@useinsider/guido 2.0.0-beta.13ba613 → 2.0.0-beta.18d5b06
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/email-preview/PreviewContainer.vue.js +3 -3
- package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.js +8 -8
- package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue2.js +17 -13
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +7 -8
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue2.js +14 -12
- package/dist/components/organisms/email-preview/desktop-preview/DesktopBrowserHeader.vue.js +18 -0
- package/dist/components/organisms/email-preview/desktop-preview/DesktopBrowserHeader.vue2.js +15 -0
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +10 -14
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +14 -22
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +3 -3
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +12 -11
- package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.js +12 -10
- package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.js +11 -10
- package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue2.js +15 -14
- package/dist/components/organisms/header/EditorActions.vue.js +20 -0
- package/dist/components/organisms/header/EditorActions.vue2.js +41 -0
- package/dist/components/organisms/header/EditorToolbar.vue.js +18 -0
- package/dist/components/organisms/header/EditorToolbar.vue2.js +17 -0
- package/dist/components/organisms/header/HeaderWrapper.vue.js +6 -5
- package/dist/components/organisms/header/LeftSlot.vue.js +11 -11
- package/dist/components/organisms/header/LeftSlot.vue2.js +11 -12
- package/dist/components/organisms/header/MiddleSlot.vue.js +7 -7
- package/dist/components/organisms/header/MiddleSlot.vue2.js +11 -15
- package/dist/components/organisms/header/RightSlot.vue.js +11 -14
- package/dist/components/organisms/header/RightSlot.vue2.js +13 -30
- package/dist/components/organisms/header/version-history/VersionHistory.vue.js +5 -5
- package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +15 -15
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +1 -1
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +20 -19
- package/dist/composables/useConfig.js +29 -27
- package/dist/composables/useSave.js +13 -11
- package/dist/composables/useStripo.js +40 -40
- package/dist/config/migrator/index.js +8 -9
- package/dist/enums/academy.js +8 -0
- package/dist/enums/onboarding.js +1 -2
- package/dist/enums/unsubscribe.js +20 -21
- 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 +40 -39
- package/dist/extensions/Blocks/Items/controls/cardComposition.js +49 -46
- package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +26 -28
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +127 -132
- package/dist/extensions/Blocks/Items/enums/settingsEnums.js +2 -2
- package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +48 -58
- package/dist/extensions/Blocks/Items/layouts/vertical.html.js +58 -48
- package/dist/extensions/Blocks/Items/store/items-block.js +2 -2
- package/dist/extensions/Blocks/Items/template.js +123 -296
- package/dist/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.js +20 -11
- package/dist/extensions/Blocks/Recommendation/control.js +1 -1
- package/dist/extensions/Blocks/Unsubscribe/extension.js +9 -9
- package/dist/extensions/Blocks/common-control.js +55 -67
- package/dist/extensions/Blocks/controlFactories.js +122 -111
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +290 -364
- package/dist/package.json.js +1 -1
- 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/components/organisms/email-preview/desktop-preview/DesktopBrowserHeader.vue.d.ts +2 -0
- package/dist/src/components/organisms/header/EditorActions.vue.d.ts +4 -0
- package/dist/src/components/organisms/header/EditorToolbar.vue.d.ts +2 -0
- package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
- package/dist/src/composables/useConfig.d.ts +8 -0
- package/dist/src/enums/academy.d.ts +12 -0
- package/dist/src/enums/onboarding.d.ts +0 -1
- package/dist/src/enums/unsubscribe.d.ts +0 -1
- 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/price/priceOrientation.d.ts +1 -1
- package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +4 -0
- package/dist/src/extensions/Blocks/Items/template.d.ts +1 -20
- package/dist/src/extensions/Blocks/common-control.d.ts +9 -14
- package/dist/src/extensions/Blocks/controlFactories.d.ts +30 -7
- package/dist/src/stores/config.d.ts +164 -1
- package/dist/src/stores/editor.d.ts +21 -0
- package/dist/static/assets/desktop/desktop-mockup-center.svg.js +4 -0
- package/dist/static/assets/desktop/desktop-mockup-left.svg.js +4 -0
- package/dist/static/assets/desktop/desktop-mockup-right.svg.js +4 -0
- package/dist/static/assets/mobile/email-mockup.svg.js +4 -0
- package/dist/static/assets/mobile/inbox-mockup.svg.js +4 -0
- package/dist/static/styles/components/button.css.js +1 -1
- package/dist/stores/config.js +7 -0
- package/dist/stores/editor.js +1 -0
- package/package.json +3 -3
- package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.js +0 -17
- package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue2.js +0 -20
- package/dist/config/migrator/itemsBlockMigrator.js +0 -283
- package/dist/extensions/Blocks/Items/utils/nodeConfigUtils.js +0 -172
- package/dist/src/config/migrator/itemsBlockMigrator.d.ts +0 -6
- package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +0 -71
- package/dist/static/assets/inbox-mockup.svg.js +0 -4
- package/dist/static/assets/phone-mockup.svg.js +0 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useItemsBlockStore as e } from "../store/items-block.js";
|
|
2
2
|
import { syncAttributeFromConfigBlock as r, createBooleanSyncConfig as i, createStringSyncConfig as s } from "./syncAttributeFromConfigBlock.js";
|
|
3
|
-
function
|
|
3
|
+
function m(t) {
|
|
4
4
|
const o = e(), n = i(
|
|
5
5
|
"PRODUCT_NAME_TRIMMING",
|
|
6
6
|
(c) => o.setNameTrimming(c),
|
|
@@ -12,7 +12,7 @@ function f(t) {
|
|
|
12
12
|
const o = e(), n = i(
|
|
13
13
|
"PRODUCT_PRICE_HIDE_DISCOUNT",
|
|
14
14
|
(c) => o.setHideDiscount(c),
|
|
15
|
-
!
|
|
15
|
+
!1
|
|
16
16
|
);
|
|
17
17
|
r(t, n);
|
|
18
18
|
}
|
|
@@ -24,7 +24,7 @@ function R(t) {
|
|
|
24
24
|
);
|
|
25
25
|
r(t, n);
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function O(t) {
|
|
28
28
|
const o = e(), n = s(
|
|
29
29
|
"PRODUCT_PRICE_CURRENCY_SYMBOL",
|
|
30
30
|
(c) => o.setCurrencySymbol(c),
|
|
@@ -32,7 +32,7 @@ function _(t) {
|
|
|
32
32
|
);
|
|
33
33
|
r(t, n);
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function _(t) {
|
|
36
36
|
const o = e(), n = s(
|
|
37
37
|
"PRODUCT_PRICE_CURRENCY_LOCATION",
|
|
38
38
|
(c) => o.setCurrencyLocation(c),
|
|
@@ -40,7 +40,7 @@ function y(t) {
|
|
|
40
40
|
);
|
|
41
41
|
r(t, n);
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function I(t) {
|
|
44
44
|
const o = e(), n = s(
|
|
45
45
|
"PRODUCT_BUTTON_LINK",
|
|
46
46
|
(c) => o.setButtonLink(c),
|
|
@@ -48,7 +48,7 @@ function T(t) {
|
|
|
48
48
|
);
|
|
49
49
|
r(t, n);
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function T(t) {
|
|
52
52
|
const o = e(), n = s(
|
|
53
53
|
"PRODUCT_IMAGE_LINK",
|
|
54
54
|
(c) => o.setImageLink(c),
|
|
@@ -56,12 +56,21 @@ function g(t) {
|
|
|
56
56
|
);
|
|
57
57
|
r(t, n);
|
|
58
58
|
}
|
|
59
|
+
function y(t) {
|
|
60
|
+
const o = e(), n = s(
|
|
61
|
+
"PRODUCT_ORIGINAL_PRICE_CONTROL_ORIENTATION",
|
|
62
|
+
(c) => o.setPriceOrientation(c),
|
|
63
|
+
"horizontal"
|
|
64
|
+
);
|
|
65
|
+
r(t, n);
|
|
66
|
+
}
|
|
59
67
|
export {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
68
|
+
I as syncButtonLinkFromAttributes,
|
|
69
|
+
_ as syncCurrencyLocationFromAttributes,
|
|
70
|
+
O as syncCurrencySymbolFromAttributes,
|
|
63
71
|
R as syncFormattedPriceFromAttributes,
|
|
64
72
|
f as syncHideDiscountFromAttributes,
|
|
65
|
-
|
|
66
|
-
|
|
73
|
+
T as syncImageLinkFromAttributes,
|
|
74
|
+
m as syncNameTrimmingFromAttributes,
|
|
75
|
+
y as syncPriceOrientationFromAttributes
|
|
67
76
|
};
|
|
@@ -289,7 +289,7 @@ class b extends g {
|
|
|
289
289
|
t.CURRENCY_DECIMAL_COUNT
|
|
290
290
|
].forEach((i) => {
|
|
291
291
|
this.api.onValueChanged(i, (a) => this._onCurrencyConfigChange(i, a));
|
|
292
|
-
}), this.api.onValueChanged(t.PRODUCT_COUNT, (i) => this._onDataChange(t.PRODUCT_COUNT,
|
|
292
|
+
}), this.api.onValueChanged(t.PRODUCT_COUNT, (i) => this._onDataChange(t.PRODUCT_COUNT, i.toString())), this.api.onValueChanged(t.PRODUCT_IN_ROW, (i) => this._onDataChange(t.PRODUCT_IN_ROW, i)), this.api.onValueChanged(t.SHUFFLE_PRODUCTS, (i) => this._onDataChange(t.SHUFFLE_PRODUCTS, i)), this.api.onValueChanged(t.RESPONSIVE, (i) => this._onDataChange(t.RESPONSIVE, i)), this.addFilterListener = this._onFilterSelectClick.bind(this), this.addFilterButton = this.getContainer().querySelector("#guido__btn-add-filter"), (o = this.addFilterButton) == null || o.addEventListener("click", this.addFilterListener);
|
|
293
293
|
}
|
|
294
294
|
_listenStateUpdates() {
|
|
295
295
|
this.storeUnsubscription = this.store.$subscribe((e) => {
|
|
@@ -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
1
|
var c = Object.defineProperty;
|
|
2
|
-
var I = (
|
|
3
|
-
var
|
|
4
|
-
import { Control as
|
|
5
|
-
class
|
|
2
|
+
var I = (a, r, e) => r in a ? c(a, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[r] = e;
|
|
3
|
+
var u = (a, r, e) => I(a, 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;
|
|
@@ -19,54 +19,42 @@ class B extends s {
|
|
|
19
19
|
this.lastBlockInstanceId = null;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
|
-
* Gets the
|
|
23
|
-
* @returns The container element or null if not found
|
|
24
|
-
*/
|
|
25
|
-
getItemsBlockContainer() {
|
|
26
|
-
return this.currentNode ? this.currentNode.closest(".items-block-v2") : null;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Gets the config block element from the current node (legacy support).
|
|
30
|
-
* @deprecated Use getNodeConfig() from nodeConfigUtils instead for Stripo V2
|
|
22
|
+
* Gets the config block element from the current node.
|
|
31
23
|
* @returns The config block element or null if not found
|
|
32
24
|
*/
|
|
33
25
|
getConfigBlock() {
|
|
34
|
-
|
|
26
|
+
if (!this.currentNode)
|
|
27
|
+
return null;
|
|
28
|
+
const e = this.currentNode.closest(".items-block-v2");
|
|
35
29
|
return e ? e.querySelector("esd-config-block") : null;
|
|
36
30
|
}
|
|
37
31
|
/**
|
|
38
|
-
* Gets the current block instance ID from the
|
|
32
|
+
* Gets the current block instance ID from the config block.
|
|
33
|
+
* @param blockInstanceIdAttribute - The attribute name for block instance ID (default: 'data-block-instance-id')
|
|
39
34
|
* @returns The block instance ID or null if not found
|
|
40
35
|
*/
|
|
41
|
-
getBlockInstanceId() {
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
return null;
|
|
45
|
-
const n = e.getNodeConfig();
|
|
46
|
-
if (n && typeof n.blockInstanceId == "string")
|
|
47
|
-
return n.blockInstanceId;
|
|
48
|
-
const o = this.getConfigBlock();
|
|
49
|
-
return o ? o.getAttribute("data-block-instance-id") : null;
|
|
36
|
+
getBlockInstanceId(e = "data-block-instance-id") {
|
|
37
|
+
const n = this.getConfigBlock();
|
|
38
|
+
return n ? n.getAttribute(e) : null;
|
|
50
39
|
}
|
|
51
40
|
/**
|
|
52
41
|
* Handles block instance change detection and syncing.
|
|
53
|
-
* This is a helper method for controls that need to sync
|
|
54
|
-
*
|
|
55
|
-
* @param syncFunction - Function to call when block instance changes (to sync from node config)
|
|
42
|
+
* This is a helper method for controls that need to sync attributes when switching between block instances.
|
|
43
|
+
* @param syncFunction - Function to call when block instance changes (to sync from attributes)
|
|
56
44
|
* @param updateUI - Function to call to update the UI (called both on change and when same block)
|
|
45
|
+
* @param blockInstanceIdAttribute - The attribute name for block instance ID (default: 'data-block-instance-id')
|
|
57
46
|
* @returns true if block instance changed, false otherwise
|
|
58
47
|
*/
|
|
59
|
-
handleBlockInstanceChange(e, n) {
|
|
60
|
-
const o = this.getBlockInstanceId();
|
|
48
|
+
handleBlockInstanceChange(e, n, E = "data-block-instance-id") {
|
|
49
|
+
const o = this.getBlockInstanceId(E);
|
|
61
50
|
if (!o)
|
|
62
51
|
return !1;
|
|
63
|
-
const
|
|
64
|
-
return
|
|
52
|
+
const T = o !== this.lastBlockInstanceId;
|
|
53
|
+
return T ? (this.currentNode && e(this.currentNode), n(), this.lastBlockInstanceId = o) : n(), T;
|
|
65
54
|
}
|
|
66
|
-
_GuLabel({ text: e, name: n = ""
|
|
55
|
+
_GuLabel({ text: e, name: n = "" }) {
|
|
67
56
|
return `
|
|
68
57
|
<${t.LABEL}
|
|
69
|
-
style="${o === "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((T) => this._GuSelectItem(T)).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
|
|
183
|
-
n.forEach((
|
|
184
|
-
const
|
|
185
|
-
|
|
186
|
-
<${t.ORDERABLE_ITEM} ${
|
|
187
|
-
${
|
|
170
|
+
let E = "";
|
|
171
|
+
n.forEach((T) => {
|
|
172
|
+
const l = $.ORDERABLE_ITEM && "name" in $.ORDERABLE_ITEM ? $.ORDERABLE_ITEM.name : "name";
|
|
173
|
+
E += `
|
|
174
|
+
<${t.ORDERABLE_ITEM} ${l}="${T.key}">
|
|
175
|
+
${T.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
|
};
|