@feedmepos/mf-menu 0.32.7-beta.2 → 0.32.7-dev

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 (87) hide show
  1. package/dist/{App-BIQ0CTci.js → App-DCkQc7e4.js} +98 -98
  2. package/dist/ApplyProduct.vue_vue_type_script_setup_true_lang-uzmq3vwy.js +161 -0
  3. package/dist/BottomSheetMenuItem.vue_vue_type_script_setup_true_lang-DhrXKy3b.js +74 -0
  4. package/dist/{Catalog-D2wc24o8.js → Catalog-CUPoRid3.js} +9 -9
  5. package/dist/{Category-DA5-55d2.js → Category-BkvhZ57Y.js} +7 -7
  6. package/dist/{Category-BPufryqK.js → Category-Cdw0ikhP.js} +4 -4
  7. package/dist/{CookingGuide-DKvou40e.js → CookingGuide-BZ-4oULM.js} +6 -6
  8. package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-DHoAYdGI.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-CJvVFWdR.js} +3 -3
  9. package/dist/FormItem.vue_vue_type_script_setup_true_lang-BmPAVphe.js +26 -0
  10. package/dist/{Group-D60oAvmM.js → Group-C1FaXdUb.js} +1 -1
  11. package/dist/{Group-Bgpc6qE1.js → Group-Cec83DWm.js} +4 -4
  12. package/dist/{Group.vue_vue_type_script_setup_true_lang-BXn3--BL.js → Group.vue_vue_type_script_setup_true_lang-2_lLBdX2.js} +128 -128
  13. package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BD9IZkwW.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BEDyKWhK.js} +91 -91
  14. package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-BE3LdBYY.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-BteTvMnx.js} +3225 -3225
  15. package/dist/{Ingredient-Brv4hml-.js → Ingredient-DulL8h2B.js} +29 -29
  16. package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-CIOX-pq1.js → InventoryBinding.vue_vue_type_script_setup_true_lang-DoBx7Dal.js} +104 -104
  17. package/dist/{LinkProductSideSheet-BDMbKJ8o.js → LinkProductSideSheet-Br2eE8pC.js} +251 -251
  18. package/dist/MenuSelector.vue_vue_type_script_setup_true_lang-K6Z0QJBl.js +69 -0
  19. package/dist/{MenuSetting-DvCu23my.js → MenuSetting-DxW4LCW4.js} +77 -77
  20. package/dist/{PageLayout.vue_vue_type_script_setup_true_lang-vFqWGM6P.js → PageLayout.vue_vue_type_script_setup_true_lang-2f0QfweQ.js} +8 -8
  21. package/dist/{PrintRoute-DwgLKDUV.js → PrintRoute-Da6Zkx-0.js} +5 -5
  22. package/dist/{Product-EmoWM778.js → Product-Cs76t18_.js} +1 -1
  23. package/dist/{Product.vue_vue_type_script_setup_true_lang-5HyO_RYw.js → Product.vue_vue_type_script_setup_true_lang-C6SOu4Vv.js} +606 -606
  24. package/dist/{ProductInternalTools-PqzouaF2.js → ProductInternalTools-DPbeRvTM.js} +10 -10
  25. package/dist/{Products-ZgfTT9dI.js → Products--7dGfuuT.js} +52 -52
  26. package/dist/{Publish-CUdRwmN1.js → Publish-COmZtiyX.js} +5 -5
  27. package/dist/{Recipe-BRUxyire.js → Recipe-BaN_1zrP.js} +5 -5
  28. package/dist/{RuleView.vue_vue_type_script_setup_true_lang-CPFGkaTr.js → RuleView.vue_vue_type_script_setup_true_lang-DputprQj.js} +451 -448
  29. package/dist/{Scheduler-BXdZh-xC.js → Scheduler-BSUpIAaK.js} +4 -4
  30. package/dist/{ServingSequence-EAZHOHiy.js → ServingSequence-dXBb7e5d.js} +4 -4
  31. package/dist/{Setting-BRut_Xj0.js → Setting-CalEQW0n.js} +6 -6
  32. package/dist/{Subcategory-D6Yrs-vO.js → Subcategory-zPHtX7Vc.js} +5 -5
  33. package/dist/{Takeaway-Bi8JfDWa.js → Takeaway-CRDj2Bpe.js} +5 -5
  34. package/dist/{Takeaway-CRdlNTu7.js → Takeaway-CcnmeTmu.js} +1 -1
  35. package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-DKQZ9J8Z.js → Takeaway.vue_vue_type_script_setup_true_lang-Cj7vyOaP.js} +5 -5
  36. package/dist/{TextChip.vue_vue_type_script_setup_true_lang-BJMcI3U2.js → TextChip.vue_vue_type_script_setup_true_lang-8frWuZFL.js} +5 -5
  37. package/dist/{Thumbnail.vue_vue_type_script_setup_true_lang-DDWk-WUW.js → Thumbnail.vue_vue_type_script_setup_true_lang-B0552qsN.js} +74 -74
  38. package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-BwnyIDNH.js +6038 -0
  39. package/dist/{Unit-Ccs_k5IS.js → Unit-C7-Oj5S3.js} +3 -3
  40. package/dist/{Variant-BHmgMXq7.js → Variant-CYiMkE0q.js} +4 -4
  41. package/dist/{_id_-DSSoi4Gy.js → _id_-D75ZcNlf.js} +11 -11
  42. package/dist/{app-CzXxFrl1.js → app-5fxKLAzS.js} +447 -447
  43. package/dist/{app-C8Dm2-h4.js → app-BhLVpUSl.js} +35 -35
  44. package/dist/{app-B9seAt5l.js → app-DzVMOviz.js} +1 -1
  45. package/dist/app.js +1 -1
  46. package/dist/apps/mf-menu/src/app.d.ts +20 -0
  47. package/dist/apps/mf-menu/src/components/feature/CategoryManager/CategoriesSelector.vue.d.ts +1 -1
  48. package/dist/apps/mf-menu/src/components/feature/MenuSelector.vue.d.ts +1 -1
  49. package/dist/apps/mf-menu/src/components/feature/SubcategoryManager/SubcategorySelector.vue.d.ts +1 -1
  50. package/dist/apps/mf-menu/src/components/feature/TreeEditor/store/menuV2.d.ts +2 -1
  51. package/dist/apps/mf-menu/src/stores/menu.d.ts +1 -0
  52. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  53. package/dist/assets/linked-status-BoIPm5hC.js +13 -0
  54. package/dist/assets/override-menu-DfTrwWpR.js +13 -0
  55. package/dist/assets/validate-menu-BhWvQ3T9.js +13 -0
  56. package/dist/{catalog-CD-fdGdY.js → catalog-CudNSsIP.js} +1 -1
  57. package/dist/{catalogSetting-Ci85lXor.js → catalogSetting-BVHO9tK3.js} +1 -1
  58. package/dist/{category-6NAH0dUF.js → category-BQpgz1lk.js} +1 -1
  59. package/dist/{currency-BP_z7R5d.js → currency-BfS7H2KE.js} +1 -1
  60. package/dist/{index-BLMijxTj.js → index-BHdPJta4.js} +91 -91
  61. package/dist/{index-C1XCbqC-.js → index-DmGJvREM.js} +56 -56
  62. package/dist/{index-Cftm4-G_.js → index-DuLXS699.js} +5 -5
  63. package/dist/{index-DgDQzkPR.js → index-aaoziUNI.js} +30 -30
  64. package/dist/{index.vue_vue_type_script_setup_true_lang-D-k9WcQV.js → index.vue_vue_type_script_setup_true_lang-Dje9kp-F.js} +40026 -40153
  65. package/dist/item-BtKW0wdj.js +7685 -0
  66. package/dist/{iteration-ZG64Re91.js → iteration-CaliNodx.js} +1 -1
  67. package/dist/{jszip.min-BETdv0rh.js → jszip.min-DXbkmgRD.js} +102 -102
  68. package/dist/{menu-COMXycAe.js → menu-D-lUEuvX.js} +1 -1
  69. package/dist/{menuV2-CeRS0Jw3.js → menuV2-D-6O36DO.js} +357 -348
  70. package/dist/mf-menu.css +1 -1
  71. package/dist/packages/shared/src/components/form/SelectFilter.vue.d.ts +1 -1
  72. package/dist/{priceTier-t2T3Q87F.js → priceTier-DKnYaOA9.js} +1 -1
  73. package/dist/{scheduler-BbJUVuiK.js → scheduler-DEwfbYPL.js} +7 -7
  74. package/dist/{subcategory-61kOQh4g.js → subcategory-CQKklgcd.js} +2 -2
  75. package/dist/{toExcel-DIYaK18-.js → toExcel-CRwL-QqF.js} +2 -2
  76. package/dist/{unit-B6StucsI.js → unit-BzM1rmN7.js} +151 -151
  77. package/dist/{vuedraggable-DnBIRDMr.js → vuedraggable-CK8z7qA8.js} +2 -2
  78. package/package.json +3 -2
  79. package/dist/ApplyProduct.vue_vue_type_script_setup_true_lang-BpEjqhAC.js +0 -161
  80. package/dist/BottomSheetMenuItem.vue_vue_type_script_setup_true_lang-CnCoRLDg.js +0 -74
  81. package/dist/FormItem.vue_vue_type_script_setup_true_lang-B3Ixruh-.js +0 -26
  82. package/dist/MenuSelector.vue_vue_type_script_setup_true_lang-Bm_hSelC.js +0 -69
  83. package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-JdHaBpaX.js +0 -5997
  84. package/dist/assets/linked-status-Cuf8X8_g.js +0 -13
  85. package/dist/assets/override-menu-yxQLf82k.js +0 -13
  86. package/dist/assets/validate-menu-BwbenBs6.js +0 -13
  87. package/dist/item-ByEPWjef.js +0 -6819
@@ -457,14 +457,14 @@ function A(e) {
457
457
  newDraggableIndex: Q
458
458
  }, e));
459
459
  }
460
- var c, D, m, _, at, Mt, S, J, ct, M, Dt, Q, Ot, x, ut = !1, Yt = !1, Bt = [], rt, Y, $t, zt, ge, ve, bt, st, St, Ct = !1, At = !1, Lt, I, Ut = [], ee = !1, Ht = [], Wt = typeof document < "u", Pt = Se, be = Tt || q ? "cssFloat" : "float", cn = Wt && !Je && !Se && "draggable" in document.createElement("div"), Ae = (function() {
460
+ var c, D, m, _, at, Mt, S, J, ct, M, Dt, Q, Ot, x, ut = !1, Yt = !1, Bt = [], rt, Y, $t, zt, ge, ve, bt, st, St, Ct = !1, At = !1, Lt, I, Ut = [], ee = !1, Ht = [], Wt = typeof document < "u", Pt = Se, be = Tt || q ? "cssFloat" : "float", cn = Wt && !Je && !Se && "draggable" in document.createElement("div"), Ae = function() {
461
461
  if (Wt) {
462
462
  if (q)
463
463
  return !1;
464
464
  var e = document.createElement("x");
465
465
  return e.style.cssText = "pointer-events:auto", e.style.pointerEvents === "auto";
466
466
  }
467
- })(), Pe = function(t, n) {
467
+ }(), Pe = function(t, n) {
468
468
  var o = h(t), r = parseInt(o.width) - parseInt(o.paddingLeft) - parseInt(o.paddingRight) - parseInt(o.borderLeftWidth) - parseInt(o.borderRightWidth), i = ft(t, 0, n), a = ft(t, 1, n), l = i && h(i), s = a && h(a), u = l && parseInt(l.marginLeft) + parseInt(l.marginRight) + T(i).width, d = s && parseInt(s.marginLeft) + parseInt(s.marginRight) + T(a).width;
469
469
  if (o.display === "flex")
470
470
  return o.flexDirection === "column" || o.flexDirection === "column-reverse" ? "vertical" : "horizontal";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-menu",
3
- "version": "0.32.7-beta.2",
3
+ "version": "0.32.7-dev",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -20,8 +20,9 @@
20
20
  "@feedmepos/core-dart": "^0.2.6",
21
21
  "@feedmepos/core-legacy": "file:../../core-legacy-1.4.tar.gz",
22
22
  "@feedmepos/custom-attributes": "0.0.1-rc.4",
23
+ "@feedmepos/feature-flag": "0.0.15",
23
24
  "@feedmepos/inventory-core": "^0.2.6",
24
- "@feedmepos/menu": "1.8.2",
25
+ "@feedmepos/menu": "1.7.32",
25
26
  "@feedmepos/mf-inventory-portal": "https://registry.npmjs.org/@feedmepos/mf-inventory-portal/-/mf-inventory-portal-0.0.19-dev.6.tgz",
26
27
  "@feedmepos/mf-remy-panel": "^0.1.0",
27
28
  "@feedmepos/ui-library": "1.8.8",
@@ -1,161 +0,0 @@
1
- import { defineComponent as K, computed as c, h as d, ref as U, resolveComponent as g, createElementBlock as f, openBlock as m, createVNode as v, withCtx as h, createElementVNode as C, createCommentVNode as B, toDisplayString as j, unref as a, isRef as A, createBlock as D, Fragment as G, renderList as H } from "vue";
2
- import { useI18n as M } from "@feedmepos/mf-common";
3
- import { components as I, FmButtonColorThemeVariant as w, FmButtonVariant as z } from "@feedmepos/ui-library";
4
- import { _ as O } from "./RuleView.vue_vue_type_script_setup_true_lang-CPFGkaTr.js";
5
- import { L as $ } from "./LinkProductSideSheet-BDMbKJ8o.js";
6
- import { u as q } from "./search-BAPEUu1R.js";
7
- import { u as J, an as Q } from "./index.vue_vue_type_script_setup_true_lang-D-k9WcQV.js";
8
- const W = { class: "space-y-16" }, X = { class: "flex items-center space-x-24" }, Y = {
9
- key: 0,
10
- class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
11
- }, le = /* @__PURE__ */ K({
12
- __name: "ApplyProduct",
13
- props: {
14
- title: {},
15
- linkButtonLabel: {},
16
- overrides: {},
17
- selectVariant: { type: Boolean },
18
- showVariant: { type: Boolean },
19
- editable: { type: Boolean },
20
- categorizedItems: {},
21
- items: {},
22
- variants: {}
23
- },
24
- emits: ["update:overrides", "row-click"],
25
- setup(s, { emit: F }) {
26
- const i = s, y = F, L = J(), { searchKey: p, filter: x } = q(), k = c(() => i.categorizedItems || L.categorizedItems), _ = c(() => Q(k.value, i.overrides)), P = c(() => _.value.reduce((o, e) => {
27
- if (x([e.name]))
28
- return o.push(e), o;
29
- const r = e.items.filter((n) => x([n.label]));
30
- return r.length && o.push({ ...e, items: r }), o;
31
- }, [])), R = c(() => i.showVariant || i.selectVariant);
32
- function S(o, e) {
33
- var n, l;
34
- const r = e ? (n = i.overrides) == null ? void 0 : n.filter((t) => !(t._id === o && t.combinationKey === e)) : (l = i.overrides) == null ? void 0 : l.filter((t) => t._id !== o);
35
- y("update:overrides", r ?? []);
36
- }
37
- const { t: u } = M(), E = c(
38
- () => (o) => [
39
- {
40
- accessorKey: "label",
41
- enableSorting: !1,
42
- header: u("menu.apply_product.table.category_count", {
43
- name: o.name,
44
- count: o.items.length
45
- }),
46
- cell: (e) => {
47
- var l;
48
- const r = e.getValue();
49
- return ((l = e.row.original.variant) == null ? void 0 : l.length) ? d(
50
- "p",
51
- {
52
- class: "flex items-center space-x-8"
53
- },
54
- [
55
- d("p", {}, [r]),
56
- d(I.FmIcon, {
57
- name: "keyboard_arrow_up",
58
- onClick: e.row.getToggleExpandedHandler(),
59
- class: [
60
- "cursor-pointer",
61
- "transition-transform",
62
- e.row.getIsExpanded() ? "transform rotate-180" : ""
63
- ]
64
- })
65
- ]
66
- ) : r;
67
- }
68
- },
69
- {
70
- id: "action",
71
- enableSorting: !1,
72
- cell: (e) => {
73
- const r = e.row.original, n = e.row.depth;
74
- return i.editable ? d(
75
- "div",
76
- {
77
- class: "flex items-center justify-end"
78
- },
79
- d(I.FmButton, {
80
- prependIcon: "delete",
81
- variant: z.Tertiary,
82
- textColor: w.NeutralGray400,
83
- onClick: () => {
84
- var t;
85
- if (n > 0) {
86
- const b = (t = e.row.getParentRow()) == null ? void 0 : t.original;
87
- S(b.value, r.value);
88
- } else
89
- S(r.value);
90
- }
91
- })
92
- ) : null;
93
- }
94
- }
95
- ]
96
- ), V = U({}), N = (o) => o.variant, T = c(() => _.value.reduce((o, e) => o + e.items.length, 0));
97
- return (o, e) => {
98
- const r = g("fm-button"), n = g("fm-search"), l = g("fm-table");
99
- return m(), f("div", W, [
100
- v(O, { title: s.title }, {
101
- "append-title": h(() => [
102
- C("div", null, [
103
- s.editable ? (m(), D($, {
104
- key: 0,
105
- "categorized-items": k.value,
106
- "initial-value": s.overrides,
107
- "select-variant": s.selectVariant,
108
- "show-variant": R.value,
109
- title: a(u)("menu.apply_product.link.title"),
110
- onSubmit: e[0] || (e[0] = ({ items: t }) => y("update:overrides", t))
111
- }, {
112
- default: h(({ trigger: t }) => [
113
- v(r, {
114
- "text-color": a(w).ColorPrimary,
115
- "border-color": a(w).ColorPrimary,
116
- variant: a(z).Secondary,
117
- label: s.linkButtonLabel || a(u)("menu.common.actions.link_product"),
118
- "prepend-icon": "link",
119
- onClick: t
120
- }, null, 8, ["text-color", "border-color", "variant", "label", "onClick"])
121
- ]),
122
- _: 1
123
- }, 8, ["categorized-items", "initial-value", "select-variant", "show-variant", "title"])) : B("", !0)
124
- ])
125
- ]),
126
- default: h(() => [
127
- C("div", X, [
128
- s.editable ? (m(), f("p", Y, j(a(u)("menu.common.labels.product_count", { count: T.value })), 1)) : B("", !0),
129
- v(n, {
130
- modelValue: a(p),
131
- "onUpdate:modelValue": e[1] || (e[1] = (t) => A(p) ? p.value = t : null),
132
- placeholder: a(u)("menu.common.labels.search_product"),
133
- class: "flex-1"
134
- }, null, 8, ["modelValue", "placeholder"])
135
- ])
136
- ]),
137
- _: 1
138
- }, 8, ["title"]),
139
- (m(!0), f(G, null, H(P.value, (t) => (m(), f("div", {
140
- key: t.id || "",
141
- class: "xs:overflow-x-scroll"
142
- }, [
143
- v(l, {
144
- "column-defs": E.value(t),
145
- "expanded-state": V.value,
146
- "get-sub-row": N,
147
- "page-size": 9999,
148
- "row-data": t.items,
149
- "search-value": a(p),
150
- "shrink-at": !1,
151
- "hide-footer": "",
152
- "onUpdate:expandedState": e[2] || (e[2] = (b) => V.value = b)
153
- }, null, 8, ["column-defs", "expanded-state", "row-data", "search-value"])
154
- ]))), 128))
155
- ]);
156
- };
157
- }
158
- });
159
- export {
160
- le as _
161
- };
@@ -1,74 +0,0 @@
1
- import { defineComponent as p, ref as v, resolveComponent as a, createBlock as r, openBlock as n, withCtx as d, createElementVNode as y, renderSlot as i, createCommentVNode as m, withModifiers as B, nextTick as C, createElementBlock as u, normalizeClass as _, createTextVNode as h, toDisplayString as k } from "vue";
2
- const F = /* @__PURE__ */ p({
3
- __name: "BottomSheetMenu",
4
- setup(o) {
5
- const e = v(!1);
6
- async function s() {
7
- await C(), e.value = !e.value;
8
- }
9
- return (l, t) => {
10
- const f = a("FmButton"), b = a("FmBottomSheet");
11
- return n(), r(b, {
12
- modelValue: e.value,
13
- "onUpdate:modelValue": t[1] || (t[1] = (c) => e.value = c),
14
- "dismiss-away": "",
15
- "no-header": "",
16
- "z-index": 110
17
- }, {
18
- "bottom-sheet-button": d(() => [
19
- l.$slots.button ? m("", !0) : (n(), r(f, {
20
- key: 0,
21
- icon: "more_vert",
22
- variant: "tertiary",
23
- onClick: B(s, ["stop"])
24
- })),
25
- i(l.$slots, "button")
26
- ]),
27
- default: d(() => [
28
- y("div", {
29
- onClick: t[0] || (t[0] = (c) => e.value = !1)
30
- }, [
31
- i(l.$slots, "default")
32
- ])
33
- ]),
34
- _: 3
35
- }, 8, ["modelValue"]);
36
- };
37
- }
38
- }), $ = { class: "py-8 px-12 hover:bg-fm-color-neutral-gray-100" }, S = /* @__PURE__ */ p({
39
- __name: "BottomSheetMenuItem",
40
- props: {
41
- label: {},
42
- icon: {},
43
- disabled: { type: Boolean },
44
- itemClass: {}
45
- },
46
- setup(o) {
47
- const e = o;
48
- return (s, l) => {
49
- const t = a("FmIcon");
50
- return n(), u("div", $, [
51
- s.$slots.content ? m("", !0) : (n(), u("div", {
52
- key: 0,
53
- class: _(["flex items-center", {
54
- "text-fm-color-typo-disabled": e.disabled,
55
- "cursor-pointer": !e.disabled,
56
- "cursor-not-allowed": e.disabled,
57
- [e.itemClass || ""]: e.itemClass && !e.disabled
58
- }])
59
- }, [
60
- o.icon ? (n(), r(t, {
61
- key: 0,
62
- name: o.icon
63
- }, null, 8, ["name"])) : m("", !0),
64
- h(" " + k(o.label), 1)
65
- ], 2)),
66
- i(s.$slots, "content")
67
- ]);
68
- };
69
- }
70
- });
71
- export {
72
- F as _,
73
- S as a
74
- };
@@ -1,26 +0,0 @@
1
- import { defineComponent as i, createElementBlock as s, openBlock as n, createElementVNode as t, renderSlot as c, createCommentVNode as l, toDisplayString as d } from "vue";
2
- const a = { class: "space-y-8" }, r = { class: "flex items-center justify-between" }, m = { class: "space-y-8" }, p = { class: "fm-typo-en-body-lg-600" }, y = {
3
- key: 0,
4
- class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
5
- }, h = /* @__PURE__ */ i({
6
- __name: "FormItem",
7
- props: {
8
- label: {},
9
- description: {}
10
- },
11
- setup(e) {
12
- return (o, _) => (n(), s("div", a, [
13
- t("div", r, [
14
- t("div", m, [
15
- t("p", p, d(e.label), 1),
16
- e.description ? (n(), s("p", y, d(e.description), 1)) : l("", !0)
17
- ]),
18
- c(o.$slots, "append")
19
- ]),
20
- c(o.$slots, "default")
21
- ]));
22
- }
23
- });
24
- export {
25
- h as _
26
- };
@@ -1,69 +0,0 @@
1
- import { defineComponent as k, computed as i, ref as x, resolveComponent as t, createBlock as p, openBlock as s, withCtx as u, createElementVNode as c, createVNode as r, createElementBlock as I, Fragment as L, renderList as M, renderSlot as S, toDisplayString as g } from "vue";
2
- import { useI18n as B } from "@feedmepos/mf-common";
3
- const E = { class: "w-full flex items-center justify-between" }, N = { class: "p-4" }, P = { class: "flex-1 overflow-y-auto min-h-0" }, K = /* @__PURE__ */ k({
4
- __name: "MenuSelector",
5
- props: {
6
- modelValue: {},
7
- items: {},
8
- placeholder: { default: "" },
9
- searchPlaceholder: { default: "" },
10
- title: { default: "" },
11
- customLabel: {}
12
- },
13
- emits: ["update:modelValue"],
14
- setup(l, { emit: f }) {
15
- const o = l, h = f, { t: $ } = B(), d = i(() => {
16
- const e = o.items.find((n) => n.value === o.modelValue);
17
- return e ? e.label : o.placeholder;
18
- }), _ = i(() => o.items.filter(
19
- (e) => e.label.toLowerCase().includes(m.value.toLowerCase())
20
- )), m = x("");
21
- function v(e) {
22
- h("update:modelValue", e);
23
- }
24
- return (e, n) => {
25
- const b = t("FmIcon"), F = t("FmChip"), C = t("FmSearch"), V = t("FmMenuItem"), w = t("FmMenu");
26
- return s(), p(w, { width: 220 }, {
27
- "menu-button": u(() => [
28
- r(F, {
29
- label: d.value,
30
- class: "w-full fm-typo-en-body-md-600 text-fm-color-neutral-gray-400"
31
- }, {
32
- default: u(() => [
33
- c("div", E, [
34
- c("p", null, g(l.customLabel || l.title || d.value), 1),
35
- r(b, {
36
- name: "expand_more",
37
- size: "sm"
38
- }),
39
- S(e.$slots, "append")
40
- ])
41
- ]),
42
- _: 3
43
- }, 8, ["label"])
44
- ]),
45
- default: u(() => [
46
- c("div", N, [
47
- r(C, {
48
- autofocus: "",
49
- modelValue: m.value,
50
- "onUpdate:modelValue": n[0] || (n[0] = (a) => m.value = a),
51
- placeholder: l.searchPlaceholder
52
- }, null, 8, ["modelValue", "placeholder"])
53
- ]),
54
- c("div", P, [
55
- (s(!0), I(L, null, M(_.value, (a, y) => (s(), p(V, {
56
- key: y,
57
- label: a.label,
58
- onClick: (j) => v(a.value)
59
- }, null, 8, ["label", "onClick"]))), 128))
60
- ])
61
- ]),
62
- _: 3
63
- });
64
- };
65
- }
66
- });
67
- export {
68
- K as _
69
- };