@feedmepos/mf-inventory-portal 0.0.25-dev.4 → 0.0.25-dev.42

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.
Files changed (112) hide show
  1. package/dist/{App-DavuRdR4.js → App-BgLyTa3Z.js} +35 -34
  2. package/dist/ApprovalView-UC31qsPD.js +143 -0
  3. package/dist/{BindingsDialog-Ckbhr9x3.js → BindingsDialog-h9el4EvX.js} +6 -6
  4. package/dist/{BindingsPicker-B63gIPVJ.js → BindingsPicker-Cw5AT6xO.js} +8 -8
  5. package/dist/{BindingsTable-5w7_8JzF.js → BindingsTable-Boj3hZup.js} +6 -6
  6. package/dist/ClosingDraftView-DOH7FmkH.js +1348 -0
  7. package/dist/ClosingTemplateView-CG7qArA8.js +1859 -0
  8. package/dist/FmCustomAttribute.vue_vue_type_script_setup_true_lang-D-IWRjRD.js +34 -0
  9. package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-k1J8dWcK.js +211 -0
  10. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-M5pWGm8D.js → FmUnitInput.vue_vue_type_script_setup_true_lang-C5qp_p1A.js} +52 -52
  11. package/dist/IngredientBindedItem.vue_vue_type_script_setup_true_lang-DBYsiV9t.js +51 -0
  12. package/dist/{IngredientGroupView-D_1gJl4X.js → IngredientGroupView-CWEw3I3i.js} +14 -14
  13. package/dist/{IngredientsView-Xzt0_AP8.js → IngredientsView-B6EDjPTe.js} +577 -551
  14. package/dist/{IntegrationView-BcF7Qhvw.js → IntegrationView-DiSoM1K8.js} +660 -623
  15. package/dist/{InventoryBindingForm-Cm49VDtA.js → InventoryBindingForm-nKWx-EUW.js} +1 -1
  16. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-EJ0U2gdF.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-BMMD4hwX.js} +96 -96
  17. package/dist/{InventoryBindingSummary-D821YZ-3.js → InventoryBindingSummary-CQnCjIY4.js} +1 -1
  18. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-D6jGlkOx.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Cr8DwdOC.js} +1 -1
  19. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-TMYgOcbh.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DnZI3Gfj.js} +15 -15
  20. package/dist/PublishView-DvHW27pI.js +222 -0
  21. package/dist/{PurchaseOrderPrintPreview-DiCTMEY4.js → PurchaseOrderPrintPreview-DSTbRKyh.js} +1 -1
  22. package/dist/ReceiveRequestView-BKRHqSU-.js +2577 -0
  23. package/dist/{RecipeView-k5yiAPop.js → RecipeView-CFTrf0YF.js} +47 -46
  24. package/dist/{index-DhAsCP14.js → StockView-CAPLd29m.js} +3564 -1764
  25. package/dist/{SupplierView-De4_YCtR.js → SupplierView-C_CrS9FM.js} +446 -457
  26. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-BWuWB95v.js +1564 -0
  27. package/dist/TransferTemplateView-BaJaiaO9.js +1526 -0
  28. package/dist/{UnitView-DouWNXFf.js → UnitView-DY9nZs1y.js} +14 -14
  29. package/dist/{WarehouseView-RQN-XBeO.js → WarehouseView-CAFxl8K4.js} +332 -314
  30. package/dist/api/closing-draft.d.ts +1 -0
  31. package/dist/api/inventory.d.ts +9 -6
  32. package/dist/api/netsuite.d.ts +21 -4
  33. package/dist/api/purchase-order.d.ts +6 -1
  34. package/dist/api/stock.d.ts +1 -0
  35. package/dist/{app-Bmmin1VX.js → app-Jh5wwLsF.js} +28968 -28906
  36. package/dist/app.js +1 -1
  37. package/dist/components/FmAutocompleteTextField.vue.d.ts +31 -0
  38. package/dist/components/FmCustomAttribute.vue.d.ts +3 -8
  39. package/dist/components/FmLockableField.vue.d.ts +3 -0
  40. package/dist/components/FmMultiselectDialog.d.ts +23 -0
  41. package/dist/components/FmMultiselectDialog.vue.d.ts +20 -3
  42. package/dist/components/FmMultiselectDialogProps.d.ts +2 -0
  43. package/dist/components/inventory-binding/InventoryBinding.vue.d.ts +1 -1
  44. package/dist/components/shell/inventory/binding-ui.vue.d.ts +1 -1
  45. package/dist/{decimal-CZhBTty7.js → decimal-0_acpDRy.js} +1 -1
  46. package/dist/feature-CqX_LtOl.js +1007 -0
  47. package/dist/{format-unit-display-CijRcRSo.js → format-unit-display-CYPC8_oX.js} +335 -328
  48. package/dist/helper/country.d.ts +1 -0
  49. package/dist/helper/fuzzy.d.ts +10 -0
  50. package/dist/index-QcOk4LDU.js +35546 -0
  51. package/dist/{stock-D5lxPBQG.js → stock-BpWEKDoQ.js} +29 -25
  52. package/dist/stores/feature.d.ts +4 -5
  53. package/dist/stores/helper/generate-backend-urls.d.ts +0 -1
  54. package/dist/stores/integration/netsuite.d.ts +21 -4
  55. package/dist/stores/inventory.d.ts +135 -8
  56. package/dist/stores/location.d.ts +100 -0
  57. package/dist/stores/warehouse.d.ts +1 -0
  58. package/dist/style.css +1 -1
  59. package/dist/{supplier-BU1WhNTR.js → supplier-By3gzRHW.js} +1 -1
  60. package/dist/tsconfig.app.tsbuildinfo +1 -1
  61. package/dist/use-ingredient-select-dialog-hkbfGnB9.js +51 -0
  62. package/dist/{use-inventory-binding-dialog-ZneYylve.js → use-inventory-binding-dialog-BFG04MUx.js} +1 -1
  63. package/dist/views/adjustment-template/wastage-template/actions.d.ts +24 -0
  64. package/dist/views/adjustment-template/wastage-template/table.d.ts +24 -0
  65. package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +8 -4
  66. package/dist/views/closing-draft/composables/use-closing-draft-actions.d.ts +4 -1
  67. package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +48 -24
  68. package/dist/views/closing-draft/helpers/export-draft.helper.d.ts +1 -1
  69. package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.d.ts +1 -1
  70. package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +36 -12
  71. package/dist/views/closing-template/composables/use-closing-template-table.d.ts +36 -12
  72. package/dist/views/dev/components/AutocompleteTextField.vue.d.ts +2 -0
  73. package/dist/views/ingredient-group/composables/use-ingredient-group-table.d.ts +3 -3
  74. package/dist/views/ingredients/components/ingredient-form/IngredientForm.vue.d.ts +2 -2
  75. package/dist/views/ingredients/composables/use-ingredient-select-dialog.d.ts +16 -0
  76. package/dist/views/ingredients/composables/use-ingredient-table.d.ts +1 -1
  77. package/dist/views/receive-request/components/netsuite/NetSuiteProps.d.ts +2 -0
  78. package/dist/views/receive-request/components/transfer-details/TransferDetailsProps.d.ts +4 -1
  79. package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +411 -17
  80. package/dist/views/receive-request/components/transfer-form/components/ForecastStock.vue.d.ts +6 -2
  81. package/dist/views/receive-request/components/transfer-form/components/TransferItemTable.vue.d.ts +382 -2
  82. package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +6 -3
  83. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +822 -29
  84. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +650 -48
  85. package/dist/views/receive-request/import/XilnexImportDialog.vue.d.ts +22 -0
  86. package/dist/views/receive-request/import/XilnexImportForm.vue.d.ts +17 -0
  87. package/dist/views/receive-request/import/XilnexResult.vue.d.ts +17 -0
  88. package/dist/views/receive-request/import/export.d.ts +12 -0
  89. package/dist/views/receive-request/import/props.d.ts +7 -0
  90. package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +4 -2
  91. package/dist/views/transfer-template/components/transfer-template-form/components/TransferTemplateItemTable.vue.d.ts +220 -0
  92. package/dist/views/transfer-template/components/transfer-template-form/composables/use-template-enabled-locations-2.d.ts +8 -0
  93. package/dist/views/transfer-template/components/transfer-template-form/composables/use-template-enabled-locations.d.ts +1 -0
  94. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +9 -4
  95. package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +60 -12
  96. package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +60 -12
  97. package/dist/views/transfer-template/composables/useTransferTemplateHelper.d.ts +305 -0
  98. package/dist/views/warehouse/components/WarehouseForm.vue.d.ts +2 -0
  99. package/dist/{vue-i18n-BQNx5sCM.js → vue-i18n-D57Xfcpf.js} +226 -226
  100. package/package.json +3 -3
  101. package/dist/ApprovalView-DjDzZmVI.js +0 -138
  102. package/dist/ClosingDraftView-BwV3uiYC.js +0 -1225
  103. package/dist/ClosingTemplateView-vaAj0Y-0.js +0 -1819
  104. package/dist/FmCustomAttribute.vue_vue_type_script_setup_true_lang-Dy1BXu1R.js +0 -142
  105. package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DZ_Q-3lU.js +0 -286
  106. package/dist/PublishView-CYdu5jl4.js +0 -192
  107. package/dist/ReceiveRequestView-DGqs1rpr.js +0 -1876
  108. package/dist/StockView-DX0RjayP.js +0 -1817
  109. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-DhdMwHAA.js +0 -1327
  110. package/dist/TransferTemplateView-DEwJaqYB.js +0 -1284
  111. package/dist/components/FmCustomAttribute2.vue.d.ts +0 -18
  112. package/dist/index-DbE8p73U.js +0 -29202
@@ -1,142 +0,0 @@
1
- import { defineComponent as g, openBlock as a, createElementBlock as i, createElementVNode as m, toDisplayString as u, unref as h, Fragment as C, renderList as N, computed as v, resolveComponent as V, createVNode as S, createCommentVNode as w, h as B } from "vue";
2
- import { j as b, K as F, f as $ } from "./app-Bmmin1VX.js";
3
- import { useI18n as k, useCoreStore as I } from "@feedmepos/mf-common";
4
- import { components as O } from "@feedmepos/ui-library";
5
- const T = { class: "flex flex-col" }, j = { class: "flex flex-row fm-typo-en-body-md-600 bg-fm-color-neutral-gray-100 text-fm-color-typo-secondary h-48 items-center" }, z = { class: "flex-1 py-8 px-16" }, D = {
6
- class: "flex-0 py-8 px-16",
7
- style: { "flex-basis": "120px" }
8
- }, E = { class: "flex-1 py-8 px-16" }, K = {
9
- key: 0,
10
- class: "flex-0 py-8 px-16",
11
- style: { "flex-basis": "120px" }
12
- }, M = {
13
- key: 1,
14
- class: "flex-0 py-8 px-16",
15
- style: { "flex-basis": "120px" }
16
- }, G = /* @__PURE__ */ g({
17
- __name: "IngredientBindedItem",
18
- props: {
19
- name: {},
20
- bindings: {}
21
- },
22
- setup(_) {
23
- const { t: p } = k();
24
- function l(o, c) {
25
- var n;
26
- if (o.measurement) {
27
- const d = F(o.amount, o.measurement.conversion);
28
- return `${b(d, !1)} ${(n = o.measurement) == null ? void 0 : n.abbrev}`;
29
- }
30
- return `${b(o.amount, !1)} ${c.abbrev}`;
31
- }
32
- function f(o) {
33
- return o.unit !== void 0;
34
- }
35
- return (o, c) => (a(), i("div", T, [
36
- m("div", j, [
37
- m("div", z, u(o.name), 1),
38
- m("div", D, u(h(p)("inventory.ingredient.bindedItems.amount")), 1)
39
- ]),
40
- (a(!0), i(C, null, N(o.bindings, (n) => (a(), i("div", {
41
- key: n.id,
42
- class: "flex flex-row fm-typo-en-body-md-400 h-48 items-center border-b border-b-fm-color-neutral-gray-100"
43
- }, [
44
- m("div", E, u(n.name), 1),
45
- f(n) ? (a(), i("div", K, u(l(n, n.unit)), 1)) : (a(), i("div", M, u(h(b)(n.amount, !1)), 1))
46
- ]))), 128))
47
- ]));
48
- }
49
- }), U = {
50
- key: 0,
51
- class: "flex flex-col gap-16"
52
- }, H = /* @__PURE__ */ g({
53
- __name: "FmCustomAttribute",
54
- props: {
55
- entity: {},
56
- modelValue: {},
57
- valueOptions: {}
58
- },
59
- emits: ["update:modelValue"],
60
- setup(_, { emit: p }) {
61
- const l = _, f = p, { t: o } = k(), c = I();
62
- function n(s) {
63
- var e, t;
64
- if ((t = (e = l.valueOptions) == null ? void 0 : e[s]) != null && t.length)
65
- return l.valueOptions[s];
66
- }
67
- const d = v(() => {
68
- const s = /* @__PURE__ */ new Set(["671005de24a7f4001c87e25e"]), e = c.currentBusiness.value;
69
- return e ? s.has(e._id) ? [
70
- {
71
- key: "tag",
72
- type: "string",
73
- entity: "inventorySku"
74
- },
75
- {
76
- key: "tag",
77
- type: "string",
78
- entity: "inventoryRecipe"
79
- }
80
- ].filter((r) => r.entity === l.entity) : [] : [];
81
- }), y = v(() => d.value.map((s) => {
82
- var t;
83
- const e = n(s.key);
84
- return {
85
- key: s.key,
86
- type: s.type,
87
- value: ((t = l.modelValue) == null ? void 0 : t[s.key]) || "",
88
- options: e
89
- };
90
- }) || []), A = [
91
- {
92
- header: () => o("portalshell.customAttributes.form.key"),
93
- accessorKey: "key",
94
- enableSorting: !1
95
- },
96
- {
97
- header: () => o("portalshell.customAttributes.form.value"),
98
- accessorKey: "value",
99
- enableSorting: !1,
100
- cell: (s) => {
101
- const e = s.row.original;
102
- return B(O.FmTextField, {
103
- modelValue: e.value,
104
- placeholder: o("portalshell.customAttributes.form.valuePlaceholder"),
105
- datalist: e.options,
106
- rules: [
107
- (t) => e.type === "number" && isNaN(Number(t)) ? o("portalshell.customAttributes.form.attributeValueMustBeNumber") : !0
108
- ],
109
- "onUpdate:modelValue": (t) => {
110
- const r = $(l.modelValue);
111
- if (r[e.key] = t == null ? void 0 : t.trim(), e.type === "number") {
112
- if (isNaN(Number(t)))
113
- return;
114
- r[e.key] = Number(t);
115
- }
116
- Object.keys(r).forEach((x) => {
117
- r[x] || delete r[x];
118
- }), f("update:modelValue", r);
119
- }
120
- });
121
- }
122
- }
123
- ];
124
- return (s, e) => {
125
- const t = V("FmTable");
126
- return y.value.length ? (a(), i("div", U, [
127
- e[0] || (e[0] = m("div", { class: "fm-typo-en-title-sm-600" }, "Custom attributes", -1)),
128
- S(t, {
129
- "column-defs": A,
130
- "row-data": y.value,
131
- "shrink-at": !1,
132
- "page-size": y.value.length,
133
- "hide-footer": ""
134
- }, null, 8, ["row-data", "page-size"])
135
- ])) : w("", !0);
136
- };
137
- }
138
- });
139
- export {
140
- G as _,
141
- H as a
142
- };
@@ -1,286 +0,0 @@
1
- import { j as L, t as I, ao as x, u as R, at as B, aD as H, aE as M } from "./app-Bmmin1VX.js";
2
- import { u as j } from "./supplier-BU1WhNTR.js";
3
- import { P as S } from "./format-unit-display-CijRcRSo.js";
4
- import { computed as y, defineComponent as W, mergeModels as $, useModel as J, ref as K, resolveComponent as U, openBlock as F, createElementBlock as A, normalizeStyle as Q, createElementVNode as D, createVNode as X, withCtx as Y, createBlock as V, createCommentVNode as E, Fragment as Z, renderList as z, unref as w } from "vue";
5
- function G(a, o, e) {
6
- var s;
7
- if (!!o.measurement === !!e && ((s = o.measurement) == null ? void 0 : s.id) === e)
8
- return o;
9
- if (!e)
10
- return {
11
- costPerUnit: o.costPerUnit
12
- };
13
- const i = a.measurements.find((r) => r.id === e);
14
- return i ? {
15
- costPerUnit: o.costPerUnit,
16
- measurement: i
17
- } : {
18
- costPerUnit: o.costPerUnit
19
- };
20
- }
21
- function oe(a, o, e, n) {
22
- var P, g, c;
23
- if (n != null && n.manualTotalCost)
24
- return n == null ? void 0 : n.manualTotalCost;
25
- const t = (c = (g = (P = n == null ? void 0 : n.supplier) == null ? void 0 : P.supplyItems) == null ? void 0 : g.find(
26
- (l) => l.skuId === a._id
27
- )) == null ? void 0 : c.defaultCost, i = a.defaultCost ? G(a.unit, a.defaultCost, a.trackingMeasurement) : void 0, s = t ?? i, r = s == null ? void 0 : s.costPerUnit, u = r ? s != null && s.measurement ? +L(r) / +L(s == null ? void 0 : s.measurement.conversion) : +L(r) : void 0, p = u ? e ? u * +L(e.conversion) : u : void 0, v = p ? +L(o) * p : void 0;
28
- return v ? {
29
- ...I(v ?? 0, 2),
30
- currency: x()
31
- } : {
32
- amount: 0,
33
- precision: 0,
34
- currency: x()
35
- };
36
- }
37
- function T(a) {
38
- return H.parse(a);
39
- }
40
- function C(a) {
41
- return {
42
- _id: a.doc._id,
43
- internal: a.type,
44
- contactName: a.doc.profile.name,
45
- name: a.doc.profile.name ?? "",
46
- email: a.doc.profile.email,
47
- phoneNumber: a.doc.profile.phoneNo,
48
- registrationNumber: a.doc.profile.regNo,
49
- address: a.doc.profile.address ?? {
50
- line1: "",
51
- state: "",
52
- city: "",
53
- postcode: "",
54
- country: ""
55
- }
56
- };
57
- }
58
- function re(a, o, e = !1, n = !1) {
59
- const t = j(), i = R();
60
- i.watchLocation(async () => {
61
- var b;
62
- await t.readSuppliers();
63
- const c = a();
64
- if ((b = c.supplier) != null && b._id) return;
65
- const l = n ? t.suppliers[0] : t.businessSuppliers[0], f = (e ? i.locations.filter((m) => m.doc._id !== i.currentLocation.doc._id) : i.locations)[0];
66
- o({
67
- ...c,
68
- supplier: l ? T(l) : f ? C(f) : c.supplier
69
- });
70
- });
71
- const s = y(
72
- () => {
73
- var c, l;
74
- return typeof ((l = (c = a()) == null ? void 0 : c.supplier) == null ? void 0 : l.internal) == "string" ? S.TRANSFER : S.PURCHASE;
75
- }
76
- ), r = y({
77
- get() {
78
- var c, l;
79
- return (l = (c = a()) == null ? void 0 : c.supplier) == null ? void 0 : l._id;
80
- },
81
- set(c) {
82
- const l = a() ?? {};
83
- if (s.value === S.PURCHASE) {
84
- const _ = (n ? t.suppliers : t.businessSuppliers).find((N) => N._id === c);
85
- o({
86
- ...l,
87
- supplier: _ ? T(_) : l.supplier
88
- });
89
- return;
90
- }
91
- const b = (e ? i.locations.filter((m) => m.doc._id !== i.currentLocation.doc._id) : i.locations).find((m) => m.doc._id === c);
92
- o({
93
- ...l,
94
- supplier: b ? C(b) : l.supplier
95
- });
96
- }
97
- }), u = y(() => t.locationSuppliers.map(T)), p = y(() => t.businessSuppliers.map(T)), v = y(() => {
98
- const c = [...u.value], l = [...p.value];
99
- return n ? [...l, ...c] : l;
100
- }), d = y(() => {
101
- var h;
102
- const c = ((h = i._currentLocation) == null ? void 0 : h.type) === B.warehouse;
103
- return (e ? i.locations.filter((f) => f.doc._id !== i.currentLocation.doc._id) : i.locations).filter((f) => c || f.acceptRequest).map(C);
104
- }), P = y(() => {
105
- if (s.value === S.PURCHASE) {
106
- const l = u.value.map((f) => ({
107
- label: f.name,
108
- value: f._id
109
- })), h = p.value.map((f) => ({
110
- label: f.name,
111
- sublabel: "Business supplier",
112
- value: f._id
113
- }));
114
- return n ? [...l, ...h] : h;
115
- }
116
- return d.value.map((l) => ({
117
- label: l.name,
118
- sublabel: l.internal ? `${l.internal}` : void 0,
119
- value: l._id
120
- }));
121
- }), g = y(() => {
122
- var f, b;
123
- const c = (b = (f = a()) == null ? void 0 : f.supplier) == null ? void 0 : b._id;
124
- if (s.value === S.PURCHASE) {
125
- const m = t.suppliers.find((_) => _._id === c);
126
- return m ? T(m) : null;
127
- }
128
- const h = i.locations.find((m) => m.doc._id);
129
- return h ? C(h) : null;
130
- });
131
- return {
132
- transferLocationModel: r,
133
- transferLocationOptions: P,
134
- locationOptionsTypePurchase: v,
135
- locationOptionsTypePurchaseLocationLevel: u,
136
- locationOptionsTypeTransfer: d,
137
- selectedLocation: g
138
- };
139
- }
140
- class O {
141
- static getDescendantProperty(o, e, n = []) {
142
- let t, i, s, r, u, p;
143
- if (e) {
144
- if (s = e.indexOf("."), s === -1 ? t = e : (t = e.slice(0, s), i = e.slice(s + 1)), r = o[t], r !== null && typeof r < "u")
145
- if (!i && (typeof r == "string" || typeof r == "number"))
146
- n.push(r);
147
- else if (Object.prototype.toString.call(r) === "[object Array]")
148
- for (u = 0, p = r.length; u < p; u++)
149
- O.getDescendantProperty(r[u], i, n);
150
- else i && O.getDescendantProperty(r, i, n);
151
- } else
152
- n.push(o);
153
- return n;
154
- }
155
- }
156
- class k {
157
- constructor(o = [], e = [], n = {}) {
158
- Array.isArray(e) || (n = e, e = []), this.haystack = o, this.keys = e, this.options = Object.assign({
159
- caseSensitive: !1,
160
- sort: !1
161
- }, n);
162
- }
163
- search(o = "") {
164
- if (o === "")
165
- return this.haystack;
166
- const e = [];
167
- for (let n = 0; n < this.haystack.length; n++) {
168
- const t = this.haystack[n];
169
- if (this.keys.length === 0) {
170
- const i = k.isMatch(t, o, this.options.caseSensitive);
171
- i && e.push({ item: t, score: i });
172
- } else
173
- for (let i = 0; i < this.keys.length; i++) {
174
- const s = O.getDescendantProperty(t, this.keys[i]);
175
- let r = !1;
176
- for (let u = 0; u < s.length; u++) {
177
- const p = k.isMatch(s[u], o, this.options.caseSensitive);
178
- if (p) {
179
- r = !0, e.push({ item: t, score: p });
180
- break;
181
- }
182
- }
183
- if (r)
184
- break;
185
- }
186
- }
187
- return this.options.sort && e.sort((n, t) => n.score - t.score), e.map((n) => n.item);
188
- }
189
- static isMatch(o, e, n) {
190
- o = String(o), e = String(e), n || (o = o.toLocaleLowerCase(), e = e.toLocaleLowerCase());
191
- const t = k.nearestIndexesFor(o, e);
192
- return t ? o === e ? 1 : t.length > 1 ? 2 + (t[t.length - 1] - t[0]) : 2 + t[0] : !1;
193
- }
194
- static nearestIndexesFor(o, e) {
195
- const n = e.split("");
196
- let t = [];
197
- return k.indexesOfFirstLetter(o, e).forEach((s, r) => {
198
- let u = s + 1;
199
- t[r] = [s];
200
- for (let p = 1; p < n.length; p++) {
201
- const v = n[p];
202
- if (u = o.indexOf(v, u), u === -1) {
203
- t[r] = !1;
204
- break;
205
- }
206
- t[r].push(u), u++;
207
- }
208
- }), t = t.filter((s) => s !== !1), t.length ? t.sort((s, r) => s.length === 1 ? s[0] - r[0] : (s = s[s.length - 1] - s[0], r = r[r.length - 1] - r[0], s - r))[0] : !1;
209
- }
210
- static indexesOfFirstLetter(o, e) {
211
- const n = e[0];
212
- return o.split("").map((t, i) => t !== n ? !1 : i).filter((t) => t !== !1);
213
- }
214
- }
215
- const q = { class: "overflow-y-auto h-full pb-8" }, ie = /* @__PURE__ */ W({
216
- __name: "FmFilterableMenuOptions",
217
- props: /* @__PURE__ */ $({
218
- modelValue: {},
219
- maxHeight: {},
220
- width: {},
221
- handleItemChange: { type: Function },
222
- items: {},
223
- options: {}
224
- }, {
225
- search: {},
226
- searchModifiers: {}
227
- }),
228
- emits: ["update:search"],
229
- setup(a) {
230
- const o = a, e = J(a, "search"), n = y(
231
- () => new k(o.items, ["label", "sublabel"], o.options)
232
- ), t = y(() => n.value.search(e.value)), i = K();
233
- return console.log({ stickyRef: i }), (s, r) => {
234
- const u = U("FmButton"), p = U("FmTextField"), v = U("FmMenuItem");
235
- return F(), A("div", {
236
- class: "relative",
237
- style: Q({ width: s.width })
238
- }, [
239
- D("div", {
240
- class: "sticky top-0 bg-white mb-8",
241
- ref_key: "stickyRef",
242
- ref: i
243
- }, [
244
- X(p, {
245
- modelValue: e.value,
246
- "onUpdate:modelValue": r[1] || (r[1] = (d) => e.value = d),
247
- placeholder: "Filter options"
248
- }, {
249
- append: Y(() => [
250
- e.value ? (F(), V(u, {
251
- key: 0,
252
- variant: "tertiary",
253
- "prepend-icon": "close",
254
- onClick: r[0] || (r[0] = (d) => e.value = "")
255
- })) : E("", !0)
256
- ]),
257
- _: 1
258
- }, 8, ["modelValue"])
259
- ], 512),
260
- D("div", q, [
261
- (F(!0), A(Z, null, z(t.value, (d, P) => (F(), V(v, {
262
- key: P,
263
- label: d.label,
264
- sublabel: d.sublabel,
265
- "model-value": w(M)(s.modelValue, d.value),
266
- onClick: () => s.handleItemChange(w(M)(s.modelValue, d.value), d),
267
- onVnodeMounted: (g) => {
268
- var c, l;
269
- return w(M)(s.modelValue, d.value) && ((c = g.el) == null || c.scrollIntoView({ behavior: "instant", block: "end" }), (l = g.el) == null || l.scrollIntoView({ behavior: "smooth", block: "center" })), void 0;
270
- }
271
- }, null, 8, ["label", "sublabel", "model-value", "onClick", "onVnodeMounted"]))), 128)),
272
- t.value.length ? E("", !0) : (F(), V(v, {
273
- key: 0,
274
- disabled: "",
275
- label: "No options available"
276
- }))
277
- ])
278
- ], 4);
279
- };
280
- }
281
- });
282
- export {
283
- ie as _,
284
- oe as c,
285
- re as u
286
- };
@@ -1,192 +0,0 @@
1
- import { defineComponent as j, computed as i, ref as q, resolveComponent as a, openBlock as k, createBlock as D, unref as p, createSlots as G, withCtx as r, createElementVNode as b, normalizeClass as J, createVNode as n, normalizeStyle as Q, Teleport as W, h } from "vue";
2
- import { u as X, a as Z, z as ee, _ as te, ae as P } from "./app-Bmmin1VX.js";
3
- import { useBreakpoints as oe, components as ne } from "@feedmepos/ui-library";
4
- import { u as le } from "./vue-i18n-BQNx5sCM.js";
5
- const ae = { class: "flex flex-col py-8" }, se = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ie = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, pe = /* @__PURE__ */ j({
6
- __name: "PublishView",
7
- setup(re) {
8
- const { t: l } = le(), { breakpoints: y } = oe(), _ = X(), g = Z(), u = i(() => g.state.inventory.updatedAt ? g.state.inventory.updatedAt : null), H = ee(), L = i(() => _.locations), f = i(() => y.value.xs || y.value.sm), R = i(() => f.value ? 10 : 20), Y = i(() => [
9
- // { label: t('inventory.publish.actions.publishAll'), value: 'publish' }
10
- ]);
11
- function B(e) {
12
- switch (e) {
13
- case "publish":
14
- console.log("publish all");
15
- }
16
- }
17
- const v = q(!1), I = [
18
- {
19
- value: "publish",
20
- label: l("inventory.publish.actions.publishAll")
21
- }
22
- ];
23
- function N(e) {
24
- switch (v.value = !1, e) {
25
- case "publish":
26
- console.log("publish all");
27
- }
28
- }
29
- const U = [
30
- {
31
- id: "type",
32
- header: () => l("inventory.publish.columns.type"),
33
- enableSorting: !0,
34
- cell(e) {
35
- return h(ne.FmChip, {
36
- color: "primary",
37
- label: e.row.original.type
38
- });
39
- }
40
- },
41
- {
42
- accessorKey: "name",
43
- header: () => l("inventory.publish.columns.location"),
44
- enableSorting: !0,
45
- size: 300
46
- },
47
- {
48
- id: "version",
49
- header: () => l("inventory.publish.columns.version"),
50
- enableSorting: !0,
51
- cell(e) {
52
- var t, o;
53
- return (t = e.row.original.inventory) != null && t.updatedAt ? P((o = e.row.original.inventory) == null ? void 0 : o.updatedAt) : "";
54
- }
55
- },
56
- {
57
- id: "status",
58
- header: () => l("inventory.publish.columns.status"),
59
- enableSorting: !0,
60
- cell(e) {
61
- var o;
62
- if (!u.value)
63
- return "";
64
- const t = ((o = e.row.original.inventory) == null ? void 0 : o.updatedAt) == u.value;
65
- return h(
66
- "div",
67
- {
68
- class: "flex"
69
- },
70
- h(
71
- "div",
72
- {
73
- class: [
74
- "fm-status-badge",
75
- t ? "fm-status-badge-success-secondary" : "fm-status-badge-info-secondary"
76
- ]
77
- },
78
- t ? "Published" : "Outdated"
79
- )
80
- );
81
- }
82
- }
83
- // {
84
- // id: 'action',
85
- // header: '',
86
- // cell(props) {
87
- // return createContextMenuComponents(
88
- // [DefaultRowActions[RowActionEnum.Edit], DefaultRowActions[RowActionEnum.Delete]],
89
- // (action) => {
90
- // onActionMenu(action, props.row.original)
91
- // }
92
- // )
93
- // },
94
- // enableSorting: false,
95
- // size: 40,
96
- // meta: {
97
- // cellClass: '',
98
- // headerClass: ''
99
- // }
100
- // }
101
- ];
102
- return (e, t) => {
103
- const o = a("FmChip"), x = a("FlexRender"), $ = a("TableActionableRow"), E = a("FmTable"), K = a("FmCollapsibleTabs"), O = a("FmBottomSheet");
104
- return k(), D(te, {
105
- title: p(l)("inventory.publish.title"),
106
- actions: Y.value,
107
- "onClick:action": B
108
- }, G({
109
- default: r(() => {
110
- var w;
111
- return [
112
- b("div", {
113
- class: J([
114
- "flex flex-col gap-8 max-h-full",
115
- {
116
- "p-0": f.value,
117
- "px-24 ": !f.value
118
- }
119
- ])
120
- }, [
121
- n(E, {
122
- style: Q(p(H).tableHeight),
123
- "column-defs": U,
124
- "row-data": L.value,
125
- loading: ((w = p(_)._locations) == null ? void 0 : w.length) === 0,
126
- "loading-text": "Loading",
127
- "page-size": R.value
128
- }, {
129
- "list-row": r((s) => [
130
- n($, { row: s }, {
131
- default: r((c) => {
132
- var S, A, F, d, M, C, T, V, m, z;
133
- return [
134
- b("div", ae, [
135
- b("div", se, [
136
- n(x, {
137
- render: (F = (A = (S = c.code) == null ? void 0 : S.column) == null ? void 0 : A.columnDef) == null ? void 0 : F.cell,
138
- props: (M = (d = c.code) == null ? void 0 : d.getContext) == null ? void 0 : M.call(d)
139
- }, null, 8, ["render", "props"])
140
- ]),
141
- b("div", ie, [
142
- n(x, {
143
- render: (V = (T = (C = c.name) == null ? void 0 : C.column) == null ? void 0 : T.columnDef) == null ? void 0 : V.cell,
144
- props: (z = (m = c.name) == null ? void 0 : m.getContext) == null ? void 0 : z.call(m)
145
- }, null, 8, ["render", "props"])
146
- ])
147
- ])
148
- ];
149
- }),
150
- _: 2
151
- }, 1032, ["row"])
152
- ]),
153
- _: 1
154
- }, 8, ["style", "row-data", "loading", "page-size"])
155
- ], 2),
156
- (k(), D(W, { to: "body" }, [
157
- n(O, {
158
- "dismiss-away": "",
159
- modelValue: v.value,
160
- "onUpdate:modelValue": t[1] || (t[1] = (s) => v.value = s)
161
- }, {
162
- default: r(() => [
163
- n(K, {
164
- class: "pb-8",
165
- items: I,
166
- "onUpdate:modelValue": t[0] || (t[0] = (s) => N(s))
167
- })
168
- ]),
169
- _: 1
170
- }, 8, ["modelValue"])
171
- ]))
172
- ];
173
- }),
174
- _: 2
175
- }, [
176
- u.value ? {
177
- name: "headerInfo",
178
- fn: r(() => [
179
- n(o, {
180
- variant: "info",
181
- label: `Latest: ${p(P)(u.value)}`
182
- }, null, 8, ["label"])
183
- ]),
184
- key: "0"
185
- } : void 0
186
- ]), 1032, ["title", "actions"]);
187
- };
188
- }
189
- });
190
- export {
191
- pe as default
192
- };