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