@acorex/platform 20.6.0-next.2 → 20.6.0-next.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/common/index.d.ts +7 -3
  2. package/core/index.d.ts +210 -56
  3. package/fesm2022/acorex-platform-auth.mjs +19 -19
  4. package/fesm2022/acorex-platform-auth.mjs.map +1 -1
  5. package/fesm2022/{acorex-platform-common-common-settings.provider-CLb2KMfv.mjs → acorex-platform-common-common-settings.provider-zhqNP3xb.mjs} +28 -4
  6. package/fesm2022/acorex-platform-common-common-settings.provider-zhqNP3xb.mjs.map +1 -0
  7. package/fesm2022/acorex-platform-common.mjs +104 -103
  8. package/fesm2022/acorex-platform-common.mjs.map +1 -1
  9. package/fesm2022/acorex-platform-core.mjs +279 -78
  10. package/fesm2022/acorex-platform-core.mjs.map +1 -1
  11. package/fesm2022/acorex-platform-domain.mjs +65 -20
  12. package/fesm2022/acorex-platform-domain.mjs.map +1 -1
  13. package/fesm2022/acorex-platform-layout-builder.mjs +56 -135
  14. package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
  15. package/fesm2022/acorex-platform-layout-components.mjs +1322 -409
  16. package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
  17. package/fesm2022/acorex-platform-layout-designer.mjs +73 -73
  18. package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
  19. package/fesm2022/acorex-platform-layout-entity.mjs +7736 -3813
  20. package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
  21. package/fesm2022/acorex-platform-layout-views.mjs +58 -40
  22. package/fesm2022/acorex-platform-layout-views.mjs.map +1 -1
  23. package/fesm2022/acorex-platform-layout-widget-core.mjs +91 -82
  24. package/fesm2022/acorex-platform-layout-widget-core.mjs.map +1 -1
  25. package/fesm2022/{acorex-platform-layout-widgets-button-widget-designer.component-lHfg4JFJ.mjs → acorex-platform-layout-widgets-button-widget-designer.component-C3VoBb_b.mjs} +4 -4
  26. package/fesm2022/{acorex-platform-layout-widgets-button-widget-designer.component-lHfg4JFJ.mjs.map → acorex-platform-layout-widgets-button-widget-designer.component-C3VoBb_b.mjs.map} +1 -1
  27. package/fesm2022/{acorex-platform-layout-widgets-extra-properties-schema-widget-edit.component-CMSnecnD.mjs → acorex-platform-layout-widgets-extra-properties-schema-widget-edit.component-fhhZOWul.mjs} +4 -4
  28. package/fesm2022/{acorex-platform-layout-widgets-extra-properties-schema-widget-edit.component-CMSnecnD.mjs.map → acorex-platform-layout-widgets-extra-properties-schema-widget-edit.component-fhhZOWul.mjs.map} +1 -1
  29. package/fesm2022/{acorex-platform-layout-widgets-extra-properties-schema-widget-view.component-DN-sIFYe.mjs → acorex-platform-layout-widgets-extra-properties-schema-widget-view.component-C3Qbs0fz.mjs} +4 -4
  30. package/fesm2022/{acorex-platform-layout-widgets-extra-properties-schema-widget-view.component-DN-sIFYe.mjs.map → acorex-platform-layout-widgets-extra-properties-schema-widget-view.component-C3Qbs0fz.mjs.map} +1 -1
  31. package/fesm2022/{acorex-platform-layout-widgets-extra-properties-values-widget-edit.component-Bn9w0SEz.mjs → acorex-platform-layout-widgets-extra-properties-values-widget-edit.component-CngQBUlN.mjs} +4 -4
  32. package/fesm2022/{acorex-platform-layout-widgets-extra-properties-values-widget-edit.component-Bn9w0SEz.mjs.map → acorex-platform-layout-widgets-extra-properties-values-widget-edit.component-CngQBUlN.mjs.map} +1 -1
  33. package/fesm2022/{acorex-platform-layout-widgets-extra-properties-values-widget-view.component-B8mgcvoX.mjs → acorex-platform-layout-widgets-extra-properties-values-widget-view.component-DSNo9e4W.mjs} +4 -4
  34. package/fesm2022/{acorex-platform-layout-widgets-extra-properties-values-widget-view.component-B8mgcvoX.mjs.map → acorex-platform-layout-widgets-extra-properties-values-widget-view.component-DSNo9e4W.mjs.map} +1 -1
  35. package/fesm2022/{acorex-platform-layout-widgets-extra-properties-widget-edit.component-Bhof2SY8.mjs → acorex-platform-layout-widgets-extra-properties-widget-edit.component-CL0CwEHX.mjs} +4 -4
  36. package/fesm2022/{acorex-platform-layout-widgets-extra-properties-widget-edit.component-Bhof2SY8.mjs.map → acorex-platform-layout-widgets-extra-properties-widget-edit.component-CL0CwEHX.mjs.map} +1 -1
  37. package/fesm2022/{acorex-platform-layout-widgets-extra-properties-widget-view.component-CeQIvKVV.mjs → acorex-platform-layout-widgets-extra-properties-widget-view.component-B6Fi0xTw.mjs} +4 -4
  38. package/fesm2022/{acorex-platform-layout-widgets-extra-properties-widget-view.component-CeQIvKVV.mjs.map → acorex-platform-layout-widgets-extra-properties-widget-view.component-B6Fi0xTw.mjs.map} +1 -1
  39. package/fesm2022/{acorex-platform-layout-widgets-file-list-popup.component-BOP7jFp4.mjs → acorex-platform-layout-widgets-file-list-popup.component-D0y-9nE5.mjs} +6 -6
  40. package/fesm2022/{acorex-platform-layout-widgets-file-list-popup.component-BOP7jFp4.mjs.map → acorex-platform-layout-widgets-file-list-popup.component-D0y-9nE5.mjs.map} +1 -1
  41. package/fesm2022/acorex-platform-layout-widgets-image-preview.popup-V31OpYah.mjs +30 -0
  42. package/fesm2022/acorex-platform-layout-widgets-image-preview.popup-V31OpYah.mjs.map +1 -0
  43. package/fesm2022/{acorex-platform-layout-widgets-page-widget-designer.component-C57lyBs3.mjs → acorex-platform-layout-widgets-page-widget-designer.component-BtZMBxYp.mjs} +4 -4
  44. package/fesm2022/{acorex-platform-layout-widgets-page-widget-designer.component-C57lyBs3.mjs.map → acorex-platform-layout-widgets-page-widget-designer.component-BtZMBxYp.mjs.map} +1 -1
  45. package/fesm2022/{acorex-platform-layout-widgets-tabular-data-edit-popup.component-fr77M8Z0.mjs → acorex-platform-layout-widgets-tabular-data-edit-popup.component-m8rHZP8L.mjs} +6 -6
  46. package/fesm2022/acorex-platform-layout-widgets-tabular-data-edit-popup.component-m8rHZP8L.mjs.map +1 -0
  47. package/fesm2022/{acorex-platform-layout-widgets-tabular-data-view-popup.component-CvZTRhct.mjs → acorex-platform-layout-widgets-tabular-data-view-popup.component-y8vjUiVs.mjs} +5 -5
  48. package/fesm2022/acorex-platform-layout-widgets-tabular-data-view-popup.component-y8vjUiVs.mjs.map +1 -0
  49. package/fesm2022/{acorex-platform-layout-widgets-text-block-widget-designer.component-DHES_0ot.mjs → acorex-platform-layout-widgets-text-block-widget-designer.component-Df1BFkSa.mjs} +4 -4
  50. package/fesm2022/{acorex-platform-layout-widgets-text-block-widget-designer.component-DHES_0ot.mjs.map → acorex-platform-layout-widgets-text-block-widget-designer.component-Df1BFkSa.mjs.map} +1 -1
  51. package/fesm2022/acorex-platform-layout-widgets.mjs +3809 -2060
  52. package/fesm2022/acorex-platform-layout-widgets.mjs.map +1 -1
  53. package/fesm2022/acorex-platform-native.mjs +7 -7
  54. package/fesm2022/acorex-platform-native.mjs.map +1 -1
  55. package/fesm2022/acorex-platform-runtime.mjs +119 -43
  56. package/fesm2022/acorex-platform-runtime.mjs.map +1 -1
  57. package/fesm2022/{acorex-platform-themes-default-entity-master-create-view.component-C_XmJV7Y.mjs → acorex-platform-themes-default-entity-master-create-view.component-mARj77Mr.mjs} +30 -9
  58. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-mARj77Mr.mjs.map +1 -0
  59. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-D5K0XUqM.mjs +1522 -0
  60. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-D5K0XUqM.mjs.map +1 -0
  61. package/fesm2022/{acorex-platform-themes-default-entity-master-modify-view.component-DJPDil7w.mjs → acorex-platform-themes-default-entity-master-modify-view.component-BTA6h7Xd.mjs} +4 -4
  62. package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-BTA6h7Xd.mjs.map +1 -0
  63. package/fesm2022/{acorex-platform-themes-default-entity-master-single-view.component-BArdGNfr.mjs → acorex-platform-themes-default-entity-master-single-view.component-B_P0a5KW.mjs} +7 -7
  64. package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-B_P0a5KW.mjs.map +1 -0
  65. package/fesm2022/{acorex-platform-themes-default-error-401.component-D7rEInHg.mjs → acorex-platform-themes-default-error-401.component-cfREo88K.mjs} +4 -4
  66. package/fesm2022/{acorex-platform-themes-default-error-401.component-D7rEInHg.mjs.map → acorex-platform-themes-default-error-401.component-cfREo88K.mjs.map} +1 -1
  67. package/fesm2022/{acorex-platform-themes-default-error-404.component-BTZlVrd8.mjs → acorex-platform-themes-default-error-404.component-CdCV5ZoA.mjs} +4 -4
  68. package/fesm2022/{acorex-platform-themes-default-error-404.component-BTZlVrd8.mjs.map → acorex-platform-themes-default-error-404.component-CdCV5ZoA.mjs.map} +1 -1
  69. package/fesm2022/{acorex-platform-themes-default-error-offline.component-BhvEi6nX.mjs → acorex-platform-themes-default-error-offline.component-E7SzBcAt.mjs} +4 -4
  70. package/fesm2022/{acorex-platform-themes-default-error-offline.component-BhvEi6nX.mjs.map → acorex-platform-themes-default-error-offline.component-E7SzBcAt.mjs.map} +1 -1
  71. package/fesm2022/acorex-platform-themes-default.mjs +156 -53
  72. package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
  73. package/fesm2022/acorex-platform-themes-shared-icon-chooser-column.component-C0EpfU2k.mjs +55 -0
  74. package/fesm2022/acorex-platform-themes-shared-icon-chooser-column.component-C0EpfU2k.mjs.map +1 -0
  75. package/fesm2022/{acorex-platform-themes-shared-icon-chooser-view.component-BXV40gay.mjs → acorex-platform-themes-shared-icon-chooser-view.component-9W52W6Nu.mjs} +4 -4
  76. package/fesm2022/{acorex-platform-themes-shared-icon-chooser-view.component-BXV40gay.mjs.map → acorex-platform-themes-shared-icon-chooser-view.component-9W52W6Nu.mjs.map} +1 -1
  77. package/fesm2022/{acorex-platform-themes-shared-theme-color-chooser-column.component-BpIf4s53.mjs → acorex-platform-themes-shared-theme-color-chooser-column.component-DTnfRy5f.mjs} +4 -4
  78. package/fesm2022/{acorex-platform-themes-shared-theme-color-chooser-column.component-BpIf4s53.mjs.map → acorex-platform-themes-shared-theme-color-chooser-column.component-DTnfRy5f.mjs.map} +1 -1
  79. package/fesm2022/{acorex-platform-themes-shared-theme-color-chooser-view.component-C9gvfQfX.mjs → acorex-platform-themes-shared-theme-color-chooser-view.component-DY0JtT1v.mjs} +4 -4
  80. package/fesm2022/{acorex-platform-themes-shared-theme-color-chooser-view.component-C9gvfQfX.mjs.map → acorex-platform-themes-shared-theme-color-chooser-view.component-DY0JtT1v.mjs.map} +1 -1
  81. package/fesm2022/acorex-platform-themes-shared.mjs +58 -153
  82. package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
  83. package/fesm2022/acorex-platform-workflow.mjs +327 -151
  84. package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
  85. package/layout/builder/index.d.ts +6 -33
  86. package/layout/components/index.d.ts +306 -61
  87. package/layout/designer/index.d.ts +1 -1
  88. package/layout/entity/index.d.ts +595 -94
  89. package/layout/views/index.d.ts +6 -58
  90. package/layout/widget-core/index.d.ts +31 -26
  91. package/layout/widgets/README.md +0 -1
  92. package/layout/widgets/index.d.ts +325 -99
  93. package/package.json +1 -1
  94. package/runtime/index.d.ts +36 -8
  95. package/themes/default/index.d.ts +32 -77
  96. package/themes/shared/index.d.ts +1 -39
  97. package/workflow/index.d.ts +909 -457
  98. package/fesm2022/acorex-platform-common-common-settings.provider-CLb2KMfv.mjs.map +0 -1
  99. package/fesm2022/acorex-platform-layout-entity-create-entity.command-BsLbiAdA.mjs +0 -52
  100. package/fesm2022/acorex-platform-layout-entity-create-entity.command-BsLbiAdA.mjs.map +0 -1
  101. package/fesm2022/acorex-platform-layout-widgets-tabular-data-edit-popup.component-fr77M8Z0.mjs.map +0 -1
  102. package/fesm2022/acorex-platform-layout-widgets-tabular-data-view-popup.component-CvZTRhct.mjs.map +0 -1
  103. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-C_XmJV7Y.mjs.map +0 -1
  104. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-BkY9HXcT.mjs +0 -782
  105. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-BkY9HXcT.mjs.map +0 -1
  106. package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-DJPDil7w.mjs.map +0 -1
  107. package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-BArdGNfr.mjs.map +0 -1
@@ -1,782 +0,0 @@
1
- import { AXActionSheetModule } from '@acorex/components/action-sheet';
2
- import * as i7 from '@acorex/components/data-table';
3
- import { AXDataTableModule } from '@acorex/components/data-table';
4
- import { AXDrawerModule } from '@acorex/components/drawer';
5
- import * as i1$1 from '@acorex/core/platform';
6
- import * as i0 from '@angular/core';
7
- import { inject, input, viewChild, signal, ViewEncapsulation, Component, computed, effect, Input, ChangeDetectionStrategy } from '@angular/core';
8
- import { Router, ActivatedRoute, RouterModule } from '@angular/router';
9
- import { AXBadgeModule } from '@acorex/components/badge';
10
- import { AXBreadcrumbsModule } from '@acorex/components/breadcrumbs';
11
- import * as i3$1 from '@acorex/components/button';
12
- import { AXButtonModule } from '@acorex/components/button';
13
- import * as i2 from '@acorex/components/decorators';
14
- import { AXDecoratorModule } from '@acorex/components/decorators';
15
- import { AXDialogModule } from '@acorex/components/dialog';
16
- import * as i5 from '@acorex/components/dropdown';
17
- import { AXDropdownModule } from '@acorex/components/dropdown';
18
- import { AXFormModule } from '@acorex/components/form';
19
- import { AXLoadingModule } from '@acorex/components/loading';
20
- import * as i3$2 from '@acorex/components/popover';
21
- import { AXPopoverModule } from '@acorex/components/popover';
22
- import * as i6 from '@acorex/components/search-box';
23
- import { AXSearchBoxModule } from '@acorex/components/search-box';
24
- import { AXTabsModule } from '@acorex/components/tabs';
25
- import { AXTooltipModule } from '@acorex/components/tooltip';
26
- import * as i10 from '@acorex/core/translation';
27
- import { AXTranslationService, AXTranslationModule, translateSync } from '@acorex/core/translation';
28
- import { AXPAuthModule } from '@acorex/platform/auth';
29
- import { AXPThemeLayoutBlockComponent, AXPThemeLayoutHeaderComponent, AXPThemeLayoutToolbarComponent, AXPStateMessageComponent, AXPQueryFiltersComponent, AXPQuerySortsComponent, AXPQueryViewsComponent, AXPQueryColumnsComponent, AXPThemeLayoutStartSideComponent } from '@acorex/platform/layout/components';
30
- import * as i7$1 from '@acorex/platform/layout/widget-core';
31
- import { AXPWidgetCoreModule } from '@acorex/platform/layout/widget-core';
32
- import { AXPWidgetsModule } from '@acorex/platform/layout/widgets';
33
- import { DragDropModule } from '@angular/cdk/drag-drop';
34
- import * as i1 from '@angular/common';
35
- import { CommonModule } from '@angular/common';
36
- import { FormsModule } from '@angular/forms';
37
- import { AXDropdownButtonModule } from '@acorex/components/dropdown-button';
38
- import { AXPPageLayoutBaseComponent, AXPPageLayoutComponent, AXPPageLayoutBase } from '@acorex/platform/layout/views';
39
- import { AXPLayoutThemeService } from '@acorex/platform/themes/shared';
40
- import * as i3 from '@acorex/components/skeleton';
41
- import { AXSkeletonModule } from '@acorex/components/skeleton';
42
- import * as i2$1 from '@acorex/components/tree-view';
43
- import { AXTreeViewModule } from '@acorex/components/tree-view';
44
- import { AXPWorkflowService } from '@acorex/platform/workflow';
45
- import { AXPEntityResolver, AXPEntityListViewColumnViewModel } from '@acorex/platform/layout/entity';
46
-
47
- class AXPEntityCategoryComponent {
48
- constructor() {
49
- this.entityResolver = inject(AXPEntityResolver);
50
- this.translate = inject(AXTranslationService);
51
- this.workflow = inject(AXPWorkflowService);
52
- this.vm = input.required(...(ngDevMode ? [{ debugName: "vm" }] : []));
53
- this.tree = viewChild('tree', ...(ngDevMode ? [{ debugName: "tree" }] : []));
54
- this.searchValue = input('', ...(ngDevMode ? [{ debugName: "searchValue" }] : []));
55
- this.isLoading = signal(true, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
56
- this.loadingTimeoutId = null;
57
- this.LOADING_DELAY = 300; // Show skeleton only if loading takes more than 300ms
58
- this.basicQueryEvent = {
59
- skip: 0,
60
- take: 1000,
61
- };
62
- this.treeItems = signal([
63
- {
64
- expand: true,
65
- children: [],
66
- },
67
- ], ...(ngDevMode ? [{ debugName: "treeItems" }] : []));
68
- }
69
- ngOnInit() {
70
- this.getCategories();
71
- }
72
- async handleCategorySearchChange(e) {
73
- if (this.categoryEntityDef) {
74
- // Set loading state with delay to avoid flickering
75
- this.setLoadingWithDelay(true);
76
- const categoryInlineFilters = this.categoryEntityDef.properties.filter((p) => p.options?.filter?.inline?.enabled);
77
- const event = {
78
- ...this.basicQueryEvent,
79
- filter: {
80
- filters: [
81
- {
82
- filters: categoryInlineFilters.map((cif) => ({
83
- field: cif.name,
84
- operator: {
85
- type: 'contains',
86
- },
87
- value: e.value,
88
- })),
89
- logic: 'or',
90
- },
91
- {
92
- value: true,
93
- field: this.categoryEntityDef.parentKey,
94
- operator: {
95
- type: 'isEmpty',
96
- },
97
- },
98
- ],
99
- logic: 'and',
100
- },
101
- };
102
- const res = await this.categoryEntityQueryFunc(event);
103
- this.treeItems.update((prev) => prev.map((item) => ({ ...item, children: res.items })));
104
- this.clearLoadingState();
105
- }
106
- }
107
- async getCategories() {
108
- // Set loading state with delay to avoid flickering
109
- this.setLoadingWithDelay(true);
110
- this.categoryEntityDef = await this.getCategoryEntityDef();
111
- this.categoryEntityQueryFunc = this.categoryEntityDef?.queries.list?.execute;
112
- const res = await this.categoryEntityQueryFunc(this.basicQueryEvent);
113
- const textField = this.vm().entityDef.category?.textField || 'title';
114
- const valueField = this.vm().entityDef.category?.valueField || 'id';
115
- const updatedItems = {
116
- expand: true,
117
- [textField]: await this.translate.translateAsync('@general:terms.interface.selection.all-items'),
118
- [valueField]: 'all',
119
- children: res.items,
120
- };
121
- this.treeItems.update((prev) => prev.map((_) => updatedItems));
122
- this.clearLoadingState();
123
- }
124
- async handleCollapseChanged(e) {
125
- await this.loadChildrenAtNode(e.data.id);
126
- }
127
- async getCategoryEntityDef() {
128
- const [module, entity] = this.vm().entityDef.category?.entity?.split('.') || [];
129
- return await this.entityResolver.get(module, entity);
130
- }
131
- handleNodeClick(event) {
132
- const filters = this.vm()
133
- .entityDef.category?.applyConditions?.map((f) => {
134
- return event.data[f.value] !== 'all'
135
- ? {
136
- field: f.name,
137
- value: event.data[f.value],
138
- operator: f.operator,
139
- }
140
- : null;
141
- })
142
- .filter((item) => item != null);
143
- const viewFilters = this.vm()
144
- .view()
145
- .conditions.map((i) => ({ ...i, field: i.name }));
146
- const newFilters = [...viewFilters, ...filters];
147
- // this.vm().filterQueries.update((prev) => [...prev, ...filters!]);
148
- this.vm().dataSource.filter({
149
- filters: newFilters,
150
- logic: 'and',
151
- });
152
- this.vm().dataSource.refresh();
153
- }
154
- //#region ---- Utility Methods ----
155
- /** Loads children for a given node id and updates the tree in place. */
156
- async loadChildrenAtNode(targetId) {
157
- this.tree()?.setNodeLoading(targetId, true);
158
- const event = {
159
- ...this.basicQueryEvent,
160
- filter: {
161
- field: this.categoryEntityDef?.parentKey,
162
- value: targetId,
163
- operator: { type: 'equal' },
164
- },
165
- };
166
- const children = await this.categoryEntityQueryFunc(event);
167
- const updateChildrenAtPath = (items, id) => {
168
- return items.map((item) => {
169
- if (item.id === id) {
170
- return { ...item, children: children.items };
171
- }
172
- if (item.children?.length) {
173
- return { ...item, children: updateChildrenAtPath(item.children, id) };
174
- }
175
- return item;
176
- });
177
- };
178
- this.treeItems.update((prev) => prev.map((i) => ({ ...i, children: updateChildrenAtPath(prev[0].children, targetId) })));
179
- this.tree()?.setNodeLoading(targetId, false);
180
- }
181
- /** Returns the module.entity key for the configured category entity. */
182
- getCategoryEntityKey() {
183
- return this.vm().entityDef.category?.entity;
184
- }
185
- /** Refresh tree after CRUD operations. */
186
- async refreshAfterChange(parentId) {
187
- if (parentId) {
188
- await this.loadChildrenAtNode(parentId);
189
- }
190
- else {
191
- await this.getCategories();
192
- }
193
- }
194
- //#endregion
195
- //#region ---- UI Handlers ----
196
- /** Create a new root category node. */
197
- async handleCreateRootClick(e) {
198
- e.nativeEvent.preventDefault();
199
- e.nativeEvent.stopPropagation();
200
- await this.workflow.execute('create-entity', {
201
- entity: this.getCategoryEntityKey(),
202
- options: { process: { redirect: false } },
203
- });
204
- await this.refreshAfterChange();
205
- }
206
- /** Create a new child under the given node. */
207
- async handleCreateChildClick(node, e) {
208
- e.nativeEvent.preventDefault();
209
- e.nativeEvent.stopPropagation();
210
- const parentKey = this.categoryEntityDef?.parentKey;
211
- const data = {};
212
- if (parentKey) {
213
- data[parentKey] = node.id;
214
- }
215
- await this.workflow.execute('create-entity', {
216
- entity: this.getCategoryEntityKey(),
217
- data,
218
- options: { process: { redirect: false, canCreateNewOne: true } },
219
- });
220
- await this.refreshAfterChange(node.id);
221
- }
222
- /** Update the given node. */
223
- async handleEditNodeClick(node, e) {
224
- e.nativeEvent.preventDefault();
225
- e.nativeEvent.stopPropagation();
226
- await this.workflow.execute('quick-modify-entity', {
227
- entity: this.getCategoryEntityKey(),
228
- data: node,
229
- options: { layout: { size: 'md' } },
230
- });
231
- await this.refreshAfterChange(node[this.categoryEntityDef?.parentKey]);
232
- }
233
- /** Delete the given node. */
234
- async handleDeleteNodeClick(node, e) {
235
- e.nativeEvent.preventDefault();
236
- e.nativeEvent.stopPropagation();
237
- await this.workflow.execute('delete-entity', {
238
- entity: this.getCategoryEntityKey(),
239
- data: node,
240
- options: { process: { showResult: true } },
241
- });
242
- await this.refreshAfterChange(node[this.categoryEntityDef?.parentKey]);
243
- }
244
- //#endregion
245
- //#region ---- Loading State Management ----
246
- /**
247
- * Set loading state with delay to avoid flickering for fast responses
248
- */
249
- setLoadingWithDelay(loading) {
250
- if (loading) {
251
- // Clear any existing timeout
252
- if (this.loadingTimeoutId) {
253
- clearTimeout(this.loadingTimeoutId);
254
- }
255
- // Only show skeleton if loading takes more than LOADING_DELAY ms
256
- this.loadingTimeoutId = setTimeout(() => {
257
- this.isLoading.set(true);
258
- this.loadingTimeoutId = null;
259
- }, this.LOADING_DELAY);
260
- }
261
- }
262
- /**
263
- * Clear loading state and cancel any pending timeout
264
- */
265
- clearLoadingState() {
266
- // Cancel the delayed loading state if it hasn't been set yet
267
- if (this.loadingTimeoutId) {
268
- clearTimeout(this.loadingTimeoutId);
269
- this.loadingTimeoutId = null;
270
- }
271
- // Clear the loading state
272
- this.isLoading.set(false);
273
- }
274
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AXPEntityCategoryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
275
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", type: AXPEntityCategoryComponent, isStandalone: true, selector: "axp-entity-category", inputs: { vm: { classPropertyName: "vm", publicName: "vm", isSignal: true, isRequired: true, transformFunction: null }, searchValue: { classPropertyName: "searchValue", publicName: "searchValue", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "tree", first: true, predicate: ["tree"], descendants: true, isSignal: true }], ngImport: i0, template: "<axp-layout-header>\n <axp-layout-title>{{\n vm().entityDef.category?.title || '@general:terms.classification.category' | translate | async\n }}</axp-layout-title>\n <axp-layout-toolbar>\n <ax-search-box\n (onValueChanged)=\"handleCategorySearchChange($event)\"\n [delayTime]=\"300\"\n [placeholder]=\"'@general:terms.interface.category.search.placeholder' | translate | async\"\n >\n </ax-search-box>\n </axp-layout-toolbar>\n</axp-layout-header>\n<axp-layout-content>\n @if (isLoading()) {\n <div class=\"ax-p-4 ax-flex ax-flex-col ax-gap-3\">\n <ax-skeleton class=\"ax-w-full ax-h-6 ax-rounded-md\"></ax-skeleton>\n <ax-skeleton class=\"ax-w-full ax-h-6 ax-rounded-md\"></ax-skeleton>\n <ax-skeleton class=\"ax-w-full ax-h-6 ax-rounded-md\"></ax-skeleton>\n <ax-skeleton class=\"ax-w-full ax-h-6 ax-rounded-md\"></ax-skeleton>\n <ax-skeleton class=\"ax-w-full ax-h-6 ax-rounded-md\"></ax-skeleton>\n <ax-skeleton class=\"ax-w-full ax-h-6 ax-rounded-md\"></ax-skeleton>\n </div>\n } @else if (treeItems()[0].children.length) {\n <div class=\"ax-px-4 ax-max-h-[calc(100vh-250px)] ax-overflow-auto\">\n <ax-tree-view\n (onNodeClick)=\"handleNodeClick($event)\"\n (onCollapsedChanged)=\"handleCollapseChanged($event)\"\n [showCheckbox]=\"false\"\n [itemTemplate]=\"itemTemplate\"\n #treeRef\n [textField]=\"vm().entityDef.category?.textField || 'title'\"\n [valueField]=\"vm().entityDef.category?.valueField || 'id'\"\n [expandedField]=\"'expand'\"\n [items]=\"treeItems()\"\n #tree\n >\n </ax-tree-view>\n </div>\n } @else {\n <axp-state-message\n icon=\"fa-light fa-folder-open\"\n [title]=\"'@general:terms.interface.category.search.no-records.title'\"\n [description]=\"'@general:terms.interface.category.search.no-records.description'\"\n >\n <ax-button\n slot=\"actions\"\n (onClick)=\"handleCreateRootClick($event)\"\n look=\"solid\"\n color=\"primary\"\n [text]=\"'@general:actions.add-new.title' | translate | async\"\n >\n <ax-icon class=\"fas fa-plus\"></ax-icon>\n </ax-button>\n </axp-state-message>\n }\n\n <ng-template #itemTemplate let-item>\n <div class=\"ax-flex ax-items-center ax-justify-between ax-w-full ax-gap-2 ax-overflow-hidden\">\n <div class=\"ax-flex ax-items-center ax-gap-2 ax-min-w-0\">\n <ax-icon class=\"fas ax-text-warning fa-folder\"></ax-icon>\n <span class=\"ax-truncate\">{{ item.title }}</span>\n </div>\n @if (item.id && item.id !== 'all') {\n <div class=\"ax-flex ax-items-center ax-gap-1\">\n <ax-button class=\"ax-xs\" color=\"default\" look=\"blank\" (onClick)=\"$event.nativeEvent.stopPropagation()\">\n <ax-icon class=\"fas fa-ellipsis-v\"></ax-icon>\n <ax-dropdown-panel>\n <ax-button-item-list>\n <ax-button-item\n (onClick)=\"handleCreateChildClick(item, $event)\"\n look=\"blank\"\n color=\"default\"\n text=\"Add New Child\"\n >\n <ax-icon class=\"fas fa-plus\"></ax-icon>\n </ax-button-item>\n <ax-button-item (onClick)=\"handleEditNodeClick(item, $event)\" look=\"blank\" text=\"Edit\">\n <ax-icon class=\"fas fa-pen\"></ax-icon>\n </ax-button-item>\n <ax-button-item\n (onClick)=\"handleDeleteNodeClick(item, $event)\"\n color=\"danger\"\n look=\"blank\"\n text=\"Delete\"\n >\n <ax-icon class=\"fas fa-trash\"></ax-icon>\n </ax-button-item>\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n </div>\n } @else if (item.id === 'all') {\n <div class=\"ax-flex ax-items-center ax-gap-1\">\n <ax-button class=\"ax-xs\" (onClick)=\"handleCreateRootClick($event)\" look=\"blank\" color=\"default\">\n <ax-icon class=\"fas fa-plus\"></ax-icon>\n </ax-button>\n </div>\n }\n </div>\n </ng-template>\n</axp-layout-content>\n", styles: ["ax-tree-view-item .ax-tree-view-items{width:100%;min-width:0px}ax-tree-view-item .ax-tree-view-items>div{width:100%}ax-tree-view-item .ax-state-tree-view-active{background-color:rgb(var(--ax-sys-color-light-surface))!important;color:rgb(var(--ax-sys-color-on-light-surface))!important;border-color:rgb(var(--ax-sys-color-border-light-surface))!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i2.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "ngmodule", type: AXTreeViewModule }, { kind: "component", type: i2$1.AXTreeViewComponent, selector: "ax-tree-view", inputs: ["items", "showCheckbox", "hasCheckboxField", "selectionMode", "selectionBehavior", "selectionScope", "focusNodeEnabled", "valueField", "textField", "visibleField", "disableField", "hasChildField", "selectedField", "expandedField", "tooltipField", "childrenField", "activeField", "indeterminateField", "parentField", "iconField", "toggleIcons", "look", "showEmptyNodeMassage", "itemTemplate", "emptyTemplate", "expandOn"], outputs: ["onSelectionChanged", "onItemSelectedChanged", "onNodeClick", "onCollapsedChanged", "onNodedbClick"] }, { kind: "ngmodule", type: AXSkeletonModule }, { kind: "component", type: i3.AXSkeletonComponent, selector: "ax-skeleton", inputs: ["animated"] }, { kind: "component", type: AXPThemeLayoutBlockComponent, selector: " axp-page-content, axp-page-footer-container, axp-page-footer, axp-page-header, axp-page-header-container, axp-page-toolbar, axp-layout-content, axp-layout-page-content, axp-layout-sections, axp-layout-body, axp-layout-page-body, axp-layout-prefix, axp-layout-suffix, axp-layout-title-bar, axp-layout-title, axp-layout-title-actions, axp-layout-nav-button, axp-layout-description, axp-layout-breadcrumbs, axp-layout-list-action, " }, { kind: "ngmodule", type: AXSearchBoxModule }, { kind: "component", type: i6.AXSearchBoxComponent, selector: "ax-search-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "value", "state", "name", "id", "look", "class", "delayTime", "type"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "component", type: AXPThemeLayoutHeaderComponent, selector: "axp-layout-header" }, { kind: "component", type: AXPThemeLayoutToolbarComponent, selector: "axp-layout-toolbar" }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i3$1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "component", type: i3$1.AXButtonItemComponent, selector: "ax-button-item", inputs: ["color", "disabled", "text", "selected", "divided", "data", "name"], outputs: ["onClick", "onFocus", "onBlur", "disabledChange"] }, { kind: "component", type: i3$1.AXButtonItemListComponent, selector: "ax-button-item-list", inputs: ["items"], outputs: ["onItemClick"] }, { kind: "ngmodule", type: AXDropdownModule }, { kind: "component", type: i5.AXDropdownPanelComponent, selector: "ax-dropdown-panel", inputs: ["isOpen", "fitParent", "dropdownWidth", "position", "placement", "_target", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "component", type: AXPStateMessageComponent, selector: "axp-state-message", inputs: ["mode", "icon", "title", "description", "variant"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i10.AXTranslatorPipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None }); }
276
- }
277
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AXPEntityCategoryComponent, decorators: [{
278
- type: Component,
279
- args: [{ selector: 'axp-entity-category', standalone: true, encapsulation: ViewEncapsulation.None, imports: [
280
- CommonModule,
281
- AXDecoratorModule,
282
- AXTreeViewModule,
283
- AXSkeletonModule,
284
- AXPThemeLayoutBlockComponent,
285
- AXSearchBoxModule,
286
- AXPThemeLayoutHeaderComponent,
287
- AXPThemeLayoutToolbarComponent,
288
- AXTranslationModule,
289
- AXButtonModule,
290
- AXDropdownModule,
291
- AXPStateMessageComponent
292
- ], template: "<axp-layout-header>\n <axp-layout-title>{{\n vm().entityDef.category?.title || '@general:terms.classification.category' | translate | async\n }}</axp-layout-title>\n <axp-layout-toolbar>\n <ax-search-box\n (onValueChanged)=\"handleCategorySearchChange($event)\"\n [delayTime]=\"300\"\n [placeholder]=\"'@general:terms.interface.category.search.placeholder' | translate | async\"\n >\n </ax-search-box>\n </axp-layout-toolbar>\n</axp-layout-header>\n<axp-layout-content>\n @if (isLoading()) {\n <div class=\"ax-p-4 ax-flex ax-flex-col ax-gap-3\">\n <ax-skeleton class=\"ax-w-full ax-h-6 ax-rounded-md\"></ax-skeleton>\n <ax-skeleton class=\"ax-w-full ax-h-6 ax-rounded-md\"></ax-skeleton>\n <ax-skeleton class=\"ax-w-full ax-h-6 ax-rounded-md\"></ax-skeleton>\n <ax-skeleton class=\"ax-w-full ax-h-6 ax-rounded-md\"></ax-skeleton>\n <ax-skeleton class=\"ax-w-full ax-h-6 ax-rounded-md\"></ax-skeleton>\n <ax-skeleton class=\"ax-w-full ax-h-6 ax-rounded-md\"></ax-skeleton>\n </div>\n } @else if (treeItems()[0].children.length) {\n <div class=\"ax-px-4 ax-max-h-[calc(100vh-250px)] ax-overflow-auto\">\n <ax-tree-view\n (onNodeClick)=\"handleNodeClick($event)\"\n (onCollapsedChanged)=\"handleCollapseChanged($event)\"\n [showCheckbox]=\"false\"\n [itemTemplate]=\"itemTemplate\"\n #treeRef\n [textField]=\"vm().entityDef.category?.textField || 'title'\"\n [valueField]=\"vm().entityDef.category?.valueField || 'id'\"\n [expandedField]=\"'expand'\"\n [items]=\"treeItems()\"\n #tree\n >\n </ax-tree-view>\n </div>\n } @else {\n <axp-state-message\n icon=\"fa-light fa-folder-open\"\n [title]=\"'@general:terms.interface.category.search.no-records.title'\"\n [description]=\"'@general:terms.interface.category.search.no-records.description'\"\n >\n <ax-button\n slot=\"actions\"\n (onClick)=\"handleCreateRootClick($event)\"\n look=\"solid\"\n color=\"primary\"\n [text]=\"'@general:actions.add-new.title' | translate | async\"\n >\n <ax-icon class=\"fas fa-plus\"></ax-icon>\n </ax-button>\n </axp-state-message>\n }\n\n <ng-template #itemTemplate let-item>\n <div class=\"ax-flex ax-items-center ax-justify-between ax-w-full ax-gap-2 ax-overflow-hidden\">\n <div class=\"ax-flex ax-items-center ax-gap-2 ax-min-w-0\">\n <ax-icon class=\"fas ax-text-warning fa-folder\"></ax-icon>\n <span class=\"ax-truncate\">{{ item.title }}</span>\n </div>\n @if (item.id && item.id !== 'all') {\n <div class=\"ax-flex ax-items-center ax-gap-1\">\n <ax-button class=\"ax-xs\" color=\"default\" look=\"blank\" (onClick)=\"$event.nativeEvent.stopPropagation()\">\n <ax-icon class=\"fas fa-ellipsis-v\"></ax-icon>\n <ax-dropdown-panel>\n <ax-button-item-list>\n <ax-button-item\n (onClick)=\"handleCreateChildClick(item, $event)\"\n look=\"blank\"\n color=\"default\"\n text=\"Add New Child\"\n >\n <ax-icon class=\"fas fa-plus\"></ax-icon>\n </ax-button-item>\n <ax-button-item (onClick)=\"handleEditNodeClick(item, $event)\" look=\"blank\" text=\"Edit\">\n <ax-icon class=\"fas fa-pen\"></ax-icon>\n </ax-button-item>\n <ax-button-item\n (onClick)=\"handleDeleteNodeClick(item, $event)\"\n color=\"danger\"\n look=\"blank\"\n text=\"Delete\"\n >\n <ax-icon class=\"fas fa-trash\"></ax-icon>\n </ax-button-item>\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n </div>\n } @else if (item.id === 'all') {\n <div class=\"ax-flex ax-items-center ax-gap-1\">\n <ax-button class=\"ax-xs\" (onClick)=\"handleCreateRootClick($event)\" look=\"blank\" color=\"default\">\n <ax-icon class=\"fas fa-plus\"></ax-icon>\n </ax-button>\n </div>\n }\n </div>\n </ng-template>\n</axp-layout-content>\n", styles: ["ax-tree-view-item .ax-tree-view-items{width:100%;min-width:0px}ax-tree-view-item .ax-tree-view-items>div{width:100%}ax-tree-view-item .ax-state-tree-view-active{background-color:rgb(var(--ax-sys-color-light-surface))!important;color:rgb(var(--ax-sys-color-on-light-surface))!important;border-color:rgb(var(--ax-sys-color-border-light-surface))!important}\n"] }]
293
- }], propDecorators: { vm: [{ type: i0.Input, args: [{ isSignal: true, alias: "vm", required: true }] }], tree: [{ type: i0.ViewChild, args: ['tree', { isSignal: true }] }], searchValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchValue", required: false }] }] } });
294
-
295
- class AXPEntityMasterToolbarViewComponent {
296
- constructor() {
297
- this.layoutService = inject(AXPLayoutThemeService);
298
- this.parent = inject(AXPEntityMasterListViewComponent);
299
- this.router = inject(Router);
300
- this.activeRoute = inject(ActivatedRoute);
301
- this.isInitializing = false;
302
- this.pendingInitialFilters = true;
303
- this.pendingInitialSorts = true;
304
- this.initialFilters = signal([], ...(ngDevMode ? [{ debugName: "initialFilters" }] : []));
305
- this.filtersDefinitions = signal([], ...(ngDevMode ? [{ debugName: "filtersDefinitions" }] : []));
306
- this.viewQueries = computed(() => this.vm.views().map((v) => ({
307
- name: v.name,
308
- fixed: false,
309
- title: v.title,
310
- columns: v.columns,
311
- conditions: v.conditions.map((c) => ({
312
- field: c.name,
313
- operator: c.operator,
314
- value: c.value,
315
- })),
316
- sorts: v.sorts,
317
- })), ...(ngDevMode ? [{ debugName: "viewQueries" }] : []));
318
- this.selectedViewQuery = computed(() => ({
319
- name: this.vm.view().name,
320
- fixed: false,
321
- title: this.vm.view().title,
322
- columns: this.vm.view().columns,
323
- conditions: this.vm.view().conditions.map((c) => ({
324
- field: c.name,
325
- operator: c.operator,
326
- value: c.value,
327
- })),
328
- sorts: this.vm.view().sorts,
329
- }), ...(ngDevMode ? [{ debugName: "selectedViewQuery" }] : []));
330
- // Debounced apply to coalesce multiple UI changes (filters/sorts/columns)
331
- this.applyTimer = null;
332
- this.#effect = effect(() => {
333
- // Keep definitions up to date; initial filters are set explicitly from settings or view
334
- this.filtersDefinitions.set(this.vm.filtersDef);
335
- }, ...(ngDevMode ? [{ debugName: "#effect" }] : []));
336
- this.sortQueries = computed(() => this.vm
337
- .sortedFields()
338
- .filter((s) => !!s.dir)
339
- .map((s) => ({ name: s.name, dir: s.dir })), ...(ngDevMode ? [{ debugName: "sortQueries" }] : []));
340
- this.sortDefinitions = computed(() => this.vm.sortableFields().map((s) => ({
341
- name: s.name,
342
- title: s.title,
343
- dir: s.dir,
344
- })), ...(ngDevMode ? [{ debugName: "sortDefinitions" }] : []));
345
- }
346
- async ngOnInit() {
347
- // Prefer saved settings (view/columns/sorts/filters) if available, then apply
348
- await this.vm.setView();
349
- this.filtersDefinitions.set(this.vm.filtersDef);
350
- this.isInitializing = true;
351
- // this.pendingInitialFilters = true;
352
- // this.pendingInitialSorts = true;
353
- this.setInitialFiltersFromSettingsOrView();
354
- // Ensure initial load even when filters/sorts are absent
355
- setTimeout(() => {
356
- this.isInitializing = false;
357
- this.scheduleApply();
358
- }, 0);
359
- }
360
- scheduleApply() {
361
- clearTimeout(this.applyTimer);
362
- this.applyTimer = setTimeout(() => {
363
- this.vm.applyFilterAndSort();
364
- }, 50);
365
- }
366
- async onViewChanged(view) {
367
- await this.vm.setView(view.name);
368
- // Sync query param immediately on tab change
369
- this.router.navigate([], {
370
- relativeTo: this.activeRoute,
371
- queryParams: { view: view.name },
372
- queryParamsHandling: 'merge',
373
- replaceUrl: true,
374
- });
375
- this.isInitializing = true;
376
- this.pendingInitialFilters = true;
377
- this.pendingInitialSorts = true;
378
- this.setInitialFiltersFromSettingsOrView();
379
- // Ensure initial load after view change
380
- setTimeout(() => {
381
- this.isInitializing = false;
382
- this.scheduleApply();
383
- }, 0);
384
- }
385
- #effect;
386
- setInitialFiltersFromSettingsOrView() {
387
- const saved = this.vm.filterQueries();
388
- const viewConditions = this.vm.view().conditions.map((c) => c.name);
389
- if (saved && saved.length) {
390
- this.initialFilters.set(saved.map((s) => ({ ...s, hidden: viewConditions.includes(s.field) })));
391
- return;
392
- }
393
- this.initialFilters.set(this.vm.view().conditions.map((c) => ({
394
- field: c.name,
395
- operator: c.operator,
396
- value: c.value,
397
- hidden: true,
398
- })));
399
- }
400
- onFiltersChanged(filters) {
401
- if (this.isInitializing || this.pendingInitialFilters) {
402
- this.pendingInitialFilters = false;
403
- return;
404
- }
405
- this.vm.filterQueries.set(filters);
406
- // Persist filters per module/entity/view
407
- this.vm.saveSettings('filters', filters);
408
- this.scheduleApply();
409
- }
410
- onSortQueriesChange(e) {
411
- if (this.isInitializing || this.pendingInitialSorts) {
412
- this.pendingInitialSorts = false;
413
- return;
414
- }
415
- this.vm.sortedFields.set(e.map((s) => ({
416
- name: s.name,
417
- title: s.name,
418
- dir: s.dir,
419
- })));
420
- // Persist sorts per module/entity/view
421
- this.vm.saveSettings('sorts', e);
422
- this.scheduleApply();
423
- }
424
- onColumnsChange(columns) {
425
- const keyOf = (c) => c.column?.options?.dataPath ?? c.name;
426
- this.vm.columns.update((prev) => {
427
- const byKey = new Map(prev.map((c) => [keyOf(c), c]));
428
- return columns.map((newColumn) => {
429
- const existing = byKey.get(keyOf(newColumn));
430
- return new AXPEntityListViewColumnViewModel(existing.property, {
431
- ...existing.column,
432
- options: {
433
- ...existing.column.options,
434
- visible: newColumn.visible,
435
- },
436
- });
437
- });
438
- });
439
- // Persist column order/visibility
440
- this.vm.onColumnsChanged(this.vm.columns());
441
- // Use debounced apply to avoid triple refresh when combined with sorts/filters
442
- // this.scheduleApply();
443
- }
444
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AXPEntityMasterToolbarViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
445
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", type: AXPEntityMasterToolbarViewComponent, isStandalone: true, selector: "axp-entity-master-toolbar-view", inputs: { vm: ["viewModel", "vm"] }, host: { classAttribute: "ax-w-full" }, ngImport: i0, template: "<!-- <axp-entity-view-toolbar [viewModel]=\"vm\"></axp-entity-view-toolbar> -->\n<axp-query-views\n id=\"axp-toolbar-view-selector\"\n [views]=\"viewQueries()\"\n [selectedView]=\"selectedViewQuery()\"\n (selectedViewChange)=\"onViewChanged($event)\"\n></axp-query-views>\n<div class=\"ax-flex ax-items-center ax-gap-2 ax-border-b ax-border-light w-full\">\n <!-- <axp-entity-filter-toolbar [viewModel]=\"vm\"></axp-entity-filter-toolbar> -->\n <axp-query-filters\n id=\"axp-toolbar-filters\"\n [filtersDefinitions]=\"filtersDefinitions()\"\n [initialFilters]=\"initialFilters()\"\n (onFiltersChanged)=\"onFiltersChanged($event)\"\n ></axp-query-filters>\n\n <div class=\"ax-flex ax-items-center ax-gap-1 md:ax-gap-2\">\n <ax-button id=\"axp-toolbar-btn-columns\" [iconOnly]=\"true\" #columnButton [color]=\"'default'\">\n <i class=\"fa-light fa-table-columns\"></i>\n </ax-button>\n <ax-popover\n id=\"axp-popover-columns\"\n [adaptivityEnabled]=\"true\"\n [offsetY]=\"30\"\n [target]=\"columnButton\"\n [openOn]=\"'toggle'\"\n [closeOn]=\"'clickOut'\"\n #popover\n >\n <div class=\"ax-lightest-surface ax-shadow-md ax-border md:ax-w-72 ax-w-full ax-rounded-md\">\n <ax-header class=\"ax-border-b ax-lighter-surface ax-rounded-t-md ax-p-4 ax-font-bold\">\n {{ '@general:terms.common.columns' | translate | async }}\n </ax-header>\n <div class=\"ax-py-2 ax-px-4\">\n <axp-query-columns [columns]=\"vm.columns()\" (columnsChange)=\"onColumnsChange($event)\"></axp-query-columns>\n <!-- <axp-list-view-option-columns [viewModel]=\"vm\"></axp-list-view-option-columns> -->\n </div>\n </div>\n </ax-popover>\n @if (vm.canSort()) {\n <ax-button id=\"axp-toolbar-btn-sort\" [iconOnly]=\"true\" [text]=\"'Sorts'\" #sortButton [color]=\"'default'\">\n <i class=\"fa-light fa-sort-amount-up\"></i>\n </ax-button>\n <ax-popover\n id=\"axp-popover-sort\"\n [adaptivityEnabled]=\"true\"\n [offsetY]=\"10\"\n [target]=\"sortButton\"\n [openOn]=\"'toggle'\"\n [closeOn]=\"'clickOut'\"\n #popover\n >\n <div class=\"ax-lightest-surface ax-shadow-md ax-border md:ax-w-72 ax-w-full ax-rounded-md\">\n <ax-header class=\"ax-border-b ax-lighter-surface ax-rounded-t-md ax-p-4 ax-font-bold\">\n {{ '@general:terms.common.sorts' | translate | async }}\n </ax-header>\n <div class=\"ax-py-2 ax-px-4\">\n <!-- <axp-list-view-option-sorting [viewModel]=\"vm\"></axp-list-view-option-sorting> -->\n <axp-query-sorts\n [sortDefinitions]=\"sortDefinitions()\"\n (sortQueriesChange)=\"onSortQueriesChange($event)\"\n [initialSortQueries]=\"sortQueries()\"\n ></axp-query-sorts>\n </div>\n </div>\n </ax-popover>\n }\n @if (layoutService.isSmall()) {\n <ax-button\n id=\"axp-toolbar-btn-category\"\n (onClick)=\"parent.toggleCategoryDrawer()\"\n [iconOnly]=\"true\"\n [color]=\"'default'\"\n >\n <i class=\"fa-light fa-bars\"></i>\n </ax-button>\n }\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i3$1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i2.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "component", type: AXPQueryFiltersComponent, selector: "axp-query-filters", inputs: ["filtersDefinitions", "initialFilters"], outputs: ["onFiltersChanged"] }, { kind: "ngmodule", type: AXPopoverModule }, { kind: "component", type: i3$2.AXPopoverComponent, selector: "ax-popover", inputs: ["width", "disabled", "offsetX", "offsetY", "target", "placement", "content", "openOn", "closeOn", "hasBackdrop", "openAfter", "closeAfter", "backdropClass", "panelClass", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "component", type: AXPQuerySortsComponent, selector: "axp-query-sorts", inputs: ["sortDefinitions", "initialSortQueries"], outputs: ["sortDefinitionsChange", "sortQueriesChange"] }, { kind: "component", type: AXPQueryViewsComponent, selector: "axp-query-views", inputs: ["views", "selectedView"], outputs: ["viewsChange", "selectedViewChange"] }, { kind: "component", type: AXPQueryColumnsComponent, selector: "axp-query-columns", inputs: ["columns"], outputs: ["columnsChange"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i10.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
446
- }
447
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AXPEntityMasterToolbarViewComponent, decorators: [{
448
- type: Component,
449
- args: [{ selector: 'axp-entity-master-toolbar-view', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
450
- CommonModule,
451
- AXButtonModule,
452
- AXDecoratorModule,
453
- AXTranslationModule,
454
- AXPQueryFiltersComponent,
455
- AXPopoverModule,
456
- AXPQuerySortsComponent,
457
- AXPQueryViewsComponent,
458
- AXPQueryColumnsComponent,
459
- ], host: {
460
- class: 'ax-w-full',
461
- }, template: "<!-- <axp-entity-view-toolbar [viewModel]=\"vm\"></axp-entity-view-toolbar> -->\n<axp-query-views\n id=\"axp-toolbar-view-selector\"\n [views]=\"viewQueries()\"\n [selectedView]=\"selectedViewQuery()\"\n (selectedViewChange)=\"onViewChanged($event)\"\n></axp-query-views>\n<div class=\"ax-flex ax-items-center ax-gap-2 ax-border-b ax-border-light w-full\">\n <!-- <axp-entity-filter-toolbar [viewModel]=\"vm\"></axp-entity-filter-toolbar> -->\n <axp-query-filters\n id=\"axp-toolbar-filters\"\n [filtersDefinitions]=\"filtersDefinitions()\"\n [initialFilters]=\"initialFilters()\"\n (onFiltersChanged)=\"onFiltersChanged($event)\"\n ></axp-query-filters>\n\n <div class=\"ax-flex ax-items-center ax-gap-1 md:ax-gap-2\">\n <ax-button id=\"axp-toolbar-btn-columns\" [iconOnly]=\"true\" #columnButton [color]=\"'default'\">\n <i class=\"fa-light fa-table-columns\"></i>\n </ax-button>\n <ax-popover\n id=\"axp-popover-columns\"\n [adaptivityEnabled]=\"true\"\n [offsetY]=\"30\"\n [target]=\"columnButton\"\n [openOn]=\"'toggle'\"\n [closeOn]=\"'clickOut'\"\n #popover\n >\n <div class=\"ax-lightest-surface ax-shadow-md ax-border md:ax-w-72 ax-w-full ax-rounded-md\">\n <ax-header class=\"ax-border-b ax-lighter-surface ax-rounded-t-md ax-p-4 ax-font-bold\">\n {{ '@general:terms.common.columns' | translate | async }}\n </ax-header>\n <div class=\"ax-py-2 ax-px-4\">\n <axp-query-columns [columns]=\"vm.columns()\" (columnsChange)=\"onColumnsChange($event)\"></axp-query-columns>\n <!-- <axp-list-view-option-columns [viewModel]=\"vm\"></axp-list-view-option-columns> -->\n </div>\n </div>\n </ax-popover>\n @if (vm.canSort()) {\n <ax-button id=\"axp-toolbar-btn-sort\" [iconOnly]=\"true\" [text]=\"'Sorts'\" #sortButton [color]=\"'default'\">\n <i class=\"fa-light fa-sort-amount-up\"></i>\n </ax-button>\n <ax-popover\n id=\"axp-popover-sort\"\n [adaptivityEnabled]=\"true\"\n [offsetY]=\"10\"\n [target]=\"sortButton\"\n [openOn]=\"'toggle'\"\n [closeOn]=\"'clickOut'\"\n #popover\n >\n <div class=\"ax-lightest-surface ax-shadow-md ax-border md:ax-w-72 ax-w-full ax-rounded-md\">\n <ax-header class=\"ax-border-b ax-lighter-surface ax-rounded-t-md ax-p-4 ax-font-bold\">\n {{ '@general:terms.common.sorts' | translate | async }}\n </ax-header>\n <div class=\"ax-py-2 ax-px-4\">\n <!-- <axp-list-view-option-sorting [viewModel]=\"vm\"></axp-list-view-option-sorting> -->\n <axp-query-sorts\n [sortDefinitions]=\"sortDefinitions()\"\n (sortQueriesChange)=\"onSortQueriesChange($event)\"\n [initialSortQueries]=\"sortQueries()\"\n ></axp-query-sorts>\n </div>\n </div>\n </ax-popover>\n }\n @if (layoutService.isSmall()) {\n <ax-button\n id=\"axp-toolbar-btn-category\"\n (onClick)=\"parent.toggleCategoryDrawer()\"\n [iconOnly]=\"true\"\n [color]=\"'default'\"\n >\n <i class=\"fa-light fa-bars\"></i>\n </ax-button>\n }\n </div>\n</div>\n" }]
462
- }], propDecorators: { vm: [{
463
- type: Input,
464
- args: ['viewModel']
465
- }] } });
466
-
467
- class AXPEntityMasterListViewComponent extends AXPPageLayoutBaseComponent {
468
- constructor(platform) {
469
- super();
470
- this.platform = platform;
471
- this.activeRoute = inject(ActivatedRoute);
472
- this.router = inject(Router);
473
- this.vm = this.activeRoute.snapshot.data['vm'];
474
- //
475
- this.store = inject(AXPLayoutThemeService);
476
- //
477
- this.searchBarShown = signal(true, ...(ngDevMode ? [{ debugName: "searchBarShown" }] : []));
478
- this.activeEndSideView = signal('column', ...(ngDevMode ? [{ debugName: "activeEndSideView" }] : []));
479
- this.categorySearchValue = signal('', ...(ngDevMode ? [{ debugName: "categorySearchValue" }] : []));
480
- // @ViewChild('grid', { static: true}) grid: AXDataTableComponent;
481
- this.grid = viewChild('grid', ...(ngDevMode ? [{ debugName: "grid" }] : []));
482
- this.initializedFromRoute = false;
483
- this.commandRowItems = computed(() => {
484
- return this.vm.primaryRowActions().map((c) => {
485
- return {
486
- icon: c.icon,
487
- name: c.name,
488
- text: translateSync(c.title),
489
- color: c.color,
490
- disabled: c.disabled,
491
- default: c.default,
492
- };
493
- });
494
- }, ...(ngDevMode ? [{ debugName: "commandRowItems" }] : []));
495
- this.getDropdownRowItems = (rowData) => {
496
- return Promise.resolve(this.dropdownRowItems(rowData));
497
- };
498
- this.getCommandRowItems = () => {
499
- return this.commandRowItems();
500
- };
501
- effect(() => {
502
- if (this.grid()) {
503
- this.grid().selectedRows = this.vm.selectedItems();
504
- }
505
- });
506
- //
507
- this.vm.events$.subscribe(async (e) => {
508
- const refreshTargetId = e.meta?.refreshTargetId;
509
- if (e.action == 'refresh') {
510
- if (refreshTargetId) {
511
- this.grid()?.refreshItemChildren(refreshTargetId);
512
- }
513
- else {
514
- this.grid()?.refresh({
515
- reset: false,
516
- });
517
- }
518
- }
519
- });
520
- // Keep URL query param `view` in sync with current vm view
521
- effect(() => {
522
- if (!this.initializedFromRoute) {
523
- return;
524
- }
525
- const currentViewName = this.vm.view().name;
526
- const urlView = this.activeRoute.snapshot.queryParamMap.get('view');
527
- if (currentViewName && currentViewName !== urlView) {
528
- this.router.navigate([], {
529
- relativeTo: this.activeRoute,
530
- queryParams: { view: currentViewName },
531
- queryParamsHandling: 'merge',
532
- replaceUrl: true,
533
- });
534
- }
535
- });
536
- }
537
- async ngOnInit() {
538
- // React to external URL changes (back/forward navigation or deep links)
539
- this.queryParamSub = this.activeRoute.queryParamMap.subscribe(async (qp) => {
540
- const viewFromUrl = qp.get('view');
541
- await this.vm.setView(viewFromUrl);
542
- });
543
- }
544
- async ngAfterViewInit() {
545
- const viewFromUrl = this.activeRoute.snapshot.queryParamMap.get('view');
546
- await this.vm.setView(viewFromUrl);
547
- const resolvedView = this.vm.view().name;
548
- const currentUrlView = this.activeRoute.snapshot.queryParamMap.get('view');
549
- if (currentUrlView !== resolvedView) {
550
- this.router.navigate([], {
551
- relativeTo: this.activeRoute,
552
- queryParams: { view: resolvedView },
553
- queryParamsHandling: 'merge',
554
- replaceUrl: true,
555
- });
556
- }
557
- this.initializedFromRoute = true;
558
- }
559
- onColumnSizeChanged(e) {
560
- if (e.isUserInteraction && e.type === 'end') {
561
- this.vm.saveSettings('columnSizes', e.data);
562
- }
563
- }
564
- onPageChanged(e) {
565
- if (e.isUserInteraction) {
566
- const pageSizeChanged = e.take != this.vm.dataSource.pageSize;
567
- if (pageSizeChanged) {
568
- this.vm.saveSettings('pageSize', e.take);
569
- }
570
- }
571
- }
572
- onColumnsOrderChanged(e) {
573
- if (e.isUserInteraction) {
574
- this.vm.onColumnsOrderChanged(e.data.event);
575
- }
576
- }
577
- async dropdownRowItems(rowData) {
578
- return (await this.vm.secondaryRowActions(rowData)).map((c) => ({
579
- icon: c.icon,
580
- name: c.name,
581
- text: c.title,
582
- color: c.color,
583
- disabled: c.disabled,
584
- default: c.default,
585
- }));
586
- }
587
- async handleRowDbClick(e) {
588
- if (this.grid()?.dataSource.isLoading) {
589
- return;
590
- }
591
- const allItems = [...this.commandRowItems(), ...(await this.dropdownRowItems(e.data))];
592
- // const defaultAction = allItems.find((c) => (c as any).default) || allItems[0];
593
- const defaultAction = allItems.find((c) => {
594
- const commandName = c.name.split('&')[0];
595
- return (c.default || commandName === 'open-entity') && !c.disabled;
596
- });
597
- if (!defaultAction) {
598
- return;
599
- }
600
- const d = {
601
- component: e.component,
602
- name: defaultAction.name,
603
- data: e.data,
604
- };
605
- this.handleRowCommandClick(d);
606
- }
607
- async handleRowCommandClick(e) {
608
- if (this.grid()?.dataSource.isLoading) {
609
- return;
610
- }
611
- this.vm.executeCommand(e.name, e.data);
612
- }
613
- async handleSelectedRowsChange(rows) {
614
- this.vm.selectedItems.set(rows);
615
- }
616
- makeResponsive(value) {
617
- if (this.platform.is('Mobile') || this.platform.is('SM')) {
618
- return '';
619
- }
620
- else {
621
- return value;
622
- }
623
- }
624
- toggleSideBar(sideBar) {
625
- this.toggleEndSide();
626
- if (sideBar) {
627
- this.activeEndSideView.set(sideBar);
628
- }
629
- }
630
- toggleSearchBar() {
631
- this.searchBarShown.update((v) => !v);
632
- }
633
- handleResetClick(sideBar) {
634
- switch (sideBar) {
635
- case 'filter': {
636
- this.vm.resetFilters();
637
- break;
638
- }
639
- case 'sort': {
640
- this.vm.resetSorts();
641
- break;
642
- }
643
- case 'column': {
644
- this.vm.resetColumns();
645
- break;
646
- }
647
- }
648
- }
649
- // protected handleDiscardClick(sideBar: 'filter' | 'sort' | 'column') {
650
- // switch (sideBar) {
651
- // case 'filter': {
652
- // this.vm.discardFilters();
653
- // break;
654
- // }
655
- // case 'sort': {
656
- // this.vm.resetSorts();
657
- // break;
658
- // }
659
- // case 'column': {
660
- // this.vm.resetColumns();
661
- // break;
662
- // }
663
- // }
664
- // }
665
- handleApplyClick(sideBar) {
666
- this.vm.applyFilterAndSort();
667
- this.toggleEndSide();
668
- }
669
- ngOnDestroy() {
670
- this.queryParamSub?.unsubscribe();
671
- this.vm.destroy();
672
- }
673
- toggleCategoryDrawer() {
674
- this.toggleStartSide();
675
- }
676
- getPageTitle() {
677
- return this.vm.title();
678
- }
679
- async getPageDescription() {
680
- const description = this.vm.description();
681
- if (description) {
682
- return this.translateService.translateAsync(description);
683
- }
684
- return '';
685
- }
686
- getPageBreadcrumbs() {
687
- return this.vm.beardcrumbs();
688
- }
689
- async getPrimaryMenuItems() {
690
- return (await this.vm.getPrimaryActions()).map((tr) => ({
691
- name: tr.name,
692
- title: tr.title,
693
- icon: tr.icon,
694
- color: tr.color,
695
- disabled: tr.disabled,
696
- command: {
697
- name: tr.name,
698
- options: tr.options,
699
- metadata: tr.metadata,
700
- },
701
- }));
702
- }
703
- async getSecondaryMenuItems() {
704
- return (await this.vm.getSecondaryActions()).map((tr) => ({
705
- name: tr.name,
706
- title: tr.title,
707
- icon: tr.icon,
708
- color: tr.color,
709
- disabled: tr.disabled,
710
- separated: tr.separated,
711
- command: {
712
- name: tr.name,
713
- options: tr.options,
714
- metadata: tr.metadata,
715
- },
716
- }));
717
- }
718
- async execute(command) {
719
- if (command) {
720
- this.vm.execute(command);
721
- }
722
- }
723
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AXPEntityMasterListViewComponent, deps: [{ token: i1$1.AXPlatform }], target: i0.ɵɵFactoryTarget.Component }); }
724
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", type: AXPEntityMasterListViewComponent, isStandalone: true, selector: "axp-entity-master-list", providers: [
725
- {
726
- provide: AXPPageLayoutBase,
727
- useExisting: AXPEntityMasterListViewComponent,
728
- },
729
- ], viewQueries: [{ propertyName: "grid", first: true, predicate: ["grid"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<axp-page-layout *translate=\"let t\">\n @if (vm.entityDef.category) {\n <axp-layout-start-side id=\"axp-entity-category-drawer\">\n <axp-entity-category\n id=\"axp-entity-category\"\n class=\"ax-w-80\"\n [vm]=\"vm\"\n [searchValue]=\"categorySearchValue()\"\n ></axp-entity-category>\n </axp-layout-start-side>\n }\n <axp-page-toolbar id=\"axp-entity-toolbar\">\n <axp-entity-master-toolbar-view [viewModel]=\"vm\"></axp-entity-master-toolbar-view>\n </axp-page-toolbar>\n <axp-page-content class=\"ax-overflow-auto\">\n <ax-data-table\n id=\"axp-entity-table\"\n [allowReordering]=\"true\"\n (onColumnsOrderChanged)=\"onColumnsOrderChanged($event)\"\n #grid\n [showFooter]=\"false\"\n class=\"ax-flex-1\"\n [paging]=\"true\"\n [fetchDataMode]=\"'manual'\"\n [parentField]=\"vm.parentKey()\"\n [loading]=\"{ enabled: true, animation: true }\"\n [dataSource]=\"vm.dataSource\"\n (selectedRowsChange)=\"handleSelectedRowsChange($event)\"\n (onRowDbClick)=\"handleRowDbClick($event)\"\n (onColumnSizeChanged)=\"onColumnSizeChanged($event)\"\n (onPageChanged)=\"onPageChanged($event)\"\n >\n @if (vm.view().indexCol === true) {\n <ax-index-column id=\"axp-table-col-index\" fixed=\"start\" [width]=\"'80px'\" [padZero]=\"true\"></ax-index-column>\n }\n @if (vm.selectedScopeActionsCount()) {\n <ax-select-column id=\"axp-table-col-select\" fixed=\"start\" [width]=\"'60px'\"></ax-select-column>\n }\n @for (col of vm.columns(); track col.name) {\n @if (col.visible) {\n <axp-widget-column-renderer\n [attr.id]=\"'axp-table-col-' + col.name\"\n [expandHandler]=\"$index === 0 && vm.parentKey() ? true : false\"\n [caption]=\"(col.title | translate | async)!\"\n [node]=\"col.node()\"\n [customWidth]=\"col.width\"\n ></axp-widget-column-renderer>\n }\n }\n @if (getCommandRowItems().length) {\n <ax-command-column\n id=\"axp-table-col-commands\"\n fixed=\"end\"\n [width]=\"getCommandRowItems().length * 60 + 'px'\"\n [items]=\"getCommandRowItems()\"\n (onItemClick)=\"handleRowCommandClick($event)\"\n ></ax-command-column>\n }\n <ax-dropdown-command-column\n id=\"axp-table-col-dropdown-commands\"\n fixed=\"end\"\n [width]=\"'60px'\"\n [items]=\"getDropdownRowItems\"\n (onItemClick)=\"handleRowCommandClick($event)\"\n ></ax-dropdown-command-column>\n </ax-data-table>\n </axp-page-content>\n</axp-page-layout>\n", styles: ["axp-entity-master-list axp-layout-start-side{min-width:20rem!important;border-inline-end-width:1px;background-color:rgb(var(--ax-sys-color-lightest-surface));color:rgb(var(--ax-sys-color-on-lightest-surface));border-color:rgb(var(--ax-sys-color-border-lightest-surface))}.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}.view-drawer{width:85vw}@media (min-width: 768px){.view-drawer{width:45vw}}@media (min-width: 1024px){.view-drawer{width:35vw}}@media (min-width: 1536px){.view-drawer{width:20vw}}.view-drawer{--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-lightest-surface),var(--tw-bg-opacity, 1));border-inline-start-width:1px;border-inline-start-color:rgba(var(--ax-sys-color-border-lightest-surface),var(--tw-border-opacity, 1));border-top-width:1px;--tw-border-opacity: 1;border-top-color:rgba(var(--ax-sys-color-primary-600),var(--tw-border-opacity, 1))}.view-drawer ax-header{display:flex;align-items:center;border-bottom-width:1px;--tw-border-opacity: 1;border-color:rgba(var(--ax-sys-color-border-lightest-surface),var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-lighter-surface),var(--tw-bg-opacity, 1));padding:.5rem 1rem}.view-drawer ax-header h2{font-size:1.25rem;line-height:1.75rem;font-weight:700;--tw-text-opacity: 1;color:rgba(var(--ax-sys-color-on-lighter-surface),var(--tw-text-opacity, 1))}.view-drawer ax-footer{position:absolute!important;bottom:0!important;width:100%!important;justify-content:flex-start!important;border-top-width:1px!important;--tw-border-opacity: 1 !important;border-color:rgba(var(--ax-sys-color-border-lightest-surface),var(--tw-border-opacity, 1))!important;padding:.5rem 1rem!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: RouterModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "ngmodule", type: AXBadgeModule }, { kind: "ngmodule", type: AXDropdownModule }, { kind: "ngmodule", type: AXPopoverModule }, { kind: "ngmodule", type: AXFormModule }, { kind: "ngmodule", type: AXActionSheetModule }, { kind: "ngmodule", type: AXDrawerModule }, { kind: "ngmodule", type: AXDialogModule }, { kind: "ngmodule", type: AXLoadingModule }, { kind: "ngmodule", type: AXTabsModule }, { kind: "ngmodule", type: AXTooltipModule }, { kind: "ngmodule", type: AXBreadcrumbsModule }, { kind: "ngmodule", type: AXDropdownButtonModule }, { kind: "ngmodule", type: AXSearchBoxModule }, { kind: "ngmodule", type: AXDataTableModule }, { kind: "component", type: i7.AXDataTableComponent, selector: "ax-data-table", inputs: ["dataSource", "selectedRows", "parentField", "rowTemplate", "emptyTemplate", "noDataTemplate", "alternative", "showHeader", "fixedHeader", "showFooter", "fixedFooter", "itemHeight", "allowReordering", "paging", "fetchDataMode", "loading", "focusedRow"], outputs: ["selectedRowsChange", "focusedRowChange", "onRowClick", "onRowDbClick", "onColumnsOrderChanged", "onColumnSizeChanged", "onPageChanged"] }, { kind: "component", type: i7.AXRowIndexColumnComponent, selector: "ax-index-column", inputs: ["width", "caption", "fixed", "footerTemplate", "padZero"] }, { kind: "component", type: i7.AXRowSelectColumnComponent, selector: "ax-select-column", inputs: ["width", "caption", "fixed"] }, { kind: "component", type: i7.AXRowCommandColumnComponent, selector: "ax-command-column", inputs: ["width", "caption", "fixed", "footerTemplate", "items"], outputs: ["onItemClick"] }, { kind: "component", type: i7.AXRowDropdownCommandColumnComponent, selector: "ax-dropdown-command-column", inputs: ["width", "caption", "fixed", "footerTemplate", "items"], outputs: ["onItemClick"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "directive", type: i10.AXTranslatorDirective, selector: "[translate]" }, { kind: "ngmodule", type: DragDropModule }, { kind: "ngmodule", type:
730
- //
731
- AXPWidgetCoreModule }, { kind: "component", type: i7$1.AXPWidgetColumnRendererComponent, selector: "axp-widget-column-renderer", inputs: ["caption", "customExpandIcon", "customCollapseIcon", "customWidth", "node", "footerTemplate", "expandHandler", "cellTemplate", "headerTemplate"] }, { kind: "ngmodule", type: AXPWidgetsModule }, { kind: "ngmodule", type: AXPAuthModule }, { kind: "component", type:
732
- //
733
- AXPEntityMasterToolbarViewComponent, selector: "axp-entity-master-toolbar-view", inputs: ["viewModel"] }, { kind: "component", type:
734
- //
735
- AXPPageLayoutComponent, selector: "axp-page-layout" }, { kind: "component", type: AXPThemeLayoutBlockComponent, selector: " axp-page-content, axp-page-footer-container, axp-page-footer, axp-page-header, axp-page-header-container, axp-page-toolbar, axp-layout-content, axp-layout-page-content, axp-layout-sections, axp-layout-body, axp-layout-page-body, axp-layout-prefix, axp-layout-suffix, axp-layout-title-bar, axp-layout-title, axp-layout-title-actions, axp-layout-nav-button, axp-layout-description, axp-layout-breadcrumbs, axp-layout-list-action, " }, { kind: "component", type: AXPThemeLayoutStartSideComponent, selector: "axp-layout-page-start-side, axp-layout-start-side" }, { kind: "component", type: AXPEntityCategoryComponent, selector: "axp-entity-category", inputs: ["vm", "searchValue"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i10.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
736
- }
737
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AXPEntityMasterListViewComponent, decorators: [{
738
- type: Component,
739
- args: [{ selector: 'axp-entity-master-list', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
740
- CommonModule,
741
- FormsModule,
742
- RouterModule,
743
- AXButtonModule,
744
- AXDecoratorModule,
745
- AXBadgeModule,
746
- AXDropdownModule,
747
- AXPopoverModule,
748
- AXFormModule,
749
- AXActionSheetModule,
750
- AXDrawerModule,
751
- AXDialogModule,
752
- AXLoadingModule,
753
- AXTabsModule,
754
- AXTooltipModule,
755
- AXBreadcrumbsModule,
756
- AXDropdownButtonModule,
757
- AXSearchBoxModule,
758
- AXDataTableModule,
759
- AXTranslationModule,
760
- DragDropModule,
761
- //
762
- AXPWidgetCoreModule,
763
- AXPWidgetsModule,
764
- AXPAuthModule,
765
- //
766
- AXPEntityMasterToolbarViewComponent,
767
- //
768
- AXPPageLayoutComponent,
769
- AXPThemeLayoutBlockComponent,
770
- AXDropdownButtonModule,
771
- AXPThemeLayoutStartSideComponent,
772
- AXPEntityCategoryComponent,
773
- ], providers: [
774
- {
775
- provide: AXPPageLayoutBase,
776
- useExisting: AXPEntityMasterListViewComponent,
777
- },
778
- ], template: "<axp-page-layout *translate=\"let t\">\n @if (vm.entityDef.category) {\n <axp-layout-start-side id=\"axp-entity-category-drawer\">\n <axp-entity-category\n id=\"axp-entity-category\"\n class=\"ax-w-80\"\n [vm]=\"vm\"\n [searchValue]=\"categorySearchValue()\"\n ></axp-entity-category>\n </axp-layout-start-side>\n }\n <axp-page-toolbar id=\"axp-entity-toolbar\">\n <axp-entity-master-toolbar-view [viewModel]=\"vm\"></axp-entity-master-toolbar-view>\n </axp-page-toolbar>\n <axp-page-content class=\"ax-overflow-auto\">\n <ax-data-table\n id=\"axp-entity-table\"\n [allowReordering]=\"true\"\n (onColumnsOrderChanged)=\"onColumnsOrderChanged($event)\"\n #grid\n [showFooter]=\"false\"\n class=\"ax-flex-1\"\n [paging]=\"true\"\n [fetchDataMode]=\"'manual'\"\n [parentField]=\"vm.parentKey()\"\n [loading]=\"{ enabled: true, animation: true }\"\n [dataSource]=\"vm.dataSource\"\n (selectedRowsChange)=\"handleSelectedRowsChange($event)\"\n (onRowDbClick)=\"handleRowDbClick($event)\"\n (onColumnSizeChanged)=\"onColumnSizeChanged($event)\"\n (onPageChanged)=\"onPageChanged($event)\"\n >\n @if (vm.view().indexCol === true) {\n <ax-index-column id=\"axp-table-col-index\" fixed=\"start\" [width]=\"'80px'\" [padZero]=\"true\"></ax-index-column>\n }\n @if (vm.selectedScopeActionsCount()) {\n <ax-select-column id=\"axp-table-col-select\" fixed=\"start\" [width]=\"'60px'\"></ax-select-column>\n }\n @for (col of vm.columns(); track col.name) {\n @if (col.visible) {\n <axp-widget-column-renderer\n [attr.id]=\"'axp-table-col-' + col.name\"\n [expandHandler]=\"$index === 0 && vm.parentKey() ? true : false\"\n [caption]=\"(col.title | translate | async)!\"\n [node]=\"col.node()\"\n [customWidth]=\"col.width\"\n ></axp-widget-column-renderer>\n }\n }\n @if (getCommandRowItems().length) {\n <ax-command-column\n id=\"axp-table-col-commands\"\n fixed=\"end\"\n [width]=\"getCommandRowItems().length * 60 + 'px'\"\n [items]=\"getCommandRowItems()\"\n (onItemClick)=\"handleRowCommandClick($event)\"\n ></ax-command-column>\n }\n <ax-dropdown-command-column\n id=\"axp-table-col-dropdown-commands\"\n fixed=\"end\"\n [width]=\"'60px'\"\n [items]=\"getDropdownRowItems\"\n (onItemClick)=\"handleRowCommandClick($event)\"\n ></ax-dropdown-command-column>\n </ax-data-table>\n </axp-page-content>\n</axp-page-layout>\n", styles: ["axp-entity-master-list axp-layout-start-side{min-width:20rem!important;border-inline-end-width:1px;background-color:rgb(var(--ax-sys-color-lightest-surface));color:rgb(var(--ax-sys-color-on-lightest-surface));border-color:rgb(var(--ax-sys-color-border-lightest-surface))}.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}.view-drawer{width:85vw}@media (min-width: 768px){.view-drawer{width:45vw}}@media (min-width: 1024px){.view-drawer{width:35vw}}@media (min-width: 1536px){.view-drawer{width:20vw}}.view-drawer{--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-lightest-surface),var(--tw-bg-opacity, 1));border-inline-start-width:1px;border-inline-start-color:rgba(var(--ax-sys-color-border-lightest-surface),var(--tw-border-opacity, 1));border-top-width:1px;--tw-border-opacity: 1;border-top-color:rgba(var(--ax-sys-color-primary-600),var(--tw-border-opacity, 1))}.view-drawer ax-header{display:flex;align-items:center;border-bottom-width:1px;--tw-border-opacity: 1;border-color:rgba(var(--ax-sys-color-border-lightest-surface),var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-lighter-surface),var(--tw-bg-opacity, 1));padding:.5rem 1rem}.view-drawer ax-header h2{font-size:1.25rem;line-height:1.75rem;font-weight:700;--tw-text-opacity: 1;color:rgba(var(--ax-sys-color-on-lighter-surface),var(--tw-text-opacity, 1))}.view-drawer ax-footer{position:absolute!important;bottom:0!important;width:100%!important;justify-content:flex-start!important;border-top-width:1px!important;--tw-border-opacity: 1 !important;border-color:rgba(var(--ax-sys-color-border-lightest-surface),var(--tw-border-opacity, 1))!important;padding:.5rem 1rem!important}\n"] }]
779
- }], ctorParameters: () => [{ type: i1$1.AXPlatform }], propDecorators: { grid: [{ type: i0.ViewChild, args: ['grid', { isSignal: true }] }] } });
780
-
781
- export { AXPEntityMasterListViewComponent };
782
- //# sourceMappingURL=acorex-platform-themes-default-entity-master-list-view.component-BkY9HXcT.mjs.map