@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.
Files changed (132) hide show
  1. package/dist/{App-D1-fT3jF.js → App-Dl97lAmD.js} +3 -3
  2. package/dist/ApprovalView-RePEhbhl.js +241 -0
  3. package/dist/{BindingsDialog-DeavyPY-.js → BindingsDialog-8QVbtnnq.js} +5 -5
  4. package/dist/{BindingsPicker-BGzhKq8G.js → BindingsPicker-D9yuDGcq.js} +3 -3
  5. package/dist/{BindingsTable-Dr9hWkE1.js → BindingsTable-DAYhI-6V.js} +5 -5
  6. package/dist/{ClosingDraftView-6gwWEWWB.js → ClosingDraftView-D_VtBfFG.js} +57 -57
  7. package/dist/{ClosingHistoryView-D4rNnlsq.js → ClosingHistoryView-ClUnxQS2.js} +4 -4
  8. package/dist/{ClosingTemplateView-DxCLH1GH.js → ClosingTemplateView-0a_isyyx.js} +16 -16
  9. package/dist/{DeliveryOrderPrintPreview-D-XeZX-z.js → DeliveryOrderPrintPreview-DovAi6j-.js} +17 -17
  10. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DeoaPLQm.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DjNZ0m13.js} +14 -14
  11. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BMhSHZ3Z.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-4vZH2hLF.js} +2 -2
  12. package/dist/{FmMultiselectDialog-DJFi54mG.js → FmMultiselectDialog-B5-aK-b2.js} +1 -1
  13. package/dist/{FmMultiselectDialog-BQZmTWDb.js → FmMultiselectDialog-Z49kK96R.js} +2 -2
  14. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-DAivpdPp.js → FmUnitInput.vue_vue_type_script_setup_true_lang-zP1nS7bp.js} +4 -4
  15. package/dist/{ImportView-DPQY0ELT.js → ImportView-Dba8fJry.js} +6 -6
  16. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DeVYXEzb.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DHITBIhp.js} +1 -1
  17. package/dist/{IngredientGroupView-5AuPbMDz.js → IngredientGroupView-CHi5_A4T.js} +7 -7
  18. package/dist/{IngredientsView-qMotWYnL.js → IngredientsView-DWk27PJg.js} +17 -17
  19. package/dist/IntegrationExplorerView-CixgHWVb.js +22254 -0
  20. package/dist/{IntegrationView-CVdwhNTA.js → IntegrationView-fttszvyC.js} +13 -13
  21. package/dist/{InventoryBindingForm-B5KUYKIu.js → InventoryBindingForm-DDcM2paa.js} +1 -1
  22. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-pbyMU879.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DOHrtdbl.js} +5 -5
  23. package/dist/{InventoryBindingSummary-Bm3A2kmC.js → InventoryBindingSummary-BERshnpd.js} +1 -1
  24. 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
  25. 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
  26. package/dist/{PublishView-DOIiAeDK.js → PublishView-COGdnDHP.js} +3 -3
  27. package/dist/{PurchaseOrderPrintPreview-BE-8EJFv.js → PurchaseOrderPrintPreview-COJVgeTm.js} +12 -12
  28. package/dist/ReceiveRequestView-DvC12_QK.js +2817 -0
  29. package/dist/{RecipeView-CM-BrVSe.js → RecipeView-BKlVCFPR.js} +22 -21
  30. package/dist/SettingsView-DbXva8_D.js +695 -0
  31. package/dist/{StockView-DDqlms0m.js → StockView-Hri6SSjn.js} +21 -20
  32. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-CcQ6bBWG.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DiRfjFmz.js} +1 -1
  33. package/dist/{SupplierView-CM2PrtHi.js → SupplierView-DCMW5muk.js} +14 -14
  34. package/dist/{SurchargeView-q2NfASMH.js → SurchargeView-DRh5EAi8.js} +8 -8
  35. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-BbZQZQTQ.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-BHNIS7Pp.js} +2 -2
  36. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-Bp3joqMK.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-BVyoZ2a4.js} +1 -1
  37. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-CMSKhz6_.js +3790 -0
  38. package/dist/{TransferTemplateView-B26H_T9Q.js → TransferTemplateView-71XY525Q.js} +20 -19
  39. package/dist/{UnitCostHistoryView-BzumRVdx.js → UnitCostHistoryView-CjEaekfJ.js} +4 -4
  40. package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-CfWpv2Mv.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-B8dRQhZi.js} +4 -4
  41. package/dist/{UnitView-Cxfg--TU.js → UnitView-D06txpBT.js} +9 -9
  42. package/dist/{WarehouseView-CvoafTrd.js → WarehouseView-DQluGq0D.js} +7 -7
  43. package/dist/{WastageTemplateView-Bqd4Wp3d.js → WastageTemplateView-Bqmd_r_Y.js} +16 -16
  44. package/dist/api/integration-sync-log.d.ts +47 -0
  45. package/dist/api/netsuite-explorer.d.ts +51 -0
  46. package/dist/{app-CrrDFeMj.js → app-B5-QVzib.js} +4711 -4557
  47. package/dist/app.d.ts +32 -0
  48. package/dist/app.js +2 -2
  49. package/dist/{closing-template-Ew74NLQj.js → closing-template-C3ClR8Pj.js} +1 -1
  50. package/dist/{component-DpCUABT3.js → component-kqxARxvM.js} +30 -21
  51. package/dist/components/row-action.enum.d.ts +3 -0
  52. package/dist/{date2-Bklbk2g-.js → date2-CQCX7jCE.js} +4 -4
  53. package/dist/{dayjs.min-B463GIlc.js → dayjs.min-Dhp0BWSV.js} +1 -1
  54. package/dist/{decimal-Dm2vbfDq.js → decimal-98G--u_X.js} +2 -2
  55. package/dist/defineDeepModel-BmHs4vdS.js +19 -0
  56. package/dist/{duplicate-template-CR79OmLy.js → duplicate-template-UzmArmcM.js} +1 -1
  57. package/dist/{export-CQJcxfPC.js → export-Bdxro0GT.js} +1 -1
  58. package/dist/feature-DyfUPR3b.js +1081 -0
  59. package/dist/{format-time-from-id-61ydd8RS.js → format-time-from-id-uRCD3JxF.js} +1 -1
  60. package/dist/{format-unit-display-BLtW28yU.js → format-unit-display-C-_85vuL.js} +13 -13
  61. package/dist/{import-export.helper-uhFwjH6X.js → import-export.helper-N1BqiTub.js} +6 -6
  62. package/dist/{index-Dx5HvWR_.js → index-B1RZtqz-.js} +1 -1
  63. package/dist/{index-uA6bkf1x.js → index-CaREZ_vQ.js} +3 -3
  64. package/dist/{index-CouegIcG.js → index-CwqHa5AY.js} +1 -1
  65. package/dist/{feature-CZHvliez.js → inventory-core-dart.default-BK8f9n8e.js} +322 -1395
  66. package/dist/{lodash-CjyamSgJ.js → lodash-B9tHF9A4.js} +1 -1
  67. package/dist/{lz-string-BbZdMrTL.js → lz-string-BSMjlcH9.js} +1 -1
  68. package/dist/modules/print-template/api/print-template.d.ts +29 -0
  69. package/dist/modules/print-template/components/BlockConfigPanel.vue.d.ts +19 -0
  70. package/dist/modules/print-template/components/CustomPrintTemplatePreview.vue.d.ts +25 -0
  71. package/dist/modules/print-template/components/PrintTemplateEditorDialog.vue.d.ts +45 -0
  72. package/dist/modules/print-template/components/TemplatePreview.vue.d.ts +22 -0
  73. package/dist/modules/print-template/composables/print-po-with-template.d.ts +25 -0
  74. package/dist/modules/print-template/definitions/block-definitions.d.ts +88 -0
  75. package/dist/modules/print-template/definitions/predefined-templates.d.ts +22 -0
  76. package/dist/modules/print-template/definitions/template-renderer.d.ts +17 -0
  77. package/dist/modules/print-template/index.d.ts +11 -0
  78. package/dist/modules/print-template/store/print-template.d.ts +170 -0
  79. package/dist/modules/print-template/types/print-data.d.ts +52 -0
  80. package/dist/modules/print-template/utils/sanitize-html.d.ts +32 -0
  81. package/dist/{netsuite-2v3F8ILe.js → netsuite-D4KHhWWu.js} +60 -9
  82. package/dist/{number-BYbxsJHr.js → number-DmqVo28f.js} +3 -3
  83. package/dist/predefined-templates-Dy5hYXMM.js +4542 -0
  84. package/dist/{purchase-order-template-s1AiueV_.js → purchase-order-template-BT3tF_gn.js} +1 -1
  85. package/dist/router/name.d.ts +2 -0
  86. package/dist/{row-action.enum-BcW_L_nE.js → row-action.enum-Co_O4qD9.js} +11 -3
  87. package/dist/{rules-C7L-LFOd.js → rules-CbJ7idQa.js} +2 -2
  88. package/dist/{stock-D2s88pz1.js → stock-C9RXv-3_.js} +1 -1
  89. package/dist/{stock-CvYOcgWb.js → stock-YXoLCE8o.js} +3 -3
  90. package/dist/stores/feature.d.ts +2 -0
  91. package/dist/stores/integration/netsuite.d.ts +1 -1
  92. package/dist/style.css +1 -1
  93. package/dist/{supplier-DmobM7mD.js → supplier-Duiacdig.js} +2 -2
  94. package/dist/{surcharge-BdZOVfi0.js → surcharge-CkDK4P_6.js} +1 -1
  95. package/dist/tsconfig.app.tsbuildinfo +1 -1
  96. package/dist/{use-ingredient-select-dialog-BUCJBHjV.js → use-ingredient-select-dialog-C7uVeT1M.js} +2 -2
  97. package/dist/{use-inventory-binding-dialog-DiN1hBIm.js → use-inventory-binding-dialog-BIo9Fi-9.js} +2 -2
  98. package/dist/{use-template-enabled-locations-CmH6I2cy.js → use-template-enabled-locations-BtbfLc0y.js} +2 -2
  99. package/dist/views/integration/components/IntegrationSyncLogTab.vue.d.ts +15 -0
  100. package/dist/views/integration/composables/use-integration-sync-log.d.ts +45 -0
  101. package/dist/views/integration-explorer/IntegrationExplorerView.vue.d.ts +2 -0
  102. package/dist/views/integration-explorer/composables/use-explorer-tab.d.ts +126 -0
  103. package/dist/views/integration-explorer/netsuite/ExplorerRecordSyncLog.vue.d.ts +17 -0
  104. package/dist/views/integration-explorer/netsuite/ExplorerRecordToolbar.vue.d.ts +201 -0
  105. package/dist/views/integration-explorer/netsuite/ExplorerSystemNote.vue.d.ts +15 -0
  106. package/dist/views/integration-explorer/netsuite/JsonViewer.vue.d.ts +15 -0
  107. package/dist/views/integration-explorer/netsuite/NetSuiteExplorerView.vue.d.ts +2 -0
  108. package/dist/views/integration-explorer/netsuite/inventoryTransfer/InventoryTransferSideSheet.vue.d.ts +7 -0
  109. package/dist/views/integration-explorer/netsuite/inventoryTransfer/InventoryTransferView.vue.d.ts +39 -0
  110. package/dist/views/integration-explorer/netsuite/items/AssemblyItemSideSheet.vue.d.ts +7 -0
  111. package/dist/views/integration-explorer/netsuite/items/InventoryItemSideSheet.vue.d.ts +7 -0
  112. package/dist/views/integration-explorer/netsuite/items/ItemsView.vue.d.ts +2 -0
  113. package/dist/views/integration-explorer/netsuite/items/ServiceItemSideSheet.vue.d.ts +7 -0
  114. package/dist/views/integration-explorer/netsuite/orders/ExplorerOrderDetailSideSheet.vue.d.ts +7 -0
  115. package/dist/views/integration-explorer/netsuite/orders/OrdersView.vue.d.ts +39 -0
  116. package/dist/views/integration-explorer/netsuite/orders/PurchaseOrderSideSheet.vue.d.ts +7 -0
  117. package/dist/views/integration-explorer/netsuite/orders/SyncNetsuiteButton.vue.d.ts +29 -0
  118. package/dist/views/integration-explorer/netsuite/orders/TransferOrderSideSheet.vue.d.ts +7 -0
  119. package/dist/views/receive-request/components/transfer-form/TransferFormWithController.vue.d.ts +21 -21
  120. package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +21 -21
  121. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +129 -129
  122. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +154 -150
  123. package/dist/views/settings/SettingsView.vue.d.ts +2 -0
  124. package/dist/vue-i18n-D1JHIbLE.js +2365 -0
  125. package/dist/{xlsx-D4PML26z.js → xlsx-BEbkruI_.js} +398 -398
  126. package/dist/{xlsx.util-BWLcCmO_.js → xlsx.util-BMTXqfxw.js} +1 -1
  127. package/package.json +9 -4
  128. package/dist/ApprovalView-0FbsslVD.js +0 -226
  129. package/dist/ReceiveRequestView-ur3OeHuv.js +0 -2802
  130. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-GhRFdMoW.js +0 -3521
  131. package/dist/defineDeepModel-SD5OUepJ.js +0 -19
  132. package/dist/vue-i18n-D0Q6LFcu.js +0 -2365
@@ -1,4 +1,4 @@
1
- import { ai as jt, A as ep } from "./app-CrrDFeMj.js";
1
+ import { ak as jt, A as ep } from "./app-B5-QVzib.js";
2
2
  var Jr = { exports: {} };
3
3
  /**
4
4
  * @license
@@ -1,4 +1,4 @@
1
- import { A as O } from "./app-CrrDFeMj.js";
1
+ import { A as O } from "./app-B5-QVzib.js";
2
2
  var _ = { exports: {} };
3
3
  _.exports;
4
4
  (function(S) {
@@ -0,0 +1,29 @@
1
+ import type { CreateType } from '@/api/type';
2
+ export declare const usePrintTemplateApi: () => {
3
+ browse(): Promise<{
4
+ _id: string;
5
+ name: string;
6
+ type: "purchaseOrder" | "deliveryOrder" | "transferOrder" | "goodsReceivedNote";
7
+ businessId: string;
8
+ createdAt: string;
9
+ updatedAt: string;
10
+ blocks: {
11
+ config?: Record<string, any> | undefined;
12
+ id: string;
13
+ tag: string;
14
+ }[];
15
+ }[]>;
16
+ read(id: string): Promise<FdoPrintTemplate>;
17
+ create(template: CreateType<FdoPrintTemplate>): Promise<FdoPrintTemplate>;
18
+ update(id: string, template: FdoPrintTemplate): Promise<FdoPrintTemplate>;
19
+ delete(id: string): Promise<any>;
20
+ urls: {
21
+ portalBackendUrl: string;
22
+ netSuiteBackendUrl: string;
23
+ businessesBackendUrl: string;
24
+ inventoryBackendUrl: string;
25
+ foodMarketHubUrl: string;
26
+ menuV4BackendUrl: string;
27
+ dataBackendUrl: string;
28
+ };
29
+ };
@@ -0,0 +1,19 @@
1
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
2
+ block: FdoPrintTemplateBlock;
3
+ }>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
4
+ update: (config: Record<string, any>) => void;
5
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
6
+ block: FdoPrintTemplateBlock;
7
+ }>>> & Readonly<{
8
+ onUpdate?: ((config: Record<string, any>) => any) | undefined;
9
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
10
+ export default _default;
11
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
12
+ type __VLS_TypePropsToRuntimeProps<T> = {
13
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
14
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
15
+ } : {
16
+ type: import('vue').PropType<T[K]>;
17
+ required: true;
18
+ };
19
+ };
@@ -0,0 +1,25 @@
1
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
2
+ html: string;
3
+ modelValue: boolean;
4
+ templateName?: string | undefined;
5
+ isDefault?: boolean | undefined;
6
+ }>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
+ "update:modelValue": (value: boolean) => void;
8
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
9
+ html: string;
10
+ modelValue: boolean;
11
+ templateName?: string | undefined;
12
+ isDefault?: boolean | undefined;
13
+ }>>> & Readonly<{
14
+ "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
15
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
16
+ export default _default;
17
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
18
+ type __VLS_TypePropsToRuntimeProps<T> = {
19
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
20
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
21
+ } : {
22
+ type: import('vue').PropType<T[K]>;
23
+ required: true;
24
+ };
25
+ };
@@ -0,0 +1,45 @@
1
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
2
+ modelValue: boolean;
3
+ }>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
4
+ "update:modelValue": (value: boolean) => void;
5
+ saved: (template: {
6
+ _id: string;
7
+ name: string;
8
+ type: "purchaseOrder" | "deliveryOrder" | "transferOrder" | "goodsReceivedNote";
9
+ businessId: string;
10
+ createdAt: string;
11
+ updatedAt: string;
12
+ blocks: {
13
+ config?: Record<string, any> | undefined;
14
+ id: string;
15
+ tag: string;
16
+ }[];
17
+ } | null) => void;
18
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
19
+ modelValue: boolean;
20
+ }>>> & Readonly<{
21
+ "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
22
+ onSaved?: ((template: {
23
+ _id: string;
24
+ name: string;
25
+ type: "purchaseOrder" | "deliveryOrder" | "transferOrder" | "goodsReceivedNote";
26
+ businessId: string;
27
+ createdAt: string;
28
+ updatedAt: string;
29
+ blocks: {
30
+ config?: Record<string, any> | undefined;
31
+ id: string;
32
+ tag: string;
33
+ }[];
34
+ } | null) => any) | undefined;
35
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
36
+ export default _default;
37
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
38
+ type __VLS_TypePropsToRuntimeProps<T> = {
39
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
40
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
41
+ } : {
42
+ type: import('vue').PropType<T[K]>;
43
+ required: true;
44
+ };
45
+ };
@@ -0,0 +1,22 @@
1
+ import type { PurchaseOrderPrintTemplateData } from '../types/print-data';
2
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
3
+ blocks: FdoPrintTemplateBlock[];
4
+ previewData?: PurchaseOrderPrintTemplateData | undefined;
5
+ selectedBlockId?: string | null | undefined;
6
+ templateType?: string | undefined;
7
+ }>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
8
+ blocks: FdoPrintTemplateBlock[];
9
+ previewData?: PurchaseOrderPrintTemplateData | undefined;
10
+ selectedBlockId?: string | null | undefined;
11
+ templateType?: string | undefined;
12
+ }>>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
13
+ export default _default;
14
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
15
+ type __VLS_TypePropsToRuntimeProps<T> = {
16
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
17
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
18
+ } : {
19
+ type: import('vue').PropType<T[K]>;
20
+ required: true;
21
+ };
22
+ };
@@ -0,0 +1,25 @@
1
+ import type { InventoryLocation } from '@/stores/location';
2
+ import type { FmpBusiness } from 'node_modules/@feedmepos/mf-common/dist/store';
3
+ interface PrintPoArgs {
4
+ po: FdoPurchaseOrder;
5
+ currentLocation: InventoryLocation;
6
+ business?: FmpBusiness;
7
+ fulfilling?: boolean;
8
+ por?: FdoPurchaseOrderRequest;
9
+ }
10
+ /**
11
+ * @deprecated Use the legacy printPo from @/views/receive-request/helper/print-po instead.
12
+ * This function was removed to maintain isolation between Print and Print Beta.
13
+ */
14
+ export interface CustomPrintResult {
15
+ html: string;
16
+ templateName: string;
17
+ isDefault: boolean;
18
+ }
19
+ /**
20
+ * Build and return the rendered custom-template HTML for a PO.
21
+ * Returns the HTML string + template name for rendering in a preview dialog.
22
+ * Falls back to predefined template if no saved template exists.
23
+ */
24
+ export declare function buildCustomPrintHtml(args: PrintPoArgs): CustomPrintResult | null;
25
+ export {};
@@ -0,0 +1,88 @@
1
+ import type { PurchaseOrderPrintTemplateData } from '../types/print-data';
2
+ export interface ConfigFieldToggle {
3
+ key: string;
4
+ label: string;
5
+ type: 'toggle';
6
+ value: boolean;
7
+ }
8
+ export interface ConfigFieldText {
9
+ key: string;
10
+ label: string;
11
+ type: 'text';
12
+ value: string;
13
+ placeholder?: string;
14
+ maxLength?: number;
15
+ }
16
+ export interface ConfigFieldTextarea {
17
+ key: string;
18
+ label: string;
19
+ type: 'textarea';
20
+ value: string;
21
+ placeholder?: string;
22
+ rows?: number;
23
+ }
24
+ export interface ConfigFieldNumber {
25
+ key: string;
26
+ label: string;
27
+ type: 'number';
28
+ value: number;
29
+ min?: number;
30
+ max?: number;
31
+ step?: number;
32
+ unit?: string;
33
+ }
34
+ export interface ConfigFieldSelect {
35
+ key: string;
36
+ label: string;
37
+ type: 'select';
38
+ value: string;
39
+ options: {
40
+ label: string;
41
+ value: string;
42
+ }[];
43
+ }
44
+ export interface ConfigFieldColor {
45
+ key: string;
46
+ label: string;
47
+ type: 'color';
48
+ value: string;
49
+ }
50
+ export type ConfigField = ConfigFieldToggle | ConfigFieldText | ConfigFieldTextarea | ConfigFieldNumber | ConfigFieldSelect | ConfigFieldColor;
51
+ /** Build a flat config object from configFields for Handlebars context */
52
+ export declare function configFieldsToValues(fields: ConfigField[]): Record<string, any>;
53
+ export interface BlockDefinition {
54
+ tag: F_PURCHASE_ORDER_PRINT_BLOCK_TYPE;
55
+ label: string;
56
+ icon: string;
57
+ /** Handlebars partial template string */
58
+ template: string;
59
+ /** Return initial config fields with values for a new block */
60
+ initialConfigFields: () => ConfigField[];
61
+ }
62
+ export declare const BLOCK_DEFINITIONS: Record<F_PURCHASE_ORDER_PRINT_BLOCK_TYPE, BlockDefinition>;
63
+ /**
64
+ * Compile a block's Handlebars template with config values.
65
+ * Resolves config conditionals (e.g. {{#if showCode}}) but preserves
66
+ * data placeholders (e.g. {{orderNumber}}, {{#each items}}).
67
+ *
68
+ * The trick: we compile the template passing config values as top-level context,
69
+ * but also pass stub data so data placeholders remain as literal output.
70
+ * Since Handlebars outputs empty string for undefined variables, we use a
71
+ * two-pass approach: first pass resolves config, second pass is at print time.
72
+ *
73
+ * Actually, for simplicity and reliability, we store the raw template string
74
+ * with config values embedded — the config conditionals are part of the
75
+ * Handlebars template and will be resolved at render time using the saved
76
+ * config values. The templateHtml IS the raw Handlebars template from
77
+ * BLOCK_DEFINITIONS, but frozen at the point of save so future code changes
78
+ * to BLOCK_DEFINITIONS don't affect saved templates.
79
+ */
80
+ export declare function compileBlockTemplateHtml(tag: string, configFields: ConfigField[]): string;
81
+ /** Build a block config from a BlockDefinition — creates configFields and compiles templateHtml */
82
+ export declare function buildBlockConfig(tag: F_PURCHASE_ORDER_PRINT_BLOCK_TYPE): Record<string, any>;
83
+ /** Default preset matching the current hardcoded layout */
84
+ export declare function getDefaultBlocks(): FdoPrintTemplateBlock[];
85
+ /** Generate a unique block ID */
86
+ export declare function generateBlockId(): string;
87
+ /** Sample data for live preview */
88
+ export declare function getSamplePrintData(templateType?: string): PurchaseOrderPrintTemplateData;
@@ -0,0 +1,22 @@
1
+ export interface PredefinedTemplate {
2
+ id: string;
3
+ name: string;
4
+ description: string;
5
+ blocks: FdoPrintTemplateBlock[];
6
+ }
7
+ /**
8
+ * Predefined templates per document type.
9
+ *
10
+ * Each template's blocks include pre-compiled config.templateHtml and config.configFields.
11
+ * Cloning a predefined template copies everything — the saved template is fully
12
+ * independent and won't be affected by future code changes to BLOCK_DEFINITIONS.
13
+ *
14
+ * To add a new predefined template: simply add a new entry to the array for
15
+ * the relevant type. No DB migration or backend change needed.
16
+ */
17
+ export declare const PREDEFINED_TEMPLATES: Record<F_PRINT_TEMPLATE_TYPE, PredefinedTemplate[]>;
18
+ /**
19
+ * Get the default predefined template for a document type.
20
+ * Used as a fallback when no saved template exists.
21
+ */
22
+ export declare function getDefaultPredefinedTemplate(type: F_PRINT_TEMPLATE_TYPE): PredefinedTemplate;
@@ -0,0 +1,17 @@
1
+ import type { PurchaseOrderPrintTemplateData } from '../types/print-data';
2
+ /**
3
+ * Render a print template with data.
4
+ *
5
+ * For each block:
6
+ * - If config.templateHtml exists (saved/predefined template), use it directly
7
+ * - Otherwise fall back to BLOCK_DEFINITIONS[tag].template (backward compat for old templates)
8
+ *
9
+ * Config values come from config.configFields (new) or are merged from
10
+ * BLOCK_DEFINITIONS defaultConfig (old backward compat).
11
+ */
12
+ export declare function renderTemplate(blocks: FdoPrintTemplateBlock[], data: PurchaseOrderPrintTemplateData): string;
13
+ /**
14
+ * Render for the print preview (full page).
15
+ * Wraps in a basic HTML document structure.
16
+ */
17
+ export declare function renderTemplateForPrint(blocks: FdoPrintTemplateBlock[], data: PurchaseOrderPrintTemplateData): string;
@@ -0,0 +1,11 @@
1
+ export type { PurchaseOrderPrintTemplateData } from './types/print-data';
2
+ export { usePrintTemplateStore } from './store/print-template';
3
+ export { usePrintTemplateApi } from './api/print-template';
4
+ export { BLOCK_DEFINITIONS, getDefaultBlocks, generateBlockId, buildBlockConfig, compileBlockTemplateHtml, configFieldsToValues, type ConfigField, type ConfigFieldToggle, type ConfigFieldText, type ConfigFieldTextarea, type ConfigFieldNumber, type ConfigFieldSelect, type ConfigFieldColor, type BlockDefinition } from './definitions/block-definitions';
5
+ export { renderTemplate, renderTemplateForPrint } from './definitions/template-renderer';
6
+ export { PREDEFINED_TEMPLATES, getDefaultPredefinedTemplate, type PredefinedTemplate } from './definitions/predefined-templates';
7
+ export { buildCustomPrintHtml, type CustomPrintResult } from './composables/print-po-with-template';
8
+ export { default as PrintTemplateEditorDialog } from './components/PrintTemplateEditorDialog.vue';
9
+ export { default as CustomPrintTemplatePreview } from './components/CustomPrintTemplatePreview.vue';
10
+ export { default as BlockConfigPanel } from './components/BlockConfigPanel.vue';
11
+ export { default as TemplatePreview } from './components/TemplatePreview.vue';
@@ -0,0 +1,170 @@
1
+ import type { F_PRINT_TEMPLATE_TYPE } from '@feedmepos/zod-inventory';
2
+ export declare const usePrintTemplateStore: import("pinia").StoreDefinition<"printTemplate", import("pinia")._UnwrapAll<Pick<{
3
+ templates: import("vue").Ref<{
4
+ _id: string;
5
+ name: string;
6
+ type: "purchaseOrder" | "deliveryOrder" | "transferOrder" | "goodsReceivedNote";
7
+ businessId: string;
8
+ createdAt: string;
9
+ updatedAt: string;
10
+ blocks: {
11
+ config?: Record<string, any> | undefined;
12
+ id: string;
13
+ tag: string;
14
+ }[];
15
+ }[], {
16
+ _id: string;
17
+ name: string;
18
+ type: "purchaseOrder" | "deliveryOrder" | "transferOrder" | "goodsReceivedNote";
19
+ businessId: string;
20
+ createdAt: string;
21
+ updatedAt: string;
22
+ blocks: {
23
+ config?: Record<string, any> | undefined;
24
+ id: string;
25
+ tag: string;
26
+ }[];
27
+ }[] | {
28
+ _id: string;
29
+ name: string;
30
+ type: "purchaseOrder" | "deliveryOrder" | "transferOrder" | "goodsReceivedNote";
31
+ businessId: string;
32
+ createdAt: string;
33
+ updatedAt: string;
34
+ blocks: {
35
+ config?: Record<string, any> | undefined;
36
+ id: string;
37
+ tag: string;
38
+ }[];
39
+ }[]>;
40
+ loading: import("vue").Ref<boolean, boolean>;
41
+ fetched: import("vue").Ref<boolean, boolean>;
42
+ templateByType: import("vue").ComputedRef<Partial<Record<"purchaseOrder" | "deliveryOrder" | "transferOrder" | "goodsReceivedNote", {
43
+ _id: string;
44
+ name: string;
45
+ type: "purchaseOrder" | "deliveryOrder" | "transferOrder" | "goodsReceivedNote";
46
+ businessId: string;
47
+ createdAt: string;
48
+ updatedAt: string;
49
+ blocks: {
50
+ config?: Record<string, any> | undefined;
51
+ id: string;
52
+ tag: string;
53
+ }[];
54
+ }>>>;
55
+ fetchTemplates: () => Promise<void>;
56
+ getTemplateByType: (type: F_PRINT_TEMPLATE_TYPE) => FdoPrintTemplate | undefined;
57
+ invalidate: () => void;
58
+ }, "loading" | "templates" | "fetched">>, Pick<{
59
+ templates: import("vue").Ref<{
60
+ _id: string;
61
+ name: string;
62
+ type: "purchaseOrder" | "deliveryOrder" | "transferOrder" | "goodsReceivedNote";
63
+ businessId: string;
64
+ createdAt: string;
65
+ updatedAt: string;
66
+ blocks: {
67
+ config?: Record<string, any> | undefined;
68
+ id: string;
69
+ tag: string;
70
+ }[];
71
+ }[], {
72
+ _id: string;
73
+ name: string;
74
+ type: "purchaseOrder" | "deliveryOrder" | "transferOrder" | "goodsReceivedNote";
75
+ businessId: string;
76
+ createdAt: string;
77
+ updatedAt: string;
78
+ blocks: {
79
+ config?: Record<string, any> | undefined;
80
+ id: string;
81
+ tag: string;
82
+ }[];
83
+ }[] | {
84
+ _id: string;
85
+ name: string;
86
+ type: "purchaseOrder" | "deliveryOrder" | "transferOrder" | "goodsReceivedNote";
87
+ businessId: string;
88
+ createdAt: string;
89
+ updatedAt: string;
90
+ blocks: {
91
+ config?: Record<string, any> | undefined;
92
+ id: string;
93
+ tag: string;
94
+ }[];
95
+ }[]>;
96
+ loading: import("vue").Ref<boolean, boolean>;
97
+ fetched: import("vue").Ref<boolean, boolean>;
98
+ templateByType: import("vue").ComputedRef<Partial<Record<"purchaseOrder" | "deliveryOrder" | "transferOrder" | "goodsReceivedNote", {
99
+ _id: string;
100
+ name: string;
101
+ type: "purchaseOrder" | "deliveryOrder" | "transferOrder" | "goodsReceivedNote";
102
+ businessId: string;
103
+ createdAt: string;
104
+ updatedAt: string;
105
+ blocks: {
106
+ config?: Record<string, any> | undefined;
107
+ id: string;
108
+ tag: string;
109
+ }[];
110
+ }>>>;
111
+ fetchTemplates: () => Promise<void>;
112
+ getTemplateByType: (type: F_PRINT_TEMPLATE_TYPE) => FdoPrintTemplate | undefined;
113
+ invalidate: () => void;
114
+ }, "templateByType">, Pick<{
115
+ templates: import("vue").Ref<{
116
+ _id: string;
117
+ name: string;
118
+ type: "purchaseOrder" | "deliveryOrder" | "transferOrder" | "goodsReceivedNote";
119
+ businessId: string;
120
+ createdAt: string;
121
+ updatedAt: string;
122
+ blocks: {
123
+ config?: Record<string, any> | undefined;
124
+ id: string;
125
+ tag: string;
126
+ }[];
127
+ }[], {
128
+ _id: string;
129
+ name: string;
130
+ type: "purchaseOrder" | "deliveryOrder" | "transferOrder" | "goodsReceivedNote";
131
+ businessId: string;
132
+ createdAt: string;
133
+ updatedAt: string;
134
+ blocks: {
135
+ config?: Record<string, any> | undefined;
136
+ id: string;
137
+ tag: string;
138
+ }[];
139
+ }[] | {
140
+ _id: string;
141
+ name: string;
142
+ type: "purchaseOrder" | "deliveryOrder" | "transferOrder" | "goodsReceivedNote";
143
+ businessId: string;
144
+ createdAt: string;
145
+ updatedAt: string;
146
+ blocks: {
147
+ config?: Record<string, any> | undefined;
148
+ id: string;
149
+ tag: string;
150
+ }[];
151
+ }[]>;
152
+ loading: import("vue").Ref<boolean, boolean>;
153
+ fetched: import("vue").Ref<boolean, boolean>;
154
+ templateByType: import("vue").ComputedRef<Partial<Record<"purchaseOrder" | "deliveryOrder" | "transferOrder" | "goodsReceivedNote", {
155
+ _id: string;
156
+ name: string;
157
+ type: "purchaseOrder" | "deliveryOrder" | "transferOrder" | "goodsReceivedNote";
158
+ businessId: string;
159
+ createdAt: string;
160
+ updatedAt: string;
161
+ blocks: {
162
+ config?: Record<string, any> | undefined;
163
+ id: string;
164
+ tag: string;
165
+ }[];
166
+ }>>>;
167
+ fetchTemplates: () => Promise<void>;
168
+ getTemplateByType: (type: F_PRINT_TEMPLATE_TYPE) => FdoPrintTemplate | undefined;
169
+ invalidate: () => void;
170
+ }, "fetchTemplates" | "getTemplateByType" | "invalidate">>;
@@ -0,0 +1,52 @@
1
+ export interface PurchaseOrderPrintTemplateData {
2
+ title?: string;
3
+ businessName?: string;
4
+ logo?: string | null;
5
+ orderNumber: string;
6
+ createdAt: string;
7
+ ref: string;
8
+ remark: string;
9
+ supplier: {
10
+ name: string;
11
+ phoneNumber?: string;
12
+ registrationNumber?: string;
13
+ line1: string;
14
+ line2?: string;
15
+ postcode: string;
16
+ city: string;
17
+ state: string;
18
+ country: string;
19
+ };
20
+ buyer: {
21
+ name: string;
22
+ legalName?: string;
23
+ registrationNumber?: string;
24
+ line1: string;
25
+ line2?: string;
26
+ postcode: string;
27
+ city: string;
28
+ state: string;
29
+ country: string;
30
+ };
31
+ items: {
32
+ code: string;
33
+ description: string;
34
+ quantity: string;
35
+ unit: string;
36
+ received: string;
37
+ unitCost?: string;
38
+ cost?: string;
39
+ }[];
40
+ status: FdoPurchaseOrder['status'];
41
+ deliveryOrders: {
42
+ createdAt: string;
43
+ ref: string;
44
+ remark: string;
45
+ items: {
46
+ code: string;
47
+ description: string;
48
+ quantity: string;
49
+ unit: string;
50
+ }[];
51
+ }[];
52
+ }
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Sanitize HTML to prevent XSS attacks while preserving print template styling
3
+ *
4
+ * This utility provides a centralized configuration for DOMPurify to ensure
5
+ * consistent security across all print template components.
6
+ *
7
+ * @param html - The HTML string to sanitize
8
+ * @returns Sanitized HTML string safe for rendering
9
+ */
10
+ export declare function sanitizeTemplateHtml(html: string): string;
11
+ /**
12
+ * Sanitize user input in config fields to prevent XSS attacks
13
+ *
14
+ * Only sanitizes the 'content' field in customText blocks where users can enter arbitrary HTML.
15
+ * Other fields are safe and should not be sanitized to preserve their intended values.
16
+ *
17
+ * @param fields - Array of config fields
18
+ * @param blockTag - The block tag to determine which fields need sanitization
19
+ * @returns Array of config fields with sanitized values
20
+ */
21
+ export declare function sanitizeConfigFields(fields: ConfigField[], blockTag: string): ConfigField[];
22
+ /**
23
+ * Sanitize all blocks before saving to database
24
+ *
25
+ * Ensures customText block's content field is sanitized to prevent XSS.
26
+ * Template HTML from block definitions is not sanitized as it's from trusted source.
27
+ *
28
+ * @param blocks - Array of template blocks
29
+ * @returns Array of blocks with sanitized content
30
+ */
31
+ export declare function sanitizeBlocks(blocks: FdoPrintTemplateBlock[]): FdoPrintTemplateBlock[];
32
+ import type { ConfigField } from '../definitions/block-definitions';