@feedmepos/mf-inventory-portal 0.0.25-dev.1 → 0.0.25-dev.12
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-TRzHN9-F.js → App-PehI6qSK.js} +35 -34
- package/dist/ApprovalView-a6tbFyO2.js +140 -0
- package/dist/{BindingsDialog-B8WqnjnP.js → BindingsDialog-BNco1Vhd.js} +6 -6
- package/dist/{BindingsPicker-jlcu-d6r.js → BindingsPicker-Dns2kFS-.js} +3 -3
- package/dist/{BindingsTable-B00mXBU7.js → BindingsTable-DTrXzYzr.js} +6 -6
- package/dist/{ClosingDraftView-CTzudiDa.js → ClosingDraftView-BXBkI6WL.js} +47 -47
- package/dist/ClosingTemplateView-BiAGOmVg.js +1859 -0
- package/dist/FmCustomAttribute.vue_vue_type_script_setup_true_lang-D-IWRjRD.js +34 -0
- package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-IlN0Uj04.js +211 -0
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-C8UXVANj.js → FmUnitInput.vue_vue_type_script_setup_true_lang-JDL6LVAb.js} +52 -52
- package/dist/IngredientBindedItem.vue_vue_type_script_setup_true_lang-DR5ewA1c.js +51 -0
- package/dist/{IngredientGroupView-C5XpFU4A.js → IngredientGroupView-Bci0qysG.js} +1 -1
- package/dist/{IngredientsView-jP9q6wm1.js → IngredientsView-Dpc_GncE.js} +394 -382
- package/dist/{IntegrationView-DmX1Q9KM.js → IntegrationView-DCWg-DR4.js} +660 -623
- package/dist/{InventoryBindingForm-Doz0ISM5.js → InventoryBindingForm-BwwF-2NM.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CXntbRos.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-1BVSUfuT.js} +55 -55
- package/dist/{InventoryBindingSummary-DDjzipz8.js → InventoryBindingSummary-DgoHed7T.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-B8cFyxTY.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Bu4Dw_6P.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-DUDKXBlh.js → PremiumBadge.vue_vue_type_script_setup_true_lang-CW7-Eu69.js} +15 -15
- package/dist/{PublishView-BX7n6k7c.js → PublishView-DVYBAYBI.js} +7 -7
- package/dist/{PurchaseOrderPrintPreview-BjSoZs6d.js → PurchaseOrderPrintPreview-Dp2v_J3o.js} +1 -1
- package/dist/{ReceiveRequestView-B7EWBCnW.js → ReceiveRequestView-DVq8tkzd.js} +503 -494
- package/dist/{RecipeView-DZo_HxRD.js → RecipeView-Cv5EH2Ah.js} +32 -31
- package/dist/{index-qnLd0zOS.js → StockView-B7x9Pywp.js} +3577 -1764
- package/dist/{SupplierView-CSB0MJPt.js → SupplierView-BgyqCgOQ.js} +12 -11
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-ByAN3s-h.js +1494 -0
- package/dist/TransferTemplateView-C30bwI6y.js +1371 -0
- package/dist/{UnitView-DavK_R4W.js → UnitView-IUEnJvH0.js} +14 -14
- package/dist/{WarehouseView-DKH-C4Xd.js → WarehouseView-Bcwta2ui.js} +332 -314
- package/dist/api/inventory.d.ts +7 -6
- package/dist/api/purchase-order.d.ts +1 -0
- package/dist/{app-U7r2BqkX.js → app-BKrf9Qul.js} +27996 -28075
- package/dist/app.js +1 -1
- package/dist/components/FmAutocompleteTextField.vue.d.ts +31 -0
- package/dist/components/FmCustomAttribute.vue.d.ts +3 -8
- package/dist/components/FmLockableField.vue.d.ts +3 -0
- package/dist/components/FmMultiselectDialog.vue.d.ts +20 -3
- package/dist/components/FmMultiselectDialogProps.d.ts +2 -0
- package/dist/components/inventory-binding/InventoryBinding.vue.d.ts +1 -1
- package/dist/components/shell/inventory/binding-ui.vue.d.ts +1 -1
- package/dist/{decimal-8Rw9enBX.js → decimal-pm1D555G.js} +1 -1
- package/dist/feature-IIGwFZ6m.js +1005 -0
- package/dist/{format-unit-display-BOmYRTQF.js → format-unit-display-DAzCcqoK.js} +335 -328
- package/dist/helper/fuzzy.d.ts +10 -0
- package/dist/index-phCfzXTb.js +35546 -0
- package/dist/{stock-B0CPrhsD.js → stock-B9Im7AGF.js} +3 -3
- package/dist/stores/integration/netsuite.d.ts +5 -0
- package/dist/stores/inventory.d.ts +8 -8
- package/dist/stores/location.d.ts +100 -0
- package/dist/stores/warehouse.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/{supplier-B9AwIixA.js → supplier-D5z7EqEg.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/use-ingredient-select-dialog-QJXtuwbP.js +51 -0
- package/dist/{use-inventory-binding-dialog-yq2U1BWY.js → use-inventory-binding-dialog-DbK__hMV.js} +1 -1
- package/dist/views/adjustment-template/wastage-template/actions.d.ts +24 -0
- package/dist/views/adjustment-template/wastage-template/table.d.ts +24 -0
- package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +8 -4
- package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +48 -24
- package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.d.ts +1 -1
- package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +36 -12
- package/dist/views/closing-template/composables/use-closing-template-table.d.ts +36 -12
- package/dist/views/dev/components/AutocompleteTextField.vue.d.ts +2 -0
- package/dist/views/ingredient-group/composables/use-ingredient-group-table.d.ts +3 -3
- package/dist/views/ingredients/components/ingredient-form/IngredientForm.vue.d.ts +2 -2
- package/dist/views/ingredients/composables/use-ingredient-select-dialog.d.ts +16 -0
- package/dist/views/ingredients/composables/use-ingredient-table.d.ts +1 -1
- package/dist/views/receive-request/components/netsuite/NetSuiteProps.d.ts +2 -0
- package/dist/views/receive-request/components/transfer-details/TransferDetailsProps.d.ts +2 -0
- package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +25 -17
- package/dist/views/receive-request/components/transfer-form/components/ForecastStock.vue.d.ts +2 -2
- package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +1 -1
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +42 -26
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +38 -26
- package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +2 -2
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-template-enabled-locations-2.d.ts +8 -0
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-template-enabled-locations.d.ts +1 -0
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +1 -2
- package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +36 -12
- package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +36 -12
- package/dist/views/warehouse/components/WarehouseForm.vue.d.ts +2 -0
- package/dist/{vue-i18n-Bl7GJEHh.js → vue-i18n-sbiTSWWp.js} +79 -79
- package/package.json +5 -5
- package/dist/ApprovalView-XuMTVxgh.js +0 -138
- package/dist/ClosingTemplateView-CH7km5d2.js +0 -1819
- package/dist/FmCustomAttribute.vue_vue_type_script_setup_true_lang-7BeCefaL.js +0 -142
- package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Dcc6Iujf.js +0 -286
- package/dist/StockView-CJy2REMR.js +0 -1817
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-DA3f4VAd.js +0 -1327
- package/dist/TransferTemplateView-CRZXRX63.js +0 -1284
- package/dist/index-C2OSKtid.js +0 -29202
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
import { defineComponent as g, openBlock as a, createElementBlock as i, createElementVNode as m, toDisplayString as u, unref as h, Fragment as C, renderList as N, computed as v, resolveComponent as V, createVNode as S, createCommentVNode as w, h as B } from "vue";
|
|
2
|
-
import { j as b, K as F, f as $ } from "./app-U7r2BqkX.js";
|
|
3
|
-
import { useI18n as k, useCoreStore as I } from "@feedmepos/mf-common";
|
|
4
|
-
import { components as O } from "@feedmepos/ui-library";
|
|
5
|
-
const T = { class: "flex flex-col" }, j = { class: "flex flex-row fm-typo-en-body-md-600 bg-fm-color-neutral-gray-100 text-fm-color-typo-secondary h-48 items-center" }, z = { class: "flex-1 py-8 px-16" }, D = {
|
|
6
|
-
class: "flex-0 py-8 px-16",
|
|
7
|
-
style: { "flex-basis": "120px" }
|
|
8
|
-
}, E = { class: "flex-1 py-8 px-16" }, K = {
|
|
9
|
-
key: 0,
|
|
10
|
-
class: "flex-0 py-8 px-16",
|
|
11
|
-
style: { "flex-basis": "120px" }
|
|
12
|
-
}, M = {
|
|
13
|
-
key: 1,
|
|
14
|
-
class: "flex-0 py-8 px-16",
|
|
15
|
-
style: { "flex-basis": "120px" }
|
|
16
|
-
}, G = /* @__PURE__ */ g({
|
|
17
|
-
__name: "IngredientBindedItem",
|
|
18
|
-
props: {
|
|
19
|
-
name: {},
|
|
20
|
-
bindings: {}
|
|
21
|
-
},
|
|
22
|
-
setup(_) {
|
|
23
|
-
const { t: p } = k();
|
|
24
|
-
function l(o, c) {
|
|
25
|
-
var n;
|
|
26
|
-
if (o.measurement) {
|
|
27
|
-
const d = F(o.amount, o.measurement.conversion);
|
|
28
|
-
return `${b(d, !1)} ${(n = o.measurement) == null ? void 0 : n.abbrev}`;
|
|
29
|
-
}
|
|
30
|
-
return `${b(o.amount, !1)} ${c.abbrev}`;
|
|
31
|
-
}
|
|
32
|
-
function f(o) {
|
|
33
|
-
return o.unit !== void 0;
|
|
34
|
-
}
|
|
35
|
-
return (o, c) => (a(), i("div", T, [
|
|
36
|
-
m("div", j, [
|
|
37
|
-
m("div", z, u(o.name), 1),
|
|
38
|
-
m("div", D, u(h(p)("inventory.ingredient.bindedItems.amount")), 1)
|
|
39
|
-
]),
|
|
40
|
-
(a(!0), i(C, null, N(o.bindings, (n) => (a(), i("div", {
|
|
41
|
-
key: n.id,
|
|
42
|
-
class: "flex flex-row fm-typo-en-body-md-400 h-48 items-center border-b border-b-fm-color-neutral-gray-100"
|
|
43
|
-
}, [
|
|
44
|
-
m("div", E, u(n.name), 1),
|
|
45
|
-
f(n) ? (a(), i("div", K, u(l(n, n.unit)), 1)) : (a(), i("div", M, u(h(b)(n.amount, !1)), 1))
|
|
46
|
-
]))), 128))
|
|
47
|
-
]));
|
|
48
|
-
}
|
|
49
|
-
}), U = {
|
|
50
|
-
key: 0,
|
|
51
|
-
class: "flex flex-col gap-16"
|
|
52
|
-
}, H = /* @__PURE__ */ g({
|
|
53
|
-
__name: "FmCustomAttribute",
|
|
54
|
-
props: {
|
|
55
|
-
entity: {},
|
|
56
|
-
modelValue: {},
|
|
57
|
-
valueOptions: {}
|
|
58
|
-
},
|
|
59
|
-
emits: ["update:modelValue"],
|
|
60
|
-
setup(_, { emit: p }) {
|
|
61
|
-
const l = _, f = p, { t: o } = k(), c = I();
|
|
62
|
-
function n(s) {
|
|
63
|
-
var e, t;
|
|
64
|
-
if ((t = (e = l.valueOptions) == null ? void 0 : e[s]) != null && t.length)
|
|
65
|
-
return l.valueOptions[s];
|
|
66
|
-
}
|
|
67
|
-
const d = v(() => {
|
|
68
|
-
const s = /* @__PURE__ */ new Set(["671005de24a7f4001c87e25e"]), e = c.currentBusiness.value;
|
|
69
|
-
return e ? s.has(e._id) ? [
|
|
70
|
-
{
|
|
71
|
-
key: "tag",
|
|
72
|
-
type: "string",
|
|
73
|
-
entity: "inventorySku"
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
key: "tag",
|
|
77
|
-
type: "string",
|
|
78
|
-
entity: "inventoryRecipe"
|
|
79
|
-
}
|
|
80
|
-
].filter((r) => r.entity === l.entity) : [] : [];
|
|
81
|
-
}), y = v(() => d.value.map((s) => {
|
|
82
|
-
var t;
|
|
83
|
-
const e = n(s.key);
|
|
84
|
-
return {
|
|
85
|
-
key: s.key,
|
|
86
|
-
type: s.type,
|
|
87
|
-
value: ((t = l.modelValue) == null ? void 0 : t[s.key]) || "",
|
|
88
|
-
options: e
|
|
89
|
-
};
|
|
90
|
-
}) || []), A = [
|
|
91
|
-
{
|
|
92
|
-
header: () => o("portalshell.customAttributes.form.key"),
|
|
93
|
-
accessorKey: "key",
|
|
94
|
-
enableSorting: !1
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
header: () => o("portalshell.customAttributes.form.value"),
|
|
98
|
-
accessorKey: "value",
|
|
99
|
-
enableSorting: !1,
|
|
100
|
-
cell: (s) => {
|
|
101
|
-
const e = s.row.original;
|
|
102
|
-
return B(O.FmTextField, {
|
|
103
|
-
modelValue: e.value,
|
|
104
|
-
placeholder: o("portalshell.customAttributes.form.valuePlaceholder"),
|
|
105
|
-
datalist: e.options,
|
|
106
|
-
rules: [
|
|
107
|
-
(t) => e.type === "number" && isNaN(Number(t)) ? o("portalshell.customAttributes.form.attributeValueMustBeNumber") : !0
|
|
108
|
-
],
|
|
109
|
-
"onUpdate:modelValue": (t) => {
|
|
110
|
-
const r = $(l.modelValue);
|
|
111
|
-
if (r[e.key] = t == null ? void 0 : t.trim(), e.type === "number") {
|
|
112
|
-
if (isNaN(Number(t)))
|
|
113
|
-
return;
|
|
114
|
-
r[e.key] = Number(t);
|
|
115
|
-
}
|
|
116
|
-
Object.keys(r).forEach((x) => {
|
|
117
|
-
r[x] || delete r[x];
|
|
118
|
-
}), f("update:modelValue", r);
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
];
|
|
124
|
-
return (s, e) => {
|
|
125
|
-
const t = V("FmTable");
|
|
126
|
-
return y.value.length ? (a(), i("div", U, [
|
|
127
|
-
e[0] || (e[0] = m("div", { class: "fm-typo-en-title-sm-600" }, "Custom attributes", -1)),
|
|
128
|
-
S(t, {
|
|
129
|
-
"column-defs": A,
|
|
130
|
-
"row-data": y.value,
|
|
131
|
-
"shrink-at": !1,
|
|
132
|
-
"page-size": y.value.length,
|
|
133
|
-
"hide-footer": ""
|
|
134
|
-
}, null, 8, ["row-data", "page-size"])
|
|
135
|
-
])) : w("", !0);
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
export {
|
|
140
|
-
G as _,
|
|
141
|
-
H as a
|
|
142
|
-
};
|
|
@@ -1,286 +0,0 @@
|
|
|
1
|
-
import { j as L, t as I, ao as x, u as R, at as B, aD as H, aE as M } from "./app-U7r2BqkX.js";
|
|
2
|
-
import { u as j } from "./supplier-B9AwIixA.js";
|
|
3
|
-
import { P as S } from "./format-unit-display-BOmYRTQF.js";
|
|
4
|
-
import { computed as y, defineComponent as W, mergeModels as $, useModel as J, ref as K, resolveComponent as U, openBlock as F, createElementBlock as A, normalizeStyle as Q, createElementVNode as D, createVNode as X, withCtx as Y, createBlock as V, createCommentVNode as E, Fragment as Z, renderList as z, unref as w } from "vue";
|
|
5
|
-
function G(a, o, e) {
|
|
6
|
-
var s;
|
|
7
|
-
if (!!o.measurement === !!e && ((s = o.measurement) == null ? void 0 : s.id) === e)
|
|
8
|
-
return o;
|
|
9
|
-
if (!e)
|
|
10
|
-
return {
|
|
11
|
-
costPerUnit: o.costPerUnit
|
|
12
|
-
};
|
|
13
|
-
const i = a.measurements.find((r) => r.id === e);
|
|
14
|
-
return i ? {
|
|
15
|
-
costPerUnit: o.costPerUnit,
|
|
16
|
-
measurement: i
|
|
17
|
-
} : {
|
|
18
|
-
costPerUnit: o.costPerUnit
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
function oe(a, o, e, n) {
|
|
22
|
-
var P, g, c;
|
|
23
|
-
if (n != null && n.manualTotalCost)
|
|
24
|
-
return n == null ? void 0 : n.manualTotalCost;
|
|
25
|
-
const t = (c = (g = (P = n == null ? void 0 : n.supplier) == null ? void 0 : P.supplyItems) == null ? void 0 : g.find(
|
|
26
|
-
(l) => l.skuId === a._id
|
|
27
|
-
)) == null ? void 0 : c.defaultCost, i = a.defaultCost ? G(a.unit, a.defaultCost, a.trackingMeasurement) : void 0, s = t ?? i, r = s == null ? void 0 : s.costPerUnit, u = r ? s != null && s.measurement ? +L(r) / +L(s == null ? void 0 : s.measurement.conversion) : +L(r) : void 0, p = u ? e ? u * +L(e.conversion) : u : void 0, v = p ? +L(o) * p : void 0;
|
|
28
|
-
return v ? {
|
|
29
|
-
...I(v ?? 0, 2),
|
|
30
|
-
currency: x()
|
|
31
|
-
} : {
|
|
32
|
-
amount: 0,
|
|
33
|
-
precision: 0,
|
|
34
|
-
currency: x()
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
function T(a) {
|
|
38
|
-
return H.parse(a);
|
|
39
|
-
}
|
|
40
|
-
function C(a) {
|
|
41
|
-
return {
|
|
42
|
-
_id: a.doc._id,
|
|
43
|
-
internal: a.type,
|
|
44
|
-
contactName: a.doc.profile.name,
|
|
45
|
-
name: a.doc.profile.name ?? "",
|
|
46
|
-
email: a.doc.profile.email,
|
|
47
|
-
phoneNumber: a.doc.profile.phoneNo,
|
|
48
|
-
registrationNumber: a.doc.profile.regNo,
|
|
49
|
-
address: a.doc.profile.address ?? {
|
|
50
|
-
line1: "",
|
|
51
|
-
state: "",
|
|
52
|
-
city: "",
|
|
53
|
-
postcode: "",
|
|
54
|
-
country: ""
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
function re(a, o, e = !1, n = !1) {
|
|
59
|
-
const t = j(), i = R();
|
|
60
|
-
i.watchLocation(async () => {
|
|
61
|
-
var b;
|
|
62
|
-
await t.readSuppliers();
|
|
63
|
-
const c = a();
|
|
64
|
-
if ((b = c.supplier) != null && b._id) return;
|
|
65
|
-
const l = n ? t.suppliers[0] : t.businessSuppliers[0], f = (e ? i.locations.filter((m) => m.doc._id !== i.currentLocation.doc._id) : i.locations)[0];
|
|
66
|
-
o({
|
|
67
|
-
...c,
|
|
68
|
-
supplier: l ? T(l) : f ? C(f) : c.supplier
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
const s = y(
|
|
72
|
-
() => {
|
|
73
|
-
var c, l;
|
|
74
|
-
return typeof ((l = (c = a()) == null ? void 0 : c.supplier) == null ? void 0 : l.internal) == "string" ? S.TRANSFER : S.PURCHASE;
|
|
75
|
-
}
|
|
76
|
-
), r = y({
|
|
77
|
-
get() {
|
|
78
|
-
var c, l;
|
|
79
|
-
return (l = (c = a()) == null ? void 0 : c.supplier) == null ? void 0 : l._id;
|
|
80
|
-
},
|
|
81
|
-
set(c) {
|
|
82
|
-
const l = a() ?? {};
|
|
83
|
-
if (s.value === S.PURCHASE) {
|
|
84
|
-
const _ = (n ? t.suppliers : t.businessSuppliers).find((N) => N._id === c);
|
|
85
|
-
o({
|
|
86
|
-
...l,
|
|
87
|
-
supplier: _ ? T(_) : l.supplier
|
|
88
|
-
});
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
const b = (e ? i.locations.filter((m) => m.doc._id !== i.currentLocation.doc._id) : i.locations).find((m) => m.doc._id === c);
|
|
92
|
-
o({
|
|
93
|
-
...l,
|
|
94
|
-
supplier: b ? C(b) : l.supplier
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
}), u = y(() => t.locationSuppliers.map(T)), p = y(() => t.businessSuppliers.map(T)), v = y(() => {
|
|
98
|
-
const c = [...u.value], l = [...p.value];
|
|
99
|
-
return n ? [...l, ...c] : l;
|
|
100
|
-
}), d = y(() => {
|
|
101
|
-
var h;
|
|
102
|
-
const c = ((h = i._currentLocation) == null ? void 0 : h.type) === B.warehouse;
|
|
103
|
-
return (e ? i.locations.filter((f) => f.doc._id !== i.currentLocation.doc._id) : i.locations).filter((f) => c || f.acceptRequest).map(C);
|
|
104
|
-
}), P = y(() => {
|
|
105
|
-
if (s.value === S.PURCHASE) {
|
|
106
|
-
const l = u.value.map((f) => ({
|
|
107
|
-
label: f.name,
|
|
108
|
-
value: f._id
|
|
109
|
-
})), h = p.value.map((f) => ({
|
|
110
|
-
label: f.name,
|
|
111
|
-
sublabel: "Business supplier",
|
|
112
|
-
value: f._id
|
|
113
|
-
}));
|
|
114
|
-
return n ? [...l, ...h] : h;
|
|
115
|
-
}
|
|
116
|
-
return d.value.map((l) => ({
|
|
117
|
-
label: l.name,
|
|
118
|
-
sublabel: l.internal ? `${l.internal}` : void 0,
|
|
119
|
-
value: l._id
|
|
120
|
-
}));
|
|
121
|
-
}), g = y(() => {
|
|
122
|
-
var f, b;
|
|
123
|
-
const c = (b = (f = a()) == null ? void 0 : f.supplier) == null ? void 0 : b._id;
|
|
124
|
-
if (s.value === S.PURCHASE) {
|
|
125
|
-
const m = t.suppliers.find((_) => _._id === c);
|
|
126
|
-
return m ? T(m) : null;
|
|
127
|
-
}
|
|
128
|
-
const h = i.locations.find((m) => m.doc._id);
|
|
129
|
-
return h ? C(h) : null;
|
|
130
|
-
});
|
|
131
|
-
return {
|
|
132
|
-
transferLocationModel: r,
|
|
133
|
-
transferLocationOptions: P,
|
|
134
|
-
locationOptionsTypePurchase: v,
|
|
135
|
-
locationOptionsTypePurchaseLocationLevel: u,
|
|
136
|
-
locationOptionsTypeTransfer: d,
|
|
137
|
-
selectedLocation: g
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
class O {
|
|
141
|
-
static getDescendantProperty(o, e, n = []) {
|
|
142
|
-
let t, i, s, r, u, p;
|
|
143
|
-
if (e) {
|
|
144
|
-
if (s = e.indexOf("."), s === -1 ? t = e : (t = e.slice(0, s), i = e.slice(s + 1)), r = o[t], r !== null && typeof r < "u")
|
|
145
|
-
if (!i && (typeof r == "string" || typeof r == "number"))
|
|
146
|
-
n.push(r);
|
|
147
|
-
else if (Object.prototype.toString.call(r) === "[object Array]")
|
|
148
|
-
for (u = 0, p = r.length; u < p; u++)
|
|
149
|
-
O.getDescendantProperty(r[u], i, n);
|
|
150
|
-
else i && O.getDescendantProperty(r, i, n);
|
|
151
|
-
} else
|
|
152
|
-
n.push(o);
|
|
153
|
-
return n;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
class k {
|
|
157
|
-
constructor(o = [], e = [], n = {}) {
|
|
158
|
-
Array.isArray(e) || (n = e, e = []), this.haystack = o, this.keys = e, this.options = Object.assign({
|
|
159
|
-
caseSensitive: !1,
|
|
160
|
-
sort: !1
|
|
161
|
-
}, n);
|
|
162
|
-
}
|
|
163
|
-
search(o = "") {
|
|
164
|
-
if (o === "")
|
|
165
|
-
return this.haystack;
|
|
166
|
-
const e = [];
|
|
167
|
-
for (let n = 0; n < this.haystack.length; n++) {
|
|
168
|
-
const t = this.haystack[n];
|
|
169
|
-
if (this.keys.length === 0) {
|
|
170
|
-
const i = k.isMatch(t, o, this.options.caseSensitive);
|
|
171
|
-
i && e.push({ item: t, score: i });
|
|
172
|
-
} else
|
|
173
|
-
for (let i = 0; i < this.keys.length; i++) {
|
|
174
|
-
const s = O.getDescendantProperty(t, this.keys[i]);
|
|
175
|
-
let r = !1;
|
|
176
|
-
for (let u = 0; u < s.length; u++) {
|
|
177
|
-
const p = k.isMatch(s[u], o, this.options.caseSensitive);
|
|
178
|
-
if (p) {
|
|
179
|
-
r = !0, e.push({ item: t, score: p });
|
|
180
|
-
break;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
if (r)
|
|
184
|
-
break;
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
return this.options.sort && e.sort((n, t) => n.score - t.score), e.map((n) => n.item);
|
|
188
|
-
}
|
|
189
|
-
static isMatch(o, e, n) {
|
|
190
|
-
o = String(o), e = String(e), n || (o = o.toLocaleLowerCase(), e = e.toLocaleLowerCase());
|
|
191
|
-
const t = k.nearestIndexesFor(o, e);
|
|
192
|
-
return t ? o === e ? 1 : t.length > 1 ? 2 + (t[t.length - 1] - t[0]) : 2 + t[0] : !1;
|
|
193
|
-
}
|
|
194
|
-
static nearestIndexesFor(o, e) {
|
|
195
|
-
const n = e.split("");
|
|
196
|
-
let t = [];
|
|
197
|
-
return k.indexesOfFirstLetter(o, e).forEach((s, r) => {
|
|
198
|
-
let u = s + 1;
|
|
199
|
-
t[r] = [s];
|
|
200
|
-
for (let p = 1; p < n.length; p++) {
|
|
201
|
-
const v = n[p];
|
|
202
|
-
if (u = o.indexOf(v, u), u === -1) {
|
|
203
|
-
t[r] = !1;
|
|
204
|
-
break;
|
|
205
|
-
}
|
|
206
|
-
t[r].push(u), u++;
|
|
207
|
-
}
|
|
208
|
-
}), t = t.filter((s) => s !== !1), t.length ? t.sort((s, r) => s.length === 1 ? s[0] - r[0] : (s = s[s.length - 1] - s[0], r = r[r.length - 1] - r[0], s - r))[0] : !1;
|
|
209
|
-
}
|
|
210
|
-
static indexesOfFirstLetter(o, e) {
|
|
211
|
-
const n = e[0];
|
|
212
|
-
return o.split("").map((t, i) => t !== n ? !1 : i).filter((t) => t !== !1);
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
const q = { class: "overflow-y-auto h-full pb-8" }, ie = /* @__PURE__ */ W({
|
|
216
|
-
__name: "FmFilterableMenuOptions",
|
|
217
|
-
props: /* @__PURE__ */ $({
|
|
218
|
-
modelValue: {},
|
|
219
|
-
maxHeight: {},
|
|
220
|
-
width: {},
|
|
221
|
-
handleItemChange: { type: Function },
|
|
222
|
-
items: {},
|
|
223
|
-
options: {}
|
|
224
|
-
}, {
|
|
225
|
-
search: {},
|
|
226
|
-
searchModifiers: {}
|
|
227
|
-
}),
|
|
228
|
-
emits: ["update:search"],
|
|
229
|
-
setup(a) {
|
|
230
|
-
const o = a, e = J(a, "search"), n = y(
|
|
231
|
-
() => new k(o.items, ["label", "sublabel"], o.options)
|
|
232
|
-
), t = y(() => n.value.search(e.value)), i = K();
|
|
233
|
-
return console.log({ stickyRef: i }), (s, r) => {
|
|
234
|
-
const u = U("FmButton"), p = U("FmTextField"), v = U("FmMenuItem");
|
|
235
|
-
return F(), A("div", {
|
|
236
|
-
class: "relative",
|
|
237
|
-
style: Q({ width: s.width })
|
|
238
|
-
}, [
|
|
239
|
-
D("div", {
|
|
240
|
-
class: "sticky top-0 bg-white mb-8",
|
|
241
|
-
ref_key: "stickyRef",
|
|
242
|
-
ref: i
|
|
243
|
-
}, [
|
|
244
|
-
X(p, {
|
|
245
|
-
modelValue: e.value,
|
|
246
|
-
"onUpdate:modelValue": r[1] || (r[1] = (d) => e.value = d),
|
|
247
|
-
placeholder: "Filter options"
|
|
248
|
-
}, {
|
|
249
|
-
append: Y(() => [
|
|
250
|
-
e.value ? (F(), V(u, {
|
|
251
|
-
key: 0,
|
|
252
|
-
variant: "tertiary",
|
|
253
|
-
"prepend-icon": "close",
|
|
254
|
-
onClick: r[0] || (r[0] = (d) => e.value = "")
|
|
255
|
-
})) : E("", !0)
|
|
256
|
-
]),
|
|
257
|
-
_: 1
|
|
258
|
-
}, 8, ["modelValue"])
|
|
259
|
-
], 512),
|
|
260
|
-
D("div", q, [
|
|
261
|
-
(F(!0), A(Z, null, z(t.value, (d, P) => (F(), V(v, {
|
|
262
|
-
key: P,
|
|
263
|
-
label: d.label,
|
|
264
|
-
sublabel: d.sublabel,
|
|
265
|
-
"model-value": w(M)(s.modelValue, d.value),
|
|
266
|
-
onClick: () => s.handleItemChange(w(M)(s.modelValue, d.value), d),
|
|
267
|
-
onVnodeMounted: (g) => {
|
|
268
|
-
var c, l;
|
|
269
|
-
return w(M)(s.modelValue, d.value) && ((c = g.el) == null || c.scrollIntoView({ behavior: "instant", block: "end" }), (l = g.el) == null || l.scrollIntoView({ behavior: "smooth", block: "center" })), void 0;
|
|
270
|
-
}
|
|
271
|
-
}, null, 8, ["label", "sublabel", "model-value", "onClick", "onVnodeMounted"]))), 128)),
|
|
272
|
-
t.value.length ? E("", !0) : (F(), V(v, {
|
|
273
|
-
key: 0,
|
|
274
|
-
disabled: "",
|
|
275
|
-
label: "No options available"
|
|
276
|
-
}))
|
|
277
|
-
])
|
|
278
|
-
], 4);
|
|
279
|
-
};
|
|
280
|
-
}
|
|
281
|
-
});
|
|
282
|
-
export {
|
|
283
|
-
ie as _,
|
|
284
|
-
oe as c,
|
|
285
|
-
re as u
|
|
286
|
-
};
|