@useinsider/guido 3.0.0-beta.34a1600 → 3.0.0-beta.39155d9
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/@types/config/schemas.js +10 -8
- package/dist/components/Guido.vue.js +3 -3
- package/dist/components/Guido.vue2.js +61 -60
- package/dist/components/organisms/header/EditorActions.vue.js +1 -1
- package/dist/components/organisms/header/EditorActions.vue2.js +6 -6
- package/dist/composables/useCustomFieldAttributes.js +16 -0
- package/dist/composables/useHtmlValidator.js +40 -38
- package/dist/config/compiler/unsubscribeCompilerRules.js +14 -14
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +29 -18
- package/dist/extensions/Blocks/Recommendation/block.js +40 -55
- package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +34 -36
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +15 -12
- package/dist/extensions/Blocks/Recommendation/controls/cardBackground/index.js +4 -4
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +693 -144
- package/dist/extensions/Blocks/Recommendation/controls/customAttribute/index.js +78 -0
- package/dist/extensions/Blocks/Recommendation/controls/{main/layoutOrientation.js → layout/index.js} +27 -32
- package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +15 -15
- package/dist/extensions/Blocks/Recommendation/controls/main/currency.js +24 -24
- package/dist/extensions/Blocks/Recommendation/controls/main/filters.js +2 -2
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +78 -107
- package/dist/extensions/Blocks/Recommendation/controls/main/locale.js +2 -2
- package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +64 -150
- package/dist/extensions/Blocks/Recommendation/controls/main/shuffle.js +2 -2
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +191 -177
- package/dist/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.js +8 -25
- package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +5 -6
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textAfter.js +8 -8
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textBefore.js +21 -21
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textAfter.js +13 -13
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textBefore.js +17 -17
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +100 -94
- package/dist/extensions/Blocks/Recommendation/extension.js +27 -25
- package/dist/extensions/Blocks/Recommendation/recommendation.css.js +125 -36
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +111 -99
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +2 -2
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +63 -34
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +30 -33
- package/dist/extensions/Blocks/Recommendation/templates/index.js +8 -8
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +28 -13
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +25 -44
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +62 -38
- package/dist/extensions/Blocks/common-control.js +41 -90
- package/dist/guido.css +1 -1
- package/dist/services/customFieldAttributesApi.js +21 -0
- package/dist/src/@types/config/schemas.d.ts +4 -0
- package/dist/src/components/Guido.vue.d.ts +1 -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/RightSlot.vue.d.ts +1 -1
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/composables/useCustomFieldAttributes.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +2 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +7 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +10 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/cardBackgroundColorControl.d.ts +25 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +134 -44
- package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/index.d.ts +105 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +3 -2
- package/dist/src/extensions/Blocks/Recommendation/controls/{main/layoutOrientation.d.ts → layout/index.d.ts} +3 -3
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +1 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +20 -38
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +4 -4
- package/dist/src/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.d.ts +1 -23
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscountTextAfterControl.d.ts +15 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscountTextBeforeControl.d.ts +15 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPriceTextAfterControl.d.ts +15 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPriceTextBeforeControl.d.ts +15 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/spacing/index.d.ts +18 -8
- package/dist/src/extensions/Blocks/Recommendation/controls/spacingControl.d.ts +60 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/elementRenderer.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/templates/list/elementRenderer.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +10 -4
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +37 -2
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +0 -13
- package/dist/src/extensions/Blocks/common-control.d.ts +2 -24
- package/dist/src/mock/api/custom-field-attributes.d.ts +2 -0
- package/dist/src/services/customFieldAttributesApi.d.ts +3 -0
- package/dist/src/stores/config.d.ts +18 -0
- package/dist/static/styles/components/wide-panel.css.js +0 -1
- package/dist/static/styles/customEditorStyle.css.js +0 -9
- package/dist/static/styles/variables.css.js +3 -0
- package/package.json +1 -1
- package/dist/extensions/Blocks/Recommendation/controls/main/productCount.js +0 -58
- package/dist/extensions/Blocks/Recommendation/controls/syncInfoMessage.js +0 -65
- package/dist/src/extensions/Blocks/Recommendation/controls/main/productCount.d.ts +0 -28
- package/dist/src/extensions/Blocks/Recommendation/controls/syncInfoMessage.d.ts +0 -34
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { TextPaddingsBuiltInControl as d, ButtonBackgroundColorBuiltInControl as c, TextFontFamilyBuiltInControl as u, TextStyleBuiltInControl as i, TextSizeBuiltInControl as C, TextColorBuiltInControl as g, TextAlignBuiltInControl as a } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { RecommendationBlockId as l } from "../../constants/blockIds.js";
|
|
3
|
+
import { RecommendationControlId as e } from "../../constants/controlIds.js";
|
|
4
|
+
import { BLOCK_ROOT_SELECTOR as I, ATTR_PRODUCT_ATTR as s } from "../../constants/selectors.js";
|
|
5
|
+
function o(t) {
|
|
6
|
+
const n = t.closest(I);
|
|
7
|
+
if (!n)
|
|
8
|
+
return [];
|
|
9
|
+
const r = t.asElement().getAttribute(s);
|
|
10
|
+
if (r) {
|
|
11
|
+
const T = `[esd-extension-block-id="${l.CUSTOM_ATTRIBUTE}"][${s}="${r}"]`;
|
|
12
|
+
return n.querySelectorAll(T);
|
|
13
|
+
}
|
|
14
|
+
return n.querySelectorAll(
|
|
15
|
+
`[esd-extension-block-id="${l.CUSTOM_ATTRIBUTE}"]`
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
const A = class extends a {
|
|
19
|
+
getId() {
|
|
20
|
+
return e.CUSTOM_ATTR_ALIGN;
|
|
21
|
+
}
|
|
22
|
+
getTargetNodes(t) {
|
|
23
|
+
return o(t);
|
|
24
|
+
}
|
|
25
|
+
}, _ = class extends g {
|
|
26
|
+
getId() {
|
|
27
|
+
return e.CUSTOM_ATTR_COLOR;
|
|
28
|
+
}
|
|
29
|
+
getTargetNodes(t) {
|
|
30
|
+
return o(t);
|
|
31
|
+
}
|
|
32
|
+
}, S = class extends C {
|
|
33
|
+
getId() {
|
|
34
|
+
return e.CUSTOM_ATTR_SIZE;
|
|
35
|
+
}
|
|
36
|
+
getTargetNodes(t) {
|
|
37
|
+
return o(t);
|
|
38
|
+
}
|
|
39
|
+
}, m = class extends i {
|
|
40
|
+
getId() {
|
|
41
|
+
return e.CUSTOM_ATTR_STYLE;
|
|
42
|
+
}
|
|
43
|
+
getTargetNodes(t) {
|
|
44
|
+
return o(t);
|
|
45
|
+
}
|
|
46
|
+
}, O = class extends u {
|
|
47
|
+
getId() {
|
|
48
|
+
return e.CUSTOM_ATTR_FONT_FAMILY;
|
|
49
|
+
}
|
|
50
|
+
getTargetNodes(t) {
|
|
51
|
+
return o(t);
|
|
52
|
+
}
|
|
53
|
+
}, R = class extends c {
|
|
54
|
+
getId() {
|
|
55
|
+
return e.CUSTOM_ATTR_BACKGROUND;
|
|
56
|
+
}
|
|
57
|
+
getTargetNodes(t) {
|
|
58
|
+
return o(t);
|
|
59
|
+
}
|
|
60
|
+
}, x = class extends d {
|
|
61
|
+
getId() {
|
|
62
|
+
return e.CUSTOM_ATTR_PADDINGS;
|
|
63
|
+
}
|
|
64
|
+
getTargetNodes(t) {
|
|
65
|
+
return o(t);
|
|
66
|
+
}
|
|
67
|
+
}, k = {
|
|
68
|
+
align: A,
|
|
69
|
+
color: _,
|
|
70
|
+
size: S,
|
|
71
|
+
style: m,
|
|
72
|
+
fontFamily: O,
|
|
73
|
+
background: R,
|
|
74
|
+
paddings: x
|
|
75
|
+
};
|
|
76
|
+
export {
|
|
77
|
+
k as CustomAttributeControls
|
|
78
|
+
};
|
package/dist/extensions/Blocks/Recommendation/controls/{main/layoutOrientation.js → layout/index.js}
RENAMED
|
@@ -1,25 +1,27 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var r = (
|
|
4
|
-
import { ModificationDescription as
|
|
5
|
-
import { CommonControl as
|
|
6
|
-
import {
|
|
1
|
+
var A = Object.defineProperty;
|
|
2
|
+
var p = (e, o, t) => o in e ? A(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t;
|
|
3
|
+
var r = (e, o, t) => p(e, typeof o != "symbol" ? o + "" : o, t);
|
|
4
|
+
import { ModificationDescription as L } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
5
|
+
import { CommonControl as O } from "../../../common-control.js";
|
|
6
|
+
import { ATTR_DATA_CUSTOM_ATTRIBUTES as T } from "../../constants/selectors.js";
|
|
7
|
+
import { LAYOUT_OPTIONS as h, DEFAULT_MOBILE_ROW_SPACING as m, DEFAULT_MOBILE_COLUMN_SPACING as d, DEFAULT_ROW_SPACING as l, DEFAULT_COLUMN_SPACING as C } from "../../constants/layout.js";
|
|
8
|
+
import { DEFAULT_COMPOSITION as g } from "../../constants/defaultConfig.js";
|
|
7
9
|
import { RecommendationConfigService as s } from "../../services/configService.js";
|
|
8
|
-
import { useRecommendationExtensionStore as
|
|
9
|
-
import { getCurrentLayout as
|
|
10
|
-
const I = "recommendation-layout-
|
|
10
|
+
import { useRecommendationExtensionStore as N } from "../../store/recommendation.js";
|
|
11
|
+
import { getCurrentLayout as _, getBlockElement as f, regenerateProductRowsWithStyles as S } from "../main/utils.js";
|
|
12
|
+
const I = "recommendation-layout-control", a = {
|
|
11
13
|
LAYOUT: "layout"
|
|
12
|
-
},
|
|
14
|
+
}, U = "data-card-composition", n = {
|
|
13
15
|
LAYOUT: "data-layout",
|
|
14
16
|
COLUMN_SPACING: "data-column-spacing",
|
|
15
17
|
ROW_SPACING: "data-row-spacing",
|
|
16
18
|
MOBILE_COLUMN_SPACING: "data-mobile-column-spacing",
|
|
17
19
|
MOBILE_ROW_SPACING: "data-mobile-row-spacing"
|
|
18
20
|
};
|
|
19
|
-
class
|
|
21
|
+
class w extends O {
|
|
20
22
|
constructor() {
|
|
21
23
|
super(...arguments);
|
|
22
|
-
r(this, "store",
|
|
24
|
+
r(this, "store", N());
|
|
23
25
|
r(this, "isChangingLayout", !1);
|
|
24
26
|
}
|
|
25
27
|
getId() {
|
|
@@ -28,32 +30,24 @@ class b extends L {
|
|
|
28
30
|
getTemplate() {
|
|
29
31
|
return `
|
|
30
32
|
<div class="layout-control-container">
|
|
31
|
-
${this._GuOnPageMessage({ name: C })}
|
|
32
|
-
|
|
33
33
|
${this._GuTwoColumns([
|
|
34
|
-
this._GuLabel({ text:
|
|
34
|
+
this._GuLabel({ text: "Layout Orientation" }),
|
|
35
35
|
this._GuRadioButton({
|
|
36
36
|
name: a.LAYOUT,
|
|
37
|
-
buttons:
|
|
37
|
+
buttons: h
|
|
38
38
|
})
|
|
39
39
|
])}
|
|
40
40
|
</div>
|
|
41
41
|
`;
|
|
42
42
|
}
|
|
43
43
|
onRender() {
|
|
44
|
-
this.
|
|
45
|
-
C,
|
|
46
|
-
this.api.translate(
|
|
47
|
-
`Note that updating the Layout Orientation, Number of Products and
|
|
48
|
-
Products in One Row settings resets the style of your Recommendation block.`
|
|
49
|
-
)
|
|
50
|
-
), this._setFormValues(), this._listenToFormUpdates();
|
|
44
|
+
this._setFormValues(), this._listenToFormUpdates();
|
|
51
45
|
}
|
|
52
46
|
onTemplateNodeUpdated(t) {
|
|
53
47
|
super.onTemplateNodeUpdated(t), this._setFormValues();
|
|
54
48
|
}
|
|
55
49
|
_setFormValues() {
|
|
56
|
-
const u = s.getConfig(this.currentNode).layout ||
|
|
50
|
+
const u = s.getConfig(this.currentNode).layout || _(this.currentNode);
|
|
57
51
|
this.api.updateValues({
|
|
58
52
|
[a.LAYOUT]: u
|
|
59
53
|
});
|
|
@@ -63,7 +57,7 @@ class b extends L {
|
|
|
63
57
|
* Updates node config, data attribute and regenerates product rows
|
|
64
58
|
*/
|
|
65
59
|
_onLayoutChange(t) {
|
|
66
|
-
if (this.isChangingLayout || !this.currentNode || (s.getConfig(this.currentNode).layout ||
|
|
60
|
+
if (this.isChangingLayout || !this.currentNode || (s.getConfig(this.currentNode).layout || _(this.currentNode)) === t)
|
|
67
61
|
return;
|
|
68
62
|
const c = f(this.currentNode);
|
|
69
63
|
if (c) {
|
|
@@ -74,15 +68,15 @@ class b extends L {
|
|
|
74
68
|
this.currentNode,
|
|
75
69
|
{
|
|
76
70
|
layout: t,
|
|
77
|
-
columnSpacing:
|
|
71
|
+
columnSpacing: C,
|
|
78
72
|
rowSpacing: l,
|
|
79
73
|
mobileColumnSpacing: d,
|
|
80
74
|
mobileRowSpacing: m
|
|
81
75
|
},
|
|
82
76
|
`Changed layout to ${t}`
|
|
83
77
|
), this.store.patchCurrentBlockConfig({ orientation: t });
|
|
84
|
-
const
|
|
85
|
-
t === "list" ? (
|
|
78
|
+
const i = this.api.getDocumentModifier().modifyHtml(c).setAttribute(n.LAYOUT, t).setAttribute(n.COLUMN_SPACING, C.toString()).setAttribute(n.ROW_SPACING, l.toString()).setAttribute(n.MOBILE_COLUMN_SPACING, d.toString()).setAttribute(n.MOBILE_ROW_SPACING, m.toString());
|
|
79
|
+
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.setAttribute(U, g.join(",")).setAttribute(T, "[]"), i.apply(new L(`Update layout to ${t}`)), this._regenerateProductRows(t);
|
|
86
80
|
} finally {
|
|
87
81
|
this.isChangingLayout = !1;
|
|
88
82
|
}
|
|
@@ -94,10 +88,11 @@ class b extends L {
|
|
|
94
88
|
* @param layout - The layout to use for regeneration (passed explicitly to avoid stale DOM reads)
|
|
95
89
|
*/
|
|
96
90
|
_regenerateProductRows(t) {
|
|
97
|
-
this.currentNode &&
|
|
91
|
+
this.currentNode && S({
|
|
98
92
|
currentNode: this.currentNode,
|
|
99
93
|
documentModifier: this.api.getDocumentModifier(),
|
|
100
|
-
layout: t
|
|
94
|
+
layout: t,
|
|
95
|
+
composition: g
|
|
101
96
|
});
|
|
102
97
|
}
|
|
103
98
|
_listenToFormUpdates() {
|
|
@@ -107,6 +102,6 @@ class b extends L {
|
|
|
107
102
|
}
|
|
108
103
|
}
|
|
109
104
|
export {
|
|
110
|
-
I as
|
|
111
|
-
|
|
105
|
+
I as LAYOUT_CONTROL_ID,
|
|
106
|
+
w as LayoutControl
|
|
112
107
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
var c = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var a = (
|
|
4
|
-
import { UEAttr as
|
|
5
|
-
import { CommonControl as
|
|
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
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
|
|
@@ -22,16 +22,16 @@ class T extends d {
|
|
|
22
22
|
return `
|
|
23
23
|
<div class="algorithm-control-container">
|
|
24
24
|
${this._GuTwoColumns([
|
|
25
|
-
this._GuLabel({ text:
|
|
25
|
+
this._GuLabel({ text: "Recommendation Algorithm" }),
|
|
26
26
|
this._GuSelect({
|
|
27
27
|
name: e.ALGORITHM,
|
|
28
|
-
placeholder:
|
|
28
|
+
placeholder: "Select Recommendation Algorithm",
|
|
29
29
|
options: this.store.getActivePredictiveAlgorithms
|
|
30
30
|
}),
|
|
31
|
-
this._GuLabel({ text:
|
|
31
|
+
this._GuLabel({ text: "Product Ids", name: `${e.PRODUCT_IDS}_label` }),
|
|
32
32
|
this._GuTextInput({
|
|
33
33
|
name: e.PRODUCT_IDS,
|
|
34
|
-
placeholder:
|
|
34
|
+
placeholder: "Enter Product Ids",
|
|
35
35
|
className: "es-180w"
|
|
36
36
|
})
|
|
37
37
|
])}
|
|
@@ -58,16 +58,16 @@ class T extends d {
|
|
|
58
58
|
try {
|
|
59
59
|
this.api.setUIEAttribute(
|
|
60
60
|
e.ALGORITHM,
|
|
61
|
-
|
|
61
|
+
h.SELECTPICKER.items,
|
|
62
62
|
t
|
|
63
63
|
);
|
|
64
|
-
} catch (
|
|
65
|
-
console.warn("[AlgorithmControl] Failed to set algorithm options:",
|
|
64
|
+
} catch (s) {
|
|
65
|
+
console.warn("[AlgorithmControl] Failed to set algorithm options:", s);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
_setProductIdsVisibility(t) {
|
|
69
|
-
const
|
|
70
|
-
this.api.setVisibility(e.PRODUCT_IDS,
|
|
69
|
+
const s = (t ?? n.getConfig(this.currentNode).strategy) === "manualMerchandising";
|
|
70
|
+
this.api.setVisibility(e.PRODUCT_IDS, s), this.api.setVisibility(`${e.PRODUCT_IDS}_label`, s);
|
|
71
71
|
}
|
|
72
72
|
_onAlgorithmChange(t) {
|
|
73
73
|
!this.currentNode || n.getConfig(this.currentNode).strategy === t || (n.updateConfig(
|
|
@@ -80,7 +80,7 @@ class T extends d {
|
|
|
80
80
|
_onProductIdsChange(t) {
|
|
81
81
|
if (!this.currentNode)
|
|
82
82
|
return;
|
|
83
|
-
const o = t.split(",").map((
|
|
83
|
+
const o = t.split(",").map((s) => s.trim()).filter(Boolean);
|
|
84
84
|
n.updateConfig(
|
|
85
85
|
this.api,
|
|
86
86
|
this.currentNode,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var c = (
|
|
4
|
-
import { currencyLocationMaps as l, currencyOperators as
|
|
5
|
-
import { UEAttr as
|
|
6
|
-
import { CommonControl as
|
|
1
|
+
var R = Object.defineProperty;
|
|
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
|
+
import { UEAttr as m } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
6
|
+
import { CommonControl as p } from "../../../common-control.js";
|
|
7
7
|
import { RecommendationConfigService as s } from "../../services/configService.js";
|
|
8
8
|
import { useRecommendationExtensionStore as d } from "../../store/recommendation.js";
|
|
9
9
|
import { setCurrencyAttributes as S, updatePricesInPlace as N } from "./utils.js";
|
|
@@ -15,7 +15,7 @@ const E = "recommendation-currency-control", t = {
|
|
|
15
15
|
CURRENCY_DECIMAL_SEPARATOR: "currencyDecimalSeparator",
|
|
16
16
|
CURRENCY_DECIMAL_COUNT: "currencyDecimalCount"
|
|
17
17
|
};
|
|
18
|
-
class Y extends
|
|
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
|
|
@@ -30,40 +30,40 @@ class Y extends m {
|
|
|
30
30
|
return `
|
|
31
31
|
<div class="currency-control-container">
|
|
32
32
|
${this._GuTwoColumns([
|
|
33
|
-
this._GuLabel({ text:
|
|
33
|
+
this._GuLabel({ text: "Currency" }),
|
|
34
34
|
this._GuSelect({
|
|
35
35
|
name: t.CURRENCY,
|
|
36
|
-
placeholder:
|
|
36
|
+
placeholder: "Select Currency",
|
|
37
37
|
options: this.store.currencyList
|
|
38
38
|
}),
|
|
39
|
-
this._GuLabel({ text:
|
|
39
|
+
this._GuLabel({ text: "Currency Location" }),
|
|
40
40
|
this._GuSelect({
|
|
41
41
|
name: t.CURRENCY_LOCATION,
|
|
42
|
-
placeholder:
|
|
42
|
+
placeholder: "Select Currency Location",
|
|
43
43
|
options: l
|
|
44
44
|
}),
|
|
45
|
-
this._GuLabel({ text:
|
|
45
|
+
this._GuLabel({ text: "Currency Symbol" }),
|
|
46
46
|
this._GuTextInput({
|
|
47
47
|
name: t.CURRENCY_SYMBOL,
|
|
48
|
-
placeholder:
|
|
48
|
+
placeholder: "Enter Currency Symbol",
|
|
49
49
|
className: "es-180w"
|
|
50
50
|
}),
|
|
51
|
-
this._GuLabel({ text:
|
|
51
|
+
this._GuLabel({ text: "Thousand Separator" }),
|
|
52
52
|
this._GuSelect({
|
|
53
53
|
name: t.CURRENCY_THOUSAND_SEPARATOR,
|
|
54
|
-
placeholder:
|
|
55
|
-
options:
|
|
54
|
+
placeholder: "Select Thousand Separator",
|
|
55
|
+
options: a
|
|
56
56
|
}),
|
|
57
|
-
this._GuLabel({ text:
|
|
57
|
+
this._GuLabel({ text: "Decimal Separator" }),
|
|
58
58
|
this._GuSelect({
|
|
59
59
|
name: t.CURRENCY_DECIMAL_SEPARATOR,
|
|
60
|
-
placeholder:
|
|
61
|
-
options:
|
|
60
|
+
placeholder: "Select Decimal Separator",
|
|
61
|
+
options: a
|
|
62
62
|
}),
|
|
63
|
-
this._GuLabel({ text:
|
|
63
|
+
this._GuLabel({ text: "Decimal Count" }),
|
|
64
64
|
this._GuSelect({
|
|
65
65
|
name: t.CURRENCY_DECIMAL_COUNT,
|
|
66
|
-
placeholder:
|
|
66
|
+
placeholder: "Select Decimal Count",
|
|
67
67
|
options: h
|
|
68
68
|
})
|
|
69
69
|
])}
|
|
@@ -96,12 +96,12 @@ class Y extends m {
|
|
|
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
103
|
Object.entries(r).forEach(([C, n]) => {
|
|
104
|
-
this.api.setUIEAttribute(C,
|
|
104
|
+
this.api.setUIEAttribute(C, m.SELECTPICKER.items, n);
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
107
|
/**
|
|
@@ -21,10 +21,10 @@ class h extends s {
|
|
|
21
21
|
return `
|
|
22
22
|
<div class="filters-control-container">
|
|
23
23
|
${this._GuTwoColumns([
|
|
24
|
-
this._GuLabel({ text:
|
|
24
|
+
this._GuLabel({ text: "Filters" }),
|
|
25
25
|
this._GuButton({
|
|
26
26
|
name: a.FILTERS,
|
|
27
|
-
label:
|
|
27
|
+
label: "Add Filter",
|
|
28
28
|
id: "guido__btn-add-filter"
|
|
29
29
|
})
|
|
30
30
|
])}
|