@pisapp/core 7.0.0-dev.20260916-153034 → 7.0.0-dev.20261029-122603

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/LICENSE +26 -18
  2. package/README.md +3 -0
  3. package/catalogs.js +3 -3
  4. package/chunks/AttributesTable-DRKGguZ2.js +3474 -0
  5. package/chunks/PisGlobal-CPAlhOni.js +94 -0
  6. package/chunks/ProductsDetailsHeader-DfVlpJh_.js +4442 -0
  7. package/chunks/carousel.es-DBv2Q2Xn.js +1602 -0
  8. package/chunks/directives-8QlgHJi7.js +8244 -0
  9. package/chunks/entry-CwhdPOkr.js +9948 -0
  10. package/chunks/entry-DVqVFTtL.js +5687 -0
  11. package/chunks/entry-Dyo7FMUS.js +2207 -0
  12. package/chunks/registerCustomElements-CWZenCp9.js +426 -0
  13. package/classifications.js +2 -2
  14. package/core.js +3 -3
  15. package/generated/registries.json +2775 -0
  16. package/index.js +7 -6
  17. package/migration/API_V1_TO_V2_MIGRATION.md +1704 -177
  18. package/migration/legacy-option-rules.json +51 -6
  19. package/migration/v7.json +2983 -441
  20. package/migration/v7.schema.json +61 -2
  21. package/package.json +17 -8
  22. package/pis-csp.js +7 -7
  23. package/pis.js +9 -9
  24. package/products.js +3 -1
  25. package/server.js +354 -0
  26. package/styles/pis.css +1 -1
  27. package/styles/theme-abb.optimized.css +1 -1
  28. package/styles/theme-cux2-blue-dark.css +1 -1
  29. package/styles/theme-cux2-blue-dark.optimized.css +1 -1
  30. package/styles/theme-cux2-blue-light.css +1 -1
  31. package/styles/theme-cux2-blue-light.optimized.css +1 -1
  32. package/styles/theme-cux2-lilac-dark.css +1 -1
  33. package/styles/theme-cux2-lilac-dark.optimized.css +1 -1
  34. package/styles/theme-cux2-lilac-light.css +1 -1
  35. package/styles/theme-cux2-lilac-light.optimized.css +1 -1
  36. package/styles/theme-cux2-mono-dark.css +1 -1
  37. package/styles/theme-cux2-mono-dark.optimized.css +1 -1
  38. package/styles/theme-cux2-mono-light.css +1 -1
  39. package/styles/theme-cux2-mono-light.optimized.css +1 -1
  40. package/styles/theme-cux2-red-dark.css +1 -1
  41. package/styles/theme-cux2-red-dark.optimized.css +1 -1
  42. package/styles/theme-cux2-red-light.css +1 -1
  43. package/styles/theme-cux2-red-light.optimized.css +1 -1
  44. package/types.d.ts +797 -587
  45. package/catalogs.d.ts +0 -7725
  46. package/chunks/catalogs-domain-DJxK_B5E.js +0 -9060
  47. package/chunks/catalogs-domain-DJxK_B5E.js.map +0 -1
  48. package/chunks/classifications-domain-DdIJaF1D.js +0 -1980
  49. package/chunks/classifications-domain-DdIJaF1D.js.map +0 -1
  50. package/chunks/icons-shared-B8v5z3BE.js +0 -1387
  51. package/chunks/icons-shared-B8v5z3BE.js.map +0 -1
  52. package/chunks/products-domain-99vJaUyI.js +0 -22587
  53. package/chunks/products-domain-99vJaUyI.js.map +0 -1
  54. package/classifications.d.ts +0 -7725
  55. package/core.d.ts +0 -7711
  56. package/index.d.ts +0 -7992
  57. package/pis-csp.js.map +0 -1
  58. package/pis.js.map +0 -1
  59. package/products.d.ts +0 -7746
@@ -1,1980 +0,0 @@
1
- import { $ as e, $n as t, D as n, E as r, Fn as i, G as a, Hn as o, J as s, K as c, L as l, N as u, O as d, P as f, Qn as p, R as m, Rn as h, U as g, W as _, X as v, Y as ee, Yn as y, Z as b, Zn as te, ar as x, at as S, cr as C, dr as ne, dt as re, er as ie, et as ae, fr as oe, ft as se, ir as ce, j as le, lt as ue, mr as de, mt as fe, nr as pe, nt as me, o as he, or as w, ot as ge, pt as _e, q as T, rr as ve, rt as ye, s as be, sr as xe, st as Se, tr as Ce, tt as we, ur as Te, zn as E } from "./products-domain-99vJaUyI.js";
2
- import { Fragment as D, Transition as Ee, computed as O, createBlock as k, createCommentVNode as A, createElementBlock as j, createElementVNode as M, createTextVNode as De, createVNode as N, defineComponent as P, mergeProps as Oe, normalizeClass as F, normalizeStyle as ke, openBlock as I, reactive as L, ref as R, renderList as z, renderSlot as Ae, resolveComponent as B, resolveDirective as je, toDisplayString as V, toHandlers as Me, vShow as H, watch as U, withCtx as W, withDirectives as G, withModifiers as K } from "vue";
3
- //#region src/classifications/api/configuration/DefaultOptions.ts
4
- var q = class {
5
- constructor() {
6
- C(this, "appSettings", {
7
- appCode: "",
8
- langCode: "en"
9
- }), C(this, "styles", []), C(this, "components", { browser: {
10
- common: { toolbar: {
11
- applyVisible: !0,
12
- cancelVisible: !0,
13
- favoritesVisible: !0,
14
- productLineTreeVisible: !0,
15
- visible: !0,
16
- expandFavoritesVisible: !1
17
- } },
18
- form: {
19
- visible: !0,
20
- useAutocomplete: !0
21
- },
22
- tabs: {
23
- visible: !0,
24
- items: [
25
- {
26
- id: "favorites",
27
- type: E.FAVORITES,
28
- itemsExpandable: !1,
29
- countsVisible: !0
30
- },
31
- {
32
- id: "offering",
33
- type: E.OFFERING,
34
- countsVisible: !0
35
- },
36
- {
37
- id: "productLine",
38
- type: E.PRODUCT_LINE,
39
- countsVisible: !0
40
- }
41
- ]
42
- },
43
- tree: {
44
- visible: !0,
45
- scrollHeight: 600,
46
- mobileScrollHeight: 300
47
- },
48
- selection: {
49
- visible: !0,
50
- scrollHeight: 600,
51
- mobileScrollHeight: 300
52
- },
53
- note: { visible: !0 },
54
- actions: {
55
- visible: !0,
56
- applyVisible: !0,
57
- cancelVisible: !0
58
- }
59
- } }), C(this, "allowMobileView", !0), C(this, "cacheTranslations", !0);
60
- }
61
- }, Ne = class {
62
- constructor(e) {
63
- C(this, "instance", void 0), C(this, "select", (e) => {
64
- if (!this.data || !(e != null && e.length)) return;
65
- let t = [];
66
- e.forEach((e) => {
67
- if (e && e.cid && !this.isSelected(e)) {
68
- var n;
69
- (n = this.data) == null || n.set(e.cid + "~" + e.tree, e), t.push(e);
70
- }
71
- }), t.length && (this.instance.eventBus.emit("favorites-changed", {
72
- added: t,
73
- removed: [],
74
- selected: this.selectedItems
75
- }), this.trackSelection(t, []));
76
- }), C(this, "deselect", (e) => {
77
- if (!this.data || !(e != null && e.length)) return;
78
- let t = [];
79
- e.forEach((e) => {
80
- if (e && e.cid && this.isSelected(e)) {
81
- var n;
82
- (n = this.data) == null || n.delete(e.cid + "~" + e.tree), t.push(e);
83
- }
84
- }), t.length && (this.instance.eventBus.emit("favorites-changed", {
85
- added: [],
86
- removed: t,
87
- selected: this.selectedItems
88
- }), this.trackSelection([], t));
89
- }), C(this, "toggle", (e) => {
90
- this.isSelected(e) ? this.deselect([e]) : this.select([e]);
91
- }), C(this, "clear", () => {
92
- var e;
93
- if (!this.data) return;
94
- let t = this.selectedItems;
95
- (e = this.data) == null || e.clear(), t.length && (this.instance.eventBus.emit("favorites-changed", {
96
- added: [],
97
- removed: t,
98
- selected: this.selectedItems
99
- }), this.trackSelection([], t));
100
- }), C(this, "isSelected", (e) => this.data ? this.data.has(e.cid + "~" + e.tree) : !1), this.instance = e, e.store.data.favoriteItems || (e.store.data.favoriteItems = /* @__PURE__ */ new Map());
101
- }
102
- trackSelection(e, t) {
103
- w(this.instance, {
104
- kind: "selection",
105
- action: "favorites-changed",
106
- trigger: "ui",
107
- args: {
108
- added: e.length,
109
- removed: t.length,
110
- selected: this.selectedItems.length
111
- }
112
- });
113
- }
114
- get data() {
115
- return this.instance.store.data.favoriteItems;
116
- }
117
- get selectedItems() {
118
- return this.data ? Array.from(this.data.values()) : [];
119
- }
120
- get count() {
121
- return this.selectedItems.length;
122
- }
123
- }, Pe = class {
124
- constructor(e) {
125
- C(this, "instance", void 0), C(this, "select", (e) => {
126
- if (!this.data || !(e != null && e.length)) return;
127
- let t = [];
128
- e.forEach((e) => {
129
- if (e && e.cid && !this.isSelected(e) && e.selectable) {
130
- var n;
131
- (n = this.data) == null || n.set(e.cid + "~" + e.tree, e), t.push(e);
132
- }
133
- }), t.length && (this.instance.eventBus.emit("selection-changed", {
134
- added: t,
135
- removed: [],
136
- selected: this.selectedItems
137
- }), this.trackSelection(t, []));
138
- }), C(this, "deselect", (e) => {
139
- if (!this.data || !(e != null && e.length)) return;
140
- let t = [];
141
- e.forEach((e) => {
142
- if (e && e.cid && this.isSelected(e)) {
143
- var n;
144
- (n = this.data) == null || n.delete(e.cid + "~" + e.tree), t.push(e);
145
- }
146
- }), t.length && (this.instance.eventBus.emit("selection-changed", {
147
- added: [],
148
- removed: t,
149
- selected: this.selectedItems
150
- }), this.trackSelection([], t));
151
- }), C(this, "toggle", (e) => {
152
- e.selectable && (this.isSelected(e) ? this.deselect([e]) : this.select([e]));
153
- }), C(this, "clear", () => {
154
- var e;
155
- if (!this.data) return;
156
- let t = this.selectedItems;
157
- (e = this.data) == null || e.clear(), t.length && (this.instance.eventBus.emit("selection-changed", {
158
- added: [],
159
- removed: t,
160
- selected: this.selectedItems
161
- }), this.trackSelection([], t));
162
- }), C(this, "isSelected", (e) => this.data ? this.data.has(e.cid + "~" + e.tree) : !1), this.instance = e, e.store.data.selectedItems || (e.store.data.selectedItems = /* @__PURE__ */ new Map());
163
- }
164
- trackSelection(e, t) {
165
- w(this.instance, {
166
- kind: "selection",
167
- action: "selection-changed",
168
- trigger: "ui",
169
- args: {
170
- added: e.length,
171
- removed: t.length,
172
- selected: this.selectedItems.length
173
- }
174
- });
175
- }
176
- get data() {
177
- return this.instance.store.data.selectedItems;
178
- }
179
- get selectedItems() {
180
- return this.data ? Array.from(this.data.values()) : [];
181
- }
182
- get count() {
183
- return this.selectedItems.length;
184
- }
185
- }, J = (e) => e.id ?? e.type, Y = (e, t) => t ? e.find((e) => J(e) === t) : void 0;
186
- function Fe(e) {
187
- var t;
188
- let n = (t = e.components) == null || (t = t.browser) == null || (t = t.tabs) == null ? void 0 : t.items;
189
- if (Array.isArray(n) && n.length === 0) throw Error("Invalid classifications tabs: components.browser.tabs.items must contain at least one tab. Omit the option or pass null to use the default tabs.");
190
- }
191
- function Ie(e) {
192
- var n, r;
193
- let i = (n = e.components) == null ? void 0 : n.browser;
194
- if (!i) return;
195
- let a = new q().components.browser.tabs;
196
- i.tabs == null ? i.tabs = t(a) : i.tabs.items ?? (i.tabs.items = t(a.items));
197
- let o = i.tabs;
198
- if (!((r = o.items) != null && r.length)) throw Error("Invalid classifications tabs: components.browser.tabs.items must contain at least one tab. Omit the option or pass null to use the default tabs.");
199
- let s = o.items, c = /* @__PURE__ */ new Set();
200
- o.items = s.map((e) => {
201
- if (!e || typeof e != "object") throw Error("Invalid classifications tabs: every items[] entry must be a TabOption object.");
202
- if ("selected" in e) throw Error("Invalid classifications tabs: TabOption.selected was removed - selection is route-driven. Pass the initial tab through init(options, { tabId }) or setRoute({ tabId }) instead.");
203
- let t = e.id ?? e.type;
204
- if (typeof t != "string" || t.length === 0) throw Error(`Invalid classifications tabs: tab id must be a non-empty string (type "${e.type}").`);
205
- if (c.has(t)) throw Error(`Invalid classifications tabs: duplicate tab id "${t}". Assign a unique TabOption.id to every tab that shares a type.`);
206
- return c.add(t), {
207
- ...e,
208
- id: t
209
- };
210
- });
211
- }
212
- var Le = new class {
213
- toLegacyEventArgs(e, n) {
214
- let r = { type: e }, i = n.selection.selectedItems;
215
- if (i != null && i.length) {
216
- let e = [];
217
- i.forEach((t) => {
218
- let n = t;
219
- e.push(this.mapNodesToLegacy(n));
220
- }), r.nodes = e;
221
- }
222
- let a = n.favorites.selectedItems;
223
- if (a != null && a.length) {
224
- let e = [];
225
- a.forEach((t) => {
226
- let n = t;
227
- e.push(this.mapNodesToLegacy(n));
228
- }), r.favorites = e;
229
- }
230
- return n.store.data.invalidFavoriteItems && (r.invalidFavorites = n.store.data.invalidFavoriteItems), n.store.data.invalidSelectedItems && (r.invalidNodes = n.store.data.invalidSelectedItems), t(r);
231
- }
232
- mapNodesToLegacy(e) {
233
- return {
234
- cid: e.cid,
235
- englishDescription: e.enName,
236
- languageSpecificDescription: e.name,
237
- treeCode: e.tree == h.OFFERING ? "OFFERING_TREE" : "PL_TREE",
238
- reference: e.reference ? this.mapNodeReferenceToLegacy(e.reference) : null
239
- };
240
- }
241
- mapNodeReferenceToLegacy(e) {
242
- return {
243
- classificationCode: e.classificationCode,
244
- cid: e.cid,
245
- refCid: e.refCid,
246
- refPath: e.refPath
247
- };
248
- }
249
- applyLegacyOptions(e, t) {
250
- let n = [];
251
- e.parameters.favoriteView && n.push({
252
- type: E.FAVORITES,
253
- itemsExpandable: e.parameters.favoriteItemsExpandable,
254
- onlyLeafNodesSelectable: e.parameters.onlyLeafNodesSelectable,
255
- countsVisible: !0
256
- }), n.push({
257
- type: E.OFFERING,
258
- onlyLeafNodesSelectable: e.parameters.onlyLeafNodesSelectable,
259
- countsVisible: !0
260
- }), e.parameters.productLineHierarchy && n.push({
261
- type: E.PRODUCT_LINE,
262
- onlyLeafNodesSelectable: e.parameters.onlyLeafNodesSelectable,
263
- countsVisible: !0
264
- });
265
- let r = {
266
- accessToken: e.accessToken,
267
- selectedNodes: this.parseCids(e.parameters.selectedNodes),
268
- favoriteNodes: this.parseCids(e.parameters.favoriteNodes),
269
- appSettings: {
270
- appCode: e.appCode,
271
- countryCode: this.getIsoCountryCode(e.countryCode),
272
- langCode: this.getIsoLangCode(e.langCode),
273
- filters: {
274
- applicationUse: {
275
- disable: e.parameters.disableAppUseCheck,
276
- exceptionCids: e.parameters.disableAppUseCheckException
277
- },
278
- lifeCyclePhases: e.parameters.lifeCyclePhases,
279
- lifeCyclePhaseMode: e.parameters.lifeCyclePhaseMode
280
- },
281
- productLinePeriod: e.parameters.productLinePeriodCode
282
- },
283
- components: { browser: {
284
- common: { toolbar: {
285
- visible: !0,
286
- expandFavoritesVisible: e.parameters.expandFavoritesVisible
287
- } },
288
- tabs: {
289
- items: n,
290
- visible: !0
291
- },
292
- tree: {
293
- visible: !0,
294
- scrollHeight: e.parameters.scrollHeight,
295
- mobileScrollHeight: e.parameters.mobileScrollHeight
296
- },
297
- selection: {
298
- visible: !0,
299
- scrollHeight: e.parameters.scrollHeight,
300
- mobileScrollHeight: e.parameters.mobileScrollHeight
301
- }
302
- } }
303
- };
304
- t && (Ce(t, r), r = t);
305
- let i = { tabId: J(n[0]) };
306
- return {
307
- options: r,
308
- routeData: i
309
- };
310
- }
311
- parseCids(e) {
312
- let t = [];
313
- return e.forEach((e) => {
314
- if (typeof e == "string") if (e.indexOf("|") > -1) {
315
- let n = e.split("|");
316
- t.push({
317
- cid: n[0],
318
- type: this.parseTreeType(n[1])
319
- });
320
- } else t.push({ cid: e });
321
- else t.push({
322
- cid: e.cid,
323
- type: this.parseTreeType(e.treeCode)
324
- });
325
- }), t;
326
- }
327
- parseTreeType(e) {
328
- if (e === "OFFERING_TREE") return h.OFFERING;
329
- if (e === "PL_TREE") return h.PRODUCT_LINE;
330
- }
331
- getIsoCountryCode(e) {
332
- if (e) return e.includes("_") ? e.split("_")[1] : e;
333
- }
334
- getIsoLangCode(e) {
335
- if (e) return e.includes("_") ? e.split("_")[0] : e;
336
- }
337
- }(), X = class extends xe {}, Re = class extends X {
338
- constructor(...e) {
339
- super(...e), C(this, "name", "classifications-filter-search"), C(this, "execute", async (e) => e.router.setRoute({ searchText: this.args.searchText }));
340
- }
341
- }, ze = class extends X {
342
- constructor(...e) {
343
- super(...e), C(this, "name", "classifications-get-autocomplete"), C(this, "execute", async (e) => {
344
- var t;
345
- return await ((t = e.httpService) == null ? void 0 : t.autocomplete(this.args.searchText));
346
- });
347
- }
348
- }, Be = class extends X {
349
- constructor(...e) {
350
- super(...e), C(this, "name", "classifications-node-expand"), C(this, "execute", async (e) => {
351
- var t;
352
- if (this.args.item.leaf) return Promise.resolve(this.args.item);
353
- if ((t = this.args.item.children) != null && t.length) return this.args.item._isExpanded = !0, Promise.resolve(this.args.item);
354
- if (e.httpService) {
355
- this.args.item._isLoading = !0;
356
- try {
357
- await e.httpService.loadChildren(this.args.item), this.args.item._isExpanded = !0;
358
- } catch {} finally {
359
- this.args.item._isLoading = !1;
360
- }
361
- }
362
- return Promise.resolve(this.args.item);
363
- });
364
- }
365
- }, Ve = class extends X {
366
- constructor(...e) {
367
- super(...e), C(this, "name", "classifications-node-collapse"), C(this, "execute", async () => (this.args.item._isExpanded = !1, Promise.resolve(this.args.item)));
368
- }
369
- }, He = class extends X {
370
- constructor(...e) {
371
- super(...e), C(this, "name", "classifications-collapse-all"), C(this, "setExpandedFalse", (e) => {
372
- e == null || e.forEach((e) => {
373
- var t;
374
- (t = e.children) != null && t.length && (e._isExpanded = !1, this.setExpandedFalse(e.children));
375
- });
376
- }), C(this, "execute", async (e) => {
377
- var t;
378
- let n = ((t = e.store.data) == null || (t = t.classifications) == null ? void 0 : t.items) ?? [];
379
- return this.setExpandedFalse(n), Promise.resolve(this.args);
380
- });
381
- }
382
- }, Ue = class extends X {
383
- constructor(...e) {
384
- super(...e), C(this, "name", "classifications-expand-all"), C(this, "setExpandedTrue", (e) => {
385
- e == null || e.forEach((e) => {
386
- var t;
387
- (t = e.children) != null && t.length && (e._isExpanded = !0, this.setExpandedTrue(e.children));
388
- });
389
- }), C(this, "execute", async (e) => {
390
- var t;
391
- let n = ((t = e.store.data) == null || (t = t.classifications) == null ? void 0 : t.items) ?? [];
392
- return this.setExpandedTrue(n), Promise.resolve(this.args);
393
- });
394
- }
395
- }, We = class extends X {
396
- constructor(...e) {
397
- super(...e), C(this, "name", "classifications-favorites-show"), C(this, "execute", async (e) => {
398
- var t, n;
399
- let r = (t = e.store.options.components) == null || (t = t.browser) == null || (t = t.tabs) == null || (t = t.items) == null ? void 0 : t.find((e) => e.type === "Favorites");
400
- return (n = e.router) == null ? void 0 : n.setRoute({ tabId: r ? J(r) : void 0 });
401
- });
402
- }
403
- }, Ge = class extends X {
404
- constructor(...e) {
405
- super(...e), C(this, "name", "classifications-show-all"), C(this, "execute", async (e) => {
406
- var t;
407
- return (t = e.router) == null ? void 0 : t.setRoute({ tabId: void 0 });
408
- });
409
- }
410
- }, Ke = class extends X {
411
- constructor(...e) {
412
- super(...e), C(this, "name", "classifications-set-tab"), C(this, "execute", async (e) => {
413
- var t;
414
- return await ((t = e.router) == null ? void 0 : t.setRoute({ tabId: this.args.tabId }));
415
- });
416
- }
417
- }, qe = class extends X {
418
- constructor(...e) {
419
- super(...e), C(this, "name", "classifications-item-select"), C(this, "execute", async (e) => (e.selection.select([this.args.item]), Promise.resolve(this.args)));
420
- }
421
- }, Je = class extends X {
422
- constructor(...e) {
423
- super(...e), C(this, "name", "classifications-item-deselect"), C(this, "execute", async (e) => (e.selection.deselect([this.args.item]), Promise.resolve(this.args)));
424
- }
425
- }, Ye = class extends X {
426
- constructor(...e) {
427
- super(...e), C(this, "name", "classifications-favorite-select"), C(this, "execute", async (e) => (e.favorites.select([this.args.item]), Promise.resolve(this.args)));
428
- }
429
- }, Xe = class extends X {
430
- constructor(...e) {
431
- super(...e), C(this, "name", "classifications-favorite-deselect"), C(this, "execute", async (e) => (e.favorites.deselect([this.args.item]), Promise.resolve(this.args)));
432
- }
433
- }, Ze = class extends X {
434
- constructor(...e) {
435
- super(...e), C(this, "name", "classifications-selection-clear"), C(this, "execute", async (e) => (e.selection.clear(), Promise.resolve(this.args)));
436
- }
437
- }, Qe = class extends X {
438
- constructor(...e) {
439
- super(...e), C(this, "name", "classifications-apply"), C(this, "execute", async (e) => {
440
- let t = Le.toLegacyEventArgs("Apply", e);
441
- return e.eventBus.emit("classification-selector-closed", t), Promise.resolve(this.args);
442
- });
443
- }
444
- }, $e = class extends X {
445
- constructor(...e) {
446
- super(...e), C(this, "name", "classifications-cancel"), C(this, "execute", async (e) => {
447
- let t = Le.toLegacyEventArgs("Cancel", e);
448
- return e.eventBus.emit("classification-selector-closed", t), Promise.resolve(this.args);
449
- });
450
- }
451
- }, et = class extends X {
452
- constructor(...e) {
453
- super(...e), C(this, "name", "classifications-notification-show"), C(this, "excludeFromUserActions", !0), C(this, "execute", async (e) => {
454
- let t = 0, n = this.args.dismissAfter;
455
- e.store.notifications.length && (e.store.notifications = [], t = 1e3), !n && n !== 0 && this.args.type !== "danger" && (n = 6e3, e.store.notifications = []), n && n !== 0 && setTimeout(() => {
456
- let t = e.store.notifications.indexOf(this.args);
457
- t !== -1 && e.store.notifications.splice(t, 1);
458
- }, this.args.dismissAfter), setTimeout(() => e.store.notifications.push(this.args), t);
459
- });
460
- }
461
- }, tt = class extends X {
462
- constructor(...e) {
463
- super(...e), C(this, "name", "classifications-notification-hide"), C(this, "excludeFromUserActions", !0), C(this, "execute", async (e) => {
464
- let t = e.store.notifications.indexOf(this.args);
465
- t !== -1 && e.store.notifications.splice(t, 1);
466
- });
467
- }
468
- }, nt = class extends te {
469
- constructor(e) {
470
- super(e, rt, "classifications");
471
- }
472
- }, rt = {
473
- "classifications-filter-search": Re,
474
- "classifications-get-autocomplete": ze,
475
- "classifications-node-expand": Be,
476
- "classifications-node-collapse": Ve,
477
- "classifications-collapse-all": He,
478
- "classifications-expand-all": Ue,
479
- "classifications-favorites-show": We,
480
- "classifications-show-all": Ge,
481
- "classifications-set-tab": Ke,
482
- "classifications-item-select": qe,
483
- "classifications-item-deselect": Je,
484
- "classifications-favorite-select": Ye,
485
- "classifications-favorite-deselect": Xe,
486
- "classifications-selection-clear": Ze,
487
- "classifications-apply": Qe,
488
- "classifications-cancel": $e,
489
- "classifications-notification-show": et,
490
- "classifications-notification-hide": tt
491
- }, Z = {
492
- Classifications: "Classifications",
493
- Translations: "Translations"
494
- }, it = {
495
- [Z.Classifications]: (e, t) => {
496
- e.classifications = t;
497
- },
498
- [Z.Translations]: (e, t) => {
499
- _e.log("Setting store data not handled", {
500
- type: Z.Translations,
501
- data: t
502
- });
503
- }
504
- }, at = class extends fe {
505
- constructor(e) {
506
- super(e);
507
- }
508
- dataInterceptor() {
509
- var e;
510
- return (e = this.instance.store) == null ? void 0 : e.options.dataInterceptor;
511
- }
512
- dispatchLoadEvent(e) {
513
- this.setStoreData(e);
514
- }
515
- setStoreData({ type: e, data: t }) {
516
- if (!this.instance.store) return;
517
- let n = it[e];
518
- n(this.instance.store.data, t);
519
- }
520
- }, ot = "pis-classifications-translations", st = class extends re {
521
- constructor(e, t, n) {
522
- super(), C(this, "instance", void 0), C(this, "instanceType", "Classifications"), C(this, "storeService", void 0), C(this, "client", void 0), C(this, "setExpanded", (e) => {
523
- e == null || e.forEach((e) => {
524
- var t;
525
- (t = e.children) != null && t.length && (e._isExpanded = !0, this.setExpanded(e.children));
526
- });
527
- }), this.instance = e, this.client = se(e, t, n), this.storeService = new at(e);
528
- }
529
- getActiveTab(e) {
530
- var t, n;
531
- return Y(((t = this.instance.store.options.components) == null || (t = t.browser) == null || (t = t.tabs) == null ? void 0 : t.items) ?? [], e ?? ((n = this.instance.router) == null ? void 0 : n.routeData.tabId));
532
- }
533
- async load(e) {
534
- if (!this.instance.router) return;
535
- let t = e || this.instance.router.routeData;
536
- return await this.search(t);
537
- }
538
- async search(e) {
539
- let { action: t, source: n, trigger: r = "ui" } = x(this.instance) ?? {};
540
- this.instance.store.data.isLoadingData = !0;
541
- let i = this.getActiveTab(e.tabId), a = Date.now(), o = (i) => w(this.instance, {
542
- kind: "search",
543
- action: "search",
544
- trigger: r,
545
- origin: t ?? "route",
546
- ...n ? { source: n } : {},
547
- args: {
548
- searchText: e.searchText ?? null,
549
- tabId: e.tabId ?? null
550
- },
551
- outcome: i
552
- });
553
- try {
554
- var s, c, l;
555
- let t = await y.classificationsBrowserSearch({ classificationsBrowserSearchQuery: {
556
- appSettings: (s = this.instance.store) == null ? void 0 : s.options.appSettings,
557
- search: {
558
- treeView: i == null ? void 0 : i.type,
559
- searchText: e.searchText ?? void 0,
560
- selectedCids: ((c = this.instance.selection) == null || (c = c.selectedItems) == null ? void 0 : c.map((e) => e.cid)) || [],
561
- favoriteCids: ((l = this.instance.favorites) == null || (l = l.selectedItems) == null ? void 0 : l.map((e) => e.cid)) || [],
562
- favoriteItemsExpandable: i == null ? void 0 : i.itemsExpandable,
563
- onlyLeafNodesSelectable: i == null ? void 0 : i.onlyLeafNodesSelectable,
564
- categoryInclusionCriteria: i == null ? void 0 : i.categoryInclusionCriteria,
565
- categoryExclusionCriteria: i == null ? void 0 : i.categoryExclusionCriteria
566
- }
567
- } }, { client: this.client });
568
- this.instance.eventBus.emit("search-loaded", t), o(ce(void 0, t.items, Date.now() - a)), t && (this.setExpanded(t.items), this.storeService.setData(Z.Classifications, t)), this.instance.store.data.isLoadingData = !1, this.instance.eventBus.emit("search-changed");
569
- } catch (e) {
570
- throw this.instance.store.data.isLoadingData = !1, o({
571
- status: "error",
572
- durationMs: Date.now() - a
573
- }), e;
574
- }
575
- }
576
- async autocomplete(e) {
577
- let { action: t, source: n, trigger: r = "ui" } = x(this.instance) ?? {}, i = this.instance.router.routeData, a = this.getActiveTab(i.tabId), o = Date.now(), s;
578
- try {
579
- var c, l, u;
580
- s = await y.classificationsBrowserAutocomplete({ classificationsBrowserAutocompleteQuery: {
581
- appSettings: (c = this.instance.store) == null ? void 0 : c.options.appSettings,
582
- search: {
583
- searchText: e,
584
- treeView: a == null ? void 0 : a.type,
585
- selectedCids: ((l = this.instance.selection) == null || (l = l.selectedItems) == null ? void 0 : l.map((e) => e.cid)) || [],
586
- favoriteCids: ((u = this.instance.favorites) == null || (u = u.selectedItems) == null ? void 0 : u.map((e) => e.cid)) || [],
587
- favoriteItemsExpandable: a == null ? void 0 : a.itemsExpandable,
588
- onlyLeafNodesSelectable: a == null ? void 0 : a.onlyLeafNodesSelectable,
589
- categoryInclusionCriteria: a == null ? void 0 : a.categoryInclusionCriteria,
590
- categoryExclusionCriteria: a == null ? void 0 : a.categoryExclusionCriteria
591
- }
592
- } }, { client: this.client });
593
- } catch (i) {
594
- throw w(this.instance, {
595
- kind: "autocomplete",
596
- action: "autocomplete",
597
- trigger: r,
598
- ...t ? { origin: t } : {},
599
- ...n ? { source: n } : {},
600
- args: { searchText: e },
601
- outcome: {
602
- status: "error",
603
- durationMs: Date.now() - o
604
- }
605
- }), i;
606
- }
607
- return w(this.instance, {
608
- kind: "autocomplete",
609
- action: "autocomplete",
610
- trigger: r,
611
- ...t ? { origin: t } : {},
612
- ...n ? { source: n } : {},
613
- args: { searchText: e },
614
- outcome: ce(s.totalCount, s.matches, Date.now() - o)
615
- }), s;
616
- }
617
- async loadChildren(e) {
618
- var t, n, r;
619
- let i = this.instance.router.routeData, a = this.getActiveTab(i.tabId), o = await y.classificationsBrowserChildren({ classificationsBrowserChildrenQuery: {
620
- appSettings: (t = this.instance.store) == null ? void 0 : t.options.appSettings,
621
- search: {
622
- treeType: e.tree,
623
- cid: e.cid,
624
- treeView: a == null ? void 0 : a.type,
625
- selectedCids: ((n = this.instance.selection) == null || (n = n.selectedItems) == null ? void 0 : n.map((e) => e.cid)) || [],
626
- favoriteCids: ((r = this.instance.favorites) == null || (r = r.selectedItems) == null ? void 0 : r.map((e) => e.cid)) || [],
627
- favoriteItemsExpandable: a == null ? void 0 : a.itemsExpandable,
628
- onlyLeafNodesSelectable: a == null ? void 0 : a.onlyLeafNodesSelectable,
629
- categoryInclusionCriteria: a == null ? void 0 : a.categoryInclusionCriteria,
630
- categoryExclusionCriteria: a == null ? void 0 : a.categoryExclusionCriteria
631
- }
632
- } }, { client: this.client });
633
- return o != null && o.items && (e.children = o.items, this.storeService.setData(Z.Classifications, this.instance.store.data.classifications)), o.items;
634
- }
635
- async validate(e) {
636
- var t;
637
- return await y.classificationsBrowserValidate({ classificationsBrowserValidateQuery: {
638
- appSettings: (t = this.instance.store) == null ? void 0 : t.options.appSettings,
639
- search: { nodes: e }
640
- } }, { client: this.client });
641
- }
642
- async loadTranslations() {
643
- var e;
644
- let t = await this.fetchTranslations(ot), n = (e = this.instance.store) == null ? void 0 : e.options.dataInterceptor, r = {
645
- type: Z.Translations,
646
- data: L({ items: t }),
647
- instance: this.instance
648
- };
649
- if (n) {
650
- var i;
651
- let e = await n(r);
652
- return e.type === "Translations" ? (i = e.data) == null ? void 0 : i.items : t;
653
- }
654
- return t;
655
- }
656
- }, ct = { tabId: "favorites" }, lt = class {
657
- constructor(e) {
658
- C(this, "instance", void 0), C(this, "routeData", L(t(ct))), C(this, "history", []), this.instance = e;
659
- }
660
- configuredTabs() {
661
- var e;
662
- return ((e = this.instance.store.options) == null || (e = e.components) == null || (e = e.browser) == null || (e = e.tabs) == null ? void 0 : e.items) ?? [];
663
- }
664
- resolveDefaultRoute() {
665
- let e = this.configuredTabs();
666
- return e.length ? { tabId: J(e.filter((e) => e.visible !== !1)[0] ?? e[0]) } : t(ct);
667
- }
668
- reconcileTabs(e) {
669
- let t = this.configuredTabs();
670
- if (!t.length) {
671
- e.tabId = this.resolveDefaultRoute().tabId;
672
- return;
673
- }
674
- if (Y(t, e.tabId)) return;
675
- let n = this.resolveDefaultRoute();
676
- e.tabId, e.tabId = n.tabId;
677
- }
678
- async setRoute(e, n = !1) {
679
- let r = t(this.routeData);
680
- if (e && pe(r, e), this.history.length === 0 && (e == null ? void 0 : e.tabId) == null && pe(r, { tabId: null }), this.reconcileTabs(r), ue(r, this.resolveDefaultRoute()), !(this.history.length > 0 && ie(r, t(this.routeData)))) return this.instance.store.data.isInitialized && this.instance.httpService ? (n || await this.instance.httpService.load(r), this.commitRoute(r), Promise.resolve()) : (this.commitRoute(r), Promise.resolve());
681
- }
682
- async reload() {
683
- var e;
684
- await ((e = this.instance.httpService) == null ? void 0 : e.load(this.routeData));
685
- }
686
- commitRoute(e) {
687
- this.history.push({ ...e }), pe(this.routeData, e), this.instance.eventBus.emit("route-changed", t(this.routeData));
688
- }
689
- async back(e = 1) {
690
- let t = this.history.length - e - 1, n = this.history[t];
691
- n && this.history.splice(t), this.setRoute(n ?? this.resolveDefaultRoute());
692
- }
693
- }, ut = class {
694
- constructor(e, t) {
695
- C(this, "id", void 0), C(this, "accessor", void 0), C(this, "instanceType", "Classifications"), C(this, "props", {}), C(this, "httpService", void 0), C(this, "store", L({
696
- notifications: [],
697
- data: {
698
- isInitialized: !1,
699
- actions: {
700
- current: null,
701
- data: null
702
- }
703
- },
704
- options: { isInitialized: !1 }
705
- })), C(this, "router", new lt(this)), C(this, "translations", new ye(this)), C(this, "commandExecutor", new nt(this)), C(this, "logger", _e), C(this, "registeredComponents", L(/* @__PURE__ */ new Set())), C(this, "dataTypesRequired", L(/* @__PURE__ */ new Set())), C(this, "eventBus", de()), C(this, "eventBusExt", S(this.eventBus)), C(this, "selection", new Pe(this)), C(this, "favorites", new Ne(this)), this.id = e, this.accessor = t;
706
- }
707
- isInitialized() {
708
- return this.store.data.isInitialized;
709
- }
710
- async reload() {
711
- await this.translations.load(), await this.router.reload();
712
- }
713
- setRoute(e) {
714
- this.router.setRoute(e);
715
- }
716
- async init(e, t) {
717
- if (this.store.data.isInitialized) throw Error(`Instance "${this.id}" is already initialized`);
718
- ae("classifications", e), we(e), Fe(e);
719
- let n = me(e == null ? void 0 : e.baseUrl), r = this.store.options.isInitialized ? this.store.options : new q();
720
- Se(r, e), Ie(r), this.store.options = r, this.store.options.isInitialized = !0, this.httpService = new st(this, n, r.accessToken), this.store.data.isInitialized = !0;
721
- try {
722
- return await this.translations.load(), await this.validateParameters(), this.router.setRoute(t), Promise.resolve();
723
- } catch (e) {
724
- this.store.data.isInitialized = !1;
725
- let t = p(r.errorInterceptor, {
726
- type: "InitError",
727
- message: "PIS initialization error.",
728
- isHandled: !1
729
- });
730
- return console.error("[PIS] initialization error", t, e), Promise.reject(Error("PIS initialization error", { cause: e }));
731
- }
732
- }
733
- update(e, t) {
734
- ae("classifications", e), we(e), Fe(e);
735
- let n = this.store.options.isInitialized ? this.store.options : new q();
736
- Se(n, e), Ie(n), this.store.options = n, this.store.options.isInitialized = !0, (t || this.router.history.length > 0) && this.router.setRoute(t ?? {});
737
- }
738
- on(e, t) {
739
- this.eventBusExt.on(e, t);
740
- }
741
- onReady(e) {
742
- let t = U(() => this.store.data, ({ isInitialized: n }) => {
743
- n && (e(), t());
744
- }, { deep: !0 });
745
- }
746
- off(e, t) {
747
- e ? this.eventBusExt.off(e, t) : this.eventBusExt.all.clear();
748
- }
749
- registerComponent(e) {
750
- this.registeredComponents.add(e);
751
- }
752
- registerRequiredDataTypes(e) {
753
- e.forEach((e) => this.dataTypesRequired.add(e));
754
- }
755
- getRegisteredSearchDataTypes() {
756
- return [];
757
- }
758
- destroy() {
759
- return this.accessor.destroyInstance(this.id);
760
- }
761
- execute(e, t) {
762
- return this.commandExecutor.execute(e, t);
763
- }
764
- executeCommand(e, ...t) {
765
- return this.commandExecutor.executeCommand(e, ...t);
766
- }
767
- trackUserAction(e) {
768
- ve(this, e);
769
- }
770
- getDefaultOptions() {
771
- let e = ge(new q());
772
- return Ie(e), e;
773
- }
774
- getDefaultRouteData() {
775
- return this.router.resolveDefaultRoute();
776
- }
777
- getOptions() {
778
- return this.store.options;
779
- }
780
- getRouteData() {
781
- return t(this.router.routeData);
782
- }
783
- applyLegacyOptions(e, t) {
784
- return Le.applyLegacyOptions(e, t);
785
- }
786
- async apply() {
787
- try {
788
- await this.execute(new Qe(), "api");
789
- } catch {}
790
- }
791
- async cancel() {
792
- try {
793
- await this.execute(new $e(), "api");
794
- } catch {}
795
- }
796
- async validateParameters() {
797
- if (this.httpService && (this.store.options.selectedNodes || this.store.options.favoriteNodes)) {
798
- let r = [...this.store.options.selectedNodes ?? [], ...this.store.options.favoriteNodes ?? []];
799
- if (r.length) {
800
- var e, n;
801
- let i = await this.httpService.validate(r), a = [], o = [], s = [], c = [];
802
- (e = this.store.options.selectedNodes) != null && e.length && this.store.options.selectedNodes.forEach((e) => {
803
- if (e.type) {
804
- var t;
805
- let n = (t = i.validNodes) == null ? void 0 : t.find((t) => t.cid === e.cid && t.tree === e.type);
806
- n ? a.push(n) : o.push(e);
807
- } else {
808
- var n, r;
809
- let t, l;
810
- if ((((n = this.store.options.components) == null || (n = n.browser) == null || (n = n.tabs) == null ? void 0 : n.items) ?? []).some((e) => e.type === E.OFFERING)) {
811
- var s;
812
- t = (s = i.validNodes) == null ? void 0 : s.find((t) => t.cid === e.cid && t.tree === h.OFFERING), t && a.push(t);
813
- }
814
- if ((((r = this.store.options.components) == null || (r = r.browser) == null || (r = r.tabs) == null ? void 0 : r.items) ?? []).some((e) => e.type === E.PRODUCT_LINE)) {
815
- var c;
816
- l = (c = i.validNodes) == null ? void 0 : c.find((t) => t.cid === e.cid && t.tree === h.PRODUCT_LINE), l && a.push(l);
817
- }
818
- t === void 0 && l === void 0 && o.push(e);
819
- }
820
- }), (n = this.store.options.favoriteNodes) != null && n.length && this.store.options.favoriteNodes.forEach((e) => {
821
- if (e.type) {
822
- var t;
823
- let n = (t = i.validNodes) == null ? void 0 : t.find((t) => t.cid === e.cid && t.tree === e.type);
824
- n ? s.push(n) : c.push(e);
825
- } else {
826
- var n, r;
827
- let t, l;
828
- if ((((n = this.store.options.components) == null || (n = n.browser) == null || (n = n.tabs) == null ? void 0 : n.items) ?? []).some((e) => e.type === E.OFFERING)) {
829
- var a;
830
- t = (a = i.validNodes) == null ? void 0 : a.find((t) => t.cid === e.cid && t.tree === h.OFFERING), t && s.push(t);
831
- }
832
- if ((((r = this.store.options.components) == null || (r = r.browser) == null || (r = r.tabs) == null ? void 0 : r.items) ?? []).some((e) => e.type === E.PRODUCT_LINE)) {
833
- var o;
834
- l = (o = i.validNodes) == null ? void 0 : o.find((t) => t.cid === e.cid && t.tree === h.PRODUCT_LINE), l && s.push(l);
835
- }
836
- t === void 0 && l === void 0 && c.push(e);
837
- }
838
- }), a.length && this.selection.select(a), s.length && this.favorites.select(s), o.length && (this.eventBus.emit("selection-validated", {
839
- invalid: t(o),
840
- valid: t(a)
841
- }), this.store.data.invalidSelectedItems = o), c.length && (this.eventBus.emit("favorites-validated", {
842
- invalid: t(c),
843
- valid: t(s)
844
- }), this.store.data.invalidFavoriteItems = c);
845
- }
846
- }
847
- }
848
- }, dt = class {
849
- constructor() {
850
- C(this, "instances", L(/* @__PURE__ */ new Map()));
851
- }
852
- destroyInstance(e) {
853
- try {
854
- var t;
855
- (t = this.instances.get(e)) == null || t.off();
856
- } catch {}
857
- this.instances.delete(e);
858
- }
859
- getInstance(e) {
860
- let t = this.instances.size;
861
- if (e !== void 0) {
862
- if (this.instances.has(e)) return this.instances.get(e);
863
- {
864
- let t = new ut(e, this);
865
- return this.instances.set(e, t), t;
866
- }
867
- }
868
- if (t === 1) return this.instances.values().next().value;
869
- if (t > 1) throw Error("[PIS Classifications] Cannot pick default instance if more than one exists");
870
- }
871
- setAccessTokenInAllInstances(e) {
872
- this.instances.forEach((t) => {
873
- t.getOptions().accessToken = e;
874
- });
875
- }
876
- }, ft = s({
877
- getInstance: (e) => b.Classifications.getInstance(e),
878
- instanceTag: "pis-classifications-instance",
879
- debounceResize: !1
880
- });
881
- function Q(e, t, n) {
882
- return ft(e, t, n);
883
- }
884
- //#endregion
885
- //#region src/classifications/components/common/ClassificationsNotifications.vue?vue&type=script&lang.ts
886
- var pt = P({
887
- name: "pis-classifications-common-notifications",
888
- components: { Notifications: r },
889
- props: { instanceId: {
890
- type: String,
891
- default: void 0
892
- } },
893
- setup(e) {
894
- let t = R(), { componentName: n, isReady: r, isWebComponent: i, instance: a, store: o, routeData: s } = Q(t, e.instanceId);
895
- return {
896
- root: t,
897
- store: o,
898
- isReady: r,
899
- instance: a,
900
- routeData: s,
901
- componentName: n,
902
- isWebComponent: i
903
- };
904
- }
905
- }), mt = {
906
- ref: "root",
907
- class: "pis-component"
908
- };
909
- function ht(e, t, n, r, i, a) {
910
- let o = B("Notifications");
911
- return I(), j("div", mt, [e.isReady && e.store && e.instance ? (I(), k(o, {
912
- key: 0,
913
- instance: e.instance
914
- }, null, 8, ["instance"])) : A("", !0)], 512);
915
- }
916
- var gt = /*#__PURE__*/ T(pt, [["render", ht]]), _t = P({
917
- name: "pis-classifications-browser-actions",
918
- props: { instanceId: {
919
- type: String,
920
- default: void 0
921
- } },
922
- setup(e) {
923
- let t = R(), { componentName: n, isReady: r, isWebComponent: i, instance: a, store: o, routeData: s, t: c } = Q(t, e.instanceId, [Z.Classifications]);
924
- return {
925
- root: t,
926
- store: o,
927
- isReady: r,
928
- instance: a,
929
- routeData: s,
930
- componentName: n,
931
- isWebComponent: i,
932
- componentOptions: O(() => {
933
- var e;
934
- return ((e = o.value) == null || (e = e.options.components) == null || (e = e.browser) == null ? void 0 : e.actions) ?? {};
935
- }),
936
- cancel: async () => {
937
- try {
938
- var e;
939
- await ((e = a.value) == null ? void 0 : e.execute(new $e().from(n)));
940
- } catch {}
941
- },
942
- apply: async () => {
943
- try {
944
- var e;
945
- await ((e = a.value) == null ? void 0 : e.execute(new Qe().from(n)));
946
- } catch {}
947
- },
948
- t: c
949
- };
950
- }
951
- });
952
- //#endregion
953
- //#region src/classifications/components/browser/ClassificationActions.vue
954
- function vt(e, t, n, r, i, a) {
955
- return G((I(), j("div", {
956
- ref: "root",
957
- class: F(["pis-component", e.componentName]),
958
- style: { "z-index": "1" }
959
- }, [e.isReady ? (I(), j(D, { key: 0 }, [M("button", {
960
- class: "btn btn-outline-primary me-2",
961
- onClick: t[0] || (t[0] = (...t) => e.cancel && e.cancel(...t))
962
- }, V(e.t("Cancel")), 1), M("button", {
963
- class: "btn btn-primary",
964
- onClick: t[1] || (t[1] = (...t) => e.apply && e.apply(...t))
965
- }, V(e.t("Apply")), 1)], 64)) : A("", !0)], 2)), [[H, e.componentOptions.visible]]);
966
- }
967
- var yt = /*#__PURE__*/ T(_t, [["render", vt]]), bt = P({
968
- name: "pis-classifications-browser-note",
969
- props: { instanceId: {
970
- type: String,
971
- default: void 0
972
- } },
973
- setup(e) {
974
- let t = R(), { componentName: n, isReady: r, isWebComponent: i, instance: a, store: o, routeData: s, t: c } = Q(t, e.instanceId, [Z.Classifications]);
975
- return {
976
- root: t,
977
- store: o,
978
- isReady: r,
979
- instance: a,
980
- routeData: s,
981
- componentName: n,
982
- isWebComponent: i,
983
- componentOptions: O(() => {
984
- var e;
985
- return ((e = o.value) == null || (e = e.options.components) == null || (e = e.browser) == null ? void 0 : e.note) ?? {};
986
- }),
987
- t: c
988
- };
989
- }
990
- }), xt = {
991
- key: 0,
992
- class: "mb-3 card px-3 py-1 bg-light rounded-1"
993
- }, St = { class: "small" }, Ct = { class: "d-inline pe-1" };
994
- function wt(e, t, n, r, i, a) {
995
- let o = je("safe-html");
996
- return G((I(), j("div", {
997
- ref: "root",
998
- class: F(["pis-component", e.componentName]),
999
- style: { "z-index": "1" }
1000
- }, [e.isReady ? (I(), j("div", xt, [M("span", St, [M("strong", Ct, V(e.t("NoteTitle")), 1), G(M("span", null, null, 512), [[o, e.t("NoteBody")]])])])) : A("", !0)], 2)), [[H, e.componentOptions.visible]]);
1001
- }
1002
- var Tt = /*#__PURE__*/ T(bt, [["render", wt]]), Et = {
1003
- value: i.CATALOG_CODE_AND_DESCRIPTION,
1004
- translate: "SearchByCodeAndDescription"
1005
- }, Dt = {
1006
- value: i.CREATED_BY,
1007
- translate: "SearchByCreatedBy"
1008
- }, Ot = P({
1009
- name: "pis-classifications-browser-search-form",
1010
- components: {
1011
- Btn: l,
1012
- Spinner: m,
1013
- Dropdown: u,
1014
- Clickable: c,
1015
- Highlighter: f,
1016
- FormInputClearable: le
1017
- },
1018
- props: { instanceId: {
1019
- type: String,
1020
- default: void 0
1021
- } },
1022
- setup(e) {
1023
- let t = R(), n = L({
1024
- text: "",
1025
- type: i.CATALOG_CODE_AND_DESCRIPTION,
1026
- isDirty: !1
1027
- }), r = R({
1028
- totalCount: 0,
1029
- visibleMatchCount: 0,
1030
- items: []
1031
- }), a = R(!1), o = R(!1), { componentName: s, isReady: c, isWebComponent: l, instance: u, store: d, routeData: f, widerThan: p, narrowerThan: m, t: h } = Q(t, e.instanceId), g = O(() => {
1032
- var e;
1033
- return (e = d.value) == null || (e = e.options.components) == null || (e = e.browser) == null || (e = e.form) == null ? void 0 : e.visible;
1034
- }), _ = O(() => {
1035
- var e;
1036
- return (e = d.value) == null || (e = e.options.components) == null || (e = e.browser) == null || (e = e.form) == null ? void 0 : e.useAutocomplete;
1037
- }), v = [Et, Dt], y = O(() => v), b = async () => {
1038
- a.value = !1;
1039
- try {
1040
- var e;
1041
- await ((e = u.value) == null ? void 0 : e.execute(new Re({ searchText: n.text }).from(s))), n.isDirty = !1;
1042
- } catch {}
1043
- }, te = (e) => {
1044
- n.text = e, b();
1045
- }, x = () => {
1046
- n.isDirty || (n.text = "", r.value.items = [], r.value.totalCount = 0, b());
1047
- }, S = () => {
1048
- var e;
1049
- _.value && n.text != ((e = f.value) == null ? void 0 : e.searchText) && n.text.length > 2 && (a.value = !0);
1050
- }, C = R([]), ne = () => {
1051
- a.value = !1;
1052
- }, re = ee(async (e) => {
1053
- {
1054
- let i = [], c = 0, l = 0, d = (e || "").trim();
1055
- if (_.value && d.length > 2) {
1056
- o.value = !0, C.value = d.toLowerCase().split(/[._-\s/]+/).concat([d]);
1057
- try {
1058
- var t, n;
1059
- let r = await ((t = u.value) == null ? void 0 : t.execute(new ze({ searchText: e }).from(s)));
1060
- i = ((r == null ? void 0 : r.matches) || []).map((e) => ({
1061
- text: e,
1062
- type: "item"
1063
- })), c = (r == null ? void 0 : r.totalCount) || 0, l = (r == null || (n = r.matches) == null ? void 0 : n.length) || 0;
1064
- } catch {}
1065
- }
1066
- r.value = {
1067
- items: i,
1068
- totalCount: c,
1069
- visibleMatchCount: l
1070
- }, a.value = r.value.items.length > 0, o.value = !1;
1071
- }
1072
- }, 600);
1073
- return U(() => {
1074
- var e;
1075
- return (e = f.value) == null ? void 0 : e.searchText;
1076
- }, (e, t) => {
1077
- e !== t && (n.text = e ?? "");
1078
- }), {
1079
- root: t,
1080
- componentName: s,
1081
- isReady: c,
1082
- isWebComponent: l,
1083
- store: d,
1084
- searchModel: n,
1085
- searchTypeOptions: y,
1086
- autocomplete: r,
1087
- isAutocompleteVisible: a,
1088
- isAutocompleteLoading: o,
1089
- autocompleteHighlightTerms: C,
1090
- widerThan: p,
1091
- narrowerThan: m,
1092
- t: h,
1093
- onSearch: b,
1094
- onSearchInput: () => {
1095
- var e, t;
1096
- n.isDirty = ((e = n.text) == null ? void 0 : e.length) > 0 && n.text != ((t = f.value) == null ? void 0 : t.searchText), re(n.text);
1097
- },
1098
- onClear: x,
1099
- searchText: te,
1100
- openAutocomplete: S,
1101
- closeAutocomplete: ne,
1102
- visible: g
1103
- };
1104
- }
1105
- }), kt = { key: 0 }, At = { class: "fw-bold ext-display-name" }, jt = {
1106
- key: 0,
1107
- class: "text-center"
1108
- }, Mt = { key: 1 }, Nt = { key: 2 }, Pt = { class: "d-none d-sm-inline" };
1109
- function Ft(e, t, n, r, i, a) {
1110
- let o = B("Highlighter"), s = B("Clickable"), c = B("Spinner"), l = B("FormInputClearable"), u = B("Btn"), d = B("Dropdown");
1111
- return G((I(), j("div", {
1112
- ref: "root",
1113
- class: F(["pis-component", e.componentName])
1114
- }, [e.isReady ? (I(), j("div", kt, [N(d, {
1115
- open: e.isAutocompleteVisible,
1116
- "onUpdate:open": t[2] || (t[2] = (t) => e.isAutocompleteVisible = t),
1117
- "min-width": "340px",
1118
- items: e.autocomplete.items
1119
- }, {
1120
- item: W(({ item: t }) => [N(s, {
1121
- class: "dropdown-item",
1122
- onClick: (n) => e.searchText(t.text)
1123
- }, {
1124
- default: W(() => [M("div", At, [N(o, {
1125
- "highlight-class-name": "text-primary p-0 display-inline bg-transparent ext-highlight",
1126
- "highlight-tag": "span",
1127
- "search-words": e.autocompleteHighlightTerms,
1128
- "auto-escape": !0,
1129
- "text-to-highlight": t.text
1130
- }, null, 8, ["search-words", "text-to-highlight"])])]),
1131
- _: 2
1132
- }, 1032, ["onClick"])]),
1133
- footer: W(() => [e.isAutocompleteLoading ? (I(), j("div", jt, [N(c, { sm: "" })])) : e.autocomplete.totalCount ? (I(), j("small", Mt, V(e.t("ShowingNOfNMatches", !1, [`${e.autocomplete.visibleMatchCount || 0}`, `${e.autocomplete.totalCount || 0}`])), 1)) : (I(), j("small", Nt, V(e.t("NoResults")), 1))]),
1134
- activator: W(({ on: n }) => [M("form", {
1135
- class: "input-group flex-nowrap",
1136
- onSubmit: t[1] || (t[1] = K((t) => e.onSearch(), ["prevent"]))
1137
- }, [N(l, Oe({
1138
- modelValue: e.searchModel.text,
1139
- "onUpdate:modelValue": t[0] || (t[0] = (t) => e.searchModel.text = t),
1140
- "class-inner": "border-end-0",
1141
- placeholder: e.t("SearchClassificationsInputPlaceholder")
1142
- }, Me(n), {
1143
- "onUpdate:modelValue": e.onSearchInput,
1144
- onClear: e.onClear,
1145
- onFocus: e.openAutocomplete
1146
- }), null, 16, [
1147
- "modelValue",
1148
- "placeholder",
1149
- "onUpdate:modelValue",
1150
- "onClear",
1151
- "onFocus"
1152
- ]), N(u, {
1153
- "aria-label": e.t("SearchButtonText"),
1154
- icon: "lens-search-find"
1155
- }, {
1156
- default: W(() => [M("span", Pt, V(e.t("SearchButtonText")), 1)]),
1157
- _: 1
1158
- }, 8, ["aria-label"])], 32)]),
1159
- _: 1
1160
- }, 8, ["open", "items"])])) : A("", !0)], 2)), [[H, e.visible]]);
1161
- }
1162
- var It = /*#__PURE__*/ T(Ot, [["render", Ft]]), Lt = P({
1163
- name: "pis-classifications-browser-selection",
1164
- components: {
1165
- Icon: a,
1166
- Tooltip: d
1167
- },
1168
- props: { instanceId: {
1169
- type: String,
1170
- default: void 0
1171
- } },
1172
- setup(e) {
1173
- let t = R(), { componentName: n, isReady: r, isWebComponent: i, instance: a, store: s, routeData: c, narrowerThan: l, emit: u, t: d } = Q(t, e.instanceId, [Z.Classifications]), f = O(() => {
1174
- var e;
1175
- return ((e = s.value) == null || (e = e.options.components) == null || (e = e.browser) == null ? void 0 : e.selection) ?? {};
1176
- }), p = O(() => {
1177
- var e;
1178
- return ((e = a.value) == null ? void 0 : e.selection.selectedItems) || [];
1179
- }), m = O(() => p.value.filter((e) => e.tree == h.OFFERING)), g = O(() => p.value.filter((e) => e.tree == h.PRODUCT_LINE));
1180
- return {
1181
- root: t,
1182
- store: s,
1183
- isReady: r,
1184
- instance: a,
1185
- routeData: c,
1186
- componentName: n,
1187
- isWebComponent: i,
1188
- componentOptions: f,
1189
- nodes: p,
1190
- selection: O(() => {
1191
- var e;
1192
- return (e = a.value) == null ? void 0 : e.selection;
1193
- }),
1194
- height: O(() => l("sm") ? f.value.mobileScrollHeight + "px" : f.value.scrollHeight + "px"),
1195
- t: d,
1196
- emit: u,
1197
- attrValue: ne,
1198
- attrValues: oe,
1199
- additionalInfo: Te,
1200
- clearAll: () => {
1201
- try {
1202
- var e;
1203
- (e = a.value) == null || e.execute(new Ze().from(n));
1204
- } catch {}
1205
- },
1206
- ProductGroupValidationStatusEnum: o,
1207
- offeringNodes: m,
1208
- plNodes: g
1209
- };
1210
- }
1211
- }), Rt = { class: "d-flex" }, zt = { class: "flex-grow-1 fw-bold" }, Bt = { key: 0 }, Vt = {
1212
- key: 0,
1213
- class: "fw-bold my-2"
1214
- }, Ht = { class: "flex-grow-1 d-flex" }, Ut = { key: 0 }, Wt = ["onClick"], Gt = {
1215
- key: 1,
1216
- class: "fw-bold my-2"
1217
- }, Kt = { class: "flex-grow-1 d-flex" }, qt = { key: 0 }, Jt = ["onClick"], Yt = {
1218
- key: 1,
1219
- class: "p-3 text-muted"
1220
- };
1221
- function Xt(e, t, n, r, i, a) {
1222
- let o = B("Icon"), s = B("Tooltip");
1223
- return G((I(), j("div", {
1224
- ref: "root",
1225
- class: F(["pis-component", e.componentName]),
1226
- style: { "z-index": "1" }
1227
- }, [e.isReady ? (I(), j(D, { key: 0 }, [M("div", Rt, [M("div", zt, V(e.t("SelectedLabel")), 1), e.nodes.length ? (I(), j("a", {
1228
- key: 0,
1229
- href: "#",
1230
- class: "small",
1231
- onClick: t[0] || (t[0] = K((...t) => e.clearAll && e.clearAll(...t), ["prevent"]))
1232
- }, V(e.t("ClearAll")), 1)) : A("", !0)]), M("div", {
1233
- class: "overflow-auto border p-1",
1234
- style: ke({ height: e.height })
1235
- }, [e.nodes && e.nodes.length ? (I(), j("div", Bt, [
1236
- e.offeringNodes.length ? (I(), j("div", Vt, V(e.t("OfferingTree")), 1)) : A("", !0),
1237
- (I(!0), j(D, null, z(e.offeringNodes, (t) => (I(), j("div", {
1238
- key: t.cid,
1239
- class: "border p-1 mb-1 bg-light d-flex align-items-center rounded-2"
1240
- }, [M("div", Ht, [M("div", null, V(t.name), 1), t.productGroup.status === e.ProductGroupValidationStatusEnum.INVALID ? (I(), j("div", Ut, [N(s, {
1241
- trigger: "hover",
1242
- text: e.t("InvalidProductGroup"),
1243
- delay: 100
1244
- }, {
1245
- default: W(() => [N(o, {
1246
- name: "warning-triangle",
1247
- size: 16,
1248
- class: "ms-1 text-warning"
1249
- })]),
1250
- _: 1
1251
- }, 8, ["text"])])) : A("", !0)]), M("a", {
1252
- href: "#",
1253
- class: "text-dark pis-hover p-2 d-flex rounded-circle",
1254
- onClick: K((n) => {
1255
- var r;
1256
- return (r = e.selection) == null ? void 0 : r.deselect([t]);
1257
- }, ["prevent"])
1258
- }, [N(o, {
1259
- name: "cross-close",
1260
- size: 16
1261
- })], 8, Wt)]))), 128)),
1262
- e.plNodes.length ? (I(), j("div", Gt, V(e.t("ProductLineTree")), 1)) : A("", !0),
1263
- (I(!0), j(D, null, z(e.plNodes, (t) => (I(), j("div", {
1264
- key: t.cid,
1265
- class: "border p-1 mb-1 bg-light d-flex align-items-center rounded-2"
1266
- }, [M("div", Kt, [M("div", null, V(t.name), 1), t.productGroup.status === e.ProductGroupValidationStatusEnum.INVALID ? (I(), j("div", qt, [N(s, {
1267
- trigger: "hover",
1268
- text: e.t("InvalidProductGroup"),
1269
- delay: 100
1270
- }, {
1271
- default: W(() => [N(o, {
1272
- name: "warning-triangle",
1273
- size: 16,
1274
- class: "ms-1 text-warning"
1275
- })]),
1276
- _: 1
1277
- }, 8, ["text"])])) : A("", !0)]), M("a", {
1278
- href: "#",
1279
- class: "text-dark pis-hover p-2 d-flex rounded-circle",
1280
- onClick: K((n) => {
1281
- var r;
1282
- return (r = e.selection) == null ? void 0 : r.deselect([t]);
1283
- }, ["prevent"])
1284
- }, [N(o, {
1285
- name: "cross-close",
1286
- size: 16
1287
- })], 8, Jt)]))), 128))
1288
- ])) : (I(), j("div", Yt, V(e.t("NothingSelected")), 1))], 4)], 64)) : A("", !0)], 2)), [[H, e.componentOptions.visible]]);
1289
- }
1290
- var Zt = /*#__PURE__*/ T(Lt, [["render", Xt]]), $ = "0px", Qt = P({
1291
- name: "ClassificationNode",
1292
- components: {
1293
- Icon: a,
1294
- Tooltip: d,
1295
- TransitionHeight: /* @__PURE__ */ P({
1296
- __name: "TransitionHeight",
1297
- props: {
1298
- duration: { default: 100 },
1299
- easingEnter: { default: "ease-in-out" },
1300
- easingLeave: { default: "ease-in-out" },
1301
- opacityClosed: { default: 0 },
1302
- opacityOpened: { default: 1 }
1303
- },
1304
- setup(e) {
1305
- let t = e;
1306
- function n(e) {
1307
- return {
1308
- height: e.style.height,
1309
- width: e.style.width,
1310
- position: e.style.position,
1311
- visibility: e.style.visibility,
1312
- overflow: e.style.overflow,
1313
- paddingTop: e.style.paddingTop,
1314
- paddingBottom: e.style.paddingBottom,
1315
- borderTopWidth: e.style.borderTopWidth,
1316
- borderBottomWidth: e.style.borderBottomWidth,
1317
- marginTop: e.style.marginTop,
1318
- marginBottom: e.style.marginBottom
1319
- };
1320
- }
1321
- function r(e, t) {
1322
- let { width: n } = getComputedStyle(e);
1323
- e.style.width = n, e.style.position = "absolute", e.style.visibility = "hidden", e.style.height = "";
1324
- let { height: r } = getComputedStyle(e);
1325
- return e.style.width = t.width, e.style.position = t.position, e.style.visibility = t.visibility, e.style.height = $, e.style.overflow = "hidden", t.height && t.height != $ ? t.height : r;
1326
- }
1327
- function i(e, t, n, r, i) {
1328
- let a = e.animate(r, i);
1329
- e.style.height = t.height, a.onfinish = () => {
1330
- e.style.overflow = t.overflow, n();
1331
- };
1332
- }
1333
- function a(e, n) {
1334
- return [{
1335
- height: $,
1336
- opacity: t.opacityClosed,
1337
- paddingTop: $,
1338
- paddingBottom: $,
1339
- borderTopWidth: $,
1340
- borderBottomWidth: $,
1341
- marginTop: $,
1342
- marginBottom: $
1343
- }, {
1344
- height: e,
1345
- opacity: t.opacityOpened,
1346
- paddingTop: n.paddingTop,
1347
- paddingBottom: n.paddingBottom,
1348
- borderTopWidth: n.borderTopWidth,
1349
- borderBottomWidth: n.borderBottomWidth,
1350
- marginTop: n.marginTop,
1351
- marginBottom: n.marginBottom
1352
- }];
1353
- }
1354
- function o(e, o) {
1355
- let s = e, c = n(s);
1356
- i(s, c, o, a(r(s, c), c), {
1357
- duration: t.duration,
1358
- easing: t.easingEnter
1359
- });
1360
- }
1361
- function s(e, r) {
1362
- let o = e, s = n(o), { height: c } = getComputedStyle(o);
1363
- o.style.height = c, o.style.overflow = "hidden", i(o, s, r, a(c, s).reverse(), {
1364
- duration: t.duration,
1365
- easing: t.easingLeave
1366
- });
1367
- }
1368
- return (e, t) => (I(), k(Ee, {
1369
- css: !1,
1370
- onEnter: o,
1371
- onLeave: s
1372
- }, {
1373
- default: W(() => [Ae(e.$slots, "default")]),
1374
- _: 3
1375
- }));
1376
- }
1377
- })
1378
- },
1379
- props: {
1380
- item: {
1381
- type: Object,
1382
- required: !0
1383
- },
1384
- t: {
1385
- type: Function,
1386
- required: !0
1387
- },
1388
- instanceId: {
1389
- type: String,
1390
- default: void 0
1391
- }
1392
- },
1393
- setup(e) {
1394
- let t = O(() => e.item._isExpanded), n = O(() => e.item._isLoading), r = O(() => b.Classifications.getInstance(e.instanceId)), i = O(() => {
1395
- var e;
1396
- return (e = r.value) == null ? void 0 : e.selection;
1397
- }), a = O(() => {
1398
- var e;
1399
- return (e = r.value) == null ? void 0 : e.favorites;
1400
- }), s = O(() => {
1401
- var t;
1402
- return (t = i.value) == null ? void 0 : t.isSelected(e.item);
1403
- }), c = O(() => {
1404
- var t;
1405
- return (t = a.value) == null ? void 0 : t.isSelected(e.item);
1406
- }), l = O(() => {
1407
- var e;
1408
- return (((e = r.value) == null || (e = e.getOptions().components) == null || (e = e.browser) == null || (e = e.tabs) == null ? void 0 : e.items) || []).some((e) => e.type === E.FAVORITES);
1409
- }), u = O(() => {
1410
- var t;
1411
- return ((t = e.item.productGroup) == null ? void 0 : t.status) === o.INVALID;
1412
- }), d = O(() => {
1413
- var t;
1414
- return ((t = e.item.productGroup) == null ? void 0 : t.status) === o.VALID;
1415
- }), f = O(() => {
1416
- var e, t;
1417
- let n = (e = r.value) == null ? void 0 : e.getRouteData();
1418
- return Y(((t = r.value) == null || (t = t.getOptions().components) == null || (t = t.browser) == null || (t = t.tabs) == null ? void 0 : t.items) ?? [], n == null ? void 0 : n.tabId);
1419
- });
1420
- return {
1421
- isExpanded: t,
1422
- isLoading: n,
1423
- isSelected: s,
1424
- isFavorite: c,
1425
- isInvalidPg: u,
1426
- isValidPg: d,
1427
- selection: i,
1428
- areFavoritesEnabled: l,
1429
- activeTab: f,
1430
- isLeaf: O(() => {
1431
- var t, n;
1432
- return ((t = f.value) == null ? void 0 : t.type) === E.FAVORITES && !((n = f.value) != null && n.itemsExpandable) ? !e.item.children : e.item.leaf;
1433
- }),
1434
- toggleNode: async () => {
1435
- if (!e.item.leaf) try {
1436
- if (t.value) {
1437
- var n;
1438
- await ((n = r.value) == null ? void 0 : n.execute(new Ve({ item: e.item }).from("classifications-tree")));
1439
- } else {
1440
- var i;
1441
- await ((i = r.value) == null ? void 0 : i.execute(new Be({ item: e.item }).from("classifications-tree")));
1442
- }
1443
- } catch {}
1444
- },
1445
- toggleSelection: async () => {
1446
- try {
1447
- var t;
1448
- if ((t = i.value) != null && t.isSelected(e.item)) {
1449
- var n;
1450
- await ((n = r.value) == null ? void 0 : n.execute(new Je({ item: e.item }).from("classifications-tree")));
1451
- } else {
1452
- var a;
1453
- await ((a = r.value) == null ? void 0 : a.execute(new qe({ item: e.item }).from("classifications-tree")));
1454
- }
1455
- } catch {}
1456
- },
1457
- toggleFavorite: async () => {
1458
- try {
1459
- var t;
1460
- if ((t = a.value) != null && t.isSelected(e.item)) {
1461
- var n;
1462
- await ((n = r.value) == null ? void 0 : n.execute(new Xe({ item: e.item }).from("classifications-tree")));
1463
- } else {
1464
- var i;
1465
- await ((i = r.value) == null ? void 0 : i.execute(new Ye({ item: e.item }).from("classifications-tree")));
1466
- }
1467
- } catch {}
1468
- }
1469
- };
1470
- }
1471
- }), $t = { class: "pis-tree-node" }, en = { class: "d-flex align-items-center" }, tn = {
1472
- key: 0,
1473
- class: "spinner-border spinner-border-sm mx-2 mt-1 mb-2",
1474
- role: "status"
1475
- }, nn = { class: "form-check d-flex" }, rn = [
1476
- "id",
1477
- "checked",
1478
- "disabled"
1479
- ], an = ["for"], on = {
1480
- key: 0,
1481
- class: "text-primary pis-hover rounded-2 text-nowrap px-1"
1482
- }, sn = {
1483
- key: 1,
1484
- class: "pis-hover text-nowrap rounded-2 px-1"
1485
- }, cn = { key: 0 }, ln = {
1486
- key: 1,
1487
- class: "ms-1"
1488
- }, un = {
1489
- key: 0,
1490
- class: "pis-tree"
1491
- };
1492
- function dn(e, t, n, r, i, a) {
1493
- let o = B("Icon"), s = B("Tooltip"), c = B("ClassificationNode", !0), l = B("TransitionHeight");
1494
- return I(), j("li", $t, [M("div", en, [e.isLeaf ? (I(), k(o, {
1495
- key: 0,
1496
- name: "plus-add",
1497
- size: 16,
1498
- class: "me-1 p-2",
1499
- style: { opacity: "0" }
1500
- })) : (I(), j(D, { key: 1 }, [e.isLoading ? (I(), j("div", tn, [...t[5] || (t[5] = [M("span", { class: "visually-hidden" }, "Loading...", -1)])])) : (I(), j(D, { key: 1 }, [e.isExpanded ? (I(), j("a", {
1501
- key: 0,
1502
- href: "#",
1503
- class: "text-dark me-1 pis-hover p-2 d-flex rounded-circle",
1504
- onClick: t[0] || (t[0] = K((...t) => e.toggleNode && e.toggleNode(...t), ["prevent"]))
1505
- }, [N(o, {
1506
- name: "arrow-right",
1507
- size: 16,
1508
- style: { transform: "rotate(90deg)" }
1509
- })])) : (I(), j("a", {
1510
- key: 1,
1511
- href: "",
1512
- class: "text-dark me-1 pis-hover p-2 d-flex rounded-circle",
1513
- onClick: t[1] || (t[1] = K((...t) => e.toggleNode && e.toggleNode(...t), ["prevent"]))
1514
- }, [N(o, {
1515
- name: "arrow-right",
1516
- size: 16
1517
- })]))], 64))], 64)), M("div", nn, [
1518
- M("input", {
1519
- id: "cid_" + e.item.cid,
1520
- class: "form-check-input me-2",
1521
- type: "checkbox",
1522
- checked: e.isSelected,
1523
- disabled: !e.item.selectable,
1524
- onChange: t[2] || (t[2] = (...t) => e.toggleSelection && e.toggleSelection(...t))
1525
- }, null, 40, rn),
1526
- M("label", {
1527
- for: "cid_" + e.item.cid,
1528
- class: F(["form-check-label user-select-none opacity-100 d-flex align-items-center", [e.item.match && "bg-light"]]),
1529
- onDblclick: t[3] || (t[3] = K((...t) => e.toggleNode && e.toggleNode(...t), ["prevent"]))
1530
- }, [e.isValidPg ? (I(), j("div", on, [N(s, {
1531
- trigger: "hover",
1532
- delay: 200,
1533
- text: e.item.productGroup.code + " - " + e.item.productGroup.name
1534
- }, {
1535
- default: W(() => [De(V(e.item.name), 1)]),
1536
- _: 1
1537
- }, 8, ["text"])])) : (I(), j("div", sn, V(e.item.name), 1))], 42, an),
1538
- e.isInvalidPg ? (I(), j("div", cn, [N(s, {
1539
- trigger: "hover",
1540
- text: e.t("InvalidProductGroup"),
1541
- delay: 100
1542
- }, {
1543
- default: W(() => [N(o, {
1544
- name: "warning-triangle",
1545
- size: 16,
1546
- class: "ms-1 text-warning"
1547
- })]),
1548
- _: 1
1549
- }, 8, ["text"])])) : e.areFavoritesEnabled ? (I(), j("div", ln, [N(s, {
1550
- trigger: "hover",
1551
- text: e.t("FavoritesTooltip"),
1552
- delay: 100
1553
- }, {
1554
- default: W(() => [M("a", {
1555
- href: "#",
1556
- class: F(["pis-hover p-1 d-flex rounded-circle", [e.isFavorite && "text-warning", !e.isFavorite && "text-secondary"]]),
1557
- onClick: t[4] || (t[4] = K((...t) => e.toggleFavorite && e.toggleFavorite(...t), ["prevent"]))
1558
- }, [N(o, {
1559
- name: "star",
1560
- size: 16
1561
- })], 2)]),
1562
- _: 1
1563
- }, 8, ["text"])])) : A("", !0)
1564
- ])]), N(l, null, {
1565
- default: W(() => [e.item.children && e.isExpanded ? (I(), j("ul", un, [(I(!0), j(D, null, z(e.item.children, (t) => (I(), k(c, {
1566
- key: t.cid,
1567
- item: t,
1568
- t: e.t,
1569
- "instance-id": e.instanceId
1570
- }, null, 8, [
1571
- "item",
1572
- "t",
1573
- "instance-id"
1574
- ]))), 128))])) : A("", !0)]),
1575
- _: 1
1576
- })]);
1577
- }
1578
- //#endregion
1579
- //#region src/classifications/components/common/ClassificationRootNode.vue?vue&type=script&lang.ts
1580
- var fn = P({
1581
- components: { ClassificationNode: /* @__PURE__ */ T(Qt, [["render", dn]]) },
1582
- props: {
1583
- items: {
1584
- type: Object,
1585
- required: !0
1586
- },
1587
- t: {
1588
- type: Function,
1589
- required: !0
1590
- },
1591
- instanceId: {
1592
- type: String,
1593
- required: !0
1594
- }
1595
- },
1596
- setup() {
1597
- return {};
1598
- }
1599
- }), pn = { class: "pis-tree ps-0" };
1600
- function mn(e, t, n, r, i, a) {
1601
- let o = B("ClassificationNode");
1602
- return I(), j("ul", pn, [(I(!0), j(D, null, z(e.items, (t) => (I(), k(o, {
1603
- key: t.cid,
1604
- item: t,
1605
- "instance-id": e.instanceId,
1606
- t: e.t
1607
- }, null, 8, [
1608
- "item",
1609
- "instance-id",
1610
- "t"
1611
- ]))), 128))]);
1612
- }
1613
- //#endregion
1614
- //#region src/classifications/components/browser/ClassificationsTree.vue?vue&type=script&lang.ts
1615
- var hn = P({
1616
- name: "pis-classifications-browser-tree",
1617
- components: { ClassificationRootNode: /* @__PURE__ */ T(fn, [["render", mn]]) },
1618
- props: { instanceId: {
1619
- type: String,
1620
- default: void 0
1621
- } },
1622
- setup(e) {
1623
- let t = R(), { componentName: n, isReady: r, isWebComponent: i, instance: a, store: o, routeData: s, narrowerThan: c, emit: l, t: u } = Q(t, e.instanceId, [Z.Classifications]), d = R([]), f = O(() => {
1624
- var e, t;
1625
- return ((e = ((t = o.value) == null || (t = t.options.components) == null || (t = t.browser) == null ? void 0 : t.tabs) ?? {}) == null || (e = e.items) == null ? void 0 : e.map((e) => e.type)) ?? [];
1626
- }), p = O(() => {
1627
- var e;
1628
- return ((e = o.value) == null || (e = e.options.components) == null || (e = e.browser) == null ? void 0 : e.tree) ?? {};
1629
- }), m = O(() => {
1630
- var e, t;
1631
- return v.value && f.value.indexOf(E.PRODUCT_LINE) < 0 ? ((e = o.value) == null || (e = e.data.classifications) == null || (e = e.items) == null ? void 0 : e.filter((e) => e.tree != h.PRODUCT_LINE)) ?? [] : ((t = o.value) == null || (t = t.data.classifications) == null ? void 0 : t.items) ?? [];
1632
- }), g = O(() => {
1633
- var e;
1634
- return (e = o.value) == null || (e = e.data.classifications) == null ? void 0 : e.limitExceeded;
1635
- }), _ = O(() => {
1636
- var e, t;
1637
- return Y(((e = o.value) == null || (e = e.options.components) == null || (e = e.browser) == null || (e = e.tabs) == null ? void 0 : e.items) ?? [], (t = s.value) == null ? void 0 : t.tabId);
1638
- }), v = O(() => {
1639
- var e;
1640
- return ((e = _.value) == null ? void 0 : e.type) === E.FAVORITES;
1641
- }), y = O(() => {
1642
- var e;
1643
- return v.value && ((e = o.value) == null || (e = e.options.components) == null || (e = e.browser) == null || (e = e.common) == null || (e = e.toolbar) == null ? void 0 : e.expandFavoritesVisible);
1644
- }), b = async () => {
1645
- try {
1646
- var e;
1647
- await ((e = a.value) == null ? void 0 : e.execute(new He().from(n)));
1648
- } catch {}
1649
- }, te = async () => {
1650
- try {
1651
- var e;
1652
- await ((e = a.value) == null ? void 0 : e.execute(new Ue().from(n)));
1653
- } catch {}
1654
- }, x = O(() => c("sm") ? p.value.mobileScrollHeight + "px" : p.value.scrollHeight + "px"), S = ee(() => {
1655
- try {
1656
- if (d.value.length) {
1657
- var e;
1658
- (e = a.value) == null || e.execute(new et({
1659
- message: d.value.join("<br>"),
1660
- type: "warning",
1661
- dismissAfter: 0
1662
- }).from(n)), d.value = [];
1663
- }
1664
- } catch {}
1665
- }, 500), C = U(() => {
1666
- var e;
1667
- return (e = a.value) == null ? void 0 : e.store.data.invalidSelectedItems;
1668
- }, async () => {
1669
- var e;
1670
- let t = (e = a.value) == null ? void 0 : e.store.data.invalidSelectedItems;
1671
- t && t != null && t.length && (C(), d.value.push(u("InvalidSelectedItemsWarning", !1, [t.map((e) => e.cid).join(", ")])), S());
1672
- }, { immediate: !0 }), ne = U(() => {
1673
- var e;
1674
- return (e = a.value) == null ? void 0 : e.store.data.invalidFavoriteItems;
1675
- }, async () => {
1676
- var e;
1677
- let t = (e = a.value) == null ? void 0 : e.store.data.invalidFavoriteItems;
1678
- t && t != null && t.length && (ne(), d.value.push(u("InvalidFavoriteItemsWarning", !1, [t.map((e) => e.cid).join(", ")])), S());
1679
- }, { immediate: !0 });
1680
- return {
1681
- root: t,
1682
- store: o,
1683
- nodes: m,
1684
- height: x,
1685
- isReady: r,
1686
- instance: a,
1687
- routeData: s,
1688
- componentName: n,
1689
- isWebComponent: i,
1690
- isLimitExceeded: g,
1691
- componentOptions: p,
1692
- isOnFavoritesView: v,
1693
- isExpandFavoritesVisible: y,
1694
- t: u,
1695
- emit: l,
1696
- collapseAll: b,
1697
- expandAll: te
1698
- };
1699
- }
1700
- }), gn = { class: "d-flex" }, _n = { class: "flex-grow-1 fw-bold" }, vn = {
1701
- key: 0,
1702
- class: "p-3 mb-1 text-muted"
1703
- }, yn = { key: 1 }, bn = {
1704
- key: 2,
1705
- class: "p-3 text-muted"
1706
- };
1707
- function xn(e, t, n, r, i, a) {
1708
- let o = B("ClassificationRootNode");
1709
- return G((I(), j("div", {
1710
- ref: "root",
1711
- class: F(["pis-component", e.componentName]),
1712
- style: { "z-index": "1" }
1713
- }, [e.isReady ? (I(), j(D, { key: 0 }, [M("div", gn, [
1714
- M("div", _n, V(e.t("SelectLabel")), 1),
1715
- M("a", {
1716
- href: "#",
1717
- class: "small text-end",
1718
- onClick: t[0] || (t[0] = K((...t) => e.collapseAll && e.collapseAll(...t), ["prevent"]))
1719
- }, V(e.t("CollapseAllClassifications")), 1),
1720
- e.isExpandFavoritesVisible ? (I(), j("a", {
1721
- key: 0,
1722
- href: "#",
1723
- class: "small ms-2 text-end",
1724
- onClick: t[1] || (t[1] = K((...t) => e.expandAll && e.expandAll(...t), ["prevent"]))
1725
- }, V(e.t("ExpandAllFavorites")), 1)) : A("", !0)
1726
- ]), M("div", {
1727
- class: "overflow-auto border p-1",
1728
- style: ke({ height: e.height })
1729
- }, [e.isLimitExceeded ? (I(), j("div", vn, V(e.t("SearchLimitExceeded")), 1)) : A("", !0), e.nodes.length ? (I(), j("div", yn, [N(o, {
1730
- items: e.nodes,
1731
- "instance-id": e.instance.id,
1732
- t: e.t
1733
- }, null, 8, [
1734
- "items",
1735
- "instance-id",
1736
- "t"
1737
- ])])) : (I(), j("div", bn, V(e.isOnFavoritesView ? e.t("NoFavoritesSelected") : e.t("NoResults")), 1))], 4)], 64)) : A("", !0)], 2)), [[H, e.componentOptions.visible]]);
1738
- }
1739
- var Sn = /*#__PURE__*/ T(hn, [["render", xn]]), Cn = P({
1740
- name: "pis-classifications-browser-tree-type-tabs",
1741
- components: {
1742
- Icon: a,
1743
- MountPoint: _
1744
- },
1745
- props: { instanceId: {
1746
- type: String,
1747
- default: void 0
1748
- } },
1749
- setup(e) {
1750
- let t = R(), { componentName: n, instance: r, isReady: i, isWebComponent: a, store: o, t: s, narrowerThan: c } = Q(t, e.instanceId), l = {
1751
- Offering: "OfferingTree",
1752
- ProductLine: "ProductLineTree",
1753
- Favorites: "MyFavorites",
1754
- OfferingAndProductLine: "OfferingAndProductLine"
1755
- }, u = (e) => {
1756
- switch (e) {
1757
- case "Offering":
1758
- var t;
1759
- return ((t = r.value) == null ? void 0 : t.selection.selectedItems.filter((e) => e.tree == h.OFFERING).length) ?? 0;
1760
- case "ProductLine":
1761
- var n;
1762
- return ((n = r.value) == null ? void 0 : n.selection.selectedItems.filter((e) => e.tree == h.PRODUCT_LINE).length) ?? 0;
1763
- case "Favorites":
1764
- var i;
1765
- return ((i = r.value) == null ? void 0 : i.favorites.selectedItems.length) ?? 0;
1766
- default: return 0;
1767
- }
1768
- }, d = O(() => {
1769
- var e;
1770
- return ((e = o.value) == null || (e = e.options.components) == null || (e = e.browser) == null ? void 0 : e.tabs) ?? {};
1771
- }), f = O(() => {
1772
- var e;
1773
- return (e = r.value) == null ? void 0 : e.router.routeData;
1774
- }), p = O(() => {
1775
- var e;
1776
- return (e = f.value) == null ? void 0 : e.tabId;
1777
- }), m = O(() => {
1778
- var e;
1779
- return (((e = d.value) == null ? void 0 : e.items) ?? []).filter((e) => e.visible !== !1);
1780
- }), _ = g((e) => ({
1781
- instance: r.value,
1782
- tab: e,
1783
- t: s
1784
- }));
1785
- return {
1786
- root: t,
1787
- visible: O(() => {
1788
- var e;
1789
- return (e = d.value) == null ? void 0 : e.visible;
1790
- }),
1791
- store: o,
1792
- isReady: i,
1793
- activeTabKey: p,
1794
- visibleTabs: m,
1795
- componentName: n,
1796
- isWebComponent: a,
1797
- translationMap: l,
1798
- componentOptions: d,
1799
- t: s,
1800
- switchToView: async (e) => {
1801
- try {
1802
- var t;
1803
- await ((t = r.value) == null ? void 0 : t.execute(new Ke({ tabId: e.id ?? e.type }).from(n)));
1804
- } catch {}
1805
- },
1806
- narrowerThan: c,
1807
- getCount: u,
1808
- tabContext: _
1809
- };
1810
- }
1811
- }), wn = {
1812
- key: 0,
1813
- class: "mb-3"
1814
- }, Tn = { class: "nav nav-tabs" }, En = ["onClick"], Dn = { key: 3 }, On = {
1815
- key: 4,
1816
- class: "badge rounded-pill bg-secondary text-body ms-1 small d-none d-sm-inline"
1817
- };
1818
- function kn(e, t, n, r, i, a) {
1819
- let o = B("MountPoint"), s = B("Icon");
1820
- return G((I(), j("div", {
1821
- ref: "root",
1822
- class: F(["pis-component position-relative", e.componentName])
1823
- }, [e.isReady ? (I(), j("div", wn, [M("ul", Tn, [(I(!0), j(D, null, z(e.visibleTabs, (t) => (I(), j("li", {
1824
- key: t.id,
1825
- class: "nav-item",
1826
- style: { "max-width": "33%" }
1827
- }, [M("a", {
1828
- class: F(["nav-link mx-1 text-nowrap pis-text-ellipsis", e.activeTabKey === t.id ? "active" : ""]),
1829
- href: "#",
1830
- onClick: K((n) => e.switchToView(t), ["prevent"])
1831
- }, [e.narrowerThan("md") && t.iconTemplate ? (I(), k(o, {
1832
- key: 0,
1833
- callbacks: t.iconTemplate,
1834
- ctx: e.tabContext(t)
1835
- }, null, 8, ["callbacks", "ctx"])) : e.narrowerThan("md") && t.type === "Favorites" ? (I(), k(s, {
1836
- key: 1,
1837
- class: "px-2",
1838
- name: "star",
1839
- size: 16
1840
- })) : t.labelTemplate ? (I(), k(o, {
1841
- key: 2,
1842
- callbacks: t.labelTemplate,
1843
- ctx: e.tabContext(t)
1844
- }, null, 8, ["callbacks", "ctx"])) : (I(), j("span", Dn, V(e.t(e.translationMap[t.type])), 1)), t.countsVisible && e.getCount(t.type) > 0 ? (I(), j("span", On, V(e.getCount(t.type)), 1)) : A("", !0)], 10, En)]))), 128))])])) : A("", !0)], 2)), [[H, e.visible]]);
1845
- }
1846
- var An = /*#__PURE__*/ T(Cn, [["render", kn]]), jn = P({
1847
- name: "pis-classifications-loading-indicator",
1848
- components: { Spinner: m },
1849
- props: { instanceId: {
1850
- type: String,
1851
- default: void 0
1852
- } },
1853
- setup(e) {
1854
- let t = R(), { componentName: r, isReady: i, isWebComponent: a, store: o, routeData: s } = Q(t, e.instanceId), c = O(() => {
1855
- var e;
1856
- return i.value && !!((e = o.value) != null && e.data.isLoadingData);
1857
- }), l = O(() => {
1858
- var e;
1859
- return !!((e = o.value) != null && (e = e.data.classifications) != null && (e = e.items) != null && e.length);
1860
- });
1861
- return {
1862
- root: t,
1863
- componentName: r,
1864
- isReady: i,
1865
- isWebComponent: a,
1866
- store: o,
1867
- routeData: s,
1868
- showOverlay: n(c, l)
1869
- };
1870
- }
1871
- }), Mn = {
1872
- ref: "root",
1873
- class: "pis-component position-relative"
1874
- }, Nn = {
1875
- class: "position-absolute start-50 top-50",
1876
- style: { "z-index": "2000" }
1877
- };
1878
- function Pn(e, t, n, r, i, a) {
1879
- let o = B("Spinner");
1880
- return I(), j("div", Mn, [e.showOverlay ? (I(), j(D, { key: 0 }, [M("div", Nn, [Ae(e.$slots, "loader", {}, () => [N(o)])]), t[0] || (t[0] = M("div", {
1881
- class: "position-absolute top-0 start-0 end-0 bottom-0 bg-body",
1882
- style: {
1883
- "z-index": "1900",
1884
- opacity: "0.2"
1885
- }
1886
- }, null, -1))], 64)) : A("", !0), Ae(e.$slots, "default")], 512);
1887
- }
1888
- //#endregion
1889
- //#region src/classifications/components/ClassificationsLayout.vue?vue&type=script&lang.ts
1890
- var Fn = P({
1891
- name: "pis-classifications-layout",
1892
- components: {
1893
- LoadingIndicator: /* @__PURE__ */ T(jn, [["render", Pn]]),
1894
- ClassificationsSearchForm: It,
1895
- ClassificationsTree: Sn,
1896
- ClassificationsSelection: Zt,
1897
- ClassificationNote: Tt,
1898
- ClassificationActions: yt,
1899
- ClassificationsTreeTabs: An,
1900
- ClassificationsNotifications: gt
1901
- },
1902
- props: { instanceId: {
1903
- type: String,
1904
- default: void 0
1905
- } },
1906
- setup(e) {
1907
- let t = R(), { componentName: n, instance: r, isWebComponent: i, isReady: a, translationsReady: o, store: s, routeData: c, widerThan: l, t: u } = Q(t, e.instanceId);
1908
- return {
1909
- root: t,
1910
- componentName: n,
1911
- isWebComponent: i,
1912
- isReady: a,
1913
- instance: r,
1914
- translationsReady: o,
1915
- store: s,
1916
- routeData: c,
1917
- allowMobileView: O(() => {
1918
- var e;
1919
- return (e = s.value) == null ? void 0 : e.options.allowMobileView;
1920
- }),
1921
- widerThan: l,
1922
- t: u
1923
- };
1924
- }
1925
- }), In = { class: "container-fluid g-0" }, Ln = { class: "row" }, Rn = { class: "col-md-12" }, zn = { class: "row" }, Bn = { class: "col-md-6 col-sm-12 mb-3" }, Vn = { class: "col-md-6 col-sm-12 text-end mb-3" }, Hn = { class: "row" }, Un = { class: "col-md-6 mb-3" }, Wn = { class: "col-md-6" };
1926
- function Gn(e, t, n, r, i, a) {
1927
- let o = B("ClassificationsNotifications"), s = B("ClassificationNote"), c = B("ClassificationsTreeTabs"), l = B("ClassificationsSearchForm"), u = B("ClassificationActions"), d = B("ClassificationsTree"), f = B("ClassificationsSelection"), p = B("LoadingIndicator");
1928
- return I(), j("div", {
1929
- ref: "root",
1930
- class: F(["pis-component w-100 h-100", e.componentName])
1931
- }, [G(M("div", null, [N(o), N(p, null, {
1932
- default: W(() => [M("div", In, [
1933
- M("div", Ln, [M("div", Rn, [N(s, { t: e.t }, null, 8, ["t"]), N(c)])]),
1934
- M("div", zn, [M("div", Bn, [N(l)]), M("div", Vn, [N(u)])]),
1935
- M("div", Hn, [M("div", Un, [N(d)]), M("div", Wn, [N(f)])])
1936
- ])]),
1937
- _: 1
1938
- })], 512), [[H, e.isReady]])], 2);
1939
- }
1940
- //#endregion
1941
- //#region src/classifications/components/index.ts
1942
- var Kn = [
1943
- /* @__PURE__ */ T(Fn, [["render", Gn]]),
1944
- Sn,
1945
- It,
1946
- Zt,
1947
- An,
1948
- Tt,
1949
- yt,
1950
- gt
1951
- ], qn = be({
1952
- idPrefix: "pisClassificationsInstance_",
1953
- instanceTag: "pis-classifications-instance",
1954
- getInstanceById: (e) => b.Classifications.getInstance(e),
1955
- isReady: (e) => !!(e.store.data.isInitialized && e.store.data.translationsReady),
1956
- hasContent: (e) => {
1957
- var t;
1958
- return !!((t = e.store.data.classifications) != null && (t = t.items) != null && t.length);
1959
- },
1960
- elements: [{
1961
- kind: "instance",
1962
- name: "pis-classifications-instance"
1963
- }, {
1964
- kind: "loader",
1965
- name: "pis-classifications-loading-indicator",
1966
- spinnerZIndex: 2e3,
1967
- backdropZIndex: 1900,
1968
- backdropOpacity: .2
1969
- }]
1970
- });
1971
- //#endregion
1972
- //#region src/classifications/entry.ts
1973
- function Jn() {
1974
- e(new dt()), he(Kn, qn), v();
1975
- }
1976
- var Yn = Kn;
1977
- //#endregion
1978
- export { Kn as i, Jn as n, qn as r, Yn as t };
1979
-
1980
- //# sourceMappingURL=classifications-domain-DdIJaF1D.js.map