@feedmepos/mf-common 1.15.0 → 1.16.0-beta.2
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-c9df2510.js +93 -0
- package/dist/Entry.vue.d.ts.map +1 -1
- package/dist/ItemSelector-c0733e65.js +24762 -0
- package/dist/RestaurantSelector-79a2b70f.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-f61631fd.js +7848 -0
- package/dist/app-fb5d961e.js +38699 -0
- package/dist/app.d.ts +164 -3
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +27 -46207
- package/dist/components/ItemSelector.vue.d.ts +42 -0
- package/dist/components/ItemSelector.vue.d.ts.map +1 -0
- package/dist/components/RestaurantSelector.vue.d.ts +9 -2
- package/dist/components/RestaurantSelector.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 +3 -2
@@ -0,0 +1,93 @@
|
|
1
|
+
import { defineComponent as g, computed as i, resolveComponent as k, openBlock as m, createElementBlock as c, createVNode as _, toDisplayString as A, unref as N, h as V } from "vue";
|
2
|
+
import { n as S, u as C } from "./app-fb5d961e.js";
|
3
|
+
import { components as v } 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
|
+
}, j = /* @__PURE__ */ g({
|
11
|
+
__name: "CustomAttributesForm",
|
12
|
+
props: {
|
13
|
+
entity: {},
|
14
|
+
modelValue: {}
|
15
|
+
},
|
16
|
+
emits: ["update:modelValue"],
|
17
|
+
setup(p, { emit: d }) {
|
18
|
+
const l = p, f = d, { t: s } = S(), a = C();
|
19
|
+
function b(o) {
|
20
|
+
if (l.entity === "restaurant") {
|
21
|
+
const t = a.restaurants.value.map((r) => {
|
22
|
+
var n;
|
23
|
+
return (n = r.customAttributes) == null ? void 0 : n[o];
|
24
|
+
}).filter((r) => typeof r == "string" && !!r);
|
25
|
+
return [...new Set(t)];
|
26
|
+
}
|
27
|
+
return [];
|
28
|
+
}
|
29
|
+
const y = i(() => {
|
30
|
+
var o, t;
|
31
|
+
return ((t = (o = a.currentBusiness.value) == null ? void 0 : o.attributeSettings) == null ? void 0 : t.filter(
|
32
|
+
(e) => e.entity === l.entity
|
33
|
+
)) || [];
|
34
|
+
}), u = i(() => y.value.map((o) => {
|
35
|
+
var e;
|
36
|
+
const t = b(o.key);
|
37
|
+
return {
|
38
|
+
key: o.key,
|
39
|
+
type: o.type,
|
40
|
+
value: ((e = l.modelValue) == null ? void 0 : e[o.key]) || "",
|
41
|
+
options: t
|
42
|
+
};
|
43
|
+
}) || []), h = [
|
44
|
+
{
|
45
|
+
header: () => s("portalshell.customAttributes.form.key"),
|
46
|
+
accessorKey: "key",
|
47
|
+
enableSorting: !1
|
48
|
+
},
|
49
|
+
{
|
50
|
+
header: () => s("portalshell.customAttributes.form.value"),
|
51
|
+
accessorKey: "value",
|
52
|
+
enableSorting: !1,
|
53
|
+
cell: (o) => {
|
54
|
+
const t = o.row.original;
|
55
|
+
return V(v.FmTextField, {
|
56
|
+
modelValue: t.value,
|
57
|
+
placeholder: s("portalshell.customAttributes.form.valuePlaceholder"),
|
58
|
+
datalist: t.options,
|
59
|
+
rules: [
|
60
|
+
(e) => t.type === "number" && isNaN(Number(e)) ? s("portalshell.customAttributes.form.attributeValueMustBeNumber") : !0
|
61
|
+
],
|
62
|
+
"onUpdate:modelValue": (e) => {
|
63
|
+
const r = w(l.modelValue);
|
64
|
+
if (r[t.key] = e == null ? void 0 : e.trim(), t.type === "number") {
|
65
|
+
if (isNaN(Number(e)))
|
66
|
+
return;
|
67
|
+
r[t.key] = Number(e);
|
68
|
+
}
|
69
|
+
Object.keys(r).forEach((n) => {
|
70
|
+
r[n] || delete r[n];
|
71
|
+
}), f("update:modelValue", r);
|
72
|
+
}
|
73
|
+
});
|
74
|
+
}
|
75
|
+
}
|
76
|
+
];
|
77
|
+
return (o, t) => {
|
78
|
+
const e = k("FmTable");
|
79
|
+
return u.value.length > 0 ? (m(), c("div", F, [
|
80
|
+
_(e, {
|
81
|
+
"column-defs": h,
|
82
|
+
"row-data": u.value,
|
83
|
+
"shrink-at": !1,
|
84
|
+
"page-size": u.value.length,
|
85
|
+
"hide-footer": ""
|
86
|
+
}, null, 8, ["row-data", "page-size"])
|
87
|
+
])) : (m(), c("p", x, A(N(s)("portalshell.customAttributes.form.noCustomAttributes")), 1));
|
88
|
+
};
|
89
|
+
}
|
90
|
+
});
|
91
|
+
export {
|
92
|
+
j as default
|
93
|
+
};
|
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"}
|