@acorex-platform/module-workplacesafety-management-client 2.0.0-next.5 → 2.0.0-next.50
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-CQsOLmlJ.mjs → acorex-platform-module-workplacesafety-management-client-acorex-platform-module-workplacesafety-management-client-WoADykTl.mjs} +12 -12
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-acorex-platform-module-workplacesafety-management-client-CQsOLmlJ.mjs.map → acorex-platform-module-workplacesafety-management-client-acorex-platform-module-workplacesafety-management-client-WoADykTl.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-control-hierarchy-diagram-widget-view.component-eDWG-sJ7.mjs → acorex-platform-module-workplacesafety-management-client-control-hierarchy-diagram-widget-view.component-CplIrmy1.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-control-hierarchy-diagram-widget-view.component-eDWG-sJ7.mjs.map → acorex-platform-module-workplacesafety-management-client-control-hierarchy-diagram-widget-view.component-CplIrmy1.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-control-hierarchy-diagram.component-CfxHwZtH.mjs → acorex-platform-module-workplacesafety-management-client-control-hierarchy-diagram.component-B4Xem1ro.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-control-hierarchy-diagram.component-CfxHwZtH.mjs.map → acorex-platform-module-workplacesafety-management-client-control-hierarchy-diagram.component-B4Xem1ro.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-fill-safety-plan.command-D-m6-mUn.mjs → acorex-platform-module-workplacesafety-management-client-fill-safety-plan.command-MUyZCEGu.mjs} +3 -3
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-fill-safety-plan.command-D-m6-mUn.mjs.map → acorex-platform-module-workplacesafety-management-client-fill-safety-plan.command-MUyZCEGu.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-hydrate-safety-plan-activity-sections-Q2vVYxP-.mjs → acorex-platform-module-workplacesafety-management-client-hydrate-safety-plan-activity-sections-BxVoD0Xb.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-hydrate-safety-plan-activity-sections-Q2vVYxP-.mjs.map → acorex-platform-module-workplacesafety-management-client-hydrate-safety-plan-activity-sections-BxVoD0Xb.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-index-BGIQtdXI.mjs → acorex-platform-module-workplacesafety-management-client-index-x3bUQx1Y.mjs} +3 -3
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-index-BGIQtdXI.mjs.map → acorex-platform-module-workplacesafety-management-client-index-x3bUQx1Y.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-load-safety-plan-preview-structure-DgfDb0uz.mjs → acorex-platform-module-workplacesafety-management-client-load-safety-plan-preview-structure-B2GOM4uJ.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-load-safety-plan-preview-structure-DgfDb0uz.mjs.map → acorex-platform-module-workplacesafety-management-client-load-safety-plan-preview-structure-B2GOM4uJ.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-B5qY_1PI.mjs} +3 -3
- 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-B5qY_1PI.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-preview-safety-plan.command-CqJHTLNq.mjs → acorex-platform-module-workplacesafety-management-client-preview-safety-plan.command-BqRFFXZO.mjs} +3 -3
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-preview-safety-plan.command-CqJHTLNq.mjs.map → acorex-platform-module-workplacesafety-management-client-preview-safety-plan.command-BqRFFXZO.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-safety-plan-preview-modal.component-B9lElhxc.mjs → acorex-platform-module-workplacesafety-management-client-safety-plan-preview-modal.component-DNeDu1Q8.mjs} +3 -3
- package/fesm2022/{acorex-platform-module-workplacesafety-management-client-safety-plan-preview-modal.component-B9lElhxc.mjs.map → acorex-platform-module-workplacesafety-management-client-safety-plan-preview-modal.component-DNeDu1Q8.mjs.map} +1 -1
- package/fesm2022/acorex-platform-module-workplacesafety-management-client.mjs +1 -1
- package/package.json +2 -2
|
@@ -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
3
|
import { s as safetyPlanSectionsToBuilderValue } from './acorex-platform-module-workplacesafety-management-client-safety-plan-section-builder.types-C0SEJsVM.mjs';
|
|
4
|
-
import { h as hydrateSafetyPlanActivitySectionsForPreview } from './acorex-platform-module-workplacesafety-management-client-hydrate-safety-plan-activity-sections-
|
|
4
|
+
import { h as hydrateSafetyPlanActivitySectionsForPreview } from './acorex-platform-module-workplacesafety-management-client-hydrate-safety-plan-activity-sections-BxVoD0Xb.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-B2GOM4uJ.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-workplacesafety-management-client-load-safety-plan-preview-structure-DgfDb0uz.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,EAAG,UAAU,CAAC,MAAM,CAAC,IAAI,CAAA,CAAA,EAAI,UAAU,CAAC,QAAQ,CAAC,iBAAiB,CAAC,IAAI,EAAE;AAC5G,MAAM,mBAAmB,GAA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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-B2GOM4uJ.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":";;;;;A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AAI,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;;"}
|
|
@@ -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.3 | 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.3 | 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-B5qY_1PI.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-B5qY_1PI.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,Q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|
import { inject, Injectable } from '@angular/core';
|
|
6
6
|
import { get, isString, isEmpty, defaultTo } from 'lodash';
|
|
7
|
-
import { A as AXMSafetyPlanPreviewService } from './acorex-platform-module-workplacesafety-management-client-hydrate-safety-plan-activity-sections-
|
|
7
|
+
import { A as AXMSafetyPlanPreviewService } from './acorex-platform-module-workplacesafety-management-client-hydrate-safety-plan-activity-sections-BxVoD0Xb.mjs';
|
|
8
8
|
import { l as loadSafetyPlanFillValues } from './acorex-platform-module-workplacesafety-management-client-safety-plan-fill-values.util-RLOdySf7.mjs';
|
|
9
|
-
import { l as loadSafetyPlanPreviewStructure } from './acorex-platform-module-workplacesafety-management-client-load-safety-plan-preview-structure-
|
|
9
|
+
import { l as loadSafetyPlanPreviewStructure } from './acorex-platform-module-workplacesafety-management-client-load-safety-plan-preview-structure-B2GOM4uJ.mjs';
|
|
10
10
|
|
|
11
11
|
//#region ----- Imports -----
|
|
12
12
|
//#endregion
|
|
@@ -99,4 +99,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
99
99
|
}] });
|
|
100
100
|
|
|
101
101
|
export { AXMPreviewSafetyPlanCommand };
|
|
102
|
-
//# sourceMappingURL=acorex-platform-module-workplacesafety-management-client-preview-safety-plan.command-
|
|
102
|
+
//# sourceMappingURL=acorex-platform-module-workplacesafety-management-client-preview-safety-plan.command-BqRFFXZO.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-workplacesafety-management-client-preview-safety-plan.command-
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-workplacesafety-management-client-preview-safety-plan.command-BqRFFXZO.mjs","sources":["../../../../libs/modules/workplacesafety-management/client/src/lib/features/safety-plan/commands/preview-safety-plan.command.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport { resolveEntityRowDisplayText } from '@acorex-platform/framework-client/common';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport type { AXPCommand, AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXTranslationService, resolveMultiLanguageString } from '@acorex/core/translation';\nimport { Injectable, inject } from '@angular/core';\nimport { defaultTo, get, isEmpty, isString } from 'lodash';\n\nimport { AXMSafetyPlanPreviewService } from '../../safety-plan-preview/safety-plan-preview.service';\nimport { loadSafetyPlanFillValues } from '../../safety-plan-preview/safety-plan-fill-values.util';\nimport { loadSafetyPlanPreviewStructure } from './load-safety-plan-preview-structure';\n\n//#endregion\n\n//#region ----- Types -----\n\nexport interface AXMPreviewSafetyPlanCommandInput {\n id?: string;\n title?: string;\n data?: Record<string, unknown>;\n options?: Partial<AXMPreviewSafetyPlanCommandInput>;\n __context__?: {\n entity?: string;\n data?: { id?: string; title?: unknown };\n options?: { id?: string; title?: unknown };\n };\n}\n\n//#endregion\n\n//#region ----- Command -----\n\n@Injectable()\nexport class AXMPreviewSafetyPlanCommand implements AXPCommand<AXMPreviewSafetyPlanCommandInput, void> {\n //#region ----- Services & Dependencies -----\n\n private readonly entityService = inject(AXPEntityService);\n private readonly translationService = inject(AXTranslationService);\n private readonly previewService = inject(AXMSafetyPlanPreviewService);\n\n //#endregion\n\n //#region ----- Command Implementation -----\n\n async execute(input: AXMPreviewSafetyPlanCommandInput = {}): AXPCommandExecuteResultPromise<void> {\n try {\n const planId = this.resolvePlanId(input);\n if (!planId) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync('@general:messages.entity.invalid-data'),\n },\n };\n }\n\n const structure = await loadSafetyPlanPreviewStructure(\n this.entityService,\n this.translationService,\n planId,\n );\n const fillValues = await loadSafetyPlanFillValues(this.entityService, planId);\n const dialogTitle = await this.resolveDialogTitle(input);\n\n await this.previewService.open({\n title: dialogTitle,\n structure,\n planId,\n fillValues,\n });\n\n return {\n success: true,\n kind: 'object',\n data: undefined,\n metadata: { refresh: false },\n };\n } catch {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync('@general:messages.generic.error.description'),\n },\n };\n }\n }\n\n //#endregion\n\n //#region ----- Utility Methods -----\n\n private resolvePlanId(input: AXMPreviewSafetyPlanCommandInput): string | undefined {\n const context = input.__context__;\n const candidates = [\n input.id,\n input.options?.id,\n get(input, 'options.id'),\n context?.options?.id,\n context?.data?.id,\n input.data?.['id'],\n ];\n\n for (const candidate of candidates) {\n if (isString(candidate) && !isEmpty(candidate.trim())) {\n return candidate.trim();\n }\n }\n\n return undefined;\n }\n\n private async resolveDialogTitle(input: AXMPreviewSafetyPlanCommandInput): Promise<string> {\n const previewLabel =\n (await this.translationService.translateAsync('@general:actions.preview.title')) || 'Preview';\n const locale = this.translationService.getActiveLang?.() ?? 'en-US';\n\n const explicitTitle = defaultTo(\n input.title,\n defaultTo(input.options?.title, defaultTo(get(input, 'options.title'), input.__context__?.options?.title)),\n );\n if (isString(explicitTitle) && explicitTitle.trim().length > 0) {\n return `${previewLabel}: ${resolveMultiLanguageString(explicitTitle, locale).trim()}`;\n }\n\n const contextTitle = defaultTo(input.data?.['title'], input.__context__?.data?.title);\n if (contextTitle != null) {\n const recordTitle = resolveEntityRowDisplayText(contextTitle, locale).trim();\n if (recordTitle.length > 0) {\n return `${previewLabel}: ${recordTitle}`;\n }\n }\n\n return previewLabel;\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;;AAAA;AA6BA;AAEA;MAGa,2BAA2B,CAAA;AADxC,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AACjD,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,2BAA2B,CAAC;AAkGtE,IAAA;;;AA5FC,IAAA,MAAM,OAAO,CAAC,KAAA,GAA0C,EAAE,EAAA;AACxD,QAAA,IAAI;YACF,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC;YACxC,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,IAAI,EAAE;AAC5E,YAAA,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE;AAC1B,gBAAA,OAAO,CAAA,EAAG,YAAY,CAAA,EAAA,EAAK,WAAW,EAAE;YAC1C;QACF;AAEA,QAAA,OAAO,YAAY;IACrB;8GApGW,2BAA2B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAA3B,2BAA2B,EAAA,CAAA,CAAA;;2FAA3B,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBADvC;;;"}
|
|
@@ -9,7 +9,7 @@ import { AsyncPipe } from '@angular/common';
|
|
|
9
9
|
import * as i0 from '@angular/core';
|
|
10
10
|
import { input, ChangeDetectionStrategy, Component, inject, signal, computed, effect, output, ViewEncapsulation } from '@angular/core';
|
|
11
11
|
import { n as normalizeSafetyPlanSectionBuilderValue } from './acorex-platform-module-workplacesafety-management-client-safety-plan-section-builder.types-C0SEJsVM.mjs';
|
|
12
|
-
import { A as AXMControlHierarchyDiagramComponent } from './acorex-platform-module-workplacesafety-management-client-control-hierarchy-diagram.component-
|
|
12
|
+
import { A as AXMControlHierarchyDiagramComponent } from './acorex-platform-module-workplacesafety-management-client-control-hierarchy-diagram.component-B4Xem1ro.mjs';
|
|
13
13
|
import { A as AXMControlHierarchyDiagramService, r as resolveControlHierarchyDiagramViewType } from './acorex-platform-module-workplacesafety-management-client-control-hierarchy-diagram.service-tMrUDnCb.mjs';
|
|
14
14
|
import { A as AXMPpeItemViewerService, a as AXMPpeItemViewerComponent } from './acorex-platform-module-workplacesafety-management-client-ppe-item-viewer.service-BxcGph1I.mjs';
|
|
15
15
|
import { r as resolvePpeItemViewerLayout, e as extractPpeItemIds } from './acorex-platform-module-workplacesafety-management-client-ppe-item-viewer.util-2Kl3_3sg.mjs';
|
|
@@ -423,7 +423,7 @@ class AXMRiskMatrixPreviewComponent {
|
|
|
423
423
|
.build();
|
|
424
424
|
}
|
|
425
425
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMRiskMatrixPreviewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
426
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXMRiskMatrixPreviewComponent, isStandalone: true, selector: "axm-risk-matrix-preview", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "axm-risk-matrix-preview block" }, ngImport: i0, template: "<div class=\"axm-risk-matrix-preview\">\n @if (loading()) {\n <!-- ----- Loading indicator while risk matrix records are fetched ----- -->\n <ax-loading></ax-loading>\n }\n <!-- ----- Empty state when no risk matrices are selected ----- -->\n @else if (matrices().length === 0) {\n <p class=\"__empty\">\n {{ '@workplacesafety-management:safety-plan-sections.preview.empty-items' | translate | async }}\n </p>\n }\n <!-- ----- Selected risk matrices rendered with the RiskMatrix widget ----- -->\n @else {\n <div class=\"__items\">\n @for (item of matrices(); track item.id) {\n <article class=\"__item\">\n <header class=\"__item-header\">\n <h4 class=\"__item-title\">{{ item.title }}</h4>\n <!--->\n <!-- ----- Optional business code after the matrix title ----- -->\n @if (item.code) {\n <span class=\"__code\">({{ item.code }})</span>\n }\n </header>\n <div class=\"__matrix\">\n <axp-layout-renderer [layout]=\"item.layout\" [context]=\"item.context\" mode=\"view\" look=\"container\" />\n </div>\n </article>\n }\n </div>\n }\n</div>\n", styles: ["@layer properties;.axm-risk-matrix-preview{display:block;width:100%}.axm-risk-matrix-preview .__empty{margin:0;color:rgba(var(--ax-sys-color-text-default))}@supports (color: color-mix(in lab,red,red)){.axm-risk-matrix-preview .__empty{color:color-mix(in oklab,rgba(var(--ax-sys-color-text-default)) 80%,transparent)}}.axm-risk-matrix-preview .__items{display:flex;flex-direction:column;gap:calc(var(--spacing, .25rem) * 6)}.axm-risk-matrix-preview .__item{display:flex;flex-direction:column;gap:calc(var(--spacing, .25rem) * 2)}.axm-risk-matrix-preview .__item-header{display:flex;flex-wrap:wrap;align-items:baseline;gap:var(--spacing, .25rem)}.axm-risk-matrix-preview .__item-title{margin:0;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-medium, 500);font-weight:var(--font-weight-medium, 500)}.axm-risk-matrix-preview .__code{color:rgba(var(--ax-sys-color-text-default))}@supports (color: color-mix(in lab,red,red)){.axm-risk-matrix-preview .__code{color:color-mix(in oklab,rgba(var(--ax-sys-color-text-default)) 80%,transparent)}}.axm-risk-matrix-preview .__matrix{width:100%;overflow-x:auto}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-font-weight: initial}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "ngmodule", type: AXLoadingModule }, { kind: "component", type: i1.AXLoadingComponent, selector: "ax-loading", inputs: ["visible", "type", "context"], outputs: ["visibleChange"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "component", type: AXPLayoutRendererComponent, selector: "axp-layout-renderer", inputs: ["layout", "context", "look", "mode"], outputs: ["contextChange", "contextInitiated", "validityChange"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: i2.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
426
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXMRiskMatrixPreviewComponent, isStandalone: true, selector: "axm-risk-matrix-preview", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "axm-risk-matrix-preview block" }, ngImport: i0, template: "<div class=\"axm-risk-matrix-preview\">\n @if (loading()) {\n <!-- ----- Loading indicator while risk matrix records are fetched ----- -->\n <ax-loading></ax-loading>\n }\n <!-- ----- Empty state when no risk matrices are selected ----- -->\n @else if (matrices().length === 0) {\n <p class=\"__empty\">\n {{ '@workplacesafety-management:safety-plan-sections.preview.empty-items' | translate | async }}\n </p>\n }\n <!-- ----- Selected risk matrices rendered with the RiskMatrix widget ----- -->\n @else {\n <div class=\"__items\">\n @for (item of matrices(); track item.id) {\n <article class=\"__item\">\n <header class=\"__item-header\">\n <h4 class=\"__item-title\">{{ item.title }}</h4>\n <!--->\n <!-- ----- Optional business code after the matrix title ----- -->\n @if (item.code) {\n <span class=\"__code\">({{ item.code }})</span>\n }\n </header>\n <div class=\"__matrix\">\n <axp-layout-renderer [layout]=\"item.layout\" [context]=\"item.context\" mode=\"view\" look=\"container\" />\n </div>\n </article>\n }\n </div>\n }\n</div>\n", styles: ["@layer properties;.axm-risk-matrix-preview{display:block;width:100%}.axm-risk-matrix-preview .__empty{margin:0;color:rgba(var(--ax-sys-color-text-default))}@supports (color: color-mix(in lab,red,red)){.axm-risk-matrix-preview .__empty{color:color-mix(in oklab,rgba(var(--ax-sys-color-text-default)) 80%,transparent)}}.axm-risk-matrix-preview .__items{display:flex;flex-direction:column;gap:calc(var(--spacing, .25rem) * 6)}.axm-risk-matrix-preview .__item{display:flex;flex-direction:column;gap:calc(var(--spacing, .25rem) * 2)}.axm-risk-matrix-preview .__item-header{display:flex;flex-wrap:wrap;align-items:baseline;gap:var(--spacing, .25rem)}.axm-risk-matrix-preview .__item-title{margin:0;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-medium, 500);font-weight:var(--font-weight-medium, 500)}.axm-risk-matrix-preview .__code{color:rgba(var(--ax-sys-color-text-default))}@supports (color: color-mix(in lab,red,red)){.axm-risk-matrix-preview .__code{color:color-mix(in oklab,rgba(var(--ax-sys-color-text-default)) 80%,transparent)}}.axm-risk-matrix-preview .__matrix{width:100%;overflow-x:auto}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-font-weight: initial}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "ngmodule", type: AXLoadingModule }, { kind: "component", type: i1.AXLoadingComponent, selector: "ax-loading", inputs: ["visible", "type", "context"], outputs: ["visibleChange"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "component", type: AXPLayoutRendererComponent, selector: "axp-layout-renderer", inputs: ["layout", "context", "look", "mode", "reveal"], outputs: ["contextChange", "contextInitiated", "validityChange", "revealed"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: i2.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
427
427
|
}
|
|
428
428
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMRiskMatrixPreviewComponent, decorators: [{
|
|
429
429
|
type: Component,
|
|
@@ -734,4 +734,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
734
734
|
}], propDecorators: { structure: [{ type: i0.Input, args: [{ isSignal: true, alias: "structure", required: false }] }], workflowActionSet: [{ type: i0.Input, args: [{ isSignal: true, alias: "workflowActionSet", required: false }] }], editable: [{ type: i0.Input, args: [{ isSignal: true, alias: "editable", required: false }] }], planId: [{ type: i0.Input, args: [{ isSignal: true, alias: "planId", required: false }] }], fillValues: [{ type: i0.Input, args: [{ isSignal: true, alias: "fillValues", required: false }] }] } });
|
|
735
735
|
|
|
736
736
|
export { AXMSafetyPlanPreviewModalComponent };
|
|
737
|
-
//# sourceMappingURL=acorex-platform-module-workplacesafety-management-client-safety-plan-preview-modal.component-
|
|
737
|
+
//# sourceMappingURL=acorex-platform-module-workplacesafety-management-client-safety-plan-preview-modal.component-DNeDu1Q8.mjs.map
|