@acorex/platform 20.2.4-next.0 → 20.2.4-next.1
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/index.d.ts +82 -1
- package/core/index.d.ts +24 -2
- package/fesm2022/acorex-platform-common.mjs +1 -1
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-builder.mjs +47 -5
- package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-components.mjs +943 -39
- package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-designer.mjs +15 -122
- package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-entity.mjs +1290 -564
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-views.mjs +83 -40
- package/fesm2022/acorex-platform-layout-views.mjs.map +1 -1
- package/fesm2022/{acorex-platform-themes-default-entity-master-list-view.component-ezrf2oBR.mjs → acorex-platform-themes-default-entity-master-list-view.component-DXGLsVis.mjs} +174 -50
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-DXGLsVis.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-entity-master-single-view.component-D8r3S2lI.mjs → acorex-platform-themes-default-entity-master-single-view.component-CVaJzWb2.mjs} +14 -11
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-CVaJzWb2.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default.mjs +19 -7
- package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
- package/fesm2022/{acorex-platform-themes-shared-color-chooser-column.component-DjKLg513.mjs → acorex-platform-themes-shared-theme-color-chooser-column.component-DjKLg513.mjs} +1 -1
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-DjKLg513.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-shared-color-chooser-view.component-DE0wO98F.mjs → acorex-platform-themes-shared-theme-color-chooser-view.component-DE0wO98F.mjs} +1 -1
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-DE0wO98F.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-shared.mjs +10 -12
- package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
- package/fesm2022/acorex-platform-widgets-extra-properties-schema-widget-edit.component-B3SJUnGQ.mjs +50 -0
- package/fesm2022/acorex-platform-widgets-extra-properties-schema-widget-edit.component-B3SJUnGQ.mjs.map +1 -0
- package/fesm2022/acorex-platform-widgets-extra-properties-schema-widget-view.component-BLR0JkRt.mjs +42 -0
- package/fesm2022/acorex-platform-widgets-extra-properties-schema-widget-view.component-BLR0JkRt.mjs.map +1 -0
- package/fesm2022/acorex-platform-widgets-extra-properties-values-widget-edit.component-hzR2FgOm.mjs +55 -0
- package/fesm2022/acorex-platform-widgets-extra-properties-values-widget-edit.component-hzR2FgOm.mjs.map +1 -0
- package/fesm2022/acorex-platform-widgets-extra-properties-values-widget-view.component-IDm6Clua.mjs +50 -0
- package/fesm2022/acorex-platform-widgets-extra-properties-values-widget-view.component-IDm6Clua.mjs.map +1 -0
- package/fesm2022/acorex-platform-widgets-extra-properties-widget-edit.component-BRO9tYDa.mjs +48 -0
- package/fesm2022/acorex-platform-widgets-extra-properties-widget-edit.component-BRO9tYDa.mjs.map +1 -0
- package/fesm2022/acorex-platform-widgets-extra-properties-widget-view.component-CkpLimyW.mjs +42 -0
- package/fesm2022/acorex-platform-widgets-extra-properties-widget-view.component-CkpLimyW.mjs.map +1 -0
- package/fesm2022/{acorex-platform-widgets-file-list-popup.component-DFbPO0ud.mjs → acorex-platform-widgets-file-list-popup.component-B601gPsW.mjs} +66 -3
- package/fesm2022/acorex-platform-widgets-file-list-popup.component-B601gPsW.mjs.map +1 -0
- package/fesm2022/acorex-platform-widgets.mjs +770 -118
- package/fesm2022/acorex-platform-widgets.mjs.map +1 -1
- package/fesm2022/acorex-platform-workflow.mjs +3 -0
- package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
- package/layout/builder/index.d.ts +12 -2
- package/layout/components/index.d.ts +172 -6
- package/layout/designer/index.d.ts +3 -46
- package/layout/entity/index.d.ts +70 -7
- package/layout/views/index.d.ts +25 -7
- package/package.json +1 -1
- package/themes/default/index.d.ts +4 -1
- package/widgets/index.d.ts +20 -11
- package/workflow/index.d.ts +3 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-ezrf2oBR.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-D8r3S2lI.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-color-chooser-column.component-DjKLg513.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-color-chooser-view.component-DE0wO98F.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-file-list-popup.component-DFbPO0ud.mjs.map +0 -1
|
@@ -13,6 +13,7 @@ import { AXButtonModule } from '@acorex/components/button';
|
|
|
13
13
|
import * as i2 from '@acorex/components/decorators';
|
|
14
14
|
import { AXDecoratorModule } from '@acorex/components/decorators';
|
|
15
15
|
import { AXDialogModule } from '@acorex/components/dialog';
|
|
16
|
+
import * as i5 from '@acorex/components/dropdown';
|
|
16
17
|
import { AXDropdownModule } from '@acorex/components/dropdown';
|
|
17
18
|
import { AXFormModule } from '@acorex/components/form';
|
|
18
19
|
import { AXLoadingModule } from '@acorex/components/loading';
|
|
@@ -40,12 +41,14 @@ import * as i3 from '@acorex/components/skeleton';
|
|
|
40
41
|
import { AXSkeletonModule } from '@acorex/components/skeleton';
|
|
41
42
|
import * as i2$1 from '@acorex/components/tree-view';
|
|
42
43
|
import { AXTreeViewModule } from '@acorex/components/tree-view';
|
|
44
|
+
import { AXPWorkflowService } from '@acorex/platform/workflow';
|
|
43
45
|
import { AXPEntityResolver, AXPEntityListViewColumnViewModel } from '@acorex/platform/layout/entity';
|
|
44
46
|
|
|
45
47
|
class AXPEntityCategoryComponent {
|
|
46
48
|
constructor() {
|
|
47
49
|
this.entityResolver = inject(AXPEntityResolver);
|
|
48
50
|
this.translate = inject(AXTranslationService);
|
|
51
|
+
this.workflow = inject(AXPWorkflowService);
|
|
49
52
|
this.vm = input.required(...(ngDevMode ? [{ debugName: "vm" }] : []));
|
|
50
53
|
this.tree = viewChild('tree', ...(ngDevMode ? [{ debugName: "tree" }] : []));
|
|
51
54
|
this.searchValue = input('', ...(ngDevMode ? [{ debugName: "searchValue" }] : []));
|
|
@@ -115,35 +118,7 @@ class AXPEntityCategoryComponent {
|
|
|
115
118
|
this.isLoading.set(false);
|
|
116
119
|
}
|
|
117
120
|
async handleCollapseChanged(e) {
|
|
118
|
-
this.
|
|
119
|
-
const event = {
|
|
120
|
-
...this.basicQueryEvent,
|
|
121
|
-
filter: {
|
|
122
|
-
field: this.categoryEntityDef?.parentKey,
|
|
123
|
-
value: e.data.id,
|
|
124
|
-
operator: {
|
|
125
|
-
type: 'equal',
|
|
126
|
-
},
|
|
127
|
-
},
|
|
128
|
-
};
|
|
129
|
-
const children = await this.categoryEntityQueryFunc(event);
|
|
130
|
-
// Recursive function to update children at any depth
|
|
131
|
-
const updateChildrenAtPath = (items, targetId) => {
|
|
132
|
-
return items.map((item) => {
|
|
133
|
-
if (item.id === targetId) {
|
|
134
|
-
return { ...item, children: children.items };
|
|
135
|
-
}
|
|
136
|
-
if (item.children?.length) {
|
|
137
|
-
return { ...item, children: updateChildrenAtPath(item.children, targetId) };
|
|
138
|
-
}
|
|
139
|
-
return item;
|
|
140
|
-
});
|
|
141
|
-
};
|
|
142
|
-
this.treeItems.update((prev) => prev.map((i) => ({
|
|
143
|
-
...i,
|
|
144
|
-
children: updateChildrenAtPath(prev[0].children, e.data.id),
|
|
145
|
-
})));
|
|
146
|
-
this.tree()?.setNodeLoading(e.data.id, false);
|
|
121
|
+
await this.loadChildrenAtNode(e.data.id);
|
|
147
122
|
}
|
|
148
123
|
async getCategoryEntityDef() {
|
|
149
124
|
const [module, entity] = this.vm().entityDef.category?.entity?.split('.') || [];
|
|
@@ -152,7 +127,6 @@ class AXPEntityCategoryComponent {
|
|
|
152
127
|
handleNodeClick(event) {
|
|
153
128
|
const filters = this.vm()
|
|
154
129
|
.entityDef.category?.applyConditions?.map((f) => {
|
|
155
|
-
console.log({ f });
|
|
156
130
|
return event.data[f.value] !== 'all'
|
|
157
131
|
? {
|
|
158
132
|
field: f.name,
|
|
@@ -174,8 +148,98 @@ class AXPEntityCategoryComponent {
|
|
|
174
148
|
});
|
|
175
149
|
this.vm().dataSource.refresh();
|
|
176
150
|
}
|
|
151
|
+
//#region ---- Utility Methods ----
|
|
152
|
+
/** Loads children for a given node id and updates the tree in place. */
|
|
153
|
+
async loadChildrenAtNode(targetId) {
|
|
154
|
+
this.tree()?.setNodeLoading(targetId, true);
|
|
155
|
+
const event = {
|
|
156
|
+
...this.basicQueryEvent,
|
|
157
|
+
filter: {
|
|
158
|
+
field: this.categoryEntityDef?.parentKey,
|
|
159
|
+
value: targetId,
|
|
160
|
+
operator: { type: 'equal' },
|
|
161
|
+
},
|
|
162
|
+
};
|
|
163
|
+
const children = await this.categoryEntityQueryFunc(event);
|
|
164
|
+
const updateChildrenAtPath = (items, id) => {
|
|
165
|
+
return items.map((item) => {
|
|
166
|
+
if (item.id === id) {
|
|
167
|
+
return { ...item, children: children.items };
|
|
168
|
+
}
|
|
169
|
+
if (item.children?.length) {
|
|
170
|
+
return { ...item, children: updateChildrenAtPath(item.children, id) };
|
|
171
|
+
}
|
|
172
|
+
return item;
|
|
173
|
+
});
|
|
174
|
+
};
|
|
175
|
+
this.treeItems.update((prev) => prev.map((i) => ({ ...i, children: updateChildrenAtPath(prev[0].children, targetId) })));
|
|
176
|
+
this.tree()?.setNodeLoading(targetId, false);
|
|
177
|
+
}
|
|
178
|
+
/** Returns the module.entity key for the configured category entity. */
|
|
179
|
+
getCategoryEntityKey() {
|
|
180
|
+
return this.vm().entityDef.category?.entity;
|
|
181
|
+
}
|
|
182
|
+
/** Refresh tree after CRUD operations. */
|
|
183
|
+
async refreshAfterChange(parentId) {
|
|
184
|
+
if (parentId) {
|
|
185
|
+
await this.loadChildrenAtNode(parentId);
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
await this.getCategories();
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
//#endregion
|
|
192
|
+
//#region ---- UI Handlers ----
|
|
193
|
+
/** Create a new root category node. */
|
|
194
|
+
async handleCreateRootClick(e) {
|
|
195
|
+
e.nativeEvent.preventDefault();
|
|
196
|
+
e.nativeEvent.stopPropagation();
|
|
197
|
+
await this.workflow.execute('create-entity', {
|
|
198
|
+
entity: this.getCategoryEntityKey(),
|
|
199
|
+
options: { process: { redirect: false } },
|
|
200
|
+
});
|
|
201
|
+
await this.refreshAfterChange();
|
|
202
|
+
}
|
|
203
|
+
/** Create a new child under the given node. */
|
|
204
|
+
async handleCreateChildClick(node, e) {
|
|
205
|
+
e.nativeEvent.preventDefault();
|
|
206
|
+
e.nativeEvent.stopPropagation();
|
|
207
|
+
const parentKey = this.categoryEntityDef?.parentKey;
|
|
208
|
+
const data = {};
|
|
209
|
+
if (parentKey) {
|
|
210
|
+
data[parentKey] = node.id;
|
|
211
|
+
}
|
|
212
|
+
await this.workflow.execute('create-entity', {
|
|
213
|
+
entity: this.getCategoryEntityKey(),
|
|
214
|
+
data,
|
|
215
|
+
options: { process: { redirect: false, canCreateNewOne: true } },
|
|
216
|
+
});
|
|
217
|
+
await this.refreshAfterChange(node.id);
|
|
218
|
+
}
|
|
219
|
+
/** Update the given node. */
|
|
220
|
+
async handleEditNodeClick(node, e) {
|
|
221
|
+
e.nativeEvent.preventDefault();
|
|
222
|
+
e.nativeEvent.stopPropagation();
|
|
223
|
+
await this.workflow.execute('quick-modify-entity', {
|
|
224
|
+
entity: this.getCategoryEntityKey(),
|
|
225
|
+
data: node,
|
|
226
|
+
options: { layout: { size: 'md' } },
|
|
227
|
+
});
|
|
228
|
+
await this.refreshAfterChange(node[this.categoryEntityDef?.parentKey]);
|
|
229
|
+
}
|
|
230
|
+
/** Delete the given node. */
|
|
231
|
+
async handleDeleteNodeClick(node, e) {
|
|
232
|
+
e.nativeEvent.preventDefault();
|
|
233
|
+
e.nativeEvent.stopPropagation();
|
|
234
|
+
await this.workflow.execute('delete-entity', {
|
|
235
|
+
entity: this.getCategoryEntityKey(),
|
|
236
|
+
data: node,
|
|
237
|
+
options: { process: { showResult: true } },
|
|
238
|
+
});
|
|
239
|
+
await this.refreshAfterChange(node[this.categoryEntityDef?.parentKey]);
|
|
240
|
+
}
|
|
177
241
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityCategoryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
178
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: AXPEntityCategoryComponent, isStandalone: true, selector: "axp-entity-category", inputs: { vm: { classPropertyName: "vm", publicName: "vm", isSignal: true, isRequired: true, transformFunction: null }, searchValue: { classPropertyName: "searchValue", publicName: "searchValue", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "tree", first: true, predicate: ["tree"], descendants: true, isSignal: true }], ngImport: i0, template: "
|
|
242
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: AXPEntityCategoryComponent, isStandalone: true, selector: "axp-entity-category", inputs: { vm: { classPropertyName: "vm", publicName: "vm", isSignal: true, isRequired: true, transformFunction: null }, searchValue: { classPropertyName: "searchValue", publicName: "searchValue", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "tree", first: true, predicate: ["tree"], descendants: true, isSignal: true }], ngImport: i0, template: "<axp-layout-header>\n <axp-layout-title>{{ vm().entityDef.category?.title || 'category' | translate | async }}</axp-layout-title>\n <axp-layout-toolbar>\n <ax-search-box (onValueChanged)=\"handleCategorySearchChange($event)\" [delayTime]=\"300\"\n [placeholder]=\"'search.placeholder' | translate | async\">\n </ax-search-box>\n </axp-layout-toolbar>\n</axp-layout-header>\n<axp-layout-content>\n @if (isLoading()) {\n <div class=\"ax-p-4 ax-flex ax-flex-col ax-gap-3\">\n <ax-skeleton class=\"ax-w-full ax-h-6 ax-rounded-md\"></ax-skeleton>\n <ax-skeleton class=\"ax-w-full ax-h-6 ax-rounded-md\"></ax-skeleton>\n <ax-skeleton class=\"ax-w-full ax-h-6 ax-rounded-md\"></ax-skeleton>\n <ax-skeleton class=\"ax-w-full ax-h-6 ax-rounded-md\"></ax-skeleton>\n <ax-skeleton class=\"ax-w-full ax-h-6 ax-rounded-md\"></ax-skeleton>\n <ax-skeleton class=\"ax-w-full ax-h-6 ax-rounded-md\"></ax-skeleton>\n </div>\n } @else if (treeItems()[0].children.length) {\n <div class=\"ax-px-4 ax-max-h-[calc(100vh-250px)] ax-overflow-auto\">\n <ax-tree-view (onNodeClick)=\"handleNodeClick($event)\" (onCollapsedChanged)=\"handleCollapseChanged($event)\"\n [showCheckbox]=\"false\" [itemTemplate]=\"itemTemplate\" #treeRef\n [textField]=\"vm().entityDef.category?.textField || 'title'\"\n [valueField]=\"vm().entityDef.category?.valueField || 'id'\" [expandedField]=\"'expand'\" [items]=\"treeItems()\" #tree>\n </ax-tree-view>\n </div>\n } @else {\n <div class=\"ax-flex ax-items-center ax-justify-center\">\n <span class=\"ax-text-center\"> No Record Found! </span>\n </div>\n }\n\n <ng-template #itemTemplate let-item>\n <div class=\"ax-flex ax-items-center ax-justify-between ax-w-full ax-gap-2 ax-overflow-hidden\">\n <div class=\"ax-flex ax-items-center ax-gap-2 ax-min-w-0\">\n <ax-icon class=\"fas ax-text-warning fa-folder\"></ax-icon>\n <span class=\"ax-truncate\">{{ item.title }}</span>\n </div>\n @if (item.id && item.id !== 'all') {\n <div class=\"ax-flex ax-items-center ax-gap-1\">\n <ax-button class=\"ax-xs\" color=\"default\" look=\"blank\" (onClick)=\"$event.nativeEvent.stopPropagation()\">\n <ax-icon class=\"fas fa-ellipsis-v\"></ax-icon>\n <ax-dropdown-panel>\n <ax-button-item-list>\n <ax-button-item (onClick)=\"handleCreateChildClick(item, $event)\" look=\"blank\" color=\"default\"\n text=\"Add New Child\">\n <ax-icon class=\"fas fa-plus\"></ax-icon>\n </ax-button-item>\n <ax-button-item (onClick)=\"handleEditNodeClick(item, $event)\" look=\"blank\" text=\"Edit\">\n <ax-icon class=\"fas fa-pen\"></ax-icon>\n </ax-button-item>\n <ax-button-item (onClick)=\"handleDeleteNodeClick(item, $event)\" color=\"danger\" look=\"blank\" text=\"Delete\">\n <ax-icon class=\"fas fa-trash\"></ax-icon>\n </ax-button-item>\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n </div>\n } @else if (item.id === 'all') {\n <div class=\"ax-flex ax-items-center ax-gap-1\">\n <ax-button class=\"ax-xs\" (onClick)=\"handleCreateRootClick($event)\" look=\"blank\" color=\"default\">\n <ax-icon class=\"fas fa-plus\"></ax-icon>\n </ax-button>\n </div>\n }\n </div>\n </ng-template>\n</axp-layout-content>", styles: ["ax-tree-view-item .ax-tree-view-items{width:100%;min-width:0px}ax-tree-view-item .ax-tree-view-items>div{width:100%}ax-tree-view-item .ax-state-tree-view-active{background-color:rgb(var(--ax-sys-color-light-surface))!important;color:rgb(var(--ax-sys-color-on-light-surface))!important;border-color:rgb(var(--ax-sys-color-border-light-surface))!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i2.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "ngmodule", type: AXTreeViewModule }, { kind: "component", type: i2$1.AXTreeViewComponent, selector: "ax-tree-view", inputs: ["items", "showCheckbox", "hasCheckboxField", "selectionMode", "selectionBehavior", "selectionScope", "focusNodeEnabled", "valueField", "textField", "visibleField", "disableField", "hasChildField", "selectedField", "expandedField", "tooltipField", "childrenField", "activeField", "indeterminateField", "parentField", "iconField", "toggleIcons", "look", "showEmptyNodeMassage", "itemTemplate", "emptyTemplate", "expandOn"], outputs: ["onSelectionChanged", "onItemSelectedChanged", "onNodeClick", "onCollapsedChanged", "onNodedbClick"] }, { kind: "ngmodule", type: AXSkeletonModule }, { kind: "component", type: i3.AXSkeletonComponent, selector: "ax-skeleton", inputs: ["animated"] }, { kind: "component", type: AXPThemeLayoutBlockComponent, selector: " axp-page-content, axp-page-footer-container, axp-page-footer, axp-page-header, axp-page-header-container, axp-page-toolbar, axp-layout-content, axp-layout-page-content, axp-layout-sections, axp-layout-body, axp-layout-page-body, axp-layout-prefix, axp-layout-suffix, axp-layout-title-bar, axp-layout-title, axp-layout-title-actions, axp-layout-nav-button, axp-layout-description, axp-layout-breadcrumbs, axp-layout-list-action, " }, { kind: "ngmodule", type: AXSearchBoxModule }, { kind: "component", type: i6.AXSearchBoxComponent, selector: "ax-search-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "value", "state", "name", "id", "look", "class", "delayTime", "type"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "component", type: AXPThemeLayoutHeaderComponent, selector: "axp-layout-header" }, { kind: "component", type: AXPThemeLayoutToolbarComponent, selector: "axp-layout-toolbar" }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i3$1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "component", type: i3$1.AXButtonItemComponent, selector: "ax-button-item", inputs: ["color", "disabled", "text", "selected", "divided", "data", "name"], outputs: ["onClick", "onFocus", "onBlur", "disabledChange"] }, { kind: "component", type: i3$1.AXButtonItemListComponent, selector: "ax-button-item-list", inputs: ["items"], outputs: ["onItemClick"] }, { kind: "ngmodule", type: AXDropdownModule }, { kind: "component", type: i5.AXDropdownPanelComponent, selector: "ax-dropdown-panel", inputs: ["isOpen", "fitParent", "dropdownWidth", "position", "placement", "_target", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i10.AXTranslatorPipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
179
243
|
}
|
|
180
244
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityCategoryComponent, decorators: [{
|
|
181
245
|
type: Component,
|
|
@@ -189,13 +253,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
189
253
|
AXPThemeLayoutHeaderComponent,
|
|
190
254
|
AXPThemeLayoutToolbarComponent,
|
|
191
255
|
AXTranslationModule,
|
|
192
|
-
|
|
256
|
+
AXButtonModule,
|
|
257
|
+
AXDropdownModule
|
|
258
|
+
], template: "<axp-layout-header>\n <axp-layout-title>{{ vm().entityDef.category?.title || 'category' | translate | async }}</axp-layout-title>\n <axp-layout-toolbar>\n <ax-search-box (onValueChanged)=\"handleCategorySearchChange($event)\" [delayTime]=\"300\"\n [placeholder]=\"'search.placeholder' | translate | async\">\n </ax-search-box>\n </axp-layout-toolbar>\n</axp-layout-header>\n<axp-layout-content>\n @if (isLoading()) {\n <div class=\"ax-p-4 ax-flex ax-flex-col ax-gap-3\">\n <ax-skeleton class=\"ax-w-full ax-h-6 ax-rounded-md\"></ax-skeleton>\n <ax-skeleton class=\"ax-w-full ax-h-6 ax-rounded-md\"></ax-skeleton>\n <ax-skeleton class=\"ax-w-full ax-h-6 ax-rounded-md\"></ax-skeleton>\n <ax-skeleton class=\"ax-w-full ax-h-6 ax-rounded-md\"></ax-skeleton>\n <ax-skeleton class=\"ax-w-full ax-h-6 ax-rounded-md\"></ax-skeleton>\n <ax-skeleton class=\"ax-w-full ax-h-6 ax-rounded-md\"></ax-skeleton>\n </div>\n } @else if (treeItems()[0].children.length) {\n <div class=\"ax-px-4 ax-max-h-[calc(100vh-250px)] ax-overflow-auto\">\n <ax-tree-view (onNodeClick)=\"handleNodeClick($event)\" (onCollapsedChanged)=\"handleCollapseChanged($event)\"\n [showCheckbox]=\"false\" [itemTemplate]=\"itemTemplate\" #treeRef\n [textField]=\"vm().entityDef.category?.textField || 'title'\"\n [valueField]=\"vm().entityDef.category?.valueField || 'id'\" [expandedField]=\"'expand'\" [items]=\"treeItems()\" #tree>\n </ax-tree-view>\n </div>\n } @else {\n <div class=\"ax-flex ax-items-center ax-justify-center\">\n <span class=\"ax-text-center\"> No Record Found! </span>\n </div>\n }\n\n <ng-template #itemTemplate let-item>\n <div class=\"ax-flex ax-items-center ax-justify-between ax-w-full ax-gap-2 ax-overflow-hidden\">\n <div class=\"ax-flex ax-items-center ax-gap-2 ax-min-w-0\">\n <ax-icon class=\"fas ax-text-warning fa-folder\"></ax-icon>\n <span class=\"ax-truncate\">{{ item.title }}</span>\n </div>\n @if (item.id && item.id !== 'all') {\n <div class=\"ax-flex ax-items-center ax-gap-1\">\n <ax-button class=\"ax-xs\" color=\"default\" look=\"blank\" (onClick)=\"$event.nativeEvent.stopPropagation()\">\n <ax-icon class=\"fas fa-ellipsis-v\"></ax-icon>\n <ax-dropdown-panel>\n <ax-button-item-list>\n <ax-button-item (onClick)=\"handleCreateChildClick(item, $event)\" look=\"blank\" color=\"default\"\n text=\"Add New Child\">\n <ax-icon class=\"fas fa-plus\"></ax-icon>\n </ax-button-item>\n <ax-button-item (onClick)=\"handleEditNodeClick(item, $event)\" look=\"blank\" text=\"Edit\">\n <ax-icon class=\"fas fa-pen\"></ax-icon>\n </ax-button-item>\n <ax-button-item (onClick)=\"handleDeleteNodeClick(item, $event)\" color=\"danger\" look=\"blank\" text=\"Delete\">\n <ax-icon class=\"fas fa-trash\"></ax-icon>\n </ax-button-item>\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n </div>\n } @else if (item.id === 'all') {\n <div class=\"ax-flex ax-items-center ax-gap-1\">\n <ax-button class=\"ax-xs\" (onClick)=\"handleCreateRootClick($event)\" look=\"blank\" color=\"default\">\n <ax-icon class=\"fas fa-plus\"></ax-icon>\n </ax-button>\n </div>\n }\n </div>\n </ng-template>\n</axp-layout-content>", styles: ["ax-tree-view-item .ax-tree-view-items{width:100%;min-width:0px}ax-tree-view-item .ax-tree-view-items>div{width:100%}ax-tree-view-item .ax-state-tree-view-active{background-color:rgb(var(--ax-sys-color-light-surface))!important;color:rgb(var(--ax-sys-color-on-light-surface))!important;border-color:rgb(var(--ax-sys-color-border-light-surface))!important}\n"] }]
|
|
193
259
|
}] });
|
|
194
260
|
|
|
195
261
|
class AXPEntityMasterToolbarViewComponent {
|
|
196
262
|
constructor() {
|
|
197
263
|
this.layoutService = inject(AXPLayoutThemeService);
|
|
198
264
|
this.parent = inject(AXPEntityMasterListViewComponent);
|
|
265
|
+
this.isInitializing = false;
|
|
266
|
+
this.pendingInitialFilters = true;
|
|
267
|
+
this.pendingInitialSorts = true;
|
|
199
268
|
this.initialFilters = signal([], ...(ngDevMode ? [{ debugName: "initialFilters" }] : []));
|
|
200
269
|
this.filtersDefinitions = signal([], ...(ngDevMode ? [{ debugName: "filtersDefinitions" }] : []));
|
|
201
270
|
this.viewQueries = computed(() => this.vm.views().map((v) => ({
|
|
@@ -222,41 +291,90 @@ class AXPEntityMasterToolbarViewComponent {
|
|
|
222
291
|
})),
|
|
223
292
|
sorts: this.vm.view().sorts,
|
|
224
293
|
}), ...(ngDevMode ? [{ debugName: "selectedViewQuery" }] : []));
|
|
294
|
+
// Debounced apply to coalesce multiple UI changes (filters/sorts/columns)
|
|
295
|
+
this.applyTimer = null;
|
|
225
296
|
this.#effect = effect(() => {
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
operator: c.operator,
|
|
229
|
-
value: c.value,
|
|
230
|
-
})));
|
|
297
|
+
// Keep definitions up to date; initial filters are set explicitly from settings or view
|
|
298
|
+
this.filtersDefinitions.set(this.vm.filtersDef);
|
|
231
299
|
}, ...(ngDevMode ? [{ debugName: "#effect" }] : []));
|
|
232
|
-
this.sortQueries = computed(() => this.vm
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
300
|
+
this.sortQueries = computed(() => this.vm
|
|
301
|
+
.sortedFields()
|
|
302
|
+
.filter((s) => !!s.dir)
|
|
303
|
+
.map((s) => ({ name: s.name, dir: s.dir })), ...(ngDevMode ? [{ debugName: "sortQueries" }] : []));
|
|
236
304
|
this.sortDefinitions = computed(() => this.vm.sortableFields().map((s) => ({
|
|
237
305
|
name: s.name,
|
|
238
306
|
title: s.title,
|
|
239
307
|
dir: s.dir,
|
|
240
308
|
})), ...(ngDevMode ? [{ debugName: "sortDefinitions" }] : []));
|
|
241
309
|
}
|
|
242
|
-
ngOnInit() {
|
|
310
|
+
async ngOnInit() {
|
|
311
|
+
// Prefer saved settings (view/columns/sorts/filters) if available, then apply
|
|
312
|
+
await this.vm.setView();
|
|
243
313
|
this.filtersDefinitions.set(this.vm.filtersDef);
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
this.
|
|
314
|
+
this.isInitializing = true;
|
|
315
|
+
// this.pendingInitialFilters = true;
|
|
316
|
+
// this.pendingInitialSorts = true;
|
|
317
|
+
this.setInitialFiltersFromSettingsOrView();
|
|
318
|
+
// Ensure initial load even when filters/sorts are absent
|
|
319
|
+
setTimeout(() => {
|
|
320
|
+
this.isInitializing = false;
|
|
321
|
+
this.scheduleApply();
|
|
322
|
+
}, 0);
|
|
323
|
+
}
|
|
324
|
+
scheduleApply() {
|
|
325
|
+
clearTimeout(this.applyTimer);
|
|
326
|
+
this.applyTimer = setTimeout(() => {
|
|
327
|
+
this.vm.applyFilterAndSort();
|
|
328
|
+
}, 50);
|
|
329
|
+
}
|
|
330
|
+
async onViewChanged(view) {
|
|
331
|
+
await this.vm.setView(view.name);
|
|
332
|
+
this.isInitializing = true;
|
|
333
|
+
this.pendingInitialFilters = true;
|
|
334
|
+
this.pendingInitialSorts = true;
|
|
335
|
+
this.setInitialFiltersFromSettingsOrView();
|
|
336
|
+
// Ensure initial load after view change
|
|
337
|
+
setTimeout(() => {
|
|
338
|
+
this.isInitializing = false;
|
|
339
|
+
this.scheduleApply();
|
|
340
|
+
}, 0);
|
|
247
341
|
}
|
|
248
342
|
#effect;
|
|
343
|
+
setInitialFiltersFromSettingsOrView() {
|
|
344
|
+
const saved = this.vm.filterQueries();
|
|
345
|
+
if (saved && saved.length) {
|
|
346
|
+
this.initialFilters.set(saved);
|
|
347
|
+
return;
|
|
348
|
+
}
|
|
349
|
+
this.initialFilters.set(this.vm.view().conditions.map((c) => ({
|
|
350
|
+
field: c.name,
|
|
351
|
+
operator: c.operator,
|
|
352
|
+
value: c.value,
|
|
353
|
+
})));
|
|
354
|
+
}
|
|
249
355
|
onFiltersChanged(filters) {
|
|
356
|
+
if (this.isInitializing || this.pendingInitialFilters) {
|
|
357
|
+
this.pendingInitialFilters = false;
|
|
358
|
+
return;
|
|
359
|
+
}
|
|
250
360
|
this.vm.filterQueries.set(filters);
|
|
251
|
-
|
|
361
|
+
// Persist filters per module/entity/view
|
|
362
|
+
this.vm.saveSettings('filters', filters);
|
|
363
|
+
this.scheduleApply();
|
|
252
364
|
}
|
|
253
365
|
onSortQueriesChange(e) {
|
|
366
|
+
if (this.isInitializing || this.pendingInitialSorts) {
|
|
367
|
+
this.pendingInitialSorts = false;
|
|
368
|
+
return;
|
|
369
|
+
}
|
|
254
370
|
this.vm.sortedFields.set(e.map((s) => ({
|
|
255
371
|
name: s.name,
|
|
256
372
|
title: s.name,
|
|
257
373
|
dir: s.dir,
|
|
258
374
|
})));
|
|
259
|
-
|
|
375
|
+
// Persist sorts per module/entity/view
|
|
376
|
+
this.vm.saveSettings('sorts', e);
|
|
377
|
+
this.scheduleApply();
|
|
260
378
|
}
|
|
261
379
|
onColumnsChange(columns) {
|
|
262
380
|
this.vm.columns.update(() => {
|
|
@@ -280,7 +398,10 @@ class AXPEntityMasterToolbarViewComponent {
|
|
|
280
398
|
return col;
|
|
281
399
|
});
|
|
282
400
|
});
|
|
283
|
-
|
|
401
|
+
// Persist column order/visibility
|
|
402
|
+
this.vm.onColumnsChanged(this.vm.columns());
|
|
403
|
+
// Use debounced apply to avoid triple refresh when combined with sorts/filters
|
|
404
|
+
// this.scheduleApply();
|
|
284
405
|
}
|
|
285
406
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityMasterToolbarViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
286
407
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: AXPEntityMasterToolbarViewComponent, isStandalone: true, selector: "axp-entity-master-toolbar-view", inputs: { vm: ["viewModel", "vm"] }, host: { classAttribute: "ax-w-full" }, ngImport: i0, template: "<!-- <axp-entity-view-toolbar [viewModel]=\"vm\"></axp-entity-view-toolbar> -->\n<axp-query-views\n [views]=\"viewQueries()\"\n [selectedView]=\"selectedViewQuery()\"\n (selectedViewChange)=\"onViewChanged($event)\"\n></axp-query-views>\n<div class=\"ax-flex ax-items-center ax-gap-2 ax-border-b ax-border-light w-full\">\n <!-- <axp-entity-filter-toolbar [viewModel]=\"vm\"></axp-entity-filter-toolbar> -->\n <axp-query-filters\n [filtersDefinitions]=\"filtersDefinitions()\"\n [initialFilters]=\"initialFilters()\"\n (onFiltersChanged)=\"onFiltersChanged($event)\"\n ></axp-query-filters>\n\n <div class=\"ax-flex ax-items-center ax-gap-1 md:ax-gap-2\">\n <ax-button [iconOnly]=\"true\" #columnButton [color]=\"'default'\">\n <i class=\"fa-light fa-table-columns\"></i>\n </ax-button>\n <ax-popover\n [adaptivityEnabled]=\"true\"\n [offsetY]=\"30\"\n [target]=\"columnButton\"\n [openOn]=\"'toggle'\"\n [closeOn]=\"'clickOut'\"\n #popover\n >\n <div class=\"ax-lightest-surface ax-shadow-md ax-border md:ax-w-72 ax-w-full ax-rounded-md\">\n <ax-header class=\"ax-border-b ax-lighter-surface ax-rounded-t-md ax-p-4 ax-font-bold\">\n {{ 'entity.columns' | translate | async }}\n </ax-header>\n <div class=\"ax-py-2 ax-px-4\">\n <axp-query-columns [columns]=\"vm.columns()\" (columnsChange)=\"onColumnsChange($event)\"></axp-query-columns>\n <!-- <axp-list-view-option-columns [viewModel]=\"vm\"></axp-list-view-option-columns> -->\n </div>\n </div>\n </ax-popover>\n @if (vm.canSort()) {\n <ax-button [iconOnly]=\"true\" [text]=\"'Sorts'\" #sortButton [color]=\"'default'\">\n <i class=\"fa-light fa-sort-amount-up\"></i>\n </ax-button>\n <ax-popover\n [adaptivityEnabled]=\"true\"\n [offsetY]=\"10\"\n [target]=\"sortButton\"\n [openOn]=\"'toggle'\"\n [closeOn]=\"'clickOut'\"\n #popover\n >\n <div class=\"ax-lightest-surface ax-shadow-md ax-border md:ax-w-72 ax-w-full ax-rounded-md\">\n <ax-header class=\"ax-border-b ax-lighter-surface ax-rounded-t-md ax-p-4 ax-font-bold\">\n {{ 'entity.sorts' | translate | async }}\n </ax-header>\n <div class=\"ax-py-2 ax-px-4\">\n <!-- <axp-list-view-option-sorting [viewModel]=\"vm\"></axp-list-view-option-sorting> -->\n <axp-query-sorts\n [sortDefinitions]=\"sortDefinitions()\"\n (sortQueriesChange)=\"onSortQueriesChange($event)\"\n [initialSortQueries]=\"sortQueries()\"\n ></axp-query-sorts>\n </div>\n </div>\n </ax-popover>\n }\n @if (layoutService.isSmall()) {\n <ax-button (onClick)=\"parent.toggleCategoryDrawer()\" [iconOnly]=\"true\" [color]=\"'default'\">\n <i class=\"fa-light fa-bars\"></i>\n </ax-button>\n }\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i3$1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i2.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "component", type: AXPQueryFiltersComponent, selector: "axp-query-filters", inputs: ["filtersDefinitions", "initialFilters"], outputs: ["onFiltersChanged"] }, { kind: "ngmodule", type: AXPopoverModule }, { kind: "component", type: i3$2.AXPopoverComponent, selector: "ax-popover", inputs: ["width", "disabled", "offsetX", "offsetY", "target", "placement", "content", "openOn", "closeOn", "hasBackdrop", "openAfter", "closeAfter", "backdropClass", "panelClass", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "component", type: AXPQuerySortsComponent, selector: "axp-query-sorts", inputs: ["sortDefinitions", "initialSortQueries"], outputs: ["sortDefinitionsChange", "sortQueriesChange"] }, { kind: "component", type: AXPQueryViewsComponent, selector: "axp-query-views", inputs: ["views", "selectedView"], outputs: ["viewsChange", "selectedViewChange"] }, { kind: "component", type: AXPQueryColumnsComponent, selector: "axp-query-columns", inputs: ["columns"], outputs: ["columnsChange"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i10.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
@@ -397,7 +518,10 @@ class AXPEntityMasterListViewComponent extends AXPPageLayoutBaseComponent {
|
|
|
397
518
|
async handleRowDbClick(e) {
|
|
398
519
|
const allItems = [...this.commandRowItems(), ...(await this.dropdownRowItems(e.data))];
|
|
399
520
|
// const defaultAction = allItems.find((c) => (c as any).default) || allItems[0];
|
|
400
|
-
const defaultAction = allItems.find((c) =>
|
|
521
|
+
const defaultAction = allItems.find((c) => {
|
|
522
|
+
const commandName = c.name.split('&')[0];
|
|
523
|
+
return c.default || commandName === 'open-entity';
|
|
524
|
+
});
|
|
401
525
|
if (!defaultAction) {
|
|
402
526
|
return;
|
|
403
527
|
}
|
|
@@ -579,4 +703,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
579
703
|
}], ctorParameters: () => [{ type: i1$1.AXPlatform }] });
|
|
580
704
|
|
|
581
705
|
export { AXPEntityMasterListViewComponent };
|
|
582
|
-
//# sourceMappingURL=acorex-platform-themes-default-entity-master-list-view.component-
|
|
706
|
+
//# sourceMappingURL=acorex-platform-themes-default-entity-master-list-view.component-DXGLsVis.mjs.map
|