@feedmepos/mf-common 1.26.16 → 1.27.1-alpha-1
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/README.md +2 -26
- package/dist/{CustomAttributesForm-b46f9662.js → CustomAttributesForm-606cabd6.js} +1 -1
- package/dist/ItemSelector-4b51aafa.js +25170 -0
- package/dist/{RestaurantSelector-c0aaec10.js → RestaurantSelector-991565f9.js} +30 -31
- package/dist/{app-fc8b4c2e.js → app-ce951186.js} +23095 -15006
- package/dist/app.d.ts +1 -0
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +34 -29
- package/dist/composables/customAttributes.d.ts +136 -0
- package/dist/composables/customAttributes.d.ts.map +1 -0
- package/dist/i18n.d.ts +48 -0
- package/dist/i18n.d.ts.map +1 -1
- package/dist/store.d.ts +15 -15
- package/dist/store.d.ts.map +1 -1
- package/dist/stores/menu.d.ts +2326 -2326
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/utils/isEqual.d.ts +10 -0
- package/dist/utils/isEqual.d.ts.map +1 -0
- package/package.json +7 -4
- package/dist/ItemSelector-19808230.js +0 -50260
- package/dist/app-9575c6c7.js +0 -7846
@@ -1,6 +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
|
2
|
-
import {
|
3
|
-
import { t as ce, u as de, a as ve } from "./app-fc8b4c2e.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 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-ce951186.js";
|
4
3
|
import "@feedmepos/ui-library";
|
5
4
|
import "pinia";
|
6
5
|
import "vue-router";
|
@@ -8,19 +7,19 @@ function fe(g, t) {
|
|
8
7
|
const u = C(!0), a = i(() => {
|
9
8
|
var o, n;
|
10
9
|
return !u.value && (!t.value || ((o = t.value) == null ? void 0 : o.length) === ((n = g.value) == null ? void 0 : n.length));
|
11
|
-
}),
|
12
|
-
var o, n,
|
13
|
-
return !!((o = t.value) != null && o.length && ((n = t.value) == null ? void 0 : n.length) > 0 && ((
|
10
|
+
}), b = i(() => {
|
11
|
+
var o, n, h, v;
|
12
|
+
return !!((o = t.value) != null && o.length && ((n = t.value) == null ? void 0 : n.length) > 0 && ((h = t.value) == null ? void 0 : h.length) < ((v = g.value) == null ? void 0 : v.length));
|
14
13
|
});
|
15
|
-
return { allCleared: u, allSelected: a, indeterminate:
|
14
|
+
return { allCleared: u, allSelected: a, indeterminate: b, toggleAll: () => {
|
16
15
|
t.value = void 0, u.value = !u.value;
|
17
16
|
}, toggleOption: (o) => {
|
18
|
-
var
|
17
|
+
var h, v, S;
|
19
18
|
let n;
|
20
|
-
t.value === void 0 && u.value ? n = [o] : t.value === void 0 && !u.value ? n = (
|
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;
|
21
20
|
} };
|
22
21
|
}
|
23
|
-
const me = { class: "w-full flex flex-col gap-8" }, pe = { class: "flex items-center gap-8" }, ge = { class: "inline-flex items-center" },
|
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({
|
24
23
|
__name: "RestaurantSelector",
|
25
24
|
props: /* @__PURE__ */ te({
|
26
25
|
multiple: { type: Boolean, default: !1 },
|
@@ -35,21 +34,21 @@ const me = { class: "w-full flex flex-col gap-8" }, pe = { class: "flex items-ce
|
|
35
34
|
}),
|
36
35
|
emits: ["update:modelValue"],
|
37
36
|
setup(g) {
|
38
|
-
const t = g, { t: u } =
|
39
|
-
function
|
40
|
-
const l =
|
37
|
+
const t = g, { t: u } = ie(), a = ae(g, "modelValue"), { restaurants: b, restaurantAttributeSettings: V } = ce();
|
38
|
+
function N(e) {
|
39
|
+
const l = b.value.map((_) => {
|
41
40
|
var A;
|
42
41
|
return (A = _.customAttributes) == null ? void 0 : A[e];
|
43
42
|
}).filter((_) => typeof _ == "string" && !!_);
|
44
43
|
return [...new Set(l)];
|
45
44
|
}
|
46
45
|
const o = i(() => V.value.map((e) => {
|
47
|
-
const l =
|
46
|
+
const l = N(e.key);
|
48
47
|
return {
|
49
48
|
...e,
|
50
49
|
values: l
|
51
50
|
};
|
52
|
-
})), { searchKey: n, filter:
|
51
|
+
})), { searchKey: n, filter: h } = de(), v = C(null);
|
53
52
|
function S(e) {
|
54
53
|
var l;
|
55
54
|
if (t.multiple)
|
@@ -62,14 +61,14 @@ const me = { class: "w-full flex flex-col gap-8" }, pe = { class: "flex items-ce
|
|
62
61
|
label: `${l} (${r ?? "--"})`,
|
63
62
|
value: e._id
|
64
63
|
};
|
65
|
-
},
|
66
|
-
() =>
|
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) => {
|
67
66
|
var l;
|
68
67
|
return !((l = t.excludeRestaurants) != null && l.includes(e.value));
|
69
68
|
})
|
70
69
|
), T = i(() => {
|
71
70
|
var e;
|
72
|
-
return a.value ? a.value.length === 1 ? (e =
|
71
|
+
return a.value ? a.value.length === 1 ? (e = Q.value.find((l) => {
|
73
72
|
var r;
|
74
73
|
return l.value === ((r = a.value) == null ? void 0 : r[0]);
|
75
74
|
})) == null ? void 0 : e.label : u("portalshell.components.restaurantSelector.restaurantCount", {
|
@@ -77,7 +76,7 @@ const me = { class: "w-full flex flex-col gap-8" }, pe = { class: "flex items-ce
|
|
77
76
|
}) : u("portalshell.components.restaurantSelector.allRestaurants");
|
78
77
|
}), W = i(() => {
|
79
78
|
var e;
|
80
|
-
return a.value ? ((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");
|
81
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(
|
82
81
|
w,
|
83
82
|
a
|
@@ -101,10 +100,10 @@ const me = { class: "w-full flex flex-col gap-8" }, pe = { class: "flex items-ce
|
|
101
100
|
a.value = null;
|
102
101
|
return;
|
103
102
|
}
|
104
|
-
const l =
|
103
|
+
const l = b.value.filter((r) => I(r.customAttributes || {}, c.value));
|
105
104
|
a.value = l.map((r) => r._id);
|
106
105
|
} else {
|
107
|
-
const l =
|
106
|
+
const l = b.value.filter((r) => I(r.customAttributes || {}, c.value));
|
108
107
|
l.length === 0 ? a.value = null : a.value = (e = l[0]) == null ? void 0 : e._id;
|
109
108
|
}
|
110
109
|
},
|
@@ -147,7 +146,7 @@ const me = { class: "w-full flex flex-col gap-8" }, pe = { class: "flex items-ce
|
|
147
146
|
"fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap",
|
148
147
|
q.value
|
149
148
|
])
|
150
|
-
}, re(L.value), 3)) :
|
149
|
+
}, re(L.value), 3)) : E("", !0),
|
151
150
|
m(r, {
|
152
151
|
color: O.value,
|
153
152
|
name: "keyboard_arrow_down",
|
@@ -166,15 +165,15 @@ const me = { class: "w-full flex flex-col gap-8" }, pe = { class: "flex items-ce
|
|
166
165
|
onClick: l[0] || (l[0] = j(() => {
|
167
166
|
}, ["prevent"]))
|
168
167
|
}, null, 8, ["outline", "color"])
|
169
|
-
])) :
|
168
|
+
])) : E("", !0)
|
170
169
|
]),
|
171
170
|
_: 1
|
172
171
|
}, 8, ["disabled"])
|
173
172
|
])
|
174
173
|
]),
|
175
174
|
default: z(() => [
|
176
|
-
k("div",
|
177
|
-
k("div",
|
175
|
+
k("div", be, [
|
176
|
+
k("div", he, [
|
178
177
|
k("div", ye, [
|
179
178
|
m(A, {
|
180
179
|
modelValue: p(n),
|
@@ -184,7 +183,7 @@ const me = { class: "w-full flex flex-col gap-8" }, pe = { class: "flex items-ce
|
|
184
183
|
])
|
185
184
|
]),
|
186
185
|
k("div", _e, [
|
187
|
-
e.multiple ? (d(), y(
|
186
|
+
e.multiple ? (d(), y($, { key: 0 }, [
|
188
187
|
m(M, {
|
189
188
|
label: "All",
|
190
189
|
"has-checkbox": "",
|
@@ -192,7 +191,7 @@ const me = { class: "w-full flex flex-col gap-8" }, pe = { class: "flex items-ce
|
|
192
191
|
indeterminate: p(J),
|
193
192
|
onClick: p(G)
|
194
193
|
}, null, 8, ["model-value", "indeterminate", "onClick"]),
|
195
|
-
(d(!0), y(
|
194
|
+
(d(!0), y($, null, K(w.value, (s) => {
|
196
195
|
var B;
|
197
196
|
return d(), P(M, {
|
198
197
|
key: s.value,
|
@@ -202,7 +201,7 @@ const me = { class: "w-full flex flex-col gap-8" }, pe = { class: "flex items-ce
|
|
202
201
|
onClick: (Ce) => p(H)(s.value)
|
203
202
|
}, null, 8, ["label", "model-value", "onClick"]);
|
204
203
|
}), 128))
|
205
|
-
], 64)) : (d(!0), y(
|
204
|
+
], 64)) : (d(!0), y($, { key: 1 }, K(w.value, (s) => (d(), P(M, {
|
206
205
|
key: s.value,
|
207
206
|
label: s.label,
|
208
207
|
onClick: (B) => S(s.value)
|
@@ -215,18 +214,18 @@ const me = { class: "w-full flex flex-col gap-8" }, pe = { class: "flex items-ce
|
|
215
214
|
oe(e.$slots, "append-right")
|
216
215
|
]),
|
217
216
|
F.value ? (d(), y("div", ke, [
|
218
|
-
m(p(
|
217
|
+
m(p(ve), {
|
219
218
|
ref_key: "filterRef",
|
220
219
|
ref: R,
|
221
220
|
attributes: o.value,
|
222
221
|
modelValue: c.value,
|
223
222
|
"onUpdate:modelValue": l[2] || (l[2] = (s) => c.value = s)
|
224
223
|
}, null, 8, ["attributes", "modelValue"])
|
225
|
-
])) :
|
224
|
+
])) : E("", !0)
|
226
225
|
]);
|
227
226
|
};
|
228
227
|
}
|
229
228
|
});
|
230
229
|
export {
|
231
|
-
|
230
|
+
Oe as default
|
232
231
|
};
|