@feedmepos/mf-common 1.27.3 → 1.27.4

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.
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as A, computed as d, resolveComponent as N, openBlock as f, createElementBlock as b, createVNode as S, toDisplayString as C, unref as F, h } from "vue";
2
- import { t as w, u as O } from "./app-89e5c55e.js";
2
+ import { t as w, u as O } from "./app-bab0f0ed.js";
3
3
  import { components as y } from "@feedmepos/ui-library";
4
4
  import { c as x } from "./object-27ce045b.js";
5
5
  import "pinia";
@@ -1,5 +1,5 @@
1
1
  import { ref as At, computed as rt, defineComponent as _i, onMounted as ki, watch as Rn, resolveComponent as hr, openBlock as Re, createElementBlock as it, createElementVNode as Qe, toDisplayString as Ln, unref as We, createVNode as nt, isRef as Ei, createCommentVNode as Bt, Fragment as hn, renderList as fn, createBlock as fr, withCtx as gn, normalizeClass as Un, Transition as Kn } from "vue";
2
- import { c as mn, l as we, e as Dt, d as _e, f as ct, g as et, h as Fi, u as Tn, i as ji, a as Si, E as Hn, t as Ci, b as zi } from "./app-89e5c55e.js";
2
+ import { c as mn, l as we, e as Dt, d as _e, f as ct, g as et, h as Fi, u as Tn, i as ji, a as Si, O as Hn, t as Ci, b as zi } from "./app-bab0f0ed.js";
3
3
  import { FmButtonVariant as Vt } from "@feedmepos/ui-library";
4
4
  import { defineStore as Oi } from "pinia";
5
5
  import { c as Gt } from "./object-27ce045b.js";
@@ -1,5 +1,5 @@
1
- import { ref as C, computed as i, defineComponent as le, mergeModels as te, useModel as ae, watch as U, resolveComponent as x, openBlock as d, createElementBlock as y, createElementVNode as k, createVNode as m, withCtx as z, normalizeClass as ne, toDisplayString as re, createCommentVNode as E, withModifiers as j, unref as p, isRef as ue, Fragment as $, renderList as K, createBlock as P, renderSlot as oe, nextTick as se } from "vue";
2
- import { t as ie, u as ce, a as de, E as I, b as ve } from "./app-89e5c55e.js";
1
+ import { ref as C, computed as i, defineComponent as le, mergeModels as te, useModel as ae, watch as U, resolveComponent as x, openBlock as d, createElementBlock as y, createElementVNode as k, createVNode as m, withCtx as z, normalizeClass as ne, toDisplayString as re, createCommentVNode as $, withModifiers as j, unref as p, isRef as ue, Fragment as I, renderList as K, createBlock as P, renderSlot as oe, nextTick as se } from "vue";
2
+ import { t as ie, u as ce, a as de, O as N, b as ve } from "./app-bab0f0ed.js";
3
3
  import "@feedmepos/ui-library";
4
4
  import "pinia";
5
5
  import "vue-router";
@@ -19,7 +19,7 @@ function fe(g, t) {
19
19
  t.value === void 0 && u.value ? n = [o] : t.value === void 0 && !u.value ? n = (h = g.value.map((f) => f.value)) == null ? void 0 : h.filter((f) => f !== o) : (v = t.value) != null && v.includes(o) ? n = (S = t.value) == null ? void 0 : S.filter((f) => f !== o) : n = [...t.value || [], o], n.length === 0 ? (t.value = void 0, u.value = !0) : n.length === g.value.length ? (t.value = void 0, u.value = !1) : t.value = n;
20
20
  } };
21
21
  }
22
- const me = { class: "w-full flex flex-col gap-8" }, pe = { class: "flex items-center gap-8" }, ge = { class: "inline-flex items-center" }, be = { class: "flex flex-col w-[360px] min-h-0 gap-8" }, he = { class: "flex gap-4 px-[6px]" }, ye = { class: "flex-1" }, _e = { class: "flex-1 overflow-y-auto min-h-0" }, ke = { key: 0 }, Oe = /* @__PURE__ */ le({
22
+ const me = { class: "w-full flex flex-col gap-8" }, pe = { class: "flex items-center gap-8" }, ge = { class: "inline-flex items-center" }, be = { class: "flex flex-col w-[360px] min-h-0 gap-8" }, he = { class: "flex gap-4 px-[6px]" }, ye = { class: "flex-1" }, _e = { class: "flex-1 overflow-y-auto min-h-0" }, ke = { key: 0 }, Ve = /* @__PURE__ */ le({
23
23
  __name: "RestaurantSelector",
24
24
  props: /* @__PURE__ */ te({
25
25
  multiple: { type: Boolean, default: !1 },
@@ -34,16 +34,16 @@ const me = { class: "w-full flex flex-col gap-8" }, pe = { class: "flex items-ce
34
34
  }),
35
35
  emits: ["update:modelValue"],
36
36
  setup(g) {
37
- const t = g, { t: u } = ie(), a = ae(g, "modelValue"), { restaurants: b, restaurantAttributeSettings: V } = ce();
38
- function N(e) {
37
+ const t = g, { t: u } = ie(), a = ae(g, "modelValue"), { restaurants: b, restaurantAttributeSettings: O } = ce();
38
+ function Q(e) {
39
39
  const l = b.value.map((_) => {
40
40
  var A;
41
41
  return (A = _.customAttributes) == null ? void 0 : A[e];
42
42
  }).filter((_) => typeof _ == "string" && !!_);
43
43
  return [...new Set(l)];
44
44
  }
45
- const o = i(() => V.value.map((e) => {
46
- const l = N(e.key);
45
+ const o = i(() => O.value.map((e) => {
46
+ const l = Q(e.key);
47
47
  return {
48
48
  ...e,
49
49
  values: l
@@ -61,14 +61,14 @@ const me = { class: "w-full flex flex-col gap-8" }, pe = { class: "flex items-ce
61
61
  label: `${l} (${r ?? "--"})`,
62
62
  value: e._id
63
63
  };
64
- }, Q = i(() => b.value.map(f)), w = i(
65
- () => b.value.filter((e) => t.managableOnly ? e.managable : !0).filter((e) => t.multiple ? !0 : I(e.customAttributes || {}, c.value)).map(f).filter(({ label: e }) => h([e])).filter((e) => {
64
+ }, E = i(() => b.value.map(f)), w = i(
65
+ () => b.value.filter((e) => t.managableOnly ? e.managable : !0).filter((e) => t.multiple ? !0 : N(e.customAttributes || {}, c.value)).map(f).filter(({ label: e }) => h([e])).filter((e) => {
66
66
  var l;
67
67
  return !((l = t.excludeRestaurants) != null && l.includes(e.value));
68
68
  })
69
69
  ), T = i(() => {
70
70
  var e;
71
- return a.value ? a.value.length === 1 ? (e = Q.value.find((l) => {
71
+ return a.value ? a.value.length === 1 ? (e = E.value.find((l) => {
72
72
  var r;
73
73
  return l.value === ((r = a.value) == null ? void 0 : r[0]);
74
74
  })) == null ? void 0 : e.label : u("portalshell.components.restaurantSelector.restaurantCount", {
@@ -76,11 +76,11 @@ const me = { class: "w-full flex flex-col gap-8" }, pe = { class: "flex items-ce
76
76
  }) : u("portalshell.components.restaurantSelector.allRestaurants");
77
77
  }), W = i(() => {
78
78
  var e;
79
- return a.value ? ((e = Q.value.find((l) => l.value === a.value)) == null ? void 0 : e.label) || u("portalshell.components.restaurantSelector.unknownRestaurant") : u("portalshell.components.restaurantSelector.selectRestaurant");
80
- }), L = i(() => t.multiple ? T.value : W.value), O = i(() => t.disabled ? "neutral-gray-200" : t.variant === "dark" ? "neutral-black" : "neutral-gray-400"), q = i(() => t.disabled ? "text-fm-color-neutral-gray-200" : t.variant === "dark" ? "text-fm-color-neutral-black" : "text-fm-color-neutral-gray-400"), { allSelected: D, toggleAll: G, toggleOption: H, indeterminate: J } = fe(
79
+ return a.value ? ((e = E.value.find((l) => l.value === a.value)) == null ? void 0 : e.label) || u("portalshell.components.restaurantSelector.unknownRestaurant") : u("portalshell.components.restaurantSelector.selectRestaurant");
80
+ }), L = i(() => t.multiple ? T.value : W.value), V = i(() => t.disabled ? "neutral-gray-200" : t.variant === "dark" ? "neutral-black" : "neutral-gray-400"), q = i(() => t.disabled ? "text-fm-color-neutral-gray-200" : t.variant === "dark" ? "text-fm-color-neutral-black" : "text-fm-color-neutral-gray-400"), { allSelected: D, toggleAll: G, toggleOption: H, indeterminate: J } = fe(
81
81
  w,
82
82
  a
83
- ), F = C(!1), X = i(() => V.value.length > 0), R = C(null);
83
+ ), F = C(!1), X = i(() => O.value.length > 0), R = C(null);
84
84
  async function Y() {
85
85
  t.disabled || (F.value ? F.value = !1 : (F.value = !0, await se(), R.value && R.value.toggleProperty(!0)));
86
86
  }
@@ -100,10 +100,10 @@ const me = { class: "w-full flex flex-col gap-8" }, pe = { class: "flex items-ce
100
100
  a.value = null;
101
101
  return;
102
102
  }
103
- const l = b.value.filter((r) => I(r.customAttributes || {}, c.value));
103
+ const l = b.value.filter((r) => N(r.customAttributes || {}, c.value));
104
104
  a.value = l.map((r) => r._id);
105
105
  } else {
106
- const l = b.value.filter((r) => I(r.customAttributes || {}, c.value));
106
+ const l = b.value.filter((r) => N(r.customAttributes || {}, c.value));
107
107
  l.length === 0 ? a.value = null : a.value = (e = l[0]) == null ? void 0 : e._id;
108
108
  }
109
109
  },
@@ -135,7 +135,7 @@ const me = { class: "w-full flex flex-col gap-8" }, pe = { class: "flex items-ce
135
135
  }, {
136
136
  default: z(() => [
137
137
  m(r, {
138
- color: O.value,
138
+ color: V.value,
139
139
  name: "storefront",
140
140
  outline: "",
141
141
  size: "sm"
@@ -146,9 +146,9 @@ const me = { class: "w-full flex flex-col gap-8" }, pe = { class: "flex items-ce
146
146
  "fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap",
147
147
  q.value
148
148
  ])
149
- }, re(L.value), 3)) : E("", !0),
149
+ }, re(L.value), 3)) : $("", !0),
150
150
  m(r, {
151
- color: O.value,
151
+ color: V.value,
152
152
  name: "keyboard_arrow_down",
153
153
  size: "sm"
154
154
  }, null, 8, ["color"]),
@@ -161,11 +161,11 @@ const me = { class: "w-full flex flex-col gap-8" }, pe = { class: "flex items-ce
161
161
  name: "filter_alt",
162
162
  size: "sm",
163
163
  outline: Z.value === 0,
164
- color: O.value,
164
+ color: V.value,
165
165
  onClick: l[0] || (l[0] = j(() => {
166
166
  }, ["prevent"]))
167
167
  }, null, 8, ["outline", "color"])
168
- ])) : E("", !0)
168
+ ])) : $("", !0)
169
169
  ]),
170
170
  _: 1
171
171
  }, 8, ["disabled"])
@@ -183,7 +183,7 @@ const me = { class: "w-full flex flex-col gap-8" }, pe = { class: "flex items-ce
183
183
  ])
184
184
  ]),
185
185
  k("div", _e, [
186
- e.multiple ? (d(), y($, { key: 0 }, [
186
+ e.multiple ? (d(), y(I, { key: 0 }, [
187
187
  m(M, {
188
188
  label: "All",
189
189
  "has-checkbox": "",
@@ -191,7 +191,7 @@ const me = { class: "w-full flex flex-col gap-8" }, pe = { class: "flex items-ce
191
191
  indeterminate: p(J),
192
192
  onClick: p(G)
193
193
  }, null, 8, ["model-value", "indeterminate", "onClick"]),
194
- (d(!0), y($, null, K(w.value, (s) => {
194
+ (d(!0), y(I, null, K(w.value, (s) => {
195
195
  var B;
196
196
  return d(), P(M, {
197
197
  key: s.value,
@@ -201,7 +201,7 @@ const me = { class: "w-full flex flex-col gap-8" }, pe = { class: "flex items-ce
201
201
  onClick: (Ce) => p(H)(s.value)
202
202
  }, null, 8, ["label", "model-value", "onClick"]);
203
203
  }), 128))
204
- ], 64)) : (d(!0), y($, { key: 1 }, K(w.value, (s) => (d(), P(M, {
204
+ ], 64)) : (d(!0), y(I, { key: 1 }, K(w.value, (s) => (d(), P(M, {
205
205
  key: s.value,
206
206
  label: s.label,
207
207
  onClick: (B) => S(s.value)
@@ -221,11 +221,11 @@ const me = { class: "w-full flex flex-col gap-8" }, pe = { class: "flex items-ce
221
221
  modelValue: c.value,
222
222
  "onUpdate:modelValue": l[2] || (l[2] = (s) => c.value = s)
223
223
  }, null, 8, ["attributes", "modelValue"])
224
- ])) : E("", !0)
224
+ ])) : $("", !0)
225
225
  ]);
226
226
  };
227
227
  }
228
228
  });
229
229
  export {
230
- Oe as default
230
+ Ve as default
231
231
  };