@feedmepos/mf-inventory-portal 0.0.23-dev.31 → 0.0.23-dev.5

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.
Files changed (105) hide show
  1. package/dist/{App-CEmWJ9lp.js → App-FsTwD8n6.js} +73 -85
  2. package/dist/{ApprovalView-jDll4AVe.js → ApprovalView-BXPFwc54.js} +27 -24
  3. package/dist/{BindingsDialog-BC_gRSif.js → BindingsDialog-CHkMKliu.js} +4 -4
  4. package/dist/{BindingsPicker-BJsGoBzM.js → BindingsPicker-D12ragAp.js} +9 -8
  5. package/dist/{BindingsTable-DSdwNK_q.js → BindingsTable-COag_o6k.js} +22 -18
  6. package/dist/{ClosingTemplateView-BzG16gl5.js → ClosingTemplateView-D8jKBDLt.js} +286 -272
  7. package/dist/FmDroppableField-8RzKjEdL.js +154 -0
  8. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DW2IOPST.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BQtdWZI5.js} +23 -22
  9. package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-RNrM3eSt.js +436 -0
  10. package/dist/FmMultiselectDialog-BQVgChfN.js +415 -0
  11. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-DDuZEf_v.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DECE_vKa.js} +49 -48
  12. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-CiNvnaaE.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-BUy5XAra.js} +5 -5
  13. package/dist/{IngredientGroupView-DL8eBhkk.js → IngredientGroupView-C5W6TKVb.js} +69 -63
  14. package/dist/{IngredientsView-B_HC9fgq.js → IngredientsView-DS18EGAg.js} +253 -245
  15. package/dist/{IntegrationView-BeFT5S24.js → IntegrationView-BCXq5C_i.js} +95 -92
  16. package/dist/{InventoryBindingForm-DJ3uwq_X.js → InventoryBindingForm-D2oUHybU.js} +1 -1
  17. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-DIviTipZ.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-Do_WCGzA.js} +27 -25
  18. package/dist/{InventoryBindingSummary-CvB5j9xq.js → InventoryBindingSummary-CTzl--8n.js} +1 -1
  19. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CQPdnXEF.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CrdZrQaL.js} +1 -1
  20. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BdscwUGn.js → PremiumBadge.vue_vue_type_script_setup_true_lang-Ce01_vRB.js} +24 -23
  21. package/dist/{PurchaseOrderPrintPreview-3_6nBajH.js → PurchaseOrderPrintPreview-C_cUNqE4.js} +14 -13
  22. package/dist/{ReceiveRequestView-B_0UldQ7.js → ReceiveRequestView-iKUSCnjc.js} +1302 -1325
  23. package/dist/{RecipeView-D9p0Ou_I.js → RecipeView-9jSzsC2o.js} +85 -79
  24. package/dist/{StockView-TIdUgG3O.js → StockView-CkLx8c-q.js} +1446 -1338
  25. package/dist/{SupplierView-B1b9Otcr.js → SupplierView-zo_pVaja.js} +809 -2345
  26. package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js +135 -0
  27. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-DVkVNrNG.js +1209 -0
  28. package/dist/TransferTemplateView-CkJs2zmu.js +1261 -0
  29. package/dist/{UnitView-BrpzJ7D3.js → UnitView-DdUCn3QX.js} +44 -40
  30. package/dist/{WarehouseView-CjbdEy8o.js → WarehouseView-BSKKIUlu.js} +100 -94
  31. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  32. package/dist/api/closing.d.ts +0 -1
  33. package/dist/api/netsuite.d.ts +3 -3
  34. package/dist/app-CVmmRPWd.js +33496 -0
  35. package/dist/app.d.ts +0 -56
  36. package/dist/app.js +2 -2
  37. package/dist/components/FmMultiselectDialogProps.d.ts +0 -1
  38. package/dist/components/row-action.enum.d.ts +0 -1
  39. package/dist/composable/defineDeepModel.d.ts +1 -1
  40. package/dist/date2-B8or025L.js +117 -0
  41. package/dist/dayjs.min-CIK0S4n6.js +282 -0
  42. package/dist/{decimal-DHYZglKx.js → decimal-DnON7sYp.js} +1 -1
  43. package/dist/defineDeepModel-ZvHrR7G4.js +13 -0
  44. package/dist/{feature-G-NnqKcY.js → feature-CfLuWtSb.js} +1 -1
  45. package/dist/format-time-from-id-DgZIvkJL.js +15 -0
  46. package/dist/{format-unit-display-BWqJsV_R.js → format-unit-display-BL51mLWH.js} +171 -162
  47. package/dist/fuzzy-BrZpb26S.js +41 -0
  48. package/dist/index-20AY5LL4.js +10545 -0
  49. package/dist/index-BHBzUsyp.js +45 -0
  50. package/dist/index-Cgi2fvdH.js +22283 -0
  51. package/dist/netsuite-C6f_DtMT.js +224 -0
  52. package/dist/normalizeArguments-DP7Hrren.js +1552 -0
  53. package/dist/router/name.d.ts +0 -2
  54. package/dist/row-action.enum-PMKMRrZR.js +50 -0
  55. package/dist/rules-CyLD3MFT.js +199 -0
  56. package/dist/stores/integration/netsuite.d.ts +2 -3
  57. package/dist/stores/inventory.d.ts +4 -1
  58. package/dist/style.css +1 -1
  59. package/dist/{supplier-DTUUR48O.js → supplier-pYrSAyO6.js} +15 -15
  60. package/dist/tsconfig.app.tsbuildinfo +1 -1
  61. package/dist/{use-inventory-binding-dialog-DvC_i-Ih.js → use-inventory-binding-dialog-BRfRiwVk.js} +11 -10
  62. package/dist/use-template-enabled-locations-2-BFm4_EuV.js +86 -0
  63. package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +192 -24
  64. package/dist/views/closing-template/composables/use-closing-template-table.d.ts +193 -25
  65. package/dist/views/receive-request/components/transfer-form/NetSuiteField.vue.d.ts +0 -2
  66. package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +0 -6
  67. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +0 -9
  68. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +0 -9
  69. package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +2 -2
  70. package/dist/views/stock/helper/compute-summary-total.d.ts +2 -2
  71. package/dist/xlsx-BFsAkixf.js +24004 -0
  72. package/dist/xlsx.util-ClkX4qFH.js +78 -0
  73. package/package.json +1 -1
  74. package/dist/ClosingDraftView-UfWdRXb-.js +0 -1190
  75. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-jUYB4L8Y.js +0 -1275
  76. package/dist/TransferTemplateView-Dxk5b-2j.js +0 -1264
  77. package/dist/api/adjustment-template.d.ts +0 -23
  78. package/dist/api/closing-draft.d.ts +0 -6
  79. package/dist/app-AcMtTQ07.js +0 -84202
  80. package/dist/index-Bt8vaUdT.js +0 -12087
  81. package/dist/stock-VZXyPw2C.js +0 -125
  82. package/dist/views/adjustment-template/import/AdjustmentTemplateImport.vue.d.ts +0 -2
  83. package/dist/views/adjustment-template/import/AdjustmentTemplateImportItem.vue.d.ts +0 -18
  84. package/dist/views/adjustment-template/import/export.d.ts +0 -60
  85. package/dist/views/adjustment-template/wastage-template/WastageTemplateDetails.vue.d.ts +0 -2
  86. package/dist/views/adjustment-template/wastage-template/WastageTemplateDialog.vue.d.ts +0 -22
  87. package/dist/views/adjustment-template/wastage-template/WastageTemplatePublish.vue.d.ts +0 -6
  88. package/dist/views/adjustment-template/wastage-template/WastageTemplateView.vue.d.ts +0 -2
  89. package/dist/views/adjustment-template/wastage-template/actions.d.ts +0 -1295
  90. package/dist/views/adjustment-template/wastage-template/form/WastageTemplateForm.vue.d.ts +0 -16
  91. package/dist/views/adjustment-template/wastage-template/form/WastageTemplateItemTable.vue.d.ts +0 -35
  92. package/dist/views/adjustment-template/wastage-template/form/useAdjustmentTemplateItems.d.ts +0 -20
  93. package/dist/views/adjustment-template/wastage-template/props.d.ts +0 -29
  94. package/dist/views/adjustment-template/wastage-template/table.d.ts +0 -1273
  95. package/dist/views/closing-draft/ClosingDraftView.vue.d.ts +0 -2
  96. package/dist/views/closing-draft/components/closing-draft-action/ClosingDraftAction.vue.d.ts +0 -22
  97. package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +0 -621
  98. package/dist/views/closing-draft/composables/use-closing-draft-actions.d.ts +0 -25
  99. package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +0 -3621
  100. package/dist/views/closing-draft/helpers/draft-status-to-class-name.helper.d.ts +0 -1
  101. package/dist/views/closing-draft/helpers/export-draft.helper.d.ts +0 -19
  102. package/dist/views/closing-draft/helpers/get-calculated-total.helper.d.ts +0 -4
  103. package/dist/views/receive-request/components/netsuite/NetSuiteInfo.vue.d.ts +0 -12
  104. package/dist/views/receive-request/components/netsuite/NetSuiteProps.d.ts +0 -13
  105. package/dist/views/receive-request/components/netsuite/NetSuiteSync.vue.d.ts +0 -12
@@ -0,0 +1,415 @@
1
+ import { defineComponent as oe, computed as _, ref as C, watch as ne, openBlock as d, createElementBlock as v, normalizeStyle as A, Fragment as S, renderList as D, renderSlot as fe, createCommentVNode as M, onMounted as be, reactive as q, resolveComponent as w, createElementVNode as V, createVNode as c, toDisplayString as K, unref as B, createSlots as ye, withCtx as y, createBlock as L, normalizeClass as te, withModifiers as he, Transition as ge } from "vue";
2
+ import { useDialogChild as ke, useSnackbar as _e } from "@feedmepos/ui-library";
3
+ import { z as m } from "./app-CVmmRPWd.js";
4
+ import { f as xe } from "./fuzzy-BrZpb26S.js";
5
+ import { d as Fe } from "./index-BHBzUsyp.js";
6
+ /* empty css */
7
+ import { useI18n as we } from "@feedmepos/mf-common";
8
+ import { _ as Ce } from "./_plugin-vue_export-helper-CHgC5LLL.js";
9
+ const Se = /* @__PURE__ */ oe({
10
+ __name: "VirtualScroll",
11
+ props: {
12
+ itemHeight: {},
13
+ length: {},
14
+ scrollTop: {},
15
+ prerender: {}
16
+ },
17
+ emits: ["changed:minHeight"],
18
+ setup(U, { emit: E }) {
19
+ const p = U, $ = E, u = _(() => {
20
+ const r = p.itemHeight * p.length;
21
+ return $("changed:minHeight", r), `${r}px`;
22
+ }), H = C(0), n = _(
23
+ () => Array.from({ length: p.prerender }).map((r, s) => s + H.value)
24
+ );
25
+ function P() {
26
+ H.value = Math.floor(p.scrollTop / p.itemHeight) - Math.floor(p.prerender / 2);
27
+ }
28
+ const h = C(Fe(P, 10));
29
+ ne([() => p.scrollTop], () => {
30
+ h.value();
31
+ });
32
+ function g(r) {
33
+ const s = r.el;
34
+ s && (s.style.opacity = "0", setTimeout(() => {
35
+ s.style.opacity = "1";
36
+ }, 0));
37
+ }
38
+ return (r, s) => (d(), v("div", {
39
+ class: "relative",
40
+ style: A({ minHeight: u.value })
41
+ }, [
42
+ (d(!0), v(S, null, D(n.value, (f) => (d(), v(S, { key: f }, [
43
+ f >= 0 && f < r.length ? (d(), v("div", {
44
+ key: 0,
45
+ class: "absolute w-full left-0 bg-white",
46
+ style: A({
47
+ top: `${r.itemHeight * f}px`,
48
+ height: `${r.itemHeight}px`,
49
+ transition: "opacity 0.5s ease"
50
+ }),
51
+ onVnodeMounted: g
52
+ }, [
53
+ fe(r.$slots, "default", {
54
+ key: f,
55
+ index: f,
56
+ getItem: (x) => x[f]
57
+ })
58
+ ], 4)) : M("", !0)
59
+ ], 64))), 128))
60
+ ], 4));
61
+ }
62
+ }), Ve = { class: "flex justify-between items-center sticky top-0 bg-white z-50" }, Te = {
63
+ key: 0,
64
+ class: "h-12 bg-white absolute top-[-12px] left-[-24px] w-lvw z-50",
65
+ style: { "max-width": "min(100vw - 48px, 560px)" }
66
+ }, Be = { class: "flex gap-16 basis-1/2" }, Ae = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, $e = {
67
+ key: 0,
68
+ class: "flex items-center gap-8 justify-center py-32"
69
+ }, He = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, Ie = {
70
+ key: 2,
71
+ class: "p-16 text-fm-color-typo-disabled fm-typo-en-body-lg-400 text-center"
72
+ }, ze = /* @__PURE__ */ oe({
73
+ __name: "FmMultiselectDialog",
74
+ props: {
75
+ modelValue: {},
76
+ items: {},
77
+ groups: {},
78
+ singleSelect: { type: Boolean },
79
+ placeholder: {},
80
+ showValidBorder: { type: Boolean },
81
+ maxHeight: {},
82
+ width: {},
83
+ noShadow: { type: Boolean },
84
+ loading: { type: Boolean },
85
+ virtualScroll: { type: Boolean }
86
+ },
87
+ emits: ["update:modelValue"],
88
+ setup(U, { emit: E }) {
89
+ var Q, R, Y;
90
+ const { t: p } = we(), $ = ke(), u = U, H = E, n = C(u.modelValue ?? []), P = _e();
91
+ be(() => {
92
+ var l, a, o, b;
93
+ $.emitData(n.value);
94
+ const e = (l = u.modelValue) != null && l.length ? u.items.findIndex((F) => {
95
+ var k;
96
+ return m(F.value, (k = u.modelValue) == null ? void 0 : k[0]);
97
+ }) : 0;
98
+ (a = z.value) == null || a.scrollTo({ top: e * 64 - 64, behavior: "smooth" }), (b = (o = O.value) == null ? void 0 : o.inputEl) == null || b.focus();
99
+ }), ne([() => n.value], ([e]) => {
100
+ $.emitData(e), H("update:modelValue", e);
101
+ });
102
+ function h(e) {
103
+ return !!n.value.find((l) => m(l, e));
104
+ }
105
+ function g(e, l) {
106
+ u.singleSelect && (n.value = l ? [] : [e]);
107
+ const a = h(e);
108
+ if (!(l && a || !l && !a))
109
+ if (l) {
110
+ const o = [...n.value, e];
111
+ n.value = o;
112
+ } else {
113
+ const o = n.value.filter((b) => !m(b, e));
114
+ n.value = o;
115
+ }
116
+ }
117
+ const r = C(""), s = _(() => {
118
+ const e = r.value.toLocaleLowerCase(), l = u.items;
119
+ return r.value ? xe.filter(e, l, {
120
+ pre: "|",
121
+ post: "|",
122
+ extract(o) {
123
+ return o.sublabel ? `${o.label}${o.sublabel}` : o.label;
124
+ }
125
+ }).map((o) => o.original).filter((o) => !o.disabled) : l;
126
+ }), f = _(
127
+ () => n.value.filter((e) => {
128
+ const l = u.items.find((a) => m(a.value, e));
129
+ return !(l != null && l.disabled) && s.value.find((a) => m(a.value, e));
130
+ })
131
+ ), x = _(() => f.value.filter((e) => !e.disabled).length === s.value.filter((e) => !e.disabled).length), W = _(() => f.value.length > 0 && !x.value);
132
+ function se() {
133
+ if (s.value.length > 100) {
134
+ P.open({
135
+ title: "Too many items to select",
136
+ message: "Please use the filter to narrow down your search options."
137
+ });
138
+ return;
139
+ }
140
+ x.value ? n.value = n.value.filter((e) => {
141
+ const l = u.items.find((a) => m(a.value, e));
142
+ return (l == null ? void 0 : l.disabled) && !s.value.find((a) => m(a.value, e));
143
+ }) : n.value = u.items.filter(
144
+ (e) => !e.disabled && (n.value.find((l) => m(l, e.value)) || s.value.find((l) => m(l.value, e.value)))
145
+ ).map((e) => e.value);
146
+ }
147
+ const ie = q(
148
+ ((Q = u.items) == null ? void 0 : Q.map((e) => ({ value: e.value, disabled: e.disabled ?? !1 }))) ?? []
149
+ );
150
+ function de(e, l) {
151
+ return e.reduce(
152
+ (a, o) => {
153
+ const b = l(o);
154
+ return a[b] || (a[b] = []), a[b].push(o), a;
155
+ },
156
+ {}
157
+ );
158
+ }
159
+ const ue = _(() => de(ie, (e) => {
160
+ var l;
161
+ return (l = e.value) == null ? void 0 : l._id;
162
+ })), re = q(
163
+ ((R = u.items) == null ? void 0 : R.map((e) => ({ value: e.value, collapsed: e.collapsed ?? !1 }))) ?? []
164
+ ), G = q(
165
+ ((Y = u.groups) == null ? void 0 : Y.reduce(
166
+ (e, l) => (e[l.id] = l.collapse ?? !1, e),
167
+ {}
168
+ )) ?? {}
169
+ );
170
+ function N({ groupId: e, value: l }) {
171
+ var a;
172
+ return e && G[e] || ((a = re.find((o) => m(o.value, l))) == null ? void 0 : a.collapsed);
173
+ }
174
+ function ce(e) {
175
+ G[e] = !G[e];
176
+ }
177
+ function j(e) {
178
+ return u.items.filter((l) => l.groupId === e).map((l) => l.value).every((l) => n.value.find((a) => m(a, l)));
179
+ }
180
+ function X(e) {
181
+ return !j(e) && u.items.filter((a) => a.groupId === e).map((a) => a.value).some((a) => n.value.find((o) => m(o, a)));
182
+ }
183
+ function ve(e) {
184
+ const l = u.items.filter((a) => a.groupId === e).map((a) => a.value);
185
+ if (j(e))
186
+ n.value = n.value.filter((a) => !l.find((o) => m(a, o)));
187
+ else if (X(e))
188
+ for (const a of l)
189
+ n.value.find((o) => m(o, a)) || (n.value = [...n.value, a]);
190
+ else
191
+ n.value = [...n.value, ...l];
192
+ }
193
+ const I = C(0);
194
+ function J(e) {
195
+ var l;
196
+ I.value = ((l = e.target) == null ? void 0 : l.scrollTop) ?? I;
197
+ }
198
+ const me = _(() => I.value > 100), z = C(), O = C();
199
+ return (e, l) => {
200
+ var ee, le;
201
+ const a = w("FmIcon"), o = w("FmTextField"), b = w("FmCircularProgress"), F = w("FmCheckbox"), k = w("FmListItem"), Z = w("FmButton"), pe = w("FmList");
202
+ return d(), v("div", {
203
+ class: "relative max-h-[380px] overflow-y-auto overflow-x-hidden",
204
+ onScroll: J,
205
+ onScrollend: J,
206
+ ref_key: "scrollable",
207
+ ref: z
208
+ }, [
209
+ V("div", Ve, [
210
+ e.noShadow ? M("", !0) : (d(), v("div", Te)),
211
+ V("div", Be, [
212
+ c(a, { name: "autorenew" }),
213
+ V("span", Ae, K(B(p)("inventory.formField.itemsSelected", { count: ((ee = n.value) == null ? void 0 : ee.length) ?? 0 })), 1)
214
+ ]),
215
+ c(o, {
216
+ class: "basis-1/2",
217
+ modelValue: r.value,
218
+ "onUpdate:modelValue": l[1] || (l[1] = (t) => r.value = t),
219
+ "prepend-icon": "search",
220
+ placeholder: e.placeholder,
221
+ ref_key: "searchTextField",
222
+ ref: O
223
+ }, ye({ _: 2 }, [
224
+ r.value.length ? {
225
+ name: "append",
226
+ fn: y(() => [
227
+ c(a, {
228
+ class: "cursor-pointer",
229
+ name: "close",
230
+ onClick: l[0] || (l[0] = (t) => r.value = "")
231
+ })
232
+ ]),
233
+ key: "0"
234
+ } : void 0
235
+ ]), 1032, ["modelValue", "placeholder"])
236
+ ]),
237
+ V("div", null, [
238
+ e.loading ? (d(), v("div", $e, [
239
+ c(b, {
240
+ size: "md",
241
+ color: "neutral-gray-400"
242
+ }),
243
+ V("div", He, K(B(p)("inventory.formField.loading")), 1)
244
+ ])) : s.value.length ? (d(), L(pe, { key: 1 }, {
245
+ default: y(() => [
246
+ e.singleSelect ? M("", !0) : (d(), L(k, {
247
+ key: 0,
248
+ "model-value": x.value,
249
+ indeterminate: W.value,
250
+ value: "",
251
+ onClick: l[2] || (l[2] = (t) => se())
252
+ }, {
253
+ prepend: y(() => [
254
+ c(F, {
255
+ "model-value": x.value,
256
+ indeterminate: W.value,
257
+ label: x.value ? B(p)("inventory.formField.select.removeAll") : B(p)("inventory.formField.select.selectAll"),
258
+ value: ""
259
+ }, null, 8, ["model-value", "indeterminate", "label"])
260
+ ]),
261
+ _: 1
262
+ }, 8, ["model-value", "indeterminate"])),
263
+ e.groups ? (d(!0), v(S, { key: 2 }, D(e.groups, (t) => (d(), v(S, {
264
+ key: t.id
265
+ }, [
266
+ c(k, {
267
+ label: t.label,
268
+ sublabel: t.sublabel,
269
+ style: { "padding-top": "4px", "padding-bottom": "4px", "padding-left": "32px" },
270
+ disabled: t.disabled
271
+ }, {
272
+ prepend: y(() => [
273
+ c(F, {
274
+ "model-value": j(t.id),
275
+ indeterminate: X(t.id),
276
+ onClick: () => ve(t.id),
277
+ value: t.id,
278
+ disabled: t.disabled
279
+ }, null, 8, ["model-value", "indeterminate", "onClick", "value", "disabled"])
280
+ ]),
281
+ append: y(() => [
282
+ c(Z, {
283
+ "prepend-icon": N({ groupId: t.id }) ? "expand_less" : "expand_more",
284
+ size: "md",
285
+ variant: "tertiary",
286
+ onClick: he(() => ce(t.id), ["stop"])
287
+ }, null, 8, ["prepend-icon", "onClick"])
288
+ ]),
289
+ _: 2
290
+ }, 1032, ["label", "sublabel", "disabled"]),
291
+ (d(!0), v(S, null, D(s.value.filter((i) => i.groupId === t.id), (i) => (d(), v("div", {
292
+ key: i.value,
293
+ class: te([
294
+ "transition-all overflow-y-clip",
295
+ N({ groupId: t.id, value: i.value }) ? "max-h-0 opacity-0" : "max-h-[64px] opacity-100"
296
+ ])
297
+ }, [
298
+ c(k, {
299
+ label: i.label,
300
+ sublabel: i.sublabel,
301
+ disabled: i.disabled,
302
+ onClick: (T) => g(i.value, !h(i.value)),
303
+ style: { "padding-top": "4px", "padding-bottom": "4px", "padding-left": "64px" }
304
+ }, {
305
+ prepend: y(() => [
306
+ c(F, {
307
+ "model-value": h(i.value),
308
+ "onUpdate:modelValue": (T) => g(i.value, T),
309
+ value: i.value,
310
+ disabled: i.disabled
311
+ }, null, 8, ["model-value", "onUpdate:modelValue", "value", "disabled"])
312
+ ]),
313
+ _: 2
314
+ }, 1032, ["label", "sublabel", "disabled", "onClick"])
315
+ ], 2))), 128))
316
+ ], 64))), 128)) : (d(), v(S, { key: 1 }, [
317
+ e.virtualScroll ? (d(), L(Se, {
318
+ key: 0,
319
+ length: s.value.length,
320
+ "item-height": 64,
321
+ scrollTop: I.value,
322
+ prerender: 100
323
+ }, {
324
+ default: y(({ getItem: t }) => {
325
+ var i, T;
326
+ return [
327
+ c(k, {
328
+ label: t(s.value).label,
329
+ sublabel: t(s.value).sublabel,
330
+ onClick: (ae) => g(
331
+ t(s.value).value,
332
+ !h(t(s.value).value)
333
+ ),
334
+ disabled: (T = ue.value[(i = t(s.value).value) == null ? void 0 : i._id][0]) == null ? void 0 : T.disabled,
335
+ style: A({
336
+ paddingTop: 4,
337
+ paddingBottom: 4,
338
+ paddingLeft: e.singleSelect === !0 ? 12 : 32
339
+ })
340
+ }, {
341
+ prepend: y(() => [
342
+ c(F, {
343
+ "model-value": h(t(s.value).value),
344
+ "onUpdate:modelValue": (ae) => g(t(s.value).value, ae),
345
+ value: t(s.value).value,
346
+ disabled: t(s.value).disabled
347
+ }, null, 8, ["model-value", "onUpdate:modelValue", "value", "disabled"])
348
+ ]),
349
+ _: 2
350
+ }, 1032, ["label", "sublabel", "onClick", "disabled", "style"])
351
+ ];
352
+ }),
353
+ _: 1
354
+ }, 8, ["length", "scrollTop"])) : (d(!0), v(S, { key: 1 }, D(s.value, (t) => (d(), v("div", {
355
+ key: t.value,
356
+ class: te([
357
+ "transition-all overflow-y-clip",
358
+ N({ value: t.value }) ? "max-h-0 opacity-0" : "max-h-[64px] opacity-100"
359
+ ])
360
+ }, [
361
+ c(k, {
362
+ label: t.label,
363
+ sublabel: t.sublabel,
364
+ onClick: (i) => g(t.value, !h(t.value)),
365
+ disabled: t.disabled,
366
+ style: A({
367
+ paddingTop: 4,
368
+ paddingBottom: 4,
369
+ paddingLeft: e.singleSelect === !0 ? 12 : 32
370
+ })
371
+ }, {
372
+ prepend: y(() => [
373
+ c(F, {
374
+ "model-value": h(t.value),
375
+ "onUpdate:modelValue": (i) => g(t.value, i),
376
+ value: t.value,
377
+ disabled: t.disabled
378
+ }, null, 8, ["model-value", "onUpdate:modelValue", "value", "disabled"])
379
+ ]),
380
+ _: 2
381
+ }, 1032, ["label", "sublabel", "onClick", "disabled", "style"])
382
+ ], 2))), 128))
383
+ ], 64))
384
+ ]),
385
+ _: 1
386
+ })) : (d(), v("div", Ie, K(B(p)("inventory.formField.noItemsFound")), 1))
387
+ ]),
388
+ V("div", {
389
+ class: "sticky bottom-24",
390
+ style: A({ transform: `translateX(${(((le = z.value) == null ? void 0 : le.clientWidth) ?? 0) - 80}px)` })
391
+ }, [
392
+ c(ge, { name: "fade" }, {
393
+ default: y(() => [
394
+ me.value ? (d(), L(Z, {
395
+ key: 0,
396
+ variant: "fab",
397
+ class: "bg-white",
398
+ "text-color": "neutral-gray-400",
399
+ "prepend-icon": "keyboard_arrow_up",
400
+ onClick: l[3] || (l[3] = () => {
401
+ var t;
402
+ return (t = z.value) == null ? void 0 : t.scrollTo({ top: 0, behavior: "smooth" });
403
+ })
404
+ })) : M("", !0)
405
+ ]),
406
+ _: 1
407
+ })
408
+ ], 4)
409
+ ], 544);
410
+ };
411
+ }
412
+ }), je = /* @__PURE__ */ Ce(ze, [["__scopeId", "data-v-fa6c2f94"]]);
413
+ export {
414
+ je as F
415
+ };
@@ -1,5 +1,6 @@
1
- import { defineComponent as oe, mergeModels as $, useModel as se, computed as v, ref as P, watch as z, inject as ie, resolveComponent as b, openBlock as f, createElementBlock as y, createElementVNode as u, createVNode as M, withCtx as g, renderSlot as T, normalizeClass as V, toDisplayString as x, withDirectives as le, vModelText as ae, createCommentVNode as q, createTextVNode as ue, createBlock as W, Fragment as re, renderList as me } from "vue";
2
- import { Z as I, I as k, O as L, K as ce, i as h, aE as de, t as pe, J as fe, aj as ve, aC as be, aB as ye } from "./app-AcMtTQ07.js";
1
+ import { defineComponent as oe, mergeModels as O, useModel as se, computed as v, ref as P, watch as z, inject as ie, resolveComponent as b, openBlock as f, createElementBlock as y, createElementVNode as u, createVNode as M, withCtx as h, renderSlot as T, normalizeClass as V, toDisplayString as F, withDirectives as le, vModelText as ae, createCommentVNode as q, createTextVNode as ue, createBlock as W, Fragment as re, renderList as me } from "vue";
2
+ import { F as I } from "./index-Cgi2fvdH.js";
3
+ import { I as k, g as L, c as ce, a as g, m as de, t as pe, b as fe, p as ve, l as be, u as ye } from "./rules-CyLD3MFT.js";
3
4
  import "@feedmepos/ui-library";
4
5
  function E() {
5
6
  return {
@@ -11,12 +12,12 @@ function H() {
11
12
  return k()(d.amountAsString);
12
13
  };
13
14
  }
14
- function Se(l) {
15
+ function Ve(l) {
15
16
  return function(t) {
16
17
  return k()(t.amountAsString) !== !0 ? !0 : +t.amountAsString < l ? `Must be at least ${l}` : !0;
17
18
  };
18
19
  }
19
- function Ve(l) {
20
+ function Le(l) {
20
21
  return function(t) {
21
22
  return k()(t.amountAsString) !== !0 ? !0 : +t.amountAsString > l ? `Must be at most ${l}` : !0;
22
23
  };
@@ -26,20 +27,20 @@ function G(l, d = !1) {
26
27
  const s = H()(r);
27
28
  if (s != !0)
28
29
  return d ? s : !0;
29
- const F = typeof l == "number" ? l : L(l, r.modelValue.measurement);
30
- return ce(+r.amountAsString).precision > F ? `Cannot exceed precision more than ${h({
30
+ const x = typeof l == "number" ? l : L(l, r.modelValue.measurement);
31
+ return ce(+r.amountAsString).precision > x ? `Cannot exceed precision more than ${g({
31
32
  amount: 1,
32
- precision: F
33
+ precision: x
33
34
  })}` : !0;
34
35
  };
35
36
  }
36
- function Le(l) {
37
+ function $e(l) {
37
38
  const d = de(l);
38
39
  return function(r) {
39
40
  return d(r.modelValue.amount);
40
41
  };
41
42
  }
42
- const Me = { class: "flex flex-col" }, he = { class: "flex flex-col" }, ge = { class: "flex-1" }, xe = { class: "flex items-center gap-4" }, Fe = { class: "flex-1 flex gap-4" }, Ae = { class: "shrink-0 grow basis-2/5" }, _e = {
43
+ const Me = { class: "flex flex-col" }, ge = { class: "flex flex-col" }, he = { class: "flex-1" }, Fe = { class: "flex items-center gap-4" }, xe = { class: "flex-1 flex gap-4" }, Ae = { class: "shrink-0 grow basis-2/5" }, _e = {
43
44
  key: 0,
44
45
  class: "text-fm-color-typo-secondary"
45
46
  }, Pe = {
@@ -51,12 +52,12 @@ const Me = { class: "flex flex-col" }, he = { class: "flex flex-col" }, ge = { c
51
52
  }, Re = {
52
53
  class: "flex items-center",
53
54
  style: { "pointer-events": "none" }
54
- }, Ce = {
55
+ }, Ue = {
55
56
  class: "flex items-center",
56
57
  style: { "pointer-events": "none" }
57
58
  }, je = /* @__PURE__ */ oe({
58
59
  __name: "FmUnitInput",
59
- props: /* @__PURE__ */ $({
60
+ props: /* @__PURE__ */ O({
60
61
  modelValue: {},
61
62
  unit: {},
62
63
  rules: {},
@@ -103,27 +104,27 @@ const Me = { class: "flex flex-col" }, he = { class: "flex flex-col" }, ge = { c
103
104
  modelValue: {},
104
105
  modelModifiers: {}
105
106
  }),
106
- emits: /* @__PURE__ */ $(["update:amount", "update:measurement"], ["update:modelValue"]),
107
+ emits: /* @__PURE__ */ O(["update:amount", "update:measurement"], ["update:modelValue"]),
107
108
  setup(l, { emit: d }) {
108
- const t = l, r = d, s = se(l, "modelValue"), F = k(), B = v(() => {
109
+ const t = l, r = d, s = se(l, "modelValue"), x = k(), B = v(() => {
109
110
  var n;
110
111
  return L(t.unit, (n = s.value) == null ? void 0 : n.measurement);
111
112
  }), c = P((() => {
112
113
  var o;
113
114
  const e = ((o = s.value) == null ? void 0 : o.amount) ?? I.reset(), n = be(e), i = t.formatMinimumPrecision ?? n.precision, a = ye(n, i);
114
- return h(a);
115
+ return g(a);
115
116
  })());
116
117
  z(c, (e) => {
117
- const n = F(e), i = t.precision ?? B.value, o = typeof t.formatMinimumPrecision == "number" && t.formatMinimumPrecision > i ? t.formatMinimumPrecision : i;
118
+ const n = x(e), i = t.precision ?? B.value, o = typeof t.formatMinimumPrecision == "number" && t.formatMinimumPrecision > i ? t.formatMinimumPrecision : i;
118
119
  n == !0 && (s.value = {
119
120
  ...s.value,
120
121
  amount: pe(+e, o)
121
122
  }), r("update:amount", e);
122
123
  });
123
- const J = Symbol.for("fm:form-state"), D = ie(J, null), A = v(() => t.disabled ?? (D == null ? void 0 : D.getDisabled()) ?? !1), K = P(), R = P(!1), j = P(!1), Q = v(() => R.value || j.value), X = v(() => {
124
+ const J = Symbol.for("fm:form-state"), D = ie(J, null), A = v(() => t.disabled ?? (D == null ? void 0 : D.getDisabled()) ?? !1), K = P(), R = P(!1), $ = P(!1), Q = v(() => R.value || $.value), X = v(() => {
124
125
  var a;
125
- const i = [...t.unit.measurements.filter((o) => !o.name.toLocaleLowerCase().includes("inactive")).filter((o) => o.abbrev !== t.unit.abbrev || +h(o.conversion) != 1).groupBy(
126
- (o) => `${o.abbrev}${h(o.conversion)}`
126
+ const i = [...t.unit.measurements.filter((o) => !o.name.toLocaleLowerCase().includes("inactive")).filter((o) => o.abbrev !== t.unit.abbrev || +g(o.conversion) != 1).groupBy(
127
+ (o) => `${o.abbrev}${g(o.conversion)}`
127
128
  ).values()].map((o) => o[0]).flat();
128
129
  return [
129
130
  {
@@ -135,7 +136,7 @@ const Me = { class: "flex flex-col" }, he = { class: "flex flex-col" }, ge = { c
135
136
  value: o.id
136
137
  }))
137
138
  ];
138
- }), C = v({
139
+ }), U = v({
139
140
  get() {
140
141
  var e, n;
141
142
  return ((n = (e = s.value) == null ? void 0 : e.measurement) == null ? void 0 : n.id) ?? null;
@@ -155,7 +156,7 @@ const Me = { class: "flex flex-col" }, he = { class: "flex flex-col" }, ge = { c
155
156
  }
156
157
  }
157
158
  });
158
- z(C, (e, n) => {
159
+ z(U, (e, n) => {
159
160
  var m;
160
161
  if (!t.convertAmountOnChangeUnit)
161
162
  return;
@@ -163,9 +164,9 @@ const Me = { class: "flex flex-col" }, he = { class: "flex flex-col" }, ge = { c
163
164
  value: w,
164
165
  precision: N
165
166
  });
166
- c.value = h(S);
167
+ c.value = g(S);
167
168
  });
168
- const U = v(() => {
169
+ const C = v(() => {
169
170
  var e, n;
170
171
  return ((n = (e = s.value) == null ? void 0 : e.measurement) == null ? void 0 : n.abbrev) ?? t.unit.abbrev;
171
172
  }), Y = v(
@@ -179,27 +180,27 @@ const Me = { class: "flex flex-col" }, he = { class: "flex flex-col" }, ge = { c
179
180
  H(),
180
181
  typeof t.precision == "number" ? G(t.precision) : G(t.unit)
181
182
  ] : [], ...Y.value]);
182
- function O(e) {
183
+ function j(e) {
183
184
  const n = t.precision ?? B.value, a = typeof t.formatMinimumPrecision == "number" && t.formatMinimumPrecision > n ? t.formatMinimumPrecision : n, o = e.toFixed(a), p = o.includes(".") ? o.replace(/0+$/, "") : o;
184
185
  return p.endsWith(".") ? p.slice(0, p.length - 1) : p;
185
186
  }
186
187
  function te() {
187
188
  if (!t.stepper)
188
189
  return;
189
- const e = +c.value + +h(t.stepper);
190
- c.value = O(e);
190
+ const e = +c.value + +g(t.stepper);
191
+ c.value = j(e);
191
192
  }
192
193
  function ne() {
193
194
  if (!t.stepper)
194
195
  return;
195
- const e = +c.value - +h(t.stepper);
196
- c.value = O(e);
196
+ const e = +c.value - +g(t.stepper);
197
+ c.value = j(e);
197
198
  }
198
199
  return (e, n) => {
199
200
  const i = b("FmLabel"), a = b("FmIcon"), o = b("FmMenuItem"), p = b("FmMenu"), w = b("FmTooltip"), N = b("FmField"), S = b("FmFormGroup");
200
201
  return f(), y("div", Me, [
201
- u("div", he, [
202
- u("div", ge, [
202
+ u("div", ge, [
203
+ u("div", he, [
203
204
  M(i, {
204
205
  label: e.label,
205
206
  disabled: e.disabled,
@@ -208,10 +209,10 @@ const Me = { class: "flex flex-col" }, he = { class: "flex flex-col" }, ge = { c
208
209
  }, null, 8, ["label", "disabled", "required", "optional"])
209
210
  ]),
210
211
  M(N, { focused: Q.value }, {
211
- default: g(() => [
212
- u("div", xe, [
212
+ default: h(() => [
213
+ u("div", Fe, [
213
214
  T(e.$slots, "prepend"),
214
- u("div", Fe, [
215
+ u("div", xe, [
215
216
  u("div", Ae, [
216
217
  e.stepperOnly ? (f(), y("span", {
217
218
  key: 0,
@@ -220,7 +221,7 @@ const Me = { class: "flex flex-col" }, he = { class: "flex flex-col" }, ge = { c
220
221
  "text-fm-color-typo-primary": !A.value,
221
222
  "text-fm-color-typo-disabled": A.value
222
223
  })
223
- }, x(c.value), 3)) : le((f(), y("input", {
224
+ }, F(c.value), 3)) : le((f(), y("input", {
224
225
  key: 1,
225
226
  type: "text",
226
227
  ref_key: "inputRef",
@@ -237,35 +238,35 @@ const Me = { class: "flex flex-col" }, he = { class: "flex flex-col" }, ge = { c
237
238
  [ae, c.value]
238
239
  ])
239
240
  ]),
240
- e.separator ? (f(), y("div", _e, x(e.separator), 1)) : q("", !0),
241
+ e.separator ? (f(), y("div", _e, F(e.separator), 1)) : q("", !0),
241
242
  u("div", {
242
243
  class: V([e.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-secondary"])
243
244
  }, [
244
245
  M(w, { "z-index": 51 }, {
245
- content: g(() => [
246
- ue(x(U.value), 1)
246
+ content: h(() => [
247
+ ue(F(C.value), 1)
247
248
  ]),
248
- default: g(() => [
249
- e.disableUnit ? (f(), y("div", Pe, x(U.value), 1)) : (f(), W(p, {
249
+ default: h(() => [
250
+ e.disableUnit ? (f(), y("div", Pe, F(C.value), 1)) : (f(), W(p, {
250
251
  key: 1,
251
- onMenuChanged: n[3] || (n[3] = (m) => j.value = m),
252
+ onMenuChanged: n[3] || (n[3] = (m) => $.value = m),
252
253
  "z-index": 500,
253
254
  placement: e.placement,
254
255
  disabled: e.disabled
255
256
  }, {
256
- "menu-button": g(() => [
257
+ "menu-button": h(() => [
257
258
  u("div", Ie, [
258
- u("div", ke, x(U.value), 1),
259
+ u("div", ke, F(C.value), 1),
259
260
  M(a, { name: "keyboard_arrow_down" })
260
261
  ])
261
262
  ]),
262
- default: g(() => [
263
+ default: h(() => [
263
264
  u("div", Be, [
264
265
  (f(!0), y(re, null, me(X.value, (m) => (f(), W(o, {
265
266
  key: m.value ?? void 0,
266
267
  label: m.label,
267
- "model-value": m.value == C.value,
268
- onClick: (_) => C.value = m.value
268
+ "model-value": m.value == U.value,
269
+ onClick: (_) => U.value = m.value
269
270
  }, null, 8, ["label", "model-value", "onClick"]))), 128))
270
271
  ])
271
272
  ]),
@@ -291,7 +292,7 @@ const Me = { class: "flex flex-col" }, he = { class: "flex flex-col" }, ge = { c
291
292
  class: "w-24 h-12 flex items-center justify-center fm-corner-radius-sm bg-fm-color-neutral-gray-100 hover:bg-fm-color-neutral-gray-200",
292
293
  onClick: ne
293
294
  }, [
294
- u("div", Ce, [
295
+ u("div", Ue, [
295
296
  M(a, {
296
297
  name: "expand_more",
297
298
  size: "md"
@@ -319,10 +320,10 @@ const Me = { class: "flex flex-col" }, he = { class: "flex flex-col" }, ge = { c
319
320
  }
320
321
  });
321
322
  export {
322
- Se as F,
323
+ Ve as F,
323
324
  je as _,
324
- Ve as a,
325
- Le as b,
325
+ Le as a,
326
+ $e as b,
326
327
  H as c,
327
328
  G as d
328
329
  };