@feedmepos/mf-inventory-portal 1.2.29 → 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.
- package/dist/{App-BcetoQcK.js → App-CZJre5y8.js} +56 -54
- package/dist/{ApprovalView-CyRCctkZ.js → ApprovalView-CnxHxojY.js} +34 -28
- package/dist/{BindingsDialog-DLN2RPYo.js → BindingsDialog-C6lCOPNs.js} +2 -2
- package/dist/{BindingsPicker-CDtYeSVh.js → BindingsPicker-DZtFKLQ5.js} +6 -5
- package/dist/{BindingsTable-C19Bm8d6.js → BindingsTable-BmQGLuJ4.js} +28 -24
- package/dist/{ClosingDraftView-DBFIR6Xv.js → ClosingDraftView-KLtlh31f.js} +184 -176
- package/dist/{ClosingHistoryView-BEZOwsPz.js → ClosingHistoryView-Rf1yMhMj.js} +43 -41
- package/dist/{ClosingTemplateView-COifu0I6.js → ClosingTemplateView-C_IiKnGx.js} +116 -98
- package/dist/{DeliveryOrderPrintPreview-lBFtH_Rm.js → DeliveryOrderPrintPreview-UF7V005U.js} +15 -14
- package/dist/FmDroppableField-J0xUsOTV.js +154 -0
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BhhmWaOl.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BcMvEdc0.js} +74 -72
- package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CqAeF0wL.js +279 -0
- package/dist/{FmMultiselectDialog-CBYvYJnE.js → FmMultiselectDialog-B0aKuf2o.js} +1 -1
- package/dist/FmMultiselectDialog-BasrjBFA.js +597 -0
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-CLuceimk.js → FmUnitInput.vue_vue_type_script_setup_true_lang-CaYJJkXz.js} +51 -49
- package/dist/{ImportView-DYNjmjys.js → ImportView-DRSoz0uM.js} +81 -74
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-BXefPowE.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DA8SlWPy.js} +5 -5
- package/dist/{IngredientGroupView-CNzK_dDv.js → IngredientGroupView-D5Laak2-.js} +73 -65
- package/dist/{IngredientsView-BnrA0ijB.js → IngredientsView-TG3fPQhR.js} +358 -345
- package/dist/{IntegrationView-DwcP5MgB.js → IntegrationView-CElpjyo7.js} +219 -209
- package/dist/{InventoryBindingForm-DeqdcXzm.js → InventoryBindingForm-CBgxRYBd.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-FuPTxo7z.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-Ys5GBHoQ.js} +41 -40
- package/dist/{InventoryBindingSummary-Dp0bshzL.js → InventoryBindingSummary-OK3vNWhi.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DLvWaFvA.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-9QRntUlk.js} +5 -5
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-tLW9bojI.js → PremiumBadge.vue_vue_type_script_setup_true_lang-Bc01NoOn.js} +22 -21
- package/dist/{PublishView-CxIU1aI4.js → PublishView-CLMfiLjP.js} +26 -23
- package/dist/{PurchaseOrderPrintPreview-DWxp3cFM.js → PurchaseOrderPrintPreview-Dy77yWDC.js} +10 -9
- package/dist/{ReceiveRequestView-CF9ingct.js → ReceiveRequestView-BhD-NaHE.js} +324 -308
- package/dist/{RecipeView-B87vakmu.js → RecipeView-RWaO94w_.js} +73 -64
- package/dist/SingleColumnLayout.vue_vue_type_script_setup_true_lang-DY7TaxPK.js +251 -0
- package/dist/{StockView-XJY3690u.js → StockView-D5t8OxaG.js} +292 -282
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DY1iRl1F.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-3Asf1TGd.js} +1 -1
- package/dist/{SupplierView-Y2NqnJ6-.js → SupplierView-DiospFKq.js} +92 -80
- package/dist/SystemTrailDialog.vue_vue_type_script_setup_true_lang-DfCHteOF.js +177 -0
- package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js +135 -0
- package/dist/TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CNtvx-LA.js +123 -0
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-l0qRNa0W.js → TransferDetails.vue_vue_type_script_setup_true_lang-p959Op4k.js} +318 -305
- package/dist/{TransferTemplateView-DBlasHGY.js → TransferTemplateView-ePZFdZ0p.js} +228 -216
- package/dist/{UnitView-C8z90hHr.js → UnitView-Banlxw7y.js} +70 -63
- package/dist/{WarehouseView-egtnCnzo.js → WarehouseView-BL-p5hbi.js} +123 -114
- package/dist/WastageTemplateView-B1pmSuW0.js +2288 -0
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/app-EpEEb8EO.js +64040 -0
- package/dist/app-rgirz_52.js +8024 -0
- package/dist/app.js +6 -6
- package/dist/closing-template-zIjwO1_E.js +117 -0
- package/dist/date2-Dnc8Y81g.js +116 -0
- package/dist/dayjs.min-TdUgzmww.js +282 -0
- package/dist/{decimal-CLM3HUsc.js → decimal-C6s3GvGb.js} +4 -3
- package/dist/defineDeepModel-BSaaXVBF.js +19 -0
- package/dist/duplicate-template-Bw0H416G.js +34 -0
- package/dist/feature-C95Hao53.js +20162 -0
- package/dist/form-mode.enum-BKiNVH6A.js +4 -0
- package/dist/format-time-from-id-DlbHo6kY.js +15 -0
- package/dist/{format-unit-display-BWoznxQp.js → format-unit-display-QBS54q0R.js} +308 -297
- package/dist/{import-export.helper-DgKnsYRB.js → import-export.helper-CUKCKtP7.js} +56 -52
- package/dist/index-CFn_9RMm.js +45 -0
- package/dist/{index-CK61uHgW.js → index-S9Ak__QC.js} +1 -1
- package/dist/{index-tMZSFG5r.js → index-goD-WGVb.js} +16 -14
- package/dist/lodash-gq8IrP4j.js +3678 -0
- package/dist/netsuite-CnhAKyAO.js +4316 -0
- package/dist/{purchase-order-template-D7dkJMqf.js → purchase-order-template-CBIpWdEW.js} +1 -1
- package/dist/router/shared.spec.d.ts +1 -0
- package/dist/row-action.enum-BcW_L_nE.js +67 -0
- package/dist/rules-DKklsaS1.js +201 -0
- package/dist/{stock-B3EEUmkF.js → stock-3K93Mif9.js} +1 -1
- package/dist/{stock-DYBHa0KN.js → stock-BW8fen3H.js} +11 -10
- package/dist/style.css +1 -1
- package/dist/{supplier-CY7Hj_a2.js → supplier-CObCSfot.js} +27 -26
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-Dlv7Eowu.js → use-ingredient-select-dialog-DwvQiaVW.js} +4 -3
- package/dist/{use-inventory-binding-dialog-DOSfDQte.js → use-inventory-binding-dialog-CuLEHLDM.js} +4 -3
- package/dist/use-template-enabled-locations-2-DkUJeppb.js +111 -0
- package/dist/views/adjustment-template/wastage-template/table.d.ts +1 -1
- package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +1 -1
- package/dist/vue-i18n-CUznvVzc.js +2365 -0
- package/dist/xlsx-bT1p3YVR.js +24004 -0
- package/dist/xlsx.util-Cr9DpDFb.js +78 -0
- package/package.json +6 -6
- package/dist/app-B5p73NM9.js +0 -130949
|
@@ -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
|
+
};
|