@pisapp/core 7.0.0-dev.20260916-153034 → 7.0.0-dev.20261028-114206
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/LICENSE +26 -18
- package/README.md +3 -0
- package/catalogs.js +3 -3
- package/chunks/AttributesTable-2eulaCqv.js +3458 -0
- package/chunks/PisGlobal-C0nd_M3S.js +94 -0
- package/chunks/ProductsDetailsHeader-q6jMjbTw.js +4430 -0
- package/chunks/carousel.es-CFCwY--2.js +1602 -0
- package/chunks/directives-KA3MkImb.js +8045 -0
- package/chunks/entry-BPatcdhP.js +9939 -0
- package/chunks/entry-D-F1wf44.js +5681 -0
- package/chunks/entry-XHBj61ID.js +2195 -0
- package/chunks/registerCustomElements-BdPLSkf_.js +426 -0
- package/classifications.js +2 -2
- package/core.js +3 -3
- package/generated/registries.json +2775 -0
- package/index.js +7 -6
- package/migration/API_V1_TO_V2_MIGRATION.md +1704 -177
- package/migration/legacy-option-rules.json +51 -6
- package/migration/v7.json +2983 -441
- package/migration/v7.schema.json +61 -2
- package/package.json +17 -8
- package/pis-csp.js +7 -7
- package/pis.js +7 -7
- package/products.js +3 -1
- package/server.js +354 -0
- package/styles/pis.css +1 -1
- package/styles/theme-abb.optimized.css +1 -1
- package/styles/theme-cux2-blue-dark.css +1 -1
- package/styles/theme-cux2-blue-dark.optimized.css +1 -1
- package/styles/theme-cux2-blue-light.css +1 -1
- package/styles/theme-cux2-blue-light.optimized.css +1 -1
- package/styles/theme-cux2-lilac-dark.css +1 -1
- package/styles/theme-cux2-lilac-dark.optimized.css +1 -1
- package/styles/theme-cux2-lilac-light.css +1 -1
- package/styles/theme-cux2-lilac-light.optimized.css +1 -1
- package/styles/theme-cux2-mono-dark.css +1 -1
- package/styles/theme-cux2-mono-dark.optimized.css +1 -1
- package/styles/theme-cux2-mono-light.css +1 -1
- package/styles/theme-cux2-mono-light.optimized.css +1 -1
- package/styles/theme-cux2-red-dark.css +1 -1
- package/styles/theme-cux2-red-dark.optimized.css +1 -1
- package/styles/theme-cux2-red-light.css +1 -1
- package/styles/theme-cux2-red-light.optimized.css +1 -1
- package/types.d.ts +779 -588
- package/catalogs.d.ts +0 -7725
- package/chunks/catalogs-domain-DJxK_B5E.js +0 -9060
- package/chunks/catalogs-domain-DJxK_B5E.js.map +0 -1
- package/chunks/classifications-domain-DdIJaF1D.js +0 -1980
- package/chunks/classifications-domain-DdIJaF1D.js.map +0 -1
- package/chunks/icons-shared-B8v5z3BE.js +0 -1387
- package/chunks/icons-shared-B8v5z3BE.js.map +0 -1
- package/chunks/products-domain-99vJaUyI.js +0 -22587
- package/chunks/products-domain-99vJaUyI.js.map +0 -1
- package/classifications.d.ts +0 -7725
- package/core.d.ts +0 -7711
- package/index.d.ts +0 -7992
- package/pis-csp.js.map +0 -1
- package/pis.js.map +0 -1
- package/products.d.ts +0 -7746
|
@@ -0,0 +1,4430 @@
|
|
|
1
|
+
import { $t as e, A as t, D as n, Dn as r, E as i, En as a, F as o, I as s, L as c, N as l, O as u, On as d, P as f, Qt as p, R as m, Rt as h, Sn as g, T as _, Tn as v, Tt as y, Ut as b, V as ee, W as te, Xt as ne, Yt as x, Zt as S, _ as C, _n as w, an as re, at as ie, bn as ae, c as oe, cn as se, ct as T, dt as E, en as ce, ft as le, g as D, h as ue, hn as de, ht as fe, i as pe, in as me, j as he, jt as ge, k as _e, l as ve, ln as ye, lt as be, m as xe, mn as O, mt as Se, n as Ce, nn as we, nt as k, on as Te, ot as Ee, p as De, pn as Oe, pt as A, rn as ke, s as Ae, sn as je, tn as Me, u as Ne, un as Pe, ut as Fe, v as j, vn as Ie, wn as Le, x as Re, xn as ze, y as Be, yn as Ve } from "./directives-KA3MkImb.js";
|
|
2
|
+
import { $ as He, D as Ue, E as We, F as Ge, O as Ke, P as qe, Q as Je, T as Ye, U as Xe, V as Ze, X as Qe, Y as $e, Z as et, _ as tt, at as nt, ct as rt, et as it, it as at, k as ot, l as st, m as ct, nt as lt, p as ut, q as dt, r as ft, rt as pt, s as mt, st as ht, t as gt, tt as _t, u as vt, ut as yt, v as bt, w as xt } from "./AttributesTable-2eulaCqv.js";
|
|
3
|
+
import { c as M, n as St } from "./PisGlobal-C0nd_M3S.js";
|
|
4
|
+
import { Fragment as N, computed as P, createBlock as F, createCommentVNode as I, createElementBlock as L, createElementVNode as R, createSlots as Ct, createTextVNode as z, createVNode as B, defineComponent as V, h as wt, mergeProps as Tt, normalizeClass as H, normalizeStyle as Et, onMounted as Dt, openBlock as U, reactive as Ot, ref as W, renderList as G, renderSlot as K, resolveComponent as q, resolveDirective as kt, resolveDynamicComponent as At, toDisplayString as J, toHandlers as jt, vModelCheckbox as Mt, watch as Nt, withCtx as Y, withDirectives as X, withKeys as Pt, withModifiers as Z } from "vue";
|
|
5
|
+
//#region src/common/components/cell-defaults/ProductNameTableCell.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
+
var Ft = {
|
|
7
|
+
key: 1,
|
|
8
|
+
class: "text-muted"
|
|
9
|
+
}, It = /* @__PURE__ */ V({
|
|
10
|
+
__name: "ProductNameTableCell",
|
|
11
|
+
props: { ctx: {} },
|
|
12
|
+
setup(e) {
|
|
13
|
+
let t = e, n = P(() => t.ctx.item), r = P(() => v(n.value, "#DisplayName"));
|
|
14
|
+
return (t, i) => n.value.inactive ? (U(), L("span", Ft, J(r.value), 1)) : (U(), L("a", {
|
|
15
|
+
key: 0,
|
|
16
|
+
class: "fw-medium",
|
|
17
|
+
href: "#",
|
|
18
|
+
onClick: i[0] || (i[0] = Z((t) => e.ctx.details(e.ctx.item), ["prevent"]))
|
|
19
|
+
}, J(r.value), 1));
|
|
20
|
+
}
|
|
21
|
+
}), Lt = { class: "fw-bold" }, Rt = { class: "text-muted small" }, zt = { key: 1 }, Bt = { class: "fw-bold" }, Vt = { class: "text-muted small" }, Ht = /* @__PURE__ */ V({
|
|
22
|
+
__name: "VariantsProductCell",
|
|
23
|
+
props: { ctx: {} },
|
|
24
|
+
setup(e) {
|
|
25
|
+
let t = e, n = P(() => t.ctx.item), r = P(() => v(n.value, "#DisplayName")), i = P(() => v(n.value, "CatalogDescription"));
|
|
26
|
+
return (t, a) => n.value.productId ? (U(), L("a", {
|
|
27
|
+
key: 0,
|
|
28
|
+
href: "#",
|
|
29
|
+
class: "text-decoration-none",
|
|
30
|
+
onClick: a[0] || (a[0] = Z((t) => e.ctx.details(e.ctx.item), ["prevent"]))
|
|
31
|
+
}, [R("div", Lt, J(r.value), 1), R("div", Rt, J(i.value), 1)])) : (U(), L("div", zt, [R("div", Bt, J(r.value), 1), R("div", Vt, J(i.value), 1)]));
|
|
32
|
+
}
|
|
33
|
+
}), Ut = { class: "d-flex flex-wrap gap-1" }, Wt = /* @__PURE__ */ V({
|
|
34
|
+
__name: "VariantsVariantCell",
|
|
35
|
+
props: { ctx: {} },
|
|
36
|
+
setup(e) {
|
|
37
|
+
let t = e, n = (e, t) => v(e, t), r = P(() => t.ctx.group.variantAttributes ?? []);
|
|
38
|
+
return (t, i) => (U(), L("div", Ut, [(U(!0), L(N, null, G(r.value, (t, r) => (U(), L("span", {
|
|
39
|
+
key: t.attributeCode ?? r,
|
|
40
|
+
class: "badge bg-light text-dark border"
|
|
41
|
+
}, J(t.attributeName ?? "") + ": " + J(n(e.ctx.item, t.attributeCode)), 1))), 128))]));
|
|
42
|
+
}
|
|
43
|
+
}), Gt = class {
|
|
44
|
+
constructor() {
|
|
45
|
+
M(this, "appSettings", {
|
|
46
|
+
appCode: "",
|
|
47
|
+
langCode: "en",
|
|
48
|
+
countryCode: void 0,
|
|
49
|
+
includeInternalData: !1,
|
|
50
|
+
treeType: A.PRODUCTS
|
|
51
|
+
}), M(this, "styles", []), M(this, "components", {
|
|
52
|
+
common: {
|
|
53
|
+
hideDocumentLinks: !0,
|
|
54
|
+
hideReplacements: !1,
|
|
55
|
+
hideWhereUsed: !1,
|
|
56
|
+
maxAttributeValuesVisible: 10
|
|
57
|
+
},
|
|
58
|
+
search: {
|
|
59
|
+
common: {
|
|
60
|
+
configurators: { visible: !1 },
|
|
61
|
+
productItemSettings: {
|
|
62
|
+
maxProductImages: 1,
|
|
63
|
+
includeAliases: !0,
|
|
64
|
+
includeReplacements: !0,
|
|
65
|
+
includeVariantAttributes: !0
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
breadcrumbs: { visible: !0 },
|
|
69
|
+
form: {
|
|
70
|
+
visible: !0,
|
|
71
|
+
useAutocomplete: !0,
|
|
72
|
+
maxCategoryMatches: 2
|
|
73
|
+
},
|
|
74
|
+
toolbar: {
|
|
75
|
+
visible: !0,
|
|
76
|
+
pageSizes: [
|
|
77
|
+
12,
|
|
78
|
+
24,
|
|
79
|
+
48,
|
|
80
|
+
72
|
|
81
|
+
],
|
|
82
|
+
subViews: [
|
|
83
|
+
"table",
|
|
84
|
+
"list",
|
|
85
|
+
"grid"
|
|
86
|
+
],
|
|
87
|
+
countVisible: !0,
|
|
88
|
+
subViewsVisible: !0,
|
|
89
|
+
pageSizesVisible: !0,
|
|
90
|
+
sortVisible: !0,
|
|
91
|
+
exportMenu: {
|
|
92
|
+
visible: !1,
|
|
93
|
+
items: []
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
pagination: {
|
|
97
|
+
visible: !0,
|
|
98
|
+
visiblePages: 5
|
|
99
|
+
},
|
|
100
|
+
header: { visible: !0 },
|
|
101
|
+
categories: {
|
|
102
|
+
transparent: !1,
|
|
103
|
+
visible: !0,
|
|
104
|
+
card: !0,
|
|
105
|
+
icon: !1,
|
|
106
|
+
maxCategoriesVisible: 12
|
|
107
|
+
},
|
|
108
|
+
filters: {
|
|
109
|
+
transparent: !1,
|
|
110
|
+
visible: !0,
|
|
111
|
+
card: !0,
|
|
112
|
+
icon: !1,
|
|
113
|
+
maxFiltersVisible: 10,
|
|
114
|
+
visibleFromNodeLevel: 0
|
|
115
|
+
},
|
|
116
|
+
filtersStatus: { visible: !0 },
|
|
117
|
+
narrowByProduct: {
|
|
118
|
+
visible: !0,
|
|
119
|
+
card: !0,
|
|
120
|
+
icon: !0
|
|
121
|
+
},
|
|
122
|
+
partTypes: { visible: !0 },
|
|
123
|
+
selection: {
|
|
124
|
+
visible: !1,
|
|
125
|
+
deselectAllVisible: !0,
|
|
126
|
+
selectAllVisible: !0,
|
|
127
|
+
persist: !1,
|
|
128
|
+
countVisible: !0
|
|
129
|
+
},
|
|
130
|
+
table: {
|
|
131
|
+
visible: !0,
|
|
132
|
+
selectable: !1,
|
|
133
|
+
columns: [
|
|
134
|
+
{
|
|
135
|
+
caption: "Name",
|
|
136
|
+
dataField: "#DisplayName",
|
|
137
|
+
width: "33%",
|
|
138
|
+
treeTypes: [A.PRODUCTS],
|
|
139
|
+
showAllIdentifiers: !0,
|
|
140
|
+
headerTemplate: yt("ProductListProduct", "common"),
|
|
141
|
+
cellTemplate: It
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
caption: "Name",
|
|
145
|
+
dataField: "#DisplayName",
|
|
146
|
+
width: "33%",
|
|
147
|
+
treeTypes: [A.PARTS],
|
|
148
|
+
showAllIdentifiers: !0,
|
|
149
|
+
headerTemplate: yt("ProductListSparePart", "common"),
|
|
150
|
+
cellTemplate: It
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
caption: "Description",
|
|
154
|
+
treeTypes: [A.PRODUCTS, A.PARTS],
|
|
155
|
+
headerTemplate: yt("ProductListInformation", "common"),
|
|
156
|
+
dataField: "CatalogDescription",
|
|
157
|
+
showReplacements: !0,
|
|
158
|
+
showVariants: !0
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
caption: "Quantity",
|
|
162
|
+
treeTypes: [A.PARTS],
|
|
163
|
+
headerTemplate: yt("ProductListQuantity", "common"),
|
|
164
|
+
dataField: "#Quantity",
|
|
165
|
+
masterProductRequired: !0
|
|
166
|
+
}
|
|
167
|
+
]
|
|
168
|
+
},
|
|
169
|
+
list: {
|
|
170
|
+
visible: !0,
|
|
171
|
+
showAllIdentifiers: !0,
|
|
172
|
+
showReplacements: !0,
|
|
173
|
+
navigateOnContentClick: !0,
|
|
174
|
+
imageSize: "10rem",
|
|
175
|
+
selectable: !1,
|
|
176
|
+
imagePadding: 0,
|
|
177
|
+
mobileBreakpoint: 680,
|
|
178
|
+
imageLazyLoading: !0,
|
|
179
|
+
showVariants: !0
|
|
180
|
+
},
|
|
181
|
+
grid: {
|
|
182
|
+
visible: !0,
|
|
183
|
+
selectable: !1,
|
|
184
|
+
showAllIdentifiers: !0,
|
|
185
|
+
showReplacements: !0,
|
|
186
|
+
navigateOnContentClick: !0,
|
|
187
|
+
imageLazyLoading: !0,
|
|
188
|
+
showVariants: !0
|
|
189
|
+
},
|
|
190
|
+
gridHorizontal: {
|
|
191
|
+
visible: !0,
|
|
192
|
+
selectable: !1,
|
|
193
|
+
showAllIdentifiers: !0,
|
|
194
|
+
showReplacements: !0,
|
|
195
|
+
navigateOnContentClick: !0,
|
|
196
|
+
showVariants: !0,
|
|
197
|
+
carousel: {
|
|
198
|
+
mouseDrag: !0,
|
|
199
|
+
touchDrag: !0,
|
|
200
|
+
transition: 300,
|
|
201
|
+
wrapAround: !1,
|
|
202
|
+
defaults: {
|
|
203
|
+
itemsToShow: 1,
|
|
204
|
+
itemsToScroll: 1,
|
|
205
|
+
snapAlign: "center",
|
|
206
|
+
margin: 5,
|
|
207
|
+
navigationVisible: !0,
|
|
208
|
+
paginationVisible: !0
|
|
209
|
+
},
|
|
210
|
+
breakpoints: {
|
|
211
|
+
576: {
|
|
212
|
+
itemsToShow: 2,
|
|
213
|
+
itemsToScroll: 1,
|
|
214
|
+
snapAlign: "start",
|
|
215
|
+
margin: 2,
|
|
216
|
+
navigationVisible: !0,
|
|
217
|
+
paginationVisible: !1
|
|
218
|
+
},
|
|
219
|
+
922: {
|
|
220
|
+
itemsToShow: 4,
|
|
221
|
+
itemsToScroll: 1,
|
|
222
|
+
snapAlign: "start",
|
|
223
|
+
margin: 2,
|
|
224
|
+
navigationVisible: !0,
|
|
225
|
+
paginationVisible: !1
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
favoriteCategories: {
|
|
231
|
+
visible: !1,
|
|
232
|
+
card: !0,
|
|
233
|
+
icon: !1,
|
|
234
|
+
transparent: !1,
|
|
235
|
+
productCids: void 0,
|
|
236
|
+
partCids: void 0,
|
|
237
|
+
maxCategoriesVisible: 12
|
|
238
|
+
},
|
|
239
|
+
favoriteViews: {
|
|
240
|
+
visible: !1,
|
|
241
|
+
transparent: !1,
|
|
242
|
+
card: !0,
|
|
243
|
+
icon: !1,
|
|
244
|
+
fallbackCode: "ABB",
|
|
245
|
+
maxViewsVisible: 10,
|
|
246
|
+
savedViewIds: void 0
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
details: {
|
|
250
|
+
data: {
|
|
251
|
+
bottomNavigationSticky: !0,
|
|
252
|
+
hideBottomNavigation: !1,
|
|
253
|
+
showTabCounts: !0,
|
|
254
|
+
showTabIcons: !0,
|
|
255
|
+
productItemSettings: {
|
|
256
|
+
includeAliases: !0,
|
|
257
|
+
includeReplacements: !0,
|
|
258
|
+
maxProductImages: 6
|
|
259
|
+
},
|
|
260
|
+
variants: { productItemSettings: { maxProductImages: 1 } },
|
|
261
|
+
relationships: {
|
|
262
|
+
productRelationshipFiltering: !0,
|
|
263
|
+
pageSize: 5,
|
|
264
|
+
searchMinItems: 5,
|
|
265
|
+
filteringMinItems: 5,
|
|
266
|
+
filteringMaxAttributesVisible: 5,
|
|
267
|
+
actionTemplates: {},
|
|
268
|
+
displayMode: { All: "table" },
|
|
269
|
+
productItemSettings: { maxProductImages: 1 }
|
|
270
|
+
},
|
|
271
|
+
downloads: {
|
|
272
|
+
visible: !0,
|
|
273
|
+
count: void 0,
|
|
274
|
+
loading: !1
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
classifications: {
|
|
278
|
+
visible: !0,
|
|
279
|
+
treeView: !1
|
|
280
|
+
},
|
|
281
|
+
gallery: {
|
|
282
|
+
visible: !0,
|
|
283
|
+
hideThumbnailImages: !1,
|
|
284
|
+
showOverlayArrows: !1
|
|
285
|
+
},
|
|
286
|
+
relatedLinks: {
|
|
287
|
+
visible: !1,
|
|
288
|
+
showImages: !0
|
|
289
|
+
},
|
|
290
|
+
header: {
|
|
291
|
+
visible: !0,
|
|
292
|
+
showBackBtn: !0,
|
|
293
|
+
showPrintToPdfBtn: !0,
|
|
294
|
+
showPrintViewBtn: !1
|
|
295
|
+
},
|
|
296
|
+
variantsDropdown: {
|
|
297
|
+
visible: !1,
|
|
298
|
+
showImages: !0
|
|
299
|
+
},
|
|
300
|
+
variantsSelector: {
|
|
301
|
+
visible: !0,
|
|
302
|
+
unavailableValuesBehavior: "disabled"
|
|
303
|
+
},
|
|
304
|
+
variantsTable: {
|
|
305
|
+
visible: !1,
|
|
306
|
+
showImages: !0,
|
|
307
|
+
columns: [{
|
|
308
|
+
caption: "Product",
|
|
309
|
+
width: "25%",
|
|
310
|
+
headerTemplate: yt("ProductListProduct", "common"),
|
|
311
|
+
cellTemplate: Ht
|
|
312
|
+
}, {
|
|
313
|
+
caption: "Variant",
|
|
314
|
+
width: "auto",
|
|
315
|
+
headerTemplate: yt("Variant", "products"),
|
|
316
|
+
cellTemplate: Wt
|
|
317
|
+
}]
|
|
318
|
+
}
|
|
319
|
+
},
|
|
320
|
+
compare: { view: {
|
|
321
|
+
visible: !0,
|
|
322
|
+
imageSize: "120px",
|
|
323
|
+
showAllIdentifiers: !0,
|
|
324
|
+
showReplacements: !0,
|
|
325
|
+
categoriesVisible: !0,
|
|
326
|
+
navigationVisible: !0,
|
|
327
|
+
printButtonVisible: !1,
|
|
328
|
+
compactMode: !0,
|
|
329
|
+
attrColWidth: "240px",
|
|
330
|
+
valColWidth: "240px",
|
|
331
|
+
imageVisible: !0,
|
|
332
|
+
imageHideOnScroll: !0,
|
|
333
|
+
productItemSettings: {
|
|
334
|
+
includeAliases: !0,
|
|
335
|
+
includeReplacements: !0,
|
|
336
|
+
maxProductImages: 1
|
|
337
|
+
}
|
|
338
|
+
} },
|
|
339
|
+
preview: { view: {
|
|
340
|
+
visible: !0,
|
|
341
|
+
productItemSettings: {
|
|
342
|
+
includeAliases: !0,
|
|
343
|
+
includeReplacements: !0,
|
|
344
|
+
maxProductImages: 6
|
|
345
|
+
}
|
|
346
|
+
} }
|
|
347
|
+
}), M(this, "allowMobileView", !0), M(this, "cacheTranslations", !0);
|
|
348
|
+
}
|
|
349
|
+
}, Kt = (e) => ({ addToCatalog: async (t, n, r, i) => e.execute(new mt({
|
|
350
|
+
productId: t,
|
|
351
|
+
catalogType: n,
|
|
352
|
+
uom: r,
|
|
353
|
+
catalogId: i
|
|
354
|
+
}), "api") }), qt = {
|
|
355
|
+
search: "/v2/Products/Search",
|
|
356
|
+
count: "/v2/Products/Count",
|
|
357
|
+
detail: "/v2/Products/Detail",
|
|
358
|
+
variantsTable: "/v2/Products/Variants/Table",
|
|
359
|
+
translations: "/v2/Translations"
|
|
360
|
+
}, Q = {
|
|
361
|
+
Classifications: T.CLASSIFICATIONS,
|
|
362
|
+
Products: T.PRODUCTS,
|
|
363
|
+
Filters: T.FILTERS,
|
|
364
|
+
Breadcrumbs: T.BREADCRUMBS,
|
|
365
|
+
Configurators: T.CONFIGURATORS,
|
|
366
|
+
MasterProducts: T.MASTER_PRODUCTS,
|
|
367
|
+
PartTypes: T.PART_TYPES,
|
|
368
|
+
ProductDetails: k.PRODUCT_DETAILS,
|
|
369
|
+
ProductClassifications: k.PRODUCT_CLASSIFICATIONS,
|
|
370
|
+
AttributeGroups: k.ATTRIBUTE_GROUPS,
|
|
371
|
+
ProductRelationships: k.PRODUCT_RELATIONSHIPS,
|
|
372
|
+
RelatedLinks: k.RELATED_LINKS,
|
|
373
|
+
ProductVariantsSelector: k.PRODUCT_VARIANTS_SELECTOR,
|
|
374
|
+
ProductVariantsTable: k.PRODUCT_VARIANTS_TABLE,
|
|
375
|
+
ProductVariantsDropdown: k.PRODUCT_VARIANTS_DROPDOWN,
|
|
376
|
+
ExtendedObjectData: k.EXTENDED_OBJECT_DATA,
|
|
377
|
+
ProductPreview: "ProductPreview",
|
|
378
|
+
FavoriteProductCategories: "FavoriteProductCategories",
|
|
379
|
+
FavoritePartCategories: "FavoritePartCategories",
|
|
380
|
+
FavoriteViews: "FavoriteViews",
|
|
381
|
+
Translations: "Translations",
|
|
382
|
+
RelatedProducts: "RelatedProducts",
|
|
383
|
+
ProductCompare: "ProductCompare",
|
|
384
|
+
ProductIdToName: "ProductIdToName"
|
|
385
|
+
}, Jt = {
|
|
386
|
+
[Q.Products]: (e, t) => {
|
|
387
|
+
e.products = t;
|
|
388
|
+
},
|
|
389
|
+
[Q.Classifications]: (e, t) => {
|
|
390
|
+
e.classifications = t;
|
|
391
|
+
},
|
|
392
|
+
[Q.Filters]: (e, t) => {
|
|
393
|
+
e.filters = t;
|
|
394
|
+
},
|
|
395
|
+
[Q.Breadcrumbs]: (e, t) => {
|
|
396
|
+
e.breadcrumbs = t;
|
|
397
|
+
},
|
|
398
|
+
[Q.ProductDetails]: (e, t) => {
|
|
399
|
+
t == null ? (e.productDetail = void 0, e.itemNotFound = !0) : (e.productDetail = t, e.itemNotFound = !1);
|
|
400
|
+
},
|
|
401
|
+
[Q.ProductClassifications]: (e, t) => {
|
|
402
|
+
e.productClassifications = t;
|
|
403
|
+
},
|
|
404
|
+
[Q.AttributeGroups]: (e, t) => {
|
|
405
|
+
e.attributeGroups = t;
|
|
406
|
+
},
|
|
407
|
+
[Q.ProductRelationships]: (e, t) => {
|
|
408
|
+
e.prm = t;
|
|
409
|
+
},
|
|
410
|
+
[Q.Configurators]: (e, t) => {
|
|
411
|
+
e.configurators = t;
|
|
412
|
+
},
|
|
413
|
+
[Q.RelatedLinks]: (e, t) => {
|
|
414
|
+
e.relatedLinks = t;
|
|
415
|
+
},
|
|
416
|
+
[Q.ProductPreview]: (e, t) => {
|
|
417
|
+
e.productPreview = t;
|
|
418
|
+
},
|
|
419
|
+
[Q.PartTypes]: (e, t) => {
|
|
420
|
+
e.partTypes = t;
|
|
421
|
+
},
|
|
422
|
+
[Q.MasterProducts]: (e, t) => {
|
|
423
|
+
e.sparePartMasterProducts = t;
|
|
424
|
+
},
|
|
425
|
+
[Q.FavoriteProductCategories]: (e, t) => {
|
|
426
|
+
e.favoriteProductCategories = t;
|
|
427
|
+
},
|
|
428
|
+
[Q.FavoritePartCategories]: (e, t) => {
|
|
429
|
+
e.favoritePartCategories = t;
|
|
430
|
+
},
|
|
431
|
+
[Q.FavoriteViews]: (e, t) => {
|
|
432
|
+
e.favoriteViews = t;
|
|
433
|
+
},
|
|
434
|
+
[Q.RelatedProducts]: (e, t) => {
|
|
435
|
+
e.relatedProducts = t;
|
|
436
|
+
},
|
|
437
|
+
[Q.ProductCompare]: (e, t) => {
|
|
438
|
+
e.compareResult = t;
|
|
439
|
+
},
|
|
440
|
+
[Q.ProductIdToName]: (e, t) => {
|
|
441
|
+
if (e.productIdToDisplayName || (e.productIdToDisplayName = {}), t != null && t.item) {
|
|
442
|
+
let { requestedProductId: n, item: r } = t, i = v(r, "#DisplayName");
|
|
443
|
+
i && (e.productIdToDisplayName[r.productId] = i, e.productIdToDisplayName[n] = i);
|
|
444
|
+
}
|
|
445
|
+
},
|
|
446
|
+
[Q.ProductVariantsSelector]: (e, t) => {
|
|
447
|
+
e.productVariantsSelector = t;
|
|
448
|
+
},
|
|
449
|
+
[Q.ProductVariantsTable]: (e, t) => {
|
|
450
|
+
var n;
|
|
451
|
+
let r = t == null ? void 0 : t.items, i = (n = e.productVariantsTable) == null ? void 0 : n.items;
|
|
452
|
+
if ((r == null ? void 0 : r.length) === 1 && i != null && i.length) {
|
|
453
|
+
let e = r[0], t = i.findIndex((t) => t.attributeCode === e.attributeCode);
|
|
454
|
+
if (t >= 0) {
|
|
455
|
+
i.splice(t, 1, e);
|
|
456
|
+
return;
|
|
457
|
+
}
|
|
458
|
+
i.push(e);
|
|
459
|
+
return;
|
|
460
|
+
}
|
|
461
|
+
e.productVariantsTable = t;
|
|
462
|
+
},
|
|
463
|
+
[Q.ProductVariantsDropdown]: (e, t) => {
|
|
464
|
+
e.productVariantsDropdown = t;
|
|
465
|
+
},
|
|
466
|
+
[Q.Translations]: (e, t) => {
|
|
467
|
+
c.log("Setting store data not handled", {
|
|
468
|
+
type: Q.Translations,
|
|
469
|
+
data: t
|
|
470
|
+
});
|
|
471
|
+
},
|
|
472
|
+
[Q.ExtendedObjectData]: (e, t) => {
|
|
473
|
+
c.log("Setting store data not handled", {
|
|
474
|
+
type: Q.ExtendedObjectData,
|
|
475
|
+
data: t
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
}, Yt = class extends m {
|
|
479
|
+
constructor(e) {
|
|
480
|
+
super(e);
|
|
481
|
+
}
|
|
482
|
+
dataInterceptor() {
|
|
483
|
+
var e;
|
|
484
|
+
return (e = this.instance.store) == null ? void 0 : e.options.dataInterceptor;
|
|
485
|
+
}
|
|
486
|
+
dispatchLoadEvent(e) {
|
|
487
|
+
this.setStoreData(e);
|
|
488
|
+
}
|
|
489
|
+
setStoreData({ type: e, data: t }) {
|
|
490
|
+
if (!this.instance.store) return;
|
|
491
|
+
let n = Jt[e];
|
|
492
|
+
n(this.instance.store.data, t);
|
|
493
|
+
}
|
|
494
|
+
}, Xt = "pis-products-translations", Zt = class extends f {
|
|
495
|
+
constructor(e, t, n) {
|
|
496
|
+
super(), M(this, "instance", void 0), M(this, "instanceType", "Products"), M(this, "storeService", void 0), M(this, "client", void 0), M(this, "variantTableController", void 0), M(this, "loadController", void 0), M(this, "autocompleteController", new AbortController()), M(this, "autocompleteCache", {}), M(this, "_lastFilterLoad", {
|
|
497
|
+
key: "",
|
|
498
|
+
count: 0
|
|
499
|
+
}), this.instance = e, this.client = o(e, t, n), this.storeService = new Yt(e);
|
|
500
|
+
}
|
|
501
|
+
searchVariants() {
|
|
502
|
+
var e;
|
|
503
|
+
let t = (e = this.instance.store.options.components) == null || (e = e.search) == null || (e = e.common) == null ? void 0 : e.variants;
|
|
504
|
+
return t ? { clustering: t.clustering } : void 0;
|
|
505
|
+
}
|
|
506
|
+
detailVariants() {
|
|
507
|
+
var e;
|
|
508
|
+
let t = (e = this.instance.store.options.components) == null || (e = e.details) == null || (e = e.data) == null ? void 0 : e.variants;
|
|
509
|
+
return t ? {
|
|
510
|
+
clustering: t.clustering,
|
|
511
|
+
productItemSettings: t.productItemSettings
|
|
512
|
+
} : void 0;
|
|
513
|
+
}
|
|
514
|
+
relationshipSettings(e) {
|
|
515
|
+
var t;
|
|
516
|
+
let n = (t = this.instance.store.options.components) == null || (t = t.details) == null || (t = t.data) == null ? void 0 : t.relationships;
|
|
517
|
+
return {
|
|
518
|
+
productRelationshipFiltering: n == null ? void 0 : n.productRelationshipFiltering,
|
|
519
|
+
productItemSettings: n == null ? void 0 : n.productItemSettings,
|
|
520
|
+
...e ? { pager: e } : {}
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
relationshipAutocompleteSettings(e) {
|
|
524
|
+
var t;
|
|
525
|
+
let n = (t = this.instance.store.options.components) == null || (t = t.details) == null || (t = t.data) == null ? void 0 : t.relationships;
|
|
526
|
+
return {
|
|
527
|
+
productItemSettings: n == null ? void 0 : n.productItemSettings,
|
|
528
|
+
pager: e
|
|
529
|
+
};
|
|
530
|
+
}
|
|
531
|
+
async load(e) {
|
|
532
|
+
if (this.instance.router) try {
|
|
533
|
+
let t = e || this.instance.router.routeData;
|
|
534
|
+
switch (t.view) {
|
|
535
|
+
case "search": return await this.query(t);
|
|
536
|
+
case "detail": return await this.detail(t);
|
|
537
|
+
case "compare": return await this.compare(t);
|
|
538
|
+
default: throw Error(`Unknown view type "${t.view}" to be handled by HttpService`);
|
|
539
|
+
}
|
|
540
|
+
} catch (e) {
|
|
541
|
+
this.instance.store.data.isLoadingData = !1, console.error("Load failed", e);
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
async paginate(e) {
|
|
545
|
+
var t, n, r;
|
|
546
|
+
let i = this.searchAttribution();
|
|
547
|
+
(t = this.loadController) == null || t.abort();
|
|
548
|
+
let a = new AbortController();
|
|
549
|
+
this.loadController = a, this.instance.store.data.isLoadingData = !0;
|
|
550
|
+
let o = Date.now(), c;
|
|
551
|
+
try {
|
|
552
|
+
var l, u, d, f, p, m, h, g, _, v, y, b, ee;
|
|
553
|
+
c = await ye({
|
|
554
|
+
...s(),
|
|
555
|
+
productsSearchQuery: {
|
|
556
|
+
productItemSettings: (l = this.instance.store.options.components) == null || (l = l.search) == null || (l = l.common) == null ? void 0 : l.productItemSettings,
|
|
557
|
+
appSettings: (u = this.instance.store) == null ? void 0 : u.options.appSettings,
|
|
558
|
+
dataTypes: [T.PRODUCTS],
|
|
559
|
+
variants: this.searchVariants(),
|
|
560
|
+
sortMap: (d = this.instance.store.options.components) == null || (d = d.search) == null || (d = d.common) == null ? void 0 : d.sortMap,
|
|
561
|
+
pager: {
|
|
562
|
+
page: (e == null || (f = e.search) == null || (f = f.pagination) == null ? void 0 : f.page) ?? 1,
|
|
563
|
+
pageSize: (e == null || (p = e.search) == null || (p = p.pagination) == null ? void 0 : p.pageSize) ?? 12
|
|
564
|
+
},
|
|
565
|
+
search: {
|
|
566
|
+
cid: (m = e.search) == null ? void 0 : m.cid,
|
|
567
|
+
partType: ((h = e.search) == null ? void 0 : h.partsType) || Ee.ALL,
|
|
568
|
+
searchType: (g = e.search) == null ? void 0 : g.searchType,
|
|
569
|
+
searchText: ((_ = e.search) == null ? void 0 : _.searchText) ?? void 0,
|
|
570
|
+
filter: (v = e.search) == null ? void 0 : v.filters,
|
|
571
|
+
masterProductId: ((y = e.search) == null ? void 0 : y.masterProductId) ?? void 0
|
|
572
|
+
},
|
|
573
|
+
sort: {
|
|
574
|
+
field: ((b = e.search) == null ? void 0 : b.sortField) ?? le.PRODUCT,
|
|
575
|
+
direction: ((ee = e.search) == null ? void 0 : ee.sortDirection) ?? E.ASCENDING
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
}, {
|
|
579
|
+
client: this.client,
|
|
580
|
+
signal: a.signal
|
|
581
|
+
});
|
|
582
|
+
} catch (t) {
|
|
583
|
+
if (Ve(t)) return;
|
|
584
|
+
throw this.trackSearch(e, {
|
|
585
|
+
status: "error",
|
|
586
|
+
durationMs: Date.now() - o
|
|
587
|
+
}, i), t;
|
|
588
|
+
}
|
|
589
|
+
this.loadController === a && (this.trackSearch(e, ae((n = c.products) == null ? void 0 : n.totalCount, (r = c.products) == null ? void 0 : r.items, Date.now() - o), i), this.instance.eventBus.emit("search-loaded", c), c.products && this.storeService.setData(Q.Products, c.products), this.instance.store.data.isLoadingData = !1);
|
|
590
|
+
}
|
|
591
|
+
searchAttribution() {
|
|
592
|
+
let { action: e, source: t, trigger: n = "ui" } = ze(this.instance) ?? {};
|
|
593
|
+
return {
|
|
594
|
+
origin: e ?? "route",
|
|
595
|
+
trigger: n,
|
|
596
|
+
...t ? { source: t } : {}
|
|
597
|
+
};
|
|
598
|
+
}
|
|
599
|
+
trackSearch(e, t, n) {
|
|
600
|
+
var r, i, a, o, s, c;
|
|
601
|
+
g(this.instance, {
|
|
602
|
+
kind: "search",
|
|
603
|
+
action: "search",
|
|
604
|
+
trigger: n.trigger,
|
|
605
|
+
origin: n.origin,
|
|
606
|
+
...n.source ? { source: n.source } : {},
|
|
607
|
+
args: {
|
|
608
|
+
searchText: ((r = e.search) == null ? void 0 : r.searchText) ?? null,
|
|
609
|
+
searchType: ((i = e.search) == null ? void 0 : i.searchType) ?? null,
|
|
610
|
+
cid: ((a = e.search) == null ? void 0 : a.cid) ?? null,
|
|
611
|
+
page: ((o = e.search) == null || (o = o.pagination) == null ? void 0 : o.page) ?? 1,
|
|
612
|
+
pageSize: ((s = e.search) == null || (s = s.pagination) == null ? void 0 : s.pageSize) ?? 12,
|
|
613
|
+
appliedFilterCount: ((c = e.search) == null || (c = c.filters) == null || (c = c.rules) == null ? void 0 : c.length) ?? 0
|
|
614
|
+
},
|
|
615
|
+
outcome: t
|
|
616
|
+
});
|
|
617
|
+
}
|
|
618
|
+
async query(e) {
|
|
619
|
+
var t, n, r, i, a, o, c, l, u;
|
|
620
|
+
let { pagination: d, searchText: f, searchType: p, cid: m, filters: h, sortField: g, sortDirection: _, partsType: v, masterProductId: y } = e.search ?? {}, b = this.instance.getRegisteredSearchDataTypes();
|
|
621
|
+
if (!b.length) return Promise.resolve();
|
|
622
|
+
let ee = this.searchAttribution();
|
|
623
|
+
(t = this.loadController) == null || t.abort();
|
|
624
|
+
let te = new AbortController();
|
|
625
|
+
this.loadController = te, this.instance.store.data.isLoadingData = !0;
|
|
626
|
+
let ne = Date.now(), x = {
|
|
627
|
+
appSettings: (n = this.instance.store) == null ? void 0 : n.options.appSettings,
|
|
628
|
+
dataTypes: b,
|
|
629
|
+
variants: this.searchVariants(),
|
|
630
|
+
productItemSettings: (r = this.instance.store.options.components) == null || (r = r.search) == null || (r = r.common) == null ? void 0 : r.productItemSettings,
|
|
631
|
+
sortMap: (i = this.instance.store.options.components) == null || (i = i.search) == null || (i = i.common) == null ? void 0 : i.sortMap,
|
|
632
|
+
classifications: { maxClassificationImages: (a = this.instance.store.options.components) == null || (a = a.search) == null || (a = a.common) == null ? void 0 : a.maxCategoryImages },
|
|
633
|
+
pager: {
|
|
634
|
+
page: (d == null ? void 0 : d.page) ?? 1,
|
|
635
|
+
pageSize: (d == null ? void 0 : d.pageSize) ?? 12
|
|
636
|
+
},
|
|
637
|
+
search: {
|
|
638
|
+
cid: m,
|
|
639
|
+
partType: v || Ee.ALL,
|
|
640
|
+
searchType: p,
|
|
641
|
+
searchText: f ?? void 0,
|
|
642
|
+
filter: h,
|
|
643
|
+
masterProductId: y ?? void 0
|
|
644
|
+
},
|
|
645
|
+
sort: {
|
|
646
|
+
field: g ?? le.PRODUCT,
|
|
647
|
+
direction: _ ?? E.ASCENDING
|
|
648
|
+
},
|
|
649
|
+
filters: {
|
|
650
|
+
attributeCodes: (o = this.instance.store.options.components) == null || (o = o.search) == null || (o = o.filters) == null ? void 0 : o.attributeCodes,
|
|
651
|
+
maxFilterAttributes: (c = this.instance.store.options.components) == null || (c = c.search) == null || (c = c.filters) == null ? void 0 : c.maxFiltersVisible
|
|
652
|
+
}
|
|
653
|
+
}, S;
|
|
654
|
+
if (this.instance.store.options.httpInterceptor) try {
|
|
655
|
+
S = await this.instance.store.options.httpInterceptor({
|
|
656
|
+
body: x,
|
|
657
|
+
url: qt.search,
|
|
658
|
+
method: "post"
|
|
659
|
+
});
|
|
660
|
+
} catch {}
|
|
661
|
+
if (this.loadController !== te) return;
|
|
662
|
+
let C = S;
|
|
663
|
+
try {
|
|
664
|
+
C || (C = await ye({
|
|
665
|
+
...s(),
|
|
666
|
+
productsSearchQuery: x
|
|
667
|
+
}, {
|
|
668
|
+
client: this.client,
|
|
669
|
+
signal: te.signal
|
|
670
|
+
}));
|
|
671
|
+
} catch (t) {
|
|
672
|
+
if (Ve(t)) return;
|
|
673
|
+
throw this.trackSearch(e, {
|
|
674
|
+
status: "error",
|
|
675
|
+
durationMs: Date.now() - ne
|
|
676
|
+
}, ee), t;
|
|
677
|
+
}
|
|
678
|
+
this.loadController === te && (this.trackSearch(e, ae((l = C.products) == null ? void 0 : l.totalCount, (u = C.products) == null ? void 0 : u.items, Date.now() - ne), ee), this.instance.eventBus.emit("search-loaded", C), C.products && this.storeService.setData(Q.Products, C.products), C.classifications && this.storeService.setData(Q.Classifications, C.classifications), C.filters && this.storeService.setData(Q.Filters, C.filters), C.breadcrumbs && this.storeService.setData(Q.Breadcrumbs, C.breadcrumbs), C.configurators && this.storeService.setData(Q.Configurators, C.configurators), C.partTypes && this.storeService.setData(Q.PartTypes, C.partTypes), C.masterProducts && this.storeService.setData(Q.MasterProducts, C.masterProducts), this.instance.store.data.isLoadingData = !1, this.instance.eventBus.emit("search-changed"));
|
|
679
|
+
}
|
|
680
|
+
async detail(e) {
|
|
681
|
+
var t, n, r, i, a, o;
|
|
682
|
+
let c = (t = e.detail) == null ? void 0 : t.productId, l = (n = e.search) == null ? void 0 : n.cid;
|
|
683
|
+
if (!c) return Promise.resolve();
|
|
684
|
+
let u = this.instance.getRegisteredDetailsDataTypes();
|
|
685
|
+
if (!u.length) return Promise.resolve();
|
|
686
|
+
(r = this.loadController) == null || r.abort();
|
|
687
|
+
let d = new AbortController();
|
|
688
|
+
this.loadController = d, this.instance.store.data.isLoadingData = !0, this.instance.store.data.productDetail = void 0, (i = this.variantTableController) == null || i.abort(), await this.storeService.setData(Q.ProductVariantsTable, void 0);
|
|
689
|
+
let f = {
|
|
690
|
+
appSettings: (a = this.instance.store) == null ? void 0 : a.options.appSettings,
|
|
691
|
+
dataTypes: u,
|
|
692
|
+
search: {
|
|
693
|
+
productId: c,
|
|
694
|
+
cid: l
|
|
695
|
+
},
|
|
696
|
+
productItemSettings: (o = this.instance.store) == null || (o = o.options.components) == null || (o = o.details) == null || (o = o.data) == null ? void 0 : o.productItemSettings,
|
|
697
|
+
relationships: this.relationshipSettings(),
|
|
698
|
+
variants: this.detailVariants()
|
|
699
|
+
}, p;
|
|
700
|
+
if (this.instance.store.options.httpInterceptor) try {
|
|
701
|
+
p = await this.instance.store.options.httpInterceptor({
|
|
702
|
+
body: f,
|
|
703
|
+
url: qt.detail,
|
|
704
|
+
method: "post"
|
|
705
|
+
});
|
|
706
|
+
} catch {}
|
|
707
|
+
if (this.loadController !== d) return;
|
|
708
|
+
let m = p;
|
|
709
|
+
if (!m) try {
|
|
710
|
+
m = await S({
|
|
711
|
+
...s(),
|
|
712
|
+
detailQuery: f
|
|
713
|
+
}, {
|
|
714
|
+
client: this.client,
|
|
715
|
+
signal: d.signal
|
|
716
|
+
});
|
|
717
|
+
} catch (e) {
|
|
718
|
+
if (Ve(e)) return;
|
|
719
|
+
throw e;
|
|
720
|
+
}
|
|
721
|
+
this.loadController === d && (this.instance.eventBus.emit("detail-loaded", m), m.productDetails ? (this.storeService.setData(Q.ProductDetails, m.productDetails), this.storeService.setData(Q.ProductIdToName, {
|
|
722
|
+
item: m.productDetails.item,
|
|
723
|
+
requestedProductId: c
|
|
724
|
+
})) : this.storeService.setData(Q.ProductDetails, void 0), m.attributeGroups && this.storeService.setData(Q.AttributeGroups, m.attributeGroups), m.productRelationships && this.storeService.setData(Q.ProductRelationships, m.productRelationships), m.productClassifications && this.storeService.setData(Q.ProductClassifications, m.productClassifications), m.relatedLinks ? this.storeService.setData(Q.RelatedLinks, m.relatedLinks) : this.storeService.setData(Q.RelatedLinks, void 0), m.productVariantsSelector && this.storeService.setData(Q.ProductVariantsSelector, m.productVariantsSelector), m.productVariantsTable && this.storeService.setData(Q.ProductVariantsTable, m.productVariantsTable), m.productVariantsDropdown && this.storeService.setData(Q.ProductVariantsDropdown, m.productVariantsDropdown), this.storeService.setData(Q.RelatedProducts, m.relatedProducts || void 0), this.instance.store.data.isLoadingData = !1);
|
|
725
|
+
}
|
|
726
|
+
async loadVariantTableGroup(e) {
|
|
727
|
+
var t, n, r, i, a;
|
|
728
|
+
let { productId: o } = this.instance.router.routeData.detail ?? {};
|
|
729
|
+
if (!o || !e) return;
|
|
730
|
+
let c = (t = this.instance.store.data.productVariantsTable) == null || (t = t.items) == null ? void 0 : t.find((t) => t.attributeCode === e);
|
|
731
|
+
if ((c == null ? void 0 : c.products) !== void 0 && c.variantAttributes !== void 0) return;
|
|
732
|
+
(n = this.variantTableController) == null || n.abort();
|
|
733
|
+
let l = new AbortController();
|
|
734
|
+
this.variantTableController = l;
|
|
735
|
+
let u = {
|
|
736
|
+
appSettings: this.instance.store.options.appSettings,
|
|
737
|
+
attributeCode: e,
|
|
738
|
+
productItemSettings: (r = this.detailVariants()) == null ? void 0 : r.productItemSettings,
|
|
739
|
+
search: { productId: o }
|
|
740
|
+
}, d;
|
|
741
|
+
if (this.instance.store.options.httpInterceptor && (d = await this.instance.store.options.httpInterceptor({
|
|
742
|
+
body: u,
|
|
743
|
+
url: qt.variantsTable,
|
|
744
|
+
method: "post"
|
|
745
|
+
}), l.signal.aborted || this.variantTableController !== l)) return;
|
|
746
|
+
let f;
|
|
747
|
+
try {
|
|
748
|
+
f = d ?? await Pe({
|
|
749
|
+
...s(),
|
|
750
|
+
productVariantsTableQuery: u
|
|
751
|
+
}, {
|
|
752
|
+
client: this.client,
|
|
753
|
+
signal: l.signal
|
|
754
|
+
});
|
|
755
|
+
} catch (e) {
|
|
756
|
+
if (Ve(e)) return;
|
|
757
|
+
throw e;
|
|
758
|
+
}
|
|
759
|
+
if (l.signal.aborted || this.variantTableController !== l) return;
|
|
760
|
+
let p = (i = f.items) == null ? void 0 : i[0];
|
|
761
|
+
if (((a = f.items) == null ? void 0 : a.length) !== 1 || (p == null ? void 0 : p.attributeCode) !== e) throw Error(`Variants table group "${e}" was not returned.`);
|
|
762
|
+
await this.storeService.setData(Q.ProductVariantsTable, f);
|
|
763
|
+
}
|
|
764
|
+
async compare(e) {
|
|
765
|
+
var t;
|
|
766
|
+
(t = this.loadController) == null || t.abort();
|
|
767
|
+
let n = new AbortController();
|
|
768
|
+
this.loadController = n, this.instance.store.data.isLoadingData = !0;
|
|
769
|
+
let r;
|
|
770
|
+
try {
|
|
771
|
+
var i, a, o, c, l, u, d, f;
|
|
772
|
+
r = await x({
|
|
773
|
+
...s(),
|
|
774
|
+
compareQuery: {
|
|
775
|
+
appSettings: (i = this.instance.store) == null ? void 0 : i.options.appSettings,
|
|
776
|
+
search: {
|
|
777
|
+
productIds: ((a = e.compare) == null ? void 0 : a.productIds) ?? [],
|
|
778
|
+
mergeMethod: ((o = e.compare) == null ? void 0 : o.mergeMethod) ?? te.FLAT,
|
|
779
|
+
cids: ((c = e.compare) == null ? void 0 : c.cids) ?? [],
|
|
780
|
+
differencesOnly: (l = e.compare) == null ? void 0 : l.differencesOnly,
|
|
781
|
+
strictMode: (u = e.compare) == null ? void 0 : u.strictMode,
|
|
782
|
+
specialDocumentHandling: (d = e.compare) == null ? void 0 : d.specialDocumentHandling
|
|
783
|
+
},
|
|
784
|
+
productItemSettings: (f = this.instance.store.options.components) == null || (f = f.compare) == null || (f = f.view) == null ? void 0 : f.productItemSettings
|
|
785
|
+
}
|
|
786
|
+
}, {
|
|
787
|
+
client: this.client,
|
|
788
|
+
signal: n.signal
|
|
789
|
+
});
|
|
790
|
+
} catch (e) {
|
|
791
|
+
if (Ve(e)) return;
|
|
792
|
+
throw e;
|
|
793
|
+
}
|
|
794
|
+
this.loadController === n && (this.instance.eventBus.emit("compare-loaded", r), r && this.storeService.setData(Q.ProductCompare, r), this.instance.store.data.isLoadingData = !1);
|
|
795
|
+
}
|
|
796
|
+
async preview(e) {
|
|
797
|
+
var t, n, r, i;
|
|
798
|
+
this.instance.store.data.isLoadingData = !0;
|
|
799
|
+
let a = await re({
|
|
800
|
+
...s(),
|
|
801
|
+
previewQuery: {
|
|
802
|
+
appSettings: (t = this.instance.store) == null ? void 0 : t.options.appSettings,
|
|
803
|
+
search: {
|
|
804
|
+
productId: e,
|
|
805
|
+
cid: (n = this.instance.getRouteData().search) == null ? void 0 : n.cid,
|
|
806
|
+
filter: (r = this.instance.getRouteData().search) == null ? void 0 : r.filters
|
|
807
|
+
},
|
|
808
|
+
productItemSettings: (i = this.instance.store.options.components) == null || (i = i.preview) == null || (i = i.view) == null ? void 0 : i.productItemSettings
|
|
809
|
+
}
|
|
810
|
+
}, { client: this.client });
|
|
811
|
+
this.instance.eventBus.emit("preview-loaded", a), a && this.storeService.setData(Q.ProductPreview, a), this.instance.store.data.isLoadingData = !1;
|
|
812
|
+
}
|
|
813
|
+
async filterValues(e) {
|
|
814
|
+
var t;
|
|
815
|
+
let { searchText: n, searchType: r, cid: i, filters: a, partsType: o } = this.instance.router.routeData.search ?? {};
|
|
816
|
+
return await ke({
|
|
817
|
+
...s(),
|
|
818
|
+
filterValueQuery: {
|
|
819
|
+
appSettings: (t = this.instance.store) == null ? void 0 : t.options.appSettings,
|
|
820
|
+
variants: this.searchVariants(),
|
|
821
|
+
search: {
|
|
822
|
+
cid: i,
|
|
823
|
+
searchText: n,
|
|
824
|
+
searchType: r,
|
|
825
|
+
partType: o,
|
|
826
|
+
filter: a,
|
|
827
|
+
attributeCodes: e
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
}, { client: this.client });
|
|
831
|
+
}
|
|
832
|
+
async filters() {
|
|
833
|
+
var e;
|
|
834
|
+
let { searchText: t, searchType: n, cid: r, filters: i, partsType: a } = this.instance.router.routeData.search ?? {};
|
|
835
|
+
return await we({
|
|
836
|
+
...s(),
|
|
837
|
+
filtersQuery: {
|
|
838
|
+
appSettings: (e = this.instance.store) == null ? void 0 : e.options.appSettings,
|
|
839
|
+
variants: this.searchVariants(),
|
|
840
|
+
search: {
|
|
841
|
+
cid: r,
|
|
842
|
+
searchText: t,
|
|
843
|
+
searchType: n,
|
|
844
|
+
partType: a,
|
|
845
|
+
filter: i
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
}, { client: this.client });
|
|
849
|
+
}
|
|
850
|
+
async loadTranslations() {
|
|
851
|
+
var e;
|
|
852
|
+
let t = await this.fetchTranslations(Xt, qt.translations), n = (e = this.instance.store) == null ? void 0 : e.options.dataInterceptor, r = {
|
|
853
|
+
type: Q.Translations,
|
|
854
|
+
data: Ot({ items: t }),
|
|
855
|
+
instance: this.instance
|
|
856
|
+
};
|
|
857
|
+
if (n) {
|
|
858
|
+
var i;
|
|
859
|
+
let e = await n(r);
|
|
860
|
+
return e.type === "Translations" ? (i = e.data) == null ? void 0 : i.items : t;
|
|
861
|
+
}
|
|
862
|
+
return t;
|
|
863
|
+
}
|
|
864
|
+
async loadPrmRelationship(e, t) {
|
|
865
|
+
var n;
|
|
866
|
+
return await Te({
|
|
867
|
+
...s(),
|
|
868
|
+
relationshipQuery: {
|
|
869
|
+
appSettings: (n = this.instance.store) == null ? void 0 : n.options.appSettings,
|
|
870
|
+
relationships: this.relationshipSettings(t),
|
|
871
|
+
search: e
|
|
872
|
+
}
|
|
873
|
+
}, { client: this.client });
|
|
874
|
+
}
|
|
875
|
+
async loadPrmRelationshipAutocomplete(e, t) {
|
|
876
|
+
var n;
|
|
877
|
+
return await je({
|
|
878
|
+
...s(),
|
|
879
|
+
relationshipAutocompleteQuery: {
|
|
880
|
+
appSettings: (n = this.instance.store) == null ? void 0 : n.options.appSettings,
|
|
881
|
+
relationships: this.relationshipAutocompleteSettings(t),
|
|
882
|
+
search: e
|
|
883
|
+
}
|
|
884
|
+
}, { client: this.client });
|
|
885
|
+
}
|
|
886
|
+
async loadPrmRelationshipFilterValues(e) {
|
|
887
|
+
var t;
|
|
888
|
+
return await se({
|
|
889
|
+
...s(),
|
|
890
|
+
relationshipFilterValueQuery: {
|
|
891
|
+
appSettings: (t = this.instance.store) == null ? void 0 : t.options.appSettings,
|
|
892
|
+
search: e
|
|
893
|
+
}
|
|
894
|
+
}, { client: this.client });
|
|
895
|
+
}
|
|
896
|
+
async autocomplete(e, t) {
|
|
897
|
+
var n, r, i;
|
|
898
|
+
let { action: a, source: o, trigger: c = "ui" } = ze(this.instance) ?? {};
|
|
899
|
+
this.autocompleteController && this.autocompleteController.abort(), this.autocompleteController = new AbortController();
|
|
900
|
+
let { cid: l, searchType: u, partsType: d, filters: f } = this.instance.router.routeData.search ?? {}, p = (n = this.instance.store.options.components) == null || (n = n.search) == null ? void 0 : n.form, m = (r = this.instance.store.options.components) == null || (r = r.search) == null || (r = r.common) == null ? void 0 : r.productItemSettings, h = {
|
|
901
|
+
appSettings: (i = this.instance.store) == null ? void 0 : i.options.appSettings,
|
|
902
|
+
variants: this.searchVariants(),
|
|
903
|
+
productItemSettings: {
|
|
904
|
+
...m,
|
|
905
|
+
maxProductImages: p != null && p.showProductImages ? (m == null ? void 0 : m.maxProductImages) ?? 1 : 0
|
|
906
|
+
},
|
|
907
|
+
pager: {
|
|
908
|
+
page: 1,
|
|
909
|
+
pageSize: 5
|
|
910
|
+
},
|
|
911
|
+
search: {
|
|
912
|
+
cid: t ? void 0 : l,
|
|
913
|
+
searchType: t ? be.HIERARCHICAL : u,
|
|
914
|
+
searchText: e ?? void 0,
|
|
915
|
+
filter: f,
|
|
916
|
+
partType: d
|
|
917
|
+
},
|
|
918
|
+
autoCategoryNavigation: p == null ? void 0 : p.autoCategoryNavigation,
|
|
919
|
+
fetchCategoryImages: t ? !0 : p == null ? void 0 : p.showCategoryImages,
|
|
920
|
+
categorySearch: t ? !0 : p == null ? void 0 : p.categorySearch,
|
|
921
|
+
categoryKeywordSearch: t ? !0 : p == null ? void 0 : p.categoryKeywordSearch
|
|
922
|
+
}, _ = JSON.stringify(h);
|
|
923
|
+
if (this.autocompleteCache[_]) return Promise.resolve(this.autocompleteCache[_]);
|
|
924
|
+
let v = Date.now(), y;
|
|
925
|
+
try {
|
|
926
|
+
y = await fe({
|
|
927
|
+
...s(),
|
|
928
|
+
autocompleteQuery: h
|
|
929
|
+
}, {
|
|
930
|
+
client: this.client,
|
|
931
|
+
signal: this.autocompleteController.signal
|
|
932
|
+
});
|
|
933
|
+
} catch (t) {
|
|
934
|
+
throw Ve(t) || g(this.instance, {
|
|
935
|
+
kind: "autocomplete",
|
|
936
|
+
action: "autocomplete",
|
|
937
|
+
trigger: c,
|
|
938
|
+
...a ? { origin: a } : {},
|
|
939
|
+
...o ? { source: o } : {},
|
|
940
|
+
args: { searchText: e },
|
|
941
|
+
outcome: {
|
|
942
|
+
status: "error",
|
|
943
|
+
durationMs: Date.now() - v
|
|
944
|
+
}
|
|
945
|
+
}), t;
|
|
946
|
+
}
|
|
947
|
+
return this.autocompleteCache[_] = y, g(this.instance, {
|
|
948
|
+
kind: "autocomplete",
|
|
949
|
+
action: "autocomplete",
|
|
950
|
+
trigger: c,
|
|
951
|
+
...a ? { origin: a } : {},
|
|
952
|
+
...o ? { source: o } : {},
|
|
953
|
+
args: { searchText: e },
|
|
954
|
+
outcome: ae(y.totalCount, y.items, Date.now() - v)
|
|
955
|
+
}), y;
|
|
956
|
+
}
|
|
957
|
+
async loadFiltersResultCount(e) {
|
|
958
|
+
var t;
|
|
959
|
+
let { cid: n, searchType: r, searchText: i, partsType: a } = this.instance.router.routeData.search ?? {}, o = {
|
|
960
|
+
appSettings: (t = this.instance.store) == null ? void 0 : t.options.appSettings,
|
|
961
|
+
variants: this.searchVariants(),
|
|
962
|
+
search: {
|
|
963
|
+
cid: n,
|
|
964
|
+
searchType: r,
|
|
965
|
+
searchText: i,
|
|
966
|
+
filter: e,
|
|
967
|
+
partType: a
|
|
968
|
+
}
|
|
969
|
+
}, c = JSON.stringify(o);
|
|
970
|
+
if (this._lastFilterLoad.key == c) return Promise.resolve({ totalCount: this._lastFilterLoad.count });
|
|
971
|
+
let l;
|
|
972
|
+
if (this.instance.store.options.httpInterceptor) try {
|
|
973
|
+
l = await this.instance.store.options.httpInterceptor({
|
|
974
|
+
body: o,
|
|
975
|
+
url: qt.count,
|
|
976
|
+
method: "post"
|
|
977
|
+
});
|
|
978
|
+
} catch {}
|
|
979
|
+
try {
|
|
980
|
+
let e = l ?? await ne({
|
|
981
|
+
...s(),
|
|
982
|
+
countQuery: o
|
|
983
|
+
}, { client: this.client });
|
|
984
|
+
return this._lastFilterLoad.key = c, this._lastFilterLoad.count = e.totalCount, e;
|
|
985
|
+
} catch {
|
|
986
|
+
return Promise.resolve({ totalCount: 0 });
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
async loadFavoriteViews(e) {
|
|
990
|
+
try {
|
|
991
|
+
var t;
|
|
992
|
+
let n = await ce({
|
|
993
|
+
...s(),
|
|
994
|
+
favoriteViewsQuery: {
|
|
995
|
+
appSettings: (t = this.instance.store) == null ? void 0 : t.options.appSettings,
|
|
996
|
+
search: { ids: e }
|
|
997
|
+
}
|
|
998
|
+
}, { client: this.client }), r = n.items ? n.items : [];
|
|
999
|
+
return this.storeService.setData(Q.FavoriteViews, { items: r }), r;
|
|
1000
|
+
} catch (e) {
|
|
1001
|
+
return this.instance.logger.log("Failed to fetch favorite views", e), [];
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
1004
|
+
async saveFavoriteView(e, t, n) {
|
|
1005
|
+
try {
|
|
1006
|
+
var r, i, a, o, c, l, u, d, f, m, h;
|
|
1007
|
+
let v = {
|
|
1008
|
+
code: t,
|
|
1009
|
+
data: {
|
|
1010
|
+
treeType: A.PRODUCTS,
|
|
1011
|
+
pager: {
|
|
1012
|
+
page: (n == null || (r = n.search) == null || (r = r.pagination) == null ? void 0 : r.page) ?? 1,
|
|
1013
|
+
pageSize: (n == null || (i = n.search) == null || (i = i.pagination) == null ? void 0 : i.pageSize) ?? 12
|
|
1014
|
+
},
|
|
1015
|
+
search: {
|
|
1016
|
+
cid: (a = n.search) == null ? void 0 : a.cid,
|
|
1017
|
+
partType: (o = n.search) == null ? void 0 : o.partsType,
|
|
1018
|
+
searchType: (c = n.search) == null ? void 0 : c.searchType,
|
|
1019
|
+
searchText: ((l = n.search) == null ? void 0 : l.searchText) ?? void 0,
|
|
1020
|
+
filter: (u = n.search) == null ? void 0 : u.filters,
|
|
1021
|
+
masterProductId: ((d = n.search) == null ? void 0 : d.masterProductId) ?? void 0
|
|
1022
|
+
},
|
|
1023
|
+
sort: {
|
|
1024
|
+
field: ((f = n.search) == null ? void 0 : f.sortField) ?? le.PRODUCT,
|
|
1025
|
+
direction: ((m = n.search) == null ? void 0 : m.sortDirection) ?? E.ASCENDING
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
}, y = (h = this.instance.store) == null ? void 0 : h.options.appSettings, b = e ? await Me({
|
|
1029
|
+
...s(),
|
|
1030
|
+
id: e,
|
|
1031
|
+
favoriteViewUpdateAction: {
|
|
1032
|
+
appSettings: y,
|
|
1033
|
+
favoriteView: v
|
|
1034
|
+
}
|
|
1035
|
+
}, { client: this.client }) : await p({
|
|
1036
|
+
...s(),
|
|
1037
|
+
favoriteViewCreateAction: {
|
|
1038
|
+
appSettings: y,
|
|
1039
|
+
favoriteView: v
|
|
1040
|
+
}
|
|
1041
|
+
}, { client: this.client });
|
|
1042
|
+
if (b.id) {
|
|
1043
|
+
var g;
|
|
1044
|
+
let e = (((g = this.instance.store) == null || (g = g.data.favoriteViews) == null ? void 0 : g.items) || []).find((e) => e.id === b.id);
|
|
1045
|
+
if (e) Object.assign(e, b);
|
|
1046
|
+
else {
|
|
1047
|
+
var _;
|
|
1048
|
+
this.storeService.setData(Q.FavoriteViews, { items: [...((_ = this.instance.store) == null || (_ = _.data.favoriteViews) == null ? void 0 : _.items) || [], b] });
|
|
1049
|
+
}
|
|
1050
|
+
return b;
|
|
1051
|
+
}
|
|
1052
|
+
} catch (e) {
|
|
1053
|
+
this.instance.logger.log("Failed to fetch favorite views", e);
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
async deleteFavoriteView(t) {
|
|
1057
|
+
try {
|
|
1058
|
+
var n;
|
|
1059
|
+
if (await e({
|
|
1060
|
+
...s(),
|
|
1061
|
+
id: t,
|
|
1062
|
+
favoriteViewDeleteAction: { appSettings: (n = this.instance.store) == null ? void 0 : n.options.appSettings }
|
|
1063
|
+
}, { client: this.client })) {
|
|
1064
|
+
var r;
|
|
1065
|
+
return this.storeService.setData(Q.FavoriteViews, { items: (((r = this.instance.store) == null || (r = r.data.favoriteViews) == null ? void 0 : r.items) ?? []).filter((e) => e.id !== t) }), t;
|
|
1066
|
+
}
|
|
1067
|
+
} catch (e) {
|
|
1068
|
+
this.instance.logger.log("Failed to delete favorite view", e);
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
async generatePDFUrl(e) {
|
|
1072
|
+
this.instance.store.data.isLoadingData = !0;
|
|
1073
|
+
try {
|
|
1074
|
+
var t;
|
|
1075
|
+
let n = await me({
|
|
1076
|
+
...s(),
|
|
1077
|
+
pdfQuery: {
|
|
1078
|
+
search: { productId: e },
|
|
1079
|
+
appSettings: (t = this.instance.store) == null ? void 0 : t.options.appSettings
|
|
1080
|
+
}
|
|
1081
|
+
}, { client: this.client });
|
|
1082
|
+
if (n && n.guid) return this.instance.store.data.isLoadingData = !1, `${this.instance.getOptions().baseUrl}/v2/Products/Pdf/Downloads/${encodeURIComponent(n.guid)}`;
|
|
1083
|
+
} catch (e) {
|
|
1084
|
+
this.instance.logger.log("Failed to print product to pdf", e);
|
|
1085
|
+
}
|
|
1086
|
+
this.instance.store.data.isLoadingData = !1;
|
|
1087
|
+
}
|
|
1088
|
+
async getCatalogOptions() {
|
|
1089
|
+
return h(s(), { client: this.client });
|
|
1090
|
+
}
|
|
1091
|
+
async getAllCatalogs() {
|
|
1092
|
+
var e, t;
|
|
1093
|
+
return b({
|
|
1094
|
+
...s(),
|
|
1095
|
+
catalogSearchQuery: {
|
|
1096
|
+
appSettings: {
|
|
1097
|
+
appCode: (e = this.instance.store) == null || (e = e.options.appSettings) == null ? void 0 : e.appCode,
|
|
1098
|
+
langCode: (t = this.instance.store) == null || (t = t.options.appSettings) == null ? void 0 : t.langCode
|
|
1099
|
+
},
|
|
1100
|
+
pager: {
|
|
1101
|
+
page: 1,
|
|
1102
|
+
pageSize: 1e3
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
}, { client: this.client });
|
|
1106
|
+
}
|
|
1107
|
+
async addCatalog(e, t, n) {
|
|
1108
|
+
return ge({
|
|
1109
|
+
...s(),
|
|
1110
|
+
catalogCreateAction: {
|
|
1111
|
+
code: e,
|
|
1112
|
+
type: t,
|
|
1113
|
+
description: n
|
|
1114
|
+
}
|
|
1115
|
+
}, { client: this.client });
|
|
1116
|
+
}
|
|
1117
|
+
async addProductToCatalog(e, t) {
|
|
1118
|
+
var n, r;
|
|
1119
|
+
return y({
|
|
1120
|
+
...s(),
|
|
1121
|
+
catalogId: e,
|
|
1122
|
+
catalogProductAddAction: {
|
|
1123
|
+
appSettings: {
|
|
1124
|
+
appCode: (n = this.instance.store) == null || (n = n.options.appSettings) == null ? void 0 : n.appCode,
|
|
1125
|
+
langCode: (r = this.instance.store) == null || (r = r.options.appSettings) == null ? void 0 : r.langCode
|
|
1126
|
+
},
|
|
1127
|
+
products: t
|
|
1128
|
+
}
|
|
1129
|
+
}, { client: this.client });
|
|
1130
|
+
}
|
|
1131
|
+
}, Qt = 50, $t = class {
|
|
1132
|
+
constructor(e) {
|
|
1133
|
+
M(this, "instance", void 0), M(this, "routeData", Ot(O(Qe))), M(this, "history", []), this.instance = e;
|
|
1134
|
+
}
|
|
1135
|
+
async setRoute(e, t = !1) {
|
|
1136
|
+
let n = O(this.routeData);
|
|
1137
|
+
if (e) {
|
|
1138
|
+
var r;
|
|
1139
|
+
if ((r = e.search) != null && r.pagination) {
|
|
1140
|
+
var i;
|
|
1141
|
+
rt(e.search.pagination, (i = this.routeData) == null || (i = i.search) == null ? void 0 : i.pagination);
|
|
1142
|
+
}
|
|
1143
|
+
w(n, e), l(n, Qe);
|
|
1144
|
+
}
|
|
1145
|
+
if (this.history.length > 0 && de(n, O(this.routeData))) return;
|
|
1146
|
+
let a = !1;
|
|
1147
|
+
if (!t && this.history.length > 1 && n.view == "search") {
|
|
1148
|
+
let e = this.history[this.history.length - 1];
|
|
1149
|
+
a = de(e, n, (e) => e === "subView");
|
|
1150
|
+
}
|
|
1151
|
+
if (a) {
|
|
1152
|
+
this.commitRoute(n);
|
|
1153
|
+
return;
|
|
1154
|
+
}
|
|
1155
|
+
let o = !1;
|
|
1156
|
+
if (!t && this.history.length > 1 && n.view == "search") {
|
|
1157
|
+
let e = this.history[this.history.length - 1];
|
|
1158
|
+
o = de(e, n, (e) => e === "page" || e === "pageSize");
|
|
1159
|
+
}
|
|
1160
|
+
let s = O(this.routeData);
|
|
1161
|
+
if (w(s, n), this.instance.props.nextRoute = s, this.instance.store.data.isInitialized && this.instance.httpService) {
|
|
1162
|
+
if (t) return this.commitRoute(n);
|
|
1163
|
+
if (o) return await this.instance.httpService.paginate(n), this.commitRoute(n);
|
|
1164
|
+
var c;
|
|
1165
|
+
return await ((c = this.instance.httpService) == null ? void 0 : c.load(n)), this.commitRoute(n);
|
|
1166
|
+
}
|
|
1167
|
+
return this.commitRoute(n);
|
|
1168
|
+
}
|
|
1169
|
+
commitRoute(e) {
|
|
1170
|
+
this.instance.props.nextRoute = null, this.history.push(O(e)), this.history.length > Qt && this.history.shift(), this.merge(e);
|
|
1171
|
+
let t = O(this.routeData);
|
|
1172
|
+
setTimeout(() => this.instance.eventBus.emit("route-changed", t), 10);
|
|
1173
|
+
}
|
|
1174
|
+
merge(e) {
|
|
1175
|
+
w(this.routeData, e);
|
|
1176
|
+
}
|
|
1177
|
+
async reload() {
|
|
1178
|
+
var e, t;
|
|
1179
|
+
(e = this.routeData) != null && (e = e.search) != null && e.pagination && (this.routeData.search.pagination.page = 1), await ((t = this.instance.httpService) == null ? void 0 : t.load(this.routeData));
|
|
1180
|
+
}
|
|
1181
|
+
async back(e = 1) {
|
|
1182
|
+
let t = this.history.length - e - 1, n = this.history[t];
|
|
1183
|
+
return n && this.history.splice(t), this.setRoute(n ?? Qe);
|
|
1184
|
+
}
|
|
1185
|
+
}, en = class {
|
|
1186
|
+
get lifetimeSignal() {
|
|
1187
|
+
return this.lifetimeController.signal;
|
|
1188
|
+
}
|
|
1189
|
+
constructor(e, t) {
|
|
1190
|
+
M(this, "id", void 0), M(this, "accessor", void 0), M(this, "helpers", void 0), M(this, "instanceType", "Products"), M(this, "props", {}), M(this, "lifetimeController", new AbortController()), M(this, "onReadyDisposers", []), M(this, "httpService", void 0), M(this, "store", Ot({
|
|
1191
|
+
notifications: [],
|
|
1192
|
+
data: {
|
|
1193
|
+
isInitialized: !1,
|
|
1194
|
+
actions: {
|
|
1195
|
+
data: null,
|
|
1196
|
+
current: null
|
|
1197
|
+
}
|
|
1198
|
+
},
|
|
1199
|
+
options: { isInitialized: !1 }
|
|
1200
|
+
})), M(this, "router", new $t(this)), M(this, "translations", new u(this)), M(this, "commandExecutor", new ct(this)), M(this, "logger", c), M(this, "registeredComponents", Ot(/* @__PURE__ */ new Set())), M(this, "dataTypesRequired", Ot(/* @__PURE__ */ new Set())), M(this, "eventBus", d()), M(this, "eventBusExt", _e(this.eventBus)), M(this, "selection", new ht(this)), this.id = e, this.accessor = t, this.helpers = Kt(this);
|
|
1201
|
+
}
|
|
1202
|
+
isInitialized() {
|
|
1203
|
+
return this.store.data.isInitialized;
|
|
1204
|
+
}
|
|
1205
|
+
async reload() {
|
|
1206
|
+
await this.translations.load(), await this.router.reload();
|
|
1207
|
+
}
|
|
1208
|
+
setRoute(e) {
|
|
1209
|
+
this.router.setRoute(e);
|
|
1210
|
+
}
|
|
1211
|
+
async init(e, t) {
|
|
1212
|
+
if (this.store.data.isInitialized) throw Error(`Instance "${this.id}" is already initialized`);
|
|
1213
|
+
_("products", e), i(e);
|
|
1214
|
+
let r = n(e == null ? void 0 : e.baseUrl), a = this.store.options.isInitialized ? this.store.options : new Gt();
|
|
1215
|
+
he(a, e), t && this.router.merge(t), this.store.options = a, this.store.options.isInitialized = !0, this.httpService = new Zt(this, r, a.accessToken), this.store.data.isInitialized = !0, this.router.setRoute(t);
|
|
1216
|
+
try {
|
|
1217
|
+
return await this.translations.load(), Promise.resolve();
|
|
1218
|
+
} catch (e) {
|
|
1219
|
+
this.store.data.isInitialized = !1;
|
|
1220
|
+
let t = Oe(a.errorInterceptor, {
|
|
1221
|
+
type: "InitError",
|
|
1222
|
+
message: "PIS initialization error.",
|
|
1223
|
+
isHandled: !1
|
|
1224
|
+
});
|
|
1225
|
+
return console.error("[PIS] initialization error", t, e), Promise.reject(Error("PIS initialization error", { cause: e }));
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1228
|
+
update(e, t) {
|
|
1229
|
+
_("products", e), i(e);
|
|
1230
|
+
let n = this.store.options.isInitialized ? this.store.options : new Gt();
|
|
1231
|
+
he(n, e), this.store.options = n, this.store.options.isInitialized = !0, t && this.router.setRoute(t);
|
|
1232
|
+
}
|
|
1233
|
+
on(e, t) {
|
|
1234
|
+
this.eventBusExt.on(e, t);
|
|
1235
|
+
}
|
|
1236
|
+
onReady(e) {
|
|
1237
|
+
let t = Nt(() => this.store.data.isInitialized, (n) => {
|
|
1238
|
+
n && (e(), t());
|
|
1239
|
+
});
|
|
1240
|
+
this.onReadyDisposers.push(t);
|
|
1241
|
+
}
|
|
1242
|
+
off(e, t) {
|
|
1243
|
+
e ? this.eventBusExt.off(e, t) : this.eventBusExt.all.clear();
|
|
1244
|
+
}
|
|
1245
|
+
registerComponent(e) {
|
|
1246
|
+
this.registeredComponents.add(e);
|
|
1247
|
+
}
|
|
1248
|
+
registerRequiredDataTypes(e) {
|
|
1249
|
+
e.forEach((e) => this.dataTypesRequired.add(e));
|
|
1250
|
+
}
|
|
1251
|
+
getRegisteredSearchDataTypes() {
|
|
1252
|
+
if (this.dataTypesRequired && this.dataTypesRequired.size) {
|
|
1253
|
+
var e, t;
|
|
1254
|
+
let n = Object.values(T), r = Array.from(this.dataTypesRequired).filter((e) => n.includes(e));
|
|
1255
|
+
return (e = this.store.options.components) != null && (e = e.search) != null && (e = e.common) != null && (e = e.configurators) != null && e.visible && r.push(T.CONFIGURATORS), ((t = this.store.options.appSettings) == null ? void 0 : t.treeType) == A.PARTS && r.push(T.MASTER_PRODUCTS), [...new Set(r)];
|
|
1256
|
+
}
|
|
1257
|
+
return [];
|
|
1258
|
+
}
|
|
1259
|
+
getRegisteredDetailsDataTypes() {
|
|
1260
|
+
if (this.dataTypesRequired && this.dataTypesRequired.size) {
|
|
1261
|
+
var e, t, n, r;
|
|
1262
|
+
let i = Object.values(k), a = Array.from(this.dataTypesRequired).filter((e) => i.includes(e));
|
|
1263
|
+
return a.push(k.EXTENDED_OBJECT_DATA), (e = this.store.options.components) != null && (e = e.details) != null && (e = e.variantsSelector) != null && e.visible && a.push(k.PRODUCT_VARIANTS_SELECTOR), (t = this.store.options.components) != null && (t = t.details) != null && (t = t.variantsDropdown) != null && t.visible && a.push(k.PRODUCT_VARIANTS_DROPDOWN), (n = this.store.options.components) != null && (n = n.details) != null && (n = n.variantsTable) != null && n.visible && a.push(k.PRODUCT_VARIANTS_TABLE), (r = this.store.options.components) != null && (r = r.details) != null && (r = r.relatedLinks) != null && r.visible && a.push(k.RELATED_LINKS), [...new Set(a)];
|
|
1264
|
+
}
|
|
1265
|
+
return [];
|
|
1266
|
+
}
|
|
1267
|
+
teardown() {
|
|
1268
|
+
this.lifetimeController.abort();
|
|
1269
|
+
for (let e of this.onReadyDisposers) e();
|
|
1270
|
+
this.onReadyDisposers.length = 0;
|
|
1271
|
+
}
|
|
1272
|
+
destroy() {
|
|
1273
|
+
return this.teardown(), this.accessor.destroyInstance(this.id);
|
|
1274
|
+
}
|
|
1275
|
+
execute(e, t) {
|
|
1276
|
+
return this.commandExecutor.execute(e, t);
|
|
1277
|
+
}
|
|
1278
|
+
executeCommand(e, ...t) {
|
|
1279
|
+
return this.commandExecutor.executeCommand(e, ...t);
|
|
1280
|
+
}
|
|
1281
|
+
trackUserAction(e) {
|
|
1282
|
+
Ie(this, e);
|
|
1283
|
+
}
|
|
1284
|
+
getDefaultOptions() {
|
|
1285
|
+
return t(new Gt());
|
|
1286
|
+
}
|
|
1287
|
+
getDefaultRouteData() {
|
|
1288
|
+
return O(Qe);
|
|
1289
|
+
}
|
|
1290
|
+
getOptions() {
|
|
1291
|
+
return this.store.options;
|
|
1292
|
+
}
|
|
1293
|
+
getRouteData() {
|
|
1294
|
+
return this.props.nextRoute ? this.props.nextRoute : O(this.router.routeData);
|
|
1295
|
+
}
|
|
1296
|
+
}, tn = class {
|
|
1297
|
+
constructor() {
|
|
1298
|
+
M(this, "instances", Ot(/* @__PURE__ */ new Map()));
|
|
1299
|
+
}
|
|
1300
|
+
destroyInstance(e) {
|
|
1301
|
+
try {
|
|
1302
|
+
let t = this.instances.get(e);
|
|
1303
|
+
t == null || t.teardown(), t == null || t.off();
|
|
1304
|
+
} catch {}
|
|
1305
|
+
this.instances.delete(e);
|
|
1306
|
+
}
|
|
1307
|
+
getInstance(e) {
|
|
1308
|
+
let t = this.instances.size;
|
|
1309
|
+
if (e !== void 0) {
|
|
1310
|
+
if (this.instances.has(e)) return this.instances.get(e);
|
|
1311
|
+
{
|
|
1312
|
+
let t = new en(e, this);
|
|
1313
|
+
return this.instances.set(e, t), t;
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
if (t === 1) return this.instances.values().next().value;
|
|
1317
|
+
if (t > 1) throw Error("[PIS Products] Cannot pick default instance if more than one exists");
|
|
1318
|
+
}
|
|
1319
|
+
setAccessTokenInAllInstances(e) {
|
|
1320
|
+
this.instances.forEach((t) => {
|
|
1321
|
+
t.getOptions().accessToken = e;
|
|
1322
|
+
});
|
|
1323
|
+
}
|
|
1324
|
+
}, nn = Be({
|
|
1325
|
+
getInstance: (e) => St.Products.getInstance(e),
|
|
1326
|
+
instanceTag: "pis-products-instance",
|
|
1327
|
+
isReadyIncludesOptions: !0,
|
|
1328
|
+
filtersCommands: {
|
|
1329
|
+
getFilters: () => new Ye(),
|
|
1330
|
+
getFilterValues: (e) => new xt({ attributeCodes: e }),
|
|
1331
|
+
applyFilters: (e) => new st({ filters: e }),
|
|
1332
|
+
excludeFilter: (e, t) => new bt({
|
|
1333
|
+
attributeCode: e,
|
|
1334
|
+
value: t
|
|
1335
|
+
})
|
|
1336
|
+
}
|
|
1337
|
+
});
|
|
1338
|
+
function $(e, t, n) {
|
|
1339
|
+
return nn(e, t, n);
|
|
1340
|
+
}
|
|
1341
|
+
//#endregion
|
|
1342
|
+
//#region src/products/composables/routeData.ts
|
|
1343
|
+
var rn = {}, an = (e) => {
|
|
1344
|
+
let t = e.id;
|
|
1345
|
+
if (!rn[t]) {
|
|
1346
|
+
let n = P(() => [...e.router.history ?? []].reverse()), r = P(() => n.value.findIndex(({ view: e }) => e === "search"));
|
|
1347
|
+
rn[t] = {
|
|
1348
|
+
historyReversed: n,
|
|
1349
|
+
lastSearchIndex: r,
|
|
1350
|
+
previousProductName: P(() => {
|
|
1351
|
+
if (r.value > 1) {
|
|
1352
|
+
var t, i;
|
|
1353
|
+
let r = (t = e.router.routeData.detail) == null ? void 0 : t.productId, o = (i = n.value.find((e) => {
|
|
1354
|
+
var t;
|
|
1355
|
+
return !(e.view !== "detail" || r && ((t = e.detail) == null ? void 0 : t.productId) === r);
|
|
1356
|
+
})) == null || (i = i.detail) == null ? void 0 : i.productId;
|
|
1357
|
+
if (o) {
|
|
1358
|
+
var a;
|
|
1359
|
+
return (((a = e.store) == null ? void 0 : a.data.productIdToDisplayName) || {})[o];
|
|
1360
|
+
}
|
|
1361
|
+
}
|
|
1362
|
+
})
|
|
1363
|
+
};
|
|
1364
|
+
}
|
|
1365
|
+
return rn[t];
|
|
1366
|
+
}, on = V({
|
|
1367
|
+
components: {
|
|
1368
|
+
Btn: ve,
|
|
1369
|
+
Tooltip: Ce,
|
|
1370
|
+
Icon: D
|
|
1371
|
+
},
|
|
1372
|
+
props: {
|
|
1373
|
+
instance: {
|
|
1374
|
+
type: Object,
|
|
1375
|
+
required: !0
|
|
1376
|
+
},
|
|
1377
|
+
t: {
|
|
1378
|
+
type: Function,
|
|
1379
|
+
required: !0
|
|
1380
|
+
}
|
|
1381
|
+
},
|
|
1382
|
+
setup(e) {
|
|
1383
|
+
let { lastSearchIndex: t, previousProductName: n } = an(e.instance);
|
|
1384
|
+
return {
|
|
1385
|
+
allowBack: P(() => {
|
|
1386
|
+
var t;
|
|
1387
|
+
return ((t = e.instance) == null || (t = t.store) == null ? void 0 : t.data.itemNotFound) !== !0;
|
|
1388
|
+
}),
|
|
1389
|
+
lastSearchIndex: t,
|
|
1390
|
+
previousProductName: n,
|
|
1391
|
+
navigateBack: async () => {
|
|
1392
|
+
try {
|
|
1393
|
+
var t;
|
|
1394
|
+
await ((t = e.instance) == null ? void 0 : t.execute(new vt().from("navigation-btns")));
|
|
1395
|
+
} catch {}
|
|
1396
|
+
},
|
|
1397
|
+
navigateToSearch: async () => {
|
|
1398
|
+
try {
|
|
1399
|
+
if (t.value > 0) {
|
|
1400
|
+
var n;
|
|
1401
|
+
await ((n = e.instance) == null ? void 0 : n.execute(new vt({ step: t.value }).from("navigation-btns")));
|
|
1402
|
+
} else {
|
|
1403
|
+
var r;
|
|
1404
|
+
await ((r = e.instance) == null ? void 0 : r.execute(new Xe().from("navigation-btns")));
|
|
1405
|
+
}
|
|
1406
|
+
} catch {}
|
|
1407
|
+
}
|
|
1408
|
+
};
|
|
1409
|
+
}
|
|
1410
|
+
}), sn = { class: "d-flex flex-wrap gap-3" }, cn = { class: "text-nowrap pis-text-ellipsis" }, ln = { class: "text-nowrap text-truncate" };
|
|
1411
|
+
function un(e, t, n, r, i, a) {
|
|
1412
|
+
let o = q("Icon"), s = q("Btn"), c = q("Tooltip");
|
|
1413
|
+
return U(), L("div", sn, [e.allowBack ? (U(), F(s, {
|
|
1414
|
+
key: 0,
|
|
1415
|
+
class: "pis-mw-10-rem ext-back",
|
|
1416
|
+
variant: "secondary",
|
|
1417
|
+
onClick: Z(e.navigateToSearch, ["prevent"])
|
|
1418
|
+
}, {
|
|
1419
|
+
default: Y(() => [B(o, {
|
|
1420
|
+
name: "arrow-left",
|
|
1421
|
+
size: 16,
|
|
1422
|
+
class: "me-2"
|
|
1423
|
+
}), R("span", cn, J(e.t("BackToSearch", !0)), 1)]),
|
|
1424
|
+
_: 1
|
|
1425
|
+
}, 8, ["onClick"])) : I("", !0), e.lastSearchIndex > 1 && e.previousProductName ? (U(), F(c, {
|
|
1426
|
+
key: 1,
|
|
1427
|
+
text: e.previousProductName,
|
|
1428
|
+
placement: "bottom",
|
|
1429
|
+
trigger: "hover focus"
|
|
1430
|
+
}, {
|
|
1431
|
+
default: Y(() => [B(s, {
|
|
1432
|
+
class: "mw-100 d-block ext-prod-back",
|
|
1433
|
+
variant: "secondary",
|
|
1434
|
+
onClick: Z(e.navigateBack, ["prevent"])
|
|
1435
|
+
}, {
|
|
1436
|
+
default: Y(() => [B(o, {
|
|
1437
|
+
name: "arrow-left",
|
|
1438
|
+
size: 16,
|
|
1439
|
+
class: "me-2"
|
|
1440
|
+
}), R("span", ln, J(e.previousProductName ?? e.t("PreviousProduct", !0)), 1)]),
|
|
1441
|
+
_: 1
|
|
1442
|
+
}, 8, ["onClick"])]),
|
|
1443
|
+
_: 1
|
|
1444
|
+
}, 8, ["text"])) : I("", !0)]);
|
|
1445
|
+
}
|
|
1446
|
+
var dn = /*#__PURE__*/ j(on, [["render", un]]), fn = V({
|
|
1447
|
+
name: "PisReplacements",
|
|
1448
|
+
components: {
|
|
1449
|
+
PisLink: ft,
|
|
1450
|
+
Icon: D
|
|
1451
|
+
},
|
|
1452
|
+
props: {
|
|
1453
|
+
replacements: {
|
|
1454
|
+
type: Object,
|
|
1455
|
+
required: !0
|
|
1456
|
+
},
|
|
1457
|
+
instance: {
|
|
1458
|
+
type: Object,
|
|
1459
|
+
required: !0
|
|
1460
|
+
},
|
|
1461
|
+
showIcon: Boolean,
|
|
1462
|
+
isDetailView: Boolean,
|
|
1463
|
+
visible: Boolean
|
|
1464
|
+
},
|
|
1465
|
+
setup(e) {
|
|
1466
|
+
let t = async (t, n) => {
|
|
1467
|
+
if (e.isDetailView) {
|
|
1468
|
+
let e = "#pis-anchor-attr-TechnicalInformation", t = n == null ? void 0 : n.getRootNode(), r = (t && "querySelector" in t ? t.querySelector(e) : null) ?? document.querySelector(e);
|
|
1469
|
+
r && r.scrollIntoView({ behavior: "smooth" });
|
|
1470
|
+
} else try {
|
|
1471
|
+
var r;
|
|
1472
|
+
await ((r = e.instance) == null ? void 0 : r.execute(new tt({ productId: t }).from("pis-replacements")));
|
|
1473
|
+
} catch {}
|
|
1474
|
+
};
|
|
1475
|
+
return {
|
|
1476
|
+
LinkTypeEnum: ie,
|
|
1477
|
+
renderLink: (e) => {
|
|
1478
|
+
var n;
|
|
1479
|
+
let r = (n = e.link) == null ? void 0 : n.text;
|
|
1480
|
+
if (!r) return wt("span", e.label ?? "");
|
|
1481
|
+
let i = /{([^}]+)}/, a = [], o = r, s;
|
|
1482
|
+
for (; (s = i.exec(o)) !== null;) {
|
|
1483
|
+
let e = o.slice(0, s.index);
|
|
1484
|
+
e && a.push(e);
|
|
1485
|
+
let n = s[1].split("|"), r = n[0], i = n[1] ?? r;
|
|
1486
|
+
a.push(wt("a", {
|
|
1487
|
+
href: "#",
|
|
1488
|
+
role: "button",
|
|
1489
|
+
onClick: (e) => {
|
|
1490
|
+
e.preventDefault(), t(r, e.currentTarget);
|
|
1491
|
+
},
|
|
1492
|
+
onKeydown: (e) => {
|
|
1493
|
+
e.key === " " && (e.preventDefault(), t(r, e.currentTarget));
|
|
1494
|
+
}
|
|
1495
|
+
}, i)), o = o.slice(s.index + s[0].length);
|
|
1496
|
+
}
|
|
1497
|
+
return o && a.push(o), a.length === 0 ? wt("span", e.label ?? "") : wt("span", a);
|
|
1498
|
+
},
|
|
1499
|
+
navigate: t
|
|
1500
|
+
};
|
|
1501
|
+
}
|
|
1502
|
+
}), pn = {
|
|
1503
|
+
key: 0,
|
|
1504
|
+
class: "pis-replacements"
|
|
1505
|
+
}, mn = {
|
|
1506
|
+
key: 1,
|
|
1507
|
+
class: "fw-bold"
|
|
1508
|
+
}, hn = { class: "fw-bold" }, gn = { class: "fw-bold text-nowrap" };
|
|
1509
|
+
function _n(e, t, n, r, i, a) {
|
|
1510
|
+
let o = q("icon"), s = q("PisLink");
|
|
1511
|
+
return e.replacements && e.replacements.length && e.visible ? (U(), L("div", pn, [(U(!0), L(N, null, G(e.replacements, (n, r) => (U(), L("div", {
|
|
1512
|
+
key: r,
|
|
1513
|
+
class: H({ "d-flex": e.showIcon })
|
|
1514
|
+
}, [e.showIcon ? (U(), F(o, {
|
|
1515
|
+
key: 0,
|
|
1516
|
+
class: "text-muted me-2",
|
|
1517
|
+
name: "information-circle",
|
|
1518
|
+
lg: ""
|
|
1519
|
+
})) : I("", !0), n.link && n.link.type === e.LinkTypeEnum.TECHNICAL_INFORMATION ? (U(), L("span", mn, [(U(), F(At(e.renderLink(n))))])) : (U(), L(N, { key: 2 }, [
|
|
1520
|
+
R("span", hn, J(n.label), 1),
|
|
1521
|
+
t[0] || (t[0] = z("\xA0 ", -1)),
|
|
1522
|
+
n.link ? (U(), F(s, {
|
|
1523
|
+
key: 0,
|
|
1524
|
+
instance: e.instance,
|
|
1525
|
+
link: n.link,
|
|
1526
|
+
"clear-search": !0
|
|
1527
|
+
}, {
|
|
1528
|
+
default: Y(() => [R("span", gn, J(n.link.text), 1)]),
|
|
1529
|
+
_: 2
|
|
1530
|
+
}, 1032, ["instance", "link"])) : I("", !0)
|
|
1531
|
+
], 64))], 2))), 128))])) : I("", !0);
|
|
1532
|
+
}
|
|
1533
|
+
var vn = /*#__PURE__*/ j(fn, [["render", _n]]), yn = V({
|
|
1534
|
+
components: { FiltersNavigatorModalBase: He },
|
|
1535
|
+
inheritAttrs: !1,
|
|
1536
|
+
props: {
|
|
1537
|
+
show: Boolean,
|
|
1538
|
+
title: {
|
|
1539
|
+
type: String,
|
|
1540
|
+
required: !0
|
|
1541
|
+
},
|
|
1542
|
+
isMobile: Boolean,
|
|
1543
|
+
t: {
|
|
1544
|
+
type: Function,
|
|
1545
|
+
required: !0
|
|
1546
|
+
},
|
|
1547
|
+
filtersAll: {
|
|
1548
|
+
type: Array,
|
|
1549
|
+
default: void 0
|
|
1550
|
+
},
|
|
1551
|
+
filtersPromoted: {
|
|
1552
|
+
type: Array,
|
|
1553
|
+
default: void 0
|
|
1554
|
+
},
|
|
1555
|
+
filtersAdditional: {
|
|
1556
|
+
type: Array,
|
|
1557
|
+
default: void 0
|
|
1558
|
+
},
|
|
1559
|
+
filtersFetched: Map,
|
|
1560
|
+
filtersModel: {
|
|
1561
|
+
type: Object,
|
|
1562
|
+
default: void 0
|
|
1563
|
+
},
|
|
1564
|
+
filteredResultCount: {
|
|
1565
|
+
type: Number,
|
|
1566
|
+
default: void 0
|
|
1567
|
+
},
|
|
1568
|
+
filteredResultCountLoading: Boolean,
|
|
1569
|
+
fetchFilterValues: {
|
|
1570
|
+
type: Function,
|
|
1571
|
+
required: !0
|
|
1572
|
+
},
|
|
1573
|
+
clearFiltersModelFromEmptyValues: {
|
|
1574
|
+
type: Function,
|
|
1575
|
+
default: void 0
|
|
1576
|
+
}
|
|
1577
|
+
}
|
|
1578
|
+
});
|
|
1579
|
+
//#endregion
|
|
1580
|
+
//#region src/products/components/common/FiltersNavigatorModal.vue
|
|
1581
|
+
function bn(e, t, n, r, i, a) {
|
|
1582
|
+
let o = q("FiltersNavigatorModalBase");
|
|
1583
|
+
return U(), F(o, Tt(e.$attrs, {
|
|
1584
|
+
show: e.show,
|
|
1585
|
+
title: e.title,
|
|
1586
|
+
"is-mobile": e.isMobile,
|
|
1587
|
+
t: e.t,
|
|
1588
|
+
"filters-all": e.filtersAll,
|
|
1589
|
+
"filters-promoted": e.filtersPromoted,
|
|
1590
|
+
"filters-additional": e.filtersAdditional,
|
|
1591
|
+
"filters-fetched": e.filtersFetched,
|
|
1592
|
+
"filters-model": e.filtersModel,
|
|
1593
|
+
"filtered-result-count": e.filteredResultCount,
|
|
1594
|
+
"filtered-result-count-loading": e.filteredResultCountLoading,
|
|
1595
|
+
"fetch-filter-values": e.fetchFilterValues,
|
|
1596
|
+
"clear-filters-model-from-empty-values": e.clearFiltersModelFromEmptyValues,
|
|
1597
|
+
"reset-filter-on-open": ""
|
|
1598
|
+
}), null, 16, [
|
|
1599
|
+
"show",
|
|
1600
|
+
"title",
|
|
1601
|
+
"is-mobile",
|
|
1602
|
+
"t",
|
|
1603
|
+
"filters-all",
|
|
1604
|
+
"filters-promoted",
|
|
1605
|
+
"filters-additional",
|
|
1606
|
+
"filters-fetched",
|
|
1607
|
+
"filters-model",
|
|
1608
|
+
"filtered-result-count",
|
|
1609
|
+
"filtered-result-count-loading",
|
|
1610
|
+
"fetch-filter-values",
|
|
1611
|
+
"clear-filters-model-from-empty-values"
|
|
1612
|
+
]);
|
|
1613
|
+
}
|
|
1614
|
+
var xn = /*#__PURE__*/ j(yn, [["render", bn]]), Sn = V({
|
|
1615
|
+
name: "PrmListSearchForm",
|
|
1616
|
+
components: {
|
|
1617
|
+
FormInputClearable: pe,
|
|
1618
|
+
Dropdown: Ae,
|
|
1619
|
+
Btn: ve,
|
|
1620
|
+
Clickable: C,
|
|
1621
|
+
Spinner: Ne,
|
|
1622
|
+
Highlighter: oe
|
|
1623
|
+
},
|
|
1624
|
+
props: {
|
|
1625
|
+
instance: {
|
|
1626
|
+
type: Object,
|
|
1627
|
+
required: !0
|
|
1628
|
+
},
|
|
1629
|
+
productId: {
|
|
1630
|
+
type: String,
|
|
1631
|
+
required: !0
|
|
1632
|
+
},
|
|
1633
|
+
relationshipType: {
|
|
1634
|
+
type: String,
|
|
1635
|
+
required: !0
|
|
1636
|
+
},
|
|
1637
|
+
relationshipCode: {
|
|
1638
|
+
type: String,
|
|
1639
|
+
required: !1,
|
|
1640
|
+
default: void 0
|
|
1641
|
+
},
|
|
1642
|
+
filterCriteria: {
|
|
1643
|
+
type: Object,
|
|
1644
|
+
required: !0
|
|
1645
|
+
},
|
|
1646
|
+
t: {
|
|
1647
|
+
type: Function,
|
|
1648
|
+
required: !0
|
|
1649
|
+
},
|
|
1650
|
+
modelValue: {
|
|
1651
|
+
type: String,
|
|
1652
|
+
default: ""
|
|
1653
|
+
}
|
|
1654
|
+
},
|
|
1655
|
+
emits: [
|
|
1656
|
+
"update:modelValue",
|
|
1657
|
+
"search",
|
|
1658
|
+
"clear"
|
|
1659
|
+
],
|
|
1660
|
+
setup(e, { emit: t }) {
|
|
1661
|
+
let n = W(e.modelValue), r = W(!1), i = W(!1), a = W({
|
|
1662
|
+
totalCount: 0,
|
|
1663
|
+
itemsCount: 0,
|
|
1664
|
+
items: []
|
|
1665
|
+
}), o = (e, t) => {
|
|
1666
|
+
if (e.attributes) {
|
|
1667
|
+
let n = e.attributes[t];
|
|
1668
|
+
if (n && n.values) return n.values[0].text;
|
|
1669
|
+
}
|
|
1670
|
+
}, s = (e) => {
|
|
1671
|
+
if (e.attributes) {
|
|
1672
|
+
let t = e.attributes["#AllIdentifiers"];
|
|
1673
|
+
if (t && t.values) return t.values.map((e) => e.text).join(", ");
|
|
1674
|
+
}
|
|
1675
|
+
}, c = Re(async (t) => {
|
|
1676
|
+
let n = t != null && t.length > 2;
|
|
1677
|
+
if (r.value = n, n) {
|
|
1678
|
+
i.value = !0;
|
|
1679
|
+
try {
|
|
1680
|
+
var c;
|
|
1681
|
+
let n = new We({
|
|
1682
|
+
search: {
|
|
1683
|
+
productId: e.productId,
|
|
1684
|
+
searchText: t,
|
|
1685
|
+
relationshipType: e.relationshipType,
|
|
1686
|
+
relationshipCode: e.relationshipCode,
|
|
1687
|
+
filter: e.filterCriteria
|
|
1688
|
+
},
|
|
1689
|
+
pager: {
|
|
1690
|
+
page: 1,
|
|
1691
|
+
pageSize: 5
|
|
1692
|
+
}
|
|
1693
|
+
}), r = await ((c = e.instance) == null ? void 0 : c.execute(n));
|
|
1694
|
+
if (r) {
|
|
1695
|
+
var l;
|
|
1696
|
+
let e = (r.items || []).map((e) => ({
|
|
1697
|
+
text: o(e, "#DisplayName") || e.productId || "",
|
|
1698
|
+
secondaryText: s(e) || "",
|
|
1699
|
+
description: o(e, "CatalogDescription") || ""
|
|
1700
|
+
}));
|
|
1701
|
+
a.value = {
|
|
1702
|
+
totalCount: r.totalCount || 0,
|
|
1703
|
+
itemsCount: ((l = r.items) == null ? void 0 : l.length) || 0,
|
|
1704
|
+
items: e
|
|
1705
|
+
};
|
|
1706
|
+
} else a.value = {
|
|
1707
|
+
totalCount: 0,
|
|
1708
|
+
itemsCount: 0,
|
|
1709
|
+
items: []
|
|
1710
|
+
};
|
|
1711
|
+
} catch {}
|
|
1712
|
+
i.value = !1;
|
|
1713
|
+
} else a.value = {
|
|
1714
|
+
totalCount: 0,
|
|
1715
|
+
itemsCount: 0,
|
|
1716
|
+
items: []
|
|
1717
|
+
};
|
|
1718
|
+
}, 300), l = Re(() => {
|
|
1719
|
+
t("update:modelValue", n.value), c(n.value), n.value || t("search", "");
|
|
1720
|
+
}, 300);
|
|
1721
|
+
return {
|
|
1722
|
+
searchText: n,
|
|
1723
|
+
isAutocompleteVisible: r,
|
|
1724
|
+
isAutocompleteLoading: i,
|
|
1725
|
+
autocomplete: a,
|
|
1726
|
+
highlightTerms: P(() => {
|
|
1727
|
+
if (!n.value) return [];
|
|
1728
|
+
let e = n.value.trim().toLowerCase().split(/[._-\s/]+/);
|
|
1729
|
+
return e.push(n.value.trim()), e;
|
|
1730
|
+
}),
|
|
1731
|
+
onSearchInput: l,
|
|
1732
|
+
onEnter: () => {
|
|
1733
|
+
r.value = !1, t("update:modelValue", n.value), t("search", n.value);
|
|
1734
|
+
},
|
|
1735
|
+
onClear: () => {
|
|
1736
|
+
n.value = "", a.value = {
|
|
1737
|
+
totalCount: 0,
|
|
1738
|
+
itemsCount: 0,
|
|
1739
|
+
items: []
|
|
1740
|
+
}, t("update:modelValue", ""), t("clear");
|
|
1741
|
+
},
|
|
1742
|
+
selectItem: (e) => {
|
|
1743
|
+
n.value = e, r.value = !1, t("update:modelValue", e), t("search", e);
|
|
1744
|
+
},
|
|
1745
|
+
openAutocomplete: () => {
|
|
1746
|
+
n.value && n.value.length > 2 && (r.value = !0, c(n.value));
|
|
1747
|
+
}
|
|
1748
|
+
};
|
|
1749
|
+
}
|
|
1750
|
+
}), Cn = { class: "d-flex align-items-center" }, wn = { class: "fw-bold ext-display-name" }, Tn = {
|
|
1751
|
+
key: 0,
|
|
1752
|
+
class: "small ext-all-identifiers text-wrap"
|
|
1753
|
+
}, En = {
|
|
1754
|
+
key: 1,
|
|
1755
|
+
class: "small ext-description text-wrap"
|
|
1756
|
+
}, Dn = {
|
|
1757
|
+
key: 0,
|
|
1758
|
+
class: "text-center"
|
|
1759
|
+
}, On = { key: 1 }, kn = { key: 2 };
|
|
1760
|
+
function An(e, t, n, r, i, a) {
|
|
1761
|
+
let o = q("Highlighter"), s = q("Clickable"), c = q("Spinner"), l = q("FormInputClearable"), u = q("Btn"), d = q("Dropdown");
|
|
1762
|
+
return U(), F(d, {
|
|
1763
|
+
open: e.isAutocompleteVisible,
|
|
1764
|
+
"onUpdate:open": t[2] || (t[2] = (t) => e.isAutocompleteVisible = t),
|
|
1765
|
+
"min-width": "300px",
|
|
1766
|
+
items: e.autocomplete.items
|
|
1767
|
+
}, {
|
|
1768
|
+
item: Y(({ item: t }) => [B(s, {
|
|
1769
|
+
class: "dropdown-item mb-1",
|
|
1770
|
+
onClick: (n) => e.selectItem(t.text)
|
|
1771
|
+
}, {
|
|
1772
|
+
default: Y(() => [R("div", Cn, [R("div", null, [
|
|
1773
|
+
R("div", wn, [B(o, {
|
|
1774
|
+
"highlight-class-name": "text-primary p-0 display-inline bg-transparent ext-highlight",
|
|
1775
|
+
"highlight-tag": "span",
|
|
1776
|
+
"search-words": e.highlightTerms,
|
|
1777
|
+
"auto-escape": !0,
|
|
1778
|
+
"text-to-highlight": t.text || ""
|
|
1779
|
+
}, null, 8, ["search-words", "text-to-highlight"])]),
|
|
1780
|
+
t.text != t.secondaryText && t.secondaryText ? (U(), L("div", Tn, [B(o, {
|
|
1781
|
+
"highlight-class-name": "fw-bold text-primary p-0 display-inline bg-transparent ext-highlight",
|
|
1782
|
+
"highlight-tag": "span",
|
|
1783
|
+
"search-words": e.highlightTerms,
|
|
1784
|
+
"auto-escape": !0,
|
|
1785
|
+
"text-to-highlight": t.secondaryText
|
|
1786
|
+
}, null, 8, ["search-words", "text-to-highlight"])])) : I("", !0),
|
|
1787
|
+
t.description ? (U(), L("div", En, [B(o, {
|
|
1788
|
+
"highlight-class-name": "fw-bold text-primary p-0 display-inline bg-transparent ext-highlight",
|
|
1789
|
+
"highlight-tag": "span",
|
|
1790
|
+
"search-words": e.highlightTerms,
|
|
1791
|
+
"auto-escape": !0,
|
|
1792
|
+
"text-to-highlight": t.description
|
|
1793
|
+
}, null, 8, ["search-words", "text-to-highlight"])])) : I("", !0)
|
|
1794
|
+
])])]),
|
|
1795
|
+
_: 2
|
|
1796
|
+
}, 1032, ["onClick"])]),
|
|
1797
|
+
footer: Y(() => [e.isAutocompleteLoading ? (U(), L("div", Dn, [B(c, { sm: "" })])) : e.autocomplete.totalCount ? (U(), L("small", On, J(e.t("ShowingNOfNMatches", !1, [`${e.autocomplete.itemsCount}`, `${e.autocomplete.totalCount}`])), 1)) : e.searchText && e.searchText.length > 2 ? (U(), L("small", kn, J(e.t("NoResults")), 1)) : I("", !0)]),
|
|
1798
|
+
activator: Y(({ on: n }) => [R("form", {
|
|
1799
|
+
class: "input-group flex-nowrap",
|
|
1800
|
+
onSubmit: t[1] || (t[1] = Z((...t) => e.onEnter && e.onEnter(...t), ["prevent"]))
|
|
1801
|
+
}, [B(l, Tt({
|
|
1802
|
+
modelValue: e.searchText,
|
|
1803
|
+
"onUpdate:modelValue": t[0] || (t[0] = (t) => e.searchText = t),
|
|
1804
|
+
modelModifiers: { trim: !0 },
|
|
1805
|
+
"class-inner": "border-end-0",
|
|
1806
|
+
placeholder: e.t("SearchProductsInputPlaceholder")
|
|
1807
|
+
}, jt(n), {
|
|
1808
|
+
"onUpdate:modelValue": e.onSearchInput,
|
|
1809
|
+
onKeyup: Pt(e.onEnter, ["enter"]),
|
|
1810
|
+
onClear: e.onClear,
|
|
1811
|
+
onFocus: e.openAutocomplete
|
|
1812
|
+
}), null, 16, [
|
|
1813
|
+
"modelValue",
|
|
1814
|
+
"placeholder",
|
|
1815
|
+
"onUpdate:modelValue",
|
|
1816
|
+
"onKeyup",
|
|
1817
|
+
"onClear",
|
|
1818
|
+
"onFocus"
|
|
1819
|
+
]), B(u, {
|
|
1820
|
+
"aria-label": e.t("SearchProductsInputAriaLabel"),
|
|
1821
|
+
icon: "lens-search-find"
|
|
1822
|
+
}, {
|
|
1823
|
+
default: Y(() => [R("span", null, J(e.t("SearchButtonText")), 1)]),
|
|
1824
|
+
_: 1
|
|
1825
|
+
}, 8, ["aria-label"])], 32)]),
|
|
1826
|
+
_: 1
|
|
1827
|
+
}, 8, ["open", "items"]);
|
|
1828
|
+
}
|
|
1829
|
+
var jn = /*#__PURE__*/ j(Sn, [["render", An]]), Mn = V({
|
|
1830
|
+
name: "PrmSearchList",
|
|
1831
|
+
components: {
|
|
1832
|
+
Icon: D,
|
|
1833
|
+
PisReplacements: vn,
|
|
1834
|
+
Tooltip: Ce,
|
|
1835
|
+
MountPoint: ue,
|
|
1836
|
+
Clickable: C,
|
|
1837
|
+
Image: Je
|
|
1838
|
+
},
|
|
1839
|
+
props: {
|
|
1840
|
+
products: {
|
|
1841
|
+
type: Array,
|
|
1842
|
+
required: !0
|
|
1843
|
+
},
|
|
1844
|
+
instance: {
|
|
1845
|
+
type: Object,
|
|
1846
|
+
required: !0
|
|
1847
|
+
},
|
|
1848
|
+
t: {
|
|
1849
|
+
type: Function,
|
|
1850
|
+
required: !0
|
|
1851
|
+
},
|
|
1852
|
+
emit: {
|
|
1853
|
+
type: Function,
|
|
1854
|
+
required: !0
|
|
1855
|
+
}
|
|
1856
|
+
},
|
|
1857
|
+
setup(e) {
|
|
1858
|
+
let t = W(), n = P(() => {
|
|
1859
|
+
var t;
|
|
1860
|
+
return (t = e.instance) == null ? void 0 : t.store;
|
|
1861
|
+
}), i = P(() => e.products), o = P(() => {
|
|
1862
|
+
var e;
|
|
1863
|
+
return ((e = n.value) == null || (e = e.options.components) == null || (e = e.search) == null ? void 0 : e.list) ?? {};
|
|
1864
|
+
}), s = P(() => {
|
|
1865
|
+
var t;
|
|
1866
|
+
return ((t = e.instance) == null ? void 0 : t.registeredComponents.has("pis-products-preview")) ?? !1;
|
|
1867
|
+
}), c = P(() => {
|
|
1868
|
+
var e;
|
|
1869
|
+
return ((e = n.value) == null || (e = e.options.components) == null || (e = e.common) == null ? void 0 : e.hideReplacements) != 1;
|
|
1870
|
+
}), l = (e) => o.value.actionTemplate && (o.value.showActionTemplateIfInactive || !(e != null && e.inactive)), u = async (t) => {
|
|
1871
|
+
try {
|
|
1872
|
+
var n;
|
|
1873
|
+
await ((n = e.instance) == null ? void 0 : n.execute(new qe({ productId: t.productId }).from("prm-search-list")));
|
|
1874
|
+
} catch {}
|
|
1875
|
+
}, d = async (t) => {
|
|
1876
|
+
if (!(t != null && t.inactive) && t) try {
|
|
1877
|
+
var n;
|
|
1878
|
+
await ((n = e.instance) == null ? void 0 : n.execute(new tt(t).from("prm-search-list")));
|
|
1879
|
+
} catch {}
|
|
1880
|
+
}, f = xe((t) => ({
|
|
1881
|
+
instance: e.instance,
|
|
1882
|
+
item: t.item,
|
|
1883
|
+
emit: e.emit,
|
|
1884
|
+
t: e.t
|
|
1885
|
+
})), p = xe((t) => ({
|
|
1886
|
+
instance: e.instance,
|
|
1887
|
+
item: t.item,
|
|
1888
|
+
emit: e.emit,
|
|
1889
|
+
details: d,
|
|
1890
|
+
attrValue: v,
|
|
1891
|
+
t: e.t
|
|
1892
|
+
}));
|
|
1893
|
+
return {
|
|
1894
|
+
root: t,
|
|
1895
|
+
componentOptions: o,
|
|
1896
|
+
productsItems: i,
|
|
1897
|
+
previewEnabled: s,
|
|
1898
|
+
replacementsVisible: c,
|
|
1899
|
+
showActionTemplate: l,
|
|
1900
|
+
attrValue: v,
|
|
1901
|
+
attrValues: a,
|
|
1902
|
+
details: d,
|
|
1903
|
+
preview: u,
|
|
1904
|
+
additionalInfoText: Le,
|
|
1905
|
+
variantsAvailableInfo: r,
|
|
1906
|
+
imageOverlayCtx: f,
|
|
1907
|
+
itemCtx: p
|
|
1908
|
+
};
|
|
1909
|
+
}
|
|
1910
|
+
}), Nn = { key: 0 }, Pn = { class: "row align-items-center" }, Fn = {
|
|
1911
|
+
key: 1,
|
|
1912
|
+
class: "position-absolute p-2 top-50 start-0 ext-select-checkbox",
|
|
1913
|
+
style: {
|
|
1914
|
+
"z-index": "1",
|
|
1915
|
+
width: "auto",
|
|
1916
|
+
"margin-top": "-1rem"
|
|
1917
|
+
}
|
|
1918
|
+
}, In = ["checked", "onClick"], Ln = { class: "position-relative col d-flex justify-content-center align-items-center card" }, Rn = { key: 0 }, zn = { class: "col" }, Bn = {
|
|
1919
|
+
key: 0,
|
|
1920
|
+
class: "text-muted"
|
|
1921
|
+
}, Vn = ["onClick"], Hn = { key: 5 }, Un = {
|
|
1922
|
+
key: 7,
|
|
1923
|
+
class: "d-flex align-items-center fw-bold mt-1"
|
|
1924
|
+
};
|
|
1925
|
+
function Wn(e, t, n, r, i, a) {
|
|
1926
|
+
let o = q("Icon"), s = q("Clickable"), c = q("Image"), l = q("MountPoint"), u = q("Tooltip"), d = q("PisReplacements"), f = kt("safe-html");
|
|
1927
|
+
return U(), L("div", {
|
|
1928
|
+
ref: "root",
|
|
1929
|
+
class: H(["pis-component", "pis-prm-search-list"])
|
|
1930
|
+
}, [e.productsItems && e.productsItems.length ? (U(), L("div", Nn, [(U(!0), L(N, null, G(e.productsItems, (t) => {
|
|
1931
|
+
var n, r, i;
|
|
1932
|
+
return U(), L("div", {
|
|
1933
|
+
key: t.productId,
|
|
1934
|
+
class: H(["card mb-3 p-3", {
|
|
1935
|
+
"bg-light": t.exactMatch,
|
|
1936
|
+
"ext-selected": (n = e.instance) == null ? void 0 : n.selection.isSelected(t)
|
|
1937
|
+
}])
|
|
1938
|
+
}, [R("div", Pn, [
|
|
1939
|
+
e.previewEnabled ? (U(), F(s, {
|
|
1940
|
+
key: 0,
|
|
1941
|
+
class: "position-absolute p-2 top-0 start-0 d-flex ext-icon-preview",
|
|
1942
|
+
"hover-mode": "primary",
|
|
1943
|
+
style: {
|
|
1944
|
+
"z-index": "1",
|
|
1945
|
+
width: "auto"
|
|
1946
|
+
},
|
|
1947
|
+
title: e.t("Preview", !0),
|
|
1948
|
+
disabled: t.inactive,
|
|
1949
|
+
onClick: (n) => !t.inactive && e.preview(t)
|
|
1950
|
+
}, {
|
|
1951
|
+
default: Y(() => [B(o, {
|
|
1952
|
+
class: "text-muted",
|
|
1953
|
+
name: "document-analysis",
|
|
1954
|
+
size: 24
|
|
1955
|
+
})]),
|
|
1956
|
+
_: 1
|
|
1957
|
+
}, 8, [
|
|
1958
|
+
"title",
|
|
1959
|
+
"disabled",
|
|
1960
|
+
"onClick"
|
|
1961
|
+
])) : I("", !0),
|
|
1962
|
+
e.componentOptions.selectable ? (U(), L("div", Fn, [R("input", {
|
|
1963
|
+
type: "checkbox",
|
|
1964
|
+
class: "form-check-input",
|
|
1965
|
+
checked: (r = e.instance) == null ? void 0 : r.selection.isSelected(t),
|
|
1966
|
+
onClick: (n) => {
|
|
1967
|
+
var r;
|
|
1968
|
+
return (r = e.instance) == null ? void 0 : r.selection.toggle(t);
|
|
1969
|
+
}
|
|
1970
|
+
}, null, 8, In)])) : I("", !0),
|
|
1971
|
+
R("div", {
|
|
1972
|
+
class: H([e.previewEnabled || e.componentOptions.selectable ? "ms-4" : "", "col"]),
|
|
1973
|
+
style: Et({ "max-width": e.componentOptions.imageSize })
|
|
1974
|
+
}, [R("div", Ln, [B(c, {
|
|
1975
|
+
style: Et({ "max-width": e.componentOptions.imageSize }),
|
|
1976
|
+
src: (i = (t.images || [])[0]) == null ? void 0 : i.url,
|
|
1977
|
+
clickable: e.componentOptions.navigateOnContentClick && !t.inactive,
|
|
1978
|
+
"hide-frame": !0,
|
|
1979
|
+
padding: e.componentOptions.imagePadding,
|
|
1980
|
+
"lazy-loading": e.componentOptions.imageLazyLoading,
|
|
1981
|
+
onClick: (n) => e.details(t)
|
|
1982
|
+
}, null, 8, [
|
|
1983
|
+
"style",
|
|
1984
|
+
"src",
|
|
1985
|
+
"clickable",
|
|
1986
|
+
"padding",
|
|
1987
|
+
"lazy-loading",
|
|
1988
|
+
"onClick"
|
|
1989
|
+
]), e.componentOptions.imageOverlayTemplate ? (U(), L("div", Rn, [B(l, {
|
|
1990
|
+
callbacks: e.componentOptions.imageOverlayTemplate,
|
|
1991
|
+
ctx: e.imageOverlayCtx({ item: t })
|
|
1992
|
+
}, null, 8, ["callbacks", "ctx"])])) : I("", !0)])], 6),
|
|
1993
|
+
R("div", zn, [
|
|
1994
|
+
t.additionalInfo && t.additionalInfo.length ? (U(), F(u, {
|
|
1995
|
+
key: 0,
|
|
1996
|
+
text: e.additionalInfoText(t.additionalInfo)
|
|
1997
|
+
}, {
|
|
1998
|
+
default: Y(() => [B(o, {
|
|
1999
|
+
class: "text-warning me-1",
|
|
2000
|
+
name: "warning-triangle"
|
|
2001
|
+
})]),
|
|
2002
|
+
_: 1
|
|
2003
|
+
}, 8, ["text"])) : I("", !0),
|
|
2004
|
+
e.componentOptions.titleTemplate ? (U(), F(l, {
|
|
2005
|
+
key: 1,
|
|
2006
|
+
callbacks: e.componentOptions.titleTemplate,
|
|
2007
|
+
ctx: e.itemCtx({ item: t })
|
|
2008
|
+
}, null, 8, ["callbacks", "ctx"])) : (U(), L(N, { key: 2 }, [t.inactive ? (U(), L("strong", Bn, J(e.attrValue(t, "#DisplayName")), 1)) : (U(), L("a", {
|
|
2009
|
+
key: 1,
|
|
2010
|
+
href: "#",
|
|
2011
|
+
onClick: Z((n) => e.details(t), ["prevent"])
|
|
2012
|
+
}, [R("strong", null, J(e.attrValue(t, "#DisplayName")), 1)], 8, Vn))], 64)),
|
|
2013
|
+
e.componentOptions.showAllIdentifiers ? (U(!0), L(N, { key: 3 }, G(e.attrValues(t, "#AllIdentifiers"), (e, t) => (U(), L("div", {
|
|
2014
|
+
key: t,
|
|
2015
|
+
class: "small text-muted fw-bold"
|
|
2016
|
+
}, J(e), 1))), 128)) : I("", !0),
|
|
2017
|
+
e.componentOptions.itemTemplate ? (U(), F(l, {
|
|
2018
|
+
key: 4,
|
|
2019
|
+
callbacks: e.componentOptions.itemTemplate,
|
|
2020
|
+
ctx: e.itemCtx({ item: t })
|
|
2021
|
+
}, null, 8, ["callbacks", "ctx"])) : (U(), L("div", Hn, [R("span", null, J(e.attrValue(t, "CatalogDescription")), 1)])),
|
|
2022
|
+
t.replacements && t.replacements.length && e.componentOptions.showReplacements ? (U(), F(d, {
|
|
2023
|
+
key: 6,
|
|
2024
|
+
instance: e.instance,
|
|
2025
|
+
replacements: t.replacements,
|
|
2026
|
+
visible: e.replacementsVisible
|
|
2027
|
+
}, null, 8, [
|
|
2028
|
+
"instance",
|
|
2029
|
+
"replacements",
|
|
2030
|
+
"visible"
|
|
2031
|
+
])) : I("", !0),
|
|
2032
|
+
e.componentOptions.showVariants && t.variantsAvailable ? (U(), L("div", Un, [B(o, {
|
|
2033
|
+
class: "text-muted me-2",
|
|
2034
|
+
name: "information-circle"
|
|
2035
|
+
}), X(R("span", null, null, 512), [[f, e.t("VariantsAvailable") + ": " + e.variantsAvailableInfo(t.variantAttributes) + "."]])])) : I("", !0)
|
|
2036
|
+
]),
|
|
2037
|
+
e.componentOptions.additionalColumnTemplate ? (U(), L("div", {
|
|
2038
|
+
key: 2,
|
|
2039
|
+
class: H("col-" + e.componentOptions.additionalColumnTemplateWidth)
|
|
2040
|
+
}, [B(l, {
|
|
2041
|
+
callbacks: e.componentOptions.additionalColumnTemplate,
|
|
2042
|
+
ctx: e.itemCtx({ item: t })
|
|
2043
|
+
}, null, 8, ["callbacks", "ctx"])], 2)) : I("", !0),
|
|
2044
|
+
e.showActionTemplate(t) ? (U(), L("div", {
|
|
2045
|
+
key: 3,
|
|
2046
|
+
class: H("col-" + e.componentOptions.actionTemplateWidth)
|
|
2047
|
+
}, [B(l, {
|
|
2048
|
+
callbacks: e.componentOptions.actionTemplate,
|
|
2049
|
+
ctx: e.itemCtx({ item: t })
|
|
2050
|
+
}, null, 8, ["callbacks", "ctx"])], 2)) : I("", !0)
|
|
2051
|
+
])], 2);
|
|
2052
|
+
}), 128))])) : I("", !0)], 512);
|
|
2053
|
+
}
|
|
2054
|
+
var Gn = /*#__PURE__*/ j(Mn, [["render", Wn]]), Kn = V({
|
|
2055
|
+
name: "PrmSearchTable",
|
|
2056
|
+
components: {
|
|
2057
|
+
Icon: D,
|
|
2058
|
+
Tooltip: Ce,
|
|
2059
|
+
PisReplacements: vn,
|
|
2060
|
+
Clickable: C,
|
|
2061
|
+
MountPoint: ue
|
|
2062
|
+
},
|
|
2063
|
+
props: {
|
|
2064
|
+
products: {
|
|
2065
|
+
type: Array,
|
|
2066
|
+
required: !0
|
|
2067
|
+
},
|
|
2068
|
+
relationshipColumns: {
|
|
2069
|
+
type: Array,
|
|
2070
|
+
required: !0
|
|
2071
|
+
},
|
|
2072
|
+
instance: {
|
|
2073
|
+
type: Object,
|
|
2074
|
+
required: !0
|
|
2075
|
+
},
|
|
2076
|
+
t: {
|
|
2077
|
+
type: Function,
|
|
2078
|
+
required: !0
|
|
2079
|
+
},
|
|
2080
|
+
emit: {
|
|
2081
|
+
type: Function,
|
|
2082
|
+
required: !0
|
|
2083
|
+
},
|
|
2084
|
+
relationship: {
|
|
2085
|
+
type: Object,
|
|
2086
|
+
required: !0
|
|
2087
|
+
},
|
|
2088
|
+
actionTemplate: {
|
|
2089
|
+
type: Object,
|
|
2090
|
+
default: void 0
|
|
2091
|
+
}
|
|
2092
|
+
},
|
|
2093
|
+
setup(e) {
|
|
2094
|
+
let t = W(), n = P(() => e.products), i = P(() => {
|
|
2095
|
+
var t;
|
|
2096
|
+
return (t = e.instance) == null ? void 0 : t.store;
|
|
2097
|
+
}), o = P(() => {
|
|
2098
|
+
var t;
|
|
2099
|
+
return ((t = e.instance) == null ? void 0 : t.registeredComponents.has("pis-products-preview")) ?? !1;
|
|
2100
|
+
}), s = P(() => {
|
|
2101
|
+
var e;
|
|
2102
|
+
return ((e = i.value) == null || (e = e.options.components) == null || (e = e.search) == null ? void 0 : e.table) ?? {};
|
|
2103
|
+
}), c = P(() => {
|
|
2104
|
+
var t, n;
|
|
2105
|
+
let r = (t = s.value.columns) == null ? void 0 : t.filter((e) => e.treeTypes.indexOf(A.PRODUCTS) > -1), i = [];
|
|
2106
|
+
if (r != null && r.length) {
|
|
2107
|
+
var a;
|
|
2108
|
+
i.push({
|
|
2109
|
+
...r[0],
|
|
2110
|
+
headerTemplate: void 0,
|
|
2111
|
+
caption: ((a = e.relationshipColumns[0]) == null ? void 0 : a.text) ?? r[0].caption
|
|
2112
|
+
});
|
|
2113
|
+
}
|
|
2114
|
+
let o = e.relationshipColumns[1];
|
|
2115
|
+
if ((o == null ? void 0 : o.dataField) === "CatalogDescription" && r && r.length > 1) {
|
|
2116
|
+
i.push({
|
|
2117
|
+
...r[1],
|
|
2118
|
+
headerTemplate: void 0,
|
|
2119
|
+
caption: o.text ?? r[1].caption
|
|
2120
|
+
});
|
|
2121
|
+
let t = e.relationshipColumns.slice(2).map((e) => ({
|
|
2122
|
+
caption: e.text,
|
|
2123
|
+
dataField: e.dataField,
|
|
2124
|
+
treeTypes: [A.PRODUCTS]
|
|
2125
|
+
}));
|
|
2126
|
+
i.push(...t);
|
|
2127
|
+
} else {
|
|
2128
|
+
let t = e.relationshipColumns.slice(1).map((e) => ({
|
|
2129
|
+
caption: e.text,
|
|
2130
|
+
dataField: e.dataField,
|
|
2131
|
+
treeTypes: [A.PRODUCTS]
|
|
2132
|
+
}));
|
|
2133
|
+
i.push(...t);
|
|
2134
|
+
}
|
|
2135
|
+
return (n = e.actionTemplate) != null && n.cellTemplate && i.push({
|
|
2136
|
+
caption: "",
|
|
2137
|
+
width: e.actionTemplate.columnWidth,
|
|
2138
|
+
treeTypes: [A.PRODUCTS],
|
|
2139
|
+
headerTemplate: e.actionTemplate.headerTemplate,
|
|
2140
|
+
cellTemplate: e.actionTemplate.cellTemplate
|
|
2141
|
+
}), i;
|
|
2142
|
+
}), l = P(() => {
|
|
2143
|
+
var e;
|
|
2144
|
+
return (e = n.value) == null ? void 0 : e.some(({ additionalInfo: e }) => e == null ? void 0 : e.length);
|
|
2145
|
+
}), u = P(() => {
|
|
2146
|
+
var e;
|
|
2147
|
+
return ((e = i.value) == null || (e = e.options.components) == null || (e = e.common) == null ? void 0 : e.hideReplacements) != 1;
|
|
2148
|
+
}), d = async (t) => {
|
|
2149
|
+
if (t) try {
|
|
2150
|
+
var n;
|
|
2151
|
+
await ((n = e.instance) == null ? void 0 : n.execute(new tt(t).from("prm-search-table")));
|
|
2152
|
+
} catch {}
|
|
2153
|
+
}, f = async (t) => {
|
|
2154
|
+
try {
|
|
2155
|
+
var n;
|
|
2156
|
+
await ((n = e.instance) == null ? void 0 : n.execute(new qe({ productId: t.productId }).from("prm-search-table")));
|
|
2157
|
+
} catch {}
|
|
2158
|
+
}, p = xe((t) => ({
|
|
2159
|
+
instance: e.instance,
|
|
2160
|
+
col: t.col,
|
|
2161
|
+
item: t.item,
|
|
2162
|
+
emit: e.emit,
|
|
2163
|
+
details: d,
|
|
2164
|
+
attrValue: v,
|
|
2165
|
+
attrValues: a,
|
|
2166
|
+
t: e.t,
|
|
2167
|
+
relationship: e.relationship,
|
|
2168
|
+
row: t.item
|
|
2169
|
+
}));
|
|
2170
|
+
return {
|
|
2171
|
+
root: t,
|
|
2172
|
+
componentOptions: s,
|
|
2173
|
+
productsItems: n,
|
|
2174
|
+
previewEnabled: o,
|
|
2175
|
+
columns: c,
|
|
2176
|
+
shouldDisplayAdditionalInfo: l,
|
|
2177
|
+
replacementsVisible: u,
|
|
2178
|
+
details: d,
|
|
2179
|
+
preview: f,
|
|
2180
|
+
attrValue: v,
|
|
2181
|
+
attrValues: a,
|
|
2182
|
+
additionalInfoText: Le,
|
|
2183
|
+
variantsAvailableInfo: r,
|
|
2184
|
+
reactiveContext: De,
|
|
2185
|
+
cellCtx: p
|
|
2186
|
+
};
|
|
2187
|
+
}
|
|
2188
|
+
}), qn = {
|
|
2189
|
+
key: 0,
|
|
2190
|
+
class: "table-responsive pis-scroll"
|
|
2191
|
+
}, Jn = { class: "table" }, Yn = {
|
|
2192
|
+
key: 0,
|
|
2193
|
+
style: { width: "1%" }
|
|
2194
|
+
}, Xn = {
|
|
2195
|
+
key: 1,
|
|
2196
|
+
style: { width: "1%" }
|
|
2197
|
+
}, Zn = {
|
|
2198
|
+
key: 2,
|
|
2199
|
+
style: { width: "1%" }
|
|
2200
|
+
}, Qn = { key: 0 }, $n = { key: 1 }, er = { key: 2 }, tr = { key: 0 }, nr = { class: "ext-select-checkbox" }, rr = ["checked", "onClick"], ir = { key: 1 }, ar = { key: 2 }, or = { key: 1 }, sr = { key: 2 }, cr = {
|
|
2201
|
+
key: 4,
|
|
2202
|
+
class: "d-flex align-items-center fw-bold mt-1"
|
|
2203
|
+
};
|
|
2204
|
+
function lr(e, t, n, r, i, a) {
|
|
2205
|
+
let o = q("MountPoint"), s = q("Icon"), c = q("Clickable"), l = q("Tooltip"), u = q("PisReplacements"), d = kt("safe-html");
|
|
2206
|
+
return U(), L("div", {
|
|
2207
|
+
ref: "root",
|
|
2208
|
+
class: H(["pis-component", "pis-prm-search-table"])
|
|
2209
|
+
}, [e.productsItems && e.productsItems.length ? (U(), L("div", qn, [R("table", Jn, [
|
|
2210
|
+
R("colgroup", null, [
|
|
2211
|
+
e.componentOptions.selectable ? (U(), L("col", Yn)) : I("", !0),
|
|
2212
|
+
e.previewEnabled ? (U(), L("col", Xn)) : I("", !0),
|
|
2213
|
+
e.shouldDisplayAdditionalInfo ? (U(), L("col", Zn)) : I("", !0),
|
|
2214
|
+
(U(!0), L(N, null, G(e.columns, (e, t) => (U(), L("col", {
|
|
2215
|
+
key: t,
|
|
2216
|
+
style: Et({ width: e.width })
|
|
2217
|
+
}, null, 4))), 128))
|
|
2218
|
+
]),
|
|
2219
|
+
R("thead", null, [R("tr", null, [
|
|
2220
|
+
e.componentOptions.selectable ? (U(), L("th", Qn)) : I("", !0),
|
|
2221
|
+
e.previewEnabled ? (U(), L("th", $n)) : I("", !0),
|
|
2222
|
+
e.shouldDisplayAdditionalInfo ? (U(), L("th", er)) : I("", !0),
|
|
2223
|
+
(U(!0), L(N, null, G(e.columns, (t, n) => (U(), L("th", { key: n }, [t.headerTemplate ? (U(), F(o, {
|
|
2224
|
+
key: 0,
|
|
2225
|
+
callbacks: t.headerTemplate,
|
|
2226
|
+
ctx: e.reactiveContext({
|
|
2227
|
+
t: e.t,
|
|
2228
|
+
col: t
|
|
2229
|
+
})
|
|
2230
|
+
}, null, 8, ["callbacks", "ctx"])) : (U(), L(N, { key: 1 }, [z(J(t.caption), 1)], 64))]))), 128))
|
|
2231
|
+
])]),
|
|
2232
|
+
R("tbody", null, [(U(!0), L(N, null, G(e.productsItems, (t) => {
|
|
2233
|
+
var n, r;
|
|
2234
|
+
return U(), L("tr", {
|
|
2235
|
+
key: t.productId,
|
|
2236
|
+
class: H({
|
|
2237
|
+
"bg-light": t.exactMatch,
|
|
2238
|
+
"ext-selected": (n = e.instance) == null ? void 0 : n.selection.isSelected(t)
|
|
2239
|
+
})
|
|
2240
|
+
}, [
|
|
2241
|
+
e.componentOptions.selectable ? (U(), L("td", tr, [R("div", nr, [R("input", {
|
|
2242
|
+
type: "checkbox",
|
|
2243
|
+
class: "form-check-input",
|
|
2244
|
+
checked: (r = e.instance) == null ? void 0 : r.selection.isSelected(t),
|
|
2245
|
+
onClick: (n) => {
|
|
2246
|
+
var r;
|
|
2247
|
+
return (r = e.instance) == null ? void 0 : r.selection.toggle(t);
|
|
2248
|
+
}
|
|
2249
|
+
}, null, 8, rr)])])) : I("", !0),
|
|
2250
|
+
e.previewEnabled ? (U(), L("td", ir, [B(c, {
|
|
2251
|
+
class: "d-flex ext-icon-preview",
|
|
2252
|
+
"hover-mode": "primary",
|
|
2253
|
+
title: e.t(t.inactive ? "PreviewNotAvailable" : "Preview", !0),
|
|
2254
|
+
disabled: t.inactive,
|
|
2255
|
+
onClick: Z((n) => !t.inactive && e.preview(t), ["prevent"])
|
|
2256
|
+
}, {
|
|
2257
|
+
default: Y(() => [B(s, {
|
|
2258
|
+
class: "text-muted",
|
|
2259
|
+
name: "document-analysis",
|
|
2260
|
+
size: 24
|
|
2261
|
+
})]),
|
|
2262
|
+
_: 1
|
|
2263
|
+
}, 8, [
|
|
2264
|
+
"title",
|
|
2265
|
+
"disabled",
|
|
2266
|
+
"onClick"
|
|
2267
|
+
])])) : I("", !0),
|
|
2268
|
+
e.shouldDisplayAdditionalInfo ? (U(), L("td", ar, [t.additionalInfo && t.additionalInfo.length ? (U(), F(l, {
|
|
2269
|
+
key: 0,
|
|
2270
|
+
text: e.additionalInfoText(t.additionalInfo)
|
|
2271
|
+
}, {
|
|
2272
|
+
default: Y(() => [B(s, {
|
|
2273
|
+
class: "text-warning",
|
|
2274
|
+
name: "warning-triangle"
|
|
2275
|
+
})]),
|
|
2276
|
+
_: 1
|
|
2277
|
+
}, 8, ["text"])) : I("", !0)])) : I("", !0),
|
|
2278
|
+
(U(!0), L(N, null, G(e.columns, (n, r) => (U(), L("td", { key: r }, [
|
|
2279
|
+
n.cellTemplate ? (U(), F(o, {
|
|
2280
|
+
key: 0,
|
|
2281
|
+
callbacks: n.cellTemplate,
|
|
2282
|
+
ctx: e.cellCtx({
|
|
2283
|
+
item: t,
|
|
2284
|
+
col: n
|
|
2285
|
+
})
|
|
2286
|
+
}, null, 8, ["callbacks", "ctx"])) : n.dataField == "ProductId" ? (U(), L("span", or, [B(c, { onClick: (n) => e.details(t) }, {
|
|
2287
|
+
default: Y(() => [z(J(e.attrValue(t, n.dataField)), 1)]),
|
|
2288
|
+
_: 2
|
|
2289
|
+
}, 1032, ["onClick"])])) : (U(), L("span", sr, J(e.attrValue(t, n.dataField)), 1)),
|
|
2290
|
+
n.showReplacements && t.replacements && t.replacements.length ? (U(), F(u, {
|
|
2291
|
+
key: 3,
|
|
2292
|
+
instance: e.instance,
|
|
2293
|
+
replacements: t.replacements,
|
|
2294
|
+
visible: e.replacementsVisible
|
|
2295
|
+
}, null, 8, [
|
|
2296
|
+
"instance",
|
|
2297
|
+
"replacements",
|
|
2298
|
+
"visible"
|
|
2299
|
+
])) : I("", !0),
|
|
2300
|
+
n.showVariants && t.variantsAvailable ? (U(), L("div", cr, [B(s, {
|
|
2301
|
+
class: "text-muted me-2",
|
|
2302
|
+
name: "information-circle"
|
|
2303
|
+
}), X(R("span", null, null, 512), [[d, e.t("VariantsAvailable") + ": " + e.variantsAvailableInfo(t.variantAttributes) + "."]])])) : I("", !0),
|
|
2304
|
+
n.showAllIdentifiers ? (U(!0), L(N, { key: 5 }, G(e.attrValues(t, "#AllIdentifiers"), (e, t) => (U(), L("div", {
|
|
2305
|
+
key: t,
|
|
2306
|
+
class: "small text-muted fw-bold"
|
|
2307
|
+
}, J(e), 1))), 128)) : I("", !0)
|
|
2308
|
+
]))), 128))
|
|
2309
|
+
], 2);
|
|
2310
|
+
}), 128))])
|
|
2311
|
+
])])) : I("", !0)], 512);
|
|
2312
|
+
}
|
|
2313
|
+
//#endregion
|
|
2314
|
+
//#region src/products/components/shared/PrmList.vue?vue&type=script&lang.ts
|
|
2315
|
+
var ur = V({
|
|
2316
|
+
name: "PrmList",
|
|
2317
|
+
components: {
|
|
2318
|
+
Arrow: nt,
|
|
2319
|
+
Btn: ve,
|
|
2320
|
+
Card: pt,
|
|
2321
|
+
LinkSecondary: _t,
|
|
2322
|
+
Message: it,
|
|
2323
|
+
ScrollableList: lt,
|
|
2324
|
+
Icon: D,
|
|
2325
|
+
Pagination: at,
|
|
2326
|
+
ImageGallery: et,
|
|
2327
|
+
PrmListSearchForm: jn,
|
|
2328
|
+
FiltersNavigatorModal: xn,
|
|
2329
|
+
Spinner: Ne,
|
|
2330
|
+
Clickable: C,
|
|
2331
|
+
PrmSearchTable: /* @__PURE__ */ j(Kn, [["render", lr]]),
|
|
2332
|
+
PrmSearchList: Gn
|
|
2333
|
+
},
|
|
2334
|
+
props: {
|
|
2335
|
+
relationship: {
|
|
2336
|
+
type: Object,
|
|
2337
|
+
required: !0
|
|
2338
|
+
},
|
|
2339
|
+
instance: {
|
|
2340
|
+
type: Object,
|
|
2341
|
+
required: !0
|
|
2342
|
+
},
|
|
2343
|
+
productId: {
|
|
2344
|
+
type: String,
|
|
2345
|
+
required: !0
|
|
2346
|
+
},
|
|
2347
|
+
t: {
|
|
2348
|
+
type: Function,
|
|
2349
|
+
required: !0
|
|
2350
|
+
},
|
|
2351
|
+
cid: {
|
|
2352
|
+
type: String,
|
|
2353
|
+
required: !1,
|
|
2354
|
+
default: void 0
|
|
2355
|
+
},
|
|
2356
|
+
emit: {
|
|
2357
|
+
type: Function,
|
|
2358
|
+
required: !0
|
|
2359
|
+
}
|
|
2360
|
+
},
|
|
2361
|
+
setup(e) {
|
|
2362
|
+
var t, n;
|
|
2363
|
+
let r = W(!1), i = W(!1), a = P(() => e.relationship), o = P(() => a.value.columns), s = W(!1), c = W(!1), l = P(() => {
|
|
2364
|
+
var t;
|
|
2365
|
+
return (t = e.instance) == null || (t = t.store.options.components) == null || (t = t.details) == null || (t = t.data) == null ? void 0 : t.relationships;
|
|
2366
|
+
}), u = $e(e.productId, e.relationship), { filter: d, filtersAll: f, filtersPromoted: p, filtersAdditional: m, filtersModel: h, filtersFetched: g, filtersLoading: _, filtersOpen: v, saveSettings: y, setFilters: b, setFilterValues: te, resetFiltersApplied: ne, getFiltersModelAsCriteriaGroup: x } = u, S = W(1), C = W(((t = l.value) == null ? void 0 : t.pageSize) || 0), w = W(((n = a.value.products) == null ? void 0 : n.totalCount) || 0), re = W([]), ie = W(!1), ae = W([]), oe = W(!1), se = W(!1), T = W(0), E = 0, ce = 0, le = 0, D = /* @__PURE__ */ new Map(), ue = P(() => {
|
|
2367
|
+
var t;
|
|
2368
|
+
return ie.value === !0 ? re.value : ((t = e.relationship.products) == null ? void 0 : t.items) || [];
|
|
2369
|
+
}), de = P(() => C.value > 0 ? Math.ceil(w.value / C.value) : 0), fe = async () => {
|
|
2370
|
+
let t = ++E;
|
|
2371
|
+
se.value = !0;
|
|
2372
|
+
let n = new Ke({
|
|
2373
|
+
search: {
|
|
2374
|
+
productId: e.productId,
|
|
2375
|
+
searchText: d.value || void 0,
|
|
2376
|
+
relationshipType: e.relationship.type,
|
|
2377
|
+
relationshipCode: e.relationship.code,
|
|
2378
|
+
filter: x()
|
|
2379
|
+
},
|
|
2380
|
+
pager: {
|
|
2381
|
+
page: S.value,
|
|
2382
|
+
pageSize: C.value
|
|
2383
|
+
}
|
|
2384
|
+
});
|
|
2385
|
+
try {
|
|
2386
|
+
var i, a, o, s;
|
|
2387
|
+
let c = await ((i = e.instance) == null ? void 0 : i.execute(n));
|
|
2388
|
+
if (t !== E || !c) return;
|
|
2389
|
+
let l = (a = c.items) == null ? void 0 : a[0];
|
|
2390
|
+
re.value = (l == null || (o = l.products) == null ? void 0 : o.items) || [], w.value = (l == null || (s = l.products) == null ? void 0 : s.totalCount) || 0, b((l == null ? void 0 : l.filters) || []);
|
|
2391
|
+
let u = /* @__PURE__ */ new Set([...g.keys(), ..._]);
|
|
2392
|
+
if (u.size > 0 && (await pe([...u]), t !== E)) return;
|
|
2393
|
+
ie.value = !0, r.value = !1;
|
|
2394
|
+
} catch {} finally {
|
|
2395
|
+
t === E && (se.value = !1);
|
|
2396
|
+
}
|
|
2397
|
+
}, pe = async (t) => {
|
|
2398
|
+
let n = ++le;
|
|
2399
|
+
t.forEach((e) => {
|
|
2400
|
+
D.set(e, n), _.add(e);
|
|
2401
|
+
});
|
|
2402
|
+
let r = (e) => D.get(e) === n;
|
|
2403
|
+
try {
|
|
2404
|
+
var i;
|
|
2405
|
+
let n = await ((i = e.instance) == null ? void 0 : i.execute(new Ue({
|
|
2406
|
+
attributeCodes: t,
|
|
2407
|
+
productId: e.productId,
|
|
2408
|
+
searchText: d.value || void 0,
|
|
2409
|
+
relationshipType: e.relationship.type,
|
|
2410
|
+
relationshipCode: e.relationship.code,
|
|
2411
|
+
filter: x()
|
|
2412
|
+
}).from("prm-list")));
|
|
2413
|
+
te(((n == null ? void 0 : n.items) || []).filter((e) => r(e.attributeCode)));
|
|
2414
|
+
} catch {} finally {
|
|
2415
|
+
t.filter(r).forEach((e) => {
|
|
2416
|
+
D.delete(e), _.delete(e);
|
|
2417
|
+
});
|
|
2418
|
+
}
|
|
2419
|
+
}, me = async (e) => {
|
|
2420
|
+
S.value = e, await fe();
|
|
2421
|
+
}, he = async () => {
|
|
2422
|
+
i.value = !1, await fe();
|
|
2423
|
+
}, ge = async (e) => {
|
|
2424
|
+
d.value = e, S.value = 1, await he();
|
|
2425
|
+
}, _e = async () => {
|
|
2426
|
+
d.value = "", S.value = 1, await fe();
|
|
2427
|
+
}, ve = (e) => {
|
|
2428
|
+
var t;
|
|
2429
|
+
return e.slice(0, (t = l.value) == null ? void 0 : t.filteringMaxAttributesVisible) ?? [];
|
|
2430
|
+
}, ye = P(() => ve(p.value.length ? p.value : m.value)), be = async ({ attributeCode: t }) => {
|
|
2431
|
+
!t || !e.instance || (v.has(t) ? v.delete(t) : (g.has(t) || await pe([t]), v.add(t)));
|
|
2432
|
+
}, xe = ({ attributeCode: e }) => v.has(e), O = ({ attributeCode: e }) => _.has(e), Se = () => {
|
|
2433
|
+
T.value++, i.value = !0;
|
|
2434
|
+
}, Ce = async () => {
|
|
2435
|
+
ne(), v.clear(), r.value = !1, await fe();
|
|
2436
|
+
}, we = ({ attributeCode: e, filterValueName: t, value: n }) => {
|
|
2437
|
+
var r;
|
|
2438
|
+
(r = h.value)[e] ?? (r[e] = {}), h.value[e][t] = n;
|
|
2439
|
+
}, k = () => {
|
|
2440
|
+
r.value = !0;
|
|
2441
|
+
}, Te = async (t) => {
|
|
2442
|
+
let n = ++ce;
|
|
2443
|
+
oe.value = !0;
|
|
2444
|
+
try {
|
|
2445
|
+
var r;
|
|
2446
|
+
let i = await ((r = e.instance) == null || (r = r.httpService) == null ? void 0 : r.loadImagesById(t));
|
|
2447
|
+
n === ce && i != null && i.items && (ae.value = i.items);
|
|
2448
|
+
} catch {} finally {
|
|
2449
|
+
n === ce && (oe.value = !1);
|
|
2450
|
+
}
|
|
2451
|
+
}, Ee = async () => {
|
|
2452
|
+
if (e.relationship && (e.relationship.images && Te(e.relationship.images), e.relationship.filters && b(e.relationship.filters)), x().rules.length || d.value) s.value = !0, c.value = !0, await fe();
|
|
2453
|
+
else {
|
|
2454
|
+
var t, n;
|
|
2455
|
+
s.value = w.value >= (((t = l.value) == null ? void 0 : t.filteringMinItems) || 0) && [
|
|
2456
|
+
Fe.ACCESSORIES,
|
|
2457
|
+
Fe.KIT_CONTENTS,
|
|
2458
|
+
Fe.SPARE_PART_USED_ON_LIST
|
|
2459
|
+
].includes(e.relationship.type || ""), c.value = w.value >= (((n = l.value) == null ? void 0 : n.searchMinItems) || 0);
|
|
2460
|
+
}
|
|
2461
|
+
}, De = () => {
|
|
2462
|
+
var t;
|
|
2463
|
+
E++, ce++, D.clear(), u.productId = e.productId, u.relationshipCode = e.relationship.code, S.value = 1, d.value = void 0, ne(), h.value = {}, _.clear(), b([]), r.value = !1, i.value = !1, ie.value = !1, se.value = !1, re.value = [], w.value = ((t = e.relationship.products) == null ? void 0 : t.totalCount) || 0, ae.value = [], oe.value = !1, s.value = !1, c.value = !1;
|
|
2464
|
+
};
|
|
2465
|
+
Nt([
|
|
2466
|
+
() => e.relationship.type,
|
|
2467
|
+
() => e.relationship.code,
|
|
2468
|
+
() => e.productId
|
|
2469
|
+
], () => {
|
|
2470
|
+
De(), Ee();
|
|
2471
|
+
}), Dt(Ee);
|
|
2472
|
+
let Oe = P(() => {
|
|
2473
|
+
var t;
|
|
2474
|
+
let n = (t = e.instance) == null || (t = t.store.options.components) == null || (t = t.details) == null || (t = t.data) == null ? void 0 : t.relationships;
|
|
2475
|
+
if (n != null && n.actionTemplates) {
|
|
2476
|
+
if (n.actionTemplates[e.relationship.type]) return n.actionTemplates[e.relationship.type];
|
|
2477
|
+
if (n.actionTemplates.All) return n.actionTemplates.All;
|
|
2478
|
+
}
|
|
2479
|
+
}), A = P(() => {
|
|
2480
|
+
var t;
|
|
2481
|
+
let n = (t = e.instance) == null || (t = t.store) == null || (t = t.options) == null || (t = t.components) == null || (t = t.details) == null || (t = t.data) == null || (t = t.relationships) == null ? void 0 : t.displayMode;
|
|
2482
|
+
if (n) {
|
|
2483
|
+
if (n[e.relationship.type]) return n[e.relationship.type];
|
|
2484
|
+
if (n.All) return n.All;
|
|
2485
|
+
}
|
|
2486
|
+
return "table";
|
|
2487
|
+
});
|
|
2488
|
+
return {
|
|
2489
|
+
isTableMode: P(() => A.value === "table"),
|
|
2490
|
+
isListMode: P(() => A.value === "list"),
|
|
2491
|
+
prm: a,
|
|
2492
|
+
products: ue,
|
|
2493
|
+
filter: d,
|
|
2494
|
+
page: S,
|
|
2495
|
+
pageCount: de,
|
|
2496
|
+
totalCount: w,
|
|
2497
|
+
productsImages: ae,
|
|
2498
|
+
productsImagesLoading: oe,
|
|
2499
|
+
isLoading: se,
|
|
2500
|
+
filtersAll: f,
|
|
2501
|
+
filtersPromoted: p,
|
|
2502
|
+
filtersAdditional: m,
|
|
2503
|
+
filtersToDisplay: ye,
|
|
2504
|
+
filtersOpen: v,
|
|
2505
|
+
filtersFetched: g,
|
|
2506
|
+
areFiltersDirty: r,
|
|
2507
|
+
filtersModel: h,
|
|
2508
|
+
isSearchEnabled: c,
|
|
2509
|
+
filteringOptions: l,
|
|
2510
|
+
isFilteringEnabled: s,
|
|
2511
|
+
allFiltersModalShown: i,
|
|
2512
|
+
filtersModalKey: T,
|
|
2513
|
+
actionTemplate: Oe,
|
|
2514
|
+
columns: o,
|
|
2515
|
+
getFiltersModelAsCriteriaGroup: x,
|
|
2516
|
+
criterionValueKey: ee,
|
|
2517
|
+
onSearch: ge,
|
|
2518
|
+
onSearchClear: _e,
|
|
2519
|
+
searchNow: he,
|
|
2520
|
+
toggleFilter: be,
|
|
2521
|
+
saveSettings: y,
|
|
2522
|
+
onPageChange: me,
|
|
2523
|
+
isFilterOpen: xe,
|
|
2524
|
+
showAllFilters: Se,
|
|
2525
|
+
isFilterLoading: O,
|
|
2526
|
+
onFetchFilterValues: pe,
|
|
2527
|
+
onFilterValueChange: k,
|
|
2528
|
+
clearAndCloseFilters: Ce,
|
|
2529
|
+
onModalFilterValueChange: we
|
|
2530
|
+
};
|
|
2531
|
+
}
|
|
2532
|
+
}), dr = { key: 0 }, fr = { class: "fw-bold" }, pr = {
|
|
2533
|
+
key: 1,
|
|
2534
|
+
class: "mb-4"
|
|
2535
|
+
}, mr = { key: 2 }, hr = {
|
|
2536
|
+
key: 0,
|
|
2537
|
+
class: "list-group list-group-flush"
|
|
2538
|
+
}, gr = { class: "text-break" }, _r = { class: "small text-muted text-nowrap ms-2" }, vr = { class: "d-flex align-items-center ms-auto ps-2 flex-shrink-0 my-auto" }, yr = {
|
|
2539
|
+
key: 0,
|
|
2540
|
+
class: "card-body py-0"
|
|
2541
|
+
}, br = { class: "form-check pe-1" }, xr = { class: "form-check-label pis-label d-flex align-items-start py-1 ms-2" }, Sr = ["onUpdate:modelValue", "name"], Cr = { class: "text-break" }, wr = ["textContent"], Tr = { class: "text-muted small text-nowrap ms-1" }, Er = {
|
|
2542
|
+
key: 1,
|
|
2543
|
+
class: "card-body"
|
|
2544
|
+
}, Dr = { class: "d-flex justify-content-between align-items-center" }, Or = { class: "text-muted fw-bold" }, kr = { key: 0 }, Ar = { class: "fw-bold" }, jr = { key: 1 }, Mr = { key: 3 }, Nr = { key: 4 }, Pr = {
|
|
2545
|
+
key: 5,
|
|
2546
|
+
class: "d-flex flex-row-reverse"
|
|
2547
|
+
};
|
|
2548
|
+
function Fr(e, t, n, r, i, a) {
|
|
2549
|
+
var o, s, c, l;
|
|
2550
|
+
let u = q("Icon"), d = q("ImageGallery"), f = q("Spinner"), p = q("Arrow"), m = q("Clickable"), h = q("ScrollableList"), g = q("Message"), _ = q("Btn"), v = q("Card"), y = q("FiltersNavigatorModal"), b = q("LinkSecondary"), ee = q("PrmListSearchForm"), te = q("PrmSearchTable"), ne = q("PrmSearchList"), x = q("Pagination"), S = kt("safe-html");
|
|
2551
|
+
return U(), L(N, null, [
|
|
2552
|
+
e.prm.userFields ? (U(), L("div", dr, [(U(!0), L(N, null, G(e.prm.userFields, (e, t) => (U(), L("div", {
|
|
2553
|
+
key: t,
|
|
2554
|
+
class: "mb-4"
|
|
2555
|
+
}, [R("div", fr, [B(u, { name: "information-circle" }), z(" " + J(e.name), 1)]), (U(!0), L(N, null, G(e.values, (e, t) => (U(), L("div", { key: t }, J(e), 1))), 128))]))), 128))])) : I("", !0),
|
|
2556
|
+
e.productsImages.length ? (U(), L("div", pr, [B(d, {
|
|
2557
|
+
images: e.productsImages,
|
|
2558
|
+
"always-show-thumbnails": !0,
|
|
2559
|
+
title: e.t("ProductGallery")
|
|
2560
|
+
}, null, 8, ["images", "title"])])) : I("", !0),
|
|
2561
|
+
e.isFilteringEnabled && ["inline-collapsed", "inline-expanded"].includes(((o = e.filteringOptions) == null ? void 0 : o.filtering) || "") ? (U(), L("div", mr, [B(v, {
|
|
2562
|
+
class: "mb-4",
|
|
2563
|
+
"sticky-footer": "",
|
|
2564
|
+
icon: "funnel-filter",
|
|
2565
|
+
header: e.t("PrmFilters", !0),
|
|
2566
|
+
"use-markup": !0,
|
|
2567
|
+
collapsed: ((s = e.filteringOptions) == null ? void 0 : s.filtering) === "inline-collapsed"
|
|
2568
|
+
}, Ct({
|
|
2569
|
+
list: Y(() => {
|
|
2570
|
+
var n;
|
|
2571
|
+
return [(n = e.filtersToDisplay) != null && n.length ? (U(), L("div", hr, [(U(!0), L(N, null, G(e.filtersToDisplay, (n) => {
|
|
2572
|
+
var r;
|
|
2573
|
+
return U(), L("div", { key: n.attributeCode }, [B(m, {
|
|
2574
|
+
class: "list-group-item list-group-item-action d-flex align-items-start border-0 user-select-none",
|
|
2575
|
+
"aria-expanded": e.isFilterOpen(n),
|
|
2576
|
+
onClick: Z((t) => e.toggleFilter(n), ["prevent"])
|
|
2577
|
+
}, {
|
|
2578
|
+
default: Y(() => [R("span", gr, [X(R("span", { class: H(["pis-label", e.isFilterOpen(n) ? "fw-bold" : ""]) }, null, 2), [[S, n.attributeName]]), R("span", _r, "(" + J(n.hitCount) + ")", 1)]), R("span", vr, [e.isFilterLoading(n) ? (U(), F(f, {
|
|
2579
|
+
key: 0,
|
|
2580
|
+
sm: ""
|
|
2581
|
+
})) : (U(), F(p, {
|
|
2582
|
+
key: 1,
|
|
2583
|
+
dir: e.isFilterOpen(n) ? "up" : "down"
|
|
2584
|
+
}, null, 8, ["dir"]))])]),
|
|
2585
|
+
_: 2
|
|
2586
|
+
}, 1032, ["aria-expanded", "onClick"]), e.isFilterOpen(n) ? (U(), L("div", yr, [(r = e.filtersFetched.get(n.attributeCode)) != null && r.length ? (U(), F(h, {
|
|
2587
|
+
key: 0,
|
|
2588
|
+
class: "list-unstyled my-1",
|
|
2589
|
+
height: "30vh",
|
|
2590
|
+
items: e.filtersFetched.get(n.attributeCode) || []
|
|
2591
|
+
}, {
|
|
2592
|
+
item: Y(({ item: r }) => [R("div", br, [R("label", xr, [X(R("input", {
|
|
2593
|
+
"onUpdate:modelValue": (t) => e.filtersModel[n.attributeCode][e.criterionValueKey(r.value)] = t,
|
|
2594
|
+
type: "checkbox",
|
|
2595
|
+
class: "form-check-input mt-1 me-2 flex-shrink-0",
|
|
2596
|
+
name: r.text,
|
|
2597
|
+
onChange: t[0] || (t[0] = (...t) => e.onFilterValueChange && e.onFilterValueChange(...t))
|
|
2598
|
+
}, null, 40, Sr), [[Mt, e.filtersModel[n.attributeCode][e.criterionValueKey(r.value)]]]), R("span", Cr, [R("span", {
|
|
2599
|
+
class: "text-break user-select-none",
|
|
2600
|
+
textContent: J(r.text)
|
|
2601
|
+
}, null, 8, wr), R("span", Tr, "(" + J(r.hitCount) + ")", 1)])])])]),
|
|
2602
|
+
_: 2
|
|
2603
|
+
}, 1032, ["items"])) : (U(), F(g, { key: 1 }, {
|
|
2604
|
+
default: Y(() => [z(J(e.t("NoFilterValues")), 1)]),
|
|
2605
|
+
_: 1
|
|
2606
|
+
}))])) : I("", !0)]);
|
|
2607
|
+
}), 128))])) : (U(), L("div", Er, [B(g, null, {
|
|
2608
|
+
default: Y(() => [z(J(e.t("NoFilters")), 1)]),
|
|
2609
|
+
_: 1
|
|
2610
|
+
})]))];
|
|
2611
|
+
}),
|
|
2612
|
+
_: 2
|
|
2613
|
+
}, [(c = e.filtersAll) != null && c.length ? {
|
|
2614
|
+
name: "footer",
|
|
2615
|
+
fn: Y(() => [
|
|
2616
|
+
e.areFiltersDirty ? (U(), F(_, {
|
|
2617
|
+
key: 0,
|
|
2618
|
+
class: "w-100 mb-2 justify-content-center ext-apply",
|
|
2619
|
+
variant: "primary",
|
|
2620
|
+
onClick: Z(e.searchNow, ["prevent"])
|
|
2621
|
+
}, {
|
|
2622
|
+
default: Y(() => [z(J(e.t("ShowResults", !0)), 1)]),
|
|
2623
|
+
_: 1
|
|
2624
|
+
}, 8, ["onClick"])) : I("", !0),
|
|
2625
|
+
B(_, {
|
|
2626
|
+
icon: "stop-not-allowed",
|
|
2627
|
+
class: "w-100 mt-2 ext-clear",
|
|
2628
|
+
variant: "secondary",
|
|
2629
|
+
sm: "",
|
|
2630
|
+
onClick: Z(e.clearAndCloseFilters, ["prevent"])
|
|
2631
|
+
}, {
|
|
2632
|
+
default: Y(() => [z(J(e.t("ClearFilters", !0)), 1)]),
|
|
2633
|
+
_: 1
|
|
2634
|
+
}, 8, ["onClick"]),
|
|
2635
|
+
B(_, {
|
|
2636
|
+
icon: "pop-out-window",
|
|
2637
|
+
class: "w-100 mt-2 ext-show-all",
|
|
2638
|
+
variant: "secondary",
|
|
2639
|
+
sm: "",
|
|
2640
|
+
onClick: Z(e.showAllFilters, ["prevent"])
|
|
2641
|
+
}, {
|
|
2642
|
+
default: Y(() => [z(J(e.t("ShowAllFilters")) + " (" + J(e.filtersAll.length) + ") ", 1)]),
|
|
2643
|
+
_: 1
|
|
2644
|
+
}, 8, ["onClick"])
|
|
2645
|
+
]),
|
|
2646
|
+
key: "0"
|
|
2647
|
+
} : void 0]), 1032, ["header", "collapsed"])])) : I("", !0),
|
|
2648
|
+
(U(), F(y, {
|
|
2649
|
+
key: e.filtersModalKey,
|
|
2650
|
+
show: e.isFilteringEnabled && e.allFiltersModalShown,
|
|
2651
|
+
title: e.t("AllFiltersModalTitle"),
|
|
2652
|
+
t: e.t,
|
|
2653
|
+
"filters-all": e.filtersAll,
|
|
2654
|
+
"filters-promoted": e.filtersPromoted,
|
|
2655
|
+
"filters-additional": e.filtersAdditional,
|
|
2656
|
+
"filters-fetched": e.filtersFetched,
|
|
2657
|
+
"filters-model": e.filtersModel,
|
|
2658
|
+
"fetch-filter-values": e.onFetchFilterValues,
|
|
2659
|
+
"filtered-result-count": void 0,
|
|
2660
|
+
"filtered-result-count-loading": !1,
|
|
2661
|
+
onValueChange: e.onModalFilterValueChange,
|
|
2662
|
+
onApplyFilters: e.searchNow,
|
|
2663
|
+
onClear: e.clearAndCloseFilters
|
|
2664
|
+
}, null, 8, [
|
|
2665
|
+
"show",
|
|
2666
|
+
"title",
|
|
2667
|
+
"t",
|
|
2668
|
+
"filters-all",
|
|
2669
|
+
"filters-promoted",
|
|
2670
|
+
"filters-additional",
|
|
2671
|
+
"filters-fetched",
|
|
2672
|
+
"filters-model",
|
|
2673
|
+
"fetch-filter-values",
|
|
2674
|
+
"onValueChange",
|
|
2675
|
+
"onApplyFilters",
|
|
2676
|
+
"onClear"
|
|
2677
|
+
])),
|
|
2678
|
+
R("div", Dr, [
|
|
2679
|
+
R("div", null, [R("span", Or, J(e.totalCount) + " " + J(e.t("Products", !0)), 1)]),
|
|
2680
|
+
e.isFilteringEnabled && ((l = e.filteringOptions) == null ? void 0 : l.filtering) === "popup" ? (U(), L("div", kr, [B(b, {
|
|
2681
|
+
icon: "funnel-filter",
|
|
2682
|
+
onClick: Z(e.showAllFilters, ["prevent"])
|
|
2683
|
+
}, {
|
|
2684
|
+
default: Y(() => [R("span", Ar, J(e.t("PrmFilters", !0)), 1)]),
|
|
2685
|
+
_: 1
|
|
2686
|
+
}, 8, ["onClick"])])) : I("", !0),
|
|
2687
|
+
e.isSearchEnabled ? (U(), L("div", jr, [B(ee, {
|
|
2688
|
+
modelValue: e.filter,
|
|
2689
|
+
"onUpdate:modelValue": t[1] || (t[1] = (t) => e.filter = t),
|
|
2690
|
+
instance: e.instance,
|
|
2691
|
+
"product-id": e.productId,
|
|
2692
|
+
"relationship-type": e.relationship.type,
|
|
2693
|
+
"relationship-code": e.relationship.code,
|
|
2694
|
+
"filter-criteria": e.getFiltersModelAsCriteriaGroup(),
|
|
2695
|
+
t: e.t,
|
|
2696
|
+
onSearch: e.onSearch,
|
|
2697
|
+
onClear: e.onSearchClear
|
|
2698
|
+
}, null, 8, [
|
|
2699
|
+
"modelValue",
|
|
2700
|
+
"instance",
|
|
2701
|
+
"product-id",
|
|
2702
|
+
"relationship-type",
|
|
2703
|
+
"relationship-code",
|
|
2704
|
+
"filter-criteria",
|
|
2705
|
+
"t",
|
|
2706
|
+
"onSearch",
|
|
2707
|
+
"onClear"
|
|
2708
|
+
])])) : I("", !0)
|
|
2709
|
+
]),
|
|
2710
|
+
e.isTableMode ? (U(), L("div", Mr, [K(e.$slots, "search-table", {}, () => [B(te, {
|
|
2711
|
+
products: e.products,
|
|
2712
|
+
"relationship-columns": e.columns,
|
|
2713
|
+
instance: e.instance,
|
|
2714
|
+
t: e.t,
|
|
2715
|
+
emit: e.emit,
|
|
2716
|
+
relationship: e.relationship,
|
|
2717
|
+
"action-template": e.actionTemplate
|
|
2718
|
+
}, null, 8, [
|
|
2719
|
+
"products",
|
|
2720
|
+
"relationship-columns",
|
|
2721
|
+
"instance",
|
|
2722
|
+
"t",
|
|
2723
|
+
"emit",
|
|
2724
|
+
"relationship",
|
|
2725
|
+
"action-template"
|
|
2726
|
+
])])])) : I("", !0),
|
|
2727
|
+
e.isListMode ? (U(), L("div", Nr, [K(e.$slots, "search-list", {}, () => [B(ne, {
|
|
2728
|
+
products: e.products,
|
|
2729
|
+
instance: e.instance,
|
|
2730
|
+
t: e.t,
|
|
2731
|
+
emit: e.emit
|
|
2732
|
+
}, null, 8, [
|
|
2733
|
+
"products",
|
|
2734
|
+
"instance",
|
|
2735
|
+
"t",
|
|
2736
|
+
"emit"
|
|
2737
|
+
])])])) : I("", !0),
|
|
2738
|
+
e.pageCount > 1 ? (U(), L("div", Pr, [B(x, {
|
|
2739
|
+
total: e.pageCount,
|
|
2740
|
+
current: e.page,
|
|
2741
|
+
onChange: e.onPageChange
|
|
2742
|
+
}, null, 8, [
|
|
2743
|
+
"total",
|
|
2744
|
+
"current",
|
|
2745
|
+
"onChange"
|
|
2746
|
+
])])) : I("", !0)
|
|
2747
|
+
], 64);
|
|
2748
|
+
}
|
|
2749
|
+
var Ir = /*#__PURE__*/ j(ur, [["render", Fr]]), Lr = (e) => typeof CSS < "u" ? CSS.escape(e) : e.replace(/[^a-zA-Z0-9_-]/g, "\\$&"), Rr = (e) => `pis-anchor-prm-${Lr(e)}`, zr = (e) => `#${Lr(e)}`, Br = (e) => {
|
|
2750
|
+
let t = P(() => {
|
|
2751
|
+
var t;
|
|
2752
|
+
return (t = e.value) == null || (t = t.store.options.components) == null || (t = t.common) == null ? void 0 : t.hideWhereUsed;
|
|
2753
|
+
}), n = P(() => {
|
|
2754
|
+
var t, n, r;
|
|
2755
|
+
let i = (t = e.value) == null ? void 0 : t.store, a = {
|
|
2756
|
+
agms: [],
|
|
2757
|
+
prms: []
|
|
2758
|
+
}, o = [...(i == null || (n = i.data.attributeGroups) == null ? void 0 : n.items) || []], s = [...(i == null || (r = i.data.prm) == null ? void 0 : r.items) || []];
|
|
2759
|
+
for (let e of o) {
|
|
2760
|
+
var c;
|
|
2761
|
+
let t = {
|
|
2762
|
+
prms: [],
|
|
2763
|
+
attributeGroup: e
|
|
2764
|
+
};
|
|
2765
|
+
if ((c = e.relationshipCodes) != null && c.length) {
|
|
2766
|
+
let n = new Set(e.relationshipCodes);
|
|
2767
|
+
t.prms = s.filter((e) => n.has(e.code)), t.prms.forEach((e) => s.splice(s.indexOf(e), 1));
|
|
2768
|
+
}
|
|
2769
|
+
a.agms.push(t);
|
|
2770
|
+
}
|
|
2771
|
+
return a.prms = s, a;
|
|
2772
|
+
});
|
|
2773
|
+
return {
|
|
2774
|
+
prmData: n,
|
|
2775
|
+
visibleAgmData: P(() => n.value.agms.reduce((e, n) => n.attributeGroup.visible ? e.concat([{
|
|
2776
|
+
attributeGroup: n.attributeGroup,
|
|
2777
|
+
prms: n.prms.filter((e) => !t.value || e.type !== Fe.WHERE_USED && e.type !== Fe.SPARE_PART_USED_ON_LIST)
|
|
2778
|
+
}]) : e, [])),
|
|
2779
|
+
visiblePrmData: P(() => n.value.prms.reduce((e, n) => !t.value || n.type !== Fe.WHERE_USED && n.type !== Fe.SPARE_PART_USED_ON_LIST ? e.concat([n]) : e, []))
|
|
2780
|
+
};
|
|
2781
|
+
}, Vr = V({
|
|
2782
|
+
name: "pis-products-details-attribute-groups",
|
|
2783
|
+
components: {
|
|
2784
|
+
PrmList: Ir,
|
|
2785
|
+
AttributesTable: gt
|
|
2786
|
+
},
|
|
2787
|
+
props: { instanceId: {
|
|
2788
|
+
type: String,
|
|
2789
|
+
default: void 0
|
|
2790
|
+
} },
|
|
2791
|
+
setup(e) {
|
|
2792
|
+
let t = W(), { instance: n, componentName: r, isReady: i, isWebComponent: a, store: o, t: s, emit: c } = $(t, e.instanceId, [Q.AttributeGroups, Q.ProductRelationships]);
|
|
2793
|
+
return {
|
|
2794
|
+
root: t,
|
|
2795
|
+
componentName: r,
|
|
2796
|
+
isReady: i,
|
|
2797
|
+
isWebComponent: a,
|
|
2798
|
+
store: o,
|
|
2799
|
+
instance: n,
|
|
2800
|
+
hideDocumentLinks: P(() => {
|
|
2801
|
+
var e;
|
|
2802
|
+
return ((e = o.value) == null || (e = e.options.components) == null || (e = e.common) == null ? void 0 : e.hideDocumentLinks) == 1;
|
|
2803
|
+
}),
|
|
2804
|
+
prmDataFiltered: Br(n).visibleAgmData,
|
|
2805
|
+
productId: P(() => {
|
|
2806
|
+
var e;
|
|
2807
|
+
return (e = o.value) == null || (e = e.data.productDetail) == null || (e = e.item) == null ? void 0 : e.productId;
|
|
2808
|
+
}),
|
|
2809
|
+
t: s,
|
|
2810
|
+
emit: c,
|
|
2811
|
+
buildPrmAnchorId: Rr
|
|
2812
|
+
};
|
|
2813
|
+
}
|
|
2814
|
+
}), Hr = { key: 0 }, Ur = ["id"], Wr = { class: "pis-heading ext-attr-group-heading" }, Gr = { class: "ext-attr-group-content" }, Kr = ["id"], qr = { class: "" }, Jr = { class: "ext-attr-group-content" };
|
|
2815
|
+
function Yr(e, t, n, r, i, a) {
|
|
2816
|
+
let o = q("AttributesTable"), s = q("PrmList");
|
|
2817
|
+
return U(), L("div", {
|
|
2818
|
+
ref: "root",
|
|
2819
|
+
class: H(["pis-component", e.componentName])
|
|
2820
|
+
}, [e.isReady ? (U(), L("div", Hr, [(U(!0), L(N, null, G(e.prmDataFiltered, (t, n) => (U(), L("div", {
|
|
2821
|
+
key: n,
|
|
2822
|
+
class: "mt-4 ext-attr-group"
|
|
2823
|
+
}, [R("div", {
|
|
2824
|
+
id: `pis-anchor-agm-${t.attributeGroup.code}`,
|
|
2825
|
+
class: "ext-attr-group-inner"
|
|
2826
|
+
}, [
|
|
2827
|
+
R("h4", Wr, J(t.attributeGroup.description), 1),
|
|
2828
|
+
R("div", Gr, [t.attributeGroup.attributes ? (U(), F(o, {
|
|
2829
|
+
key: 0,
|
|
2830
|
+
attributes: t.attributeGroup.attributes,
|
|
2831
|
+
instance: e.instance,
|
|
2832
|
+
"hide-document-links": e.hideDocumentLinks,
|
|
2833
|
+
t: e.t
|
|
2834
|
+
}, null, 8, [
|
|
2835
|
+
"attributes",
|
|
2836
|
+
"instance",
|
|
2837
|
+
"hide-document-links",
|
|
2838
|
+
"t"
|
|
2839
|
+
])) : I("", !0)]),
|
|
2840
|
+
(U(!0), L(N, null, G(t.prms, (t) => (U(), L("div", {
|
|
2841
|
+
key: t.code,
|
|
2842
|
+
class: "ext-attr-group-list"
|
|
2843
|
+
}, [t && e.productId ? (U(), L("div", {
|
|
2844
|
+
key: 0,
|
|
2845
|
+
id: e.buildPrmAnchorId(t.code),
|
|
2846
|
+
class: "ps-lg-3"
|
|
2847
|
+
}, [R("h5", qr, J(t.description), 1), R("div", Jr, [B(s, {
|
|
2848
|
+
relationship: t,
|
|
2849
|
+
instance: e.instance,
|
|
2850
|
+
"product-id": e.productId,
|
|
2851
|
+
t: e.t,
|
|
2852
|
+
emit: e.emit
|
|
2853
|
+
}, null, 8, [
|
|
2854
|
+
"relationship",
|
|
2855
|
+
"instance",
|
|
2856
|
+
"product-id",
|
|
2857
|
+
"t",
|
|
2858
|
+
"emit"
|
|
2859
|
+
])])], 8, Kr)) : I("", !0)]))), 128))
|
|
2860
|
+
], 8, Ur)]))), 128))])) : I("", !0)], 2);
|
|
2861
|
+
}
|
|
2862
|
+
var Xr = /*#__PURE__*/ j(Vr, [["render", Yr]]), Zr = V({
|
|
2863
|
+
name: "pis-products-details-classifications",
|
|
2864
|
+
components: { Message: it },
|
|
2865
|
+
props: { instanceId: {
|
|
2866
|
+
type: String,
|
|
2867
|
+
default: void 0
|
|
2868
|
+
} },
|
|
2869
|
+
setup(e) {
|
|
2870
|
+
let t = W(), { instance: n, componentName: r, isReady: i, isWebComponent: a, store: o, t: s } = $(t, e.instanceId, [Q.ProductClassifications]);
|
|
2871
|
+
return {
|
|
2872
|
+
root: t,
|
|
2873
|
+
componentName: r,
|
|
2874
|
+
isReady: i,
|
|
2875
|
+
isWebComponent: a,
|
|
2876
|
+
store: o,
|
|
2877
|
+
classifications: P(() => {
|
|
2878
|
+
var e;
|
|
2879
|
+
return (e = o.value) == null || (e = e.data.productClassifications) == null ? void 0 : e.items;
|
|
2880
|
+
}),
|
|
2881
|
+
setCategory: async (e) => {
|
|
2882
|
+
if (n.value && e) try {
|
|
2883
|
+
await n.value.execute(new ut({
|
|
2884
|
+
cid: e.cid,
|
|
2885
|
+
clearSearch: !0
|
|
2886
|
+
}).from(r));
|
|
2887
|
+
} catch {}
|
|
2888
|
+
},
|
|
2889
|
+
t: s
|
|
2890
|
+
};
|
|
2891
|
+
}
|
|
2892
|
+
}), Qr = { key: 0 }, $r = { key: 0 }, ei = { class: "fw-bold ext-class-group" }, ti = { class: "ext-class-nodes" }, ni = { key: 0 }, ri = ["onClick"], ii = {
|
|
2893
|
+
key: 2,
|
|
2894
|
+
class: "px-1 ext-class-arrow"
|
|
2895
|
+
};
|
|
2896
|
+
function ai(e, t, n, r, i, a) {
|
|
2897
|
+
let o = q("Message");
|
|
2898
|
+
return U(), L("div", {
|
|
2899
|
+
ref: "root",
|
|
2900
|
+
class: H(["pis-component", e.componentName])
|
|
2901
|
+
}, [e.isReady ? (U(), L("div", Qr, [e.classifications ? (U(), L("div", $r, [R("ul", null, [(U(!0), L(N, null, G(e.classifications, (t, n) => (U(), L("li", { key: n }, [R("span", ei, J(n), 1), R("ul", null, [(U(!0), L(N, null, G(t, (t, n) => (U(), L("li", { key: n }, [R("div", ti, [(U(!0), L(N, null, G(t, (n, r) => (U(), L("span", {
|
|
2902
|
+
key: n.cid,
|
|
2903
|
+
class: "ext-class-node"
|
|
2904
|
+
}, [n.inactive ? (U(), L("span", ni, J(n.name), 1)) : (U(), L("a", {
|
|
2905
|
+
key: 1,
|
|
2906
|
+
href: "#",
|
|
2907
|
+
onClick: Z((t) => e.setCategory(n), ["prevent"])
|
|
2908
|
+
}, J(n.name), 9, ri)), r + 1 < t.length ? (U(), L("span", ii, "›")) : I("", !0)]))), 128))])]))), 128))])]))), 128))])])) : (U(), F(o, {
|
|
2909
|
+
key: 1,
|
|
2910
|
+
class: "p-2"
|
|
2911
|
+
}, {
|
|
2912
|
+
default: Y(() => [z(J(e.t("ProductNotClassified")), 1)]),
|
|
2913
|
+
_: 1
|
|
2914
|
+
}))])) : I("", !0)], 2);
|
|
2915
|
+
}
|
|
2916
|
+
var oi = /*#__PURE__*/ j(Zr, [["render", ai]]), si = V({
|
|
2917
|
+
name: "pis-products-details-general-information",
|
|
2918
|
+
components: { AttributesTable: gt },
|
|
2919
|
+
props: { instanceId: {
|
|
2920
|
+
type: String,
|
|
2921
|
+
default: void 0
|
|
2922
|
+
} },
|
|
2923
|
+
setup(e) {
|
|
2924
|
+
let t = W(), { instance: n, componentName: r, isReady: i, isWebComponent: a, store: o, t: s } = $(t, e.instanceId, [k.PRODUCT_DETAILS]);
|
|
2925
|
+
return {
|
|
2926
|
+
root: t,
|
|
2927
|
+
componentName: r,
|
|
2928
|
+
isReady: i,
|
|
2929
|
+
isWebComponent: a,
|
|
2930
|
+
store: o,
|
|
2931
|
+
instance: n,
|
|
2932
|
+
item: P(() => {
|
|
2933
|
+
var e;
|
|
2934
|
+
return (e = o.value) == null || (e = e.data.productDetail) == null ? void 0 : e.item;
|
|
2935
|
+
}),
|
|
2936
|
+
hideDocumentLinks: P(() => {
|
|
2937
|
+
var e;
|
|
2938
|
+
return ((e = o.value) == null || (e = e.options.components) == null || (e = e.common) == null ? void 0 : e.hideDocumentLinks) == 1;
|
|
2939
|
+
}),
|
|
2940
|
+
t: s
|
|
2941
|
+
};
|
|
2942
|
+
}
|
|
2943
|
+
}), ci = { key: 0 }, li = { key: 0 }, ui = { class: "pis-heading ext-attr-group-heading" }, di = { class: "ext-attr-group-content" };
|
|
2944
|
+
function fi(e, t, n, r, i, a) {
|
|
2945
|
+
let o = q("AttributesTable");
|
|
2946
|
+
return U(), L("div", {
|
|
2947
|
+
ref: "root",
|
|
2948
|
+
class: H(["pis-component", e.componentName])
|
|
2949
|
+
}, [e.isReady ? (U(), L("div", ci, [e.item ? (U(), L("div", li, [R("h3", ui, J(e.t("GeneralInfo")), 1), R("div", di, [e.item.attributes ? (U(), F(o, {
|
|
2950
|
+
key: 0,
|
|
2951
|
+
attributes: e.item.attributes,
|
|
2952
|
+
instance: e.instance,
|
|
2953
|
+
"hide-document-links": e.hideDocumentLinks,
|
|
2954
|
+
t: e.t
|
|
2955
|
+
}, null, 8, [
|
|
2956
|
+
"attributes",
|
|
2957
|
+
"instance",
|
|
2958
|
+
"hide-document-links",
|
|
2959
|
+
"t"
|
|
2960
|
+
])) : I("", !0)])])) : I("", !0)])) : I("", !0)], 2);
|
|
2961
|
+
}
|
|
2962
|
+
var pi = /*#__PURE__*/ j(si, [["render", fi]]), mi = V({
|
|
2963
|
+
name: "pis-products-details-navigation",
|
|
2964
|
+
components: { Clickable: C },
|
|
2965
|
+
props: { instanceId: {
|
|
2966
|
+
type: String,
|
|
2967
|
+
default: void 0
|
|
2968
|
+
} },
|
|
2969
|
+
setup(e) {
|
|
2970
|
+
let t = W(), { instance: n, componentName: r, isReady: i, isWebComponent: a, store: o, widerThan: s, t: c } = $(t, e.instanceId, []), l = Br(n);
|
|
2971
|
+
return {
|
|
2972
|
+
root: t,
|
|
2973
|
+
componentName: r,
|
|
2974
|
+
isReady: i,
|
|
2975
|
+
isWebComponent: a,
|
|
2976
|
+
store: o,
|
|
2977
|
+
links: P(() => {
|
|
2978
|
+
var e, t, r;
|
|
2979
|
+
let i = [];
|
|
2980
|
+
return (e = n.value) != null && e.translations.translations ? (l.visibleAgmData.value.forEach((e) => i.push({
|
|
2981
|
+
text: e.attributeGroup.description,
|
|
2982
|
+
id: `pis-anchor-agm-${e.attributeGroup.code}`
|
|
2983
|
+
})), l.visiblePrmData.value.forEach((e) => i.push({
|
|
2984
|
+
text: e.description,
|
|
2985
|
+
id: Rr(e.code)
|
|
2986
|
+
})), (t = o.value) != null && (t = t.options.components) != null && (t = t.details) != null && (t = t.variantsTable) != null && t.visible && (((r = o.value) == null || (r = r.data.productVariantsTable) == null || (r = r.items) == null ? void 0 : r.length) ?? !1) && i.push({
|
|
2987
|
+
text: c("AllVariantProducts"),
|
|
2988
|
+
id: "pis-anchor-variants-table"
|
|
2989
|
+
}), i) : i;
|
|
2990
|
+
}),
|
|
2991
|
+
t: c,
|
|
2992
|
+
scrollToLink: (e) => {
|
|
2993
|
+
let t = document.querySelector(zr(e.id));
|
|
2994
|
+
t && t.scrollIntoView({ behavior: "smooth" });
|
|
2995
|
+
},
|
|
2996
|
+
widerThan: s
|
|
2997
|
+
};
|
|
2998
|
+
}
|
|
2999
|
+
}), hi = { key: 0 }, gi = {
|
|
3000
|
+
key: 0,
|
|
3001
|
+
class: "bg-light p-3"
|
|
3002
|
+
}, _i = { class: "fw-bold" }, vi = { class: "row" };
|
|
3003
|
+
function yi(e, t, n, r, i, a) {
|
|
3004
|
+
let o = q("Clickable");
|
|
3005
|
+
return U(), L("div", {
|
|
3006
|
+
ref: "root",
|
|
3007
|
+
class: H(["pis-component", e.componentName])
|
|
3008
|
+
}, [e.isReady ? (U(), L("div", hi, [e.links.length > 1 ? (U(), L("div", gi, [R("p", _i, J(e.t("GoToSection")) + ":", 1), R("div", vi, [(U(!0), L(N, null, G(e.links, (t) => (U(), L("div", {
|
|
3009
|
+
key: t.id,
|
|
3010
|
+
class: H([e.widerThan("lg") ? "col-6" : "col-12", "mb-1"])
|
|
3011
|
+
}, [B(o, {
|
|
3012
|
+
class: "text-body",
|
|
3013
|
+
"hover-mode": "background",
|
|
3014
|
+
onClick: (n) => e.scrollToLink(t)
|
|
3015
|
+
}, {
|
|
3016
|
+
default: Y(() => [z(J(t.text), 1)]),
|
|
3017
|
+
_: 2
|
|
3018
|
+
}, 1032, ["onClick"])], 2))), 128))])])) : I("", !0)])) : I("", !0)], 2);
|
|
3019
|
+
}
|
|
3020
|
+
var bi = /*#__PURE__*/ j(mi, [["render", yi]]), xi = V({
|
|
3021
|
+
components: {
|
|
3022
|
+
Card: pt,
|
|
3023
|
+
Image: Je
|
|
3024
|
+
},
|
|
3025
|
+
props: {
|
|
3026
|
+
imageSrc: {
|
|
3027
|
+
type: String,
|
|
3028
|
+
default: void 0
|
|
3029
|
+
},
|
|
3030
|
+
imageLoading: Boolean,
|
|
3031
|
+
inactive: Boolean,
|
|
3032
|
+
contentClickable: Boolean,
|
|
3033
|
+
wide: Boolean,
|
|
3034
|
+
useCardMarkup: {
|
|
3035
|
+
type: Boolean,
|
|
3036
|
+
default: !0
|
|
3037
|
+
},
|
|
3038
|
+
hideImage: Boolean,
|
|
3039
|
+
imageClickable: {
|
|
3040
|
+
type: Boolean,
|
|
3041
|
+
default: !0
|
|
3042
|
+
},
|
|
3043
|
+
imageWidth: {
|
|
3044
|
+
type: String,
|
|
3045
|
+
default: "8rem"
|
|
3046
|
+
},
|
|
3047
|
+
additionalColumnTemplateWidth: {
|
|
3048
|
+
type: Number,
|
|
3049
|
+
default: 2
|
|
3050
|
+
},
|
|
3051
|
+
actionTemplateWidth: {
|
|
3052
|
+
type: Number,
|
|
3053
|
+
default: 2
|
|
3054
|
+
}
|
|
3055
|
+
},
|
|
3056
|
+
emits: ["click-content"]
|
|
3057
|
+
}), Si = {
|
|
3058
|
+
key: 0,
|
|
3059
|
+
class: "flex-fill"
|
|
3060
|
+
}, Ci = { class: "position-relative" }, wi = { class: "col" };
|
|
3061
|
+
function Ti(e, t, n, r, i, a) {
|
|
3062
|
+
let o = q("Image"), s = q("Card");
|
|
3063
|
+
return U(), F(s, {
|
|
3064
|
+
class: H([e.useCardMarkup ? "mb-4" : "mb-5"]),
|
|
3065
|
+
"use-markup": e.useCardMarkup
|
|
3066
|
+
}, {
|
|
3067
|
+
default: Y(() => [K(e.$slots, "before"), R("div", { class: H(["row align-items-center mt-2", [e.$slots.before ? "ms-3" : ""]]) }, [
|
|
3068
|
+
R("div", {
|
|
3069
|
+
class: H(["mb-lg-2", {
|
|
3070
|
+
col: e.wide,
|
|
3071
|
+
"col-12": !e.wide
|
|
3072
|
+
}]),
|
|
3073
|
+
style: Et({ "max-width": e.wide ? e.imageWidth : "100%" })
|
|
3074
|
+
}, [e.hideImage ? I("", !0) : (U(), L("div", Si, [R("div", Ci, [B(o, {
|
|
3075
|
+
style: { width: "100%" },
|
|
3076
|
+
class: "flex-fill",
|
|
3077
|
+
src: e.imageSrc,
|
|
3078
|
+
"is-loading": e.imageLoading,
|
|
3079
|
+
clickable: e.imageClickable,
|
|
3080
|
+
"hide-frame": !0,
|
|
3081
|
+
onClick: t[0] || (t[0] = (t) => e.$emit("click-content"))
|
|
3082
|
+
}, null, 8, [
|
|
3083
|
+
"src",
|
|
3084
|
+
"is-loading",
|
|
3085
|
+
"clickable"
|
|
3086
|
+
]), K(e.$slots, "imageOverlay")])]))], 6),
|
|
3087
|
+
R("div", wi, [K(e.$slots, "content")]),
|
|
3088
|
+
e.$slots.additionalColumn ? (U(), L("div", {
|
|
3089
|
+
key: 0,
|
|
3090
|
+
class: H(["mt-lg-2", ["col-lg-" + e.additionalColumnTemplateWidth]])
|
|
3091
|
+
}, [R("div", { class: H([e.wide ? "ms-auto" : "mt-3"]) }, [K(e.$slots, "additionalColumn")], 2)], 2)) : I("", !0),
|
|
3092
|
+
!e.inactive && e.$slots.after ? (U(), L("div", {
|
|
3093
|
+
key: 1,
|
|
3094
|
+
class: H(["mt-lg-2", ["col-lg-" + e.actionTemplateWidth]])
|
|
3095
|
+
}, [R("div", { class: H([e.wide ? "ms-auto text-end" : "mt-3"]) }, [K(e.$slots, "after")], 2)], 2)) : I("", !0)
|
|
3096
|
+
], 2)]),
|
|
3097
|
+
_: 3
|
|
3098
|
+
}, 8, ["class", "use-markup"]);
|
|
3099
|
+
}
|
|
3100
|
+
//#endregion
|
|
3101
|
+
//#region src/products/components/details/ProductDetailsRelatedLinks.vue?vue&type=script&lang.ts
|
|
3102
|
+
var Ei = V({
|
|
3103
|
+
name: "pis-products-details-related-links",
|
|
3104
|
+
components: {
|
|
3105
|
+
Message: it,
|
|
3106
|
+
ProductsListItem: /* @__PURE__ */ j(xi, [["render", Ti]]),
|
|
3107
|
+
Tooltip: Ce,
|
|
3108
|
+
Icon: D
|
|
3109
|
+
},
|
|
3110
|
+
props: { instanceId: {
|
|
3111
|
+
type: String,
|
|
3112
|
+
default: void 0
|
|
3113
|
+
} },
|
|
3114
|
+
setup(e) {
|
|
3115
|
+
let t = W(), { componentName: n, isReady: r, isWebComponent: i, store: a, t: o, widerThan: s } = $(t, e.instanceId), c = P(() => {
|
|
3116
|
+
var e;
|
|
3117
|
+
return (e = a.value) == null || (e = e.data.relatedLinks) == null ? void 0 : e.items;
|
|
3118
|
+
});
|
|
3119
|
+
return {
|
|
3120
|
+
root: t,
|
|
3121
|
+
componentName: n,
|
|
3122
|
+
componentOptions: P(() => {
|
|
3123
|
+
var e;
|
|
3124
|
+
return ((e = a.value) == null || (e = e.options.components) == null || (e = e.details) == null ? void 0 : e.relatedLinks) ?? {};
|
|
3125
|
+
}),
|
|
3126
|
+
isReady: r,
|
|
3127
|
+
isWebComponent: i,
|
|
3128
|
+
store: a,
|
|
3129
|
+
relatedLinks: c,
|
|
3130
|
+
t: o,
|
|
3131
|
+
widerThan: s
|
|
3132
|
+
};
|
|
3133
|
+
}
|
|
3134
|
+
}), Di = { key: 0 }, Oi = ["href"];
|
|
3135
|
+
function ki(e, t, n, r, i, a) {
|
|
3136
|
+
var o;
|
|
3137
|
+
let s = q("Icon"), c = q("Tooltip"), l = q("ProductsListItem"), u = q("Message");
|
|
3138
|
+
return U(), L("div", {
|
|
3139
|
+
ref: "root",
|
|
3140
|
+
class: H(["pis-component", e.componentName])
|
|
3141
|
+
}, [e.componentOptions.visible && e.isReady ? (U(), L("div", Di, [(o = e.relatedLinks) != null && o.length ? (U(!0), L(N, { key: 0 }, G(e.relatedLinks, (t, n) => (U(), L("a", {
|
|
3142
|
+
key: n,
|
|
3143
|
+
target: "_blank",
|
|
3144
|
+
href: t.url ?? void 0
|
|
3145
|
+
}, [B(l, {
|
|
3146
|
+
"image-src": e.componentOptions.showImages ? t.image ?? void 0 : "",
|
|
3147
|
+
wide: e.widerThan("sm"),
|
|
3148
|
+
"hide-image": !e.componentOptions.showImages
|
|
3149
|
+
}, {
|
|
3150
|
+
content: Y(() => [t.internal ? (U(), F(c, {
|
|
3151
|
+
key: 0,
|
|
3152
|
+
text: e.t("Internal", !0)
|
|
3153
|
+
}, {
|
|
3154
|
+
default: Y(() => [B(s, {
|
|
3155
|
+
class: "text-warning text-end",
|
|
3156
|
+
name: "warning-triangle"
|
|
3157
|
+
})]),
|
|
3158
|
+
_: 1
|
|
3159
|
+
}, 8, ["text"])) : I("", !0), z(" " + J(t.text), 1)]),
|
|
3160
|
+
_: 2
|
|
3161
|
+
}, 1032, [
|
|
3162
|
+
"image-src",
|
|
3163
|
+
"wide",
|
|
3164
|
+
"hide-image"
|
|
3165
|
+
])], 8, Oi))), 128)) : (U(), F(u, {
|
|
3166
|
+
key: 1,
|
|
3167
|
+
class: "p-2"
|
|
3168
|
+
}, {
|
|
3169
|
+
default: Y(() => [z(J(e.t("RelatedLinksNotAvailable")), 1)]),
|
|
3170
|
+
_: 1
|
|
3171
|
+
}))])) : I("", !0)], 2);
|
|
3172
|
+
}
|
|
3173
|
+
var Ai = /*#__PURE__*/ j(Ei, [["render", ki]]), ji = V({
|
|
3174
|
+
name: "pis-products-details-relationships",
|
|
3175
|
+
components: { PrmList: Ir },
|
|
3176
|
+
props: { instanceId: {
|
|
3177
|
+
type: String,
|
|
3178
|
+
default: void 0
|
|
3179
|
+
} },
|
|
3180
|
+
setup(e) {
|
|
3181
|
+
let t = W(), { instance: n, componentName: r, isReady: i, isWebComponent: a, store: o, t: s, emit: c } = $(t, e.instanceId, [Q.ProductRelationships]);
|
|
3182
|
+
return {
|
|
3183
|
+
root: t,
|
|
3184
|
+
componentName: r,
|
|
3185
|
+
isReady: i,
|
|
3186
|
+
isWebComponent: a,
|
|
3187
|
+
store: o,
|
|
3188
|
+
instance: n,
|
|
3189
|
+
prmItems: Br(n).visiblePrmData,
|
|
3190
|
+
productId: P(() => {
|
|
3191
|
+
var e;
|
|
3192
|
+
return (e = o.value) == null || (e = e.data.productDetail) == null || (e = e.item) == null ? void 0 : e.productId;
|
|
3193
|
+
}),
|
|
3194
|
+
t: s,
|
|
3195
|
+
emit: c,
|
|
3196
|
+
buildPrmAnchorId: Rr
|
|
3197
|
+
};
|
|
3198
|
+
}
|
|
3199
|
+
}), Mi = { key: 0 }, Ni = ["id"], Pi = { class: "pis-heading" };
|
|
3200
|
+
function Fi(e, t, n, r, i, a) {
|
|
3201
|
+
let o = q("PrmList");
|
|
3202
|
+
return U(), L("div", {
|
|
3203
|
+
ref: "root",
|
|
3204
|
+
class: H(["pis-component", e.componentName])
|
|
3205
|
+
}, [e.isReady && e.productId ? (U(), L("div", Mi, [(U(!0), L(N, null, G(e.prmItems, (t) => (U(), L("div", {
|
|
3206
|
+
id: e.buildPrmAnchorId(t.code),
|
|
3207
|
+
key: t.code,
|
|
3208
|
+
class: "mt-4"
|
|
3209
|
+
}, [R("h4", Pi, J(t.description), 1), B(o, {
|
|
3210
|
+
relationship: t,
|
|
3211
|
+
instance: e.instance,
|
|
3212
|
+
"product-id": e.productId,
|
|
3213
|
+
t: e.t,
|
|
3214
|
+
emit: e.emit
|
|
3215
|
+
}, null, 8, [
|
|
3216
|
+
"relationship",
|
|
3217
|
+
"instance",
|
|
3218
|
+
"product-id",
|
|
3219
|
+
"t",
|
|
3220
|
+
"emit"
|
|
3221
|
+
])], 8, Ni))), 128))])) : I("", !0)], 2);
|
|
3222
|
+
}
|
|
3223
|
+
var Ii = /*#__PURE__*/ j(ji, [["render", Fi]]), Li = V({
|
|
3224
|
+
name: "pis-products-details-variants-dropdown",
|
|
3225
|
+
components: {
|
|
3226
|
+
Icon: D,
|
|
3227
|
+
Dropdown: Ae,
|
|
3228
|
+
Clickable: C
|
|
3229
|
+
},
|
|
3230
|
+
props: { instanceId: {
|
|
3231
|
+
type: String,
|
|
3232
|
+
default: void 0
|
|
3233
|
+
} },
|
|
3234
|
+
setup(e) {
|
|
3235
|
+
let t = W(), n = W(!1), { componentName: r, isReady: i, isWebComponent: a, instance: o, store: s, t: c, routeData: l } = $(t, e.instanceId), u = P(() => {
|
|
3236
|
+
var e;
|
|
3237
|
+
return ((e = s.value) == null || (e = e.options.components) == null || (e = e.details) == null ? void 0 : e.variantsDropdown) ?? {};
|
|
3238
|
+
}), d = P(() => {
|
|
3239
|
+
var e, t;
|
|
3240
|
+
return (e = s.value) != null && (e = e.data.productVariantsDropdown) != null && (e = e.items) != null && e.length ? (t = s.value) == null ? void 0 : t.data.productVariantsDropdown.items : [];
|
|
3241
|
+
}), f = P(() => {
|
|
3242
|
+
var e;
|
|
3243
|
+
return u.value.visible !== !1 && (((e = d.value) == null ? void 0 : e.length) ?? 0) > 0;
|
|
3244
|
+
}), p = P(() => {
|
|
3245
|
+
var e;
|
|
3246
|
+
let t = [];
|
|
3247
|
+
return (e = d.value) != null && e.length && d.value.forEach((e) => {
|
|
3248
|
+
var n;
|
|
3249
|
+
t.push({
|
|
3250
|
+
type: "group",
|
|
3251
|
+
value: e
|
|
3252
|
+
}), (n = e.products) == null || n.forEach((e) => {
|
|
3253
|
+
t.push({
|
|
3254
|
+
type: "product",
|
|
3255
|
+
value: e
|
|
3256
|
+
});
|
|
3257
|
+
});
|
|
3258
|
+
}), t;
|
|
3259
|
+
});
|
|
3260
|
+
return {
|
|
3261
|
+
root: t,
|
|
3262
|
+
componentName: r,
|
|
3263
|
+
isReady: i,
|
|
3264
|
+
isWebComponent: a,
|
|
3265
|
+
instance: o,
|
|
3266
|
+
store: s,
|
|
3267
|
+
t: c,
|
|
3268
|
+
componentOptions: u,
|
|
3269
|
+
variants: d,
|
|
3270
|
+
visible: f,
|
|
3271
|
+
isDropdownOpen: n,
|
|
3272
|
+
selectedProduct: P(() => {
|
|
3273
|
+
var e;
|
|
3274
|
+
return ((e = s.value) == null || (e = e.data.productDetail) == null ? void 0 : e.item) || {};
|
|
3275
|
+
}),
|
|
3276
|
+
dropdownItems: p,
|
|
3277
|
+
attrValue: v,
|
|
3278
|
+
toggleDropdown: () => {
|
|
3279
|
+
n.value = !n.value;
|
|
3280
|
+
},
|
|
3281
|
+
details: async (e) => {
|
|
3282
|
+
if (!(e != null && e.inactive) && l.value && e) {
|
|
3283
|
+
n.value = !1;
|
|
3284
|
+
try {
|
|
3285
|
+
var t;
|
|
3286
|
+
await ((t = o.value) == null ? void 0 : t.execute(new tt(e).from(r)));
|
|
3287
|
+
} catch {}
|
|
3288
|
+
}
|
|
3289
|
+
}
|
|
3290
|
+
};
|
|
3291
|
+
}
|
|
3292
|
+
}), Ri = { key: 0 }, zi = { class: "mb-4 ext-attr-group" }, Bi = { class: "row" }, Vi = { class: "col-12" }, Hi = {
|
|
3293
|
+
key: 0,
|
|
3294
|
+
class: "px-3 py-2 fw-semibold text-muted bg-light border-bottom small sticky-top"
|
|
3295
|
+
}, Ui = { class: "d-flex align-items-center" }, Wi = {
|
|
3296
|
+
key: 0,
|
|
3297
|
+
class: "me-2 flex-shrink-0",
|
|
3298
|
+
style: { width: "2.5rem" }
|
|
3299
|
+
}, Gi = ["src", "alt"], Ki = {
|
|
3300
|
+
key: 1,
|
|
3301
|
+
class: "d-flex align-items-center justify-content-center rounded border bg-light text-muted",
|
|
3302
|
+
style: {
|
|
3303
|
+
height: "2rem",
|
|
3304
|
+
"font-size": "1rem"
|
|
3305
|
+
}
|
|
3306
|
+
}, qi = { class: "flex-grow-1 overflow-hidden" }, Ji = { class: "fw-bold text-truncate" }, Yi = {
|
|
3307
|
+
key: 0,
|
|
3308
|
+
class: "small text-muted text-truncate"
|
|
3309
|
+
}, Xi = ["aria-expanded"], Zi = { class: "d-flex align-items-center flex-grow-1 w-100" }, Qi = {
|
|
3310
|
+
key: 0,
|
|
3311
|
+
class: "me-2 flex-shrink-0",
|
|
3312
|
+
style: { width: "2rem" }
|
|
3313
|
+
}, $i = ["src", "alt"], ea = {
|
|
3314
|
+
key: 1,
|
|
3315
|
+
class: "d-flex align-items-center justify-content-center rounded border bg-light text-muted",
|
|
3316
|
+
style: {
|
|
3317
|
+
height: "1.5rem",
|
|
3318
|
+
"font-size": "0.875rem"
|
|
3319
|
+
}
|
|
3320
|
+
}, ta = { class: "flex-grow-1 overflow-hidden" }, na = {
|
|
3321
|
+
key: 0,
|
|
3322
|
+
class: "text-truncate d-block"
|
|
3323
|
+
}, ra = { class: "fw-medium d-block text-truncate" }, ia = {
|
|
3324
|
+
key: 0,
|
|
3325
|
+
class: "text-muted small d-block text-truncate"
|
|
3326
|
+
}, aa = {
|
|
3327
|
+
key: 1,
|
|
3328
|
+
class: "text-muted"
|
|
3329
|
+
};
|
|
3330
|
+
function oa(e, t, n, r, i, a) {
|
|
3331
|
+
let o = q("Icon"), s = q("Clickable"), c = q("Dropdown"), l = kt("safe-html");
|
|
3332
|
+
return U(), L("div", {
|
|
3333
|
+
id: "pis-anchor-variants-dropdown",
|
|
3334
|
+
ref: "root",
|
|
3335
|
+
class: H(["pis-component", e.componentName])
|
|
3336
|
+
}, [e.isReady && e.visible ? (U(), L("div", Ri, [R("h4", null, J(e.t("Variants")), 1), R("div", zi, [R("div", Bi, [R("div", Vi, [B(c, {
|
|
3337
|
+
open: e.isDropdownOpen,
|
|
3338
|
+
"onUpdate:open": t[3] || (t[3] = (t) => e.isDropdownOpen = t),
|
|
3339
|
+
width: "100%",
|
|
3340
|
+
items: e.dropdownItems
|
|
3341
|
+
}, {
|
|
3342
|
+
item: Y(({ item: t }) => {
|
|
3343
|
+
var n;
|
|
3344
|
+
return [t.type === "group" ? (U(), L("div", Hi, [X(R("span", null, null, 512), [[l, t.value.attributeName + ": " + t.value.attributeValueText]])])) : t.type === "product" ? (U(), F(s, {
|
|
3345
|
+
key: 1,
|
|
3346
|
+
class: H(["dropdown-item py-2", { active: t.value.productId === ((n = e.selectedProduct) == null ? void 0 : n.productId) }]),
|
|
3347
|
+
onClick: (n) => e.details(t.value)
|
|
3348
|
+
}, {
|
|
3349
|
+
default: Y(() => {
|
|
3350
|
+
var n;
|
|
3351
|
+
return [R("div", Ui, [e.componentOptions.showImages === !1 ? I("", !0) : (U(), L("div", Wi, [(n = t.value.images) != null && n.length ? (U(), L("img", {
|
|
3352
|
+
key: 0,
|
|
3353
|
+
src: t.value.images[0].thumbnailUrl,
|
|
3354
|
+
alt: e.attrValue(t.value, "#DisplayName"),
|
|
3355
|
+
class: "img-fluid rounded border",
|
|
3356
|
+
style: {
|
|
3357
|
+
"max-height": "2rem",
|
|
3358
|
+
"object-fit": "contain"
|
|
3359
|
+
},
|
|
3360
|
+
loading: "lazy"
|
|
3361
|
+
}, null, 8, Gi)) : (U(), L("div", Ki, [B(o, { name: "photo-picture" })]))])), R("div", qi, [R("div", Ji, J(e.attrValue(t.value, "#DisplayName")), 1), e.attrValue(t.value, "CatalogDescription") ? (U(), L("div", Yi, J(e.attrValue(t.value, "CatalogDescription")), 1)) : I("", !0)])])];
|
|
3362
|
+
}),
|
|
3363
|
+
_: 2
|
|
3364
|
+
}, 1032, ["class", "onClick"])) : I("", !0)];
|
|
3365
|
+
}),
|
|
3366
|
+
activator: Y(({ on: n }) => {
|
|
3367
|
+
var r;
|
|
3368
|
+
return [R("div", Tt({
|
|
3369
|
+
class: "form-select d-flex align-items-center",
|
|
3370
|
+
tabindex: "0",
|
|
3371
|
+
role: "combobox",
|
|
3372
|
+
"aria-expanded": e.isDropdownOpen,
|
|
3373
|
+
"aria-haspopup": "listbox"
|
|
3374
|
+
}, jt(n, !0), {
|
|
3375
|
+
onClick: t[0] || (t[0] = (...t) => e.toggleDropdown && e.toggleDropdown(...t)),
|
|
3376
|
+
onKeydown: [t[1] || (t[1] = Pt((...t) => e.toggleDropdown && e.toggleDropdown(...t), ["enter"])), t[2] || (t[2] = Pt(Z((...t) => e.toggleDropdown && e.toggleDropdown(...t), ["prevent"]), ["space"]))]
|
|
3377
|
+
}), [R("div", Zi, [e.componentOptions.showImages !== !1 && e.selectedProduct ? (U(), L("div", Qi, [(r = e.selectedProduct.images) != null && r.length ? (U(), L("img", {
|
|
3378
|
+
key: 0,
|
|
3379
|
+
src: e.selectedProduct.images[0].thumbnailUrl,
|
|
3380
|
+
alt: e.selectedProduct && e.attrValue(e.selectedProduct, "#DisplayName"),
|
|
3381
|
+
class: "img-fluid rounded border",
|
|
3382
|
+
style: {
|
|
3383
|
+
"max-height": "1.5rem",
|
|
3384
|
+
"object-fit": "contain"
|
|
3385
|
+
}
|
|
3386
|
+
}, null, 8, $i)) : (U(), L("div", ea, [B(o, {
|
|
3387
|
+
name: "photo-picture",
|
|
3388
|
+
size: 16
|
|
3389
|
+
})]))])) : I("", !0), R("div", ta, [e.selectedProduct ? (U(), L("span", na, [R("span", ra, J(e.attrValue(e.selectedProduct, "#DisplayName")), 1), e.attrValue(e.selectedProduct, "CatalogDescription") ? (U(), L("span", ia, " (" + J(e.attrValue(e.selectedProduct, "CatalogDescription")) + ") ", 1)) : I("", !0)])) : (U(), L("span", aa, J(e.t("SelectProduct")), 1))])])], 16, Xi)];
|
|
3390
|
+
}),
|
|
3391
|
+
_: 1
|
|
3392
|
+
}, 8, ["open", "items"])])])])])) : I("", !0)], 2);
|
|
3393
|
+
}
|
|
3394
|
+
var sa = /*#__PURE__*/ j(Li, [["render", oa]]), ca = V({
|
|
3395
|
+
name: "pis-products-details-variants-selector",
|
|
3396
|
+
components: {
|
|
3397
|
+
Icon: D,
|
|
3398
|
+
Dropdown: Ae,
|
|
3399
|
+
Clickable: C
|
|
3400
|
+
},
|
|
3401
|
+
props: { instanceId: {
|
|
3402
|
+
type: String,
|
|
3403
|
+
default: void 0
|
|
3404
|
+
} },
|
|
3405
|
+
setup(e) {
|
|
3406
|
+
let t = W(), { componentName: n, isReady: r, isWebComponent: i, instance: a, store: o, t: s, routeData: c } = $(t, e.instanceId), l = P(() => {
|
|
3407
|
+
var e;
|
|
3408
|
+
return ((e = o.value) == null || (e = e.options.components) == null || (e = e.details) == null ? void 0 : e.variantsSelector) ?? {};
|
|
3409
|
+
}), u = P(() => {
|
|
3410
|
+
var e, t;
|
|
3411
|
+
return (e = o.value) != null && (e = e.data.productVariantsSelector) != null && (e = e.items) != null && e.length ? (t = o.value) == null ? void 0 : t.data.productVariantsSelector.items : [];
|
|
3412
|
+
}), d = P(() => {
|
|
3413
|
+
var e;
|
|
3414
|
+
return l.value.visible !== !1 && (((e = u.value) == null ? void 0 : e.length) ?? 0) > 0;
|
|
3415
|
+
}), f = (e) => {
|
|
3416
|
+
if (l.value.unavailableValuesBehavior === "hidden") {
|
|
3417
|
+
var t;
|
|
3418
|
+
return ((t = e.values) == null ? void 0 : t.filter((e) => e.match === !0)) || [];
|
|
3419
|
+
}
|
|
3420
|
+
return e.values || [];
|
|
3421
|
+
}, p = W({});
|
|
3422
|
+
return {
|
|
3423
|
+
root: t,
|
|
3424
|
+
componentName: n,
|
|
3425
|
+
isReady: r,
|
|
3426
|
+
isWebComponent: i,
|
|
3427
|
+
store: o,
|
|
3428
|
+
t: s,
|
|
3429
|
+
componentOptions: l,
|
|
3430
|
+
variants: u,
|
|
3431
|
+
visible: d,
|
|
3432
|
+
isDropdownOpen: p,
|
|
3433
|
+
VariantAttributeDisplayModeEnum: Se,
|
|
3434
|
+
getVariantValues: f,
|
|
3435
|
+
details: async (e) => {
|
|
3436
|
+
var t;
|
|
3437
|
+
if (!((t = e.product) != null && t.inactive) && !(l.value.unavailableValuesBehavior === "disabled" && !e.match) && c.value && e.product) try {
|
|
3438
|
+
var r;
|
|
3439
|
+
await ((r = a.value) == null ? void 0 : r.execute(new tt(e.product).from(n)));
|
|
3440
|
+
} catch {}
|
|
3441
|
+
},
|
|
3442
|
+
toggleDropdown: (e) => {
|
|
3443
|
+
p.value[e] = !p.value[e];
|
|
3444
|
+
},
|
|
3445
|
+
getSelectedValue: (e) => {
|
|
3446
|
+
var t;
|
|
3447
|
+
return ((t = e.values) == null ? void 0 : t.find((e) => e.selected)) || null;
|
|
3448
|
+
},
|
|
3449
|
+
Clickable: C
|
|
3450
|
+
};
|
|
3451
|
+
}
|
|
3452
|
+
}), la = { key: 0 }, ua = { class: "mb-4 ext-attr-group" }, da = { class: "mb-3" }, fa = { class: "d-flex justify-content-between align-items-center mb-3" }, pa = { class: "fw-bold" }, ma = {
|
|
3453
|
+
key: 0,
|
|
3454
|
+
class: "variant-values"
|
|
3455
|
+
}, ha = {
|
|
3456
|
+
key: 0,
|
|
3457
|
+
class: "d-flex flex-wrap gap-2 mb-3"
|
|
3458
|
+
}, ga = ["disabled", "onClick"], _a = {
|
|
3459
|
+
key: 1,
|
|
3460
|
+
class: "mb-3"
|
|
3461
|
+
}, va = { class: "d-flex align-items-center" }, ya = {
|
|
3462
|
+
class: "me-2 flex-shrink-0",
|
|
3463
|
+
style: { width: "2rem" }
|
|
3464
|
+
}, ba = ["src", "alt"], xa = { class: "flex-grow-1 min-w-0" }, Sa = { class: "fw-medium text-truncate" }, Ca = [
|
|
3465
|
+
"aria-expanded",
|
|
3466
|
+
"onClick",
|
|
3467
|
+
"onKeydown"
|
|
3468
|
+
], wa = { class: "d-flex align-items-center flex-grow-1" }, Ta = {
|
|
3469
|
+
class: "me-2 flex-shrink-0",
|
|
3470
|
+
style: { width: "1.5rem" }
|
|
3471
|
+
}, Ea = ["src", "alt"], Da = { class: "flex-grow-1 min-w-0" }, Oa = { class: "text-truncate d-block" }, ka = { class: "fw-medium" }, Aa = {
|
|
3472
|
+
key: 1,
|
|
3473
|
+
class: "text-muted"
|
|
3474
|
+
}, ja = {
|
|
3475
|
+
key: 2,
|
|
3476
|
+
class: "mb-3"
|
|
3477
|
+
}, Ma = { class: "row g-2" }, Na = [
|
|
3478
|
+
"title",
|
|
3479
|
+
"onClick",
|
|
3480
|
+
"onKeydown"
|
|
3481
|
+
], Pa = {
|
|
3482
|
+
class: "variant-image-container d-flex align-items-center justify-content-center position-relative",
|
|
3483
|
+
style: {
|
|
3484
|
+
width: "100%",
|
|
3485
|
+
"aspect-ratio": "1",
|
|
3486
|
+
"min-height": "60px"
|
|
3487
|
+
}
|
|
3488
|
+
}, Fa = ["src", "alt"], Ia = {
|
|
3489
|
+
key: 1,
|
|
3490
|
+
class: "variant-image-placeholder text-muted d-flex align-items-center justify-content-center h-100"
|
|
3491
|
+
};
|
|
3492
|
+
function La(e, t, n, r, i, a) {
|
|
3493
|
+
let o = q("Clickable"), s = q("Dropdown"), c = q("Icon"), l = kt("safe-html");
|
|
3494
|
+
return U(), L("div", {
|
|
3495
|
+
ref: "root",
|
|
3496
|
+
class: H(["pis-component mt-4", e.componentName])
|
|
3497
|
+
}, [e.isReady && e.visible ? (U(), L("div", la, [R("div", ua, [R("h4", da, J(e.t("Variants")), 1), (U(!0), L(N, null, G(e.variants, (t, n) => (U(), L("div", {
|
|
3498
|
+
key: t.attributeCode || n,
|
|
3499
|
+
class: "mb-4"
|
|
3500
|
+
}, [R("div", fa, [R("div", null, [X(R("span", pa, null, 512), [[l, t.attributeName]])])]), e.getVariantValues(t).length ? (U(), L("div", ma, [t.displayMode === e.VariantAttributeDisplayModeEnum.PILLS ? (U(), L("div", ha, [(U(!0), L(N, null, G(e.getVariantValues(t), (t) => (U(), L("button", {
|
|
3501
|
+
key: t.attributeValueText,
|
|
3502
|
+
type: "button",
|
|
3503
|
+
class: H(["btn btn-sm", {
|
|
3504
|
+
active: t.selected,
|
|
3505
|
+
"btn-outline-primary": e.componentOptions.unavailableValuesBehavior !== "disabled" || t.match,
|
|
3506
|
+
"btn-outline-secondary": e.componentOptions.unavailableValuesBehavior === "disabled" && !t.match
|
|
3507
|
+
}]),
|
|
3508
|
+
disabled: e.componentOptions.unavailableValuesBehavior === "disabled" && !t.match,
|
|
3509
|
+
onClick: (n) => t.product && e.details(t)
|
|
3510
|
+
}, [R("span", null, J(t.attributeValueText), 1)], 10, ga))), 128))])) : t.displayMode === e.VariantAttributeDisplayModeEnum.DROPDOWN ? (U(), L("div", _a, [B(s, {
|
|
3511
|
+
open: e.isDropdownOpen[t.attributeCode || ""],
|
|
3512
|
+
"onUpdate:open": (n) => e.isDropdownOpen[t.attributeCode || ""] = n,
|
|
3513
|
+
width: "100%",
|
|
3514
|
+
items: e.getVariantValues(t).map((e) => ({
|
|
3515
|
+
type: "value",
|
|
3516
|
+
value: e
|
|
3517
|
+
}))
|
|
3518
|
+
}, {
|
|
3519
|
+
item: Y(({ item: n }) => [n.type === "value" ? (U(), F(o, {
|
|
3520
|
+
key: 0,
|
|
3521
|
+
class: H(["dropdown-item py-2", {
|
|
3522
|
+
active: n.value.selected,
|
|
3523
|
+
disabled: e.componentOptions.unavailableValuesBehavior === "disabled" && !n.value.match
|
|
3524
|
+
}]),
|
|
3525
|
+
onClick: (r) => {
|
|
3526
|
+
e.toggleDropdown(t.attributeCode || ""), e.details(n.value);
|
|
3527
|
+
}
|
|
3528
|
+
}, {
|
|
3529
|
+
default: Y(() => {
|
|
3530
|
+
var e;
|
|
3531
|
+
return [R("div", va, [R("div", ya, [(e = n.value.product) != null && (e = e.images) != null && e.length ? (U(), L("img", {
|
|
3532
|
+
key: 0,
|
|
3533
|
+
src: n.value.product.images[0].thumbnailUrl,
|
|
3534
|
+
alt: n.value.name,
|
|
3535
|
+
class: "img-fluid rounded border",
|
|
3536
|
+
style: {
|
|
3537
|
+
"max-height": "1.5rem",
|
|
3538
|
+
"object-fit": "contain"
|
|
3539
|
+
},
|
|
3540
|
+
loading: "lazy"
|
|
3541
|
+
}, null, 8, ba)) : I("", !0)]), R("div", xa, [R("div", Sa, J(n.value.attributeValueText), 1)])])];
|
|
3542
|
+
}),
|
|
3543
|
+
_: 2
|
|
3544
|
+
}, 1032, ["class", "onClick"])) : I("", !0)]),
|
|
3545
|
+
activator: Y(({ on: n }) => {
|
|
3546
|
+
var r, i;
|
|
3547
|
+
return [R("div", Tt({
|
|
3548
|
+
class: "form-select d-flex align-items-center",
|
|
3549
|
+
tabindex: "0",
|
|
3550
|
+
role: "combobox",
|
|
3551
|
+
"aria-expanded": e.isDropdownOpen[t.attributeCode || ""] ? "true" : "false",
|
|
3552
|
+
"aria-haspopup": "listbox",
|
|
3553
|
+
style: {
|
|
3554
|
+
cursor: "pointer",
|
|
3555
|
+
"background-color": "white"
|
|
3556
|
+
}
|
|
3557
|
+
}, jt(n, !0), {
|
|
3558
|
+
onClick: (n) => e.toggleDropdown(t.attributeCode || ""),
|
|
3559
|
+
onKeydown: [Pt((n) => e.toggleDropdown(t.attributeCode || ""), ["enter"]), Pt(Z((n) => e.toggleDropdown(t.attributeCode || ""), ["prevent"]), ["space"])]
|
|
3560
|
+
}), [R("div", wa, [e.getSelectedValue(t) ? (U(), L(N, { key: 0 }, [R("div", Ta, [(r = e.getSelectedValue(t).product) != null && (r = r.images) != null && r.length ? (U(), L("img", {
|
|
3561
|
+
key: 0,
|
|
3562
|
+
src: (i = e.getSelectedValue(t)) == null || (i = i.product) == null || (i = i.images) == null || (i = i[0]) == null ? void 0 : i.thumbnailUrl,
|
|
3563
|
+
alt: e.getSelectedValue(t).attributeValueText,
|
|
3564
|
+
class: "img-fluid rounded border",
|
|
3565
|
+
style: {
|
|
3566
|
+
"max-height": "1.5rem",
|
|
3567
|
+
"object-fit": "contain"
|
|
3568
|
+
}
|
|
3569
|
+
}, null, 8, Ea)) : I("", !0)]), R("div", Da, [R("span", Oa, [R("span", ka, J(e.getSelectedValue(t).attributeValueText), 1)])])], 64)) : (U(), L("span", Aa, J(e.t("SelectVariant")), 1))])], 16, Ca)];
|
|
3570
|
+
}),
|
|
3571
|
+
_: 2
|
|
3572
|
+
}, 1032, [
|
|
3573
|
+
"open",
|
|
3574
|
+
"onUpdate:open",
|
|
3575
|
+
"items"
|
|
3576
|
+
])])) : t.displayMode === e.VariantAttributeDisplayModeEnum.IMAGES ? (U(), L("div", ja, [R("div", Ma, [(U(!0), L(N, null, G(e.getVariantValues(t), (t) => {
|
|
3577
|
+
var n;
|
|
3578
|
+
return U(), L("div", {
|
|
3579
|
+
key: t.attributeValueText,
|
|
3580
|
+
class: "col-xl-2 col-lg-3 col-md-4 col-sm-4 col-4"
|
|
3581
|
+
}, [R("div", {
|
|
3582
|
+
class: H(["card h-100 text-center position-relative", {
|
|
3583
|
+
"border-primary": t.selected,
|
|
3584
|
+
"opacity-50": e.componentOptions.unavailableValuesBehavior === "disabled" && !t.match,
|
|
3585
|
+
"border-1": t.selected
|
|
3586
|
+
}]),
|
|
3587
|
+
title: t.attributeValueText,
|
|
3588
|
+
role: "button",
|
|
3589
|
+
tabindex: "0",
|
|
3590
|
+
style: Et({
|
|
3591
|
+
cursor: e.componentOptions.unavailableValuesBehavior === "disabled" && !t.match ? "not-allowed" : "pointer",
|
|
3592
|
+
transition: "all 0.15s ease-in-out"
|
|
3593
|
+
}),
|
|
3594
|
+
onClick: (n) => t.product && e.details(t),
|
|
3595
|
+
onKeydown: [Pt((n) => t.product && e.details(t), ["enter"]), Pt(Z((n) => t.product && e.details(t), ["prevent"]), ["space"])]
|
|
3596
|
+
}, [R("div", Pa, [R("div", null, [(n = t.product) != null && (n = n.images) != null && n.length ? (U(), L("img", {
|
|
3597
|
+
key: 0,
|
|
3598
|
+
src: t.product.images[0].thumbnailUrl,
|
|
3599
|
+
alt: t.attributeValueText,
|
|
3600
|
+
class: "variant-image img-fluid",
|
|
3601
|
+
style: {
|
|
3602
|
+
"max-height": "100%",
|
|
3603
|
+
"max-width": "100%",
|
|
3604
|
+
"object-fit": "contain"
|
|
3605
|
+
}
|
|
3606
|
+
}, null, 8, Fa)) : (U(), L("div", Ia, [B(c, {
|
|
3607
|
+
name: "photo-picture",
|
|
3608
|
+
size: 24
|
|
3609
|
+
})]))])])], 46, Na)]);
|
|
3610
|
+
}), 128))])])) : I("", !0)])) : I("", !0)]))), 128))])])) : I("", !0)], 2);
|
|
3611
|
+
}
|
|
3612
|
+
var Ra = /*#__PURE__*/ j(ca, [["render", La]]), za = V({
|
|
3613
|
+
name: "pis-products-details-variants-table",
|
|
3614
|
+
components: {
|
|
3615
|
+
Icon: D,
|
|
3616
|
+
Clickable: C,
|
|
3617
|
+
MountPoint: ue
|
|
3618
|
+
},
|
|
3619
|
+
props: { instanceId: {
|
|
3620
|
+
type: String,
|
|
3621
|
+
default: void 0
|
|
3622
|
+
} },
|
|
3623
|
+
setup(e) {
|
|
3624
|
+
let t = W(), { componentName: n, isReady: r, isWebComponent: i, instance: a, store: o, t: s, routeData: c } = $(t, e.instanceId), l = P(() => {
|
|
3625
|
+
var e;
|
|
3626
|
+
return ((e = o.value) == null || (e = e.options.components) == null || (e = e.details) == null ? void 0 : e.variantsTable) ?? {};
|
|
3627
|
+
}), u = P(() => {
|
|
3628
|
+
var e, t;
|
|
3629
|
+
return (e = o.value) != null && (e = e.data.productVariantsTable) != null && (e = e.items) != null && e.length ? (t = o.value) == null ? void 0 : t.data.productVariantsTable.items : [];
|
|
3630
|
+
}), d = P(() => {
|
|
3631
|
+
var e;
|
|
3632
|
+
return l.value.visible !== !1 && (((e = u.value) == null ? void 0 : e.length) ?? 0) > 0;
|
|
3633
|
+
}), f = W(), p = W(), m = (e) => {
|
|
3634
|
+
let t = u.value.find((t) => t.attributeCode === e);
|
|
3635
|
+
return (t == null ? void 0 : t.products) !== void 0 && t.variantAttributes !== void 0;
|
|
3636
|
+
}, h = P(() => u.value.find((e) => e.attributeCode === f.value));
|
|
3637
|
+
Nt(u, (e) => {
|
|
3638
|
+
var t, n;
|
|
3639
|
+
h.value || (f.value = ((t = e.find((e) => e.products !== void 0 && e.variantAttributes !== void 0)) == null ? void 0 : t.attributeCode) ?? ((n = e[0]) == null ? void 0 : n.attributeCode));
|
|
3640
|
+
}, { immediate: !0 });
|
|
3641
|
+
let g = async (e) => {
|
|
3642
|
+
if (e !== f.value && p.value !== e) {
|
|
3643
|
+
if (m(e)) {
|
|
3644
|
+
f.value = e;
|
|
3645
|
+
return;
|
|
3646
|
+
}
|
|
3647
|
+
p.value = e;
|
|
3648
|
+
try {
|
|
3649
|
+
var t;
|
|
3650
|
+
await ((t = a.value) == null ? void 0 : t.execute(new ot({ attributeCode: e }).from(n))), m(e) && (f.value = e);
|
|
3651
|
+
} catch {} finally {
|
|
3652
|
+
p.value === e && (p.value = void 0);
|
|
3653
|
+
}
|
|
3654
|
+
}
|
|
3655
|
+
}, _ = async (e) => {
|
|
3656
|
+
if (!(e != null && e.inactive) && c.value && e) try {
|
|
3657
|
+
var t;
|
|
3658
|
+
await ((t = a.value) == null ? void 0 : t.execute(new tt(e).from(n)));
|
|
3659
|
+
} catch {}
|
|
3660
|
+
}, y = xe((e) => ({
|
|
3661
|
+
col: e.col,
|
|
3662
|
+
group: e.group,
|
|
3663
|
+
item: e.item,
|
|
3664
|
+
instance: a.value,
|
|
3665
|
+
t: s,
|
|
3666
|
+
attrValue: v,
|
|
3667
|
+
details: _
|
|
3668
|
+
}));
|
|
3669
|
+
return {
|
|
3670
|
+
root: t,
|
|
3671
|
+
componentName: n,
|
|
3672
|
+
isReady: r,
|
|
3673
|
+
isWebComponent: i,
|
|
3674
|
+
instance: a,
|
|
3675
|
+
store: o,
|
|
3676
|
+
t: s,
|
|
3677
|
+
componentOptions: l,
|
|
3678
|
+
groups: u,
|
|
3679
|
+
selectedGroup: h,
|
|
3680
|
+
loadingAttributeCode: p,
|
|
3681
|
+
selectGroup: g,
|
|
3682
|
+
visible: d,
|
|
3683
|
+
attrValue: v,
|
|
3684
|
+
Clickable: C,
|
|
3685
|
+
details: _,
|
|
3686
|
+
reactiveContext: De,
|
|
3687
|
+
cellCtx: y
|
|
3688
|
+
};
|
|
3689
|
+
}
|
|
3690
|
+
}), Ba = { key: 0 }, Va = { class: "mb-4 ext-attr-group" }, Ha = { class: "pis-heading ext-attr-group-heading" }, Ua = ["aria-label"], Wa = [
|
|
3691
|
+
"aria-pressed",
|
|
3692
|
+
"aria-busy",
|
|
3693
|
+
"disabled",
|
|
3694
|
+
"onClick"
|
|
3695
|
+
], Ga = {
|
|
3696
|
+
key: 0,
|
|
3697
|
+
class: "mb-4"
|
|
3698
|
+
}, Ka = {
|
|
3699
|
+
class: "table-responsive position-relative d-none d-md-block",
|
|
3700
|
+
style: {
|
|
3701
|
+
"min-height": "3rem",
|
|
3702
|
+
"overflow-x": "auto"
|
|
3703
|
+
}
|
|
3704
|
+
}, qa = { class: "table table-sm table-striped" }, Ja = {
|
|
3705
|
+
key: 0,
|
|
3706
|
+
style: { width: "80px" }
|
|
3707
|
+
}, Ya = { class: "table-light" }, Xa = {
|
|
3708
|
+
key: 0,
|
|
3709
|
+
class: "text-center border-top-0 ps-4 pe-4"
|
|
3710
|
+
}, Za = {
|
|
3711
|
+
key: 0,
|
|
3712
|
+
class: "text-center align-middle"
|
|
3713
|
+
}, Qa = {
|
|
3714
|
+
key: 0,
|
|
3715
|
+
class: "d-flex align-items-center justify-content-center",
|
|
3716
|
+
style: { height: "40px" }
|
|
3717
|
+
}, $a = ["src"], eo = {
|
|
3718
|
+
key: 1,
|
|
3719
|
+
class: "d-flex align-items-center justify-content-center text-muted",
|
|
3720
|
+
style: { height: "40px" }
|
|
3721
|
+
}, to = { key: 1 }, no = {
|
|
3722
|
+
key: 1,
|
|
3723
|
+
class: "fw-bold"
|
|
3724
|
+
}, ro = { key: 2 }, io = { class: "d-flex flex-wrap gap-1" }, ao = { class: "mt-1" }, oo = {
|
|
3725
|
+
class: "badge bg-primary text-white variant-value-badge",
|
|
3726
|
+
style: { "font-size": "0.7rem" }
|
|
3727
|
+
}, so = { key: 3 }, co = { class: "d-md-none" }, lo = { class: "card-body p-3" }, uo = { class: "d-flex align-items-start mb-2" }, fo = {
|
|
3728
|
+
key: 0,
|
|
3729
|
+
class: "flex-shrink-0 me-3"
|
|
3730
|
+
}, po = {
|
|
3731
|
+
key: 0,
|
|
3732
|
+
style: {
|
|
3733
|
+
width: "60px",
|
|
3734
|
+
height: "60px"
|
|
3735
|
+
}
|
|
3736
|
+
}, mo = ["src"], ho = {
|
|
3737
|
+
key: 1,
|
|
3738
|
+
class: "d-flex align-items-center justify-content-center text-muted rounded border",
|
|
3739
|
+
style: {
|
|
3740
|
+
width: "60px",
|
|
3741
|
+
height: "60px"
|
|
3742
|
+
}
|
|
3743
|
+
}, go = { class: "flex-grow-1 min-w-0" }, _o = { class: "mb-2" }, vo = {
|
|
3744
|
+
key: 1,
|
|
3745
|
+
class: "fw-bold text-break"
|
|
3746
|
+
}, yo = { class: "mb-2" }, bo = {
|
|
3747
|
+
class: "badge bg-primary text-white variant-value-badge",
|
|
3748
|
+
style: { "font-size": "0.7rem" }
|
|
3749
|
+
}, xo = { class: "mb-3" }, So = { class: "d-flex flex-wrap gap-1" }, Co = { key: 0 }, wo = { class: "text-muted d-block" }, To = {
|
|
3750
|
+
key: 1,
|
|
3751
|
+
class: "text-break"
|
|
3752
|
+
};
|
|
3753
|
+
function Eo(e, t, n, r, i, a) {
|
|
3754
|
+
let o = q("MountPoint"), s = q("Icon"), c = q("Clickable"), l = kt("safe-html");
|
|
3755
|
+
return U(), L("div", {
|
|
3756
|
+
id: "pis-anchor-variants-table",
|
|
3757
|
+
ref: "root",
|
|
3758
|
+
class: H(["pis-component mt-4", e.componentName])
|
|
3759
|
+
}, [e.isReady && e.visible ? (U(), L("div", Ba, [R("div", Va, [
|
|
3760
|
+
R("h4", Ha, J(e.t("VariantProducts")), 1),
|
|
3761
|
+
R("div", {
|
|
3762
|
+
class: "d-flex flex-wrap gap-2 mb-3",
|
|
3763
|
+
role: "group",
|
|
3764
|
+
"aria-label": e.t("VariantProducts")
|
|
3765
|
+
}, [(U(!0), L(N, null, G(e.groups, (t) => {
|
|
3766
|
+
var n, r;
|
|
3767
|
+
return X((U(), L("button", {
|
|
3768
|
+
key: t.attributeCode,
|
|
3769
|
+
type: "button",
|
|
3770
|
+
class: H(["btn btn-sm variant-group-pill", t.attributeCode === ((n = e.selectedGroup) == null ? void 0 : n.attributeCode) ? "btn-primary" : "btn-outline-primary"]),
|
|
3771
|
+
"aria-pressed": t.attributeCode === ((r = e.selectedGroup) == null ? void 0 : r.attributeCode),
|
|
3772
|
+
"aria-busy": e.loadingAttributeCode === t.attributeCode,
|
|
3773
|
+
disabled: e.loadingAttributeCode === t.attributeCode,
|
|
3774
|
+
onClick: (n) => e.selectGroup(t.attributeCode)
|
|
3775
|
+
}, null, 10, Wa)), [[l, t.attributeName + ": " + t.attributeValueText]]);
|
|
3776
|
+
}), 128))], 8, Ua),
|
|
3777
|
+
e.selectedGroup ? (U(), L("div", Ga, [R("div", Ka, [R("table", qa, [
|
|
3778
|
+
R("colgroup", null, [e.componentOptions.showImages === !1 ? I("", !0) : (U(), L("col", Ja)), (U(!0), L(N, null, G(e.componentOptions.columns, (e, t) => (U(), L("col", {
|
|
3779
|
+
key: t,
|
|
3780
|
+
style: Et({ width: e.width })
|
|
3781
|
+
}, null, 4))), 128))]),
|
|
3782
|
+
R("thead", Ya, [R("tr", null, [e.componentOptions.showImages === !1 ? I("", !0) : (U(), L("th", Xa, [...t[0] || (t[0] = [R("span", { class: "ms-1 me-1" }, null, -1)])])), (U(!0), L(N, null, G(e.componentOptions.columns, (t, n) => (U(), L("th", {
|
|
3783
|
+
key: n,
|
|
3784
|
+
class: "border-top-0"
|
|
3785
|
+
}, [t.headerTemplate ? (U(), F(o, {
|
|
3786
|
+
key: 0,
|
|
3787
|
+
callbacks: t.headerTemplate,
|
|
3788
|
+
ctx: e.reactiveContext({
|
|
3789
|
+
t: e.t,
|
|
3790
|
+
col: t
|
|
3791
|
+
})
|
|
3792
|
+
}, null, 8, ["callbacks", "ctx"])) : (U(), L(N, { key: 1 }, [z(J(t.caption), 1)], 64))]))), 128))])]),
|
|
3793
|
+
R("tbody", null, [(U(!0), L(N, null, G(e.selectedGroup.products ?? [], (t) => {
|
|
3794
|
+
var n;
|
|
3795
|
+
return U(), L("tr", { key: `${e.selectedGroup.attributeCode}-${t.productId}` }, [e.componentOptions.showImages === !1 ? I("", !0) : (U(), L("td", Za, [(n = t.images) != null && n.length ? (U(), L("div", Qa, [R("img", {
|
|
3796
|
+
src: t.images[0].thumbnailUrl,
|
|
3797
|
+
class: "img-fluid",
|
|
3798
|
+
style: {
|
|
3799
|
+
"max-height": "40px",
|
|
3800
|
+
"object-fit": "contain"
|
|
3801
|
+
}
|
|
3802
|
+
}, null, 8, $a)])) : (U(), L("div", eo, [B(s, {
|
|
3803
|
+
name: "photo-picture",
|
|
3804
|
+
size: 24
|
|
3805
|
+
})]))])), (U(!0), L(N, null, G(e.componentOptions.columns, (n, r) => (U(), L("td", {
|
|
3806
|
+
key: r,
|
|
3807
|
+
class: "align-middle"
|
|
3808
|
+
}, [n.cellTemplate ? (U(), F(o, {
|
|
3809
|
+
key: 0,
|
|
3810
|
+
callbacks: n.cellTemplate,
|
|
3811
|
+
ctx: e.cellCtx({
|
|
3812
|
+
item: t,
|
|
3813
|
+
col: n,
|
|
3814
|
+
group: e.selectedGroup
|
|
3815
|
+
})
|
|
3816
|
+
}, null, 8, ["callbacks", "ctx"])) : n.dataField === "ProductName" ? (U(), L("div", to, [t.productId ? (U(), F(c, {
|
|
3817
|
+
key: 0,
|
|
3818
|
+
class: "text-decoration-none fw-bold",
|
|
3819
|
+
onClick: (n) => e.details(t)
|
|
3820
|
+
}, {
|
|
3821
|
+
default: Y(() => [z(J(e.attrValue(t, "#DisplayName")), 1)]),
|
|
3822
|
+
_: 2
|
|
3823
|
+
}, 1032, ["onClick"])) : (U(), L("span", no, J(e.attrValue(t, "#DisplayName")), 1))])) : n.dataField === "VariantAttributes" ? (U(), L("div", ro, [R("div", io, [(U(!0), L(N, null, G(e.selectedGroup.variantAttributes ?? [], (n, r) => X((U(), L("span", {
|
|
3824
|
+
key: r,
|
|
3825
|
+
class: "badge bg-light text-dark border variant-value-badge"
|
|
3826
|
+
})), [[l, n.attributeName + ": " + e.attrValue(t, n.attributeCode)]])), 128))]), R("div", ao, [X(R("span", oo, null, 512), [[l, e.selectedGroup.attributeName + ": " + e.attrValue(t, e.selectedGroup.attributeCode)]])])])) : (U(), L("div", so, J(e.attrValue(t, n.dataField)), 1))]))), 128))]);
|
|
3827
|
+
}), 128))])
|
|
3828
|
+
])]), R("div", co, [(U(!0), L(N, null, G(e.selectedGroup.products ?? [], (t) => {
|
|
3829
|
+
var n;
|
|
3830
|
+
return U(), L("div", {
|
|
3831
|
+
key: `mobile-${e.selectedGroup.attributeCode}-${t.productId}`,
|
|
3832
|
+
class: "card mb-3 border"
|
|
3833
|
+
}, [R("div", lo, [
|
|
3834
|
+
R("div", uo, [e.componentOptions.showImages === !1 ? I("", !0) : (U(), L("div", fo, [(n = t.images) != null && n.length ? (U(), L("div", po, [R("img", {
|
|
3835
|
+
src: t.images[0].thumbnailUrl,
|
|
3836
|
+
class: "img-fluid rounded",
|
|
3837
|
+
style: {
|
|
3838
|
+
width: "100%",
|
|
3839
|
+
height: "100%",
|
|
3840
|
+
"object-fit": "contain",
|
|
3841
|
+
border: "1px solid #dee2e6"
|
|
3842
|
+
}
|
|
3843
|
+
}, null, 8, mo)])) : (U(), L("div", ho, [B(s, { name: "photo-picture" })]))])), R("div", go, [R("div", _o, [t.productId ? (U(), F(c, {
|
|
3844
|
+
key: 0,
|
|
3845
|
+
class: "text-decoration-none fw-bold text-break",
|
|
3846
|
+
onClick: (n) => e.details(t)
|
|
3847
|
+
}, {
|
|
3848
|
+
default: Y(() => [z(J(e.attrValue(t, "#DisplayName")), 1)]),
|
|
3849
|
+
_: 2
|
|
3850
|
+
}, 1032, ["onClick"])) : (U(), L("span", vo, J(e.attrValue(t, "#DisplayName")), 1))]), R("div", yo, [X(R("span", bo, null, 512), [[l, e.selectedGroup.attributeName + ": " + e.attrValue(t, e.selectedGroup.attributeCode)]])])])]),
|
|
3851
|
+
R("div", xo, [R("div", So, [(U(!0), L(N, null, G(e.selectedGroup.variantAttributes ?? [], (n, r) => X((U(), L("span", {
|
|
3852
|
+
key: r,
|
|
3853
|
+
class: "badge bg-light text-dark border variant-value-badge",
|
|
3854
|
+
style: { "font-size": "0.7rem" }
|
|
3855
|
+
})), [[l, n.attributeName + ": " + e.attrValue(t, n.attributeCode)]])), 128))])]),
|
|
3856
|
+
(U(!0), L(N, null, G(e.componentOptions.columns, (n, r) => (U(), L("div", {
|
|
3857
|
+
key: r,
|
|
3858
|
+
class: "mb-2"
|
|
3859
|
+
}, [n.dataField !== "ProductName" && n.dataField !== "VariantAttributes" ? (U(), L("div", Co, [R("small", wo, J(n.caption) + ":", 1), n.cellTemplate ? (U(), F(o, {
|
|
3860
|
+
key: 0,
|
|
3861
|
+
callbacks: n.cellTemplate,
|
|
3862
|
+
ctx: e.cellCtx({
|
|
3863
|
+
item: t,
|
|
3864
|
+
col: n,
|
|
3865
|
+
group: e.selectedGroup
|
|
3866
|
+
})
|
|
3867
|
+
}, null, 8, ["callbacks", "ctx"])) : (U(), L("span", To, J(e.attrValue(t, n.dataField) || "-"), 1))])) : I("", !0)]))), 128))
|
|
3868
|
+
])]);
|
|
3869
|
+
}), 128))])])) : I("", !0)
|
|
3870
|
+
])])) : I("", !0)], 2);
|
|
3871
|
+
}
|
|
3872
|
+
var Do = /*#__PURE__*/ j(za, [["render", Eo], ["__scopeId", "data-v-3fc29d33"]]), Oo = V({
|
|
3873
|
+
name: "pis-products-details-actions",
|
|
3874
|
+
components: { MountPoint: ue },
|
|
3875
|
+
props: { instanceId: {
|
|
3876
|
+
type: String,
|
|
3877
|
+
default: void 0
|
|
3878
|
+
} },
|
|
3879
|
+
setup(e) {
|
|
3880
|
+
let t = W(), { instance: n, componentName: r, isReady: i, isWebComponent: a, store: o, t: s, emit: c } = $(t, e.instanceId, []);
|
|
3881
|
+
return {
|
|
3882
|
+
root: t,
|
|
3883
|
+
componentName: r,
|
|
3884
|
+
isReady: i,
|
|
3885
|
+
isWebComponent: a,
|
|
3886
|
+
store: o,
|
|
3887
|
+
instance: n,
|
|
3888
|
+
item: P(() => {
|
|
3889
|
+
var e;
|
|
3890
|
+
return (e = o.value) == null || (e = e.data.productDetail) == null ? void 0 : e.item;
|
|
3891
|
+
}),
|
|
3892
|
+
componentOptions: P(() => {
|
|
3893
|
+
var e;
|
|
3894
|
+
return ((e = o.value) == null || (e = e.options.components) == null || (e = e.details) == null ? void 0 : e.actions) ?? {};
|
|
3895
|
+
}),
|
|
3896
|
+
emit: c,
|
|
3897
|
+
t: s,
|
|
3898
|
+
reactiveContext: De
|
|
3899
|
+
};
|
|
3900
|
+
}
|
|
3901
|
+
}), ko = { key: 0 }, Ao = {
|
|
3902
|
+
key: 0,
|
|
3903
|
+
class: "mt-2"
|
|
3904
|
+
};
|
|
3905
|
+
function jo(e, t, n, r, i, a) {
|
|
3906
|
+
let o = q("MountPoint");
|
|
3907
|
+
return U(), L("div", {
|
|
3908
|
+
ref: "root",
|
|
3909
|
+
class: H(["pis-component", e.componentName])
|
|
3910
|
+
}, [e.isReady && e.item ? (U(), L("div", ko, [e.componentOptions.actionTemplate ? (U(), L("div", Ao, [B(o, {
|
|
3911
|
+
callbacks: e.componentOptions.actionTemplate,
|
|
3912
|
+
ctx: e.reactiveContext({
|
|
3913
|
+
instance: e.instance,
|
|
3914
|
+
item: e.item,
|
|
3915
|
+
emit: e.emit,
|
|
3916
|
+
t: e.t
|
|
3917
|
+
})
|
|
3918
|
+
}, null, 8, ["callbacks", "ctx"])])) : I("", !0)])) : I("", !0)], 2);
|
|
3919
|
+
}
|
|
3920
|
+
var Mo = /*#__PURE__*/ j(Oo, [["render", jo]]), No = V({
|
|
3921
|
+
name: "Tab",
|
|
3922
|
+
props: {
|
|
3923
|
+
title: {
|
|
3924
|
+
type: String,
|
|
3925
|
+
default: void 0
|
|
3926
|
+
},
|
|
3927
|
+
icon: {
|
|
3928
|
+
type: String,
|
|
3929
|
+
default: void 0
|
|
3930
|
+
},
|
|
3931
|
+
loading: Boolean,
|
|
3932
|
+
count: {
|
|
3933
|
+
type: [String, Number],
|
|
3934
|
+
default: void 0
|
|
3935
|
+
},
|
|
3936
|
+
extclass: {
|
|
3937
|
+
type: String,
|
|
3938
|
+
default: void 0
|
|
3939
|
+
}
|
|
3940
|
+
}
|
|
3941
|
+
});
|
|
3942
|
+
//#endregion
|
|
3943
|
+
//#region src/common/components/Tab.vue
|
|
3944
|
+
function Po(e, t, n, r, i, a) {
|
|
3945
|
+
return K(e.$slots, "default");
|
|
3946
|
+
}
|
|
3947
|
+
var Fo = /*#__PURE__*/ j(No, [["render", Po]]), Io = 0, Lo = {
|
|
3948
|
+
xs: "pis-tabs-xs",
|
|
3949
|
+
sm: "pis-tabs-sm",
|
|
3950
|
+
md: "pis-tabs-md",
|
|
3951
|
+
lg: "pis-tabs-lg",
|
|
3952
|
+
xl: "pis-tabs-xl"
|
|
3953
|
+
}, Ro = {
|
|
3954
|
+
xs: 16,
|
|
3955
|
+
sm: 16,
|
|
3956
|
+
md: 16,
|
|
3957
|
+
lg: 24,
|
|
3958
|
+
xl: 24
|
|
3959
|
+
}, zo = (e) => e.flatMap((e) => e.type === Fo ? [e] : e.type === N && Array.isArray(e.children) ? zo(e.children) : []), Bo = V({
|
|
3960
|
+
name: "Tabs",
|
|
3961
|
+
components: {
|
|
3962
|
+
Clickable: C,
|
|
3963
|
+
Icon: D,
|
|
3964
|
+
Spinner: Ne
|
|
3965
|
+
},
|
|
3966
|
+
props: {
|
|
3967
|
+
modelValue: {
|
|
3968
|
+
type: Number,
|
|
3969
|
+
default: 0
|
|
3970
|
+
},
|
|
3971
|
+
desktop: Boolean,
|
|
3972
|
+
size: {
|
|
3973
|
+
type: String,
|
|
3974
|
+
default: "md"
|
|
3975
|
+
},
|
|
3976
|
+
variant: {
|
|
3977
|
+
type: String,
|
|
3978
|
+
default: "floating"
|
|
3979
|
+
},
|
|
3980
|
+
divider: Boolean
|
|
3981
|
+
},
|
|
3982
|
+
emits: ["update:modelValue"],
|
|
3983
|
+
setup(e, { slots: t }) {
|
|
3984
|
+
let n = P(() => t.default ? zo(t.default()) : []), r = P(() => [
|
|
3985
|
+
Lo[e.size] ?? Lo.md,
|
|
3986
|
+
e.variant === "panel" && "pis-tabs-panel",
|
|
3987
|
+
e.divider && "pis-tabs-divider"
|
|
3988
|
+
]), i = P(() => Ro[e.size] ?? 16), a = W("tabpanel");
|
|
3989
|
+
return Dt(() => {
|
|
3990
|
+
a.value = `pis-tabpanel-${++Io}`;
|
|
3991
|
+
}), {
|
|
3992
|
+
tabItems: n,
|
|
3993
|
+
listClasses: r,
|
|
3994
|
+
iconSize: i,
|
|
3995
|
+
idPrefix: a
|
|
3996
|
+
};
|
|
3997
|
+
}
|
|
3998
|
+
}), Vo = { key: 0 }, Ho = {
|
|
3999
|
+
key: 2,
|
|
4000
|
+
class: "badge rounded-pill bg-secondary text-body ms-1 small"
|
|
4001
|
+
}, Uo = ["id"], Wo = { key: 1 }, Go = { class: "my-4 d-flex align-items-center mb-0 mt-5" };
|
|
4002
|
+
function Ko(e, t, n, r, i, a) {
|
|
4003
|
+
let o = q("Icon"), s = q("Spinner"), c = q("Clickable");
|
|
4004
|
+
return e.desktop ? (U(), L("div", Vo, [R("ul", {
|
|
4005
|
+
class: H(["nav nav-tabs mb-3", e.listClasses]),
|
|
4006
|
+
role: "tablist"
|
|
4007
|
+
}, [(U(!0), L(N, null, G(e.tabItems, (t, n) => {
|
|
4008
|
+
var r;
|
|
4009
|
+
return U(), L("li", {
|
|
4010
|
+
key: n,
|
|
4011
|
+
class: H([(r = t.props) == null ? void 0 : r.extclass])
|
|
4012
|
+
}, [B(c, {
|
|
4013
|
+
class: H(["nav-link d-flex align-items-center", { active: n === e.modelValue }]),
|
|
4014
|
+
role: "tab",
|
|
4015
|
+
"aria-selected": n === e.modelValue ? "true" : "false",
|
|
4016
|
+
"aria-controls": `${e.idPrefix}-${n}`,
|
|
4017
|
+
onClick: (t) => e.$emit("update:modelValue", n)
|
|
4018
|
+
}, {
|
|
4019
|
+
default: Y(() => {
|
|
4020
|
+
var n, r, i, a, c;
|
|
4021
|
+
return [
|
|
4022
|
+
(n = t.props) != null && n.icon ? (U(), F(o, {
|
|
4023
|
+
key: 0,
|
|
4024
|
+
name: t.props.icon,
|
|
4025
|
+
class: "me-1",
|
|
4026
|
+
size: e.iconSize
|
|
4027
|
+
}, null, 8, ["name", "size"])) : I("", !0),
|
|
4028
|
+
z(" " + J((r = t.props) == null ? void 0 : r.title) + " ", 1),
|
|
4029
|
+
(i = t.props) != null && i.loading ? (U(), F(s, {
|
|
4030
|
+
key: 1,
|
|
4031
|
+
class: "ms-1",
|
|
4032
|
+
sm: ""
|
|
4033
|
+
})) : I("", !0),
|
|
4034
|
+
!((a = t.props) != null && a.loading) && (c = t.props) != null && c.count ? (U(), L("span", Ho, J(t.props.count), 1)) : I("", !0)
|
|
4035
|
+
];
|
|
4036
|
+
}),
|
|
4037
|
+
_: 2
|
|
4038
|
+
}, 1032, [
|
|
4039
|
+
"aria-selected",
|
|
4040
|
+
"aria-controls",
|
|
4041
|
+
"class",
|
|
4042
|
+
"onClick"
|
|
4043
|
+
])], 2);
|
|
4044
|
+
}), 128))], 2), (U(!0), L(N, null, G(e.tabItems, (t, n) => (U(), L("div", {
|
|
4045
|
+
id: `${e.idPrefix}-${n}`,
|
|
4046
|
+
key: n,
|
|
4047
|
+
role: "tabpanel",
|
|
4048
|
+
style: Et({ display: n === e.modelValue ? "block" : "none" })
|
|
4049
|
+
}, [(U(), F(At(t)))], 12, Uo))), 128))])) : (U(), L("div", Wo, [(U(!0), L(N, null, G(e.tabItems, (e, n) => {
|
|
4050
|
+
var r, i, a;
|
|
4051
|
+
return U(), L("div", { key: n }, [
|
|
4052
|
+
R("h4", Go, [(r = e.props) != null && r.isLoading ? (U(), F(s, {
|
|
4053
|
+
key: 0,
|
|
4054
|
+
class: "me-2",
|
|
4055
|
+
sm: ""
|
|
4056
|
+
})) : (i = e.props) != null && i.icon ? (U(), F(o, {
|
|
4057
|
+
key: 1,
|
|
4058
|
+
name: e.props.icon,
|
|
4059
|
+
class: "me-2"
|
|
4060
|
+
}, null, 8, ["name"])) : I("", !0), z(" " + J((a = e.props) == null ? void 0 : a.title), 1)]),
|
|
4061
|
+
t[0] || (t[0] = R("hr", {
|
|
4062
|
+
class: "mt-2",
|
|
4063
|
+
style: { height: "2px" }
|
|
4064
|
+
}, null, -1)),
|
|
4065
|
+
(U(), F(At(e)))
|
|
4066
|
+
]);
|
|
4067
|
+
}), 128))]));
|
|
4068
|
+
}
|
|
4069
|
+
//#endregion
|
|
4070
|
+
//#region src/products/components/details/ProductsDetailsData.vue?vue&type=script&lang.ts
|
|
4071
|
+
var qo = V({
|
|
4072
|
+
name: "pis-products-details-data",
|
|
4073
|
+
components: {
|
|
4074
|
+
Tabs: /* @__PURE__ */ j(Bo, [["render", Ko]]),
|
|
4075
|
+
Tab: Fo,
|
|
4076
|
+
NavigationBtns: dn,
|
|
4077
|
+
Icon: D,
|
|
4078
|
+
Btn: ve,
|
|
4079
|
+
ProductDetailsRelatedLinks: Ai,
|
|
4080
|
+
ProductDetailsAttributeGroups: Xr,
|
|
4081
|
+
ProductDetailsRelationships: Ii,
|
|
4082
|
+
ProductDetailsNavigation: bi,
|
|
4083
|
+
ProductDetailsClassifications: oi,
|
|
4084
|
+
Message: it,
|
|
4085
|
+
ProductDetailsVariantsTable: Do
|
|
4086
|
+
},
|
|
4087
|
+
props: { instanceId: {
|
|
4088
|
+
type: String,
|
|
4089
|
+
default: void 0
|
|
4090
|
+
} },
|
|
4091
|
+
setup(e) {
|
|
4092
|
+
let t = W(), n = W(0), { componentName: r, isReady: i, isWebComponent: a, instance: o, store: s, routeData: c, t: l, widerThan: u } = $(t, e.instanceId, [
|
|
4093
|
+
Q.ProductClassifications,
|
|
4094
|
+
Q.AttributeGroups,
|
|
4095
|
+
Q.ProductRelationships,
|
|
4096
|
+
Q.RelatedLinks
|
|
4097
|
+
]), d = P(() => {
|
|
4098
|
+
var e;
|
|
4099
|
+
return (e = s.value) == null || (e = e.options.components) == null || (e = e.details) == null ? void 0 : e.data;
|
|
4100
|
+
}), f = P(() => {
|
|
4101
|
+
var e;
|
|
4102
|
+
return (e = s.value) == null || (e = e.options.components) == null || (e = e.details) == null || (e = e.classifications) == null ? void 0 : e.visible;
|
|
4103
|
+
}), p = P(() => {
|
|
4104
|
+
var e;
|
|
4105
|
+
return (e = s.value) == null || (e = e.options.components) == null || (e = e.details) == null || (e = e.relatedLinks) == null ? void 0 : e.visible;
|
|
4106
|
+
}), m = P(() => {
|
|
4107
|
+
var e;
|
|
4108
|
+
return (e = s.value) == null || (e = e.options.components) == null || (e = e.details) == null || (e = e.data) == null || (e = e.downloads) == null ? void 0 : e.visible;
|
|
4109
|
+
}), h = P(() => {
|
|
4110
|
+
var e;
|
|
4111
|
+
return (e = s.value) == null || (e = e.options.components) == null || (e = e.details) == null || (e = e.data) == null || (e = e.downloads) == null ? void 0 : e.loading;
|
|
4112
|
+
}), g = P(() => {
|
|
4113
|
+
var e;
|
|
4114
|
+
return (e = s.value) == null || (e = e.options.components) == null || (e = e.details) == null || (e = e.data) == null || (e = e.downloads) == null ? void 0 : e.count;
|
|
4115
|
+
}), _ = P(() => {
|
|
4116
|
+
var e;
|
|
4117
|
+
return ((e = s.value) == null || (e = e.data.productDetail) == null ? void 0 : e.item) != null;
|
|
4118
|
+
}), v = P(() => {
|
|
4119
|
+
var e, t;
|
|
4120
|
+
if (!((e = d.value) != null && e.showTabCounts)) return;
|
|
4121
|
+
var n = (t = s.value) == null || (t = t.data.productClassifications) == null ? void 0 : t.items;
|
|
4122
|
+
if (!n) return 0;
|
|
4123
|
+
let r = 0;
|
|
4124
|
+
for (let e in n) n[e].forEach(() => {
|
|
4125
|
+
r++;
|
|
4126
|
+
});
|
|
4127
|
+
return r;
|
|
4128
|
+
}), y = P(() => {
|
|
4129
|
+
var e, t;
|
|
4130
|
+
if ((e = d.value) != null && e.showTabCounts) {
|
|
4131
|
+
var n = (t = s.value) == null || (t = t.data.relatedLinks) == null ? void 0 : t.items;
|
|
4132
|
+
return n ? n.length : 0;
|
|
4133
|
+
}
|
|
4134
|
+
});
|
|
4135
|
+
return Nt(() => {
|
|
4136
|
+
var e;
|
|
4137
|
+
return (e = c.value) == null ? void 0 : e.view;
|
|
4138
|
+
}, (e, t) => {
|
|
4139
|
+
e === "detail" && e !== t && (n.value = 0);
|
|
4140
|
+
}), {
|
|
4141
|
+
root: t,
|
|
4142
|
+
itemLoaded: _,
|
|
4143
|
+
currentTabIndex: n,
|
|
4144
|
+
componentName: r,
|
|
4145
|
+
isReady: i,
|
|
4146
|
+
isWebComponent: a,
|
|
4147
|
+
store: s,
|
|
4148
|
+
classifications: f,
|
|
4149
|
+
instance: o,
|
|
4150
|
+
downloads: m,
|
|
4151
|
+
downloadsLoading: h,
|
|
4152
|
+
downloadsCount: g,
|
|
4153
|
+
relatedLinks: p,
|
|
4154
|
+
componentOptions: d,
|
|
4155
|
+
classificationCount: v,
|
|
4156
|
+
relatedLinkCount: y,
|
|
4157
|
+
t: l,
|
|
4158
|
+
widerThan: u,
|
|
4159
|
+
scrollTop: async () => {
|
|
4160
|
+
try {
|
|
4161
|
+
var e, t;
|
|
4162
|
+
await ((e = o.value) == null ? void 0 : e.execute(new Ze({ productId: ((t = c.value) == null || (t = t.detail) == null ? void 0 : t.productId) || "" }).from(r)));
|
|
4163
|
+
} catch {}
|
|
4164
|
+
}
|
|
4165
|
+
};
|
|
4166
|
+
}
|
|
4167
|
+
});
|
|
4168
|
+
//#endregion
|
|
4169
|
+
//#region src/products/components/details/ProductsDetailsData.vue
|
|
4170
|
+
function Jo(e, t, n, r, i, a) {
|
|
4171
|
+
var o, s;
|
|
4172
|
+
let c = q("ProductDetailsNavigation"), l = q("ProductDetailsAttributeGroups"), u = q("ProductDetailsRelationships"), d = q("ProductDetailsVariantsTable"), f = q("Tab"), p = q("ProductDetailsClassifications"), m = q("Message"), h = q("ProductDetailsRelatedLinks"), g = q("Tabs"), _ = q("NavigationBtns"), v = q("Icon"), y = q("Btn");
|
|
4173
|
+
return U(), L("div", {
|
|
4174
|
+
ref: "root",
|
|
4175
|
+
class: H(["pis-component", e.componentName])
|
|
4176
|
+
}, [e.isReady && e.itemLoaded ? (U(), L(N, { key: 0 }, [B(g, {
|
|
4177
|
+
modelValue: e.currentTabIndex,
|
|
4178
|
+
"onUpdate:modelValue": t[0] || (t[0] = (t) => e.currentTabIndex = t),
|
|
4179
|
+
class: "mt-4",
|
|
4180
|
+
desktop: e.widerThan("md")
|
|
4181
|
+
}, {
|
|
4182
|
+
default: Y(() => {
|
|
4183
|
+
var t, n, r, i;
|
|
4184
|
+
return [
|
|
4185
|
+
B(f, {
|
|
4186
|
+
title: e.t("DetailsTabTitle"),
|
|
4187
|
+
icon: (t = e.componentOptions) != null && t.showTabIcons ? "file-document" : void 0,
|
|
4188
|
+
extclass: "ext-tab-details"
|
|
4189
|
+
}, {
|
|
4190
|
+
default: Y(() => [
|
|
4191
|
+
B(c, { "instance-id": e.instanceId }, null, 8, ["instance-id"]),
|
|
4192
|
+
B(l, { "instance-id": e.instanceId }, null, 8, ["instance-id"]),
|
|
4193
|
+
B(u, { "instance-id": e.instanceId }, null, 8, ["instance-id"]),
|
|
4194
|
+
B(d, { "instance-id": e.instanceId }, null, 8, ["instance-id"])
|
|
4195
|
+
]),
|
|
4196
|
+
_: 1
|
|
4197
|
+
}, 8, ["title", "icon"]),
|
|
4198
|
+
e.classifications ? (U(), F(f, {
|
|
4199
|
+
key: 0,
|
|
4200
|
+
title: e.t("CategoriesTabTitle"),
|
|
4201
|
+
icon: (n = e.componentOptions) != null && n.showTabIcons ? "folder-open" : void 0,
|
|
4202
|
+
extclass: "ext-tab-details",
|
|
4203
|
+
count: e.classificationCount
|
|
4204
|
+
}, {
|
|
4205
|
+
default: Y(() => [B(p, { "instance-id": e.instanceId }, null, 8, ["instance-id"])]),
|
|
4206
|
+
_: 1
|
|
4207
|
+
}, 8, [
|
|
4208
|
+
"title",
|
|
4209
|
+
"icon",
|
|
4210
|
+
"count"
|
|
4211
|
+
])) : I("", !0),
|
|
4212
|
+
e.downloads ? (U(), F(f, {
|
|
4213
|
+
key: 1,
|
|
4214
|
+
icon: (r = e.componentOptions) != null && r.showTabIcons ? "download" : void 0,
|
|
4215
|
+
title: e.t("DownloadsTabTitle"),
|
|
4216
|
+
loading: e.downloadsLoading,
|
|
4217
|
+
count: e.downloadsCount,
|
|
4218
|
+
extclass: "ext-tab-downloads"
|
|
4219
|
+
}, {
|
|
4220
|
+
default: Y(() => [K(e.$slots, "detail-downloads", {}, () => [B(m, { class: "p-2" }, {
|
|
4221
|
+
default: Y(() => [z(J(e.t("DownloadsNotAvailable")), 1)]),
|
|
4222
|
+
_: 1
|
|
4223
|
+
})])]),
|
|
4224
|
+
_: 3
|
|
4225
|
+
}, 8, [
|
|
4226
|
+
"icon",
|
|
4227
|
+
"title",
|
|
4228
|
+
"loading",
|
|
4229
|
+
"count"
|
|
4230
|
+
])) : I("", !0),
|
|
4231
|
+
e.relatedLinks ? (U(), F(f, {
|
|
4232
|
+
key: 2,
|
|
4233
|
+
title: e.t("LinksTabTitle"),
|
|
4234
|
+
icon: (i = e.componentOptions) != null && i.showTabIcons ? "link" : void 0,
|
|
4235
|
+
extclass: "ext-tab-related-links",
|
|
4236
|
+
count: e.relatedLinkCount
|
|
4237
|
+
}, {
|
|
4238
|
+
default: Y(() => [B(h, { "instance-id": e.instanceId }, null, 8, ["instance-id"])]),
|
|
4239
|
+
_: 1
|
|
4240
|
+
}, 8, [
|
|
4241
|
+
"title",
|
|
4242
|
+
"icon",
|
|
4243
|
+
"count"
|
|
4244
|
+
])) : I("", !0)
|
|
4245
|
+
];
|
|
4246
|
+
}),
|
|
4247
|
+
_: 3
|
|
4248
|
+
}, 8, ["modelValue", "desktop"]), ((o = e.componentOptions) == null ? void 0 : o.hideBottomNavigation) === !0 ? I("", !0) : (U(), L("div", {
|
|
4249
|
+
key: 0,
|
|
4250
|
+
class: H(["d-flex d-grid gap-3 justify-content-end align-items-center mt-4 pb-2", { "position-sticky bottom-0 bg-body": ((s = e.componentOptions) == null ? void 0 : s.bottomNavigationSticky) === !0 }]),
|
|
4251
|
+
style: { "z-index": "5" }
|
|
4252
|
+
}, [e.widerThan("sm") ? (U(), F(_, {
|
|
4253
|
+
key: 0,
|
|
4254
|
+
instance: e.instance,
|
|
4255
|
+
t: e.t
|
|
4256
|
+
}, null, 8, ["instance", "t"])) : I("", !0), B(y, {
|
|
4257
|
+
class: "ext-scroll-top",
|
|
4258
|
+
variant: "secondary",
|
|
4259
|
+
onClick: Z(e.scrollTop, ["prevent"])
|
|
4260
|
+
}, {
|
|
4261
|
+
default: Y(() => [B(v, {
|
|
4262
|
+
name: "arrow-up",
|
|
4263
|
+
size: 16,
|
|
4264
|
+
class: "me-2"
|
|
4265
|
+
}), z(" " + J(e.t("BackToTop")), 1)]),
|
|
4266
|
+
_: 1
|
|
4267
|
+
}, 8, ["onClick"])], 2))], 64)) : I("", !0)], 2);
|
|
4268
|
+
}
|
|
4269
|
+
var Yo = /*#__PURE__*/ j(qo, [["render", Jo]]), Xo = V({
|
|
4270
|
+
name: "pis-products-details-gallery",
|
|
4271
|
+
components: {
|
|
4272
|
+
ImageGallery: et,
|
|
4273
|
+
MountPoint: ue
|
|
4274
|
+
},
|
|
4275
|
+
props: {
|
|
4276
|
+
instanceId: {
|
|
4277
|
+
type: String,
|
|
4278
|
+
default: void 0
|
|
4279
|
+
},
|
|
4280
|
+
showPreview: {
|
|
4281
|
+
type: Boolean,
|
|
4282
|
+
default: !0
|
|
4283
|
+
}
|
|
4284
|
+
},
|
|
4285
|
+
setup(e) {
|
|
4286
|
+
let t = W(), { instance: n, componentName: r, isReady: i, isWebComponent: a, store: o, t: s, emit: c } = $(t, e.instanceId, [Q.Breadcrumbs, Q.ProductDetails]), l = P(() => {
|
|
4287
|
+
var e;
|
|
4288
|
+
return ((e = o.value) == null || (e = e.options.components) == null || (e = e.details) == null ? void 0 : e.gallery) ?? {};
|
|
4289
|
+
}), u = P(() => {
|
|
4290
|
+
var e;
|
|
4291
|
+
return ((e = o.value) == null ? void 0 : e.data.productDetail) || void 0;
|
|
4292
|
+
});
|
|
4293
|
+
return {
|
|
4294
|
+
root: t,
|
|
4295
|
+
componentName: r,
|
|
4296
|
+
componentOptions: l,
|
|
4297
|
+
isReady: i,
|
|
4298
|
+
isWebComponent: a,
|
|
4299
|
+
store: o,
|
|
4300
|
+
visible: P(() => {
|
|
4301
|
+
var e;
|
|
4302
|
+
return l.value.visible && ((e = u.value) == null ? void 0 : e.item);
|
|
4303
|
+
}),
|
|
4304
|
+
instance: n,
|
|
4305
|
+
productDetail: u,
|
|
4306
|
+
t: s,
|
|
4307
|
+
emit: c,
|
|
4308
|
+
reactiveContext: De
|
|
4309
|
+
};
|
|
4310
|
+
}
|
|
4311
|
+
}), Zo = { key: 0 }, Qo = { key: 0 };
|
|
4312
|
+
function $o(e, t, n, r, i, a) {
|
|
4313
|
+
var o;
|
|
4314
|
+
let s = q("MountPoint"), c = q("ImageGallery");
|
|
4315
|
+
return U(), L("div", {
|
|
4316
|
+
ref: "root",
|
|
4317
|
+
class: H(["pis-component", e.componentName])
|
|
4318
|
+
}, [e.isReady && e.visible ? (U(), L("div", Zo, [B(c, {
|
|
4319
|
+
"show-preview": e.showPreview,
|
|
4320
|
+
images: (o = e.productDetail) == null || (o = o.item) == null ? void 0 : o.images,
|
|
4321
|
+
"hide-thumbnails": e.componentOptions.hideThumbnailImages,
|
|
4322
|
+
"show-overlay-arrows": e.componentOptions.showOverlayArrows,
|
|
4323
|
+
title: e.t("ProductGallery")
|
|
4324
|
+
}, {
|
|
4325
|
+
default: Y(() => {
|
|
4326
|
+
var t;
|
|
4327
|
+
return [e.componentOptions.imageOverlayTemplate ? (U(), L("div", Qo, [B(s, {
|
|
4328
|
+
callbacks: e.componentOptions.imageOverlayTemplate,
|
|
4329
|
+
ctx: e.reactiveContext({
|
|
4330
|
+
instance: e.instance,
|
|
4331
|
+
item: (t = e.productDetail) == null ? void 0 : t.item,
|
|
4332
|
+
emit: e.emit,
|
|
4333
|
+
t: e.t
|
|
4334
|
+
})
|
|
4335
|
+
}, null, 8, ["callbacks", "ctx"])])) : I("", !0)];
|
|
4336
|
+
}),
|
|
4337
|
+
_: 1
|
|
4338
|
+
}, 8, [
|
|
4339
|
+
"show-preview",
|
|
4340
|
+
"images",
|
|
4341
|
+
"hide-thumbnails",
|
|
4342
|
+
"show-overlay-arrows",
|
|
4343
|
+
"title"
|
|
4344
|
+
])])) : I("", !0)], 2);
|
|
4345
|
+
}
|
|
4346
|
+
var es = /*#__PURE__*/ j(Xo, [["render", $o]]), ts = V({
|
|
4347
|
+
name: "pis-products-details-header",
|
|
4348
|
+
components: {
|
|
4349
|
+
Icon: D,
|
|
4350
|
+
Btn: ve,
|
|
4351
|
+
NavigationBtns: dn
|
|
4352
|
+
},
|
|
4353
|
+
props: { instanceId: {
|
|
4354
|
+
type: String,
|
|
4355
|
+
default: void 0
|
|
4356
|
+
} },
|
|
4357
|
+
setup(e) {
|
|
4358
|
+
let t = W(), { componentName: n, isReady: r, isWebComponent: i, instance: a, store: o, t: s, widerThan: c } = $(t, e.instanceId, [Q.Breadcrumbs, Q.ProductDetails]), l = P(() => {
|
|
4359
|
+
var e;
|
|
4360
|
+
return (e = o.value) == null || (e = e.data.productDetail) == null ? void 0 : e.item;
|
|
4361
|
+
});
|
|
4362
|
+
return {
|
|
4363
|
+
root: t,
|
|
4364
|
+
title: P(() => l.value ? v(l.value, "#DisplayName") : ""),
|
|
4365
|
+
store: o,
|
|
4366
|
+
isReady: r,
|
|
4367
|
+
instance: a,
|
|
4368
|
+
componentName: n,
|
|
4369
|
+
isWebComponent: i,
|
|
4370
|
+
componentOptions: P(() => {
|
|
4371
|
+
var e;
|
|
4372
|
+
return ((e = o.value) == null || (e = e.options.components) == null || (e = e.details) == null ? void 0 : e.header) ?? {};
|
|
4373
|
+
}),
|
|
4374
|
+
t: s,
|
|
4375
|
+
widerThan: c,
|
|
4376
|
+
printToPdf: async () => {
|
|
4377
|
+
if (l.value) try {
|
|
4378
|
+
var e;
|
|
4379
|
+
await ((e = a.value) == null ? void 0 : e.execute(new Ge({ productId: l.value.productId }).from(n)));
|
|
4380
|
+
} catch {}
|
|
4381
|
+
},
|
|
4382
|
+
showPrintView: async () => {
|
|
4383
|
+
if (l.value) try {
|
|
4384
|
+
var e;
|
|
4385
|
+
await ((e = a.value) == null ? void 0 : e.execute(new dt({ productId: l.value.productId }).from(n)));
|
|
4386
|
+
} catch {}
|
|
4387
|
+
}
|
|
4388
|
+
};
|
|
4389
|
+
}
|
|
4390
|
+
}), ns = { key: 0 }, rs = { class: "h2 with-cursor" }, is = { class: "d-flex flex-column" }, as = { class: "d-grid gap-3 d-md-flex justify-content-md-between align-items-center" }, os = { class: "d-flex gap-3" }, ss = { class: "overflow-hidden text-nowrap" }, cs = { class: "overflow-hidden text-nowrap" };
|
|
4391
|
+
function ls(e, t, n, r, i, a) {
|
|
4392
|
+
let o = q("NavigationBtns"), s = q("Icon"), c = q("Btn");
|
|
4393
|
+
return U(), L("div", {
|
|
4394
|
+
ref: "root",
|
|
4395
|
+
class: H(["pis-component", e.componentName])
|
|
4396
|
+
}, [e.isReady && e.componentOptions.visible ? (U(), L(N, { key: 0 }, [e.title ? (U(), L("div", ns, [R("h2", rs, J(e.title), 1)])) : I("", !0), R("div", is, [R("div", as, [e.componentOptions.showBackBtn ? (U(), F(o, {
|
|
4397
|
+
key: 0,
|
|
4398
|
+
instance: e.instance,
|
|
4399
|
+
t: e.t
|
|
4400
|
+
}, null, 8, ["instance", "t"])) : I("", !0), R("div", os, [e.componentOptions.showPrintViewBtn ? (U(), F(c, {
|
|
4401
|
+
key: 0,
|
|
4402
|
+
variant: "secondary",
|
|
4403
|
+
class: "d-flex align-items-center ext-print-view",
|
|
4404
|
+
onClick: e.showPrintView
|
|
4405
|
+
}, {
|
|
4406
|
+
default: Y(() => [B(s, {
|
|
4407
|
+
name: "printer",
|
|
4408
|
+
class: "me-1",
|
|
4409
|
+
size: 24
|
|
4410
|
+
}), R("span", ss, J(e.t("ShowPrintView")), 1)]),
|
|
4411
|
+
_: 1
|
|
4412
|
+
}, 8, ["onClick"])) : I("", !0), e.componentOptions.showPrintToPdfBtn ? (U(), F(c, {
|
|
4413
|
+
key: 1,
|
|
4414
|
+
variant: "secondary",
|
|
4415
|
+
class: "d-flex align-items-center ext-print-pdf",
|
|
4416
|
+
onClick: t[0] || (t[0] = (t) => e.printToPdf())
|
|
4417
|
+
}, {
|
|
4418
|
+
default: Y(() => [B(s, {
|
|
4419
|
+
name: "printer",
|
|
4420
|
+
class: "me-1",
|
|
4421
|
+
size: 24
|
|
4422
|
+
}), R("span", cs, J(e.t("PrintToPdf")), 1)]),
|
|
4423
|
+
_: 1
|
|
4424
|
+
})) : I("", !0)])])])], 64)) : I("", !0)], 2);
|
|
4425
|
+
}
|
|
4426
|
+
var us = /*#__PURE__*/ j(ts, [["render", ls]]);
|
|
4427
|
+
//#endregion
|
|
4428
|
+
export { $ as _, Do as a, qt as b, Ii as c, pi as d, oi as f, dn as g, vn as h, Mo as i, Ai as l, xn as m, es as n, Ra as o, Xr as p, Yo as r, sa as s, us as t, bi as u, tn as v, Q as y };
|
|
4429
|
+
|
|
4430
|
+
//# sourceMappingURL=ProductsDetailsHeader-q6jMjbTw.js.map
|