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

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 (136) hide show
  1. package/dist/{App-BYwjYoox.js → App-xSsyvQV_.js} +515 -536
  2. package/dist/{ApprovalView-CvfLuQiG.js → ApprovalView-DfJ0FAiD.js} +9 -9
  3. package/dist/{BindingsDialog-CS0IlwGC.js → BindingsDialog-oAZyjgrN.js} +2 -2
  4. package/dist/{BindingsPicker-CqY5tyvT.js → BindingsPicker-CEIo7myR.js} +8 -8
  5. package/dist/{BindingsTable-BA1CMNtR.js → BindingsTable-BKa-JYRR.js} +4 -4
  6. package/dist/BulkReceiveRequestPage-C6Oyg5-E.js +2839 -0
  7. package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-B6s_QcuY.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-BvleQo5y.js} +1 -1
  8. package/dist/{ClosingDraftView-Bk8TmRfV.js → ClosingDraftView-tJrjqyAC.js} +19 -19
  9. package/dist/{ClosingHistoryView-XMROUlaz.js → ClosingHistoryView-CJQlK4Xc.js} +7 -7
  10. package/dist/{ClosingTemplateView-CxQp2kaI.js → ClosingTemplateView-DYRtdK5h.js} +18 -18
  11. package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-KgvAbmkj.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-DEwi7wFf.js} +1 -1
  12. package/dist/{DefaultView-DNKPKrrr.js → DefaultView-CxTBlkln.js} +2 -2
  13. package/dist/{DeliveryOrderPrintPreview-CfCMlcEC.js → DeliveryOrderPrintPreview-Bywdjc2U.js} +2 -2
  14. package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-BLfRq8o3.js → EmailDialog.vue_vue_type_script_setup_true_lang-DcFAUTdO.js} +38 -33
  15. package/dist/{FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-Bmei7M_d.js → FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-C8c6rmJv.js} +11 -10
  16. package/dist/FeatureCapabilityGate-B41dULfm.js +77 -0
  17. package/dist/FeaturePageGate.vue_vue_type_script_setup_true_lang-D4G6i1D6.js +189 -0
  18. package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-AKDqv1C8.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-CnqH115V.js} +1 -1
  19. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DQIfW9h3.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-QBviJzAO.js} +2 -2
  20. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DrTNzJSz.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BqHtzo20.js} +2 -2
  21. package/dist/{FmMultiselectDialog-CchCZDYp.js → FmMultiselectDialog-CFNZMzlC.js} +2 -2
  22. package/dist/{FmMultiselectDialog-DD6AbolT.js → FmMultiselectDialog-M6CvNFW1.js} +2 -2
  23. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-MqvhtQcN.js → FmUnitInput.vue_vue_type_script_setup_true_lang-BGco50Ma.js} +5 -5
  24. package/dist/{ImportView-f35OUKFU.js → ImportView-C2GOmpuK.js} +6 -6
  25. package/dist/{IngredientsView-CLC1di0L.js → IngredientsView-wB9kGiOK.js} +15 -15
  26. package/dist/{IntegrationExplorerView-BWzUCAD0.js → IntegrationExplorerView-BujwGE4q.js} +1414 -1485
  27. package/dist/{IntegrationPlatformView-C78gW5nI.js → IntegrationPlatformView-Wnvj6-BG.js} +4899 -4794
  28. package/dist/{IntegrationView-CnUWuRtH.js → IntegrationView-C77rSbpn.js} +14 -14
  29. package/dist/{InventoryBindingForm-ZGjVpCAI.js → InventoryBindingForm-Bs7Duwfj.js} +1 -1
  30. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CQDso4fW.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DawAEeuP.js} +4 -4
  31. package/dist/{InventoryBindingSummary-B68FLrzC.js → InventoryBindingSummary-BefkYWIr.js} +1 -1
  32. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DlCmFAUg.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BpUMK6fj.js} +2 -2
  33. package/dist/PlanTierBadge.vue_vue_type_script_setup_true_lang-CM3gtYZo.js +19 -0
  34. package/dist/{PlanUpgradeDialog.vue_vue_type_script_setup_true_lang-E6WVZA-D.js → PlanUpgradeDialog.vue_vue_type_script_setup_true_lang-0F-yOcPC.js} +1 -1
  35. package/dist/PremiumUpgradePage.vue_vue_type_script_setup_true_lang-DGAxPOEh.js +58 -0
  36. package/dist/ProductionRunDetailPage-CVx9LS-P.js +2316 -0
  37. package/dist/{ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang--NWDSxIT.js → ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-4aYz5NwS.js} +1626 -1712
  38. package/dist/ProductionRunPage-CuXzmWMc.js +953 -0
  39. package/dist/{PublishView-BvuP_W4l.js → PublishView-Bu8J6ndy.js} +3 -3
  40. package/dist/{PurchaseOrderPrintPreview-CTFNQWED.js → PurchaseOrderPrintPreview-DaslFe8u.js} +2 -2
  41. package/dist/{ReceiveRequestView-Ca9jGuKW.js → ReceiveRequestView-CKPBpN4x.js} +13 -13
  42. package/dist/{RecipeView-Vm2c1vGo.js → RecipeView-BeZ9ljtA.js} +15 -15
  43. package/dist/{SettingsView-49IPE742.js → SettingsView-CWhMdNfn.js} +10 -9
  44. package/dist/{StockView-CylYMrFJ.js → StockView-C5IhPGxi.js} +21 -21
  45. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DYoom8UC.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-B9Rx_9b7.js} +1 -1
  46. package/dist/{SupplierView-CCB8gkT1.js → SupplierView-BSGajl9V.js} +13 -13
  47. package/dist/{SurchargeView-MXCxLWTu.js → SurchargeView-DtAszxTN.js} +7 -7
  48. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-D9LGk7R7.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-CfxroS8u.js} +2 -2
  49. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-Cp2CDerI.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CTj_jYK1.js} +1 -1
  50. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-B_9i5LzY.js +4900 -0
  51. package/dist/{TransferTemplateView-DZEYUHOu.js → TransferTemplateView-D6_AfMja.js} +19 -19
  52. package/dist/{UnitCostHistoryView-TnQwZk3R.js → UnitCostHistoryView-kisQehVE.js} +4 -4
  53. package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-C6o4xrjZ.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-DKoPNZoW.js} +4 -4
  54. package/dist/{UnitView-CFqdNGjT.js → UnitView-jSLennZW.js} +7 -7
  55. package/dist/{WarehouseView-rH3loGl_.js → WarehouseView-CUdWJCMq.js} +8 -8
  56. package/dist/{WastageTemplateView-Cnsi_EJ1.js → WastageTemplateView--B0LSwHa.js} +15 -15
  57. package/dist/api/netsuite-explorer.d.ts +1 -0
  58. package/dist/{app-O0ln50NT.js → app-Bb5HLWTu.js} +2041 -2045
  59. package/dist/app.d.ts +6 -6
  60. package/dist/app.js +1 -1
  61. package/dist/{closing-template-BcXKc7kW.js → closing-template-CgDMayoo.js} +1 -1
  62. package/dist/components/FeatureCapabilityGate.vue.d.ts +2 -0
  63. package/dist/components/FeatureGateLayout.vue.d.ts +11 -0
  64. package/dist/components/FeaturePageGate.spec.d.ts +1 -0
  65. package/dist/components/FeaturePageGate.vue.d.ts +34 -0
  66. package/dist/components/FmAdminCollapsiblePanel.vue.d.ts +1 -1
  67. package/dist/components/FmDroppableField.vue.d.ts +1 -1
  68. package/dist/components/FmInventoryTableToolbar.vue.d.ts +2 -2
  69. package/dist/components/HrmPermissionGuard.vue.d.ts +1 -1
  70. package/dist/components/PremiumUpgradePage.vue.d.ts +2 -0
  71. package/dist/{date2-BVVlNlAO.js → date2-D9gB9BE-.js} +1 -1
  72. package/dist/{dayjs.min-86T3g7jl.js → dayjs.min-CumM_kH7.js} +1 -1
  73. package/dist/{decimal-BceSQ9qu.js → decimal-CVF1rRoj.js} +2 -2
  74. package/dist/{defineDeepModel-CYCLZ-jP.js → defineDeepModel-DE-DsQjm.js} +1 -1
  75. package/dist/{duplicate-template-BOQW9uDO.js → duplicate-template-CFYtQfQn.js} +1 -1
  76. package/dist/feature-flags/vue.d.ts +22 -1
  77. package/dist/{feature-SfaxOOo8.js → feature-kti8bU8q.js} +412 -346
  78. package/dist/{format-time-from-id-DcZjh4zF.js → format-time-from-id-CWZ5VGvM.js} +1 -1
  79. package/dist/{format-unit-display-B_Leyj1M.js → format-unit-display-BlxdvskN.js} +12 -12
  80. package/dist/{id-to-date-CxJMEppi.js → id-to-date-BaH_1Kui.js} +1 -1
  81. package/dist/{import-export.helper-CTzQihBw.js → import-export.helper-8rKrOB0E.js} +5 -5
  82. package/dist/{index-D5JOuvFG.js → index-B9p_OEdk.js} +1 -1
  83. package/dist/{index-DiN65wc9.js → index-BHc3cNyz.js} +3 -3
  84. package/dist/{index-WnJgGINW.js → index-MEUJonBr.js} +1 -1
  85. package/dist/layout/SingleColumnLayout.vue.d.ts +1 -1
  86. package/dist/{lz-string-COM8L2Yg.js → lz-string-IiazGN0W.js} +1 -1
  87. package/dist/{netsuite-B4PKJ2O4.js → netsuite-BeDxaeKM.js} +2 -2
  88. package/dist/netsuite-explorer-4IluitzS.js +79 -0
  89. package/dist/{predefined-templates-jno0IPO6.js → predefined-templates-D4qVID1q.js} +1 -1
  90. package/dist/{purchase-order-template-CBgiJ239.js → purchase-order-template-GTOntq3C.js} +1 -1
  91. package/dist/{recalculationUtils-C-dyQAGg.js → recalculationUtils-Dye8x2TO.js} +1 -1
  92. package/dist/{row-action.enum-D2CmAs2h.js → row-action.enum-CVJbq_-y.js} +1 -1
  93. package/dist/{rules-CByHkO8L.js → rules-Y3zXVj3i.js} +3 -3
  94. package/dist/{stock-DrSVVTuZ.js → stock-BIjTQFsR.js} +2 -2
  95. package/dist/{stock-DbyYZzKm.js → stock-BR8x3nlx.js} +1 -1
  96. package/dist/stores/feature.d.ts +21 -1
  97. package/dist/stores/feature.load-state.spec.d.ts +1 -0
  98. package/dist/stores/warehouse.d.ts +1 -1
  99. package/dist/style.css +1 -1
  100. package/dist/{supplier-DcqbvDxz.js → supplier-CbdCjiIB.js} +2 -2
  101. package/dist/{surcharge-BqcD_sf2.js → surcharge-BoXLK6o0.js} +1 -1
  102. package/dist/tsconfig.app.tsbuildinfo +1 -1
  103. package/dist/{uom-rules-2cAqJPJa.js → uom-rules-C5h1AoPJ.js} +1 -1
  104. package/dist/{use-ingredient-select-dialog-DwQn7p6y.js → use-ingredient-select-dialog-D196q_qk.js} +2 -2
  105. package/dist/{use-inventory-binding-dialog-Id5sz9Xu.js → use-inventory-binding-dialog-B4IhhCjM.js} +2 -2
  106. package/dist/{use-template-enabled-locations-8RnaHV8u.js → use-template-enabled-locations-CDKP3kTS.js} +2 -2
  107. package/dist/{use-transfer-locations-JvPP8F4f.js → use-transfer-locations-DE4vxSDp.js} +2 -2
  108. package/dist/{useHrmPermission-OGla5jyF.js → useHrmPermission-D1dkveCP.js} +1 -1
  109. package/dist/{useNavigationMenu-BVJlsjVn.js → useNavigationMenu-N5_7da8m.js} +39 -39
  110. package/dist/{useSseClient-BaM0oGDR.js → useSseClient-CKpNaz5g.js} +1 -1
  111. package/dist/views/changelog/composables/use-snapshot-diff.d.ts +2 -2
  112. package/dist/views/integration/IntegrationPlatformView.vue.d.ts +2 -0
  113. package/dist/views/production-run/ProductionRunDetailPage.spec.d.ts +1 -0
  114. package/dist/views/production-run/ProductionRunDetailPage.vue.d.ts +15 -0
  115. package/dist/views/production-run/ProductionRunPage.vue.d.ts +2 -0
  116. package/dist/views/production-run/features/detail/use-production-run-detail.d.ts +11 -1
  117. package/dist/views/production-run/shared/helpers/production-run-navigation.d.ts +0 -1
  118. package/dist/views/production-run/shared/ui/ProductionRunInfoBadge.vue.d.ts +1 -1
  119. package/dist/views/production-run/shared/ui/ProductionRunInfoText.vue.d.ts +1 -1
  120. package/dist/views/production-run/shared/ui/ProductionRunScrollHint.vue.d.ts +2 -2
  121. package/dist/views/production-run/shared/ui/ProductionRunTextarea.vue.d.ts +3 -3
  122. package/dist/views/receive-request/composables/use-receive-request-form.spec.d.ts +1 -0
  123. package/dist/views/receive-request-bulk/BulkReceiveRequestPage.vue.d.ts +2 -0
  124. package/dist/views/receive-request-bulk/components/CreateTransferWizard.spec.d.ts +1 -0
  125. package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-form.d.ts +6 -6
  126. package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-form.readiness.spec.d.ts +1 -0
  127. package/dist/views/warehouse/components/WarehouseForm.vue.d.ts +2 -2
  128. package/dist/{PlanTierBadge.vue_vue_type_script_setup_true_lang-DwUCuX11.js → vue-CxSKQOrZ.js} +84 -68
  129. package/dist/{vue-i18n-Cf9XKwOr.js → vue-i18n-CTR_IUvd.js} +258 -258
  130. package/dist/{xlsx.util-EZTW-mf4.js → xlsx.util-J9pxGRQD.js} +2 -2
  131. package/package.json +4 -4
  132. package/dist/BulkReceiveRequestView-CFaMPFfO.js +0 -2657
  133. package/dist/FeatureCapabilityGate-CFUPteG8.js +0 -74
  134. package/dist/ProductionRunDetailView-DPcovCY1.js +0 -2312
  135. package/dist/ProductionRunView-DJXZ_hmi.js +0 -931
  136. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-BIc4mZJI.js +0 -4847
@@ -1,931 +0,0 @@
1
- import { defineComponent as ae, computed as m, createElementBlock as k, createCommentVNode as H, openBlock as p, withModifiers as ot, createVNode as C, unref as r, ref as h, watch as fe, onMounted as ke, onBeforeUnmount as Re, resolveComponent as ne, Fragment as X, createElementVNode as s, createTextVNode as _e, toDisplayString as b, withCtx as G, renderList as xe, normalizeClass as se, nextTick as rt, watchEffect as xt, h as Q, createBlock as ee, normalizeStyle as wt } from "vue";
2
- import { F as te } from "./index-eGvSlWMU.js";
3
- import { useRouter as kt } from "vue-router";
4
- import { useDialog as Rt, useSnackbar as It, useBreakpoints as $t } from "@feedmepos/ui-library";
5
- import { useI18n as ie, useCoreStore as St } from "@feedmepos/mf-common";
6
- import { u as At, _ as Ct } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DpwneGOV.js";
7
- import { _ as Ft } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-gJQQKKAC.js";
8
- import { F as st } from "./FmAdminBadge-DlplQOHb.js";
9
- import { p as Ie, a as Nt, i as we, _ as Pt, h as Tt, b as Dt, f as Mt, c as zt, d as at, e as Lt, u as Vt, g as Ot, j as Et, P as qt, m as Ut, k as jt, l as Wt, n as Ht, o as Bt, q as ge, r as et, s as tt, t as nt, v as Yt } from "./ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang--NWDSxIT.js";
10
- import { _ as Qt } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DrTNzJSz.js";
11
- import { u as Gt, a as Kt } from "./app-O0ln50NT.js";
12
- import { _ as it } from "./_plugin-vue_export-helper-CHgC5LLL.js";
13
- const Jt = /* @__PURE__ */ ae({
14
- __name: "ProductionRunActionsCell",
15
- props: {
16
- run: {}
17
- },
18
- emits: ["action"],
19
- setup(q, { emit: o }) {
20
- const i = q, N = o, { t: u } = ie(), R = m(
21
- () => Ie(i.run, u("inventory.production.run.list.untitled"))
22
- ), x = {
23
- request: 0,
24
- prepare: 0,
25
- complete: 0,
26
- update: 1,
27
- close: 1,
28
- cancel: 2
29
- }, f = m(
30
- () => Nt(i.run).filter(({ action: t }) => t !== "request" || i.run.plan.items.length > 0).sort((t, d) => we(i.run) && t.action === "close" ? -1 : we(i.run) && d.action === "close" ? 1 : x[t.action] - x[d.action]).map(({ action: t }) => t)
31
- );
32
- function w(t) {
33
- return t === "complete" && Tt(i.run) ? u("inventory.production.run.detail.pendingStock.resume") : u(`inventory.production.run.list.rowActions.${t}`);
34
- }
35
- const c = m(
36
- () => f.value.map((t) => ({
37
- id: t,
38
- label: w(t),
39
- destructive: t === "cancel"
40
- }))
41
- );
42
- function v(t) {
43
- N("action", t);
44
- }
45
- return (t, d) => f.value.length ? (p(), k("div", {
46
- key: 0,
47
- class: "production-run-action-interactive relative flex items-center justify-center",
48
- onClick: d[0] || (d[0] = ot(() => {
49
- }, ["stop"]))
50
- }, [
51
- C(Pt, {
52
- items: c.value,
53
- placement: "bottom-end",
54
- "menu-testid": "run-actions-menu",
55
- "accessible-label": r(u)("inventory.production.run.list.actionsFor", { name: R.value }),
56
- onSelect: v
57
- }, null, 8, ["items", "accessible-label"])
58
- ])) : H("", !0);
59
- }
60
- }), Xt = ["id"], Zt = {
61
- key: 0,
62
- class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
63
- }, en = {
64
- key: 1,
65
- class: "production-run-items-interactive relative min-w-0"
66
- }, tn = { class: "min-w-0 overflow-hidden whitespace-nowrap" }, nn = {
67
- key: 0,
68
- class: "shrink-0",
69
- "aria-hidden": "true"
70
- }, on = ["data-hidden-count"], rn = ["aria-label"], sn = { class: "fm-typo-en-body-sm-600 mb-8 text-fm-color-typo-primary" }, an = { class: "flex flex-col gap-8 border-t border-fm-color-neutral-gray-100 pt-8" }, ln = { class: "text-fm-color-typo-primary" }, un = { class: "shrink-0 text-fm-color-typo-secondary" };
71
- let cn = 0;
72
- const dn = /* @__PURE__ */ ae({
73
- __name: "ProductionRunItemsCell",
74
- props: {
75
- run: {},
76
- resolveSku: {},
77
- rowLinkFocused: { type: Boolean, default: !1 },
78
- descriptionId: {},
79
- wrap: { type: Boolean, default: !1 }
80
- },
81
- setup(q) {
82
- const o = q, { t: i } = ie(), N = h(!1), u = m(() => N.value || o.rowLinkFocused), R = h(null), x = h(null), f = h(null), w = h(Number.POSITIVE_INFINITY), c = h(!1), v = typeof navigator < "u" && /safari/i.test(navigator.userAgent) && !/(chrome|chromium|crios|android)/i.test(navigator.userAgent), t = ++cn, d = `production-run-items-tooltip-${t}`, T = `production-run-items-description-${t}`, P = m(() => o.descriptionId ?? T), l = 44;
83
- let _ = null, g = null, O = null, B = !1;
84
- const I = m(
85
- () => o.run.plan.items.map((a, S) => {
86
- const D = o.resolveSku(a.skuId), $ = Dt(a.measurement) ? a.measurement : null, V = ($ == null ? void 0 : $.abbrev) ?? null, j = Mt(a.requestedAmount, V, {
87
- precision: a.requestedAmount.precision
88
- });
89
- return {
90
- key: `${a.skuId}-${S}`,
91
- name: (D == null ? void 0 : D.name) ?? a.skuId,
92
- quantity: V ? j : `${j} · ${i("inventory.production.run.list.itemsUnitUnresolved")}`
93
- };
94
- })
95
- ), z = m(() => I.value.slice(0, w.value)), K = m(() => I.value.map(({ name: a }) => a).join(", ")), U = m(() => z.value.map(({ name: a }) => a).join(", ")), L = m(
96
- () => o.wrap ? 0 : Math.max(0, I.value.length - z.value.length)
97
- ), Z = m(() => L.value > 99 ? "99+" : `+${L.value}`), ye = m(
98
- () => I.value.map(({ name: a, quantity: S }) => `${a}: ${S}`).join(", ")
99
- );
100
- function he() {
101
- if (o.wrap) {
102
- w.value = I.value.length, c.value = !1;
103
- return;
104
- }
105
- const a = x.value, S = f.value;
106
- if (!a || !S || a.clientWidth <= 0) return;
107
- const D = Array.from(S.children).map((W) => W.offsetWidth);
108
- if (!D.length || D.reduce((W, Y) => W + Y, 0) <= a.clientWidth) {
109
- w.value = I.value.length, c.value = !1;
110
- return;
111
- }
112
- c.value = !0;
113
- const $ = Math.max(0, a.clientWidth - l);
114
- let V = 0, j = 0;
115
- for (const W of D) {
116
- if (V + W > $) break;
117
- V += W, j++;
118
- }
119
- w.value = Math.min(I.value.length, Math.max(1, j + 1));
120
- }
121
- function J() {
122
- B || (B = !0, rt(() => {
123
- B = !1, he();
124
- }));
125
- }
126
- function oe() {
127
- _ && (g !== x.value && (g && _.unobserve(g), g = x.value, g && _.observe(g)), O !== f.value && (O && _.unobserve(O), O = f.value, O && _.observe(O)), J());
128
- }
129
- fe(
130
- () => I.value.map(({ name: a }) => a).join("\0"),
131
- () => {
132
- w.value = Number.POSITIVE_INFINITY, J();
133
- },
134
- { flush: "post" }
135
- ), fe(
136
- () => o.wrap,
137
- () => {
138
- w.value = Number.POSITIVE_INFINITY, J();
139
- },
140
- { flush: "post" }
141
- ), fe([x, f], oe, { flush: "post" }), ke(() => {
142
- typeof ResizeObserver < "u" && (_ = new ResizeObserver(J), oe()), J();
143
- }), Re(() => _ == null ? void 0 : _.disconnect());
144
- function le(a) {
145
- var S, D;
146
- a !== u.value && (u.value ? (S = R.value) == null || S.show() : (D = R.value) == null || D.hide());
147
- }
148
- return (a, S) => {
149
- const D = ne("FmPopover");
150
- return p(), k(X, null, [
151
- s("span", {
152
- id: P.value,
153
- "data-testid": "run-items-a11y-description",
154
- class: "sr-only"
155
- }, [
156
- L.value ? (p(), k(X, { key: 0 }, [
157
- _e(b(r(i)("inventory.production.run.list.itemsHidden", { count: L.value })) + ". ", 1)
158
- ], 64)) : H("", !0),
159
- _e(" " + b(I.value.length ? r(i)("inventory.production.run.list.itemsLabel", { names: ye.value }) : r(i)("inventory.production.run.list.itemsNone")), 1)
160
- ], 8, Xt),
161
- I.value.length === 0 ? (p(), k("span", Zt, b(r(i)("inventory.production.run.list.itemsNone")), 1)) : (p(), k("div", en, [
162
- C(D, {
163
- ref_key: "popover",
164
- ref: R,
165
- "show-popover": u.value,
166
- placement: "bottom-start",
167
- onPopoverChanged: le
168
- }, {
169
- "popover-button": G(() => [
170
- s("div", {
171
- ref_key: "disclosureContainer",
172
- ref: x,
173
- "data-testid": "items-disclosure-container",
174
- class: se(["flex w-full max-w-full min-w-0 gap-4 text-left", a.wrap ? "items-start overflow-visible" : "items-center overflow-hidden"]),
175
- onMouseenter: S[0] || (S[0] = ($) => N.value = !0),
176
- onMouseleave: S[1] || (S[1] = ($) => N.value = !1)
177
- }, [
178
- s("span", {
179
- "data-testid": "run-items-summary",
180
- class: se([
181
- "fm-typo-en-body-md-400 min-w-0 flex-1 text-fm-color-typo-primary",
182
- a.wrap ? "whitespace-normal break-words" : r(v) ? "flex overflow-hidden whitespace-nowrap" : "truncate"
183
- ])
184
- }, [
185
- r(v) && !a.wrap ? (p(), k(X, { key: 0 }, [
186
- s("span", tn, b(U.value), 1),
187
- c.value ? (p(), k("span", nn, "…")) : H("", !0)
188
- ], 64)) : (p(), k(X, { key: 1 }, [
189
- _e(b(K.value), 1)
190
- ], 64))
191
- ], 2),
192
- L.value ? (p(), k("span", {
193
- key: 0,
194
- "data-testid": "run-items-overflow",
195
- "data-hidden-count": L.value,
196
- "data-production-info-size": "sm",
197
- "aria-hidden": "true",
198
- class: "inline-flex h-[20px] shrink-0 items-center justify-center whitespace-nowrap rounded-full bg-fm-color-neutral-gray-100 px-[8px] text-[12px] font-normal leading-[18px] text-fm-color-typo-primary"
199
- }, b(Z.value), 9, on)) : H("", !0),
200
- s("span", {
201
- ref_key: "measureRail",
202
- ref: f,
203
- "data-testid": "run-items-measure",
204
- "aria-hidden": "true",
205
- class: "fm-typo-en-body-md-400 pointer-events-none invisible absolute w-max whitespace-nowrap"
206
- }, [
207
- (p(!0), k(X, null, xe(I.value, ($, V) => (p(), k("span", {
208
- key: $.key,
209
- "data-testid": "run-item-measure"
210
- }, b(V ? `, ${$.name}` : $.name), 1))), 128))
211
- ], 512)
212
- ], 34)
213
- ]),
214
- default: G(() => [
215
- s("div", {
216
- id: d,
217
- "data-testid": "run-items-disclosure",
218
- role: "tooltip",
219
- "aria-label": r(i)("inventory.production.run.list.itemsDisclosure"),
220
- class: "pointer-events-none min-w-[288px] p-12"
221
- }, [
222
- s("h3", sn, b(r(i)("inventory.production.run.list.itemsCount", { count: I.value.length })), 1),
223
- s("ul", an, [
224
- (p(!0), k(X, null, xe(I.value, ($) => (p(), k("li", {
225
- key: $.key,
226
- class: "fm-typo-en-body-sm-400 flex items-start justify-between gap-16"
227
- }, [
228
- s("span", ln, b($.name), 1),
229
- s("span", un, b($.quantity), 1)
230
- ]))), 128))
231
- ])
232
- ], 8, rn)
233
- ]),
234
- _: 1
235
- }, 8, ["show-popover"])
236
- ]))
237
- ], 64);
238
- };
239
- }
240
- }), pn = ["href", "aria-describedby"], mn = /* @__PURE__ */ ae({
241
- __name: "ProductionRunNameCell",
242
- props: {
243
- name: {},
244
- href: {},
245
- descriptionId: {},
246
- wrap: { type: Boolean, default: !1 }
247
- },
248
- emits: ["open", "focus", "blur"],
249
- setup(q, { emit: o }) {
250
- const i = q, N = o, u = h(null), R = h(!1);
251
- let x = null, f = !1;
252
- function w() {
253
- const t = u.value;
254
- R.value = !i.wrap && !!t && t.scrollWidth > t.clientWidth;
255
- }
256
- function c() {
257
- f || (f = !0, rt(() => {
258
- f = !1, w();
259
- }));
260
- }
261
- fe(() => [i.name, i.wrap], c, { flush: "post" }), ke(() => {
262
- typeof ResizeObserver < "u" && u.value && (x = new ResizeObserver(c), x.observe(u.value)), c();
263
- }), Re(() => x == null ? void 0 : x.disconnect());
264
- function v(t) {
265
- t.preventDefault(), t.stopPropagation(), N("open");
266
- }
267
- return (t, d) => {
268
- const T = ne("FmTooltip");
269
- return p(), k("a", {
270
- href: t.href,
271
- "aria-describedby": t.descriptionId,
272
- class: "production-run-row-link fm-typo-en-body-md-600 block min-w-0 max-w-full text-left text-fm-color-typo-primary",
273
- onClick: v,
274
- onFocus: d[0] || (d[0] = (P) => N("focus")),
275
- onBlur: d[1] || (d[1] = (P) => N("blur"))
276
- }, [
277
- C(T, {
278
- content: t.name,
279
- disabled: !R.value,
280
- placement: "top",
281
- "z-index": 51,
282
- "content-class": "production-run-name-tooltip-reference"
283
- }, {
284
- default: G(() => [
285
- s("span", {
286
- ref_key: "label",
287
- ref: u,
288
- "data-testid": "run-name-label",
289
- class: se(["block min-w-0", t.wrap ? "whitespace-normal break-words" : "truncate"])
290
- }, b(t.name), 3)
291
- ]),
292
- _: 1
293
- }, 8, ["content", "disabled"])
294
- ], 40, pn);
295
- };
296
- }
297
- }), vn = /* @__PURE__ */ it(mn, [["__scopeId", "data-v-4d06048a"]]), fn = ["aria-label"], yn = { class: "min-w-0 truncate" }, hn = /* @__PURE__ */ ae({
298
- __name: "ProductionRunSortHeader",
299
- props: {
300
- columnId: {},
301
- label: {},
302
- activeColumnId: {},
303
- descending: { type: Boolean }
304
- },
305
- emits: ["toggle"],
306
- setup(q, { emit: o }) {
307
- const i = q, N = o, { t: u } = ie(), R = m(() => i.activeColumnId === i.columnId), x = m(
308
- () => R.value ? u(`inventory.production.run.list.sort.${i.descending ? "descending" : "ascending"}`) : u("inventory.production.run.list.sort.unsorted")
309
- ), f = m(
310
- () => R.value ? i.descending ? "arrow_downward" : "arrow_upward" : "unfold_more"
311
- ), w = m(
312
- () => u("inventory.production.run.list.sort.label", {
313
- column: i.label,
314
- direction: x.value
315
- })
316
- ), c = h(null), v = h(null);
317
- return ke(() => {
318
- var t;
319
- v.value = ((t = c.value) == null ? void 0 : t.closest("th")) ?? null;
320
- }), xt(() => {
321
- v.value && v.value.setAttribute(
322
- "aria-sort",
323
- R.value ? i.descending ? "descending" : "ascending" : "none"
324
- );
325
- }), Re(() => {
326
- var t;
327
- return (t = v.value) == null ? void 0 : t.removeAttribute("aria-sort");
328
- }), (t, d) => {
329
- const T = ne("FmIcon");
330
- return p(), k("button", {
331
- ref_key: "button",
332
- ref: c,
333
- type: "button",
334
- class: "production-run-sort-header flex h-[35px] w-full items-center gap-4 px-16 text-left fm-typo-en-body-md-600 text-fm-color-typo-secondary hover:text-fm-color-typo-primary focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-fm-color-primary",
335
- "aria-label": w.value,
336
- onClick: d[0] || (d[0] = ot((P) => N("toggle", t.columnId), ["stop"]))
337
- }, [
338
- s("span", yn, b(t.label), 1),
339
- C(T, {
340
- name: f.value,
341
- size: "sm",
342
- "aria-hidden": "true",
343
- class: "shrink-0"
344
- }, null, 8, ["name"])
345
- ], 8, fn);
346
- };
347
- }
348
- });
349
- let bn = 0;
350
- function _n(q, o = () => null, i = () => {
351
- }, N = () => {
352
- }, u = () => {
353
- }, R = () => !1, x = (f) => `/production-run/${encodeURIComponent(f._id)}`) {
354
- var P;
355
- const { t: f } = ie(), w = St(), c = ++bn, v = h(null), t = (l) => `production-run-table-${c}-items-${encodeURIComponent(l._id)}`, d = (l, _) => {
356
- const g = N();
357
- return Q(hn, {
358
- columnId: l,
359
- label: _,
360
- activeColumnId: g == null ? void 0 : g.id,
361
- descending: g == null ? void 0 : g.desc,
362
- onToggle: u
363
- });
364
- };
365
- return { columnDefs: [
366
- {
367
- id: "runNo",
368
- header: () => d("runNo", "#"),
369
- enableSorting: !1,
370
- size: 80,
371
- meta: { headerClass: "p-0" },
372
- cell: (l) => Q(
373
- "span",
374
- { class: "fm-typo-en-body-md-600 text-fm-color-typo-primary" },
375
- `${l.row.original.runNo}`
376
- )
377
- },
378
- {
379
- id: "name",
380
- header: () => d("name", f("inventory.production.run.list.columns.name")),
381
- enableSorting: !1,
382
- minSize: 240,
383
- size: 320,
384
- maxSize: 320,
385
- meta: { headerClass: "p-0" },
386
- cell: (l) => Q(vn, {
387
- name: Ie(
388
- l.row.original,
389
- f("inventory.production.run.list.untitled")
390
- ),
391
- href: x(l.row.original),
392
- descriptionId: t(l.row.original),
393
- wrap: R(),
394
- onOpen: () => i(l.row.original),
395
- onFocus: () => {
396
- v.value = l.row.original._id;
397
- },
398
- onBlur: () => {
399
- v.value === l.row.original._id && (v.value = null);
400
- }
401
- })
402
- },
403
- {
404
- id: "items",
405
- header: () => f("inventory.production.run.list.columns.items"),
406
- enableSorting: !1,
407
- minSize: 220,
408
- size: 280,
409
- maxSize: 280,
410
- cell: (l) => Q(dn, {
411
- run: l.row.original,
412
- resolveSku: o,
413
- descriptionId: t(l.row.original),
414
- wrap: R(),
415
- rowLinkFocused: v.value === l.row.original._id
416
- })
417
- },
418
- ...(P = w.sessionUser.value) != null && P.role.isAdmin ? [
419
- {
420
- id: "statusForAdmin",
421
- header: () => Q(st, {}, () => f("inventory.production.run.list.columns.status")),
422
- cell: (l) => l.row.original.status,
423
- enableSorting: !1,
424
- size: 120
425
- }
426
- ] : [],
427
- {
428
- id: "status",
429
- header: () => d("status", f("inventory.production.run.list.columns.status")),
430
- enableSorting: !1,
431
- size: 120,
432
- meta: { headerClass: "p-0" },
433
- cell: (l) => Q(zt, { status: l.row.original.status })
434
- },
435
- {
436
- id: "updatedAt",
437
- header: () => d("updatedAt", f("inventory.production.run.list.columns.updated")),
438
- enableSorting: !1,
439
- minSize: 180,
440
- size: 200,
441
- maxSize: 200,
442
- meta: { headerClass: "p-0" },
443
- cell: (l) => {
444
- const _ = l.row.original, g = at(_);
445
- return Q(
446
- "span",
447
- { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary whitespace-nowrap" },
448
- Lt((g == null ? void 0 : g.at) ?? _.createdAt)
449
- );
450
- }
451
- },
452
- {
453
- id: "action",
454
- header: "",
455
- enableSorting: !1,
456
- cell: (l) => Q(Jt, {
457
- run: l.row.original,
458
- onAction: (_) => q(_, l.row.original)
459
- }),
460
- size: 40,
461
- meta: {
462
- cellClass: "",
463
- headerClass: ""
464
- }
465
- }
466
- ] };
467
- }
468
- const gn = { class: "sr-only" }, xn = ["aria-label"], wn = {
469
- key: 0,
470
- "data-testid": "production-run-history-scope",
471
- class: "flex shrink-0 flex-wrap items-center justify-between gap-8"
472
- }, kn = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Rn = {
473
- key: 1,
474
- role: "alert",
475
- class: "w-full fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
476
- }, In = ["aria-label"], $n = ["aria-label"], Sn = {
477
- key: 2,
478
- "data-testid": "production-run-list-empty",
479
- class: "rounded-md border border-dashed border-fm-color-neutral-gray-200 p-48 text-center"
480
- }, An = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Cn = { class: "mx-auto mt-4 max-w-[25rem] fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Fn = {
481
- key: 3,
482
- "data-testid": "production-run-list-no-match",
483
- class: "rounded-md border border-dashed border-fm-color-neutral-gray-200 p-40 text-center"
484
- }, Nn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Pn = { class: "mx-auto mt-4 max-w-[25rem] fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Tn = { class: "flex flex-col gap-[8px] py-[8px]" }, Dn = {
485
- "data-testid": "production-run-mobile-run-number",
486
- class: "flex items-center gap-[4px]"
487
- }, Mn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary" }, zn = { class: "flex min-w-0 flex-col gap-[2px]" }, Ln = { class: "text-[12px] font-medium leading-[18px] text-fm-color-typo-secondary" }, Vn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, On = { class: "flex min-w-0 flex-col gap-[2px]" }, En = { class: "text-[12px] font-medium leading-[18px] text-fm-color-typo-secondary" }, qn = {
488
- "data-testid": "production-run-admin-status",
489
- class: "flex flex-col gap-[4px]"
490
- }, Un = { class: "text-[12px] font-medium leading-[18px] text-fm-color-typo-secondary" }, jn = { class: "flex flex-col gap-[2px]" }, Wn = { class: "text-[12px] font-medium leading-[18px] text-fm-color-typo-secondary" }, Hn = { class: "flex flex-col gap-[2px]" }, Bn = { class: "text-[12px] font-medium leading-[18px] text-fm-color-typo-secondary" }, Yn = /* @__PURE__ */ ae({
491
- __name: "ProductionRunView",
492
- setup(q) {
493
- const { t: o } = ie(), i = kt(), N = Rt(), u = It(), R = Vt(), x = Gt(), f = Kt(), w = At();
494
- Ot();
495
- const c = h([]), v = h(!1), t = h(null), d = h(null), T = h(!1), P = h(null), l = m(() => ({
496
- loading: v.value || T.value,
497
- loaded: !v.value && !t.value,
498
- hasMore: d.value !== null,
499
- error: P.value ?? t.value
500
- })), _ = h(""), g = h("all"), O = h([{ id: "updatedAt", desc: !0 }]), B = h(!1), I = h(null), z = h(null), K = h(null);
501
- let U = 0, L = 0;
502
- const Z = m(
503
- () => c.value.find((e) => e._id === z.value) ?? null
504
- ), ye = Et(() => Z.value), he = m(() => !!Z.value && we(Z.value)), J = m(
505
- () => ye.ingredientLines.value.map((e) => ({
506
- skuId: e.skuId,
507
- name: e.name,
508
- unit: e.unit,
509
- unitRef: e.unitRef,
510
- outputSkuIds: e.outputSkuIds
511
- }))
512
- );
513
- function oe() {
514
- return t.value ? a() : S();
515
- }
516
- function le() {
517
- L++, K.value = null, z.value = null, I.value = null, B.value = !1;
518
- }
519
- async function a() {
520
- const e = ++U;
521
- v.value = !0, t.value = null, d.value = null, T.value = !1, P.value = null;
522
- try {
523
- const n = await R.list();
524
- if (e !== U) return;
525
- c.value = n.items, d.value = n.nextCursor;
526
- } catch (n) {
527
- if (e !== U) return;
528
- const y = ge(n);
529
- t.value = y.message, u == null || u.open({
530
- title: o("inventory.production.run.list.error.load"),
531
- message: y.message,
532
- type: "error"
533
- });
534
- } finally {
535
- e === U && (v.value = !1);
536
- }
537
- }
538
- async function S() {
539
- const e = d.value;
540
- if (!e || v.value || T.value) return;
541
- const n = U;
542
- T.value = !0, P.value = null;
543
- try {
544
- const y = await R.list({ cursor: e });
545
- if (n !== U || e !== d.value) return;
546
- if (y.nextCursor === e)
547
- throw new Error(o("inventory.production.run.list.history.cursorError"));
548
- const A = new Set(c.value.map((E) => E._id));
549
- c.value = [...c.value, ...y.items.filter((E) => !A.has(E._id))], d.value = y.nextCursor;
550
- } catch (y) {
551
- n === U && (P.value = ge(y).message);
552
- } finally {
553
- n === U && (T.value = !1);
554
- }
555
- }
556
- x.watchLocation(() => (le(), a()));
557
- const D = m(
558
- () => qt.map((e) => ({
559
- label: o(`inventory.production.run.list.tabs.${e.key}`),
560
- value: e.key
561
- }))
562
- );
563
- function $(e) {
564
- var n;
565
- return ((n = at(e)) == null ? void 0 : n.at) ?? e.createdAt;
566
- }
567
- function V(e, n, y) {
568
- switch (y) {
569
- case "runNo":
570
- return e.runNo - n.runNo;
571
- case "name":
572
- return tt(e).localeCompare(tt(n));
573
- case "status":
574
- return et(e.status) - et(n.status);
575
- case "updatedAt":
576
- return Date.parse($(e)) - Date.parse($(n));
577
- default:
578
- return 0;
579
- }
580
- }
581
- const j = m(() => {
582
- const e = c.value.filter(
583
- (A) => Ut(A, g.value) && jt(A, _.value, $e)
584
- ), n = O.value[0];
585
- if (!n)
586
- return e.sort(
587
- (A, E) => V(E, A, "updatedAt") || V(E, A, "runNo")
588
- );
589
- const y = n.desc ? -1 : 1;
590
- return e.sort(
591
- (A, E) => y * V(A, E, n.id) || V(E, A, "runNo")
592
- );
593
- }), { breakpoints: W } = $t(), Y = m(() => W.value.xs || W.value.sm), lt = m(() => Y.value ? 10 : 20), ut = m(() => Y.value ? { height: `calc(${w.tableHeight.height} - 16px)` } : w.tableHeight), ct = m(
594
- () => Y.value ? j.value.map((e) => `${e._id}:${e._rev}`).join("|") : "desktop"
595
- );
596
- function dt() {
597
- _.value = "", g.value = "all";
598
- }
599
- function pt(e) {
600
- const n = O.value[0];
601
- O.value = [
602
- (n == null ? void 0 : n.id) === e ? { id: e, desc: !n.desc } : { id: e, desc: !1 }
603
- ];
604
- }
605
- function $e(e) {
606
- return f.skuById[e];
607
- }
608
- function be(e) {
609
- i.push(nt(e._id));
610
- }
611
- function mt(e) {
612
- return i.resolve(nt(e._id)).href;
613
- }
614
- function vt(e, n) {
615
- const y = ++L;
616
- if (z.value = n._id, K.value = null, e === "request") {
617
- N.open(Yt(o)).onPrimary(() => void ft(n._id, y));
618
- return;
619
- }
620
- K.value = e;
621
- }
622
- async function ft(e, n) {
623
- if (!(n !== L || z.value !== e))
624
- try {
625
- const y = await R.request(e);
626
- if (n !== L || z.value !== e || !Se(y)) return;
627
- u == null || u.open({
628
- title: o("inventory.production.run.list.request.success"),
629
- message: o("inventory.production.run.list.request.successMessage", {
630
- name: Ie(y, o("inventory.production.run.list.untitled"))
631
- }),
632
- type: "success"
633
- }), z.value = null;
634
- } catch (y) {
635
- if (n !== L || z.value !== e) return;
636
- u == null || u.open({
637
- title: o("inventory.production.run.list.error.action", {
638
- action: o("inventory.production.run.list.rowActions.request")
639
- }),
640
- message: ge(y).message,
641
- type: "error"
642
- });
643
- }
644
- }
645
- function Se(e) {
646
- const n = c.value.findIndex((A) => A._id === e._id);
647
- if (n < 0) return !1;
648
- const y = [...c.value];
649
- return y[n] = e, c.value = y, !0;
650
- }
651
- function re(e) {
652
- z.value === e._id && Se(e);
653
- }
654
- function yt(e) {
655
- e === null && (K.value = null, z.value = null);
656
- }
657
- function ht() {
658
- le(), a();
659
- }
660
- const { columnDefs: bt } = _n(
661
- vt,
662
- $e,
663
- be,
664
- () => O.value[0],
665
- pt,
666
- () => Y.value,
667
- mt
668
- );
669
- function Ae(e) {
670
- e === "refresh" && a(), e === "create" && (I.value = null, B.value = !0);
671
- }
672
- const _t = m(() => [
673
- {
674
- label: o("inventory.common.refresh"),
675
- value: "refresh",
676
- prependIcon: "refresh"
677
- },
678
- {
679
- label: o("inventory.production.run.list.actions.create"),
680
- value: "create",
681
- prependIcon: "add",
682
- testId: "production-run-mobile-create",
683
- isPrimary: !0
684
- }
685
- ]);
686
- function gt() {
687
- I.value = null, a();
688
- }
689
- return (e, n) => {
690
- const y = ne("FmTabs"), A = ne("FmButton"), E = ne("FmTable");
691
- return p(), ee(Ct, {
692
- title: r(o)("inventory.production.run.list.title"),
693
- "helper-text": r(o)("inventory.production.run.list.caption"),
694
- actions: _t.value,
695
- "onClick:action": Ae
696
- }, {
697
- default: G(() => {
698
- var Ce;
699
- return [
700
- s("div", {
701
- "data-testid": "production-run-list-content",
702
- class: se([
703
- "flex w-full max-h-full flex-col gap-12",
704
- {
705
- "p-0": Y.value,
706
- "px-24": !Y.value
707
- }
708
- ])
709
- }, [
710
- s("h1", gn, b(r(o)("inventory.production.run.list.title")), 1),
711
- C(Qt, {
712
- "change-location": "",
713
- searchable: "",
714
- search: _.value,
715
- "onUpdate:search": n[0] || (n[0] = (F) => _.value = F)
716
- }, null, 8, ["search"]),
717
- s("div", {
718
- class: "flex min-w-0 shrink-0 flex-col gap-12",
719
- "data-testid": "production-run-list-controls",
720
- onVnodeMounted: n[2] || (n[2] = //@ts-ignore
721
- (...F) => r(w).onMounted && r(w).onMounted(...F)),
722
- onVnodeUnmounted: n[3] || (n[3] = //@ts-ignore
723
- (...F) => r(w).onUnmounted && r(w).onUnmounted(...F))
724
- }, [
725
- s("nav", {
726
- class: "min-w-0 overflow-x-auto",
727
- "aria-label": r(o)("inventory.production.run.list.tabsLabel")
728
- }, [
729
- C(y, {
730
- "model-value": g.value,
731
- "onUpdate:modelValue": n[1] || (n[1] = (F) => g.value = F),
732
- items: D.value
733
- }, null, 8, ["model-value", "items"])
734
- ], 8, xn),
735
- !v.value && !t.value && (d.value || P.value) ? (p(), k("div", wn, [
736
- s("p", kn, b(r(o)("inventory.production.run.list.history.scope", { count: c.value.length })), 1),
737
- d.value ? (p(), ee(A, {
738
- key: 0,
739
- "data-testid": "production-run-load-more",
740
- variant: "secondary",
741
- label: r(o)("inventory.production.run.list.history.loadMore"),
742
- loading: T.value,
743
- disabled: T.value,
744
- onClick: S
745
- }, null, 8, ["label", "loading", "disabled"])) : H("", !0),
746
- P.value ? (p(), k("p", Rn, b(P.value), 1)) : H("", !0)
747
- ])) : H("", !0)
748
- ], 512),
749
- s("div", {
750
- id: "production-run-list-panel",
751
- role: "region",
752
- "aria-label": r(o)("inventory.production.run.list.tabsLabel"),
753
- class: se(["flex min-h-0 flex-col", !v.value && !t.value && j.value.length ? "" : "overflow-y-auto"])
754
- }, [
755
- v.value ? (p(), k("div", {
756
- key: 0,
757
- "data-testid": "production-run-list-loading",
758
- role: "status",
759
- class: "w-full space-y-12",
760
- "aria-busy": "true",
761
- "aria-label": r(o)("inventory.production.run.list.loading")
762
- }, [
763
- (p(), k(X, null, xe(6, (F) => s("div", {
764
- key: F,
765
- "data-testid": "production-run-list-skeleton-row",
766
- class: "h-80 w-full animate-pulse rounded-md bg-fm-color-neutral-gray-100"
767
- })), 64))
768
- ], 8, $n)) : t.value ? (p(), ee(Wt, {
769
- key: 1,
770
- "data-testid": "production-run-list-error",
771
- class: "m-16",
772
- role: "alert",
773
- tone: "critical",
774
- title: r(o)("inventory.production.run.list.error.load"),
775
- message: t.value
776
- }, {
777
- actions: G(() => [
778
- C(A, {
779
- "data-testid": "production-run-list-retry",
780
- label: r(o)("inventory.production.run.list.error.retry"),
781
- variant: "secondary",
782
- onClick: a
783
- }, null, 8, ["label"])
784
- ]),
785
- _: 1
786
- }, 8, ["title", "message"])) : c.value.length === 0 ? (p(), k("div", Sn, [
787
- s("div", An, b(r(o)("inventory.production.run.list.empty.noneTitle")), 1),
788
- s("div", Cn, b(r(o)("inventory.production.run.list.empty.noneDescription")), 1),
789
- C(A, {
790
- "data-testid": "production-run-list-empty-create",
791
- class: "mx-auto mt-16",
792
- label: r(o)("inventory.production.run.list.empty.create"),
793
- "prepend-icon": "add",
794
- onClick: n[4] || (n[4] = (F) => Ae("create"))
795
- }, null, 8, ["label"])
796
- ])) : j.value.length === 0 ? (p(), k("div", Fn, [
797
- s("div", Nn, b(r(o)("inventory.production.run.list.empty.noMatchTitle")), 1),
798
- s("div", Pn, b(_.value.trim() ? r(o)("inventory.production.run.list.empty.searchDescription", {
799
- query: _.value.trim()
800
- }) : r(o)("inventory.production.run.list.empty.noMatchDescription")), 1),
801
- C(A, {
802
- "data-testid": "production-run-list-clear-filters",
803
- class: "mx-auto mt-12",
804
- label: r(o)("inventory.production.run.list.empty.clearFilters"),
805
- "aria-label": r(o)("inventory.production.run.list.empty.clearFilters"),
806
- variant: "tertiary",
807
- onClick: dt
808
- }, null, 8, ["label", "aria-label"])
809
- ])) : (p(), ee(E, {
810
- key: ct.value,
811
- class: "production-run-table",
812
- style: wt(ut.value),
813
- "column-defs": r(bt),
814
- "row-data": j.value,
815
- loading: v.value,
816
- "page-size": lt.value,
817
- "pin-header-row": !1,
818
- onRowClick: n[5] || (n[5] = (F) => be(F.original))
819
- }, {
820
- "list-row": G((F) => [
821
- C(Ft, {
822
- "data-testid": "production-run-mobile-row",
823
- class: "production-run-mobile-row !py-8",
824
- row: F,
825
- onRowClick: be
826
- }, {
827
- default: G((M) => {
828
- var Fe, Ne, Pe, ue, Te, De, Me, ze, ce, Le, Ve, Oe, Ee, de, qe, Ue, je, We, pe, He, Be, Ye, Qe, me, Ge;
829
- return [
830
- s("div", Tn, [
831
- s("div", Dn, [
832
- n[7] || (n[7] = s("span", { class: "text-[12px] font-medium leading-[18px] text-fm-color-typo-secondary" }, "#", -1)),
833
- s("div", Mn, [
834
- C(r(te), {
835
- render: (Pe = (Ne = (Fe = M.runNo) == null ? void 0 : Fe.column) == null ? void 0 : Ne.columnDef) == null ? void 0 : Pe.cell,
836
- props: (Te = (ue = M.runNo) == null ? void 0 : ue.getContext) == null ? void 0 : Te.call(ue)
837
- }, null, 8, ["render", "props"])
838
- ])
839
- ]),
840
- s("div", zn, [
841
- s("span", Ln, b(r(o)("inventory.production.run.list.columns.name")), 1),
842
- s("div", Vn, [
843
- C(r(te), {
844
- render: (ze = (Me = (De = M.name) == null ? void 0 : De.column) == null ? void 0 : Me.columnDef) == null ? void 0 : ze.cell,
845
- props: (Le = (ce = M.name) == null ? void 0 : ce.getContext) == null ? void 0 : Le.call(ce)
846
- }, null, 8, ["render", "props"])
847
- ])
848
- ]),
849
- s("div", On, [
850
- s("span", En, b(r(o)("inventory.production.run.list.columns.items")), 1),
851
- C(r(te), {
852
- render: (Ee = (Oe = (Ve = M.items) == null ? void 0 : Ve.column) == null ? void 0 : Oe.columnDef) == null ? void 0 : Ee.cell,
853
- props: (qe = (de = M.items) == null ? void 0 : de.getContext) == null ? void 0 : qe.call(de)
854
- }, null, 8, ["render", "props"])
855
- ]),
856
- M.statusForAdmin ? (p(), ee(st, { key: 0 }, {
857
- default: G(() => {
858
- var Ke, Je, Xe, ve, Ze;
859
- return [
860
- s("div", qn, [
861
- s("span", Un, b(r(o)("inventory.production.run.list.columns.status")), 1),
862
- C(r(te), {
863
- render: (Xe = (Je = (Ke = M.statusForAdmin) == null ? void 0 : Ke.column) == null ? void 0 : Je.columnDef) == null ? void 0 : Xe.cell,
864
- props: (Ze = (ve = M.statusForAdmin) == null ? void 0 : ve.getContext) == null ? void 0 : Ze.call(ve)
865
- }, null, 8, ["render", "props"])
866
- ])
867
- ];
868
- }),
869
- _: 2
870
- }, 1024)) : H("", !0),
871
- s("div", jn, [
872
- s("span", Wn, b(r(o)("inventory.production.run.list.columns.status")), 1),
873
- C(r(te), {
874
- render: (We = (je = (Ue = M.status) == null ? void 0 : Ue.column) == null ? void 0 : je.columnDef) == null ? void 0 : We.cell,
875
- props: (He = (pe = M.status) == null ? void 0 : pe.getContext) == null ? void 0 : He.call(pe)
876
- }, null, 8, ["render", "props"])
877
- ]),
878
- s("div", Hn, [
879
- s("span", Bn, b(r(o)("inventory.production.run.list.columns.updated")), 1),
880
- C(r(te), {
881
- render: (Qe = (Ye = (Be = M.updatedAt) == null ? void 0 : Be.column) == null ? void 0 : Ye.columnDef) == null ? void 0 : Qe.cell,
882
- props: (Ge = (me = M.updatedAt) == null ? void 0 : me.getContext) == null ? void 0 : Ge.call(me)
883
- }, null, 8, ["render", "props"])
884
- ])
885
- ])
886
- ];
887
- }),
888
- _: 2
889
- }, 1032, ["row"])
890
- ]),
891
- _: 1
892
- }, 8, ["style", "column-defs", "row-data", "loading", "page-size"]))
893
- ], 10, In)
894
- ], 2),
895
- B.value ? (p(), ee(Ht, {
896
- key: 0,
897
- show: !0,
898
- run: I.value,
899
- "duplicate-sources": c.value,
900
- "duplicate-source-state": l.value,
901
- onLoadMoreDuplicateSources: oe,
902
- "onUpdate:show": n[6] || (n[6] = (F) => B.value = F),
903
- onSaved: gt
904
- }, null, 8, ["run", "duplicate-sources", "duplicate-source-state"])) : H("", !0),
905
- C(Bt, {
906
- action: K.value,
907
- run: Z.value,
908
- "location-name": ((Ce = r(x)._currentLocation) == null ? void 0 : Ce.name) ?? null,
909
- "duplicate-sources": c.value,
910
- "duplicate-source-state": l.value,
911
- onLoadMoreDuplicateSources: oe,
912
- "at-target": he.value,
913
- ingredients: J.value,
914
- "onUpdate:action": yt,
915
- onEdited: re,
916
- onIssued: re,
917
- onRecorded: re,
918
- onClosed: re,
919
- onCancelled: re,
920
- onReload: ht
921
- }, null, 8, ["action", "run", "location-name", "duplicate-sources", "duplicate-source-state", "at-target", "ingredients"])
922
- ];
923
- }),
924
- _: 1
925
- }, 8, ["title", "helper-text", "actions"]);
926
- };
927
- }
928
- }), ao = /* @__PURE__ */ it(Yn, [["__scopeId", "data-v-53484757"]]);
929
- export {
930
- ao as default
931
- };