@feedmepos/mf-inventory-portal 0.0.17-dev.9 → 0.0.18-dev.2
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/ApprovalView-DyazMoIY.js +118 -0
- package/dist/{BindingsDialog-Dw_DCOTY.js → BindingsDialog-D-p9eOMP.js} +2 -2
- package/dist/{BindingsPicker-BRLTF4Qs.js → BindingsPicker-C_kuxqQI.js} +2 -2
- package/dist/BindingsTable-jgL5-FZc.js +147 -0
- package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DLc1nCIY.js +268 -0
- package/dist/{FmMultiselectDialog.vue_vue_type_script_setup_true_lang-YzVhmNJc.js → FmMultiselectDialog.vue_vue_type_script_setup_true_lang-D2Cg0s16.js} +2 -2
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-Dv01gy7k.js → FmUnitInput.vue_vue_type_script_setup_true_lang-FMI-Bp6y.js} +12 -12
- package/dist/IngredientsView-DnIHe3Gj.js +1672 -0
- package/dist/{IntegrationView-Xnl758CS.js → IntegrationView-CgYnK7JB.js} +260 -266
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CUj9Mnt6.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-BObjqgU-.js} +6 -6
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CW0h41FP.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DClJGGeY.js} +1 -1
- package/dist/{PurchaseOrderPrintPreview-DzimxkGt.js → PurchaseOrderPrintPreview-Vbmche3y.js} +1 -1
- package/dist/ReceiveRequestView-CpRdJQuN.js +1394 -0
- package/dist/{RecipeView-B9NcEw7x.js → RecipeView-Do3LgdfI.js} +182 -190
- package/dist/StockView-C16AHdmT.js +1862 -0
- package/dist/SupplierView-DGQXU4Ha.js +796 -0
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BSwsz8Xt.js → TransferDetails.vue_vue_type_script_setup_true_lang-DK5gzjwS.js} +21 -20
- package/dist/{UnitView-BvbaRHxG.js → UnitView-AfEMV9Qr.js} +129 -133
- package/dist/{WarehouseView-Cf5Bmfhn.js → WarehouseView-Cph8wrcF.js} +260 -264
- package/dist/app-UpgZo4xX.js +66113 -0
- package/dist/app.js +1 -1
- package/dist/array-AvWd53LI.js +30 -0
- package/dist/components/FmInventoryTableToolbar.vue.d.ts +53 -0
- package/dist/date2-BfOl_Gio.js +95 -0
- package/dist/dayjs.min-r5rPIQFX.js +282 -0
- package/dist/{decimal-S-jYTEL5.js → decimal-CTa5OWKK.js} +1 -1
- package/dist/extensions/array.d.ts +1 -0
- package/dist/{fuzzy-DW00BX8H.js → fuzzy-0FMA9raY.js} +1 -1
- package/dist/{dayjs.min-M4PEyOKN.js → index-D9a9wXgJ.js} +3594 -3356
- package/dist/{layout-DACHKQ9G.js → layout-DxcK0DGS.js} +1 -1
- package/dist/number-BSqhQaRy.js +97 -0
- package/dist/{rules-ldw61cGA.js → rules-7WxBNkDE.js} +16 -15
- package/dist/stock-estimate-hfECAKZK.js +122 -0
- package/dist/{supplier-DjKC4TaM.js → supplier-Dg3f6Ybw.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-inventory-binding-dialog-D1M09VoX.js → use-inventory-binding-dialog-NLy01qAo.js} +2 -2
- package/dist/views/ingredients/IngredientsView.vue.d.ts +1 -0
- package/dist/{xlsx-BcM9fWkc.js → xlsx-qSY56eID.js} +1 -1
- package/dist/{xlsx.util-BNXjhkYU.js → xlsx.util-DL8p0Kzi.js} +2 -2
- package/package.json +4 -4
- package/dist/ApprovalView-BJ_SGOrx.js +0 -134
- package/dist/BindingsTable-BMIkL0Bk.js +0 -121
- package/dist/ChangeLocationComponent.vue_vue_type_script_setup_true_lang-D9Qp3jke.js +0 -97
- package/dist/IngredientsView-DYFkUsHx.js +0 -1802
- package/dist/ReceiveRequestView-C_0jK6GY.js +0 -1435
- package/dist/SingleColumnLayout.vue_vue_type_script_setup_true_lang-Dov3Uq2z.js +0 -64
- package/dist/StockView-JPw1K8aU.js +0 -1960
- package/dist/SupplierView-CiQLFWmQ.js +0 -804
- package/dist/app-BbXzmbBO.js +0 -42892
- package/dist/components/FmTableToolbar.vue.d.ts +0 -49
- package/dist/date2-DFqSdEvG.js +0 -189
- package/dist/init-date-range-B_ha80e0.js +0 -21
- package/dist/stock-estimate-DOP1qO5w.js +0 -145
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { u as
|
|
3
|
-
import { useDialog as
|
|
4
|
-
import { i as
|
|
5
|
-
import { F as
|
|
6
|
-
import { c as
|
|
7
|
-
import { _ as _e } from "./
|
|
8
|
-
import { R as
|
|
9
|
-
import { a as O, c as he } from "./
|
|
10
|
-
import { F as Ve } from "./decimal-
|
|
11
|
-
import { _ as
|
|
12
|
-
const
|
|
1
|
+
import { defineComponent as H, computed as x, openBlock as c, createElementBlock as w, Fragment as j, renderList as q, createElementVNode as l, toDisplayString as g, createCommentVNode as G, ref as R, resolveComponent as A, createBlock as M, withCtx as D, createVNode as m, unref as d, isRef as Q, normalizeStyle as le, Teleport as se, normalizeProps as ae, guardReactiveProps as ne } from "vue";
|
|
2
|
+
import { u as K, S as re, c as ee, b as W, f as ie } from "./app-UpgZo4xX.js";
|
|
3
|
+
import { useDialog as de, useSnackbar as te, useProxiedModel as X, useBreakpoints as ue } from "@feedmepos/ui-library";
|
|
4
|
+
import { i as ce, _ as me } from "./is-linked-ingredient-error-C6AghEwR.js";
|
|
5
|
+
import { F as U, D as Z, R as L } from "./row-action.enum-BwQbURNh.js";
|
|
6
|
+
import { c as pe, _ as fe, F as ve, u as ye } from "./layout-DxcK0DGS.js";
|
|
7
|
+
import { _ as be, a as _e } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DLc1nCIY.js";
|
|
8
|
+
import { R as z, A as ge, a as xe } from "./rules-7WxBNkDE.js";
|
|
9
|
+
import { a as O, c as he } from "./number-BSqhQaRy.js";
|
|
10
|
+
import { F as Ve } from "./decimal-CTa5OWKK.js";
|
|
11
|
+
import { _ as Ue } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DClJGGeY.js";
|
|
12
|
+
const we = { class: "flex flex-col gap-8" }, Ce = /* @__PURE__ */ l("div", { class: "fm-typo-en-body-md-400" }, "Sorry, this unit is used in the following modules:", -1), Se = {
|
|
13
13
|
key: 0,
|
|
14
14
|
class: "flex flex-col"
|
|
15
|
-
},
|
|
15
|
+
}, $e = /* @__PURE__ */ l("div", { 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" }, [
|
|
16
16
|
/* @__PURE__ */ l("div", { class: "flex-1 py-8 px-16" }, "Ingredient"),
|
|
17
17
|
/* @__PURE__ */ l("div", {
|
|
18
18
|
class: "flex-0 py-8 px-16",
|
|
19
19
|
style: { "flex-basis": "240px" }
|
|
20
20
|
}, "Used in")
|
|
21
|
-
], -1),
|
|
21
|
+
], -1), ke = { class: "flex-1 py-8 px-16" }, Fe = {
|
|
22
22
|
class: "flex-0 py-8 px-16",
|
|
23
23
|
style: { "flex-basis": "240px" }
|
|
24
24
|
}, Ae = {
|
|
@@ -42,54 +42,54 @@ const Ue = { class: "flex flex-col gap-8" }, Ce = /* @__PURE__ */ l("div", { cla
|
|
|
42
42
|
class: "flex-0 py-8 px-16",
|
|
43
43
|
style: { "flex-basis": "240px" }
|
|
44
44
|
}, "Used in")
|
|
45
|
-
], -1),
|
|
45
|
+
], -1), Me = { class: "flex-1 py-8 px-16" }, Te = {
|
|
46
46
|
class: "flex-0 py-8 px-16",
|
|
47
47
|
style: { "flex-basis": "240px" }
|
|
48
|
-
}, Be = /* @__PURE__ */
|
|
48
|
+
}, Be = /* @__PURE__ */ H({
|
|
49
49
|
__name: "UnitUsedBy",
|
|
50
50
|
props: {
|
|
51
51
|
unit: {}
|
|
52
52
|
},
|
|
53
53
|
setup(h) {
|
|
54
|
-
const u = h,
|
|
55
|
-
return (f, V) => (c(),
|
|
54
|
+
const u = h, b = K(), a = x(() => b.validateUnitUsage(u.unit)), s = x(() => a.value.filter((f) => f.from === "INGREDIENT")), r = x(() => a.value.filter((f) => f.from === "RECIPE")), p = x(() => a.value.filter((f) => f.from === "MENU"));
|
|
55
|
+
return (f, V) => (c(), w("div", we, [
|
|
56
56
|
Ce,
|
|
57
|
-
s.value.length ? (c(),
|
|
58
|
-
|
|
59
|
-
(c(!0),
|
|
57
|
+
s.value.length ? (c(), w("div", Se, [
|
|
58
|
+
$e,
|
|
59
|
+
(c(!0), w(j, null, q(s.value, (t) => {
|
|
60
60
|
var n;
|
|
61
|
-
return c(),
|
|
61
|
+
return c(), w("div", {
|
|
62
62
|
key: t.code,
|
|
63
63
|
class: "flex flex-row fm-typo-en-body-md-400 h-48 items-center border-b border-b-fm-color-neutral-gray-100"
|
|
64
64
|
}, [
|
|
65
|
-
l("div",
|
|
66
|
-
l("div",
|
|
65
|
+
l("div", ke, g(t.code) + " " + g(t.name), 1),
|
|
66
|
+
l("div", Fe, g((n = t.bindedIngredient) != null && n.length ? "Convert binding" : "Item unit"), 1)
|
|
67
67
|
]);
|
|
68
68
|
}), 128))
|
|
69
69
|
])) : G("", !0),
|
|
70
|
-
r.value.length ? (c(),
|
|
70
|
+
r.value.length ? (c(), w("div", Ae, [
|
|
71
71
|
Ee,
|
|
72
|
-
(c(!0),
|
|
73
|
-
var n, v,
|
|
74
|
-
return c(),
|
|
72
|
+
(c(!0), w(j, null, q(r.value, (t) => {
|
|
73
|
+
var n, v, y;
|
|
74
|
+
return c(), w("div", {
|
|
75
75
|
key: t.code,
|
|
76
76
|
class: "flex flex-row fm-typo-en-body-md-400 h-48 items-center border-b border-b-fm-color-neutral-gray-100"
|
|
77
77
|
}, [
|
|
78
78
|
l("div", Ie, g(t.code) + " " + g(t.name), 1),
|
|
79
|
-
l("div", De, g((n = t.bindedIngredient) == null ? void 0 : n.slice(0, 3).map((e) => e.code).join(", ")) + " " + g(t.bindedIngredient && ((v = t.bindedIngredient) == null ? void 0 : v.length) > 3 ? `and ${((
|
|
79
|
+
l("div", De, g((n = t.bindedIngredient) == null ? void 0 : n.slice(0, 3).map((e) => e.code).join(", ")) + " " + g(t.bindedIngredient && ((v = t.bindedIngredient) == null ? void 0 : v.length) > 3 ? `and ${((y = t.bindedIngredient) == null ? void 0 : y.length) - 3} more` : ""), 1)
|
|
80
80
|
]);
|
|
81
81
|
}), 128))
|
|
82
82
|
])) : G("", !0),
|
|
83
|
-
p.value.length ? (c(),
|
|
83
|
+
p.value.length ? (c(), w("div", Re, [
|
|
84
84
|
Pe,
|
|
85
|
-
(c(!0),
|
|
86
|
-
var n, v,
|
|
87
|
-
return c(),
|
|
85
|
+
(c(!0), w(j, null, q(p.value, (t) => {
|
|
86
|
+
var n, v, y;
|
|
87
|
+
return c(), w("div", {
|
|
88
88
|
key: t.code,
|
|
89
89
|
class: "flex flex-row fm-typo-en-body-md-400 h-48 items-center border-b border-b-fm-color-neutral-gray-100"
|
|
90
90
|
}, [
|
|
91
|
-
l("div",
|
|
92
|
-
l("div",
|
|
91
|
+
l("div", Me, g(t.code) + " " + g(t.name), 1),
|
|
92
|
+
l("div", Te, g((n = t.bindedIngredient) == null ? void 0 : n.slice(0, 3).map((e) => e.code).join(", ")) + " " + g(t.bindedIngredient && ((v = t.bindedIngredient) == null ? void 0 : v.length) > 3 ? `and ${((y = t.bindedIngredient) == null ? void 0 : y.length) - 3} more` : ""), 1)
|
|
93
93
|
]);
|
|
94
94
|
}), 128))
|
|
95
95
|
])) : G("", !0)
|
|
@@ -97,11 +97,11 @@ const Ue = { class: "flex flex-col gap-8" }, Ce = /* @__PURE__ */ l("div", { cla
|
|
|
97
97
|
}
|
|
98
98
|
});
|
|
99
99
|
function Ne() {
|
|
100
|
-
const h =
|
|
100
|
+
const h = de(), u = te(), b = K(), a = R(!1), s = R();
|
|
101
101
|
function r() {
|
|
102
102
|
const t = {
|
|
103
103
|
unit: {},
|
|
104
|
-
mode:
|
|
104
|
+
mode: U.CREATE,
|
|
105
105
|
show: !0,
|
|
106
106
|
"onUpdate:show"(n) {
|
|
107
107
|
s.value.show = n;
|
|
@@ -112,7 +112,7 @@ function Ne() {
|
|
|
112
112
|
async function p(t) {
|
|
113
113
|
const n = {
|
|
114
114
|
unit: t,
|
|
115
|
-
mode:
|
|
115
|
+
mode: U.UPDATE,
|
|
116
116
|
show: !0,
|
|
117
117
|
"onUpdate:show"(v) {
|
|
118
118
|
s.value.show = v;
|
|
@@ -123,15 +123,15 @@ function Ne() {
|
|
|
123
123
|
async function f(t) {
|
|
124
124
|
a.value = !0;
|
|
125
125
|
try {
|
|
126
|
-
await
|
|
126
|
+
await b.deleteUnit(t), u.open({
|
|
127
127
|
title: "Success",
|
|
128
128
|
message: `Deleted ${t.name}`,
|
|
129
129
|
type: "success"
|
|
130
130
|
});
|
|
131
131
|
} catch (n) {
|
|
132
|
-
n instanceof
|
|
132
|
+
n instanceof re && ce(n) ? h.open({
|
|
133
133
|
title: "Cannot delete unit",
|
|
134
|
-
contentComponent:
|
|
134
|
+
contentComponent: me,
|
|
135
135
|
contentComponentProps: {
|
|
136
136
|
subject: (t == null ? void 0 : t.name) ?? "",
|
|
137
137
|
items: n.errorResponse.message
|
|
@@ -150,7 +150,7 @@ function Ne() {
|
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
152
|
function V(t) {
|
|
153
|
-
if (
|
|
153
|
+
if (b.validateUnitUsage(t).length) {
|
|
154
154
|
h.open({
|
|
155
155
|
title: `Cannot delete ${(t == null ? void 0 : t.name) ?? "unit"}`,
|
|
156
156
|
overlay: !0,
|
|
@@ -194,13 +194,13 @@ function Le({
|
|
|
194
194
|
updateUnit: h,
|
|
195
195
|
deleteUnit: u
|
|
196
196
|
}) {
|
|
197
|
-
async function
|
|
198
|
-
const p =
|
|
199
|
-
if (s ===
|
|
197
|
+
async function b(s, r) {
|
|
198
|
+
const p = ee(r);
|
|
199
|
+
if (s === L.Edit) {
|
|
200
200
|
await h(p);
|
|
201
201
|
return;
|
|
202
202
|
}
|
|
203
|
-
if (s ===
|
|
203
|
+
if (s === L.Delete) {
|
|
204
204
|
await u(p);
|
|
205
205
|
return;
|
|
206
206
|
}
|
|
@@ -222,10 +222,10 @@ function Le({
|
|
|
222
222
|
id: "action",
|
|
223
223
|
header: "",
|
|
224
224
|
cell(s) {
|
|
225
|
-
return
|
|
226
|
-
[
|
|
225
|
+
return pe(
|
|
226
|
+
[Z[L.Edit], Z[L.Delete]],
|
|
227
227
|
(r) => {
|
|
228
|
-
|
|
228
|
+
b(r, s.row.original);
|
|
229
229
|
}
|
|
230
230
|
);
|
|
231
231
|
},
|
|
@@ -238,7 +238,7 @@ function Le({
|
|
|
238
238
|
}
|
|
239
239
|
] };
|
|
240
240
|
}
|
|
241
|
-
const ze = { class: "flex flex-col gap-24" }, je = { class: "flex gap-24" }, qe = { class: "flex-1" }, He = { class: "flex-1" }, Ke = { class: "flex" }, Ge = { class: "flex items-center" }, Oe = { class: "fm-typo-en-body-lg-600 flex-grow" }, Ye = { class: "flex flex-col gap-24" }, Je = { class: "flex gap-24" }, Qe = { class: "flex-1" }, We = { class: "flex-1" }, Xe = /* @__PURE__ */
|
|
241
|
+
const ze = { class: "flex flex-col gap-24" }, je = { class: "flex gap-24" }, qe = { class: "flex-1" }, He = { class: "flex-1" }, Ke = { class: "flex" }, Ge = { class: "flex items-center" }, Oe = { class: "fm-typo-en-body-lg-600 flex-grow" }, Ye = { class: "flex flex-col gap-24" }, Je = { class: "flex gap-24" }, Qe = { class: "flex-1" }, We = { class: "flex-1" }, Xe = /* @__PURE__ */ H({
|
|
242
242
|
__name: "UnitForm",
|
|
243
243
|
props: {
|
|
244
244
|
mode: {},
|
|
@@ -246,8 +246,8 @@ const ze = { class: "flex flex-col gap-24" }, je = { class: "flex gap-24" }, qe
|
|
|
246
246
|
disabled: { type: Boolean }
|
|
247
247
|
},
|
|
248
248
|
emits: ["update:modelValue", "click:submit"],
|
|
249
|
-
setup(h, { expose: u, emit:
|
|
250
|
-
const a = h, s =
|
|
249
|
+
setup(h, { expose: u, emit: b }) {
|
|
250
|
+
const a = h, s = b;
|
|
251
251
|
function r() {
|
|
252
252
|
s("click:submit");
|
|
253
253
|
}
|
|
@@ -307,30 +307,30 @@ const ze = { class: "flex flex-col gap-24" }, je = { class: "flex gap-24" }, qe
|
|
|
307
307
|
const o = a.modelValue ?? {}, i = o.measurements ?? [];
|
|
308
308
|
i.splice(e, 1), o.measurements = i, s("update:modelValue", o);
|
|
309
309
|
}
|
|
310
|
-
const
|
|
310
|
+
const y = R();
|
|
311
311
|
return u({
|
|
312
312
|
validateInputs: () => {
|
|
313
313
|
var e, o;
|
|
314
|
-
(o = (e =
|
|
314
|
+
(o = (e = y.value) == null ? void 0 : e.validateInputs) == null || o.call(e);
|
|
315
315
|
},
|
|
316
316
|
resetInputsValidation: () => {
|
|
317
317
|
var e, o;
|
|
318
|
-
(o = (e =
|
|
318
|
+
(o = (e = y.value) == null ? void 0 : e.resetInputsValidation) == null || o.call(e);
|
|
319
319
|
},
|
|
320
320
|
resetInputs: () => {
|
|
321
321
|
var e, o;
|
|
322
|
-
(o = (e =
|
|
322
|
+
(o = (e = y.value) == null ? void 0 : e.resetInputs) == null || o.call(e);
|
|
323
323
|
}
|
|
324
324
|
}), (e, o) => {
|
|
325
|
-
const i = A("FmTextField"), E = A("FmStepperField"),
|
|
326
|
-
return c(),
|
|
325
|
+
const i = A("FmTextField"), E = A("FmStepperField"), S = A("FmButton"), $ = A("FmCard"), F = A("FmForm");
|
|
326
|
+
return c(), M(F, {
|
|
327
327
|
ref_key: "formRef",
|
|
328
|
-
ref:
|
|
328
|
+
ref: y,
|
|
329
329
|
class: "flex flex-col gap-40",
|
|
330
330
|
onValidationSuccess: r
|
|
331
331
|
}, {
|
|
332
|
-
default:
|
|
333
|
-
var
|
|
332
|
+
default: D(() => {
|
|
333
|
+
var P;
|
|
334
334
|
return [
|
|
335
335
|
l("div", ze, [
|
|
336
336
|
l("div", je, [
|
|
@@ -340,7 +340,7 @@ const ze = { class: "flex flex-col gap-24" }, je = { class: "flex gap-24" }, qe
|
|
|
340
340
|
label: "Name",
|
|
341
341
|
modelValue: p.value,
|
|
342
342
|
"onUpdate:modelValue": o[0] || (o[0] = (C) => p.value = C),
|
|
343
|
-
rules: [d(
|
|
343
|
+
rules: [d(z)()],
|
|
344
344
|
"label-mark": "required"
|
|
345
345
|
}, null, 8, ["disabled", "modelValue", "rules"])
|
|
346
346
|
]),
|
|
@@ -350,7 +350,7 @@ const ze = { class: "flex flex-col gap-24" }, je = { class: "flex gap-24" }, qe
|
|
|
350
350
|
label: "Symbol",
|
|
351
351
|
modelValue: f.value,
|
|
352
352
|
"onUpdate:modelValue": o[1] || (o[1] = (C) => f.value = C),
|
|
353
|
-
rules: [d(
|
|
353
|
+
rules: [d(z)()],
|
|
354
354
|
"label-mark": "required"
|
|
355
355
|
}, null, 8, ["disabled", "modelValue", "rules"])
|
|
356
356
|
])
|
|
@@ -367,7 +367,7 @@ const ze = { class: "flex flex-col gap-24" }, je = { class: "flex gap-24" }, qe
|
|
|
367
367
|
])
|
|
368
368
|
]),
|
|
369
369
|
l("div", Ke, [
|
|
370
|
-
m(
|
|
370
|
+
m(S, {
|
|
371
371
|
disabled: e.disabled,
|
|
372
372
|
type: "button",
|
|
373
373
|
"prepend-icon": "add",
|
|
@@ -376,15 +376,15 @@ const ze = { class: "flex flex-col gap-24" }, je = { class: "flex gap-24" }, qe
|
|
|
376
376
|
onClick: n
|
|
377
377
|
}, null, 8, ["disabled"])
|
|
378
378
|
]),
|
|
379
|
-
(c(!0),
|
|
379
|
+
(c(!0), w(j, null, q((P = e.modelValue) == null ? void 0 : P.measurements, (C, _) => (c(), M($, {
|
|
380
380
|
class: "flex flex-col gap-16 p-16",
|
|
381
381
|
variant: "outlined",
|
|
382
382
|
key: C.id
|
|
383
383
|
}, {
|
|
384
|
-
default:
|
|
384
|
+
default: D(() => [
|
|
385
385
|
l("div", Ge, [
|
|
386
386
|
l("div", Oe, "Measurement " + g(_ + 1), 1),
|
|
387
|
-
m(
|
|
387
|
+
m(S, {
|
|
388
388
|
disabled: e.disabled,
|
|
389
389
|
variant: "tertiary",
|
|
390
390
|
"prepend-icon": "delete",
|
|
@@ -400,7 +400,7 @@ const ze = { class: "flex flex-col gap-24" }, je = { class: "flex gap-24" }, qe
|
|
|
400
400
|
label: "Name",
|
|
401
401
|
modelValue: e.modelValue.measurements[_].name,
|
|
402
402
|
"onUpdate:modelValue": (k) => e.modelValue.measurements[_].name = k,
|
|
403
|
-
rules: [d(
|
|
403
|
+
rules: [d(z)()],
|
|
404
404
|
"label-mark": "required"
|
|
405
405
|
}, null, 8, ["disabled", "modelValue", "onUpdate:modelValue", "rules"])
|
|
406
406
|
]),
|
|
@@ -410,24 +410,24 @@ const ze = { class: "flex flex-col gap-24" }, je = { class: "flex gap-24" }, qe
|
|
|
410
410
|
label: "Symbol",
|
|
411
411
|
modelValue: e.modelValue.measurements[_].abbrev,
|
|
412
412
|
"onUpdate:modelValue": (k) => e.modelValue.measurements[_].abbrev = k,
|
|
413
|
-
rules: [d(
|
|
413
|
+
rules: [d(z)()],
|
|
414
414
|
"label-mark": "required"
|
|
415
415
|
}, null, 8, ["disabled", "modelValue", "onUpdate:modelValue", "rules"])
|
|
416
416
|
])
|
|
417
417
|
]),
|
|
418
|
-
m(
|
|
418
|
+
m(Ue, {
|
|
419
419
|
disabled: e.disabled,
|
|
420
420
|
class: "col-span-3",
|
|
421
421
|
label: "Conversion",
|
|
422
422
|
"model-value": +d(O)(e.modelValue.measurements[_].conversion),
|
|
423
423
|
"onUpdate:modelValue": (k) => t.value = t.value.map(
|
|
424
|
-
(
|
|
425
|
-
...
|
|
424
|
+
(I, T) => T === _ ? {
|
|
425
|
+
...I,
|
|
426
426
|
conversion: d(Ve).toPrecision(
|
|
427
427
|
d(he)(k),
|
|
428
428
|
V.value
|
|
429
429
|
)
|
|
430
|
-
} :
|
|
430
|
+
} : I
|
|
431
431
|
),
|
|
432
432
|
rules: [d(xe)(0)],
|
|
433
433
|
step: +d(O)({ amount: 1, precision: V.value }),
|
|
@@ -443,32 +443,32 @@ const ze = { class: "flex flex-col gap-24" }, je = { class: "flex gap-24" }, qe
|
|
|
443
443
|
}, 512);
|
|
444
444
|
};
|
|
445
445
|
}
|
|
446
|
-
}), Ze = { class: "flex gap-4" }, et = /* @__PURE__ */
|
|
446
|
+
}), Ze = { class: "flex gap-4" }, et = /* @__PURE__ */ H({
|
|
447
447
|
__name: "UnitDialog",
|
|
448
448
|
props: {
|
|
449
449
|
show: { type: Boolean },
|
|
450
450
|
unit: {},
|
|
451
|
-
mode: { default:
|
|
451
|
+
mode: { default: U.READ }
|
|
452
452
|
},
|
|
453
453
|
emits: ["update:show"],
|
|
454
454
|
setup(h) {
|
|
455
|
-
const u = h,
|
|
455
|
+
const u = h, b = K(), a = te(), s = X(u, "show"), r = X(u, "unit"), p = x(() => {
|
|
456
456
|
switch (u.mode) {
|
|
457
|
-
case
|
|
457
|
+
case U.READ:
|
|
458
458
|
return "View unit";
|
|
459
|
-
case
|
|
459
|
+
case U.UPDATE:
|
|
460
460
|
return "Edit unit";
|
|
461
|
-
case
|
|
461
|
+
case U.CREATE:
|
|
462
462
|
return "Add unit";
|
|
463
463
|
}
|
|
464
464
|
return "";
|
|
465
465
|
}), f = x(() => {
|
|
466
466
|
switch (u.mode) {
|
|
467
|
-
case
|
|
467
|
+
case U.READ:
|
|
468
468
|
return "";
|
|
469
|
-
case
|
|
469
|
+
case U.UPDATE:
|
|
470
470
|
return "Save";
|
|
471
|
-
case
|
|
471
|
+
case U.CREATE:
|
|
472
472
|
return "Add";
|
|
473
473
|
}
|
|
474
474
|
return "";
|
|
@@ -476,14 +476,14 @@ const ze = { class: "flex flex-col gap-24" }, je = { class: "flex gap-24" }, qe
|
|
|
476
476
|
async function n() {
|
|
477
477
|
t.value = !0;
|
|
478
478
|
try {
|
|
479
|
-
const o =
|
|
480
|
-
o.precision ?? (o.precision = 0), o.measurements ?? (o.measurements = []), await
|
|
479
|
+
const o = ee(r.value);
|
|
480
|
+
o.precision ?? (o.precision = 0), o.measurements ?? (o.measurements = []), await b.createUnit(o), s.value = !1, a.open({
|
|
481
481
|
title: "Success",
|
|
482
482
|
message: "Created " + r.value.name,
|
|
483
483
|
type: "success"
|
|
484
484
|
});
|
|
485
485
|
} catch (o) {
|
|
486
|
-
o instanceof
|
|
486
|
+
o instanceof W || a.open({
|
|
487
487
|
title: "Failed to create unit",
|
|
488
488
|
message: "Please try again",
|
|
489
489
|
type: "error"
|
|
@@ -495,13 +495,13 @@ const ze = { class: "flex flex-col gap-24" }, je = { class: "flex gap-24" }, qe
|
|
|
495
495
|
async function v() {
|
|
496
496
|
t.value = !0;
|
|
497
497
|
try {
|
|
498
|
-
await
|
|
498
|
+
await b.updateUnit(r.value), s.value = !1, a.open({
|
|
499
499
|
title: "Success",
|
|
500
500
|
message: "Updated " + r.value.name,
|
|
501
501
|
type: "success"
|
|
502
502
|
});
|
|
503
503
|
} catch (o) {
|
|
504
|
-
o instanceof
|
|
504
|
+
o instanceof W || a.open({
|
|
505
505
|
title: "Failed to update unit",
|
|
506
506
|
message: "Please try again",
|
|
507
507
|
type: "error"
|
|
@@ -510,112 +510,108 @@ const ze = { class: "flex flex-col gap-24" }, je = { class: "flex gap-24" }, qe
|
|
|
510
510
|
t.value = !1;
|
|
511
511
|
}
|
|
512
512
|
}
|
|
513
|
-
function
|
|
513
|
+
function y() {
|
|
514
514
|
var o, i;
|
|
515
515
|
(i = (o = V.value) == null ? void 0 : o.validateInputs) == null || i.call(o);
|
|
516
516
|
}
|
|
517
517
|
function e() {
|
|
518
518
|
switch (u.mode) {
|
|
519
|
-
case
|
|
519
|
+
case U.READ:
|
|
520
520
|
return;
|
|
521
|
-
case
|
|
521
|
+
case U.UPDATE:
|
|
522
522
|
return v();
|
|
523
|
-
case
|
|
523
|
+
case U.CREATE:
|
|
524
524
|
return n();
|
|
525
525
|
}
|
|
526
526
|
}
|
|
527
527
|
return (o, i) => {
|
|
528
|
-
const E = A("FmButton"),
|
|
529
|
-
return c(),
|
|
528
|
+
const E = A("FmButton"), S = A("FmSideSheet");
|
|
529
|
+
return c(), M(S, {
|
|
530
530
|
"model-value": d(s),
|
|
531
|
-
"onUpdate:modelValue": i[3] || (i[3] = (
|
|
531
|
+
"onUpdate:modelValue": i[3] || (i[3] = ($) => Q(s) ? s.value = $ : null),
|
|
532
532
|
header: p.value,
|
|
533
533
|
"close-button": "",
|
|
534
534
|
"dismiss-away": "",
|
|
535
535
|
"max-width": 500
|
|
536
536
|
}, {
|
|
537
|
-
"side-sheet-footer":
|
|
537
|
+
"side-sheet-footer": D(() => [
|
|
538
538
|
l("div", Ze, [
|
|
539
539
|
m(E, {
|
|
540
540
|
loading: t.value,
|
|
541
541
|
label: f.value,
|
|
542
|
-
onClick:
|
|
542
|
+
onClick: y
|
|
543
543
|
}, null, 8, ["loading", "label"]),
|
|
544
544
|
m(E, {
|
|
545
545
|
disabled: t.value,
|
|
546
546
|
label: "Close",
|
|
547
547
|
variant: "tertiary",
|
|
548
|
-
onClick: i[2] || (i[2] = (
|
|
548
|
+
onClick: i[2] || (i[2] = ($) => s.value = !1)
|
|
549
549
|
}, null, 8, ["disabled"])
|
|
550
550
|
])
|
|
551
551
|
]),
|
|
552
|
-
default:
|
|
552
|
+
default: D(() => [
|
|
553
553
|
m(Xe, {
|
|
554
554
|
class: "w-full",
|
|
555
555
|
ref_key: "hasValidationExpose",
|
|
556
556
|
ref: V,
|
|
557
557
|
modelValue: d(r),
|
|
558
|
-
"onUpdate:modelValue": i[0] || (i[0] = (
|
|
558
|
+
"onUpdate:modelValue": i[0] || (i[0] = ($) => Q(r) ? r.value = $ : null),
|
|
559
559
|
mode: o.mode,
|
|
560
560
|
disabled: t.value,
|
|
561
|
-
"onClick:submit": i[1] || (i[1] = (
|
|
561
|
+
"onClick:submit": i[1] || (i[1] = ($) => e())
|
|
562
562
|
}, null, 8, ["modelValue", "mode", "disabled"])
|
|
563
563
|
]),
|
|
564
564
|
_: 1
|
|
565
565
|
}, 8, ["model-value", "header"]);
|
|
566
566
|
};
|
|
567
567
|
}
|
|
568
|
-
}), tt = { class: "px-24 xs:p-0 sm:p-0 flex flex-col gap-8 max-h-full" }, ot = { class: "
|
|
568
|
+
}), tt = { class: "px-24 xs:p-0 sm:p-0 flex flex-col gap-8 max-h-full" }, ot = { class: "flex flex-col py-8" }, lt = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, st = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, yt = /* @__PURE__ */ H({
|
|
569
569
|
__name: "UnitView",
|
|
570
570
|
setup(h) {
|
|
571
|
-
const u =
|
|
571
|
+
const u = K(), b = ie(), a = x(() => u.units), { createUnit: s, updateUnit: r, deleteUnit: p, unitDialogProps: f, unitViewLoading: V } = Ne(), { columnDefs: t } = Le({ updateUnit: r, deleteUnit: p });
|
|
572
572
|
function n(E) {
|
|
573
573
|
E === "add" && s();
|
|
574
574
|
}
|
|
575
|
-
const v = R(""),
|
|
576
|
-
return (E,
|
|
577
|
-
const
|
|
578
|
-
return c(),
|
|
575
|
+
const v = R(""), y = x(() => V.value), { breakpoints: e } = ue(), o = x(() => e.value.xs || e.value.sm ? 10 : 20), i = ye();
|
|
576
|
+
return (E, S) => {
|
|
577
|
+
const $ = A("FmTable");
|
|
578
|
+
return c(), M(be, {
|
|
579
579
|
title: "Unit",
|
|
580
580
|
actions: [{ label: "Add unit", value: "add", isPrimary: !0, prependIcon: "add" }],
|
|
581
581
|
"onClick:action": n
|
|
582
582
|
}, {
|
|
583
|
-
default:
|
|
583
|
+
default: D(() => [
|
|
584
584
|
l("div", tt, [
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
])
|
|
593
|
-
]),
|
|
594
|
-
m(K, {
|
|
595
|
-
style: se(d(i).tableHeight),
|
|
585
|
+
m(_e, {
|
|
586
|
+
searchable: "",
|
|
587
|
+
search: v.value,
|
|
588
|
+
"onUpdate:search": S[0] || (S[0] = (F) => v.value = F)
|
|
589
|
+
}, null, 8, ["search"]),
|
|
590
|
+
m($, {
|
|
591
|
+
style: le(d(i).tableHeight),
|
|
596
592
|
"column-defs": d(t),
|
|
597
593
|
"row-data": a.value,
|
|
598
594
|
"search-value": v.value,
|
|
599
|
-
loading: !d(
|
|
600
|
-
onRowClick:
|
|
595
|
+
loading: !d(b)._currentLocation || y.value,
|
|
596
|
+
onRowClick: S[1] || (S[1] = (F) => d(r)(F.original)),
|
|
601
597
|
"page-size": o.value
|
|
602
598
|
}, {
|
|
603
|
-
"list-row":
|
|
604
|
-
m(
|
|
599
|
+
"list-row": D((F) => [
|
|
600
|
+
m(fe, {
|
|
605
601
|
row: F,
|
|
606
602
|
onRowClick: d(r)
|
|
607
603
|
}, {
|
|
608
|
-
default:
|
|
609
|
-
var _, k,
|
|
604
|
+
default: D((P) => {
|
|
605
|
+
var C, _, k, I, T, B, Y, N, J;
|
|
610
606
|
return [
|
|
611
|
-
l("div",
|
|
612
|
-
l("div",
|
|
613
|
-
m(d(
|
|
614
|
-
render: (
|
|
615
|
-
props: (
|
|
607
|
+
l("div", ot, [
|
|
608
|
+
l("div", lt, [
|
|
609
|
+
m(d(ve), {
|
|
610
|
+
render: (k = (_ = (C = P.name) == null ? void 0 : C.column) == null ? void 0 : _.columnDef) == null ? void 0 : k.cell,
|
|
611
|
+
props: (T = (I = P.name) == null ? void 0 : I.getContext) == null ? void 0 : T.call(I)
|
|
616
612
|
}, null, 8, ["render", "props"])
|
|
617
613
|
]),
|
|
618
|
-
l("div",
|
|
614
|
+
l("div", st, g((J = (N = (Y = (B = F.original.measurements) == null ? void 0 : B.map) == null ? void 0 : Y.call(B, (oe) => oe.name)) == null ? void 0 : N.join) == null ? void 0 : J.call(N, ", ")), 1)
|
|
619
615
|
])
|
|
620
616
|
];
|
|
621
617
|
}),
|
|
@@ -625,8 +621,8 @@ const ze = { class: "flex flex-col gap-24" }, je = { class: "flex gap-24" }, qe
|
|
|
625
621
|
_: 1
|
|
626
622
|
}, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"])
|
|
627
623
|
]),
|
|
628
|
-
(c(),
|
|
629
|
-
m(et, ne(
|
|
624
|
+
(c(), M(se, { to: "body" }, [
|
|
625
|
+
m(et, ae(ne(d(f))), null, 16)
|
|
630
626
|
]))
|
|
631
627
|
]),
|
|
632
628
|
_: 1
|
|
@@ -635,5 +631,5 @@ const ze = { class: "flex flex-col gap-24" }, je = { class: "flex gap-24" }, qe
|
|
|
635
631
|
}
|
|
636
632
|
});
|
|
637
633
|
export {
|
|
638
|
-
|
|
634
|
+
yt as default
|
|
639
635
|
};
|