@feedmepos/mf-common 1.26.9-beta.1 → 1.26.10
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/dist/{CustomAttributesForm-6dfd958b.js → CustomAttributesForm-6ed5a586.js} +1 -1
- package/dist/{ItemSelector-d8663cd1.js → ItemSelector-857bb5e5.js} +460 -471
- package/dist/RestaurantSelector-05e5e2d8.js +226 -0
- package/dist/{app-31afa149.js → app-bac1d13e.js} +2927 -2890
- package/dist/app.js +12 -12
- package/dist/components/ItemSelector.vue.d.ts +1 -1
- package/dist/components/ItemSelector.vue.d.ts.map +1 -1
- package/dist/components/MyBusinessDialog.vue.d.ts.map +1 -1
- package/dist/components/RestaurantSelector.vue.d.ts +26 -0
- package/dist/components/RestaurantSelector.vue.d.ts.map +1 -1
- package/dist/components/attribute/CustomAttributesForm.vue.d.ts +1 -1
- package/dist/components/attribute/CustomAttributesForm.vue.d.ts.map +1 -1
- package/dist/components.d.ts +30 -0
- package/dist/components.d.ts.map +1 -1
- package/dist/i18n.d.ts +13 -0
- package/dist/i18n.d.ts.map +1 -1
- package/dist/store.d.ts.map +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/dist/RestaurantSelector-ac4d6acb.js +0 -218
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@feedmepos/mf-common",
|
3
|
-
"version": "1.26.
|
3
|
+
"version": "1.26.10",
|
4
4
|
"type": "module",
|
5
5
|
"files": [
|
6
6
|
"dist"
|
@@ -31,7 +31,7 @@
|
|
31
31
|
"libphonenumber-js": "^1.11.1",
|
32
32
|
"pinia": "^2.1.6",
|
33
33
|
"sift": "^17.1.3",
|
34
|
-
"vue": "^3.5.
|
34
|
+
"vue": "^3.5.16",
|
35
35
|
"vue-country-flag-next": "2.3.2",
|
36
36
|
"vue-i18n": "10.0.5",
|
37
37
|
"vue-router": "^4.2.5"
|
@@ -1,218 +0,0 @@
|
|
1
|
-
import { ref as C, computed as i, defineComponent as J, mergeModels as X, useModel as Y, watch as Z, resolveComponent as S, openBlock as v, createElementBlock as b, createElementVNode as k, createVNode as f, withCtx as O, normalizeClass as ee, toDisplayString as le, createCommentVNode as B, withModifiers as E, unref as y, Fragment as z, renderList as $, createBlock as D, renderSlot as te, nextTick as ae } from "vue";
|
2
|
-
import "pinia";
|
3
|
-
import { _ as L, h as ne } from "./app-9575c6c7.js";
|
4
|
-
import { t as re, u as ue } from "./app-31afa149.js";
|
5
|
-
import "@feedmepos/ui-library";
|
6
|
-
import "vue-router";
|
7
|
-
function oe(p, t) {
|
8
|
-
const r = C(!0), n = i(() => {
|
9
|
-
var u, a;
|
10
|
-
return !r.value && (!t.value || ((u = t.value) == null ? void 0 : u.length) === ((a = p.value) == null ? void 0 : a.length));
|
11
|
-
}), g = i(() => {
|
12
|
-
var u, a, m, h;
|
13
|
-
return !!((u = t.value) != null && u.length && ((a = t.value) == null ? void 0 : a.length) > 0 && ((m = t.value) == null ? void 0 : m.length) < ((h = p.value) == null ? void 0 : h.length));
|
14
|
-
});
|
15
|
-
return { allCleared: r, allSelected: n, indeterminate: g, toggleAll: () => {
|
16
|
-
t.value = void 0, r.value = !r.value;
|
17
|
-
}, toggleOption: (u) => {
|
18
|
-
var m, h, w;
|
19
|
-
let a;
|
20
|
-
t.value === void 0 && r.value ? a = [u] : t.value === void 0 && !r.value ? a = (m = p.value.map((c) => c.value)) == null ? void 0 : m.filter((c) => c !== u) : (h = t.value) != null && h.includes(u) ? a = (w = t.value) == null ? void 0 : w.filter((c) => c !== u) : a = [...t.value || [], u], a.length === 0 ? (t.value = void 0, r.value = !0) : a.length === p.value.length ? (t.value = void 0, r.value = !1) : t.value = a;
|
21
|
-
} };
|
22
|
-
}
|
23
|
-
const se = { class: "w-full flex flex-col gap-8" }, ie = { class: "flex items-center gap-8" }, ce = { class: "inline-flex items-center" }, de = { class: "flex flex-col w-[360px] min-h-0 gap-8" }, ve = { class: "flex gap-4 px-[6px]" }, me = { class: "flex-1" }, fe = { class: "flex-1 overflow-y-auto min-h-0" }, pe = { key: 0 }, xe = /* @__PURE__ */ J({
|
24
|
-
__name: "RestaurantSelector",
|
25
|
-
props: /* @__PURE__ */ X({
|
26
|
-
multiple: { type: Boolean, default: !1 },
|
27
|
-
excludeRestaurants: {},
|
28
|
-
managableOnly: { type: Boolean, default: !0 },
|
29
|
-
disabled: { type: Boolean, default: !1 }
|
30
|
-
}, {
|
31
|
-
modelValue: {},
|
32
|
-
modelModifiers: {}
|
33
|
-
}),
|
34
|
-
emits: ["update:modelValue"],
|
35
|
-
setup(p) {
|
36
|
-
const t = p, { t: r } = re(), n = Y(p, "modelValue"), { restaurants: g, restaurantAttributeSettings: A } = ue();
|
37
|
-
function I(e) {
|
38
|
-
const l = g.value.map((_) => {
|
39
|
-
var F;
|
40
|
-
return (F = _.customAttributes) == null ? void 0 : F[e];
|
41
|
-
}).filter((_) => typeof _ == "string" && !!_);
|
42
|
-
return [...new Set(l)];
|
43
|
-
}
|
44
|
-
const u = i(() => A.value.map((e) => {
|
45
|
-
const l = I(e.key);
|
46
|
-
return {
|
47
|
-
...e,
|
48
|
-
values: l
|
49
|
-
};
|
50
|
-
})), a = C(""), m = C(null);
|
51
|
-
function h(e) {
|
52
|
-
var l;
|
53
|
-
if (t.multiple)
|
54
|
-
throw new Error("Single selection is not supported for multiple selection");
|
55
|
-
n.value = e, (l = m.value) == null || l.toggleMenu(!1);
|
56
|
-
}
|
57
|
-
const w = i(() => g.value.map((e) => ({
|
58
|
-
label: e.profile.name,
|
59
|
-
value: e._id
|
60
|
-
}))), c = i(
|
61
|
-
() => g.value.filter((e) => t.managableOnly ? e.managable : !0).filter((e) => a.value ? e.profile.name.toLowerCase().includes(a.value.toLowerCase()) : !0).filter((e) => t.multiple ? !0 : L(e.customAttributes || {}, d.value)).map((e) => ({
|
62
|
-
label: e.profile.name,
|
63
|
-
value: e._id
|
64
|
-
})).filter((e) => {
|
65
|
-
var l;
|
66
|
-
return !((l = t.excludeRestaurants) != null && l.includes(e.value));
|
67
|
-
})
|
68
|
-
), U = i(() => {
|
69
|
-
var e;
|
70
|
-
return n.value ? n.value.length === 1 ? (e = w.value.find((l) => {
|
71
|
-
var o;
|
72
|
-
return l.value === ((o = n.value) == null ? void 0 : o[0]);
|
73
|
-
})) == null ? void 0 : e.label : r("portalshell.components.restaurantSelector.restaurantCount", {
|
74
|
-
count: n.value.length
|
75
|
-
}) : r("portalshell.components.restaurantSelector.allRestaurants");
|
76
|
-
}), j = i(() => {
|
77
|
-
var e;
|
78
|
-
return n.value ? ((e = w.value.find((l) => l.value === n.value)) == null ? void 0 : e.label) || r("portalshell.components.restaurantSelector.unknownRestaurant") : r("portalshell.components.restaurantSelector.selectRestaurant");
|
79
|
-
}), N = i(() => t.multiple ? U.value : j.value), { allCleared: ge, allSelected: Q, toggleAll: K, toggleOption: P, indeterminate: T } = oe(
|
80
|
-
c,
|
81
|
-
n
|
82
|
-
), x = C(!1), W = i(() => A.value.length > 0), V = C(null);
|
83
|
-
async function q() {
|
84
|
-
t.disabled || (x.value ? x.value = !1 : (x.value = !0, await ae(), V.value && V.value.toggleProperty(!0)));
|
85
|
-
}
|
86
|
-
const d = C((() => ({
|
87
|
-
logic: "AND",
|
88
|
-
rules: []
|
89
|
-
}))()), G = i(() => {
|
90
|
-
var e, l;
|
91
|
-
return ((l = (e = d.value) == null ? void 0 : e.rules) == null ? void 0 : l.length) || 0;
|
92
|
-
});
|
93
|
-
return Z(d, () => {
|
94
|
-
var e;
|
95
|
-
if (t.multiple) {
|
96
|
-
if (!d.value || d.value.rules.length === 0) {
|
97
|
-
n.value = null;
|
98
|
-
return;
|
99
|
-
}
|
100
|
-
const l = g.value.filter((o) => L(o.customAttributes || {}, d.value));
|
101
|
-
n.value = l.map((o) => o._id);
|
102
|
-
} else {
|
103
|
-
const l = g.value.filter((o) => L(o.customAttributes || {}, d.value));
|
104
|
-
l.length === 0 ? n.value = null : n.value = (e = l[0]) == null ? void 0 : e._id;
|
105
|
-
}
|
106
|
-
}), (e, l) => {
|
107
|
-
const o = S("FmIcon"), _ = S("FmChip"), F = S("FmSearch"), R = S("FmMenuItem"), H = S("FmMenu");
|
108
|
-
return v(), b("div", se, [
|
109
|
-
k("div", ie, [
|
110
|
-
f(H, {
|
111
|
-
"close-on-click": !1,
|
112
|
-
disabled: t.disabled,
|
113
|
-
ref_key: "menuRef",
|
114
|
-
ref: m,
|
115
|
-
"z-index": 50,
|
116
|
-
"selector-for-dismiss-away-event-exclusion": ".fm-dialog, .fm-select__menu__wrapper"
|
117
|
-
}, {
|
118
|
-
"menu-button": O(() => [
|
119
|
-
k("div", ce, [
|
120
|
-
f(_, {
|
121
|
-
disabled: t.disabled
|
122
|
-
}, {
|
123
|
-
default: O(() => [
|
124
|
-
f(o, {
|
125
|
-
color: e.disabled ? "neutral-gray-200" : "neutral-gray-400",
|
126
|
-
name: "storefront",
|
127
|
-
outline: "",
|
128
|
-
size: "sm"
|
129
|
-
}, null, 8, ["color"]),
|
130
|
-
N.value ? (v(), b("div", {
|
131
|
-
key: 0,
|
132
|
-
class: ee([
|
133
|
-
"fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap",
|
134
|
-
e.disabled ? "text-fm-color-neutral-gray-200" : "text-fm-color-neutral-gray-400"
|
135
|
-
])
|
136
|
-
}, le(N.value), 3)) : B("", !0),
|
137
|
-
f(o, {
|
138
|
-
color: e.disabled ? "neutral-gray-200" : "neutral-gray-400",
|
139
|
-
name: "keyboard_arrow_down",
|
140
|
-
size: "sm"
|
141
|
-
}, null, 8, ["color"]),
|
142
|
-
W.value ? (v(), b("div", {
|
143
|
-
key: 1,
|
144
|
-
class: "pl-8 flex items-center justify-center border-l border-fm-color-neutral-gray-200",
|
145
|
-
onClick: E(q, ["stop"])
|
146
|
-
}, [
|
147
|
-
f(o, {
|
148
|
-
name: "filter_alt",
|
149
|
-
size: "sm",
|
150
|
-
outline: G.value === 0,
|
151
|
-
color: e.disabled ? "neutral-gray-200" : "neutral-gray-400",
|
152
|
-
onClick: l[0] || (l[0] = E(() => {
|
153
|
-
}, ["prevent"]))
|
154
|
-
}, null, 8, ["outline", "color"])
|
155
|
-
])) : B("", !0)
|
156
|
-
]),
|
157
|
-
_: 1
|
158
|
-
}, 8, ["disabled"])
|
159
|
-
])
|
160
|
-
]),
|
161
|
-
default: O(() => [
|
162
|
-
k("div", de, [
|
163
|
-
k("div", ve, [
|
164
|
-
k("div", me, [
|
165
|
-
f(F, {
|
166
|
-
modelValue: a.value,
|
167
|
-
"onUpdate:modelValue": l[1] || (l[1] = (s) => a.value = s),
|
168
|
-
placeholder: y(r)("common.search")
|
169
|
-
}, null, 8, ["modelValue", "placeholder"])
|
170
|
-
])
|
171
|
-
]),
|
172
|
-
k("div", fe, [
|
173
|
-
e.multiple ? (v(), b(z, { key: 0 }, [
|
174
|
-
f(R, {
|
175
|
-
label: "All",
|
176
|
-
"has-checkbox": "",
|
177
|
-
"model-value": y(Q),
|
178
|
-
indeterminate: y(T),
|
179
|
-
onClick: y(K)
|
180
|
-
}, null, 8, ["model-value", "indeterminate", "onClick"]),
|
181
|
-
(v(!0), b(z, null, $(c.value, (s) => {
|
182
|
-
var M;
|
183
|
-
return v(), D(R, {
|
184
|
-
key: s.value,
|
185
|
-
label: s.label,
|
186
|
-
"has-checkbox": "",
|
187
|
-
"model-value": y(Q) || ((M = n.value) == null ? void 0 : M.includes(s.value)),
|
188
|
-
onClick: (be) => y(P)(s.value)
|
189
|
-
}, null, 8, ["label", "model-value", "onClick"]);
|
190
|
-
}), 128))
|
191
|
-
], 64)) : (v(!0), b(z, { key: 1 }, $(c.value, (s) => (v(), D(R, {
|
192
|
-
key: s.value,
|
193
|
-
label: s.label,
|
194
|
-
onClick: (M) => h(s.value)
|
195
|
-
}, null, 8, ["label", "onClick"]))), 128))
|
196
|
-
])
|
197
|
-
])
|
198
|
-
]),
|
199
|
-
_: 1
|
200
|
-
}, 8, ["disabled"]),
|
201
|
-
te(e.$slots, "append-right")
|
202
|
-
]),
|
203
|
-
x.value ? (v(), b("div", pe, [
|
204
|
-
f(y(ne), {
|
205
|
-
ref_key: "filterRef",
|
206
|
-
ref: V,
|
207
|
-
attributes: u.value,
|
208
|
-
modelValue: d.value,
|
209
|
-
"onUpdate:modelValue": l[2] || (l[2] = (s) => d.value = s)
|
210
|
-
}, null, 8, ["attributes", "modelValue"])
|
211
|
-
])) : B("", !0)
|
212
|
-
]);
|
213
|
-
};
|
214
|
-
}
|
215
|
-
});
|
216
|
-
export {
|
217
|
-
xe as default
|
218
|
-
};
|