@feedmepos/mf-inventory-portal 1.8.0-dev.1 → 1.8.0-dev.10
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-BjFIh5km.js +1466 -0
- package/dist/{ApprovalView-C8_ax05b.js → ApprovalView-CauRuf64.js} +26 -25
- package/dist/{BindingsDialog-t0ZY9eh5.js → BindingsDialog-U-tzIfGX.js} +2 -2
- package/dist/{BindingsPicker-C0Qblmml.js → BindingsPicker-CV_oghtz.js} +2 -2
- package/dist/{BindingsTable-CsqUBbRA.js → BindingsTable-TKSQxAxV.js} +4 -4
- package/dist/{BulkReceiveRequestView-DAG-TMox.js → BulkReceiveRequestView-Cyeq26qc.js} +21 -21
- package/dist/ChangeLocationComponent.vue_vue_type_script_setup_true_lang-BpJhboKU.js +151 -0
- package/dist/{ClosingDraftView-CdKp4Ny6.js → ClosingDraftView-UqeHsxyJ.js} +748 -746
- package/dist/ClosingHistoryView-Cr6cQq6j.js +769 -0
- package/dist/{ClosingTemplateView-C326DL4q.js → ClosingTemplateView-DZ0Mdc87.js} +303 -291
- package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-CXjubRbj.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-C-OsCTxZ.js} +1 -1
- package/dist/{DefaultView-CsIMmQAY.js → DefaultView-DQKHG5Jl.js} +2 -2
- package/dist/{DeliveryOrderPrintPreview-eTrMvJzA.js → DeliveryOrderPrintPreview-Z_kBbMMO.js} +2 -2
- package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-B7nBbxMo.js → EmailDialog.vue_vue_type_script_setup_true_lang-Ce6Ly9pT.js} +6228 -6216
- package/dist/FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-BUYI8koH.js +47 -0
- package/dist/FeatureCapabilityGate-DOn2IVJb.js +74 -0
- package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-CI2KTzDs.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-BJuo4lEh.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Db_FiSRe.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DZxz5hbo.js} +2 -2
- package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CiBhz5sq.js +120 -0
- package/dist/FmMultiselectDialog-Bx9cLdYs.js +123 -0
- package/dist/{FmMultiselectDialog-CYUxtxnS.js → FmMultiselectDialog-DvaWLGY5.js} +2 -2
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-DOkV11NN.js → FmUnitInput.vue_vue_type_script_setup_true_lang-D6f1M96D.js} +72 -73
- package/dist/ImportView-1-cjN7ay.js +1290 -0
- package/dist/{IngredientsView-CZ6E7cXf.js → IngredientsView-JfKlUU2E.js} +656 -649
- package/dist/{IntegrationExplorerView-B15ND4Fg.js → IntegrationExplorerView-uElgWH8i.js} +602 -614
- package/dist/IntegrationPlatformView-g2dU5SG6.js +13061 -0
- package/dist/{IntegrationView-hkNhsqx2.js → IntegrationView-B9g888K4.js} +2956 -2922
- package/dist/{InventoryBindingForm-SfuUF0_O.js → InventoryBindingForm-DfGOKZWg.js} +1 -1
- package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-CNjTdNL7.js +472 -0
- package/dist/{InventoryBindingSummary-DUcukkyJ.js → InventoryBindingSummary-CSii8B2X.js} +1 -1
- package/dist/JsonViewer.vue_vue_type_script_setup_true_lang-C_hg75l0.js +25 -0
- package/dist/NumberPrecisionInput.vue_vue_type_script_setup_true_lang-D_Xk4SOH.js +79 -0
- package/dist/PlanTierBadge.vue_vue_type_script_setup_true_lang-DJvfMOND.js +274 -0
- package/dist/PlanUpgradeDialog.vue_vue_type_script_setup_true_lang-Bdjm0Y4w.js +79 -0
- package/dist/{ProductionRunDetailView-BwgRX-14.js → ProductionRunDetailView-HgH2Wp99.js} +4 -4
- package/dist/{ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-BbNXNhpr.js → ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-C88pjV2s.js} +9 -9
- package/dist/{ProductionRunView-CZU7LY9-.js → ProductionRunView-BkvQHeCP.js} +16 -15
- package/dist/{PublishView-DS2FZ66p.js → PublishView-CIei_T5e.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-CZa0MVAs.js → PurchaseOrderPrintPreview-Wmv7676h.js} +2 -2
- package/dist/{ReceiveRequestView-Bk5b3nVB.js → ReceiveRequestView-MqOIpIDB.js} +15 -15
- package/dist/RecipeView-WzXJX4JU.js +3440 -0
- package/dist/SettingsView-1YlgjyzB.js +1032 -0
- package/dist/StockView-C-dIRXPv.js +2651 -0
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DdZg9T4n.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-CewKTZzy.js} +1 -1
- package/dist/{SupplierView-D8q6siZW.js → SupplierView-53rHhQ63.js} +577 -571
- package/dist/{SurchargeView-Db_5YFoR.js → SurchargeView-DuJb5EUn.js} +7 -7
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-WOVs4Fr1.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-C_YmC-ZX.js} +2 -2
- package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-gJQQKKAC.js +71 -0
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-BtoP4XgE.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CyQujMzv.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-Bljc4Vuy.js → TransferDetails.vue_vue_type_script_setup_true_lang-CMwqjlb0.js} +1722 -1672
- package/dist/TransferTemplateView-B6OGfKQr.js +2343 -0
- package/dist/{UnitCostHistoryView-BqDiQ4IE.js → UnitCostHistoryView-BVlq4BNG.js} +4 -4
- package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-BjSmg5LX.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-CULJEeCU.js} +4 -4
- package/dist/{UnitView-CM695-VI.js → UnitView-AuIJokVF.js} +84 -84
- package/dist/{WarehouseView-BdidU4p6.js → WarehouseView-Cjv8S1ov.js} +194 -189
- package/dist/{WastageTemplateView-DdhwdXT6.js → WastageTemplateView-mxSTzVSZ.js} +19 -18
- package/dist/api/feature-flags.d.ts +12 -0
- package/dist/api/integration-sync-log.d.ts +0 -13
- package/dist/api/inventory.d.ts +9 -9
- package/dist/api/license.d.ts +8 -0
- package/dist/{app-Cb5s4jMu.js → app-OztWApio.js} +6085 -6053
- package/dist/app.d.ts +36 -150
- package/dist/app.js +1 -1
- package/dist/{closing-template-DnqnpXxn.js → closing-template-DIxXDgZQ.js} +1 -1
- package/dist/components/ChangeLocationComponent.vue.d.ts +21 -14
- package/dist/components/DeprecateSoonWarningDialog.vue.d.ts +22 -0
- package/dist/components/FeatureCapabilityBadge.vue.d.ts +29 -0
- package/dist/components/FeatureCapabilityGate.spec.d.ts +1 -0
- package/dist/components/FeatureCapabilityGate.vue.d.ts +29 -0
- package/dist/components/FmUnitInputRules.d.ts +1 -1
- package/dist/components/MultiLocationSelector.vue.d.ts +6 -6
- package/dist/components/NumberPrecisionInput.spec.d.ts +1 -0
- package/dist/components/{PremiumBadge.vue.d.ts → PlanTierBadge.vue.d.ts} +5 -13
- package/dist/components/PlanUpgradeDialog.vue.d.ts +30 -0
- package/dist/composable/useNavigationMenu.d.ts +2 -1
- package/dist/{date2-BPhD_1Of.js → date2-BTzYzk-x.js} +1 -1
- package/dist/{dayjs.min-Zbd6-uVD.js → dayjs.min-BIg6CfC4.js} +1 -1
- package/dist/{decimal-Df6a50Ld.js → decimal-B34w3X7O.js} +2 -2
- package/dist/{defineDeepModel-Brbsikbi.js → defineDeepModel-CrZAv12u.js} +1 -1
- package/dist/{duplicate-template-B9kuShaF.js → duplicate-template-BKVPhi40.js} +1 -1
- package/dist/{inventory-core-dart.default-DDRxXXnt.js → feature-BUVZ_ab3.js} +766 -398
- package/dist/feature-flags/core.d.ts +28 -0
- package/dist/feature-flags/core.spec.d.ts +1 -0
- package/dist/feature-flags/navigation-capabilities.d.ts +23 -0
- package/dist/feature-flags/navigation-capabilities.spec.d.ts +1 -0
- package/dist/feature-flags/plan-tier.d.ts +6 -0
- package/dist/feature-flags/plan-tier.spec.d.ts +1 -0
- package/dist/feature-flags/portal-feature-catalog.d.ts +19 -0
- package/dist/feature-flags/portal-feature-catalog.spec.d.ts +1 -0
- package/dist/feature-flags/vue.d.ts +16 -0
- package/dist/feature-flags/vue.spec.d.ts +1 -0
- package/dist/{format-time-from-id-DmUjUcVj.js → format-time-from-id-DGLxhRFH.js} +1 -1
- package/dist/{format-unit-display-CsQA0SQd.js → format-unit-display-BhudItCc.js} +118 -119
- package/dist/helper/menu-usage-module.d.ts +1 -1
- package/dist/helper/number.d.ts +5 -1
- package/dist/helper/rules.d.ts +1 -1
- package/dist/id-to-date-BfwadWDS.js +67 -0
- package/dist/{import-export.helper-DCQ6oX9s.js → import-export.helper-BdQ_d-fT.js} +16 -17
- package/dist/{index-UmM6gHJ1.js → index-BTNI4XZ2.js} +1 -1
- package/dist/{index-C-mazZwS.js → index-B_hoeQNL.js} +3 -3
- package/dist/{JsonViewer.vue_vue_type_script_setup_true_lang-ig2zSXAB.js → index-C25C1Dg7.js} +1074 -1066
- package/dist/{index-BXaIMGnI.js → index-CCvxPS3E.js} +1 -1
- package/dist/index-eGvSlWMU.js +1892 -0
- package/dist/{lz-string-Bibw5D_6.js → lz-string-CVEGZpSC.js} +1 -1
- package/dist/{netsuite-Bev0OtQT.js → netsuite-DEhdSyBn.js} +9 -3
- package/dist/{predefined-templates-BHvUnTk_.js → predefined-templates-BTdQl7jj.js} +1 -1
- package/dist/{purchase-order-template-DgOKEzhS.js → purchase-order-template-DfMmpsrJ.js} +1 -1
- package/dist/{recalculationUtils-Dv__DzZh.js → recalculationUtils-Ds9Jcg0l.js} +1 -1
- package/dist/router/name.d.ts +2 -2
- package/dist/{row-action.enum-ncgDYAjP.js → row-action.enum-B2Y5YFbc.js} +2 -2
- package/dist/rules-D01xYhgI.js +238 -0
- package/dist/{stock-CxCRZo_D.js → stock-D3kBNq3e.js} +1 -1
- package/dist/stock-DyTC4Teu.js +74 -0
- package/dist/stores/feature.d.ts +20 -2
- package/dist/stores/integration/netsuite.d.ts +2 -2
- package/dist/stores/inventory.d.ts +0 -47
- package/dist/stores/inventory.no-location.spec.d.ts +1 -0
- package/dist/stores/location.d.ts +42 -42
- package/dist/stores/supplier.d.ts +49 -49
- package/dist/stores/warehouse.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/{supplier-CkZdeMcl.js → supplier-DaidezrO.js} +2 -2
- package/dist/{surcharge-FRSFqjGl.js → surcharge-C-PFvvlU.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{uom-rules-Cm1styDr.js → uom-rules-Un5bhcrm.js} +1 -1
- package/dist/{use-ingredient-select-dialog-ntAqHX04.js → use-ingredient-select-dialog-DV_hkAt9.js} +2 -2
- package/dist/use-inventory-binding-dialog-CTceyFrg.js +113 -0
- package/dist/{use-template-enabled-locations-CIZqw-Z8.js → use-template-enabled-locations-DGqw8tvz.js} +2 -2
- package/dist/{use-transfer-locations-CM5vNttA.js → use-transfer-locations-DgtKajec.js} +2 -2
- package/dist/{useHrmPermission-CslLuBoP.js → useHrmPermission-BMpZlah6.js} +1 -1
- package/dist/useNavigationMenu-D0NtXAnB.js +346 -0
- package/dist/{useSseClient-CCV4mPzD.js → useSseClient-CHZZxy7Z.js} +1 -1
- package/dist/views/adjustment-template/wastage-template/actions.d.ts +36 -36
- package/dist/views/adjustment-template/wastage-template/table.d.ts +36 -36
- package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftApprovalDialog.vue.d.ts +6 -6
- package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +12 -12
- package/dist/views/closing-draft/components/closing-draft-groups/ClosingGroupDetailSideSheet.vue.d.ts +6 -6
- package/dist/views/closing-draft/composables/use-closing-draft-import.d.ts +3 -3
- package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +18 -18
- package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +45 -45
- package/dist/views/closing-template/composables/use-closing-template-table.d.ts +36 -36
- package/dist/views/ingredients/components/inventory-binding/InventoryBindingForm.vue.d.ts +0 -1
- package/dist/views/ingredients/components/inventory-binding/composables/use-inventory-binding-dialog.d.ts +0 -1
- package/dist/views/ingredients/components/inventory-binding/recipe-amount-validation.spec.d.ts +1 -0
- package/dist/views/ingredients/components/inventory-binding/v2/InventoryBindingFormV2.vue.d.ts +0 -1
- package/dist/views/ingredients/components/inventory-binding/v2/composables/use-inventory-binding-dialog.d.ts +0 -1
- package/dist/views/ingredients/helper/is-linked-ingredient-error.d.ts +1 -1
- package/dist/{components/PreviewBadge.vue.d.ts → views/integration/IntegrationPlatformView.vue.d.ts} +11 -13
- package/dist/views/integration/components/IntegrationCard.vue.d.ts +38 -0
- package/dist/views/integration/components/Synergy/importFn.spec.d.ts +1 -0
- package/dist/views/integration/components/Xilnex/importFn.spec.d.ts +1 -0
- package/dist/views/integration/components/netsuite/business/AddLocationDialog.vue.d.ts +36 -36
- package/dist/views/integration/components/netsuite/business/AddVendorDialog.vue.d.ts +24 -24
- package/dist/views/integration/helper/opening-balance.d.ts +22 -0
- package/dist/views/integration/helper/opening-balance.spec.d.ts +1 -0
- package/dist/views/receive-request/components/transfer-form/TransferFormWithController.vue.d.ts +5 -5
- package/dist/views/receive-request/composables/netsuite-order-label.d.ts +11 -0
- package/dist/views/receive-request/composables/netsuite-order-label.spec.d.ts +1 -0
- package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +5 -5
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +39 -39
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +35 -35
- package/dist/views/receive-request/import/export.spec.d.ts +1 -0
- package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-form.d.ts +34 -34
- package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-table.d.ts +6 -6
- package/dist/views/recipe/components/recipe-bulk-editor/components/ModificationCard.spec.d.ts +1 -0
- package/dist/views/recipe/helper/bulk-edit-simulation.helper.d.ts +0 -1
- package/dist/views/recipe/helper/import-recipe.d.ts +2 -2
- package/dist/views/recipe/helper/import-recipe.spec.d.ts +1 -0
- package/dist/views/{ingredient-group/IngredientGroupView.vue.d.ts → settings/FeatureFlagView.vue.d.ts} +0 -1
- package/dist/views/settings/PlanLicenseDisplay.spec.d.ts +1 -0
- package/dist/views/{integration/components/IntegrationSyncLogTab.vue.d.ts → settings/PlanLicenseDisplay.vue.d.ts} +2 -2
- package/dist/views/stock/components/dialog/AmendAdjustmentForm.spec.d.ts +1 -0
- package/dist/views/stock/components/dialog/ConvertSkuDialog.spec.d.ts +1 -0
- package/dist/views/supplier/components/SupplierForm.vue.d.ts +4 -4
- package/dist/views/supplier/composables/use-supplier-table.d.ts +2 -2
- package/dist/views/transfer-template/components/transfer-template-dialog/TransferTemplateDialog.vue.d.ts +8 -8
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-locations.d.ts +4 -4
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.spec.d.ts +1 -0
- package/dist/views/transfer-template/composables/use-template-item-bulk-editor.d.ts +24 -24
- package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +48 -48
- package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +48 -48
- package/dist/views/warehouse/components/WarehouseForm.vue.d.ts +2 -2
- package/dist/{vue-i18n-C5j4EQhi.js → vue-i18n-mXrQUZTi.js} +519 -519
- package/dist/{xlsx.util-B50OvX4z.js → xlsx.util-CKx0NYTq.js} +2 -2
- package/package.json +71 -66
- package/dist/App-BXgpGzGR.js +0 -1476
- package/dist/ClosingHistoryView-Blyq9-BS.js +0 -761
- package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-zcEv1Swg.js +0 -243
- package/dist/FmMultiselectDialog-BAw-gp5K.js +0 -77
- package/dist/ImportView-BmotFC-3.js +0 -1302
- package/dist/IngredientBindedItem.vue_vue_type_script_setup_true_lang-DVCCpvS4.js +0 -51
- package/dist/IngredientGroupView-qrR9ksEn.js +0 -985
- package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-Zq81p_MF.js +0 -563
- package/dist/NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BmfROiLM.js +0 -72
- package/dist/PremiumBadge.vue_vue_type_script_setup_true_lang-3e3kDsbN.js +0 -93
- package/dist/PreviewBadge.vue_vue_type_script_setup_true_lang-DX2MJqL4.js +0 -29
- package/dist/RecipeView-DvI6X-uN.js +0 -3625
- package/dist/SettingsView-sThYErMz.js +0 -698
- package/dist/StockView-Z9wGihT7.js +0 -2612
- package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-DAMpuZ1X.js +0 -84
- package/dist/TransferTemplateView-DtsJzmUr.js +0 -2327
- package/dist/feature-Ckn5ra3z.js +0 -1136
- package/dist/number-y_W4pn_d.js +0 -138
- package/dist/random-CSbEbElR.js +0 -10
- package/dist/rules-CZTBvenw.js +0 -98
- package/dist/stock-XINW8JOM.js +0 -75
- package/dist/use-inventory-binding-dialog-DVIJO8Cl.js +0 -152
- package/dist/useNavigationMenu-CSinmNCY.js +0 -172
- package/dist/usePromise-CbVUCxhj.js +0 -29
- package/dist/views/ingredient-group/components/ingredient-group-dialog/IngredientGroupDialog.vue.d.ts +0 -31
- package/dist/views/ingredient-group/components/ingredient-group-dialog/IngredientGroupDialogProps.d.ts +0 -10
- package/dist/views/ingredient-group/components/ingredient-group-form/IngredientGroupForm.vue.d.ts +0 -21
- package/dist/views/ingredient-group/components/ingredient-group-form/IngredientGroupFormProps.d.ts +0 -12
- package/dist/views/ingredient-group/components/ingredient-group-rule-field/IngredientGroupRuleField.vue.d.ts +0 -37
- package/dist/views/ingredient-group/composables/use-ingredient-group-actions.d.ts +0 -24
- package/dist/views/ingredient-group/composables/use-ingredient-group-rule-item.d.ts +0 -31
- package/dist/views/ingredient-group/composables/use-ingredient-group-table.d.ts +0 -77
- package/dist/views/integration/composables/use-integration-sync-log.d.ts +0 -45
- /package/dist/components/{FmFeatureFlagDialog.vue.d.ts → DeprecateSoonPill.vue.d.ts} +0 -0
|
@@ -0,0 +1,1032 @@
|
|
|
1
|
+
import { defineComponent as ee, ref as _, computed as E, watch as j, resolveComponent as L, createElementBlock as i, openBlock as o, createElementVNode as l, toDisplayString as C, Fragment as A, renderList as W, createBlock as O, createCommentVNode as Z, createVNode as m, nextTick as xe, createSlots as he, withCtx as z, normalizeClass as ue, unref as S, withModifiers as ke, h as V, Teleport as we } from "vue";
|
|
2
|
+
import { _ as Fe } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DpwneGOV.js";
|
|
3
|
+
import { B as Y, g as Te, r as Se, s as $e, u as De, a as ae, b as Ce, c as Be, d as be, e as Ve, f as Ie } from "./predefined-templates-BTdQl7jj.js";
|
|
4
|
+
import { useSnackbar as Pe, components as X } from "@feedmepos/ui-library";
|
|
5
|
+
import { _ as ze } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
|
+
import { H as se, I as Oe, u as _e } from "./app-OztWApio.js";
|
|
7
|
+
import { useCoreStore as ye, useI18n as Ee } from "@feedmepos/mf-common";
|
|
8
|
+
import "./dayjs.min-BIg6CfC4.js";
|
|
9
|
+
import { a as Le, b as Ae, I as Ne, u as Ue } from "./feature-BUVZ_ab3.js";
|
|
10
|
+
import { _ as He, D as Me } from "./FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-BUYI8koH.js";
|
|
11
|
+
import { _ as Re } from "./ChangeLocationComponent.vue_vue_type_script_setup_true_lang-BpJhboKU.js";
|
|
12
|
+
import { _ as je, a as Ke } from "./PlanTierBadge.vue_vue_type_script_setup_true_lang-DJvfMOND.js";
|
|
13
|
+
const qe = { class: "p-3" }, Ge = { class: "text-sm font-semibold text-gray-700 mb-4 pb-2 border-b border-gray-200" }, Ye = { class: "flex flex-col gap-3" }, We = {
|
|
14
|
+
key: 0,
|
|
15
|
+
class: "flex items-center justify-between py-1"
|
|
16
|
+
}, Je = { class: "text-[13px] text-gray-600" }, Qe = { class: "text-[13px] text-gray-600" }, Xe = ["value", "rows", "placeholder", "onInput"], Ze = {
|
|
17
|
+
key: 5,
|
|
18
|
+
class: "flex items-center justify-between py-1"
|
|
19
|
+
}, et = { class: "text-[13px] text-gray-600" }, tt = ["value", "onInput"], lt = /* @__PURE__ */ ee({
|
|
20
|
+
__name: "BlockConfigPanel",
|
|
21
|
+
props: {
|
|
22
|
+
block: {}
|
|
23
|
+
},
|
|
24
|
+
emits: ["update"],
|
|
25
|
+
setup(N, { emit: h }) {
|
|
26
|
+
const T = N, k = h;
|
|
27
|
+
function w(n) {
|
|
28
|
+
var g;
|
|
29
|
+
if ((g = n.config) != null && g.configFields && Array.isArray(n.config.configFields)) {
|
|
30
|
+
const f = n.config.configFields.map((d) => ({ ...d })), x = new Set(f.map((d) => d.key)), a = Y[n.tag], D = a ? a.initialConfigFields().filter((d) => !x.has(d.key)) : [];
|
|
31
|
+
return [...f, ...D];
|
|
32
|
+
}
|
|
33
|
+
const r = Y[n.tag];
|
|
34
|
+
return r ? r.initialConfigFields() : [];
|
|
35
|
+
}
|
|
36
|
+
const p = _(w(T.block)), $ = E(() => {
|
|
37
|
+
const n = Y[T.block.tag];
|
|
38
|
+
return (n == null ? void 0 : n.label) ?? T.block.tag;
|
|
39
|
+
});
|
|
40
|
+
j(
|
|
41
|
+
() => T.block,
|
|
42
|
+
(n) => {
|
|
43
|
+
p.value = w(n);
|
|
44
|
+
},
|
|
45
|
+
{ deep: !0 }
|
|
46
|
+
);
|
|
47
|
+
function v(n, r) {
|
|
48
|
+
const g = p.value[n];
|
|
49
|
+
g && (g.value = r, y());
|
|
50
|
+
}
|
|
51
|
+
function y() {
|
|
52
|
+
k("update", {
|
|
53
|
+
...T.block.config || {},
|
|
54
|
+
configFields: p.value.map((n) => ({ ...n }))
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
return (n, r) => {
|
|
58
|
+
const g = L("FmSwitch"), f = L("FmTextField"), x = L("FmSelect");
|
|
59
|
+
return o(), i("div", qe, [
|
|
60
|
+
l("div", Ge, C($.value) + " Settings ", 1),
|
|
61
|
+
l("div", Ye, [
|
|
62
|
+
(o(!0), i(A, null, W(p.value, (a, D) => (o(), i("div", {
|
|
63
|
+
key: a.key
|
|
64
|
+
}, [
|
|
65
|
+
a.type === "toggle" ? (o(), i("div", We, [
|
|
66
|
+
l("label", Je, C(a.label), 1),
|
|
67
|
+
m(g, {
|
|
68
|
+
"model-value": a.value,
|
|
69
|
+
"onUpdate:modelValue": (d) => v(D, d)
|
|
70
|
+
}, null, 8, ["model-value", "onUpdate:modelValue"])
|
|
71
|
+
])) : a.type === "text" ? (o(), O(f, {
|
|
72
|
+
key: 1,
|
|
73
|
+
label: a.label,
|
|
74
|
+
"model-value": a.value,
|
|
75
|
+
placeholder: a.placeholder,
|
|
76
|
+
"onUpdate:modelValue": (d) => v(D, d)
|
|
77
|
+
}, null, 8, ["label", "model-value", "placeholder", "onUpdate:modelValue"])) : a.type === "textarea" ? (o(), i(A, { key: 2 }, [
|
|
78
|
+
l("div", Qe, C(a.label), 1),
|
|
79
|
+
l("textarea", {
|
|
80
|
+
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",
|
|
81
|
+
value: a.value,
|
|
82
|
+
rows: a.rows ?? 8,
|
|
83
|
+
placeholder: a.placeholder,
|
|
84
|
+
onInput: (d) => v(D, d.target.value)
|
|
85
|
+
}, null, 40, Xe)
|
|
86
|
+
], 64)) : a.type === "select" ? (o(), O(x, {
|
|
87
|
+
key: 3,
|
|
88
|
+
label: a.label,
|
|
89
|
+
"model-value": a.value,
|
|
90
|
+
items: a.options || [],
|
|
91
|
+
"item-label": "label",
|
|
92
|
+
"item-value": "value",
|
|
93
|
+
"onUpdate:modelValue": (d) => v(D, d)
|
|
94
|
+
}, null, 8, ["label", "model-value", "items", "onUpdate:modelValue"])) : a.type === "number" ? (o(), O(f, {
|
|
95
|
+
key: 4,
|
|
96
|
+
label: a.label,
|
|
97
|
+
type: "number",
|
|
98
|
+
"model-value": String(a.value),
|
|
99
|
+
"onUpdate:modelValue": (d) => v(D, Number(d))
|
|
100
|
+
}, null, 8, ["label", "model-value", "onUpdate:modelValue"])) : a.type === "color" ? (o(), i("div", Ze, [
|
|
101
|
+
l("label", et, C(a.label), 1),
|
|
102
|
+
l("input", {
|
|
103
|
+
type: "color",
|
|
104
|
+
value: a.value,
|
|
105
|
+
class: "color-input w-9 h-7 p-0 border border-gray-300 rounded cursor-pointer bg-transparent",
|
|
106
|
+
onInput: (d) => v(D, d.target.value)
|
|
107
|
+
}, null, 40, tt)
|
|
108
|
+
])) : Z("", !0)
|
|
109
|
+
]))), 128))
|
|
110
|
+
])
|
|
111
|
+
]);
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
}), ot = /* @__PURE__ */ ze(lt, [["__scopeId", "data-v-840687bf"]]), at = { class: "h-full flex flex-col" }, st = { class: "flex-1 overflow-auto p-4 bg-gray-100" }, nt = /* @__PURE__ */ ee({
|
|
115
|
+
__name: "TemplatePreview",
|
|
116
|
+
props: {
|
|
117
|
+
blocks: {},
|
|
118
|
+
previewData: {},
|
|
119
|
+
selectedBlockId: {},
|
|
120
|
+
templateType: {}
|
|
121
|
+
},
|
|
122
|
+
setup(N) {
|
|
123
|
+
const h = N, T = _(null);
|
|
124
|
+
let k = null;
|
|
125
|
+
function w() {
|
|
126
|
+
return !k && T.value && (k = T.value.attachShadow({ mode: "open" })), k;
|
|
127
|
+
}
|
|
128
|
+
const p = E(() => h.previewData ?? Te(h.templateType));
|
|
129
|
+
j(
|
|
130
|
+
() => [h.blocks, p.value, T.value],
|
|
131
|
+
() => {
|
|
132
|
+
const v = w();
|
|
133
|
+
if (v) {
|
|
134
|
+
try {
|
|
135
|
+
const y = Se(h.blocks, p.value), n = $e(y);
|
|
136
|
+
v.innerHTML = `
|
|
137
|
+
<style>
|
|
138
|
+
:host { display: block; }
|
|
139
|
+
.preview-scale-wrapper {
|
|
140
|
+
transform-origin: top left;
|
|
141
|
+
transform: scale(0.75);
|
|
142
|
+
width: 133.33%;
|
|
143
|
+
}
|
|
144
|
+
.preview-content {
|
|
145
|
+
max-width: 800px;
|
|
146
|
+
margin: auto;
|
|
147
|
+
padding: 30px;
|
|
148
|
+
border: 1px solid #eee;
|
|
149
|
+
box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
|
|
150
|
+
background: white;
|
|
151
|
+
font-size: 16px;
|
|
152
|
+
line-height: 1.5;
|
|
153
|
+
font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;
|
|
154
|
+
color: #555;
|
|
155
|
+
}
|
|
156
|
+
</style>
|
|
157
|
+
<div class="preview-scale-wrapper">
|
|
158
|
+
<div class="preview-content">${n}</div>
|
|
159
|
+
</div>
|
|
160
|
+
`;
|
|
161
|
+
} catch (y) {
|
|
162
|
+
v.innerHTML = `<div style="color:red;padding:20px;">Error rendering template: ${y}</div>`;
|
|
163
|
+
}
|
|
164
|
+
xe(() => $(h.selectedBlockId));
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
{ deep: !0, immediate: !0 }
|
|
168
|
+
), j(
|
|
169
|
+
() => h.selectedBlockId,
|
|
170
|
+
(v) => $(v)
|
|
171
|
+
);
|
|
172
|
+
function $(v) {
|
|
173
|
+
if (!k || (k.querySelectorAll("[data-block-id].highlight").forEach((n) => {
|
|
174
|
+
n.classList.remove("highlight");
|
|
175
|
+
}), !v)) return;
|
|
176
|
+
const y = k.querySelector(`[data-block-id="${v}"]`);
|
|
177
|
+
y && (y.classList.add("highlight"), y.scrollIntoView({ behavior: "smooth", block: "nearest" }));
|
|
178
|
+
}
|
|
179
|
+
return (v, y) => (o(), i("div", at, [
|
|
180
|
+
y[0] || (y[0] = l("div", { class: "text-xs font-semibold text-gray-400 uppercase tracking-wider px-3 py-2 border-b border-gray-200" }, " Live Preview ", -1)),
|
|
181
|
+
l("div", st, [
|
|
182
|
+
l("div", {
|
|
183
|
+
ref_key: "shadowHost",
|
|
184
|
+
ref: T
|
|
185
|
+
}, null, 512)
|
|
186
|
+
])
|
|
187
|
+
]));
|
|
188
|
+
}
|
|
189
|
+
}), rt = { class: "flex items-center gap-2 text-base font-semibold" }, it = { key: 1 }, ut = { key: 2 }, ct = {
|
|
190
|
+
key: 0,
|
|
191
|
+
class: "p-6"
|
|
192
|
+
}, dt = {
|
|
193
|
+
key: 0,
|
|
194
|
+
class: "flex justify-center items-center h-40 text-gray-400"
|
|
195
|
+
}, pt = {
|
|
196
|
+
key: 1,
|
|
197
|
+
class: "grid grid-cols-2 gap-8"
|
|
198
|
+
}, mt = ["onClick"], vt = { 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" }, ft = { class: "text-center" }, yt = { class: "text-sm font-semibold text-gray-700 group-hover:text-blue-700" }, gt = { class: "text-xs text-gray-400 mt-1" }, bt = {
|
|
199
|
+
key: 0,
|
|
200
|
+
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"
|
|
201
|
+
}, _t = {
|
|
202
|
+
key: 1,
|
|
203
|
+
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"
|
|
204
|
+
}, xt = {
|
|
205
|
+
key: 1,
|
|
206
|
+
class: "flex justify-center items-center h-[400px] text-gray-400"
|
|
207
|
+
}, ht = {
|
|
208
|
+
key: 2,
|
|
209
|
+
class: "flex h-[calc(100vh-120px)] border-t border-gray-200"
|
|
210
|
+
}, kt = { class: "w-[280px] border-r border-gray-200 overflow-y-auto shrink-0" }, wt = { class: "px-3 pt-3 pb-2" }, Ft = { class: "flex flex-col" }, Tt = ["onClick"], St = { class: "border-y border-gray-100" }, $t = ["onDragstart", "onDragover", "onDrop", "onClick"], Dt = { class: "flex-1" }, Ct = { class: "flex gap-1 opacity-50 hover:opacity-100" }, Bt = {
|
|
211
|
+
key: 0,
|
|
212
|
+
class: "py-6 px-4 text-center text-gray-400 text-[13px]"
|
|
213
|
+
}, Vt = {
|
|
214
|
+
key: 0,
|
|
215
|
+
class: "border-t border-gray-200"
|
|
216
|
+
}, It = {
|
|
217
|
+
key: 1,
|
|
218
|
+
class: "flex items-center justify-center text-gray-400 text-[13px] py-8"
|
|
219
|
+
}, Pt = { class: "p-3 border-t border-gray-200" }, zt = { class: "flex-1 overflow-hidden" }, Ot = { class: "ml-auto flex gap-2" }, Et = { class: "p-4" }, Lt = { 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" }, At = { class: "p-4" }, Nt = { 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" }, Ut = /* @__PURE__ */ ee({
|
|
220
|
+
__name: "PrintTemplateEditorDialog",
|
|
221
|
+
props: {
|
|
222
|
+
modelValue: { type: Boolean }
|
|
223
|
+
},
|
|
224
|
+
emits: ["update:modelValue", "saved"],
|
|
225
|
+
setup(N, { emit: h }) {
|
|
226
|
+
const T = N, k = h, w = De(), p = Pe(), $ = ye(), v = E({
|
|
227
|
+
get: () => T.modelValue,
|
|
228
|
+
set: (u) => k("update:modelValue", u)
|
|
229
|
+
}), y = _(!1), n = _(!1), r = _(ae()), g = _(null), f = _(se.Enum.purchaseOrder), x = _("Purchase Order Template"), a = _(null), D = _(!1), d = _(!1), I = _("select-type"), J = [
|
|
230
|
+
{
|
|
231
|
+
label: "Purchase Order",
|
|
232
|
+
value: se.Enum.purchaseOrder,
|
|
233
|
+
icon: "receipt_long",
|
|
234
|
+
description: "Customize the layout for purchase order printouts"
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
label: "Transfer Order",
|
|
238
|
+
value: se.Enum.transferOrder,
|
|
239
|
+
icon: "swap_horiz",
|
|
240
|
+
description: "Customize the layout for transfer order printouts"
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
label: "Goods Received Note",
|
|
244
|
+
value: se.Enum.goodsReceivedNote,
|
|
245
|
+
icon: "fact_check",
|
|
246
|
+
description: "Customize the layout for GRN printouts"
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
label: "Delivery Order",
|
|
250
|
+
value: se.Enum.deliveryOrder,
|
|
251
|
+
icon: "local_shipping",
|
|
252
|
+
description: "Customize the layout for delivery order printouts"
|
|
253
|
+
}
|
|
254
|
+
], K = _(/* @__PURE__ */ new Set()), Q = E(
|
|
255
|
+
() => r.value.find((u) => u.id === g.value) ?? null
|
|
256
|
+
), U = _(null), H = _(null);
|
|
257
|
+
j(v, async (u) => {
|
|
258
|
+
if (u) {
|
|
259
|
+
I.value = "select-type", y.value = !0;
|
|
260
|
+
try {
|
|
261
|
+
const e = await w.browse();
|
|
262
|
+
K.value = new Set(e.map((b) => b.type));
|
|
263
|
+
} catch {
|
|
264
|
+
} finally {
|
|
265
|
+
y.value = !1;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}), j(f, async () => {
|
|
269
|
+
g.value = null, await le();
|
|
270
|
+
});
|
|
271
|
+
async function ne(u) {
|
|
272
|
+
f.value = u, await le(), I.value = "editor";
|
|
273
|
+
}
|
|
274
|
+
function te() {
|
|
275
|
+
return {
|
|
276
|
+
purchaseOrder: "Purchase Order Template",
|
|
277
|
+
transferOrder: "Transfer Order Template",
|
|
278
|
+
goodsReceivedNote: "Goods Received Note Template",
|
|
279
|
+
deliveryOrder: "Delivery Order Template"
|
|
280
|
+
}[f.value] ?? "Purchase Order Template";
|
|
281
|
+
}
|
|
282
|
+
async function le() {
|
|
283
|
+
y.value = !0;
|
|
284
|
+
try {
|
|
285
|
+
const u = await w.browse();
|
|
286
|
+
K.value = new Set(u.map((b) => b.type));
|
|
287
|
+
const e = u.find((b) => b.type === f.value);
|
|
288
|
+
e ? (a.value = e._id, x.value = e.name, r.value = e.blocks.map((b) => ({ ...b }))) : (a.value = null, r.value = ae(), x.value = te());
|
|
289
|
+
} catch {
|
|
290
|
+
r.value = ae(), x.value = te();
|
|
291
|
+
} finally {
|
|
292
|
+
y.value = !1;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
function ce(u) {
|
|
296
|
+
const e = {
|
|
297
|
+
id: Be(),
|
|
298
|
+
tag: u,
|
|
299
|
+
config: Ce(u)
|
|
300
|
+
};
|
|
301
|
+
r.value.push(e), g.value = e.id;
|
|
302
|
+
}
|
|
303
|
+
function de(u) {
|
|
304
|
+
const e = r.value.findIndex((b) => b.id === u);
|
|
305
|
+
e >= 0 && (r.value.splice(e, 1), g.value === u && (g.value = null));
|
|
306
|
+
}
|
|
307
|
+
function re(u) {
|
|
308
|
+
const e = r.value.find((b) => b.id === g.value);
|
|
309
|
+
if (e) {
|
|
310
|
+
const b = u.configFields || [], oe = be(e.tag);
|
|
311
|
+
e.config = { configFields: b, templateHtml: oe };
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
function pe(u) {
|
|
315
|
+
U.value = u;
|
|
316
|
+
}
|
|
317
|
+
function me(u, e) {
|
|
318
|
+
u.preventDefault(), H.value = e;
|
|
319
|
+
}
|
|
320
|
+
function ve() {
|
|
321
|
+
H.value = null;
|
|
322
|
+
}
|
|
323
|
+
function fe(u) {
|
|
324
|
+
if (U.value === null || U.value === u) {
|
|
325
|
+
U.value = null, H.value = null;
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
const e = r.value.splice(U.value, 1)[0];
|
|
329
|
+
r.value.splice(u, 0, e), U.value = null, H.value = null;
|
|
330
|
+
}
|
|
331
|
+
function t() {
|
|
332
|
+
U.value = null, H.value = null;
|
|
333
|
+
}
|
|
334
|
+
async function s() {
|
|
335
|
+
var u;
|
|
336
|
+
n.value = !0;
|
|
337
|
+
try {
|
|
338
|
+
const e = (u = $.currentBusiness.value) == null ? void 0 : u._id;
|
|
339
|
+
if (!e)
|
|
340
|
+
throw new Error("Business ID is missing. Please select a business first.");
|
|
341
|
+
const b = r.value.map((c) => {
|
|
342
|
+
var ge;
|
|
343
|
+
const P = ((ge = c.config) == null ? void 0 : ge.configFields) || [], G = be(c.tag, P);
|
|
344
|
+
return {
|
|
345
|
+
...c,
|
|
346
|
+
config: { configFields: P, templateHtml: G }
|
|
347
|
+
};
|
|
348
|
+
}), oe = Ve(b), M = {
|
|
349
|
+
name: x.value,
|
|
350
|
+
type: f.value,
|
|
351
|
+
blocks: oe,
|
|
352
|
+
businessId: e,
|
|
353
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
354
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
355
|
+
};
|
|
356
|
+
let R;
|
|
357
|
+
a.value ? R = await w.update(a.value, {
|
|
358
|
+
_id: a.value,
|
|
359
|
+
...M
|
|
360
|
+
}) : (R = await w.create(M), a.value = R._id), K.value.add(f.value), d.value = !1, p == null || p.open({
|
|
361
|
+
title: "Success",
|
|
362
|
+
message: "Print template saved",
|
|
363
|
+
type: "success"
|
|
364
|
+
}), k("saved", R), v.value = !1;
|
|
365
|
+
} catch (e) {
|
|
366
|
+
p == null || p.open({
|
|
367
|
+
title: "Error",
|
|
368
|
+
message: (e == null ? void 0 : e.message) || "Failed to save template",
|
|
369
|
+
type: "error"
|
|
370
|
+
});
|
|
371
|
+
} finally {
|
|
372
|
+
n.value = !1;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
async function B() {
|
|
376
|
+
if (a.value) {
|
|
377
|
+
n.value = !0;
|
|
378
|
+
try {
|
|
379
|
+
await w.delete(a.value), a.value = null, r.value = ae(), x.value = te(), K.value.delete(f.value), D.value = !1, p == null || p.open({
|
|
380
|
+
title: "Deleted",
|
|
381
|
+
message: "Print template deleted. Default layout will be used.",
|
|
382
|
+
type: "success"
|
|
383
|
+
}), k("saved", null), v.value = !1;
|
|
384
|
+
} catch (u) {
|
|
385
|
+
p == null || p.open({
|
|
386
|
+
title: "Error",
|
|
387
|
+
message: (u == null ? void 0 : u.message) || "Failed to delete template",
|
|
388
|
+
type: "error"
|
|
389
|
+
});
|
|
390
|
+
} finally {
|
|
391
|
+
n.value = !1;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
function q() {
|
|
396
|
+
r.value = ae(), g.value = null;
|
|
397
|
+
}
|
|
398
|
+
function F(u) {
|
|
399
|
+
var e;
|
|
400
|
+
return ((e = Y[u]) == null ? void 0 : e.label) ?? u;
|
|
401
|
+
}
|
|
402
|
+
function ie(u) {
|
|
403
|
+
var e;
|
|
404
|
+
return ((e = Y[u]) == null ? void 0 : e.icon) ?? "widgets";
|
|
405
|
+
}
|
|
406
|
+
return (u, e) => {
|
|
407
|
+
const b = L("FmIcon"), oe = L("FmTextField"), M = L("FmButton"), R = L("FmDialog");
|
|
408
|
+
return o(), i(A, null, [
|
|
409
|
+
m(R, {
|
|
410
|
+
modelValue: v.value,
|
|
411
|
+
"onUpdate:modelValue": e[4] || (e[4] = (c) => v.value = c),
|
|
412
|
+
overlay: !0,
|
|
413
|
+
"close-button": "",
|
|
414
|
+
"max-width": "98vw",
|
|
415
|
+
"max-height": "98vh"
|
|
416
|
+
}, he({
|
|
417
|
+
"dialog-header": z(() => {
|
|
418
|
+
var c;
|
|
419
|
+
return [
|
|
420
|
+
l("div", rt, [
|
|
421
|
+
I.value === "editor" ? (o(), i("button", {
|
|
422
|
+
key: 0,
|
|
423
|
+
class: "flex items-center justify-center w-7 h-7 rounded hover:bg-gray-100 transition-colors text-gray-500",
|
|
424
|
+
onClick: e[0] || (e[0] = (P) => I.value = "select-type")
|
|
425
|
+
}, [
|
|
426
|
+
m(b, {
|
|
427
|
+
name: "arrow_back",
|
|
428
|
+
size: "sm"
|
|
429
|
+
})
|
|
430
|
+
])) : Z("", !0),
|
|
431
|
+
I.value === "select-type" ? (o(), i("span", it, "Print Template Editor")) : (o(), i("span", ut, C((c = J.find((P) => P.value === f.value)) == null ? void 0 : c.label) + " Template", 1))
|
|
432
|
+
])
|
|
433
|
+
];
|
|
434
|
+
}),
|
|
435
|
+
default: z(() => [
|
|
436
|
+
I.value === "select-type" ? (o(), i("div", ct, [
|
|
437
|
+
e[7] || (e[7] = l("p", { class: "text-sm text-gray-500 mb-5" }, " Select a template type to customize its print layout. ", -1)),
|
|
438
|
+
y.value ? (o(), i("div", dt, " Loading... ")) : (o(), i("div", pt, [
|
|
439
|
+
(o(), i(A, null, W(J, (c) => l("div", {
|
|
440
|
+
key: c.value,
|
|
441
|
+
class: ue(["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", {
|
|
442
|
+
"border-blue-500 bg-blue-50/50 shadow-md": f.value === c.value && I.value === "select-type"
|
|
443
|
+
}]),
|
|
444
|
+
onClick: (P) => ne(c.value)
|
|
445
|
+
}, [
|
|
446
|
+
l("div", vt, [
|
|
447
|
+
m(b, {
|
|
448
|
+
name: c.icon,
|
|
449
|
+
size: "sm"
|
|
450
|
+
}, null, 8, ["name"])
|
|
451
|
+
]),
|
|
452
|
+
l("div", ft, [
|
|
453
|
+
l("div", yt, C(c.label), 1),
|
|
454
|
+
l("div", gt, C(c.description), 1)
|
|
455
|
+
]),
|
|
456
|
+
K.value.has(c.value) ? (o(), i("span", bt, "Customized")) : (o(), i("span", _t, "Default"))
|
|
457
|
+
], 10, mt)), 64))
|
|
458
|
+
]))
|
|
459
|
+
])) : y.value ? (o(), i("div", xt, e[8] || (e[8] = [
|
|
460
|
+
l("div", null, "Loading template...", -1)
|
|
461
|
+
]))) : (o(), i("div", ht, [
|
|
462
|
+
l("div", kt, [
|
|
463
|
+
l("div", wt, [
|
|
464
|
+
m(oe, {
|
|
465
|
+
modelValue: x.value,
|
|
466
|
+
"onUpdate:modelValue": e[1] || (e[1] = (c) => x.value = c),
|
|
467
|
+
placeholder: "Template name",
|
|
468
|
+
label: "Template Name"
|
|
469
|
+
}, null, 8, ["modelValue"])
|
|
470
|
+
]),
|
|
471
|
+
e[9] || (e[9] = l("div", { class: "text-xs font-semibold text-gray-400 uppercase tracking-wider px-3 py-2" }, " Add Blocks ", -1)),
|
|
472
|
+
l("div", Ft, [
|
|
473
|
+
(o(!0), i(A, null, W(S(Oe).Values, (c) => (o(), i("div", {
|
|
474
|
+
key: c,
|
|
475
|
+
class: "group flex items-center gap-2 px-3 py-2 cursor-pointer text-[13px] text-gray-600 transition-colors hover:bg-gray-100",
|
|
476
|
+
onClick: (P) => ce(c)
|
|
477
|
+
}, [
|
|
478
|
+
m(b, {
|
|
479
|
+
name: S(Y)[c].icon,
|
|
480
|
+
size: "sm"
|
|
481
|
+
}, null, 8, ["name"]),
|
|
482
|
+
l("span", null, C(S(Y)[c].label), 1),
|
|
483
|
+
m(b, {
|
|
484
|
+
name: "add",
|
|
485
|
+
size: "sm",
|
|
486
|
+
class: "ml-auto opacity-0 text-blue-600 group-hover:opacity-100"
|
|
487
|
+
})
|
|
488
|
+
], 8, Tt))), 128))
|
|
489
|
+
]),
|
|
490
|
+
e[10] || (e[10] = l("div", { class: "text-xs font-semibold text-gray-400 uppercase tracking-wider px-3 py-2 mt-2" }, " Block Order ", -1)),
|
|
491
|
+
l("div", St, [
|
|
492
|
+
(o(!0), i(A, null, W(r.value, (c, P) => (o(), i("div", {
|
|
493
|
+
key: c.id,
|
|
494
|
+
class: ue(["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", {
|
|
495
|
+
"bg-blue-50 border-l-[3px] border-l-blue-600": c.id === g.value,
|
|
496
|
+
"border-t-2 border-t-blue-600": H.value === P
|
|
497
|
+
}]),
|
|
498
|
+
draggable: "true",
|
|
499
|
+
onDragstart: (G) => pe(P),
|
|
500
|
+
onDragover: (G) => me(G, P),
|
|
501
|
+
onDragleave: ve,
|
|
502
|
+
onDrop: (G) => fe(P),
|
|
503
|
+
onDragend: t,
|
|
504
|
+
onClick: (G) => g.value = c.id
|
|
505
|
+
}, [
|
|
506
|
+
m(b, {
|
|
507
|
+
name: "drag_indicator",
|
|
508
|
+
size: "sm",
|
|
509
|
+
class: "cursor-grab text-gray-300"
|
|
510
|
+
}),
|
|
511
|
+
m(b, {
|
|
512
|
+
name: ie(c.tag),
|
|
513
|
+
size: "sm"
|
|
514
|
+
}, null, 8, ["name"]),
|
|
515
|
+
l("span", Dt, C(F(c.tag)), 1),
|
|
516
|
+
l("div", Ct, [
|
|
517
|
+
m(b, {
|
|
518
|
+
name: "delete",
|
|
519
|
+
size: "sm",
|
|
520
|
+
class: "cursor-pointer text-gray-400 hover:text-red-500",
|
|
521
|
+
onClick: ke((G) => de(c.id), ["stop"])
|
|
522
|
+
}, null, 8, ["onClick"])
|
|
523
|
+
])
|
|
524
|
+
], 42, $t))), 128)),
|
|
525
|
+
r.value.length === 0 ? (o(), i("div", Bt, " Click a block above to add it ")) : Z("", !0)
|
|
526
|
+
]),
|
|
527
|
+
Q.value ? (o(), i("div", Vt, [
|
|
528
|
+
(o(), O(ot, {
|
|
529
|
+
key: Q.value.id,
|
|
530
|
+
block: Q.value,
|
|
531
|
+
onUpdate: re
|
|
532
|
+
}, null, 8, ["block"]))
|
|
533
|
+
])) : (o(), i("div", It, " Select a block to configure it ")),
|
|
534
|
+
l("div", Pt, [
|
|
535
|
+
m(M, {
|
|
536
|
+
label: "Reset to Default",
|
|
537
|
+
variant: "plain",
|
|
538
|
+
size: "md",
|
|
539
|
+
onClick: q
|
|
540
|
+
})
|
|
541
|
+
])
|
|
542
|
+
]),
|
|
543
|
+
l("div", zt, [
|
|
544
|
+
m(nt, {
|
|
545
|
+
blocks: r.value,
|
|
546
|
+
"selected-block-id": g.value,
|
|
547
|
+
"template-type": f.value
|
|
548
|
+
}, null, 8, ["blocks", "selected-block-id", "template-type"])
|
|
549
|
+
])
|
|
550
|
+
]))
|
|
551
|
+
]),
|
|
552
|
+
_: 2
|
|
553
|
+
}, [
|
|
554
|
+
I.value === "editor" ? {
|
|
555
|
+
name: "dialog-footer",
|
|
556
|
+
fn: z(() => [
|
|
557
|
+
l("div", Ot, [
|
|
558
|
+
a.value ? (o(), O(M, {
|
|
559
|
+
key: 0,
|
|
560
|
+
label: "Delete Template",
|
|
561
|
+
variant: "destructive",
|
|
562
|
+
size: "md",
|
|
563
|
+
onClick: e[2] || (e[2] = (c) => D.value = !0)
|
|
564
|
+
})) : Z("", !0),
|
|
565
|
+
m(M, {
|
|
566
|
+
label: "Save Template",
|
|
567
|
+
variant: "primary",
|
|
568
|
+
size: "md",
|
|
569
|
+
onClick: e[3] || (e[3] = (c) => d.value = !0)
|
|
570
|
+
})
|
|
571
|
+
])
|
|
572
|
+
]),
|
|
573
|
+
key: "0"
|
|
574
|
+
} : void 0
|
|
575
|
+
]), 1032, ["modelValue"]),
|
|
576
|
+
m(R, {
|
|
577
|
+
modelValue: d.value,
|
|
578
|
+
"onUpdate:modelValue": e[5] || (e[5] = (c) => d.value = c),
|
|
579
|
+
overlay: !0,
|
|
580
|
+
dismissAway: !0,
|
|
581
|
+
"close-button": "",
|
|
582
|
+
"max-width": "400px"
|
|
583
|
+
}, {
|
|
584
|
+
"dialog-header": z(() => e[11] || (e[11] = [
|
|
585
|
+
l("span", null, "Save Print Template?", -1)
|
|
586
|
+
])),
|
|
587
|
+
"dialog-footer": z(() => [
|
|
588
|
+
m(M, {
|
|
589
|
+
class: "ml-auto",
|
|
590
|
+
label: "Save",
|
|
591
|
+
variant: "primary",
|
|
592
|
+
size: "md",
|
|
593
|
+
loading: n.value,
|
|
594
|
+
onClick: s
|
|
595
|
+
}, null, 8, ["loading"])
|
|
596
|
+
]),
|
|
597
|
+
default: z(() => [
|
|
598
|
+
l("div", Et, [
|
|
599
|
+
e[13] || (e[13] = l("p", null, "Are you sure you want to save this print template?", -1)),
|
|
600
|
+
e[14] || (e[14] = l("p", { class: "text-gray-500 text-sm mt-2" }, " This template will be used for all future prints of this type. ", -1)),
|
|
601
|
+
l("div", Lt, [
|
|
602
|
+
m(b, {
|
|
603
|
+
name: "warning",
|
|
604
|
+
size: "sm"
|
|
605
|
+
}),
|
|
606
|
+
e[12] || (e[12] = l("span", null, "This will affect all locations under this business.", -1))
|
|
607
|
+
])
|
|
608
|
+
])
|
|
609
|
+
]),
|
|
610
|
+
_: 1
|
|
611
|
+
}, 8, ["modelValue"]),
|
|
612
|
+
m(R, {
|
|
613
|
+
modelValue: D.value,
|
|
614
|
+
"onUpdate:modelValue": e[6] || (e[6] = (c) => D.value = c),
|
|
615
|
+
overlay: !0,
|
|
616
|
+
dismissAway: !0,
|
|
617
|
+
"close-button": "",
|
|
618
|
+
"max-width": "400px"
|
|
619
|
+
}, {
|
|
620
|
+
"dialog-header": z(() => e[15] || (e[15] = [
|
|
621
|
+
l("span", null, "Delete Print Template?", -1)
|
|
622
|
+
])),
|
|
623
|
+
"dialog-footer": z(() => [
|
|
624
|
+
m(M, {
|
|
625
|
+
class: "ml-auto",
|
|
626
|
+
label: "Delete",
|
|
627
|
+
variant: "destructive",
|
|
628
|
+
size: "md",
|
|
629
|
+
loading: n.value,
|
|
630
|
+
onClick: B
|
|
631
|
+
}, null, 8, ["loading"])
|
|
632
|
+
]),
|
|
633
|
+
default: z(() => [
|
|
634
|
+
l("div", At, [
|
|
635
|
+
e[17] || (e[17] = l("p", null, "Are you sure you want to delete this print template?", -1)),
|
|
636
|
+
e[18] || (e[18] = l("p", { class: "text-gray-500 text-sm mt-2" }, " The default print layout will be used for all future prints. ", -1)),
|
|
637
|
+
l("div", Nt, [
|
|
638
|
+
m(b, {
|
|
639
|
+
name: "warning",
|
|
640
|
+
size: "sm"
|
|
641
|
+
}),
|
|
642
|
+
e[16] || (e[16] = l("span", null, "This will affect all locations under this business.", -1))
|
|
643
|
+
])
|
|
644
|
+
])
|
|
645
|
+
]),
|
|
646
|
+
_: 1
|
|
647
|
+
}, 8, ["modelValue"])
|
|
648
|
+
], 64);
|
|
649
|
+
};
|
|
650
|
+
}
|
|
651
|
+
}), Ht = { class: "flex flex-wrap items-center gap-8 border-b border-fm-color-neutral-gray-200 pb-16" }, Mt = {
|
|
652
|
+
key: 0,
|
|
653
|
+
class: "text-fm-color-typo-secondary"
|
|
654
|
+
}, Rt = {
|
|
655
|
+
key: 1,
|
|
656
|
+
class: "text-fm-color-typo-secondary"
|
|
657
|
+
}, jt = {
|
|
658
|
+
key: 2,
|
|
659
|
+
class: "text-fm-color-typo-error"
|
|
660
|
+
}, Kt = {
|
|
661
|
+
key: 4,
|
|
662
|
+
class: "fm-typo-en-body-md-600"
|
|
663
|
+
}, qt = {
|
|
664
|
+
key: 5,
|
|
665
|
+
class: "text-fm-color-typo-secondary"
|
|
666
|
+
}, Gt = /* @__PURE__ */ ee({
|
|
667
|
+
__name: "PlanLicenseDisplay",
|
|
668
|
+
props: {
|
|
669
|
+
scopeDbName: {}
|
|
670
|
+
},
|
|
671
|
+
setup(N) {
|
|
672
|
+
const h = N, T = _e(), k = Le(), w = E(() => T.locationByDbName[h.scopeDbName ?? ""]), p = E(() => {
|
|
673
|
+
var r;
|
|
674
|
+
const n = (r = w.value) == null ? void 0 : r.doc;
|
|
675
|
+
return n ? n.id || n._id : void 0;
|
|
676
|
+
}), $ = _(null), v = _(!1), y = _(!1);
|
|
677
|
+
return j(
|
|
678
|
+
p,
|
|
679
|
+
async (n, r, g) => {
|
|
680
|
+
if ($.value = null, y.value = !1, !n) return;
|
|
681
|
+
let f = !1;
|
|
682
|
+
g(() => {
|
|
683
|
+
f = !0;
|
|
684
|
+
}), v.value = !0;
|
|
685
|
+
try {
|
|
686
|
+
const x = await k.getInventoryPlan(n);
|
|
687
|
+
f || ($.value = x);
|
|
688
|
+
} catch {
|
|
689
|
+
f || (y.value = !0);
|
|
690
|
+
} finally {
|
|
691
|
+
f || (v.value = !1);
|
|
692
|
+
}
|
|
693
|
+
},
|
|
694
|
+
{ immediate: !0 }
|
|
695
|
+
), (n, r) => (o(), i("div", Ht, [
|
|
696
|
+
r[0] || (r[0] = l("span", { class: "fm-typo-en-body-md-600" }, "Inventory plan", -1)),
|
|
697
|
+
w.value ? v.value ? (o(), i("span", Rt, "Loading…")) : y.value ? (o(), i("span", jt, "Could not load plan")) : $.value === "Premium" ? (o(), O(je, {
|
|
698
|
+
key: 3,
|
|
699
|
+
tier: "premium"
|
|
700
|
+
})) : $.value === "Standard" ? (o(), i("span", Kt, "Standard")) : (o(), i("span", qt, "No plan assigned")) : (o(), i("span", Mt, "Select a location to view its plan"))
|
|
701
|
+
]));
|
|
702
|
+
}
|
|
703
|
+
}), Yt = { class: "flex min-h-0 w-full flex-col gap-12" }, Wt = { class: "flex w-full flex-wrap items-center gap-8" }, Jt = /* @__PURE__ */ ee({
|
|
704
|
+
__name: "FeatureFlagView",
|
|
705
|
+
setup(N) {
|
|
706
|
+
const h = Ue(), T = _e(), k = ye(), w = Ae(), p = X.FmSwitch, $ = X.FmTable, v = X.FmMenu, y = X.FmMenuDivider, n = X.FmMenuHeader, r = X.FmMenuItem, g = /* @__PURE__ */ new Set(), f = {
|
|
707
|
+
inventory_pos_closing_v1: "Use v2: Closing Draft and Closing Template.",
|
|
708
|
+
inventory_pos_convert_v1: "Use Production Item instead."
|
|
709
|
+
}, x = _([]), a = _(null), D = ["In use", "Deprecate Soon", "Deprecated"], d = _(null), I = _({}), J = _(!1), K = {
|
|
710
|
+
inventory_netsuite_inventory_transfer_out: ["netsuite"],
|
|
711
|
+
inventory_portal_accept_require_fulfillment: ["mobile"],
|
|
712
|
+
inventory_portal_must_use_transfer_template: ["mobile"],
|
|
713
|
+
inventory_portal_po_operate_v2: ["mobile"],
|
|
714
|
+
inventory_portal_xilnex_transfer_note: ["mobile"],
|
|
715
|
+
inventory_pos_adjust_v1: ["mobile", "pos-v7", "pos-7.8"],
|
|
716
|
+
inventory_pos_adjust_v2_wastage: ["mobile", "pos-v7", "pos-7.8"],
|
|
717
|
+
inventory_pos_allow_receive_order: ["mobile", "pos-v7", "pos-7.8"],
|
|
718
|
+
inventory_pos_closing_v1: ["mobile", "pos-v7", "pos-7.8"],
|
|
719
|
+
inventory_pos_closing_v2: ["mobile", "pos-v7", "pos-7.8"],
|
|
720
|
+
inventory_pos_convert_v1: ["mobile", "pos-v7", "pos-7.8"],
|
|
721
|
+
inventory_pos_costing: ["mobile"],
|
|
722
|
+
inventory_pos_stock_return: ["mobile"],
|
|
723
|
+
inventory_pos_transfer_require_fulfillment: ["mobile", "pos-v7", "pos-7.8"],
|
|
724
|
+
inventory_purchase_order_approval: ["mobile"]
|
|
725
|
+
}, Q = E(
|
|
726
|
+
() => Object.values(Ne).map((t) => {
|
|
727
|
+
const s = h.flags.find((B) => B.name === t);
|
|
728
|
+
return {
|
|
729
|
+
name: t,
|
|
730
|
+
enabled: (s == null ? void 0 : s.enabled) ?? null,
|
|
731
|
+
domains: ["portal", ...K[t] ?? []],
|
|
732
|
+
features: Ke(t)
|
|
733
|
+
};
|
|
734
|
+
})
|
|
735
|
+
), U = E(
|
|
736
|
+
() => [...new Set(Q.value.flatMap((t) => t.domains))].sort()
|
|
737
|
+
), H = E(
|
|
738
|
+
() => Q.value.filter(
|
|
739
|
+
(t) => (x.value.length === 0 || x.value.some((s) => t.domains.includes(s))) && (!a.value || re(t) === a.value)
|
|
740
|
+
)
|
|
741
|
+
);
|
|
742
|
+
function ne(t) {
|
|
743
|
+
x.value = x.value.includes(t) ? x.value.filter((s) => s !== t) : [...x.value, t];
|
|
744
|
+
}
|
|
745
|
+
function te() {
|
|
746
|
+
x.value = [], a.value = null;
|
|
747
|
+
}
|
|
748
|
+
function le(t) {
|
|
749
|
+
return t.domains.includes("mobile") || t.domains.some((s) => s.startsWith("pos-"));
|
|
750
|
+
}
|
|
751
|
+
function ce(t) {
|
|
752
|
+
return d.value && le(t) ? I.value[t.name] === !0 : t.enabled === !0;
|
|
753
|
+
}
|
|
754
|
+
async function de(t) {
|
|
755
|
+
if (!t) {
|
|
756
|
+
I.value = {};
|
|
757
|
+
return;
|
|
758
|
+
}
|
|
759
|
+
const s = t;
|
|
760
|
+
J.value = !0;
|
|
761
|
+
try {
|
|
762
|
+
const { flags: B } = await w.listForScope(s);
|
|
763
|
+
d.value === s && (I.value = Object.fromEntries(B.map((q) => [q.name, q.enabled])));
|
|
764
|
+
} catch (B) {
|
|
765
|
+
console.error("Unable to load feature flags for the selected scope", B), d.value === s && (I.value = {});
|
|
766
|
+
} finally {
|
|
767
|
+
d.value === s && (J.value = !1);
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
j(
|
|
771
|
+
() => {
|
|
772
|
+
var t;
|
|
773
|
+
return (t = k.currentBusiness.value) != null && t._id ? `business_${k.currentBusiness.value._id}` : null;
|
|
774
|
+
},
|
|
775
|
+
(t) => {
|
|
776
|
+
var s;
|
|
777
|
+
d.value || (d.value = ((s = T._currentLocation) == null ? void 0 : s.dbName) ?? t);
|
|
778
|
+
},
|
|
779
|
+
{ immediate: !0 }
|
|
780
|
+
), j(d, de, { immediate: !0 });
|
|
781
|
+
function re(t) {
|
|
782
|
+
return g.has(t.name) ? "Deprecated" : f[t.name] ? "Deprecate Soon" : "In use";
|
|
783
|
+
}
|
|
784
|
+
function pe(t) {
|
|
785
|
+
return t === "Deprecated" ? "bg-red-50 text-red-700" : t === "Deprecate Soon" ? "bg-fm-color-state-warning-subtle text-fm-color-state-warning-base" : "bg-green-50 text-green-700";
|
|
786
|
+
}
|
|
787
|
+
function me(t) {
|
|
788
|
+
return t.features.length === 0 ? ["Controls the availability of this inventory feature."] : t.features.length === 1 ? [t.features[0].controls] : t.features.map((s) => `${s.label}: ${s.controls}`);
|
|
789
|
+
}
|
|
790
|
+
function ve(t) {
|
|
791
|
+
return g.has(t.name) ? "This flag is deprecated. Use its supported replacement for new work." : f[t.name];
|
|
792
|
+
}
|
|
793
|
+
const fe = E(() => [
|
|
794
|
+
{
|
|
795
|
+
accessorKey: "name",
|
|
796
|
+
header: "Feature flag",
|
|
797
|
+
meta: { width: "27%" },
|
|
798
|
+
cell: ({ row: t }) => V("div", { class: "flex flex-wrap items-center gap-2" }, [
|
|
799
|
+
V("span", { class: "break-all font-mono text-xs text-gray-700" }, t.original.name),
|
|
800
|
+
...t.original.features.slice(0, 1).map(
|
|
801
|
+
(s) => V(He, {
|
|
802
|
+
tier: s.category === "premium" ? "premium" : "standard",
|
|
803
|
+
category: s.category,
|
|
804
|
+
deprecateSoon: s.deprecateSoon,
|
|
805
|
+
informative: !0
|
|
806
|
+
})
|
|
807
|
+
)
|
|
808
|
+
])
|
|
809
|
+
},
|
|
810
|
+
{
|
|
811
|
+
id: "domains",
|
|
812
|
+
header: "Domains",
|
|
813
|
+
meta: { width: "19%" },
|
|
814
|
+
cell: ({ row: t }) => V(
|
|
815
|
+
"div",
|
|
816
|
+
{ class: "flex flex-wrap gap-2" },
|
|
817
|
+
t.original.domains.map(
|
|
818
|
+
(s) => V(
|
|
819
|
+
"span",
|
|
820
|
+
{
|
|
821
|
+
class: "rounded-full bg-fm-color-neutral-gray-100 px-2 py-0.5 text-xs font-medium text-fm-color-typo-secondary"
|
|
822
|
+
},
|
|
823
|
+
s
|
|
824
|
+
)
|
|
825
|
+
)
|
|
826
|
+
)
|
|
827
|
+
},
|
|
828
|
+
{
|
|
829
|
+
id: "description",
|
|
830
|
+
header: "Description",
|
|
831
|
+
meta: { width: "29%" },
|
|
832
|
+
cell: ({ row: t }) => {
|
|
833
|
+
const s = ve(t.original);
|
|
834
|
+
return V("div", { class: "flex flex-col gap-2 text-xs" }, [
|
|
835
|
+
...me(t.original).map(
|
|
836
|
+
(B) => V("span", { class: "text-fm-color-typo-secondary" }, B)
|
|
837
|
+
),
|
|
838
|
+
...s ? [V("span", { class: "text-fm-color-state-warning-base" }, s)] : []
|
|
839
|
+
]);
|
|
840
|
+
}
|
|
841
|
+
},
|
|
842
|
+
{
|
|
843
|
+
id: "status",
|
|
844
|
+
header: "Status",
|
|
845
|
+
meta: { width: "13%" },
|
|
846
|
+
cell: ({ row: t }) => {
|
|
847
|
+
const s = re(t.original);
|
|
848
|
+
return s === "Deprecate Soon" ? V(Me) : V(
|
|
849
|
+
"span",
|
|
850
|
+
{
|
|
851
|
+
class: `inline-flex rounded-full px-2 py-0.5 text-xs font-medium ${pe(s)}`
|
|
852
|
+
},
|
|
853
|
+
s
|
|
854
|
+
);
|
|
855
|
+
}
|
|
856
|
+
},
|
|
857
|
+
{
|
|
858
|
+
id: "availability",
|
|
859
|
+
header: "Availability",
|
|
860
|
+
meta: { width: "12%" },
|
|
861
|
+
cell: ({ row: t }) => {
|
|
862
|
+
const s = !!d.value && le(t.original);
|
|
863
|
+
return V("div", { class: "flex flex-col items-end gap-2" }, [
|
|
864
|
+
V(p, { modelValue: ce(t.original), disabled: !0, showIcon: !0 }),
|
|
865
|
+
...s && J.value ? [V("span", { class: "text-xs text-gray-500" }, "Loading location value…")] : [],
|
|
866
|
+
...t.original.features.some((B) => B.category === "premium") && t.original.enabled !== !0 && !s ? [V("span", { class: "text-xs text-gray-500" }, "Controlled by the Premium plan")] : []
|
|
867
|
+
]);
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
]);
|
|
871
|
+
return (t, s) => {
|
|
872
|
+
const B = L("FmChip"), q = L("FmButton");
|
|
873
|
+
return o(), i("div", Yt, [
|
|
874
|
+
m(Gt, { "scope-db-name": d.value }, null, 8, ["scope-db-name"]),
|
|
875
|
+
l("div", Wt, [
|
|
876
|
+
m(Re, {
|
|
877
|
+
"model-value": d.value,
|
|
878
|
+
"onUpdate:modelValue": s[0] || (s[0] = (F) => d.value = F),
|
|
879
|
+
"selection-only": "",
|
|
880
|
+
"show-business": ""
|
|
881
|
+
}, null, 8, ["model-value"]),
|
|
882
|
+
(o(!0), i(A, null, W(x.value, (F) => (o(), O(B, {
|
|
883
|
+
key: F,
|
|
884
|
+
label: `domain in ${F}`,
|
|
885
|
+
removable: "",
|
|
886
|
+
onChipClosed: (ie) => ne(F)
|
|
887
|
+
}, null, 8, ["label", "onChipClosed"]))), 128)),
|
|
888
|
+
a.value ? (o(), O(B, {
|
|
889
|
+
key: 0,
|
|
890
|
+
label: `status in ${a.value}`,
|
|
891
|
+
removable: "",
|
|
892
|
+
onChipClosed: s[1] || (s[1] = (F) => a.value = null)
|
|
893
|
+
}, null, 8, ["label"])) : Z("", !0),
|
|
894
|
+
m(S(v), {
|
|
895
|
+
"close-on-click": !1,
|
|
896
|
+
width: 288,
|
|
897
|
+
"max-height": 420,
|
|
898
|
+
placement: "bottom-start"
|
|
899
|
+
}, {
|
|
900
|
+
"menu-button": z(() => [
|
|
901
|
+
m(q, {
|
|
902
|
+
label: "Filter",
|
|
903
|
+
"prepend-icon": "add",
|
|
904
|
+
variant: "secondary"
|
|
905
|
+
})
|
|
906
|
+
]),
|
|
907
|
+
default: z(() => [
|
|
908
|
+
m(S(n), { label: "Domains" }),
|
|
909
|
+
(o(!0), i(A, null, W(U.value, (F) => (o(), O(S(r), {
|
|
910
|
+
key: F,
|
|
911
|
+
label: F,
|
|
912
|
+
selectable: "",
|
|
913
|
+
"has-checkbox": "",
|
|
914
|
+
"model-value": x.value.includes(F),
|
|
915
|
+
onClick: (ie) => ne(F)
|
|
916
|
+
}, null, 8, ["label", "model-value", "onClick"]))), 128)),
|
|
917
|
+
m(S(y)),
|
|
918
|
+
m(S(n), { label: "Status" }),
|
|
919
|
+
(o(), i(A, null, W(D, (F) => m(S(r), {
|
|
920
|
+
key: F,
|
|
921
|
+
label: F,
|
|
922
|
+
selectable: "",
|
|
923
|
+
"has-checkbox": "",
|
|
924
|
+
"model-value": a.value === F,
|
|
925
|
+
onClick: (ie) => a.value = a.value === F ? null : F
|
|
926
|
+
}, null, 8, ["label", "model-value", "onClick"])), 64))
|
|
927
|
+
]),
|
|
928
|
+
_: 1
|
|
929
|
+
}),
|
|
930
|
+
x.value.length || a.value ? (o(), O(q, {
|
|
931
|
+
key: 1,
|
|
932
|
+
label: "Clear all",
|
|
933
|
+
variant: "tertiary",
|
|
934
|
+
onClick: te
|
|
935
|
+
})) : Z("", !0)
|
|
936
|
+
]),
|
|
937
|
+
m(S($), {
|
|
938
|
+
"column-defs": fe.value,
|
|
939
|
+
"row-data": H.value,
|
|
940
|
+
"page-size": 50,
|
|
941
|
+
"hide-footer": "",
|
|
942
|
+
"shrink-at": !1
|
|
943
|
+
}, null, 8, ["column-defs", "row-data"])
|
|
944
|
+
]);
|
|
945
|
+
};
|
|
946
|
+
}
|
|
947
|
+
}), Qt = { class: "flex w-full flex-col gap-16 p-16" }, Xt = {
|
|
948
|
+
key: 0,
|
|
949
|
+
class: "py-32 text-center"
|
|
950
|
+
}, Zt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, el = {
|
|
951
|
+
class: "flex gap-2 border-b border-gray-200",
|
|
952
|
+
role: "tablist"
|
|
953
|
+
}, tl = ["aria-selected"], ll = ["aria-selected"], ol = { key: 0 }, al = { class: "flex items-center justify-between gap-12" }, sl = { class: "fm-typo-en-heading-sm-600 text-fm-color-typo-primary" }, nl = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, rl = {
|
|
954
|
+
key: 1,
|
|
955
|
+
class: "w-full"
|
|
956
|
+
}, il = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, hl = /* @__PURE__ */ ee({
|
|
957
|
+
__name: "SettingsView",
|
|
958
|
+
setup(N) {
|
|
959
|
+
const { t: h } = Ee(), T = ye(), k = Ie(), w = _(!1), p = _("order"), $ = E(() => {
|
|
960
|
+
var n, r;
|
|
961
|
+
return ((r = (n = T.sessionUser.value) == null ? void 0 : n.role) == null ? void 0 : r.isAdmin) === !0;
|
|
962
|
+
});
|
|
963
|
+
function v() {
|
|
964
|
+
k.invalidate(), k.fetchTemplates();
|
|
965
|
+
}
|
|
966
|
+
function y() {
|
|
967
|
+
k.fetchTemplates(), w.value = !0;
|
|
968
|
+
}
|
|
969
|
+
return (n, r) => {
|
|
970
|
+
const g = L("FmButton");
|
|
971
|
+
return o(), O(Fe, {
|
|
972
|
+
title: S(h)("inventory.settings.title")
|
|
973
|
+
}, {
|
|
974
|
+
default: z(() => [
|
|
975
|
+
l("div", Qt, [
|
|
976
|
+
$.value ? (o(), i(A, { key: 1 }, [
|
|
977
|
+
l("div", el, [
|
|
978
|
+
l("button", {
|
|
979
|
+
type: "button",
|
|
980
|
+
role: "tab",
|
|
981
|
+
"aria-selected": p.value === "order",
|
|
982
|
+
class: ue([
|
|
983
|
+
"border-b-2 px-3 py-2 text-sm font-medium",
|
|
984
|
+
p.value === "order" ? "border-fm-color-primary text-fm-color-primary" : "border-transparent text-gray-500"
|
|
985
|
+
]),
|
|
986
|
+
onClick: r[0] || (r[0] = (f) => p.value = "order")
|
|
987
|
+
}, C(S(h)("inventory.settings.order.title")), 11, tl),
|
|
988
|
+
l("button", {
|
|
989
|
+
type: "button",
|
|
990
|
+
role: "tab",
|
|
991
|
+
"aria-selected": p.value === "features",
|
|
992
|
+
class: ue([
|
|
993
|
+
"border-b-2 px-3 py-2 text-sm font-medium",
|
|
994
|
+
p.value === "features" ? "border-fm-color-primary text-fm-color-primary" : "border-transparent text-gray-500"
|
|
995
|
+
]),
|
|
996
|
+
onClick: r[1] || (r[1] = (f) => p.value = "features")
|
|
997
|
+
}, C(S(h)("inventory.settings.features.title")), 11, ll)
|
|
998
|
+
]),
|
|
999
|
+
p.value === "order" ? (o(), i("div", ol, [
|
|
1000
|
+
l("div", al, [
|
|
1001
|
+
l("h2", sl, C(S(h)("inventory.settings.order.printTemplates")), 1),
|
|
1002
|
+
m(g, {
|
|
1003
|
+
onClick: y,
|
|
1004
|
+
variant: "secondary",
|
|
1005
|
+
label: S(h)("inventory.settings.printTemplate.edit")
|
|
1006
|
+
}, null, 8, ["label"])
|
|
1007
|
+
]),
|
|
1008
|
+
l("p", nl, C(S(h)("inventory.settings.printTemplate.description")), 1)
|
|
1009
|
+
])) : (o(), i("div", rl, [
|
|
1010
|
+
l("p", il, C(S(h)("inventory.settings.features.description")), 1),
|
|
1011
|
+
m(Jt)
|
|
1012
|
+
]))
|
|
1013
|
+
], 64)) : (o(), i("div", Xt, [
|
|
1014
|
+
l("p", Zt, C(S(h)("inventory.settings.adminOnly")), 1)
|
|
1015
|
+
]))
|
|
1016
|
+
]),
|
|
1017
|
+
(o(), O(we, { to: "body" }, [
|
|
1018
|
+
m(Ut, {
|
|
1019
|
+
modelValue: w.value,
|
|
1020
|
+
"onUpdate:modelValue": r[2] || (r[2] = (f) => w.value = f),
|
|
1021
|
+
onSaved: v
|
|
1022
|
+
}, null, 8, ["modelValue"])
|
|
1023
|
+
]))
|
|
1024
|
+
]),
|
|
1025
|
+
_: 1
|
|
1026
|
+
}, 8, ["title"]);
|
|
1027
|
+
};
|
|
1028
|
+
}
|
|
1029
|
+
});
|
|
1030
|
+
export {
|
|
1031
|
+
hl as default
|
|
1032
|
+
};
|