@useinsider/guido 2.1.0-beta.411f2a9 → 2.1.0-beta.425dfd0
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/config/migrator/itemsBlockMigrator.js +123 -140
- package/dist/extensions/Blocks/Items/block.js +28 -19
- package/dist/extensions/Blocks/Items/controls/button/link.js +31 -19
- package/dist/extensions/Blocks/Items/controls/cardComposition.js +81 -97
- package/dist/extensions/Blocks/Items/controls/image/link.js +31 -19
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +40 -28
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +46 -34
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +50 -45
- package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +51 -40
- package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +35 -23
- package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +57 -45
- package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +62 -42
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +191 -184
- package/dist/extensions/Blocks/Items/enums/settingsEnums.js +2 -0
- package/dist/extensions/Blocks/Items/extension.js +9 -8
- package/dist/extensions/Blocks/Items/store/items-block.js +79 -0
- package/dist/extensions/Blocks/Items/template.js +175 -181
- package/dist/extensions/Blocks/Items/utils/nodeConfigUtils.js +65 -65
- package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +3 -3
- package/dist/extensions/Blocks/common-control.js +92 -91
- package/dist/src/extensions/Blocks/Items/block.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/controls/button/link.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/controls/cardComposition.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/controls/image/link.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/controls/name/trimming.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/controls/price/currencyLocation.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/controls/price/currencySymbol.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/controls/price/formattedPrice.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/controls/price/hideDiscount.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/controls/price/priceOrientation.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/controls/price/singlePrice.d.ts +5 -0
- package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +12 -10
- package/dist/src/extensions/Blocks/Items/store/items-block.d.ts +45 -0
- package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +1 -2
- package/dist/src/extensions/Blocks/common-control.d.ts +5 -4
- package/package.json +1 -1
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
import { ModificationDescription as b } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
-
import { DefaultConfigValues as
|
|
3
|
-
function
|
|
2
|
+
import { DefaultConfigValues as i, SETTINGS_ENUMS as n, ItemInCartOptions as g } from "../enums/settingsEnums.js";
|
|
3
|
+
function d() {
|
|
4
4
|
return String(Date.now() + Math.floor(Math.random() * 1e3));
|
|
5
5
|
}
|
|
6
|
-
const E = (
|
|
6
|
+
const E = (o) => o.replace(/\$/g, "$$$$");
|
|
7
7
|
function S() {
|
|
8
8
|
return {
|
|
9
9
|
initialized: !0,
|
|
10
|
-
blockInstanceId:
|
|
10
|
+
blockInstanceId: d(),
|
|
11
11
|
source: n.ITEMS_TYPE.CART_ITEMS,
|
|
12
12
|
type: n.ITEMS_TYPE.CART_ITEMS,
|
|
13
|
-
itemsSelectValue:
|
|
13
|
+
itemsSelectValue: i.cartItemsSelectControlValue,
|
|
14
14
|
orientation: n.ORIENTATION.VERTICAL,
|
|
15
|
-
nameTrimming:
|
|
16
|
-
priceHideDiscount:
|
|
17
|
-
priceFormatted:
|
|
15
|
+
nameTrimming: i.productNameTrimmingControlValue === "1",
|
|
16
|
+
priceHideDiscount: i.productPriceHideDiscountControlValue === "1",
|
|
17
|
+
priceFormatted: i.productPriceFormattedControlValue === "1",
|
|
18
18
|
priceSinglePrice: !1,
|
|
19
|
-
priceCurrencySymbol:
|
|
20
|
-
priceCurrencyLocation:
|
|
19
|
+
priceCurrencySymbol: i.productPriceCurrencySymbolControlValue,
|
|
20
|
+
priceCurrencyLocation: i.productPriceCurrencyLocationControlValue,
|
|
21
21
|
priceOrientation: "horizontal",
|
|
22
|
-
quantityControlEnabled:
|
|
23
|
-
buttonLink:
|
|
24
|
-
imageLink:
|
|
22
|
+
quantityControlEnabled: i.productQuantityControlEnabled === "1",
|
|
23
|
+
buttonLink: i.productButtonLinkControlValue,
|
|
24
|
+
imageLink: i.productImageLinkControlValue,
|
|
25
25
|
buttonLabel: "Buy",
|
|
26
26
|
buttonFullWidth: !0,
|
|
27
27
|
// Default to full width (es-fw class)
|
|
28
|
-
imageVisible:
|
|
29
|
-
nameVisible:
|
|
30
|
-
quantityVisible:
|
|
31
|
-
priceVisible:
|
|
32
|
-
originalPriceVisible:
|
|
33
|
-
buttonVisible:
|
|
28
|
+
imageVisible: i.productImageVisible === "1",
|
|
29
|
+
nameVisible: i.productNameVisible === "1",
|
|
30
|
+
quantityVisible: i.productQuantityVisible === "1",
|
|
31
|
+
priceVisible: i.productPriceVisible === "1",
|
|
32
|
+
originalPriceVisible: i.productOriginalPriceVisible === "1",
|
|
33
|
+
buttonVisible: i.productButtonVisible === "1"
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
if (!
|
|
36
|
+
function s(o) {
|
|
37
|
+
if (!o)
|
|
38
38
|
return null;
|
|
39
|
-
const t =
|
|
40
|
-
return t ||
|
|
39
|
+
const t = o.closest(".items-block-v2");
|
|
40
|
+
return t || o.closest(".esd-cart-items-block");
|
|
41
41
|
}
|
|
42
|
-
function m(
|
|
43
|
-
return
|
|
42
|
+
function m(o) {
|
|
43
|
+
return o ? {
|
|
44
44
|
CartItems: n.ITEMS_TYPE.CART_ITEMS,
|
|
45
45
|
BrowsedItems: n.ITEMS_TYPE.BROWSED_ITEMS,
|
|
46
46
|
PurchasedItems: n.ITEMS_TYPE.PURCHASED_ITEMS,
|
|
@@ -48,34 +48,34 @@ function m(r) {
|
|
|
48
48
|
CART_ITEMS: n.ITEMS_TYPE.CART_ITEMS,
|
|
49
49
|
BROWSED_ITEMS: n.ITEMS_TYPE.BROWSED_ITEMS,
|
|
50
50
|
PURCHASED_ITEMS: n.ITEMS_TYPE.PURCHASED_ITEMS
|
|
51
|
-
}[
|
|
51
|
+
}[o] || n.ITEMS_TYPE.CART_ITEMS : n.ITEMS_TYPE.CART_ITEMS;
|
|
52
52
|
}
|
|
53
|
-
function I(
|
|
54
|
-
if (!
|
|
55
|
-
return
|
|
56
|
-
if (
|
|
57
|
-
return
|
|
58
|
-
if (/^\d+$/.test(
|
|
59
|
-
const e = parseInt(
|
|
60
|
-
if (
|
|
61
|
-
return
|
|
53
|
+
function I(o, t) {
|
|
54
|
+
if (!o)
|
|
55
|
+
return i.cartItemsSelectControlValue;
|
|
56
|
+
if (o.includes("{{"))
|
|
57
|
+
return o;
|
|
58
|
+
if (/^\d+$/.test(o)) {
|
|
59
|
+
const e = parseInt(o) - 1, r = g[t];
|
|
60
|
+
if (r && r[e])
|
|
61
|
+
return r[e].value;
|
|
62
62
|
}
|
|
63
|
-
return
|
|
63
|
+
return i.cartItemsSelectControlValue;
|
|
64
64
|
}
|
|
65
|
-
function C(
|
|
66
|
-
const t =
|
|
65
|
+
function C(o) {
|
|
66
|
+
const t = o.querySelector("esd-config-block");
|
|
67
67
|
if (!t)
|
|
68
68
|
return null;
|
|
69
|
-
const e = (c,
|
|
69
|
+
const e = (c, a) => c == null ? a : c === "1" || c === "true", r = (c, a) => c || a, l = t.getAttribute("data-type"), u = m(l), _ = t.getAttribute("data-cart_items_select_control_value"), p = I(_, u);
|
|
70
70
|
return {
|
|
71
71
|
initialized: e(t.getAttribute("data-initialized"), !1),
|
|
72
|
-
blockInstanceId:
|
|
72
|
+
blockInstanceId: r(
|
|
73
73
|
t.getAttribute("data-block-instance-id"),
|
|
74
|
-
|
|
74
|
+
d()
|
|
75
75
|
),
|
|
76
|
-
source:
|
|
77
|
-
type:
|
|
78
|
-
itemsSelectValue:
|
|
76
|
+
source: u,
|
|
77
|
+
type: u,
|
|
78
|
+
itemsSelectValue: p,
|
|
79
79
|
orientation: t.getAttribute("data-card_orientation_control_value") || n.ORIENTATION.VERTICAL,
|
|
80
80
|
nameTrimming: e(
|
|
81
81
|
t.getAttribute("data-product_name_control_trim"),
|
|
@@ -93,28 +93,28 @@ function C(r) {
|
|
|
93
93
|
t.getAttribute("data-product_price_control_single_price"),
|
|
94
94
|
!1
|
|
95
95
|
),
|
|
96
|
-
priceCurrencySymbol:
|
|
97
|
-
t.getAttribute("data-
|
|
98
|
-
|
|
96
|
+
priceCurrencySymbol: r(
|
|
97
|
+
t.getAttribute("data-product_price_currency_symbol"),
|
|
98
|
+
i.productPriceCurrencySymbolControlValue
|
|
99
99
|
),
|
|
100
|
-
priceCurrencyLocation:
|
|
100
|
+
priceCurrencyLocation: r(
|
|
101
101
|
t.getAttribute("data-product_price_currency_location"),
|
|
102
|
-
|
|
102
|
+
i.productPriceCurrencyLocationControlValue
|
|
103
103
|
),
|
|
104
104
|
priceOrientation: t.getAttribute("data-product_original_price_control_orientation") || "horizontal",
|
|
105
105
|
quantityControlEnabled: e(
|
|
106
106
|
t.getAttribute("data-product_quantity_control_enabled"),
|
|
107
107
|
!0
|
|
108
108
|
),
|
|
109
|
-
buttonLink:
|
|
109
|
+
buttonLink: r(
|
|
110
110
|
t.getAttribute("data-product_button_link"),
|
|
111
|
-
|
|
111
|
+
i.productButtonLinkControlValue
|
|
112
112
|
),
|
|
113
|
-
imageLink:
|
|
113
|
+
imageLink: r(
|
|
114
114
|
t.getAttribute("data-product_image_link"),
|
|
115
|
-
|
|
115
|
+
i.productImageLinkControlValue
|
|
116
116
|
),
|
|
117
|
-
buttonLabel:
|
|
117
|
+
buttonLabel: r(
|
|
118
118
|
t.getAttribute("data-product_button_control_label"),
|
|
119
119
|
"Buy"
|
|
120
120
|
),
|
|
@@ -149,28 +149,28 @@ function C(r) {
|
|
|
149
149
|
)
|
|
150
150
|
};
|
|
151
151
|
}
|
|
152
|
-
function y(
|
|
153
|
-
const t =
|
|
152
|
+
function y(o) {
|
|
153
|
+
const t = s(o);
|
|
154
154
|
if (!t)
|
|
155
155
|
return null;
|
|
156
156
|
const e = t.getNodeConfig();
|
|
157
157
|
if (e && e.initialized)
|
|
158
158
|
return e;
|
|
159
|
-
const
|
|
160
|
-
return
|
|
159
|
+
const r = C(t);
|
|
160
|
+
return r || null;
|
|
161
161
|
}
|
|
162
|
-
function A(
|
|
163
|
-
const
|
|
164
|
-
if (!
|
|
162
|
+
function A(o, t, e) {
|
|
163
|
+
const r = s(o);
|
|
164
|
+
if (!r)
|
|
165
165
|
return;
|
|
166
|
-
const
|
|
167
|
-
|
|
166
|
+
const u = { ...r.getNodeConfig() || {}, ...e };
|
|
167
|
+
t.getDocumentModifier().modifyHtml(r).setNodeConfig(u).apply(new b("Update Items block configuration"));
|
|
168
168
|
}
|
|
169
169
|
export {
|
|
170
170
|
E as escapeReplacement,
|
|
171
|
-
|
|
171
|
+
d as generateBlockInstanceId,
|
|
172
172
|
S as getDefaultItemsBlockConfig,
|
|
173
173
|
y as getItemsBlockConfig,
|
|
174
|
-
|
|
174
|
+
s as getItemsBlockContainer,
|
|
175
175
|
A as setItemsBlockConfig
|
|
176
176
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
function a(n) {
|
|
2
|
-
return "getInnerHTML" in n && typeof n.getInnerHTML == "function" ? n.getInnerHTML()
|
|
2
|
+
return "getInnerHTML" in n && typeof n.getInnerHTML == "function" ? n.getInnerHTML() : "innerHTML" in n ? n.innerHTML : "";
|
|
3
3
|
}
|
|
4
|
-
function
|
|
4
|
+
function H(n, t) {
|
|
5
5
|
if (!n)
|
|
6
6
|
return t;
|
|
7
7
|
const r = a(n);
|
|
@@ -21,5 +21,5 @@ function m(n, t) {
|
|
|
21
21
|
return i.length > 0 ? i.join("") + t + s.join("") : t;
|
|
22
22
|
}
|
|
23
23
|
export {
|
|
24
|
-
|
|
24
|
+
H as preserveTextStyles
|
|
25
25
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var I = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var u = (T, r, e) =>
|
|
4
|
-
import { Control as
|
|
5
|
-
class _ extends
|
|
2
|
+
var c = (T, r, e) => r in T ? I(T, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : T[r] = e;
|
|
3
|
+
var u = (T, r, e) => c(T, typeof r != "symbol" ? r + "" : r, e);
|
|
4
|
+
import { Control as O, UIElementType as t, UEAttr as $ } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
5
|
+
class _ extends O {
|
|
6
6
|
constructor() {
|
|
7
7
|
super(...arguments);
|
|
8
8
|
u(this, "currentNode");
|
|
@@ -33,100 +33,101 @@ class _ extends c {
|
|
|
33
33
|
const e = this.getItemsBlockContainer();
|
|
34
34
|
if (!e)
|
|
35
35
|
return null;
|
|
36
|
-
const
|
|
37
|
-
return
|
|
36
|
+
const n = e.getNodeConfig();
|
|
37
|
+
return n && typeof n.blockInstanceId == "string" ? n.blockInstanceId : null;
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
|
-
* Handles block instance change detection and
|
|
41
|
-
* This is a helper method for controls that need to
|
|
40
|
+
* Handles block instance change detection and syncing.
|
|
41
|
+
* This is a helper method for controls that need to sync config when switching between block instances.
|
|
42
42
|
* Uses Stripo V2 nodeConfig API for block instance tracking.
|
|
43
|
-
* @param
|
|
43
|
+
* @param syncFunction - Function to call when block instance changes (to sync from node config)
|
|
44
|
+
* @param updateUI - Function to call to update the UI (called both on change and when same block)
|
|
44
45
|
* @returns true if block instance changed, false otherwise
|
|
45
46
|
*/
|
|
46
|
-
handleBlockInstanceChange(e) {
|
|
47
|
-
const
|
|
48
|
-
if (!
|
|
47
|
+
handleBlockInstanceChange(e, n) {
|
|
48
|
+
const E = this.getBlockInstanceId();
|
|
49
|
+
if (!E)
|
|
49
50
|
return !1;
|
|
50
|
-
const
|
|
51
|
-
return e(),
|
|
51
|
+
const o = E !== this.lastBlockInstanceId;
|
|
52
|
+
return o ? (this.currentNode && e(this.currentNode), n(), this.lastBlockInstanceId = E) : n(), o;
|
|
52
53
|
}
|
|
53
|
-
_GuLabel({ text: e, name:
|
|
54
|
+
_GuLabel({ text: e, name: n = "" }) {
|
|
54
55
|
return `
|
|
55
|
-
<${
|
|
56
|
+
<${t.LABEL}
|
|
56
57
|
${$.LABEL.text}="${e}"
|
|
57
|
-
${$.LABEL.name}="${
|
|
58
|
-
</${
|
|
58
|
+
${$.LABEL.name}="${n || `${e} Label`}">
|
|
59
|
+
</${t.LABEL}>
|
|
59
60
|
`;
|
|
60
61
|
}
|
|
61
62
|
_GuToggle(e) {
|
|
62
63
|
return `
|
|
63
|
-
<${
|
|
64
|
+
<${t.SWITCHER}
|
|
64
65
|
${$.SWITCHER.name}="${e}">
|
|
65
|
-
</${
|
|
66
|
+
</${t.SWITCHER}>
|
|
66
67
|
`;
|
|
67
68
|
}
|
|
68
|
-
_GuSelectItem({ text: e, value:
|
|
69
|
+
_GuSelectItem({ text: e, value: n }) {
|
|
69
70
|
return `
|
|
70
|
-
<${
|
|
71
|
+
<${t.SELECT_ITEM}
|
|
71
72
|
${$.SELECT_ITEM.text}="${e}"
|
|
72
|
-
${$.SELECT_ITEM.value}="${
|
|
73
|
-
</${
|
|
73
|
+
${$.SELECT_ITEM.value}="${n}">
|
|
74
|
+
</${t.SELECT_ITEM}>`;
|
|
74
75
|
}
|
|
75
|
-
_GuSelect({ name: e, placeholder:
|
|
76
|
+
_GuSelect({ name: e, placeholder: n, options: E, className: o = "es-180w" }) {
|
|
76
77
|
return `
|
|
77
|
-
<${
|
|
78
|
+
<${t.SELECTPICKER}
|
|
78
79
|
class="${o}"
|
|
79
80
|
${$.SELECTPICKER.name}="${e}"
|
|
80
|
-
${$.SELECTPICKER.placeholder}="${
|
|
81
|
+
${$.SELECTPICKER.placeholder}="${n}">
|
|
81
82
|
${E.map((a) => this._GuSelectItem(a)).join("")}
|
|
82
|
-
</${
|
|
83
|
+
</${t.SELECTPICKER}>
|
|
83
84
|
`;
|
|
84
85
|
}
|
|
85
|
-
_GuTextInput({ name: e, placeholder:
|
|
86
|
+
_GuTextInput({ name: e, placeholder: n, className: E = "", disabled: o = !1 }) {
|
|
86
87
|
return `
|
|
87
|
-
<${
|
|
88
|
+
<${t.TEXT}
|
|
88
89
|
class=${E}
|
|
89
90
|
${$.TEXT.name}="${e}"
|
|
90
|
-
placeholder="${
|
|
91
|
+
placeholder="${n || e}"
|
|
91
92
|
${o ? `${$.TEXT.disabled}="true"` : ""}>
|
|
92
|
-
</${
|
|
93
|
+
</${t.TEXT}>
|
|
93
94
|
`;
|
|
94
95
|
}
|
|
95
|
-
_GuCounter({ name: e, maxValue:
|
|
96
|
+
_GuCounter({ name: e, maxValue: n, minValue: E = 1, step: o = 1 }) {
|
|
96
97
|
return `
|
|
97
|
-
<${
|
|
98
|
+
<${t.COUNTER}
|
|
98
99
|
${$.COUNTER.name}="${e}"
|
|
99
100
|
${$.COUNTER.minValue}="${E}"
|
|
100
|
-
${$.COUNTER.maxValue}="${
|
|
101
|
+
${$.COUNTER.maxValue}="${n}"
|
|
101
102
|
${$.COUNTER.step}="${o}">
|
|
102
|
-
</${
|
|
103
|
+
</${t.COUNTER}>
|
|
103
104
|
`;
|
|
104
105
|
}
|
|
105
|
-
_GuRadioButtonItem({ text: e, value:
|
|
106
|
+
_GuRadioButtonItem({ text: e, value: n, icon: E }) {
|
|
106
107
|
return `
|
|
107
|
-
<${
|
|
108
|
-
${$.RADIO_ITEM.value}="${
|
|
108
|
+
<${t.RADIO_ITEM}
|
|
109
|
+
${$.RADIO_ITEM.value}="${n}"
|
|
109
110
|
${e ? `${$.RADIO_ITEM.text}="${e}"` : ""}
|
|
110
111
|
${E ? `${$.RADIO_ITEM.icon}="${E}"` : ""}>
|
|
111
|
-
</${
|
|
112
|
+
</${t.RADIO_ITEM}>
|
|
112
113
|
`;
|
|
113
114
|
}
|
|
114
|
-
_GuRadioButton({ name: e, buttons:
|
|
115
|
+
_GuRadioButton({ name: e, buttons: n, id: E = "" }) {
|
|
115
116
|
return `
|
|
116
|
-
<${
|
|
117
|
+
<${t.RADIO_BUTTONS}
|
|
117
118
|
${E ? `id="${E}"` : ""}
|
|
118
119
|
${$.RADIO_BUTTONS.name}="${e}">
|
|
119
|
-
${
|
|
120
|
-
</${
|
|
120
|
+
${n.map((o) => this._GuRadioButtonItem(o)).join("")}
|
|
121
|
+
</${t.RADIO_BUTTONS}>
|
|
121
122
|
`;
|
|
122
123
|
}
|
|
123
|
-
_GuButton({ name: e, label:
|
|
124
|
+
_GuButton({ name: e, label: n, id: E = "" }) {
|
|
124
125
|
return `
|
|
125
|
-
<${
|
|
126
|
+
<${t.BUTTON}
|
|
126
127
|
${$.BUTTON.name}="${e}"
|
|
127
128
|
${E ? `id="${E}"` : ""}
|
|
128
|
-
${$.BUTTON.caption}="${
|
|
129
|
-
</${
|
|
129
|
+
${$.BUTTON.caption}="${n}"}>
|
|
130
|
+
</${t.BUTTON}>
|
|
130
131
|
`;
|
|
131
132
|
}
|
|
132
133
|
/**
|
|
@@ -134,25 +135,25 @@ class _ extends c {
|
|
|
134
135
|
* @param param0
|
|
135
136
|
* @returns It returns a button with an icon.
|
|
136
137
|
*/
|
|
137
|
-
_GuIconButton({ name: e, icon:
|
|
138
|
+
_GuIconButton({ name: e, icon: n, className: E = "" }) {
|
|
138
139
|
return `
|
|
139
|
-
<${
|
|
140
|
+
<${t.BUTTON}
|
|
140
141
|
class="${E}"
|
|
141
142
|
${$.BUTTON.name}="${e}"
|
|
142
|
-
${$.BUTTON.icon}="${
|
|
143
|
-
</${
|
|
143
|
+
${$.BUTTON.icon}="${n}">
|
|
144
|
+
</${t.BUTTON}>
|
|
144
145
|
`;
|
|
145
146
|
}
|
|
146
|
-
_GuOneColumn(e,
|
|
147
|
+
_GuOneColumn(e, n = "") {
|
|
147
148
|
return `
|
|
148
|
-
<div class="container one-column ${
|
|
149
|
+
<div class="container one-column ${n}">
|
|
149
150
|
${e.join("")}
|
|
150
151
|
</div>
|
|
151
152
|
`;
|
|
152
153
|
}
|
|
153
|
-
_GuTwoColumns(e,
|
|
154
|
+
_GuTwoColumns(e, n = "") {
|
|
154
155
|
return `
|
|
155
|
-
<div class="container two-columns ${
|
|
156
|
+
<div class="container two-columns ${n}">
|
|
156
157
|
${e.join("")}
|
|
157
158
|
</div>
|
|
158
159
|
`;
|
|
@@ -164,79 +165,79 @@ class _ extends c {
|
|
|
164
165
|
* @param itemLabels - Optional array of objects with key and label properties for display
|
|
165
166
|
* @returns HTML string for the orderable control
|
|
166
167
|
*/
|
|
167
|
-
_GuOrderable(e,
|
|
168
|
+
_GuOrderable(e, n) {
|
|
168
169
|
let E = "";
|
|
169
|
-
|
|
170
|
+
n.forEach((a) => {
|
|
170
171
|
const l = $.ORDERABLE_ITEM && "name" in $.ORDERABLE_ITEM ? $.ORDERABLE_ITEM.name : "name";
|
|
171
172
|
E += `
|
|
172
|
-
<${
|
|
173
|
+
<${t.ORDERABLE_ITEM} ${l}="${a.key}">
|
|
173
174
|
${a.content}
|
|
174
|
-
</${
|
|
175
|
+
</${t.ORDERABLE_ITEM}>
|
|
175
176
|
`;
|
|
176
177
|
});
|
|
177
178
|
const o = $.ORDERABLE && "name" in $.ORDERABLE ? $.ORDERABLE.name : "name";
|
|
178
179
|
return `
|
|
179
|
-
<${
|
|
180
|
+
<${t.ORDERABLE} ${o}="${e}">
|
|
180
181
|
${E}
|
|
181
|
-
</${
|
|
182
|
+
</${t.ORDERABLE}>
|
|
182
183
|
`;
|
|
183
184
|
}
|
|
184
|
-
_GuNestedControl(e,
|
|
185
|
+
_GuNestedControl(e, n) {
|
|
185
186
|
return `
|
|
186
|
-
<${
|
|
187
|
-
${
|
|
188
|
-
</${
|
|
187
|
+
<${t.NESTED_CONTROL} ${$.NESTED_CONTROL.controlId}="${e}">
|
|
188
|
+
${n}
|
|
189
|
+
</${t.NESTED_CONTROL}>
|
|
189
190
|
`;
|
|
190
191
|
}
|
|
191
|
-
_GuExpandable(e,
|
|
192
|
+
_GuExpandable(e, n) {
|
|
192
193
|
return `
|
|
193
|
-
<${
|
|
194
|
-
<${
|
|
195
|
-
<${
|
|
196
|
-
</${
|
|
197
|
-
<${
|
|
194
|
+
<${t.EXPANDABLE}>
|
|
195
|
+
<${t.EXPANDABLE_HEADER}>
|
|
196
|
+
<${t.LABEL} ${$.LABEL.text}="${e}"></${t.LABEL}>
|
|
197
|
+
</${t.EXPANDABLE_HEADER}>
|
|
198
|
+
<${t.EXPANDABLE_CONTENT}>
|
|
198
199
|
|
|
199
|
-
${
|
|
200
|
+
${n}
|
|
200
201
|
|
|
201
|
-
</${
|
|
202
|
-
</${
|
|
202
|
+
</${t.EXPANDABLE_CONTENT}>
|
|
203
|
+
</${t.EXPANDABLE}>
|
|
203
204
|
`;
|
|
204
205
|
}
|
|
205
206
|
_GuColorPicker(e) {
|
|
206
207
|
return `
|
|
207
|
-
<${
|
|
208
|
+
<${t.COLOR}
|
|
208
209
|
${$.COLOR.name}="${e}">
|
|
209
|
-
</${
|
|
210
|
+
</${t.COLOR}>
|
|
210
211
|
`;
|
|
211
212
|
}
|
|
212
|
-
_GuFontFamily(e,
|
|
213
|
+
_GuFontFamily(e, n = "Select Font") {
|
|
213
214
|
return `
|
|
214
|
-
<${
|
|
215
|
+
<${t.FONT_FAMILY_SELECT}
|
|
215
216
|
${$.FONT_FAMILY_SELECT.name}="${e}"
|
|
216
|
-
${$.FONT_FAMILY_SELECT.placeholder}="${
|
|
217
|
-
</${
|
|
217
|
+
${$.FONT_FAMILY_SELECT.placeholder}="${n}">
|
|
218
|
+
</${t.FONT_FAMILY_SELECT}>
|
|
218
219
|
`;
|
|
219
220
|
}
|
|
220
|
-
_GuRadioButtons(e,
|
|
221
|
-
const E =
|
|
222
|
-
<${
|
|
221
|
+
_GuRadioButtons(e, n) {
|
|
222
|
+
const E = n.map((o) => `
|
|
223
|
+
<${t.RADIO_ITEM}
|
|
223
224
|
${$.RADIO_ITEM.text}="${o.text}"
|
|
224
225
|
${$.RADIO_ITEM.value}="${o.value}">
|
|
225
|
-
</${
|
|
226
|
+
</${t.RADIO_ITEM}>
|
|
226
227
|
`).join("");
|
|
227
228
|
return `
|
|
228
|
-
<${
|
|
229
|
+
<${t.RADIO_BUTTONS}
|
|
229
230
|
${$.RADIO_BUTTONS.name}="${e}">
|
|
230
231
|
${E}
|
|
231
|
-
</${
|
|
232
|
+
</${t.RADIO_BUTTONS}>
|
|
232
233
|
`;
|
|
233
234
|
}
|
|
234
|
-
_GuCheckbox(e,
|
|
235
|
+
_GuCheckbox(e, n) {
|
|
235
236
|
return `
|
|
236
|
-
<${
|
|
237
|
+
<${t.CHECKBOX}
|
|
237
238
|
${$.CHECKBOX.name}="${e}"
|
|
238
|
-
${$.CHECKBOX.caption}="${
|
|
239
|
-
</${
|
|
239
|
+
${$.CHECKBOX.caption}="${n}">
|
|
240
|
+
</${t.CHECKBOX}>
|
|
240
241
|
`;
|
|
241
242
|
}
|
|
242
243
|
}
|
|
@@ -3,6 +3,7 @@ import { CommonControl } from '../../../common-control';
|
|
|
3
3
|
import { ItemsBlockControlId } from '../../enums/controlEnums';
|
|
4
4
|
export declare const CONTROL_BLOCK_ID = ItemsBlockControlId.BUTTON_LINK;
|
|
5
5
|
export declare class ButtonLinkControl extends CommonControl {
|
|
6
|
+
private store;
|
|
6
7
|
getId(): string;
|
|
7
8
|
getTemplate(): string;
|
|
8
9
|
onRender(): void;
|
|
@@ -2,6 +2,7 @@ import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
|
2
2
|
import { CommonControl } from '../../common-control';
|
|
3
3
|
export declare const COMPOSITION_CONTROL_BLOCK_ID = "ui-elements-items-card-composition-block";
|
|
4
4
|
export declare class ItemsBlockCardCompositionControl extends CommonControl {
|
|
5
|
+
private store;
|
|
5
6
|
private visibilityState;
|
|
6
7
|
getId(): string;
|
|
7
8
|
getTemplate(): string;
|
|
@@ -3,6 +3,7 @@ import { CommonControl } from '../../../common-control';
|
|
|
3
3
|
import { ItemsBlockControlId } from '../../enums/controlEnums';
|
|
4
4
|
export declare const CONTROL_BLOCK_ID = ItemsBlockControlId.IMAGE_LINK;
|
|
5
5
|
export declare class ImageLinkControl extends CommonControl {
|
|
6
|
+
private store;
|
|
6
7
|
getId(): string;
|
|
7
8
|
getTemplate(): string;
|
|
8
9
|
onRender(): void;
|
|
@@ -3,6 +3,7 @@ import { CommonControl } from '../../../common-control';
|
|
|
3
3
|
import { ItemsBlockControlId } from '../../enums/controlEnums';
|
|
4
4
|
export declare const CONTROL_BLOCK_ID = ItemsBlockControlId.NAME_TRIMMING;
|
|
5
5
|
export declare class NameTrimmingControl extends CommonControl {
|
|
6
|
+
private store;
|
|
6
7
|
getId(): string;
|
|
7
8
|
getTemplate(): string;
|
|
8
9
|
onRender(): void;
|
|
@@ -3,6 +3,7 @@ import { CommonControl } from '../../../common-control';
|
|
|
3
3
|
import { ItemsBlockControlId } from '../../enums/controlEnums';
|
|
4
4
|
export declare const CONTROL_BLOCK_ID = ItemsBlockControlId.PRICE_CURRENCY_LOCATION;
|
|
5
5
|
export declare class PriceCurrencyLocationControl extends CommonControl {
|
|
6
|
+
private store;
|
|
6
7
|
getId(): string;
|
|
7
8
|
getTemplate(): string;
|
|
8
9
|
onRender(): void;
|
|
@@ -3,6 +3,7 @@ import { CommonControl } from '../../../common-control';
|
|
|
3
3
|
import { ItemsBlockControlId } from '../../enums/controlEnums';
|
|
4
4
|
export declare const CONTROL_BLOCK_ID = ItemsBlockControlId.PRICE_CURRENCY_SYMBOL;
|
|
5
5
|
export declare class PriceCurrencySymbolControl extends CommonControl {
|
|
6
|
+
private store;
|
|
6
7
|
private originalPriceContents;
|
|
7
8
|
getId(): string;
|
|
8
9
|
getTemplate(): string;
|
|
@@ -3,6 +3,7 @@ import { CommonControl } from '../../../common-control';
|
|
|
3
3
|
import { ItemsBlockControlId } from '../../enums/controlEnums';
|
|
4
4
|
export declare const CONTROL_BLOCK_ID = ItemsBlockControlId.PRICE_FORMATTED_PRICE;
|
|
5
5
|
export declare class PriceFormattedPriceControl extends CommonControl {
|
|
6
|
+
private store;
|
|
6
7
|
getId(): string;
|
|
7
8
|
getTemplate(): string;
|
|
8
9
|
onRender(): void;
|
|
@@ -3,6 +3,7 @@ import { CommonControl } from '../../../common-control';
|
|
|
3
3
|
import { ItemsBlockControlId } from '../../enums/controlEnums';
|
|
4
4
|
export declare const CONTROL_BLOCK_ID = ItemsBlockControlId.PRICE_HIDE_DISCOUNT;
|
|
5
5
|
export declare class PriceHideDiscountControl extends CommonControl {
|
|
6
|
+
private store;
|
|
6
7
|
getId(): string;
|
|
7
8
|
getTemplate(): string;
|
|
8
9
|
onRender(): void;
|
|
@@ -3,6 +3,7 @@ import { CommonControl } from '../../../common-control';
|
|
|
3
3
|
import { ItemsBlockControlId } from '../../enums/controlEnums';
|
|
4
4
|
export declare const CONTROL_BLOCK_ID = ItemsBlockControlId.PRICE_ORIENTATION;
|
|
5
5
|
export declare class PriceOrientationControl extends CommonControl {
|
|
6
|
+
private store;
|
|
6
7
|
getId(): string;
|
|
7
8
|
getTemplate(): string;
|
|
8
9
|
onRender(): void;
|
|
@@ -3,10 +3,15 @@ import { CommonControl } from '../../../common-control';
|
|
|
3
3
|
import { ItemsBlockControlId } from '../../enums/controlEnums';
|
|
4
4
|
export declare const CONTROL_BLOCK_ID = ItemsBlockControlId.PRICE_SINGLE_PRICE;
|
|
5
5
|
export declare class PriceSinglePriceControl extends CommonControl {
|
|
6
|
+
private store;
|
|
6
7
|
getId(): string;
|
|
7
8
|
getTemplate(): string;
|
|
8
9
|
onRender(): void;
|
|
9
10
|
onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
|
|
11
|
+
/**
|
|
12
|
+
* Syncs single price state from nodeConfig.
|
|
13
|
+
*/
|
|
14
|
+
private _syncSinglePriceFromNodeConfig;
|
|
10
15
|
_onSinglePriceChange(value: boolean): void;
|
|
11
16
|
private _updatePriceBlock;
|
|
12
17
|
_getSinglePrice(): string;
|