@feedmepos/mf-inventory-portal 1.2.30-dev.1 → 1.2.31-dev.1
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/dist/{App-kX4bqoEe.js → App-DfKh34ES.js} +43 -41
- package/dist/{ApprovalView-DCNKqVE2.js → ApprovalView-DyoKsEqh.js} +34 -28
- package/dist/{BindingsDialog-d7f1f8gf.js → BindingsDialog-7rGLzkyA.js} +8 -8
- package/dist/{BindingsPicker-2HJOx0QW.js → BindingsPicker-Cj1DvhQN.js} +6 -5
- package/dist/{BindingsTable-CPAjxOZG.js → BindingsTable-CAreptqr.js} +28 -24
- package/dist/{ClosingDraftView-CUng41eo.js → ClosingDraftView-DoDGz9Y8.js} +183 -175
- package/dist/{ClosingHistoryView-CcGc2NwU.js → ClosingHistoryView-BJSE7ZSv.js} +43 -41
- package/dist/{ClosingTemplateView-D8IAdhDb.js → ClosingTemplateView-Dr2eJk4h.js} +94 -76
- package/dist/{DeliveryOrderPrintPreview-BsM-CCc5.js → DeliveryOrderPrintPreview-BzYLm6J6.js} +15 -14
- package/dist/FmDroppableField-J0xUsOTV.js +154 -0
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-cuggJ5Xd.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-16r_hkBE.js} +74 -72
- package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-Csesow4V.js +279 -0
- package/dist/FmMultiselectDialog-BGhSjgbj.js +597 -0
- package/dist/{FmMultiselectDialog-BGbrqXUF.js → FmMultiselectDialog-DUrpqAkF.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-isogcN1O.js → FmUnitInput.vue_vue_type_script_setup_true_lang-CSv7osJW.js} +51 -49
- package/dist/{ImportView-wAVrMEwL.js → ImportView-BAkyTU_3.js} +81 -74
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DVUF4I2Q.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-z0IAsrH_.js} +5 -5
- package/dist/{IngredientGroupView-BZczeXdL.js → IngredientGroupView-D7gurA7T.js} +73 -65
- package/dist/{IngredientsView-D5N5Y1ZY.js → IngredientsView-hwfpMtTX.js} +358 -345
- package/dist/{IntegrationView-Hrslmuc1.js → IntegrationView-DwqzQ6E3.js} +1618 -1593
- package/dist/{InventoryBindingForm-DH6wgxOG.js → InventoryBindingForm-CwjM6Rqk.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-Drr5vD6f.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-BPr8PDwu.js} +41 -40
- package/dist/{InventoryBindingSummary-BU1ehpQZ.js → InventoryBindingSummary-B7UFFMkm.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-1ueC4GfZ.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Djo2b2Ix.js} +5 -5
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-FHcU1zZt.js → PremiumBadge.vue_vue_type_script_setup_true_lang-BSgGGiN6.js} +22 -21
- package/dist/{PublishView-CQtj0f31.js → PublishView-CA9gFV_r.js} +26 -23
- package/dist/{PurchaseOrderPrintPreview-BQyXtHST.js → PurchaseOrderPrintPreview-BeHd82Y0.js} +10 -9
- package/dist/{ReceiveRequestView-Dm-h_SrY.js → ReceiveRequestView-DEthRdM1.js} +472 -456
- package/dist/{RecipeView-DNNRvr1w.js → RecipeView-D45gkYHY.js} +73 -64
- package/dist/SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js +251 -0
- package/dist/{StockView-CaOm5BCx.js → StockView-COx7A4Ac.js} +292 -282
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Z91XRszD.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DX35xDkm.js} +1 -1
- package/dist/{SupplierView-JSII9qwL.js → SupplierView-DHM3dJMZ.js} +92 -80
- package/dist/SystemTrailDialog.vue_vue_type_script_setup_true_lang-Bg2K2ULw.js +177 -0
- package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js +135 -0
- package/dist/TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CyMEGFh5.js +123 -0
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-Mehd4lGs.js → TransferDetails.vue_vue_type_script_setup_true_lang-CVm2bXic.js} +318 -305
- package/dist/{TransferTemplateView-DyCpNKJd.js → TransferTemplateView-BtYozLuk.js} +228 -216
- package/dist/{UnitView-CqN7mlJ2.js → UnitView-B4mqodQa.js} +70 -63
- package/dist/{WarehouseView-gFWD-m8e.js → WarehouseView-CjDM8L_V.js} +123 -114
- package/dist/WastageTemplateView-Be4Y_zV8.js +2288 -0
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/api/netsuite.d.ts +9 -3
- package/dist/app-DYsP0gKj.js +64121 -0
- package/dist/app-rgirz_52.js +8024 -0
- package/dist/app.js +6 -6
- package/dist/closing-template-BVy1ga2g.js +117 -0
- package/dist/date2-BO7HiZTk.js +116 -0
- package/dist/dayjs.min-HNt4C1ja.js +282 -0
- package/dist/{decimal-DfF_g5rc.js → decimal-BJ8rKm1R.js} +4 -3
- package/dist/defineDeepModel-CidpVmK7.js +19 -0
- package/dist/duplicate-template-C25Z0lvq.js +34 -0
- package/dist/feature-DCia3aqG.js +20162 -0
- package/dist/form-mode.enum-BKiNVH6A.js +4 -0
- package/dist/format-time-from-id-BPws326b.js +15 -0
- package/dist/{format-unit-display-ivAljvlo.js → format-unit-display-C2P3mS8l.js} +308 -297
- package/dist/{import-export.helper-B2MWv9v7.js → import-export.helper-Dt6ZMAPT.js} +56 -52
- package/dist/{index-DZaT0ZaL.js → index-6zxXdF-V.js} +1 -1
- package/dist/index-BjUDHtA2.js +45 -0
- package/dist/{index-BbhuWHyh.js → index-tZj47B-j.js} +16 -14
- package/dist/lodash-DLMgBu6M.js +3678 -0
- package/dist/netsuite-BSMLXIQa.js +4979 -0
- package/dist/{purchase-order-template-DdybMC_P.js → purchase-order-template-D5NGCbI2.js} +1 -1
- package/dist/router/shared.spec.d.ts +1 -0
- package/dist/row-action.enum-BcW_L_nE.js +67 -0
- package/dist/rules-BiaGzhvQ.js +201 -0
- package/dist/{stock-BYagIdsj.js → stock-DOCQ91Jh.js} +1 -1
- package/dist/{stock-V4ciPiBe.js → stock-Ty-89Ap8.js} +11 -10
- package/dist/stores/integration/netsuite.d.ts +5 -1
- package/dist/style.css +1 -1
- package/dist/{supplier-CgtB1I9I.js → supplier-Dxb5ULjF.js} +27 -26
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-BIQovyZX.js → use-ingredient-select-dialog-BI0yIG6A.js} +4 -3
- package/dist/{use-inventory-binding-dialog-DyjicXgc.js → use-inventory-binding-dialog-CbZC-VuL.js} +4 -3
- package/dist/use-template-enabled-locations-2-Dhttpl0B.js +111 -0
- package/dist/views/adjustment-template/wastage-template/table.d.ts +1 -1
- package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +1 -1
- package/dist/views/integration/components/netsuite/business/BusinessNetSuiteSideSheet.vue.d.ts +6 -2
- package/dist/vue-i18n-Cqx7gNJF.js +2365 -0
- package/dist/xlsx-ex8Bmftq.js +24004 -0
- package/dist/xlsx.util-C8YXEqEl.js +78 -0
- package/package.json +2 -2
- package/dist/app-CnQ49Lyb.js +0 -131483
|
@@ -0,0 +1,597 @@
|
|
|
1
|
+
var Le = Object.defineProperty;
|
|
2
|
+
var Ie = (F, o, t) => o in F ? Le(F, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : F[o] = t;
|
|
3
|
+
var me = (F, o, t) => Ie(F, typeof o != "symbol" ? o + "" : o, t);
|
|
4
|
+
import { defineComponent as ye, computed as S, ref as L, watch as ge, openBlock as c, createElementBlock as h, normalizeStyle as G, Fragment as V, renderList as $, renderSlot as ke, createCommentVNode as O, useSlots as De, onMounted as He, onUnmounted as $e, reactive as q, resolveComponent as B, createElementVNode as I, createVNode as _, toDisplayString as ee, unref as H, createSlots as Oe, withCtx as w, createBlock as M, resolveDynamicComponent as fe, normalizeClass as he, withModifiers as Ue, Transition as Pe } from "vue";
|
|
5
|
+
import { useDialogChild as Ee } from "@feedmepos/ui-library";
|
|
6
|
+
import { x as be } from "./app-DYsP0gKj.js";
|
|
7
|
+
import { d as Ne } from "./index-BjUDHtA2.js";
|
|
8
|
+
/* empty css */
|
|
9
|
+
import { useI18n as je } from "@feedmepos/mf-common";
|
|
10
|
+
import { N as Ge, H as ze, b as Ke } from "./app-rgirz_52.js";
|
|
11
|
+
import { _ as We } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
12
|
+
const Je = /* @__PURE__ */ ye({
|
|
13
|
+
__name: "VirtualScroll",
|
|
14
|
+
props: {
|
|
15
|
+
itemHeight: {},
|
|
16
|
+
length: {},
|
|
17
|
+
scrollTop: {},
|
|
18
|
+
prerender: {}
|
|
19
|
+
},
|
|
20
|
+
emits: ["changed:minHeight"],
|
|
21
|
+
setup(F, { emit: o }) {
|
|
22
|
+
const t = F, u = o, s = S(() => {
|
|
23
|
+
const k = t.itemHeight * t.length;
|
|
24
|
+
return u("changed:minHeight", k), `${k}px`;
|
|
25
|
+
}), p = L(0), v = S(
|
|
26
|
+
() => Array.from({ length: t.prerender }).map((k, b) => b + p.value)
|
|
27
|
+
);
|
|
28
|
+
function d() {
|
|
29
|
+
p.value = Math.floor(t.scrollTop / t.itemHeight) - Math.floor(t.prerender / 2);
|
|
30
|
+
}
|
|
31
|
+
const i = L(Ne(d, 10));
|
|
32
|
+
ge([() => t.scrollTop], () => {
|
|
33
|
+
i.value();
|
|
34
|
+
});
|
|
35
|
+
function g(k) {
|
|
36
|
+
const b = k.el;
|
|
37
|
+
b && (b.style.opacity = "0", setTimeout(() => {
|
|
38
|
+
b.style.opacity = "1";
|
|
39
|
+
}, 0));
|
|
40
|
+
}
|
|
41
|
+
return (k, b) => (c(), h("div", {
|
|
42
|
+
class: "relative",
|
|
43
|
+
style: G({ minHeight: s.value })
|
|
44
|
+
}, [
|
|
45
|
+
(c(!0), h(V, null, $(v.value, (C) => (c(), h(V, { key: C }, [
|
|
46
|
+
C >= 0 && C < k.length ? (c(), h("div", {
|
|
47
|
+
key: 0,
|
|
48
|
+
class: "absolute w-full left-0 bg-white",
|
|
49
|
+
style: G({
|
|
50
|
+
top: `${k.itemHeight * C}px`,
|
|
51
|
+
height: `${k.itemHeight}px`,
|
|
52
|
+
transition: "opacity 0.5s ease"
|
|
53
|
+
}),
|
|
54
|
+
onVnodeMounted: g
|
|
55
|
+
}, [
|
|
56
|
+
ke(k.$slots, "default", {
|
|
57
|
+
key: C,
|
|
58
|
+
index: C,
|
|
59
|
+
getItem: (A) => A[C]
|
|
60
|
+
})
|
|
61
|
+
], 4)) : O("", !0)
|
|
62
|
+
], 64))), 128))
|
|
63
|
+
], 4));
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
class J {
|
|
67
|
+
static getDescendantProperty(o, t, u = []) {
|
|
68
|
+
let s, p, v, d, i, g;
|
|
69
|
+
if (t) {
|
|
70
|
+
if (v = t.indexOf("."), v === -1 ? s = t : (s = t.slice(0, v), p = t.slice(v + 1)), d = o[s], d !== null && typeof d < "u")
|
|
71
|
+
if (!p && (typeof d == "string" || typeof d == "number"))
|
|
72
|
+
u.push(d);
|
|
73
|
+
else if (Object.prototype.toString.call(d) === "[object Array]")
|
|
74
|
+
for (i = 0, g = d.length; i < g; i++)
|
|
75
|
+
J.getDescendantProperty(d[i], p, u);
|
|
76
|
+
else p && J.getDescendantProperty(d, p, u);
|
|
77
|
+
} else
|
|
78
|
+
u.push(o);
|
|
79
|
+
return u;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
class U {
|
|
83
|
+
constructor(o = [], t = [], u = {}) {
|
|
84
|
+
Array.isArray(t) || (u = t, t = []), this.haystack = o, this.keys = t, this.options = Object.assign({
|
|
85
|
+
caseSensitive: !1,
|
|
86
|
+
sort: !1
|
|
87
|
+
}, u);
|
|
88
|
+
}
|
|
89
|
+
search(o = "") {
|
|
90
|
+
if (o === "")
|
|
91
|
+
return this.haystack;
|
|
92
|
+
const t = [];
|
|
93
|
+
for (let u = 0; u < this.haystack.length; u++) {
|
|
94
|
+
const s = this.haystack[u];
|
|
95
|
+
if (this.keys.length === 0) {
|
|
96
|
+
const p = U.isMatch(s, o, this.options.caseSensitive);
|
|
97
|
+
p && t.push({ item: s, score: p });
|
|
98
|
+
} else
|
|
99
|
+
for (let p = 0; p < this.keys.length; p++) {
|
|
100
|
+
const v = J.getDescendantProperty(s, this.keys[p]);
|
|
101
|
+
let d = !1;
|
|
102
|
+
for (let i = 0; i < v.length; i++) {
|
|
103
|
+
const g = U.isMatch(v[i], o, this.options.caseSensitive);
|
|
104
|
+
if (g) {
|
|
105
|
+
d = !0, t.push({ item: s, score: g });
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
if (d)
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return this.options.sort && t.sort((u, s) => u.score - s.score), t.map((u) => u.item);
|
|
114
|
+
}
|
|
115
|
+
static isMatch(o, t, u) {
|
|
116
|
+
o = String(o), t = String(t), u || (o = o.toLocaleLowerCase(), t = t.toLocaleLowerCase());
|
|
117
|
+
const s = U.nearestIndexesFor(o, t);
|
|
118
|
+
return s ? o === t ? 1 : s.length > 1 ? 2 + (s[s.length - 1] - s[0]) : 2 + s[0] : !1;
|
|
119
|
+
}
|
|
120
|
+
static nearestIndexesFor(o, t) {
|
|
121
|
+
const u = t.split("");
|
|
122
|
+
let s = [];
|
|
123
|
+
return U.indexesOfFirstLetter(o, t).forEach((v, d) => {
|
|
124
|
+
let i = v + 1;
|
|
125
|
+
s[d] = [v];
|
|
126
|
+
for (let g = 1; g < u.length; g++) {
|
|
127
|
+
const k = u[g];
|
|
128
|
+
if (i = o.indexOf(k, i), i === -1) {
|
|
129
|
+
s[d] = !1;
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
s[d].push(i), i++;
|
|
133
|
+
}
|
|
134
|
+
}), s = s.filter((v) => v !== !1), s.length ? s.sort((v, d) => v.length === 1 ? v[0] - d[0] : (v = v[v.length - 1] - v[0], d = d[d.length - 1] - d[0], v - d))[0] : !1;
|
|
135
|
+
}
|
|
136
|
+
static indexesOfFirstLetter(o, t) {
|
|
137
|
+
const u = t[0];
|
|
138
|
+
return o.split("").map((s, p) => s !== u ? !1 : p).filter((s) => s !== !1);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
class Qe {
|
|
142
|
+
constructor(o, t) {
|
|
143
|
+
me(this, "searcher");
|
|
144
|
+
this.candidates = o, t ?? (t = (u) => [String(u)]), this.searcher = new U(
|
|
145
|
+
o.flatMap(
|
|
146
|
+
(u, s) => (t == null ? void 0 : t(u).map((p) => ({ key: p, index: s }))) ?? []
|
|
147
|
+
),
|
|
148
|
+
["key"],
|
|
149
|
+
{ caseSensitive: !1, sort: !0 }
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
search(o) {
|
|
153
|
+
return [...new Set(this.searcher.search(o).map((t) => t.index))].map(
|
|
154
|
+
(t) => this.candidates[t]
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
const Xe = { class: "sticky top-0 bg-white z-50" }, Re = {
|
|
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
|
+
}, Ye = { class: "flex justify-between items-center" }, Ze = { class: "flex gap-16 basis-1/2" }, qe = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, el = {
|
|
163
|
+
key: 1,
|
|
164
|
+
class: "pt-8 pb-8"
|
|
165
|
+
}, ll = {
|
|
166
|
+
key: 0,
|
|
167
|
+
class: "flex items-center gap-8 justify-center py-32"
|
|
168
|
+
}, tl = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, sl = {
|
|
169
|
+
key: 0,
|
|
170
|
+
class: "flex gap-4 items-center"
|
|
171
|
+
}, al = {
|
|
172
|
+
key: 2,
|
|
173
|
+
class: "p-16 text-fm-color-typo-disabled fm-typo-en-body-lg-400 text-center"
|
|
174
|
+
}, nl = /* @__PURE__ */ ye({
|
|
175
|
+
__name: "FmMultiselectDialog",
|
|
176
|
+
props: {
|
|
177
|
+
modelValue: {},
|
|
178
|
+
items: {},
|
|
179
|
+
groups: {},
|
|
180
|
+
singleSelect: { type: Boolean },
|
|
181
|
+
placeholder: {},
|
|
182
|
+
showValidBorder: { type: Boolean },
|
|
183
|
+
maxHeight: {},
|
|
184
|
+
width: {},
|
|
185
|
+
noShadow: { type: Boolean },
|
|
186
|
+
loading: { type: Boolean },
|
|
187
|
+
virtualScroll: { type: Boolean },
|
|
188
|
+
filterAttributes: {}
|
|
189
|
+
},
|
|
190
|
+
emits: ["update:modelValue", "close"],
|
|
191
|
+
setup(F, { emit: o }) {
|
|
192
|
+
var oe, ie, re;
|
|
193
|
+
const { t } = je(), u = Ee(), s = F, p = De(), v = S(() => {
|
|
194
|
+
var l;
|
|
195
|
+
const e = (l = p.appendList) == null ? void 0 : l.call(p);
|
|
196
|
+
return Array.isArray(e) ? e : e ? [e] : [];
|
|
197
|
+
}), d = o, i = L(s.modelValue ?? []);
|
|
198
|
+
He(() => {
|
|
199
|
+
var l, n, r, m;
|
|
200
|
+
u.emitData(i.value);
|
|
201
|
+
const e = (l = s.modelValue) != null && l.length ? s.items.findIndex((x) => {
|
|
202
|
+
var T;
|
|
203
|
+
return be(x.value, (T = s.modelValue) == null ? void 0 : T[0]);
|
|
204
|
+
}) : 0;
|
|
205
|
+
(n = W.value) == null || n.scrollTo({ top: e * 64 - 64, behavior: "smooth" }), (m = (r = ne.value) == null ? void 0 : r.inputEl) == null || m.focus();
|
|
206
|
+
}), $e(() => {
|
|
207
|
+
d("close");
|
|
208
|
+
}), ge([() => i.value], ([e]) => {
|
|
209
|
+
u.emitData(e), d("update:modelValue", e);
|
|
210
|
+
});
|
|
211
|
+
function g(e) {
|
|
212
|
+
return A.value.has(b(e));
|
|
213
|
+
}
|
|
214
|
+
const k = /* @__PURE__ */ new WeakMap();
|
|
215
|
+
function b(e) {
|
|
216
|
+
if (e && typeof e == "object") {
|
|
217
|
+
if ("_id" in e && e._id) return String(e._id);
|
|
218
|
+
const l = k.get(e);
|
|
219
|
+
if (l) return l;
|
|
220
|
+
const n = JSON.stringify(e);
|
|
221
|
+
return k.set(e, n), n;
|
|
222
|
+
}
|
|
223
|
+
return String(e);
|
|
224
|
+
}
|
|
225
|
+
const C = S(() => {
|
|
226
|
+
const e = /* @__PURE__ */ new Map();
|
|
227
|
+
for (const l of s.items) e.set(b(l.value), l);
|
|
228
|
+
return e;
|
|
229
|
+
}), A = S(() => new Set(i.value.map((e) => b(e)))), Q = S(
|
|
230
|
+
() => new Set(y.value.map((e) => b(e.value)))
|
|
231
|
+
);
|
|
232
|
+
function D(e, l) {
|
|
233
|
+
if (s.singleSelect) {
|
|
234
|
+
i.value = l ? [e] : [];
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
const n = b(e), r = A.value.has(n);
|
|
238
|
+
l && r || !l && !r || (l ? i.value = [...i.value, e] : i.value = i.value.filter((m) => b(m) !== n));
|
|
239
|
+
}
|
|
240
|
+
const _e = S(
|
|
241
|
+
() => new Qe(
|
|
242
|
+
s.items,
|
|
243
|
+
(e) => [e.label ?? "", e.sublabel ?? "", ...e.searchKeys ?? []].filter((l) => l)
|
|
244
|
+
)
|
|
245
|
+
), P = L(""), z = L(null), y = S(() => {
|
|
246
|
+
let e = _e.value.search(P.value);
|
|
247
|
+
if (z.value && s.filterAttributes) {
|
|
248
|
+
const l = Ge.build(z.value);
|
|
249
|
+
e = e.filter((n) => ze(n, l));
|
|
250
|
+
}
|
|
251
|
+
return e;
|
|
252
|
+
}), le = S(() => {
|
|
253
|
+
const e = [], l = C.value, n = Q.value;
|
|
254
|
+
for (const r of i.value) {
|
|
255
|
+
const m = b(r), x = l.get(m);
|
|
256
|
+
x && !x.disabled && n.has(m) && e.push(r);
|
|
257
|
+
}
|
|
258
|
+
return e;
|
|
259
|
+
}), E = S(() => {
|
|
260
|
+
const e = y.value.filter((l) => !l.disabled);
|
|
261
|
+
return le.value.length === e.length;
|
|
262
|
+
}), te = S(() => le.value.length > 0 && !E.value);
|
|
263
|
+
function Se() {
|
|
264
|
+
if (E.value) {
|
|
265
|
+
const e = Q.value;
|
|
266
|
+
i.value = i.value.filter((l) => {
|
|
267
|
+
const n = b(l), r = C.value.get(n);
|
|
268
|
+
return (r == null ? void 0 : r.disabled) && !e.has(n);
|
|
269
|
+
});
|
|
270
|
+
} else {
|
|
271
|
+
const e = A.value, l = Q.value;
|
|
272
|
+
i.value = s.items.filter(
|
|
273
|
+
(n) => !n.disabled && (e.has(b(n.value)) || l.has(b(n.value)))
|
|
274
|
+
).map((n) => n.value);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
const xe = q(
|
|
278
|
+
((oe = s.items) == null ? void 0 : oe.map((e) => ({ value: e.value, disabled: e.disabled ?? !1 }))) ?? []
|
|
279
|
+
);
|
|
280
|
+
function we(e, l) {
|
|
281
|
+
return e.reduce(
|
|
282
|
+
(n, r) => {
|
|
283
|
+
const m = l(r);
|
|
284
|
+
return n[m] || (n[m] = []), n[m].push(r), n;
|
|
285
|
+
},
|
|
286
|
+
{}
|
|
287
|
+
);
|
|
288
|
+
}
|
|
289
|
+
const Fe = S(() => we(xe, (e) => {
|
|
290
|
+
var l;
|
|
291
|
+
return (l = e.value) == null ? void 0 : l._id;
|
|
292
|
+
})), Ce = q(
|
|
293
|
+
((ie = s.items) == null ? void 0 : ie.map((e) => ({ value: e.value, collapsed: e.collapsed ?? !1 }))) ?? []
|
|
294
|
+
), X = q(
|
|
295
|
+
((re = s.groups) == null ? void 0 : re.reduce(
|
|
296
|
+
(e, l) => (e[l.id] = l.collapse ?? !1, e),
|
|
297
|
+
{}
|
|
298
|
+
)) ?? {}
|
|
299
|
+
);
|
|
300
|
+
function R({ groupId: e, value: l }) {
|
|
301
|
+
var n;
|
|
302
|
+
return e && X[e] || ((n = Ce.find((r) => be(r.value, l))) == null ? void 0 : n.collapsed);
|
|
303
|
+
}
|
|
304
|
+
function Ve(e) {
|
|
305
|
+
X[e] = !X[e];
|
|
306
|
+
}
|
|
307
|
+
const Y = S(() => {
|
|
308
|
+
const e = /* @__PURE__ */ new Map();
|
|
309
|
+
for (const l of s.items)
|
|
310
|
+
if (l.groupId) {
|
|
311
|
+
const n = b(l.value), r = e.get(l.groupId) ?? [];
|
|
312
|
+
r.push(n), e.set(l.groupId, r);
|
|
313
|
+
}
|
|
314
|
+
return e;
|
|
315
|
+
});
|
|
316
|
+
function Z(e) {
|
|
317
|
+
const l = Y.value.get(e) || [], n = A.value;
|
|
318
|
+
return l.length > 0 && l.every((r) => n.has(r));
|
|
319
|
+
}
|
|
320
|
+
function se(e) {
|
|
321
|
+
const l = Y.value.get(e) || [], n = A.value;
|
|
322
|
+
return l.some((r) => n.has(r)) && !Z(e);
|
|
323
|
+
}
|
|
324
|
+
function Ae(e) {
|
|
325
|
+
const l = Y.value.get(e) || [];
|
|
326
|
+
if (!l.length) return;
|
|
327
|
+
const n = A.value;
|
|
328
|
+
if (Z(e))
|
|
329
|
+
i.value = i.value.filter((r) => !l.includes(b(r)));
|
|
330
|
+
else if (se(e)) {
|
|
331
|
+
const r = [];
|
|
332
|
+
for (const m of s.items)
|
|
333
|
+
if (m.groupId === e) {
|
|
334
|
+
const x = b(m.value);
|
|
335
|
+
n.has(x) || r.push(m.value);
|
|
336
|
+
}
|
|
337
|
+
r.length && (i.value = [...i.value, ...r]);
|
|
338
|
+
} else {
|
|
339
|
+
const r = s.items.filter((m) => m.groupId === e).map((m) => m.value);
|
|
340
|
+
i.value = [...i.value, ...r];
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
const K = L(0);
|
|
344
|
+
function ae(e) {
|
|
345
|
+
var l;
|
|
346
|
+
K.value = ((l = e.target) == null ? void 0 : l.scrollTop) ?? K;
|
|
347
|
+
}
|
|
348
|
+
const Te = S(() => K.value > 100), W = L(), ne = L();
|
|
349
|
+
return (e, l) => {
|
|
350
|
+
var de, ce;
|
|
351
|
+
const n = B("FmIcon"), r = B("FmTextField"), m = B("FmCircularProgress"), x = B("FmCheckbox"), T = B("FmListItem"), Be = B("FmChip"), ue = B("FmButton"), Me = B("FmList");
|
|
352
|
+
return c(), h("div", {
|
|
353
|
+
class: "relative max-h-[380px] overflow-y-auto overflow-x-hidden",
|
|
354
|
+
onScroll: ae,
|
|
355
|
+
onScrollend: ae,
|
|
356
|
+
ref_key: "scrollable",
|
|
357
|
+
ref: W
|
|
358
|
+
}, [
|
|
359
|
+
I("div", Xe, [
|
|
360
|
+
e.noShadow ? O("", !0) : (c(), h("div", Re)),
|
|
361
|
+
I("div", Ye, [
|
|
362
|
+
I("div", Ze, [
|
|
363
|
+
_(n, { name: "autorenew" }),
|
|
364
|
+
I("span", qe, ee(H(t)("inventory.formField.itemsSelected", { count: ((de = i.value) == null ? void 0 : de.length) ?? 0 })), 1)
|
|
365
|
+
]),
|
|
366
|
+
_(r, {
|
|
367
|
+
class: "basis-1/2",
|
|
368
|
+
modelValue: P.value,
|
|
369
|
+
"onUpdate:modelValue": l[1] || (l[1] = (a) => P.value = a),
|
|
370
|
+
"prepend-icon": "search",
|
|
371
|
+
placeholder: e.placeholder,
|
|
372
|
+
ref_key: "searchTextField",
|
|
373
|
+
ref: ne
|
|
374
|
+
}, Oe({ _: 2 }, [
|
|
375
|
+
P.value.length ? {
|
|
376
|
+
name: "append",
|
|
377
|
+
fn: w(() => [
|
|
378
|
+
_(n, {
|
|
379
|
+
class: "cursor-pointer",
|
|
380
|
+
name: "close",
|
|
381
|
+
onClick: l[0] || (l[0] = (a) => P.value = "")
|
|
382
|
+
})
|
|
383
|
+
]),
|
|
384
|
+
key: "0"
|
|
385
|
+
} : void 0
|
|
386
|
+
]), 1032, ["modelValue", "placeholder"])
|
|
387
|
+
]),
|
|
388
|
+
e.filterAttributes && e.filterAttributes.length > 0 ? (c(), h("div", el, [
|
|
389
|
+
_(H(Ke), {
|
|
390
|
+
modelValue: z.value,
|
|
391
|
+
"onUpdate:modelValue": l[2] || (l[2] = (a) => z.value = a),
|
|
392
|
+
attributes: e.filterAttributes
|
|
393
|
+
}, null, 8, ["modelValue", "attributes"])
|
|
394
|
+
])) : O("", !0)
|
|
395
|
+
]),
|
|
396
|
+
I("div", null, [
|
|
397
|
+
e.loading ? (c(), h("div", ll, [
|
|
398
|
+
_(m, {
|
|
399
|
+
size: "md",
|
|
400
|
+
color: "neutral-gray-400"
|
|
401
|
+
}),
|
|
402
|
+
I("div", tl, ee(H(t)("inventory.formField.loading")), 1)
|
|
403
|
+
])) : y.value.length ? (c(), M(Me, { key: 1 }, {
|
|
404
|
+
default: w(() => [
|
|
405
|
+
e.singleSelect ? O("", !0) : (c(), M(T, {
|
|
406
|
+
key: 0,
|
|
407
|
+
"model-value": E.value,
|
|
408
|
+
indeterminate: te.value,
|
|
409
|
+
value: "",
|
|
410
|
+
onClick: l[3] || (l[3] = (a) => Se())
|
|
411
|
+
}, {
|
|
412
|
+
prepend: w(() => [
|
|
413
|
+
_(x, {
|
|
414
|
+
"model-value": E.value,
|
|
415
|
+
indeterminate: te.value,
|
|
416
|
+
label: E.value ? H(t)("inventory.formField.select.removeAll") : H(t)("inventory.formField.select.selectAll"),
|
|
417
|
+
value: ""
|
|
418
|
+
}, null, 8, ["model-value", "indeterminate", "label"])
|
|
419
|
+
]),
|
|
420
|
+
_: 1
|
|
421
|
+
}, 8, ["model-value", "indeterminate"])),
|
|
422
|
+
e.groups ? (c(!0), h(V, { key: 2 }, $(e.groups, (a) => (c(), h(V, {
|
|
423
|
+
key: a.id
|
|
424
|
+
}, [
|
|
425
|
+
_(T, {
|
|
426
|
+
label: a.label,
|
|
427
|
+
sublabel: a.sublabel,
|
|
428
|
+
style: { "padding-top": "4px", "padding-bottom": "4px", "padding-left": "32px" },
|
|
429
|
+
disabled: a.disabled
|
|
430
|
+
}, {
|
|
431
|
+
prepend: w(() => [
|
|
432
|
+
_(x, {
|
|
433
|
+
"model-value": Z(a.id),
|
|
434
|
+
indeterminate: se(a.id),
|
|
435
|
+
onClick: () => Ae(a.id),
|
|
436
|
+
value: a.id,
|
|
437
|
+
disabled: a.disabled
|
|
438
|
+
}, null, 8, ["model-value", "indeterminate", "onClick", "value", "disabled"])
|
|
439
|
+
]),
|
|
440
|
+
append: w(() => [
|
|
441
|
+
_(ue, {
|
|
442
|
+
"prepend-icon": R({ groupId: a.id }) ? "expand_less" : "expand_more",
|
|
443
|
+
size: "md",
|
|
444
|
+
variant: "tertiary",
|
|
445
|
+
onClick: Ue(() => Ve(a.id), ["stop"])
|
|
446
|
+
}, null, 8, ["prepend-icon", "onClick"])
|
|
447
|
+
]),
|
|
448
|
+
_: 2
|
|
449
|
+
}, 1032, ["label", "sublabel", "disabled"]),
|
|
450
|
+
(c(!0), h(V, null, $(y.value.filter((f) => f.groupId === a.id), (f) => (c(), h("div", {
|
|
451
|
+
key: f.value,
|
|
452
|
+
class: he([
|
|
453
|
+
"transition-all overflow-y-clip",
|
|
454
|
+
R({ groupId: a.id, value: f.value }) ? "max-h-0 opacity-0" : "max-h-[64px] opacity-100"
|
|
455
|
+
])
|
|
456
|
+
}, [
|
|
457
|
+
_(T, {
|
|
458
|
+
label: f.label,
|
|
459
|
+
sublabel: f.sublabel,
|
|
460
|
+
disabled: f.disabled,
|
|
461
|
+
onClick: (N) => D(f.value, !g(f.value)),
|
|
462
|
+
style: { "padding-top": "4px", "padding-bottom": "4px", "padding-left": "64px" }
|
|
463
|
+
}, {
|
|
464
|
+
prepend: w(() => [
|
|
465
|
+
_(x, {
|
|
466
|
+
"model-value": g(f.value),
|
|
467
|
+
"onUpdate:modelValue": (N) => D(f.value, N),
|
|
468
|
+
value: f.value,
|
|
469
|
+
disabled: f.disabled
|
|
470
|
+
}, null, 8, ["model-value", "onUpdate:modelValue", "value", "disabled"])
|
|
471
|
+
]),
|
|
472
|
+
_: 2
|
|
473
|
+
}, 1032, ["label", "sublabel", "disabled", "onClick"])
|
|
474
|
+
], 2))), 128))
|
|
475
|
+
], 64))), 128)) : (c(), h(V, { key: 1 }, [
|
|
476
|
+
e.virtualScroll ? (c(), M(Je, {
|
|
477
|
+
key: 0,
|
|
478
|
+
length: y.value.length + v.value.length,
|
|
479
|
+
"item-height": 64,
|
|
480
|
+
scrollTop: K.value,
|
|
481
|
+
prerender: 100
|
|
482
|
+
}, {
|
|
483
|
+
default: w(({ getItem: a, index: f }) => {
|
|
484
|
+
var N, ve;
|
|
485
|
+
return [
|
|
486
|
+
f < y.value.length ? (c(), M(T, {
|
|
487
|
+
key: 0,
|
|
488
|
+
label: a(y.value).label,
|
|
489
|
+
sublabel: a(y.value).sublabel,
|
|
490
|
+
onClick: (j) => D(
|
|
491
|
+
a(y.value).value,
|
|
492
|
+
!g(a(y.value).value)
|
|
493
|
+
),
|
|
494
|
+
disabled: (ve = Fe.value[(N = a(y.value).value) == null ? void 0 : N._id][0]) == null ? void 0 : ve.disabled,
|
|
495
|
+
style: G({
|
|
496
|
+
paddingTop: 4,
|
|
497
|
+
paddingBottom: 4,
|
|
498
|
+
paddingLeft: e.singleSelect === !0 ? 12 : 32
|
|
499
|
+
})
|
|
500
|
+
}, {
|
|
501
|
+
prepend: w(() => [
|
|
502
|
+
_(x, {
|
|
503
|
+
"model-value": g(a(y.value).value),
|
|
504
|
+
"onUpdate:modelValue": (j) => D(a(y.value).value, j),
|
|
505
|
+
value: a(y.value).value,
|
|
506
|
+
disabled: a(y.value).disabled
|
|
507
|
+
}, null, 8, ["model-value", "onUpdate:modelValue", "value", "disabled"])
|
|
508
|
+
]),
|
|
509
|
+
append: w(() => {
|
|
510
|
+
var j;
|
|
511
|
+
return [
|
|
512
|
+
(j = a(y.value)) != null && j.tags ? (c(), h("div", sl, [
|
|
513
|
+
(c(!0), h(V, null, $(a(y.value).tags, (pe) => (c(), M(Be, {
|
|
514
|
+
key: pe.label,
|
|
515
|
+
label: pe,
|
|
516
|
+
compact: ""
|
|
517
|
+
}, null, 8, ["label"]))), 128))
|
|
518
|
+
])) : O("", !0),
|
|
519
|
+
ke(e.$slots, "appendListItem", {
|
|
520
|
+
item: a(y.value)
|
|
521
|
+
}, void 0, !0)
|
|
522
|
+
];
|
|
523
|
+
}),
|
|
524
|
+
_: 2
|
|
525
|
+
}, 1032, ["label", "sublabel", "onClick", "disabled", "style"])) : (c(), M(fe(v.value[f - y.value.length]), { key: 1 }))
|
|
526
|
+
];
|
|
527
|
+
}),
|
|
528
|
+
_: 3
|
|
529
|
+
}, 8, ["length", "scrollTop"])) : (c(), h(V, { key: 1 }, [
|
|
530
|
+
(c(!0), h(V, null, $(y.value, (a) => (c(), h("div", {
|
|
531
|
+
key: a.value,
|
|
532
|
+
class: he([
|
|
533
|
+
"transition-all overflow-y-clip",
|
|
534
|
+
R({ value: a.value }) ? "max-h-0 opacity-0" : "max-h-[64px] opacity-100"
|
|
535
|
+
])
|
|
536
|
+
}, [
|
|
537
|
+
_(T, {
|
|
538
|
+
label: a.label,
|
|
539
|
+
sublabel: a.sublabel,
|
|
540
|
+
onClick: (f) => D(a.value, !g(a.value)),
|
|
541
|
+
disabled: a.disabled,
|
|
542
|
+
style: G({
|
|
543
|
+
paddingTop: 4,
|
|
544
|
+
paddingBottom: 4,
|
|
545
|
+
paddingLeft: e.singleSelect === !0 ? 12 : 32
|
|
546
|
+
})
|
|
547
|
+
}, {
|
|
548
|
+
prepend: w(() => [
|
|
549
|
+
_(x, {
|
|
550
|
+
"model-value": g(a.value),
|
|
551
|
+
"onUpdate:modelValue": (f) => D(a.value, f),
|
|
552
|
+
value: a.value,
|
|
553
|
+
disabled: a.disabled
|
|
554
|
+
}, null, 8, ["model-value", "onUpdate:modelValue", "value", "disabled"])
|
|
555
|
+
]),
|
|
556
|
+
_: 2
|
|
557
|
+
}, 1032, ["label", "sublabel", "onClick", "disabled", "style"])
|
|
558
|
+
], 2))), 128)),
|
|
559
|
+
(c(!0), h(V, null, $(v.value, (a, f) => (c(), h("div", { key: f }, [
|
|
560
|
+
(c(), M(fe(a)))
|
|
561
|
+
]))), 128))
|
|
562
|
+
], 64))
|
|
563
|
+
], 64))
|
|
564
|
+
]),
|
|
565
|
+
_: 3
|
|
566
|
+
})) : (c(), h("div", al, ee(H(t)("inventory.formField.noItemsFound")), 1))
|
|
567
|
+
]),
|
|
568
|
+
I("div", {
|
|
569
|
+
class: "sticky bottom-24",
|
|
570
|
+
style: G({ transform: `translateX(${(((ce = W.value) == null ? void 0 : ce.clientWidth) ?? 0) - 80}px)` })
|
|
571
|
+
}, [
|
|
572
|
+
_(Pe, { name: "fade" }, {
|
|
573
|
+
default: w(() => [
|
|
574
|
+
Te.value ? (c(), M(ue, {
|
|
575
|
+
key: 0,
|
|
576
|
+
variant: "fab",
|
|
577
|
+
class: "bg-white",
|
|
578
|
+
"text-color": "neutral-gray-400",
|
|
579
|
+
"prepend-icon": "keyboard_arrow_up",
|
|
580
|
+
onClick: l[4] || (l[4] = () => {
|
|
581
|
+
var a;
|
|
582
|
+
return (a = W.value) == null ? void 0 : a.scrollTo({ top: 0, behavior: "smooth" });
|
|
583
|
+
})
|
|
584
|
+
})) : O("", !0)
|
|
585
|
+
]),
|
|
586
|
+
_: 1
|
|
587
|
+
})
|
|
588
|
+
], 4)
|
|
589
|
+
], 544);
|
|
590
|
+
};
|
|
591
|
+
}
|
|
592
|
+
}), fl = /* @__PURE__ */ We(nl, [["__scopeId", "data-v-6f532501"]]);
|
|
593
|
+
export {
|
|
594
|
+
U as F,
|
|
595
|
+
fl as a,
|
|
596
|
+
Qe as b
|
|
597
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineStore as p } from "pinia";
|
|
2
2
|
import { useDialog as y } from "@feedmepos/ui-library";
|
|
3
3
|
import { useI18n as v } from "@feedmepos/mf-common";
|
|
4
|
-
import {
|
|
4
|
+
import { a } from "./FmMultiselectDialog-BGhSjgbj.js";
|
|
5
5
|
import { h as S } from "vue";
|
|
6
6
|
const w = p("inventoryMultiSelectDialog", () => {
|
|
7
7
|
const l = y(), { t: n } = v();
|