@feedmepos/mf-common 1.16.0-beta.2 → 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.
@@ -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
+ };
@@ -2,7 +2,7 @@ import { ref as lt, computed as Re, defineComponent as si, onMounted as li, watc
2
2
  import { x as Mn, v as ci } from "./app-f61631fd.js";
3
3
  import { FmButtonVariant as Un } from "@feedmepos/ui-library";
4
4
  import { c as er } from "./object-27ce045b.js";
5
- import { c as on, l as fe, e as Nt, a as ve, d as Ze, b as Ke, f as di, u as En, g as pi, n as hi } from "./app-fb5d961e.js";
5
+ import { c as on, l as fe, e as Nt, a as ve, d as Ze, b as Ke, f as di, u as En, g as pi, n as hi } from "./app-d0c25293.js";
6
6
  import { defineStore as fi } from "pinia";
7
7
  import "vue-router";
8
8
  var $t = {};
@@ -24507,10 +24507,10 @@ const Ka = fi("mf-common-menu", () => {
24507
24507
  rules: []
24508
24508
  }))());
24509
24509
  function V(D) {
24510
- const X = C.menu.modules.item.map((e) => {
24511
- var t;
24512
- return (t = e.customAttributes) == null ? void 0 : t[D];
24513
- }).filter((e) => typeof e == "string" && !!e);
24510
+ const X = Object.values(J.value).flatMap((e) => e.items.map((t) => {
24511
+ var n;
24512
+ return (n = t.customAttributes) == null ? void 0 : n[D];
24513
+ })).filter((e) => typeof e == "string" && !!e);
24514
24514
  return [...new Set(X)];
24515
24515
  }
24516
24516
  const G = Re(() => Q.itemAttributeSettings.value.map((D) => {
@@ -1,7 +1,7 @@
1
1
  import { ref as C, computed as i, defineComponent as J, mergeModels as X, useModel as Y, watch as Z, resolveComponent as x, openBlock as v, createElementBlock as h, createElementVNode as k, createVNode as m, withCtx as O, normalizeClass as ee, toDisplayString as le, createCommentVNode as B, withModifiers as E, unref as y, Fragment as L, renderList as $, createBlock as D, renderSlot as te, nextTick as ae } from "vue";
2
2
  import { x as z, v as ne } from "./app-f61631fd.js";
3
3
  import { storeToRefs as re } from "pinia";
4
- import { n as ue, u as oe } from "./app-fb5d961e.js";
4
+ import { n as ue, u as oe } from "./app-d0c25293.js";
5
5
  import "@feedmepos/ui-library";
6
6
  import "vue-router";
7
7
  function se(p, t) {
@@ -38662,10 +38662,10 @@ function PM() {
38662
38662
  return localStorage.getItem("locale") !== i && localStorage.setItem("locale", i), i;
38663
38663
  }
38664
38664
  const _M = co(
38665
- () => import("./CustomAttributesForm-c9df2510.js")
38665
+ () => import("./CustomAttributesForm-ce654716.js")
38666
38666
  ), KM = co(
38667
- () => import("./RestaurantSelector-79a2b70f.js")
38668
- ), $M = co(() => import("./ItemSelector-c0733e65.js"));
38667
+ () => import("./RestaurantSelector-de19c80b.js")
38668
+ ), $M = co(() => import("./ItemSelector-34a22281.js"));
38669
38669
  export {
38670
38670
  _M as C,
38671
38671
  pt as F,
package/dist/app.d.ts CHANGED
@@ -341,6 +341,11 @@ export declare const CustomAttributesForm: import("vue").DefineComponent<import(
341
341
  type: import("vue").PropType<import("./components/attribute/CustomAttributesForm.vue").CustomAttributes>;
342
342
  required: true;
343
343
  };
344
+ valueOptions: {
345
+ type: import("vue").PropType<{
346
+ [key: string]: string[];
347
+ }>;
348
+ };
344
349
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
345
350
  "update:modelValue": (value: import("./components/attribute/CustomAttributesForm.vue").CustomAttributes) => void;
346
351
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
@@ -352,6 +357,11 @@ export declare const CustomAttributesForm: import("vue").DefineComponent<import(
352
357
  type: import("vue").PropType<import("./components/attribute/CustomAttributesForm.vue").CustomAttributes>;
353
358
  required: true;
354
359
  };
360
+ valueOptions: {
361
+ type: import("vue").PropType<{
362
+ [key: string]: string[];
363
+ }>;
364
+ };
355
365
  }>> & Readonly<{
356
366
  "onUpdate:modelValue"?: ((value: import("./components/attribute/CustomAttributesForm.vue").CustomAttributes) => any) | undefined;
357
367
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
package/dist/app.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/app.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,IAAI,MAAM,sBAAsB,CAAA;AAEvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAGxD,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,WAAW,QAenE;AAED,eAAO,MAAM,kBAAkB,sCAAgC,CAAA;A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;;;;;;;;;;;;;;;;;;;;4EAAsE,CAAA"}
package/dist/app.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "vue";
2
- import { k as r, C as n, F as l, _ as m, m as u, I as p, P as c, r as d, R as h, g as C, h as F, j as I, i as S, v as P, q as g, o as b, p as A, s as L, u as M, n as R, t as v, w } from "./app-fb5d961e.js";
2
+ import { k as r, C as n, F as l, _ as m, m as u, I as p, P as c, r as d, R as h, g as C, h as F, j as I, i as S, v as P, q as g, o as b, p as A, s as L, u as M, n as R, t as v, w } from "./app-d0c25293.js";
3
3
  import "pinia";
4
4
  import "vue-router";
5
5
  import "@feedmepos/ui-library";
@@ -1 +1 @@
1
- {"version":3,"file":"ItemSelector.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ItemSelector.vue.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAA;AAiBpD,KAAK,eAAe,GAAG;IACrB,GAAG,EAAE,MAAM,CAAA;IACX,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC/B,CAAA;AAwBD,UAAU,KAAK;IACb,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,gBAAgB,CAAC,EAAE,KAAK,CAAC,eAAe,CAAC,CAAA;IACzC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC,CAAA;CAC7C;;;;;;;;;;;;AAotBD,wBAOG;AACH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE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AC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC;AAC9M,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAE1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QACxE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KACb,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACT,CAAC;AACN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
@@ -3,6 +3,9 @@ export type CustomAttributes = Record<string, any>;
3
3
  interface Props {
4
4
  entity: FdoCustomAttributeEntity;
5
5
  modelValue: CustomAttributes;
6
+ valueOptions?: {
7
+ [key: string]: string[];
8
+ };
6
9
  }
7
10
  declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
8
11
  "update:modelValue": (value: CustomAttributes) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"CustomAttributesForm.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/attribute/CustomAttributesForm.vue.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,wBAAwB,EAG9B,MAAM,wBAAwB,CAAA;AAM/B,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AAIlD,UAAU,KAAK;IACb,MAAM,EAAE,wBAAwB,CAAA;IAChC,UAAU,EAAE,gBAAgB,CAAA;CAC7B;;;;;;AA2LD,wBAOG;AACH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC"}
1
+ {"version":3,"file":"CustomAttributesForm.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/attribute/CustomAttributesForm.vue.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,wBAAwB,EAG9B,MAAM,wBAAwB,CAAA;AAM/B,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AAIlD,UAAU,KAAK;IACb,MAAM,EAAE,wBAAwB,CAAA;IAChC,UAAU,EAAE,gBAAgB,CAAA;IAC5B,YAAY,CAAC,EAAE;QACb,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;KACxB,CAAA;CACF;;;;;;AA6LD,wBAOG;AACH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-common",
3
- "version": "1.16.0-beta.2",
3
+ "version": "1.16.0-beta.3",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -1,93 +0,0 @@
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
- };