@acorex-platform/module-workplacesafety-management-client 0.0.38 → 0.0.48

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 (127) hide show
  1. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-acorex-platform-module-workplacesafety-management-client-Ds0Fkspp.mjs → acorex-platform-module-workplacesafety-management-client-acorex-platform-module-workplacesafety-management-client-C2CZZwOj.mjs} +104 -33
  2. package/fesm2022/acorex-platform-module-workplacesafety-management-client-acorex-platform-module-workplacesafety-management-client-C2CZZwOj.mjs.map +1 -0
  3. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-control-hierarchy-levels.mjs +19 -5
  4. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-control-hierarchy-levels.mjs.map +1 -1
  5. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-control-measure.mjs +19 -5
  6. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-control-measure.mjs.map +1 -1
  7. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-hazard-ppe-rule.mjs +19 -5
  8. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-hazard-ppe-rule.mjs.map +1 -1
  9. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-hazard-register.mjs +19 -5
  10. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-hazard-register.mjs.map +1 -1
  11. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-hazard-risk.mjs +22 -72
  12. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-hazard-risk.mjs.map +1 -1
  13. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-hazard.mjs +20 -6
  14. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-hazard.mjs.map +1 -1
  15. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-ppe-item.mjs +19 -5
  16. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-ppe-item.mjs.map +1 -1
  17. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan-activity.mjs +1516 -0
  18. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan-activity.mjs.map +1 -0
  19. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan-section.mjs +82 -12
  20. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan-section.mjs.map +1 -1
  21. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan-type-section.mjs +82 -12
  22. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan-type-section.mjs.map +1 -1
  23. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan-type.mjs +19 -5
  24. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan-type.mjs.map +1 -1
  25. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan.mjs +39 -6
  26. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan.mjs.map +1 -1
  27. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-template.mjs +20 -5
  28. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-template.mjs.map +1 -1
  29. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-section-type.mjs +19 -5
  30. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-section-type.mjs.map +1 -1
  31. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-work-step-type.mjs +82 -12
  32. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-work-step-type.mjs.map +1 -1
  33. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-BI4TLvSE.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-C46YEBVd.mjs} +21 -21
  34. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-C46YEBVd.mjs.map +1 -0
  35. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-control-hierarchy-levels.entity-COlCNnyK.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-control-hierarchy-levels.entity-oylKTsgJ.mjs} +16 -2
  36. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-control-hierarchy-levels.entity-oylKTsgJ.mjs.map +1 -0
  37. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-control-measure.entity-BrXGzqZU.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-control-measure.entity-DHm1nRwW.mjs} +16 -2
  38. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-control-measure.entity-DHm1nRwW.mjs.map +1 -0
  39. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-ppe-rule.entity-DHJus7OP.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-ppe-rule.entity-DH-hPuAD.mjs} +16 -2
  40. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-ppe-rule.entity-DH-hPuAD.mjs.map +1 -0
  41. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-register.entity-CogjoDox.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-register.entity-g4AT_IiT.mjs} +16 -2
  42. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-register.entity-g4AT_IiT.mjs.map +1 -0
  43. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-risk.entity-9UWHmIXV.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-risk.entity-BwNlWbnC.mjs} +18 -72
  44. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-risk.entity-BwNlWbnC.mjs.map +1 -0
  45. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard.entity-CNPbxULL.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard.entity-Cogwbd1P.mjs} +17 -3
  46. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard.entity-Cogwbd1P.mjs.map +1 -0
  47. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-ppe-item.entity-D5iOBl3P.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-ppe-item.entity-0xqGaPnk.mjs} +16 -2
  48. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-ppe-item.entity-0xqGaPnk.mjs.map +1 -0
  49. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-risk-management.integration-CUZIl8zt.mjs +7 -0
  50. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-risk-management.integration-CUZIl8zt.mjs.map +1 -0
  51. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-activity.entity-CZCYupQT.mjs +324 -0
  52. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-activity.entity-CZCYupQT.mjs.map +1 -0
  53. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-section-dependency-TdIMIkM7.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-section-dependency-D0fzHV_L.mjs} +62 -10
  54. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-section-dependency-D0fzHV_L.mjs.map +1 -0
  55. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-section.entity-DJAI-7lB.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-section.entity-BpziBgGf.mjs} +17 -3
  56. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-section.entity-DJAI-7lB.mjs.map → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-section.entity-BpziBgGf.mjs.map} +1 -1
  57. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-type-section.entity-BGZ1VAW3.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-type-section.entity-D8wL0ned.mjs} +17 -3
  58. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-type-section.entity-D8wL0ned.mjs.map +1 -0
  59. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-type.entity-B6NYL4xi.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-type.entity-DrqQDYn9.mjs} +16 -2
  60. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-type.entity-DrqQDYn9.mjs.map +1 -0
  61. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan.entity-BSUR9jqs.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan.entity-DaRnWCin.mjs} +36 -3
  62. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan.entity-DaRnWCin.mjs.map +1 -0
  63. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-template.entity-CIHy_hLh.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-template.entity-Coj5Rzry.mjs} +17 -2
  64. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-template.entity-Coj5Rzry.mjs.map +1 -0
  65. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-section-type.entity-Cs4nIHou.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-section-type.entity-BU5roQ5-.mjs} +16 -2
  66. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-section-type.entity-BU5roQ5-.mjs.map +1 -0
  67. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-work-step-type.entity-CJFWDOoh.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-work-step-type.entity-DijGV30H.mjs} +17 -3
  68. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-work-step-type.entity-DijGV30H.mjs.map +1 -0
  69. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog.mjs +1 -1
  70. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts.mjs +144 -168
  71. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts.mjs.map +1 -1
  72. package/fesm2022/acorex-platform-module-workplacesafety-management-client-fill-safety-plan.command-lJl0qpvT.mjs +165 -0
  73. package/fesm2022/acorex-platform-module-workplacesafety-management-client-fill-safety-plan.command-lJl0qpvT.mjs.map +1 -0
  74. package/fesm2022/acorex-platform-module-workplacesafety-management-client-hydrate-safety-plan-activity-sections-TrVl3-T6.mjs +240 -0
  75. package/fesm2022/acorex-platform-module-workplacesafety-management-client-hydrate-safety-plan-activity-sections-TrVl3-T6.mjs.map +1 -0
  76. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-index-gbDgxqrV.mjs → acorex-platform-module-workplacesafety-management-client-index-D_LE40Xc.mjs} +130 -398
  77. package/fesm2022/acorex-platform-module-workplacesafety-management-client-index-D_LE40Xc.mjs.map +1 -0
  78. package/fesm2022/acorex-platform-module-workplacesafety-management-client-load-safety-plan-preview-structure-Ce67NSIZ.mjs +136 -0
  79. package/fesm2022/acorex-platform-module-workplacesafety-management-client-load-safety-plan-preview-structure-Ce67NSIZ.mjs.map +1 -0
  80. package/fesm2022/acorex-platform-module-workplacesafety-management-client-local-entities.mjs +1 -1
  81. package/fesm2022/acorex-platform-module-workplacesafety-management-client-local-entities.mjs.map +1 -1
  82. package/fesm2022/acorex-platform-module-workplacesafety-management-client-preview-safety-plan.command-DJqqiYlD.mjs +102 -0
  83. package/fesm2022/acorex-platform-module-workplacesafety-management-client-preview-safety-plan.command-DJqqiYlD.mjs.map +1 -0
  84. package/fesm2022/acorex-platform-module-workplacesafety-management-client-safety-plan-fill-values.util-RLOdySf7.mjs +33 -0
  85. package/fesm2022/acorex-platform-module-workplacesafety-management-client-safety-plan-fill-values.util-RLOdySf7.mjs.map +1 -0
  86. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-safety-plan-preview-modal.component-CQ2xB7Va.mjs → acorex-platform-module-workplacesafety-management-client-safety-plan-preview-modal.component-B9lElhxc.mjs} +252 -72
  87. package/fesm2022/acorex-platform-module-workplacesafety-management-client-safety-plan-preview-modal.component-B9lElhxc.mjs.map +1 -0
  88. package/fesm2022/acorex-platform-module-workplacesafety-management-client-safety-plan-section-builder.types-C0SEJsVM.mjs +185 -0
  89. package/fesm2022/acorex-platform-module-workplacesafety-management-client-safety-plan-section-builder.types-C0SEJsVM.mjs.map +1 -0
  90. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-save-safety-plan-sections.command-CLj3y_JD.mjs → acorex-platform-module-workplacesafety-management-client-save-safety-plan-sections.command-D0aRQHWk.mjs} +30 -94
  91. package/fesm2022/acorex-platform-module-workplacesafety-management-client-save-safety-plan-sections.command-D0aRQHWk.mjs.map +1 -0
  92. package/fesm2022/acorex-platform-module-workplacesafety-management-client-show-job-doc-setup.command-UlWyzIXQ.mjs +341 -0
  93. package/fesm2022/acorex-platform-module-workplacesafety-management-client-show-job-doc-setup.command-UlWyzIXQ.mjs.map +1 -0
  94. package/fesm2022/acorex-platform-module-workplacesafety-management-client.mjs +1 -1
  95. package/package.json +6 -6
  96. package/types/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan-activity.d.ts +5 -0
  97. package/types/acorex-platform-module-workplacesafety-management-client-contracts.d.ts +133 -157
  98. package/fesm2022/acorex-platform-module-workplacesafety-management-client-acorex-platform-module-workplacesafety-management-client-Ds0Fkspp.mjs.map +0 -1
  99. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan-work-step.mjs +0 -542
  100. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan-work-step.mjs.map +0 -1
  101. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-BI4TLvSE.mjs.map +0 -1
  102. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-control-hierarchy-levels.entity-COlCNnyK.mjs.map +0 -1
  103. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-control-measure.entity-BrXGzqZU.mjs.map +0 -1
  104. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-ppe-rule.entity-DHJus7OP.mjs.map +0 -1
  105. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-register.entity-CogjoDox.mjs.map +0 -1
  106. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-risk.entity-9UWHmIXV.mjs.map +0 -1
  107. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard.entity-CNPbxULL.mjs.map +0 -1
  108. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-ppe-item.entity-D5iOBl3P.mjs.map +0 -1
  109. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-section-dependency-TdIMIkM7.mjs.map +0 -1
  110. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-type-section.entity-BGZ1VAW3.mjs.map +0 -1
  111. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-type.entity-B6NYL4xi.mjs.map +0 -1
  112. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-work-step.entity-BlCbf5qP.mjs +0 -405
  113. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-work-step.entity-BlCbf5qP.mjs.map +0 -1
  114. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan.entity-BSUR9jqs.mjs.map +0 -1
  115. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-template.entity-CIHy_hLh.mjs.map +0 -1
  116. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-section-type.entity-Cs4nIHou.mjs.map +0 -1
  117. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-work-step-type.entity-CJFWDOoh.mjs.map +0 -1
  118. package/fesm2022/acorex-platform-module-workplacesafety-management-client-index-gbDgxqrV.mjs.map +0 -1
  119. package/fesm2022/acorex-platform-module-workplacesafety-management-client-preview-safety-plan.command-BU95c4xb.mjs +0 -254
  120. package/fesm2022/acorex-platform-module-workplacesafety-management-client-preview-safety-plan.command-BU95c4xb.mjs.map +0 -1
  121. package/fesm2022/acorex-platform-module-workplacesafety-management-client-safety-plan-preview-modal.component-CQ2xB7Va.mjs.map +0 -1
  122. package/fesm2022/acorex-platform-module-workplacesafety-management-client-safety-plan-preview.service-DJP41MuL.mjs +0 -36
  123. package/fesm2022/acorex-platform-module-workplacesafety-management-client-safety-plan-preview.service-DJP41MuL.mjs.map +0 -1
  124. package/fesm2022/acorex-platform-module-workplacesafety-management-client-safety-plan-section-builder.types-LaN1NIgc.mjs +0 -204
  125. package/fesm2022/acorex-platform-module-workplacesafety-management-client-safety-plan-section-builder.types-LaN1NIgc.mjs.map +0 -1
  126. package/fesm2022/acorex-platform-module-workplacesafety-management-client-save-safety-plan-sections.command-CLj3y_JD.mjs.map +0 -1
  127. package/types/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan-work-step.d.ts +0 -5
@@ -1,22 +1,26 @@
1
+ import * as i1$1 from '@acorex/components/button';
2
+ import { AXButtonModule } from '@acorex/components/button';
1
3
  import { AXBasePageComponent } from '@acorex/components/page';
4
+ import { AXToastService } from '@acorex/components/toast';
2
5
  import * as i2 from '@acorex/core/translation';
3
6
  import { AXTranslationModule, AXTranslationService } from '@acorex/core/translation';
7
+ import { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';
4
8
  import { AsyncPipe } from '@angular/common';
5
9
  import * as i0 from '@angular/core';
6
- import { input, ChangeDetectionStrategy, Component, inject, signal, computed, effect, ViewEncapsulation } from '@angular/core';
7
- import { n as normalizeSafetyPlanSectionBuilderValue } from './acorex-platform-module-workplacesafety-management-client-safety-plan-section-builder.types-LaN1NIgc.mjs';
10
+ import { input, ChangeDetectionStrategy, Component, inject, signal, computed, effect, output, ViewEncapsulation } from '@angular/core';
11
+ import { n as normalizeSafetyPlanSectionBuilderValue } from './acorex-platform-module-workplacesafety-management-client-safety-plan-section-builder.types-C0SEJsVM.mjs';
8
12
  import { A as AXMControlHierarchyDiagramComponent } from './acorex-platform-module-workplacesafety-management-client-control-hierarchy-diagram.component-CfxHwZtH.mjs';
9
13
  import { A as AXMControlHierarchyDiagramService, r as resolveControlHierarchyDiagramViewType } from './acorex-platform-module-workplacesafety-management-client-control-hierarchy-diagram.service-tMrUDnCb.mjs';
10
14
  import { A as AXMPpeItemViewerService, a as AXMPpeItemViewerComponent } from './acorex-platform-module-workplacesafety-management-client-ppe-item-viewer.service-BxcGph1I.mjs';
11
- import { r as resolvePpeItemViewerLayout } from './acorex-platform-module-workplacesafety-management-client-ppe-item-viewer.util-2Kl3_3sg.mjs';
15
+ import { r as resolvePpeItemViewerLayout, e as extractPpeItemIds } from './acorex-platform-module-workplacesafety-management-client-ppe-item-viewer.util-2Kl3_3sg.mjs';
12
16
  import * as i1 from '@acorex/components/loading';
13
17
  import { AXLoadingModule } from '@acorex/components/loading';
14
18
  import { AXPLayoutBuilderService, AXPLayoutRendererComponent } from '@acorex-platform/framework-client/layout/builder';
15
- import { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';
16
19
  import { AXPWidgetsList } from '@acorex-platform/framework-shared/core';
17
- import { isStepTableSectionType, resolveSectionTypeKey, sortStepTableColumns, normalizeStepTableColumns, stepTableColumnTitle, RISK_MANAGEMENT_RISK_MATRIX_CELL_ENTITY, stepTableColumnKey } from '@acorex-platform/module-workplacesafety-management-client/contracts';
20
+ import { isActivitySectionType, resolveSectionTypeKey, RISK_MANAGEMENT_RISK_MATRIX_ENTITY, resolveSectionTypeDisplayTitle, asSafetyPlanDisplayText } from '@acorex-platform/module-workplacesafety-management-client/contracts';
18
21
  import { cloneDeep } from 'lodash';
19
22
  import { resolveEntityRowDisplayText } from '@acorex-platform/framework-client/common';
23
+ import { n as normalizeSafetyPlanFillValues, s as saveSafetyPlanFillValues } from './acorex-platform-module-workplacesafety-management-client-safety-plan-fill-values.util-RLOdySf7.mjs';
20
24
 
21
25
  //#region ----- Imports -----
22
26
  //#endregion
@@ -115,6 +119,13 @@ class AXMPpeSectionPreviewComponent {
115
119
  ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
116
120
  this.layout = input(/* @ts-ignore */
117
121
  ...(ngDevMode ? [undefined, { debugName: "layout" }] : /* istanbul ignore next */ []));
122
+ this.value = input(undefined, /* @ts-ignore */
123
+ ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
124
+ this.editable = input(false, /* @ts-ignore */
125
+ ...(ngDevMode ? [{ debugName: "editable" }] : /* istanbul ignore next */ []));
126
+ //#endregion
127
+ //#region ----- Outputs -----
128
+ this.valueChange = output();
118
129
  //#endregion
119
130
  //#region ----- State Signals -----
120
131
  this.loading = signal(false, /* @ts-ignore */
@@ -127,6 +138,10 @@ class AXMPpeSectionPreviewComponent {
127
138
  ...(ngDevMode ? [{ debugName: "resolvedLayout" }] : /* istanbul ignore next */ []));
128
139
  //#endregion
129
140
  //#region ----- Lifecycle -----
141
+ this.applyStoredValue = effect(() => {
142
+ this.selectedIds.set(extractPpeItemIds(this.value()));
143
+ }, /* @ts-ignore */
144
+ ...(ngDevMode ? [{ debugName: "applyStoredValue" }] : /* istanbul ignore next */ []));
130
145
  this.loadItems = effect((onCleanup) => {
131
146
  const catalogItems = this.items();
132
147
  let cancelled = false;
@@ -140,7 +155,11 @@ class AXMPpeSectionPreviewComponent {
140
155
  //#endregion
141
156
  //#region ----- Event Handlers -----
142
157
  onSelectedIdsChange(ids) {
158
+ if (!this.editable()) {
159
+ return;
160
+ }
143
161
  this.selectedIds.set(ids);
162
+ this.valueChange.emit(ids);
144
163
  }
145
164
  //#endregion
146
165
  //#region ----- Data Loading -----
@@ -180,14 +199,14 @@ class AXMPpeSectionPreviewComponent {
180
199
  };
181
200
  }
182
201
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMPpeSectionPreviewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
183
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.8", type: AXMPpeSectionPreviewComponent, isStandalone: true, selector: "axm-ppe-section-preview", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "axm-ppe-section-preview block" }, ngImport: i0, template: "<!-- ----- PPE Item viewer (same component as Questionnaire; checkboxes can be toggled) ----- -->\n<axm-ppe-item-viewer\n [items]=\"displayItems()\"\n [layout]=\"resolvedLayout()\"\n [selectedIds]=\"selectedIds()\"\n [loading]=\"loading()\"\n (selectedIdsChange)=\"onSelectedIdsChange($event)\"\n/>\n", dependencies: [{ kind: "component", type: AXMPpeItemViewerComponent, selector: "axm-ppe-item-viewer", inputs: ["items", "layout", "selectedIds", "loading", "disabled", "readonly", "showControl"], outputs: ["selectedIdsChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
202
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.8", type: AXMPpeSectionPreviewComponent, isStandalone: true, selector: "axm-ppe-section-preview", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, host: { classAttribute: "axm-ppe-section-preview block" }, ngImport: i0, template: "<!-- ----- PPE Item viewer; checks are workflow fill values, not the section catalog ----- -->\n<axm-ppe-item-viewer\n [items]=\"displayItems()\"\n [layout]=\"resolvedLayout()\"\n [selectedIds]=\"selectedIds()\"\n [loading]=\"loading()\"\n [readonly]=\"!editable()\"\n (selectedIdsChange)=\"onSelectedIdsChange($event)\"\n/>\n", dependencies: [{ kind: "component", type: AXMPpeItemViewerComponent, selector: "axm-ppe-item-viewer", inputs: ["items", "layout", "selectedIds", "loading", "disabled", "readonly", "showControl"], outputs: ["selectedIdsChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
184
203
  }
185
204
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMPpeSectionPreviewComponent, decorators: [{
186
205
  type: Component,
187
206
  args: [{ selector: 'axm-ppe-section-preview', changeDetection: ChangeDetectionStrategy.OnPush, imports: [AXMPpeItemViewerComponent], host: {
188
207
  class: 'axm-ppe-section-preview block',
189
- }, template: "<!-- ----- PPE Item viewer (same component as Questionnaire; checkboxes can be toggled) ----- -->\n<axm-ppe-item-viewer\n [items]=\"displayItems()\"\n [layout]=\"resolvedLayout()\"\n [selectedIds]=\"selectedIds()\"\n [loading]=\"loading()\"\n (selectedIdsChange)=\"onSelectedIdsChange($event)\"\n/>\n" }]
190
- }], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], layout: [{ type: i0.Input, args: [{ isSignal: true, alias: "layout", required: false }] }] } });
208
+ }, template: "<!-- ----- PPE Item viewer; checks are workflow fill values, not the section catalog ----- -->\n<axm-ppe-item-viewer\n [items]=\"displayItems()\"\n [layout]=\"resolvedLayout()\"\n [selectedIds]=\"selectedIds()\"\n [loading]=\"loading()\"\n [readonly]=\"!editable()\"\n (selectedIdsChange)=\"onSelectedIdsChange($event)\"\n/>\n" }]
209
+ }], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], layout: [{ type: i0.Input, args: [{ isSignal: true, alias: "layout", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], editable: [{ type: i0.Input, args: [{ isSignal: true, alias: "editable", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }] } });
191
210
 
192
211
  //#region ----- Imports -----
193
212
  //#endregion
@@ -205,8 +224,8 @@ function resolveSafetyPlanPreviewSectionTitle(section, locale) {
205
224
  * can add cases here without changing the editor.
206
225
  */
207
226
  function resolveSafetyPlanSectionPreviewKind(section) {
208
- if (isStepTableSectionType(section.sectionTypeId, section.sectionType)) {
209
- return 'work-step-table';
227
+ if (isActivitySectionType(section.sectionTypeId, section.sectionType)) {
228
+ return 'activity';
210
229
  }
211
230
  if (resolveSectionTypeKey(section.sectionTypeId, section.sectionType) === 'RiskMatrix') {
212
231
  return 'risk-matrix';
@@ -219,10 +238,14 @@ function resolveSafetyPlanSectionPreviewKind(section) {
219
238
  }
220
239
  return 'catalog';
221
240
  }
222
- /** True when the section has at least one previewable item (catalog row or work-step row). */
241
+ /** True when the section has at least one previewable item (catalog row or activity row). */
223
242
  function safetyPlanPreviewSectionHasItems(section) {
224
- if (isStepTableSectionType(section.sectionTypeId, section.sectionType)) {
225
- return (section.items ?? []).some((item) => item.stepTableRow != null);
243
+ if (isActivitySectionType(section.sectionTypeId, section.sectionType)) {
244
+ return (section.items ?? []).some((item) => {
245
+ const row = item.activityRow;
246
+ const snapshotTitle = item.items?.[0]?.title;
247
+ return Boolean(row?.title?.trim() || snapshotTitle?.trim());
248
+ });
226
249
  }
227
250
  return collectSafetyPlanPreviewCatalogItems(section, '').length > 0;
228
251
  }
@@ -240,33 +263,6 @@ function collectSafetyPlanPreviewCatalogItems(section, locale) {
240
263
  }
241
264
  return linked;
242
265
  }
243
- function resolveSafetyPlanPreviewStepTableColumns(section) {
244
- return sortStepTableColumns(normalizeStepTableColumns(section.columns));
245
- }
246
- function formatSafetyPlanPreviewStepTableCell(cell, locale) {
247
- if (!cell) {
248
- return '';
249
- }
250
- const fromRefs = (cell.refs ?? [])
251
- .map((ref) => toSafetyPlanPreviewDisplayText(ref.title, locale) || String(ref.code ?? '').trim())
252
- .filter((text) => text.length > 0);
253
- if (fromRefs.length) {
254
- return fromRefs.join(', ');
255
- }
256
- const text = cell.textValue?.trim();
257
- if (text) {
258
- return text;
259
- }
260
- if (typeof cell.numberValue === 'number' && Number.isFinite(cell.numberValue)) {
261
- return String(cell.numberValue);
262
- }
263
- return '';
264
- }
265
- function stepTablePreviewColumnLabel(column, locale) {
266
- return (toSafetyPlanPreviewDisplayText(column.title, locale) ||
267
- toSafetyPlanPreviewDisplayText(column.sectionType?.title, locale) ||
268
- stepTableColumnTitle(column));
269
- }
270
266
  function flattenCatalogSlot(slot, locale) {
271
267
  const ids = Array.isArray(slot.itemIds) ? slot.itemIds : [];
272
268
  const snapshots = Array.isArray(slot.items) ? slot.items : [];
@@ -371,7 +367,7 @@ class AXMRiskMatrixPreviewComponent {
371
367
  }
372
368
  async queryByIds(ids) {
373
369
  const dataAccessor = this.entityService
374
- .withEntity(RISK_MANAGEMENT_RISK_MATRIX_CELL_ENTITY)
370
+ .withEntity(RISK_MANAGEMENT_RISK_MATRIX_ENTITY)
375
371
  .data();
376
372
  try {
377
373
  const result = await dataAccessor.query({
@@ -418,7 +414,7 @@ class AXMRiskMatrixPreviewComponent {
418
414
  flex.mode('view').setDirection('column');
419
415
  flex.formField('', (field) => {
420
416
  field
421
- .path('matrix')
417
+ .path('cells')
422
418
  .setShowLabel(false)
423
419
  .mode('view')
424
420
  .customWidget(AXPWidgetsList.Editors.RiskMatrix, { readonly: true });
@@ -439,7 +435,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
439
435
  //#region ----- Imports -----
440
436
  //#endregion
441
437
  //#region ----- Component -----
442
- class AXMWorkStepTablePreviewComponent {
438
+ class AXMActivityPreviewComponent {
443
439
  constructor() {
444
440
  //#region ----- Services & Dependencies -----
445
441
  this.translationService = inject(AXTranslationService);
@@ -449,32 +445,63 @@ class AXMWorkStepTablePreviewComponent {
449
445
  ...(ngDevMode ? [{ debugName: "section" }] : /* istanbul ignore next */ []));
450
446
  //#endregion
451
447
  //#region ----- Computed Properties -----
452
- this.columns = computed(() => resolveSafetyPlanPreviewStepTableColumns(this.section()), /* @ts-ignore */
453
- ...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
454
- this.rows = computed(() => (this.section().items ?? [])
455
- .map((item) => item.stepTableRow)
456
- .filter((row) => !!row)
457
- .sort((a, b) => (a.sortOrder ?? 0) - (b.sortOrder ?? 0)), /* @ts-ignore */
448
+ this.rows = computed(() => {
449
+ const locale = this.translationService.getActiveLang() ?? 'en-US';
450
+ return (this.section().items ?? [])
451
+ .map((item, index) => {
452
+ const row = item.activityRow;
453
+ if (!row) {
454
+ return null;
455
+ }
456
+ return {
457
+ view: this.toRowView(row, item.id || String(index), locale),
458
+ sortOrder: row.sortOrder ?? index + 1,
459
+ };
460
+ })
461
+ .filter((entry) => entry != null)
462
+ .sort((a, b) => a.sortOrder - b.sortOrder)
463
+ .map((entry) => entry.view);
464
+ }, /* @ts-ignore */
458
465
  ...(ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []));
459
466
  }
460
467
  //#endregion
461
468
  //#region ----- Display -----
462
- columnLabel(column) {
463
- return stepTablePreviewColumnLabel(column, this.translationService.getActiveLang() ?? 'en-US');
469
+ toRowView(row, key, locale) {
470
+ const sections = [...(row.sections ?? [])].sort((a, b) => (a.sortOrder ?? 0) - (b.sortOrder ?? 0));
471
+ return {
472
+ key,
473
+ title: toSafetyPlanPreviewDisplayText(row.title, locale) || 'Row',
474
+ code: String(row.code ?? '').trim(),
475
+ description: toSafetyPlanPreviewDisplayText(row.description, locale),
476
+ sections: sections.map((section, index) => this.toSectionView(section, `${key}__section_${index}`, locale)),
477
+ };
464
478
  }
465
- cellText(row, column) {
466
- const key = stepTableColumnKey(column);
467
- const cell = (row.cells ?? []).find((entry) => entry.columnKey === key);
468
- return formatSafetyPlanPreviewStepTableCell(cell, this.translationService.getActiveLang() ?? 'en-US');
479
+ toSectionView(section, key, locale) {
480
+ const title = toSafetyPlanPreviewDisplayText(section.title, locale) ||
481
+ toSafetyPlanPreviewDisplayText(section.sectionType?.title, locale) ||
482
+ resolveSectionTypeDisplayTitle(section.sectionTypeId, section.sectionType) ||
483
+ toSafetyPlanPreviewDisplayText(section.sectionType?.code, locale) ||
484
+ 'Section';
485
+ const items = (section.itemIds ?? []).map((id, index) => {
486
+ const snapshot = section.items?.find((entry) => entry.id === id) ?? section.items?.[index];
487
+ return {
488
+ id,
489
+ title: toSafetyPlanPreviewDisplayText(snapshot?.title, locale) ||
490
+ asSafetyPlanDisplayText(snapshot?.code) ||
491
+ id,
492
+ code: asSafetyPlanDisplayText(snapshot?.code) || undefined,
493
+ };
494
+ });
495
+ return { key, title, items };
469
496
  }
470
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMWorkStepTablePreviewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
471
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXMWorkStepTablePreviewComponent, isStandalone: true, selector: "axm-work-step-table-preview", inputs: { section: { classPropertyName: "section", publicName: "section", isSignal: true, isRequired: true, transformFunction: null } }, host: { classAttribute: "axm-work-step-table-preview block" }, ngImport: i0, template: "<div class=\"axm-work-step-table-preview\">\n @if (columns().length > 0 && rows().length > 0) {\n <!-- ----- Read-only work-step table ----- -->\n <div class=\"__table-wrap\">\n <table class=\"__table\">\n <thead>\n <tr>\n @for (column of columns(); track column.sectionTypeId) {\n <th>{{ columnLabel(column) }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of rows(); track $index) {\n <tr>\n @for (column of columns(); track column.sectionTypeId) {\n <td>{{ cellText(row, column) }}</td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n }\n <!-- ----- Empty work-step table ----- -->\n @else {\n <p class=\"__empty\">\n {{ '@workplacesafety-management:safety-plan-sections.preview.empty-items' | translate | async }}\n </p>\n }\n</div>\n", styles: ["@layer properties;.axm-work-step-table-preview .__table-wrap{overflow-x:auto}.axm-work-step-table-preview .__table{width:100%;border-collapse:collapse;font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)))}.axm-work-step-table-preview .__table th,.axm-work-step-table-preview .__table td{border-style:var(--tw-border-style);border-width:1px;border-color:rgba(var(--ax-sys-color-surface));padding-inline:calc(var(--spacing, .25rem) * 3);padding-block:calc(var(--spacing, .25rem) * 2);text-align:start;vertical-align:top}.axm-work-step-table-preview .__table th{background-color:rgba(var(--ax-sys-color-surface));--tw-font-weight: var(--font-weight-semibold, 600);font-weight:var(--font-weight-semibold, 600)}.axm-work-step-table-preview .__empty{margin:0;color:rgba(var(--ax-sys-color-text-default))}@supports (color: color-mix(in lab,red,red)){.axm-work-step-table-preview .__empty{color:color-mix(in oklab,rgba(var(--ax-sys-color-text-default)) 80%,transparent)}}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-font-weight: initial}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "ngmodule", type: AXTranslationModule }, { kind: "pipe", type: i2.AXTranslatorPipe, name: "translate" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
497
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMActivityPreviewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
498
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXMActivityPreviewComponent, isStandalone: true, selector: "axm-activity-preview", inputs: { section: { classPropertyName: "section", publicName: "section", isSignal: true, isRequired: true, transformFunction: null } }, host: { classAttribute: "axm-activity-preview block" }, ngImport: i0, template: "<div class=\"axm-activity-preview\">\n @if (rows().length > 0) {\n <!-- ----- Activity items with nested predefined sections ----- -->\n <ul class=\"__list\">\n @for (row of rows(); track row.key) {\n <li class=\"__item\">\n <div class=\"__header\">\n <span class=\"__title\">{{ row.title }}</span>\n <!--->\n <!-- ----- Optional business code after the item title ----- -->\n @if (row.code) {\n <span class=\"__code\">({{ row.code }})</span>\n }\n </div>\n <!--->\n <!-- ----- Optional activity description below the title ----- -->\n @if (row.description) {\n <p class=\"__description\">{{ row.description }}</p>\n }\n <!--->\n <!-- ----- Predefined SafetyPlanActivity sections (Control, Hazard, \u2026) ----- -->\n @if (row.sections.length > 0) {\n <div class=\"__sections\">\n @for (activitySection of row.sections; track activitySection.key) {\n <div class=\"__section\">\n <h4 class=\"__section-title\">{{ activitySection.title }}</h4>\n <axm-catalog-section-preview [items]=\"activitySection.items\" />\n </div>\n }\n </div>\n }\n </li>\n }\n </ul>\n }\n <!-- ----- Empty activity section ----- -->\n @else {\n <p class=\"__empty\">\n {{ '@workplacesafety-management:safety-plan-sections.preview.empty-items' | translate | async }}\n </p>\n }\n</div>\n", styles: ["@layer properties;.axm-activity-preview .__list{margin:0;list-style-type:disc;padding-inline-start:calc(var(--spacing, .25rem) * 5)}.axm-activity-preview .__item{margin-bottom:calc(var(--spacing, .25rem) * 4)}.axm-activity-preview .__header{display:flex;flex-wrap:wrap;align-items:baseline;gap:var(--spacing, .25rem)}.axm-activity-preview .__code{margin-inline-start:var(--spacing, .25rem);color:rgba(var(--ax-sys-color-text-default))}@supports (color: color-mix(in lab,red,red)){.axm-activity-preview .__code{color:color-mix(in oklab,rgba(var(--ax-sys-color-text-default)) 80%,transparent)}}.axm-activity-preview .__description{margin:0;margin-top:var(--spacing, .25rem);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));color:rgba(var(--ax-sys-color-text-default))}@supports (color: color-mix(in lab,red,red)){.axm-activity-preview .__description{color:color-mix(in oklab,rgba(var(--ax-sys-color-text-default)) 80%,transparent)}}.axm-activity-preview .__sections{margin-inline-start:var(--spacing, .25rem);margin-top:calc(var(--spacing, .25rem) * 3);display:flex;flex-direction:column;gap:calc(var(--spacing, .25rem) * 3)}.axm-activity-preview .__section-title{margin:0;margin-bottom:var(--spacing, .25rem);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));--tw-font-weight: var(--font-weight-semibold, 600);font-weight:var(--font-weight-semibold, 600)}.axm-activity-preview .__empty{margin:0;color:rgba(var(--ax-sys-color-text-default))}@supports (color: color-mix(in lab,red,red)){.axm-activity-preview .__empty{color:color-mix(in oklab,rgba(var(--ax-sys-color-text-default)) 80%,transparent)}}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-font-weight: initial}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "ngmodule", type: AXTranslationModule }, { kind: "component", type: AXMCatalogSectionPreviewComponent, selector: "axm-catalog-section-preview", inputs: ["items"] }, { kind: "pipe", type: i2.AXTranslatorPipe, name: "translate" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
472
499
  }
473
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMWorkStepTablePreviewComponent, decorators: [{
500
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMActivityPreviewComponent, decorators: [{
474
501
  type: Component,
475
- args: [{ selector: 'axm-work-step-table-preview', changeDetection: ChangeDetectionStrategy.OnPush, imports: [AXTranslationModule, AsyncPipe], host: {
476
- class: 'axm-work-step-table-preview block',
477
- }, template: "<div class=\"axm-work-step-table-preview\">\n @if (columns().length > 0 && rows().length > 0) {\n <!-- ----- Read-only work-step table ----- -->\n <div class=\"__table-wrap\">\n <table class=\"__table\">\n <thead>\n <tr>\n @for (column of columns(); track column.sectionTypeId) {\n <th>{{ columnLabel(column) }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of rows(); track $index) {\n <tr>\n @for (column of columns(); track column.sectionTypeId) {\n <td>{{ cellText(row, column) }}</td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n }\n <!-- ----- Empty work-step table ----- -->\n @else {\n <p class=\"__empty\">\n {{ '@workplacesafety-management:safety-plan-sections.preview.empty-items' | translate | async }}\n </p>\n }\n</div>\n", styles: ["@layer properties;.axm-work-step-table-preview .__table-wrap{overflow-x:auto}.axm-work-step-table-preview .__table{width:100%;border-collapse:collapse;font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)))}.axm-work-step-table-preview .__table th,.axm-work-step-table-preview .__table td{border-style:var(--tw-border-style);border-width:1px;border-color:rgba(var(--ax-sys-color-surface));padding-inline:calc(var(--spacing, .25rem) * 3);padding-block:calc(var(--spacing, .25rem) * 2);text-align:start;vertical-align:top}.axm-work-step-table-preview .__table th{background-color:rgba(var(--ax-sys-color-surface));--tw-font-weight: var(--font-weight-semibold, 600);font-weight:var(--font-weight-semibold, 600)}.axm-work-step-table-preview .__empty{margin:0;color:rgba(var(--ax-sys-color-text-default))}@supports (color: color-mix(in lab,red,red)){.axm-work-step-table-preview .__empty{color:color-mix(in oklab,rgba(var(--ax-sys-color-text-default)) 80%,transparent)}}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-font-weight: initial}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
502
+ args: [{ selector: 'axm-activity-preview', changeDetection: ChangeDetectionStrategy.OnPush, imports: [AXTranslationModule, AsyncPipe, AXMCatalogSectionPreviewComponent], host: {
503
+ class: 'axm-activity-preview block',
504
+ }, template: "<div class=\"axm-activity-preview\">\n @if (rows().length > 0) {\n <!-- ----- Activity items with nested predefined sections ----- -->\n <ul class=\"__list\">\n @for (row of rows(); track row.key) {\n <li class=\"__item\">\n <div class=\"__header\">\n <span class=\"__title\">{{ row.title }}</span>\n <!--->\n <!-- ----- Optional business code after the item title ----- -->\n @if (row.code) {\n <span class=\"__code\">({{ row.code }})</span>\n }\n </div>\n <!--->\n <!-- ----- Optional activity description below the title ----- -->\n @if (row.description) {\n <p class=\"__description\">{{ row.description }}</p>\n }\n <!--->\n <!-- ----- Predefined SafetyPlanActivity sections (Control, Hazard, \u2026) ----- -->\n @if (row.sections.length > 0) {\n <div class=\"__sections\">\n @for (activitySection of row.sections; track activitySection.key) {\n <div class=\"__section\">\n <h4 class=\"__section-title\">{{ activitySection.title }}</h4>\n <axm-catalog-section-preview [items]=\"activitySection.items\" />\n </div>\n }\n </div>\n }\n </li>\n }\n </ul>\n }\n <!-- ----- Empty activity section ----- -->\n @else {\n <p class=\"__empty\">\n {{ '@workplacesafety-management:safety-plan-sections.preview.empty-items' | translate | async }}\n </p>\n }\n</div>\n", styles: ["@layer properties;.axm-activity-preview .__list{margin:0;list-style-type:disc;padding-inline-start:calc(var(--spacing, .25rem) * 5)}.axm-activity-preview .__item{margin-bottom:calc(var(--spacing, .25rem) * 4)}.axm-activity-preview .__header{display:flex;flex-wrap:wrap;align-items:baseline;gap:var(--spacing, .25rem)}.axm-activity-preview .__code{margin-inline-start:var(--spacing, .25rem);color:rgba(var(--ax-sys-color-text-default))}@supports (color: color-mix(in lab,red,red)){.axm-activity-preview .__code{color:color-mix(in oklab,rgba(var(--ax-sys-color-text-default)) 80%,transparent)}}.axm-activity-preview .__description{margin:0;margin-top:var(--spacing, .25rem);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));color:rgba(var(--ax-sys-color-text-default))}@supports (color: color-mix(in lab,red,red)){.axm-activity-preview .__description{color:color-mix(in oklab,rgba(var(--ax-sys-color-text-default)) 80%,transparent)}}.axm-activity-preview .__sections{margin-inline-start:var(--spacing, .25rem);margin-top:calc(var(--spacing, .25rem) * 3);display:flex;flex-direction:column;gap:calc(var(--spacing, .25rem) * 3)}.axm-activity-preview .__section-title{margin:0;margin-bottom:var(--spacing, .25rem);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));--tw-font-weight: var(--font-weight-semibold, 600);font-weight:var(--font-weight-semibold, 600)}.axm-activity-preview .__empty{margin:0;color:rgba(var(--ax-sys-color-text-default))}@supports (color: color-mix(in lab,red,red)){.axm-activity-preview .__empty{color:color-mix(in oklab,rgba(var(--ax-sys-color-text-default)) 80%,transparent)}}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-font-weight: initial}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
478
505
  }], propDecorators: { section: [{ type: i0.Input, args: [{ isSignal: true, alias: "section", required: true }] }] } });
479
506
 
480
507
  //#region ----- Imports -----
@@ -488,6 +515,13 @@ class AXMSafetyPlanSectionPreviewComponent {
488
515
  //#region ----- Inputs -----
489
516
  this.section = input.required(/* @ts-ignore */
490
517
  ...(ngDevMode ? [{ debugName: "section" }] : /* istanbul ignore next */ []));
518
+ this.fillValue = input(undefined, /* @ts-ignore */
519
+ ...(ngDevMode ? [{ debugName: "fillValue" }] : /* istanbul ignore next */ []));
520
+ this.editable = input(false, /* @ts-ignore */
521
+ ...(ngDevMode ? [{ debugName: "editable" }] : /* istanbul ignore next */ []));
522
+ //#endregion
523
+ //#region ----- Outputs -----
524
+ this.fillValueChange = output();
491
525
  //#endregion
492
526
  //#region ----- Computed Properties -----
493
527
  this.locale = computed(() => this.translationService.getActiveLang() ?? 'en-US', /* @ts-ignore */
@@ -501,8 +535,13 @@ class AXMSafetyPlanSectionPreviewComponent {
501
535
  this.hasItems = computed(() => safetyPlanPreviewSectionHasItems(this.section()), /* @ts-ignore */
502
536
  ...(ngDevMode ? [{ debugName: "hasItems" }] : /* istanbul ignore next */ []));
503
537
  }
538
+ //#endregion
539
+ //#region ----- Event Handlers -----
540
+ onFillValueChange(value) {
541
+ this.fillValueChange.emit(value);
542
+ }
504
543
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMSafetyPlanSectionPreviewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
505
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXMSafetyPlanSectionPreviewComponent, isStandalone: true, selector: "axm-safety-plan-section-preview", inputs: { section: { classPropertyName: "section", publicName: "section", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "class.block": "hasItems()", "hidden": "!hasItems()" }, classAttribute: "axm-safety-plan-section-preview" }, ngImport: i0, template: "@if (hasItems()) {\n <!-- ----- Section with at least one item ----- -->\n <section class=\"axm-safety-plan-section-preview\">\n <header class=\"__header\">\n <h3 class=\"__title\">{{ title() }}</h3>\n </header>\n\n @switch (kind()) {\n @case ('work-step-table') {\n <axm-work-step-table-preview [section]=\"section()\" />\n }\n @case ('risk-matrix') {\n <axm-risk-matrix-preview [items]=\"catalogItems()\" />\n }\n @case ('ppe') {\n <axm-ppe-section-preview [items]=\"catalogItems()\" [layout]=\"section().widgetOptions?.layout\" />\n }\n @case ('hierarchy') {\n <axm-hierarchy-section-preview\n [items]=\"catalogItems()\"\n [viewType]=\"section().widgetOptions?.viewType\"\n [showTitle]=\"section().widgetOptions?.showTitle\"\n />\n }\n @default {\n <axm-catalog-section-preview [items]=\"catalogItems()\" />\n }\n }\n </section>\n}\n", styles: ["@layer properties;.axm-safety-plan-section-preview{display:block}.axm-safety-plan-section-preview .__header{margin-bottom:calc(var(--spacing, .25rem) * 3);border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:rgba(var(--ax-sys-color-surface));padding-bottom:calc(var(--spacing, .25rem) * 2)}.axm-safety-plan-section-preview .__title{margin:0;font-size:var(--text-base, 1rem);line-height:var(--tw-leading, var(--text-base--line-height, 1.5 ));--tw-font-weight: var(--font-weight-semibold, 600);font-weight:var(--font-weight-semibold, 600)}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-font-weight: initial}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "component", type: AXMCatalogSectionPreviewComponent, selector: "axm-catalog-section-preview", inputs: ["items"] }, { kind: "component", type: AXMHierarchySectionPreviewComponent, selector: "axm-hierarchy-section-preview", inputs: ["items", "viewType", "showTitle"] }, { kind: "component", type: AXMPpeSectionPreviewComponent, selector: "axm-ppe-section-preview", inputs: ["items", "layout"] }, { kind: "component", type: AXMRiskMatrixPreviewComponent, selector: "axm-risk-matrix-preview", inputs: ["items"] }, { kind: "component", type: AXMWorkStepTablePreviewComponent, selector: "axm-work-step-table-preview", inputs: ["section"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
544
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXMSafetyPlanSectionPreviewComponent, isStandalone: true, selector: "axm-safety-plan-section-preview", inputs: { section: { classPropertyName: "section", publicName: "section", isSignal: true, isRequired: true, transformFunction: null }, fillValue: { classPropertyName: "fillValue", publicName: "fillValue", isSignal: true, isRequired: false, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { fillValueChange: "fillValueChange" }, host: { properties: { "class.block": "hasItems()", "hidden": "!hasItems()" }, classAttribute: "axm-safety-plan-section-preview" }, ngImport: i0, template: "@if (hasItems()) {\n <!-- ----- Section with at least one item ----- -->\n <section class=\"axm-safety-plan-section-preview\">\n <header class=\"__header\">\n <h3 class=\"__title\">{{ title() }}</h3>\n </header>\n\n @switch (kind()) {\n @case ('activity') {\n <axm-activity-preview [section]=\"section()\" />\n }\n @case ('risk-matrix') {\n <axm-risk-matrix-preview [items]=\"catalogItems()\" />\n }\n @case ('ppe') {\n <axm-ppe-section-preview\n [items]=\"catalogItems()\"\n [layout]=\"section().widgetOptions?.layout\"\n [value]=\"fillValue()\"\n [editable]=\"editable()\"\n (valueChange)=\"onFillValueChange($event)\"\n />\n }\n @case ('hierarchy') {\n <axm-hierarchy-section-preview\n [items]=\"catalogItems()\"\n [viewType]=\"section().widgetOptions?.viewType\"\n [showTitle]=\"section().widgetOptions?.showTitle\"\n />\n }\n @default {\n <axm-catalog-section-preview [items]=\"catalogItems()\" />\n }\n }\n </section>\n}\n", styles: ["@layer properties;.axm-safety-plan-section-preview{display:block}.axm-safety-plan-section-preview .__header{margin-bottom:calc(var(--spacing, .25rem) * 3);border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:rgba(var(--ax-sys-color-surface));padding-bottom:calc(var(--spacing, .25rem) * 2)}.axm-safety-plan-section-preview .__title{margin:0;font-size:var(--text-base, 1rem);line-height:var(--tw-leading, var(--text-base--line-height, 1.5 ));--tw-font-weight: var(--font-weight-semibold, 600);font-weight:var(--font-weight-semibold, 600)}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-font-weight: initial}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "component", type: AXMCatalogSectionPreviewComponent, selector: "axm-catalog-section-preview", inputs: ["items"] }, { kind: "component", type: AXMHierarchySectionPreviewComponent, selector: "axm-hierarchy-section-preview", inputs: ["items", "viewType", "showTitle"] }, { kind: "component", type: AXMPpeSectionPreviewComponent, selector: "axm-ppe-section-preview", inputs: ["items", "layout", "value", "editable"], outputs: ["valueChange"] }, { kind: "component", type: AXMRiskMatrixPreviewComponent, selector: "axm-risk-matrix-preview", inputs: ["items"] }, { kind: "component", type: AXMActivityPreviewComponent, selector: "axm-activity-preview", inputs: ["section"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
506
545
  }
507
546
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMSafetyPlanSectionPreviewComponent, decorators: [{
508
547
  type: Component,
@@ -511,23 +550,45 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
511
550
  AXMHierarchySectionPreviewComponent,
512
551
  AXMPpeSectionPreviewComponent,
513
552
  AXMRiskMatrixPreviewComponent,
514
- AXMWorkStepTablePreviewComponent,
553
+ AXMActivityPreviewComponent,
515
554
  ], host: {
516
555
  class: 'axm-safety-plan-section-preview',
517
556
  '[class.block]': 'hasItems()',
518
557
  '[hidden]': '!hasItems()',
519
- }, template: "@if (hasItems()) {\n <!-- ----- Section with at least one item ----- -->\n <section class=\"axm-safety-plan-section-preview\">\n <header class=\"__header\">\n <h3 class=\"__title\">{{ title() }}</h3>\n </header>\n\n @switch (kind()) {\n @case ('work-step-table') {\n <axm-work-step-table-preview [section]=\"section()\" />\n }\n @case ('risk-matrix') {\n <axm-risk-matrix-preview [items]=\"catalogItems()\" />\n }\n @case ('ppe') {\n <axm-ppe-section-preview [items]=\"catalogItems()\" [layout]=\"section().widgetOptions?.layout\" />\n }\n @case ('hierarchy') {\n <axm-hierarchy-section-preview\n [items]=\"catalogItems()\"\n [viewType]=\"section().widgetOptions?.viewType\"\n [showTitle]=\"section().widgetOptions?.showTitle\"\n />\n }\n @default {\n <axm-catalog-section-preview [items]=\"catalogItems()\" />\n }\n }\n </section>\n}\n", styles: ["@layer properties;.axm-safety-plan-section-preview{display:block}.axm-safety-plan-section-preview .__header{margin-bottom:calc(var(--spacing, .25rem) * 3);border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:rgba(var(--ax-sys-color-surface));padding-bottom:calc(var(--spacing, .25rem) * 2)}.axm-safety-plan-section-preview .__title{margin:0;font-size:var(--text-base, 1rem);line-height:var(--tw-leading, var(--text-base--line-height, 1.5 ));--tw-font-weight: var(--font-weight-semibold, 600);font-weight:var(--font-weight-semibold, 600)}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-font-weight: initial}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
520
- }], propDecorators: { section: [{ type: i0.Input, args: [{ isSignal: true, alias: "section", required: true }] }] } });
558
+ }, template: "@if (hasItems()) {\n <!-- ----- Section with at least one item ----- -->\n <section class=\"axm-safety-plan-section-preview\">\n <header class=\"__header\">\n <h3 class=\"__title\">{{ title() }}</h3>\n </header>\n\n @switch (kind()) {\n @case ('activity') {\n <axm-activity-preview [section]=\"section()\" />\n }\n @case ('risk-matrix') {\n <axm-risk-matrix-preview [items]=\"catalogItems()\" />\n }\n @case ('ppe') {\n <axm-ppe-section-preview\n [items]=\"catalogItems()\"\n [layout]=\"section().widgetOptions?.layout\"\n [value]=\"fillValue()\"\n [editable]=\"editable()\"\n (valueChange)=\"onFillValueChange($event)\"\n />\n }\n @case ('hierarchy') {\n <axm-hierarchy-section-preview\n [items]=\"catalogItems()\"\n [viewType]=\"section().widgetOptions?.viewType\"\n [showTitle]=\"section().widgetOptions?.showTitle\"\n />\n }\n @default {\n <axm-catalog-section-preview [items]=\"catalogItems()\" />\n }\n }\n </section>\n}\n", styles: ["@layer properties;.axm-safety-plan-section-preview{display:block}.axm-safety-plan-section-preview .__header{margin-bottom:calc(var(--spacing, .25rem) * 3);border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:rgba(var(--ax-sys-color-surface));padding-bottom:calc(var(--spacing, .25rem) * 2)}.axm-safety-plan-section-preview .__title{margin:0;font-size:var(--text-base, 1rem);line-height:var(--tw-leading, var(--text-base--line-height, 1.5 ));--tw-font-weight: var(--font-weight-semibold, 600);font-weight:var(--font-weight-semibold, 600)}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-font-weight: initial}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
559
+ }], propDecorators: { section: [{ type: i0.Input, args: [{ isSignal: true, alias: "section", required: true }] }], fillValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "fillValue", required: false }] }], editable: [{ type: i0.Input, args: [{ isSignal: true, alias: "editable", required: false }] }], fillValueChange: [{ type: i0.Output, args: ["fillValueChange"] }] } });
521
560
 
522
- //#region ----- Imports -----
523
561
  //#endregion
524
562
  //#region ----- Component -----
525
563
  class AXMSafetyPlanPreviewModalComponent extends AXBasePageComponent {
526
564
  constructor() {
527
565
  super(...arguments);
566
+ //#region ----- Services & Dependencies -----
567
+ this.entityService = inject(AXPEntityService);
568
+ this.translationService = inject(AXTranslationService);
569
+ this.toastService = inject(AXToastService);
570
+ //#endregion
528
571
  //#region ----- Inputs -----
529
572
  this.structure = input({ sections: [] }, /* @ts-ignore */
530
573
  ...(ngDevMode ? [{ debugName: "structure" }] : /* istanbul ignore next */ []));
574
+ this.workflowActionSet = input(undefined, /* @ts-ignore */
575
+ ...(ngDevMode ? [{ debugName: "workflowActionSet" }] : /* istanbul ignore next */ []));
576
+ /** When true, section values can be edited and are saved when the dialog closes. */
577
+ this.editable = input(undefined, /* @ts-ignore */
578
+ ...(ngDevMode ? [{ debugName: "editable" }] : /* istanbul ignore next */ []));
579
+ this.planId = input(undefined, /* @ts-ignore */
580
+ ...(ngDevMode ? [{ debugName: "planId" }] : /* istanbul ignore next */ []));
581
+ this.fillValues = input({}, /* @ts-ignore */
582
+ ...(ngDevMode ? [{ debugName: "fillValues" }] : /* istanbul ignore next */ []));
583
+ //#endregion
584
+ //#region ----- State Signals -----
585
+ this.fillDirty = signal(false, /* @ts-ignore */
586
+ ...(ngDevMode ? [{ debugName: "fillDirty" }] : /* istanbul ignore next */ []));
587
+ this.saving = signal(false, /* @ts-ignore */
588
+ ...(ngDevMode ? [{ debugName: "saving" }] : /* istanbul ignore next */ []));
589
+ this.skipClosePersist = false;
590
+ this.draftValues = signal({}, /* @ts-ignore */
591
+ ...(ngDevMode ? [{ debugName: "draftValues" }] : /* istanbul ignore next */ []));
531
592
  //#endregion
532
593
  //#region ----- Computed Properties -----
533
594
  this.sections = computed(() => {
@@ -537,6 +598,125 @@ class AXMSafetyPlanPreviewModalComponent extends AXBasePageComponent {
537
598
  .filter((section) => safetyPlanPreviewSectionHasItems(section));
538
599
  }, /* @ts-ignore */
539
600
  ...(ngDevMode ? [{ debugName: "sections" }] : /* istanbul ignore next */ []));
601
+ this.resolvedActionSet = computed(() => {
602
+ const raw = this.safeInputValue(this.workflowActionSet);
603
+ if (raw === 'draft' || raw === 'assigned' || raw === 'locked') {
604
+ return raw;
605
+ }
606
+ return undefined;
607
+ }, /* @ts-ignore */
608
+ ...(ngDevMode ? [{ debugName: "resolvedActionSet" }] : /* istanbul ignore next */ []));
609
+ this.showDraftActions = computed(() => this.resolvedActionSet() === 'draft', /* @ts-ignore */
610
+ ...(ngDevMode ? [{ debugName: "showDraftActions" }] : /* istanbul ignore next */ []));
611
+ this.showAssignedActions = computed(() => this.resolvedActionSet() === 'assigned', /* @ts-ignore */
612
+ ...(ngDevMode ? [{ debugName: "showAssignedActions" }] : /* istanbul ignore next */ []));
613
+ this.showLockedActions = computed(() => this.resolvedActionSet() === 'locked', /* @ts-ignore */
614
+ ...(ngDevMode ? [{ debugName: "showLockedActions" }] : /* istanbul ignore next */ []));
615
+ this.canEditFill = computed(() => this.resolvedActionSet() === 'draft' || this.resolvedActionSet() === 'assigned' || this.isEditableRequested(), /* @ts-ignore */
616
+ ...(ngDevMode ? [{ debugName: "canEditFill" }] : /* istanbul ignore next */ []));
617
+ //#endregion
618
+ //#region ----- Lifecycle -----
619
+ this.hydrateFillValues = effect(() => {
620
+ if (this.fillDirty()) {
621
+ return;
622
+ }
623
+ this.draftValues.set(normalizeSafetyPlanFillValues(this.safeInputValue(this.fillValues)));
624
+ }, /* @ts-ignore */
625
+ ...(ngDevMode ? [{ debugName: "hydrateFillValues" }] : /* istanbul ignore next */ []));
626
+ }
627
+ //#endregion
628
+ //#region ----- Event Handlers -----
629
+ sectionFillValue(sectionId) {
630
+ return this.draftValues()[sectionId];
631
+ }
632
+ onSectionFillValueChange(sectionId, value) {
633
+ if (!sectionId || !this.canEditFill()) {
634
+ return;
635
+ }
636
+ this.fillDirty.set(true);
637
+ this.draftValues.update((current) => ({ ...current, [sectionId]: value }));
638
+ }
639
+ async onClosing(e) {
640
+ if (this.skipClosePersist) {
641
+ this.skipClosePersist = false;
642
+ return;
643
+ }
644
+ if (!this.isEditableRequested()) {
645
+ return;
646
+ }
647
+ if (!(await this.persistFillValues())) {
648
+ e.cancel = true;
649
+ }
650
+ }
651
+ saveAsDraft() {
652
+ void this.closeAfterPersist({ saved: true, submitted: false });
653
+ }
654
+ submitPlan() {
655
+ void this.closeAfterPersist({ saved: false, submitted: true });
656
+ }
657
+ savePlan() {
658
+ void this.closeAfterPersist({ saved: true });
659
+ }
660
+ lockPlan() {
661
+ void this.closeAfterPersist({ locked: true });
662
+ }
663
+ signOffPlan() {
664
+ void this.closeAfterPersist({ signOff: true });
665
+ }
666
+ //#endregion
667
+ //#region ----- Persistence -----
668
+ async closeAfterPersist(result) {
669
+ if (!(await this.persistFillValues())) {
670
+ return;
671
+ }
672
+ this.skipClosePersist = true;
673
+ this.close(result);
674
+ }
675
+ async persistFillValues() {
676
+ if (!this.canEditFill()) {
677
+ return true;
678
+ }
679
+ const planId = this.resolvePlanId();
680
+ if (this.saving()) {
681
+ return false;
682
+ }
683
+ if (!planId) {
684
+ await this.showSaveError();
685
+ return false;
686
+ }
687
+ this.saving.set(true);
688
+ try {
689
+ await saveSafetyPlanFillValues(this.entityService, planId, this.draftValues());
690
+ return true;
691
+ }
692
+ catch {
693
+ await this.showSaveError();
694
+ return false;
695
+ }
696
+ finally {
697
+ this.saving.set(false);
698
+ }
699
+ }
700
+ async showSaveError() {
701
+ this.toastService.show({
702
+ color: 'danger',
703
+ title: await this.translationService.translateAsync('@general:messages.generic.error.title'),
704
+ content: await this.translationService.translateAsync('@general:messages.generic.error.description'),
705
+ closeButton: true,
706
+ timeOut: 7000,
707
+ });
708
+ }
709
+ resolvePlanId() {
710
+ const raw = this.safeInputValue(this.planId);
711
+ return typeof raw === 'string' && raw.trim().length > 0 ? raw.trim() : undefined;
712
+ }
713
+ isEditableRequested() {
714
+ const raw = this.safeInputValue(this.editable);
715
+ if (raw === true || raw === 'true') {
716
+ return true;
717
+ }
718
+ const actionSet = this.safeInputValue(this.workflowActionSet);
719
+ return actionSet === 'draft' || actionSet === 'assigned';
540
720
  }
541
721
  //#endregion
542
722
  //#region ----- Helpers -----
@@ -544,14 +724,14 @@ class AXMSafetyPlanPreviewModalComponent extends AXBasePageComponent {
544
724
  return typeof inputOrValue === 'function' ? inputOrValue() : inputOrValue;
545
725
  }
546
726
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMSafetyPlanPreviewModalComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
547
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXMSafetyPlanPreviewModalComponent, isStandalone: true, selector: "axm-safety-plan-preview-modal", inputs: { structure: { classPropertyName: "structure", publicName: "structure", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "axm-safety-plan-preview-modal-host flex flex-col w-full h-full" }, usesInheritance: true, ngImport: i0, template: "<div class=\"axm-safety-plan-preview-modal __content-area\">\n @if (sections().length === 0) {\n <!-- ----- Empty state when the plan has no sections ----- -->\n <p class=\"__empty\">\n {{ '@workplacesafety-management:safety-plan-sections.preview.empty' | translate | async }}\n </p>\n }\n <!-- ----- Read-only document blocks in configured section order ----- -->\n @else {\n <div class=\"__document\">\n @for (section of sections(); track section.id) {\n <axm-safety-plan-section-preview [section]=\"section\" />\n }\n </div>\n }\n</div>\n", styles: ["axm-safety-plan-preview-modal{display:flex;height:100%;max-height:90vh;min-height:0px;width:100%;flex:1;flex-direction:column;overflow:hidden}@media(width>=64rem){axm-safety-plan-preview-modal{max-height:75vh}}.axm-safety-plan-preview-modal{display:flex;min-height:0px;flex:1;flex-direction:column;overflow-y:auto;padding:calc(var(--spacing, .25rem) * 6)}.axm-safety-plan-preview-modal .__empty{margin:0;color:rgba(var(--ax-sys-color-text-default))}@supports (color: color-mix(in lab,red,red)){.axm-safety-plan-preview-modal .__empty{color:color-mix(in oklab,rgba(var(--ax-sys-color-text-default)) 80%,transparent)}}.axm-safety-plan-preview-modal .__document{display:flex;flex-direction:column;gap:calc(var(--spacing, .25rem) * 8)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "ngmodule", type: AXTranslationModule }, { kind: "component", type: AXMSafetyPlanSectionPreviewComponent, selector: "axm-safety-plan-section-preview", inputs: ["section"] }, { kind: "pipe", type: i2.AXTranslatorPipe, name: "translate" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
727
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXMSafetyPlanPreviewModalComponent, isStandalone: true, selector: "axm-safety-plan-preview-modal", inputs: { structure: { classPropertyName: "structure", publicName: "structure", isSignal: true, isRequired: false, transformFunction: null }, workflowActionSet: { classPropertyName: "workflowActionSet", publicName: "workflowActionSet", isSignal: true, isRequired: false, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", isSignal: true, isRequired: false, transformFunction: null }, planId: { classPropertyName: "planId", publicName: "planId", isSignal: true, isRequired: false, transformFunction: null }, fillValues: { classPropertyName: "fillValues", publicName: "fillValues", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "axm-safety-plan-preview-modal-host flex flex-col w-full h-full min-h-0" }, usesInheritance: true, ngImport: i0, template: "<div class=\"axm-safety-plan-preview-modal\">\n <div class=\"__content-area\">\n @if (sections().length === 0) {\n <!-- ----- Empty state when the plan has no sections ----- -->\n <p class=\"__empty\">\n {{ '@workplacesafety-management:safety-plan-sections.preview.empty' | translate | async }}\n </p>\n }\n <!-- ----- Document blocks in configured section order ----- -->\n @else {\n <div class=\"__document\">\n @for (section of sections(); track section.id) {\n <axm-safety-plan-section-preview\n [section]=\"section\"\n [fillValue]=\"sectionFillValue(section.id)\"\n [editable]=\"canEditFill()\"\n (fillValueChange)=\"onSectionFillValueChange(section.id, $event)\"\n />\n }\n </div>\n }\n </div>\n\n @if (showDraftActions()) {\n <!-- ----- Save as Draft / Submit while the task is Initial or Draft ----- -->\n <div class=\"__actions\">\n <ax-button\n look=\"outline\"\n color=\"primary\"\n [text]=\"'@workplacesafety-management:safety-plan-sections.preview.actions.save-draft' | translate | async\"\n (onClick)=\"saveAsDraft()\"\n ></ax-button>\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"'@workplacesafety-management:safety-plan-sections.preview.actions.submit' | translate | async\"\n (onClick)=\"submitPlan()\"\n ></ax-button>\n </div>\n }\n <!-- ----- Save / Lock while the task is Assigned ----- -->\n @else if (showAssignedActions()) {\n <div class=\"__actions\">\n <ax-button\n look=\"outline\"\n color=\"primary\"\n [text]=\"'@workplacesafety-management:safety-plan-sections.preview.actions.save' | translate | async\"\n (onClick)=\"savePlan()\"\n ></ax-button>\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"'@workplacesafety-management:safety-plan-sections.preview.actions.lock' | translate | async\"\n (onClick)=\"lockPlan()\"\n ></ax-button>\n </div>\n }\n <!-- ----- Sign Off while the task is Locked ----- -->\n @else if (showLockedActions()) {\n <div class=\"__actions\">\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"'@workplacesafety-management:safety-plan-sections.preview.actions.sign-off' | translate | async\"\n (onClick)=\"signOffPlan()\"\n ></ax-button>\n </div>\n }\n</div>\n\n", styles: ["@layer properties;.axm-safety-plan-preview-modal-host,.axm-safety-plan-preview-modal{display:flex;height:100%;min-height:0px;width:100%;flex:1;flex-direction:column;overflow:hidden}.axm-safety-plan-preview-modal .__content-area{display:flex;min-height:0px;flex:1;flex-direction:column;overflow-y:auto;padding:calc(var(--spacing, .25rem) * 6)}.axm-safety-plan-preview-modal .__empty{margin:0;color:rgba(var(--ax-sys-color-text-default))}@supports (color: color-mix(in lab,red,red)){.axm-safety-plan-preview-modal .__empty{color:color-mix(in oklab,rgba(var(--ax-sys-color-text-default)) 80%,transparent)}}.axm-safety-plan-preview-modal .__document{display:flex;flex-direction:column;gap:calc(var(--spacing, .25rem) * 8)}.axm-safety-plan-preview-modal .__actions{display:flex;flex:none;flex-direction:row;align-items:center;justify-content:flex-end;gap:calc(var(--spacing, .25rem) * 3);border-top-style:var(--tw-border-style);border-top-width:1px;border-color:var(--color-border-default);background-color:rgba(var(--ax-sys-color-surface));padding-inline:calc(var(--spacing, .25rem) * 6);padding-block:calc(var(--spacing, .25rem) * 4)}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "ngmodule", type: AXTranslationModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i1$1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "component", type: AXMSafetyPlanSectionPreviewComponent, selector: "axm-safety-plan-section-preview", inputs: ["section", "fillValue", "editable"], outputs: ["fillValueChange"] }, { kind: "pipe", type: i2.AXTranslatorPipe, name: "translate" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
548
728
  }
549
729
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMSafetyPlanPreviewModalComponent, decorators: [{
550
730
  type: Component,
551
- args: [{ selector: 'axm-safety-plan-preview-modal', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [AXTranslationModule, AsyncPipe, AXMSafetyPlanSectionPreviewComponent], host: {
552
- class: 'axm-safety-plan-preview-modal-host flex flex-col w-full h-full',
553
- }, template: "<div class=\"axm-safety-plan-preview-modal __content-area\">\n @if (sections().length === 0) {\n <!-- ----- Empty state when the plan has no sections ----- -->\n <p class=\"__empty\">\n {{ '@workplacesafety-management:safety-plan-sections.preview.empty' | translate | async }}\n </p>\n }\n <!-- ----- Read-only document blocks in configured section order ----- -->\n @else {\n <div class=\"__document\">\n @for (section of sections(); track section.id) {\n <axm-safety-plan-section-preview [section]=\"section\" />\n }\n </div>\n }\n</div>\n", styles: ["axm-safety-plan-preview-modal{display:flex;height:100%;max-height:90vh;min-height:0px;width:100%;flex:1;flex-direction:column;overflow:hidden}@media(width>=64rem){axm-safety-plan-preview-modal{max-height:75vh}}.axm-safety-plan-preview-modal{display:flex;min-height:0px;flex:1;flex-direction:column;overflow-y:auto;padding:calc(var(--spacing, .25rem) * 6)}.axm-safety-plan-preview-modal .__empty{margin:0;color:rgba(var(--ax-sys-color-text-default))}@supports (color: color-mix(in lab,red,red)){.axm-safety-plan-preview-modal .__empty{color:color-mix(in oklab,rgba(var(--ax-sys-color-text-default)) 80%,transparent)}}.axm-safety-plan-preview-modal .__document{display:flex;flex-direction:column;gap:calc(var(--spacing, .25rem) * 8)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
554
- }], propDecorators: { structure: [{ type: i0.Input, args: [{ isSignal: true, alias: "structure", required: false }] }] } });
731
+ args: [{ selector: 'axm-safety-plan-preview-modal', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [AXTranslationModule, AsyncPipe, AXButtonModule, AXMSafetyPlanSectionPreviewComponent], host: {
732
+ class: 'axm-safety-plan-preview-modal-host flex flex-col w-full h-full min-h-0',
733
+ }, template: "<div class=\"axm-safety-plan-preview-modal\">\n <div class=\"__content-area\">\n @if (sections().length === 0) {\n <!-- ----- Empty state when the plan has no sections ----- -->\n <p class=\"__empty\">\n {{ '@workplacesafety-management:safety-plan-sections.preview.empty' | translate | async }}\n </p>\n }\n <!-- ----- Document blocks in configured section order ----- -->\n @else {\n <div class=\"__document\">\n @for (section of sections(); track section.id) {\n <axm-safety-plan-section-preview\n [section]=\"section\"\n [fillValue]=\"sectionFillValue(section.id)\"\n [editable]=\"canEditFill()\"\n (fillValueChange)=\"onSectionFillValueChange(section.id, $event)\"\n />\n }\n </div>\n }\n </div>\n\n @if (showDraftActions()) {\n <!-- ----- Save as Draft / Submit while the task is Initial or Draft ----- -->\n <div class=\"__actions\">\n <ax-button\n look=\"outline\"\n color=\"primary\"\n [text]=\"'@workplacesafety-management:safety-plan-sections.preview.actions.save-draft' | translate | async\"\n (onClick)=\"saveAsDraft()\"\n ></ax-button>\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"'@workplacesafety-management:safety-plan-sections.preview.actions.submit' | translate | async\"\n (onClick)=\"submitPlan()\"\n ></ax-button>\n </div>\n }\n <!-- ----- Save / Lock while the task is Assigned ----- -->\n @else if (showAssignedActions()) {\n <div class=\"__actions\">\n <ax-button\n look=\"outline\"\n color=\"primary\"\n [text]=\"'@workplacesafety-management:safety-plan-sections.preview.actions.save' | translate | async\"\n (onClick)=\"savePlan()\"\n ></ax-button>\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"'@workplacesafety-management:safety-plan-sections.preview.actions.lock' | translate | async\"\n (onClick)=\"lockPlan()\"\n ></ax-button>\n </div>\n }\n <!-- ----- Sign Off while the task is Locked ----- -->\n @else if (showLockedActions()) {\n <div class=\"__actions\">\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"'@workplacesafety-management:safety-plan-sections.preview.actions.sign-off' | translate | async\"\n (onClick)=\"signOffPlan()\"\n ></ax-button>\n </div>\n }\n</div>\n\n", styles: ["@layer properties;.axm-safety-plan-preview-modal-host,.axm-safety-plan-preview-modal{display:flex;height:100%;min-height:0px;width:100%;flex:1;flex-direction:column;overflow:hidden}.axm-safety-plan-preview-modal .__content-area{display:flex;min-height:0px;flex:1;flex-direction:column;overflow-y:auto;padding:calc(var(--spacing, .25rem) * 6)}.axm-safety-plan-preview-modal .__empty{margin:0;color:rgba(var(--ax-sys-color-text-default))}@supports (color: color-mix(in lab,red,red)){.axm-safety-plan-preview-modal .__empty{color:color-mix(in oklab,rgba(var(--ax-sys-color-text-default)) 80%,transparent)}}.axm-safety-plan-preview-modal .__document{display:flex;flex-direction:column;gap:calc(var(--spacing, .25rem) * 8)}.axm-safety-plan-preview-modal .__actions{display:flex;flex:none;flex-direction:row;align-items:center;justify-content:flex-end;gap:calc(var(--spacing, .25rem) * 3);border-top-style:var(--tw-border-style);border-top-width:1px;border-color:var(--color-border-default);background-color:rgba(var(--ax-sys-color-surface));padding-inline:calc(var(--spacing, .25rem) * 6);padding-block:calc(var(--spacing, .25rem) * 4)}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
734
+ }], propDecorators: { structure: [{ type: i0.Input, args: [{ isSignal: true, alias: "structure", required: false }] }], workflowActionSet: [{ type: i0.Input, args: [{ isSignal: true, alias: "workflowActionSet", required: false }] }], editable: [{ type: i0.Input, args: [{ isSignal: true, alias: "editable", required: false }] }], planId: [{ type: i0.Input, args: [{ isSignal: true, alias: "planId", required: false }] }], fillValues: [{ type: i0.Input, args: [{ isSignal: true, alias: "fillValues", required: false }] }] } });
555
735
 
556
736
  export { AXMSafetyPlanPreviewModalComponent };
557
- //# sourceMappingURL=acorex-platform-module-workplacesafety-management-client-safety-plan-preview-modal.component-CQ2xB7Va.mjs.map
737
+ //# sourceMappingURL=acorex-platform-module-workplacesafety-management-client-safety-plan-preview-modal.component-B9lElhxc.mjs.map