UI Framework ReferenceAuWidgetImageCarousel

Class: AuWidgetImageCarousel

A widget that is used to display multiple images arranged as an image carousel.

For details, you can refer to the ImageCarousel widget topic.

{
  "widgets": [
    {
      "name": "images",
      "type": "image-carousel",
      "params": {
        "images": [
          {
            "title": "Front Side",
            "url": "http://example.com/some/url/1/front.jpg"
          },
          {
            "title": "Back Side",
            "url": "http://example.com/some/url/1/back.jpg"
          }
        ]
      }
    }
  ]
}

Hierarchy

AuBaseWidget

AuWidgetImageCarousel

Implements

Index

Properties

Methods

Properties

currentImageTitle

currentImageTitle: string = ""

Defined in src/widgets/au-widget-image-carousel/au-widget-image-carousel.ts:81

The title of the current image.


images

images: Array‹IImage = []

Defined in src/widgets/au-widget-image-carousel/au-widget-image-carousel.ts:52

An array of images displayed in the widget.


imagesCount

imagesCount: number = 0

Defined in src/widgets/au-widget-image-carousel/au-widget-image-carousel.ts:61

The number of images displayed in the widget.


params

params: IImageCarouselConfig

Overrides AuBaseWidget.params

Defined in src/widgets/au-widget-image-carousel/au-widget-image-carousel.ts:46

Properties of the widget.


paramsRaw

paramsRaw: any

Inherited from AuBaseWidget.paramsRaw

Defined in src/widgets/widget/AuBaseWidget.ts:53

Uncompiled widget configuration.

Methods

addCustomStyles

addCustomStyles(params: any): void

Inherited from AuBaseWidget.addCustomStyles

Defined in src/widgets/widget/AuBaseWidget.ts:352

Applies new styles to a widget.

Parameters:

Name Type
params any

Returns:void


backImage

backImage(): void

Defined in src/widgets/au-widget-image-carousel/au-widget-image-carousel.ts:316

go to previous image

Returns:void


compile

compile(additionalParam: any): Promise‹any›

Inherited from AuBaseWidget.compile

Defined in src/widgets/widget/AuBaseWidget.ts:185

Compiles the widget config.

"steps": [{
  "name": "card-size",
  "title": "Step 1. Card Options",
  "description": "Choose a card size.",
  "toolPanel": {
    "name": "options"
  },
  "onActivate": [
    "{{#function $['logo'].compile() }}"
  ]
},
...

Parameters:

Name Type Default Description
additionalParam any Parameters for widget config compilation.

Returns:Promise‹any›

The compiled widget configuration.


emitChange

emitChange(data: any, forceRecompile: boolean): void

Inherited from AuBaseWidget.emitChange

Defined in src/widgets/widget/AuBaseWidget.ts:161

Sends a message about the widget state changes.

"steps": [{
  "name": "card-size",
  "title": "Step 1. Card Options",
  "description": "Choose a card size.",
  "toolPanel": {
    "name": "options"
  },
  "onActivate": [
    "{{#function $['options'].emitChange()}}"
  ]
},
...

Parameters:

Name Type Default Description
data any Data for updating the widget.
forceRecompile boolean false If true, runs widget recompilation to apply the updated parameters.

Returns:void


exportWidgetData

exportWidgetData(force: boolean): Promise‹ImageCarouselData›

Implementation of IRestorableWidget

Defined in src/widgets/au-widget-image-carousel/au-widget-image-carousel.ts:193

Parameters:

Name Type
force boolean

Returns:Promise‹ImageCarouselData›


nextImage

nextImage(): void

Defined in src/widgets/au-widget-image-carousel/au-widget-image-carousel.ts:309

go to next image

Returns:void


restoreWidgetFromData

restoreWidgetFromData(widgetData: ImageCarouselData, force: boolean): Promise‹void›

Defined in src/widgets/au-widget-image-carousel/au-widget-image-carousel.ts:197

Parameters:

Name Type
widgetData ImageCarouselData
force boolean

Returns:Promise‹void›


selectImage

selectImage(index: number): void

Defined in src/widgets/au-widget-image-carousel/au-widget-image-carousel.ts:406

select image by index

Parameters:

Name Type Description
index number

Returns:void


showPreloader

showPreloader(isPreload: boolean, message: string): void

Inherited from AuBaseWidget.showPreloader

Defined in src/widgets/widget/AuBaseWidget.ts:250

Shows a preloader.

"onClick": [
  "{{#function main.showPreloader(true, 'Creating print files...')}}",
  "{{#function $['editor'].getHiResImages(800,800)}}",
  "{{#function main.showPreloader(false)}}"
]

Parameters:

Name Type Default Description
isPreload boolean - If true, enables the preloader.
message string undefined A text message that appears next to the preloader.

Returns:void


showToast

showToast(data?: string, duration?: number): void

Inherited from AuBaseWidget.showToast

Defined in src/widgets/widget/AuBaseWidget.ts:514

Shows a toast.

return editor.loadUserInfo(data)
    .catch(err => {
        this.widget.showToast("Error: Invalid data");
        console.log(err);
    });

Parameters:

Name Type Description
data? string A string message to display in the toast.
duration? number Defines how long to show the toast for.

Returns:void