@feedmepos/mf-inventory-portal 1.2.22-dev.1 → 1.2.22-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/{App-CVo40hoN.js → App-DtwLZ9Ng.js} +1 -1
- package/dist/{ApprovalView-B99YGXOt.js → ApprovalView-DTiPzA1y.js} +9 -9
- package/dist/{BindingsDialog-DGFYmVX9.js → BindingsDialog--1wB_TX2.js} +2 -2
- package/dist/{BindingsPicker-CVWxRkDE.js → BindingsPicker-JjZfjlvz.js} +9 -9
- package/dist/{BindingsTable-Cxs_cQrM.js → BindingsTable-M2CGWdTD.js} +1 -1
- package/dist/{ClosingDraftView-gBO5Icdy.js → ClosingDraftView-B800NjEZ.js} +101 -101
- package/dist/ClosingTemplateView-B1TVIzzy.js +2001 -0
- package/dist/{DeliveryOrderPrintPreview-D-H7S-4t.js → DeliveryOrderPrintPreview-CUXfCixj.js} +8 -8
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BsPMd4IE.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Bdw3Q4Dz.js} +33 -33
- package/dist/{FmMultiselectDialog-DXVvibUU.js → FmMultiselectDialog-CyYcvvyg.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-Dq8lMkNV.js → FmUnitInput.vue_vue_type_script_setup_true_lang-D-FDSjxY.js} +49 -49
- package/dist/{ImportView-DUPfQshy.js → ImportView-BR7JpsG8.js} +27 -27
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DxLVS1Ar.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-Bae5DUA9.js} +8 -8
- package/dist/{IngredientGroupView-CqPl6RZI.js → IngredientGroupView-c6XH5Fzg.js} +17 -17
- package/dist/{IngredientsView--7ro7P7J.js → IngredientsView-D4JiQ6Bp.js} +72 -73
- package/dist/{IntegrationView-BZnq8gYp.js → IntegrationView-BdOTe6FG.js} +3 -3
- package/dist/{InventoryBindingForm-DASUGZuO.js → InventoryBindingForm-kqrZutMr.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-l_EgNW0u.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DZ-Mr8-U.js} +12 -12
- package/dist/{InventoryBindingSummary-BoUAsK9S.js → InventoryBindingSummary-D4p9cOiy.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DimqJCjO.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Bj_2aQiY.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-C_wNgXUC.js → PremiumBadge.vue_vue_type_script_setup_true_lang-CX9H2gLU.js} +7 -7
- package/dist/{PublishView-B-Zal--Y.js → PublishView-DcQQtuF8.js} +10 -10
- package/dist/{PurchaseOrderPrintPreview-CoXu4VO-.js → PurchaseOrderPrintPreview-Ueo4Yftu.js} +13 -13
- package/dist/{ReceiveRequestView-B7rprDy7.js → ReceiveRequestView-Cikz66hY.js} +115 -115
- package/dist/{RecipeView-BbMlUt0v.js → RecipeView-DL1kKy2w.js} +50 -50
- package/dist/{StockView-Bko2-Rzd.js → StockView-DzaCcxc5.js} +7 -7
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DONtcweN.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DP5AFZM2.js} +1 -1
- package/dist/{SupplierView-D4hAT4CW.js → SupplierView-CJuI_jPc.js} +93 -93
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-BoZEbHkN.js +3233 -0
- package/dist/{TransferTemplateView-BLWYhdZG.js → TransferTemplateView-DiGdnr0-.js} +140 -140
- package/dist/{UnitView-Boi_sRGP.js → UnitView-CA2isH5r.js} +44 -44
- package/dist/{WarehouseView-B1aAyncU.js → WarehouseView-BMUJN1D1.js} +66 -66
- package/dist/api/adjustment-template.d.ts +1 -0
- package/dist/api/closing-template.d.ts +1 -0
- package/dist/{app-C4dN86_k.js → app-DdrL4md8.js} +8229 -7971
- package/dist/app.js +4 -4
- package/dist/{decimal-Cf4voIJl.js → decimal-DJjE7Vf3.js} +1 -1
- package/dist/{format-unit-display-CjsVuoHS.js → format-unit-display-CK-PNM0G.js} +33 -33
- package/dist/{import-export.helper-DmouV6nF.js → import-export.helper-CJeCekEB.js} +6 -6
- package/dist/{index-DK93lkR_.js → index-Crgf6sCC.js} +1 -1
- package/dist/{index-D2C87f4k.js → index-D4F6boO1.js} +1 -1
- package/dist/{purchase-order-template-CQcIyT35.js → purchase-order-template-BOLP3UzN.js} +1 -1
- package/dist/{stock-CRKwCBhd.js → stock-DqL6z9wL.js} +1 -1
- package/dist/{supplier-BGeDlnSm.js → supplier-CW3GGX9U.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-Dg3hbUaX.js → use-ingredient-select-dialog-CrCo-DHA.js} +1 -1
- package/dist/{use-inventory-binding-dialog-DRCiAYUs.js → use-inventory-binding-dialog-RdX9Q4q9.js} +1 -1
- package/dist/views/adjustment-template/wastage-template/actions.d.ts +60 -0
- package/dist/views/adjustment-template/wastage-template/table.d.ts +60 -0
- package/dist/views/receive-request/components/delivery-order-form/SystemTrailDialog.vue.d.ts +8 -4
- package/package.json +4 -4
- package/dist/ClosingTemplateView-C61_1m3k.js +0 -1970
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-Cr30q-Ft.js +0 -3394
- package/dist/closing-template-CNtgIoiQ.js +0 -53
package/dist/{DeliveryOrderPrintPreview-D-H7S-4t.js → DeliveryOrderPrintPreview-CUXfCixj.js}
RENAMED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { defineComponent as x, computed as f, ref as h, onMounted as g, openBlock as u, createElementBlock as i, createElementVNode as t, createTextVNode as n, toDisplayString as e, createCommentVNode as d, Fragment as o, renderList as p, normalizeClass as _ } from "vue";
|
|
2
2
|
import { useRoute as k } from "vue-router";
|
|
3
|
-
import {
|
|
3
|
+
import { aK as y, aw as w } from "./app-DdrL4md8.js";
|
|
4
4
|
const c = { class: "purchase-box" }, A = { valign: "bottom" }, N = { class: "sub-header" }, O = ["src"], P = { style: { "padding-left": "10px" } }, C = { class: "address" }, D = { class: "text-right" }, R = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "subtitle"
|
|
7
|
-
}, S = { class: "sub-header" }, E = { class: "caption" }, T = { class: "address" }, q = { class: "text-right" }, F = { class: "sub-header" }, I = { class: "address" },
|
|
7
|
+
}, S = { class: "sub-header" }, E = { class: "caption" }, T = { class: "address" }, q = { class: "text-right" }, F = { class: "sub-header" }, I = { class: "address" }, U = { class: "purchase-body" }, B = { class: "text-left" }, H = { class: "text-left" }, L = { class: "text-left" }, M = { class: "text-left" }, V = { class: "text-left" }, J = { class: "text-right" }, j = { key: 0 }, z = {
|
|
8
8
|
key: 1,
|
|
9
9
|
style: { "padding-top": "30px" }
|
|
10
|
-
}, G = { valign: "bottom" },
|
|
10
|
+
}, G = { valign: "bottom" }, K = { class: "header" }, Q = { class: "caption" }, W = {
|
|
11
11
|
class: "text-left",
|
|
12
12
|
style: { width: "20%" }
|
|
13
13
|
}, X = { class: "text-left" }, Y = {
|
|
@@ -106,7 +106,7 @@ const c = { class: "purchase-box" }, A = { valign: "bottom" }, N = { class: "sub
|
|
|
106
106
|
])
|
|
107
107
|
])
|
|
108
108
|
]),
|
|
109
|
-
t("div",
|
|
109
|
+
t("div", U, [
|
|
110
110
|
t("table", null, [
|
|
111
111
|
l[19] || (l[19] = t("thead", { class: "item-header" }, [
|
|
112
112
|
t("tr", null, [
|
|
@@ -126,8 +126,8 @@ const c = { class: "purchase-box" }, A = { valign: "bottom" }, N = { class: "sub
|
|
|
126
126
|
], -1)),
|
|
127
127
|
t("tbody", null, [
|
|
128
128
|
t("tr", null, [
|
|
129
|
-
t("td",
|
|
130
|
-
t("td",
|
|
129
|
+
t("td", B, e(s.value.orderNumber), 1),
|
|
130
|
+
t("td", H, e(s.value.ref), 1),
|
|
131
131
|
t("td", L, e(s.value.supplier.phoneNumber), 1)
|
|
132
132
|
])
|
|
133
133
|
])
|
|
@@ -178,8 +178,8 @@ const c = { class: "purchase-box" }, A = { valign: "bottom" }, N = { class: "sub
|
|
|
178
178
|
t("table", null, [
|
|
179
179
|
t("tr", G, [
|
|
180
180
|
t("td", null, [
|
|
181
|
-
t("div",
|
|
182
|
-
t("div",
|
|
181
|
+
t("div", K, "Ref: " + e(r.ref), 1),
|
|
182
|
+
t("div", Q, e(r.createdAt), 1),
|
|
183
183
|
t("div", null, "Remark: " + e(r.remark), 1)
|
|
184
184
|
])
|
|
185
185
|
])
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { u as z } from "./supplier-
|
|
3
|
-
import { P as
|
|
4
|
-
import { computed as f, defineComponent as
|
|
1
|
+
import { n as C, t as E, aH as g, u as R, aM as B, aW as H, p as D, aX as U } from "./app-DdrL4md8.js";
|
|
2
|
+
import { u as z } from "./supplier-CW3GGX9U.js";
|
|
3
|
+
import { P as T } from "./format-unit-display-CK-PNM0G.js";
|
|
4
|
+
import { computed as f, defineComponent as W, mergeModels as j, useModel as q, ref as x, resolveComponent as w, openBlock as L, createElementBlock as O, normalizeStyle as $, createElementVNode as I, createVNode as X, withCtx as J, createBlock as M, createCommentVNode as N, Fragment as K, renderList as Q, unref as V } from "vue";
|
|
5
5
|
function Y(e, a, r) {
|
|
6
6
|
var o;
|
|
7
7
|
if (!!a.measurement === !!r && ((o = a.measurement) == null ? void 0 : o.id) === r)
|
|
@@ -29,26 +29,26 @@ function oe(e, a, r, u) {
|
|
|
29
29
|
skuDefaultCost: e.defaultCost ?? void 0,
|
|
30
30
|
supplierOverrideCost: l ?? void 0
|
|
31
31
|
};
|
|
32
|
-
const n = e.defaultCost ? Y(e.unit, e.defaultCost, e.trackingMeasurement) : void 0, o = l ?? n, p = o == null ? void 0 : o.costPerUnit, v = p ? o != null && o.measurement ? +
|
|
32
|
+
const n = e.defaultCost ? Y(e.unit, e.defaultCost, e.trackingMeasurement) : void 0, o = l ?? n, p = o == null ? void 0 : o.costPerUnit, v = p ? o != null && o.measurement ? +C(p) / +C(o == null ? void 0 : o.measurement.conversion) : +C(p) : void 0, b = v ? r ? v * +C(r.conversion) : v : void 0, h = b ? +C(a) * b : void 0;
|
|
33
33
|
return {
|
|
34
34
|
cost: h ? {
|
|
35
35
|
...E(h ?? 0, 2),
|
|
36
|
-
currency:
|
|
36
|
+
currency: g()
|
|
37
37
|
} : {
|
|
38
38
|
amount: 0,
|
|
39
39
|
precision: 0,
|
|
40
|
-
currency:
|
|
40
|
+
currency: g()
|
|
41
41
|
},
|
|
42
42
|
skuDefaultCost: e.defaultCost ?? void 0,
|
|
43
43
|
supplierOverrideCost: l ?? void 0
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
46
|
function k(e) {
|
|
47
|
-
const a =
|
|
47
|
+
const a = H.safeParse(e);
|
|
48
48
|
if (a.success) return a.data;
|
|
49
49
|
throw new Error("Invalid supplier data");
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function F(e) {
|
|
52
52
|
return {
|
|
53
53
|
_id: e.doc._id,
|
|
54
54
|
internal: e.type,
|
|
@@ -77,13 +77,13 @@ function ne(e, a, r = !1, u = !1) {
|
|
|
77
77
|
const t = u ? l.suppliers[0] : l.businessSuppliers[0], i = (r ? n.locations.filter((d) => d.doc._id !== n.currentLocation.doc._id) : n.locations)[0];
|
|
78
78
|
a({
|
|
79
79
|
...s,
|
|
80
|
-
supplier: t ? k(t) : i ?
|
|
80
|
+
supplier: t ? k(t) : i ? F(i) : s.supplier
|
|
81
81
|
});
|
|
82
82
|
});
|
|
83
83
|
const o = f(
|
|
84
84
|
() => {
|
|
85
85
|
var s, t;
|
|
86
|
-
return typeof ((t = (s = e()) == null ? void 0 : s.supplier) == null ? void 0 : t.internal) == "string" ?
|
|
86
|
+
return typeof ((t = (s = e()) == null ? void 0 : s.supplier) == null ? void 0 : t.internal) == "string" ? T.TRANSFER : T.PURCHASE;
|
|
87
87
|
}
|
|
88
88
|
), p = f({
|
|
89
89
|
get() {
|
|
@@ -92,11 +92,11 @@ function ne(e, a, r = !1, u = !1) {
|
|
|
92
92
|
},
|
|
93
93
|
set(s) {
|
|
94
94
|
const t = e() ?? {};
|
|
95
|
-
if (o.value ===
|
|
96
|
-
const
|
|
95
|
+
if (o.value === T.PURCHASE) {
|
|
96
|
+
const S = (u ? l.suppliers : l.businessSuppliers).find((A) => A._id === s);
|
|
97
97
|
a({
|
|
98
98
|
...t,
|
|
99
|
-
supplier:
|
|
99
|
+
supplier: S ? k(S) : t.supplier
|
|
100
100
|
});
|
|
101
101
|
return;
|
|
102
102
|
}
|
|
@@ -105,7 +105,7 @@ function ne(e, a, r = !1, u = !1) {
|
|
|
105
105
|
) : n.allLocations).find((d) => d.doc._id === s);
|
|
106
106
|
a({
|
|
107
107
|
...t,
|
|
108
|
-
supplier: y ?
|
|
108
|
+
supplier: y ? F(y) : t.supplier
|
|
109
109
|
});
|
|
110
110
|
}
|
|
111
111
|
}), v = f(() => l.locationSuppliers.map(k)), b = f(() => l.businessSuppliers.map(k)), h = f(() => {
|
|
@@ -116,9 +116,9 @@ function ne(e, a, r = !1, u = !1) {
|
|
|
116
116
|
const s = ((m = n._currentLocation) == null ? void 0 : m.type) === B.warehouse;
|
|
117
117
|
return (r ? n.allLocations.filter(
|
|
118
118
|
(i) => i.doc._id !== n.currentLocation.doc._id
|
|
119
|
-
) : n.allLocations).filter((i) => s || i.acceptRequest).map(
|
|
119
|
+
) : n.allLocations).filter((i) => s || i.acceptRequest).map(F);
|
|
120
120
|
}), P = f(() => {
|
|
121
|
-
if (o.value ===
|
|
121
|
+
if (o.value === T.PURCHASE) {
|
|
122
122
|
const t = v.value.map((i) => ({
|
|
123
123
|
label: i.name,
|
|
124
124
|
value: i._id
|
|
@@ -137,12 +137,12 @@ function ne(e, a, r = !1, u = !1) {
|
|
|
137
137
|
}), _ = f(() => {
|
|
138
138
|
var i, y;
|
|
139
139
|
const s = (y = (i = e()) == null ? void 0 : i.supplier) == null ? void 0 : y._id;
|
|
140
|
-
if (o.value ===
|
|
141
|
-
const d = l.suppliers.find((
|
|
140
|
+
if (o.value === T.PURCHASE) {
|
|
141
|
+
const d = l.suppliers.find((S) => S._id === s);
|
|
142
142
|
return d ? k(d) : null;
|
|
143
143
|
}
|
|
144
144
|
const m = n.allLocations.find((d) => d.doc._id);
|
|
145
|
-
return m ?
|
|
145
|
+
return m ? F(m) : null;
|
|
146
146
|
});
|
|
147
147
|
return {
|
|
148
148
|
transferLocationModel: p,
|
|
@@ -153,9 +153,9 @@ function ne(e, a, r = !1, u = !1) {
|
|
|
153
153
|
selectedLocation: _
|
|
154
154
|
};
|
|
155
155
|
}
|
|
156
|
-
const Z = { class: "overflow-y-auto h-full pb-8" }, ae = /* @__PURE__ */
|
|
156
|
+
const Z = { class: "overflow-y-auto h-full pb-8" }, ae = /* @__PURE__ */ W({
|
|
157
157
|
__name: "FmFilterableMenuOptions",
|
|
158
|
-
props: /* @__PURE__ */
|
|
158
|
+
props: /* @__PURE__ */ j({
|
|
159
159
|
modelValue: {},
|
|
160
160
|
maxHeight: {},
|
|
161
161
|
width: {},
|
|
@@ -168,12 +168,12 @@ const Z = { class: "overflow-y-auto h-full pb-8" }, ae = /* @__PURE__ */ j({
|
|
|
168
168
|
}),
|
|
169
169
|
emits: ["update:search"],
|
|
170
170
|
setup(e) {
|
|
171
|
-
const a = e, r =
|
|
172
|
-
() => new
|
|
171
|
+
const a = e, r = q(e, "search"), u = f(
|
|
172
|
+
() => new D(a.items, ["label", "sublabel"], {
|
|
173
173
|
caseSensitive: !1,
|
|
174
174
|
sort: !0
|
|
175
175
|
})
|
|
176
|
-
), l = f(() => u.value.search(r.value)), n =
|
|
176
|
+
), l = f(() => u.value.search(r.value)), n = x();
|
|
177
177
|
return console.log({ stickyRef: n }), (o, p) => {
|
|
178
178
|
const v = w("FmButton"), b = w("FmTextField"), h = w("FmMenuItem");
|
|
179
179
|
return L(), O("div", {
|
|
@@ -185,13 +185,13 @@ const Z = { class: "overflow-y-auto h-full pb-8" }, ae = /* @__PURE__ */ j({
|
|
|
185
185
|
ref_key: "stickyRef",
|
|
186
186
|
ref: n
|
|
187
187
|
}, [
|
|
188
|
-
|
|
188
|
+
X(b, {
|
|
189
189
|
modelValue: r.value,
|
|
190
190
|
"onUpdate:modelValue": p[1] || (p[1] = (c) => r.value = c),
|
|
191
191
|
placeholder: "Filter options"
|
|
192
192
|
}, {
|
|
193
|
-
append:
|
|
194
|
-
r.value ? (L(),
|
|
193
|
+
append: J(() => [
|
|
194
|
+
r.value ? (L(), M(v, {
|
|
195
195
|
key: 0,
|
|
196
196
|
variant: "tertiary",
|
|
197
197
|
"prepend-icon": "close",
|
|
@@ -202,18 +202,18 @@ const Z = { class: "overflow-y-auto h-full pb-8" }, ae = /* @__PURE__ */ j({
|
|
|
202
202
|
}, 8, ["modelValue"])
|
|
203
203
|
], 512),
|
|
204
204
|
I("div", Z, [
|
|
205
|
-
(L(!0), O(
|
|
205
|
+
(L(!0), O(K, null, Q(l.value, (c, P) => (L(), M(h, {
|
|
206
206
|
key: P,
|
|
207
207
|
label: c.label,
|
|
208
208
|
sublabel: c.sublabel,
|
|
209
|
-
"model-value":
|
|
210
|
-
onClick: () => o.handleItemChange(
|
|
209
|
+
"model-value": V(U)(o.modelValue, c.value),
|
|
210
|
+
onClick: () => o.handleItemChange(V(U)(o.modelValue, c.value), c),
|
|
211
211
|
onVnodeMounted: (_) => {
|
|
212
212
|
var s, t;
|
|
213
|
-
return
|
|
213
|
+
return V(U)(o.modelValue, c.value) && ((s = _.el) == null || s.scrollIntoView({ behavior: "instant", block: "end" }), (t = _.el) == null || t.scrollIntoView({ behavior: "smooth", block: "center" })), void 0;
|
|
214
214
|
}
|
|
215
215
|
}, null, 8, ["label", "sublabel", "model-value", "onClick", "onVnodeMounted"]))), 128)),
|
|
216
|
-
l.value.length ? N("", !0) : (L(),
|
|
216
|
+
l.value.length ? N("", !0) : (L(), M(h, {
|
|
217
217
|
key: 0,
|
|
218
218
|
disabled: "",
|
|
219
219
|
label: "No options available"
|
|
@@ -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 { x as a } from "./app-DdrL4md8.js";
|
|
5
5
|
import { h as S } from "vue";
|
|
6
6
|
const w = p("inventoryMultiSelectDialog", () => {
|
|
7
7
|
const l = y(), { t: n } = v();
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import { defineComponent as ie, mergeModels as W, useModel as
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent as ie, mergeModels as W, useModel as ae, computed as v, ref as B, watch as E, onBeforeUnmount as le, inject as ue, resolveComponent as b, openBlock as d, createElementBlock as y, createElementVNode as u, createVNode as h, withCtx as F, renderSlot as G, normalizeClass as $, toDisplayString as A, withDirectives as re, vModelText as me, createCommentVNode as I, createTextVNode as ce, createBlock as U, Fragment as de, renderList as pe } from "vue";
|
|
2
|
+
import { $ as D, P as R, z as j, a0 as fe, n as M, aV as ve, t as be, bf as ye, Z as he, aA as Me, aT as ge, aS as xe } from "./app-DdrL4md8.js";
|
|
3
3
|
import "@feedmepos/ui-library";
|
|
4
4
|
function H() {
|
|
5
5
|
return {
|
|
6
6
|
amount: D.reset()
|
|
7
7
|
};
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function J() {
|
|
10
10
|
return function(f) {
|
|
11
11
|
return R()(f.amountAsString);
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function Oe(l) {
|
|
15
15
|
return function(t) {
|
|
16
|
-
return R()(t.amountAsString) !== !0 ? !0 : +t.amountAsString <
|
|
16
|
+
return R()(t.amountAsString) !== !0 ? !0 : +t.amountAsString < l ? `Must be at least ${l}` : !0;
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
function qe(
|
|
19
|
+
function qe(l) {
|
|
20
20
|
return function(t) {
|
|
21
|
-
return R()(t.amountAsString) !== !0 ? !0 : +t.amountAsString >
|
|
21
|
+
return R()(t.amountAsString) !== !0 ? !0 : +t.amountAsString > l ? `Must be at most ${l}` : !0;
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
function Z(
|
|
24
|
+
function Z(l, f = !1) {
|
|
25
25
|
return function(c) {
|
|
26
|
-
const s =
|
|
26
|
+
const s = J()(c);
|
|
27
27
|
if (s != !0)
|
|
28
28
|
return f ? s : !0;
|
|
29
|
-
const
|
|
30
|
-
return fe(+c.amountAsString).precision >
|
|
29
|
+
const _ = typeof l == "number" ? l : j(l, c.modelValue.measurement);
|
|
30
|
+
return fe(+c.amountAsString).precision > _ ? `Cannot exceed precision more than ${M({
|
|
31
31
|
amount: 1,
|
|
32
|
-
precision:
|
|
32
|
+
precision: _
|
|
33
33
|
})}` : !0;
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
|
-
function ze(
|
|
37
|
-
const f = ve(
|
|
36
|
+
function ze(l) {
|
|
37
|
+
const f = ve(l);
|
|
38
38
|
return function(c) {
|
|
39
39
|
return f(c.modelValue.amount);
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
const Fe = { class: "flex flex-col" },
|
|
42
|
+
const Fe = { class: "flex flex-col" }, Ae = { class: "flex flex-col" }, _e = { class: "flex-1" }, Pe = { class: "flex items-center gap-4" }, ke = { class: "flex-1 flex gap-4" }, Be = { class: "shrink-0 grow basis-2/5" }, Ie = {
|
|
43
43
|
key: 0,
|
|
44
44
|
class: "text-fm-color-typo-secondary"
|
|
45
45
|
}, Ue = {
|
|
@@ -104,20 +104,20 @@ const Fe = { class: "flex flex-col" }, _e = { class: "flex flex-col" }, Ae = { c
|
|
|
104
104
|
modelModifiers: {}
|
|
105
105
|
}),
|
|
106
106
|
emits: /* @__PURE__ */ W(["update:amount", "update:measurement"], ["update:modelValue"]),
|
|
107
|
-
setup(
|
|
108
|
-
const t =
|
|
107
|
+
setup(l, { emit: f }) {
|
|
108
|
+
const t = l, c = f, s = ae(l, "modelValue"), _ = R(), w = v(() => {
|
|
109
109
|
var n;
|
|
110
|
-
return
|
|
110
|
+
return j(t.unit, (n = s.value) == null ? void 0 : n.measurement);
|
|
111
111
|
}), p = B((() => {
|
|
112
112
|
var o;
|
|
113
|
-
const e = ((o = s.value) == null ? void 0 : o.amount) ?? D.reset(), n = ge(e), i = t.formatMinimumPrecision ?? n.precision,
|
|
114
|
-
return M(
|
|
113
|
+
const e = ((o = s.value) == null ? void 0 : o.amount) ?? D.reset(), n = ge(e), i = t.formatMinimumPrecision ?? n.precision, a = xe(n, i);
|
|
114
|
+
return M(a);
|
|
115
115
|
})());
|
|
116
116
|
let x = null;
|
|
117
117
|
E(p, (e) => {
|
|
118
118
|
x && clearTimeout(x), x = setTimeout(() => {
|
|
119
119
|
var r;
|
|
120
|
-
const n =
|
|
120
|
+
const n = _(e), i = t.precision ?? w.value, o = typeof t.formatMinimumPrecision == "number" && t.formatMinimumPrecision > i ? t.formatMinimumPrecision : i;
|
|
121
121
|
if (n == !0) {
|
|
122
122
|
const g = be(+e, o);
|
|
123
123
|
((r = s.value) == null ? void 0 : r.amount) !== g && (s.value = {
|
|
@@ -127,18 +127,18 @@ const Fe = { class: "flex flex-col" }, _e = { class: "flex flex-col" }, Ae = { c
|
|
|
127
127
|
}
|
|
128
128
|
c("update:amount", e);
|
|
129
129
|
}, 500);
|
|
130
|
-
}),
|
|
130
|
+
}), le(() => {
|
|
131
131
|
x && clearTimeout(x);
|
|
132
132
|
});
|
|
133
|
-
const
|
|
134
|
-
var
|
|
133
|
+
const Q = Symbol.for("fm:form-state"), C = ue(Q, null), P = v(() => t.disabled ?? (C == null ? void 0 : C.getDisabled()) ?? !1), X = B(), S = B(!1), O = B(!1), Y = v(() => S.value || O.value), ee = v(() => {
|
|
134
|
+
var a;
|
|
135
135
|
const e = t.unit.measurements.filter((o) => !o.name.toLocaleLowerCase().includes("inactive")).filter((o) => o.abbrev !== t.unit.abbrev || +M(o.conversion) != 1), n = ye.groupBy(
|
|
136
136
|
e,
|
|
137
137
|
(o) => `${o.abbrev}${M(o.conversion)}`
|
|
138
138
|
), i = Object.values(n).map((o) => o[0]);
|
|
139
139
|
return [
|
|
140
140
|
{
|
|
141
|
-
label: (
|
|
141
|
+
label: (a = t.unit) == null ? void 0 : a.abbrev,
|
|
142
142
|
value: null,
|
|
143
143
|
isBaseUnit: !0
|
|
144
144
|
},
|
|
@@ -172,7 +172,7 @@ const Fe = { class: "flex flex-col" }, _e = { class: "flex flex-col" }, Ae = { c
|
|
|
172
172
|
var m;
|
|
173
173
|
if (!t.convertAmountOnChangeUnit)
|
|
174
174
|
return;
|
|
175
|
-
const i = ((m = s.value) == null ? void 0 : m.amount) ?? D.reset(),
|
|
175
|
+
const i = ((m = s.value) == null ? void 0 : m.amount) ?? D.reset(), a = t.unit.measurements.find((k) => k.id === n) ?? null, o = t.unit.measurements.find((k) => k.id === e) ?? null, r = a ? he(i, a.conversion) : i, g = o ? Me(r, o.conversion) : r, T = j(t.unit, o), L = D.convertPrecision({
|
|
176
176
|
value: g,
|
|
177
177
|
precision: T
|
|
178
178
|
});
|
|
@@ -192,11 +192,11 @@ const Fe = { class: "flex flex-col" }, _e = { class: "flex flex-col" }, Ae = { c
|
|
|
192
192
|
)) ?? [];
|
|
193
193
|
}
|
|
194
194
|
), ne = v(() => [...t.applyDefaultRules ? [
|
|
195
|
-
|
|
195
|
+
J(),
|
|
196
196
|
typeof t.precision == "number" ? Z(t.precision) : Z(t.unit)
|
|
197
197
|
] : [], ...te.value]);
|
|
198
198
|
function z(e) {
|
|
199
|
-
const n = t.precision ?? w.value,
|
|
199
|
+
const n = t.precision ?? w.value, a = typeof t.formatMinimumPrecision == "number" && t.formatMinimumPrecision > n ? t.formatMinimumPrecision : n, o = e.toFixed(a), r = o.includes(".") ? o.replace(/0+$/, "") : o;
|
|
200
200
|
return r.endsWith(".") ? r.slice(0, r.length - 1) : r;
|
|
201
201
|
}
|
|
202
202
|
function oe() {
|
|
@@ -212,10 +212,10 @@ const Fe = { class: "flex flex-col" }, _e = { class: "flex flex-col" }, Ae = { c
|
|
|
212
212
|
p.value = z(e);
|
|
213
213
|
}
|
|
214
214
|
return (e, n) => {
|
|
215
|
-
const i = b("FmLabel"),
|
|
215
|
+
const i = b("FmLabel"), a = b("FmIcon"), o = b("FmMenuItem"), r = b("FmMenu"), g = b("FmTooltip"), T = b("FmField"), L = b("FmFormGroup");
|
|
216
216
|
return d(), y("div", Fe, [
|
|
217
|
-
u("div",
|
|
218
|
-
u("div",
|
|
217
|
+
u("div", Ae, [
|
|
218
|
+
u("div", _e, [
|
|
219
219
|
h(i, {
|
|
220
220
|
label: e.label,
|
|
221
221
|
disabled: e.disabled,
|
|
@@ -223,7 +223,7 @@ const Fe = { class: "flex flex-col" }, _e = { class: "flex flex-col" }, Ae = { c
|
|
|
223
223
|
optional: e.labelMark === "optional"
|
|
224
224
|
}, null, 8, ["label", "disabled", "required", "optional"])
|
|
225
225
|
]),
|
|
226
|
-
h(T, { focused:
|
|
226
|
+
h(T, { focused: Y.value }, {
|
|
227
227
|
default: F(() => [
|
|
228
228
|
u("div", Pe, [
|
|
229
229
|
G(e.$slots, "prepend"),
|
|
@@ -231,20 +231,20 @@ const Fe = { class: "flex flex-col" }, _e = { class: "flex flex-col" }, Ae = { c
|
|
|
231
231
|
u("div", Be, [
|
|
232
232
|
e.stepperOnly ? (d(), y("span", {
|
|
233
233
|
key: 0,
|
|
234
|
-
class:
|
|
234
|
+
class: $({
|
|
235
235
|
"fm-text-field--input fm-typo-en-body-lg-400": !0,
|
|
236
236
|
"text-fm-color-typo-primary": !P.value,
|
|
237
237
|
"text-fm-color-typo-disabled": P.value
|
|
238
238
|
})
|
|
239
|
-
},
|
|
239
|
+
}, A(p.value), 3)) : re((d(), y("input", {
|
|
240
240
|
key: 1,
|
|
241
241
|
type: "text",
|
|
242
242
|
ref_key: "inputRef",
|
|
243
|
-
ref:
|
|
243
|
+
ref: X,
|
|
244
244
|
onFocus: n[0] || (n[0] = () => S.value = !0),
|
|
245
245
|
onBlur: n[1] || (n[1] = () => S.value = !1),
|
|
246
246
|
"onUpdate:modelValue": n[2] || (n[2] = (m) => p.value = m),
|
|
247
|
-
class:
|
|
247
|
+
class: $({
|
|
248
248
|
"fm-text-field--input fm-typo-en-body-lg-400": !0,
|
|
249
249
|
"text-fm-color-typo-primary": !P.value,
|
|
250
250
|
"text-fm-color-typo-disabled": P.value
|
|
@@ -253,24 +253,24 @@ const Fe = { class: "flex flex-col" }, _e = { class: "flex flex-col" }, Ae = { c
|
|
|
253
253
|
[me, p.value]
|
|
254
254
|
])
|
|
255
255
|
]),
|
|
256
|
-
e.separator ? (d(), y("div", Ie,
|
|
256
|
+
e.separator ? (d(), y("div", Ie, A(e.separator), 1)) : I("", !0),
|
|
257
257
|
u("div", {
|
|
258
|
-
class:
|
|
258
|
+
class: $([e.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-secondary"])
|
|
259
259
|
}, [
|
|
260
260
|
h(g, { "z-index": 51 }, {
|
|
261
261
|
content: F(() => [
|
|
262
|
-
ce(
|
|
262
|
+
ce(A(V.value), 1)
|
|
263
263
|
]),
|
|
264
264
|
default: F(() => [
|
|
265
265
|
e.disableUnit ? (d(), y("div", Ue, [
|
|
266
|
-
q.value ? I("", !0) : (d(), U(
|
|
266
|
+
q.value ? I("", !0) : (d(), U(a, {
|
|
267
267
|
key: 0,
|
|
268
268
|
name: "square_foot"
|
|
269
269
|
})),
|
|
270
|
-
u("div", De,
|
|
270
|
+
u("div", De, A(V.value), 1)
|
|
271
271
|
])) : (d(), U(r, {
|
|
272
272
|
key: 1,
|
|
273
|
-
onMenuChanged: n[3] || (n[3] = (m) =>
|
|
273
|
+
onMenuChanged: n[3] || (n[3] = (m) => O.value = m),
|
|
274
274
|
"z-index": 500,
|
|
275
275
|
placement: e.placement,
|
|
276
276
|
disabled: e.disabled
|
|
@@ -278,13 +278,13 @@ const Fe = { class: "flex flex-col" }, _e = { class: "flex flex-col" }, Ae = { c
|
|
|
278
278
|
"menu-button": F(() => [
|
|
279
279
|
u("div", Re, [
|
|
280
280
|
u("div", we, [
|
|
281
|
-
q.value ? I("", !0) : (d(), U(
|
|
281
|
+
q.value ? I("", !0) : (d(), U(a, {
|
|
282
282
|
key: 0,
|
|
283
283
|
name: "square_foot"
|
|
284
284
|
})),
|
|
285
|
-
u("div", Ce,
|
|
285
|
+
u("div", Ce, A(V.value), 1)
|
|
286
286
|
]),
|
|
287
|
-
h(
|
|
287
|
+
h(a, { name: "keyboard_arrow_down" })
|
|
288
288
|
])
|
|
289
289
|
]),
|
|
290
290
|
default: F(() => [
|
|
@@ -310,7 +310,7 @@ const Fe = { class: "flex flex-col" }, _e = { class: "flex flex-col" }, Ae = { c
|
|
|
310
310
|
onClick: oe
|
|
311
311
|
}, [
|
|
312
312
|
u("div", Ve, [
|
|
313
|
-
h(
|
|
313
|
+
h(a, {
|
|
314
314
|
name: "expand_less",
|
|
315
315
|
size: "md"
|
|
316
316
|
})
|
|
@@ -321,7 +321,7 @@ const Fe = { class: "flex flex-col" }, _e = { class: "flex flex-col" }, Ae = { c
|
|
|
321
321
|
onClick: se
|
|
322
322
|
}, [
|
|
323
323
|
u("div", Te, [
|
|
324
|
-
h(
|
|
324
|
+
h(a, {
|
|
325
325
|
name: "expand_more",
|
|
326
326
|
size: "md"
|
|
327
327
|
})
|
|
@@ -348,10 +348,10 @@ const Fe = { class: "flex flex-col" }, _e = { class: "flex flex-col" }, Ae = { c
|
|
|
348
348
|
}
|
|
349
349
|
});
|
|
350
350
|
export {
|
|
351
|
-
|
|
351
|
+
Oe as F,
|
|
352
352
|
We as _,
|
|
353
353
|
qe as a,
|
|
354
354
|
ze as b,
|
|
355
|
-
|
|
355
|
+
J as c,
|
|
356
356
|
Z as d
|
|
357
357
|
};
|