@useinsider/guido 1.0.3-beta.cdff8ce → 1.0.3-beta.ce3ed00
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/README.md +32 -6
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +73 -79
- package/dist/components/organisms/LoadingWrapper.vue.js +1 -1
- package/dist/components/organisms/header/RightSlot.vue.js +1 -1
- package/dist/components/organisms/header/RightSlot.vue2.js +20 -21
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +18 -20
- package/dist/composables/useActionsApi.js +1 -1
- package/dist/composables/useGuidoActions.js +9 -19
- package/dist/composables/useHtmlCompiler.js +13 -15
- package/dist/composables/useHtmlValidator.js +35 -36
- package/dist/composables/useStripo.js +41 -47
- package/dist/config/compiler/unsubscribeCompilerRules.js +28 -33
- package/dist/enums/defaults.js +1 -2
- package/dist/enums/onboarding.js +3 -7
- package/dist/enums/unsubscribe.js +25 -27
- package/dist/extensions/Blocks/Checkbox/control.js +14 -15
- package/dist/extensions/Blocks/Checkbox/template.js +9 -14
- package/dist/extensions/Blocks/Items/block.js +43 -40
- package/dist/extensions/Blocks/Items/controls/button/link.js +17 -25
- package/dist/extensions/Blocks/Items/controls/cardComposition.js +57 -151
- package/dist/extensions/Blocks/Items/controls/image/link.js +20 -28
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +22 -29
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +18 -25
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +8 -18
- package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +30 -37
- package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +14 -37
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +130 -167
- package/dist/extensions/Blocks/Items/enums/controlEnums.js +2 -2
- package/dist/extensions/Blocks/Items/enums/productEnums.js +5 -98
- package/dist/extensions/Blocks/Items/enums/settingsEnums.js +7 -21
- package/dist/extensions/Blocks/Items/extension.js +8 -9
- package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +59 -57
- package/dist/extensions/Blocks/Items/layouts/vertical.html.js +61 -67
- package/dist/extensions/Blocks/Items/settingsPanel.js +43 -69
- package/dist/extensions/Blocks/Items/store/items-block.js +4 -12
- package/dist/extensions/Blocks/Items/template.js +63 -150
- package/dist/extensions/Blocks/RadioButton/control.js +17 -18
- package/dist/extensions/Blocks/RadioButton/template.js +9 -18
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +1 -1
- package/dist/extensions/Blocks/Unsubscribe/block.js +41 -45
- package/dist/extensions/Blocks/common-control.js +125 -164
- package/dist/extensions/DynamicContent/dynamic-content-modal.js +19 -25
- package/dist/extensions/DynamicContent/dynamic-content.js +33 -128
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +2 -12
- package/dist/node_modules/lodash-es/_arrayLikeKeys.js +12 -13
- package/dist/node_modules/lodash-es/keysIn.js +3 -3
- package/dist/package.json.js +1 -1
- package/dist/src/@types/generic.d.ts +6 -27
- package/dist/src/components/Guido.vue.d.ts +2 -3
- package/dist/src/composables/useGuidoActions.d.ts +0 -9
- package/dist/src/enums/onboarding.d.ts +0 -4
- package/dist/src/extensions/Blocks/Checkbox/template.d.ts +1 -1
- package/dist/src/extensions/Blocks/Items/block.d.ts +0 -15
- package/dist/src/extensions/Blocks/Items/controls/cardComposition.d.ts +7 -20
- package/dist/src/extensions/Blocks/Items/controls/price/currencySymbol.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/controls/price/hideDiscount.d.ts +1 -5
- package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +2 -8
- package/dist/src/extensions/Blocks/Items/enums/controlEnums.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +0 -20
- package/dist/src/extensions/Blocks/Items/enums/settingsEnums.d.ts +0 -15
- package/dist/src/extensions/Blocks/Items/store/items-block.d.ts +1 -5
- package/dist/src/extensions/Blocks/Items/template.d.ts +1 -9
- package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -1
- package/dist/src/extensions/Blocks/Unsubscribe/block.d.ts +4 -3
- package/dist/src/extensions/Blocks/common-control.d.ts +2 -25
- package/dist/src/extensions/DynamicContent/dynamic-content-modal.d.ts +2 -9
- package/dist/src/extensions/DynamicContent/dynamic-content.d.ts +2 -52
- package/dist/src/stores/config.d.ts +2 -3
- package/dist/src/stores/dynamic-content.d.ts +3 -3
- package/dist/src/stores/editor.d.ts +1 -1
- package/dist/src/stores/onboarding.d.ts +1 -335
- package/dist/src/stores/preview.d.ts +1 -1
- package/dist/src/stores/recommendation.d.ts +1 -1
- package/dist/src/stores/save-as-template.d.ts +1 -1
- package/dist/src/stores/toaster.d.ts +1 -1
- package/dist/src/stores/unsubscribe.d.ts +1 -1
- package/dist/src/stores/version-history.d.ts +1 -1
- package/dist/src/utils/genericUtil.d.ts +0 -1
- package/dist/stores/config.js +5 -5
- package/dist/stores/dynamic-content.js +2 -2
- package/dist/stores/editor.js +1 -1
- package/dist/stores/onboarding.js +36 -44
- package/dist/stores/preview.js +1 -1
- package/dist/stores/recommendation.js +3 -3
- package/dist/stores/save-as-template.js +2 -2
- package/dist/stores/toaster.js +1 -1
- package/dist/stores/unsubscribe.js +1 -1
- package/dist/stores/version-history.js +4 -4
- package/dist/utils/genericUtil.js +6 -17
- package/package.json +12 -7
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +0 -21
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +0 -99
- package/dist/config/compiler/itemsCompilerRules.js +0 -14
- package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +0 -92
- package/dist/extensions/Blocks/Items/utils/configBlockUtils.js +0 -17
- package/dist/extensions/Blocks/Items/utils/syncAttributeFromConfigBlock.js +0 -28
- package/dist/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.js +0 -76
- package/dist/extensions/Blocks/Items/utils/updateAttributes.js +0 -46
- package/dist/node_modules/lodash-es/_DataView.js +0 -6
- package/dist/node_modules/lodash-es/_Promise.js +0 -6
- package/dist/node_modules/lodash-es/_Set.js +0 -6
- package/dist/node_modules/lodash-es/_SetCache.js +0 -13
- package/dist/node_modules/lodash-es/_WeakMap.js +0 -6
- package/dist/node_modules/lodash-es/_arrayFilter.js +0 -10
- package/dist/node_modules/lodash-es/_arrayMap.js +0 -8
- package/dist/node_modules/lodash-es/_arrayPush.js +0 -8
- package/dist/node_modules/lodash-es/_arraySome.js +0 -9
- package/dist/node_modules/lodash-es/_baseEach.js +0 -6
- package/dist/node_modules/lodash-es/_baseFlatten.js +0 -13
- package/dist/node_modules/lodash-es/_baseForOwn.js +0 -8
- package/dist/node_modules/lodash-es/_baseGet.js +0 -11
- package/dist/node_modules/lodash-es/_baseGetAllKeys.js +0 -9
- package/dist/node_modules/lodash-es/_baseHasIn.js +0 -6
- package/dist/node_modules/lodash-es/_baseIsEqual.js +0 -8
- package/dist/node_modules/lodash-es/_baseIsEqualDeep.js +0 -32
- package/dist/node_modules/lodash-es/_baseIsMatch.js +0 -29
- package/dist/node_modules/lodash-es/_baseIteratee.js +0 -11
- package/dist/node_modules/lodash-es/_baseKeys.js +0 -14
- package/dist/node_modules/lodash-es/_baseMap.js +0 -11
- package/dist/node_modules/lodash-es/_baseMatches.js +0 -12
- package/dist/node_modules/lodash-es/_baseMatchesProperty.js +0 -17
- package/dist/node_modules/lodash-es/_baseProperty.js +0 -8
- package/dist/node_modules/lodash-es/_basePropertyDeep.js +0 -9
- package/dist/node_modules/lodash-es/_baseRange.js +0 -9
- package/dist/node_modules/lodash-es/_baseToString.js +0 -18
- package/dist/node_modules/lodash-es/_baseTrim.js +0 -8
- package/dist/node_modules/lodash-es/_cacheHas.js +0 -6
- package/dist/node_modules/lodash-es/_castPath.js +0 -10
- package/dist/node_modules/lodash-es/_createBaseEach.js +0 -15
- package/dist/node_modules/lodash-es/_createRange.js +0 -11
- package/dist/node_modules/lodash-es/_equalArrays.js +0 -40
- package/dist/node_modules/lodash-es/_equalByTag.js +0 -45
- package/dist/node_modules/lodash-es/_equalObjects.js +0 -36
- package/dist/node_modules/lodash-es/_getAllKeys.js +0 -9
- package/dist/node_modules/lodash-es/_getMatchData.js +0 -12
- package/dist/node_modules/lodash-es/_getSymbols.js +0 -10
- package/dist/node_modules/lodash-es/_getTag.js +0 -28
- package/dist/node_modules/lodash-es/_hasPath.js +0 -19
- package/dist/node_modules/lodash-es/_isFlattenable.js +0 -10
- package/dist/node_modules/lodash-es/_isKey.js +0 -12
- package/dist/node_modules/lodash-es/_isStrictComparable.js +0 -7
- package/dist/node_modules/lodash-es/_mapToArray.js +0 -9
- package/dist/node_modules/lodash-es/_matchesStrictComparable.js +0 -8
- package/dist/node_modules/lodash-es/_memoizeCapped.js +0 -11
- package/dist/node_modules/lodash-es/_nativeKeys.js +0 -5
- package/dist/node_modules/lodash-es/_setCacheAdd.js +0 -7
- package/dist/node_modules/lodash-es/_setCacheHas.js +0 -6
- package/dist/node_modules/lodash-es/_setToArray.js +0 -9
- package/dist/node_modules/lodash-es/_stringToPath.js +0 -10
- package/dist/node_modules/lodash-es/_toKey.js +0 -10
- package/dist/node_modules/lodash-es/_trimmedEndIndex.js +0 -9
- package/dist/node_modules/lodash-es/flatMap.js +0 -8
- package/dist/node_modules/lodash-es/get.js +0 -8
- package/dist/node_modules/lodash-es/hasIn.js +0 -8
- package/dist/node_modules/lodash-es/isSymbol.js +0 -9
- package/dist/node_modules/lodash-es/keys.js +0 -9
- package/dist/node_modules/lodash-es/map.js +0 -11
- package/dist/node_modules/lodash-es/property.js +0 -10
- package/dist/node_modules/lodash-es/range.js +0 -5
- package/dist/node_modules/lodash-es/stubArray.js +0 -6
- package/dist/node_modules/lodash-es/toFinite.js +0 -14
- package/dist/node_modules/lodash-es/toNumber.js +0 -22
- package/dist/node_modules/lodash-es/toString.js +0 -7
- package/dist/src/components/organisms/onboarding/ItemsOnboarding.vue.d.ts +0 -2
- package/dist/src/config/compiler/itemsCompilerRules.d.ts +0 -2
- package/dist/src/extensions/Blocks/Items/controls/price/priceOrientation.d.ts +0 -15
- package/dist/src/extensions/Blocks/Items/utils/configBlockUtils.d.ts +0 -23
- package/dist/src/extensions/Blocks/Items/utils/syncAttributeFromConfigBlock.d.ts +0 -32
- package/dist/src/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.d.ts +0 -50
- package/dist/src/extensions/Blocks/Items/utils/updateAttributes.d.ts +0 -8
- package/dist/src/utils/environmentUtil.d.ts +0 -5
- package/dist/src/utils/pairProductVariables.d.ts +0 -7
- package/dist/utils/environmentUtil.js +0 -4
- package/dist/utils/pairProductVariables.js +0 -136
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Block as R, BlockCompositionType as L, ModificationDescription as a } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
1
|
+
import { Block as b, BlockCompositionType as E, ModificationDescription as f } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
3
2
|
import { configAttributes as t } from "./enums/productEnums.js";
|
|
4
|
-
import { DefaultConfigValues as
|
|
5
|
-
import { useItemsBlockStore as
|
|
6
|
-
import { getDefaultTemplate as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class x extends R {
|
|
3
|
+
import { DefaultConfigValues as n, SETTINGS_ENUMS as m } from "./enums/settingsEnums.js";
|
|
4
|
+
import { useItemsBlockStore as p } from "./store/items-block.js";
|
|
5
|
+
import { getDefaultTemplate as A } from "./template.js";
|
|
6
|
+
const _ = "items-block";
|
|
7
|
+
class D extends b {
|
|
10
8
|
getId() {
|
|
11
|
-
return
|
|
9
|
+
return _;
|
|
12
10
|
}
|
|
13
11
|
getIcon() {
|
|
14
12
|
return "items-icon";
|
|
15
13
|
}
|
|
16
14
|
getBlockCompositionType() {
|
|
17
|
-
return
|
|
15
|
+
return E.CONTAINER;
|
|
18
16
|
}
|
|
19
17
|
getName() {
|
|
20
18
|
return this.api.translate("Items");
|
|
@@ -23,45 +21,50 @@ class x extends R {
|
|
|
23
21
|
return this.api.translate("Items lets you display personalized products based on user behavior.");
|
|
24
22
|
}
|
|
25
23
|
getTemplate() {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
const e = p();
|
|
25
|
+
return A({
|
|
26
|
+
orientation: m.ORIENTATION.HORIZONTAL,
|
|
27
|
+
itemsType: m.ITEMS_TYPE.CART_ITEMS,
|
|
29
28
|
itemId: "{{Abandoned Cart Item (1) Url}}",
|
|
30
|
-
currencySymbol: e.
|
|
31
|
-
currencyLocation: e.
|
|
32
|
-
formattedPrice: e.
|
|
29
|
+
currencySymbol: e.currencySymbol,
|
|
30
|
+
currencyLocation: e.currencyLocation,
|
|
31
|
+
formattedPrice: e.formattedPrice
|
|
33
32
|
});
|
|
34
33
|
}
|
|
35
34
|
allowInnerBlocksDND() {
|
|
36
35
|
return !1;
|
|
37
36
|
}
|
|
38
|
-
onCreated(
|
|
39
|
-
const
|
|
40
|
-
if (!
|
|
37
|
+
onCreated(e) {
|
|
38
|
+
const r = e.querySelector("esd-config-block");
|
|
39
|
+
if (!r)
|
|
41
40
|
return;
|
|
42
|
-
const o =
|
|
43
|
-
if (
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
this.api.getDocumentModifier().modifyHtml(o).setAttribute("data-source", i).setAttribute(t.TYPE, i).setAttribute(t.ITEMS_INDEX_SELECT_CONTROL_VALUE, I).setAttribute(t.ORIENTATION, d).setAttribute(t.PRODUCT_NAME_TRIMMING, m).setAttribute(t.PRODUCT_PRICE_HIDE_DISCOUNT, C).setAttribute(t.PRODUCT_PRICE_FORMATTED, b).setAttribute(t.PRODUCT_PRICE_CURRENCY_SYMBOL, T).setAttribute(t.PRODUCT_PRICE_CURRENCY_LOCATION, A).setAttribute(t.PRODUCT_BUTTON_LINK, E).setAttribute(t.PRODUCT_IMAGE_LINK, O).setAttribute(t.BLOCK_INSTANCE_ID, P).setAttribute("data-initialized", "1").setAttribute(t.NAME_CONTROL_ENABLED, e.productNameControlEnabled).setAttribute(
|
|
51
|
-
t.QUANTITY_CONTROL_ENABLED,
|
|
52
|
-
e.productQuantityControlEnabled
|
|
53
|
-
).setAttribute(t.PRICE_CONTROL_OPENED, e.productPriceControlOpened).setAttribute(t.PRODUCT_IMAGE_VISIBLE, _).setAttribute(t.PRODUCT_NAME_VISIBLE, p).setAttribute(t.PRODUCT_QUANTITY_VISIBLE, N).setAttribute(t.PRODUCT_PRICE_VISIBLE, f).setAttribute(t.PRODUCT_ORIGINAL_PRICE_VISIBLE, g).setAttribute(t.PRODUCT_BUTTON_VISIBLE, D).apply(new a("Initialize config block attributes with defaults")), y().startOnboarding("itemsOnboarding");
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
onSelect(r) {
|
|
57
|
-
const n = r.querySelector("esd-config-block"), o = S();
|
|
58
|
-
if (!n)
|
|
41
|
+
const I = this.api.getDocumentModifier(), o = r, T = o.getAttribute("data-initialized"), i = p(), { itemsType: a, itemIds: s, orientation: c } = i;
|
|
42
|
+
if (T === "1") {
|
|
43
|
+
const d = o.getAttribute(t.TYPE), u = o.getAttribute(t.ITEMS_INDEX_SELECT_CONTROL_VALUE), l = o.getAttribute(t.ORIENTATION);
|
|
44
|
+
(d || u || l) && i.updateFromAttributes({
|
|
45
|
+
itemsType: d || void 0,
|
|
46
|
+
itemIds: u || void 0,
|
|
47
|
+
orientation: l || void 0
|
|
48
|
+
});
|
|
59
49
|
return;
|
|
60
|
-
|
|
61
|
-
|
|
50
|
+
}
|
|
51
|
+
I.modifyHtml(r).setAttribute(
|
|
52
|
+
t.TYPE,
|
|
53
|
+
a
|
|
54
|
+
).setAttribute(
|
|
55
|
+
t.ITEMS_INDEX_SELECT_CONTROL_VALUE,
|
|
56
|
+
s
|
|
57
|
+
).setAttribute(
|
|
58
|
+
t.ORIENTATION,
|
|
59
|
+
c
|
|
60
|
+
).setAttribute("data-product_name_control_enabled", n.productNameControlEnabled).setAttribute("data-product_quantity_control_enabled", n.productQuantityControlEnabled).setAttribute("data-product_price_control_opened", n.productPriceControlOpened).setAttribute("data-initialized", "1").apply(new f("Initialize config block")), i.updateFromAttributes({
|
|
61
|
+
itemsType: a,
|
|
62
|
+
itemIds: s,
|
|
63
|
+
orientation: c
|
|
64
|
+
});
|
|
62
65
|
}
|
|
63
66
|
}
|
|
64
67
|
export {
|
|
65
|
-
|
|
66
|
-
|
|
68
|
+
_ as BLOCK_ID,
|
|
69
|
+
D as ItemsBlock
|
|
67
70
|
};
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
var r = Object.defineProperty;
|
|
2
|
-
var a = (
|
|
3
|
-
var s = (
|
|
4
|
-
import { CommonControl as
|
|
5
|
-
import { ItemsBlockControlId as
|
|
6
|
-
import { useItemsBlockStore as
|
|
7
|
-
|
|
8
|
-
import { updateConfigBlockAttributes as m } from "../../utils/updateAttributes.js";
|
|
9
|
-
const i = d.BUTTON_LINK, n = {
|
|
2
|
+
var a = (n, e, t) => e in n ? r(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var s = (n, e, t) => a(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { CommonControl as l } from "../../../common-control.js";
|
|
5
|
+
import { ItemsBlockControlId as u } from "../../enums/controlEnums.js";
|
|
6
|
+
import { useItemsBlockStore as L } from "../../store/items-block.js";
|
|
7
|
+
const i = u.BUTTON_LINK, o = {
|
|
10
8
|
LINK: "link"
|
|
11
9
|
};
|
|
12
|
-
class
|
|
10
|
+
class k extends l {
|
|
13
11
|
constructor() {
|
|
14
12
|
super(...arguments);
|
|
15
|
-
s(this, "store",
|
|
13
|
+
s(this, "store", L());
|
|
16
14
|
}
|
|
17
15
|
getId() {
|
|
18
16
|
return i;
|
|
@@ -26,43 +24,37 @@ class C extends u {
|
|
|
26
24
|
}
|
|
27
25
|
onRender() {
|
|
28
26
|
this.api.updateValues({
|
|
29
|
-
[
|
|
27
|
+
[o.LINK]: this.store.buttonLink
|
|
30
28
|
}), this._listenToFormUpdates();
|
|
31
29
|
}
|
|
32
30
|
onTemplateNodeUpdated(t) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
this.api.updateValues({
|
|
37
|
-
[n.LINK]: this.store.buttonLink
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
);
|
|
31
|
+
this.currentNode = t, this.api.updateValues({
|
|
32
|
+
[o.LINK]: this.store.buttonLink
|
|
33
|
+
});
|
|
41
34
|
}
|
|
42
35
|
_listenToFormUpdates() {
|
|
43
36
|
this.api.onValueChanged(
|
|
44
|
-
|
|
37
|
+
o.LINK,
|
|
45
38
|
(t) => this._onLinkChange(t)
|
|
46
39
|
);
|
|
47
40
|
}
|
|
48
41
|
_onLinkChange(t) {
|
|
49
|
-
console.debug("Button link changed to: ", t), this.store.setButtonLink(t)
|
|
42
|
+
console.debug("Button link changed to: ", t), this.store.setButtonLink(t);
|
|
50
43
|
}
|
|
51
44
|
_getLink() {
|
|
52
45
|
return `
|
|
53
46
|
${this._GuOneColumn([
|
|
54
47
|
this._GuLabel({ text: "Link" }),
|
|
55
48
|
this._GuTextInput({
|
|
56
|
-
name:
|
|
49
|
+
name: o.LINK,
|
|
57
50
|
placeholder: "Enter Link",
|
|
58
|
-
className: "es-100"
|
|
59
|
-
disabled: !0
|
|
51
|
+
className: "es-100"
|
|
60
52
|
})
|
|
61
53
|
])}
|
|
62
54
|
`;
|
|
63
55
|
}
|
|
64
56
|
}
|
|
65
57
|
export {
|
|
66
|
-
|
|
58
|
+
k as ButtonLinkControl,
|
|
67
59
|
i as CONTROL_BLOCK_ID
|
|
68
60
|
};
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { CommonControl as R } from "../../common-control.js";
|
|
6
|
-
import { ItemsBlockId as s } from "../enums/controlEnums.js";
|
|
7
|
-
import { configAttributes as C } from "../enums/productEnums.js";
|
|
8
|
-
import { SETTINGS_ENUMS as u } from "../enums/settingsEnums.js";
|
|
9
|
-
import { useItemsBlockStore as O } from "../store/items-block.js";
|
|
10
|
-
import { getConfigBlock as P, attributeToBoolean as U } from "../utils/configBlockUtils.js";
|
|
11
|
-
const h = "ui-elements-items-card-composition-block", i = {
|
|
1
|
+
import { UIElementType as a, UEAttr as l, ModificationDescription as o } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { CommonControl as s } from "../../common-control.js";
|
|
3
|
+
import { ItemsBlockId as r } from "../enums/controlEnums.js";
|
|
4
|
+
const d = "ui-elements-items-card-composition-block", i = {
|
|
12
5
|
PRODUCT_IMAGE: "image",
|
|
13
6
|
PRODUCT_NAME: "name",
|
|
14
7
|
PRODUCT_QUANTITY: "quantity",
|
|
@@ -16,21 +9,9 @@ const h = "ui-elements-items-card-composition-block", i = {
|
|
|
16
9
|
PRODUCT_ORIGINAL_PRICE: "originalPrice",
|
|
17
10
|
PRODUCT_BUTTON: "button"
|
|
18
11
|
};
|
|
19
|
-
class g extends
|
|
20
|
-
constructor() {
|
|
21
|
-
super(...arguments);
|
|
22
|
-
_(this, "store", O());
|
|
23
|
-
_(this, "visibilityState", {
|
|
24
|
-
[i.PRODUCT_IMAGE]: !0,
|
|
25
|
-
[i.PRODUCT_NAME]: !0,
|
|
26
|
-
[i.PRODUCT_QUANTITY]: !0,
|
|
27
|
-
[i.PRODUCT_PRICE]: !0,
|
|
28
|
-
[i.PRODUCT_ORIGINAL_PRICE]: !0,
|
|
29
|
-
[i.PRODUCT_BUTTON]: !0
|
|
30
|
-
});
|
|
31
|
-
}
|
|
12
|
+
class g extends s {
|
|
32
13
|
getId() {
|
|
33
|
-
return
|
|
14
|
+
return d;
|
|
34
15
|
}
|
|
35
16
|
getTemplate() {
|
|
36
17
|
return `
|
|
@@ -42,152 +23,77 @@ class g extends R {
|
|
|
42
23
|
{ name: i.PRODUCT_PRICE, label: "Product Price" },
|
|
43
24
|
{ name: i.PRODUCT_ORIGINAL_PRICE, label: "Product Original Price" },
|
|
44
25
|
{ name: i.PRODUCT_BUTTON, label: "Product Button" }
|
|
45
|
-
].map((
|
|
26
|
+
].map((t) => this._getToggleContainer(t)).join("")}
|
|
46
27
|
</div>
|
|
47
28
|
`;
|
|
48
29
|
}
|
|
49
30
|
onRender() {
|
|
50
|
-
this.
|
|
31
|
+
this._initializeToggles(), this._listenToFormUpdates();
|
|
51
32
|
}
|
|
52
|
-
|
|
53
|
-
super.onTemplateNodeUpdated(t), this.handleBlockInstanceChange(
|
|
54
|
-
() => {
|
|
55
|
-
this._syncVisibilityFromAttributes(), this._handleBrowsedItemsQuantity(), this._applyVisibilityStyles();
|
|
56
|
-
},
|
|
57
|
-
() => {
|
|
58
|
-
this._updateTogglesFromState();
|
|
59
|
-
}
|
|
60
|
-
);
|
|
33
|
+
onDestroy() {
|
|
61
34
|
}
|
|
62
|
-
_getToggleContainer({ name:
|
|
35
|
+
_getToggleContainer({ name: e, label: t }) {
|
|
63
36
|
return `
|
|
64
|
-
<div class="container"
|
|
37
|
+
<div class="container">
|
|
65
38
|
<div class="display-flex align-items-center justify-content-between">
|
|
66
|
-
${
|
|
67
|
-
${this._GuToggle(
|
|
39
|
+
<${a.LABEL} ${l.LABEL.text}="${t}"></${a.LABEL}>
|
|
40
|
+
${this._GuToggle(e)}
|
|
68
41
|
</div>
|
|
69
42
|
</div>
|
|
70
43
|
`;
|
|
71
44
|
}
|
|
72
45
|
_initializeToggles() {
|
|
73
|
-
this._updateTogglesFromState();
|
|
74
|
-
}
|
|
75
|
-
_updateTogglesFromState() {
|
|
76
46
|
this.api.updateValues({
|
|
77
|
-
[i.PRODUCT_IMAGE]:
|
|
78
|
-
[i.PRODUCT_NAME]:
|
|
79
|
-
[i.PRODUCT_QUANTITY]:
|
|
80
|
-
[i.PRODUCT_PRICE]:
|
|
81
|
-
[i.PRODUCT_ORIGINAL_PRICE]:
|
|
82
|
-
[i.PRODUCT_BUTTON]:
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
_syncVisibilityFromAttributes() {
|
|
86
|
-
const t = P(this.currentNode);
|
|
87
|
-
if (!t)
|
|
88
|
-
return;
|
|
89
|
-
const e = {
|
|
90
|
-
[i.PRODUCT_IMAGE]: "PRODUCT_IMAGE_VISIBLE",
|
|
91
|
-
[i.PRODUCT_NAME]: "PRODUCT_NAME_VISIBLE",
|
|
92
|
-
[i.PRODUCT_QUANTITY]: "PRODUCT_QUANTITY_VISIBLE",
|
|
93
|
-
[i.PRODUCT_PRICE]: "PRODUCT_PRICE_VISIBLE",
|
|
94
|
-
[i.PRODUCT_ORIGINAL_PRICE]: "PRODUCT_ORIGINAL_PRICE_VISIBLE",
|
|
95
|
-
[i.PRODUCT_BUTTON]: "PRODUCT_BUTTON_VISIBLE"
|
|
96
|
-
};
|
|
97
|
-
Object.entries(e).forEach(([o, r]) => {
|
|
98
|
-
const T = t.getAttribute(C[r]);
|
|
99
|
-
this.visibilityState[o] = U(T, !0);
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* If itemsType is not BROWSED_ITEMS, show quantity
|
|
104
|
-
* If itemsType is BROWSED_ITEMS, hide quantity
|
|
105
|
-
* and mark it as '0'
|
|
106
|
-
*/
|
|
107
|
-
_handleBrowsedItemsQuantity() {
|
|
108
|
-
var r;
|
|
109
|
-
const t = this.store.itemsType !== u.ITEMS_TYPE.BROWSED_ITEMS, e = (r = this.currentNode) == null ? void 0 : r.querySelector("esd-config-block");
|
|
110
|
-
if (!e)
|
|
111
|
-
return;
|
|
112
|
-
const o = e.getAttribute(C.PRODUCT_QUANTITY_VISIBLE) === "1";
|
|
113
|
-
this.visibilityState[i.PRODUCT_QUANTITY] = t && o, this.api.setVisibility(`${i.PRODUCT_QUANTITY}Container`, t), this._updateVisibilityAttribute(i.PRODUCT_QUANTITY, t && o);
|
|
114
|
-
}
|
|
115
|
-
_applyVisibilityStyles() {
|
|
116
|
-
const t = {
|
|
117
|
-
[i.PRODUCT_IMAGE]: s.IMAGE,
|
|
118
|
-
[i.PRODUCT_NAME]: s.NAME,
|
|
119
|
-
[i.PRODUCT_QUANTITY]: s.QUANTITY,
|
|
120
|
-
[i.PRODUCT_PRICE]: s.PRICE,
|
|
121
|
-
[i.PRODUCT_ORIGINAL_PRICE]: s.ORIGINAL_PRICE,
|
|
122
|
-
[i.PRODUCT_BUTTON]: s.BUTTON
|
|
123
|
-
};
|
|
124
|
-
Object.entries(t).forEach(([e, o]) => {
|
|
125
|
-
var d;
|
|
126
|
-
const r = (d = this.currentNode) == null ? void 0 : d.querySelector(`[esd-extension-block-id="${o}"]`);
|
|
127
|
-
if (!r)
|
|
128
|
-
return;
|
|
129
|
-
const T = this.visibilityState[e];
|
|
130
|
-
this.api.getDocumentModifier().modifyHtml(r).setStyle("display", T ? "table-cell" : "none").apply(new l(`Applied ${e} visibility from attributes`));
|
|
47
|
+
[i.PRODUCT_IMAGE]: !0,
|
|
48
|
+
[i.PRODUCT_NAME]: !0,
|
|
49
|
+
[i.PRODUCT_QUANTITY]: !0,
|
|
50
|
+
[i.PRODUCT_PRICE]: !0,
|
|
51
|
+
[i.PRODUCT_ORIGINAL_PRICE]: !0,
|
|
52
|
+
[i.PRODUCT_BUTTON]: !0
|
|
131
53
|
});
|
|
132
54
|
}
|
|
133
|
-
_updateVisibilityAttribute(t, e) {
|
|
134
|
-
const o = P(this.currentNode);
|
|
135
|
-
if (!o)
|
|
136
|
-
return;
|
|
137
|
-
const T = {
|
|
138
|
-
[i.PRODUCT_IMAGE]: "PRODUCT_IMAGE_VISIBLE",
|
|
139
|
-
[i.PRODUCT_NAME]: "PRODUCT_NAME_VISIBLE",
|
|
140
|
-
[i.PRODUCT_QUANTITY]: "PRODUCT_QUANTITY_VISIBLE",
|
|
141
|
-
[i.PRODUCT_PRICE]: "PRODUCT_PRICE_VISIBLE",
|
|
142
|
-
[i.PRODUCT_ORIGINAL_PRICE]: "PRODUCT_ORIGINAL_PRICE_VISIBLE",
|
|
143
|
-
[i.PRODUCT_BUTTON]: "PRODUCT_BUTTON_VISIBLE"
|
|
144
|
-
}[t];
|
|
145
|
-
T && this.api.getDocumentModifier().modifyHtml(o).setAttribute(C[T], e ? "1" : "0").apply(new l(`Updated ${t} visibility attribute`));
|
|
146
|
-
}
|
|
147
55
|
_listenToFormUpdates() {
|
|
148
|
-
this.api.onValueChanged(i.PRODUCT_IMAGE, (
|
|
56
|
+
this.api.onValueChanged(i.PRODUCT_IMAGE, (e) => this._onProductImageChange(e)), this.api.onValueChanged(i.PRODUCT_NAME, (e) => this._onProductNameChange(e)), this.api.onValueChanged(i.PRODUCT_QUANTITY, (e) => this._onProductQuantityChange(e)), this.api.onValueChanged(i.PRODUCT_PRICE, (e) => this._onProductPriceChange(e)), this.api.onValueChanged(
|
|
149
57
|
i.PRODUCT_ORIGINAL_PRICE,
|
|
150
|
-
(
|
|
151
|
-
), this.api.onValueChanged(i.PRODUCT_BUTTON, (
|
|
152
|
-
}
|
|
153
|
-
_onProductImageChange(
|
|
154
|
-
var
|
|
155
|
-
const
|
|
156
|
-
|
|
157
|
-
}
|
|
158
|
-
_onProductNameChange(
|
|
159
|
-
var
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
-
}
|
|
163
|
-
_onProductQuantityChange(
|
|
164
|
-
var
|
|
165
|
-
const
|
|
166
|
-
|
|
167
|
-
`Product quantity visibility changed to ${
|
|
168
|
-
))
|
|
169
|
-
}
|
|
170
|
-
_onProductPriceChange(
|
|
171
|
-
var
|
|
172
|
-
const
|
|
173
|
-
|
|
174
|
-
}
|
|
175
|
-
_onProductOriginalPriceChange(
|
|
176
|
-
var
|
|
177
|
-
const
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
const e = (o = this.currentNode) == null ? void 0 : o.querySelector(`[esd-extension-block-id="${s.BUTTON}"]`);
|
|
187
|
-
e && (this.visibilityState[i.PRODUCT_BUTTON] = t, this.api.getDocumentModifier().modifyHtml(e).setStyle("display", t ? "table-cell" : "none").apply(new l(`Product button visibility changed to ${t ? "visible" : "hidden"}`)), this._updateVisibilityAttribute(i.PRODUCT_BUTTON, t));
|
|
58
|
+
(e) => this._onProductOriginalPriceChange(e)
|
|
59
|
+
), this.api.onValueChanged(i.PRODUCT_BUTTON, (e) => this._onProductButtonChange(e));
|
|
60
|
+
}
|
|
61
|
+
_onProductImageChange(e) {
|
|
62
|
+
var n;
|
|
63
|
+
const t = (n = this.currentNode) == null ? void 0 : n.querySelector(`[esd-extension-block-id="${r.IMAGE}"]`);
|
|
64
|
+
t && this.api.getDocumentModifier().modifyHtml(t).setStyle("display", e ? "table-cell" : "none").apply(new o(`Product image visibility changed to ${e ? "visible" : "hidden"}`));
|
|
65
|
+
}
|
|
66
|
+
_onProductNameChange(e) {
|
|
67
|
+
var n;
|
|
68
|
+
const t = (n = this.currentNode) == null ? void 0 : n.querySelector(`[esd-extension-block-id="${r.NAME}"]`);
|
|
69
|
+
t && this.api.getDocumentModifier().modifyHtml(t).setStyle("display", e ? "table-cell" : "none").apply(new o(`Product name visibility changed to ${e ? "visible" : "hidden"}`));
|
|
70
|
+
}
|
|
71
|
+
_onProductQuantityChange(e) {
|
|
72
|
+
var n;
|
|
73
|
+
const t = (n = this.currentNode) == null ? void 0 : n.querySelector(`[esd-extension-block-id="${r.QUANTITY}"]`);
|
|
74
|
+
t && this.api.getDocumentModifier().modifyHtml(t).setStyle("display", e ? "table-cell" : "none").apply(new o(
|
|
75
|
+
`Product quantity visibility changed to ${e ? "visible" : "hidden"}`
|
|
76
|
+
));
|
|
77
|
+
}
|
|
78
|
+
_onProductPriceChange(e) {
|
|
79
|
+
var n;
|
|
80
|
+
const t = (n = this.currentNode) == null ? void 0 : n.querySelector(`[esd-extension-block-id="${r.PRICE}"]`);
|
|
81
|
+
t && this.api.getDocumentModifier().modifyHtml(t).setStyle("display", e ? "table-cell" : "none").apply(new o(`Product price visibility changed to ${e ? "visible" : "hidden"}`));
|
|
82
|
+
}
|
|
83
|
+
_onProductOriginalPriceChange(e) {
|
|
84
|
+
var n;
|
|
85
|
+
const t = (n = this.currentNode) == null ? void 0 : n.querySelector(`[esd-extension-block-id="${r.ORIGINAL_PRICE}"]`);
|
|
86
|
+
t && this.api.getDocumentModifier().modifyHtml(t).setStyle("display", e ? "table-cell" : "none").apply(new o(
|
|
87
|
+
`Product original price visibility changed to ${e ? "visible" : "hidden"}`
|
|
88
|
+
));
|
|
89
|
+
}
|
|
90
|
+
_onProductButtonChange(e) {
|
|
91
|
+
var n;
|
|
92
|
+
const t = (n = this.currentNode) == null ? void 0 : n.querySelector(`[esd-extension-block-id="${r.BUTTON}"]`);
|
|
93
|
+
t && this.api.getDocumentModifier().modifyHtml(t).setStyle("display", e ? "table-cell" : "none").apply(new o(`Product button visibility changed to ${e ? "visible" : "hidden"}`));
|
|
188
94
|
}
|
|
189
95
|
}
|
|
190
96
|
export {
|
|
191
|
-
|
|
97
|
+
d as COMPOSITION_CONTROL_BLOCK_ID,
|
|
192
98
|
g as ItemsBlockCardCompositionControl
|
|
193
99
|
};
|
|
@@ -1,68 +1,60 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var a = Object.defineProperty;
|
|
2
|
+
var r = (n, t, e) => t in n ? a(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
3
|
+
var s = (n, t, e) => r(n, typeof t != "symbol" ? t + "" : t, e);
|
|
4
4
|
import { CommonControl as m } from "../../../common-control.js";
|
|
5
|
-
import { ItemsBlockControlId as
|
|
6
|
-
import { useItemsBlockStore as
|
|
7
|
-
|
|
8
|
-
import { updateConfigBlockAttributes as p } from "../../utils/updateAttributes.js";
|
|
9
|
-
const s = d.IMAGE_LINK, n = {
|
|
5
|
+
import { ItemsBlockControlId as l } from "../../enums/controlEnums.js";
|
|
6
|
+
import { useItemsBlockStore as L } from "../../store/items-block.js";
|
|
7
|
+
const i = l.IMAGE_LINK, o = {
|
|
10
8
|
LINK: "link"
|
|
11
9
|
};
|
|
12
|
-
class
|
|
10
|
+
class u extends m {
|
|
13
11
|
constructor() {
|
|
14
12
|
super(...arguments);
|
|
15
|
-
|
|
13
|
+
s(this, "store", L());
|
|
16
14
|
}
|
|
17
15
|
getId() {
|
|
18
|
-
return
|
|
16
|
+
return i;
|
|
19
17
|
}
|
|
20
18
|
getTemplate() {
|
|
21
19
|
return `
|
|
22
|
-
<div class="${
|
|
20
|
+
<div class="${i}">
|
|
23
21
|
${this._getLink()}
|
|
24
22
|
</div>
|
|
25
23
|
`;
|
|
26
24
|
}
|
|
27
25
|
onRender() {
|
|
28
26
|
this.api.updateValues({
|
|
29
|
-
[
|
|
27
|
+
[o.LINK]: this.store.imageLink
|
|
30
28
|
}), this._listenToFormUpdates();
|
|
31
29
|
}
|
|
32
30
|
onTemplateNodeUpdated(e) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
this.api.updateValues({
|
|
37
|
-
[n.LINK]: this.store.imageLink
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
);
|
|
31
|
+
this.currentNode = e, this.api.updateValues({
|
|
32
|
+
[o.LINK]: this.store.imageLink
|
|
33
|
+
});
|
|
41
34
|
}
|
|
42
35
|
_listenToFormUpdates() {
|
|
43
36
|
this.api.onValueChanged(
|
|
44
|
-
|
|
37
|
+
o.LINK,
|
|
45
38
|
(e) => this._onLinkChange(e)
|
|
46
39
|
);
|
|
47
40
|
}
|
|
48
41
|
_onLinkChange(e) {
|
|
49
|
-
console.debug("Image link changed to: ", e), this.store.setImageLink(e)
|
|
42
|
+
console.debug("Image link changed to: ", e), this.store.setImageLink(e);
|
|
50
43
|
}
|
|
51
44
|
_getLink() {
|
|
52
45
|
return `
|
|
53
46
|
${this._GuOneColumn([
|
|
54
47
|
this._GuLabel({ text: "Link" }),
|
|
55
48
|
this._GuTextInput({
|
|
56
|
-
name:
|
|
49
|
+
name: o.LINK,
|
|
57
50
|
placeholder: "Enter Link",
|
|
58
|
-
className: "es-100"
|
|
59
|
-
disabled: !0
|
|
51
|
+
className: "es-100"
|
|
60
52
|
})
|
|
61
53
|
])}
|
|
62
54
|
`;
|
|
63
55
|
}
|
|
64
56
|
}
|
|
65
57
|
export {
|
|
66
|
-
|
|
67
|
-
|
|
58
|
+
i as CONTROL_BLOCK_ID,
|
|
59
|
+
u as ImageLinkControl
|
|
68
60
|
};
|
|
@@ -1,70 +1,63 @@
|
|
|
1
1
|
var d = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { ModificationDescription as
|
|
2
|
+
var g = (i, t, e) => t in i ? d(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
+
var s = (i, t, e) => g(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { ModificationDescription as n, UIElementType as l, UEAttr as h } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
5
5
|
import { CommonControl as c } from "../../../common-control.js";
|
|
6
|
-
import { ItemsBlockControlId as
|
|
6
|
+
import { ItemsBlockControlId as a } from "../../enums/controlEnums.js";
|
|
7
7
|
import { SETTINGS_ENUMS as I } from "../../enums/settingsEnums.js";
|
|
8
|
-
import { useItemsBlockStore as
|
|
9
|
-
|
|
10
|
-
import { updateConfigBlockAttributes as u } from "../../utils/updateAttributes.js";
|
|
11
|
-
const y = p.NAME_TRIMMING, o = {
|
|
8
|
+
import { useItemsBlockStore as y } from "../../store/items-block.js";
|
|
9
|
+
const M = a.NAME_TRIMMING, r = {
|
|
12
10
|
TRIMMING: "trimming"
|
|
13
11
|
};
|
|
14
|
-
class
|
|
12
|
+
class x extends c {
|
|
15
13
|
constructor() {
|
|
16
14
|
super(...arguments);
|
|
17
|
-
|
|
15
|
+
s(this, "store", y());
|
|
18
16
|
}
|
|
19
17
|
getId() {
|
|
20
|
-
return
|
|
18
|
+
return M;
|
|
21
19
|
}
|
|
22
20
|
getTemplate() {
|
|
23
21
|
return `
|
|
24
|
-
<div class="${
|
|
22
|
+
<div class="${a.NAME_TRIMMING}">
|
|
25
23
|
${this._getTextTrimming()}
|
|
26
24
|
</div>
|
|
27
25
|
`;
|
|
28
26
|
}
|
|
29
27
|
onRender() {
|
|
30
|
-
this.api.updateValues({ [
|
|
28
|
+
this.api.updateValues({ [r.TRIMMING]: this.store.nameTrimming }), this.api.onValueChanged(r.TRIMMING, (e) => {
|
|
31
29
|
this._onTrimmingChange(e);
|
|
32
30
|
});
|
|
33
31
|
}
|
|
34
32
|
onTemplateNodeUpdated(e) {
|
|
35
|
-
|
|
36
|
-
() => M(this.currentNode),
|
|
37
|
-
() => {
|
|
38
|
-
this.api.updateValues({ [o.TRIMMING]: this.store.nameTrimming });
|
|
39
|
-
}
|
|
40
|
-
);
|
|
33
|
+
this.currentNode = e, this.api.updateValues({ [r.TRIMMING]: this.store.nameTrimming }), this.store.nameTrimming && this._applyTrimmingStyles();
|
|
41
34
|
}
|
|
42
35
|
_onTrimmingChange(e) {
|
|
43
|
-
this.store.setNameTrimming(e),
|
|
36
|
+
this.store.setNameTrimming(e), this._applyTrimmingStyles(e);
|
|
44
37
|
}
|
|
45
38
|
_applyTrimmingStyles(e) {
|
|
46
|
-
var
|
|
47
|
-
const
|
|
48
|
-
if (!
|
|
39
|
+
var o;
|
|
40
|
+
const m = (o = this.currentNode) == null ? void 0 : o.querySelector("p");
|
|
41
|
+
if (!m)
|
|
49
42
|
return;
|
|
50
|
-
const T = e !== void 0 ? e : this.store.nameTrimming,
|
|
51
|
-
T ? this.api.getDocumentModifier().modifyHtml(
|
|
43
|
+
const T = e !== void 0 ? e : this.store.nameTrimming, p = this.store.orientation === I.ORIENTATION.VERTICAL;
|
|
44
|
+
T ? this.api.getDocumentModifier().modifyHtml(m).setStyle("white-space", "nowrap").setStyle("overflow", "hidden").setStyle("text-overflow", "ellipsis").setStyle("max-width", p ? "130px" : "100%").apply(new n("Text Trimming Enabled")) : this.api.getDocumentModifier().modifyHtml(m).removeStyle("white-space").removeStyle("overflow").removeStyle("text-overflow").removeStyle("max-width").apply(new n("Text Trimming Disabled"));
|
|
52
45
|
}
|
|
53
46
|
_getTextTrimming() {
|
|
54
47
|
return `
|
|
55
48
|
<div class="container">
|
|
56
49
|
<div class="display-flex align-items-center justify-content-between">
|
|
57
50
|
<${l.LABEL}
|
|
58
|
-
${
|
|
51
|
+
${h.LABEL.text}="${this.api.translate("Text Trimming")}"
|
|
59
52
|
>
|
|
60
53
|
</${l.LABEL}>
|
|
61
|
-
${this._GuToggle(
|
|
54
|
+
${this._GuToggle(r.TRIMMING)}
|
|
62
55
|
</div>
|
|
63
56
|
</div>
|
|
64
57
|
`;
|
|
65
58
|
}
|
|
66
59
|
}
|
|
67
60
|
export {
|
|
68
|
-
|
|
69
|
-
|
|
61
|
+
M as CONTROL_BLOCK_ID,
|
|
62
|
+
x as NameTrimmingControl
|
|
70
63
|
};
|