@useinsider/guido 2.2.0-beta.eeefcc3 → 3.0.0-beta.5b2298c
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 +41 -2
- package/dist/@types/config/schemas.js +1 -1
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +66 -66
- package/dist/components/organisms/base/Toaster.vue.js +4 -4
- package/dist/components/organisms/base/Toaster.vue2.js +12 -9
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +5 -5
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +2 -2
- package/dist/components/organisms/extensions/recommendation/FilterItem.vue.js +11 -13
- package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +54 -23
- package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.js +7 -5
- package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +34 -21
- package/dist/components/organisms/extensions/recommendation/Filters.vue.js +11 -11
- package/dist/components/organisms/extensions/recommendation/Filters.vue2.js +48 -36
- package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue2.js +11 -9
- package/dist/components/organisms/header/EditorActions.vue.js +10 -8
- package/dist/components/organisms/header/EditorActions.vue2.js +40 -30
- package/dist/components/organisms/header/MigrationConfirmModal.vue.js +17 -0
- package/dist/components/organisms/header/MigrationConfirmModal.vue2.js +39 -0
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +1 -1
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +19 -19
- package/dist/composables/useRecommendation.js +9 -9
- package/dist/composables/useSave.js +16 -12
- package/dist/composables/useStripo.js +66 -62
- package/dist/composables/useStripoEventHandler.js +27 -12
- package/dist/composables/useSyncModuleExtractor.js +45 -0
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +1 -1
- package/dist/config/i18n/en/labels.json.js +8 -3
- package/dist/config/migrator/itemsBlockMigrator.js +135 -131
- package/dist/config/migrator/recommendationMigrator.js +59 -55
- package/dist/enums/block.js +4 -0
- package/dist/enums/unsubscribe.js +25 -21
- package/dist/extensions/Blocks/Items/block.js +30 -21
- package/dist/extensions/Blocks/Items/iconsRegistry.js +7 -6
- package/dist/extensions/Blocks/Items/items.css.js +48 -0
- package/dist/extensions/Blocks/Recommendation/block.js +22 -13
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +36 -33
- package/dist/extensions/Blocks/Recommendation/constants/layout.js +16 -14
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +15 -13
- package/dist/extensions/Blocks/Recommendation/controls/button/index.js +9 -9
- package/dist/extensions/Blocks/Recommendation/controls/image/index.js +1 -1
- package/dist/extensions/Blocks/Recommendation/controls/layout/index.js +41 -29
- package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +16 -16
- package/dist/extensions/Blocks/Recommendation/controls/main/currency.js +30 -32
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +194 -104
- package/dist/extensions/Blocks/Recommendation/controls/main/locale.js +9 -9
- package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +46 -38
- package/dist/extensions/Blocks/Recommendation/controls/main/shuffle.js +16 -16
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +291 -217
- package/dist/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.js +14 -14
- package/dist/extensions/Blocks/Recommendation/controls/name/index.js +10 -10
- package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +5 -5
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/index.js +14 -14
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.js +9 -9
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textAfter.js +3 -3
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textBefore.js +1 -1
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/index.js +9 -9
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textAfter.js +3 -3
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textBefore.js +13 -13
- package/dist/extensions/Blocks/Recommendation/controls/price/index.js +3 -3
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +223 -99
- package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +5 -4
- package/dist/extensions/Blocks/Recommendation/recommendation.css.js +48 -0
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +172 -85
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +2 -2
- package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +1 -1
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +2 -2
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +32 -32
- package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +8 -8
- package/dist/extensions/Blocks/Recommendation/validation/filterSchema.js +29 -0
- package/dist/extensions/Blocks/Unsubscribe/block.js +29 -29
- package/dist/extensions/Blocks/Unsubscribe/control.js +12 -9
- package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +13 -11
- package/dist/extensions/Blocks/Unsubscribe/styles.css.js +31 -1
- package/dist/extensions/Blocks/common-control.js +12 -4
- package/dist/guido.css +1 -1
- package/dist/services/stripoApi.js +55 -19
- package/dist/src/@types/config/schemas.d.ts +1 -1
- package/dist/src/@types/events.d.ts +38 -2
- package/dist/src/@types/extensions/block.d.ts +2 -0
- package/dist/src/components/Guido.vue.d.ts +2 -2
- package/dist/src/components/organisms/extensions/recommendation/FilterItem.vue.d.ts +1 -0
- package/dist/src/components/organisms/extensions/recommendation/Filters.vue.d.ts +17 -1
- package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -1
- package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -1
- package/dist/src/components/organisms/header/MigrationConfirmModal.vue.d.ts +6 -0
- package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
- package/dist/src/components/wrappers/WpModal.vue.d.ts +2 -2
- package/dist/src/composables/useGuidoActions.d.ts +1 -1
- package/dist/src/composables/useSave.d.ts +2 -2
- package/dist/src/composables/useStripo.d.ts +2 -2
- package/dist/src/composables/useSyncModuleExtractor.d.ts +4 -0
- package/dist/src/enums/block.d.ts +4 -0
- package/dist/src/enums/unsubscribe.d.ts +3 -0
- package/dist/src/extensions/Blocks/Items/block.d.ts +3 -1
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +3 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +3 -3
- package/dist/src/extensions/Blocks/Recommendation/constants/layout.d.ts +6 -2
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +8 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +38 -10
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +27 -14
- package/dist/src/extensions/Blocks/Recommendation/controls/spacing/index.d.ts +50 -17
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +19 -2
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/migration.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/templates/index.d.ts +4 -2
- package/dist/src/extensions/Blocks/Recommendation/templates/list/migration.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +8 -0
- package/dist/src/extensions/Blocks/Recommendation/validation/filterSchema.d.ts +15 -0
- package/dist/src/extensions/Blocks/Unsubscribe/control.d.ts +1 -0
- package/dist/src/extensions/Blocks/common-control.d.ts +5 -0
- package/dist/src/mock/api/settings.d.ts +2 -0
- package/dist/src/services/stripoApi.d.ts +5 -0
- package/dist/src/stores/editor.d.ts +23 -0
- package/dist/src/stores/template.d.ts +29 -0
- package/dist/src/utils/migrationBannerHtml.d.ts +2 -0
- package/dist/src/utils/templatePreparation.d.ts +1 -1
- package/dist/static/assets/info.svg.js +5 -0
- package/dist/static/styles/customEditorStyle.css.js +50 -23
- package/dist/stores/editor.js +2 -1
- package/dist/stores/template.js +15 -0
- package/dist/stores/unsubscribe.js +37 -34
- package/dist/utils/migrationBannerHtml.js +21 -0
- package/dist/utils/templatePreparation.js +1 -1
- package/package.json +2 -2
|
@@ -1,25 +1,29 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { ModificationDescription as
|
|
1
|
+
var L = Object.defineProperty;
|
|
2
|
+
var _ = (o, e, t) => e in o ? L(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
3
|
+
var r = (o, e, t) => _(o, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { ModificationDescription as p } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
5
5
|
import { CommonControl as h } from "../../../common-control.js";
|
|
6
|
-
import { LAYOUT_OPTIONS as g } from "../../constants/layout.js";
|
|
7
|
-
import { RecommendationConfigService as
|
|
8
|
-
import { useRecommendationExtensionStore as
|
|
9
|
-
import { getCurrentLayout as
|
|
10
|
-
const
|
|
6
|
+
import { LAYOUT_OPTIONS as N, DEFAULT_MOBILE_ROW_SPACING as m, DEFAULT_MOBILE_COLUMN_SPACING as d, DEFAULT_ROW_SPACING as l, DEFAULT_COLUMN_SPACING as g } from "../../constants/layout.js";
|
|
7
|
+
import { RecommendationConfigService as s } from "../../services/configService.js";
|
|
8
|
+
import { useRecommendationExtensionStore as A } from "../../store/recommendation.js";
|
|
9
|
+
import { getCurrentLayout as C, getBlockElement as O, regenerateProductRowsWithStyles as f } from "../main/utils.js";
|
|
10
|
+
const S = "recommendation-layout-control", a = {
|
|
11
11
|
LAYOUT: "layout"
|
|
12
|
-
},
|
|
13
|
-
LAYOUT: "data-layout"
|
|
12
|
+
}, n = {
|
|
13
|
+
LAYOUT: "data-layout",
|
|
14
|
+
COLUMN_SPACING: "data-column-spacing",
|
|
15
|
+
ROW_SPACING: "data-row-spacing",
|
|
16
|
+
MOBILE_COLUMN_SPACING: "data-mobile-column-spacing",
|
|
17
|
+
MOBILE_ROW_SPACING: "data-mobile-row-spacing"
|
|
14
18
|
};
|
|
15
|
-
class
|
|
19
|
+
class G extends h {
|
|
16
20
|
constructor() {
|
|
17
21
|
super(...arguments);
|
|
18
|
-
|
|
19
|
-
|
|
22
|
+
r(this, "store", A());
|
|
23
|
+
r(this, "isChangingLayout", !1);
|
|
20
24
|
}
|
|
21
25
|
getId() {
|
|
22
|
-
return
|
|
26
|
+
return S;
|
|
23
27
|
}
|
|
24
28
|
getTemplate() {
|
|
25
29
|
return `
|
|
@@ -27,8 +31,8 @@ class Y extends h {
|
|
|
27
31
|
${this._GuTwoColumns([
|
|
28
32
|
this._GuLabel({ text: "Layout Orientation" }),
|
|
29
33
|
this._GuRadioButton({
|
|
30
|
-
name:
|
|
31
|
-
buttons:
|
|
34
|
+
name: a.LAYOUT,
|
|
35
|
+
buttons: N
|
|
32
36
|
})
|
|
33
37
|
])}
|
|
34
38
|
</div>
|
|
@@ -41,9 +45,9 @@ class Y extends h {
|
|
|
41
45
|
super.onTemplateNodeUpdated(t), this._setFormValues();
|
|
42
46
|
}
|
|
43
47
|
_setFormValues() {
|
|
44
|
-
const
|
|
48
|
+
const u = s.getConfig(this.currentNode).layout || C(this.currentNode);
|
|
45
49
|
this.api.updateValues({
|
|
46
|
-
[
|
|
50
|
+
[a.LAYOUT]: u
|
|
47
51
|
});
|
|
48
52
|
}
|
|
49
53
|
/**
|
|
@@ -51,18 +55,26 @@ class Y extends h {
|
|
|
51
55
|
* Updates node config, data attribute and regenerates product rows
|
|
52
56
|
*/
|
|
53
57
|
_onLayoutChange(t) {
|
|
54
|
-
if (this.isChangingLayout || !this.currentNode || (
|
|
58
|
+
if (this.isChangingLayout || !this.currentNode || (s.getConfig(this.currentNode).layout || C(this.currentNode)) === t)
|
|
55
59
|
return;
|
|
56
|
-
const
|
|
57
|
-
if (
|
|
60
|
+
const c = O(this.currentNode);
|
|
61
|
+
if (c) {
|
|
58
62
|
this.isChangingLayout = !0;
|
|
59
63
|
try {
|
|
60
|
-
|
|
64
|
+
s.updateConfig(
|
|
61
65
|
this.api,
|
|
62
66
|
this.currentNode,
|
|
63
|
-
{
|
|
67
|
+
{
|
|
68
|
+
layout: t,
|
|
69
|
+
columnSpacing: g,
|
|
70
|
+
rowSpacing: l,
|
|
71
|
+
mobileColumnSpacing: d,
|
|
72
|
+
mobileRowSpacing: m
|
|
73
|
+
},
|
|
64
74
|
`Changed layout to ${t}`
|
|
65
|
-
), this.store.patchCurrentBlockConfig({ orientation: t })
|
|
75
|
+
), this.store.patchCurrentBlockConfig({ orientation: t });
|
|
76
|
+
const i = this.api.getDocumentModifier().modifyHtml(c).setAttribute(n.LAYOUT, t).setAttribute(n.COLUMN_SPACING, g.toString()).setAttribute(n.ROW_SPACING, l.toString()).setAttribute(n.MOBILE_COLUMN_SPACING, d.toString()).setAttribute(n.MOBILE_ROW_SPACING, m.toString());
|
|
77
|
+
t === "list" ? (i.setClass("es-m-p0"), i.setClass("ins-recommendation-list-layout")) : (i.removeClass("es-m-p0"), i.removeClass("ins-recommendation-list-layout")), i.apply(new p(`Update layout to ${t}`)), this._regenerateProductRows(t);
|
|
66
78
|
} finally {
|
|
67
79
|
this.isChangingLayout = !1;
|
|
68
80
|
}
|
|
@@ -74,19 +86,19 @@ class Y extends h {
|
|
|
74
86
|
* @param layout - The layout to use for regeneration (passed explicitly to avoid stale DOM reads)
|
|
75
87
|
*/
|
|
76
88
|
_regenerateProductRows(t) {
|
|
77
|
-
this.currentNode &&
|
|
89
|
+
this.currentNode && f({
|
|
78
90
|
currentNode: this.currentNode,
|
|
79
91
|
documentModifier: this.api.getDocumentModifier(),
|
|
80
92
|
layout: t
|
|
81
93
|
});
|
|
82
94
|
}
|
|
83
95
|
_listenToFormUpdates() {
|
|
84
|
-
this.api.onValueChanged(
|
|
96
|
+
this.api.onValueChanged(a.LAYOUT, (t) => {
|
|
85
97
|
this._onLayoutChange(t);
|
|
86
98
|
});
|
|
87
99
|
}
|
|
88
100
|
}
|
|
89
101
|
export {
|
|
90
|
-
|
|
91
|
-
|
|
102
|
+
S as LAYOUT_CONTROL_ID,
|
|
103
|
+
G as LayoutControl
|
|
92
104
|
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var a = (
|
|
4
|
-
import { UEAttr as
|
|
5
|
-
import { CommonControl as
|
|
1
|
+
var c = Object.defineProperty;
|
|
2
|
+
var d = (r, i, t) => i in r ? c(r, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[i] = t;
|
|
3
|
+
var a = (r, i, t) => d(r, typeof i != "symbol" ? i + "" : i, t);
|
|
4
|
+
import { UEAttr as h } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
5
|
+
import { CommonControl as l } from "../../../common-control.js";
|
|
6
6
|
import { RecommendationConfigService as n } from "../../services/configService.js";
|
|
7
7
|
import { useRecommendationExtensionStore as m } from "../../store/recommendation.js";
|
|
8
|
-
const
|
|
8
|
+
const g = "recommendation-algorithm-control", e = {
|
|
9
9
|
ALGORITHM: "strategy",
|
|
10
10
|
PRODUCT_IDS: "productIds"
|
|
11
11
|
};
|
|
12
|
-
class T extends
|
|
12
|
+
class T extends l {
|
|
13
13
|
constructor() {
|
|
14
14
|
super(...arguments);
|
|
15
15
|
// Store is used ONLY for API-fetched data (algorithms list), not for config
|
|
16
16
|
a(this, "store", m());
|
|
17
17
|
}
|
|
18
18
|
getId() {
|
|
19
|
-
return
|
|
19
|
+
return g;
|
|
20
20
|
}
|
|
21
21
|
getTemplate() {
|
|
22
22
|
return `
|
|
@@ -52,13 +52,13 @@ class T extends h {
|
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
_initializeSelectItems() {
|
|
55
|
-
var
|
|
56
|
-
const t = (
|
|
55
|
+
var o;
|
|
56
|
+
const t = (o = this.store) == null ? void 0 : o.getActivePredictiveAlgorithms;
|
|
57
57
|
if (t != null && t.length)
|
|
58
58
|
try {
|
|
59
59
|
this.api.setUIEAttribute(
|
|
60
60
|
e.ALGORITHM,
|
|
61
|
-
|
|
61
|
+
h.SELECTPICKER.items,
|
|
62
62
|
t
|
|
63
63
|
);
|
|
64
64
|
} catch (s) {
|
|
@@ -70,7 +70,7 @@ class T extends h {
|
|
|
70
70
|
this.api.setVisibility(e.PRODUCT_IDS, s), this.api.setVisibility(`${e.PRODUCT_IDS}_label`, s);
|
|
71
71
|
}
|
|
72
72
|
_onAlgorithmChange(t) {
|
|
73
|
-
this.currentNode
|
|
73
|
+
!this.currentNode || n.getConfig(this.currentNode).strategy === t || (n.updateConfig(
|
|
74
74
|
this.api,
|
|
75
75
|
this.currentNode,
|
|
76
76
|
{ strategy: t },
|
|
@@ -80,13 +80,13 @@ class T extends h {
|
|
|
80
80
|
_onProductIdsChange(t) {
|
|
81
81
|
if (!this.currentNode)
|
|
82
82
|
return;
|
|
83
|
-
const
|
|
83
|
+
const o = t.split(",").map((s) => s.trim()).filter(Boolean);
|
|
84
84
|
n.updateConfig(
|
|
85
85
|
this.api,
|
|
86
86
|
this.currentNode,
|
|
87
|
-
{ productIds:
|
|
87
|
+
{ productIds: o },
|
|
88
88
|
"Updated product IDs"
|
|
89
|
-
), this.store.patchCurrentBlockConfig({ productIds:
|
|
89
|
+
), this.store.patchCurrentBlockConfig({ productIds: o });
|
|
90
90
|
}
|
|
91
91
|
_listenToFormUpdates() {
|
|
92
92
|
this.api.onValueChanged(e.ALGORITHM, (t) => {
|
|
@@ -97,6 +97,6 @@ class T extends h {
|
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
export {
|
|
100
|
-
|
|
100
|
+
g as ALGORITHM_CONTROL_ID,
|
|
101
101
|
T as AlgorithmControl
|
|
102
102
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
var R = Object.defineProperty;
|
|
2
|
-
var _ = (
|
|
3
|
-
var c = (
|
|
4
|
-
import { currencyLocationMaps as l, currencyOperators as
|
|
2
|
+
var _ = (i, o, e) => o in i ? R(i, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[o] = e;
|
|
3
|
+
var c = (i, o, e) => _(i, typeof o != "symbol" ? o + "" : o, e);
|
|
4
|
+
import { currencyLocationMaps as l, currencyOperators as a, currencyDecimalCounts as h } from "../../../../../enums/extensions/recommendationBlock.js";
|
|
5
5
|
import { UEAttr as m } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
6
|
-
import { CommonControl as
|
|
7
|
-
import { RecommendationConfigService as
|
|
8
|
-
import { useRecommendationExtensionStore as
|
|
9
|
-
import { setCurrencyAttributes as S, updatePricesInPlace as
|
|
10
|
-
const
|
|
6
|
+
import { CommonControl as p } from "../../../common-control.js";
|
|
7
|
+
import { RecommendationConfigService as s } from "../../services/configService.js";
|
|
8
|
+
import { useRecommendationExtensionStore as d } from "../../store/recommendation.js";
|
|
9
|
+
import { setCurrencyAttributes as S, updatePricesInPlace as N } from "./utils.js";
|
|
10
|
+
const E = "recommendation-currency-control", t = {
|
|
11
11
|
CURRENCY: "currencyCode",
|
|
12
12
|
CURRENCY_LOCATION: "currencyAlignment",
|
|
13
13
|
CURRENCY_SYMBOL: "currencySymbol",
|
|
@@ -15,16 +15,16 @@ const y = "recommendation-currency-control", t = {
|
|
|
15
15
|
CURRENCY_DECIMAL_SEPARATOR: "currencyDecimalSeparator",
|
|
16
16
|
CURRENCY_DECIMAL_COUNT: "currencyDecimalCount"
|
|
17
17
|
};
|
|
18
|
-
class
|
|
18
|
+
class Y extends p {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(...arguments);
|
|
21
21
|
// Store is used ONLY for API-fetched data (currency list), not for config
|
|
22
|
-
c(this, "store",
|
|
22
|
+
c(this, "store", d());
|
|
23
23
|
c(this, "storeUnsubscription", () => {
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
getId() {
|
|
27
|
-
return
|
|
27
|
+
return E;
|
|
28
28
|
}
|
|
29
29
|
getTemplate() {
|
|
30
30
|
return `
|
|
@@ -52,13 +52,13 @@ class D extends d {
|
|
|
52
52
|
this._GuSelect({
|
|
53
53
|
name: t.CURRENCY_THOUSAND_SEPARATOR,
|
|
54
54
|
placeholder: "Select Thousand Separator",
|
|
55
|
-
options:
|
|
55
|
+
options: a
|
|
56
56
|
}),
|
|
57
57
|
this._GuLabel({ text: "Decimal Separator" }),
|
|
58
58
|
this._GuSelect({
|
|
59
59
|
name: t.CURRENCY_DECIMAL_SEPARATOR,
|
|
60
60
|
placeholder: "Select Decimal Separator",
|
|
61
|
-
options:
|
|
61
|
+
options: a
|
|
62
62
|
}),
|
|
63
63
|
this._GuLabel({ text: "Decimal Count" }),
|
|
64
64
|
this._GuSelect({
|
|
@@ -82,7 +82,7 @@ class D extends d {
|
|
|
82
82
|
this.storeUnsubscription();
|
|
83
83
|
}
|
|
84
84
|
_setFormValues() {
|
|
85
|
-
const e =
|
|
85
|
+
const e = s.getConfig(this.currentNode), { currency: r } = e;
|
|
86
86
|
this.api.updateValues({
|
|
87
87
|
[t.CURRENCY]: `price.${r.code}`,
|
|
88
88
|
[t.CURRENCY_LOCATION]: r.alignment === "before" ? "0" : "1",
|
|
@@ -96,12 +96,12 @@ class D extends d {
|
|
|
96
96
|
const { store: e } = this, r = {
|
|
97
97
|
[t.CURRENCY]: e.currencyList,
|
|
98
98
|
[t.CURRENCY_LOCATION]: l,
|
|
99
|
-
[t.CURRENCY_THOUSAND_SEPARATOR]:
|
|
100
|
-
[t.CURRENCY_DECIMAL_SEPARATOR]:
|
|
99
|
+
[t.CURRENCY_THOUSAND_SEPARATOR]: a,
|
|
100
|
+
[t.CURRENCY_DECIMAL_SEPARATOR]: a,
|
|
101
101
|
[t.CURRENCY_DECIMAL_COUNT]: h
|
|
102
102
|
};
|
|
103
|
-
Object.entries(r).forEach(([
|
|
104
|
-
this.api.setUIEAttribute(
|
|
103
|
+
Object.entries(r).forEach(([C, n]) => {
|
|
104
|
+
this.api.setUIEAttribute(C, m.SELECTPICKER.items, n);
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
107
|
/**
|
|
@@ -114,17 +114,17 @@ class D extends d {
|
|
|
114
114
|
_updateCurrency(e, r = !1) {
|
|
115
115
|
if (!this.currentNode)
|
|
116
116
|
return;
|
|
117
|
-
const n = { ...
|
|
118
|
-
|
|
117
|
+
const n = { ...s.getConfig(this.currentNode).currency, ...e };
|
|
118
|
+
s.updateConfig(
|
|
119
119
|
this.api,
|
|
120
120
|
this.currentNode,
|
|
121
121
|
{ currency: n },
|
|
122
122
|
"Updated currency settings"
|
|
123
123
|
);
|
|
124
|
-
const
|
|
124
|
+
const u = this.api.getDocumentModifier();
|
|
125
125
|
S({
|
|
126
126
|
currentNode: this.currentNode,
|
|
127
|
-
documentModifier:
|
|
127
|
+
documentModifier: u,
|
|
128
128
|
currency: n
|
|
129
129
|
}), this.store.patchCurrentBlockConfig({
|
|
130
130
|
currencySettings: {
|
|
@@ -136,22 +136,19 @@ class D extends d {
|
|
|
136
136
|
decimalSeparator: n.decimalSeparator,
|
|
137
137
|
thousandSeparator: n.thousandSeparator
|
|
138
138
|
}
|
|
139
|
-
}, { triggerRefetch: r }),
|
|
139
|
+
}, { triggerRefetch: r }), N({
|
|
140
140
|
currentNode: this.currentNode,
|
|
141
|
-
documentModifier:
|
|
142
|
-
}) || N({
|
|
143
|
-
currentNode: this.currentNode,
|
|
144
|
-
documentModifier: a
|
|
141
|
+
documentModifier: u
|
|
145
142
|
});
|
|
146
143
|
}
|
|
147
144
|
_onCurrencyChange(e) {
|
|
148
145
|
const [, r] = e.includes(".") ? e.split(".") : [null, e];
|
|
149
|
-
this._updateCurrency({
|
|
146
|
+
s.getConfig(this.currentNode).currency.code !== r && (this._updateCurrency({
|
|
150
147
|
code: r,
|
|
151
148
|
symbol: r
|
|
152
149
|
}, !0), this.api.updateValues({
|
|
153
150
|
[t.CURRENCY_SYMBOL]: r
|
|
154
|
-
});
|
|
151
|
+
}));
|
|
155
152
|
}
|
|
156
153
|
_onCurrencyLocationChange(e) {
|
|
157
154
|
this._updateCurrency({
|
|
@@ -172,8 +169,9 @@ class D extends d {
|
|
|
172
169
|
});
|
|
173
170
|
}
|
|
174
171
|
_onDecimalCountChange(e) {
|
|
172
|
+
const r = parseInt(e);
|
|
175
173
|
this._updateCurrency({
|
|
176
|
-
decimalCount:
|
|
174
|
+
decimalCount: Number.isNaN(r) ? 2 : r
|
|
177
175
|
});
|
|
178
176
|
}
|
|
179
177
|
_listenToFormUpdates() {
|
|
@@ -204,6 +202,6 @@ class D extends d {
|
|
|
204
202
|
}
|
|
205
203
|
}
|
|
206
204
|
export {
|
|
207
|
-
|
|
208
|
-
|
|
205
|
+
E as CURRENCY_CONTROL_ID,
|
|
206
|
+
Y as CurrencyControl
|
|
209
207
|
};
|