@feedmepos/mf-common 1.26.8-beta.1 → 1.26.8-beta.3
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 +102 -0
- package/dist/{ItemSelector-89a38fe2.js → ItemSelector-d8663cd1.js} +1 -1
- package/dist/{RestaurantSelector-ada11d44.js → RestaurantSelector-ac4d6acb.js} +1 -1
- package/dist/{app-24adbe08.js → app-31afa149.js} +15668 -15417
- package/dist/app.js +2 -2
- package/dist/components/attribute/CustomAttributesForm.vue.d.ts.map +1 -1
- package/dist/composables/usePaginatedBusinesses.d.ts +2 -0
- package/dist/composables/usePaginatedBusinesses.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/package.json +2 -2
- package/dist/CustomAttributesForm-d2709f16.js +0 -112
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@feedmepos/mf-common",
|
3
|
-
"version": "1.26.8-beta.
|
3
|
+
"version": "1.26.8-beta.3",
|
4
4
|
"type": "module",
|
5
5
|
"files": [
|
6
6
|
"dist"
|
@@ -18,7 +18,7 @@
|
|
18
18
|
"dependencies": {
|
19
19
|
"@feedmepos/ui-library": "1.6.7",
|
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",
|
@@ -1,112 +0,0 @@
|
|
1
|
-
import { defineComponent as S, computed as c, resolveComponent as V, openBlock as p, createElementBlock as d, createVNode as k, toDisplayString as C, unref as O, h as f } from "vue";
|
2
|
-
import { t as D, u as F } from "./app-24adbe08.js";
|
3
|
-
import { components as b } from "@feedmepos/ui-library";
|
4
|
-
import { c as T } from "./object-27ce045b.js";
|
5
|
-
import "pinia";
|
6
|
-
import "vue-router";
|
7
|
-
const E = { key: 0 }, w = {
|
8
|
-
key: 1,
|
9
|
-
class: "text-fm-color-neutral-gray-500"
|
10
|
-
}, G = /* @__PURE__ */ S({
|
11
|
-
__name: "CustomAttributesForm",
|
12
|
-
props: {
|
13
|
-
entity: {},
|
14
|
-
modelValue: {},
|
15
|
-
valueOptions: {}
|
16
|
-
},
|
17
|
-
emits: ["update:modelValue"],
|
18
|
-
setup(h, { emit: y }) {
|
19
|
-
const l = h, g = y, { t: n } = D(), i = F();
|
20
|
-
function A(t) {
|
21
|
-
var e;
|
22
|
-
if ((e = l.valueOptions) != null && e[t] && l.valueOptions[t].length > 0)
|
23
|
-
return l.valueOptions[t];
|
24
|
-
if (l.entity === "restaurant") {
|
25
|
-
const r = i.restaurants.value.map((o) => {
|
26
|
-
var s;
|
27
|
-
return (s = o.customAttributes) == null ? void 0 : s[t];
|
28
|
-
}).filter((o) => typeof o == "string" && !!o), u = [...new Set(r)];
|
29
|
-
return u.length > 0 ? u : void 0;
|
30
|
-
}
|
31
|
-
}
|
32
|
-
const v = c(() => {
|
33
|
-
var t, e;
|
34
|
-
return ((e = (t = i.currentBusiness.value) == null ? void 0 : t.attributeSettings) == null ? void 0 : e.filter(
|
35
|
-
(r) => r.entity === l.entity
|
36
|
-
)) || [];
|
37
|
-
}), a = c(() => v.value.map((t) => {
|
38
|
-
var r;
|
39
|
-
const e = A(t.key);
|
40
|
-
return {
|
41
|
-
key: t.key,
|
42
|
-
type: t.type,
|
43
|
-
value: ((r = l.modelValue) == null ? void 0 : r[t.key]) || "",
|
44
|
-
options: e
|
45
|
-
};
|
46
|
-
}) || []), N = {
|
47
|
-
"Group.customer_attribute.type": ["MIXMATCH", "ADDON"],
|
48
|
-
"Group.items.*.customer_attribute.type": [
|
49
|
-
"DRINK",
|
50
|
-
"FOOD",
|
51
|
-
"MERCHANDISE",
|
52
|
-
"ADDON",
|
53
|
-
"FREEGIFT",
|
54
|
-
"SNACKS",
|
55
|
-
"BOTTLED"
|
56
|
-
]
|
57
|
-
}, _ = [
|
58
|
-
{
|
59
|
-
header: () => n("portalshell.customAttributes.form.key"),
|
60
|
-
accessorKey: "key",
|
61
|
-
enableSorting: !1
|
62
|
-
},
|
63
|
-
{
|
64
|
-
header: () => n("portalshell.customAttributes.form.value"),
|
65
|
-
accessorKey: "value",
|
66
|
-
enableSorting: !1,
|
67
|
-
cell: (t) => {
|
68
|
-
const e = t.row.original, r = (o) => {
|
69
|
-
const s = T(l.modelValue);
|
70
|
-
if (s[e.key] = o == null ? void 0 : o.trim(), e.type === "number") {
|
71
|
-
if (isNaN(Number(o)))
|
72
|
-
return;
|
73
|
-
s[e.key] = Number(o);
|
74
|
-
}
|
75
|
-
Object.keys(s).forEach((m) => {
|
76
|
-
s[m] || delete s[m];
|
77
|
-
}), g("update:modelValue", s);
|
78
|
-
}, u = N[e.key] ?? [];
|
79
|
-
return u != null && u.length ? f(b.FmSelect, {
|
80
|
-
modelValue: e.value,
|
81
|
-
placeholder: n("portalshell.customAttributes.form.valuePlaceholder"),
|
82
|
-
items: u.map((o) => ({ label: o, value: o })),
|
83
|
-
"onUpdate:modelValue": r
|
84
|
-
}) : f(b.FmTextField, {
|
85
|
-
modelValue: e.value,
|
86
|
-
placeholder: n("portalshell.customAttributes.form.valuePlaceholder"),
|
87
|
-
datalist: e.options,
|
88
|
-
rules: [
|
89
|
-
(o) => e.type === "number" && isNaN(Number(o)) ? n("portalshell.customAttributes.form.attributeValueMustBeNumber") : !0
|
90
|
-
],
|
91
|
-
"onUpdate:modelValue": r
|
92
|
-
});
|
93
|
-
}
|
94
|
-
}
|
95
|
-
];
|
96
|
-
return (t, e) => {
|
97
|
-
const r = V("FmTable");
|
98
|
-
return a.value.length > 0 ? (p(), d("div", E, [
|
99
|
-
k(r, {
|
100
|
-
"column-defs": _,
|
101
|
-
"row-data": a.value,
|
102
|
-
"shrink-at": !1,
|
103
|
-
"page-size": a.value.length,
|
104
|
-
"hide-footer": ""
|
105
|
-
}, null, 8, ["row-data", "page-size"])
|
106
|
-
])) : (p(), d("p", w, C(O(n)("portalshell.customAttributes.form.noCustomAttributes")), 1));
|
107
|
-
};
|
108
|
-
}
|
109
|
-
});
|
110
|
-
export {
|
111
|
-
G as default
|
112
|
-
};
|