@acorex-platform/module-assessment-management-client 0.0.37 → 0.0.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/{acorex-platform-module-assessment-management-client-acorex-platform-module-assessment-management-client-BcpbQ8TJ.mjs → acorex-platform-module-assessment-management-client-acorex-platform-module-assessment-management-client-rrUYWHvI.mjs} +787 -91
- package/fesm2022/acorex-platform-module-assessment-management-client-acorex-platform-module-assessment-management-client-rrUYWHvI.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-assessment-management-client-assessment-voice.commands-DEcHphg8.mjs → acorex-platform-module-assessment-management-client-assessment-voice.commands-BjWPb92M.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-assessment-management-client-assessment-voice.commands-DEcHphg8.mjs.map → acorex-platform-module-assessment-management-client-assessment-voice.commands-BjWPb92M.mjs.map} +1 -1
- package/fesm2022/acorex-platform-module-assessment-management-client-contracts-entities-assessment-case.mjs +20 -0
- package/fesm2022/acorex-platform-module-assessment-management-client-contracts-entities-assessment-case.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-assessment-management-client-contracts-entities-assessment-session.mjs +20 -0
- package/fesm2022/acorex-platform-module-assessment-management-client-contracts-entities-assessment-session.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-assessment-management-client-contracts-entities-question-bank-item.mjs +20 -0
- package/fesm2022/acorex-platform-module-assessment-management-client-contracts-entities-question-bank-item.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-assessment-management-client-contracts-entities-questionnaire.mjs +243 -212
- package/fesm2022/acorex-platform-module-assessment-management-client-contracts-entities-questionnaire.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-assessment-management-client-contracts-entities-template.mjs +774 -0
- package/fesm2022/acorex-platform-module-assessment-management-client-contracts-entities-template.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-assessment-management-client-contracts-entity-catalog-acorex-platform-module-assessment-management-client-contracts-entity-catalog-B8PJe3IJ.mjs → acorex-platform-module-assessment-management-client-contracts-entity-catalog-acorex-platform-module-assessment-management-client-contracts-entity-catalog-Pa8mdKRV.mjs} +12 -5
- package/fesm2022/acorex-platform-module-assessment-management-client-contracts-entity-catalog-acorex-platform-module-assessment-management-client-contracts-entity-catalog-Pa8mdKRV.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-assessment-management-client-contracts-entity-catalog-assessment-case.entity-DcRzvfKO.mjs → acorex-platform-module-assessment-management-client-contracts-entity-catalog-assessment-case.entity-DJeaqilT.mjs} +16 -2
- package/fesm2022/acorex-platform-module-assessment-management-client-contracts-entity-catalog-assessment-case.entity-DJeaqilT.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-assessment-management-client-contracts-entity-catalog-assessment-pre-post.properties-DX_nB0QM.mjs +229 -0
- package/fesm2022/acorex-platform-module-assessment-management-client-contracts-entity-catalog-assessment-pre-post.properties-DX_nB0QM.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-assessment-management-client-contracts-entity-catalog-assessment-session.entity-Y0FU8X-e.mjs → acorex-platform-module-assessment-management-client-contracts-entity-catalog-assessment-session.entity-BSP4UQ47.mjs} +16 -2
- package/fesm2022/acorex-platform-module-assessment-management-client-contracts-entity-catalog-assessment-session.entity-BSP4UQ47.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-assessment-management-client-contracts-entity-catalog-question-bank-item.entity-CT913OrX.mjs → acorex-platform-module-assessment-management-client-contracts-entity-catalog-question-bank-item.entity-CVgepxbX.mjs} +16 -2
- package/fesm2022/acorex-platform-module-assessment-management-client-contracts-entity-catalog-question-bank-item.entity-CVgepxbX.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-assessment-management-client-contracts-entity-catalog-questionnaire.entity-C4hxiPTX.mjs → acorex-platform-module-assessment-management-client-contracts-entity-catalog-questionnaire.entity-8Dqdbm6i.mjs} +18 -217
- package/fesm2022/acorex-platform-module-assessment-management-client-contracts-entity-catalog-questionnaire.entity-8Dqdbm6i.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-assessment-management-client-contracts-entity-catalog-template.entity-BTDJAnF1.mjs +493 -0
- package/fesm2022/acorex-platform-module-assessment-management-client-contracts-entity-catalog-template.entity-BTDJAnF1.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-assessment-management-client-contracts-entity-catalog.mjs +1 -1
- package/fesm2022/acorex-platform-module-assessment-management-client-contracts.mjs +105 -13
- package/fesm2022/acorex-platform-module-assessment-management-client-contracts.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-assessment-management-client-create-form-template.command-DLC7aazI.mjs +44 -0
- package/fesm2022/acorex-platform-module-assessment-management-client-create-form-template.command-DLC7aazI.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-assessment-management-client-design-form-template.command-Cgc9Inlz.mjs +97 -0
- package/fesm2022/acorex-platform-module-assessment-management-client-design-form-template.command-Cgc9Inlz.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-assessment-management-client-designer.page-COXTLIgc.mjs +45 -0
- package/fesm2022/acorex-platform-module-assessment-management-client-designer.page-COXTLIgc.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-assessment-management-client-fill-assessment-session.command-lHYKxCXo.mjs → acorex-platform-module-assessment-management-client-fill-assessment-session.command-DNDkEL7L.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-assessment-management-client-fill-assessment-session.command-lHYKxCXo.mjs.map → acorex-platform-module-assessment-management-client-fill-assessment-session.command-DNDkEL7L.mjs.map} +1 -1
- package/fesm2022/acorex-platform-module-assessment-management-client-form-template-viewer-popup.component-Cuq6_FfC.mjs +238 -0
- package/fesm2022/acorex-platform-module-assessment-management-client-form-template-viewer-popup.component-Cuq6_FfC.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-assessment-management-client-form-template-viewer.service-BTmeEOAJ.mjs +93 -0
- package/fesm2022/acorex-platform-module-assessment-management-client-form-template-viewer.service-BTmeEOAJ.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-assessment-management-client-local-entities.mjs +1 -0
- package/fesm2022/acorex-platform-module-assessment-management-client-local-entities.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-assessment-management-client-open-form-template.command-Cg2Cnp1-.mjs +55 -0
- package/fesm2022/acorex-platform-module-assessment-management-client-open-form-template.command-Cg2Cnp1-.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-assessment-management-client-preview-form-template.command-CaCFGmlA.mjs +90 -0
- package/fesm2022/acorex-platform-module-assessment-management-client-preview-form-template.command-CaCFGmlA.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-assessment-management-client-preview-question.command-Db64SCn6.mjs → acorex-platform-module-assessment-management-client-preview-question.command-DIRJDBFM.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-assessment-management-client-preview-question.command-Db64SCn6.mjs.map → acorex-platform-module-assessment-management-client-preview-question.command-DIRJDBFM.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-assessment-management-client-preview-questionnaire.command-yOfBbOMK.mjs → acorex-platform-module-assessment-management-client-preview-questionnaire.command-fcYcY10l.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-assessment-management-client-preview-questionnaire.command-yOfBbOMK.mjs.map → acorex-platform-module-assessment-management-client-preview-questionnaire.command-fcYcY10l.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-assessment-management-client-question-bank-interface-editor-widget-edit.component-B9iRaSSF.mjs → acorex-platform-module-assessment-management-client-question-bank-interface-editor-widget-edit.component-DVQZ1A-Q.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-assessment-management-client-question-bank-interface-editor-widget-edit.component-B9iRaSSF.mjs.map → acorex-platform-module-assessment-management-client-question-bank-interface-editor-widget-edit.component-DVQZ1A-Q.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-assessment-management-client-questionnaire-viewer-popup.component-B4JMc6ew.mjs → acorex-platform-module-assessment-management-client-questionnaire-viewer-popup.component-BAA879UA.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-assessment-management-client-questionnaire-viewer-popup.component-B4JMc6ew.mjs.map → acorex-platform-module-assessment-management-client-questionnaire-viewer-popup.component-BAA879UA.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-assessment-management-client-review-assessment-session.command-si6-7hpg.mjs → acorex-platform-module-assessment-management-client-review-assessment-session.command-Dm3i0_Oj.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-assessment-management-client-review-assessment-session.command-si6-7hpg.mjs.map → acorex-platform-module-assessment-management-client-review-assessment-session.command-Dm3i0_Oj.mjs.map} +1 -1
- package/fesm2022/acorex-platform-module-assessment-management-client-template-picker.component-RFv42PnE.mjs +260 -0
- package/fesm2022/acorex-platform-module-assessment-management-client-template-picker.component-RFv42PnE.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-assessment-management-client-template-widget-edit.component-DpndNC_y.mjs +107 -0
- package/fesm2022/acorex-platform-module-assessment-management-client-template-widget-edit.component-DpndNC_y.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-assessment-management-client-view-session-answers.command-BUMtj_L6.mjs → acorex-platform-module-assessment-management-client-view-session-answers.command-4Y3C8W4k.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-assessment-management-client-view-session-answers.command-BUMtj_L6.mjs.map → acorex-platform-module-assessment-management-client-view-session-answers.command-4Y3C8W4k.mjs.map} +1 -1
- package/fesm2022/acorex-platform-module-assessment-management-client.mjs +1 -1
- package/package.json +7 -3
- package/types/acorex-platform-module-assessment-management-client-contracts-entities-template.d.ts +5 -0
- package/types/acorex-platform-module-assessment-management-client-contracts.d.ts +139 -13
- package/types/acorex-platform-module-assessment-management-client.d.ts +3 -2
- package/fesm2022/acorex-platform-module-assessment-management-client-acorex-platform-module-assessment-management-client-BcpbQ8TJ.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-assessment-management-client-contracts-entity-catalog-acorex-platform-module-assessment-management-client-contracts-entity-catalog-B8PJe3IJ.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-assessment-management-client-contracts-entity-catalog-assessment-case.entity-DcRzvfKO.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-assessment-management-client-contracts-entity-catalog-assessment-session.entity-Y0FU8X-e.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-assessment-management-client-contracts-entity-catalog-question-bank-item.entity-CT913OrX.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-assessment-management-client-contracts-entity-catalog-questionnaire.entity-C4hxiPTX.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-assessment-management-client-form-template-viewer-popup.component-Cuq6_FfC.mjs","sources":["../../../../libs/modules/assessment-management/client/src/lib/features/form-template/viewer/pages/form-template-viewer-popup/form-template-viewer-popup.component.ts","../../../../libs/modules/assessment-management/client/src/lib/features/form-template/viewer/pages/form-template-viewer-popup/form-template-viewer-popup.component.html"],"sourcesContent":["//#region ----- Imports -----\n\nimport { AXButtonModule } from '@acorex/components/button';\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport { AXFormComponent, AXFormModule } from '@acorex/components/form';\nimport { AXBasePageComponent } from '@acorex/components/page';\nimport { AXTranslationModule, AXTranslationService, resolveMultiLanguageString } from '@acorex/core/translation';\nimport { DomSanitizer, type SafeHtml } from '@angular/platform-browser';\nimport {\n AXP_LOCAL_DATA_SOURCE_STORE,\n AXPWidgetCoreModule,\n createReadonlyLocalDataSourceStore,\n readLocalDataSourcesFromNode,\n} from '@acorex-platform/framework-client/layout/widget-core';\nimport { AXPContextChangeEvent, AXPWidgetsCatalog, type AXPWidgetNode } from '@acorex-platform/framework-shared/core';\nimport type {\n PrePostConfig,\n QuestionnaireBuilderValue,\n} from '@acorex-platform/module-assessment-management-client/contracts';\nimport { CommonModule } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n inject,\n Input,\n signal,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport { AXMPreQuestionnaireContentComponent } from '../../../../questionnaire-viewer/components/pre-questionnaire-content';\nimport { AXMPostQuestionnaireContentComponent } from '../../../../questionnaire-viewer/components/post-questionnaire-content';\nimport { AXMQuestionnaireViewerService } from '../../../../questionnaire-viewer/questionnaire-viewer.service';\nimport {\n resolveSummaryPlaceholders,\n type SummaryPlaceholderValues,\n} from '../../../../questionnaire-viewer/utils/pre-post-content.utils';\nimport type { AXMFormTemplateViewerConfig, AXMFormTemplateViewerResult } from '../../form-template-viewer.types';\n\n//#endregion\n\n//#region ----- Types -----\n\ntype FormFlowStep = 'pre' | 'form' | 'review' | 'results' | 'summary';\n\nconst EMPTY_OUTCOME_STRUCTURE: QuestionnaireBuilderValue = { sections: [] };\n\n//#endregion\n\n//#region ----- Component -----\n\n@Component({\n selector: 'axm-form-template-viewer-popup',\n templateUrl: './form-template-viewer-popup.component.html',\n styleUrl: './form-template-viewer-popup.component.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [\n CommonModule,\n AXTranslationModule,\n AXButtonModule,\n AXDecoratorModule,\n AXFormModule,\n AXPWidgetCoreModule,\n AXMPreQuestionnaireContentComponent,\n AXMPostQuestionnaireContentComponent,\n ],\n providers: [\n {\n provide: AXP_LOCAL_DATA_SOURCE_STORE,\n useFactory: (host: AXMFormTemplateViewerPopupComponent) =>\n createReadonlyLocalDataSourceStore(() => host.sources()),\n deps: [AXMFormTemplateViewerPopupComponent],\n },\n ],\n})\nexport class AXMFormTemplateViewerPopupComponent extends AXBasePageComponent {\n //#region ----- Services & Dependencies -----\n\n private readonly questionnaireViewerService = inject(AXMQuestionnaireViewerService);\n private readonly translationService = inject(AXTranslationService);\n private readonly sanitizer = inject(DomSanitizer);\n private readonly formRef = viewChild<AXFormComponent>('form');\n\n //#endregion\n\n //#region ----- Inputs -----\n\n @Input() set config(value: AXMFormTemplateViewerConfig | undefined) {\n this._config.set(value);\n }\n\n //#endregion\n\n //#region ----- State Signals -----\n\n protected readonly _config = signal<AXMFormTemplateViewerConfig | undefined>(undefined);\n protected readonly flowStep = signal<FormFlowStep>('form');\n protected readonly submitResult = signal<SummaryPlaceholderValues | null>(null);\n protected readonly isSubmitting = signal(false);\n protected readonly document = signal({ type: AXPWidgetsCatalog.document } as AXPWidgetNode);\n protected readonly currentPageIndex = signal(0);\n private readonly initialFlowApplied = signal(false);\n private readonly templateLoaded = signal(false);\n\n protected context: Record<string, unknown> = {};\n\n readonly sources = computed(() => readLocalDataSourcesFromNode(this.document()));\n\n protected readonly currentPage = computed(\n () => this.document().children?.[this.currentPageIndex()] ?? ({ type: AXPWidgetsCatalog.pageLayout } as AXPWidgetNode),\n );\n\n protected readonly prePostConfig = computed((): PrePostConfig | null => this._config()?.prePostConfig ?? null);\n\n protected readonly widgetMode = computed(() =>\n this._config()?.readOnly || this.flowStep() === 'review' ? 'view' : 'edit',\n );\n\n protected readonly showReviewButton = computed(\n () => this.flowStep() === 'form' && !this._config()?.readOnly && this.prePostConfig()?.post?.reviewEnabled === true,\n );\n\n protected readonly showSubmitButton = computed(\n () => this.flowStep() === 'form' && !this._config()?.readOnly && !this.showReviewButton(),\n );\n\n protected readonly isPreviewMode = computed(() => this._config()?.previewMode === true);\n\n protected readonly submitActionLabel = computed(() =>\n this.isPreviewMode()\n ? '@form-template-management:templates.viewer.preview.finish.title'\n : '@general:actions.submit.title',\n );\n\n /** Summary rich text with outcome placeholders. Empty author content stays blank. */\n protected readonly summaryHtml = computed((): SafeHtml | '' => {\n const content = this.prePostConfig()?.post?.summaryContent;\n const locale = this.translationService.getActiveLang?.() ?? 'en-US';\n let resolved = resolveMultiLanguageString(content, locale);\n const values = this.submitResult();\n if (resolved && values) {\n resolved = resolveSummaryPlaceholders(resolved, values);\n }\n return resolved ? this.sanitizer.bypassSecurityTrustHtml(resolved) : '';\n });\n\n //#endregion\n\n //#region ----- Lifecycle -----\n\n constructor() {\n super();\n effect(() => {\n const cfg = this._config();\n if (!cfg) {\n return;\n }\n if (!this.templateLoaded()) {\n this.loadTemplate(cfg);\n this.templateLoaded.set(true);\n }\n if (!this.initialFlowApplied()) {\n this.flowStep.set(cfg.prePostConfig?.pre?.enabled === true ? 'pre' : 'form');\n this.initialFlowApplied.set(true);\n }\n });\n }\n\n //#endregion\n\n //#region ----- Event Handlers -----\n\n protected handleContextChanged(event: AXPContextChangeEvent): void {\n this.context = event.data ?? {};\n }\n\n protected handleCancel(): void {\n this.finish(true);\n }\n\n protected handleStart(): void {\n this.flowStep.set('form');\n }\n\n protected handleEdit(): void {\n this.flowStep.set('form');\n }\n\n protected async handleReviewClick(): Promise<void> {\n if (!(await this.validateForm())) {\n return;\n }\n this.flowStep.set('review');\n }\n\n protected async handleSubmitClick(): Promise<void> {\n if (this.flowStep() === 'form' && !(await this.validateForm())) {\n return;\n }\n await this.advanceAfterSubmit();\n }\n\n protected handleResultsNext(): void {\n if (this.prePostConfig()?.post?.summaryEnabled) {\n this.flowStep.set('summary');\n return;\n }\n this.finish(false);\n }\n\n protected handleDone(): void {\n this.finish(false);\n }\n\n //#endregion\n\n //#region ----- Template Loading -----\n\n private loadTemplate(config: AXMFormTemplateViewerConfig): void {\n let templateData: AXPWidgetNode;\n if (typeof config.template === 'string') {\n try {\n templateData = JSON.parse(config.template) as AXPWidgetNode;\n } catch (error) {\n console.error('Failed to parse form template JSON:', error);\n return;\n }\n } else {\n templateData = config.template;\n }\n this.document.set(templateData);\n if (config.context) {\n this.context = { ...config.context };\n }\n }\n\n //#endregion\n\n //#region ----- Submit Flow -----\n\n private async validateForm(): Promise<boolean> {\n const form = this.formRef();\n if (!form) {\n return false;\n }\n const formResult = await form.validate();\n return formResult.result === true;\n }\n\n private async advanceAfterSubmit(): Promise<void> {\n if (this.isSubmitting()) {\n return;\n }\n this.isSubmitting.set(true);\n try {\n const rules = this._config()?.outcomeRules ?? [];\n const post = this.prePostConfig()?.post;\n let placeholders: SummaryPlaceholderValues | null = null;\n if (rules.length > 0) {\n placeholders = await this.questionnaireViewerService.buildSummaryPlaceholderValues(\n EMPTY_OUTCOME_STRUCTURE,\n this.context,\n { outcomeRules: rules },\n );\n }\n this.submitResult.set(placeholders);\n if (post?.showOutcomeResults) {\n this.flowStep.set('results');\n return;\n }\n if (post?.summaryEnabled) {\n this.flowStep.set('summary');\n return;\n }\n this.finish(false);\n } finally {\n this.isSubmitting.set(false);\n }\n }\n\n private finish(cancelled: boolean): void {\n const result: AXMFormTemplateViewerResult = {\n context: this.context,\n cancelled,\n metadata: this._config()?.metadata,\n };\n this.close(result);\n }\n\n //#endregion\n}\n\n//#endregion\n","<div\n class=\"__content-area flex flex-1 min-h-0 flex-col\"\n [class.overflow-hidden]=\"flowStep() === 'form' || flowStep() === 'review'\"\n [class.overflow-y-auto]=\"flowStep() !== 'form' && flowStep() !== 'review'\"\n>\n <!-- ----- Welcome content before the form ----- -->\n @if (flowStep() === 'pre') {\n <axm-pre-questionnaire-content [content]=\"prePostConfig()?.pre?.content\"></axm-pre-questionnaire-content>\n }\n <!-- ----- Outcome results after submit ----- -->\n @else if (flowStep() === 'results') {\n <axm-post-questionnaire-content mode=\"results\" [placeholderValues]=\"submitResult()\"></axm-post-questionnaire-content>\n }\n <!-- ----- Summary content after submit ----- -->\n @else if (flowStep() === 'summary') {\n <div class=\"flex flex-col items-center justify-center p-8 min-h-[200px] text-on-surface\">\n <div class=\"max-w-2xl w-full prose text-on-surface\" [innerHTML]=\"summaryHtml()\"></div>\n </div>\n }\n <!-- ----- Form body, including readonly review ----- -->\n @else {\n <!-- ----- Review heading while the filled form is shown read-only ----- -->\n @if (flowStep() === 'review') {\n <div class=\"p-4 border-b border-surface\">\n <h2 class=\"text-lg font-semibold text-on-surface\">\n {{ '@form-template-management:templates.viewer.flow.review-title' | translate | async }}\n </h2>\n </div>\n }\n <div class=\"flex flex-1 min-h-0 flex-col overflow-y-auto overflow-x-hidden p-4\">\n <ax-form #form>\n <axp-widgets-container [context]=\"context\" (onContextChanged)=\"handleContextChanged($event)\">\n <ng-container axp-widget-renderer [node]=\"currentPage()\" [mode]=\"widgetMode()\"></ng-container>\n </axp-widgets-container>\n </ax-form>\n </div>\n }\n</div>\n\n<ax-footer class=\"__popup-footer flex-shrink-0 border-t px-4 py-3\">\n <ax-suffix>\n <!-- ----- Welcome step ----- -->\n @if (flowStep() === 'pre') {\n <ax-button\n [text]=\"'@general:actions.cancel.title' | translate | async\"\n (onClick)=\"handleCancel()\"\n ></ax-button>\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"'@form-template-management:templates.viewer.flow.start' | translate | async\"\n (onClick)=\"handleStart()\"\n ></ax-button>\n }\n <!-- ----- Fill step ----- -->\n @else if (flowStep() === 'form') {\n <ax-button\n [text]=\"'@general:actions.cancel.title' | translate | async\"\n (onClick)=\"handleCancel()\"\n ></ax-button>\n <!-- ----- Review before submit when post review is enabled ----- -->\n @if (showReviewButton()) {\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"'@form-template-management:templates.viewer.flow.review' | translate | async\"\n [disabled]=\"isSubmitting()\"\n (onClick)=\"handleReviewClick()\"\n ></ax-button>\n }\n <!-- ----- Submit when review is off ----- -->\n @else if (showSubmitButton()) {\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"submitActionLabel() | translate | async\"\n [disabled]=\"isSubmitting()\"\n (onClick)=\"handleSubmitClick()\"\n ></ax-button>\n }\n }\n <!-- ----- Review step ----- -->\n @else if (flowStep() === 'review') {\n <ax-button\n look=\"outline\"\n [text]=\"'@form-template-management:templates.viewer.flow.edit' | translate | async\"\n (onClick)=\"handleEdit()\"\n ></ax-button>\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"submitActionLabel() | translate | async\"\n [disabled]=\"isSubmitting()\"\n (onClick)=\"handleSubmitClick()\"\n ></ax-button>\n }\n <!-- ----- Outcome results step ----- -->\n @else if (flowStep() === 'results') {\n <!-- ----- Continue to the summary when it is enabled ----- -->\n @if (prePostConfig()?.post?.summaryEnabled) {\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"'@general:actions.next.title' | translate | async\"\n (onClick)=\"handleResultsNext()\"\n ></ax-button>\n }\n <!-- ----- Close when there is no summary step ----- -->\n @else {\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"'@form-template-management:templates.viewer.flow.done' | translate | async\"\n (onClick)=\"handleDone()\"\n ></ax-button>\n }\n }\n <!-- ----- Summary step ----- -->\n @else if (flowStep() === 'summary') {\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"'@form-template-management:templates.viewer.flow.done' | translate | async\"\n (onClick)=\"handleDone()\"\n ></ax-button>\n }\n </ax-suffix>\n</ax-footer>\n"],"names":["i3","i4","i5","i6"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AA8CA,MAAM,uBAAuB,GAA8B,EAAE,QAAQ,EAAE,EAAE,EAAE;AAE3E;AAEA;AA2BM,MAAO,mCAAoC,SAAQ,mBAAmB,CAAA;;;IAY1E,IAAa,MAAM,CAAC,KAA8C,EAAA;AAChE,QAAA,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC;IACzB;;;AA6DA,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;;AAzEQ,QAAA,IAAA,CAAA,0BAA0B,GAAG,MAAM,CAAC,6BAA6B,CAAC;AAClE,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AACjD,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,YAAY,CAAC;QAChC,IAAA,CAAA,OAAO,GAAG,SAAS,CAAkB,MAAM;oFAAC;;;QAc1C,IAAA,CAAA,OAAO,GAAG,MAAM,CAA0C,SAAS;oFAAC;QACpE,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAe,MAAM;qFAAC;QACvC,IAAA,CAAA,YAAY,GAAG,MAAM,CAAkC,IAAI;yFAAC;QAC5D,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,KAAK;yFAAC;QAC5B,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,EAAE,IAAI,EAAE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AA,EAGzB,uBAAuB,CAAC,MAAM,iBAChC,iBAAiB,CAAC,IAAI,EAAA,OAAA,EAC5B;wBACP,YAAY;wBACZ,mBAAmB;wBACnB,cAAc;wBACd,iBAAiB;wBACjB,YAAY;wBACZ,mBAAmB;wBACnB,mCAAmC;wBACnC,oCAAoC;qBACrC,EAAA,SAAA,EACU;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,2BAA2B;AACpC,4BAAA,UAAU,EAAE,CAAC,IAAyC,KACpD,kCAAkC,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;AAC1D,4BAAA,IAAI,EAAE,CAAA,mCAAA,CAAqC;AAC5C,yBAAA;AACF,qBAAA,EAAA,QAAA,EAAA,21JAAA,EAAA,MAAA,EAAA,CAAA,yVAAA,CAAA,EAAA;+FAQqD,MAAM,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA;sBAM3D;;;"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { AXPopupService } from '@acorex/components/popup';
|
|
2
|
+
import { AXTranslationService } from '@acorex/core/translation';
|
|
3
|
+
import { AXPDeviceService } from '@acorex-platform/framework-client/core';
|
|
4
|
+
import { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';
|
|
5
|
+
import { AXPWidgetsCatalog } from '@acorex-platform/framework-shared/core';
|
|
6
|
+
import { RootConfig, toPrePostConfig, flattenQuestionnaireOutcomeItems } from '@acorex-platform/module-assessment-management-client/contracts';
|
|
7
|
+
import * as i0 from '@angular/core';
|
|
8
|
+
import { inject, Injectable } from '@angular/core';
|
|
9
|
+
import { f as formatQuestionnairePreviewDialogTitle } from './acorex-platform-module-assessment-management-client-acorex-platform-module-assessment-management-client-rrUYWHvI.mjs';
|
|
10
|
+
|
|
11
|
+
//#region ----- Imports -----
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region ----- Service -----
|
|
14
|
+
/**
|
|
15
|
+
* Opens a form template in the same pre → form → review → results → summary flow as questionnaires.
|
|
16
|
+
*/
|
|
17
|
+
class AXMFormTemplateViewerService {
|
|
18
|
+
constructor() {
|
|
19
|
+
//#region ----- Services & Dependencies -----
|
|
20
|
+
this.popupService = inject(AXPopupService);
|
|
21
|
+
this.entityService = inject(AXPEntityService);
|
|
22
|
+
this.translationService = inject(AXTranslationService);
|
|
23
|
+
this.deviceService = inject(AXPDeviceService);
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region ----- Public Methods -----
|
|
27
|
+
async open(input) {
|
|
28
|
+
let templateData = input.template;
|
|
29
|
+
let title;
|
|
30
|
+
let prePostConfig = null;
|
|
31
|
+
let outcomeRules = [];
|
|
32
|
+
if (input.id) {
|
|
33
|
+
const item = await this.entityService
|
|
34
|
+
.withEntity(RootConfig.module.name, RootConfig.entities.template.name)
|
|
35
|
+
.data()
|
|
36
|
+
.byKey(input.id);
|
|
37
|
+
if (!item) {
|
|
38
|
+
return 'not-found';
|
|
39
|
+
}
|
|
40
|
+
templateData = item.template ?? '';
|
|
41
|
+
title = item.title?.trim() || undefined;
|
|
42
|
+
prePostConfig = toPrePostConfig({ pre: item.pre, post: item.post });
|
|
43
|
+
outcomeRules = flattenQuestionnaireOutcomeItems(item.outcomes);
|
|
44
|
+
}
|
|
45
|
+
if (!templateData) {
|
|
46
|
+
if (!input.id) {
|
|
47
|
+
return 'missing';
|
|
48
|
+
}
|
|
49
|
+
templateData = JSON.stringify({
|
|
50
|
+
type: AXPWidgetsCatalog.document,
|
|
51
|
+
children: [{ type: AXPWidgetsCatalog.pageLayout }],
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
const fallbackTitle = (await this.translationService.translateAsync('@form-template-management:templates.viewer.title')) || 'Form';
|
|
55
|
+
const displayTitle = input.title?.trim() || title;
|
|
56
|
+
const popupTitle = input.previewMode
|
|
57
|
+
? formatQuestionnairePreviewDialogTitle((await this.translationService.translateAsync('@form-template-management:templates.entities.template.actions.preview.title')) || 'Preview', displayTitle)
|
|
58
|
+
: displayTitle || fallbackTitle;
|
|
59
|
+
const { AXMFormTemplateViewerPopupComponent } = await import('./acorex-platform-module-assessment-management-client-form-template-viewer-popup.component-Cuq6_FfC.mjs');
|
|
60
|
+
const config = {
|
|
61
|
+
template: templateData,
|
|
62
|
+
title,
|
|
63
|
+
prePostConfig,
|
|
64
|
+
outcomeRules,
|
|
65
|
+
context: input.context ?? {},
|
|
66
|
+
metadata: input.metadata,
|
|
67
|
+
readOnly: input.readOnly === true,
|
|
68
|
+
previewMode: input.previewMode === true,
|
|
69
|
+
};
|
|
70
|
+
const result = await this.popupService.open(AXMFormTemplateViewerPopupComponent, {
|
|
71
|
+
title: popupTitle,
|
|
72
|
+
size: this.deviceService.isSmall() ? 'full' : 'lg',
|
|
73
|
+
closeButton: false,
|
|
74
|
+
closeOnBackdropClick: false,
|
|
75
|
+
draggable: false,
|
|
76
|
+
data: { config },
|
|
77
|
+
});
|
|
78
|
+
return (result?.data ?? {
|
|
79
|
+
context: input.context ?? {},
|
|
80
|
+
cancelled: true,
|
|
81
|
+
metadata: input.metadata,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMFormTemplateViewerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
85
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMFormTemplateViewerService, providedIn: 'root' }); }
|
|
86
|
+
}
|
|
87
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMFormTemplateViewerService, decorators: [{
|
|
88
|
+
type: Injectable,
|
|
89
|
+
args: [{ providedIn: 'root' }]
|
|
90
|
+
}] });
|
|
91
|
+
|
|
92
|
+
export { AXMFormTemplateViewerService as A };
|
|
93
|
+
//# sourceMappingURL=acorex-platform-module-assessment-management-client-form-template-viewer.service-BTmeEOAJ.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-assessment-management-client-form-template-viewer.service-BTmeEOAJ.mjs","sources":["../../../../libs/modules/assessment-management/client/src/lib/features/form-template/viewer/form-template-viewer.service.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport { AXPopupService } from '@acorex/components/popup';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPDeviceService } from '@acorex-platform/framework-client/core';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPWidgetsCatalog, type AXPMetaData } from '@acorex-platform/framework-shared/core';\nimport {\n flattenQuestionnaireOutcomeItems,\n RootConfig,\n toPrePostConfig,\n type AXMFormTemplateDetailDto,\n} from '@acorex-platform/module-assessment-management-client/contracts';\nimport { inject, Injectable } from '@angular/core';\nimport { formatQuestionnairePreviewDialogTitle } from '../../questionnaire-viewer/utils/questionnaire-preview-title.util';\nimport type {\n AXMFormTemplateViewerConfig,\n AXMFormTemplateViewerOpenStatus,\n AXMFormTemplateViewerResult,\n} from './form-template-viewer.types';\n\n//#endregion\n\n//#region ----- Service -----\n\n/**\n * Opens a form template in the same pre → form → review → results → summary flow as questionnaires.\n */\n@Injectable({ providedIn: 'root' })\nexport class AXMFormTemplateViewerService {\n //#region ----- Services & Dependencies -----\n\n private readonly popupService = inject(AXPopupService);\n private readonly entityService = inject(AXPEntityService);\n private readonly translationService = inject(AXTranslationService);\n private readonly deviceService = inject(AXPDeviceService);\n\n //#endregion\n\n //#region ----- Public Methods -----\n\n async open(input: {\n id?: string;\n template?: string;\n title?: string;\n metadata?: AXPMetaData;\n readOnly?: boolean;\n previewMode?: boolean;\n context?: Record<string, unknown>;\n }): Promise<AXMFormTemplateViewerResult | AXMFormTemplateViewerOpenStatus> {\n let templateData = input.template;\n let title: string | undefined;\n let prePostConfig = null as AXMFormTemplateViewerConfig['prePostConfig'];\n let outcomeRules: AXMFormTemplateViewerConfig['outcomeRules'] = [];\n\n if (input.id) {\n const item = await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.template.name)\n .data<string, AXMFormTemplateDetailDto>()\n .byKey(input.id);\n if (!item) {\n return 'not-found';\n }\n templateData = item.template ?? '';\n title = item.title?.trim() || undefined;\n prePostConfig = toPrePostConfig({ pre: item.pre, post: item.post });\n outcomeRules = flattenQuestionnaireOutcomeItems(item.outcomes);\n }\n\n if (!templateData) {\n if (!input.id) {\n return 'missing';\n }\n templateData = JSON.stringify({\n type: AXPWidgetsCatalog.document,\n children: [{ type: AXPWidgetsCatalog.pageLayout }],\n });\n }\n\n const fallbackTitle =\n (await this.translationService.translateAsync('@form-template-management:templates.viewer.title')) || 'Form';\n const displayTitle = input.title?.trim() || title;\n const popupTitle = input.previewMode\n ? formatQuestionnairePreviewDialogTitle(\n (await this.translationService.translateAsync(\n '@form-template-management:templates.entities.template.actions.preview.title',\n )) || 'Preview',\n displayTitle,\n )\n : displayTitle || fallbackTitle;\n\n const { AXMFormTemplateViewerPopupComponent } = await import(\n './pages/form-template-viewer-popup/form-template-viewer-popup.component'\n );\n\n const config: AXMFormTemplateViewerConfig = {\n template: templateData,\n title,\n prePostConfig,\n outcomeRules,\n context: input.context ?? {},\n metadata: input.metadata,\n readOnly: input.readOnly === true,\n previewMode: input.previewMode === true,\n };\n\n const result = await this.popupService.open(AXMFormTemplateViewerPopupComponent, {\n title: popupTitle,\n size: this.deviceService.isSmall() ? 'full' : 'lg',\n closeButton: false,\n closeOnBackdropClick: false,\n draggable: false,\n data: { config },\n });\n\n return (\n (result?.data as AXMFormTemplateViewerResult | undefined) ?? {\n context: input.context ?? {},\n cancelled: true,\n metadata: input.metadata,\n }\n );\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;;AAAA;AAqBA;AAEA;AAEA;;AAEG;MAEU,4BAA4B,CAAA;AADzC,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CA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EAAE,IAAgD,IAAI;AAC3D,YAAA,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,EAAE;AAC5B,YAAA,SAAS,EAAE,IAAI;YACf,QAAQ,EAAE,KAAK,CAAC,QAAQ;AACzB,SAAA;IAEL;8GA7FW,4BAA4B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA5B,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,4BAA4B,cADf,MAAM,EAAA,CAAA,CAAA;;2FACnB,4BAA4B,EAAA,UAAA,EAAA,CAAA;kBADxC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
|
|
@@ -19,6 +19,7 @@ function provideAssessmentManagementLocalEntities() {
|
|
|
19
19
|
[RootConfig.entities.assessmentSession.name]: () => import('@acorex-platform/module-assessment-management-client/contracts/entities/assessment-session').then((m) => m.factoryAssessmentSession()),
|
|
20
20
|
[RootConfig.entities.questionBankItem.name]: () => import('@acorex-platform/module-assessment-management-client/contracts/entities/question-bank-item').then((m) => m.factoryQuestionBankItem()),
|
|
21
21
|
[RootConfig.entities.questionnaire.name]: () => import('@acorex-platform/module-assessment-management-client/contracts/entities/questionnaire').then((m) => m.factoryQuestionnaire()),
|
|
22
|
+
[RootConfig.entities.template.name]: () => import('@acorex-platform/module-assessment-management-client/contracts/entities/template').then((m) => m.factoryTemplate()),
|
|
22
23
|
},
|
|
23
24
|
});
|
|
24
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-assessment-management-client-local-entities.mjs","sources":["../../../../libs/modules/assessment-management/client/src/lib/provide-local-entities.ts","../../../../libs/modules/assessment-management/client/src/lib/acorex-platform-module-assessment-management-client-local-entities.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport { provideLocalEntityCatalog } from '@acorex-platform/framework-client/layout/entity';\nimport { RootConfig } from '@acorex-platform/module-assessment-management-client/contracts';\n\n//#endregion\n\n//#region ----- Provide local entities -----\n\n/**\n * Registers assessment-management layouts on the client from packaged factories.\n * Each `import()` targets a secondary entry so unused entities stay out of the\n * bundle. Do not add this to the demo app; demo continues to load layouts via\n * `Domain:GetEntityLayout`.\n */\nexport function provideAssessmentManagementLocalEntities() {\n return provideLocalEntityCatalog({\n moduleName: RootConfig.module.name,\n loaders: {\n [RootConfig.entities.assessmentCase.name]: () =>\n import('@acorex-platform/module-assessment-management-client/contracts/entities/assessment-case').then((m) => m.factoryAssessmentCase()),\n [RootConfig.entities.assessmentSession.name]: () =>\n import('@acorex-platform/module-assessment-management-client/contracts/entities/assessment-session').then((m) => m.factoryAssessmentSession()),\n [RootConfig.entities.questionBankItem.name]: () =>\n import('@acorex-platform/module-assessment-management-client/contracts/entities/question-bank-item').then((m) => m.factoryQuestionBankItem()),\n [RootConfig.entities.questionnaire.name]: () =>\n import('@acorex-platform/module-assessment-management-client/contracts/entities/questionnaire').then((m) => m.factoryQuestionnaire()),\n },\n });\n}\n\nexport { assessmentManagementLocalEntityCatalog } from '@acorex-platform/module-assessment-management-client/contracts/entity-catalog';\n\n//#endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './provide-local-entities';\n"],"names":[],"mappings":";;;;AAAA;AAKA;AAEA;AAEA;;;;;AAKG;SACa,wCAAwC,GAAA;AACtD,IAAA,OAAO,yBAAyB,CAAC;AAC/B,QAAA,UAAU,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI;AAClC,QAAA,OAAO,EAAE;AACP,YAAA,CAAC,UAAU,CAAC,QAAQ,CAAC,cAAc,CAAC,IAAI,GAAG,MACzC,OAAO,yFAAyF,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,qBAAqB,EAAE,CAAC;AAC1I,YAAA,CAAC,UAAU,CAAC,QAAQ,CAAC,iBAAiB,CAAC,IAAI,GAAG,MAC5C,OAAO,4FAA4F,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,wBAAwB,EAAE,CAAC;AAChJ,YAAA,CAAC,UAAU,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,GAAG,MAC3C,OAAO,4FAA4F,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,uBAAuB,EAAE,CAAC;AAC/I,YAAA,CAAC,UAAU,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,GAAG,MACxC,OAAO,uFAAuF,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,oBAAoB,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-assessment-management-client-local-entities.mjs","sources":["../../../../libs/modules/assessment-management/client/src/lib/provide-local-entities.ts","../../../../libs/modules/assessment-management/client/src/lib/acorex-platform-module-assessment-management-client-local-entities.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport { provideLocalEntityCatalog } from '@acorex-platform/framework-client/layout/entity';\nimport { RootConfig } from '@acorex-platform/module-assessment-management-client/contracts';\n\n//#endregion\n\n//#region ----- Provide local entities -----\n\n/**\n * Registers assessment-management layouts on the client from packaged factories.\n * Each `import()` targets a secondary entry so unused entities stay out of the\n * bundle. Do not add this to the demo app; demo continues to load layouts via\n * `Domain:GetEntityLayout`.\n */\nexport function provideAssessmentManagementLocalEntities() {\n return provideLocalEntityCatalog({\n moduleName: RootConfig.module.name,\n loaders: {\n [RootConfig.entities.assessmentCase.name]: () =>\n import('@acorex-platform/module-assessment-management-client/contracts/entities/assessment-case').then((m) => m.factoryAssessmentCase()),\n [RootConfig.entities.assessmentSession.name]: () =>\n import('@acorex-platform/module-assessment-management-client/contracts/entities/assessment-session').then((m) => m.factoryAssessmentSession()),\n [RootConfig.entities.questionBankItem.name]: () =>\n import('@acorex-platform/module-assessment-management-client/contracts/entities/question-bank-item').then((m) => m.factoryQuestionBankItem()),\n [RootConfig.entities.questionnaire.name]: () =>\n import('@acorex-platform/module-assessment-management-client/contracts/entities/questionnaire').then((m) => m.factoryQuestionnaire()),\n [RootConfig.entities.template.name]: () =>\n import('@acorex-platform/module-assessment-management-client/contracts/entities/template').then((m) => m.factoryTemplate()),\n },\n });\n}\n\nexport { assessmentManagementLocalEntityCatalog } from '@acorex-platform/module-assessment-management-client/contracts/entity-catalog';\n\n//#endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './provide-local-entities';\n"],"names":[],"mappings":";;;;AAAA;AAKA;AAEA;AAEA;;;;;AAKG;SACa,wCAAwC,GAAA;AACtD,IAAA,OAAO,yBAAyB,CAAC;AAC/B,QAAA,UAAU,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI;AAClC,QAAA,OAAO,EAAE;AACP,YAAA,CAAC,UAAU,CAAC,QAAQ,CAAC,cAAc,CAAC,IAAI,GAAG,MACzC,OAAO,yFAAyF,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,qBAAqB,EAAE,CAAC;AAC1I,YAAA,CAAC,UAAU,CAAC,QAAQ,CAAC,iBAAiB,CAAC,IAAI,GAAG,MAC5C,OAAO,4FAA4F,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,wBAAwB,EAAE,CAAC;AAChJ,YAAA,CAAC,UAAU,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,GAAG,MAC3C,OAAO,4FAA4F,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,uBAAuB,EAAE,CAAC;AAC/I,YAAA,CAAC,UAAU,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,GAAG,MACxC,OAAO,uFAAuF,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,oBAAoB,EAAE,CAAC;AACvI,YAAA,CAAC,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,GAAG,MACnC,OAAO,kFAAkF,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,eAAe,EAAE,CAAC;AAC9H,SAAA;AACF,KAAA,CAAC;AACJ;AAIA;;ACnCA;;AAEG;;"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, Injectable } from '@angular/core';
|
|
3
|
+
import { A as AXMFormTemplateViewerService } from './acorex-platform-module-assessment-management-client-form-template-viewer.service-BTmeEOAJ.mjs';
|
|
4
|
+
import { A as AXPFormTemplateViewerConnector } from './acorex-platform-module-assessment-management-client-acorex-platform-module-assessment-management-client-rrUYWHvI.mjs';
|
|
5
|
+
|
|
6
|
+
const MISSING_TEMPLATE_KEY = '@form-template-management:templates.viewer.messages.missing-template';
|
|
7
|
+
const NOT_FOUND_KEY = '@form-template-management:templates.viewer.messages.not-found';
|
|
8
|
+
const OPEN_FAILED_KEY = '@form-template-management:templates.viewer.messages.open-failed';
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region ----- Open form template command -----
|
|
11
|
+
class AXMOpenFormTemplateCommand {
|
|
12
|
+
constructor() {
|
|
13
|
+
//#region ----- Services & Dependencies -----
|
|
14
|
+
this.formViewer = inject(AXMFormTemplateViewerService);
|
|
15
|
+
this.connector = inject(AXPFormTemplateViewerConnector);
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region ----- Command Implementation -----
|
|
19
|
+
async execute(input = {}) {
|
|
20
|
+
try {
|
|
21
|
+
const data = input.data ?? {};
|
|
22
|
+
const metadata = input.metadata;
|
|
23
|
+
const { id, template } = data;
|
|
24
|
+
if (!id && !template) {
|
|
25
|
+
return { success: false, message: { text: MISSING_TEMPLATE_KEY } };
|
|
26
|
+
}
|
|
27
|
+
const result = await this.formViewer.open({ id, template, metadata });
|
|
28
|
+
if (result === 'missing') {
|
|
29
|
+
return { success: false, message: { text: MISSING_TEMPLATE_KEY } };
|
|
30
|
+
}
|
|
31
|
+
if (result === 'not-found') {
|
|
32
|
+
return { success: false, message: { text: NOT_FOUND_KEY } };
|
|
33
|
+
}
|
|
34
|
+
if (result.cancelled) {
|
|
35
|
+
return { success: false };
|
|
36
|
+
}
|
|
37
|
+
if (id) {
|
|
38
|
+
await this.connector.submit(id, result.context, metadata);
|
|
39
|
+
}
|
|
40
|
+
return { success: true, kind: 'object', data: result.context };
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
return { success: false, message: { text: OPEN_FAILED_KEY } };
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMOpenFormTemplateCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
47
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMOpenFormTemplateCommand, providedIn: 'root' }); }
|
|
48
|
+
}
|
|
49
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMOpenFormTemplateCommand, decorators: [{
|
|
50
|
+
type: Injectable,
|
|
51
|
+
args: [{ providedIn: 'root' }]
|
|
52
|
+
}] });
|
|
53
|
+
|
|
54
|
+
export { AXMOpenFormTemplateCommand };
|
|
55
|
+
//# sourceMappingURL=acorex-platform-module-assessment-management-client-open-form-template.command-Cg2Cnp1-.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-assessment-management-client-open-form-template.command-Cg2Cnp1-.mjs","sources":["../../../../libs/modules/assessment-management/client/src/lib/features/form-template/viewer/commands/open-form-template.command.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport type { AXPMetaData } from '@acorex-platform/framework-shared/core';\nimport { inject, Injectable } from '@angular/core';\n\nimport { AXMFormTemplateViewerService } from '../form-template-viewer.service';\nimport { AXPFormTemplateViewerConnector } from '../viewer-connector.service';\n\n//#endregion\n\n//#region ----- Types -----\n\nexport interface AXMOpenFormTemplateCommandInput {\n data?: {\n id?: string;\n template?: string;\n };\n metadata?: AXPMetaData;\n}\n\nconst MISSING_TEMPLATE_KEY = '@form-template-management:templates.viewer.messages.missing-template';\nconst NOT_FOUND_KEY = '@form-template-management:templates.viewer.messages.not-found';\nconst OPEN_FAILED_KEY = '@form-template-management:templates.viewer.messages.open-failed';\n\n//#endregion\n\n//#region ----- Open form template command -----\n\n@Injectable({ providedIn: 'root' })\nexport class AXMOpenFormTemplateCommand implements AXPCommand<AXMOpenFormTemplateCommandInput> {\n //#region ----- Services & Dependencies -----\n\n private readonly formViewer = inject(AXMFormTemplateViewerService);\n private readonly connector = inject(AXPFormTemplateViewerConnector);\n\n //#endregion\n\n //#region ----- Command Implementation -----\n\n async execute(input: AXMOpenFormTemplateCommandInput = {}): AXPCommandExecuteResultPromise {\n try {\n const data = input.data ?? {};\n const metadata = input.metadata;\n const { id, template } = data;\n\n if (!id && !template) {\n return { success: false, message: { text: MISSING_TEMPLATE_KEY } };\n }\n\n const result = await this.formViewer.open({ id, template, metadata });\n if (result === 'missing') {\n return { success: false, message: { text: MISSING_TEMPLATE_KEY } };\n }\n if (result === 'not-found') {\n return { success: false, message: { text: NOT_FOUND_KEY } };\n }\n if (result.cancelled) {\n return { success: false };\n }\n\n if (id) {\n await this.connector.submit(id, result.context, metadata);\n }\n\n return { success: true, kind: 'object', data: result.context };\n } catch {\n return { success: false, message: { text: OPEN_FAILED_KEY } };\n }\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;AAqBA,MAAM,oBAAoB,GAAG,sEAAsE;AACnG,MAAM,aAAa,GAAG,+DAA+D;AACrF,MAAM,eAAe,GAAG,iEAAiE;AAEz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AE,QAAQ,CAAC;YAC3D;AAEA,YAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,OAAO,EAAE;QAChE;AAAE,QAAA,MAAM;AACN,YAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,EAAE;QAC/D;IACF;8GAvCW,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA1B,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,0BAA0B,cADb,MAAM,EAAA,CAAA,CAAA;;2FACnB,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBADtC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, Injectable } from '@angular/core';
|
|
3
|
+
import { A as AXMFormTemplateViewerService } from './acorex-platform-module-assessment-management-client-form-template-viewer.service-BTmeEOAJ.mjs';
|
|
4
|
+
|
|
5
|
+
const MISSING_TEMPLATE_KEY = '@form-template-management:templates.viewer.messages.missing-template';
|
|
6
|
+
const NOT_FOUND_KEY = '@form-template-management:templates.viewer.messages.not-found';
|
|
7
|
+
const OPEN_FAILED_KEY = '@form-template-management:templates.viewer.messages.open-failed';
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region ----- Preview form template command -----
|
|
10
|
+
/**
|
|
11
|
+
* Opens a form template preview. Answers are not saved.
|
|
12
|
+
*/
|
|
13
|
+
class AXMPreviewFormTemplateCommand {
|
|
14
|
+
constructor() {
|
|
15
|
+
//#region ----- Services & Dependencies -----
|
|
16
|
+
this.formViewer = inject(AXMFormTemplateViewerService);
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region ----- Command Implementation -----
|
|
20
|
+
resolvePayload(input) {
|
|
21
|
+
const ctxOpts = input.options;
|
|
22
|
+
const ctxData = input.data;
|
|
23
|
+
const asNonEmptyString = (value) => typeof value === 'string' && value.length > 0 ? value : undefined;
|
|
24
|
+
const asDisplayTitle = (value) => {
|
|
25
|
+
const text = asNonEmptyString(value);
|
|
26
|
+
if (text) {
|
|
27
|
+
return text;
|
|
28
|
+
}
|
|
29
|
+
if (value && typeof value === 'object') {
|
|
30
|
+
const record = value;
|
|
31
|
+
const fromTitle = record['title'];
|
|
32
|
+
if (typeof fromTitle === 'string' && fromTitle.trim()) {
|
|
33
|
+
return fromTitle.trim();
|
|
34
|
+
}
|
|
35
|
+
const fromName = record['name'];
|
|
36
|
+
if (typeof fromName === 'string' && fromName.trim()) {
|
|
37
|
+
return fromName.trim();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return undefined;
|
|
41
|
+
};
|
|
42
|
+
const templateId = asNonEmptyString(input.templateId) ??
|
|
43
|
+
asNonEmptyString(ctxOpts?.templateId) ??
|
|
44
|
+
(ctxData?.['id'] != null ? String(ctxData['id']) : undefined);
|
|
45
|
+
if (!templateId) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
const templateTitle = asDisplayTitle(input.templateTitle) ??
|
|
49
|
+
asDisplayTitle(ctxOpts?.templateTitle) ??
|
|
50
|
+
asDisplayTitle(ctxData?.['title']) ??
|
|
51
|
+
asDisplayTitle(ctxData?.['name']);
|
|
52
|
+
return { templateId, templateTitle };
|
|
53
|
+
}
|
|
54
|
+
async execute(input) {
|
|
55
|
+
try {
|
|
56
|
+
const resolved = this.resolvePayload(input);
|
|
57
|
+
if (!resolved?.templateId) {
|
|
58
|
+
return { success: false, message: { text: MISSING_TEMPLATE_KEY } };
|
|
59
|
+
}
|
|
60
|
+
const result = await this.formViewer.open({
|
|
61
|
+
id: resolved.templateId,
|
|
62
|
+
title: resolved.templateTitle,
|
|
63
|
+
previewMode: true,
|
|
64
|
+
});
|
|
65
|
+
if (result === 'missing') {
|
|
66
|
+
return { success: false, message: { text: MISSING_TEMPLATE_KEY } };
|
|
67
|
+
}
|
|
68
|
+
if (result === 'not-found') {
|
|
69
|
+
return { success: false, message: { text: NOT_FOUND_KEY } };
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
success: true,
|
|
73
|
+
kind: 'object',
|
|
74
|
+
data: undefined,
|
|
75
|
+
metadata: { outcome: result.cancelled ? 'Cancelled' : 'Previewed', refresh: false },
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
return { success: false, message: { text: OPEN_FAILED_KEY } };
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMPreviewFormTemplateCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
83
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMPreviewFormTemplateCommand }); }
|
|
84
|
+
}
|
|
85
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMPreviewFormTemplateCommand, decorators: [{
|
|
86
|
+
type: Injectable
|
|
87
|
+
}] });
|
|
88
|
+
|
|
89
|
+
export { AXMPreviewFormTemplateCommand };
|
|
90
|
+
//# sourceMappingURL=acorex-platform-module-assessment-management-client-preview-form-template.command-CaCFGmlA.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-assessment-management-client-preview-form-template.command-CaCFGmlA.mjs","sources":["../../../../libs/modules/assessment-management/client/src/lib/features/form-template/viewer/commands/preview-form-template.command.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { inject, Injectable } from '@angular/core';\n\nimport { AXMFormTemplateViewerService } from '../form-template-viewer.service';\n\n//#endregion\n\n//#region ----- Types -----\n\nexport interface AXMPreviewFormTemplateCommandInput {\n templateId?: string;\n templateTitle?: string;\n}\n\ntype AXMPreviewFormTemplateCommandInvocation = AXMPreviewFormTemplateCommandInput & {\n data?: Record<string, unknown>;\n options?: Partial<AXMPreviewFormTemplateCommandInput> & Record<string, unknown>;\n};\n\nconst MISSING_TEMPLATE_KEY = '@form-template-management:templates.viewer.messages.missing-template';\nconst NOT_FOUND_KEY = '@form-template-management:templates.viewer.messages.not-found';\nconst OPEN_FAILED_KEY = '@form-template-management:templates.viewer.messages.open-failed';\n\n//#endregion\n\n//#region ----- Preview form template command -----\n\n/**\n * Opens a form template preview. Answers are not saved.\n */\n@Injectable()\nexport class AXMPreviewFormTemplateCommand implements AXPCommand<AXMPreviewFormTemplateCommandInput, void> {\n //#region ----- Services & Dependencies -----\n\n private readonly formViewer = inject(AXMFormTemplateViewerService);\n\n //#endregion\n\n //#region ----- Command Implementation -----\n\n private resolvePayload(\n input: AXMPreviewFormTemplateCommandInvocation,\n ): AXMPreviewFormTemplateCommandInput | null {\n const ctxOpts = input.options;\n const ctxData = input.data;\n\n const asNonEmptyString = (value: unknown): string | undefined =>\n typeof value === 'string' && value.length > 0 ? value : undefined;\n\n const asDisplayTitle = (value: unknown): string | undefined => {\n const text = asNonEmptyString(value);\n if (text) {\n return text;\n }\n if (value && typeof value === 'object') {\n const record = value as Record<string, unknown>;\n const fromTitle = record['title'];\n if (typeof fromTitle === 'string' && fromTitle.trim()) {\n return fromTitle.trim();\n }\n const fromName = record['name'];\n if (typeof fromName === 'string' && fromName.trim()) {\n return fromName.trim();\n }\n }\n return undefined;\n };\n\n const templateId =\n asNonEmptyString(input.templateId) ??\n asNonEmptyString(ctxOpts?.templateId) ??\n (ctxData?.['id'] != null ? String(ctxData['id']) : undefined);\n\n if (!templateId) {\n return null;\n }\n\n const templateTitle =\n asDisplayTitle(input.templateTitle) ??\n asDisplayTitle(ctxOpts?.templateTitle) ??\n asDisplayTitle(ctxData?.['title']) ??\n asDisplayTitle(ctxData?.['name']);\n\n return { templateId, templateTitle };\n }\n\n async execute(input: AXMPreviewFormTemplateCommandInvocation): AXPCommandExecuteResultPromise<void> {\n try {\n const resolved = this.resolvePayload(input);\n if (!resolved?.templateId) {\n return { success: false, message: { text: MISSING_TEMPLATE_KEY } };\n }\n\n const result = await this.formViewer.open({\n id: resolved.templateId,\n title: resolved.templateTitle,\n previewMode: true,\n });\n\n if (result === 'missing') {\n return { success: false, message: { text: MISSING_TEMPLATE_KEY } };\n }\n if (result === 'not-found') {\n return { success: false, message: { text: NOT_FOUND_KEY } };\n }\n\n return {\n success: true,\n kind: 'object',\n data: undefined,\n metadata: { outcome: result.cancelled ? 'Cancelled' : 'Previewed', refresh: false },\n };\n } catch {\n return { success: false, message: { text: OPEN_FAILED_KEY } };\n }\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;AAqBA,MAAM,oBAAoB,GAAG,sEAAsE;AACnG,MAAM,aAAa,GAAG,+DAA+D;AACrF,MAAM,eAAe,GAAG,iEAAiE;AAEzF;AAEA;AAEA;;AAEG;MAEU,6BAA6B,CAAA;AAD1C,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,4BAA4B,CAAC;AAoFnE,IAAA;;;AA9ES,IAAA,cAAc,CACpB,KAA8C,EAAA;AAE9C,QAAA,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO;AAC7B,QAAA,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI;QAE1B,MAAM,gBAAgB,GAAG,CAAC,KAAc,KACtC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,GAAG,KAAK,GAAG,SAAS;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6B,EAAA,CAAA,CAAA;;2FAA7B,6BAA6B,EAAA,UAAA,EAAA,CAAA;kBADzC;;;"}
|
|
@@ -3,7 +3,7 @@ import { AXPEntityService } from '@acorex-platform/framework-client/layout/entit
|
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
4
|
import { inject, Injectable } from '@angular/core';
|
|
5
5
|
import { RootConfig } from '@acorex-platform/module-assessment-management-client/contracts';
|
|
6
|
-
import {
|
|
6
|
+
import { a as AXMQuestionnaireViewerService } from './acorex-platform-module-assessment-management-client-acorex-platform-module-assessment-management-client-rrUYWHvI.mjs';
|
|
7
7
|
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region ---- Preview Question Command ----
|
|
@@ -120,4 +120,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
120
120
|
}] });
|
|
121
121
|
|
|
122
122
|
export { PreviewQuestionCommand };
|
|
123
|
-
//# sourceMappingURL=acorex-platform-module-assessment-management-client-preview-question.command-
|
|
123
|
+
//# sourceMappingURL=acorex-platform-module-assessment-management-client-preview-question.command-DIRJDBFM.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-assessment-management-client-preview-question.command-
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-assessment-management-client-preview-question.command-DIRJDBFM.mjs","sources":["../../../../libs/modules/assessment-management/client/src/lib/features/questionnaire-viewer/commands/preview-question.command.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXTranslationService, resolveMultiLanguageString } from '@acorex/core/translation';\nimport { AXPRuntimeCommandResult } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\n\nimport { Injectable, inject } from '@angular/core';\nimport { RootConfig } from '@acorex-platform/module-assessment-management-client/contracts';\nimport type { AXMAssessmentManagementQuestionBankItemEntityModel } from '@acorex-platform/module-assessment-management-client/contracts';\nimport { QuestionnaireBuilderValue } from '@acorex-platform/module-assessment-management-client/contracts';\nimport { AXMQuestionnaireViewerService } from '../questionnaire-viewer.service';\n\n//#endregion\n\n//#region ---- Command Input/Output Types ----\n\n/**\n * Input for PreviewQuestion command.\n * Pass id to load the question bank item (title and structure come from the item).\n * Or pass pre-built structure (e.g. from builder) with optional title.\n */\nexport interface PreviewQuestionCommandInput {\n /** Question bank item id. */\n id?: string;\n /** Pre-built structure; when set, id is not required. */\n structure?: QuestionnaireBuilderValue;\n /** Dialog title when using pre-built structure. */\n title?: string;\n data?: Record<string, unknown>;\n options?: Record<string, unknown>;\n}\n\n//#endregion\n\n//#region ---- Preview Question Command ----\n\n/**\n * Command that opens a preview of a single question in a dialog.\n * Used from the questionnaire builder per-question primary action.\n */\n@Injectable()\nexport class PreviewQuestionCommand implements AXPCommand<PreviewQuestionCommandInput, void> {\n //#region ---- Services & Dependencies ----\n\n private readonly questionnaireViewerService = inject(AXMQuestionnaireViewerService);\n private readonly entityService = inject(AXPEntityService);\n private readonly translationService = inject(AXTranslationService);\n\n //#endregion\n\n //#region ---- Command Implementation ----\n\n private resolveId(input: PreviewQuestionCommandInput): string | undefined {\n const record = input as Record<string, unknown>;\n const ctxData = input.data as Record<string, unknown> | undefined;\n const ctxOptions = input.options as Record<string, unknown> | undefined;\n const asString = (v: unknown): string | undefined => (typeof v === 'string' && v.length > 0 ? v : undefined);\n return (\n asString(input.id) ??\n asString(record['questionBankItemId']) ??\n asString(ctxOptions?.['questionBankItemId']) ??\n asString(ctxData?.['id']) ??\n asString(record['id'])\n );\n }\n\n async execute(input: PreviewQuestionCommandInput): AXPCommandExecuteResultPromise<void> {\n try {\n const id = this.resolveId(input);\n let structure: QuestionnaireBuilderValue | undefined = input.structure;\n let title = input.title;\n\n if (id) {\n const item = await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.questionBankItem.name)\n .data<string, AXMAssessmentManagementQuestionBankItemEntityModel>()\n .byKey(id);\n if (!item) {\n return {\n success: false,\n message: { text: 'Question not found' },\n };\n }\n const locale = this.translationService.getActiveLang?.() ?? 'en-US';\n const resolvedListTitle = resolveMultiLanguageString(item.title, locale);\n structure = {\n sections: [\n {\n name: `preview-section-${item.id}`,\n title: resolvedListTitle || 'Question',\n description: undefined,\n order: 0,\n items: [\n {\n name: String(item.id),\n questionBankItemId: item.id,\n order: 0,\n isRequired: false,\n interfaceOverride: item.interface,\n } as QuestionnaireBuilderValue['sections'][0]['items'][0],\n ],\n },\n ],\n displaySettings: {\n viewMode: 'single-page',\n showProgressBar: false,\n showQuestionNumbers: false,\n },\n };\n title = resolvedListTitle || undefined;\n }\n\n if (!structure?.sections?.length) {\n return {\n success: false,\n message: { text: 'No question structure to preview' },\n };\n }\n\n const totalQuestions =\n structure.sections?.reduce((s: number, sec: { items?: unknown[] }) => s + (sec.items?.length ?? 0), 0) ?? 0;\n if (totalQuestions === 0) {\n return {\n success: false,\n message: { text: 'No question to preview' },\n };\n }\n\n const previewTitleKey = '@assessment-management:question-bank.entities.question-bank-item.actions.preview.title';\n const defaultTitle = (await this.translationService.translateAsync(previewTitleKey)) || 'Preview';\n const dialogTitle = title?.trim() || defaultTitle;\n\n await this.questionnaireViewerService.open({\n title: dialogTitle,\n structure,\n config: { previewMode: true },\n });\n\n return {\n success: true,\n kind: 'object',\n data: undefined,\n message: { text: '' },\n metadata: { refresh: false },\n };\n } catch (error: unknown) {\n const message = error instanceof Error ? error.message : 'Unknown error';\n return {\n success: false,\n message: { text: `Error previewing question: ${message}` },\n };\n }\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;AAiCA;AAEA;AAEA;;;AAGG;MAEU,sBAAsB,CAAA;AADnC,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,0BAA0B,GAAG,MAAM,CAAC,6BAA6B,CAAC;AAClE,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAC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"}
|
|
@@ -2,7 +2,7 @@ import { AXTranslationService, resolveMultiLanguageString } from '@acorex/core/t
|
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { inject, Injectable } from '@angular/core';
|
|
4
4
|
import { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';
|
|
5
|
-
import {
|
|
5
|
+
import { a as AXMQuestionnaireViewerService, f as formatQuestionnairePreviewDialogTitle } from './acorex-platform-module-assessment-management-client-acorex-platform-module-assessment-management-client-rrUYWHvI.mjs';
|
|
6
6
|
import { RootConfig, toPrePostConfig, toDisplaySettings, toPrintSettings } from '@acorex-platform/module-assessment-management-client/contracts';
|
|
7
7
|
|
|
8
8
|
//#endregion
|
|
@@ -162,4 +162,4 @@ function asEntityId(value) {
|
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
export { AXPPreviewQuestionnaireCommand };
|
|
165
|
-
//# sourceMappingURL=acorex-platform-module-assessment-management-client-preview-questionnaire.command-
|
|
165
|
+
//# sourceMappingURL=acorex-platform-module-assessment-management-client-preview-questionnaire.command-fcYcY10l.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-assessment-management-client-preview-questionnaire.command-yOfBbOMK.mjs","sources":["../../../../libs/modules/assessment-management/client/src/lib/features/questionnaire-viewer/commands/preview-questionnaire.command.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXPRuntimeCommandResult } from '@acorex-platform/framework-shared/core';\n\nimport { AXTranslationService, resolveMultiLanguageString } from '@acorex/core/translation';\nimport { Injectable, inject } from '@angular/core';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXMQuestionnaireViewerService } from '../../../features/questionnaire-viewer/questionnaire-viewer.service';\nimport {\n type AXMAssessmentManagementQuestionnaireEntityModel,\n toDisplaySettings,\n toPrePostConfig,\n toPrintSettings,\n} from '@acorex-platform/module-assessment-management-client/contracts';\nimport { RootConfig } from '@acorex-platform/module-assessment-management-client/contracts';\nimport { formatQuestionnairePreviewDialogTitle } from '../utils/questionnaire-preview-title.util';\n\n//#endregion\n\n//#region ---- Command Input/Output Types ----\n\n/**\n * Input for PreviewQuestionnaire command.\n */\nexport interface AXPPreviewQuestionnaireCommandInput {\n /**\n * Questionnaire ID to preview.\n */\n questionnaireId: string;\n\n /**\n * Questionnaire title (for display).\n */\n questionnaireTitle?: string;\n}\n\n/** Entity list passes evaluated action options on `options` (see entity-master-list view model). */\ntype AXPPreviewQuestionnaireCommandInvocation = AXPPreviewQuestionnaireCommandInput & {\n data?: Record<string, unknown>;\n options?: Partial<AXPPreviewQuestionnaireCommandInput> & Record<string, unknown>;\n};\n\n//#endregion\n\n//#region ---- Preview Questionnaire Command ----\n\n/**\n * Command that opens a preview of a questionnaire in a dialog.\n */\n@Injectable()\nexport class AXPPreviewQuestionnaireCommand implements AXPCommand<AXPPreviewQuestionnaireCommandInput, void> {\n //#region ---- Services & Dependencies ----\n\n private readonly entityService = inject(AXPEntityService);\n private readonly questionnaireViewerService = inject(AXMQuestionnaireViewerService);\n private readonly translationService = inject(AXTranslationService);\n\n //#endregion\n\n //#region ---- Command Implementation ----\n\n /**\n * Resolves questionnaire id/title from root input or from entity action payload (`options` / row `data`).\n */\n private resolvePayload(input: AXPPreviewQuestionnaireCommandInvocation): AXPPreviewQuestionnaireCommandInput | null {\n const ctxOpts = input.options;\n const ctxData = input.data;\n\n const asNonEmptyString = (v: unknown): string | undefined =>\n typeof v === 'string' && v.length > 0 ? v : undefined;\n\n const asDisplayTitle = (v: unknown): string | undefined => {\n const s = asNonEmptyString(v);\n if (s) return s;\n if (v && typeof v === 'object') {\n const o = v as Record<string, unknown>;\n const fromTitle = o['title'];\n if (typeof fromTitle === 'string' && fromTitle.trim()) return fromTitle.trim();\n const fromName = o['name'];\n if (typeof fromName === 'string' && fromName.trim()) return fromName.trim();\n }\n return undefined;\n };\n\n const questionnaireId =\n asNonEmptyString(input.questionnaireId) ??\n asNonEmptyString(ctxOpts?.questionnaireId) ??\n (ctxData?.['id'] != null ? String(ctxData['id']) : undefined);\n\n if (!questionnaireId) {\n return null;\n }\n\n const questionnaireTitle =\n asDisplayTitle(input.questionnaireTitle) ??\n asDisplayTitle(ctxOpts?.questionnaireTitle) ??\n asDisplayTitle(ctxData?.['title']) ??\n asDisplayTitle(ctxData?.['name']);\n\n return { questionnaireId, questionnaireTitle };\n }\n\n async execute(input: AXPPreviewQuestionnaireCommandInvocation): AXPCommandExecuteResultPromise<void> {\n try {\n const resolved = this.resolvePayload(input);\n if (!resolved) {\n return {\n success: false,\n message: {\n text: 'Questionnaire id is missing (could not resolve from command context).',\n },\n };\n }\n\n const { questionnaireId, questionnaireTitle } = resolved;\n\n // Get questionnaire data\n const questionnaire = await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.questionnaire.name)\n .data<string, AXMAssessmentManagementQuestionnaireEntityModel>()\n .byKey(questionnaireId);\n\n if (!questionnaire) {\n return {\n success: false,\n message: {\n text: `Questionnaire with ID ${questionnaireId} not found`,\n },\n };\n }\n\n // Check if questionnaire has questions\n if (!questionnaire.questions || !questionnaire.questions.sections || questionnaire.questions.sections.length === 0) {\n return {\n success: false,\n message: {\n text: 'Questionnaire has no questions to preview',\n },\n };\n }\n\n // Get preview title\n const previewTitleKey = '@assessment-management:questionnaires.entities.questionnaire.actions.preview.title';\n const previewTitleBase = (await this.translationService.translateAsync(previewTitleKey)) || 'Preview';\n const locale = this.translationService.getActiveLang?.() ?? 'en-US';\n const entityTitle = resolveMultiLanguageString(questionnaire.title, locale).trim();\n const displayTitle = questionnaireTitle?.trim() || entityTitle || undefined;\n const previewTitle = formatQuestionnairePreviewDialogTitle(previewTitleBase, displayTitle);\n\n const cfg = toPrePostConfig(questionnaire);\n const displaySettings = toDisplaySettings(questionnaire);\n const questions = questionnaire.questions;\n const structure = {\n sections: questions?.sections ?? [],\n displaySettings: displaySettings ?? undefined,\n printSettings: toPrintSettings(questionnaire) ?? undefined,\n };\n const result = await this.questionnaireViewerService.open({\n title: previewTitle,\n structure,\n prePostConfig: cfg,\n config: {\n previewMode: true,\n completionMode: 'submit-only',\n viewMode: displaySettings?.viewMode,\n showProgressBar: displaySettings?.showProgressBar,\n timer: { showTimer: displaySettings?.showTimer ?? false },\n showQuestionNumbers: displaySettings?.showQuestionNumbers,\n validationStrategy: displaySettings?.validationStrategy,\n },\n questionnaireId,\n printTemplateId: asEntityId(questionnaire.printTemplateId),\n submitHandler: async (answers: Record<string, any>) =>\n this.questionnaireViewerService.buildSummaryPlaceholderValues(structure, answers, {\n questionnaireId,\n }),\n });\n\n if (result?.submitted && result.answers) {\n return {\n success: true,\n kind: 'object',\n data: undefined,\n metadata: { outcome: 'Previewed', refresh: false },\n };\n }\n return {\n success: true,\n kind: 'object',\n data: undefined,\n metadata: { outcome: 'Cancelled', refresh: false },\n };\n } catch (error: any) {\n return {\n success: false,\n message: {\n text: `Error previewing questionnaire: ${error.message || 'Unknown error'}`,\n },\n };\n }\n }\n\n //#endregion\n}\n\nfunction asEntityId(value: unknown): string | undefined {\n if (typeof value === 'string' && value.trim()) {\n return value.trim();\n }\n if (value && typeof value === 'object' && 'id' in value) {\n return asEntityId((value as { id: unknown }).id);\n }\n return undefined;\n}\n\n//#endregion\n\n"],"names":[],"mappings":";;;;;;;AA2CA;AAEA;AAEA;;AAEG;MAEU,8BAA8B,CAAA;AAD3C,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,QAAA,IAAA,CAAA,0BAA0B,GAAG,MAAM,CAAC,6BAA6B,CAAC;AAClE,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AAoJnE,IAAA;;;AA9IC;;AAEG;AACK,IAAA,cAAc,CAAC,KAA+C,EAAA;AACpE,QAAA,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO;AAC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AI,OAAO,KAAK,KAAK,QAAQ,IAAI,IAAI,IAAI,KAAK,EAAE;AACvD,QAAA,OAAO,UAAU,CAAE,KAAyB,CAAC,EAAE,CAAC;IAClD;AACA,IAAA,OAAO,SAAS;AAClB;;"}
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-assessment-management-client-preview-questionnaire.command-fcYcY10l.mjs","sources":["../../../../libs/modules/assessment-management/client/src/lib/features/questionnaire-viewer/commands/preview-questionnaire.command.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXPRuntimeCommandResult } from '@acorex-platform/framework-shared/core';\n\nimport { AXTranslationService, resolveMultiLanguageString } from '@acorex/core/translation';\nimport { Injectable, inject } from '@angular/core';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXMQuestionnaireViewerService } from '../../../features/questionnaire-viewer/questionnaire-viewer.service';\nimport {\n type AXMAssessmentManagementQuestionnaireEntityModel,\n toDisplaySettings,\n toPrePostConfig,\n toPrintSettings,\n} from '@acorex-platform/module-assessment-management-client/contracts';\nimport { RootConfig } from '@acorex-platform/module-assessment-management-client/contracts';\nimport { formatQuestionnairePreviewDialogTitle } from '../utils/questionnaire-preview-title.util';\n\n//#endregion\n\n//#region ---- Command Input/Output Types ----\n\n/**\n * Input for PreviewQuestionnaire command.\n */\nexport interface AXPPreviewQuestionnaireCommandInput {\n /**\n * Questionnaire ID to preview.\n */\n questionnaireId: string;\n\n /**\n * Questionnaire title (for display).\n */\n questionnaireTitle?: string;\n}\n\n/** Entity list passes evaluated action options on `options` (see entity-master-list view model). */\ntype AXPPreviewQuestionnaireCommandInvocation = AXPPreviewQuestionnaireCommandInput & {\n data?: Record<string, unknown>;\n options?: Partial<AXPPreviewQuestionnaireCommandInput> & Record<string, unknown>;\n};\n\n//#endregion\n\n//#region ---- Preview Questionnaire Command ----\n\n/**\n * Command that opens a preview of a questionnaire in a dialog.\n */\n@Injectable()\nexport class AXPPreviewQuestionnaireCommand implements AXPCommand<AXPPreviewQuestionnaireCommandInput, void> {\n //#region ---- Services & Dependencies ----\n\n private readonly entityService = inject(AXPEntityService);\n private readonly questionnaireViewerService = inject(AXMQuestionnaireViewerService);\n private readonly translationService = inject(AXTranslationService);\n\n //#endregion\n\n //#region ---- Command Implementation ----\n\n /**\n * Resolves questionnaire id/title from root input or from entity action payload (`options` / row `data`).\n */\n private resolvePayload(input: AXPPreviewQuestionnaireCommandInvocation): AXPPreviewQuestionnaireCommandInput | null {\n const ctxOpts = input.options;\n const ctxData = input.data;\n\n const asNonEmptyString = (v: unknown): string | undefined =>\n typeof v === 'string' && v.length > 0 ? v : undefined;\n\n const asDisplayTitle = (v: unknown): string | undefined => {\n const s = asNonEmptyString(v);\n if (s) return s;\n if (v && typeof v === 'object') {\n const o = v as Record<string, unknown>;\n const fromTitle = o['title'];\n if (typeof fromTitle === 'string' && fromTitle.trim()) return fromTitle.trim();\n const fromName = o['name'];\n if (typeof fromName === 'string' && fromName.trim()) return fromName.trim();\n }\n return undefined;\n };\n\n const questionnaireId =\n asNonEmptyString(input.questionnaireId) ??\n asNonEmptyString(ctxOpts?.questionnaireId) ??\n (ctxData?.['id'] != null ? String(ctxData['id']) : undefined);\n\n if (!questionnaireId) {\n return null;\n }\n\n const questionnaireTitle =\n asDisplayTitle(input.questionnaireTitle) ??\n asDisplayTitle(ctxOpts?.questionnaireTitle) ??\n asDisplayTitle(ctxData?.['title']) ??\n asDisplayTitle(ctxData?.['name']);\n\n return { questionnaireId, questionnaireTitle };\n }\n\n async execute(input: AXPPreviewQuestionnaireCommandInvocation): AXPCommandExecuteResultPromise<void> {\n try {\n const resolved = this.resolvePayload(input);\n if (!resolved) {\n return {\n success: false,\n message: {\n text: 'Questionnaire id is missing (could not resolve from command context).',\n },\n };\n }\n\n const { questionnaireId, questionnaireTitle } = resolved;\n\n // Get questionnaire data\n const questionnaire = await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.questionnaire.name)\n .data<string, AXMAssessmentManagementQuestionnaireEntityModel>()\n .byKey(questionnaireId);\n\n if (!questionnaire) {\n return {\n success: false,\n message: {\n text: `Questionnaire with ID ${questionnaireId} not found`,\n },\n };\n }\n\n // Check if questionnaire has questions\n if (!questionnaire.questions || !questionnaire.questions.sections || questionnaire.questions.sections.length === 0) {\n return {\n success: false,\n message: {\n text: 'Questionnaire has no questions to preview',\n },\n };\n }\n\n // Get preview title\n const previewTitleKey = '@assessment-management:questionnaires.entities.questionnaire.actions.preview.title';\n const previewTitleBase = (await this.translationService.translateAsync(previewTitleKey)) || 'Preview';\n const locale = this.translationService.getActiveLang?.() ?? 'en-US';\n const entityTitle = resolveMultiLanguageString(questionnaire.title, locale).trim();\n const displayTitle = questionnaireTitle?.trim() || entityTitle || undefined;\n const previewTitle = formatQuestionnairePreviewDialogTitle(previewTitleBase, displayTitle);\n\n const cfg = toPrePostConfig(questionnaire);\n const displaySettings = toDisplaySettings(questionnaire);\n const questions = questionnaire.questions;\n const structure = {\n sections: questions?.sections ?? [],\n displaySettings: displaySettings ?? undefined,\n printSettings: toPrintSettings(questionnaire) ?? undefined,\n };\n const result = await this.questionnaireViewerService.open({\n title: previewTitle,\n structure,\n prePostConfig: cfg,\n config: {\n previewMode: true,\n completionMode: 'submit-only',\n viewMode: displaySettings?.viewMode,\n showProgressBar: displaySettings?.showProgressBar,\n timer: { showTimer: displaySettings?.showTimer ?? false },\n showQuestionNumbers: displaySettings?.showQuestionNumbers,\n validationStrategy: displaySettings?.validationStrategy,\n },\n questionnaireId,\n printTemplateId: asEntityId(questionnaire.printTemplateId),\n submitHandler: async (answers: Record<string, any>) =>\n this.questionnaireViewerService.buildSummaryPlaceholderValues(structure, answers, {\n questionnaireId,\n }),\n });\n\n if (result?.submitted && result.answers) {\n return {\n success: true,\n kind: 'object',\n data: undefined,\n metadata: { outcome: 'Previewed', refresh: false },\n };\n }\n return {\n success: true,\n kind: 'object',\n data: undefined,\n metadata: { outcome: 'Cancelled', refresh: false },\n };\n } catch (error: any) {\n return {\n success: false,\n message: {\n text: `Error previewing questionnaire: ${error.message || 'Unknown error'}`,\n },\n };\n }\n }\n\n //#endregion\n}\n\nfunction asEntityId(value: unknown): string | undefined {\n if (typeof value === 'string' && value.trim()) {\n return value.trim();\n }\n if (value && typeof value === 'object' && 'id' in value) {\n return asEntityId((value as { id: unknown }).id);\n }\n return undefined;\n}\n\n//#endregion\n\n"],"names":[],"mappings":";;;;;;;AA2CA;AAEA;AAEA;;AAEG;MAEU,8BAA8B,CAAA;AAD3C,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,QAAA,IAAA,CAAA,0BAA0B,GAAG,MAAM,CAAC,6BAA6B,CAAC;AAClE,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AAoJnE,IAAA;;;AA9IC;;AAEG;AACK,IAAA,cAAc,CAAC,KAA+C,EAAA;AACpE,QAAA,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO;AAC7B,QAAA,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI;QAE1B,MAAM,gBAAgB,GAAG,CAAC,CAAU,KAClC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,GAAG,SAAS;AAEvD,QAAA,MAAM,cAAc,GAAG,CAAC,CAAU,KAAwB;AACxD,YAAA,MAAM,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC;AAC7B,YAAA,IAAI,CAAC;AAAE,gBAAA,OAAO,CAAC;AACf,YAAA,IAAI,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE;gBAC9B,MAAM,CAAC,GAAG,CAA4B;AACtC,gBAAA,MAAM,SAAS,GAAG,CAAC,CAAC,OAAO,CAAC;gBAC5B,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,SAAS,CAAC,IA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gBAAA,IAAI,EAAE,SAAS;gBACf,QAAQ,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,KAAK,EAAE;aACnD;QACH;QAAE,OAAO,KAAU,EAAE;YACnB,OAAO;AACL,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,OAAO,EAAE;AACP,oBAAA,IAAI,EAAE,CAAA,gCAAA,EAAmC,KAAK,CAAC,OAAO,IAAI,eAAe,CAAA,CAAE;AAC5E,iBAAA;aACF;QACH;IACF;8GAtJW,8BAA8B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAA9B,8BAA8B,EAAA,CAAA,CAAA;;2FAA9B,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAD1C;;AA4JD,SAAS,UAAU,CAAC,KAAc,EAAA;IAChC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,EAAE;AAC7C,QAAA,OAAO,KAAK,CAAC,IAAI,EAAE;IACrB;IACA,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,IAAI,IAAI,KAAK,EAAE;AACvD,QAAA,OAAO,UAAU,CAAE,KAAyB,CAAC,EAAE,CAAC;IAClD;AACA,IAAA,OAAO,SAAS;AAClB;;"}
|
|
@@ -12,7 +12,7 @@ import { AsyncPipe } from '@angular/common';
|
|
|
12
12
|
import * as i0 from '@angular/core';
|
|
13
13
|
import { inject, computed, signal, model, effect, untracked, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
14
14
|
import { isEqual } from 'lodash';
|
|
15
|
-
import { s as stripQuestionBankInterfaceMetadata, r as resolveWidgetNodeFromMetaDataDefinitionInterface } from './acorex-platform-module-assessment-management-client-acorex-platform-module-assessment-management-client-
|
|
15
|
+
import { s as stripQuestionBankInterfaceMetadata, r as resolveWidgetNodeFromMetaDataDefinitionInterface } from './acorex-platform-module-assessment-management-client-acorex-platform-module-assessment-management-client-rrUYWHvI.mjs';
|
|
16
16
|
import * as i2 from '@acorex/components/decorators';
|
|
17
17
|
import { AXDecoratorModule } from '@acorex/components/decorators';
|
|
18
18
|
|
|
@@ -486,4 +486,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
486
486
|
}], propDecorators: { definitionIdModel: [{ type: i0.Input, args: [{ isSignal: true, alias: "definitionIdModel", required: false }] }, { type: i0.Output, args: ["definitionIdModelChange"] }], widgetConfigModel: [{ type: i0.Input, args: [{ isSignal: true, alias: "widgetConfigModel", required: false }] }, { type: i0.Output, args: ["widgetConfigModelChange"] }] } });
|
|
487
487
|
|
|
488
488
|
export { AXMQuestionBankInterfaceEditorWidgetEditComponent };
|
|
489
|
-
//# sourceMappingURL=acorex-platform-module-assessment-management-client-question-bank-interface-editor-widget-edit.component-
|
|
489
|
+
//# sourceMappingURL=acorex-platform-module-assessment-management-client-question-bank-interface-editor-widget-edit.component-DVQZ1A-Q.mjs.map
|