@acorex-platform/module-workplacesafety-management-client 1.0.2 → 2.0.0-beta.1
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-BM1x8qua.mjs → acorex-platform-module-workplacesafety-management-client-acorex-platform-module-workplacesafety-management-client-Bsyyn-al.mjs} +134 -30
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-acorex-platform-module-workplacesafety-management-client-Bsyyn-al.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-hazard.mjs +1 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-hazard.mjs.map +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-C46YEBVd.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-5xvF3Yvw.mjs} +16 -16
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-C46YEBVd.mjs.map → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-5xvF3Yvw.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-control-hierarchy-levels.entity-oylKTsgJ.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-control-hierarchy-levels.entity-Bp8WxGds.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-control-hierarchy-levels.entity-oylKTsgJ.mjs.map → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-control-hierarchy-levels.entity-Bp8WxGds.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-control-measure.entity-DHm1nRwW.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-control-measure.entity-BPEVWX3t.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-control-measure.entity-DHm1nRwW.mjs.map → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-control-measure.entity-BPEVWX3t.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-ppe-rule.entity-DH-hPuAD.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-ppe-rule.entity-CwoiGFyJ.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-ppe-rule.entity-DH-hPuAD.mjs.map → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-ppe-rule.entity-CwoiGFyJ.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-register.entity-g4AT_IiT.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-register.entity-D_DNr3E1.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-register.entity-g4AT_IiT.mjs.map → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-register.entity-D_DNr3E1.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-risk.entity-BwNlWbnC.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-risk.entity-Cw1hRgfr.mjs} +3 -3
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-risk.entity-BwNlWbnC.mjs.map → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-risk.entity-Cw1hRgfr.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard.entity-Cogwbd1P.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard.entity-BieryjkE.mjs} +3 -3
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard.entity-BieryjkE.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-ppe-item.entity-0xqGaPnk.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-ppe-item.entity-BM6hh1Ng.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-ppe-item.entity-0xqGaPnk.mjs.map → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-ppe-item.entity-BM6hh1Ng.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-risk-management.integration-CUZIl8zt.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-risk-management.integration-T7XtDUR4.mjs} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-risk-management.integration-CUZIl8zt.mjs.map → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-risk-management.integration-T7XtDUR4.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-activity.entity-CZCYupQT.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-activity.entity-DAUPFoMX.mjs} +3 -3
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-activity.entity-CZCYupQT.mjs.map → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-activity.entity-DAUPFoMX.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-section-dependency-D0fzHV_L.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-section-dependency-7ue7iLix.mjs} +3 -3
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-section-dependency-D0fzHV_L.mjs.map → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-section-dependency-7ue7iLix.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-section.entity-BpziBgGf.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-section.entity-Bjc0NeUT.mjs} +3 -3
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-section.entity-BpziBgGf.mjs.map → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-section.entity-Bjc0NeUT.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-type-section.entity-D8wL0ned.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-type-section.entity-BdunBI16.mjs} +3 -3
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-type-section.entity-D8wL0ned.mjs.map → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-type-section.entity-BdunBI16.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-type.entity-DrqQDYn9.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-type.entity-x_FEbNre.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-type.entity-DrqQDYn9.mjs.map → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-type.entity-x_FEbNre.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan.entity-DaRnWCin.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan.entity-XvLsWmcd.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan.entity-DaRnWCin.mjs.map → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan.entity-XvLsWmcd.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-template.entity-Coj5Rzry.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-template.entity-xBOZ9HQN.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-template.entity-Coj5Rzry.mjs.map → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-template.entity-xBOZ9HQN.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-section-type.entity-BU5roQ5-.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-section-type.entity-CbEagwww.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-section-type.entity-BU5roQ5-.mjs.map → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-section-type.entity-CbEagwww.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-work-step-type.entity-DijGV30H.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-work-step-type.entity-dlnMABo2.mjs} +3 -3
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-work-step-type.entity-DijGV30H.mjs.map → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-work-step-type.entity-dlnMABo2.mjs.map} +1 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog.mjs +1 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts.mjs +47 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts.mjs.map +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-control-hierarchy-diagram-widget-view.component-nsOufvaz.mjs → acorex-platform-module-workplacesafety-management-client-control-hierarchy-diagram-widget-view.component-CLmWHTfS.mjs} +3 -3
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-control-hierarchy-diagram-widget-view.component-nsOufvaz.mjs.map → acorex-platform-module-workplacesafety-management-client-control-hierarchy-diagram-widget-view.component-CLmWHTfS.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-control-hierarchy-diagram.component-CmyssHtY.mjs → acorex-platform-module-workplacesafety-management-client-control-hierarchy-diagram.component-bohOkOIV.mjs} +4 -4
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-control-hierarchy-diagram.component-CmyssHtY.mjs.map → acorex-platform-module-workplacesafety-management-client-control-hierarchy-diagram.component-bohOkOIV.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-control-hierarchy-diagram.service-tMrUDnCb.mjs → acorex-platform-module-workplacesafety-management-client-control-hierarchy-diagram.service-B0aLa6KF.mjs} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-control-hierarchy-diagram.service-tMrUDnCb.mjs.map → acorex-platform-module-workplacesafety-management-client-control-hierarchy-diagram.service-B0aLa6KF.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-fill-safety-plan.command-BLktbCMG.mjs → acorex-platform-module-workplacesafety-management-client-fill-safety-plan.command-By_pSGSY.mjs} +4 -4
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-fill-safety-plan.command-BLktbCMG.mjs.map → acorex-platform-module-workplacesafety-management-client-fill-safety-plan.command-By_pSGSY.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-hazard-ppe-rule-status.provider-6ZWaO5DG.mjs → acorex-platform-module-workplacesafety-management-client-hazard-ppe-rule-status.provider-XUpvOWyt.mjs} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-hazard-ppe-rule-status.provider-6ZWaO5DG.mjs.map → acorex-platform-module-workplacesafety-management-client-hazard-ppe-rule-status.provider-XUpvOWyt.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-hazard-risk-status.provider-B6IkRYbW.mjs → acorex-platform-module-workplacesafety-management-client-hazard-risk-status.provider-hCnzjOe7.mjs} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-hazard-risk-status.provider-B6IkRYbW.mjs.map → acorex-platform-module-workplacesafety-management-client-hazard-risk-status.provider-hCnzjOe7.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-hydrate-safety-plan-activity-sections-D4K0RBpR.mjs → acorex-platform-module-workplacesafety-management-client-hydrate-safety-plan-activity-sections-SFRvQ81J.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-hydrate-safety-plan-activity-sections-D4K0RBpR.mjs.map → acorex-platform-module-workplacesafety-management-client-hydrate-safety-plan-activity-sections-SFRvQ81J.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-load-safety-plan-preview-structure-DA9w-vaB.mjs → acorex-platform-module-workplacesafety-management-client-load-safety-plan-preview-structure-072LSKo7.mjs} +3 -3
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-load-safety-plan-preview-structure-DA9w-vaB.mjs.map → acorex-platform-module-workplacesafety-management-client-load-safety-plan-preview-structure-072LSKo7.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-ppe-item-viewer-widget-column.component-D2Mmow12.mjs → acorex-platform-module-workplacesafety-management-client-ppe-item-viewer-widget-column.component-D4bhgV8u.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-ppe-item-viewer-widget-column.component-D2Mmow12.mjs.map → acorex-platform-module-workplacesafety-management-client-ppe-item-viewer-widget-column.component-D4bhgV8u.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-ppe-item-viewer-widget-edit.component-BqHXrGn9.mjs → acorex-platform-module-workplacesafety-management-client-ppe-item-viewer-widget-edit.component-CUwa70wq.mjs} +5 -5
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-ppe-item-viewer-widget-edit.component-BqHXrGn9.mjs.map → acorex-platform-module-workplacesafety-management-client-ppe-item-viewer-widget-edit.component-CUwa70wq.mjs.map} +1 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-ppe-item-viewer-widget-print.component-Bmr8LhoF.mjs +29 -0
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-ppe-item-viewer-widget-print.component-Bmr8LhoF.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-ppe-item-viewer.service-BxcGph1I.mjs → acorex-platform-module-workplacesafety-management-client-ppe-item-viewer.service-B_TuM6zB.mjs} +6 -6
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-ppe-item-viewer.service-BxcGph1I.mjs.map → acorex-platform-module-workplacesafety-management-client-ppe-item-viewer.service-B_TuM6zB.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-ppe-item-viewer.util-2Kl3_3sg.mjs → acorex-platform-module-workplacesafety-management-client-ppe-item-viewer.util-BTR9I8Te.mjs} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-ppe-item-viewer.util-2Kl3_3sg.mjs.map → acorex-platform-module-workplacesafety-management-client-ppe-item-viewer.util-BTR9I8Te.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-preview-control-hierarchy-diagram.command-Dd9xdo_y.mjs → acorex-platform-module-workplacesafety-management-client-preview-control-hierarchy-diagram.command-BfuvjV_F.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-preview-control-hierarchy-diagram.command-Dd9xdo_y.mjs.map → acorex-platform-module-workplacesafety-management-client-preview-control-hierarchy-diagram.command-BfuvjV_F.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-preview-safety-plan.command-CAlLZvLx.mjs → acorex-platform-module-workplacesafety-management-client-preview-safety-plan.command-B6HKY2jC.mjs} +4 -4
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-preview-safety-plan.command-CAlLZvLx.mjs.map → acorex-platform-module-workplacesafety-management-client-preview-safety-plan.command-B6HKY2jC.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-publish-safety-plan.command-Ci-zcrmO.mjs → acorex-platform-module-workplacesafety-management-client-publish-safety-plan.command-BiBLNqr4.mjs} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-publish-safety-plan.command-Ci-zcrmO.mjs.map → acorex-platform-module-workplacesafety-management-client-publish-safety-plan.command-BiBLNqr4.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-safety-plan-fill-values.util-RLOdySf7.mjs → acorex-platform-module-workplacesafety-management-client-safety-plan-fill-values.util-m4eQ5zx3.mjs} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-safety-plan-fill-values.util-RLOdySf7.mjs.map → acorex-platform-module-workplacesafety-management-client-safety-plan-fill-values.util-m4eQ5zx3.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-safety-plan-preview-modal.component-B3SJDR9q.mjs → acorex-platform-module-workplacesafety-management-client-safety-plan-preview-modal.component-omdGHrWD.mjs} +19 -19
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-safety-plan-preview-modal.component-B3SJDR9q.mjs.map → acorex-platform-module-workplacesafety-management-client-safety-plan-preview-modal.component-omdGHrWD.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-safety-plan-section-builder.types-C0SEJsVM.mjs → acorex-platform-module-workplacesafety-management-client-safety-plan-section-builder.types-DQX6nPWP.mjs} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-safety-plan-section-builder.types-C0SEJsVM.mjs.map → acorex-platform-module-workplacesafety-management-client-safety-plan-section-builder.types-DQX6nPWP.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-index-CwdK4rX8.mjs → acorex-platform-module-workplacesafety-management-client-safety-plan-sections-page-DlULCH_5.mjs} +8 -8
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-safety-plan-sections-page-DlULCH_5.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-safety-plan-status.provider-BpWx3gIf.mjs → acorex-platform-module-workplacesafety-management-client-safety-plan-status.provider-BjdJDKHn.mjs} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-safety-plan-status.provider-BpWx3gIf.mjs.map → acorex-platform-module-workplacesafety-management-client-safety-plan-status.provider-BjdJDKHn.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-save-safety-plan-sections.command-D0aRQHWk.mjs → acorex-platform-module-workplacesafety-management-client-save-safety-plan-sections.command-CQqJ-p5u.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-save-safety-plan-sections.command-D0aRQHWk.mjs.map → acorex-platform-module-workplacesafety-management-client-save-safety-plan-sections.command-CQqJ-p5u.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-show-job-doc-setup.command-B0g4JL0B.mjs → acorex-platform-module-workplacesafety-management-client-show-job-doc-setup.command-BY_NOprP.mjs} +88 -118
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-show-job-doc-setup.command-BY_NOprP.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workplacesafety-management-client.mjs +1 -1
- package/i18n/en-AU/workplacesafety-management.json +14 -1
- package/i18n/en-US/workplacesafety-management.json +14 -1
- package/i18n/fa-IR/workplacesafety-management.json +14 -1
- package/package.json +2 -2
- package/types/acorex-platform-module-workplacesafety-management-client-contracts.d.ts +37 -2
- package/types/acorex-platform-module-workplacesafety-management-client.d.ts +11 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-acorex-platform-module-workplacesafety-management-client-BM1x8qua.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard.entity-Cogwbd1P.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-index-CwdK4rX8.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client-show-job-doc-setup.command-B0g4JL0B.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-workplacesafety-management-client-hydrate-safety-plan-activity-sections-D4K0RBpR.mjs","sources":["../../../../libs/modules/workplacesafety-management/client/src/lib/features/safety-plan-preview/safety-plan-preview.service.ts","../../../../libs/modules/workplacesafety-management/client/src/lib/features/safety-plan-preview/hydrate-safety-plan-activity-sections.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport { Injectable, inject } from '@angular/core';\nimport { AXPopupService } from '@acorex/components/popup';\nimport { AXPDialogOpener } from '@acorex-platform/framework-client/core';\nimport { AXPDeviceService } from '@acorex-platform/framework-client/core';\n\nimport type {\n AXMSafetyPlanPreviewOpenOptions,\n AXMSafetyPlanPreviewResult,\n AXMSafetyPlanPreviewWorkflowActionSet,\n} from './safety-plan-preview.types';\n\n//#endregion\n\n//#region ----- Service -----\n\n@Injectable({ providedIn: 'root' })\nexport class AXMSafetyPlanPreviewService {\n //#region ----- Services & Dependencies -----\n\n private readonly popupService = inject(AXPopupService);\n private readonly dialogOpener = inject(AXPDialogOpener);\n private readonly deviceService = inject(AXPDeviceService);\n\n //#endregion\n\n //#region ----- Public API -----\n\n async open(options: AXMSafetyPlanPreviewOpenOptions): Promise<AXMSafetyPlanPreviewResult | null> {\n const workflowActionSet = this.resolveWorkflowActionSet(options);\n const result = await this.dialogOpener.openPopup({\n load: () => import('./safety-plan-preview-modal.component').then((module) => module.AXMSafetyPlanPreviewModalComponent),\n data: { planId: options.planId ?? '', title: options.title },\n show: (component) =>\n this.popupService.open(component, {\n title: options.title,\n size: this.deviceService.isSmall() ? 'full' : 'lg',\n data: {\n structure: options.structure,\n workflowActionSet,\n editable: options.editable === true,\n planId: options.planId,\n fillValues: options.fillValues ?? {},\n },\n }),\n });\n\n return (result?.data as AXMSafetyPlanPreviewResult | undefined) ?? null;\n }\n\n //#endregion\n\n //#region ----- Helpers -----\n\n private resolveWorkflowActionSet(\n options: AXMSafetyPlanPreviewOpenOptions,\n ): AXMSafetyPlanPreviewWorkflowActionSet | undefined {\n if (\n options.workflowActionSet === 'draft' ||\n options.workflowActionSet === 'assigned' ||\n options.workflowActionSet === 'locked'\n ) {\n return options.workflowActionSet;\n }\n if (options.showWorkflowActions === true) {\n return 'draft';\n }\n return undefined;\n }\n\n //#endregion\n}\n\n//#endregion\n\n","//#region ----- Imports -----\n\nimport { resolveEntityRowDisplayText } from '@acorex-platform/framework-client/common';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport {\n asSafetyPlanDisplayText,\n isActivitySectionType,\n mapSafetyPlanActivityItemsToSectionSnapshots,\n resolveEntityRefId,\n resolveSectionItemEntityName,\n RootConfig,\n type AXMSafetyPlanActivitySectionSnapshot,\n type AXMSafetyPlanSectionBuilderValue,\n type AXMWorkplaceSafetyManagementSafetyPlanSectionItemModel,\n} from '@acorex-platform/module-workplacesafety-management-client/contracts';\nimport { AXTranslationService } from '@acorex/core/translation';\n\n//#endregion\n\n//#region ----- Public API -----\n\n/**\n * Loads each Activity catalog row's predefined `items` onto `activityRow.sections`\n * and fills missing catalog item titles for preview rendering.\n */\nexport async function hydrateSafetyPlanActivitySectionsForPreview(\n entityService: AXPEntityService,\n translationService: AXTranslationService,\n value: AXMSafetyPlanSectionBuilderValue,\n): Promise<AXMSafetyPlanSectionBuilderValue> {\n const activityIds = collectActivityIdsNeedingSections(value);\n if (activityIds.length === 0) {\n return value;\n }\n\n const loadedById = await loadSafetyPlanActivitiesById(entityService, activityIds);\n if (loadedById.size === 0) {\n return value;\n }\n\n const withSections: AXMSafetyPlanSectionBuilderValue = {\n sections: value.sections.map((section) => {\n if (!isActivitySectionType(section.sectionTypeId, section.sectionType)) {\n return section;\n }\n return {\n ...section,\n items: section.items.map((item) => {\n const activityId = resolveEntityRefId(item.id) ?? resolveEntityRefId(item.itemIds?.[0]);\n if (!activityId) {\n return item;\n }\n const loaded = loadedById.get(activityId);\n if (!loaded) {\n return item;\n }\n const existingRow = item.activityRow;\n return {\n ...item,\n activityRow: {\n ...existingRow,\n title: existingRow?.title || loaded.title,\n code: existingRow?.code || loaded.code,\n description: existingRow?.description || loaded.description,\n sections: loaded.sections,\n },\n };\n }),\n };\n }),\n };\n\n return hydrateNestedActivityCatalogSnapshots(entityService, translationService, withSections);\n}\n\n//#endregion\n\n//#region ----- Helpers -----\n\nfunction collectActivityIdsNeedingSections(value: AXMSafetyPlanSectionBuilderValue): string[] {\n const ids = new Set<string>();\n for (const section of value.sections) {\n if (!isActivitySectionType(section.sectionTypeId, section.sectionType)) {\n continue;\n }\n for (const item of section.items ?? []) {\n const hasSections = (item.activityRow?.sections?.length ?? 0) > 0;\n if (hasSections) {\n continue;\n }\n const activityId = resolveEntityRefId(item.id) ?? resolveEntityRefId(item.itemIds?.[0]);\n if (activityId) {\n ids.add(activityId);\n }\n }\n }\n return [...ids];\n}\n\nasync function loadSafetyPlanActivitiesById(\n entityService: AXPEntityService,\n activityIds: string[],\n): Promise<\n Map<\n string,\n {\n title?: string;\n code?: string;\n description?: string;\n sections: AXMSafetyPlanActivitySectionSnapshot[];\n }\n >\n> {\n const entityKey = `${RootConfig.module.name}.${RootConfig.entities.safetyPlanActivity.name}`;\n const loaded = new Map<\n string,\n {\n title?: string;\n code?: string;\n description?: string;\n sections: AXMSafetyPlanActivitySectionSnapshot[];\n }\n >();\n\n await Promise.all(\n activityIds.map(async (id) => {\n try {\n const row = await entityService.withEntity(entityKey).data().byKey(id);\n if (!row) {\n return;\n }\n const record = row as {\n title?: string;\n code?: string;\n description?: string;\n items?: AXMWorkplaceSafetyManagementSafetyPlanSectionItemModel[];\n };\n loaded.set(id, {\n title: typeof record.title === 'string' ? record.title : undefined,\n code: typeof record.code === 'string' ? record.code : undefined,\n description: typeof record.description === 'string' ? record.description : undefined,\n sections: mapSafetyPlanActivityItemsToSectionSnapshots(record.items),\n });\n } catch {\n /* skip activities the session cannot read */\n }\n }),\n );\n\n return loaded;\n}\n\nasync function hydrateNestedActivityCatalogSnapshots(\n entityService: AXPEntityService,\n translationService: AXTranslationService,\n value: AXMSafetyPlanSectionBuilderValue,\n): Promise<AXMSafetyPlanSectionBuilderValue> {\n const locale = translationService.getActiveLang?.() ?? 'en-US';\n const missingByEntity = new Map<string, Set<string>>();\n\n for (const section of value.sections) {\n if (!isActivitySectionType(section.sectionTypeId, section.sectionType)) {\n continue;\n }\n for (const item of section.items ?? []) {\n for (const activitySection of item.activityRow?.sections ?? []) {\n const entityName = resolveSectionItemEntityName(\n activitySection.sectionTypeId,\n activitySection.sectionType,\n );\n if (!entityName) {\n continue;\n }\n for (const id of activitySection.itemIds ?? []) {\n const snapshot = activitySection.items?.find((entry) => entry.id === id);\n if (asSafetyPlanDisplayText(snapshot?.title) || asSafetyPlanDisplayText(snapshot?.code)) {\n continue;\n }\n const ids = missingByEntity.get(entityName) ?? new Set<string>();\n ids.add(id);\n missingByEntity.set(entityName, ids);\n }\n }\n }\n }\n\n if (missingByEntity.size === 0) {\n return value;\n }\n\n const loadedById = new Map<string, { title?: string; code?: string }>();\n await Promise.all(\n [...missingByEntity.entries()].map(async ([entityName, ids]) => {\n const idList = [...ids];\n try {\n const result = await entityService.withEntity(entityName).data().query({\n skip: 0,\n take: Math.max(idList.length, 1),\n filter:\n idList.length === 1\n ? { field: 'id', operator: { type: 'equal' }, value: idList[0] }\n : { field: 'id', operator: { type: 'in' }, value: idList },\n } as never);\n for (const row of result.items ?? []) {\n const record = row as unknown as Record<string, unknown>;\n const id = resolveEntityRefId(record['id']);\n if (!id) {\n continue;\n }\n loadedById.set(id, {\n title: resolveEntityRowDisplayText(record['title'], locale) || undefined,\n code: asSafetyPlanDisplayText(record['code']) || undefined,\n });\n }\n } catch {\n /* skip entities the session cannot read */\n }\n }),\n );\n\n if (loadedById.size === 0) {\n return value;\n }\n\n return {\n sections: value.sections.map((section) => ({\n ...section,\n items: section.items.map((item) => {\n if (!item.activityRow?.sections?.length) {\n return item;\n }\n return {\n ...item,\n activityRow: {\n ...item.activityRow,\n sections: item.activityRow.sections.map((activitySection) => ({\n ...activitySection,\n items: (activitySection.itemIds ?? []).map((id, index) => {\n const existing =\n activitySection.items?.find((entry) => entry.id === id) ??\n activitySection.items?.[index];\n const loaded = loadedById.get(id);\n return {\n id,\n title: asSafetyPlanDisplayText(existing?.title) || loaded?.title,\n code: asSafetyPlanDisplayText(existing?.code) || loaded?.code,\n };\n }),\n })),\n },\n };\n }),\n })),\n };\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;AAAA;AAaA;AAEA;MAGa,2BAA2B,CAAA;AADxC,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC;AACrC,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,eAAe,CAAC;AACtC,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAiD1D,IAAA;;;IA3CC,MAAM,IAAI,CAAC,OAAwC,EAAA;QACjD,MAAM,iBAAiB,GAAG,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAAC;QAChE,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC;AAC/C,YAAA,IAAI,EAAE,MAAM,OAAO,6GAAuC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,kCAAkC,CAAC;AACvH,YAAA,IAAI,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE;AAC5D,YAAA,IAAI,EAAE,CAAC,S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,KAAI;gBAChC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE;AACvC,oBAAA,OAAO,IAAI;gBACb;gBACA,OAAO;AACL,oBAAA,GAAG,IAAI;AACP,oBAAA,WAAW,EAAE;wBACX,GAAG,IAAI,CAAC,WAAW;AACnB,wBAAA,QAAQ,EAAE,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,eAAe,MAAM;AAC5D,4BAAA,GAAG,eAAe;AAClB,4BAAA,KAAK,EAAE,CAAC,eAAe,CAAC,OAAO,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC,EAAE,EAAE,KAAK,KAAI;AACvD,gCAAA,MAAM,QAAQ,GACZ,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,EAAE,KAAK,EAAE,CAAC;AACvD,oCAAA,eAAe,CAAC,KAAK,GAAG,KAAK,CAAC;gCAChC,MAAM,MAAM,GAAG,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;gCACjC,OAAO;oCACL,EAAE;oCACF,KAAK,EAAE,uBAAuB,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,MAAM,EAAE,KAAK;oCAChE,IAAI,EAAE,uBAAuB,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,MAAM,EAAE,IAAI;iCAC9D;AACH,4BAAA,CAAC,CAAC;AACH,yBAAA,CAAC,CAAC;AACJ,qBAAA;iBACF;AACH,YAAA,CAAC,CAAC;AACH,SAAA,CAAC,CAAC;KACJ;AACH;AAEA;;"}
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-workplacesafety-management-client-hydrate-safety-plan-activity-sections-SFRvQ81J.mjs","sources":["../../../../libs/modules/workplacesafety-management/client/src/lib/features/safety-plan-preview/safety-plan-preview.service.ts","../../../../libs/modules/workplacesafety-management/client/src/lib/features/safety-plan-preview/hydrate-safety-plan-activity-sections.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport { Injectable, inject } from '@angular/core';\nimport { AXPopupService } from '@acorex/components/popup';\nimport { AXPDialogOpener } from '@acorex-platform/framework-client/core';\nimport { AXPDeviceService } from '@acorex-platform/framework-client/core';\n\nimport type {\n AXMSafetyPlanPreviewOpenOptions,\n AXMSafetyPlanPreviewResult,\n AXMSafetyPlanPreviewWorkflowActionSet,\n} from './safety-plan-preview.types';\n\n//#endregion\n\n//#region ----- Service -----\n\n@Injectable({ providedIn: 'root' })\nexport class AXMSafetyPlanPreviewService {\n //#region ----- Services & Dependencies -----\n\n private readonly popupService = inject(AXPopupService);\n private readonly dialogOpener = inject(AXPDialogOpener);\n private readonly deviceService = inject(AXPDeviceService);\n\n //#endregion\n\n //#region ----- Public API -----\n\n async open(options: AXMSafetyPlanPreviewOpenOptions): Promise<AXMSafetyPlanPreviewResult | null> {\n const workflowActionSet = this.resolveWorkflowActionSet(options);\n const result = await this.dialogOpener.openPopup({\n load: () => import('./safety-plan-preview-modal.component').then((module) => module.AXMSafetyPlanPreviewModalComponent),\n data: { planId: options.planId ?? '', title: options.title },\n show: (component) =>\n this.popupService.open(component, {\n title: options.title,\n size: this.deviceService.isSmall() ? 'full' : 'lg',\n data: {\n structure: options.structure,\n workflowActionSet,\n editable: options.editable === true,\n planId: options.planId,\n fillValues: options.fillValues ?? {},\n },\n }),\n });\n\n return (result?.data as AXMSafetyPlanPreviewResult | undefined) ?? null;\n }\n\n //#endregion\n\n //#region ----- Helpers -----\n\n private resolveWorkflowActionSet(\n options: AXMSafetyPlanPreviewOpenOptions,\n ): AXMSafetyPlanPreviewWorkflowActionSet | undefined {\n if (\n options.workflowActionSet === 'draft' ||\n options.workflowActionSet === 'assigned' ||\n options.workflowActionSet === 'locked'\n ) {\n return options.workflowActionSet;\n }\n if (options.showWorkflowActions === true) {\n return 'draft';\n }\n return undefined;\n }\n\n //#endregion\n}\n\n//#endregion\n\n","//#region ----- Imports -----\n\nimport { resolveEntityRowDisplayText } from '@acorex-platform/framework-client/common';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport {\n asSafetyPlanDisplayText,\n isActivitySectionType,\n mapSafetyPlanActivityItemsToSectionSnapshots,\n resolveEntityRefId,\n resolveSectionItemEntityName,\n RootConfig,\n type AXMSafetyPlanActivitySectionSnapshot,\n type AXMSafetyPlanSectionBuilderValue,\n type AXMWorkplaceSafetyManagementSafetyPlanSectionItemModel,\n} from '@acorex-platform/module-workplacesafety-management-client/contracts';\nimport { AXTranslationService } from '@acorex/core/translation';\n\n//#endregion\n\n//#region ----- Public API -----\n\n/**\n * Loads each Activity catalog row's predefined `items` onto `activityRow.sections`\n * and fills missing catalog item titles for preview rendering.\n */\nexport async function hydrateSafetyPlanActivitySectionsForPreview(\n entityService: AXPEntityService,\n translationService: AXTranslationService,\n value: AXMSafetyPlanSectionBuilderValue,\n): Promise<AXMSafetyPlanSectionBuilderValue> {\n const activityIds = collectActivityIdsNeedingSections(value);\n if (activityIds.length === 0) {\n return value;\n }\n\n const loadedById = await loadSafetyPlanActivitiesById(entityService, activityIds);\n if (loadedById.size === 0) {\n return value;\n }\n\n const withSections: AXMSafetyPlanSectionBuilderValue = {\n sections: value.sections.map((section) => {\n if (!isActivitySectionType(section.sectionTypeId, section.sectionType)) {\n return section;\n }\n return {\n ...section,\n items: section.items.map((item) => {\n const activityId = resolveEntityRefId(item.id) ?? resolveEntityRefId(item.itemIds?.[0]);\n if (!activityId) {\n return item;\n }\n const loaded = loadedById.get(activityId);\n if (!loaded) {\n return item;\n }\n const existingRow = item.activityRow;\n return {\n ...item,\n activityRow: {\n ...existingRow,\n title: existingRow?.title || loaded.title,\n code: existingRow?.code || loaded.code,\n description: existingRow?.description || loaded.description,\n sections: loaded.sections,\n },\n };\n }),\n };\n }),\n };\n\n return hydrateNestedActivityCatalogSnapshots(entityService, translationService, withSections);\n}\n\n//#endregion\n\n//#region ----- Helpers -----\n\nfunction collectActivityIdsNeedingSections(value: AXMSafetyPlanSectionBuilderValue): string[] {\n const ids = new Set<string>();\n for (const section of value.sections) {\n if (!isActivitySectionType(section.sectionTypeId, section.sectionType)) {\n continue;\n }\n for (const item of section.items ?? []) {\n const hasSections = (item.activityRow?.sections?.length ?? 0) > 0;\n if (hasSections) {\n continue;\n }\n const activityId = resolveEntityRefId(item.id) ?? resolveEntityRefId(item.itemIds?.[0]);\n if (activityId) {\n ids.add(activityId);\n }\n }\n }\n return [...ids];\n}\n\nasync function loadSafetyPlanActivitiesById(\n entityService: AXPEntityService,\n activityIds: string[],\n): Promise<\n Map<\n string,\n {\n title?: string;\n code?: string;\n description?: string;\n sections: AXMSafetyPlanActivitySectionSnapshot[];\n }\n >\n> {\n const entityKey = `${RootConfig.module.name}.${RootConfig.entities.safetyPlanActivity.name}`;\n const loaded = new Map<\n string,\n {\n title?: string;\n code?: string;\n description?: string;\n sections: AXMSafetyPlanActivitySectionSnapshot[];\n }\n >();\n\n await Promise.all(\n activityIds.map(async (id) => {\n try {\n const row = await entityService.withEntity(entityKey).data().byKey(id);\n if (!row) {\n return;\n }\n const record = row as {\n title?: string;\n code?: string;\n description?: string;\n items?: AXMWorkplaceSafetyManagementSafetyPlanSectionItemModel[];\n };\n loaded.set(id, {\n title: typeof record.title === 'string' ? record.title : undefined,\n code: typeof record.code === 'string' ? record.code : undefined,\n description: typeof record.description === 'string' ? record.description : undefined,\n sections: mapSafetyPlanActivityItemsToSectionSnapshots(record.items),\n });\n } catch {\n /* skip activities the session cannot read */\n }\n }),\n );\n\n return loaded;\n}\n\nasync function hydrateNestedActivityCatalogSnapshots(\n entityService: AXPEntityService,\n translationService: AXTranslationService,\n value: AXMSafetyPlanSectionBuilderValue,\n): Promise<AXMSafetyPlanSectionBuilderValue> {\n const locale = translationService.getActiveLang?.() ?? 'en-US';\n const missingByEntity = new Map<string, Set<string>>();\n\n for (const section of value.sections) {\n if (!isActivitySectionType(section.sectionTypeId, section.sectionType)) {\n continue;\n }\n for (const item of section.items ?? []) {\n for (const activitySection of item.activityRow?.sections ?? []) {\n const entityName = resolveSectionItemEntityName(\n activitySection.sectionTypeId,\n activitySection.sectionType,\n );\n if (!entityName) {\n continue;\n }\n for (const id of activitySection.itemIds ?? []) {\n const snapshot = activitySection.items?.find((entry) => entry.id === id);\n if (asSafetyPlanDisplayText(snapshot?.title) || asSafetyPlanDisplayText(snapshot?.code)) {\n continue;\n }\n const ids = missingByEntity.get(entityName) ?? new Set<string>();\n ids.add(id);\n missingByEntity.set(entityName, ids);\n }\n }\n }\n }\n\n if (missingByEntity.size === 0) {\n return value;\n }\n\n const loadedById = new Map<string, { title?: string; code?: string }>();\n await Promise.all(\n [...missingByEntity.entries()].map(async ([entityName, ids]) => {\n const idList = [...ids];\n try {\n const result = await entityService.withEntity(entityName).data().query({\n skip: 0,\n take: Math.max(idList.length, 1),\n filter:\n idList.length === 1\n ? { field: 'id', operator: { type: 'equal' }, value: idList[0] }\n : { field: 'id', operator: { type: 'in' }, value: idList },\n } as never);\n for (const row of result.items ?? []) {\n const record = row as unknown as Record<string, unknown>;\n const id = resolveEntityRefId(record['id']);\n if (!id) {\n continue;\n }\n loadedById.set(id, {\n title: resolveEntityRowDisplayText(record['title'], locale) || undefined,\n code: asSafetyPlanDisplayText(record['code']) || undefined,\n });\n }\n } catch {\n /* skip entities the session cannot read */\n }\n }),\n );\n\n if (loadedById.size === 0) {\n return value;\n }\n\n return {\n sections: value.sections.map((section) => ({\n ...section,\n items: section.items.map((item) => {\n if (!item.activityRow?.sections?.length) {\n return item;\n }\n return {\n ...item,\n activityRow: {\n ...item.activityRow,\n sections: item.activityRow.sections.map((activitySection) => ({\n ...activitySection,\n items: (activitySection.itemIds ?? []).map((id, index) => {\n const existing =\n activitySection.items?.find((entry) => entry.id === id) ??\n activitySection.items?.[index];\n const loaded = loadedById.get(id);\n return {\n id,\n title: asSafetyPlanDisplayText(existing?.title) || loaded?.title,\n code: asSafetyPlanDisplayText(existing?.code) || loaded?.code,\n };\n }),\n })),\n },\n };\n }),\n })),\n };\n}\n\n//#endregion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,KAAK,CAAC,EAAE,KAAK,EAAE,CAAC;AACvD,oCAAA,eAAe,CAAC,KAAK,GAAG,KAAK,CAAC;gCAChC,MAAM,MAAM,GAAG,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;gCACjC,OAAO;oCACL,EAAE;oCACF,KAAK,EAAE,uBAAuB,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,MAAM,EAAE,KAAK;oCAChE,IAAI,EAAE,uBAAuB,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,MAAM,EAAE,IAAI;iCAC9D;AACH,4BAAA,CAAC,CAAC;AACH,yBAAA,CAAC,CAAC;AACJ,qBAAA;iBACF;AACH,YAAA,CAAC,CAAC;AACH,SAAA,CAAC,CAAC;KACJ;AACH;AAEA;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { resolveEntityRowDisplayText } from '@acorex-platform/framework-client/common';
|
|
2
2
|
import { RootConfig, dedupeSafetyPlanSectionStructure, collectBuiltInRepeatableSectionTypeIds, resolveEntityRefId, isActivitySectionType, resolveSectionItemEntityName, asSafetyPlanDisplayText } from '@acorex-platform/module-workplacesafety-management-client/contracts';
|
|
3
|
-
import { s as safetyPlanSectionsToBuilderValue } from './acorex-platform-module-workplacesafety-management-client-safety-plan-section-builder.types-
|
|
4
|
-
import { h as hydrateSafetyPlanActivitySectionsForPreview } from './acorex-platform-module-workplacesafety-management-client-hydrate-safety-plan-activity-sections-
|
|
3
|
+
import { s as safetyPlanSectionsToBuilderValue } from './acorex-platform-module-workplacesafety-management-client-safety-plan-section-builder.types-DQX6nPWP.mjs';
|
|
4
|
+
import { h as hydrateSafetyPlanActivitySectionsForPreview } from './acorex-platform-module-workplacesafety-management-client-hydrate-safety-plan-activity-sections-SFRvQ81J.mjs';
|
|
5
5
|
|
|
6
6
|
//#region ----- Imports -----
|
|
7
7
|
//#endregion
|
|
@@ -133,4 +133,4 @@ async function hydrateCatalogItemSnapshots(entityService, translationService, va
|
|
|
133
133
|
//#endregion
|
|
134
134
|
|
|
135
135
|
export { loadSafetyPlanPreviewStructure as l };
|
|
136
|
-
//# sourceMappingURL=acorex-platform-module-workplacesafety-management-client-load-safety-plan-preview-structure-
|
|
136
|
+
//# sourceMappingURL=acorex-platform-module-workplacesafety-management-client-load-safety-plan-preview-structure-072LSKo7.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-workplacesafety-management-client-load-safety-plan-preview-structure-DA9w-vaB.mjs","sources":["../../../../libs/modules/workplacesafety-management/client/src/lib/features/safety-plan/commands/load-safety-plan-preview-structure.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport { resolveEntityRowDisplayText } from '@acorex-platform/framework-client/common';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport {\n asSafetyPlanDisplayText,\n collectBuiltInRepeatableSectionTypeIds,\n dedupeSafetyPlanSectionStructure,\n isActivitySectionType,\n resolveEntityRefId,\n resolveSectionItemEntityName,\n RootConfig,\n type AXMSafetyPlanSectionBuilderValue,\n} from '@acorex-platform/module-workplacesafety-management-client/contracts';\nimport { AXTranslationService } from '@acorex/core/translation';\n\nimport { safetyPlanSectionsToBuilderValue } from '../../safety-plan-sections-page/safety-plan-section-builder.types';\nimport { hydrateSafetyPlanActivitySectionsForPreview } from '../../safety-plan-preview/hydrate-safety-plan-activity-sections';\n\n//#endregion\n\n//#region ----- Constants -----\n\nconst SAFETY_PLAN_SECTION_ENTITY = `${RootConfig.module.name}.${RootConfig.entities.safetyPlanSection.name}`;\nconst SECTION_TYPE_ENTITY = `${RootConfig.module.name}.${RootConfig.entities.sectionType.name}`;\n\n//#endregion\n\n//#region ----- Public API -----\n\n/**\n * Loads a safety plan's section structure for the existing preview modal\n * (same shape the sections page feeds into AXMSafetyPlanPreviewService).\n */\nexport async function loadSafetyPlanPreviewStructure(\n entityService: AXPEntityService,\n translationService: AXTranslationService,\n planId: string,\n): Promise<AXMSafetyPlanSectionBuilderValue> {\n const editable = await loadSafetyPlanEditableStructure(entityService, translationService, planId);\n // Activity sections reference SafetyPlanActivity; hydrate nested section items for preview.\n return hydrateSafetyPlanActivitySectionsForPreview(entityService, translationService, editable);\n}\n\n/**\n * Loads section structure for editing (Fill / sections page shape).\n * Skips preview-only activity hydration so the builder can persist cleanly.\n */\nexport async function loadSafetyPlanEditableStructure(\n entityService: AXPEntityService,\n translationService: AXTranslationService,\n planId: string,\n): Promise<AXMSafetyPlanSectionBuilderValue> {\n const repeatableSectionTypeIds = await loadRepeatableSectionTypeIds(entityService);\n\n const result = await entityService.withEntity(SAFETY_PLAN_SECTION_ENTITY).data().query({\n skip: 0,\n take: 1000,\n filter: {\n logic: 'and',\n filters: [{ field: 'safetyPlanId', operator: { type: 'equal' }, value: planId }],\n },\n } as never);\n\n const rawLoaded = safetyPlanSectionsToBuilderValue(\n (result.items ?? []) as Parameters<typeof safetyPlanSectionsToBuilderValue>[0],\n );\n const deduped = dedupeSafetyPlanSectionStructure(rawLoaded, { repeatableSectionTypeIds });\n return hydrateCatalogItemSnapshots(entityService, translationService, deduped);\n}\n\n//#endregion\n\n//#region ----- Helpers -----\n\nasync function loadRepeatableSectionTypeIds(entityService: AXPEntityService): Promise<string[]> {\n const builtIn = collectBuiltInRepeatableSectionTypeIds();\n try {\n const result = await entityService.withEntity(SECTION_TYPE_ENTITY).data().query({\n skip: 0,\n take: 1000,\n } as never);\n const fromQuery = (result.items ?? [])\n .filter((row) => (row as { isRepeatable?: unknown }).isRepeatable === true)\n .map((row) => resolveEntityRefId((row as { id?: unknown }).id))\n .filter((id): id is string => !!id);\n return [...new Set([...fromQuery, ...builtIn])];\n } catch {\n return builtIn;\n }\n}\n\nasync function hydrateCatalogItemSnapshots(\n entityService: AXPEntityService,\n translationService: AXTranslationService,\n value: AXMSafetyPlanSectionBuilderValue,\n): Promise<AXMSafetyPlanSectionBuilderValue> {\n const locale = translationService.getActiveLang?.() ?? 'en-US';\n const missingByEntity = new Map<string, Set<string>>();\n\n for (const section of value.sections) {\n if (isActivitySectionType(section.sectionTypeId, section.sectionType)) {\n continue;\n }\n const entityName = resolveSectionItemEntityName(section.sectionTypeId, section.sectionType);\n if (!entityName) {\n continue;\n }\n for (const slot of section.items) {\n for (const id of slot.itemIds ?? []) {\n const snapshot = slot.items?.find((entry) => entry.id === id);\n if (asSafetyPlanDisplayText(snapshot?.title) || asSafetyPlanDisplayText(snapshot?.code)) {\n continue;\n }\n const ids = missingByEntity.get(entityName) ?? new Set<string>();\n ids.add(id);\n missingByEntity.set(entityName, ids);\n }\n }\n }\n\n if (missingByEntity.size === 0) {\n return value;\n }\n\n const loadedById = new Map<string, { title?: string; code?: string }>();\n await Promise.all(\n [...missingByEntity.entries()].map(async ([entityName, ids]) => {\n const idList = [...ids];\n try {\n const result = await entityService.withEntity(entityName).data().query({\n skip: 0,\n take: Math.max(idList.length, 1),\n filter:\n idList.length === 1\n ? { field: 'id', operator: { type: 'equal' }, value: idList[0] }\n : { field: 'id', operator: { type: 'in' }, value: idList },\n } as never);\n for (const row of result.items ?? []) {\n const record = row as unknown as Record<string, unknown>;\n const id = resolveEntityRefId(record['id']);\n if (!id) {\n continue;\n }\n loadedById.set(id, {\n title: resolveEntityRowDisplayText(record['title'], locale) || undefined,\n code: asSafetyPlanDisplayText(record['code']) || undefined,\n });\n }\n } catch {\n /* skip entities the session cannot read */\n }\n }),\n );\n\n if (loadedById.size === 0) {\n return value;\n }\n\n return {\n sections: value.sections.map((section) => ({\n ...section,\n items: section.items.map((slot) => ({\n ...slot,\n items: (slot.itemIds ?? []).map((id, index) => {\n const existing = slot.items?.find((entry) => entry.id === id) ?? slot.items?.[index];\n const loaded = loadedById.get(id);\n return {\n id,\n title: asSafetyPlanDisplayText(existing?.title) || loaded?.title,\n code: asSafetyPlanDisplayText(existing?.code) || loaded?.code,\n };\n }),\n })),\n })),\n };\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;AAAA;AAmBA;AAEA;AAEA,MAAM,0BAA0B,GAAG,CAAA,EAA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AAE,CAAC,IAAI,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;oBACpF,MAAM,MAAM,GAAG,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;oBACjC,OAAO;wBACL,EAAE;wBACF,KAAK,EAAE,uBAAuB,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,MAAM,EAAE,KAAK;wBAChE,IAAI,EAAE,uBAAuB,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,MAAM,EAAE,IAAI;qBAC9D;AACH,gBAAA,CAAC,CAAC;AACH,aAAA,CAAC,CAAC;AACJ,SAAA,CAAC,CAAC;KACJ;AACH;AAEA;;"}
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-workplacesafety-management-client-load-safety-plan-preview-structure-072LSKo7.mjs","sources":["../../../../libs/modules/workplacesafety-management/client/src/lib/features/safety-plan/commands/load-safety-plan-preview-structure.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport { resolveEntityRowDisplayText } from '@acorex-platform/framework-client/common';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport {\n asSafetyPlanDisplayText,\n collectBuiltInRepeatableSectionTypeIds,\n dedupeSafetyPlanSectionStructure,\n isActivitySectionType,\n resolveEntityRefId,\n resolveSectionItemEntityName,\n RootConfig,\n type AXMSafetyPlanSectionBuilderValue,\n} from '@acorex-platform/module-workplacesafety-management-client/contracts';\nimport { AXTranslationService } from '@acorex/core/translation';\n\nimport { safetyPlanSectionsToBuilderValue } from '../../safety-plan-sections-page/safety-plan-section-builder.types';\nimport { hydrateSafetyPlanActivitySectionsForPreview } from '../../safety-plan-preview/hydrate-safety-plan-activity-sections';\n\n//#endregion\n\n//#region ----- Constants -----\n\nconst SAFETY_PLAN_SECTION_ENTITY = `${RootConfig.module.name}.${RootConfig.entities.safetyPlanSection.name}`;\nconst SECTION_TYPE_ENTITY = `${RootConfig.module.name}.${RootConfig.entities.sectionType.name}`;\n\n//#endregion\n\n//#region ----- Public API -----\n\n/**\n * Loads a safety plan's section structure for the existing preview modal\n * (same shape the sections page feeds into AXMSafetyPlanPreviewService).\n */\nexport async function loadSafetyPlanPreviewStructure(\n entityService: AXPEntityService,\n translationService: AXTranslationService,\n planId: string,\n): Promise<AXMSafetyPlanSectionBuilderValue> {\n const editable = await loadSafetyPlanEditableStructure(entityService, translationService, planId);\n // Activity sections reference SafetyPlanActivity; hydrate nested section items for preview.\n return hydrateSafetyPlanActivitySectionsForPreview(entityService, translationService, editable);\n}\n\n/**\n * Loads section structure for editing (Fill / sections page shape).\n * Skips preview-only activity hydration so the builder can persist cleanly.\n */\nexport async function loadSafetyPlanEditableStructure(\n entityService: AXPEntityService,\n translationService: AXTranslationService,\n planId: string,\n): Promise<AXMSafetyPlanSectionBuilderValue> {\n const repeatableSectionTypeIds = await loadRepeatableSectionTypeIds(entityService);\n\n const result = await entityService.withEntity(SAFETY_PLAN_SECTION_ENTITY).data().query({\n skip: 0,\n take: 1000,\n filter: {\n logic: 'and',\n filters: [{ field: 'safetyPlanId', operator: { type: 'equal' }, value: planId }],\n },\n } as never);\n\n const rawLoaded = safetyPlanSectionsToBuilderValue(\n (result.items ?? []) as Parameters<typeof safetyPlanSectionsToBuilderValue>[0],\n );\n const deduped = dedupeSafetyPlanSectionStructure(rawLoaded, { repeatableSectionTypeIds });\n return hydrateCatalogItemSnapshots(entityService, translationService, deduped);\n}\n\n//#endregion\n\n//#region ----- Helpers -----\n\nasync function loadRepeatableSectionTypeIds(entityService: AXPEntityService): Promise<string[]> {\n const builtIn = collectBuiltInRepeatableSectionTypeIds();\n try {\n const result = await entityService.withEntity(SECTION_TYPE_ENTITY).data().query({\n skip: 0,\n take: 1000,\n } as never);\n const fromQuery = (result.items ?? [])\n .filter((row) => (row as { isRepeatable?: unknown }).isRepeatable === true)\n .map((row) => resolveEntityRefId((row as { id?: unknown }).id))\n .filter((id): id is string => !!id);\n return [...new Set([...fromQuery, ...builtIn])];\n } catch {\n return builtIn;\n }\n}\n\nasync function hydrateCatalogItemSnapshots(\n entityService: AXPEntityService,\n translationService: AXTranslationService,\n value: AXMSafetyPlanSectionBuilderValue,\n): Promise<AXMSafetyPlanSectionBuilderValue> {\n const locale = translationService.getActiveLang?.() ?? 'en-US';\n const missingByEntity = new Map<string, Set<string>>();\n\n for (const section of value.sections) {\n if (isActivitySectionType(section.sectionTypeId, section.sectionType)) {\n continue;\n }\n const entityName = resolveSectionItemEntityName(section.sectionTypeId, section.sectionType);\n if (!entityName) {\n continue;\n }\n for (const slot of section.items) {\n for (const id of slot.itemIds ?? []) {\n const snapshot = slot.items?.find((entry) => entry.id === id);\n if (asSafetyPlanDisplayText(snapshot?.title) || asSafetyPlanDisplayText(snapshot?.code)) {\n continue;\n }\n const ids = missingByEntity.get(entityName) ?? new Set<string>();\n ids.add(id);\n missingByEntity.set(entityName, ids);\n }\n }\n }\n\n if (missingByEntity.size === 0) {\n return value;\n }\n\n const loadedById = new Map<string, { title?: string; code?: string }>();\n await Promise.all(\n [...missingByEntity.entries()].map(async ([entityName, ids]) => {\n const idList = [...ids];\n try {\n const result = await entityService.withEntity(entityName).data().query({\n skip: 0,\n take: Math.max(idList.length, 1),\n filter:\n idList.length === 1\n ? { field: 'id', operator: { type: 'equal' }, value: idList[0] }\n : { field: 'id', operator: { type: 'in' }, value: idList },\n } as never);\n for (const row of result.items ?? []) {\n const record = row as unknown as Record<string, unknown>;\n const id = resolveEntityRefId(record['id']);\n if (!id) {\n continue;\n }\n loadedById.set(id, {\n title: resolveEntityRowDisplayText(record['title'], locale) || undefined,\n code: asSafetyPlanDisplayText(record['code']) || undefined,\n });\n }\n } catch {\n /* skip entities the session cannot read */\n }\n }),\n );\n\n if (loadedById.size === 0) {\n return value;\n }\n\n return {\n sections: value.sections.map((section) => ({\n ...section,\n items: section.items.map((slot) => ({\n ...slot,\n items: (slot.itemIds ?? []).map((id, index) => {\n const existing = slot.items?.find((entry) => entry.id === id) ?? slot.items?.[index];\n const loaded = loadedById.get(id);\n return {\n id,\n title: asSafetyPl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AAC,OAAO,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC,EAAE,EAAE,KAAK,KAAI;oBAC5C,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,EAAE,KAAK,EAAE,CAAC,IAAI,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;oBACpF,MAAM,MAAM,GAAG,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;oBACjC,OAAO;wBACL,EAAE;wBACF,KAAK,EAAE,uBAAuB,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,MAAM,EAAE,KAAK;wBAChE,IAAI,EAAE,uBAAuB,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,MAAM,EAAE,IAAI;qBAC9D;AACH,gBAAA,CAAC,CAAC;AACH,aAAA,CAAC,CAAC;AACJ,SAAA,CAAC,CAAC;KACJ;AACH;AAEA;;"}
|
|
@@ -3,7 +3,7 @@ import { AXDecoratorModule } from '@acorex/components/decorators';
|
|
|
3
3
|
import { AXPColumnWidgetComponent } from '@acorex-platform/framework-client/layout/widget-core';
|
|
4
4
|
import * as i0 from '@angular/core';
|
|
5
5
|
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
6
|
-
import { e as extractPpeItemIds } from './acorex-platform-module-workplacesafety-management-client-ppe-item-viewer.util-
|
|
6
|
+
import { e as extractPpeItemIds } from './acorex-platform-module-workplacesafety-management-client-ppe-item-viewer.util-BTR9I8Te.mjs';
|
|
7
7
|
|
|
8
8
|
//#region ----- Imports -----
|
|
9
9
|
//#endregion
|
|
@@ -39,4 +39,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
39
39
|
}] });
|
|
40
40
|
|
|
41
41
|
export { AXMPpeItemViewerWidgetColumnComponent };
|
|
42
|
-
//# sourceMappingURL=acorex-platform-module-workplacesafety-management-client-ppe-item-viewer-widget-column.component-
|
|
42
|
+
//# sourceMappingURL=acorex-platform-module-workplacesafety-management-client-ppe-item-viewer-widget-column.component-D4bhgV8u.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-workplacesafety-management-client-ppe-item-viewer-widget-column.component-
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-workplacesafety-management-client-ppe-item-viewer-widget-column.component-D4bhgV8u.mjs","sources":["../../../../libs/modules/workplacesafety-management/client/src/lib/features/ppe-item-viewer/ppe-item-viewer-widget-column.component.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport { AXPColumnWidgetComponent } from '@acorex-platform/framework-client/layout/widget-core';\nimport { ChangeDetectionStrategy, Component } from '@angular/core';\n\nimport { extractPpeItemIds } from './ppe-item-viewer.util';\n\n//#endregion\n\n//#region ----- Component -----\n\n@Component({\n selector: 'axm-ppe-item-viewer-widget-column',\n template: `\n @if (selectedCount > 0) {\n <ax-icon class=\"fa-solid fa-check text-success\"></ax-icon>\n } @else {\n <span>---</span>\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [AXDecoratorModule],\n inputs: ['rawValue', 'rowData'],\n})\nexport class AXMPpeItemViewerWidgetColumnComponent extends AXPColumnWidgetComponent<unknown> {\n protected get selectedCount(): number {\n return extractPpeItemIds(this.rawValue).length;\n }\n}\n\n//#endregion\n"],"names":["i1"],"mappings":";;;;;;;AAAA;AAQA;AAEA;AAeM,MAAO,qCAAsC,SAAQ,wBAAiC,CAAA;AAC1F,IAAA,IAAc,aAAa,GAAA;QACzB,OAAO,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM;IAChD;8GAHW,qCAAqC,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAArC,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,qCAAqC,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,mCAAA,EAAA,MAAA,EAAA,EAAA,QAAA,EAAA,UAAA,EAAA,OAAA,EAAA,SAAA,EAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAXtC;;;;;;AAMT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAES,iBAAiB,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAAA,EAAA,CAAA,wBAAA,EAAA,QAAA,EAAA,SAAA,EAAA,MAAA,EAAA,CAAA,MAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAGhB,qCAAqC,EAAA,UAAA,EAAA,CAAA;kBAbjD,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,mCAAmC;AAC7C,oBAAA,QAAQ,EAAE;;;;;;AAMT,EAAA,CAAA;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,OAAO,EAAE,CAAC,iBAAiB,CAAC;AAC5B,oBAAA,MAAM,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC;AAChC,iBAAA;;;"}
|
|
@@ -6,8 +6,8 @@ import { AXValidationModule } from '@acorex/core/validation';
|
|
|
6
6
|
import { AXPValueWidgetComponent } from '@acorex-platform/framework-client/layout/widget-core';
|
|
7
7
|
import * as i0 from '@angular/core';
|
|
8
8
|
import { inject, signal, computed, effect, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
|
|
9
|
-
import { A as AXMPpeItemViewerService, a as AXMPpeItemViewerComponent } from './acorex-platform-module-workplacesafety-management-client-ppe-item-viewer.service-
|
|
10
|
-
import { r as resolvePpeItemViewerLayout, e as extractPpeItemIds } from './acorex-platform-module-workplacesafety-management-client-ppe-item-viewer.util-
|
|
9
|
+
import { A as AXMPpeItemViewerService, a as AXMPpeItemViewerComponent } from './acorex-platform-module-workplacesafety-management-client-ppe-item-viewer.service-B_TuM6zB.mjs';
|
|
10
|
+
import { r as resolvePpeItemViewerLayout, e as extractPpeItemIds } from './acorex-platform-module-workplacesafety-management-client-ppe-item-viewer.util-BTR9I8Te.mjs';
|
|
11
11
|
|
|
12
12
|
//#region ----- Imports -----
|
|
13
13
|
//#endregion
|
|
@@ -88,14 +88,14 @@ class AXMPpeItemViewerWidgetEditComponent extends AXPValueWidgetComponent {
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMPpeItemViewerWidgetEditComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
91
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXMPpeItemViewerWidgetEditComponent, isStandalone: true, selector: "axm-ppe-item-viewer-widget-edit", host: { classAttribute: "axm-ppe-item-viewer-widget block w-full" }, usesInheritance: true, ngImport: i0, template: "<ax-form-field class=\"flex flex-col gap-1 w-full\">\n @if (fieldLabel()) {\n <!-- ----- Optional field label when the host does not already wrap the widget ----- -->\n <ax-label class=\"font-semibold text-sm\" [required]=\"hasRequiredValidation()\">{{ fieldLabel() }}</ax-label>\n }\n <axm-ppe-item-viewer\n [items]=\"items()\"\n [layout]=\"layout()\"\n [selectedIds]=\"selectedIds()\"\n [loading]=\"loading()\"\n [disabled]=\"disabled()\"\n [readonly]=\"isReadonly()\"\n (selectedIdsChange)=\"onSelectedIdsChange($event)\"\n />\n @for (validation of validationRules(); track $index) {\n <ax-validation-rule\n [rule]=\"validation.rule\"\n [message]=\"$safeNavigationMigration(validation.options?.message)\"\n [options]=\"validation.options\"\n
|
|
91
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXMPpeItemViewerWidgetEditComponent, isStandalone: true, selector: "axm-ppe-item-viewer-widget-edit", host: { classAttribute: "axm-ppe-item-viewer-widget block w-full" }, usesInheritance: true, ngImport: i0, template: "<ax-form-field class=\"flex flex-col gap-1 w-full\">\n @if (fieldLabel()) {\n <!-- ----- Optional field label when the host does not already wrap the widget ----- -->\n <ax-label class=\"font-semibold text-sm\" [required]=\"hasRequiredValidation()\">{{ fieldLabel() }}</ax-label>\n }\n <axm-ppe-item-viewer\n [items]=\"items()\"\n [layout]=\"layout()\"\n [selectedIds]=\"selectedIds()\"\n [loading]=\"loading()\"\n [disabled]=\"disabled()\"\n [readonly]=\"isReadonly()\"\n (selectedIdsChange)=\"onSelectedIdsChange($event)\"\n />\n @for (validation of validationRules(); track $index) {\n <ax-validation-rule\n [rule]=\"validation.rule\"\n [message]=\"$safeNavigationMigration(validation.options?.message)\"\n [options]=\"validation.options\"\n [disabled]=\"validation.disabled === true\"></ax-validation-rule>\n }\n</ax-form-field>\n", styles: [".axm-ppe-item-viewer-widget{width:100%}\n/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "ngmodule", type: AXFormModule }, { kind: "component", type: i1.AXFormFieldComponent, selector: "ax-form-field", inputs: ["labelMode"] }, { kind: "directive", type: i1.AXValidationRuleDirective, selector: "ax-validation-rule", inputs: ["rule", "options", "message", "disabled"] }, { kind: "ngmodule", type: AXLabelModule }, { kind: "component", type: i2.AXLabelComponent, selector: "ax-label", inputs: ["required", "for"], outputs: ["requiredChange"] }, { kind: "ngmodule", type: AXValidationModule }, { kind: "component", type: AXMPpeItemViewerComponent, selector: "axm-ppe-item-viewer", inputs: ["items", "layout", "selectedIds", "loading", "disabled", "readonly", "showControl"], outputs: ["selectedIdsChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
92
92
|
}
|
|
93
93
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMPpeItemViewerWidgetEditComponent, decorators: [{
|
|
94
94
|
type: Component,
|
|
95
95
|
args: [{ selector: 'axm-ppe-item-viewer-widget-edit', host: {
|
|
96
96
|
class: 'axm-ppe-item-viewer-widget block w-full',
|
|
97
|
-
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [AXFormModule, AXLabelModule, AXValidationModule, AXMPpeItemViewerComponent], template: "<ax-form-field class=\"flex flex-col gap-1 w-full\">\n @if (fieldLabel()) {\n <!-- ----- Optional field label when the host does not already wrap the widget ----- -->\n <ax-label class=\"font-semibold text-sm\" [required]=\"hasRequiredValidation()\">{{ fieldLabel() }}</ax-label>\n }\n <axm-ppe-item-viewer\n [items]=\"items()\"\n [layout]=\"layout()\"\n [selectedIds]=\"selectedIds()\"\n [loading]=\"loading()\"\n [disabled]=\"disabled()\"\n [readonly]=\"isReadonly()\"\n (selectedIdsChange)=\"onSelectedIdsChange($event)\"\n />\n @for (validation of validationRules(); track $index) {\n <ax-validation-rule\n [rule]=\"validation.rule\"\n [message]=\"$safeNavigationMigration(validation.options?.message)\"\n [options]=\"validation.options\"\n
|
|
97
|
+
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [AXFormModule, AXLabelModule, AXValidationModule, AXMPpeItemViewerComponent], template: "<ax-form-field class=\"flex flex-col gap-1 w-full\">\n @if (fieldLabel()) {\n <!-- ----- Optional field label when the host does not already wrap the widget ----- -->\n <ax-label class=\"font-semibold text-sm\" [required]=\"hasRequiredValidation()\">{{ fieldLabel() }}</ax-label>\n }\n <axm-ppe-item-viewer\n [items]=\"items()\"\n [layout]=\"layout()\"\n [selectedIds]=\"selectedIds()\"\n [loading]=\"loading()\"\n [disabled]=\"disabled()\"\n [readonly]=\"isReadonly()\"\n (selectedIdsChange)=\"onSelectedIdsChange($event)\"\n />\n @for (validation of validationRules(); track $index) {\n <ax-validation-rule\n [rule]=\"validation.rule\"\n [message]=\"$safeNavigationMigration(validation.options?.message)\"\n [options]=\"validation.options\"\n [disabled]=\"validation.disabled === true\"></ax-validation-rule>\n }\n</ax-form-field>\n", styles: [".axm-ppe-item-viewer-widget{width:100%}\n/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */\n"] }]
|
|
98
98
|
}] });
|
|
99
99
|
|
|
100
100
|
export { AXMPpeItemViewerWidgetEditComponent };
|
|
101
|
-
//# sourceMappingURL=acorex-platform-module-workplacesafety-management-client-ppe-item-viewer-widget-edit.component-
|
|
101
|
+
//# sourceMappingURL=acorex-platform-module-workplacesafety-management-client-ppe-item-viewer-widget-edit.component-CUwa70wq.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-workplacesafety-management-client-ppe-item-viewer-widget-edit.component-
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-workplacesafety-management-client-ppe-item-viewer-widget-edit.component-CUwa70wq.mjs","sources":["../../../../libs/modules/workplacesafety-management/client/src/lib/features/ppe-item-viewer/ppe-item-viewer-widget-edit.component.ts","../../../../libs/modules/workplacesafety-management/client/src/lib/features/ppe-item-viewer/ppe-item-viewer-widget-edit.component.html"],"sourcesContent":["//#region ----- Imports -----\n\nimport { AXFormModule } from '@acorex/components/form';\nimport { AXLabelModule } from '@acorex/components/label';\nimport { AXValidationModule } from '@acorex/core/validation';\nimport { AXPValueWidgetComponent } from '@acorex-platform/framework-client/layout/widget-core';\nimport { ChangeDetectionStrategy, Component, computed, effect, inject, signal, ViewEncapsulation } from '@angular/core';\n\nimport { AXMPpeItemViewerComponent } from './ppe-item-viewer.component';\nimport type { AXMPpeItemViewerDisplayItem, AXMPpeItemViewerLayout, AXMPpeItemViewerWidgetOptions } from './ppe-item-viewer.types';\nimport { AXMPpeItemViewerService } from './ppe-item-viewer.service';\nimport { extractPpeItemIds, resolvePpeItemViewerLayout } from './ppe-item-viewer.util';\n\n//#endregion\n\n//#region ----- Component -----\n\n@Component({\n selector: 'axm-ppe-item-viewer-widget-edit',\n templateUrl: './ppe-item-viewer-widget-edit.component.html',\n styleUrl: './ppe-item-viewer-widget-edit.component.css',\n host: {\n class: 'axm-ppe-item-viewer-widget block w-full',\n },\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [AXFormModule, AXLabelModule, AXValidationModule, AXMPpeItemViewerComponent],\n})\nexport class AXMPpeItemViewerWidgetEditComponent extends AXPValueWidgetComponent<\n string[] | null,\n AXMPpeItemViewerWidgetOptions\n> {\n //#region ----- Services & Dependencies -----\n\n private readonly ppeItemViewerService = inject(AXMPpeItemViewerService);\n\n //#endregion\n\n //#region ----- State Signals -----\n\n protected readonly loading = signal(false);\n protected readonly items = signal<AXMPpeItemViewerDisplayItem[]>([]);\n\n //#endregion\n\n //#region ----- Computed Properties -----\n\n protected readonly layout = computed<AXMPpeItemViewerLayout>(() =>\n resolvePpeItemViewerLayout(this.options()['layout']),\n );\n\n protected readonly disabled = computed<boolean>(() => this.options()['disabled'] === true);\n\n protected readonly selectedIds = computed(() => extractPpeItemIds(this.getValue()));\n\n protected readonly fieldLabel = computed<string>(() => {\n const label = this.options()['label'];\n return typeof label === 'string' ? label : '';\n });\n\n //#endregion\n\n //#region ----- Lifecycle -----\n\n private readonly loadConfiguredItems = effect((onCleanup) => {\n const ids = extractPpeItemIds(this.options()['ppeItems']);\n let cancelled = false;\n onCleanup(() => {\n cancelled = true;\n });\n void this.refreshItems(ids, () => cancelled);\n });\n\n //#endregion\n\n //#region ----- Event Handlers -----\n\n protected isReadonly(): boolean {\n return this.options()['readonly'] === true || this.mode === 'view' || this.mode === 'print';\n }\n\n protected onSelectedIdsChange(ids: string[]): void {\n if (this.disabled() || this.isReadonly()) {\n return;\n }\n this.setValue(ids.length > 0 ? ids : null);\n }\n\n //#endregion\n\n //#region ----- Data Loading -----\n\n private async refreshItems(ids: string[], isCancelled: () => boolean): Promise<void> {\n if (ids.length === 0) {\n this.items.set([]);\n this.loading.set(false);\n return;\n }\n\n this.beginHydration();\n this.loading.set(true);\n try {\n const loaded = await this.ppeItemViewerService.loadDisplayItems(ids);\n if (!isCancelled()) {\n this.items.set(loaded);\n }\n } catch {\n if (!isCancelled()) {\n this.items.set([]);\n }\n } finally {\n if (!isCancelled()) {\n this.loading.set(false);\n }\n this.endHydration();\n }\n }\n\n //#endregion\n}\n\n//#endregion\n","<ax-form-field class=\"flex flex-col gap-1 w-full\">\n @if (fieldLabel()) {\n <!-- ----- Optional field label when the host does not already wrap the widget ----- -->\n <ax-label class=\"font-semibold text-sm\" [required]=\"hasRequiredValidation()\">{{ fieldLabel() }}</ax-label>\n }\n <axm-ppe-item-viewer\n [items]=\"items()\"\n [layout]=\"layout()\"\n [selectedIds]=\"selectedIds()\"\n [loading]=\"loading()\"\n [disabled]=\"disabled()\"\n [readonly]=\"isReadonly()\"\n (selectedIdsChange)=\"onSelectedIdsChange($event)\"\n />\n @for (validation of validationRules(); track $index) {\n <ax-validation-rule\n [rule]=\"validation.rule\"\n [message]=\"$safeNavigationMigration(validation.options?.message)\"\n [options]=\"validation.options\"\n [disabled]=\"validation.disabled === true\"></ax-validation-rule>\n }\n</ax-form-field>\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;AAaA;AAEA;AAaM,MAAO,mCAAoC,SAAQ,uBAGxD,CAAA;AAdD,IAAA,WAAA,GAAA;;;AAiBmB,QAAA,IAAA,CAAA,oBAAoB,GAAG,MAAM,CAAC,uBAAuB,CAAC;;;QAMpD,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,KAAK;oFAAC;QACvB,IAAA,CAAA,KAAK,GAAG,MAAM,CAAgC,EAAE;kFAAC;;;AAMjD,QAAA,IAAA,CAAA,MAAM,GAAG,QAAQ,CAAyB,MAC3D,0BAA0B,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,QAA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,qRAAE,aAAa,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,gBAAA,EAAA,QAAA,EAAA,UAAA,EAAA,MAAA,EAAA,CAAA,UAAA,EAAA,KAAA,CAAA,EAAA,OAAA,EAAA,CAAA,gBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAE,kBAAkB,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,yBAAyB,EAAA,QAAA,EAAA,qBAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,aAAA,EAAA,SAAA,EAAA,UAAA,EAAA,UAAA,EAAA,aAAA,CAAA,EAAA,OAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA,CAAA;;2FAEzE,mCAAmC,EAAA,UAAA,EAAA,CAAA;kBAX/C,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,iCAAiC,EAAA,IAAA,EAGrC;AACJ,wBAAA,KAAK,EAAE,yCAAyC;AACjD,qBAAA,EAAA,aAAA,EACc,iBAAiB,CAAC,IAAI,EAAA,eAAA,EACpB,uBAAuB,CAAC,MAAM,EAAA,OAAA,EACtC,CAAC,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,yBAAyB,CAAC,EAAA,QAAA,EAAA,23BAAA,EAAA,MAAA,EAAA,CAAA,8GAAA,CAAA,EAAA;;;"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { WidgetHtmlPrintComponent } from '@acorex-platform/framework-client/layout/widget-core';
|
|
4
|
+
import { widgetPrint } from '@acorex-platform/framework-shared/core';
|
|
5
|
+
|
|
6
|
+
const render = (c) => {
|
|
7
|
+
const items = c.value ?? c.options['ppeItems'];
|
|
8
|
+
return (Array.isArray(items) ? items : [items])
|
|
9
|
+
.map((value) => widgetPrint.printValue({ ...c, value }))
|
|
10
|
+
.filter(Boolean)
|
|
11
|
+
.join(', ');
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
class AXPPpeItemViewerPrintComponent extends WidgetHtmlPrintComponent {
|
|
15
|
+
static { this.render = render; }
|
|
16
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPPpeItemViewerPrintComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
17
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.8", type: AXPPpeItemViewerPrintComponent, isStandalone: true, selector: "axp-print-ppe-item-viewer", usesInheritance: true, ngImport: i0, template: '<div [innerHTML]="markup()"></div>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
18
|
+
}
|
|
19
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPPpeItemViewerPrintComponent, decorators: [{
|
|
20
|
+
type: Component,
|
|
21
|
+
args: [{
|
|
22
|
+
selector: 'axp-print-ppe-item-viewer',
|
|
23
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
24
|
+
template: '<div [innerHTML]="markup()"></div>',
|
|
25
|
+
}]
|
|
26
|
+
}] });
|
|
27
|
+
|
|
28
|
+
export { AXPPpeItemViewerPrintComponent };
|
|
29
|
+
//# sourceMappingURL=acorex-platform-module-workplacesafety-management-client-ppe-item-viewer-widget-print.component-Bmr8LhoF.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-workplacesafety-management-client-ppe-item-viewer-widget-print.component-Bmr8LhoF.mjs","sources":["../../../../libs/modules/workplacesafety-management/client/src/lib/features/ppe-item-viewer/ppe-item-viewer-widget.render.ts","../../../../libs/modules/workplacesafety-management/client/src/lib/features/ppe-item-viewer/ppe-item-viewer-widget-print.component.ts"],"sourcesContent":["import { widgetPrint } from '@acorex-platform/framework-shared/core';\n\nexport const render: widgetPrint.WidgetHtmlRenderer = (c) => {\n const items = c.value ?? c.options['ppeItems'];\n return (Array.isArray(items) ? items : [items])\n .map((value) => widgetPrint.printValue({ ...c, value }))\n .filter(Boolean)\n .join(', ');\n};\n","import { ChangeDetectionStrategy, Component } from '@angular/core';\nimport { WidgetHtmlPrintComponent } from '@acorex-platform/framework-client/layout/widget-core';\nimport { render } from './ppe-item-viewer-widget.render';\n\n@Component({\n selector: 'axp-print-ppe-item-viewer',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: '<div [innerHTML]=\"markup()\"></div>',\n})\nexport class AXPPpeItemViewerPrintComponent extends WidgetHtmlPrintComponent {\n static readonly render = render;\n}\n"],"names":[],"mappings":";;;;;AAEO,MAAM,MAAM,GAAmC,CAAC,CAAC,KAAI;AAC1D,IAAA,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;AAC9C,IAAA,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,CAAC,KAAK,CAAC;AAC3C,SAAA,GAAG,CAAC,CAAC,KAAK,KAAK,WAAW,CAAC,UAAU,CAAC,EAAE,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC;SACtD,MAAM,CAAC,OAAO;SACd,IAAI,CAAC,IAAI,CAAC;AACf,CAAC;;ACCK,MAAO,8BAA+B,SAAQ,wBAAwB,CAAA;aAC1D,IAAA,CAAA,MAAM,GAAG,MAAH,CAAU;8GADrB,8BAA8B,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAA9B,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,8BAA8B,4GAF/B,oCAAoC,EAAA,QAAA,EAAA,IAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAEnC,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAL1C,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,2BAA2B;oBACrC,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,QAAQ,EAAE,oCAAoC;AAC/C,iBAAA;;;"}
|
|
@@ -11,7 +11,7 @@ import * as i2 from '@acorex/components/decorators';
|
|
|
11
11
|
import { AXDecoratorModule } from '@acorex/components/decorators';
|
|
12
12
|
import * as i1$1 from '@angular/forms';
|
|
13
13
|
import { FormsModule } from '@angular/forms';
|
|
14
|
-
import { p as ppeItemViewerStandardText, a as resolvePpeItemViewerLook } from './acorex-platform-module-workplacesafety-management-client-ppe-item-viewer.util-
|
|
14
|
+
import { p as ppeItemViewerStandardText, a as resolvePpeItemViewerLook } from './acorex-platform-module-workplacesafety-management-client-ppe-item-viewer.util-BTR9I8Te.mjs';
|
|
15
15
|
import { resolveMultiLanguageString } from '@acorex-platform/framework-shared/core';
|
|
16
16
|
import { AXPFileStorageService, isStoredImageFileId, resolveStoredImageDisplayUrl } from '@acorex-platform/framework-client/common';
|
|
17
17
|
import { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';
|
|
@@ -62,7 +62,7 @@ class AXMPpeItemCardComponent {
|
|
|
62
62
|
event.stopPropagation();
|
|
63
63
|
}
|
|
64
64
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMPpeItemCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
65
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXMPpeItemCardComponent, isStandalone: true, selector: "axm-ppe-item-card", inputs: { item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired: true, transformFunction: null }, look: { classPropertyName: "look", publicName: "look", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, showControl: { classPropertyName: "showControl", publicName: "showControl", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedChange: "selectedChange" }, host: { properties: { "class.axm-ppe-item-card--list": "look() === \"list\"", "class.axm-ppe-item-card--card": "look() === \"card\"", "class.axm-ppe-item-card--selected": "selected()", "class.axm-ppe-item-card--interactive": "interactive()", "class.axm-ppe-item-card--disabled": "disabled()" }, classAttribute: "axm-ppe-item-card" }, ngImport: i0, template: "<div class=\"axm-ppe-item-card__body\" (click)=\"onActivate()\">\n <!-- ----- PPE icon ----- -->\n @if (item().imageUrl) {\n <div class=\"axm-ppe-item-card__icon\">\n <img [src]=\"item().imageUrl\" [alt]=\"item().title\" />\n </div>\n }\n <!-- ----- Fallback icon when the PPE item has no image ----- -->\n @else {\n <div class=\"axm-ppe-item-card__icon axm-ppe-item-card__icon--fallback\">\n <ax-icon icon=\"fa-light fa-helmet-safety\"></ax-icon>\n </div>\n }\n\n <div class=\"axm-ppe-item-card__content\">\n <span class=\"axm-ppe-item-card__title\">{{ item().title }}</span>\n <!--->\n <!-- ----- Standard / code when present ----- -->\n @if (standardText()) {\n <span class=\"axm-ppe-item-card__code\">{{ standardText() }}</span>\n }\n </div>\n\n <!-- ----- Selection checkbox ----- -->\n @if (showControl()) {\n <div class=\"axm-ppe-item-card__control\" (click)=\"onControlClick($event)\">\n <ax-check-box\n [ngModel]=\"selected()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n (onValueChanged)=\"onCheckChanged($event)\"\n ></ax-check-box>\n </div>\n }\n</div>\n", styles: ["@layer properties;.axm-ppe-item-card{display:block;width:100%}.axm-ppe-item-card .axm-ppe-item-card__body{display:flex;width:100%}.axm-ppe-item-card .axm-ppe-item-card__icon{display:flex;flex-shrink:0;align-items:center;justify-content:center;overflow:hidden;border-radius:var(--radius-lg, .5rem);border-style:var(--tw-border-style);border-width:1px;background-color:var(--color-lighter);color:var(--color-on-lighter);border-color:var(--color-border-lighter);border-color:rgba(var(--ax-sys-color-surface))}.axm-ppe-item-card .axm-ppe-item-card__icon img{height:100%;width:100%;object-fit:contain}.axm-ppe-item-card .axm-ppe-item-card__icon--fallback{color:rgba(var(--ax-sys-color-text-default))}@supports (color: color-mix(in lab,red,red)){.axm-ppe-item-card .axm-ppe-item-card__icon--fallback{color:color-mix(in oklab,rgba(var(--ax-sys-color-text-default)) 80%,transparent)}}.axm-ppe-item-card .axm-ppe-item-card__content{display:flex;min-width:0px;flex-direction:column}.axm-ppe-item-card .axm-ppe-item-card__title{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-ppe-item-card .axm-ppe-item-card__code{font-size:var(--text-xs, .75rem);line-height:var(--tw-leading, var(--text-xs--line-height, calc(1 / .75)));color:rgba(var(--ax-sys-color-text-default))}@supports (color: color-mix(in lab,red,red)){.axm-ppe-item-card .axm-ppe-item-card__code{color:color-mix(in oklab,rgba(var(--ax-sys-color-text-default)) 80%,transparent)}}.axm-ppe-item-card .axm-ppe-item-card__control{display:flex;flex-shrink:0;align-items:center}.axm-ppe-item-card.axm-ppe-item-card--card .axm-ppe-item-card__body{height:100%;flex-direction:column;align-items:center;gap:calc(var(--spacing, .25rem) * 2);border-radius:var(--radius-lg, .5rem);border-style:var(--tw-border-style);border-width:1px;background-color:var(--color-lighter);color:var(--color-on-lighter);border-color:var(--color-border-lighter);border-color:rgba(var(--ax-sys-color-surface));padding:calc(var(--spacing, .25rem) * 3);text-align:center}.axm-ppe-item-card.axm-ppe-item-card--card .axm-ppe-item-card__icon{width:calc(var(--spacing, .25rem) * 16);height:calc(var(--spacing, .25rem) * 16)}.axm-ppe-item-card.axm-ppe-item-card--card .axm-ppe-item-card__icon--fallback{font-size:var(--text-2xl, 1.5rem);line-height:var(--tw-leading, var(--text-2xl--line-height, calc(2 / 1.5)))}.axm-ppe-item-card.axm-ppe-item-card--card .axm-ppe-item-card__content{width:100%;align-items:center;gap:calc(var(--spacing, .25rem) * .5)}.axm-ppe-item-card.axm-ppe-item-card--card .axm-ppe-item-card__control{justify-content:center}.axm-ppe-item-card.axm-ppe-item-card--list .axm-ppe-item-card__body{flex-direction:row;align-items:center;gap:calc(var(--spacing, .25rem) * 3);padding-block:calc(var(--spacing, .25rem) * 2)}.axm-ppe-item-card.axm-ppe-item-card--list .axm-ppe-item-card__icon{width:calc(var(--spacing, .25rem) * 10);height:calc(var(--spacing, .25rem) * 10)}.axm-ppe-item-card.axm-ppe-item-card--list .axm-ppe-item-card__content{flex:1;gap:calc(var(--spacing, .25rem) * .5)}.axm-ppe-item-card.axm-ppe-item-card--list .axm-ppe-item-card__control{order:-9999}.axm-ppe-item-card.axm-ppe-item-card--selected.axm-ppe-item-card--card .axm-ppe-item-card__body{border-color:rgba(var(--ax-sys-color-primary-surface))}.axm-ppe-item-card.axm-ppe-item-card--interactive .axm-ppe-item-card__body{cursor:pointer}.axm-ppe-item-card.axm-ppe-item-card--disabled{opacity:60%}@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:
|
|
65
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXMPpeItemCardComponent, isStandalone: true, selector: "axm-ppe-item-card", inputs: { item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired: true, transformFunction: null }, look: { classPropertyName: "look", publicName: "look", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, showControl: { classPropertyName: "showControl", publicName: "showControl", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedChange: "selectedChange" }, host: { properties: { "class.axm-ppe-item-card--list": "look() === \"list\"", "class.axm-ppe-item-card--card": "look() === \"card\"", "class.axm-ppe-item-card--selected": "selected()", "class.axm-ppe-item-card--interactive": "interactive()", "class.axm-ppe-item-card--disabled": "disabled()" }, classAttribute: "axm-ppe-item-card" }, ngImport: i0, template: "<div class=\"axm-ppe-item-card__body\" (click)=\"onActivate()\">\n <!-- ----- PPE icon ----- -->\n @if (item().imageUrl) {\n <div class=\"axm-ppe-item-card__icon\">\n <img [src]=\"item().imageUrl\" [alt]=\"item().title\" />\n </div>\n }\n <!-- ----- Fallback icon when the PPE item has no image ----- -->\n @else {\n <div class=\"axm-ppe-item-card__icon axm-ppe-item-card__icon--fallback\">\n <ax-icon icon=\"fa-light fa-helmet-safety\"></ax-icon>\n </div>\n }\n\n <div class=\"axm-ppe-item-card__content\">\n <span class=\"axm-ppe-item-card__title\">{{ item().title }}</span>\n <!--->\n <!-- ----- Standard / code when present ----- -->\n @if (standardText()) {\n <span class=\"axm-ppe-item-card__code\">{{ standardText() }}</span>\n }\n </div>\n\n <!-- ----- Selection checkbox ----- -->\n @if (showControl()) {\n <div class=\"axm-ppe-item-card__control\" (click)=\"onControlClick($event)\">\n <ax-check-box\n [ngModel]=\"selected()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n (onValueChanged)=\"onCheckChanged($event)\"\n ></ax-check-box>\n </div>\n }\n</div>\n", styles: ["@layer properties;.axm-ppe-item-card{display:block;width:100%}.axm-ppe-item-card .axm-ppe-item-card__body{display:flex;width:100%}.axm-ppe-item-card .axm-ppe-item-card__icon{display:flex;flex-shrink:0;align-items:center;justify-content:center;overflow:hidden;border-radius:var(--radius-lg, .5rem);border-style:var(--tw-border-style);border-width:1px;background-color:var(--color-lighter);color:var(--color-on-lighter);border-color:var(--color-border-lighter);border-color:rgba(var(--ax-sys-color-surface))}.axm-ppe-item-card .axm-ppe-item-card__icon img{height:100%;width:100%;object-fit:contain}.axm-ppe-item-card .axm-ppe-item-card__icon--fallback{color:rgba(var(--ax-sys-color-text-default))}@supports (color: color-mix(in lab,red,red)){.axm-ppe-item-card .axm-ppe-item-card__icon--fallback{color:color-mix(in oklab,rgba(var(--ax-sys-color-text-default)) 80%,transparent)}}.axm-ppe-item-card .axm-ppe-item-card__content{display:flex;min-width:0px;flex-direction:column}.axm-ppe-item-card .axm-ppe-item-card__title{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-ppe-item-card .axm-ppe-item-card__code{font-size:var(--text-xs, .75rem);line-height:var(--tw-leading, var(--text-xs--line-height, calc(1 / .75)));color:rgba(var(--ax-sys-color-text-default))}@supports (color: color-mix(in lab,red,red)){.axm-ppe-item-card .axm-ppe-item-card__code{color:color-mix(in oklab,rgba(var(--ax-sys-color-text-default)) 80%,transparent)}}.axm-ppe-item-card .axm-ppe-item-card__control{display:flex;flex-shrink:0;align-items:center}.axm-ppe-item-card.axm-ppe-item-card--card .axm-ppe-item-card__body{height:100%;flex-direction:column;align-items:center;gap:calc(var(--spacing, .25rem) * 2);border-radius:var(--radius-lg, .5rem);border-style:var(--tw-border-style);border-width:1px;background-color:var(--color-lighter);color:var(--color-on-lighter);border-color:var(--color-border-lighter);border-color:rgba(var(--ax-sys-color-surface));padding:calc(var(--spacing, .25rem) * 3);text-align:center}.axm-ppe-item-card.axm-ppe-item-card--card .axm-ppe-item-card__icon{width:calc(var(--spacing, .25rem) * 16);height:calc(var(--spacing, .25rem) * 16)}.axm-ppe-item-card.axm-ppe-item-card--card .axm-ppe-item-card__icon--fallback{font-size:var(--text-2xl, 1.5rem);line-height:var(--tw-leading, var(--text-2xl--line-height, calc(2 / 1.5)))}.axm-ppe-item-card.axm-ppe-item-card--card .axm-ppe-item-card__content{width:100%;align-items:center;gap:calc(var(--spacing, .25rem) * .5)}.axm-ppe-item-card.axm-ppe-item-card--card .axm-ppe-item-card__control{justify-content:center}.axm-ppe-item-card.axm-ppe-item-card--list .axm-ppe-item-card__body{flex-direction:row;align-items:center;gap:calc(var(--spacing, .25rem) * 3);padding-block:calc(var(--spacing, .25rem) * 2)}.axm-ppe-item-card.axm-ppe-item-card--list .axm-ppe-item-card__icon{width:calc(var(--spacing, .25rem) * 10);height:calc(var(--spacing, .25rem) * 10)}.axm-ppe-item-card.axm-ppe-item-card--list .axm-ppe-item-card__content{flex:1;gap:calc(var(--spacing, .25rem) * .5)}.axm-ppe-item-card.axm-ppe-item-card--list .axm-ppe-item-card__control{order:-9999}.axm-ppe-item-card.axm-ppe-item-card--selected.axm-ppe-item-card--card .axm-ppe-item-card__body{border-color:rgba(var(--ax-sys-color-primary-surface))}.axm-ppe-item-card.axm-ppe-item-card--interactive .axm-ppe-item-card__body{cursor:pointer}.axm-ppe-item-card.axm-ppe-item-card--disabled{opacity:60%}@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: block))) 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.5 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "ngmodule", type: AXCheckBoxModule }, { kind: "component", type: i1.AXCheckBoxComponent, selector: "ax-check-box", inputs: ["disabled", "tabIndex", "readonly", "color", "value", "name", "id", "isLoading", "indeterminate"], outputs: ["onBlur", "onFocus", "valueChange", "onValueChanged"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i2.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
66
66
|
}
|
|
67
67
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMPpeItemCardComponent, decorators: [{
|
|
68
68
|
type: Component,
|
|
@@ -73,7 +73,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
73
73
|
'[class.axm-ppe-item-card--selected]': 'selected()',
|
|
74
74
|
'[class.axm-ppe-item-card--interactive]': 'interactive()',
|
|
75
75
|
'[class.axm-ppe-item-card--disabled]': 'disabled()',
|
|
76
|
-
}, template: "<div class=\"axm-ppe-item-card__body\" (click)=\"onActivate()\">\n <!-- ----- PPE icon ----- -->\n @if (item().imageUrl) {\n <div class=\"axm-ppe-item-card__icon\">\n <img [src]=\"item().imageUrl\" [alt]=\"item().title\" />\n </div>\n }\n <!-- ----- Fallback icon when the PPE item has no image ----- -->\n @else {\n <div class=\"axm-ppe-item-card__icon axm-ppe-item-card__icon--fallback\">\n <ax-icon icon=\"fa-light fa-helmet-safety\"></ax-icon>\n </div>\n }\n\n <div class=\"axm-ppe-item-card__content\">\n <span class=\"axm-ppe-item-card__title\">{{ item().title }}</span>\n <!--->\n <!-- ----- Standard / code when present ----- -->\n @if (standardText()) {\n <span class=\"axm-ppe-item-card__code\">{{ standardText() }}</span>\n }\n </div>\n\n <!-- ----- Selection checkbox ----- -->\n @if (showControl()) {\n <div class=\"axm-ppe-item-card__control\" (click)=\"onControlClick($event)\">\n <ax-check-box\n [ngModel]=\"selected()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n (onValueChanged)=\"onCheckChanged($event)\"\n ></ax-check-box>\n </div>\n }\n</div>\n", styles: ["@layer properties;.axm-ppe-item-card{display:block;width:100%}.axm-ppe-item-card .axm-ppe-item-card__body{display:flex;width:100%}.axm-ppe-item-card .axm-ppe-item-card__icon{display:flex;flex-shrink:0;align-items:center;justify-content:center;overflow:hidden;border-radius:var(--radius-lg, .5rem);border-style:var(--tw-border-style);border-width:1px;background-color:var(--color-lighter);color:var(--color-on-lighter);border-color:var(--color-border-lighter);border-color:rgba(var(--ax-sys-color-surface))}.axm-ppe-item-card .axm-ppe-item-card__icon img{height:100%;width:100%;object-fit:contain}.axm-ppe-item-card .axm-ppe-item-card__icon--fallback{color:rgba(var(--ax-sys-color-text-default))}@supports (color: color-mix(in lab,red,red)){.axm-ppe-item-card .axm-ppe-item-card__icon--fallback{color:color-mix(in oklab,rgba(var(--ax-sys-color-text-default)) 80%,transparent)}}.axm-ppe-item-card .axm-ppe-item-card__content{display:flex;min-width:0px;flex-direction:column}.axm-ppe-item-card .axm-ppe-item-card__title{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-ppe-item-card .axm-ppe-item-card__code{font-size:var(--text-xs, .75rem);line-height:var(--tw-leading, var(--text-xs--line-height, calc(1 / .75)));color:rgba(var(--ax-sys-color-text-default))}@supports (color: color-mix(in lab,red,red)){.axm-ppe-item-card .axm-ppe-item-card__code{color:color-mix(in oklab,rgba(var(--ax-sys-color-text-default)) 80%,transparent)}}.axm-ppe-item-card .axm-ppe-item-card__control{display:flex;flex-shrink:0;align-items:center}.axm-ppe-item-card.axm-ppe-item-card--card .axm-ppe-item-card__body{height:100%;flex-direction:column;align-items:center;gap:calc(var(--spacing, .25rem) * 2);border-radius:var(--radius-lg, .5rem);border-style:var(--tw-border-style);border-width:1px;background-color:var(--color-lighter);color:var(--color-on-lighter);border-color:var(--color-border-lighter);border-color:rgba(var(--ax-sys-color-surface));padding:calc(var(--spacing, .25rem) * 3);text-align:center}.axm-ppe-item-card.axm-ppe-item-card--card .axm-ppe-item-card__icon{width:calc(var(--spacing, .25rem) * 16);height:calc(var(--spacing, .25rem) * 16)}.axm-ppe-item-card.axm-ppe-item-card--card .axm-ppe-item-card__icon--fallback{font-size:var(--text-2xl, 1.5rem);line-height:var(--tw-leading, var(--text-2xl--line-height, calc(2 / 1.5)))}.axm-ppe-item-card.axm-ppe-item-card--card .axm-ppe-item-card__content{width:100%;align-items:center;gap:calc(var(--spacing, .25rem) * .5)}.axm-ppe-item-card.axm-ppe-item-card--card .axm-ppe-item-card__control{justify-content:center}.axm-ppe-item-card.axm-ppe-item-card--list .axm-ppe-item-card__body{flex-direction:row;align-items:center;gap:calc(var(--spacing, .25rem) * 3);padding-block:calc(var(--spacing, .25rem) * 2)}.axm-ppe-item-card.axm-ppe-item-card--list .axm-ppe-item-card__icon{width:calc(var(--spacing, .25rem) * 10);height:calc(var(--spacing, .25rem) * 10)}.axm-ppe-item-card.axm-ppe-item-card--list .axm-ppe-item-card__content{flex:1;gap:calc(var(--spacing, .25rem) * .5)}.axm-ppe-item-card.axm-ppe-item-card--list .axm-ppe-item-card__control{order:-9999}.axm-ppe-item-card.axm-ppe-item-card--selected.axm-ppe-item-card--card .axm-ppe-item-card__body{border-color:rgba(var(--ax-sys-color-primary-surface))}.axm-ppe-item-card.axm-ppe-item-card--interactive .axm-ppe-item-card__body{cursor:pointer}.axm-ppe-item-card.axm-ppe-item-card--disabled{opacity:60%}@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:
|
|
76
|
+
}, template: "<div class=\"axm-ppe-item-card__body\" (click)=\"onActivate()\">\n <!-- ----- PPE icon ----- -->\n @if (item().imageUrl) {\n <div class=\"axm-ppe-item-card__icon\">\n <img [src]=\"item().imageUrl\" [alt]=\"item().title\" />\n </div>\n }\n <!-- ----- Fallback icon when the PPE item has no image ----- -->\n @else {\n <div class=\"axm-ppe-item-card__icon axm-ppe-item-card__icon--fallback\">\n <ax-icon icon=\"fa-light fa-helmet-safety\"></ax-icon>\n </div>\n }\n\n <div class=\"axm-ppe-item-card__content\">\n <span class=\"axm-ppe-item-card__title\">{{ item().title }}</span>\n <!--->\n <!-- ----- Standard / code when present ----- -->\n @if (standardText()) {\n <span class=\"axm-ppe-item-card__code\">{{ standardText() }}</span>\n }\n </div>\n\n <!-- ----- Selection checkbox ----- -->\n @if (showControl()) {\n <div class=\"axm-ppe-item-card__control\" (click)=\"onControlClick($event)\">\n <ax-check-box\n [ngModel]=\"selected()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n (onValueChanged)=\"onCheckChanged($event)\"\n ></ax-check-box>\n </div>\n }\n</div>\n", styles: ["@layer properties;.axm-ppe-item-card{display:block;width:100%}.axm-ppe-item-card .axm-ppe-item-card__body{display:flex;width:100%}.axm-ppe-item-card .axm-ppe-item-card__icon{display:flex;flex-shrink:0;align-items:center;justify-content:center;overflow:hidden;border-radius:var(--radius-lg, .5rem);border-style:var(--tw-border-style);border-width:1px;background-color:var(--color-lighter);color:var(--color-on-lighter);border-color:var(--color-border-lighter);border-color:rgba(var(--ax-sys-color-surface))}.axm-ppe-item-card .axm-ppe-item-card__icon img{height:100%;width:100%;object-fit:contain}.axm-ppe-item-card .axm-ppe-item-card__icon--fallback{color:rgba(var(--ax-sys-color-text-default))}@supports (color: color-mix(in lab,red,red)){.axm-ppe-item-card .axm-ppe-item-card__icon--fallback{color:color-mix(in oklab,rgba(var(--ax-sys-color-text-default)) 80%,transparent)}}.axm-ppe-item-card .axm-ppe-item-card__content{display:flex;min-width:0px;flex-direction:column}.axm-ppe-item-card .axm-ppe-item-card__title{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-ppe-item-card .axm-ppe-item-card__code{font-size:var(--text-xs, .75rem);line-height:var(--tw-leading, var(--text-xs--line-height, calc(1 / .75)));color:rgba(var(--ax-sys-color-text-default))}@supports (color: color-mix(in lab,red,red)){.axm-ppe-item-card .axm-ppe-item-card__code{color:color-mix(in oklab,rgba(var(--ax-sys-color-text-default)) 80%,transparent)}}.axm-ppe-item-card .axm-ppe-item-card__control{display:flex;flex-shrink:0;align-items:center}.axm-ppe-item-card.axm-ppe-item-card--card .axm-ppe-item-card__body{height:100%;flex-direction:column;align-items:center;gap:calc(var(--spacing, .25rem) * 2);border-radius:var(--radius-lg, .5rem);border-style:var(--tw-border-style);border-width:1px;background-color:var(--color-lighter);color:var(--color-on-lighter);border-color:var(--color-border-lighter);border-color:rgba(var(--ax-sys-color-surface));padding:calc(var(--spacing, .25rem) * 3);text-align:center}.axm-ppe-item-card.axm-ppe-item-card--card .axm-ppe-item-card__icon{width:calc(var(--spacing, .25rem) * 16);height:calc(var(--spacing, .25rem) * 16)}.axm-ppe-item-card.axm-ppe-item-card--card .axm-ppe-item-card__icon--fallback{font-size:var(--text-2xl, 1.5rem);line-height:var(--tw-leading, var(--text-2xl--line-height, calc(2 / 1.5)))}.axm-ppe-item-card.axm-ppe-item-card--card .axm-ppe-item-card__content{width:100%;align-items:center;gap:calc(var(--spacing, .25rem) * .5)}.axm-ppe-item-card.axm-ppe-item-card--card .axm-ppe-item-card__control{justify-content:center}.axm-ppe-item-card.axm-ppe-item-card--list .axm-ppe-item-card__body{flex-direction:row;align-items:center;gap:calc(var(--spacing, .25rem) * 3);padding-block:calc(var(--spacing, .25rem) * 2)}.axm-ppe-item-card.axm-ppe-item-card--list .axm-ppe-item-card__icon{width:calc(var(--spacing, .25rem) * 10);height:calc(var(--spacing, .25rem) * 10)}.axm-ppe-item-card.axm-ppe-item-card--list .axm-ppe-item-card__content{flex:1;gap:calc(var(--spacing, .25rem) * .5)}.axm-ppe-item-card.axm-ppe-item-card--list .axm-ppe-item-card__control{order:-9999}.axm-ppe-item-card.axm-ppe-item-card--selected.axm-ppe-item-card--card .axm-ppe-item-card__body{border-color:rgba(var(--ax-sys-color-primary-surface))}.axm-ppe-item-card.axm-ppe-item-card--interactive .axm-ppe-item-card__body{cursor:pointer}.axm-ppe-item-card.axm-ppe-item-card--disabled{opacity:60%}@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: block))) 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.5 | MIT License | https://tailwindcss.com */\n"] }]
|
|
77
77
|
}], propDecorators: { item: [{ type: i0.Input, args: [{ isSignal: true, alias: "item", required: true }] }], look: [{ type: i0.Input, args: [{ isSignal: true, alias: "look", required: false }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], showControl: [{ type: i0.Input, args: [{ isSignal: true, alias: "showControl", required: false }] }], selectedChange: [{ type: i0.Output, args: ["selectedChange"] }] } });
|
|
78
78
|
|
|
79
79
|
//#region ----- Imports -----
|
|
@@ -121,13 +121,13 @@ class AXMPpeItemViewerComponent {
|
|
|
121
121
|
this.selectedIdsChange.emit(next);
|
|
122
122
|
}
|
|
123
123
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMPpeItemViewerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
124
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXMPpeItemViewerComponent, isStandalone: true, selector: "axm-ppe-item-viewer", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, selectedIds: { classPropertyName: "selectedIds", publicName: "selectedIds", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, showControl: { classPropertyName: "showControl", publicName: "showControl", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedIdsChange: "selectedIdsChange" }, host: { classAttribute: "axm-ppe-item-viewer block w-full" }, ngImport: i0, template: "@if (loading()) {\n <!-- ----- Loading indicator while configured PPE items are fetched ----- -->\n <ax-loading></ax-loading>\n}\n<!-- ----- Empty state when no PPE items are configured ----- -->\n@else if (items().length === 0) {\n <p class=\"axm-ppe-item-viewer__empty\">\n {{ '@workplacesafety-management:ppe-items.components.ppe-item-viewer.empty' | translate | async }}\n </p>\n}\n<!-- ----- PPE items in card grid or checklist list ----- -->\n@else {\n <div\n class=\"axm-ppe-item-viewer__items\"\n [class.axm-ppe-item-viewer__items--card]=\"look() === 'card'\"\n [class.axm-ppe-item-viewer__items--list]=\"look() === 'list'\"\n >\n @for (item of items(); track item.id) {\n <axm-ppe-item-card\n [item]=\"item\"\n [look]=\"look()\"\n [selected]=\"isSelected(item.id)\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [showControl]=\"showControl()\"\n (selectedChange)=\"onItemSelectedChange(item.id, $event)\"\n />\n }\n </div>\n}\n", styles: ["@layer properties;.axm-ppe-item-viewer{width:100%}.axm-ppe-item-viewer .axm-ppe-item-viewer__empty{margin:0;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-ppe-item-viewer .axm-ppe-item-viewer__empty{color:color-mix(in oklab,rgba(var(--ax-sys-color-text-default)) 80%,transparent)}}.axm-ppe-item-viewer .axm-ppe-item-viewer__items--card{display:grid;grid-template-columns:repeat(auto-fill,minmax(9.5rem,1fr));width:100%;gap:calc(var(--spacing, .25rem) * 3)}.axm-ppe-item-viewer .axm-ppe-item-viewer__items--list{display:flex;width:100%;flex-direction:column}.axm-ppe-item-viewer .axm-ppe-item-viewer__items--list>*+*{border-top-style:var(--tw-border-style);border-top-width:1px;border-color:rgba(var(--ax-sys-color-surface))}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim:
|
|
124
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXMPpeItemViewerComponent, isStandalone: true, selector: "axm-ppe-item-viewer", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, selectedIds: { classPropertyName: "selectedIds", publicName: "selectedIds", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, showControl: { classPropertyName: "showControl", publicName: "showControl", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedIdsChange: "selectedIdsChange" }, host: { classAttribute: "axm-ppe-item-viewer block w-full" }, ngImport: i0, template: "@if (loading()) {\n <!-- ----- Loading indicator while configured PPE items are fetched ----- -->\n <ax-loading></ax-loading>\n}\n<!-- ----- Empty state when no PPE items are configured ----- -->\n@else if (items().length === 0) {\n <p class=\"axm-ppe-item-viewer__empty\">\n {{ '@workplacesafety-management:ppe-items.components.ppe-item-viewer.empty' | translate | async }}\n </p>\n}\n<!-- ----- PPE items in card grid or checklist list ----- -->\n@else {\n <div\n class=\"axm-ppe-item-viewer__items\"\n [class.axm-ppe-item-viewer__items--card]=\"look() === 'card'\"\n [class.axm-ppe-item-viewer__items--list]=\"look() === 'list'\"\n >\n @for (item of items(); track item.id) {\n <axm-ppe-item-card\n [item]=\"item\"\n [look]=\"look()\"\n [selected]=\"isSelected(item.id)\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [showControl]=\"showControl()\"\n (selectedChange)=\"onItemSelectedChange(item.id, $event)\"\n />\n }\n </div>\n}\n", styles: ["@layer properties;.axm-ppe-item-viewer{width:100%}.axm-ppe-item-viewer .axm-ppe-item-viewer__empty{margin:0;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-ppe-item-viewer .axm-ppe-item-viewer__empty{color:color-mix(in oklab,rgba(var(--ax-sys-color-text-default)) 80%,transparent)}}.axm-ppe-item-viewer .axm-ppe-item-viewer__items--card{display:grid;grid-template-columns:repeat(auto-fill,minmax(9.5rem,1fr));width:100%;gap:calc(var(--spacing, .25rem) * 3)}.axm-ppe-item-viewer .axm-ppe-item-viewer__items--list{display:flex;width:100%;flex-direction:column}.axm-ppe-item-viewer .axm-ppe-item-viewer__items--list>*+*{border-top-style:var(--tw-border-style);border-top-width:1px;border-color:rgba(var(--ax-sys-color-surface))}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: block))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid}}}\n/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "ngmodule", type: AXLoadingModule }, { kind: "component", type: i1$2.AXLoadingComponent, selector: "ax-loading", inputs: ["visible", "type", "context"], outputs: ["visibleChange"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "component", type: AXMPpeItemCardComponent, selector: "axm-ppe-item-card", inputs: ["item", "look", "selected", "disabled", "readonly", "showControl"], outputs: ["selectedChange"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: i2$1.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
125
125
|
}
|
|
126
126
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMPpeItemViewerComponent, decorators: [{
|
|
127
127
|
type: Component,
|
|
128
128
|
args: [{ selector: 'axm-ppe-item-viewer', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [AsyncPipe, AXLoadingModule, AXTranslationModule, AXMPpeItemCardComponent], host: {
|
|
129
129
|
class: 'axm-ppe-item-viewer block w-full',
|
|
130
|
-
}, template: "@if (loading()) {\n <!-- ----- Loading indicator while configured PPE items are fetched ----- -->\n <ax-loading></ax-loading>\n}\n<!-- ----- Empty state when no PPE items are configured ----- -->\n@else if (items().length === 0) {\n <p class=\"axm-ppe-item-viewer__empty\">\n {{ '@workplacesafety-management:ppe-items.components.ppe-item-viewer.empty' | translate | async }}\n </p>\n}\n<!-- ----- PPE items in card grid or checklist list ----- -->\n@else {\n <div\n class=\"axm-ppe-item-viewer__items\"\n [class.axm-ppe-item-viewer__items--card]=\"look() === 'card'\"\n [class.axm-ppe-item-viewer__items--list]=\"look() === 'list'\"\n >\n @for (item of items(); track item.id) {\n <axm-ppe-item-card\n [item]=\"item\"\n [look]=\"look()\"\n [selected]=\"isSelected(item.id)\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [showControl]=\"showControl()\"\n (selectedChange)=\"onItemSelectedChange(item.id, $event)\"\n />\n }\n </div>\n}\n", styles: ["@layer properties;.axm-ppe-item-viewer{width:100%}.axm-ppe-item-viewer .axm-ppe-item-viewer__empty{margin:0;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-ppe-item-viewer .axm-ppe-item-viewer__empty{color:color-mix(in oklab,rgba(var(--ax-sys-color-text-default)) 80%,transparent)}}.axm-ppe-item-viewer .axm-ppe-item-viewer__items--card{display:grid;grid-template-columns:repeat(auto-fill,minmax(9.5rem,1fr));width:100%;gap:calc(var(--spacing, .25rem) * 3)}.axm-ppe-item-viewer .axm-ppe-item-viewer__items--list{display:flex;width:100%;flex-direction:column}.axm-ppe-item-viewer .axm-ppe-item-viewer__items--list>*+*{border-top-style:var(--tw-border-style);border-top-width:1px;border-color:rgba(var(--ax-sys-color-surface))}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim:
|
|
130
|
+
}, template: "@if (loading()) {\n <!-- ----- Loading indicator while configured PPE items are fetched ----- -->\n <ax-loading></ax-loading>\n}\n<!-- ----- Empty state when no PPE items are configured ----- -->\n@else if (items().length === 0) {\n <p class=\"axm-ppe-item-viewer__empty\">\n {{ '@workplacesafety-management:ppe-items.components.ppe-item-viewer.empty' | translate | async }}\n </p>\n}\n<!-- ----- PPE items in card grid or checklist list ----- -->\n@else {\n <div\n class=\"axm-ppe-item-viewer__items\"\n [class.axm-ppe-item-viewer__items--card]=\"look() === 'card'\"\n [class.axm-ppe-item-viewer__items--list]=\"look() === 'list'\"\n >\n @for (item of items(); track item.id) {\n <axm-ppe-item-card\n [item]=\"item\"\n [look]=\"look()\"\n [selected]=\"isSelected(item.id)\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [showControl]=\"showControl()\"\n (selectedChange)=\"onItemSelectedChange(item.id, $event)\"\n />\n }\n </div>\n}\n", styles: ["@layer properties;.axm-ppe-item-viewer{width:100%}.axm-ppe-item-viewer .axm-ppe-item-viewer__empty{margin:0;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-ppe-item-viewer .axm-ppe-item-viewer__empty{color:color-mix(in oklab,rgba(var(--ax-sys-color-text-default)) 80%,transparent)}}.axm-ppe-item-viewer .axm-ppe-item-viewer__items--card{display:grid;grid-template-columns:repeat(auto-fill,minmax(9.5rem,1fr));width:100%;gap:calc(var(--spacing, .25rem) * 3)}.axm-ppe-item-viewer .axm-ppe-item-viewer__items--list{display:flex;width:100%;flex-direction:column}.axm-ppe-item-viewer .axm-ppe-item-viewer__items--list>*+*{border-top-style:var(--tw-border-style);border-top-width:1px;border-color:rgba(var(--ax-sys-color-surface))}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: block))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid}}}\n/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */\n"] }]
|
|
131
131
|
}], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], layout: [{ type: i0.Input, args: [{ isSignal: true, alias: "layout", required: false }] }], selectedIds: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedIds", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], showControl: [{ type: i0.Input, args: [{ isSignal: true, alias: "showControl", required: false }] }], selectedIdsChange: [{ type: i0.Output, args: ["selectedIdsChange"] }] } });
|
|
132
132
|
|
|
133
133
|
//#region ----- Imports -----
|
|
@@ -218,4 +218,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
218
218
|
}] });
|
|
219
219
|
|
|
220
220
|
export { AXMPpeItemViewerService as A, AXMPpeItemViewerComponent as a };
|
|
221
|
-
//# sourceMappingURL=acorex-platform-module-workplacesafety-management-client-ppe-item-viewer.service-
|
|
221
|
+
//# sourceMappingURL=acorex-platform-module-workplacesafety-management-client-ppe-item-viewer.service-B_TuM6zB.mjs.map
|