@feedmepos/mf-inventory-portal 1.2.51-dev.1 → 1.2.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/dist/{App-bY_YcLwH.js → App-BJ_vKOR1.js} +70 -75
  2. package/dist/{ApprovalView-vzIiBqt2.js → ApprovalView-B_prTTtl.js} +34 -34
  3. package/dist/{BindingsDialog-DCh2ORem.js → BindingsDialog-BPuKgJIk.js} +2 -2
  4. package/dist/{BindingsPicker-DcNG03p-.js → BindingsPicker-Dv_cmEil.js} +2 -2
  5. package/dist/{BindingsTable-B_Yaq-z3.js → BindingsTable-BNSfYRfq.js} +4 -4
  6. package/dist/{ClosingDraftView-C0T8cWEB.js → ClosingDraftView-C78tcaJ3.js} +399 -413
  7. package/dist/{ClosingHistoryView-DkKAjh7T.js → ClosingHistoryView-DY8liEk3.js} +27 -27
  8. package/dist/{ClosingTemplateView-DpH1EyW5.js → ClosingTemplateView-pJXEcrjO.js} +17 -18
  9. package/dist/{DeliveryOrderPrintPreview-B2ecLaLu.js → DeliveryOrderPrintPreview-Bu_l-kxu.js} +1 -1
  10. package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Dgibb-Fh.js +231 -0
  11. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-kVpsL4cx.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DHe5G3kX.js} +12 -12
  12. package/dist/{FmMultiselectDialog-DGUwruxs.js → FmMultiselectDialog-C3iCMK5I.js} +1 -1
  13. package/dist/FmMultiselectDialog-CDONDKxE.js +598 -0
  14. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-CRTG3VFo.js → FmUnitInput.vue_vue_type_script_setup_true_lang-CefvebOx.js} +3 -3
  15. package/dist/{ImportView-Bk4Z7nGh.js → ImportView-JrenRgiI.js} +7 -7
  16. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-BEJ19Uej.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-CSdxodp6.js} +1 -1
  17. package/dist/{IngredientGroupView-8GHMMOux.js → IngredientGroupView-aDFq_ZDh.js} +107 -108
  18. package/dist/{IngredientsView-DbmODx-v.js → IngredientsView-DSh3UqDg.js} +125 -126
  19. package/dist/{IntegrationView-DC0O_Lk4.js → IntegrationView-KhZ78uxM.js} +80 -80
  20. package/dist/{InventoryBindingForm-ln0q25n_.js → InventoryBindingForm-DZu0CZYh.js} +1 -1
  21. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CFgk9rSe.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-YuCn0irA.js} +21 -21
  22. package/dist/{InventoryBindingSummary-BlNXhS4v.js → InventoryBindingSummary-DZxLhZ_-.js} +1 -1
  23. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BY_mXqPr.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DAwpZY3n.js} +1 -1
  24. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BhNjwE3X.js → PremiumBadge.vue_vue_type_script_setup_true_lang-CPDxwz-V.js} +2 -2
  25. package/dist/{PublishView-5GkTzxbi.js → PublishView-CLnQ7NBN.js} +3 -3
  26. package/dist/{PurchaseOrderPrintPreview-Dj5lJ5Ou.js → PurchaseOrderPrintPreview-DiBztBma.js} +1 -1
  27. package/dist/ReceiveRequestView-_TOSnDGJ.js +2913 -0
  28. package/dist/{RecipeView-OLPRwnVx.js → RecipeView-BPIMvoTw.js} +82 -83
  29. package/dist/{StockView-TcA5zJqr.js → StockView-CI8MUJay.js} +112 -113
  30. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DZ6TDkKR.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DEBHEMkh.js} +1 -1
  31. package/dist/{SupplierView-77qI9YCg.js → SupplierView-COihDMNY.js} +27 -28
  32. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-_8YeihNH.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-D-c0Ayis.js} +2 -2
  33. package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-cfFHDIwQ.js +162 -0
  34. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-ByPIjcED.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-D8vbPlie.js} +13 -13
  35. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-7BoFD5wV.js → TransferDetails.vue_vue_type_script_setup_true_lang-BVuuw11z.js} +659 -658
  36. package/dist/{TransferTemplateView-CI0U36Tr.js → TransferTemplateView-B2NNfrEq.js} +81 -82
  37. package/dist/{UnitView-fNFFUNlb.js → UnitView-ZsbM07hw.js} +19 -20
  38. package/dist/{WarehouseView-BAXgnZnO.js → WarehouseView-Cd5RFu5v.js} +20 -21
  39. package/dist/{WastageTemplateView-C5qCXWqZ.js → WastageTemplateView-DpikyyZW.js} +164 -165
  40. package/dist/api/netsuite.d.ts +0 -8
  41. package/dist/{app-CddcvygU.js → app-CySQTQxj.js} +4410 -4513
  42. package/dist/app-uBuHtW8m.js +8127 -0
  43. package/dist/app.d.ts +0 -52
  44. package/dist/app.js +1 -1
  45. package/dist/{closing-template-DxdLqlb1.js → closing-template-DXGjC5AG.js} +1 -1
  46. package/dist/components/FmInventoryTableToolbar.vue.d.ts +0 -8
  47. package/dist/components/FmMultiselectDialogProps.d.ts +0 -5
  48. package/dist/cypress/component/receive-request/KDI-15-total-price-currency.cy.d.ts +2 -0
  49. package/dist/{date2-CVZy20Q_.js → date2-BWoUn1K_.js} +1 -1
  50. package/dist/{dayjs.min-NrRtjg32.js → dayjs.min-cMW8olEu.js} +26 -26
  51. package/dist/{decimal-Du3Grkk9.js → decimal-8BRzZQU6.js} +2 -2
  52. package/dist/{defineDeepModel-DgRoiQBp.js → defineDeepModel-AsUZ-DyW.js} +1 -1
  53. package/dist/{duplicate-template-DvnZ4BW6.js → duplicate-template-CyHfZR3S.js} +1 -1
  54. package/dist/{feature-CTA18HlL.js → feature-Dm0FnWf9.js} +6178 -8906
  55. package/dist/{format-time-from-id-6kt1RMWs.js → format-time-from-id-C9lmv5BP.js} +1 -1
  56. package/dist/{format-unit-display-mVJ-nuJe.js → format-unit-display-BV8pJisO.js} +11 -11
  57. package/dist/{import-export.helper-DWwlJy7N.js → import-export.helper-Djxw_H5S.js} +5 -5
  58. package/dist/{index-By-jyWOP.js → index-8hCa5_Gb.js} +1 -1
  59. package/dist/{index-BfcdagSF.js → index-D6u3kywf.js} +1 -1
  60. package/dist/{index-BEcj1jGd.js → index-DidYtgNc.js} +3 -3
  61. package/dist/{lodash-D0COOw3m.js → lodash-CW_Ea6mA.js} +1 -1
  62. package/dist/netsuite-BEto-z0v.js +5131 -0
  63. package/dist/{purchase-order-template-CJCmABzP.js → purchase-order-template-BTzjcgrO.js} +1 -1
  64. package/dist/router/name.d.ts +0 -1
  65. package/dist/{rules-hQBVd1Mn.js → rules-DkVWS5mF.js} +9 -9
  66. package/dist/{stock-4xGaezEy.js → stock-CHw8pI8V.js} +3 -3
  67. package/dist/{stock-B6QW-S14.js → stock-D8hLHgeN.js} +1 -1
  68. package/dist/stores/feature.d.ts +2 -4
  69. package/dist/stores/integration/netsuite.d.ts +0 -5
  70. package/dist/style.css +1 -1
  71. package/dist/{supplier-C-dmFnqw.js → supplier-Dv83IfQr.js} +2 -2
  72. package/dist/tsconfig.app.tsbuildinfo +1 -1
  73. package/dist/{use-ingredient-select-dialog-DgYSZDN8.js → use-ingredient-select-dialog-CJjd4g-6.js} +2 -2
  74. package/dist/{use-inventory-binding-dialog-CnYcA_Fo.js → use-inventory-binding-dialog-D4g79p5S.js} +2 -2
  75. package/dist/{use-template-enabled-locations-2-B_aZrMUU.js → use-template-enabled-locations-2-Cg2iqQdq.js} +2 -2
  76. package/dist/views/ingredients/helper/calculate-default-cost.d.ts +9 -0
  77. package/dist/views/receive-request/components/transfer-form/TransferForm2.vue.d.ts +22 -0
  78. package/dist/views/receive-request/components/transfer-form/TransferFormWithController.vue.d.ts +0 -714
  79. package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +1 -8
  80. package/dist/views/stock/components/StockRecordCard.vue.d.ts +1 -1
  81. package/dist/{vue-i18n-BCEDBY4T.js → vue-i18n-kUcLfpvT.js} +563 -563
  82. package/dist/{xlsx-CJsXiiEq.js → xlsx-BjeMbhDF.js} +398 -398
  83. package/dist/{xlsx.util-CSudzOii.js → xlsx.util-9eMlJfd9.js} +1 -1
  84. package/package.json +5 -5
  85. package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CI4z5XYQ.js +0 -188
  86. package/dist/FmMultiselectDialog-BviFuAM5.js +0 -618
  87. package/dist/ReceiveRequestView-BAYczSpW.js +0 -2913
  88. package/dist/SurchargeView-CxW2ZZ8a.js +0 -460
  89. package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-Ca_eYa8-.js +0 -84
  90. package/dist/api/surcharge.d.ts +0 -31
  91. package/dist/app-DiX-EfV6.js +0 -8167
  92. package/dist/component-DpCUABT3.js +0 -82
  93. package/dist/netsuite-3LgQ5ztL.js +0 -5402
  94. package/dist/stores/surcharge.d.ts +0 -18
  95. package/dist/surcharge-Db4IiSEQ.js +0 -71
  96. package/dist/views/surcharge/SurchargeView.vue.d.ts +0 -2
@@ -1,618 +0,0 @@
1
- var He = Object.defineProperty;
2
- var Pe = (F, i, l) => i in F ? He(F, i, { enumerable: !0, configurable: !0, writable: !0, value: l }) : F[i] = l;
3
- var ve = (F, i, l) => Pe(F, typeof i != "symbol" ? i + "" : i, l);
4
- import { defineComponent as be, computed as x, ref as $, watch as ge, openBlock as d, createElementBlock as f, normalizeStyle as z, Fragment as V, renderList as O, renderSlot as ke, createCommentVNode as D, useSlots as Oe, onMounted as Ue, onUnmounted as Ee, reactive as ee, resolveComponent as T, createElementVNode as B, createVNode as k, createTextVNode as Ke, toDisplayString as P, unref as L, createSlots as je, withCtx as w, createBlock as I, resolveDynamicComponent as pe, normalizeClass as fe, withModifiers as Ne, Transition as ze } from "vue";
5
- import { useDialogChild as Ge } from "@feedmepos/ui-library";
6
- import { z as he } from "./app-CddcvygU.js";
7
- import { d as Je } from "./index-By-jyWOP.js";
8
- /* empty css */
9
- import { useI18n as Re } from "@feedmepos/mf-common";
10
- import { P as We, J as ye, D as Qe } from "./app-DiX-EfV6.js";
11
- import { _ as Xe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
12
- const Ye = /* @__PURE__ */ be({
13
- __name: "VirtualScroll",
14
- props: {
15
- itemHeight: {},
16
- length: {},
17
- scrollTop: {},
18
- prerender: {}
19
- },
20
- emits: ["changed:minHeight"],
21
- setup(F, { emit: i }) {
22
- const l = F, u = i, a = x(() => {
23
- const S = l.itemHeight * l.length;
24
- return u("changed:minHeight", S), `${S}px`;
25
- }), v = $(0), m = x(
26
- () => Array.from({ length: l.prerender }).map((S, p) => p + v.value)
27
- );
28
- function c() {
29
- v.value = Math.floor(l.scrollTop / l.itemHeight) - Math.floor(l.prerender / 2);
30
- }
31
- const o = $(Je(c, 10));
32
- ge([() => l.scrollTop], () => {
33
- o.value();
34
- });
35
- function g(S) {
36
- const p = S.el;
37
- p && (p.style.opacity = "0", setTimeout(() => {
38
- p.style.opacity = "1";
39
- }, 0));
40
- }
41
- return (S, p) => (d(), f("div", {
42
- class: "relative",
43
- style: z({ minHeight: a.value })
44
- }, [
45
- (d(!0), f(V, null, O(m.value, (C) => (d(), f(V, { key: C }, [
46
- C >= 0 && C < S.length ? (d(), f("div", {
47
- key: 0,
48
- class: "absolute w-full left-0 bg-white",
49
- style: z({
50
- top: `${S.itemHeight * C}px`,
51
- height: `${S.itemHeight}px`,
52
- transition: "opacity 0.5s ease"
53
- }),
54
- onVnodeMounted: g
55
- }, [
56
- ke(S.$slots, "default", {
57
- key: C,
58
- index: C,
59
- getItem: (A) => A[C]
60
- })
61
- ], 4)) : D("", !0)
62
- ], 64))), 128))
63
- ], 4));
64
- }
65
- });
66
- class W {
67
- static getDescendantProperty(i, l, u = []) {
68
- let a, v, m, c, o, g;
69
- if (l) {
70
- if (m = l.indexOf("."), m === -1 ? a = l : (a = l.slice(0, m), v = l.slice(m + 1)), c = i[a], c !== null && typeof c < "u")
71
- if (!v && (typeof c == "string" || typeof c == "number"))
72
- u.push(c);
73
- else if (Object.prototype.toString.call(c) === "[object Array]")
74
- for (o = 0, g = c.length; o < g; o++)
75
- W.getDescendantProperty(c[o], v, u);
76
- else v && W.getDescendantProperty(c, v, u);
77
- } else
78
- u.push(i);
79
- return u;
80
- }
81
- }
82
- class U {
83
- constructor(i = [], l = [], u = {}) {
84
- Array.isArray(l) || (u = l, l = []), this.haystack = i, this.keys = l, this.options = Object.assign({
85
- caseSensitive: !1,
86
- sort: !1
87
- }, u);
88
- }
89
- search(i = "") {
90
- if (i === "")
91
- return this.haystack;
92
- const l = [];
93
- for (let u = 0; u < this.haystack.length; u++) {
94
- const a = this.haystack[u];
95
- if (this.keys.length === 0) {
96
- const v = U.isMatch(a, i, this.options.caseSensitive);
97
- v && l.push({ item: a, score: v });
98
- } else
99
- for (let v = 0; v < this.keys.length; v++) {
100
- const m = W.getDescendantProperty(a, this.keys[v]);
101
- let c = !1;
102
- for (let o = 0; o < m.length; o++) {
103
- const g = U.isMatch(m[o], i, this.options.caseSensitive);
104
- if (g) {
105
- c = !0, l.push({ item: a, score: g });
106
- break;
107
- }
108
- }
109
- if (c)
110
- break;
111
- }
112
- }
113
- return this.options.sort && l.sort((u, a) => u.score - a.score), l.map((u) => u.item);
114
- }
115
- static isMatch(i, l, u) {
116
- i = String(i), l = String(l), u || (i = i.toLocaleLowerCase(), l = l.toLocaleLowerCase());
117
- const a = U.nearestIndexesFor(i, l);
118
- return a ? i === l ? 1 : a.length > 1 ? 2 + (a[a.length - 1] - a[0]) : 2 + a[0] : !1;
119
- }
120
- static nearestIndexesFor(i, l) {
121
- const u = l.split("");
122
- let a = [];
123
- return U.indexesOfFirstLetter(i, l).forEach((m, c) => {
124
- let o = m + 1;
125
- a[c] = [m];
126
- for (let g = 1; g < u.length; g++) {
127
- const S = u[g];
128
- if (o = i.indexOf(S, o), o === -1) {
129
- a[c] = !1;
130
- break;
131
- }
132
- a[c].push(o), o++;
133
- }
134
- }), a = a.filter((m) => m !== !1), a.length ? a.sort((m, c) => m.length === 1 ? m[0] - c[0] : (m = m[m.length - 1] - m[0], c = c[c.length - 1] - c[0], m - c))[0] : !1;
135
- }
136
- static indexesOfFirstLetter(i, l) {
137
- const u = l[0];
138
- return i.split("").map((a, v) => a !== u ? !1 : v).filter((a) => a !== !1);
139
- }
140
- }
141
- class Ze {
142
- constructor(i, l) {
143
- ve(this, "searcher");
144
- this.candidates = i, l ?? (l = (u) => [String(u)]), this.searcher = new U(
145
- i.flatMap(
146
- (u, a) => (l == null ? void 0 : l(u).map((v) => ({ key: v, index: a }))) ?? []
147
- ),
148
- ["key"],
149
- { caseSensitive: !1, sort: !0 }
150
- );
151
- }
152
- search(i) {
153
- return [...new Set(this.searcher.search(i).map((l) => l.index))].map(
154
- (l) => this.candidates[l]
155
- );
156
- }
157
- }
158
- const qe = { class: "sticky top-0 bg-white z-50" }, et = {
159
- key: 0,
160
- class: "h-12 bg-white absolute top-[-12px] left-[-24px] w-lvw z-50",
161
- style: { "max-width": "min(100vw - 48px, 560px)" }
162
- }, tt = { class: "flex justify-between items-center" }, lt = { class: "flex gap-16 basis-1/2" }, at = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, st = {
163
- key: 0,
164
- class: "ml-4"
165
- }, nt = {
166
- key: 1,
167
- class: "pt-8 pb-8"
168
- }, ot = {
169
- key: 2,
170
- class: "mt-8 p-12 bg-fm-color-state-warning-subtle border border-fm-color-state-warning-base rounded-4 flex items-center gap-8"
171
- }, it = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary" }, rt = {
172
- key: 0,
173
- class: "flex items-center gap-8 justify-center py-32"
174
- }, ut = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, dt = {
175
- key: 0,
176
- class: "flex gap-4 items-center"
177
- }, ct = {
178
- key: 2,
179
- class: "p-16 text-fm-color-typo-disabled fm-typo-en-body-lg-400 text-center"
180
- }, mt = /* @__PURE__ */ be({
181
- __name: "FmMultiselectDialog",
182
- props: {
183
- modelValue: {},
184
- items: {},
185
- groups: {},
186
- singleSelect: { type: Boolean },
187
- placeholder: {},
188
- showValidBorder: { type: Boolean },
189
- maxHeight: {},
190
- width: {},
191
- noShadow: { type: Boolean },
192
- loading: { type: Boolean },
193
- virtualScroll: { type: Boolean },
194
- filterAttributes: {},
195
- attributeKey: {},
196
- maxSelections: {}
197
- },
198
- emits: ["update:modelValue", "close"],
199
- setup(F, { emit: i }) {
200
- var oe, ie, re;
201
- const { t: l } = Re(), u = Ge(), a = F, v = Oe(), m = x(() => {
202
- var t;
203
- const e = (t = v.appendList) == null ? void 0 : t.call(v);
204
- return Array.isArray(e) ? e : e ? [e] : [];
205
- }), c = i, o = $(a.modelValue ?? []);
206
- Ue(() => {
207
- var t, n, r, h;
208
- u.emitData(o.value);
209
- const e = (t = a.modelValue) != null && t.length ? a.items.findIndex((_) => {
210
- var M;
211
- return he(_.value, (M = a.modelValue) == null ? void 0 : M[0]);
212
- }) : 0;
213
- (n = R.value) == null || n.scrollTo({ top: e * 64 - 64, behavior: "smooth" }), (h = (r = ne.value) == null ? void 0 : r.inputEl) == null || h.focus();
214
- }), Ee(() => {
215
- c("close");
216
- }), ge([() => o.value], ([e]) => {
217
- u.emitData(e), c("update:modelValue", e);
218
- });
219
- function g(e) {
220
- return A.value.has(p(e));
221
- }
222
- const S = /* @__PURE__ */ new WeakMap();
223
- function p(e) {
224
- if (e && typeof e == "object") {
225
- if ("_id" in e && e._id) return String(e._id);
226
- const t = S.get(e);
227
- if (t) return t;
228
- const n = JSON.stringify(e);
229
- return S.set(e, n), n;
230
- }
231
- return String(e);
232
- }
233
- const C = x(() => {
234
- const e = /* @__PURE__ */ new Map();
235
- for (const t of a.items) e.set(p(t.value), t);
236
- return e;
237
- }), A = x(() => new Set(o.value.map((e) => p(e)))), Q = x(
238
- () => new Set(b.value.map((e) => p(e.value)))
239
- );
240
- function H(e, t) {
241
- if (a.singleSelect) {
242
- o.value = t ? [e] : [];
243
- return;
244
- }
245
- const n = p(e), r = A.value.has(n);
246
- if (!(t && r || !t && !r))
247
- if (t) {
248
- if (a.maxSelections && o.value.length >= a.maxSelections)
249
- return;
250
- o.value = [...o.value, e];
251
- } else
252
- o.value = o.value.filter((h) => p(h) !== n);
253
- }
254
- const xe = x(
255
- () => new Ze(
256
- a.items,
257
- (e) => [e.label ?? "", e.sublabel ?? "", ...e.searchKeys ?? []].filter((t) => t)
258
- )
259
- ), E = $(""), G = $(null), b = x(() => {
260
- let e = xe.value.search(E.value);
261
- if (G.value && a.filterAttributes) {
262
- const t = We.build(G.value);
263
- e = a.attributeKey ? e.filter((n) => ye(n[a.attributeKey] ?? {}, t)) : e.filter((n) => ye(n, t));
264
- }
265
- return e;
266
- }), te = x(() => {
267
- const e = [], t = C.value, n = Q.value;
268
- for (const r of o.value) {
269
- const h = p(r), _ = t.get(h);
270
- _ && !_.disabled && n.has(h) && e.push(r);
271
- }
272
- return e;
273
- }), K = x(() => {
274
- const e = b.value.filter((t) => !t.disabled);
275
- return te.value.length === e.length;
276
- }), le = x(() => te.value.length > 0 && !K.value);
277
- function Se() {
278
- if (K.value) {
279
- const e = Q.value;
280
- o.value = o.value.filter((t) => {
281
- const n = p(t), r = C.value.get(n);
282
- return (r == null ? void 0 : r.disabled) && !e.has(n);
283
- });
284
- } else {
285
- const e = A.value, t = Q.value;
286
- o.value = a.items.filter(
287
- (n) => !n.disabled && (e.has(p(n.value)) || t.has(p(n.value)))
288
- ).map((n) => n.value);
289
- }
290
- }
291
- const _e = ee(
292
- ((oe = a.items) == null ? void 0 : oe.map((e) => ({ value: e.value, disabled: e.disabled ?? !1 }))) ?? []
293
- );
294
- function we(e, t) {
295
- return e.reduce(
296
- (n, r) => {
297
- const h = t(r);
298
- return n[h] || (n[h] = []), n[h].push(r), n;
299
- },
300
- {}
301
- );
302
- }
303
- const Fe = x(() => we(_e, (e) => p(e.value))), Ce = ee(
304
- ((ie = a.items) == null ? void 0 : ie.map((e) => ({ value: e.value, collapsed: e.collapsed ?? !1 }))) ?? []
305
- ), X = ee(
306
- ((re = a.groups) == null ? void 0 : re.reduce(
307
- (e, t) => (e[t.id] = t.collapse ?? !1, e),
308
- {}
309
- )) ?? {}
310
- );
311
- function Y({ groupId: e, value: t }) {
312
- var n;
313
- return e && X[e] || ((n = Ce.find((r) => he(r.value, t))) == null ? void 0 : n.collapsed);
314
- }
315
- function Ve(e) {
316
- X[e] = !X[e];
317
- }
318
- const Z = x(() => {
319
- const e = /* @__PURE__ */ new Map();
320
- for (const t of a.items)
321
- if (t.groupId) {
322
- const n = p(t.value), r = e.get(t.groupId) ?? [];
323
- r.push(n), e.set(t.groupId, r);
324
- }
325
- return e;
326
- });
327
- function q(e) {
328
- const t = Z.value.get(e) || [], n = A.value;
329
- return t.length > 0 && t.every((r) => n.has(r));
330
- }
331
- function ae(e) {
332
- const t = Z.value.get(e) || [], n = A.value;
333
- return t.some((r) => n.has(r)) && !q(e);
334
- }
335
- function Ae(e) {
336
- const t = Z.value.get(e) || [];
337
- if (!t.length) return;
338
- const n = A.value;
339
- if (q(e))
340
- o.value = o.value.filter((r) => !t.includes(p(r)));
341
- else if (ae(e)) {
342
- const r = [];
343
- for (const h of a.items)
344
- if (h.groupId === e) {
345
- const _ = p(h.value);
346
- n.has(_) || r.push(h.value);
347
- }
348
- r.length && (o.value = [...o.value, ...r]);
349
- } else {
350
- const r = a.items.filter((h) => h.groupId === e).map((h) => h.value);
351
- o.value = [...o.value, ...r];
352
- }
353
- }
354
- const J = $(0);
355
- function se(e) {
356
- var t;
357
- J.value = ((t = e.target) == null ? void 0 : t.scrollTop) ?? J;
358
- }
359
- const Me = x(() => J.value > 100), R = $(), ne = $(), Te = x(() => a.maxSelections ? Math.max(0, a.maxSelections - o.value.length) : null), Be = x(() => a.maxSelections && o.value.length >= a.maxSelections);
360
- return (e, t) => {
361
- var de, ce;
362
- const n = T("FmIcon"), r = T("FmTextField"), h = T("FmCircularProgress"), _ = T("FmCheckbox"), M = T("FmListItem"), Le = T("FmChip"), ue = T("FmButton"), Ie = T("FmList");
363
- return d(), f("div", {
364
- class: "relative max-h-[380px] overflow-y-auto overflow-x-hidden",
365
- onScroll: se,
366
- onScrollend: se,
367
- ref_key: "scrollable",
368
- ref: R
369
- }, [
370
- B("div", qe, [
371
- e.noShadow ? D("", !0) : (d(), f("div", et)),
372
- B("div", tt, [
373
- B("div", lt, [
374
- k(n, { name: "autorenew" }),
375
- B("span", at, [
376
- Ke(P(L(l)("inventory.formField.itemsSelected", { count: ((de = o.value) == null ? void 0 : de.length) ?? 0 })) + " ", 1),
377
- e.maxSelections ? (d(), f("span", st, " (" + P(L(l)("inventory.formField.maximum")) + " " + P(Te.value) + ") ", 1)) : D("", !0)
378
- ])
379
- ]),
380
- k(r, {
381
- class: "basis-1/2",
382
- modelValue: E.value,
383
- "onUpdate:modelValue": t[1] || (t[1] = (s) => E.value = s),
384
- "prepend-icon": "search",
385
- placeholder: e.placeholder,
386
- ref_key: "searchTextField",
387
- ref: ne
388
- }, je({ _: 2 }, [
389
- E.value.length ? {
390
- name: "append",
391
- fn: w(() => [
392
- k(n, {
393
- class: "cursor-pointer",
394
- name: "close",
395
- onClick: t[0] || (t[0] = (s) => E.value = "")
396
- })
397
- ]),
398
- key: "0"
399
- } : void 0
400
- ]), 1032, ["modelValue", "placeholder"])
401
- ]),
402
- e.filterAttributes && e.filterAttributes.length > 0 ? (d(), f("div", nt, [
403
- k(L(Qe), {
404
- modelValue: G.value,
405
- "onUpdate:modelValue": t[2] || (t[2] = (s) => G.value = s),
406
- attributes: e.filterAttributes
407
- }, null, 8, ["modelValue", "attributes"])
408
- ])) : D("", !0),
409
- Be.value ? (d(), f("div", ot, [
410
- k(n, {
411
- name: "warning",
412
- class: "text-fm-color-state-warning-base"
413
- }),
414
- B("span", it, P(L(l)("inventory.formField.maxSelectionsReached", { count: e.maxSelections })), 1)
415
- ])) : D("", !0)
416
- ]),
417
- B("div", null, [
418
- e.loading ? (d(), f("div", rt, [
419
- k(h, {
420
- size: "md",
421
- color: "neutral-gray-400"
422
- }),
423
- B("div", ut, P(L(l)("inventory.formField.loading")), 1)
424
- ])) : b.value.length ? (d(), I(Ie, { key: 1 }, {
425
- default: w(() => [
426
- e.singleSelect ? D("", !0) : (d(), I(M, {
427
- key: 0,
428
- "model-value": K.value,
429
- indeterminate: le.value,
430
- value: "",
431
- onClick: t[3] || (t[3] = (s) => Se())
432
- }, {
433
- prepend: w(() => [
434
- k(_, {
435
- "model-value": K.value,
436
- indeterminate: le.value,
437
- label: K.value ? L(l)("inventory.formField.select.removeAll") : L(l)("inventory.formField.select.selectAll"),
438
- value: ""
439
- }, null, 8, ["model-value", "indeterminate", "label"])
440
- ]),
441
- _: 1
442
- }, 8, ["model-value", "indeterminate"])),
443
- e.groups ? (d(!0), f(V, { key: 2 }, O(e.groups, (s) => (d(), f(V, {
444
- key: s.id
445
- }, [
446
- k(M, {
447
- label: s.label,
448
- sublabel: s.sublabel,
449
- style: { "padding-top": "4px", "padding-bottom": "4px", "padding-left": "32px" },
450
- disabled: s.disabled
451
- }, {
452
- prepend: w(() => [
453
- k(_, {
454
- "model-value": q(s.id),
455
- indeterminate: ae(s.id),
456
- onClick: () => Ae(s.id),
457
- value: s.id,
458
- disabled: s.disabled
459
- }, null, 8, ["model-value", "indeterminate", "onClick", "value", "disabled"])
460
- ]),
461
- append: w(() => [
462
- k(ue, {
463
- "prepend-icon": Y({ groupId: s.id }) ? "expand_less" : "expand_more",
464
- size: "md",
465
- variant: "tertiary",
466
- onClick: Ne(() => Ve(s.id), ["stop"])
467
- }, null, 8, ["prepend-icon", "onClick"])
468
- ]),
469
- _: 2
470
- }, 1032, ["label", "sublabel", "disabled"]),
471
- (d(!0), f(V, null, O(b.value.filter((y) => y.groupId === s.id), (y) => (d(), f("div", {
472
- key: p(y.value),
473
- class: fe([
474
- "transition-all overflow-y-clip",
475
- Y({ groupId: s.id, value: y.value }) ? "max-h-0 opacity-0" : "max-h-[64px] opacity-100"
476
- ])
477
- }, [
478
- k(M, {
479
- label: y.label,
480
- sublabel: y.sublabel,
481
- disabled: y.disabled,
482
- onClick: (j) => H(y.value, !g(y.value)),
483
- style: { "padding-top": "4px", "padding-bottom": "4px", "padding-left": "64px" }
484
- }, {
485
- prepend: w(() => [
486
- k(_, {
487
- "model-value": g(y.value),
488
- "onUpdate:modelValue": (j) => H(y.value, j),
489
- value: y.value,
490
- disabled: y.disabled
491
- }, null, 8, ["model-value", "onUpdate:modelValue", "value", "disabled"])
492
- ]),
493
- _: 2
494
- }, 1032, ["label", "sublabel", "disabled", "onClick"])
495
- ], 2))), 128))
496
- ], 64))), 128)) : (d(), f(V, { key: 1 }, [
497
- e.virtualScroll ? (d(), I(Ye, {
498
- key: 0,
499
- length: b.value.length + m.value.length,
500
- "item-height": 64,
501
- scrollTop: J.value,
502
- prerender: 100
503
- }, {
504
- default: w(({ getItem: s, index: y }) => {
505
- var j, me;
506
- return [
507
- y < b.value.length ? (d(), I(M, {
508
- key: 0,
509
- label: s(b.value).label,
510
- sublabel: s(b.value).sublabel,
511
- onClick: (N) => H(
512
- s(b.value).value,
513
- !g(s(b.value).value)
514
- ),
515
- disabled: (me = (j = Fe.value[p(s(b.value).value)]) == null ? void 0 : j[0]) == null ? void 0 : me.disabled,
516
- style: z({
517
- paddingTop: 4,
518
- paddingBottom: 4,
519
- paddingLeft: e.singleSelect === !0 ? 12 : 32
520
- })
521
- }, {
522
- prepend: w(() => [
523
- k(_, {
524
- "model-value": g(s(b.value).value),
525
- "onUpdate:modelValue": (N) => H(s(b.value).value, N),
526
- value: s(b.value).value,
527
- disabled: s(b.value).disabled
528
- }, null, 8, ["model-value", "onUpdate:modelValue", "value", "disabled"])
529
- ]),
530
- append: w(() => {
531
- var N;
532
- return [
533
- (N = s(b.value)) != null && N.tags ? (d(), f("div", dt, [
534
- (d(!0), f(V, null, O(s(b.value).tags, (De, $e) => (d(), I(Le, {
535
- key: $e,
536
- label: De,
537
- compact: ""
538
- }, null, 8, ["label"]))), 128))
539
- ])) : D("", !0),
540
- ke(e.$slots, "appendListItem", {
541
- item: s(b.value)
542
- }, void 0, !0)
543
- ];
544
- }),
545
- _: 2
546
- }, 1032, ["label", "sublabel", "onClick", "disabled", "style"])) : (d(), I(pe(m.value[y - b.value.length]), { key: 1 }))
547
- ];
548
- }),
549
- _: 3
550
- }, 8, ["length", "scrollTop"])) : (d(), f(V, { key: 1 }, [
551
- (d(!0), f(V, null, O(b.value, (s) => (d(), f("div", {
552
- key: p(s.value),
553
- class: fe([
554
- "transition-all overflow-y-clip",
555
- Y({ value: s.value }) ? "max-h-0 opacity-0" : "max-h-[64px] opacity-100"
556
- ])
557
- }, [
558
- k(M, {
559
- label: s.label,
560
- sublabel: s.sublabel,
561
- onClick: (y) => H(s.value, !g(s.value)),
562
- disabled: s.disabled,
563
- style: z({
564
- paddingTop: 4,
565
- paddingBottom: 4,
566
- paddingLeft: e.singleSelect === !0 ? 12 : 32
567
- })
568
- }, {
569
- prepend: w(() => [
570
- k(_, {
571
- "model-value": g(s.value),
572
- "onUpdate:modelValue": (y) => H(s.value, y),
573
- value: s.value,
574
- disabled: s.disabled
575
- }, null, 8, ["model-value", "onUpdate:modelValue", "value", "disabled"])
576
- ]),
577
- _: 2
578
- }, 1032, ["label", "sublabel", "onClick", "disabled", "style"])
579
- ], 2))), 128)),
580
- (d(!0), f(V, null, O(m.value, (s, y) => (d(), f("div", { key: y }, [
581
- (d(), I(pe(s)))
582
- ]))), 128))
583
- ], 64))
584
- ], 64))
585
- ]),
586
- _: 3
587
- })) : (d(), f("div", ct, P(L(l)("inventory.formField.noItemsFound")), 1))
588
- ]),
589
- B("div", {
590
- class: "sticky bottom-24",
591
- style: z({ transform: `translateX(${(((ce = R.value) == null ? void 0 : ce.clientWidth) ?? 0) - 80}px)` })
592
- }, [
593
- k(ze, { name: "fade" }, {
594
- default: w(() => [
595
- Me.value ? (d(), I(ue, {
596
- key: 0,
597
- variant: "fab",
598
- class: "bg-white",
599
- "text-color": "neutral-gray-400",
600
- "prepend-icon": "keyboard_arrow_up",
601
- onClick: t[4] || (t[4] = () => {
602
- var s;
603
- return (s = R.value) == null ? void 0 : s.scrollTo({ top: 0, behavior: "smooth" });
604
- })
605
- })) : D("", !0)
606
- ]),
607
- _: 1
608
- })
609
- ], 4)
610
- ], 544);
611
- };
612
- }
613
- }), St = /* @__PURE__ */ Xe(mt, [["__scopeId", "data-v-3d54ea9a"]]);
614
- export {
615
- U as F,
616
- St as a,
617
- Ze as b
618
- };