@feedmepos/mf-inventory-portal 1.2.30-dev.1 → 1.2.30

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 (84) hide show
  1. package/dist/{App-kX4bqoEe.js → App-CZJre5y8.js} +57 -55
  2. package/dist/{ApprovalView-DCNKqVE2.js → ApprovalView-CnxHxojY.js} +34 -28
  3. package/dist/{BindingsDialog-d7f1f8gf.js → BindingsDialog-C6lCOPNs.js} +2 -2
  4. package/dist/{BindingsPicker-2HJOx0QW.js → BindingsPicker-DZtFKLQ5.js} +6 -5
  5. package/dist/{BindingsTable-CPAjxOZG.js → BindingsTable-BmQGLuJ4.js} +28 -24
  6. package/dist/{ClosingDraftView-CUng41eo.js → ClosingDraftView-KLtlh31f.js} +183 -175
  7. package/dist/{ClosingHistoryView-CcGc2NwU.js → ClosingHistoryView-Rf1yMhMj.js} +43 -41
  8. package/dist/ClosingTemplateView-C_IiKnGx.js +2019 -0
  9. package/dist/{DeliveryOrderPrintPreview-BsM-CCc5.js → DeliveryOrderPrintPreview-UF7V005U.js} +15 -14
  10. package/dist/FmDroppableField-J0xUsOTV.js +154 -0
  11. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-cuggJ5Xd.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BcMvEdc0.js} +74 -72
  12. package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CqAeF0wL.js +279 -0
  13. package/dist/{FmMultiselectDialog-BGbrqXUF.js → FmMultiselectDialog-B0aKuf2o.js} +1 -1
  14. package/dist/FmMultiselectDialog-BasrjBFA.js +597 -0
  15. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-isogcN1O.js → FmUnitInput.vue_vue_type_script_setup_true_lang-CaYJJkXz.js} +51 -49
  16. package/dist/{ImportView-wAVrMEwL.js → ImportView-DRSoz0uM.js} +81 -74
  17. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DVUF4I2Q.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DA8SlWPy.js} +5 -5
  18. package/dist/{IngredientGroupView-BZczeXdL.js → IngredientGroupView-D5Laak2-.js} +73 -65
  19. package/dist/{IngredientsView-D5N5Y1ZY.js → IngredientsView-TG3fPQhR.js} +358 -345
  20. package/dist/{IntegrationView-Hrslmuc1.js → IntegrationView-CElpjyo7.js} +219 -209
  21. package/dist/{InventoryBindingForm-DH6wgxOG.js → InventoryBindingForm-CBgxRYBd.js} +1 -1
  22. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-Drr5vD6f.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-Ys5GBHoQ.js} +41 -40
  23. package/dist/{InventoryBindingSummary-BU1ehpQZ.js → InventoryBindingSummary-OK3vNWhi.js} +1 -1
  24. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-1ueC4GfZ.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-9QRntUlk.js} +5 -5
  25. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-FHcU1zZt.js → PremiumBadge.vue_vue_type_script_setup_true_lang-Bc01NoOn.js} +22 -21
  26. package/dist/{PublishView-CQtj0f31.js → PublishView-CLMfiLjP.js} +26 -23
  27. package/dist/{PurchaseOrderPrintPreview-BQyXtHST.js → PurchaseOrderPrintPreview-Dy77yWDC.js} +10 -9
  28. package/dist/{ReceiveRequestView-Dm-h_SrY.js → ReceiveRequestView-BhD-NaHE.js} +478 -462
  29. package/dist/{RecipeView-DNNRvr1w.js → RecipeView-RWaO94w_.js} +73 -64
  30. package/dist/SingleColumnLayout.vue_vue_type_script_setup_true_lang-DY7TaxPK.js +251 -0
  31. package/dist/{StockView-CaOm5BCx.js → StockView-D5t8OxaG.js} +292 -282
  32. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Z91XRszD.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-3Asf1TGd.js} +1 -1
  33. package/dist/{SupplierView-JSII9qwL.js → SupplierView-DiospFKq.js} +92 -80
  34. package/dist/SystemTrailDialog.vue_vue_type_script_setup_true_lang-DfCHteOF.js +177 -0
  35. package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js +135 -0
  36. package/dist/TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CNtvx-LA.js +123 -0
  37. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-Mehd4lGs.js → TransferDetails.vue_vue_type_script_setup_true_lang-p959Op4k.js} +318 -305
  38. package/dist/{TransferTemplateView-DyCpNKJd.js → TransferTemplateView-ePZFdZ0p.js} +228 -216
  39. package/dist/{UnitView-CqN7mlJ2.js → UnitView-Banlxw7y.js} +70 -63
  40. package/dist/{WarehouseView-gFWD-m8e.js → WarehouseView-BL-p5hbi.js} +123 -114
  41. package/dist/WastageTemplateView-B1pmSuW0.js +2288 -0
  42. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  43. package/dist/app-EpEEb8EO.js +64040 -0
  44. package/dist/app-rgirz_52.js +8024 -0
  45. package/dist/app.d.ts +0 -21
  46. package/dist/app.js +6 -6
  47. package/dist/closing-template-zIjwO1_E.js +117 -0
  48. package/dist/date2-Dnc8Y81g.js +116 -0
  49. package/dist/dayjs.min-TdUgzmww.js +282 -0
  50. package/dist/{decimal-DfF_g5rc.js → decimal-C6s3GvGb.js} +4 -3
  51. package/dist/defineDeepModel-BSaaXVBF.js +19 -0
  52. package/dist/duplicate-template-Bw0H416G.js +34 -0
  53. package/dist/feature-C95Hao53.js +20162 -0
  54. package/dist/form-mode.enum-BKiNVH6A.js +4 -0
  55. package/dist/format-time-from-id-DlbHo6kY.js +15 -0
  56. package/dist/{format-unit-display-ivAljvlo.js → format-unit-display-QBS54q0R.js} +308 -297
  57. package/dist/{import-export.helper-B2MWv9v7.js → import-export.helper-CUKCKtP7.js} +56 -52
  58. package/dist/index-CFn_9RMm.js +45 -0
  59. package/dist/{index-DZaT0ZaL.js → index-S9Ak__QC.js} +1 -1
  60. package/dist/{index-BbhuWHyh.js → index-goD-WGVb.js} +16 -14
  61. package/dist/lodash-gq8IrP4j.js +3678 -0
  62. package/dist/netsuite-CnhAKyAO.js +4316 -0
  63. package/dist/{purchase-order-template-DdybMC_P.js → purchase-order-template-CBIpWdEW.js} +1 -1
  64. package/dist/router/shared.spec.d.ts +1 -0
  65. package/dist/row-action.enum-BcW_L_nE.js +67 -0
  66. package/dist/rules-DKklsaS1.js +201 -0
  67. package/dist/{stock-BYagIdsj.js → stock-3K93Mif9.js} +1 -1
  68. package/dist/{stock-V4ciPiBe.js → stock-BW8fen3H.js} +11 -10
  69. package/dist/style.css +1 -1
  70. package/dist/{supplier-CgtB1I9I.js → supplier-CObCSfot.js} +27 -26
  71. package/dist/tsconfig.app.tsbuildinfo +1 -1
  72. package/dist/{use-ingredient-select-dialog-BIQovyZX.js → use-ingredient-select-dialog-DwvQiaVW.js} +4 -3
  73. package/dist/{use-inventory-binding-dialog-DyjicXgc.js → use-inventory-binding-dialog-CuLEHLDM.js} +4 -3
  74. package/dist/use-template-enabled-locations-2-DkUJeppb.js +111 -0
  75. package/dist/views/adjustment-template/wastage-template/table.d.ts +1 -1
  76. package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.d.ts +0 -1
  77. package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +1 -13
  78. package/dist/views/closing-template/composables/use-closing-template-table.d.ts +0 -12
  79. package/dist/vue-i18n-CUznvVzc.js +2365 -0
  80. package/dist/xlsx-bT1p3YVR.js +24004 -0
  81. package/dist/xlsx.util-Cr9DpDFb.js +78 -0
  82. package/package.json +5 -5
  83. package/dist/ClosingTemplateView-D8IAdhDb.js +0 -2041
  84. package/dist/app-CnQ49Lyb.js +0 -131483
@@ -0,0 +1,177 @@
1
+ import { defineComponent as I, ref as m, resolveComponent as p, openBlock as i, createBlock as O, withCtx as u, createVNode as y, createElementBlock as v, toDisplayString as g, createElementVNode as T, h as B } from "vue";
2
+ import { F as L } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DY7TaxPK.js";
3
+ import { o as U, u as _ } from "./app-EpEEb8EO.js";
4
+ import { useCoreStore as A } from "@feedmepos/mf-common";
5
+ import { useDialog as C, components as V } from "@feedmepos/ui-library";
6
+ import { u as F, a as j } from "./closing-template-zIjwO1_E.js";
7
+ const q = U((o, t) => {
8
+ const c = _(), l = A();
9
+ return {
10
+ async readRequests(a, e, r) {
11
+ const n = a ?? c.currentLocationDBName, d = `${o.inventoryBackendUrl}/${n}/purchase-request`;
12
+ return e && r ? await t.get(`${d}?startDate=${e}&endDate=${r}`) : await t.get(d);
13
+ },
14
+ async readRequestById(a, e) {
15
+ const r = e ?? c.currentLocationDBName, n = `${o.inventoryBackendUrl}/${r}/purchase-request/${a}`;
16
+ return await t.get(n);
17
+ },
18
+ async readRequestByIds(a, e) {
19
+ const r = e ?? c.currentLocationDBName, n = `${o.inventoryBackendUrl}/${r}/purchase-request/find`;
20
+ return await t.post(n, { requestIds: a });
21
+ },
22
+ async getPurchaseOrders({
23
+ start: a,
24
+ end: e
25
+ }) {
26
+ const r = c.currentLocationDBName, n = `${o.inventoryBackendUrl}/${r}/purchase-order`;
27
+ return await t.get(`${n}?start=${a}&end=${e}`);
28
+ },
29
+ async getLatestPurchaseOrderRequest(a) {
30
+ const e = c.currentLocationDBName, r = `${o.inventoryBackendUrl}/${e}/purchase-request/find-by-purchase-order-id`;
31
+ return await t.get(`${r}/${a}`);
32
+ },
33
+ async getPurchaseOrderById(a) {
34
+ const e = c.currentLocationDBName, r = `${o.inventoryBackendUrl}/${e}/purchase-order`;
35
+ return await t.get(`${r}/${a}`);
36
+ },
37
+ /**
38
+ * @deprecated Use `processPurchaseOrderV2` instead.
39
+ */
40
+ async processPurchaseOrder(a, e) {
41
+ const r = c.currentLocationDBName, n = e || r, d = `${o.inventoryBackendUrl}/${n}/purchase-order/run-operation`;
42
+ return await t.put(d, a);
43
+ },
44
+ async createPurchaseOrder(a) {
45
+ const e = c.currentLocationDBName, r = `${o.inventoryBackendUrl}/${e}/purchase-order`;
46
+ return await t.post(r, a);
47
+ },
48
+ async updatePurchaseOrder(a) {
49
+ const e = c.currentLocationDBName, r = `${o.inventoryBackendUrl}/${e}/purchase-order`;
50
+ return await t.put(r, a);
51
+ },
52
+ async importFromXilnex(a) {
53
+ const e = c.currentLocationDBName, r = `${o.inventoryBackendUrl}/${e}/purchase-order/import-from-xilnex`;
54
+ return await t.post(r, a);
55
+ },
56
+ async processPurchaseOrderV2(a, e) {
57
+ const r = c.currentLocationDBName, n = e || r, d = `${o.inventoryBackendUrl}/${n}/v2/purchase-order/run-operation`;
58
+ return await t.put(d, a);
59
+ },
60
+ async getWorkflowConfig() {
61
+ var n;
62
+ const e = `business_${(n = l.currentBusiness.value) == null ? void 0 : n._id}`, r = `${o.inventoryBackendUrl}/${e}/v2/purchase-order/workflow-config`;
63
+ return await t.get(r);
64
+ },
65
+ async updateDeliveryOrder(a) {
66
+ const e = c.currentLocationDBName, r = `${o.inventoryBackendUrl}/${e}/delivery-order`;
67
+ return await t.put(r, a);
68
+ },
69
+ async createDeliveryOrder(a) {
70
+ const e = c.currentLocationDBName, r = `${o.inventoryBackendUrl}/${e}/delivery-order`;
71
+ return await t.post(r, a);
72
+ },
73
+ async getDeliveryOrderTrails(a, e) {
74
+ const r = c.currentLocationDBName, n = `${o.inventoryBackendUrl}/${r}/delivery-order/audit-trails`;
75
+ return await t.post(n, { purchaseOrderId: a, deliveryOrderId: e });
76
+ }
77
+ };
78
+ }), P = { key: 0 }, S = { key: 1 }, K = { key: 2 }, W = /* @__PURE__ */ I({
79
+ __name: "SystemTrailDialog",
80
+ props: {
81
+ purchaseOrderId: {},
82
+ deliveryOrderId: {},
83
+ adjustmentId: {},
84
+ closingId: {}
85
+ },
86
+ setup(o) {
87
+ const t = o, c = q(), l = F(), a = j(), e = m(!1), r = C(), n = m([]), d = m("");
88
+ async function $() {
89
+ t.adjustmentId ? await l.getAuditTrails(t.adjustmentId).then((s) => {
90
+ n.value = s;
91
+ }) : t.closingId ? await a.getAuditTrails(t.closingId).then((s) => {
92
+ n.value = s;
93
+ }) : t.purchaseOrderId && t.deliveryOrderId && await c.getDeliveryOrderTrails(t.purchaseOrderId, t.deliveryOrderId).then((s) => {
94
+ n.value = s;
95
+ });
96
+ }
97
+ function w(s) {
98
+ r.open({
99
+ title: "Metadata",
100
+ contentComponent: B(
101
+ "pre",
102
+ { class: "bg-gray-100 p-4 rounded whitespace-pre-wrap" },
103
+ JSON.stringify(s, null, 2)
104
+ )
105
+ });
106
+ }
107
+ const f = [
108
+ {
109
+ accessorKey: "createdAt",
110
+ header: () => "Created At"
111
+ },
112
+ {
113
+ accessorKey: "createdBy",
114
+ header: () => "Created By",
115
+ cell: (s) => s.getValue().name
116
+ },
117
+ {
118
+ accessorKey: "message",
119
+ header: () => "Message"
120
+ },
121
+ {
122
+ accessorKey: "metadata",
123
+ header: () => "Metadata",
124
+ cell: (s) => B(V.FmButton, {
125
+ label: "View",
126
+ onClick: () => w(s.getValue())
127
+ }),
128
+ meta: {
129
+ cellSpanClass: ""
130
+ }
131
+ }
132
+ ];
133
+ return (s, h) => {
134
+ const N = p("FmButton"), D = p("FmTable"), b = p("FmDialog");
135
+ return i(), O(b, {
136
+ modelValue: e.value,
137
+ "onUpdate:modelValue": h[0] || (h[0] = (k) => e.value = k),
138
+ overlay: !0,
139
+ dismissAway: "",
140
+ "max-width": "800px"
141
+ }, {
142
+ "dialog-button": u(() => [
143
+ y(L, null, {
144
+ default: u(() => [
145
+ y(N, {
146
+ variant: "plain",
147
+ label: "Trails",
148
+ size: "md",
149
+ "prepend-icon": "overview",
150
+ onClick: $
151
+ })
152
+ ]),
153
+ _: 1
154
+ })
155
+ ]),
156
+ "dialog-header": u(() => [
157
+ s.adjustmentId ? (i(), v("div", P, 'Adjustment Template "' + g(s.adjustmentId) + '" Trails', 1)) : s.closingId ? (i(), v("div", S, 'Closing Template "' + g(s.closingId) + '" Trails', 1)) : (i(), v("div", K, 'Delivery Order "' + g(s.deliveryOrderId) + '" Trails', 1))
158
+ ]),
159
+ default: u(() => [
160
+ T("div", null, [
161
+ y(D, {
162
+ "row-data": n.value,
163
+ "column-defs": f,
164
+ "search-value": d.value,
165
+ "shrink-at": !1
166
+ }, null, 8, ["row-data", "search-value"])
167
+ ])
168
+ ]),
169
+ _: 1
170
+ }, 8, ["modelValue"]);
171
+ };
172
+ }
173
+ });
174
+ export {
175
+ W as _,
176
+ q as u
177
+ };
@@ -0,0 +1,135 @@
1
+ import { useI18n as R } from "@feedmepos/mf-common";
2
+ import { components as h } from "@feedmepos/ui-library";
3
+ import { h as i, defineComponent as F, computed as B, openBlock as u, createBlock as V, resolveDynamicComponent as z, unref as p, normalizeClass as D, withCtx as M, createElementVNode as c, renderSlot as N, normalizeProps as P, guardReactiveProps as _, createElementBlock as m, Fragment as w, renderList as E, createVNode as b, createCommentVNode as y } from "vue";
4
+ const { FmMenu: L, FmButton: S, FmMenuItem: $ } = h;
5
+ function O(o, a) {
6
+ return i(
7
+ L,
8
+ {
9
+ trigger: "click",
10
+ stopClickPropagation: !0
11
+ },
12
+ {
13
+ "menu-button": () => i(S, {
14
+ type: "button",
15
+ variant: "tertiary",
16
+ icon: "more_vert",
17
+ iconColor: "#000000",
18
+ size: "md"
19
+ }),
20
+ default: () => i(
21
+ "div",
22
+ {
23
+ style: {
24
+ backgroundColor: "white",
25
+ padding: "4px",
26
+ width: "160px"
27
+ }
28
+ },
29
+ o.map(({ translationKey: t, color: e, value: r }) => {
30
+ const { t: s } = R(), n = s(t);
31
+ return i(
32
+ $,
33
+ {
34
+ onClick() {
35
+ a(r ?? n);
36
+ }
37
+ },
38
+ {
39
+ label: () => i(
40
+ "span",
41
+ {
42
+ class: e
43
+ },
44
+ n
45
+ )
46
+ }
47
+ );
48
+ })
49
+ )
50
+ }
51
+ );
52
+ }
53
+ /**
54
+ * vue-table
55
+ *
56
+ * Copyright (c) TanStack
57
+ *
58
+ * This source code is licensed under the MIT license found in the
59
+ * LICENSE.md file in the root directory of this source tree.
60
+ *
61
+ * @license MIT
62
+ */
63
+ const I = F({
64
+ props: ["render", "props"],
65
+ setup: (o) => () => typeof o.render == "function" || typeof o.render == "object" ? i(o.render, o.props) : o.render
66
+ }), j = { class: "flex gap-4 w-full" }, A = { class: "flex-1" }, T = { class: "flex flex-col" }, q = { key: 0 }, G = { key: 0 }, Q = /* @__PURE__ */ F({
67
+ __name: "TableActionableRow",
68
+ props: {
69
+ row: {},
70
+ onRowClick: {},
71
+ actionColumnId: { default: "action" }
72
+ },
73
+ setup(o) {
74
+ const a = o, t = B(
75
+ () => a.row.getVisibleCells().reduce(
76
+ (e, r) => (e[r.column.id] = r, e),
77
+ {}
78
+ )
79
+ );
80
+ return (e, r) => (u(), V(z(e.onRowClick ? p(h).FmListItem : "div"), {
81
+ class: D([
82
+ "w-full border-b border-fm-color-neutral-gray-100",
83
+ {
84
+ "bg-fm-color-neutral-gray-100": e.row.getIsSelected(),
85
+ "cursor-pointer": typeof e.onRowClick == "function"
86
+ }
87
+ ]),
88
+ onClick: r[0] || (r[0] = (s) => {
89
+ var n;
90
+ return (n = e.onRowClick) == null ? void 0 : n.call(e, e.row.original);
91
+ })
92
+ }, {
93
+ default: M(() => {
94
+ var s, n, f, d, C;
95
+ return [
96
+ c("div", j, [
97
+ c("div", A, [
98
+ N(e.$slots, "default", P(_(t.value)), () => [
99
+ c("div", T, [
100
+ (u(!0), m(w, null, E(a.row.getVisibleCells(), (l) => {
101
+ var g, v, k;
102
+ return u(), m(w, {
103
+ key: l.id
104
+ }, [
105
+ l.column.id !== e.actionColumnId ? (u(), m("div", q, [
106
+ b(p(I), {
107
+ render: (v = (g = l.column) == null ? void 0 : g.columnDef) == null ? void 0 : v.cell,
108
+ props: (k = l.getContext) == null ? void 0 : k.call(l)
109
+ }, null, 8, ["render", "props"])
110
+ ])) : y("", !0)
111
+ ], 64);
112
+ }), 128))
113
+ ])
114
+ ])
115
+ ]),
116
+ t.value[e.actionColumnId ?? ""] ? (u(), m("div", G, [
117
+ c("div", null, [
118
+ b(p(I), {
119
+ render: (f = (n = (s = t.value[e.actionColumnId ?? ""]) == null ? void 0 : s.column) == null ? void 0 : n.columnDef) == null ? void 0 : f.cell,
120
+ props: (C = (d = t.value[e.actionColumnId ?? ""]) == null ? void 0 : d.getContext) == null ? void 0 : C.call(d)
121
+ }, null, 8, ["render", "props"])
122
+ ])
123
+ ])) : y("", !0)
124
+ ])
125
+ ];
126
+ }),
127
+ _: 3
128
+ }, 8, ["class"]));
129
+ }
130
+ });
131
+ export {
132
+ I as F,
133
+ Q as _,
134
+ O as c
135
+ };
@@ -0,0 +1,123 @@
1
+ import { defineComponent as y, ref as u, computed as w, resolveComponent as v, openBlock as x, createElementBlock as F, createElementVNode as i, toDisplayString as N, createVNode as m, h as b } from "vue";
2
+ import { u as R } from "./vue-i18n-CUznvVzc.js";
3
+ import { components as B } from "@feedmepos/ui-library";
4
+ const L = { class: "flex flex-col gap-24" }, P = { class: "flex items-center" }, k = { class: "fm-typo-en-body-lg-600 flex-1" }, T = { class: "flex flex-col gap-4 w-full" }, A = /* @__PURE__ */ y({
5
+ __name: "TemplatePublishDialog",
6
+ props: {
7
+ title: {},
8
+ doc: {},
9
+ controller: {},
10
+ initialPublishedRev: {},
11
+ locations: {},
12
+ enabledLocations: {}
13
+ },
14
+ setup(f) {
15
+ const l = f, d = u(l.initialPublishedRev ?? {}), o = u(), h = w(
16
+ () => {
17
+ var e;
18
+ return (e = l.enabledLocations) != null && e.length ? l.enabledLocations : l.locations;
19
+ }
20
+ ), { t: p } = R(), c = u(""), g = [
21
+ {
22
+ id: "name",
23
+ header: () => "Name",
24
+ accessorKey: "name",
25
+ size: "auto"
26
+ },
27
+ {
28
+ id: "status",
29
+ header: () => "Published",
30
+ accessorFn: (e) => {
31
+ var s;
32
+ return !!(((s = d.value) == null ? void 0 : s[e.dbName]) ?? []).find((n) => n._id === l.doc._id && n._rev === l.doc._rev);
33
+ },
34
+ cell: (e) => {
35
+ var r;
36
+ const a = e.row.original, n = !!(((r = d.value) == null ? void 0 : r[a.dbName]) ?? []).find(
37
+ (t) => t._id === l.doc._id && t._rev === l.doc._rev
38
+ );
39
+ return b("div", { class: "flex items-center gap-8" }, [
40
+ b(
41
+ "div",
42
+ {
43
+ class: [
44
+ "fm-status-badge",
45
+ n ? "fm-status-badge-success-secondary" : "fm-status-badge-info-secondary"
46
+ ]
47
+ },
48
+ p(n ? "inventory.publish.status.published" : "inventory.publish.status.outdated")
49
+ ),
50
+ b(B.FmButton, {
51
+ class: "tertiary",
52
+ variant: "secondary",
53
+ icon: "ios_share",
54
+ loading: o.value === e.row.original.dbName,
55
+ disabled: o.value !== void 0 && o.value !== e.row.original.dbName,
56
+ onClick: async () => {
57
+ o.value = e.row.original.dbName;
58
+ try {
59
+ const t = await l.controller.publishAtLocation(e.row.original).delayed(1e3);
60
+ d.value = t;
61
+ } catch (t) {
62
+ console.error("Error publishing at location:", t);
63
+ } finally {
64
+ o.value = void 0;
65
+ }
66
+ }
67
+ })
68
+ ]);
69
+ }
70
+ }
71
+ ];
72
+ async function _() {
73
+ o.value = "all";
74
+ try {
75
+ const e = await l.controller.publishAll().delayed(1e3);
76
+ d.value = e;
77
+ } catch (e) {
78
+ console.error("Error publishing all:", e);
79
+ } finally {
80
+ o.value = void 0;
81
+ }
82
+ }
83
+ return (e, a) => {
84
+ const s = v("FmButton"), n = v("FmTextField"), r = v("FmTable");
85
+ return x(), F("div", L, [
86
+ i("div", P, [
87
+ i("div", k, N(e.title), 1),
88
+ i("div", null, [
89
+ m(s, {
90
+ label: "Publish all",
91
+ variant: "secondary",
92
+ onClick: a[0] || (a[0] = (t) => _()),
93
+ loading: o.value === "all",
94
+ disabled: o.value !== "all" && o.value !== void 0
95
+ }, null, 8, ["loading", "disabled"])
96
+ ])
97
+ ]),
98
+ i("div", T, [
99
+ m(n, {
100
+ modelValue: c.value,
101
+ "onUpdate:modelValue": a[1] || (a[1] = (t) => c.value = t),
102
+ class: "w-full",
103
+ placeholder: "Search locations",
104
+ "prepend-icon": "search"
105
+ }, null, 8, ["modelValue"]),
106
+ m(r, {
107
+ "row-data": h.value,
108
+ "column-defs": g,
109
+ "search-value": c.value,
110
+ "shrink-at": 9999,
111
+ "page-count": h.value.length,
112
+ style: { height: "300px" },
113
+ "hide-footer": ""
114
+ }, null, 8, ["row-data", "search-value", "page-count"])
115
+ ]),
116
+ a[2] || (a[2] = i("div", null, null, -1))
117
+ ]);
118
+ };
119
+ }
120
+ });
121
+ export {
122
+ A as _
123
+ };