@feedmepos/mf-inventory-portal 0.0.19-dev.1 → 0.0.19-dev.3
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-CS7NtcBA.js +120 -0
- package/dist/{BindingsDialog-DpC48bqK.js → BindingsDialog-BA2w-qkY.js} +5 -6
- package/dist/{BindingsPicker-BU52g6zk.js → BindingsPicker-wf7b30Bk.js} +6 -7
- package/dist/{BindingsTable-aIuFdScv.js → BindingsTable-mqqSPDbO.js} +4 -6
- package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CViUEhuw.js +272 -0
- package/dist/IngredientsView-BVX31o67.js +1750 -0
- package/dist/IntegrationView-DFdl_238.js +1172 -0
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BuyM580N.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BENFVQkL.js} +1 -1
- package/dist/{PurchaseOrderPrintPreview-EeKhENYH.js → PurchaseOrderPrintPreview-06PokYt4.js} +13 -13
- package/dist/ReceiveRequestView-ck-05Ly7.js +1394 -0
- package/dist/RecipeView-CiOb2lvU.js +572 -0
- package/dist/StockForecast.vue_vue_type_style_index_0_lang-KLXSWvo5.js +59 -0
- package/dist/StockView-5LkTxYI2.js +1876 -0
- package/dist/SupplierView-BAfC5Wcw.js +801 -0
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-qZDMkkIZ.js +1031 -0
- package/dist/UnitView-wsbXOcbf.js +638 -0
- package/dist/WarehouseView-DHhDNAk8.js +1050 -0
- package/dist/api/bill.d.ts +2 -2
- package/dist/app-DNCC20Aq.js +66729 -0
- package/dist/app.d.ts +1031 -0
- package/dist/app.js +5 -3
- package/dist/components/FmDroppableField.vue.d.ts +1 -1
- package/dist/{decimal-BAZuuTcd.js → decimal-DaXHxukU.js} +1 -1
- package/dist/{stock-estimate-CL4HShG8.js → id-to-date-XiomI6dP.js} +12 -13
- package/dist/{layout-BnTfCS_X.js → layout-DvgFrTEG.js} +14 -14
- package/dist/router/name.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/{supplier-CjAH8O1y.js → supplier-BepZrUgL.js} +3 -3
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/views/ingredients/composables/use-ingredient-form.d.ts +14 -2
- package/dist/views/ingredients/composables/use-ingredient-table.d.ts +1 -2
- package/dist/views/receive-request/components/transfer-form/SparkIcon.vue.d.ts +1 -1
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +12 -12
- package/dist/views/recipe/composables/use-recipe-form.d.ts +14 -2
- package/dist/views/recipe/composables/use-recipe-table.d.ts +1 -2
- package/dist/views/stock/components/StockRecordCard.vue.d.ts +1 -1
- package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +2 -2
- package/dist/views/stock/composables/use-stock-action.d.ts +26 -0
- package/dist/views/stock/composables/use-stock-table.d.ts +1 -8
- package/dist/views/stock/helper/compute-summary-total.d.ts +2 -2
- package/dist/views/unit/composables/use-unit-form.d.ts +14 -2
- package/dist/views/unit/composables/use-unit-table.d.ts +1 -2
- package/dist/{xlsx-vUzm_udV.js → xlsx-DaxqUL1h.js} +1 -1
- package/dist/xlsx.util-Dwiw0sTo.js +109 -0
- package/package.json +6 -5
- package/dist/ApprovalView-BTZwnKLf.js +0 -118
- package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DjgmtvXU.js +0 -268
- package/dist/FmMultiselectDialog.vue_vue_type_script_setup_true_lang-n09XXJZK.js +0 -143
- package/dist/FmUnitInput.vue_vue_type_script_setup_true_lang-B-19iYaK.js +0 -236
- package/dist/IngredientsView-DMyEGdik.js +0 -1767
- package/dist/IntegrationView-Dn_qL_vC.js +0 -1166
- package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-DGTLUrb9.js +0 -276
- package/dist/ReceiveRequestView-BOdgbFFM.js +0 -1394
- package/dist/RecipeView-B1aNLDIK.js +0 -573
- package/dist/StockForecast.vue_vue_type_style_index_0_lang-B5EK101t.js +0 -58
- package/dist/StockView-C_Ur_jTg.js +0 -1862
- package/dist/SupplierView-CXfOoHTr.js +0 -796
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-kjV5Eazv.js +0 -1028
- package/dist/UnitView-DHXfAsnq.js +0 -635
- package/dist/WarehouseView-DMwbxs1q.js +0 -1043
- package/dist/app-BkcO8oNJ.js +0 -66113
- package/dist/date2-Cvp5iJkI.js +0 -95
- package/dist/dayjs.min-D1_pOsO7.js +0 -282
- package/dist/fuzzy-0roCBvgC.js +0 -41
- package/dist/index-B_aEOJsR.js +0 -21515
- package/dist/number-DLj3W3RW.js +0 -97
- package/dist/rules-CCmXA0Yi.js +0 -85
- package/dist/use-inventory-binding-dialog-GkJOzE6V.js +0 -93
- package/dist/xlsx.util-B_bqymTM.js +0 -107
|
@@ -1,268 +0,0 @@
|
|
|
1
|
-
import { defineComponent as D, computed as b, resolveComponent as p, openBlock as t, createElementBlock as f, Fragment as k, createElementVNode as i, toDisplayString as M, renderList as $, createBlock as v, createCommentVNode as h, unref as y, createVNode as m, renderSlot as S, Teleport as P, ref as I, withCtx as C, watch as A, mergeModels as H, useModel as B } from "vue";
|
|
2
|
-
import { FmButtonVariant as U, useBreakpoints as Y } from "@feedmepos/ui-library";
|
|
3
|
-
import { f as z } from "./app-BkcO8oNJ.js";
|
|
4
|
-
import { c as L } from "./date2-Cvp5iJkI.js";
|
|
5
|
-
const Q = { class: "flex flex-col w-full bg-white h-full" }, j = { class: "flex items-center px-24 py-16 xs:p-12 sm:p-12 gap-4 h-[68px]" }, E = { class: "flex-1 fm-typo-en-title-md-800 flex items-center h-[36px] bg-white" }, W = { key: 0 }, q = { key: 1 }, G = { class: "bg-white flex-1" }, J = { class: "fixed bottom-96 right-16" }, ve = /* @__PURE__ */ D({
|
|
6
|
-
__name: "SingleColumnLayout",
|
|
7
|
-
props: {
|
|
8
|
-
actions: { default: () => [] },
|
|
9
|
-
title: { default: "Title" },
|
|
10
|
-
description: {},
|
|
11
|
-
showBackButton: { type: Boolean },
|
|
12
|
-
defaultPadding: { type: Boolean },
|
|
13
|
-
breadcrumbs: { default: () => [] }
|
|
14
|
-
},
|
|
15
|
-
emits: ["click:action"],
|
|
16
|
-
setup(r, { emit: o }) {
|
|
17
|
-
const a = r, n = o, l = b(() => a.actions.find((e) => e.isPrimary)), u = b(
|
|
18
|
-
() => a.actions.filter((e) => !e.isPrimary).map((e) => ({ ...e, variant: e.variant ?? U.Tertiary }))
|
|
19
|
-
), { breakpoints: s } = Y();
|
|
20
|
-
return (e, d) => {
|
|
21
|
-
const g = p("FmButton");
|
|
22
|
-
return t(), f(k, null, [
|
|
23
|
-
i("div", Q, [
|
|
24
|
-
i("div", j, [
|
|
25
|
-
i("div", E, M(e.title), 1),
|
|
26
|
-
u.value.length ? (t(), f("div", W, [
|
|
27
|
-
(t(!0), f(k, null, $(u.value, (_) => (t(), v(g, {
|
|
28
|
-
key: _.value,
|
|
29
|
-
label: _.label,
|
|
30
|
-
"prepend-icon": _.prependIcon,
|
|
31
|
-
variant: _.variant,
|
|
32
|
-
onClick: (w) => n("click:action", _.value)
|
|
33
|
-
}, null, 8, ["label", "prepend-icon", "variant", "onClick"]))), 128))
|
|
34
|
-
])) : h("", !0),
|
|
35
|
-
l.value && (y(s).lg || y(s).md) ? (t(), f("div", q, [
|
|
36
|
-
m(g, {
|
|
37
|
-
label: l.value.label,
|
|
38
|
-
"prepend-icon": l.value.prependIcon,
|
|
39
|
-
onClick: d[0] || (d[0] = (_) => n("click:action", l.value.value))
|
|
40
|
-
}, null, 8, ["label", "prepend-icon"])
|
|
41
|
-
])) : h("", !0)
|
|
42
|
-
]),
|
|
43
|
-
i("div", G, [
|
|
44
|
-
S(e.$slots, "default")
|
|
45
|
-
])
|
|
46
|
-
]),
|
|
47
|
-
l.value && (y(s).sm || y(s).xs) ? (t(), v(P, {
|
|
48
|
-
key: 0,
|
|
49
|
-
to: "body"
|
|
50
|
-
}, [
|
|
51
|
-
i("div", J, [
|
|
52
|
-
m(g, {
|
|
53
|
-
label: l.value.label,
|
|
54
|
-
"prepend-icon": l.value.prependIcon,
|
|
55
|
-
onClick: d[1] || (d[1] = (_) => n("click:action", l.value.value)),
|
|
56
|
-
variant: "fab"
|
|
57
|
-
}, null, 8, ["label", "prepend-icon"])
|
|
58
|
-
])
|
|
59
|
-
])) : h("", !0)
|
|
60
|
-
], 64);
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
}), K = { class: "inline-flex" }, O = { class: "inline-flex rounded-md items-center gap-4 justify-center h-[30px] px-8 py-4 bg-fm-color-neutral-gray-100 cursor-pointer text-fm-color-neutral-gray-400" }, X = { class: "fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap" }, Z = {
|
|
64
|
-
class: "overflow-hidden overflow-y-scroll",
|
|
65
|
-
style: { maxHeight: "105px" }
|
|
66
|
-
}, ee = {
|
|
67
|
-
class: "overflow-hidden overflow-y-scroll",
|
|
68
|
-
style: { maxHeight: "105px" }
|
|
69
|
-
}, te = /* @__PURE__ */ D({
|
|
70
|
-
__name: "ChangeLocationComponent",
|
|
71
|
-
setup(r) {
|
|
72
|
-
const o = z(), a = I(""), n = b(
|
|
73
|
-
() => o.locations.map((e) => ({ label: e.name, value: e.dbName, type: e.type })).filter(
|
|
74
|
-
(e) => a.value ? e.label.toLocaleLowerCase().includes(a.value.toLocaleLowerCase()) : !0
|
|
75
|
-
)
|
|
76
|
-
), l = b(
|
|
77
|
-
() => n.value.filter((e) => e.type === "restaurant")
|
|
78
|
-
), u = b(
|
|
79
|
-
() => n.value.filter((e) => e.type === "warehouse")
|
|
80
|
-
);
|
|
81
|
-
function s({ value: e }) {
|
|
82
|
-
o.selectLocation(o.locations.find((d) => d.dbName === e));
|
|
83
|
-
}
|
|
84
|
-
return (e, d) => {
|
|
85
|
-
const g = p("FmIcon"), _ = p("FmSearch"), w = p("FmMenuDivider"), R = p("FmMenuHeader"), F = p("FmMenuItem"), N = p("FmMenu");
|
|
86
|
-
return t(), f("div", K, [
|
|
87
|
-
m(N, { "close-on-click": !0 }, {
|
|
88
|
-
"menu-button": C(() => {
|
|
89
|
-
var c;
|
|
90
|
-
return [
|
|
91
|
-
i("div", O, [
|
|
92
|
-
m(g, {
|
|
93
|
-
name: "storefront",
|
|
94
|
-
size: "sm"
|
|
95
|
-
}),
|
|
96
|
-
i("div", X, M(((c = y(o)._currentLocation) == null ? void 0 : c.name) ?? "No location selected"), 1),
|
|
97
|
-
m(g, {
|
|
98
|
-
name: "expand_more",
|
|
99
|
-
size: "sm"
|
|
100
|
-
})
|
|
101
|
-
])
|
|
102
|
-
];
|
|
103
|
-
}),
|
|
104
|
-
default: C(() => [
|
|
105
|
-
m(_, {
|
|
106
|
-
"model-value": a.value,
|
|
107
|
-
"onUpdate:modelValue": d[0] || (d[0] = (c) => a.value = c),
|
|
108
|
-
class: "w-[200px]",
|
|
109
|
-
placeholder: "Filter result"
|
|
110
|
-
}, null, 8, ["model-value"]),
|
|
111
|
-
m(w),
|
|
112
|
-
m(R, { label: "Restaurant" }),
|
|
113
|
-
m(w),
|
|
114
|
-
i("div", Z, [
|
|
115
|
-
(t(!0), f(k, null, $(l.value, (c) => {
|
|
116
|
-
var x;
|
|
117
|
-
return t(), v(F, {
|
|
118
|
-
key: c.value,
|
|
119
|
-
"model-value": ((x = y(o)._currentLocation) == null ? void 0 : x.dbName) === c.value,
|
|
120
|
-
label: c.label,
|
|
121
|
-
onClick: (T) => s(c)
|
|
122
|
-
}, null, 8, ["model-value", "label", "onClick"]);
|
|
123
|
-
}), 128))
|
|
124
|
-
]),
|
|
125
|
-
l.value.length ? h("", !0) : (t(), v(F, {
|
|
126
|
-
key: 0,
|
|
127
|
-
disabled: "",
|
|
128
|
-
label: "No result found"
|
|
129
|
-
})),
|
|
130
|
-
m(R, { label: "Warehouse" }),
|
|
131
|
-
m(w),
|
|
132
|
-
i("div", ee, [
|
|
133
|
-
(t(!0), f(k, null, $(u.value, (c) => {
|
|
134
|
-
var x;
|
|
135
|
-
return t(), v(F, {
|
|
136
|
-
key: c.value,
|
|
137
|
-
"model-value": ((x = y(o)._currentLocation) == null ? void 0 : x.dbName) === c.value,
|
|
138
|
-
label: c.label,
|
|
139
|
-
onClick: (T) => s(c)
|
|
140
|
-
}, null, 8, ["model-value", "label", "onClick"]);
|
|
141
|
-
}), 128))
|
|
142
|
-
]),
|
|
143
|
-
u.value.length ? h("", !0) : (t(), v(F, {
|
|
144
|
-
key: 1,
|
|
145
|
-
disabled: "",
|
|
146
|
-
label: "No result found"
|
|
147
|
-
}))
|
|
148
|
-
]),
|
|
149
|
-
_: 1
|
|
150
|
-
})
|
|
151
|
-
]);
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
function fe() {
|
|
156
|
-
const r = /* @__PURE__ */ new Date();
|
|
157
|
-
return r.setDate(r.getDate() - 15), {
|
|
158
|
-
start: r,
|
|
159
|
-
end: /* @__PURE__ */ new Date()
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
|
-
function V(r = 15) {
|
|
163
|
-
const o = /* @__PURE__ */ new Date();
|
|
164
|
-
o.setDate(o.getDate() - r);
|
|
165
|
-
const a = o, n = /* @__PURE__ */ new Date();
|
|
166
|
-
return {
|
|
167
|
-
startDate: `${L(a)}`,
|
|
168
|
-
endDate: `${L(n)}`
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
|
-
const ne = { class: "inline-flex rounded-md items-center gap-4 justify-center h-[30px] px-8 py-4 bg-fm-color-neutral-gray-100 cursor-pointer text-fm-color-neutral-gray-400" }, oe = { class: "fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap" }, le = /* @__PURE__ */ D({
|
|
172
|
-
__name: "FmDateRangePickerChip",
|
|
173
|
-
props: {
|
|
174
|
-
modelValue: { default: (r) => r.modelValue ?? V() }
|
|
175
|
-
},
|
|
176
|
-
emits: ["update:modelValue"],
|
|
177
|
-
setup(r, { emit: o }) {
|
|
178
|
-
const a = o, n = I(V());
|
|
179
|
-
A(n, (u) => {
|
|
180
|
-
a("update:modelValue", u);
|
|
181
|
-
});
|
|
182
|
-
const l = b(() => {
|
|
183
|
-
const { startDate: u, endDate: s } = n.value;
|
|
184
|
-
return !u && !s ? "" : `${u} - ${s}`;
|
|
185
|
-
});
|
|
186
|
-
return (u, s) => {
|
|
187
|
-
const e = p("FmIcon"), d = p("FmDateRangePicker");
|
|
188
|
-
return t(), v(d, {
|
|
189
|
-
"show-predefined-range": "",
|
|
190
|
-
modelValue: n.value,
|
|
191
|
-
"onUpdate:modelValue": s[0] || (s[0] = (g) => n.value = g),
|
|
192
|
-
"start-label": "",
|
|
193
|
-
"end-label": ""
|
|
194
|
-
}, {
|
|
195
|
-
"trigger-button": C(() => [
|
|
196
|
-
i("div", ne, [
|
|
197
|
-
m(e, {
|
|
198
|
-
name: "calendar_month",
|
|
199
|
-
size: "sm"
|
|
200
|
-
}),
|
|
201
|
-
i("div", oe, M(l.value), 1)
|
|
202
|
-
])
|
|
203
|
-
]),
|
|
204
|
-
_: 1
|
|
205
|
-
}, 8, ["modelValue"]);
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
}), ae = { class: "xs:px-8 sm:px-8 flex gap-8 items-center xs:gap-4 xs:flex-col-reverse sm:gap-4 sm:flex-col-reverse h-48 sm:h-[unset] xs:h-[unset]" }, se = {
|
|
209
|
-
key: 0,
|
|
210
|
-
class: "xs:w-full sm:w-full flex gap-8 items-center"
|
|
211
|
-
}, re = { class: "flex-1 w-full flex items-center gap-4" }, ce = /* @__PURE__ */ i("div", { class: "flex-1 xs:hidden sm:hidden" }, null, -1), ie = { class: "w-full max-w-[343px] xs:max-w-[unset] sm:max-w-[unset]" }, _e = /* @__PURE__ */ D({
|
|
212
|
-
__name: "FmInventoryTableToolbar",
|
|
213
|
-
props: /* @__PURE__ */ H({
|
|
214
|
-
dateRangeQuery: { type: Boolean },
|
|
215
|
-
dateRange: {},
|
|
216
|
-
changeLocation: { type: Boolean },
|
|
217
|
-
searchable: { type: Boolean },
|
|
218
|
-
search: {},
|
|
219
|
-
actions: {}
|
|
220
|
-
}, {
|
|
221
|
-
search: {},
|
|
222
|
-
searchModifiers: {},
|
|
223
|
-
dateRange: {},
|
|
224
|
-
dateRangeModifiers: {}
|
|
225
|
-
}),
|
|
226
|
-
emits: ["update:search", "update:dateRange"],
|
|
227
|
-
setup(r) {
|
|
228
|
-
const o = B(r, "search"), a = B(r, "dateRange");
|
|
229
|
-
return (n, l) => {
|
|
230
|
-
const u = p("FmTextField"), s = p("FmButton");
|
|
231
|
-
return t(), f("div", ae, [
|
|
232
|
-
n.changeLocation || n.dateRangeQuery ? (t(), f("div", se, [
|
|
233
|
-
n.changeLocation ? (t(), v(te, { key: 0 })) : h("", !0),
|
|
234
|
-
n.dateRangeQuery ? (t(), v(le, {
|
|
235
|
-
key: 1,
|
|
236
|
-
"model-value": a.value,
|
|
237
|
-
"onUpdate:modelValue": l[0] || (l[0] = (e) => a.value = e)
|
|
238
|
-
}, null, 8, ["model-value"])) : h("", !0)
|
|
239
|
-
])) : h("", !0),
|
|
240
|
-
i("div", re, [
|
|
241
|
-
ce,
|
|
242
|
-
i("div", ie, [
|
|
243
|
-
n.searchable ? (t(), v(u, {
|
|
244
|
-
key: 0,
|
|
245
|
-
"model-value": o.value,
|
|
246
|
-
"onUpdate:modelValue": l[1] || (l[1] = (e) => o.value = e),
|
|
247
|
-
"prepend-icon": "search",
|
|
248
|
-
placeholder: "Filter items",
|
|
249
|
-
class: "w-full"
|
|
250
|
-
}, null, 8, ["model-value"])) : h("", !0)
|
|
251
|
-
]),
|
|
252
|
-
(t(!0), f(k, null, $(n.actions, (e, d) => (t(), v(s, {
|
|
253
|
-
key: d,
|
|
254
|
-
variant: "tertiary",
|
|
255
|
-
"prepend-icon": e.icon,
|
|
256
|
-
onClick: e.onClick
|
|
257
|
-
}, null, 8, ["prepend-icon", "onClick"]))), 128))
|
|
258
|
-
])
|
|
259
|
-
]);
|
|
260
|
-
};
|
|
261
|
-
}
|
|
262
|
-
});
|
|
263
|
-
export {
|
|
264
|
-
ve as _,
|
|
265
|
-
_e as a,
|
|
266
|
-
fe as b,
|
|
267
|
-
V as i
|
|
268
|
-
};
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import { defineComponent as $, ref as C, onMounted as N, watch as E, computed as f, resolveComponent as m, openBlock as v, createElementBlock as _, createElementVNode as s, createVNode as d, createTextVNode as M, toDisplayString as T, createSlots as U, withCtx as h, createBlock as I, Fragment as j, renderList as z } from "vue";
|
|
2
|
-
import { useDialogChild as q } from "@feedmepos/ui-library";
|
|
3
|
-
import { y as c } from "./app-BkcO8oNJ.js";
|
|
4
|
-
import { f as H } from "./fuzzy-0roCBvgC.js";
|
|
5
|
-
const R = { class: "flex flex-col h-[400px]" }, G = { class: "flex justify-between py-24 items-center relative" }, J = { class: "flex gap-16 basis-1/2" }, K = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, O = /* @__PURE__ */ s("span", { class: "xs:hidden" }, "selected", -1), P = /* @__PURE__ */ s("div", { class: "absolute pointer-events-none -bottom-[304px] left-0 w-full h-[308px] overflow-hidden flex flex-col justify-between" }, [
|
|
6
|
-
/* @__PURE__ */ s("div", { class: "h-1 fm-shadow-light-200" }),
|
|
7
|
-
/* @__PURE__ */ s("div", {
|
|
8
|
-
class: "h-1",
|
|
9
|
-
style: { "box-shadow": "0px -4px 8px 0px rgba(199, 199, 204, 0.24)" }
|
|
10
|
-
})
|
|
11
|
-
], -1), Q = { class: "h-[300px] overflow-y-auto" }, W = {
|
|
12
|
-
key: 1,
|
|
13
|
-
class: "p-16 text-fm-color-typo-disabled fm-typo-en-body-lg-400 text-center"
|
|
14
|
-
}, le = /* @__PURE__ */ $({
|
|
15
|
-
__name: "FmMultiselectDialog",
|
|
16
|
-
props: {
|
|
17
|
-
modelValue: {},
|
|
18
|
-
items: {},
|
|
19
|
-
multiselect: { type: Boolean },
|
|
20
|
-
placeholder: { default: "Filter selections" },
|
|
21
|
-
showValidBorder: { type: Boolean },
|
|
22
|
-
maxHeight: {},
|
|
23
|
-
width: {}
|
|
24
|
-
},
|
|
25
|
-
emits: ["update:modelValue"],
|
|
26
|
-
setup(L, { emit: B }) {
|
|
27
|
-
const y = q(), b = L, D = B, t = C(b.modelValue ?? []);
|
|
28
|
-
N(() => {
|
|
29
|
-
y.emitData(t.value);
|
|
30
|
-
}), E([() => t.value], ([l]) => {
|
|
31
|
-
y.emitData(l), D("update:modelValue", l);
|
|
32
|
-
});
|
|
33
|
-
function x(l) {
|
|
34
|
-
return !!t.value.find((e) => c(e, l));
|
|
35
|
-
}
|
|
36
|
-
function g(l, e) {
|
|
37
|
-
const i = x(l);
|
|
38
|
-
if (!(e && i || !e && !i))
|
|
39
|
-
if (e) {
|
|
40
|
-
const a = [...t.value, l];
|
|
41
|
-
t.value = a;
|
|
42
|
-
} else {
|
|
43
|
-
const a = t.value.filter((p) => !c(p, l));
|
|
44
|
-
t.value = a;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
const n = C(""), u = f(() => {
|
|
48
|
-
const l = n.value.toLocaleLowerCase(), e = b.items;
|
|
49
|
-
return n.value ? H.filter(l, e, {
|
|
50
|
-
pre: "|",
|
|
51
|
-
post: "|",
|
|
52
|
-
extract(a) {
|
|
53
|
-
return a.sublabel ? `${a.label}${a.sublabel}` : a.label;
|
|
54
|
-
}
|
|
55
|
-
}).map((a) => a.original) : e;
|
|
56
|
-
}), V = f(
|
|
57
|
-
() => t.value.filter((l) => u.value.find((e) => c(e.value, l)))
|
|
58
|
-
), r = f(() => V.value.length === u.value.length), F = f(() => V.value.length > 0 && !r.value);
|
|
59
|
-
function S() {
|
|
60
|
-
r.value ? t.value = t.value.filter(
|
|
61
|
-
(l) => !u.value.find((e) => c(e.value, l))
|
|
62
|
-
) : t.value = b.items.filter(
|
|
63
|
-
(l) => t.value.find((e) => c(e, l.value)) || u.value.find((e) => c(e.value, l.value))
|
|
64
|
-
).map((l) => l.value);
|
|
65
|
-
}
|
|
66
|
-
return (l, e) => {
|
|
67
|
-
const i = m("FmIcon"), a = m("FmTextField"), p = m("FmCheckbox"), k = m("FmListItem"), A = m("FmList");
|
|
68
|
-
return v(), _("div", R, [
|
|
69
|
-
s("div", G, [
|
|
70
|
-
s("div", J, [
|
|
71
|
-
d(i, { name: "autorenew" }),
|
|
72
|
-
s("span", K, [
|
|
73
|
-
M(T(t.value.length) + " item(s) ", 1),
|
|
74
|
-
O
|
|
75
|
-
])
|
|
76
|
-
]),
|
|
77
|
-
d(a, {
|
|
78
|
-
class: "basis-1/2",
|
|
79
|
-
modelValue: n.value,
|
|
80
|
-
"onUpdate:modelValue": e[1] || (e[1] = (o) => n.value = o),
|
|
81
|
-
"prepend-icon": "search",
|
|
82
|
-
placeholder: l.placeholder
|
|
83
|
-
}, U({ _: 2 }, [
|
|
84
|
-
n.value.length ? {
|
|
85
|
-
name: "append",
|
|
86
|
-
fn: h(() => [
|
|
87
|
-
d(i, {
|
|
88
|
-
class: "cursor-pointer",
|
|
89
|
-
name: "close",
|
|
90
|
-
onClick: e[0] || (e[0] = (o) => n.value = "")
|
|
91
|
-
})
|
|
92
|
-
]),
|
|
93
|
-
key: "0"
|
|
94
|
-
} : void 0
|
|
95
|
-
]), 1032, ["modelValue", "placeholder"]),
|
|
96
|
-
P
|
|
97
|
-
]),
|
|
98
|
-
s("div", Q, [
|
|
99
|
-
u.value.length ? (v(), I(A, { key: 0 }, {
|
|
100
|
-
default: h(() => [
|
|
101
|
-
d(k, {
|
|
102
|
-
"model-value": r.value,
|
|
103
|
-
indeterminate: F.value,
|
|
104
|
-
value: "",
|
|
105
|
-
onClick: e[2] || (e[2] = (o) => S())
|
|
106
|
-
}, {
|
|
107
|
-
prepend: h(() => [
|
|
108
|
-
d(p, {
|
|
109
|
-
"model-value": r.value,
|
|
110
|
-
indeterminate: F.value,
|
|
111
|
-
label: r.value ? "Remove all" : "Select all",
|
|
112
|
-
value: ""
|
|
113
|
-
}, null, 8, ["model-value", "indeterminate", "label"])
|
|
114
|
-
]),
|
|
115
|
-
_: 1
|
|
116
|
-
}, 8, ["model-value", "indeterminate"]),
|
|
117
|
-
(v(!0), _(j, null, z(u.value, (o) => (v(), I(k, {
|
|
118
|
-
key: o.value,
|
|
119
|
-
label: o.label,
|
|
120
|
-
sublabel: o.sublabel,
|
|
121
|
-
onClick: (w) => g(o.value, !x(o.value)),
|
|
122
|
-
style: { "padding-top": "4px", "padding-bottom": "4px", "padding-left": "32px" }
|
|
123
|
-
}, {
|
|
124
|
-
prepend: h(() => [
|
|
125
|
-
d(p, {
|
|
126
|
-
"model-value": x(o.value),
|
|
127
|
-
"onUpdate:modelValue": (w) => g(o.value, w),
|
|
128
|
-
value: o.value
|
|
129
|
-
}, null, 8, ["model-value", "onUpdate:modelValue", "value"])
|
|
130
|
-
]),
|
|
131
|
-
_: 2
|
|
132
|
-
}, 1032, ["label", "sublabel", "onClick"]))), 128))
|
|
133
|
-
]),
|
|
134
|
-
_: 1
|
|
135
|
-
})) : (v(), _("div", W, " No results found "))
|
|
136
|
-
])
|
|
137
|
-
]);
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
export {
|
|
142
|
-
le as _
|
|
143
|
-
};
|
|
@@ -1,236 +0,0 @@
|
|
|
1
|
-
import { defineComponent as Q, mergeModels as U, useModel as X, computed as m, ref as h, watch as j, inject as Y, resolveComponent as p, openBlock as M, createElementBlock as D, createElementVNode as i, createVNode as v, withCtx as R, renderSlot as L, withDirectives as ee, normalizeClass as te, vModelText as ne, toDisplayString as T, createCommentVNode as oe, Fragment as ae, renderList as ue, createBlock as le } from "vue";
|
|
2
|
-
import { F } from "./index-B_aEOJsR.js";
|
|
3
|
-
import { g as C, c as se, a as k, t as ie, b as re, k as me, l as ce, u as de } from "./number-DLj3W3RW.js";
|
|
4
|
-
import { I as w } from "./rules-CCmXA0Yi.js";
|
|
5
|
-
function $() {
|
|
6
|
-
return {
|
|
7
|
-
amount: F.reset()
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
function q() {
|
|
11
|
-
return function(d) {
|
|
12
|
-
return w()(d.amountAsString);
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
function _e(u) {
|
|
16
|
-
return function(n) {
|
|
17
|
-
return w()(n.amountAsString) !== !0 ? !0 : +n.amountAsString <= u ? `Must be more than ${u}` : !0;
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
function z(u, d = !1) {
|
|
21
|
-
return function(r) {
|
|
22
|
-
const o = q()(r);
|
|
23
|
-
if (o != !0)
|
|
24
|
-
return d ? o : !0;
|
|
25
|
-
const b = typeof u == "number" ? u : C(u, r.modelValue.measurement);
|
|
26
|
-
return se(+r.amountAsString).precision > b ? `Cannot exceed precision more than ${k({
|
|
27
|
-
amount: 1,
|
|
28
|
-
precision: b
|
|
29
|
-
})}` : !0;
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
const pe = { class: "flex flex-col" }, fe = { class: "flex flex-col" }, ve = { class: "flex-1" }, be = { class: "flex items-center gap-4" }, ye = { class: "flex-1" }, he = {
|
|
33
|
-
key: 0,
|
|
34
|
-
class: "text-fm-color-typo-secondary"
|
|
35
|
-
}, Me = { class: "text-fm-color-typo-secondary whitespace-nowrap" }, Fe = { class: "flex items-center gap-4" }, ge = { class: "max-w-[200px] flex flex-col gap-[1px]" }, Be = /* @__PURE__ */ Q({
|
|
36
|
-
__name: "FmUnitInput",
|
|
37
|
-
props: /* @__PURE__ */ U({
|
|
38
|
-
modelValue: {},
|
|
39
|
-
unit: {},
|
|
40
|
-
rules: {},
|
|
41
|
-
zIndex: {},
|
|
42
|
-
applyDefaultRules: { type: Boolean },
|
|
43
|
-
placement: {},
|
|
44
|
-
separator: {},
|
|
45
|
-
precision: {},
|
|
46
|
-
convertAmountOnChangeUnit: { type: Boolean },
|
|
47
|
-
formatMinimumPrecision: {},
|
|
48
|
-
placeholder: {},
|
|
49
|
-
minLength: {},
|
|
50
|
-
maxLength: {},
|
|
51
|
-
inputmode: {},
|
|
52
|
-
type: {},
|
|
53
|
-
readonly: { type: Boolean },
|
|
54
|
-
labelMark: {},
|
|
55
|
-
prependIcon: {},
|
|
56
|
-
appendIcon: {},
|
|
57
|
-
showValidBorder: { type: Boolean },
|
|
58
|
-
labelInfo: {},
|
|
59
|
-
showWordCount: { type: Boolean },
|
|
60
|
-
invalid: { type: Boolean },
|
|
61
|
-
autofocus: { type: Boolean },
|
|
62
|
-
formatter: { type: Function },
|
|
63
|
-
decimal: {},
|
|
64
|
-
datalist: {},
|
|
65
|
-
shiftDatalist: { type: Boolean },
|
|
66
|
-
datalistMaxHeight: {},
|
|
67
|
-
datalistMinHeight: {},
|
|
68
|
-
offsetDatalist: {},
|
|
69
|
-
datalistPlacement: {},
|
|
70
|
-
datalistZIndex: {},
|
|
71
|
-
datalistWidth: {},
|
|
72
|
-
label: {},
|
|
73
|
-
disabled: { type: Boolean },
|
|
74
|
-
focused: { type: Boolean },
|
|
75
|
-
helperText: {},
|
|
76
|
-
helperState: {}
|
|
77
|
-
}, {
|
|
78
|
-
modelValue: {},
|
|
79
|
-
modelModifiers: {}
|
|
80
|
-
}),
|
|
81
|
-
emits: /* @__PURE__ */ U(["update:amount", "update:measurement"], ["update:modelValue"]),
|
|
82
|
-
setup(u, { emit: d }) {
|
|
83
|
-
const n = u, r = d, o = X(u, "modelValue"), b = w(), N = m(() => {
|
|
84
|
-
var t;
|
|
85
|
-
return C(n.unit, (t = o.value) == null ? void 0 : t.measurement);
|
|
86
|
-
}), f = h((() => {
|
|
87
|
-
var l;
|
|
88
|
-
const e = ((l = o.value) == null ? void 0 : l.amount) ?? F.reset(), t = ce(e), a = n.formatMinimumPrecision ?? t.precision, c = de(t, a);
|
|
89
|
-
return k(c);
|
|
90
|
-
})());
|
|
91
|
-
j(f, (e) => {
|
|
92
|
-
const t = b(e), a = n.precision ?? N.value, l = typeof n.formatMinimumPrecision == "number" && n.formatMinimumPrecision > a ? n.formatMinimumPrecision : a;
|
|
93
|
-
t == !0 && (o.value = {
|
|
94
|
-
...o.value,
|
|
95
|
-
amount: ie(+e, l)
|
|
96
|
-
}), r("update:amount", e);
|
|
97
|
-
});
|
|
98
|
-
const E = Symbol.for("fm:form-state"), g = Y(E, null), S = m(() => n.disabled ?? (g == null ? void 0 : g.getDisabled()) ?? !1), G = h(), x = h(!1), V = h(!1), H = m(() => x.value || V.value), O = m(() => {
|
|
99
|
-
var e;
|
|
100
|
-
return [
|
|
101
|
-
{
|
|
102
|
-
label: (e = n.unit) == null ? void 0 : e.abbrev,
|
|
103
|
-
value: null
|
|
104
|
-
},
|
|
105
|
-
...n.unit.measurements.map((t) => ({
|
|
106
|
-
label: t.abbrev,
|
|
107
|
-
value: t.id
|
|
108
|
-
}))
|
|
109
|
-
];
|
|
110
|
-
}), A = m({
|
|
111
|
-
get() {
|
|
112
|
-
var e, t;
|
|
113
|
-
return ((t = (e = o.value) == null ? void 0 : e.measurement) == null ? void 0 : t.id) ?? null;
|
|
114
|
-
},
|
|
115
|
-
set(e) {
|
|
116
|
-
if (e == null)
|
|
117
|
-
o.value = {
|
|
118
|
-
...o.value ?? $(),
|
|
119
|
-
measurement: null
|
|
120
|
-
}, r("update:measurement", null);
|
|
121
|
-
else {
|
|
122
|
-
const t = n.unit.measurements.find((a) => a.id === e) ?? null;
|
|
123
|
-
o.value = {
|
|
124
|
-
...o.value ?? $(),
|
|
125
|
-
measurement: t
|
|
126
|
-
}, r("update:measurement", t);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
j(A, (e, t) => {
|
|
131
|
-
var _;
|
|
132
|
-
if (!n.convertAmountOnChangeUnit)
|
|
133
|
-
return;
|
|
134
|
-
const a = ((_ = o.value) == null ? void 0 : _.amount) ?? F.reset(), c = n.unit.measurements.find((B) => B.id === t) ?? null, l = n.unit.measurements.find((B) => B.id === e) ?? null, y = c ? re(a, c.conversion) : a, I = l ? me(y, l.conversion) : y, P = C(n.unit, l), s = F.convertPrecision({
|
|
135
|
-
value: I,
|
|
136
|
-
precision: P
|
|
137
|
-
});
|
|
138
|
-
f.value = k(s);
|
|
139
|
-
});
|
|
140
|
-
const Z = m(() => {
|
|
141
|
-
var e, t;
|
|
142
|
-
return ((t = (e = o.value) == null ? void 0 : e.measurement) == null ? void 0 : t.abbrev) ?? n.unit.abbrev;
|
|
143
|
-
}), J = m(
|
|
144
|
-
() => {
|
|
145
|
-
var e;
|
|
146
|
-
return ((e = n.rules) == null ? void 0 : e.map(
|
|
147
|
-
(t) => (a) => typeof t == "function" ? t(a) : t
|
|
148
|
-
)) ?? [];
|
|
149
|
-
}
|
|
150
|
-
), K = m(() => [...n.applyDefaultRules ? [
|
|
151
|
-
q(),
|
|
152
|
-
typeof n.precision == "number" ? z(n.precision) : z(n.unit)
|
|
153
|
-
] : [], ...J.value]);
|
|
154
|
-
return (e, t) => {
|
|
155
|
-
const a = p("FmLabel"), c = p("FmIcon"), l = p("FmMenuItem"), y = p("FmMenu"), I = p("FmField"), P = p("FmFormGroup");
|
|
156
|
-
return M(), D("div", pe, [
|
|
157
|
-
i("div", fe, [
|
|
158
|
-
i("div", ve, [
|
|
159
|
-
v(a, {
|
|
160
|
-
label: e.label,
|
|
161
|
-
disabled: e.disabled,
|
|
162
|
-
required: e.labelMark === "required",
|
|
163
|
-
optional: e.labelMark === "optional"
|
|
164
|
-
}, null, 8, ["label", "disabled", "required", "optional"])
|
|
165
|
-
]),
|
|
166
|
-
v(I, { focused: H.value }, {
|
|
167
|
-
default: R(() => [
|
|
168
|
-
i("div", be, [
|
|
169
|
-
L(e.$slots, "prepend"),
|
|
170
|
-
i("div", ye, [
|
|
171
|
-
ee(i("input", {
|
|
172
|
-
type: "text",
|
|
173
|
-
ref_key: "inputRef",
|
|
174
|
-
ref: G,
|
|
175
|
-
onFocus: t[0] || (t[0] = () => x.value = !0),
|
|
176
|
-
onBlur: t[1] || (t[1] = () => x.value = !1),
|
|
177
|
-
"onUpdate:modelValue": t[2] || (t[2] = (s) => f.value = s),
|
|
178
|
-
class: te({
|
|
179
|
-
"fm-text-field--input fm-typo-en-body-lg-400": !0,
|
|
180
|
-
"text-fm-color-typo-primary": !S.value,
|
|
181
|
-
"text-fm-color-typo-disabled": S.value
|
|
182
|
-
})
|
|
183
|
-
}, null, 34), [
|
|
184
|
-
[ne, f.value]
|
|
185
|
-
])
|
|
186
|
-
]),
|
|
187
|
-
e.separator ? (M(), D("div", he, T(e.separator), 1)) : oe("", !0),
|
|
188
|
-
i("div", Me, [
|
|
189
|
-
v(y, {
|
|
190
|
-
onMenuChanged: t[3] || (t[3] = (s) => V.value = s),
|
|
191
|
-
"z-index": 500,
|
|
192
|
-
placement: e.placement
|
|
193
|
-
}, {
|
|
194
|
-
"menu-button": R(() => [
|
|
195
|
-
i("div", Fe, [
|
|
196
|
-
i("div", null, T(Z.value), 1),
|
|
197
|
-
v(c, { name: "keyboard_arrow_down" })
|
|
198
|
-
])
|
|
199
|
-
]),
|
|
200
|
-
default: R(() => [
|
|
201
|
-
i("div", ge, [
|
|
202
|
-
(M(!0), D(ae, null, ue(O.value, (s) => (M(), le(l, {
|
|
203
|
-
key: s.value ?? void 0,
|
|
204
|
-
label: s.label,
|
|
205
|
-
"model-value": s.value == A.value,
|
|
206
|
-
onClick: (_) => A.value = s.value
|
|
207
|
-
}, null, 8, ["label", "model-value", "onClick"]))), 128))
|
|
208
|
-
])
|
|
209
|
-
]),
|
|
210
|
-
_: 1
|
|
211
|
-
}, 8, ["placement"])
|
|
212
|
-
]),
|
|
213
|
-
L(e.$slots, "append")
|
|
214
|
-
])
|
|
215
|
-
]),
|
|
216
|
-
_: 3
|
|
217
|
-
}, 8, ["focused"])
|
|
218
|
-
]),
|
|
219
|
-
v(P, {
|
|
220
|
-
class: "flex-1",
|
|
221
|
-
"model-value": { modelValue: o.value, amountAsString: String(f.value) },
|
|
222
|
-
info: e.labelInfo,
|
|
223
|
-
rules: K.value,
|
|
224
|
-
"helper-text": e.helperText,
|
|
225
|
-
"helper-state": e.helperState
|
|
226
|
-
}, null, 8, ["model-value", "info", "rules", "helper-text", "helper-state"])
|
|
227
|
-
]);
|
|
228
|
-
};
|
|
229
|
-
}
|
|
230
|
-
});
|
|
231
|
-
export {
|
|
232
|
-
_e as F,
|
|
233
|
-
Be as _,
|
|
234
|
-
q as a,
|
|
235
|
-
z as b
|
|
236
|
-
};
|