@acorex/platform 19.0.0 → 19.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/common/lib/app/application.types.d.ts +1 -0
- package/common/lib/common.module.d.ts +2 -2
- package/common/lib/layout/sticky.directive.d.ts +5 -1
- package/common/lib/settings/index.d.ts +1 -0
- package/common/lib/settings/setting-definition.provider.d.ts +7 -8
- package/common/lib/settings/setting.builder.d.ts +45 -0
- package/common/lib/settings/settings.provider.d.ts +3 -2
- package/common/lib/settings/settings.service.d.ts +9 -5
- package/common/lib/settings/settings.types.d.ts +15 -25
- package/common/lib/store/common.effects.d.ts +2 -2
- package/fesm2022/acorex-platform-common.mjs +255 -190
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-builder.mjs +82 -25
- package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-designer.mjs +12 -10
- package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-entity.mjs +23 -6
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-setting.mjs +134 -118
- package/fesm2022/acorex-platform-layout-setting.mjs.map +1 -1
- package/fesm2022/acorex-platform-layouts.mjs +1 -1
- package/fesm2022/acorex-platform-layouts.mjs.map +1 -1
- package/fesm2022/{acorex-platform-themes-default-entity-master-create-view.component-Bw-rbKbL.mjs → acorex-platform-themes-default-entity-master-create-view.component-CJ_HVKX-.mjs} +4 -4
- package/fesm2022/{acorex-platform-themes-default-entity-master-create-view.component-Bw-rbKbL.mjs.map → acorex-platform-themes-default-entity-master-create-view.component-CJ_HVKX-.mjs.map} +1 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-CeBk_nxz.mjs +305 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-CeBk_nxz.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-entity-master-modify-view.component-DoeGBemE.mjs → acorex-platform-themes-default-entity-master-modify-view.component-DveB-N1Z.mjs} +5 -5
- package/fesm2022/{acorex-platform-themes-default-entity-master-modify-view.component-DoeGBemE.mjs.map → acorex-platform-themes-default-entity-master-modify-view.component-DveB-N1Z.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-themes-default-entity-master-single-view.component-D8UjpvuI.mjs → acorex-platform-themes-default-entity-master-single-view.component-q_DOP0cT.mjs} +12 -12
- package/fesm2022/{acorex-platform-themes-default-entity-master-single-view.component-D8UjpvuI.mjs.map → acorex-platform-themes-default-entity-master-single-view.component-q_DOP0cT.mjs.map} +1 -1
- package/fesm2022/acorex-platform-themes-default.mjs +233 -193
- package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
- package/fesm2022/acorex-platform-themes-shared.mjs +182 -23
- package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
- package/fesm2022/{acorex-platform-widgets-checkbox-widget-designer.component-RCi5IJOR.mjs → acorex-platform-widgets-checkbox-widget-designer.component-B_Gec5Qf.mjs} +4 -4
- package/fesm2022/{acorex-platform-widgets-checkbox-widget-designer.component-RCi5IJOR.mjs.map → acorex-platform-widgets-checkbox-widget-designer.component-B_Gec5Qf.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-widgets-color-box-widget-designer.component-CWhbgmDV.mjs → acorex-platform-widgets-color-box-widget-designer.component-B2g0ct24.mjs} +4 -4
- package/fesm2022/acorex-platform-widgets-color-box-widget-designer.component-B2g0ct24.mjs.map +1 -0
- package/fesm2022/{acorex-platform-widgets-page-widget-designer.component-DGNcuRbs.mjs → acorex-platform-widgets-page-widget-designer.component-CITselce.mjs} +5 -5
- package/fesm2022/acorex-platform-widgets-page-widget-designer.component-CITselce.mjs.map +1 -0
- package/fesm2022/acorex-platform-widgets.mjs +280 -127
- package/fesm2022/acorex-platform-widgets.mjs.map +1 -1
- package/layout/builder/lib/builder/widget-column-renderer.d.ts +5 -1
- package/layout/builder/lib/builder/widget-renderer.component.directive.d.ts +6 -1
- package/layout/builder/lib/builder/widget.types.d.ts +14 -9
- package/layout/designer/lib/preview/preview.component.d.ts +2 -2
- package/layout/entity/lib/entity-detail-list.viewmodel.d.ts +1 -0
- package/layout/entity/lib/entity-master-list.viewmodel.d.ts +1 -0
- package/layout/entity/lib/widgets/lookup-widget/lookup-widget-selector.viewmodel.d.ts +1 -0
- package/layout/setting/lib/setting.viewmodel.d.ts +19 -19
- package/layouts/lib/admin/entity-layout/entity-details-view/entity-details-view.component.d.ts +1 -0
- package/package.json +16 -16
- package/themes/default/index.d.ts +2 -1
- package/themes/default/lib/layouts/base/index.d.ts +1 -0
- package/themes/default/lib/layouts/base/simple-page/simple-page.layout.d.ts +7 -0
- package/themes/default/lib/layouts/entity-layouts/entity-detail-list-view/entity-detail-list-view.component.d.ts +1 -0
- package/themes/default/lib/layouts/entity-layouts/entity-master-list-view/entity-master-list-view.component.d.ts +1 -0
- package/themes/default/lib/layouts/entity-layouts/entity-master-list-view/list-view-option-columns/list-view-option-columns.component.d.ts +2 -2
- package/themes/default/lib/layouts/entity-layouts/entity-master-single-view/entity-master-single-view.component.d.ts +1 -0
- package/themes/default/lib/layouts/root-layout/components/header/header.component.d.ts +1 -0
- package/themes/default/lib/layouts/root-layout/root-layout.component.d.ts +1 -0
- package/themes/default/lib/layouts/setting-layout/setting-menu/setting-menu.component.d.ts +0 -2
- package/themes/default/lib/layouts/setting-layout/setting-page/setting-page.component.d.ts +5 -0
- package/themes/default/lib/layouts/setting-layout/setting-view/setting-view.component.d.ts +3 -1
- package/themes/shared/index.d.ts +1 -0
- package/themes/shared/lib/components/layout-elements/index.d.ts +2 -0
- package/themes/shared/lib/components/layout-elements/layout-blocks.component.d.ts +5 -0
- package/themes/shared/lib/components/layout-elements/layout-page-header.component.d.ts +11 -0
- package/themes/shared/lib/components/theme-slot.component.d.ts +1 -0
- package/themes/shared/lib/services/theme.service.d.ts +1 -0
- package/themes/shared/lib/setting.keys.d.ts +4 -0
- package/themes/shared/lib/setting.provider.d.ts +4 -0
- package/widgets/lib/properties/layout.props.d.ts +1 -0
- package/widgets/lib/widgets/advance/map/map-box-widget-edit.component.d.ts +1 -1
- package/widgets/lib/widgets/advance/map/map-box-widget-view.component.d.ts +1 -1
- package/widgets/lib/widgets/editors/checkbox/checkbox-widget-edit.component.d.ts +0 -3
- package/widgets/lib/widgets/editors/checkbox/checkbox-widget.config.d.ts +4 -6
- package/widgets/lib/widgets/editors/password/password-box-widget-view.component.d.ts +1 -1
- package/widgets/lib/widgets/editors/toggle/toggle-widget-edit.component.d.ts +4 -0
- package/widgets/lib/widgets/index.d.ts +1 -0
- package/widgets/lib/widgets/layout/block/block-widget-designer.component.d.ts +2 -2
- package/widgets/lib/widgets/layout/form-field/form-field-widget-designer.component.d.ts +2 -2
- package/widgets/lib/widgets/layout/grid/grid-widget-designer.component.d.ts +2 -2
- package/widgets/lib/widgets/layout/grid-item/grid-item-widget-designer.component.d.ts +2 -2
- package/widgets/lib/widgets/layout/grid-item/grid-item-widget-view.component.d.ts +2 -2
- package/widgets/lib/widgets/layout/grid-row/grid-row-widget-designer.component.d.ts +2 -2
- package/widgets/lib/widgets/layout/page/page-widget-designer.component.d.ts +2 -2
- package/widgets/lib/widgets/layout/repeater/repeater-widget-designer.component.d.ts +2 -2
- package/widgets/lib/widgets/property-editors/spacing/index.d.ts +3 -0
- package/widgets/lib/widgets/property-editors/spacing/spacing-widget-editor.component.d.ts +13 -0
- package/widgets/lib/widgets/property-editors/spacing/spacing-widget-type.d.ts +10 -0
- package/widgets/lib/widgets/property-editors/spacing/spacing-widget.config.d.ts +7 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-DJYTC375.mjs +0 -305
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-DJYTC375.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-color-box-widget-designer.component-CWhbgmDV.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-page-widget-designer.component-DGNcuRbs.mjs.map +0 -1
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { AXToastService } from '@acorex/components/toast';
|
|
2
2
|
import { AXPlatform } from '@acorex/core/platform';
|
|
3
|
-
import { AXPSettingDefinitionProviderService } from '@acorex/platform/common';
|
|
3
|
+
import { AXPSettingDefinitionProviderService, AXPSettingValueProviderService } from '@acorex/platform/common';
|
|
4
4
|
import { AXHighlightService } from '@acorex/platform/core';
|
|
5
5
|
import * as i0 from '@angular/core';
|
|
6
|
-
import { inject, signal,
|
|
6
|
+
import { inject, signal, computed, effect, Injectable } from '@angular/core';
|
|
7
7
|
import { Router, NavigationEnd } from '@angular/router';
|
|
8
8
|
import { filter, take } from 'rxjs';
|
|
9
|
+
import { isEmpty, isEqual } from 'lodash-es';
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* Converts a list of AXPSettingDefinitionGroup into a tree structure of AXTreeViewSchema.
|
|
@@ -28,6 +29,7 @@ function convertToTreeViewSchema(groups, parentId) {
|
|
|
28
29
|
//tooltip: group.description, // Optional description as tooltip
|
|
29
30
|
hasChild: group.groups.length > 0, // Whether the group has child groups
|
|
30
31
|
isExpanded: false, // Default state for expansion (optional)
|
|
32
|
+
icon: group.icon,
|
|
31
33
|
childrens: group.groups.length > 0 ? [] : undefined, // Child groups array (undefined if no children)
|
|
32
34
|
};
|
|
33
35
|
// Recursively process nested groups (sub-groups inside the current group)
|
|
@@ -66,115 +68,120 @@ function setActiveByValueField(tree, targetId) {
|
|
|
66
68
|
});
|
|
67
69
|
}
|
|
68
70
|
function searchSettings(groups, search) {
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
const matchedSections = [];
|
|
78
|
-
// Check sections in the current group
|
|
79
|
-
group.sections.forEach((section) => {
|
|
80
|
-
if (searchInSection(section)) {
|
|
81
|
-
matchedSections.push(section);
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
// Check nested groups recursively
|
|
85
|
-
group.groups.forEach((nestedGroup) => {
|
|
86
|
-
// Search for matching sections in the nested group
|
|
87
|
-
const nestedGroupMatchedSections = nestedGroup.sections.filter((section) => searchInSection(section));
|
|
88
|
-
matchedSections.push(...nestedGroupMatchedSections);
|
|
89
|
-
// If any section in the nested group matched, we should include this nested group in the result
|
|
90
|
-
if (nestedGroupMatchedSections.length > 0) {
|
|
91
|
-
// If the group has matched sections, we add it (excluding nested groups in the final result)
|
|
92
|
-
result.push({
|
|
93
|
-
...nestedGroup,
|
|
94
|
-
sections: nestedGroupMatchedSections,
|
|
95
|
-
groups: [], // Exclude nested groups from the result
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
// If the group has any matching sections, add it to the result
|
|
100
|
-
if (matchedSections.length > 0) {
|
|
101
|
-
result.push({
|
|
71
|
+
const sectionMatchResult = [];
|
|
72
|
+
const settingMatchResult = [];
|
|
73
|
+
const processedGroups = new Set();
|
|
74
|
+
const createGroupIdentifier = (group) => `${group.name}-${group.title}`;
|
|
75
|
+
const addGroupToResult = (group, sections, resultArray) => {
|
|
76
|
+
const groupId = createGroupIdentifier(group);
|
|
77
|
+
if (!processedGroups.has(groupId)) {
|
|
78
|
+
resultArray.push({
|
|
102
79
|
...group,
|
|
103
|
-
sections
|
|
104
|
-
groups: [], // Exclude nested groups
|
|
80
|
+
sections,
|
|
81
|
+
groups: [], // Exclude nested groups
|
|
105
82
|
});
|
|
106
|
-
|
|
83
|
+
processedGroups.add(groupId);
|
|
107
84
|
}
|
|
108
|
-
return false; // No matching settings in this group
|
|
109
85
|
};
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
86
|
+
const processSections = (group, filterFn) => {
|
|
87
|
+
const matchedSections = group.sections.filter(filterFn);
|
|
88
|
+
if (matchedSections.length > 0) {
|
|
89
|
+
addGroupToResult(group, matchedSections, sectionMatchResult);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
const processSettings = (group, filterFn) => {
|
|
93
|
+
const matchedSections = group.sections
|
|
94
|
+
.map(filterFn)
|
|
95
|
+
.filter((section) => section !== null);
|
|
96
|
+
if (matchedSections.length > 0) {
|
|
97
|
+
addGroupToResult(group, matchedSections, settingMatchResult);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
const sectionMatches = (section) => section.name.toLowerCase().includes(search.toLowerCase()) ||
|
|
101
|
+
section.title.toLowerCase().includes(search.toLowerCase());
|
|
102
|
+
const filterSettings = (section) => {
|
|
103
|
+
const matchedSettings = section.settings.filter((setting) => setting.name.toLowerCase().includes(search.toLowerCase()) ||
|
|
104
|
+
setting.title.toLowerCase().includes(search.toLowerCase()));
|
|
105
|
+
return matchedSettings.length > 0 ? { ...section, settings: matchedSettings } : null;
|
|
106
|
+
};
|
|
107
|
+
const processGroupRecursively = (group) => {
|
|
108
|
+
processSections(group, sectionMatches); // Match sections with all settings
|
|
109
|
+
processSettings(group, filterSettings); // Match settings within sections
|
|
110
|
+
group.groups.forEach(processGroupRecursively); // Recurse into nested groups
|
|
111
|
+
};
|
|
112
|
+
groups.forEach(processGroupRecursively);
|
|
113
|
+
return [...sectionMatchResult, ...settingMatchResult];
|
|
115
114
|
}
|
|
116
115
|
|
|
117
116
|
class AXPSettingsViewModel {
|
|
117
|
+
#effect2;
|
|
118
|
+
/**
|
|
119
|
+
* @ignore
|
|
120
|
+
*/
|
|
118
121
|
constructor() {
|
|
119
122
|
this.router = inject(Router);
|
|
120
|
-
this.
|
|
123
|
+
this.settingDefinitionService = inject(AXPSettingDefinitionProviderService);
|
|
124
|
+
this.settingValueService = inject(AXPSettingValueProviderService);
|
|
121
125
|
this.platform = inject(AXPlatform);
|
|
122
126
|
this.toastService = inject(AXToastService);
|
|
123
127
|
this.highlightService = inject(AXHighlightService);
|
|
124
128
|
this.isMobile = signal(this.platform.is('MD'));
|
|
125
129
|
this.fullRoute = this.router.url.split('/settings')[0] + '/settings/';
|
|
126
130
|
this.search = signal('');
|
|
127
|
-
|
|
128
|
-
this.searchedSettings = signal(undefined);
|
|
129
|
-
this.effect2 = effect(() => {
|
|
130
|
-
if (this.search()) {
|
|
131
|
-
this.searchedSettings.set(searchSettings(this.data(), this.search()));
|
|
132
|
-
}
|
|
133
|
-
setTimeout(() => {
|
|
134
|
-
this.highlightService.highlight('#ax-settings', this.search());
|
|
135
|
-
}, 0);
|
|
136
|
-
//console.log('search settings:', this.searchedSettings());
|
|
137
|
-
});
|
|
131
|
+
this.searchResult = signal(undefined);
|
|
138
132
|
this.activatedGroup = signal(undefined);
|
|
139
|
-
this.
|
|
140
|
-
this.
|
|
133
|
+
this.loadedItems = signal(null);
|
|
134
|
+
this.formattedData = signal([]);
|
|
135
|
+
this.groups = computed(() => {
|
|
141
136
|
if (this.activatedGroup()) {
|
|
142
|
-
return this.
|
|
137
|
+
return this.settingDefinitionService.findGroup(this.activatedGroup());
|
|
143
138
|
}
|
|
144
|
-
else
|
|
139
|
+
else {
|
|
145
140
|
return null;
|
|
141
|
+
}
|
|
142
|
+
;
|
|
143
|
+
});
|
|
144
|
+
this.#effect2 = effect(() => {
|
|
145
|
+
if (this.search()) {
|
|
146
|
+
this.searchResult.set(searchSettings(this.loadedItems(), this.search()));
|
|
147
|
+
}
|
|
148
|
+
setTimeout(() => {
|
|
149
|
+
this.highlightService.highlight('#ax-settings', this.search());
|
|
150
|
+
});
|
|
146
151
|
});
|
|
147
|
-
this.formattedData = signal([]);
|
|
148
152
|
this.context = signal({});
|
|
149
153
|
this.previousContext = signal({});
|
|
150
154
|
this.isSaving = signal(false);
|
|
151
|
-
this.canCancel = computed(() =>
|
|
155
|
+
this.canCancel = computed(() => isEmpty(this.context()));
|
|
152
156
|
this.canSave = computed(() => !this.isSaving() &&
|
|
153
|
-
!
|
|
154
|
-
!
|
|
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 }));
|
|
162
|
+
});
|
|
155
163
|
}
|
|
156
164
|
async initializeService(activatedRoute) {
|
|
157
165
|
// Initial setup
|
|
166
|
+
await this.load();
|
|
158
167
|
this.activatedRoute = activatedRoute;
|
|
168
|
+
//
|
|
159
169
|
this.router.events.pipe(filter((event) => event instanceof NavigationEnd)).subscribe(() => {
|
|
160
170
|
this.updateGroupParam();
|
|
161
171
|
});
|
|
172
|
+
//
|
|
162
173
|
this.updateGroupParam();
|
|
163
|
-
await this.getData();
|
|
164
|
-
}
|
|
165
|
-
ngOnDestroy() {
|
|
166
|
-
this.subscription.unsubscribe();
|
|
167
174
|
}
|
|
168
175
|
// Fetch settings data
|
|
169
|
-
async
|
|
170
|
-
const items = await this.
|
|
171
|
-
this.
|
|
172
|
-
const formattedData = convertToTreeViewSchema(this.
|
|
176
|
+
async load() {
|
|
177
|
+
const items = await this.settingDefinitionService.items();
|
|
178
|
+
this.loadedItems.set(items);
|
|
179
|
+
const formattedData = convertToTreeViewSchema(this.loadedItems());
|
|
173
180
|
this.formattedData.set(formattedData);
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
181
|
+
const currentContext = await this.settingValueService.all();
|
|
182
|
+
const defaults = this.settingDefinitionService.defaultValues();
|
|
183
|
+
this.context.set({ ...defaults, ...currentContext });
|
|
184
|
+
this.previousContext.set(this.context());
|
|
178
185
|
}
|
|
179
186
|
// Update group param logic
|
|
180
187
|
updateGroupParam() {
|
|
@@ -185,9 +192,9 @@ class AXPSettingsViewModel {
|
|
|
185
192
|
}
|
|
186
193
|
// Traverse child routes to check for the group parameter
|
|
187
194
|
this.activatedRoute.children.forEach((childRoute) => {
|
|
188
|
-
childRoute.paramMap.pipe(take(1)).subscribe((params) => {
|
|
195
|
+
childRoute.paramMap.pipe(take(1)).subscribe(async (params) => {
|
|
189
196
|
const group = params.get('group');
|
|
190
|
-
this.activatedGroup.
|
|
197
|
+
this.activatedGroup.update(() => group || undefined);
|
|
191
198
|
if (group) {
|
|
192
199
|
this.formattedData.set(setActiveByValueField(this.formattedData(), group));
|
|
193
200
|
}
|
|
@@ -199,50 +206,59 @@ class AXPSettingsViewModel {
|
|
|
199
206
|
this.router.navigate([value], { relativeTo: this.activatedRoute });
|
|
200
207
|
this.search.set('');
|
|
201
208
|
}
|
|
202
|
-
|
|
203
|
-
|
|
209
|
+
handleContextChanged(e) {
|
|
210
|
+
if (e.init) {
|
|
211
|
+
this.previousContext.set(e.data);
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
this.context.set(e.data);
|
|
215
|
+
}
|
|
204
216
|
}
|
|
205
217
|
// Save settings logic
|
|
206
|
-
async
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
this.context.set({});
|
|
224
|
-
}
|
|
225
|
-
// Helper: Check if object is empty
|
|
226
|
-
isObjectEmpty(obj) {
|
|
227
|
-
return Object.keys(obj).length === 0;
|
|
228
|
-
}
|
|
229
|
-
// Helper: Compare objects
|
|
230
|
-
areObjectsEqual(obj1, obj2) {
|
|
231
|
-
if (typeof obj1 !== 'object' || typeof obj2 !== 'object' || obj1 === null || obj2 === null) {
|
|
232
|
-
return obj1 === obj2;
|
|
218
|
+
async apply() {
|
|
219
|
+
try {
|
|
220
|
+
// Update the previous context and set the saving state
|
|
221
|
+
this.previousContext.set(this.context());
|
|
222
|
+
this.isSaving.set(true);
|
|
223
|
+
// Save the settings
|
|
224
|
+
await this.settingValueService.set(this.context());
|
|
225
|
+
// Show success notification
|
|
226
|
+
this.toastService.show({
|
|
227
|
+
color: 'success',
|
|
228
|
+
title: 'Settings Saved',
|
|
229
|
+
content: 'Your changes have been saved successfully.',
|
|
230
|
+
location: 'bottom-center',
|
|
231
|
+
closeButton: true,
|
|
232
|
+
timeOut: 3000,
|
|
233
|
+
timeOutProgress: true,
|
|
234
|
+
});
|
|
233
235
|
}
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
236
|
+
catch (error) {
|
|
237
|
+
// Handle and show errors
|
|
238
|
+
console.error('Error saving settings:', error);
|
|
239
|
+
this.toastService.show({
|
|
240
|
+
color: 'danger',
|
|
241
|
+
title: 'Save Failed',
|
|
242
|
+
content: error?.['message'] || 'An error occurred while saving your settings. Please try again.',
|
|
243
|
+
location: 'bottom-center',
|
|
244
|
+
closeButton: true,
|
|
245
|
+
timeOut: 5000,
|
|
246
|
+
timeOutProgress: true,
|
|
247
|
+
});
|
|
238
248
|
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
return false;
|
|
243
|
-
}
|
|
249
|
+
finally {
|
|
250
|
+
// Reset the saving state
|
|
251
|
+
this.isSaving.set(false);
|
|
244
252
|
}
|
|
245
|
-
|
|
253
|
+
}
|
|
254
|
+
// Cancel settings logic
|
|
255
|
+
reset() {
|
|
256
|
+
this.context.set(this.previousContext());
|
|
257
|
+
}
|
|
258
|
+
// Cancel settings logic
|
|
259
|
+
resetToDefault() {
|
|
260
|
+
const defaults = this.settingDefinitionService.defaultValues();
|
|
261
|
+
this.context.set(defaults);
|
|
246
262
|
}
|
|
247
263
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPSettingsViewModel, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
248
264
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPSettingsViewModel, providedIn: 'root' }); }
|
|
@@ -250,7 +266,7 @@ class AXPSettingsViewModel {
|
|
|
250
266
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPSettingsViewModel, decorators: [{
|
|
251
267
|
type: Injectable,
|
|
252
268
|
args: [{ providedIn: 'root' }]
|
|
253
|
-
}] });
|
|
269
|
+
}], ctorParameters: () => [] });
|
|
254
270
|
|
|
255
271
|
/**
|
|
256
272
|
* Generated bundle index. Do not edit.
|
|
@@ -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 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}\n\nexport function searchSettings(groups: AXPSettingDefinitionGroup[], search: string): AXPSettingDefinitionGroup[] {\n const result: AXPSettingDefinitionGroup[] = [];\n\n // Helper function to search within a section's settings\n const searchInSection = (section: AXPSettingDefinitionSection): boolean => {\n return section.settings.some(\n (setting) =>\n setting.name.toLowerCase().includes(search.toLowerCase()) ||\n setting.title.toLowerCase().includes(search.toLowerCase())\n );\n };\n\n // Recursive function to search within groups and sections\n const searchInGroup = (group: AXPSettingDefinitionGroup): boolean => {\n const matchedSections: AXPSettingDefinitionSection[] = [];\n\n // Check sections in the current group\n group.sections.forEach((section) => {\n if (searchInSection(section)) {\n matchedSections.push(section);\n }\n });\n\n // Check nested groups recursively\n group.groups.forEach((nestedGroup) => {\n // Search for matching sections in the nested group\n const nestedGroupMatchedSections = nestedGroup.sections.filter((section) => searchInSection(section));\n matchedSections.push(...nestedGroupMatchedSections);\n\n // If any section in the nested group matched, we should include this nested group in the result\n if (nestedGroupMatchedSections.length > 0) {\n // If the group has matched sections, we add it (excluding nested groups in the final result)\n result.push({\n ...nestedGroup,\n sections: nestedGroupMatchedSections,\n groups: [], // Exclude nested groups from the result\n });\n }\n });\n\n // If the group has any matching sections, add it to the result\n if (matchedSections.length > 0) {\n result.push({\n ...group,\n sections: matchedSections, // Only include the matched sections\n groups: [], // Exclude nested groups in the result\n });\n return true; // Group contains matched settings\n }\n\n return false; // No matching settings in this group\n };\n\n // Iterate through each top-level group\n groups.forEach((group) => {\n searchInGroup(group); // Recursively search the group and nested groups\n });\n\n return result;\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 AXPGroupDetails,\n AXPSettingDefinitionGroup,\n AXPSettingDefinitionItem,\n AXPSettingDefinitionProviderService,\n} from '@acorex/platform/common';\nimport { AXHighlightService } from '@acorex/platform/core';\nimport { computed, effect, inject, Injectable, OnDestroy, signal } from '@angular/core';\nimport { ActivatedRoute, NavigationEnd, Router } from '@angular/router';\nimport { filter, Subscription, take } from 'rxjs';\nimport { convertToTreeViewSchema, searchSettings, setActiveByValueField } from './convert-setting-data';\n\n@Injectable({ providedIn: 'root' })\nexport class AXPSettingsViewModel implements OnDestroy {\n private readonly router = inject(Router);\n private readonly settingService = inject(AXPSettingDefinitionProviderService);\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 subscription: Subscription;\n isMobile = signal(this.platform.is('MD'));\n fullRoute = this.router.url.split('/settings')[0] + '/settings/';\n\n search = signal('');\n //effect1 = effect(() => console.log('search text: ', this.search()));\n searchedSettings = signal<AXPSettingDefinitionGroup[] | undefined>(undefined);\n\n effect2 = effect(\n () => {\n if (this.search()) {\n this.searchedSettings.set(searchSettings(this.data()!, this.search()));\n }\n setTimeout(() => {\n this.highlightService.highlight('#ax-settings', this.search());\n }, 0);\n //console.log('search settings:', this.searchedSettings());\n }\n );\n\n activatedGroup = signal<string | undefined>(undefined);\n data = signal<AXPSettingDefinitionItem[] | null>(null);\n dataDetails = computed<AXPGroupDetails | null>(() => {\n if (this.activatedGroup()) {\n return this.fetchGroupDetails(this.activatedGroup()!);\n } else return null;\n });\n\n formattedData = signal<AXTreeViewSchema[]>([]);\n\n\n async initializeService(activatedRoute: ActivatedRoute) {\n // Initial setup\n this.activatedRoute = activatedRoute;\n this.router.events.pipe(filter((event) => event instanceof NavigationEnd)).subscribe(() => {\n this.updateGroupParam();\n });\n this.updateGroupParam();\n await this.getData();\n }\n\n ngOnDestroy(): void {\n this.subscription.unsubscribe();\n }\n\n // Fetch settings data\n async getData(): Promise<void> {\n const items = await this.settingService.items();\n this.data.set(items);\n const formattedData = convertToTreeViewSchema(this.data()!);\n this.formattedData.set(formattedData);\n }\n\n // Fetch group details for preview\n fetchGroupDetails(groupName: string): AXPGroupDetails | null {\n return this.settingService.findGroupDetails(groupName);\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((params) => {\n const group = params.get('group');\n this.activatedGroup.set(group || undefined);\n if (group) {\n this.formattedData.set(setActiveByValueField(this.formattedData(), group));\n }\n });\n });\n }\n\n public onChooseGroup(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 previousContext = signal<Record<any, any>>({});\n setContext(value: any) {\n this.context.set(value);\n }\n isSaving = signal(false);\n\n canCancel = computed(() => this.isObjectEmpty(this.context()));\n canSave = computed(\n () =>\n !this.isSaving() &&\n !this.isObjectEmpty(this.context()) &&\n !this.areObjectsEqual(this.context(), this.previousContext())\n );\n // Save settings logic\n public async onSaveSettings(): Promise<void> {\n this.previousContext.set(this.context());\n this.isSaving.set(true);\n\n // Simulate an API call\n this.toastService.show({\n color: 'success',\n title: `Saved successfully`,\n location: 'bottom-center',\n closeButton: true,\n timeOut: 3000,\n timeOutProgress: false,\n });\n\n await new Promise((resolve) => setTimeout(resolve, 500));\n this.isSaving.set(false);\n }\n\n // Cancel settings logic\n public onCancelSettings(): void {\n this.context.set({});\n }\n\n // Helper: Check if object is empty\n private isObjectEmpty(obj: object): boolean {\n return Object.keys(obj).length === 0;\n }\n\n // Helper: Compare objects\n private areObjectsEqual<T>(obj1: T, obj2: T): boolean {\n if (typeof obj1 !== 'object' || typeof obj2 !== 'object' || obj1 === null || obj2 === null) {\n return obj1 === obj2;\n }\n const keys1 = Object.keys(obj1);\n const keys2 = Object.keys(obj2);\n\n if (keys1.length !== keys2.length) {\n return false;\n }\n for (const key of keys1) {\n const keyTyped = key as keyof T;\n if (!obj2.hasOwnProperty(key) || !this.areObjectsEqual(obj1[keyTyped], obj2[keyTyped])) {\n return false;\n }\n }\n return true;\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;Y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EAAE;YAC1F,OAAO,IAAI,KAAK,IAAI;;QAEtB,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;QAC/B,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;QAE/B,IAAI,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM,EAAE;AACjC,YAAA,OAAO,KAAK;;AAEd,QAAA,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE;YACvB,MAAM,QAAQ,GAAG,GAAc;YAC/B,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE;AACtF,gBAAA,OAAO,KAAK;;;AAGhB,QAAA,OAAO,IAAI;;8GAxJF,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAApB,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,oBAAoB,cADP,MAAM,EAAA,CAAA,CAAA;;2FACnB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBADhC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACflC;;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 { 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 onChooseGroup(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;YACj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AE,KAAK,GAAG,SAAS,CAAC,IAAI,iEAAiE;AAChG,gBAAA,QAAQ,EAAE,eAAe;AACzB,gBAAA,WAAW,EAAE,IAAI;AACjB,gBAAA,OAAO,EAAE,IAAI;AACb,gBAAA,eAAe,EAAE,IAAI;AACtB,aAAA,CAAC;;gBACM;;AAER,YAAA,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC;;;;IAMrB,KAAK,GAAA;QACV,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC;;;IAInC,cAAc,GAAA;QACnB,MAAM,QAAQ,GAAG,IAAI,CAAC,wBAAwB,CAAC,aAAa,EAAE;AAC9D,QAAA,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;;8GAjLjB,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAApB,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,oBAAoB,cADP,MAAM,EAAA,CAAA,CAAA;;2FACnB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBADhC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACnBlC;;AAEG;;;;"}
|
|
@@ -1667,7 +1667,7 @@ class AXPEntityListViewComponent {
|
|
|
1667
1667
|
this.dataSource.reset();
|
|
1668
1668
|
}
|
|
1669
1669
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityListViewComponent, deps: [{ token: i1$3.AXActionSheetService }, { token: i2.AXUnsubscriber }, { token: i3.AXPlatform }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1670
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: AXPEntityListViewComponent, isStandalone: false, selector: "ng-component", providers: [AXUnsubscriber], viewQueries: [{ propertyName: "viewsTemplate", first: true, predicate: ["viewsTemplate"], descendants: true }, { propertyName: "grid", first: true, predicate: ["grid"], descendants: true }, { propertyName: "entityViewDrawer", first: true, predicate: ["entityViewDrawer"], descendants: true }], ngImport: i0, template: "<ax-drawer-container>\n <!-- <ax-drawer #drawer location=\"start\" [collapsed]=\"true\" [mode]=\"platform.is('SM') ? 'overlay' : 'push'\">\n <ax-content class=\"ax-w-64 ax-border-e\">\n <div class=\"ax-p-6 ax-py-4 ax-gap-6 ax-flex ax-flex-col\">\n <p class=\"ax-text-2xl ax-font-bold\">Folders</p>\n <ax-side-menu>\n <ng-container *ngFor=\"let node of menuItems\" [ngTemplateOutlet]=\"sideMenu\"\n [ngTemplateOutletContext]=\"{ $implicit: node }\">\n </ng-container>\n </ax-side-menu>\n <ng-template #sideMenu let-item>\n <ax-side-menu-item [text]=\"item.text\">\n <ax-prefix>\n <ax-icon class=\"fa-solid fa-folder ax-text-warning-500\"></ax-icon>\n </ax-prefix>\n <ng-container *ngIf=\"item.children\">\n <ng-container *ngFor=\"let child of item.children\" [ngTemplateOutlet]=\"sideMenu\"\n [ngTemplateOutletContext]=\"{ $implicit: child }\">\n </ng-container>\n </ng-container>\n </ax-side-menu-item>\n </ng-template>\n </div>\n </ax-content>\n </ax-drawer> -->\n <ax-content class=\"ax-flex ax-flex-col ax-overflow-hidden\">\n <div\n class=\"ax-flex ax-flex-col ax-gap-0 md:ax-gap-4 ax-px-4 ax-py-3 md:ax-py-4 md:ax-px-6 ax-bg-surface ax-border-b md:ax-border-0 md:ax-bg-default\">\n @if(platform.is('MD') && this.grid){\n <div class=\"ax-flex ax-justify-between ax-mb-4\">\n @if(this.grid.selectedRows.length===0){\n <div class=\"ax-text-xl ax-font-bold\">{{ title }}</div>\n <div class=\"ax-flex ax-items-center ax-gap-2\">\n @if(canCreate) {\n <ax-button color=\"primary\" class=\"ax-sm\" (onClick)=\"handleCreateClick()\">\n <ax-icon class=\"fa-solid fa-add\"></ax-icon>\n </ax-button>\n }\n <ax-button color=\"ghost\" class=\"ax-sm\" #more>\n <ax-icon class=\"fa-solid fa-ellipsis-vertical\"> </ax-icon>\n <ax-dropdown-panel [adaptivityEnabled]=\"true\">\n <ax-button-item-list>\n <ax-button-item text=\"Export\" class=\"ax-font-semibold\">\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-file-export\"> </ax-icon>\n </ax-prefix>\n </ax-button-item>\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n </div>\n }@else {\n <div class=\"ax-flex ax-items-center ax-gap-3\">\n <span class=\"ax-text-xl ax-font-bold\"> {{ this.grid.selectedRows.length }} Items Selected </span>\n <span (click)=\"clearSelectedItems()\"\n class=\"ax-text-sm ax-text-primary dark:ax-text-primary-300 ax-underline ax-cursor-pointer\">Clear\n Items</span>\n </div>\n <div class=\"ax-flex ax-items-center ax-gap-2\">\n @if(canDelete) {\n <ax-button color=\"danger\" class=\"ax-sm\" (onClick)=\"handleCommandClick('delete')\">\n <ax-icon class=\"fa-solid fa-trash\"> </ax-icon>\n </ax-button>\n }\n <ax-button color=\"ghost\" class=\"ax-sm\" #more>\n <ax-icon class=\"fa-solid fa-ellipsis-vertical\"> </ax-icon>\n </ax-button>\n </div>\n }\n </div>\n\n <div class=\"ax-flex ax-items-center ax-justify-between\">\n <ax-button [disabled]=\"this.grid.selectedRows.length != 0\" [text]=\"(view$ | async)?.title\" color=\"ghost\">\n <ax-icon class=\"fa-solid fa-eye ax-text-neutral-400\"> </ax-icon>\n <ax-suffix>\n <i class=\"fa-solid fa-caret-down\"></i>\n </ax-suffix>\n <ax-dropdown-panel [adaptivityEnabled]=\"true\">\n <ax-button-item-list class=\"ax-bg-surface\">\n <ax-title class=\"ax-font-bold ax-opacity-100\">{{ 'entity.public-view' | translate | async }}</ax-title>\n <ax-button-item *ngFor=\"let v of publicViews$ | async\" [text]=\"v.title\"\n [class.ax-bg-on-surface]=\"(view$ | async) == v\" (onClick)=\"loader.setView(v.name)\"></ax-button-item>\n <ax-title class=\"ax-font-bold ax-opacity-100\" *ngIf=\"hasCustomViews$ | async\">Created by me</ax-title>\n <ax-button-item *ngFor=\"let v of customViews$ | async\" [text]=\"v.title\"\n [class.ax-bg-on-surface]=\"(view$ | async) == v\" (onClick)=\"loader.setView(v.name)\"></ax-button-item>\n <ng-container *feature=\"'axp-entity-list-custom-view'\">\n <ax-divider></ax-divider>\n <ax-button-item (onClick)=\"addCustomViewPopup()\" text=\"Add Custom View\"\n class=\"ax-font-semibold ax-text-primary\"></ax-button-item>\n </ng-container>\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n <div class=\"ax-flex ax-gap-2\">\n @if(searchBoxTitle){\n <ax-button (onClick)=\"toggleSearchBox()\" [disabled]=\"this.grid.selectedRows.length != 0\" color=\"ghost\">\n <ax-icon class=\"fa-solid fa-search ax-text-neutral-400\"> </ax-icon>\n </ax-button>\n }\n <ax-button [disabled]=\"this.grid.selectedRows.length != 0\" color=\"ghost\" (onClick)=\"columnsDrawer.open()\">\n <ax-icon class=\"fa-solid fa-bars ax-text-neutral-400\"> </ax-icon>\n </ax-button>\n <ax-button [disabled]=\"this.grid.selectedRows.length != 0\" color=\"ghost\" (onClick)=\"conditionsDrawer.open()\">\n <ax-icon class=\"fa-solid fa-sliders ax-text-neutral-400\"> </ax-icon>\n @if ((conditionsCount$ | async)) {\n <ax-suffix>\n <ax-badge [color]=\"'primary'\"></ax-badge>\n </ax-suffix>\n }\n </ax-button>\n <ax-button [disabled]=\"this.grid.selectedRows.length != 0\" color=\"ghost\" (onClick)=\"sortsDrawer.open()\">\n <ax-icon class=\"fa-solid fa-bars-sort ax-text-neutral-400\"> </ax-icon>\n @if ((sortCount$ | async)) {\n <ax-suffix>\n <ax-badge [color]=\"'primary'\"></ax-badge>\n </ax-suffix>\n }\n </ax-button>\n </div>\n </div>\n <div [class.collapsed-search-box]=\"searchBoxCollapsed\" class=\"ax-transition-all ax-mt-4\">\n <ax-search-box [title]=\"searchBoxTitle\"\n [placeholder]=\"('widget.lookup.search' | translate | async) + searchBoxPlaceholder\"><ax-clear-button></ax-clear-button></ax-search-box>\n </div>\n } @else {\n <div class=\"ax-flex ax-items-center ax-justify-between ax-gap-3\">\n <div class=\"ax-text-xl md:ax-text-2xl ax-font-bold ax-mb-2\">{{ title }}</div>\n @if(this.grid.selectedRows.length==0){\n <div class=\"ax-flex ax-gap-3\">\n @if(canCreate) {\n <ax-button [text]=\"'create-new' | translate | async\" color=\"primary\" (onClick)=\"handleCreateClick()\">\n <ax-prefix>\n <i class=\"fa-solid fa-add\"></i>\n </ax-prefix>\n </ax-button>\n } @let redirectAction = getSingleAction('redirect'); @if(redirectAction) {\n <ax-button [text]=\"redirectAction.title | translate | async\" color=\"primary\"\n (onClick)=\"redirectAction.execute()\">\n <ax-prefix>\n <i class=\"fa-solid fa-add\"></i>\n </ax-prefix>\n </ax-button>\n } @if(canImport){\n <ax-button [text]=\"'entity.actions' | translate | async\" color=\"ghost\">\n <ax-prefix>\n <i class=\"fa-solid fa-ellipsis-vertical\"></i>\n </ax-prefix>\n <ax-dropdown-panel [adaptivityEnabled]=\"true\">\n <ax-button-item-list>\n <ax-button-item (onClick)=\"handleImportClick()\" text=\"Import\" class=\"ax-font-semibold\">\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-file-import\"> </ax-icon>\n </ax-prefix>\n </ax-button-item>\n <!-- <ax-button-item text=\"Export\" class=\"ax-font-semibold\">\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-file-export\"> </ax-icon>\n </ax-prefix>\n </ax-button-item> -->\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n }\n </div>\n }@else {\n <div class=\"ax-flex ax-gap-3\">\n @if(canDelete) {\n <ax-button text=\"Delete Items\" color=\"danger\" (onClick)=\"handleCommandClick('delete')\">\n <ax-prefix>\n <i class=\"fa-solid fa-trash\"></i>\n </ax-prefix>\n </ax-button>\n }\n <ax-button [text]=\"'entity.actions' | translate | async\" color=\"ghost\">\n <ax-prefix>\n <i class=\"fa-solid fa-ellipsis-vertical\"></i>\n </ax-prefix>\n </ax-button>\n </div>\n }\n </div>\n <div class=\"ax-flex ax-items-center ax-justify-between\">\n <!----------------------- View Mode --------------------->\n @if(this.grid.selectedRows.length==0) {\n <div class=\"ax-flex ax-w-full ax-justify-between ax-gap-3\">\n <div class=\"ax-flex ax-gap-3\">\n <ax-button [text]=\"(view$ | async)?.title\" #views color=\"ghost\">\n <ax-prefix>\n <i class=\"fa-solid fa-eye\"></i>\n </ax-prefix>\n <ax-suffix>\n <i class=\"fa-solid fa-caret-down\"></i>\n </ax-suffix>\n <ax-dropdown-panel [adaptivityEnabled]=\"true\">\n <ax-button-item-list class=\"ax-bg-surface\">\n <ax-title class=\"ax-font-bold ax-opacity-100\">{{\n 'entity.public-view' | translate | async\n }}</ax-title>\n <ax-button-item *ngFor=\"let v of publicViews$ | async\" [text]=\"v.title\"\n [class.ax-bg-on-surface]=\"(view$ | async) == v\" (onClick)=\"loader.setView(v.name)\"></ax-button-item>\n <ax-title class=\"ax-font-bold ax-opacity-100\" *ngIf=\"hasCustomViews$ | async\">Created by me</ax-title>\n <ax-button-item class=\"ax-pe-4 ax-flex ax-justify-between\" *ngFor=\"let v of customViews$ | async\"\n [text]=\"v.title\" [class.ax-bg-on-surface]=\"(view$ | async) == v\" (onClick)=\"loader.setView(v.name)\">\n <ax-suffix>\n <ax-button (onClick)=\"updateViewPopup($event, v)\" class=\"ax-xs\" look=\"none\">\n <ax-icon class=\"far fa-edit\"> </ax-icon>\n </ax-button>\n </ax-suffix>\n </ax-button-item>\n <ng-container *feature=\"'axp-entity-list-custom-view'\">\n <ax-divider></ax-divider>\n <ax-button-item text=\"Add Custom View\" (onClick)=\"addCustomViewPopup()\"\n class=\"ax-font-semibold ax-text-primary\"></ax-button-item>\n </ng-container>\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n @if(searchBoxTitle){\n <div class=\"ax-w-72\">\n <ax-search-box [title]=\"searchBoxTitle\" [(ngModel)]=\"searchValue\"\n (onValueChanged)=\"handleChangeSearchValue($event)\"\n [placeholder]=\"('widget.lookup.search' | translate | async) + searchBoxPlaceholder\"><ax-clear-button></ax-clear-button></ax-search-box>\n </div>\n }\n </div>\n\n <div class=\"ax-flex ax-gap-3\">\n <ax-button [text]=\"'entity.columns' | translate | async\" color=\"ghost\" #columns\n (onClick)=\"columnsDrawer.open()\">\n <ax-prefix>\n <i class=\"fa-solid fa-bars\"></i>\n </ax-prefix>\n <ax-suffix>\n <ax-badge text=\"{{ columnsCount$ | async }}\" color=\"primary\"></ax-badge>\n </ax-suffix>\n </ax-button>\n <ax-button text=\"Filters\" color=\"ghost\" (onClick)=\"conditionsDrawer.open()\" #conditions>\n <ax-prefix>\n <i class=\"fa-solid fa-sliders\"></i>\n </ax-prefix>\n <ax-suffix>\n <ax-badge text=\"{{ conditionsCount$ | async }}\" color=\"primary\"></ax-badge>\n </ax-suffix>\n </ax-button>\n <ax-button [text]=\"'entity.sort' | translate | async\" color=\"ghost\" (onClick)=\"sortsDrawer.open()\">\n <ax-prefix>\n <i class=\"fa-solid fa-bars-sort\"></i>\n </ax-prefix>\n <ax-suffix *ngIf=\"(sortCount$ | async)! > 0\">\n <ax-badge text=\"{{ sortCount$ | async }}\" color=\"primary\"></ax-badge>\n </ax-suffix>\n </ax-button>\n </div>\n </div>\n\n } @else{\n <!----------------------- Selection Mode --------------------->\n <div>\n <div class=\"ax-flex ax-gap-3 ax-items-center ax-h-10\">\n <span class=\"ax-text-xl ax-font-bold\"> {{ this.grid.selectedRows.length }} Items Selected </span>\n <span (click)=\"clearSelectedItems()\"\n class=\"ax-text-sm ax-text-primary dark:ax-text-primary-300 ax-underline ax-cursor-pointer\">Clear\n Items</span>\n </div>\n </div>\n }\n </div>\n }\n </div>\n <div class=\"ax-flex-1 ax-px-6 ax-py-4 ax-flex ax-overflow-auto\">\n <ax-data-table #grid [showFooter]=\"false\" class=\"ax-flex-1\" [dataSource]=\"dataSource\" [paging]=\"true\"\n [fetchDataMode]=\"'manual'\" (onRowDbClick)=\"handleRowDbClick($event)\"\n [loading]=\"{ enabled: true, animation: true }\">\n <!-- <ax-index-column *ngIf=\"!platform.is('SM')\" [width]=\"'85px'\"></ax-index-column> -->\n <ax-select-column fixed=\"start\" [width]=\"'50px'\"></ax-select-column>\n @for(col of (columns$ | async);track col.name) {\n <axp-widget-column-renderer *ngIf=\"col.visible\" [schema]=\"col.schema\" [dataField]=\"col.name\"\n [caption]=\"col.title\" [options]=\"col.options\" [displayFormat]=\"col.displayFormat\" [width]=\"'180px'\"\n [allowSorting]=\"false\">\n </axp-widget-column-renderer>\n }\n <ax-dropdown-command-column fixed=\"end\" [width]=\"'60px'\" [items]=\"getDropdownRowItems\"\n (onItemClick)=\"handleRowCommandClick($event)\"></ax-dropdown-command-column>\n <ax-command-column fixed=\"end\" [width]=\"'60px'\" [items]=\"getInlineRowItems\"\n (onItemClick)=\"handleRowCommandClick($event)\"></ax-command-column>\n </ax-data-table>\n </div>\n </ax-content>\n <ax-drawer (collapsedChange)=\"closeDrawer('columns', $event)\" #columnsDrawer location=\"end\" [mode]=\"'overlay'\">\n <ax-content class=\"ax-w-[85vw] md:ax-w-[45vw] lg:ax-w-[35vw] 2xl:ax-w-[20vw] ax-border-e\">\n <axp-list-view-option-columns [loader]=\"loader\" (onClosed)=\"columnsDrawer.close()\"></axp-list-view-option-columns>\n </ax-content>\n </ax-drawer>\n <ax-drawer (collapsedChange)=\"closeDrawer('conditions', $event)\" #conditionsDrawer location=\"end\" [mode]=\"'overlay'\">\n <ax-content class=\"ax-w-[85vw] md:ax-w-[45vw] lg:ax-w-[35vw] 2xl:ax-w-[25vw] ax-border-e\">\n <axp-list-view-option-conditions [loader]=\"loader\"\n (onClosed)=\"conditionsDrawer.close()\"></axp-list-view-option-conditions>\n </ax-content>\n </ax-drawer>\n <ax-drawer (collapsedChange)=\"closeDrawer('sorts', $event)\" #sortsDrawer location=\"end\" [mode]=\"'overlay'\">\n <ax-content class=\"ax-w-[85vw] md:ax-w-[45vw] lg:ax-w-[35vw] 2xl:ax-w-[20vw] ax-border-e\">\n <axp-list-view-option-sorting (onClosed)=\"sortsDrawer.close()\" [loader]=\"loader\"></axp-list-view-option-sorting>\n </ax-content>\n </ax-drawer>\n</ax-drawer-container>", styles: [".cdk-drag-preview{border-radius:.375rem;border-width:1px;--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);background:rgba(var(--ax-color-on-surface));padding:.5rem;height:max-content!important}.collapsed-search-box{margin-top:0;height:0px;opacity:0}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6$2.AXDataTableComponent, selector: "ax-data-table", inputs: ["dataSource", "rowTemplate", "emptyTemplate", "alternative", "showHeader", "fixedHeader", "showFooter", "fixedFooter", "itemHeight", "allowReordering", "paging", "fetchDataMode", "loading", "focusedRow"], outputs: ["selectedRowsChange", "focusedRowChange", "onRowClick", "onRowDbClick", "onColumnsOrderChanged"] }, { kind: "component", type: i6$2.AXRowSelectColumnComponent, selector: "ax-select-column", inputs: ["width", "caption", "fixed"] }, { kind: "component", type: i6$2.AXRowCommandColumnComponent, selector: "ax-command-column", inputs: ["width", "caption", "fixed", "footerTemplate", "items"], outputs: ["onItemClick"] }, { kind: "component", type: i6$2.AXRowDropdownCommandColumnComponent, selector: "ax-dropdown-command-column", inputs: ["width", "caption", "fixed", "footerTemplate", "items"], outputs: ["onItemClick"] }, { kind: "component", type: i4.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "type", "responsiveOn", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "responsiveOnChange", "loadingTextChange"] }, { kind: "component", type: i4.AXButtonItemComponent, selector: "ax-button-item", inputs: ["color", "disabled", "text", "selected", "divided", "data", "name"], outputs: ["onClick", "onFocus", "onBlur", "disabledChange"] }, { kind: "component", type: i4.AXButtonItemListComponent, selector: "ax-button-item-list", inputs: ["items"], outputs: ["onItemClick"] }, { kind: "component", type: i4$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i4$1.AXDecoratorClearButtonComponent, selector: "ax-clear-button", inputs: ["icon"] }, { kind: "component", type: i4$1.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-sub-title, ax-placeholder, ax-overlay" }, { kind: "component", type: i5.AXBadgeComponent, selector: "ax-badge", inputs: ["color", "look", "text"] }, { kind: "component", type: i6.AXDropdownPanelComponent, selector: "ax-dropdown-panel", inputs: ["isOpen", "fitParent", "dropdownWidth", "position", "_target", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "component", type: i11.AXDrawerComponent, selector: "ax-drawer", inputs: ["location", "showBackdrop", "mode", "closeOthers", "collapsed"], outputs: ["locationChange", "modeChange", "collapsedChange"] }, { kind: "component", type: i11.AXDrawerContainerComponent, selector: "ax-drawer-container" }, { kind: "component", type: i12.AXSearchBoxComponent, selector: "ax-search-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "value", "state", "name", "id", "look", "delayTime"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "component", type: i10.AXPWidgetColumnRendererComponent, selector: "axp-widget-column-renderer", inputs: ["width", "caption", "headerTemplate", "allowSorting", "fixed", "footerTemplate", "cellTemplate", "options", "dataField", "displayFormat", "schema"] }, { kind: "directive", type: i14$1.AXPFeatureDirective, selector: "[feature]", inputs: ["feature", "featureElse"] }, { kind: "component", type: AXPListViewOptionsColumnsComponent, selector: "axp-list-view-option-columns", inputs: ["loader"], outputs: ["onClosed"] }, { kind: "component", type: AXPListViewOptionConditionsComponent, selector: "axp-list-view-option-conditions", inputs: ["loader"], outputs: ["onClosed"] }, { kind: "component", type: AXPListViewOptionSortingComponent, selector: "axp-list-view-option-sorting", inputs: ["loader"], outputs: ["onClosed"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i8.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1670
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: AXPEntityListViewComponent, isStandalone: false, selector: "ng-component", providers: [AXUnsubscriber], viewQueries: [{ propertyName: "viewsTemplate", first: true, predicate: ["viewsTemplate"], descendants: true }, { propertyName: "grid", first: true, predicate: ["grid"], descendants: true }, { propertyName: "entityViewDrawer", first: true, predicate: ["entityViewDrawer"], descendants: true }], ngImport: i0, template: "<ax-drawer-container>\n <!-- <ax-drawer #drawer location=\"start\" [collapsed]=\"true\" [mode]=\"platform.is('SM') ? 'overlay' : 'push'\">\n <ax-content class=\"ax-w-64 ax-border-e\">\n <div class=\"ax-p-6 ax-py-4 ax-gap-6 ax-flex ax-flex-col\">\n <p class=\"ax-text-2xl ax-font-bold\">Folders</p>\n <ax-side-menu>\n <ng-container *ngFor=\"let node of menuItems\" [ngTemplateOutlet]=\"sideMenu\"\n [ngTemplateOutletContext]=\"{ $implicit: node }\">\n </ng-container>\n </ax-side-menu>\n <ng-template #sideMenu let-item>\n <ax-side-menu-item [text]=\"item.text\">\n <ax-prefix>\n <ax-icon class=\"fa-solid fa-folder ax-text-warning-500\"></ax-icon>\n </ax-prefix>\n <ng-container *ngIf=\"item.children\">\n <ng-container *ngFor=\"let child of item.children\" [ngTemplateOutlet]=\"sideMenu\"\n [ngTemplateOutletContext]=\"{ $implicit: child }\">\n </ng-container>\n </ng-container>\n </ax-side-menu-item>\n </ng-template>\n </div>\n </ax-content>\n </ax-drawer> -->\n <ax-content class=\"ax-flex ax-flex-col ax-overflow-hidden\">\n <div\n class=\"ax-flex ax-flex-col ax-gap-0 md:ax-gap-4 ax-px-4 ax-py-3 md:ax-py-4 md:ax-px-6 ax-bg-surface ax-border-b md:ax-border-0 md:ax-bg-default\">\n @if(platform.is('MD') && this.grid){\n <div class=\"ax-flex ax-justify-between ax-mb-4\">\n @if(this.grid.selectedRows.length===0){\n <div class=\"ax-text-xl ax-font-bold\">{{ title }}</div>\n <div class=\"ax-flex ax-items-center ax-gap-2\">\n @if(canCreate) {\n <ax-button color=\"primary\" class=\"ax-sm\" (onClick)=\"handleCreateClick()\">\n <ax-icon class=\"fa-solid fa-add\"></ax-icon>\n </ax-button>\n }\n <ax-button color=\"ghost\" class=\"ax-sm\" #more>\n <ax-icon class=\"fa-solid fa-ellipsis-vertical\"> </ax-icon>\n <ax-dropdown-panel [adaptivityEnabled]=\"true\">\n <ax-button-item-list>\n <ax-button-item text=\"Export\" class=\"ax-font-semibold\">\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-file-export\"> </ax-icon>\n </ax-prefix>\n </ax-button-item>\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n </div>\n }@else {\n <div class=\"ax-flex ax-items-center ax-gap-3\">\n <span class=\"ax-text-xl ax-font-bold\"> {{ this.grid.selectedRows.length }} Items Selected </span>\n <span (click)=\"clearSelectedItems()\"\n class=\"ax-text-sm ax-text-primary dark:ax-text-primary-300 ax-underline ax-cursor-pointer\">Clear\n Items</span>\n </div>\n <div class=\"ax-flex ax-items-center ax-gap-2\">\n @if(canDelete) {\n <ax-button color=\"danger\" class=\"ax-sm\" (onClick)=\"handleCommandClick('delete')\">\n <ax-icon class=\"fa-solid fa-trash\"> </ax-icon>\n </ax-button>\n }\n <ax-button color=\"ghost\" class=\"ax-sm\" #more>\n <ax-icon class=\"fa-solid fa-ellipsis-vertical\"> </ax-icon>\n </ax-button>\n </div>\n }\n </div>\n\n <div class=\"ax-flex ax-items-center ax-justify-between\">\n <ax-button [disabled]=\"this.grid.selectedRows.length != 0\" [text]=\"(view$ | async)?.title\" color=\"ghost\">\n <ax-icon class=\"fa-solid fa-eye ax-text-neutral-400\"> </ax-icon>\n <ax-suffix>\n <i class=\"fa-solid fa-caret-down\"></i>\n </ax-suffix>\n <ax-dropdown-panel [adaptivityEnabled]=\"true\">\n <ax-button-item-list class=\"ax-bg-surface\">\n <ax-title class=\"ax-font-bold ax-opacity-100\">{{ 'entity.public-view' | translate | async }}</ax-title>\n <ax-button-item *ngFor=\"let v of publicViews$ | async\" [text]=\"v.title\"\n [class.ax-bg-on-surface]=\"(view$ | async) == v\" (onClick)=\"loader.setView(v.name)\"></ax-button-item>\n <ax-title class=\"ax-font-bold ax-opacity-100\" *ngIf=\"hasCustomViews$ | async\">Created by me</ax-title>\n <ax-button-item *ngFor=\"let v of customViews$ | async\" [text]=\"v.title\"\n [class.ax-bg-on-surface]=\"(view$ | async) == v\" (onClick)=\"loader.setView(v.name)\"></ax-button-item>\n <ng-container *feature=\"'axp-entity-list-custom-view'\">\n <ax-divider></ax-divider>\n <ax-button-item (onClick)=\"addCustomViewPopup()\" text=\"Add Custom View\"\n class=\"ax-font-semibold ax-text-primary\"></ax-button-item>\n </ng-container>\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n <div class=\"ax-flex ax-gap-2\">\n @if(searchBoxTitle){\n <ax-button (onClick)=\"toggleSearchBox()\" [disabled]=\"this.grid.selectedRows.length != 0\" color=\"ghost\">\n <ax-icon class=\"fa-solid fa-search ax-text-neutral-400\"> </ax-icon>\n </ax-button>\n }\n <ax-button [disabled]=\"this.grid.selectedRows.length != 0\" color=\"ghost\" (onClick)=\"columnsDrawer.open()\">\n <ax-icon class=\"fa-solid fa-bars ax-text-neutral-400\"> </ax-icon>\n </ax-button>\n <ax-button [disabled]=\"this.grid.selectedRows.length != 0\" color=\"ghost\" (onClick)=\"conditionsDrawer.open()\">\n <ax-icon class=\"fa-solid fa-sliders ax-text-neutral-400\"> </ax-icon>\n @if ((conditionsCount$ | async)) {\n <ax-suffix>\n <ax-badge [color]=\"'primary'\"></ax-badge>\n </ax-suffix>\n }\n </ax-button>\n <ax-button [disabled]=\"this.grid.selectedRows.length != 0\" color=\"ghost\" (onClick)=\"sortsDrawer.open()\">\n <ax-icon class=\"fa-solid fa-bars-sort ax-text-neutral-400\"> </ax-icon>\n @if ((sortCount$ | async)) {\n <ax-suffix>\n <ax-badge [color]=\"'primary'\"></ax-badge>\n </ax-suffix>\n }\n </ax-button>\n </div>\n </div>\n <div [class.collapsed-search-box]=\"searchBoxCollapsed\" class=\"ax-transition-all ax-mt-4\">\n <ax-search-box [title]=\"searchBoxTitle\"\n [placeholder]=\"('widget.lookup.search' | translate | async) + searchBoxPlaceholder\"><ax-clear-button></ax-clear-button></ax-search-box>\n </div>\n } @else {\n <div class=\"ax-flex ax-items-center ax-justify-between ax-gap-3\">\n <div class=\"ax-text-xl md:ax-text-2xl ax-font-bold ax-mb-2\">{{ title }}</div>\n @if(this.grid.selectedRows.length==0){\n <div class=\"ax-flex ax-gap-3\">\n @if(canCreate) {\n <ax-button [text]=\"'create-new' | translate | async\" color=\"primary\" (onClick)=\"handleCreateClick()\">\n <ax-prefix>\n <i class=\"fa-solid fa-add\"></i>\n </ax-prefix>\n </ax-button>\n } @let redirectAction = getSingleAction('redirect'); @if(redirectAction) {\n <ax-button [text]=\"redirectAction.title | translate | async\" color=\"primary\"\n (onClick)=\"redirectAction.execute()\">\n <ax-prefix>\n <i class=\"fa-solid fa-add\"></i>\n </ax-prefix>\n </ax-button>\n } @if(canImport){\n <ax-button [text]=\"'entity.actions' | translate | async\" color=\"ghost\">\n <ax-prefix>\n <i class=\"fa-solid fa-ellipsis-vertical\"></i>\n </ax-prefix>\n <ax-dropdown-panel [adaptivityEnabled]=\"true\">\n <ax-button-item-list>\n <ax-button-item (onClick)=\"handleImportClick()\" text=\"Import\" class=\"ax-font-semibold\">\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-file-import\"> </ax-icon>\n </ax-prefix>\n </ax-button-item>\n <!-- <ax-button-item text=\"Export\" class=\"ax-font-semibold\">\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-file-export\"> </ax-icon>\n </ax-prefix>\n </ax-button-item> -->\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n }\n </div>\n }@else {\n <div class=\"ax-flex ax-gap-3\">\n @if(canDelete) {\n <ax-button text=\"Delete Items\" color=\"danger\" (onClick)=\"handleCommandClick('delete')\">\n <ax-prefix>\n <i class=\"fa-solid fa-trash\"></i>\n </ax-prefix>\n </ax-button>\n }\n <ax-button [text]=\"'entity.actions' | translate | async\" color=\"ghost\">\n <ax-prefix>\n <i class=\"fa-solid fa-ellipsis-vertical\"></i>\n </ax-prefix>\n </ax-button>\n </div>\n }\n </div>\n <div class=\"ax-flex ax-items-center ax-justify-between\">\n <!----------------------- View Mode --------------------->\n @if(this.grid.selectedRows.length==0) {\n <div class=\"ax-flex ax-w-full ax-justify-between ax-gap-3\">\n <div class=\"ax-flex ax-gap-3\">\n <ax-button [text]=\"(view$ | async)?.title\" #views color=\"ghost\">\n <ax-prefix>\n <i class=\"fa-solid fa-eye\"></i>\n </ax-prefix>\n <ax-suffix>\n <i class=\"fa-solid fa-caret-down\"></i>\n </ax-suffix>\n <ax-dropdown-panel [adaptivityEnabled]=\"true\">\n <ax-button-item-list class=\"ax-bg-surface\">\n <ax-title class=\"ax-font-bold ax-opacity-100\">{{\n 'entity.public-view' | translate | async\n }}</ax-title>\n <ax-button-item *ngFor=\"let v of publicViews$ | async\" [text]=\"v.title\"\n [class.ax-bg-on-surface]=\"(view$ | async) == v\" (onClick)=\"loader.setView(v.name)\"></ax-button-item>\n <ax-title class=\"ax-font-bold ax-opacity-100\" *ngIf=\"hasCustomViews$ | async\">Created by me</ax-title>\n <ax-button-item class=\"ax-pe-4 ax-flex ax-justify-between\" *ngFor=\"let v of customViews$ | async\"\n [text]=\"v.title\" [class.ax-bg-on-surface]=\"(view$ | async) == v\" (onClick)=\"loader.setView(v.name)\">\n <ax-suffix>\n <ax-button (onClick)=\"updateViewPopup($event, v)\" class=\"ax-xs\" look=\"none\">\n <ax-icon class=\"far fa-edit\"> </ax-icon>\n </ax-button>\n </ax-suffix>\n </ax-button-item>\n <ng-container *feature=\"'axp-entity-list-custom-view'\">\n <ax-divider></ax-divider>\n <ax-button-item text=\"Add Custom View\" (onClick)=\"addCustomViewPopup()\"\n class=\"ax-font-semibold ax-text-primary\"></ax-button-item>\n </ng-container>\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n @if(searchBoxTitle){\n <div class=\"ax-w-72\">\n <ax-search-box [title]=\"searchBoxTitle\" [(ngModel)]=\"searchValue\"\n (onValueChanged)=\"handleChangeSearchValue($event)\"\n [placeholder]=\"('widget.lookup.search' | translate | async) + searchBoxPlaceholder\"><ax-clear-button></ax-clear-button></ax-search-box>\n </div>\n }\n </div>\n\n <div class=\"ax-flex ax-gap-3\">\n <ax-button [text]=\"'entity.columns' | translate | async\" color=\"ghost\" #columns\n (onClick)=\"columnsDrawer.open()\">\n <ax-prefix>\n <i class=\"fa-solid fa-bars\"></i>\n </ax-prefix>\n <ax-suffix>\n <ax-badge text=\"{{ columnsCount$ | async }}\" color=\"primary\"></ax-badge>\n </ax-suffix>\n </ax-button>\n <ax-button text=\"Filters\" color=\"ghost\" (onClick)=\"conditionsDrawer.open()\" #conditions>\n <ax-prefix>\n <i class=\"fa-solid fa-sliders\"></i>\n </ax-prefix>\n <ax-suffix>\n <ax-badge text=\"{{ conditionsCount$ | async }}\" color=\"primary\"></ax-badge>\n </ax-suffix>\n </ax-button>\n <ax-button [text]=\"'entity.sort' | translate | async\" color=\"ghost\" (onClick)=\"sortsDrawer.open()\">\n <ax-prefix>\n <i class=\"fa-solid fa-bars-sort\"></i>\n </ax-prefix>\n <ax-suffix *ngIf=\"(sortCount$ | async)! > 0\">\n <ax-badge text=\"{{ sortCount$ | async }}\" color=\"primary\"></ax-badge>\n </ax-suffix>\n </ax-button>\n </div>\n </div>\n\n } @else{\n <!----------------------- Selection Mode --------------------->\n <div>\n <div class=\"ax-flex ax-gap-3 ax-items-center ax-h-10\">\n <span class=\"ax-text-xl ax-font-bold\"> {{ this.grid.selectedRows.length }} Items Selected </span>\n <span (click)=\"clearSelectedItems()\"\n class=\"ax-text-sm ax-text-primary dark:ax-text-primary-300 ax-underline ax-cursor-pointer\">Clear\n Items</span>\n </div>\n </div>\n }\n </div>\n }\n </div>\n <div class=\"ax-flex-1 ax-px-6 ax-py-4 ax-flex ax-overflow-auto\">\n <ax-data-table #grid [showFooter]=\"false\" class=\"ax-flex-1\" [dataSource]=\"dataSource\" [paging]=\"true\"\n [fetchDataMode]=\"'manual'\" (onRowDbClick)=\"handleRowDbClick($event)\"\n [loading]=\"{ enabled: true, animation: true }\">\n <!-- <ax-index-column *ngIf=\"!platform.is('SM')\" [width]=\"'85px'\"></ax-index-column> -->\n <ax-select-column fixed=\"start\" [width]=\"'50px'\"></ax-select-column>\n @for(col of (columns$ | async);track col.name) {\n <axp-widget-column-renderer *ngIf=\"col.visible\" [schema]=\"col.schema\" [dataField]=\"col.name\"\n [caption]=\"col.title\" [options]=\"col.options\" [displayFormat]=\"col.displayFormat\" [width]=\"'180px'\"\n [allowSorting]=\"false\">\n </axp-widget-column-renderer>\n }\n <ax-dropdown-command-column fixed=\"end\" [width]=\"'60px'\" [items]=\"getDropdownRowItems\"\n (onItemClick)=\"handleRowCommandClick($event)\"></ax-dropdown-command-column>\n <ax-command-column fixed=\"end\" [width]=\"'60px'\" [items]=\"getInlineRowItems\"\n (onItemClick)=\"handleRowCommandClick($event)\"></ax-command-column>\n </ax-data-table>\n </div>\n </ax-content>\n <ax-drawer (collapsedChange)=\"closeDrawer('columns', $event)\" #columnsDrawer location=\"end\" [mode]=\"'overlay'\">\n <ax-content class=\"ax-w-[85vw] md:ax-w-[45vw] lg:ax-w-[35vw] 2xl:ax-w-[20vw] ax-border-e\">\n <axp-list-view-option-columns [loader]=\"loader\" (onClosed)=\"columnsDrawer.close()\"></axp-list-view-option-columns>\n </ax-content>\n </ax-drawer>\n <ax-drawer (collapsedChange)=\"closeDrawer('conditions', $event)\" #conditionsDrawer location=\"end\" [mode]=\"'overlay'\">\n <ax-content class=\"ax-w-[85vw] md:ax-w-[45vw] lg:ax-w-[35vw] 2xl:ax-w-[25vw] ax-border-e\">\n <axp-list-view-option-conditions [loader]=\"loader\"\n (onClosed)=\"conditionsDrawer.close()\"></axp-list-view-option-conditions>\n </ax-content>\n </ax-drawer>\n <ax-drawer (collapsedChange)=\"closeDrawer('sorts', $event)\" #sortsDrawer location=\"end\" [mode]=\"'overlay'\">\n <ax-content class=\"ax-w-[85vw] md:ax-w-[45vw] lg:ax-w-[35vw] 2xl:ax-w-[20vw] ax-border-e\">\n <axp-list-view-option-sorting (onClosed)=\"sortsDrawer.close()\" [loader]=\"loader\"></axp-list-view-option-sorting>\n </ax-content>\n </ax-drawer>\n</ax-drawer-container>", styles: [".cdk-drag-preview{border-radius:.375rem;border-width:1px;--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);background:rgba(var(--ax-color-on-surface));padding:.5rem;height:max-content!important}.collapsed-search-box{margin-top:0;height:0px;opacity:0}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6$2.AXDataTableComponent, selector: "ax-data-table", inputs: ["dataSource", "parentField", "rowTemplate", "emptyTemplate", "alternative", "showHeader", "fixedHeader", "showFooter", "fixedFooter", "itemHeight", "allowReordering", "paging", "fetchDataMode", "loading", "focusedRow"], outputs: ["selectedRowsChange", "focusedRowChange", "onRowClick", "onRowDbClick", "onColumnsOrderChanged", "onColumnSizeChanged"] }, { kind: "component", type: i6$2.AXRowSelectColumnComponent, selector: "ax-select-column", inputs: ["width", "caption", "fixed"] }, { kind: "component", type: i6$2.AXRowCommandColumnComponent, selector: "ax-command-column", inputs: ["width", "caption", "fixed", "footerTemplate", "items"], outputs: ["onItemClick"] }, { kind: "component", type: i6$2.AXRowDropdownCommandColumnComponent, selector: "ax-dropdown-command-column", inputs: ["width", "caption", "fixed", "footerTemplate", "items"], outputs: ["onItemClick"] }, { kind: "component", type: i4.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "type", "responsiveOn", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "responsiveOnChange", "loadingTextChange"] }, { kind: "component", type: i4.AXButtonItemComponent, selector: "ax-button-item", inputs: ["color", "disabled", "text", "selected", "divided", "data", "name"], outputs: ["onClick", "onFocus", "onBlur", "disabledChange"] }, { kind: "component", type: i4.AXButtonItemListComponent, selector: "ax-button-item-list", inputs: ["items"], outputs: ["onItemClick"] }, { kind: "component", type: i4$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i4$1.AXDecoratorClearButtonComponent, selector: "ax-clear-button", inputs: ["icon"] }, { kind: "component", type: i4$1.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-sub-title, ax-placeholder, ax-overlay" }, { kind: "component", type: i5.AXBadgeComponent, selector: "ax-badge", inputs: ["color", "look", "text"] }, { kind: "component", type: i6.AXDropdownPanelComponent, selector: "ax-dropdown-panel", inputs: ["isOpen", "fitParent", "dropdownWidth", "position", "_target", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "component", type: i11.AXDrawerComponent, selector: "ax-drawer", inputs: ["location", "showBackdrop", "mode", "closeOthers", "collapsed"], outputs: ["locationChange", "modeChange", "collapsedChange"] }, { kind: "component", type: i11.AXDrawerContainerComponent, selector: "ax-drawer-container" }, { kind: "component", type: i12.AXSearchBoxComponent, selector: "ax-search-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "value", "state", "name", "id", "look", "delayTime"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "component", type: i10.AXPWidgetColumnRendererComponent, selector: "axp-widget-column-renderer", inputs: ["width", "caption", "headerTemplate", "allowSorting", "fixed", "footerTemplate", "cellTemplate", "options", "dataField", "displayFormat", "schema"] }, { kind: "directive", type: i14$1.AXPFeatureDirective, selector: "[feature]", inputs: ["feature", "featureElse"] }, { kind: "component", type: AXPListViewOptionsColumnsComponent, selector: "axp-list-view-option-columns", inputs: ["loader"], outputs: ["onClosed"] }, { kind: "component", type: AXPListViewOptionConditionsComponent, selector: "axp-list-view-option-conditions", inputs: ["loader"], outputs: ["onClosed"] }, { kind: "component", type: AXPListViewOptionSortingComponent, selector: "axp-list-view-option-sorting", inputs: ["loader"], outputs: ["onClosed"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i8.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1671
1671
|
}
|
|
1672
1672
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityListViewComponent, decorators: [{
|
|
1673
1673
|
type: Component,
|