@feedmepos/mf-inventory-portal 0.0.24-dev.3 → 0.0.24-prod.10
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-C8gm6x7Q.js → App-JjB1Wrpi.js} +2 -2
- package/dist/ApprovalView-Djr4fE-Y.js +140 -0
- package/dist/{BindingsDialog-II1cNZ8y.js → BindingsDialog-D05z9qe3.js} +9 -9
- package/dist/{BindingsPicker-7hWtLm42.js → BindingsPicker-BGZ4RdQQ.js} +13 -13
- package/dist/BindingsTable-RYiAJkDa.js +120 -0
- package/dist/ClosingDraftView-BR9jDEWV.js +1255 -0
- package/dist/{ClosingTemplateView-cmdRLrA3.js → ClosingTemplateView-MFwTFXba.js} +478 -493
- package/dist/{FmCustomAttribute.vue_vue_type_script_setup_true_lang-Dk618cmq.js → FmCustomAttribute.vue_vue_type_script_setup_true_lang-y4nlK0EZ.js} +11 -11
- package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BavH11lZ.js +211 -0
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BcQSDPWo.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DomVe2ts.js} +14 -14
- package/dist/{IngredientGroupView-YGl-cE0p.js → IngredientGroupView-BmuRTuzO.js} +2 -2
- package/dist/{IngredientsView-XxrOFv-u.js → IngredientsView-ZKDk5eqa.js} +393 -383
- package/dist/{IntegrationView-Bq-m4-Wh.js → IntegrationView-B24FlD2W.js} +660 -623
- package/dist/{InventoryBindingForm-DFWSf75X.js → InventoryBindingForm-CeaDoRhy.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-RQ6XxdxU.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-Cu5ditXD.js} +16 -16
- package/dist/{InventoryBindingSummary-DU6GO2TJ.js → InventoryBindingSummary-7kS3wtck.js} +3 -3
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-ChpZ0NwL.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-D6hT0x7p.js} +6 -6
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-Ba2Uq1H-.js → PremiumBadge.vue_vue_type_script_setup_true_lang-NIiwyJ0t.js} +3 -3
- package/dist/{PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js → PreviewBadge.vue_vue_type_script_setup_true_lang-DX2MJqL4.js} +2 -2
- package/dist/{PublishView-CBIvo-Qj.js → PublishView-I99IYucw.js} +5 -5
- package/dist/{PurchaseOrderPrintPreview-cp_DzuxM.js → PurchaseOrderPrintPreview-D5KmYxfZ.js} +8 -8
- package/dist/{ReceiveRequestView-UIaPylF0.js → ReceiveRequestView-DcCJcf9k.js} +581 -576
- package/dist/{RecipeView-voWc35VV.js → RecipeView--qdj5S0i.js} +26 -26
- package/dist/{StockForecast.vue_vue_type_style_index_0_lang-KLXSWvo5.js → StockForecast.vue_vue_type_style_index_0_lang-mEsX3B1X.js} +3 -3
- package/dist/{StockView-CoigRqM-.js → StockView-DWeusRmm.js} +11 -12
- package/dist/{SupplierView-BDpCPZE7.js → SupplierView-DbuTcLpR.js} +812 -2362
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-CdiuANPU.js +1500 -0
- package/dist/{TransferTemplateView-C2XMghN_.js → TransferTemplateView-FAYleqi8.js} +445 -460
- package/dist/{UnitView-BBPJ0vhB.js → UnitView-J4_lMLAr.js} +7 -7
- package/dist/{WarehouseView-Ck6hBrGf.js → WarehouseView-D0Qbxe8l.js} +2 -2
- package/dist/api/bill.d.ts +8 -0
- package/dist/api/closing-draft.d.ts +1 -0
- package/dist/api/purchase-order.d.ts +1 -0
- package/dist/{app-ojZQI-KQ.js → app-liYoREqu.js} +23158 -22139
- package/dist/app.d.ts +0 -6
- package/dist/app.js +1 -1
- package/dist/components/FmCustomAttribute2.vue.d.ts +18 -0
- package/dist/components/FmLockableField.vue.d.ts +3 -0
- package/dist/components/FmMultiselectDialog.d.ts +23 -0
- package/dist/components/FmMultiselectDialog.vue.d.ts +20 -3
- package/dist/components/FmMultiselectDialogProps.d.ts +2 -0
- package/dist/{decimal-xq82Pirk.js → decimal-BvYSawzw.js} +1 -1
- package/dist/{format-unit-display-ByfsyWBU.js → format-unit-display-UWtRo64X.js} +275 -273
- package/dist/helper/fuzzy.d.ts +10 -0
- package/dist/index-Bgr580L2.js +10545 -0
- package/dist/{is-linked-ingredient-error-fJ2TJb3z.js → is-linked-ingredient-error-C5KlE2db.js} +3 -3
- package/dist/layout/SingleColumnLayout.vue.d.ts +1 -1
- package/dist/normalizeArguments-DbhYFixO.js +1564 -0
- package/dist/{stock-CC4RqQaB.js → stock-BtrmGYVV.js} +6 -6
- package/dist/stores/feature.d.ts +0 -1
- package/dist/stores/integration/netsuite.d.ts +5 -0
- package/dist/stores/location.d.ts +91 -0
- package/dist/stores/supplier.d.ts +2 -2
- package/dist/stores/warehouse.d.ts +4 -7
- package/dist/style.css +1 -1
- package/dist/{supplier-DLXOOcIm.js → supplier-6M9tlKYa.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/use-ingredient-select-dialog-B2zDE5zA.js +52 -0
- package/dist/{use-inventory-binding-dialog-B1zBTsW9.js → use-inventory-binding-dialog-BdF8pqXk.js} +1 -1
- package/dist/views/adjustment-template/wastage-template/actions.d.ts +2 -2
- package/dist/views/adjustment-template/wastage-template/table.d.ts +2 -2
- package/dist/views/closing-draft/composables/use-closing-draft-actions.d.ts +6 -3
- package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +2 -2
- package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +2 -2
- package/dist/views/closing-template/composables/use-closing-template-table.d.ts +2 -2
- package/dist/views/ingredient-group/composables/use-ingredient-group-actions.d.ts +2 -2
- package/dist/views/ingredient-group/composables/use-ingredient-group-table.d.ts +2 -2
- package/dist/views/ingredients/composables/use-ingredient-form.d.ts +2 -2
- package/dist/views/ingredients/composables/use-ingredient-select-dialog.d.ts +16 -0
- 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 +8 -8
- 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 +18 -14
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +14 -14
- package/dist/views/recipe/composables/use-recipe-form.d.ts +2 -2
- package/dist/views/stock/components/StockRecordCard.vue.d.ts +4 -0
- package/dist/views/stock/composables/use-stock-action.d.ts +2 -2
- package/dist/views/supplier/composables/use-supplier-actions.d.ts +2 -2
- 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 +14 -14
- package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +14 -14
- package/dist/views/unit/composables/use-unit-form.d.ts +2 -2
- package/dist/views/warehouse/components/WarehouseForm.vue.d.ts +8 -14
- package/dist/vue-i18n-BPWoCoYN.js +2351 -0
- package/package.json +5 -5
- package/dist/ApprovalView-xtUG5yeg.js +0 -138
- package/dist/BindingsTable-Bub-L-pM.js +0 -145
- package/dist/ClosingDraftView-C9VKku7E.js +0 -1225
- package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BSB7T16f.js +0 -286
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-CyovzdZg.js +0 -1327
- package/dist/index-Bi6FnWGy.js +0 -29202
- package/dist/index-CKEbjSig.js +0 -6034
- package/dist/vue-i18n-AeCKtYb7.js +0 -2365
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ref as x, onUnmounted as F, defineComponent as h, watch as P, onMounted as U, computed as g, resolveComponent as b, openBlock as S,
|
|
2
|
-
import { u as k, a as D, b as H,
|
|
1
|
+
import { ref as x, onUnmounted as F, defineComponent as h, watch as P, onMounted as U, computed as g, resolveComponent as b, createElementBlock as I, openBlock as S, createBlock as G, createCommentVNode as M, unref as v, createVNode as _, createElementVNode as p, toDisplayString as w } from "vue";
|
|
2
|
+
import { u as k, a as D, b as H, c as B, R as e, g as s, d as W } from "./app-liYoREqu.js";
|
|
3
3
|
import { useCoreStore as A, useI18n as O } from "@feedmepos/mf-common";
|
|
4
4
|
import { useRouter as C, useRoute as K } from "vue-router";
|
|
5
5
|
import { u as $ } from "./useTabStorage-BkIVScW_.js";
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { defineComponent as oe, ref as g, watch as re, computed as b, resolveComponent as ne, createBlock as K, openBlock as x, unref as e, withCtx as y, createElementVNode as s, normalizeClass as se, createVNode as n, normalizeStyle as le, createElementBlock as ce, createCommentVNode as ie, toDisplayString as ue, Teleport as pe, mergeProps as me } from "vue";
|
|
2
|
+
import { u as de, av as _, aG as fe, a8 as Q, z as _e, _ as ve, B as he, E as De, G as v } from "./app-liYoREqu.js";
|
|
3
|
+
import { a as ge, P as O, b as be, _ as xe } from "./TransferDetails.vue_vue_type_script_setup_true_lang-CdiuANPU.js";
|
|
4
|
+
import { useBreakpoints as ye } from "@feedmepos/ui-library";
|
|
5
|
+
import { useI18n as Oe } from "@feedmepos/mf-common";
|
|
6
|
+
const Re = { class: "flex flex-col py-8" }, we = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Pe = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, ke = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1" }, Se = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1"
|
|
9
|
+
}, Ce = { class: "pt-8" }, $e = /* @__PURE__ */ oe({
|
|
10
|
+
__name: "ApprovalView",
|
|
11
|
+
setup(Te) {
|
|
12
|
+
const o = ge(O.APPROVAL), { columnDefs: W } = be(O.APPROVAL, o), X = de();
|
|
13
|
+
_.object({
|
|
14
|
+
name: _.string().optional().nullable(),
|
|
15
|
+
start: _.date().optional().nullable(),
|
|
16
|
+
end: _.date().optional().nullable()
|
|
17
|
+
});
|
|
18
|
+
const R = g({
|
|
19
|
+
name: "",
|
|
20
|
+
...fe()
|
|
21
|
+
}), a = g({
|
|
22
|
+
startDate: Q(R.value.start ?? /* @__PURE__ */ new Date()),
|
|
23
|
+
endDate: Q(R.value.end ?? /* @__PURE__ */ new Date())
|
|
24
|
+
});
|
|
25
|
+
re([() => a.value.startDate], () => {
|
|
26
|
+
if (!a.value.startDate)
|
|
27
|
+
return;
|
|
28
|
+
if (!a.value.endDate) {
|
|
29
|
+
a.value.endDate = a.value.startDate;
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const c = new Date(a.value.startDate);
|
|
33
|
+
if (new Date(a.value.endDate).getTime() < c.getTime()) {
|
|
34
|
+
a.value.endDate = a.value.startDate;
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
const h = g(""), { breakpoints: w } = ye(), D = b(() => w.value.xs || w.value.sm), Z = b(() => D.value ? 10 : 20), B = _e(), { t: P } = Oe(), I = b(() => [
|
|
39
|
+
{
|
|
40
|
+
label: P("common.refresh"),
|
|
41
|
+
value: "refresh"
|
|
42
|
+
}
|
|
43
|
+
]);
|
|
44
|
+
function ee(c) {
|
|
45
|
+
switch (c) {
|
|
46
|
+
case "refresh":
|
|
47
|
+
return o.fetchData();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return (c, l) => {
|
|
51
|
+
const te = ne("FmTable");
|
|
52
|
+
return x(), K(ve, {
|
|
53
|
+
title: e(P)("inventory.transfer.approval.title"),
|
|
54
|
+
actions: I.value,
|
|
55
|
+
"onClick:action": ee
|
|
56
|
+
}, {
|
|
57
|
+
default: y(() => [
|
|
58
|
+
s("div", {
|
|
59
|
+
class: se([
|
|
60
|
+
"flex flex-col gap-8 max-h-full",
|
|
61
|
+
{
|
|
62
|
+
"p-0": D.value,
|
|
63
|
+
"px-24 ": !D.value
|
|
64
|
+
}
|
|
65
|
+
])
|
|
66
|
+
}, [
|
|
67
|
+
n(he, {
|
|
68
|
+
searchable: "",
|
|
69
|
+
"change-location": "",
|
|
70
|
+
search: h.value,
|
|
71
|
+
"onUpdate:search": l[0] || (l[0] = (r) => h.value = r)
|
|
72
|
+
}, null, 8, ["search"]),
|
|
73
|
+
n(te, {
|
|
74
|
+
style: le(e(B).tableHeight),
|
|
75
|
+
"column-defs": e(W),
|
|
76
|
+
"row-data": e(o).purchaseRequests.value,
|
|
77
|
+
"search-value": h.value,
|
|
78
|
+
loading: !e(X)._currentLocation || e(o).loading.value,
|
|
79
|
+
onRowClick: l[1] || (l[1] = (r) => e(o).promptShowTransferDetails(r.original.purchaseOrder, r.original)),
|
|
80
|
+
"page-size": Z.value
|
|
81
|
+
}, {
|
|
82
|
+
"list-row": y((r) => [
|
|
83
|
+
n(De, {
|
|
84
|
+
row: r,
|
|
85
|
+
onRowClick: (t) => e(o).promptShowTransferDetails(t.purchaseOrder, t)
|
|
86
|
+
}, {
|
|
87
|
+
default: y((t) => {
|
|
88
|
+
var k, S, C, i, T, A, V, z, u, L, M, p, $, m, E, F, Y, q, N, d, j, G, H, U, f, J;
|
|
89
|
+
return [
|
|
90
|
+
s("div", Re, [
|
|
91
|
+
s("div", we, [
|
|
92
|
+
n(e(v), {
|
|
93
|
+
render: (C = (S = (k = t.purchaseOrder__id) == null ? void 0 : k.column) == null ? void 0 : S.columnDef) == null ? void 0 : C.cell,
|
|
94
|
+
props: (T = (i = t.purchaseOrder__id) == null ? void 0 : i.getContext) == null ? void 0 : T.call(i)
|
|
95
|
+
}, null, 8, ["render", "props"])
|
|
96
|
+
]),
|
|
97
|
+
s("div", Pe, [
|
|
98
|
+
n(e(v), {
|
|
99
|
+
render: (z = (V = (A = t.to_name) == null ? void 0 : A.column) == null ? void 0 : V.columnDef) == null ? void 0 : z.cell,
|
|
100
|
+
props: (L = (u = t.to_name) == null ? void 0 : u.getContext) == null ? void 0 : L.call(u)
|
|
101
|
+
}, null, 8, ["render", "props"])
|
|
102
|
+
]),
|
|
103
|
+
s("div", ke, ue((E = (m = ($ = (p = (M = r.original.purchaseOrder) == null ? void 0 : M.items) == null ? void 0 : p.map) == null ? void 0 : $.call(p, (ae) => `${ae.name}`)) == null ? void 0 : m.join) == null ? void 0 : E.call(m, ", ")), 1),
|
|
104
|
+
(F = r.original.purchaseOrder) != null && F.ref ? (x(), ce("div", Se, [
|
|
105
|
+
n(e(v), {
|
|
106
|
+
render: (N = (q = (Y = t.purchaseOrder_ref) == null ? void 0 : Y.column) == null ? void 0 : q.columnDef) == null ? void 0 : N.cell,
|
|
107
|
+
props: (j = (d = t.purchaseOrder_ref) == null ? void 0 : d.getContext) == null ? void 0 : j.call(d)
|
|
108
|
+
}, null, 8, ["render", "props"])
|
|
109
|
+
])) : ie("", !0),
|
|
110
|
+
s("div", Ce, [
|
|
111
|
+
n(e(v), {
|
|
112
|
+
render: (U = (H = (G = t.purchaseOrder_status) == null ? void 0 : G.column) == null ? void 0 : H.columnDef) == null ? void 0 : U.cell,
|
|
113
|
+
props: (J = (f = t.purchaseOrder_status) == null ? void 0 : f.getContext) == null ? void 0 : J.call(f)
|
|
114
|
+
}, null, 8, ["render", "props"])
|
|
115
|
+
])
|
|
116
|
+
])
|
|
117
|
+
];
|
|
118
|
+
}),
|
|
119
|
+
_: 2
|
|
120
|
+
}, 1032, ["row", "onRowClick"])
|
|
121
|
+
]),
|
|
122
|
+
_: 1
|
|
123
|
+
}, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"])
|
|
124
|
+
], 2),
|
|
125
|
+
(x(), K(pe, { to: "body" }, [
|
|
126
|
+
n(xe, me({
|
|
127
|
+
scope: e(O).APPROVAL
|
|
128
|
+
}, e(o).transferDetailsProps.value, {
|
|
129
|
+
onSubmitted: e(o).fetchData
|
|
130
|
+
}), null, 16, ["scope", "onSubmitted"])
|
|
131
|
+
]))
|
|
132
|
+
]),
|
|
133
|
+
_: 1
|
|
134
|
+
}, 8, ["title", "actions"]);
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
export {
|
|
139
|
+
$e as default
|
|
140
|
+
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { _ as
|
|
3
|
-
import { a as
|
|
1
|
+
import { defineComponent as w, ref as o, onMounted as C, onUnmounted as F, watch as x, resolveComponent as l, createElementBlock as c, openBlock as i, createBlock as I, withCtx as R, createVNode as a, createCommentVNode as z, createElementVNode as P } from "vue";
|
|
2
|
+
import { _ as V } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-Cu5ditXD.js";
|
|
3
|
+
import { a as L, aM as S } from "./app-liYoREqu.js";
|
|
4
4
|
const U = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "flex justify-end gap-8 items-center"
|
|
7
7
|
}, E = {
|
|
8
8
|
key: 1,
|
|
9
9
|
class: "p-24 flex items-center justify-center gap-16"
|
|
10
|
-
}, D = /* @__PURE__ */
|
|
10
|
+
}, D = /* @__PURE__ */ w({
|
|
11
11
|
__name: "BindingsDialog",
|
|
12
12
|
setup(N) {
|
|
13
|
-
const p =
|
|
13
|
+
const p = L(), d = o(!0), s = o(new Array()), u = o(), t = S(y);
|
|
14
14
|
async function y() {
|
|
15
15
|
await p.readInventory(), u.value = t.onMessage("props:inventory-bindings", (e) => {
|
|
16
16
|
d.value = !1, s.value = e;
|
|
@@ -29,7 +29,7 @@ const U = {
|
|
|
29
29
|
t.sendMessage("@click:pick-inventory-bindings", e);
|
|
30
30
|
}
|
|
31
31
|
const m = o(), r = o(!0);
|
|
32
|
-
|
|
32
|
+
C(() => {
|
|
33
33
|
v();
|
|
34
34
|
const e = m.value;
|
|
35
35
|
e && new ResizeObserver(() => {
|
|
@@ -55,7 +55,7 @@ const U = {
|
|
|
55
55
|
}, [
|
|
56
56
|
d.value ? (i(), c("div", E, [
|
|
57
57
|
a(h, { size: "md" }),
|
|
58
|
-
n[2] || (n[2] =
|
|
58
|
+
n[2] || (n[2] = P("div", null, "Loading bindings dialog...", -1))
|
|
59
59
|
])) : (i(), I(B, {
|
|
60
60
|
key: 0,
|
|
61
61
|
onValidationSuccess: n[1] || (n[1] = () => r.value ? void 0 : b()),
|
|
@@ -64,9 +64,9 @@ const U = {
|
|
|
64
64
|
class: "flex flex-col gap-16"
|
|
65
65
|
}, {
|
|
66
66
|
default: R(() => [
|
|
67
|
-
a(
|
|
67
|
+
a(V, {
|
|
68
68
|
"model-value": s.value,
|
|
69
|
-
"onUpdate:modelValue": n[0] || (n[0] = (
|
|
69
|
+
"onUpdate:modelValue": n[0] || (n[0] = (M) => s.value = M),
|
|
70
70
|
"iframe-mode": "",
|
|
71
71
|
"onClick:pickInventoryBindings": k
|
|
72
72
|
}, null, 8, ["model-value"]),
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { a as
|
|
1
|
+
import { defineComponent as R, computed as r, ref as l, onMounted as S, onUnmounted as U, resolveComponent as E, createElementBlock as p, openBlock as f, createVNode as u, createElementVNode as k } from "vue";
|
|
2
|
+
import { a as V, aM as x, J as z } from "./app-liYoREqu.js";
|
|
3
3
|
const F = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "flex flex-col gap-16"
|
|
6
6
|
}, K = { class: "flex justify-end gap-8 items-center" }, w = {
|
|
7
7
|
key: 1,
|
|
8
8
|
class: "p-24 flex items-center justify-center gap-16"
|
|
9
|
-
}, N = /* @__PURE__ */
|
|
9
|
+
}, N = /* @__PURE__ */ R({
|
|
10
10
|
__name: "BindingsPicker",
|
|
11
11
|
setup(L) {
|
|
12
|
-
const d =
|
|
12
|
+
const d = V(), C = r(() => d.recipes), I = r(() => d.skus), g = l(!0), i = l(new Array()), a = l("RECIPE"), c = r(() => a.value === "SKU" ? I.value.map((s) => ({
|
|
13
13
|
label: s.name,
|
|
14
14
|
sublabel: s.code,
|
|
15
15
|
value: s
|
|
@@ -71,32 +71,32 @@ const F = {
|
|
|
71
71
|
}
|
|
72
72
|
), o.sendMessage("props:binding-items");
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function M() {
|
|
75
75
|
o.sendMessage("@close");
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function P() {
|
|
78
78
|
o.sendMessage("@submit:items", i.value);
|
|
79
79
|
}
|
|
80
80
|
const y = l();
|
|
81
|
-
return
|
|
81
|
+
return S(() => {
|
|
82
82
|
const e = y.value;
|
|
83
83
|
e && new ResizeObserver(() => {
|
|
84
84
|
o.sendMessage("resize", e.scrollHeight);
|
|
85
85
|
}).observe(e);
|
|
86
|
-
}),
|
|
86
|
+
}), U(() => {
|
|
87
87
|
var e, s;
|
|
88
88
|
(s = (e = _.value) == null ? void 0 : e.removeEventListener) == null || s.call(e);
|
|
89
89
|
}), (e, s) => {
|
|
90
90
|
const n = E("FmButton"), t = E("FmCircularProgress");
|
|
91
|
-
return
|
|
91
|
+
return f(), p("div", {
|
|
92
92
|
class: "bg-white",
|
|
93
93
|
ref_key: "resizeableRef",
|
|
94
94
|
ref: y
|
|
95
95
|
}, [
|
|
96
|
-
g.value ? (
|
|
96
|
+
g.value ? (f(), p("div", w, [
|
|
97
97
|
u(t, { size: "md" }),
|
|
98
98
|
s[1] || (s[1] = k("div", null, "Loading bindings dialog...", -1))
|
|
99
|
-
])) : (
|
|
99
|
+
])) : (f(), p("div", F, [
|
|
100
100
|
u(z, {
|
|
101
101
|
"model-value": b.value,
|
|
102
102
|
"onUpdate:modelValue": s[0] || (s[0] = (m) => b.value = m),
|
|
@@ -106,11 +106,11 @@ const F = {
|
|
|
106
106
|
u(n, {
|
|
107
107
|
variant: "tertiary",
|
|
108
108
|
label: "Close",
|
|
109
|
-
onClick:
|
|
109
|
+
onClick: M
|
|
110
110
|
}),
|
|
111
111
|
u(n, {
|
|
112
112
|
label: "Submit",
|
|
113
|
-
onClick:
|
|
113
|
+
onClick: P
|
|
114
114
|
})
|
|
115
115
|
])
|
|
116
116
|
]))
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { defineComponent as x, ref as r, provide as C, computed as g, resolveComponent as h, createElementBlock as u, openBlock as l, createStaticVNode as F, Fragment as L, renderList as I, createElementVNode as p, toDisplayString as v, createVNode as w, withModifiers as N, onMounted as E, onUnmounted as M, createBlock as z } from "vue";
|
|
2
|
+
import { F as b, a as P, aM as R } from "./app-liYoREqu.js";
|
|
3
|
+
import "@feedmepos/ui-library";
|
|
4
|
+
import "@feedmepos/mf-common";
|
|
5
|
+
const U = { class: "" }, D = ["onClick"], O = { class: "flex-grow-0 flex-shrink-0 basis-5/12 py-8 pl-8" }, V = { class: "flex-grow-0 flex-shrink-0 basis-3/12 py-8" }, S = { class: "flex-grow-0 flex-shrink-0 basis-3/12 py-8" }, $ = { class: "flex-grow-0 flex-shrink-0 basis-1/12 py-4" }, T = /* @__PURE__ */ x({
|
|
6
|
+
__name: "binding-ui",
|
|
7
|
+
props: {
|
|
8
|
+
items: { default: () => [] },
|
|
9
|
+
recipes: { default: () => [] },
|
|
10
|
+
skus: { default: () => [] },
|
|
11
|
+
type: { default: "Product" },
|
|
12
|
+
editable: { type: Boolean, default: !1 }
|
|
13
|
+
},
|
|
14
|
+
emits: ["click:open-binding-dialog"],
|
|
15
|
+
setup(_, { emit: a }) {
|
|
16
|
+
const d = r({
|
|
17
|
+
isOpen: !1,
|
|
18
|
+
initialValue: [],
|
|
19
|
+
context: "",
|
|
20
|
+
name: ""
|
|
21
|
+
});
|
|
22
|
+
C("closeDialog", () => {
|
|
23
|
+
d.value.isOpen = !d.value.isOpen;
|
|
24
|
+
});
|
|
25
|
+
const i = _, f = a, m = g(() => i.items.map((s) => ({
|
|
26
|
+
key: s.key,
|
|
27
|
+
name: s.name,
|
|
28
|
+
_skuLinked: s.bindings.filter(
|
|
29
|
+
({ type: t, id: e }) => t === b.enum.SKU && i.skus.some((c) => c._id === e)
|
|
30
|
+
).length,
|
|
31
|
+
_recipeLinked: s.bindings.filter(
|
|
32
|
+
({ type: t, id: e }) => t === b.enum.RECIPE && i.recipes.some((c) => c._id === e)
|
|
33
|
+
).length,
|
|
34
|
+
onUpdate: async () => {
|
|
35
|
+
i.editable && f("click:open-binding-dialog", i.type, s);
|
|
36
|
+
}
|
|
37
|
+
})));
|
|
38
|
+
return (k, s) => {
|
|
39
|
+
const t = h("FmButton");
|
|
40
|
+
return l(), u("div", U, [
|
|
41
|
+
s[0] || (s[0] = F('<div class="flex font-bold bg-[#F7F8FA]"><div class="flex-grow-0 flex-shrink-0 basis-5/12 py-8"></div><div class="flex-grow-0 flex-shrink-0 basis-3/12 py-8">Ingredient</div><div class="flex-grow-0 flex-shrink-0 basis-3/12 py-8">Recipe</div><div class="flex-grow-0 flex-shrink-0 basis-1/12 py-8"></div></div>', 1)),
|
|
42
|
+
(l(!0), u(L, null, I(m.value, (e) => (l(), u("div", {
|
|
43
|
+
key: e.key,
|
|
44
|
+
class: "cursor-pointer flex border-t border-[rgba(17,32,47,0.15] items-center",
|
|
45
|
+
onClick: e.onUpdate
|
|
46
|
+
}, [
|
|
47
|
+
p("div", O, v(e.name), 1),
|
|
48
|
+
p("div", V, v(e._skuLinked ? `${e._skuLinked} linked` : "Not linked"), 1),
|
|
49
|
+
p("div", S, v(e._recipeLinked ? `${e._recipeLinked} linked` : "Not linked"), 1),
|
|
50
|
+
p("div", $, [
|
|
51
|
+
w(t, {
|
|
52
|
+
variant: "tertiary",
|
|
53
|
+
icon: "edit",
|
|
54
|
+
"icon-color": "#000",
|
|
55
|
+
size: "md",
|
|
56
|
+
disabled: !i.editable,
|
|
57
|
+
type: "button",
|
|
58
|
+
onClick: N(e.onUpdate, ["stop"])
|
|
59
|
+
}, null, 8, ["disabled", "onClick"])
|
|
60
|
+
])
|
|
61
|
+
], 8, D))), 128))
|
|
62
|
+
]);
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
}), A = {
|
|
66
|
+
key: 1,
|
|
67
|
+
class: "p-24 flex items-center justify-center gap-16"
|
|
68
|
+
}, K = /* @__PURE__ */ x({
|
|
69
|
+
__name: "BindingsTable",
|
|
70
|
+
setup(_) {
|
|
71
|
+
const a = P(), d = r(!0), i = r(new Array()), f = g(() => a.recipes), m = g(() => a.skus), k = r(""), s = R(e), t = r();
|
|
72
|
+
async function e() {
|
|
73
|
+
await a.readInventory(), t.value = s.onMessage(
|
|
74
|
+
"props:grouped-bindings",
|
|
75
|
+
(n) => {
|
|
76
|
+
d.value = !1, i.value = n;
|
|
77
|
+
}
|
|
78
|
+
), s.sendMessage("props:grouped-bindings");
|
|
79
|
+
}
|
|
80
|
+
async function c(n, o) {
|
|
81
|
+
s.sendMessage("@click:open-binding-dialog", {
|
|
82
|
+
key: n,
|
|
83
|
+
binding: o
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
const y = r();
|
|
87
|
+
return E(() => {
|
|
88
|
+
const n = y.value;
|
|
89
|
+
n && new ResizeObserver(() => {
|
|
90
|
+
s.sendMessage("resize", n.scrollHeight);
|
|
91
|
+
}).observe(n);
|
|
92
|
+
}), M(() => {
|
|
93
|
+
var n, o;
|
|
94
|
+
(o = (n = t.value) == null ? void 0 : n.removeEventListener) == null || o.call(n);
|
|
95
|
+
}), (n, o) => {
|
|
96
|
+
const B = h("FmCircularProgress");
|
|
97
|
+
return l(), u("div", {
|
|
98
|
+
class: "bg-white",
|
|
99
|
+
ref_key: "resizeableRef",
|
|
100
|
+
ref: y
|
|
101
|
+
}, [
|
|
102
|
+
d.value ? (l(), u("div", A, [
|
|
103
|
+
w(B, { size: "md" }),
|
|
104
|
+
o[0] || (o[0] = p("div", null, "Loading bindings table...", -1))
|
|
105
|
+
])) : (l(), z(T, {
|
|
106
|
+
key: 0,
|
|
107
|
+
items: i.value,
|
|
108
|
+
recipes: f.value,
|
|
109
|
+
skus: m.value,
|
|
110
|
+
type: k.value,
|
|
111
|
+
editable: "",
|
|
112
|
+
"onClick:openBindingDialog": c
|
|
113
|
+
}, null, 8, ["items", "recipes", "skus", "type"]))
|
|
114
|
+
], 512);
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
export {
|
|
119
|
+
K as default
|
|
120
|
+
};
|