@acorex-platform/module-data-management-client 0.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/fesm2022/acorex-platform-module-data-management-client-contracts.mjs +366 -0
  2. package/fesm2022/acorex-platform-module-data-management-client-contracts.mjs.map +1 -0
  3. package/fesm2022/acorex-platform-module-data-management-client-index-CMxKYDas.mjs +298 -0
  4. package/fesm2022/acorex-platform-module-data-management-client-index-CMxKYDas.mjs.map +1 -0
  5. package/fesm2022/acorex-platform-module-data-management-client-list-agreement-scale-options.query-Dl7jMXp1.mjs +67 -0
  6. package/fesm2022/acorex-platform-module-data-management-client-list-agreement-scale-options.query-Dl7jMXp1.mjs.map +1 -0
  7. package/fesm2022/acorex-platform-module-data-management-client-list-availability-options.query-CdaHTgij.mjs +64 -0
  8. package/fesm2022/acorex-platform-module-data-management-client-list-availability-options.query-CdaHTgij.mjs.map +1 -0
  9. package/fesm2022/acorex-platform-module-data-management-client-list-frequency-options.query-BvsPPzFj.mjs +52 -0
  10. package/fesm2022/acorex-platform-module-data-management-client-list-frequency-options.query-BvsPPzFj.mjs.map +1 -0
  11. package/fesm2022/acorex-platform-module-data-management-client-list-gender-options.query-BA6Bwv66.mjs +55 -0
  12. package/fesm2022/acorex-platform-module-data-management-client-list-gender-options.query-BA6Bwv66.mjs.map +1 -0
  13. package/fesm2022/acorex-platform-module-data-management-client-list-nps-scale-options.query-C8Pbp0Ow.mjs +49 -0
  14. package/fesm2022/acorex-platform-module-data-management-client-list-nps-scale-options.query-C8Pbp0Ow.mjs.map +1 -0
  15. package/fesm2022/acorex-platform-module-data-management-client-list-priority-options.query-GCuv4lU3.mjs +51 -0
  16. package/fesm2022/acorex-platform-module-data-management-client-list-priority-options.query-GCuv4lU3.mjs.map +1 -0
  17. package/fesm2022/acorex-platform-module-data-management-client-list-rating-1-10-options.query-BYBU_yzv.mjs +49 -0
  18. package/fesm2022/acorex-platform-module-data-management-client-list-rating-1-10-options.query-BYBU_yzv.mjs.map +1 -0
  19. package/fesm2022/acorex-platform-module-data-management-client-list-rating-scale-options.query-H-jWx7_1.mjs +72 -0
  20. package/fesm2022/acorex-platform-module-data-management-client-list-rating-scale-options.query-H-jWx7_1.mjs.map +1 -0
  21. package/fesm2022/acorex-platform-module-data-management-client-list-satisfaction-options.query-BIDjWNP5.mjs +67 -0
  22. package/fesm2022/acorex-platform-module-data-management-client-list-satisfaction-options.query-BIDjWNP5.mjs.map +1 -0
  23. package/fesm2022/acorex-platform-module-data-management-client-list-yes-no-maybe-options.query-C90RnQ5A.mjs +50 -0
  24. package/fesm2022/acorex-platform-module-data-management-client-list-yes-no-maybe-options.query-C90RnQ5A.mjs.map +1 -0
  25. package/fesm2022/acorex-platform-module-data-management-client-list-yes-no-na-options.query-tz9dR33P.mjs +53 -0
  26. package/fesm2022/acorex-platform-module-data-management-client-list-yes-no-na-options.query-tz9dR33P.mjs.map +1 -0
  27. package/fesm2022/acorex-platform-module-data-management-client-list-yes-no-options.query-w2mqJJNZ.mjs +49 -0
  28. package/fesm2022/acorex-platform-module-data-management-client-list-yes-no-options.query-w2mqJJNZ.mjs.map +1 -0
  29. package/fesm2022/acorex-platform-module-data-management-client.mjs +8397 -0
  30. package/fesm2022/acorex-platform-module-data-management-client.mjs.map +1 -0
  31. package/package.json +28 -0
  32. package/types/acorex-platform-module-data-management-client-contracts.d.ts +429 -0
  33. package/types/acorex-platform-module-data-management-client.d.ts +1798 -0
@@ -0,0 +1,298 @@
1
+ import { AXPEntityDefinitionRegistryService } from '@acorex-platform/framework-client/layout/entity';
2
+ import { AXPPageLayoutBaseComponent, AXPPageLayoutBase } from '@acorex-platform/framework-client/layout/views';
3
+ import * as i0 from '@angular/core';
4
+ import { input, viewChild, inject, signal, computed, effect, untracked, ChangeDetectionStrategy, Component, Injectable } from '@angular/core';
5
+ import { ActivatedRoute } from '@angular/router';
6
+ import { isEqual, get, cloneDeep } from 'lodash';
7
+ import { AXMMetaDataBuilderRecordService, AXPMetaDataBuilderGroupsComponent, META_DATA_BUILDER_PAGE_COMPONENT_KEY } from './acorex-platform-module-data-management-client.mjs';
8
+
9
+ /** Command names used by the meta-data-builder page toolbar actions. */
10
+ const META_DATA_BUILDER_ADD_SECTION_COMMAND = 'MetaDataBuilder:AddSection';
11
+ const META_DATA_BUILDER_PREVIEW_COMMAND = 'MetaDataBuilder:Preview';
12
+ const META_DATA_BUILDER_SAVE_COMMAND = 'MetaDataBuilder:Save';
13
+ const META_DATA_BUILDER_DISCARD_COMMAND = 'MetaDataBuilder:Discard';
14
+
15
+ /**
16
+ * Page component that renders the meta-data builder with hideHeaderActions,
17
+ * and exposes Add section, Preview, Save, and Discard as page action commands.
18
+ */
19
+ class AXPMetaDataBuilderPageComponent extends AXPPageLayoutBaseComponent {
20
+ constructor() {
21
+ super();
22
+ /** Entity record context from details view; set asynchronously by page-component-renderer. */
23
+ this.rootContext = input(/* @ts-ignore */
24
+ ...(ngDevMode ? [undefined, { debugName: "rootContext" }] : /* istanbul ignore next */ []));
25
+ this.pageConfig = input(/* @ts-ignore */
26
+ ...(ngDevMode ? [undefined, { debugName: "pageConfig" }] : /* istanbul ignore next */ []));
27
+ this.groupsRef = viewChild('groupsRef', /* @ts-ignore */
28
+ ...(ngDevMode ? [{ debugName: "groupsRef" }] : /* istanbul ignore next */ []));
29
+ this.route = inject(ActivatedRoute);
30
+ this.entityRegistry = inject(AXPEntityDefinitionRegistryService);
31
+ this.recordService = inject(AXMMetaDataBuilderRecordService);
32
+ this.hostPageLayout = inject(AXPPageLayoutBase, { optional: true, skipSelf: true });
33
+ this.entityDef = signal(null, /* @ts-ignore */
34
+ ...(ngDevMode ? [{ debugName: "entityDef" }] : /* istanbul ignore next */ []));
35
+ this.baselineValue = signal(null, /* @ts-ignore */
36
+ ...(ngDevMode ? [{ debugName: "baselineValue" }] : /* istanbul ignore next */ []));
37
+ this.committedValue = signal(null, /* @ts-ignore */
38
+ ...(ngDevMode ? [{ debugName: "committedValue" }] : /* istanbul ignore next */ []));
39
+ /** True when committed meta-data differs from last saved / loaded baseline (same pattern as questionnaire questions page). */
40
+ this.isDirty = computed(() => {
41
+ const committed = this.committedValue();
42
+ const baseline = this.baselineValue();
43
+ return !isEqual(committed ?? null, baseline ?? null);
44
+ }, /* @ts-ignore */
45
+ ...(ngDevMode ? [{ debugName: "isDirty" }] : /* istanbul ignore next */ []));
46
+ this.context = computed(() => this.rootContext() ?? {}, /* @ts-ignore */
47
+ ...(ngDevMode ? [{ debugName: "context" }] : /* istanbul ignore next */ []));
48
+ this.fieldName = computed(() => {
49
+ const config = this.pageConfig();
50
+ return config && typeof config.field === 'string'
51
+ ? config.field
52
+ : 'metaDataList';
53
+ }, /* @ts-ignore */
54
+ ...(ngDevMode ? [{ debugName: "fieldName" }] : /* istanbul ignore next */ []));
55
+ this.entityKey = computed(() => {
56
+ const moduleName = this.route.snapshot.parent?.paramMap.get('module');
57
+ const entityName = this.route.snapshot.paramMap.get('entity');
58
+ return moduleName && entityName ? `${moduleName}.${entityName}` : '';
59
+ }, /* @ts-ignore */
60
+ ...(ngDevMode ? [{ debugName: "entityKey" }] : /* istanbul ignore next */ []));
61
+ this.recordId = computed(() => {
62
+ const ctx = this.context();
63
+ const id = get(ctx, 'id');
64
+ return id != null ? String(id) : '';
65
+ }, /* @ts-ignore */
66
+ ...(ngDevMode ? [{ debugName: "recordId" }] : /* istanbul ignore next */ []));
67
+ this.#syncFromContext = effect(() => {
68
+ const ctx = this.rootContext();
69
+ if (ctx == null) {
70
+ return;
71
+ }
72
+ const field = this.fieldName();
73
+ const value = field ? get(ctx, field) : undefined;
74
+ this.baselineValue.set(value ?? null);
75
+ this.committedValue.set(value ?? null);
76
+ untracked(() => this.recompute());
77
+ }, /* @ts-ignore */
78
+ ...(ngDevMode ? [{ debugName: "#syncFromContext" }] : /* istanbul ignore next */ []));
79
+ this.groupsOptions = computed(() => ({ hideHeaderActions: true }), /* @ts-ignore */
80
+ ...(ngDevMode ? [{ debugName: "groupsOptions" }] : /* istanbul ignore next */ []));
81
+ effect((onCleanup) => {
82
+ const moduleName = this.route.snapshot.parent?.paramMap.get('module');
83
+ const entityName = this.route.snapshot.paramMap.get('entity');
84
+ if (!moduleName || !entityName) {
85
+ this.entityDef.set(null);
86
+ return;
87
+ }
88
+ let cancelled = false;
89
+ this.entityRegistry.resolve(moduleName, entityName).then((entity) => {
90
+ if (!cancelled)
91
+ this.entityDef.set(entity);
92
+ });
93
+ onCleanup(() => {
94
+ cancelled = true;
95
+ });
96
+ });
97
+ }
98
+ #syncFromContext;
99
+ onValueChange(value) {
100
+ this.committedValue.set(value);
101
+ this.updateRootContextField(this.fieldName(), value);
102
+ this.recompute();
103
+ }
104
+ getWizardStepContext() {
105
+ const field = this.fieldName();
106
+ const value = this.committedValue();
107
+ if (!field || value == null) {
108
+ return null;
109
+ }
110
+ return { [field]: cloneDeep(value) };
111
+ }
112
+ hasUnsavedChanges() {
113
+ return this.isDirty();
114
+ }
115
+ async getPrimaryMenuItems() {
116
+ const addSectionTitle = (await this.translateService.translateAsync('@data-management:metadata-definitions.actions.add-group.title')) ||
117
+ 'Add section';
118
+ const previewTitle = (await this.translateService.translateAsync('@data-management:metadata-definitions.actions.preview.title')) ||
119
+ 'Preview';
120
+ const saveTitle = (await this.translateService.translateAsync('@general:actions.save.title')) || 'Save';
121
+ const discardTitle = (await this.translateService.translateAsync('@general:actions.discard.title')) || 'Discard';
122
+ return [
123
+ {
124
+ title: addSectionTitle,
125
+ icon: 'fa-light fa-layer-group',
126
+ zone: 'header',
127
+ priority: 'primary',
128
+ color: 'primary',
129
+ command: { name: META_DATA_BUILDER_ADD_SECTION_COMMAND, options: {} },
130
+ },
131
+ {
132
+ title: previewTitle,
133
+ icon: 'fa-light fa-eye',
134
+ zone: 'header',
135
+ priority: 'primary',
136
+ color: 'default',
137
+ command: { name: META_DATA_BUILDER_PREVIEW_COMMAND, options: {} },
138
+ },
139
+ {
140
+ title: discardTitle,
141
+ icon: 'fa-light fa-rotate-left',
142
+ zone: 'footer',
143
+ priority: 'secondary',
144
+ color: 'default',
145
+ visible: this.isDirty(),
146
+ command: { name: META_DATA_BUILDER_DISCARD_COMMAND, options: {} },
147
+ },
148
+ {
149
+ title: saveTitle,
150
+ icon: 'fa-light fa-floppy-disk',
151
+ zone: 'footer',
152
+ priority: 'primary',
153
+ color: 'primary',
154
+ visible: this.isDirty(),
155
+ command: { name: META_DATA_BUILDER_SAVE_COMMAND, options: {} },
156
+ },
157
+ ];
158
+ }
159
+ async execute(command) {
160
+ const groups = this.groupsRef();
161
+ if (command.name === META_DATA_BUILDER_ADD_SECTION_COMMAND) {
162
+ await groups?.addSection();
163
+ return;
164
+ }
165
+ if (command.name === META_DATA_BUILDER_PREVIEW_COMMAND) {
166
+ await groups?.handlePreviewClick();
167
+ return;
168
+ }
169
+ if (command.name === META_DATA_BUILDER_SAVE_COMMAND) {
170
+ await this.handleSave();
171
+ return;
172
+ }
173
+ if (command.name === META_DATA_BUILDER_DISCARD_COMMAND) {
174
+ this.handleDiscard();
175
+ return;
176
+ }
177
+ }
178
+ async handleSave() {
179
+ const entity = this.entityKey();
180
+ const id = this.recordId();
181
+ const field = this.fieldName();
182
+ const value = this.committedValue();
183
+ if (!entity || !id || !field) {
184
+ this.toastService.show({
185
+ color: 'danger',
186
+ title: await this.translateService.translateAsync('@general:messages.error.title'),
187
+ content: await this.translateService.translateAsync('@general:messages.entity.invalid-data'),
188
+ });
189
+ return;
190
+ }
191
+ try {
192
+ await this.recordService.updateRecord(entity, id, { [field]: value ?? { groups: [] } });
193
+ const saved = value ?? { groups: [] };
194
+ this.baselineValue.set(saved);
195
+ this.committedValue.set(saved);
196
+ this.updateRootContextField(field, saved);
197
+ this.recompute();
198
+ this.toastService.show({
199
+ color: 'success',
200
+ title: await this.translateService.translateAsync('@general:messages.generic.success.title'),
201
+ content: await this.translateService.translateAsync('@general:messages.generic.success.description'),
202
+ location: 'bottom-center',
203
+ closeButton: true,
204
+ timeOut: 3000,
205
+ timeOutProgress: true,
206
+ });
207
+ }
208
+ catch {
209
+ this.toastService.show({
210
+ color: 'danger',
211
+ title: await this.translateService.translateAsync('@general:messages.error.title'),
212
+ content: await this.translateService.translateAsync('@general:messages.entity.update-failed'),
213
+ });
214
+ }
215
+ }
216
+ handleDiscard() {
217
+ const baseline = this.baselineValue();
218
+ this.committedValue.set(baseline ?? null);
219
+ this.recompute();
220
+ }
221
+ recompute() {
222
+ super.recompute();
223
+ const maybeLayout = this.hostPageLayout;
224
+ maybeLayout?.recompute?.();
225
+ }
226
+ /** Keeps details-view `rootContext` in sync so sidebar navigation remounts with latest data. */
227
+ updateRootContextField(field, value) {
228
+ const ctx = this.rootContext();
229
+ if (!ctx || typeof ctx !== 'object') {
230
+ return;
231
+ }
232
+ ctx[field] = cloneDeep(value);
233
+ }
234
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPMetaDataBuilderPageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
235
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.8", type: AXPMetaDataBuilderPageComponent, isStandalone: true, selector: "axp-meta-data-builder-page", inputs: { rootContext: { classPropertyName: "rootContext", publicName: "rootContext", isSignal: true, isRequired: false, transformFunction: null }, pageConfig: { classPropertyName: "pageConfig", publicName: "pageConfig", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.axp-page-layout-base": "true" } }, providers: [
236
+ {
237
+ provide: AXPPageLayoutBase,
238
+ useExisting: AXPMetaDataBuilderPageComponent,
239
+ },
240
+ ], viewQueries: [{ propertyName: "groupsRef", first: true, predicate: ["groupsRef"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: `
241
+ <axp-meta-data-builder-groups
242
+ #groupsRef
243
+ [value]="committedValue()"
244
+ [options]="groupsOptions()"
245
+ (valueChange)="onValueChange($event)"
246
+ />
247
+ `, isInline: true, dependencies: [{ kind: "component", type: AXPMetaDataBuilderGroupsComponent, selector: "axp-meta-data-builder-groups", inputs: ["value", "options", "contextPath"], outputs: ["valueChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
248
+ }
249
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPMetaDataBuilderPageComponent, decorators: [{
250
+ type: Component,
251
+ args: [{
252
+ selector: 'axp-meta-data-builder-page',
253
+ standalone: true,
254
+ imports: [AXPMetaDataBuilderGroupsComponent],
255
+ providers: [
256
+ {
257
+ provide: AXPPageLayoutBase,
258
+ useExisting: AXPMetaDataBuilderPageComponent,
259
+ },
260
+ ],
261
+ template: `
262
+ <axp-meta-data-builder-groups
263
+ #groupsRef
264
+ [value]="committedValue()"
265
+ [options]="groupsOptions()"
266
+ (valueChange)="onValueChange($event)"
267
+ />
268
+ `,
269
+ changeDetection: ChangeDetectionStrategy.OnPush,
270
+ host: {
271
+ '[class.axp-page-layout-base]': 'true',
272
+ },
273
+ }]
274
+ }], ctorParameters: () => [], propDecorators: { rootContext: [{ type: i0.Input, args: [{ isSignal: true, alias: "rootContext", required: false }] }], pageConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageConfig", required: false }] }], groupsRef: [{ type: i0.ViewChild, args: ['groupsRef', { isSignal: true }] }] } });
275
+
276
+ var metaDataBuilderPage_component = /*#__PURE__*/Object.freeze({
277
+ __proto__: null,
278
+ AXPMetaDataBuilderPageComponent: AXPMetaDataBuilderPageComponent
279
+ });
280
+
281
+ class AXMMetaDataBuilderPageComponentProvider {
282
+ async components() {
283
+ return [
284
+ {
285
+ key: META_DATA_BUILDER_PAGE_COMPONENT_KEY,
286
+ loader: () => Promise.resolve().then(function () { return metaDataBuilderPage_component; }).then((m) => m.AXPMetaDataBuilderPageComponent),
287
+ },
288
+ ];
289
+ }
290
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMMetaDataBuilderPageComponentProvider, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
291
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMMetaDataBuilderPageComponentProvider }); }
292
+ }
293
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMMetaDataBuilderPageComponentProvider, decorators: [{
294
+ type: Injectable
295
+ }] });
296
+
297
+ export { AXMMetaDataBuilderPageComponentProvider, AXPMetaDataBuilderPageComponent, META_DATA_BUILDER_ADD_SECTION_COMMAND, META_DATA_BUILDER_DISCARD_COMMAND, META_DATA_BUILDER_PREVIEW_COMMAND, META_DATA_BUILDER_SAVE_COMMAND };
298
+ //# sourceMappingURL=acorex-platform-module-data-management-client-index-CMxKYDas.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-data-management-client-index-CMxKYDas.mjs","sources":["../../../../libs/modules/data-management/client/src/lib/features/meta-data/meta-data-builder/meta-data-builder-page/meta-data-builder-page.commands.ts","../../../../libs/modules/data-management/client/src/lib/features/meta-data/meta-data-builder/meta-data-builder-page/meta-data-builder-page.component.ts","../../../../libs/modules/data-management/client/src/lib/features/meta-data/meta-data-builder/meta-data-builder-page/meta-data-builder-page-component.provider.ts"],"sourcesContent":["/** Command names used by the meta-data-builder page toolbar actions. */\nexport const META_DATA_BUILDER_ADD_SECTION_COMMAND = 'MetaDataBuilder:AddSection';\nexport const META_DATA_BUILDER_PREVIEW_COMMAND = 'MetaDataBuilder:Preview';\nexport const META_DATA_BUILDER_SAVE_COMMAND = 'MetaDataBuilder:Save';\nexport const META_DATA_BUILDER_DISCARD_COMMAND = 'MetaDataBuilder:Discard';\n","\nimport { AXPEntity } from '@acorex-platform/framework-shared/entity';\nimport { AXPEntityDefinitionRegistryService } from '@acorex-platform/framework-client/layout/entity';\nimport type { AXPLayoutDetailsViewAction } from '@acorex-platform/framework-client/layout/views';\nimport { AXPPageLayoutBase, AXPPageLayoutBaseComponent } from '@acorex-platform/framework-client/layout/views';\n\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n inject,\n input,\n signal,\n untracked,\n viewChild,\n} from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { cloneDeep, get, isEqual } from 'lodash';\nimport { AXPMetaDataBuilderGroupsComponent } from '../meta-data-builder-groups.component';\nimport { AXMMetaDataBuilderRecordService } from '../meta-data-builder-record.service';\nimport type { AXMMetaDataBuilderValue } from '@acorex-platform/module-data-management-client/contracts';\nimport {\n META_DATA_BUILDER_ADD_SECTION_COMMAND,\n META_DATA_BUILDER_DISCARD_COMMAND,\n META_DATA_BUILDER_PREVIEW_COMMAND,\n META_DATA_BUILDER_SAVE_COMMAND,\n} from './meta-data-builder-page.commands';\n\n/**\n * Page component that renders the meta-data builder with hideHeaderActions,\n * and exposes Add section, Preview, Save, and Discard as page action commands.\n */\n@Component({\n selector: 'axp-meta-data-builder-page',\n standalone: true,\n imports: [AXPMetaDataBuilderGroupsComponent],\n providers: [\n {\n provide: AXPPageLayoutBase,\n useExisting: AXPMetaDataBuilderPageComponent,\n },\n ],\n template: `\n <axp-meta-data-builder-groups\n #groupsRef\n [value]=\"committedValue()\"\n [options]=\"groupsOptions()\"\n (valueChange)=\"onValueChange($event)\"\n />\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class.axp-page-layout-base]': 'true',\n },\n})\nexport class AXPMetaDataBuilderPageComponent extends AXPPageLayoutBaseComponent {\n /** Entity record context from details view; set asynchronously by page-component-renderer. */\n rootContext = input<Record<string, unknown>>();\n\n pageConfig = input<Record<string, unknown>>();\n\n protected groupsRef = viewChild<AXPMetaDataBuilderGroupsComponent>('groupsRef');\n\n private route = inject(ActivatedRoute);\n private entityRegistry = inject(AXPEntityDefinitionRegistryService);\n private recordService = inject(AXMMetaDataBuilderRecordService);\n private hostPageLayout = inject(AXPPageLayoutBase, { optional: true, skipSelf: true });\n\n private entityDef = signal<AXPEntity | null>(null);\n\n private baselineValue = signal<AXMMetaDataBuilderValue | null | undefined>(null);\n protected committedValue = signal<AXMMetaDataBuilderValue | null | undefined>(null);\n\n /** True when committed meta-data differs from last saved / loaded baseline (same pattern as questionnaire questions page). */\n protected isDirty = computed(() => {\n const committed = this.committedValue();\n const baseline = this.baselineValue();\n return !isEqual(committed ?? null, baseline ?? null);\n });\n\n constructor() {\n super();\n effect((onCleanup) => {\n const moduleName = this.route.snapshot.parent?.paramMap.get('module');\n const entityName = this.route.snapshot.paramMap.get('entity');\n if (!moduleName || !entityName) {\n this.entityDef.set(null);\n return;\n }\n let cancelled = false;\n this.entityRegistry.resolve(moduleName, entityName).then((entity) => {\n if (!cancelled) this.entityDef.set(entity);\n });\n onCleanup(() => {\n cancelled = true;\n });\n });\n }\n\n protected context = computed(() => this.rootContext() ?? {});\n\n protected fieldName = computed(() => {\n const config = this.pageConfig();\n return config && typeof (config as { field?: string }).field === 'string'\n ? (config as { field: string }).field\n : 'metaDataList';\n });\n\n protected entityKey = computed(() => {\n const moduleName = this.route.snapshot.parent?.paramMap.get('module');\n const entityName = this.route.snapshot.paramMap.get('entity');\n return moduleName && entityName ? `${moduleName}.${entityName}` : '';\n });\n\n protected recordId = computed(() => {\n const ctx = this.context();\n const id = get(ctx, 'id');\n return id != null ? String(id) : '';\n });\n\n #syncFromContext = effect(() => {\n const ctx = this.rootContext();\n if (ctx == null) {\n return;\n }\n\n const field = this.fieldName();\n const value = field ? (get(ctx, field) as AXMMetaDataBuilderValue) : undefined;\n this.baselineValue.set(value ?? null);\n this.committedValue.set(value ?? null);\n untracked(() => this.recompute());\n });\n\n protected groupsOptions = computed(() => ({ hideHeaderActions: true }));\n\n protected onValueChange(value: AXMMetaDataBuilderValue): void {\n this.committedValue.set(value);\n this.updateRootContextField(this.fieldName(), value);\n this.recompute();\n }\n\n override getWizardStepContext(): Record<string, unknown> | null {\n const field = this.fieldName();\n const value = this.committedValue();\n if (!field || value == null) {\n return null;\n }\n return { [field]: cloneDeep(value) };\n }\n\n override hasUnsavedChanges(): boolean {\n return this.isDirty();\n }\n\n override async getPrimaryMenuItems(): Promise<AXPLayoutDetailsViewAction[]> {\n const addSectionTitle =\n (await this.translateService.translateAsync('@data-management:metadata-definitions.actions.add-group.title')) ||\n 'Add section';\n const previewTitle =\n (await this.translateService.translateAsync('@data-management:metadata-definitions.actions.preview.title')) ||\n 'Preview';\n const saveTitle = (await this.translateService.translateAsync('@general:actions.save.title')) || 'Save';\n const discardTitle = (await this.translateService.translateAsync('@general:actions.discard.title')) || 'Discard';\n\n return [\n {\n title: addSectionTitle,\n icon: 'fa-light fa-layer-group',\n zone: 'header',\n priority: 'primary',\n color: 'primary',\n command: { name: META_DATA_BUILDER_ADD_SECTION_COMMAND, options: {} },\n },\n {\n title: previewTitle,\n icon: 'fa-light fa-eye',\n zone: 'header',\n priority: 'primary',\n color: 'default',\n command: { name: META_DATA_BUILDER_PREVIEW_COMMAND, options: {} },\n },\n {\n title: discardTitle,\n icon: 'fa-light fa-rotate-left',\n zone: 'footer',\n priority: 'secondary',\n color: 'default',\n visible: this.isDirty(),\n command: { name: META_DATA_BUILDER_DISCARD_COMMAND, options: {} },\n },\n {\n title: saveTitle,\n icon: 'fa-light fa-floppy-disk',\n zone: 'footer',\n priority: 'primary',\n color: 'primary',\n visible: this.isDirty(),\n command: { name: META_DATA_BUILDER_SAVE_COMMAND, options: {} },\n },\n ];\n }\n\n override async execute(command: { name: string; options?: unknown }): Promise<void> {\n const groups = this.groupsRef();\n if (command.name === META_DATA_BUILDER_ADD_SECTION_COMMAND) {\n await groups?.addSection();\n return;\n }\n if (command.name === META_DATA_BUILDER_PREVIEW_COMMAND) {\n await groups?.handlePreviewClick();\n return;\n }\n if (command.name === META_DATA_BUILDER_SAVE_COMMAND) {\n await this.handleSave();\n return;\n }\n if (command.name === META_DATA_BUILDER_DISCARD_COMMAND) {\n this.handleDiscard();\n return;\n }\n }\n\n private async handleSave(): Promise<void> {\n const entity = this.entityKey();\n const id = this.recordId();\n const field = this.fieldName();\n const value = this.committedValue();\n if (!entity || !id || !field) {\n this.toastService.show({\n color: 'danger',\n title: await this.translateService.translateAsync('@general:messages.error.title'),\n content: await this.translateService.translateAsync('@general:messages.entity.invalid-data'),\n });\n return;\n }\n try {\n await this.recordService.updateRecord(entity, id, { [field]: value ?? { groups: [] } });\n const saved = value ?? { groups: [] };\n this.baselineValue.set(saved);\n this.committedValue.set(saved);\n this.updateRootContextField(field, saved);\n this.recompute();\n this.toastService.show({\n color: 'success',\n title: await this.translateService.translateAsync('@general:messages.generic.success.title'),\n content: await this.translateService.translateAsync('@general:messages.generic.success.description'),\n location: 'bottom-center',\n closeButton: true,\n timeOut: 3000,\n timeOutProgress: true,\n });\n } catch {\n this.toastService.show({\n color: 'danger',\n title: await this.translateService.translateAsync('@general:messages.error.title'),\n content: await this.translateService.translateAsync('@general:messages.entity.update-failed'),\n });\n }\n }\n\n private handleDiscard(): void {\n const baseline = this.baselineValue();\n this.committedValue.set(baseline ?? null);\n this.recompute();\n }\n\n protected override recompute(): void {\n super.recompute();\n const maybeLayout = this.hostPageLayout as unknown as { recompute?: () => void };\n maybeLayout?.recompute?.();\n }\n\n /** Keeps details-view `rootContext` in sync so sidebar navigation remounts with latest data. */\n private updateRootContextField(field: string, value: unknown): void {\n const ctx = this.rootContext() as Record<string, unknown> | undefined;\n if (!ctx || typeof ctx !== 'object') {\n return;\n }\n ctx[field] = cloneDeep(value);\n }\n}\n","import {\n AXPPageComponentDefinition,\n AXPPageComponentProvider,\n} from '@acorex-platform/framework-client/layout/components';\nimport { Injectable } from '@angular/core';\nimport { META_DATA_BUILDER_PAGE_COMPONENT_KEY } from '../meta-data-builder.plugin';\n\n@Injectable()\nexport class AXMMetaDataBuilderPageComponentProvider implements AXPPageComponentProvider {\n async components(): Promise<AXPPageComponentDefinition[]> {\n return [\n {\n key: META_DATA_BUILDER_PAGE_COMPONENT_KEY,\n loader: () =>\n import('./meta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uccessCollection, runtimeQueryFailure } from '@acorex-platform/framework-shared/core';
3
+ import { applyFilterArray, applySortArray } from '@acorex-platform/framework-client/core';
4
+ import * as i0 from '@angular/core';
5
+ import { Injectable } from '@angular/core';
6
+
7
+ //#endregion
8
+ //#region ---- Constants ----
9
+ /** Same rows as the former `agreement-scale-options` registry data source. */
10
+ const AGREEMENT_SCALE_OPTIONS = [
11
+ {
12
+ value: 'strongly-disagree',
13
+ title: '@questionnaire:datasources.agreement-scale-options.samples.strongly-disagree',
14
+ },
15
+ {
16
+ value: 'disagree',
17
+ title: '@questionnaire:datasources.agreement-scale-options.samples.disagree',
18
+ },
19
+ {
20
+ value: 'neutral',
21
+ title: '@questionnaire:datasources.agreement-scale-options.samples.neutral',
22
+ },
23
+ {
24
+ value: 'agree',
25
+ title: '@questionnaire:datasources.agreement-scale-options.samples.agree',
26
+ },
27
+ {
28
+ value: 'strongly-agree',
29
+ title: '@questionnaire:datasources.agreement-scale-options.samples.strongly-agree',
30
+ },
31
+ ];
32
+ //#endregion
33
+ //#region ---- Query ----
34
+ /**
35
+ * Static agreement Likert catalog — replaces the `agreement-scale-options` DI data source.
36
+ */
37
+ class AXMListAgreementScaleOptionsQuery {
38
+ //#region ---- Query Execution ----
39
+ async fetch(input) {
40
+ try {
41
+ let items = [...AGREEMENT_SCALE_OPTIONS];
42
+ if (input?.filter) {
43
+ items = applyFilterArray(items, [input.filter]);
44
+ }
45
+ const rawSort = Array.isArray(input?.sort) ? input.sort : input?.sort ? [input.sort] : [];
46
+ const sortOpt = rawSort.length > 0 ? rawSort : [{ field: 'value', dir: 'asc' }];
47
+ items = applySortArray(items, sortOpt);
48
+ const skip = resolveCollectionSkip(input?.skip);
49
+ const take = resolveCollectionTake(input?.take);
50
+ const total = items.length;
51
+ const page = items.slice(skip, skip + take);
52
+ return runtimeQuerySuccessCollection({ items: page, total });
53
+ }
54
+ catch (error) {
55
+ return runtimeQueryFailure(error instanceof Error ? error.message : 'Unknown error occurred');
56
+ }
57
+ }
58
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMListAgreementScaleOptionsQuery, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
59
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMListAgreementScaleOptionsQuery, providedIn: 'root' }); }
60
+ }
61
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMListAgreementScaleOptionsQuery, decorators: [{
62
+ type: Injectable,
63
+ args: [{ providedIn: 'root' }]
64
+ }] });
65
+
66
+ export { AXMListAgreementScaleOptionsQuery };
67
+ //# sourceMappingURL=acorex-platform-module-data-management-client-list-agreement-scale-options.query-Dl7jMXp1.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-data-management-client-list-agreement-scale-options.query-Dl7jMXp1.mjs","sources":["../../../../libs/modules/data-management/client/src/lib/features/queries/list-agreement-scale-options.query.ts"],"sourcesContent":["import {\n resolveCollectionSkip,\n resolveCollectionTake,\n type AXPCollectionQuery,\n type AXPCollectionQueryInput,\n type AXPQueryCollectionFetchResultPromise,\n} from '@acorex-platform/framework-shared/runtime';\nimport {\n runtimeQueryFailure,\n runtimeQuerySuccessCollection,\n} from '@acorex-platform/framework-shared/core';\nimport { applyFilterArray, applySortArray } from '@acorex-platform/framework-client/core';\n\nimport { Injectable } from '@angular/core';\n\n//#region ---- Types ----\n\nexport type AXMListAgreementScaleOptionsQueryInput = AXPCollectionQueryInput;\n\nexport interface AXMListAgreementScaleOptionsQueryItem {\n /** Stored choice code. */\n value: string;\n /** Display title (i18n key). */\n title: string;\n}\n\n//#endregion\n\n//#region ---- Constants ----\n\n/** Same rows as the former `agreement-scale-options` registry data source. */\nconst AGREEMENT_SCALE_OPTIONS: AXMListAgreementScaleOptionsQueryItem[] = [\n {\n value: 'strongly-disagree',\n title: '@questionnaire:datasources.agreement-scale-options.samples.strongly-disagree',\n },\n {\n value: 'disagree',\n title: '@questionnaire:datasources.agreement-scale-options.samples.disagree',\n },\n {\n value: 'neutral',\n title: '@questionnaire:datasources.agreement-scale-options.samples.neutral',\n },\n {\n value: 'agree',\n title: '@questionnaire:datasources.agreement-scale-options.samples.agree',\n },\n {\n value: 'strongly-agree',\n title: '@questionnaire:datasources.agreement-scale-options.samples.strongly-agree',\n },\n];\n\n//#endregion\n\n//#region ---- Query ----\n\n/**\n * Static agreement Likert catalog — replaces the `agreement-scale-options` DI data source.\n */\n@Injectable({ providedIn: 'root' })\nexport class AXMListAgreementScaleOptionsQuery\n implements\n AXPCollectionQuery<AXMListAgreementScaleOptionsQueryInput, AXMListAgreementScaleOptionsQueryItem>\n{\n //#region ---- Query Execution ----\n\n async fetch(\n input?: AXMListAgreementScaleOptionsQueryInput | null,\n ): AXPQueryCollectionFetchResultPromise<AXMListAgreementScaleOptionsQueryItem> {\n try {\n let items = [...AGREEMENT_SCALE_OPTIONS];\n\n if (input?.filter) {\n items = applyFilterArray(items, [input.filter]);\n }\n\n const rawSort = Array.isArray(input?.sort) ? input.sort : input?.sort ? [input.sort] : [];\n const sortOpt = rawSort.length > 0 ? rawSort : [{ field: 'value' as const, dir: 'asc' as const }];\n items = applySortArray(items, sortOpt);\n\n const skip = resolveCollectionSkip(input?.skip);\n const take = resolveCollectionTake(input?.take);\n const total = items.length;\n const page = items.slice(skip, skip + take);\n\n return runtimeQuerySuccessCollection({ items: page, total });\n } catch (error) {\n return runtimeQueryFailure(\n error instanceof Error ? error.message : 'Unknown error occurred',\n );\n }\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;AA0BA;AAEA;AAEA;AACA,MAAM,uBAAuB,GAA4C;AACvE,IAAA;AACE,QAAA,KAAK,EAAE,mBAAmB;AAC1B,QAAA,KAAK,EAAE,8EAA8E;AACtF,KAAA;AACD,IAAA;AACE,QAAA,KAAK,EAAE,UAAU;AACjB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AE3C,OAAO,6BAA6B,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;QAC9D;QAAE,OAAO,KAAK,EAAE;AACd,YAAA,OAAO,mBAAmB,CACxB,KAAK,YAAY,KAAK,GAAG,KAAK,CAAC,OAAO,GAAG,wBAAwB,CAClE;QACH;IACF;8GA/BW,iCAAiC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAjC,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,iCAAiC,cADpB,MAAM,EAAA,CAAA,CAAA;;2FACnB,iCAAiC,EAAA,UAAA,EAAA,CAAA;kBAD7C,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
@@ -0,0 +1,64 @@
1
+ import { resolveCollectionSkip, resolveCollectionTake } from '@acorex-platform/framework-shared/runtime';
2
+ import { runtimeQuerySuccessCollection, runtimeQueryFailure } from '@acorex-platform/framework-shared/core';
3
+ import { applyFilterArray, applySortArray } from '@acorex-platform/framework-client/core';
4
+ import * as i0 from '@angular/core';
5
+ import { Injectable } from '@angular/core';
6
+
7
+ //#endregion
8
+ //#region ---- Constants ----
9
+ /** Same rows as the former `availability-options` registry data source. */
10
+ const AVAILABILITY_OPTIONS = [
11
+ { value: '24-7', title: '@data-management:datasources.availability-options.samples.24-7' },
12
+ {
13
+ value: 'business-hours',
14
+ title: '@data-management:datasources.availability-options.samples.business-hours',
15
+ },
16
+ {
17
+ value: 'weekdays',
18
+ title: '@data-management:datasources.availability-options.samples.weekdays',
19
+ },
20
+ {
21
+ value: 'weekends',
22
+ title: '@data-management:datasources.availability-options.samples.weekends',
23
+ },
24
+ {
25
+ value: 'limited-hours',
26
+ title: '@data-management:datasources.availability-options.samples.limited-hours',
27
+ },
28
+ ];
29
+ //#endregion
30
+ //#region ---- Query ----
31
+ /**
32
+ * Static availability catalog — replaces the `availability-options` DI data source.
33
+ */
34
+ class AXMListAvailabilityOptionsQuery {
35
+ //#region ---- Query Execution ----
36
+ async fetch(input) {
37
+ try {
38
+ let items = [...AVAILABILITY_OPTIONS];
39
+ if (input?.filter) {
40
+ items = applyFilterArray(items, [input.filter]);
41
+ }
42
+ const rawSort = Array.isArray(input?.sort) ? input.sort : input?.sort ? [input.sort] : [];
43
+ const sortOpt = rawSort.length > 0 ? rawSort : [{ field: 'value', dir: 'asc' }];
44
+ items = applySortArray(items, sortOpt);
45
+ const skip = resolveCollectionSkip(input?.skip);
46
+ const take = resolveCollectionTake(input?.take);
47
+ const total = items.length;
48
+ const page = items.slice(skip, skip + take);
49
+ return runtimeQuerySuccessCollection({ items: page, total });
50
+ }
51
+ catch (error) {
52
+ return runtimeQueryFailure(error instanceof Error ? error.message : 'Unknown error occurred');
53
+ }
54
+ }
55
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMListAvailabilityOptionsQuery, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
56
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMListAvailabilityOptionsQuery, providedIn: 'root' }); }
57
+ }
58
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMListAvailabilityOptionsQuery, decorators: [{
59
+ type: Injectable,
60
+ args: [{ providedIn: 'root' }]
61
+ }] });
62
+
63
+ export { AXMListAvailabilityOptionsQuery };
64
+ //# sourceMappingURL=acorex-platform-module-data-management-client-list-availability-options.query-CdaHTgij.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-data-management-client-list-availability-options.query-CdaHTgij.mjs","sources":["../../../../libs/modules/data-management/client/src/lib/features/queries/list-availability-options.query.ts"],"sourcesContent":["import {\n resolveCollectionSkip,\n resolveCollectionTake,\n type AXPCollectionQuery,\n type AXPCollectionQueryInput,\n type AXPQueryCollectionFetchResultPromise,\n} from '@acorex-platform/framework-shared/runtime';\nimport {\n runtimeQueryFailure,\n runtimeQuerySuccessCollection,\n} from '@acorex-platform/framework-shared/core';\nimport { applyFilterArray, applySortArray } from '@acorex-platform/framework-client/core';\n\nimport { Injectable } from '@angular/core';\n\n//#region ---- Types ----\n\nexport type AXMListAvailabilityOptionsQueryInput = AXPCollectionQueryInput;\n\nexport interface AXMListAvailabilityOptionsQueryItem {\n /** Stored choice code. */\n value: string;\n /** Display title (i18n key). */\n title: string;\n}\n\n//#endregion\n\n//#region ---- Constants ----\n\n/** Same rows as the former `availability-options` registry data source. */\nconst AVAILABILITY_OPTIONS: AXMListAvailabilityOptionsQueryItem[] = [\n { value: '24-7', title: '@data-management:datasources.availability-options.samples.24-7' },\n {\n value: 'business-hours',\n title: '@data-management:datasources.availability-options.samples.business-hours',\n },\n {\n value: 'weekdays',\n title: '@data-management:datasources.availability-options.samples.weekdays',\n },\n {\n value: 'weekends',\n title: '@data-management:datasources.availability-options.samples.weekends',\n },\n {\n value: 'limited-hours',\n title: '@data-management:datasources.availability-options.samples.limited-hours',\n },\n];\n\n//#endregion\n\n//#region ---- Query ----\n\n/**\n * Static availability catalog — replaces the `availability-options` DI data source.\n */\n@Injectable({ providedIn: 'root' })\nexport class AXMListAvailabilityOptionsQuery\n implements AXPCollectionQuery<AXMListAvailabilityOptionsQueryInput, AXMListAvailabilityOptionsQueryItem>\n{\n //#region ---- Query Execution ----\n\n async fetch(\n input?: AXMListAvailabilityOptionsQueryInput | null,\n ): AXPQueryCollectionFetchResultPromise<AXMListAvailabilityOptionsQueryItem> {\n try {\n let items = [...AVAILABILITY_OPTIONS];\n\n if (input?.filter) {\n items = applyFilterArray(items, [input.filter]);\n }\n\n const rawSort = Array.isArray(input?.sort) ? input.sort : input?.sort ? [input.sort] : [];\n const sortOpt = rawSort.length > 0 ? rawSort : [{ field: 'value' as const, dir: 'asc' as const }];\n items = applySortArray(items, sortOpt);\n\n const skip = resolveCollectionSkip(input?.skip);\n const take = resolveCollectionTake(input?.take);\n const total = items.length;\n const page = items.slice(skip, skip + take);\n\n return runtimeQuerySuccessCollection({ items: page, total });\n } catch (error) {\n return runtimeQueryFailure(\n error instanceof Error ? error.message : 'Unknown error occurred',\n );\n }\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;AA0BA;AAEA;AAEA;AACA,MAAM,oBAAoB,GAA0C;AAClE,IAAA,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,gEAAgE,EAAE;AAC1F,IAAA;AACE,QAAA,KAAK,EAAE,gBAAgB;AACvB,QAAA,KAAK,EAAE,0EAA0E;AAClF,KAAA;AACD,IAAA;AACE,QAAA,KAAK,EAAE,UAAU;AACjB,QAAA,KAAK,EAAE,oEAAoE;AAC5E,KAAA;AACD,IAAA;AACE,QAAA,KAAK,EAAE,UAAU;AACjB,QAAA,KAAK,EAAE,oEAAoE;AAC5E,KAAA;AACD,IAAA;AACE,QAAA,KAAK,EAAE,eAAe;AACtB,QAAA,KAAK,EAAE,yEAAyE;AACjF,KAAA;CACF;AAED;AAEA;AAEA;;AAEG;MAEU,+BAA+B,CAAA;;IAK1C,MAAM,KAAK,CACT,KAAmD,EAAA;AAEnD,QAAA,IAAI;AACF,YAAA,IAAI,KAAK,GAAG,CAAC,GAAG,oBAAoB,CAAC;AAErC,YAAA,IAAI,KAAK,EAAE,MAAM,EAAE;gBACjB,KAAK,GAAG,gBAAgB,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YACjD;AAEA,YAAA,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,KAAK,CAAC,IAAI,GAAG,KAAK,EAAE,IAAI,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE;YACzF,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,GAAG,OAAO,GAAG,CAAC,EAAE,KAAK,EAAE,OAAgB,EAAE,GAAG,EAAE,KAAc,EAAE,CAAC;AACjG,YAAA,KAAK,GAAG,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC;YAEtC,MAAM,IAAI,GAAG,qBAAqB,CAAC,KAAK,EAAE,IAAI,CAAC;YAC/C,MAAM,IAAI,GAAG,qBAAqB,CAAC,KAAK,EAAE,IAAI,CAAC;AAC/C,YAAA,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM;AAC1B,YAAA,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;YAE3C,OAAO,6BAA6B,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;QAC9D;QAAE,OAAO,KAAK,EAAE;AACd,YAAA,OAAO,mBAAmB,CACxB,KAAK,YAAY,KAAK,GAAG,KAAK,CAAC,OAAO,GAAG,wBAAwB,CAClE;QACH;IACF;8GA9BW,+BAA+B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA/B,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,+BAA+B,cADlB,MAAM,EAAA,CAAA,CAAA;;2FACnB,+BAA+B,EAAA,UAAA,EAAA,CAAA;kBAD3C,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
@@ -0,0 +1,52 @@
1
+ import { resolveCollectionSkip, resolveCollectionTake } from '@acorex-platform/framework-shared/runtime';
2
+ import { runtimeQuerySuccessCollection, runtimeQueryFailure } from '@acorex-platform/framework-shared/core';
3
+ import { applyFilterArray, applySortArray } from '@acorex-platform/framework-client/core';
4
+ import * as i0 from '@angular/core';
5
+ import { Injectable } from '@angular/core';
6
+
7
+ //#endregion
8
+ //#region ---- Constants ----
9
+ /** Same rows as the former `frequency-options` registry data source. */
10
+ const FREQUENCY_OPTIONS = [
11
+ { value: 'never', title: '@questionnaire:datasources.frequency-options.samples.never' },
12
+ { value: 'rarely', title: '@questionnaire:datasources.frequency-options.samples.rarely' },
13
+ { value: 'sometimes', title: '@questionnaire:datasources.frequency-options.samples.sometimes' },
14
+ { value: 'often', title: '@questionnaire:datasources.frequency-options.samples.often' },
15
+ { value: 'always', title: '@questionnaire:datasources.frequency-options.samples.always' },
16
+ ];
17
+ //#endregion
18
+ //#region ---- Query ----
19
+ /**
20
+ * Static frequency catalog — replaces the `frequency-options` DI data source.
21
+ */
22
+ class AXMListFrequencyOptionsQuery {
23
+ //#region ---- Query Execution ----
24
+ async fetch(input) {
25
+ try {
26
+ let items = [...FREQUENCY_OPTIONS];
27
+ if (input?.filter) {
28
+ items = applyFilterArray(items, [input.filter]);
29
+ }
30
+ const rawSort = Array.isArray(input?.sort) ? input.sort : input?.sort ? [input.sort] : [];
31
+ const sortOpt = rawSort.length > 0 ? rawSort : [{ field: 'value', dir: 'asc' }];
32
+ items = applySortArray(items, sortOpt);
33
+ const skip = resolveCollectionSkip(input?.skip);
34
+ const take = resolveCollectionTake(input?.take);
35
+ const total = items.length;
36
+ const page = items.slice(skip, skip + take);
37
+ return runtimeQuerySuccessCollection({ items: page, total });
38
+ }
39
+ catch (error) {
40
+ return runtimeQueryFailure(error instanceof Error ? error.message : 'Unknown error occurred');
41
+ }
42
+ }
43
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMListFrequencyOptionsQuery, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
44
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMListFrequencyOptionsQuery, providedIn: 'root' }); }
45
+ }
46
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMListFrequencyOptionsQuery, decorators: [{
47
+ type: Injectable,
48
+ args: [{ providedIn: 'root' }]
49
+ }] });
50
+
51
+ export { AXMListFrequencyOptionsQuery };
52
+ //# sourceMappingURL=acorex-platform-module-data-management-client-list-frequency-options.query-BvsPPzFj.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-data-management-client-list-frequency-options.query-BvsPPzFj.mjs","sources":["../../../../libs/modules/data-management/client/src/lib/features/queries/list-frequency-options.query.ts"],"sourcesContent":["import {\n resolveCollectionSkip,\n resolveCollectionTake,\n type AXPCollectionQuery,\n type AXPCollectionQueryInput,\n type AXPQueryCollectionFetchResultPromise,\n} from '@acorex-platform/framework-shared/runtime';\nimport {\n runtimeQueryFailure,\n runtimeQuerySuccessCollection,\n} from '@acorex-platform/framework-shared/core';\nimport { applyFilterArray, applySortArray } from '@acorex-platform/framework-client/core';\n\nimport { Injectable } from '@angular/core';\n\n//#region ---- Types ----\n\nexport type AXMListFrequencyOptionsQueryInput = AXPCollectionQueryInput;\n\nexport interface AXMListFrequencyOptionsQueryItem {\n /** Stored choice code. */\n value: string;\n /** Display title (i18n key). */\n title: string;\n}\n\n//#endregion\n\n//#region ---- Constants ----\n\n/** Same rows as the former `frequency-options` registry data source. */\nconst FREQUENCY_OPTIONS: AXMListFrequencyOptionsQueryItem[] = [\n { value: 'never', title: '@questionnaire:datasources.frequency-options.samples.never' },\n { value: 'rarely', title: '@questionnaire:datasources.frequency-options.samples.rarely' },\n { value: 'sometimes', title: '@questionnaire:datasources.frequency-options.samples.sometimes' },\n { value: 'often', title: '@questionnaire:datasources.frequency-options.samples.often' },\n { value: 'always', title: '@questionnaire:datasources.frequency-options.samples.always' },\n];\n\n//#endregion\n\n//#region ---- Query ----\n\n/**\n * Static frequency catalog — replaces the `frequency-options` DI data source.\n */\n@Injectable({ providedIn: 'root' })\nexport class AXMListFrequencyOptionsQuery\n implements AXPCollectionQuery<AXMListFrequencyOptionsQueryInput, AXMListFrequencyOptionsQueryItem>\n{\n //#region ---- Query Execution ----\n\n async fetch(\n input?: AXMListFrequencyOptionsQueryInput | null,\n ): AXPQueryCollectionFetchResultPromise<AXMListFrequencyOptionsQueryItem> {\n try {\n let items = [...FREQUENCY_OPTIONS];\n\n if (input?.filter) {\n items = applyFilterArray(items, [input.filter]);\n }\n\n const rawSort = Array.isArray(input?.sort) ? input.sort : input?.sort ? [input.sort] : [];\n const sortOpt = rawSort.length > 0 ? rawSort : [{ field: 'value' as const, dir: 'asc' as const }];\n items = applySortArray(items, sortOpt);\n\n const skip = resolveCollectionSkip(input?.skip);\n const take = resolveCollectionTake(input?.take);\n const total = items.length;\n const page = items.slice(skip, skip + take);\n\n return runtimeQuerySuccessCollection({ items: page, total });\n } catch (error) {\n return runtimeQueryFailure(\n error instanceof Error ? error.message : 'Unknown error occurred',\n );\n }\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;AA0BA;AAEA;AAEA;AACA,MAAM,iBAAiB,GAAuC;AAC5D,IAAA,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,4DAA4D,EAAE;AACvF,IAAA,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,6DAA6D,EAAE;AACzF,IAAA,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,gEAAgE,EAAE;AAC/F,IAAA,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,4DAA4D,EAAE;AACvF,IAAA,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,6DAA6D,EAAE;CAC1F;AAED;AAEA;AAEA;;AAEG;MAEU,4BAA4B,CAAA;;IAKvC,MAAM,KAAK,CACT,KAAgD,EAAA;AAEhD,QAAA,IAAI;AACF,YAAA,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,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;;;;;"}
@@ -0,0 +1,55 @@
1
+ import { resolveCollectionSkip, resolveCollectionTake } from '@acorex-platform/framework-shared/runtime';
2
+ import { runtimeQuerySuccessCollection, runtimeQueryFailure } from '@acorex-platform/framework-shared/core';
3
+ import { applyFilterArray, applySortArray } from '@acorex-platform/framework-client/core';
4
+ import * as i0 from '@angular/core';
5
+ import { Injectable } from '@angular/core';
6
+
7
+ //#endregion
8
+ //#region ---- Constants ----
9
+ /** Same rows as the former `gender-options` registry data source. */
10
+ const GENDER_OPTIONS = [
11
+ { value: 'female', title: '@questionnaire:datasources.gender-options.samples.female' },
12
+ { value: 'male', title: '@questionnaire:datasources.gender-options.samples.male' },
13
+ { value: 'non-binary', title: '@questionnaire:datasources.gender-options.samples.non-binary' },
14
+ {
15
+ value: 'prefer-not-to-say',
16
+ title: '@questionnaire:datasources.gender-options.samples.prefer-not-to-say',
17
+ },
18
+ { value: 'other', title: '@questionnaire:datasources.gender-options.samples.other' },
19
+ ];
20
+ //#endregion
21
+ //#region ---- Query ----
22
+ /**
23
+ * Static gender catalog — replaces the `gender-options` DI data source.
24
+ */
25
+ class AXMListGenderOptionsQuery {
26
+ //#region ---- Query Execution ----
27
+ async fetch(input) {
28
+ try {
29
+ let items = [...GENDER_OPTIONS];
30
+ if (input?.filter) {
31
+ items = applyFilterArray(items, [input.filter]);
32
+ }
33
+ const rawSort = Array.isArray(input?.sort) ? input.sort : input?.sort ? [input.sort] : [];
34
+ const sortOpt = rawSort.length > 0 ? rawSort : [{ field: 'value', dir: 'asc' }];
35
+ items = applySortArray(items, sortOpt);
36
+ const skip = resolveCollectionSkip(input?.skip);
37
+ const take = resolveCollectionTake(input?.take);
38
+ const total = items.length;
39
+ const page = items.slice(skip, skip + take);
40
+ return runtimeQuerySuccessCollection({ items: page, total });
41
+ }
42
+ catch (error) {
43
+ return runtimeQueryFailure(error instanceof Error ? error.message : 'Unknown error occurred');
44
+ }
45
+ }
46
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMListGenderOptionsQuery, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
47
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMListGenderOptionsQuery, providedIn: 'root' }); }
48
+ }
49
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMListGenderOptionsQuery, decorators: [{
50
+ type: Injectable,
51
+ args: [{ providedIn: 'root' }]
52
+ }] });
53
+
54
+ export { AXMListGenderOptionsQuery };
55
+ //# sourceMappingURL=acorex-platform-module-data-management-client-list-gender-options.query-BA6Bwv66.mjs.map