@useinsider/guido 2.0.0-beta.5ccd854 → 2.0.0-beta.689d09e
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 +2 -0
- package/dist/@types/config/schemas.js +55 -39
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +15 -17
- package/dist/components/organisms/header/LeftSlot.vue.js +12 -12
- package/dist/components/organisms/header/LeftSlot.vue2.js +6 -6
- package/dist/components/organisms/header/RightSlot.vue2.js +10 -10
- package/dist/composables/useConfig.js +29 -27
- package/dist/composables/useSave.js +13 -11
- package/dist/composables/useStripo.js +42 -40
- package/dist/config/migrator/itemsBlockMigrator.js +184 -125
- package/dist/extensions/Blocks/CouponBlock/constants.js +4 -0
- package/dist/extensions/Blocks/CouponBlock/controls/index.js +29 -0
- package/dist/extensions/Blocks/CouponBlock/extension.js +5 -4
- package/dist/extensions/Blocks/CouponBlock/settingsPanel.js +20 -14
- package/dist/extensions/Blocks/CouponBlock/template.js +22 -11
- package/dist/extensions/Blocks/Items/block.js +1 -1
- package/dist/extensions/Blocks/Items/controls/button/link.js +22 -29
- package/dist/extensions/Blocks/Items/controls/cardComposition.js +59 -36
- package/dist/extensions/Blocks/Items/controls/image/link.js +23 -30
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +25 -25
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +19 -17
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +31 -29
- package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +44 -38
- package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +21 -19
- package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +1 -1
- package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +93 -0
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +99 -95
- package/dist/extensions/Blocks/Items/enums/controlEnums.js +2 -2
- package/dist/extensions/Blocks/Items/enums/productEnums.js +43 -45
- package/dist/extensions/Blocks/Items/enums/settingsEnums.js +2 -1
- package/dist/extensions/Blocks/Items/extension.js +7 -6
- package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +0 -1
- package/dist/extensions/Blocks/Items/layouts/vertical.html.js +0 -1
- package/dist/extensions/Blocks/Items/settingsPanel.js +27 -26
- package/dist/extensions/Blocks/Items/store/items-block.js +9 -5
- package/dist/extensions/Blocks/Items/template.js +285 -221
- package/dist/extensions/Blocks/Items/utils/nodeConfigUtils.js +94 -82
- package/dist/extensions/Blocks/Unsubscribe/extension.js +9 -9
- package/dist/extensions/Blocks/common-control.js +45 -57
- package/dist/extensions/Blocks/controlFactories.js +139 -118
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +53 -48
- package/dist/package.json.js +7 -0
- package/dist/services/stripoApi.js +6 -10
- package/dist/src/@types/config/index.d.ts +2 -2
- package/dist/src/@types/config/schemas.d.ts +30 -0
- package/dist/src/@types/config/types.d.ts +7 -1
- package/dist/src/composables/useConfig.d.ts +8 -0
- package/dist/src/extensions/Blocks/CouponBlock/constants.d.ts +14 -0
- package/dist/src/extensions/Blocks/CouponBlock/controls/index.d.ts +108 -0
- package/dist/src/extensions/Blocks/CouponBlock/template.d.ts +1 -1
- package/dist/src/extensions/Blocks/Items/controls/button/link.d.ts +0 -2
- package/dist/src/extensions/Blocks/Items/controls/cardComposition.d.ts +9 -0
- package/dist/src/extensions/Blocks/Items/controls/image/link.d.ts +0 -2
- package/dist/src/extensions/Blocks/Items/controls/price/singlePrice.d.ts +18 -0
- package/dist/src/extensions/Blocks/Items/enums/controlEnums.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +24 -26
- package/dist/src/extensions/Blocks/Items/enums/settingsEnums.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/store/items-block.d.ts +2 -0
- package/dist/src/extensions/Blocks/Items/template.d.ts +3 -1
- package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +4 -2
- package/dist/src/extensions/Blocks/common-control.d.ts +1 -7
- package/dist/src/extensions/Blocks/controlFactories.d.ts +30 -7
- package/dist/src/stores/config.d.ts +164 -1
- package/dist/static/styles/components/button.css.js +1 -1
- package/dist/stores/config.js +7 -0
- package/dist/utils/pairProductVariables.js +61 -58
- package/package.json +1 -1
- 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 -67
- package/dist/extensions/Blocks/Items/utils/updateAttributes.js +0 -46
- 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
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ModificationDescription as
|
|
2
|
-
import { DefaultConfigValues as
|
|
1
|
+
import { ModificationDescription as b } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { DefaultConfigValues as r, SETTINGS_ENUMS as n, ItemInCartOptions as g } from "../enums/settingsEnums.js";
|
|
3
3
|
function d() {
|
|
4
4
|
return String(Date.now() + Math.floor(Math.random() * 1e3));
|
|
5
5
|
}
|
|
@@ -9,36 +9,39 @@ function f() {
|
|
|
9
9
|
blockInstanceId: d(),
|
|
10
10
|
source: n.ITEMS_TYPE.CART_ITEMS,
|
|
11
11
|
type: n.ITEMS_TYPE.CART_ITEMS,
|
|
12
|
-
itemsSelectValue:
|
|
12
|
+
itemsSelectValue: r.cartItemsSelectControlValue,
|
|
13
13
|
orientation: n.ORIENTATION.VERTICAL,
|
|
14
|
-
nameTrimming:
|
|
15
|
-
nameControlEnabled:
|
|
16
|
-
priceHideDiscount:
|
|
17
|
-
priceFormatted:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
nameTrimming: r.productNameTrimmingControlValue === "1",
|
|
15
|
+
nameControlEnabled: r.productNameControlEnabled === "1",
|
|
16
|
+
priceHideDiscount: r.productPriceHideDiscountControlValue === "1",
|
|
17
|
+
priceFormatted: r.productPriceFormattedControlValue === "1",
|
|
18
|
+
priceSinglePrice: !1,
|
|
19
|
+
priceCurrencySymbol: r.productPriceCurrencySymbolControlValue,
|
|
20
|
+
priceCurrencyLocation: r.productPriceCurrencyLocationControlValue,
|
|
21
|
+
priceControlOpened: r.productPriceControlOpened === "1",
|
|
21
22
|
priceOrientation: "horizontal",
|
|
22
|
-
quantityControlEnabled:
|
|
23
|
-
buttonLink:
|
|
24
|
-
imageLink:
|
|
23
|
+
quantityControlEnabled: r.productQuantityControlEnabled === "1",
|
|
24
|
+
buttonLink: r.productButtonLinkControlValue,
|
|
25
|
+
imageLink: r.productImageLinkControlValue,
|
|
25
26
|
buttonLabel: "Buy",
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
buttonFullWidth: !0,
|
|
28
|
+
// Default to full width (es-fw class)
|
|
29
|
+
imageVisible: r.productImageVisible === "1",
|
|
30
|
+
nameVisible: r.productNameVisible === "1",
|
|
31
|
+
quantityVisible: r.productQuantityVisible === "1",
|
|
32
|
+
priceVisible: r.productPriceVisible === "1",
|
|
33
|
+
originalPriceVisible: r.productOriginalPriceVisible === "1",
|
|
34
|
+
buttonVisible: r.productButtonVisible === "1"
|
|
32
35
|
};
|
|
33
36
|
}
|
|
34
|
-
function
|
|
35
|
-
if (!
|
|
37
|
+
function p(o) {
|
|
38
|
+
if (!o)
|
|
36
39
|
return null;
|
|
37
|
-
const t =
|
|
38
|
-
return t ||
|
|
40
|
+
const t = o.closest(".items-block-v2");
|
|
41
|
+
return t || o.closest(".esd-cart-items-block");
|
|
39
42
|
}
|
|
40
|
-
function m(
|
|
41
|
-
return
|
|
43
|
+
function m(o) {
|
|
44
|
+
return o ? {
|
|
42
45
|
CartItems: n.ITEMS_TYPE.CART_ITEMS,
|
|
43
46
|
BrowsedItems: n.ITEMS_TYPE.BROWSED_ITEMS,
|
|
44
47
|
PurchasedItems: n.ITEMS_TYPE.PURCHASED_ITEMS,
|
|
@@ -46,127 +49,136 @@ function m(r) {
|
|
|
46
49
|
CART_ITEMS: n.ITEMS_TYPE.CART_ITEMS,
|
|
47
50
|
BROWSED_ITEMS: n.ITEMS_TYPE.BROWSED_ITEMS,
|
|
48
51
|
PURCHASED_ITEMS: n.ITEMS_TYPE.PURCHASED_ITEMS
|
|
49
|
-
}[
|
|
52
|
+
}[o] || n.ITEMS_TYPE.CART_ITEMS : n.ITEMS_TYPE.CART_ITEMS;
|
|
50
53
|
}
|
|
51
|
-
function C(
|
|
52
|
-
if (!
|
|
53
|
-
return
|
|
54
|
-
if (
|
|
55
|
-
return
|
|
56
|
-
if (/^\d+$/.test(
|
|
57
|
-
const
|
|
58
|
-
if (
|
|
59
|
-
return
|
|
54
|
+
function C(o, t) {
|
|
55
|
+
if (!o)
|
|
56
|
+
return r.cartItemsSelectControlValue;
|
|
57
|
+
if (o.includes("{{"))
|
|
58
|
+
return o;
|
|
59
|
+
if (/^\d+$/.test(o)) {
|
|
60
|
+
const e = parseInt(o) - 1, i = g[t];
|
|
61
|
+
if (i && i[e])
|
|
62
|
+
return i[e].value;
|
|
60
63
|
}
|
|
61
|
-
return
|
|
64
|
+
return r.cartItemsSelectControlValue;
|
|
62
65
|
}
|
|
63
|
-
function I(
|
|
64
|
-
const t =
|
|
66
|
+
function I(o) {
|
|
67
|
+
const t = o.querySelector("esd-config-block");
|
|
65
68
|
if (!t)
|
|
66
69
|
return null;
|
|
67
|
-
const
|
|
70
|
+
const e = (c, a) => c == null ? a : c === "1" || c === "true", i = (c, a) => c || a, l = t.getAttribute("data-type"), u = m(l), s = t.getAttribute("data-cart_items_select_control_value"), _ = C(s, u);
|
|
68
71
|
return {
|
|
69
|
-
initialized:
|
|
70
|
-
blockInstanceId:
|
|
72
|
+
initialized: e(t.getAttribute("data-initialized"), !1),
|
|
73
|
+
blockInstanceId: i(
|
|
71
74
|
t.getAttribute("data-block-instance-id"),
|
|
72
75
|
d()
|
|
73
76
|
),
|
|
74
77
|
source: u,
|
|
75
78
|
type: u,
|
|
76
|
-
itemsSelectValue:
|
|
79
|
+
itemsSelectValue: _,
|
|
77
80
|
orientation: t.getAttribute("data-card_orientation_control_value") || n.ORIENTATION.VERTICAL,
|
|
78
|
-
nameTrimming:
|
|
79
|
-
t.getAttribute("data-
|
|
81
|
+
nameTrimming: e(
|
|
82
|
+
t.getAttribute("data-product_name_control_trim"),
|
|
80
83
|
!0
|
|
81
84
|
),
|
|
82
|
-
nameControlEnabled:
|
|
85
|
+
nameControlEnabled: e(
|
|
83
86
|
t.getAttribute("data-product_name_control_enabled"),
|
|
84
87
|
!0
|
|
85
88
|
),
|
|
86
|
-
priceHideDiscount:
|
|
87
|
-
t.getAttribute("data-
|
|
89
|
+
priceHideDiscount: e(
|
|
90
|
+
t.getAttribute("data-product_price_control_nodup"),
|
|
88
91
|
!0
|
|
89
92
|
),
|
|
90
|
-
priceFormatted:
|
|
91
|
-
t.getAttribute("data-
|
|
93
|
+
priceFormatted: e(
|
|
94
|
+
t.getAttribute("data-product_price_control_formated"),
|
|
92
95
|
!0
|
|
93
96
|
),
|
|
94
|
-
|
|
97
|
+
priceSinglePrice: e(
|
|
98
|
+
t.getAttribute("data-product_price_control_single_price"),
|
|
99
|
+
!1
|
|
100
|
+
),
|
|
101
|
+
priceCurrencySymbol: i(
|
|
95
102
|
t.getAttribute("data-product_price_currency_symbol"),
|
|
96
|
-
|
|
103
|
+
r.productPriceCurrencySymbolControlValue
|
|
97
104
|
),
|
|
98
|
-
priceCurrencyLocation:
|
|
105
|
+
priceCurrencyLocation: i(
|
|
99
106
|
t.getAttribute("data-product_price_currency_location"),
|
|
100
|
-
|
|
107
|
+
r.productPriceCurrencyLocationControlValue
|
|
101
108
|
),
|
|
102
|
-
priceControlOpened:
|
|
109
|
+
priceControlOpened: e(
|
|
103
110
|
t.getAttribute("data-product_price_control_opened"),
|
|
104
111
|
!0
|
|
105
112
|
),
|
|
106
113
|
priceOrientation: t.getAttribute("data-product_original_price_control_orientation") || "horizontal",
|
|
107
|
-
quantityControlEnabled:
|
|
114
|
+
quantityControlEnabled: e(
|
|
108
115
|
t.getAttribute("data-product_quantity_control_enabled"),
|
|
109
116
|
!0
|
|
110
117
|
),
|
|
111
|
-
buttonLink:
|
|
118
|
+
buttonLink: i(
|
|
112
119
|
t.getAttribute("data-product_button_link"),
|
|
113
|
-
|
|
120
|
+
r.productButtonLinkControlValue
|
|
114
121
|
),
|
|
115
|
-
imageLink:
|
|
122
|
+
imageLink: i(
|
|
116
123
|
t.getAttribute("data-product_image_link"),
|
|
117
|
-
|
|
124
|
+
r.productImageLinkControlValue
|
|
118
125
|
),
|
|
119
|
-
buttonLabel:
|
|
126
|
+
buttonLabel: i(
|
|
120
127
|
t.getAttribute("data-product_button_control_label"),
|
|
121
128
|
"Buy"
|
|
122
129
|
),
|
|
123
|
-
|
|
124
|
-
t.getAttribute("data-
|
|
130
|
+
buttonFullWidth: e(
|
|
131
|
+
t.getAttribute("data-product_button_control_atw"),
|
|
125
132
|
!0
|
|
133
|
+
// Default to full width
|
|
126
134
|
),
|
|
127
|
-
|
|
128
|
-
t.getAttribute("data-
|
|
135
|
+
imageVisible: e(
|
|
136
|
+
t.getAttribute("data-product_image_control_enabled"),
|
|
129
137
|
!0
|
|
130
138
|
),
|
|
131
|
-
|
|
139
|
+
nameVisible: e(
|
|
140
|
+
t.getAttribute("data-product_name_control_enabled"),
|
|
141
|
+
!0
|
|
142
|
+
),
|
|
143
|
+
quantityVisible: e(
|
|
132
144
|
t.getAttribute("data-product_quantity_visible"),
|
|
133
145
|
!0
|
|
134
146
|
),
|
|
135
|
-
priceVisible:
|
|
147
|
+
priceVisible: e(
|
|
136
148
|
t.getAttribute("data-product_price_visible"),
|
|
137
149
|
!0
|
|
138
150
|
),
|
|
139
|
-
originalPriceVisible:
|
|
151
|
+
originalPriceVisible: e(
|
|
140
152
|
t.getAttribute("data-product_original_price_control_enabled"),
|
|
141
153
|
!0
|
|
142
154
|
),
|
|
143
|
-
buttonVisible:
|
|
155
|
+
buttonVisible: e(
|
|
144
156
|
t.getAttribute("data-product_button_visible"),
|
|
145
157
|
!0
|
|
146
158
|
)
|
|
147
159
|
};
|
|
148
160
|
}
|
|
149
|
-
function S(
|
|
150
|
-
const t =
|
|
161
|
+
function S(o) {
|
|
162
|
+
const t = p(o);
|
|
151
163
|
if (!t)
|
|
152
164
|
return null;
|
|
153
|
-
const
|
|
154
|
-
if (
|
|
155
|
-
return
|
|
156
|
-
const
|
|
157
|
-
return
|
|
165
|
+
const e = t.getNodeConfig();
|
|
166
|
+
if (e && e.initialized)
|
|
167
|
+
return e;
|
|
168
|
+
const i = I(t);
|
|
169
|
+
return i || null;
|
|
158
170
|
}
|
|
159
|
-
function
|
|
160
|
-
const
|
|
161
|
-
if (!
|
|
171
|
+
function A(o, t, e) {
|
|
172
|
+
const i = p(o);
|
|
173
|
+
if (!i)
|
|
162
174
|
return;
|
|
163
|
-
const u = { ...
|
|
164
|
-
t.getDocumentModifier().modifyHtml(
|
|
175
|
+
const u = { ...i.getNodeConfig() || {}, ...e };
|
|
176
|
+
t.getDocumentModifier().modifyHtml(i).setNodeConfig(u).apply(new b("Update Items block configuration"));
|
|
165
177
|
}
|
|
166
178
|
export {
|
|
167
179
|
d as generateBlockInstanceId,
|
|
168
180
|
f as getDefaultItemsBlockConfig,
|
|
169
181
|
S as getItemsBlockConfig,
|
|
170
|
-
|
|
171
|
-
|
|
182
|
+
p as getItemsBlockContainer,
|
|
183
|
+
A as setItemsBlockConfig
|
|
172
184
|
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { ExtensionBuilder as e } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
2
|
import { UnsubscribeBlock as i } from "./block.js";
|
|
3
3
|
import { UnsubscribeControl as t } from "./control.js";
|
|
4
|
-
import { PreviewUIElement as
|
|
5
|
-
import { UnsubscribeIconsRegistry as
|
|
6
|
-
import { SettingsPanel as
|
|
4
|
+
import { PreviewUIElement as s } from "./elements/preview.js";
|
|
5
|
+
import { UnsubscribeIconsRegistry as o } from "./iconsRegistry.js";
|
|
6
|
+
import { SettingsPanel as r } from "./settingsPanel.js";
|
|
7
7
|
import n from "./styles.css.js";
|
|
8
|
-
import { UnsubscribeTagRegistry as
|
|
9
|
-
const
|
|
8
|
+
import { UnsubscribeTagRegistry as c } from "./tagRegistry.js";
|
|
9
|
+
const g = new e().addBlock(i).withSettingsPanelRegistry(r).addControl(t).addUiElement(s).addStyles(n).withLocalization({
|
|
10
10
|
en: {
|
|
11
|
-
"Unsubscribe Block": "Unsubscribe
|
|
12
|
-
"Unsubscribe Block Description": "
|
|
11
|
+
"Unsubscribe Block": "Unsubscribe",
|
|
12
|
+
"Unsubscribe Block Description": "Unsubscribe lets you add an Unsubscribe Link to direct users to opt out of receiving your messages.",
|
|
13
13
|
"Select Template": "Select Template",
|
|
14
14
|
"Unsubscribe Template": "Unsubscribe Template",
|
|
15
15
|
Showing: "Showing",
|
|
16
16
|
of: "of"
|
|
17
17
|
}
|
|
18
|
-
}).withUiElementTagRegistry(
|
|
18
|
+
}).withUiElementTagRegistry(c).withIconsRegistry(o).build();
|
|
19
19
|
export {
|
|
20
|
-
|
|
20
|
+
g as default
|
|
21
21
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { Control as
|
|
5
|
-
class
|
|
1
|
+
var I = Object.defineProperty;
|
|
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
|
-
|
|
9
|
-
|
|
8
|
+
u(this, "currentNode");
|
|
9
|
+
u(this, "lastBlockInstanceId", null);
|
|
10
10
|
}
|
|
11
11
|
getContainer() {
|
|
12
12
|
var e;
|
|
@@ -26,16 +26,7 @@ class B extends s {
|
|
|
26
26
|
return this.currentNode ? this.currentNode.closest(".items-block-v2") : null;
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
|
-
* Gets the
|
|
30
|
-
* @deprecated Use getNodeConfig() from nodeConfigUtils instead for Stripo V2
|
|
31
|
-
* @returns The config block element or null if not found
|
|
32
|
-
*/
|
|
33
|
-
getConfigBlock() {
|
|
34
|
-
const e = this.getItemsBlockContainer();
|
|
35
|
-
return e ? e.querySelector("esd-config-block") : null;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Gets the current block instance ID from the node config (Stripo V2) or legacy config block.
|
|
29
|
+
* Gets the current block instance ID from the node config (Stripo V2).
|
|
39
30
|
* @returns The block instance ID or null if not found
|
|
40
31
|
*/
|
|
41
32
|
getBlockInstanceId() {
|
|
@@ -43,10 +34,7 @@ class B extends s {
|
|
|
43
34
|
if (!e)
|
|
44
35
|
return null;
|
|
45
36
|
const n = e.getNodeConfig();
|
|
46
|
-
|
|
47
|
-
return n.blockInstanceId;
|
|
48
|
-
const o = this.getConfigBlock();
|
|
49
|
-
return o ? o.getAttribute("data-block-instance-id") : null;
|
|
37
|
+
return n && typeof n.blockInstanceId == "string" ? n.blockInstanceId : null;
|
|
50
38
|
}
|
|
51
39
|
/**
|
|
52
40
|
* Handles block instance change detection and syncing.
|
|
@@ -57,16 +45,16 @@ class B extends s {
|
|
|
57
45
|
* @returns true if block instance changed, false otherwise
|
|
58
46
|
*/
|
|
59
47
|
handleBlockInstanceChange(e, n) {
|
|
60
|
-
const
|
|
61
|
-
if (!
|
|
48
|
+
const E = this.getBlockInstanceId();
|
|
49
|
+
if (!E)
|
|
62
50
|
return !1;
|
|
63
|
-
const
|
|
64
|
-
return
|
|
51
|
+
const o = E !== this.lastBlockInstanceId;
|
|
52
|
+
return o ? (this.currentNode && e(this.currentNode), n(), this.lastBlockInstanceId = E) : n(), o;
|
|
65
53
|
}
|
|
66
|
-
_GuLabel({ text: e, name: n = "", position:
|
|
54
|
+
_GuLabel({ text: e, name: n = "", position: E = "top" }) {
|
|
67
55
|
return `
|
|
68
56
|
<${t.LABEL}
|
|
69
|
-
style="${
|
|
57
|
+
style="${E === "top" ? "margin-bottom: 8px;" : ""}"
|
|
70
58
|
${$.LABEL.text}="${e}"
|
|
71
59
|
${$.LABEL.name}="${n || `${e} Label`}">
|
|
72
60
|
</${t.LABEL}>
|
|
@@ -86,59 +74,59 @@ class B extends s {
|
|
|
86
74
|
${$.SELECT_ITEM.value}="${n}">
|
|
87
75
|
</${t.SELECT_ITEM}>`;
|
|
88
76
|
}
|
|
89
|
-
_GuSelect({ name: e, placeholder: n, options:
|
|
77
|
+
_GuSelect({ name: e, placeholder: n, options: E, className: o = "es-180w" }) {
|
|
90
78
|
return `
|
|
91
79
|
<${t.SELECTPICKER}
|
|
92
|
-
class="${
|
|
80
|
+
class="${o}"
|
|
93
81
|
${$.SELECTPICKER.name}="${e}"
|
|
94
82
|
${$.SELECTPICKER.placeholder}="${n}">
|
|
95
|
-
${
|
|
83
|
+
${E.map((a) => this._GuSelectItem(a)).join("")}
|
|
96
84
|
</${t.SELECTPICKER}>
|
|
97
85
|
`;
|
|
98
86
|
}
|
|
99
|
-
_GuTextInput({ name: e, placeholder: n, className:
|
|
87
|
+
_GuTextInput({ name: e, placeholder: n, className: E = "", disabled: o = !1 }) {
|
|
100
88
|
return `
|
|
101
89
|
<${t.TEXT}
|
|
102
|
-
class=${
|
|
90
|
+
class=${E}
|
|
103
91
|
${$.TEXT.name}="${e}"
|
|
104
92
|
placeholder="${n || e}"
|
|
105
|
-
${
|
|
93
|
+
${o ? `${$.TEXT.disabled}="true"` : ""}>
|
|
106
94
|
</${t.TEXT}>
|
|
107
95
|
`;
|
|
108
96
|
}
|
|
109
|
-
_GuCounter({ name: e, maxValue: n, minValue:
|
|
97
|
+
_GuCounter({ name: e, maxValue: n, minValue: E = 1, step: o = 1 }) {
|
|
110
98
|
return `
|
|
111
99
|
<${t.COUNTER}
|
|
112
100
|
${$.COUNTER.name}="${e}"
|
|
113
|
-
${$.COUNTER.minValue}="${
|
|
101
|
+
${$.COUNTER.minValue}="${E}"
|
|
114
102
|
${$.COUNTER.maxValue}="${n}"
|
|
115
|
-
${$.COUNTER.step}="${
|
|
103
|
+
${$.COUNTER.step}="${o}">
|
|
116
104
|
</${t.COUNTER}>
|
|
117
105
|
`;
|
|
118
106
|
}
|
|
119
|
-
_GuRadioButtonItem({ text: e, value: n, icon:
|
|
107
|
+
_GuRadioButtonItem({ text: e, value: n, icon: E }) {
|
|
120
108
|
return `
|
|
121
109
|
<${t.RADIO_ITEM}
|
|
122
110
|
${$.RADIO_ITEM.value}="${n}"
|
|
123
111
|
${e ? `${$.RADIO_ITEM.text}="${e}"` : ""}
|
|
124
|
-
${
|
|
112
|
+
${E ? `${$.RADIO_ITEM.icon}="${E}"` : ""}>
|
|
125
113
|
</${t.RADIO_ITEM}>
|
|
126
114
|
`;
|
|
127
115
|
}
|
|
128
|
-
_GuRadioButton({ name: e, buttons: n, id:
|
|
116
|
+
_GuRadioButton({ name: e, buttons: n, id: E = "" }) {
|
|
129
117
|
return `
|
|
130
118
|
<${t.RADIO_BUTTONS}
|
|
131
|
-
${
|
|
119
|
+
${E ? `id="${E}"` : ""}
|
|
132
120
|
${$.RADIO_BUTTONS.name}="${e}">
|
|
133
|
-
${n.map((
|
|
121
|
+
${n.map((o) => this._GuRadioButtonItem(o)).join("")}
|
|
134
122
|
</${t.RADIO_BUTTONS}>
|
|
135
123
|
`;
|
|
136
124
|
}
|
|
137
|
-
_GuButton({ name: e, label: n, id:
|
|
125
|
+
_GuButton({ name: e, label: n, id: E = "" }) {
|
|
138
126
|
return `
|
|
139
127
|
<${t.BUTTON}
|
|
140
128
|
${$.BUTTON.name}="${e}"
|
|
141
|
-
${
|
|
129
|
+
${E ? `id="${E}"` : ""}
|
|
142
130
|
${$.BUTTON.caption}="${n}"}>
|
|
143
131
|
</${t.BUTTON}>
|
|
144
132
|
`;
|
|
@@ -148,10 +136,10 @@ class B extends s {
|
|
|
148
136
|
* @param param0
|
|
149
137
|
* @returns It returns a button with an icon.
|
|
150
138
|
*/
|
|
151
|
-
_GuIconButton({ name: e, icon: n, className:
|
|
139
|
+
_GuIconButton({ name: e, icon: n, className: E = "" }) {
|
|
152
140
|
return `
|
|
153
141
|
<${t.BUTTON}
|
|
154
|
-
class="${
|
|
142
|
+
class="${E}"
|
|
155
143
|
${$.BUTTON.name}="${e}"
|
|
156
144
|
${$.BUTTON.icon}="${n}">
|
|
157
145
|
</${t.BUTTON}>
|
|
@@ -179,19 +167,19 @@ class B extends s {
|
|
|
179
167
|
* @returns HTML string for the orderable control
|
|
180
168
|
*/
|
|
181
169
|
_GuOrderable(e, n) {
|
|
182
|
-
let
|
|
170
|
+
let E = "";
|
|
183
171
|
n.forEach((a) => {
|
|
184
|
-
const
|
|
185
|
-
|
|
186
|
-
<${t.ORDERABLE_ITEM} ${
|
|
172
|
+
const l = $.ORDERABLE_ITEM && "name" in $.ORDERABLE_ITEM ? $.ORDERABLE_ITEM.name : "name";
|
|
173
|
+
E += `
|
|
174
|
+
<${t.ORDERABLE_ITEM} ${l}="${a.key}">
|
|
187
175
|
${a.content}
|
|
188
176
|
</${t.ORDERABLE_ITEM}>
|
|
189
177
|
`;
|
|
190
178
|
});
|
|
191
|
-
const
|
|
179
|
+
const o = $.ORDERABLE && "name" in $.ORDERABLE ? $.ORDERABLE.name : "name";
|
|
192
180
|
return `
|
|
193
|
-
<${t.ORDERABLE} ${
|
|
194
|
-
${
|
|
181
|
+
<${t.ORDERABLE} ${o}="${e}">
|
|
182
|
+
${E}
|
|
195
183
|
</${t.ORDERABLE}>
|
|
196
184
|
`;
|
|
197
185
|
}
|
|
@@ -232,16 +220,16 @@ class B extends s {
|
|
|
232
220
|
`;
|
|
233
221
|
}
|
|
234
222
|
_GuRadioButtons(e, n) {
|
|
235
|
-
const
|
|
223
|
+
const E = n.map((o) => `
|
|
236
224
|
<${t.RADIO_ITEM}
|
|
237
|
-
${$.RADIO_ITEM.text}="${
|
|
238
|
-
${$.RADIO_ITEM.value}="${
|
|
225
|
+
${$.RADIO_ITEM.text}="${o.text}"
|
|
226
|
+
${$.RADIO_ITEM.value}="${o.value}">
|
|
239
227
|
</${t.RADIO_ITEM}>
|
|
240
228
|
`).join("");
|
|
241
229
|
return `
|
|
242
230
|
<${t.RADIO_BUTTONS}
|
|
243
231
|
${$.RADIO_BUTTONS.name}="${e}">
|
|
244
|
-
${
|
|
232
|
+
${E}
|
|
245
233
|
</${t.RADIO_BUTTONS}>
|
|
246
234
|
`;
|
|
247
235
|
}
|
|
@@ -255,5 +243,5 @@ class B extends s {
|
|
|
255
243
|
}
|
|
256
244
|
}
|
|
257
245
|
export {
|
|
258
|
-
|
|
246
|
+
_ as CommonControl
|
|
259
247
|
};
|