@acorex/platform 20.6.0-next.9 → 21.0.0-next.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.
Files changed (88) hide show
  1. package/auth/index.d.ts +91 -12
  2. package/common/index.d.ts +615 -44
  3. package/core/index.d.ts +718 -422
  4. package/fesm2022/acorex-platform-auth.mjs +152 -39
  5. package/fesm2022/acorex-platform-auth.mjs.map +1 -1
  6. package/fesm2022/acorex-platform-common.mjs +1009 -112
  7. package/fesm2022/acorex-platform-common.mjs.map +1 -1
  8. package/fesm2022/acorex-platform-core.mjs +887 -408
  9. package/fesm2022/acorex-platform-core.mjs.map +1 -1
  10. package/fesm2022/acorex-platform-domain.mjs +99 -11
  11. package/fesm2022/acorex-platform-domain.mjs.map +1 -1
  12. package/fesm2022/acorex-platform-layout-builder.mjs +555 -492
  13. package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
  14. package/fesm2022/acorex-platform-layout-components.mjs +2446 -2733
  15. package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
  16. package/fesm2022/acorex-platform-layout-designer.mjs +9 -9
  17. package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
  18. package/fesm2022/acorex-platform-layout-entity.mjs +9708 -4721
  19. package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
  20. package/fesm2022/acorex-platform-layout-views.mjs +32 -26
  21. package/fesm2022/acorex-platform-layout-views.mjs.map +1 -1
  22. package/fesm2022/acorex-platform-layout-widget-core.mjs +252 -182
  23. package/fesm2022/acorex-platform-layout-widget-core.mjs.map +1 -1
  24. package/fesm2022/{acorex-platform-layout-widgets-file-list-popup.component-D0y-9nE5.mjs → acorex-platform-layout-widgets-file-list-popup.component-CxrsI6Hn.mjs} +2 -2
  25. package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-CxrsI6Hn.mjs.map +1 -0
  26. package/fesm2022/acorex-platform-layout-widgets-image-preview.popup-V31OpYah.mjs +30 -0
  27. package/fesm2022/acorex-platform-layout-widgets-image-preview.popup-V31OpYah.mjs.map +1 -0
  28. package/fesm2022/{acorex-platform-layout-widgets-tabular-data-edit-popup.component-C1l2KSDa.mjs → acorex-platform-layout-widgets-tabular-data-edit-popup.component-Ck7-wpT2.mjs} +2 -2
  29. package/fesm2022/acorex-platform-layout-widgets-tabular-data-edit-popup.component-Ck7-wpT2.mjs.map +1 -0
  30. package/fesm2022/{acorex-platform-layout-widgets-tabular-data-view-popup.component-D-31ej0C.mjs → acorex-platform-layout-widgets-tabular-data-view-popup.component-y8vjUiVs.mjs} +2 -2
  31. package/fesm2022/acorex-platform-layout-widgets-tabular-data-view-popup.component-y8vjUiVs.mjs.map +1 -0
  32. package/fesm2022/acorex-platform-layout-widgets.mjs +9791 -6928
  33. package/fesm2022/acorex-platform-layout-widgets.mjs.map +1 -1
  34. package/fesm2022/acorex-platform-runtime.mjs +79 -3
  35. package/fesm2022/acorex-platform-runtime.mjs.map +1 -1
  36. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-VIGuU5M4.mjs +157 -0
  37. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-VIGuU5M4.mjs.map +1 -0
  38. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-DyDa_hyd.mjs +1542 -0
  39. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-DyDa_hyd.mjs.map +1 -0
  40. package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-Ua3ZA5hk.mjs +101 -0
  41. package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-Ua3ZA5hk.mjs.map +1 -0
  42. package/fesm2022/{acorex-platform-themes-default-entity-master-single-view.component-B_P0a5KW.mjs → acorex-platform-themes-default-entity-master-single-view.component-eMBby9k4.mjs} +3 -3
  43. package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-eMBby9k4.mjs.map +1 -0
  44. package/fesm2022/acorex-platform-themes-default.mjs +282 -43
  45. package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
  46. package/fesm2022/acorex-platform-themes-shared-icon-chooser-column.component-C0EpfU2k.mjs +55 -0
  47. package/fesm2022/acorex-platform-themes-shared-icon-chooser-column.component-C0EpfU2k.mjs.map +1 -0
  48. package/fesm2022/acorex-platform-themes-shared.mjs +42 -137
  49. package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
  50. package/fesm2022/acorex-platform-workflow.mjs +658 -45
  51. package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
  52. package/layout/builder/index.d.ts +10 -34
  53. package/layout/components/index.d.ts +694 -375
  54. package/layout/designer/index.d.ts +4 -4
  55. package/layout/entity/index.d.ts +802 -183
  56. package/layout/views/index.d.ts +5 -58
  57. package/layout/widget-core/index.d.ts +63 -75
  58. package/layout/widgets/README.md +0 -1
  59. package/layout/widgets/index.d.ts +493 -129
  60. package/package.json +5 -5
  61. package/runtime/index.d.ts +36 -8
  62. package/themes/default/index.d.ts +44 -75
  63. package/themes/shared/index.d.ts +11 -49
  64. package/workflow/index.d.ts +401 -90
  65. package/fesm2022/acorex-platform-layout-entity-create-entity.command-DGeylNSY.mjs +0 -52
  66. package/fesm2022/acorex-platform-layout-entity-create-entity.command-DGeylNSY.mjs.map +0 -1
  67. package/fesm2022/acorex-platform-layout-widgets-extra-properties-schema-widget-edit.component-fhhZOWul.mjs +0 -50
  68. package/fesm2022/acorex-platform-layout-widgets-extra-properties-schema-widget-edit.component-fhhZOWul.mjs.map +0 -1
  69. package/fesm2022/acorex-platform-layout-widgets-extra-properties-schema-widget-view.component-C3Qbs0fz.mjs +0 -42
  70. package/fesm2022/acorex-platform-layout-widgets-extra-properties-schema-widget-view.component-C3Qbs0fz.mjs.map +0 -1
  71. package/fesm2022/acorex-platform-layout-widgets-extra-properties-values-widget-edit.component-CngQBUlN.mjs +0 -55
  72. package/fesm2022/acorex-platform-layout-widgets-extra-properties-values-widget-edit.component-CngQBUlN.mjs.map +0 -1
  73. package/fesm2022/acorex-platform-layout-widgets-extra-properties-values-widget-view.component-DSNo9e4W.mjs +0 -50
  74. package/fesm2022/acorex-platform-layout-widgets-extra-properties-values-widget-view.component-DSNo9e4W.mjs.map +0 -1
  75. package/fesm2022/acorex-platform-layout-widgets-extra-properties-widget-edit.component-CL0CwEHX.mjs +0 -48
  76. package/fesm2022/acorex-platform-layout-widgets-extra-properties-widget-edit.component-CL0CwEHX.mjs.map +0 -1
  77. package/fesm2022/acorex-platform-layout-widgets-extra-properties-widget-view.component-B6Fi0xTw.mjs +0 -42
  78. package/fesm2022/acorex-platform-layout-widgets-extra-properties-widget-view.component-B6Fi0xTw.mjs.map +0 -1
  79. package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-D0y-9nE5.mjs.map +0 -1
  80. package/fesm2022/acorex-platform-layout-widgets-tabular-data-edit-popup.component-C1l2KSDa.mjs.map +0 -1
  81. package/fesm2022/acorex-platform-layout-widgets-tabular-data-view-popup.component-D-31ej0C.mjs.map +0 -1
  82. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-WbPPqDON.mjs +0 -115
  83. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-WbPPqDON.mjs.map +0 -1
  84. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-CD7rJIMh.mjs +0 -803
  85. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-CD7rJIMh.mjs.map +0 -1
  86. package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-BTA6h7Xd.mjs +0 -101
  87. package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-BTA6h7Xd.mjs.map +0 -1
  88. package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-B_P0a5KW.mjs.map +0 -1
@@ -0,0 +1,1542 @@
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, computed, afterNextRender, ViewEncapsulation, Component, 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 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$1 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 i2$1 from '@acorex/components/skeleton';
41
+ import { AXSkeletonModule } from '@acorex/components/skeleton';
42
+ import { AXTreeViewModule, AXTreeViewComponent } from '@acorex/components/tree-view';
43
+ import { AXPRefreshEvent, AXPSettingsService, AXPCommonSettings } from '@acorex/platform/common';
44
+ import { AXHighlightService, AXPDeviceService } from '@acorex/platform/core';
45
+ import { AXPCategoryTreeService, AXPEntityListViewColumnViewModel } from '@acorex/platform/layout/entity';
46
+ import { AXPWorkflowService, ofType } from '@acorex/platform/workflow';
47
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
48
+ import { isEqual } from 'lodash-es';
49
+
50
+ //#region ---- Constants ----
51
+ const ROOT_NODE_ID = 'all';
52
+ const LOADING_DELAY_MS = 300;
53
+ const DEFAULT_TEXT_FIELD = 'title';
54
+ const DEFAULT_VALUE_FIELD = 'id';
55
+ //#endregion
56
+ class AXPEntityCategoryComponent {
57
+ //#endregion
58
+ //#region ---- Constructor & Lifecycle ----
59
+ constructor() {
60
+ //#region ---- Services & Dependencies ----
61
+ this.translate = inject(AXTranslationService);
62
+ this.workflow = inject(AXPWorkflowService);
63
+ this.categoryTreeService = inject(AXPCategoryTreeService);
64
+ this.highlightService = inject(AXHighlightService);
65
+ //#endregion
66
+ //#region ---- Component Inputs & View Queries ----
67
+ this.vm = input.required(...(ngDevMode ? [{ debugName: "vm" }] : []));
68
+ this.tree = viewChild('tree', ...(ngDevMode ? [{ debugName: "tree" }] : []));
69
+ this.searchValue = input('', ...(ngDevMode ? [{ debugName: "searchValue" }] : []));
70
+ // Tree view inputs with defaults
71
+ this.selectMode = input('single', ...(ngDevMode ? [{ debugName: "selectMode" }] : []));
72
+ this.selectionBehavior = input('intermediate', ...(ngDevMode ? [{ debugName: "selectionBehavior" }] : []));
73
+ this.dragArea = input('handler', ...(ngDevMode ? [{ debugName: "dragArea" }] : []));
74
+ this.dragBehavior = input('none', ...(ngDevMode ? [{ debugName: "dragBehavior" }] : []));
75
+ this.showIcons = input(true, ...(ngDevMode ? [{ debugName: "showIcons" }] : []));
76
+ this.showChildrenBadge = input(false, ...(ngDevMode ? [{ debugName: "showChildrenBadge" }] : []));
77
+ this.expandedIcon = input('fa-solid fa-chevron-down', ...(ngDevMode ? [{ debugName: "expandedIcon" }] : []));
78
+ this.collapsedIcon = input('fa-solid fa-chevron-right', ...(ngDevMode ? [{ debugName: "collapsedIcon" }] : []));
79
+ this.indentSize = input(16, ...(ngDevMode ? [{ debugName: "indentSize" }] : []));
80
+ this.look = input('default', ...(ngDevMode ? [{ debugName: "look" }] : []));
81
+ this.searchWithChildren = input(true, ...(ngDevMode ? [{ debugName: "searchWithChildren" }] : [])); // Include children of search results
82
+ //#endregion
83
+ //#region ---- Component State ----
84
+ this.isLoading = signal(true, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
85
+ this.isSearching = signal(false, ...(ngDevMode ? [{ debugName: "isSearching" }] : []));
86
+ this.searchResultCount = signal(0, ...(ngDevMode ? [{ debugName: "searchResultCount" }] : []));
87
+ this.currentSearchValue = signal('', ...(ngDevMode ? [{ debugName: "currentSearchValue" }] : []));
88
+ this.resultsFoundText = signal('', ...(ngDevMode ? [{ debugName: "resultsFoundText" }] : []));
89
+ //#endregion
90
+ //#region ---- Private Properties ----
91
+ this.loadingTimeoutId = null;
92
+ this.treeData = null;
93
+ this.treeConfig = null;
94
+ this.matchingNodeIds = new Set();
95
+ this.relevantNodeIds = new Set(); // For search filtering
96
+ this.nodeDataCache = new Map(); // Cache parent data from search results
97
+ this.expandedNodesBeforeSearch = [];
98
+ this.nodesExpandedDuringSearch = [];
99
+ this.currentSearchTerm = null;
100
+ //#endregion
101
+ //#region ---- Computed Properties ----
102
+ this.textField = computed(() => this.vm().entityDef.category?.textField || DEFAULT_TEXT_FIELD, ...(ngDevMode ? [{ debugName: "textField" }] : []));
103
+ this.valueField = computed(() => this.vm().entityDef.category?.valueField || DEFAULT_VALUE_FIELD, ...(ngDevMode ? [{ debugName: "valueField" }] : []));
104
+ /**
105
+ * Computed property to check if we should show the "no search results" empty state.
106
+ * Returns true when search is active, not searching, and no results found.
107
+ */
108
+ this.showNoSearchResults = computed(() => {
109
+ const searchValue = this.currentSearchValue().trim();
110
+ const isSearching = this.isSearching();
111
+ const resultCount = this.searchResultCount();
112
+ return searchValue.length > 0 && !isSearching && resultCount === 0;
113
+ }, ...(ngDevMode ? [{ debugName: "showNoSearchResults" }] : []));
114
+ this.categoryEntityKey = computed(() => {
115
+ const key = this.vm().entityDef.category?.entity;
116
+ if (!key) {
117
+ throw new Error('Category entity is not configured');
118
+ }
119
+ return key;
120
+ }, ...(ngDevMode ? [{ debugName: "categoryEntityKey" }] : []));
121
+ // protected toggleExpand(e: AXTreeViewNodeDoubleClickEvent) {
122
+ // (e.component as AXTreeViewComponent).toggleNodeExpansion(String(e.node[this.valueField()] ?? ''));
123
+ // }
124
+ //#endregion
125
+ //#region ---- Tree Data Source ----
126
+ /**
127
+ * Datasource callback for tree-view component.
128
+ * Provides lazy loading support for tree nodes.
129
+ */
130
+ this.datasource = async (parentId) => {
131
+ console.log('datasource', parentId);
132
+ if (!this.isTreeInitialized()) {
133
+ return [];
134
+ }
135
+ // Load root nodes if no parent ID provided
136
+ if (!parentId) {
137
+ return await this.loadRootNodes();
138
+ }
139
+ // Load children for the specified parent
140
+ return await this.loadChildNodes(parentId);
141
+ };
142
+ afterNextRender(() => {
143
+ this.initializeTree();
144
+ });
145
+ this.workflow.events$
146
+ .pipe(ofType(AXPRefreshEvent))
147
+ .pipe(takeUntilDestroyed())
148
+ .subscribe((event) => {
149
+ this.tree()?.reloadData();
150
+ // this.tree()?.refresh();
151
+ });
152
+ }
153
+ //#endregion
154
+ //#region ---- Public Methods ----
155
+ /**
156
+ * Handles category search input changes - Uses server-side search for efficiency and reliability
157
+ */
158
+ async handleCategorySearchChange(event) {
159
+ if (!this.isTreeInitialized()) {
160
+ return;
161
+ }
162
+ const searchTerm = (event.value ?? '').trim().toLowerCase();
163
+ const previousSearchTerm = this.currentSearchValue();
164
+ // If search is cleared, reset tree
165
+ if (!searchTerm) {
166
+ if (previousSearchTerm || this.matchingNodeIds.size > 0) {
167
+ this.currentSearchValue.set('');
168
+ this.currentSearchTerm = null;
169
+ await this.resetSearch();
170
+ }
171
+ return;
172
+ }
173
+ // For non-empty search, only process user interactions
174
+ if (!event.isUserInteraction) {
175
+ return;
176
+ }
177
+ // Prevent concurrent searches
178
+ if (this.isSearching() && this.currentSearchTerm !== null) {
179
+ if (this.currentSearchTerm === searchTerm) {
180
+ return;
181
+ }
182
+ }
183
+ this.currentSearchValue.set(event.value ?? '');
184
+ this.currentSearchTerm = searchTerm;
185
+ const treeComponent = this.tree();
186
+ if (!treeComponent) {
187
+ return;
188
+ }
189
+ // Store expanded nodes before starting a new search (only on first search)
190
+ if (!previousSearchTerm && this.expandedNodesBeforeSearch.length === 0) {
191
+ const expandedNodes = treeComponent.getExpandedNodes();
192
+ this.expandedNodesBeforeSearch = expandedNodes
193
+ .map((node) => String(node['id'] ?? ''))
194
+ .filter((id) => id && id !== ROOT_NODE_ID);
195
+ }
196
+ // Collapse nodes from previous search before starting new search
197
+ if (previousSearchTerm && this.nodesExpandedDuringSearch.length > 0) {
198
+ const nodesToCollapse = [...this.nodesExpandedDuringSearch].reverse();
199
+ this.nodesExpandedDuringSearch = [];
200
+ for (const nodeId of nodesToCollapse) {
201
+ // Only collapse if it wasn't originally expanded before search
202
+ if (!this.expandedNodesBeforeSearch.includes(nodeId)) {
203
+ try {
204
+ treeComponent.collapseNode(nodeId);
205
+ }
206
+ catch {
207
+ // Node might not exist anymore, ignore
208
+ }
209
+ }
210
+ }
211
+ }
212
+ this.isSearching.set(true);
213
+ try {
214
+ // Step 1: Use server-side search to get matching items
215
+ const searchResults = await this.categoryTreeService.searchCategories(searchTerm, this.treeData, this.treeConfig);
216
+ // Check if search term changed during the API call
217
+ if (this.currentSearchTerm !== searchTerm) {
218
+ return;
219
+ }
220
+ if (!searchResults || searchResults.length === 0) {
221
+ this.matchingNodeIds.clear();
222
+ this.relevantNodeIds.clear();
223
+ this.searchResultCount.set(0);
224
+ await this.updateTranslatedMessages(0);
225
+ // Clear highlighting and reload tree to show all nodes
226
+ this.highlightService.clear();
227
+ await treeComponent.reloadData();
228
+ return;
229
+ }
230
+ // Store matching node IDs from search results
231
+ this.matchingNodeIds.clear();
232
+ const valueField = this.valueField();
233
+ searchResults.forEach((item) => {
234
+ const nodeId = String(item[valueField] ?? '');
235
+ if (nodeId) {
236
+ this.matchingNodeIds.add(nodeId);
237
+ }
238
+ });
239
+ const resultCount = searchResults.length;
240
+ this.searchResultCount.set(resultCount);
241
+ // Update translated messages
242
+ await this.updateTranslatedMessages(resultCount);
243
+ // Step 2: Collect parent IDs (builds relevantNodeIds for filtering)
244
+ const parentsToExpand = await this.collectParentIds(searchResults);
245
+ // Step 2.5: Collect children IDs if searchWithChildren is enabled
246
+ if (this.searchWithChildren()) {
247
+ await this.collectChildrenIds(searchResults);
248
+ }
249
+ // Step 3: Reload tree to apply filtering
250
+ await treeComponent.reloadData();
251
+ // Step 4: Expand root node
252
+ if (!treeComponent.isNodeExpanded(ROOT_NODE_ID)) {
253
+ try {
254
+ await treeComponent.expandNode(ROOT_NODE_ID);
255
+ this.nodesExpandedDuringSearch.push(ROOT_NODE_ID);
256
+ }
257
+ catch {
258
+ // Root might not exist
259
+ }
260
+ }
261
+ // Step 4: Expand all parent nodes in order (from root to leaves)
262
+ // Sort parents by their depth to expand in correct order
263
+ const sortedParents = await this.sortParentsByDepth(Array.from(parentsToExpand));
264
+ for (const parentId of sortedParents) {
265
+ // Only expand if not already expanded
266
+ if (!treeComponent.isNodeExpanded(parentId)) {
267
+ try {
268
+ await treeComponent.expandNode(parentId);
269
+ this.nodesExpandedDuringSearch.push(parentId);
270
+ // Small delay to prevent overwhelming the tree component
271
+ await new Promise((resolve) => setTimeout(resolve, 10));
272
+ }
273
+ catch {
274
+ // Node might not exist, ignore
275
+ }
276
+ }
277
+ }
278
+ // Step 5: Apply highlighting after tree is rendered
279
+ // Use setTimeout to ensure DOM is updated after tree reload
280
+ setTimeout(() => {
281
+ if (this.currentSearchValue().trim()) {
282
+ this.highlightService.highlight('ax-tree-view .ax-truncate', this.currentSearchValue().trim());
283
+ }
284
+ }, 100);
285
+ }
286
+ catch (error) {
287
+ console.error('Error searching categories:', error);
288
+ this.matchingNodeIds.clear();
289
+ this.relevantNodeIds.clear();
290
+ this.searchResultCount.set(0);
291
+ this.highlightService.clear();
292
+ // Reload tree to clear any filters
293
+ const treeComponent = this.tree();
294
+ if (treeComponent) {
295
+ await treeComponent.reloadData();
296
+ }
297
+ }
298
+ finally {
299
+ if (this.currentSearchTerm === searchTerm) {
300
+ this.currentSearchTerm = null;
301
+ }
302
+ this.isSearching.set(false);
303
+ }
304
+ }
305
+ /**
306
+ * Collects all parent IDs for the given search results
307
+ * Handles both nested 'parent' object and 'parentId' field in search results
308
+ * Recursively fetches parent nodes to build the full parent chain
309
+ */
310
+ async collectParentIds(items) {
311
+ const parentsToExpand = new Set();
312
+ const valueField = this.valueField();
313
+ const parentKey = this.treeData?.categoryEntityDef?.parentKey || 'parentId';
314
+ // Build relevantNodeIds = matching nodes + all parents
315
+ this.relevantNodeIds.clear();
316
+ this.matchingNodeIds.forEach((id) => this.relevantNodeIds.add(id));
317
+ // Recursively extract all parent IDs
318
+ const extractParentIds = async (item) => {
319
+ // First, try to get parent from nested 'parent' object (if available)
320
+ const parent = item['parent'];
321
+ if (parent) {
322
+ const parentId = String(parent[valueField] ?? parent['id'] ?? '');
323
+ if (parentId && parentId !== ROOT_NODE_ID) {
324
+ parentsToExpand.add(parentId);
325
+ this.relevantNodeIds.add(parentId); // Add to filter set
326
+ this.nodeDataCache.set(parentId, parent);
327
+ await extractParentIds(parent);
328
+ }
329
+ }
330
+ else {
331
+ // Fallback: use parentId field and fetch parent from server
332
+ // Try both parentKey from entity definition and common 'parentId' field
333
+ const parentIdValue = item[parentKey] ?? item['parentId'];
334
+ if (parentIdValue) {
335
+ const parentId = String(parentIdValue);
336
+ if (parentId && parentId !== ROOT_NODE_ID) {
337
+ // Add to sets first
338
+ parentsToExpand.add(parentId);
339
+ this.relevantNodeIds.add(parentId);
340
+ // Fetch parent from server if not already cached
341
+ if (!this.nodeDataCache.has(parentId)) {
342
+ const parentItem = await this.fetchItemById(parentId);
343
+ if (parentItem) {
344
+ this.nodeDataCache.set(parentId, parentItem);
345
+ // Recursively fetch parent's parent
346
+ await extractParentIds(parentItem);
347
+ }
348
+ }
349
+ else {
350
+ // Parent already in cache, recursively process it
351
+ const cachedParent = this.nodeDataCache.get(parentId);
352
+ if (cachedParent) {
353
+ await extractParentIds(cachedParent);
354
+ }
355
+ }
356
+ }
357
+ }
358
+ }
359
+ };
360
+ // Process all items
361
+ for (const item of items) {
362
+ await extractParentIds(item);
363
+ }
364
+ return parentsToExpand;
365
+ }
366
+ /**
367
+ * Collects children IDs for matching search results recursively
368
+ * Adds all descendants (children, grandchildren, etc.) to relevantNodeIds so they appear in the filtered tree
369
+ */
370
+ async collectChildrenIds(items) {
371
+ if (!this.treeData?.categoryEntityQueryFunc || !this.treeConfig) {
372
+ return;
373
+ }
374
+ const valueField = this.valueField();
375
+ const parentKey = this.treeData.categoryEntityDef?.parentKey;
376
+ if (!parentKey) {
377
+ return;
378
+ }
379
+ // For each matching node, recursively fetch all its descendants
380
+ for (const item of items) {
381
+ const nodeId = String(item[valueField] ?? '');
382
+ if (!nodeId || nodeId === ROOT_NODE_ID) {
383
+ continue;
384
+ }
385
+ await this.collectChildrenRecursively(nodeId, valueField, parentKey);
386
+ }
387
+ }
388
+ /**
389
+ * Recursively collects all descendant IDs for a given node
390
+ */
391
+ async collectChildrenRecursively(nodeId, valueField, parentKey) {
392
+ if (!this.treeData?.categoryEntityQueryFunc) {
393
+ return;
394
+ }
395
+ try {
396
+ // Fetch children for this node
397
+ const event = {
398
+ ...this.treeData.basicQueryEvent,
399
+ filter: {
400
+ field: parentKey,
401
+ value: nodeId,
402
+ operator: { type: 'equal' },
403
+ },
404
+ };
405
+ const res = await this.treeData.categoryEntityQueryFunc(event);
406
+ if (res?.items && res.items.length > 0) {
407
+ // Add children IDs to relevantNodeIds so they appear in filtered tree
408
+ for (const child of res.items) {
409
+ const childId = String(child[valueField] ?? '');
410
+ if (childId && childId !== ROOT_NODE_ID) {
411
+ this.relevantNodeIds.add(childId);
412
+ // Cache child data
413
+ this.nodeDataCache.set(childId, child);
414
+ // Recursively fetch children of this child
415
+ await this.collectChildrenRecursively(childId, valueField, parentKey);
416
+ }
417
+ }
418
+ }
419
+ }
420
+ catch (error) {
421
+ console.error(`Error fetching children for node ${nodeId}:`, error);
422
+ }
423
+ }
424
+ /**
425
+ * Fetches a single item by ID from the server
426
+ */
427
+ async fetchItemById(id) {
428
+ if (!this.treeData?.categoryEntityQueryFunc) {
429
+ return null;
430
+ }
431
+ try {
432
+ const valueField = this.valueField();
433
+ const event = {
434
+ ...this.treeData.basicQueryEvent,
435
+ filter: {
436
+ field: valueField,
437
+ value: id,
438
+ operator: { type: 'equal' },
439
+ },
440
+ };
441
+ const res = await this.treeData.categoryEntityQueryFunc(event);
442
+ return res?.items?.[0] ?? null;
443
+ }
444
+ catch (error) {
445
+ console.error('Error fetching item by ID:', error);
446
+ return null;
447
+ }
448
+ }
449
+ /**
450
+ * Sorts parent IDs by their depth (root first, leaves last)
451
+ * Uses cached data from collectParentIds
452
+ */
453
+ async sortParentsByDepth(parentIds) {
454
+ const parentKey = this.treeData?.categoryEntityDef?.parentKey;
455
+ if (!parentKey || parentIds.length === 0) {
456
+ return parentIds;
457
+ }
458
+ // Build depth map using cached data
459
+ const depthMap = new Map();
460
+ for (const parentId of parentIds) {
461
+ if (depthMap.has(parentId)) {
462
+ continue;
463
+ }
464
+ let depth = 0;
465
+ let currentId = parentId;
466
+ const visited = new Set();
467
+ while (currentId && currentId !== ROOT_NODE_ID && !visited.has(currentId)) {
468
+ visited.add(currentId);
469
+ depth++;
470
+ // Use nodeDataCache which was populated by collectParentIds
471
+ const item = this.nodeDataCache.get(currentId);
472
+ if (item) {
473
+ currentId = item[parentKey] ? String(item[parentKey]) : null;
474
+ }
475
+ else {
476
+ break;
477
+ }
478
+ }
479
+ depthMap.set(parentId, depth);
480
+ }
481
+ // Sort by depth (lower depth = closer to root = expand first)
482
+ return parentIds.sort((a, b) => {
483
+ const depthA = depthMap.get(a) ?? 0;
484
+ const depthB = depthMap.get(b) ?? 0;
485
+ return depthA - depthB;
486
+ });
487
+ }
488
+ /**
489
+ * Updates translated messages for search results
490
+ */
491
+ async updateTranslatedMessages(resultCount) {
492
+ if (resultCount > 0) {
493
+ const key = resultCount === 1
494
+ ? '@general:terms.interface.category.search.results-found.singular'
495
+ : '@general:terms.interface.category.search.results-found.plural';
496
+ const text = await this.translate.translateAsync(key, { params: { count: resultCount } });
497
+ this.resultsFoundText.set(text);
498
+ }
499
+ else {
500
+ this.resultsFoundText.set('');
501
+ }
502
+ }
503
+ /**
504
+ * Resets search state and restores tree to original expanded state
505
+ */
506
+ async resetSearch() {
507
+ this.searchResultCount.set(0);
508
+ this.resultsFoundText.set('');
509
+ this.currentSearchTerm = null;
510
+ this.isSearching.set(false);
511
+ this.matchingNodeIds.clear();
512
+ this.relevantNodeIds.clear();
513
+ this.nodeDataCache.clear();
514
+ // Clear highlighting
515
+ this.highlightService.clear();
516
+ const treeComponent = this.tree();
517
+ if (!treeComponent) {
518
+ this.expandedNodesBeforeSearch = [];
519
+ this.nodesExpandedDuringSearch = [];
520
+ return;
521
+ }
522
+ // Reload tree to show all nodes (no filtering)
523
+ await treeComponent.reloadData();
524
+ // Collapse nodes that were expanded during search (in reverse order - leaves first)
525
+ const nodesToCollapse = [...this.nodesExpandedDuringSearch].reverse();
526
+ this.nodesExpandedDuringSearch = [];
527
+ for (const nodeId of nodesToCollapse) {
528
+ // Only collapse if it wasn't originally expanded before search
529
+ if (!this.expandedNodesBeforeSearch.includes(nodeId)) {
530
+ try {
531
+ treeComponent.collapseNode(nodeId);
532
+ }
533
+ catch {
534
+ // Node might not exist anymore, ignore
535
+ }
536
+ }
537
+ }
538
+ // Clear the stored expanded nodes
539
+ this.expandedNodesBeforeSearch = [];
540
+ }
541
+ /**
542
+ * Checks if a node matches the current search term
543
+ */
544
+ isMatchingNode(nodeId) {
545
+ return this.matchingNodeIds.has(nodeId);
546
+ }
547
+ /**
548
+ * Handles node click events to apply category filters
549
+ */
550
+ handleNodeClick(node) {
551
+ const nodeData = this.extractNodeData(node);
552
+ const applyConditions = this.vm().entityDef.category?.applyConditions || [];
553
+ const categoryFilters = this.buildCategoryFilters(nodeData, applyConditions);
554
+ const viewFilters = this.buildViewFilters();
555
+ this.vm().dataSource.filter({
556
+ filters: [...viewFilters, ...categoryFilters],
557
+ logic: 'and',
558
+ });
559
+ this.vm().dataSource.refresh();
560
+ }
561
+ /**
562
+ * Handles node toggle events (expansion/collapse)
563
+ */
564
+ async onNodeToggle(_event) {
565
+ // Tree component handles lazy loading via datasource callback
566
+ }
567
+ //#endregion
568
+ //#region ---- CRUD Operations ----
569
+ /**
570
+ * Creates a new root category node
571
+ */
572
+ async handleCreateRootClick(event) {
573
+ this.preventDefaultAndStopPropagation(event);
574
+ try {
575
+ const context = await this.executeCreateWorkflow(undefined);
576
+ await this.handleCreateResult(context, undefined);
577
+ }
578
+ catch (error) {
579
+ console.error('Error creating root category:', error);
580
+ }
581
+ }
582
+ /**
583
+ * Creates a new child category under the given parent node
584
+ */
585
+ async handleCreateChildClick(node, event) {
586
+ this.preventDefaultAndStopPropagation(event);
587
+ try {
588
+ const parentId = this.extractNodeId(node);
589
+ const context = await this.executeCreateWorkflow(parentId);
590
+ await this.handleCreateResult(context, parentId);
591
+ }
592
+ catch (error) {
593
+ console.error('Error creating child category:', error);
594
+ }
595
+ }
596
+ /**
597
+ * Updates an existing category node
598
+ */
599
+ async handleEditNodeClick(node, event) {
600
+ this.preventDefaultAndStopPropagation(event);
601
+ try {
602
+ const nodeData = this.extractNodeData(node);
603
+ const context = await this.executeModifyWorkflow(nodeData);
604
+ await this.handleModifyResult(context, node);
605
+ }
606
+ catch (error) {
607
+ console.error('Error editing category:', error);
608
+ }
609
+ }
610
+ /**
611
+ * Deletes a category node
612
+ */
613
+ async handleDeleteNodeClick(node, event) {
614
+ this.preventDefaultAndStopPropagation(event);
615
+ try {
616
+ const nodeData = this.extractNodeData(node);
617
+ const context = await this.executeDeleteWorkflow(nodeData);
618
+ await this.handleDeleteResult(context, node);
619
+ }
620
+ catch (error) {
621
+ console.error('Error deleting category:', error);
622
+ }
623
+ }
624
+ //#endregion
625
+ //#region ---- Private Tree Management Methods ----
626
+ /**
627
+ * Initializes the category tree data structure
628
+ */
629
+ async initializeTree() {
630
+ this.setLoadingWithDelay(true);
631
+ try {
632
+ const entityKey = this.categoryEntityKey();
633
+ this.treeConfig = {
634
+ entityKey,
635
+ textField: this.textField(),
636
+ valueField: this.valueField(),
637
+ };
638
+ this.treeData = await this.categoryTreeService.initializeCategoryTree(this.treeConfig);
639
+ if (!this.treeData) {
640
+ this.clearLoadingState();
641
+ return;
642
+ }
643
+ // Set parent key from entity definition
644
+ if (this.treeData.categoryEntityDef?.parentKey) {
645
+ this.treeConfig.parentKey = this.treeData.categoryEntityDef.parentKey;
646
+ }
647
+ }
648
+ catch (error) {
649
+ console.error('Error loading categories:', error);
650
+ }
651
+ finally {
652
+ this.clearLoadingState();
653
+ }
654
+ }
655
+ /**
656
+ * Loads root nodes for the tree
657
+ */
658
+ async loadRootNodes() {
659
+ if (!this.isTreeInitialized()) {
660
+ return [];
661
+ }
662
+ // Load root categories
663
+ const items = await this.categoryTreeService.loadRootCategories(this.treeData, this.treeConfig);
664
+ if (!items) {
665
+ return [];
666
+ }
667
+ const rootNode = await this.categoryTreeService.createRootNode(items, this.treeConfig);
668
+ // Filter root's children when search is active
669
+ if (this.relevantNodeIds.size > 0 && rootNode['children']) {
670
+ rootNode['children'] = rootNode['children'].filter((child) => {
671
+ const childId = String(child['id'] ?? '');
672
+ return this.relevantNodeIds.has(childId);
673
+ });
674
+ rootNode['childrenCount'] = rootNode['children'].length;
675
+ }
676
+ return [rootNode];
677
+ }
678
+ /**
679
+ * Loads child nodes for a given parent ID
680
+ */
681
+ async loadChildNodes(parentId) {
682
+ if (!this.isTreeInitialized()) {
683
+ return [];
684
+ }
685
+ // Create minimal node object - loadChildren only needs node.id
686
+ const targetNode = {
687
+ id: parentId,
688
+ };
689
+ let children = await this.categoryTreeService.loadChildren(targetNode, this.treeData, this.treeConfig);
690
+ // Filter children when search is active
691
+ if (this.relevantNodeIds.size > 0) {
692
+ children = children.filter((child) => {
693
+ const childId = String(child['id'] ?? '');
694
+ return this.relevantNodeIds.has(childId);
695
+ });
696
+ }
697
+ return children;
698
+ }
699
+ /**
700
+ * Refreshes the tree view component
701
+ */
702
+ refreshTree() {
703
+ const treeComponent = this.tree();
704
+ if (treeComponent) {
705
+ treeComponent.refresh();
706
+ }
707
+ }
708
+ /**
709
+ * Refreshes tree after CRUD operations
710
+ */
711
+ async refreshAfterChange(parentId) {
712
+ this.refreshTree();
713
+ }
714
+ /**
715
+ * Adds a new node to the tree after create operation
716
+ */
717
+ async addNodeToTree(entityData, parentId) {
718
+ if (!this.isTreeInitialized()) {
719
+ return;
720
+ }
721
+ const treeComponent = this.tree();
722
+ if (!treeComponent) {
723
+ return;
724
+ }
725
+ const newNode = this.categoryTreeService.convertToTreeNode(entityData, this.treeConfig);
726
+ if (parentId) {
727
+ await this.addChildNode(treeComponent, parentId, newNode);
728
+ }
729
+ else {
730
+ await this.addRootNode(treeComponent, newNode);
731
+ }
732
+ }
733
+ /**
734
+ * Adds a child node to a parent node
735
+ */
736
+ async addChildNode(treeComponent, parentId, newNode) {
737
+ const parentNode = treeComponent.findNode(parentId);
738
+ if (!parentNode) {
739
+ await this.refreshAfterChange(parentId);
740
+ return;
741
+ }
742
+ if (!treeComponent.isNodeExpanded(parentId)) {
743
+ await treeComponent.expandNode(parentId);
744
+ }
745
+ treeComponent.addChild(parentId, newNode);
746
+ }
747
+ /**
748
+ * Adds a root node to the tree
749
+ */
750
+ async addRootNode(treeComponent, newNode) {
751
+ const rootNode = treeComponent.findNode(ROOT_NODE_ID);
752
+ if (!rootNode) {
753
+ await this.refreshAfterChange();
754
+ return;
755
+ }
756
+ if (!treeComponent.isNodeExpanded(ROOT_NODE_ID)) {
757
+ await treeComponent.expandNode(ROOT_NODE_ID);
758
+ }
759
+ treeComponent.addChild(ROOT_NODE_ID, newNode);
760
+ }
761
+ /**
762
+ * Updates an existing node in the tree after edit operation
763
+ */
764
+ async updateNodeInTree(nodeId, entityData) {
765
+ if (!this.isTreeInitialized()) {
766
+ return;
767
+ }
768
+ const treeComponent = this.tree();
769
+ if (!treeComponent) {
770
+ return;
771
+ }
772
+ const existingNode = treeComponent.findNode(nodeId);
773
+ if (!existingNode) {
774
+ await this.refreshNodeParent(entityData);
775
+ return;
776
+ }
777
+ // Check if parent changed
778
+ const parentKey = this.treeData?.categoryEntityDef?.parentKey;
779
+ let newParentId = undefined;
780
+ if (parentKey && entityData[parentKey]) {
781
+ const parentValue = String(entityData[parentKey]);
782
+ // 'all' means root, so treat it as undefined
783
+ newParentId = parentValue !== 'all' && parentValue !== '' ? parentValue : undefined;
784
+ }
785
+ const currentParent = treeComponent.getParent(nodeId);
786
+ const currentParentId = currentParent ? String(currentParent['id'] ?? '') : undefined;
787
+ // Normalize current parent: 'all' means root (undefined)
788
+ const normalizedCurrentParentId = currentParentId === 'all' || currentParentId === '' ? undefined : currentParentId;
789
+ // Handle parent change: move node to new parent if parent changed
790
+ if (newParentId !== normalizedCurrentParentId) {
791
+ // If parent changed, move the node first
792
+ const moved = treeComponent.moveNode(nodeId, newParentId);
793
+ if (!moved) {
794
+ // If move failed, refresh the tree to ensure consistency
795
+ await this.refreshNodeParent(entityData);
796
+ return;
797
+ }
798
+ // After moving, we need to ensure the new parent is expanded
799
+ if (newParentId) {
800
+ if (!treeComponent.isNodeExpanded(newParentId)) {
801
+ await treeComponent.expandNode(newParentId);
802
+ }
803
+ }
804
+ else {
805
+ // Moving to root - ensure root is expanded
806
+ if (!treeComponent.isNodeExpanded(ROOT_NODE_ID)) {
807
+ await treeComponent.expandNode(ROOT_NODE_ID);
808
+ }
809
+ }
810
+ }
811
+ // Update node properties (title, data, etc.)
812
+ const updatedNode = this.categoryTreeService.convertToTreeNode(entityData, this.treeConfig);
813
+ const updates = {
814
+ ['title']: updatedNode['title'],
815
+ ['data']: updatedNode['data'],
816
+ ['childrenCount']: updatedNode['childrenCount'],
817
+ ['icon']: updatedNode['icon'],
818
+ };
819
+ treeComponent.editNode(nodeId, updates);
820
+ }
821
+ /**
822
+ * Removes a node from the tree after delete operation
823
+ */
824
+ async removeNodeFromTree(nodeId) {
825
+ const treeComponent = this.tree();
826
+ if (!treeComponent) {
827
+ return;
828
+ }
829
+ const nodeToDelete = treeComponent.findNode(nodeId);
830
+ if (!nodeToDelete) {
831
+ await this.refreshAfterChange();
832
+ return;
833
+ }
834
+ treeComponent.removeNode(nodeId);
835
+ }
836
+ //#endregion
837
+ //#region ---- Workflow Execution Methods ----
838
+ /**
839
+ * Executes the create entity workflow
840
+ */
841
+ async executeCreateWorkflow(parentId) {
842
+ const entityKey = this.categoryEntityKey();
843
+ const workflowData = {};
844
+ if (parentId && this.treeData?.categoryEntityDef?.parentKey) {
845
+ workflowData[this.treeData.categoryEntityDef.parentKey] = parentId;
846
+ }
847
+ return await this.workflow.execute('create-entity', {
848
+ entity: entityKey,
849
+ data: Object.keys(workflowData).length > 0 ? workflowData : undefined,
850
+ options: { process: { redirect: false, canCreateNewOne: !!parentId } },
851
+ });
852
+ }
853
+ /**
854
+ * Executes the modify entity workflow
855
+ */
856
+ async executeModifyWorkflow(nodeData) {
857
+ return await this.workflow.execute('quick-modify-entity', {
858
+ entity: this.categoryEntityKey(),
859
+ data: nodeData,
860
+ options: { layout: { size: 'md' } },
861
+ });
862
+ }
863
+ /**
864
+ * Executes the delete entity workflow
865
+ */
866
+ async executeDeleteWorkflow(nodeData) {
867
+ return await this.workflow.execute('delete-entity', {
868
+ entity: this.categoryEntityKey(),
869
+ data: nodeData,
870
+ options: { process: { showResult: true } },
871
+ });
872
+ }
873
+ /**
874
+ * Handles the result of a create operation
875
+ */
876
+ async handleCreateResult(context, parentId) {
877
+ const result = context.getOutput('result');
878
+ if (!result || !this.isTreeInitialized()) {
879
+ await this.refreshAfterChange(parentId);
880
+ return;
881
+ }
882
+ const newEntityData = context.getVariable('data');
883
+ if (newEntityData) {
884
+ await this.addNodeToTree(newEntityData, parentId);
885
+ }
886
+ else {
887
+ await this.refreshAfterChange(parentId);
888
+ }
889
+ }
890
+ /**
891
+ * Handles the result of a modify operation
892
+ */
893
+ async handleModifyResult(context, node) {
894
+ const result = context.getOutput('result');
895
+ if (!result || !this.isTreeInitialized()) {
896
+ await this.refreshNodeParent(this.extractNodeData(node));
897
+ return;
898
+ }
899
+ const updatedEntityData = context.getVariable('data');
900
+ if (updatedEntityData) {
901
+ await this.updateNodeInTree(this.extractNodeId(node), updatedEntityData);
902
+ }
903
+ else {
904
+ await this.refreshNodeParent(this.extractNodeData(node));
905
+ }
906
+ }
907
+ /**
908
+ * Handles the result of a delete operation
909
+ */
910
+ async handleDeleteResult(context, node) {
911
+ const result = context.getOutput('result');
912
+ if (result) {
913
+ await this.removeNodeFromTree(this.extractNodeId(node));
914
+ }
915
+ else {
916
+ await this.refreshNodeParent(this.extractNodeData(node));
917
+ }
918
+ }
919
+ //#endregion
920
+ //#region ---- Utility Methods ----
921
+ /**
922
+ * Checks if tree data and config are initialized
923
+ */
924
+ isTreeInitialized() {
925
+ return !!(this.treeData && this.treeConfig);
926
+ }
927
+ /**
928
+ * Extracts node data from a tree node
929
+ */
930
+ extractNodeData(node) {
931
+ return (node['data'] || node);
932
+ }
933
+ /**
934
+ * Extracts node ID from a tree node
935
+ */
936
+ extractNodeId(node) {
937
+ return String(node['id'] ?? '');
938
+ }
939
+ /**
940
+ * Builds category filters from node data and apply conditions
941
+ */
942
+ buildCategoryFilters(nodeData, applyConditions) {
943
+ return applyConditions
944
+ .map((condition) => {
945
+ const value = nodeData[condition.value];
946
+ if (value === 'all' || value == null) {
947
+ return null;
948
+ }
949
+ return {
950
+ field: condition.name,
951
+ value,
952
+ operator: condition.operator,
953
+ };
954
+ })
955
+ .filter((item) => item !== null);
956
+ }
957
+ /**
958
+ * Builds view filters from view conditions
959
+ */
960
+ buildViewFilters() {
961
+ return this.vm()
962
+ .view()
963
+ .conditions.map((condition) => ({ ...condition, field: condition.name }));
964
+ }
965
+ /**
966
+ * Refreshes the parent node of the given entity data
967
+ */
968
+ async refreshNodeParent(entityData) {
969
+ const parentKey = this.treeData?.categoryEntityDef?.parentKey;
970
+ const parentId = parentKey && entityData[parentKey] ? entityData[parentKey] : undefined;
971
+ await this.refreshAfterChange(parentId);
972
+ }
973
+ /**
974
+ * Prevents default behavior and stops event propagation
975
+ */
976
+ preventDefaultAndStopPropagation(event) {
977
+ event.nativeEvent.preventDefault();
978
+ event.nativeEvent.stopPropagation();
979
+ }
980
+ //#endregion
981
+ //#region ---- Loading State Management ----
982
+ /**
983
+ * Sets loading state with delay to avoid flickering for fast responses
984
+ */
985
+ setLoadingWithDelay(loading) {
986
+ if (!loading) {
987
+ return;
988
+ }
989
+ if (this.loadingTimeoutId) {
990
+ clearTimeout(this.loadingTimeoutId);
991
+ }
992
+ this.loadingTimeoutId = setTimeout(() => {
993
+ this.isLoading.set(true);
994
+ this.loadingTimeoutId = null;
995
+ }, LOADING_DELAY_MS);
996
+ }
997
+ /**
998
+ * Clears loading state and cancels any pending timeout
999
+ */
1000
+ clearLoadingState() {
1001
+ if (this.loadingTimeoutId) {
1002
+ clearTimeout(this.loadingTimeoutId);
1003
+ this.loadingTimeoutId = null;
1004
+ }
1005
+ this.isLoading.set(false);
1006
+ }
1007
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPEntityCategoryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1008
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.12", 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 }, selectMode: { classPropertyName: "selectMode", publicName: "selectMode", isSignal: true, isRequired: false, transformFunction: null }, selectionBehavior: { classPropertyName: "selectionBehavior", publicName: "selectionBehavior", isSignal: true, isRequired: false, transformFunction: null }, dragArea: { classPropertyName: "dragArea", publicName: "dragArea", isSignal: true, isRequired: false, transformFunction: null }, dragBehavior: { classPropertyName: "dragBehavior", publicName: "dragBehavior", isSignal: true, isRequired: false, transformFunction: null }, showIcons: { classPropertyName: "showIcons", publicName: "showIcons", isSignal: true, isRequired: false, transformFunction: null }, showChildrenBadge: { classPropertyName: "showChildrenBadge", publicName: "showChildrenBadge", isSignal: true, isRequired: false, transformFunction: null }, expandedIcon: { classPropertyName: "expandedIcon", publicName: "expandedIcon", isSignal: true, isRequired: false, transformFunction: null }, collapsedIcon: { classPropertyName: "collapsedIcon", publicName: "collapsedIcon", isSignal: true, isRequired: false, transformFunction: null }, indentSize: { classPropertyName: "indentSize", publicName: "indentSize", isSignal: true, isRequired: false, transformFunction: null }, look: { classPropertyName: "look", publicName: "look", isSignal: true, isRequired: false, transformFunction: null }, searchWithChildren: { classPropertyName: "searchWithChildren", publicName: "searchWithChildren", 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 <div class=\"ax-flex ax-flex-col ax-gap-1 ax-w-full\">\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 @if (isSearching() && currentSearchValue().trim()) {\n <div class=\"ax-text-xs ax-text-muted ax-flex ax-items-center ax-gap-1\">\n <span>{{ '@general:terms.interface.category.search.searching' | translate | async }}</span>\n </div>\n } @else if (currentSearchValue().trim() && !isSearching()) {\n <div class=\"ax-text-xs ax-text-muted ax-flex ax-items-center ax-gap-1\">\n @if (searchResultCount() > 0) {\n <span>{{ resultsFoundText() }}</span>\n }\n </div>\n }\n </div>\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 (showNoSearchResults()) {\n <div class=\"__empty-state\">\n <axp-state-message\n icon=\"fa-light fa-search\"\n [title]=\"'@general:terms.interface.category.search.no-results-found.title'\"\n [description]=\"'@general:terms.interface.category.search.no-results-found.description'\"\n >\n </axp-state-message>\n </div>\n } @else if (treeData) {\n <div class=\"ax-px-4 ax-max-h-[calc(100vh-250px)] ax-overflow-auto\">\n <ax-tree-view\n [datasource]=\"datasource\"\n [selectMode]=\"selectMode()\"\n [selectionBehavior]=\"selectionBehavior()\"\n [dragArea]=\"dragArea()\"\n [dragBehavior]=\"dragBehavior()\"\n [showIcons]=\"showIcons()\"\n [showChildrenBadge]=\"showChildrenBadge()\"\n [expandedIcon]=\"expandedIcon()\"\n [collapsedIcon]=\"collapsedIcon()\"\n [indentSize]=\"indentSize()\"\n [look]=\"look()\"\n [titleField]=\"textField()\"\n [idField]=\"valueField()\"\n [expandOnDoubleClick]=\"true\"\n [nodeTemplate]=\"itemTemplate\"\n (onNodeToggle)=\"onNodeToggle($event)\"\n (onNodeClick)=\"handleNodeClick($event.node)\"\n #tree\n >\n </ax-tree-view>\n </div>\n } @else {\n <div class=\"__empty-state\">\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 </div>\n }\n\n <ng-template #itemTemplate let-node=\"node\" let-level=\"level\">\n @let item = node.data || node;\n @let textField = vm().entityDef.category?.textField || 'title';\n @let valueField = vm().entityDef.category?.valueField || 'id';\n @let itemId = item[valueField] || node.id;\n @let itemTitle = item[textField] || node.title;\n <div class=\"ax-flex ax-items-center ax-justify-between ax-w-full ax-gap-2 ax-overflow-hidden ax-py-1\">\n <div class=\"ax-flex ax-items-center ax-gap-2 ax-min-w-0\">\n <ax-icon\n class=\"fas fa-folder\"\n [style.color]=\"item.color ?? 'rgba(var(--ax-sys-color-warning-500), 1)'\"\n ></ax-icon>\n <span class=\"ax-truncate\">{{ itemTitle }}</span>\n </div>\n @if (itemId && itemId !== '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(node, $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(node, $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(node, $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 (itemId === '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: [""], 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: AXTreeViewComponent, selector: "ax-tree-view", inputs: ["datasource", "selectMode", "selectionBehavior", "dragArea", "dragBehavior", "showIcons", "showChildrenBadge", "expandedIcon", "collapsedIcon", "indentSize", "look", "nodeTemplate", "idField", "titleField", "tooltipField", "iconField", "expandedField", "selectedField", "indeterminateField", "disabledField", "hiddenField", "childrenField", "childrenCountField", "dataField", "inheritDisabled", "expandOnDoubleClick"], outputs: ["datasourceChange", "onBeforeDrop", "onNodeToggle", "onNodeSelect", "onNodeDoubleClick", "onNodeClick", "onSelectionChange", "onOrderChange", "onMoveChange", "onItemsChange"] }, { kind: "ngmodule", type: AXSkeletonModule }, { kind: "component", type: i2$1.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", "autoSearch"], 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.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.AXButtonItemComponent, selector: "ax-button-item", inputs: ["color", "disabled", "text", "selected", "divided", "data", "name"], outputs: ["onClick", "onFocus", "onBlur", "disabledChange"] }, { kind: "component", type: i3.AXButtonItemListComponent, selector: "ax-button-item-list", inputs: ["items", "closeParentOnClick", "lockOnLoading"], 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 }); }
1009
+ }
1010
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPEntityCategoryComponent, decorators: [{
1011
+ type: Component,
1012
+ args: [{ selector: 'axp-entity-category', standalone: true, encapsulation: ViewEncapsulation.None, imports: [
1013
+ CommonModule,
1014
+ AXDecoratorModule,
1015
+ AXTreeViewModule,
1016
+ AXTreeViewComponent,
1017
+ AXSkeletonModule,
1018
+ AXPThemeLayoutBlockComponent,
1019
+ AXSearchBoxModule,
1020
+ AXPThemeLayoutHeaderComponent,
1021
+ AXPThemeLayoutToolbarComponent,
1022
+ AXTranslationModule,
1023
+ AXButtonModule,
1024
+ AXDropdownModule,
1025
+ AXPStateMessageComponent,
1026
+ ], 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 <div class=\"ax-flex ax-flex-col ax-gap-1 ax-w-full\">\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 @if (isSearching() && currentSearchValue().trim()) {\n <div class=\"ax-text-xs ax-text-muted ax-flex ax-items-center ax-gap-1\">\n <span>{{ '@general:terms.interface.category.search.searching' | translate | async }}</span>\n </div>\n } @else if (currentSearchValue().trim() && !isSearching()) {\n <div class=\"ax-text-xs ax-text-muted ax-flex ax-items-center ax-gap-1\">\n @if (searchResultCount() > 0) {\n <span>{{ resultsFoundText() }}</span>\n }\n </div>\n }\n </div>\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 (showNoSearchResults()) {\n <div class=\"__empty-state\">\n <axp-state-message\n icon=\"fa-light fa-search\"\n [title]=\"'@general:terms.interface.category.search.no-results-found.title'\"\n [description]=\"'@general:terms.interface.category.search.no-results-found.description'\"\n >\n </axp-state-message>\n </div>\n } @else if (treeData) {\n <div class=\"ax-px-4 ax-max-h-[calc(100vh-250px)] ax-overflow-auto\">\n <ax-tree-view\n [datasource]=\"datasource\"\n [selectMode]=\"selectMode()\"\n [selectionBehavior]=\"selectionBehavior()\"\n [dragArea]=\"dragArea()\"\n [dragBehavior]=\"dragBehavior()\"\n [showIcons]=\"showIcons()\"\n [showChildrenBadge]=\"showChildrenBadge()\"\n [expandedIcon]=\"expandedIcon()\"\n [collapsedIcon]=\"collapsedIcon()\"\n [indentSize]=\"indentSize()\"\n [look]=\"look()\"\n [titleField]=\"textField()\"\n [idField]=\"valueField()\"\n [expandOnDoubleClick]=\"true\"\n [nodeTemplate]=\"itemTemplate\"\n (onNodeToggle)=\"onNodeToggle($event)\"\n (onNodeClick)=\"handleNodeClick($event.node)\"\n #tree\n >\n </ax-tree-view>\n </div>\n } @else {\n <div class=\"__empty-state\">\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 </div>\n }\n\n <ng-template #itemTemplate let-node=\"node\" let-level=\"level\">\n @let item = node.data || node;\n @let textField = vm().entityDef.category?.textField || 'title';\n @let valueField = vm().entityDef.category?.valueField || 'id';\n @let itemId = item[valueField] || node.id;\n @let itemTitle = item[textField] || node.title;\n <div class=\"ax-flex ax-items-center ax-justify-between ax-w-full ax-gap-2 ax-overflow-hidden ax-py-1\">\n <div class=\"ax-flex ax-items-center ax-gap-2 ax-min-w-0\">\n <ax-icon\n class=\"fas fa-folder\"\n [style.color]=\"item.color ?? 'rgba(var(--ax-sys-color-warning-500), 1)'\"\n ></ax-icon>\n <span class=\"ax-truncate\">{{ itemTitle }}</span>\n </div>\n @if (itemId && itemId !== '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(node, $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(node, $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(node, $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 (itemId === '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" }]
1027
+ }], ctorParameters: () => [], 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 }] }], selectMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectMode", required: false }] }], selectionBehavior: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionBehavior", required: false }] }], dragArea: [{ type: i0.Input, args: [{ isSignal: true, alias: "dragArea", required: false }] }], dragBehavior: [{ type: i0.Input, args: [{ isSignal: true, alias: "dragBehavior", required: false }] }], showIcons: [{ type: i0.Input, args: [{ isSignal: true, alias: "showIcons", required: false }] }], showChildrenBadge: [{ type: i0.Input, args: [{ isSignal: true, alias: "showChildrenBadge", required: false }] }], expandedIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandedIcon", required: false }] }], collapsedIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsedIcon", required: false }] }], indentSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "indentSize", required: false }] }], look: [{ type: i0.Input, args: [{ isSignal: true, alias: "look", required: false }] }], searchWithChildren: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchWithChildren", required: false }] }] } });
1028
+
1029
+ class AXPEntityMasterToolbarViewComponent {
1030
+ constructor() {
1031
+ this.layoutService = inject(AXPLayoutThemeService);
1032
+ this.deviceService = inject(AXPDeviceService);
1033
+ this.parent = inject(AXPEntityMasterListViewComponent);
1034
+ this.router = inject(Router);
1035
+ this.activeRoute = inject(ActivatedRoute);
1036
+ this.settingsService = inject(AXPSettingsService);
1037
+ this.isInitializing = false;
1038
+ this.pendingInitialFilters = true;
1039
+ this.pendingInitialSorts = true;
1040
+ this.filterTriggerMode = 'manual';
1041
+ this.previousFilterQueries = signal([], ...(ngDevMode ? [{ debugName: "previousFilterQueries" }] : []));
1042
+ this.initialFilters = signal([], ...(ngDevMode ? [{ debugName: "initialFilters" }] : []));
1043
+ this.filtersDefinitions = signal([], ...(ngDevMode ? [{ debugName: "filtersDefinitions" }] : []));
1044
+ this.viewQueries = computed(() => this.vm.views().map((v) => ({
1045
+ name: v.name,
1046
+ fixed: false,
1047
+ title: v.title,
1048
+ columns: v.columns,
1049
+ conditions: v.conditions.map((c) => ({
1050
+ field: c.name,
1051
+ operator: c.operator,
1052
+ value: c.value,
1053
+ })),
1054
+ sorts: v.sorts,
1055
+ })), ...(ngDevMode ? [{ debugName: "viewQueries" }] : []));
1056
+ this.selectedViewQuery = computed(() => ({
1057
+ name: this.vm.view().name,
1058
+ fixed: false,
1059
+ title: this.vm.view().title,
1060
+ columns: this.vm.view().columns,
1061
+ conditions: this.vm.view().conditions.map((c) => ({
1062
+ field: c.name,
1063
+ operator: c.operator,
1064
+ value: c.value,
1065
+ })),
1066
+ sorts: this.vm.view().sorts,
1067
+ }), ...(ngDevMode ? [{ debugName: "selectedViewQuery" }] : []));
1068
+ this.isFiltersDirty = computed(() => !isEqual(this.vm.filterQueries(), this.previousFilterQueries()), ...(ngDevMode ? [{ debugName: "isFiltersDirty" }] : []));
1069
+ // Debounced apply to coalesce multiple UI changes (filters/sorts/columns)
1070
+ this.applyTimer = null;
1071
+ this.#effect = effect(() => {
1072
+ // Keep definitions up to date; initial filters are set explicitly from settings or view
1073
+ this.filtersDefinitions.set(this.vm.filtersDef);
1074
+ }, ...(ngDevMode ? [{ debugName: "#effect" }] : []));
1075
+ this.sortQueries = computed(() => this.vm
1076
+ .sortedFields()
1077
+ .filter((s) => !!s.dir)
1078
+ .map((s) => ({ name: s.name, dir: s.dir })), ...(ngDevMode ? [{ debugName: "sortQueries" }] : []));
1079
+ this.sortDefinitions = computed(() => this.vm.sortableFields().map((s) => ({
1080
+ name: s.name,
1081
+ title: s.title,
1082
+ dir: s.dir,
1083
+ })), ...(ngDevMode ? [{ debugName: "sortDefinitions" }] : []));
1084
+ }
1085
+ async ngOnInit() {
1086
+ // Prefer saved settings (view/columns/sorts/filters) if available, then apply
1087
+ await this.loadSettings();
1088
+ await this.vm.setView();
1089
+ this.filtersDefinitions.set(this.vm.filtersDef);
1090
+ this.isInitializing = true;
1091
+ // this.pendingInitialFilters = true;
1092
+ // this.pendingInitialSorts = true;
1093
+ this.setInitialFiltersFromSettingsOrView();
1094
+ // Ensure initial load even when filters/sorts are absent
1095
+ setTimeout(() => {
1096
+ this.isInitializing = false;
1097
+ this.scheduleApply();
1098
+ }, 0);
1099
+ }
1100
+ async loadSettings() {
1101
+ const filterTriggerMode = await this.settingsService.get(AXPCommonSettings.EntityFilterApplyMode);
1102
+ this.filterTriggerMode = (filterTriggerMode?.value ?? 'auto');
1103
+ }
1104
+ scheduleApply() {
1105
+ clearTimeout(this.applyTimer);
1106
+ this.applyTimer = setTimeout(() => {
1107
+ this.vm.applyFilterAndSort();
1108
+ }, 50);
1109
+ }
1110
+ async onViewChanged(view) {
1111
+ await this.vm.setView(view.name);
1112
+ // Sync query param immediately on tab change
1113
+ this.router.navigate([], {
1114
+ relativeTo: this.activeRoute,
1115
+ queryParams: { view: view.name },
1116
+ queryParamsHandling: 'merge',
1117
+ replaceUrl: true,
1118
+ });
1119
+ this.isInitializing = true;
1120
+ this.pendingInitialFilters = true;
1121
+ this.pendingInitialSorts = true;
1122
+ this.setInitialFiltersFromSettingsOrView();
1123
+ // Ensure initial load after view change
1124
+ setTimeout(() => {
1125
+ this.isInitializing = false;
1126
+ this.scheduleApply();
1127
+ }, 0);
1128
+ }
1129
+ #effect;
1130
+ setInitialFiltersFromSettingsOrView() {
1131
+ const saved = this.vm.filterQueries();
1132
+ this.previousFilterQueries.set(saved);
1133
+ const viewConditions = this.vm.view().conditions.map((c) => c.name);
1134
+ if (saved && saved.length) {
1135
+ this.initialFilters.set(saved.map((s) => ({ ...s, hidden: viewConditions.includes(s.field) })));
1136
+ return;
1137
+ }
1138
+ this.initialFilters.set(this.vm.view().conditions.map((c) => ({
1139
+ field: c.name,
1140
+ operator: c.operator,
1141
+ value: c.value,
1142
+ hidden: true,
1143
+ })));
1144
+ }
1145
+ onFiltersChanged(filters) {
1146
+ if (this.isInitializing || this.pendingInitialFilters) {
1147
+ this.pendingInitialFilters = false;
1148
+ return;
1149
+ }
1150
+ this.vm.filterQueries.set(filters);
1151
+ if (this.filterTriggerMode === 'auto') {
1152
+ this.applyFilters();
1153
+ }
1154
+ }
1155
+ applyFilters() {
1156
+ this.previousFilterQueries.set(this.vm.filterQueries());
1157
+ this.vm.saveSettings('filters', this.vm.filterQueries());
1158
+ this.scheduleApply();
1159
+ }
1160
+ onSortQueriesChange(e) {
1161
+ if (this.isInitializing || this.pendingInitialSorts) {
1162
+ this.pendingInitialSorts = false;
1163
+ return;
1164
+ }
1165
+ this.vm.sortedFields.set(e.map((s) => ({
1166
+ name: s.name,
1167
+ title: s.name,
1168
+ dir: s.dir,
1169
+ })));
1170
+ // Persist sorts per module/entity/view
1171
+ this.vm.saveSettings('sorts', e);
1172
+ this.scheduleApply();
1173
+ }
1174
+ onColumnsChange(columns) {
1175
+ const keyOf = (c) => c.column?.options?.dataPath ?? c.name;
1176
+ this.vm.columns.update((prev) => {
1177
+ const byKey = new Map(prev.map((c) => [keyOf(c), c]));
1178
+ return columns.map((newColumn) => {
1179
+ const existing = byKey.get(keyOf(newColumn));
1180
+ return new AXPEntityListViewColumnViewModel(existing.property, {
1181
+ ...existing.column,
1182
+ options: {
1183
+ ...existing.column.options,
1184
+ visible: newColumn.visible,
1185
+ },
1186
+ });
1187
+ });
1188
+ });
1189
+ // Persist column order/visibility
1190
+ this.vm.onColumnsChanged(this.vm.columns());
1191
+ // Use debounced apply to avoid triple refresh when combined with sorts/filters
1192
+ // this.scheduleApply();
1193
+ }
1194
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPEntityMasterToolbarViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1195
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.12", 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-2 md:ax-gap-2\">\n @if (filterTriggerMode === 'manual' && isFiltersDirty()) {\n <ax-button\n id=\"axp-toolbar-btn-filter\"\n [title]=\"'@general:actions.apply.title'\"\n [iconOnly]=\"true\"\n #filterButton\n [color]=\"'primary'\"\n (onClick)=\"applyFilters()\"\n >\n <ax-prefix>\n <i class=\"fa-light fa-search\"></i>\n </ax-prefix>\n </ax-button>\n }\n <div>\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 </div>\n\n @if (vm.canSort()) {\n <div>\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 </div>\n }\n @if (deviceService.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.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$1.AXPopoverComponent, selector: "ax-popover", inputs: ["width", "disabled", "offsetX", "offsetY", "target", "placement", "content", "openOn", "closeOn", "hasBackdrop", "openAfter", "closeAfter", "backdropClass", "panelClass", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "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 }); }
1196
+ }
1197
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPEntityMasterToolbarViewComponent, decorators: [{
1198
+ type: Component,
1199
+ args: [{ selector: 'axp-entity-master-toolbar-view', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
1200
+ CommonModule,
1201
+ AXButtonModule,
1202
+ AXDecoratorModule,
1203
+ AXTranslationModule,
1204
+ AXPQueryFiltersComponent,
1205
+ AXPopoverModule,
1206
+ AXPQuerySortsComponent,
1207
+ AXPQueryViewsComponent,
1208
+ AXPQueryColumnsComponent,
1209
+ ], host: {
1210
+ class: 'ax-w-full',
1211
+ }, 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-2 md:ax-gap-2\">\n @if (filterTriggerMode === 'manual' && isFiltersDirty()) {\n <ax-button\n id=\"axp-toolbar-btn-filter\"\n [title]=\"'@general:actions.apply.title'\"\n [iconOnly]=\"true\"\n #filterButton\n [color]=\"'primary'\"\n (onClick)=\"applyFilters()\"\n >\n <ax-prefix>\n <i class=\"fa-light fa-search\"></i>\n </ax-prefix>\n </ax-button>\n }\n <div>\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 </div>\n\n @if (vm.canSort()) {\n <div>\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 </div>\n }\n @if (deviceService.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" }]
1212
+ }], propDecorators: { vm: [{
1213
+ type: Input,
1214
+ args: ['viewModel']
1215
+ }] } });
1216
+
1217
+ class AXPEntityMasterListViewComponent extends AXPPageLayoutBaseComponent {
1218
+ constructor(platform) {
1219
+ super();
1220
+ this.platform = platform;
1221
+ this.activeRoute = inject(ActivatedRoute);
1222
+ this.router = inject(Router);
1223
+ this.vm = this.activeRoute.snapshot.data['vm'];
1224
+ //
1225
+ this.store = inject(AXPLayoutThemeService);
1226
+ //
1227
+ this.searchBarShown = signal(true, ...(ngDevMode ? [{ debugName: "searchBarShown" }] : []));
1228
+ this.activeEndSideView = signal('column', ...(ngDevMode ? [{ debugName: "activeEndSideView" }] : []));
1229
+ this.categorySearchValue = signal('', ...(ngDevMode ? [{ debugName: "categorySearchValue" }] : []));
1230
+ // @ViewChild('grid', { static: true}) grid: AXDataTableComponent;
1231
+ this.grid = viewChild('grid', ...(ngDevMode ? [{ debugName: "grid" }] : []));
1232
+ this.initializedFromRoute = false;
1233
+ this.commandRowItems = computed(() => {
1234
+ return this.vm.primaryRowActions().map((c) => {
1235
+ return {
1236
+ icon: c.icon,
1237
+ name: c.name,
1238
+ text: translateSync(c.title),
1239
+ color: c.color,
1240
+ disabled: c.disabled,
1241
+ default: c.default,
1242
+ };
1243
+ });
1244
+ }, ...(ngDevMode ? [{ debugName: "commandRowItems" }] : []));
1245
+ this.getDropdownRowItems = (rowData) => {
1246
+ return Promise.resolve(this.dropdownRowItems(rowData));
1247
+ };
1248
+ this.getCommandRowItems = () => {
1249
+ return this.commandRowItems();
1250
+ };
1251
+ effect(() => {
1252
+ if (this.grid()) {
1253
+ this.grid().selectedRows = this.vm.selectedItems();
1254
+ }
1255
+ });
1256
+ //
1257
+ this.vm.events$.subscribe(async (e) => {
1258
+ const refreshTargetId = e.meta?.refreshTargetId;
1259
+ if (e.action == 'refresh') {
1260
+ if (refreshTargetId) {
1261
+ this.grid()?.refreshItemChildren(refreshTargetId);
1262
+ }
1263
+ else {
1264
+ this.grid()?.refresh({
1265
+ reset: false,
1266
+ });
1267
+ }
1268
+ }
1269
+ });
1270
+ // Keep URL query param `view` in sync with current vm view
1271
+ effect(() => {
1272
+ if (!this.initializedFromRoute) {
1273
+ return;
1274
+ }
1275
+ const currentViewName = this.vm.view().name;
1276
+ const urlView = this.activeRoute.snapshot.queryParamMap.get('view');
1277
+ if (currentViewName && currentViewName !== urlView) {
1278
+ this.router.navigate([], {
1279
+ relativeTo: this.activeRoute,
1280
+ queryParams: { view: currentViewName },
1281
+ queryParamsHandling: 'merge',
1282
+ replaceUrl: true,
1283
+ });
1284
+ }
1285
+ });
1286
+ }
1287
+ async ngOnInit() {
1288
+ // React to external URL changes (back/forward navigation or deep links)
1289
+ this.queryParamSub = this.activeRoute.queryParamMap.subscribe(async (qp) => {
1290
+ const viewFromUrl = qp.get('view');
1291
+ await this.vm.setView(viewFromUrl);
1292
+ });
1293
+ }
1294
+ async ngAfterViewInit() {
1295
+ const viewFromUrl = this.activeRoute.snapshot.queryParamMap.get('view');
1296
+ await this.vm.setView(viewFromUrl);
1297
+ const resolvedView = this.vm.view().name;
1298
+ const currentUrlView = this.activeRoute.snapshot.queryParamMap.get('view');
1299
+ if (currentUrlView !== resolvedView) {
1300
+ this.router.navigate([], {
1301
+ relativeTo: this.activeRoute,
1302
+ queryParams: { view: resolvedView },
1303
+ queryParamsHandling: 'merge',
1304
+ replaceUrl: true,
1305
+ });
1306
+ }
1307
+ this.initializedFromRoute = true;
1308
+ }
1309
+ onColumnSizeChanged(e) {
1310
+ if (e.isUserInteraction && e.type === 'end') {
1311
+ this.vm.saveSettings('columnSizes', e.data);
1312
+ }
1313
+ }
1314
+ onPageChanged(e) {
1315
+ if (e.isUserInteraction) {
1316
+ const pageSizeChanged = e.take != this.vm.dataSource.pageSize;
1317
+ if (pageSizeChanged) {
1318
+ this.vm.saveSettings('pageSize', e.take);
1319
+ }
1320
+ }
1321
+ }
1322
+ onColumnsOrderChanged(e) {
1323
+ if (e.isUserInteraction) {
1324
+ this.vm.onColumnsOrderChanged(e.data.event);
1325
+ }
1326
+ }
1327
+ async dropdownRowItems(rowData) {
1328
+ return (await this.vm.secondaryRowActions(rowData)).map((c) => ({
1329
+ icon: c.icon,
1330
+ name: c.name,
1331
+ text: c.title,
1332
+ color: c.color,
1333
+ disabled: c.disabled,
1334
+ default: c.default,
1335
+ divided: c.separated,
1336
+ }));
1337
+ }
1338
+ async handleRowDbClick(e) {
1339
+ if (this.grid()?.dataSource.isLoading) {
1340
+ return;
1341
+ }
1342
+ const allItems = [...this.commandRowItems(), ...(await this.dropdownRowItems(e.data))];
1343
+ // const defaultAction = allItems.find((c) => (c as any).default) || allItems[0];
1344
+ const defaultAction = allItems.find((c) => {
1345
+ const commandName = c.name.split('&')[0];
1346
+ return (c.default || commandName === 'open-entity') && !c.disabled;
1347
+ });
1348
+ if (!defaultAction) {
1349
+ return;
1350
+ }
1351
+ const d = {
1352
+ component: e.component,
1353
+ name: defaultAction.name,
1354
+ data: e.data,
1355
+ };
1356
+ this.handleRowCommandClick(d);
1357
+ }
1358
+ async handleRowCommandClick(e) {
1359
+ if (this.grid()?.dataSource.isLoading) {
1360
+ return;
1361
+ }
1362
+ if (e.setLoading) {
1363
+ e.setLoading(true);
1364
+ }
1365
+ await this.vm.executeCommand(e.name, e.data);
1366
+ if (e.setLoading) {
1367
+ e.setLoading(false);
1368
+ }
1369
+ }
1370
+ async handleSelectedRowsChange(rows) {
1371
+ this.vm.selectedItems.set(rows);
1372
+ }
1373
+ makeResponsive(value) {
1374
+ if (this.platform.is('Mobile') || this.platform.is('SM')) {
1375
+ return '';
1376
+ }
1377
+ else {
1378
+ return value;
1379
+ }
1380
+ }
1381
+ toggleSideBar(sideBar) {
1382
+ this.toggleEndSide();
1383
+ if (sideBar) {
1384
+ this.activeEndSideView.set(sideBar);
1385
+ }
1386
+ }
1387
+ toggleSearchBar() {
1388
+ this.searchBarShown.update((v) => !v);
1389
+ }
1390
+ handleResetClick(sideBar) {
1391
+ switch (sideBar) {
1392
+ case 'filter': {
1393
+ this.vm.resetFilters();
1394
+ break;
1395
+ }
1396
+ case 'sort': {
1397
+ this.vm.resetSorts();
1398
+ break;
1399
+ }
1400
+ case 'column': {
1401
+ this.vm.resetColumns();
1402
+ break;
1403
+ }
1404
+ }
1405
+ }
1406
+ // protected handleDiscardClick(sideBar: 'filter' | 'sort' | 'column') {
1407
+ // switch (sideBar) {
1408
+ // case 'filter': {
1409
+ // this.vm.discardFilters();
1410
+ // break;
1411
+ // }
1412
+ // case 'sort': {
1413
+ // this.vm.resetSorts();
1414
+ // break;
1415
+ // }
1416
+ // case 'column': {
1417
+ // this.vm.resetColumns();
1418
+ // break;
1419
+ // }
1420
+ // }
1421
+ // }
1422
+ handleApplyClick(sideBar) {
1423
+ this.vm.applyFilterAndSort();
1424
+ this.toggleEndSide();
1425
+ }
1426
+ ngOnDestroy() {
1427
+ this.queryParamSub?.unsubscribe();
1428
+ this.vm.destroy();
1429
+ }
1430
+ toggleCategoryDrawer() {
1431
+ this.toggleStartSide();
1432
+ }
1433
+ getPageTitle() {
1434
+ return this.vm.title();
1435
+ }
1436
+ async getPageDescription() {
1437
+ const description = this.vm.description();
1438
+ if (description) {
1439
+ return this.translateService.translateAsync(description);
1440
+ }
1441
+ return '';
1442
+ }
1443
+ getPageBreadcrumbs() {
1444
+ return this.vm.beardcrumbs();
1445
+ }
1446
+ async getPrimaryMenuItems() {
1447
+ return (await this.vm.getPrimaryActions()).map((tr) => ({
1448
+ name: tr.name,
1449
+ title: tr.title,
1450
+ icon: tr.icon,
1451
+ color: tr.color,
1452
+ disabled: tr.disabled,
1453
+ command: {
1454
+ name: tr.name,
1455
+ options: tr.options,
1456
+ metadata: tr.metadata,
1457
+ },
1458
+ }));
1459
+ }
1460
+ async getSecondaryMenuItems() {
1461
+ return (await this.vm.getSecondaryActions()).map((tr) => ({
1462
+ name: tr.name,
1463
+ title: tr.title,
1464
+ icon: tr.icon,
1465
+ color: tr.color,
1466
+ disabled: tr.disabled,
1467
+ separated: tr.separated,
1468
+ command: {
1469
+ name: tr.name,
1470
+ options: tr.options,
1471
+ metadata: tr.metadata,
1472
+ },
1473
+ }));
1474
+ }
1475
+ async execute(command) {
1476
+ if (command) {
1477
+ this.vm.execute(command);
1478
+ }
1479
+ }
1480
+ handleUnselectAll() {
1481
+ this.vm.selectedItems.set([]);
1482
+ }
1483
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPEntityMasterListViewComponent, deps: [{ token: i1$1.AXPlatform }], target: i0.ɵɵFactoryTarget.Component }); }
1484
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.12", type: AXPEntityMasterListViewComponent, isStandalone: true, selector: "axp-entity-master-list", providers: [
1485
+ {
1486
+ provide: AXPPageLayoutBase,
1487
+ useExisting: AXPEntityMasterListViewComponent,
1488
+ },
1489
+ ], 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 ax-pt-0\">\n <div\n class=\"ax-flex ax-items-center ax-justify-between ax-gap-1 ax-pb-1\"\n [class.ax-invisible]=\"!grid.selectedRows.length\"\n >\n <span\n >{{ grid.selectedRows.length }}\n <span>{{ '@general:terms.interface.items-selected' | translate | async }}</span>\n </span>\n <ax-button text=\"@general:terms.interface.unselect-all\" class=\"ax-xs\" (onClick)=\"handleUnselectAll()\"></ax-button>\n </div>\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 * 70 + '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))}axp-entity-master-list axp-layout-header{padding-bottom:.25rem!important}.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: "component", type: i3.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: "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", "rowDetailsTemplate", "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", "emptyStateTemplate", "emptyStateText", "items"], outputs: ["onItemClick"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "directive", type: i10.AXTranslatorDirective, selector: "[translate]" }, { kind: "ngmodule", type: DragDropModule }, { kind: "ngmodule", type:
1490
+ //
1491
+ 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:
1492
+ //
1493
+ AXPEntityMasterToolbarViewComponent, selector: "axp-entity-master-toolbar-view", inputs: ["viewModel"] }, { kind: "component", type:
1494
+ //
1495
+ 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", "selectMode", "selectionBehavior", "dragArea", "dragBehavior", "showIcons", "showChildrenBadge", "expandedIcon", "collapsedIcon", "indentSize", "look", "searchWithChildren"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i10.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
1496
+ }
1497
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPEntityMasterListViewComponent, decorators: [{
1498
+ type: Component,
1499
+ args: [{ selector: 'axp-entity-master-list', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
1500
+ CommonModule,
1501
+ FormsModule,
1502
+ RouterModule,
1503
+ AXButtonModule,
1504
+ AXDecoratorModule,
1505
+ AXBadgeModule,
1506
+ AXDropdownModule,
1507
+ AXPopoverModule,
1508
+ AXFormModule,
1509
+ AXActionSheetModule,
1510
+ AXDrawerModule,
1511
+ AXDialogModule,
1512
+ AXLoadingModule,
1513
+ AXTabsModule,
1514
+ AXTooltipModule,
1515
+ AXBreadcrumbsModule,
1516
+ AXDropdownButtonModule,
1517
+ AXSearchBoxModule,
1518
+ AXDataTableModule,
1519
+ AXTranslationModule,
1520
+ DragDropModule,
1521
+ //
1522
+ AXPWidgetCoreModule,
1523
+ AXPWidgetsModule,
1524
+ AXPAuthModule,
1525
+ //
1526
+ AXPEntityMasterToolbarViewComponent,
1527
+ //
1528
+ AXPPageLayoutComponent,
1529
+ AXPThemeLayoutBlockComponent,
1530
+ AXDropdownButtonModule,
1531
+ AXPThemeLayoutStartSideComponent,
1532
+ AXPEntityCategoryComponent,
1533
+ ], providers: [
1534
+ {
1535
+ provide: AXPPageLayoutBase,
1536
+ useExisting: AXPEntityMasterListViewComponent,
1537
+ },
1538
+ ], 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 ax-pt-0\">\n <div\n class=\"ax-flex ax-items-center ax-justify-between ax-gap-1 ax-pb-1\"\n [class.ax-invisible]=\"!grid.selectedRows.length\"\n >\n <span\n >{{ grid.selectedRows.length }}\n <span>{{ '@general:terms.interface.items-selected' | translate | async }}</span>\n </span>\n <ax-button text=\"@general:terms.interface.unselect-all\" class=\"ax-xs\" (onClick)=\"handleUnselectAll()\"></ax-button>\n </div>\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 * 70 + '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))}axp-entity-master-list axp-layout-header{padding-bottom:.25rem!important}.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"] }]
1539
+ }], ctorParameters: () => [{ type: i1$1.AXPlatform }], propDecorators: { grid: [{ type: i0.ViewChild, args: ['grid', { isSignal: true }] }] } });
1540
+
1541
+ export { AXPEntityMasterListViewComponent };
1542
+ //# sourceMappingURL=acorex-platform-themes-default-entity-master-list-view.component-DyDa_hyd.mjs.map