@acorex/platform 20.3.0-next.0 → 20.3.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/common/index.d.ts +5 -119
- package/core/index.d.ts +67 -72
- package/fesm2022/acorex-platform-auth.mjs +1 -1
- package/fesm2022/acorex-platform-auth.mjs.map +1 -1
- package/fesm2022/acorex-platform-common.mjs +11 -35
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-core.mjs +164 -142
- package/fesm2022/acorex-platform-core.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-builder.mjs +638 -1168
- package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-components.mjs +51 -1439
- package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-designer.mjs +137 -92
- package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-entity.mjs +1059 -3204
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-views.mjs +72 -373
- package/fesm2022/acorex-platform-layout-views.mjs.map +1 -1
- package/fesm2022/acorex-platform-themes-default-create-entity-view.component-SY0oMDoH.mjs +22 -0
- package/fesm2022/acorex-platform-themes-default-create-entity-view.component-SY0oMDoH.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-entity-master-create-view.component-I7Eq8Nti.mjs → acorex-platform-themes-default-entity-master-create-view.component-hHXxHlFG.mjs} +3 -3
- package/fesm2022/{acorex-platform-themes-default-entity-master-create-view.component-I7Eq8Nti.mjs.map → acorex-platform-themes-default-entity-master-create-view.component-hHXxHlFG.mjs.map} +1 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-hf4QOz_4.mjs +665 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-hf4QOz_4.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-entity-master-modify-view.component-16sdMBvH.mjs → acorex-platform-themes-default-entity-master-modify-view.component-DC3MrDtI.mjs} +10 -3
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-DC3MrDtI.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-Bb90PeHq.mjs +236 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-Bb90PeHq.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default.mjs +484 -39
- package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
- package/fesm2022/{acorex-platform-themes-shared-theme-color-chooser-column.component-DjKLg513.mjs → acorex-platform-themes-shared-color-chooser-column.component-DjKLg513.mjs} +1 -1
- package/fesm2022/acorex-platform-themes-shared-color-chooser-column.component-DjKLg513.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-shared-theme-color-chooser-view.component-DE0wO98F.mjs → acorex-platform-themes-shared-color-chooser-view.component-DE0wO98F.mjs} +1 -1
- package/fesm2022/acorex-platform-themes-shared-color-chooser-view.component-DE0wO98F.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-shared.mjs +13 -11
- package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
- package/fesm2022/{acorex-platform-widgets-button-widget-designer.component-BJtkWusr.mjs → acorex-platform-widgets-button-widget-designer.component-lNF95FJv.mjs} +3 -3
- package/fesm2022/acorex-platform-widgets-button-widget-designer.component-lNF95FJv.mjs.map +1 -0
- package/fesm2022/{acorex-platform-widgets-checkbox-widget-column.component-DeKpl0uK.mjs → acorex-platform-widgets-checkbox-widget-column.component-BNBOATPB.mjs} +2 -1
- package/fesm2022/acorex-platform-widgets-checkbox-widget-column.component-BNBOATPB.mjs.map +1 -0
- package/fesm2022/{acorex-platform-widgets-checkbox-widget-designer.component-Cv7dEMCm.mjs → acorex-platform-widgets-checkbox-widget-designer.component-BI18uzNZ.mjs} +2 -2
- package/fesm2022/acorex-platform-widgets-checkbox-widget-designer.component-BI18uzNZ.mjs.map +1 -0
- package/fesm2022/{acorex-platform-widgets-color-box-widget-designer.component-CohkI1w1.mjs → acorex-platform-widgets-color-box-widget-designer.component-pYOQv5g8.mjs} +2 -2
- package/fesm2022/acorex-platform-widgets-color-box-widget-designer.component-pYOQv5g8.mjs.map +1 -0
- package/fesm2022/{acorex-platform-widgets-file-list-popup.component-BafU5Lfl.mjs → acorex-platform-widgets-file-list-popup.component-DFbPO0ud.mjs} +4 -69
- package/fesm2022/acorex-platform-widgets-file-list-popup.component-DFbPO0ud.mjs.map +1 -0
- package/fesm2022/{acorex-platform-widgets-page-widget-designer.component-Cw9WcZze.mjs → acorex-platform-widgets-page-widget-designer.component-DRsLkulH.mjs} +64 -74
- package/fesm2022/acorex-platform-widgets-page-widget-designer.component-DRsLkulH.mjs.map +1 -0
- package/fesm2022/{acorex-platform-widgets-tabular-data-edit-popup.component-BDQIfr0g.mjs → acorex-platform-widgets-tabular-data-edit-popup.component-nLZYiPnF.mjs} +5 -5
- package/fesm2022/{acorex-platform-widgets-tabular-data-edit-popup.component-BDQIfr0g.mjs.map → acorex-platform-widgets-tabular-data-edit-popup.component-nLZYiPnF.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-widgets-tabular-data-view-popup.component-CmPqtt0G.mjs → acorex-platform-widgets-tabular-data-view-popup.component-D6kiasYM.mjs} +3 -3
- package/fesm2022/{acorex-platform-widgets-tabular-data-view-popup.component-CmPqtt0G.mjs.map → acorex-platform-widgets-tabular-data-view-popup.component-D6kiasYM.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-widgets-text-block-widget-designer.component-DaR4Nkv4.mjs → acorex-platform-widgets-text-block-widget-designer.component-CCMQtH3e.mjs} +12 -8
- package/fesm2022/acorex-platform-widgets-text-block-widget-designer.component-CCMQtH3e.mjs.map +1 -0
- package/fesm2022/acorex-platform-widgets.mjs +1498 -2707
- package/fesm2022/acorex-platform-widgets.mjs.map +1 -1
- package/fesm2022/acorex-platform-workflow.mjs +0 -3
- package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
- package/layout/builder/index.d.ts +181 -367
- package/layout/components/index.d.ts +25 -372
- package/layout/designer/index.d.ts +47 -16
- package/layout/entity/index.d.ts +336 -222
- package/layout/views/index.d.ts +22 -129
- package/package.json +36 -22
- package/widgets/index.d.ts +224 -275
- package/workflow/index.d.ts +1 -4
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-D3VUh8K8.mjs +0 -707
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-D3VUh8K8.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-16sdMBvH.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-BMkhNfF4.mjs +0 -244
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-BMkhNfF4.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-DjKLg513.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-DE0wO98F.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-button-widget-designer.component-BJtkWusr.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-checkbox-widget-column.component-DeKpl0uK.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-checkbox-widget-designer.component-Cv7dEMCm.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-color-box-widget-designer.component-CohkI1w1.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-extra-properties-schema-widget-edit.component-B3SJUnGQ.mjs +0 -50
- package/fesm2022/acorex-platform-widgets-extra-properties-schema-widget-edit.component-B3SJUnGQ.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-extra-properties-schema-widget-view.component-BLR0JkRt.mjs +0 -42
- package/fesm2022/acorex-platform-widgets-extra-properties-schema-widget-view.component-BLR0JkRt.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-extra-properties-values-widget-edit.component-hzR2FgOm.mjs +0 -55
- package/fesm2022/acorex-platform-widgets-extra-properties-values-widget-edit.component-hzR2FgOm.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-extra-properties-values-widget-view.component-IDm6Clua.mjs +0 -50
- package/fesm2022/acorex-platform-widgets-extra-properties-values-widget-view.component-IDm6Clua.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-extra-properties-widget-edit.component-BRO9tYDa.mjs +0 -48
- package/fesm2022/acorex-platform-widgets-extra-properties-widget-edit.component-BRO9tYDa.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-extra-properties-widget-view.component-CkpLimyW.mjs +0 -42
- package/fesm2022/acorex-platform-widgets-extra-properties-widget-view.component-CkpLimyW.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-file-list-popup.component-BafU5Lfl.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-page-widget-designer.component-Cw9WcZze.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-text-block-widget-designer.component-DaR4Nkv4.mjs.map +0 -1
|
@@ -1,69 +1,52 @@
|
|
|
1
1
|
import * as i2$2 from '@acorex/components/button';
|
|
2
2
|
import { AXButtonModule } from '@acorex/components/button';
|
|
3
3
|
import { AXCommonModule } from '@acorex/cdk/common';
|
|
4
|
-
import * as
|
|
4
|
+
import * as i3 from '@acorex/components/decorators';
|
|
5
5
|
import { AXDecoratorModule } from '@acorex/components/decorators';
|
|
6
|
-
import * as
|
|
6
|
+
import * as i2 from '@acorex/core/translation';
|
|
7
7
|
import { AXTranslationService, AXTranslationModule } from '@acorex/core/translation';
|
|
8
|
-
import * as i3 from '@acorex/components/skeleton';
|
|
8
|
+
import * as i3$1 from '@acorex/components/skeleton';
|
|
9
9
|
import { AXSkeletonModule } from '@acorex/components/skeleton';
|
|
10
|
-
import * as i5
|
|
10
|
+
import * as i5 from '@acorex/core/format';
|
|
11
11
|
import { AXFormatModule } from '@acorex/core/format';
|
|
12
12
|
import { getSystemActions, AXPExpressionEvaluatorService, AXPContextStore } from '@acorex/platform/core';
|
|
13
13
|
import { AXPWorkflowService } from '@acorex/platform/workflow';
|
|
14
14
|
import * as i4 from '@angular/common';
|
|
15
15
|
import { CommonModule } from '@angular/common';
|
|
16
16
|
import * as i0 from '@angular/core';
|
|
17
|
-
import { inject, input, signal, effect, ViewEncapsulation, ChangeDetectionStrategy, Component, InjectionToken, computed, Injectable, Directive, viewChild, contentChild, ElementRef,
|
|
17
|
+
import { inject, input, signal, effect, ViewEncapsulation, ChangeDetectionStrategy, Component, InjectionToken, computed, Injectable, Directive, viewChild, contentChild, ElementRef, Injector, ViewContainerRef, runInInjectionContext, Optional, Inject, NgModule, output, linkedSignal, untracked, ViewChildren } from '@angular/core';
|
|
18
18
|
import { AXAccordionCdkModule } from '@acorex/cdk/accordion';
|
|
19
19
|
import { AXTagModule } from '@acorex/components/tag';
|
|
20
20
|
import { SIGNAL, signalSetFn } from '@angular/core/primitives/signals';
|
|
21
21
|
import * as i8 from '@acorex/components/badge';
|
|
22
22
|
import { AXBadgeComponent, AXBadgeModule } from '@acorex/components/badge';
|
|
23
|
-
import * as
|
|
24
|
-
import { AXSwitchModule } from '@acorex/components/switch';
|
|
25
|
-
import * as i9 from '@angular/cdk/drag-drop';
|
|
26
|
-
import { moveItemInArray, CdkDropList, CdkDrag, CdkDragHandle, DragDropModule } from '@angular/cdk/drag-drop';
|
|
27
|
-
import * as i1 from '@angular/forms';
|
|
28
|
-
import { FormsModule } from '@angular/forms';
|
|
29
|
-
import { cloneDeep, sortBy, isEqual, camelCase, merge, capitalize, unionBy, isArray, isNil, isEmpty, set } from 'lodash-es';
|
|
30
|
-
import * as i2$1 from '@acorex/components/form';
|
|
23
|
+
import * as i1$1 from '@acorex/components/form';
|
|
31
24
|
import { AXFormModule, AXFormComponent } from '@acorex/components/form';
|
|
32
|
-
import * as i4$1 from '@acorex/components/text-box';
|
|
33
25
|
import { AXTextBoxModule } from '@acorex/components/text-box';
|
|
34
|
-
import * as i2 from '@acorex/components/check-box';
|
|
26
|
+
import * as i2$1 from '@acorex/components/check-box';
|
|
35
27
|
import { AXCheckBoxModule } from '@acorex/components/check-box';
|
|
36
|
-
import * as
|
|
28
|
+
import * as i1 from '@acorex/components/label';
|
|
37
29
|
import { AXLabelModule, AXLabelComponent } from '@acorex/components/label';
|
|
38
|
-
import * as i3$
|
|
39
|
-
import { AXPLayoutBuilderModule, AXPWidgetContainerComponent, AXPPageStatus
|
|
40
|
-
import {
|
|
30
|
+
import * as i3$2 from '@acorex/platform/layout/builder';
|
|
31
|
+
import { AXPLayoutBuilderModule, AXPWidgetContainerComponent, AXPPageStatus } from '@acorex/platform/layout/builder';
|
|
32
|
+
import { sortBy } from 'lodash-es';
|
|
41
33
|
import { AXValidationModule } from '@acorex/core/validation';
|
|
42
34
|
import { AXPGridLayoutDirective, AXPFilterOperatorMiddlewareService, ALL_DEFAULT_OPERATORS } from '@acorex/platform/common';
|
|
43
|
-
import
|
|
44
|
-
import
|
|
45
|
-
import
|
|
46
|
-
import { AXLoadingModule } from '@acorex/components/loading';
|
|
47
|
-
import { AXPopupService } from '@acorex/components/popup';
|
|
48
|
-
import * as i5$2 from '@acorex/components/select-box';
|
|
49
|
-
import { AXSelectBoxModule } from '@acorex/components/select-box';
|
|
50
|
-
import * as i1$1 from '@acorex/components/collapse';
|
|
51
|
-
import { AXCollapseModule } from '@acorex/components/collapse';
|
|
52
|
-
import * as i2$3 from '@acorex/components/tabs';
|
|
53
|
-
import { AXTabsModule } from '@acorex/components/tabs';
|
|
54
|
-
import * as i7$1 from '@acorex/cdk/list-navigation';
|
|
35
|
+
import * as i1$2 from '@angular/forms';
|
|
36
|
+
import { FormsModule } from '@angular/forms';
|
|
37
|
+
import * as i7 from '@acorex/cdk/list-navigation';
|
|
55
38
|
import { AXListNavigationModule } from '@acorex/cdk/list-navigation';
|
|
56
|
-
import * as i4$
|
|
39
|
+
import * as i4$1 from '@acorex/components/popover';
|
|
57
40
|
import { AXPopoverModule } from '@acorex/components/popover';
|
|
58
41
|
import { AXSelectionListModule } from '@acorex/components/selection-list';
|
|
59
|
-
import * as i5$
|
|
42
|
+
import * as i5$1 from '@acorex/components/tag-box';
|
|
60
43
|
import { AXTagBoxModule } from '@acorex/components/tag-box';
|
|
61
44
|
import { AXCalendarService } from '@acorex/core/date-time';
|
|
62
45
|
import { BehaviorSubject, timer, Subject, takeUntil } from 'rxjs';
|
|
63
46
|
import { tap } from 'rxjs/operators';
|
|
64
|
-
import * as i1$
|
|
47
|
+
import * as i1$3 from '@acorex/components/avatar';
|
|
65
48
|
import { AXAvatarModule } from '@acorex/components/avatar';
|
|
66
|
-
import * as i3$
|
|
49
|
+
import * as i3$3 from '@acorex/components/image';
|
|
67
50
|
import { AXImageModule } from '@acorex/components/image';
|
|
68
51
|
|
|
69
52
|
//#region ---- Component Definition ----
|
|
@@ -196,7 +179,7 @@ class AXPActivityLogComponent {
|
|
|
196
179
|
return currentIndex > 0; // Can compare if not the first activity
|
|
197
180
|
}
|
|
198
181
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPActivityLogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
199
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: AXPActivityLogComponent, isStandalone: true, selector: "axp-activity-log", inputs: { activities: { classPropertyName: "activities", publicName: "activities", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"axp-activity-log ax-accent2\" *translate=\"let t\">\n\n <!-- Activity Log Content -->\n <div class=\"__content\">\n\n <!-- Loading State -->\n @if (loading()) {\n <div class=\"__loading\">\n @for (item of [1,2,3,4]; track $index) {\n <div class=\"__item\">\n <ax-skeleton [animated]=\"true\" class=\"__avatar\"></ax-skeleton>\n <div class=\"__content\">\n <ax-skeleton [animated]=\"true\" class=\"__title\"></ax-skeleton>\n <ax-skeleton [animated]=\"true\" class=\"__subtitle\"></ax-skeleton>\n <ax-skeleton [animated]=\"true\" class=\"__description\"></ax-skeleton>\n <ax-skeleton [animated]=\"true\" class=\"__time\"></ax-skeleton>\n </div>\n </div>\n }\n </div>\n }\n\n <!-- Activity Feed -->\n @if (!loading() && activities().length > 0) {\n <div class=\"__feed\">\n @for (activity of activities(); track activity.id) {\n @let changeClasses = getChangeClasses(activity.changeType);\n @let isItemExpanded = isExpanded(activity.id);\n @let hasExpandableContentItem = hasExpandableContent(activity);\n <div class=\"__item\" [class.__collapsed]=\"!isItemExpanded\" [class.__expandable]=\"hasExpandableContentItem\">\n\n <div\n class=\"ax-size-10 ax-rounded-full ax-border ax-flex ax-items-center ax-justify-center ax-lightest-surface \">\n <i class=\"{{changeClasses.icon}} {{changeClasses.text}} fa-solid\"></i>\n </div>\n\n <!-- Activity Content -->\n <div class=\"__content\">\n <!-- Main Activity Info -->\n <div class=\"__main-info\">\n\n <!-- User and Action with Toggle Button -->\n <div class=\"__action-line __header-line\" (click)=\"toggleExpanded(activity.id)\">\n <span class=\"__user-name\">{{ activity.user.title }}</span>\n <span class=\"__action-type\">\n {{ t(`actions.${activity.changeType}.title`, {\n scope: 'general' }) | async }}\n </span>\n <span class=\"__action-text\">\n {{ activity.title | translate | async }}\n </span>\n\n <!-- Compare Button -->\n @if (canCompare(activity)) {\n <button type=\"button\" class=\"__compare-button\" (click)=\"handleCompare(activity, $event)\"\n [attr.aria-label]=\"t('compare.title', { scope: i18nScope }) | async\">\n <i class=\"fa-solid fa-code-compare\"></i>\n </button>\n }\n\n <!-- Toggle Button (only show if there's expandable content) -->\n @if (hasExpandableContentItem) {\n <button type=\"button\" class=\"__toggle-button\" [attr.aria-expanded]=\"isItemExpanded\"\n [attr.aria-label]=\"isItemExpanded ? 'Collapse details' : 'Expand details'\">\n <i class=\"fa-solid\" [class.fa-chevron-down]=\"!isItemExpanded\"\n [class.fa-chevron-up]=\"isItemExpanded\"></i>\n </button>\n }\n </div>\n\n <!-- Expandable Description/Changes -->\n @if (hasExpandableContentItem && isItemExpanded && activity.changes.length > 0) {\n <div class=\"__action-lines __expandable-content\"\n [class.__animated]=\"shouldAnimate(activity.id)\">\n @for (change of activity.changes; track $index) {\n @let changeClasses = getChangeClasses(change.type);\n <div class=\"__action-line\">\n <div class=\"ax-rounded-full ax-size-7 ax-grid ax-place-items-center\">\n <i class=\"{{changeClasses.icon}} {{changeClasses.text}}\"></i>\n </div>\n <span class=\"__action-text\">{{\n change.description | translate | async }}</span>\n </div>\n }\n </div>\n }\n </div>\n\n <!-- Time -->\n <div class=\"__time\">\n {{ activity.date | format: 'datetime' : 'short' | async }}\n </div>\n\n </div>\n\n </div>\n }\n </div>\n }\n\n <!-- Empty State -->\n @if (!loading() && activities().length === 0) {\n <div class=\"__empty\">\n <div class=\"__icon\">\n <ax-icon icon=\"fa-light fa-history\" class=\"__svg\"></ax-icon>\n </div>\n <div class=\"__content\">\n <h4 class=\"__title\">{{ t('no-history.title', { scope: i18nScope }) | async }}</h4>\n <p class=\"__message\">{{ t('no-history.message', { scope: i18nScope }) | async }}\n </p>\n </div>\n </div>\n }\n\n </div>\n</div>\n\n<!-- \n\nax-success-surface\nax-primary-surface\nax-danger-surface\nax-warning-surface\nax-info-surface\nax-muted-surface\nax-text-success\n\n -->", styles: [".axp-activity-log{height:100%;width:100%}.axp-activity-log .__content .__loading>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.axp-activity-log .__content .__loading .__item{display:flex;align-items:flex-start;gap:1rem}.axp-activity-log .__content .__loading .__item .__avatar{height:3rem;width:3rem;flex-shrink:0;border-radius:9999px}.axp-activity-log .__content .__loading .__item .__content{flex:1 1 0%}.axp-activity-log .__content .__loading .__item .__content>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.axp-activity-log .__content .__loading .__item .__content .__title{height:1rem;width:75%;border-radius:.25rem}.axp-activity-log .__content .__loading .__item .__content .__subtitle{height:.75rem;width:50%;border-radius:.25rem}.axp-activity-log .__content .__loading .__item .__content .__description{height:.75rem;width:83.333333%;border-radius:.25rem}.axp-activity-log .__content .__loading .__item .__content .__time{height:.75rem;width:25%;border-radius:.25rem}.axp-activity-log .__content .__feed{position:relative}.axp-activity-log .__content .__feed>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.axp-activity-log .__content .__feed:before{content:\"\";position:absolute;inset-inline-start:1.25rem;top:.5rem;bottom:.5rem;width:0px;border-left:1px solid rgba(var(--ax-sys-color-border-surface));z-index:0}.axp-activity-log .__content .__feed .__item{position:relative;display:flex;align-items:flex-start;gap:1rem}.axp-activity-log .__content .__feed .__item axp-user-avatar{position:relative;z-index:10}.axp-activity-log .__content .__feed .__item .__content{min-width:0px;flex:1 1 0%}.axp-activity-log .__content .__feed .__item .__content .__main-info{margin-bottom:.25rem}.axp-activity-log .__content .__feed .__item .__content .__main-info .__action-line{margin-top:.25rem;display:flex;flex-wrap:wrap;align-items:center;gap:.25rem;line-height:1.5}.axp-activity-log .__content .__feed .__item .__content .__main-info .__action-line .__user-name{font-weight:600}.axp-activity-log .__content .__feed .__item .__content .__main-info .__action-line .__action-type,.axp-activity-log .__content .__feed .__item .__content .__main-info .__action-line .__action-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.875rem;line-height:1.25rem;opacity:.85}.axp-activity-log .__content .__feed .__item .__content .__main-info .__action-line.__header-line{align-items:center;border-radius:.375rem;padding:.25rem .5rem}.axp-activity-log .__content .__feed .__item .__content .__main-info .__action-line.__header-line:hover{background-color:rgb(var(--ax-sys-color-lighter-surface));color:rgb(var(--ax-sys-color-on-lighter-surface));border-color:rgb(var(--ax-sys-color-border-lighter-surface))}.axp-activity-log .__content .__feed .__item .__content .__main-info .__action-line.__header-line .__compare-button{margin-left:.5rem;border-radius:9999px;padding:.25rem;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s;animation-duration:.2s;display:flex;width:1.5rem;height:1.5rem;align-items:center;justify-content:center;--tw-text-opacity: 1;color:rgba(var(--ax-sys-color-primary-500),var(--tw-text-opacity, 1))}.axp-activity-log .__content .__feed .__item .__content .__main-info .__action-line.__header-line .__compare-button:hover{background-color:rgb(var(--ax-sys-color-primary-surface));color:rgb(var(--ax-sys-color-on-primary-surface));border-color:rgb(var(--ax-sys-color-border-primary-surface))}.axp-activity-log .__content .__feed .__item .__content .__main-info .__action-line.__header-line .__compare-button:focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-opacity: 1;--tw-ring-color: rgba(var(--ax-sys-color-primary-500), var(--tw-ring-opacity, 1));--tw-ring-offset-width: 1px}.axp-activity-log .__content .__feed .__item .__content .__main-info .__action-line.__header-line .__compare-button i{font-size:.75rem;line-height:1rem}.axp-activity-log .__content .__feed .__item .__content .__main-info .__action-line.__header-line .__toggle-button{margin-left:auto;border-radius:9999px;padding:.25rem;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s;animation-duration:.2s;display:flex;width:1.5rem;height:1.5rem;align-items:center;justify-content:center}.axp-activity-log .__content .__feed .__item .__content .__main-info .__action-line.__header-line .__toggle-button:focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-opacity: 1;--tw-ring-color: rgba(var(--ax-sys-color-primary-500), var(--tw-ring-opacity, 1));--tw-ring-offset-width: 1px}.axp-activity-log .__content .__feed .__item .__content .__main-info .__action-line.__header-line .__toggle-button i{font-size:.75rem;line-height:1rem;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s;animation-duration:.2s}.axp-activity-log .__content .__feed .__item .__content .__main-info .__action-lines{margin-top:.5rem;margin-bottom:.5rem;display:flex;flex-direction:column;font-size:.875rem;line-height:1.25rem}.axp-activity-log .__content .__feed .__item .__content .__main-info .__action-lines.__expandable-content{overflow:hidden}.axp-activity-log .__content .__feed .__item .__content .__main-info .__action-lines.__expandable-content.__animated{transition-property:all;transition-duration:.3s;transition-timing-function:cubic-bezier(.4,0,.2,1);animation-duration:.3s;animation-timing-function:cubic-bezier(.4,0,.2,1);animation:slideDown .3s ease-out}.axp-activity-log .__content .__feed .__item .__content .__main-info .__action-lines .__action-line{display:flex;align-items:center;gap:.5rem;padding-top:.25rem;padding-bottom:.25rem}.axp-activity-log .__content .__feed .__item .__content .__main-info .__action-lines .__action-line .__action-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.875rem;line-height:1.25rem;opacity:.85}.axp-activity-log .__content .__feed .__item .__content .__time{padding-left:.5rem;padding-right:.5rem;font-size:.75rem;line-height:1rem;opacity:.75}.axp-activity-log .__content .__feed .__item.__collapsed .__expandable-content{display:none}.axp-activity-log .__content .__feed .__item.__expandable .__header-line{cursor:pointer}.axp-activity-log .__content .__empty{display:flex;height:12rem;flex-direction:column;align-items:center;justify-content:center;padding:2rem;text-align:center}.axp-activity-log .__content .__empty .__icon{margin-bottom:1rem}.axp-activity-log .__content .__empty .__icon .__svg{font-size:2.25rem;line-height:2.5rem;--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.axp-activity-log .__content .__empty .__content .__title{margin-bottom:.5rem;font-size:1.125rem;line-height:1.75rem;font-weight:600;--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.axp-activity-log .__content .__empty .__content .__message{max-width:20rem;line-height:1.625;--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}@media (min-width: 640px){.axp-activity-log .__content .__feed .__item{gap:.625rem}.axp-activity-log .__content .__feed .__item .__content .__main-info .__action-line{flex-wrap:nowrap}}@keyframes slideDown{0%{opacity:0;max-height:0;transform:translateY(-10px)}to{opacity:1;max-height:200px;transform:translateY(0)}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "ngmodule", type: AXCommonModule }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i7.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "directive", type: i5.AXTranslatorDirective, selector: "[translate]" }, { kind: "ngmodule", type: AXSkeletonModule }, { kind: "component", type: i3.AXSkeletonComponent, selector: "ax-skeleton", inputs: ["animated"] }, { kind: "ngmodule", type: AXFormatModule }, { kind: "ngmodule", type: AXTagModule }, { kind: "ngmodule", type: AXAccordionCdkModule }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "pipe", type: i5.AXTranslatorPipe, name: "translate" }, { kind: "pipe", type: i5$1.AXFormatPipe, name: "format" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
182
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: AXPActivityLogComponent, isStandalone: true, selector: "axp-activity-log", inputs: { activities: { classPropertyName: "activities", publicName: "activities", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"axp-activity-log ax-accent2\" *translate=\"let t\">\n\n <!-- Activity Log Content -->\n <div class=\"__content\">\n\n <!-- Loading State -->\n @if (loading()) {\n <div class=\"__loading\">\n @for (item of [1,2,3,4]; track $index) {\n <div class=\"__item\">\n <ax-skeleton [animated]=\"true\" class=\"__avatar\"></ax-skeleton>\n <div class=\"__content\">\n <ax-skeleton [animated]=\"true\" class=\"__title\"></ax-skeleton>\n <ax-skeleton [animated]=\"true\" class=\"__subtitle\"></ax-skeleton>\n <ax-skeleton [animated]=\"true\" class=\"__description\"></ax-skeleton>\n <ax-skeleton [animated]=\"true\" class=\"__time\"></ax-skeleton>\n </div>\n </div>\n }\n </div>\n }\n\n <!-- Activity Feed -->\n @if (!loading() && activities().length > 0) {\n <div class=\"__feed\">\n @for (activity of activities(); track activity.id) {\n @let changeClasses = getChangeClasses(activity.changeType);\n @let isItemExpanded = isExpanded(activity.id);\n @let hasExpandableContentItem = hasExpandableContent(activity);\n <div class=\"__item\" [class.__collapsed]=\"!isItemExpanded\" [class.__expandable]=\"hasExpandableContentItem\">\n\n <div\n class=\"ax-size-10 ax-rounded-full ax-border ax-flex ax-items-center ax-justify-center ax-lightest-surface \">\n <i class=\"{{changeClasses.icon}} {{changeClasses.text}} fa-solid\"></i>\n </div>\n\n <!-- Activity Content -->\n <div class=\"__content\">\n <!-- Main Activity Info -->\n <div class=\"__main-info\">\n\n <!-- User and Action with Toggle Button -->\n <div class=\"__action-line __header-line\" (click)=\"toggleExpanded(activity.id)\">\n <span class=\"__user-name\">{{ activity.user.title }}</span>\n <span class=\"__action-type\">\n {{ t(`actions.${activity.changeType}.title`, {\n scope: 'general' }) | async }}\n </span>\n <span class=\"__action-text\">\n {{ activity.title | translate | async }}\n </span>\n\n <!-- Compare Button -->\n @if (canCompare(activity)) {\n <button type=\"button\" class=\"__compare-button\" (click)=\"handleCompare(activity, $event)\"\n [attr.aria-label]=\"t('compare.title', { scope: i18nScope }) | async\">\n <i class=\"fa-solid fa-code-compare\"></i>\n </button>\n }\n\n <!-- Toggle Button (only show if there's expandable content) -->\n @if (hasExpandableContentItem) {\n <button type=\"button\" class=\"__toggle-button\" [attr.aria-expanded]=\"isItemExpanded\"\n [attr.aria-label]=\"isItemExpanded ? 'Collapse details' : 'Expand details'\">\n <i class=\"fa-solid\" [class.fa-chevron-down]=\"!isItemExpanded\"\n [class.fa-chevron-up]=\"isItemExpanded\"></i>\n </button>\n }\n </div>\n\n <!-- Expandable Description/Changes -->\n @if (hasExpandableContentItem && isItemExpanded && activity.changes.length > 0) {\n <div class=\"__action-lines __expandable-content\"\n [class.__animated]=\"shouldAnimate(activity.id)\">\n @for (change of activity.changes; track $index) {\n @let changeClasses = getChangeClasses(change.type);\n <div class=\"__action-line\">\n <div class=\"ax-rounded-full ax-size-7 ax-grid ax-place-items-center\">\n <i class=\"{{changeClasses.icon}} {{changeClasses.text}}\"></i>\n </div>\n <span class=\"__action-text\">{{\n change.description | translate | async }}</span>\n </div>\n }\n </div>\n }\n </div>\n\n <!-- Time -->\n <div class=\"__time\">\n {{ activity.date | format: 'datetime' : 'short' | async }}\n </div>\n\n </div>\n\n </div>\n }\n </div>\n }\n\n <!-- Empty State -->\n @if (!loading() && activities().length === 0) {\n <div class=\"__empty\">\n <div class=\"__icon\">\n <ax-icon icon=\"fa-light fa-history\" class=\"__svg\"></ax-icon>\n </div>\n <div class=\"__content\">\n <h4 class=\"__title\">{{ t('no-history.title', { scope: i18nScope }) | async }}</h4>\n <p class=\"__message\">{{ t('no-history.message', { scope: i18nScope }) | async }}\n </p>\n </div>\n </div>\n }\n\n </div>\n</div>\n\n<!-- \n\nax-success-surface\nax-primary-surface\nax-danger-surface\nax-warning-surface\nax-info-surface\nax-muted-surface\nax-text-success\n\n -->", styles: [".axp-activity-log{height:100%;width:100%}.axp-activity-log .__content .__loading>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.axp-activity-log .__content .__loading .__item{display:flex;align-items:flex-start;gap:1rem}.axp-activity-log .__content .__loading .__item .__avatar{height:3rem;width:3rem;flex-shrink:0;border-radius:9999px}.axp-activity-log .__content .__loading .__item .__content{flex:1 1 0%}.axp-activity-log .__content .__loading .__item .__content>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.axp-activity-log .__content .__loading .__item .__content .__title{height:1rem;width:75%;border-radius:.25rem}.axp-activity-log .__content .__loading .__item .__content .__subtitle{height:.75rem;width:50%;border-radius:.25rem}.axp-activity-log .__content .__loading .__item .__content .__description{height:.75rem;width:83.333333%;border-radius:.25rem}.axp-activity-log .__content .__loading .__item .__content .__time{height:.75rem;width:25%;border-radius:.25rem}.axp-activity-log .__content .__feed{position:relative}.axp-activity-log .__content .__feed>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.axp-activity-log .__content .__feed:before{content:\"\";position:absolute;inset-inline-start:1.25rem;top:.5rem;bottom:.5rem;width:0px;border-left:1px solid rgba(var(--ax-sys-color-border-surface));z-index:0}.axp-activity-log .__content .__feed .__item{position:relative;display:flex;align-items:flex-start;gap:1rem}.axp-activity-log .__content .__feed .__item axp-user-avatar{position:relative;z-index:10}.axp-activity-log .__content .__feed .__item .__content{min-width:0px;flex:1 1 0%}.axp-activity-log .__content .__feed .__item .__content .__main-info{margin-bottom:.25rem}.axp-activity-log .__content .__feed .__item .__content .__main-info .__action-line{margin-top:.25rem;display:flex;flex-wrap:wrap;align-items:center;gap:.25rem;line-height:1.5}.axp-activity-log .__content .__feed .__item .__content .__main-info .__action-line .__user-name{font-weight:600}.axp-activity-log .__content .__feed .__item .__content .__main-info .__action-line .__action-type,.axp-activity-log .__content .__feed .__item .__content .__main-info .__action-line .__action-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.875rem;line-height:1.25rem;opacity:.85}.axp-activity-log .__content .__feed .__item .__content .__main-info .__action-line.__header-line{align-items:center;border-radius:.375rem;padding:.25rem .5rem}.axp-activity-log .__content .__feed .__item .__content .__main-info .__action-line.__header-line:hover{background-color:rgb(var(--ax-sys-color-lighter-surface));color:rgb(var(--ax-sys-color-on-lighter-surface));border-color:rgb(var(--ax-sys-color-border-lighter-surface))}.axp-activity-log .__content .__feed .__item .__content .__main-info .__action-line.__header-line .__compare-button{margin-left:.5rem;border-radius:9999px;padding:.25rem;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s;animation-duration:.2s;display:flex;width:1.5rem;height:1.5rem;align-items:center;justify-content:center;--tw-text-opacity: 1;color:rgba(var(--ax-sys-color-primary-500),var(--tw-text-opacity, 1))}.axp-activity-log .__content .__feed .__item .__content .__main-info .__action-line.__header-line .__compare-button:hover{background-color:rgb(var(--ax-sys-color-primary-surface));color:rgb(var(--ax-sys-color-on-primary-surface));border-color:rgb(var(--ax-sys-color-border-primary-surface))}.axp-activity-log .__content .__feed .__item .__content .__main-info .__action-line.__header-line .__compare-button:focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-opacity: 1;--tw-ring-color: rgba(var(--ax-sys-color-primary-500), var(--tw-ring-opacity, 1));--tw-ring-offset-width: 1px}.axp-activity-log .__content .__feed .__item .__content .__main-info .__action-line.__header-line .__compare-button i{font-size:.75rem;line-height:1rem}.axp-activity-log .__content .__feed .__item .__content .__main-info .__action-line.__header-line .__toggle-button{margin-left:auto;border-radius:9999px;padding:.25rem;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s;animation-duration:.2s;display:flex;width:1.5rem;height:1.5rem;align-items:center;justify-content:center}.axp-activity-log .__content .__feed .__item .__content .__main-info .__action-line.__header-line .__toggle-button:focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-opacity: 1;--tw-ring-color: rgba(var(--ax-sys-color-primary-500), var(--tw-ring-opacity, 1));--tw-ring-offset-width: 1px}.axp-activity-log .__content .__feed .__item .__content .__main-info .__action-line.__header-line .__toggle-button i{font-size:.75rem;line-height:1rem;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s;animation-duration:.2s}.axp-activity-log .__content .__feed .__item .__content .__main-info .__action-lines{margin-top:.5rem;margin-bottom:.5rem;display:flex;flex-direction:column;font-size:.875rem;line-height:1.25rem}.axp-activity-log .__content .__feed .__item .__content .__main-info .__action-lines.__expandable-content{overflow:hidden}.axp-activity-log .__content .__feed .__item .__content .__main-info .__action-lines.__expandable-content.__animated{transition-property:all;transition-duration:.3s;transition-timing-function:cubic-bezier(.4,0,.2,1);animation-duration:.3s;animation-timing-function:cubic-bezier(.4,0,.2,1);animation:slideDown .3s ease-out}.axp-activity-log .__content .__feed .__item .__content .__main-info .__action-lines .__action-line{display:flex;align-items:center;gap:.5rem;padding-top:.25rem;padding-bottom:.25rem}.axp-activity-log .__content .__feed .__item .__content .__main-info .__action-lines .__action-line .__action-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.875rem;line-height:1.25rem;opacity:.85}.axp-activity-log .__content .__feed .__item .__content .__time{padding-left:.5rem;padding-right:.5rem;font-size:.75rem;line-height:1rem;opacity:.75}.axp-activity-log .__content .__feed .__item.__collapsed .__expandable-content{display:none}.axp-activity-log .__content .__feed .__item.__expandable .__header-line{cursor:pointer}.axp-activity-log .__content .__empty{display:flex;height:12rem;flex-direction:column;align-items:center;justify-content:center;padding:2rem;text-align:center}.axp-activity-log .__content .__empty .__icon{margin-bottom:1rem}.axp-activity-log .__content .__empty .__icon .__svg{font-size:2.25rem;line-height:2.5rem;--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.axp-activity-log .__content .__empty .__content .__title{margin-bottom:.5rem;font-size:1.125rem;line-height:1.75rem;font-weight:600;--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.axp-activity-log .__content .__empty .__content .__message{max-width:20rem;line-height:1.625;--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}@media (min-width: 640px){.axp-activity-log .__content .__feed .__item{gap:.625rem}.axp-activity-log .__content .__feed .__item .__content .__main-info .__action-line{flex-wrap:nowrap}}@keyframes slideDown{0%{opacity:0;max-height:0;transform:translateY(-10px)}to{opacity:1;max-height:200px;transform:translateY(0)}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "ngmodule", type: AXCommonModule }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "directive", type: i2.AXTranslatorDirective, selector: "[translate]" }, { kind: "ngmodule", type: AXSkeletonModule }, { kind: "component", type: i3$1.AXSkeletonComponent, selector: "ax-skeleton", inputs: ["animated"] }, { kind: "ngmodule", type: AXFormatModule }, { kind: "ngmodule", type: AXTagModule }, { kind: "ngmodule", type: AXAccordionCdkModule }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.AXTranslatorPipe, name: "translate" }, { kind: "pipe", type: i5.AXFormatPipe, name: "format" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
200
183
|
}
|
|
201
184
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPActivityLogComponent, decorators: [{
|
|
202
185
|
type: Component,
|
|
@@ -701,42 +684,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
701
684
|
}]
|
|
702
685
|
}] });
|
|
703
686
|
|
|
704
|
-
class AXPQueryColumnsComponent {
|
|
705
|
-
constructor() {
|
|
706
|
-
this.columns = model([], ...(ngDevMode ? [{ debugName: "columns" }] : []));
|
|
707
|
-
}
|
|
708
|
-
handleVisibilityChange(e, name) {
|
|
709
|
-
if (e.isUserInteraction) {
|
|
710
|
-
this.columns.update((prev) => {
|
|
711
|
-
return prev.map((c) => {
|
|
712
|
-
return c.name === name ? { ...c, visible: e.value ?? true } : c;
|
|
713
|
-
});
|
|
714
|
-
});
|
|
715
|
-
}
|
|
716
|
-
}
|
|
717
|
-
drop(event) {
|
|
718
|
-
const columns = cloneDeep(this.columns());
|
|
719
|
-
moveItemInArray(columns, event.previousIndex, event.currentIndex);
|
|
720
|
-
this.columns.set(columns);
|
|
721
|
-
}
|
|
722
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPQueryColumnsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
723
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: AXPQueryColumnsComponent, isStandalone: true, selector: "axp-query-columns", inputs: { columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { columns: "columnsChange" }, ngImport: i0, template: "<div class=\"ax-flex ax-flex-col ax-gap-4 ax-select-none\" cdkDropList (cdkDropListDropped)=\"drop($event)\">\n <div class=\"ax-flex ax-flex-col ax-gap-3 ax-w-full ax-sorted-list ax-max-h-[calc(100vh-280px)] ax-overflow-auto\">\n @for (item of columns(); track item.name) {\n <div class=\"ax-flex ax-py-1 ax-items-center ax-justify-between\" cdkDrag cdkDragBoundary=\".ax-sorted-list\">\n <div class=\"ax-flex ax-items-center ax-gap-3\" cdkDragHandle>\n <ax-icon class=\"fa-solid fa-grip-dots-vertical ax-cursor-move\"></ax-icon>\n <p class=\"ax-font-medium ax-text-sm\">{{ item.title | translate | async }}</p>\n </div>\n <ax-switch\n class=\"ax-sm\"\n [ngModel]=\"item.visible\"\n (onValueChanged)=\"handleVisibilityChange($event, item.name)\"\n ></ax-switch>\n </div>\n }\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "ngmodule", type: AXButtonModule }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i7.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "ngmodule", type: AXSwitchModule }, { kind: "component", type: i3$1.AXSwitchComponent, selector: "ax-switch", inputs: ["disabled", "readonly", "color", "tabIndex", "value", "name", "isLoading"], outputs: ["onBlur", "onFocus", "valueChange", "onValueChanged", "readonlyChange", "disabledChange"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "pipe", type: i5.AXTranslatorPipe, name: "translate" }] }); }
|
|
724
|
-
}
|
|
725
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPQueryColumnsComponent, decorators: [{
|
|
726
|
-
type: Component,
|
|
727
|
-
args: [{ selector: 'axp-query-columns', imports: [
|
|
728
|
-
CommonModule,
|
|
729
|
-
FormsModule,
|
|
730
|
-
CdkDropList,
|
|
731
|
-
CdkDrag,
|
|
732
|
-
CdkDragHandle,
|
|
733
|
-
AXButtonModule,
|
|
734
|
-
AXDecoratorModule,
|
|
735
|
-
AXSwitchModule,
|
|
736
|
-
AXTranslationModule,
|
|
737
|
-
], template: "<div class=\"ax-flex ax-flex-col ax-gap-4 ax-select-none\" cdkDropList (cdkDropListDropped)=\"drop($event)\">\n <div class=\"ax-flex ax-flex-col ax-gap-3 ax-w-full ax-sorted-list ax-max-h-[calc(100vh-280px)] ax-overflow-auto\">\n @for (item of columns(); track item.name) {\n <div class=\"ax-flex ax-py-1 ax-items-center ax-justify-between\" cdkDrag cdkDragBoundary=\".ax-sorted-list\">\n <div class=\"ax-flex ax-items-center ax-gap-3\" cdkDragHandle>\n <ax-icon class=\"fa-solid fa-grip-dots-vertical ax-cursor-move\"></ax-icon>\n <p class=\"ax-font-medium ax-text-sm\">{{ item.title | translate | async }}</p>\n </div>\n <ax-switch\n class=\"ax-sm\"\n [ngModel]=\"item.visible\"\n (onValueChanged)=\"handleVisibilityChange($event, item.name)\"\n ></ax-switch>\n </div>\n }\n </div>\n</div>\n" }]
|
|
738
|
-
}] });
|
|
739
|
-
|
|
740
687
|
class AXPCompareViewComponent {
|
|
741
688
|
constructor() {
|
|
742
689
|
//#region ---- Component Properties ----
|
|
@@ -851,13 +798,13 @@ class AXPCompareViewComponent {
|
|
|
851
798
|
ngOnDestroy() {
|
|
852
799
|
}
|
|
853
800
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPCompareViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
854
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: AXPCompareViewComponent, isStandalone: true, selector: "axp-compare-view", inputs: { inputs: { classPropertyName: "inputs", publicName: "inputs", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null } }, providers: [], ngImport: i0, template: "<!--\n #region ---- Compare View Table Layout ----\n-->\n<div class=\"axp-compare-view\">\n <div class=\"__table-container\">\n <table class=\"__table\">\n <thead class=\"__thead\">\n <tr class=\"__header-row\">\n <th class=\"__field-header\">\n <ax-check-box\n [value]=\"showOnlyChanges()\"\n (valueChange)=\"toggleShowOnlyChanges()\"\n class=\"__show-changes-toggle\"\n >\n <ax-label>\n {{ '@activity-log:compare-view.show-only-differences' | translate | async }}\n </ax-label>\n </ax-check-box>\n </th>\n @for (obj of remainingObjects(); track obj.id) {\n <th class=\"__object-header\" [attr.data-id]=\"obj.id\">\n <div class=\"__object-title\" [title]=\"obj.description\">\n <span>{{ obj.title | translate | async }}</span>\n @if (remainingObjects().length > 2) {\n <span class=\"__remove-object-button\" (click)=\"removeObject(obj.id)\">\n <i class=\"fa-light fa-times\"></i>\n </span>\n }\n </div>\n </th>\n }\n </tr>\n </thead>\n <tbody class=\"__tbody\">\n @for (field of filteredFields(); track field.path; let i = $index) {\n <tr\n class=\"__row\"\n [class.__row--odd]=\"i % 2 === 1\"\n [class.__row--has-differences]=\"hasUnequalValues(field.path)\"\n [class.__row--has-equal-values]=\"hasEqualValues(field.path)\"\n >\n <td class=\"__field-cell\">\n <div class=\"__field-content\">\n <div class=\"__field-title\">\n {{ field.title | translate | async }}\n </div>\n @if (field.description) {\n <div class=\"__field-description\">{{ field.description }}</div>\n }\n </div>\n </td>\n @for (obj of remainingObjects(); track obj.id; let objIndex = $index) {\n <td\n class=\"__object-cell\"\n [attr.data-id]=\"obj.id\"\n [class.__cell--changed]=\"hasValueChangedFromPrevious(field.path, objIndex) && isChangesMode()\"\n >\n @if (obj.context[field.path] !== undefined) {\n <div class=\"__object-content\">\n <axp-widgets-container [context]=\"obj.context\">\n <ng-container axp-widget-renderer [node]=\"field.widget\" [mode]=\"'view'\"></ng-container>\n </axp-widgets-container>\n </div>\n } @else {\n <div class=\"__object-placeholder\">---</div>\n }\n @if (hasValueChangingToNext(field.path, objIndex) && isChangesMode()) {\n <div class=\"__change-indicator\">\n <i class=\"fa-light fa-arrow-right\"></i>\n </div>\n }\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n</div>\n<!--\n #endregion\n-->\n", styles: [".axp-compare-view{display:flex;height:100%;width:100%;flex-direction:column;border-radius:.375rem;border-width:1px;--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);background-color:rgb(var(--ax-sys-color-lightest-surface));color:rgb(var(--ax-sys-color-on-lightest-surface));border-color:rgb(var(--ax-sys-color-border-lightest-surface));position:relative}.axp-compare-view .__filter-controls{flex-shrink:0;border-bottom-width:1px;padding:1rem;background-color:rgb(var(--ax-sys-color-light-surface));color:rgb(var(--ax-sys-color-on-light-surface));border-color:rgb(var(--ax-sys-color-border-light-surface))}.axp-compare-view .__filter-controls .__show-changes-toggle{font-size:.875rem;line-height:1.25rem}.axp-compare-view .__table-container{flex:1 1 0%;overflow:auto;position:relative}.axp-compare-view .__table{width:100%;border-collapse:separate;border-spacing:0;table-layout:fixed}.axp-compare-view .__table .__thead{position:-webkit-sticky;position:sticky;top:0;z-index:20}.axp-compare-view .__table .__thead .__header-row .__field-header{width:14rem;border-bottom-width:1px;border-right-width:1px;padding:.75rem 1rem;text-align:left;font-weight:700;background-color:rgb(var(--ax-sys-color-lighter-surface));color:rgb(var(--ax-sys-color-on-lighter-surface));border-color:rgb(var(--ax-sys-color-border-lighter-surface));position:-webkit-sticky;position:sticky;left:0;z-index:25}.axp-compare-view .__table .__thead .__header-row .__object-header{position:relative;border-bottom-width:1px;padding:.75rem 1rem;text-align:center;background-color:rgb(var(--ax-sys-color-lighter-surface));color:rgb(var(--ax-sys-color-on-lighter-surface));border-color:rgb(var(--ax-sys-color-border-lighter-surface));min-width:250px;width:250px}.axp-compare-view .__table .__thead .__header-row .__object-header .__object-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.875rem;line-height:1.25rem;font-weight:600}.axp-compare-view .__table .__thead .__header-row .__object-header .__object-description{margin-top:.25rem;font-size:.75rem;line-height:1rem;opacity:.75}.axp-compare-view .__table .__thead .__header-row .__object-header .__remove-object-button{display:flex;width:1.5rem;height:1.5rem;cursor:pointer;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-light-surface),var(--tw-bg-opacity, 1));font-size:.875rem;line-height:1.25rem;position:absolute;top:50%;inset-inline-end:0px;--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.axp-compare-view .__table .__thead .__header-row .__object-header .__remove-object-button:hover{--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-danger-100),var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgba(var(--ax-sys-color-danger-600),var(--tw-text-opacity, 1))}.axp-compare-view .__table .__tbody .__row{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s;animation-duration:.2s}.axp-compare-view .__table .__tbody .__row.__row--odd{background-color:rgb(var(--ax-sys-color-lightest-surface));color:rgb(var(--ax-sys-color-on-lightest-surface));border-color:rgb(var(--ax-sys-color-border-lightest-surface))}.axp-compare-view .__table .__tbody .__row.__row--has-differences{border-left-width:4px;--tw-border-opacity: 1;border-left-color:rgba(var(--ax-sys-color-warning-500),var(--tw-border-opacity, 1))}.axp-compare-view .__table .__tbody .__row.__row--has-differences .__field-cell{background-color:rgba(var(--ax-sys-color-warning-500),var(--tw-bg-opacity, 1));--tw-bg-opacity: .05}.axp-compare-view .__table .__tbody .__row.__row--has-equal-values{border-left-width:4px;--tw-border-opacity: 1;border-left-color:rgba(var(--ax-sys-color-success-500),var(--tw-border-opacity, 1))}.axp-compare-view .__table .__tbody .__row.__row--has-equal-values .__field-cell{background-color:rgba(var(--ax-sys-color-success-500),var(--tw-bg-opacity, 1));--tw-bg-opacity: .05}.axp-compare-view .__table .__tbody .__row .__field-cell{width:14rem;border-bottom-width:1px;border-right-width:1px;padding:.75rem 1rem;vertical-align:top;background-color:rgb(var(--ax-sys-color-lightest-surface));color:rgb(var(--ax-sys-color-on-lightest-surface));border-color:rgb(var(--ax-sys-color-border-lightest-surface));position:-webkit-sticky;position:sticky;left:0;z-index:15}.axp-compare-view .__table .__tbody .__row .__field-cell .__field-content{display:flex;flex-direction:column;gap:.25rem}.axp-compare-view .__table .__tbody .__row .__field-cell .__field-content .__field-title{font-weight:500}.axp-compare-view .__table .__tbody .__row .__field-cell .__field-content .__field-description{font-size:.75rem;line-height:1rem;opacity:.75}.axp-compare-view .__table .__tbody .__row .__object-cell{border-bottom-width:1px;padding:.75rem 1rem;text-align:center;vertical-align:middle;position:relative}.axp-compare-view .__table .__tbody .__row .__object-cell.__cell--changed .__object-content{border-width:1px;border-style:dashed;--tw-border-opacity: 1;border-color:rgba(var(--ax-sys-color-warning-200),var(--tw-border-opacity, 1));padding:.5rem}.axp-compare-view .__table .__tbody .__row .__object-cell .__object-content{position:relative;display:flex;align-items:center;justify-content:center}.axp-compare-view .__table .__tbody .__row .__object-cell .__change-indicator{position:absolute;inset-inline-end:-.25rem;top:50%;--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));line-height:1rem;--tw-text-opacity: 1;color:rgba(var(--ax-sys-color-warning-500),var(--tw-text-opacity, 1));font-size:.875rem}.axp-compare-view .__table .__tbody .__row .__object-cell .__object-placeholder{opacity:.75}.axp-compare-view .__table .__tbody .__row.__row--has-differences .__field-cell{border-inline-start-width:4px;--tw-border-opacity: 1;border-inline-start-color:rgba(var(--ax-sys-color-warning-500),var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-warning-50),var(--tw-bg-opacity, 1))}.axp-compare-view .__table .__tbody .__row.__row--has-differences .__field-cell:is(.ax-dark *){--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-warning-900),var(--tw-bg-opacity, 1))}.axp-compare-view .__table .__tbody .__row.__row--has-equal-values .__field-cell{border-inline-start-width:4px;--tw-border-opacity: 1;border-inline-start-color:rgba(var(--ax-sys-color-success-500),var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-success-50),var(--tw-bg-opacity, 1))}.axp-compare-view .__table .__tbody .__row.__row--has-equal-values .__field-cell:is(.ax-dark *){--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-success-900),var(--tw-bg-opacity, 1))}\n"], dependencies: [{ kind: "ngmodule", type:
|
|
801
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: AXPCompareViewComponent, isStandalone: true, selector: "axp-compare-view", inputs: { inputs: { classPropertyName: "inputs", publicName: "inputs", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null } }, providers: [], ngImport: i0, template: "<!--\n #region ---- Compare View Table Layout ----\n-->\n<div class=\"axp-compare-view\">\n <div class=\"__table-container\">\n <table class=\"__table\">\n <thead class=\"__thead\">\n <tr class=\"__header-row\">\n <th class=\"__field-header\">\n <ax-check-box [value]=\"showOnlyChanges()\" (valueChange)=\"toggleShowOnlyChanges()\"\n class=\"__show-changes-toggle\">\n <ax-label>\n {{ 'compare-view.show-only-differences' | translate: { scope: 'common' } | async }}\n </ax-label>\n </ax-check-box>\n </th>\n @for (obj of remainingObjects(); track obj.id) {\n <th class=\"__object-header\" [attr.data-id]=\"obj.id\">\n <div class=\"__object-title\" [title]=\"obj.description\">\n <span>{{ obj.title | translate | async }}</span>\n @if (remainingObjects().length > 2) {\n <span class=\"__remove-object-button\" (click)=\"removeObject(obj.id)\">\n <i class=\"fa-light fa-times\"></i>\n </span>\n }\n </div>\n </th>\n }\n </tr>\n </thead>\n <tbody class=\"__tbody\">\n @for (field of filteredFields(); track field.path; let i = $index) {\n <tr class=\"__row\" [class.__row--odd]=\"i % 2 === 1\" [class.__row--has-differences]=\"hasUnequalValues(field.path)\"\n [class.__row--has-equal-values]=\"hasEqualValues(field.path)\">\n <td class=\"__field-cell\">\n <div class=\"__field-content\">\n <div class=\"__field-title\">\n {{ field.title | translate | async }}\n </div>\n @if (field.description) {\n <div class=\"__field-description\">{{ field.description }}</div>\n }\n </div>\n </td>\n @for (obj of remainingObjects(); track obj.id; let objIndex = $index) {\n <td class=\"__object-cell\" [attr.data-id]=\"obj.id\"\n [class.__cell--changed]=\"hasValueChangedFromPrevious(field.path, objIndex) && isChangesMode()\">\n @if (obj.context[field.path] !== undefined) {\n <div class=\"__object-content\">\n <axp-widgets-container [context]=\"obj.context\">\n <ng-container axp-widget-renderer [node]=\"field.widget\" [mode]=\"'view'\"></ng-container>\n </axp-widgets-container>\n </div>\n } @else {\n <div class=\"__object-placeholder\">---</div>\n }\n @if (hasValueChangingToNext(field.path, objIndex) && isChangesMode()) {\n <div class=\"__change-indicator\">\n <i class=\"fa-light fa-arrow-right\"></i>\n </div>\n }\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n</div>\n<!--\n #endregion\n-->", styles: [".axp-compare-view{display:flex;height:100%;width:100%;flex-direction:column;border-radius:.375rem;border-width:1px;--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);background-color:rgb(var(--ax-sys-color-lightest-surface));color:rgb(var(--ax-sys-color-on-lightest-surface));border-color:rgb(var(--ax-sys-color-border-lightest-surface));position:relative}.axp-compare-view .__filter-controls{flex-shrink:0;border-bottom-width:1px;padding:1rem;background-color:rgb(var(--ax-sys-color-light-surface));color:rgb(var(--ax-sys-color-on-light-surface));border-color:rgb(var(--ax-sys-color-border-light-surface))}.axp-compare-view .__filter-controls .__show-changes-toggle{font-size:.875rem;line-height:1.25rem}.axp-compare-view .__table-container{flex:1 1 0%;overflow:auto;position:relative}.axp-compare-view .__table{width:100%;border-collapse:separate;border-spacing:0;table-layout:fixed}.axp-compare-view .__table .__thead{position:-webkit-sticky;position:sticky;top:0;z-index:20}.axp-compare-view .__table .__thead .__header-row .__field-header{width:14rem;border-bottom-width:1px;border-right-width:1px;padding:.75rem 1rem;text-align:left;font-weight:700;background-color:rgb(var(--ax-sys-color-lighter-surface));color:rgb(var(--ax-sys-color-on-lighter-surface));border-color:rgb(var(--ax-sys-color-border-lighter-surface));position:-webkit-sticky;position:sticky;left:0;z-index:25}.axp-compare-view .__table .__thead .__header-row .__object-header{position:relative;border-bottom-width:1px;padding:.75rem 1rem;text-align:center;background-color:rgb(var(--ax-sys-color-lighter-surface));color:rgb(var(--ax-sys-color-on-lighter-surface));border-color:rgb(var(--ax-sys-color-border-lighter-surface));min-width:250px;width:250px}.axp-compare-view .__table .__thead .__header-row .__object-header .__object-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.875rem;line-height:1.25rem;font-weight:600}.axp-compare-view .__table .__thead .__header-row .__object-header .__object-description{margin-top:.25rem;font-size:.75rem;line-height:1rem;opacity:.75}.axp-compare-view .__table .__thead .__header-row .__object-header .__remove-object-button{display:flex;width:1.5rem;height:1.5rem;cursor:pointer;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-light-surface),var(--tw-bg-opacity, 1));font-size:.875rem;line-height:1.25rem;position:absolute;top:50%;inset-inline-end:0px;--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.axp-compare-view .__table .__thead .__header-row .__object-header .__remove-object-button:hover{--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-danger-100),var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgba(var(--ax-sys-color-danger-600),var(--tw-text-opacity, 1))}.axp-compare-view .__table .__tbody .__row{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s;animation-duration:.2s}.axp-compare-view .__table .__tbody .__row.__row--odd{background-color:rgb(var(--ax-sys-color-lightest-surface));color:rgb(var(--ax-sys-color-on-lightest-surface));border-color:rgb(var(--ax-sys-color-border-lightest-surface))}.axp-compare-view .__table .__tbody .__row.__row--has-differences{border-left-width:4px;--tw-border-opacity: 1;border-left-color:rgba(var(--ax-sys-color-warning-500),var(--tw-border-opacity, 1))}.axp-compare-view .__table .__tbody .__row.__row--has-differences .__field-cell{background-color:rgba(var(--ax-sys-color-warning-500),var(--tw-bg-opacity, 1));--tw-bg-opacity: .05}.axp-compare-view .__table .__tbody .__row.__row--has-equal-values{border-left-width:4px;--tw-border-opacity: 1;border-left-color:rgba(var(--ax-sys-color-success-500),var(--tw-border-opacity, 1))}.axp-compare-view .__table .__tbody .__row.__row--has-equal-values .__field-cell{background-color:rgba(var(--ax-sys-color-success-500),var(--tw-bg-opacity, 1));--tw-bg-opacity: .05}.axp-compare-view .__table .__tbody .__row .__field-cell{width:14rem;border-bottom-width:1px;border-right-width:1px;padding:.75rem 1rem;vertical-align:top;background-color:rgb(var(--ax-sys-color-lightest-surface));color:rgb(var(--ax-sys-color-on-lightest-surface));border-color:rgb(var(--ax-sys-color-border-lightest-surface));position:-webkit-sticky;position:sticky;left:0;z-index:15}.axp-compare-view .__table .__tbody .__row .__field-cell .__field-content{display:flex;flex-direction:column;gap:.25rem}.axp-compare-view .__table .__tbody .__row .__field-cell .__field-content .__field-title{font-weight:500}.axp-compare-view .__table .__tbody .__row .__field-cell .__field-content .__field-description{font-size:.75rem;line-height:1rem;opacity:.75}.axp-compare-view .__table .__tbody .__row .__object-cell{border-bottom-width:1px;padding:.75rem 1rem;text-align:center;vertical-align:middle;position:relative}.axp-compare-view .__table .__tbody .__row .__object-cell.__cell--changed .__object-content{border-width:1px;border-style:dashed;--tw-border-opacity: 1;border-color:rgba(var(--ax-sys-color-warning-200),var(--tw-border-opacity, 1));padding:.5rem}.axp-compare-view .__table .__tbody .__row .__object-cell .__object-content{position:relative;display:flex;align-items:center;justify-content:center}.axp-compare-view .__table .__tbody .__row .__object-cell .__change-indicator{position:absolute;inset-inline-end:-.25rem;top:50%;--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));line-height:1rem;--tw-text-opacity: 1;color:rgba(var(--ax-sys-color-warning-500),var(--tw-text-opacity, 1));font-size:.875rem}.axp-compare-view .__table .__tbody .__row .__object-cell .__object-placeholder{opacity:.75}.axp-compare-view .__table .__tbody .__row.__row--has-differences .__field-cell{border-inline-start-width:4px;--tw-border-opacity: 1;border-inline-start-color:rgba(var(--ax-sys-color-warning-500),var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-warning-50),var(--tw-bg-opacity, 1))}.axp-compare-view .__table .__tbody .__row.__row--has-differences .__field-cell:is(.ax-dark *){--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-warning-900),var(--tw-bg-opacity, 1))}.axp-compare-view .__table .__tbody .__row.__row--has-equal-values .__field-cell{border-inline-start-width:4px;--tw-border-opacity: 1;border-inline-start-color:rgba(var(--ax-sys-color-success-500),var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-success-50),var(--tw-bg-opacity, 1))}.axp-compare-view .__table .__tbody .__row.__row--has-equal-values .__field-cell:is(.ax-dark *){--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-success-900),var(--tw-bg-opacity, 1))}\n"], dependencies: [{ kind: "ngmodule", type:
|
|
855
802
|
// Angular
|
|
856
803
|
CommonModule }, { kind: "ngmodule", type:
|
|
857
804
|
// ACoreX
|
|
858
|
-
AXFormModule }, { kind: "ngmodule", type: AXTextBoxModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "ngmodule", type: AXLabelModule }, { kind: "component", type:
|
|
805
|
+
AXFormModule }, { kind: "ngmodule", type: AXTextBoxModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "ngmodule", type: AXLabelModule }, { kind: "component", type: i1.AXLabelComponent, selector: "ax-label", inputs: ["required", "for"], outputs: ["requiredChange"] }, { kind: "ngmodule", type: AXCheckBoxModule }, { kind: "component", type: i2$1.AXCheckBoxComponent, selector: "ax-check-box", inputs: ["disabled", "tabIndex", "readonly", "color", "value", "name", "id", "checked", "isLoading", "indeterminate"], outputs: ["onBlur", "onFocus", "valueChange", "onValueChanged"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "ngmodule", type:
|
|
859
806
|
// Platform
|
|
860
|
-
AXPLayoutBuilderModule }, { kind: "component", type: i3$
|
|
807
|
+
AXPLayoutBuilderModule }, { kind: "component", type: i3$2.AXPWidgetContainerComponent, selector: "axp-widgets-container", inputs: ["context", "functions"], outputs: ["onContextChanged"] }, { kind: "directive", type: i3$2.AXPWidgetRendererDirective, selector: "[axp-widget-renderer]", inputs: ["parentNode", "index", "mode", "node"], outputs: ["onOptionsChanged", "onValueChanged"], exportAs: ["widgetRenderer"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.AXTranslatorPipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
861
808
|
}
|
|
862
809
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPCompareViewComponent, decorators: [{
|
|
863
810
|
type: Component,
|
|
@@ -873,7 +820,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
873
820
|
AXTranslationModule,
|
|
874
821
|
// Platform
|
|
875
822
|
AXPLayoutBuilderModule
|
|
876
|
-
], encapsulation: ViewEncapsulation.None, providers: [], template: "<!--\n #region ---- Compare View Table Layout ----\n-->\n<div class=\"axp-compare-view\">\n <div class=\"__table-container\">\n <table class=\"__table\">\n <thead class=\"__thead\">\n <tr class=\"__header-row\">\n <th class=\"__field-header\">\n <ax-check-box\n [value]=\"showOnlyChanges()\"\n (valueChange)=\"toggleShowOnlyChanges()\"\n class=\"__show-changes-toggle\"\n >\n <ax-label>\n {{ '@activity-log:compare-view.show-only-differences' | translate | async }}\n </ax-label>\n </ax-check-box>\n </th>\n @for (obj of remainingObjects(); track obj.id) {\n <th class=\"__object-header\" [attr.data-id]=\"obj.id\">\n <div class=\"__object-title\" [title]=\"obj.description\">\n <span>{{ obj.title | translate | async }}</span>\n @if (remainingObjects().length > 2) {\n <span class=\"__remove-object-button\" (click)=\"removeObject(obj.id)\">\n <i class=\"fa-light fa-times\"></i>\n </span>\n }\n </div>\n </th>\n }\n </tr>\n </thead>\n <tbody class=\"__tbody\">\n @for (field of filteredFields(); track field.path; let i = $index) {\n <tr\n class=\"__row\"\n [class.__row--odd]=\"i % 2 === 1\"\n [class.__row--has-differences]=\"hasUnequalValues(field.path)\"\n [class.__row--has-equal-values]=\"hasEqualValues(field.path)\"\n >\n <td class=\"__field-cell\">\n <div class=\"__field-content\">\n <div class=\"__field-title\">\n {{ field.title | translate | async }}\n </div>\n @if (field.description) {\n <div class=\"__field-description\">{{ field.description }}</div>\n }\n </div>\n </td>\n @for (obj of remainingObjects(); track obj.id; let objIndex = $index) {\n <td\n class=\"__object-cell\"\n [attr.data-id]=\"obj.id\"\n [class.__cell--changed]=\"hasValueChangedFromPrevious(field.path, objIndex) && isChangesMode()\"\n >\n @if (obj.context[field.path] !== undefined) {\n <div class=\"__object-content\">\n <axp-widgets-container [context]=\"obj.context\">\n <ng-container axp-widget-renderer [node]=\"field.widget\" [mode]=\"'view'\"></ng-container>\n </axp-widgets-container>\n </div>\n } @else {\n <div class=\"__object-placeholder\">---</div>\n }\n @if (hasValueChangingToNext(field.path, objIndex) && isChangesMode()) {\n <div class=\"__change-indicator\">\n <i class=\"fa-light fa-arrow-right\"></i>\n </div>\n }\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n</div>\n<!--\n #endregion\n-->\n", styles: [".axp-compare-view{display:flex;height:100%;width:100%;flex-direction:column;border-radius:.375rem;border-width:1px;--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);background-color:rgb(var(--ax-sys-color-lightest-surface));color:rgb(var(--ax-sys-color-on-lightest-surface));border-color:rgb(var(--ax-sys-color-border-lightest-surface));position:relative}.axp-compare-view .__filter-controls{flex-shrink:0;border-bottom-width:1px;padding:1rem;background-color:rgb(var(--ax-sys-color-light-surface));color:rgb(var(--ax-sys-color-on-light-surface));border-color:rgb(var(--ax-sys-color-border-light-surface))}.axp-compare-view .__filter-controls .__show-changes-toggle{font-size:.875rem;line-height:1.25rem}.axp-compare-view .__table-container{flex:1 1 0%;overflow:auto;position:relative}.axp-compare-view .__table{width:100%;border-collapse:separate;border-spacing:0;table-layout:fixed}.axp-compare-view .__table .__thead{position:-webkit-sticky;position:sticky;top:0;z-index:20}.axp-compare-view .__table .__thead .__header-row .__field-header{width:14rem;border-bottom-width:1px;border-right-width:1px;padding:.75rem 1rem;text-align:left;font-weight:700;background-color:rgb(var(--ax-sys-color-lighter-surface));color:rgb(var(--ax-sys-color-on-lighter-surface));border-color:rgb(var(--ax-sys-color-border-lighter-surface));position:-webkit-sticky;position:sticky;left:0;z-index:25}.axp-compare-view .__table .__thead .__header-row .__object-header{position:relative;border-bottom-width:1px;padding:.75rem 1rem;text-align:center;background-color:rgb(var(--ax-sys-color-lighter-surface));color:rgb(var(--ax-sys-color-on-lighter-surface));border-color:rgb(var(--ax-sys-color-border-lighter-surface));min-width:250px;width:250px}.axp-compare-view .__table .__thead .__header-row .__object-header .__object-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.875rem;line-height:1.25rem;font-weight:600}.axp-compare-view .__table .__thead .__header-row .__object-header .__object-description{margin-top:.25rem;font-size:.75rem;line-height:1rem;opacity:.75}.axp-compare-view .__table .__thead .__header-row .__object-header .__remove-object-button{display:flex;width:1.5rem;height:1.5rem;cursor:pointer;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-light-surface),var(--tw-bg-opacity, 1));font-size:.875rem;line-height:1.25rem;position:absolute;top:50%;inset-inline-end:0px;--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.axp-compare-view .__table .__thead .__header-row .__object-header .__remove-object-button:hover{--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-danger-100),var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgba(var(--ax-sys-color-danger-600),var(--tw-text-opacity, 1))}.axp-compare-view .__table .__tbody .__row{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s;animation-duration:.2s}.axp-compare-view .__table .__tbody .__row.__row--odd{background-color:rgb(var(--ax-sys-color-lightest-surface));color:rgb(var(--ax-sys-color-on-lightest-surface));border-color:rgb(var(--ax-sys-color-border-lightest-surface))}.axp-compare-view .__table .__tbody .__row.__row--has-differences{border-left-width:4px;--tw-border-opacity: 1;border-left-color:rgba(var(--ax-sys-color-warning-500),var(--tw-border-opacity, 1))}.axp-compare-view .__table .__tbody .__row.__row--has-differences .__field-cell{background-color:rgba(var(--ax-sys-color-warning-500),var(--tw-bg-opacity, 1));--tw-bg-opacity: .05}.axp-compare-view .__table .__tbody .__row.__row--has-equal-values{border-left-width:4px;--tw-border-opacity: 1;border-left-color:rgba(var(--ax-sys-color-success-500),var(--tw-border-opacity, 1))}.axp-compare-view .__table .__tbody .__row.__row--has-equal-values .__field-cell{background-color:rgba(var(--ax-sys-color-success-500),var(--tw-bg-opacity, 1));--tw-bg-opacity: .05}.axp-compare-view .__table .__tbody .__row .__field-cell{width:14rem;border-bottom-width:1px;border-right-width:1px;padding:.75rem 1rem;vertical-align:top;background-color:rgb(var(--ax-sys-color-lightest-surface));color:rgb(var(--ax-sys-color-on-lightest-surface));border-color:rgb(var(--ax-sys-color-border-lightest-surface));position:-webkit-sticky;position:sticky;left:0;z-index:15}.axp-compare-view .__table .__tbody .__row .__field-cell .__field-content{display:flex;flex-direction:column;gap:.25rem}.axp-compare-view .__table .__tbody .__row .__field-cell .__field-content .__field-title{font-weight:500}.axp-compare-view .__table .__tbody .__row .__field-cell .__field-content .__field-description{font-size:.75rem;line-height:1rem;opacity:.75}.axp-compare-view .__table .__tbody .__row .__object-cell{border-bottom-width:1px;padding:.75rem 1rem;text-align:center;vertical-align:middle;position:relative}.axp-compare-view .__table .__tbody .__row .__object-cell.__cell--changed .__object-content{border-width:1px;border-style:dashed;--tw-border-opacity: 1;border-color:rgba(var(--ax-sys-color-warning-200),var(--tw-border-opacity, 1));padding:.5rem}.axp-compare-view .__table .__tbody .__row .__object-cell .__object-content{position:relative;display:flex;align-items:center;justify-content:center}.axp-compare-view .__table .__tbody .__row .__object-cell .__change-indicator{position:absolute;inset-inline-end:-.25rem;top:50%;--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));line-height:1rem;--tw-text-opacity: 1;color:rgba(var(--ax-sys-color-warning-500),var(--tw-text-opacity, 1));font-size:.875rem}.axp-compare-view .__table .__tbody .__row .__object-cell .__object-placeholder{opacity:.75}.axp-compare-view .__table .__tbody .__row.__row--has-differences .__field-cell{border-inline-start-width:4px;--tw-border-opacity: 1;border-inline-start-color:rgba(var(--ax-sys-color-warning-500),var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-warning-50),var(--tw-bg-opacity, 1))}.axp-compare-view .__table .__tbody .__row.__row--has-differences .__field-cell:is(.ax-dark *){--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-warning-900),var(--tw-bg-opacity, 1))}.axp-compare-view .__table .__tbody .__row.__row--has-equal-values .__field-cell{border-inline-start-width:4px;--tw-border-opacity: 1;border-inline-start-color:rgba(var(--ax-sys-color-success-500),var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-success-50),var(--tw-bg-opacity, 1))}.axp-compare-view .__table .__tbody .__row.__row--has-equal-values .__field-cell:is(.ax-dark *){--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-success-900),var(--tw-bg-opacity, 1))}\n"] }]
|
|
823
|
+
], encapsulation: ViewEncapsulation.None, providers: [], template: "<!--\n #region ---- Compare View Table Layout ----\n-->\n<div class=\"axp-compare-view\">\n <div class=\"__table-container\">\n <table class=\"__table\">\n <thead class=\"__thead\">\n <tr class=\"__header-row\">\n <th class=\"__field-header\">\n <ax-check-box [value]=\"showOnlyChanges()\" (valueChange)=\"toggleShowOnlyChanges()\"\n class=\"__show-changes-toggle\">\n <ax-label>\n {{ 'compare-view.show-only-differences' | translate: { scope: 'common' } | async }}\n </ax-label>\n </ax-check-box>\n </th>\n @for (obj of remainingObjects(); track obj.id) {\n <th class=\"__object-header\" [attr.data-id]=\"obj.id\">\n <div class=\"__object-title\" [title]=\"obj.description\">\n <span>{{ obj.title | translate | async }}</span>\n @if (remainingObjects().length > 2) {\n <span class=\"__remove-object-button\" (click)=\"removeObject(obj.id)\">\n <i class=\"fa-light fa-times\"></i>\n </span>\n }\n </div>\n </th>\n }\n </tr>\n </thead>\n <tbody class=\"__tbody\">\n @for (field of filteredFields(); track field.path; let i = $index) {\n <tr class=\"__row\" [class.__row--odd]=\"i % 2 === 1\" [class.__row--has-differences]=\"hasUnequalValues(field.path)\"\n [class.__row--has-equal-values]=\"hasEqualValues(field.path)\">\n <td class=\"__field-cell\">\n <div class=\"__field-content\">\n <div class=\"__field-title\">\n {{ field.title | translate | async }}\n </div>\n @if (field.description) {\n <div class=\"__field-description\">{{ field.description }}</div>\n }\n </div>\n </td>\n @for (obj of remainingObjects(); track obj.id; let objIndex = $index) {\n <td class=\"__object-cell\" [attr.data-id]=\"obj.id\"\n [class.__cell--changed]=\"hasValueChangedFromPrevious(field.path, objIndex) && isChangesMode()\">\n @if (obj.context[field.path] !== undefined) {\n <div class=\"__object-content\">\n <axp-widgets-container [context]=\"obj.context\">\n <ng-container axp-widget-renderer [node]=\"field.widget\" [mode]=\"'view'\"></ng-container>\n </axp-widgets-container>\n </div>\n } @else {\n <div class=\"__object-placeholder\">---</div>\n }\n @if (hasValueChangingToNext(field.path, objIndex) && isChangesMode()) {\n <div class=\"__change-indicator\">\n <i class=\"fa-light fa-arrow-right\"></i>\n </div>\n }\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n</div>\n<!--\n #endregion\n-->", styles: [".axp-compare-view{display:flex;height:100%;width:100%;flex-direction:column;border-radius:.375rem;border-width:1px;--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);background-color:rgb(var(--ax-sys-color-lightest-surface));color:rgb(var(--ax-sys-color-on-lightest-surface));border-color:rgb(var(--ax-sys-color-border-lightest-surface));position:relative}.axp-compare-view .__filter-controls{flex-shrink:0;border-bottom-width:1px;padding:1rem;background-color:rgb(var(--ax-sys-color-light-surface));color:rgb(var(--ax-sys-color-on-light-surface));border-color:rgb(var(--ax-sys-color-border-light-surface))}.axp-compare-view .__filter-controls .__show-changes-toggle{font-size:.875rem;line-height:1.25rem}.axp-compare-view .__table-container{flex:1 1 0%;overflow:auto;position:relative}.axp-compare-view .__table{width:100%;border-collapse:separate;border-spacing:0;table-layout:fixed}.axp-compare-view .__table .__thead{position:-webkit-sticky;position:sticky;top:0;z-index:20}.axp-compare-view .__table .__thead .__header-row .__field-header{width:14rem;border-bottom-width:1px;border-right-width:1px;padding:.75rem 1rem;text-align:left;font-weight:700;background-color:rgb(var(--ax-sys-color-lighter-surface));color:rgb(var(--ax-sys-color-on-lighter-surface));border-color:rgb(var(--ax-sys-color-border-lighter-surface));position:-webkit-sticky;position:sticky;left:0;z-index:25}.axp-compare-view .__table .__thead .__header-row .__object-header{position:relative;border-bottom-width:1px;padding:.75rem 1rem;text-align:center;background-color:rgb(var(--ax-sys-color-lighter-surface));color:rgb(var(--ax-sys-color-on-lighter-surface));border-color:rgb(var(--ax-sys-color-border-lighter-surface));min-width:250px;width:250px}.axp-compare-view .__table .__thead .__header-row .__object-header .__object-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.875rem;line-height:1.25rem;font-weight:600}.axp-compare-view .__table .__thead .__header-row .__object-header .__object-description{margin-top:.25rem;font-size:.75rem;line-height:1rem;opacity:.75}.axp-compare-view .__table .__thead .__header-row .__object-header .__remove-object-button{display:flex;width:1.5rem;height:1.5rem;cursor:pointer;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-light-surface),var(--tw-bg-opacity, 1));font-size:.875rem;line-height:1.25rem;position:absolute;top:50%;inset-inline-end:0px;--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.axp-compare-view .__table .__thead .__header-row .__object-header .__remove-object-button:hover{--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-danger-100),var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgba(var(--ax-sys-color-danger-600),var(--tw-text-opacity, 1))}.axp-compare-view .__table .__tbody .__row{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s;animation-duration:.2s}.axp-compare-view .__table .__tbody .__row.__row--odd{background-color:rgb(var(--ax-sys-color-lightest-surface));color:rgb(var(--ax-sys-color-on-lightest-surface));border-color:rgb(var(--ax-sys-color-border-lightest-surface))}.axp-compare-view .__table .__tbody .__row.__row--has-differences{border-left-width:4px;--tw-border-opacity: 1;border-left-color:rgba(var(--ax-sys-color-warning-500),var(--tw-border-opacity, 1))}.axp-compare-view .__table .__tbody .__row.__row--has-differences .__field-cell{background-color:rgba(var(--ax-sys-color-warning-500),var(--tw-bg-opacity, 1));--tw-bg-opacity: .05}.axp-compare-view .__table .__tbody .__row.__row--has-equal-values{border-left-width:4px;--tw-border-opacity: 1;border-left-color:rgba(var(--ax-sys-color-success-500),var(--tw-border-opacity, 1))}.axp-compare-view .__table .__tbody .__row.__row--has-equal-values .__field-cell{background-color:rgba(var(--ax-sys-color-success-500),var(--tw-bg-opacity, 1));--tw-bg-opacity: .05}.axp-compare-view .__table .__tbody .__row .__field-cell{width:14rem;border-bottom-width:1px;border-right-width:1px;padding:.75rem 1rem;vertical-align:top;background-color:rgb(var(--ax-sys-color-lightest-surface));color:rgb(var(--ax-sys-color-on-lightest-surface));border-color:rgb(var(--ax-sys-color-border-lightest-surface));position:-webkit-sticky;position:sticky;left:0;z-index:15}.axp-compare-view .__table .__tbody .__row .__field-cell .__field-content{display:flex;flex-direction:column;gap:.25rem}.axp-compare-view .__table .__tbody .__row .__field-cell .__field-content .__field-title{font-weight:500}.axp-compare-view .__table .__tbody .__row .__field-cell .__field-content .__field-description{font-size:.75rem;line-height:1rem;opacity:.75}.axp-compare-view .__table .__tbody .__row .__object-cell{border-bottom-width:1px;padding:.75rem 1rem;text-align:center;vertical-align:middle;position:relative}.axp-compare-view .__table .__tbody .__row .__object-cell.__cell--changed .__object-content{border-width:1px;border-style:dashed;--tw-border-opacity: 1;border-color:rgba(var(--ax-sys-color-warning-200),var(--tw-border-opacity, 1));padding:.5rem}.axp-compare-view .__table .__tbody .__row .__object-cell .__object-content{position:relative;display:flex;align-items:center;justify-content:center}.axp-compare-view .__table .__tbody .__row .__object-cell .__change-indicator{position:absolute;inset-inline-end:-.25rem;top:50%;--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));line-height:1rem;--tw-text-opacity: 1;color:rgba(var(--ax-sys-color-warning-500),var(--tw-text-opacity, 1));font-size:.875rem}.axp-compare-view .__table .__tbody .__row .__object-cell .__object-placeholder{opacity:.75}.axp-compare-view .__table .__tbody .__row.__row--has-differences .__field-cell{border-inline-start-width:4px;--tw-border-opacity: 1;border-inline-start-color:rgba(var(--ax-sys-color-warning-500),var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-warning-50),var(--tw-bg-opacity, 1))}.axp-compare-view .__table .__tbody .__row.__row--has-differences .__field-cell:is(.ax-dark *){--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-warning-900),var(--tw-bg-opacity, 1))}.axp-compare-view .__table .__tbody .__row.__row--has-equal-values .__field-cell{border-inline-start-width:4px;--tw-border-opacity: 1;border-inline-start-color:rgba(var(--ax-sys-color-success-500),var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-success-50),var(--tw-bg-opacity, 1))}.axp-compare-view .__table .__tbody .__row.__row--has-equal-values .__field-cell:is(.ax-dark *){--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-success-900),var(--tw-bg-opacity, 1))}\n"] }]
|
|
877
824
|
}] });
|
|
878
825
|
|
|
879
826
|
class AXPComponentSlot {
|
|
@@ -975,9 +922,9 @@ class AXPComponentSlotDirective {
|
|
|
975
922
|
}
|
|
976
923
|
// load options
|
|
977
924
|
if (typeof config.options === 'function') {
|
|
978
|
-
|
|
925
|
+
runInInjectionContext(this.injector, () => {
|
|
979
926
|
const fun = config.options;
|
|
980
|
-
options =
|
|
927
|
+
options = fun();
|
|
981
928
|
});
|
|
982
929
|
}
|
|
983
930
|
else if (config.options) {
|
|
@@ -1094,13 +1041,9 @@ class AXPDynamicFormComponent {
|
|
|
1094
1041
|
*/
|
|
1095
1042
|
this.context = input.required(...(ngDevMode ? [{ debugName: "context" }] : []));
|
|
1096
1043
|
/**
|
|
1097
|
-
*
|
|
1098
|
-
*/
|
|
1099
|
-
this.layoutLook = input('normal', ...(ngDevMode ? [{ debugName: "layoutLook" }] : []));
|
|
1100
|
-
/**
|
|
1101
|
-
* Form layout direction and flow (vertical, horizontal, grid)
|
|
1044
|
+
* Layout style for the form (normal, compact, vertical, horizontal)
|
|
1102
1045
|
*/
|
|
1103
|
-
this.
|
|
1046
|
+
this.layoutStyle = input('normal', ...(ngDevMode ? [{ debugName: "layoutStyle" }] : []));
|
|
1104
1047
|
/**
|
|
1105
1048
|
* Custom layout configuration for form fields
|
|
1106
1049
|
*/
|
|
@@ -1142,17 +1085,17 @@ class AXPDynamicFormComponent {
|
|
|
1142
1085
|
*/
|
|
1143
1086
|
this.computedLayout = computed(() => this.layoutConfig(), ...(ngDevMode ? [{ debugName: "computedLayout" }] : []));
|
|
1144
1087
|
/**
|
|
1145
|
-
*
|
|
1088
|
+
* Computed form definition
|
|
1089
|
+
*/
|
|
1090
|
+
this.computedFormDefinition = computed(() => this.formDefinition(), ...(ngDevMode ? [{ debugName: "computedFormDefinition" }] : []));
|
|
1091
|
+
/**
|
|
1092
|
+
* Host classes based on layout style
|
|
1146
1093
|
*/
|
|
1147
1094
|
this.hostClasses = computed(() => {
|
|
1148
1095
|
const classes = ['axp-dynamic-form'];
|
|
1149
|
-
const
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
classes.push(`--look-${look}`);
|
|
1153
|
-
}
|
|
1154
|
-
if (direction && direction !== 'vertical') {
|
|
1155
|
-
classes.push(`--direction-${direction}`);
|
|
1096
|
+
const style = this.layoutStyle();
|
|
1097
|
+
if (style && style !== 'normal') {
|
|
1098
|
+
classes.push(`--${style}`);
|
|
1156
1099
|
}
|
|
1157
1100
|
return classes.join(' ');
|
|
1158
1101
|
}, ...(ngDevMode ? [{ debugName: "hostClasses" }] : []));
|
|
@@ -1206,9 +1149,6 @@ class AXPDynamicFormComponent {
|
|
|
1206
1149
|
this.contextChange.emit(event.data);
|
|
1207
1150
|
}
|
|
1208
1151
|
}
|
|
1209
|
-
isRequired(param) {
|
|
1210
|
-
return param.widget?.options?.['validations']?.some((v) => v.rule === 'required');
|
|
1211
|
-
}
|
|
1212
1152
|
//#endregion
|
|
1213
1153
|
//#region ---- Public Methods ----
|
|
1214
1154
|
/**
|
|
@@ -1242,11 +1182,11 @@ class AXPDynamicFormComponent {
|
|
|
1242
1182
|
return false;
|
|
1243
1183
|
}
|
|
1244
1184
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPDynamicFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1245
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: AXPDynamicFormComponent, isStandalone: true, selector: "axp-dynamic-form", inputs: { formDefinition: { classPropertyName: "formDefinition", publicName: "formDefinition", isSignal: true, isRequired: true, transformFunction: null }, context: { classPropertyName: "context", publicName: "context", isSignal: true, isRequired: true, transformFunction: null }, layoutLook: { classPropertyName: "layoutLook", publicName: "layoutLook", isSignal: true, isRequired: false, transformFunction: null }, layoutDirection: { classPropertyName: "layoutDirection", publicName: "layoutDirection", isSignal: true, isRequired: false, transformFunction: null }, layoutConfig: { classPropertyName: "layoutConfig", publicName: "layoutConfig", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { contextChange: "contextChange", contextInitiated: "contextInitiated", validityChange: "validityChange" }, host: { properties: { "class": "hostClasses()" }, classAttribute: "axp-dynamic-form" }, viewQueries: [{ propertyName: "form", first: true, predicate: AXFormComponent, descendants: true, isSignal: true }, { propertyName: "container", first: true, predicate: AXPWidgetContainerComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<ax-form>\n <axp-widgets-container [context]=\"internalContext()\" (onContextChanged)=\"handleContextChanged($event)\">\n <axp-layout-sections>\n @for (group of formDefinition().groups; track group.name) {\n <axp-layout-section>\n @if (group.title || group.description) {\n <axp-layout-header>\n <axp-layout-title>{{ group.title }}</axp-layout-title>\n @if (group.description) {\n <axp-layout-description>{{ group.description }}</axp-layout-description>\n }\n </axp-layout-header>\n }\n <axp-layout-content>\n @for (param of group.parameters; track param.path) {\n <div class=\"__field-container\">\n <ax-form-field class=\"__field-input\" [gridLayout]=\"computedLayout()\">\n <ax-label [required]=\"isRequired(param)\">{{ param.title! | translate | async }}</ax-label>\n <ng-container axp-widget-renderer [node]=\"param.widget\" [mode]=\"'edit'\"></ng-container>\n @if (param.description) {\n <axp-layout-description>{{ param.description! | translate | async }}</axp-layout-description>\n }\n </ax-form-field>\n </div>\n }\n </axp-layout-content>\n </axp-layout-section>\n } @empty {\n <axp-layout-section>\n <axp-layout-content>\n <div class=\"__empty-state\">\n <axp-layout-description>No form definition provided</axp-layout-description>\n </div>\n </axp-layout-content>\n </axp-layout-section>\n }\n </axp-layout-sections>\n </axp-widgets-container>\n</ax-form>\n", styles: [".axp-dynamic-form{width:100%}.axp-dynamic-form axp-layout-section axp-layout-content{display:flex;width:100%;flex-direction:column}.axp-dynamic-form axp-layout-section axp-layout-content>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse));border-style:dashed;--tw-divide-opacity: 1;border-color:rgba(var(--ax-sys-color-border-lightest-surface),var(--tw-divide-opacity, 1))}.axp-dynamic-form axp-layout-section axp-layout-content .__field-container{align-items:center;gap:1rem;padding:1rem}@media (min-width: 1024px){.axp-dynamic-form axp-layout-section axp-layout-content .__field-container{padding-left:1.5rem;padding-right:1.5rem}}@media (min-width: 1280px){.axp-dynamic-form axp-layout-section axp-layout-content .__field-container{padding-left:2rem;padding-right:2rem}}@media (min-width: 1536px){.axp-dynamic-form axp-layout-section axp-layout-content .__field-container{padding-left:2.5rem;padding-right:2.5rem}}.axp-dynamic-form axp-layout-section axp-layout-content .__field-container{display:grid;grid-template-columns:repeat(12,minmax(0,1fr))}.axp-dynamic-form axp-layout-section axp-layout-content .__field-container .__field-info{grid-column:span 12 / span 12}@media (min-width: 768px){.axp-dynamic-form axp-layout-section axp-layout-content .__field-container .__field-info{grid-column:span 4 / span 4}}@media (min-width: 1024px){.axp-dynamic-form axp-layout-section axp-layout-content .__field-container .__field-info{grid-column:span 4 / span 4}}@media (min-width: 1536px){.axp-dynamic-form axp-layout-section axp-layout-content .__field-container .__field-info{grid-column:span 3 / span 3}}.axp-dynamic-form axp-layout-section axp-layout-content .__field-container axp-layout-description{margin-top:.5rem!important;font-size:.75rem!important;line-height:1rem!important}.axp-dynamic-form.--look-compact axp-layout-section axp-layout-content>:not([hidden])~:not([hidden]){border-style:none}.axp-dynamic-form.--look-compact axp-layout-section axp-layout-content .__field-container{display:flex;flex-direction:column;gap:.25rem;padding:.25rem .5rem;margin-bottom:.5rem;border-width:0px}.axp-dynamic-form.--look-compact axp-layout-section axp-layout-content .__field-container .__field-info{margin-bottom:.125rem;width:100%}.axp-dynamic-form.--look-compact axp-layout-section axp-layout-content .__field-container .__field-info axp-layout-title{font-size:.875rem;line-height:1.25rem;font-weight:500}.axp-dynamic-form.--look-compact axp-layout-section axp-layout-content .__field-container .__field-input{width:100%}.axp-dynamic-form.--look-compact axp-layout-section axp-layout-content .__field-container axp-layout-description{margin-top:.125rem!important;font-size:.75rem!important;line-height:1rem!important;opacity:.75!important}.axp-dynamic-form.--look-compact axp-layout-section{margin-bottom:.75rem}.axp-dynamic-form.--look-compact axp-layout-section axp-layout-header{margin-bottom:.5rem;gap:0px;padding:.5rem}.axp-dynamic-form.--look-compact axp-layout-section axp-layout-header axp-layout-title{font-size:1rem;line-height:1.5rem;font-weight:600}.axp-dynamic-form.--look-compact axp-layout-section axp-layout-header axp-layout-description{margin-top:.25rem;font-size:.75rem;line-height:1rem;opacity:.75}.axp-dynamic-form.--look-borderless axp-layout-section{border-width:0px!important;--tw-shadow: 0 0 #0000 !important;--tw-shadow-colored: 0 0 #0000 !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.axp-dynamic-form.--look-borderless axp-layout-section axp-layout-content>:not([hidden])~:not([hidden]){border-style:none}.axp-dynamic-form.--look-borderless axp-layout-section axp-layout-content .__field-container{display:flex;flex-direction:column;gap:.25rem;padding:.25rem .5rem;margin-bottom:.5rem;border-width:0px}.axp-dynamic-form.--look-borderless axp-layout-section axp-layout-content .__field-container .__field-info{margin-bottom:.125rem;width:100%}.axp-dynamic-form.--look-borderless axp-layout-section axp-layout-content .__field-container .__field-info axp-layout-title{font-size:.875rem;line-height:1.25rem;font-weight:500}.axp-dynamic-form.--look-borderless axp-layout-section axp-layout-content .__field-container .__field-input{width:100%}.axp-dynamic-form.--look-borderless axp-layout-section axp-layout-content .__field-container axp-layout-description{margin-top:.125rem!important;font-size:.75rem!important;line-height:1rem!important;opacity:.75!important}.axp-dynamic-form.--direction-vertical axp-layout-section axp-layout-content .__field-container{display:flex;flex-direction:column;align-items:flex-start;gap:.75rem}.axp-dynamic-form.--direction-vertical axp-layout-section axp-layout-content .__field-container .__field-info{grid-column:span 12 / span 12;width:100%}.axp-dynamic-form.--direction-vertical axp-layout-section axp-layout-content .__field-container .__field-input{grid-column:span 12 / span 12;width:100%}.axp-dynamic-form.--direction-vertical axp-layout-section axp-layout-content .__field-container axp-layout-description{margin-top:.25rem!important;font-size:.875rem!important;line-height:1.25rem!important}.axp-dynamic-form.--direction-horizontal axp-layout-section axp-layout-content>:not([hidden])~:not([hidden]){border-style:none}.axp-dynamic-form.--direction-horizontal axp-layout-section axp-layout-content .__field-container{display:flex;flex-direction:row;align-items:center;gap:1rem;padding-top:.75rem;padding-bottom:.75rem}.axp-dynamic-form.--direction-horizontal axp-layout-section axp-layout-content .__field-container .__field-info{width:12rem;flex-shrink:0}.axp-dynamic-form.--direction-horizontal axp-layout-section axp-layout-content .__field-container .__field-info axp-layout-title{margin-bottom:.25rem;font-size:.875rem;line-height:1.25rem;font-weight:500}.axp-dynamic-form.--direction-horizontal axp-layout-section axp-layout-content .__field-container .__field-input{flex:1 1 0%}.axp-dynamic-form.--direction-horizontal axp-layout-section axp-layout-content .__field-container axp-layout-description{margin-top:.25rem!important;font-size:.75rem!important;line-height:1rem!important;opacity:.75!important}.axp-dynamic-form.--direction-grid axp-layout-section axp-layout-content .__field-container{display:grid;grid-template-columns:repeat(1,minmax(0,1fr))}@media (min-width: 768px){.axp-dynamic-form.--direction-grid axp-layout-section axp-layout-content .__field-container{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width: 1024px){.axp-dynamic-form.--direction-grid axp-layout-section axp-layout-content .__field-container{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (min-width: 1280px){.axp-dynamic-form.--direction-grid axp-layout-section axp-layout-content .__field-container{grid-template-columns:repeat(4,minmax(0,1fr))}}.axp-dynamic-form.--direction-grid axp-layout-section axp-layout-content .__field-container{gap:1rem;padding:1rem}.axp-dynamic-form.--direction-grid axp-layout-section axp-layout-content .__field-container .__field-info{grid-column:1 / -1}.axp-dynamic-form.--direction-grid axp-layout-section axp-layout-content .__field-container .__field-input{grid-column:1 / -1}.axp-dynamic-form .__empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;padding-top:2rem;padding-bottom:2rem;text-align:center}.axp-dynamic-form .__empty-state .__message{font-size:.875rem;line-height:1.25rem;--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type:
|
|
1185
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: AXPDynamicFormComponent, isStandalone: true, selector: "axp-dynamic-form", inputs: { formDefinition: { classPropertyName: "formDefinition", publicName: "formDefinition", isSignal: true, isRequired: true, transformFunction: null }, context: { classPropertyName: "context", publicName: "context", isSignal: true, isRequired: true, transformFunction: null }, layoutStyle: { classPropertyName: "layoutStyle", publicName: "layoutStyle", isSignal: true, isRequired: false, transformFunction: null }, layoutConfig: { classPropertyName: "layoutConfig", publicName: "layoutConfig", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { contextChange: "contextChange", contextInitiated: "contextInitiated", validityChange: "validityChange" }, host: { properties: { "class": "hostClasses()" }, classAttribute: "axp-dynamic-form" }, viewQueries: [{ propertyName: "form", first: true, predicate: AXFormComponent, descendants: true, isSignal: true }, { propertyName: "container", first: true, predicate: AXPWidgetContainerComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<ax-form>\n <axp-widgets-container [context]=\"internalContext()\" (onContextChanged)=\"handleContextChanged($event)\">\n <axp-layout-sections>\n @if (computedFormDefinition()) {\n @for (group of computedFormDefinition().groups; track group.name) {\n <axp-layout-section>\n <axp-layout-header>\n <axp-layout-title>{{ group.title }}</axp-layout-title>\n @if (group.description) {\n <axp-layout-description>{{ group.description }}</axp-layout-description>\n }\n </axp-layout-header>\n <axp-layout-content>\n @for (param of group.parameters; track param.path) {\n <div class=\"__field-container\">\n <ax-form-field class=\"__field-input\" [gridLayout]=\"computedLayout()\">\n <ax-label>{{ param.title }}</ax-label>\n <ng-container axp-widget-renderer [node]=\"param.widget\" [mode]=\"'edit'\"></ng-container>\n <!-- @if (param.description) {\n <axp-layout-description>{{ param.description }}</axp-layout-description>\n } -->\n </ax-form-field>\n </div>\n }\n </axp-layout-content>\n </axp-layout-section>\n }\n } @else {\n <axp-layout-section>\n <axp-layout-content>\n <div class=\"__empty-state\">\n <axp-layout-description>No form definition provided</axp-layout-description>\n </div>\n </axp-layout-content>\n </axp-layout-section>\n }\n </axp-layout-sections>\n </axp-widgets-container>\n</ax-form>\n", styles: [".axp-dynamic-form{width:100%}.axp-dynamic-form axp-layout-section axp-layout-content{display:flex;width:100%;flex-direction:column}.axp-dynamic-form axp-layout-section axp-layout-content>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse));border-style:dashed;--tw-divide-opacity: 1;border-color:rgba(var(--ax-sys-color-border-lightest-surface),var(--tw-divide-opacity, 1))}.axp-dynamic-form axp-layout-section axp-layout-content .__field-container{align-items:center;gap:1rem;padding:1rem}@media (min-width: 1024px){.axp-dynamic-form axp-layout-section axp-layout-content .__field-container{padding-left:1.5rem;padding-right:1.5rem}}@media (min-width: 1280px){.axp-dynamic-form axp-layout-section axp-layout-content .__field-container{padding-left:2rem;padding-right:2rem}}@media (min-width: 1536px){.axp-dynamic-form axp-layout-section axp-layout-content .__field-container{padding-left:2.5rem;padding-right:2.5rem}}.axp-dynamic-form axp-layout-section axp-layout-content .__field-container{display:grid;grid-template-columns:repeat(12,minmax(0,1fr))}.axp-dynamic-form axp-layout-section axp-layout-content .__field-container .__field-info{grid-column:span 12 / span 12}@media (min-width: 768px){.axp-dynamic-form axp-layout-section axp-layout-content .__field-container .__field-info{grid-column:span 4 / span 4}}@media (min-width: 1024px){.axp-dynamic-form axp-layout-section axp-layout-content .__field-container .__field-info{grid-column:span 4 / span 4}}@media (min-width: 1536px){.axp-dynamic-form axp-layout-section axp-layout-content .__field-container .__field-info{grid-column:span 3 / span 3}}.axp-dynamic-form axp-layout-section axp-layout-content .__field-container axp-layout-description{margin-top:.5rem!important;font-size:.75rem!important;line-height:1rem!important}.axp-dynamic-form.--compact axp-layout-section axp-layout-content>:not([hidden])~:not([hidden]){border-style:none}.axp-dynamic-form.--compact axp-layout-section axp-layout-content .__field-container{display:flex;flex-direction:column;gap:.25rem;padding:.25rem .5rem;margin-bottom:.5rem;border-width:0px}.axp-dynamic-form.--compact axp-layout-section axp-layout-content .__field-container .__field-info{margin-bottom:.125rem;width:100%}.axp-dynamic-form.--compact axp-layout-section axp-layout-content .__field-container .__field-info axp-layout-title{font-size:.875rem;line-height:1.25rem;font-weight:500}.axp-dynamic-form.--compact axp-layout-section axp-layout-content .__field-container .__field-input{width:100%}.axp-dynamic-form.--compact axp-layout-section axp-layout-content .__field-container axp-layout-description{margin-top:.125rem!important;font-size:.75rem!important;line-height:1rem!important;opacity:.75!important}.axp-dynamic-form.--compact axp-layout-section{margin-bottom:.75rem}.axp-dynamic-form.--compact axp-layout-section axp-layout-header{margin-bottom:.5rem;gap:0px;padding:.5rem}.axp-dynamic-form.--compact axp-layout-section axp-layout-header axp-layout-title{font-size:1rem;line-height:1.5rem;font-weight:600}.axp-dynamic-form.--compact axp-layout-section axp-layout-header axp-layout-description{margin-top:.25rem;font-size:.75rem;line-height:1rem;opacity:.75}.axp-dynamic-form.--vertical axp-layout-section axp-layout-content .__field-container{display:flex;flex-direction:column;align-items:flex-start;gap:.75rem}.axp-dynamic-form.--vertical axp-layout-section axp-layout-content .__field-container .__field-info{grid-column:span 12 / span 12;width:100%}.axp-dynamic-form.--vertical axp-layout-section axp-layout-content .__field-container .__field-input{grid-column:span 12 / span 12;width:100%}.axp-dynamic-form.--vertical axp-layout-section axp-layout-content .__field-container axp-layout-description{margin-top:.25rem!important;font-size:.875rem!important;line-height:1.25rem!important}.axp-dynamic-form.--horizontal axp-layout-section axp-layout-content>:not([hidden])~:not([hidden]){border-style:none}.axp-dynamic-form.--horizontal axp-layout-section axp-layout-content .__field-container{display:flex;flex-direction:row;align-items:center;gap:1rem;padding-top:.75rem;padding-bottom:.75rem}.axp-dynamic-form.--horizontal axp-layout-section axp-layout-content .__field-container .__field-info{width:12rem;flex-shrink:0}.axp-dynamic-form.--horizontal axp-layout-section axp-layout-content .__field-container .__field-info axp-layout-title{margin-bottom:.25rem;font-size:.875rem;line-height:1.25rem;font-weight:500}.axp-dynamic-form.--horizontal axp-layout-section axp-layout-content .__field-container .__field-input{flex:1 1 0%}.axp-dynamic-form.--horizontal axp-layout-section axp-layout-content .__field-container axp-layout-description{margin-top:.25rem!important;font-size:.75rem!important;line-height:1rem!important;opacity:.75!important}.axp-dynamic-form .__empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;padding-top:2rem;padding-bottom:2rem;text-align:center}.axp-dynamic-form .__empty-state .__message{font-size:.875rem;line-height:1.25rem;--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type:
|
|
1246
1186
|
// ACoreX
|
|
1247
|
-
AXFormModule }, { kind: "component", type:
|
|
1187
|
+
AXFormModule }, { kind: "component", type: i1$1.AXFormFieldComponent, selector: "ax-form-field", inputs: ["labelMode"] }, { kind: "component", type: i1$1.AXFormComponent, selector: "ax-form", inputs: ["labelMode", "look", "messageStyle", "updateOn"], outputs: ["onValidate", "updateOnChange"] }, { kind: "ngmodule", type: AXValidationModule }, { kind: "ngmodule", type:
|
|
1248
1188
|
// Platform
|
|
1249
|
-
AXPLayoutBuilderModule }, { kind: "component", type: i3$
|
|
1189
|
+
AXPLayoutBuilderModule }, { kind: "component", type: i3$2.AXPWidgetContainerComponent, selector: "axp-widgets-container", inputs: ["context", "functions"], outputs: ["onContextChanged"] }, { kind: "directive", type: i3$2.AXPWidgetRendererDirective, selector: "[axp-widget-renderer]", inputs: ["parentNode", "index", "mode", "node"], outputs: ["onOptionsChanged", "onValueChanged"], exportAs: ["widgetRenderer"] }, { kind: "component", type: AXPThemeLayoutBlockComponent, selector: "\n\n axp-page-content, \n axp-page-footer-container,\n axp-page-footer,\n axp-page-header,\n axp-page-header-container,\n axp-page-toolbar,\n\n axp-layout-content, \n axp-layout-page-content, \n\n axp-layout-sections,\n axp-layout-body,\n axp-layout-page-body,\n axp-layout-prefix,\n axp-layout-suffix,\n axp-layout-title-bar,\n axp-layout-title, \n axp-layout-title-actions, \n axp-layout-nav-button, \n axp-layout-description, \n axp-layout-breadcrumbs,\n axp-layout-list-action,\n " }, { kind: "component", type: AXPThemeLayoutHeaderComponent, selector: "axp-layout-header" }, { kind: "component", type: AXPThemeLayoutSectionComponent, selector: "axp-layout-section" }, { kind: "directive", type: AXPGridLayoutDirective, selector: "[gridLayout]", inputs: ["gridLayout"] }, { kind: "component", type: AXLabelComponent, selector: "ax-label", inputs: ["required", "for"], outputs: ["requiredChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1250
1190
|
}
|
|
1251
1191
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPDynamicFormComponent, decorators: [{
|
|
1252
1192
|
type: Component,
|
|
@@ -1256,7 +1196,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
1256
1196
|
// ACoreX
|
|
1257
1197
|
AXFormModule,
|
|
1258
1198
|
AXValidationModule,
|
|
1259
|
-
AXTranslationModule,
|
|
1260
1199
|
// Platform
|
|
1261
1200
|
AXPLayoutBuilderModule,
|
|
1262
1201
|
AXPThemeLayoutBlockComponent,
|
|
@@ -1267,1053 +1206,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
1267
1206
|
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
1268
1207
|
class: 'axp-dynamic-form',
|
|
1269
1208
|
'[class]': 'hostClasses()',
|
|
1270
|
-
}, template: "<ax-form>\n <axp-widgets-container [context]=\"internalContext()\" (onContextChanged)=\"handleContextChanged($event)\">\n <axp-layout-sections>\n @for (group of
|
|
1209
|
+
}, template: "<ax-form>\n <axp-widgets-container [context]=\"internalContext()\" (onContextChanged)=\"handleContextChanged($event)\">\n <axp-layout-sections>\n @if (computedFormDefinition()) {\n @for (group of computedFormDefinition().groups; track group.name) {\n <axp-layout-section>\n <axp-layout-header>\n <axp-layout-title>{{ group.title }}</axp-layout-title>\n @if (group.description) {\n <axp-layout-description>{{ group.description }}</axp-layout-description>\n }\n </axp-layout-header>\n <axp-layout-content>\n @for (param of group.parameters; track param.path) {\n <div class=\"__field-container\">\n <ax-form-field class=\"__field-input\" [gridLayout]=\"computedLayout()\">\n <ax-label>{{ param.title }}</ax-label>\n <ng-container axp-widget-renderer [node]=\"param.widget\" [mode]=\"'edit'\"></ng-container>\n <!-- @if (param.description) {\n <axp-layout-description>{{ param.description }}</axp-layout-description>\n } -->\n </ax-form-field>\n </div>\n }\n </axp-layout-content>\n </axp-layout-section>\n }\n } @else {\n <axp-layout-section>\n <axp-layout-content>\n <div class=\"__empty-state\">\n <axp-layout-description>No form definition provided</axp-layout-description>\n </div>\n </axp-layout-content>\n </axp-layout-section>\n }\n </axp-layout-sections>\n </axp-widgets-container>\n</ax-form>\n", styles: [".axp-dynamic-form{width:100%}.axp-dynamic-form axp-layout-section axp-layout-content{display:flex;width:100%;flex-direction:column}.axp-dynamic-form axp-layout-section axp-layout-content>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse));border-style:dashed;--tw-divide-opacity: 1;border-color:rgba(var(--ax-sys-color-border-lightest-surface),var(--tw-divide-opacity, 1))}.axp-dynamic-form axp-layout-section axp-layout-content .__field-container{align-items:center;gap:1rem;padding:1rem}@media (min-width: 1024px){.axp-dynamic-form axp-layout-section axp-layout-content .__field-container{padding-left:1.5rem;padding-right:1.5rem}}@media (min-width: 1280px){.axp-dynamic-form axp-layout-section axp-layout-content .__field-container{padding-left:2rem;padding-right:2rem}}@media (min-width: 1536px){.axp-dynamic-form axp-layout-section axp-layout-content .__field-container{padding-left:2.5rem;padding-right:2.5rem}}.axp-dynamic-form axp-layout-section axp-layout-content .__field-container{display:grid;grid-template-columns:repeat(12,minmax(0,1fr))}.axp-dynamic-form axp-layout-section axp-layout-content .__field-container .__field-info{grid-column:span 12 / span 12}@media (min-width: 768px){.axp-dynamic-form axp-layout-section axp-layout-content .__field-container .__field-info{grid-column:span 4 / span 4}}@media (min-width: 1024px){.axp-dynamic-form axp-layout-section axp-layout-content .__field-container .__field-info{grid-column:span 4 / span 4}}@media (min-width: 1536px){.axp-dynamic-form axp-layout-section axp-layout-content .__field-container .__field-info{grid-column:span 3 / span 3}}.axp-dynamic-form axp-layout-section axp-layout-content .__field-container axp-layout-description{margin-top:.5rem!important;font-size:.75rem!important;line-height:1rem!important}.axp-dynamic-form.--compact axp-layout-section axp-layout-content>:not([hidden])~:not([hidden]){border-style:none}.axp-dynamic-form.--compact axp-layout-section axp-layout-content .__field-container{display:flex;flex-direction:column;gap:.25rem;padding:.25rem .5rem;margin-bottom:.5rem;border-width:0px}.axp-dynamic-form.--compact axp-layout-section axp-layout-content .__field-container .__field-info{margin-bottom:.125rem;width:100%}.axp-dynamic-form.--compact axp-layout-section axp-layout-content .__field-container .__field-info axp-layout-title{font-size:.875rem;line-height:1.25rem;font-weight:500}.axp-dynamic-form.--compact axp-layout-section axp-layout-content .__field-container .__field-input{width:100%}.axp-dynamic-form.--compact axp-layout-section axp-layout-content .__field-container axp-layout-description{margin-top:.125rem!important;font-size:.75rem!important;line-height:1rem!important;opacity:.75!important}.axp-dynamic-form.--compact axp-layout-section{margin-bottom:.75rem}.axp-dynamic-form.--compact axp-layout-section axp-layout-header{margin-bottom:.5rem;gap:0px;padding:.5rem}.axp-dynamic-form.--compact axp-layout-section axp-layout-header axp-layout-title{font-size:1rem;line-height:1.5rem;font-weight:600}.axp-dynamic-form.--compact axp-layout-section axp-layout-header axp-layout-description{margin-top:.25rem;font-size:.75rem;line-height:1rem;opacity:.75}.axp-dynamic-form.--vertical axp-layout-section axp-layout-content .__field-container{display:flex;flex-direction:column;align-items:flex-start;gap:.75rem}.axp-dynamic-form.--vertical axp-layout-section axp-layout-content .__field-container .__field-info{grid-column:span 12 / span 12;width:100%}.axp-dynamic-form.--vertical axp-layout-section axp-layout-content .__field-container .__field-input{grid-column:span 12 / span 12;width:100%}.axp-dynamic-form.--vertical axp-layout-section axp-layout-content .__field-container axp-layout-description{margin-top:.25rem!important;font-size:.875rem!important;line-height:1.25rem!important}.axp-dynamic-form.--horizontal axp-layout-section axp-layout-content>:not([hidden])~:not([hidden]){border-style:none}.axp-dynamic-form.--horizontal axp-layout-section axp-layout-content .__field-container{display:flex;flex-direction:row;align-items:center;gap:1rem;padding-top:.75rem;padding-bottom:.75rem}.axp-dynamic-form.--horizontal axp-layout-section axp-layout-content .__field-container .__field-info{width:12rem;flex-shrink:0}.axp-dynamic-form.--horizontal axp-layout-section axp-layout-content .__field-container .__field-info axp-layout-title{margin-bottom:.25rem;font-size:.875rem;line-height:1.25rem;font-weight:500}.axp-dynamic-form.--horizontal axp-layout-section axp-layout-content .__field-container .__field-input{flex:1 1 0%}.axp-dynamic-form.--horizontal axp-layout-section axp-layout-content .__field-container axp-layout-description{margin-top:.25rem!important;font-size:.75rem!important;line-height:1rem!important;opacity:.75!important}.axp-dynamic-form .__empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;padding-top:2rem;padding-bottom:2rem;text-align:center}.axp-dynamic-form .__empty-state .__message{font-size:.875rem;line-height:1.25rem;--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}\n"] }]
|
|
1271
1210
|
}] });
|
|
1272
1211
|
|
|
1273
|
-
class
|
|
1274
|
-
constructor() {
|
|
1275
|
-
super(...arguments);
|
|
1276
|
-
this.dynamicForm = viewChild(AXPDynamicFormComponent, ...(ngDevMode ? [{ debugName: "dynamicForm" }] : []));
|
|
1277
|
-
this.isSubmitting = signal(false, ...(ngDevMode ? [{ debugName: "isSubmitting" }] : []));
|
|
1278
|
-
this.previousContext = signal({}, ...(ngDevMode ? [{ debugName: "previousContext" }] : []));
|
|
1279
|
-
this.formData = signal({}, ...(ngDevMode ? [{ debugName: "formData" }] : []));
|
|
1280
|
-
//#region ---- Computed Properties ----
|
|
1281
|
-
/**
|
|
1282
|
-
* Form context for widget container
|
|
1283
|
-
*/
|
|
1284
|
-
this.formContext = computed(() => this.formData(), ...(ngDevMode ? [{ debugName: "formContext" }] : []));
|
|
1285
|
-
this.defaultLayout = () => ({
|
|
1286
|
-
positions: {
|
|
1287
|
-
default: { colSpan: 12 },
|
|
1288
|
-
md: { colSpan: 8 },
|
|
1289
|
-
lg: { colSpan: 6 },
|
|
1290
|
-
xl: { colSpan: 5 },
|
|
1291
|
-
xxl: { colSpan: 4 }
|
|
1292
|
-
}
|
|
1293
|
-
});
|
|
1294
|
-
/**
|
|
1295
|
-
* Footer actions for dynamic button system
|
|
1296
|
-
*/
|
|
1297
|
-
this.footerPrefixActions = computed(() => this.config.actions?.footer?.prefix || [], ...(ngDevMode ? [{ debugName: "footerPrefixActions" }] : []));
|
|
1298
|
-
this.footerSuffixActions = computed(() => this.config.actions?.footer?.suffix || [], ...(ngDevMode ? [{ debugName: "footerSuffixActions" }] : []));
|
|
1299
|
-
this.hasFooterActions = computed(() => {
|
|
1300
|
-
const prefixActions = this.footerPrefixActions();
|
|
1301
|
-
const suffixActions = this.footerSuffixActions();
|
|
1302
|
-
return prefixActions.length > 0 || suffixActions.length > 0;
|
|
1303
|
-
}, ...(ngDevMode ? [{ debugName: "hasFooterActions" }] : []));
|
|
1304
|
-
this.hasVisibleFooterPrefixActions = computed(() => {
|
|
1305
|
-
const prefixFooterActions = this.footerPrefixActions();
|
|
1306
|
-
return prefixFooterActions.some((action) => action.visible != false);
|
|
1307
|
-
}, ...(ngDevMode ? [{ debugName: "hasVisibleFooterPrefixActions" }] : []));
|
|
1308
|
-
this.hasVisibleFooterSuffixActions = computed(() => {
|
|
1309
|
-
const suffixFooterActions = this.footerSuffixActions();
|
|
1310
|
-
return suffixFooterActions.some((action) => action.visible != false);
|
|
1311
|
-
}, ...(ngDevMode ? [{ debugName: "hasVisibleFooterSuffixActions" }] : []));
|
|
1312
|
-
}
|
|
1313
|
-
//#endregion
|
|
1314
|
-
//#region ---- Lifecycle Methods ----
|
|
1315
|
-
ngOnInit() {
|
|
1316
|
-
this.formData.set(this.config.context ?? {});
|
|
1317
|
-
}
|
|
1318
|
-
//#endregion
|
|
1319
|
-
//#region ---- Event Handlers ----
|
|
1320
|
-
handleContextInitiated(context) {
|
|
1321
|
-
this.previousContext.set(context);
|
|
1322
|
-
}
|
|
1323
|
-
handleContextChanged(context) {
|
|
1324
|
-
this.formData.set(context);
|
|
1325
|
-
}
|
|
1326
|
-
//#endregion
|
|
1327
|
-
//#region ---- Action Execution ----
|
|
1328
|
-
/**
|
|
1329
|
-
* Execute a dynamic action
|
|
1330
|
-
*/
|
|
1331
|
-
async executeAction(action) {
|
|
1332
|
-
if (action.command) {
|
|
1333
|
-
// Execute the command if provided
|
|
1334
|
-
await this.executeCommand(action.command);
|
|
1335
|
-
}
|
|
1336
|
-
else {
|
|
1337
|
-
// Handle custom action logic here
|
|
1338
|
-
const result = {
|
|
1339
|
-
context: this.formData(),
|
|
1340
|
-
action: action.name || action.title
|
|
1341
|
-
};
|
|
1342
|
-
this.close(result);
|
|
1343
|
-
}
|
|
1344
|
-
}
|
|
1345
|
-
/**
|
|
1346
|
-
* Execute a command
|
|
1347
|
-
*/
|
|
1348
|
-
async executeCommand(command) {
|
|
1349
|
-
// Handle command execution logic here
|
|
1350
|
-
// This can be extended based on your command system
|
|
1351
|
-
console.log('Executing command:', command);
|
|
1352
|
-
if (command.options?.['validate'] == true) {
|
|
1353
|
-
if (!await this.isFormValid()) {
|
|
1354
|
-
return;
|
|
1355
|
-
}
|
|
1356
|
-
}
|
|
1357
|
-
const result = {
|
|
1358
|
-
context: this.formData(),
|
|
1359
|
-
action: command.name
|
|
1360
|
-
};
|
|
1361
|
-
this.close(result);
|
|
1362
|
-
}
|
|
1363
|
-
//#endregion
|
|
1364
|
-
//#region ---- Public Methods ----
|
|
1365
|
-
/**
|
|
1366
|
-
* Check if form is valid
|
|
1367
|
-
*/
|
|
1368
|
-
async isFormValid() {
|
|
1369
|
-
return await this.dynamicForm()?.validate() ?? false;
|
|
1370
|
-
}
|
|
1371
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPDynamicDialogComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
1372
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: AXPDynamicDialogComponent, isStandalone: true, selector: "axp-dynamic-dialog", inputs: { config: "config" }, viewQueries: [{ propertyName: "dynamicForm", first: true, predicate: AXPDynamicFormComponent, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"ax-p-4\">\n <axp-dynamic-form\n [formDefinition]=\"config.formDefinition\"\n [context]=\"formContext()\"\n [layoutConfig]=\"config.layoutConfig || defaultLayout()\"\n [layoutLook]=\"'borderless'\"\n [layoutDirection]=\"'vertical'\"\n (contextChange)=\"handleContextChanged($event)\"\n (contextInitiated)=\"handleContextInitiated($event)\"\n >\n </axp-dynamic-form>\n</div>\n\n<ax-footer>\n <ax-prefix>\n <!-- Dynamic footer prefix actions -->\n @if (hasVisibleFooterPrefixActions()) {\n @for (action of footerPrefixActions(); track $index) {\n @if (action.visible != false) {\n <ax-button\n [disabled]=\"action.disabled || isSubmitting()\"\n [text]=\"(action.title | translate | async)!\"\n [look]=\"'outline'\"\n [color]=\"action.color\"\n (onClick)=\"executeAction(action)\"\n >\n <ax-prefix>\n <i class=\"{{ action.icon }}\"></i>\n </ax-prefix>\n @if (action?.items) {\n <ax-dropdown-panel #panel>\n <ax-button-item-list>\n @for (sub of action?.items; track $index) {\n @if (sub.visible != false) {\n <ax-button-item\n [text]=\"(sub.title | translate | async)!\"\n [color]=\"sub.color\"\n [disabled]=\"sub.disabled\"\n (onClick)=\"executeAction(sub)\"\n >\n <ax-prefix>\n <i class=\"fa-light {{ sub.icon }}\"></i>\n </ax-prefix>\n </ax-button-item>\n @if (sub.break) {\n <div class=\"ax-divider\"></div>\n }\n }\n }\n </ax-button-item-list>\n </ax-dropdown-panel>\n }\n </ax-button>\n }\n }\n }\n </ax-prefix>\n <ax-suffix>\n <!-- Dynamic footer suffix actions -->\n @if (hasFooterActions()) {\n <!-- Suffix actions -->\n @if (hasVisibleFooterSuffixActions()) {\n @for (action of footerSuffixActions(); track $index) {\n @if (action.visible != false) {\n <ax-button\n [disabled]=\"action.disabled || isSubmitting()\"\n [text]=\"(action.title | translate | async)!\"\n [look]=\"'solid'\"\n [color]=\"action.color\"\n (onClick)=\"executeAction(action)\"\n >\n <ax-prefix>\n <i class=\"{{ action.icon }}\"></i>\n </ax-prefix>\n @if (action?.items) {\n <ax-dropdown-panel #panel>\n <ax-button-item-list>\n @for (sub of action?.items; track $index) {\n @if (sub.visible != false) {\n <ax-button-item\n [text]=\"(sub.title | translate | async)!\"\n [color]=\"sub.color\"\n [disabled]=\"sub.disabled\"\n (onClick)=\"executeAction(sub)\"\n >\n <ax-prefix>\n <i class=\"fa-light {{ sub.icon }}\"></i>\n </ax-prefix>\n </ax-button-item>\n @if (sub.break) {\n <div class=\"ax-divider\"></div>\n }\n }\n }\n </ax-button-item-list>\n </ax-dropdown-panel>\n }\n </ax-button>\n }\n }\n }\n }\n </ax-suffix>\n</ax-footer>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXFormModule }, { kind: "ngmodule", type: AXValidationModule }, { kind: "component", type: AXPDynamicFormComponent, selector: "axp-dynamic-form", inputs: ["formDefinition", "context", "layoutLook", "layoutDirection", "layoutConfig"], outputs: ["contextChange", "contextInitiated", "validityChange"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i7.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$2.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: "component", type: i2$2.AXButtonItemComponent, selector: "ax-button-item", inputs: ["color", "disabled", "text", "selected", "divided", "data", "name"], outputs: ["onClick", "onFocus", "onBlur", "disabledChange"] }, { kind: "component", type: i2$2.AXButtonItemListComponent, selector: "ax-button-item-list", inputs: ["items"], outputs: ["onItemClick"] }, { kind: "ngmodule", type: AXDropdownButtonModule }, { kind: "ngmodule", type: AXDropdownModule }, { kind: "component", type: i3$4.AXDropdownPanelComponent, selector: "ax-dropdown-panel", inputs: ["isOpen", "fitParent", "dropdownWidth", "position", "placement", "_target", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "ngmodule", type: AXLoadingModule }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "pipe", type: i5.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1373
|
-
}
|
|
1374
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPDynamicDialogComponent, decorators: [{
|
|
1375
|
-
type: Component,
|
|
1376
|
-
args: [{ selector: 'axp-dynamic-dialog', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
1377
|
-
CommonModule,
|
|
1378
|
-
AXFormModule,
|
|
1379
|
-
AXValidationModule,
|
|
1380
|
-
AXPDynamicFormComponent,
|
|
1381
|
-
AXDecoratorModule,
|
|
1382
|
-
AXButtonModule,
|
|
1383
|
-
AXDropdownButtonModule,
|
|
1384
|
-
AXDropdownModule,
|
|
1385
|
-
AXLoadingModule,
|
|
1386
|
-
AXTranslationModule,
|
|
1387
|
-
], template: "<div class=\"ax-p-4\">\n <axp-dynamic-form\n [formDefinition]=\"config.formDefinition\"\n [context]=\"formContext()\"\n [layoutConfig]=\"config.layoutConfig || defaultLayout()\"\n [layoutLook]=\"'borderless'\"\n [layoutDirection]=\"'vertical'\"\n (contextChange)=\"handleContextChanged($event)\"\n (contextInitiated)=\"handleContextInitiated($event)\"\n >\n </axp-dynamic-form>\n</div>\n\n<ax-footer>\n <ax-prefix>\n <!-- Dynamic footer prefix actions -->\n @if (hasVisibleFooterPrefixActions()) {\n @for (action of footerPrefixActions(); track $index) {\n @if (action.visible != false) {\n <ax-button\n [disabled]=\"action.disabled || isSubmitting()\"\n [text]=\"(action.title | translate | async)!\"\n [look]=\"'outline'\"\n [color]=\"action.color\"\n (onClick)=\"executeAction(action)\"\n >\n <ax-prefix>\n <i class=\"{{ action.icon }}\"></i>\n </ax-prefix>\n @if (action?.items) {\n <ax-dropdown-panel #panel>\n <ax-button-item-list>\n @for (sub of action?.items; track $index) {\n @if (sub.visible != false) {\n <ax-button-item\n [text]=\"(sub.title | translate | async)!\"\n [color]=\"sub.color\"\n [disabled]=\"sub.disabled\"\n (onClick)=\"executeAction(sub)\"\n >\n <ax-prefix>\n <i class=\"fa-light {{ sub.icon }}\"></i>\n </ax-prefix>\n </ax-button-item>\n @if (sub.break) {\n <div class=\"ax-divider\"></div>\n }\n }\n }\n </ax-button-item-list>\n </ax-dropdown-panel>\n }\n </ax-button>\n }\n }\n }\n </ax-prefix>\n <ax-suffix>\n <!-- Dynamic footer suffix actions -->\n @if (hasFooterActions()) {\n <!-- Suffix actions -->\n @if (hasVisibleFooterSuffixActions()) {\n @for (action of footerSuffixActions(); track $index) {\n @if (action.visible != false) {\n <ax-button\n [disabled]=\"action.disabled || isSubmitting()\"\n [text]=\"(action.title | translate | async)!\"\n [look]=\"'solid'\"\n [color]=\"action.color\"\n (onClick)=\"executeAction(action)\"\n >\n <ax-prefix>\n <i class=\"{{ action.icon }}\"></i>\n </ax-prefix>\n @if (action?.items) {\n <ax-dropdown-panel #panel>\n <ax-button-item-list>\n @for (sub of action?.items; track $index) {\n @if (sub.visible != false) {\n <ax-button-item\n [text]=\"(sub.title | translate | async)!\"\n [color]=\"sub.color\"\n [disabled]=\"sub.disabled\"\n (onClick)=\"executeAction(sub)\"\n >\n <ax-prefix>\n <i class=\"fa-light {{ sub.icon }}\"></i>\n </ax-prefix>\n </ax-button-item>\n @if (sub.break) {\n <div class=\"ax-divider\"></div>\n }\n }\n }\n </ax-button-item-list>\n </ax-dropdown-panel>\n }\n </ax-button>\n }\n }\n }\n }\n </ax-suffix>\n</ax-footer>\n" }]
|
|
1388
|
-
}], propDecorators: { config: [{
|
|
1389
|
-
type: Input,
|
|
1390
|
-
args: [{ required: true }]
|
|
1391
|
-
}] } });
|
|
1392
|
-
|
|
1393
|
-
var dynamicDialog_component = /*#__PURE__*/Object.freeze({
|
|
1394
|
-
__proto__: null,
|
|
1395
|
-
AXPDynamicDialogComponent: AXPDynamicDialogComponent
|
|
1396
|
-
});
|
|
1397
|
-
|
|
1398
|
-
class AXPDynamicDialogService {
|
|
1399
|
-
constructor() {
|
|
1400
|
-
this.popupService = inject(AXPopupService);
|
|
1401
|
-
}
|
|
1402
|
-
/**
|
|
1403
|
-
* Show a dynamic dialog with the given configuration
|
|
1404
|
-
* @param config Dialog configuration including fields, validation, and UI options
|
|
1405
|
-
* @returns Promise resolving to dialog result with form values and cancellation status
|
|
1406
|
-
*/
|
|
1407
|
-
async showDialog(config) {
|
|
1408
|
-
const component = await Promise.resolve().then(function () { return dynamicDialog_component; }).then(c => c.AXPDynamicDialogComponent);
|
|
1409
|
-
const result = await this.popupService.open(component, {
|
|
1410
|
-
title: config.title,
|
|
1411
|
-
size: config.size || 'md',
|
|
1412
|
-
closeButton: false,
|
|
1413
|
-
closeOnBackdropClick: false,
|
|
1414
|
-
draggable: false,
|
|
1415
|
-
data: { config }
|
|
1416
|
-
});
|
|
1417
|
-
return result?.data || { context: config.context, cancelled: true };
|
|
1418
|
-
}
|
|
1419
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPDynamicDialogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1420
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPDynamicDialogService, providedIn: 'root' }); }
|
|
1421
|
-
}
|
|
1422
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPDynamicDialogService, decorators: [{
|
|
1423
|
-
type: Injectable,
|
|
1424
|
-
args: [{
|
|
1425
|
-
providedIn: 'root'
|
|
1426
|
-
}]
|
|
1427
|
-
}] });
|
|
1428
|
-
|
|
1429
|
-
//#endregion
|
|
1430
|
-
//#region ---- Injection Tokens ----
|
|
1431
|
-
/**
|
|
1432
|
-
* Injection token to provide available extra property types.
|
|
1433
|
-
*/
|
|
1434
|
-
const AXP_EXTRA_PROPERTY_TYPES = new InjectionToken('AXP_EXTRA_PROPERTY_TYPES');
|
|
1435
|
-
//#endregion
|
|
1436
|
-
|
|
1437
|
-
class AXPExtraPropertiesComponent {
|
|
1438
|
-
constructor() {
|
|
1439
|
-
//#region ---- Inputs ----
|
|
1440
|
-
this.items = input([], ...(ngDevMode ? [{ debugName: "items" }] : []));
|
|
1441
|
-
this.mode = input('edit', ...(ngDevMode ? [{ debugName: "mode" }] : []));
|
|
1442
|
-
//#endregion
|
|
1443
|
-
//#region ---- Outputs ----
|
|
1444
|
-
this.itemsChange = output();
|
|
1445
|
-
//#endregion
|
|
1446
|
-
//#region ---- Services & Dependencies ----
|
|
1447
|
-
this.providedTypes = inject(AXP_EXTRA_PROPERTY_TYPES, { optional: true }) ?? [];
|
|
1448
|
-
this.translationService = inject(AXTranslationService);
|
|
1449
|
-
//#endregion
|
|
1450
|
-
//#region ---- Class Properties ----
|
|
1451
|
-
this.newKey = signal('', ...(ngDevMode ? [{ debugName: "newKey" }] : []));
|
|
1452
|
-
this.newTitle = signal('', ...(ngDevMode ? [{ debugName: "newTitle" }] : []));
|
|
1453
|
-
this.newTypeId = signal('', ...(ngDevMode ? [{ debugName: "newTypeId" }] : []));
|
|
1454
|
-
this.newValue = signal(undefined, ...(ngDevMode ? [{ debugName: "newValue" }] : []));
|
|
1455
|
-
/** Local, ephemeral context for widget rendering */
|
|
1456
|
-
this.internalContext = signal({}, ...(ngDevMode ? [{ debugName: "internalContext" }] : []));
|
|
1457
|
-
this.lastTypeByKey = {};
|
|
1458
|
-
this.draftVersion = signal(0, ...(ngDevMode ? [{ debugName: "draftVersion" }] : []));
|
|
1459
|
-
this.draftKey = computed(() => `__draft__v${this.draftVersion()}`, ...(ngDevMode ? [{ debugName: "draftKey" }] : []));
|
|
1460
|
-
this.typeOptions = computed(() => this.providedTypes, ...(ngDevMode ? [{ debugName: "typeOptions" }] : []));
|
|
1461
|
-
this.presetTypes = computed(() => this.providedTypes.slice(0, 5), ...(ngDevMode ? [{ debugName: "presetTypes" }] : []));
|
|
1462
|
-
this.canAdd = computed(() => {
|
|
1463
|
-
const key = this.newKey()?.trim();
|
|
1464
|
-
const title = this.newTitle()?.trim();
|
|
1465
|
-
const typeId = this.newTypeId();
|
|
1466
|
-
const val = this.newValue();
|
|
1467
|
-
const hasValue = val !== undefined && val !== null && (typeof val !== 'string' || val.trim() !== '');
|
|
1468
|
-
if (!key || !title || !typeId || !hasValue)
|
|
1469
|
-
return false;
|
|
1470
|
-
return !this.items().some((i) => i.key === key);
|
|
1471
|
-
}, ...(ngDevMode ? [{ debugName: "canAdd" }] : []));
|
|
1472
|
-
//#endregion
|
|
1473
|
-
//#region ---- Effects ----
|
|
1474
|
-
/** Sync incoming items' values into internal context for rendering */
|
|
1475
|
-
this.syncContextFromItems = effect(() => {
|
|
1476
|
-
const items = this.items();
|
|
1477
|
-
const current = this.internalContext();
|
|
1478
|
-
const currentExtra = current['extra'] ?? {};
|
|
1479
|
-
const extra = { ...currentExtra };
|
|
1480
|
-
for (const it of items) {
|
|
1481
|
-
if (it.value !== undefined && it.value !== null) {
|
|
1482
|
-
extra[it.key] = it.value;
|
|
1483
|
-
}
|
|
1484
|
-
else if (Object.prototype.hasOwnProperty.call(extra, it.key)) {
|
|
1485
|
-
delete extra[it.key];
|
|
1486
|
-
}
|
|
1487
|
-
}
|
|
1488
|
-
const nextContext = { ...current, extra };
|
|
1489
|
-
if (!isEqual(nextContext, current)) {
|
|
1490
|
-
this.internalContext.set(nextContext);
|
|
1491
|
-
}
|
|
1492
|
-
}, ...(ngDevMode ? [{ debugName: "syncContextFromItems" }] : []));
|
|
1493
|
-
/**
|
|
1494
|
-
* Clear item values when their widget type changes to avoid incompatible stale values
|
|
1495
|
-
*/
|
|
1496
|
-
this.clearValueOnTypeChange = effect(() => {
|
|
1497
|
-
const items = this.items();
|
|
1498
|
-
const changedKeys = new Set();
|
|
1499
|
-
for (const it of items) {
|
|
1500
|
-
const prevType = this.lastTypeByKey[it.key];
|
|
1501
|
-
if (prevType && prevType !== it.type) {
|
|
1502
|
-
changedKeys.add(it.key);
|
|
1503
|
-
}
|
|
1504
|
-
this.lastTypeByKey[it.key] = it.type;
|
|
1505
|
-
}
|
|
1506
|
-
if (changedKeys.size > 0) {
|
|
1507
|
-
const updated = items.map((it) => (changedKeys.has(it.key) ? { ...it, value: undefined } : it));
|
|
1508
|
-
// Reset cached default values for affected nodes
|
|
1509
|
-
changedKeys.forEach((k) => {
|
|
1510
|
-
const node = this.nodeCache[k];
|
|
1511
|
-
if (node) {
|
|
1512
|
-
node.defaultValue = undefined;
|
|
1513
|
-
}
|
|
1514
|
-
});
|
|
1515
|
-
this.itemsChange.emit(updated);
|
|
1516
|
-
}
|
|
1517
|
-
}, ...(ngDevMode ? [{ debugName: "clearValueOnTypeChange" }] : []));
|
|
1518
|
-
this.nodeCache = {};
|
|
1519
|
-
}
|
|
1520
|
-
//#endregion
|
|
1521
|
-
//#region ---- Event Handlers ----
|
|
1522
|
-
onContextChanged(event) {
|
|
1523
|
-
// Ignore initial bootstrapping to prevent cycles
|
|
1524
|
-
if (event.state === 'initiated')
|
|
1525
|
-
return;
|
|
1526
|
-
const data = (event.data ?? {});
|
|
1527
|
-
const extra = data['extra'] ?? {};
|
|
1528
|
-
// sync draft value
|
|
1529
|
-
const dk = this.draftKey();
|
|
1530
|
-
if (Object.prototype.hasOwnProperty.call(extra, dk)) {
|
|
1531
|
-
this.newValue.set(extra[dk]);
|
|
1532
|
-
}
|
|
1533
|
-
const nextItems = this.items().map((it) => ({ ...it, value: extra[it.key] }));
|
|
1534
|
-
if (!isEqual(nextItems, this.items())) {
|
|
1535
|
-
this.itemsChange.emit(nextItems);
|
|
1536
|
-
}
|
|
1537
|
-
}
|
|
1538
|
-
//#endregion
|
|
1539
|
-
//#region ---- Utility Methods ----
|
|
1540
|
-
handleAddItem() {
|
|
1541
|
-
if (!this.canAdd())
|
|
1542
|
-
return;
|
|
1543
|
-
const type = this.typeOptions().find((t) => t.id === this.newTypeId());
|
|
1544
|
-
const next = {
|
|
1545
|
-
key: this.newKey().trim(),
|
|
1546
|
-
title: this.newTitle().trim(),
|
|
1547
|
-
type: this.newTypeId(),
|
|
1548
|
-
value: this.newValue(),
|
|
1549
|
-
options: cloneDeep(type?.defaultOptions ?? {}),
|
|
1550
|
-
};
|
|
1551
|
-
const updated = [...this.items(), next];
|
|
1552
|
-
this.itemsChange.emit(updated);
|
|
1553
|
-
// reset inputs
|
|
1554
|
-
this.newKey.set('');
|
|
1555
|
-
this.newTitle.set('');
|
|
1556
|
-
this.newTypeId.set('');
|
|
1557
|
-
this.newValue.set(undefined);
|
|
1558
|
-
// clear draft from context
|
|
1559
|
-
const ctx = { ...this.internalContext() };
|
|
1560
|
-
const draftExtra = { ...(ctx['extra'] ?? {}) };
|
|
1561
|
-
const dk = this.draftKey();
|
|
1562
|
-
if (Object.prototype.hasOwnProperty.call(draftExtra, dk)) {
|
|
1563
|
-
delete draftExtra[dk];
|
|
1564
|
-
this.internalContext.set({ ...ctx, extra: draftExtra });
|
|
1565
|
-
}
|
|
1566
|
-
}
|
|
1567
|
-
handleRemoveItem(key) {
|
|
1568
|
-
const updated = this.items().filter((i) => i.key !== key);
|
|
1569
|
-
this.itemsChange.emit(updated);
|
|
1570
|
-
// prune context
|
|
1571
|
-
const ctx = { ...this.internalContext() };
|
|
1572
|
-
if (ctx['extra']) {
|
|
1573
|
-
const { [key]: _, ...rest } = ctx['extra'];
|
|
1574
|
-
this.internalContext.set({ ...ctx, ['extra']: rest });
|
|
1575
|
-
}
|
|
1576
|
-
}
|
|
1577
|
-
handleDrop(event) {
|
|
1578
|
-
const arr = [...this.items()];
|
|
1579
|
-
moveItemInArray(arr, event.previousIndex, event.currentIndex);
|
|
1580
|
-
this.itemsChange.emit(arr);
|
|
1581
|
-
}
|
|
1582
|
-
selectPreset(id) {
|
|
1583
|
-
this.newTypeId.set(id);
|
|
1584
|
-
}
|
|
1585
|
-
getNode(item) {
|
|
1586
|
-
const key = item.key;
|
|
1587
|
-
let node = this.nodeCache[key];
|
|
1588
|
-
if (!node) {
|
|
1589
|
-
node = {
|
|
1590
|
-
type: item.type,
|
|
1591
|
-
path: `extra.${item.key}`,
|
|
1592
|
-
options: item.options ?? {},
|
|
1593
|
-
defaultValue: item.value,
|
|
1594
|
-
};
|
|
1595
|
-
this.nodeCache[key] = node;
|
|
1596
|
-
}
|
|
1597
|
-
else {
|
|
1598
|
-
// Keep reference stable; update nested fields if essential changes happen
|
|
1599
|
-
node.type = item.type;
|
|
1600
|
-
node.options = item.options ?? node.options;
|
|
1601
|
-
// Do not overwrite defaultValue during editing to avoid resets
|
|
1602
|
-
}
|
|
1603
|
-
return node;
|
|
1604
|
-
}
|
|
1605
|
-
draftNode() {
|
|
1606
|
-
const typeId = this.newTypeId();
|
|
1607
|
-
const type = this.typeOptions().find((t) => t.id === typeId);
|
|
1608
|
-
let node = this.draftNodeCache;
|
|
1609
|
-
const resolvedType = typeId;
|
|
1610
|
-
if (!node || node.type !== resolvedType) {
|
|
1611
|
-
node = {
|
|
1612
|
-
type: resolvedType,
|
|
1613
|
-
path: `extra.${this.draftKey()}`,
|
|
1614
|
-
options: cloneDeep(type?.defaultOptions ?? {}),
|
|
1615
|
-
defaultValue: this.newValue(),
|
|
1616
|
-
};
|
|
1617
|
-
this.draftNodeCache = node;
|
|
1618
|
-
}
|
|
1619
|
-
else {
|
|
1620
|
-
node.options = cloneDeep(type?.defaultOptions ?? {});
|
|
1621
|
-
}
|
|
1622
|
-
return node;
|
|
1623
|
-
}
|
|
1624
|
-
//#region ---- Utility Helpers ----
|
|
1625
|
-
newTypeChanged(val) {
|
|
1626
|
-
this.newTypeId.set(val);
|
|
1627
|
-
// force draft widget re-render on type change
|
|
1628
|
-
this.draftNodeCache = undefined;
|
|
1629
|
-
// clear draft value from both signal and context to avoid type mismatch
|
|
1630
|
-
const prevDraftKey = this.draftKey();
|
|
1631
|
-
this.newValue.set(undefined);
|
|
1632
|
-
const ctx = { ...this.internalContext() };
|
|
1633
|
-
const draftExtra = { ...(ctx['extra'] ?? {}) };
|
|
1634
|
-
if (Object.prototype.hasOwnProperty.call(draftExtra, prevDraftKey)) {
|
|
1635
|
-
delete draftExtra[prevDraftKey];
|
|
1636
|
-
this.internalContext.set({ ...ctx, extra: draftExtra });
|
|
1637
|
-
}
|
|
1638
|
-
// bump draft version so new draft path is isolated from old widget emissions
|
|
1639
|
-
this.draftVersion.set(this.draftVersion() + 1);
|
|
1640
|
-
const t = this.typeOptions().find((x) => x.id === val);
|
|
1641
|
-
if (t) {
|
|
1642
|
-
const autoTitle = t.title ?? val;
|
|
1643
|
-
const autoKey = this.sanitizeKey(autoTitle);
|
|
1644
|
-
// Only auto-fill when empty
|
|
1645
|
-
if (!this.newTitle()?.trim())
|
|
1646
|
-
this.newTitle.set(autoTitle);
|
|
1647
|
-
// always derive key from title
|
|
1648
|
-
this.newKey.set(autoKey);
|
|
1649
|
-
}
|
|
1650
|
-
}
|
|
1651
|
-
ngOnInit() {
|
|
1652
|
-
// auto-select first item of type list
|
|
1653
|
-
const types = this.typeOptions();
|
|
1654
|
-
if (!this.newTypeId() && types && types.length > 0) {
|
|
1655
|
-
this.newTypeChanged(types[0].id);
|
|
1656
|
-
}
|
|
1657
|
-
}
|
|
1658
|
-
handleTitleChange(val) {
|
|
1659
|
-
this.newTitle.set(val);
|
|
1660
|
-
this.newKey.set(this.sanitizeKey(val));
|
|
1661
|
-
}
|
|
1662
|
-
sanitizeKey(input) {
|
|
1663
|
-
if (!input)
|
|
1664
|
-
return '';
|
|
1665
|
-
// Convert to camelCase, remove invalid chars, ensure starts with letter/_
|
|
1666
|
-
let k = camelCase(String(input));
|
|
1667
|
-
k = k.replace(/[^a-zA-Z0-9_]/g, '');
|
|
1668
|
-
if (!/^[a-zA-Z_]/.test(k))
|
|
1669
|
-
k = `_${k}`;
|
|
1670
|
-
// enforce uniqueness by suffixing if needed
|
|
1671
|
-
const exists = (candidate) => this.items().some((i) => i.key === candidate);
|
|
1672
|
-
if (!exists(k))
|
|
1673
|
-
return k;
|
|
1674
|
-
let i = 1;
|
|
1675
|
-
while (exists(`${k}${i}`))
|
|
1676
|
-
i++;
|
|
1677
|
-
return `${k}${i}`;
|
|
1678
|
-
}
|
|
1679
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPExtraPropertiesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1680
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: AXPExtraPropertiesComponent, isStandalone: true, selector: "axp-extra-properties", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemsChange: "itemsChange" }, host: { classAttribute: "ax-block ax-flex-1" }, ngImport: i0, template: `
|
|
1681
|
-
<div class="ax-grid ax-grid-cols-12 ax-gap-4">
|
|
1682
|
-
<axp-widgets-container [context]="internalContext()" (onContextChanged)="onContextChanged($event)">
|
|
1683
|
-
<div cdkDropList (cdkDropListDropped)="handleDrop($event)" class="ax-col-span-12 ax-flex ax-flex-col ax-gap-3">
|
|
1684
|
-
@for(item of items(); track item.key){
|
|
1685
|
-
@if(mode()==='edit'){
|
|
1686
|
-
<div class="ax-grid ax-grid-cols-12 ax-gap-4 ax-items-center" cdkDrag [cdkDragDisabled]="false">
|
|
1687
|
-
<div class="ax-col-span-12 md:ax-col-span-3 ax-flex ax-items-center ax-gap-3">
|
|
1688
|
-
<ax-icon class="fa-solid fa-grip-dots-vertical ax-cursor-move ax-text-neutral-500" cdkDragHandle></ax-icon>
|
|
1689
|
-
<div>
|
|
1690
|
-
<div class="ax-font-semibold">{{item.title}}</div>
|
|
1691
|
-
</div>
|
|
1692
|
-
<!-- Small-screen delete aligned with title -->
|
|
1693
|
-
<ax-button class="ax-ml-auto md:ax-hidden" look="blank" color="danger" (onClick)="handleRemoveItem(item.key)">
|
|
1694
|
-
<ax-prefix><ax-icon class="fa-light fa-trash-can"></ax-icon></ax-prefix>
|
|
1695
|
-
</ax-button>
|
|
1696
|
-
</div>
|
|
1697
|
-
<div class="ax-col-span-12 md:ax-col-span-8">
|
|
1698
|
-
<ng-container
|
|
1699
|
-
axp-widget-renderer
|
|
1700
|
-
[node]="getNode(item)"
|
|
1701
|
-
[mode]="'edit'"
|
|
1702
|
-
></ng-container>
|
|
1703
|
-
</div>
|
|
1704
|
-
<div class="ax-hidden md:ax-block md:ax-col-span-1 md:ax-justify-self-end">
|
|
1705
|
-
<ax-button look="blank" color="danger" (onClick)="handleRemoveItem(item.key)">
|
|
1706
|
-
<ax-prefix><ax-icon class="fa-light fa-trash-can"></ax-icon></ax-prefix>
|
|
1707
|
-
</ax-button>
|
|
1708
|
-
</div>
|
|
1709
|
-
</div>
|
|
1710
|
-
} @else {
|
|
1711
|
-
<div class="ax-grid ax-grid-cols-12 ax-gap-1">
|
|
1712
|
-
<div class="ax-font-semibold">{{item.title}}</div>
|
|
1713
|
-
<div class="ax-col-span-12 ax-text-muted">
|
|
1714
|
-
<ng-container
|
|
1715
|
-
axp-widget-renderer
|
|
1716
|
-
[node]="getNode(item)"
|
|
1717
|
-
[mode]="'view'"
|
|
1718
|
-
></ng-container>
|
|
1719
|
-
</div>
|
|
1720
|
-
</div>
|
|
1721
|
-
}
|
|
1722
|
-
} @empty {
|
|
1723
|
-
<div class="ax-col-span-12 ax-text-sm ax-text-gray-400">
|
|
1724
|
-
{{ 'extra-properties:messages.no-extra-properties' | translate | async }}
|
|
1725
|
-
</div>
|
|
1726
|
-
}
|
|
1727
|
-
@if(mode()==='edit'){
|
|
1728
|
-
<div class="ax-grid ax-grid-cols-12 ax-gap-4 ax-items-end ax-mt-4 ax-border-t ax-border-dashed ax-pt-4">
|
|
1729
|
-
<!-- Type -->
|
|
1730
|
-
<ax-form-field class="ax-col-span-12 md:ax-col-span-6 lg:ax-col-span-3">
|
|
1731
|
-
<ax-label>{{ 'extra-properties:labels.type' | translate | async }}</ax-label>
|
|
1732
|
-
<ax-select-box
|
|
1733
|
-
[value]="newTypeId()"
|
|
1734
|
-
[dataSource]="typeOptions()"
|
|
1735
|
-
valueField="id"
|
|
1736
|
-
textField="title"
|
|
1737
|
-
(onValueChanged)="newTypeChanged($event.value)"
|
|
1738
|
-
></ax-select-box>
|
|
1739
|
-
</ax-form-field>
|
|
1740
|
-
<!-- Title -->
|
|
1741
|
-
<ax-form-field class="ax-col-span-12 md:ax-col-span-6 lg:ax-col-span-5">
|
|
1742
|
-
<ax-label>{{ 'extra-properties:labels.title' | translate | async }}</ax-label>
|
|
1743
|
-
<ax-text-box [ngModel]="newTitle()" (onValueChanged)="handleTitleChange($event.value)"></ax-text-box>
|
|
1744
|
-
</ax-form-field>
|
|
1745
|
-
<!-- Value -->
|
|
1746
|
-
@if(newTypeId()){
|
|
1747
|
-
<ax-form-field class="ax-col-span-12 md:ax-col-span-6 lg:ax-col-span-4">
|
|
1748
|
-
<ax-label>{{ 'extra-properties:labels.value' | translate | async }}</ax-label>
|
|
1749
|
-
<div (keydown.enter)="handleAddItem()">
|
|
1750
|
-
<ng-container
|
|
1751
|
-
axp-widget-renderer
|
|
1752
|
-
[node]="draftNode()"
|
|
1753
|
-
[mode]="'edit'"
|
|
1754
|
-
></ng-container>
|
|
1755
|
-
</div>
|
|
1756
|
-
</ax-form-field>
|
|
1757
|
-
}
|
|
1758
|
-
<!-- Add moved to bottom (same as before) -->
|
|
1759
|
-
<div class="ax-col-span-12 ax-flex ax-justify-end">
|
|
1760
|
-
<ax-button look="solid" (onClick)="handleAddItem()" [disabled]="!canAdd()" text="{{ 'extra-properties:actions.add-field' | translate | async }}">
|
|
1761
|
-
<ax-prefix><ax-icon class="fa-solid fa-add"></ax-icon></ax-prefix>
|
|
1762
|
-
</ax-button>
|
|
1763
|
-
</div>
|
|
1764
|
-
</div>
|
|
1765
|
-
}
|
|
1766
|
-
</div>
|
|
1767
|
-
</axp-widgets-container>
|
|
1768
|
-
</div>
|
|
1769
|
-
|
|
1770
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: AXFormModule }, { kind: "component", type: i2$1.AXFormFieldComponent, selector: "ax-form-field", inputs: ["labelMode"] }, { kind: "ngmodule", type: AXLabelModule }, { kind: "component", type: i3$2.AXLabelComponent, selector: "ax-label", inputs: ["required", "for"], outputs: ["requiredChange"] }, { kind: "ngmodule", type: AXTextBoxModule }, { kind: "component", type: i4$1.AXTextBoxComponent, selector: "ax-text-box", inputs: ["disabled", "tabIndex", "readonly", "value", "state", "name", "id", "placeholder", "maxLength", "allowNull", "type", "autoComplete", "look", "mask-options", "class"], outputs: ["onBlur", "onFocus", "valueChange", "stateChange", "onValueChanged", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "ngmodule", type: AXSelectBoxModule }, { kind: "component", type: i5$2.AXSelectBoxComponent, selector: "ax-select-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "minValue", "maxValue", "value", "state", "name", "id", "type", "look", "multiple", "valueField", "textField", "disabledField", "textTemplate", "selectedItems", "isItemTruncated", "showItemTooltip", "dataSource", "minRecordsForSearch", "caption", "itemTemplate", "selectedTemplate", "emptyTemplate", "loadingTemplate", "dropdownWidth", "searchBoxAutoFocus"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onOpened", "onClosed", "onItemSelected", "onItemClick"] }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i2$2.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: AXDecoratorModule }, { kind: "component", type: i7.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i7.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: AXPLayoutBuilderModule }, { kind: "component", type: i3$3.AXPWidgetContainerComponent, selector: "axp-widgets-container", inputs: ["context", "functions"], outputs: ["onContextChanged"] }, { kind: "directive", type: i3$3.AXPWidgetRendererDirective, selector: "[axp-widget-renderer]", inputs: ["parentNode", "index", "mode", "node"], outputs: ["onOptionsChanged", "onValueChanged"], exportAs: ["widgetRenderer"] }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i9.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i9.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i9.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "pipe", type: i5.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1771
|
-
}
|
|
1772
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPExtraPropertiesComponent, decorators: [{
|
|
1773
|
-
type: Component,
|
|
1774
|
-
args: [{
|
|
1775
|
-
selector: 'axp-extra-properties',
|
|
1776
|
-
template: `
|
|
1777
|
-
<div class="ax-grid ax-grid-cols-12 ax-gap-4">
|
|
1778
|
-
<axp-widgets-container [context]="internalContext()" (onContextChanged)="onContextChanged($event)">
|
|
1779
|
-
<div cdkDropList (cdkDropListDropped)="handleDrop($event)" class="ax-col-span-12 ax-flex ax-flex-col ax-gap-3">
|
|
1780
|
-
@for(item of items(); track item.key){
|
|
1781
|
-
@if(mode()==='edit'){
|
|
1782
|
-
<div class="ax-grid ax-grid-cols-12 ax-gap-4 ax-items-center" cdkDrag [cdkDragDisabled]="false">
|
|
1783
|
-
<div class="ax-col-span-12 md:ax-col-span-3 ax-flex ax-items-center ax-gap-3">
|
|
1784
|
-
<ax-icon class="fa-solid fa-grip-dots-vertical ax-cursor-move ax-text-neutral-500" cdkDragHandle></ax-icon>
|
|
1785
|
-
<div>
|
|
1786
|
-
<div class="ax-font-semibold">{{item.title}}</div>
|
|
1787
|
-
</div>
|
|
1788
|
-
<!-- Small-screen delete aligned with title -->
|
|
1789
|
-
<ax-button class="ax-ml-auto md:ax-hidden" look="blank" color="danger" (onClick)="handleRemoveItem(item.key)">
|
|
1790
|
-
<ax-prefix><ax-icon class="fa-light fa-trash-can"></ax-icon></ax-prefix>
|
|
1791
|
-
</ax-button>
|
|
1792
|
-
</div>
|
|
1793
|
-
<div class="ax-col-span-12 md:ax-col-span-8">
|
|
1794
|
-
<ng-container
|
|
1795
|
-
axp-widget-renderer
|
|
1796
|
-
[node]="getNode(item)"
|
|
1797
|
-
[mode]="'edit'"
|
|
1798
|
-
></ng-container>
|
|
1799
|
-
</div>
|
|
1800
|
-
<div class="ax-hidden md:ax-block md:ax-col-span-1 md:ax-justify-self-end">
|
|
1801
|
-
<ax-button look="blank" color="danger" (onClick)="handleRemoveItem(item.key)">
|
|
1802
|
-
<ax-prefix><ax-icon class="fa-light fa-trash-can"></ax-icon></ax-prefix>
|
|
1803
|
-
</ax-button>
|
|
1804
|
-
</div>
|
|
1805
|
-
</div>
|
|
1806
|
-
} @else {
|
|
1807
|
-
<div class="ax-grid ax-grid-cols-12 ax-gap-1">
|
|
1808
|
-
<div class="ax-font-semibold">{{item.title}}</div>
|
|
1809
|
-
<div class="ax-col-span-12 ax-text-muted">
|
|
1810
|
-
<ng-container
|
|
1811
|
-
axp-widget-renderer
|
|
1812
|
-
[node]="getNode(item)"
|
|
1813
|
-
[mode]="'view'"
|
|
1814
|
-
></ng-container>
|
|
1815
|
-
</div>
|
|
1816
|
-
</div>
|
|
1817
|
-
}
|
|
1818
|
-
} @empty {
|
|
1819
|
-
<div class="ax-col-span-12 ax-text-sm ax-text-gray-400">
|
|
1820
|
-
{{ 'extra-properties:messages.no-extra-properties' | translate | async }}
|
|
1821
|
-
</div>
|
|
1822
|
-
}
|
|
1823
|
-
@if(mode()==='edit'){
|
|
1824
|
-
<div class="ax-grid ax-grid-cols-12 ax-gap-4 ax-items-end ax-mt-4 ax-border-t ax-border-dashed ax-pt-4">
|
|
1825
|
-
<!-- Type -->
|
|
1826
|
-
<ax-form-field class="ax-col-span-12 md:ax-col-span-6 lg:ax-col-span-3">
|
|
1827
|
-
<ax-label>{{ 'extra-properties:labels.type' | translate | async }}</ax-label>
|
|
1828
|
-
<ax-select-box
|
|
1829
|
-
[value]="newTypeId()"
|
|
1830
|
-
[dataSource]="typeOptions()"
|
|
1831
|
-
valueField="id"
|
|
1832
|
-
textField="title"
|
|
1833
|
-
(onValueChanged)="newTypeChanged($event.value)"
|
|
1834
|
-
></ax-select-box>
|
|
1835
|
-
</ax-form-field>
|
|
1836
|
-
<!-- Title -->
|
|
1837
|
-
<ax-form-field class="ax-col-span-12 md:ax-col-span-6 lg:ax-col-span-5">
|
|
1838
|
-
<ax-label>{{ 'extra-properties:labels.title' | translate | async }}</ax-label>
|
|
1839
|
-
<ax-text-box [ngModel]="newTitle()" (onValueChanged)="handleTitleChange($event.value)"></ax-text-box>
|
|
1840
|
-
</ax-form-field>
|
|
1841
|
-
<!-- Value -->
|
|
1842
|
-
@if(newTypeId()){
|
|
1843
|
-
<ax-form-field class="ax-col-span-12 md:ax-col-span-6 lg:ax-col-span-4">
|
|
1844
|
-
<ax-label>{{ 'extra-properties:labels.value' | translate | async }}</ax-label>
|
|
1845
|
-
<div (keydown.enter)="handleAddItem()">
|
|
1846
|
-
<ng-container
|
|
1847
|
-
axp-widget-renderer
|
|
1848
|
-
[node]="draftNode()"
|
|
1849
|
-
[mode]="'edit'"
|
|
1850
|
-
></ng-container>
|
|
1851
|
-
</div>
|
|
1852
|
-
</ax-form-field>
|
|
1853
|
-
}
|
|
1854
|
-
<!-- Add moved to bottom (same as before) -->
|
|
1855
|
-
<div class="ax-col-span-12 ax-flex ax-justify-end">
|
|
1856
|
-
<ax-button look="solid" (onClick)="handleAddItem()" [disabled]="!canAdd()" text="{{ 'extra-properties:actions.add-field' | translate | async }}">
|
|
1857
|
-
<ax-prefix><ax-icon class="fa-solid fa-add"></ax-icon></ax-prefix>
|
|
1858
|
-
</ax-button>
|
|
1859
|
-
</div>
|
|
1860
|
-
</div>
|
|
1861
|
-
}
|
|
1862
|
-
</div>
|
|
1863
|
-
</axp-widgets-container>
|
|
1864
|
-
</div>
|
|
1865
|
-
|
|
1866
|
-
`,
|
|
1867
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1868
|
-
imports: [
|
|
1869
|
-
CommonModule,
|
|
1870
|
-
FormsModule,
|
|
1871
|
-
AXFormModule,
|
|
1872
|
-
AXLabelModule,
|
|
1873
|
-
AXTextBoxModule,
|
|
1874
|
-
AXSelectBoxModule,
|
|
1875
|
-
AXButtonModule,
|
|
1876
|
-
AXDecoratorModule,
|
|
1877
|
-
AXPLayoutBuilderModule,
|
|
1878
|
-
DragDropModule,
|
|
1879
|
-
AXTranslationModule,
|
|
1880
|
-
//AXPGridLayoutDirective,
|
|
1881
|
-
],
|
|
1882
|
-
standalone: true,
|
|
1883
|
-
host: {
|
|
1884
|
-
class: 'ax-block ax-flex-1',
|
|
1885
|
-
},
|
|
1886
|
-
}]
|
|
1887
|
-
}] });
|
|
1888
|
-
|
|
1889
|
-
class AXPWidgetPropertyViewerComponent {
|
|
1890
|
-
constructor() {
|
|
1891
|
-
this.widget = input.required(...(ngDevMode ? [{ debugName: "widget" }] : []));
|
|
1892
|
-
this.mode = input('simple', ...(ngDevMode ? [{ debugName: "mode" }] : []));
|
|
1893
|
-
this.widgetRegistryService = inject(AXPWidgetRegistryService);
|
|
1894
|
-
// Designer connector removed to avoid cross-entry circular dependency
|
|
1895
|
-
this.currentTabIndex = signal(0, ...(ngDevMode ? [{ debugName: "currentTabIndex" }] : []));
|
|
1896
|
-
this.config = signal(null, ...(ngDevMode ? [{ debugName: "config" }] : []));
|
|
1897
|
-
this.allPoperties = [];
|
|
1898
|
-
this.tabs = signal([], ...(ngDevMode ? [{ debugName: "tabs" }] : []));
|
|
1899
|
-
this.groups = computed(() => {
|
|
1900
|
-
return this.tabs().length ? this.tabs()[this.currentTabIndex()].groups : [];
|
|
1901
|
-
}, ...(ngDevMode ? [{ debugName: "groups" }] : []));
|
|
1902
|
-
this.groupCollapsedStates = new Map();
|
|
1903
|
-
this.onChanged = new EventEmitter();
|
|
1904
|
-
this.context = signal({}, ...(ngDevMode ? [{ debugName: "context" }] : []));
|
|
1905
|
-
this.initialContext = {};
|
|
1906
|
-
effect(() => {
|
|
1907
|
-
if (!this.widget())
|
|
1908
|
-
return;
|
|
1909
|
-
const config = this.widgetRegistryService.resolve(this.widget()?.type);
|
|
1910
|
-
if (config) {
|
|
1911
|
-
this.initialContext = {};
|
|
1912
|
-
this.config.set(config);
|
|
1913
|
-
this.fillTabs();
|
|
1914
|
-
}
|
|
1915
|
-
else {
|
|
1916
|
-
console.error(`Invalid widget name: ${this.widget()}`);
|
|
1917
|
-
}
|
|
1918
|
-
});
|
|
1919
|
-
}
|
|
1920
|
-
update(values) {
|
|
1921
|
-
this.context.set(merge(cloneDeep(this.context()), values));
|
|
1922
|
-
}
|
|
1923
|
-
fillTabs() {
|
|
1924
|
-
const tabs = [
|
|
1925
|
-
{
|
|
1926
|
-
name: 'general',
|
|
1927
|
-
title: 'General',
|
|
1928
|
-
groups: [],
|
|
1929
|
-
},
|
|
1930
|
-
];
|
|
1931
|
-
Object.entries(this.config()?.components ?? {}).forEach((c) => {
|
|
1932
|
-
if (c[1].component != null && c[1].properties?.length) {
|
|
1933
|
-
tabs.push({ name: c[0], title: capitalize(c[0]), groups: [] });
|
|
1934
|
-
}
|
|
1935
|
-
});
|
|
1936
|
-
///
|
|
1937
|
-
this.allPoperties = [];
|
|
1938
|
-
///
|
|
1939
|
-
tabs.forEach((tab) => {
|
|
1940
|
-
const props = tab.name == 'general'
|
|
1941
|
-
? (this.config()?.properties ?? [])
|
|
1942
|
-
: ((this.config()?.components)[tab.name]?.properties ?? []);
|
|
1943
|
-
//
|
|
1944
|
-
const visibleProps = props.filter((c) => c.visible != false);
|
|
1945
|
-
this.allPoperties.push(...props);
|
|
1946
|
-
tab.groups = unionBy(sortBy(visibleProps.map((pg) => ({
|
|
1947
|
-
isCollapsed: !!this.groupCollapsedStates.get(pg.group.name),
|
|
1948
|
-
name: pg.group.name,
|
|
1949
|
-
title: pg.group.title,
|
|
1950
|
-
props: sortBy(visibleProps.filter((p) => p.group.name == pg.group.name && pg.visible), ['order', 'title']),
|
|
1951
|
-
})), ['order', 'title']), 'name').filter((c) => c.props.length);
|
|
1952
|
-
});
|
|
1953
|
-
this.tabs.set(tabs.filter((c) => c.groups.length));
|
|
1954
|
-
//
|
|
1955
|
-
this.initialContext = this.allPoperties
|
|
1956
|
-
.filter((c) => (!isArray(c.schema.defaultValue) && !isNil(c.schema.defaultValue)) ||
|
|
1957
|
-
(isArray(c.schema.defaultValue) && !isEmpty(c.schema.defaultValue)))
|
|
1958
|
-
.reduce((acc, c) => {
|
|
1959
|
-
set(acc, c.schema.interface.path, c.schema.defaultValue);
|
|
1960
|
-
return acc;
|
|
1961
|
-
}, {});
|
|
1962
|
-
//
|
|
1963
|
-
untracked(() => {
|
|
1964
|
-
this.context.set(merge(cloneDeep(this.initialContext), this.widget()));
|
|
1965
|
-
this.onChanged.emit({ values: this.context(), mode: 'init' });
|
|
1966
|
-
});
|
|
1967
|
-
}
|
|
1968
|
-
handleContextChange(e) {
|
|
1969
|
-
untracked(() => {
|
|
1970
|
-
this.context.set(e.data);
|
|
1971
|
-
this.onChanged.emit({ values: this.context(), mode: e.state == 'initiated' ? 'init' : 'update' });
|
|
1972
|
-
});
|
|
1973
|
-
}
|
|
1974
|
-
handleTabChange(event) {
|
|
1975
|
-
const indx = event.index;
|
|
1976
|
-
if (this.currentTabIndex() != indx) {
|
|
1977
|
-
this.currentTabIndex.set(indx);
|
|
1978
|
-
}
|
|
1979
|
-
}
|
|
1980
|
-
handleCollapsedChange(group, collapsed) {
|
|
1981
|
-
this.groupCollapsedStates.set(group, collapsed);
|
|
1982
|
-
}
|
|
1983
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPWidgetPropertyViewerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1984
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: AXPWidgetPropertyViewerComponent, isStandalone: true, selector: "axp-widget-property-viewer", inputs: { widget: { classPropertyName: "widget", publicName: "widget", isSignal: true, isRequired: true, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onChanged: "onChanged" }, ngImport: i0, template: "<axp-widgets-container [context]=\"context()\" (onContextChanged)=\"handleContextChange($event)\">\n @if (mode() == 'advanced') {\n <div class=\"ax-flex ax-flex-col\">\n @if (tabs().length > 1) {\n <div class=\"ax-pb-2\">\n <ax-tabs look=\"default\" (onActiveTabChanged)=\"handleTabChange($event)\" [look]=\"'with-line'\">\n @for (tab of tabs(); track $index) {\n <ax-tab-item [text]=\"tab.title\" [key]=\"$index.toString()\" [active]=\"currentTabIndex() === $index\">\n </ax-tab-item>\n }\n </ax-tabs>\n </div>\n }\n <div class=\"ax-flex-1 ax-overflow-auto\">\n <ax-collapse-group class=\"ax-h-fit\" [look]=\"'flat'\">\n @for (group of groups(); track $index) {\n <ax-collapse\n class=\"!ax-mb-0\"\n [caption]=\"group.title\"\n [(isCollapsed)]=\"group.isCollapsed\"\n (isCollapsedChange)=\"handleCollapsedChange(group.name, $event)\"\n >\n <div class=\"ax-flex ax-flex-col\">\n @for (p of group.props; track $index) {\n <div class=\"ax-flex ax-flex-col ax-gap-1 ax-py-2\">\n <span class=\"ax-font-semibold\">{{ p.title }}</span>\n @if (p.schema.interface) {\n <ng-container axp-widget-renderer [node]=\"p.schema.interface\" [mode]=\"'edit'\"> </ng-container>\n }\n </div>\n }\n </div>\n </ax-collapse>\n }\n </ax-collapse-group>\n </div>\n </div>\n }\n <!-- Simple-->\n @else {\n <div class=\"ax-flex ax-flex-col ax-p-4 ax-gap-4\">\n <!-- groups -->\n @for (group of groups(); track $index) {\n <!-- props -->\n @for (p of group.props; track $index) {\n <div class=\"ax-flex ax-flex-col ax-gap-2\">\n <span class=\"ax-font-semibold\">{{ p.title | translate | async }}</span>\n @if (p.schema.interface) {\n <ng-container axp-widget-renderer [node]=\"p.schema.interface\" [mode]=\"'edit'\"> </ng-container>\n }\n </div>\n }\n }\n </div>\n }\n</axp-widgets-container>\n", styles: [":host ax-collapse .ax-collapse-header{font-weight:600}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXCollapseModule }, { kind: "component", type: i1$1.AXCollapseComponent, selector: "ax-collapse", inputs: ["disabled", "look", "isCollapsed", "showHeader", "caption", "icon", "isLoading", "headerTemplate"], outputs: ["onClick", "isCollapsedChange"] }, { kind: "component", type: i1$1.AXCollapseGroupComponent, selector: "ax-collapse-group", inputs: ["look", "accordion", "activeIndex"], outputs: ["accordionChange", "activeIndexChange"] }, { kind: "ngmodule", type: AXTabsModule }, { kind: "component", type: i2$3.AXTabsComponent, selector: "ax-tabs", inputs: ["look", "location", "fitParent", "minWidth", "content"], outputs: ["onActiveTabChanged"] }, { kind: "component", type: i2$3.AXTabItemComponent, selector: "ax-tab-item", inputs: ["disabled", "text", "key", "headerTemplate", "active"], outputs: ["disabledChange", "onClick", "onBlur", "onFocus", "activeChange"] }, { kind: "ngmodule", type: AXPLayoutBuilderModule }, { kind: "component", type: i3$3.AXPWidgetContainerComponent, selector: "axp-widgets-container", inputs: ["context", "functions"], outputs: ["onContextChanged"] }, { kind: "directive", type: i3$3.AXPWidgetRendererDirective, selector: "[axp-widget-renderer]", inputs: ["parentNode", "index", "mode", "node"], outputs: ["onOptionsChanged", "onValueChanged"], exportAs: ["widgetRenderer"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "pipe", type: i5.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1985
|
-
}
|
|
1986
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPWidgetPropertyViewerComponent, decorators: [{
|
|
1987
|
-
type: Component,
|
|
1988
|
-
args: [{ selector: 'axp-widget-property-viewer', changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule, AXCollapseModule, AXTabsModule, AXPLayoutBuilderModule, AXTranslationModule], template: "<axp-widgets-container [context]=\"context()\" (onContextChanged)=\"handleContextChange($event)\">\n @if (mode() == 'advanced') {\n <div class=\"ax-flex ax-flex-col\">\n @if (tabs().length > 1) {\n <div class=\"ax-pb-2\">\n <ax-tabs look=\"default\" (onActiveTabChanged)=\"handleTabChange($event)\" [look]=\"'with-line'\">\n @for (tab of tabs(); track $index) {\n <ax-tab-item [text]=\"tab.title\" [key]=\"$index.toString()\" [active]=\"currentTabIndex() === $index\">\n </ax-tab-item>\n }\n </ax-tabs>\n </div>\n }\n <div class=\"ax-flex-1 ax-overflow-auto\">\n <ax-collapse-group class=\"ax-h-fit\" [look]=\"'flat'\">\n @for (group of groups(); track $index) {\n <ax-collapse\n class=\"!ax-mb-0\"\n [caption]=\"group.title\"\n [(isCollapsed)]=\"group.isCollapsed\"\n (isCollapsedChange)=\"handleCollapsedChange(group.name, $event)\"\n >\n <div class=\"ax-flex ax-flex-col\">\n @for (p of group.props; track $index) {\n <div class=\"ax-flex ax-flex-col ax-gap-1 ax-py-2\">\n <span class=\"ax-font-semibold\">{{ p.title }}</span>\n @if (p.schema.interface) {\n <ng-container axp-widget-renderer [node]=\"p.schema.interface\" [mode]=\"'edit'\"> </ng-container>\n }\n </div>\n }\n </div>\n </ax-collapse>\n }\n </ax-collapse-group>\n </div>\n </div>\n }\n <!-- Simple-->\n @else {\n <div class=\"ax-flex ax-flex-col ax-p-4 ax-gap-4\">\n <!-- groups -->\n @for (group of groups(); track $index) {\n <!-- props -->\n @for (p of group.props; track $index) {\n <div class=\"ax-flex ax-flex-col ax-gap-2\">\n <span class=\"ax-font-semibold\">{{ p.title | translate | async }}</span>\n @if (p.schema.interface) {\n <ng-container axp-widget-renderer [node]=\"p.schema.interface\" [mode]=\"'edit'\"> </ng-container>\n }\n </div>\n }\n }\n </div>\n }\n</axp-widgets-container>\n", styles: [":host ax-collapse .ax-collapse-header{font-weight:600}\n"] }]
|
|
1989
|
-
}], ctorParameters: () => [], propDecorators: { onChanged: [{
|
|
1990
|
-
type: Output
|
|
1991
|
-
}] } });
|
|
1992
|
-
|
|
1993
|
-
class AXPExtraPropertiesSchemaComponent {
|
|
1994
|
-
constructor() {
|
|
1995
|
-
//#region ---- Inputs ----
|
|
1996
|
-
this.schema = input([], ...(ngDevMode ? [{ debugName: "schema" }] : []));
|
|
1997
|
-
this.mode = input('edit', ...(ngDevMode ? [{ debugName: "mode" }] : []));
|
|
1998
|
-
//#endregion
|
|
1999
|
-
//#region ---- Outputs ----
|
|
2000
|
-
this.schemaChange = output();
|
|
2001
|
-
//#endregion
|
|
2002
|
-
//#region ---- Services & Dependencies ----
|
|
2003
|
-
this.providedTypes = inject(AXP_EXTRA_PROPERTY_TYPES, { optional: true }) ?? [];
|
|
2004
|
-
this.translationService = inject(AXTranslationService);
|
|
2005
|
-
//#endregion
|
|
2006
|
-
//#region ---- Class Properties ----
|
|
2007
|
-
this.newTitle = signal('', ...(ngDevMode ? [{ debugName: "newTitle" }] : []));
|
|
2008
|
-
this.newTypeId = signal('', ...(ngDevMode ? [{ debugName: "newTypeId" }] : []));
|
|
2009
|
-
this.typeOptions = computed(() => this.providedTypes, ...(ngDevMode ? [{ debugName: "typeOptions" }] : []));
|
|
2010
|
-
this.canAdd = computed(() => {
|
|
2011
|
-
const title = this.newTitle()?.trim();
|
|
2012
|
-
const typeId = this.newTypeId();
|
|
2013
|
-
const key = this.deriveKey(title);
|
|
2014
|
-
if (!key || !title || !typeId)
|
|
2015
|
-
return false;
|
|
2016
|
-
return !this.schema().some((i) => i.key === key);
|
|
2017
|
-
}, ...(ngDevMode ? [{ debugName: "canAdd" }] : []));
|
|
2018
|
-
// Selection state for right panel editor
|
|
2019
|
-
this.selectedKey = signal(null, ...(ngDevMode ? [{ debugName: "selectedKey" }] : []));
|
|
2020
|
-
this.selectedItem = computed(() => this.schema().find((i) => i.key === this.selectedKey()) ?? null, ...(ngDevMode ? [{ debugName: "selectedItem" }] : []));
|
|
2021
|
-
// Auto-select first item when schema changes or current selection removed
|
|
2022
|
-
effect(() => {
|
|
2023
|
-
const items = this.schema();
|
|
2024
|
-
const current = this.selectedKey();
|
|
2025
|
-
if (!items.length) {
|
|
2026
|
-
if (current !== null)
|
|
2027
|
-
this.selectedKey.set(null);
|
|
2028
|
-
return;
|
|
2029
|
-
}
|
|
2030
|
-
if (!current || !items.some((i) => i.key === current)) {
|
|
2031
|
-
this.selectedKey.set(items[0].key);
|
|
2032
|
-
}
|
|
2033
|
-
});
|
|
2034
|
-
}
|
|
2035
|
-
//#endregion
|
|
2036
|
-
//#region ---- Utility Methods ----
|
|
2037
|
-
handleAdd() {
|
|
2038
|
-
if (!this.canAdd())
|
|
2039
|
-
return;
|
|
2040
|
-
const type = this.typeOptions().find((t) => t.id === this.newTypeId());
|
|
2041
|
-
const title = this.newTitle().trim();
|
|
2042
|
-
const key = this.deriveKey(title);
|
|
2043
|
-
const next = {
|
|
2044
|
-
key,
|
|
2045
|
-
title,
|
|
2046
|
-
type: this.newTypeId(),
|
|
2047
|
-
options: cloneDeep(type?.defaultOptions ?? {}),
|
|
2048
|
-
};
|
|
2049
|
-
const updated = [...this.schema(), next];
|
|
2050
|
-
this.schemaChange.emit(updated);
|
|
2051
|
-
this.newTitle.set('');
|
|
2052
|
-
this.newTypeId.set('');
|
|
2053
|
-
// select newly added item
|
|
2054
|
-
this.selectedKey.set(key);
|
|
2055
|
-
}
|
|
2056
|
-
handleRemove(key) {
|
|
2057
|
-
const updated = this.schema().filter((i) => i.key !== key);
|
|
2058
|
-
this.schemaChange.emit(updated);
|
|
2059
|
-
if (this.selectedKey() === key) {
|
|
2060
|
-
this.selectedKey.set(updated.length ? updated[0].key : null);
|
|
2061
|
-
}
|
|
2062
|
-
}
|
|
2063
|
-
handleDrop(event) {
|
|
2064
|
-
const arr = [...this.schema()];
|
|
2065
|
-
moveItemInArray(arr, event.previousIndex, event.currentIndex);
|
|
2066
|
-
this.schemaChange.emit(arr);
|
|
2067
|
-
}
|
|
2068
|
-
handleUpdateTitle(key, title) {
|
|
2069
|
-
const updated = this.schema().map((it) => (it.key === key ? { ...it, title } : it));
|
|
2070
|
-
this.schemaChange.emit(updated);
|
|
2071
|
-
}
|
|
2072
|
-
handleUpdateType(key, typeId) {
|
|
2073
|
-
const type = this.typeOptions().find((t) => t.id === typeId);
|
|
2074
|
-
const updated = this.schema().map((it) => it.key === key ? { ...it, type: typeId, options: cloneDeep(type?.defaultOptions ?? {}) } : it);
|
|
2075
|
-
this.schemaChange.emit(updated);
|
|
2076
|
-
}
|
|
2077
|
-
newTypeChanged(val) {
|
|
2078
|
-
this.newTypeId.set(val);
|
|
2079
|
-
const t = this.typeOptions().find((x) => x.id === val);
|
|
2080
|
-
if (t) {
|
|
2081
|
-
const autoTitle = t.title ?? val;
|
|
2082
|
-
if (!this.newTitle()?.trim())
|
|
2083
|
-
this.newTitle.set(autoTitle);
|
|
2084
|
-
}
|
|
2085
|
-
}
|
|
2086
|
-
handleTitleChange(val) {
|
|
2087
|
-
this.newTitle.set(val);
|
|
2088
|
-
}
|
|
2089
|
-
handleSelect(key) {
|
|
2090
|
-
this.selectedKey.set(key);
|
|
2091
|
-
}
|
|
2092
|
-
handleViewerChanged(e) {
|
|
2093
|
-
// Ignore initial emissions to prevent change detection loops
|
|
2094
|
-
if (e?.mode === 'init')
|
|
2095
|
-
return;
|
|
2096
|
-
const key = this.selectedKey();
|
|
2097
|
-
if (!key)
|
|
2098
|
-
return;
|
|
2099
|
-
const nextOptions = e?.values?.options ?? {};
|
|
2100
|
-
const updated = this.schema().map((it) => (it.key === key ? { ...it, options: cloneDeep(nextOptions) } : it));
|
|
2101
|
-
this.schemaChange.emit(updated);
|
|
2102
|
-
}
|
|
2103
|
-
deriveKey(input) {
|
|
2104
|
-
if (!input)
|
|
2105
|
-
return '';
|
|
2106
|
-
let k = camelCase(String(input));
|
|
2107
|
-
k = k.replace(/[^a-zA-Z0-9_]/g, '');
|
|
2108
|
-
if (!/^[a-zA-Z_]/.test(k))
|
|
2109
|
-
k = `_${k}`;
|
|
2110
|
-
const exists = (candidate) => this.schema().some((i) => i.key === candidate);
|
|
2111
|
-
if (!exists(k))
|
|
2112
|
-
return k;
|
|
2113
|
-
let i = 1;
|
|
2114
|
-
while (exists(`${k}${i}`))
|
|
2115
|
-
i++;
|
|
2116
|
-
return `${k}${i}`;
|
|
2117
|
-
}
|
|
2118
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPExtraPropertiesSchemaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2119
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: AXPExtraPropertiesSchemaComponent, isStandalone: true, selector: "axp-extra-properties-schema", inputs: { schema: { classPropertyName: "schema", publicName: "schema", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { schemaChange: "schemaChange" }, host: { classAttribute: "ax-flex ax-flex-1 ax-h-full ax-gap-4 ax-p-4" }, ngImport: i0, template: "<!-- Left Panel: list/manage properties -->\n<div class=\"ax-flex ax-flex-col ax-gap-3 ax-min-h-0 ax-h-full ax-w-2/3\">\n <div class=\"ax-overflow-y-auto ax-min-h-0 ax-h-full ax-pe-2 -ax-me-2\">\n <div cdkDropList (cdkDropListDropped)=\"handleDrop($event)\" class=\"ax-flex ax-flex-col ax-gap-3\">\n @for (item of schema(); track item.key) {\n @if (mode() === 'edit') {\n <div class=\"ax-grid ax-grid-cols-12 ax-gap-4 ax-items-center ax-rounded ax-border ax-p-3 ax-cursor-pointer ax-lightest-surface \"\n [class.!ax-lighter-surface]=\"item.key === selectedKey()\" (click)=\"handleSelect(item.key)\" cdkDrag\n [cdkDragDisabled]=\"false\">\n <div class=\"ax-col-span-12 md:ax-col-span-4 ax-flex ax-items-center ax-gap-3\">\n <ax-icon class=\"fa-solid fa-grip-dots-vertical ax-cursor-move ax-text-neutral-500\"\n cdkDragHandle></ax-icon>\n <div>\n <div class=\"ax-font-semibold\">{{ item.title }}</div>\n </div>\n </div>\n <div class=\"ax-col-span-12 md:ax-col-span-7 ax-grid ax-grid-cols-12 ax-gap-4 ax-items-center\">\n <ax-form-field class=\"ax-col-span-12 md:ax-col-span-6\">\n <ax-select-box [value]=\"item.type\" [dataSource]=\"typeOptions()\" valueField=\"id\"\n textField=\"title\"\n (onValueChanged)=\"handleUpdateType(item.key, $event.value)\"></ax-select-box>\n </ax-form-field>\n <ax-form-field class=\"ax-col-span-12 md:ax-col-span-6\">\n <ax-text-box [ngModel]=\"item.title\"\n (onValueChanged)=\"handleUpdateTitle(item.key, $event.value)\"></ax-text-box>\n </ax-form-field>\n </div>\n <div class=\"ax-hidden md:ax-block md:ax-col-span-1 md:ax-justify-self-end\">\n <ax-button look=\"blank\" color=\"danger\" (onClick)=\"handleRemove(item.key)\">\n <ax-prefix><ax-icon class=\"fa-light fa-trash-can\"></ax-icon></ax-prefix>\n </ax-button>\n </div>\n </div>\n } @else {\n <div class=\"ax-grid ax-grid-cols-12 ax-gap-1 ax-rounded ax-border ax-p-3\">\n <div class=\"ax-font-semibold\">{{ item.title }}</div>\n <div class=\"ax-col-span-12 ax-text-xs ax-text-muted\">{{ item.key }}</div>\n </div>\n }\n } @empty {\n <div class=\"ax-text-sm ax-text-gray-400\">{{ '@extra-properties:messages.no-schema-fields' | translate |\n async\n }}</div>\n }\n\n @if (mode() === 'edit') {\n <div class=\"ax-grid ax-grid-cols-12 ax-gap-4 ax-items-end ax-mt-4 ax-border-t ax-border-dashed ax-pt-4\">\n <!-- Type -->\n <ax-form-field class=\"ax-col-span-12 md:ax-col-span-6 lg:ax-col-span-6\">\n <ax-label>{{ '@extra-properties:labels.type' | translate | async }}</ax-label>\n <ax-select-box [ngModel]=\"newTypeId()\" [dataSource]=\"typeOptions()\" valueField=\"id\"\n textField=\"title\" (onValueChanged)=\"newTypeChanged($event.value)\"></ax-select-box>\n </ax-form-field>\n <!-- Title -->\n <ax-form-field class=\"ax-col-span-12 md:ax-col-span-6 lg:ax-col-span-6\">\n <ax-label>{{ '@extra-properties:labels.title' | translate | async }}</ax-label>\n <ax-text-box [ngModel]=\"newTitle()\"\n (onValueChanged)=\"handleTitleChange($event.value)\"></ax-text-box>\n </ax-form-field>\n <!-- Add -->\n <div class=\"ax-col-span-12 ax-flex ax-justify-end\">\n <ax-button look=\"solid\" (onClick)=\"handleAdd()\" [disabled]=\"!canAdd()\"\n text=\"{{ '@extra-properties:actions.add-field' | translate | async }}\">\n <ax-prefix><ax-icon class=\"fa-solid fa-add\"></ax-icon></ax-prefix>\n </ax-button>\n </div>\n </div>\n }\n </div>\n </div>\n</div>\n\n<!-- Right Panel: widget property viewer for selected item -->\n<div class=\"ax-w-1/3 ax-border ax-rounded ax-h-full ax-flex ax-flex-col ax-lightest-surface\">\n @if (mode() === 'edit' && selectedItem()) {\n <div class=\"ax-p-4 ax-font-semibold ax-border-b ax-lighter-surface\">\n {{selectedItem()?.title}}\n </div>\n <div class=\"ax-overflow-y-auto ax-flex-1\">\n <axp-widget-property-viewer [widget]=\"{ type: selectedItem()!.type, options: selectedItem()!.options }\"\n [mode]=\"'advanced'\" (onChanged)=\"handleViewerChanged($event)\" />\n </div>\n }\n @else {\n <div class=\"ax-text-sm ax-text-muted ax-p-4 ax-text-center\">{{ '@extra-properties:messages.select-field-to-edit' |\n translate | async }}</div>\n }\n</div>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: AXFormModule }, { kind: "component", type: i2$1.AXFormFieldComponent, selector: "ax-form-field", inputs: ["labelMode"] }, { kind: "ngmodule", type: AXLabelModule }, { kind: "component", type: i3$2.AXLabelComponent, selector: "ax-label", inputs: ["required", "for"], outputs: ["requiredChange"] }, { kind: "ngmodule", type: AXTextBoxModule }, { kind: "component", type: i4$1.AXTextBoxComponent, selector: "ax-text-box", inputs: ["disabled", "tabIndex", "readonly", "value", "state", "name", "id", "placeholder", "maxLength", "allowNull", "type", "autoComplete", "look", "mask-options", "class"], outputs: ["onBlur", "onFocus", "valueChange", "stateChange", "onValueChanged", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "ngmodule", type: AXSelectBoxModule }, { kind: "component", type: i5$2.AXSelectBoxComponent, selector: "ax-select-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "minValue", "maxValue", "value", "state", "name", "id", "type", "look", "multiple", "valueField", "textField", "disabledField", "textTemplate", "selectedItems", "isItemTruncated", "showItemTooltip", "dataSource", "minRecordsForSearch", "caption", "itemTemplate", "selectedTemplate", "emptyTemplate", "loadingTemplate", "dropdownWidth", "searchBoxAutoFocus"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onOpened", "onClosed", "onItemSelected", "onItemClick"] }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i2$2.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: AXDecoratorModule }, { kind: "component", type: i7.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i7.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: DragDropModule }, { kind: "directive", type: i9.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i9.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i9.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "component", type: AXPWidgetPropertyViewerComponent, selector: "axp-widget-property-viewer", inputs: ["widget", "mode"], outputs: ["onChanged"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "pipe", type: i5.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2120
|
-
}
|
|
2121
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPExtraPropertiesSchemaComponent, decorators: [{
|
|
2122
|
-
type: Component,
|
|
2123
|
-
args: [{ selector: 'axp-extra-properties-schema', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
2124
|
-
CommonModule,
|
|
2125
|
-
FormsModule,
|
|
2126
|
-
AXFormModule,
|
|
2127
|
-
AXLabelModule,
|
|
2128
|
-
AXTextBoxModule,
|
|
2129
|
-
AXSelectBoxModule,
|
|
2130
|
-
AXButtonModule,
|
|
2131
|
-
AXDecoratorModule,
|
|
2132
|
-
DragDropModule,
|
|
2133
|
-
AXTranslationModule,
|
|
2134
|
-
AXPWidgetPropertyViewerComponent,
|
|
2135
|
-
], standalone: true, host: {
|
|
2136
|
-
class: 'ax-flex ax-flex-1 ax-h-full ax-gap-4 ax-p-4',
|
|
2137
|
-
}, template: "<!-- Left Panel: list/manage properties -->\n<div class=\"ax-flex ax-flex-col ax-gap-3 ax-min-h-0 ax-h-full ax-w-2/3\">\n <div class=\"ax-overflow-y-auto ax-min-h-0 ax-h-full ax-pe-2 -ax-me-2\">\n <div cdkDropList (cdkDropListDropped)=\"handleDrop($event)\" class=\"ax-flex ax-flex-col ax-gap-3\">\n @for (item of schema(); track item.key) {\n @if (mode() === 'edit') {\n <div class=\"ax-grid ax-grid-cols-12 ax-gap-4 ax-items-center ax-rounded ax-border ax-p-3 ax-cursor-pointer ax-lightest-surface \"\n [class.!ax-lighter-surface]=\"item.key === selectedKey()\" (click)=\"handleSelect(item.key)\" cdkDrag\n [cdkDragDisabled]=\"false\">\n <div class=\"ax-col-span-12 md:ax-col-span-4 ax-flex ax-items-center ax-gap-3\">\n <ax-icon class=\"fa-solid fa-grip-dots-vertical ax-cursor-move ax-text-neutral-500\"\n cdkDragHandle></ax-icon>\n <div>\n <div class=\"ax-font-semibold\">{{ item.title }}</div>\n </div>\n </div>\n <div class=\"ax-col-span-12 md:ax-col-span-7 ax-grid ax-grid-cols-12 ax-gap-4 ax-items-center\">\n <ax-form-field class=\"ax-col-span-12 md:ax-col-span-6\">\n <ax-select-box [value]=\"item.type\" [dataSource]=\"typeOptions()\" valueField=\"id\"\n textField=\"title\"\n (onValueChanged)=\"handleUpdateType(item.key, $event.value)\"></ax-select-box>\n </ax-form-field>\n <ax-form-field class=\"ax-col-span-12 md:ax-col-span-6\">\n <ax-text-box [ngModel]=\"item.title\"\n (onValueChanged)=\"handleUpdateTitle(item.key, $event.value)\"></ax-text-box>\n </ax-form-field>\n </div>\n <div class=\"ax-hidden md:ax-block md:ax-col-span-1 md:ax-justify-self-end\">\n <ax-button look=\"blank\" color=\"danger\" (onClick)=\"handleRemove(item.key)\">\n <ax-prefix><ax-icon class=\"fa-light fa-trash-can\"></ax-icon></ax-prefix>\n </ax-button>\n </div>\n </div>\n } @else {\n <div class=\"ax-grid ax-grid-cols-12 ax-gap-1 ax-rounded ax-border ax-p-3\">\n <div class=\"ax-font-semibold\">{{ item.title }}</div>\n <div class=\"ax-col-span-12 ax-text-xs ax-text-muted\">{{ item.key }}</div>\n </div>\n }\n } @empty {\n <div class=\"ax-text-sm ax-text-gray-400\">{{ '@extra-properties:messages.no-schema-fields' | translate |\n async\n }}</div>\n }\n\n @if (mode() === 'edit') {\n <div class=\"ax-grid ax-grid-cols-12 ax-gap-4 ax-items-end ax-mt-4 ax-border-t ax-border-dashed ax-pt-4\">\n <!-- Type -->\n <ax-form-field class=\"ax-col-span-12 md:ax-col-span-6 lg:ax-col-span-6\">\n <ax-label>{{ '@extra-properties:labels.type' | translate | async }}</ax-label>\n <ax-select-box [ngModel]=\"newTypeId()\" [dataSource]=\"typeOptions()\" valueField=\"id\"\n textField=\"title\" (onValueChanged)=\"newTypeChanged($event.value)\"></ax-select-box>\n </ax-form-field>\n <!-- Title -->\n <ax-form-field class=\"ax-col-span-12 md:ax-col-span-6 lg:ax-col-span-6\">\n <ax-label>{{ '@extra-properties:labels.title' | translate | async }}</ax-label>\n <ax-text-box [ngModel]=\"newTitle()\"\n (onValueChanged)=\"handleTitleChange($event.value)\"></ax-text-box>\n </ax-form-field>\n <!-- Add -->\n <div class=\"ax-col-span-12 ax-flex ax-justify-end\">\n <ax-button look=\"solid\" (onClick)=\"handleAdd()\" [disabled]=\"!canAdd()\"\n text=\"{{ '@extra-properties:actions.add-field' | translate | async }}\">\n <ax-prefix><ax-icon class=\"fa-solid fa-add\"></ax-icon></ax-prefix>\n </ax-button>\n </div>\n </div>\n }\n </div>\n </div>\n</div>\n\n<!-- Right Panel: widget property viewer for selected item -->\n<div class=\"ax-w-1/3 ax-border ax-rounded ax-h-full ax-flex ax-flex-col ax-lightest-surface\">\n @if (mode() === 'edit' && selectedItem()) {\n <div class=\"ax-p-4 ax-font-semibold ax-border-b ax-lighter-surface\">\n {{selectedItem()?.title}}\n </div>\n <div class=\"ax-overflow-y-auto ax-flex-1\">\n <axp-widget-property-viewer [widget]=\"{ type: selectedItem()!.type, options: selectedItem()!.options }\"\n [mode]=\"'advanced'\" (onChanged)=\"handleViewerChanged($event)\" />\n </div>\n }\n @else {\n <div class=\"ax-text-sm ax-text-muted ax-p-4 ax-text-center\">{{ '@extra-properties:messages.select-field-to-edit' |\n translate | async }}</div>\n }\n</div>" }]
|
|
2138
|
-
}], ctorParameters: () => [] });
|
|
2139
|
-
|
|
2140
|
-
class AXPExtraPropertiesValuesComponent {
|
|
2141
|
-
constructor() {
|
|
2142
|
-
//#region ---- Inputs ----
|
|
2143
|
-
this.schema = input([], ...(ngDevMode ? [{ debugName: "schema" }] : []));
|
|
2144
|
-
this.values = input({}, ...(ngDevMode ? [{ debugName: "values" }] : []));
|
|
2145
|
-
this.mode = input('edit', ...(ngDevMode ? [{ debugName: "mode" }] : []));
|
|
2146
|
-
//#endregion
|
|
2147
|
-
//#region ---- Outputs ----
|
|
2148
|
-
this.valuesChange = output();
|
|
2149
|
-
//#endregion
|
|
2150
|
-
//#region ---- Outputs ----
|
|
2151
|
-
this.isRequired = (item) => {
|
|
2152
|
-
return item.options?.['validations']?.['required'] ?? false;
|
|
2153
|
-
};
|
|
2154
|
-
//#endregion
|
|
2155
|
-
//#region ---- Class Properties ----
|
|
2156
|
-
this.internalContext = signal({}, ...(ngDevMode ? [{ debugName: "internalContext" }] : []));
|
|
2157
|
-
this.nodeCache = {};
|
|
2158
|
-
this.lastTypeByKey = {};
|
|
2159
|
-
//#endregion
|
|
2160
|
-
//#region ---- Effects ----
|
|
2161
|
-
this.syncContextFromInputs = effect(() => {
|
|
2162
|
-
const schema = this.schema();
|
|
2163
|
-
const vals = this.values();
|
|
2164
|
-
const current = this.internalContext();
|
|
2165
|
-
const currentExtra = current['extra'] ?? {};
|
|
2166
|
-
const extra = {};
|
|
2167
|
-
for (const s of schema) {
|
|
2168
|
-
const v = vals[s.key];
|
|
2169
|
-
if (v !== undefined && v !== null)
|
|
2170
|
-
extra[s.key] = v;
|
|
2171
|
-
}
|
|
2172
|
-
const nextContext = { ...current, extra };
|
|
2173
|
-
if (!isEqual(nextContext, current)) {
|
|
2174
|
-
this.internalContext.set(nextContext);
|
|
2175
|
-
}
|
|
2176
|
-
}, ...(ngDevMode ? [{ debugName: "syncContextFromInputs" }] : []));
|
|
2177
|
-
this.clearOnSchemaTypeChange = effect(() => {
|
|
2178
|
-
const schema = this.schema();
|
|
2179
|
-
const changedKeys = new Set();
|
|
2180
|
-
for (const s of schema) {
|
|
2181
|
-
const prev = this.lastTypeByKey[s.key];
|
|
2182
|
-
if (prev && prev !== s.type)
|
|
2183
|
-
changedKeys.add(s.key);
|
|
2184
|
-
this.lastTypeByKey[s.key] = s.type;
|
|
2185
|
-
}
|
|
2186
|
-
if (changedKeys.size > 0) {
|
|
2187
|
-
const next = { ...this.values() };
|
|
2188
|
-
changedKeys.forEach((k) => delete next[k]);
|
|
2189
|
-
// reset cached node defaults
|
|
2190
|
-
changedKeys.forEach((k) => {
|
|
2191
|
-
const node = this.nodeCache[k];
|
|
2192
|
-
if (node)
|
|
2193
|
-
node.defaultValue = undefined;
|
|
2194
|
-
});
|
|
2195
|
-
this.valuesChange.emit(next);
|
|
2196
|
-
}
|
|
2197
|
-
}, ...(ngDevMode ? [{ debugName: "clearOnSchemaTypeChange" }] : []));
|
|
2198
|
-
}
|
|
2199
|
-
//#endregion
|
|
2200
|
-
//#region ---- Event Handlers ----
|
|
2201
|
-
onContextChanged(event) {
|
|
2202
|
-
if (event.state === 'initiated')
|
|
2203
|
-
return;
|
|
2204
|
-
const data = (event.data ?? {});
|
|
2205
|
-
const extra = data['extra'] ?? {};
|
|
2206
|
-
const nextValues = {};
|
|
2207
|
-
for (const s of this.schema()) {
|
|
2208
|
-
if (Object.prototype.hasOwnProperty.call(extra, s.key)) {
|
|
2209
|
-
nextValues[s.key] = extra[s.key];
|
|
2210
|
-
}
|
|
2211
|
-
}
|
|
2212
|
-
const currentValues = this.values();
|
|
2213
|
-
if (!isEqual(currentValues, nextValues)) {
|
|
2214
|
-
this.valuesChange.emit(nextValues);
|
|
2215
|
-
}
|
|
2216
|
-
}
|
|
2217
|
-
//#endregion
|
|
2218
|
-
//#region ---- Utility Methods ----
|
|
2219
|
-
getNode(item) {
|
|
2220
|
-
const key = item.key;
|
|
2221
|
-
let node = this.nodeCache[key];
|
|
2222
|
-
if (!node) {
|
|
2223
|
-
node = {
|
|
2224
|
-
type: item.type,
|
|
2225
|
-
path: `extra.${item.key}`,
|
|
2226
|
-
options: item.options ?? {},
|
|
2227
|
-
defaultValue: this.values()[item.key],
|
|
2228
|
-
};
|
|
2229
|
-
this.nodeCache[key] = node;
|
|
2230
|
-
}
|
|
2231
|
-
else {
|
|
2232
|
-
// Keep reference stable; update nested fields if essential changes happen
|
|
2233
|
-
node.type = item.type;
|
|
2234
|
-
node.options = item.options ?? node.options;
|
|
2235
|
-
// Do not overwrite defaultValue during editing to avoid resets
|
|
2236
|
-
}
|
|
2237
|
-
return node;
|
|
2238
|
-
}
|
|
2239
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPExtraPropertiesValuesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2240
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: AXPExtraPropertiesValuesComponent, isStandalone: true, selector: "axp-extra-properties-values", inputs: { schema: { classPropertyName: "schema", publicName: "schema", isSignal: true, isRequired: false, transformFunction: null }, values: { classPropertyName: "values", publicName: "values", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valuesChange: "valuesChange" }, host: { classAttribute: "ax-block ax-flex-1" }, ngImport: i0, template: `
|
|
2241
|
-
<div class="ax-grid ax-grid-cols-12 ax-gap-4">
|
|
2242
|
-
<axp-widgets-container [context]="internalContext()" (onContextChanged)="onContextChanged($event)">
|
|
2243
|
-
<div class="ax-col-span-12 ax-flex ax-flex-col ax-gap-3">
|
|
2244
|
-
@for(item of schema(); track item.key){
|
|
2245
|
-
@if(mode()==='edit'){
|
|
2246
|
-
<ax-form-field>
|
|
2247
|
-
<ax-label [required]="isRequired(item)">{{item.title}}</ax-label>
|
|
2248
|
-
<ng-container
|
|
2249
|
-
axp-widget-renderer
|
|
2250
|
-
[node]="getNode(item)"
|
|
2251
|
-
[mode]="'edit'"
|
|
2252
|
-
></ng-container>
|
|
2253
|
-
</ax-form-field>
|
|
2254
|
-
} @else {
|
|
2255
|
-
<div class="ax-grid ax-grid-cols-12 ax-gap-1">
|
|
2256
|
-
<div class="ax-font-semibold">{{item.title}}</div>
|
|
2257
|
-
<div class="ax-col-span-12 ax-text-muted">
|
|
2258
|
-
<ng-container
|
|
2259
|
-
axp-widget-renderer
|
|
2260
|
-
[node]="getNode(item)"
|
|
2261
|
-
[mode]="'view'"
|
|
2262
|
-
></ng-container>
|
|
2263
|
-
</div>
|
|
2264
|
-
</div>
|
|
2265
|
-
}
|
|
2266
|
-
}
|
|
2267
|
-
</div>
|
|
2268
|
-
</axp-widgets-container>
|
|
2269
|
-
</div>
|
|
2270
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXPLayoutBuilderModule }, { kind: "component", type: i3$3.AXPWidgetContainerComponent, selector: "axp-widgets-container", inputs: ["context", "functions"], outputs: ["onContextChanged"] }, { kind: "directive", type: i3$3.AXPWidgetRendererDirective, selector: "[axp-widget-renderer]", inputs: ["parentNode", "index", "mode", "node"], outputs: ["onOptionsChanged", "onValueChanged"], exportAs: ["widgetRenderer"] }, { kind: "ngmodule", type: AXFormModule }, { kind: "component", type: i2$1.AXFormFieldComponent, selector: "ax-form-field", inputs: ["labelMode"] }, { kind: "ngmodule", type: AXLabelModule }, { kind: "component", type: i3$2.AXLabelComponent, selector: "ax-label", inputs: ["required", "for"], outputs: ["requiredChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2271
|
-
}
|
|
2272
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPExtraPropertiesValuesComponent, decorators: [{
|
|
2273
|
-
type: Component,
|
|
2274
|
-
args: [{
|
|
2275
|
-
selector: 'axp-extra-properties-values',
|
|
2276
|
-
template: `
|
|
2277
|
-
<div class="ax-grid ax-grid-cols-12 ax-gap-4">
|
|
2278
|
-
<axp-widgets-container [context]="internalContext()" (onContextChanged)="onContextChanged($event)">
|
|
2279
|
-
<div class="ax-col-span-12 ax-flex ax-flex-col ax-gap-3">
|
|
2280
|
-
@for(item of schema(); track item.key){
|
|
2281
|
-
@if(mode()==='edit'){
|
|
2282
|
-
<ax-form-field>
|
|
2283
|
-
<ax-label [required]="isRequired(item)">{{item.title}}</ax-label>
|
|
2284
|
-
<ng-container
|
|
2285
|
-
axp-widget-renderer
|
|
2286
|
-
[node]="getNode(item)"
|
|
2287
|
-
[mode]="'edit'"
|
|
2288
|
-
></ng-container>
|
|
2289
|
-
</ax-form-field>
|
|
2290
|
-
} @else {
|
|
2291
|
-
<div class="ax-grid ax-grid-cols-12 ax-gap-1">
|
|
2292
|
-
<div class="ax-font-semibold">{{item.title}}</div>
|
|
2293
|
-
<div class="ax-col-span-12 ax-text-muted">
|
|
2294
|
-
<ng-container
|
|
2295
|
-
axp-widget-renderer
|
|
2296
|
-
[node]="getNode(item)"
|
|
2297
|
-
[mode]="'view'"
|
|
2298
|
-
></ng-container>
|
|
2299
|
-
</div>
|
|
2300
|
-
</div>
|
|
2301
|
-
}
|
|
2302
|
-
}
|
|
2303
|
-
</div>
|
|
2304
|
-
</axp-widgets-container>
|
|
2305
|
-
</div>
|
|
2306
|
-
`,
|
|
2307
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2308
|
-
imports: [CommonModule, AXPLayoutBuilderModule, AXFormModule, AXLabelModule],
|
|
2309
|
-
standalone: true,
|
|
2310
|
-
host: {
|
|
2311
|
-
class: 'ax-block ax-flex-1',
|
|
2312
|
-
},
|
|
2313
|
-
}]
|
|
2314
|
-
}] });
|
|
2315
|
-
|
|
2316
|
-
class AXPQueryFiltersComponent {
|
|
1212
|
+
class AXPLayoutFiltersComponent {
|
|
2317
1213
|
constructor() {
|
|
2318
1214
|
this.translate = inject(AXTranslationService);
|
|
2319
1215
|
this.calendarService = inject(AXCalendarService);
|
|
@@ -2323,9 +1219,7 @@ class AXPQueryFiltersComponent {
|
|
|
2323
1219
|
this.onFiltersChanged = output();
|
|
2324
1220
|
this.tagBox = viewChild('tagBox', ...(ngDevMode ? [{ debugName: "tagBox" }] : []));
|
|
2325
1221
|
this.selectedField = signal(null, ...(ngDevMode ? [{ debugName: "selectedField" }] : []));
|
|
2326
|
-
this.selectedFilters = linkedSignal(() => this.convertQueriesToDefinitions(this.initialFilters()),
|
|
2327
|
-
equal: isEqual,
|
|
2328
|
-
});
|
|
1222
|
+
this.selectedFilters = linkedSignal(() => this.convertQueriesToDefinitions(this.initialFilters()).map((i) => ({ ...i, readOnly: true })));
|
|
2329
1223
|
this.context = linkedSignal(() => this.convertQueriesToContext(this.initialFilters()));
|
|
2330
1224
|
this.activeFilter = signal(null, ...(ngDevMode ? [{ debugName: "activeFilter" }] : []));
|
|
2331
1225
|
this.asyncTags = signal([], ...(ngDevMode ? [{ debugName: "asyncTags" }] : []));
|
|
@@ -2339,7 +1233,7 @@ class AXPQueryFiltersComponent {
|
|
|
2339
1233
|
sf.operator?.type === (this.context()[sf.field]?.operation?.type || f.operator?.type)));
|
|
2340
1234
|
};
|
|
2341
1235
|
this.getDisplayValue = async (filter, val) => {
|
|
2342
|
-
if (filter.widget
|
|
1236
|
+
if (filter.widget.type === 'select-editor' || filter.widget.type === 'select-filter') {
|
|
2343
1237
|
const dataSource = filter.widget.options?.['dataSource'];
|
|
2344
1238
|
const textField = filter.widget.options?.['textField'];
|
|
2345
1239
|
const valueField = filter.widget.options?.['valueField'];
|
|
@@ -2390,7 +1284,6 @@ class AXPQueryFiltersComponent {
|
|
|
2390
1284
|
field: f.field,
|
|
2391
1285
|
operator: context[f.field]?.operation,
|
|
2392
1286
|
value: context[f.field]?.value,
|
|
2393
|
-
hidden: f.hidden,
|
|
2394
1287
|
}));
|
|
2395
1288
|
const newContext = {};
|
|
2396
1289
|
convertedFilters.forEach((cf) => {
|
|
@@ -2415,7 +1308,7 @@ class AXPQueryFiltersComponent {
|
|
|
2415
1308
|
query: `${this.translate.translateSync(filter.title)} ${this.getActiveOperator(filter)} '${displayValue}'`,
|
|
2416
1309
|
};
|
|
2417
1310
|
})).then((results) => {
|
|
2418
|
-
this.asyncTags.set(results
|
|
1311
|
+
this.asyncTags.set(results);
|
|
2419
1312
|
});
|
|
2420
1313
|
}, ...(ngDevMode ? [{ debugName: "#effect2" }] : []));
|
|
2421
1314
|
}
|
|
@@ -2430,7 +1323,6 @@ class AXPQueryFiltersComponent {
|
|
|
2430
1323
|
title: definition?.title || '',
|
|
2431
1324
|
widget: definition?.widget,
|
|
2432
1325
|
filterType: definition?.filterType,
|
|
2433
|
-
hidden: q.hidden,
|
|
2434
1326
|
};
|
|
2435
1327
|
});
|
|
2436
1328
|
}
|
|
@@ -2444,7 +1336,6 @@ class AXPQueryFiltersComponent {
|
|
|
2444
1336
|
this.tagBoxInput = this.tagBox()?.getHostElement().querySelector('input');
|
|
2445
1337
|
}
|
|
2446
1338
|
handleSelectField(field) {
|
|
2447
|
-
console.log(field);
|
|
2448
1339
|
this.activeFilter.set(field);
|
|
2449
1340
|
// this.inputValue.set('');
|
|
2450
1341
|
this.tagBox()?.inputValue.set('');
|
|
@@ -2492,9 +1383,8 @@ class AXPQueryFiltersComponent {
|
|
|
2492
1383
|
#effect;
|
|
2493
1384
|
handleSelectFilters(e) {
|
|
2494
1385
|
if (e.value?.length < this.selectedFilters().length) {
|
|
2495
|
-
const hiddenFilters = this.selectedFilters().filter((f) => f.hidden);
|
|
2496
1386
|
this.selectedFilters.update((prev) => {
|
|
2497
|
-
return
|
|
1387
|
+
return e.value;
|
|
2498
1388
|
});
|
|
2499
1389
|
}
|
|
2500
1390
|
}
|
|
@@ -2541,12 +1431,12 @@ class AXPQueryFiltersComponent {
|
|
|
2541
1431
|
}
|
|
2542
1432
|
}
|
|
2543
1433
|
#effect2;
|
|
2544
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type:
|
|
2545
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type:
|
|
1434
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPLayoutFiltersComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1435
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: AXPLayoutFiltersComponent, isStandalone: true, selector: "axp-layout-filters", inputs: { filtersDefinitions: { classPropertyName: "filtersDefinitions", publicName: "filtersDefinitions", isSignal: true, isRequired: false, transformFunction: null }, initialFilters: { classPropertyName: "initialFilters", publicName: "initialFilters", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onFiltersChanged: "onFiltersChanged" }, viewQueries: [{ propertyName: "tagBox", first: true, predicate: ["tagBox"], descendants: true, isSignal: true }, { propertyName: "popover", first: true, predicate: ["popover"], descendants: true, isSignal: true }, { propertyName: "listItems", predicate: ["caseItem"], descendants: true }], ngImport: i0, template: "<div class=\"ax-flex ax-items-center ax-gap-2 ax-p-2\">\n <ax-button (keydown)=\"handleButtonKeyDown($event)\" (onClick)=\"popover.open()\" #filterButton [look]=\"'blank'\">\n <ax-icon class=\"far fa-bars-filter ax-cursor-pointer\"> </ax-icon>\n </ax-button>\n <ax-tag-box\n [ngModel]=\"asyncTags()\"\n (onValueChanged)=\"handleSelectFilters($event)\"\n [textField]=\"'query'\"\n [valueField]=\"'id'\"\n [readonly]=\"filtersDefinitions().length === 0\"\n [look]=\"'none'\"\n [readonlyField]=\"'readOnly'\"\n (onKeyDown)=\"handleKeyDown($event)\"\n [addOnEnter]=\"false\"\n [placeholder]=\"(filtersDefinitions().length === 0 ? 'filter.noRecords' : 'filter.title') | translate | async\"\n #tagBox\n ></ax-tag-box>\n</div>\n\n<ax-popover\n [offsetY]=\"activeFilter() ? -30 : 0\"\n [target]=\"tagBoxInput\"\n [openOn]=\"'toggle'\"\n (onOpened)=\"onPopoverOpened($event)\"\n [closeOn]=\"'clickOut'\"\n (onClosed)=\"handlePopoverClosed($event)\"\n [adaptivityEnabled]=\"true\"\n #popover\n>\n <div class=\"md:ax-min-w-72 ax-border ax-surface ax-w-full ax-rounded-md md:ax-max-h-96 md:ax-overflow-auto\">\n <axp-widgets-container [context]=\"context()\" (onContextChanged)=\"onContextChanged($event)\">\n @if (activeFilter()) {\n <div class=\"ax-flex ax-flex-col ax-lightest-surface ax-shadow-md\">\n <ax-header class=\"ax-border-b ax-border-light ax-px-4 ax-py-2\">{{\n activeFilter()?.title! | translate | async\n }}</ax-header>\n <ax-content class=\"ax-p-4\">\n <div class=\"ax-mb-2\">\n <ax-badge [text]=\"getActiveOperator(activeFilter())!\"></ax-badge>\n </div>\n <ng-container\n axp-widget-renderer\n [node]=\"{\n type: activeFilter()?.widget?.type || 'text-editor',\n path: activeFilter()?.field,\n options: activeFilter()?.widget?.options,\n }\"\n [mode]=\"'edit'\"\n >\n </ng-container>\n </ax-content>\n <ax-footer class=\"ax-border-t ax-flex ax-justify-end ax-border-light ax-w-full ax-px-4 ax-py-2\">\n <ax-button class=\"ax-xs\" [text]=\"'apply' | translate | async\" (onClick)=\"handleApplyFilter()\"></ax-button>\n </ax-footer>\n </div>\n } @else {\n <div axListNavigation #list=\"axListNavigation\" class=\"axp-list-items\">\n @if (tagBox.inputValue()) {\n @for (inlineFilter of inlineFilters(); track inlineFilter.field) {\n <div\n axListNavigationItem\n #caseItem=\"axListNavigationItem\"\n [class.axp-state-focused]=\"caseItem.isActive()\"\n tabindex=\"0\"\n (click)=\"handleSelectInlineFilter(inlineFilter)\"\n (keydown)=\"handleInlineFilterKeyDown($event, inlineFilter)\"\n >\n {{ inlineFilter.title | translate | async }} {{ getActiveOperator(inlineFilter) }} '{{\n tagBox.inputValue()\n }}'\n </div>\n }\n <span class=\"ax-w-full ax-border-t ax-border-light ax-my-1\"></span>\n }\n @for (field of filterFields(); track field.field) {\n <div\n axListNavigationItem\n #caseItem=\"axListNavigationItem\"\n [class.axp-state-focused]=\"caseItem.isActive()\"\n (click)=\"handleSelectField(field)\"\n (keydown)=\"handleFieldKeyDown($event, field)\"\n tabindex=\"0\"\n >\n <div class=\"ax-flex ax-items-end ax-gap-2\">\n <ax-icon class=\"ax-w-5\" [class]=\"'fa-light ' + field.icon\"> </ax-icon>\n {{ field.title | translate | async }}\n </div>\n </div>\n }\n </div>\n }\n </axp-widgets-container>\n </div>\n</ax-popover>\n", styles: ["axp-layout-filters{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i2$2.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: AXDecoratorModule }, { kind: "component", type: i3.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i3.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: AXTranslationModule }, { kind: "ngmodule", type: AXPopoverModule }, { kind: "component", type: i4$1.AXPopoverComponent, selector: "ax-popover", inputs: ["width", "disabled", "offsetX", "offsetY", "target", "placement", "content", "openOn", "closeOn", "hasBackdrop", "openAfter", "closeAfter", "backdropClass", "panelClass", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "ngmodule", type: AXSelectionListModule }, { kind: "ngmodule", type: AXTagBoxModule }, { kind: "component", type: i5$1.AXTagBoxComponent, selector: "ax-tag-box", inputs: ["disabled", "tabIndex", "readonly", "value", "state", "name", "id", "placeholder", "allowNull", "type", "look", "addOnComma", "addOnEnter", "valueField", "textField", "readonlyField", "allowDuplicateValues"], outputs: ["onBlur", "onFocus", "valueChange", "stateChange", "onValueChanged", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "ngmodule", type: AXPLayoutBuilderModule }, { kind: "component", type: i3$2.AXPWidgetContainerComponent, selector: "axp-widgets-container", inputs: ["context", "functions"], outputs: ["onContextChanged"] }, { kind: "directive", type: i3$2.AXPWidgetRendererDirective, selector: "[axp-widget-renderer]", inputs: ["parentNode", "index", "mode", "node"], outputs: ["onOptionsChanged", "onValueChanged"], exportAs: ["widgetRenderer"] }, { kind: "ngmodule", type: AXListNavigationModule }, { kind: "directive", type: i7.AXListNavigationDirective, selector: "[axListNavigation]", inputs: ["orientation"], outputs: ["onNavigationChanged", "onPressEnterOrSpace"], exportAs: ["axListNavigation"] }, { kind: "directive", type: i7.AXListNavigationItemDirective, selector: "[axListNavigationItem]", exportAs: ["axListNavigationItem"] }, { kind: "ngmodule", type: AXBadgeModule }, { kind: "component", type: i8.AXBadgeComponent, selector: "ax-badge", inputs: ["color", "look", "text"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
2546
1436
|
}
|
|
2547
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type:
|
|
1437
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPLayoutFiltersComponent, decorators: [{
|
|
2548
1438
|
type: Component,
|
|
2549
|
-
args: [{ selector: 'axp-
|
|
1439
|
+
args: [{ selector: 'axp-layout-filters', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [
|
|
2550
1440
|
CommonModule,
|
|
2551
1441
|
FormsModule,
|
|
2552
1442
|
AXButtonModule,
|
|
@@ -2558,250 +1448,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
2558
1448
|
AXPLayoutBuilderModule,
|
|
2559
1449
|
AXListNavigationModule,
|
|
2560
1450
|
AXBadgeModule,
|
|
2561
|
-
], template: "<div class=\"ax-flex ax-items-center ax-gap-2 ax-p-2\">\n <ax-button (keydown)=\"handleButtonKeyDown($event)\" (onClick)=\"popover.open()\" #filterButton [look]=\"'blank'\">\n <ax-icon class=\"far fa-bars-filter ax-cursor-pointer\"> </ax-icon>\n </ax-button>\n <ax-tag-box\n [ngModel]=\"asyncTags()\"\n (onValueChanged)=\"handleSelectFilters($event)\"\n [textField]=\"'query'\"\n [valueField]=\"'id'\"\n [readonly]=\"filtersDefinitions().length === 0\"\n [look]=\"'none'\"\n [readonlyField]=\"'readOnly'\"\n (onKeyDown)=\"handleKeyDown($event)\"\n [addOnEnter]=\"false\"\n [placeholder]=\"(filtersDefinitions().length === 0 ? 'filter.noRecords' : 'filter.title') | translate | async\"\n #tagBox\n ></ax-tag-box>\n</div>\n\n<ax-popover\n [offsetY]=\"activeFilter() ? -30 : 0\"\n [target]=\"tagBoxInput\"\n [openOn]=\"'toggle'\"\n (onOpened)=\"onPopoverOpened($event)\"\n [closeOn]=\"'clickOut'\"\n (onClosed)=\"handlePopoverClosed($event)\"\n [adaptivityEnabled]=\"true\"\n #popover\n>\n <div class=\"md:ax-min-w-72 ax-border ax-surface ax-w-full ax-rounded-md md:ax-max-h-96 md:ax-overflow-auto\">\n <axp-widgets-container [context]=\"context()\" (onContextChanged)=\"onContextChanged($event)\">\n @if (activeFilter()) {\n <div class=\"ax-flex ax-flex-col ax-lightest-surface ax-shadow-md\">\n <ax-header class=\"ax-border-b ax-border-light ax-px-4 ax-py-2\">{{\n activeFilter()?.title! | translate | async\n }}</ax-header>\n <ax-content class=\"ax-p-4\">\n <div class=\"ax-mb-2\">\n <ax-badge [text]=\"getActiveOperator(activeFilter())!\"></ax-badge>\n </div>\n <ng-container\n axp-widget-renderer\n [node]=\"{\n type: activeFilter()?.widget?.type || 'text-editor',\n path: activeFilter()?.field,\n options: activeFilter()?.widget?.options,\n }\"\n [mode]=\"'edit'\"\n >\n </ng-container>\n </ax-content>\n <ax-footer class=\"ax-border-t ax-flex ax-justify-end ax-border-light ax-w-full ax-px-4 ax-py-2\">\n <ax-button class=\"ax-xs\" [text]=\"'apply' | translate | async\" (onClick)=\"handleApplyFilter()\"></ax-button>\n </ax-footer>\n </div>\n } @else {\n <div axListNavigation #list=\"axListNavigation\" class=\"axp-list-items\">\n @if (tagBox.inputValue()) {\n @for (inlineFilter of inlineFilters(); track inlineFilter.field) {\n <div\n axListNavigationItem\n #caseItem=\"axListNavigationItem\"\n [class.axp-state-focused]=\"caseItem.isActive()\"\n tabindex=\"0\"\n (click)=\"handleSelectInlineFilter(inlineFilter)\"\n (keydown)=\"handleInlineFilterKeyDown($event, inlineFilter)\"\n >\n {{ inlineFilter.title | translate | async }} {{ getActiveOperator(inlineFilter) }} '{{\n tagBox.inputValue()\n }}'\n </div>\n }\n <span class=\"ax-w-full ax-border-t ax-border-light ax-my-1\"></span>\n }\n @for (field of filterFields(); track field.field) {\n <div\n axListNavigationItem\n #caseItem=\"axListNavigationItem\"\n [class.axp-state-focused]=\"caseItem.isActive()\"\n (click)=\"handleSelectField(field)\"\n (keydown)=\"handleFieldKeyDown($event, field)\"\n tabindex=\"0\"\n >\n <div class=\"ax-flex ax-items-end ax-gap-2\">\n <ax-icon class=\"ax-w-5\" [class]=\"'fa-light ' + field.icon\"> </ax-icon>\n {{ field.title | translate | async }}\n </div>\n </div>\n }\n </div>\n }\n </axp-widgets-container>\n </div>\n</ax-popover>\n", styles: ["axp-
|
|
1451
|
+
], template: "<div class=\"ax-flex ax-items-center ax-gap-2 ax-p-2\">\n <ax-button (keydown)=\"handleButtonKeyDown($event)\" (onClick)=\"popover.open()\" #filterButton [look]=\"'blank'\">\n <ax-icon class=\"far fa-bars-filter ax-cursor-pointer\"> </ax-icon>\n </ax-button>\n <ax-tag-box\n [ngModel]=\"asyncTags()\"\n (onValueChanged)=\"handleSelectFilters($event)\"\n [textField]=\"'query'\"\n [valueField]=\"'id'\"\n [readonly]=\"filtersDefinitions().length === 0\"\n [look]=\"'none'\"\n [readonlyField]=\"'readOnly'\"\n (onKeyDown)=\"handleKeyDown($event)\"\n [addOnEnter]=\"false\"\n [placeholder]=\"(filtersDefinitions().length === 0 ? 'filter.noRecords' : 'filter.title') | translate | async\"\n #tagBox\n ></ax-tag-box>\n</div>\n\n<ax-popover\n [offsetY]=\"activeFilter() ? -30 : 0\"\n [target]=\"tagBoxInput\"\n [openOn]=\"'toggle'\"\n (onOpened)=\"onPopoverOpened($event)\"\n [closeOn]=\"'clickOut'\"\n (onClosed)=\"handlePopoverClosed($event)\"\n [adaptivityEnabled]=\"true\"\n #popover\n>\n <div class=\"md:ax-min-w-72 ax-border ax-surface ax-w-full ax-rounded-md md:ax-max-h-96 md:ax-overflow-auto\">\n <axp-widgets-container [context]=\"context()\" (onContextChanged)=\"onContextChanged($event)\">\n @if (activeFilter()) {\n <div class=\"ax-flex ax-flex-col ax-lightest-surface ax-shadow-md\">\n <ax-header class=\"ax-border-b ax-border-light ax-px-4 ax-py-2\">{{\n activeFilter()?.title! | translate | async\n }}</ax-header>\n <ax-content class=\"ax-p-4\">\n <div class=\"ax-mb-2\">\n <ax-badge [text]=\"getActiveOperator(activeFilter())!\"></ax-badge>\n </div>\n <ng-container\n axp-widget-renderer\n [node]=\"{\n type: activeFilter()?.widget?.type || 'text-editor',\n path: activeFilter()?.field,\n options: activeFilter()?.widget?.options,\n }\"\n [mode]=\"'edit'\"\n >\n </ng-container>\n </ax-content>\n <ax-footer class=\"ax-border-t ax-flex ax-justify-end ax-border-light ax-w-full ax-px-4 ax-py-2\">\n <ax-button class=\"ax-xs\" [text]=\"'apply' | translate | async\" (onClick)=\"handleApplyFilter()\"></ax-button>\n </ax-footer>\n </div>\n } @else {\n <div axListNavigation #list=\"axListNavigation\" class=\"axp-list-items\">\n @if (tagBox.inputValue()) {\n @for (inlineFilter of inlineFilters(); track inlineFilter.field) {\n <div\n axListNavigationItem\n #caseItem=\"axListNavigationItem\"\n [class.axp-state-focused]=\"caseItem.isActive()\"\n tabindex=\"0\"\n (click)=\"handleSelectInlineFilter(inlineFilter)\"\n (keydown)=\"handleInlineFilterKeyDown($event, inlineFilter)\"\n >\n {{ inlineFilter.title | translate | async }} {{ getActiveOperator(inlineFilter) }} '{{\n tagBox.inputValue()\n }}'\n </div>\n }\n <span class=\"ax-w-full ax-border-t ax-border-light ax-my-1\"></span>\n }\n @for (field of filterFields(); track field.field) {\n <div\n axListNavigationItem\n #caseItem=\"axListNavigationItem\"\n [class.axp-state-focused]=\"caseItem.isActive()\"\n (click)=\"handleSelectField(field)\"\n (keydown)=\"handleFieldKeyDown($event, field)\"\n tabindex=\"0\"\n >\n <div class=\"ax-flex ax-items-end ax-gap-2\">\n <ax-icon class=\"ax-w-5\" [class]=\"'fa-light ' + field.icon\"> </ax-icon>\n {{ field.title | translate | async }}\n </div>\n </div>\n }\n </div>\n }\n </axp-widgets-container>\n </div>\n</ax-popover>\n", styles: ["axp-layout-filters{width:100%}\n"] }]
|
|
2562
1452
|
}], propDecorators: { listItems: [{
|
|
2563
1453
|
type: ViewChildren,
|
|
2564
1454
|
args: ['caseItem']
|
|
2565
1455
|
}] } });
|
|
2566
1456
|
|
|
2567
|
-
class AXPQuerySortsComponent {
|
|
2568
|
-
constructor() {
|
|
2569
|
-
this.sortDefinitions = model([], ...(ngDevMode ? [{ debugName: "sortDefinitions" }] : []));
|
|
2570
|
-
this.sortQueries = signal([], ...(ngDevMode ? [{ debugName: "sortQueries", equal: isEqual }] : [{
|
|
2571
|
-
equal: isEqual,
|
|
2572
|
-
}]));
|
|
2573
|
-
this.initialSortQueries = input([], ...(ngDevMode ? [{ debugName: "initialSortQueries" }] : []));
|
|
2574
|
-
this.sortQueriesChange = output();
|
|
2575
|
-
// Recompute merged sort queries whenever inputs change
|
|
2576
|
-
effect(() => {
|
|
2577
|
-
const initialQueries = this.initialSortQueries();
|
|
2578
|
-
const definitions = this.sortDefinitions();
|
|
2579
|
-
const existingQueriesMap = new Map(initialQueries.map((q) => [q.name, q]));
|
|
2580
|
-
const mergedQueries = definitions.map((def) => {
|
|
2581
|
-
const existingQuery = existingQueriesMap.get(def.name);
|
|
2582
|
-
return existingQuery ? { ...def, dir: existingQuery.dir } : { ...def };
|
|
2583
|
-
});
|
|
2584
|
-
this.sortQueries.set(mergedQueries);
|
|
2585
|
-
});
|
|
2586
|
-
effect(() => {
|
|
2587
|
-
this.sortQueriesChange.emit(this.sortQueries());
|
|
2588
|
-
});
|
|
2589
|
-
}
|
|
2590
|
-
drop(event) {
|
|
2591
|
-
const sd = this.sortDefinitions();
|
|
2592
|
-
moveItemInArray(sd, event.previousIndex, event.currentIndex);
|
|
2593
|
-
this.sortDefinitions.set([...sd]);
|
|
2594
|
-
// Reorder sortQueries based on new sortDefinitions order
|
|
2595
|
-
const sq = this.sortQueries();
|
|
2596
|
-
moveItemInArray(sq, event.previousIndex, event.currentIndex);
|
|
2597
|
-
this.sortQueries.set([...sq]);
|
|
2598
|
-
}
|
|
2599
|
-
getSortDirection(item) {
|
|
2600
|
-
return this.sortQueries().find((i) => i.name === item.name)?.dir;
|
|
2601
|
-
}
|
|
2602
|
-
changeItemSort(item) {
|
|
2603
|
-
const itemDirection = this.getSortDirection(item);
|
|
2604
|
-
const newDirection = itemDirection === 'asc' ? 'desc' : itemDirection === 'desc' ? undefined : 'asc';
|
|
2605
|
-
this.sortQueries.update((prev) => {
|
|
2606
|
-
return prev.map((field) => {
|
|
2607
|
-
if (field.name === item.name) {
|
|
2608
|
-
return { ...field, dir: newDirection };
|
|
2609
|
-
}
|
|
2610
|
-
return field;
|
|
2611
|
-
});
|
|
2612
|
-
});
|
|
2613
|
-
}
|
|
2614
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPQuerySortsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2615
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: AXPQuerySortsComponent, isStandalone: true, selector: "axp-query-sorts", inputs: { sortDefinitions: { classPropertyName: "sortDefinitions", publicName: "sortDefinitions", isSignal: true, isRequired: false, transformFunction: null }, initialSortQueries: { classPropertyName: "initialSortQueries", publicName: "initialSortQueries", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sortDefinitions: "sortDefinitionsChange", sortQueriesChange: "sortQueriesChange" }, ngImport: i0, template: "<div class=\"ax-flex ax-flex-col ax-justify-center ax-gap-4 ax-select-none\">\n <div class=\"ax-flex ax-flex-col ax-gap-4 ax-select-none\" cdkDropList (cdkDropListDropped)=\"drop($event)\">\n <div class=\"ax-flex ax-flex-col ax-gap-3 ax-w-full ax-sorted-list ax-max-h-[calc(100vh-280px)] ax-overflow-auto\">\n @for (item of sortDefinitions(); track item.name) {\n <div class=\"ax-flex ax-py-1 ax-items-center ax-justify-between\" cdkDrag cdkDragBoundary=\".ax-sorted-list\">\n <div class=\"ax-flex ax-items-center ax-gap-3\" cdkDragHandle>\n <ax-icon class=\"fa-solid fa-grip-dots-vertical ax-cursor-move\"></ax-icon>\n <p class=\"ax-font-medium ax-text-sm\">{{ item.title | translate | async }}</p>\n </div>\n <ax-button [color]=\"'blank'\" class=\"ax-sm\" (click)=\"changeItemSort(item)\">\n <ax-icon\n [class.ax-text-primary]=\"getSortDirection(item) === 'asc'\"\n class=\"fa-solid fa-arrow-up-long ax-text-neutral-400\"\n ></ax-icon>\n <ax-icon\n [class.ax-text-primary]=\"getSortDirection(item) === 'desc'\"\n class=\"fa-solid fa-arrow-down-long ax-text-neutral-400\"\n ></ax-icon>\n </ax-button>\n </div>\n }\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "ngmodule", type: AXTabsModule }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i7.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i2$2.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: "pipe", type: i5.AXTranslatorPipe, name: "translate" }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
2616
|
-
}
|
|
2617
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPQuerySortsComponent, decorators: [{
|
|
2618
|
-
type: Component,
|
|
2619
|
-
args: [{ selector: 'axp-query-sorts', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [
|
|
2620
|
-
CdkDropList,
|
|
2621
|
-
CdkDrag,
|
|
2622
|
-
CdkDragHandle,
|
|
2623
|
-
AXTabsModule,
|
|
2624
|
-
AXTranslationModule,
|
|
2625
|
-
CommonModule,
|
|
2626
|
-
AXDecoratorModule,
|
|
2627
|
-
AXButtonModule,
|
|
2628
|
-
], template: "<div class=\"ax-flex ax-flex-col ax-justify-center ax-gap-4 ax-select-none\">\n <div class=\"ax-flex ax-flex-col ax-gap-4 ax-select-none\" cdkDropList (cdkDropListDropped)=\"drop($event)\">\n <div class=\"ax-flex ax-flex-col ax-gap-3 ax-w-full ax-sorted-list ax-max-h-[calc(100vh-280px)] ax-overflow-auto\">\n @for (item of sortDefinitions(); track item.name) {\n <div class=\"ax-flex ax-py-1 ax-items-center ax-justify-between\" cdkDrag cdkDragBoundary=\".ax-sorted-list\">\n <div class=\"ax-flex ax-items-center ax-gap-3\" cdkDragHandle>\n <ax-icon class=\"fa-solid fa-grip-dots-vertical ax-cursor-move\"></ax-icon>\n <p class=\"ax-font-medium ax-text-sm\">{{ item.title | translate | async }}</p>\n </div>\n <ax-button [color]=\"'blank'\" class=\"ax-sm\" (click)=\"changeItemSort(item)\">\n <ax-icon\n [class.ax-text-primary]=\"getSortDirection(item) === 'asc'\"\n class=\"fa-solid fa-arrow-up-long ax-text-neutral-400\"\n ></ax-icon>\n <ax-icon\n [class.ax-text-primary]=\"getSortDirection(item) === 'desc'\"\n class=\"fa-solid fa-arrow-down-long ax-text-neutral-400\"\n ></ax-icon>\n </ax-button>\n </div>\n }\n </div>\n </div>\n</div>\n" }]
|
|
2629
|
-
}], ctorParameters: () => [] });
|
|
2630
|
-
|
|
2631
|
-
class AXPTemplateViewerComponent extends AXBasePageComponent {
|
|
2632
|
-
constructor() {
|
|
2633
|
-
super(...arguments);
|
|
2634
|
-
//#endregion
|
|
2635
|
-
//#region ---- Component State ----
|
|
2636
|
-
this.context = {};
|
|
2637
|
-
this.document = signal({ type: AXPWidgetsCatalog.document }, ...(ngDevMode ? [{ debugName: "document" }] : []));
|
|
2638
|
-
this.currentPageIndex = signal(0, ...(ngDevMode ? [{ debugName: "currentPageIndex" }] : []));
|
|
2639
|
-
this._config = signal(undefined, ...(ngDevMode ? [{ debugName: "_config" }] : []));
|
|
2640
|
-
this.currentPage = computed(() => {
|
|
2641
|
-
return (this.document().children?.[this.currentPageIndex()] ?? { type: AXPWidgetsCatalog.pageLayout });
|
|
2642
|
-
}, ...(ngDevMode ? [{ debugName: "currentPage" }] : []));
|
|
2643
|
-
}
|
|
2644
|
-
//#region ---- Input Properties ----
|
|
2645
|
-
set config(value) {
|
|
2646
|
-
this._config.set(value);
|
|
2647
|
-
}
|
|
2648
|
-
get config() {
|
|
2649
|
-
return this._config();
|
|
2650
|
-
}
|
|
2651
|
-
//#endregion
|
|
2652
|
-
//#region ---- Lifecycle Methods ----
|
|
2653
|
-
async ngOnInit() {
|
|
2654
|
-
super.ngOnInit();
|
|
2655
|
-
await this.loadTemplate();
|
|
2656
|
-
}
|
|
2657
|
-
//#endregion
|
|
2658
|
-
//#region ---- Template Loading ----
|
|
2659
|
-
async loadTemplate() {
|
|
2660
|
-
const config = this.config;
|
|
2661
|
-
if (!config)
|
|
2662
|
-
return;
|
|
2663
|
-
let templateData;
|
|
2664
|
-
if (typeof config.template === 'string') {
|
|
2665
|
-
try {
|
|
2666
|
-
templateData = JSON.parse(config.template);
|
|
2667
|
-
}
|
|
2668
|
-
catch (error) {
|
|
2669
|
-
console.error('Failed to parse template JSON:', error);
|
|
2670
|
-
return;
|
|
2671
|
-
}
|
|
2672
|
-
}
|
|
2673
|
-
else {
|
|
2674
|
-
templateData = config.template;
|
|
2675
|
-
}
|
|
2676
|
-
this.document.set(templateData);
|
|
2677
|
-
// Set initial context if provided
|
|
2678
|
-
if (config.context) {
|
|
2679
|
-
this.context = { ...config.context };
|
|
2680
|
-
}
|
|
2681
|
-
}
|
|
2682
|
-
//#endregion
|
|
2683
|
-
//#region ---- Event Handlers ----
|
|
2684
|
-
handleContextChanged(e) {
|
|
2685
|
-
this.context = e.data;
|
|
2686
|
-
}
|
|
2687
|
-
async handleSubmit(form) {
|
|
2688
|
-
const formResult = await form.validate();
|
|
2689
|
-
if (formResult.result) {
|
|
2690
|
-
this.close({
|
|
2691
|
-
context: this.context,
|
|
2692
|
-
cancelled: false,
|
|
2693
|
-
metadata: this.config?.metadata
|
|
2694
|
-
});
|
|
2695
|
-
}
|
|
2696
|
-
}
|
|
2697
|
-
handleCancel() {
|
|
2698
|
-
this.close({
|
|
2699
|
-
context: this.context,
|
|
2700
|
-
cancelled: true,
|
|
2701
|
-
metadata: this.config?.metadata
|
|
2702
|
-
});
|
|
2703
|
-
}
|
|
2704
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPTemplateViewerComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
2705
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: AXPTemplateViewerComponent, isStandalone: true, selector: "axp-template-viewer", inputs: { config: "config" }, usesInheritance: true, ngImport: i0, template: `
|
|
2706
|
-
<div class="ax-p-4 ax-min-h-64">
|
|
2707
|
-
<ax-form #form>
|
|
2708
|
-
<axp-widgets-container [context]="context" (onContextChanged)="handleContextChanged($event)" >
|
|
2709
|
-
<ng-container axp-widget-renderer [node]="currentPage()" [mode]="config?.readOnly ? 'view' : 'edit'"></ng-container>
|
|
2710
|
-
</axp-widgets-container>
|
|
2711
|
-
</ax-form>
|
|
2712
|
-
</div>
|
|
2713
|
-
|
|
2714
|
-
@if (config?.showActions !== false) {
|
|
2715
|
-
<ax-footer *translate="let t">
|
|
2716
|
-
<ax-suffix>
|
|
2717
|
-
<ax-button [text]="t('cancel') | async" (onClick)="handleCancel()"></ax-button>
|
|
2718
|
-
@if (!config?.readOnly) {
|
|
2719
|
-
<ax-button color="primary" [text]="t('submit') | async" (onClick)="handleSubmit(form)"></ax-button>
|
|
2720
|
-
}
|
|
2721
|
-
</ax-suffix>
|
|
2722
|
-
</ax-footer>
|
|
2723
|
-
}
|
|
2724
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXPLayoutBuilderModule }, { kind: "component", type: i3$3.AXPWidgetContainerComponent, selector: "axp-widgets-container", inputs: ["context", "functions"], outputs: ["onContextChanged"] }, { kind: "directive", type: i3$3.AXPWidgetRendererDirective, selector: "[axp-widget-renderer]", inputs: ["parentNode", "index", "mode", "node"], outputs: ["onOptionsChanged", "onValueChanged"], exportAs: ["widgetRenderer"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i7.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$2.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: AXFormModule }, { kind: "component", type: i2$1.AXFormComponent, selector: "ax-form", inputs: ["labelMode", "look", "messageStyle", "updateOn"], outputs: ["onValidate", "updateOnChange"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "directive", type: i5.AXTranslatorDirective, selector: "[translate]" }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
2725
|
-
}
|
|
2726
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPTemplateViewerComponent, decorators: [{
|
|
2727
|
-
type: Component,
|
|
2728
|
-
args: [{
|
|
2729
|
-
selector: 'axp-template-viewer',
|
|
2730
|
-
template: `
|
|
2731
|
-
<div class="ax-p-4 ax-min-h-64">
|
|
2732
|
-
<ax-form #form>
|
|
2733
|
-
<axp-widgets-container [context]="context" (onContextChanged)="handleContextChanged($event)" >
|
|
2734
|
-
<ng-container axp-widget-renderer [node]="currentPage()" [mode]="config?.readOnly ? 'view' : 'edit'"></ng-container>
|
|
2735
|
-
</axp-widgets-container>
|
|
2736
|
-
</ax-form>
|
|
2737
|
-
</div>
|
|
2738
|
-
|
|
2739
|
-
@if (config?.showActions !== false) {
|
|
2740
|
-
<ax-footer *translate="let t">
|
|
2741
|
-
<ax-suffix>
|
|
2742
|
-
<ax-button [text]="t('cancel') | async" (onClick)="handleCancel()"></ax-button>
|
|
2743
|
-
@if (!config?.readOnly) {
|
|
2744
|
-
<ax-button color="primary" [text]="t('submit') | async" (onClick)="handleSubmit(form)"></ax-button>
|
|
2745
|
-
}
|
|
2746
|
-
</ax-suffix>
|
|
2747
|
-
</ax-footer>
|
|
2748
|
-
}
|
|
2749
|
-
`,
|
|
2750
|
-
encapsulation: ViewEncapsulation.None,
|
|
2751
|
-
imports: [CommonModule, AXPLayoutBuilderModule, AXDecoratorModule, AXButtonModule, AXFormModule, AXTranslationModule]
|
|
2752
|
-
}]
|
|
2753
|
-
}], propDecorators: { config: [{
|
|
2754
|
-
type: Input
|
|
2755
|
-
}] } });
|
|
2756
|
-
|
|
2757
|
-
var templateViewer_component = /*#__PURE__*/Object.freeze({
|
|
2758
|
-
__proto__: null,
|
|
2759
|
-
AXPTemplateViewerComponent: AXPTemplateViewerComponent
|
|
2760
|
-
});
|
|
2761
|
-
|
|
2762
|
-
class AXPTemplateViewerService {
|
|
2763
|
-
constructor() {
|
|
2764
|
-
this.popupService = inject(AXPopupService);
|
|
2765
|
-
}
|
|
2766
|
-
/**
|
|
2767
|
-
* Show a template viewer dialog with the given configuration
|
|
2768
|
-
* @param config Template viewer configuration including template, title, and UI options
|
|
2769
|
-
* @returns Promise resolving to viewer result with form values and cancellation status
|
|
2770
|
-
*/
|
|
2771
|
-
async showTemplate(config) {
|
|
2772
|
-
const component = await Promise.resolve().then(function () { return templateViewer_component; }).then(c => c.AXPTemplateViewerComponent);
|
|
2773
|
-
const result = await this.popupService.open(component, {
|
|
2774
|
-
title: config.title || 'Template Viewer',
|
|
2775
|
-
size: config.size || 'md',
|
|
2776
|
-
closeButton: false,
|
|
2777
|
-
closeOnBackdropClick: false,
|
|
2778
|
-
draggable: false,
|
|
2779
|
-
data: { config }
|
|
2780
|
-
});
|
|
2781
|
-
return result?.data || { context: config.context, cancelled: true, metadata: config.metadata };
|
|
2782
|
-
}
|
|
2783
|
-
/**
|
|
2784
|
-
* Show a template viewer in read-only mode
|
|
2785
|
-
* @param config Template viewer configuration
|
|
2786
|
-
* @returns Promise resolving to viewer result
|
|
2787
|
-
*/
|
|
2788
|
-
async showTemplateReadOnly(config) {
|
|
2789
|
-
return this.showTemplate({
|
|
2790
|
-
...config,
|
|
2791
|
-
readOnly: true,
|
|
2792
|
-
showActions: false
|
|
2793
|
-
});
|
|
2794
|
-
}
|
|
2795
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPTemplateViewerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2796
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPTemplateViewerService, providedIn: 'root' }); }
|
|
2797
|
-
}
|
|
2798
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPTemplateViewerService, decorators: [{
|
|
2799
|
-
type: Injectable,
|
|
2800
|
-
args: [{
|
|
2801
|
-
providedIn: 'root'
|
|
2802
|
-
}]
|
|
2803
|
-
}] });
|
|
2804
|
-
|
|
2805
1457
|
const AXP_USER_AVATAR_PROVIDER = new InjectionToken('AXP_USER_AVATAR_PROVIDER', {
|
|
2806
1458
|
providedIn: 'root',
|
|
2807
1459
|
factory: () => {
|
|
@@ -3029,7 +1681,7 @@ class AXPUserAvatarComponent {
|
|
|
3029
1681
|
return colors[idx];
|
|
3030
1682
|
}
|
|
3031
1683
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPUserAvatarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3032
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: AXPUserAvatarComponent, isStandalone: true, selector: "axp-user-avatar", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, userId: { classPropertyName: "userId", publicName: "userId", isSignal: true, isRequired: false, transformFunction: null } }, providers: [], ngImport: i0, template: "<ax-avatar #avatar [size]=\"size()\" class=\"ax-cursor-pointer\">\n @if(hasPicture()){\n <ax-image (onError)=\"onImageError($event)\" (onLoad)=\"onImageLoad($event)\" [src]=\"src()\"></ax-image>\n }@else{\n <ax-text class=\"ax-{{ avatarColor() }}-lightest \">\n <small class=\"ax-text-xs ax-font-semibold\">{{ avatarText() }}</small>\n </ax-text>\n }\n</ax-avatar>\n\n<!--\n\nax-primary-lightest\nax-warning-lightest\nax-success-lightest\nax-danger-lightest\nax-secondary-lightest\nax-accent1-lightest\nax-accent2-lightest\nax-accent3-lightest\n\n-->\n", styles: [""], dependencies: [{ kind: "ngmodule", type: AXAvatarModule }, { kind: "component", type: i1$
|
|
1684
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: AXPUserAvatarComponent, isStandalone: true, selector: "axp-user-avatar", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, userId: { classPropertyName: "userId", publicName: "userId", isSignal: true, isRequired: false, transformFunction: null } }, providers: [], ngImport: i0, template: "<ax-avatar #avatar [size]=\"size()\" class=\"ax-cursor-pointer\">\n @if(hasPicture()){\n <ax-image (onError)=\"onImageError($event)\" (onLoad)=\"onImageLoad($event)\" [src]=\"src()\"></ax-image>\n }@else{\n <ax-text class=\"ax-{{ avatarColor() }}-lightest \">\n <small class=\"ax-text-xs ax-font-semibold\">{{ avatarText() }}</small>\n </ax-text>\n }\n</ax-avatar>\n\n<!--\n\nax-primary-lightest\nax-warning-lightest\nax-success-lightest\nax-danger-lightest\nax-secondary-lightest\nax-accent1-lightest\nax-accent2-lightest\nax-accent3-lightest\n\n-->\n", styles: [""], dependencies: [{ kind: "ngmodule", type: AXAvatarModule }, { kind: "component", type: i1$3.AXAvatarComponent, selector: "ax-avatar", inputs: ["color", "size", "shape", "look"], outputs: ["sizeChange"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3.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: AXImageModule }, { kind: "component", type: i3$3.AXImageComponent, selector: "ax-image", inputs: ["width", "height", "overlayMode", "src", "alt", "priority", "lazy"], outputs: ["onLoad", "onError"] }, { kind: "ngmodule", type: AXBadgeModule }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
3033
1685
|
}
|
|
3034
1686
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPUserAvatarComponent, decorators: [{
|
|
3035
1687
|
type: Component,
|
|
@@ -3041,46 +1693,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
3041
1693
|
], encapsulation: ViewEncapsulation.None, providers: [], template: "<ax-avatar #avatar [size]=\"size()\" class=\"ax-cursor-pointer\">\n @if(hasPicture()){\n <ax-image (onError)=\"onImageError($event)\" (onLoad)=\"onImageLoad($event)\" [src]=\"src()\"></ax-image>\n }@else{\n <ax-text class=\"ax-{{ avatarColor() }}-lightest \">\n <small class=\"ax-text-xs ax-font-semibold\">{{ avatarText() }}</small>\n </ax-text>\n }\n</ax-avatar>\n\n<!--\n\nax-primary-lightest\nax-warning-lightest\nax-success-lightest\nax-danger-lightest\nax-secondary-lightest\nax-accent1-lightest\nax-accent2-lightest\nax-accent3-lightest\n\n-->\n" }]
|
|
3042
1694
|
}] });
|
|
3043
1695
|
|
|
3044
|
-
class AXPQueryViewsComponent {
|
|
3045
|
-
constructor() {
|
|
3046
|
-
this.popupService = inject(AXPopupService);
|
|
3047
|
-
this.translate = inject(AXTranslationService);
|
|
3048
|
-
this.tabs = viewChild('tabs', ...(ngDevMode ? [{ debugName: "tabs" }] : []));
|
|
3049
|
-
this.views = model([], ...(ngDevMode ? [{ debugName: "views" }] : []));
|
|
3050
|
-
this.selectedView = model.required(...(ngDevMode ? [{ debugName: "selectedView" }] : []));
|
|
3051
|
-
this.isMounted = signal(false, ...(ngDevMode ? [{ debugName: "isMounted" }] : []));
|
|
3052
|
-
this.#effect = effect(() => {
|
|
3053
|
-
if (!this.isMounted())
|
|
3054
|
-
return;
|
|
3055
|
-
const views = untracked(() => this.views());
|
|
3056
|
-
if (!views)
|
|
3057
|
-
return;
|
|
3058
|
-
const selectedTab = views.findIndex((v) => v.name == this.selectedView().name);
|
|
3059
|
-
untracked(() => {
|
|
3060
|
-
if (selectedTab != -1) {
|
|
3061
|
-
this.tabs()?.select(selectedTab);
|
|
3062
|
-
}
|
|
3063
|
-
});
|
|
3064
|
-
}, ...(ngDevMode ? [{ debugName: "#effect" }] : []));
|
|
3065
|
-
}
|
|
3066
|
-
ngAfterViewInit() {
|
|
3067
|
-
this.isMounted.set(true);
|
|
3068
|
-
}
|
|
3069
|
-
#effect;
|
|
3070
|
-
setView(view) {
|
|
3071
|
-
this.selectedView.set(view);
|
|
3072
|
-
}
|
|
3073
|
-
handleActiveChange(e) {
|
|
3074
|
-
console.log(e);
|
|
3075
|
-
}
|
|
3076
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPQueryViewsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3077
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: AXPQueryViewsComponent, isStandalone: true, selector: "axp-query-views", inputs: { views: { classPropertyName: "views", publicName: "views", isSignal: true, isRequired: false, transformFunction: null }, selectedView: { classPropertyName: "selectedView", publicName: "selectedView", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { views: "viewsChange", selectedView: "selectedViewChange" }, viewQueries: [{ propertyName: "tabs", first: true, predicate: ["tabs"], descendants: true, isSignal: true }], ngImport: i0, template: "<ax-tabs #tabs [look]=\"'with-line'\" class=\"ax-font-semibold\">\n @for (item of views(); track item.name) {\n <ax-tab-item (onClick)=\"setView(item)\" [key]=\"item.name\" [text]=\"(item.title | translate | async) || 'item.title'\">\n </ax-tab-item>\n }\n <!-- <ax-tab-item\n (onClick)=\"createNew()\"\n [key]=\"'create-new'\"\n [text]=\"('view.createNew' | translate | async) || 'Create New'\"\n >\n </ax-tab-item> -->\n</ax-tabs>\n", dependencies: [{ kind: "ngmodule", type: AXTabsModule }, { kind: "component", type: i2$3.AXTabsComponent, selector: "ax-tabs", inputs: ["look", "location", "fitParent", "minWidth", "content"], outputs: ["onActiveTabChanged"] }, { kind: "component", type: i2$3.AXTabItemComponent, selector: "ax-tab-item", inputs: ["disabled", "text", "key", "headerTemplate", "active"], outputs: ["disabledChange", "onClick", "onBlur", "onFocus", "activeChange"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i5.AXTranslatorPipe, name: "translate" }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
3078
|
-
}
|
|
3079
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPQueryViewsComponent, decorators: [{
|
|
3080
|
-
type: Component,
|
|
3081
|
-
args: [{ selector: 'axp-query-views', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [AXTabsModule, AXTranslationModule, CommonModule], template: "<ax-tabs #tabs [look]=\"'with-line'\" class=\"ax-font-semibold\">\n @for (item of views(); track item.name) {\n <ax-tab-item (onClick)=\"setView(item)\" [key]=\"item.name\" [text]=\"(item.title | translate | async) || 'item.title'\">\n </ax-tab-item>\n }\n <!-- <ax-tab-item\n (onClick)=\"createNew()\"\n [key]=\"'create-new'\"\n [text]=\"('view.createNew' | translate | async) || 'Create New'\"\n >\n </ax-tab-item> -->\n</ax-tabs>\n" }]
|
|
3082
|
-
}] });
|
|
3083
|
-
|
|
3084
1696
|
/**
|
|
3085
1697
|
* Generic widget item component for displaying selectable widgets with icons, titles, and descriptions.
|
|
3086
1698
|
* Can be used across different modules for consistent widget display and interaction.
|
|
@@ -3139,5 +1751,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
3139
1751
|
* Generated bundle index. Do not edit.
|
|
3140
1752
|
*/
|
|
3141
1753
|
|
|
3142
|
-
export { AXPActivityLogComponent, AXPCompareViewComponent, AXPComponentSlot, AXPComponentSlotDirective, AXPComponentSlotModule, AXPComponentSlotRegistryService,
|
|
1754
|
+
export { AXPActivityLogComponent, AXPCompareViewComponent, AXPComponentSlot, AXPComponentSlotDirective, AXPComponentSlotModule, AXPComponentSlotRegistryService, AXPDynamicFormComponent, AXPLayoutFiltersComponent, AXPMenuBadgeHelper, AXPTaskBadgeDirective, AXPTaskBadgeProvider, AXPTaskBadgeService, AXPThemeLayoutActionsComponent, AXPThemeLayoutBlockComponent, AXPThemeLayoutContainerComponent, AXPThemeLayoutEndSideComponent, AXPThemeLayoutFooterComponent, AXPThemeLayoutHeaderComponent, AXPThemeLayoutListComponent, AXPThemeLayoutListItemComponent, AXPThemeLayoutListItemsGroupComponent, AXPThemeLayoutPageHeaderComponent, AXPThemeLayoutPagePrimaryActionsComponent, AXPThemeLayoutPageSecondaryActionsComponent, AXPThemeLayoutSectionComponent, AXPThemeLayoutStartSideComponent, AXPThemeLayoutToolbarComponent, AXPUserAvatarComponent, AXPUserAvatarService, AXPWidgetItemComponent, AXP_TASK_BADGE_PROVIDERS, AXP_USER_AVATAR_PROVIDER };
|
|
3143
1755
|
//# sourceMappingURL=acorex-platform-layout-components.mjs.map
|