@acorex/platform 19.1.2 → 19.1.3

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 (78) hide show
  1. package/common/index.d.ts +1 -0
  2. package/common/lib/app/application.types.d.ts +10 -8
  3. package/common/lib/configs/app.config.d.ts +0 -1
  4. package/common/lib/filters/filters.service.d.ts +8 -0
  5. package/common/lib/filters/filters.types.d.ts +18 -0
  6. package/common/lib/filters/index.d.ts +2 -0
  7. package/common/lib/settings/setting-definition.provider.d.ts +4 -2
  8. package/common/lib/settings/setting.builder.d.ts +3 -5
  9. package/fesm2022/acorex-platform-auth.mjs +5 -4
  10. package/fesm2022/acorex-platform-auth.mjs.map +1 -1
  11. package/fesm2022/acorex-platform-common.mjs +71 -14
  12. package/fesm2022/acorex-platform-common.mjs.map +1 -1
  13. package/fesm2022/acorex-platform-layout-builder.mjs +72 -27
  14. package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
  15. package/fesm2022/acorex-platform-layout-designer.mjs +7 -7
  16. package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
  17. package/fesm2022/acorex-platform-layout-entity.mjs +280 -182
  18. package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
  19. package/fesm2022/acorex-platform-layout-filters.mjs +47 -0
  20. package/fesm2022/acorex-platform-layout-filters.mjs.map +1 -0
  21. package/fesm2022/acorex-platform-layout-setting.mjs +174 -69
  22. package/fesm2022/acorex-platform-layout-setting.mjs.map +1 -1
  23. package/fesm2022/acorex-platform-layouts.mjs +1 -1
  24. package/fesm2022/acorex-platform-layouts.mjs.map +1 -1
  25. package/fesm2022/{acorex-platform-themes-default-entity-master-create-view.component-B13KvLX4.mjs → acorex-platform-themes-default-entity-master-create-view.component-CSyR4pYp.mjs} +5 -5
  26. package/fesm2022/{acorex-platform-themes-default-entity-master-create-view.component-B13KvLX4.mjs.map → acorex-platform-themes-default-entity-master-create-view.component-CSyR4pYp.mjs.map} +1 -1
  27. package/fesm2022/{acorex-platform-themes-default-entity-master-list-view.component-B6MXHPWi.mjs → acorex-platform-themes-default-entity-master-list-view.component-xHWp2Lk-.mjs} +81 -18
  28. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-xHWp2Lk-.mjs.map +1 -0
  29. package/fesm2022/{acorex-platform-themes-default-entity-master-modify-view.component-tKCGSRQT.mjs → acorex-platform-themes-default-entity-master-modify-view.component-n7mYNduJ.mjs} +6 -6
  30. package/fesm2022/{acorex-platform-themes-default-entity-master-modify-view.component-tKCGSRQT.mjs.map → acorex-platform-themes-default-entity-master-modify-view.component-n7mYNduJ.mjs.map} +1 -1
  31. package/fesm2022/{acorex-platform-themes-default-entity-master-single-view.component-CHvC0IAV.mjs → acorex-platform-themes-default-entity-master-single-view.component-DjyYU0Gy.mjs} +14 -14
  32. package/fesm2022/{acorex-platform-themes-default-entity-master-single-view.component-CHvC0IAV.mjs.map → acorex-platform-themes-default-entity-master-single-view.component-DjyYU0Gy.mjs.map} +1 -1
  33. package/fesm2022/acorex-platform-themes-default-setting-page.component-6Dd8MGqr.mjs +78 -0
  34. package/fesm2022/acorex-platform-themes-default-setting-page.component-6Dd8MGqr.mjs.map +1 -0
  35. package/fesm2022/acorex-platform-themes-default-setting-view.component-BgiMClew.mjs +58 -0
  36. package/fesm2022/acorex-platform-themes-default-setting-view.component-BgiMClew.mjs.map +1 -0
  37. package/fesm2022/acorex-platform-themes-default.mjs +38 -112
  38. package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
  39. package/fesm2022/acorex-platform-themes-shared.mjs +187 -86
  40. package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
  41. package/fesm2022/{acorex-platform-widgets-checkbox-widget-designer.component-juhKoygA.mjs → acorex-platform-widgets-checkbox-widget-designer.component-B_Gec5Qf.mjs} +3 -3
  42. package/fesm2022/acorex-platform-widgets-checkbox-widget-designer.component-B_Gec5Qf.mjs.map +1 -0
  43. package/fesm2022/acorex-platform-widgets.mjs +213 -78
  44. package/fesm2022/acorex-platform-widgets.mjs.map +1 -1
  45. package/layout/builder/lib/builder/widget-renderer.component.directive.d.ts +3 -4
  46. package/layout/builder/lib/builder/widget.types.d.ts +11 -5
  47. package/layout/entity/lib/entity-master-list.viewmodel.d.ts +2 -1
  48. package/layout/entity/lib/workflows/modify-entity.workflow.d.ts +14 -0
  49. package/layout/filters/README.md +3 -0
  50. package/layout/filters/index.d.ts +1 -0
  51. package/layout/filters/lib/filters.viewmodel.d.ts +20 -0
  52. package/layout/setting/lib/setting.viewmodel.d.ts +23 -21
  53. package/package.json +16 -12
  54. package/themes/default/index.d.ts +0 -1
  55. package/themes/default/lib/layouts/base/simple-page/simple-page.layout.d.ts +5 -5
  56. package/themes/default/lib/layouts/entity-layouts/entity-master-list-view/list-view-option-filters/list-view-option-filters.component.d.ts +11 -0
  57. package/themes/default/lib/layouts/filters-layout/simple-filter-builder/filters-view.component.d.ts +12 -0
  58. package/themes/default/lib/layouts/setting-layout/setting-page/setting-page.component.d.ts +47 -2
  59. package/themes/default/lib/layouts/setting-layout/setting-view/setting-view.component.d.ts +43 -0
  60. package/themes/shared/lib/components/layout-elements/index.d.ts +5 -3
  61. package/themes/shared/lib/components/layout-elements/{layout-page-actions.component.d.ts → layout-actions.component.d.ts} +5 -5
  62. package/themes/shared/lib/components/layout-elements/layout-blocks.component.d.ts +1 -1
  63. package/themes/shared/lib/components/layout-elements/layout-header.component.d.ts +12 -0
  64. package/themes/shared/lib/components/layout-elements/layout-list-component.d.ts +13 -0
  65. package/themes/shared/lib/components/layout-elements/layout-section.component.d.ts +9 -0
  66. package/themes/shared/lib/components/layout-elements/layout-side.component.d.ts +9 -0
  67. package/themes/shared/lib/shared.module.d.ts +3 -1
  68. package/widgets/lib/properties/editors.props.d.ts +2 -0
  69. package/widgets/lib/widgets/editors/select/select-box-widget-edit.component.d.ts +1 -0
  70. package/widgets/lib/widgets/property-editors/border/border-widget-editor.component.d.ts +1 -0
  71. package/widgets/lib/widgets/property-editors/border/index.d.ts +1 -0
  72. package/widgets/lib/widgets/property-editors/spacing/spacing-widget-editor.component.d.ts +14 -3
  73. package/widgets/lib/widgets/property-editors/spacing/spacing-widget-type.d.ts +6 -0
  74. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-B6MXHPWi.mjs.map +0 -1
  75. package/fesm2022/acorex-platform-widgets-checkbox-widget-designer.component-juhKoygA.mjs.map +0 -1
  76. package/themes/default/lib/layouts/setting-layout/index.d.ts +0 -1
  77. package/themes/shared/lib/components/layout-elements/layout-page-header.component.d.ts +0 -11
  78. package/themes/shared/lib/components/layout-elements/layout-page-side.component.d.ts +0 -5
@@ -0,0 +1,47 @@
1
+ import { AXPFiltersProviderService } from '@acorex/platform/common';
2
+ import { moveItemInArray } from '@angular/cdk/drag-drop';
3
+ import * as i0 from '@angular/core';
4
+ import { inject, signal, computed, Injectable } from '@angular/core';
5
+
6
+ class AXPFiltersViewModel {
7
+ constructor() {
8
+ this.filterProviderService = inject(AXPFiltersProviderService);
9
+ this.availableFilters = signal([]);
10
+ this.activeFilters = signal([]);
11
+ this.newFilters = signal([]);
12
+ this.activeFiltersCount = computed(() => this.activeFilters().length);
13
+ }
14
+ onChoosingFiltersChange(e) {
15
+ if (e.isUserInteraction) {
16
+ this.newFilters.set(e.component.selectedItems);
17
+ }
18
+ }
19
+ onChoosingFiltersConfirm() {
20
+ this.activeFilters.set(this.newFilters());
21
+ }
22
+ setFilters(filters) {
23
+ this.availableFilters.set(filters);
24
+ }
25
+ drop(event) {
26
+ moveItemInArray(this.availableFilters(), event.previousIndex, event.currentIndex);
27
+ }
28
+ resetFilterFields() {
29
+ this.newFilters.set(this.activeFilters());
30
+ }
31
+ removeCondition(selectedFilter) {
32
+ this.activeFilters.update((prev) => prev.filter((filter) => filter.field !== selectedFilter.field));
33
+ }
34
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPFiltersViewModel, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
35
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPFiltersViewModel, providedIn: 'root' }); }
36
+ }
37
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPFiltersViewModel, decorators: [{
38
+ type: Injectable,
39
+ args: [{ providedIn: 'root' }]
40
+ }] });
41
+
42
+ /**
43
+ * Generated bundle index. Do not edit.
44
+ */
45
+
46
+ export { AXPFiltersViewModel };
47
+ //# sourceMappingURL=acorex-platform-layout-filters.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-layout-filters.mjs","sources":["../../../../libs/platform/layout/filters/src/lib/filters.viewmodel.ts","../../../../libs/platform/layout/filters/src/acorex-platform-layout-filters.ts"],"sourcesContent":["import { AXValueChangedEvent } from '@acorex/components/common';\nimport { AXPFilterDefinition, AXPFiltersProviderService } from '@acorex/platform/common';\nimport { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop';\nimport { computed, inject, Injectable, signal, WritableSignal } from '@angular/core';\n\n@Injectable({ providedIn: 'root' })\nexport class AXPFiltersViewModel {\n private readonly filterProviderService = inject(AXPFiltersProviderService);\n\n readonly availableFilters: WritableSignal<AXPFilterDefinition[]> = signal([]);\n readonly activeFilters: WritableSignal<AXPFilterDefinition[]> = signal([]);\n readonly newFilters: WritableSignal<AXPFilterDefinition[]> = signal([]);\n\n readonly activeFiltersCount = computed(() => this.activeFilters().length);\n\n onChoosingFiltersChange(e: AXValueChangedEvent<any>) {\n if (e.isUserInteraction) {\n this.newFilters.set(e.component.selectedItems);\n }\n }\n\n onChoosingFiltersConfirm() {\n this.activeFilters.set(this.newFilters());\n }\n\n setFilters(filters: AXPFilterDefinition[]) {\n this.availableFilters.set(filters);\n }\n\n drop(event: CdkDragDrop<unknown[]>) {\n moveItemInArray(this.availableFilters(), event.previousIndex, event.currentIndex);\n }\n\n resetFilterFields() {\n this.newFilters.set(this.activeFilters());\n }\n\n removeCondition(selectedFilter: AXPFilterDefinition) {\n this.activeFilters.update((prev) => prev.filter((filter) => filter.field !== selectedFilter.field));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAMa,mBAAmB,CAAA;AADhC,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,qBAAqB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AAEjE,QAAA,IAAA,CAAA,gBAAgB,GAA0C,MAAM,CAAC,EAAE,CAAC;AACpE,QAAA,IAAA,CAAA,aAAa,GAA0C,MAAM,CAAC,EAAE,CAAC;AACjE,QAAA,IAAA,CAAA,UAAU,GAA0C,MAAM,CAAC,EAAE,CAAC;AAE9D,QAAA,IAAA,CAAA,kBAAkB,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC,MAAM,CAAC;AA2B1E;AAzBC,IAAA,uBAAuB,CAAC,CAA2B,EAAA;AACjD,QAAA,IAAI,CAAC,CAAC,iBAAiB,EAAE;YACvB,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,aAAa,CAAC;;;IAIlD,wBAAwB,GAAA;QACtB,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;;AAG3C,IAAA,UAAU,CAAC,OAA8B,EAAA;AACvC,QAAA,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,OAAO,CAAC;;AAGpC,IAAA,IAAI,CAAC,KAA6B,EAAA;AAChC,QAAA,eAAe,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,KAAK,CAAC,aAAa,EAAE,KAAK,CAAC,YAAY,CAAC;;IAGnF,iBAAiB,GAAA;QACf,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;;AAG3C,IAAA,eAAe,CAAC,cAAmC,EAAA;AACjD,QAAA,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,KAAK,KAAK,cAAc,CAAC,KAAK,CAAC,CAAC;;8GAhC1F,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAnB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,cADN,MAAM,EAAA,CAAA,CAAA;;2FACnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAD/B,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACLlC;;AAEG;;;;"}
@@ -1,12 +1,12 @@
1
1
  import { AXToastService } from '@acorex/components/toast';
2
- import { AXPlatform } from '@acorex/core/platform';
3
2
  import { AXPSettingDefinitionProviderService, AXPSettingValueProviderService } from '@acorex/platform/common';
4
3
  import { AXHighlightService } from '@acorex/platform/core';
5
4
  import * as i0 from '@angular/core';
6
5
  import { inject, signal, computed, effect, Injectable } from '@angular/core';
7
- import { Router, NavigationEnd } from '@angular/router';
6
+ import { Router, ActivatedRoute, NavigationEnd } from '@angular/router';
8
7
  import { filter, take } from 'rxjs';
9
- import { isEmpty, isEqual } from 'lodash-es';
8
+ import { isNil, isEmpty, get, isEqual } from 'lodash-es';
9
+ import { AXPLayoutThemeService } from '@acorex/platform/themes/shared';
10
10
 
11
11
  /**
12
12
  * Converts a list of AXPSettingDefinitionGroup into a tree structure of AXTreeViewSchema.
@@ -114,6 +114,16 @@ function searchSettings(groups, search) {
114
114
  }
115
115
 
116
116
  class AXPSettingsViewModel {
117
+ resolveScope(scopeName) {
118
+ const scopeMap = {
119
+ environment: 'C',
120
+ global: 'G',
121
+ tenant: 'T',
122
+ user: 'U',
123
+ };
124
+ const normalizedScopeName = scopeName.trim().toLowerCase();
125
+ return scopeMap[normalizedScopeName] ?? 'U';
126
+ }
117
127
  #effect2;
118
128
  /**
119
129
  * @ignore
@@ -122,19 +132,24 @@ class AXPSettingsViewModel {
122
132
  this.router = inject(Router);
123
133
  this.settingDefinitionService = inject(AXPSettingDefinitionProviderService);
124
134
  this.settingValueService = inject(AXPSettingValueProviderService);
125
- this.platform = inject(AXPlatform);
126
135
  this.toastService = inject(AXToastService);
127
136
  this.highlightService = inject(AXHighlightService);
128
- this.isMobile = signal(this.platform.is('MD'));
129
- this.fullRoute = this.router.url.split('/settings')[0] + '/settings/';
130
- this.search = signal('');
131
- this.searchResult = signal(undefined);
132
- this.activatedGroup = signal(undefined);
137
+ this.layoutService = inject(AXPLayoutThemeService);
138
+ this.activatedRoute = inject(ActivatedRoute);
139
+ this.searchExpression = signal('');
140
+ this.isValidQuery = (expression) => !isNil(expression) && !isEmpty(expression);
141
+ this.isSearching = computed(() => this.isValidQuery(this.searchExpression()));
142
+ this.searchResult = signal([]);
143
+ this.isSaving = signal(false);
144
+ this.inlineSave = computed(() => {
145
+ return this.layoutService.isSmall();
146
+ });
147
+ this.activateGroup = signal(undefined);
148
+ this.activeScope = signal('U');
133
149
  this.loadedItems = signal(null);
134
- this.formattedData = signal([]);
135
150
  this.groups = computed(() => {
136
- if (this.activatedGroup()) {
137
- return this.settingDefinitionService.findGroup(this.activatedGroup());
151
+ if (this.activateGroup()) {
152
+ return this.settingDefinitionService.findGroup(this.activeScope(), this.activateGroup());
138
153
  }
139
154
  else {
140
155
  return null;
@@ -142,86 +157,150 @@ class AXPSettingsViewModel {
142
157
  ;
143
158
  });
144
159
  this.#effect2 = effect(() => {
145
- if (this.search()) {
146
- this.searchResult.set(searchSettings(this.loadedItems(), this.search()));
160
+ if (this.searchExpression()) {
161
+ this.searchResult.set(searchSettings(this.loadedItems(), this.searchExpression()));
147
162
  }
148
- setTimeout(() => {
149
- this.highlightService.highlight('#ax-settings', this.search());
150
- });
151
163
  });
152
164
  this.context = signal({});
153
165
  this.previousContext = signal({});
154
- this.isSaving = signal(false);
155
- this.canCancel = computed(() => isEmpty(this.context()));
156
- this.canSave = computed(() => !this.isSaving() &&
157
- !isEmpty(this.context()) &&
158
- !isEqual(this.context(), this.previousContext()));
159
- this.settingValueService.onChanged.subscribe(async () => {
160
- const currentContext = await this.settingValueService.all();
161
- this.context.update((ctx) => ({ ...ctx, ...currentContext }));
166
+ this.settingValueService.onChanged.subscribe((e) => {
167
+ e.keys.forEach(k => {
168
+ const currentValue = e.values[k];
169
+ const contextValue = get(this.context(), k);
170
+ const previousValue = get(this.previousContext(), k);
171
+ // Update only if there are actual changes
172
+ if (!isEqual(previousValue, currentValue) || !isEqual(currentValue, contextValue)) {
173
+ this.previousContext.update(prev => ({
174
+ ...prev,
175
+ [k]: currentValue, // Use backend-provided value
176
+ }));
177
+ this.context.update(ctx => ({
178
+ ...ctx,
179
+ [k]: currentValue,
180
+ }));
181
+ }
182
+ });
162
183
  });
163
- }
164
- async initializeService(activatedRoute) {
165
- // Initial setup
166
- await this.load();
167
- this.activatedRoute = activatedRoute;
184
+ this.load();
168
185
  //
169
- this.router.events.pipe(filter((event) => event instanceof NavigationEnd)).subscribe(() => {
170
- this.updateGroupParam();
186
+ this.router.events.pipe(filter((event) => event instanceof NavigationEnd)).subscribe(async () => {
187
+ await this.updateGroupParam();
171
188
  });
172
- //
173
- this.updateGroupParam();
174
189
  }
175
- // Fetch settings data
176
190
  async load() {
177
- const items = await this.settingDefinitionService.items();
191
+ //
192
+ this.activeScope.set(this.resolveScope(this.activatedRoute.snapshot.paramMap?.get('scope')));
193
+ //
194
+ const items = await this.settingDefinitionService.getListAsync(this.activeScope());
178
195
  this.loadedItems.set(items);
179
- const formattedData = convertToTreeViewSchema(this.loadedItems());
180
- this.formattedData.set(formattedData);
181
196
  const currentContext = await this.settingValueService.all();
182
197
  const defaults = this.settingDefinitionService.defaultValues();
183
198
  this.context.set({ ...defaults, ...currentContext });
184
199
  this.previousContext.set(this.context());
200
+ //
201
+ await this.updateGroupParam();
202
+ if (!this.activateGroup() && this.layoutService.isLarge() && !this.isSearching()) {
203
+ await this.redirectToFirstGroup();
204
+ }
185
205
  }
186
- // Update group param logic
187
- updateGroupParam() {
188
- // If no child routes exist, set groupParam to null
206
+ async updateGroupParam() {
207
+ const query = this.activatedRoute.snapshot.queryParams["q"];
208
+ const scope = this.resolveScope(this.activatedRoute.snapshot.paramMap.get("scope"));
209
+ const group = this.activatedRoute.snapshot.paramMap.get("group");
210
+ if ((this.activeScope() && this.activeScope() != scope) || (this.activateGroup() != group)) {
211
+ this.activateGroup.set(undefined);
212
+ await this.load();
213
+ return;
214
+ }
215
+ if (this.isValidQuery(query)) {
216
+ this.searchExpression.set(query);
217
+ }
218
+ if (this.isSearching()) {
219
+ setTimeout(() => {
220
+ this.highlightService.highlight('#ax-settings', this.searchExpression());
221
+ }, 100);
222
+ }
223
+ // If no child routes exist, set activateGroup to undefined
189
224
  if (this.activatedRoute.children.length === 0) {
190
- this.activatedGroup.set(undefined);
225
+ this.activateGroup.set(undefined);
191
226
  return;
192
227
  }
193
228
  // Traverse child routes to check for the group parameter
194
- this.activatedRoute.children.forEach((childRoute) => {
195
- childRoute.paramMap.pipe(take(1)).subscribe(async (params) => {
196
- const group = params.get('group');
197
- this.activatedGroup.update(() => group || undefined);
198
- if (group) {
199
- this.formattedData.set(setActiveByValueField(this.formattedData(), group));
200
- }
201
- });
202
- });
229
+ for (const childRoute of this.activatedRoute.children) {
230
+ const params = await childRoute.paramMap.pipe(take(1)).toPromise();
231
+ const group = params?.get('group');
232
+ if (group) {
233
+ this.activateGroup.set(group);
234
+ }
235
+ }
236
+ }
237
+ async redirectToFirstGroup() {
238
+ const firstGroup = this.determineFirstGroup();
239
+ if (firstGroup) {
240
+ const app = this.activatedRoute.snapshot.params['app'];
241
+ const scope = this.activatedRoute.snapshot.params['scope'];
242
+ await this.router.navigate([app, 'settings', scope, firstGroup], { replaceUrl: true });
243
+ //this.activateGroup.set(firstGroup);
244
+ }
245
+ }
246
+ async navigateUpLevel() {
247
+ const app = this.activatedRoute.snapshot.params['app'];
248
+ const scope = this.activatedRoute.snapshot.params['scope'];
249
+ await this.router.navigate([app, 'settings', scope]);
250
+ }
251
+ determineFirstGroup() {
252
+ const groups = this.loadedItems();
253
+ return groups && groups.length > 0 ? groups[0].name : null;
203
254
  }
204
255
  handleSelectGroup(item) {
205
- const value = item.data?.['id'];
206
- this.router.navigate([`${value}`], { relativeTo: this.activatedRoute });
207
- this.search.set('');
256
+ this.router.navigate([`${item.name}`], { relativeTo: this.activatedRoute });
257
+ this.searchExpression.set('');
208
258
  }
209
- handleContextChanged(e) {
259
+ async handleContextChanged(e) {
210
260
  if (e.init) {
211
261
  this.previousContext.set(e.data);
212
262
  }
213
263
  else {
214
- this.context.set(e.data);
264
+ if (this.inlineSave()) {
265
+ await this.settingValueService.set(e.path, e.newValue);
266
+ }
267
+ else {
268
+ this.context.set(e.data);
269
+ }
270
+ }
271
+ }
272
+ isDirty(section) {
273
+ if (section) {
274
+ // Check for changes in the specific section
275
+ return section.settings.some(c => !isEqual(get(this.context(), c.name), get(this.previousContext(), c.name)));
276
+ }
277
+ else {
278
+ // Check for changes globally based on loadedItems keys
279
+ return this.loadedItems()?.some(group => group.sections.some(sec => sec.settings.some(setting => {
280
+ const currentValue = get(this.context(), setting.name);
281
+ const previousValue = get(this.previousContext(), setting.name);
282
+ return !isEqual(currentValue, previousValue);
283
+ }))) || false;
215
284
  }
216
285
  }
217
286
  // Save settings logic
218
- async apply() {
287
+ async apply(section) {
219
288
  try {
220
- // Update the previous context and set the saving state
221
- this.previousContext.set(this.context());
222
289
  this.isSaving.set(true);
223
- // Save the settings
224
- await this.settingValueService.set(this.context());
290
+ if (section) {
291
+ // Apply changes for the specific section
292
+ const changes = {};
293
+ section.settings.forEach(c => {
294
+ changes[c.name] = get(this.context(), c.name);
295
+ });
296
+ if (!isEmpty(changes)) {
297
+ await this.settingValueService.set(changes);
298
+ }
299
+ }
300
+ else {
301
+ // Save the settings
302
+ await this.settingValueService.set(this.context());
303
+ }
225
304
  // Show success notification
226
305
  this.toastService.show({
227
306
  color: 'success',
@@ -247,25 +326,51 @@ class AXPSettingsViewModel {
247
326
  });
248
327
  }
249
328
  finally {
250
- // Reset the saving state
251
329
  this.isSaving.set(false);
252
330
  }
253
331
  }
254
- // Cancel settings logic
255
- reset() {
256
- this.context.set(this.previousContext());
332
+ // discard settings logic
333
+ async discard(section) {
334
+ if (section) {
335
+ // Discard changes for the specific section
336
+ section.settings.forEach(c => {
337
+ const previousValue = get(this.previousContext(), c.name);
338
+ this.context.update(ctx => ({
339
+ ...ctx,
340
+ [c.name]: previousValue
341
+ }));
342
+ });
343
+ }
344
+ else {
345
+ // Discard changes for all sections
346
+ this.context.set(this.previousContext());
347
+ }
257
348
  }
258
349
  // Cancel settings logic
259
- resetToDefault() {
350
+ async resetToDefault() {
260
351
  const defaults = this.settingDefinitionService.defaultValues();
352
+ // Update the context with the defaults
261
353
  this.context.set(defaults);
354
+ //
355
+ await this.apply();
356
+ }
357
+ async search(expression) {
358
+ this.searchExpression.set(expression);
359
+ const app = this.activatedRoute.snapshot.params['app'];
360
+ const scope = this.activatedRoute.snapshot.params['scope'];
361
+ //
362
+ if (this.isValidQuery(expression)) {
363
+ await this.router.navigate([app, 'settings', scope, this.activateGroup() ?? ''], { queryParams: { q: expression } });
364
+ }
365
+ else {
366
+ await this.router.navigate([app, 'settings', scope, this.activateGroup() ?? '']);
367
+ }
262
368
  }
263
369
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPSettingsViewModel, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
264
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPSettingsViewModel, providedIn: 'root' }); }
370
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPSettingsViewModel }); }
265
371
  }
266
372
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPSettingsViewModel, decorators: [{
267
- type: Injectable,
268
- args: [{ providedIn: 'root' }]
373
+ type: Injectable
269
374
  }], ctorParameters: () => [] });
270
375
 
271
376
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-layout-setting.mjs","sources":["../../../../libs/platform/layout/setting/src/lib/convert-setting-data.ts","../../../../libs/platform/layout/setting/src/lib/setting.viewmodel.ts","../../../../libs/platform/layout/setting/src/acorex-platform-layout-setting.ts"],"sourcesContent":["import { AXTreeViewSchema } from '@acorex/components/tree-view/lib/tree-view.class';\nimport { AXPSettingDefinitionGroup, AXPSettingDefinitionSection } from '@acorex/platform/common';\n\n/**\n * Converts a list of AXPSettingDefinitionGroup into a tree structure of AXTreeViewSchema.\n * This function processes groups and their nested sub-groups, recursively creating a tree.\n *\n * @param groups - Array of top-level setting groups to be converted into tree view schema.\n * @param parentId - The parent ID for nested groups, passed down recursively. (Optional, default is undefined)\n *\n * @returns An array of AXTreeViewSchema representing the hierarchical structure of groups.\n */\nexport function convertToTreeViewSchema(\n groups: AXPSettingDefinitionGroup[],\n parentId?: string | number\n): AXTreeViewSchema[] {\n // Helper function to traverse and convert a single group (and its sub-groups)\n const traverseGroups = (group: AXPSettingDefinitionGroup, parent?: string | number): AXTreeViewSchema => {\n const currentId = group.name;\n\n // Schema for the current group\n const schema: AXTreeViewSchema = {\n id: currentId, // Unique identifier for the group (using group name)\n parentId: parent, // Parent group ID, passed down recursively\n text: group.title, // Display title of the group\n //tooltip: group.description, // Optional description as tooltip\n hasChild: group.groups.length > 0, // Whether the group has child groups\n isExpanded: false, // Default state for expansion (optional)\n icon: group.icon,\n childrens: group.groups.length > 0 ? [] : undefined, // Child groups array (undefined if no children)\n };\n\n // Recursively process nested groups (sub-groups inside the current group)\n group.groups.forEach((subGroup) => {\n const childSchema = traverseGroups(subGroup, currentId); // Create schema for sub-group\n schema.childrens?.push(childSchema); // Add the child schema to the parent group's children\n });\n\n return schema; // Return the group schema with its children (if any)\n };\n\n // Initialize an array to hold the top-level groups' schemas\n const treeViewSchemas: AXTreeViewSchema[] = [];\n\n // Process each top-level group and convert it into tree view schema\n groups.forEach((group) => {\n treeViewSchemas.push(traverseGroups(group, parentId)); // Add the schema for each group\n });\n\n // Return the resulting hierarchical structure\n return treeViewSchemas;\n}\n\n/**\n * Recursively searches for a specific `id` in a tree structure and updates its `active` property to `true`.\n * Additionally, ensures all other nodes have their `active` property set to `false`.\n *\n * @param tree - The tree structure to search, represented as an array of AXTreeViewSchema nodes.\n * @param targetId - The `id` of the node to activate.\n * @returns The updated tree structure with the target node activated and others deactivated.\n */\nexport function setActiveByValueField(tree: AXTreeViewSchema[], targetId: string | number): AXTreeViewSchema[] {\n return tree.map((node) => {\n // Set active property for the target node\n node.active = node.id === targetId;\n\n // Recursively process children if they exist\n if (node.childrens && node.childrens.length > 0) {\n node.childrens = setActiveByValueField(node.childrens, targetId);\n }\n\n return node;\n });\n}\nexport function searchSettings(groups: AXPSettingDefinitionGroup[], search: string): AXPSettingDefinitionGroup[] {\n const sectionMatchResult: AXPSettingDefinitionGroup[] = [];\n const settingMatchResult: AXPSettingDefinitionGroup[] = [];\n const processedGroups = new Set<string>();\n\n const createGroupIdentifier = (group: AXPSettingDefinitionGroup): string => `${group.name}-${group.title}`;\n\n const addGroupToResult = (\n group: AXPSettingDefinitionGroup,\n sections: AXPSettingDefinitionSection[],\n resultArray: AXPSettingDefinitionGroup[]\n ) => {\n const groupId = createGroupIdentifier(group);\n if (!processedGroups.has(groupId)) {\n resultArray.push({\n ...group,\n sections,\n groups: [], // Exclude nested groups\n });\n processedGroups.add(groupId);\n }\n };\n\n const processSections = (\n group: AXPSettingDefinitionGroup,\n filterFn: (section: AXPSettingDefinitionSection) => boolean\n ) => {\n const matchedSections = group.sections.filter(filterFn);\n if (matchedSections.length > 0) {\n addGroupToResult(group, matchedSections, sectionMatchResult);\n }\n };\n\n const processSettings = (\n group: AXPSettingDefinitionGroup,\n filterFn: (section: AXPSettingDefinitionSection) => AXPSettingDefinitionSection | null\n ) => {\n const matchedSections = group.sections\n .map(filterFn)\n .filter((section): section is AXPSettingDefinitionSection => section !== null);\n if (matchedSections.length > 0) {\n addGroupToResult(group, matchedSections, settingMatchResult);\n }\n };\n\n const sectionMatches = (section: AXPSettingDefinitionSection): boolean =>\n section.name.toLowerCase().includes(search.toLowerCase()) ||\n section.title.toLowerCase().includes(search.toLowerCase());\n\n const filterSettings = (section: AXPSettingDefinitionSection): AXPSettingDefinitionSection | null => {\n const matchedSettings = section.settings.filter(\n (setting) =>\n setting.name.toLowerCase().includes(search.toLowerCase()) ||\n setting.title.toLowerCase().includes(search.toLowerCase())\n );\n return matchedSettings.length > 0 ? { ...section, settings: matchedSettings } : null;\n };\n\n const processGroupRecursively = (group: AXPSettingDefinitionGroup) => {\n processSections(group, sectionMatches); // Match sections with all settings\n processSettings(group, filterSettings); // Match settings within sections\n group.groups.forEach(processGroupRecursively); // Recurse into nested groups\n };\n\n groups.forEach(processGroupRecursively);\n\n return [...sectionMatchResult, ...settingMatchResult];\n}\n","import { AXToastService } from '@acorex/components/toast';\nimport { AXTreeItemClickBaseEvent, AXTreeViewSchema } from '@acorex/components/tree-view/lib/tree-view.class';\nimport { AXPlatform } from '@acorex/core/platform';\nimport {\n AXPGroupSearchResult,\n AXPSettingDefinitionGroup,\n AXPSettingDefinitionProviderService,\n AXPSettingValueProviderService,\n} from '@acorex/platform/common';\nimport { AXHighlightService } from '@acorex/platform/core';\nimport { computed, effect, inject, Injectable, signal } from '@angular/core';\nimport { ActivatedRoute, NavigationEnd, Router } from '@angular/router';\nimport { filter, take } from 'rxjs';\nimport { convertToTreeViewSchema, searchSettings, setActiveByValueField } from './convert-setting-data';\nimport { isEmpty, isEqual } from 'lodash-es';\nimport { AXPLayoutContextEvent } from '@acorex/platform/layout/builder';\n\n\n\n@Injectable({ providedIn: 'root' })\nexport class AXPSettingsViewModel {\n\n private readonly router = inject(Router);\n private readonly settingDefinitionService = inject(AXPSettingDefinitionProviderService);\n private readonly settingValueService = inject(AXPSettingValueProviderService);\n private readonly platform = inject(AXPlatform);\n private readonly toastService = inject(AXToastService);\n private readonly highlightService = inject(AXHighlightService);\n\n private activatedRoute: ActivatedRoute;\n\n isMobile = signal(this.platform.is('MD'));\n fullRoute = this.router.url.split('/settings')[0] + '/settings/';\n\n search = signal('');\n searchResult = signal<AXPSettingDefinitionGroup[] | undefined>(undefined);\n\n\n public activatedGroup = signal<string | undefined>(undefined);\n\n private loadedItems = signal<AXPSettingDefinitionGroup[] | null>(null);\n\n formattedData = signal<AXTreeViewSchema[]>([]);\n\n\n groups = computed<AXPGroupSearchResult | null>(() => {\n if (this.activatedGroup()) {\n return this.settingDefinitionService.findGroup(this.activatedGroup()!);\n } else {\n return null\n };\n });\n\n #effect2 = effect(\n () => {\n if (this.search()) {\n this.searchResult.set(searchSettings(this.loadedItems()!, this.search()));\n }\n setTimeout(() => {\n this.highlightService.highlight('#ax-settings', this.search());\n });\n }\n );\n\n\n /**\n * @ignore\n */\n constructor() {\n this.settingValueService.onChanged.subscribe(async () => {\n const currentContext = await this.settingValueService.all();\n this.context.update((ctx) => ({ ...ctx, ...currentContext }));\n });\n }\n\n async initializeService(activatedRoute: ActivatedRoute) {\n // Initial setup\n await this.load();\n\n this.activatedRoute = activatedRoute;\n //\n this.router.events.pipe(\n filter((event) => event instanceof NavigationEnd)\n ).subscribe(() => {\n this.updateGroupParam();\n });\n //\n this.updateGroupParam();\n }\n\n // Fetch settings data\n private async load(): Promise<void> {\n const items = await this.settingDefinitionService.items();\n this.loadedItems.set(items);\n const formattedData = convertToTreeViewSchema(this.loadedItems()!);\n this.formattedData.set(formattedData);\n const currentContext = await this.settingValueService.all();\n const defaults = this.settingDefinitionService.defaultValues();\n this.context.set({ ...defaults, ...currentContext });\n this.previousContext.set(this.context());\n }\n\n\n // Update group param logic\n private updateGroupParam(): void {\n // If no child routes exist, set groupParam to null\n if (this.activatedRoute.children.length === 0) {\n this.activatedGroup.set(undefined);\n return;\n }\n // Traverse child routes to check for the group parameter\n this.activatedRoute.children.forEach((childRoute) => {\n childRoute.paramMap.pipe(take(1)).subscribe(async (params) => {\n const group = params.get('group');\n this.activatedGroup.update(() => group || undefined);\n if (group) {\n this.formattedData.set(setActiveByValueField(this.formattedData(), group));\n }\n });\n });\n }\n\n public handleSelectGroup(item: AXTreeItemClickBaseEvent) {\n const value = item.data?.['id'];\n this.router.navigate([`${value}`], { relativeTo: this.activatedRoute });\n this.search.set('');\n }\n\n context = signal<Record<any, any>>({});\n private previousContext = signal<Record<any, any>>({});\n\n handleContextChanged(e: AXPLayoutContextEvent) {\n if (e.init) {\n this.previousContext.set(e.data);\n }\n else {\n this.context.set(e.data);\n }\n }\n\n isSaving = signal(false);\n\n canCancel = computed(() => isEmpty(this.context()));\n canSave = computed(\n () =>\n !this.isSaving() &&\n !isEmpty(this.context()) &&\n !isEqual(this.context(), this.previousContext())\n );\n\n // Save settings logic\n public async apply(): Promise<void> {\n try {\n // Update the previous context and set the saving state\n this.previousContext.set(this.context());\n this.isSaving.set(true);\n\n // Save the settings\n await this.settingValueService.set(this.context());\n\n // Show success notification\n this.toastService.show({\n color: 'success',\n title: 'Settings Saved',\n content: 'Your changes have been saved successfully.',\n location: 'bottom-center',\n closeButton: true,\n timeOut: 3000,\n timeOutProgress: true,\n });\n } catch (error: any) {\n // Handle and show errors\n console.error('Error saving settings:', error);\n this.toastService.show({\n color: 'danger',\n title: 'Save Failed',\n content: error?.['message'] || 'An error occurred while saving your settings. Please try again.',\n location: 'bottom-center',\n closeButton: true,\n timeOut: 5000,\n timeOutProgress: true,\n });\n } finally {\n // Reset the saving state\n this.isSaving.set(false);\n }\n }\n\n\n // Cancel settings logic\n public reset(): void {\n this.context.set(this.previousContext());\n }\n\n // Cancel settings logic\n public resetToDefault(): void {\n const defaults = this.settingDefinitionService.defaultValues();\n this.context.set(defaults);\n }\n\n\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAGA;;;;;;;;AAQG;AACa,SAAA,uBAAuB,CACrC,MAAmC,EACnC,QAA0B,EAAA;;AAG1B,IAAA,MAAM,cAAc,GAAG,CAAC,KAAgC,EAAE,MAAwB,KAAsB;AACtG,QAAA,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI;;AAG5B,QAAA,MAAM,MAAM,GAAqB;YAC/B,EAAE,EAAE,SAAS;YACb,QAAQ,EAAE,MAAM;AAChB,YAAA,IAAI,EAAE,KAAK,CAAC,KAAK;;YAEjB,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;YACjC,UAAU,EAAE,KAAK;YACjB,IAAI,EAAE,KAAK,CAAC,IAAI;AAChB,YAAA,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,GAAG,EAAE,GAAG,SAAS;SACpD;;QAGD,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,QAAQ,KAAI;YAChC,MAAM,WAAW,GAAG,cAAc,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;YACxD,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;AACtC,SAAC,CAAC;QAEF,OAAO,MAAM,CAAC;AAChB,KAAC;;IAGD,MAAM,eAAe,GAAuB,EAAE;;AAG9C,IAAA,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,KAAI;AACvB,QAAA,eAAe,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;AACxD,KAAC,CAAC;;AAGF,IAAA,OAAO,eAAe;AACxB;AAEA;;;;;;;AAOG;AACa,SAAA,qBAAqB,CAAC,IAAwB,EAAE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,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,cADP,MAAM,EAAA,CAAA,CAAA;;2FACnB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBADhC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACnBlC;;AAEG;;;;"}
1
+ {"version":3,"file":"acorex-platform-layout-setting.mjs","sources":["../../../../libs/platform/layout/setting/src/lib/convert-setting-data.ts","../../../../libs/platform/layout/setting/src/lib/setting.viewmodel.ts","../../../../libs/platform/layout/setting/src/acorex-platform-layout-setting.ts"],"sourcesContent":["import { AXTreeViewSchema } from '@acorex/components/tree-view/lib/tree-view.class';\nimport { AXPSettingDefinitionGroup, AXPSettingDefinitionSection } from '@acorex/platform/common';\n\n/**\n * Converts a list of AXPSettingDefinitionGroup into a tree structure of AXTreeViewSchema.\n * This function processes groups and their nested sub-groups, recursively creating a tree.\n *\n * @param groups - Array of top-level setting groups to be converted into tree view schema.\n * @param parentId - The parent ID for nested groups, passed down recursively. (Optional, default is undefined)\n *\n * @returns An array of AXTreeViewSchema representing the hierarchical structure of groups.\n */\nexport function convertToTreeViewSchema(\n groups: AXPSettingDefinitionGroup[],\n parentId?: string | number\n): AXTreeViewSchema[] {\n // Helper function to traverse and convert a single group (and its sub-groups)\n const traverseGroups = (group: AXPSettingDefinitionGroup, parent?: string | number): AXTreeViewSchema => {\n const currentId = group.name;\n\n // Schema for the current group\n const schema: AXTreeViewSchema = {\n id: currentId, // Unique identifier for the group (using group name)\n parentId: parent, // Parent group ID, passed down recursively\n text: group.title, // Display title of the group\n //tooltip: group.description, // Optional description as tooltip\n hasChild: group.groups.length > 0, // Whether the group has child groups\n isExpanded: false, // Default state for expansion (optional)\n icon: group.icon,\n childrens: group.groups.length > 0 ? [] : undefined, // Child groups array (undefined if no children)\n };\n\n // Recursively process nested groups (sub-groups inside the current group)\n group.groups.forEach((subGroup) => {\n const childSchema = traverseGroups(subGroup, currentId); // Create schema for sub-group\n schema.childrens?.push(childSchema); // Add the child schema to the parent group's children\n });\n\n return schema; // Return the group schema with its children (if any)\n };\n\n // Initialize an array to hold the top-level groups' schemas\n const treeViewSchemas: AXTreeViewSchema[] = [];\n\n // Process each top-level group and convert it into tree view schema\n groups.forEach((group) => {\n treeViewSchemas.push(traverseGroups(group, parentId)); // Add the schema for each group\n });\n\n // Return the resulting hierarchical structure\n return treeViewSchemas;\n}\n\n/**\n * Recursively searches for a specific `id` in a tree structure and updates its `active` property to `true`.\n * Additionally, ensures all other nodes have their `active` property set to `false`.\n *\n * @param tree - The tree structure to search, represented as an array of AXTreeViewSchema nodes.\n * @param targetId - The `id` of the node to activate.\n * @returns The updated tree structure with the target node activated and others deactivated.\n */\nexport function setActiveByValueField(tree: AXTreeViewSchema[], targetId: string | number): AXTreeViewSchema[] {\n return tree.map((node) => {\n // Set active property for the target node\n node.active = node.id === targetId;\n\n // Recursively process children if they exist\n if (node.childrens && node.childrens.length > 0) {\n node.childrens = setActiveByValueField(node.childrens, targetId);\n }\n\n return node;\n });\n}\nexport function searchSettings(groups: AXPSettingDefinitionGroup[], search: string): AXPSettingDefinitionGroup[] {\n const sectionMatchResult: AXPSettingDefinitionGroup[] = [];\n const settingMatchResult: AXPSettingDefinitionGroup[] = [];\n const processedGroups = new Set<string>();\n\n const createGroupIdentifier = (group: AXPSettingDefinitionGroup): string => `${group.name}-${group.title}`;\n\n const addGroupToResult = (\n group: AXPSettingDefinitionGroup,\n sections: AXPSettingDefinitionSection[],\n resultArray: AXPSettingDefinitionGroup[]\n ) => {\n const groupId = createGroupIdentifier(group);\n if (!processedGroups.has(groupId)) {\n resultArray.push({\n ...group,\n sections,\n groups: [], // Exclude nested groups\n });\n processedGroups.add(groupId);\n }\n };\n\n const processSections = (\n group: AXPSettingDefinitionGroup,\n filterFn: (section: AXPSettingDefinitionSection) => boolean\n ) => {\n const matchedSections = group.sections.filter(filterFn);\n if (matchedSections.length > 0) {\n addGroupToResult(group, matchedSections, sectionMatchResult);\n }\n };\n\n const processSettings = (\n group: AXPSettingDefinitionGroup,\n filterFn: (section: AXPSettingDefinitionSection) => AXPSettingDefinitionSection | null\n ) => {\n const matchedSections = group.sections\n .map(filterFn)\n .filter((section): section is AXPSettingDefinitionSection => section !== null);\n if (matchedSections.length > 0) {\n addGroupToResult(group, matchedSections, settingMatchResult);\n }\n };\n\n const sectionMatches = (section: AXPSettingDefinitionSection): boolean =>\n section.name.toLowerCase().includes(search.toLowerCase()) ||\n section.title.toLowerCase().includes(search.toLowerCase());\n\n const filterSettings = (section: AXPSettingDefinitionSection): AXPSettingDefinitionSection | null => {\n const matchedSettings = section.settings.filter(\n (setting) =>\n setting.name.toLowerCase().includes(search.toLowerCase()) ||\n setting.title.toLowerCase().includes(search.toLowerCase())\n );\n return matchedSettings.length > 0 ? { ...section, settings: matchedSettings } : null;\n };\n\n const processGroupRecursively = (group: AXPSettingDefinitionGroup) => {\n processSections(group, sectionMatches); // Match sections with all settings\n processSettings(group, filterSettings); // Match settings within sections\n group.groups.forEach(processGroupRecursively); // Recurse into nested groups\n };\n\n groups.forEach(processGroupRecursively);\n\n return [...sectionMatchResult, ...settingMatchResult];\n}\n","import { AXToastService } from '@acorex/components/toast';\nimport {\n AXPGroupSearchResult,\n AXPSettingDefinitionGroup,\n AXPSettingDefinitionProviderService,\n AXPSettingDefinitionSection,\n AXPSettingScope,\n AXPSettingValueProviderService,\n} from '@acorex/platform/common';\nimport { AXHighlightService } from '@acorex/platform/core';\nimport { computed, effect, inject, Injectable, signal } from '@angular/core';\nimport { ActivatedRoute, NavigationEnd, Router } from '@angular/router';\nimport { filter, take } from 'rxjs';\nimport { searchSettings } from './convert-setting-data';\nimport { cloneDeep, get, isEmpty, isEqual, isNil, values } from 'lodash-es';\nimport { AXPLayoutContextEvent } from '@acorex/platform/layout/builder';\nimport { AXPLayoutThemeService } from '@acorex/platform/themes/shared';\n\n\n@Injectable()\nexport class AXPSettingsViewModel {\n\n private readonly router = inject(Router);\n private readonly settingDefinitionService = inject(AXPSettingDefinitionProviderService);\n private readonly settingValueService = inject(AXPSettingValueProviderService);\n private readonly toastService = inject(AXToastService);\n private readonly highlightService = inject(AXHighlightService);\n private readonly layoutService = inject(AXPLayoutThemeService);\n private activatedRoute = inject(ActivatedRoute);\n\n\n public searchExpression = signal('');\n private isValidQuery = (expression: string) => !isNil(expression) && !isEmpty(expression);\n public isSearching = computed(() => this.isValidQuery(this.searchExpression()));\n\n public searchResult = signal<AXPSettingDefinitionGroup[]>([]);\n public isSaving = signal(false);\n public inlineSave = computed(() => {\n return this.layoutService.isSmall();\n });\n\n\n public activateGroup = signal<string | undefined>(undefined);\n private activeScope = signal<AXPSettingScope>('U');\n\n public loadedItems = signal<AXPSettingDefinitionGroup[] | null>(null);\n\n\n\n private resolveScope(scopeName: string): AXPSettingScope {\n const scopeMap: Record<string, AXPSettingScope> = {\n environment: 'C',\n global: 'G',\n tenant: 'T',\n user: 'U',\n };\n\n const normalizedScopeName = scopeName.trim().toLowerCase();\n\n return scopeMap[normalizedScopeName] ?? 'U'\n }\n\n groups = computed<AXPGroupSearchResult | null>(() => {\n if (this.activateGroup()) {\n return this.settingDefinitionService.findGroup(this.activeScope(), this.activateGroup()!);\n } else {\n return null\n };\n });\n\n #effect2 = effect(\n () => {\n if (this.searchExpression()) {\n this.searchResult.set(searchSettings(this.loadedItems()!, this.searchExpression()));\n }\n }\n );\n\n\n /**\n * @ignore\n */\n constructor() {\n this.settingValueService.onChanged.subscribe((e) => {\n e.keys.forEach(k => {\n const currentValue = e.values[k];\n const contextValue = get(this.context(), k);\n const previousValue = get(this.previousContext(), k);\n // Update only if there are actual changes\n if (!isEqual(previousValue, currentValue) || !isEqual(currentValue, contextValue)) {\n this.previousContext.update(prev => ({\n ...prev,\n [k]: currentValue, // Use backend-provided value\n }));\n this.context.update(ctx => ({\n ...ctx,\n [k]: currentValue,\n }));\n }\n });\n });\n this.load();\n //\n this.router.events.pipe(\n filter((event) => event instanceof NavigationEnd)\n ).subscribe(async () => {\n await this.updateGroupParam();\n });\n }\n\n async load() {\n //\n this.activeScope.set(this.resolveScope(this.activatedRoute.snapshot.paramMap?.get('scope')!));\n //\n const items = await this.settingDefinitionService.getListAsync(this.activeScope());\n this.loadedItems.set(items);\n const currentContext = await this.settingValueService.all();\n const defaults = this.settingDefinitionService.defaultValues();\n this.context.set({ ...defaults, ...currentContext });\n this.previousContext.set(this.context());\n //\n await this.updateGroupParam();\n if (!this.activateGroup() && this.layoutService.isLarge() && !this.isSearching()) {\n await this.redirectToFirstGroup();\n }\n }\n\n\n\n\n private async updateGroupParam(): Promise<void> {\n const query = this.activatedRoute.snapshot.queryParams[\"q\"];\n const scope = this.resolveScope(this.activatedRoute.snapshot.paramMap.get(\"scope\")!);\n const group = this.activatedRoute.snapshot.paramMap.get(\"group\");\n\n\n if ((this.activeScope() && this.activeScope() != scope) || (this.activateGroup() != group)) {\n this.activateGroup.set(undefined);\n await this.load();\n return;\n }\n\n if (this.isValidQuery(query)) {\n this.searchExpression.set(query);\n }\n if (this.isSearching()) {\n setTimeout(() => {\n this.highlightService.highlight('#ax-settings', this.searchExpression());\n }, 100);\n }\n\n // If no child routes exist, set activateGroup to undefined\n if (this.activatedRoute.children.length === 0) {\n this.activateGroup.set(undefined);\n return;\n }\n // Traverse child routes to check for the group parameter\n for (const childRoute of this.activatedRoute.children) {\n const params = await childRoute.paramMap.pipe(take(1)).toPromise();\n const group = params?.get('group');\n if (group) {\n this.activateGroup.set(group);\n }\n }\n\n\n }\n\n public async redirectToFirstGroup(): Promise<void> {\n const firstGroup = this.determineFirstGroup();\n if (firstGroup) {\n const app = this.activatedRoute.snapshot.params['app'];\n const scope = this.activatedRoute.snapshot.params['scope'];\n await this.router.navigate([app, 'settings', scope, firstGroup], { replaceUrl: true });\n //this.activateGroup.set(firstGroup);\n }\n }\n\n public async navigateUpLevel(): Promise<void> {\n const app = this.activatedRoute.snapshot.params['app'];\n const scope = this.activatedRoute.snapshot.params['scope'];\n await this.router.navigate([app, 'settings', scope]);\n }\n\n private determineFirstGroup(): string | null {\n const groups = this.loadedItems();\n return groups && groups.length > 0 ? groups[0].name : null;\n }\n\n public handleSelectGroup(item: AXPSettingDefinitionGroup) {\n this.router.navigate([`${item.name}`], { relativeTo: this.activatedRoute });\n this.searchExpression.set('');\n }\n\n context = signal<Record<any, any>>({});\n private previousContext = signal<Record<any, any>>({});\n\n async handleContextChanged(e: AXPLayoutContextEvent) {\n if (e.init) {\n this.previousContext.set(e.data);\n }\n else {\n if (this.inlineSave()) {\n await this.settingValueService.set(e.path!, e.newValue);\n }\n else {\n this.context.set(e.data);\n }\n\n }\n }\n\n\n isDirty(section?: AXPSettingDefinitionSection): boolean {\n if (section) {\n // Check for changes in the specific section\n return section.settings.some(c =>\n !isEqual(get(this.context(), c.name), get(this.previousContext(), c.name))\n );\n } else {\n // Check for changes globally based on loadedItems keys\n return this.loadedItems()?.some(group =>\n group.sections.some(sec =>\n sec.settings.some(setting => {\n const currentValue = get(this.context(), setting.name);\n const previousValue = get(this.previousContext(), setting.name);\n return !isEqual(currentValue, previousValue);\n })\n )\n ) || false;\n }\n }\n\n // Save settings logic\n public async apply(section?: AXPSettingDefinitionSection): Promise<void> {\n try {\n this.isSaving.set(true);\n\n if (section) {\n // Apply changes for the specific section\n const changes: Record<string, any> = {}\n section.settings.forEach(c => {\n changes[c.name] = get(this.context(), c.name);\n });\n if (!isEmpty(changes)) {\n await this.settingValueService.set(changes);\n }\n } else {\n // Save the settings\n await this.settingValueService.set(this.context());\n }\n\n // Show success notification\n this.toastService.show({\n color: 'success',\n title: 'Settings Saved',\n content: 'Your changes have been saved successfully.',\n location: 'bottom-center',\n closeButton: true,\n timeOut: 3000,\n timeOutProgress: true,\n });\n } catch (error: any) {\n // Handle and show errors\n console.error('Error saving settings:', error);\n this.toastService.show({\n color: 'danger',\n title: 'Save Failed',\n content: error?.['message'] || 'An error occurred while saving your settings. Please try again.',\n location: 'bottom-center',\n closeButton: true,\n timeOut: 5000,\n timeOutProgress: true,\n });\n } finally {\n this.isSaving.set(false);\n }\n }\n\n // discard settings logic\n public async discard(section?: AXPSettingDefinitionSection): Promise<void> {\n if (section) {\n // Discard changes for the specific section\n section.settings.forEach(c => {\n const previousValue = get(this.previousContext(), c.name);\n this.context.update(ctx => ({\n ...ctx,\n [c.name]: previousValue\n }));\n });\n } else {\n // Discard changes for all sections\n this.context.set(this.previousContext());\n }\n }\n\n // Cancel settings logic\n public async resetToDefault(): Promise<void> {\n const defaults = this.settingDefinitionService.defaultValues();\n // Update the context with the defaults\n this.context.set(defaults);\n //\n await this.apply();\n }\n\n\n public async search(expression: string) {\n this.searchExpression.set(expression);\n const app = this.activatedRoute.snapshot.params['app'];\n const scope = this.activatedRoute.snapshot.params['scope'];\n //\n if (this.isValidQuery(expression)) {\n await this.router.navigate([app, 'settings', scope, this.activateGroup() ?? ''], { queryParams: { q: expression } });\n }\n else {\n await this.router.navigate([app, 'settings', scope, this.activateGroup() ?? '']);\n }\n }\n\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAGA;;;;;;;;AAQG;AACa,SAAA,uBAAuB,CACrC,MAAmC,EACnC,QAA0B,EAAA;;AAG1B,IAAA,MAAM,cAAc,GAAG,CAAC,KAAgC,EAAE,MAAwB,KAAsB;AACtG,QAAA,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI;;AAG5B,QAAA,MAAM,MAAM,GAAqB;YAC/B,EAAE,EAAE,SAAS;YACb,QAAQ,EAAE,MAAM;AAChB,YAAA,IAAI,EAAE,KAAK,CAAC,KAAK;;YAEjB,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;YACjC,UAAU,EAAE,KAAK;YACjB,IAAI,EAAE,KAAK,CAAC,IAAI;AAChB,YAAA,SAAS,EAAE,KAAK,CAAC,MAAM,CAA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,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,WAAW,EAAE,EAAE,CAAC,EAAE,UAAU,EAAE,EAAE,CAAC;;aAEjH;YACH,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;;;8GAvSzE,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAApB,oBAAoB,EAAA,CAAA,CAAA;;2FAApB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBADhC;;;ACnBD;;AAEG;;;;"}
@@ -1085,7 +1085,7 @@ class AXPEntityCreateCustomViewComponent extends AXBasePageComponent {
1085
1085
  {
1086
1086
  provide: AXUnsubscriber,
1087
1087
  },
1088
- ], usesInheritance: true, ngImport: i0, template: "<ax-header class=\"ax-p-4 ax-flex ax-justify-between ax-border-b\">\n <div class=\"ax-flex ax-items-center\">\n @if (showNameInput() && mode==='create') {\n <div class=\"ax-w-60\">\n <ax-text-box class=\"ax-sm\" [(ngModel)]=\"selectedView.title\">\n @if(showNameInput()){\n <ax-suffix>\n <ax-button (onClick)=\"changeViewNameToggle()\" look=\"default\">\n <ax-icon class=\"fa-sodild fas fa-check ax-text-sm\"> </ax-icon>\n </ax-button>\n </ax-suffix>\n }\n </ax-text-box>\n </div>\n }@else {\n <span class=\"ax-text-lg ax-font-semibold\">{{ selectedView.title }}</span>\n } @if (mode===\"create\") {\n <ax-button class=\"ax-xs\" (onClick)=\"changeViewNameToggle()\" color=\"default\">\n @if(!showNameInput() ){\n <ax-icon class=\"fa-regular fa-pen ax-text-sm ax-text-neutral-600\"> </ax-icon>\n }\n </ax-button>\n }\n </div>\n <ax-close-button></ax-close-button>\n</ax-header>\n<div class=\"ax-p-4\">\n <ax-tabs [content]=\"contents\" look=\"with-line\">\n <ax-tab-item [text]=\"('entity.columns' | translate | async) ?? 'Columns'\">\n <ax-suffix>\n <ax-badge [text]=\"visibleColumns().length.toString()\" color=\"primary\"> </ax-badge>\n </ax-suffix>\n <ax-content>\n <div class=\"ax-flex ax-flex-col ax-gap-4 ax-p-4 ax-select-none ax-h-[400px]\" cdkDropList (cdkDropListDropped)=\"drop('columns', $event)\">\n <div class=\"ax-flex ax-flex-col ax-gap-3 ax-w-full ax-sorted-list ax-overflow-auto ax-pe-2\">\n <ng-container *ngFor=\"let item of columns()\">\n <div class=\"ax-flex ax-py-1 ax-items-center ax-justify-between\" cdkDrag cdkDragBoundary=\".ax-sorted-list\">\n <div class=\"ax-flex ax-items-center ax-gap-3\" cdkDragHandle>\n <ax-icon class=\"fa-solid fa-grip-dots-vertical ax-cursor-move\"></ax-icon>\n <p class=\"ax-font-medium ax-text-sm\">{{ item.title }}</p>\n </div>\n <ax-switch class=\"ax-sm\" [(ngModel)]=\"item.visible\" (onValueChanged)=\"updateColumnItem($event, item.name)\"></ax-switch>\n </div>\n </ng-container>\n </div>\n </div>\n </ax-content>\n </ax-tab-item>\n <ax-tab-item text=\"Conditions\">\n <ax-suffix>\n <ax-badge [text]=\"conditions().length.toString()\" color=\"primary\"> </ax-badge>\n </ax-suffix>\n <ax-content>\n <div\n class=\"ax-flex ax-flex-col ax-justify-start ax-gap-4 ax-py-4 ax-select-none ax-h-[400px]\"\n [class.ax-justify-center]=\"!conditions().length\"\n >\n @if(!conditions().length){\n <div class=\"ax-flex ax-flex-col ax-items-center ax-justify-center\">\n <ax-image src=\"assets/documents.svg\"></ax-image>\n <p class=\"ax-mt-6 ax-mb-1 ax-font-bold\">No Filters Selected</p>\n <span class=\"ax-text-neutral-400 ax-text-sm md:ax-text-md\">Please select field(s) that you want to filter</span>\n </div>\n } @else {\n <div class=\"ax-sorted-list ax-px-4 ax-py-1 ax-overflow-auto\">\n <div cdkDropList (cdkDropListDropped)=\"drop('conditions', $event)\" class=\"ax-flex ax-flex-col ax-gap-2\">\n @for(item of conditions(); track item.name ){\n <div cdkDrag cdkDragBoundary=\".ax-sorted-list\">\n <div class=\"ax-ms-4 ax-flex ax-items-start ax-gap-2\">\n <ax-label>{{ loader.getProp(item.name)?.title }}</ax-label>\n @if(getOperatorTitle(item.name,item.operator)){\n <ax-badge class=\"ax-text-xs\" color=\"primary\" [look]=\"'twotone'\" [text]=\"getOperatorTitle(item.name, item.operator)\"></ax-badge>\n }\n </div>\n <div class=\"ax-flex ax-group ax-items-center ax-gap-2\">\n <ax-icon class=\"fa-solid fa-grip-dots-vertical ax-cursor-move\" cdkDragHandle></ax-icon>\n <div class=\"ax-w-full\">\n <axp-widget-filter-renderer\n [schema]=\"getSchema(item.name)\"\n [prop]=\"loader.getProp(item.name)\"\n [(value)]=\"item.value\"\n [(operator)]=\"item.operator\"\n >\n </axp-widget-filter-renderer>\n </div>\n <ax-button look=\"blank\" color=\"danger\" class=\"ax-sm\" (onClick)=\"removeCondition(item)\">\n <ax-icon class=\"fa-solid fa-trash-can\"></ax-icon>\n </ax-button>\n </div>\n </div>\n }\n </div>\n </div>\n }\n <div class=\"ax-flex ax-gap-2\">\n <div class=\"ax-w-full\" #addField>\n @if(conditions().length){\n <ax-button color=\"primary\" [text]=\"'entity.add-field' | translate | async\" look=\"blank\" class=\"ax-sm\"></ax-button>\n }@else {\n <div class=\"ax-flex ax-justify-center ax-w-full\">\n <ax-button color=\"primary\" [text]=\"'entity.add-field' | translate | async\" look=\"outline\" class=\"ax-md ax-w-56\"></ax-button>\n </div>\n }\n <ax-popover\n #conditionsPopover\n [target]=\"addField\"\n [placement]=\"conditions().length ? 'bottom-start' : 'bottom'\"\n [offsetY]=\"8\"\n [openOn]=\"'toggle'\"\n [closeOn]=\"'clickOut'\"\n [adaptivityEnabled]=\"true\"\n (onOpened)=\"resetSelectedFieldNames()\"\n >\n <div class=\"ax-bg-surface ax-border ax-border-default ax-rounded-md ax-shadow-md ax-w-full ax-min-w-[250px]\">\n <div class=\"ax-border-b-[1px] ax-pb-2 ax-mb-2 ax-p-3\">\n <ax-title class=\"ax-font-bold\">Fields</ax-title>\n </div>\n <div class=\"ax-max-h-48 ax-overflow-auto\">\n <ax-selection-list\n [valueField]=\"'name'\"\n [textField]=\"'title'\"\n [(ngModel)]=\"selectedConditionNames\"\n [direction]=\"'vertical'\"\n [items]=\"props()\"\n [multiple]=\"true\"\n ></ax-selection-list>\n </div>\n <div class=\"ax-flex ax-justify-end ax-border-t-[1px] ax-p-3\">\n <ax-button (onClick)=\"addCondition(); conditionsPopover.close()\" class=\"ax-sm\" text=\"Confirm\" color=\"primary\"> </ax-button>\n </div>\n </div>\n </ax-popover>\n </div>\n </div>\n </div>\n </ax-content>\n </ax-tab-item>\n <ax-tab-item text=\"Sorting\">\n <ax-suffix>\n <ax-badge [text]=\"sorts().length.toString()\" color=\"primary\"> </ax-badge>\n </ax-suffix>\n <ax-content>\n <div\n class=\"ax-flex ax-p-4 ax-flex-col ax-justify-start ax-gap-4 ax-select-none ax-overflow-auto ax-h-[400px]\"\n [class.ax-justify-center]=\"!sorts().length\"\n >\n @if(!sorts().length){\n <div class=\"ax-flex ax-flex-col ax-items-center ax-justify-center\">\n <ax-image src=\"assets/documents.svg\"></ax-image>\n <p class=\"ax-mt-6 ax-mb-1 ax-font-bold\">{{ 'entity.no-sort' | translate | async }}</p>\n <span class=\"ax-text-neutral-400 ax-text-sm md:ax-text-md\">{{ 'entity.ask-sort' | translate | async }}</span>\n </div>\n }@else {\n <div\n cdkDropList\n (cdkDropListDropped)=\"drop('sorts', $event)\"\n class=\"ax-flex ax-flex-col ax-gap-3 ax-w-full ax-sorted-list ax-py-1 ax-overflow-auto\"\n >\n <ng-container *ngFor=\"let item of sorts()\">\n <div class=\"ax-flex ax-gap-2 ax-items-center\" cdkDrag cdkDragBoundary=\".ax-sorted-list\">\n <ax-icon class=\"fa-solid fa-grip-dots-vertical ax-cursor-move\" cdkDragHandle></ax-icon>\n <ax-select-box [dataSource]=\"props()\" valueField=\"name\" textField=\"title\" [(ngModel)]=\"item.name\"> </ax-select-box>\n <ax-button [color]=\"'default'\" class=\"ax-sm\" (click)=\"updateSortItem(item)\">\n <ax-icon [class.ax-text-primary]=\"item.dir == 'asc'\" class=\"fa-solid fa-arrow-up-long ax-text-neutral-400\"></ax-icon>\n <ax-icon [class.ax-text-primary]=\"item.dir == 'desc'\" class=\"fa-solid fa-arrow-down-long ax-text-neutral-400\"></ax-icon>\n </ax-button>\n\n <ax-button look=\"blank\" (onClick)=\"removeSortItem(item)\">\n <ax-icon class=\"fa-solid fa-trash-can ax-text-danger-500\"></ax-icon>\n </ax-button>\n </div>\n </ng-container>\n </div>\n }\n\n <div class=\"ax-flex ax-gap-2\">\n <div class=\"ax-w-full\" #addField>\n @if(sorts().length){\n <ax-button\n (onClick)=\"addSortItem()\"\n color=\"primary\"\n [text]=\"'entity.add-field' | translate | async\"\n look=\"blank\"\n class=\"ax-sm\"\n ></ax-button>\n }@else {\n <div class=\"ax-flex ax-justify-center ax-w-full\">\n <ax-button\n (onClick)=\"addSortItem()\"\n color=\"primary\"\n [text]=\"'entity.add-field' | translate | async\"\n look=\"outline\"\n class=\"ax-md ax-w-56\"\n ></ax-button>\n </div>\n }\n </div>\n </div>\n </div>\n </ax-content>\n </ax-tab-item>\n </ax-tabs>\n <ng-template [axTabContent] #contents=\"axTabContent\"> </ng-template>\n</div>\n<ax-footer class=\"!ax-justify-end\">\n @if (mode===\"edit\") {\n <ax-dropdown-button [text]=\"'discard' | translate | async\" (onClick)=\"handleDiscardClick()\">\n <ax-button-item-list>\n <ax-button-item [text]=\"('reset' | translate | async) ?? ' '\" (onClick)=\"handleResetClick()\">\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-rotate-left fa-flip-horizontal\"></ax-icon>\n </ax-prefix>\n </ax-button-item>\n <ax-button-item class=\"ax-text-danger\" text=\"Delete\" (onClick)=\"handleDeleteClick()\">\n <ax-prefix> <ax-icon icon=\"fas fa-trash fa-flip-horizontal\"></ax-icon> </ax-prefix\n ></ax-button-item>\n </ax-button-item-list>\n </ax-dropdown-button>\n } @else {\n <ax-button [text]=\"'cancel' | translate | async\" look=\"outline\" (onClick)=\"handleCancelClick()\"></ax-button>\n }\n <ax-button [text]=\"mode === 'create' ? ('save' | translate | async) : ('save-changes' | translate | async)\" color=\"primary\" (onClick)=\"handleApplyClick()\"></ax-button>\n</ax-footer>\n", dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "type", "responsiveOn", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "responsiveOnChange", "loadingTextChange"] }, { kind: "component", type: i4.AXButtonItemComponent, selector: "ax-button-item", inputs: ["color", "disabled", "text", "selected", "divided", "data", "name"], outputs: ["onClick", "onFocus", "onBlur", "disabledChange"] }, { kind: "component", type: i4.AXButtonItemListComponent, selector: "ax-button-item-list", inputs: ["items"], outputs: ["onItemClick"] }, { kind: "component", type: i4$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i4$1.AXDecoratorCloseButtonComponent, selector: "ax-close-button", inputs: ["icon"] }, { kind: "component", type: i4$1.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-sub-title, ax-placeholder, ax-overlay" }, { kind: "component", type: i5.AXBadgeComponent, selector: "ax-badge", inputs: ["color", "look", "text"] }, { kind: "component", type: i6$1.AXPopoverComponent, selector: "ax-popover", inputs: ["offsetX", "offsetY", "target", "placement", "content", "openOn", "closeOn", "hasBackdrop", "openAfter", "closeAfter", "backdropClass", "panelClass", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "component", type: i7.AXImageComponent, selector: "ax-image", inputs: ["overlayMode", "src", "alt", "priority", "lazy"], outputs: ["onLoad", "onError"] }, { kind: "component", type: i8$1.AXSwitchComponent, selector: "ax-switch", inputs: ["disabled", "readonly", "color", "tabIndex", "value", "name", "isLoading"], outputs: ["onBlur", "onFocus", "valueChange", "onValueChanged", "readonlyChange", "disabledChange"] }, { kind: "component", type: i9.AXTabsComponent, selector: "ax-tabs", inputs: ["look", "location", "fitParent", "minWidth", "content"], outputs: ["onActiveTabChanged"] }, { kind: "component", type: i9.AXTabItemComponent, selector: "ax-tab-item", inputs: ["disabled", "text", "key", "headerTemplate", "active"], outputs: ["disabledChange", "onClick", "onBlur", "onFocus", "activeChange"] }, { kind: "directive", type: i9.AXTabContentDirective, selector: "[axTabContent]", inputs: ["axTabContent"], exportAs: ["axTabContent"] }, { kind: "component", type: i10$1.AXSelectBoxComponent, selector: "ax-select-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "minValue", "maxValue", "value", "state", "name", "id", "type", "look", "multiple", "valueField", "textField", "textTemplate", "dataSource", "caption", "itemTemplate", "selectedTemplate", "emptyTemplate", "loadingTemplate", "dropdownWidth"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onOpened", "onClosed"] }, { kind: "component", type: i11$1.AXTextBoxComponent, selector: "ax-text-box", inputs: ["disabled", "tabIndex", "readonly", "value", "state", "name", "id", "placeholder", "maxLength", "allowNull", "type", "autoComplete", "look", "mask-options", "class"], outputs: ["onBlur", "onFocus", "valueChange", "stateChange", "onValueChanged", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "component", type: i7$1.AXLabelComponent, selector: "ax-label", inputs: ["required", "for"], outputs: ["requiredChange"] }, { kind: "component", type: i13.AXSelectionListComponent, selector: "ax-selection-list", inputs: ["id", "name", "disabled", "readonly", "tabIndex", "size", "value", "valueField", "textField", "disabledField", "readonlyField", "multiple", "direction", "customTemplate", "showControl", "items", "look"], outputs: ["onValueChanged", "onBlur", "onFocus"] }, { kind: "component", type: i14.AXDropdownButtonComponent, selector: "ax-dropdown-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "type", "mode"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "lookChange", "colorChange", "disabledChange"] }, { kind: "directive", type: i15.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i15.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i15.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: i10.AXPWidgetFilterRendererComponent, selector: "axp-widget-filter-renderer", inputs: ["value", "operator", "prop", "schema"], outputs: ["valueChange", "operatorChange"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i8.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1088
+ ], usesInheritance: true, ngImport: i0, template: "<ax-header class=\"ax-p-4 ax-flex ax-justify-between ax-border-b\">\n <div class=\"ax-flex ax-items-center\">\n @if (showNameInput() && mode==='create') {\n <div class=\"ax-w-60\">\n <ax-text-box class=\"ax-sm\" [(ngModel)]=\"selectedView.title\">\n @if(showNameInput()){\n <ax-suffix>\n <ax-button (onClick)=\"changeViewNameToggle()\" look=\"default\">\n <ax-icon class=\"fa-sodild fas fa-check ax-text-sm\"> </ax-icon>\n </ax-button>\n </ax-suffix>\n }\n </ax-text-box>\n </div>\n }@else {\n <span class=\"ax-text-lg ax-font-semibold\">{{ selectedView.title }}</span>\n } @if (mode===\"create\") {\n <ax-button class=\"ax-xs\" (onClick)=\"changeViewNameToggle()\" color=\"default\">\n @if(!showNameInput() ){\n <ax-icon class=\"fa-regular fa-pen ax-text-sm ax-text-neutral-600\"> </ax-icon>\n }\n </ax-button>\n }\n </div>\n <ax-close-button></ax-close-button>\n</ax-header>\n<div class=\"ax-p-4\">\n <ax-tabs [content]=\"contents\" look=\"with-line\">\n <ax-tab-item [text]=\"('entity.columns' | translate | async) ?? 'Columns'\">\n <ax-suffix>\n <ax-badge [text]=\"visibleColumns().length.toString()\" color=\"primary\"> </ax-badge>\n </ax-suffix>\n <ax-content>\n <div class=\"ax-flex ax-flex-col ax-gap-4 ax-p-4 ax-select-none ax-h-[400px]\" cdkDropList (cdkDropListDropped)=\"drop('columns', $event)\">\n <div class=\"ax-flex ax-flex-col ax-gap-3 ax-w-full ax-sorted-list ax-overflow-auto ax-pe-2\">\n <ng-container *ngFor=\"let item of columns()\">\n <div class=\"ax-flex ax-py-1 ax-items-center ax-justify-between\" cdkDrag cdkDragBoundary=\".ax-sorted-list\">\n <div class=\"ax-flex ax-items-center ax-gap-3\" cdkDragHandle>\n <ax-icon class=\"fa-solid fa-grip-dots-vertical ax-cursor-move\"></ax-icon>\n <p class=\"ax-font-medium ax-text-sm\">{{ item.title }}</p>\n </div>\n <ax-switch class=\"ax-sm\" [(ngModel)]=\"item.visible\" (onValueChanged)=\"updateColumnItem($event, item.name)\"></ax-switch>\n </div>\n </ng-container>\n </div>\n </div>\n </ax-content>\n </ax-tab-item>\n <ax-tab-item text=\"Conditions\">\n <ax-suffix>\n <ax-badge [text]=\"conditions().length.toString()\" color=\"primary\"> </ax-badge>\n </ax-suffix>\n <ax-content>\n <div\n class=\"ax-flex ax-flex-col ax-justify-start ax-gap-4 ax-py-4 ax-select-none ax-h-[400px]\"\n [class.ax-justify-center]=\"!conditions().length\"\n >\n @if(!conditions().length){\n <div class=\"ax-flex ax-flex-col ax-items-center ax-justify-center\">\n <ax-image src=\"assets/documents.svg\"></ax-image>\n <p class=\"ax-mt-6 ax-mb-1 ax-font-bold\">No Filters Selected</p>\n <span class=\"ax-text-neutral-400 ax-text-sm md:ax-text-md\">Please select field(s) that you want to filter</span>\n </div>\n } @else {\n <div class=\"ax-sorted-list ax-px-4 ax-py-1 ax-overflow-auto\">\n <div cdkDropList (cdkDropListDropped)=\"drop('conditions', $event)\" class=\"ax-flex ax-flex-col ax-gap-2\">\n @for(item of conditions(); track item.name ){\n <div cdkDrag cdkDragBoundary=\".ax-sorted-list\">\n <div class=\"ax-ms-4 ax-flex ax-items-start ax-gap-2\">\n <ax-label>{{ loader.getProp(item.name)?.title }}</ax-label>\n @if(getOperatorTitle(item.name,item.operator)){\n <ax-badge class=\"ax-text-xs\" color=\"primary\" [look]=\"'twotone'\" [text]=\"getOperatorTitle(item.name, item.operator)\"></ax-badge>\n }\n </div>\n <div class=\"ax-flex ax-group ax-items-center ax-gap-2\">\n <ax-icon class=\"fa-solid fa-grip-dots-vertical ax-cursor-move\" cdkDragHandle></ax-icon>\n <div class=\"ax-w-full\">\n <axp-widget-filter-renderer\n [schema]=\"getSchema(item.name)\"\n [prop]=\"loader.getProp(item.name)\"\n [(value)]=\"item.value\"\n [(operator)]=\"item.operator\"\n >\n </axp-widget-filter-renderer>\n </div>\n <ax-button look=\"blank\" color=\"danger\" class=\"ax-sm\" (onClick)=\"removeCondition(item)\">\n <ax-icon class=\"fa-solid fa-trash-can\"></ax-icon>\n </ax-button>\n </div>\n </div>\n }\n </div>\n </div>\n }\n <div class=\"ax-flex ax-gap-2\">\n <div class=\"ax-w-full\" #addField>\n @if(conditions().length){\n <ax-button color=\"primary\" [text]=\"'entity.add-field' | translate | async\" look=\"blank\" class=\"ax-sm\"></ax-button>\n }@else {\n <div class=\"ax-flex ax-justify-center ax-w-full\">\n <ax-button color=\"primary\" [text]=\"'entity.add-field' | translate | async\" look=\"outline\" class=\"ax-md ax-w-56\"></ax-button>\n </div>\n }\n <ax-popover\n #conditionsPopover\n [target]=\"addField\"\n [placement]=\"conditions().length ? 'bottom-start' : 'bottom'\"\n [offsetY]=\"8\"\n [openOn]=\"'toggle'\"\n [closeOn]=\"'clickOut'\"\n [adaptivityEnabled]=\"true\"\n (onOpened)=\"resetSelectedFieldNames()\"\n >\n <div class=\"ax-bg-surface ax-border ax-border-default ax-rounded-md ax-shadow-md ax-w-full ax-min-w-[250px]\">\n <div class=\"ax-border-b-[1px] ax-pb-2 ax-mb-2 ax-p-3\">\n <ax-title class=\"ax-font-bold\">Fields</ax-title>\n </div>\n <div class=\"ax-max-h-48 ax-overflow-auto\">\n <ax-selection-list\n [valueField]=\"'name'\"\n [textField]=\"'title'\"\n [(ngModel)]=\"selectedConditionNames\"\n [direction]=\"'vertical'\"\n [items]=\"props()\"\n [multiple]=\"true\"\n ></ax-selection-list>\n </div>\n <div class=\"ax-flex ax-justify-end ax-border-t-[1px] ax-p-3\">\n <ax-button (onClick)=\"addCondition(); conditionsPopover.close()\" class=\"ax-sm\" text=\"Confirm\" color=\"primary\"> </ax-button>\n </div>\n </div>\n </ax-popover>\n </div>\n </div>\n </div>\n </ax-content>\n </ax-tab-item>\n <ax-tab-item text=\"Sorting\">\n <ax-suffix>\n <ax-badge [text]=\"sorts().length.toString()\" color=\"primary\"> </ax-badge>\n </ax-suffix>\n <ax-content>\n <div\n class=\"ax-flex ax-p-4 ax-flex-col ax-justify-start ax-gap-4 ax-select-none ax-overflow-auto ax-h-[400px]\"\n [class.ax-justify-center]=\"!sorts().length\"\n >\n @if(!sorts().length){\n <div class=\"ax-flex ax-flex-col ax-items-center ax-justify-center\">\n <ax-image src=\"assets/documents.svg\"></ax-image>\n <p class=\"ax-mt-6 ax-mb-1 ax-font-bold\">{{ 'entity.no-sort' | translate | async }}</p>\n <span class=\"ax-text-neutral-400 ax-text-sm md:ax-text-md\">{{ 'entity.ask-sort' | translate | async }}</span>\n </div>\n }@else {\n <div\n cdkDropList\n (cdkDropListDropped)=\"drop('sorts', $event)\"\n class=\"ax-flex ax-flex-col ax-gap-3 ax-w-full ax-sorted-list ax-py-1 ax-overflow-auto\"\n >\n <ng-container *ngFor=\"let item of sorts()\">\n <div class=\"ax-flex ax-gap-2 ax-items-center\" cdkDrag cdkDragBoundary=\".ax-sorted-list\">\n <ax-icon class=\"fa-solid fa-grip-dots-vertical ax-cursor-move\" cdkDragHandle></ax-icon>\n <ax-select-box [dataSource]=\"props()\" valueField=\"name\" textField=\"title\" [(ngModel)]=\"item.name\"> </ax-select-box>\n <ax-button [color]=\"'default'\" class=\"ax-sm\" (click)=\"updateSortItem(item)\">\n <ax-icon [class.ax-text-primary]=\"item.dir == 'asc'\" class=\"fa-solid fa-arrow-up-long ax-text-neutral-400\"></ax-icon>\n <ax-icon [class.ax-text-primary]=\"item.dir == 'desc'\" class=\"fa-solid fa-arrow-down-long ax-text-neutral-400\"></ax-icon>\n </ax-button>\n\n <ax-button look=\"blank\" (onClick)=\"removeSortItem(item)\">\n <ax-icon class=\"fa-solid fa-trash-can ax-text-danger-500\"></ax-icon>\n </ax-button>\n </div>\n </ng-container>\n </div>\n }\n\n <div class=\"ax-flex ax-gap-2\">\n <div class=\"ax-w-full\" #addField>\n @if(sorts().length){\n <ax-button\n (onClick)=\"addSortItem()\"\n color=\"primary\"\n [text]=\"'entity.add-field' | translate | async\"\n look=\"blank\"\n class=\"ax-sm\"\n ></ax-button>\n }@else {\n <div class=\"ax-flex ax-justify-center ax-w-full\">\n <ax-button\n (onClick)=\"addSortItem()\"\n color=\"primary\"\n [text]=\"'entity.add-field' | translate | async\"\n look=\"outline\"\n class=\"ax-md ax-w-56\"\n ></ax-button>\n </div>\n }\n </div>\n </div>\n </div>\n </ax-content>\n </ax-tab-item>\n </ax-tabs>\n <ng-template [axTabContent] #contents=\"axTabContent\"> </ng-template>\n</div>\n<ax-footer class=\"!ax-justify-end\">\n @if (mode===\"edit\") {\n <ax-dropdown-button [text]=\"'discard' | translate | async\" (onClick)=\"handleDiscardClick()\">\n <ax-button-item-list>\n <ax-button-item [text]=\"('reset' | translate | async) ?? ' '\" (onClick)=\"handleResetClick()\">\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-rotate-left fa-flip-horizontal\"></ax-icon>\n </ax-prefix>\n </ax-button-item>\n <ax-button-item class=\"ax-text-danger\" text=\"Delete\" (onClick)=\"handleDeleteClick()\">\n <ax-prefix> <ax-icon icon=\"fas fa-trash fa-flip-horizontal\"></ax-icon> </ax-prefix\n ></ax-button-item>\n </ax-button-item-list>\n </ax-dropdown-button>\n } @else {\n <ax-button [text]=\"'cancel' | translate | async\" look=\"outline\" (onClick)=\"handleCancelClick()\"></ax-button>\n }\n <ax-button [text]=\"mode === 'create' ? ('save' | translate | async) : ('save-changes' | translate | async)\" color=\"primary\" (onClick)=\"handleApplyClick()\"></ax-button>\n</ax-footer>\n", dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "type", "responsiveOn", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "responsiveOnChange", "loadingTextChange"] }, { kind: "component", type: i4.AXButtonItemComponent, selector: "ax-button-item", inputs: ["color", "disabled", "text", "selected", "divided", "data", "name"], outputs: ["onClick", "onFocus", "onBlur", "disabledChange"] }, { kind: "component", type: i4.AXButtonItemListComponent, selector: "ax-button-item-list", inputs: ["items"], outputs: ["onItemClick"] }, { kind: "component", type: i4$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i4$1.AXDecoratorCloseButtonComponent, selector: "ax-close-button", inputs: ["closeAll", "icon"] }, { kind: "component", type: i4$1.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-sub-title, ax-placeholder, ax-overlay" }, { kind: "component", type: i5.AXBadgeComponent, selector: "ax-badge", inputs: ["color", "look", "text"] }, { kind: "component", type: i6$1.AXPopoverComponent, selector: "ax-popover", inputs: ["offsetX", "offsetY", "target", "placement", "content", "openOn", "closeOn", "hasBackdrop", "openAfter", "closeAfter", "backdropClass", "panelClass", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "component", type: i7.AXImageComponent, selector: "ax-image", inputs: ["overlayMode", "src", "alt", "priority", "lazy"], outputs: ["onLoad", "onError"] }, { kind: "component", type: i8$1.AXSwitchComponent, selector: "ax-switch", inputs: ["disabled", "readonly", "color", "tabIndex", "value", "name", "isLoading"], outputs: ["onBlur", "onFocus", "valueChange", "onValueChanged", "readonlyChange", "disabledChange"] }, { kind: "component", type: i9.AXTabsComponent, selector: "ax-tabs", inputs: ["look", "location", "fitParent", "minWidth", "content"], outputs: ["onActiveTabChanged"] }, { kind: "component", type: i9.AXTabItemComponent, selector: "ax-tab-item", inputs: ["disabled", "text", "key", "headerTemplate", "active"], outputs: ["disabledChange", "onClick", "onBlur", "onFocus", "activeChange"] }, { kind: "directive", type: i9.AXTabContentDirective, selector: "[axTabContent]", inputs: ["axTabContent"], exportAs: ["axTabContent"] }, { kind: "component", type: i10$1.AXSelectBoxComponent, selector: "ax-select-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "minValue", "maxValue", "value", "state", "name", "id", "type", "look", "multiple", "valueField", "textField", "textTemplate", "dataSource", "caption", "itemTemplate", "selectedTemplate", "emptyTemplate", "loadingTemplate", "dropdownWidth"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onOpened", "onClosed"] }, { kind: "component", type: i11$1.AXTextBoxComponent, selector: "ax-text-box", inputs: ["disabled", "tabIndex", "readonly", "value", "state", "name", "id", "placeholder", "maxLength", "allowNull", "type", "autoComplete", "look", "mask-options", "class"], outputs: ["onBlur", "onFocus", "valueChange", "stateChange", "onValueChanged", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "component", type: i7$1.AXLabelComponent, selector: "ax-label", inputs: ["required", "for"], outputs: ["requiredChange"] }, { kind: "component", type: i13.AXSelectionListComponent, selector: "ax-selection-list", inputs: ["id", "name", "disabled", "readonly", "tabIndex", "size", "value", "valueField", "textField", "disabledField", "readonlyField", "multiple", "direction", "customTemplate", "showControl", "items", "look"], outputs: ["onValueChanged", "onBlur", "onFocus"] }, { kind: "component", type: i14.AXDropdownButtonComponent, selector: "ax-dropdown-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "type", "mode"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "lookChange", "colorChange", "disabledChange"] }, { kind: "directive", type: i15.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i15.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i15.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: i10.AXPWidgetFilterRendererComponent, selector: "axp-widget-filter-renderer", inputs: ["value", "operator", "prop", "schema"], outputs: ["valueChange", "operatorChange"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i8.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1089
1089
  }
1090
1090
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityCreateCustomViewComponent, decorators: [{
1091
1091
  type: Component,