@inappstory/slide-api 0.0.28 → 0.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +73 -46
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +73 -46
- package/dist/index.js.map +1 -1
- package/package.json +1 -4
package/dist/index.d.cts
CHANGED
|
@@ -6,6 +6,7 @@ declare const enum CARD_TYPE {
|
|
|
6
6
|
}
|
|
7
7
|
type WidgetRangeSliderOptions = WidgetOptionsBase & {
|
|
8
8
|
rangeClass: string;
|
|
9
|
+
rangeBackgroundClass: string;
|
|
9
10
|
activeClass: string;
|
|
10
11
|
horizontalClass: string;
|
|
11
12
|
verticalClass: string;
|
|
@@ -41,6 +42,7 @@ declare class WidgetRangeSlider extends WidgetBase<WidgetRangeSliderOptions> {
|
|
|
41
42
|
private fill;
|
|
42
43
|
private readonly handle;
|
|
43
44
|
private readonly range;
|
|
45
|
+
private readonly rangeBgView;
|
|
44
46
|
private readonly DIMENSION;
|
|
45
47
|
private readonly DIRECTION;
|
|
46
48
|
private DIRECTION_STYLE;
|
|
@@ -936,7 +938,6 @@ declare class WidgetBase<WidgetOptions extends WidgetOptionsBase> {
|
|
|
936
938
|
protected showWidgetCompleteToast: boolean;
|
|
937
939
|
protected submitButtonAnimatedView: HTMLElement | null;
|
|
938
940
|
protected submitButtonView: HTMLElement | null;
|
|
939
|
-
protected submitButtonViewHeight: number;
|
|
940
941
|
protected savedData: Record<string, any> | null;
|
|
941
942
|
protected localData: Record<string, any>;
|
|
942
943
|
protected firstOpenTime: number;
|
|
@@ -944,6 +945,7 @@ declare class WidgetBase<WidgetOptions extends WidgetOptionsBase> {
|
|
|
944
945
|
startReadyPromise: Promise<void>;
|
|
945
946
|
private startReadyResolve;
|
|
946
947
|
constructor(element: HTMLElement, options: Partial<WidgetOptions>, elementIdGetter?: (element: HTMLElement) => string, slideGetter?: (element: HTMLElement) => HTMLElement);
|
|
948
|
+
protected get submitButtonViewHeight(): number;
|
|
947
949
|
private resetStartReadyPromise;
|
|
948
950
|
/**
|
|
949
951
|
* Start or restart widget
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ declare const enum CARD_TYPE {
|
|
|
6
6
|
}
|
|
7
7
|
type WidgetRangeSliderOptions = WidgetOptionsBase & {
|
|
8
8
|
rangeClass: string;
|
|
9
|
+
rangeBackgroundClass: string;
|
|
9
10
|
activeClass: string;
|
|
10
11
|
horizontalClass: string;
|
|
11
12
|
verticalClass: string;
|
|
@@ -41,6 +42,7 @@ declare class WidgetRangeSlider extends WidgetBase<WidgetRangeSliderOptions> {
|
|
|
41
42
|
private fill;
|
|
42
43
|
private readonly handle;
|
|
43
44
|
private readonly range;
|
|
45
|
+
private readonly rangeBgView;
|
|
44
46
|
private readonly DIMENSION;
|
|
45
47
|
private readonly DIRECTION;
|
|
46
48
|
private DIRECTION_STYLE;
|
|
@@ -936,7 +938,6 @@ declare class WidgetBase<WidgetOptions extends WidgetOptionsBase> {
|
|
|
936
938
|
protected showWidgetCompleteToast: boolean;
|
|
937
939
|
protected submitButtonAnimatedView: HTMLElement | null;
|
|
938
940
|
protected submitButtonView: HTMLElement | null;
|
|
939
|
-
protected submitButtonViewHeight: number;
|
|
940
941
|
protected savedData: Record<string, any> | null;
|
|
941
942
|
protected localData: Record<string, any>;
|
|
942
943
|
protected firstOpenTime: number;
|
|
@@ -944,6 +945,7 @@ declare class WidgetBase<WidgetOptions extends WidgetOptionsBase> {
|
|
|
944
945
|
startReadyPromise: Promise<void>;
|
|
945
946
|
private startReadyResolve;
|
|
946
947
|
constructor(element: HTMLElement, options: Partial<WidgetOptions>, elementIdGetter?: (element: HTMLElement) => string, slideGetter?: (element: HTMLElement) => HTMLElement);
|
|
948
|
+
protected get submitButtonViewHeight(): number;
|
|
947
949
|
private resetStartReadyPromise;
|
|
948
950
|
/**
|
|
949
951
|
* Start or restart widget
|
package/dist/index.js
CHANGED
|
@@ -1234,7 +1234,6 @@ class WidgetBase {
|
|
|
1234
1234
|
showWidgetCompleteToast = null;
|
|
1235
1235
|
submitButtonAnimatedView = null;
|
|
1236
1236
|
submitButtonView = null;
|
|
1237
|
-
submitButtonViewHeight = 0;
|
|
1238
1237
|
savedData = null;
|
|
1239
1238
|
localData = null;
|
|
1240
1239
|
firstOpenTime = 0;
|
|
@@ -1283,9 +1282,6 @@ class WidgetBase {
|
|
|
1283
1282
|
this.submitButtonAnimatedView = this.element.querySelector(".submit-button-animated-view");
|
|
1284
1283
|
if (this.submitButtonAnimatedView != null) {
|
|
1285
1284
|
this.submitButtonView = this.submitButtonAnimatedView.querySelector(".submit-button-view");
|
|
1286
|
-
if (this.submitButtonView != null) {
|
|
1287
|
-
this.submitButtonViewHeight = this.submitButtonView.clientHeight;
|
|
1288
|
-
}
|
|
1289
1285
|
}
|
|
1290
1286
|
}
|
|
1291
1287
|
this.savedData = this.sdkApi.getCardServerData(this.cardId);
|
|
@@ -1294,6 +1290,12 @@ class WidgetBase {
|
|
|
1294
1290
|
++WidgetBase.widgetIndex;
|
|
1295
1291
|
this.resetStartReadyPromise();
|
|
1296
1292
|
}
|
|
1293
|
+
get submitButtonViewHeight() {
|
|
1294
|
+
if (this.submitButtonView != null) {
|
|
1295
|
+
return this.submitButtonView.clientHeight;
|
|
1296
|
+
}
|
|
1297
|
+
return 0;
|
|
1298
|
+
}
|
|
1297
1299
|
resetStartReadyPromise() {
|
|
1298
1300
|
this.startReadyPromise = new Promise(resolve => {
|
|
1299
1301
|
this.startReadyResolve = resolve;
|
|
@@ -1795,8 +1797,9 @@ class WidgetCopy extends WidgetBase {
|
|
|
1795
1797
|
initWidget: function (nodeList, localData) {
|
|
1796
1798
|
// prevent initWidget for result layer
|
|
1797
1799
|
const elements = slice.call(nodeList).filter(element => !element.classList.contains("narrative-element-copy-result-variant"));
|
|
1798
|
-
WidgetCopy.initWidgets((element, options) => new WidgetCopy(element, options), elements, localData)
|
|
1799
|
-
|
|
1800
|
+
WidgetCopy.initWidgets((element, options) => new WidgetCopy(element, options), elements, localData).then(() => {
|
|
1801
|
+
elements.forEach(element => WidgetCopy.getInstance(element)?.onStart());
|
|
1802
|
+
});
|
|
1800
1803
|
},
|
|
1801
1804
|
onStart: function (element) {
|
|
1802
1805
|
WidgetCopy.getInstance(element)?.onStart();
|
|
@@ -2001,8 +2004,9 @@ class WidgetDataInput extends WidgetBase {
|
|
|
2001
2004
|
/** @deprecated */
|
|
2002
2005
|
initWidget: function (nodeList, localData) {
|
|
2003
2006
|
const elements = slice.call(nodeList);
|
|
2004
|
-
WidgetDataInput.initWidgets((element, options) => new WidgetDataInput(element, options), slice.call(nodeList), localData)
|
|
2005
|
-
|
|
2007
|
+
WidgetDataInput.initWidgets((element, options) => new WidgetDataInput(element, options), slice.call(nodeList), localData).then(() => {
|
|
2008
|
+
elements.forEach(element => WidgetDataInput.getInstance(element)?.onStart());
|
|
2009
|
+
});
|
|
2006
2010
|
},
|
|
2007
2011
|
onStart: function (element) {
|
|
2008
2012
|
WidgetDataInput.getInstance(element)?.onStart();
|
|
@@ -2239,8 +2243,9 @@ class WidgetDateCountdown extends WidgetBase {
|
|
|
2239
2243
|
/** @deprecated */
|
|
2240
2244
|
initWidget: function (nodeList, layers, localData) {
|
|
2241
2245
|
const elements = slice.call(nodeList);
|
|
2242
|
-
WidgetDateCountdown.initWidgets((element, options) => new WidgetDateCountdown(element, { ...options, layers }), elements, localData)
|
|
2243
|
-
|
|
2246
|
+
WidgetDateCountdown.initWidgets((element, options) => new WidgetDateCountdown(element, { ...options, layers }), elements, localData).then(() => {
|
|
2247
|
+
elements.forEach(element => WidgetDateCountdown.getInstance(element)?.onStart());
|
|
2248
|
+
});
|
|
2244
2249
|
},
|
|
2245
2250
|
onStart: function (element) {
|
|
2246
2251
|
WidgetDateCountdown.getInstance(element)?.onStart();
|
|
@@ -2888,8 +2893,9 @@ class WidgetPoll extends WidgetBase {
|
|
|
2888
2893
|
},
|
|
2889
2894
|
/** @deprecated */
|
|
2890
2895
|
initWidget: function (element, localData) {
|
|
2891
|
-
WidgetPoll.initWidgets((element, options) => new WidgetPoll(element, options), [element], localData)
|
|
2892
|
-
|
|
2896
|
+
WidgetPoll.initWidgets((element, options) => new WidgetPoll(element, options), [element], localData).then(() => {
|
|
2897
|
+
WidgetPoll.getInstance(element)?.onStart();
|
|
2898
|
+
});
|
|
2893
2899
|
},
|
|
2894
2900
|
onStart: function (element) {
|
|
2895
2901
|
WidgetPoll.getInstance(element)?.onStart();
|
|
@@ -3083,8 +3089,9 @@ class WidgetPollLayers extends WidgetBase {
|
|
|
3083
3089
|
layers = localData;
|
|
3084
3090
|
localData = undefined;
|
|
3085
3091
|
}
|
|
3086
|
-
WidgetPollLayers.initWidgets((element, options) => new WidgetPollLayers(element, { ...options, layers }), [element], localData)
|
|
3087
|
-
|
|
3092
|
+
WidgetPollLayers.initWidgets((element, options) => new WidgetPollLayers(element, { ...options, layers }), [element], localData).then(() => {
|
|
3093
|
+
WidgetPollLayers.getInstance(element)?.onStart();
|
|
3094
|
+
});
|
|
3088
3095
|
},
|
|
3089
3096
|
onStart: function (element) {
|
|
3090
3097
|
WidgetPollLayers.getInstance(element)?.onStart();
|
|
@@ -3401,13 +3408,14 @@ class WidgetQuest extends WidgetBase {
|
|
|
3401
3408
|
WidgetQuest.initWidgets((element, options) => new WidgetQuest(element, options), [element], localData).then(localData => {
|
|
3402
3409
|
const widget = WidgetQuest.getInstance(element);
|
|
3403
3410
|
if (widget) {
|
|
3404
|
-
|
|
3411
|
+
const result = widget.init();
|
|
3412
|
+
widget.onStart();
|
|
3413
|
+
resolve(result);
|
|
3405
3414
|
}
|
|
3406
3415
|
else {
|
|
3407
3416
|
resolve(true);
|
|
3408
3417
|
}
|
|
3409
3418
|
});
|
|
3410
|
-
WidgetQuest.getInstance(element)?.onStart();
|
|
3411
3419
|
});
|
|
3412
3420
|
},
|
|
3413
3421
|
onStart: function (element) {
|
|
@@ -3498,7 +3506,7 @@ class WidgetQuiz extends WidgetBase {
|
|
|
3498
3506
|
this.localData["_q_g_" + this.elementId + "_sa"] = index;
|
|
3499
3507
|
this.element.classList.add("done");
|
|
3500
3508
|
this.env.requestAnimationFrame(() => {
|
|
3501
|
-
if (this.submitButtonAnimatedView != null
|
|
3509
|
+
if (this.submitButtonAnimatedView != null) {
|
|
3502
3510
|
this.submitButtonAnimatedView.style.maxHeight = `${this.submitButtonViewHeight}px`;
|
|
3503
3511
|
}
|
|
3504
3512
|
});
|
|
@@ -3611,8 +3619,9 @@ class WidgetQuiz extends WidgetBase {
|
|
|
3611
3619
|
},
|
|
3612
3620
|
/** @deprecated */
|
|
3613
3621
|
initWidget: function (element, localData) {
|
|
3614
|
-
WidgetQuiz.initWidgets((element, options) => new WidgetQuiz(element, options), [element], localData)
|
|
3615
|
-
|
|
3622
|
+
WidgetQuiz.initWidgets((element, options) => new WidgetQuiz(element, options), [element], localData).then(() => {
|
|
3623
|
+
WidgetQuiz.getInstance(element)?.onStart();
|
|
3624
|
+
});
|
|
3616
3625
|
},
|
|
3617
3626
|
onStart: function (element) {
|
|
3618
3627
|
WidgetQuiz.getInstance(element)?.onStart();
|
|
@@ -3698,8 +3707,8 @@ class WidgetQuizGrouped extends WidgetBase {
|
|
|
3698
3707
|
this.localData["_q_gg_" + this.elementId + "_sa"] = index;
|
|
3699
3708
|
this.element.classList.add("done");
|
|
3700
3709
|
this.env.requestAnimationFrame(() => {
|
|
3701
|
-
if (this.submitButtonAnimatedView != null
|
|
3702
|
-
this.submitButtonAnimatedView.style.maxHeight = this.submitButtonViewHeight
|
|
3710
|
+
if (this.submitButtonAnimatedView != null) {
|
|
3711
|
+
this.submitButtonAnimatedView.style.maxHeight = `${this.submitButtonViewHeight}px`;
|
|
3703
3712
|
}
|
|
3704
3713
|
});
|
|
3705
3714
|
this.startReadyPromise.then(() => {
|
|
@@ -3821,8 +3830,9 @@ class WidgetQuizGrouped extends WidgetBase {
|
|
|
3821
3830
|
},
|
|
3822
3831
|
/** @deprecated */
|
|
3823
3832
|
initWidget: function (element, localData) {
|
|
3824
|
-
WidgetQuizGrouped.initWidgets((element, options) => new WidgetQuizGrouped(element, options), [element], localData)
|
|
3825
|
-
|
|
3833
|
+
WidgetQuizGrouped.initWidgets((element, options) => new WidgetQuizGrouped(element, options), [element], localData).then(() => {
|
|
3834
|
+
WidgetQuizGrouped.getInstance(element)?.onStart();
|
|
3835
|
+
});
|
|
3826
3836
|
},
|
|
3827
3837
|
onStart: function (element) {
|
|
3828
3838
|
WidgetQuizGrouped.getInstance(element)?.onStart();
|
|
@@ -3979,6 +3989,7 @@ class WidgetRangeSlider extends WidgetBase {
|
|
|
3979
3989
|
create: false,
|
|
3980
3990
|
localData: {},
|
|
3981
3991
|
rangeClass: "slider-view",
|
|
3992
|
+
rangeBackgroundClass: "slider-background-view",
|
|
3982
3993
|
activeClass: "rangeslider--active",
|
|
3983
3994
|
horizontalClass: "rangeslider--horizontal",
|
|
3984
3995
|
verticalClass: "rangeslider--vertical",
|
|
@@ -4004,6 +4015,7 @@ class WidgetRangeSlider extends WidgetBase {
|
|
|
4004
4015
|
fill;
|
|
4005
4016
|
handle;
|
|
4006
4017
|
range;
|
|
4018
|
+
rangeBgView;
|
|
4007
4019
|
DIMENSION;
|
|
4008
4020
|
DIRECTION;
|
|
4009
4021
|
DIRECTION_STYLE;
|
|
@@ -4046,11 +4058,14 @@ class WidgetRangeSlider extends WidgetBase {
|
|
|
4046
4058
|
this.handle = getValueOrException(this.element.querySelector(`.${this.options.handleClass}`), `Empty .${this.options.handleClass}`);
|
|
4047
4059
|
this.range = getValueOrException(this.element.querySelector(`.${this.options.rangeClass}`), `Empty .${this.options.rangeClass}`);
|
|
4048
4060
|
this.range.id = this.id;
|
|
4061
|
+
this.rangeBgView = getValueOrException(this.element.querySelector(`.${this.options.rangeBackgroundClass}`), `Empty .${this.options.rangeBackgroundClass}`);
|
|
4049
4062
|
// if (this.range.classList.contains(this.options['horizontalClass'])) {
|
|
4050
4063
|
this.orientation = "horizontal";
|
|
4051
4064
|
// } else if (this.range.classList.contains(this.options['verticalClass'])) {
|
|
4052
4065
|
// this.orientation = 'vertical';
|
|
4053
4066
|
// }
|
|
4067
|
+
// enable expanded tap area (disabled by default for backward compatibility)
|
|
4068
|
+
this.element.classList.add("width-expanded-slider-tap-area");
|
|
4054
4069
|
this.DIMENSION = constants.orientation[this.orientation].dimension;
|
|
4055
4070
|
this.DIRECTION = constants.orientation[this.orientation].direction;
|
|
4056
4071
|
this.DIRECTION_STYLE = constants.orientation[this.orientation].directionStyle[this.layoutDirection];
|
|
@@ -4253,8 +4268,9 @@ class WidgetRangeSlider extends WidgetBase {
|
|
|
4253
4268
|
this.step = tryParseFloat(this.elementSlider.getAttribute("step"), 1);
|
|
4254
4269
|
}
|
|
4255
4270
|
this.handleDimension = getDimension(this.handle, ("offset" + ucfirst(this.DIMENSION)));
|
|
4256
|
-
this.rangeDimension = getDimension(this.
|
|
4257
|
-
this.maxHandlePos = this.rangeDimension - this.handleDimension;
|
|
4271
|
+
this.rangeDimension = getDimension(this.rangeBgView, ("offset" + ucfirst(this.DIMENSION)));
|
|
4272
|
+
// this.maxHandlePos = this.rangeDimension - this.handleDimension;
|
|
4273
|
+
this.maxHandlePos = this.rangeDimension;
|
|
4258
4274
|
this.grabPos = this.handleDimension / 2;
|
|
4259
4275
|
this.position = this.getPositionFromValue(this.value);
|
|
4260
4276
|
if (updateAttributes) {
|
|
@@ -4293,7 +4309,7 @@ class WidgetRangeSlider extends WidgetBase {
|
|
|
4293
4309
|
if ((" " + e.target.className + " ").replace(/[\n\t]/g, " ").indexOf(this.options.handleClass) > -1) {
|
|
4294
4310
|
return;
|
|
4295
4311
|
}
|
|
4296
|
-
const pos = this.getRelativePosition(e), rangePos = this.
|
|
4312
|
+
const pos = this.getRelativePosition(e), rangePos = this.rangeBgView.getBoundingClientRect()[this.DIRECTION], handlePos = this.getPositionFromNode(this.handle) - rangePos, setPos = this.orientation === "vertical" ? this.maxHandlePos - (pos - this.grabPos) : pos - this.grabPos;
|
|
4297
4313
|
this.setPosition(setPos);
|
|
4298
4314
|
if (pos >= handlePos && pos < handlePos + this.handleDimension) {
|
|
4299
4315
|
this.grabPos = pos - handlePos;
|
|
@@ -4321,8 +4337,8 @@ class WidgetRangeSlider extends WidgetBase {
|
|
|
4321
4337
|
}
|
|
4322
4338
|
else {
|
|
4323
4339
|
this.env.requestAnimationFrame(() => {
|
|
4324
|
-
if (this.submitButtonAnimatedView != null
|
|
4325
|
-
this.submitButtonAnimatedView.style.maxHeight = this.submitButtonViewHeight
|
|
4340
|
+
if (this.submitButtonAnimatedView != null) {
|
|
4341
|
+
this.submitButtonAnimatedView.style.maxHeight = `${this.submitButtonViewHeight}px`;
|
|
4326
4342
|
}
|
|
4327
4343
|
});
|
|
4328
4344
|
}
|
|
@@ -4350,11 +4366,14 @@ class WidgetRangeSlider extends WidgetBase {
|
|
|
4350
4366
|
uiPos = this.maxHandlePos - uiPos;
|
|
4351
4367
|
}
|
|
4352
4368
|
// this.rangeDimension - slider width
|
|
4353
|
-
this.fill.style.transform = "translateX(" + (uiPos
|
|
4369
|
+
this.fill.style.transform = "translateX(" + (uiPos - this.rangeDimension) + "px)";
|
|
4370
|
+
// this.fill.style.transform = "translateX(" + (uiPos + this.grabPos - this.rangeDimension) + "px)";
|
|
4354
4371
|
// this.fill.style[this.DIMENSION] = (uiPos + this.grabPos) + 'px';
|
|
4355
4372
|
const percentage = this.getPercentageFromValue(value);
|
|
4356
4373
|
// 1 + (scale - 1) * percentage
|
|
4357
|
-
this.handle.style.
|
|
4374
|
+
this.handle.style.setProperty("--offset", String(uiPos));
|
|
4375
|
+
this.handle.style.setProperty("--percentage", String(percentage));
|
|
4376
|
+
// this.handle.style.transform = "translateY(-50%) translateX(" + uiPos + "px) scale(calc(1 + (var(--scale-factor, 1) - 1) * " + percentage + "))";
|
|
4358
4377
|
// this.handle.style[this.DIRECTION_STYLE] = uiPos + 'px';
|
|
4359
4378
|
this.setValue(value);
|
|
4360
4379
|
// Update globals
|
|
@@ -4465,8 +4484,9 @@ class WidgetRangeSlider extends WidgetBase {
|
|
|
4465
4484
|
},
|
|
4466
4485
|
/** @deprecated */
|
|
4467
4486
|
initWidget: function (element, localData) {
|
|
4468
|
-
WidgetRangeSlider.initWidgets((element, options) => new WidgetRangeSlider(element, options), [element], localData)
|
|
4469
|
-
|
|
4487
|
+
WidgetRangeSlider.initWidgets((element, options) => new WidgetRangeSlider(element, options), [element], localData).then(() => {
|
|
4488
|
+
WidgetRangeSlider.getInstance(element)?.onStart();
|
|
4489
|
+
});
|
|
4470
4490
|
},
|
|
4471
4491
|
onStart: function (element) {
|
|
4472
4492
|
WidgetRangeSlider.getInstance(element)?.onStart();
|
|
@@ -4730,8 +4750,9 @@ class WidgetRate extends WidgetBase {
|
|
|
4730
4750
|
/** @deprecated */
|
|
4731
4751
|
initWidget: function (nodeList, localData) {
|
|
4732
4752
|
const elements = slice.call(nodeList);
|
|
4733
|
-
WidgetRate.initWidgets((element, options) => new WidgetRate(element, options), elements, localData)
|
|
4734
|
-
|
|
4753
|
+
WidgetRate.initWidgets((element, options) => new WidgetRate(element, options), elements, localData).then(() => {
|
|
4754
|
+
elements.forEach(element => WidgetRate.getInstance(element)?.onStart());
|
|
4755
|
+
});
|
|
4735
4756
|
},
|
|
4736
4757
|
onStart: function (element) {
|
|
4737
4758
|
WidgetRate.getInstance(element)?.onStart();
|
|
@@ -4891,8 +4912,9 @@ class WidgetShare extends WidgetBase {
|
|
|
4891
4912
|
localData = undefined;
|
|
4892
4913
|
}
|
|
4893
4914
|
const elements = slice.call(nodeList);
|
|
4894
|
-
WidgetShare.initWidgets((element, options) => new WidgetShare(element, { ...options, layers }), elements, localData)
|
|
4895
|
-
|
|
4915
|
+
WidgetShare.initWidgets((element, options) => new WidgetShare(element, { ...options, layers }), elements, localData).then(() => {
|
|
4916
|
+
elements.forEach(element => WidgetShare.getInstance(element)?.onStart());
|
|
4917
|
+
});
|
|
4896
4918
|
},
|
|
4897
4919
|
onStart: function (element) {
|
|
4898
4920
|
WidgetShare.getInstance(element)?.onStart();
|
|
@@ -5088,8 +5110,8 @@ class WidgetTest extends WidgetBase {
|
|
|
5088
5110
|
this.localData["_t_g_" + this.elementId + "_sa"] = index;
|
|
5089
5111
|
this.element.classList.add("done");
|
|
5090
5112
|
this.env.requestAnimationFrame(() => {
|
|
5091
|
-
if (this.submitButtonAnimatedView != null
|
|
5092
|
-
this.submitButtonAnimatedView.style.maxHeight = this.submitButtonViewHeight
|
|
5113
|
+
if (this.submitButtonAnimatedView != null) {
|
|
5114
|
+
this.submitButtonAnimatedView.style.maxHeight = `${this.submitButtonViewHeight}px`;
|
|
5093
5115
|
}
|
|
5094
5116
|
});
|
|
5095
5117
|
this.startReadyPromise.then(() => {
|
|
@@ -5174,8 +5196,9 @@ class WidgetTest extends WidgetBase {
|
|
|
5174
5196
|
},
|
|
5175
5197
|
/** @deprecated */
|
|
5176
5198
|
initWidget: function (element, localData) {
|
|
5177
|
-
WidgetTest.initWidgets((element, options) => new WidgetTest(element, options), [element], localData)
|
|
5178
|
-
|
|
5199
|
+
WidgetTest.initWidgets((element, options) => new WidgetTest(element, options), [element], localData).then(() => {
|
|
5200
|
+
WidgetTest.getInstance(element)?.onStart();
|
|
5201
|
+
});
|
|
5179
5202
|
},
|
|
5180
5203
|
onStart: function (element) {
|
|
5181
5204
|
WidgetTest.getInstance(element)?.onStart();
|
|
@@ -5429,8 +5452,8 @@ class WidgetVote extends WidgetBase {
|
|
|
5429
5452
|
}
|
|
5430
5453
|
_showSubmitBtn() {
|
|
5431
5454
|
this.env.requestAnimationFrame(() => {
|
|
5432
|
-
if (this.submitButtonAnimatedView != null
|
|
5433
|
-
this.submitButtonAnimatedView.style.maxHeight = this.submitButtonViewHeight
|
|
5455
|
+
if (this.submitButtonAnimatedView != null) {
|
|
5456
|
+
this.submitButtonAnimatedView.style.maxHeight = `${this.submitButtonViewHeight}px`;
|
|
5434
5457
|
}
|
|
5435
5458
|
});
|
|
5436
5459
|
}
|
|
@@ -5653,10 +5676,13 @@ class WidgetVote extends WidgetBase {
|
|
|
5653
5676
|
},
|
|
5654
5677
|
/** @deprecated */
|
|
5655
5678
|
initWidget: function (element, localData) {
|
|
5656
|
-
WidgetVote.initWidgets((element, options) => new WidgetVote(element, options), [element], localData)
|
|
5679
|
+
WidgetVote.initWidgets((element, options) => new WidgetVote(element, options), [element], localData)
|
|
5680
|
+
.then(localData => {
|
|
5657
5681
|
WidgetVote.api.fallbackInitOnMultiSlide(element, localData);
|
|
5682
|
+
})
|
|
5683
|
+
.then(() => {
|
|
5684
|
+
WidgetVote.getInstance(element)?.onStart();
|
|
5658
5685
|
});
|
|
5659
|
-
WidgetVote.getInstance(element)?.onStart();
|
|
5660
5686
|
},
|
|
5661
5687
|
onStart: function (element) {
|
|
5662
5688
|
WidgetVote.getInstance(element)?.onStart();
|
|
@@ -15329,8 +15355,9 @@ class WidgetBarcode extends WidgetBase {
|
|
|
15329
15355
|
/** @deprecated */
|
|
15330
15356
|
initWidget: function (nodeList, localData) {
|
|
15331
15357
|
const elements = slice.call(nodeList);
|
|
15332
|
-
WidgetBarcode.initWidgets((element, options) => new WidgetBarcode(element, options), elements, localData)
|
|
15333
|
-
|
|
15358
|
+
WidgetBarcode.initWidgets((element, options) => new WidgetBarcode(element, options), elements, localData).then(() => {
|
|
15359
|
+
elements.forEach(element => WidgetBarcode.getInstance(element)?.onStart());
|
|
15360
|
+
});
|
|
15334
15361
|
},
|
|
15335
15362
|
onStart: function (element) {
|
|
15336
15363
|
WidgetBarcode.getInstance(element)?.onStart();
|