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