@feedmepos/mf-inventory-portal 1.2.50-dev.2 → 1.2.50

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 (90) hide show
  1. package/dist/{App-DAO7XF9h.js → App-DssF0b6P.js} +68 -72
  2. package/dist/{ApprovalView-BUHefc15.js → ApprovalView-DTCayLqE.js} +34 -34
  3. package/dist/{BindingsDialog-Cx9ngX7X.js → BindingsDialog-C2-THIG0.js} +2 -2
  4. package/dist/{BindingsPicker-CIZ9FVgv.js → BindingsPicker-Q9W92GzO.js} +2 -2
  5. package/dist/{BindingsTable-CMyZkvyn.js → BindingsTable-BQo8HpbF.js} +4 -4
  6. package/dist/{ClosingDraftView-D4CMfSvf.js → ClosingDraftView-B0spMbZd.js} +18 -19
  7. package/dist/{ClosingHistoryView-J_2EA-F4.js → ClosingHistoryView-DDVibMzL.js} +3 -3
  8. package/dist/{ClosingTemplateView-Bz21bJLn.js → ClosingTemplateView-BSiNTpkH.js} +17 -18
  9. package/dist/{DeliveryOrderPrintPreview-D9xRJSBT.js → DeliveryOrderPrintPreview-P9JASYcM.js} +1 -1
  10. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-ifkxhq6-.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DkvLYf5A.js} +4 -4
  11. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BcJ1ydJ1.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CaQq9jpc.js} +12 -12
  12. package/dist/FmMultiselectDialog-BgLyRNeD.js +598 -0
  13. package/dist/{FmMultiselectDialog-Cxj6_Bbq.js → FmMultiselectDialog-DKEGwdyz.js} +1 -1
  14. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-CJsg-6qm.js → FmUnitInput.vue_vue_type_script_setup_true_lang-H5xYFc6B.js} +3 -3
  15. package/dist/{ImportView-mq9p_YKN.js → ImportView-CKg0Z3Bz.js} +7 -7
  16. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-CvdNblLJ.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-y1qeqeUV.js} +1 -1
  17. package/dist/{IngredientGroupView-1YQdweWW.js → IngredientGroupView-DntDNlVX.js} +107 -108
  18. package/dist/{IngredientsView-rZZDO37M.js → IngredientsView-B93tavZW.js} +125 -126
  19. package/dist/{IntegrationView-0KCNTL9w.js → IntegrationView-CqEe7SWR.js} +80 -80
  20. package/dist/{InventoryBindingForm-Cz6tMVlQ.js → InventoryBindingForm-9E3VsD4v.js} +1 -1
  21. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-9jHxMOEn.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-Dgy_eFxJ.js} +4 -4
  22. package/dist/{InventoryBindingSummary-DarjH7Dn.js → InventoryBindingSummary-DTcoWk_n.js} +1 -1
  23. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BR6U0SpT.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CIDw4WOz.js} +1 -1
  24. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-C9ffyR0d.js → PremiumBadge.vue_vue_type_script_setup_true_lang-Dao7XifY.js} +2 -2
  25. package/dist/{PublishView-Bam4W7ko.js → PublishView-GDJsOfeY.js} +3 -3
  26. package/dist/{PurchaseOrderPrintPreview-DEKkUMB6.js → PurchaseOrderPrintPreview-DFeZT5Zi.js} +1 -1
  27. package/dist/ReceiveRequestView-BvYpGKEB.js +2913 -0
  28. package/dist/{RecipeView-CwwKtDRg.js → RecipeView-DyJs2lsk.js} +82 -83
  29. package/dist/{StockView-CVN5MKbj.js → StockView-Cvwfcsf7.js} +112 -113
  30. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Bm1MxmBR.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-CMFiW6FL.js} +1 -1
  31. package/dist/{SupplierView-BhnmPv7N.js → SupplierView-C6rIxQOg.js} +27 -28
  32. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-DdPVsOZY.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-6C5vAumx.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-Bp49G_dV.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-Bc0MVyK_.js} +13 -13
  35. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BQFBZ0CH.js → TransferDetails.vue_vue_type_script_setup_true_lang-BSNIRZx3.js} +15 -15
  36. package/dist/{TransferTemplateView-7AJGTAAy.js → TransferTemplateView-BVRXLZGK.js} +16 -16
  37. package/dist/{UnitView-Dz4bgzmW.js → UnitView-B9n1vDtN.js} +19 -20
  38. package/dist/{WarehouseView-DEYOa_Ol.js → WarehouseView-oyEVpI9M.js} +20 -21
  39. package/dist/{WastageTemplateView-DdPkFfyQ.js → WastageTemplateView-DCdR4fhu.js} +164 -165
  40. package/dist/api/netsuite.d.ts +0 -8
  41. package/dist/{app-kim0oKgm.js → app-_hCz0958.js} +4408 -4511
  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-MLHUWgwA.js → closing-template-y0kvKjaN.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/{date2-Ck1fxOS1.js → date2-Ct3mwV73.js} +1 -1
  49. package/dist/{dayjs.min-CgHxLw1P.js → dayjs.min-iDh15Qvq.js} +1 -1
  50. package/dist/{decimal-DVjzMCmx.js → decimal-DliTT0vp.js} +2 -2
  51. package/dist/{defineDeepModel-CLo1ie3w.js → defineDeepModel-DmVg-VGa.js} +1 -1
  52. package/dist/{duplicate-template-B_f_fYhs.js → duplicate-template-BO8LvPWq.js} +1 -1
  53. package/dist/{feature-D4HcMaGK.js → feature-Dk3_0hiC.js} +2810 -3440
  54. package/dist/{format-time-from-id-CwtHJpC0.js → format-time-from-id-DOmxxVYQ.js} +1 -1
  55. package/dist/{format-unit-display-DRIOlVir.js → format-unit-display-BuliV6Fn.js} +11 -11
  56. package/dist/{import-export.helper-BrcydEPI.js → import-export.helper-DpWf4zh7.js} +5 -5
  57. package/dist/{index-D9dtwK1d.js → index-BZ9fyZbO.js} +1 -1
  58. package/dist/{index-ChruXaud.js → index-C6nEuFpg.js} +1 -1
  59. package/dist/{index-Wd74fJNj.js → index-CY6-px7W.js} +3 -3
  60. package/dist/{lodash-MkfFbMhZ.js → lodash-DDMf37Aw.js} +1 -1
  61. package/dist/netsuite-CVg13Lx5.js +5131 -0
  62. package/dist/{purchase-order-template-BdKUiSPI.js → purchase-order-template-C9GqlQL3.js} +1 -1
  63. package/dist/router/name.d.ts +0 -1
  64. package/dist/{rules-KSzt3qOJ.js → rules-9-OxHCjJ.js} +3 -3
  65. package/dist/{stock-DZliLQNR.js → stock-CjJKvKsB.js} +3 -3
  66. package/dist/{stock-BHWNLsBc.js → stock-D7gYQHth.js} +1 -1
  67. package/dist/stores/integration/netsuite.d.ts +0 -5
  68. package/dist/style.css +1 -1
  69. package/dist/{supplier-CiMOpHKx.js → supplier-z1X1B4yZ.js} +2 -2
  70. package/dist/tsconfig.app.tsbuildinfo +1 -1
  71. package/dist/{use-ingredient-select-dialog-CK_Ldhwm.js → use-ingredient-select-dialog-B4u8ttOK.js} +2 -2
  72. package/dist/{use-inventory-binding-dialog-jfME3m3c.js → use-inventory-binding-dialog-CaFu9DlH.js} +2 -2
  73. package/dist/{use-template-enabled-locations-2-Dbk_RoRj.js → use-template-enabled-locations-2-KQU0hLX3.js} +2 -2
  74. package/dist/views/receive-request/components/transfer-form/TransferFormWithController.vue.d.ts +0 -714
  75. package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +0 -5
  76. package/dist/{vue-i18n-DUlOMRWF.js → vue-i18n-UG5lCeUG.js} +533 -533
  77. package/dist/{xlsx-CiNXr9Ie.js → xlsx-INrtkMe5.js} +1 -1
  78. package/dist/{xlsx.util-D81JjCsx.js → xlsx.util-OqI8IJfw.js} +1 -1
  79. package/package.json +4 -4
  80. package/dist/FmMultiselectDialog-B5F93-xV.js +0 -621
  81. package/dist/ReceiveRequestView-DDfHVcG2.js +0 -3028
  82. package/dist/SurchargeView-nlkL3YIK.js +0 -460
  83. package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-Ca_eYa8-.js +0 -84
  84. package/dist/api/surcharge.d.ts +0 -31
  85. package/dist/app-DiX-EfV6.js +0 -8167
  86. package/dist/component-DpCUABT3.js +0 -82
  87. package/dist/netsuite-D4cXyIr7.js +0 -5402
  88. package/dist/stores/surcharge.d.ts +0 -18
  89. package/dist/surcharge-CjdNdcm1.js +0 -71
  90. package/dist/views/surcharge/SurchargeView.vue.d.ts +0 -2
@@ -1,621 +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 p, normalizeStyle as G, 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 Ge } from "vue";
5
- import { useDialogChild as ze } from "@feedmepos/ui-library";
6
- import { y as he } from "./app-kim0oKgm.js";
7
- import { d as Je } from "./index-D9dtwK1d.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, y) => y + 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 y = S.el;
37
- y && (y.style.opacity = "0", setTimeout(() => {
38
- y.style.opacity = "1";
39
- }, 0));
40
- }
41
- return (S, y) => (d(), p("div", {
42
- class: "relative",
43
- style: G({ minHeight: a.value })
44
- }, [
45
- (d(!0), p(V, null, O(m.value, (C) => (d(), p(V, { key: C }, [
46
- C >= 0 && C < S.length ? (d(), p("div", {
47
- key: 0,
48
- class: "absolute w-full left-0 bg-white",
49
- style: G({
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 = ze(), 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, f;
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" }), (f = (r = ne.value) == null ? void 0 : r.inputEl) == null || f.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(y(e));
221
- }
222
- const S = /* @__PURE__ */ new WeakMap();
223
- function y(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(y(t.value), t);
236
- return e;
237
- }), A = x(() => new Set(o.value.map((e) => y(e)))), Q = x(
238
- () => new Set(b.value.map((e) => y(e.value)))
239
- );
240
- function H(e, t) {
241
- if (a.singleSelect) {
242
- o.value = t ? [e] : [];
243
- return;
244
- }
245
- const n = y(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((f) => y(f) !== 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 = $(""), z = $(null), b = x(() => {
260
- let e = xe.value.search(E.value);
261
- if (z.value && a.filterAttributes) {
262
- const t = We.build(z.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 f = y(r), _ = t.get(f);
270
- _ && !_.disabled && n.has(f) && 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 = y(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(y(n.value)) || t.has(y(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 f = t(r);
298
- return n[f] || (n[f] = []), n[f].push(r), n;
299
- },
300
- {}
301
- );
302
- }
303
- const Fe = x(() => we(_e, (e) => {
304
- var t;
305
- return (t = e.value) == null ? void 0 : t._id;
306
- })), Ce = ee(
307
- ((ie = a.items) == null ? void 0 : ie.map((e) => ({ value: e.value, collapsed: e.collapsed ?? !1 }))) ?? []
308
- ), X = ee(
309
- ((re = a.groups) == null ? void 0 : re.reduce(
310
- (e, t) => (e[t.id] = t.collapse ?? !1, e),
311
- {}
312
- )) ?? {}
313
- );
314
- function Y({ groupId: e, value: t }) {
315
- var n;
316
- return e && X[e] || ((n = Ce.find((r) => he(r.value, t))) == null ? void 0 : n.collapsed);
317
- }
318
- function Ve(e) {
319
- X[e] = !X[e];
320
- }
321
- const Z = x(() => {
322
- const e = /* @__PURE__ */ new Map();
323
- for (const t of a.items)
324
- if (t.groupId) {
325
- const n = y(t.value), r = e.get(t.groupId) ?? [];
326
- r.push(n), e.set(t.groupId, r);
327
- }
328
- return e;
329
- });
330
- function q(e) {
331
- const t = Z.value.get(e) || [], n = A.value;
332
- return t.length > 0 && t.every((r) => n.has(r));
333
- }
334
- function ae(e) {
335
- const t = Z.value.get(e) || [], n = A.value;
336
- return t.some((r) => n.has(r)) && !q(e);
337
- }
338
- function Ae(e) {
339
- const t = Z.value.get(e) || [];
340
- if (!t.length) return;
341
- const n = A.value;
342
- if (q(e))
343
- o.value = o.value.filter((r) => !t.includes(y(r)));
344
- else if (ae(e)) {
345
- const r = [];
346
- for (const f of a.items)
347
- if (f.groupId === e) {
348
- const _ = y(f.value);
349
- n.has(_) || r.push(f.value);
350
- }
351
- r.length && (o.value = [...o.value, ...r]);
352
- } else {
353
- const r = a.items.filter((f) => f.groupId === e).map((f) => f.value);
354
- o.value = [...o.value, ...r];
355
- }
356
- }
357
- const J = $(0);
358
- function se(e) {
359
- var t;
360
- J.value = ((t = e.target) == null ? void 0 : t.scrollTop) ?? J;
361
- }
362
- 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);
363
- return (e, t) => {
364
- var de, ce;
365
- const n = T("FmIcon"), r = T("FmTextField"), f = T("FmCircularProgress"), _ = T("FmCheckbox"), M = T("FmListItem"), Le = T("FmChip"), ue = T("FmButton"), Ie = T("FmList");
366
- return d(), p("div", {
367
- class: "relative max-h-[380px] overflow-y-auto overflow-x-hidden",
368
- onScroll: se,
369
- onScrollend: se,
370
- ref_key: "scrollable",
371
- ref: R
372
- }, [
373
- B("div", qe, [
374
- e.noShadow ? D("", !0) : (d(), p("div", et)),
375
- B("div", tt, [
376
- B("div", lt, [
377
- k(n, { name: "autorenew" }),
378
- B("span", at, [
379
- Ke(P(L(l)("inventory.formField.itemsSelected", { count: ((de = o.value) == null ? void 0 : de.length) ?? 0 })) + " ", 1),
380
- e.maxSelections ? (d(), p("span", st, " (" + P(L(l)("inventory.formField.maximum")) + " " + P(Te.value) + ") ", 1)) : D("", !0)
381
- ])
382
- ]),
383
- k(r, {
384
- class: "basis-1/2",
385
- modelValue: E.value,
386
- "onUpdate:modelValue": t[1] || (t[1] = (s) => E.value = s),
387
- "prepend-icon": "search",
388
- placeholder: e.placeholder,
389
- ref_key: "searchTextField",
390
- ref: ne
391
- }, je({ _: 2 }, [
392
- E.value.length ? {
393
- name: "append",
394
- fn: w(() => [
395
- k(n, {
396
- class: "cursor-pointer",
397
- name: "close",
398
- onClick: t[0] || (t[0] = (s) => E.value = "")
399
- })
400
- ]),
401
- key: "0"
402
- } : void 0
403
- ]), 1032, ["modelValue", "placeholder"])
404
- ]),
405
- e.filterAttributes && e.filterAttributes.length > 0 ? (d(), p("div", nt, [
406
- k(L(Qe), {
407
- modelValue: z.value,
408
- "onUpdate:modelValue": t[2] || (t[2] = (s) => z.value = s),
409
- attributes: e.filterAttributes
410
- }, null, 8, ["modelValue", "attributes"])
411
- ])) : D("", !0),
412
- Be.value ? (d(), p("div", ot, [
413
- k(n, {
414
- name: "warning",
415
- class: "text-fm-color-state-warning-base"
416
- }),
417
- B("span", it, P(L(l)("inventory.formField.maxSelectionsReached", { count: e.maxSelections })), 1)
418
- ])) : D("", !0)
419
- ]),
420
- B("div", null, [
421
- e.loading ? (d(), p("div", rt, [
422
- k(f, {
423
- size: "md",
424
- color: "neutral-gray-400"
425
- }),
426
- B("div", ut, P(L(l)("inventory.formField.loading")), 1)
427
- ])) : b.value.length ? (d(), I(Ie, { key: 1 }, {
428
- default: w(() => [
429
- e.singleSelect ? D("", !0) : (d(), I(M, {
430
- key: 0,
431
- "model-value": K.value,
432
- indeterminate: le.value,
433
- value: "",
434
- onClick: t[3] || (t[3] = (s) => Se())
435
- }, {
436
- prepend: w(() => [
437
- k(_, {
438
- "model-value": K.value,
439
- indeterminate: le.value,
440
- label: K.value ? L(l)("inventory.formField.select.removeAll") : L(l)("inventory.formField.select.selectAll"),
441
- value: ""
442
- }, null, 8, ["model-value", "indeterminate", "label"])
443
- ]),
444
- _: 1
445
- }, 8, ["model-value", "indeterminate"])),
446
- e.groups ? (d(!0), p(V, { key: 2 }, O(e.groups, (s) => (d(), p(V, {
447
- key: s.id
448
- }, [
449
- k(M, {
450
- label: s.label,
451
- sublabel: s.sublabel,
452
- style: { "padding-top": "4px", "padding-bottom": "4px", "padding-left": "32px" },
453
- disabled: s.disabled
454
- }, {
455
- prepend: w(() => [
456
- k(_, {
457
- "model-value": q(s.id),
458
- indeterminate: ae(s.id),
459
- onClick: () => Ae(s.id),
460
- value: s.id,
461
- disabled: s.disabled
462
- }, null, 8, ["model-value", "indeterminate", "onClick", "value", "disabled"])
463
- ]),
464
- append: w(() => [
465
- k(ue, {
466
- "prepend-icon": Y({ groupId: s.id }) ? "expand_less" : "expand_more",
467
- size: "md",
468
- variant: "tertiary",
469
- onClick: Ne(() => Ve(s.id), ["stop"])
470
- }, null, 8, ["prepend-icon", "onClick"])
471
- ]),
472
- _: 2
473
- }, 1032, ["label", "sublabel", "disabled"]),
474
- (d(!0), p(V, null, O(b.value.filter((h) => h.groupId === s.id), (h) => (d(), p("div", {
475
- key: h.value,
476
- class: fe([
477
- "transition-all overflow-y-clip",
478
- Y({ groupId: s.id, value: h.value }) ? "max-h-0 opacity-0" : "max-h-[64px] opacity-100"
479
- ])
480
- }, [
481
- k(M, {
482
- label: h.label,
483
- sublabel: h.sublabel,
484
- disabled: h.disabled,
485
- onClick: (j) => H(h.value, !g(h.value)),
486
- style: { "padding-top": "4px", "padding-bottom": "4px", "padding-left": "64px" }
487
- }, {
488
- prepend: w(() => [
489
- k(_, {
490
- "model-value": g(h.value),
491
- "onUpdate:modelValue": (j) => H(h.value, j),
492
- value: h.value,
493
- disabled: h.disabled
494
- }, null, 8, ["model-value", "onUpdate:modelValue", "value", "disabled"])
495
- ]),
496
- _: 2
497
- }, 1032, ["label", "sublabel", "disabled", "onClick"])
498
- ], 2))), 128))
499
- ], 64))), 128)) : (d(), p(V, { key: 1 }, [
500
- e.virtualScroll ? (d(), I(Ye, {
501
- key: 0,
502
- length: b.value.length + m.value.length,
503
- "item-height": 64,
504
- scrollTop: J.value,
505
- prerender: 100
506
- }, {
507
- default: w(({ getItem: s, index: h }) => {
508
- var j, me;
509
- return [
510
- h < b.value.length ? (d(), I(M, {
511
- key: 0,
512
- label: s(b.value).label,
513
- sublabel: s(b.value).sublabel,
514
- onClick: (N) => H(
515
- s(b.value).value,
516
- !g(s(b.value).value)
517
- ),
518
- disabled: (me = Fe.value[(j = s(b.value).value) == null ? void 0 : j._id][0]) == null ? void 0 : me.disabled,
519
- style: G({
520
- paddingTop: 4,
521
- paddingBottom: 4,
522
- paddingLeft: e.singleSelect === !0 ? 12 : 32
523
- })
524
- }, {
525
- prepend: w(() => [
526
- k(_, {
527
- "model-value": g(s(b.value).value),
528
- "onUpdate:modelValue": (N) => H(s(b.value).value, N),
529
- value: s(b.value).value,
530
- disabled: s(b.value).disabled
531
- }, null, 8, ["model-value", "onUpdate:modelValue", "value", "disabled"])
532
- ]),
533
- append: w(() => {
534
- var N;
535
- return [
536
- (N = s(b.value)) != null && N.tags ? (d(), p("div", dt, [
537
- (d(!0), p(V, null, O(s(b.value).tags, (De, $e) => (d(), I(Le, {
538
- key: $e,
539
- label: De,
540
- compact: ""
541
- }, null, 8, ["label"]))), 128))
542
- ])) : D("", !0),
543
- ke(e.$slots, "appendListItem", {
544
- item: s(b.value)
545
- }, void 0, !0)
546
- ];
547
- }),
548
- _: 2
549
- }, 1032, ["label", "sublabel", "onClick", "disabled", "style"])) : (d(), I(pe(m.value[h - b.value.length]), { key: 1 }))
550
- ];
551
- }),
552
- _: 3
553
- }, 8, ["length", "scrollTop"])) : (d(), p(V, { key: 1 }, [
554
- (d(!0), p(V, null, O(b.value, (s) => (d(), p("div", {
555
- key: s.value,
556
- class: fe([
557
- "transition-all overflow-y-clip",
558
- Y({ value: s.value }) ? "max-h-0 opacity-0" : "max-h-[64px] opacity-100"
559
- ])
560
- }, [
561
- k(M, {
562
- label: s.label,
563
- sublabel: s.sublabel,
564
- onClick: (h) => H(s.value, !g(s.value)),
565
- disabled: s.disabled,
566
- style: G({
567
- paddingTop: 4,
568
- paddingBottom: 4,
569
- paddingLeft: e.singleSelect === !0 ? 12 : 32
570
- })
571
- }, {
572
- prepend: w(() => [
573
- k(_, {
574
- "model-value": g(s.value),
575
- "onUpdate:modelValue": (h) => H(s.value, h),
576
- value: s.value,
577
- disabled: s.disabled
578
- }, null, 8, ["model-value", "onUpdate:modelValue", "value", "disabled"])
579
- ]),
580
- _: 2
581
- }, 1032, ["label", "sublabel", "onClick", "disabled", "style"])
582
- ], 2))), 128)),
583
- (d(!0), p(V, null, O(m.value, (s, h) => (d(), p("div", { key: h }, [
584
- (d(), I(pe(s)))
585
- ]))), 128))
586
- ], 64))
587
- ], 64))
588
- ]),
589
- _: 3
590
- })) : (d(), p("div", ct, P(L(l)("inventory.formField.noItemsFound")), 1))
591
- ]),
592
- B("div", {
593
- class: "sticky bottom-24",
594
- style: G({ transform: `translateX(${(((ce = R.value) == null ? void 0 : ce.clientWidth) ?? 0) - 80}px)` })
595
- }, [
596
- k(Ge, { name: "fade" }, {
597
- default: w(() => [
598
- Me.value ? (d(), I(ue, {
599
- key: 0,
600
- variant: "fab",
601
- class: "bg-white",
602
- "text-color": "neutral-gray-400",
603
- "prepend-icon": "keyboard_arrow_up",
604
- onClick: t[4] || (t[4] = () => {
605
- var s;
606
- return (s = R.value) == null ? void 0 : s.scrollTo({ top: 0, behavior: "smooth" });
607
- })
608
- })) : D("", !0)
609
- ]),
610
- _: 1
611
- })
612
- ], 4)
613
- ], 544);
614
- };
615
- }
616
- }), St = /* @__PURE__ */ Xe(mt, [["__scopeId", "data-v-0cf5baa2"]]);
617
- export {
618
- U as F,
619
- St as a,
620
- Ze as b
621
- };