@feedmepos/mf-inventory-portal 1.7.3-dev.1 → 1.7.3-dev.2
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-DK0-LWWu.js → App-B5qnwEvd.js} +4 -4
- package/dist/{ApprovalView-BxV4_keX.js → ApprovalView-C_bCdqCE.js} +8 -8
- package/dist/{BindingsDialog-DYVL00NY.js → BindingsDialog-NoD35amZ.js} +2 -2
- package/dist/{BindingsPicker-Bi1EcW62.js → BindingsPicker-CPjrsA7g.js} +2 -2
- package/dist/{BindingsTable-CvtOCAkc.js → BindingsTable-lSM6Qvc1.js} +3 -3
- package/dist/{BulkReceiveRequestView-Dgp3EWOn.js → BulkReceiveRequestView-H97Vm5RQ.js} +19 -19
- package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-DX3Ug_dN.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-Ysx4_aKb.js} +1 -1
- package/dist/{ClosingDraftView-D2uvIKY5.js → ClosingDraftView-D1qzcxyc.js} +19 -19
- package/dist/{ClosingHistoryView-CIb7Ch4L.js → ClosingHistoryView-COVLEUJE.js} +5 -5
- package/dist/{ClosingTemplateView-XVSVYB2y.js → ClosingTemplateView-CCjWKW4A.js} +16 -16
- package/dist/{DefaultView-BJets42n.js → DefaultView-8JanBwi1.js} +2 -2
- package/dist/{DeliveryOrderPrintPreview-DaQHEkqA.js → DeliveryOrderPrintPreview-jmYbNNQS.js} +2 -2
- package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-CBL0xqFW.js → EmailDialog.vue_vue_type_script_setup_true_lang-HSlddJKT.js} +23 -23
- package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-DbQxJtrd.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-D7i1SzCt.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BgCS24jN.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-GZFKLCed.js} +2 -2
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-Dc6xTcD8.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-C-A4ytBi.js} +2 -2
- package/dist/{FmMultiselectDialog-CxsksooH.js → FmMultiselectDialog-DIm-TBkv.js} +1 -1
- package/dist/{FmMultiselectDialog-Bq_Na17d.js → FmMultiselectDialog-DNqQOM8Z.js} +2 -2
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-DkftHtJN.js → FmUnitInput.vue_vue_type_script_setup_true_lang-CGpxstv1.js} +5 -5
- package/dist/{ImportView-BzNfHFEx.js → ImportView-Czlfd6fQ.js} +6 -6
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-Hat27Ar4.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-CVq7-2qs.js} +1 -1
- package/dist/{IngredientGroupView-ClG1OM4D.js → IngredientGroupView-D5iO0K_A.js} +5 -5
- package/dist/{IngredientsView-BYE1xoOE.js → IngredientsView-BLpExZxR.js} +15 -15
- package/dist/{IntegrationExplorerView-DwvsbHfd.js → IntegrationExplorerView-Dc9GHMqa.js} +4 -4
- package/dist/{IntegrationView-ikLaCdnl.js → IntegrationView-FnMv7ETs.js} +14 -14
- package/dist/{InventoryBindingForm-C6P0ZuXJ.js → InventoryBindingForm-Cyzr1Bst.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-DzLxq3uM.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-C3AYygQH.js} +5 -5
- package/dist/{InventoryBindingSummary-CMSSSTdo.js → InventoryBindingSummary-B5XtTUoM.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-COXmn2a8.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-D0pmO2lT.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BvrpIpql.js → PremiumBadge.vue_vue_type_script_setup_true_lang-BfqfE-MH.js} +1 -1
- package/dist/{ProductionView-DI3JxiFg.js → ProductionView-vt5M7OFl.js} +7 -7
- package/dist/{PublishView-BoyEuUAu.js → PublishView-B93jBpMw.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-D60kdiQU.js → PurchaseOrderPrintPreview-CHRnWgEH.js} +2 -2
- package/dist/{ReceiveRequestView-DhpS9JLx.js → ReceiveRequestView-DsykNduj.js} +13 -13
- package/dist/{RecipeView-Cz-Q0aio.js → RecipeView-C1KRJwD_.js} +17 -17
- package/dist/{SettingsView-BNDr4ez-.js → SettingsView-5uoZvtor.js} +226 -224
- package/dist/{StockView-bpRLYtw0.js → StockView-CFjw8sTV.js} +21 -21
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-B0wulwNM.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-EkuTLEsr.js} +1 -1
- package/dist/{SupplierView-CDHpZdob.js → SupplierView-Cz0RMHV1.js} +12 -12
- package/dist/{SurchargeView-BQ1O-fAr.js → SurchargeView-BXD2yfHT.js} +6 -6
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-DicFDlas.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-CVyTmnnl.js} +2 -2
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-D0NGjAyr.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-uaHJlzzd.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-SHMiHC5F.js → TransferDetails.vue_vue_type_script_setup_true_lang-DShpMILM.js} +1167 -1164
- package/dist/{TransferTemplateView-BRYAJdlG.js → TransferTemplateView-DzNLq8-A.js} +20 -20
- package/dist/{UnitCostHistoryView-DLLPBU9n.js → UnitCostHistoryView-AHCSzXg6.js} +4 -4
- package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-DTJBsfEj.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-CuLDwpz_.js} +4 -4
- package/dist/{UnitView-DwZMbt4A.js → UnitView-CQuXzism.js} +7 -7
- package/dist/{WarehouseView-DyKR9b4c.js → WarehouseView-CwtDpf_J.js} +5 -5
- package/dist/{WastageTemplateView-CZhQ7MKe.js → WastageTemplateView-CE28O1gZ.js} +14 -14
- package/dist/{app-CPHh8dJ8.js → app-BuoXiggC.js} +15 -15
- package/dist/app.js +1 -1
- package/dist/{closing-template-DV8hM9mR.js → closing-template-C1qVUaYB.js} +1 -1
- package/dist/{date2-CMYcYkVI.js → date2-BQpsoOPQ.js} +1 -1
- package/dist/{dayjs.min-Crreg1xX.js → dayjs.min-C-6FhQxs.js} +1 -1
- package/dist/{decimal-DhFDmEjW.js → decimal-bQrHKApj.js} +2 -2
- package/dist/{defineDeepModel-DSzyuBIx.js → defineDeepModel-nEhqHuqN.js} +1 -1
- package/dist/{duplicate-template-qbIou3kX.js → duplicate-template-E9mFjnug.js} +1 -1
- package/dist/{feature-Do5dZj8x.js → feature-B0AS1EQ6.js} +2 -2
- package/dist/{format-time-from-id-BbguyEMG.js → format-time-from-id-DIMT-bqD.js} +1 -1
- package/dist/{format-unit-display-C-RAKWPU.js → format-unit-display-B-mLM6e4.js} +12 -12
- package/dist/{import-export.helper-Duq-vfeY.js → import-export.helper-CbwYpiCV.js} +6 -6
- package/dist/{index-Ctrxj7cE.js → index-B35IG4Yk.js} +3 -3
- package/dist/{index-D73SJ6zk.js → index-_tt7s1OE.js} +1 -1
- package/dist/{index-75GfRz2O.js → index-dlW6ARAr.js} +1 -1
- package/dist/{inventory-core-dart.default-toC4Oswn.js → inventory-core-dart.default-LjwypePL.js} +1 -1
- package/dist/{jszip.min-DCDx15Lo.js → jszip.min-D5T4A7Ll.js} +251 -251
- package/dist/{lz-string-DIrw_osP.js → lz-string-BS_s7ZIl.js} +1 -1
- package/dist/modules/print-template/types/print-data.d.ts +1 -0
- package/dist/{netsuite-BCPPfv5q.js → netsuite-CJCV-Xun.js} +2 -2
- package/dist/{number-Dj-zUn93.js → number-Dzy12OlH.js} +3 -3
- package/dist/{predefined-templates-CkZwybVN.js → predefined-templates-DHykkVzD.js} +572 -562
- package/dist/{purchase-order-template-B96No_lH.js → purchase-order-template-BaSnDkW4.js} +1 -1
- package/dist/{recalculationUtils-lkExVizR.js → recalculationUtils-DzajZbBh.js} +1 -1
- package/dist/{rules-DjI-FPha.js → rules-CMwZOiOr.js} +2 -2
- package/dist/{stock-BLL3aLEQ.js → stock-CeOgNPCZ.js} +3 -3
- package/dist/{stock-KNrrUQF1.js → stock-CuO-Hg1Q.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{supplier-CosSdx6_.js → supplier-CNPExTUb.js} +2 -2
- package/dist/{surcharge-DFnSG3ka.js → surcharge-JxVEnWL9.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{uom-rules-MbRvuo5s.js → uom-rules-71IIkmUk.js} +1 -1
- package/dist/{use-ingredient-select-dialog-HqatzFkQ.js → use-ingredient-select-dialog-DNcSzjv1.js} +2 -2
- package/dist/{use-inventory-binding-dialog-CHIrX4O3.js → use-inventory-binding-dialog-BFeTdXTG.js} +2 -2
- package/dist/{use-template-enabled-locations-CZDQcsEJ.js → use-template-enabled-locations-BmRiYSuz.js} +2 -2
- package/dist/{use-transfer-locations-BRCrX_-r.js → use-transfer-locations-BlQTXhOJ.js} +2 -2
- package/dist/{useHrmPermission-B9vfKTf-.js → useHrmPermission-CgIdm6P7.js} +1 -1
- package/dist/{useNavigationMenu-DPD_pWDz.js → useNavigationMenu-hX7eAxQm.js} +2 -2
- package/dist/{useSseClient-CuljyleL.js → useSseClient-D-5Wi7LQ.js} +1 -1
- package/dist/{vue-i18n-CyoeLXfI.js → vue-i18n-D_0CiHw_.js} +1 -1
- package/dist/{xlsx.util-C6g7kacG.js → xlsx.util-DDV-UHBt.js} +2 -2
- package/package.json +3 -3
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as Y, ref as
|
|
1
|
+
import { defineComponent as Y, ref as x, computed as q, watch as M, resolveComponent as V, createElementBlock as r, openBlock as s, createElementVNode as t, toDisplayString as C, Fragment as A, renderList as G, createBlock as E, createCommentVNode as K, createVNode as m, nextTick as fe, createSlots as ye, withCtx as F, normalizeClass as ee, unref as O, withModifiers as be, Teleport as xe } from "vue";
|
|
2
2
|
import { _ as _e } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DwrLsWX_.js";
|
|
3
|
-
import { B as
|
|
3
|
+
import { B as P, g as he, r as ke, s as we, u as Te, a as R, b as Fe, c as Ce, d as te, e as De, f as Se } from "./predefined-templates-DHykkVzD.js";
|
|
4
4
|
import { useSnackbar as Be } from "@feedmepos/ui-library";
|
|
5
5
|
import { _ as Ve } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
|
-
import { H as j, I as $e } from "./app-
|
|
6
|
+
import { H as j, I as $e } from "./app-BuoXiggC.js";
|
|
7
7
|
import { useCoreStore as ze, useI18n as Ie } from "@feedmepos/mf-common";
|
|
8
|
-
import "./dayjs.min-
|
|
9
|
-
import "./inventory-core-dart.default-
|
|
8
|
+
import "./dayjs.min-C-6FhQxs.js";
|
|
9
|
+
import "./inventory-core-dart.default-LjwypePL.js";
|
|
10
10
|
import { F as Oe } from "./FmAdminBadge-DlplQOHb.js";
|
|
11
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
12
|
key: 0,
|
|
@@ -20,94 +20,96 @@ const Pe = { class: "p-3" }, Ee = { class: "text-sm font-semibold text-gray-700
|
|
|
20
20
|
block: {}
|
|
21
21
|
},
|
|
22
22
|
emits: ["update"],
|
|
23
|
-
setup(
|
|
24
|
-
const
|
|
25
|
-
function
|
|
26
|
-
var
|
|
27
|
-
if ((
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
setup(N, { emit: _ }) {
|
|
24
|
+
const f = N, y = _;
|
|
25
|
+
function k(n) {
|
|
26
|
+
var g;
|
|
27
|
+
if ((g = n.config) != null && g.configFields && Array.isArray(n.config.configFields)) {
|
|
28
|
+
const b = n.config.configFields.map((p) => ({ ...p })), T = new Set(b.map((p) => p.key)), o = P[n.tag], h = o ? o.initialConfigFields().filter((p) => !T.has(p.key)) : [];
|
|
29
|
+
return [...b, ...h];
|
|
30
|
+
}
|
|
31
|
+
const c = P[n.tag];
|
|
30
32
|
return c ? c.initialConfigFields() : [];
|
|
31
33
|
}
|
|
32
|
-
const d =
|
|
33
|
-
const n =
|
|
34
|
-
return (n == null ? void 0 : n.label) ??
|
|
34
|
+
const d = x(k(f.block)), $ = q(() => {
|
|
35
|
+
const n = P[f.block.tag];
|
|
36
|
+
return (n == null ? void 0 : n.label) ?? f.block.tag;
|
|
35
37
|
});
|
|
36
38
|
M(
|
|
37
|
-
() =>
|
|
39
|
+
() => f.block,
|
|
38
40
|
(n) => {
|
|
39
|
-
d.value =
|
|
41
|
+
d.value = k(n);
|
|
40
42
|
},
|
|
41
43
|
{ deep: !0 }
|
|
42
44
|
);
|
|
43
45
|
function i(n, c) {
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
+
const g = d.value[n];
|
|
47
|
+
g && (g.value = c, v());
|
|
46
48
|
}
|
|
47
|
-
function
|
|
48
|
-
|
|
49
|
-
...
|
|
49
|
+
function v() {
|
|
50
|
+
y("update", {
|
|
51
|
+
...f.block.config || {},
|
|
50
52
|
configFields: d.value.map((n) => ({ ...n }))
|
|
51
53
|
});
|
|
52
54
|
}
|
|
53
55
|
return (n, c) => {
|
|
54
|
-
const
|
|
56
|
+
const g = V("FmSwitch"), b = V("FmTextField"), T = V("FmSelect");
|
|
55
57
|
return s(), r("div", Pe, [
|
|
56
|
-
t("div", Ee,
|
|
58
|
+
t("div", Ee, C($.value) + " Settings ", 1),
|
|
57
59
|
t("div", Ne, [
|
|
58
|
-
(s(!0), r(
|
|
59
|
-
key:
|
|
60
|
+
(s(!0), r(A, null, G(d.value, (o, h) => (s(), r("div", {
|
|
61
|
+
key: o.key
|
|
60
62
|
}, [
|
|
61
|
-
|
|
62
|
-
t("label", Ae,
|
|
63
|
-
|
|
64
|
-
"model-value":
|
|
65
|
-
"onUpdate:modelValue": (
|
|
63
|
+
o.type === "toggle" ? (s(), r("div", Ue, [
|
|
64
|
+
t("label", Ae, C(o.label), 1),
|
|
65
|
+
m(g, {
|
|
66
|
+
"model-value": o.value,
|
|
67
|
+
"onUpdate:modelValue": (p) => i(h, p)
|
|
66
68
|
}, null, 8, ["model-value", "onUpdate:modelValue"])
|
|
67
|
-
])) :
|
|
69
|
+
])) : o.type === "text" ? (s(), E(b, {
|
|
68
70
|
key: 1,
|
|
69
|
-
label:
|
|
70
|
-
"model-value":
|
|
71
|
-
placeholder:
|
|
72
|
-
"onUpdate:modelValue": (
|
|
73
|
-
}, null, 8, ["label", "model-value", "placeholder", "onUpdate:modelValue"])) :
|
|
74
|
-
t("div", He,
|
|
71
|
+
label: o.label,
|
|
72
|
+
"model-value": o.value,
|
|
73
|
+
placeholder: o.placeholder,
|
|
74
|
+
"onUpdate:modelValue": (p) => i(h, p)
|
|
75
|
+
}, null, 8, ["label", "model-value", "placeholder", "onUpdate:modelValue"])) : o.type === "textarea" ? (s(), r(A, { key: 2 }, [
|
|
76
|
+
t("div", He, C(o.label), 1),
|
|
75
77
|
t("textarea", {
|
|
76
78
|
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:
|
|
78
|
-
rows:
|
|
79
|
-
placeholder:
|
|
80
|
-
onInput: (
|
|
79
|
+
value: o.value,
|
|
80
|
+
rows: o.rows ?? 8,
|
|
81
|
+
placeholder: o.placeholder,
|
|
82
|
+
onInput: (p) => i(h, p.target.value)
|
|
81
83
|
}, null, 40, Le)
|
|
82
|
-
], 64)) :
|
|
84
|
+
], 64)) : o.type === "select" ? (s(), E(T, {
|
|
83
85
|
key: 3,
|
|
84
|
-
label:
|
|
85
|
-
"model-value":
|
|
86
|
-
items:
|
|
86
|
+
label: o.label,
|
|
87
|
+
"model-value": o.value,
|
|
88
|
+
items: o.options || [],
|
|
87
89
|
"item-label": "label",
|
|
88
90
|
"item-value": "value",
|
|
89
|
-
"onUpdate:modelValue": (
|
|
90
|
-
}, null, 8, ["label", "model-value", "items", "onUpdate:modelValue"])) :
|
|
91
|
+
"onUpdate:modelValue": (p) => i(h, p)
|
|
92
|
+
}, null, 8, ["label", "model-value", "items", "onUpdate:modelValue"])) : o.type === "number" ? (s(), E(b, {
|
|
91
93
|
key: 4,
|
|
92
|
-
label:
|
|
94
|
+
label: o.label,
|
|
93
95
|
type: "number",
|
|
94
|
-
"model-value": String(
|
|
95
|
-
"onUpdate:modelValue": (
|
|
96
|
-
}, null, 8, ["label", "model-value", "onUpdate:modelValue"])) :
|
|
97
|
-
t("label", je,
|
|
96
|
+
"model-value": String(o.value),
|
|
97
|
+
"onUpdate:modelValue": (p) => i(h, Number(p))
|
|
98
|
+
}, null, 8, ["label", "model-value", "onUpdate:modelValue"])) : o.type === "color" ? (s(), r("div", Re, [
|
|
99
|
+
t("label", je, C(o.label), 1),
|
|
98
100
|
t("input", {
|
|
99
101
|
type: "color",
|
|
100
|
-
value:
|
|
102
|
+
value: o.value,
|
|
101
103
|
class: "color-input w-9 h-7 p-0 border border-gray-300 rounded cursor-pointer bg-transparent",
|
|
102
|
-
onInput: (
|
|
104
|
+
onInput: (p) => i(h, p.target.value)
|
|
103
105
|
}, null, 40, Me)
|
|
104
|
-
])) :
|
|
106
|
+
])) : K("", !0)
|
|
105
107
|
]))), 128))
|
|
106
108
|
])
|
|
107
109
|
]);
|
|
108
110
|
};
|
|
109
111
|
}
|
|
110
|
-
}),
|
|
112
|
+
}), Ke = /* @__PURE__ */ Ve(Ge, [["__scopeId", "data-v-840687bf"]]), qe = { class: "h-full flex flex-col" }, Ye = { class: "flex-1 overflow-auto p-4 bg-gray-100" }, Je = /* @__PURE__ */ Y({
|
|
111
113
|
__name: "TemplatePreview",
|
|
112
114
|
props: {
|
|
113
115
|
blocks: {},
|
|
@@ -115,20 +117,20 @@ const Pe = { class: "p-3" }, Ee = { class: "text-sm font-semibold text-gray-700
|
|
|
115
117
|
selectedBlockId: {},
|
|
116
118
|
templateType: {}
|
|
117
119
|
},
|
|
118
|
-
setup(
|
|
119
|
-
const
|
|
120
|
-
let
|
|
121
|
-
function
|
|
122
|
-
return !
|
|
120
|
+
setup(N) {
|
|
121
|
+
const _ = N, f = x(null);
|
|
122
|
+
let y = null;
|
|
123
|
+
function k() {
|
|
124
|
+
return !y && f.value && (y = f.value.attachShadow({ mode: "open" })), y;
|
|
123
125
|
}
|
|
124
|
-
const d =
|
|
126
|
+
const d = q(() => _.previewData ?? he(_.templateType));
|
|
125
127
|
M(
|
|
126
|
-
() => [
|
|
128
|
+
() => [_.blocks, d.value, f.value],
|
|
127
129
|
() => {
|
|
128
|
-
const i =
|
|
130
|
+
const i = k();
|
|
129
131
|
if (i) {
|
|
130
132
|
try {
|
|
131
|
-
const
|
|
133
|
+
const v = ke(_.blocks, d.value), n = we(v);
|
|
132
134
|
i.innerHTML = `
|
|
133
135
|
<style>
|
|
134
136
|
:host { display: block; }
|
|
@@ -154,30 +156,30 @@ const Pe = { class: "p-3" }, Ee = { class: "text-sm font-semibold text-gray-700
|
|
|
154
156
|
<div class="preview-content">${n}</div>
|
|
155
157
|
</div>
|
|
156
158
|
`;
|
|
157
|
-
} catch (
|
|
158
|
-
i.innerHTML = `<div style="color:red;padding:20px;">Error rendering template: ${
|
|
159
|
+
} catch (v) {
|
|
160
|
+
i.innerHTML = `<div style="color:red;padding:20px;">Error rendering template: ${v}</div>`;
|
|
159
161
|
}
|
|
160
|
-
fe(() => $(
|
|
162
|
+
fe(() => $(_.selectedBlockId));
|
|
161
163
|
}
|
|
162
164
|
},
|
|
163
165
|
{ deep: !0, immediate: !0 }
|
|
164
166
|
), M(
|
|
165
|
-
() =>
|
|
167
|
+
() => _.selectedBlockId,
|
|
166
168
|
(i) => $(i)
|
|
167
169
|
);
|
|
168
170
|
function $(i) {
|
|
169
|
-
if (!
|
|
171
|
+
if (!y || (y.querySelectorAll("[data-block-id].highlight").forEach((n) => {
|
|
170
172
|
n.classList.remove("highlight");
|
|
171
173
|
}), !i)) return;
|
|
172
|
-
const
|
|
173
|
-
|
|
174
|
+
const v = y.querySelector(`[data-block-id="${i}"]`);
|
|
175
|
+
v && (v.classList.add("highlight"), v.scrollIntoView({ behavior: "smooth", block: "nearest" }));
|
|
174
176
|
}
|
|
175
|
-
return (i,
|
|
176
|
-
|
|
177
|
+
return (i, v) => (s(), r("div", qe, [
|
|
178
|
+
v[0] || (v[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
179
|
t("div", Ye, [
|
|
178
180
|
t("div", {
|
|
179
181
|
ref_key: "shadowHost",
|
|
180
|
-
ref:
|
|
182
|
+
ref: f
|
|
181
183
|
}, null, 512)
|
|
182
184
|
])
|
|
183
185
|
]));
|
|
@@ -212,17 +214,17 @@ const Pe = { class: "p-3" }, Ee = { class: "text-sm font-semibold text-gray-700
|
|
|
212
214
|
}, ht = {
|
|
213
215
|
key: 1,
|
|
214
216
|
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" },
|
|
217
|
+
}, 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" }, Ct = { 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" }, Dt = { 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
218
|
__name: "PrintTemplateEditorDialog",
|
|
217
219
|
props: {
|
|
218
220
|
modelValue: { type: Boolean }
|
|
219
221
|
},
|
|
220
222
|
emits: ["update:modelValue", "saved"],
|
|
221
|
-
setup(
|
|
222
|
-
const
|
|
223
|
-
get: () =>
|
|
224
|
-
set: (l) =>
|
|
225
|
-
}),
|
|
223
|
+
setup(N, { emit: _ }) {
|
|
224
|
+
const f = N, y = _, k = Te(), d = Be(), $ = ze(), i = q({
|
|
225
|
+
get: () => f.modelValue,
|
|
226
|
+
set: (l) => y("update:modelValue", l)
|
|
227
|
+
}), v = x(!1), n = x(!1), c = x(R()), g = x(null), b = x(j.Enum.purchaseOrder), T = x("Purchase Order Template"), o = x(null), h = x(!1), p = x(!1), D = x("select-type"), W = [
|
|
226
228
|
{
|
|
227
229
|
label: "Purchase Order",
|
|
228
230
|
value: j.Enum.purchaseOrder,
|
|
@@ -247,25 +249,25 @@ const Pe = { class: "p-3" }, Ee = { class: "text-sm font-semibold text-gray-700
|
|
|
247
249
|
icon: "local_shipping",
|
|
248
250
|
description: "Customize the layout for delivery order printouts"
|
|
249
251
|
}
|
|
250
|
-
], H =
|
|
251
|
-
() => c.value.find((l) => l.id ===
|
|
252
|
-
), z =
|
|
252
|
+
], H = x(/* @__PURE__ */ new Set()), J = q(
|
|
253
|
+
() => c.value.find((l) => l.id === g.value) ?? null
|
|
254
|
+
), z = x(null), U = x(null);
|
|
253
255
|
M(i, async (l) => {
|
|
254
256
|
if (l) {
|
|
255
|
-
|
|
257
|
+
D.value = "select-type", v.value = !0;
|
|
256
258
|
try {
|
|
257
|
-
const e = await
|
|
259
|
+
const e = await k.browse();
|
|
258
260
|
H.value = new Set(e.map((u) => u.type));
|
|
259
261
|
} catch {
|
|
260
262
|
} finally {
|
|
261
|
-
|
|
263
|
+
v.value = !1;
|
|
262
264
|
}
|
|
263
265
|
}
|
|
264
|
-
}), M(
|
|
265
|
-
|
|
266
|
+
}), M(b, async () => {
|
|
267
|
+
g.value = null, await X();
|
|
266
268
|
});
|
|
267
269
|
async function le(l) {
|
|
268
|
-
|
|
270
|
+
b.value = l, await X(), D.value = "editor";
|
|
269
271
|
}
|
|
270
272
|
function Q() {
|
|
271
273
|
return {
|
|
@@ -273,35 +275,35 @@ const Pe = { class: "p-3" }, Ee = { class: "text-sm font-semibold text-gray-700
|
|
|
273
275
|
transferOrder: "Transfer Order Template",
|
|
274
276
|
goodsReceivedNote: "Goods Received Note Template",
|
|
275
277
|
deliveryOrder: "Delivery Order Template"
|
|
276
|
-
}[
|
|
278
|
+
}[b.value] ?? "Purchase Order Template";
|
|
277
279
|
}
|
|
278
280
|
async function X() {
|
|
279
|
-
|
|
281
|
+
v.value = !0;
|
|
280
282
|
try {
|
|
281
|
-
const l = await
|
|
283
|
+
const l = await k.browse();
|
|
282
284
|
H.value = new Set(l.map((u) => u.type));
|
|
283
|
-
const e = l.find((u) => u.type ===
|
|
284
|
-
e ? (
|
|
285
|
+
const e = l.find((u) => u.type === b.value);
|
|
286
|
+
e ? (o.value = e._id, T.value = e.name, c.value = e.blocks.map((u) => ({ ...u }))) : (o.value = null, c.value = R(), T.value = Q());
|
|
285
287
|
} catch {
|
|
286
|
-
c.value = R(),
|
|
288
|
+
c.value = R(), T.value = Q();
|
|
287
289
|
} finally {
|
|
288
|
-
|
|
290
|
+
v.value = !1;
|
|
289
291
|
}
|
|
290
292
|
}
|
|
291
293
|
function oe(l) {
|
|
292
294
|
const e = {
|
|
293
|
-
id:
|
|
295
|
+
id: Ce(),
|
|
294
296
|
tag: l,
|
|
295
297
|
config: Fe(l)
|
|
296
298
|
};
|
|
297
|
-
c.value.push(e),
|
|
299
|
+
c.value.push(e), g.value = e.id;
|
|
298
300
|
}
|
|
299
301
|
function ae(l) {
|
|
300
302
|
const e = c.value.findIndex((u) => u.id === l);
|
|
301
|
-
e >= 0 && (c.value.splice(e, 1),
|
|
303
|
+
e >= 0 && (c.value.splice(e, 1), g.value === l && (g.value = null));
|
|
302
304
|
}
|
|
303
305
|
function se(l) {
|
|
304
|
-
const e = c.value.find((u) => u.id ===
|
|
306
|
+
const e = c.value.find((u) => u.id === g.value);
|
|
305
307
|
if (e) {
|
|
306
308
|
const u = l.configFields || [], L = te(e.tag);
|
|
307
309
|
e.config = { configFields: u, templateHtml: L };
|
|
@@ -311,21 +313,21 @@ const Pe = { class: "p-3" }, Ee = { class: "text-sm font-semibold text-gray-700
|
|
|
311
313
|
z.value = l;
|
|
312
314
|
}
|
|
313
315
|
function re(l, e) {
|
|
314
|
-
l.preventDefault(),
|
|
316
|
+
l.preventDefault(), U.value = e;
|
|
315
317
|
}
|
|
316
318
|
function ie() {
|
|
317
|
-
|
|
319
|
+
U.value = null;
|
|
318
320
|
}
|
|
319
321
|
function ue(l) {
|
|
320
322
|
if (z.value === null || z.value === l) {
|
|
321
|
-
z.value = null,
|
|
323
|
+
z.value = null, U.value = null;
|
|
322
324
|
return;
|
|
323
325
|
}
|
|
324
326
|
const e = c.value.splice(z.value, 1)[0];
|
|
325
|
-
c.value.splice(l, 0, e), z.value = null,
|
|
327
|
+
c.value.splice(l, 0, e), z.value = null, U.value = null;
|
|
326
328
|
}
|
|
327
329
|
function de() {
|
|
328
|
-
z.value = null,
|
|
330
|
+
z.value = null, U.value = null;
|
|
329
331
|
}
|
|
330
332
|
async function ce() {
|
|
331
333
|
var l;
|
|
@@ -334,30 +336,30 @@ const Pe = { class: "p-3" }, Ee = { class: "text-sm font-semibold text-gray-700
|
|
|
334
336
|
const e = (l = $.currentBusiness.value) == null ? void 0 : l._id;
|
|
335
337
|
if (!e)
|
|
336
338
|
throw new Error("Business ID is missing. Please select a business first.");
|
|
337
|
-
const u = c.value.map((
|
|
339
|
+
const u = c.value.map((a) => {
|
|
338
340
|
var Z;
|
|
339
|
-
const
|
|
341
|
+
const w = ((Z = a.config) == null ? void 0 : Z.configFields) || [], I = te(a.tag, w);
|
|
340
342
|
return {
|
|
341
|
-
...
|
|
342
|
-
config: { configFields:
|
|
343
|
+
...a,
|
|
344
|
+
config: { configFields: w, templateHtml: I }
|
|
343
345
|
};
|
|
344
|
-
}), L =
|
|
345
|
-
name:
|
|
346
|
-
type:
|
|
346
|
+
}), L = De(u), S = {
|
|
347
|
+
name: T.value,
|
|
348
|
+
type: b.value,
|
|
347
349
|
blocks: L,
|
|
348
350
|
businessId: e,
|
|
349
351
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
350
352
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
351
353
|
};
|
|
352
354
|
let B;
|
|
353
|
-
|
|
354
|
-
_id:
|
|
355
|
+
o.value ? B = await k.update(o.value, {
|
|
356
|
+
_id: o.value,
|
|
355
357
|
...S
|
|
356
|
-
}) : (B = await
|
|
358
|
+
}) : (B = await k.create(S), o.value = B._id), H.value.add(b.value), p.value = !1, d == null || d.open({
|
|
357
359
|
title: "Success",
|
|
358
360
|
message: "Print template saved",
|
|
359
361
|
type: "success"
|
|
360
|
-
}),
|
|
362
|
+
}), y("saved", B), i.value = !1;
|
|
361
363
|
} catch (e) {
|
|
362
364
|
d == null || d.open({
|
|
363
365
|
title: "Error",
|
|
@@ -369,14 +371,14 @@ const Pe = { class: "p-3" }, Ee = { class: "text-sm font-semibold text-gray-700
|
|
|
369
371
|
}
|
|
370
372
|
}
|
|
371
373
|
async function pe() {
|
|
372
|
-
if (
|
|
374
|
+
if (o.value) {
|
|
373
375
|
n.value = !0;
|
|
374
376
|
try {
|
|
375
|
-
await
|
|
377
|
+
await k.delete(o.value), o.value = null, c.value = R(), T.value = Q(), H.value.delete(b.value), h.value = !1, d == null || d.open({
|
|
376
378
|
title: "Deleted",
|
|
377
379
|
message: "Print template deleted. Default layout will be used.",
|
|
378
380
|
type: "success"
|
|
379
|
-
}),
|
|
381
|
+
}), y("saved", null), i.value = !1;
|
|
380
382
|
} catch (l) {
|
|
381
383
|
d == null || d.open({
|
|
382
384
|
title: "Error",
|
|
@@ -389,94 +391,94 @@ const Pe = { class: "p-3" }, Ee = { class: "text-sm font-semibold text-gray-700
|
|
|
389
391
|
}
|
|
390
392
|
}
|
|
391
393
|
function me() {
|
|
392
|
-
c.value = R(),
|
|
394
|
+
c.value = R(), g.value = null;
|
|
393
395
|
}
|
|
394
396
|
function ve(l) {
|
|
395
397
|
var e;
|
|
396
|
-
return ((e =
|
|
398
|
+
return ((e = P[l]) == null ? void 0 : e.label) ?? l;
|
|
397
399
|
}
|
|
398
400
|
function ge(l) {
|
|
399
401
|
var e;
|
|
400
|
-
return ((e =
|
|
402
|
+
return ((e = P[l]) == null ? void 0 : e.icon) ?? "widgets";
|
|
401
403
|
}
|
|
402
404
|
return (l, e) => {
|
|
403
405
|
const u = V("FmIcon"), L = V("FmTextField"), S = V("FmButton"), B = V("FmDialog");
|
|
404
|
-
return s(), r(
|
|
405
|
-
|
|
406
|
+
return s(), r(A, null, [
|
|
407
|
+
m(B, {
|
|
406
408
|
modelValue: i.value,
|
|
407
|
-
"onUpdate:modelValue": e[4] || (e[4] = (
|
|
409
|
+
"onUpdate:modelValue": e[4] || (e[4] = (a) => i.value = a),
|
|
408
410
|
overlay: !0,
|
|
409
411
|
"close-button": "",
|
|
410
412
|
"max-width": "98vw",
|
|
411
413
|
"max-height": "98vh"
|
|
412
414
|
}, ye({
|
|
413
|
-
"dialog-header":
|
|
414
|
-
var
|
|
415
|
+
"dialog-header": F(() => {
|
|
416
|
+
var a;
|
|
415
417
|
return [
|
|
416
418
|
t("div", Qe, [
|
|
417
|
-
|
|
419
|
+
D.value === "editor" ? (s(), r("button", {
|
|
418
420
|
key: 0,
|
|
419
421
|
class: "flex items-center justify-center w-7 h-7 rounded hover:bg-gray-100 transition-colors text-gray-500",
|
|
420
|
-
onClick: e[0] || (e[0] = (
|
|
422
|
+
onClick: e[0] || (e[0] = (w) => D.value = "select-type")
|
|
421
423
|
}, [
|
|
422
|
-
|
|
424
|
+
m(u, {
|
|
423
425
|
name: "arrow_back",
|
|
424
426
|
size: "sm"
|
|
425
427
|
})
|
|
426
|
-
])) :
|
|
427
|
-
|
|
428
|
+
])) : K("", !0),
|
|
429
|
+
D.value === "select-type" ? (s(), r("span", We, "Print Template Editor")) : (s(), r("span", Xe, C((a = W.find((w) => w.value === b.value)) == null ? void 0 : a.label) + " Template", 1))
|
|
428
430
|
])
|
|
429
431
|
];
|
|
430
432
|
}),
|
|
431
|
-
default:
|
|
432
|
-
|
|
433
|
+
default: F(() => [
|
|
434
|
+
D.value === "select-type" ? (s(), r("div", Ze, [
|
|
433
435
|
e[7] || (e[7] = t("p", { class: "text-sm text-gray-500 mb-5" }, " Select a template type to customize its print layout. ", -1)),
|
|
434
|
-
|
|
435
|
-
(s(), r(
|
|
436
|
-
key:
|
|
436
|
+
v.value ? (s(), r("div", et, " Loading... ")) : (s(), r("div", tt, [
|
|
437
|
+
(s(), r(A, null, G(W, (a) => t("div", {
|
|
438
|
+
key: a.value,
|
|
437
439
|
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", {
|
|
438
|
-
"border-blue-500 bg-blue-50/50 shadow-md":
|
|
440
|
+
"border-blue-500 bg-blue-50/50 shadow-md": b.value === a.value && D.value === "select-type"
|
|
439
441
|
}]),
|
|
440
|
-
onClick: (
|
|
442
|
+
onClick: (w) => le(a.value)
|
|
441
443
|
}, [
|
|
442
444
|
t("div", ot, [
|
|
443
|
-
|
|
444
|
-
name:
|
|
445
|
+
m(u, {
|
|
446
|
+
name: a.icon,
|
|
445
447
|
size: "sm"
|
|
446
448
|
}, null, 8, ["name"])
|
|
447
449
|
]),
|
|
448
450
|
t("div", at, [
|
|
449
|
-
t("div", st,
|
|
450
|
-
t("div", nt,
|
|
451
|
+
t("div", st, C(a.label), 1),
|
|
452
|
+
t("div", nt, C(a.description), 1)
|
|
451
453
|
]),
|
|
452
|
-
H.value.has(
|
|
454
|
+
H.value.has(a.value) ? (s(), r("span", rt, "Customized")) : (s(), r("span", it, "Default"))
|
|
453
455
|
], 10, lt)), 64))
|
|
454
456
|
]))
|
|
455
|
-
])) :
|
|
457
|
+
])) : v.value ? (s(), r("div", ut, e[8] || (e[8] = [
|
|
456
458
|
t("div", null, "Loading template...", -1)
|
|
457
459
|
]))) : (s(), r("div", dt, [
|
|
458
460
|
t("div", ct, [
|
|
459
461
|
t("div", pt, [
|
|
460
|
-
|
|
461
|
-
modelValue:
|
|
462
|
-
"onUpdate:modelValue": e[1] || (e[1] = (
|
|
462
|
+
m(L, {
|
|
463
|
+
modelValue: T.value,
|
|
464
|
+
"onUpdate:modelValue": e[1] || (e[1] = (a) => T.value = a),
|
|
463
465
|
placeholder: "Template name",
|
|
464
466
|
label: "Template Name"
|
|
465
467
|
}, null, 8, ["modelValue"])
|
|
466
468
|
]),
|
|
467
469
|
e[9] || (e[9] = t("div", { class: "text-xs font-semibold text-gray-400 uppercase tracking-wider px-3 py-2" }, " Add Blocks ", -1)),
|
|
468
470
|
t("div", mt, [
|
|
469
|
-
(s(!0), r(
|
|
470
|
-
key:
|
|
471
|
+
(s(!0), r(A, null, G(O($e).Values, (a) => (s(), r("div", {
|
|
472
|
+
key: a,
|
|
471
473
|
class: "group flex items-center gap-2 px-3 py-2 cursor-pointer text-[13px] text-gray-600 transition-colors hover:bg-gray-100",
|
|
472
|
-
onClick: (
|
|
474
|
+
onClick: (w) => oe(a)
|
|
473
475
|
}, [
|
|
474
|
-
|
|
475
|
-
name: O(
|
|
476
|
+
m(u, {
|
|
477
|
+
name: O(P)[a].icon,
|
|
476
478
|
size: "sm"
|
|
477
479
|
}, null, 8, ["name"]),
|
|
478
|
-
t("span", null,
|
|
479
|
-
|
|
480
|
+
t("span", null, C(O(P)[a].label), 1),
|
|
481
|
+
m(u, {
|
|
480
482
|
name: "add",
|
|
481
483
|
size: "sm",
|
|
482
484
|
class: "ml-auto opacity-0 text-blue-600 group-hover:opacity-100"
|
|
@@ -485,50 +487,50 @@ const Pe = { class: "p-3" }, Ee = { class: "text-sm font-semibold text-gray-700
|
|
|
485
487
|
]),
|
|
486
488
|
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)),
|
|
487
489
|
t("div", gt, [
|
|
488
|
-
(s(!0), r(
|
|
489
|
-
key:
|
|
490
|
+
(s(!0), r(A, null, G(c.value, (a, w) => (s(), r("div", {
|
|
491
|
+
key: a.id,
|
|
490
492
|
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", {
|
|
491
|
-
"bg-blue-50 border-l-[3px] border-l-blue-600":
|
|
492
|
-
"border-t-2 border-t-blue-600":
|
|
493
|
+
"bg-blue-50 border-l-[3px] border-l-blue-600": a.id === g.value,
|
|
494
|
+
"border-t-2 border-t-blue-600": U.value === w
|
|
493
495
|
}]),
|
|
494
496
|
draggable: "true",
|
|
495
|
-
onDragstart: (I) => ne(
|
|
496
|
-
onDragover: (I) => re(I,
|
|
497
|
+
onDragstart: (I) => ne(w),
|
|
498
|
+
onDragover: (I) => re(I, w),
|
|
497
499
|
onDragleave: ie,
|
|
498
|
-
onDrop: (I) => ue(
|
|
500
|
+
onDrop: (I) => ue(w),
|
|
499
501
|
onDragend: de,
|
|
500
|
-
onClick: (I) =>
|
|
502
|
+
onClick: (I) => g.value = a.id
|
|
501
503
|
}, [
|
|
502
|
-
|
|
504
|
+
m(u, {
|
|
503
505
|
name: "drag_indicator",
|
|
504
506
|
size: "sm",
|
|
505
507
|
class: "cursor-grab text-gray-300"
|
|
506
508
|
}),
|
|
507
|
-
|
|
508
|
-
name: ge(
|
|
509
|
+
m(u, {
|
|
510
|
+
name: ge(a.tag),
|
|
509
511
|
size: "sm"
|
|
510
512
|
}, null, 8, ["name"]),
|
|
511
|
-
t("span", yt,
|
|
513
|
+
t("span", yt, C(ve(a.tag)), 1),
|
|
512
514
|
t("div", bt, [
|
|
513
|
-
|
|
515
|
+
m(u, {
|
|
514
516
|
name: "delete",
|
|
515
517
|
size: "sm",
|
|
516
518
|
class: "cursor-pointer text-gray-400 hover:text-red-500",
|
|
517
|
-
onClick: be((I) => ae(
|
|
519
|
+
onClick: be((I) => ae(a.id), ["stop"])
|
|
518
520
|
}, null, 8, ["onClick"])
|
|
519
521
|
])
|
|
520
522
|
], 42, ft))), 128)),
|
|
521
|
-
c.value.length === 0 ? (s(), r("div", xt, " Click a block above to add it ")) :
|
|
523
|
+
c.value.length === 0 ? (s(), r("div", xt, " Click a block above to add it ")) : K("", !0)
|
|
522
524
|
]),
|
|
523
525
|
J.value ? (s(), r("div", _t, [
|
|
524
|
-
(s(),
|
|
526
|
+
(s(), E(Ke, {
|
|
525
527
|
key: J.value.id,
|
|
526
528
|
block: J.value,
|
|
527
529
|
onUpdate: se
|
|
528
530
|
}, null, 8, ["block"]))
|
|
529
531
|
])) : (s(), r("div", ht, " Select a block to configure it ")),
|
|
530
532
|
t("div", kt, [
|
|
531
|
-
|
|
533
|
+
m(S, {
|
|
532
534
|
label: "Reset to Default",
|
|
533
535
|
variant: "plain",
|
|
534
536
|
size: "md",
|
|
@@ -537,51 +539,51 @@ const Pe = { class: "p-3" }, Ee = { class: "text-sm font-semibold text-gray-700
|
|
|
537
539
|
])
|
|
538
540
|
]),
|
|
539
541
|
t("div", wt, [
|
|
540
|
-
|
|
542
|
+
m(Je, {
|
|
541
543
|
blocks: c.value,
|
|
542
|
-
"selected-block-id":
|
|
543
|
-
"template-type":
|
|
544
|
+
"selected-block-id": g.value,
|
|
545
|
+
"template-type": b.value
|
|
544
546
|
}, null, 8, ["blocks", "selected-block-id", "template-type"])
|
|
545
547
|
])
|
|
546
548
|
]))
|
|
547
549
|
]),
|
|
548
550
|
_: 2
|
|
549
551
|
}, [
|
|
550
|
-
|
|
552
|
+
D.value === "editor" ? {
|
|
551
553
|
name: "dialog-footer",
|
|
552
|
-
fn:
|
|
554
|
+
fn: F(() => [
|
|
553
555
|
t("div", Tt, [
|
|
554
|
-
|
|
556
|
+
o.value ? (s(), E(S, {
|
|
555
557
|
key: 0,
|
|
556
558
|
label: "Delete Template",
|
|
557
559
|
variant: "destructive",
|
|
558
560
|
size: "md",
|
|
559
|
-
onClick: e[2] || (e[2] = (
|
|
560
|
-
})) :
|
|
561
|
-
|
|
561
|
+
onClick: e[2] || (e[2] = (a) => h.value = !0)
|
|
562
|
+
})) : K("", !0),
|
|
563
|
+
m(S, {
|
|
562
564
|
label: "Save Template",
|
|
563
565
|
variant: "primary",
|
|
564
566
|
size: "md",
|
|
565
|
-
onClick: e[3] || (e[3] = (
|
|
567
|
+
onClick: e[3] || (e[3] = (a) => p.value = !0)
|
|
566
568
|
})
|
|
567
569
|
])
|
|
568
570
|
]),
|
|
569
571
|
key: "0"
|
|
570
572
|
} : void 0
|
|
571
573
|
]), 1032, ["modelValue"]),
|
|
572
|
-
|
|
573
|
-
modelValue:
|
|
574
|
-
"onUpdate:modelValue": e[5] || (e[5] = (
|
|
574
|
+
m(B, {
|
|
575
|
+
modelValue: p.value,
|
|
576
|
+
"onUpdate:modelValue": e[5] || (e[5] = (a) => p.value = a),
|
|
575
577
|
overlay: !0,
|
|
576
578
|
dismissAway: !0,
|
|
577
579
|
"close-button": "",
|
|
578
580
|
"max-width": "400px"
|
|
579
581
|
}, {
|
|
580
|
-
"dialog-header":
|
|
582
|
+
"dialog-header": F(() => e[11] || (e[11] = [
|
|
581
583
|
t("span", null, "Save Print Template?", -1)
|
|
582
584
|
])),
|
|
583
|
-
"dialog-footer":
|
|
584
|
-
|
|
585
|
+
"dialog-footer": F(() => [
|
|
586
|
+
m(S, {
|
|
585
587
|
class: "ml-auto",
|
|
586
588
|
label: "Save",
|
|
587
589
|
variant: "primary",
|
|
@@ -590,12 +592,12 @@ const Pe = { class: "p-3" }, Ee = { class: "text-sm font-semibold text-gray-700
|
|
|
590
592
|
onClick: ce
|
|
591
593
|
}, null, 8, ["loading"])
|
|
592
594
|
]),
|
|
593
|
-
default:
|
|
595
|
+
default: F(() => [
|
|
594
596
|
t("div", Ft, [
|
|
595
597
|
e[13] || (e[13] = t("p", null, "Are you sure you want to save this print template?", -1)),
|
|
596
598
|
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)),
|
|
597
|
-
t("div",
|
|
598
|
-
|
|
599
|
+
t("div", Ct, [
|
|
600
|
+
m(u, {
|
|
599
601
|
name: "warning",
|
|
600
602
|
size: "sm"
|
|
601
603
|
}),
|
|
@@ -605,19 +607,19 @@ const Pe = { class: "p-3" }, Ee = { class: "text-sm font-semibold text-gray-700
|
|
|
605
607
|
]),
|
|
606
608
|
_: 1
|
|
607
609
|
}, 8, ["modelValue"]),
|
|
608
|
-
|
|
609
|
-
modelValue:
|
|
610
|
-
"onUpdate:modelValue": e[6] || (e[6] = (
|
|
610
|
+
m(B, {
|
|
611
|
+
modelValue: h.value,
|
|
612
|
+
"onUpdate:modelValue": e[6] || (e[6] = (a) => h.value = a),
|
|
611
613
|
overlay: !0,
|
|
612
614
|
dismissAway: !0,
|
|
613
615
|
"close-button": "",
|
|
614
616
|
"max-width": "400px"
|
|
615
617
|
}, {
|
|
616
|
-
"dialog-header":
|
|
618
|
+
"dialog-header": F(() => e[15] || (e[15] = [
|
|
617
619
|
t("span", null, "Delete Print Template?", -1)
|
|
618
620
|
])),
|
|
619
|
-
"dialog-footer":
|
|
620
|
-
|
|
621
|
+
"dialog-footer": F(() => [
|
|
622
|
+
m(S, {
|
|
621
623
|
class: "ml-auto",
|
|
622
624
|
label: "Delete",
|
|
623
625
|
variant: "destructive",
|
|
@@ -626,12 +628,12 @@ const Pe = { class: "p-3" }, Ee = { class: "text-sm font-semibold text-gray-700
|
|
|
626
628
|
onClick: pe
|
|
627
629
|
}, null, 8, ["loading"])
|
|
628
630
|
]),
|
|
629
|
-
default:
|
|
630
|
-
t("div",
|
|
631
|
+
default: F(() => [
|
|
632
|
+
t("div", Dt, [
|
|
631
633
|
e[17] || (e[17] = t("p", null, "Are you sure you want to delete this print template?", -1)),
|
|
632
634
|
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)),
|
|
633
635
|
t("div", St, [
|
|
634
|
-
|
|
636
|
+
m(u, {
|
|
635
637
|
name: "warning",
|
|
636
638
|
size: "sm"
|
|
637
639
|
}),
|
|
@@ -646,43 +648,43 @@ const Pe = { class: "p-3" }, Ee = { class: "text-sm font-semibold text-gray-700
|
|
|
646
648
|
}
|
|
647
649
|
}), 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({
|
|
648
650
|
__name: "SettingsView",
|
|
649
|
-
setup(
|
|
650
|
-
const { t:
|
|
651
|
-
|
|
652
|
-
const
|
|
653
|
-
function
|
|
654
|
-
|
|
651
|
+
setup(N) {
|
|
652
|
+
const { t: _ } = Ie(), f = Se();
|
|
653
|
+
f.fetchTemplates();
|
|
654
|
+
const y = x(!1);
|
|
655
|
+
function k() {
|
|
656
|
+
f.invalidate(), f.fetchTemplates();
|
|
655
657
|
}
|
|
656
658
|
function d() {
|
|
657
|
-
|
|
659
|
+
y.value = !0;
|
|
658
660
|
}
|
|
659
661
|
return ($, i) => {
|
|
660
|
-
const
|
|
661
|
-
return s(),
|
|
662
|
-
title: O(
|
|
662
|
+
const v = V("FmButton");
|
|
663
|
+
return s(), E(_e, {
|
|
664
|
+
title: O(_)("inventory.settings.title")
|
|
663
665
|
}, {
|
|
664
|
-
default:
|
|
666
|
+
default: F(() => [
|
|
665
667
|
t("div", Vt, [
|
|
666
|
-
|
|
667
|
-
default:
|
|
668
|
+
m(Oe, null, {
|
|
669
|
+
default: F(() => [
|
|
668
670
|
t("div", $t, [
|
|
669
|
-
t("h2", zt,
|
|
670
|
-
t("p", It,
|
|
671
|
-
|
|
671
|
+
t("h2", zt, C(O(_)("inventory.settings.printTemplate.title")), 1),
|
|
672
|
+
t("p", It, C(O(_)("inventory.settings.printTemplate.description")), 1),
|
|
673
|
+
m(v, {
|
|
672
674
|
onClick: d,
|
|
673
675
|
variant: "secondary",
|
|
674
|
-
label: O(
|
|
676
|
+
label: O(_)("inventory.settings.printTemplate.edit")
|
|
675
677
|
}, null, 8, ["label"])
|
|
676
678
|
])
|
|
677
679
|
]),
|
|
678
680
|
_: 1
|
|
679
681
|
})
|
|
680
682
|
]),
|
|
681
|
-
(s(),
|
|
682
|
-
|
|
683
|
-
modelValue:
|
|
684
|
-
"onUpdate:modelValue": i[0] || (i[0] = (n) =>
|
|
685
|
-
onSaved:
|
|
683
|
+
(s(), E(xe, { to: "body" }, [
|
|
684
|
+
m(Bt, {
|
|
685
|
+
modelValue: y.value,
|
|
686
|
+
"onUpdate:modelValue": i[0] || (i[0] = (n) => y.value = n),
|
|
687
|
+
onSaved: k
|
|
686
688
|
}, null, 8, ["modelValue"])
|
|
687
689
|
]))
|
|
688
690
|
]),
|