@useinsider/guido 3.8.2 → 3.9.0-beta.69ecfd1

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.
Files changed (61) hide show
  1. package/dist/@types/config/schemas.js +70 -66
  2. package/dist/composables/usePreviewMode.js +15 -14
  3. package/dist/composables/useRecommendationPreview.js +111 -0
  4. package/dist/config/compiler/recommendationCompilerRules.js +1 -1
  5. package/dist/config/compiler/utils/recommendationCompilerUtils.js +88 -80
  6. package/dist/config/migrator/recommendation/htmlBuilder.js +53 -52
  7. package/dist/config/migrator/recommendation/settingsMapper.js +38 -33
  8. package/dist/enums/html-validator.js +6 -5
  9. package/dist/extensions/Blocks/Items/block.js +48 -29
  10. package/dist/extensions/Blocks/Items/utils/nodeConfigUtils.js +62 -45
  11. package/dist/extensions/Blocks/Recommendation/block.js +64 -42
  12. package/dist/extensions/Blocks/Recommendation/canvasPreview.css.js +16 -0
  13. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +41 -32
  14. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +461 -363
  15. package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +33 -25
  16. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +99 -87
  17. package/dist/extensions/Blocks/Recommendation/controls/main/pricePlacement.js +133 -0
  18. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +162 -160
  19. package/dist/extensions/Blocks/Recommendation/extension.js +30 -29
  20. package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +21 -7
  21. package/dist/extensions/Blocks/Recommendation/recommendation.css.js +126 -8
  22. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +3 -1
  23. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +130 -96
  24. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +43 -54
  25. package/dist/extensions/Blocks/Recommendation/templates/index.js +17 -14
  26. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +86 -80
  27. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +31 -40
  28. package/dist/extensions/Blocks/Recommendation/templates/utils.js +155 -102
  29. package/dist/extensions/Blocks/common-control.js +58 -45
  30. package/dist/extensions/Blocks/controlFactories.js +76 -57
  31. package/dist/src/@types/config/schemas.d.ts +16 -0
  32. package/dist/src/composables/useConfig.d.ts +4 -0
  33. package/dist/src/composables/useRecommendationPreview.d.ts +10 -0
  34. package/dist/src/config/migrator/recommendation/settingsMapper.d.ts +1 -1
  35. package/dist/src/extensions/Blocks/CouponBlock/controls/index.d.ts +1 -1
  36. package/dist/src/extensions/Blocks/Items/block.d.ts +8 -0
  37. package/dist/src/extensions/Blocks/Items/controls/index.d.ts +3 -3
  38. package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +1 -1
  39. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +10 -0
  40. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +29 -3
  41. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -1
  42. package/dist/src/extensions/Blocks/Recommendation/controls/main/algorithm.d.ts +2 -1
  43. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +3 -1
  44. package/dist/src/extensions/Blocks/Recommendation/controls/main/pricePlacement.d.ts +59 -0
  45. package/dist/src/extensions/Blocks/Recommendation/controls/name/index.d.ts +1 -1
  46. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/index.d.ts +1 -1
  47. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.d.ts +1 -1
  48. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/index.d.ts +1 -1
  49. package/dist/src/extensions/Blocks/Recommendation/controls/price/index.d.ts +1 -1
  50. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +2 -0
  51. package/dist/src/extensions/Blocks/Recommendation/templates/grid/elementRenderer.d.ts +13 -1
  52. package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +4 -4
  53. package/dist/src/extensions/Blocks/Recommendation/templates/index.d.ts +1 -1
  54. package/dist/src/extensions/Blocks/Recommendation/templates/list/elementRenderer.d.ts +10 -1
  55. package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +3 -3
  56. package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +51 -1
  57. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +15 -0
  58. package/dist/src/extensions/Blocks/common-control.d.ts +7 -0
  59. package/dist/src/extensions/Blocks/controlFactories.d.ts +10 -1
  60. package/dist/src/stores/config.d.ts +36 -0
  61. package/package.json +1 -1
@@ -1,101 +1,148 @@
1
- import { ATTR_CUSTOM_PREFIX as c, PRODUCT_ATTRIBUTE_PREFIX as l, ATTR_PRODUCT_IMAGE as b, ATTR_PRODUCT_NAME as T, ATTR_PRODUCT_OLD_PRICE as g, ATTR_PRODUCT_PRICE as _, ATTR_PRODUCT_OMNIBUS_PRICE as f, ATTR_PRODUCT_OMNIBUS_DISCOUNT as p, ATTR_PRODUCT_BUTTON as m } from "../constants/selectors.js";
2
- function U(t) {
3
- return t.replace(/_/g, " ").replace(/\b\w/g, (n) => n.toUpperCase());
4
- }
5
- function S(t) {
6
- const n = Array.isArray(t) ? t[t.length - 1] : t;
7
- if (typeof n == "string")
8
- return n;
9
- if (typeof n == "number")
10
- return String(n);
11
- }
12
- function C(t, n) {
13
- const e = Object.values(n).find((o) => o.attributeName === t);
14
- return (e == null ? void 0 : e.type) === "defaultAttribute";
15
- }
16
- function E(t, n) {
17
- return C(t, n) ? t : `${l}${t}`;
18
- }
19
- function M(t) {
20
- const n = t.startsWith(l) ? t.substring(l.length) : t;
21
- return `${c}${n}`;
22
- }
23
- const P = Symbol("customCellHtml");
24
- function k(t, n, e = {}) {
25
- const o = t[P];
1
+ import { ATTR_PRODUCT_PRICE as c, ATTR_PRODUCT_OLD_PRICE as l, ATTR_CUSTOM_PREFIX as a, PRODUCT_ATTRIBUTE_PREFIX as u, ATTR_PRODUCT_IMAGE as f, ATTR_PRODUCT_NAME as T, ATTR_PRODUCT_OMNIBUS_PRICE as C, ATTR_PRODUCT_OMNIBUS_DISCOUNT as p, ATTR_PRODUCT_BUTTON as _ } from "../constants/selectors.js";
2
+ import { useRecommendationExtensionStore as D } from "../store/recommendation.js";
3
+ import { formatPrice as O } from "../utils/priceFormatter.js";
4
+ function E() {
5
+ const t = D(), { currencySettings: e } = t.recommendationConfigs;
6
+ return {
7
+ code: e.value,
8
+ symbol: e.symbol,
9
+ alignment: e.alignment === "0" ? "before" : "after",
10
+ decimalCount: parseInt(e.decimalCount) || 2,
11
+ decimalSeparator: e.decimalSeparator,
12
+ thousandSeparator: e.thousandSeparator
13
+ };
14
+ }
15
+ function m(t, e = "price") {
16
+ const n = E(), o = t[e], r = (o == null ? void 0 : o[n.code]) ?? Object.values(o ?? {})[0] ?? 0;
17
+ return O({
18
+ price: r,
19
+ currency: n
20
+ });
21
+ }
22
+ function Y(t) {
23
+ return m(t, "price") === m(t, "original_price");
24
+ }
25
+ function I(t) {
26
+ return t.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
27
+ }
28
+ function G(t) {
29
+ const e = t.indexOf(c), n = t.indexOf(l), o = n !== -1 && (e === -1 || n < e);
30
+ return {
31
+ originalFirst: o,
32
+ anchor: o ? l : c,
33
+ skip: o ? c : l
34
+ };
35
+ }
36
+ function $(t) {
37
+ const e = Array.isArray(t) ? t[t.length - 1] : t;
38
+ if (typeof e == "string")
39
+ return e;
40
+ if (typeof e == "number")
41
+ return String(e);
42
+ }
43
+ function h(t, e) {
44
+ const n = Object.values(e).find((o) => o.attributeName === t);
45
+ return (n == null ? void 0 : n.type) === "defaultAttribute";
46
+ }
47
+ function L(t, e) {
48
+ return h(t, e) ? t : `${u}${t}`;
49
+ }
50
+ function j(t) {
51
+ const e = t.startsWith(u) ? t.substring(u.length) : t;
52
+ return `${a}${e}`;
53
+ }
54
+ const x = Symbol("customCellHtml");
55
+ function z(t, e, n = {}) {
56
+ const o = t[x];
26
57
  if (!o)
27
58
  return { ...t };
28
- const s = { ...t };
29
- return n.filter((r) => r.startsWith(c) && !s[r]).forEach((r) => {
30
- const i = r.substring(c.length), a = U(i), y = E(i, e), R = C(i, e);
31
- s[r] = (d, A) => {
32
- var u;
33
- const D = R ? d[i] : (u = d.product_attributes) == null ? void 0 : u[i], O = S(D) ?? a;
34
- return o(y, O, A);
59
+ const r = { ...t };
60
+ return e.filter((s) => s.startsWith(a) && !r[s]).forEach((s) => {
61
+ const i = s.substring(a.length), d = I(i), S = L(i, n), A = h(i, n);
62
+ r[s] = (g, R) => {
63
+ var b;
64
+ const P = A ? g[i] : (b = g.product_attributes) == null ? void 0 : b[i], U = $(P) ?? d;
65
+ return o(S, U, R);
35
66
  };
36
- }), s;
67
+ }), r;
68
+ }
69
+ function V(t, e) {
70
+ var n, o, r, s, i;
71
+ return {
72
+ cellPadding: e.cellPadding,
73
+ cardBackgroundColor: e.cardBackgroundColor,
74
+ cellBackgroundColor: (n = e.cellBackgroundColors) == null ? void 0 : n[t],
75
+ cellAlignment: (o = e.cellAlignments) == null ? void 0 : o[t],
76
+ cellClasses: (r = e.cellClasses) == null ? void 0 : r[t],
77
+ omnibusText: (s = e.omnibusTexts) == null ? void 0 : s[t],
78
+ styleTemplate: (i = e.styleTemplates) == null ? void 0 : i[t]
79
+ };
37
80
  }
38
- const x = {
81
+ const X = {
39
82
  TITLE: "You May Also Like!"
40
- }, v = [
41
- b,
42
- T,
43
- g,
44
- _,
83
+ }, K = [
45
84
  f,
85
+ T,
86
+ l,
87
+ c,
88
+ C,
46
89
  p,
47
- m
48
- ], F = {
49
- [b]: !0,
90
+ _
91
+ ], q = {
92
+ [f]: !0,
50
93
  [T]: !0,
51
- [_]: !0,
52
- [g]: !0,
53
- [f]: !1,
94
+ [c]: !0,
95
+ [l]: !0,
96
+ [C]: !1,
54
97
  [p]: !1,
55
- [m]: !0
56
- }, I = 10;
57
- function $(t = I) {
98
+ [_]: !0
99
+ }, B = 10;
100
+ function k(t = B) {
58
101
  return `
59
102
  <tr>
60
103
  <td class="spacer" style="height: ${t}px;"></td>
61
104
  </tr>
62
105
  `;
63
106
  }
64
- const L = $();
65
- function w(t, n) {
66
- return n ? n.pStyle ?? "" : t;
107
+ const v = k();
108
+ function w(t, e) {
109
+ return e ? e.pStyle ?? "" : t;
67
110
  }
68
- function W(t, n, e) {
69
- const o = w(n.pStyle, e), s = e ? e.openTags ?? "" : n.openTags, r = e ? e.closeTags ?? "" : n.closeTags;
70
- return `<p contenteditable="false" style="${o}">${s}${t}${r}</p>`;
111
+ function J(t, e, n) {
112
+ const o = w(e.pStyle, n), r = n ? n.openTags ?? "" : e.openTags, s = n ? n.closeTags ?? "" : e.closeTags;
113
+ return `<p contenteditable="false" style="${o}">${r}${t}${s}</p>`;
71
114
  }
72
- function H(t, n) {
73
- const e = [];
74
- return t && e.push(t), n && e.push(`background-color: ${n};`), e.join(" ");
115
+ function Q(t, e) {
116
+ const n = [];
117
+ return t && n.push(t), e && n.push(`background-color: ${e};`), n.join(" ");
75
118
  }
76
- function Y(t) {
77
- return t ? ` style="background-color: ${t};"` : "";
119
+ function N(t) {
120
+ return t ? ` background-color: ${t};` : "";
121
+ }
122
+ function Z(t) {
123
+ const e = N(t);
124
+ return e ? ` style="${e.trim()}"` : "";
78
125
  }
79
- function G(t, n = "") {
126
+ function tt(t, e = "") {
80
127
  return {
81
- before: (t == null ? void 0 : t.before) ?? n,
128
+ before: (t == null ? void 0 : t.before) ?? e,
82
129
  after: (t == null ? void 0 : t.after) ?? ""
83
130
  };
84
131
  }
85
- function z(t, n) {
86
- return `${(n == null ? void 0 : n.openTags) ?? ""}${t}${(n == null ? void 0 : n.closeTags) ?? ""}`;
132
+ function et(t, e) {
133
+ return `${(e == null ? void 0 : e.openTags) ?? ""}${t}${(e == null ? void 0 : e.closeTags) ?? ""}`;
87
134
  }
88
- function X(t) {
135
+ function nt(t) {
89
136
  return t != null && t.buttonFitToContainer ? "es-button-border es-fw" : "es-button-border";
90
137
  }
91
- const j = "display: block; max-width: 100%; height: auto;", V = "border-width: 1px; background: rgb(217, 234, 211); border-color: rgb(106, 168, 79);", K = "color: rgb(56, 118, 29); background: rgb(217, 234, 211); font-family: arial, 'helvetica neue', helvetica, sans-serif; font-size: 16px; font-weight: normal; line-height: 120%; mso-border-alt: 10px solid rgb(217, 234, 211); mso-padding-alt: 0;", h = "https://email-static.useinsider.com/stripo/modules/email-recommendation-v3/assets/images/image-placeholder.png";
92
- function q(t) {
93
- return !t || typeof t != "string" || t.trim() === "" ? h : t.startsWith("http://") ? t.replace("http://", "https://") : t;
138
+ const ot = "display: block; max-width: 100%; height: auto;", rt = "border-width: 1px; background: rgb(217, 234, 211); border-color: rgb(106, 168, 79);", st = "color: rgb(56, 118, 29); background: rgb(217, 234, 211); font-family: arial, 'helvetica neue', helvetica, sans-serif; font-size: 16px; font-weight: normal; line-height: 120%; mso-border-alt: 10px solid rgb(217, 234, 211); mso-padding-alt: 0;", y = "https://email-static.useinsider.com/stripo/modules/email-recommendation-v3/assets/images/image-placeholder.png";
139
+ function it(t) {
140
+ return !t || typeof t != "string" || t.trim() === "" ? y : t.startsWith("http://") ? t.replace("http://", "https://") : t;
94
141
  }
95
- function B(t) {
142
+ function F(t) {
96
143
  return {
97
144
  name: "Product Name",
98
- image_url: h,
145
+ image_url: y,
99
146
  price: { USD: 18 },
100
147
  original_price: { USD: 20 },
101
148
  discount: { USD: 2 },
@@ -107,19 +154,19 @@ function B(t) {
107
154
  category: []
108
155
  };
109
156
  }
110
- function J(t = 6) {
157
+ function ct(t = 6) {
111
158
  return Array.from(
112
159
  { length: t },
113
- (n, e) => B(String(e + 1))
160
+ (e, n) => F(String(n + 1))
114
161
  );
115
162
  }
116
- function Q(t = "grid", n) {
117
- const e = t === "list" ? `
118
- data-layout="list"` : "", o = n ? ` ${n}` : "";
163
+ function lt(t = "grid", e) {
164
+ const n = t === "list" ? `
165
+ data-layout="list"` : "", o = e ? ` ${e}` : "";
119
166
  return `
120
167
  <td
121
168
  align="left"
122
- class="${`recommendation-block-v2 esd-block-recommendation-v3-block es-p20${t === "list" ? " es-m-p0 ins-recommendation-list-layout" : ""}${o}`}"${e}>
169
+ class="${`recommendation-block-v2 esd-block-recommendation-v3-block es-p20${t === "list" ? " es-m-p0 ins-recommendation-list-layout" : ""}${o}`}"${n}>
123
170
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
124
171
  <tr>
125
172
  <td align="center">
@@ -151,7 +198,7 @@ function Q(t = "grid", n) {
151
198
  </table>
152
199
  </td>
153
200
  </tr>
154
- ${L}
201
+ ${v}
155
202
  <tr>
156
203
  <td>
157
204
  <table
@@ -190,31 +237,37 @@ function Q(t = "grid", n) {
190
237
  `;
191
238
  }
192
239
  export {
193
- P as CUSTOM_CELL_HTML,
194
- x as DEFAULTS,
195
- K as DEFAULT_BUTTON_ANCHOR_STYLE,
196
- V as DEFAULT_BUTTON_BORDER_STYLE,
197
- v as DEFAULT_CARD_COMPOSITION,
198
- F as DEFAULT_CARD_VISIBILITY,
199
- j as DEFAULT_IMG_STYLE,
200
- I as DEFAULT_ROW_SPACING_PX,
201
- h as PLACEHOLDER_IMAGE,
202
- k as buildElementRenderer,
203
- $ as buildSpacer,
204
- Y as cellBgStyleAttr,
205
- Q as createBlockTemplate,
206
- J as getDefaultProducts,
207
- C as isDefaultAttribute,
208
- z as renderButtonLabel,
209
- W as renderStyledParagraph,
210
- X as resolveButtonBorderClass,
211
- G as resolveOmnibusText,
240
+ x as CUSTOM_CELL_HTML,
241
+ X as DEFAULTS,
242
+ st as DEFAULT_BUTTON_ANCHOR_STYLE,
243
+ rt as DEFAULT_BUTTON_BORDER_STYLE,
244
+ K as DEFAULT_CARD_COMPOSITION,
245
+ q as DEFAULT_CARD_VISIBILITY,
246
+ ot as DEFAULT_IMG_STYLE,
247
+ B as DEFAULT_ROW_SPACING_PX,
248
+ y as PLACEHOLDER_IMAGE,
249
+ N as bgColorFragment,
250
+ V as buildCellOptions,
251
+ z as buildElementRenderer,
252
+ k as buildSpacer,
253
+ Z as cellBgStyleAttr,
254
+ lt as createBlockTemplate,
255
+ m as formatProductPrice,
256
+ E as getCurrentCurrencyConfig,
257
+ ct as getDefaultProducts,
258
+ h as isDefaultAttribute,
259
+ Y as isSamePrice,
260
+ et as renderButtonLabel,
261
+ J as renderStyledParagraph,
262
+ nt as resolveButtonBorderClass,
263
+ G as resolveInlinePriceOrder,
264
+ tt as resolveOmnibusText,
212
265
  w as resolvePStyle,
213
- E as resolveProductAttrValue,
214
- H as resolveSegmentBgStyle,
215
- q as sanitizeImageUrl,
216
- L as spacer,
217
- M as toCustomCompositionKey,
218
- U as toDisplayName,
219
- S as toDisplayableAttributeValue
266
+ L as resolveProductAttrValue,
267
+ Q as resolveSegmentBgStyle,
268
+ it as sanitizeImageUrl,
269
+ v as spacer,
270
+ j as toCustomCompositionKey,
271
+ I as toDisplayName,
272
+ $ as toDisplayableAttributeValue
220
273
  };
@@ -1,12 +1,12 @@
1
1
  var c = Object.defineProperty;
2
- var i = (s, r, e) => r in s ? c(s, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[r] = e;
3
- var u = (s, r, e) => i(s, typeof r != "symbol" ? r + "" : r, e);
2
+ var i = (s, a, e) => a in s ? c(s, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[a] = e;
3
+ var T = (s, a, e) => i(s, typeof a != "symbol" ? a + "" : a, e);
4
4
  import { Control as I, UIElementType as n, UEAttr as $ } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
- class d extends I {
5
+ class _ extends I {
6
6
  constructor() {
7
7
  super(...arguments);
8
- u(this, "currentNode");
9
- u(this, "lastBlockInstanceId", null);
8
+ T(this, "currentNode");
9
+ T(this, "lastBlockInstanceId", null);
10
10
  }
11
11
  getContainer() {
12
12
  var e;
@@ -47,15 +47,15 @@ class d extends I {
47
47
  const t = this.getBlockInstanceId();
48
48
  if (!t)
49
49
  return !1;
50
- const o = t !== this.lastBlockInstanceId;
51
- return e(), o && (this.lastBlockInstanceId = t), o;
50
+ const E = t !== this.lastBlockInstanceId;
51
+ return e(), E && (this.lastBlockInstanceId = t), E;
52
52
  }
53
- _GuLabel({ text: e, name: t = "", hint: o }) {
53
+ _GuLabel({ text: e, name: t = "", hint: E }) {
54
54
  return `
55
55
  <${n.LABEL}
56
56
  ${$.LABEL.text}="${e}"
57
57
  ${$.LABEL.name}="${t || `${e} Label`}"
58
- ${o ? `${$.LABEL.hint}="${o}"` : ""}>
58
+ ${E ? `${$.LABEL.hint}="${E}"` : ""}>
59
59
  </${n.LABEL}>
60
60
  `;
61
61
  }
@@ -73,7 +73,7 @@ class d extends I {
73
73
  * Use in getTemplate() — the icon is registered in a hidden store so Stripo initializes it.
74
74
  * Pair with _setInfoMessageValue() in onRender() to set the text content.
75
75
  */
76
- _GuOnPageMessage({ name: e, icon: t = "not-found", type: o = "info" }) {
76
+ _GuOnPageMessage({ name: e, icon: t = "not-found", type: E = "info" }) {
77
77
  return `
78
78
  <div data-info-message="${e}" style="display: none; padding: 16px 16px 0;">
79
79
  <div class="icon-store" style="display: none;">
@@ -81,7 +81,7 @@ class d extends I {
81
81
  ${this._GuIcon({ src: t, className: "icon" })}
82
82
  </div>
83
83
  </div>
84
- ${this._GuMessage({ name: e, type: o })}
84
+ ${this._GuMessage({ name: e, type: E })}
85
85
  </div>
86
86
  `;
87
87
  }
@@ -91,7 +91,7 @@ class d extends I {
91
91
  * and combines it with the text in Stripo's alert-message layout.
92
92
  */
93
93
  _setInfoMessageValue(e, t) {
94
- const o = this.getContainer(), E = o.querySelector(`[data-icon-key="${e}"]`), a = E == null ? void 0 : E.querySelector("ue-icon-component"), l = (a == null ? void 0 : a.outerHTML) ?? "";
94
+ const E = this.getContainer(), o = E.querySelector(`[data-icon-key="${e}"]`), r = o == null ? void 0 : o.querySelector("ue-icon-component"), l = (r == null ? void 0 : r.outerHTML) ?? "";
95
95
  this.api.setUIEAttribute(
96
96
  e,
97
97
  "value",
@@ -104,8 +104,8 @@ class d extends I {
104
104
  </div>
105
105
  `
106
106
  );
107
- const T = o.querySelector(`[data-info-message="${e}"]`);
108
- T && (T.style.display = "");
107
+ const u = E.querySelector(`[data-info-message="${e}"]`);
108
+ u && (u.style.display = "");
109
109
  }
110
110
  _GuToggle(e) {
111
111
  return `
@@ -121,59 +121,59 @@ class d extends I {
121
121
  ${$.SELECT_ITEM.value}="${t}">
122
122
  </${n.SELECT_ITEM}>`;
123
123
  }
124
- _GuSelect({ name: e, placeholder: t, options: o, className: E = "es-180w" }) {
124
+ _GuSelect({ name: e, placeholder: t, options: E, className: o = "es-180w" }) {
125
125
  return `
126
126
  <${n.SELECTPICKER}
127
- class="${E}"
127
+ class="${o}"
128
128
  ${$.SELECTPICKER.name}="${e}"
129
129
  ${$.SELECTPICKER.placeholder}="${t}">
130
- ${o.map((a) => this._GuSelectItem(a)).join("")}
130
+ ${E.map((r) => this._GuSelectItem(r)).join("")}
131
131
  </${n.SELECTPICKER}>
132
132
  `;
133
133
  }
134
- _GuTextInput({ name: e, placeholder: t, className: o = "", disabled: E = !1 }) {
134
+ _GuTextInput({ name: e, placeholder: t, className: E = "", disabled: o = !1 }) {
135
135
  return `
136
136
  <${n.TEXT}
137
- class=${o}
137
+ class=${E}
138
138
  ${$.TEXT.name}="${e}"
139
139
  placeholder="${t || e}"
140
- ${E ? `${$.TEXT.disabled}="true"` : ""}>
140
+ ${o ? `${$.TEXT.disabled}="true"` : ""}>
141
141
  </${n.TEXT}>
142
142
  `;
143
143
  }
144
- _GuCounter({ name: e, maxValue: t, minValue: o = 1, step: E = 1 }) {
144
+ _GuCounter({ name: e, maxValue: t, minValue: E = 1, step: o = 1 }) {
145
145
  return `
146
146
  <${n.COUNTER}
147
147
  ${$.COUNTER.name}="${e}"
148
- ${$.COUNTER.minValue}="${o}"
148
+ ${$.COUNTER.minValue}="${E}"
149
149
  ${$.COUNTER.maxValue}="${t}"
150
- ${$.COUNTER.step}="${E}">
150
+ ${$.COUNTER.step}="${o}">
151
151
  </${n.COUNTER}>
152
152
  `;
153
153
  }
154
- _GuRadioButtonItem({ text: e, value: t, icon: o }) {
154
+ _GuRadioButtonItem({ text: e, value: t, icon: E }) {
155
155
  return `
156
156
  <${n.RADIO_ITEM}
157
157
  ${$.RADIO_ITEM.value}="${t}"
158
158
  ${e ? `${$.RADIO_ITEM.text}="${e}"` : ""}
159
- ${o ? `${$.RADIO_ITEM.icon}="${o}"` : ""}>
159
+ ${E ? `${$.RADIO_ITEM.icon}="${E}"` : ""}>
160
160
  </${n.RADIO_ITEM}>
161
161
  `;
162
162
  }
163
- _GuRadioButton({ name: e, buttons: t, id: o = "" }) {
163
+ _GuRadioButton({ name: e, buttons: t, id: E = "" }) {
164
164
  return `
165
165
  <${n.RADIO_BUTTONS}
166
- ${o ? `id="${o}"` : ""}
166
+ ${E ? `id="${E}"` : ""}
167
167
  ${$.RADIO_BUTTONS.name}="${e}">
168
- ${t.map((E) => this._GuRadioButtonItem(E)).join("")}
168
+ ${t.map((o) => this._GuRadioButtonItem(o)).join("")}
169
169
  </${n.RADIO_BUTTONS}>
170
170
  `;
171
171
  }
172
- _GuButton({ name: e, label: t, id: o = "" }) {
172
+ _GuButton({ name: e, label: t, id: E = "" }) {
173
173
  return `
174
174
  <${n.BUTTON}
175
175
  ${$.BUTTON.name}="${e}"
176
- ${o ? `id="${o}"` : ""}
176
+ ${E ? `id="${E}"` : ""}
177
177
  ${$.BUTTON.caption}="${t}"}>
178
178
  </${n.BUTTON}>
179
179
  `;
@@ -191,10 +191,10 @@ class d extends I {
191
191
  * @param param0
192
192
  * @returns It returns a button with an icon.
193
193
  */
194
- _GuIconButton({ name: e, icon: t, className: o = "" }) {
194
+ _GuIconButton({ name: e, icon: t, className: E = "" }) {
195
195
  return `
196
196
  <${n.BUTTON}
197
- class="${o}"
197
+ class="${E}"
198
198
  ${$.BUTTON.name}="${e}"
199
199
  ${$.BUTTON.icon}="${t}">
200
200
  </${n.BUTTON}>
@@ -222,19 +222,19 @@ class d extends I {
222
222
  * @returns HTML string for the orderable control
223
223
  */
224
224
  _GuOrderable(e, t) {
225
- let o = "";
226
- t.forEach((a) => {
225
+ let E = "";
226
+ t.forEach((r) => {
227
227
  const l = $.ORDERABLE_ITEM && "name" in $.ORDERABLE_ITEM ? $.ORDERABLE_ITEM.name : "name";
228
- o += `
229
- <${n.ORDERABLE_ITEM} ${l}="${a.key}">
230
- ${a.content}
228
+ E += `
229
+ <${n.ORDERABLE_ITEM} ${l}="${r.key}">
230
+ ${r.content}
231
231
  </${n.ORDERABLE_ITEM}>
232
232
  `;
233
233
  });
234
- const E = $.ORDERABLE && "name" in $.ORDERABLE ? $.ORDERABLE.name : "name";
234
+ const o = $.ORDERABLE && "name" in $.ORDERABLE ? $.ORDERABLE.name : "name";
235
235
  return `
236
- <${n.ORDERABLE} ${E}="${e}">
237
- ${o}
236
+ <${n.ORDERABLE} ${o}="${e}">
237
+ ${E}
238
238
  </${n.ORDERABLE}>
239
239
  `;
240
240
  }
@@ -275,16 +275,16 @@ class d extends I {
275
275
  `;
276
276
  }
277
277
  _GuRadioButtons(e, t) {
278
- const o = t.map((E) => `
278
+ const E = t.map((o) => `
279
279
  <${n.RADIO_ITEM}
280
- ${$.RADIO_ITEM.text}="${E.text}"
281
- ${$.RADIO_ITEM.value}="${E.value}">
280
+ ${$.RADIO_ITEM.text}="${o.text}"
281
+ ${$.RADIO_ITEM.value}="${o.value}">
282
282
  </${n.RADIO_ITEM}>
283
283
  `).join("");
284
284
  return `
285
285
  <${n.RADIO_BUTTONS}
286
286
  ${$.RADIO_BUTTONS.name}="${e}">
287
- ${o}
287
+ ${E}
288
288
  </${n.RADIO_BUTTONS}>
289
289
  `;
290
290
  }
@@ -296,7 +296,20 @@ class d extends I {
296
296
  </${n.CHECKBOX}>
297
297
  `;
298
298
  }
299
+ // Tag/chips input (Stripo MULTIPLE_SELECT): add-by-Enter, remove-by-×.
300
+ // Value is read/written as a string[] via updateValues / onValueChanged.
301
+ _GuMultiSelect({ name: e, placeholder: t = "", className: E = "", disabled: o = !1 }) {
302
+ const r = [E, o ? "" : "click-enabled"].filter(Boolean).join(" ");
303
+ return `
304
+ <${n.MULTIPLE_SELECT}
305
+ class="${r}"
306
+ ${$.MULTIPLE_SELECT.name}="${e}"
307
+ ${$.MULTIPLE_SELECT.placeholder}="${t}"
308
+ ${o ? `${$.MULTIPLE_SELECT.disabled}="true"` : ""}>
309
+ </${n.MULTIPLE_SELECT}>
310
+ `;
311
+ }
299
312
  }
300
313
  export {
301
- d as CommonControl
314
+ _ as CommonControl
302
315
  };