@acorex/platform 18.0.16 → 18.1.0
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/lib/schema/entity/entity.class.d.ts +2 -1
- package/esm2022/common/lib/schema/entity/entity.class.mjs +1 -1
- package/esm2022/common/lib/workflows/common.workflow.mjs +1 -1
- package/esm2022/layout/designer/lib/designer/components/header-menu/header-menu.component.mjs +1 -1
- package/esm2022/layout/designer/lib/designer/designer.component.mjs +2 -2
- package/esm2022/layout/entity/lib/entity.module.mjs +4 -2
- package/esm2022/layout/entity/lib/widgets/lookup-widget/lookup-widget-view.component.mjs +7 -4
- package/esm2022/layout/entity/lib/workflows/create-entity.workflow.mjs +4 -3
- package/esm2022/layout/entity/lib/workflows/delete-entity.workflow.mjs +10 -11
- package/esm2022/layouts/lib/admin/entity-layout/entity-create-view/entity-create-view.component.mjs +3 -2
- package/esm2022/layouts/lib/admin/entity-layout/entity-details-view/detail-view.config.mjs +2 -3
- package/esm2022/layouts/lib/admin/entity-layout/entity-list-view/entity-list-view.component.mjs +3 -3
- package/esm2022/layouts/lib/admin/entity-layout/index.mjs +2 -2
- package/esm2022/layouts/lib/admin/entity-layout/workflows/show-list.workflow.mjs +2 -2
- package/esm2022/themes/default/lib/entity-reuse.strategy.mjs +2 -4
- package/esm2022/themes/default/lib/layouts/entity-layouts/entity-detail-list-view/entity-detail-list-view.component.mjs +33 -6
- package/esm2022/themes/default/lib/layouts/entity-layouts/entity-master-list-view/entity-master-list-view.component.mjs +4 -4
- package/esm2022/themes/default/lib/layouts/entity-layouts/entity-master-single-view/comments/comment-list-view.component.mjs +4 -4
- package/esm2022/widgets/lib/properties/editors.props.mjs +61 -2
- package/esm2022/widgets/lib/properties/table-column.props.mjs +17 -2
- package/esm2022/widgets/lib/widgets/actions/button/button-widget-designer.component.mjs +23 -7
- package/esm2022/widgets/lib/widgets/actions/button/button-widget-view.component.mjs +24 -8
- package/esm2022/widgets/lib/widgets/actions/button/button-widget.config.mjs +4 -2
- package/esm2022/widgets/lib/widgets/advance/file/file-box-widget-column.component.mjs +3 -3
- package/esm2022/widgets/lib/widgets/advance/gallery/gallery-widget-column.component.mjs +3 -3
- package/esm2022/widgets/lib/widgets/advance/map/map-box-widget-edit.component.mjs +7 -3
- package/esm2022/widgets/lib/widgets/advance/map/map-box-widget.config.mjs +4 -4
- package/esm2022/widgets/lib/widgets/advance/qrcode/qrcode-widget.config.mjs +3 -3
- package/esm2022/widgets/lib/widgets/advance/signature/signature-pad-widget-column.component.mjs +3 -3
- package/esm2022/widgets/lib/widgets/editors/checkbox/checkbox-widget-column.component.mjs +6 -6
- package/esm2022/widgets/lib/widgets/editors/contact/contact-widget-edit.component.mjs +23 -14
- package/esm2022/widgets/lib/widgets/editors/contact/contact-widget-view.component.mjs +58 -58
- package/esm2022/widgets/lib/widgets/editors/contact/contact-widget.config.mjs +3 -3
- package/esm2022/widgets/lib/widgets/editors/contact/index.mjs +3 -4
- package/esm2022/widgets/lib/widgets/editors/date-time/date-time-box-widget-column.component.mjs +1 -1
- package/esm2022/widgets/lib/widgets/editors/date-time/date-time-box-widget-edit.component.mjs +63 -41
- package/esm2022/widgets/lib/widgets/editors/date-time/date-time-box-widget-view.component.mjs +14 -20
- package/esm2022/widgets/lib/widgets/editors/large-text/large-text-widget-column.component.mjs +1 -1
- package/esm2022/widgets/lib/widgets/editors/large-text/large-text-widget-edit.component.mjs +1 -1
- package/esm2022/widgets/lib/widgets/editors/large-text/large-text-widget-view.component.mjs +1 -1
- package/esm2022/widgets/lib/widgets/editors/large-text/large-text-widget.config.mjs +5 -4
- package/esm2022/widgets/lib/widgets/editors/number/number-box-widget-edit.component.mjs +49 -57
- package/esm2022/widgets/lib/widgets/editors/number/number-box-widget-view.component.mjs +11 -17
- package/esm2022/widgets/lib/widgets/editors/number/number-box-widget.config.mjs +3 -2
- package/esm2022/widgets/lib/widgets/editors/password/password-box-widget-column.component.mjs +44 -7
- package/esm2022/widgets/lib/widgets/editors/password/password-box-widget-edit.component.mjs +1 -1
- package/esm2022/widgets/lib/widgets/editors/password/password-box-widget-view.component.mjs +11 -5
- package/esm2022/widgets/lib/widgets/editors/rich-text/rich-text-widget-edit.component.mjs +33 -15
- package/esm2022/widgets/lib/widgets/editors/rich-text/rich-text-widget.config.mjs +4 -4
- package/esm2022/widgets/lib/widgets/editors/selection-list/selection-list-widget-column.component.mjs +20 -6
- package/esm2022/widgets/lib/widgets/editors/selection-list/selection-list-widget.config.mjs +4 -4
- package/esm2022/widgets/lib/widgets/editors/text/text-box-widget.config.mjs +4 -4
- package/esm2022/widgets/lib/widgets.module.mjs +16 -10
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-designer.mjs +2 -2
- package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-entity.mjs +18 -13
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
- package/fesm2022/{acorex-platform-layouts-entity-create-view.component-C2pYReAo.mjs → acorex-platform-layouts-entity-create-view.component-CPGbLM4C.mjs} +3 -2
- package/fesm2022/acorex-platform-layouts-entity-create-view.component-CPGbLM4C.mjs.map +1 -0
- package/fesm2022/acorex-platform-layouts.mjs +1633 -1633
- package/fesm2022/acorex-platform-layouts.mjs.map +1 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-CWXJxLS0.mjs +281 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-CWXJxLS0.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-CGhOE3jO.mjs +357 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-CGhOE3jO.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default.mjs +11 -562
- package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
- package/fesm2022/{acorex-platform-widgets-button-widget-designer.component-C0S_HJkl.mjs → acorex-platform-widgets-button-widget-designer.component-COvuxaTt.mjs} +23 -7
- package/fesm2022/acorex-platform-widgets-button-widget-designer.component-COvuxaTt.mjs.map +1 -0
- package/fesm2022/{acorex-platform-widgets-checkbox-widget-column.component-BzNhzB9y.mjs → acorex-platform-widgets-checkbox-widget-column.component-j1jG8pCr.mjs} +6 -6
- package/fesm2022/acorex-platform-widgets-checkbox-widget-column.component-j1jG8pCr.mjs.map +1 -0
- package/fesm2022/acorex-platform-widgets-contact-widget-filter.component-GTwK51nJ.mjs +23 -0
- package/fesm2022/acorex-platform-widgets-contact-widget-filter.component-GTwK51nJ.mjs.map +1 -0
- package/fesm2022/acorex-platform-widgets.mjs +747 -586
- package/fesm2022/acorex-platform-widgets.mjs.map +1 -1
- package/layout/entity/lib/widgets/lookup-widget/lookup-widget-view.component.d.ts +1 -1
- package/layout/entity/lib/workflows/create-entity.workflow.d.ts +2 -0
- package/layout/entity/lib/workflows/delete-entity.workflow.d.ts +2 -0
- package/layouts/lib/admin/entity-layout/index.d.ts +1 -1
- package/package.json +12 -12
- package/themes/default/lib/entity-reuse.strategy.d.ts +1 -1
- package/themes/default/lib/layouts/entity-layouts/entity-detail-list-view/entity-detail-list-view.component.d.ts +5 -0
- package/widgets/lib/properties/editors.props.d.ts +4 -0
- package/widgets/lib/properties/table-column.props.d.ts +1 -0
- package/widgets/lib/widgets/actions/button/button-widget-designer.component.d.ts +2 -1
- package/widgets/lib/widgets/actions/button/button-widget-view.component.d.ts +2 -1
- package/widgets/lib/widgets/advance/file/file-box-widget-column.component.d.ts +1 -1
- package/widgets/lib/widgets/advance/gallery/gallery-widget-column.component.d.ts +1 -1
- package/widgets/lib/widgets/advance/map/map-box-widget-edit.component.d.ts +2 -0
- package/widgets/lib/widgets/advance/signature/signature-pad-widget-column.component.d.ts +1 -1
- package/widgets/lib/widgets/editors/checkbox/checkbox-widget-column.component.d.ts +1 -1
- package/widgets/lib/widgets/editors/contact/contact-widget-edit.component.d.ts +1 -0
- package/widgets/lib/widgets/editors/contact/contact-widget-view.component.d.ts +2 -2
- package/widgets/lib/widgets/editors/contact/index.d.ts +2 -3
- package/widgets/lib/widgets/editors/date-time/date-time-box-widget-column.component.d.ts +1 -1
- package/widgets/lib/widgets/editors/date-time/date-time-box-widget-edit.component.d.ts +2 -1
- package/widgets/lib/widgets/editors/date-time/date-time-box-widget-view.component.d.ts +2 -2
- package/widgets/lib/widgets/editors/large-text/large-text-widget-column.component.d.ts +1 -1
- package/widgets/lib/widgets/editors/large-text/large-text-widget-edit.component.d.ts +1 -1
- package/widgets/lib/widgets/editors/large-text/large-text-widget-view.component.d.ts +1 -1
- package/widgets/lib/widgets/editors/number/number-box-widget-edit.component.d.ts +1 -1
- package/widgets/lib/widgets/editors/password/password-box-widget-column.component.d.ts +7 -3
- package/widgets/lib/widgets/editors/password/password-box-widget-edit.component.d.ts +1 -1
- package/widgets/lib/widgets/editors/password/password-box-widget-view.component.d.ts +1 -1
- package/widgets/lib/widgets/editors/rich-text/rich-text-widget-edit.component.d.ts +2 -0
- package/widgets/lib/widgets/editors/selection-list/selection-list-widget-column.component.d.ts +1 -1
- package/fesm2022/acorex-platform-layouts-entity-create-view.component-C2pYReAo.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-button-widget-designer.component-C0S_HJkl.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-checkbox-widget-column.component-BzNhzB9y.mjs.map +0 -1
|
@@ -1,36 +1,63 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import * as i10$1 from '@acorex/platform/common';
|
|
7
|
-
import { AXPSchemaRegistryService, EQ_OPER, isSmallScreen, AXPEntityRegistryService, AXPLayoutService, AXP_MENU_LOADER, AXPLayoutChildDrawerToggle, convertPropertiesToColumns, AXPSchemaModule, AXPCommonWidgetModule, AXPEntityListViewConfigEmpty, AXPWorkflowNavigateAction, getChildDrawer, AXPLayoutChildDrawerClose, AXPStickyDirective, AXPCommonModule, AXMWorkflowErrorHandler, AXPDialogConfirmAction, AXPToastAction } from '@acorex/platform/common';
|
|
8
|
-
import * as i15 from '@angular/cdk/drag-drop';
|
|
9
|
-
import { moveItemInArray, CdkDropList, CdkDrag, CdkDragPlaceholder, CdkDragHandle } from '@angular/cdk/drag-drop';
|
|
10
|
-
import * as i0 from '@angular/core';
|
|
11
|
-
import { inject, signal, computed, Component, ChangeDetectionStrategy, Input, EventEmitter, Output, ViewEncapsulation, ChangeDetectorRef, ViewChild, Injectable, NgModule, InjectionToken } from '@angular/core';
|
|
12
|
-
import { cloneDeep, assign } from 'lodash-es';
|
|
13
|
-
import * as i1 from '@angular/common';
|
|
14
|
-
import { CommonModule, Location } from '@angular/common';
|
|
15
|
-
import * as i1$1 from '@angular/forms';
|
|
16
|
-
import { FormsModule } from '@angular/forms';
|
|
1
|
+
import * as i1$3 from '@acorex/components/action-sheet';
|
|
2
|
+
import { AXActionSheetModule } from '@acorex/components/action-sheet';
|
|
3
|
+
import * as i5 from '@acorex/components/badge';
|
|
4
|
+
import { AXBadgeModule } from '@acorex/components/badge';
|
|
5
|
+
import { AXBreadcrumbsModule } from '@acorex/components/breadcrumbs';
|
|
17
6
|
import * as i4 from '@acorex/components/button';
|
|
18
7
|
import { AXButtonModule } from '@acorex/components/button';
|
|
19
8
|
import * as i4$1 from '@acorex/components/decorators';
|
|
20
9
|
import { AXDecoratorModule } from '@acorex/components/decorators';
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
10
|
+
import { AXDialogService, AXDialogModule } from '@acorex/components/dialog';
|
|
11
|
+
import * as i11 from '@acorex/components/drawer';
|
|
12
|
+
import { AXDrawerModule } from '@acorex/components/drawer';
|
|
13
|
+
import * as i6 from '@acorex/components/dropdown';
|
|
14
|
+
import { AXDropdownModule } from '@acorex/components/dropdown';
|
|
15
|
+
import * as i2$1 from '@acorex/components/form';
|
|
16
|
+
import { AXFormModule } from '@acorex/components/form';
|
|
25
17
|
import * as i7 from '@acorex/components/image';
|
|
26
18
|
import { AXImageModule } from '@acorex/components/image';
|
|
27
|
-
import
|
|
19
|
+
import { AXLoadingModule } from '@acorex/components/loading';
|
|
20
|
+
import * as i6$1 from '@acorex/components/popover';
|
|
21
|
+
import { AXPopoverModule } from '@acorex/components/popover';
|
|
22
|
+
import { AXPopupService } from '@acorex/components/popup';
|
|
23
|
+
import * as i8$1 from '@acorex/components/switch';
|
|
28
24
|
import { AXSwitchModule } from '@acorex/components/switch';
|
|
29
25
|
import * as i9 from '@acorex/components/tabs';
|
|
30
26
|
import { AXTabsModule } from '@acorex/components/tabs';
|
|
31
|
-
import
|
|
27
|
+
import { AXTooltipModule } from '@acorex/components/tooltip';
|
|
28
|
+
import * as i3 from '@acorex/core/platform';
|
|
29
|
+
import { AXPlatform } from '@acorex/core/platform';
|
|
30
|
+
import * as i8 from '@acorex/core/translation';
|
|
31
|
+
import { AXTranslationService, AXTranslationModule } from '@acorex/core/translation';
|
|
32
|
+
import * as i2 from '@acorex/core/utils';
|
|
33
|
+
import { AXUnsubscriber } from '@acorex/core/utils';
|
|
34
|
+
import * as i14$1 from '@acorex/platform/auth';
|
|
35
|
+
import { AXPSessionService, AXPAuthModule, AXPAuthGuard } from '@acorex/platform/auth';
|
|
36
|
+
import * as i10 from '@acorex/platform/common';
|
|
37
|
+
import { AXPEntityRegistryService, AXPLayoutService, AXPWorkflowNavigateAction, isSmallScreen, getChildDrawer, AXPLayoutChildDrawerClose, AXPLayoutChildDrawerToggle, AXPSchemaModule, AXPCommonWidgetModule, AXPStickyDirective, AXPSchemaRegistryService, EQ_OPER, AXP_MENU_LOADER, convertPropertiesToColumns, AXPEntityListViewConfigEmpty, AXPCommonModule, AXMWorkflowErrorHandler, AXPDialogConfirmAction, AXPToastAction } from '@acorex/platform/common';
|
|
38
|
+
import * as i1$4 from '@acorex/platform/workflow';
|
|
39
|
+
import { createWorkFlowEvent, AXPWorkflowAction, AXPWorkflowFunction, AXPWorkflowService, ofType as ofType$1, AXPWorkflowModule } from '@acorex/platform/workflow';
|
|
40
|
+
import * as i1$1 from '@angular/common';
|
|
41
|
+
import { Location, CommonModule } from '@angular/common';
|
|
42
|
+
import * as i0 from '@angular/core';
|
|
43
|
+
import { inject, Injectable, ChangeDetectorRef, signal, Component, ChangeDetectionStrategy, ViewChild, computed, Input, EventEmitter, Output, ViewEncapsulation, NgModule, InjectionToken } from '@angular/core';
|
|
44
|
+
import { ActivatedRoute, Router, RouterModule, RouteReuseStrategy } from '@angular/router';
|
|
45
|
+
import * as i1 from '@ngrx/effects';
|
|
46
|
+
import { ofType } from '@ngrx/effects';
|
|
47
|
+
import { Store } from '@ngrx/store';
|
|
48
|
+
import { cloneDeep, assign } from 'lodash-es';
|
|
49
|
+
import { BehaviorSubject, defaultIfEmpty, switchMap, of, map, first } from 'rxjs';
|
|
50
|
+
import { AXFormatService } from '@acorex/core/format';
|
|
51
|
+
import { AXLoadingDialogService } from '@acorex/components/loading-dialog';
|
|
52
|
+
import { AXBasePageComponent } from '@acorex/components/page';
|
|
53
|
+
import { AXToastService } from '@acorex/components/toast';
|
|
54
|
+
import * as i15 from '@angular/cdk/drag-drop';
|
|
55
|
+
import { moveItemInArray, CdkDropList, CdkDrag, CdkDragPlaceholder, CdkDragHandle } from '@angular/cdk/drag-drop';
|
|
56
|
+
import * as i1$2 from '@angular/forms';
|
|
57
|
+
import { FormsModule } from '@angular/forms';
|
|
58
|
+
import * as i10$1 from '@acorex/components/select-box';
|
|
32
59
|
import { AXSelectBoxComponent, AXSelectBoxModule } from '@acorex/components/select-box';
|
|
33
|
-
import * as i11 from '@acorex/components/text-box';
|
|
60
|
+
import * as i11$1 from '@acorex/components/text-box';
|
|
34
61
|
import { AXTextBoxModule } from '@acorex/components/text-box';
|
|
35
62
|
import * as i7$1 from '@acorex/components/label';
|
|
36
63
|
import { AXLabelModule } from '@acorex/components/label';
|
|
@@ -38,556 +65,108 @@ import * as i13 from '@acorex/components/selection-list';
|
|
|
38
65
|
import { AXSelectionListModule } from '@acorex/components/selection-list';
|
|
39
66
|
import * as i14 from '@acorex/components/dropdown-button';
|
|
40
67
|
import { AXDropdownButtonModule } from '@acorex/components/dropdown-button';
|
|
41
|
-
import * as
|
|
42
|
-
import { AXTranslationService, AXTranslationModule } from '@acorex/core/translation';
|
|
43
|
-
import { Store } from '@ngrx/store';
|
|
44
|
-
import { of, first, map, BehaviorSubject, defaultIfEmpty, switchMap } from 'rxjs';
|
|
45
|
-
import { AXPopupService } from '@acorex/components/popup';
|
|
46
|
-
import * as i1$2 from '@acorex/components/action-sheet';
|
|
47
|
-
import { AXActionSheetModule } from '@acorex/components/action-sheet';
|
|
48
|
-
import * as i6$1 from '@acorex/components/data-table';
|
|
68
|
+
import * as i6$2 from '@acorex/components/data-table';
|
|
49
69
|
import { AXDataTableModule } from '@acorex/components/data-table';
|
|
50
|
-
import * as i11$1 from '@acorex/components/drawer';
|
|
51
|
-
import { AXDrawerModule } from '@acorex/components/drawer';
|
|
52
|
-
import * as i3 from '@acorex/core/platform';
|
|
53
|
-
import { AXPlatform } from '@acorex/core/platform';
|
|
54
|
-
import { ActivatedRoute, Router, RouterModule, RouteReuseStrategy } from '@angular/router';
|
|
55
|
-
import * as i1$4 from '@acorex/platform/workflow';
|
|
56
|
-
import { createWorkFlowEvent, AXPWorkflowAction, AXPWorkflowFunction, AXPWorkflowService, ofType, AXPWorkflowModule } from '@acorex/platform/workflow';
|
|
57
|
-
import { AXFormatService } from '@acorex/core/format';
|
|
58
|
-
import { AXLoadingDialogService } from '@acorex/components/loading-dialog';
|
|
59
|
-
import * as i10$2 from '@acorex/components/dropdown';
|
|
60
|
-
import { AXDropdownModule } from '@acorex/components/dropdown';
|
|
61
70
|
import * as i12 from '@acorex/components/search-box';
|
|
62
71
|
import { AXSearchBoxModule } from '@acorex/components/search-box';
|
|
63
|
-
import * as i14$1 from '@acorex/platform/auth';
|
|
64
|
-
import { AXPAuthModule, AXPSessionService, AXPAuthGuard } from '@acorex/platform/auth';
|
|
65
72
|
import { AXCollapseModule } from '@acorex/components/collapse';
|
|
66
73
|
import { AXCommonModule, AXDataSource } from '@acorex/components/common';
|
|
67
|
-
import * as i2$1 from '@acorex/components/form';
|
|
68
|
-
import { AXFormModule } from '@acorex/components/form';
|
|
69
74
|
import { AXListModule } from '@acorex/components/list';
|
|
70
|
-
import { AXLoadingModule } from '@acorex/components/loading';
|
|
71
75
|
import { PortalModule } from '@angular/cdk/portal';
|
|
72
|
-
import * as i1$3 from '@ngrx/effects';
|
|
73
|
-
import { ofType as ofType$1 } from '@ngrx/effects';
|
|
74
|
-
import { AXBreadcrumbsModule } from '@acorex/components/breadcrumbs';
|
|
75
|
-
import { AXTooltipModule } from '@acorex/components/tooltip';
|
|
76
76
|
|
|
77
|
-
class
|
|
78
|
-
constructor() {
|
|
79
|
-
|
|
80
|
-
this.
|
|
81
|
-
this.
|
|
82
|
-
this.
|
|
83
|
-
this.
|
|
84
|
-
this.
|
|
85
|
-
|
|
86
|
-
this.
|
|
87
|
-
this.
|
|
88
|
-
this.
|
|
89
|
-
this.visibleColumns = computed(() => this.columns().filter((c) => c.visible));
|
|
90
|
-
this.conditions = signal([]);
|
|
91
|
-
this.sorts = signal([]);
|
|
92
|
-
this.selectedConditionNames = [];
|
|
93
|
-
this.viewNames = [];
|
|
94
|
-
}
|
|
95
|
-
ngOnInit() {
|
|
96
|
-
this.props.set(cloneDeep(this.loader.entity.properties));
|
|
97
|
-
this.columns.set(cloneDeep(this.selectedView.columns));
|
|
98
|
-
this.conditions.set(cloneDeep(this.selectedView.conditions));
|
|
99
|
-
this.sorts.set(cloneDeep(this.selectedView.sorts));
|
|
100
|
-
this.loader.views$.pipe(this.subscriber.takeUntilDestroy).subscribe((views) => {
|
|
101
|
-
this.viewNames = views.map((v) => v.name);
|
|
102
|
-
});
|
|
77
|
+
class AXPEntityCreateLoaderDefault {
|
|
78
|
+
constructor(config, store, formatService) {
|
|
79
|
+
this.config = config;
|
|
80
|
+
this.store = store;
|
|
81
|
+
this.formatService = formatService;
|
|
82
|
+
this._data = {};
|
|
83
|
+
this._currentSection = 'default';
|
|
84
|
+
this._sections$ = new BehaviorSubject(this.sections);
|
|
85
|
+
//****************** Properties ******************//
|
|
86
|
+
this.getProp = (name) => this.entity.properties.find((c) => c.name == name);
|
|
87
|
+
this.isRequired = (name) => this.getProp(name)?.validationRules?.some(c => c.rule == 'required') || false;
|
|
88
|
+
this._currentSection = this.sections[0]?.name || 'default';
|
|
103
89
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
this.columns.update((prevCols) => prevCols.map((col) => (col.name === colName ? { ...col, visible: event.value } : col)));
|
|
90
|
+
get entity() {
|
|
91
|
+
if (!this._config) {
|
|
92
|
+
this._config = cloneDeep(this.config);
|
|
108
93
|
}
|
|
94
|
+
return this._config;
|
|
109
95
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
this.sorts.update((prevSorts) => prevSorts.map((sort) => (sort.name === item.name ? { ...sort, dir: sort.dir == 'asc' ? 'desc' : 'asc' } : sort)));
|
|
113
|
-
}
|
|
114
|
-
addSortItem() {
|
|
115
|
-
const sortNames = this.sorts().map((p) => p.name);
|
|
116
|
-
console.log(this.props(), sortNames);
|
|
117
|
-
const name = this.props().find((c) => !sortNames.includes(c.name))?.name || this.props()[0].name;
|
|
118
|
-
this.sorts.update((prevSorts) => [...prevSorts, { name, dir: 'asc' }]);
|
|
119
|
-
}
|
|
120
|
-
removeSortItem(item) {
|
|
121
|
-
this.sorts.update((prevSorts) => prevSorts.filter((sort) => item.name != sort.name));
|
|
122
|
-
}
|
|
123
|
-
//****************** Conditions ******************//
|
|
124
|
-
getSchema(name) {
|
|
125
|
-
return this.props().find((c) => c.name == name)?.schema ?? '';
|
|
126
|
-
}
|
|
127
|
-
getOperators(name) {
|
|
128
|
-
const schemaName = this.props().find((c) => c.name == name)?.schema ?? '';
|
|
129
|
-
return this.schemaRegistry.resolve(schemaName)?.filterOptions?.operators ?? [];
|
|
96
|
+
get data() {
|
|
97
|
+
return this._data;
|
|
130
98
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
return this.schemaRegistry.resolve(schemaName)?.filterOptions?.default ?? EQ_OPER;
|
|
99
|
+
get view() {
|
|
100
|
+
return this.entity.views.createView;
|
|
134
101
|
}
|
|
135
|
-
|
|
136
|
-
|
|
102
|
+
//****************** Sections ******************//
|
|
103
|
+
get sections() {
|
|
104
|
+
return this.view.root.sections?.length
|
|
105
|
+
? this.view.root.sections
|
|
106
|
+
: [
|
|
107
|
+
{
|
|
108
|
+
name: 'default',
|
|
109
|
+
title: 'Default',
|
|
110
|
+
properties: this.view.root.properties,
|
|
111
|
+
},
|
|
112
|
+
];
|
|
137
113
|
}
|
|
138
|
-
|
|
139
|
-
|
|
114
|
+
get sections$() {
|
|
115
|
+
return this._sections$.pipe(defaultIfEmpty([]));
|
|
140
116
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
const
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
117
|
+
get section$() {
|
|
118
|
+
return this.sections$.pipe(switchMap((sections) => {
|
|
119
|
+
const section = sections.find((c) => c.name === this._currentSection) ?? this.sections[0];
|
|
120
|
+
if (!section.sections?.length) {
|
|
121
|
+
section.sections = [
|
|
122
|
+
{
|
|
123
|
+
name: 'default',
|
|
124
|
+
title: 'Details',
|
|
125
|
+
properties: section.properties,
|
|
126
|
+
},
|
|
127
|
+
];
|
|
128
|
+
}
|
|
129
|
+
return of(section);
|
|
130
|
+
}));
|
|
150
131
|
}
|
|
151
|
-
|
|
152
|
-
this.
|
|
132
|
+
get hasSections$() {
|
|
133
|
+
return this.sections$.pipe(map((c) => c.length > 1));
|
|
153
134
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
switch (type) {
|
|
157
|
-
case 'columns':
|
|
158
|
-
this.columns.update((prevCols) => {
|
|
159
|
-
const columns = prevCols;
|
|
160
|
-
moveItemInArray(columns, event.previousIndex, event.currentIndex);
|
|
161
|
-
return columns;
|
|
162
|
-
});
|
|
163
|
-
break;
|
|
164
|
-
case 'sorts':
|
|
165
|
-
this.sorts.update((prevSorts) => {
|
|
166
|
-
const sorts = prevSorts;
|
|
167
|
-
moveItemInArray(sorts, event.previousIndex, event.currentIndex);
|
|
168
|
-
return sorts;
|
|
169
|
-
});
|
|
170
|
-
break;
|
|
171
|
-
case 'conditions':
|
|
172
|
-
this.conditions.update((prevConditions) => {
|
|
173
|
-
const conditions = prevConditions;
|
|
174
|
-
moveItemInArray(conditions, event.previousIndex, event.currentIndex);
|
|
175
|
-
return conditions;
|
|
176
|
-
});
|
|
177
|
-
break;
|
|
178
|
-
default:
|
|
179
|
-
break;
|
|
180
|
-
}
|
|
135
|
+
get isLast$() {
|
|
136
|
+
return this.sections$.pipe(map((c) => this.sections.length - this.sections.findIndex((c) => c.name == this._currentSection) == 1));
|
|
181
137
|
}
|
|
182
|
-
|
|
183
|
-
this.
|
|
138
|
+
get isFirst$() {
|
|
139
|
+
return this.sections$.pipe(map((c) => this.sections.findIndex((c) => c.name == this._currentSection) == 0));
|
|
184
140
|
}
|
|
185
|
-
|
|
186
|
-
return
|
|
141
|
+
get currentIndex$() {
|
|
142
|
+
return this.sections$.pipe(map((c) => this.sections.findIndex((c) => c.name == this._currentSection)));
|
|
187
143
|
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
name:
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
sorts: this.sorts(),
|
|
144
|
+
setSection(name) {
|
|
145
|
+
this._currentSection = name ?? 'default';
|
|
146
|
+
const updatedSection = this.sections.find((c) => c.name === this._currentSection) || {
|
|
147
|
+
name: 'default',
|
|
148
|
+
title: 'Default',
|
|
149
|
+
properties: this.view.root.properties,
|
|
195
150
|
};
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
151
|
+
const currentSections = this._sections$.value;
|
|
152
|
+
const updatedSections = currentSections.map((section) => {
|
|
153
|
+
if (section.name === updatedSection.name) {
|
|
154
|
+
return updatedSection;
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
return section;
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
this._sections$.next(updatedSections);
|
|
161
|
+
}
|
|
162
|
+
next() {
|
|
163
|
+
const nextIndex = this.sections.findIndex((c) => c.name == this._currentSection) + 1;
|
|
164
|
+
if (nextIndex >= this.sections.length) {
|
|
165
|
+
return Promise.resolve();
|
|
205
166
|
}
|
|
206
167
|
else {
|
|
207
|
-
this.
|
|
208
|
-
|
|
209
|
-
}
|
|
210
|
-
handleResetClick() {
|
|
211
|
-
this.conditions.set(cloneDeep(this.selectedView.conditions));
|
|
212
|
-
this.columns.set(cloneDeep(this.selectedView.columns));
|
|
213
|
-
this.sorts.set(cloneDeep(this.selectedView.sorts));
|
|
214
|
-
}
|
|
215
|
-
handleDiscardClick() {
|
|
216
|
-
this.close({ save: false });
|
|
217
|
-
}
|
|
218
|
-
handleCancelClick() {
|
|
219
|
-
this.close({ save: false });
|
|
220
|
-
}
|
|
221
|
-
handleDeleteClick() {
|
|
222
|
-
this.dialogService
|
|
223
|
-
.confirm('Warning', 'Are you sure want to delete this view?', 'danger', 'horizontal')
|
|
224
|
-
.then((data) => {
|
|
225
|
-
if (data.result) {
|
|
226
|
-
this.close({ delete: true, viewName: this.selectedView.name });
|
|
227
|
-
}
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPEntityCreateCustomViewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
231
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AXPEntityCreateCustomViewComponent, selector: "ng-component", inputs: { loader: "loader", mode: "mode", selectedView: "selectedView" }, providers: [
|
|
232
|
-
{
|
|
233
|
-
provide: AXUnsubscriber,
|
|
234
|
-
},
|
|
235
|
-
], usesInheritance: true, ngImport: i0, template: "<ax-header class=\"ax-p-4 ax-flex ax-justify-between ax-border-b\">\n <div class=\"ax-flex ax-items-center\">\n @if (showNameInput() && mode==='create') {\n <div class=\"ax-w-60\">\n <ax-text-box class=\"ax-sm\" [(ngModel)]=\"selectedView.title\">\n @if(showNameInput()){\n <ax-suffix>\n <ax-button (onClick)=\"changeViewNameToggle()\" look=\"default\">\n <ax-icon class=\"fa-sodild fas fa-check ax-text-sm\"> </ax-icon>\n </ax-button>\n </ax-suffix>\n }\n </ax-text-box>\n </div>\n }@else {\n <span class=\"ax-text-lg ax-font-semibold\">{{ selectedView.title }}</span>\n } @if (mode===\"create\") {\n <ax-button class=\"ax-xs\" (onClick)=\"changeViewNameToggle()\" color=\"default\">\n @if(!showNameInput() ){\n <ax-icon class=\"fa-regular fa-pen ax-text-sm ax-text-neutral-600\"> </ax-icon>\n }\n </ax-button>\n }\n </div>\n <ax-close-button></ax-close-button>\n</ax-header>\n<div class=\"ax-p-4\">\n <ax-tabs [content]=\"contents\" look=\"with-line\">\n <ax-tab-item [text]=\"('entity.columns' | translate | async) ?? 'Columns'\">\n <ax-suffix>\n <ax-badge [text]=\"visibleColumns().length.toString()\" color=\"primary\"> </ax-badge>\n </ax-suffix>\n <ax-content>\n <div class=\"ax-flex ax-flex-col ax-gap-4 ax-p-4 ax-select-none ax-h-[400px]\" cdkDropList (cdkDropListDropped)=\"drop('columns', $event)\">\n <div class=\"ax-flex ax-flex-col ax-gap-3 ax-w-full ax-sorted-list ax-overflow-auto ax-pe-2\">\n <ng-container *ngFor=\"let item of columns()\">\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 }}</p>\n </div>\n <ax-switch class=\"ax-sm\" [(ngModel)]=\"item.visible\" (onValueChanged)=\"updateColumnItem($event, item.name)\"></ax-switch>\n </div>\n </ng-container>\n </div>\n </div>\n </ax-content>\n </ax-tab-item>\n <ax-tab-item text=\"Conditions\">\n <ax-suffix>\n <ax-badge [text]=\"conditions().length.toString()\" color=\"primary\"> </ax-badge>\n </ax-suffix>\n <ax-content>\n <div\n class=\"ax-flex ax-flex-col ax-justify-start ax-gap-4 ax-py-4 ax-select-none ax-h-[400px]\"\n [class.ax-justify-center]=\"!conditions().length\"\n >\n @if(!conditions().length){\n <div class=\"ax-flex ax-flex-col ax-items-center ax-justify-center\">\n <ax-image src=\"assets/documents.svg\"></ax-image>\n <p class=\"ax-mt-6 ax-mb-1 ax-font-bold\">No Filters Selected</p>\n <span class=\"ax-text-neutral-400 ax-text-sm md:ax-text-md\">Please select field(s) that you want to filter</span>\n </div>\n } @else {\n <div class=\"ax-sorted-list ax-px-4 ax-py-1 ax-overflow-auto\">\n <div cdkDropList (cdkDropListDropped)=\"drop('conditions', $event)\" class=\"ax-flex ax-flex-col ax-gap-2\">\n @for(item of conditions(); track item.name ){\n <div cdkDrag cdkDragBoundary=\".ax-sorted-list\">\n <div class=\"ax-ms-4 ax-flex ax-items-start ax-gap-2\">\n <ax-label>{{ loader.getProp(item.name)?.title }}</ax-label>\n @if(getOperatorTitle(item.name,item.operator)){\n <ax-badge class=\"ax-text-xs\" color=\"primary\" [look]=\"'twotone'\" [text]=\"getOperatorTitle(item.name, item.operator)\"></ax-badge>\n }\n </div>\n <div class=\"ax-flex ax-group ax-items-center ax-gap-2\">\n <ax-icon class=\"fa-solid fa-grip-dots-vertical ax-cursor-move\" cdkDragHandle></ax-icon>\n <div class=\"ax-w-full\">\n <axp-widget-filter-renderer\n [schema]=\"getSchema(item.name)\"\n [prop]=\"loader.getProp(item.name)\"\n [(value)]=\"item.value\"\n [(operator)]=\"item.operator\"\n >\n </axp-widget-filter-renderer>\n </div>\n <ax-button look=\"blank\" color=\"danger\" class=\"ax-sm\" (onClick)=\"removeCondition(item)\">\n <ax-icon class=\"fa-solid fa-trash-can\"></ax-icon>\n </ax-button>\n </div>\n </div>\n }\n </div>\n </div>\n }\n <div class=\"ax-flex ax-gap-2\">\n <div class=\"ax-w-full\" #addField>\n @if(conditions().length){\n <ax-button color=\"primary\" [text]=\"'entity.add-field' | translate | async\" look=\"blank\" class=\"ax-sm\"></ax-button>\n }@else {\n <div class=\"ax-flex ax-justify-center ax-w-full\">\n <ax-button color=\"primary\" [text]=\"'entity.add-field' | translate | async\" look=\"outline\" class=\"ax-md ax-w-56\"></ax-button>\n </div>\n }\n <ax-popover\n #conditionsPopover\n [target]=\"addField\"\n [placement]=\"conditions().length ? 'bottom-start' : 'bottom'\"\n [offsetY]=\"8\"\n [openOn]=\"'toggle'\"\n [closeOn]=\"'clickOut'\"\n [adaptivityEnabled]=\"true\"\n (onOpened)=\"resetSelectedFieldNames()\"\n >\n <div class=\"ax-bg-surface ax-border ax-border-default ax-rounded-md ax-shadow-md ax-w-full ax-min-w-[250px]\">\n <div class=\"ax-border-b-[1px] ax-pb-2 ax-mb-2 ax-p-3\">\n <ax-title class=\"ax-font-bold\">Fields</ax-title>\n </div>\n <div class=\"ax-max-h-48 ax-overflow-auto\">\n <ax-selection-list\n [valueField]=\"'name'\"\n [textField]=\"'title'\"\n [(ngModel)]=\"selectedConditionNames\"\n [direction]=\"'vertical'\"\n [items]=\"props()\"\n [multiple]=\"true\"\n ></ax-selection-list>\n </div>\n <div class=\"ax-flex ax-justify-end ax-border-t-[1px] ax-p-3\">\n <ax-button (onClick)=\"addCondition(); conditionsPopover.close()\" class=\"ax-sm\" text=\"Confirm\" color=\"primary\"> </ax-button>\n </div>\n </div>\n </ax-popover>\n </div>\n </div>\n </div>\n </ax-content>\n </ax-tab-item>\n <ax-tab-item text=\"Sorting\">\n <ax-suffix>\n <ax-badge [text]=\"sorts().length.toString()\" color=\"primary\"> </ax-badge>\n </ax-suffix>\n <ax-content>\n <div\n class=\"ax-flex ax-p-4 ax-flex-col ax-justify-start ax-gap-4 ax-select-none ax-overflow-auto ax-h-[400px]\"\n [class.ax-justify-center]=\"!sorts().length\"\n >\n @if(!sorts().length){\n <div class=\"ax-flex ax-flex-col ax-items-center ax-justify-center\">\n <ax-image src=\"assets/documents.svg\"></ax-image>\n <p class=\"ax-mt-6 ax-mb-1 ax-font-bold\">{{ 'entity.no-sort' | translate | async }}</p>\n <span class=\"ax-text-neutral-400 ax-text-sm md:ax-text-md\">{{ 'entity.ask-sort' | translate | async }}</span>\n </div>\n }@else {\n <div\n cdkDropList\n (cdkDropListDropped)=\"drop('sorts', $event)\"\n class=\"ax-flex ax-flex-col ax-gap-3 ax-w-full ax-sorted-list ax-py-1 ax-overflow-auto\"\n >\n <ng-container *ngFor=\"let item of sorts()\">\n <div class=\"ax-flex ax-gap-2 ax-items-center\" cdkDrag cdkDragBoundary=\".ax-sorted-list\">\n <ax-icon class=\"fa-solid fa-grip-dots-vertical ax-cursor-move\" cdkDragHandle></ax-icon>\n <ax-select-box [dataSource]=\"props()\" valueField=\"name\" textField=\"title\" [(ngModel)]=\"item.name\"> </ax-select-box>\n <ax-button [color]=\"'default'\" class=\"ax-sm\" (click)=\"updateSortItem(item)\">\n <ax-icon [class.ax-text-primary]=\"item.dir == 'asc'\" class=\"fa-solid fa-arrow-up-long ax-text-neutral-400\"></ax-icon>\n <ax-icon [class.ax-text-primary]=\"item.dir == 'desc'\" class=\"fa-solid fa-arrow-down-long ax-text-neutral-400\"></ax-icon>\n </ax-button>\n\n <ax-button look=\"blank\" (onClick)=\"removeSortItem(item)\">\n <ax-icon class=\"fa-solid fa-trash-can ax-text-danger-500\"></ax-icon>\n </ax-button>\n </div>\n </ng-container>\n </div>\n }\n\n <div class=\"ax-flex ax-gap-2\">\n <div class=\"ax-w-full\" #addField>\n @if(sorts().length){\n <ax-button\n (onClick)=\"addSortItem()\"\n color=\"primary\"\n [text]=\"'entity.add-field' | translate | async\"\n look=\"blank\"\n class=\"ax-sm\"\n ></ax-button>\n }@else {\n <div class=\"ax-flex ax-justify-center ax-w-full\">\n <ax-button\n (onClick)=\"addSortItem()\"\n color=\"primary\"\n [text]=\"'entity.add-field' | translate | async\"\n look=\"outline\"\n class=\"ax-md ax-w-56\"\n ></ax-button>\n </div>\n }\n </div>\n </div>\n </div>\n </ax-content>\n </ax-tab-item>\n </ax-tabs>\n <ng-template [axTabContent] #contents=\"axTabContent\"> </ng-template>\n</div>\n<ax-footer class=\"!ax-justify-end\">\n @if (mode===\"edit\") {\n <ax-dropdown-button [text]=\"'discard' | translate | async\" (onClick)=\"handleDiscardClick()\">\n <ax-button-item-list>\n <ax-button-item [text]=\"('reset' | translate | async) ?? ' '\" (onClick)=\"handleResetClick()\">\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-rotate-left fa-flip-horizontal\"></ax-icon>\n </ax-prefix>\n </ax-button-item>\n <ax-button-item class=\"ax-text-danger\" text=\"Delete\" (onClick)=\"handleDeleteClick()\">\n <ax-prefix> <ax-icon icon=\"fas fa-trash fa-flip-horizontal\"></ax-icon> </ax-prefix\n ></ax-button-item>\n </ax-button-item-list>\n </ax-dropdown-button>\n } @else {\n <ax-button [text]=\"'cancel' | translate | async\" look=\"outline\" (onClick)=\"handleCancelClick()\"></ax-button>\n }\n <ax-button [text]=\"mode === 'create' ? ('save' | translate | async) : ('save-changes' | translate | async)\" color=\"primary\" (onClick)=\"handleApplyClick()\"></ax-button>\n</ax-footer>\n", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "type", "responsiveOn", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "responsiveOnChange", "loadingTextChange"] }, { kind: "component", type: i4.AXButtonItemComponent, selector: "ax-button-item", inputs: ["color", "disabled", "text", "selected", "divided", "data", "name"], outputs: ["onClick", "onFocus", "onBlur", "disabledChange"] }, { kind: "component", type: i4.AXButtonItemListComponent, selector: "ax-button-item-list", inputs: ["items"], outputs: ["onItemClick"] }, { kind: "component", type: i4$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i4$1.AXDecoratorCloseButtonComponent, selector: "ax-close-button", inputs: ["icon"] }, { kind: "component", type: i4$1.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-sub-title, ax-placeholder, ax-overlay" }, { kind: "component", type: i5.AXBadgeComponent, selector: "ax-badge", inputs: ["color", "look", "text"] }, { kind: "component", type: i6.AXPopoverComponent, selector: "ax-popover", inputs: ["offsetX", "offsetY", "target", "placement", "content", "openOn", "closeOn", "hasBackdrop", "openAfter", "closeAfter", "backdropClass", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "component", type: i7.AXImageComponent, selector: "ax-image", inputs: ["overlayMode", "src", "alt", "priority", "lazy"], outputs: ["onLoad", "onError"] }, { kind: "component", type: i8.AXSwitchComponent, selector: "ax-switch", inputs: ["disabled", "readonly", "color", "tabIndex", "value", "name", "isLoading"], outputs: ["onBlur", "onFocus", "valueChange", "onValueChanged", "readonlyChange", "disabledChange"] }, { kind: "component", type: i9.AXTabsComponent, selector: "ax-tabs", inputs: ["look", "location", "fitParent", "minWidth", "content"], outputs: ["onActiveTabChanged"] }, { kind: "component", type: i9.AXTabItemComponent, selector: "ax-tab-item", inputs: ["disabled", "text", "key", "headerTemplate", "active"], outputs: ["disabledChange", "onClick", "onBlur", "onFocus", "activeChange"] }, { kind: "directive", type: i9.AXTabContentDirective, selector: "[axTabContent]", inputs: ["axTabContent"], exportAs: ["axTabContent"] }, { kind: "component", type: i10.AXSelectBoxComponent, selector: "ax-select-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "minValue", "maxValue", "value", "state", "name", "id", "type", "look", "multiple", "valueField", "textField", "textTemplate", "dataSource", "caption", "itemTemplate", "selectedTemplate", "emptyTemplate", "loadingTemplate", "dropdownWidth"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onOpened", "onClosed"] }, { kind: "component", type: i11.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: "component", type: i7$1.AXLabelComponent, selector: "ax-label", inputs: ["required", "for"], outputs: ["requiredChange"] }, { kind: "component", type: i13.AXSelectionListComponent, selector: "ax-selection-list", inputs: ["id", "name", "disabled", "readonly", "tabIndex", "size", "value", "valueField", "textField", "hintField", "disabledField", "readonlyField", "multiple", "direction", "customTemplate", "showControl", "items", "look"], outputs: ["onValueChanged", "onBlur", "onFocus"] }, { kind: "component", type: i14.AXDropdownButtonComponent, selector: "ax-dropdown-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "type", "mode"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "lookChange", "colorChange", "disabledChange"] }, { kind: "directive", type: i15.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i15.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: i15.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: i10$1.AXPWidgetFilterRendererComponent, selector: "axp-widget-filter-renderer", inputs: ["value", "operator", "prop", "schema"], outputs: ["valueChange", "operatorChange"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i8$1.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
236
|
-
}
|
|
237
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPEntityCreateCustomViewComponent, decorators: [{
|
|
238
|
-
type: Component,
|
|
239
|
-
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
240
|
-
{
|
|
241
|
-
provide: AXUnsubscriber,
|
|
242
|
-
},
|
|
243
|
-
], template: "<ax-header class=\"ax-p-4 ax-flex ax-justify-between ax-border-b\">\n <div class=\"ax-flex ax-items-center\">\n @if (showNameInput() && mode==='create') {\n <div class=\"ax-w-60\">\n <ax-text-box class=\"ax-sm\" [(ngModel)]=\"selectedView.title\">\n @if(showNameInput()){\n <ax-suffix>\n <ax-button (onClick)=\"changeViewNameToggle()\" look=\"default\">\n <ax-icon class=\"fa-sodild fas fa-check ax-text-sm\"> </ax-icon>\n </ax-button>\n </ax-suffix>\n }\n </ax-text-box>\n </div>\n }@else {\n <span class=\"ax-text-lg ax-font-semibold\">{{ selectedView.title }}</span>\n } @if (mode===\"create\") {\n <ax-button class=\"ax-xs\" (onClick)=\"changeViewNameToggle()\" color=\"default\">\n @if(!showNameInput() ){\n <ax-icon class=\"fa-regular fa-pen ax-text-sm ax-text-neutral-600\"> </ax-icon>\n }\n </ax-button>\n }\n </div>\n <ax-close-button></ax-close-button>\n</ax-header>\n<div class=\"ax-p-4\">\n <ax-tabs [content]=\"contents\" look=\"with-line\">\n <ax-tab-item [text]=\"('entity.columns' | translate | async) ?? 'Columns'\">\n <ax-suffix>\n <ax-badge [text]=\"visibleColumns().length.toString()\" color=\"primary\"> </ax-badge>\n </ax-suffix>\n <ax-content>\n <div class=\"ax-flex ax-flex-col ax-gap-4 ax-p-4 ax-select-none ax-h-[400px]\" cdkDropList (cdkDropListDropped)=\"drop('columns', $event)\">\n <div class=\"ax-flex ax-flex-col ax-gap-3 ax-w-full ax-sorted-list ax-overflow-auto ax-pe-2\">\n <ng-container *ngFor=\"let item of columns()\">\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 }}</p>\n </div>\n <ax-switch class=\"ax-sm\" [(ngModel)]=\"item.visible\" (onValueChanged)=\"updateColumnItem($event, item.name)\"></ax-switch>\n </div>\n </ng-container>\n </div>\n </div>\n </ax-content>\n </ax-tab-item>\n <ax-tab-item text=\"Conditions\">\n <ax-suffix>\n <ax-badge [text]=\"conditions().length.toString()\" color=\"primary\"> </ax-badge>\n </ax-suffix>\n <ax-content>\n <div\n class=\"ax-flex ax-flex-col ax-justify-start ax-gap-4 ax-py-4 ax-select-none ax-h-[400px]\"\n [class.ax-justify-center]=\"!conditions().length\"\n >\n @if(!conditions().length){\n <div class=\"ax-flex ax-flex-col ax-items-center ax-justify-center\">\n <ax-image src=\"assets/documents.svg\"></ax-image>\n <p class=\"ax-mt-6 ax-mb-1 ax-font-bold\">No Filters Selected</p>\n <span class=\"ax-text-neutral-400 ax-text-sm md:ax-text-md\">Please select field(s) that you want to filter</span>\n </div>\n } @else {\n <div class=\"ax-sorted-list ax-px-4 ax-py-1 ax-overflow-auto\">\n <div cdkDropList (cdkDropListDropped)=\"drop('conditions', $event)\" class=\"ax-flex ax-flex-col ax-gap-2\">\n @for(item of conditions(); track item.name ){\n <div cdkDrag cdkDragBoundary=\".ax-sorted-list\">\n <div class=\"ax-ms-4 ax-flex ax-items-start ax-gap-2\">\n <ax-label>{{ loader.getProp(item.name)?.title }}</ax-label>\n @if(getOperatorTitle(item.name,item.operator)){\n <ax-badge class=\"ax-text-xs\" color=\"primary\" [look]=\"'twotone'\" [text]=\"getOperatorTitle(item.name, item.operator)\"></ax-badge>\n }\n </div>\n <div class=\"ax-flex ax-group ax-items-center ax-gap-2\">\n <ax-icon class=\"fa-solid fa-grip-dots-vertical ax-cursor-move\" cdkDragHandle></ax-icon>\n <div class=\"ax-w-full\">\n <axp-widget-filter-renderer\n [schema]=\"getSchema(item.name)\"\n [prop]=\"loader.getProp(item.name)\"\n [(value)]=\"item.value\"\n [(operator)]=\"item.operator\"\n >\n </axp-widget-filter-renderer>\n </div>\n <ax-button look=\"blank\" color=\"danger\" class=\"ax-sm\" (onClick)=\"removeCondition(item)\">\n <ax-icon class=\"fa-solid fa-trash-can\"></ax-icon>\n </ax-button>\n </div>\n </div>\n }\n </div>\n </div>\n }\n <div class=\"ax-flex ax-gap-2\">\n <div class=\"ax-w-full\" #addField>\n @if(conditions().length){\n <ax-button color=\"primary\" [text]=\"'entity.add-field' | translate | async\" look=\"blank\" class=\"ax-sm\"></ax-button>\n }@else {\n <div class=\"ax-flex ax-justify-center ax-w-full\">\n <ax-button color=\"primary\" [text]=\"'entity.add-field' | translate | async\" look=\"outline\" class=\"ax-md ax-w-56\"></ax-button>\n </div>\n }\n <ax-popover\n #conditionsPopover\n [target]=\"addField\"\n [placement]=\"conditions().length ? 'bottom-start' : 'bottom'\"\n [offsetY]=\"8\"\n [openOn]=\"'toggle'\"\n [closeOn]=\"'clickOut'\"\n [adaptivityEnabled]=\"true\"\n (onOpened)=\"resetSelectedFieldNames()\"\n >\n <div class=\"ax-bg-surface ax-border ax-border-default ax-rounded-md ax-shadow-md ax-w-full ax-min-w-[250px]\">\n <div class=\"ax-border-b-[1px] ax-pb-2 ax-mb-2 ax-p-3\">\n <ax-title class=\"ax-font-bold\">Fields</ax-title>\n </div>\n <div class=\"ax-max-h-48 ax-overflow-auto\">\n <ax-selection-list\n [valueField]=\"'name'\"\n [textField]=\"'title'\"\n [(ngModel)]=\"selectedConditionNames\"\n [direction]=\"'vertical'\"\n [items]=\"props()\"\n [multiple]=\"true\"\n ></ax-selection-list>\n </div>\n <div class=\"ax-flex ax-justify-end ax-border-t-[1px] ax-p-3\">\n <ax-button (onClick)=\"addCondition(); conditionsPopover.close()\" class=\"ax-sm\" text=\"Confirm\" color=\"primary\"> </ax-button>\n </div>\n </div>\n </ax-popover>\n </div>\n </div>\n </div>\n </ax-content>\n </ax-tab-item>\n <ax-tab-item text=\"Sorting\">\n <ax-suffix>\n <ax-badge [text]=\"sorts().length.toString()\" color=\"primary\"> </ax-badge>\n </ax-suffix>\n <ax-content>\n <div\n class=\"ax-flex ax-p-4 ax-flex-col ax-justify-start ax-gap-4 ax-select-none ax-overflow-auto ax-h-[400px]\"\n [class.ax-justify-center]=\"!sorts().length\"\n >\n @if(!sorts().length){\n <div class=\"ax-flex ax-flex-col ax-items-center ax-justify-center\">\n <ax-image src=\"assets/documents.svg\"></ax-image>\n <p class=\"ax-mt-6 ax-mb-1 ax-font-bold\">{{ 'entity.no-sort' | translate | async }}</p>\n <span class=\"ax-text-neutral-400 ax-text-sm md:ax-text-md\">{{ 'entity.ask-sort' | translate | async }}</span>\n </div>\n }@else {\n <div\n cdkDropList\n (cdkDropListDropped)=\"drop('sorts', $event)\"\n class=\"ax-flex ax-flex-col ax-gap-3 ax-w-full ax-sorted-list ax-py-1 ax-overflow-auto\"\n >\n <ng-container *ngFor=\"let item of sorts()\">\n <div class=\"ax-flex ax-gap-2 ax-items-center\" cdkDrag cdkDragBoundary=\".ax-sorted-list\">\n <ax-icon class=\"fa-solid fa-grip-dots-vertical ax-cursor-move\" cdkDragHandle></ax-icon>\n <ax-select-box [dataSource]=\"props()\" valueField=\"name\" textField=\"title\" [(ngModel)]=\"item.name\"> </ax-select-box>\n <ax-button [color]=\"'default'\" class=\"ax-sm\" (click)=\"updateSortItem(item)\">\n <ax-icon [class.ax-text-primary]=\"item.dir == 'asc'\" class=\"fa-solid fa-arrow-up-long ax-text-neutral-400\"></ax-icon>\n <ax-icon [class.ax-text-primary]=\"item.dir == 'desc'\" class=\"fa-solid fa-arrow-down-long ax-text-neutral-400\"></ax-icon>\n </ax-button>\n\n <ax-button look=\"blank\" (onClick)=\"removeSortItem(item)\">\n <ax-icon class=\"fa-solid fa-trash-can ax-text-danger-500\"></ax-icon>\n </ax-button>\n </div>\n </ng-container>\n </div>\n }\n\n <div class=\"ax-flex ax-gap-2\">\n <div class=\"ax-w-full\" #addField>\n @if(sorts().length){\n <ax-button\n (onClick)=\"addSortItem()\"\n color=\"primary\"\n [text]=\"'entity.add-field' | translate | async\"\n look=\"blank\"\n class=\"ax-sm\"\n ></ax-button>\n }@else {\n <div class=\"ax-flex ax-justify-center ax-w-full\">\n <ax-button\n (onClick)=\"addSortItem()\"\n color=\"primary\"\n [text]=\"'entity.add-field' | translate | async\"\n look=\"outline\"\n class=\"ax-md ax-w-56\"\n ></ax-button>\n </div>\n }\n </div>\n </div>\n </div>\n </ax-content>\n </ax-tab-item>\n </ax-tabs>\n <ng-template [axTabContent] #contents=\"axTabContent\"> </ng-template>\n</div>\n<ax-footer class=\"!ax-justify-end\">\n @if (mode===\"edit\") {\n <ax-dropdown-button [text]=\"'discard' | translate | async\" (onClick)=\"handleDiscardClick()\">\n <ax-button-item-list>\n <ax-button-item [text]=\"('reset' | translate | async) ?? ' '\" (onClick)=\"handleResetClick()\">\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-rotate-left fa-flip-horizontal\"></ax-icon>\n </ax-prefix>\n </ax-button-item>\n <ax-button-item class=\"ax-text-danger\" text=\"Delete\" (onClick)=\"handleDeleteClick()\">\n <ax-prefix> <ax-icon icon=\"fas fa-trash fa-flip-horizontal\"></ax-icon> </ax-prefix\n ></ax-button-item>\n </ax-button-item-list>\n </ax-dropdown-button>\n } @else {\n <ax-button [text]=\"'cancel' | translate | async\" look=\"outline\" (onClick)=\"handleCancelClick()\"></ax-button>\n }\n <ax-button [text]=\"mode === 'create' ? ('save' | translate | async) : ('save-changes' | translate | async)\" color=\"primary\" (onClick)=\"handleApplyClick()\"></ax-button>\n</ax-footer>\n" }]
|
|
244
|
-
}], propDecorators: { loader: [{
|
|
245
|
-
type: Input
|
|
246
|
-
}], mode: [{
|
|
247
|
-
type: Input
|
|
248
|
-
}], selectedView: [{
|
|
249
|
-
type: Input
|
|
250
|
-
}] } });
|
|
251
|
-
|
|
252
|
-
class AXPListViewOptionsColumnsComponent {
|
|
253
|
-
constructor() {
|
|
254
|
-
this.store = inject((Store));
|
|
255
|
-
this.isSM = this.store.select(isSmallScreen());
|
|
256
|
-
this.columns$ = of([]);
|
|
257
|
-
this.onClosed = new EventEmitter();
|
|
258
|
-
}
|
|
259
|
-
ngOnInit() {
|
|
260
|
-
this.columns$ = this.loader.displayColumns$;
|
|
261
|
-
}
|
|
262
|
-
handleVisibilityChange(e, name) {
|
|
263
|
-
if (e.isUserInteraction) {
|
|
264
|
-
this.loader.setColumnVisibility(name, e.value);
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
drop(event) {
|
|
268
|
-
this.columns$.pipe(first()).subscribe((columns) => {
|
|
269
|
-
moveItemInArray(columns, event.previousIndex, event.currentIndex);
|
|
270
|
-
});
|
|
271
|
-
}
|
|
272
|
-
handleClose() {
|
|
273
|
-
this.onClosed.emit();
|
|
274
|
-
}
|
|
275
|
-
handleResetClick() {
|
|
276
|
-
this.loader.resetColumns();
|
|
277
|
-
}
|
|
278
|
-
handleApplyClick() {
|
|
279
|
-
this.columns$.pipe(first()).subscribe((data) => {
|
|
280
|
-
this.loader.updateColumns(data);
|
|
281
|
-
});
|
|
282
|
-
this.onClosed.emit();
|
|
283
|
-
}
|
|
284
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPListViewOptionsColumnsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
285
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", type: AXPListViewOptionsColumnsComponent, selector: "axp-list-view-option-columns", inputs: { loader: "loader" }, outputs: { onClosed: "onClosed" }, ngImport: i0, template: "<ax-header class=\"ax-flex ax-items-center\">\n <h2 class=\"ax-text-xl ax-font-bold\">{{ 'entity.columns' | translate | async }}</h2>\n <ax-button (onClick)=\"handleClose()\" [look]=\"'blank'\">\n <ax-icon class=\"fa-solid fa-close ax-text-neutral-400 ax-text-xl\"> </ax-icon>\n </ax-button>\n</ax-header>\n<div class=\"ax-flex ax-flex-col ax-gap-4 ax-p-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 <ng-container *ngFor=\"let item of columns$ | async\">\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 }}</p>\n </div>\n <ax-switch class=\"ax-sm\" [ngModel]=\"item.visible\" (onValueChanged)=\"handleVisibilityChange($event, item.name)\"></ax-switch>\n </div>\n </ng-container>\n </div>\n</div>\n<ax-footer class=\"!ax-justify-start ax-absolute ax-bottom-0 ax-w-full\">\n <ax-button [text]=\"'apply' | translate | async\" color=\"primary\" (onClick)=\"handleApplyClick()\"></ax-button>\n <ax-button [text]=\"'reset' | translate | async\" color=\"ghost\" (onClick)=\"handleResetClick()\"></ax-button>\n</ax-footer>\n", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "type", "responsiveOn", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "responsiveOnChange", "loadingTextChange"] }, { kind: "component", type: i4$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i4$1.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-sub-title, ax-placeholder, ax-overlay" }, { kind: "component", type: i8.AXSwitchComponent, selector: "ax-switch", inputs: ["disabled", "readonly", "color", "tabIndex", "value", "name", "isLoading"], outputs: ["onBlur", "onFocus", "valueChange", "onValueChanged", "readonlyChange", "disabledChange"] }, { kind: "directive", type: i15.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i15.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: i15.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i8$1.AXTranslatorPipe, name: "translate" }] }); }
|
|
286
|
-
}
|
|
287
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPListViewOptionsColumnsComponent, decorators: [{
|
|
288
|
-
type: Component,
|
|
289
|
-
args: [{ selector: 'axp-list-view-option-columns', template: "<ax-header class=\"ax-flex ax-items-center\">\n <h2 class=\"ax-text-xl ax-font-bold\">{{ 'entity.columns' | translate | async }}</h2>\n <ax-button (onClick)=\"handleClose()\" [look]=\"'blank'\">\n <ax-icon class=\"fa-solid fa-close ax-text-neutral-400 ax-text-xl\"> </ax-icon>\n </ax-button>\n</ax-header>\n<div class=\"ax-flex ax-flex-col ax-gap-4 ax-p-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 <ng-container *ngFor=\"let item of columns$ | async\">\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 }}</p>\n </div>\n <ax-switch class=\"ax-sm\" [ngModel]=\"item.visible\" (onValueChanged)=\"handleVisibilityChange($event, item.name)\"></ax-switch>\n </div>\n </ng-container>\n </div>\n</div>\n<ax-footer class=\"!ax-justify-start ax-absolute ax-bottom-0 ax-w-full\">\n <ax-button [text]=\"'apply' | translate | async\" color=\"primary\" (onClick)=\"handleApplyClick()\"></ax-button>\n <ax-button [text]=\"'reset' | translate | async\" color=\"ghost\" (onClick)=\"handleResetClick()\"></ax-button>\n</ax-footer>\n" }]
|
|
290
|
-
}], propDecorators: { loader: [{
|
|
291
|
-
type: Input
|
|
292
|
-
}], onClosed: [{
|
|
293
|
-
type: Output
|
|
294
|
-
}] } });
|
|
295
|
-
|
|
296
|
-
class AXPListViewOptionConditionsComponent {
|
|
297
|
-
constructor() {
|
|
298
|
-
this.onClosed = new EventEmitter();
|
|
299
|
-
this.schemaRegistery = inject(AXPSchemaRegistryService);
|
|
300
|
-
this.popopService = inject(AXPopupService);
|
|
301
|
-
this.isSM = false;
|
|
302
|
-
this.props$ = of([]);
|
|
303
|
-
this.props = [];
|
|
304
|
-
this.conditions$ = of([]);
|
|
305
|
-
this.selectedFieldNames = [];
|
|
306
|
-
}
|
|
307
|
-
onNameChange(item) {
|
|
308
|
-
console.log('onName changed!', item);
|
|
309
|
-
}
|
|
310
|
-
ngOnInit() {
|
|
311
|
-
this.props$ = this.loader.properties$.pipe(map((sorts) => sorts.filter((s) => s.canFilter != false)));
|
|
312
|
-
this.conditions$ = this.loader.conditions$;
|
|
313
|
-
this.conditions$.pipe(first()).subscribe((initialConditions) => {
|
|
314
|
-
this.selectedFieldNames = initialConditions.map((i) => i.name);
|
|
315
|
-
});
|
|
316
|
-
this.props$.pipe(first()).subscribe((data) => {
|
|
317
|
-
this.props = data;
|
|
318
|
-
});
|
|
319
|
-
}
|
|
320
|
-
getOperators(name) {
|
|
321
|
-
const schemaName = this.props.find((c) => c.name == name)?.schema ?? '';
|
|
322
|
-
return this.schemaRegistery.resolve(schemaName)?.filterOptions?.operators ?? [];
|
|
323
|
-
}
|
|
324
|
-
getDefaultOperator(name) {
|
|
325
|
-
const schemaName = this.props.find((c) => c.name == name)?.schema ?? '';
|
|
326
|
-
return this.schemaRegistery.resolve(schemaName)?.filterOptions?.default ?? EQ_OPER;
|
|
327
|
-
}
|
|
328
|
-
getOperatorTitle(schemaName, oprName) {
|
|
329
|
-
return this.getOperators(schemaName).find((c) => c.name == oprName)?.title || '';
|
|
330
|
-
}
|
|
331
|
-
getSchema(name) {
|
|
332
|
-
return this.props.find((c) => c.name == name)?.schema ?? '';
|
|
333
|
-
}
|
|
334
|
-
drop(event) {
|
|
335
|
-
this.conditions$.pipe(first()).subscribe((conditions) => {
|
|
336
|
-
console.log('conditions: ', conditions);
|
|
337
|
-
moveItemInArray(conditions, event.previousIndex, event.currentIndex);
|
|
338
|
-
});
|
|
339
|
-
}
|
|
340
|
-
handleClose() {
|
|
341
|
-
this.onClosed.emit();
|
|
342
|
-
}
|
|
343
|
-
handleRemoveCondition(item) {
|
|
344
|
-
this.selectedFieldNames = this.selectedFieldNames.filter((i) => i !== item.name);
|
|
345
|
-
this.loader.removeCondition(item);
|
|
346
|
-
}
|
|
347
|
-
resetSelectedFieldNames() {
|
|
348
|
-
this.conditions$.pipe(first()).subscribe((initialConditions) => {
|
|
349
|
-
this.selectedFieldNames = initialConditions.map((i) => i.name);
|
|
350
|
-
});
|
|
351
|
-
}
|
|
352
|
-
handleResetClick() {
|
|
353
|
-
this.loader.resetConditions();
|
|
354
|
-
}
|
|
355
|
-
onConfirmFields() {
|
|
356
|
-
const fileds = this.selectedFieldNames.map((c) => {
|
|
357
|
-
const opr = this.getDefaultOperator(c);
|
|
358
|
-
return {
|
|
359
|
-
name: c,
|
|
360
|
-
opr: opr.name,
|
|
361
|
-
};
|
|
362
|
-
});
|
|
363
|
-
this.loader.addCondition(fileds);
|
|
364
|
-
}
|
|
365
|
-
handleApplyClick() {
|
|
366
|
-
this.conditions$.pipe(first()).subscribe((data) => {
|
|
367
|
-
console.log(data);
|
|
368
|
-
this.loader.updateConditions(data);
|
|
369
|
-
});
|
|
370
|
-
this.onClosed.emit();
|
|
371
|
-
}
|
|
372
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPListViewOptionConditionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
373
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AXPListViewOptionConditionsComponent, selector: "axp-list-view-option-conditions", inputs: { loader: "loader" }, outputs: { onClosed: "onClosed" }, ngImport: i0, template: "<ax-header class=\"ax-flex ax-items-center\">\n <h2 class=\"ax-text-xl ax-font-bold\">Filters</h2>\n <ax-button (onClick)=\"handleClose()\" [look]=\"'blank'\">\n <ax-icon class=\"fa-solid fa-close ax-text-neutral-400 ax-text-xl\"> </ax-icon>\n </ax-button>\n</ax-header>\n<div\n class=\"ax-flex ax-flex-col ax-justify-center ax-gap-4 ax-py-4 ax-select-none\"\n [class.ax-h-[calc(100vh-310px)]]=\"!(conditions$ | async)?.length\"\n>\n @if(!(conditions$ | async)?.length){\n <div class=\"ax-flex ax-flex-col ax-items-center ax-justify-center\">\n <ax-image src=\"assets/documents.svg\"></ax-image>\n <p class=\"ax-mt-6 ax-mb-1 ax-font-bold\">No Filters Selected</p>\n <span class=\"ax-text-neutral-400 ax-text-sm md:ax-text-md\">Please select field(s) that you want to filter</span>\n </div>\n } @else {\n <div class=\"ax-sorted-list ax-max-h-[calc(100vh-310px)] ax-px-4 ax-py-1 ax-overflow-auto\">\n <div cdkDropList (cdkDropListDropped)=\"drop($event)\" class=\"ax-flex ax-flex-col ax-gap-2\">\n @for(item of conditions$ | async; track item.name ){\n <div cdkDrag cdkDragBoundary=\".ax-sorted-list\">\n <div class=\"ax-ms-4 ax-flex ax-items-start ax-gap-2\">\n <ax-label>{{ loader.getProp(item.name)?.title }}</ax-label>\n @if(getOperatorTitle(item.name,item.operator)){\n <ax-badge\n class=\"ax-text-xs\"\n color=\"primary\"\n [look]=\"'twotone'\"\n [text]=\"getOperatorTitle(item.name, item.operator)\"\n ></ax-badge>\n }\n </div>\n <div class=\"ax-flex ax-group ax-items-center ax-gap-2\">\n <ax-icon class=\"fa-solid fa-grip-dots-vertical ax-cursor-move\" cdkDragHandle></ax-icon>\n <div class=\"ax-w-full\">\n <!-- <ax-text-box [(ngModel)]=\"item.value\"></ax-text-box> -->\n <axp-widget-filter-renderer\n [schema]=\"getSchema(item.name)\"\n [prop]=\"loader.getProp(item.name)\"\n [(value)]=\"item.value\"\n [(operator)]=\"item.operator\"\n >\n </axp-widget-filter-renderer>\n </div>\n <ax-button look=\"blank\" color=\"danger\" class=\"ax-sm\" (onClick)=\"handleRemoveCondition(item)\">\n <ax-icon class=\"fa-solid fa-trash-can\"></ax-icon>\n </ax-button>\n </div>\n </div>\n }\n </div>\n </div>\n }\n <div class=\"ax-flex ax-gap-2\">\n <div class=\"ax-w-full\" #addField>\n @if((conditions$ | async)?.length){\n <ax-button color=\"primary\" [text]=\"'entity.add-field' | translate | async\" look=\"blank\" class=\"ax-sm\"></ax-button>\n }@else {\n <div class=\"ax-flex ax-justify-center ax-w-full\">\n <ax-button color=\"primary\" [text]=\"'entity.add-field' | translate | async\" look=\"outline\" class=\"ax-md ax-w-56\"></ax-button>\n </div>\n }\n </div>\n <ax-popover\n #fieldsPopover\n [target]=\"addField\"\n [openOn]=\"'toggle'\"\n [closeOn]=\"'clickOut'\"\n [adaptivityEnabled]=\"true\"\n (onOpened)=\"resetSelectedFieldNames()\"\n [offsetX]=\"15\"\n >\n <div class=\"ax-bg-surface ax-border ax-border-default ax-rounded-md ax-shadow-md ax-w-full ax-min-w-[250px]\">\n <div class=\"ax-border-b-[1px] ax-pb-2 ax-mb-2 ax-p-3\">\n <ax-title class=\"ax-font-bold\">Fields</ax-title>\n </div>\n <div class=\"ax-max-h-72 2xl:ax-max-h-80 ax-overflow-auto\">\n <ax-selection-list\n [valueField]=\"'name'\"\n [textField]=\"'title'\"\n [(ngModel)]=\"selectedFieldNames\"\n [direction]=\"'vertical'\"\n [items]=\"props\"\n [multiple]=\"true\"\n ></ax-selection-list>\n </div>\n <div class=\"ax-flex ax-justify-end ax-border-t-[1px] ax-p-3\">\n <ax-button (onClick)=\"onConfirmFields(); fieldsPopover.close()\" class=\"ax-sm\" text=\"Confirm\" color=\"primary\">\n </ax-button>\n </div>\n </div>\n </ax-popover>\n </div>\n</div>\n<ax-footer class=\"!ax-justify-start ax-absolute ax-bottom-0 ax-w-full\">\n <ax-button [text]=\"'apply' | translate | async\" color=\"primary\" (onClick)=\"handleApplyClick()\"></ax-button>\n <ax-button [text]=\"'reset' | translate | async\" color=\"ghost\" (onClick)=\"handleResetClick()\"></ax-button>\n</ax-footer>\n", dependencies: [{ kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "type", "responsiveOn", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "responsiveOnChange", "loadingTextChange"] }, { kind: "component", type: i4$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i4$1.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-sub-title, ax-placeholder, ax-overlay" }, { kind: "component", type: i5.AXBadgeComponent, selector: "ax-badge", inputs: ["color", "look", "text"] }, { kind: "component", type: i6.AXPopoverComponent, selector: "ax-popover", inputs: ["offsetX", "offsetY", "target", "placement", "content", "openOn", "closeOn", "hasBackdrop", "openAfter", "closeAfter", "backdropClass", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "component", type: i7.AXImageComponent, selector: "ax-image", inputs: ["overlayMode", "src", "alt", "priority", "lazy"], outputs: ["onLoad", "onError"] }, { kind: "component", type: i7$1.AXLabelComponent, selector: "ax-label", inputs: ["required", "for"], outputs: ["requiredChange"] }, { kind: "component", type: i13.AXSelectionListComponent, selector: "ax-selection-list", inputs: ["id", "name", "disabled", "readonly", "tabIndex", "size", "value", "valueField", "textField", "hintField", "disabledField", "readonlyField", "multiple", "direction", "customTemplate", "showControl", "items", "look"], outputs: ["onValueChanged", "onBlur", "onFocus"] }, { kind: "directive", type: i15.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i15.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: i15.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: i10$1.AXPWidgetFilterRendererComponent, selector: "axp-widget-filter-renderer", inputs: ["value", "operator", "prop", "schema"], outputs: ["valueChange", "operatorChange"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i8$1.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
374
|
-
}
|
|
375
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPListViewOptionConditionsComponent, decorators: [{
|
|
376
|
-
type: Component,
|
|
377
|
-
args: [{ selector: 'axp-list-view-option-conditions', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<ax-header class=\"ax-flex ax-items-center\">\n <h2 class=\"ax-text-xl ax-font-bold\">Filters</h2>\n <ax-button (onClick)=\"handleClose()\" [look]=\"'blank'\">\n <ax-icon class=\"fa-solid fa-close ax-text-neutral-400 ax-text-xl\"> </ax-icon>\n </ax-button>\n</ax-header>\n<div\n class=\"ax-flex ax-flex-col ax-justify-center ax-gap-4 ax-py-4 ax-select-none\"\n [class.ax-h-[calc(100vh-310px)]]=\"!(conditions$ | async)?.length\"\n>\n @if(!(conditions$ | async)?.length){\n <div class=\"ax-flex ax-flex-col ax-items-center ax-justify-center\">\n <ax-image src=\"assets/documents.svg\"></ax-image>\n <p class=\"ax-mt-6 ax-mb-1 ax-font-bold\">No Filters Selected</p>\n <span class=\"ax-text-neutral-400 ax-text-sm md:ax-text-md\">Please select field(s) that you want to filter</span>\n </div>\n } @else {\n <div class=\"ax-sorted-list ax-max-h-[calc(100vh-310px)] ax-px-4 ax-py-1 ax-overflow-auto\">\n <div cdkDropList (cdkDropListDropped)=\"drop($event)\" class=\"ax-flex ax-flex-col ax-gap-2\">\n @for(item of conditions$ | async; track item.name ){\n <div cdkDrag cdkDragBoundary=\".ax-sorted-list\">\n <div class=\"ax-ms-4 ax-flex ax-items-start ax-gap-2\">\n <ax-label>{{ loader.getProp(item.name)?.title }}</ax-label>\n @if(getOperatorTitle(item.name,item.operator)){\n <ax-badge\n class=\"ax-text-xs\"\n color=\"primary\"\n [look]=\"'twotone'\"\n [text]=\"getOperatorTitle(item.name, item.operator)\"\n ></ax-badge>\n }\n </div>\n <div class=\"ax-flex ax-group ax-items-center ax-gap-2\">\n <ax-icon class=\"fa-solid fa-grip-dots-vertical ax-cursor-move\" cdkDragHandle></ax-icon>\n <div class=\"ax-w-full\">\n <!-- <ax-text-box [(ngModel)]=\"item.value\"></ax-text-box> -->\n <axp-widget-filter-renderer\n [schema]=\"getSchema(item.name)\"\n [prop]=\"loader.getProp(item.name)\"\n [(value)]=\"item.value\"\n [(operator)]=\"item.operator\"\n >\n </axp-widget-filter-renderer>\n </div>\n <ax-button look=\"blank\" color=\"danger\" class=\"ax-sm\" (onClick)=\"handleRemoveCondition(item)\">\n <ax-icon class=\"fa-solid fa-trash-can\"></ax-icon>\n </ax-button>\n </div>\n </div>\n }\n </div>\n </div>\n }\n <div class=\"ax-flex ax-gap-2\">\n <div class=\"ax-w-full\" #addField>\n @if((conditions$ | async)?.length){\n <ax-button color=\"primary\" [text]=\"'entity.add-field' | translate | async\" look=\"blank\" class=\"ax-sm\"></ax-button>\n }@else {\n <div class=\"ax-flex ax-justify-center ax-w-full\">\n <ax-button color=\"primary\" [text]=\"'entity.add-field' | translate | async\" look=\"outline\" class=\"ax-md ax-w-56\"></ax-button>\n </div>\n }\n </div>\n <ax-popover\n #fieldsPopover\n [target]=\"addField\"\n [openOn]=\"'toggle'\"\n [closeOn]=\"'clickOut'\"\n [adaptivityEnabled]=\"true\"\n (onOpened)=\"resetSelectedFieldNames()\"\n [offsetX]=\"15\"\n >\n <div class=\"ax-bg-surface ax-border ax-border-default ax-rounded-md ax-shadow-md ax-w-full ax-min-w-[250px]\">\n <div class=\"ax-border-b-[1px] ax-pb-2 ax-mb-2 ax-p-3\">\n <ax-title class=\"ax-font-bold\">Fields</ax-title>\n </div>\n <div class=\"ax-max-h-72 2xl:ax-max-h-80 ax-overflow-auto\">\n <ax-selection-list\n [valueField]=\"'name'\"\n [textField]=\"'title'\"\n [(ngModel)]=\"selectedFieldNames\"\n [direction]=\"'vertical'\"\n [items]=\"props\"\n [multiple]=\"true\"\n ></ax-selection-list>\n </div>\n <div class=\"ax-flex ax-justify-end ax-border-t-[1px] ax-p-3\">\n <ax-button (onClick)=\"onConfirmFields(); fieldsPopover.close()\" class=\"ax-sm\" text=\"Confirm\" color=\"primary\">\n </ax-button>\n </div>\n </div>\n </ax-popover>\n </div>\n</div>\n<ax-footer class=\"!ax-justify-start ax-absolute ax-bottom-0 ax-w-full\">\n <ax-button [text]=\"'apply' | translate | async\" color=\"primary\" (onClick)=\"handleApplyClick()\"></ax-button>\n <ax-button [text]=\"'reset' | translate | async\" color=\"ghost\" (onClick)=\"handleResetClick()\"></ax-button>\n</ax-footer>\n" }]
|
|
378
|
-
}], ctorParameters: () => [], propDecorators: { onClosed: [{
|
|
379
|
-
type: Output
|
|
380
|
-
}], loader: [{
|
|
381
|
-
type: Input
|
|
382
|
-
}] } });
|
|
383
|
-
|
|
384
|
-
class AXPListViewOptionFilterOperatorComponent {
|
|
385
|
-
constructor() {
|
|
386
|
-
this.visible = false;
|
|
387
|
-
this.cdr = inject(ChangeDetectorRef);
|
|
388
|
-
this._items = [];
|
|
389
|
-
this.valueChange = new EventEmitter();
|
|
390
|
-
}
|
|
391
|
-
get items() {
|
|
392
|
-
return this._items;
|
|
393
|
-
}
|
|
394
|
-
set items(v) {
|
|
395
|
-
this.visible = false;
|
|
396
|
-
this._items = v;
|
|
397
|
-
setTimeout(() => {
|
|
398
|
-
this.visible = true;
|
|
399
|
-
this.cdr.markForCheck();
|
|
400
|
-
setTimeout(() => {
|
|
401
|
-
if (this.selectBox) {
|
|
402
|
-
//this.selectBox.defaultValue = this.items[0]?.name;
|
|
403
|
-
}
|
|
404
|
-
});
|
|
405
|
-
});
|
|
406
|
-
}
|
|
407
|
-
get value() {
|
|
408
|
-
return this._value;
|
|
409
|
-
}
|
|
410
|
-
set value(v) {
|
|
411
|
-
this._value = v;
|
|
412
|
-
this.valueChange.emit(v);
|
|
413
|
-
}
|
|
414
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPListViewOptionFilterOperatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
415
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", type: AXPListViewOptionFilterOperatorComponent, selector: "axp-list-view-option-filter-operator", inputs: { items: "items", value: "value" }, outputs: { valueChange: "valueChange" }, host: { styleAttribute: "display: contents;" }, viewQueries: [{ propertyName: "selectBox", first: true, predicate: AXSelectBoxComponent, descendants: true }], ngImport: i0, template: `
|
|
416
|
-
<ax-select-box
|
|
417
|
-
valueField="name"
|
|
418
|
-
[dataSource]="items"
|
|
419
|
-
textField="title"
|
|
420
|
-
[(ngModel)]="value"
|
|
421
|
-
*ngIf="visible"
|
|
422
|
-
>
|
|
423
|
-
</ax-select-box>
|
|
424
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i10.AXSelectBoxComponent, selector: "ax-select-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "minValue", "maxValue", "value", "state", "name", "id", "type", "look", "multiple", "valueField", "textField", "textTemplate", "dataSource", "caption", "itemTemplate", "selectedTemplate", "emptyTemplate", "loadingTemplate", "dropdownWidth"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onOpened", "onClosed"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
425
|
-
}
|
|
426
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPListViewOptionFilterOperatorComponent, decorators: [{
|
|
427
|
-
type: Component,
|
|
428
|
-
args: [{
|
|
429
|
-
selector: 'axp-list-view-option-filter-operator',
|
|
430
|
-
template: `
|
|
431
|
-
<ax-select-box
|
|
432
|
-
valueField="name"
|
|
433
|
-
[dataSource]="items"
|
|
434
|
-
textField="title"
|
|
435
|
-
[(ngModel)]="value"
|
|
436
|
-
*ngIf="visible"
|
|
437
|
-
>
|
|
438
|
-
</ax-select-box>
|
|
439
|
-
`,
|
|
440
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
441
|
-
host: { style: 'display: contents;' },
|
|
442
|
-
}]
|
|
443
|
-
}], propDecorators: { selectBox: [{
|
|
444
|
-
type: ViewChild,
|
|
445
|
-
args: [AXSelectBoxComponent]
|
|
446
|
-
}], items: [{
|
|
447
|
-
type: Input
|
|
448
|
-
}], valueChange: [{
|
|
449
|
-
type: Output
|
|
450
|
-
}], value: [{
|
|
451
|
-
type: Input
|
|
452
|
-
}] } });
|
|
453
|
-
|
|
454
|
-
class AXPListViewOptionSortingComponent {
|
|
455
|
-
constructor() {
|
|
456
|
-
this.isSM = false;
|
|
457
|
-
this.onClosed = new EventEmitter();
|
|
458
|
-
this.props$ = of([]);
|
|
459
|
-
this.sorts$ = of([]);
|
|
460
|
-
}
|
|
461
|
-
ngOnInit() {
|
|
462
|
-
this.props$ = this.loader.properties$.pipe(map((sorts) => sorts.filter((s) => s.canSort != false)));
|
|
463
|
-
this.loader.sorts$.subscribe((data) => { });
|
|
464
|
-
this.sorts$ = this.loader.sorts$;
|
|
465
|
-
}
|
|
466
|
-
drop(event) {
|
|
467
|
-
this.sorts$.pipe(first()).subscribe((sorts) => {
|
|
468
|
-
moveItemInArray(sorts, event.previousIndex, event.currentIndex);
|
|
469
|
-
});
|
|
470
|
-
}
|
|
471
|
-
changeItemSort(item) {
|
|
472
|
-
item.dir = item.dir == 'asc' ? 'desc' : 'asc';
|
|
473
|
-
}
|
|
474
|
-
handleClose() {
|
|
475
|
-
this.onClosed.emit();
|
|
476
|
-
}
|
|
477
|
-
handleResetClick() {
|
|
478
|
-
this.loader.resetSort();
|
|
479
|
-
}
|
|
480
|
-
handleApplyClick() {
|
|
481
|
-
this.sorts$.pipe(first()).subscribe((data) => {
|
|
482
|
-
this.loader.updateSort(data);
|
|
483
|
-
});
|
|
484
|
-
this.onClosed.emit();
|
|
485
|
-
}
|
|
486
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPListViewOptionSortingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
487
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AXPListViewOptionSortingComponent, selector: "axp-list-view-option-sorting", inputs: { loader: "loader" }, outputs: { onClosed: "onClosed" }, ngImport: i0, template: "<ax-header class=\"ax-flex ax-items-center\">\n <h2 class=\"ax-text-xl ax-font-bold\">{{'entity.sort' | translate | async}}</h2>\n <ax-button (onClick)=\"handleClose()\" [look]=\"'blank'\">\n <ax-icon class=\"fa-solid fa-close ax-text-neutral-400 ax-text-xl\"> </ax-icon>\n </ax-button>\n</ax-header>\n<div class=\"ax-flex ax-p-4 ax-flex-col ax-justify-center ax-gap-4 ax-select-none\" [class.ax-h-[calc(100vh-310px)]]=\"!(sorts$ | async)?.length\">\n @if(!(sorts$ | async)?.length){\n <div class=\"ax-flex ax-flex-col ax-items-center ax-justify-center\">\n <ax-image src=\"assets/documents.svg\"></ax-image>\n <p class=\"ax-mt-6 ax-mb-1 ax-font-bold\">{{ 'entity.no-sort' | translate | async }}</p>\n <span class=\"ax-text-neutral-400 ax-text-sm md:ax-text-md\">{{ 'entity.ask-sort' | translate | async }}</span>\n </div>\n }\n <div\n cdkDropList\n (cdkDropListDropped)=\"drop($event)\"\n class=\"ax-flex ax-flex-col ax-gap-3 ax-w-full ax-sorted-list ax-py-1 ax-max-h-[calc(100vh-310px)] ax-overflow-auto\"\n >\n <ng-container *ngFor=\"let item of sorts$ | async\">\n <div class=\"ax-flex ax-gap-2 ax-items-center\" cdkDrag cdkDragBoundary=\".ax-sorted-list\">\n <ax-icon class=\"fa-solid fa-grip-dots-vertical ax-cursor-move\" cdkDragHandle></ax-icon>\n <ax-select-box [dataSource]=\"(props$ | async) ?? []\" valueField=\"name\" textField=\"title\" [(ngModel)]=\"item.name\"> </ax-select-box>\n <ax-button [color]=\"'default'\" class=\"ax-sm\" (click)=\"changeItemSort(item)\">\n <ax-icon [class.ax-text-primary]=\"item.dir == 'asc'\" class=\"fa-solid fa-arrow-up-long ax-text-neutral-400\"></ax-icon>\n <ax-icon [class.ax-text-primary]=\"item.dir == 'desc'\" class=\"fa-solid fa-arrow-down-long ax-text-neutral-400\"></ax-icon>\n </ax-button>\n\n <ax-button look=\"blank\" (onClick)=\"loader.removeSort(item)\">\n <ax-icon class=\"fa-solid fa-trash-can ax-text-danger-500\"></ax-icon>\n </ax-button>\n </div>\n </ng-container>\n </div>\n\n <div class=\"ax-flex ax-gap-2\">\n <div class=\"ax-w-full\" #addField>\n @if((sorts$ | async)?.length){\n <ax-button (onClick)=\"loader.addSort()\" color=\"primary\" [text]=\"'entity.add-field' | translate | async\" look=\"blank\" class=\"ax-sm\"></ax-button>\n }@else {\n <div class=\"ax-flex ax-justify-center ax-w-full\">\n <ax-button (onClick)=\"loader.addSort()\" color=\"primary\" [text]=\"'entity.add-field' | translate | async\" look=\"outline\" class=\"ax-md ax-w-56\"></ax-button>\n </div>\n }\n </div>\n </div>\n</div>\n<ax-footer class=\"!ax-justify-start ax-absolute ax-bottom-0 ax-w-full\">\n <ax-button [text]=\"'apply' | translate | async\" color=\"primary\" (onClick)=\"handleApplyClick()\"></ax-button>\n <ax-button [text]=\"'reset' | translate | async\" color=\"ghost\" (onClick)=\"handleResetClick()\"></ax-button>\n</ax-footer>\n", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "type", "responsiveOn", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "responsiveOnChange", "loadingTextChange"] }, { kind: "component", type: i4$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i4$1.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-sub-title, ax-placeholder, ax-overlay" }, { kind: "component", type: i7.AXImageComponent, selector: "ax-image", inputs: ["overlayMode", "src", "alt", "priority", "lazy"], outputs: ["onLoad", "onError"] }, { kind: "component", type: i10.AXSelectBoxComponent, selector: "ax-select-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "minValue", "maxValue", "value", "state", "name", "id", "type", "look", "multiple", "valueField", "textField", "textTemplate", "dataSource", "caption", "itemTemplate", "selectedTemplate", "emptyTemplate", "loadingTemplate", "dropdownWidth"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onOpened", "onClosed"] }, { kind: "directive", type: i15.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i15.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: i15.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i8$1.AXTranslatorPipe, name: "translate" }] }); }
|
|
488
|
-
}
|
|
489
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPListViewOptionSortingComponent, decorators: [{
|
|
490
|
-
type: Component,
|
|
491
|
-
args: [{ selector: 'axp-list-view-option-sorting', template: "<ax-header class=\"ax-flex ax-items-center\">\n <h2 class=\"ax-text-xl ax-font-bold\">{{'entity.sort' | translate | async}}</h2>\n <ax-button (onClick)=\"handleClose()\" [look]=\"'blank'\">\n <ax-icon class=\"fa-solid fa-close ax-text-neutral-400 ax-text-xl\"> </ax-icon>\n </ax-button>\n</ax-header>\n<div class=\"ax-flex ax-p-4 ax-flex-col ax-justify-center ax-gap-4 ax-select-none\" [class.ax-h-[calc(100vh-310px)]]=\"!(sorts$ | async)?.length\">\n @if(!(sorts$ | async)?.length){\n <div class=\"ax-flex ax-flex-col ax-items-center ax-justify-center\">\n <ax-image src=\"assets/documents.svg\"></ax-image>\n <p class=\"ax-mt-6 ax-mb-1 ax-font-bold\">{{ 'entity.no-sort' | translate | async }}</p>\n <span class=\"ax-text-neutral-400 ax-text-sm md:ax-text-md\">{{ 'entity.ask-sort' | translate | async }}</span>\n </div>\n }\n <div\n cdkDropList\n (cdkDropListDropped)=\"drop($event)\"\n class=\"ax-flex ax-flex-col ax-gap-3 ax-w-full ax-sorted-list ax-py-1 ax-max-h-[calc(100vh-310px)] ax-overflow-auto\"\n >\n <ng-container *ngFor=\"let item of sorts$ | async\">\n <div class=\"ax-flex ax-gap-2 ax-items-center\" cdkDrag cdkDragBoundary=\".ax-sorted-list\">\n <ax-icon class=\"fa-solid fa-grip-dots-vertical ax-cursor-move\" cdkDragHandle></ax-icon>\n <ax-select-box [dataSource]=\"(props$ | async) ?? []\" valueField=\"name\" textField=\"title\" [(ngModel)]=\"item.name\"> </ax-select-box>\n <ax-button [color]=\"'default'\" class=\"ax-sm\" (click)=\"changeItemSort(item)\">\n <ax-icon [class.ax-text-primary]=\"item.dir == 'asc'\" class=\"fa-solid fa-arrow-up-long ax-text-neutral-400\"></ax-icon>\n <ax-icon [class.ax-text-primary]=\"item.dir == 'desc'\" class=\"fa-solid fa-arrow-down-long ax-text-neutral-400\"></ax-icon>\n </ax-button>\n\n <ax-button look=\"blank\" (onClick)=\"loader.removeSort(item)\">\n <ax-icon class=\"fa-solid fa-trash-can ax-text-danger-500\"></ax-icon>\n </ax-button>\n </div>\n </ng-container>\n </div>\n\n <div class=\"ax-flex ax-gap-2\">\n <div class=\"ax-w-full\" #addField>\n @if((sorts$ | async)?.length){\n <ax-button (onClick)=\"loader.addSort()\" color=\"primary\" [text]=\"'entity.add-field' | translate | async\" look=\"blank\" class=\"ax-sm\"></ax-button>\n }@else {\n <div class=\"ax-flex ax-justify-center ax-w-full\">\n <ax-button (onClick)=\"loader.addSort()\" color=\"primary\" [text]=\"'entity.add-field' | translate | async\" look=\"outline\" class=\"ax-md ax-w-56\"></ax-button>\n </div>\n }\n </div>\n </div>\n</div>\n<ax-footer class=\"!ax-justify-start ax-absolute ax-bottom-0 ax-w-full\">\n <ax-button [text]=\"'apply' | translate | async\" color=\"primary\" (onClick)=\"handleApplyClick()\"></ax-button>\n <ax-button [text]=\"'reset' | translate | async\" color=\"ghost\" (onClick)=\"handleResetClick()\"></ax-button>\n</ax-footer>\n" }]
|
|
492
|
-
}], propDecorators: { onClosed: [{
|
|
493
|
-
type: Output
|
|
494
|
-
}], loader: [{
|
|
495
|
-
type: Input
|
|
496
|
-
}] } });
|
|
497
|
-
|
|
498
|
-
class AXPEntityCreateLoaderDefault {
|
|
499
|
-
constructor(config, store, formatService) {
|
|
500
|
-
this.config = config;
|
|
501
|
-
this.store = store;
|
|
502
|
-
this.formatService = formatService;
|
|
503
|
-
this._data = {};
|
|
504
|
-
this._currentSection = 'default';
|
|
505
|
-
this._sections$ = new BehaviorSubject(this.sections);
|
|
506
|
-
//****************** Properties ******************//
|
|
507
|
-
this.getProp = (name) => this.entity.properties.find((c) => c.name == name);
|
|
508
|
-
this.isRequired = (name) => this.getProp(name)?.validationRules?.some(c => c.rule == 'required') || false;
|
|
509
|
-
this._currentSection = this.sections[0]?.name || 'default';
|
|
510
|
-
}
|
|
511
|
-
get entity() {
|
|
512
|
-
if (!this._config) {
|
|
513
|
-
this._config = cloneDeep(this.config);
|
|
514
|
-
}
|
|
515
|
-
return this._config;
|
|
516
|
-
}
|
|
517
|
-
get data() {
|
|
518
|
-
return this._data;
|
|
519
|
-
}
|
|
520
|
-
get view() {
|
|
521
|
-
return this.entity.views.createView;
|
|
522
|
-
}
|
|
523
|
-
//****************** Sections ******************//
|
|
524
|
-
get sections() {
|
|
525
|
-
return this.view.root.sections?.length
|
|
526
|
-
? this.view.root.sections
|
|
527
|
-
: [
|
|
528
|
-
{
|
|
529
|
-
name: 'default',
|
|
530
|
-
title: 'Default',
|
|
531
|
-
properties: this.view.root.properties,
|
|
532
|
-
},
|
|
533
|
-
];
|
|
534
|
-
}
|
|
535
|
-
get sections$() {
|
|
536
|
-
return this._sections$.pipe(defaultIfEmpty([]));
|
|
537
|
-
}
|
|
538
|
-
get section$() {
|
|
539
|
-
return this.sections$.pipe(switchMap((sections) => {
|
|
540
|
-
const section = sections.find((c) => c.name === this._currentSection) ?? this.sections[0];
|
|
541
|
-
if (!section.sections?.length) {
|
|
542
|
-
section.sections = [
|
|
543
|
-
{
|
|
544
|
-
name: 'default',
|
|
545
|
-
title: 'Details',
|
|
546
|
-
properties: section.properties,
|
|
547
|
-
},
|
|
548
|
-
];
|
|
549
|
-
}
|
|
550
|
-
return of(section);
|
|
551
|
-
}));
|
|
552
|
-
}
|
|
553
|
-
get hasSections$() {
|
|
554
|
-
return this.sections$.pipe(map((c) => c.length > 1));
|
|
555
|
-
}
|
|
556
|
-
get isLast$() {
|
|
557
|
-
return this.sections$.pipe(map((c) => this.sections.length - this.sections.findIndex((c) => c.name == this._currentSection) == 1));
|
|
558
|
-
}
|
|
559
|
-
get isFirst$() {
|
|
560
|
-
return this.sections$.pipe(map((c) => this.sections.findIndex((c) => c.name == this._currentSection) == 0));
|
|
561
|
-
}
|
|
562
|
-
get currentIndex$() {
|
|
563
|
-
return this.sections$.pipe(map((c) => this.sections.findIndex((c) => c.name == this._currentSection)));
|
|
564
|
-
}
|
|
565
|
-
setSection(name) {
|
|
566
|
-
this._currentSection = name ?? 'default';
|
|
567
|
-
const updatedSection = this.sections.find((c) => c.name === this._currentSection) || {
|
|
568
|
-
name: 'default',
|
|
569
|
-
title: 'Default',
|
|
570
|
-
properties: this.view.root.properties,
|
|
571
|
-
};
|
|
572
|
-
const currentSections = this._sections$.value;
|
|
573
|
-
const updatedSections = currentSections.map((section) => {
|
|
574
|
-
if (section.name === updatedSection.name) {
|
|
575
|
-
return updatedSection;
|
|
576
|
-
}
|
|
577
|
-
else {
|
|
578
|
-
return section;
|
|
579
|
-
}
|
|
580
|
-
});
|
|
581
|
-
this._sections$.next(updatedSections);
|
|
582
|
-
}
|
|
583
|
-
next() {
|
|
584
|
-
const nextIndex = this.sections.findIndex((c) => c.name == this._currentSection) + 1;
|
|
585
|
-
if (nextIndex >= this.sections.length) {
|
|
586
|
-
return Promise.resolve();
|
|
587
|
-
}
|
|
588
|
-
else {
|
|
589
|
-
this.setSection(this.sections[nextIndex].name);
|
|
590
|
-
return Promise.resolve();
|
|
168
|
+
this.setSection(this.sections[nextIndex].name);
|
|
169
|
+
return Promise.resolve();
|
|
591
170
|
}
|
|
592
171
|
}
|
|
593
172
|
back() {
|
|
@@ -638,7 +217,7 @@ class AXPEntityCreatePopupAction extends AXPWorkflowAction {
|
|
|
638
217
|
async execute(context) {
|
|
639
218
|
const { module, entity: entityName } = context.getVariable('payload');
|
|
640
219
|
const entity = await this.entityRegistery.resolve(module, entityName);
|
|
641
|
-
const com = await import('./acorex-platform-layouts-entity-create-view.component-
|
|
220
|
+
const com = await import('./acorex-platform-layouts-entity-create-view.component-CPGbLM4C.mjs');
|
|
642
221
|
const result = await this.popupService.open(com.AXPEntityCreateViewComponent, {
|
|
643
222
|
title: this.translateService.translateSync('create-new') + ' ' + entity.title,
|
|
644
223
|
size: this.platform.is('Mobile') || this.platform.is('SM') ? 'full' : 'md',
|
|
@@ -842,48 +421,123 @@ const AXPDeleteEntityWorkflow = {
|
|
|
842
421
|
},
|
|
843
422
|
};
|
|
844
423
|
|
|
845
|
-
|
|
846
|
-
|
|
424
|
+
class AXPEntityModifyLoaderDefault {
|
|
425
|
+
constructor(config, selectedData, selectedSection) {
|
|
426
|
+
this.config = config;
|
|
427
|
+
this.selectedData = selectedData;
|
|
428
|
+
this.selectedSection = selectedSection;
|
|
429
|
+
this._data = {};
|
|
430
|
+
//****************** Properties ******************//
|
|
431
|
+
this.getProp = (name) => this.entity.properties.find((c) => c.name == name);
|
|
432
|
+
this._data = this.selectedData;
|
|
433
|
+
this._currentSection = this.selectedSection;
|
|
434
|
+
}
|
|
435
|
+
get entity() {
|
|
436
|
+
if (!this._config) {
|
|
437
|
+
this._config = cloneDeep(this.config);
|
|
438
|
+
}
|
|
439
|
+
return this._config;
|
|
440
|
+
}
|
|
441
|
+
get data() {
|
|
442
|
+
return this._data;
|
|
443
|
+
}
|
|
444
|
+
get section() {
|
|
445
|
+
return this._currentSection;
|
|
446
|
+
}
|
|
447
|
+
get view() {
|
|
448
|
+
return this.entity.views.detailView;
|
|
449
|
+
}
|
|
450
|
+
//****************** update ******************//
|
|
451
|
+
async update(values) {
|
|
452
|
+
if (this._config.commands?.update) {
|
|
453
|
+
const updated = await this._config.commands?.update(this._data.id, values);
|
|
454
|
+
Object.assign(this._data, updated);
|
|
455
|
+
return Promise.resolve();
|
|
456
|
+
}
|
|
457
|
+
else {
|
|
458
|
+
return Promise.reject(`There is not any update commands for '${this.config.name}'`);
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
class AXPEntityModifyViewLoaderFactory {
|
|
463
|
+
constructor() {
|
|
464
|
+
this.entityService = inject(AXPEntityRegistryService);
|
|
465
|
+
this.layout = inject(AXPLayoutService);
|
|
466
|
+
}
|
|
467
|
+
async create(moduleName, entityName, id, section) {
|
|
468
|
+
this.layout.setNavigationLoading(true);
|
|
469
|
+
const config = await this.entityService.resolve(moduleName, entityName);
|
|
470
|
+
if (config.dataSource.byKey) {
|
|
471
|
+
const data = await config.dataSource.byKey(id);
|
|
472
|
+
this.layout.setNavigationLoading(false);
|
|
473
|
+
return new AXPEntityModifyLoaderDefault(config, data, section);
|
|
474
|
+
}
|
|
475
|
+
this.layout.setNavigationLoading(false);
|
|
476
|
+
return Promise.reject('cannot fetch ');
|
|
477
|
+
}
|
|
478
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPEntityModifyViewLoaderFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
479
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPEntityModifyViewLoaderFactory, providedIn: 'root' }); }
|
|
480
|
+
}
|
|
481
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPEntityModifyViewLoaderFactory, decorators: [{
|
|
482
|
+
type: Injectable,
|
|
483
|
+
args: [{ providedIn: 'root' }]
|
|
484
|
+
}] });
|
|
485
|
+
|
|
486
|
+
const AXPEntityModifyEvent = createWorkFlowEvent('[Entity] Modified');
|
|
487
|
+
class AXPEntityModifyPopupAction extends AXPWorkflowAction {
|
|
847
488
|
constructor() {
|
|
848
489
|
super(...arguments);
|
|
849
|
-
this.entityRegistery = inject(AXPEntityRegistryService);
|
|
850
490
|
this.popupService = inject(AXPopupService);
|
|
851
491
|
this.platform = inject(AXPlatform);
|
|
492
|
+
this.entityRegistery = inject(AXPEntityRegistryService);
|
|
493
|
+
this.entityCreateFactory = inject(AXPEntityModifyViewLoaderFactory);
|
|
852
494
|
}
|
|
853
495
|
async execute(context) {
|
|
854
|
-
const
|
|
496
|
+
const payload = context.getVariable('payload');
|
|
497
|
+
const { module, entity: entityName, section, id } = payload;
|
|
855
498
|
const entity = await this.entityRegistery.resolve(module, entityName);
|
|
856
|
-
const
|
|
857
|
-
const
|
|
858
|
-
|
|
499
|
+
const loader = await this.entityCreateFactory.create(module, entityName, id, section);
|
|
500
|
+
const com = await import('./acorex-platform-layouts-entity-modify-view.component-Bt4MLEou.mjs');
|
|
501
|
+
const popup = await this.popupService.open(com.AXPEntityModifyViewComponent, {
|
|
502
|
+
title: `Modify ${payload.section.title}`,
|
|
859
503
|
size: this.platform.is('Mobile') || this.platform.is('SM') ? 'full' : 'md',
|
|
860
504
|
data: {
|
|
505
|
+
context: loader.data,
|
|
506
|
+
loader: loader,
|
|
507
|
+
properties: payload.section.properties,
|
|
861
508
|
entity,
|
|
862
509
|
},
|
|
863
510
|
});
|
|
864
|
-
|
|
511
|
+
context.setOutput('popupResult', false);
|
|
512
|
+
if (popup.data?.result == true) {
|
|
865
513
|
context.setOutput('popupResult', true);
|
|
866
|
-
context.setVariable('
|
|
514
|
+
context.setVariable('updatedData', cloneDeep(popup.data.context));
|
|
867
515
|
}
|
|
868
516
|
}
|
|
869
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type:
|
|
870
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type:
|
|
517
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPEntityModifyPopupAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
518
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPEntityModifyPopupAction }); }
|
|
871
519
|
}
|
|
872
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type:
|
|
520
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPEntityModifyPopupAction, decorators: [{
|
|
873
521
|
type: Injectable
|
|
874
522
|
}] });
|
|
875
|
-
class
|
|
523
|
+
class AXPEntityModifyConfirmedAction extends AXPWorkflowAction {
|
|
524
|
+
constructor() {
|
|
525
|
+
super(...arguments);
|
|
526
|
+
this.entityRegistery = inject(AXPEntityRegistryService);
|
|
527
|
+
}
|
|
876
528
|
async execute(context) {
|
|
877
|
-
const
|
|
878
|
-
|
|
529
|
+
const payload = context.getVariable('payload');
|
|
530
|
+
const updatedData = context.getVariable('updatedData');
|
|
531
|
+
const entity = await this.entityRegistery.resolve(payload.module, payload.entity);
|
|
532
|
+
this.dispatch(AXPEntityModifyEvent({ module: entity.module, entity: entity.name, updateValues: updatedData }));
|
|
879
533
|
}
|
|
880
534
|
}
|
|
881
|
-
const
|
|
882
|
-
startStepId: '
|
|
535
|
+
const AXPModifyEntityWorkflow = {
|
|
536
|
+
startStepId: 'modifyPopup',
|
|
883
537
|
steps: {
|
|
884
|
-
|
|
885
|
-
id: '
|
|
886
|
-
action: '
|
|
538
|
+
modifyPopup: {
|
|
539
|
+
id: 'modifyPopup',
|
|
540
|
+
action: 'AXPEntityModifyPopupAction',
|
|
887
541
|
nextSteps: [
|
|
888
542
|
{
|
|
889
543
|
conditions: [{ type: 'SINGLE', expression: 'context.getOutput("popupResult") == true' }],
|
|
@@ -896,926 +550,851 @@ const AXPImportEntityWorkflow = {
|
|
|
896
550
|
action: 'AXPToastAction',
|
|
897
551
|
input: {
|
|
898
552
|
color: 'success',
|
|
899
|
-
title: 'Entity
|
|
900
|
-
content: '
|
|
553
|
+
title: 'Entity Modified',
|
|
554
|
+
content: 'Record has been successfully updated.',
|
|
901
555
|
},
|
|
902
556
|
nextSteps: [
|
|
903
557
|
{
|
|
904
558
|
conditions: [],
|
|
905
|
-
nextStepId: '
|
|
559
|
+
nextStepId: 'modifyConfirmed',
|
|
906
560
|
},
|
|
907
561
|
],
|
|
908
562
|
},
|
|
909
|
-
|
|
910
|
-
id: '
|
|
911
|
-
action: '
|
|
563
|
+
modifyConfirmed: {
|
|
564
|
+
id: 'modifyConfirmed',
|
|
565
|
+
action: 'AXPEntityModifyConfirmedAction',
|
|
566
|
+
nextSteps: [
|
|
567
|
+
{
|
|
568
|
+
conditions: [],
|
|
569
|
+
nextStepId: '',
|
|
570
|
+
},
|
|
571
|
+
],
|
|
912
572
|
},
|
|
913
573
|
},
|
|
914
574
|
};
|
|
915
575
|
|
|
916
|
-
class
|
|
917
|
-
constructor(
|
|
918
|
-
|
|
919
|
-
this.
|
|
920
|
-
this.
|
|
921
|
-
this.
|
|
922
|
-
this.
|
|
576
|
+
class AXPShowQuickViewAction extends AXPWorkflowAction {
|
|
577
|
+
constructor() {
|
|
578
|
+
super(...arguments);
|
|
579
|
+
this.entityRegistery = inject(AXPEntityRegistryService);
|
|
580
|
+
this.formatService = inject(AXFormatService);
|
|
581
|
+
this.popupService = inject(AXPopupService);
|
|
582
|
+
this.platform = inject(AXPlatform);
|
|
583
|
+
}
|
|
584
|
+
async execute(context) {
|
|
585
|
+
const payload = context.getVariable('payload');
|
|
586
|
+
const entity = await this.entityRegistery.resolve(payload.module, payload.entity);
|
|
587
|
+
const suggestedProps = entity.properties.find((c) => ['title', 'name', 'code'].includes(c.name));
|
|
588
|
+
let suggestedFormat = 'Item #{{id}}';
|
|
589
|
+
if (suggestedProps)
|
|
590
|
+
suggestedFormat = `{{${suggestedProps.name}}}`;
|
|
591
|
+
const title = this.formatService.format(entity.formats?.header ?? entity.formats?.default ?? suggestedFormat, 'string', payload.data);
|
|
592
|
+
//
|
|
593
|
+
const com = await Promise.resolve().then(function () { return entityQuickView_component; });
|
|
594
|
+
this.popupService.open(com.AXPEntityQuickViewComponent, {
|
|
595
|
+
title: `${title} - Quick View`,
|
|
596
|
+
size: this.platform.is('Mobile') || this.platform.is('SM') ? 'full' : 'md',
|
|
597
|
+
data: {
|
|
598
|
+
entity: entity,
|
|
599
|
+
data: payload.data,
|
|
600
|
+
},
|
|
601
|
+
});
|
|
602
|
+
}
|
|
603
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPShowQuickViewAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
604
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPShowQuickViewAction }); }
|
|
605
|
+
}
|
|
606
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPShowQuickViewAction, decorators: [{
|
|
607
|
+
type: Injectable
|
|
608
|
+
}] });
|
|
609
|
+
const AXPShowQuickViewWorkflow = {
|
|
610
|
+
startStepId: 'showQuickView',
|
|
611
|
+
steps: {
|
|
612
|
+
showQuickView: {
|
|
613
|
+
id: 'showQuickView',
|
|
614
|
+
action: 'AXPShowQuickViewAction',
|
|
615
|
+
},
|
|
616
|
+
},
|
|
617
|
+
};
|
|
618
|
+
|
|
619
|
+
class AXPShowDetailViewAction extends AXPWorkflowAction {
|
|
620
|
+
constructor() {
|
|
621
|
+
super(...arguments);
|
|
622
|
+
this.navigation = inject(AXPWorkflowNavigateAction);
|
|
623
|
+
this.sessionService = inject(AXPSessionService);
|
|
624
|
+
}
|
|
625
|
+
async execute(context) {
|
|
626
|
+
const payload = context.getVariable('payload');
|
|
627
|
+
const id = context.getVariable('id');
|
|
628
|
+
const newPayload = {
|
|
629
|
+
commands: `/${this.sessionService.application?.name}/${payload.module}/e/${payload.entity}/${id}/view`,
|
|
630
|
+
};
|
|
631
|
+
context.setVariable('payload', newPayload);
|
|
632
|
+
this.navigation.execute(context);
|
|
633
|
+
}
|
|
634
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPShowDetailViewAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
635
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPShowDetailViewAction }); }
|
|
636
|
+
}
|
|
637
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPShowDetailViewAction, decorators: [{
|
|
638
|
+
type: Injectable
|
|
639
|
+
}] });
|
|
640
|
+
const AXPShowDetailsViewWorkflow = {
|
|
641
|
+
startStepId: 'showDetailView',
|
|
642
|
+
steps: {
|
|
643
|
+
showDetailView: {
|
|
644
|
+
id: 'showDetailView',
|
|
645
|
+
action: 'AXPShowDetailViewAction',
|
|
646
|
+
},
|
|
647
|
+
},
|
|
648
|
+
};
|
|
649
|
+
|
|
650
|
+
class AXPShowListViewAction extends AXPWorkflowAction {
|
|
651
|
+
constructor() {
|
|
652
|
+
super(...arguments);
|
|
653
|
+
this.navigation = inject(AXPWorkflowNavigateAction);
|
|
654
|
+
this.sessionService = inject(AXPSessionService);
|
|
655
|
+
}
|
|
656
|
+
async execute(context) {
|
|
657
|
+
const payload = context.getVariable('payload');
|
|
658
|
+
const newPayload = {
|
|
659
|
+
commands: `/${this.sessionService.application?.name}/${payload.module}/e/${payload.entity}/list`,
|
|
660
|
+
};
|
|
661
|
+
context.setVariable('payload', newPayload);
|
|
662
|
+
this.navigation.execute(context);
|
|
663
|
+
}
|
|
664
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPShowListViewAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
665
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPShowListViewAction }); }
|
|
666
|
+
}
|
|
667
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPShowListViewAction, decorators: [{
|
|
668
|
+
type: Injectable
|
|
669
|
+
}] });
|
|
670
|
+
const AXPShowListViewWorkflow = {
|
|
671
|
+
startStepId: 'showListView',
|
|
672
|
+
steps: {
|
|
673
|
+
showListView: {
|
|
674
|
+
id: 'showListView',
|
|
675
|
+
action: 'AXPShowListViewAction',
|
|
676
|
+
},
|
|
677
|
+
},
|
|
678
|
+
};
|
|
679
|
+
|
|
680
|
+
class AXPEntityDetailsViewComponent {
|
|
681
|
+
constructor(actions$, unsubscriber) {
|
|
682
|
+
this.actions$ = actions$;
|
|
683
|
+
this.unsubscriber = unsubscriber;
|
|
684
|
+
this.popupService = inject(AXPopupService);
|
|
685
|
+
this.sessionService = inject(AXPSessionService);
|
|
686
|
+
this.activeRoute = inject(ActivatedRoute);
|
|
687
|
+
this.router = inject(Router);
|
|
688
|
+
this.location = inject(Location);
|
|
689
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
690
|
+
this.platform = inject(AXPlatform);
|
|
923
691
|
this.workflow = inject(AXPWorkflowService);
|
|
924
|
-
this.
|
|
925
|
-
this.
|
|
926
|
-
this.
|
|
927
|
-
this.
|
|
928
|
-
this.title = '';
|
|
929
|
-
this.searchValue = '';
|
|
930
|
-
this.searchBoxPlaceholder = '';
|
|
931
|
-
this.searchBoxTitle = '';
|
|
932
|
-
this.searchBoxCollapsed = true;
|
|
933
|
-
this.publicViews$ = this.loader.publicViews$;
|
|
934
|
-
this.customViews$ = this.loader.customViews$;
|
|
935
|
-
this.hasCustomViews$ = this.loader.hasCustomViews$;
|
|
936
|
-
this.view$ = this.loader.view$;
|
|
937
|
-
//
|
|
938
|
-
this.conditions$ = this.loader.conditions$;
|
|
939
|
-
this.conditionsCount$ = this.loader.conditionsCount$;
|
|
940
|
-
//
|
|
941
|
-
this.columns$ = this.loader.displayColumns$;
|
|
942
|
-
this.columnsCount$ = this.loader.displayColumnsCount$;
|
|
943
|
-
//
|
|
944
|
-
this.sort$ = this.loader.sorts$;
|
|
945
|
-
this.sortCount$ = this.loader.sortsCount$;
|
|
946
|
-
//
|
|
947
|
-
this.dataSource = this.loader.dataSource;
|
|
692
|
+
this.loader = this.activeRoute.snapshot.data['loader'];
|
|
693
|
+
this.store = inject((Store));
|
|
694
|
+
this.isSM = this.store.select(isSmallScreen());
|
|
695
|
+
this.isOpen = this.store.select(getChildDrawer());
|
|
948
696
|
//
|
|
949
697
|
this.canDelete = this.loader.entity.editOptions?.delete ?? true;
|
|
950
698
|
this.canCreate = this.loader.entity.editOptions?.create ?? true;
|
|
951
699
|
this.canUpdate = this.loader.entity.editOptions?.update ?? true;
|
|
952
|
-
this.canImport = this.loader.entity.editOptions?.import ?? false;
|
|
953
|
-
this.popupService = inject(AXPopupService);
|
|
954
|
-
this.dropdownRowItems = [
|
|
955
|
-
{
|
|
956
|
-
text: 'Details',
|
|
957
|
-
icon: 'fa-solid fa-eye',
|
|
958
|
-
name: 'edit',
|
|
959
|
-
divided: true,
|
|
960
|
-
},
|
|
961
|
-
{
|
|
962
|
-
text: 'Delete',
|
|
963
|
-
icon: 'fa-solid fa-trash-can',
|
|
964
|
-
name: 'delete',
|
|
965
|
-
color: 'danger',
|
|
966
|
-
disabled: !this.canDelete,
|
|
967
|
-
},
|
|
968
|
-
];
|
|
969
|
-
this.inlineRowItems = [
|
|
970
|
-
{
|
|
971
|
-
text: 'View',
|
|
972
|
-
icon: 'fa-solid fa-eye',
|
|
973
|
-
name: 'view',
|
|
974
|
-
divided: true,
|
|
975
|
-
},
|
|
976
|
-
];
|
|
977
|
-
this.getDropdownRowItems = (rowData) => {
|
|
978
|
-
return Promise.resolve(this.dropdownRowItems);
|
|
979
|
-
};
|
|
980
|
-
this.getInlineRowItems = (rowData) => {
|
|
981
|
-
return this.inlineRowItems;
|
|
982
|
-
};
|
|
983
|
-
//TODO: namespace, module name issues
|
|
984
|
-
this.title = this.manuLoader.currentMenuItem()?.text ?? this.loader.entity.formats?.list ?? this.loader.entity.formats?.default ?? 'Title';
|
|
985
700
|
//
|
|
986
|
-
this.
|
|
987
|
-
|
|
988
|
-
.
|
|
989
|
-
if (event.payload.entity == this.loader.entity.name && event.payload.module == this.loader.entity.module) {
|
|
990
|
-
this.grid.selectedRows = [];
|
|
991
|
-
this.grid?.refresh();
|
|
992
|
-
}
|
|
701
|
+
this.context = signal(cloneDeep(this.loader.data));
|
|
702
|
+
this.activeRoute.paramMap.pipe(first()).subscribe((c) => {
|
|
703
|
+
this.setSection(c.get('section'));
|
|
993
704
|
});
|
|
994
705
|
//
|
|
995
|
-
this.
|
|
996
|
-
this.
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
ngAfterViewInit() {
|
|
1001
|
-
this.loader.setDefaultView();
|
|
1002
|
-
}
|
|
1003
|
-
_getInlineConditionTitles() {
|
|
1004
|
-
const titles = this.loader.getInlineFilterTitles();
|
|
1005
|
-
this.searchBoxTitle = titles.join(', ');
|
|
1006
|
-
if (titles.length > 2)
|
|
1007
|
-
this.searchBoxPlaceholder = titles.slice(0, 2).join(', ') + ' ...';
|
|
1008
|
-
else
|
|
1009
|
-
this.searchBoxPlaceholder = titles.join(', ');
|
|
1010
|
-
}
|
|
1011
|
-
_handleViewsPopover() {
|
|
1012
|
-
this.actionSheetService.open({ content: this.viewsTemplate });
|
|
1013
|
-
}
|
|
1014
|
-
handleDrawerClick() {
|
|
1015
|
-
this.store.dispatch(AXPLayoutChildDrawerToggle());
|
|
1016
|
-
}
|
|
1017
|
-
toggleSearchBox() {
|
|
1018
|
-
this.searchBoxCollapsed = !this.searchBoxCollapsed;
|
|
1019
|
-
}
|
|
1020
|
-
handleRowDbClick(e) {
|
|
1021
|
-
const d = {
|
|
1022
|
-
component: e.component,
|
|
1023
|
-
name: this.dropdownRowItems[0].name,
|
|
1024
|
-
data: e.data,
|
|
1025
|
-
};
|
|
1026
|
-
this.handleRowCommandClick(d);
|
|
1027
|
-
}
|
|
1028
|
-
async handleRowCommandClick(e) {
|
|
1029
|
-
switch (e.name) {
|
|
1030
|
-
case 'view': {
|
|
1031
|
-
await this.workflow.execute('show-quick-view', {
|
|
1032
|
-
payload: {
|
|
1033
|
-
module: this.loader.entity.module,
|
|
1034
|
-
entity: this.loader.entity.name,
|
|
1035
|
-
data: e.data,
|
|
1036
|
-
},
|
|
1037
|
-
});
|
|
1038
|
-
break;
|
|
1039
|
-
}
|
|
1040
|
-
case 'edit': {
|
|
1041
|
-
await this.workflow.execute('show-details', {
|
|
706
|
+
this.workflow.events$.pipe(ofType(AXPEntityDeletedEvent), this.unsubscriber.takeUntilDestroy).subscribe((event) => {
|
|
707
|
+
if (event.payload.entity == this.loader.entity.name &&
|
|
708
|
+
event.payload.module == this.loader.entity.module &&
|
|
709
|
+
event.payload.id.includes(this.loader.data.id)) {
|
|
710
|
+
this.workflow.execute('show-list-view', {
|
|
1042
711
|
payload: {
|
|
1043
712
|
module: this.loader.entity.module,
|
|
1044
713
|
entity: this.loader.entity.name,
|
|
1045
714
|
},
|
|
1046
|
-
id: e.data.id,
|
|
1047
715
|
});
|
|
1048
|
-
break;
|
|
1049
716
|
}
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
717
|
+
});
|
|
718
|
+
this.workflow.events$.pipe(ofType(AXPEntityModifyEvent), this.unsubscriber.takeUntilDestroy).subscribe(async (event) => {
|
|
719
|
+
if (event.payload.entity == this.loader.entity.name &&
|
|
720
|
+
event.payload.module == this.loader.entity.module &&
|
|
721
|
+
event.payload.updateValues.id === this.loader.data.id) {
|
|
722
|
+
await this.loader.update(event.payload.updateValues);
|
|
723
|
+
this.context.set(cloneDeep(this.loader.data));
|
|
1057
724
|
}
|
|
1058
|
-
}
|
|
1059
|
-
}
|
|
1060
|
-
handleCreateClick() {
|
|
1061
|
-
this.workflow.execute('create-entity', {
|
|
1062
|
-
payload: {
|
|
1063
|
-
module: this.loader.entity.module,
|
|
1064
|
-
entity: this.loader.entity.name,
|
|
1065
|
-
},
|
|
1066
725
|
});
|
|
1067
726
|
}
|
|
1068
|
-
|
|
1069
|
-
this.
|
|
727
|
+
handleMenuClick(e, item) {
|
|
728
|
+
const entity = this.loader.entity;
|
|
729
|
+
const path = `/${this.sessionService.application?.name}/${entity.module}/e/${entity.name}/${this.loader.data?.id}/view/${item.name}`;
|
|
730
|
+
this.location.go(path);
|
|
731
|
+
this.setSection(item.name);
|
|
732
|
+
}
|
|
733
|
+
handleCollapsedChange(value) {
|
|
734
|
+
if (value)
|
|
735
|
+
this.store.dispatch(AXPLayoutChildDrawerClose());
|
|
736
|
+
}
|
|
737
|
+
handleDrawerClick() {
|
|
738
|
+
this.store.dispatch(AXPLayoutChildDrawerToggle());
|
|
739
|
+
}
|
|
740
|
+
setSection(name) {
|
|
741
|
+
this.loader.setSection(name);
|
|
742
|
+
}
|
|
743
|
+
async handleSectionEdit(section) {
|
|
744
|
+
this.workflow.execute('modify-entity', {
|
|
1070
745
|
payload: {
|
|
1071
746
|
module: this.loader.entity.module,
|
|
1072
747
|
entity: this.loader.entity.name,
|
|
748
|
+
id: this.loader.data.id,
|
|
749
|
+
section: section,
|
|
1073
750
|
},
|
|
1074
751
|
});
|
|
1075
752
|
}
|
|
753
|
+
isActive(item) {
|
|
754
|
+
return item.name == window.location.pathname.split('/').pop();
|
|
755
|
+
}
|
|
1076
756
|
handleCommandClick(command) {
|
|
1077
757
|
switch (command) {
|
|
1078
758
|
case 'delete':
|
|
1079
|
-
this.workflow.execute('delete-entity', {
|
|
1080
|
-
module: this.loader.entity.module,
|
|
1081
|
-
entity: this.loader.entity.name,
|
|
1082
|
-
ids: this.
|
|
1083
|
-
});
|
|
1084
|
-
break;
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
this.loader.resetConditions();
|
|
1097
|
-
break;
|
|
1098
|
-
case 'columns':
|
|
1099
|
-
this.loader.resetColumns();
|
|
1100
|
-
break;
|
|
1101
|
-
case 'sorts':
|
|
1102
|
-
this.loader.resetSort();
|
|
1103
|
-
break;
|
|
1104
|
-
default:
|
|
1105
|
-
break;
|
|
1106
|
-
}
|
|
1107
|
-
}
|
|
1108
|
-
}
|
|
1109
|
-
handleChangeSearchValue(e) {
|
|
1110
|
-
if (e.isUserInteraction) {
|
|
1111
|
-
this.loader.handleInlineSearch(e.value);
|
|
1112
|
-
}
|
|
1113
|
-
}
|
|
1114
|
-
async addCustomViewPopup() {
|
|
1115
|
-
const newView = {
|
|
1116
|
-
name: 'custom-view',
|
|
1117
|
-
title: 'Custom View',
|
|
1118
|
-
fixed: false,
|
|
1119
|
-
sorts: [],
|
|
1120
|
-
columns: convertPropertiesToColumns(...this.loader.entity.properties),
|
|
1121
|
-
conditions: [],
|
|
1122
|
-
};
|
|
1123
|
-
const popup = await this.popupService.open(AXPEntityCreateCustomViewComponent, {
|
|
1124
|
-
title: 'Create Custom View',
|
|
1125
|
-
size: this.platform.is('Mobile') || this.platform.is('SM') ? 'full' : 'md',
|
|
1126
|
-
closeOnBackdropClick: true,
|
|
1127
|
-
draggable: false,
|
|
1128
|
-
data: {
|
|
1129
|
-
loader: this.loader,
|
|
1130
|
-
selectedView: newView,
|
|
1131
|
-
mode: 'create',
|
|
1132
|
-
},
|
|
1133
|
-
});
|
|
1134
|
-
if (popup.data?.save == true) {
|
|
1135
|
-
console.log('updatedView: ', popup.data.updatedView);
|
|
1136
|
-
this.loader.createView(popup.data.updatedView);
|
|
1137
|
-
}
|
|
1138
|
-
}
|
|
1139
|
-
async updateViewPopup(e, selectedView) {
|
|
1140
|
-
// (e.nativeEvent as UIEvent).stopPropagation();
|
|
1141
|
-
const popup = await this.popupService.open(AXPEntityCreateCustomViewComponent, {
|
|
1142
|
-
title: 'Modify Custom View',
|
|
1143
|
-
size: this.platform.is('Mobile') || this.platform.is('SM') ? 'full' : 'md',
|
|
1144
|
-
closeOnBackdropClick: true,
|
|
1145
|
-
draggable: false,
|
|
1146
|
-
data: {
|
|
1147
|
-
loader: this.loader,
|
|
1148
|
-
selectedView,
|
|
1149
|
-
mode: 'edit',
|
|
1150
|
-
},
|
|
1151
|
-
});
|
|
1152
|
-
if (popup.data?.delete == true) {
|
|
1153
|
-
this.loader.deleteView(popup.data.viewName);
|
|
1154
|
-
}
|
|
1155
|
-
if (popup.data?.save == true) {
|
|
1156
|
-
console.log('updatedView: ', popup.data.updatedView);
|
|
1157
|
-
this.loader.updateView(popup.data.updatedView);
|
|
759
|
+
this.workflow.execute('delete-entity', {
|
|
760
|
+
module: this.loader.entity.module,
|
|
761
|
+
entity: this.loader.entity.name,
|
|
762
|
+
ids: [this.loader.data.id],
|
|
763
|
+
});
|
|
764
|
+
break;
|
|
765
|
+
case 'create': {
|
|
766
|
+
this.workflow.execute('create-entity', {
|
|
767
|
+
payload: {
|
|
768
|
+
module: this.loader.entity.module,
|
|
769
|
+
entity: this.loader.entity.name,
|
|
770
|
+
},
|
|
771
|
+
});
|
|
772
|
+
break;
|
|
773
|
+
}
|
|
774
|
+
default:
|
|
775
|
+
break;
|
|
1158
776
|
}
|
|
1159
777
|
}
|
|
1160
|
-
|
|
1161
|
-
this.dataSource.reset();
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AXPEntityListViewComponent, selector: "ng-component", providers: [AXUnsubscriber], viewQueries: [{ propertyName: "viewsTemplate", first: true, predicate: ["viewsTemplate"], descendants: true }, { propertyName: "grid", first: true, predicate: ["grid"], descendants: true }, { propertyName: "entityViewDrawer", first: true, predicate: ["entityViewDrawer"], descendants: true }], ngImport: i0, template: "<ax-drawer-container>\n <!-- <ax-drawer #drawer location=\"start\" [collapsed]=\"true\" [mode]=\"platform.is('SM') ? 'overlay' : 'push'\">\n <ax-content class=\"ax-w-64 ax-border-e\">\n <div class=\"ax-p-6 ax-py-4 ax-gap-6 ax-flex ax-flex-col\">\n <p class=\"ax-text-2xl ax-font-bold\">Folders</p>\n <ax-side-menu>\n <ng-container *ngFor=\"let node of menuItems\" [ngTemplateOutlet]=\"sideMenu\"\n [ngTemplateOutletContext]=\"{ $implicit: node }\">\n </ng-container>\n </ax-side-menu>\n <ng-template #sideMenu let-item>\n <ax-side-menu-item [text]=\"item.text\">\n <ax-prefix>\n <ax-icon class=\"fa-solid fa-folder ax-text-warning-500\"></ax-icon>\n </ax-prefix>\n <ng-container *ngIf=\"item.children\">\n <ng-container *ngFor=\"let child of item.children\" [ngTemplateOutlet]=\"sideMenu\"\n [ngTemplateOutletContext]=\"{ $implicit: child }\">\n </ng-container>\n </ng-container>\n </ax-side-menu-item>\n </ng-template>\n </div>\n </ax-content>\n </ax-drawer> -->\n <ax-content class=\"ax-flex ax-flex-col ax-overflow-hidden\">\n <div\n class=\"ax-flex ax-flex-col ax-gap-0 md:ax-gap-4 ax-px-4 ax-py-3 md:ax-py-4 md:ax-px-6 ax-bg-surface ax-border-b md:ax-border-0 md:ax-bg-default\"\n >\n @if(platform.is('MD')){\n <div class=\"ax-flex ax-justify-between ax-mb-4\">\n @if(this.grid?.selectedRows?.length==0){\n <div class=\"ax-text-xl ax-font-bold\">{{ title }}</div>\n <div class=\"ax-flex ax-items-center ax-gap-2\">\n @if(canCreate) {\n <ax-button color=\"primary\" class=\"ax-sm\" (onClick)=\"handleCreateClick()\">\n <ax-icon class=\"fa-solid fa-add\"></ax-icon>\n </ax-button>\n }\n <ax-button color=\"ghost\" class=\"ax-sm\" #more>\n <ax-icon class=\"fa-solid fa-ellipsis-vertical\"> </ax-icon>\n <ax-dropdown-panel [adaptivityEnabled]=\"true\">\n <ax-button-item-list>\n <ax-button-item text=\"Export\" class=\"ax-font-semibold\">\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-file-export\"> </ax-icon>\n </ax-prefix>\n </ax-button-item>\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n </div>\n }@else {\n <div class=\"ax-flex ax-items-center ax-gap-3\">\n <span class=\"ax-text-xl ax-font-bold\"> {{ this.grid?.selectedRows?.length }} Items Selected </span>\n <span (click)=\"clearSelectedItems()\" class=\"ax-text-sm ax-text-primary dark:ax-text-primary-300 ax-underline ax-cursor-pointer\"\n >Clear Items</span\n >\n </div>\n <div class=\"ax-flex ax-items-center ax-gap-2\">\n @if(canDelete) {\n <ax-button color=\"danger\" class=\"ax-sm\" (onClick)=\"handleCommandClick('delete')\">\n <ax-icon class=\"fa-solid fa-trash\"> </ax-icon>\n </ax-button>\n }\n <ax-button color=\"ghost\" class=\"ax-sm\" #more>\n <ax-icon class=\"fa-solid fa-ellipsis-vertical\"> </ax-icon>\n </ax-button>\n </div>\n }\n </div>\n\n <div class=\"ax-flex ax-items-center ax-justify-between\">\n <ax-button [disabled]=\"this.grid?.selectedRows?.length != 0\" [text]=\"(view$ | async)?.title\" color=\"ghost\">\n <ax-icon class=\"fa-solid fa-eye ax-text-neutral-400\"> </ax-icon>\n <ax-suffix>\n <i class=\"fa-solid fa-caret-down\"></i>\n </ax-suffix>\n <ax-dropdown-panel [adaptivityEnabled]=\"true\">\n <ax-button-item-list class=\"ax-bg-surface\">\n <ax-title class=\"ax-font-bold ax-opacity-100\">{{ 'entity.public-view' | translate | async }}</ax-title>\n <ax-button-item\n *ngFor=\"let v of publicViews$ | async\"\n [text]=\"v.title\"\n [class.ax-bg-on-surface]=\"(view$ | async) == v\"\n (onClick)=\"loader.setView(v.name)\"\n ></ax-button-item>\n <ax-title class=\"ax-font-bold ax-opacity-100\" *ngIf=\"hasCustomViews$ | async\">Created by me</ax-title>\n <ax-button-item\n *ngFor=\"let v of customViews$ | async\"\n [text]=\"v.title\"\n [class.ax-bg-on-surface]=\"(view$ | async) == v\"\n (onClick)=\"loader.setView(v.name)\"\n ></ax-button-item>\n <ng-container *feature=\"'axp-entity-list-custom-view'\">\n <ax-divider></ax-divider>\n <ax-button-item (onClick)=\"addCustomViewPopup()\" text=\"Add Custom View\" class=\"ax-font-semibold ax-text-primary\"></ax-button-item>\n </ng-container>\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n <div class=\"ax-flex ax-gap-2\">\n @if(searchBoxTitle){\n <ax-button (onClick)=\"toggleSearchBox()\" [disabled]=\"this.grid?.selectedRows?.length != 0\" color=\"ghost\">\n <ax-icon class=\"fa-solid fa-search ax-text-neutral-400\"> </ax-icon>\n </ax-button>\n }\n <ax-button [disabled]=\"this.grid?.selectedRows?.length != 0\" color=\"ghost\" (onClick)=\"columnsDrawer.open()\">\n <ax-icon class=\"fa-solid fa-bars ax-text-neutral-400\"> </ax-icon>\n </ax-button>\n <ax-button [disabled]=\"this.grid?.selectedRows?.length != 0\" color=\"ghost\" (onClick)=\"conditionsDrawer.open()\">\n <ax-icon class=\"fa-solid fa-sliders ax-text-neutral-400\"> </ax-icon>\n @if ((conditionsCount$ | async)) {\n <ax-suffix>\n <ax-badge [color]=\"'primary'\"></ax-badge>\n </ax-suffix>\n }\n </ax-button>\n <ax-button [disabled]=\"this.grid?.selectedRows?.length != 0\" color=\"ghost\" (onClick)=\"sortsDrawer.open()\">\n <ax-icon class=\"fa-solid fa-bars-sort ax-text-neutral-400\"> </ax-icon>\n @if ((sortCount$ | async)) {\n <ax-suffix>\n <ax-badge [color]=\"'primary'\"></ax-badge>\n </ax-suffix>\n }\n </ax-button>\n </div>\n </div>\n <div [class.collapsed-search-box]=\"searchBoxCollapsed\" class=\"ax-transition-all ax-mt-4\">\n <ax-search-box [title]=\"searchBoxTitle\" [placeholder]=\"('widget.lookup.search' | translate | async) + searchBoxPlaceholder\"\n ><ax-clear-button></ax-clear-button\n ></ax-search-box>\n </div>\n } @else {\n <div class=\"ax-flex ax-items-center ax-justify-between ax-gap-3\">\n <div class=\"ax-text-xl md:ax-text-3xl ax-font-bold ax-mb-2\">{{ title }}</div>\n @if(this.grid?.selectedRows?.length==0){\n <div class=\"ax-flex ax-gap-3\">\n @if(canCreate) {\n <ax-button [text]=\"'create-new' | translate | async\" color=\"primary\" (onClick)=\"handleCreateClick()\">\n <ax-prefix>\n <i class=\"fa-solid fa-add\"></i>\n </ax-prefix>\n </ax-button>\n }\n <ax-button [text]=\"'entity.actions' | translate | async\" color=\"ghost\">\n <ax-prefix>\n <i class=\"fa-solid fa-ellipsis-vertical\"></i>\n </ax-prefix>\n <ax-dropdown-panel [adaptivityEnabled]=\"true\">\n <ax-button-item-list>\n @if(canImport){\n <ax-button-item (onClick)=\"handleImportClick()\" text=\"Import\" class=\"ax-font-semibold\">\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-file-import\"> </ax-icon>\n </ax-prefix>\n </ax-button-item>\n }\n <ax-button-item text=\"Export\" class=\"ax-font-semibold\">\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-file-export\"> </ax-icon>\n </ax-prefix>\n </ax-button-item>\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n </div>\n }@else {\n <div class=\"ax-flex ax-gap-3\">\n @if(canDelete) {\n <ax-button text=\"Delete Items\" color=\"danger\" (onClick)=\"handleCommandClick('delete')\">\n <ax-prefix>\n <i class=\"fa-solid fa-trash\"></i>\n </ax-prefix>\n </ax-button>\n }\n <ax-button [text]=\"'entity.actions' | translate | async\" color=\"ghost\">\n <ax-prefix>\n <i class=\"fa-solid fa-ellipsis-vertical\"></i>\n </ax-prefix>\n </ax-button>\n </div>\n }\n </div>\n <div class=\"ax-flex ax-items-center ax-justify-between\">\n <!----------------------- View Mode --------------------->\n @if(this.grid?.selectedRows?.length==0) {\n <div class=\"ax-flex ax-w-full ax-justify-between ax-gap-3\">\n <div class=\"ax-flex ax-gap-3\">\n <ax-button [text]=\"(view$ | async)?.title\" #views color=\"ghost\">\n <ax-prefix>\n <i class=\"fa-solid fa-eye\"></i>\n </ax-prefix>\n <ax-suffix>\n <i class=\"fa-solid fa-caret-down\"></i>\n </ax-suffix>\n <ax-dropdown-panel [adaptivityEnabled]=\"true\">\n <ax-button-item-list class=\"ax-bg-surface\">\n <ax-title class=\"ax-font-bold ax-opacity-100\">{{ 'entity.public-view' | translate | async }}</ax-title>\n <ax-button-item\n *ngFor=\"let v of publicViews$ | async\"\n [text]=\"v.title\"\n [class.ax-bg-on-surface]=\"(view$ | async) == v\"\n (onClick)=\"loader.setView(v.name)\"\n ></ax-button-item>\n <ax-title class=\"ax-font-bold ax-opacity-100\" *ngIf=\"hasCustomViews$ | async\">Created by me</ax-title>\n <ax-button-item\n class=\"ax-pe-4 ax-flex ax-justify-between\"\n *ngFor=\"let v of customViews$ | async\"\n [text]=\"v.title\"\n [class.ax-bg-on-surface]=\"(view$ | async) == v\"\n (onClick)=\"loader.setView(v.name)\"\n >\n <ax-suffix>\n <ax-button (onClick)=\"updateViewPopup($event, v)\" class=\"ax-xs\" look=\"none\">\n <ax-icon class=\"far fa-edit\"> </ax-icon>\n </ax-button>\n </ax-suffix>\n </ax-button-item>\n <ng-container *feature=\"'axp-entity-list-custom-view'\">\n <ax-divider></ax-divider>\n <ax-button-item text=\"Add Custom View\" (onClick)=\"addCustomViewPopup()\" class=\"ax-font-semibold ax-text-primary\"></ax-button-item>\n </ng-container>\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n @if(searchBoxTitle){\n <div class=\"ax-w-72\">\n <ax-search-box\n [title]=\"searchBoxTitle\"\n [(ngModel)]=\"searchValue\"\n (onValueChanged)=\"handleChangeSearchValue($event)\"\n [placeholder]=\"('widget.lookup.search' | translate | async) + searchBoxPlaceholder\"\n ><ax-clear-button></ax-clear-button\n ></ax-search-box>\n </div>\n }\n </div>\n\n <div class=\"ax-flex ax-gap-3\">\n <ax-button [text]=\"'entity.columns' | translate | async\" color=\"ghost\" #columns (onClick)=\"columnsDrawer.open()\">\n <ax-prefix>\n <i class=\"fa-solid fa-bars\"></i>\n </ax-prefix>\n <ax-suffix>\n <ax-badge text=\"{{ columnsCount$ | async }}\" color=\"primary\"></ax-badge>\n </ax-suffix>\n </ax-button>\n <ax-button text=\"Filters\" color=\"ghost\" (onClick)=\"conditionsDrawer.open()\" #conditions>\n <ax-prefix>\n <i class=\"fa-solid fa-sliders\"></i>\n </ax-prefix>\n <ax-suffix>\n <ax-badge text=\"{{ conditionsCount$ | async }}\" color=\"primary\"></ax-badge>\n </ax-suffix>\n </ax-button>\n <ax-button [text]=\"'entity.sort' | translate | async\" color=\"ghost\" (onClick)=\"sortsDrawer.open()\">\n <ax-prefix>\n <i class=\"fa-solid fa-bars-sort\"></i>\n </ax-prefix>\n <ax-suffix *ngIf=\"(sortCount$ | async)! > 0\">\n <ax-badge text=\"{{ sortCount$ | async }}\" color=\"primary\"></ax-badge>\n </ax-suffix>\n </ax-button>\n </div>\n </div>\n\n } @else{\n <!----------------------- Selection Mode --------------------->\n <div>\n <div class=\"ax-flex ax-gap-3 ax-items-center ax-h-10\">\n <span class=\"ax-text-xl ax-font-bold\"> {{ this.grid?.selectedRows?.length }} Items Selected </span>\n <span (click)=\"clearSelectedItems()\" class=\"ax-text-sm ax-text-primary dark:ax-text-primary-300 ax-underline ax-cursor-pointer\"\n >Clear Items</span\n >\n </div>\n </div>\n }\n </div>\n }\n </div>\n <div class=\"ax-flex-1 ax-px-6 ax-py-4 ax-flex ax-overflow-auto\">\n <ax-data-table\n #grid\n [showFooter]=\"false\"\n class=\"ax-flex-1\"\n [dataSource]=\"dataSource\"\n [paging]=\"true\"\n [fetchDataMode]=\"'manual'\"\n (onRowDbClick)=\"handleRowDbClick($event)\"\n [loading]=\"{ enabled: true, animation: true }\"\n >\n <!-- <ax-index-column *ngIf=\"!platform.is('SM')\" [width]=\"'85px'\"></ax-index-column> -->\n <ax-select-column fixed=\"start\" [width]=\"'50px'\"></ax-select-column>\n @for(col of (columns$ | async);track col.name) {\n <axp-widget-column-renderer\n *ngIf=\"col.visible\"\n [schema]=\"col.schema\"\n [dataField]=\"col.name\"\n [caption]=\"col.title\"\n [options]=\"col.options\"\n [displayFormat]=\"col.displayFormat\"\n [width]=\"'180px'\"\n [allowSorting]=\"false\"\n >\n </axp-widget-column-renderer>\n }\n <ax-dropdown-command-column\n fixed=\"end\"\n [width]=\"'60px'\"\n [items]=\"getDropdownRowItems\"\n (onItemClick)=\"handleRowCommandClick($event)\"\n ></ax-dropdown-command-column>\n <ax-command-column fixed=\"end\" [width]=\"'60px'\" [items]=\"getInlineRowItems\" (onItemClick)=\"handleRowCommandClick($event)\"></ax-command-column>\n </ax-data-table>\n </div>\n </ax-content>\n <ax-drawer (collapsedChange)=\"closeDrawer('columns', $event)\" #columnsDrawer location=\"end\" [mode]=\"'overlay'\">\n <ax-content class=\"ax-w-[85vw] md:ax-w-[45vw] lg:ax-w-[35vw] 2xl:ax-w-[20vw] ax-border-e\">\n <axp-list-view-option-columns [loader]=\"loader\" (onClosed)=\"columnsDrawer.close()\"></axp-list-view-option-columns>\n </ax-content>\n </ax-drawer>\n <ax-drawer (collapsedChange)=\"closeDrawer('conditions', $event)\" #conditionsDrawer location=\"end\" [mode]=\"'overlay'\">\n <ax-content class=\"ax-w-[85vw] md:ax-w-[45vw] lg:ax-w-[35vw] 2xl:ax-w-[25vw] ax-border-e\">\n <axp-list-view-option-conditions [loader]=\"loader\" (onClosed)=\"conditionsDrawer.close()\"></axp-list-view-option-conditions>\n </ax-content>\n </ax-drawer>\n <ax-drawer (collapsedChange)=\"closeDrawer('sorts', $event)\" #sortsDrawer location=\"end\" [mode]=\"'overlay'\">\n <ax-content class=\"ax-w-[85vw] md:ax-w-[45vw] lg:ax-w-[35vw] 2xl:ax-w-[20vw] ax-border-e\">\n <axp-list-view-option-sorting (onClosed)=\"sortsDrawer.close()\" [loader]=\"loader\"></axp-list-view-option-sorting>\n </ax-content>\n </ax-drawer>\n</ax-drawer-container>\n", styles: [".cdk-drag-preview{border-radius:.375rem;border-width:1px;--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px 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:rgba(var(--ax-color-on-surface));padding:.5rem;height:max-content!important}.collapsed-search-box{margin-top:0;height:0px;opacity:0}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6$1.AXDataTableComponent, selector: "ax-data-table", inputs: ["dataSource", "rowTemplate", "emptyTemplate", "alternative", "showHeader", "fixedHeader", "showFooter", "fixedFooter", "itemHeight", "allowReordering", "paging", "fetchDataMode", "loading", "focusedRow"], outputs: ["selectedRowsChange", "focusedRowChange", "onRowClick", "onRowDbClick", "onColumnsOrderChanged"] }, { kind: "component", type: i6$1.AXRowSelectColumnComponent, selector: "ax-select-column", inputs: ["width", "caption", "fixed"] }, { kind: "component", type: i6$1.AXRowCommandColumnComponent, selector: "ax-command-column", inputs: ["width", "caption", "fixed", "footerTemplate", "items"], outputs: ["onItemClick"] }, { kind: "component", type: i6$1.AXRowDropdownCommandColumnComponent, selector: "ax-dropdown-command-column", inputs: ["width", "caption", "fixed", "footerTemplate", "items"], outputs: ["onItemClick"] }, { kind: "component", type: i4.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "type", "responsiveOn", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "responsiveOnChange", "loadingTextChange"] }, { kind: "component", type: i4.AXButtonItemComponent, selector: "ax-button-item", inputs: ["color", "disabled", "text", "selected", "divided", "data", "name"], outputs: ["onClick", "onFocus", "onBlur", "disabledChange"] }, { kind: "component", type: i4.AXButtonItemListComponent, selector: "ax-button-item-list", inputs: ["items"], outputs: ["onItemClick"] }, { kind: "component", type: i4$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i4$1.AXDecoratorClearButtonComponent, selector: "ax-clear-button", inputs: ["icon"] }, { kind: "component", type: i4$1.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-sub-title, ax-placeholder, ax-overlay" }, { kind: "component", type: i5.AXBadgeComponent, selector: "ax-badge", inputs: ["color", "look", "text"] }, { kind: "component", type: i10$2.AXDropdownPanelComponent, selector: "ax-dropdown-panel", inputs: ["isOpen", "fitParent", "dropdownWidth", "position", "_target", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "component", type: i11$1.AXDrawerComponent, selector: "ax-drawer", inputs: ["location", "showBackdrop", "mode", "collapsed", "closeOthers"], outputs: ["locationChange", "modeChange", "collapsedChange"] }, { kind: "component", type: i11$1.AXDrawerContainerComponent, selector: "ax-drawer-container" }, { kind: "component", type: i12.AXSearchBoxComponent, selector: "ax-search-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "value", "state", "name", "id", "look", "delayTime"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "component", type: i10$1.AXPWidgetColumnRendererComponent, selector: "axp-widget-column-renderer", inputs: ["width", "caption", "headerTemplate", "allowSorting", "fixed", "footerTemplate", "cellTemplate", "options", "dataField", "displayFormat", "schema"] }, { kind: "directive", type: i14$1.AXPFeatureDirective, selector: "[feature]", inputs: ["feature", "featureElse"] }, { kind: "component", type: AXPListViewOptionsColumnsComponent, selector: "axp-list-view-option-columns", inputs: ["loader"], outputs: ["onClosed"] }, { kind: "component", type: AXPListViewOptionConditionsComponent, selector: "axp-list-view-option-conditions", inputs: ["loader"], outputs: ["onClosed"] }, { kind: "component", type: AXPListViewOptionSortingComponent, selector: "axp-list-view-option-sorting", inputs: ["loader"], outputs: ["onClosed"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i8$1.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
778
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPEntityDetailsViewComponent, deps: [{ token: i1.Actions }, { token: i2.AXUnsubscriber }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
779
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AXPEntityDetailsViewComponent, isStandalone: true, selector: "ng-component", providers: [AXUnsubscriber], viewQueries: [{ propertyName: "drawer", first: true, predicate: ["drawer"], descendants: true }], ngImport: i0, template: "<ax-drawer-container>\n <!-- <ax-drawer #drawer location=\"start\" [collapsed]=\"!(isOpen | async)\" [mode]=\" (isSM | async) ? 'overlay' : 'push'\"\n *ngIf=\"loader.hasSections$ | async\" (collapsedChange)=\"handleCollapsedChange($event)\">\n <ax-content class=\"ax-border-e ax-p-6 ax-w-64\">\n <p class=\"ax-text-xl ax-font-bold ax-mb-6\">{{loader.sectionTitle}}</p>\n <ax-tabs look=\"with-line\" location=\"start\">\n @for(tab of (loader.sections$ | async); track tab.name)\n {\n <ax-tab-item [text]=\"tab.title\" [active]=\"isActive(tab)\" (onClick)=\"handleMenuClick($event,tab)\"\n [disabled]=\"editForm.context\">\n </ax-tab-item>\n }\n </ax-tabs>\n </ax-content>\n </ax-drawer> -->\n <ax-content #content class=\"ax-overflow-x-hidden\">\n <div class=\"ax-flex ax-flex-col ax-gap-4 ax-min-h-full ax-px-4 ax-pb-4 md:ax-px-6 ax-bg-surface ax-border-b md:ax-border-0 md:ax-bg-default\">\n <div\n class=\"ax-flex ax-flex-col ax-pt-4 ax-sticky ax-top-0 ax-z-10 ax-transition-all\"\n #sticky=\"axpSticky\"\n [axpSticky]=\"'ax-bg-surface ax-px-6 ax-py-3 -ax-mx-6 ax-shadow-xl'\"\n [stickyParent]=\"content.getHostElement()\"\n >\n <!-------- Begin Toolbar -------->\n <div class=\"ax-flex ax-justify-between ax-items-center\">\n <!-------- Begin Title -------->\n <div class=\"ax-flex ax-gap-1 ax-items-center\">\n <!-- <ax-button class=\"lg:ax-hidden\">\n <ax-icon class=\"fa-solid fa-chevron-left\"></ax-icon>\n </ax-button> -->\n <div class=\"ax-flex ax-flex-col ax-gap-2\">\n <div class=\"ax-text-xl md:ax-text-3xl ax-font-bold\">{{ loader.title }}</div>\n <!-- <ax-breadcrumbs class=\"child:ax-font-normal child:ax-text-neutral-400\">\n <ng-template #divider>\n <i class=\"fa-solid fa-chevron-right ax-text-xs ax-mx-2\"></i>\n </ng-template>\n <ax-breadcrumbs-item>\n <a>Home</a>\n </ax-breadcrumbs-item>\n <ax-breadcrumbs-item>\n <a>{{ loader.entity.title }}</a>\n </ax-breadcrumbs-item>\n <ax-breadcrumbs-item [active]=\"true\" class=\"!ax-font-semibold !ax-text-neutral-600\">\n {{ loader.title }}\n </ax-breadcrumbs-item>\n </ax-breadcrumbs> -->\n </div>\n </div>\n <!-------- Finish Title -------->\n <!--------------------------------------------------------------->\n <!-- Begin Action Menu -->\n <div class=\"ax-flex ax-items-center ax-gap-3\">\n @if(canCreate || canUpdate) {\n <ax-button [text]=\"(isSM | async) ? null : 'Actions'\" color=\"ghost\">\n <ax-prefix>\n <i class=\"fa-solid fa-ellipsis-vertical\"></i>\n </ax-prefix>\n <ax-dropdown-panel>\n <ax-button-item-list>\n <!-- <ax-button-item text=\"Share\" class=\"ax-font-semibold\">\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-share\"> </ax-icon>\n </ax-prefix>\n </ax-button-item> \n <ax-divider></ax-divider>-->\n @if(canCreate) {\n <ax-button-item\n [text]=\"('create-new' | translate | async) ?? ' '\"\n class=\"ax-font-semibold ax-text-primary\"\n (onClick)=\"handleCommandClick('create')\"\n >\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-add\"> </ax-icon>\n </ax-prefix>\n </ax-button-item>\n } @if(canDelete) {\n <ax-button-item text=\"Delete\" class=\"ax-font-semibold ax-text-danger\" (onClick)=\"handleCommandClick('delete')\">\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-trash\"> </ax-icon>\n </ax-prefix>\n </ax-button-item>\n }\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n }\n </div>\n <!-- Finish Action Menu -->\n </div>\n <!----- Finish Toolbar ----->\n <!--------------------------------------------------------------->\n <!-- Begin Section Tab Items -->\n @if((loader.hasSections$| async)) {\n <ax-tabs look=\"with-line\" location=\"bottom\" class=\"ax-mt-2\">\n @for(tab of (loader.sections$ | async); track tab.name) {\n <ax-tab-item [text]=\"tab.title\" [active]=\"isActive(tab)\" (onClick)=\"handleMenuClick($event, tab)\" class=\"first:!ax-ms-0\"> </ax-tab-item>\n }\n </ax-tabs>\n }\n <!-- Finish Section Tab Items -->\n </div>\n @for(section of (loader.section$ | async)?.sections; track section.name) {\n <ax-form #form>\n <div class=\"ax-card ax-shadow-md\">\n <div class=\"ax-card-header\">\n <p>{{ section.title }}</p>\n @if(canUpdate) {\n <ax-button text=\"{{ 'entity.modify' | translate | async }}\" class=\"ax-sm\" color=\"primary\" (onClick)=\"handleSectionEdit(section)\">\n <ax-icon class=\"fa-solid fa-pen\"> </ax-icon>\n </ax-button>\n }\n </div>\n <div class=\"ax-card-body ax-divide-y ax-divide-gray-100 dark:ax-divide-gray-700 !ax-gap-0\">\n <ng-container *ngFor=\"let name of section.properties\">\n <ng-container *ngIf=\"loader.getProp(name) as prop\">\n <div class=\"ax-grid md:ax-grid-cols-12 ax-gap-2 ax-py-4 first:ax-pt-0 last:ax-pb-0\">\n @if(section.options?.showPropTitle!=false){\n <div class=\"ax-col-span-12 md:ax-col-span-3 lg:ax-col-span-2 ax-flex ax-items-center md:ax-items-start ax-justify-between\">\n <div class=\"ax-flex ax-flex-col ax-items-start\">\n <span class=\"ax-font-semibold\">{{ prop.title }}</span>\n <!-- @if(prop.description) {\n <i\n class=\"fa-solid fa-circle-info fa-sm ax-text-neutral-500 dark:ax-text-neutral-400 ax-cursor-pointer\"\n [axTooltip]=\"prop.description\"\n [axTooltipPlacement]=\"'end'\"\n ></i>\n } -->\n @if(prop.description) {\n <span class=\"ax-text-neutral-500 ax-text-xs\">{{ prop.description }}</span>\n }\n </div>\n </div>\n }\n <div [class]=\"section.options?.showPropTitle == false ? 'ax-col-span-12' : 'ax-col-span-12 md:ax-col-span-9 lg:ax-col-span-10'\">\n <axp-widget-renderer [schema]=\"prop.schema\" [context]=\"context()\" [prop]=\"prop\" [mode]=\"'view'\"></axp-widget-renderer>\n </div>\n </div>\n </ng-container>\n </ng-container>\n </div>\n </div>\n </ax-form>\n }\n </div>\n </ax-content>\n</ax-drawer-container>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: RouterModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i4.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "type", "responsiveOn", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "responsiveOnChange", "loadingTextChange"] }, { kind: "component", type: i4.AXButtonItemComponent, selector: "ax-button-item", inputs: ["color", "disabled", "text", "selected", "divided", "data", "name"], outputs: ["onClick", "onFocus", "onBlur", "disabledChange"] }, { kind: "component", type: i4.AXButtonItemListComponent, selector: "ax-button-item-list", inputs: ["items"], outputs: ["onItemClick"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i4$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i4$1.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-sub-title, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXBadgeModule }, { kind: "ngmodule", type: AXDropdownModule }, { kind: "component", type: i6.AXDropdownPanelComponent, selector: "ax-dropdown-panel", inputs: ["isOpen", "fitParent", "dropdownWidth", "position", "_target", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "ngmodule", type: AXPopoverModule }, { kind: "ngmodule", type: AXFormModule }, { kind: "component", type: i2$1.AXFormComponent, selector: "ax-form", inputs: ["labelMode", "messageStyle", "updateOn"], outputs: ["onValidate", "updateOnChange"] }, { kind: "ngmodule", type: AXImageModule }, { kind: "ngmodule", type: AXActionSheetModule }, { kind: "ngmodule", type: AXSwitchModule }, { kind: "ngmodule", type: AXDrawerModule }, { kind: "component", type: i11.AXDrawerContainerComponent, selector: "ax-drawer-container" }, { kind: "ngmodule", type: AXDialogModule }, { kind: "ngmodule", type: AXLoadingModule }, { kind: "ngmodule", type: AXTabsModule }, { kind: "component", type: i9.AXTabsComponent, selector: "ax-tabs", inputs: ["look", "location", "fitParent", "minWidth", "content"], outputs: ["onActiveTabChanged"] }, { kind: "component", type: i9.AXTabItemComponent, selector: "ax-tab-item", inputs: ["disabled", "text", "key", "headerTemplate", "active"], outputs: ["disabledChange", "onClick", "onBlur", "onFocus", "activeChange"] }, { kind: "ngmodule", type: AXPSchemaModule }, { kind: "component", type: i10.AXPWidgetRendererComponent, selector: "axp-widget-renderer", inputs: ["context", "prop", "mode", "schema"] }, { kind: "ngmodule", type: AXTooltipModule }, { kind: "ngmodule", type: AXBreadcrumbsModule }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "pipe", type: i8.AXTranslatorPipe, name: "translate" }, { kind: "ngmodule", type:
|
|
780
|
+
//
|
|
781
|
+
AXPCommonWidgetModule }, { kind: "directive", type: AXPStickyDirective, selector: "[axpSticky]", inputs: ["axpSticky", "stickyOffset", "stickyParent", "stickyTarget"], outputs: ["isStickyChange"], exportAs: ["axpSticky"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1165
782
|
}
|
|
1166
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type:
|
|
783
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPEntityDetailsViewComponent, decorators: [{
|
|
1167
784
|
type: Component,
|
|
1168
|
-
args: [{ encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [AXUnsubscriber], template: "<ax-drawer-container>\n <!-- <ax-drawer #drawer location=\"start\" [collapsed]=\"true\" [mode]=\"platform.is('SM') ? 'overlay' : 'push'\">\n <ax-content class=\"ax-w-64 ax-border-e\">\n <div class=\"ax-p-6 ax-py-4 ax-gap-6 ax-flex ax-flex-col\">\n <p class=\"ax-text-2xl ax-font-bold\">Folders</p>\n <ax-side-menu>\n <ng-container *ngFor=\"let node of menuItems\" [ngTemplateOutlet]=\"sideMenu\"\n [ngTemplateOutletContext]=\"{ $implicit: node }\">\n </ng-container>\n </ax-side-menu>\n <ng-template #sideMenu let-item>\n <ax-side-menu-item [text]=\"item.text\">\n <ax-prefix>\n <ax-icon class=\"fa-solid fa-folder ax-text-warning-500\"></ax-icon>\n </ax-prefix>\n <ng-container *ngIf=\"item.children\">\n <ng-container *ngFor=\"let child of item.children\" [ngTemplateOutlet]=\"sideMenu\"\n [ngTemplateOutletContext]=\"{ $implicit: child }\">\n </ng-container>\n </ng-container>\n </ax-side-menu-item>\n </ng-template>\n </div>\n </ax-content>\n </ax-drawer> -->\n <ax-content class=\"ax-flex ax-flex-col ax-overflow-hidden\">\n <div\n class=\"ax-flex ax-flex-col ax-gap-0 md:ax-gap-4 ax-px-4 ax-py-3 md:ax-py-4 md:ax-px-6 ax-bg-surface ax-border-b md:ax-border-0 md:ax-bg-default\"\n >\n @if(platform.is('MD')){\n <div class=\"ax-flex ax-justify-between ax-mb-4\">\n @if(this.grid?.selectedRows?.length==0){\n <div class=\"ax-text-xl ax-font-bold\">{{ title }}</div>\n <div class=\"ax-flex ax-items-center ax-gap-2\">\n @if(canCreate) {\n <ax-button color=\"primary\" class=\"ax-sm\" (onClick)=\"handleCreateClick()\">\n <ax-icon class=\"fa-solid fa-add\"></ax-icon>\n </ax-button>\n }\n <ax-button color=\"ghost\" class=\"ax-sm\" #more>\n <ax-icon class=\"fa-solid fa-ellipsis-vertical\"> </ax-icon>\n <ax-dropdown-panel [adaptivityEnabled]=\"true\">\n <ax-button-item-list>\n <ax-button-item text=\"Export\" class=\"ax-font-semibold\">\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-file-export\"> </ax-icon>\n </ax-prefix>\n </ax-button-item>\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n </div>\n }@else {\n <div class=\"ax-flex ax-items-center ax-gap-3\">\n <span class=\"ax-text-xl ax-font-bold\"> {{ this.grid?.selectedRows?.length }} Items Selected </span>\n <span (click)=\"clearSelectedItems()\" class=\"ax-text-sm ax-text-primary dark:ax-text-primary-300 ax-underline ax-cursor-pointer\"\n >Clear Items</span\n >\n </div>\n <div class=\"ax-flex ax-items-center ax-gap-2\">\n @if(canDelete) {\n <ax-button color=\"danger\" class=\"ax-sm\" (onClick)=\"handleCommandClick('delete')\">\n <ax-icon class=\"fa-solid fa-trash\"> </ax-icon>\n </ax-button>\n }\n <ax-button color=\"ghost\" class=\"ax-sm\" #more>\n <ax-icon class=\"fa-solid fa-ellipsis-vertical\"> </ax-icon>\n </ax-button>\n </div>\n }\n </div>\n\n <div class=\"ax-flex ax-items-center ax-justify-between\">\n <ax-button [disabled]=\"this.grid?.selectedRows?.length != 0\" [text]=\"(view$ | async)?.title\" color=\"ghost\">\n <ax-icon class=\"fa-solid fa-eye ax-text-neutral-400\"> </ax-icon>\n <ax-suffix>\n <i class=\"fa-solid fa-caret-down\"></i>\n </ax-suffix>\n <ax-dropdown-panel [adaptivityEnabled]=\"true\">\n <ax-button-item-list class=\"ax-bg-surface\">\n <ax-title class=\"ax-font-bold ax-opacity-100\">{{ 'entity.public-view' | translate | async }}</ax-title>\n <ax-button-item\n *ngFor=\"let v of publicViews$ | async\"\n [text]=\"v.title\"\n [class.ax-bg-on-surface]=\"(view$ | async) == v\"\n (onClick)=\"loader.setView(v.name)\"\n ></ax-button-item>\n <ax-title class=\"ax-font-bold ax-opacity-100\" *ngIf=\"hasCustomViews$ | async\">Created by me</ax-title>\n <ax-button-item\n *ngFor=\"let v of customViews$ | async\"\n [text]=\"v.title\"\n [class.ax-bg-on-surface]=\"(view$ | async) == v\"\n (onClick)=\"loader.setView(v.name)\"\n ></ax-button-item>\n <ng-container *feature=\"'axp-entity-list-custom-view'\">\n <ax-divider></ax-divider>\n <ax-button-item (onClick)=\"addCustomViewPopup()\" text=\"Add Custom View\" class=\"ax-font-semibold ax-text-primary\"></ax-button-item>\n </ng-container>\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n <div class=\"ax-flex ax-gap-2\">\n @if(searchBoxTitle){\n <ax-button (onClick)=\"toggleSearchBox()\" [disabled]=\"this.grid?.selectedRows?.length != 0\" color=\"ghost\">\n <ax-icon class=\"fa-solid fa-search ax-text-neutral-400\"> </ax-icon>\n </ax-button>\n }\n <ax-button [disabled]=\"this.grid?.selectedRows?.length != 0\" color=\"ghost\" (onClick)=\"columnsDrawer.open()\">\n <ax-icon class=\"fa-solid fa-bars ax-text-neutral-400\"> </ax-icon>\n </ax-button>\n <ax-button [disabled]=\"this.grid?.selectedRows?.length != 0\" color=\"ghost\" (onClick)=\"conditionsDrawer.open()\">\n <ax-icon class=\"fa-solid fa-sliders ax-text-neutral-400\"> </ax-icon>\n @if ((conditionsCount$ | async)) {\n <ax-suffix>\n <ax-badge [color]=\"'primary'\"></ax-badge>\n </ax-suffix>\n }\n </ax-button>\n <ax-button [disabled]=\"this.grid?.selectedRows?.length != 0\" color=\"ghost\" (onClick)=\"sortsDrawer.open()\">\n <ax-icon class=\"fa-solid fa-bars-sort ax-text-neutral-400\"> </ax-icon>\n @if ((sortCount$ | async)) {\n <ax-suffix>\n <ax-badge [color]=\"'primary'\"></ax-badge>\n </ax-suffix>\n }\n </ax-button>\n </div>\n </div>\n <div [class.collapsed-search-box]=\"searchBoxCollapsed\" class=\"ax-transition-all ax-mt-4\">\n <ax-search-box [title]=\"searchBoxTitle\" [placeholder]=\"('widget.lookup.search' | translate | async) + searchBoxPlaceholder\"\n ><ax-clear-button></ax-clear-button\n ></ax-search-box>\n </div>\n } @else {\n <div class=\"ax-flex ax-items-center ax-justify-between ax-gap-3\">\n <div class=\"ax-text-xl md:ax-text-3xl ax-font-bold ax-mb-2\">{{ title }}</div>\n @if(this.grid?.selectedRows?.length==0){\n <div class=\"ax-flex ax-gap-3\">\n @if(canCreate) {\n <ax-button [text]=\"'create-new' | translate | async\" color=\"primary\" (onClick)=\"handleCreateClick()\">\n <ax-prefix>\n <i class=\"fa-solid fa-add\"></i>\n </ax-prefix>\n </ax-button>\n }\n <ax-button [text]=\"'entity.actions' | translate | async\" color=\"ghost\">\n <ax-prefix>\n <i class=\"fa-solid fa-ellipsis-vertical\"></i>\n </ax-prefix>\n <ax-dropdown-panel [adaptivityEnabled]=\"true\">\n <ax-button-item-list>\n @if(canImport){\n <ax-button-item (onClick)=\"handleImportClick()\" text=\"Import\" class=\"ax-font-semibold\">\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-file-import\"> </ax-icon>\n </ax-prefix>\n </ax-button-item>\n }\n <ax-button-item text=\"Export\" class=\"ax-font-semibold\">\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-file-export\"> </ax-icon>\n </ax-prefix>\n </ax-button-item>\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n </div>\n }@else {\n <div class=\"ax-flex ax-gap-3\">\n @if(canDelete) {\n <ax-button text=\"Delete Items\" color=\"danger\" (onClick)=\"handleCommandClick('delete')\">\n <ax-prefix>\n <i class=\"fa-solid fa-trash\"></i>\n </ax-prefix>\n </ax-button>\n }\n <ax-button [text]=\"'entity.actions' | translate | async\" color=\"ghost\">\n <ax-prefix>\n <i class=\"fa-solid fa-ellipsis-vertical\"></i>\n </ax-prefix>\n </ax-button>\n </div>\n }\n </div>\n <div class=\"ax-flex ax-items-center ax-justify-between\">\n <!----------------------- View Mode --------------------->\n @if(this.grid?.selectedRows?.length==0) {\n <div class=\"ax-flex ax-w-full ax-justify-between ax-gap-3\">\n <div class=\"ax-flex ax-gap-3\">\n <ax-button [text]=\"(view$ | async)?.title\" #views color=\"ghost\">\n <ax-prefix>\n <i class=\"fa-solid fa-eye\"></i>\n </ax-prefix>\n <ax-suffix>\n <i class=\"fa-solid fa-caret-down\"></i>\n </ax-suffix>\n <ax-dropdown-panel [adaptivityEnabled]=\"true\">\n <ax-button-item-list class=\"ax-bg-surface\">\n <ax-title class=\"ax-font-bold ax-opacity-100\">{{ 'entity.public-view' | translate | async }}</ax-title>\n <ax-button-item\n *ngFor=\"let v of publicViews$ | async\"\n [text]=\"v.title\"\n [class.ax-bg-on-surface]=\"(view$ | async) == v\"\n (onClick)=\"loader.setView(v.name)\"\n ></ax-button-item>\n <ax-title class=\"ax-font-bold ax-opacity-100\" *ngIf=\"hasCustomViews$ | async\">Created by me</ax-title>\n <ax-button-item\n class=\"ax-pe-4 ax-flex ax-justify-between\"\n *ngFor=\"let v of customViews$ | async\"\n [text]=\"v.title\"\n [class.ax-bg-on-surface]=\"(view$ | async) == v\"\n (onClick)=\"loader.setView(v.name)\"\n >\n <ax-suffix>\n <ax-button (onClick)=\"updateViewPopup($event, v)\" class=\"ax-xs\" look=\"none\">\n <ax-icon class=\"far fa-edit\"> </ax-icon>\n </ax-button>\n </ax-suffix>\n </ax-button-item>\n <ng-container *feature=\"'axp-entity-list-custom-view'\">\n <ax-divider></ax-divider>\n <ax-button-item text=\"Add Custom View\" (onClick)=\"addCustomViewPopup()\" class=\"ax-font-semibold ax-text-primary\"></ax-button-item>\n </ng-container>\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n @if(searchBoxTitle){\n <div class=\"ax-w-72\">\n <ax-search-box\n [title]=\"searchBoxTitle\"\n [(ngModel)]=\"searchValue\"\n (onValueChanged)=\"handleChangeSearchValue($event)\"\n [placeholder]=\"('widget.lookup.search' | translate | async) + searchBoxPlaceholder\"\n ><ax-clear-button></ax-clear-button\n ></ax-search-box>\n </div>\n }\n </div>\n\n <div class=\"ax-flex ax-gap-3\">\n <ax-button [text]=\"'entity.columns' | translate | async\" color=\"ghost\" #columns (onClick)=\"columnsDrawer.open()\">\n <ax-prefix>\n <i class=\"fa-solid fa-bars\"></i>\n </ax-prefix>\n <ax-suffix>\n <ax-badge text=\"{{ columnsCount$ | async }}\" color=\"primary\"></ax-badge>\n </ax-suffix>\n </ax-button>\n <ax-button text=\"Filters\" color=\"ghost\" (onClick)=\"conditionsDrawer.open()\" #conditions>\n <ax-prefix>\n <i class=\"fa-solid fa-sliders\"></i>\n </ax-prefix>\n <ax-suffix>\n <ax-badge text=\"{{ conditionsCount$ | async }}\" color=\"primary\"></ax-badge>\n </ax-suffix>\n </ax-button>\n <ax-button [text]=\"'entity.sort' | translate | async\" color=\"ghost\" (onClick)=\"sortsDrawer.open()\">\n <ax-prefix>\n <i class=\"fa-solid fa-bars-sort\"></i>\n </ax-prefix>\n <ax-suffix *ngIf=\"(sortCount$ | async)! > 0\">\n <ax-badge text=\"{{ sortCount$ | async }}\" color=\"primary\"></ax-badge>\n </ax-suffix>\n </ax-button>\n </div>\n </div>\n\n } @else{\n <!----------------------- Selection Mode --------------------->\n <div>\n <div class=\"ax-flex ax-gap-3 ax-items-center ax-h-10\">\n <span class=\"ax-text-xl ax-font-bold\"> {{ this.grid?.selectedRows?.length }} Items Selected </span>\n <span (click)=\"clearSelectedItems()\" class=\"ax-text-sm ax-text-primary dark:ax-text-primary-300 ax-underline ax-cursor-pointer\"\n >Clear Items</span\n >\n </div>\n </div>\n }\n </div>\n }\n </div>\n <div class=\"ax-flex-1 ax-px-6 ax-py-4 ax-flex ax-overflow-auto\">\n <ax-data-table\n #grid\n [showFooter]=\"false\"\n class=\"ax-flex-1\"\n [dataSource]=\"dataSource\"\n [paging]=\"true\"\n [fetchDataMode]=\"'manual'\"\n (onRowDbClick)=\"handleRowDbClick($event)\"\n [loading]=\"{ enabled: true, animation: true }\"\n >\n <!-- <ax-index-column *ngIf=\"!platform.is('SM')\" [width]=\"'85px'\"></ax-index-column> -->\n <ax-select-column fixed=\"start\" [width]=\"'50px'\"></ax-select-column>\n @for(col of (columns$ | async);track col.name) {\n <axp-widget-column-renderer\n *ngIf=\"col.visible\"\n [schema]=\"col.schema\"\n [dataField]=\"col.name\"\n [caption]=\"col.title\"\n [options]=\"col.options\"\n [displayFormat]=\"col.displayFormat\"\n [width]=\"'180px'\"\n [allowSorting]=\"false\"\n >\n </axp-widget-column-renderer>\n }\n <ax-dropdown-command-column\n fixed=\"end\"\n [width]=\"'60px'\"\n [items]=\"getDropdownRowItems\"\n (onItemClick)=\"handleRowCommandClick($event)\"\n ></ax-dropdown-command-column>\n <ax-command-column fixed=\"end\" [width]=\"'60px'\" [items]=\"getInlineRowItems\" (onItemClick)=\"handleRowCommandClick($event)\"></ax-command-column>\n </ax-data-table>\n </div>\n </ax-content>\n <ax-drawer (collapsedChange)=\"closeDrawer('columns', $event)\" #columnsDrawer location=\"end\" [mode]=\"'overlay'\">\n <ax-content class=\"ax-w-[85vw] md:ax-w-[45vw] lg:ax-w-[35vw] 2xl:ax-w-[20vw] ax-border-e\">\n <axp-list-view-option-columns [loader]=\"loader\" (onClosed)=\"columnsDrawer.close()\"></axp-list-view-option-columns>\n </ax-content>\n </ax-drawer>\n <ax-drawer (collapsedChange)=\"closeDrawer('conditions', $event)\" #conditionsDrawer location=\"end\" [mode]=\"'overlay'\">\n <ax-content class=\"ax-w-[85vw] md:ax-w-[45vw] lg:ax-w-[35vw] 2xl:ax-w-[25vw] ax-border-e\">\n <axp-list-view-option-conditions [loader]=\"loader\" (onClosed)=\"conditionsDrawer.close()\"></axp-list-view-option-conditions>\n </ax-content>\n </ax-drawer>\n <ax-drawer (collapsedChange)=\"closeDrawer('sorts', $event)\" #sortsDrawer location=\"end\" [mode]=\"'overlay'\">\n <ax-content class=\"ax-w-[85vw] md:ax-w-[45vw] lg:ax-w-[35vw] 2xl:ax-w-[20vw] ax-border-e\">\n <axp-list-view-option-sorting (onClosed)=\"sortsDrawer.close()\" [loader]=\"loader\"></axp-list-view-option-sorting>\n </ax-content>\n </ax-drawer>\n</ax-drawer-container>\n", styles: [".cdk-drag-preview{border-radius:.375rem;border-width:1px;--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px 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:rgba(var(--ax-color-on-surface));padding:.5rem;height:max-content!important}.collapsed-search-box{margin-top:0;height:0px;opacity:0}\n"] }]
|
|
1169
|
-
}], ctorParameters: () => [{ type: i1$2.AXActionSheetService }, { type: i2.AXUnsubscriber }, { type: i3.AXPlatform }, { type: i0.ChangeDetectorRef }], propDecorators: { viewsTemplate: [{
|
|
1170
|
-
type: ViewChild,
|
|
1171
|
-
args: ['viewsTemplate']
|
|
1172
|
-
}], grid: [{
|
|
1173
|
-
type: ViewChild,
|
|
1174
|
-
args: ['grid']
|
|
1175
|
-
}], entityViewDrawer: [{
|
|
1176
|
-
type: ViewChild,
|
|
1177
|
-
args: ['entityViewDrawer']
|
|
1178
|
-
}] } });
|
|
1179
|
-
|
|
1180
|
-
class AXPListViewModule {
|
|
1181
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPListViewModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1182
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.0", ngImport: i0, type: AXPListViewModule, declarations: [AXPEntityListViewComponent,
|
|
1183
|
-
AXPEntityCreateCustomViewComponent,
|
|
1184
|
-
AXPListViewOptionsColumnsComponent,
|
|
1185
|
-
AXPListViewOptionConditionsComponent,
|
|
1186
|
-
AXPListViewOptionFilterOperatorComponent,
|
|
1187
|
-
AXPListViewOptionSortingComponent], imports: [CommonModule,
|
|
1188
|
-
FormsModule,
|
|
1189
|
-
AXCommonModule,
|
|
1190
|
-
AXDataTableModule,
|
|
1191
|
-
AXButtonModule,
|
|
1192
|
-
AXDecoratorModule,
|
|
1193
|
-
AXBadgeModule,
|
|
1194
|
-
AXDropdownModule,
|
|
1195
|
-
AXPopoverModule,
|
|
1196
|
-
AXImageModule,
|
|
1197
|
-
AXSwitchModule,
|
|
1198
|
-
AXDrawerModule,
|
|
1199
|
-
AXLoadingModule,
|
|
1200
|
-
AXTabsModule,
|
|
1201
|
-
AXSelectBoxModule,
|
|
1202
|
-
AXFormModule,
|
|
1203
|
-
AXListModule,
|
|
1204
|
-
AXTextBoxModule,
|
|
1205
|
-
AXSearchBoxModule,
|
|
1206
|
-
AXLabelModule,
|
|
1207
|
-
AXCollapseModule,
|
|
1208
|
-
AXActionSheetModule,
|
|
1209
|
-
AXSelectionListModule,
|
|
1210
|
-
AXImageModule,
|
|
1211
|
-
AXDialogModule,
|
|
1212
|
-
AXDropdownButtonModule,
|
|
1213
|
-
//
|
|
1214
|
-
CdkDropList,
|
|
1215
|
-
CdkDrag,
|
|
1216
|
-
CdkDragPlaceholder,
|
|
1217
|
-
CdkDragHandle,
|
|
1218
|
-
PortalModule,
|
|
1219
|
-
AXPSchemaModule,
|
|
1220
|
-
AXPCommonWidgetModule,
|
|
1221
|
-
AXPAuthModule,
|
|
1222
|
-
AXTranslationModule] }); }
|
|
1223
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPListViewModule, imports: [CommonModule,
|
|
1224
|
-
FormsModule,
|
|
1225
|
-
AXCommonModule,
|
|
1226
|
-
AXDataTableModule,
|
|
1227
|
-
AXButtonModule,
|
|
1228
|
-
AXDecoratorModule,
|
|
1229
|
-
AXBadgeModule,
|
|
1230
|
-
AXDropdownModule,
|
|
1231
|
-
AXPopoverModule,
|
|
1232
|
-
AXImageModule,
|
|
1233
|
-
AXSwitchModule,
|
|
1234
|
-
AXDrawerModule,
|
|
1235
|
-
AXLoadingModule,
|
|
1236
|
-
AXTabsModule,
|
|
1237
|
-
AXSelectBoxModule,
|
|
1238
|
-
AXFormModule,
|
|
1239
|
-
AXListModule,
|
|
1240
|
-
AXTextBoxModule,
|
|
1241
|
-
AXSearchBoxModule,
|
|
1242
|
-
AXLabelModule,
|
|
1243
|
-
AXCollapseModule,
|
|
1244
|
-
AXActionSheetModule,
|
|
1245
|
-
AXSelectionListModule,
|
|
1246
|
-
AXImageModule,
|
|
1247
|
-
AXDialogModule,
|
|
1248
|
-
AXDropdownButtonModule,
|
|
1249
|
-
PortalModule,
|
|
1250
|
-
AXPSchemaModule,
|
|
1251
|
-
AXPCommonWidgetModule,
|
|
1252
|
-
AXPAuthModule,
|
|
1253
|
-
AXTranslationModule] }); }
|
|
1254
|
-
}
|
|
1255
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPListViewModule, decorators: [{
|
|
1256
|
-
type: NgModule,
|
|
1257
|
-
args: [{
|
|
1258
|
-
imports: [
|
|
785
|
+
args: [{ imports: [
|
|
1259
786
|
CommonModule,
|
|
1260
|
-
|
|
1261
|
-
AXCommonModule,
|
|
1262
|
-
AXDataTableModule,
|
|
787
|
+
RouterModule,
|
|
1263
788
|
AXButtonModule,
|
|
1264
789
|
AXDecoratorModule,
|
|
1265
790
|
AXBadgeModule,
|
|
1266
791
|
AXDropdownModule,
|
|
1267
792
|
AXPopoverModule,
|
|
793
|
+
AXFormModule,
|
|
1268
794
|
AXImageModule,
|
|
795
|
+
AXActionSheetModule,
|
|
1269
796
|
AXSwitchModule,
|
|
1270
797
|
AXDrawerModule,
|
|
798
|
+
AXDialogModule,
|
|
1271
799
|
AXLoadingModule,
|
|
1272
800
|
AXTabsModule,
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
AXTextBoxModule,
|
|
1277
|
-
AXSearchBoxModule,
|
|
1278
|
-
AXLabelModule,
|
|
1279
|
-
AXCollapseModule,
|
|
1280
|
-
AXActionSheetModule,
|
|
1281
|
-
AXSelectionListModule,
|
|
1282
|
-
AXImageModule,
|
|
1283
|
-
AXDialogModule,
|
|
1284
|
-
AXDropdownButtonModule,
|
|
1285
|
-
//
|
|
1286
|
-
CdkDropList,
|
|
1287
|
-
CdkDrag,
|
|
1288
|
-
CdkDragPlaceholder,
|
|
1289
|
-
CdkDragHandle,
|
|
1290
|
-
PortalModule,
|
|
801
|
+
AXBadgeModule,
|
|
802
|
+
AXButtonModule,
|
|
803
|
+
AXSwitchModule,
|
|
1291
804
|
AXPSchemaModule,
|
|
1292
|
-
|
|
1293
|
-
|
|
805
|
+
AXTooltipModule,
|
|
806
|
+
AXBreadcrumbsModule,
|
|
1294
807
|
AXTranslationModule,
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
],
|
|
1304
|
-
providers: [],
|
|
1305
|
-
}]
|
|
1306
|
-
}] });
|
|
808
|
+
//
|
|
809
|
+
AXPCommonWidgetModule,
|
|
810
|
+
AXPStickyDirective,
|
|
811
|
+
], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, providers: [AXUnsubscriber], template: "<ax-drawer-container>\n <!-- <ax-drawer #drawer location=\"start\" [collapsed]=\"!(isOpen | async)\" [mode]=\" (isSM | async) ? 'overlay' : 'push'\"\n *ngIf=\"loader.hasSections$ | async\" (collapsedChange)=\"handleCollapsedChange($event)\">\n <ax-content class=\"ax-border-e ax-p-6 ax-w-64\">\n <p class=\"ax-text-xl ax-font-bold ax-mb-6\">{{loader.sectionTitle}}</p>\n <ax-tabs look=\"with-line\" location=\"start\">\n @for(tab of (loader.sections$ | async); track tab.name)\n {\n <ax-tab-item [text]=\"tab.title\" [active]=\"isActive(tab)\" (onClick)=\"handleMenuClick($event,tab)\"\n [disabled]=\"editForm.context\">\n </ax-tab-item>\n }\n </ax-tabs>\n </ax-content>\n </ax-drawer> -->\n <ax-content #content class=\"ax-overflow-x-hidden\">\n <div class=\"ax-flex ax-flex-col ax-gap-4 ax-min-h-full ax-px-4 ax-pb-4 md:ax-px-6 ax-bg-surface ax-border-b md:ax-border-0 md:ax-bg-default\">\n <div\n class=\"ax-flex ax-flex-col ax-pt-4 ax-sticky ax-top-0 ax-z-10 ax-transition-all\"\n #sticky=\"axpSticky\"\n [axpSticky]=\"'ax-bg-surface ax-px-6 ax-py-3 -ax-mx-6 ax-shadow-xl'\"\n [stickyParent]=\"content.getHostElement()\"\n >\n <!-------- Begin Toolbar -------->\n <div class=\"ax-flex ax-justify-between ax-items-center\">\n <!-------- Begin Title -------->\n <div class=\"ax-flex ax-gap-1 ax-items-center\">\n <!-- <ax-button class=\"lg:ax-hidden\">\n <ax-icon class=\"fa-solid fa-chevron-left\"></ax-icon>\n </ax-button> -->\n <div class=\"ax-flex ax-flex-col ax-gap-2\">\n <div class=\"ax-text-xl md:ax-text-3xl ax-font-bold\">{{ loader.title }}</div>\n <!-- <ax-breadcrumbs class=\"child:ax-font-normal child:ax-text-neutral-400\">\n <ng-template #divider>\n <i class=\"fa-solid fa-chevron-right ax-text-xs ax-mx-2\"></i>\n </ng-template>\n <ax-breadcrumbs-item>\n <a>Home</a>\n </ax-breadcrumbs-item>\n <ax-breadcrumbs-item>\n <a>{{ loader.entity.title }}</a>\n </ax-breadcrumbs-item>\n <ax-breadcrumbs-item [active]=\"true\" class=\"!ax-font-semibold !ax-text-neutral-600\">\n {{ loader.title }}\n </ax-breadcrumbs-item>\n </ax-breadcrumbs> -->\n </div>\n </div>\n <!-------- Finish Title -------->\n <!--------------------------------------------------------------->\n <!-- Begin Action Menu -->\n <div class=\"ax-flex ax-items-center ax-gap-3\">\n @if(canCreate || canUpdate) {\n <ax-button [text]=\"(isSM | async) ? null : 'Actions'\" color=\"ghost\">\n <ax-prefix>\n <i class=\"fa-solid fa-ellipsis-vertical\"></i>\n </ax-prefix>\n <ax-dropdown-panel>\n <ax-button-item-list>\n <!-- <ax-button-item text=\"Share\" class=\"ax-font-semibold\">\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-share\"> </ax-icon>\n </ax-prefix>\n </ax-button-item> \n <ax-divider></ax-divider>-->\n @if(canCreate) {\n <ax-button-item\n [text]=\"('create-new' | translate | async) ?? ' '\"\n class=\"ax-font-semibold ax-text-primary\"\n (onClick)=\"handleCommandClick('create')\"\n >\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-add\"> </ax-icon>\n </ax-prefix>\n </ax-button-item>\n } @if(canDelete) {\n <ax-button-item text=\"Delete\" class=\"ax-font-semibold ax-text-danger\" (onClick)=\"handleCommandClick('delete')\">\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-trash\"> </ax-icon>\n </ax-prefix>\n </ax-button-item>\n }\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n }\n </div>\n <!-- Finish Action Menu -->\n </div>\n <!----- Finish Toolbar ----->\n <!--------------------------------------------------------------->\n <!-- Begin Section Tab Items -->\n @if((loader.hasSections$| async)) {\n <ax-tabs look=\"with-line\" location=\"bottom\" class=\"ax-mt-2\">\n @for(tab of (loader.sections$ | async); track tab.name) {\n <ax-tab-item [text]=\"tab.title\" [active]=\"isActive(tab)\" (onClick)=\"handleMenuClick($event, tab)\" class=\"first:!ax-ms-0\"> </ax-tab-item>\n }\n </ax-tabs>\n }\n <!-- Finish Section Tab Items -->\n </div>\n @for(section of (loader.section$ | async)?.sections; track section.name) {\n <ax-form #form>\n <div class=\"ax-card ax-shadow-md\">\n <div class=\"ax-card-header\">\n <p>{{ section.title }}</p>\n @if(canUpdate) {\n <ax-button text=\"{{ 'entity.modify' | translate | async }}\" class=\"ax-sm\" color=\"primary\" (onClick)=\"handleSectionEdit(section)\">\n <ax-icon class=\"fa-solid fa-pen\"> </ax-icon>\n </ax-button>\n }\n </div>\n <div class=\"ax-card-body ax-divide-y ax-divide-gray-100 dark:ax-divide-gray-700 !ax-gap-0\">\n <ng-container *ngFor=\"let name of section.properties\">\n <ng-container *ngIf=\"loader.getProp(name) as prop\">\n <div class=\"ax-grid md:ax-grid-cols-12 ax-gap-2 ax-py-4 first:ax-pt-0 last:ax-pb-0\">\n @if(section.options?.showPropTitle!=false){\n <div class=\"ax-col-span-12 md:ax-col-span-3 lg:ax-col-span-2 ax-flex ax-items-center md:ax-items-start ax-justify-between\">\n <div class=\"ax-flex ax-flex-col ax-items-start\">\n <span class=\"ax-font-semibold\">{{ prop.title }}</span>\n <!-- @if(prop.description) {\n <i\n class=\"fa-solid fa-circle-info fa-sm ax-text-neutral-500 dark:ax-text-neutral-400 ax-cursor-pointer\"\n [axTooltip]=\"prop.description\"\n [axTooltipPlacement]=\"'end'\"\n ></i>\n } -->\n @if(prop.description) {\n <span class=\"ax-text-neutral-500 ax-text-xs\">{{ prop.description }}</span>\n }\n </div>\n </div>\n }\n <div [class]=\"section.options?.showPropTitle == false ? 'ax-col-span-12' : 'ax-col-span-12 md:ax-col-span-9 lg:ax-col-span-10'\">\n <axp-widget-renderer [schema]=\"prop.schema\" [context]=\"context()\" [prop]=\"prop\" [mode]=\"'view'\"></axp-widget-renderer>\n </div>\n </div>\n </ng-container>\n </ng-container>\n </div>\n </div>\n </ax-form>\n }\n </div>\n </ax-content>\n</ax-drawer-container>\n" }]
|
|
812
|
+
}], ctorParameters: () => [{ type: i1.Actions }, { type: i2.AXUnsubscriber }], propDecorators: { drawer: [{
|
|
813
|
+
type: ViewChild,
|
|
814
|
+
args: ['drawer']
|
|
815
|
+
}] } });
|
|
1307
816
|
|
|
1308
|
-
class
|
|
1309
|
-
constructor(config,
|
|
817
|
+
class AXPEntityDetailLoaderDefault {
|
|
818
|
+
constructor(config, store, entityData, formatService) {
|
|
1310
819
|
this.config = config;
|
|
1311
|
-
this.
|
|
1312
|
-
this.
|
|
1313
|
-
this.
|
|
1314
|
-
this.
|
|
820
|
+
this.store = store;
|
|
821
|
+
this.entityData = entityData;
|
|
822
|
+
this.formatService = formatService;
|
|
823
|
+
this._currentSection = 'default';
|
|
824
|
+
this._sections$ = new BehaviorSubject(this.sections);
|
|
825
|
+
//****************** Properties ******************//
|
|
1315
826
|
this.getProp = (name) => this.entity.properties.find((c) => c.name == name);
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
827
|
+
}
|
|
828
|
+
get entity() {
|
|
829
|
+
if (!this._config) {
|
|
830
|
+
this._config = cloneDeep(this.config);
|
|
831
|
+
}
|
|
832
|
+
return this._config;
|
|
833
|
+
}
|
|
834
|
+
get data() {
|
|
835
|
+
return this.entityData;
|
|
836
|
+
}
|
|
837
|
+
get view() {
|
|
838
|
+
return (this.entity.views.detailView ?? this.entity.views.quickView);
|
|
839
|
+
}
|
|
840
|
+
//****************** Titles ******************//
|
|
841
|
+
get title() {
|
|
842
|
+
const suggestedProps = this.entity.properties.find((c) => ['title', 'name', 'code'].includes(c.name));
|
|
843
|
+
let suggestedFormat = 'Item #{{id}}';
|
|
844
|
+
if (suggestedProps)
|
|
845
|
+
suggestedFormat = `{{${suggestedProps.name}}}`;
|
|
846
|
+
const title = this.formatService.format(this.entity.formats?.header ?? this.entity.formats?.default ?? suggestedFormat, 'string', this.data);
|
|
847
|
+
return title;
|
|
848
|
+
}
|
|
849
|
+
get sectionTitle() {
|
|
850
|
+
return `${this.entity.title}`;
|
|
851
|
+
}
|
|
852
|
+
//****************** Sections ******************//
|
|
853
|
+
get sections() {
|
|
854
|
+
return this.view.root.sections?.length
|
|
855
|
+
? this.view.root.sections
|
|
856
|
+
: [
|
|
857
|
+
{
|
|
858
|
+
name: 'default',
|
|
859
|
+
title: 'Default',
|
|
860
|
+
properties: this.view.root.properties,
|
|
861
|
+
},
|
|
862
|
+
];
|
|
863
|
+
}
|
|
864
|
+
get sections$() {
|
|
865
|
+
return this._sections$.pipe(defaultIfEmpty([]));
|
|
866
|
+
}
|
|
867
|
+
get section$() {
|
|
868
|
+
return this.sections$.pipe(switchMap((sections) => {
|
|
869
|
+
const section = sections.find((c) => c.name === this._currentSection) ?? this.sections[0];
|
|
870
|
+
if (!section.sections?.length) {
|
|
871
|
+
section.sections = [
|
|
872
|
+
{
|
|
873
|
+
name: 'default',
|
|
874
|
+
title: 'Details',
|
|
875
|
+
properties: section.properties,
|
|
876
|
+
},
|
|
877
|
+
];
|
|
878
|
+
}
|
|
879
|
+
return of(section);
|
|
880
|
+
}));
|
|
881
|
+
}
|
|
882
|
+
get hasSections$() {
|
|
883
|
+
return this.sections$.pipe(map((c) => c.length > 1));
|
|
884
|
+
}
|
|
885
|
+
setSection(name) {
|
|
886
|
+
this._currentSection = name ?? 'default';
|
|
887
|
+
const updatedSection = this.sections.find((c) => c.name === this._currentSection) || {
|
|
888
|
+
name: 'default',
|
|
889
|
+
title: 'Default',
|
|
890
|
+
properties: this.view.root.properties,
|
|
891
|
+
};
|
|
892
|
+
const currentSections = this._sections$.value;
|
|
893
|
+
const updatedSections = currentSections.map((section) => {
|
|
894
|
+
if (section.name === updatedSection.name) {
|
|
895
|
+
return updatedSection;
|
|
896
|
+
}
|
|
897
|
+
else {
|
|
898
|
+
return section;
|
|
899
|
+
}
|
|
1331
900
|
});
|
|
901
|
+
this._sections$.next(updatedSections);
|
|
1332
902
|
}
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
903
|
+
//****************** Update ******************//
|
|
904
|
+
async update(values) {
|
|
905
|
+
assign(this.data, values);
|
|
906
|
+
this.setSection(this._currentSection);
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
class AXPEntityDetailViewLoaderFactory {
|
|
910
|
+
constructor() {
|
|
911
|
+
this.entityService = inject(AXPEntityRegistryService);
|
|
912
|
+
this.formatService = inject(AXFormatService);
|
|
913
|
+
this.layout = inject(AXPLayoutService);
|
|
914
|
+
this.store = inject(Store);
|
|
915
|
+
}
|
|
916
|
+
async create(moduleName, entityName, id) {
|
|
917
|
+
const config = await this.entityService.resolve(moduleName, entityName);
|
|
918
|
+
this.layout.setNavigationLoading(true);
|
|
919
|
+
if (config.dataSource.byKey) {
|
|
920
|
+
const data = await config.dataSource.byKey(id);
|
|
921
|
+
this.layout.setNavigationLoading(false);
|
|
922
|
+
return new AXPEntityDetailLoaderDefault(config, this.store, data, this.formatService);
|
|
1336
923
|
}
|
|
1337
|
-
|
|
924
|
+
this.layout.setNavigationLoading(false);
|
|
925
|
+
return Promise.reject('cannot fetch ');
|
|
1338
926
|
}
|
|
1339
|
-
|
|
1340
|
-
|
|
927
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPEntityDetailViewLoaderFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
928
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPEntityDetailViewLoaderFactory, providedIn: 'root' }); }
|
|
929
|
+
}
|
|
930
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPEntityDetailViewLoaderFactory, decorators: [{
|
|
931
|
+
type: Injectable,
|
|
932
|
+
args: [{ providedIn: 'root' }]
|
|
933
|
+
}] });
|
|
934
|
+
|
|
935
|
+
class AXPEntityCreateCustomViewComponent extends AXBasePageComponent {
|
|
936
|
+
constructor() {
|
|
937
|
+
super(...arguments);
|
|
938
|
+
this.schemaRegistry = inject(AXPSchemaRegistryService);
|
|
939
|
+
this.toastService = inject(AXToastService);
|
|
940
|
+
this.dialogService = inject(AXDialogService);
|
|
941
|
+
this.subscriber = inject(AXUnsubscriber);
|
|
942
|
+
this.mode = 'create';
|
|
943
|
+
this.selectedView = {};
|
|
944
|
+
this.showNameInput = signal(false);
|
|
945
|
+
this.props = signal([]);
|
|
946
|
+
this.columns = signal([]);
|
|
947
|
+
this.visibleColumns = computed(() => this.columns().filter((c) => c.visible));
|
|
948
|
+
this.conditions = signal([]);
|
|
949
|
+
this.sorts = signal([]);
|
|
950
|
+
this.selectedConditionNames = [];
|
|
951
|
+
this.viewNames = [];
|
|
1341
952
|
}
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
953
|
+
ngOnInit() {
|
|
954
|
+
this.props.set(cloneDeep(this.loader.entity.properties));
|
|
955
|
+
this.columns.set(cloneDeep(this.selectedView.columns));
|
|
956
|
+
this.conditions.set(cloneDeep(this.selectedView.conditions));
|
|
957
|
+
this.sorts.set(cloneDeep(this.selectedView.sorts));
|
|
958
|
+
this.loader.views$.pipe(this.subscriber.takeUntilDestroy).subscribe((views) => {
|
|
959
|
+
this.viewNames = views.map((v) => v.name);
|
|
960
|
+
});
|
|
1345
961
|
}
|
|
1346
|
-
|
|
1347
|
-
|
|
962
|
+
//****************** Columns ******************//
|
|
963
|
+
updateColumnItem(event, colName) {
|
|
964
|
+
if (event.isUserInteraction) {
|
|
965
|
+
this.columns.update((prevCols) => prevCols.map((col) => (col.name === colName ? { ...col, visible: event.value } : col)));
|
|
966
|
+
}
|
|
1348
967
|
}
|
|
1349
|
-
|
|
1350
|
-
|
|
968
|
+
//****************** Sorts ******************//
|
|
969
|
+
updateSortItem(item) {
|
|
970
|
+
this.sorts.update((prevSorts) => prevSorts.map((sort) => (sort.name === item.name ? { ...sort, dir: sort.dir == 'asc' ? 'desc' : 'asc' } : sort)));
|
|
1351
971
|
}
|
|
1352
|
-
|
|
1353
|
-
|
|
972
|
+
addSortItem() {
|
|
973
|
+
const sortNames = this.sorts().map((p) => p.name);
|
|
974
|
+
console.log(this.props(), sortNames);
|
|
975
|
+
const name = this.props().find((c) => !sortNames.includes(c.name))?.name || this.props()[0].name;
|
|
976
|
+
this.sorts.update((prevSorts) => [...prevSorts, { name, dir: 'asc' }]);
|
|
1354
977
|
}
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
const view = views.find((c) => c.name === this._currentView);
|
|
1358
|
-
if (view) {
|
|
1359
|
-
return of(view);
|
|
1360
|
-
}
|
|
1361
|
-
else if (this.views.length > 0) {
|
|
1362
|
-
return of(this.views[0]);
|
|
1363
|
-
}
|
|
1364
|
-
else {
|
|
1365
|
-
return of(AXPEntityListViewConfigEmpty);
|
|
1366
|
-
}
|
|
1367
|
-
}));
|
|
978
|
+
removeSortItem(item) {
|
|
979
|
+
this.sorts.update((prevSorts) => prevSorts.filter((sort) => item.name != sort.name));
|
|
1368
980
|
}
|
|
1369
|
-
|
|
1370
|
-
|
|
981
|
+
//****************** Conditions ******************//
|
|
982
|
+
getSchema(name) {
|
|
983
|
+
return this.props().find((c) => c.name == name)?.schema ?? '';
|
|
1371
984
|
}
|
|
1372
|
-
|
|
1373
|
-
|
|
985
|
+
getOperators(name) {
|
|
986
|
+
const schemaName = this.props().find((c) => c.name == name)?.schema ?? '';
|
|
987
|
+
return this.schemaRegistry.resolve(schemaName)?.filterOptions?.operators ?? [];
|
|
1374
988
|
}
|
|
1375
|
-
|
|
1376
|
-
|
|
989
|
+
getDefaultOperator(name) {
|
|
990
|
+
const schemaName = this.props().find((c) => c.name == name)?.schema ?? '';
|
|
991
|
+
return this.schemaRegistry.resolve(schemaName)?.filterOptions?.default ?? EQ_OPER;
|
|
1377
992
|
}
|
|
1378
|
-
|
|
1379
|
-
this.
|
|
993
|
+
getOperatorTitle(schemaName, oprName) {
|
|
994
|
+
return this.getOperators(schemaName).find((c) => c.name == oprName)?.title || '';
|
|
1380
995
|
}
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
return updatedView;
|
|
1392
|
-
}
|
|
1393
|
-
else {
|
|
1394
|
-
return view;
|
|
1395
|
-
}
|
|
1396
|
-
});
|
|
1397
|
-
this._currentConditions$.next(cloneDeep(updatedView.conditions.filter((c) => propNames.includes(c.name))));
|
|
1398
|
-
this._currentSorts$.next(cloneDeep(updatedView.sorts.filter((s) => propNames.includes(s.name))));
|
|
1399
|
-
// this._columns$.next(updatedView.columns);
|
|
1400
|
-
this._currentDisplayColumns$.next(cloneDeep(updatedView.columns.filter((c) => propNames.includes(c.name))));
|
|
1401
|
-
this._views$.next(updatedViews);
|
|
1402
|
-
//apply conditions and sorts:
|
|
1403
|
-
this.dataSource.filter({
|
|
1404
|
-
field: null,
|
|
1405
|
-
logic: 'and',
|
|
1406
|
-
operator: null,
|
|
1407
|
-
filters: updatedView.conditions.map((c) => ({
|
|
1408
|
-
field: c.name,
|
|
1409
|
-
value: c.value,
|
|
1410
|
-
operator: { type: c.operator },
|
|
1411
|
-
})),
|
|
996
|
+
resetSelectedFieldNames() {
|
|
997
|
+
this.selectedConditionNames = this.conditions().map((c) => c.name);
|
|
998
|
+
}
|
|
999
|
+
addCondition() {
|
|
1000
|
+
const conditions = this.selectedConditionNames.map((c) => {
|
|
1001
|
+
const opr = this.getDefaultOperator(c);
|
|
1002
|
+
return {
|
|
1003
|
+
name: c,
|
|
1004
|
+
operator: opr.name,
|
|
1005
|
+
};
|
|
1412
1006
|
});
|
|
1413
|
-
|
|
1414
|
-
field: s.name,
|
|
1415
|
-
dir: s.dir,
|
|
1416
|
-
}));
|
|
1417
|
-
this.dataSource.sort(...convertedSortItems);
|
|
1418
|
-
this.dataSource.refresh();
|
|
1007
|
+
this.conditions.set(conditions);
|
|
1419
1008
|
}
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
currentViews.push(newView);
|
|
1423
|
-
this._views$.next(currentViews);
|
|
1424
|
-
this.setView(newView.name);
|
|
1009
|
+
removeCondition(item) {
|
|
1010
|
+
this.conditions.update((prevConditions) => prevConditions.filter((con) => con.name != item.name));
|
|
1425
1011
|
}
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1012
|
+
//****************** Common ******************//
|
|
1013
|
+
drop(type, event) {
|
|
1014
|
+
switch (type) {
|
|
1015
|
+
case 'columns':
|
|
1016
|
+
this.columns.update((prevCols) => {
|
|
1017
|
+
const columns = prevCols;
|
|
1018
|
+
moveItemInArray(columns, event.previousIndex, event.currentIndex);
|
|
1019
|
+
return columns;
|
|
1020
|
+
});
|
|
1021
|
+
break;
|
|
1022
|
+
case 'sorts':
|
|
1023
|
+
this.sorts.update((prevSorts) => {
|
|
1024
|
+
const sorts = prevSorts;
|
|
1025
|
+
moveItemInArray(sorts, event.previousIndex, event.currentIndex);
|
|
1026
|
+
return sorts;
|
|
1027
|
+
});
|
|
1028
|
+
break;
|
|
1029
|
+
case 'conditions':
|
|
1030
|
+
this.conditions.update((prevConditions) => {
|
|
1031
|
+
const conditions = prevConditions;
|
|
1032
|
+
moveItemInArray(conditions, event.previousIndex, event.currentIndex);
|
|
1033
|
+
return conditions;
|
|
1034
|
+
});
|
|
1035
|
+
break;
|
|
1036
|
+
default:
|
|
1037
|
+
break;
|
|
1038
|
+
}
|
|
1430
1039
|
}
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
this._views$.next(currentViews);
|
|
1434
|
-
this.setView(this.views[0].name);
|
|
1040
|
+
changeViewNameToggle() {
|
|
1041
|
+
this.showNameInput.update((prev) => !prev);
|
|
1435
1042
|
}
|
|
1436
|
-
|
|
1437
|
-
return
|
|
1438
|
-
name: p.name,
|
|
1439
|
-
title: p.title,
|
|
1440
|
-
schema: p.schema,
|
|
1441
|
-
}));
|
|
1043
|
+
generateViewName(title) {
|
|
1044
|
+
return title.replace(/\s+/g, '-').toLowerCase();
|
|
1442
1045
|
}
|
|
1443
|
-
|
|
1444
|
-
|
|
1046
|
+
handleApplyClick() {
|
|
1047
|
+
const updatedView = {
|
|
1048
|
+
...this.selectedView,
|
|
1049
|
+
name: this.generateViewName(this.selectedView.title),
|
|
1050
|
+
conditions: this.conditions(),
|
|
1051
|
+
columns: this.columns(),
|
|
1052
|
+
sorts: this.sorts(),
|
|
1053
|
+
};
|
|
1054
|
+
if (this.viewNames.includes(updatedView.name) && this.mode == 'create') {
|
|
1055
|
+
this.toastService.show({
|
|
1056
|
+
title: 'Invalid Title',
|
|
1057
|
+
content: 'The title you have chosen already exists. Please choose a different title for your custom view.',
|
|
1058
|
+
color: 'danger',
|
|
1059
|
+
location: 'bottom-center',
|
|
1060
|
+
closeButton: true,
|
|
1061
|
+
timeOut: 3000,
|
|
1062
|
+
});
|
|
1063
|
+
}
|
|
1064
|
+
else {
|
|
1065
|
+
this.close({ save: true, updatedView });
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
handleResetClick() {
|
|
1069
|
+
this.conditions.set(cloneDeep(this.selectedView.conditions));
|
|
1070
|
+
this.columns.set(cloneDeep(this.selectedView.columns));
|
|
1071
|
+
this.sorts.set(cloneDeep(this.selectedView.sorts));
|
|
1445
1072
|
}
|
|
1446
|
-
|
|
1447
|
-
|
|
1073
|
+
handleDiscardClick() {
|
|
1074
|
+
this.close({ save: false });
|
|
1448
1075
|
}
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
return view.columns.filter((column) => column.visible).length;
|
|
1452
|
-
}));
|
|
1076
|
+
handleCancelClick() {
|
|
1077
|
+
this.close({ save: false });
|
|
1453
1078
|
}
|
|
1454
|
-
|
|
1455
|
-
this.
|
|
1456
|
-
|
|
1457
|
-
|
|
1079
|
+
handleDeleteClick() {
|
|
1080
|
+
this.dialogService
|
|
1081
|
+
.confirm('Warning', 'Are you sure want to delete this view?', 'danger', 'horizontal')
|
|
1082
|
+
.then((data) => {
|
|
1083
|
+
if (data.result) {
|
|
1084
|
+
this.close({ delete: true, viewName: this.selectedView.name });
|
|
1085
|
+
}
|
|
1458
1086
|
});
|
|
1459
1087
|
}
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1088
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPEntityCreateCustomViewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
1089
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AXPEntityCreateCustomViewComponent, selector: "ng-component", inputs: { loader: "loader", mode: "mode", selectedView: "selectedView" }, providers: [
|
|
1090
|
+
{
|
|
1091
|
+
provide: AXUnsubscriber,
|
|
1092
|
+
},
|
|
1093
|
+
], usesInheritance: true, ngImport: i0, template: "<ax-header class=\"ax-p-4 ax-flex ax-justify-between ax-border-b\">\n <div class=\"ax-flex ax-items-center\">\n @if (showNameInput() && mode==='create') {\n <div class=\"ax-w-60\">\n <ax-text-box class=\"ax-sm\" [(ngModel)]=\"selectedView.title\">\n @if(showNameInput()){\n <ax-suffix>\n <ax-button (onClick)=\"changeViewNameToggle()\" look=\"default\">\n <ax-icon class=\"fa-sodild fas fa-check ax-text-sm\"> </ax-icon>\n </ax-button>\n </ax-suffix>\n }\n </ax-text-box>\n </div>\n }@else {\n <span class=\"ax-text-lg ax-font-semibold\">{{ selectedView.title }}</span>\n } @if (mode===\"create\") {\n <ax-button class=\"ax-xs\" (onClick)=\"changeViewNameToggle()\" color=\"default\">\n @if(!showNameInput() ){\n <ax-icon class=\"fa-regular fa-pen ax-text-sm ax-text-neutral-600\"> </ax-icon>\n }\n </ax-button>\n }\n </div>\n <ax-close-button></ax-close-button>\n</ax-header>\n<div class=\"ax-p-4\">\n <ax-tabs [content]=\"contents\" look=\"with-line\">\n <ax-tab-item [text]=\"('entity.columns' | translate | async) ?? 'Columns'\">\n <ax-suffix>\n <ax-badge [text]=\"visibleColumns().length.toString()\" color=\"primary\"> </ax-badge>\n </ax-suffix>\n <ax-content>\n <div class=\"ax-flex ax-flex-col ax-gap-4 ax-p-4 ax-select-none ax-h-[400px]\" cdkDropList (cdkDropListDropped)=\"drop('columns', $event)\">\n <div class=\"ax-flex ax-flex-col ax-gap-3 ax-w-full ax-sorted-list ax-overflow-auto ax-pe-2\">\n <ng-container *ngFor=\"let item of columns()\">\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 }}</p>\n </div>\n <ax-switch class=\"ax-sm\" [(ngModel)]=\"item.visible\" (onValueChanged)=\"updateColumnItem($event, item.name)\"></ax-switch>\n </div>\n </ng-container>\n </div>\n </div>\n </ax-content>\n </ax-tab-item>\n <ax-tab-item text=\"Conditions\">\n <ax-suffix>\n <ax-badge [text]=\"conditions().length.toString()\" color=\"primary\"> </ax-badge>\n </ax-suffix>\n <ax-content>\n <div\n class=\"ax-flex ax-flex-col ax-justify-start ax-gap-4 ax-py-4 ax-select-none ax-h-[400px]\"\n [class.ax-justify-center]=\"!conditions().length\"\n >\n @if(!conditions().length){\n <div class=\"ax-flex ax-flex-col ax-items-center ax-justify-center\">\n <ax-image src=\"assets/documents.svg\"></ax-image>\n <p class=\"ax-mt-6 ax-mb-1 ax-font-bold\">No Filters Selected</p>\n <span class=\"ax-text-neutral-400 ax-text-sm md:ax-text-md\">Please select field(s) that you want to filter</span>\n </div>\n } @else {\n <div class=\"ax-sorted-list ax-px-4 ax-py-1 ax-overflow-auto\">\n <div cdkDropList (cdkDropListDropped)=\"drop('conditions', $event)\" class=\"ax-flex ax-flex-col ax-gap-2\">\n @for(item of conditions(); track item.name ){\n <div cdkDrag cdkDragBoundary=\".ax-sorted-list\">\n <div class=\"ax-ms-4 ax-flex ax-items-start ax-gap-2\">\n <ax-label>{{ loader.getProp(item.name)?.title }}</ax-label>\n @if(getOperatorTitle(item.name,item.operator)){\n <ax-badge class=\"ax-text-xs\" color=\"primary\" [look]=\"'twotone'\" [text]=\"getOperatorTitle(item.name, item.operator)\"></ax-badge>\n }\n </div>\n <div class=\"ax-flex ax-group ax-items-center ax-gap-2\">\n <ax-icon class=\"fa-solid fa-grip-dots-vertical ax-cursor-move\" cdkDragHandle></ax-icon>\n <div class=\"ax-w-full\">\n <axp-widget-filter-renderer\n [schema]=\"getSchema(item.name)\"\n [prop]=\"loader.getProp(item.name)\"\n [(value)]=\"item.value\"\n [(operator)]=\"item.operator\"\n >\n </axp-widget-filter-renderer>\n </div>\n <ax-button look=\"blank\" color=\"danger\" class=\"ax-sm\" (onClick)=\"removeCondition(item)\">\n <ax-icon class=\"fa-solid fa-trash-can\"></ax-icon>\n </ax-button>\n </div>\n </div>\n }\n </div>\n </div>\n }\n <div class=\"ax-flex ax-gap-2\">\n <div class=\"ax-w-full\" #addField>\n @if(conditions().length){\n <ax-button color=\"primary\" [text]=\"'entity.add-field' | translate | async\" look=\"blank\" class=\"ax-sm\"></ax-button>\n }@else {\n <div class=\"ax-flex ax-justify-center ax-w-full\">\n <ax-button color=\"primary\" [text]=\"'entity.add-field' | translate | async\" look=\"outline\" class=\"ax-md ax-w-56\"></ax-button>\n </div>\n }\n <ax-popover\n #conditionsPopover\n [target]=\"addField\"\n [placement]=\"conditions().length ? 'bottom-start' : 'bottom'\"\n [offsetY]=\"8\"\n [openOn]=\"'toggle'\"\n [closeOn]=\"'clickOut'\"\n [adaptivityEnabled]=\"true\"\n (onOpened)=\"resetSelectedFieldNames()\"\n >\n <div class=\"ax-bg-surface ax-border ax-border-default ax-rounded-md ax-shadow-md ax-w-full ax-min-w-[250px]\">\n <div class=\"ax-border-b-[1px] ax-pb-2 ax-mb-2 ax-p-3\">\n <ax-title class=\"ax-font-bold\">Fields</ax-title>\n </div>\n <div class=\"ax-max-h-48 ax-overflow-auto\">\n <ax-selection-list\n [valueField]=\"'name'\"\n [textField]=\"'title'\"\n [(ngModel)]=\"selectedConditionNames\"\n [direction]=\"'vertical'\"\n [items]=\"props()\"\n [multiple]=\"true\"\n ></ax-selection-list>\n </div>\n <div class=\"ax-flex ax-justify-end ax-border-t-[1px] ax-p-3\">\n <ax-button (onClick)=\"addCondition(); conditionsPopover.close()\" class=\"ax-sm\" text=\"Confirm\" color=\"primary\"> </ax-button>\n </div>\n </div>\n </ax-popover>\n </div>\n </div>\n </div>\n </ax-content>\n </ax-tab-item>\n <ax-tab-item text=\"Sorting\">\n <ax-suffix>\n <ax-badge [text]=\"sorts().length.toString()\" color=\"primary\"> </ax-badge>\n </ax-suffix>\n <ax-content>\n <div\n class=\"ax-flex ax-p-4 ax-flex-col ax-justify-start ax-gap-4 ax-select-none ax-overflow-auto ax-h-[400px]\"\n [class.ax-justify-center]=\"!sorts().length\"\n >\n @if(!sorts().length){\n <div class=\"ax-flex ax-flex-col ax-items-center ax-justify-center\">\n <ax-image src=\"assets/documents.svg\"></ax-image>\n <p class=\"ax-mt-6 ax-mb-1 ax-font-bold\">{{ 'entity.no-sort' | translate | async }}</p>\n <span class=\"ax-text-neutral-400 ax-text-sm md:ax-text-md\">{{ 'entity.ask-sort' | translate | async }}</span>\n </div>\n }@else {\n <div\n cdkDropList\n (cdkDropListDropped)=\"drop('sorts', $event)\"\n class=\"ax-flex ax-flex-col ax-gap-3 ax-w-full ax-sorted-list ax-py-1 ax-overflow-auto\"\n >\n <ng-container *ngFor=\"let item of sorts()\">\n <div class=\"ax-flex ax-gap-2 ax-items-center\" cdkDrag cdkDragBoundary=\".ax-sorted-list\">\n <ax-icon class=\"fa-solid fa-grip-dots-vertical ax-cursor-move\" cdkDragHandle></ax-icon>\n <ax-select-box [dataSource]=\"props()\" valueField=\"name\" textField=\"title\" [(ngModel)]=\"item.name\"> </ax-select-box>\n <ax-button [color]=\"'default'\" class=\"ax-sm\" (click)=\"updateSortItem(item)\">\n <ax-icon [class.ax-text-primary]=\"item.dir == 'asc'\" class=\"fa-solid fa-arrow-up-long ax-text-neutral-400\"></ax-icon>\n <ax-icon [class.ax-text-primary]=\"item.dir == 'desc'\" class=\"fa-solid fa-arrow-down-long ax-text-neutral-400\"></ax-icon>\n </ax-button>\n\n <ax-button look=\"blank\" (onClick)=\"removeSortItem(item)\">\n <ax-icon class=\"fa-solid fa-trash-can ax-text-danger-500\"></ax-icon>\n </ax-button>\n </div>\n </ng-container>\n </div>\n }\n\n <div class=\"ax-flex ax-gap-2\">\n <div class=\"ax-w-full\" #addField>\n @if(sorts().length){\n <ax-button\n (onClick)=\"addSortItem()\"\n color=\"primary\"\n [text]=\"'entity.add-field' | translate | async\"\n look=\"blank\"\n class=\"ax-sm\"\n ></ax-button>\n }@else {\n <div class=\"ax-flex ax-justify-center ax-w-full\">\n <ax-button\n (onClick)=\"addSortItem()\"\n color=\"primary\"\n [text]=\"'entity.add-field' | translate | async\"\n look=\"outline\"\n class=\"ax-md ax-w-56\"\n ></ax-button>\n </div>\n }\n </div>\n </div>\n </div>\n </ax-content>\n </ax-tab-item>\n </ax-tabs>\n <ng-template [axTabContent] #contents=\"axTabContent\"> </ng-template>\n</div>\n<ax-footer class=\"!ax-justify-end\">\n @if (mode===\"edit\") {\n <ax-dropdown-button [text]=\"'discard' | translate | async\" (onClick)=\"handleDiscardClick()\">\n <ax-button-item-list>\n <ax-button-item [text]=\"('reset' | translate | async) ?? ' '\" (onClick)=\"handleResetClick()\">\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-rotate-left fa-flip-horizontal\"></ax-icon>\n </ax-prefix>\n </ax-button-item>\n <ax-button-item class=\"ax-text-danger\" text=\"Delete\" (onClick)=\"handleDeleteClick()\">\n <ax-prefix> <ax-icon icon=\"fas fa-trash fa-flip-horizontal\"></ax-icon> </ax-prefix\n ></ax-button-item>\n </ax-button-item-list>\n </ax-dropdown-button>\n } @else {\n <ax-button [text]=\"'cancel' | translate | async\" look=\"outline\" (onClick)=\"handleCancelClick()\"></ax-button>\n }\n <ax-button [text]=\"mode === 'create' ? ('save' | translate | async) : ('save-changes' | translate | async)\" color=\"primary\" (onClick)=\"handleApplyClick()\"></ax-button>\n</ax-footer>\n", dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { 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: "component", type: i4.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "type", "responsiveOn", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "responsiveOnChange", "loadingTextChange"] }, { kind: "component", type: i4.AXButtonItemComponent, selector: "ax-button-item", inputs: ["color", "disabled", "text", "selected", "divided", "data", "name"], outputs: ["onClick", "onFocus", "onBlur", "disabledChange"] }, { kind: "component", type: i4.AXButtonItemListComponent, selector: "ax-button-item-list", inputs: ["items"], outputs: ["onItemClick"] }, { kind: "component", type: i4$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i4$1.AXDecoratorCloseButtonComponent, selector: "ax-close-button", inputs: ["icon"] }, { kind: "component", type: i4$1.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-sub-title, ax-placeholder, ax-overlay" }, { kind: "component", type: i5.AXBadgeComponent, selector: "ax-badge", inputs: ["color", "look", "text"] }, { kind: "component", type: i6$1.AXPopoverComponent, selector: "ax-popover", inputs: ["offsetX", "offsetY", "target", "placement", "content", "openOn", "closeOn", "hasBackdrop", "openAfter", "closeAfter", "backdropClass", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "component", type: i7.AXImageComponent, selector: "ax-image", inputs: ["overlayMode", "src", "alt", "priority", "lazy"], outputs: ["onLoad", "onError"] }, { kind: "component", type: i8$1.AXSwitchComponent, selector: "ax-switch", inputs: ["disabled", "readonly", "color", "tabIndex", "value", "name", "isLoading"], outputs: ["onBlur", "onFocus", "valueChange", "onValueChanged", "readonlyChange", "disabledChange"] }, { kind: "component", type: i9.AXTabsComponent, selector: "ax-tabs", inputs: ["look", "location", "fitParent", "minWidth", "content"], outputs: ["onActiveTabChanged"] }, { kind: "component", type: i9.AXTabItemComponent, selector: "ax-tab-item", inputs: ["disabled", "text", "key", "headerTemplate", "active"], outputs: ["disabledChange", "onClick", "onBlur", "onFocus", "activeChange"] }, { kind: "directive", type: i9.AXTabContentDirective, selector: "[axTabContent]", inputs: ["axTabContent"], exportAs: ["axTabContent"] }, { kind: "component", type: i10$1.AXSelectBoxComponent, selector: "ax-select-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "minValue", "maxValue", "value", "state", "name", "id", "type", "look", "multiple", "valueField", "textField", "textTemplate", "dataSource", "caption", "itemTemplate", "selectedTemplate", "emptyTemplate", "loadingTemplate", "dropdownWidth"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onOpened", "onClosed"] }, { kind: "component", type: i11$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: "component", type: i7$1.AXLabelComponent, selector: "ax-label", inputs: ["required", "for"], outputs: ["requiredChange"] }, { kind: "component", type: i13.AXSelectionListComponent, selector: "ax-selection-list", inputs: ["id", "name", "disabled", "readonly", "tabIndex", "size", "value", "valueField", "textField", "hintField", "disabledField", "readonlyField", "multiple", "direction", "customTemplate", "showControl", "items", "look"], outputs: ["onValueChanged", "onBlur", "onFocus"] }, { kind: "component", type: i14.AXDropdownButtonComponent, selector: "ax-dropdown-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "type", "mode"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "lookChange", "colorChange", "disabledChange"] }, { kind: "directive", type: i15.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i15.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: i15.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: i10.AXPWidgetFilterRendererComponent, selector: "axp-widget-filter-renderer", inputs: ["value", "operator", "prop", "schema"], outputs: ["valueChange", "operatorChange"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i8.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1094
|
+
}
|
|
1095
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPEntityCreateCustomViewComponent, decorators: [{
|
|
1096
|
+
type: Component,
|
|
1097
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
1098
|
+
{
|
|
1099
|
+
provide: AXUnsubscriber,
|
|
1100
|
+
},
|
|
1101
|
+
], template: "<ax-header class=\"ax-p-4 ax-flex ax-justify-between ax-border-b\">\n <div class=\"ax-flex ax-items-center\">\n @if (showNameInput() && mode==='create') {\n <div class=\"ax-w-60\">\n <ax-text-box class=\"ax-sm\" [(ngModel)]=\"selectedView.title\">\n @if(showNameInput()){\n <ax-suffix>\n <ax-button (onClick)=\"changeViewNameToggle()\" look=\"default\">\n <ax-icon class=\"fa-sodild fas fa-check ax-text-sm\"> </ax-icon>\n </ax-button>\n </ax-suffix>\n }\n </ax-text-box>\n </div>\n }@else {\n <span class=\"ax-text-lg ax-font-semibold\">{{ selectedView.title }}</span>\n } @if (mode===\"create\") {\n <ax-button class=\"ax-xs\" (onClick)=\"changeViewNameToggle()\" color=\"default\">\n @if(!showNameInput() ){\n <ax-icon class=\"fa-regular fa-pen ax-text-sm ax-text-neutral-600\"> </ax-icon>\n }\n </ax-button>\n }\n </div>\n <ax-close-button></ax-close-button>\n</ax-header>\n<div class=\"ax-p-4\">\n <ax-tabs [content]=\"contents\" look=\"with-line\">\n <ax-tab-item [text]=\"('entity.columns' | translate | async) ?? 'Columns'\">\n <ax-suffix>\n <ax-badge [text]=\"visibleColumns().length.toString()\" color=\"primary\"> </ax-badge>\n </ax-suffix>\n <ax-content>\n <div class=\"ax-flex ax-flex-col ax-gap-4 ax-p-4 ax-select-none ax-h-[400px]\" cdkDropList (cdkDropListDropped)=\"drop('columns', $event)\">\n <div class=\"ax-flex ax-flex-col ax-gap-3 ax-w-full ax-sorted-list ax-overflow-auto ax-pe-2\">\n <ng-container *ngFor=\"let item of columns()\">\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 }}</p>\n </div>\n <ax-switch class=\"ax-sm\" [(ngModel)]=\"item.visible\" (onValueChanged)=\"updateColumnItem($event, item.name)\"></ax-switch>\n </div>\n </ng-container>\n </div>\n </div>\n </ax-content>\n </ax-tab-item>\n <ax-tab-item text=\"Conditions\">\n <ax-suffix>\n <ax-badge [text]=\"conditions().length.toString()\" color=\"primary\"> </ax-badge>\n </ax-suffix>\n <ax-content>\n <div\n class=\"ax-flex ax-flex-col ax-justify-start ax-gap-4 ax-py-4 ax-select-none ax-h-[400px]\"\n [class.ax-justify-center]=\"!conditions().length\"\n >\n @if(!conditions().length){\n <div class=\"ax-flex ax-flex-col ax-items-center ax-justify-center\">\n <ax-image src=\"assets/documents.svg\"></ax-image>\n <p class=\"ax-mt-6 ax-mb-1 ax-font-bold\">No Filters Selected</p>\n <span class=\"ax-text-neutral-400 ax-text-sm md:ax-text-md\">Please select field(s) that you want to filter</span>\n </div>\n } @else {\n <div class=\"ax-sorted-list ax-px-4 ax-py-1 ax-overflow-auto\">\n <div cdkDropList (cdkDropListDropped)=\"drop('conditions', $event)\" class=\"ax-flex ax-flex-col ax-gap-2\">\n @for(item of conditions(); track item.name ){\n <div cdkDrag cdkDragBoundary=\".ax-sorted-list\">\n <div class=\"ax-ms-4 ax-flex ax-items-start ax-gap-2\">\n <ax-label>{{ loader.getProp(item.name)?.title }}</ax-label>\n @if(getOperatorTitle(item.name,item.operator)){\n <ax-badge class=\"ax-text-xs\" color=\"primary\" [look]=\"'twotone'\" [text]=\"getOperatorTitle(item.name, item.operator)\"></ax-badge>\n }\n </div>\n <div class=\"ax-flex ax-group ax-items-center ax-gap-2\">\n <ax-icon class=\"fa-solid fa-grip-dots-vertical ax-cursor-move\" cdkDragHandle></ax-icon>\n <div class=\"ax-w-full\">\n <axp-widget-filter-renderer\n [schema]=\"getSchema(item.name)\"\n [prop]=\"loader.getProp(item.name)\"\n [(value)]=\"item.value\"\n [(operator)]=\"item.operator\"\n >\n </axp-widget-filter-renderer>\n </div>\n <ax-button look=\"blank\" color=\"danger\" class=\"ax-sm\" (onClick)=\"removeCondition(item)\">\n <ax-icon class=\"fa-solid fa-trash-can\"></ax-icon>\n </ax-button>\n </div>\n </div>\n }\n </div>\n </div>\n }\n <div class=\"ax-flex ax-gap-2\">\n <div class=\"ax-w-full\" #addField>\n @if(conditions().length){\n <ax-button color=\"primary\" [text]=\"'entity.add-field' | translate | async\" look=\"blank\" class=\"ax-sm\"></ax-button>\n }@else {\n <div class=\"ax-flex ax-justify-center ax-w-full\">\n <ax-button color=\"primary\" [text]=\"'entity.add-field' | translate | async\" look=\"outline\" class=\"ax-md ax-w-56\"></ax-button>\n </div>\n }\n <ax-popover\n #conditionsPopover\n [target]=\"addField\"\n [placement]=\"conditions().length ? 'bottom-start' : 'bottom'\"\n [offsetY]=\"8\"\n [openOn]=\"'toggle'\"\n [closeOn]=\"'clickOut'\"\n [adaptivityEnabled]=\"true\"\n (onOpened)=\"resetSelectedFieldNames()\"\n >\n <div class=\"ax-bg-surface ax-border ax-border-default ax-rounded-md ax-shadow-md ax-w-full ax-min-w-[250px]\">\n <div class=\"ax-border-b-[1px] ax-pb-2 ax-mb-2 ax-p-3\">\n <ax-title class=\"ax-font-bold\">Fields</ax-title>\n </div>\n <div class=\"ax-max-h-48 ax-overflow-auto\">\n <ax-selection-list\n [valueField]=\"'name'\"\n [textField]=\"'title'\"\n [(ngModel)]=\"selectedConditionNames\"\n [direction]=\"'vertical'\"\n [items]=\"props()\"\n [multiple]=\"true\"\n ></ax-selection-list>\n </div>\n <div class=\"ax-flex ax-justify-end ax-border-t-[1px] ax-p-3\">\n <ax-button (onClick)=\"addCondition(); conditionsPopover.close()\" class=\"ax-sm\" text=\"Confirm\" color=\"primary\"> </ax-button>\n </div>\n </div>\n </ax-popover>\n </div>\n </div>\n </div>\n </ax-content>\n </ax-tab-item>\n <ax-tab-item text=\"Sorting\">\n <ax-suffix>\n <ax-badge [text]=\"sorts().length.toString()\" color=\"primary\"> </ax-badge>\n </ax-suffix>\n <ax-content>\n <div\n class=\"ax-flex ax-p-4 ax-flex-col ax-justify-start ax-gap-4 ax-select-none ax-overflow-auto ax-h-[400px]\"\n [class.ax-justify-center]=\"!sorts().length\"\n >\n @if(!sorts().length){\n <div class=\"ax-flex ax-flex-col ax-items-center ax-justify-center\">\n <ax-image src=\"assets/documents.svg\"></ax-image>\n <p class=\"ax-mt-6 ax-mb-1 ax-font-bold\">{{ 'entity.no-sort' | translate | async }}</p>\n <span class=\"ax-text-neutral-400 ax-text-sm md:ax-text-md\">{{ 'entity.ask-sort' | translate | async }}</span>\n </div>\n }@else {\n <div\n cdkDropList\n (cdkDropListDropped)=\"drop('sorts', $event)\"\n class=\"ax-flex ax-flex-col ax-gap-3 ax-w-full ax-sorted-list ax-py-1 ax-overflow-auto\"\n >\n <ng-container *ngFor=\"let item of sorts()\">\n <div class=\"ax-flex ax-gap-2 ax-items-center\" cdkDrag cdkDragBoundary=\".ax-sorted-list\">\n <ax-icon class=\"fa-solid fa-grip-dots-vertical ax-cursor-move\" cdkDragHandle></ax-icon>\n <ax-select-box [dataSource]=\"props()\" valueField=\"name\" textField=\"title\" [(ngModel)]=\"item.name\"> </ax-select-box>\n <ax-button [color]=\"'default'\" class=\"ax-sm\" (click)=\"updateSortItem(item)\">\n <ax-icon [class.ax-text-primary]=\"item.dir == 'asc'\" class=\"fa-solid fa-arrow-up-long ax-text-neutral-400\"></ax-icon>\n <ax-icon [class.ax-text-primary]=\"item.dir == 'desc'\" class=\"fa-solid fa-arrow-down-long ax-text-neutral-400\"></ax-icon>\n </ax-button>\n\n <ax-button look=\"blank\" (onClick)=\"removeSortItem(item)\">\n <ax-icon class=\"fa-solid fa-trash-can ax-text-danger-500\"></ax-icon>\n </ax-button>\n </div>\n </ng-container>\n </div>\n }\n\n <div class=\"ax-flex ax-gap-2\">\n <div class=\"ax-w-full\" #addField>\n @if(sorts().length){\n <ax-button\n (onClick)=\"addSortItem()\"\n color=\"primary\"\n [text]=\"'entity.add-field' | translate | async\"\n look=\"blank\"\n class=\"ax-sm\"\n ></ax-button>\n }@else {\n <div class=\"ax-flex ax-justify-center ax-w-full\">\n <ax-button\n (onClick)=\"addSortItem()\"\n color=\"primary\"\n [text]=\"'entity.add-field' | translate | async\"\n look=\"outline\"\n class=\"ax-md ax-w-56\"\n ></ax-button>\n </div>\n }\n </div>\n </div>\n </div>\n </ax-content>\n </ax-tab-item>\n </ax-tabs>\n <ng-template [axTabContent] #contents=\"axTabContent\"> </ng-template>\n</div>\n<ax-footer class=\"!ax-justify-end\">\n @if (mode===\"edit\") {\n <ax-dropdown-button [text]=\"'discard' | translate | async\" (onClick)=\"handleDiscardClick()\">\n <ax-button-item-list>\n <ax-button-item [text]=\"('reset' | translate | async) ?? ' '\" (onClick)=\"handleResetClick()\">\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-rotate-left fa-flip-horizontal\"></ax-icon>\n </ax-prefix>\n </ax-button-item>\n <ax-button-item class=\"ax-text-danger\" text=\"Delete\" (onClick)=\"handleDeleteClick()\">\n <ax-prefix> <ax-icon icon=\"fas fa-trash fa-flip-horizontal\"></ax-icon> </ax-prefix\n ></ax-button-item>\n </ax-button-item-list>\n </ax-dropdown-button>\n } @else {\n <ax-button [text]=\"'cancel' | translate | async\" look=\"outline\" (onClick)=\"handleCancelClick()\"></ax-button>\n }\n <ax-button [text]=\"mode === 'create' ? ('save' | translate | async) : ('save-changes' | translate | async)\" color=\"primary\" (onClick)=\"handleApplyClick()\"></ax-button>\n</ax-footer>\n" }]
|
|
1102
|
+
}], propDecorators: { loader: [{
|
|
1103
|
+
type: Input
|
|
1104
|
+
}], mode: [{
|
|
1105
|
+
type: Input
|
|
1106
|
+
}], selectedView: [{
|
|
1107
|
+
type: Input
|
|
1108
|
+
}] } });
|
|
1109
|
+
|
|
1110
|
+
class AXPListViewOptionsColumnsComponent {
|
|
1111
|
+
constructor() {
|
|
1112
|
+
this.store = inject((Store));
|
|
1113
|
+
this.isSM = this.store.select(isSmallScreen());
|
|
1114
|
+
this.columns$ = of([]);
|
|
1115
|
+
this.onClosed = new EventEmitter();
|
|
1464
1116
|
}
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1117
|
+
ngOnInit() {
|
|
1118
|
+
this.columns$ = this.loader.displayColumns$;
|
|
1119
|
+
}
|
|
1120
|
+
handleVisibilityChange(e, name) {
|
|
1121
|
+
if (e.isUserInteraction) {
|
|
1122
|
+
this.loader.setColumnVisibility(name, e.value);
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
drop(event) {
|
|
1126
|
+
this.columns$.pipe(first()).subscribe((columns) => {
|
|
1127
|
+
moveItemInArray(columns, event.previousIndex, event.currentIndex);
|
|
1473
1128
|
});
|
|
1474
|
-
this._currentDisplayColumns$.next(updatedColumns);
|
|
1475
1129
|
}
|
|
1476
|
-
|
|
1477
|
-
|
|
1130
|
+
handleClose() {
|
|
1131
|
+
this.onClosed.emit();
|
|
1478
1132
|
}
|
|
1479
|
-
|
|
1480
|
-
|
|
1133
|
+
handleResetClick() {
|
|
1134
|
+
this.loader.resetColumns();
|
|
1481
1135
|
}
|
|
1482
|
-
|
|
1483
|
-
this.
|
|
1484
|
-
|
|
1485
|
-
const name = view.columns.find((c) => !currentSorts.some((s) => s.name == c.name))?.name ?? '';
|
|
1486
|
-
if (name) {
|
|
1487
|
-
const sorts = [...currentSorts, { name, dir: 'asc' }];
|
|
1488
|
-
this._currentSorts$.next(sorts);
|
|
1489
|
-
}
|
|
1136
|
+
handleApplyClick() {
|
|
1137
|
+
this.columns$.pipe(first()).subscribe((data) => {
|
|
1138
|
+
this.loader.updateColumns(data);
|
|
1490
1139
|
});
|
|
1140
|
+
this.onClosed.emit();
|
|
1491
1141
|
}
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1142
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPListViewOptionsColumnsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1143
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", type: AXPListViewOptionsColumnsComponent, selector: "axp-list-view-option-columns", inputs: { loader: "loader" }, outputs: { onClosed: "onClosed" }, ngImport: i0, template: "<ax-header class=\"ax-flex ax-items-center\">\n <h2 class=\"ax-text-xl ax-font-bold\">{{ 'entity.columns' | translate | async }}</h2>\n <ax-button (onClick)=\"handleClose()\" [look]=\"'blank'\">\n <ax-icon class=\"fa-solid fa-close ax-text-neutral-400 ax-text-xl\"> </ax-icon>\n </ax-button>\n</ax-header>\n<div class=\"ax-flex ax-flex-col ax-gap-4 ax-p-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 <ng-container *ngFor=\"let item of columns$ | async\">\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 }}</p>\n </div>\n <ax-switch class=\"ax-sm\" [ngModel]=\"item.visible\" (onValueChanged)=\"handleVisibilityChange($event, item.name)\"></ax-switch>\n </div>\n </ng-container>\n </div>\n</div>\n<ax-footer class=\"!ax-justify-start ax-absolute ax-bottom-0 ax-w-full\">\n <ax-button [text]=\"'apply' | translate | async\" color=\"primary\" (onClick)=\"handleApplyClick()\"></ax-button>\n <ax-button [text]=\"'reset' | translate | async\" color=\"ghost\" (onClick)=\"handleResetClick()\"></ax-button>\n</ax-footer>\n", dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { 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: "component", type: i4.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "type", "responsiveOn", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "responsiveOnChange", "loadingTextChange"] }, { kind: "component", type: i4$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i4$1.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-sub-title, ax-placeholder, ax-overlay" }, { kind: "component", type: i8$1.AXSwitchComponent, selector: "ax-switch", inputs: ["disabled", "readonly", "color", "tabIndex", "value", "name", "isLoading"], outputs: ["onBlur", "onFocus", "valueChange", "onValueChanged", "readonlyChange", "disabledChange"] }, { kind: "directive", type: i15.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i15.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: i15.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i8.AXTranslatorPipe, name: "translate" }] }); }
|
|
1144
|
+
}
|
|
1145
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPListViewOptionsColumnsComponent, decorators: [{
|
|
1146
|
+
type: Component,
|
|
1147
|
+
args: [{ selector: 'axp-list-view-option-columns', template: "<ax-header class=\"ax-flex ax-items-center\">\n <h2 class=\"ax-text-xl ax-font-bold\">{{ 'entity.columns' | translate | async }}</h2>\n <ax-button (onClick)=\"handleClose()\" [look]=\"'blank'\">\n <ax-icon class=\"fa-solid fa-close ax-text-neutral-400 ax-text-xl\"> </ax-icon>\n </ax-button>\n</ax-header>\n<div class=\"ax-flex ax-flex-col ax-gap-4 ax-p-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 <ng-container *ngFor=\"let item of columns$ | async\">\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 }}</p>\n </div>\n <ax-switch class=\"ax-sm\" [ngModel]=\"item.visible\" (onValueChanged)=\"handleVisibilityChange($event, item.name)\"></ax-switch>\n </div>\n </ng-container>\n </div>\n</div>\n<ax-footer class=\"!ax-justify-start ax-absolute ax-bottom-0 ax-w-full\">\n <ax-button [text]=\"'apply' | translate | async\" color=\"primary\" (onClick)=\"handleApplyClick()\"></ax-button>\n <ax-button [text]=\"'reset' | translate | async\" color=\"ghost\" (onClick)=\"handleResetClick()\"></ax-button>\n</ax-footer>\n" }]
|
|
1148
|
+
}], propDecorators: { loader: [{
|
|
1149
|
+
type: Input
|
|
1150
|
+
}], onClosed: [{
|
|
1151
|
+
type: Output
|
|
1152
|
+
}] } });
|
|
1153
|
+
|
|
1154
|
+
class AXPListViewOptionConditionsComponent {
|
|
1155
|
+
constructor() {
|
|
1156
|
+
this.onClosed = new EventEmitter();
|
|
1157
|
+
this.schemaRegistery = inject(AXPSchemaRegistryService);
|
|
1158
|
+
this.popopService = inject(AXPopupService);
|
|
1159
|
+
this.isSM = false;
|
|
1160
|
+
this.props$ = of([]);
|
|
1161
|
+
this.props = [];
|
|
1162
|
+
this.conditions$ = of([]);
|
|
1163
|
+
this.selectedFieldNames = [];
|
|
1496
1164
|
}
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
this._currentSorts$.next(cloneDeep(view.sorts));
|
|
1500
|
-
});
|
|
1165
|
+
onNameChange(item) {
|
|
1166
|
+
console.log('onName changed!', item);
|
|
1501
1167
|
}
|
|
1502
|
-
|
|
1503
|
-
this.
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
this.dataSource.sort(...convertedSortItems);
|
|
1511
|
-
this.dataSource.refresh();
|
|
1168
|
+
ngOnInit() {
|
|
1169
|
+
this.props$ = this.loader.properties$.pipe(map((sorts) => sorts.filter((s) => s.canFilter != false)));
|
|
1170
|
+
this.conditions$ = this.loader.conditions$;
|
|
1171
|
+
this.conditions$.pipe(first()).subscribe((initialConditions) => {
|
|
1172
|
+
this.selectedFieldNames = initialConditions.map((i) => i.name);
|
|
1173
|
+
});
|
|
1174
|
+
this.props$.pipe(first()).subscribe((data) => {
|
|
1175
|
+
this.props = data;
|
|
1512
1176
|
});
|
|
1513
1177
|
}
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
get conditionsCount$() {
|
|
1518
|
-
return this.view$.pipe(map((c) => c.conditions.length));
|
|
1178
|
+
getOperators(name) {
|
|
1179
|
+
const schemaName = this.props.find((c) => c.name == name)?.schema ?? '';
|
|
1180
|
+
return this.schemaRegistery.resolve(schemaName)?.filterOptions?.operators ?? [];
|
|
1519
1181
|
}
|
|
1520
|
-
|
|
1521
|
-
|
|
1182
|
+
getDefaultOperator(name) {
|
|
1183
|
+
const schemaName = this.props.find((c) => c.name == name)?.schema ?? '';
|
|
1184
|
+
return this.schemaRegistery.resolve(schemaName)?.filterOptions?.default ?? EQ_OPER;
|
|
1522
1185
|
}
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
const conditionsMap = new Map(prevConditions.map((item) => [item.name, item]));
|
|
1526
|
-
const newFields = selectedFields.map((field) => conditionsMap.get(field.name) || { name: field.name, operator: field.opr });
|
|
1527
|
-
this._currentConditions$.next(newFields);
|
|
1186
|
+
getOperatorTitle(schemaName, oprName) {
|
|
1187
|
+
return this.getOperators(schemaName).find((c) => c.name == oprName)?.title || '';
|
|
1528
1188
|
}
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
const conditions = currentConditions.filter((c) => c != item);
|
|
1532
|
-
this._currentConditions$.next(conditions);
|
|
1189
|
+
getSchema(name) {
|
|
1190
|
+
return this.props.find((c) => c.name == name)?.schema ?? '';
|
|
1533
1191
|
}
|
|
1534
|
-
|
|
1535
|
-
this.
|
|
1536
|
-
|
|
1537
|
-
|
|
1192
|
+
drop(event) {
|
|
1193
|
+
this.conditions$.pipe(first()).subscribe((conditions) => {
|
|
1194
|
+
console.log('conditions: ', conditions);
|
|
1195
|
+
moveItemInArray(conditions, event.previousIndex, event.currentIndex);
|
|
1538
1196
|
});
|
|
1539
|
-
this.applyAllConditions();
|
|
1540
1197
|
}
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
this._inlineFilterItems?.forEach((property) => {
|
|
1544
|
-
if (property?.dataType == 'string' || property?.dataType == 'number') {
|
|
1545
|
-
inlineConditions.push({
|
|
1546
|
-
name: property.name,
|
|
1547
|
-
value: property.dataType == 'number' ? parseFloat(value) : value,
|
|
1548
|
-
operator: property.dataType == 'string' ? 'contains' : 'equal',
|
|
1549
|
-
});
|
|
1550
|
-
}
|
|
1551
|
-
});
|
|
1552
|
-
this.view$.pipe(first()).subscribe((view) => {
|
|
1553
|
-
view.inlineConditions = cloneDeep(inlineConditions);
|
|
1554
|
-
});
|
|
1555
|
-
this.applyAllConditions();
|
|
1198
|
+
handleClose() {
|
|
1199
|
+
this.onClosed.emit();
|
|
1556
1200
|
}
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
const mainConditions = {
|
|
1565
|
-
field: null,
|
|
1566
|
-
operator: null,
|
|
1567
|
-
logic: 'and',
|
|
1568
|
-
filters: [],
|
|
1569
|
-
};
|
|
1570
|
-
this.view$.pipe(first()).subscribe((view) => {
|
|
1571
|
-
if (view.inlineConditions && view.inlineConditions.length) {
|
|
1572
|
-
view.inlineConditions?.forEach((c) => {
|
|
1573
|
-
if (c.value) {
|
|
1574
|
-
inlineConditions.filters?.push({
|
|
1575
|
-
field: c.name,
|
|
1576
|
-
operator: { type: c.operator },
|
|
1577
|
-
value: c.value,
|
|
1578
|
-
});
|
|
1579
|
-
}
|
|
1580
|
-
});
|
|
1581
|
-
}
|
|
1582
|
-
if (view.conditions.length) {
|
|
1583
|
-
view.conditions.forEach((c) => {
|
|
1584
|
-
mainConditions.filters?.push({
|
|
1585
|
-
field: c.name,
|
|
1586
|
-
operator: { type: c.operator },
|
|
1587
|
-
value: c.value,
|
|
1588
|
-
});
|
|
1589
|
-
});
|
|
1590
|
-
}
|
|
1591
|
-
this.dataSource.filter({
|
|
1592
|
-
field: null,
|
|
1593
|
-
logic: 'and',
|
|
1594
|
-
operator: null,
|
|
1595
|
-
filters: [mainConditions, inlineConditions],
|
|
1596
|
-
});
|
|
1597
|
-
this.dataSource.refresh();
|
|
1598
|
-
this._views$.next(this._views$.value.map((v) => (v.name === this._currentView ? view : v)));
|
|
1201
|
+
handleRemoveCondition(item) {
|
|
1202
|
+
this.selectedFieldNames = this.selectedFieldNames.filter((i) => i !== item.name);
|
|
1203
|
+
this.loader.removeCondition(item);
|
|
1204
|
+
}
|
|
1205
|
+
resetSelectedFieldNames() {
|
|
1206
|
+
this.conditions$.pipe(first()).subscribe((initialConditions) => {
|
|
1207
|
+
this.selectedFieldNames = initialConditions.map((i) => i.name);
|
|
1599
1208
|
});
|
|
1600
1209
|
}
|
|
1601
|
-
|
|
1602
|
-
this.
|
|
1603
|
-
|
|
1210
|
+
handleResetClick() {
|
|
1211
|
+
this.loader.resetConditions();
|
|
1212
|
+
}
|
|
1213
|
+
onConfirmFields() {
|
|
1214
|
+
const fileds = this.selectedFieldNames.map((c) => {
|
|
1215
|
+
const opr = this.getDefaultOperator(c);
|
|
1216
|
+
return {
|
|
1217
|
+
name: c,
|
|
1218
|
+
opr: opr.name,
|
|
1219
|
+
};
|
|
1604
1220
|
});
|
|
1221
|
+
this.loader.addCondition(fileds);
|
|
1605
1222
|
}
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
this.
|
|
1612
|
-
this.schemaService = inject(AXPSchemaRegistryService);
|
|
1613
|
-
this.layout = inject(AXPLayoutService);
|
|
1614
|
-
}
|
|
1615
|
-
async create(moduleName, entityName) {
|
|
1616
|
-
this.layout.setNavigationLoading(true);
|
|
1617
|
-
const config = await this.entityService.resolve(moduleName, entityName);
|
|
1618
|
-
let result = this.cache.get(config.name);
|
|
1619
|
-
if (result) {
|
|
1620
|
-
this.layout.setNavigationLoading(false);
|
|
1621
|
-
return result;
|
|
1622
|
-
}
|
|
1623
|
-
result = new AXPListViewLoaderDefault(config, this.schemaService);
|
|
1624
|
-
this.cache.set(config.name, result);
|
|
1625
|
-
this.layout.setNavigationLoading(false);
|
|
1626
|
-
return result;
|
|
1223
|
+
handleApplyClick() {
|
|
1224
|
+
this.conditions$.pipe(first()).subscribe((data) => {
|
|
1225
|
+
console.log(data);
|
|
1226
|
+
this.loader.updateConditions(data);
|
|
1227
|
+
});
|
|
1228
|
+
this.onClosed.emit();
|
|
1627
1229
|
}
|
|
1628
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type:
|
|
1629
|
-
static { this.ɵ
|
|
1230
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPListViewOptionConditionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1231
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AXPListViewOptionConditionsComponent, selector: "axp-list-view-option-conditions", inputs: { loader: "loader" }, outputs: { onClosed: "onClosed" }, ngImport: i0, template: "<ax-header class=\"ax-flex ax-items-center\">\n <h2 class=\"ax-text-xl ax-font-bold\">Filters</h2>\n <ax-button (onClick)=\"handleClose()\" [look]=\"'blank'\">\n <ax-icon class=\"fa-solid fa-close ax-text-neutral-400 ax-text-xl\"> </ax-icon>\n </ax-button>\n</ax-header>\n<div\n class=\"ax-flex ax-flex-col ax-justify-center ax-gap-4 ax-py-4 ax-select-none\"\n [class.ax-h-[calc(100vh-310px)]]=\"!(conditions$ | async)?.length\"\n>\n @if(!(conditions$ | async)?.length){\n <div class=\"ax-flex ax-flex-col ax-items-center ax-justify-center\">\n <ax-image src=\"assets/documents.svg\"></ax-image>\n <p class=\"ax-mt-6 ax-mb-1 ax-font-bold\">No Filters Selected</p>\n <span class=\"ax-text-neutral-400 ax-text-sm md:ax-text-md\">Please select field(s) that you want to filter</span>\n </div>\n } @else {\n <div class=\"ax-sorted-list ax-max-h-[calc(100vh-310px)] ax-px-4 ax-py-1 ax-overflow-auto\">\n <div cdkDropList (cdkDropListDropped)=\"drop($event)\" class=\"ax-flex ax-flex-col ax-gap-2\">\n @for(item of conditions$ | async; track item.name ){\n <div cdkDrag cdkDragBoundary=\".ax-sorted-list\">\n <div class=\"ax-ms-4 ax-flex ax-items-start ax-gap-2\">\n <ax-label>{{ loader.getProp(item.name)?.title }}</ax-label>\n @if(getOperatorTitle(item.name,item.operator)){\n <ax-badge\n class=\"ax-text-xs\"\n color=\"primary\"\n [look]=\"'twotone'\"\n [text]=\"getOperatorTitle(item.name, item.operator)\"\n ></ax-badge>\n }\n </div>\n <div class=\"ax-flex ax-group ax-items-center ax-gap-2\">\n <ax-icon class=\"fa-solid fa-grip-dots-vertical ax-cursor-move\" cdkDragHandle></ax-icon>\n <div class=\"ax-w-full\">\n <!-- <ax-text-box [(ngModel)]=\"item.value\"></ax-text-box> -->\n <axp-widget-filter-renderer\n [schema]=\"getSchema(item.name)\"\n [prop]=\"loader.getProp(item.name)\"\n [(value)]=\"item.value\"\n [(operator)]=\"item.operator\"\n >\n </axp-widget-filter-renderer>\n </div>\n <ax-button look=\"blank\" color=\"danger\" class=\"ax-sm\" (onClick)=\"handleRemoveCondition(item)\">\n <ax-icon class=\"fa-solid fa-trash-can\"></ax-icon>\n </ax-button>\n </div>\n </div>\n }\n </div>\n </div>\n }\n <div class=\"ax-flex ax-gap-2\">\n <div class=\"ax-w-full\" #addField>\n @if((conditions$ | async)?.length){\n <ax-button color=\"primary\" [text]=\"'entity.add-field' | translate | async\" look=\"blank\" class=\"ax-sm\"></ax-button>\n }@else {\n <div class=\"ax-flex ax-justify-center ax-w-full\">\n <ax-button color=\"primary\" [text]=\"'entity.add-field' | translate | async\" look=\"outline\" class=\"ax-md ax-w-56\"></ax-button>\n </div>\n }\n </div>\n <ax-popover\n #fieldsPopover\n [target]=\"addField\"\n [openOn]=\"'toggle'\"\n [closeOn]=\"'clickOut'\"\n [adaptivityEnabled]=\"true\"\n (onOpened)=\"resetSelectedFieldNames()\"\n [offsetX]=\"15\"\n >\n <div class=\"ax-bg-surface ax-border ax-border-default ax-rounded-md ax-shadow-md ax-w-full ax-min-w-[250px]\">\n <div class=\"ax-border-b-[1px] ax-pb-2 ax-mb-2 ax-p-3\">\n <ax-title class=\"ax-font-bold\">Fields</ax-title>\n </div>\n <div class=\"ax-max-h-72 2xl:ax-max-h-80 ax-overflow-auto\">\n <ax-selection-list\n [valueField]=\"'name'\"\n [textField]=\"'title'\"\n [(ngModel)]=\"selectedFieldNames\"\n [direction]=\"'vertical'\"\n [items]=\"props\"\n [multiple]=\"true\"\n ></ax-selection-list>\n </div>\n <div class=\"ax-flex ax-justify-end ax-border-t-[1px] ax-p-3\">\n <ax-button (onClick)=\"onConfirmFields(); fieldsPopover.close()\" class=\"ax-sm\" text=\"Confirm\" color=\"primary\">\n </ax-button>\n </div>\n </div>\n </ax-popover>\n </div>\n</div>\n<ax-footer class=\"!ax-justify-start ax-absolute ax-bottom-0 ax-w-full\">\n <ax-button [text]=\"'apply' | translate | async\" color=\"primary\" (onClick)=\"handleApplyClick()\"></ax-button>\n <ax-button [text]=\"'reset' | translate | async\" color=\"ghost\" (onClick)=\"handleResetClick()\"></ax-button>\n</ax-footer>\n", dependencies: [{ 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: "component", type: i4.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "type", "responsiveOn", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "responsiveOnChange", "loadingTextChange"] }, { kind: "component", type: i4$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i4$1.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-sub-title, ax-placeholder, ax-overlay" }, { kind: "component", type: i5.AXBadgeComponent, selector: "ax-badge", inputs: ["color", "look", "text"] }, { kind: "component", type: i6$1.AXPopoverComponent, selector: "ax-popover", inputs: ["offsetX", "offsetY", "target", "placement", "content", "openOn", "closeOn", "hasBackdrop", "openAfter", "closeAfter", "backdropClass", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "component", type: i7.AXImageComponent, selector: "ax-image", inputs: ["overlayMode", "src", "alt", "priority", "lazy"], outputs: ["onLoad", "onError"] }, { kind: "component", type: i7$1.AXLabelComponent, selector: "ax-label", inputs: ["required", "for"], outputs: ["requiredChange"] }, { kind: "component", type: i13.AXSelectionListComponent, selector: "ax-selection-list", inputs: ["id", "name", "disabled", "readonly", "tabIndex", "size", "value", "valueField", "textField", "hintField", "disabledField", "readonlyField", "multiple", "direction", "customTemplate", "showControl", "items", "look"], outputs: ["onValueChanged", "onBlur", "onFocus"] }, { kind: "directive", type: i15.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i15.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: i15.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: i10.AXPWidgetFilterRendererComponent, selector: "axp-widget-filter-renderer", inputs: ["value", "operator", "prop", "schema"], outputs: ["valueChange", "operatorChange"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i8.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1630
1232
|
}
|
|
1631
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type:
|
|
1632
|
-
type:
|
|
1633
|
-
args: [{
|
|
1634
|
-
}]
|
|
1233
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPListViewOptionConditionsComponent, decorators: [{
|
|
1234
|
+
type: Component,
|
|
1235
|
+
args: [{ selector: 'axp-list-view-option-conditions', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<ax-header class=\"ax-flex ax-items-center\">\n <h2 class=\"ax-text-xl ax-font-bold\">Filters</h2>\n <ax-button (onClick)=\"handleClose()\" [look]=\"'blank'\">\n <ax-icon class=\"fa-solid fa-close ax-text-neutral-400 ax-text-xl\"> </ax-icon>\n </ax-button>\n</ax-header>\n<div\n class=\"ax-flex ax-flex-col ax-justify-center ax-gap-4 ax-py-4 ax-select-none\"\n [class.ax-h-[calc(100vh-310px)]]=\"!(conditions$ | async)?.length\"\n>\n @if(!(conditions$ | async)?.length){\n <div class=\"ax-flex ax-flex-col ax-items-center ax-justify-center\">\n <ax-image src=\"assets/documents.svg\"></ax-image>\n <p class=\"ax-mt-6 ax-mb-1 ax-font-bold\">No Filters Selected</p>\n <span class=\"ax-text-neutral-400 ax-text-sm md:ax-text-md\">Please select field(s) that you want to filter</span>\n </div>\n } @else {\n <div class=\"ax-sorted-list ax-max-h-[calc(100vh-310px)] ax-px-4 ax-py-1 ax-overflow-auto\">\n <div cdkDropList (cdkDropListDropped)=\"drop($event)\" class=\"ax-flex ax-flex-col ax-gap-2\">\n @for(item of conditions$ | async; track item.name ){\n <div cdkDrag cdkDragBoundary=\".ax-sorted-list\">\n <div class=\"ax-ms-4 ax-flex ax-items-start ax-gap-2\">\n <ax-label>{{ loader.getProp(item.name)?.title }}</ax-label>\n @if(getOperatorTitle(item.name,item.operator)){\n <ax-badge\n class=\"ax-text-xs\"\n color=\"primary\"\n [look]=\"'twotone'\"\n [text]=\"getOperatorTitle(item.name, item.operator)\"\n ></ax-badge>\n }\n </div>\n <div class=\"ax-flex ax-group ax-items-center ax-gap-2\">\n <ax-icon class=\"fa-solid fa-grip-dots-vertical ax-cursor-move\" cdkDragHandle></ax-icon>\n <div class=\"ax-w-full\">\n <!-- <ax-text-box [(ngModel)]=\"item.value\"></ax-text-box> -->\n <axp-widget-filter-renderer\n [schema]=\"getSchema(item.name)\"\n [prop]=\"loader.getProp(item.name)\"\n [(value)]=\"item.value\"\n [(operator)]=\"item.operator\"\n >\n </axp-widget-filter-renderer>\n </div>\n <ax-button look=\"blank\" color=\"danger\" class=\"ax-sm\" (onClick)=\"handleRemoveCondition(item)\">\n <ax-icon class=\"fa-solid fa-trash-can\"></ax-icon>\n </ax-button>\n </div>\n </div>\n }\n </div>\n </div>\n }\n <div class=\"ax-flex ax-gap-2\">\n <div class=\"ax-w-full\" #addField>\n @if((conditions$ | async)?.length){\n <ax-button color=\"primary\" [text]=\"'entity.add-field' | translate | async\" look=\"blank\" class=\"ax-sm\"></ax-button>\n }@else {\n <div class=\"ax-flex ax-justify-center ax-w-full\">\n <ax-button color=\"primary\" [text]=\"'entity.add-field' | translate | async\" look=\"outline\" class=\"ax-md ax-w-56\"></ax-button>\n </div>\n }\n </div>\n <ax-popover\n #fieldsPopover\n [target]=\"addField\"\n [openOn]=\"'toggle'\"\n [closeOn]=\"'clickOut'\"\n [adaptivityEnabled]=\"true\"\n (onOpened)=\"resetSelectedFieldNames()\"\n [offsetX]=\"15\"\n >\n <div class=\"ax-bg-surface ax-border ax-border-default ax-rounded-md ax-shadow-md ax-w-full ax-min-w-[250px]\">\n <div class=\"ax-border-b-[1px] ax-pb-2 ax-mb-2 ax-p-3\">\n <ax-title class=\"ax-font-bold\">Fields</ax-title>\n </div>\n <div class=\"ax-max-h-72 2xl:ax-max-h-80 ax-overflow-auto\">\n <ax-selection-list\n [valueField]=\"'name'\"\n [textField]=\"'title'\"\n [(ngModel)]=\"selectedFieldNames\"\n [direction]=\"'vertical'\"\n [items]=\"props\"\n [multiple]=\"true\"\n ></ax-selection-list>\n </div>\n <div class=\"ax-flex ax-justify-end ax-border-t-[1px] ax-p-3\">\n <ax-button (onClick)=\"onConfirmFields(); fieldsPopover.close()\" class=\"ax-sm\" text=\"Confirm\" color=\"primary\">\n </ax-button>\n </div>\n </div>\n </ax-popover>\n </div>\n</div>\n<ax-footer class=\"!ax-justify-start ax-absolute ax-bottom-0 ax-w-full\">\n <ax-button [text]=\"'apply' | translate | async\" color=\"primary\" (onClick)=\"handleApplyClick()\"></ax-button>\n <ax-button [text]=\"'reset' | translate | async\" color=\"ghost\" (onClick)=\"handleResetClick()\"></ax-button>\n</ax-footer>\n" }]
|
|
1236
|
+
}], ctorParameters: () => [], propDecorators: { onClosed: [{
|
|
1237
|
+
type: Output
|
|
1238
|
+
}], loader: [{
|
|
1239
|
+
type: Input
|
|
1240
|
+
}] } });
|
|
1635
1241
|
|
|
1636
|
-
class
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
this.actions$ = actions$;
|
|
1643
|
-
this.store = inject((Store));
|
|
1644
|
-
this.workflow = inject(AXPWorkflowService);
|
|
1645
|
-
this.canDelete = false;
|
|
1646
|
-
this.canCreate = false;
|
|
1647
|
-
this.canUpdate = false;
|
|
1242
|
+
class AXPListViewOptionFilterOperatorComponent {
|
|
1243
|
+
constructor() {
|
|
1244
|
+
this.visible = false;
|
|
1245
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
1246
|
+
this._items = [];
|
|
1247
|
+
this.valueChange = new EventEmitter();
|
|
1648
1248
|
}
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
//
|
|
1652
|
-
if (this.entity.views.quickView) {
|
|
1653
|
-
this.root = this.entity.views.quickView?.root;
|
|
1654
|
-
this.canDelete = this.entity.editOptions?.delete ?? true;
|
|
1655
|
-
this.canCreate = this.entity.editOptions?.create ?? true;
|
|
1656
|
-
this.canUpdate = this.entity.editOptions?.update ?? true;
|
|
1657
|
-
}
|
|
1249
|
+
get items() {
|
|
1250
|
+
return this._items;
|
|
1658
1251
|
}
|
|
1659
|
-
|
|
1660
|
-
|
|
1252
|
+
set items(v) {
|
|
1253
|
+
this.visible = false;
|
|
1254
|
+
this._items = v;
|
|
1255
|
+
setTimeout(() => {
|
|
1256
|
+
this.visible = true;
|
|
1257
|
+
this.cdr.markForCheck();
|
|
1258
|
+
setTimeout(() => {
|
|
1259
|
+
if (this.selectBox) {
|
|
1260
|
+
//this.selectBox.defaultValue = this.items[0]?.name;
|
|
1261
|
+
}
|
|
1262
|
+
});
|
|
1263
|
+
});
|
|
1661
1264
|
}
|
|
1662
|
-
|
|
1663
|
-
this.
|
|
1265
|
+
get value() {
|
|
1266
|
+
return this._value;
|
|
1664
1267
|
}
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
this.workflow.execute('delete-entity', {
|
|
1669
|
-
module: this.entity.module,
|
|
1670
|
-
entity: this.entity.name,
|
|
1671
|
-
ids: [this.data.id],
|
|
1672
|
-
});
|
|
1673
|
-
this.close();
|
|
1674
|
-
break;
|
|
1675
|
-
case 'details':
|
|
1676
|
-
this.workflow.execute('show-details', {
|
|
1677
|
-
payload: {
|
|
1678
|
-
module: this.entity.module,
|
|
1679
|
-
entity: this.entity.name,
|
|
1680
|
-
},
|
|
1681
|
-
id: this.data.id,
|
|
1682
|
-
});
|
|
1683
|
-
this.close();
|
|
1684
|
-
break;
|
|
1685
|
-
default:
|
|
1686
|
-
break;
|
|
1687
|
-
}
|
|
1268
|
+
set value(v) {
|
|
1269
|
+
this._value = v;
|
|
1270
|
+
this.valueChange.emit(v);
|
|
1688
1271
|
}
|
|
1689
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type:
|
|
1690
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
1272
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPListViewOptionFilterOperatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1273
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", type: AXPListViewOptionFilterOperatorComponent, selector: "axp-list-view-option-filter-operator", inputs: { items: "items", value: "value" }, outputs: { valueChange: "valueChange" }, host: { styleAttribute: "display: contents;" }, viewQueries: [{ propertyName: "selectBox", first: true, predicate: AXSelectBoxComponent, descendants: true }], ngImport: i0, template: `
|
|
1274
|
+
<ax-select-box
|
|
1275
|
+
valueField="name"
|
|
1276
|
+
[dataSource]="items"
|
|
1277
|
+
textField="title"
|
|
1278
|
+
[(ngModel)]="value"
|
|
1279
|
+
*ngIf="visible"
|
|
1280
|
+
>
|
|
1281
|
+
</ax-select-box>
|
|
1282
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { 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: "component", type: i10$1.AXSelectBoxComponent, selector: "ax-select-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "minValue", "maxValue", "value", "state", "name", "id", "type", "look", "multiple", "valueField", "textField", "textTemplate", "dataSource", "caption", "itemTemplate", "selectedTemplate", "emptyTemplate", "loadingTemplate", "dropdownWidth"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onOpened", "onClosed"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1691
1283
|
}
|
|
1692
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type:
|
|
1284
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPListViewOptionFilterOperatorComponent, decorators: [{
|
|
1693
1285
|
type: Component,
|
|
1694
|
-
args: [{
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1286
|
+
args: [{
|
|
1287
|
+
selector: 'axp-list-view-option-filter-operator',
|
|
1288
|
+
template: `
|
|
1289
|
+
<ax-select-box
|
|
1290
|
+
valueField="name"
|
|
1291
|
+
[dataSource]="items"
|
|
1292
|
+
textField="title"
|
|
1293
|
+
[(ngModel)]="value"
|
|
1294
|
+
*ngIf="visible"
|
|
1295
|
+
>
|
|
1296
|
+
</ax-select-box>
|
|
1297
|
+
`,
|
|
1298
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1299
|
+
host: { style: 'display: contents;' },
|
|
1300
|
+
}]
|
|
1301
|
+
}], propDecorators: { selectBox: [{
|
|
1302
|
+
type: ViewChild,
|
|
1303
|
+
args: [AXSelectBoxComponent]
|
|
1304
|
+
}], items: [{
|
|
1305
|
+
type: Input
|
|
1306
|
+
}], valueChange: [{
|
|
1307
|
+
type: Output
|
|
1308
|
+
}], value: [{
|
|
1309
|
+
type: Input
|
|
1310
|
+
}] } });
|
|
1701
1311
|
|
|
1702
|
-
class
|
|
1703
|
-
constructor(
|
|
1704
|
-
this.
|
|
1705
|
-
this.
|
|
1706
|
-
this.
|
|
1707
|
-
this.
|
|
1708
|
-
//****************** Properties ******************//
|
|
1709
|
-
this.getProp = (name) => this.entity.properties.find((c) => c.name == name);
|
|
1710
|
-
this._data = this.selectedData;
|
|
1711
|
-
this._currentSection = this.selectedSection;
|
|
1712
|
-
}
|
|
1713
|
-
get entity() {
|
|
1714
|
-
if (!this._config) {
|
|
1715
|
-
this._config = cloneDeep(this.config);
|
|
1716
|
-
}
|
|
1717
|
-
return this._config;
|
|
1312
|
+
class AXPListViewOptionSortingComponent {
|
|
1313
|
+
constructor() {
|
|
1314
|
+
this.isSM = false;
|
|
1315
|
+
this.onClosed = new EventEmitter();
|
|
1316
|
+
this.props$ = of([]);
|
|
1317
|
+
this.sorts$ = of([]);
|
|
1718
1318
|
}
|
|
1719
|
-
|
|
1720
|
-
|
|
1319
|
+
ngOnInit() {
|
|
1320
|
+
this.props$ = this.loader.properties$.pipe(map((sorts) => sorts.filter((s) => s.canSort != false)));
|
|
1321
|
+
this.loader.sorts$.subscribe((data) => { });
|
|
1322
|
+
this.sorts$ = this.loader.sorts$;
|
|
1721
1323
|
}
|
|
1722
|
-
|
|
1723
|
-
|
|
1324
|
+
drop(event) {
|
|
1325
|
+
this.sorts$.pipe(first()).subscribe((sorts) => {
|
|
1326
|
+
moveItemInArray(sorts, event.previousIndex, event.currentIndex);
|
|
1327
|
+
});
|
|
1724
1328
|
}
|
|
1725
|
-
|
|
1726
|
-
|
|
1329
|
+
changeItemSort(item) {
|
|
1330
|
+
item.dir = item.dir == 'asc' ? 'desc' : 'asc';
|
|
1727
1331
|
}
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
if (this._config.commands?.update) {
|
|
1731
|
-
const updated = await this._config.commands?.update(this._data.id, values);
|
|
1732
|
-
Object.assign(this._data, updated);
|
|
1733
|
-
return Promise.resolve();
|
|
1734
|
-
}
|
|
1735
|
-
else {
|
|
1736
|
-
return Promise.reject(`There is not any update commands for '${this.config.name}'`);
|
|
1737
|
-
}
|
|
1332
|
+
handleClose() {
|
|
1333
|
+
this.onClosed.emit();
|
|
1738
1334
|
}
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
constructor() {
|
|
1742
|
-
this.entityService = inject(AXPEntityRegistryService);
|
|
1743
|
-
this.layout = inject(AXPLayoutService);
|
|
1335
|
+
handleResetClick() {
|
|
1336
|
+
this.loader.resetSort();
|
|
1744
1337
|
}
|
|
1745
|
-
|
|
1746
|
-
this.
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
this.layout.setNavigationLoading(false);
|
|
1751
|
-
return new AXPEntityModifyLoaderDefault(config, data, section);
|
|
1752
|
-
}
|
|
1753
|
-
this.layout.setNavigationLoading(false);
|
|
1754
|
-
return Promise.reject('cannot fetch ');
|
|
1338
|
+
handleApplyClick() {
|
|
1339
|
+
this.sorts$.pipe(first()).subscribe((data) => {
|
|
1340
|
+
this.loader.updateSort(data);
|
|
1341
|
+
});
|
|
1342
|
+
this.onClosed.emit();
|
|
1755
1343
|
}
|
|
1756
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type:
|
|
1757
|
-
static { this.ɵ
|
|
1344
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPListViewOptionSortingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1345
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AXPListViewOptionSortingComponent, selector: "axp-list-view-option-sorting", inputs: { loader: "loader" }, outputs: { onClosed: "onClosed" }, ngImport: i0, template: "<ax-header class=\"ax-flex ax-items-center\">\n <h2 class=\"ax-text-xl ax-font-bold\">{{'entity.sort' | translate | async}}</h2>\n <ax-button (onClick)=\"handleClose()\" [look]=\"'blank'\">\n <ax-icon class=\"fa-solid fa-close ax-text-neutral-400 ax-text-xl\"> </ax-icon>\n </ax-button>\n</ax-header>\n<div class=\"ax-flex ax-p-4 ax-flex-col ax-justify-center ax-gap-4 ax-select-none\" [class.ax-h-[calc(100vh-310px)]]=\"!(sorts$ | async)?.length\">\n @if(!(sorts$ | async)?.length){\n <div class=\"ax-flex ax-flex-col ax-items-center ax-justify-center\">\n <ax-image src=\"assets/documents.svg\"></ax-image>\n <p class=\"ax-mt-6 ax-mb-1 ax-font-bold\">{{ 'entity.no-sort' | translate | async }}</p>\n <span class=\"ax-text-neutral-400 ax-text-sm md:ax-text-md\">{{ 'entity.ask-sort' | translate | async }}</span>\n </div>\n }\n <div\n cdkDropList\n (cdkDropListDropped)=\"drop($event)\"\n class=\"ax-flex ax-flex-col ax-gap-3 ax-w-full ax-sorted-list ax-py-1 ax-max-h-[calc(100vh-310px)] ax-overflow-auto\"\n >\n <ng-container *ngFor=\"let item of sorts$ | async\">\n <div class=\"ax-flex ax-gap-2 ax-items-center\" cdkDrag cdkDragBoundary=\".ax-sorted-list\">\n <ax-icon class=\"fa-solid fa-grip-dots-vertical ax-cursor-move\" cdkDragHandle></ax-icon>\n <ax-select-box [dataSource]=\"(props$ | async) ?? []\" valueField=\"name\" textField=\"title\" [(ngModel)]=\"item.name\"> </ax-select-box>\n <ax-button [color]=\"'default'\" class=\"ax-sm\" (click)=\"changeItemSort(item)\">\n <ax-icon [class.ax-text-primary]=\"item.dir == 'asc'\" class=\"fa-solid fa-arrow-up-long ax-text-neutral-400\"></ax-icon>\n <ax-icon [class.ax-text-primary]=\"item.dir == 'desc'\" class=\"fa-solid fa-arrow-down-long ax-text-neutral-400\"></ax-icon>\n </ax-button>\n\n <ax-button look=\"blank\" (onClick)=\"loader.removeSort(item)\">\n <ax-icon class=\"fa-solid fa-trash-can ax-text-danger-500\"></ax-icon>\n </ax-button>\n </div>\n </ng-container>\n </div>\n\n <div class=\"ax-flex ax-gap-2\">\n <div class=\"ax-w-full\" #addField>\n @if((sorts$ | async)?.length){\n <ax-button (onClick)=\"loader.addSort()\" color=\"primary\" [text]=\"'entity.add-field' | translate | async\" look=\"blank\" class=\"ax-sm\"></ax-button>\n }@else {\n <div class=\"ax-flex ax-justify-center ax-w-full\">\n <ax-button (onClick)=\"loader.addSort()\" color=\"primary\" [text]=\"'entity.add-field' | translate | async\" look=\"outline\" class=\"ax-md ax-w-56\"></ax-button>\n </div>\n }\n </div>\n </div>\n</div>\n<ax-footer class=\"!ax-justify-start ax-absolute ax-bottom-0 ax-w-full\">\n <ax-button [text]=\"'apply' | translate | async\" color=\"primary\" (onClick)=\"handleApplyClick()\"></ax-button>\n <ax-button [text]=\"'reset' | translate | async\" color=\"ghost\" (onClick)=\"handleResetClick()\"></ax-button>\n</ax-footer>\n", dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { 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: "component", type: i4.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "type", "responsiveOn", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "responsiveOnChange", "loadingTextChange"] }, { kind: "component", type: i4$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i4$1.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-sub-title, ax-placeholder, ax-overlay" }, { kind: "component", type: i7.AXImageComponent, selector: "ax-image", inputs: ["overlayMode", "src", "alt", "priority", "lazy"], outputs: ["onLoad", "onError"] }, { kind: "component", type: i10$1.AXSelectBoxComponent, selector: "ax-select-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "minValue", "maxValue", "value", "state", "name", "id", "type", "look", "multiple", "valueField", "textField", "textTemplate", "dataSource", "caption", "itemTemplate", "selectedTemplate", "emptyTemplate", "loadingTemplate", "dropdownWidth"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onOpened", "onClosed"] }, { kind: "directive", type: i15.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i15.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: i15.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i8.AXTranslatorPipe, name: "translate" }] }); }
|
|
1758
1346
|
}
|
|
1759
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type:
|
|
1760
|
-
type:
|
|
1761
|
-
args: [{
|
|
1762
|
-
}]
|
|
1347
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPListViewOptionSortingComponent, decorators: [{
|
|
1348
|
+
type: Component,
|
|
1349
|
+
args: [{ selector: 'axp-list-view-option-sorting', template: "<ax-header class=\"ax-flex ax-items-center\">\n <h2 class=\"ax-text-xl ax-font-bold\">{{'entity.sort' | translate | async}}</h2>\n <ax-button (onClick)=\"handleClose()\" [look]=\"'blank'\">\n <ax-icon class=\"fa-solid fa-close ax-text-neutral-400 ax-text-xl\"> </ax-icon>\n </ax-button>\n</ax-header>\n<div class=\"ax-flex ax-p-4 ax-flex-col ax-justify-center ax-gap-4 ax-select-none\" [class.ax-h-[calc(100vh-310px)]]=\"!(sorts$ | async)?.length\">\n @if(!(sorts$ | async)?.length){\n <div class=\"ax-flex ax-flex-col ax-items-center ax-justify-center\">\n <ax-image src=\"assets/documents.svg\"></ax-image>\n <p class=\"ax-mt-6 ax-mb-1 ax-font-bold\">{{ 'entity.no-sort' | translate | async }}</p>\n <span class=\"ax-text-neutral-400 ax-text-sm md:ax-text-md\">{{ 'entity.ask-sort' | translate | async }}</span>\n </div>\n }\n <div\n cdkDropList\n (cdkDropListDropped)=\"drop($event)\"\n class=\"ax-flex ax-flex-col ax-gap-3 ax-w-full ax-sorted-list ax-py-1 ax-max-h-[calc(100vh-310px)] ax-overflow-auto\"\n >\n <ng-container *ngFor=\"let item of sorts$ | async\">\n <div class=\"ax-flex ax-gap-2 ax-items-center\" cdkDrag cdkDragBoundary=\".ax-sorted-list\">\n <ax-icon class=\"fa-solid fa-grip-dots-vertical ax-cursor-move\" cdkDragHandle></ax-icon>\n <ax-select-box [dataSource]=\"(props$ | async) ?? []\" valueField=\"name\" textField=\"title\" [(ngModel)]=\"item.name\"> </ax-select-box>\n <ax-button [color]=\"'default'\" class=\"ax-sm\" (click)=\"changeItemSort(item)\">\n <ax-icon [class.ax-text-primary]=\"item.dir == 'asc'\" class=\"fa-solid fa-arrow-up-long ax-text-neutral-400\"></ax-icon>\n <ax-icon [class.ax-text-primary]=\"item.dir == 'desc'\" class=\"fa-solid fa-arrow-down-long ax-text-neutral-400\"></ax-icon>\n </ax-button>\n\n <ax-button look=\"blank\" (onClick)=\"loader.removeSort(item)\">\n <ax-icon class=\"fa-solid fa-trash-can ax-text-danger-500\"></ax-icon>\n </ax-button>\n </div>\n </ng-container>\n </div>\n\n <div class=\"ax-flex ax-gap-2\">\n <div class=\"ax-w-full\" #addField>\n @if((sorts$ | async)?.length){\n <ax-button (onClick)=\"loader.addSort()\" color=\"primary\" [text]=\"'entity.add-field' | translate | async\" look=\"blank\" class=\"ax-sm\"></ax-button>\n }@else {\n <div class=\"ax-flex ax-justify-center ax-w-full\">\n <ax-button (onClick)=\"loader.addSort()\" color=\"primary\" [text]=\"'entity.add-field' | translate | async\" look=\"outline\" class=\"ax-md ax-w-56\"></ax-button>\n </div>\n }\n </div>\n </div>\n</div>\n<ax-footer class=\"!ax-justify-start ax-absolute ax-bottom-0 ax-w-full\">\n <ax-button [text]=\"'apply' | translate | async\" color=\"primary\" (onClick)=\"handleApplyClick()\"></ax-button>\n <ax-button [text]=\"'reset' | translate | async\" color=\"ghost\" (onClick)=\"handleResetClick()\"></ax-button>\n</ax-footer>\n" }]
|
|
1350
|
+
}], propDecorators: { onClosed: [{
|
|
1351
|
+
type: Output
|
|
1352
|
+
}], loader: [{
|
|
1353
|
+
type: Input
|
|
1354
|
+
}] } });
|
|
1763
1355
|
|
|
1764
|
-
const
|
|
1765
|
-
class
|
|
1356
|
+
const AXPImportEntityEvent = createWorkFlowEvent('[Entity] Imported!');
|
|
1357
|
+
class AXPEntityImportPopupAction extends AXPWorkflowAction {
|
|
1766
1358
|
constructor() {
|
|
1767
1359
|
super(...arguments);
|
|
1360
|
+
this.entityRegistery = inject(AXPEntityRegistryService);
|
|
1768
1361
|
this.popupService = inject(AXPopupService);
|
|
1769
1362
|
this.platform = inject(AXPlatform);
|
|
1770
|
-
this.entityRegistery = inject(AXPEntityRegistryService);
|
|
1771
|
-
this.entityCreateFactory = inject(AXPEntityModifyViewLoaderFactory);
|
|
1772
1363
|
}
|
|
1773
1364
|
async execute(context) {
|
|
1774
|
-
const
|
|
1775
|
-
const { module, entity: entityName, section, id } = payload;
|
|
1365
|
+
const { module, entity: entityName } = context.getVariable('payload');
|
|
1776
1366
|
const entity = await this.entityRegistery.resolve(module, entityName);
|
|
1777
|
-
const
|
|
1778
|
-
const
|
|
1779
|
-
|
|
1780
|
-
title: `Modify ${payload.section.title}`,
|
|
1367
|
+
const com = await import('./acorex-platform-layouts-entity-import-view.component-CZpEcVi9.mjs');
|
|
1368
|
+
const result = await this.popupService.open(com.AXPEntityImportViewComponent, {
|
|
1369
|
+
title: `Import ${entity.title}`,
|
|
1781
1370
|
size: this.platform.is('Mobile') || this.platform.is('SM') ? 'full' : 'md',
|
|
1782
1371
|
data: {
|
|
1783
|
-
context: loader.data,
|
|
1784
|
-
loader: loader,
|
|
1785
|
-
properties: payload.section.properties,
|
|
1786
1372
|
entity,
|
|
1787
1373
|
},
|
|
1788
1374
|
});
|
|
1789
|
-
|
|
1790
|
-
if (popup.data?.result == true) {
|
|
1375
|
+
if (result.data?.save) {
|
|
1791
1376
|
context.setOutput('popupResult', true);
|
|
1792
|
-
context.setVariable('
|
|
1377
|
+
context.setVariable('redirect', result.data.redirect);
|
|
1793
1378
|
}
|
|
1794
1379
|
}
|
|
1795
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type:
|
|
1796
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type:
|
|
1380
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPEntityImportPopupAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1381
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPEntityImportPopupAction }); }
|
|
1797
1382
|
}
|
|
1798
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type:
|
|
1383
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPEntityImportPopupAction, decorators: [{
|
|
1799
1384
|
type: Injectable
|
|
1800
1385
|
}] });
|
|
1801
|
-
class
|
|
1802
|
-
constructor() {
|
|
1803
|
-
super(...arguments);
|
|
1804
|
-
this.entityRegistery = inject(AXPEntityRegistryService);
|
|
1805
|
-
}
|
|
1386
|
+
class AXPEntityImportSubmittedAction extends AXPWorkflowAction {
|
|
1806
1387
|
async execute(context) {
|
|
1807
|
-
const
|
|
1808
|
-
|
|
1809
|
-
const entity = await this.entityRegistery.resolve(payload.module, payload.entity);
|
|
1810
|
-
this.dispatch(AXPEntityModifyEvent({ module: entity.module, entity: entity.name, updateValues: updatedData }));
|
|
1388
|
+
const { module, entity: entity } = context.getVariable('payload');
|
|
1389
|
+
this.dispatch(AXPImportEntityEvent({ entity, module }));
|
|
1811
1390
|
}
|
|
1812
1391
|
}
|
|
1813
|
-
const
|
|
1814
|
-
startStepId: '
|
|
1392
|
+
const AXPImportEntityWorkflow = {
|
|
1393
|
+
startStepId: 'createPopup',
|
|
1815
1394
|
steps: {
|
|
1816
|
-
|
|
1817
|
-
id: '
|
|
1818
|
-
action: '
|
|
1395
|
+
createPopup: {
|
|
1396
|
+
id: 'createPopup',
|
|
1397
|
+
action: 'AXPEntityImportPopupAction',
|
|
1819
1398
|
nextSteps: [
|
|
1820
1399
|
{
|
|
1821
1400
|
conditions: [{ type: 'SINGLE', expression: 'context.getOutput("popupResult") == true' }],
|
|
@@ -1828,208 +1407,182 @@ const AXPModifyEntityWorkflow = {
|
|
|
1828
1407
|
action: 'AXPToastAction',
|
|
1829
1408
|
input: {
|
|
1830
1409
|
color: 'success',
|
|
1831
|
-
title: 'Entity
|
|
1832
|
-
content: '
|
|
1410
|
+
title: 'Entity Imported',
|
|
1411
|
+
content: 'Your file has been uploaded successfully',
|
|
1833
1412
|
},
|
|
1834
1413
|
nextSteps: [
|
|
1835
1414
|
{
|
|
1836
1415
|
conditions: [],
|
|
1837
|
-
nextStepId: '
|
|
1838
|
-
},
|
|
1839
|
-
],
|
|
1840
|
-
},
|
|
1841
|
-
modifyConfirmed: {
|
|
1842
|
-
id: 'modifyConfirmed',
|
|
1843
|
-
action: 'AXPEntityModifyConfirmedAction',
|
|
1844
|
-
nextSteps: [
|
|
1845
|
-
{
|
|
1846
|
-
conditions: [],
|
|
1847
|
-
nextStepId: '',
|
|
1416
|
+
nextStepId: 'importSubmitted',
|
|
1848
1417
|
},
|
|
1849
1418
|
],
|
|
1850
1419
|
},
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
class AXPShowQuickViewAction extends AXPWorkflowAction {
|
|
1855
|
-
constructor() {
|
|
1856
|
-
super(...arguments);
|
|
1857
|
-
this.entityRegistery = inject(AXPEntityRegistryService);
|
|
1858
|
-
this.formatService = inject(AXFormatService);
|
|
1859
|
-
this.popupService = inject(AXPopupService);
|
|
1860
|
-
this.platform = inject(AXPlatform);
|
|
1861
|
-
}
|
|
1862
|
-
async execute(context) {
|
|
1863
|
-
const payload = context.getVariable('payload');
|
|
1864
|
-
const entity = await this.entityRegistery.resolve(payload.module, payload.entity);
|
|
1865
|
-
const suggestedProps = entity.properties.find((c) => ['title', 'name', 'code'].includes(c.name));
|
|
1866
|
-
let suggestedFormat = 'Item #{{id}}';
|
|
1867
|
-
if (suggestedProps)
|
|
1868
|
-
suggestedFormat = `{{${suggestedProps.name}}}`;
|
|
1869
|
-
const title = this.formatService.format(entity.formats?.header ?? entity.formats?.default ?? suggestedFormat, 'string', payload.data);
|
|
1870
|
-
//
|
|
1871
|
-
const com = await Promise.resolve().then(function () { return entityQuickView_component; });
|
|
1872
|
-
this.popupService.open(com.AXPEntityQuickViewComponent, {
|
|
1873
|
-
title: `${title} - Quick View`,
|
|
1874
|
-
size: this.platform.is('Mobile') || this.platform.is('SM') ? 'full' : 'md',
|
|
1875
|
-
data: {
|
|
1876
|
-
entity: entity,
|
|
1877
|
-
data: payload.data,
|
|
1878
|
-
},
|
|
1879
|
-
});
|
|
1880
|
-
}
|
|
1881
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPShowQuickViewAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1882
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPShowQuickViewAction }); }
|
|
1883
|
-
}
|
|
1884
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPShowQuickViewAction, decorators: [{
|
|
1885
|
-
type: Injectable
|
|
1886
|
-
}] });
|
|
1887
|
-
const AXPShowQuickViewWorkflow = {
|
|
1888
|
-
startStepId: 'showQuickView',
|
|
1889
|
-
steps: {
|
|
1890
|
-
showQuickView: {
|
|
1891
|
-
id: 'showQuickView',
|
|
1892
|
-
action: 'AXPShowQuickViewAction',
|
|
1893
|
-
},
|
|
1894
|
-
},
|
|
1895
|
-
};
|
|
1896
|
-
|
|
1897
|
-
class AXPShowDetailViewAction extends AXPWorkflowAction {
|
|
1898
|
-
constructor() {
|
|
1899
|
-
super(...arguments);
|
|
1900
|
-
this.navigation = inject(AXPWorkflowNavigateAction);
|
|
1901
|
-
this.sessionService = inject(AXPSessionService);
|
|
1902
|
-
}
|
|
1903
|
-
async execute(context) {
|
|
1904
|
-
const payload = context.getVariable('payload');
|
|
1905
|
-
const id = context.getVariable('id');
|
|
1906
|
-
const newPayload = {
|
|
1907
|
-
commands: `/${this.sessionService.application?.name}/${payload.module}/e/${payload.entity}/${id}/view`,
|
|
1908
|
-
};
|
|
1909
|
-
context.setVariable('payload', newPayload);
|
|
1910
|
-
this.navigation.execute(context);
|
|
1911
|
-
}
|
|
1912
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPShowDetailViewAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1913
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPShowDetailViewAction }); }
|
|
1914
|
-
}
|
|
1915
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPShowDetailViewAction, decorators: [{
|
|
1916
|
-
type: Injectable
|
|
1917
|
-
}] });
|
|
1918
|
-
const AXPShowDetailsViewWorkflow = {
|
|
1919
|
-
startStepId: 'showDetailView',
|
|
1920
|
-
steps: {
|
|
1921
|
-
showDetailView: {
|
|
1922
|
-
id: 'showDetailView',
|
|
1923
|
-
action: 'AXPShowDetailViewAction',
|
|
1924
|
-
},
|
|
1925
|
-
},
|
|
1926
|
-
};
|
|
1927
|
-
|
|
1928
|
-
class AXPShowListViewAction extends AXPWorkflowAction {
|
|
1929
|
-
constructor() {
|
|
1930
|
-
super(...arguments);
|
|
1931
|
-
this.navigation = inject(AXPWorkflowNavigateAction);
|
|
1932
|
-
this.sessionService = inject(AXPSessionService);
|
|
1933
|
-
}
|
|
1934
|
-
async execute(context) {
|
|
1935
|
-
const payload = context.getVariable('payload');
|
|
1936
|
-
const newPayload = {
|
|
1937
|
-
commands: `/${this.sessionService.application?.name}/${payload.entity.module}/e/${payload.entity}/list`,
|
|
1938
|
-
};
|
|
1939
|
-
context.setVariable('payload', newPayload);
|
|
1940
|
-
this.navigation.execute(context);
|
|
1941
|
-
}
|
|
1942
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPShowListViewAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1943
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPShowListViewAction }); }
|
|
1944
|
-
}
|
|
1945
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPShowListViewAction, decorators: [{
|
|
1946
|
-
type: Injectable
|
|
1947
|
-
}] });
|
|
1948
|
-
const AXPShowListViewWorkflow = {
|
|
1949
|
-
startStepId: 'showListView',
|
|
1950
|
-
steps: {
|
|
1951
|
-
showListView: {
|
|
1952
|
-
id: 'showListView',
|
|
1953
|
-
action: 'AXPShowListViewAction',
|
|
1420
|
+
importSubmitted: {
|
|
1421
|
+
id: 'importSubmitted',
|
|
1422
|
+
action: 'AXPEntityImportSubmittedAction',
|
|
1954
1423
|
},
|
|
1955
1424
|
},
|
|
1956
1425
|
};
|
|
1957
1426
|
|
|
1958
|
-
class
|
|
1959
|
-
constructor(
|
|
1960
|
-
this.
|
|
1427
|
+
class AXPEntityListViewComponent {
|
|
1428
|
+
constructor(actionSheetService, unsubscriber, platform, cdr) {
|
|
1429
|
+
this.actionSheetService = actionSheetService;
|
|
1961
1430
|
this.unsubscriber = unsubscriber;
|
|
1962
|
-
this.
|
|
1963
|
-
this.
|
|
1964
|
-
this.activeRoute = inject(ActivatedRoute);
|
|
1965
|
-
this.router = inject(Router);
|
|
1966
|
-
this.location = inject(Location);
|
|
1967
|
-
this.cdr = inject(ChangeDetectorRef);
|
|
1968
|
-
this.platform = inject(AXPlatform);
|
|
1969
|
-
this.workflow = inject(AXPWorkflowService);
|
|
1970
|
-
this.loader = this.activeRoute.snapshot.data['loader'];
|
|
1431
|
+
this.platform = platform;
|
|
1432
|
+
this.cdr = cdr;
|
|
1971
1433
|
this.store = inject((Store));
|
|
1972
|
-
this.
|
|
1973
|
-
this.
|
|
1434
|
+
this.workflow = inject(AXPWorkflowService);
|
|
1435
|
+
this.layout = inject(AXPLayoutService);
|
|
1436
|
+
this.route = inject(ActivatedRoute);
|
|
1437
|
+
this.manuLoader = inject(AXP_MENU_LOADER);
|
|
1438
|
+
this.loader = this.route.snapshot.data['loader'];
|
|
1439
|
+
this.title = '';
|
|
1440
|
+
this.searchValue = '';
|
|
1441
|
+
this.searchBoxPlaceholder = '';
|
|
1442
|
+
this.searchBoxTitle = '';
|
|
1443
|
+
this.searchBoxCollapsed = true;
|
|
1444
|
+
this.publicViews$ = this.loader.publicViews$;
|
|
1445
|
+
this.customViews$ = this.loader.customViews$;
|
|
1446
|
+
this.hasCustomViews$ = this.loader.hasCustomViews$;
|
|
1447
|
+
this.view$ = this.loader.view$;
|
|
1448
|
+
//
|
|
1449
|
+
this.conditions$ = this.loader.conditions$;
|
|
1450
|
+
this.conditionsCount$ = this.loader.conditionsCount$;
|
|
1451
|
+
//
|
|
1452
|
+
this.columns$ = this.loader.displayColumns$;
|
|
1453
|
+
this.columnsCount$ = this.loader.displayColumnsCount$;
|
|
1454
|
+
//
|
|
1455
|
+
this.sort$ = this.loader.sorts$;
|
|
1456
|
+
this.sortCount$ = this.loader.sortsCount$;
|
|
1457
|
+
//
|
|
1458
|
+
this.dataSource = this.loader.dataSource;
|
|
1974
1459
|
//
|
|
1975
1460
|
this.canDelete = this.loader.entity.editOptions?.delete ?? true;
|
|
1976
1461
|
this.canCreate = this.loader.entity.editOptions?.create ?? true;
|
|
1977
1462
|
this.canUpdate = this.loader.entity.editOptions?.update ?? true;
|
|
1463
|
+
this.canImport = this.loader.entity.editOptions?.import ?? false;
|
|
1464
|
+
this.popupService = inject(AXPopupService);
|
|
1465
|
+
this.dropdownRowItems = [
|
|
1466
|
+
{
|
|
1467
|
+
text: 'Details',
|
|
1468
|
+
icon: 'fa-solid fa-eye',
|
|
1469
|
+
name: 'edit',
|
|
1470
|
+
divided: true,
|
|
1471
|
+
},
|
|
1472
|
+
{
|
|
1473
|
+
text: 'Delete',
|
|
1474
|
+
icon: 'fa-solid fa-trash-can',
|
|
1475
|
+
name: 'delete',
|
|
1476
|
+
color: 'danger',
|
|
1477
|
+
disabled: !this.canDelete,
|
|
1478
|
+
},
|
|
1479
|
+
];
|
|
1480
|
+
this.inlineRowItems = [
|
|
1481
|
+
{
|
|
1482
|
+
text: 'View',
|
|
1483
|
+
icon: 'fa-solid fa-eye',
|
|
1484
|
+
name: 'view',
|
|
1485
|
+
divided: true,
|
|
1486
|
+
},
|
|
1487
|
+
];
|
|
1488
|
+
this.getDropdownRowItems = (rowData) => {
|
|
1489
|
+
return Promise.resolve(this.dropdownRowItems);
|
|
1490
|
+
};
|
|
1491
|
+
this.getInlineRowItems = (rowData) => {
|
|
1492
|
+
return this.inlineRowItems;
|
|
1493
|
+
};
|
|
1494
|
+
//TODO: namespace, module name issues
|
|
1495
|
+
this.title = this.manuLoader.currentMenuItem()?.text ?? this.loader.entity.formats?.list ?? this.loader.entity.formats?.default ?? 'Title';
|
|
1978
1496
|
//
|
|
1979
|
-
this.
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
if (event.payload.entity == this.loader.entity.name &&
|
|
1986
|
-
event.payload.module == this.loader.entity.module &&
|
|
1987
|
-
event.payload.id.includes(this.loader.data.id)) {
|
|
1988
|
-
this.workflow.execute('show-list-view', {
|
|
1989
|
-
payload: {
|
|
1990
|
-
module: this.loader.entity.module,
|
|
1991
|
-
entity: this.loader.entity.name,
|
|
1992
|
-
},
|
|
1993
|
-
});
|
|
1497
|
+
this.workflow.events$
|
|
1498
|
+
.pipe(ofType$1(AXPEntityDeletedEvent, AXPEntityCreateEvent, AXPImportEntityEvent), this.unsubscriber.takeUntilDestroy)
|
|
1499
|
+
.subscribe((event) => {
|
|
1500
|
+
if (event.payload.entity == this.loader.entity.name && event.payload.module == this.loader.entity.module) {
|
|
1501
|
+
this.grid.selectedRows = [];
|
|
1502
|
+
this.grid?.refresh();
|
|
1994
1503
|
}
|
|
1995
1504
|
});
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
event.payload.updateValues.id === this.loader.data.id) {
|
|
2000
|
-
await this.loader.update(event.payload.updateValues);
|
|
2001
|
-
this.context.set(cloneDeep(this.loader.data));
|
|
2002
|
-
}
|
|
1505
|
+
//
|
|
1506
|
+
this.dataSource.onLoadingChanged.pipe(this.unsubscriber.takeUntilDestroy).subscribe((value) => {
|
|
1507
|
+
this.layout.setNavigationLoading(value);
|
|
2003
1508
|
});
|
|
1509
|
+
this._getInlineConditionTitles();
|
|
2004
1510
|
}
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
const path = `/${this.sessionService.application?.name}/${entity.module}/e/${entity.name}/${this.loader.data?.id}/view/${item.name}`;
|
|
2008
|
-
this.location.go(path);
|
|
2009
|
-
this.setSection(item.name);
|
|
1511
|
+
ngAfterViewInit() {
|
|
1512
|
+
this.loader.setDefaultView();
|
|
2010
1513
|
}
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
1514
|
+
_getInlineConditionTitles() {
|
|
1515
|
+
const titles = this.loader.getInlineFilterTitles();
|
|
1516
|
+
this.searchBoxTitle = titles.join(', ');
|
|
1517
|
+
if (titles.length > 2)
|
|
1518
|
+
this.searchBoxPlaceholder = titles.slice(0, 2).join(', ') + ' ...';
|
|
1519
|
+
else
|
|
1520
|
+
this.searchBoxPlaceholder = titles.join(', ');
|
|
1521
|
+
}
|
|
1522
|
+
_handleViewsPopover() {
|
|
1523
|
+
this.actionSheetService.open({ content: this.viewsTemplate });
|
|
2014
1524
|
}
|
|
2015
1525
|
handleDrawerClick() {
|
|
2016
1526
|
this.store.dispatch(AXPLayoutChildDrawerToggle());
|
|
2017
1527
|
}
|
|
2018
|
-
|
|
2019
|
-
this.
|
|
1528
|
+
toggleSearchBox() {
|
|
1529
|
+
this.searchBoxCollapsed = !this.searchBoxCollapsed;
|
|
2020
1530
|
}
|
|
2021
|
-
|
|
2022
|
-
|
|
1531
|
+
handleRowDbClick(e) {
|
|
1532
|
+
const d = {
|
|
1533
|
+
component: e.component,
|
|
1534
|
+
name: this.dropdownRowItems[0].name,
|
|
1535
|
+
data: e.data,
|
|
1536
|
+
};
|
|
1537
|
+
this.handleRowCommandClick(d);
|
|
1538
|
+
}
|
|
1539
|
+
async handleRowCommandClick(e) {
|
|
1540
|
+
switch (e.name) {
|
|
1541
|
+
case 'view': {
|
|
1542
|
+
await this.workflow.execute('show-quick-view', {
|
|
1543
|
+
payload: {
|
|
1544
|
+
module: this.loader.entity.module,
|
|
1545
|
+
entity: this.loader.entity.name,
|
|
1546
|
+
data: e.data,
|
|
1547
|
+
},
|
|
1548
|
+
});
|
|
1549
|
+
break;
|
|
1550
|
+
}
|
|
1551
|
+
case 'edit': {
|
|
1552
|
+
await this.workflow.execute('show-details', {
|
|
1553
|
+
payload: {
|
|
1554
|
+
module: this.loader.entity.module,
|
|
1555
|
+
entity: this.loader.entity.name,
|
|
1556
|
+
},
|
|
1557
|
+
id: e.data.id,
|
|
1558
|
+
});
|
|
1559
|
+
break;
|
|
1560
|
+
}
|
|
1561
|
+
case 'delete': {
|
|
1562
|
+
await this.workflow.execute('delete-entity', {
|
|
1563
|
+
module: this.loader.entity.module,
|
|
1564
|
+
entity: this.loader.entity.name,
|
|
1565
|
+
ids: [e.data.id],
|
|
1566
|
+
});
|
|
1567
|
+
break;
|
|
1568
|
+
}
|
|
1569
|
+
}
|
|
1570
|
+
}
|
|
1571
|
+
handleCreateClick() {
|
|
1572
|
+
this.workflow.execute('create-entity', {
|
|
2023
1573
|
payload: {
|
|
2024
1574
|
module: this.loader.entity.module,
|
|
2025
1575
|
entity: this.loader.entity.name,
|
|
2026
|
-
id: this.loader.data.id,
|
|
2027
|
-
section: section,
|
|
2028
1576
|
},
|
|
2029
1577
|
});
|
|
2030
1578
|
}
|
|
2031
|
-
|
|
2032
|
-
|
|
1579
|
+
handleImportClick() {
|
|
1580
|
+
this.workflow.execute('import-entity', {
|
|
1581
|
+
payload: {
|
|
1582
|
+
module: this.loader.entity.module,
|
|
1583
|
+
entity: this.loader.entity.name,
|
|
1584
|
+
},
|
|
1585
|
+
});
|
|
2033
1586
|
}
|
|
2034
1587
|
handleCommandClick(command) {
|
|
2035
1588
|
switch (command) {
|
|
@@ -2037,179 +1590,626 @@ class AXPEntityDetailsViewComponent {
|
|
|
2037
1590
|
this.workflow.execute('delete-entity', {
|
|
2038
1591
|
module: this.loader.entity.module,
|
|
2039
1592
|
entity: this.loader.entity.name,
|
|
2040
|
-
ids:
|
|
2041
|
-
});
|
|
2042
|
-
break;
|
|
2043
|
-
case 'create': {
|
|
2044
|
-
this.workflow.execute('create-entity', {
|
|
2045
|
-
payload: {
|
|
2046
|
-
module: this.loader.entity.module,
|
|
2047
|
-
entity: this.loader.entity.name,
|
|
2048
|
-
},
|
|
1593
|
+
ids: this.grid.selectedRows.map((c) => c['id']),
|
|
2049
1594
|
});
|
|
2050
1595
|
break;
|
|
2051
|
-
}
|
|
2052
1596
|
default:
|
|
2053
1597
|
break;
|
|
2054
1598
|
}
|
|
2055
1599
|
}
|
|
2056
|
-
|
|
2057
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AXPEntityDetailsViewComponent, isStandalone: true, selector: "ng-component", providers: [AXUnsubscriber], viewQueries: [{ propertyName: "drawer", first: true, predicate: ["drawer"], descendants: true }], ngImport: i0, template: "<ax-drawer-container>\n <!-- <ax-drawer #drawer location=\"start\" [collapsed]=\"!(isOpen | async)\" [mode]=\" (isSM | async) ? 'overlay' : 'push'\"\n *ngIf=\"loader.hasSections$ | async\" (collapsedChange)=\"handleCollapsedChange($event)\">\n <ax-content class=\"ax-border-e ax-p-6 ax-w-64\">\n <p class=\"ax-text-xl ax-font-bold ax-mb-6\">{{loader.sectionTitle}}</p>\n <ax-tabs look=\"with-line\" location=\"start\">\n @for(tab of (loader.sections$ | async); track tab.name)\n {\n <ax-tab-item [text]=\"tab.title\" [active]=\"isActive(tab)\" (onClick)=\"handleMenuClick($event,tab)\"\n [disabled]=\"editForm.context\">\n </ax-tab-item>\n }\n </ax-tabs>\n </ax-content>\n </ax-drawer> -->\n <ax-content #content class=\"ax-overflow-x-hidden\">\n <div class=\"ax-flex ax-flex-col ax-gap-4 ax-min-h-full ax-px-4 ax-pb-4 md:ax-px-6 ax-bg-surface ax-border-b md:ax-border-0 md:ax-bg-default\">\n <div\n class=\"ax-flex ax-flex-col ax-pt-4 ax-sticky ax-top-0 ax-z-10 ax-transition-all\"\n #sticky=\"axpSticky\"\n [axpSticky]=\"'ax-bg-surface ax-px-6 ax-py-3 -ax-mx-6 ax-shadow-xl'\"\n [stickyParent]=\"content.getHostElement()\"\n >\n <!-------- Begin Toolbar -------->\n <div class=\"ax-flex ax-justify-between ax-items-center\">\n <!-------- Begin Title -------->\n <div class=\"ax-flex ax-gap-1 ax-items-center\">\n <!-- <ax-button class=\"lg:ax-hidden\">\n <ax-icon class=\"fa-solid fa-chevron-left\"></ax-icon>\n </ax-button> -->\n <div class=\"ax-flex ax-flex-col ax-gap-2\">\n <div class=\"ax-text-xl md:ax-text-3xl ax-font-bold\">{{ loader.title }}</div>\n <!-- <ax-breadcrumbs class=\"child:ax-font-normal child:ax-text-neutral-400\">\n <ng-template #divider>\n <i class=\"fa-solid fa-chevron-right ax-text-xs ax-mx-2\"></i>\n </ng-template>\n <ax-breadcrumbs-item>\n <a>Home</a>\n </ax-breadcrumbs-item>\n <ax-breadcrumbs-item>\n <a>{{ loader.entity.title }}</a>\n </ax-breadcrumbs-item>\n <ax-breadcrumbs-item [active]=\"true\" class=\"!ax-font-semibold !ax-text-neutral-600\">\n {{ loader.title }}\n </ax-breadcrumbs-item>\n </ax-breadcrumbs> -->\n </div>\n </div>\n <!-------- Finish Title -------->\n <!--------------------------------------------------------------->\n <!-- Begin Action Menu -->\n <div class=\"ax-flex ax-items-center ax-gap-3\">\n @if(canCreate || canUpdate) {\n <ax-button [text]=\"(isSM | async) ? null : 'Actions'\" color=\"ghost\">\n <ax-prefix>\n <i class=\"fa-solid fa-ellipsis-vertical\"></i>\n </ax-prefix>\n <ax-dropdown-panel>\n <ax-button-item-list>\n <!-- <ax-button-item text=\"Share\" class=\"ax-font-semibold\">\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-share\"> </ax-icon>\n </ax-prefix>\n </ax-button-item> \n <ax-divider></ax-divider>-->\n @if(canCreate) {\n <ax-button-item\n [text]=\"('create-new' | translate | async) ?? ' '\"\n class=\"ax-font-semibold ax-text-primary\"\n (onClick)=\"handleCommandClick('create')\"\n >\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-add\"> </ax-icon>\n </ax-prefix>\n </ax-button-item>\n } @if(canDelete) {\n <ax-button-item text=\"Delete\" class=\"ax-font-semibold ax-text-danger\" (onClick)=\"handleCommandClick('delete')\">\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-trash\"> </ax-icon>\n </ax-prefix>\n </ax-button-item>\n }\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n }\n </div>\n <!-- Finish Action Menu -->\n </div>\n <!----- Finish Toolbar ----->\n <!--------------------------------------------------------------->\n <!-- Begin Section Tab Items -->\n @if((loader.hasSections$| async)) {\n <ax-tabs look=\"with-line\" location=\"bottom\" class=\"ax-mt-2\">\n @for(tab of (loader.sections$ | async); track tab.name) {\n <ax-tab-item [text]=\"tab.title\" [active]=\"isActive(tab)\" (onClick)=\"handleMenuClick($event, tab)\" class=\"first:!ax-ms-0\"> </ax-tab-item>\n }\n </ax-tabs>\n }\n <!-- Finish Section Tab Items -->\n </div>\n @for(section of (loader.section$ | async)?.sections; track section.name) {\n <ax-form #form>\n <div class=\"ax-card ax-shadow-md\">\n <div class=\"ax-card-header\">\n <p>{{ section.title }}</p>\n @if(canUpdate) {\n <ax-button text=\"{{ 'entity.modify' | translate | async }}\" class=\"ax-sm\" color=\"primary\" (onClick)=\"handleSectionEdit(section)\">\n <ax-icon class=\"fa-solid fa-pen\"> </ax-icon>\n </ax-button>\n }\n </div>\n <div class=\"ax-card-body ax-divide-y ax-divide-gray-100 dark:ax-divide-gray-700 !ax-gap-0\">\n <ng-container *ngFor=\"let name of section.properties\">\n <ng-container *ngIf=\"loader.getProp(name) as prop\">\n <div class=\"ax-grid md:ax-grid-cols-12 ax-gap-2 ax-py-4 first:ax-pt-0 last:ax-pb-0\">\n @if(section.options?.showPropTitle!=false){\n <div class=\"ax-col-span-12 md:ax-col-span-3 lg:ax-col-span-2 ax-flex ax-items-center md:ax-items-start ax-justify-between\">\n <div class=\"ax-flex ax-flex-col ax-items-start\">\n <span class=\"ax-font-semibold\">{{ prop.title }}</span>\n <!-- @if(prop.description) {\n <i\n class=\"fa-solid fa-circle-info fa-sm ax-text-neutral-500 dark:ax-text-neutral-400 ax-cursor-pointer\"\n [axTooltip]=\"prop.description\"\n [axTooltipPlacement]=\"'end'\"\n ></i>\n } -->\n @if(prop.description) {\n <span class=\"ax-text-neutral-500 ax-text-xs\">{{ prop.description }}</span>\n }\n </div>\n </div>\n }\n <div [class]=\"section.options?.showPropTitle == false ? 'ax-col-span-12' : 'ax-col-span-12 md:ax-col-span-9 lg:ax-col-span-10'\">\n <axp-widget-renderer [schema]=\"prop.schema\" [context]=\"context()\" [prop]=\"prop\" [mode]=\"'view'\"></axp-widget-renderer>\n </div>\n </div>\n </ng-container>\n </ng-container>\n </div>\n </div>\n </ax-form>\n }\n </div>\n </ax-content>\n</ax-drawer-container>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: RouterModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i4.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "type", "responsiveOn", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "responsiveOnChange", "loadingTextChange"] }, { kind: "component", type: i4.AXButtonItemComponent, selector: "ax-button-item", inputs: ["color", "disabled", "text", "selected", "divided", "data", "name"], outputs: ["onClick", "onFocus", "onBlur", "disabledChange"] }, { kind: "component", type: i4.AXButtonItemListComponent, selector: "ax-button-item-list", inputs: ["items"], outputs: ["onItemClick"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i4$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i4$1.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-sub-title, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXBadgeModule }, { kind: "ngmodule", type: AXDropdownModule }, { kind: "component", type: i10$2.AXDropdownPanelComponent, selector: "ax-dropdown-panel", inputs: ["isOpen", "fitParent", "dropdownWidth", "position", "_target", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "ngmodule", type: AXPopoverModule }, { kind: "ngmodule", type: AXFormModule }, { kind: "component", type: i2$1.AXFormComponent, selector: "ax-form", inputs: ["labelMode", "messageStyle", "updateOn"], outputs: ["onValidate", "updateOnChange"] }, { kind: "ngmodule", type: AXImageModule }, { kind: "ngmodule", type: AXActionSheetModule }, { kind: "ngmodule", type: AXSwitchModule }, { kind: "ngmodule", type: AXDrawerModule }, { kind: "component", type: i11$1.AXDrawerContainerComponent, selector: "ax-drawer-container" }, { kind: "ngmodule", type: AXDialogModule }, { kind: "ngmodule", type: AXLoadingModule }, { kind: "ngmodule", type: AXTabsModule }, { kind: "component", type: i9.AXTabsComponent, selector: "ax-tabs", inputs: ["look", "location", "fitParent", "minWidth", "content"], outputs: ["onActiveTabChanged"] }, { kind: "component", type: i9.AXTabItemComponent, selector: "ax-tab-item", inputs: ["disabled", "text", "key", "headerTemplate", "active"], outputs: ["disabledChange", "onClick", "onBlur", "onFocus", "activeChange"] }, { kind: "ngmodule", type: AXPSchemaModule }, { kind: "component", type: i10$1.AXPWidgetRendererComponent, selector: "axp-widget-renderer", inputs: ["context", "prop", "mode", "schema"] }, { kind: "ngmodule", type: AXTooltipModule }, { kind: "ngmodule", type: AXBreadcrumbsModule }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "pipe", type: i8$1.AXTranslatorPipe, name: "translate" }, { kind: "ngmodule", type:
|
|
2058
|
-
|
|
2059
|
-
|
|
1600
|
+
clearSelectedItems() {
|
|
1601
|
+
this.grid.selectedRows = [];
|
|
1602
|
+
}
|
|
1603
|
+
closeDrawer(name, collapsed) {
|
|
1604
|
+
if (collapsed != false) {
|
|
1605
|
+
switch (name) {
|
|
1606
|
+
case 'conditions':
|
|
1607
|
+
this.loader.resetConditions();
|
|
1608
|
+
break;
|
|
1609
|
+
case 'columns':
|
|
1610
|
+
this.loader.resetColumns();
|
|
1611
|
+
break;
|
|
1612
|
+
case 'sorts':
|
|
1613
|
+
this.loader.resetSort();
|
|
1614
|
+
break;
|
|
1615
|
+
default:
|
|
1616
|
+
break;
|
|
1617
|
+
}
|
|
1618
|
+
}
|
|
1619
|
+
}
|
|
1620
|
+
handleChangeSearchValue(e) {
|
|
1621
|
+
if (e.isUserInteraction) {
|
|
1622
|
+
this.loader.handleInlineSearch(e.value);
|
|
1623
|
+
}
|
|
1624
|
+
}
|
|
1625
|
+
async addCustomViewPopup() {
|
|
1626
|
+
const newView = {
|
|
1627
|
+
name: 'custom-view',
|
|
1628
|
+
title: 'Custom View',
|
|
1629
|
+
fixed: false,
|
|
1630
|
+
sorts: [],
|
|
1631
|
+
columns: convertPropertiesToColumns(...this.loader.entity.properties),
|
|
1632
|
+
conditions: [],
|
|
1633
|
+
};
|
|
1634
|
+
const popup = await this.popupService.open(AXPEntityCreateCustomViewComponent, {
|
|
1635
|
+
title: 'Create Custom View',
|
|
1636
|
+
size: this.platform.is('Mobile') || this.platform.is('SM') ? 'full' : 'md',
|
|
1637
|
+
closeOnBackdropClick: true,
|
|
1638
|
+
draggable: false,
|
|
1639
|
+
data: {
|
|
1640
|
+
loader: this.loader,
|
|
1641
|
+
selectedView: newView,
|
|
1642
|
+
mode: 'create',
|
|
1643
|
+
},
|
|
1644
|
+
});
|
|
1645
|
+
if (popup.data?.save == true) {
|
|
1646
|
+
console.log('updatedView: ', popup.data.updatedView);
|
|
1647
|
+
this.loader.createView(popup.data.updatedView);
|
|
1648
|
+
}
|
|
1649
|
+
}
|
|
1650
|
+
async updateViewPopup(e, selectedView) {
|
|
1651
|
+
// (e.nativeEvent as UIEvent).stopPropagation();
|
|
1652
|
+
const popup = await this.popupService.open(AXPEntityCreateCustomViewComponent, {
|
|
1653
|
+
title: 'Modify Custom View',
|
|
1654
|
+
size: this.platform.is('Mobile') || this.platform.is('SM') ? 'full' : 'md',
|
|
1655
|
+
closeOnBackdropClick: true,
|
|
1656
|
+
draggable: false,
|
|
1657
|
+
data: {
|
|
1658
|
+
loader: this.loader,
|
|
1659
|
+
selectedView,
|
|
1660
|
+
mode: 'edit',
|
|
1661
|
+
},
|
|
1662
|
+
});
|
|
1663
|
+
if (popup.data?.delete == true) {
|
|
1664
|
+
this.loader.deleteView(popup.data.viewName);
|
|
1665
|
+
}
|
|
1666
|
+
if (popup.data?.save == true) {
|
|
1667
|
+
console.log('updatedView: ', popup.data.updatedView);
|
|
1668
|
+
this.loader.updateView(popup.data.updatedView);
|
|
1669
|
+
}
|
|
1670
|
+
}
|
|
1671
|
+
ngOnDestroy() {
|
|
1672
|
+
this.dataSource.reset();
|
|
1673
|
+
}
|
|
1674
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPEntityListViewComponent, deps: [{ token: i1$3.AXActionSheetService }, { token: i2.AXUnsubscriber }, { token: i3.AXPlatform }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1675
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AXPEntityListViewComponent, selector: "ng-component", providers: [AXUnsubscriber], viewQueries: [{ propertyName: "viewsTemplate", first: true, predicate: ["viewsTemplate"], descendants: true }, { propertyName: "grid", first: true, predicate: ["grid"], descendants: true }, { propertyName: "entityViewDrawer", first: true, predicate: ["entityViewDrawer"], descendants: true }], ngImport: i0, template: "<ax-drawer-container>\n <!-- <ax-drawer #drawer location=\"start\" [collapsed]=\"true\" [mode]=\"platform.is('SM') ? 'overlay' : 'push'\">\n <ax-content class=\"ax-w-64 ax-border-e\">\n <div class=\"ax-p-6 ax-py-4 ax-gap-6 ax-flex ax-flex-col\">\n <p class=\"ax-text-2xl ax-font-bold\">Folders</p>\n <ax-side-menu>\n <ng-container *ngFor=\"let node of menuItems\" [ngTemplateOutlet]=\"sideMenu\"\n [ngTemplateOutletContext]=\"{ $implicit: node }\">\n </ng-container>\n </ax-side-menu>\n <ng-template #sideMenu let-item>\n <ax-side-menu-item [text]=\"item.text\">\n <ax-prefix>\n <ax-icon class=\"fa-solid fa-folder ax-text-warning-500\"></ax-icon>\n </ax-prefix>\n <ng-container *ngIf=\"item.children\">\n <ng-container *ngFor=\"let child of item.children\" [ngTemplateOutlet]=\"sideMenu\"\n [ngTemplateOutletContext]=\"{ $implicit: child }\">\n </ng-container>\n </ng-container>\n </ax-side-menu-item>\n </ng-template>\n </div>\n </ax-content>\n </ax-drawer> -->\n <ax-content class=\"ax-flex ax-flex-col ax-overflow-hidden\">\n <div\n class=\"ax-flex ax-flex-col ax-gap-0 md:ax-gap-4 ax-px-4 ax-py-3 md:ax-py-4 md:ax-px-6 ax-bg-surface ax-border-b md:ax-border-0 md:ax-bg-default\"\n >\n @if(platform.is('MD')){\n <div class=\"ax-flex ax-justify-between ax-mb-4\">\n @if(this.grid?.selectedRows?.length==0){\n <div class=\"ax-text-xl ax-font-bold\">{{ title }}</div>\n <div class=\"ax-flex ax-items-center ax-gap-2\">\n @if(canCreate) {\n <ax-button color=\"primary\" class=\"ax-sm\" (onClick)=\"handleCreateClick()\">\n <ax-icon class=\"fa-solid fa-add\"></ax-icon>\n </ax-button>\n }\n <ax-button color=\"ghost\" class=\"ax-sm\" #more>\n <ax-icon class=\"fa-solid fa-ellipsis-vertical\"> </ax-icon>\n <ax-dropdown-panel [adaptivityEnabled]=\"true\">\n <ax-button-item-list>\n <ax-button-item text=\"Export\" class=\"ax-font-semibold\">\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-file-export\"> </ax-icon>\n </ax-prefix>\n </ax-button-item>\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n </div>\n }@else {\n <div class=\"ax-flex ax-items-center ax-gap-3\">\n <span class=\"ax-text-xl ax-font-bold\"> {{ this.grid?.selectedRows?.length }} Items Selected </span>\n <span\n (click)=\"clearSelectedItems()\"\n class=\"ax-text-sm ax-text-primary dark:ax-text-primary-300 ax-underline ax-cursor-pointer\"\n >Clear Items</span\n >\n </div>\n <div class=\"ax-flex ax-items-center ax-gap-2\">\n @if(canDelete) {\n <ax-button color=\"danger\" class=\"ax-sm\" (onClick)=\"handleCommandClick('delete')\">\n <ax-icon class=\"fa-solid fa-trash\"> </ax-icon>\n </ax-button>\n }\n <ax-button color=\"ghost\" class=\"ax-sm\" #more>\n <ax-icon class=\"fa-solid fa-ellipsis-vertical\"> </ax-icon>\n </ax-button>\n </div>\n }\n </div>\n\n <div class=\"ax-flex ax-items-center ax-justify-between\">\n <ax-button [disabled]=\"this.grid?.selectedRows?.length != 0\" [text]=\"(view$ | async)?.title\" color=\"ghost\">\n <ax-icon class=\"fa-solid fa-eye ax-text-neutral-400\"> </ax-icon>\n <ax-suffix>\n <i class=\"fa-solid fa-caret-down\"></i>\n </ax-suffix>\n <ax-dropdown-panel [adaptivityEnabled]=\"true\">\n <ax-button-item-list class=\"ax-bg-surface\">\n <ax-title class=\"ax-font-bold ax-opacity-100\">{{ 'entity.public-view' | translate | async }}</ax-title>\n <ax-button-item\n *ngFor=\"let v of publicViews$ | async\"\n [text]=\"v.title\"\n [class.ax-bg-on-surface]=\"(view$ | async) == v\"\n (onClick)=\"loader.setView(v.name)\"\n ></ax-button-item>\n <ax-title class=\"ax-font-bold ax-opacity-100\" *ngIf=\"hasCustomViews$ | async\">Created by me</ax-title>\n <ax-button-item\n *ngFor=\"let v of customViews$ | async\"\n [text]=\"v.title\"\n [class.ax-bg-on-surface]=\"(view$ | async) == v\"\n (onClick)=\"loader.setView(v.name)\"\n ></ax-button-item>\n <ng-container *feature=\"'axp-entity-list-custom-view'\">\n <ax-divider></ax-divider>\n <ax-button-item\n (onClick)=\"addCustomViewPopup()\"\n text=\"Add Custom View\"\n class=\"ax-font-semibold ax-text-primary\"\n ></ax-button-item>\n </ng-container>\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n <div class=\"ax-flex ax-gap-2\">\n @if(searchBoxTitle){\n <ax-button (onClick)=\"toggleSearchBox()\" [disabled]=\"this.grid?.selectedRows?.length != 0\" color=\"ghost\">\n <ax-icon class=\"fa-solid fa-search ax-text-neutral-400\"> </ax-icon>\n </ax-button>\n }\n <ax-button [disabled]=\"this.grid?.selectedRows?.length != 0\" color=\"ghost\" (onClick)=\"columnsDrawer.open()\">\n <ax-icon class=\"fa-solid fa-bars ax-text-neutral-400\"> </ax-icon>\n </ax-button>\n <ax-button\n [disabled]=\"this.grid?.selectedRows?.length != 0\"\n color=\"ghost\"\n (onClick)=\"conditionsDrawer.open()\"\n >\n <ax-icon class=\"fa-solid fa-sliders ax-text-neutral-400\"> </ax-icon>\n @if ((conditionsCount$ | async)) {\n <ax-suffix>\n <ax-badge [color]=\"'primary'\"></ax-badge>\n </ax-suffix>\n }\n </ax-button>\n <ax-button [disabled]=\"this.grid?.selectedRows?.length != 0\" color=\"ghost\" (onClick)=\"sortsDrawer.open()\">\n <ax-icon class=\"fa-solid fa-bars-sort ax-text-neutral-400\"> </ax-icon>\n @if ((sortCount$ | async)) {\n <ax-suffix>\n <ax-badge [color]=\"'primary'\"></ax-badge>\n </ax-suffix>\n }\n </ax-button>\n </div>\n </div>\n <div [class.collapsed-search-box]=\"searchBoxCollapsed\" class=\"ax-transition-all ax-mt-4\">\n <ax-search-box\n [title]=\"searchBoxTitle\"\n [placeholder]=\"('widget.lookup.search' | translate | async) + searchBoxPlaceholder\"\n ><ax-clear-button></ax-clear-button\n ></ax-search-box>\n </div>\n } @else {\n <div class=\"ax-flex ax-items-center ax-justify-between ax-gap-3\">\n <div class=\"ax-text-xl md:ax-text-3xl ax-font-bold ax-mb-2\">{{ title }}</div>\n @if(this.grid?.selectedRows?.length==0){\n <div class=\"ax-flex ax-gap-3\">\n @if(canCreate) {\n <ax-button [text]=\"'create-new' | translate | async\" color=\"primary\" (onClick)=\"handleCreateClick()\">\n <ax-prefix>\n <i class=\"fa-solid fa-add\"></i>\n </ax-prefix>\n </ax-button>\n } @if(canImport){\n <ax-button [text]=\"'entity.actions' | translate | async\" color=\"ghost\">\n <ax-prefix>\n <i class=\"fa-solid fa-ellipsis-vertical\"></i>\n </ax-prefix>\n <ax-dropdown-panel [adaptivityEnabled]=\"true\">\n <ax-button-item-list>\n <ax-button-item (onClick)=\"handleImportClick()\" text=\"Import\" class=\"ax-font-semibold\">\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-file-import\"> </ax-icon>\n </ax-prefix>\n </ax-button-item>\n <!-- <ax-button-item text=\"Export\" class=\"ax-font-semibold\">\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-file-export\"> </ax-icon>\n </ax-prefix>\n </ax-button-item> -->\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n }\n </div>\n }@else {\n <div class=\"ax-flex ax-gap-3\">\n @if(canDelete) {\n <ax-button text=\"Delete Items\" color=\"danger\" (onClick)=\"handleCommandClick('delete')\">\n <ax-prefix>\n <i class=\"fa-solid fa-trash\"></i>\n </ax-prefix>\n </ax-button>\n }\n <ax-button [text]=\"'entity.actions' | translate | async\" color=\"ghost\">\n <ax-prefix>\n <i class=\"fa-solid fa-ellipsis-vertical\"></i>\n </ax-prefix>\n </ax-button>\n </div>\n }\n </div>\n <div class=\"ax-flex ax-items-center ax-justify-between\">\n <!----------------------- View Mode --------------------->\n @if(this.grid?.selectedRows?.length==0) {\n <div class=\"ax-flex ax-w-full ax-justify-between ax-gap-3\">\n <div class=\"ax-flex ax-gap-3\">\n <ax-button [text]=\"(view$ | async)?.title\" #views color=\"ghost\">\n <ax-prefix>\n <i class=\"fa-solid fa-eye\"></i>\n </ax-prefix>\n <ax-suffix>\n <i class=\"fa-solid fa-caret-down\"></i>\n </ax-suffix>\n <ax-dropdown-panel [adaptivityEnabled]=\"true\">\n <ax-button-item-list class=\"ax-bg-surface\">\n <ax-title class=\"ax-font-bold ax-opacity-100\">{{\n 'entity.public-view' | translate | async\n }}</ax-title>\n <ax-button-item\n *ngFor=\"let v of publicViews$ | async\"\n [text]=\"v.title\"\n [class.ax-bg-on-surface]=\"(view$ | async) == v\"\n (onClick)=\"loader.setView(v.name)\"\n ></ax-button-item>\n <ax-title class=\"ax-font-bold ax-opacity-100\" *ngIf=\"hasCustomViews$ | async\">Created by me</ax-title>\n <ax-button-item\n class=\"ax-pe-4 ax-flex ax-justify-between\"\n *ngFor=\"let v of customViews$ | async\"\n [text]=\"v.title\"\n [class.ax-bg-on-surface]=\"(view$ | async) == v\"\n (onClick)=\"loader.setView(v.name)\"\n >\n <ax-suffix>\n <ax-button (onClick)=\"updateViewPopup($event, v)\" class=\"ax-xs\" look=\"none\">\n <ax-icon class=\"far fa-edit\"> </ax-icon>\n </ax-button>\n </ax-suffix>\n </ax-button-item>\n <ng-container *feature=\"'axp-entity-list-custom-view'\">\n <ax-divider></ax-divider>\n <ax-button-item\n text=\"Add Custom View\"\n (onClick)=\"addCustomViewPopup()\"\n class=\"ax-font-semibold ax-text-primary\"\n ></ax-button-item>\n </ng-container>\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n @if(searchBoxTitle){\n <div class=\"ax-w-72\">\n <ax-search-box\n [title]=\"searchBoxTitle\"\n [(ngModel)]=\"searchValue\"\n (onValueChanged)=\"handleChangeSearchValue($event)\"\n [placeholder]=\"('widget.lookup.search' | translate | async) + searchBoxPlaceholder\"\n ><ax-clear-button></ax-clear-button\n ></ax-search-box>\n </div>\n }\n </div>\n\n <div class=\"ax-flex ax-gap-3\">\n <ax-button\n [text]=\"'entity.columns' | translate | async\"\n color=\"ghost\"\n #columns\n (onClick)=\"columnsDrawer.open()\"\n >\n <ax-prefix>\n <i class=\"fa-solid fa-bars\"></i>\n </ax-prefix>\n <ax-suffix>\n <ax-badge text=\"{{ columnsCount$ | async }}\" color=\"primary\"></ax-badge>\n </ax-suffix>\n </ax-button>\n <ax-button text=\"Filters\" color=\"ghost\" (onClick)=\"conditionsDrawer.open()\" #conditions>\n <ax-prefix>\n <i class=\"fa-solid fa-sliders\"></i>\n </ax-prefix>\n <ax-suffix>\n <ax-badge text=\"{{ conditionsCount$ | async }}\" color=\"primary\"></ax-badge>\n </ax-suffix>\n </ax-button>\n <ax-button [text]=\"'entity.sort' | translate | async\" color=\"ghost\" (onClick)=\"sortsDrawer.open()\">\n <ax-prefix>\n <i class=\"fa-solid fa-bars-sort\"></i>\n </ax-prefix>\n <ax-suffix *ngIf=\"(sortCount$ | async)! > 0\">\n <ax-badge text=\"{{ sortCount$ | async }}\" color=\"primary\"></ax-badge>\n </ax-suffix>\n </ax-button>\n </div>\n </div>\n\n } @else{\n <!----------------------- Selection Mode --------------------->\n <div>\n <div class=\"ax-flex ax-gap-3 ax-items-center ax-h-10\">\n <span class=\"ax-text-xl ax-font-bold\"> {{ this.grid?.selectedRows?.length }} Items Selected </span>\n <span\n (click)=\"clearSelectedItems()\"\n class=\"ax-text-sm ax-text-primary dark:ax-text-primary-300 ax-underline ax-cursor-pointer\"\n >Clear Items</span\n >\n </div>\n </div>\n }\n </div>\n }\n </div>\n <div class=\"ax-flex-1 ax-px-6 ax-py-4 ax-flex ax-overflow-auto\">\n <ax-data-table\n #grid\n [showFooter]=\"false\"\n class=\"ax-flex-1\"\n [dataSource]=\"dataSource\"\n [paging]=\"true\"\n [fetchDataMode]=\"'manual'\"\n (onRowDbClick)=\"handleRowDbClick($event)\"\n [loading]=\"{ enabled: true, animation: true }\"\n >\n <!-- <ax-index-column *ngIf=\"!platform.is('SM')\" [width]=\"'85px'\"></ax-index-column> -->\n <ax-select-column fixed=\"start\" [width]=\"'50px'\"></ax-select-column>\n @for(col of (columns$ | async);track col.name) {\n <axp-widget-column-renderer\n *ngIf=\"col.visible\"\n [schema]=\"col.schema\"\n [dataField]=\"col.name\"\n [caption]=\"col.title\"\n [options]=\"col.options\"\n [displayFormat]=\"col.displayFormat\"\n [width]=\"'180px'\"\n [allowSorting]=\"false\"\n >\n </axp-widget-column-renderer>\n }\n <ax-dropdown-command-column\n fixed=\"end\"\n [width]=\"'60px'\"\n [items]=\"getDropdownRowItems\"\n (onItemClick)=\"handleRowCommandClick($event)\"\n ></ax-dropdown-command-column>\n <ax-command-column\n fixed=\"end\"\n [width]=\"'60px'\"\n [items]=\"getInlineRowItems\"\n (onItemClick)=\"handleRowCommandClick($event)\"\n ></ax-command-column>\n </ax-data-table>\n </div>\n </ax-content>\n <ax-drawer (collapsedChange)=\"closeDrawer('columns', $event)\" #columnsDrawer location=\"end\" [mode]=\"'overlay'\">\n <ax-content class=\"ax-w-[85vw] md:ax-w-[45vw] lg:ax-w-[35vw] 2xl:ax-w-[20vw] ax-border-e\">\n <axp-list-view-option-columns [loader]=\"loader\" (onClosed)=\"columnsDrawer.close()\"></axp-list-view-option-columns>\n </ax-content>\n </ax-drawer>\n <ax-drawer (collapsedChange)=\"closeDrawer('conditions', $event)\" #conditionsDrawer location=\"end\" [mode]=\"'overlay'\">\n <ax-content class=\"ax-w-[85vw] md:ax-w-[45vw] lg:ax-w-[35vw] 2xl:ax-w-[25vw] ax-border-e\">\n <axp-list-view-option-conditions\n [loader]=\"loader\"\n (onClosed)=\"conditionsDrawer.close()\"\n ></axp-list-view-option-conditions>\n </ax-content>\n </ax-drawer>\n <ax-drawer (collapsedChange)=\"closeDrawer('sorts', $event)\" #sortsDrawer location=\"end\" [mode]=\"'overlay'\">\n <ax-content class=\"ax-w-[85vw] md:ax-w-[45vw] lg:ax-w-[35vw] 2xl:ax-w-[20vw] ax-border-e\">\n <axp-list-view-option-sorting (onClosed)=\"sortsDrawer.close()\" [loader]=\"loader\"></axp-list-view-option-sorting>\n </ax-content>\n </ax-drawer>\n</ax-drawer-container>\n", styles: [".cdk-drag-preview{border-radius:.375rem;border-width:1px;--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px 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:rgba(var(--ax-color-on-surface));padding:.5rem;height:max-content!important}.collapsed-search-box{margin-top:0;height:0px;opacity:0}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { 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: "component", type: i6$2.AXDataTableComponent, selector: "ax-data-table", inputs: ["dataSource", "rowTemplate", "emptyTemplate", "alternative", "showHeader", "fixedHeader", "showFooter", "fixedFooter", "itemHeight", "allowReordering", "paging", "fetchDataMode", "loading", "focusedRow"], outputs: ["selectedRowsChange", "focusedRowChange", "onRowClick", "onRowDbClick", "onColumnsOrderChanged"] }, { kind: "component", type: i6$2.AXRowSelectColumnComponent, selector: "ax-select-column", inputs: ["width", "caption", "fixed"] }, { kind: "component", type: i6$2.AXRowCommandColumnComponent, selector: "ax-command-column", inputs: ["width", "caption", "fixed", "footerTemplate", "items"], outputs: ["onItemClick"] }, { kind: "component", type: i6$2.AXRowDropdownCommandColumnComponent, selector: "ax-dropdown-command-column", inputs: ["width", "caption", "fixed", "footerTemplate", "items"], outputs: ["onItemClick"] }, { kind: "component", type: i4.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "type", "responsiveOn", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "responsiveOnChange", "loadingTextChange"] }, { kind: "component", type: i4.AXButtonItemComponent, selector: "ax-button-item", inputs: ["color", "disabled", "text", "selected", "divided", "data", "name"], outputs: ["onClick", "onFocus", "onBlur", "disabledChange"] }, { kind: "component", type: i4.AXButtonItemListComponent, selector: "ax-button-item-list", inputs: ["items"], outputs: ["onItemClick"] }, { kind: "component", type: i4$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i4$1.AXDecoratorClearButtonComponent, selector: "ax-clear-button", inputs: ["icon"] }, { kind: "component", type: i4$1.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-sub-title, ax-placeholder, ax-overlay" }, { kind: "component", type: i5.AXBadgeComponent, selector: "ax-badge", inputs: ["color", "look", "text"] }, { kind: "component", type: i6.AXDropdownPanelComponent, selector: "ax-dropdown-panel", inputs: ["isOpen", "fitParent", "dropdownWidth", "position", "_target", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "component", type: i11.AXDrawerComponent, selector: "ax-drawer", inputs: ["location", "showBackdrop", "mode", "collapsed", "closeOthers"], outputs: ["locationChange", "modeChange", "collapsedChange"] }, { kind: "component", type: i11.AXDrawerContainerComponent, selector: "ax-drawer-container" }, { kind: "component", type: i12.AXSearchBoxComponent, selector: "ax-search-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "value", "state", "name", "id", "look", "delayTime"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "component", type: i10.AXPWidgetColumnRendererComponent, selector: "axp-widget-column-renderer", inputs: ["width", "caption", "headerTemplate", "allowSorting", "fixed", "footerTemplate", "cellTemplate", "options", "dataField", "displayFormat", "schema"] }, { kind: "directive", type: i14$1.AXPFeatureDirective, selector: "[feature]", inputs: ["feature", "featureElse"] }, { kind: "component", type: AXPListViewOptionsColumnsComponent, selector: "axp-list-view-option-columns", inputs: ["loader"], outputs: ["onClosed"] }, { kind: "component", type: AXPListViewOptionConditionsComponent, selector: "axp-list-view-option-conditions", inputs: ["loader"], outputs: ["onClosed"] }, { kind: "component", type: AXPListViewOptionSortingComponent, selector: "axp-list-view-option-sorting", inputs: ["loader"], outputs: ["onClosed"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i8.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1676
|
+
}
|
|
1677
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPEntityListViewComponent, decorators: [{
|
|
1678
|
+
type: Component,
|
|
1679
|
+
args: [{ encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [AXUnsubscriber], template: "<ax-drawer-container>\n <!-- <ax-drawer #drawer location=\"start\" [collapsed]=\"true\" [mode]=\"platform.is('SM') ? 'overlay' : 'push'\">\n <ax-content class=\"ax-w-64 ax-border-e\">\n <div class=\"ax-p-6 ax-py-4 ax-gap-6 ax-flex ax-flex-col\">\n <p class=\"ax-text-2xl ax-font-bold\">Folders</p>\n <ax-side-menu>\n <ng-container *ngFor=\"let node of menuItems\" [ngTemplateOutlet]=\"sideMenu\"\n [ngTemplateOutletContext]=\"{ $implicit: node }\">\n </ng-container>\n </ax-side-menu>\n <ng-template #sideMenu let-item>\n <ax-side-menu-item [text]=\"item.text\">\n <ax-prefix>\n <ax-icon class=\"fa-solid fa-folder ax-text-warning-500\"></ax-icon>\n </ax-prefix>\n <ng-container *ngIf=\"item.children\">\n <ng-container *ngFor=\"let child of item.children\" [ngTemplateOutlet]=\"sideMenu\"\n [ngTemplateOutletContext]=\"{ $implicit: child }\">\n </ng-container>\n </ng-container>\n </ax-side-menu-item>\n </ng-template>\n </div>\n </ax-content>\n </ax-drawer> -->\n <ax-content class=\"ax-flex ax-flex-col ax-overflow-hidden\">\n <div\n class=\"ax-flex ax-flex-col ax-gap-0 md:ax-gap-4 ax-px-4 ax-py-3 md:ax-py-4 md:ax-px-6 ax-bg-surface ax-border-b md:ax-border-0 md:ax-bg-default\"\n >\n @if(platform.is('MD')){\n <div class=\"ax-flex ax-justify-between ax-mb-4\">\n @if(this.grid?.selectedRows?.length==0){\n <div class=\"ax-text-xl ax-font-bold\">{{ title }}</div>\n <div class=\"ax-flex ax-items-center ax-gap-2\">\n @if(canCreate) {\n <ax-button color=\"primary\" class=\"ax-sm\" (onClick)=\"handleCreateClick()\">\n <ax-icon class=\"fa-solid fa-add\"></ax-icon>\n </ax-button>\n }\n <ax-button color=\"ghost\" class=\"ax-sm\" #more>\n <ax-icon class=\"fa-solid fa-ellipsis-vertical\"> </ax-icon>\n <ax-dropdown-panel [adaptivityEnabled]=\"true\">\n <ax-button-item-list>\n <ax-button-item text=\"Export\" class=\"ax-font-semibold\">\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-file-export\"> </ax-icon>\n </ax-prefix>\n </ax-button-item>\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n </div>\n }@else {\n <div class=\"ax-flex ax-items-center ax-gap-3\">\n <span class=\"ax-text-xl ax-font-bold\"> {{ this.grid?.selectedRows?.length }} Items Selected </span>\n <span\n (click)=\"clearSelectedItems()\"\n class=\"ax-text-sm ax-text-primary dark:ax-text-primary-300 ax-underline ax-cursor-pointer\"\n >Clear Items</span\n >\n </div>\n <div class=\"ax-flex ax-items-center ax-gap-2\">\n @if(canDelete) {\n <ax-button color=\"danger\" class=\"ax-sm\" (onClick)=\"handleCommandClick('delete')\">\n <ax-icon class=\"fa-solid fa-trash\"> </ax-icon>\n </ax-button>\n }\n <ax-button color=\"ghost\" class=\"ax-sm\" #more>\n <ax-icon class=\"fa-solid fa-ellipsis-vertical\"> </ax-icon>\n </ax-button>\n </div>\n }\n </div>\n\n <div class=\"ax-flex ax-items-center ax-justify-between\">\n <ax-button [disabled]=\"this.grid?.selectedRows?.length != 0\" [text]=\"(view$ | async)?.title\" color=\"ghost\">\n <ax-icon class=\"fa-solid fa-eye ax-text-neutral-400\"> </ax-icon>\n <ax-suffix>\n <i class=\"fa-solid fa-caret-down\"></i>\n </ax-suffix>\n <ax-dropdown-panel [adaptivityEnabled]=\"true\">\n <ax-button-item-list class=\"ax-bg-surface\">\n <ax-title class=\"ax-font-bold ax-opacity-100\">{{ 'entity.public-view' | translate | async }}</ax-title>\n <ax-button-item\n *ngFor=\"let v of publicViews$ | async\"\n [text]=\"v.title\"\n [class.ax-bg-on-surface]=\"(view$ | async) == v\"\n (onClick)=\"loader.setView(v.name)\"\n ></ax-button-item>\n <ax-title class=\"ax-font-bold ax-opacity-100\" *ngIf=\"hasCustomViews$ | async\">Created by me</ax-title>\n <ax-button-item\n *ngFor=\"let v of customViews$ | async\"\n [text]=\"v.title\"\n [class.ax-bg-on-surface]=\"(view$ | async) == v\"\n (onClick)=\"loader.setView(v.name)\"\n ></ax-button-item>\n <ng-container *feature=\"'axp-entity-list-custom-view'\">\n <ax-divider></ax-divider>\n <ax-button-item\n (onClick)=\"addCustomViewPopup()\"\n text=\"Add Custom View\"\n class=\"ax-font-semibold ax-text-primary\"\n ></ax-button-item>\n </ng-container>\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n <div class=\"ax-flex ax-gap-2\">\n @if(searchBoxTitle){\n <ax-button (onClick)=\"toggleSearchBox()\" [disabled]=\"this.grid?.selectedRows?.length != 0\" color=\"ghost\">\n <ax-icon class=\"fa-solid fa-search ax-text-neutral-400\"> </ax-icon>\n </ax-button>\n }\n <ax-button [disabled]=\"this.grid?.selectedRows?.length != 0\" color=\"ghost\" (onClick)=\"columnsDrawer.open()\">\n <ax-icon class=\"fa-solid fa-bars ax-text-neutral-400\"> </ax-icon>\n </ax-button>\n <ax-button\n [disabled]=\"this.grid?.selectedRows?.length != 0\"\n color=\"ghost\"\n (onClick)=\"conditionsDrawer.open()\"\n >\n <ax-icon class=\"fa-solid fa-sliders ax-text-neutral-400\"> </ax-icon>\n @if ((conditionsCount$ | async)) {\n <ax-suffix>\n <ax-badge [color]=\"'primary'\"></ax-badge>\n </ax-suffix>\n }\n </ax-button>\n <ax-button [disabled]=\"this.grid?.selectedRows?.length != 0\" color=\"ghost\" (onClick)=\"sortsDrawer.open()\">\n <ax-icon class=\"fa-solid fa-bars-sort ax-text-neutral-400\"> </ax-icon>\n @if ((sortCount$ | async)) {\n <ax-suffix>\n <ax-badge [color]=\"'primary'\"></ax-badge>\n </ax-suffix>\n }\n </ax-button>\n </div>\n </div>\n <div [class.collapsed-search-box]=\"searchBoxCollapsed\" class=\"ax-transition-all ax-mt-4\">\n <ax-search-box\n [title]=\"searchBoxTitle\"\n [placeholder]=\"('widget.lookup.search' | translate | async) + searchBoxPlaceholder\"\n ><ax-clear-button></ax-clear-button\n ></ax-search-box>\n </div>\n } @else {\n <div class=\"ax-flex ax-items-center ax-justify-between ax-gap-3\">\n <div class=\"ax-text-xl md:ax-text-3xl ax-font-bold ax-mb-2\">{{ title }}</div>\n @if(this.grid?.selectedRows?.length==0){\n <div class=\"ax-flex ax-gap-3\">\n @if(canCreate) {\n <ax-button [text]=\"'create-new' | translate | async\" color=\"primary\" (onClick)=\"handleCreateClick()\">\n <ax-prefix>\n <i class=\"fa-solid fa-add\"></i>\n </ax-prefix>\n </ax-button>\n } @if(canImport){\n <ax-button [text]=\"'entity.actions' | translate | async\" color=\"ghost\">\n <ax-prefix>\n <i class=\"fa-solid fa-ellipsis-vertical\"></i>\n </ax-prefix>\n <ax-dropdown-panel [adaptivityEnabled]=\"true\">\n <ax-button-item-list>\n <ax-button-item (onClick)=\"handleImportClick()\" text=\"Import\" class=\"ax-font-semibold\">\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-file-import\"> </ax-icon>\n </ax-prefix>\n </ax-button-item>\n <!-- <ax-button-item text=\"Export\" class=\"ax-font-semibold\">\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-file-export\"> </ax-icon>\n </ax-prefix>\n </ax-button-item> -->\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n }\n </div>\n }@else {\n <div class=\"ax-flex ax-gap-3\">\n @if(canDelete) {\n <ax-button text=\"Delete Items\" color=\"danger\" (onClick)=\"handleCommandClick('delete')\">\n <ax-prefix>\n <i class=\"fa-solid fa-trash\"></i>\n </ax-prefix>\n </ax-button>\n }\n <ax-button [text]=\"'entity.actions' | translate | async\" color=\"ghost\">\n <ax-prefix>\n <i class=\"fa-solid fa-ellipsis-vertical\"></i>\n </ax-prefix>\n </ax-button>\n </div>\n }\n </div>\n <div class=\"ax-flex ax-items-center ax-justify-between\">\n <!----------------------- View Mode --------------------->\n @if(this.grid?.selectedRows?.length==0) {\n <div class=\"ax-flex ax-w-full ax-justify-between ax-gap-3\">\n <div class=\"ax-flex ax-gap-3\">\n <ax-button [text]=\"(view$ | async)?.title\" #views color=\"ghost\">\n <ax-prefix>\n <i class=\"fa-solid fa-eye\"></i>\n </ax-prefix>\n <ax-suffix>\n <i class=\"fa-solid fa-caret-down\"></i>\n </ax-suffix>\n <ax-dropdown-panel [adaptivityEnabled]=\"true\">\n <ax-button-item-list class=\"ax-bg-surface\">\n <ax-title class=\"ax-font-bold ax-opacity-100\">{{\n 'entity.public-view' | translate | async\n }}</ax-title>\n <ax-button-item\n *ngFor=\"let v of publicViews$ | async\"\n [text]=\"v.title\"\n [class.ax-bg-on-surface]=\"(view$ | async) == v\"\n (onClick)=\"loader.setView(v.name)\"\n ></ax-button-item>\n <ax-title class=\"ax-font-bold ax-opacity-100\" *ngIf=\"hasCustomViews$ | async\">Created by me</ax-title>\n <ax-button-item\n class=\"ax-pe-4 ax-flex ax-justify-between\"\n *ngFor=\"let v of customViews$ | async\"\n [text]=\"v.title\"\n [class.ax-bg-on-surface]=\"(view$ | async) == v\"\n (onClick)=\"loader.setView(v.name)\"\n >\n <ax-suffix>\n <ax-button (onClick)=\"updateViewPopup($event, v)\" class=\"ax-xs\" look=\"none\">\n <ax-icon class=\"far fa-edit\"> </ax-icon>\n </ax-button>\n </ax-suffix>\n </ax-button-item>\n <ng-container *feature=\"'axp-entity-list-custom-view'\">\n <ax-divider></ax-divider>\n <ax-button-item\n text=\"Add Custom View\"\n (onClick)=\"addCustomViewPopup()\"\n class=\"ax-font-semibold ax-text-primary\"\n ></ax-button-item>\n </ng-container>\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n @if(searchBoxTitle){\n <div class=\"ax-w-72\">\n <ax-search-box\n [title]=\"searchBoxTitle\"\n [(ngModel)]=\"searchValue\"\n (onValueChanged)=\"handleChangeSearchValue($event)\"\n [placeholder]=\"('widget.lookup.search' | translate | async) + searchBoxPlaceholder\"\n ><ax-clear-button></ax-clear-button\n ></ax-search-box>\n </div>\n }\n </div>\n\n <div class=\"ax-flex ax-gap-3\">\n <ax-button\n [text]=\"'entity.columns' | translate | async\"\n color=\"ghost\"\n #columns\n (onClick)=\"columnsDrawer.open()\"\n >\n <ax-prefix>\n <i class=\"fa-solid fa-bars\"></i>\n </ax-prefix>\n <ax-suffix>\n <ax-badge text=\"{{ columnsCount$ | async }}\" color=\"primary\"></ax-badge>\n </ax-suffix>\n </ax-button>\n <ax-button text=\"Filters\" color=\"ghost\" (onClick)=\"conditionsDrawer.open()\" #conditions>\n <ax-prefix>\n <i class=\"fa-solid fa-sliders\"></i>\n </ax-prefix>\n <ax-suffix>\n <ax-badge text=\"{{ conditionsCount$ | async }}\" color=\"primary\"></ax-badge>\n </ax-suffix>\n </ax-button>\n <ax-button [text]=\"'entity.sort' | translate | async\" color=\"ghost\" (onClick)=\"sortsDrawer.open()\">\n <ax-prefix>\n <i class=\"fa-solid fa-bars-sort\"></i>\n </ax-prefix>\n <ax-suffix *ngIf=\"(sortCount$ | async)! > 0\">\n <ax-badge text=\"{{ sortCount$ | async }}\" color=\"primary\"></ax-badge>\n </ax-suffix>\n </ax-button>\n </div>\n </div>\n\n } @else{\n <!----------------------- Selection Mode --------------------->\n <div>\n <div class=\"ax-flex ax-gap-3 ax-items-center ax-h-10\">\n <span class=\"ax-text-xl ax-font-bold\"> {{ this.grid?.selectedRows?.length }} Items Selected </span>\n <span\n (click)=\"clearSelectedItems()\"\n class=\"ax-text-sm ax-text-primary dark:ax-text-primary-300 ax-underline ax-cursor-pointer\"\n >Clear Items</span\n >\n </div>\n </div>\n }\n </div>\n }\n </div>\n <div class=\"ax-flex-1 ax-px-6 ax-py-4 ax-flex ax-overflow-auto\">\n <ax-data-table\n #grid\n [showFooter]=\"false\"\n class=\"ax-flex-1\"\n [dataSource]=\"dataSource\"\n [paging]=\"true\"\n [fetchDataMode]=\"'manual'\"\n (onRowDbClick)=\"handleRowDbClick($event)\"\n [loading]=\"{ enabled: true, animation: true }\"\n >\n <!-- <ax-index-column *ngIf=\"!platform.is('SM')\" [width]=\"'85px'\"></ax-index-column> -->\n <ax-select-column fixed=\"start\" [width]=\"'50px'\"></ax-select-column>\n @for(col of (columns$ | async);track col.name) {\n <axp-widget-column-renderer\n *ngIf=\"col.visible\"\n [schema]=\"col.schema\"\n [dataField]=\"col.name\"\n [caption]=\"col.title\"\n [options]=\"col.options\"\n [displayFormat]=\"col.displayFormat\"\n [width]=\"'180px'\"\n [allowSorting]=\"false\"\n >\n </axp-widget-column-renderer>\n }\n <ax-dropdown-command-column\n fixed=\"end\"\n [width]=\"'60px'\"\n [items]=\"getDropdownRowItems\"\n (onItemClick)=\"handleRowCommandClick($event)\"\n ></ax-dropdown-command-column>\n <ax-command-column\n fixed=\"end\"\n [width]=\"'60px'\"\n [items]=\"getInlineRowItems\"\n (onItemClick)=\"handleRowCommandClick($event)\"\n ></ax-command-column>\n </ax-data-table>\n </div>\n </ax-content>\n <ax-drawer (collapsedChange)=\"closeDrawer('columns', $event)\" #columnsDrawer location=\"end\" [mode]=\"'overlay'\">\n <ax-content class=\"ax-w-[85vw] md:ax-w-[45vw] lg:ax-w-[35vw] 2xl:ax-w-[20vw] ax-border-e\">\n <axp-list-view-option-columns [loader]=\"loader\" (onClosed)=\"columnsDrawer.close()\"></axp-list-view-option-columns>\n </ax-content>\n </ax-drawer>\n <ax-drawer (collapsedChange)=\"closeDrawer('conditions', $event)\" #conditionsDrawer location=\"end\" [mode]=\"'overlay'\">\n <ax-content class=\"ax-w-[85vw] md:ax-w-[45vw] lg:ax-w-[35vw] 2xl:ax-w-[25vw] ax-border-e\">\n <axp-list-view-option-conditions\n [loader]=\"loader\"\n (onClosed)=\"conditionsDrawer.close()\"\n ></axp-list-view-option-conditions>\n </ax-content>\n </ax-drawer>\n <ax-drawer (collapsedChange)=\"closeDrawer('sorts', $event)\" #sortsDrawer location=\"end\" [mode]=\"'overlay'\">\n <ax-content class=\"ax-w-[85vw] md:ax-w-[45vw] lg:ax-w-[35vw] 2xl:ax-w-[20vw] ax-border-e\">\n <axp-list-view-option-sorting (onClosed)=\"sortsDrawer.close()\" [loader]=\"loader\"></axp-list-view-option-sorting>\n </ax-content>\n </ax-drawer>\n</ax-drawer-container>\n", styles: [".cdk-drag-preview{border-radius:.375rem;border-width:1px;--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px 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:rgba(var(--ax-color-on-surface));padding:.5rem;height:max-content!important}.collapsed-search-box{margin-top:0;height:0px;opacity:0}\n"] }]
|
|
1680
|
+
}], ctorParameters: () => [{ type: i1$3.AXActionSheetService }, { type: i2.AXUnsubscriber }, { type: i3.AXPlatform }, { type: i0.ChangeDetectorRef }], propDecorators: { viewsTemplate: [{
|
|
1681
|
+
type: ViewChild,
|
|
1682
|
+
args: ['viewsTemplate']
|
|
1683
|
+
}], grid: [{
|
|
1684
|
+
type: ViewChild,
|
|
1685
|
+
args: ['grid']
|
|
1686
|
+
}], entityViewDrawer: [{
|
|
1687
|
+
type: ViewChild,
|
|
1688
|
+
args: ['entityViewDrawer']
|
|
1689
|
+
}] } });
|
|
1690
|
+
|
|
1691
|
+
class AXPListViewModule {
|
|
1692
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPListViewModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1693
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.0", ngImport: i0, type: AXPListViewModule, declarations: [AXPEntityListViewComponent,
|
|
1694
|
+
AXPEntityCreateCustomViewComponent,
|
|
1695
|
+
AXPListViewOptionsColumnsComponent,
|
|
1696
|
+
AXPListViewOptionConditionsComponent,
|
|
1697
|
+
AXPListViewOptionFilterOperatorComponent,
|
|
1698
|
+
AXPListViewOptionSortingComponent], imports: [CommonModule,
|
|
1699
|
+
FormsModule,
|
|
1700
|
+
AXCommonModule,
|
|
1701
|
+
AXDataTableModule,
|
|
1702
|
+
AXButtonModule,
|
|
1703
|
+
AXDecoratorModule,
|
|
1704
|
+
AXBadgeModule,
|
|
1705
|
+
AXDropdownModule,
|
|
1706
|
+
AXPopoverModule,
|
|
1707
|
+
AXImageModule,
|
|
1708
|
+
AXSwitchModule,
|
|
1709
|
+
AXDrawerModule,
|
|
1710
|
+
AXLoadingModule,
|
|
1711
|
+
AXTabsModule,
|
|
1712
|
+
AXSelectBoxModule,
|
|
1713
|
+
AXFormModule,
|
|
1714
|
+
AXListModule,
|
|
1715
|
+
AXTextBoxModule,
|
|
1716
|
+
AXSearchBoxModule,
|
|
1717
|
+
AXLabelModule,
|
|
1718
|
+
AXCollapseModule,
|
|
1719
|
+
AXActionSheetModule,
|
|
1720
|
+
AXSelectionListModule,
|
|
1721
|
+
AXImageModule,
|
|
1722
|
+
AXDialogModule,
|
|
1723
|
+
AXDropdownButtonModule,
|
|
1724
|
+
//
|
|
1725
|
+
CdkDropList,
|
|
1726
|
+
CdkDrag,
|
|
1727
|
+
CdkDragPlaceholder,
|
|
1728
|
+
CdkDragHandle,
|
|
1729
|
+
PortalModule,
|
|
1730
|
+
AXPSchemaModule,
|
|
1731
|
+
AXPCommonWidgetModule,
|
|
1732
|
+
AXPAuthModule,
|
|
1733
|
+
AXTranslationModule] }); }
|
|
1734
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPListViewModule, imports: [CommonModule,
|
|
1735
|
+
FormsModule,
|
|
1736
|
+
AXCommonModule,
|
|
1737
|
+
AXDataTableModule,
|
|
1738
|
+
AXButtonModule,
|
|
1739
|
+
AXDecoratorModule,
|
|
1740
|
+
AXBadgeModule,
|
|
1741
|
+
AXDropdownModule,
|
|
1742
|
+
AXPopoverModule,
|
|
1743
|
+
AXImageModule,
|
|
1744
|
+
AXSwitchModule,
|
|
1745
|
+
AXDrawerModule,
|
|
1746
|
+
AXLoadingModule,
|
|
1747
|
+
AXTabsModule,
|
|
1748
|
+
AXSelectBoxModule,
|
|
1749
|
+
AXFormModule,
|
|
1750
|
+
AXListModule,
|
|
1751
|
+
AXTextBoxModule,
|
|
1752
|
+
AXSearchBoxModule,
|
|
1753
|
+
AXLabelModule,
|
|
1754
|
+
AXCollapseModule,
|
|
1755
|
+
AXActionSheetModule,
|
|
1756
|
+
AXSelectionListModule,
|
|
1757
|
+
AXImageModule,
|
|
1758
|
+
AXDialogModule,
|
|
1759
|
+
AXDropdownButtonModule,
|
|
1760
|
+
PortalModule,
|
|
1761
|
+
AXPSchemaModule,
|
|
1762
|
+
AXPCommonWidgetModule,
|
|
1763
|
+
AXPAuthModule,
|
|
1764
|
+
AXTranslationModule] }); }
|
|
2060
1765
|
}
|
|
2061
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type:
|
|
2062
|
-
type:
|
|
2063
|
-
args: [{
|
|
1766
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPListViewModule, decorators: [{
|
|
1767
|
+
type: NgModule,
|
|
1768
|
+
args: [{
|
|
1769
|
+
imports: [
|
|
2064
1770
|
CommonModule,
|
|
2065
|
-
|
|
1771
|
+
FormsModule,
|
|
1772
|
+
AXCommonModule,
|
|
1773
|
+
AXDataTableModule,
|
|
2066
1774
|
AXButtonModule,
|
|
2067
1775
|
AXDecoratorModule,
|
|
2068
1776
|
AXBadgeModule,
|
|
2069
1777
|
AXDropdownModule,
|
|
2070
1778
|
AXPopoverModule,
|
|
2071
|
-
AXFormModule,
|
|
2072
1779
|
AXImageModule,
|
|
2073
|
-
AXActionSheetModule,
|
|
2074
1780
|
AXSwitchModule,
|
|
2075
1781
|
AXDrawerModule,
|
|
2076
|
-
AXDialogModule,
|
|
2077
1782
|
AXLoadingModule,
|
|
2078
1783
|
AXTabsModule,
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
1784
|
+
AXSelectBoxModule,
|
|
1785
|
+
AXFormModule,
|
|
1786
|
+
AXListModule,
|
|
1787
|
+
AXTextBoxModule,
|
|
1788
|
+
AXSearchBoxModule,
|
|
1789
|
+
AXLabelModule,
|
|
1790
|
+
AXCollapseModule,
|
|
1791
|
+
AXActionSheetModule,
|
|
1792
|
+
AXSelectionListModule,
|
|
1793
|
+
AXImageModule,
|
|
1794
|
+
AXDialogModule,
|
|
1795
|
+
AXDropdownButtonModule,
|
|
2086
1796
|
//
|
|
1797
|
+
CdkDropList,
|
|
1798
|
+
CdkDrag,
|
|
1799
|
+
CdkDragPlaceholder,
|
|
1800
|
+
CdkDragHandle,
|
|
1801
|
+
PortalModule,
|
|
1802
|
+
AXPSchemaModule,
|
|
2087
1803
|
AXPCommonWidgetModule,
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
1804
|
+
AXPAuthModule,
|
|
1805
|
+
AXTranslationModule,
|
|
1806
|
+
],
|
|
1807
|
+
declarations: [
|
|
1808
|
+
AXPEntityListViewComponent,
|
|
1809
|
+
AXPEntityCreateCustomViewComponent,
|
|
1810
|
+
AXPListViewOptionsColumnsComponent,
|
|
1811
|
+
AXPListViewOptionConditionsComponent,
|
|
1812
|
+
AXPListViewOptionFilterOperatorComponent,
|
|
1813
|
+
AXPListViewOptionSortingComponent,
|
|
1814
|
+
],
|
|
1815
|
+
providers: [],
|
|
1816
|
+
}]
|
|
1817
|
+
}] });
|
|
2094
1818
|
|
|
2095
|
-
class
|
|
2096
|
-
constructor(config,
|
|
1819
|
+
class AXPListViewLoaderDefault {
|
|
1820
|
+
constructor(config, schemaService) {
|
|
2097
1821
|
this.config = config;
|
|
2098
|
-
this.
|
|
2099
|
-
this.
|
|
2100
|
-
this.
|
|
2101
|
-
this.
|
|
2102
|
-
this._sections$ = new BehaviorSubject(this.sections);
|
|
2103
|
-
//****************** Properties ******************//
|
|
1822
|
+
this.schemaService = schemaService;
|
|
1823
|
+
this._dataSource = new AXDataSource(this.entity.dataSource);
|
|
1824
|
+
this._inlineFilterItems = [];
|
|
1825
|
+
this._props$ = new BehaviorSubject(this.props);
|
|
2104
1826
|
this.getProp = (name) => this.entity.properties.find((c) => c.name == name);
|
|
1827
|
+
//****************** Views ******************//
|
|
1828
|
+
this._currentView = 'default';
|
|
1829
|
+
this._views$ = new BehaviorSubject(this.views);
|
|
1830
|
+
//****************** Columns ******************//
|
|
1831
|
+
this._currentDisplayColumns$ = new BehaviorSubject([]);
|
|
1832
|
+
this._columns$ = new BehaviorSubject(this.columns);
|
|
1833
|
+
//****************** Sort ******************//
|
|
1834
|
+
this._currentSorts$ = new BehaviorSubject([]);
|
|
1835
|
+
//****************** Conditions ******************//
|
|
1836
|
+
this._currentConditions$ = new BehaviorSubject([]);
|
|
1837
|
+
this._inlineFilterItems = this.entity.properties
|
|
1838
|
+
.filter((property) => property.canInlineFilter)
|
|
1839
|
+
.map((item) => {
|
|
1840
|
+
const schema = this.schemaService.resolve(item.schema);
|
|
1841
|
+
return { name: item.name, dataType: schema?.dataType, title: item.title };
|
|
1842
|
+
});
|
|
1843
|
+
}
|
|
1844
|
+
get entity() {
|
|
1845
|
+
if (!this._config) {
|
|
1846
|
+
this._config = cloneDeep(this.config);
|
|
1847
|
+
}
|
|
1848
|
+
return this._config;
|
|
1849
|
+
}
|
|
1850
|
+
get dataSource() {
|
|
1851
|
+
return this._dataSource;
|
|
1852
|
+
}
|
|
1853
|
+
//****************** Properties ******************//
|
|
1854
|
+
get props() {
|
|
1855
|
+
return this.entity.properties;
|
|
1856
|
+
}
|
|
1857
|
+
get properties$() {
|
|
1858
|
+
return this._props$;
|
|
1859
|
+
}
|
|
1860
|
+
get views() {
|
|
1861
|
+
return this.entity.views.list?.views;
|
|
1862
|
+
}
|
|
1863
|
+
get views$() {
|
|
1864
|
+
return this._views$;
|
|
1865
|
+
}
|
|
1866
|
+
get view$() {
|
|
1867
|
+
return this.views$.pipe(switchMap((views) => {
|
|
1868
|
+
const view = views.find((c) => c.name === this._currentView);
|
|
1869
|
+
if (view) {
|
|
1870
|
+
return of(view);
|
|
1871
|
+
}
|
|
1872
|
+
else if (this.views.length > 0) {
|
|
1873
|
+
return of(this.views[0]);
|
|
1874
|
+
}
|
|
1875
|
+
else {
|
|
1876
|
+
return of(AXPEntityListViewConfigEmpty);
|
|
1877
|
+
}
|
|
1878
|
+
}));
|
|
1879
|
+
}
|
|
1880
|
+
get publicViews$() {
|
|
1881
|
+
return this.views$.pipe(map((c) => c.filter((v) => v.fixed)));
|
|
1882
|
+
}
|
|
1883
|
+
get customViews$() {
|
|
1884
|
+
return this.views$.pipe(map((c) => c.filter((v) => !v.fixed)));
|
|
1885
|
+
}
|
|
1886
|
+
get hasCustomViews$() {
|
|
1887
|
+
return this.customViews$.pipe(map((c) => c.length > 0));
|
|
1888
|
+
}
|
|
1889
|
+
setDefaultView() {
|
|
1890
|
+
this.setView(this.views[0].name);
|
|
1891
|
+
}
|
|
1892
|
+
setView(name) {
|
|
1893
|
+
let propNames = [];
|
|
1894
|
+
this.properties$.pipe(first()).subscribe((properties) => {
|
|
1895
|
+
propNames = properties.map((p) => p.name);
|
|
1896
|
+
});
|
|
1897
|
+
this._currentView = name;
|
|
1898
|
+
const updatedView = this._views$.value.find((c) => c.name === this._currentView) || AXPEntityListViewConfigEmpty;
|
|
1899
|
+
const currentViews = this._views$.value;
|
|
1900
|
+
const updatedViews = currentViews.map((view) => {
|
|
1901
|
+
if (view.name === updatedView.name) {
|
|
1902
|
+
return updatedView;
|
|
1903
|
+
}
|
|
1904
|
+
else {
|
|
1905
|
+
return view;
|
|
1906
|
+
}
|
|
1907
|
+
});
|
|
1908
|
+
this._currentConditions$.next(cloneDeep(updatedView.conditions.filter((c) => propNames.includes(c.name))));
|
|
1909
|
+
this._currentSorts$.next(cloneDeep(updatedView.sorts.filter((s) => propNames.includes(s.name))));
|
|
1910
|
+
// this._columns$.next(updatedView.columns);
|
|
1911
|
+
this._currentDisplayColumns$.next(cloneDeep(updatedView.columns.filter((c) => propNames.includes(c.name))));
|
|
1912
|
+
this._views$.next(updatedViews);
|
|
1913
|
+
//apply conditions and sorts:
|
|
1914
|
+
this.dataSource.filter({
|
|
1915
|
+
field: null,
|
|
1916
|
+
logic: 'and',
|
|
1917
|
+
operator: null,
|
|
1918
|
+
filters: updatedView.conditions.map((c) => ({
|
|
1919
|
+
field: c.name,
|
|
1920
|
+
value: c.value,
|
|
1921
|
+
operator: { type: c.operator },
|
|
1922
|
+
})),
|
|
1923
|
+
});
|
|
1924
|
+
const convertedSortItems = updatedView.sorts.map((s) => ({
|
|
1925
|
+
field: s.name,
|
|
1926
|
+
dir: s.dir,
|
|
1927
|
+
}));
|
|
1928
|
+
this.dataSource.sort(...convertedSortItems);
|
|
1929
|
+
this.dataSource.refresh();
|
|
1930
|
+
}
|
|
1931
|
+
createView(newView) {
|
|
1932
|
+
const currentViews = this._views$.getValue();
|
|
1933
|
+
currentViews.push(newView);
|
|
1934
|
+
this._views$.next(currentViews);
|
|
1935
|
+
this.setView(newView.name);
|
|
1936
|
+
}
|
|
1937
|
+
updateView(updatedView) {
|
|
1938
|
+
const currentViews = this._views$.getValue().map((view) => (view.name === updatedView.name ? updatedView : view));
|
|
1939
|
+
this._views$.next(currentViews);
|
|
1940
|
+
this.setView(updatedView.name);
|
|
1941
|
+
}
|
|
1942
|
+
deleteView(viewName) {
|
|
1943
|
+
const currentViews = this._views$.getValue().filter((view) => view.name !== viewName);
|
|
1944
|
+
this._views$.next(currentViews);
|
|
1945
|
+
this.setView(this.views[0].name);
|
|
1946
|
+
}
|
|
1947
|
+
get columns() {
|
|
1948
|
+
return this.entity.properties.map((p) => ({
|
|
1949
|
+
name: p.name,
|
|
1950
|
+
title: p.title,
|
|
1951
|
+
schema: p.schema,
|
|
1952
|
+
}));
|
|
1953
|
+
}
|
|
1954
|
+
get columns$() {
|
|
1955
|
+
return this._columns$.pipe(defaultIfEmpty([]));
|
|
1956
|
+
}
|
|
1957
|
+
get displayColumns$() {
|
|
1958
|
+
return this._currentDisplayColumns$.pipe(defaultIfEmpty([]));
|
|
1959
|
+
}
|
|
1960
|
+
get displayColumnsCount$() {
|
|
1961
|
+
return this.view$.pipe(map((view) => {
|
|
1962
|
+
return view.columns.filter((column) => column.visible).length;
|
|
1963
|
+
}));
|
|
1964
|
+
}
|
|
1965
|
+
updateColumns(items) {
|
|
1966
|
+
this.view$.pipe(first()).subscribe((view) => {
|
|
1967
|
+
view.columns = cloneDeep(items);
|
|
1968
|
+
this._views$.next(this._views$.value.map((v) => (v.name === this._currentView ? view : v)));
|
|
1969
|
+
});
|
|
1970
|
+
}
|
|
1971
|
+
resetColumns() {
|
|
1972
|
+
this.view$.pipe(first()).subscribe((view) => {
|
|
1973
|
+
this._currentDisplayColumns$.next(cloneDeep(view.columns));
|
|
1974
|
+
});
|
|
1975
|
+
}
|
|
1976
|
+
setColumnVisibility(name, visible) {
|
|
1977
|
+
const updatedColumns = this._currentDisplayColumns$.getValue().map((column) => {
|
|
1978
|
+
if (column.name === name) {
|
|
1979
|
+
return { ...column, visible };
|
|
1980
|
+
}
|
|
1981
|
+
else {
|
|
1982
|
+
return column;
|
|
1983
|
+
}
|
|
1984
|
+
});
|
|
1985
|
+
this._currentDisplayColumns$.next(updatedColumns);
|
|
1986
|
+
}
|
|
1987
|
+
get sorts$() {
|
|
1988
|
+
return this._currentSorts$.pipe(defaultIfEmpty([]));
|
|
1989
|
+
}
|
|
1990
|
+
get sortsCount$() {
|
|
1991
|
+
return this.view$.pipe(map((c) => c.sorts.length));
|
|
1992
|
+
}
|
|
1993
|
+
addSort() {
|
|
1994
|
+
this.view$.pipe(first()).subscribe((view) => {
|
|
1995
|
+
const currentSorts = this._currentSorts$.getValue();
|
|
1996
|
+
const name = view.columns.find((c) => !currentSorts.some((s) => s.name == c.name))?.name ?? '';
|
|
1997
|
+
if (name) {
|
|
1998
|
+
const sorts = [...currentSorts, { name, dir: 'asc' }];
|
|
1999
|
+
this._currentSorts$.next(sorts);
|
|
2000
|
+
}
|
|
2001
|
+
});
|
|
2105
2002
|
}
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
return this._config;
|
|
2003
|
+
removeSort(item) {
|
|
2004
|
+
const currentSorts = this._currentSorts$.getValue();
|
|
2005
|
+
const sorts = currentSorts.filter((c) => c != item);
|
|
2006
|
+
this._currentSorts$.next(sorts);
|
|
2111
2007
|
}
|
|
2112
|
-
|
|
2113
|
-
|
|
2008
|
+
resetSort() {
|
|
2009
|
+
this.view$.pipe(first()).subscribe((view) => {
|
|
2010
|
+
this._currentSorts$.next(cloneDeep(view.sorts));
|
|
2011
|
+
});
|
|
2114
2012
|
}
|
|
2115
|
-
|
|
2116
|
-
|
|
2013
|
+
updateSort(items) {
|
|
2014
|
+
this.view$.pipe(first()).subscribe((view) => {
|
|
2015
|
+
view.sorts = cloneDeep(items);
|
|
2016
|
+
this._views$.next(this._views$.value.map((v) => (v.name === this._currentView ? view : v)));
|
|
2017
|
+
const convertedSortItems = items.map((s) => ({
|
|
2018
|
+
field: s.name,
|
|
2019
|
+
dir: s.dir,
|
|
2020
|
+
}));
|
|
2021
|
+
this.dataSource.sort(...convertedSortItems);
|
|
2022
|
+
this.dataSource.refresh();
|
|
2023
|
+
});
|
|
2117
2024
|
}
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
const suggestedProps = this.entity.properties.find((c) => ['title', 'name', 'code'].includes(c.name));
|
|
2121
|
-
let suggestedFormat = 'Item #{{id}}';
|
|
2122
|
-
if (suggestedProps)
|
|
2123
|
-
suggestedFormat = `{{${suggestedProps.name}}}`;
|
|
2124
|
-
const title = this.formatService.format(this.entity.formats?.header ?? this.entity.formats?.default ?? suggestedFormat, 'string', this.data);
|
|
2125
|
-
return title;
|
|
2025
|
+
get conditions$() {
|
|
2026
|
+
return this._currentConditions$.pipe(defaultIfEmpty([]));
|
|
2126
2027
|
}
|
|
2127
|
-
get
|
|
2128
|
-
return
|
|
2028
|
+
get conditionsCount$() {
|
|
2029
|
+
return this.view$.pipe(map((c) => c.conditions.length));
|
|
2129
2030
|
}
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
return this.view.root.sections?.length
|
|
2133
|
-
? this.view.root.sections
|
|
2134
|
-
: [
|
|
2135
|
-
{
|
|
2136
|
-
name: 'default',
|
|
2137
|
-
title: 'Default',
|
|
2138
|
-
properties: this.view.root.properties,
|
|
2139
|
-
},
|
|
2140
|
-
];
|
|
2031
|
+
getInlineFilterTitles() {
|
|
2032
|
+
return this._inlineFilterItems.map((item) => item.title);
|
|
2141
2033
|
}
|
|
2142
|
-
|
|
2143
|
-
|
|
2034
|
+
addCondition(selectedFields) {
|
|
2035
|
+
const prevConditions = this._currentConditions$.getValue();
|
|
2036
|
+
const conditionsMap = new Map(prevConditions.map((item) => [item.name, item]));
|
|
2037
|
+
const newFields = selectedFields.map((field) => conditionsMap.get(field.name) || { name: field.name, operator: field.opr });
|
|
2038
|
+
this._currentConditions$.next(newFields);
|
|
2144
2039
|
}
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
section.sections = [
|
|
2150
|
-
{
|
|
2151
|
-
name: 'default',
|
|
2152
|
-
title: 'Details',
|
|
2153
|
-
properties: section.properties,
|
|
2154
|
-
},
|
|
2155
|
-
];
|
|
2156
|
-
}
|
|
2157
|
-
return of(section);
|
|
2158
|
-
}));
|
|
2040
|
+
removeCondition(item) {
|
|
2041
|
+
const currentConditions = this._currentConditions$.getValue();
|
|
2042
|
+
const conditions = currentConditions.filter((c) => c != item);
|
|
2043
|
+
this._currentConditions$.next(conditions);
|
|
2159
2044
|
}
|
|
2160
|
-
|
|
2161
|
-
|
|
2045
|
+
updateConditions(items) {
|
|
2046
|
+
this.view$.pipe(first()).subscribe((view) => {
|
|
2047
|
+
view.conditions = cloneDeep(items);
|
|
2048
|
+
this._views$.next(this._views$.value.map((v) => (v.name === this._currentView ? view : v)));
|
|
2049
|
+
});
|
|
2050
|
+
this.applyAllConditions();
|
|
2162
2051
|
}
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2052
|
+
handleInlineSearch(value) {
|
|
2053
|
+
const inlineConditions = [];
|
|
2054
|
+
this._inlineFilterItems?.forEach((property) => {
|
|
2055
|
+
if (property?.dataType == 'string' || property?.dataType == 'number') {
|
|
2056
|
+
inlineConditions.push({
|
|
2057
|
+
name: property.name,
|
|
2058
|
+
value: property.dataType == 'number' ? parseFloat(value) : value,
|
|
2059
|
+
operator: property.dataType == 'string' ? 'contains' : 'equal',
|
|
2060
|
+
});
|
|
2061
|
+
}
|
|
2062
|
+
});
|
|
2063
|
+
this.view$.pipe(first()).subscribe((view) => {
|
|
2064
|
+
view.inlineConditions = cloneDeep(inlineConditions);
|
|
2065
|
+
});
|
|
2066
|
+
this.applyAllConditions();
|
|
2067
|
+
}
|
|
2068
|
+
applyAllConditions() {
|
|
2069
|
+
const inlineConditions = {
|
|
2070
|
+
field: null,
|
|
2071
|
+
operator: null,
|
|
2072
|
+
logic: 'or',
|
|
2073
|
+
filters: [],
|
|
2169
2074
|
};
|
|
2170
|
-
const
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2075
|
+
const mainConditions = {
|
|
2076
|
+
field: null,
|
|
2077
|
+
operator: null,
|
|
2078
|
+
logic: 'and',
|
|
2079
|
+
filters: [],
|
|
2080
|
+
};
|
|
2081
|
+
this.view$.pipe(first()).subscribe((view) => {
|
|
2082
|
+
if (view.inlineConditions && view.inlineConditions.length) {
|
|
2083
|
+
view.inlineConditions?.forEach((c) => {
|
|
2084
|
+
if (c.value) {
|
|
2085
|
+
inlineConditions.filters?.push({
|
|
2086
|
+
field: c.name,
|
|
2087
|
+
operator: { type: c.operator },
|
|
2088
|
+
value: c.value,
|
|
2089
|
+
});
|
|
2090
|
+
}
|
|
2091
|
+
});
|
|
2174
2092
|
}
|
|
2175
|
-
|
|
2176
|
-
|
|
2093
|
+
if (view.conditions.length) {
|
|
2094
|
+
view.conditions.forEach((c) => {
|
|
2095
|
+
mainConditions.filters?.push({
|
|
2096
|
+
field: c.name,
|
|
2097
|
+
operator: { type: c.operator },
|
|
2098
|
+
value: c.value,
|
|
2099
|
+
});
|
|
2100
|
+
});
|
|
2177
2101
|
}
|
|
2102
|
+
this.dataSource.filter({
|
|
2103
|
+
field: null,
|
|
2104
|
+
logic: 'and',
|
|
2105
|
+
operator: null,
|
|
2106
|
+
filters: [mainConditions, inlineConditions],
|
|
2107
|
+
});
|
|
2108
|
+
this.dataSource.refresh();
|
|
2109
|
+
this._views$.next(this._views$.value.map((v) => (v.name === this._currentView ? view : v)));
|
|
2178
2110
|
});
|
|
2179
|
-
this._sections$.next(updatedSections);
|
|
2180
2111
|
}
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2112
|
+
resetConditions() {
|
|
2113
|
+
this.view$.pipe(first()).subscribe((view) => {
|
|
2114
|
+
this._currentConditions$.next(cloneDeep(view.conditions));
|
|
2115
|
+
});
|
|
2185
2116
|
}
|
|
2186
2117
|
}
|
|
2187
|
-
|
|
2118
|
+
const AXP_LISTVIEW_LOADER = new InjectionToken('AXP_LISTVIEW_LOADER');
|
|
2119
|
+
class AXPListViewLoaderFactory {
|
|
2188
2120
|
constructor() {
|
|
2121
|
+
this.cache = new Map();
|
|
2189
2122
|
this.entityService = inject(AXPEntityRegistryService);
|
|
2190
|
-
this.
|
|
2123
|
+
this.schemaService = inject(AXPSchemaRegistryService);
|
|
2191
2124
|
this.layout = inject(AXPLayoutService);
|
|
2192
|
-
this.store = inject(Store);
|
|
2193
2125
|
}
|
|
2194
|
-
async create(moduleName, entityName
|
|
2195
|
-
const config = await this.entityService.resolve(moduleName, entityName);
|
|
2126
|
+
async create(moduleName, entityName) {
|
|
2196
2127
|
this.layout.setNavigationLoading(true);
|
|
2197
|
-
|
|
2198
|
-
|
|
2128
|
+
const config = await this.entityService.resolve(moduleName, entityName);
|
|
2129
|
+
let result = this.cache.get(config.name);
|
|
2130
|
+
if (result) {
|
|
2199
2131
|
this.layout.setNavigationLoading(false);
|
|
2200
|
-
return
|
|
2132
|
+
return result;
|
|
2201
2133
|
}
|
|
2134
|
+
result = new AXPListViewLoaderDefault(config, this.schemaService);
|
|
2135
|
+
this.cache.set(config.name, result);
|
|
2202
2136
|
this.layout.setNavigationLoading(false);
|
|
2203
|
-
return
|
|
2137
|
+
return result;
|
|
2204
2138
|
}
|
|
2205
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type:
|
|
2206
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type:
|
|
2139
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPListViewLoaderFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2140
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPListViewLoaderFactory, providedIn: 'root' }); }
|
|
2207
2141
|
}
|
|
2208
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type:
|
|
2142
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPListViewLoaderFactory, decorators: [{
|
|
2209
2143
|
type: Injectable,
|
|
2210
2144
|
args: [{ providedIn: 'root' }]
|
|
2211
2145
|
}] });
|
|
2212
2146
|
|
|
2147
|
+
class AXPEntityQuickViewComponent extends AXBasePageComponent {
|
|
2148
|
+
/**
|
|
2149
|
+
*
|
|
2150
|
+
*/
|
|
2151
|
+
constructor(actions$) {
|
|
2152
|
+
super();
|
|
2153
|
+
this.actions$ = actions$;
|
|
2154
|
+
this.store = inject((Store));
|
|
2155
|
+
this.workflow = inject(AXPWorkflowService);
|
|
2156
|
+
this.canDelete = false;
|
|
2157
|
+
this.canCreate = false;
|
|
2158
|
+
this.canUpdate = false;
|
|
2159
|
+
}
|
|
2160
|
+
ngOnInit() {
|
|
2161
|
+
super.ngOnInit();
|
|
2162
|
+
//
|
|
2163
|
+
if (this.entity.views.quickView) {
|
|
2164
|
+
this.root = this.entity.views.quickView?.root;
|
|
2165
|
+
this.canDelete = this.entity.editOptions?.delete ?? true;
|
|
2166
|
+
this.canCreate = this.entity.editOptions?.create ?? true;
|
|
2167
|
+
this.canUpdate = this.entity.editOptions?.update ?? true;
|
|
2168
|
+
}
|
|
2169
|
+
}
|
|
2170
|
+
getProperties(names) {
|
|
2171
|
+
return this.entity.properties.filter((c) => names.includes(c.name));
|
|
2172
|
+
}
|
|
2173
|
+
handleCloseClick() {
|
|
2174
|
+
this.close();
|
|
2175
|
+
}
|
|
2176
|
+
handleCommandClick(command) {
|
|
2177
|
+
switch (command) {
|
|
2178
|
+
case 'delete':
|
|
2179
|
+
this.workflow.execute('delete-entity', {
|
|
2180
|
+
module: this.entity.module,
|
|
2181
|
+
entity: this.entity.name,
|
|
2182
|
+
ids: [this.data.id],
|
|
2183
|
+
});
|
|
2184
|
+
this.close();
|
|
2185
|
+
break;
|
|
2186
|
+
case 'details':
|
|
2187
|
+
this.workflow.execute('show-details', {
|
|
2188
|
+
payload: {
|
|
2189
|
+
module: this.entity.module,
|
|
2190
|
+
entity: this.entity.name,
|
|
2191
|
+
},
|
|
2192
|
+
id: this.data.id,
|
|
2193
|
+
});
|
|
2194
|
+
this.close();
|
|
2195
|
+
break;
|
|
2196
|
+
default:
|
|
2197
|
+
break;
|
|
2198
|
+
}
|
|
2199
|
+
}
|
|
2200
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPEntityQuickViewComponent, deps: [{ token: i1.Actions }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2201
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AXPEntityQuickViewComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "<div class=\"ax-flex ax-flex-col ax-gap-6 ax-p-4\">\n <div class=\"ax-flex ax-flex-col ax-gap-2\" *ngIf=\"root.properties?.length\">\n <div *ngFor=\"let p of getProperties(root.properties)\"\n class=\"ax-flex ax-p-4 odd:ax-bg-on-surface odd:ax-border-t odd:ax-border-b\">\n <div class=\"ax-min-w-[10rem] ax-text-gray-500\">\n <span>{{ p.title }}</span>\n </div>\n <div class=\"ax-min-w-[30rem]\">\n <axp-widget-renderer [schema]=\"p.schema\" [context]=\"data\" [prop]=\"p\"></axp-widget-renderer>\n </div>\n </div>\n </div>\n <div *ngFor=\"let s of root.sections\"\n class=\"ax-flex ax-flex-col ax-pb-3 last-of-type:ax-border-none last-of-type:ax-pb-3\">\n <div class=\"ax-pb-4\">\n <span class=\"ax-font-bold\">{{ s.title }}</span>\n </div>\n <div class=\"ax-flex ax-flex-col\">\n <div *ngFor=\"let p of getProperties(s.properties)\"\n class=\"ax-flex ax-flex-col md:ax-flex-row ax-p-3 odd:ax-bg-on-surface odd:ax-border-t odd:ax-border-b\">\n @if (s.options?.showPropTitle!=false) {\n <div class=\"ax-min-w-[10rem] ax-text-neutral-500 dark:ax-text-neutral-300 ax-mb-2 md:ax-mb-0\">\n <span>{{ p.title }}</span>\n </div>\n }\n <div class=\"md:ax-min-w-[30rem]\">\n <axp-widget-renderer [schema]=\"p.schema\" [context]=\"data\" [prop]=\"p\" [mode]=\"'view'\"></axp-widget-renderer>\n </div>\n </div>\n </div>\n </div>\n</div>\n<ax-footer>\n <ax-prefix> </ax-prefix>\n <ax-suffix>\n <ax-dropdown-button text=\"Close\" (onClick)=\"handleCloseClick()\">\n <ax-button-item-list>\n <ax-button-item text=\"View Details\" (onClick)=\"handleCommandClick('details')\">\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-info-circle\"></ax-icon>\n </ax-prefix>\n </ax-button-item>\n @if(canDelete)\n {\n <ax-button-item class=\"ax-text-danger\" text=\"Delete\" (onClick)=\"handleCommandClick('delete')\">\n <ax-prefix> <ax-icon icon=\"fas fa-trash fa-flip-horizontal\"></ax-icon> </ax-prefix></ax-button-item>\n }\n </ax-button-item-list>\n </ax-dropdown-button>\n </ax-suffix>\n</ax-footer>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: AXPSchemaModule }, { kind: "component", type: i10.AXPWidgetRendererComponent, selector: "axp-widget-renderer", inputs: ["context", "prop", "mode", "schema"] }, { kind: "ngmodule", type: AXPCommonWidgetModule }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i4$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i4$1.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-sub-title, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i4.AXButtonItemComponent, selector: "ax-button-item", inputs: ["color", "disabled", "text", "selected", "divided", "data", "name"], outputs: ["onClick", "onFocus", "onBlur", "disabledChange"] }, { kind: "component", type: i4.AXButtonItemListComponent, selector: "ax-button-item-list", inputs: ["items"], outputs: ["onItemClick"] }, { kind: "ngmodule", type: AXDropdownModule }, { kind: "ngmodule", type: AXDropdownButtonModule }, { kind: "component", type: i14.AXDropdownButtonComponent, selector: "ax-dropdown-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "type", "mode"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "lookChange", "colorChange", "disabledChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
2202
|
+
}
|
|
2203
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPEntityQuickViewComponent, decorators: [{
|
|
2204
|
+
type: Component,
|
|
2205
|
+
args: [{ encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [CommonModule, AXPSchemaModule, AXPCommonWidgetModule, AXDecoratorModule, AXButtonModule, AXDropdownModule, AXDropdownButtonModule], template: "<div class=\"ax-flex ax-flex-col ax-gap-6 ax-p-4\">\n <div class=\"ax-flex ax-flex-col ax-gap-2\" *ngIf=\"root.properties?.length\">\n <div *ngFor=\"let p of getProperties(root.properties)\"\n class=\"ax-flex ax-p-4 odd:ax-bg-on-surface odd:ax-border-t odd:ax-border-b\">\n <div class=\"ax-min-w-[10rem] ax-text-gray-500\">\n <span>{{ p.title }}</span>\n </div>\n <div class=\"ax-min-w-[30rem]\">\n <axp-widget-renderer [schema]=\"p.schema\" [context]=\"data\" [prop]=\"p\"></axp-widget-renderer>\n </div>\n </div>\n </div>\n <div *ngFor=\"let s of root.sections\"\n class=\"ax-flex ax-flex-col ax-pb-3 last-of-type:ax-border-none last-of-type:ax-pb-3\">\n <div class=\"ax-pb-4\">\n <span class=\"ax-font-bold\">{{ s.title }}</span>\n </div>\n <div class=\"ax-flex ax-flex-col\">\n <div *ngFor=\"let p of getProperties(s.properties)\"\n class=\"ax-flex ax-flex-col md:ax-flex-row ax-p-3 odd:ax-bg-on-surface odd:ax-border-t odd:ax-border-b\">\n @if (s.options?.showPropTitle!=false) {\n <div class=\"ax-min-w-[10rem] ax-text-neutral-500 dark:ax-text-neutral-300 ax-mb-2 md:ax-mb-0\">\n <span>{{ p.title }}</span>\n </div>\n }\n <div class=\"md:ax-min-w-[30rem]\">\n <axp-widget-renderer [schema]=\"p.schema\" [context]=\"data\" [prop]=\"p\" [mode]=\"'view'\"></axp-widget-renderer>\n </div>\n </div>\n </div>\n </div>\n</div>\n<ax-footer>\n <ax-prefix> </ax-prefix>\n <ax-suffix>\n <ax-dropdown-button text=\"Close\" (onClick)=\"handleCloseClick()\">\n <ax-button-item-list>\n <ax-button-item text=\"View Details\" (onClick)=\"handleCommandClick('details')\">\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-info-circle\"></ax-icon>\n </ax-prefix>\n </ax-button-item>\n @if(canDelete)\n {\n <ax-button-item class=\"ax-text-danger\" text=\"Delete\" (onClick)=\"handleCommandClick('delete')\">\n <ax-prefix> <ax-icon icon=\"fas fa-trash fa-flip-horizontal\"></ax-icon> </ax-prefix></ax-button-item>\n }\n </ax-button-item-list>\n </ax-dropdown-button>\n </ax-suffix>\n</ax-footer>" }]
|
|
2206
|
+
}], ctorParameters: () => [{ type: i1.Actions }] });
|
|
2207
|
+
|
|
2208
|
+
var entityQuickView_component = /*#__PURE__*/Object.freeze({
|
|
2209
|
+
__proto__: null,
|
|
2210
|
+
AXPEntityQuickViewComponent: AXPEntityQuickViewComponent
|
|
2211
|
+
});
|
|
2212
|
+
|
|
2213
2213
|
class AXPCustomReuseStrategy {
|
|
2214
2214
|
shouldDetach(route) {
|
|
2215
2215
|
return false;
|
|
@@ -2434,7 +2434,7 @@ const AX_ADMIN_ROUTES = [
|
|
|
2434
2434
|
|
|
2435
2435
|
class AXPLayoutModule {
|
|
2436
2436
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPLayoutModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2437
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.0", ngImport: i0, type: AXPLayoutModule, imports: [i10
|
|
2437
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.0", ngImport: i0, type: AXPLayoutModule, imports: [i10.AXPCommonModule, i1$4.AXPWorkflowModule], exports: [RouterModule] }); }
|
|
2438
2438
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPLayoutModule, imports: [AXPCommonModule.forChild({ errorHandlers: [AXMWorkflowErrorHandler] }),
|
|
2439
2439
|
AXPWorkflowModule.forChild({
|
|
2440
2440
|
actions: {
|