@feedmepos/mf-inventory-portal 1.3.7 → 1.3.8-dev.1
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-D1-fT3jF.js → App-Dl97lAmD.js} +3 -3
- package/dist/ApprovalView-RePEhbhl.js +241 -0
- package/dist/{BindingsDialog-DeavyPY-.js → BindingsDialog-8QVbtnnq.js} +5 -5
- package/dist/{BindingsPicker-BGzhKq8G.js → BindingsPicker-D9yuDGcq.js} +3 -3
- package/dist/{BindingsTable-Dr9hWkE1.js → BindingsTable-DAYhI-6V.js} +5 -5
- package/dist/{ClosingDraftView-6gwWEWWB.js → ClosingDraftView-D_VtBfFG.js} +57 -57
- package/dist/{ClosingHistoryView-D4rNnlsq.js → ClosingHistoryView-ClUnxQS2.js} +4 -4
- package/dist/{ClosingTemplateView-DxCLH1GH.js → ClosingTemplateView-0a_isyyx.js} +16 -16
- package/dist/{DeliveryOrderPrintPreview-D-XeZX-z.js → DeliveryOrderPrintPreview-DovAi6j-.js} +17 -17
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DeoaPLQm.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DjNZ0m13.js} +14 -14
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BMhSHZ3Z.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-4vZH2hLF.js} +2 -2
- package/dist/{FmMultiselectDialog-DJFi54mG.js → FmMultiselectDialog-B5-aK-b2.js} +1 -1
- package/dist/{FmMultiselectDialog-BQZmTWDb.js → FmMultiselectDialog-Z49kK96R.js} +2 -2
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-DAivpdPp.js → FmUnitInput.vue_vue_type_script_setup_true_lang-zP1nS7bp.js} +4 -4
- package/dist/{ImportView-DPQY0ELT.js → ImportView-Dba8fJry.js} +6 -6
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DeVYXEzb.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DHITBIhp.js} +1 -1
- package/dist/{IngredientGroupView-5AuPbMDz.js → IngredientGroupView-CHi5_A4T.js} +7 -7
- package/dist/{IngredientsView-qMotWYnL.js → IngredientsView-DWk27PJg.js} +17 -17
- package/dist/IntegrationExplorerView-CixgHWVb.js +22254 -0
- package/dist/{IntegrationView-CVdwhNTA.js → IntegrationView-fttszvyC.js} +13 -13
- package/dist/{InventoryBindingForm-B5KUYKIu.js → InventoryBindingForm-DDcM2paa.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-pbyMU879.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DOHrtdbl.js} +5 -5
- package/dist/{InventoryBindingSummary-Bm3A2kmC.js → InventoryBindingSummary-BERshnpd.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-NnoVkA8W.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-D4u0MM_k.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-Dp4gFbs5.js → PremiumBadge.vue_vue_type_script_setup_true_lang-eFb-84g2.js} +1 -1
- package/dist/{PublishView-DOIiAeDK.js → PublishView-COGdnDHP.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-BE-8EJFv.js → PurchaseOrderPrintPreview-COJVgeTm.js} +12 -12
- package/dist/ReceiveRequestView-DvC12_QK.js +2817 -0
- package/dist/{RecipeView-CM-BrVSe.js → RecipeView-BKlVCFPR.js} +22 -21
- package/dist/SettingsView-DbXva8_D.js +695 -0
- package/dist/{StockView-DDqlms0m.js → StockView-Hri6SSjn.js} +21 -20
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-CcQ6bBWG.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DiRfjFmz.js} +1 -1
- package/dist/{SupplierView-CM2PrtHi.js → SupplierView-DCMW5muk.js} +14 -14
- package/dist/{SurchargeView-q2NfASMH.js → SurchargeView-DRh5EAi8.js} +8 -8
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-BbZQZQTQ.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-BHNIS7Pp.js} +2 -2
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-Bp3joqMK.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-BVyoZ2a4.js} +1 -1
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-CMSKhz6_.js +3790 -0
- package/dist/{TransferTemplateView-B26H_T9Q.js → TransferTemplateView-71XY525Q.js} +20 -19
- package/dist/{UnitCostHistoryView-BzumRVdx.js → UnitCostHistoryView-CjEaekfJ.js} +4 -4
- package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-CfWpv2Mv.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-B8dRQhZi.js} +4 -4
- package/dist/{UnitView-Cxfg--TU.js → UnitView-D06txpBT.js} +9 -9
- package/dist/{WarehouseView-CvoafTrd.js → WarehouseView-DQluGq0D.js} +7 -7
- package/dist/{WastageTemplateView-Bqd4Wp3d.js → WastageTemplateView-Bqmd_r_Y.js} +16 -16
- package/dist/api/integration-sync-log.d.ts +47 -0
- package/dist/api/netsuite-explorer.d.ts +51 -0
- package/dist/{app-CrrDFeMj.js → app-B5-QVzib.js} +4711 -4557
- package/dist/app.d.ts +32 -0
- package/dist/app.js +2 -2
- package/dist/{closing-template-Ew74NLQj.js → closing-template-C3ClR8Pj.js} +1 -1
- package/dist/{component-DpCUABT3.js → component-kqxARxvM.js} +30 -21
- package/dist/components/row-action.enum.d.ts +3 -0
- package/dist/{date2-Bklbk2g-.js → date2-CQCX7jCE.js} +4 -4
- package/dist/{dayjs.min-B463GIlc.js → dayjs.min-Dhp0BWSV.js} +1 -1
- package/dist/{decimal-Dm2vbfDq.js → decimal-98G--u_X.js} +2 -2
- package/dist/defineDeepModel-BmHs4vdS.js +19 -0
- package/dist/{duplicate-template-CR79OmLy.js → duplicate-template-UzmArmcM.js} +1 -1
- package/dist/{export-CQJcxfPC.js → export-Bdxro0GT.js} +1 -1
- package/dist/feature-DyfUPR3b.js +1081 -0
- package/dist/{format-time-from-id-61ydd8RS.js → format-time-from-id-uRCD3JxF.js} +1 -1
- package/dist/{format-unit-display-BLtW28yU.js → format-unit-display-C-_85vuL.js} +13 -13
- package/dist/{import-export.helper-uhFwjH6X.js → import-export.helper-N1BqiTub.js} +6 -6
- package/dist/{index-Dx5HvWR_.js → index-B1RZtqz-.js} +1 -1
- package/dist/{index-uA6bkf1x.js → index-CaREZ_vQ.js} +3 -3
- package/dist/{index-CouegIcG.js → index-CwqHa5AY.js} +1 -1
- package/dist/{feature-CZHvliez.js → inventory-core-dart.default-BK8f9n8e.js} +322 -1395
- package/dist/{lodash-CjyamSgJ.js → lodash-B9tHF9A4.js} +1 -1
- package/dist/{lz-string-BbZdMrTL.js → lz-string-BSMjlcH9.js} +1 -1
- package/dist/modules/print-template/api/print-template.d.ts +29 -0
- package/dist/modules/print-template/components/BlockConfigPanel.vue.d.ts +19 -0
- package/dist/modules/print-template/components/CustomPrintTemplatePreview.vue.d.ts +25 -0
- package/dist/modules/print-template/components/PrintTemplateEditorDialog.vue.d.ts +45 -0
- package/dist/modules/print-template/components/TemplatePreview.vue.d.ts +22 -0
- package/dist/modules/print-template/composables/print-po-with-template.d.ts +25 -0
- package/dist/modules/print-template/definitions/block-definitions.d.ts +88 -0
- package/dist/modules/print-template/definitions/predefined-templates.d.ts +22 -0
- package/dist/modules/print-template/definitions/template-renderer.d.ts +17 -0
- package/dist/modules/print-template/index.d.ts +11 -0
- package/dist/modules/print-template/store/print-template.d.ts +170 -0
- package/dist/modules/print-template/types/print-data.d.ts +52 -0
- package/dist/modules/print-template/utils/sanitize-html.d.ts +32 -0
- package/dist/{netsuite-2v3F8ILe.js → netsuite-D4KHhWWu.js} +60 -9
- package/dist/{number-BYbxsJHr.js → number-DmqVo28f.js} +3 -3
- package/dist/predefined-templates-Dy5hYXMM.js +4542 -0
- package/dist/{purchase-order-template-s1AiueV_.js → purchase-order-template-BT3tF_gn.js} +1 -1
- package/dist/router/name.d.ts +2 -0
- package/dist/{row-action.enum-BcW_L_nE.js → row-action.enum-Co_O4qD9.js} +11 -3
- package/dist/{rules-C7L-LFOd.js → rules-CbJ7idQa.js} +2 -2
- package/dist/{stock-D2s88pz1.js → stock-C9RXv-3_.js} +1 -1
- package/dist/{stock-CvYOcgWb.js → stock-YXoLCE8o.js} +3 -3
- package/dist/stores/feature.d.ts +2 -0
- package/dist/stores/integration/netsuite.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/{supplier-DmobM7mD.js → supplier-Duiacdig.js} +2 -2
- package/dist/{surcharge-BdZOVfi0.js → surcharge-CkDK4P_6.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-BUCJBHjV.js → use-ingredient-select-dialog-C7uVeT1M.js} +2 -2
- package/dist/{use-inventory-binding-dialog-DiN1hBIm.js → use-inventory-binding-dialog-BIo9Fi-9.js} +2 -2
- package/dist/{use-template-enabled-locations-CmH6I2cy.js → use-template-enabled-locations-BtbfLc0y.js} +2 -2
- package/dist/views/integration/components/IntegrationSyncLogTab.vue.d.ts +15 -0
- package/dist/views/integration/composables/use-integration-sync-log.d.ts +45 -0
- package/dist/views/integration-explorer/IntegrationExplorerView.vue.d.ts +2 -0
- package/dist/views/integration-explorer/composables/use-explorer-tab.d.ts +126 -0
- package/dist/views/integration-explorer/netsuite/ExplorerRecordSyncLog.vue.d.ts +17 -0
- package/dist/views/integration-explorer/netsuite/ExplorerRecordToolbar.vue.d.ts +201 -0
- package/dist/views/integration-explorer/netsuite/ExplorerSystemNote.vue.d.ts +15 -0
- package/dist/views/integration-explorer/netsuite/JsonViewer.vue.d.ts +15 -0
- package/dist/views/integration-explorer/netsuite/NetSuiteExplorerView.vue.d.ts +2 -0
- package/dist/views/integration-explorer/netsuite/inventoryTransfer/InventoryTransferSideSheet.vue.d.ts +7 -0
- package/dist/views/integration-explorer/netsuite/inventoryTransfer/InventoryTransferView.vue.d.ts +39 -0
- package/dist/views/integration-explorer/netsuite/items/AssemblyItemSideSheet.vue.d.ts +7 -0
- package/dist/views/integration-explorer/netsuite/items/InventoryItemSideSheet.vue.d.ts +7 -0
- package/dist/views/integration-explorer/netsuite/items/ItemsView.vue.d.ts +2 -0
- package/dist/views/integration-explorer/netsuite/items/ServiceItemSideSheet.vue.d.ts +7 -0
- package/dist/views/integration-explorer/netsuite/orders/ExplorerOrderDetailSideSheet.vue.d.ts +7 -0
- package/dist/views/integration-explorer/netsuite/orders/OrdersView.vue.d.ts +39 -0
- package/dist/views/integration-explorer/netsuite/orders/PurchaseOrderSideSheet.vue.d.ts +7 -0
- package/dist/views/integration-explorer/netsuite/orders/SyncNetsuiteButton.vue.d.ts +29 -0
- package/dist/views/integration-explorer/netsuite/orders/TransferOrderSideSheet.vue.d.ts +7 -0
- package/dist/views/receive-request/components/transfer-form/TransferFormWithController.vue.d.ts +21 -21
- package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +21 -21
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +129 -129
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +154 -150
- package/dist/views/settings/SettingsView.vue.d.ts +2 -0
- package/dist/vue-i18n-D1JHIbLE.js +2365 -0
- package/dist/{xlsx-D4PML26z.js → xlsx-BEbkruI_.js} +398 -398
- package/dist/{xlsx.util-BWLcCmO_.js → xlsx.util-BMTXqfxw.js} +1 -1
- package/package.json +9 -4
- package/dist/ApprovalView-0FbsslVD.js +0 -226
- package/dist/ReceiveRequestView-ur3OeHuv.js +0 -2802
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-GhRFdMoW.js +0 -3521
- package/dist/defineDeepModel-SD5OUepJ.js +0 -19
- package/dist/vue-i18n-D0Q6LFcu.js +0 -2365
|
@@ -0,0 +1,695 @@
|
|
|
1
|
+
import { defineComponent as Y, ref as b, computed as K, watch as M, resolveComponent as V, openBlock as s, createElementBlock as r, createElementVNode as t, toDisplayString as F, Fragment as U, renderList as G, createVNode as p, createBlock as P, createCommentVNode as q, nextTick as fe, createSlots as ye, withCtx as T, normalizeClass as ee, unref as O, withModifiers as be, Teleport as xe } from "vue";
|
|
2
|
+
import { _ as _e } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CkPuJQWF.js";
|
|
3
|
+
import { B as A, g as he, r as ke, s as we, u as Te, a as R, b as Fe, c as De, d as te, e as Ce, f as Se } from "./predefined-templates-Dy5hYXMM.js";
|
|
4
|
+
import { useSnackbar as Be } from "@feedmepos/ui-library";
|
|
5
|
+
import { _ as Ve } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
|
+
import { I as j, J as $e } from "./app-B5-QVzib.js";
|
|
7
|
+
import { useCoreStore as ze, useI18n as Ie } from "@feedmepos/mf-common";
|
|
8
|
+
import "./dayjs.min-Dhp0BWSV.js";
|
|
9
|
+
import "./inventory-core-dart.default-BK8f9n8e.js";
|
|
10
|
+
import { F as Oe } from "./FmAdminBadge-BOEV93D3.js";
|
|
11
|
+
const Pe = { class: "p-3" }, Ee = { class: "text-sm font-semibold text-gray-700 mb-4 pb-2 border-b border-gray-200" }, Ne = { class: "flex flex-col gap-3" }, Ue = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "flex items-center justify-between py-1"
|
|
14
|
+
}, Ae = { class: "text-[13px] text-gray-600" }, He = { class: "text-[13px] text-gray-600" }, Le = ["value", "rows", "placeholder", "onInput"], Re = {
|
|
15
|
+
key: 5,
|
|
16
|
+
class: "flex items-center justify-between py-1"
|
|
17
|
+
}, je = { class: "text-[13px] text-gray-600" }, Me = ["value", "onInput"], Ge = /* @__PURE__ */ Y({
|
|
18
|
+
__name: "BlockConfigPanel",
|
|
19
|
+
props: {
|
|
20
|
+
block: {}
|
|
21
|
+
},
|
|
22
|
+
emits: ["update"],
|
|
23
|
+
setup(E, { emit: x }) {
|
|
24
|
+
const g = E, f = x;
|
|
25
|
+
function h(n) {
|
|
26
|
+
var v;
|
|
27
|
+
if ((v = n.config) != null && v.configFields && Array.isArray(n.config.configFields))
|
|
28
|
+
return n.config.configFields.map((_) => ({ ..._ }));
|
|
29
|
+
const c = A[n.tag];
|
|
30
|
+
return c ? c.initialConfigFields() : [];
|
|
31
|
+
}
|
|
32
|
+
const d = b(h(g.block)), $ = K(() => {
|
|
33
|
+
const n = A[g.block.tag];
|
|
34
|
+
return (n == null ? void 0 : n.label) ?? g.block.tag;
|
|
35
|
+
});
|
|
36
|
+
M(
|
|
37
|
+
() => g.block,
|
|
38
|
+
(n) => {
|
|
39
|
+
d.value = h(n);
|
|
40
|
+
},
|
|
41
|
+
{ deep: !0 }
|
|
42
|
+
);
|
|
43
|
+
function i(n, c) {
|
|
44
|
+
const v = d.value[n];
|
|
45
|
+
v && (v.value = c, m());
|
|
46
|
+
}
|
|
47
|
+
function m() {
|
|
48
|
+
f("update", {
|
|
49
|
+
...g.block.config || {},
|
|
50
|
+
configFields: d.value.map((n) => ({ ...n }))
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
return (n, c) => {
|
|
54
|
+
const v = V("FmSwitch"), _ = V("FmTextField"), D = V("FmSelect");
|
|
55
|
+
return s(), r("div", Pe, [
|
|
56
|
+
t("div", Ee, F($.value) + " Settings ", 1),
|
|
57
|
+
t("div", Ne, [
|
|
58
|
+
(s(!0), r(U, null, G(d.value, (a, w) => (s(), r("div", {
|
|
59
|
+
key: a.key
|
|
60
|
+
}, [
|
|
61
|
+
a.type === "toggle" ? (s(), r("div", Ue, [
|
|
62
|
+
t("label", Ae, F(a.label), 1),
|
|
63
|
+
p(v, {
|
|
64
|
+
"model-value": a.value,
|
|
65
|
+
"onUpdate:modelValue": (y) => i(w, y)
|
|
66
|
+
}, null, 8, ["model-value", "onUpdate:modelValue"])
|
|
67
|
+
])) : a.type === "text" ? (s(), P(_, {
|
|
68
|
+
key: 1,
|
|
69
|
+
label: a.label,
|
|
70
|
+
"model-value": a.value,
|
|
71
|
+
placeholder: a.placeholder,
|
|
72
|
+
"onUpdate:modelValue": (y) => i(w, y)
|
|
73
|
+
}, null, 8, ["label", "model-value", "placeholder", "onUpdate:modelValue"])) : a.type === "textarea" ? (s(), r(U, { key: 2 }, [
|
|
74
|
+
t("div", He, F(a.label), 1),
|
|
75
|
+
t("textarea", {
|
|
76
|
+
class: "w-full font-mono text-[13px] p-2 border border-gray-300 rounded resize-y box-border focus:outline-none focus:border-blue-600",
|
|
77
|
+
value: a.value,
|
|
78
|
+
rows: a.rows ?? 8,
|
|
79
|
+
placeholder: a.placeholder,
|
|
80
|
+
onInput: (y) => i(w, y.target.value)
|
|
81
|
+
}, null, 40, Le)
|
|
82
|
+
], 64)) : a.type === "select" ? (s(), P(D, {
|
|
83
|
+
key: 3,
|
|
84
|
+
label: a.label,
|
|
85
|
+
"model-value": a.value,
|
|
86
|
+
items: a.options || [],
|
|
87
|
+
"item-label": "label",
|
|
88
|
+
"item-value": "value",
|
|
89
|
+
"onUpdate:modelValue": (y) => i(w, y)
|
|
90
|
+
}, null, 8, ["label", "model-value", "items", "onUpdate:modelValue"])) : a.type === "number" ? (s(), P(_, {
|
|
91
|
+
key: 4,
|
|
92
|
+
label: a.label,
|
|
93
|
+
type: "number",
|
|
94
|
+
"model-value": String(a.value),
|
|
95
|
+
"onUpdate:modelValue": (y) => i(w, Number(y))
|
|
96
|
+
}, null, 8, ["label", "model-value", "onUpdate:modelValue"])) : a.type === "color" ? (s(), r("div", Re, [
|
|
97
|
+
t("label", je, F(a.label), 1),
|
|
98
|
+
t("input", {
|
|
99
|
+
type: "color",
|
|
100
|
+
value: a.value,
|
|
101
|
+
class: "color-input w-9 h-7 p-0 border border-gray-300 rounded cursor-pointer bg-transparent",
|
|
102
|
+
onInput: (y) => i(w, y.target.value)
|
|
103
|
+
}, null, 40, Me)
|
|
104
|
+
])) : q("", !0)
|
|
105
|
+
]))), 128))
|
|
106
|
+
])
|
|
107
|
+
]);
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
}), qe = /* @__PURE__ */ Ve(Ge, [["__scopeId", "data-v-1f00cb56"]]), Ke = { class: "h-full flex flex-col" }, Ye = { class: "flex-1 overflow-auto p-4 bg-gray-100" }, Je = /* @__PURE__ */ Y({
|
|
111
|
+
__name: "TemplatePreview",
|
|
112
|
+
props: {
|
|
113
|
+
blocks: {},
|
|
114
|
+
previewData: {},
|
|
115
|
+
selectedBlockId: {},
|
|
116
|
+
templateType: {}
|
|
117
|
+
},
|
|
118
|
+
setup(E) {
|
|
119
|
+
const x = E, g = b(null);
|
|
120
|
+
let f = null;
|
|
121
|
+
function h() {
|
|
122
|
+
return !f && g.value && (f = g.value.attachShadow({ mode: "open" })), f;
|
|
123
|
+
}
|
|
124
|
+
const d = K(() => x.previewData ?? he(x.templateType));
|
|
125
|
+
M(
|
|
126
|
+
() => [x.blocks, d.value, g.value],
|
|
127
|
+
() => {
|
|
128
|
+
const i = h();
|
|
129
|
+
if (i) {
|
|
130
|
+
try {
|
|
131
|
+
const m = ke(x.blocks, d.value), n = we(m);
|
|
132
|
+
i.innerHTML = `
|
|
133
|
+
<style>
|
|
134
|
+
:host { display: block; }
|
|
135
|
+
.preview-scale-wrapper {
|
|
136
|
+
transform-origin: top left;
|
|
137
|
+
transform: scale(0.75);
|
|
138
|
+
width: 133.33%;
|
|
139
|
+
}
|
|
140
|
+
.preview-content {
|
|
141
|
+
max-width: 800px;
|
|
142
|
+
margin: auto;
|
|
143
|
+
padding: 30px;
|
|
144
|
+
border: 1px solid #eee;
|
|
145
|
+
box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
|
|
146
|
+
background: white;
|
|
147
|
+
font-size: 16px;
|
|
148
|
+
line-height: 1.5;
|
|
149
|
+
font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;
|
|
150
|
+
color: #555;
|
|
151
|
+
}
|
|
152
|
+
</style>
|
|
153
|
+
<div class="preview-scale-wrapper">
|
|
154
|
+
<div class="preview-content">${n}</div>
|
|
155
|
+
</div>
|
|
156
|
+
`;
|
|
157
|
+
} catch (m) {
|
|
158
|
+
i.innerHTML = `<div style="color:red;padding:20px;">Error rendering template: ${m}</div>`;
|
|
159
|
+
}
|
|
160
|
+
fe(() => $(x.selectedBlockId));
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
{ deep: !0, immediate: !0 }
|
|
164
|
+
), M(
|
|
165
|
+
() => x.selectedBlockId,
|
|
166
|
+
(i) => $(i)
|
|
167
|
+
);
|
|
168
|
+
function $(i) {
|
|
169
|
+
if (!f || (f.querySelectorAll("[data-block-id].highlight").forEach((n) => {
|
|
170
|
+
n.classList.remove("highlight");
|
|
171
|
+
}), !i)) return;
|
|
172
|
+
const m = f.querySelector(`[data-block-id="${i}"]`);
|
|
173
|
+
m && (m.classList.add("highlight"), m.scrollIntoView({ behavior: "smooth", block: "nearest" }));
|
|
174
|
+
}
|
|
175
|
+
return (i, m) => (s(), r("div", Ke, [
|
|
176
|
+
m[0] || (m[0] = t("div", { class: "text-xs font-semibold text-gray-400 uppercase tracking-wider px-3 py-2 border-b border-gray-200" }, " Live Preview ", -1)),
|
|
177
|
+
t("div", Ye, [
|
|
178
|
+
t("div", {
|
|
179
|
+
ref_key: "shadowHost",
|
|
180
|
+
ref: g
|
|
181
|
+
}, null, 512)
|
|
182
|
+
])
|
|
183
|
+
]));
|
|
184
|
+
}
|
|
185
|
+
}), Qe = { class: "flex items-center gap-2 text-base font-semibold" }, We = { key: 1 }, Xe = { key: 2 }, Ze = {
|
|
186
|
+
key: 0,
|
|
187
|
+
class: "p-6"
|
|
188
|
+
}, et = {
|
|
189
|
+
key: 0,
|
|
190
|
+
class: "flex justify-center items-center h-40 text-gray-400"
|
|
191
|
+
}, tt = {
|
|
192
|
+
key: 1,
|
|
193
|
+
class: "grid grid-cols-2 gap-8"
|
|
194
|
+
}, lt = ["onClick"], ot = { class: "flex items-center justify-center w-12 h-12 rounded-xl bg-gray-100 text-gray-500 group-hover:bg-blue-100 group-hover:text-blue-600 transition-colors" }, at = { class: "text-center" }, st = { class: "text-sm font-semibold text-gray-700 group-hover:text-blue-700" }, nt = { class: "text-xs text-gray-400 mt-1" }, rt = {
|
|
195
|
+
key: 0,
|
|
196
|
+
class: "absolute top-2.5 right-2.5 text-[10px] font-medium text-green-600 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full"
|
|
197
|
+
}, it = {
|
|
198
|
+
key: 1,
|
|
199
|
+
class: "absolute top-2.5 right-2.5 text-[10px] font-medium text-gray-400 bg-gray-100 px-2 py-0.5 rounded-full"
|
|
200
|
+
}, ut = {
|
|
201
|
+
key: 1,
|
|
202
|
+
class: "flex justify-center items-center h-[400px] text-gray-400"
|
|
203
|
+
}, dt = {
|
|
204
|
+
key: 2,
|
|
205
|
+
class: "flex h-[calc(100vh-120px)] border-t border-gray-200"
|
|
206
|
+
}, ct = { class: "w-[280px] border-r border-gray-200 overflow-y-auto shrink-0" }, pt = { class: "px-3 pt-3 pb-2" }, mt = { class: "flex flex-col" }, vt = ["onClick"], gt = { class: "border-y border-gray-100" }, ft = ["onDragstart", "onDragover", "onDrop", "onClick"], yt = { class: "flex-1" }, bt = { class: "flex gap-1 opacity-50 hover:opacity-100" }, xt = {
|
|
207
|
+
key: 0,
|
|
208
|
+
class: "py-6 px-4 text-center text-gray-400 text-[13px]"
|
|
209
|
+
}, _t = {
|
|
210
|
+
key: 0,
|
|
211
|
+
class: "border-t border-gray-200"
|
|
212
|
+
}, ht = {
|
|
213
|
+
key: 1,
|
|
214
|
+
class: "flex items-center justify-center text-gray-400 text-[13px] py-8"
|
|
215
|
+
}, kt = { class: "p-3 border-t border-gray-200" }, wt = { class: "flex-1 overflow-hidden" }, Tt = { class: "ml-auto flex gap-2" }, Ft = { class: "p-4" }, Dt = { class: "flex items-center gap-1.5 mt-3 text-xs text-amber-600 bg-amber-50 border border-amber-200 rounded px-3 py-2" }, Ct = { class: "p-4" }, St = { class: "flex items-center gap-1.5 mt-3 text-xs text-amber-600 bg-amber-50 border border-amber-200 rounded px-3 py-2" }, Bt = /* @__PURE__ */ Y({
|
|
216
|
+
__name: "PrintTemplateEditorDialog",
|
|
217
|
+
props: {
|
|
218
|
+
modelValue: { type: Boolean }
|
|
219
|
+
},
|
|
220
|
+
emits: ["update:modelValue", "saved"],
|
|
221
|
+
setup(E, { emit: x }) {
|
|
222
|
+
const g = E, f = x, h = Te(), d = Be(), $ = ze(), i = K({
|
|
223
|
+
get: () => g.modelValue,
|
|
224
|
+
set: (l) => f("update:modelValue", l)
|
|
225
|
+
}), m = b(!1), n = b(!1), c = b(R()), v = b(null), _ = b(j.Enum.purchaseOrder), D = b("Purchase Order Template"), a = b(null), w = b(!1), y = b(!1), C = b("select-type"), W = [
|
|
226
|
+
{
|
|
227
|
+
label: "Purchase Order",
|
|
228
|
+
value: j.Enum.purchaseOrder,
|
|
229
|
+
icon: "receipt_long",
|
|
230
|
+
description: "Customize the layout for purchase order printouts"
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
label: "Transfer Order",
|
|
234
|
+
value: j.Enum.transferOrder,
|
|
235
|
+
icon: "swap_horiz",
|
|
236
|
+
description: "Customize the layout for transfer order printouts"
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
label: "Goods Received Note",
|
|
240
|
+
value: j.Enum.goodsReceivedNote,
|
|
241
|
+
icon: "fact_check",
|
|
242
|
+
description: "Customize the layout for GRN printouts"
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
label: "Delivery Order",
|
|
246
|
+
value: j.Enum.deliveryOrder,
|
|
247
|
+
icon: "local_shipping",
|
|
248
|
+
description: "Customize the layout for delivery order printouts"
|
|
249
|
+
}
|
|
250
|
+
], H = b(/* @__PURE__ */ new Set()), J = K(
|
|
251
|
+
() => c.value.find((l) => l.id === v.value) ?? null
|
|
252
|
+
), z = b(null), N = b(null);
|
|
253
|
+
M(i, async (l) => {
|
|
254
|
+
if (l) {
|
|
255
|
+
C.value = "select-type", m.value = !0;
|
|
256
|
+
try {
|
|
257
|
+
const e = await h.browse();
|
|
258
|
+
H.value = new Set(e.map((u) => u.type));
|
|
259
|
+
} catch {
|
|
260
|
+
} finally {
|
|
261
|
+
m.value = !1;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}), M(_, async () => {
|
|
265
|
+
v.value = null, await X();
|
|
266
|
+
});
|
|
267
|
+
async function le(l) {
|
|
268
|
+
_.value = l, await X(), C.value = "editor";
|
|
269
|
+
}
|
|
270
|
+
function Q() {
|
|
271
|
+
return {
|
|
272
|
+
purchaseOrder: "Purchase Order Template",
|
|
273
|
+
transferOrder: "Transfer Order Template",
|
|
274
|
+
goodsReceivedNote: "Goods Received Note Template",
|
|
275
|
+
deliveryOrder: "Delivery Order Template"
|
|
276
|
+
}[_.value] ?? "Purchase Order Template";
|
|
277
|
+
}
|
|
278
|
+
async function X() {
|
|
279
|
+
m.value = !0;
|
|
280
|
+
try {
|
|
281
|
+
const l = await h.browse();
|
|
282
|
+
H.value = new Set(l.map((u) => u.type));
|
|
283
|
+
const e = l.find((u) => u.type === _.value);
|
|
284
|
+
e ? (a.value = e._id, D.value = e.name, c.value = e.blocks.map((u) => ({ ...u }))) : (a.value = null, c.value = R(), D.value = Q());
|
|
285
|
+
} catch {
|
|
286
|
+
c.value = R(), D.value = Q();
|
|
287
|
+
} finally {
|
|
288
|
+
m.value = !1;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
function oe(l) {
|
|
292
|
+
const e = {
|
|
293
|
+
id: Fe(),
|
|
294
|
+
tag: l,
|
|
295
|
+
config: De(l)
|
|
296
|
+
};
|
|
297
|
+
c.value.push(e), v.value = e.id;
|
|
298
|
+
}
|
|
299
|
+
function ae(l) {
|
|
300
|
+
const e = c.value.findIndex((u) => u.id === l);
|
|
301
|
+
e >= 0 && (c.value.splice(e, 1), v.value === l && (v.value = null));
|
|
302
|
+
}
|
|
303
|
+
function se(l) {
|
|
304
|
+
const e = c.value.find((u) => u.id === v.value);
|
|
305
|
+
if (e) {
|
|
306
|
+
const u = l.configFields || [], L = te(e.tag);
|
|
307
|
+
e.config = { configFields: u, templateHtml: L };
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
function ne(l) {
|
|
311
|
+
z.value = l;
|
|
312
|
+
}
|
|
313
|
+
function re(l, e) {
|
|
314
|
+
l.preventDefault(), N.value = e;
|
|
315
|
+
}
|
|
316
|
+
function ie() {
|
|
317
|
+
N.value = null;
|
|
318
|
+
}
|
|
319
|
+
function ue(l) {
|
|
320
|
+
if (z.value === null || z.value === l) {
|
|
321
|
+
z.value = null, N.value = null;
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
const e = c.value.splice(z.value, 1)[0];
|
|
325
|
+
c.value.splice(l, 0, e), z.value = null, N.value = null;
|
|
326
|
+
}
|
|
327
|
+
function de() {
|
|
328
|
+
z.value = null, N.value = null;
|
|
329
|
+
}
|
|
330
|
+
async function ce() {
|
|
331
|
+
var l;
|
|
332
|
+
n.value = !0;
|
|
333
|
+
try {
|
|
334
|
+
const e = (l = $.currentBusiness.value) == null ? void 0 : l._id;
|
|
335
|
+
if (!e)
|
|
336
|
+
throw new Error("Business ID is missing. Please select a business first.");
|
|
337
|
+
const u = c.value.map((o) => {
|
|
338
|
+
var Z;
|
|
339
|
+
const k = ((Z = o.config) == null ? void 0 : Z.configFields) || [], I = te(o.tag, k);
|
|
340
|
+
return {
|
|
341
|
+
...o,
|
|
342
|
+
config: { configFields: k, templateHtml: I }
|
|
343
|
+
};
|
|
344
|
+
}), L = Ce(u), S = {
|
|
345
|
+
name: D.value,
|
|
346
|
+
type: _.value,
|
|
347
|
+
blocks: L,
|
|
348
|
+
businessId: e,
|
|
349
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
350
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
351
|
+
};
|
|
352
|
+
let B;
|
|
353
|
+
a.value ? B = await h.update(a.value, {
|
|
354
|
+
_id: a.value,
|
|
355
|
+
...S
|
|
356
|
+
}) : (B = await h.create(S), a.value = B._id), H.value.add(_.value), y.value = !1, d == null || d.open({
|
|
357
|
+
title: "Success",
|
|
358
|
+
message: "Print template saved",
|
|
359
|
+
type: "success"
|
|
360
|
+
}), f("saved", B), i.value = !1;
|
|
361
|
+
} catch (e) {
|
|
362
|
+
d == null || d.open({
|
|
363
|
+
title: "Error",
|
|
364
|
+
message: (e == null ? void 0 : e.message) || "Failed to save template",
|
|
365
|
+
type: "error"
|
|
366
|
+
});
|
|
367
|
+
} finally {
|
|
368
|
+
n.value = !1;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
async function pe() {
|
|
372
|
+
if (a.value) {
|
|
373
|
+
n.value = !0;
|
|
374
|
+
try {
|
|
375
|
+
await h.delete(a.value), a.value = null, c.value = R(), D.value = Q(), H.value.delete(_.value), w.value = !1, d == null || d.open({
|
|
376
|
+
title: "Deleted",
|
|
377
|
+
message: "Print template deleted. Default layout will be used.",
|
|
378
|
+
type: "success"
|
|
379
|
+
}), f("saved", null), i.value = !1;
|
|
380
|
+
} catch (l) {
|
|
381
|
+
d == null || d.open({
|
|
382
|
+
title: "Error",
|
|
383
|
+
message: (l == null ? void 0 : l.message) || "Failed to delete template",
|
|
384
|
+
type: "error"
|
|
385
|
+
});
|
|
386
|
+
} finally {
|
|
387
|
+
n.value = !1;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
function me() {
|
|
392
|
+
c.value = R(), v.value = null;
|
|
393
|
+
}
|
|
394
|
+
function ve(l) {
|
|
395
|
+
var e;
|
|
396
|
+
return ((e = A[l]) == null ? void 0 : e.label) ?? l;
|
|
397
|
+
}
|
|
398
|
+
function ge(l) {
|
|
399
|
+
var e;
|
|
400
|
+
return ((e = A[l]) == null ? void 0 : e.icon) ?? "widgets";
|
|
401
|
+
}
|
|
402
|
+
return (l, e) => {
|
|
403
|
+
const u = V("FmIcon"), L = V("FmTextField"), S = V("FmButton"), B = V("FmDialog");
|
|
404
|
+
return s(), r(U, null, [
|
|
405
|
+
p(B, {
|
|
406
|
+
modelValue: i.value,
|
|
407
|
+
"onUpdate:modelValue": e[4] || (e[4] = (o) => i.value = o),
|
|
408
|
+
overlay: !0,
|
|
409
|
+
"close-button": "",
|
|
410
|
+
"max-width": "98vw"
|
|
411
|
+
}, ye({
|
|
412
|
+
"dialog-header": T(() => {
|
|
413
|
+
var o;
|
|
414
|
+
return [
|
|
415
|
+
t("div", Qe, [
|
|
416
|
+
C.value === "editor" ? (s(), r("button", {
|
|
417
|
+
key: 0,
|
|
418
|
+
class: "flex items-center justify-center w-7 h-7 rounded hover:bg-gray-100 transition-colors text-gray-500",
|
|
419
|
+
onClick: e[0] || (e[0] = (k) => C.value = "select-type")
|
|
420
|
+
}, [
|
|
421
|
+
p(u, {
|
|
422
|
+
name: "arrow_back",
|
|
423
|
+
size: "sm"
|
|
424
|
+
})
|
|
425
|
+
])) : q("", !0),
|
|
426
|
+
C.value === "select-type" ? (s(), r("span", We, "Print Template Editor")) : (s(), r("span", Xe, F((o = W.find((k) => k.value === _.value)) == null ? void 0 : o.label) + " Template", 1))
|
|
427
|
+
])
|
|
428
|
+
];
|
|
429
|
+
}),
|
|
430
|
+
default: T(() => [
|
|
431
|
+
C.value === "select-type" ? (s(), r("div", Ze, [
|
|
432
|
+
e[7] || (e[7] = t("p", { class: "text-sm text-gray-500 mb-5" }, " Select a template type to customize its print layout. ", -1)),
|
|
433
|
+
m.value ? (s(), r("div", et, " Loading... ")) : (s(), r("div", tt, [
|
|
434
|
+
(s(), r(U, null, G(W, (o) => t("div", {
|
|
435
|
+
key: o.value,
|
|
436
|
+
class: ee(["group relative flex flex-col items-center gap-3 p-6 rounded-xl border-2 border-gray-200 cursor-pointer transition-all hover:border-blue-400 hover:shadow-md", {
|
|
437
|
+
"border-blue-500 bg-blue-50/50 shadow-md": _.value === o.value && C.value === "select-type"
|
|
438
|
+
}]),
|
|
439
|
+
onClick: (k) => le(o.value)
|
|
440
|
+
}, [
|
|
441
|
+
t("div", ot, [
|
|
442
|
+
p(u, {
|
|
443
|
+
name: o.icon,
|
|
444
|
+
size: "sm"
|
|
445
|
+
}, null, 8, ["name"])
|
|
446
|
+
]),
|
|
447
|
+
t("div", at, [
|
|
448
|
+
t("div", st, F(o.label), 1),
|
|
449
|
+
t("div", nt, F(o.description), 1)
|
|
450
|
+
]),
|
|
451
|
+
H.value.has(o.value) ? (s(), r("span", rt, "Customized")) : (s(), r("span", it, "Default"))
|
|
452
|
+
], 10, lt)), 64))
|
|
453
|
+
]))
|
|
454
|
+
])) : m.value ? (s(), r("div", ut, e[8] || (e[8] = [
|
|
455
|
+
t("div", null, "Loading template...", -1)
|
|
456
|
+
]))) : (s(), r("div", dt, [
|
|
457
|
+
t("div", ct, [
|
|
458
|
+
t("div", pt, [
|
|
459
|
+
p(L, {
|
|
460
|
+
modelValue: D.value,
|
|
461
|
+
"onUpdate:modelValue": e[1] || (e[1] = (o) => D.value = o),
|
|
462
|
+
placeholder: "Template name",
|
|
463
|
+
label: "Template Name"
|
|
464
|
+
}, null, 8, ["modelValue"])
|
|
465
|
+
]),
|
|
466
|
+
e[9] || (e[9] = t("div", { class: "text-xs font-semibold text-gray-400 uppercase tracking-wider px-3 py-2" }, " Add Blocks ", -1)),
|
|
467
|
+
t("div", mt, [
|
|
468
|
+
(s(!0), r(U, null, G(O($e).Values, (o) => (s(), r("div", {
|
|
469
|
+
key: o,
|
|
470
|
+
class: "group flex items-center gap-2 px-3 py-2 cursor-pointer text-[13px] text-gray-600 transition-colors hover:bg-gray-100",
|
|
471
|
+
onClick: (k) => oe(o)
|
|
472
|
+
}, [
|
|
473
|
+
p(u, {
|
|
474
|
+
name: O(A)[o].icon,
|
|
475
|
+
size: "sm"
|
|
476
|
+
}, null, 8, ["name"]),
|
|
477
|
+
t("span", null, F(O(A)[o].label), 1),
|
|
478
|
+
p(u, {
|
|
479
|
+
name: "add",
|
|
480
|
+
size: "sm",
|
|
481
|
+
class: "ml-auto opacity-0 text-blue-600 group-hover:opacity-100"
|
|
482
|
+
})
|
|
483
|
+
], 8, vt))), 128))
|
|
484
|
+
]),
|
|
485
|
+
e[10] || (e[10] = t("div", { class: "text-xs font-semibold text-gray-400 uppercase tracking-wider px-3 py-2 mt-2" }, " Block Order ", -1)),
|
|
486
|
+
t("div", gt, [
|
|
487
|
+
(s(!0), r(U, null, G(c.value, (o, k) => (s(), r("div", {
|
|
488
|
+
key: o.id,
|
|
489
|
+
class: ee(["flex items-center gap-2 px-3 py-2 cursor-pointer text-[13px] text-gray-600 border-b border-gray-100 transition-colors hover:bg-gray-100", {
|
|
490
|
+
"bg-blue-50 border-l-[3px] border-l-blue-600": o.id === v.value,
|
|
491
|
+
"border-t-2 border-t-blue-600": N.value === k
|
|
492
|
+
}]),
|
|
493
|
+
draggable: "true",
|
|
494
|
+
onDragstart: (I) => ne(k),
|
|
495
|
+
onDragover: (I) => re(I, k),
|
|
496
|
+
onDragleave: ie,
|
|
497
|
+
onDrop: (I) => ue(k),
|
|
498
|
+
onDragend: de,
|
|
499
|
+
onClick: (I) => v.value = o.id
|
|
500
|
+
}, [
|
|
501
|
+
p(u, {
|
|
502
|
+
name: "drag_indicator",
|
|
503
|
+
size: "sm",
|
|
504
|
+
class: "cursor-grab text-gray-300"
|
|
505
|
+
}),
|
|
506
|
+
p(u, {
|
|
507
|
+
name: ge(o.tag),
|
|
508
|
+
size: "sm"
|
|
509
|
+
}, null, 8, ["name"]),
|
|
510
|
+
t("span", yt, F(ve(o.tag)), 1),
|
|
511
|
+
t("div", bt, [
|
|
512
|
+
p(u, {
|
|
513
|
+
name: "delete",
|
|
514
|
+
size: "sm",
|
|
515
|
+
class: "cursor-pointer text-gray-400 hover:text-red-500",
|
|
516
|
+
onClick: be((I) => ae(o.id), ["stop"])
|
|
517
|
+
}, null, 8, ["onClick"])
|
|
518
|
+
])
|
|
519
|
+
], 42, ft))), 128)),
|
|
520
|
+
c.value.length === 0 ? (s(), r("div", xt, " Click a block above to add it ")) : q("", !0)
|
|
521
|
+
]),
|
|
522
|
+
J.value ? (s(), r("div", _t, [
|
|
523
|
+
(s(), P(qe, {
|
|
524
|
+
key: J.value.id,
|
|
525
|
+
block: J.value,
|
|
526
|
+
onUpdate: se
|
|
527
|
+
}, null, 8, ["block"]))
|
|
528
|
+
])) : (s(), r("div", ht, " Select a block to configure it ")),
|
|
529
|
+
t("div", kt, [
|
|
530
|
+
p(S, {
|
|
531
|
+
label: "Reset to Default",
|
|
532
|
+
variant: "plain",
|
|
533
|
+
size: "md",
|
|
534
|
+
onClick: me
|
|
535
|
+
})
|
|
536
|
+
])
|
|
537
|
+
]),
|
|
538
|
+
t("div", wt, [
|
|
539
|
+
p(Je, {
|
|
540
|
+
blocks: c.value,
|
|
541
|
+
"selected-block-id": v.value,
|
|
542
|
+
"template-type": _.value
|
|
543
|
+
}, null, 8, ["blocks", "selected-block-id", "template-type"])
|
|
544
|
+
])
|
|
545
|
+
]))
|
|
546
|
+
]),
|
|
547
|
+
_: 2
|
|
548
|
+
}, [
|
|
549
|
+
C.value === "editor" ? {
|
|
550
|
+
name: "dialog-footer",
|
|
551
|
+
fn: T(() => [
|
|
552
|
+
t("div", Tt, [
|
|
553
|
+
a.value ? (s(), P(S, {
|
|
554
|
+
key: 0,
|
|
555
|
+
label: "Delete Template",
|
|
556
|
+
variant: "destructive",
|
|
557
|
+
size: "md",
|
|
558
|
+
onClick: e[2] || (e[2] = (o) => w.value = !0)
|
|
559
|
+
})) : q("", !0),
|
|
560
|
+
p(S, {
|
|
561
|
+
label: "Save Template",
|
|
562
|
+
variant: "primary",
|
|
563
|
+
size: "md",
|
|
564
|
+
onClick: e[3] || (e[3] = (o) => y.value = !0)
|
|
565
|
+
})
|
|
566
|
+
])
|
|
567
|
+
]),
|
|
568
|
+
key: "0"
|
|
569
|
+
} : void 0
|
|
570
|
+
]), 1032, ["modelValue"]),
|
|
571
|
+
p(B, {
|
|
572
|
+
modelValue: y.value,
|
|
573
|
+
"onUpdate:modelValue": e[5] || (e[5] = (o) => y.value = o),
|
|
574
|
+
overlay: !0,
|
|
575
|
+
dismissAway: !0,
|
|
576
|
+
"close-button": "",
|
|
577
|
+
"max-width": "400px"
|
|
578
|
+
}, {
|
|
579
|
+
"dialog-header": T(() => e[11] || (e[11] = [
|
|
580
|
+
t("span", null, "Save Print Template?", -1)
|
|
581
|
+
])),
|
|
582
|
+
"dialog-footer": T(() => [
|
|
583
|
+
p(S, {
|
|
584
|
+
class: "ml-auto",
|
|
585
|
+
label: "Save",
|
|
586
|
+
variant: "primary",
|
|
587
|
+
size: "md",
|
|
588
|
+
loading: n.value,
|
|
589
|
+
onClick: ce
|
|
590
|
+
}, null, 8, ["loading"])
|
|
591
|
+
]),
|
|
592
|
+
default: T(() => [
|
|
593
|
+
t("div", Ft, [
|
|
594
|
+
e[13] || (e[13] = t("p", null, "Are you sure you want to save this print template?", -1)),
|
|
595
|
+
e[14] || (e[14] = t("p", { class: "text-gray-500 text-sm mt-2" }, " This template will be used for all future prints of this type. ", -1)),
|
|
596
|
+
t("div", Dt, [
|
|
597
|
+
p(u, {
|
|
598
|
+
name: "warning",
|
|
599
|
+
size: "sm"
|
|
600
|
+
}),
|
|
601
|
+
e[12] || (e[12] = t("span", null, "This will affect all locations under this business.", -1))
|
|
602
|
+
])
|
|
603
|
+
])
|
|
604
|
+
]),
|
|
605
|
+
_: 1
|
|
606
|
+
}, 8, ["modelValue"]),
|
|
607
|
+
p(B, {
|
|
608
|
+
modelValue: w.value,
|
|
609
|
+
"onUpdate:modelValue": e[6] || (e[6] = (o) => w.value = o),
|
|
610
|
+
overlay: !0,
|
|
611
|
+
dismissAway: !0,
|
|
612
|
+
"close-button": "",
|
|
613
|
+
"max-width": "400px"
|
|
614
|
+
}, {
|
|
615
|
+
"dialog-header": T(() => e[15] || (e[15] = [
|
|
616
|
+
t("span", null, "Delete Print Template?", -1)
|
|
617
|
+
])),
|
|
618
|
+
"dialog-footer": T(() => [
|
|
619
|
+
p(S, {
|
|
620
|
+
class: "ml-auto",
|
|
621
|
+
label: "Delete",
|
|
622
|
+
variant: "destructive",
|
|
623
|
+
size: "md",
|
|
624
|
+
loading: n.value,
|
|
625
|
+
onClick: pe
|
|
626
|
+
}, null, 8, ["loading"])
|
|
627
|
+
]),
|
|
628
|
+
default: T(() => [
|
|
629
|
+
t("div", Ct, [
|
|
630
|
+
e[17] || (e[17] = t("p", null, "Are you sure you want to delete this print template?", -1)),
|
|
631
|
+
e[18] || (e[18] = t("p", { class: "text-gray-500 text-sm mt-2" }, " The default print layout will be used for all future prints. ", -1)),
|
|
632
|
+
t("div", St, [
|
|
633
|
+
p(u, {
|
|
634
|
+
name: "warning",
|
|
635
|
+
size: "sm"
|
|
636
|
+
}),
|
|
637
|
+
e[16] || (e[16] = t("span", null, "This will affect all locations under this business.", -1))
|
|
638
|
+
])
|
|
639
|
+
])
|
|
640
|
+
]),
|
|
641
|
+
_: 1
|
|
642
|
+
}, 8, ["modelValue"])
|
|
643
|
+
], 64);
|
|
644
|
+
};
|
|
645
|
+
}
|
|
646
|
+
}), Vt = { class: "p-16 flex flex-col gap-16" }, $t = { class: "bg-white rounded-8 p-16 shadow-sm" }, zt = { class: "fm-typo-en-heading-sm-600 text-fm-color-typo-primary mb-12" }, It = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-16" }, Mt = /* @__PURE__ */ Y({
|
|
647
|
+
__name: "SettingsView",
|
|
648
|
+
setup(E) {
|
|
649
|
+
const { t: x } = Ie(), g = Se();
|
|
650
|
+
g.fetchTemplates();
|
|
651
|
+
const f = b(!1);
|
|
652
|
+
function h() {
|
|
653
|
+
g.invalidate(), g.fetchTemplates();
|
|
654
|
+
}
|
|
655
|
+
function d() {
|
|
656
|
+
f.value = !0;
|
|
657
|
+
}
|
|
658
|
+
return ($, i) => {
|
|
659
|
+
const m = V("FmButton");
|
|
660
|
+
return s(), P(_e, {
|
|
661
|
+
title: O(x)("inventory.settings.title")
|
|
662
|
+
}, {
|
|
663
|
+
default: T(() => [
|
|
664
|
+
t("div", Vt, [
|
|
665
|
+
p(Oe, null, {
|
|
666
|
+
default: T(() => [
|
|
667
|
+
t("div", $t, [
|
|
668
|
+
t("h2", zt, F(O(x)("inventory.settings.printTemplate.title")), 1),
|
|
669
|
+
t("p", It, F(O(x)("inventory.settings.printTemplate.description")), 1),
|
|
670
|
+
p(m, {
|
|
671
|
+
onClick: d,
|
|
672
|
+
variant: "secondary",
|
|
673
|
+
label: O(x)("inventory.settings.printTemplate.edit")
|
|
674
|
+
}, null, 8, ["label"])
|
|
675
|
+
])
|
|
676
|
+
]),
|
|
677
|
+
_: 1
|
|
678
|
+
})
|
|
679
|
+
]),
|
|
680
|
+
(s(), P(xe, { to: "body" }, [
|
|
681
|
+
p(Bt, {
|
|
682
|
+
modelValue: f.value,
|
|
683
|
+
"onUpdate:modelValue": i[0] || (i[0] = (n) => f.value = n),
|
|
684
|
+
onSaved: h
|
|
685
|
+
}, null, 8, ["modelValue"])
|
|
686
|
+
]))
|
|
687
|
+
]),
|
|
688
|
+
_: 1
|
|
689
|
+
}, 8, ["title"]);
|
|
690
|
+
};
|
|
691
|
+
}
|
|
692
|
+
});
|
|
693
|
+
export {
|
|
694
|
+
Mt as default
|
|
695
|
+
};
|