@feedmepos/mf-inventory-portal 1.8.0-dev.16 → 1.8.0-dev.17

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 (133) hide show
  1. package/dist/{App-xSsyvQV_.js → App-CRmKXhRV.js} +9 -9
  2. package/dist/{ApprovalView-DfJ0FAiD.js → ApprovalView-tDkNN-Cd.js} +9 -9
  3. package/dist/{BindingsDialog-oAZyjgrN.js → BindingsDialog-DrB0U9F6.js} +2 -2
  4. package/dist/{BindingsPicker-CEIo7myR.js → BindingsPicker-tjjgijNe.js} +2 -2
  5. package/dist/{BindingsTable-BKa-JYRR.js → BindingsTable-D7EGgWxE.js} +4 -4
  6. package/dist/{BulkReceiveRequestPage-C6Oyg5-E.js → BulkReceiveRequestPage-B7GEE9qI.js} +21 -21
  7. package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-BvleQo5y.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-B4j6Acmo.js} +1 -1
  8. package/dist/{ClosingDraftView-tJrjqyAC.js → ClosingDraftView-DH0eBMZ8.js} +19 -19
  9. package/dist/{ClosingHistoryView-CJQlK4Xc.js → ClosingHistoryView-FmdYCiLI.js} +7 -7
  10. package/dist/{ClosingTemplateView-DYRtdK5h.js → ClosingTemplateView-BGmFG2-y.js} +18 -18
  11. package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-DEwi7wFf.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-DHboInU_.js} +1 -1
  12. package/dist/{DefaultView-CxTBlkln.js → DefaultView-CsNlHUlf.js} +2 -2
  13. package/dist/{DeliveryOrderPrintPreview-Bywdjc2U.js → DeliveryOrderPrintPreview-CMe2DpP1.js} +2 -2
  14. package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-DcFAUTdO.js → EmailDialog.vue_vue_type_script_setup_true_lang-Yen9u78U.js} +7759 -7654
  15. package/dist/{FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-C8c6rmJv.js → FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-BJy8_H2s.js} +1 -1
  16. package/dist/{FeatureCapabilityGate-B41dULfm.js → FeatureCapabilityGate-DN8b1697.js} +2 -2
  17. package/dist/{FeaturePageGate.vue_vue_type_script_setup_true_lang-D4G6i1D6.js → FeaturePageGate.vue_vue_type_script_setup_true_lang-DmNFZYam.js} +1 -1
  18. package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-CnqH115V.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-2zOATqzb.js} +1 -1
  19. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-QBviJzAO.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CVBUkN02.js} +2 -2
  20. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BqHtzo20.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BuE-1qd6.js} +2 -2
  21. package/dist/{FmMultiselectDialog-M6CvNFW1.js → FmMultiselectDialog-C3B8pd2Z.js} +2 -2
  22. package/dist/{FmMultiselectDialog-CFNZMzlC.js → FmMultiselectDialog-LI5ekHzQ.js} +2 -2
  23. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BGco50Ma.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DQZ7aJGJ.js} +113 -106
  24. package/dist/{ImportView-C2GOmpuK.js → ImportView-DYoeJLdr.js} +6 -6
  25. package/dist/{IngredientsView-wB9kGiOK.js → IngredientsView-u3KHfALO.js} +15 -15
  26. package/dist/{IntegrationExplorerView-BujwGE4q.js → IntegrationExplorerView-Bl0Z8sxM.js} +6 -6
  27. package/dist/{IntegrationPlatformView-Wnvj6-BG.js → IntegrationPlatformView-CybBB3RA.js} +2 -2
  28. package/dist/{IntegrationView-C77rSbpn.js → IntegrationView-Dxy7QhCp.js} +14 -14
  29. package/dist/{InventoryBindingForm-Bs7Duwfj.js → InventoryBindingForm-DyUvyOsa.js} +1 -1
  30. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-DawAEeuP.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-Dmch1sfA.js} +4 -4
  31. package/dist/{InventoryBindingSummary-BefkYWIr.js → InventoryBindingSummary-DwY3vUf_.js} +1 -1
  32. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BpUMK6fj.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-B2UtnJtf.js} +2 -2
  33. package/dist/{ProductionRunDetailPage-CVx9LS-P.js → ProductionRunDetailPage-Cdi4hv3E.js} +4 -4
  34. package/dist/{ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-4aYz5NwS.js → ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-D5jlF5x4.js} +988 -954
  35. package/dist/{ProductionRunPage-CuXzmWMc.js → ProductionRunPage-RcbHy0Mj.js} +4 -4
  36. package/dist/{PublishView-Bu8J6ndy.js → PublishView-CyJ_rE-5.js} +3 -3
  37. package/dist/{PurchaseOrderPrintPreview-DaslFe8u.js → PurchaseOrderPrintPreview-ZlbV3YfE.js} +2 -2
  38. package/dist/{ReceiveRequestView-CKPBpN4x.js → ReceiveRequestView-BKz8N6yK.js} +13 -13
  39. package/dist/{RecipeView-BeZ9ljtA.js → RecipeView-D3IEyQoK.js} +15 -15
  40. package/dist/{SettingsView-CWhMdNfn.js → SettingsView-A0eozTq3.js} +7 -7
  41. package/dist/{StockView-C5IhPGxi.js → StockView-DrxkHTH4.js} +25 -25
  42. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-B9Rx_9b7.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-CD11VzXa.js} +1 -1
  43. package/dist/{SupplierView-BSGajl9V.js → SupplierView-Cg60vwsj.js} +15 -14
  44. package/dist/{SurchargeView-DtAszxTN.js → SurchargeView-Dxvg-RnC.js} +7 -7
  45. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-CfxroS8u.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-DDLGEaa2.js} +2 -2
  46. package/dist/TemplatePublishDialog.vue_vue_type_script_setup_true_lang-DfYoaT5a.js +332 -0
  47. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-B_9i5LzY.js → TransferDetails.vue_vue_type_script_setup_true_lang-D3wClK8t.js} +1264 -1232
  48. package/dist/{TransferTemplateView-D6_AfMja.js → TransferTemplateView-DfCJzLHt.js} +945 -941
  49. package/dist/{UnitCostHistoryView-kisQehVE.js → UnitCostHistoryView-BkNnwNUc.js} +4 -4
  50. package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-DKoPNZoW.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-Clufqvr_.js} +4 -4
  51. package/dist/{UnitView-jSLennZW.js → UnitView-D_agG3Kd.js} +7 -7
  52. package/dist/{WarehouseView-CUdWJCMq.js → WarehouseView-DE_CaJCb.js} +8 -8
  53. package/dist/{WastageTemplateView--B0LSwHa.js → WastageTemplateView-r3b6angy.js} +15 -15
  54. package/dist/api/inventory.d.ts +9 -9
  55. package/dist/{app-Bb5HLWTu.js → app-CLTXsVH_.js} +26976 -25707
  56. package/dist/app.d.ts +48 -0
  57. package/dist/app.js +1 -1
  58. package/dist/{closing-template-CgDMayoo.js → closing-template-yP6QT_6M.js} +4 -4
  59. package/dist/components/FmUnitInputProps.d.ts +1 -0
  60. package/dist/components/MultiLocationSelector.vue.d.ts +6 -6
  61. package/dist/components/TemplatePublishDialog.d.ts +2 -0
  62. package/dist/components/TemplatePublishDialog.spec.d.ts +1 -0
  63. package/dist/composable/defineApi.d.ts +1 -1
  64. package/dist/{date2-D9gB9BE-.js → date2-9jq_OKuv.js} +1 -1
  65. package/dist/{dayjs.min-CumM_kH7.js → dayjs.min-CAxu5-hQ.js} +1 -1
  66. package/dist/{decimal-CVF1rRoj.js → decimal-BhGvDuWQ.js} +2 -2
  67. package/dist/{defineDeepModel-DE-DsQjm.js → defineDeepModel-Czbczabc.js} +1 -1
  68. package/dist/{duplicate-template-CFYtQfQn.js → duplicate-template-X72Zob-u.js} +1 -1
  69. package/dist/{feature-kti8bU8q.js → feature-CC2pF6VK.js} +2 -2
  70. package/dist/{format-time-from-id-CWZ5VGvM.js → format-time-from-id-DhZOfLN4.js} +1 -1
  71. package/dist/{format-unit-display-BlxdvskN.js → format-unit-display-BalKqHYj.js} +115 -113
  72. package/dist/{id-to-date-BaH_1Kui.js → id-to-date-Cb9v4BtX.js} +1 -1
  73. package/dist/{import-export.helper-8rKrOB0E.js → import-export.helper-9D5DLoaq.js} +5 -5
  74. package/dist/{index-B9p_OEdk.js → index-B0T8iGU6.js} +1 -1
  75. package/dist/{index-BHc3cNyz.js → index-CnjRz458.js} +3 -3
  76. package/dist/{index-MEUJonBr.js → index-DqV626Os.js} +1768 -1741
  77. package/dist/{lz-string-IiazGN0W.js → lz-string-CK_kK0b8.js} +1 -1
  78. package/dist/{netsuite-BeDxaeKM.js → netsuite-Czq6x14E.js} +2 -2
  79. package/dist/{netsuite-explorer-4IluitzS.js → netsuite-explorer-BugWV6N7.js} +1 -1
  80. package/dist/{predefined-templates-D4qVID1q.js → predefined-templates-D5qjNE4o.js} +1 -1
  81. package/dist/{purchase-order-template-GTOntq3C.js → purchase-order-template-Bc0QP-bq.js} +1 -1
  82. package/dist/{recalculationUtils-Dye8x2TO.js → recalculationUtils-CJknKvb-.js} +1 -1
  83. package/dist/{row-action.enum-CVJbq_-y.js → row-action.enum-Cz1k6Kht.js} +1 -1
  84. package/dist/{rules-Y3zXVj3i.js → rules-BQscySfb.js} +45 -40
  85. package/dist/{stock-BR8x3nlx.js → stock--68mu-M1.js} +1 -1
  86. package/dist/{stock-BIjTQFsR.js → stock-DCz3ZTmd.js} +2 -2
  87. package/dist/stores/integration/netsuite.d.ts +2 -2
  88. package/dist/stores/location.d.ts +42 -42
  89. package/dist/stores/supplier.d.ts +48 -48
  90. package/dist/stores/warehouse.d.ts +1 -1
  91. package/dist/{supplier-CbdCjiIB.js → supplier-U06ZrnoC.js} +2 -2
  92. package/dist/{surcharge-BoXLK6o0.js → surcharge-B5DGPlf5.js} +1 -1
  93. package/dist/tsconfig.app.tsbuildinfo +1 -1
  94. package/dist/{uom-rules-C5h1AoPJ.js → uom-rules-DfBYytl6.js} +1 -1
  95. package/dist/{use-ingredient-select-dialog-D196q_qk.js → use-ingredient-select-dialog-BRTxaEaQ.js} +2 -2
  96. package/dist/{use-inventory-binding-dialog-B4IhhCjM.js → use-inventory-binding-dialog-DQDv8yOS.js} +2 -2
  97. package/dist/{use-template-enabled-locations-CDKP3kTS.js → use-template-enabled-locations-DzQVNhev.js} +2 -2
  98. package/dist/{use-transfer-locations-DE4vxSDp.js → use-transfer-locations-CGvKssyQ.js} +2 -2
  99. package/dist/{useHrmPermission-D1dkveCP.js → useHrmPermission-BkOtYcLu.js} +1 -1
  100. package/dist/{useNavigationMenu-N5_7da8m.js → useNavigationMenu-korDNdFf.js} +4 -4
  101. package/dist/{useSseClient-CKpNaz5g.js → useSseClient-BjoRcYKu.js} +1 -1
  102. package/dist/views/adjustment-template/wastage-template/actions.d.ts +36 -36
  103. package/dist/views/adjustment-template/wastage-template/table.d.ts +36 -36
  104. package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftApprovalDialog.vue.d.ts +6 -6
  105. package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +12 -12
  106. package/dist/views/closing-draft/components/closing-draft-groups/ClosingGroupDetailSideSheet.vue.d.ts +6 -6
  107. package/dist/views/closing-draft/composables/use-closing-draft-import.d.ts +3 -3
  108. package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +18 -18
  109. package/dist/views/closing-draft/helpers/draft-status-to-class-name.helper.d.ts +1 -1
  110. package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +45 -45
  111. package/dist/views/closing-template/composables/use-closing-template-table.d.ts +36 -36
  112. package/dist/views/integration/components/netsuite/business/AddLocationDialog.vue.d.ts +36 -36
  113. package/dist/views/integration/components/netsuite/business/AddVendorDialog.vue.d.ts +24 -24
  114. package/dist/views/receive-request/components/transfer-form/TransferFormWithController.vue.d.ts +5 -5
  115. package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +5 -5
  116. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +39 -39
  117. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +35 -35
  118. package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-form.d.ts +34 -34
  119. package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-table.d.ts +6 -6
  120. package/dist/views/supplier/components/SupplierForm.vue.d.ts +4 -4
  121. package/dist/views/supplier/composables/use-supplier-table.d.ts +2 -2
  122. package/dist/views/transfer-template/components/transfer-template-dialog/TransferTemplateDialog.vue.d.ts +8 -8
  123. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-locations.d.ts +4 -4
  124. package/dist/views/transfer-template/composables/use-template-item-bulk-editor.d.ts +24 -24
  125. package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +48 -48
  126. package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +48 -48
  127. package/dist/views/transfer-template/helpers/template-item.error.helper.spec.d.ts +1 -0
  128. package/dist/views/warehouse/components/WarehouseForm.vue.d.ts +2 -2
  129. package/dist/{vue-CxSKQOrZ.js → vue-hPU91AHR.js} +2 -2
  130. package/dist/{vue-i18n-CTR_IUvd.js → vue-i18n-VFYpKHHB.js} +158 -158
  131. package/dist/{xlsx.util-J9pxGRQD.js → xlsx.util-VlHt05TU.js} +2 -2
  132. package/package.json +5 -5
  133. package/dist/TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CTj_jYK1.js +0 -299
@@ -0,0 +1,332 @@
1
+ import { defineComponent as H, ref as g, computed as u, watch as J, h as i, resolveComponent as L, createElementBlock as Q, openBlock as U, createElementVNode as b, toDisplayString as W, createVNode as y, createBlock as X, createCommentVNode as Y, unref as P } from "vue";
2
+ import { useCoreStore as Z, useI18n as ee } from "@feedmepos/mf-common";
3
+ import { useSnackbar as le, components as A } from "@feedmepos/ui-library";
4
+ import { K as te, D as ae } from "./app-C39bYJmq.js";
5
+ import { u as oe } from "./app-CLTXsVH_.js";
6
+ import { F as ne } from "./FmAdminBadge-DlplQOHb.js";
7
+ function se(C, o, r) {
8
+ if (!(r != null && r.length)) return [];
9
+ const t = new Set(r);
10
+ return Object.entries(C).filter(([n, w]) => !t.has(n) && w.some((F) => F._id === o)).map(([n]) => n);
11
+ }
12
+ const ie = {
13
+ class: "flex flex-col gap-24 h-full",
14
+ style: { "max-height": "50vh" }
15
+ }, re = { class: "flex items-center flex-shrink-0" }, ue = { class: "fm-typo-en-body-lg-600 flex-1" }, de = { class: "flex gap-8" }, ce = { class: "flex flex-col gap-4 w-full flex-1 min-h-0" }, ve = { class: "flex items-center gap-8 flex-shrink-0" }, me = { class: "flex-1 border border-fm-color-border-secondary rounded-lg overflow-hidden overflow-y-auto min-h-0" }, we = /* @__PURE__ */ H({
16
+ __name: "TemplatePublishDialog",
17
+ props: {
18
+ title: {},
19
+ doc: {},
20
+ controller: {},
21
+ initialPublishedRev: {},
22
+ locations: {},
23
+ enabledLocations: {},
24
+ hideUnpublish: { type: Boolean }
25
+ },
26
+ setup(C) {
27
+ const o = C, r = g(o.initialPublishedRev ?? {}), t = g(), n = g(/* @__PURE__ */ new Set()), w = oe(), F = Z(), p = le(), E = u(() => {
28
+ var l;
29
+ return ((l = F.sessionUser.value) == null ? void 0 : l.role.isAdmin) ?? !1;
30
+ }), _ = (l) => l.status !== "invalid" && l.status !== "pendingRemoval", R = u(() => {
31
+ var e;
32
+ return ((e = o.enabledLocations) != null && e.length ? o.enabledLocations : o.locations).map((a) => {
33
+ var s;
34
+ if (!!!w.locationByDbName[a.dbName])
35
+ return {
36
+ ...a,
37
+ status: "invalid"
38
+ };
39
+ const h = !!(((s = r.value) == null ? void 0 : s[a.dbName]) ?? []).find(
40
+ (k) => k._id === o.doc._id && (k.updatedAt ? k.updatedAt === o.doc.updatedAt : k._rev === o.doc._rev)
41
+ );
42
+ return {
43
+ ...a,
44
+ status: h ? "published" : "outdated",
45
+ state: a.doc.profile.address.state
46
+ };
47
+ });
48
+ }), $ = u(
49
+ () => {
50
+ var l;
51
+ return se(
52
+ r.value,
53
+ o.doc._id,
54
+ (l = o.enabledLocations) == null ? void 0 : l.map((e) => e.dbName)
55
+ ).flatMap((e) => {
56
+ const a = o.locations.find((v) => v.dbName === e);
57
+ return a ? [{ ...a, status: "pendingRemoval" }] : [];
58
+ });
59
+ }
60
+ ), { t: f } = ee(), x = g(""), N = g({
61
+ logic: "AND",
62
+ rules: []
63
+ }), T = [
64
+ {
65
+ type: "string",
66
+ key: "status",
67
+ entity: "inventory",
68
+ values: ["published", "outdated", "pendingRemoval"]
69
+ },
70
+ {
71
+ type: "string",
72
+ key: "state",
73
+ entity: "inventory",
74
+ values: [
75
+ ...new Set(w.locations.map((l) => l.doc.profile.address.state).filter(Boolean))
76
+ ]
77
+ }
78
+ ], d = u(() => {
79
+ const l = x.value.toLowerCase();
80
+ return [...R.value, ...$.value].filter((e) => te(e, N.value)).filter(({ name: e, dbName: a }) => !!(!l || e.toLowerCase().includes(l) || E.value && a.toLowerCase().includes(l)));
81
+ }), S = u(
82
+ () => d.value.filter(_)
83
+ );
84
+ J(
85
+ [x, N],
86
+ () => {
87
+ n.value = /* @__PURE__ */ new Set();
88
+ },
89
+ { deep: !0 }
90
+ );
91
+ const B = u(() => d.value.length === 0 ? !1 : d.value.every((l) => n.value.has(l.dbName))), z = u(() => {
92
+ if (S.value.length === 0) return !1;
93
+ const l = S.value.filter(
94
+ (e) => n.value.has(e.dbName)
95
+ ).length;
96
+ return l > 0 && l < S.value.length;
97
+ });
98
+ function D() {
99
+ B.value ? d.value.forEach((l) => n.value.delete(l.dbName)) : d.value.forEach((l) => n.value.add(l.dbName)), n.value = new Set(n.value);
100
+ }
101
+ function I(l) {
102
+ _(l) && (n.value.has(l.dbName) ? n.value.delete(l.dbName) : n.value.add(l.dbName), n.value = new Set(n.value));
103
+ }
104
+ function V() {
105
+ const l = d.value.filter(
106
+ (e) => _(e) && n.value.has(e.dbName)
107
+ );
108
+ return l.length === 0 ? S.value : l;
109
+ }
110
+ const M = u(() => [
111
+ {
112
+ id: "checkbox",
113
+ header: () => "",
114
+ size: 56,
115
+ cell: (l) => {
116
+ const e = l.row.original;
117
+ return _(e) ? i(A.FmCheckbox, {
118
+ value: e.dbName,
119
+ modelValue: n.value.has(e.dbName),
120
+ "onUpdate:modelValue": () => I(e)
121
+ }) : i("div", { class: "w-56" });
122
+ }
123
+ },
124
+ {
125
+ id: "name",
126
+ header: () => "Name",
127
+ size: "auto",
128
+ cell: (l) => {
129
+ const e = l.row.original;
130
+ return i("div", { class: "flex flex-col" }, [
131
+ i("span", {}, e.name),
132
+ i(
133
+ ne,
134
+ {},
135
+ {
136
+ default: () => i("div", { class: "flex items-center gap-4" }, [
137
+ i(
138
+ "span",
139
+ { class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary" },
140
+ e.dbName
141
+ ),
142
+ i(A.FmButton, {
143
+ variant: "tertiary",
144
+ icon: "content_copy",
145
+ size: "sm",
146
+ onClick: async (a) => {
147
+ a.stopPropagation();
148
+ try {
149
+ await navigator.clipboard.writeText(e.dbName), p == null || p.open({
150
+ title: "Copied to clipboard",
151
+ message: e.name,
152
+ type: "success"
153
+ });
154
+ } catch (v) {
155
+ console.error("Failed to copy:", v);
156
+ }
157
+ }
158
+ })
159
+ ])
160
+ }
161
+ )
162
+ ]);
163
+ }
164
+ },
165
+ {
166
+ id: "status",
167
+ header: () => "Status",
168
+ size: 200,
169
+ cell: (l) => {
170
+ const e = l.row.original, a = e.status === "published";
171
+ if (e.status === "invalid")
172
+ return i(
173
+ "div",
174
+ {
175
+ class: ["fm-status-badge", "fm-status-badge-error-secondary"]
176
+ },
177
+ "Invalid"
178
+ );
179
+ if (e.status === "pendingRemoval")
180
+ return i(
181
+ "div",
182
+ {
183
+ class: ["fm-status-badge", "fm-status-badge-processing"],
184
+ title: "This template is no longer enabled here but the outlet still has it. Publish again to remove it; it stays while an open closing draft uses it."
185
+ },
186
+ "Pending removal"
187
+ );
188
+ let m;
189
+ a && o.controller.unpublishAtLocation && !o.hideUnpublish ? m = i(A.FmButton, {
190
+ variant: "tertiary",
191
+ icon: "block",
192
+ loading: t.value === `unpublish-${e.dbName}`,
193
+ disabled: t.value !== void 0 && t.value !== `unpublish-${e.dbName}`,
194
+ onClick: async () => {
195
+ t.value = `unpublish-${e.dbName}`;
196
+ try {
197
+ const s = await o.controller.unpublishAtLocation(e).delayed(1e3);
198
+ r.value = s;
199
+ } catch (s) {
200
+ console.error("Error unpublishing at location:", s);
201
+ } finally {
202
+ t.value = void 0;
203
+ }
204
+ }
205
+ }) : a || (m = i(A.FmButton, {
206
+ variant: "tertiary",
207
+ icon: "ios_share",
208
+ loading: t.value === `publish-${e.dbName}`,
209
+ disabled: t.value !== void 0 && t.value !== `publish-${e.dbName}`,
210
+ onClick: async () => {
211
+ t.value = `publish-${e.dbName}`;
212
+ try {
213
+ const s = await o.controller.publishAtLocation(e).delayed(1e3);
214
+ r.value = s;
215
+ } catch (s) {
216
+ console.error("Error publishing at location:", s);
217
+ } finally {
218
+ t.value = void 0;
219
+ }
220
+ }
221
+ }));
222
+ const h = [
223
+ i(
224
+ "div",
225
+ {
226
+ class: [
227
+ "fm-status-badge",
228
+ a ? "fm-status-badge-success-secondary" : "fm-status-badge-info-secondary"
229
+ ]
230
+ },
231
+ f(a ? "inventory.publish.status.published" : "inventory.publish.status.outdated")
232
+ )
233
+ ];
234
+ return m && h.push(m), i("div", { class: "flex items-center gap-8" }, h);
235
+ }
236
+ }
237
+ ]);
238
+ async function K() {
239
+ t.value = "all";
240
+ try {
241
+ const l = V(), e = $.value.length, a = await o.controller.publishAll(l).delayed(1e3);
242
+ r.value = a, j(e, $.value.length);
243
+ } catch (l) {
244
+ console.error("Error publishing all:", l);
245
+ } finally {
246
+ t.value = void 0;
247
+ }
248
+ }
249
+ function j(l, e) {
250
+ l === 0 && e === 0 || p == null || p.open({
251
+ title: `Removed from ${l - e} of ${l} outlet${l === 1 ? "" : "s"} no longer enabled`,
252
+ message: e ? `${e} still pending removal: an open closing draft may still use it, or removal failed. Publish again later.` : void 0,
253
+ type: e ? "warning" : "success"
254
+ });
255
+ }
256
+ async function O() {
257
+ if (o.controller.unpublishAll) {
258
+ t.value = "unpublish-all";
259
+ try {
260
+ const l = V(), e = await o.controller.unpublishAll(l).delayed(1e3);
261
+ r.value = e;
262
+ } catch (l) {
263
+ console.error("Error unpublishing all:", l);
264
+ } finally {
265
+ t.value = void 0;
266
+ }
267
+ }
268
+ }
269
+ const c = u(() => n.value.size), q = u(() => c.value === 0 || c.value === R.value.length ? f("inventory.publish.actions.publishAll") : f("inventory.publish.actions.publishSelected", { count: c.value })), G = u(() => c.value === 0 || c.value === R.value.length ? "Unpublish all" : `Unpublish selected ${c.value} location${c.value === 1 ? "" : "s"}`);
270
+ return (l, e) => {
271
+ const a = L("FmButton"), v = L("FmTextField"), m = L("FmCheckbox"), h = L("FmTable");
272
+ return U(), Q("div", ie, [
273
+ b("div", re, [
274
+ b("div", ue, W(l.title), 1),
275
+ b("div", de, [
276
+ y(a, {
277
+ label: q.value,
278
+ variant: "secondary",
279
+ onClick: e[0] || (e[0] = (s) => K()),
280
+ loading: t.value === "all",
281
+ disabled: t.value !== "all" && t.value !== void 0
282
+ }, null, 8, ["label", "loading", "disabled"]),
283
+ l.controller.unpublishAll && !l.hideUnpublish ? (U(), X(a, {
284
+ key: 0,
285
+ label: G.value,
286
+ variant: "tertiary",
287
+ onClick: e[1] || (e[1] = (s) => O()),
288
+ loading: t.value === "unpublish-all",
289
+ disabled: t.value !== "unpublish-all" && t.value !== void 0
290
+ }, null, 8, ["label", "loading", "disabled"])) : Y("", !0)
291
+ ])
292
+ ]),
293
+ b("div", ce, [
294
+ y(v, {
295
+ modelValue: x.value,
296
+ "onUpdate:modelValue": e[2] || (e[2] = (s) => x.value = s),
297
+ class: "w-full flex-shrink-0",
298
+ placeholder: P(f)("inventory.publish.search.placeholder"),
299
+ "prepend-icon": "search"
300
+ }, null, 8, ["modelValue", "placeholder"]),
301
+ b("div", ve, [
302
+ y(P(ae), {
303
+ modelValue: N.value,
304
+ "onUpdate:modelValue": e[3] || (e[3] = (s) => N.value = s),
305
+ attributes: T
306
+ }, null, 8, ["modelValue"]),
307
+ y(m, {
308
+ value: "select-all",
309
+ "model-value": B.value,
310
+ indeterminate: z.value,
311
+ "onUpdate:modelValue": D,
312
+ label: "Select all"
313
+ }, null, 8, ["model-value", "indeterminate"])
314
+ ]),
315
+ b("div", me, [
316
+ y(h, {
317
+ "row-data": d.value,
318
+ "column-defs": M.value,
319
+ "shrink-at": 9999,
320
+ virtual: !0,
321
+ "page-size": d.value.length,
322
+ "hide-footer": ""
323
+ }, null, 8, ["row-data", "column-defs", "page-size"])
324
+ ])
325
+ ])
326
+ ]);
327
+ };
328
+ }
329
+ });
330
+ export {
331
+ we as _
332
+ };