@feedmepos/mf-common 1.26.8 → 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-6ed5a586.js +102 -0
- package/dist/{ItemSelector-cc1896b7.js → ItemSelector-857bb5e5.js} +460 -471
- package/dist/RestaurantSelector-05e5e2d8.js +226 -0
- package/dist/{app-2d272ee9.js → app-bac1d13e.js} +16011 -15723
- 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/composables/usePaginatedBusinesses.d.ts +2 -0
- package/dist/composables/usePaginatedBusinesses.d.ts.map +1 -1
- package/dist/i18n.d.ts +13 -0
- package/dist/i18n.d.ts.map +1 -1
- package/dist/locales/th-TH.json +2 -2
- package/dist/store.d.ts +96 -0
- package/dist/store.d.ts.map +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/vite-preset.d.ts.map +1 -1
- package/dist/vite-preset.js +2 -2
- package/package.json +9 -9
- package/dist/CustomAttributesForm-5b6d4433.js +0 -96
- package/dist/RestaurantSelector-84c538d3.js +0 -218
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"vite-preset.d.ts","sourceRoot":"","sources":["../vite-preset.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"vite-preset.d.ts","sourceRoot":"","sources":["../vite-preset.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAwB,UAAU,EAAE,MAAM,MAAM,CAAA;AAKvE,MAAM,WAAW,kBAAkB;IACjC,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC9B,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC9B,mBAAmB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC5C,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACxC,KAAK,CAAC,EAAE,OAAO,CAAA;IAIf,WAAW,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAA;IAChC,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B;AAED,eAAO,MAAM,eAAe,WAClB,UAAU,qBACC,SAAS,YACnB,kBAAkB,KAC1B,QAAQ,UAAU,CAkJpB,CAAA"}
|
package/dist/vite-preset.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import { resolve as h } from "path";
|
2
1
|
import { readFileSync as b } from "fs";
|
2
|
+
import { resolve as h } from "path";
|
3
3
|
const g = (l) => {
|
4
4
|
const r = l.join("|");
|
5
5
|
return new RegExp(`^(${r})(\\/.*)?$`);
|
@@ -82,7 +82,7 @@ const g = (l) => {
|
|
82
82
|
} : {}
|
83
83
|
}, o = {
|
84
84
|
"@vue/devtools-api": "6.5.0/lib/esm/index.js",
|
85
|
-
vue: "3.5.
|
85
|
+
vue: "3.5.16/dist/vue.esm-browser.prod.min.js",
|
86
86
|
"vue-router": "4.2.5/dist/vue-router.esm-browser.min.js",
|
87
87
|
pinia: "2.1.7/+esm"
|
88
88
|
};
|
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"
|
@@ -16,25 +16,25 @@
|
|
16
16
|
"./style.css": "./dist/style.css"
|
17
17
|
},
|
18
18
|
"dependencies": {
|
19
|
-
"@
|
19
|
+
"@casl/ability": "^3.2.0",
|
20
20
|
"@feedmepos/auth": "^1.2.1-beta.3",
|
21
|
-
"@feedmepos/core": "2.14.
|
21
|
+
"@feedmepos/core": "2.14.19",
|
22
22
|
"@feedmepos/menu": "1.4.3",
|
23
23
|
"@feedmepos/i18n": "0.3.1",
|
24
24
|
"@feedmepos/custom-attributes": "0.0.0-rc.6",
|
25
|
-
"
|
25
|
+
"@feedmepos/ui-library": "1.7.0",
|
26
|
+
"@feedmepos/vue-client-monitoring": "0.1.0-beta.6",
|
26
27
|
"@vue/devtools-api": "^6.5.0",
|
27
28
|
"@vueuse/core": "^10.11.0",
|
28
29
|
"axios": "^1.7.7",
|
29
30
|
"firebase": "^10.12.2",
|
30
31
|
"libphonenumber-js": "^1.11.1",
|
31
32
|
"pinia": "^2.1.6",
|
32
|
-
"vue": "^3.5.13",
|
33
|
-
"vue-router": "^4.2.5",
|
34
|
-
"@casl/ability": "^3.2.0",
|
35
33
|
"sift": "^17.1.3",
|
36
|
-
"
|
37
|
-
"vue-country-flag-next": "2.3.2"
|
34
|
+
"vue": "^3.5.16",
|
35
|
+
"vue-country-flag-next": "2.3.2",
|
36
|
+
"vue-i18n": "10.0.5",
|
37
|
+
"vue-router": "^4.2.5"
|
38
38
|
},
|
39
39
|
"devDependencies": {
|
40
40
|
"@tsconfig/node18": "^18.2.2",
|
@@ -1,96 +0,0 @@
|
|
1
|
-
import { defineComponent as _, computed as m, resolveComponent as v, openBlock as c, createElementBlock as p, createVNode as k, toDisplayString as A, unref as N, h as V } from "vue";
|
2
|
-
import { t as S, u as C } from "./app-2d272ee9.js";
|
3
|
-
import { components as O } from "@feedmepos/ui-library";
|
4
|
-
import { c as w } from "./object-27ce045b.js";
|
5
|
-
import "pinia";
|
6
|
-
import "vue-router";
|
7
|
-
const F = { key: 0 }, x = {
|
8
|
-
key: 1,
|
9
|
-
class: "text-fm-color-neutral-gray-500"
|
10
|
-
}, D = /* @__PURE__ */ _({
|
11
|
-
__name: "CustomAttributesForm",
|
12
|
-
props: {
|
13
|
-
entity: {},
|
14
|
-
modelValue: {},
|
15
|
-
valueOptions: {}
|
16
|
-
},
|
17
|
-
emits: ["update:modelValue"],
|
18
|
-
setup(d, { emit: f }) {
|
19
|
-
const s = d, b = f, { t: l } = S(), a = C();
|
20
|
-
function h(t) {
|
21
|
-
var o;
|
22
|
-
if ((o = s.valueOptions) != null && o[t] && s.valueOptions[t].length > 0)
|
23
|
-
return s.valueOptions[t];
|
24
|
-
if (s.entity === "restaurant") {
|
25
|
-
const e = a.restaurants.value.map((n) => {
|
26
|
-
var i;
|
27
|
-
return (i = n.customAttributes) == null ? void 0 : i[t];
|
28
|
-
}).filter((n) => typeof n == "string" && !!n), r = [...new Set(e)];
|
29
|
-
return r.length > 0 ? r : void 0;
|
30
|
-
}
|
31
|
-
}
|
32
|
-
const y = m(() => {
|
33
|
-
var t, o;
|
34
|
-
return ((o = (t = a.currentBusiness.value) == null ? void 0 : t.attributeSettings) == null ? void 0 : o.filter(
|
35
|
-
(e) => e.entity === s.entity
|
36
|
-
)) || [];
|
37
|
-
}), u = m(() => y.value.map((t) => {
|
38
|
-
var e;
|
39
|
-
const o = h(t.key);
|
40
|
-
return {
|
41
|
-
key: t.key,
|
42
|
-
type: t.type,
|
43
|
-
value: ((e = s.modelValue) == null ? void 0 : e[t.key]) || "",
|
44
|
-
options: o
|
45
|
-
};
|
46
|
-
}) || []), g = [
|
47
|
-
{
|
48
|
-
header: () => l("portalshell.customAttributes.form.key"),
|
49
|
-
accessorKey: "key",
|
50
|
-
enableSorting: !1
|
51
|
-
},
|
52
|
-
{
|
53
|
-
header: () => l("portalshell.customAttributes.form.value"),
|
54
|
-
accessorKey: "value",
|
55
|
-
enableSorting: !1,
|
56
|
-
cell: (t) => {
|
57
|
-
const o = t.row.original;
|
58
|
-
return V(O.FmTextField, {
|
59
|
-
modelValue: o.value,
|
60
|
-
placeholder: l("portalshell.customAttributes.form.valuePlaceholder"),
|
61
|
-
datalist: o.options,
|
62
|
-
rules: [
|
63
|
-
(e) => o.type === "number" && isNaN(Number(e)) ? l("portalshell.customAttributes.form.attributeValueMustBeNumber") : !0
|
64
|
-
],
|
65
|
-
"onUpdate:modelValue": (e) => {
|
66
|
-
const r = w(s.modelValue);
|
67
|
-
if (r[o.key] = e == null ? void 0 : e.trim(), o.type === "number") {
|
68
|
-
if (isNaN(Number(e)))
|
69
|
-
return;
|
70
|
-
r[o.key] = Number(e);
|
71
|
-
}
|
72
|
-
Object.keys(r).forEach((n) => {
|
73
|
-
r[n] || delete r[n];
|
74
|
-
}), b("update:modelValue", r);
|
75
|
-
}
|
76
|
-
});
|
77
|
-
}
|
78
|
-
}
|
79
|
-
];
|
80
|
-
return (t, o) => {
|
81
|
-
const e = v("FmTable");
|
82
|
-
return u.value.length > 0 ? (c(), p("div", F, [
|
83
|
-
k(e, {
|
84
|
-
"column-defs": g,
|
85
|
-
"row-data": u.value,
|
86
|
-
"shrink-at": !1,
|
87
|
-
"page-size": u.value.length,
|
88
|
-
"hide-footer": ""
|
89
|
-
}, null, 8, ["row-data", "page-size"])
|
90
|
-
])) : (c(), p("p", x, A(N(l)("portalshell.customAttributes.form.noCustomAttributes")), 1));
|
91
|
-
};
|
92
|
-
}
|
93
|
-
});
|
94
|
-
export {
|
95
|
-
D as default
|
96
|
-
};
|
@@ -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-2d272ee9.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
|
-
};
|