@feedmepos/mf-inventory-portal 0.0.25-dev.35 → 0.0.25-dev.37

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 (60) hide show
  1. package/dist/App-C0_9-oDP.js +277 -0
  2. package/dist/{ApprovalView-lHxxupqD.js → ApprovalView-BDUbQAH0.js} +12 -18
  3. package/dist/{BindingsDialog-BYXxxF3D.js → BindingsDialog-BvKDyWAP.js} +4 -4
  4. package/dist/{BindingsPicker-BiOmhG63.js → BindingsPicker-zAexcP3H.js} +5 -5
  5. package/dist/{BindingsTable-C2CG0Wzx.js → BindingsTable-6dPndhbk.js} +5 -5
  6. package/dist/{ClosingDraftView-BO8Fg9uW.js → ClosingDraftView-NwwxcHA-.js} +2 -2
  7. package/dist/{ClosingTemplateView-DmBvstOM.js → ClosingTemplateView-Cfh0BZXH.js} +2 -2
  8. package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DKxW0e2c.js +211 -0
  9. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-CQB9QYnf.js → FmUnitInput.vue_vue_type_script_setup_true_lang-CD0p0eOE.js} +1 -1
  10. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DditohRx.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-eGofs51J.js} +1 -1
  11. package/dist/{IngredientGroupView-D5SpwtqP.js → IngredientGroupView-Cz4zcWgF.js} +1 -1
  12. package/dist/{IngredientsView-Dgw0nCeT.js → IngredientsView-Ctmor1Ds.js} +622 -605
  13. package/dist/{IntegrationView-BPkBh8lR.js → IntegrationView-DYV2ISmc.js} +23 -23
  14. package/dist/{InventoryBindingForm-COpLVAaA.js → InventoryBindingForm-Be75Cpzd.js} +1 -1
  15. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-BkyQOb8e.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-D8dK7h0Z.js} +11 -11
  16. package/dist/{InventoryBindingSummary-D6lmFeFs.js → InventoryBindingSummary-Cw1Woc3L.js} +1 -1
  17. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BKzL_obr.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BhKk5nMz.js} +1 -1
  18. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-CRrDyI6N.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DECtXs-3.js} +1 -1
  19. package/dist/{PublishView-DRLVREhD.js → PublishView-D9mnP1d8.js} +11 -11
  20. package/dist/{PurchaseOrderPrintPreview-DvaJAeNk.js → PurchaseOrderPrintPreview-2DOgQczG.js} +1 -1
  21. package/dist/ReceiveRequestView-Ss803mII.js +2547 -0
  22. package/dist/{RecipeView-BFVpv5zA.js → RecipeView-DTwkk7M_.js} +3 -3
  23. package/dist/{StockView-BOzx7POz.js → StockView-cd047f5L.js} +7 -7
  24. package/dist/{SupplierView-DA3-b1sK.js → SupplierView-CkYiC3sV.js} +4 -4
  25. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-CE3vSlpG.js +1540 -0
  26. package/dist/{TransferTemplateView-V4C_flzB.js → TransferTemplateView-C6-6Db2r.js} +7 -7
  27. package/dist/{UnitView-CfQSRLN9.js → UnitView-C-1I-kVv.js} +3 -3
  28. package/dist/{WarehouseView-B5mEXts4.js → WarehouseView-CJTtNzco.js} +1 -1
  29. package/dist/api/purchase-order.d.ts +2 -2
  30. package/dist/{app-tDCjbNqA.js → app-C720GM9g.js} +6632 -6672
  31. package/dist/app.js +1 -1
  32. package/dist/components/FmMultiselectDialog.d.ts +1 -24
  33. package/dist/{decimal-BXNZd-qR.js → decimal-BCdHyq3s.js} +1 -1
  34. package/dist/{feature-RoIIaF13.js → feature-Df0TfAlQ.js} +227 -231
  35. package/dist/{format-unit-display-B2P_1U8-.js → format-unit-display-DhVGfJ3A.js} +2 -2
  36. package/dist/{index-0DbWAreR.js → index-BcO0U3XD.js} +2 -2
  37. package/dist/{stock-BkYwqicV.js → stock-AgQ9Kd12.js} +1 -1
  38. package/dist/stores/feature.d.ts +2 -3
  39. package/dist/{supplier-2qlZME6l.js → supplier-y6wN-U1P.js} +1 -1
  40. package/dist/tsconfig.app.tsbuildinfo +1 -1
  41. package/dist/{use-ingredient-select-dialog-D9bLhIPr.js → use-ingredient-select-dialog-DedAlRiZ.js} +1 -1
  42. package/dist/{use-inventory-binding-dialog-FprlSH51.js → use-inventory-binding-dialog-D6ESCCxB.js} +1 -1
  43. package/dist/views/receive-request/components/transfer-details/TransferDetails.vue.d.ts +0 -1375
  44. package/dist/views/receive-request/components/transfer-details/TransferDetailsProps.d.ts +1 -3
  45. package/dist/views/receive-request/components/transfer-dialog/TransferDialogProps.d.ts +0 -3
  46. package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +3022 -0
  47. package/dist/views/receive-request/components/transfer-form/TransferFormProps.d.ts +2 -1
  48. package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +1 -0
  49. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +9 -27
  50. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +9 -22
  51. package/dist/views/receive-request/helper/print-po.d.ts +2 -9
  52. package/dist/{vue-i18n-C2CwX0tc.js → vue-i18n-C4yPgaCz.js} +397 -397
  53. package/package.json +1 -1
  54. package/dist/App-DPw6U_NJ.js +0 -280
  55. package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CJ7BgFh6.js +0 -215
  56. package/dist/ReceiveRequestView-C9Hqtit6.js +0 -2661
  57. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-DRUroMZS.js +0 -1843
  58. package/dist/components/MountListener.vue.d.ts +0 -15
  59. package/dist/views/receive-request/helper/po-to-po-template.util.d.ts +0 -1
  60. package/dist/views/transfer-template/helpers/location-to-po-supplier.util.d.ts +0 -75
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-inventory-portal",
3
- "version": "0.0.25-dev.35",
3
+ "version": "0.0.25-dev.37",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -1,280 +0,0 @@
1
- import { ref as x, onUnmounted as M, defineComponent as h, watch as y, onMounted as U, computed as g, resolveComponent as R, openBlock as T, createElementBlock as P, unref as f, createVNode as S, createElementVNode as p, toDisplayString as L, createBlock as G, createCommentVNode as k } from "vue";
2
- import { u as D, a as H, b as W, R as e, g as a, c as K } from "./app-tDCjbNqA.js";
3
- import { useCoreStore as A, useI18n as B } from "@feedmepos/mf-common";
4
- import { useRouter as w, useRoute as $ } from "vue-router";
5
- import { u as O } from "./feature-RoIIaF13.js";
6
- import { u as Q } from "./useTabStorage-BkIVScW_.js";
7
- import { u as j } from "./googlemap-Dm8ERVai.js";
8
- import "./array-hChJVZLE.js";
9
- function q() {
10
- return {
11
- loadingHookInstalled: !1,
12
- isLoading: !1
13
- };
14
- }
15
- const _ = x(q());
16
- function z() {
17
- const i = w();
18
- if (!_.value.loadingHookInstalled) {
19
- _.value.loadingHookInstalled = !0;
20
- const o = i.beforeEach(() => {
21
- _.value.isLoading = !0;
22
- }), u = i.afterEach(() => {
23
- _.value.isLoading = !1;
24
- });
25
- M(() => {
26
- _.value.loadingHookInstalled = !1, o(), u();
27
- });
28
- }
29
- return {
30
- get isLoading() {
31
- return _.value.isLoading;
32
- }
33
- };
34
- }
35
- const J = {
36
- key: 0,
37
- class: "flex flex-col items-center w-full h-full gap-24"
38
- }, X = {
39
- key: 1,
40
- class: "flex flex-col pt-[200px] gap-32 items-center"
41
- }, Y = { class: "flex flex-col gap-12 items-center text-center px-24 max-w-[1000px]" }, Z = { class: "fm-typo-en-title-lg-600" }, ee = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, te = { class: "flex gap-16" }, oe = { href: "https://feedme.ai/product/inventory/features?tab=plans_%26_prices" }, ne = { href: "https://feedme.ai/form" }, re = /* @__PURE__ */ h({
42
- __name: "InventoryView",
43
- setup(i) {
44
- const o = D(), u = H(), c = W(), s = A(), m = w(), t = z(), b = O(), { t: d } = B();
45
- y(
46
- [() => s.sessionUser.value, () => s.currentBusiness.value],
47
- ([r, l]) => {
48
- E(r, l);
49
- }
50
- );
51
- const v = window.location.href.includes("/receive-request/print-preview");
52
- U(async () => {
53
- if (v) return;
54
- await b.init(), await s.readBusinesses();
55
- const r = s.sessionUser.value, l = s.currentBusiness.value;
56
- E(r, l);
57
- });
58
- function E(r, l) {
59
- !r || !l || N();
60
- }
61
- async function N() {
62
- return await o.init(), await c.readSetting().catch((r) => {
63
- console.error("error on reading netsuite store", r);
64
- }), await u.init();
65
- }
66
- const n = g(() => m.currentRoute.value.name === e.TRANSFER_TEMPLATE ? b.enablePoTemplate : !0);
67
- return (r, l) => {
68
- const I = R("FmSpacer"), V = R("FmCircularProgress"), C = R("FmButton"), F = R("RouterView");
69
- return T(), P("div", null, [
70
- f(t).isLoading ? (T(), P("div", J, [
71
- S(I),
72
- p("div", null, [
73
- S(V, { size: "xl" })
74
- ]),
75
- l[0] || (l[0] = p("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary pl-8" }, "Loading page...", -1)),
76
- S(I)
77
- ])) : n.value ? f(s).sessionUser.value || f(v) ? (T(), G(F, { key: 2 })) : k("", !0) : (T(), P("div", X, [
78
- p("div", Y, [
79
- p("div", Z, L(f(d)("inventory.common.proPlan.title")), 1),
80
- p("div", ee, L(f(d)("inventory.common.proPlan.subtitle")), 1)
81
- ]),
82
- p("div", te, [
83
- p("a", oe, [
84
- S(C, {
85
- label: f(d)("inventory.common.proPlan.comparePlans"),
86
- variant: "secondary"
87
- }, null, 8, ["label"])
88
- ]),
89
- p("a", ne, [
90
- S(C, {
91
- label: f(d)("inventory.common.proPlan.callUs"),
92
- "prepend-icon": "call"
93
- }, null, 8, ["label"])
94
- ])
95
- ])
96
- ]))
97
- ]);
98
- };
99
- }
100
- }), se = { class: "h-full flex flex-col overflow-auto py-16" }, ae = /* @__PURE__ */ h({
101
- __name: "NavigationTab",
102
- setup(i) {
103
- const o = $(), u = w(), c = A(), s = O(), m = Q(), { t } = B();
104
- y([() => c.currentBusiness.value, () => o.name], ([n, r]) => {
105
- (n == null ? void 0 : n.menuVersion) === "v3" && (r === e.INGREDIENTS || r === e.RECIPE || r === e.UNIT) && u.push({ name: e.STOCK });
106
- });
107
- const b = g(() => {
108
- var r;
109
- const n = [
110
- {
111
- label: a(e.STOCK, t),
112
- // icon: 'inventory_2',
113
- children: [
114
- {
115
- label: "Stock balance",
116
- value: e.STOCK
117
- },
118
- ...s.enableWastageTemplate ? [
119
- {
120
- label: a(e.WASTAGE_TEMPLATE, t),
121
- value: e.WASTAGE_TEMPLATE
122
- }
123
- ] : []
124
- ]
125
- },
126
- ...s.enableClosingTemplate ? [
127
- {
128
- label: "Closing",
129
- children: [
130
- {
131
- label: a(e.CLOSING_TEMPLATE, t),
132
- value: e.CLOSING_TEMPLATE
133
- },
134
- {
135
- label: a(e.CLOSING_DRAFT, t),
136
- value: e.CLOSING_DRAFT
137
- }
138
- ]
139
- }
140
- ] : [],
141
- {
142
- label: a(e.INGREDIENTS, t),
143
- // icon: 'grocery',
144
- value: e.INGREDIENTS
145
- },
146
- ...s.enableIngredientGroup ? [
147
- {
148
- label: a(e.INGREDIENT_GROUP, t),
149
- // icon: 'grocery',
150
- value: e.INGREDIENT_GROUP
151
- }
152
- ] : [],
153
- {
154
- label: a(e.RECIPE, t),
155
- // icon: 'weight',
156
- value: e.RECIPE
157
- },
158
- {
159
- label: a(e.UNIT, t),
160
- // icon: 'fastfood',
161
- value: e.UNIT
162
- },
163
- {
164
- label: t("inventory.transfer.title"),
165
- // icon: 'swap_horiz',
166
- children: [
167
- {
168
- label: a(e.RECEIVE_REQUEST, t),
169
- value: e.RECEIVE_REQUEST
170
- },
171
- {
172
- label: a(e.APPROVAL, t),
173
- value: e.APPROVAL
174
- },
175
- ...s.enablePoTemplate ? [
176
- {
177
- label: a(e.TRANSFER_TEMPLATE, t),
178
- value: e.TRANSFER_TEMPLATE
179
- }
180
- ] : []
181
- ]
182
- },
183
- {
184
- label: a(e.SUPPLIER, t),
185
- // icon: 'group',
186
- value: e.SUPPLIER
187
- },
188
- {
189
- label: a(e.WAREHOUSE, t),
190
- // icon: 'warehouse',
191
- value: e.WAREHOUSE
192
- },
193
- {
194
- label: a(e.PUBLISH, t),
195
- value: e.PUBLISH
196
- },
197
- {
198
- label: a(e.INTEGRATION, t),
199
- // icon: 'integration_instructions',
200
- value: e.INTEGRATION
201
- }
202
- ];
203
- return ((r = c.currentBusiness.value) == null ? void 0 : r.menuVersion) === "v3" ? n.filter(
204
- (l) => l.value !== e.INGREDIENTS && l.value !== e.RECIPE && l.value !== e.UNIT
205
- ) : n;
206
- }), d = g({
207
- get() {
208
- if (o.name)
209
- return String(o.name);
210
- },
211
- set(n) {
212
- n && u.push({ name: n });
213
- }
214
- }), v = g(
215
- () => {
216
- var n;
217
- return `NavigationTab.${(n = c.currentBusiness.value) == null ? void 0 : n._id}`;
218
- }
219
- ), E = x(!1), N = g({
220
- get() {
221
- return E.value;
222
- },
223
- set(n) {
224
- E.value = n, n || m.setItem(v.value, "true");
225
- }
226
- });
227
- return y([() => v.value], () => {
228
- E.value = !1, setTimeout(() => {
229
- N.value = !m.getItem(v.value);
230
- }, 2e3);
231
- }), (n, r) => {
232
- const l = R("FmCollapsibleTabs");
233
- return T(), P("div", se, [
234
- S(l, {
235
- modelValue: d.value,
236
- "onUpdate:modelValue": r[0] || (r[0] = (I) => d.value = I),
237
- items: b.value
238
- }, null, 8, ["modelValue", "items"])
239
- ]);
240
- };
241
- }
242
- });
243
- typeof Promise.withResolvers > "u" && (Promise.withResolvers = () => {
244
- let i, o;
245
- return { promise: new Promise((c, s) => {
246
- i = c, o = s;
247
- }), resolve: i, reject: o };
248
- });
249
- typeof Promise.prototype.delayed > "u" && (Promise.prototype.delayed = async function(i) {
250
- return await new Promise((o) => setTimeout(o, i)), Promise.resolve(this);
251
- });
252
- const ve = /* @__PURE__ */ h({
253
- __name: "App",
254
- setup(i) {
255
- const o = A(), u = j(), c = K();
256
- U(() => {
257
- if (window.location.href.includes("print-preview")) {
258
- o.setEmbedded(!0);
259
- return;
260
- }
261
- o.registerSidebarComponent(ae), u.initGoogleMap(c.appApi.googleMap).catch(() => {
262
- console.error("Google map cannot be loaded");
263
- });
264
- }), y([() => o.currentCountry.value], () => {
265
- s();
266
- });
267
- async function s() {
268
- var m;
269
- try {
270
- await o.readBusinesses(), o.currentBusiness.value = (m = o.businesses.value) == null ? void 0 : m.find((t) => t);
271
- } catch (t) {
272
- console.error("error when trying to reset businesses:", t);
273
- }
274
- }
275
- return (m, t) => (T(), G(re));
276
- }
277
- });
278
- export {
279
- ve as default
280
- };
@@ -1,215 +0,0 @@
1
- import { i as k, t as E, as as w, aH as B, u as H, ax as z, aI as D, aJ as V } from "./app-tDCjbNqA.js";
2
- import { u as x } from "./supplier-2qlZME6l.js";
3
- import { P as F } from "./format-unit-display-B2P_1U8-.js";
4
- import { computed as d, defineComponent as j, mergeModels as q, useModel as W, ref as $, resolveComponent as g, openBlock as L, createElementBlock as N, normalizeStyle as J, createElementVNode as A, createVNode as K, withCtx as Q, createBlock as M, createCommentVNode as I, Fragment as X, renderList as Y, unref as R } from "vue";
5
- function Z(e, l, a) {
6
- var n;
7
- if (!!l.measurement === !!a && ((n = l.measurement) == null ? void 0 : n.id) === a)
8
- return l;
9
- if (!a)
10
- return {
11
- costPerUnit: l.costPerUnit
12
- };
13
- const s = e.measurements.find((c) => c.id === a);
14
- return s ? {
15
- costPerUnit: l.costPerUnit,
16
- measurement: s
17
- } : {
18
- costPerUnit: l.costPerUnit
19
- };
20
- }
21
- function se(e, l, a, r) {
22
- var _, P, T;
23
- if (r != null && r.manualTotalCost)
24
- return r == null ? void 0 : r.manualTotalCost;
25
- const u = (T = (P = (_ = r == null ? void 0 : r.supplier) == null ? void 0 : _.supplyItems) == null ? void 0 : P.find(
26
- (o) => o.skuId === e._id
27
- )) == null ? void 0 : T.defaultCost, s = e.defaultCost ? Z(e.unit, e.defaultCost, e.trackingMeasurement) : void 0, n = u ?? s, c = n == null ? void 0 : n.costPerUnit, h = c ? n != null && n.measurement ? +k(c) / +k(n == null ? void 0 : n.measurement.conversion) : +k(c) : void 0, v = h ? a ? h * +k(a.conversion) : h : void 0, y = v ? +k(l) * v : void 0;
28
- return y ? {
29
- ...E(y ?? 0, 2),
30
- currency: w()
31
- } : {
32
- amount: 0,
33
- precision: 0,
34
- currency: w()
35
- };
36
- }
37
- function C(e) {
38
- return B.parse(e);
39
- }
40
- function S(e) {
41
- return {
42
- _id: e.doc._id,
43
- internal: e.type,
44
- contactName: e.doc.profile.name,
45
- name: e.doc.profile.name ?? "",
46
- email: e.doc.profile.email,
47
- phoneNumber: e.doc.profile.phoneNo,
48
- registrationNumber: e.doc.profile.regNo,
49
- address: e.doc.profile.address ?? {
50
- line1: "",
51
- state: "",
52
- city: "",
53
- postcode: "",
54
- country: ""
55
- }
56
- };
57
- }
58
- function ae(e, l, a = !1, r = !1) {
59
- const u = x(), s = H(), n = d(() => e().isReturnPo ?? !1);
60
- s.watchLocation(async () => {
61
- var b;
62
- if (n.value) return;
63
- await u.readSuppliers();
64
- const o = e();
65
- if ((b = o.supplier) != null && b._id) return;
66
- const t = r ? u.suppliers[0] : u.businessSuppliers[0], i = (a ? s.locations.filter((m) => m.doc._id !== s.currentLocation.doc._id) : s.locations)[0];
67
- l({
68
- ...o,
69
- supplier: t ? C(t) : i ? S(i) : o.supplier
70
- });
71
- });
72
- const c = d(() => {
73
- var o, t;
74
- return n.value ? F.TRANSFER : typeof ((t = (o = e()) == null ? void 0 : o.supplier) == null ? void 0 : t.internal) == "string" ? F.TRANSFER : F.PURCHASE;
75
- }), h = d({
76
- get() {
77
- var o, t;
78
- return (t = (o = e()) == null ? void 0 : o.supplier) == null ? void 0 : t._id;
79
- },
80
- set(o) {
81
- const t = e() ?? {};
82
- if (c.value === F.PURCHASE) {
83
- const U = (r ? u.suppliers : u.businessSuppliers).find((O) => O._id === o);
84
- l({
85
- ...t,
86
- supplier: U ? C(U) : t.supplier
87
- });
88
- return;
89
- }
90
- const b = (a ? s.locations.filter((m) => m.doc._id !== s.currentLocation.doc._id) : s.locations).find((m) => m.doc._id === o);
91
- l({
92
- ...t,
93
- supplier: b ? S(b) : t.supplier
94
- });
95
- }
96
- }), v = d(() => u.locationSuppliers.map(C)), y = d(() => u.businessSuppliers.map(C)), p = d(() => {
97
- if (n.value) return [];
98
- const o = [...v.value], t = [...y.value];
99
- return r ? [...t, ...o] : t;
100
- }), _ = d(() => {
101
- var f;
102
- if (n.value) return [S(s.currentLocation)];
103
- const o = ((f = s._currentLocation) == null ? void 0 : f.type) === z.enum.warehouse;
104
- return (a ? s.locations.filter((i) => i.doc._id !== s.currentLocation.doc._id) : s.locations).filter((i) => o || i.acceptRequest).map(S);
105
- }), P = d(() => {
106
- if (c.value === F.PURCHASE) {
107
- const t = v.value.map((i) => ({
108
- label: i.name,
109
- value: i._id
110
- })), f = y.value.map((i) => ({
111
- label: i.name,
112
- sublabel: "Business supplier",
113
- value: i._id
114
- }));
115
- return r ? [...t, ...f] : f;
116
- }
117
- return _.value.map((t) => ({
118
- label: t.name,
119
- sublabel: t.internal ? `${t.internal}` : void 0,
120
- value: t._id
121
- }));
122
- }), T = d(() => {
123
- var i, b;
124
- if (n.value)
125
- return S(s.currentLocation);
126
- const o = (b = (i = e()) == null ? void 0 : i.supplier) == null ? void 0 : b._id;
127
- if (c.value === F.PURCHASE) {
128
- const m = u.suppliers.find((U) => U._id === o);
129
- return m ? C(m) : null;
130
- }
131
- const f = s.locations.find((m) => m.doc._id);
132
- return f ? S(f) : null;
133
- });
134
- return {
135
- transferLocationModel: h,
136
- transferLocationOptions: P,
137
- locationOptionsTypePurchase: p,
138
- locationOptionsTypePurchaseLocationLevel: v,
139
- locationOptionsTypeTransfer: _,
140
- selectedLocation: T
141
- };
142
- }
143
- const G = { class: "overflow-y-auto h-full pb-8" }, re = /* @__PURE__ */ j({
144
- __name: "FmFilterableMenuOptions",
145
- props: /* @__PURE__ */ q({
146
- modelValue: {},
147
- maxHeight: {},
148
- width: {},
149
- handleItemChange: { type: Function },
150
- items: {},
151
- options: {}
152
- }, {
153
- search: {},
154
- searchModifiers: {}
155
- }),
156
- emits: ["update:search"],
157
- setup(e) {
158
- const l = e, a = W(e, "search"), r = d(
159
- () => new D(l.items, ["label", "sublabel"], l.options)
160
- ), u = d(() => r.value.search(a.value)), s = $();
161
- return console.log({ stickyRef: s }), (n, c) => {
162
- const h = g("FmButton"), v = g("FmTextField"), y = g("FmMenuItem");
163
- return L(), N("div", {
164
- class: "relative",
165
- style: J({ width: n.width })
166
- }, [
167
- A("div", {
168
- class: "sticky top-0 bg-white mb-8",
169
- ref_key: "stickyRef",
170
- ref: s
171
- }, [
172
- K(v, {
173
- modelValue: a.value,
174
- "onUpdate:modelValue": c[1] || (c[1] = (p) => a.value = p),
175
- placeholder: "Filter options"
176
- }, {
177
- append: Q(() => [
178
- a.value ? (L(), M(h, {
179
- key: 0,
180
- variant: "tertiary",
181
- "prepend-icon": "close",
182
- onClick: c[0] || (c[0] = (p) => a.value = "")
183
- })) : I("", !0)
184
- ]),
185
- _: 1
186
- }, 8, ["modelValue"])
187
- ], 512),
188
- A("div", G, [
189
- (L(!0), N(X, null, Y(u.value, (p, _) => (L(), M(y, {
190
- key: _,
191
- label: p.label,
192
- sublabel: p.sublabel,
193
- "model-value": R(V)(n.modelValue, p.value),
194
- onClick: () => n.handleItemChange(R(V)(n.modelValue, p.value), p),
195
- onVnodeMounted: (P) => {
196
- var T, o;
197
- return R(V)(n.modelValue, p.value) && ((T = P.el) == null || T.scrollIntoView({ behavior: "instant", block: "end" }), (o = P.el) == null || o.scrollIntoView({ behavior: "smooth", block: "center" })), void 0;
198
- }
199
- }, null, 8, ["label", "sublabel", "model-value", "onClick", "onVnodeMounted"]))), 128)),
200
- u.value.length ? I("", !0) : (L(), M(y, {
201
- key: 0,
202
- disabled: "",
203
- label: "No options available"
204
- }))
205
- ])
206
- ], 4);
207
- };
208
- }
209
- });
210
- export {
211
- re as _,
212
- se as c,
213
- S as l,
214
- ae as u
215
- };