@acorex-platform/module-common-client 0.0.14

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 (44) hide show
  1. package/README.md +3 -0
  2. package/fesm2022/acorex-platform-module-common-client-acorex-platform-module-common-client-IHaYrZeE.mjs +6437 -0
  3. package/fesm2022/acorex-platform-module-common-client-acorex-platform-module-common-client-IHaYrZeE.mjs.map +1 -0
  4. package/fesm2022/acorex-platform-module-common-client-archive-entity.command-Dgsmx1_A.mjs +57 -0
  5. package/fesm2022/acorex-platform-module-common-client-archive-entity.command-Dgsmx1_A.mjs.map +1 -0
  6. package/fesm2022/acorex-platform-module-common-client-archive-entity.command.util-CEvlTSlo.mjs +144 -0
  7. package/fesm2022/acorex-platform-module-common-client-archive-entity.command.util-CEvlTSlo.mjs.map +1 -0
  8. package/fesm2022/acorex-platform-module-common-client-audit-info-column.component-DuZUwD31.mjs +158 -0
  9. package/fesm2022/acorex-platform-module-common-client-audit-info-column.component-DuZUwD31.mjs.map +1 -0
  10. package/fesm2022/acorex-platform-module-common-client-audit-info-edit.component-CSsCG6Dz.mjs +127 -0
  11. package/fesm2022/acorex-platform-module-common-client-audit-info-edit.component-CSsCG6Dz.mjs.map +1 -0
  12. package/fesm2022/acorex-platform-module-common-client-audit-info-view.component-WYXsZcLg.mjs +127 -0
  13. package/fesm2022/acorex-platform-module-common-client-audit-info-view.component-WYXsZcLg.mjs.map +1 -0
  14. package/fesm2022/acorex-platform-module-common-client-bulk-archive-entity.command-DZ6VL4oy.mjs +75 -0
  15. package/fesm2022/acorex-platform-module-common-client-bulk-archive-entity.command-DZ6VL4oy.mjs.map +1 -0
  16. package/fesm2022/acorex-platform-module-common-client-bulk-disable-entity.command-0J4vgsFL.mjs +75 -0
  17. package/fesm2022/acorex-platform-module-common-client-bulk-disable-entity.command-0J4vgsFL.mjs.map +1 -0
  18. package/fesm2022/acorex-platform-module-common-client-bulk-enable-entity.command-DsVuaInC.mjs +75 -0
  19. package/fesm2022/acorex-platform-module-common-client-bulk-enable-entity.command-DsVuaInC.mjs.map +1 -0
  20. package/fesm2022/acorex-platform-module-common-client-bulk-restore-archive-entity.command-C-ptvYRp.mjs +75 -0
  21. package/fesm2022/acorex-platform-module-common-client-bulk-restore-archive-entity.command-C-ptvYRp.mjs.map +1 -0
  22. package/fesm2022/acorex-platform-module-common-client-clone-entity.command-CyIAr8bc.mjs +227 -0
  23. package/fesm2022/acorex-platform-module-common-client-clone-entity.command-CyIAr8bc.mjs.map +1 -0
  24. package/fesm2022/acorex-platform-module-common-client-contracts.mjs +128 -0
  25. package/fesm2022/acorex-platform-module-common-client-contracts.mjs.map +1 -0
  26. package/fesm2022/acorex-platform-module-common-client-disable-entity.command-DWyqAAwo.mjs +57 -0
  27. package/fesm2022/acorex-platform-module-common-client-disable-entity.command-DWyqAAwo.mjs.map +1 -0
  28. package/fesm2022/acorex-platform-module-common-client-disable-entity.command.util-BBwY9Q30.mjs +146 -0
  29. package/fesm2022/acorex-platform-module-common-client-disable-entity.command.util-BBwY9Q30.mjs.map +1 -0
  30. package/fesm2022/acorex-platform-module-common-client-enable-entity.command-BP30gOku.mjs +57 -0
  31. package/fesm2022/acorex-platform-module-common-client-enable-entity.command-BP30gOku.mjs.map +1 -0
  32. package/fesm2022/acorex-platform-module-common-client-get-current-time.command-B7hJTMzT.mjs +72 -0
  33. package/fesm2022/acorex-platform-module-common-client-get-current-time.command-B7hJTMzT.mjs.map +1 -0
  34. package/fesm2022/acorex-platform-module-common-client-restore-archive-entity.command-D6ms054j.mjs +57 -0
  35. package/fesm2022/acorex-platform-module-common-client-restore-archive-entity.command-D6ms054j.mjs.map +1 -0
  36. package/fesm2022/acorex-platform-module-common-client-search-popup.component-upSRWTIO.mjs +136 -0
  37. package/fesm2022/acorex-platform-module-common-client-search-popup.component-upSRWTIO.mjs.map +1 -0
  38. package/fesm2022/acorex-platform-module-common-client-timeline-version-history-popup.component-D4lLwLpx.mjs +59 -0
  39. package/fesm2022/acorex-platform-module-common-client-timeline-version-history-popup.component-D4lLwLpx.mjs.map +1 -0
  40. package/fesm2022/acorex-platform-module-common-client.mjs +2 -0
  41. package/fesm2022/acorex-platform-module-common-client.mjs.map +1 -0
  42. package/package.json +32 -0
  43. package/types/acorex-platform-module-common-client-contracts.d.ts +111 -0
  44. package/types/acorex-platform-module-common-client.d.ts +777 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-common-client-disable-entity.command.util-BBwY9Q30.mjs","sources":["../../../../libs/modules/common/client/src/lib/features/disable-plugin/disable-entity.events.ts","../../../../libs/modules/common/client/src/lib/features/disable-plugin/commands/disable-entity.command.helper.ts","../../../../libs/modules/common/client/src/lib/features/disable-plugin/commands/disable-entity.command.util.ts"],"sourcesContent":["import { createWorkFlowEvent } from '@acorex-platform/framework-client/workflow';\n\nexport const AXPEntityDisabledEvent = createWorkFlowEvent<{ entity: string; id: string; meta?: unknown }>(\n '[Entity] Disabled',\n);\n\nexport const AXPEntityEnabledEvent = createWorkFlowEvent<{ entity: string; id: string; meta?: unknown }>(\n '[Entity] Enabled',\n);\n\nexport const AXPEntityBulkDisabledEvent = createWorkFlowEvent<{\n entity: string;\n ids: string[];\n meta?: unknown;\n}>('[Entity] Bulk Disabled');\n\nexport const AXPEntityBulkEnabledEvent = createWorkFlowEvent<{\n entity: string;\n ids: string[];\n meta?: unknown;\n}>('[Entity] Bulk Enabled');\n","import { AXDialogService } from '@acorex/components/dialog';\nimport { AXLoadingDialogService } from '@acorex/components/loading-dialog';\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXStyleColorType } from '@acorex/cdk/common';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport type { AXPContextData } from '@acorex-platform/framework-shared/core';\nimport { AXPCommonSettings, AXPRefreshEvent, AXPSettingsService } from '@acorex-platform/framework-client/common';\nimport { AXPEntityDefinitionRegistryService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPWorkflowEventService } from '@acorex-platform/framework-client/workflow';\nimport type { AXPEntity } from '@acorex-platform/framework-shared/entity';\nimport { inject, Injectable } from '@angular/core';\n\nimport {\n AXPEntityBulkDisabledEvent,\n AXPEntityBulkEnabledEvent,\n AXPEntityDisabledEvent,\n AXPEntityEnabledEvent,\n} from '../disable-entity.events';\n\n@Injectable({ providedIn: 'root' })\nexport class AXPDisableEntityCommandHelper {\n private readonly entityRegistry = inject(AXPEntityDefinitionRegistryService);\n private readonly dialogService = inject(AXDialogService);\n private readonly loadingDialog = inject(AXLoadingDialogService);\n private readonly translationService = inject(AXTranslationService);\n private readonly toastService = inject(AXToastService);\n private readonly settingsService = inject(AXPSettingsService);\n private readonly workflowEventService = inject(AXPWorkflowEventService);\n\n async resolveEntity(refType: string): Promise<AXPEntity> {\n const [moduleName, entityName] = refType.split('.');\n return this.entityRegistry.resolve(moduleName, entityName);\n }\n\n async applyPatch(refType: string, refId: string, patch: AXPContextData): Promise<void> {\n const entityDefinition = await this.resolveEntity(refType);\n const updateExec = entityDefinition.commands?.update?.execute as\n | ((payload: AXPContextData) => Promise<unknown>)\n | undefined;\n\n if (!updateExec) {\n throw new Error('Entity does not support update operation');\n }\n\n await updateExec({ id: refId, ...patch });\n }\n\n async confirm(\n titleKey: string,\n messageKey: string,\n messageParams?: AXPContextData,\n color: AXStyleColorType = 'warning',\n ): Promise<boolean> {\n const dialogResult = await this.dialogService.confirm(\n await this.translationService.translateAsync(titleKey),\n await this.translationService.translateAsync(messageKey, { params: messageParams }),\n color,\n 'horizontal',\n false,\n 'cancel',\n );\n return dialogResult.result === true;\n }\n\n showLoading(title: string, status: string) {\n return this.loadingDialog.show({\n title,\n mode: 'indeterminate',\n status,\n });\n }\n\n async showSuccessToast(titleKey: string, contentKey?: string): Promise<void> {\n const enabled = await this.settingsService.get<boolean>(AXPCommonSettings.EnableOperationToasts);\n if (!enabled) {\n return;\n }\n\n this.toastService.show({\n color: 'success',\n title: await this.translationService.translateAsync(titleKey),\n content: contentKey ? await this.translationService.translateAsync(contentKey) : undefined,\n });\n }\n\n async showErrorToast(message: string): Promise<void> {\n const enabled = await this.settingsService.get<boolean>(AXPCommonSettings.EnableOperationToasts);\n if (!enabled || !message.trim()) {\n return;\n }\n\n this.toastService.show({\n color: 'danger',\n title: await this.translationService.translateAsync('@general:state-message.error.title'),\n content: message,\n closeButton: true,\n timeOut: 6000,\n timeOutProgress: true,\n });\n }\n\n dispatchDisabled(refType: string, id: string, meta?: AXPContextData): void {\n this.workflowEventService.dispatch(AXPEntityDisabledEvent({ entity: refType, id, meta }));\n this.workflowEventService.dispatch(AXPRefreshEvent({ entity: refType, meta }));\n }\n\n dispatchEnabled(refType: string, id: string, meta?: AXPContextData): void {\n this.workflowEventService.dispatch(AXPEntityEnabledEvent({ entity: refType, id, meta }));\n this.workflowEventService.dispatch(AXPRefreshEvent({ entity: refType, meta }));\n }\n\n dispatchBulkDisabled(refType: string, ids: string[], meta?: AXPContextData): void {\n this.workflowEventService.dispatch(AXPEntityBulkDisabledEvent({ entity: refType, ids, meta }));\n this.workflowEventService.dispatch(\n AXPRefreshEvent({ entity: refType, meta: { refreshType: 'bulk-disable', ...meta } }),\n );\n }\n\n dispatchBulkEnabled(refType: string, ids: string[], meta?: AXPContextData): void {\n this.workflowEventService.dispatch(AXPEntityBulkEnabledEvent({ entity: refType, ids, meta }));\n this.workflowEventService.dispatch(\n AXPRefreshEvent({ entity: refType, meta: { refreshType: 'bulk-enable', ...meta } }),\n );\n }\n}\n","import type { AXPContextData } from '@acorex-platform/framework-shared/core';\nimport type { AXPEntity } from '@acorex-platform/framework-shared/entity';\n\nexport const DEFAULT_DISABLE_FIELD = 'isDisabled';\nexport const DISABLE_TIMESTAMP_FIELD = 'disabledAt';\nexport const ENABLE_TIMESTAMP_FIELD = 'enabledAt';\n\nexport interface AXPDisableCommandContext {\n refId: string;\n refType: string;\n rowData?: AXPContextData;\n}\n\nexport interface AXPBulkDisableCommandContext {\n refType: string;\n ids: string[];\n rows: AXPContextData[];\n}\n\nexport function normalizeDisableSingleInput(input: AXPContextData): AXPDisableCommandContext | null {\n const ctx = input['__context__'] as AXPContextData | undefined;\n const options = (input['options'] ?? ctx?.['options'] ?? input) as AXPContextData;\n const data = ctx?.['data'] ?? input;\n const rowData = Array.isArray(data)\n ? (data[0] as AXPContextData | undefined)\n : (data as AXPContextData | undefined);\n\n const refType = String(\n options['refType'] ?? ctx?.['entity'] ?? (ctx?.['entityInfo'] as AXPContextData | undefined)?.['source'] ?? '',\n );\n const rawId = options['refId'] ?? rowData?.['id'] ?? rowData?.['_id'] ?? input['refId'];\n\n if (!refType || rawId == null || rawId === '') {\n return null;\n }\n\n return { refId: String(rawId), refType, rowData };\n}\n\nexport function normalizeDisableBulkInput(input: AXPContextData): AXPBulkDisableCommandContext | null {\n const ctx = input['__context__'] as AXPContextData | undefined;\n const options = (input['options'] ?? ctx?.['options'] ?? input) as AXPContextData;\n const data = ctx?.['data'] ?? input['data'] ?? input;\n const rows = (Array.isArray(data) ? data : data ? [data] : []) as AXPContextData[];\n\n const refType = String(\n options['refType'] ?? ctx?.['entity'] ?? (ctx?.['entityInfo'] as AXPContextData | undefined)?.['source'] ?? '',\n );\n const ids = rows.map((row) => row?.['id']).filter((id): id is string => id != null && id !== '');\n\n if (!refType || ids.length === 0) {\n return null;\n }\n\n return { refType, ids, rows };\n}\n\nexport function buildDisablePatch(disabled: boolean): AXPContextData {\n if (disabled) {\n return { [DEFAULT_DISABLE_FIELD]: true, [DISABLE_TIMESTAMP_FIELD]: new Date() };\n }\n return {\n [DEFAULT_DISABLE_FIELD]: false,\n [DISABLE_TIMESTAMP_FIELD]: null,\n [ENABLE_TIMESTAMP_FIELD]: new Date(),\n };\n}\n\nexport function buildDisableRefreshMeta(\n entityDefinition: AXPEntity,\n rowData?: AXPContextData,\n): AXPContextData {\n const meta: AXPContextData = {};\n if (entityDefinition.parentKey && rowData?.[entityDefinition.parentKey] != null) {\n meta['refreshTargetId'] = rowData[entityDefinition.parentKey];\n }\n return meta;\n}\n"],"names":[],"mapp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IAAI,GAAG,GAAG,QAAQ,CAAC,IAAK,GAAG,GAAG,YAAY,CAAgC,GAAG,QAAQ,CAAC,IAAI,EAAE,CAC/G;AACD,IAAA,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,KAAmB,EAAE,IAAI,IAAI,IAAI,EAAE,KAAK,EAAE,CAAC;IAEhG,IAAI,CAAC,OAAO,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;AAChC,QAAA,OAAO,IAAI;IACb;AAEA,IAAA,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE;AAC/B;AAEM,SAAU,iBAAiB,CAAC,QAAiB,EAAA;IACjD,IAAI,QAAQ,EAAE;AACZ,QAAA,OAAO,EAAE,CAAC,qBAAqB,GAAG,IAAI,EAAE,CAAC,uBAAuB,GAAG,IAAI,IAAI,EAAE,EAAE;IACjF;IACA,OAAO;QACL,CAAC,qBAAqB,GAAG,KAAK;QAC9B,CAAC,uBAAuB,GAAG,IAAI;AAC/B,QAAA,CAAC,sBAAsB,GAAG,IAAI,IAAI,EAAE;KACrC;AACH;AAEM,SAAU,uBAAuB,CACrC,gBAA2B,EAC3B,OAAwB,EAAA;IAExB,MAAM,IAAI,GAAmB,EAAE;AAC/B,IAAA,IAAI,gBAAgB,CAAC,SAAS,IAAI,OAAO,GAAG,gBAAgB,CAAC,SAAS,CAAC,IAAI,IAAI,EAAE;QAC/E,IAAI,CAAC,iBAAiB,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,SAAS,CAAC;IAC/D;AACA,IAAA,OAAO,IAAI;AACb;;;;"}
@@ -0,0 +1,57 @@
1
+ import { AXTranslationService } from '@acorex/core/translation';
2
+ import * as i0 from '@angular/core';
3
+ import { inject, Injectable } from '@angular/core';
4
+ import { A as AXPDisableEntityCommandHelper, n as normalizeDisableSingleInput, b as buildDisablePatch, a as buildDisableRefreshMeta } from './acorex-platform-module-common-client-disable-entity.command.util-BBwY9Q30.mjs';
5
+
6
+ class AXPEnableEntityCommand {
7
+ constructor() {
8
+ this.helper = inject(AXPDisableEntityCommandHelper);
9
+ this.translationService = inject(AXTranslationService);
10
+ }
11
+ async execute(input) {
12
+ const context = normalizeDisableSingleInput(input);
13
+ if (!context) {
14
+ return {
15
+ success: false,
16
+ message: {
17
+ text: await this.translationService.translateAsync('@general:messages.entity.invalid-data'),
18
+ },
19
+ };
20
+ }
21
+ const confirmed = await this.helper.confirm('@general:actions.enable.confirm.title', '@general:actions.enable.confirm.message', undefined, 'success');
22
+ if (!confirmed) {
23
+ return { success: false };
24
+ }
25
+ const loadingDialog = this.helper.showLoading(await this.translationService.translateAsync('@general:actions.enable.confirm.processing'), 'Enabling...');
26
+ try {
27
+ const entityDefinition = await this.helper.resolveEntity(context.refType);
28
+ const patch = buildDisablePatch(false);
29
+ await this.helper.applyPatch(context.refType, context.refId, patch);
30
+ const meta = buildDisableRefreshMeta(entityDefinition, context.rowData);
31
+ this.helper.dispatchEnabled(context.refType, context.refId, meta);
32
+ await this.helper.showSuccessToast('@general:workflow.entity-enabled', '@general:workflow.entity-enabled-body');
33
+ return { success: true };
34
+ }
35
+ catch (error) {
36
+ console.error('Enable operation failed:', error);
37
+ const message = error instanceof Error ? error.message : 'Enable operation failed';
38
+ await this.helper.showErrorToast(message);
39
+ return {
40
+ success: false,
41
+ message: { text: message },
42
+ };
43
+ }
44
+ finally {
45
+ loadingDialog.close();
46
+ }
47
+ }
48
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPEnableEntityCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
49
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPEnableEntityCommand, providedIn: 'root' }); }
50
+ }
51
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPEnableEntityCommand, decorators: [{
52
+ type: Injectable,
53
+ args: [{ providedIn: 'root' }]
54
+ }] });
55
+
56
+ export { AXPEnableEntityCommand };
57
+ //# sourceMappingURL=acorex-platform-module-common-client-enable-entity.command-BP30gOku.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-common-client-enable-entity.command-BP30gOku.mjs","sources":["../../../../libs/modules/common/client/src/lib/features/disable-plugin/commands/enable-entity.command.ts"],"sourcesContent":["import { AXPCommand } from '@acorex-platform/framework-shared/runtime';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPExecuteCommandResult, type AXPContextData } from '@acorex-platform/framework-shared/core';\nimport { inject, Injectable } from '@angular/core';\n\nimport { AXPDisableEntityCommandHelper } from './disable-entity.command.helper';\nimport { buildDisablePatch, buildDisableRefreshMeta, normalizeDisableSingleInput } from './disable-entity.command.util';\n\n@Injectable({ providedIn: 'root' })\nexport class AXPEnableEntityCommand implements AXPCommand<AXPContextData, void> {\n private readonly helper = inject(AXPDisableEntityCommandHelper);\n private readonly translationService = inject(AXTranslationService);\n\n async execute(input: AXPContextData): Promise<AXPExecuteCommandResult<void>> {\n const context = normalizeDisableSingleInput(input);\n if (!context) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync('@general:messages.entity.invalid-data'),\n },\n };\n }\n\n const confirmed = await this.helper.confirm(\n '@general:actions.enable.confirm.title',\n '@general:actions.enable.confirm.message',\n undefined,\n 'success',\n );\n if (!confirmed) {\n return { success: false };\n }\n\n const loadingDialog = this.helper.showLoading(\n await this.translationService.translateAsync('@general:actions.enable.confirm.processing'),\n 'Enabling...',\n );\n\n try {\n const entityDefinition = await this.helper.resolveEntity(context.refType);\n const patch = buildDisablePatch(false);\n await this.helper.applyPatch(context.refType, context.refId, patch);\n\n const meta = buildDisableRefreshMeta(entityDefinition, context.rowData);\n this.helper.dispatchEnabled(context.refType, context.refId, meta);\n await this.helper.showSuccessToast(\n '@general:workflow.entity-enabled',\n '@general:workflow.entity-enabled-body',\n );\n\n return { success: true };\n } catch (error) {\n console.error('Enable operation failed:', error);\n const message = error instanceof Error ? error.message : 'Enable operation failed';\n await this.helper.showErrorToast(message);\n return {\n success: false,\n message: { text: message },\n };\n } finally {\n loadingDialog.close();\n }\n }\n}\n"],"names":[],"mappings":";;;;;MASa,sBAAsB,CAAA;AADnC,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,6BAA6B,CAAC;AAC9C,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AAqDnE,IAAA;IAnDC,MAAM,OAAO,CAAC,KAAqB,EAAA;AACjC,QAAA,MAAM,OAAO,GAAG,2BAA2B,CAAC,KAAK,CAAC;QAClD,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO;AACL,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,uCAAuC,CAAC;AAC5F,iBAAA;aACF;QACH;AAEA,QAAA,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CACzC,uCAAuC,EACvC,yCAAyC,EACzC,SAAS,EACT,SAAS,CACV;QACD,IAAI,CAAC,SAAS,EAAE;AACd,YAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;QAC3B;QAEA,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,CAC3C,MAAM,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,4CAA4C,CAAC,EAC1F,aAAa,CACd;AAED,QAAA,IAAI;AACF,YAAA,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC;AACzE,YAAA,MAAM,KAAK,GAAG,iBAAiB,CAAC,KAAK,CA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-0,0 +1,72 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable } from '@angular/core';
3
+
4
+ //#endregion
5
+ //#region ---- Timezone helpers ----
6
+ /**
7
+ * Non-standard or deprecated labels models sometimes pass; map to a canonical IANA id accepted by `Intl`.
8
+ */
9
+ const COMMON_TIMEZONE_ALIASES = {
10
+ 'Asia/Ankara': 'Europe/Istanbul',
11
+ };
12
+ function buildTimezoneCandidates(raw) {
13
+ const trimmed = raw.trim();
14
+ if (!trimmed) {
15
+ return [];
16
+ }
17
+ const alias = COMMON_TIMEZONE_ALIASES[trimmed];
18
+ const set = new Set([trimmed]);
19
+ if (alias) {
20
+ set.add(alias);
21
+ }
22
+ return [...set];
23
+ }
24
+ function formatWithTimeZone(now, timeZone) {
25
+ return now.toLocaleString('sv-SE', { timeZone });
26
+ }
27
+ //#endregion
28
+ //#region ---- Command ----
29
+ /**
30
+ * Returns the current time as ISO string, or sv-SE locale string when {@link CommonGetCurrentTimeInput.timezone} is set.
31
+ * Catalog key: `common.get_current_time`.
32
+ */
33
+ class CommonGetCurrentTimeCommand {
34
+ async execute(input) {
35
+ const now = new Date();
36
+ const rawTz = input.timezone?.trim() ?? '';
37
+ if (!rawTz) {
38
+ return {
39
+ success: true,
40
+ data: now.toISOString(),
41
+ };
42
+ }
43
+ const candidates = buildTimezoneCandidates(rawTz);
44
+ let lastMessage = '';
45
+ for (const tz of candidates) {
46
+ try {
47
+ return {
48
+ success: true,
49
+ data: formatWithTimeZone(now, tz),
50
+ };
51
+ }
52
+ catch (e) {
53
+ lastMessage = e instanceof Error ? e.message : String(e);
54
+ }
55
+ }
56
+ return {
57
+ success: false,
58
+ message: {
59
+ text: `Invalid or unsupported IANA time zone: "${rawTz}". ${lastMessage ? `${lastMessage} ` : ''}Use a valid IANA name (e.g. Europe/Istanbul for Turkey).`,
60
+ },
61
+ };
62
+ }
63
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CommonGetCurrentTimeCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
64
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CommonGetCurrentTimeCommand, providedIn: 'root' }); }
65
+ }
66
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CommonGetCurrentTimeCommand, decorators: [{
67
+ type: Injectable,
68
+ args: [{ providedIn: 'root' }]
69
+ }] });
70
+
71
+ export { CommonGetCurrentTimeCommand };
72
+ //# sourceMappingURL=acorex-platform-module-common-client-get-current-time.command-B7hJTMzT.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-common-client-get-current-time.command-B7hJTMzT.mjs","sources":["../../../../libs/modules/common/client/src/lib/tools/get-current-time.command.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXPCommand } from '@acorex-platform/framework-shared/runtime';\nimport { AXPExecuteCommandResult } from '@acorex-platform/framework-shared/core';\n\nimport { Injectable } from '@angular/core';\n\n//#endregion\n\n//#region ---- Types ----\n\nexport interface CommonGetCurrentTimeInput {\n timezone?: string;\n}\n\n//#endregion\n\n//#region ---- Timezone helpers ----\n\n/**\n * Non-standard or deprecated labels models sometimes pass; map to a canonical IANA id accepted by `Intl`.\n */\nconst COMMON_TIMEZONE_ALIASES: Readonly<Record<string, string>> = {\n 'Asia/Ankara': 'Europe/Istanbul',\n};\n\nfunction buildTimezoneCandidates(raw: string): string[] {\n const trimmed = raw.trim();\n if (!trimmed) {\n return [];\n }\n const alias = COMMON_TIMEZONE_ALIASES[trimmed];\n const set = new Set<string>([trimmed]);\n if (alias) {\n set.add(alias);\n }\n return [...set];\n}\n\nfunction formatWithTimeZone(now: Date, timeZone: string): string {\n return now.toLocaleString('sv-SE', { timeZone });\n}\n\n//#endregion\n\n//#region ---- Command ----\n\n/**\n * Returns the current time as ISO string, or sv-SE locale string when {@link CommonGetCurrentTimeInput.timezone} is set.\n * Catalog key: `common.get_current_time`.\n */\n@Injectable({ providedIn: 'root' })\nexport class CommonGetCurrentTimeCommand implements AXPCommand<CommonGetCurrentTimeInput, string> {\n async execute(input: CommonGetCurrentTimeInput): Promise<AXPExecuteCommandResult<string>> {\n const now = new Date();\n const rawTz = input.timezone?.trim() ?? '';\n\n if (!rawTz) {\n return {\n success: true,\n data: now.toISOString(),\n };\n }\n\n const candidates = buildTimezoneCandidates(rawTz);\n let lastMessage = '';\n\n for (const tz of candidates) {\n try {\n return {\n success: true,\n data: formatWithTimeZone(now, tz),\n };\n } catch (e) {\n lastMessage = e instanceof Error ? e.message : String(e);\n }\n }\n\n return {\n success: false,\n message: {\n text: `Invalid or unsupported IANA time zone: \"${rawTz}\". ${lastMessage ? `${lastMessage} ` : ''}Use a valid IANA name (e.g. Europe/Istanbul for Turkey).`,\n },\n };\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;AAeA;AAEA;AAEA;;AAEG;AACH,MAAM,uBAAuB,GAAqC;AAChE,IAAA,aAAa,EAAE,iBAAiB;CACjC;AAED,SAAS,uBAAuB,CAAC,GAAW,EAAA;AAC1C,IAAA,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,EAAE;IAC1B,IAAI,CAAC,OAAO,EAAE;AACZ,QAAA,OAAO,EAAE;IACX;AACA,IAAA,MAAM,KAAK,GAAG,uBAAuB,CAAC,OAAO,CAAC;IAC9C,MAAM,GAAG,GAAG,IAAI,GAAG,CAAS,CAAC,OAAO,CAAC,CAAC;IACtC,IAAI,KAAK,EAAE;AACT,QAAA,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC;IAChB;AACA,IAAA,OAAO,CAAC,GAAG,GAAG,CAAC;AACjB;AAEA,SAAS,kBAAkB,CAAC,GAAS,EAAE,QAAgB,EAAA;IACrD,OAAO,GAAG,CAAC,cAAc,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,CAAC;AAClD;AAEA;AAEA;AAEA;;;AAGG;MAEU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EAAA,CAAA,CAAA;;2FACnB,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBADvC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
@@ -0,0 +1,57 @@
1
+ import { AXTranslationService } from '@acorex/core/translation';
2
+ import * as i0 from '@angular/core';
3
+ import { inject, Injectable } from '@angular/core';
4
+ import { A as AXPArchiveEntityCommandHelper, n as normalizeArchiveSingleInput, b as buildArchivePatch, a as buildArchiveRefreshMeta } from './acorex-platform-module-common-client-archive-entity.command.util-CEvlTSlo.mjs';
5
+
6
+ class AXPRestoreArchiveEntityCommand {
7
+ constructor() {
8
+ this.helper = inject(AXPArchiveEntityCommandHelper);
9
+ this.translationService = inject(AXTranslationService);
10
+ }
11
+ async execute(input) {
12
+ const context = normalizeArchiveSingleInput(input);
13
+ if (!context) {
14
+ return {
15
+ success: false,
16
+ message: {
17
+ text: await this.translationService.translateAsync('@general:messages.entity.invalid-data'),
18
+ },
19
+ };
20
+ }
21
+ const confirmed = await this.helper.confirm('@general:actions.restore-archive.confirm.title', '@general:actions.restore-archive.confirm.message');
22
+ if (!confirmed) {
23
+ return { success: false };
24
+ }
25
+ const loadingDialog = this.helper.showLoading(await this.translationService.translateAsync('@general:actions.restore-archive.confirm.processing'), 'Unarchiving...');
26
+ try {
27
+ const entityDefinition = await this.helper.resolveEntity(context.refType);
28
+ const patch = buildArchivePatch(false);
29
+ await this.helper.applyPatch(context.refType, context.refId, patch);
30
+ const meta = buildArchiveRefreshMeta(entityDefinition, context.rowData);
31
+ this.helper.dispatchUnarchived(context.refType, context.refId, meta);
32
+ await this.helper.showSuccessToast('@general:workflow.entity-unarchived', '@general:workflow.entity-unarchived-body');
33
+ return { success: true };
34
+ }
35
+ catch (error) {
36
+ console.error('Unarchive operation failed:', error);
37
+ return {
38
+ success: false,
39
+ message: {
40
+ text: error instanceof Error ? error.message : 'Unarchive operation failed',
41
+ },
42
+ };
43
+ }
44
+ finally {
45
+ loadingDialog.close();
46
+ }
47
+ }
48
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPRestoreArchiveEntityCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
49
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPRestoreArchiveEntityCommand, providedIn: 'root' }); }
50
+ }
51
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPRestoreArchiveEntityCommand, decorators: [{
52
+ type: Injectable,
53
+ args: [{ providedIn: 'root' }]
54
+ }] });
55
+
56
+ export { AXPRestoreArchiveEntityCommand };
57
+ //# sourceMappingURL=acorex-platform-module-common-client-restore-archive-entity.command-D6ms054j.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-common-client-restore-archive-entity.command-D6ms054j.mjs","sources":["../../../../libs/modules/common/client/src/lib/features/archive-plugin/commands/restore-archive-entity.command.ts"],"sourcesContent":["import { AXPCommand } from '@acorex-platform/framework-shared/runtime';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPExecuteCommandResult, type AXPContextData } from '@acorex-platform/framework-shared/core';\nimport { inject, Injectable } from '@angular/core';\n\nimport { AXPArchiveEntityCommandHelper } from './archive-entity.command.helper';\nimport { buildArchivePatch, buildArchiveRefreshMeta, normalizeArchiveSingleInput } from './archive-entity.command.util';\n\n@Injectable({ providedIn: 'root' })\nexport class AXPRestoreArchiveEntityCommand implements AXPCommand<AXPContextData, void> {\n private readonly helper = inject(AXPArchiveEntityCommandHelper);\n private readonly translationService = inject(AXTranslationService);\n\n async execute(input: AXPContextData): Promise<AXPExecuteCommandResult<void>> {\n const context = normalizeArchiveSingleInput(input);\n if (!context) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync('@general:messages.entity.invalid-data'),\n },\n };\n }\n\n const confirmed = await this.helper.confirm(\n '@general:actions.restore-archive.confirm.title',\n '@general:actions.restore-archive.confirm.message',\n );\n if (!confirmed) {\n return { success: false };\n }\n\n const loadingDialog = this.helper.showLoading(\n await this.translationService.translateAsync('@general:actions.restore-archive.confirm.processing'),\n 'Unarchiving...',\n );\n\n try {\n const entityDefinition = await this.helper.resolveEntity(context.refType);\n const patch = buildArchivePatch(false);\n await this.helper.applyPatch(context.refType, context.refId, patch);\n\n const meta = buildArchiveRefreshMeta(entityDefinition, context.rowData);\n this.helper.dispatchUnarchived(context.refType, context.refId, meta);\n await this.helper.showSuccessToast('@general:workflow.entity-unarchived', '@general:workflow.entity-unarchived-body');\n\n return { success: true };\n } catch (error) {\n console.error('Unarchive operation failed:', error);\n return {\n success: false,\n message: {\n text: error instanceof Error ? error.message : 'Unarchive operation failed',\n },\n };\n } finally {\n loadingDialog.close();\n }\n }\n}\n"],"names":[],"mappings":";;;;;MASa,8BAA8B,CAAA;AAD3C,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,6BAA6B,CAAC;AAC9C,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AAgDnE,IAAA;IA9CC,MAAM,OAAO,CAAC,KAAqB,EAAA;AACjC,QAAA,MAAM,OAAO,GAAG,2BAA2B,CAAC,KAAK,CAAC;QAClD,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO;AACL,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,uCAAuC,CAAC;AAC5F,iBAAA;aACF;QACH;AAEA,QAAA,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CACzC,gDAAgD,EAChD,kDAAkD,CACnD;QACD,IAAI,CAAC,SAAS,EAAE;AACd,YAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;QAC3B;QAEA,MAAM,aAAa,GAA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AAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,8BAA8B,cADjB,MAAM,EAAA,CAAA,CAAA;;2FACnB,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAD1C,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
@@ -0,0 +1,136 @@
1
+ import * as i6 from '@acorex/cdk/list-navigation';
2
+ import { AXListNavigationDirective, AXListNavigationItemDirective, AXListNavigationModule } from '@acorex/cdk/list-navigation';
3
+ import * as i2$1 from '@acorex/components/button';
4
+ import { AXButtonModule } from '@acorex/components/button';
5
+ import { AXChipsModule } from '@acorex/components/chips';
6
+ import * as i4 from '@acorex/cdk/common';
7
+ import { AXCommonModule } from '@acorex/cdk/common';
8
+ import * as i1$1 from '@acorex/components/decorators';
9
+ import { AXDecoratorModule } from '@acorex/components/decorators';
10
+ import { AXBasePageComponent } from '@acorex/components/page';
11
+ import * as i3 from '@acorex/components/search-box';
12
+ import { AXSearchBoxComponent, AXSearchBoxModule } from '@acorex/components/search-box';
13
+ import * as i8 from '@acorex/components/skeleton';
14
+ import { AXSkeletonModule } from '@acorex/components/skeleton';
15
+ import * as i4$1 from '@acorex/core/translation';
16
+ import { AXTranslationModule } from '@acorex/core/translation';
17
+ import { AXPThemeLayoutBlockComponent, AXPThemeLayoutListComponent, AXPThemeLayoutListItemComponent, AXPThemeLayoutListItemsGroupComponent, AXPThemeLayoutHeaderComponent, AXPStateMessageComponent } from '@acorex-platform/framework-client/layout/components';
18
+ import * as i1 from '@angular/common';
19
+ import { CommonModule } from '@angular/common';
20
+ import * as i0 from '@angular/core';
21
+ import { inject, viewChild, viewChildren, ChangeDetectionStrategy, Component } from '@angular/core';
22
+ import * as i2 from '@angular/forms';
23
+ import { FormsModule } from '@angular/forms';
24
+ import { first } from 'rxjs';
25
+ import { a as AXPGlobalSearchViewModel } from './acorex-platform-module-common-client-acorex-platform-module-common-client-IHaYrZeE.mjs';
26
+
27
+ class AXPGlobalSearchPopupComponent extends AXBasePageComponent {
28
+ constructor() {
29
+ super(...arguments);
30
+ this.i18nScope = 'global-search';
31
+ this.vm = inject(AXPGlobalSearchViewModel);
32
+ this.text = null;
33
+ this.list = viewChild(AXListNavigationDirective, ...(ngDevMode ? [{ debugName: "list" }] : /* istanbul ignore next */ []));
34
+ this.searchBox = viewChild(AXSearchBoxComponent, ...(ngDevMode ? [{ debugName: "searchBox" }] : /* istanbul ignore next */ []));
35
+ this.items = viewChildren(AXListNavigationItemDirective, ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
36
+ }
37
+ async handleTextChanged(e) {
38
+ if (e.isUserInteraction) {
39
+ await this.vm.search(e.value);
40
+ }
41
+ }
42
+ ngOnInit() {
43
+ super.ngOnInit();
44
+ //
45
+ this.vm.onItemSelected.pipe(first()).subscribe((item) => {
46
+ this.close(item);
47
+ });
48
+ }
49
+ handleSearchKeyDown(e) {
50
+ const event = e.nativeEvent;
51
+ switch (event.code) {
52
+ case 'ArrowDown':
53
+ const item = this.items()[0];
54
+ if (item && this.list()) {
55
+ this.list()?.navigateTo(item);
56
+ }
57
+ event.preventDefault();
58
+ event.stopPropagation();
59
+ break;
60
+ }
61
+ }
62
+ handleClearClick($event) {
63
+ this.vm.clearRecentItems();
64
+ }
65
+ handleListKeyDown(e) {
66
+ switch (e.code) {
67
+ case 'ArrowUp': {
68
+ const item = this.items()[0];
69
+ if (item && this.list() && item.isActive()) {
70
+ this.searchBox()?.focus();
71
+ }
72
+ break;
73
+ }
74
+ case 'Escape': {
75
+ this.searchBox()?.focus();
76
+ e.preventDefault();
77
+ e.stopPropagation();
78
+ break;
79
+ }
80
+ }
81
+ }
82
+ handleItemKeyDown(e, item) {
83
+ switch (e.code) {
84
+ case 'Enter':
85
+ case 'Space': {
86
+ e.preventDefault();
87
+ e.stopPropagation();
88
+ this.vm.execute(item);
89
+ break;
90
+ }
91
+ }
92
+ }
93
+ handlePinClick(e, item) {
94
+ e.stopPropagation();
95
+ this.vm.togglePin(item);
96
+ }
97
+ searchListItemIcon(item) {
98
+ const icon = item.icon?.trim();
99
+ if (!icon) {
100
+ return 'fa-light fa-circle';
101
+ }
102
+ return icon.includes(' ') ? icon : `fa-light ${icon}`;
103
+ }
104
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPGlobalSearchPopupComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
105
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: AXPGlobalSearchPopupComponent, isStandalone: true, selector: "ng-component", providers: [AXPGlobalSearchViewModel], viewQueries: [{ propertyName: "list", first: true, predicate: AXListNavigationDirective, descendants: true, isSignal: true }, { propertyName: "searchBox", first: true, predicate: AXSearchBoxComponent, descendants: true, isSignal: true }, { propertyName: "items", predicate: AXListNavigationItemDirective, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<axp-layout-content>\n <axp-layout-header class=\"ax-lg\">\n <axp-layout-prefix class=\"min-w-0 flex-1\">\n <ax-search-box\n class=\"__search-box w-full\"\n [axAutoFocus]\n [axAutoFocusTime]=\"500\"\n [look]=\"'none'\"\n [ngModel]=\"vm.text()\"\n (onValueChanged)=\"handleTextChanged($event)\"\n [placeholder]=\"\n '@global-search:terms.search-anything' | translate | async\n \"\n (onKeyDown)=\"handleSearchKeyDown($event)\"\n >\n <ax-clear-button class=\"__clear-button\"></ax-clear-button>\n </ax-search-box>\n </axp-layout-prefix>\n <axp-layout-suffix class=\"__close-button\">\n <ax-button [look]=\"'solid'\" class=\"rounded-lg ax-sm\" (onClick)=\"close()\">\n <ax-icon icon=\"fa-light fa-xmark fa-sm ax-sm\"></ax-icon>\n </ax-button>\n </axp-layout-suffix>\n </axp-layout-header>\n\n <!-- Results Area -->\n <axp-layout-body>\n @if (vm.isBusy()) {\n <ng-container *ngTemplateOutlet=\"skeleton\"></ng-container>\n } @else if (vm.isEmpty()) {\n <ng-container *ngTemplateOutlet=\"empty\"></ng-container>\n } @else if (vm.isWelcome()) {\n <ng-container *ngTemplateOutlet=\"welcome\"></ng-container>\n } @else if (vm.isStart()) {\n <ng-container *ngTemplateOutlet=\"start\"></ng-container>\n } @else {\n <ng-container *ngTemplateOutlet=\"result\"></ng-container>\n }\n </axp-layout-body>\n\n <!-- Skeleton Template -->\n <ng-template #skeleton>\n <div class=\"flex flex-col gap-10 p-8\">\n @for (item of [1, 2, 3, 4, 5]; track $index) {\n <div class=\"flex items-center gap-4\">\n <ax-skeleton\n [animated]=\"true\"\n class=\"w-4 h-4 rounded-full\"\n ></ax-skeleton>\n <div class=\"flex flex-col gap-2 flex-1\">\n <ax-skeleton\n [animated]=\"true\"\n class=\"w-1/4 h-2 rounded\"\n ></ax-skeleton>\n <ax-skeleton\n [animated]=\"true\"\n class=\"w-1/2 h-2 rounded\"\n ></ax-skeleton>\n </div>\n </div>\n }\n </div>\n </ng-template>\n\n <!-- Empty Template -->\n <ng-template #empty>\n <axp-state-message\n icon=\"fa-light fa-search\"\n [title]=\"\n '@global-search:components.search-box.empty-states.no-result.title'\n \"\n [description]=\"\n '@global-search:components.search-box.empty-states.no-result.description'\n \"\n >\n </axp-state-message>\n </ng-template>\n\n <!-- Welcome Template -->\n <ng-template #welcome>\n <axp-state-message\n icon=\"fa-light fa-search\"\n [title]=\"'@global-search:components.search-box.empty-states.start.title'\"\n [description]=\"\n '@global-search:components.search-box.empty-states.start.description'\n \"\n >\n </axp-state-message>\n </ng-template>\n\n <!-- Start Template -->\n <ng-template #start>\n <!-- Pinned Items -->\n <axp-layout-list\n class=\"p-4 divide-none\"\n (keydown)=\"handleListKeyDown($event)\"\n axListNavigation\n #list=\"axListNavigation\"\n >\n @if (vm.pinnedItems().length > 0) {\n <axp-layout-list-group>\n <axp-layout-title>{{\n '@global-search:terms.pinned' | translate | async\n }}</axp-layout-title>\n @for (item of vm.pinnedItems(); track $index) {\n <axp-layout-list-item\n (click)=\"vm.execute(item)\"\n (keydown)=\"handleItemKeyDown($event, item)\"\n class=\"group\"\n axListNavigationItem\n #i=\"axListNavigationItem\"\n [class.axp-state-focused]=\"i.isActive()\"\n >\n <ng-container\n [ngTemplateOutlet]=\"listItem\"\n [ngTemplateOutletContext]=\"{ item }\"\n ></ng-container>\n </axp-layout-list-item>\n }\n </axp-layout-list-group>\n }\n <!-- Recent Items -->\n @if (vm.recentItems().length > 0) {\n <axp-layout-list-group>\n <axp-layout-header>\n <axp-layout-prefix>\n <axp-layout-title>{{\n '@global-search:terms.recent' | translate | async\n }}</axp-layout-title>\n </axp-layout-prefix>\n <axp-layout-prefix class=\"ax-sm\">\n <ax-button\n [text]=\"'@global-search:terms.clear' | translate | async\"\n look=\"blank\"\n [color]=\"'default'\"\n (onClick)=\"handleClearClick($event)\"\n ></ax-button>\n </axp-layout-prefix>\n </axp-layout-header>\n @for (item of vm.recentItems(); track $index) {\n <axp-layout-list-item\n (click)=\"vm.execute(item)\"\n (keydown)=\"handleItemKeyDown($event, item)\"\n class=\"group\"\n axListNavigationItem\n #i=\"axListNavigationItem\"\n [class.axp-state-focused]=\"i.isActive()\"\n >\n <ng-container\n [ngTemplateOutlet]=\"listItem\"\n [ngTemplateOutletContext]=\"{ item }\"\n ></ng-container>\n </axp-layout-list-item>\n }\n </axp-layout-list-group>\n }\n </axp-layout-list>\n </ng-template>\n\n <!-- Result Template -->\n <ng-template #result>\n <axp-layout-list\n class=\"p-4 divide-none\"\n (keydown)=\"handleListKeyDown($event)\"\n axListNavigation\n #list=\"axListNavigation\"\n >\n @for (group of vm.results(); track $index) {\n <axp-layout-list-group>\n <axp-layout-title>{{\n group.title | translate | async\n }}</axp-layout-title>\n @for (item of group.children; track $index) {\n <axp-layout-list-item\n (click)=\"vm.execute(item)\"\n (keydown)=\"handleItemKeyDown($event, item)\"\n class=\"group\"\n axListNavigationItem\n #i=\"axListNavigationItem\"\n [class.axp-state-focused]=\"i.isActive()\"\n >\n <ng-container\n [ngTemplateOutlet]=\"listItem\"\n [ngTemplateOutletContext]=\"{ item }\"\n ></ng-container>\n </axp-layout-list-item>\n }\n </axp-layout-list-group>\n }\n </axp-layout-list>\n </ng-template>\n\n <ng-template #listItem let-item=\"item\">\n <axp-layout-prefix>\n <ax-icon [icon]=\"searchListItemIcon(item)\"></ax-icon>\n </axp-layout-prefix>\n <axp-layout-content>\n <axp-layout-title class=\"group\">\n <span>{{ item.title | translate | async }}</span>\n <span class=\"ms-3\" (click)=\"handlePinClick($event, item)\">\n <i\n [class.invisible]=\"!vm.isPinned(item)\"\n class=\"fa-light fa-thumbtack rotate-45 group-hover:!visible\"\n [class.fa-solid]=\"vm.isPinned(item)\"\n ></i>\n </span>\n </axp-layout-title>\n @if (item.parent) {\n <axp-layout-description>\n {{ item.parent.title | translate | async }}\n </axp-layout-description>\n } @else if (item.description) {\n <axp-layout-description>\n {{ item.description | translate | async }}\n </axp-layout-description>\n }\n </axp-layout-content>\n <axp-layout-suffix>\n <i class=\"far fa-chevron-right rtl:rotate-180\"></i>\n </axp-layout-suffix>\n </ng-template>\n</axp-layout-content>\n", styles: ["@layer properties;:host .editor-container:focus-within{outline-style:none}:host>axp-layout-content{display:flex;flex-direction:column;background-color:var(--color-lightest);color:var(--color-on-lightest);border-color:var(--color-border-lightest);width:90vw;max-width:var(--container-xl, 36rem)}@media(width>=40rem){:host>axp-layout-content{width:80vw}}@media(width>=48rem){:host>axp-layout-content{width:60vw}}@media(width>=64rem){:host>axp-layout-content{width:40vw}}@media(width>=80rem){:host>axp-layout-content{width:30vw}}:host>axp-layout-content>axp-layout-header{flex-wrap:nowrap;align-items:center;gap:calc(var(--spacing, .25rem) * 2);border-bottom-style:var(--tw-border-style);border-bottom-width:1px;background-color:var(--color-lighter);color:var(--color-on-lighter);border-color:var(--color-border-lighter)}:host>axp-layout-content>axp-layout-header>axp-layout-prefix{display:flex;min-width:0;flex:1;align-items:center}:host>axp-layout-content>axp-layout-header>.__close-button{margin-inline-end:calc(var(--spacing, .25rem) * 4);flex-shrink:0}:host>axp-layout-content>axp-layout-header .__search-box{width:100%;align-items:center;padding-inline-end:0!important}:host>axp-layout-content>axp-layout-header .__search-box .__clear-button{color:var(--color-neutral-400, oklch(70.8% 0 0))}:host>axp-layout-content>axp-layout-body{display:flex;flex-direction:column;overflow-y:auto;border-radius:var(--radius-md, .375rem);max-height:50vh;min-height:30vh}:where(:host>axp-layout-content axp-layout-body>:not(:last-child)){--tw-divide-y-reverse: 0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}@media(width>=40rem){:host>axp-layout-content>axp-layout-body{max-height:60vh}}@media(width>=40rem){:host>axp-layout-content>axp-layout-body{min-height:40vh}}@media(width>=48rem){:host>axp-layout-content>axp-layout-body{max-height:70vh}}@media(width>=48rem){:host>axp-layout-content>axp-layout-body{min-height:50vh}}@media(width>=64rem){:host>axp-layout-content>axp-layout-body{max-height:80vh}}@media(width>=64rem){:host>axp-layout-content>axp-layout-body{min-height:40vh}}:host>axp-layout-content>axp-layout-body .axp-search-recent{display:flex;flex-direction:column;padding:calc(var(--spacing, .25rem) * 4)}:host>axp-layout-content>axp-layout-body .axp-search-recent>axp-layout-header{margin-bottom:calc(var(--spacing, .25rem) * 2);display:flex;flex-direction:row;align-items:center;justify-content:space-between;font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));--tw-font-weight: var(--font-weight-semibold, 600);font-weight:var(--font-weight-semibold, 600)}:host>axp-layout-content>axp-layout-body .axp-search-recent>axp-layout-body{display:flex;flex-direction:row;flex-wrap:wrap;gap:calc(var(--spacing, .25rem) * 2);border-radius:var(--radius-md, .375rem)}:host>axp-layout-content axp-layout-list-item axp-layout-prefix ax-icon{display:flex;height:calc(var(--spacing, .25rem) * 9);width:calc(var(--spacing, .25rem) * 9);align-items:center;justify-content:center;border-radius:var(--radius-md, .375rem);background-color:var(--color-dark);color:var(--color-on-dark);border-color:var(--color-border-dark);font-size:1rem}:host>axp-layout-content axp-layout-list-item axp-layout-prefix ax-icon:where(.ax-dark,.ax-dark *):not(:where(.ax-light,.ax-light *)){background-color:var(--color-darker);color:var(--color-on-darker);border-color:var(--color-border-darker)}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-divide-y-reverse{syntax: \"*\"; inherits: false; initial-value: 0;}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-divide-y-reverse: 0;--tw-font-weight: initial}}}\n/*! tailwindcss v4.3.2 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type:
106
+ //
107
+ AXSearchBoxModule }, { kind: "component", type: i3.AXSearchBoxComponent, selector: "ax-search-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "value", "state", "name", "id", "look", "class", "delayTime", "type", "autoSearch"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "ngmodule", type: AXCommonModule }, { kind: "directive", type: i4.AXAutoFocusDirective, selector: "[axAutoFocus]", inputs: ["axAutoFocus", "axAutoFocusTime"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i1$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i1$1.AXDecoratorClearButtonComponent, selector: "ax-clear-button", inputs: ["icon"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "ngmodule", type: AXListNavigationModule }, { kind: "directive", type: i6.AXListNavigationDirective, selector: "[axListNavigation]", inputs: ["orientation"], outputs: ["onNavigationChanged", "onKeypress"], exportAs: ["axListNavigation"] }, { kind: "directive", type: i6.AXListNavigationItemDirective, selector: "[axListNavigationItem]", outputs: ["onKeypress"], exportAs: ["axListNavigationItem"] }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i2$1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type:
108
+ //
109
+ AXSkeletonModule }, { kind: "component", type: i8.AXSkeletonComponent, selector: "ax-skeleton", inputs: ["animated"] }, { kind: "ngmodule", type: AXChipsModule }, { kind: "component", type: AXPThemeLayoutBlockComponent, selector: " axp-page-content, axp-page-footer-container, axp-page-footer, axp-page-header, axp-page-header-container, axp-page-toolbar, axp-layout-content, axp-layout-page-content, axp-layout-sections, axp-layout-body, axp-layout-page-body, axp-layout-prefix, axp-layout-suffix, axp-layout-title-bar, axp-layout-title, axp-layout-title-actions, axp-layout-nav-button, axp-layout-description, axp-layout-breadcrumbs, axp-layout-list-action, " }, { kind: "component", type: AXPThemeLayoutListComponent, selector: "axp-layout-list" }, { kind: "component", type: AXPThemeLayoutListItemComponent, selector: "axp-layout-list-item" }, { kind: "component", type: AXPThemeLayoutListItemsGroupComponent, selector: "axp-layout-list-group" }, { kind: "component", type: AXPThemeLayoutHeaderComponent, selector: "axp-layout-header" }, { kind: "component", type: AXPStateMessageComponent, selector: "axp-state-message", inputs: ["mode", "icon", "title", "description", "titleParams", "descriptionParams", "look"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i4$1.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
110
+ }
111
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPGlobalSearchPopupComponent, decorators: [{
112
+ type: Component,
113
+ args: [{ imports: [
114
+ CommonModule,
115
+ FormsModule,
116
+ //
117
+ AXSearchBoxModule,
118
+ AXCommonModule,
119
+ AXDecoratorModule,
120
+ AXTranslationModule,
121
+ AXListNavigationModule,
122
+ AXButtonModule,
123
+ //
124
+ AXSkeletonModule,
125
+ AXChipsModule,
126
+ AXPThemeLayoutBlockComponent,
127
+ AXPThemeLayoutListComponent,
128
+ AXPThemeLayoutListItemComponent,
129
+ AXPThemeLayoutListItemsGroupComponent,
130
+ AXPThemeLayoutHeaderComponent,
131
+ AXPStateMessageComponent,
132
+ ], changeDetection: ChangeDetectionStrategy.OnPush, providers: [AXPGlobalSearchViewModel], template: "<axp-layout-content>\n <axp-layout-header class=\"ax-lg\">\n <axp-layout-prefix class=\"min-w-0 flex-1\">\n <ax-search-box\n class=\"__search-box w-full\"\n [axAutoFocus]\n [axAutoFocusTime]=\"500\"\n [look]=\"'none'\"\n [ngModel]=\"vm.text()\"\n (onValueChanged)=\"handleTextChanged($event)\"\n [placeholder]=\"\n '@global-search:terms.search-anything' | translate | async\n \"\n (onKeyDown)=\"handleSearchKeyDown($event)\"\n >\n <ax-clear-button class=\"__clear-button\"></ax-clear-button>\n </ax-search-box>\n </axp-layout-prefix>\n <axp-layout-suffix class=\"__close-button\">\n <ax-button [look]=\"'solid'\" class=\"rounded-lg ax-sm\" (onClick)=\"close()\">\n <ax-icon icon=\"fa-light fa-xmark fa-sm ax-sm\"></ax-icon>\n </ax-button>\n </axp-layout-suffix>\n </axp-layout-header>\n\n <!-- Results Area -->\n <axp-layout-body>\n @if (vm.isBusy()) {\n <ng-container *ngTemplateOutlet=\"skeleton\"></ng-container>\n } @else if (vm.isEmpty()) {\n <ng-container *ngTemplateOutlet=\"empty\"></ng-container>\n } @else if (vm.isWelcome()) {\n <ng-container *ngTemplateOutlet=\"welcome\"></ng-container>\n } @else if (vm.isStart()) {\n <ng-container *ngTemplateOutlet=\"start\"></ng-container>\n } @else {\n <ng-container *ngTemplateOutlet=\"result\"></ng-container>\n }\n </axp-layout-body>\n\n <!-- Skeleton Template -->\n <ng-template #skeleton>\n <div class=\"flex flex-col gap-10 p-8\">\n @for (item of [1, 2, 3, 4, 5]; track $index) {\n <div class=\"flex items-center gap-4\">\n <ax-skeleton\n [animated]=\"true\"\n class=\"w-4 h-4 rounded-full\"\n ></ax-skeleton>\n <div class=\"flex flex-col gap-2 flex-1\">\n <ax-skeleton\n [animated]=\"true\"\n class=\"w-1/4 h-2 rounded\"\n ></ax-skeleton>\n <ax-skeleton\n [animated]=\"true\"\n class=\"w-1/2 h-2 rounded\"\n ></ax-skeleton>\n </div>\n </div>\n }\n </div>\n </ng-template>\n\n <!-- Empty Template -->\n <ng-template #empty>\n <axp-state-message\n icon=\"fa-light fa-search\"\n [title]=\"\n '@global-search:components.search-box.empty-states.no-result.title'\n \"\n [description]=\"\n '@global-search:components.search-box.empty-states.no-result.description'\n \"\n >\n </axp-state-message>\n </ng-template>\n\n <!-- Welcome Template -->\n <ng-template #welcome>\n <axp-state-message\n icon=\"fa-light fa-search\"\n [title]=\"'@global-search:components.search-box.empty-states.start.title'\"\n [description]=\"\n '@global-search:components.search-box.empty-states.start.description'\n \"\n >\n </axp-state-message>\n </ng-template>\n\n <!-- Start Template -->\n <ng-template #start>\n <!-- Pinned Items -->\n <axp-layout-list\n class=\"p-4 divide-none\"\n (keydown)=\"handleListKeyDown($event)\"\n axListNavigation\n #list=\"axListNavigation\"\n >\n @if (vm.pinnedItems().length > 0) {\n <axp-layout-list-group>\n <axp-layout-title>{{\n '@global-search:terms.pinned' | translate | async\n }}</axp-layout-title>\n @for (item of vm.pinnedItems(); track $index) {\n <axp-layout-list-item\n (click)=\"vm.execute(item)\"\n (keydown)=\"handleItemKeyDown($event, item)\"\n class=\"group\"\n axListNavigationItem\n #i=\"axListNavigationItem\"\n [class.axp-state-focused]=\"i.isActive()\"\n >\n <ng-container\n [ngTemplateOutlet]=\"listItem\"\n [ngTemplateOutletContext]=\"{ item }\"\n ></ng-container>\n </axp-layout-list-item>\n }\n </axp-layout-list-group>\n }\n <!-- Recent Items -->\n @if (vm.recentItems().length > 0) {\n <axp-layout-list-group>\n <axp-layout-header>\n <axp-layout-prefix>\n <axp-layout-title>{{\n '@global-search:terms.recent' | translate | async\n }}</axp-layout-title>\n </axp-layout-prefix>\n <axp-layout-prefix class=\"ax-sm\">\n <ax-button\n [text]=\"'@global-search:terms.clear' | translate | async\"\n look=\"blank\"\n [color]=\"'default'\"\n (onClick)=\"handleClearClick($event)\"\n ></ax-button>\n </axp-layout-prefix>\n </axp-layout-header>\n @for (item of vm.recentItems(); track $index) {\n <axp-layout-list-item\n (click)=\"vm.execute(item)\"\n (keydown)=\"handleItemKeyDown($event, item)\"\n class=\"group\"\n axListNavigationItem\n #i=\"axListNavigationItem\"\n [class.axp-state-focused]=\"i.isActive()\"\n >\n <ng-container\n [ngTemplateOutlet]=\"listItem\"\n [ngTemplateOutletContext]=\"{ item }\"\n ></ng-container>\n </axp-layout-list-item>\n }\n </axp-layout-list-group>\n }\n </axp-layout-list>\n </ng-template>\n\n <!-- Result Template -->\n <ng-template #result>\n <axp-layout-list\n class=\"p-4 divide-none\"\n (keydown)=\"handleListKeyDown($event)\"\n axListNavigation\n #list=\"axListNavigation\"\n >\n @for (group of vm.results(); track $index) {\n <axp-layout-list-group>\n <axp-layout-title>{{\n group.title | translate | async\n }}</axp-layout-title>\n @for (item of group.children; track $index) {\n <axp-layout-list-item\n (click)=\"vm.execute(item)\"\n (keydown)=\"handleItemKeyDown($event, item)\"\n class=\"group\"\n axListNavigationItem\n #i=\"axListNavigationItem\"\n [class.axp-state-focused]=\"i.isActive()\"\n >\n <ng-container\n [ngTemplateOutlet]=\"listItem\"\n [ngTemplateOutletContext]=\"{ item }\"\n ></ng-container>\n </axp-layout-list-item>\n }\n </axp-layout-list-group>\n }\n </axp-layout-list>\n </ng-template>\n\n <ng-template #listItem let-item=\"item\">\n <axp-layout-prefix>\n <ax-icon [icon]=\"searchListItemIcon(item)\"></ax-icon>\n </axp-layout-prefix>\n <axp-layout-content>\n <axp-layout-title class=\"group\">\n <span>{{ item.title | translate | async }}</span>\n <span class=\"ms-3\" (click)=\"handlePinClick($event, item)\">\n <i\n [class.invisible]=\"!vm.isPinned(item)\"\n class=\"fa-light fa-thumbtack rotate-45 group-hover:!visible\"\n [class.fa-solid]=\"vm.isPinned(item)\"\n ></i>\n </span>\n </axp-layout-title>\n @if (item.parent) {\n <axp-layout-description>\n {{ item.parent.title | translate | async }}\n </axp-layout-description>\n } @else if (item.description) {\n <axp-layout-description>\n {{ item.description | translate | async }}\n </axp-layout-description>\n }\n </axp-layout-content>\n <axp-layout-suffix>\n <i class=\"far fa-chevron-right rtl:rotate-180\"></i>\n </axp-layout-suffix>\n </ng-template>\n</axp-layout-content>\n", styles: ["@layer properties;:host .editor-container:focus-within{outline-style:none}:host>axp-layout-content{display:flex;flex-direction:column;background-color:var(--color-lightest);color:var(--color-on-lightest);border-color:var(--color-border-lightest);width:90vw;max-width:var(--container-xl, 36rem)}@media(width>=40rem){:host>axp-layout-content{width:80vw}}@media(width>=48rem){:host>axp-layout-content{width:60vw}}@media(width>=64rem){:host>axp-layout-content{width:40vw}}@media(width>=80rem){:host>axp-layout-content{width:30vw}}:host>axp-layout-content>axp-layout-header{flex-wrap:nowrap;align-items:center;gap:calc(var(--spacing, .25rem) * 2);border-bottom-style:var(--tw-border-style);border-bottom-width:1px;background-color:var(--color-lighter);color:var(--color-on-lighter);border-color:var(--color-border-lighter)}:host>axp-layout-content>axp-layout-header>axp-layout-prefix{display:flex;min-width:0;flex:1;align-items:center}:host>axp-layout-content>axp-layout-header>.__close-button{margin-inline-end:calc(var(--spacing, .25rem) * 4);flex-shrink:0}:host>axp-layout-content>axp-layout-header .__search-box{width:100%;align-items:center;padding-inline-end:0!important}:host>axp-layout-content>axp-layout-header .__search-box .__clear-button{color:var(--color-neutral-400, oklch(70.8% 0 0))}:host>axp-layout-content>axp-layout-body{display:flex;flex-direction:column;overflow-y:auto;border-radius:var(--radius-md, .375rem);max-height:50vh;min-height:30vh}:where(:host>axp-layout-content axp-layout-body>:not(:last-child)){--tw-divide-y-reverse: 0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}@media(width>=40rem){:host>axp-layout-content>axp-layout-body{max-height:60vh}}@media(width>=40rem){:host>axp-layout-content>axp-layout-body{min-height:40vh}}@media(width>=48rem){:host>axp-layout-content>axp-layout-body{max-height:70vh}}@media(width>=48rem){:host>axp-layout-content>axp-layout-body{min-height:50vh}}@media(width>=64rem){:host>axp-layout-content>axp-layout-body{max-height:80vh}}@media(width>=64rem){:host>axp-layout-content>axp-layout-body{min-height:40vh}}:host>axp-layout-content>axp-layout-body .axp-search-recent{display:flex;flex-direction:column;padding:calc(var(--spacing, .25rem) * 4)}:host>axp-layout-content>axp-layout-body .axp-search-recent>axp-layout-header{margin-bottom:calc(var(--spacing, .25rem) * 2);display:flex;flex-direction:row;align-items:center;justify-content:space-between;font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));--tw-font-weight: var(--font-weight-semibold, 600);font-weight:var(--font-weight-semibold, 600)}:host>axp-layout-content>axp-layout-body .axp-search-recent>axp-layout-body{display:flex;flex-direction:row;flex-wrap:wrap;gap:calc(var(--spacing, .25rem) * 2);border-radius:var(--radius-md, .375rem)}:host>axp-layout-content axp-layout-list-item axp-layout-prefix ax-icon{display:flex;height:calc(var(--spacing, .25rem) * 9);width:calc(var(--spacing, .25rem) * 9);align-items:center;justify-content:center;border-radius:var(--radius-md, .375rem);background-color:var(--color-dark);color:var(--color-on-dark);border-color:var(--color-border-dark);font-size:1rem}:host>axp-layout-content axp-layout-list-item axp-layout-prefix ax-icon:where(.ax-dark,.ax-dark *):not(:where(.ax-light,.ax-light *)){background-color:var(--color-darker);color:var(--color-on-darker);border-color:var(--color-border-darker)}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-divide-y-reverse{syntax: \"*\"; inherits: false; initial-value: 0;}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-divide-y-reverse: 0;--tw-font-weight: initial}}}\n/*! tailwindcss v4.3.2 | MIT License | https://tailwindcss.com */\n"] }]
133
+ }], propDecorators: { list: [{ type: i0.ViewChild, args: [i0.forwardRef(() => AXListNavigationDirective), { isSignal: true }] }], searchBox: [{ type: i0.ViewChild, args: [i0.forwardRef(() => AXSearchBoxComponent), { isSignal: true }] }], items: [{ type: i0.ViewChildren, args: [i0.forwardRef(() => AXListNavigationItemDirective), { isSignal: true }] }] } });
134
+
135
+ export { AXPGlobalSearchPopupComponent };
136
+ //# sourceMappingURL=acorex-platform-module-common-client-search-popup.component-upSRWTIO.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-common-client-search-popup.component-upSRWTIO.mjs","sources":["../../../../libs/modules/common/client/src/lib/features/global-search/search-popup.component.ts","../../../../libs/modules/common/client/src/lib/features/global-search/search-popup.component.html"],"sourcesContent":["import {\n AXListNavigationDirective,\n AXListNavigationItemDirective,\n AXListNavigationModule,\n} from '@acorex/cdk/list-navigation';\nimport { AXButtonModule } from '@acorex/components/button';\nimport { AXChipsModule } from '@acorex/components/chips';\nimport { AXClickEvent, AXCommonModule, AXHtmlEvent, AXValueChangedEvent } from '@acorex/cdk/common';\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport { AXBasePageComponent } from '@acorex/components/page';\nimport { AXSearchBoxComponent, AXSearchBoxModule } from '@acorex/components/search-box';\nimport { AXSkeletonModule } from '@acorex/components/skeleton';\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { AXPSearchDisplayResult } from '@acorex-platform/framework-client/common';\nimport {\n AXPThemeLayoutBlockComponent,\n AXPThemeLayoutHeaderComponent,\n AXPThemeLayoutListComponent,\n AXPThemeLayoutListItemComponent,\n AXPThemeLayoutListItemsGroupComponent,\n AXPStateMessageComponent,\n} from '@acorex-platform/framework-client/layout/components';\nimport { CommonModule } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, inject, viewChild, viewChildren } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { first } from 'rxjs';\nimport { AXPGlobalSearchViewModel } from './search.viewmodel';\n\n@Component({\n templateUrl: 'search-popup.component.html',\n styleUrl: 'search-popup.component.css',\n imports: [\n CommonModule,\n FormsModule,\n //\n AXSearchBoxModule,\n AXCommonModule,\n AXDecoratorModule,\n AXTranslationModule,\n AXListNavigationModule,\n AXButtonModule,\n //\n AXSkeletonModule,\n AXChipsModule,\n AXPThemeLayoutBlockComponent,\n AXPThemeLayoutListComponent,\n AXPThemeLayoutListItemComponent,\n AXPThemeLayoutListItemsGroupComponent,\n AXPThemeLayoutHeaderComponent,\n AXPStateMessageComponent,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [AXPGlobalSearchViewModel],\n})\nexport class AXPGlobalSearchPopupComponent extends AXBasePageComponent {\n protected i18nScope = 'global-search';\n\n protected vm = inject(AXPGlobalSearchViewModel);\n\n protected text: string | null = null;\n\n private list = viewChild(AXListNavigationDirective);\n private searchBox = viewChild(AXSearchBoxComponent);\n private items = viewChildren(AXListNavigationItemDirective);\n\n async handleTextChanged(e: AXValueChangedEvent<string>) {\n if (e.isUserInteraction) {\n await this.vm.search(e.value!);\n }\n }\n\n protected override ngOnInit() {\n super.ngOnInit();\n //\n this.vm.onItemSelected.pipe(first()).subscribe((item) => {\n this.close(item);\n });\n }\n\n protected handleSearchKeyDown(e: AXHtmlEvent<KeyboardEvent>) {\n const event = e.nativeEvent!;\n switch (event.code) {\n case 'ArrowDown':\n const item = this.items()[0];\n if (item && this.list()) {\n this.list()?.navigateTo(item);\n }\n event.preventDefault();\n event.stopPropagation();\n break;\n }\n }\n\n protected handleClearClick($event: AXClickEvent) {\n this.vm.clearRecentItems();\n }\n\n protected handleListKeyDown(e: KeyboardEvent) {\n switch (e.code) {\n case 'ArrowUp': {\n const item = this.items()[0];\n if (item && this.list() && item.isActive()) {\n this.searchBox()?.focus();\n }\n break;\n }\n case 'Escape': {\n this.searchBox()?.focus();\n e.preventDefault();\n e.stopPropagation();\n break;\n }\n }\n }\n\n protected handleItemKeyDown(e: KeyboardEvent, item: AXPSearchDisplayResult) {\n switch (e.code) {\n case 'Enter':\n case 'Space': {\n e.preventDefault();\n e.stopPropagation();\n this.vm.execute(item);\n break;\n }\n }\n }\n\n protected handlePinClick(e: Event, item: any) {\n e.stopPropagation();\n this.vm.togglePin(item);\n }\n\n protected searchListItemIcon(item: AXPSearchDisplayResult): string {\n const icon = item.icon?.trim();\n if (!icon) {\n return 'fa-light fa-circle';\n }\n return icon.includes(' ') ? icon : `fa-light ${icon}`;\n }\n}\n","<axp-layout-content>\n <axp-layout-header class=\"ax-lg\">\n <axp-layout-prefix class=\"min-w-0 flex-1\">\n <ax-search-box\n class=\"__search-box w-full\"\n [axAutoFocus]\n [axAutoFocusTime]=\"500\"\n [look]=\"'none'\"\n [ngModel]=\"vm.text()\"\n (onValueChanged)=\"handleTextChanged($event)\"\n [placeholder]=\"\n '@global-search:terms.search-anything' | translate | async\n \"\n (onKeyDown)=\"handleSearchKeyDown($event)\"\n >\n <ax-clear-button class=\"__clear-button\"></ax-clear-button>\n </ax-search-box>\n </axp-layout-prefix>\n <axp-layout-suffix class=\"__close-button\">\n <ax-button [look]=\"'solid'\" class=\"rounded-lg ax-sm\" (onClick)=\"close()\">\n <ax-icon icon=\"fa-light fa-xmark fa-sm ax-sm\"></ax-icon>\n </ax-button>\n </axp-layout-suffix>\n </axp-layout-header>\n\n <!-- Results Area -->\n <axp-layout-body>\n @if (vm.isBusy()) {\n <ng-container *ngTemplateOutlet=\"skeleton\"></ng-container>\n } @else if (vm.isEmpty()) {\n <ng-container *ngTemplateOutlet=\"empty\"></ng-container>\n } @else if (vm.isWelcome()) {\n <ng-container *ngTemplateOutlet=\"welcome\"></ng-container>\n } @else if (vm.isStart()) {\n <ng-container *ngTemplateOutlet=\"start\"></ng-container>\n } @else {\n <ng-container *ngTemplateOutlet=\"result\"></ng-container>\n }\n </axp-layout-body>\n\n <!-- Skeleton Template -->\n <ng-template #skeleton>\n <div class=\"flex flex-col gap-10 p-8\">\n @for (item of [1, 2, 3, 4, 5]; track $index) {\n <div class=\"flex items-center gap-4\">\n <ax-skeleton\n [animated]=\"true\"\n class=\"w-4 h-4 rounded-full\"\n ></ax-skeleton>\n <div class=\"flex flex-col gap-2 flex-1\">\n <ax-skeleton\n [animated]=\"true\"\n class=\"w-1/4 h-2 rounded\"\n ></ax-skeleton>\n <ax-skeleton\n [animated]=\"true\"\n class=\"w-1/2 h-2 rounded\"\n ></ax-skeleton>\n </div>\n </div>\n }\n </div>\n </ng-template>\n\n <!-- Empty Template -->\n <ng-template #empty>\n <axp-state-message\n icon=\"fa-light fa-search\"\n [title]=\"\n '@global-search:components.search-box.empty-states.no-result.title'\n \"\n [description]=\"\n '@global-search:components.search-box.empty-states.no-result.description'\n \"\n >\n </axp-state-message>\n </ng-template>\n\n <!-- Welcome Template -->\n <ng-template #welcome>\n <axp-state-message\n icon=\"fa-light fa-search\"\n [title]=\"'@global-search:components.search-box.empty-states.start.title'\"\n [description]=\"\n '@global-search:components.search-box.empty-states.start.description'\n \"\n >\n </axp-state-message>\n </ng-template>\n\n <!-- Start Template -->\n <ng-template #start>\n <!-- Pinned Items -->\n <axp-layout-list\n class=\"p-4 divide-none\"\n (keydown)=\"handleListKeyDown($event)\"\n axListNavigation\n #list=\"axListNavigation\"\n >\n @if (vm.pinnedItems().length > 0) {\n <axp-layout-list-group>\n <axp-layout-title>{{\n '@global-search:terms.pinned' | translate | async\n }}</axp-layout-title>\n @for (item of vm.pinnedItems(); track $index) {\n <axp-layout-list-item\n (click)=\"vm.execute(item)\"\n (keydown)=\"handleItemKeyDown($event, item)\"\n class=\"group\"\n axListNavigationItem\n #i=\"axListNavigationItem\"\n [class.axp-state-focused]=\"i.isActive()\"\n >\n <ng-container\n [ngTemplateOutlet]=\"listItem\"\n [ngTemplateOutletContext]=\"{ item }\"\n ></ng-container>\n </axp-layout-list-item>\n }\n </axp-layout-list-group>\n }\n <!-- Recent Items -->\n @if (vm.recentItems().length > 0) {\n <axp-layout-list-group>\n <axp-layout-header>\n <axp-layout-prefix>\n <axp-layout-title>{{\n '@global-search:terms.recent' | translate | async\n }}</axp-layout-title>\n </axp-layout-prefix>\n <axp-layout-prefix class=\"ax-sm\">\n <ax-button\n [text]=\"'@global-search:terms.clear' | translate | async\"\n look=\"blank\"\n [color]=\"'default'\"\n (onClick)=\"handleClearClick($event)\"\n ></ax-button>\n </axp-layout-prefix>\n </axp-layout-header>\n @for (item of vm.recentItems(); track $index) {\n <axp-layout-list-item\n (click)=\"vm.execute(item)\"\n (keydown)=\"handleItemKeyDown($event, item)\"\n class=\"group\"\n axListNavigationItem\n #i=\"axListNavigationItem\"\n [class.axp-state-focused]=\"i.isActive()\"\n >\n <ng-container\n [ngTemplateOutlet]=\"listItem\"\n [ngTemplateOutletContext]=\"{ item }\"\n ></ng-container>\n </axp-layout-list-item>\n }\n </axp-layout-list-group>\n }\n </axp-layout-list>\n </ng-template>\n\n <!-- Result Template -->\n <ng-template #result>\n <axp-layout-list\n class=\"p-4 divide-none\"\n (keydown)=\"handleListKeyDown($event)\"\n axListNavigation\n #list=\"axListNavigation\"\n >\n @for (group of vm.results(); track $index) {\n <axp-layout-list-group>\n <axp-layout-title>{{\n group.title | translate | async\n }}</axp-layout-title>\n @for (item of group.children; track $index) {\n <axp-layout-list-item\n (click)=\"vm.execute(item)\"\n (keydown)=\"handleItemKeyDown($event, item)\"\n class=\"group\"\n axListNavigationItem\n #i=\"axListNavigationItem\"\n [class.axp-state-focused]=\"i.isActive()\"\n >\n <ng-container\n [ngTemplateOutlet]=\"listItem\"\n [ngTemplateOutletContext]=\"{ item }\"\n ></ng-container>\n </axp-layout-list-item>\n }\n </axp-layout-list-group>\n }\n </axp-layout-list>\n </ng-template>\n\n <ng-template #listItem let-item=\"item\">\n <axp-layout-prefix>\n <ax-icon [icon]=\"searchListItemIcon(item)\"></ax-icon>\n </axp-layout-prefix>\n <axp-layout-content>\n <axp-layout-title class=\"group\">\n <span>{{ item.title | translate | async }}</span>\n <span class=\"ms-3\" (click)=\"handlePinClick($event, item)\">\n <i\n [class.invisible]=\"!vm.isPinned(item)\"\n class=\"fa-light fa-thumbtack rotate-45 group-hover:!visible\"\n [class.fa-solid]=\"vm.isPinned(item)\"\n ></i>\n </span>\n </axp-layout-title>\n @if (item.parent) {\n <axp-layout-description>\n {{ item.parent.title | translate | async }}\n </axp-layout-description>\n } @else if (item.description) {\n <axp-layout-description>\n {{ item.description | translate | async }}\n </axp-layout-description>\n }\n </axp-layout-content>\n <axp-layout-suffix>\n <i class=\"far fa-chevron-right rtl:rotate-180\"></i>\n </axp-layout-suffix>\n </ng-template>\n</axp-layout-content>\n"],"names":["i7","i9"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAsDM,MAAO,6BAA8B,SAAQ,mBAAmB,CAAA;AA1BtE,IAAA,WAAA,GAAA;;QA2BY,IAAA,CAAA,SAAS,GAAG,eAAe;AAE3B,QAAA,IAAA,CAAA,EAAE,GAAG,MAAM,CAAC,wBAAwB,CAAC;QAErC,IAAA,CAAA,IAAI,GAAkB,IAAI;AAE5B,QAAA,IAA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A,MAAA,EAAA,IAAA,EAAAC,IAAA,CAAA,gBAAA,EAAA,IAAA,EAAA,WAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAKf,6BAA6B,EAAA,UAAA,EAAA,CAAA;kBA1BzC,SAAS;AAGC,YAAA,IAAA,EAAA,CAAA,EAAA,OAAA,EAAA;wBACP,YAAY;wBACZ,WAAW;;wBAEX,iBAAiB;wBACjB,cAAc;wBACd,iBAAiB;wBACjB,mBAAmB;wBACnB,sBAAsB;wBACtB,cAAc;;wBAEd,gBAAgB;wBAChB,aAAa;wBACb,4BAA4B;wBAC5B,2BAA2B;wBAC3B,+BAA+B;wBAC/B,qCAAqC;wBACrC,6BAA6B;wBAC7B,wBAAwB;AACzB,qBAAA,EAAA,eAAA,EACgB,uBAAuB,CAAC,MAAM,EAAA,SAAA,EACpC,CAAC,wBAAwB,CAAC,EAAA,QAAA,EAAA,g+OAAA,EAAA,MAAA,EAAA,CAAA,siIAAA,CAAA,EAAA;sFASZ,yBAAyB,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,SAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MACpB,oBAAoB,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,KAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,YAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MACrB,6BAA6B,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;;;"}
@@ -0,0 +1,59 @@
1
+ import * as i0 from '@angular/core';
2
+ import { signal, inject, Injector, computed, ViewEncapsulation, Component } from '@angular/core';
3
+ import * as i1$1 from '@angular/common';
4
+ import { CommonModule } from '@angular/common';
5
+ import * as i2 from '@acorex/components/button';
6
+ import { AXButtonModule } from '@acorex/components/button';
7
+ import { AXBasePageComponent } from '@acorex/components/page';
8
+ import * as i1 from '@acorex/components/decorators';
9
+ import { AXDecoratorModule } from '@acorex/components/decorators';
10
+ import { AXPActivityLogComponent } from '@acorex-platform/framework-client/layout/components';
11
+ import { AXPVersioningService } from '@acorex-platform/framework-client/common';
12
+ import * as i4 from '@acorex/core/translation';
13
+ import { AXTranslationModule } from '@acorex/core/translation';
14
+ import { v as versionEntriesToActivityLogs, o as openActivityLogVersionCompare } from './acorex-platform-module-common-client-acorex-platform-module-common-client-IHaYrZeE.mjs';
15
+
16
+ class AXMTimelineVersionHistoryPopupComponent extends AXBasePageComponent {
17
+ constructor() {
18
+ super(...arguments);
19
+ this.isBusy = signal(false, ...(ngDevMode ? [{ debugName: "isBusy" }] : /* istanbul ignore next */ []));
20
+ this.versioning = inject(AXPVersioningService);
21
+ this.injector = inject(Injector);
22
+ this.versions = signal([], ...(ngDevMode ? [{ debugName: "versions" }] : /* istanbul ignore next */ []));
23
+ this.activities = computed(() => versionEntriesToActivityLogs(this.versions(), this.refId, this.refType, this.fieldTitles), ...(ngDevMode ? [{ debugName: "activities" }] : /* istanbul ignore next */ []));
24
+ }
25
+ async ngOnInit() {
26
+ this.isBusy.set(true);
27
+ super.ngOnInit();
28
+ const streamId = await this.versioning.getStreamIdIfExists(this.refType, this.refId);
29
+ if (streamId) {
30
+ const entries = await this.versioning.listEntries(streamId, {
31
+ limit: this.limit,
32
+ offset: this.offset,
33
+ });
34
+ this.versions.set(entries);
35
+ }
36
+ else {
37
+ this.versions.set([]);
38
+ }
39
+ this.isBusy.set(false);
40
+ }
41
+ async onCompareRequested(event) {
42
+ await openActivityLogVersionCompare(this.injector, event);
43
+ }
44
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMTimelineVersionHistoryPopupComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
45
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.9", type: AXMTimelineVersionHistoryPopupComponent, isStandalone: true, selector: "axp-timeline-version-history-popup", usesInheritance: true, ngImport: i0, template: "<ax-content>\n <div class=\"p-6 min-h-[30vh] overflow-y-auto\">\n <axp-activity-log\n [activities]=\"activities()\"\n [loading]=\"isBusy()\"\n [enableCompare]=\"true\"\n (compareRequested)=\"onCompareRequested($event)\"\n ></axp-activity-log>\n </div>\n</ax-content>\n<ax-footer>\n <ax-prefix></ax-prefix>\n <ax-suffix>\n <ax-button\n [text]=\"'@general:actions.close.title' | translate | async\"\n look=\"solid\"\n color=\"primary\"\n (onClick)=\"close()\"\n >\n </ax-button>\n </ax-suffix>\n</ax-footer>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i1.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i2.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "component", type: AXPActivityLogComponent, selector: "axp-activity-log", inputs: ["activities", "loading", "enableCompare"], outputs: ["compareRequested"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.AXTranslatorPipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None }); }
46
+ }
47
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMTimelineVersionHistoryPopupComponent, decorators: [{
48
+ type: Component,
49
+ args: [{ selector: 'axp-timeline-version-history-popup', imports: [
50
+ CommonModule,
51
+ AXDecoratorModule,
52
+ AXButtonModule,
53
+ AXTranslationModule,
54
+ AXPActivityLogComponent,
55
+ ], encapsulation: ViewEncapsulation.None, template: "<ax-content>\n <div class=\"p-6 min-h-[30vh] overflow-y-auto\">\n <axp-activity-log\n [activities]=\"activities()\"\n [loading]=\"isBusy()\"\n [enableCompare]=\"true\"\n (compareRequested)=\"onCompareRequested($event)\"\n ></axp-activity-log>\n </div>\n</ax-content>\n<ax-footer>\n <ax-prefix></ax-prefix>\n <ax-suffix>\n <ax-button\n [text]=\"'@general:actions.close.title' | translate | async\"\n look=\"solid\"\n color=\"primary\"\n (onClick)=\"close()\"\n >\n </ax-button>\n </ax-suffix>\n</ax-footer>\n" }]
56
+ }] });
57
+
58
+ export { AXMTimelineVersionHistoryPopupComponent };
59
+ //# sourceMappingURL=acorex-platform-module-common-client-timeline-version-history-popup.component-D4lLwLpx.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-common-client-timeline-version-history-popup.component-D4lLwLpx.mjs","sources":["../../../../libs/modules/common/client/src/lib/features/history-plugin/components/timeline-version-history-popup/timeline-version-history-popup.component.ts","../../../../libs/modules/common/client/src/lib/features/history-plugin/components/timeline-version-history-popup/timeline-version-history-popup.component.html"],"sourcesContent":["import { Component, inject, Injector, signal, ViewEncapsulation, computed } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { AXButtonModule } from '@acorex/components/button';\nimport { AXBasePageComponent } from '@acorex/components/page';\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport {\n AXPActivityLogCompareRequest,\n AXPActivityLogComponent,\n} from '@acorex-platform/framework-client/layout/components';\nimport { AXPVersionEntry, AXPVersioningService } from '@acorex-platform/framework-client/common';\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { versionEntriesToActivityLogs } from '../../utils/version-history.utils';\nimport { openActivityLogVersionCompare } from '../../utils/open-activity-log-compare.util';\n\n@Component({\n selector: 'axp-timeline-version-history-popup',\n templateUrl: './timeline-version-history-popup.component.html',\n imports: [\n CommonModule,\n AXDecoratorModule,\n AXButtonModule,\n AXTranslationModule,\n AXPActivityLogComponent,\n ],\n encapsulation: ViewEncapsulation.None,\n})\nexport class AXMTimelineVersionHistoryPopupComponent extends AXBasePageComponent {\n refId!: string;\n refType!: string;\n fieldTitles?: Record<string, string>;\n fromDate!: Date;\n toDate!: Date;\n limit!: number;\n offset!: number;\n\n protected isBusy = signal(false);\n\n protected versioning = inject(AXPVersioningService);\n private readonly injector = inject(Injector);\n protected versions = signal<AXPVersionEntry[]>([]);\n protected activities = computed(() =>\n versionEntriesToActivityLogs(\n this.versions(),\n this.refId,\n this.refType,\n this.fieldTitles\n )\n );\n\n override async ngOnInit(): Promise<void> {\n this.isBusy.set(true);\n super.ngOnInit();\n const streamId = await this.versioning.getStreamIdIfExists(this.refType, this.refId);\n if (streamId) {\n const entries = await this.versioning.listEntries(streamId, {\n limit: this.limit,\n offset: this.offset,\n });\n this.versions.set(entries);\n } else {\n this.versions.set([]);\n }\n this.isBusy.set(false);\n }\n\n protected async onCompareRequested(event: AXPActivityLogCompareRequest): Promise<void> {\n await openActivityLogVersionCompare(this.injector, event);\n }\n}\n","<ax-content>\n <div class=\"p-6 min-h-[30vh] overflow-y-auto\">\n <axp-activity-log\n [activities]=\"activities()\"\n [loading]=\"isBusy()\"\n [enableCompare]=\"true\"\n (compareRequested)=\"onCompareRequested($event)\"\n ></axp-activity-log>\n </div>\n</ax-content>\n<ax-footer>\n <ax-prefix></ax-prefix>\n <ax-suffix>\n <ax-button\n [text]=\"'@general:actions.close.title' | translate | async\"\n look=\"solid\"\n color=\"primary\"\n (onClick)=\"close()\"\n >\n </ax-button>\n </ax-suffix>\n</ax-footer>\n"],"names":["i3"],"mappings":";;;;;;;;;;;;;;;AA2BM,MAAO,uCAAwC,SAAQ,mBAAmB,CAAA;AAZ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,EAAA,CAAA,kBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAAA,IAAA,CAAA,SAAA,EAAA,IAAA,EAAA,OAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAA,EAAA,CAAA,gBAAA,EAAA,IAAA,EAAA,WAAA,EAAA,CAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA,CAAA;;2FAId,uCAAuC,EAAA,UAAA,EAAA,CAAA;kBAZnD,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,oCAAoC,EAAA,OAAA,EAErC;wBACP,YAAY;wBACZ,iBAAiB;wBACjB,cAAc;wBACd,mBAAmB;wBACnB,uBAAuB;qBACxB,EAAA,aAAA,EACc,iBAAiB,CAAC,IAAI,EAAA,QAAA,EAAA,yjBAAA,EAAA;;;;;"}
@@ -0,0 +1,2 @@
1
+ export { b as AXMCommonModule, c as AXMMenuProvider, d as AXMSettingProvider, e as AXMVersionHistoryPageComponent, f as AXPArchivePluginModule, g as AXPCommonFeatureDefinitionProvider, h as AXPDerivedNamePluginModule, j as AXPDisablePluginModule, k as AXPGlobalSearchModule, a as AXPGlobalSearchViewModel, l as AXPHistoryAuditInfoWidget, m as AXPHistoryModule, n as AXPLockEntityCommand, p as AXPResourceAppointmentPageComponent, q as AXPStatusPluginModule, r as AXPUniqueFieldsPluginModule, s as AXPUnlockEntityCommand, u as AXPValidationRulesModule, A as AXP_ENTITY_ARCHIVE_OVERRIDES, w as AXP_GLOBAL_SEARCH_CONFIG_TOKEN, x as AXP_RESOURCE_APPOINTMENT_PAGE_CONFIG, y as ApprovalStatusProvider, z as AtLeastOneOfValidationRule, C as CommonManifest, H as HISTORY_PAGE_COMPONENT_KEY, S as ShowVersionHistoryPopupCommand, B as StateStatusProvider, T as TaskStatusProvider, U as UniqueValidationRule, V as VARIABLE_NAME_VALIDATION_PATTERN, D as VariableNameValidationRule, E as aggregateVersionHistoryBarChartItems, F as archivePlugin, G as buildEntityFieldHistoryLineChartSeries, I as buildProductBasePriceHistoryLineChartSeries, J as derivedNamePlugin, K as disablePlugin, L as getActiveStatuses, M as getFinalStatuses, N as getInitialStatuses, O as getStatusByName, P as getTransitionsFromStatus, Q as getTransitionsToStatus, R as historyPlugin, W as humanizeChange, X as isValidTransition, i as isValidVariableName, Y as mapChangeType, Z as mapOpToAction, _ as resolvePathKey, $ as statusPlugin, t as toVariableName, a0 as uniqueFieldsPlugin, v as versionEntriesToActivityLogs } from './acorex-platform-module-common-client-acorex-platform-module-common-client-IHaYrZeE.mjs';
2
+ //# sourceMappingURL=acorex-platform-module-common-client.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-common-client.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}