@useinsider/guido 3.20.0 → 3.20.1-beta.04cd240
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/composables/useLegacyStrategyConversion.js +16 -16
- package/dist/composables/useStripo.js +11 -10
- package/dist/composables/useVersionHistoryApi.js +42 -37
- package/dist/config/compiler/itemsCompilerRules.js +21 -5
- package/dist/config/compiler/utils/itemsCompilerUtils.js +64 -17
- package/dist/config/migrator/itemsBlockMigrator.js +112 -108
- package/dist/extensions/Blocks/Items/block.js +76 -64
- package/dist/extensions/Blocks/Items/constants/cardWidth.js +20 -0
- package/dist/extensions/Blocks/Items/layouts/vertical.html.js +1 -1
- package/dist/extensions/Blocks/Recommendation/block.js +60 -49
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +163 -149
- package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +1 -2
- package/dist/extensions/Blocks/Recommendation/controls/main/currency.js +102 -78
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +313 -210
- package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +15 -13
- package/dist/extensions/Blocks/Recommendation/controls/main/pricePlacement.js +17 -12
- package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +92 -84
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +219 -193
- package/dist/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.js +23 -18
- package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +1 -2
- package/dist/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.js +6 -6
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +12 -9
- package/dist/extensions/Blocks/Recommendation/extension.js +4 -2
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +4 -2
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +240 -190
- package/dist/extensions/Blocks/Recommendation/utils/blockRefresh.js +19 -0
- package/dist/extensions/Blocks/Recommendation/utils/blockUrlConfig.js +25 -0
- package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +72 -70
- package/dist/extensions/Blocks/Recommendation/utils/compositionKeys.js +69 -60
- package/dist/extensions/Blocks/Recommendation/utils/followUpApply.js +34 -0
- package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +73 -28
- package/dist/extensions/Blocks/Recommendation/utils/restoreRefresh.js +36 -0
- package/dist/extensions/Blocks/Recommendation/utils/strategyCommit.js +39 -20
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +271 -192
- package/dist/package.json.js +1 -1
- package/dist/src/config/compiler/utils/itemsCompilerUtils.d.ts +10 -0
- package/dist/src/extensions/Blocks/Checkbox/controls/blockBackground/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/CouponBlock/controls/index.d.ts +8 -0
- package/dist/src/extensions/Blocks/Items/block.d.ts +5 -0
- package/dist/src/extensions/Blocks/Items/constants/cardWidth.d.ts +12 -0
- package/dist/src/extensions/Blocks/Items/controls/index.d.ts +40 -0
- package/dist/src/extensions/Blocks/RadioButton/controls/blockBackground/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +3 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/blockBackground/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/index.d.ts +11 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +3 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/image/index.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/currency.d.ts +3 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +22 -3
- package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +1 -18
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +8 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.d.ts +10 -6
- package/dist/src/extensions/Blocks/Recommendation/controls/name/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.d.ts +2 -3
- package/dist/src/extensions/Blocks/Recommendation/controls/spacing/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/title/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +28 -6
- package/dist/src/extensions/Blocks/Recommendation/utils/blockRefresh.d.ts +19 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/blockUrlConfig.d.ts +4 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/compositionKeys.d.ts +4 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/followUpApply.d.ts +20 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +15 -2
- package/dist/src/extensions/Blocks/Recommendation/utils/restoreRefresh.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/strategyCommit.d.ts +7 -0
- package/dist/src/extensions/Blocks/_Boilerplate/controls/blockBackground/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/controlFactories.d.ts +22 -0
- package/dist/src/stores/editor.d.ts +3 -1
- package/dist/src/utils/liquidProtection.d.ts +3 -0
- package/dist/static/styles/components/button.css.js +5 -0
- package/dist/stores/editor.js +5 -0
- package/dist/utils/liquidProtection.js +5 -0
- package/dist/utils/templatePreparation.js +61 -85
- package/package.json +3 -3
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var $ = (
|
|
4
|
-
import { ACADEMY_LINKS as
|
|
5
|
-
import { UIElementType as
|
|
6
|
-
import { CommonControl as
|
|
7
|
-
import { ATTR_PRODUCT_IMAGE as
|
|
8
|
-
import { DEFAULT_COMPOSITION as
|
|
9
|
-
import { RecommendationConfigService as
|
|
10
|
-
import { useRecommendationExtensionStore as
|
|
11
|
-
import { ATTRIBUTE_CELL_CLASS as
|
|
12
|
-
import { listElementRenderer as
|
|
13
|
-
import { buildTitleRows as
|
|
14
|
-
import { resolveInlinePriceOrder as
|
|
15
|
-
import { normalizeCompositionKeys as
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
|
|
1
|
+
var ct = Object.defineProperty;
|
|
2
|
+
var dt = (_, g, t) => g in _ ? ct(_, g, { enumerable: !0, configurable: !0, writable: !0, value: t }) : _[g] = t;
|
|
3
|
+
var $ = (_, g, t) => dt(_, typeof g != "symbol" ? g + "" : g, t);
|
|
4
|
+
import { ACADEMY_LINKS as ut } from "../../../../../enums/academy.js";
|
|
5
|
+
import { UIElementType as f, UEAttr as L, ModificationDescription as k } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
6
|
+
import { CommonControl as mt } from "../../../common-control.js";
|
|
7
|
+
import { ATTR_PRODUCT_IMAGE as F, ATTR_PRODUCT_NAME as ht, ATTR_PRODUCT_PRICE as p, ATTR_PRODUCT_OLD_PRICE as A, ATTR_PRODUCT_OMNIBUS_PRICE as pt, ATTR_PRODUCT_OMNIBUS_DISCOUNT as _t, ATTR_PRODUCT_BUTTON as x, ATTR_RECOMMENDATION_TITLE as I, ATTR_DATA_CARD_COMPOSITION as W, ATTR_DATA_CUSTOM_ATTRIBUTES as z, ATTR_CUSTOM_PREFIX as v, SELECTOR_ATTRIBUTE_ROW as N, SELECTOR_TITLE_CELL as G, ATTR_DATA_VISIBILITY as O, ATTR_DATA_ATTRIBUTE_TYPE as E, CSS_CLASS_ATTRIBUTE_ROW as Y, CSS_CLASS_SPACER as gt, BUILT_IN_DEFAULT_ATTRIBUTES as ft } from "../../constants/selectors.js";
|
|
8
|
+
import { DEFAULT_COMPOSITION as X, DEFAULT_VISIBILITY as J } from "../../constants/defaultConfig.js";
|
|
9
|
+
import { RecommendationConfigService as y } from "../../services/configService.js";
|
|
10
|
+
import { useRecommendationExtensionStore as bt } from "../../store/recommendation.js";
|
|
11
|
+
import { ATTRIBUTE_CELL_CLASS as yt, gridElementRenderer as Tt, DEFAULT_CELL_PADDING as Ct, buildFillerCell as St } from "../../templates/grid/elementRenderer.js";
|
|
12
|
+
import { listElementRenderer as At } from "../../templates/list/elementRenderer.js";
|
|
13
|
+
import { buildTitleRows as It, DEFAULT_TITLE_PARAGRAPH as $t, DEFAULT_TITLE_TEXT as vt } from "../../templates/titleRows.js";
|
|
14
|
+
import { resolveInlinePriceOrder as Nt, toDisplayName as Et, toDisplayableAttributeValue as Rt, buildElementRenderer as Q } from "../../templates/utils.js";
|
|
15
|
+
import { normalizeCompositionKeys as Lt, normalizeCustomAttrValues as Ot, compositionKeyToProductAttr as M, resolveRowVisibilityKeys as Dt, filterToProductAttrValue as T, findAttributeRow as Ht, rewriteLegacyRowKeyHtml as Z, bareAttributeName as D, isDefaultProductAttr as Pt, productAttrToCompositionKey as U } from "../../utils/compositionKeys.js";
|
|
16
|
+
import { applyFollowUp as H } from "../../utils/followUpApply.js";
|
|
17
|
+
import { getTableDisplayValue as wt } from "../../utils/tagName.js";
|
|
18
|
+
import { isPartnerManagedBlock as Bt, regenerateProductRowsWithStyles as kt, getMainContainerTbody as Mt, getCurrentLayout as Ut } from "../main/utils.js";
|
|
19
|
+
const qt = "ui-elements-recommendation-card-composition", q = ".product-card-wrapper > tbody", tt = ".product-info-cell > table > tbody", et = {
|
|
19
20
|
ADD_ATTRIBUTE: "addAttribute"
|
|
20
|
-
},
|
|
21
|
-
{ key:
|
|
22
|
-
{ key:
|
|
23
|
-
{ key:
|
|
24
|
-
{ key:
|
|
25
|
-
{ key:
|
|
26
|
-
{ key:
|
|
21
|
+
}, b = 5, P = "reorderIcon_", Ft = '<svg width="14" height="10" viewBox="0 0 14 10" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><circle cx="2" cy="2.5" r="1.2"/><circle cx="7" cy="2.5" r="1.2"/><circle cx="12" cy="2.5" r="1.2"/><circle cx="2" cy="7.5" r="1.2"/><circle cx="7" cy="7.5" r="1.2"/><circle cx="12" cy="7.5" r="1.2"/></svg>', m = [
|
|
22
|
+
{ key: F, label: "Product Image" },
|
|
23
|
+
{ key: ht, label: "Product Name" },
|
|
24
|
+
{ key: p, label: "Product Price" },
|
|
25
|
+
{ key: A, label: "Product Original Price" },
|
|
26
|
+
{ key: pt, label: "Omnibus Price" },
|
|
27
|
+
{ key: _t, label: "Omnibus Discount" },
|
|
27
28
|
{ key: x, label: "Product Button" }
|
|
28
|
-
], R = { key: I, label: "Title" }, xt = new Set(m.map((
|
|
29
|
-
class
|
|
29
|
+
], R = { key: I, label: "Title" }, xt = new Set(m.map((_) => _.key)), S = "customAttr_", w = "deleteAttr_";
|
|
30
|
+
class ne extends mt {
|
|
30
31
|
constructor() {
|
|
31
32
|
super(...arguments);
|
|
32
|
-
$(this, "store",
|
|
33
|
+
$(this, "store", bt());
|
|
33
34
|
$(this, "unsubscribeStore", null);
|
|
34
35
|
$(this, "eventController", null);
|
|
35
36
|
/**
|
|
@@ -39,7 +40,7 @@ class se extends ut {
|
|
|
39
40
|
$(this, "reorderInProgress", !1);
|
|
40
41
|
}
|
|
41
42
|
getId() {
|
|
42
|
-
return
|
|
43
|
+
return qt;
|
|
43
44
|
}
|
|
44
45
|
// ========================================================================
|
|
45
46
|
// Lifecycle
|
|
@@ -50,11 +51,11 @@ class se extends ut {
|
|
|
50
51
|
${this._GuToggle(`visibility_${d.key}`)}
|
|
51
52
|
</div>
|
|
52
53
|
`).join(""), e = Array.from(
|
|
53
|
-
{ length:
|
|
54
|
+
{ length: b },
|
|
54
55
|
(d, c) => `
|
|
55
|
-
<div data-custom-select-key="${
|
|
56
|
+
<div data-custom-select-key="${S}${c}" style="display: none;">
|
|
56
57
|
${this._GuSelect({
|
|
57
|
-
name: `${
|
|
58
|
+
name: `${S}${c}`,
|
|
58
59
|
placeholder: this.api.translate("Select Attribute"),
|
|
59
60
|
options: [],
|
|
60
61
|
// A partner's attribute list runs long; search beats scrolling.
|
|
@@ -62,37 +63,37 @@ class se extends ut {
|
|
|
62
63
|
})}
|
|
63
64
|
</div>
|
|
64
65
|
`
|
|
65
|
-
).join(""), r = m.length +
|
|
66
|
+
).join(""), r = m.length + b, i = Array.from(
|
|
66
67
|
{ length: r },
|
|
67
68
|
(d, c) => `
|
|
68
69
|
<div data-reorder-icon-key="${P}${c}" style="display: none;">
|
|
69
|
-
<${
|
|
70
|
+
<${f.BUTTON}
|
|
70
71
|
class="guido-drag-handle-btn flat-inline flat-white"
|
|
71
|
-
${
|
|
72
|
+
${L.BUTTON.name}="${P}${c}"
|
|
72
73
|
>
|
|
73
|
-
<${
|
|
74
|
+
<${f.ICON}
|
|
74
75
|
src="reorder"
|
|
75
76
|
class="icon-button"
|
|
76
|
-
></${
|
|
77
|
-
</${
|
|
77
|
+
></${f.ICON}>
|
|
78
|
+
</${f.BUTTON}>
|
|
78
79
|
</div>
|
|
79
80
|
`
|
|
80
81
|
).join(""), s = Array.from(
|
|
81
|
-
{ length:
|
|
82
|
+
{ length: b },
|
|
82
83
|
(d, c) => `
|
|
83
84
|
<div data-custom-delete-key="${w}${c}" style="display: none;">
|
|
84
|
-
<${
|
|
85
|
+
<${f.BUTTON}
|
|
85
86
|
class="custom-attr-delete flat-inline flat-white"
|
|
86
|
-
${
|
|
87
|
+
${L.BUTTON.name}="${w}${c}"
|
|
87
88
|
>
|
|
88
|
-
<${
|
|
89
|
+
<${f.ICON}
|
|
89
90
|
src="delete"
|
|
90
91
|
class="icon-button"
|
|
91
|
-
></${
|
|
92
|
-
</${
|
|
92
|
+
></${f.ICON}>
|
|
93
|
+
</${f.BUTTON}>
|
|
93
94
|
</div>
|
|
94
95
|
`
|
|
95
|
-
).join(""), o =
|
|
96
|
+
).join(""), o = ut.EMAIL_RECOMMENDATION_BLOCK, n = this.api.translate(
|
|
96
97
|
"Drag and drop the card elements to reorder them, adjust their visibility or add new attributes up to 5."
|
|
97
98
|
), l = this.api.translate("For more information, you can"), a = this.api.translate("visit Academy");
|
|
98
99
|
return `
|
|
@@ -134,7 +135,7 @@ class se extends ut {
|
|
|
134
135
|
<div class="orderable-list" data-composition-list></div>
|
|
135
136
|
|
|
136
137
|
${this._GuButton({
|
|
137
|
-
name:
|
|
138
|
+
name: et.ADD_ATTRIBUTE,
|
|
138
139
|
label: this.api.translate("Add Attribute"),
|
|
139
140
|
id: "guido__btn-add-attribute"
|
|
140
141
|
})}
|
|
@@ -155,7 +156,7 @@ class se extends ut {
|
|
|
155
156
|
const t = (r = this.getContainer()) == null ? void 0 : r.querySelector("[data-card-composition-control]");
|
|
156
157
|
if (!t)
|
|
157
158
|
return;
|
|
158
|
-
const e =
|
|
159
|
+
const e = Bt(this.currentNode);
|
|
159
160
|
t.style.pointerEvents = e ? "none" : "", t.style.opacity = e ? "0.5" : "";
|
|
160
161
|
}
|
|
161
162
|
onTemplateNodeUpdated(t) {
|
|
@@ -177,8 +178,8 @@ class se extends ut {
|
|
|
177
178
|
this._applyVisibilityToBlock(t.key, e);
|
|
178
179
|
});
|
|
179
180
|
});
|
|
180
|
-
for (let t = 0; t <
|
|
181
|
-
const e = `${
|
|
181
|
+
for (let t = 0; t < b; t++) {
|
|
182
|
+
const e = `${S}${t}`, r = t;
|
|
182
183
|
this.api.onValueChanged(e, (i) => {
|
|
183
184
|
this._onCustomAttributeChanged(r, i);
|
|
184
185
|
});
|
|
@@ -189,24 +190,24 @@ class se extends ut {
|
|
|
189
190
|
// ========================================================================
|
|
190
191
|
_readCompositionFromNode() {
|
|
191
192
|
if (!this.currentNode || !("getAttribute" in this.currentNode))
|
|
192
|
-
return [...
|
|
193
|
-
const t = this.currentNode.getAttribute(
|
|
193
|
+
return [...X];
|
|
194
|
+
const t = this.currentNode.getAttribute(W);
|
|
194
195
|
if (t)
|
|
195
196
|
return this._normalizeComposition(t.split(",").filter(Boolean));
|
|
196
|
-
const { composition: e } =
|
|
197
|
-
return e != null && e.length ? this._normalizeComposition([...e]) : [...
|
|
197
|
+
const { composition: e } = y.getConfig(this.currentNode);
|
|
198
|
+
return e != null && e.length ? this._normalizeComposition([...e]) : [...X];
|
|
198
199
|
}
|
|
199
200
|
/** Upgrades legacy bare-name custom keys to the canonical form. (SD-147101) */
|
|
200
201
|
_normalizeComposition(t) {
|
|
201
|
-
return
|
|
202
|
+
return Lt(t, this.currentNode, this.store.filterList);
|
|
202
203
|
}
|
|
203
204
|
_readCustomAttributesFromNode() {
|
|
204
205
|
if (!this.currentNode || !("getAttribute" in this.currentNode))
|
|
205
206
|
return [];
|
|
206
|
-
const t = this.currentNode.getAttribute(
|
|
207
|
+
const t = this.currentNode.getAttribute(z);
|
|
207
208
|
if (t)
|
|
208
209
|
try {
|
|
209
|
-
return
|
|
210
|
+
return Ot(
|
|
210
211
|
JSON.parse(t).map((e) => String(e)),
|
|
211
212
|
this.currentNode,
|
|
212
213
|
this.store.filterList
|
|
@@ -214,7 +215,7 @@ class se extends ut {
|
|
|
214
215
|
} catch {
|
|
215
216
|
return [];
|
|
216
217
|
}
|
|
217
|
-
return this._readCompositionFromNode().filter((e) => e.startsWith(v)).map(
|
|
218
|
+
return this._readCompositionFromNode().filter((e) => e.startsWith(v)).map(M);
|
|
218
219
|
}
|
|
219
220
|
_readVisibilityFromRows() {
|
|
220
221
|
if (!this.currentNode)
|
|
@@ -222,7 +223,7 @@ class se extends ut {
|
|
|
222
223
|
const t = Array.from(this.currentNode.querySelectorAll(N)), e = this._extractVisibilityFromRows(t);
|
|
223
224
|
if (Object.keys(e).length > 0)
|
|
224
225
|
return this._withTitlePresence(this._mergeWithDefaults(e));
|
|
225
|
-
const r =
|
|
226
|
+
const r = y.getConfig(this.currentNode).visibility;
|
|
226
227
|
return this._withTitlePresence(this._mergeWithDefaults({ ...r }));
|
|
227
228
|
}
|
|
228
229
|
_withTitlePresence(t) {
|
|
@@ -230,25 +231,27 @@ class se extends ut {
|
|
|
230
231
|
}
|
|
231
232
|
_hasTitle() {
|
|
232
233
|
var t;
|
|
233
|
-
return !!((t = this.currentNode) != null && t.querySelector(
|
|
234
|
+
return !!((t = this.currentNode) != null && t.querySelector(G));
|
|
234
235
|
}
|
|
235
236
|
_getDefaultVisibilities() {
|
|
236
|
-
return { ...
|
|
237
|
+
return { ...J };
|
|
237
238
|
}
|
|
238
239
|
_extractVisibilityFromRows(t) {
|
|
239
240
|
const e = {};
|
|
240
241
|
return t.forEach((r) => {
|
|
241
242
|
if (!("getAttribute" in r))
|
|
242
243
|
return;
|
|
243
|
-
const i =
|
|
244
|
-
i
|
|
244
|
+
const i = r.getAttribute(O);
|
|
245
|
+
i !== null && Dt(r).forEach((s) => {
|
|
246
|
+
e[s] = this._parseVisibilityValue(i);
|
|
247
|
+
});
|
|
245
248
|
}), e;
|
|
246
249
|
}
|
|
247
250
|
_parseVisibilityValue(t) {
|
|
248
251
|
return t === "1" || t === "true";
|
|
249
252
|
}
|
|
250
253
|
_mergeWithDefaults(t) {
|
|
251
|
-
return Object.entries(
|
|
254
|
+
return Object.entries(J).forEach(([e, r]) => {
|
|
252
255
|
e in t || (t[e] = r);
|
|
253
256
|
}), t;
|
|
254
257
|
}
|
|
@@ -270,22 +273,22 @@ class se extends ut {
|
|
|
270
273
|
const i = r.querySelector("[data-composition-list]");
|
|
271
274
|
if (!i)
|
|
272
275
|
return !1;
|
|
273
|
-
const s =
|
|
276
|
+
const s = this._isInlinePrices();
|
|
274
277
|
if (!(i.dataset.inlinePrices !== String(s)) && this._tryReorderInPlace(i, t))
|
|
275
278
|
return !1;
|
|
276
279
|
i.dataset.inlinePrices = String(s);
|
|
277
|
-
const n = new Set(e), l =
|
|
280
|
+
const n = new Set(e), l = Nt(t);
|
|
278
281
|
let a = 0, d = 0;
|
|
279
282
|
const c = t.map((u) => {
|
|
280
|
-
if (s && (u ===
|
|
283
|
+
if (s && (u === p || u === A))
|
|
281
284
|
return u === l.anchor ? this._createPriceGroupItemHtml(d++, l.originalFirst) : "";
|
|
282
285
|
if (xt.has(u)) {
|
|
283
|
-
const
|
|
284
|
-
return this._createBuiltInItemHtml(
|
|
286
|
+
const h = m.find((C) => C.key === u);
|
|
287
|
+
return this._createBuiltInItemHtml(h, d++);
|
|
285
288
|
}
|
|
286
289
|
if (u.startsWith(v)) {
|
|
287
|
-
const
|
|
288
|
-
if (n.has(
|
|
290
|
+
const h = M(u);
|
|
291
|
+
if (n.has(h))
|
|
289
292
|
return this._createCustomItemHtml(u, a++, d++);
|
|
290
293
|
}
|
|
291
294
|
return "";
|
|
@@ -344,18 +347,18 @@ class se extends ut {
|
|
|
344
347
|
*/
|
|
345
348
|
_createPriceGroupItemHtml(t, e) {
|
|
346
349
|
var n, l;
|
|
347
|
-
const r = ((n = m.find((a) => a.key ===
|
|
350
|
+
const r = ((n = m.find((a) => a.key === p)) == null ? void 0 : n.label) ?? "Product Price", i = ((l = m.find((a) => a.key === A)) == null ? void 0 : l.label) ?? "Product Original Price", s = (a, d) => `
|
|
348
351
|
<div class="price-suborderable-item" draggable="true" data-subkey="${a}">
|
|
349
|
-
<span class="sub-drag-handle">${
|
|
352
|
+
<span class="sub-drag-handle">${Ft}</span>
|
|
350
353
|
<span class="item-label">${this.api.translate(d)}</span>
|
|
351
|
-
</div>`, o = e ? s(
|
|
354
|
+
</div>`, o = e ? s(A, i) + s(p, r) : s(p, r) + s(A, i);
|
|
352
355
|
return `
|
|
353
356
|
<div class="orderable-item price-group-item" draggable="true"
|
|
354
|
-
data-key="${
|
|
357
|
+
data-key="${p}" data-group="prices">
|
|
355
358
|
<div class="price-group-header">
|
|
356
359
|
<span class="guido-drag-handle" data-reorder-icon-slot="${t}"></span>
|
|
357
360
|
<span class="item-label">${this.api.translate("Product Prices")}</span>
|
|
358
|
-
<div class="item-action" data-action-for="${
|
|
361
|
+
<div class="item-action" data-action-for="${p}"></div>
|
|
359
362
|
</div>
|
|
360
363
|
<div class="price-suborderable-list">${o}</div>
|
|
361
364
|
</div>
|
|
@@ -412,8 +415,8 @@ class se extends ut {
|
|
|
412
415
|
_initializeCustomSelects(t) {
|
|
413
416
|
t.length !== 0 && setTimeout(() => {
|
|
414
417
|
t.forEach((e, r) => {
|
|
415
|
-
const i = `${
|
|
416
|
-
this.api.setUIEAttribute(i,
|
|
418
|
+
const i = `${S}${r}`, s = this._getSelectOptions(e, t);
|
|
419
|
+
this.api.setUIEAttribute(i, L.SELECTPICKER.items, s), this.api.updateValues({ [i]: e });
|
|
417
420
|
});
|
|
418
421
|
}, 0);
|
|
419
422
|
}
|
|
@@ -436,7 +439,7 @@ class se extends ut {
|
|
|
436
439
|
*/
|
|
437
440
|
_moveSelectsIntoItems(t, e) {
|
|
438
441
|
for (let r = 0; r < e; r++) {
|
|
439
|
-
const i = `${
|
|
442
|
+
const i = `${S}${r}`, s = t.querySelector(`[data-custom-select-key="${i}"]`), o = t.querySelector(`[data-custom-select-slot="${r}"]`);
|
|
440
443
|
if (s && o) {
|
|
441
444
|
const n = s.querySelector("ue-select");
|
|
442
445
|
n && o.appendChild(n);
|
|
@@ -463,8 +466,8 @@ class se extends ut {
|
|
|
463
466
|
* Same rescue pattern as _rescueTogglesToStore — prevents innerHTML from destroying them.
|
|
464
467
|
*/
|
|
465
468
|
_rescueSelectsToStore(t) {
|
|
466
|
-
for (let e = 0; e <
|
|
467
|
-
const r = `${
|
|
469
|
+
for (let e = 0; e < b; e++) {
|
|
470
|
+
const r = `${S}${e}`, i = t.querySelector(`[data-custom-select-key="${r}"]`), s = t.querySelector(`[data-custom-select-slot="${e}"]`);
|
|
468
471
|
if (s) {
|
|
469
472
|
const o = s.querySelector("ue-select");
|
|
470
473
|
o && i && i.appendChild(o);
|
|
@@ -489,7 +492,7 @@ class se extends ut {
|
|
|
489
492
|
* Same rescue pattern as _rescueSelectsToStore — prevents innerHTML from destroying them.
|
|
490
493
|
*/
|
|
491
494
|
_rescueDeleteButtonsToStore(t) {
|
|
492
|
-
for (let e = 0; e <
|
|
495
|
+
for (let e = 0; e < b; e++) {
|
|
493
496
|
const r = `${w}${e}`, i = t.querySelector(`[data-custom-delete-key="${r}"]`), s = t.querySelector(`[data-custom-delete-slot="${e}"]`);
|
|
494
497
|
if (s) {
|
|
495
498
|
const o = s.querySelector("ue-button");
|
|
@@ -515,7 +518,7 @@ class se extends ut {
|
|
|
515
518
|
* Same rescue pattern as _rescueDeleteButtonsToStore — prevents innerHTML from destroying them.
|
|
516
519
|
*/
|
|
517
520
|
_rescueReorderIconsToStore(t) {
|
|
518
|
-
const e = m.length +
|
|
521
|
+
const e = m.length + b;
|
|
519
522
|
for (let r = 0; r < e; r++) {
|
|
520
523
|
const i = `${P}${r}`, s = t.querySelector(`[data-reorder-icon-key="${i}"]`), o = t.querySelector(`[data-reorder-icon-slot="${r}"]`);
|
|
521
524
|
if (o) {
|
|
@@ -616,7 +619,7 @@ class se extends ut {
|
|
|
616
619
|
// Actions (Add, Delete, Reorder)
|
|
617
620
|
// ========================================================================
|
|
618
621
|
_onAddAttribute(t, e) {
|
|
619
|
-
const r =
|
|
622
|
+
const r = U(t), i = this._readCompositionFromNode();
|
|
620
623
|
i.push(r);
|
|
621
624
|
const s = [...this._readCustomAttributesFromNode(), t];
|
|
622
625
|
this._updateBothAttributes(i, s), this._injectCustomAttributeHtml(t, e, r, i), this._renderOrderableItems(i, s), this._initializeCustomSelects(s), this._updateAddButtonState();
|
|
@@ -640,20 +643,21 @@ class se extends ut {
|
|
|
640
643
|
const r = this._readCustomAttributesFromNode(), i = r[t];
|
|
641
644
|
if (i === void 0 || i === e)
|
|
642
645
|
return;
|
|
643
|
-
const s =
|
|
646
|
+
const s = U(e), o = this._readCompositionFromNode(), n = this._findNthCustomKeyIndex(o, t);
|
|
644
647
|
n !== -1 && (o[n] = s), r[t] = e;
|
|
645
648
|
const l = this._getDisplayNameForAttribute(e);
|
|
646
649
|
this._updateBothAttributes(o, r), this._injectCustomAttributeHtml(e, l, s, o), this._renderOrderableItems(o, r), this._initializeCustomSelects(r);
|
|
647
650
|
}
|
|
648
651
|
_onReorder(t) {
|
|
649
|
-
const e = t.filter((r) => r.startsWith(v)).map(
|
|
652
|
+
const e = t.filter((r) => r.startsWith(v)).map(M);
|
|
650
653
|
this.reorderInProgress = !0;
|
|
651
654
|
try {
|
|
652
655
|
this._updateBothAttributes(t, e);
|
|
653
|
-
const r =
|
|
654
|
-
this._getCurrentLayout() === "grid" && !r ? this._reorderProductAttributes(t) : this.currentNode &&
|
|
656
|
+
const r = this._isInlinePrices();
|
|
657
|
+
this._getCurrentLayout() === "grid" && !r ? this._reorderProductAttributes(t) : this.currentNode && kt({
|
|
655
658
|
currentNode: this.currentNode,
|
|
656
|
-
documentModifier: this.api.getDocumentModifier()
|
|
659
|
+
documentModifier: this.api.getDocumentModifier(),
|
|
660
|
+
hidden: !0
|
|
657
661
|
});
|
|
658
662
|
} finally {
|
|
659
663
|
this.reorderInProgress = !1;
|
|
@@ -669,13 +673,13 @@ class se extends ut {
|
|
|
669
673
|
* DOM converge on the next composition change without writing on open.
|
|
670
674
|
*/
|
|
671
675
|
_getExistingRowHtml(t, e) {
|
|
672
|
-
const r =
|
|
676
|
+
const r = Ht(t, e);
|
|
673
677
|
if (r && "getOuterHTML" in r)
|
|
674
|
-
return
|
|
678
|
+
return Z(r.getOuterHTML(), e);
|
|
675
679
|
const i = t.querySelector(
|
|
676
680
|
`${N}[${E}="${e}"]`
|
|
677
681
|
);
|
|
678
|
-
return i && "getOuterHTML" in i ?
|
|
682
|
+
return i && "getOuterHTML" in i ? Z(i.getOuterHTML(), e) : "";
|
|
679
683
|
}
|
|
680
684
|
_injectCustomAttributeHtml(t, e, r, i) {
|
|
681
685
|
if (!this.currentNode)
|
|
@@ -683,45 +687,45 @@ class se extends ut {
|
|
|
683
687
|
this._getCurrentLayout() === "grid" ? this._injectGridAttributeRow(t, e, r, i) : this._injectListAttributeRow(t, e, r, i);
|
|
684
688
|
}
|
|
685
689
|
_injectGridAttributeRow(t, e, r, i) {
|
|
686
|
-
const s = this.currentNode.querySelectorAll(
|
|
690
|
+
const s = this.currentNode.querySelectorAll(q);
|
|
687
691
|
if (!(s != null && s.length))
|
|
688
692
|
return;
|
|
689
|
-
const o =
|
|
693
|
+
const o = y.getConfig(this.currentNode), l = `0 ${Math.floor(o.columnSpacing / 2)}px`, a = this.api.getDocumentModifier(), d = this.store.recommendationProducts.length;
|
|
690
694
|
let c = 0;
|
|
691
695
|
s.forEach((u) => {
|
|
692
|
-
var
|
|
693
|
-
const
|
|
694
|
-
if (
|
|
695
|
-
const
|
|
696
|
+
var j;
|
|
697
|
+
const h = u.querySelector(N), C = ((j = h == null ? void 0 : h.querySelectorAll(`.${yt}`)) == null ? void 0 : j.length) || 1, V = (100 / C).toFixed(2), { bgStyle: rt, bgAttr: it } = this._extractSegmentBgFromCard(u), B = d > 0 ? Math.min(C, d - c) : C, st = i.map((K) => {
|
|
698
|
+
if (K === r) {
|
|
699
|
+
const ot = Array.from(
|
|
696
700
|
{ length: B },
|
|
697
|
-
(
|
|
698
|
-
const
|
|
701
|
+
(Vt, lt) => {
|
|
702
|
+
const at = this._resolveAttributeContent(
|
|
699
703
|
t,
|
|
700
704
|
e,
|
|
701
|
-
c +
|
|
705
|
+
c + lt
|
|
702
706
|
);
|
|
703
707
|
return this._getGridCellHtml(
|
|
704
708
|
t,
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
et,
|
|
709
|
+
at,
|
|
710
|
+
V,
|
|
708
711
|
rt,
|
|
712
|
+
it,
|
|
709
713
|
l
|
|
710
714
|
);
|
|
711
715
|
}
|
|
712
|
-
).join(""),
|
|
713
|
-
return `<tr class="${
|
|
716
|
+
).join(""), nt = St(V, l).repeat(C - B);
|
|
717
|
+
return `<tr class="${Y}" ${E}="${r}" ${O}="1">${ot}${nt}</tr>`;
|
|
714
718
|
}
|
|
715
|
-
return this._getExistingRowHtml(u,
|
|
719
|
+
return this._getExistingRowHtml(u, K);
|
|
716
720
|
}).join("");
|
|
717
|
-
c += B, d > 0 && c >= d && (c = 0), a.modifyHtml(u).setInnerHtml(
|
|
718
|
-
}), a
|
|
721
|
+
c += B, d > 0 && c >= d && (c = 0), a.modifyHtml(u).setInnerHtml(st);
|
|
722
|
+
}), H(a, `${this.api.translate("Add custom attribute")}: ${e}`, !0);
|
|
719
723
|
}
|
|
720
724
|
_injectListAttributeRow(t, e, r, i) {
|
|
721
|
-
const s = this.currentNode.querySelectorAll(
|
|
725
|
+
const s = this.currentNode.querySelectorAll(tt);
|
|
722
726
|
if (!(s != null && s.length))
|
|
723
727
|
return;
|
|
724
|
-
const o = i.filter((l) => l !==
|
|
728
|
+
const o = i.filter((l) => l !== F && l !== x), n = this.api.getDocumentModifier();
|
|
725
729
|
s.forEach((l, a) => {
|
|
726
730
|
const d = o.map((c) => {
|
|
727
731
|
if (c === r) {
|
|
@@ -731,7 +735,7 @@ class se extends ut {
|
|
|
731
735
|
return this._getExistingRowHtml(l, c);
|
|
732
736
|
}).join("");
|
|
733
737
|
n.modifyHtml(l).setInnerHtml(d);
|
|
734
|
-
}), n
|
|
738
|
+
}), H(n, `${this.api.translate("Add custom attribute")}: ${e}`, !0);
|
|
735
739
|
}
|
|
736
740
|
/**
|
|
737
741
|
* Removes a custom attribute by rebuilding product card content without it.
|
|
@@ -742,19 +746,19 @@ class se extends ut {
|
|
|
742
746
|
return;
|
|
743
747
|
const e = this._getCurrentLayout(), r = this.api.getDocumentModifier();
|
|
744
748
|
if (e === "grid") {
|
|
745
|
-
const i = this.currentNode.querySelectorAll(
|
|
749
|
+
const i = this.currentNode.querySelectorAll(q);
|
|
746
750
|
i == null || i.forEach((s) => {
|
|
747
751
|
const o = this._buildCompositionHtml(s, t);
|
|
748
752
|
r.modifyHtml(s).setInnerHtml(o);
|
|
749
753
|
});
|
|
750
754
|
} else {
|
|
751
|
-
const i = t.filter((o) => o !==
|
|
755
|
+
const i = t.filter((o) => o !== F && o !== x), s = this.currentNode.querySelectorAll(tt);
|
|
752
756
|
s == null || s.forEach((o) => {
|
|
753
757
|
const n = this._buildCompositionHtml(o, i);
|
|
754
758
|
r.modifyHtml(o).setInnerHtml(n);
|
|
755
759
|
});
|
|
756
760
|
}
|
|
757
|
-
r
|
|
761
|
+
H(r, this.api.translate("Remove custom attribute"), !0);
|
|
758
762
|
}
|
|
759
763
|
// ========================================================================
|
|
760
764
|
// DOM Mutation (Block Root Attributes, Reorder)
|
|
@@ -770,10 +774,10 @@ class se extends ut {
|
|
|
770
774
|
if (!this.currentNode)
|
|
771
775
|
return;
|
|
772
776
|
const r = {
|
|
773
|
-
...
|
|
777
|
+
...y.getConfig(this.currentNode),
|
|
774
778
|
composition: t
|
|
775
779
|
};
|
|
776
|
-
this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute(
|
|
780
|
+
this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute(W, t.join(",")).setAttribute(z, JSON.stringify(e)).setNodeConfig(r).apply(new k(this.api.translate("Update card composition")));
|
|
777
781
|
}
|
|
778
782
|
/**
|
|
779
783
|
* Reorders attribute rows within each product card based on composition order.
|
|
@@ -782,14 +786,14 @@ class se extends ut {
|
|
|
782
786
|
_reorderProductAttributes(t) {
|
|
783
787
|
if (!this.currentNode)
|
|
784
788
|
return;
|
|
785
|
-
const e = this.currentNode.querySelectorAll(
|
|
789
|
+
const e = this.currentNode.querySelectorAll(q);
|
|
786
790
|
if (!(e != null && e.length))
|
|
787
791
|
return;
|
|
788
792
|
const r = this.api.getDocumentModifier();
|
|
789
793
|
e.forEach((i) => {
|
|
790
794
|
const s = this._buildCompositionHtml(i, t);
|
|
791
795
|
r.modifyHtml(i).setInnerHtml(s);
|
|
792
|
-
}), r
|
|
796
|
+
}), H(r, this.api.translate("Reorder product attributes"), !0);
|
|
793
797
|
}
|
|
794
798
|
/**
|
|
795
799
|
* Builds HTML string with attributes ordered according to composition.
|
|
@@ -808,22 +812,32 @@ class se extends ut {
|
|
|
808
812
|
this._applyTitleVisibilityToBlock(e);
|
|
809
813
|
return;
|
|
810
814
|
}
|
|
811
|
-
const r = this.currentNode.querySelectorAll(`${N}[${E}="${
|
|
812
|
-
if (!
|
|
815
|
+
const r = this._resolveVisibilityKeys(t), { currentNode: i } = this, s = r.flatMap((c) => Array.from(i.querySelectorAll(`${N}[${E}="${c}"]`) ?? []));
|
|
816
|
+
if (!s.length)
|
|
813
817
|
return;
|
|
814
|
-
const
|
|
815
|
-
|
|
816
|
-
const
|
|
817
|
-
|
|
818
|
+
const o = e ? "1" : "0", n = e ? this.api.translate("visible") : this.api.translate("hidden"), l = `${this.api.translate("Set visibility")}: ${t} → ${n}`, a = this.api.getDocumentModifier();
|
|
819
|
+
s.forEach((c) => {
|
|
820
|
+
const u = wt(c), h = e ? u : "none";
|
|
821
|
+
a.modifyHtml(c).setStyle("display", h).setAttribute(O, o);
|
|
818
822
|
});
|
|
819
|
-
const
|
|
820
|
-
...
|
|
821
|
-
visibility: {
|
|
823
|
+
const d = {
|
|
824
|
+
...y.getConfig(this.currentNode),
|
|
825
|
+
visibility: {
|
|
826
|
+
...this._readVisibilityFromRows(),
|
|
827
|
+
...Object.fromEntries(r.map((c) => [c, e]))
|
|
828
|
+
}
|
|
822
829
|
};
|
|
823
|
-
|
|
830
|
+
a.modifyHtml(this.currentNode).setNodeConfig(d), a.apply(new k(l));
|
|
831
|
+
}
|
|
832
|
+
/** Inline "Product Prices" group row is tagged with whichever price comes first, so it drives both keys. */
|
|
833
|
+
_resolveVisibilityKeys(t) {
|
|
834
|
+
return this._isInlinePrices() && t === p ? [p, A] : [t];
|
|
835
|
+
}
|
|
836
|
+
_isInlinePrices() {
|
|
837
|
+
return !y.getConfig(this.currentNode).priceMovedToNextLine;
|
|
824
838
|
}
|
|
825
839
|
_applyTitleVisibilityToBlock(t) {
|
|
826
|
-
const e =
|
|
840
|
+
const e = y.getConfig(this.currentNode), r = t ? this._resolveTitleInjection(e) : null, i = t ? [] : this._findTitleRows(), s = t ? this._hasTitle() || !r : i.length === 0;
|
|
827
841
|
if (!this.currentNode || s)
|
|
828
842
|
return;
|
|
829
843
|
const o = this.api.getDocumentModifier();
|
|
@@ -833,7 +847,7 @@ class se extends ut {
|
|
|
833
847
|
visibility: { ...this._readVisibilityFromRows(), [I]: t }
|
|
834
848
|
});
|
|
835
849
|
const n = t ? this.api.translate("visible") : this.api.translate("hidden");
|
|
836
|
-
o.apply(new
|
|
850
|
+
o.apply(new k(
|
|
837
851
|
`${this.api.translate("Set visibility")}: ${I} → ${n}`
|
|
838
852
|
));
|
|
839
853
|
}
|
|
@@ -841,7 +855,7 @@ class se extends ut {
|
|
|
841
855
|
const e = this._findTitleContainerBody(), r = e ? this._readInnerHtml(e) : null;
|
|
842
856
|
if (!e || r === null)
|
|
843
857
|
return null;
|
|
844
|
-
const i = t.previousTitleHtml ||
|
|
858
|
+
const i = t.previousTitleHtml || It(this._defaultTitleParagraph(), !0, t.rowSpacing);
|
|
845
859
|
return { containerBody: e, html: i + r };
|
|
846
860
|
}
|
|
847
861
|
_readTitleHtml(t) {
|
|
@@ -855,23 +869,23 @@ class se extends ut {
|
|
|
855
869
|
return t.length > 0 ? t : this._findTitleRowsByClass();
|
|
856
870
|
}
|
|
857
871
|
_findTitleRowsByClass() {
|
|
858
|
-
const t = this._findTitleContainerBody(), e = t && "children" in t ? t.children() : [], r = e.findIndex((s) => !!s.querySelector(
|
|
872
|
+
const t = this._findTitleContainerBody(), e = t && "children" in t ? t.children() : [], r = e.findIndex((s) => !!s.querySelector(G));
|
|
859
873
|
if (r === -1)
|
|
860
874
|
return [];
|
|
861
875
|
const i = e[r + 1];
|
|
862
876
|
return i && this._isSpacerRow(i) ? [e[r], i] : [e[r]];
|
|
863
877
|
}
|
|
864
878
|
_isSpacerRow(t) {
|
|
865
|
-
return "children" in t && t.children().some((e) => "hasClass" in e && e.hasClass(
|
|
879
|
+
return "children" in t && t.children().some((e) => "hasClass" in e && e.hasClass(gt));
|
|
866
880
|
}
|
|
867
881
|
_findTitleContainerBody() {
|
|
868
|
-
return (this.currentNode ?
|
|
882
|
+
return (this.currentNode ? Mt(this.currentNode) : null) ?? void 0;
|
|
869
883
|
}
|
|
870
884
|
_readInnerHtml(t) {
|
|
871
885
|
return "getInnerHTML" in t && typeof t.getInnerHTML == "function" ? t.getInnerHTML().trim() : null;
|
|
872
886
|
}
|
|
873
887
|
_defaultTitleParagraph() {
|
|
874
|
-
return
|
|
888
|
+
return $t.replace("{-{-TITLE-}-}", this.api.translate(vt));
|
|
875
889
|
}
|
|
876
890
|
// ========================================================================
|
|
877
891
|
// Utilities
|
|
@@ -892,7 +906,7 @@ class se extends ut {
|
|
|
892
906
|
return -1;
|
|
893
907
|
}
|
|
894
908
|
_getCurrentLayout() {
|
|
895
|
-
return this.store.recommendationConfigs.orientation ||
|
|
909
|
+
return this.store.recommendationConfigs.orientation || Ut(this.currentNode);
|
|
896
910
|
}
|
|
897
911
|
/**
|
|
898
912
|
* Extracts background color properties from existing card elements.
|
|
@@ -944,10 +958,10 @@ class se extends ut {
|
|
|
944
958
|
* or when all available filters have already been added (no unused attributes left).
|
|
945
959
|
*/
|
|
946
960
|
_updateAddButtonState() {
|
|
947
|
-
const t = this._readCustomAttributesFromNode(), e = t.length >=
|
|
961
|
+
const t = this._readCustomAttributesFromNode(), e = t.length >= b, r = new Set(t), i = this._getAddableFilters(), s = i.length > 0 && i.every((o) => r.has(T(o)));
|
|
948
962
|
this.api.setUIEAttribute(
|
|
949
|
-
|
|
950
|
-
|
|
963
|
+
et.ADD_ATTRIBUTE,
|
|
964
|
+
L.BUTTON.disabled,
|
|
951
965
|
e || s ? "true" : "false"
|
|
952
966
|
);
|
|
953
967
|
}
|
|
@@ -976,7 +990,7 @@ class se extends ut {
|
|
|
976
990
|
*/
|
|
977
991
|
_getAddableFilters() {
|
|
978
992
|
const t = /* @__PURE__ */ new Set();
|
|
979
|
-
return Object.values(this.store.filterList).filter((e) => !(e.type === "defaultAttribute" &&
|
|
993
|
+
return Object.values(this.store.filterList).filter((e) => !(e.type === "defaultAttribute" && ft.has(e.attributeName))).filter((e) => {
|
|
980
994
|
const r = T(e);
|
|
981
995
|
return t.has(r) ? !1 : (t.add(r), !0);
|
|
982
996
|
});
|
|
@@ -988,7 +1002,7 @@ class se extends ut {
|
|
|
988
1002
|
*/
|
|
989
1003
|
_getDisplayNameForAttribute(t) {
|
|
990
1004
|
const e = Object.values(this.store.filterList).find((r) => T(r) === t);
|
|
991
|
-
return e ? e.displayName :
|
|
1005
|
+
return e ? e.displayName : Et(D(t));
|
|
992
1006
|
}
|
|
993
1007
|
/**
|
|
994
1008
|
* Resolves the display content for a custom attribute cell.
|
|
@@ -996,29 +1010,29 @@ class se extends ut {
|
|
|
996
1010
|
*/
|
|
997
1011
|
_resolveAttributeContent(t, e, r) {
|
|
998
1012
|
var l;
|
|
999
|
-
const s = this.store.recommendationProducts[r], o =
|
|
1000
|
-
return
|
|
1013
|
+
const s = this.store.recommendationProducts[r], o = D(t), n = Pt(t) ? s == null ? void 0 : s[o] : (l = s == null ? void 0 : s.product_attributes) == null ? void 0 : l[o];
|
|
1014
|
+
return Rt(n) ?? e;
|
|
1001
1015
|
}
|
|
1002
1016
|
_getGridCellHtml(t, e, r, i = "", s = "", o = "") {
|
|
1003
|
-
const n =
|
|
1017
|
+
const n = U(t), l = D(t), a = Q(Tt, [n], this.store.filterList), d = {
|
|
1004
1018
|
[l]: e,
|
|
1005
1019
|
product_attributes: { [l]: e }
|
|
1006
1020
|
};
|
|
1007
1021
|
let c = a[n](d);
|
|
1008
1022
|
return c = c.replace("<td", `<td width="${r}%"`), o && (c = c.replace(
|
|
1009
|
-
`padding: ${
|
|
1023
|
+
`padding: ${Ct}`,
|
|
1010
1024
|
`padding: ${o}`
|
|
1011
1025
|
)), i && (c = c.replace(/style="table-layout: fixed;"/, `style="table-layout: fixed; ${i}"`)), s && (c = c.replace(/border="0"/, `border="0" bgcolor="${s}"`)), c;
|
|
1012
1026
|
}
|
|
1013
1027
|
_getListRowHtml(t, e, r) {
|
|
1014
|
-
const i =
|
|
1028
|
+
const i = D(t), s = Q(At, [r], this.store.filterList), o = {
|
|
1015
1029
|
[i]: e,
|
|
1016
1030
|
product_attributes: { [i]: e }
|
|
1017
1031
|
}, l = s[r](o).replace(/<tr>/, "").replace(/<\/tr>/, "");
|
|
1018
|
-
return `<tr class="${
|
|
1032
|
+
return `<tr class="${Y}" ${E}="${r}" ${O}="1">${l}</tr>`;
|
|
1019
1033
|
}
|
|
1020
1034
|
}
|
|
1021
1035
|
export {
|
|
1022
|
-
|
|
1023
|
-
|
|
1036
|
+
qt as COMPOSITION_CONTROL_BLOCK_ID,
|
|
1037
|
+
ne as RecommendationCardCompositionControl
|
|
1024
1038
|
};
|