@acorex-platform/module-workplacesafety-management-client 0.0.38 → 0.0.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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-C3a08xjg.mjs} +79 -32
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-acorex-platform-module-workplacesafety-management-client-C3a08xjg.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-control-hierarchy-levels.mjs +19 -5
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-control-hierarchy-levels.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-control-measure.mjs +19 -5
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-control-measure.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-hazard-ppe-rule.mjs +19 -5
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-hazard-ppe-rule.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-hazard-register.mjs +19 -5
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-hazard-register.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-hazard-risk.mjs +22 -72
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-hazard-risk.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-hazard.mjs +20 -6
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-hazard.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-ppe-item.mjs +19 -5
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-ppe-item.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan-activity.mjs +1516 -0
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan-activity.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan-section.mjs +82 -12
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan-section.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan-type-section.mjs +82 -12
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan-type-section.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan-type.mjs +19 -5
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan-type.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan.mjs +39 -6
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-template.mjs +20 -5
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-template.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-section-type.mjs +19 -5
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-section-type.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-work-step-type.mjs +82 -12
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-work-step-type.mjs.map +1 -1
- 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
- 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
- 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
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-control-hierarchy-levels.entity-oylKTsgJ.mjs.map +1 -0
- 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
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-control-measure.entity-DHm1nRwW.mjs.map +1 -0
- 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
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-ppe-rule.entity-DH-hPuAD.mjs.map +1 -0
- 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
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-register.entity-g4AT_IiT.mjs.map +1 -0
- 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
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-risk.entity-BwNlWbnC.mjs.map +1 -0
- 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
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard.entity-Cogwbd1P.mjs.map +1 -0
- 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
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-ppe-item.entity-0xqGaPnk.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-risk-management.integration-CUZIl8zt.mjs +7 -0
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-risk-management.integration-CUZIl8zt.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-activity.entity-CZCYupQT.mjs +324 -0
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-activity.entity-CZCYupQT.mjs.map +1 -0
- 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
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-section-dependency-D0fzHV_L.mjs.map +1 -0
- 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
- 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
- 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
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-type-section.entity-D8wL0ned.mjs.map +1 -0
- 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
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-type.entity-DrqQDYn9.mjs.map +1 -0
- 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
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan.entity-DaRnWCin.mjs.map +1 -0
- 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
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-template.entity-Coj5Rzry.mjs.map +1 -0
- 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
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-section-type.entity-BU5roQ5-.mjs.map +1 -0
- 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
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-work-step-type.entity-DijGV30H.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog.mjs +1 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts.mjs +144 -168
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-fill-safety-plan.command-lJl0qpvT.mjs +165 -0
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-fill-safety-plan.command-lJl0qpvT.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-hydrate-safety-plan-activity-sections-TrVl3-T6.mjs +240 -0
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-hydrate-safety-plan-activity-sections-TrVl3-T6.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-index-gbDgxqrV.mjs → acorex-platform-module-workplacesafety-management-client-index-CInaiEjw.mjs} +130 -398
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-index-CInaiEjw.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-load-safety-plan-preview-structure-Ce67NSIZ.mjs +136 -0
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-load-safety-plan-preview-structure-Ce67NSIZ.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-local-entities.mjs +1 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-local-entities.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-preview-safety-plan.command-DJqqiYlD.mjs +102 -0
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-preview-safety-plan.command-DJqqiYlD.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-safety-plan-fill-values.util-RLOdySf7.mjs +33 -0
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-safety-plan-fill-values.util-RLOdySf7.mjs.map +1 -0
- 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
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-safety-plan-preview-modal.component-B9lElhxc.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-safety-plan-section-builder.types-C0SEJsVM.mjs +185 -0
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-safety-plan-section-builder.types-C0SEJsVM.mjs.map +1 -0
- 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
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-save-safety-plan-sections.command-D0aRQHWk.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workplacesafety-management-client.mjs +1 -1
- package/package.json +6 -6
- package/types/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan-activity.d.ts +5 -0
- package/types/acorex-platform-module-workplacesafety-management-client-contracts.d.ts +133 -157
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-acorex-platform-module-workplacesafety-management-client-Ds0Fkspp.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan-work-step.mjs +0 -542
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan-work-step.mjs.map +0 -1
- 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
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-control-hierarchy-levels.entity-COlCNnyK.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-control-measure.entity-BrXGzqZU.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-ppe-rule.entity-DHJus7OP.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-register.entity-CogjoDox.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-risk.entity-9UWHmIXV.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard.entity-CNPbxULL.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-ppe-item.entity-D5iOBl3P.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-section-dependency-TdIMIkM7.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-type-section.entity-BGZ1VAW3.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-type.entity-B6NYL4xi.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-work-step.entity-BlCbf5qP.mjs +0 -405
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-work-step.entity-BlCbf5qP.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan.entity-BSUR9jqs.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-template.entity-CIHy_hLh.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-section-type.entity-Cs4nIHou.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-work-step-type.entity-CJFWDOoh.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-index-gbDgxqrV.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-preview-safety-plan.command-BU95c4xb.mjs +0 -254
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-preview-safety-plan.command-BU95c4xb.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-safety-plan-preview-modal.component-CQ2xB7Va.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-safety-plan-preview.service-DJP41MuL.mjs +0 -36
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-safety-plan-preview.service-DJP41MuL.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-safety-plan-section-builder.types-LaN1NIgc.mjs +0 -204
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-safety-plan-section-builder.types-LaN1NIgc.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-save-safety-plan-sections.command-CLj3y_JD.mjs.map +0 -1
- package/types/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan-work-step.d.ts +0 -5
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
import { AXPWidgetsList } from '@acorex-platform/framework-shared/core';
|
|
2
|
+
import { createAllQueryView, entityMasterCrudActions, entityMasterRecordActions } from '@acorex-platform/framework-shared/entity';
|
|
3
|
+
import { R as RootConfig } from './acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-C46YEBVd.mjs';
|
|
4
|
+
import { e as WORKPLACE_SAFETY_BUILT_IN_SECTION_TYPE_IDS, W as WORKPLACE_SAFETY_SECTION_TYPE_LOOKUP_WIDGET_OPTIONS, f as buildWorkplaceSafetySectionTypeEntityExpression, b as buildSafetyPlanSectionItemSelectorOptions } from './acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-section-dependency-D0fzHV_L.mjs';
|
|
5
|
+
|
|
6
|
+
//#region ---- Imports ----
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region ---- Constants ----
|
|
9
|
+
const listSortAndFilterOptions = {
|
|
10
|
+
sort: { enabled: true },
|
|
11
|
+
filter: { advance: { enabled: true }, inline: { enabled: true } },
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Section-type picker for activity item rows — no title/description sync (those would
|
|
15
|
+
* write onto the parent SafetyPlanActivity fields), and Activity itself is excluded.
|
|
16
|
+
* Keep `expose` so `sectionType.id` updates and itemIds cascade can react.
|
|
17
|
+
*/
|
|
18
|
+
const ACTIVITY_ITEMS_SECTION_TYPE_LOOKUP_OPTIONS = {
|
|
19
|
+
...WORKPLACE_SAFETY_SECTION_TYPE_LOOKUP_WIDGET_OPTIONS,
|
|
20
|
+
triggers: [],
|
|
21
|
+
filter: {
|
|
22
|
+
logic: 'and',
|
|
23
|
+
filters: [
|
|
24
|
+
{
|
|
25
|
+
field: 'id',
|
|
26
|
+
operator: { type: 'notEqual' },
|
|
27
|
+
value: WORKPLACE_SAFETY_BUILT_IN_SECTION_TYPE_IDS.activity,
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Bound sectionTypeId on the repeater row (parent of the itemIds lookup).
|
|
34
|
+
* `>` is required at eval time for the correct row value.
|
|
35
|
+
*/
|
|
36
|
+
const ACTIVITY_ITEM_SECTION_TYPE_ID_PATH = '>sectionTypeId';
|
|
37
|
+
/** Maps row sectionTypeId → catalog entity (Hazard, Ppe, Control, …). */
|
|
38
|
+
const ACTIVITY_ITEM_ENTITY_EXPRESSION = buildWorkplaceSafetySectionTypeEntityExpression(ACTIVITY_ITEM_SECTION_TYPE_ID_PATH);
|
|
39
|
+
/**
|
|
40
|
+
* Enable itemIds once the row has a section type.
|
|
41
|
+
*
|
|
42
|
+
* `>sectionTypeId` alone does not re-trigger option updates for nested paths like
|
|
43
|
+
* `items.[n].sectionTypeId` (renderer dependency matching ignores the `>` prefix).
|
|
44
|
+
* Including bare `sectionTypeId` makes `isSegmentSuffix` treat the nested change as
|
|
45
|
+
* relevant so disabled/entity expressions re-evaluate after selection.
|
|
46
|
+
*/
|
|
47
|
+
const ACTIVITY_ITEM_IDS_DISABLED_EXPRESSION = "{{ !(context.eval('>sectionTypeId') || context.eval('sectionTypeId')) }}";
|
|
48
|
+
/**
|
|
49
|
+
* Activity-only cascade: clear selection + refresh entity/data when section type changes.
|
|
50
|
+
* Do not use the shared section triggers — they call `context.set('items', [])`, which
|
|
51
|
+
* would wipe this entity's `items` repeater (same key as the lookup expose parent).
|
|
52
|
+
*/
|
|
53
|
+
const ACTIVITY_ITEM_IDS_SECTION_TYPE_TRIGGERS = [
|
|
54
|
+
{
|
|
55
|
+
event: "{{ events.context('sectionType.id') }}",
|
|
56
|
+
action: '{{ widget.setValue([]); widget.refresh(); }}',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
event: "{{ events.context('sectionTypeId') }}",
|
|
60
|
+
action: '{{ widget.setValue([]); widget.refresh(); }}',
|
|
61
|
+
},
|
|
62
|
+
];
|
|
63
|
+
/** Same repeater widget tree as {@link safetyPlanSectionEntityFactory} `items`. */
|
|
64
|
+
const ITEMS_REPEATER_CHILDREN = [
|
|
65
|
+
{
|
|
66
|
+
type: AXPWidgetsList.Layouts.GridLayout,
|
|
67
|
+
mode: 'edit',
|
|
68
|
+
name: 'itemRow',
|
|
69
|
+
options: {
|
|
70
|
+
grid: {
|
|
71
|
+
default: {
|
|
72
|
+
columns: 12,
|
|
73
|
+
gap: '1rem',
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
children: [
|
|
78
|
+
{
|
|
79
|
+
type: AXPWidgetsList.Layouts.GridItemLayout,
|
|
80
|
+
mode: 'edit',
|
|
81
|
+
options: { colSpan: 4 },
|
|
82
|
+
children: [
|
|
83
|
+
{
|
|
84
|
+
type: AXPWidgetsList.Layouts.FormField,
|
|
85
|
+
mode: 'edit',
|
|
86
|
+
options: {
|
|
87
|
+
label: '@workplacesafety-management:safety-plan-sections.entities.safety-plan-section.fields.section-type.title',
|
|
88
|
+
showLabel: true,
|
|
89
|
+
},
|
|
90
|
+
children: [
|
|
91
|
+
{
|
|
92
|
+
type: AXPWidgetsList.Editors.LookupBox,
|
|
93
|
+
mode: 'edit',
|
|
94
|
+
path: 'sectionTypeId',
|
|
95
|
+
name: 'sectionTypeId',
|
|
96
|
+
options: {
|
|
97
|
+
entity: `${RootConfig.module.name}.${RootConfig.entities.sectionType.name}`,
|
|
98
|
+
...ACTIVITY_ITEMS_SECTION_TYPE_LOOKUP_OPTIONS,
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
],
|
|
102
|
+
},
|
|
103
|
+
],
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
type: AXPWidgetsList.Layouts.GridItemLayout,
|
|
107
|
+
mode: 'edit',
|
|
108
|
+
options: { colSpan: 8 },
|
|
109
|
+
children: [
|
|
110
|
+
{
|
|
111
|
+
type: AXPWidgetsList.Layouts.FormField,
|
|
112
|
+
mode: 'edit',
|
|
113
|
+
options: {
|
|
114
|
+
label: '@workplacesafety-management:safety-plan-sections.entities.safety-plan-section.fields.item-ids.title',
|
|
115
|
+
showLabel: true,
|
|
116
|
+
},
|
|
117
|
+
children: [
|
|
118
|
+
{
|
|
119
|
+
type: AXPWidgetsList.Editors.LookupBox,
|
|
120
|
+
mode: 'edit',
|
|
121
|
+
path: 'itemIds',
|
|
122
|
+
name: 'itemIds',
|
|
123
|
+
triggers: ACTIVITY_ITEM_IDS_SECTION_TYPE_TRIGGERS,
|
|
124
|
+
options: {
|
|
125
|
+
...buildSafetyPlanSectionItemSelectorOptions(ACTIVITY_ITEM_ENTITY_EXPRESSION, {
|
|
126
|
+
sectionTypeIdPath: ACTIVITY_ITEM_SECTION_TYPE_ID_PATH,
|
|
127
|
+
}),
|
|
128
|
+
// Shared options expose into `items.*` — that key is this entity's repeater.
|
|
129
|
+
expose: [],
|
|
130
|
+
triggers: ACTIVITY_ITEM_IDS_SECTION_TYPE_TRIGGERS,
|
|
131
|
+
valueField: 'id',
|
|
132
|
+
disabled: ACTIVITY_ITEM_IDS_DISABLED_EXPRESSION,
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
},
|
|
137
|
+
],
|
|
138
|
+
},
|
|
139
|
+
],
|
|
140
|
+
},
|
|
141
|
+
];
|
|
142
|
+
const itemsPropertyLayout = {
|
|
143
|
+
name: 'items',
|
|
144
|
+
layout: { label: { visible: false }, order: 1, positions: { lg: { colSpan: 12 } } },
|
|
145
|
+
};
|
|
146
|
+
//#endregion
|
|
147
|
+
//#region ---- Entity factory ----
|
|
148
|
+
async function safetyPlanActivityEntityFactory() {
|
|
149
|
+
const entityDef = {
|
|
150
|
+
module: RootConfig.module.name,
|
|
151
|
+
name: RootConfig.entities.safetyPlanActivity.name,
|
|
152
|
+
title: RootConfig.entities.safetyPlanActivity.title,
|
|
153
|
+
icon: RootConfig.entities.safetyPlanActivity.icon,
|
|
154
|
+
searchTags: [
|
|
155
|
+
'safety-plan-activity',
|
|
156
|
+
'safety plan activity',
|
|
157
|
+
'activity',
|
|
158
|
+
'work activity',
|
|
159
|
+
'plan activity',
|
|
160
|
+
'فعالیت برنامه ایمنی',
|
|
161
|
+
'فعالیت',
|
|
162
|
+
'برنامه ایمنی',
|
|
163
|
+
'ایمنی محیط کار',
|
|
164
|
+
],
|
|
165
|
+
formats: {
|
|
166
|
+
individual: RootConfig.entities.safetyPlanActivity.title,
|
|
167
|
+
plural: RootConfig.entities.safetyPlanActivity.titlePlural,
|
|
168
|
+
searchResult: {
|
|
169
|
+
title: '{{ code }}',
|
|
170
|
+
description: '{{ description }}',
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
plugins: [
|
|
174
|
+
{ name: 'identifier', options: { field: 'code', rule: 'safety-plan-activity-code' } },
|
|
175
|
+
{ name: 'unique-fields', options: { fields: 'code', scope: 'global' } },
|
|
176
|
+
{ name: 'archive' },
|
|
177
|
+
{
|
|
178
|
+
name: 'attachments',
|
|
179
|
+
options: {
|
|
180
|
+
accept: '.jpg,.jpeg,.png,.pdf,.doc,.docx',
|
|
181
|
+
fileEditable: true,
|
|
182
|
+
display: 'page',
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
],
|
|
186
|
+
relatedEntities: [],
|
|
187
|
+
groups: [
|
|
188
|
+
{
|
|
189
|
+
id: 'basic-info',
|
|
190
|
+
title: '@workplacesafety-management:safety-plan-activities.entities.safety-plan-activity.groups.basic-info',
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
id: 'items',
|
|
194
|
+
title: '@workplacesafety-management:safety-plan-activities.entities.safety-plan-activity.groups.items',
|
|
195
|
+
},
|
|
196
|
+
],
|
|
197
|
+
properties: [
|
|
198
|
+
{
|
|
199
|
+
name: 'id',
|
|
200
|
+
title: '@general:terms.common.id',
|
|
201
|
+
groupId: 'basic-info',
|
|
202
|
+
schema: { dataType: 'uuid', visible: false, nullable: false, readonly: true, unique: { enabled: true } },
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
name: 'code',
|
|
206
|
+
title: '@workplacesafety-management:safety-plan-activities.entities.safety-plan-activity.fields.code.title',
|
|
207
|
+
groupId: 'basic-info',
|
|
208
|
+
options: listSortAndFilterOptions,
|
|
209
|
+
schema: {
|
|
210
|
+
dataType: 'string',
|
|
211
|
+
unique: { enabled: true },
|
|
212
|
+
interface: {
|
|
213
|
+
type: AXPWidgetsList.Editors.TextBox,
|
|
214
|
+
options: {
|
|
215
|
+
disabled: true,
|
|
216
|
+
placeholder: '@workplacesafety-management:safety-plan-activities.entities.safety-plan-activity.fields.code.placeholder',
|
|
217
|
+
},
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
validations: [{ rule: 'required' }],
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
name: 'title',
|
|
224
|
+
title: '@workplacesafety-management:safety-plan-activities.entities.safety-plan-activity.fields.title.title',
|
|
225
|
+
groupId: 'basic-info',
|
|
226
|
+
options: listSortAndFilterOptions,
|
|
227
|
+
schema: {
|
|
228
|
+
dataType: 'string',
|
|
229
|
+
interface: {
|
|
230
|
+
type: AXPWidgetsList.Editors.TextBox,
|
|
231
|
+
options: {
|
|
232
|
+
placeholder: '@workplacesafety-management:safety-plan-activities.entities.safety-plan-activity.fields.title.placeholder',
|
|
233
|
+
},
|
|
234
|
+
},
|
|
235
|
+
},
|
|
236
|
+
validations: [{ rule: 'required' }],
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
name: 'description',
|
|
240
|
+
title: '@workplacesafety-management:safety-plan-activities.entities.safety-plan-activity.fields.description.title',
|
|
241
|
+
groupId: 'basic-info',
|
|
242
|
+
options: {
|
|
243
|
+
sort: { enabled: false },
|
|
244
|
+
filter: { advance: { enabled: true }, inline: { enabled: false } },
|
|
245
|
+
},
|
|
246
|
+
schema: {
|
|
247
|
+
dataType: 'string',
|
|
248
|
+
interface: {
|
|
249
|
+
type: AXPWidgetsList.Editors.LargeTextBox,
|
|
250
|
+
options: {
|
|
251
|
+
rows: 2,
|
|
252
|
+
placeholder: '@workplacesafety-management:safety-plan-activities.entities.safety-plan-activity.fields.description.placeholder',
|
|
253
|
+
},
|
|
254
|
+
},
|
|
255
|
+
},
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
name: 'items',
|
|
259
|
+
title: '',
|
|
260
|
+
groupId: 'items',
|
|
261
|
+
schema: {
|
|
262
|
+
defaultValue: [],
|
|
263
|
+
dataType: 'array',
|
|
264
|
+
nullable: true,
|
|
265
|
+
interface: {
|
|
266
|
+
type: AXPWidgetsList.Layouts.RepeaterLayout,
|
|
267
|
+
options: { hasControls: true, allowReorder: true },
|
|
268
|
+
children: [...ITEMS_REPEATER_CHILDREN],
|
|
269
|
+
},
|
|
270
|
+
},
|
|
271
|
+
},
|
|
272
|
+
],
|
|
273
|
+
columns: [
|
|
274
|
+
{ name: 'code', options: { width: '120px', order: 1 } },
|
|
275
|
+
{ name: 'title', options: { width: '200px', order: 2 } },
|
|
276
|
+
{ name: 'description', options: { width: '280px', order: 3 } },
|
|
277
|
+
],
|
|
278
|
+
interfaces: {
|
|
279
|
+
master: {
|
|
280
|
+
create: {
|
|
281
|
+
sections: [{ id: 'basic-info' }, { id: 'items' }],
|
|
282
|
+
properties: [
|
|
283
|
+
{ name: 'code', layout: { positions: { lg: { colSpan: 6, order: 1 } } } },
|
|
284
|
+
{ name: 'title', layout: { positions: { lg: { colSpan: 12, order: 2 } } } },
|
|
285
|
+
{ name: 'description', layout: { positions: { lg: { colSpan: 12, order: 3 } } } },
|
|
286
|
+
itemsPropertyLayout,
|
|
287
|
+
],
|
|
288
|
+
},
|
|
289
|
+
update: {
|
|
290
|
+
sections: [{ id: 'basic-info' }, { id: 'items' }],
|
|
291
|
+
properties: [
|
|
292
|
+
{ name: 'code', layout: { positions: { lg: { colSpan: 6, order: 1 } } } },
|
|
293
|
+
{ name: 'title', layout: { positions: { lg: { colSpan: 12, order: 2 } } } },
|
|
294
|
+
{ name: 'description', layout: { positions: { lg: { colSpan: 12, order: 3 } } } },
|
|
295
|
+
itemsPropertyLayout,
|
|
296
|
+
],
|
|
297
|
+
},
|
|
298
|
+
single: {
|
|
299
|
+
title: '{{ title }}',
|
|
300
|
+
sections: [
|
|
301
|
+
{ id: 'basic-info', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
302
|
+
{ id: 'items', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
303
|
+
],
|
|
304
|
+
properties: [
|
|
305
|
+
{ name: 'code', layout: { positions: { lg: { colSpan: 6, order: 1 } } } },
|
|
306
|
+
{ name: 'title', layout: { positions: { lg: { colSpan: 12, order: 2 } } } },
|
|
307
|
+
{ name: 'description', layout: { positions: { lg: { colSpan: 12, order: 3 } } } },
|
|
308
|
+
itemsPropertyLayout,
|
|
309
|
+
],
|
|
310
|
+
actions: [...entityMasterRecordActions()],
|
|
311
|
+
},
|
|
312
|
+
list: {
|
|
313
|
+
actions: [...entityMasterCrudActions()],
|
|
314
|
+
views: [createAllQueryView({ sorts: [{ name: 'code', dir: 'asc' }] })],
|
|
315
|
+
},
|
|
316
|
+
},
|
|
317
|
+
},
|
|
318
|
+
};
|
|
319
|
+
return entityDef;
|
|
320
|
+
}
|
|
321
|
+
//#endregion
|
|
322
|
+
|
|
323
|
+
export { safetyPlanActivityEntityFactory };
|
|
324
|
+
//# sourceMappingURL=acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-activity.entity-CZCYupQT.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-activity.entity-CZCYupQT.mjs","sources":["../../../../libs/modules/workplacesafety-management/contracts/src/entities/safety-plan-activity/safety-plan-activity.entity.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXPWidgetsList } from '@acorex-platform/framework-shared/core';\nimport {\n AXPEntity,\n createAllQueryView,\n entityMasterCrudActions,\n entityMasterRecordActions,\n} from '@acorex-platform/framework-shared/entity';\n\nimport { RootConfig } from '../../root-config';\nimport {\n buildSafetyPlanSectionItemSelectorOptions,\n WORKPLACE_SAFETY_SECTION_TYPE_LOOKUP_WIDGET_OPTIONS,\n} from '../../safety-plan-section-dependency';\nimport {\n buildWorkplaceSafetySectionTypeEntityExpression,\n WORKPLACE_SAFETY_BUILT_IN_SECTION_TYPE_IDS,\n} from '../../section-type-entity-map';\n\n//#endregion\n\n//#region ---- Constants ----\n\nconst listSortAndFilterOptions = {\n sort: { enabled: true },\n filter: { advance: { enabled: true }, inline: { enabled: true } },\n};\n\n/**\n * Section-type picker for activity item rows — no title/description sync (those would\n * write onto the parent SafetyPlanActivity fields), and Activity itself is excluded.\n * Keep `expose` so `sectionType.id` updates and itemIds cascade can react.\n */\nconst ACTIVITY_ITEMS_SECTION_TYPE_LOOKUP_OPTIONS: Record<string, unknown> = {\n ...WORKPLACE_SAFETY_SECTION_TYPE_LOOKUP_WIDGET_OPTIONS,\n triggers: [],\n filter: {\n logic: 'and',\n filters: [\n {\n field: 'id',\n operator: { type: 'notEqual' },\n value: WORKPLACE_SAFETY_BUILT_IN_SECTION_TYPE_IDS.activity,\n },\n ],\n },\n};\n\n/**\n * Bound sectionTypeId on the repeater row (parent of the itemIds lookup).\n * `>` is required at eval time for the correct row value.\n */\nconst ACTIVITY_ITEM_SECTION_TYPE_ID_PATH = '>sectionTypeId';\n\n/** Maps row sectionTypeId → catalog entity (Hazard, Ppe, Control, …). */\nconst ACTIVITY_ITEM_ENTITY_EXPRESSION = buildWorkplaceSafetySectionTypeEntityExpression(\n ACTIVITY_ITEM_SECTION_TYPE_ID_PATH,\n);\n\n/**\n * Enable itemIds once the row has a section type.\n *\n * `>sectionTypeId` alone does not re-trigger option updates for nested paths like\n * `items.[n].sectionTypeId` (renderer dependency matching ignores the `>` prefix).\n * Including bare `sectionTypeId` makes `isSegmentSuffix` treat the nested change as\n * relevant so disabled/entity expressions re-evaluate after selection.\n */\nconst ACTIVITY_ITEM_IDS_DISABLED_EXPRESSION =\n \"{{ !(context.eval('>sectionTypeId') || context.eval('sectionTypeId')) }}\";\n\n/**\n * Activity-only cascade: clear selection + refresh entity/data when section type changes.\n * Do not use the shared section triggers — they call `context.set('items', [])`, which\n * would wipe this entity's `items` repeater (same key as the lookup expose parent).\n */\nconst ACTIVITY_ITEM_IDS_SECTION_TYPE_TRIGGERS = [\n {\n event: \"{{ events.context('sectionType.id') }}\",\n action: '{{ widget.setValue([]); widget.refresh(); }}',\n },\n {\n event: \"{{ events.context('sectionTypeId') }}\",\n action: '{{ widget.setValue([]); widget.refresh(); }}',\n },\n];\n\n/** Same repeater widget tree as {@link safetyPlanSectionEntityFactory} `items`. */\nconst ITEMS_REPEATER_CHILDREN = [\n {\n type: AXPWidgetsList.Layouts.GridLayout,\n mode: 'edit' as const,\n name: 'itemRow',\n options: {\n grid: {\n default: {\n columns: 12,\n gap: '1rem',\n },\n },\n },\n children: [\n {\n type: AXPWidgetsList.Layouts.GridItemLayout,\n mode: 'edit' as const,\n options: { colSpan: 4 },\n children: [\n {\n type: AXPWidgetsList.Layouts.FormField,\n mode: 'edit' as const,\n options: {\n label:\n '@workplacesafety-management:safety-plan-sections.entities.safety-plan-section.fields.section-type.title',\n showLabel: true,\n },\n children: [\n {\n type: AXPWidgetsList.Editors.LookupBox,\n mode: 'edit' as const,\n path: 'sectionTypeId',\n name: 'sectionTypeId',\n options: {\n entity: `${RootConfig.module.name}.${RootConfig.entities.sectionType.name}`,\n ...ACTIVITY_ITEMS_SECTION_TYPE_LOOKUP_OPTIONS,\n },\n },\n ],\n },\n ],\n },\n {\n type: AXPWidgetsList.Layouts.GridItemLayout,\n mode: 'edit' as const,\n options: { colSpan: 8 },\n children: [\n {\n type: AXPWidgetsList.Layouts.FormField,\n mode: 'edit' as const,\n options: {\n label:\n '@workplacesafety-management:safety-plan-sections.entities.safety-plan-section.fields.item-ids.title',\n showLabel: true,\n },\n children: [\n {\n type: AXPWidgetsList.Editors.LookupBox,\n mode: 'edit' as const,\n path: 'itemIds',\n name: 'itemIds',\n triggers: ACTIVITY_ITEM_IDS_SECTION_TYPE_TRIGGERS,\n options: {\n ...buildSafetyPlanSectionItemSelectorOptions(ACTIVITY_ITEM_ENTITY_EXPRESSION, {\n sectionTypeIdPath: ACTIVITY_ITEM_SECTION_TYPE_ID_PATH,\n }),\n // Shared options expose into `items.*` — that key is this entity's repeater.\n expose: [],\n triggers: ACTIVITY_ITEM_IDS_SECTION_TYPE_TRIGGERS,\n valueField: 'id',\n disabled: ACTIVITY_ITEM_IDS_DISABLED_EXPRESSION,\n },\n },\n ],\n },\n ],\n },\n ],\n },\n];\n\nconst itemsPropertyLayout = {\n name: 'items',\n layout: { label: { visible: false }, order: 1, positions: { lg: { colSpan: 12 } } },\n};\n\n//#endregion\n\n//#region ---- Entity factory ----\n\nexport async function safetyPlanActivityEntityFactory(): Promise<AXPEntity | null> {\n const entityDef: AXPEntity = {\n module: RootConfig.module.name,\n name: RootConfig.entities.safetyPlanActivity.name,\n title: RootConfig.entities.safetyPlanActivity.title,\n icon: RootConfig.entities.safetyPlanActivity.icon,\n searchTags: [\n 'safety-plan-activity',\n 'safety plan activity',\n 'activity',\n 'work activity',\n 'plan activity',\n 'فعالیت برنامه ایمنی',\n 'فعالیت',\n 'برنامه ایمنی',\n 'ایمنی محیط کار',\n ],\n formats: {\n individual: RootConfig.entities.safetyPlanActivity.title,\n plural: RootConfig.entities.safetyPlanActivity.titlePlural,\n searchResult: {\n title: '{{ code }}',\n description: '{{ description }}',\n },\n },\n plugins: [\n { name: 'identifier', options: { field: 'code', rule: 'safety-plan-activity-code' } },\n { name: 'unique-fields', options: { fields: 'code', scope: 'global' } },\n { name: 'archive' },\n {\n name: 'attachments',\n options: {\n accept: '.jpg,.jpeg,.png,.pdf,.doc,.docx',\n fileEditable: true,\n display: 'page',\n },\n },\n ],\n relatedEntities: [],\n groups: [\n {\n id: 'basic-info',\n title:\n '@workplacesafety-management:safety-plan-activities.entities.safety-plan-activity.groups.basic-info',\n },\n {\n id: 'items',\n title: '@workplacesafety-management:safety-plan-activities.entities.safety-plan-activity.groups.items',\n },\n ],\n properties: [\n {\n name: 'id',\n title: '@general:terms.common.id',\n groupId: 'basic-info',\n schema: { dataType: 'uuid', visible: false, nullable: false, readonly: true, unique: { enabled: true } },\n },\n {\n name: 'code',\n title: '@workplacesafety-management:safety-plan-activities.entities.safety-plan-activity.fields.code.title',\n groupId: 'basic-info',\n options: listSortAndFilterOptions,\n schema: {\n dataType: 'string',\n unique: { enabled: true },\n interface: {\n type: AXPWidgetsList.Editors.TextBox,\n options: {\n disabled: true,\n placeholder:\n '@workplacesafety-management:safety-plan-activities.entities.safety-plan-activity.fields.code.placeholder',\n },\n },\n },\n validations: [{ rule: 'required' }],\n },\n {\n name: 'title',\n title: '@workplacesafety-management:safety-plan-activities.entities.safety-plan-activity.fields.title.title',\n groupId: 'basic-info',\n options: listSortAndFilterOptions,\n schema: {\n dataType: 'string',\n interface: {\n type: AXPWidgetsList.Editors.TextBox,\n options: {\n placeholder:\n '@workplacesafety-management:safety-plan-activities.entities.safety-plan-activity.fields.title.placeholder',\n },\n },\n },\n validations: [{ rule: 'required' }],\n },\n {\n name: 'description',\n title:\n '@workplacesafety-management:safety-plan-activities.entities.safety-plan-activity.fields.description.title',\n groupId: 'basic-info',\n options: {\n sort: { enabled: false },\n filter: { advance: { enabled: true }, inline: { enabled: false } },\n },\n schema: {\n dataType: 'string',\n interface: {\n type: AXPWidgetsList.Editors.LargeTextBox,\n options: {\n rows: 2,\n placeholder:\n '@workplacesafety-management:safety-plan-activities.entities.safety-plan-activity.fields.description.placeholder',\n },\n },\n },\n },\n {\n name: 'items',\n title: '',\n groupId: 'items',\n schema: {\n defaultValue: [],\n dataType: 'array',\n nullable: true,\n interface: {\n type: AXPWidgetsList.Layouts.RepeaterLayout,\n options: { hasControls: true, allowReorder: true },\n children: [...ITEMS_REPEATER_CHILDREN],\n },\n },\n },\n ],\n columns: [\n { name: 'code', options: { width: '120px', order: 1 } },\n { name: 'title', options: { width: '200px', order: 2 } },\n { name: 'description', options: { width: '280px', order: 3 } },\n ],\n interfaces: {\n master: {\n create: {\n sections: [{ id: 'basic-info' }, { id: 'items' }],\n properties: [\n { name: 'code', layout: { positions: { lg: { colSpan: 6, order: 1 } } } },\n { name: 'title', layout: { positions: { lg: { colSpan: 12, order: 2 } } } },\n { name: 'description', layout: { positions: { lg: { colSpan: 12, order: 3 } } } },\n itemsPropertyLayout,\n ],\n },\n update: {\n sections: [{ id: 'basic-info' }, { id: 'items' }],\n properties: [\n { name: 'code', layout: { positions: { lg: { colSpan: 6, order: 1 } } } },\n { name: 'title', layout: { positions: { lg: { colSpan: 12, order: 2 } } } },\n { name: 'description', layout: { positions: { lg: { colSpan: 12, order: 3 } } } },\n itemsPropertyLayout,\n ],\n },\n single: {\n title: '{{ title }}',\n sections: [\n { id: 'basic-info', layout: { positions: { lg: { colSpan: 12 } } } },\n { id: 'items', layout: { positions: { lg: { colSpan: 12 } } } },\n ],\n properties: [\n { name: 'code', layout: { positions: { lg: { colSpan: 6, order: 1 } } } },\n { name: 'title', layout: { positions: { lg: { colSpan: 12, order: 2 } } } },\n { name: 'description', layout: { positions: { lg: { colSpan: 12, order: 3 } } } },\n itemsPropertyLayout,\n ],\n actions: [...entityMasterRecordActions()],\n },\n list: {\n actions: [...entityMasterCrudActions()],\n views: [createAllQueryView({ sorts: [{ name: 'code', dir: 'asc' }] })],\n },\n },\n },\n };\n\n return entityDef;\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;AAAA;AAoBA;AAEA;AAEA,MAAM,wBAAwB,GAAG;AAC/B,IAAA,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;AACvB,IAAA,MAAM,EAAE,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;CAClE;AAED;;;;AAIG;AACH,MAAM,0CAA0C,GAA4B;AAC1E,IAAA,GAAG,mDAAmD;AACtD,IAAA,QAAQ,EAAE,EAAE;AACZ,IAAA,MAAM,EAAE;AACN,QAAA,KAAK,EAAE,KAAK;AACZ,QAAA,OAAO,EAAE;AACP,YAAA;AACE,gBAAA,KAAK,EAAE,IAAI;AACX,gBAAA,QAAQ,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE;gBAC9B,KAAK,EAAE,0CAA0C,CAAC,QAAQ;AAC3D,aAAA;AACF,SAAA;AACF,KAAA;CACF;AAED;;;AAGG;AACH,MAAM,kCA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EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;AAChE,qBAAA;AACD,oBAAA,UAAU,EAAE;wBACV,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE;wBACzE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE;wBAC3E,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE;wBACjF,mBAAmB;AACpB,qBAAA;AACD,oBAAA,OAAO,EAAE,CAAC,GAAG,yBAAyB,EAAE,CAAC;AAC1C,iBAAA;AACD,gBAAA,IAAI,EAAE;AACJ,oBAAA,OAAO,EAAE,CAAC,GAAG,uBAAuB,EAAE,CAAC;oBACvC,KAAK,EAAE,CAAC,kBAAkB,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;AACvE,iBAAA;AACF,aAAA;AACF,SAAA;KACF;AAED,IAAA,OAAO,SAAS;AAClB;AAEA;;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { R as
|
|
1
|
+
import { R as RISK_MANAGEMENT_RISK_MATRIX_ENTITY } from './acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-risk-management.integration-CUZIl8zt.mjs';
|
|
2
|
+
import { R as RootConfig } from './acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-C46YEBVd.mjs';
|
|
2
3
|
import { createRandomUuid } from '@acorex-platform/framework-shared/core';
|
|
3
4
|
|
|
4
5
|
//#region ---- Imports ----
|
|
@@ -15,7 +16,7 @@ const WORKPLACE_SAFETY_BUILT_IN_SECTION_TYPE_IDS = {
|
|
|
15
16
|
ppeHazards: 'c1d2e3f4-a5b6-4789-c001-000000000007',
|
|
16
17
|
riskMatrix: 'c1d2e3f4-a5b6-4789-c001-000000000008',
|
|
17
18
|
hazardRiskPpe: 'c1d2e3f4-a5b6-4789-c001-000000000009',
|
|
18
|
-
|
|
19
|
+
activity: 'c1d2e3f4-a5b6-4789-c001-00000000000a',
|
|
19
20
|
};
|
|
20
21
|
const moduleName = RootConfig.module.name;
|
|
21
22
|
/** Maps section type codes to the entity that supplies selectable items. */
|
|
@@ -27,10 +28,10 @@ const WORKPLACE_SAFETY_SECTION_TYPE_ENTITY_BY_CODE = {
|
|
|
27
28
|
HazardRiskPpe: undefined,
|
|
28
29
|
Control: `${moduleName}.${RootConfig.entities.controlMeasure.name}`,
|
|
29
30
|
HierarchyLevel: `${moduleName}.${RootConfig.entities.controlHierarchyLevels.name}`,
|
|
30
|
-
RiskMatrix:
|
|
31
|
+
RiskMatrix: RISK_MANAGEMENT_RISK_MATRIX_ENTITY,
|
|
31
32
|
Custom: undefined,
|
|
32
|
-
/** Host section for
|
|
33
|
-
|
|
33
|
+
/** Host section for Activity rows (managed by the section builder, not a catalog picker). */
|
|
34
|
+
Activity: undefined,
|
|
34
35
|
};
|
|
35
36
|
/** Built-in section types resolved by stable section type id. */
|
|
36
37
|
const WORKPLACE_SAFETY_BUILT_IN_SECTION_TYPE_BY_ID = {
|
|
@@ -71,9 +72,9 @@ const WORKPLACE_SAFETY_BUILT_IN_SECTION_TYPE_BY_ID = {
|
|
|
71
72
|
itemEntityName: WORKPLACE_SAFETY_SECTION_TYPE_ENTITY_BY_CODE.Custom,
|
|
72
73
|
isRepeatable: true,
|
|
73
74
|
},
|
|
74
|
-
[WORKPLACE_SAFETY_BUILT_IN_SECTION_TYPE_IDS.
|
|
75
|
-
sectionTypeKey: '
|
|
76
|
-
itemEntityName: WORKPLACE_SAFETY_SECTION_TYPE_ENTITY_BY_CODE.
|
|
75
|
+
[WORKPLACE_SAFETY_BUILT_IN_SECTION_TYPE_IDS.activity]: {
|
|
76
|
+
sectionTypeKey: 'Activity',
|
|
77
|
+
itemEntityName: WORKPLACE_SAFETY_SECTION_TYPE_ENTITY_BY_CODE.Activity,
|
|
77
78
|
isRepeatable: true,
|
|
78
79
|
},
|
|
79
80
|
};
|
|
@@ -92,6 +93,50 @@ function resolveSectionTypeKey(sectionTypeId, snapshot) {
|
|
|
92
93
|
return WORKPLACE_SAFETY_BUILT_IN_SECTION_TYPE_BY_ID[sectionTypeId]
|
|
93
94
|
?.sectionTypeKey;
|
|
94
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* Human-readable titles for built-in section type keys (matches seeded SectionType titles).
|
|
98
|
+
* Used when snapshots lack `title` (common after id-only enrichment).
|
|
99
|
+
*/
|
|
100
|
+
const SECTION_TYPE_KEY_DISPLAY_TITLES = {
|
|
101
|
+
Hazard: 'Hazard',
|
|
102
|
+
HazardRisk: 'Hazard Risk',
|
|
103
|
+
Ppe: 'PPE',
|
|
104
|
+
PpeHazards: 'Hazard PPE Items',
|
|
105
|
+
HazardRiskPpe: 'Hazard Risk PPE',
|
|
106
|
+
Control: 'Control',
|
|
107
|
+
HierarchyLevel: 'Hierarchy Level',
|
|
108
|
+
RiskMatrix: 'Risk Matrix',
|
|
109
|
+
Custom: 'Custom',
|
|
110
|
+
Activity: 'Activity',
|
|
111
|
+
};
|
|
112
|
+
/** Formats a section type key for display (e.g. `HierarchyLevel` → `Hierarchy Level`). */
|
|
113
|
+
function formatSectionTypeKeyAsTitle(key) {
|
|
114
|
+
if (!key) {
|
|
115
|
+
return '';
|
|
116
|
+
}
|
|
117
|
+
const known = SECTION_TYPE_KEY_DISPLAY_TITLES[key];
|
|
118
|
+
if (known) {
|
|
119
|
+
return known;
|
|
120
|
+
}
|
|
121
|
+
return key.replace(/([a-z\d])([A-Z])/g, '$1 $2').trim();
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Resolves a section type label for UI/preview: snapshot title → key display title → spaced code.
|
|
125
|
+
*/
|
|
126
|
+
function resolveSectionTypeDisplayTitle(sectionTypeId, snapshot) {
|
|
127
|
+
if (typeof snapshot?.title === 'string' && snapshot.title.trim()) {
|
|
128
|
+
return snapshot.title.trim();
|
|
129
|
+
}
|
|
130
|
+
const key = resolveSectionTypeKey(sectionTypeId, snapshot ?? undefined);
|
|
131
|
+
const fromKey = formatSectionTypeKeyAsTitle(key);
|
|
132
|
+
if (fromKey) {
|
|
133
|
+
return fromKey;
|
|
134
|
+
}
|
|
135
|
+
if (typeof snapshot?.code === 'string' && snapshot.code.trim()) {
|
|
136
|
+
return formatSectionTypeKeyAsTitle(snapshot.code.trim()) || snapshot.code.trim();
|
|
137
|
+
}
|
|
138
|
+
return '';
|
|
139
|
+
}
|
|
95
140
|
function resolveSectionItemEntityName(sectionTypeId, snapshot) {
|
|
96
141
|
const fromSnapshot = snapshot?.itemEntityName;
|
|
97
142
|
if (typeof fromSnapshot === 'string' && fromSnapshot.length > 0) {
|
|
@@ -133,6 +178,13 @@ function buildSectionTypeEntityExpressionWithSnapshotFallback(sectionTypeIdPath,
|
|
|
133
178
|
* For repeater / nested FormField widgets — `>` walks up to the row where `sectionType` is exposed.
|
|
134
179
|
*/
|
|
135
180
|
const WORKPLACE_SAFETY_SECTION_TYPE_ENTITY_EXPRESSION = buildSectionTypeEntityExpressionWithSnapshotFallback('>sectionType.id', '>sectionType.itemEntityName');
|
|
181
|
+
/**
|
|
182
|
+
* Entity expression keyed by the bound `sectionTypeId` field (repeater-safe).
|
|
183
|
+
* Prefer this when expose snapshots may not live on the same path the lookup evaluates.
|
|
184
|
+
*/
|
|
185
|
+
function buildWorkplaceSafetySectionTypeEntityExpression(sectionTypeIdPath) {
|
|
186
|
+
return buildSectionTypeEntityExpressionById(sectionTypeIdPath);
|
|
187
|
+
}
|
|
136
188
|
/**
|
|
137
189
|
* For flat dialog / dynamic forms — sibling fields share the same context (no parent path).
|
|
138
190
|
*/
|
|
@@ -1001,5 +1053,5 @@ function isPpeRuleSectionTypeId(sectionTypeId) {
|
|
|
1001
1053
|
}
|
|
1002
1054
|
//#endregion
|
|
1003
1055
|
|
|
1004
|
-
export { WORKPLACE_SAFETY_SECTION_TYPE_LOOKUP_WIDGET_OPTIONS as W, WORKPLACE_SAFETY_SECTION_ITEM_LOOKUP_SECTION_TYPE_TRIGGERS as a, buildSafetyPlanSectionItemSelectorOptions as b, WORKPLACE_SAFETY_SECTION_TYPE_ENTITY_EXPRESSION as c, WORKPLACE_SAFETY_SECTION_TYPE_LOOKUP_EXPOSE as d };
|
|
1005
|
-
//# sourceMappingURL=acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-section-dependency-
|
|
1056
|
+
export { WORKPLACE_SAFETY_SECTION_TYPE_LOOKUP_WIDGET_OPTIONS as W, WORKPLACE_SAFETY_SECTION_ITEM_LOOKUP_SECTION_TYPE_TRIGGERS as a, buildSafetyPlanSectionItemSelectorOptions as b, WORKPLACE_SAFETY_SECTION_TYPE_ENTITY_EXPRESSION as c, WORKPLACE_SAFETY_SECTION_TYPE_LOOKUP_EXPOSE as d, WORKPLACE_SAFETY_BUILT_IN_SECTION_TYPE_IDS as e, buildWorkplaceSafetySectionTypeEntityExpression as f };
|
|
1057
|
+
//# sourceMappingURL=acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-section-dependency-D0fzHV_L.mjs.map
|