@feedmepos/mf-common 1.16.0-beta.1 → 1.16.0-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-ce654716.js +96 -0
- package/dist/Entry.vue.d.ts.map +1 -1
- package/dist/ItemSelector-34a22281.js +24762 -0
- package/dist/RestaurantSelector-de19c80b.js +217 -0
- package/dist/api/index.d.ts +2 -1
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/menu.d.ts +7 -0
- package/dist/api/menu.d.ts.map +1 -0
- package/dist/app-d0c25293.js +38699 -0
- package/dist/app-f61631fd.js +7848 -0
- package/dist/app.d.ts +174 -3
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +27 -46924
- package/dist/components/ItemSelector.vue.d.ts +42 -0
- package/dist/components/ItemSelector.vue.d.ts.map +1 -0
- package/dist/components/attribute/CustomAttributesForm.vue.d.ts +3 -0
- package/dist/components/attribute/CustomAttributesForm.vue.d.ts.map +1 -1
- package/dist/composables/search.d.ts +6 -0
- package/dist/composables/search.d.ts.map +1 -0
- package/dist/object-27ce045b.js +16 -0
- package/dist/stores/menu.d.ts +7231 -0
- package/dist/stores/menu.d.ts.map +1 -0
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/package.json +2 -1
@@ -0,0 +1,96 @@
|
|
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 { n as S, u as C } from "./app-d0c25293.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
|
+
};
|
package/dist/Entry.vue.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Entry.vue.d.ts","sourceRoot":"","sources":["../../src/Entry.vue.ts"],"names":[],"mappings":";
|
1
|
+
{"version":3,"file":"Entry.vue.d.ts","sourceRoot":"","sources":["../../src/Entry.vue.ts"],"names":[],"mappings":";AA2TA,wBAKG"}
|