@feedmepos/mf-common 1.29.24 → 1.29.25
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-199ad42d.js → CustomAttributesForm-97319d56.js} +1 -1
- package/dist/{ItemSelector-64b7c958.js → ItemSelector-eefda1b9.js} +1 -1
- package/dist/{RestaurantSelector-23d5ddb4.js → RestaurantSelector-1352748c.js} +109 -103
- package/dist/{app-9ae28090.js → app-594ba388.js} +5699 -5674
- package/dist/app.js +2 -2
- package/dist/components/Portal/PortalDesktop.vue.d.ts.map +1 -1
- package/dist/components/RestaurantSelector.vue.d.ts +5 -0
- package/dist/components/RestaurantSelector.vue.d.ts.map +1 -1
- package/dist/components.d.ts +5 -0
- package/dist/components.d.ts.map +1 -1
- package/dist/composables/usePaginatedBusinesses.d.ts +6 -0
- package/dist/composables/usePaginatedBusinesses.d.ts.map +1 -1
- package/dist/store.d.ts +81 -5
- package/dist/store.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as C, computed as b, resolveComponent as N, openBlock as h, createElementBlock as v, createVNode as S, toDisplayString as F, unref as w, h as d } from "vue";
|
|
2
|
-
import { t as x, u as B } from "./app-
|
|
2
|
+
import { t as x, u as B } from "./app-594ba388.js";
|
|
3
3
|
import { components as c } from "@feedmepos/ui-library";
|
|
4
4
|
import { c as O } from "./object-27ce045b.js";
|
|
5
5
|
import "pinia";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ref as Fr, computed as Vt, defineComponent as Rd, onMounted as qd, watch as Ks, resolveComponent as _i, openBlock as It, createElementBlock as $n, createElementVNode as Rt, toDisplayString as Ys, unref as qt, createVNode as en, isRef as Bd, createCommentVNode as ra, Fragment as Io, renderList as To, createBlock as Ei, withCtx as Co, normalizeClass as ds, Transition as Js } from "vue";
|
|
2
|
-
import { c as kr, l as G, d as xe, e as Ie, f as Nd, u as $s, g as Ud, a as xd, O as Ws, t as Ld, b as Gd } from "./app-
|
|
2
|
+
import { c as kr, l as G, d as xe, e as Ie, f as Nd, u as $s, g as Ud, a as xd, O as Ws, t as Ld, b as Gd } from "./app-594ba388.js";
|
|
3
3
|
import { FmButtonVariant as aa } from "@feedmepos/ui-library";
|
|
4
4
|
import { defineStore as Vd } from "pinia";
|
|
5
5
|
import { c as ia } from "./object-27ce045b.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { t as ve, u as de, a as fe, O as
|
|
1
|
+
import { ref as S, computed as o, defineComponent as ne, mergeModels as ue, useModel as re, watch as j, resolveComponent as C, openBlock as i, createElementBlock as y, createElementVNode as w, createVNode as k, withCtx as N, renderSlot as K, normalizeClass as oe, toDisplayString as se, createCommentVNode as Q, createBlock as R, withModifiers as T, unref as g, isRef as ie, Fragment as E, renderList as W, nextTick as ce } from "vue";
|
|
2
|
+
import { t as ve, u as de, a as fe, O as P, b as me } from "./app-594ba388.js";
|
|
3
3
|
import "@feedmepos/ui-library";
|
|
4
4
|
import "pinia";
|
|
5
5
|
import "vue-router";
|
|
6
6
|
function pe(f, t, c = f) {
|
|
7
|
-
const a =
|
|
7
|
+
const a = S(!0), v = o(() => {
|
|
8
8
|
if (!a.value && !t.value)
|
|
9
9
|
return !0;
|
|
10
10
|
if (t.value && t.value.length > 0) {
|
|
@@ -13,8 +13,8 @@ function pe(f, t, c = f) {
|
|
|
13
13
|
}
|
|
14
14
|
return !1;
|
|
15
15
|
}), x = o(() => {
|
|
16
|
-
var u, n,
|
|
17
|
-
return !!((u = t.value) != null && u.length && ((n = t.value) == null ? void 0 : n.length) > 0 && ((
|
|
16
|
+
var u, n, b, m;
|
|
17
|
+
return !!((u = t.value) != null && u.length && ((n = t.value) == null ? void 0 : n.length) > 0 && ((b = t.value) == null ? void 0 : b.length) < ((m = f.value) == null ? void 0 : m.length));
|
|
18
18
|
});
|
|
19
19
|
return { allCleared: a, allSelected: v, indeterminate: x, toggleAll: () => {
|
|
20
20
|
if (v.value) {
|
|
@@ -24,14 +24,14 @@ function pe(f, t, c = f) {
|
|
|
24
24
|
const u = c.value.map((n) => n.value);
|
|
25
25
|
u.length === f.value.length ? (t.value = void 0, a.value = !1) : (t.value = u, a.value = !1);
|
|
26
26
|
}, toggleOption: (u) => {
|
|
27
|
-
var
|
|
27
|
+
var b, m, F;
|
|
28
28
|
let n;
|
|
29
|
-
t.value === void 0 && a.value ? n = [u] : t.value === void 0 && !a.value ? n = (
|
|
29
|
+
t.value === void 0 && a.value ? n = [u] : t.value === void 0 && !a.value ? n = (b = f.value.map((p) => p.value)) == null ? void 0 : b.filter((p) => p !== u) : (m = t.value) != null && m.includes(u) ? n = (F = t.value) == null ? void 0 : F.filter((p) => p !== u) : n = [...t.value || [], u], n.length === 0 ? (t.value = void 0, a.value = !0) : n.length === f.value.length ? (t.value = void 0, a.value = !1) : t.value = n;
|
|
30
30
|
} };
|
|
31
31
|
}
|
|
32
|
-
const ge = { class: "w-full flex flex-col gap-8" }, he = { class: "flex items-center gap-8 min-w-0" }, be = { class: "inline-flex items-center max-w-full" }, ye = { class: "flex flex-col w-[360px] min-h-0 gap-8" },
|
|
32
|
+
const ge = { class: "w-full flex flex-col gap-8" }, he = { class: "flex items-center gap-8 min-w-0" }, be = { class: "inline-flex items-center max-w-full" }, ye = { class: "flex flex-col w-[360px] min-h-0 gap-8" }, ke = { class: "flex gap-4 px-[6px]" }, _e = { class: "flex-1" }, Ce = { class: "flex-1 overflow-y-auto min-h-0" }, we = { key: 0 }, Me = /* @__PURE__ */ ne({
|
|
33
33
|
__name: "RestaurantSelector",
|
|
34
|
-
props: /* @__PURE__ */
|
|
34
|
+
props: /* @__PURE__ */ ue({
|
|
35
35
|
multiple: { type: Boolean, default: !1 },
|
|
36
36
|
excludeRestaurants: {},
|
|
37
37
|
managableOnly: { type: Boolean, default: !0 },
|
|
@@ -44,22 +44,22 @@ const ge = { class: "w-full flex flex-col gap-8" }, he = { class: "flex items-ce
|
|
|
44
44
|
}),
|
|
45
45
|
emits: ["update:modelValue"],
|
|
46
46
|
setup(f) {
|
|
47
|
-
const t = f, { t: c } = ve(), a =
|
|
48
|
-
function
|
|
47
|
+
const t = f, { t: c } = ve(), a = re(f, "modelValue"), { restaurants: v, restaurantAttributeSettings: x } = de(), h = o(() => v.value.length === 0);
|
|
48
|
+
function D(e) {
|
|
49
49
|
const l = v.value.map((_) => {
|
|
50
|
-
var
|
|
51
|
-
return (
|
|
50
|
+
var O;
|
|
51
|
+
return (O = _.customAttributes) == null ? void 0 : O[e];
|
|
52
52
|
}).filter((_) => typeof _ == "string" && !!_);
|
|
53
53
|
return [...new Set(l)];
|
|
54
54
|
}
|
|
55
55
|
const u = o(() => x.value.map((e) => {
|
|
56
|
-
const l =
|
|
56
|
+
const l = D(e.key);
|
|
57
57
|
return {
|
|
58
58
|
...e,
|
|
59
59
|
values: l
|
|
60
60
|
};
|
|
61
|
-
})), { searchKey: n, filter:
|
|
62
|
-
function
|
|
61
|
+
})), { searchKey: n, filter: b } = fe(), m = S(null);
|
|
62
|
+
function F(e) {
|
|
63
63
|
var l;
|
|
64
64
|
if (t.multiple)
|
|
65
65
|
throw new Error("Single selection is not supported for multiple selection");
|
|
@@ -71,12 +71,12 @@ const ge = { class: "w-full flex flex-col gap-8" }, he = { class: "flex items-ce
|
|
|
71
71
|
label: `${l} (${r ?? "--"})`,
|
|
72
72
|
value: e._id
|
|
73
73
|
};
|
|
74
|
-
}, M = o(() => v.value.map(p)),
|
|
75
|
-
() => v.value.filter((e) => t.managableOnly ? e.managable : !0).filter((e) => t.multiple ? !0 :
|
|
74
|
+
}, M = o(() => v.value.map(p)), V = o(
|
|
75
|
+
() => v.value.filter((e) => t.managableOnly ? e.managable : !0).filter((e) => t.multiple ? !0 : P(e.customAttributes || {}, d.value)).map(p).filter(({ label: e }) => b([e])).filter((e) => {
|
|
76
76
|
var l;
|
|
77
77
|
return !((l = t.excludeRestaurants) != null && l.includes(e.value));
|
|
78
78
|
})
|
|
79
|
-
),
|
|
79
|
+
), q = o(() => {
|
|
80
80
|
var e;
|
|
81
81
|
return a.value ? a.value.length === 1 ? (e = M.value.find((l) => {
|
|
82
82
|
var r;
|
|
@@ -84,21 +84,21 @@ const ge = { class: "w-full flex flex-col gap-8" }, he = { class: "flex items-ce
|
|
|
84
84
|
})) == null ? void 0 : e.label : c("portalshell.components.restaurantSelector.restaurantCount", {
|
|
85
85
|
count: a.value.length
|
|
86
86
|
}) : c("portalshell.components.restaurantSelector.allRestaurants");
|
|
87
|
-
}),
|
|
87
|
+
}), G = o(() => {
|
|
88
88
|
var e;
|
|
89
89
|
return a.value ? ((e = M.value.find((l) => l.value === a.value)) == null ? void 0 : e.label) || c("portalshell.components.restaurantSelector.unknownRestaurant") : c("portalshell.components.restaurantSelector.selectRestaurant");
|
|
90
|
-
}),
|
|
90
|
+
}), B = o(() => t.multiple ? q.value : G.value), z = o(() => t.disabled ? "neutral-gray-200" : t.variant === "dark" ? "neutral-black" : "neutral-gray-400"), H = o(() => t.disabled ? "text-fm-color-neutral-gray-200" : t.variant === "dark" ? "text-fm-color-neutral-black" : "text-fm-color-neutral-gray-400"), { allSelected: U, toggleAll: J, toggleOption: X, indeterminate: Y } = pe(
|
|
91
91
|
M,
|
|
92
92
|
a,
|
|
93
|
-
|
|
94
|
-
),
|
|
95
|
-
async function
|
|
96
|
-
t.disabled || (
|
|
93
|
+
V
|
|
94
|
+
), A = S(!1), Z = o(() => x.value.length > 0), $ = S(null);
|
|
95
|
+
async function ee() {
|
|
96
|
+
t.disabled || h.value || (A.value ? A.value = !1 : (A.value = !0, await ce(), $.value && $.value.toggleProperty(!0)));
|
|
97
97
|
}
|
|
98
|
-
const d =
|
|
98
|
+
const d = S((() => ({
|
|
99
99
|
logic: "AND",
|
|
100
100
|
rules: []
|
|
101
|
-
}))()),
|
|
101
|
+
}))()), le = o(() => {
|
|
102
102
|
var e, l;
|
|
103
103
|
return ((l = (e = d.value) == null ? void 0 : e.rules) == null ? void 0 : l.length) || 0;
|
|
104
104
|
});
|
|
@@ -111,10 +111,10 @@ const ge = { class: "w-full flex flex-col gap-8" }, he = { class: "flex items-ce
|
|
|
111
111
|
a.value = null;
|
|
112
112
|
return;
|
|
113
113
|
}
|
|
114
|
-
const l = v.value.filter((r) =>
|
|
114
|
+
const l = v.value.filter((r) => P(r.customAttributes || {}, d.value));
|
|
115
115
|
a.value = l.map((r) => r._id);
|
|
116
116
|
} else {
|
|
117
|
-
const l = v.value.filter((r) =>
|
|
117
|
+
const l = v.value.filter((r) => P(r.customAttributes || {}, d.value));
|
|
118
118
|
l.length === 0 ? a.value = null : a.value = (e = l[0]) == null ? void 0 : e._id;
|
|
119
119
|
}
|
|
120
120
|
},
|
|
@@ -122,123 +122,129 @@ const ge = { class: "w-full flex flex-col gap-8" }, he = { class: "flex items-ce
|
|
|
122
122
|
deep: !0
|
|
123
123
|
}
|
|
124
124
|
), j(
|
|
125
|
-
[() => t.autoSelectFirst,
|
|
125
|
+
[() => t.autoSelectFirst, V],
|
|
126
126
|
([e, l]) => {
|
|
127
127
|
e && l.length > 0 && !a.value && (a.value = l[0].value);
|
|
128
128
|
},
|
|
129
129
|
{ immediate: !0 }
|
|
130
130
|
), (e, l) => {
|
|
131
|
-
const r =
|
|
132
|
-
return i(),
|
|
133
|
-
|
|
134
|
-
|
|
131
|
+
const r = C("FmIcon"), _ = C("FmCircularProgress"), O = C("FmChip"), te = C("FmSearch"), L = C("FmMenuItem"), ae = C("FmMenu");
|
|
132
|
+
return i(), y("div", ge, [
|
|
133
|
+
w("div", he, [
|
|
134
|
+
k(ae, {
|
|
135
135
|
class: "min-w-0",
|
|
136
136
|
"close-on-click": !1,
|
|
137
|
-
disabled: e.disabled ||
|
|
137
|
+
disabled: e.disabled || h.value,
|
|
138
138
|
ref_key: "menuRef",
|
|
139
139
|
ref: m,
|
|
140
140
|
"z-index": 50,
|
|
141
141
|
"selector-for-dismiss-away-event-exclusion": ".fm-dialog, .fm-select__menu__wrapper"
|
|
142
142
|
}, {
|
|
143
|
-
"menu-button":
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
y(
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
143
|
+
"menu-button": N(() => [
|
|
144
|
+
K(e.$slots, "menu-button", {
|
|
145
|
+
disabled: e.disabled || h.value,
|
|
146
|
+
isLoading: h.value,
|
|
147
|
+
label: B.value
|
|
148
|
+
}, () => [
|
|
149
|
+
w("div", be, [
|
|
150
|
+
k(O, {
|
|
151
|
+
disabled: e.disabled || h.value,
|
|
152
|
+
class: "max-w-full overflow-hidden"
|
|
153
|
+
}, {
|
|
154
|
+
default: N(() => [
|
|
155
|
+
k(r, {
|
|
156
|
+
color: z.value,
|
|
157
|
+
name: "storefront",
|
|
158
|
+
outline: "",
|
|
159
|
+
size: "sm"
|
|
160
|
+
}, null, 8, ["color"]),
|
|
161
|
+
B.value ? (i(), y("div", {
|
|
162
|
+
key: 0,
|
|
163
|
+
class: oe([
|
|
164
|
+
"fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap",
|
|
165
|
+
H.value
|
|
166
|
+
])
|
|
167
|
+
}, se(B.value), 3)) : Q("", !0),
|
|
168
|
+
h.value ? (i(), R(_, {
|
|
169
|
+
key: 1,
|
|
170
|
+
size: "md"
|
|
171
|
+
})) : (i(), R(r, {
|
|
172
|
+
key: 2,
|
|
173
|
+
color: z.value,
|
|
174
|
+
name: "keyboard_arrow_down",
|
|
175
|
+
size: "sm"
|
|
176
|
+
}, null, 8, ["color"])),
|
|
177
|
+
Z.value ? (i(), y("div", {
|
|
178
|
+
key: 3,
|
|
179
|
+
class: "pl-8 flex items-center justify-center border-l border-fm-color-neutral-gray-200",
|
|
180
|
+
onClick: T(ee, ["stop"])
|
|
181
|
+
}, [
|
|
182
|
+
k(r, {
|
|
183
|
+
name: "filter_alt",
|
|
184
|
+
size: "sm",
|
|
185
|
+
outline: le.value === 0,
|
|
186
|
+
color: z.value,
|
|
187
|
+
onClick: l[0] || (l[0] = T(() => {
|
|
188
|
+
}, ["prevent"]))
|
|
189
|
+
}, null, 8, ["outline", "color"])
|
|
190
|
+
])) : Q("", !0)
|
|
191
|
+
]),
|
|
192
|
+
_: 1
|
|
193
|
+
}, 8, ["disabled"])
|
|
194
|
+
])
|
|
189
195
|
])
|
|
190
196
|
]),
|
|
191
|
-
default:
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
197
|
+
default: N(() => [
|
|
198
|
+
w("div", ye, [
|
|
199
|
+
w("div", ke, [
|
|
200
|
+
w("div", _e, [
|
|
201
|
+
k(te, {
|
|
196
202
|
modelValue: g(n),
|
|
197
|
-
"onUpdate:modelValue": l[1] || (l[1] = (s) =>
|
|
203
|
+
"onUpdate:modelValue": l[1] || (l[1] = (s) => ie(n) ? n.value = s : null),
|
|
198
204
|
placeholder: g(c)("common.search")
|
|
199
205
|
}, null, 8, ["modelValue", "placeholder"])
|
|
200
206
|
])
|
|
201
207
|
]),
|
|
202
|
-
|
|
203
|
-
e.multiple ? (i(),
|
|
204
|
-
|
|
208
|
+
w("div", Ce, [
|
|
209
|
+
e.multiple ? (i(), y(E, { key: 0 }, [
|
|
210
|
+
k(L, {
|
|
205
211
|
label: "All",
|
|
206
212
|
"has-checkbox": "",
|
|
207
213
|
"model-value": g(U),
|
|
208
|
-
indeterminate: g(
|
|
209
|
-
onClick: g(
|
|
214
|
+
indeterminate: g(Y),
|
|
215
|
+
onClick: g(J)
|
|
210
216
|
}, null, 8, ["model-value", "indeterminate", "onClick"]),
|
|
211
|
-
(i(!0),
|
|
217
|
+
(i(!0), y(E, null, W(V.value, (s) => {
|
|
212
218
|
var I;
|
|
213
|
-
return i(),
|
|
219
|
+
return i(), R(L, {
|
|
214
220
|
key: s.value,
|
|
215
221
|
label: s.label,
|
|
216
222
|
"has-checkbox": "",
|
|
217
223
|
"model-value": g(U) || ((I = a.value) == null ? void 0 : I.includes(s.value)),
|
|
218
|
-
onClick: (
|
|
224
|
+
onClick: (xe) => g(X)(s.value)
|
|
219
225
|
}, null, 8, ["label", "model-value", "onClick"]);
|
|
220
226
|
}), 128))
|
|
221
|
-
], 64)) : (i(!0),
|
|
227
|
+
], 64)) : (i(!0), y(E, { key: 1 }, W(V.value, (s) => (i(), R(L, {
|
|
222
228
|
key: s.value,
|
|
223
229
|
label: s.label,
|
|
224
|
-
onClick: (I) =>
|
|
230
|
+
onClick: (I) => F(s.value)
|
|
225
231
|
}, null, 8, ["label", "onClick"]))), 128))
|
|
226
232
|
])
|
|
227
233
|
])
|
|
228
234
|
]),
|
|
229
|
-
_:
|
|
235
|
+
_: 3
|
|
230
236
|
}, 8, ["disabled"]),
|
|
231
|
-
|
|
237
|
+
K(e.$slots, "append-right")
|
|
232
238
|
]),
|
|
233
|
-
|
|
234
|
-
|
|
239
|
+
A.value ? (i(), y("div", we, [
|
|
240
|
+
k(g(me), {
|
|
235
241
|
ref_key: "filterRef",
|
|
236
|
-
ref:
|
|
242
|
+
ref: $,
|
|
237
243
|
attributes: u.value,
|
|
238
244
|
modelValue: d.value,
|
|
239
245
|
"onUpdate:modelValue": l[2] || (l[2] = (s) => d.value = s)
|
|
240
246
|
}, null, 8, ["attributes", "modelValue"])
|
|
241
|
-
])) :
|
|
247
|
+
])) : Q("", !0)
|
|
242
248
|
]);
|
|
243
249
|
};
|
|
244
250
|
}
|