@acorex/platform 20.3.0-next.7 → 20.3.0-next.9
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 +0 -2
- package/core/index.d.ts +386 -47
- package/fesm2022/acorex-platform-common.mjs +5 -10
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-core.mjs +427 -125
- package/fesm2022/acorex-platform-core.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-builder.mjs +422 -26
- package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-components.mjs +1843 -111
- package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-designer.mjs +19 -12
- package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-entity.mjs +463 -510
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-views.mjs +23 -15
- package/fesm2022/acorex-platform-layout-views.mjs.map +1 -1
- package/fesm2022/{acorex-platform-themes-default-entity-master-create-view.component-BXbkGGei.mjs → acorex-platform-themes-default-entity-master-create-view.component-Ct-ri59W.mjs} +3 -3
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-Ct-ri59W.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-entity-master-list-view.component-gQIK6PIx.mjs → acorex-platform-themes-default-entity-master-list-view.component-7BB4LdjK.mjs} +9 -9
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-7BB4LdjK.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-BDJR088o.mjs +101 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-BDJR088o.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default.mjs +8 -8
- package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
- package/fesm2022/{acorex-platform-themes-shared-icon-chooser-view.component-KpZWpnOJ.mjs → acorex-platform-themes-shared-icon-chooser-view.component-BgEh06Tn.mjs} +21 -11
- package/fesm2022/acorex-platform-themes-shared-icon-chooser-view.component-BgEh06Tn.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-shared-settings.provider-CXiRmniv.mjs → acorex-platform-themes-shared-settings.provider-CLUKU4y0.mjs} +2 -2
- package/fesm2022/acorex-platform-themes-shared-settings.provider-CLUKU4y0.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-shared-theme-color-chooser-column.component-BvOiVCgt.mjs → acorex-platform-themes-shared-theme-color-chooser-column.component-AeOQxjbS.mjs} +20 -5
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-AeOQxjbS.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-shared-theme-color-chooser-view.component-BW0rfkjk.mjs → acorex-platform-themes-shared-theme-color-chooser-view.component-DEVzRd6-.mjs} +20 -5
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-DEVzRd6-.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-shared.mjs +205 -38
- package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
- package/fesm2022/{acorex-platform-widgets-checkbox-widget-view.component-C-4bWr9G.mjs → acorex-platform-widgets-checkbox-widget-view.component-KYCQ2qTJ.mjs} +51 -35
- package/fesm2022/acorex-platform-widgets-checkbox-widget-view.component-KYCQ2qTJ.mjs.map +1 -0
- package/fesm2022/{acorex-platform-widgets-file-list-popup.component-rW2RD35f.mjs → acorex-platform-widgets-file-list-popup.component-Cmtq2bBV.mjs} +3 -3
- package/fesm2022/acorex-platform-widgets-file-list-popup.component-Cmtq2bBV.mjs.map +1 -0
- package/fesm2022/{acorex-platform-widgets-page-widget-designer.component-DNvnQ4Mc.mjs → acorex-platform-widgets-page-widget-designer.component-D8ivmxzT.mjs} +2 -2
- package/fesm2022/acorex-platform-widgets-page-widget-designer.component-D8ivmxzT.mjs.map +1 -0
- package/fesm2022/{acorex-platform-widgets-tabular-data-edit-popup.component-CPVRbE8B.mjs → acorex-platform-widgets-tabular-data-edit-popup.component-CMqq_iOj.mjs} +8 -8
- package/fesm2022/acorex-platform-widgets-tabular-data-edit-popup.component-CMqq_iOj.mjs.map +1 -0
- package/fesm2022/acorex-platform-widgets.mjs +4590 -5073
- package/fesm2022/acorex-platform-widgets.mjs.map +1 -1
- package/layout/builder/index.d.ts +62 -8
- package/layout/components/index.d.ts +780 -54
- package/layout/designer/index.d.ts +4 -2
- package/layout/entity/index.d.ts +53 -10
- package/package.json +9 -9
- package/widgets/index.d.ts +1441 -433
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-BXbkGGei.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-gQIK6PIx.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-Bp1JLsj1.mjs +0 -101
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-Bp1JLsj1.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-icon-chooser-view.component-KpZWpnOJ.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-settings.provider-CXiRmniv.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-BvOiVCgt.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-BW0rfkjk.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-checkbox-widget-view.component-C-4bWr9G.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-file-list-popup.component-rW2RD35f.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-page-widget-designer.component-DNvnQ4Mc.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-tabular-data-edit-popup.component-CPVRbE8B.mjs.map +0 -1
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { InjectionToken, inject, Injectable, computed, signal, Injector, runInInjectionContext, EnvironmentInjector, viewChild, viewChildren, linkedSignal, effect, untracked, ChangeDetectionStrategy, Component, HostBinding, input, ElementRef, ApplicationRef, createComponent, ViewChild, NgModule } from '@angular/core';
|
|
3
3
|
import { castArray, get, cloneDeep, set, merge, isNil, isEmpty, sortBy } from 'lodash-es';
|
|
4
|
-
import
|
|
5
|
-
import { AXDataSource, AXCommonModule } from '@acorex/cdk/common';
|
|
4
|
+
import { AXDataSource } from '@acorex/cdk/common';
|
|
6
5
|
import { AXFormatService } from '@acorex/core/format';
|
|
7
6
|
import { AXPFilterOperatorMiddlewareService, AXPEntityCommandScope, getEntityInfo, AXPSettingService, AXPRefreshEvent, AXPReloadEvent, AXPCleanNestedFilters, AXPWorkflowNavigateAction, AXPToastAction, AXP_SEARCH_DEFINITION_PROVIDER } from '@acorex/platform/common';
|
|
8
|
-
import * as i1$
|
|
7
|
+
import * as i1$2 from '@acorex/platform/core';
|
|
9
8
|
import { resolveActionLook, AXPExpressionEvaluatorService, AXPPlatformScope, AXPDistributedEventListenerService, getChangedPaths, extractValue, setSmart, AXPSystemActionType } from '@acorex/platform/core';
|
|
10
9
|
import * as i2$2 from '@acorex/platform/workflow';
|
|
11
10
|
import { AXPWorkflowService, ofType, createWorkFlowEvent, AXPWorkflowAction, AXPWorkflowModule } from '@acorex/platform/workflow';
|
|
@@ -16,7 +15,7 @@ import { Subject, takeUntil } from 'rxjs';
|
|
|
16
15
|
import { AXPSessionService, AXPAuthGuard } from '@acorex/platform/auth';
|
|
17
16
|
import { AXPCommandService, AXPQueryService, provideCommandSetups, provideQuerySetups } from '@acorex/platform/runtime';
|
|
18
17
|
import { moveItemInArray } from '@angular/cdk/drag-drop';
|
|
19
|
-
import * as
|
|
18
|
+
import * as i6 from '@acorex/core/translation';
|
|
20
19
|
import { AXTranslationService, AXTranslationModule } from '@acorex/core/translation';
|
|
21
20
|
import { AXDialogService } from '@acorex/components/dialog';
|
|
22
21
|
import { AXLoadingDialogService } from '@acorex/components/loading-dialog';
|
|
@@ -29,10 +28,10 @@ import * as i3 from '@acorex/components/decorators';
|
|
|
29
28
|
import { AXDecoratorModule } from '@acorex/components/decorators';
|
|
30
29
|
import * as i4 from '@acorex/components/dropdown';
|
|
31
30
|
import { AXDropdownModule } from '@acorex/components/dropdown';
|
|
32
|
-
import * as
|
|
31
|
+
import * as i5 from '@angular/common';
|
|
33
32
|
import { CommonModule } from '@angular/common';
|
|
34
33
|
import { AXP_NAME_PROPERTY, AXP_DATA_PATH_PROPERTY, AXP_DISABLED_PROPERTY, AXP_ALLOW_CLEAR_PROPERTY, AXP_DATA_PROPERTY_GROUP, AXP_ALLOW_MULTIPLE_PROPERTY, AXPFileUploaderWidgetService } from '@acorex/platform/widgets';
|
|
35
|
-
import * as i1$
|
|
34
|
+
import * as i1$1 from '@angular/forms';
|
|
36
35
|
import { FormsModule } from '@angular/forms';
|
|
37
36
|
import * as i4$1 from '@acorex/components/loading';
|
|
38
37
|
import { AXLoadingModule } from '@acorex/components/loading';
|
|
@@ -40,22 +39,18 @@ import * as i1 from '@acorex/components/badge';
|
|
|
40
39
|
import { AXBadgeModule } from '@acorex/components/badge';
|
|
41
40
|
import * as i5$1 from '@acorex/components/form';
|
|
42
41
|
import { AXFormModule } from '@acorex/components/form';
|
|
43
|
-
import * as
|
|
44
|
-
import {
|
|
45
|
-
import * as i7
|
|
42
|
+
import * as i6$2 from '@acorex/components/search-box';
|
|
43
|
+
import { AXSearchBoxComponent, AXSearchBoxModule } from '@acorex/components/search-box';
|
|
44
|
+
import * as i7 from '@acorex/components/select-box';
|
|
46
45
|
import { AXSelectBoxModule } from '@acorex/components/select-box';
|
|
47
|
-
import * as i6 from '@acorex/components/tag-box';
|
|
46
|
+
import * as i6$1 from '@acorex/components/tag-box';
|
|
48
47
|
import { AXTagBoxComponent, AXTagBoxModule } from '@acorex/components/tag-box';
|
|
49
48
|
import { AXValidationModule } from '@acorex/core/validation';
|
|
50
|
-
import
|
|
51
|
-
import { AXDataTableModule } from '@acorex/components/data-table';
|
|
52
|
-
import { AXDropdownButtonModule } from '@acorex/components/dropdown-button';
|
|
53
|
-
import { AXBasePageComponent } from '@acorex/components/page';
|
|
49
|
+
import { AXPDataSelectorService, AXPWidgetPropertyViewerComponent } from '@acorex/platform/layout/components';
|
|
54
50
|
import * as i2 from '@acorex/components/popover';
|
|
55
51
|
import { AXPopoverModule } from '@acorex/components/popover';
|
|
56
52
|
import * as i2$1 from '@acorex/components/text-box';
|
|
57
53
|
import { AXTextBoxModule, AXTextBoxComponent } from '@acorex/components/text-box';
|
|
58
|
-
import { AXPWidgetPropertyViewerComponent } from '@acorex/platform/layout/components';
|
|
59
54
|
import { transform, isEqual } from 'lodash';
|
|
60
55
|
|
|
61
56
|
const AXP_DATA_SEEDER_TOKEN = new InjectionToken('AXP_DATA_SEEDER_TOKEN');
|
|
@@ -369,7 +364,7 @@ class AXPEntityDetailListViewModel {
|
|
|
369
364
|
module: this.detailEntity()?.module,
|
|
370
365
|
title: this.detailEntity()?.title,
|
|
371
366
|
parentKey: this.detailEntity()?.parentKey,
|
|
372
|
-
source: this.detailEntity()?.
|
|
367
|
+
source: `${this.detailEntity()?.module}.${this.detailEntity()?.name}`,
|
|
373
368
|
},
|
|
374
369
|
options,
|
|
375
370
|
});
|
|
@@ -437,13 +432,6 @@ function createModifierContext(entity) {
|
|
|
437
432
|
return ctx;
|
|
438
433
|
},
|
|
439
434
|
},
|
|
440
|
-
source: {
|
|
441
|
-
get: () => entity.source,
|
|
442
|
-
set: (newValue) => {
|
|
443
|
-
entity.source = newValue;
|
|
444
|
-
return ctx;
|
|
445
|
-
},
|
|
446
|
-
},
|
|
447
435
|
parentKey: {
|
|
448
436
|
get: () => entity.parentKey,
|
|
449
437
|
set: (newValue) => {
|
|
@@ -1542,7 +1530,7 @@ class AXPEntityMasterListViewModel {
|
|
|
1542
1530
|
module: this.entityDef.module,
|
|
1543
1531
|
title: this.entityDef.title,
|
|
1544
1532
|
parentKey: this.entityDef.parentKey,
|
|
1545
|
-
source: this.entityDef.
|
|
1533
|
+
source: `${this.entityDef.module}.${this.entityDef.name}`,
|
|
1546
1534
|
},
|
|
1547
1535
|
data: action?.scope == AXPEntityCommandScope.Selected ? this.selectedItems() : data,
|
|
1548
1536
|
options: options,
|
|
@@ -1550,7 +1538,20 @@ class AXPEntityMasterListViewModel {
|
|
|
1550
1538
|
});
|
|
1551
1539
|
}
|
|
1552
1540
|
else {
|
|
1553
|
-
this.commandService.execute(command, options);
|
|
1541
|
+
// this.commandService.execute(command, options);
|
|
1542
|
+
this.commandService.execute(command, {
|
|
1543
|
+
entity: getEntityInfo(this.entityDef).source,
|
|
1544
|
+
entityInfo: {
|
|
1545
|
+
name: this.entityDef.name,
|
|
1546
|
+
module: this.entityDef.module,
|
|
1547
|
+
title: this.entityDef.title,
|
|
1548
|
+
parentKey: this.entityDef.parentKey,
|
|
1549
|
+
source: `${this.entityDef.module}.${this.entityDef.name}`,
|
|
1550
|
+
},
|
|
1551
|
+
data: action?.scope == AXPEntityCommandScope.Selected ? this.selectedItems() : data,
|
|
1552
|
+
options: options,
|
|
1553
|
+
metadata: action?.metadata,
|
|
1554
|
+
});
|
|
1554
1555
|
}
|
|
1555
1556
|
}
|
|
1556
1557
|
async execute(command) {
|
|
@@ -1661,14 +1662,14 @@ class AXPEntityPerformDeleteAction extends AXPWorkflowAction {
|
|
|
1661
1662
|
// Create dialog config but don't show it yet
|
|
1662
1663
|
const createDialog = async () => {
|
|
1663
1664
|
dialog = this.loadingDialog.show({
|
|
1664
|
-
title: await this.translationService.translateAsync('workflow.deleting'),
|
|
1665
|
+
title: await this.translationService.translateAsync('@general:workflow.deleting'),
|
|
1665
1666
|
mode: 'determinate',
|
|
1666
1667
|
status: 'Deleting...',
|
|
1667
1668
|
progressValue: 0,
|
|
1668
1669
|
text: `0/${idLength}`,
|
|
1669
1670
|
buttons: [
|
|
1670
1671
|
{
|
|
1671
|
-
text: await this.translationService.translateAsync('cancel'),
|
|
1672
|
+
text: await this.translationService.translateAsync('@general:actions.cancel.title'),
|
|
1672
1673
|
color: 'danger',
|
|
1673
1674
|
onClick: () => {
|
|
1674
1675
|
if (dialog) {
|
|
@@ -1729,7 +1730,7 @@ class AXPEntityPerformDeleteAction extends AXPWorkflowAction {
|
|
|
1729
1730
|
if (successfulPromises > 0 && failedPromises === 0) {
|
|
1730
1731
|
// All items deleted successfully
|
|
1731
1732
|
if (showResult) {
|
|
1732
|
-
await this.dialogService.alert(await this.translationService.translateAsync('workflow.success-delete-title'), await this.translationService.translateAsync('workflow.success-delete-body', {
|
|
1733
|
+
await this.dialogService.alert(await this.translationService.translateAsync('@general:workflow.success-delete-title'), await this.translationService.translateAsync('@general:workflow.success-delete-body', {
|
|
1733
1734
|
params: { item: successfulPromises },
|
|
1734
1735
|
}), //TODO test translation
|
|
1735
1736
|
'success');
|
|
@@ -1741,7 +1742,7 @@ class AXPEntityPerformDeleteAction extends AXPWorkflowAction {
|
|
|
1741
1742
|
else if (successfulPromises > 0 && failedPromises > 0) {
|
|
1742
1743
|
// Some items deleted successfully, some failed
|
|
1743
1744
|
if (showResult) {
|
|
1744
|
-
await this.dialogService.alert(await this.translationService.translateAsync('workflow.success-partial-delete-title'), await this.translationService.translateAsync('workflow.partial-delete-body', {
|
|
1745
|
+
await this.dialogService.alert(await this.translationService.translateAsync('@general:workflow.success-partial-delete-title'), await this.translationService.translateAsync('@general:workflow.partial-delete-body', {
|
|
1745
1746
|
params: { success: successfulPromises, fail: failedPromises },
|
|
1746
1747
|
}), 'warning');
|
|
1747
1748
|
}
|
|
@@ -1751,7 +1752,7 @@ class AXPEntityPerformDeleteAction extends AXPWorkflowAction {
|
|
|
1751
1752
|
else if (successfulPromises === 0 && failedPromises > 0) {
|
|
1752
1753
|
// No items deleted, all failed
|
|
1753
1754
|
if (showResult) {
|
|
1754
|
-
await this.dialogService.alert(await this.translationService.translateAsync('workflow.fail-delete-title'), await this.translationService.translateAsync('workflow.fail-delete-body', {
|
|
1755
|
+
await this.dialogService.alert(await this.translationService.translateAsync('@general:workflow.fail-delete-title'), await this.translationService.translateAsync('@general:workflow.fail-delete-body', {
|
|
1755
1756
|
params: { item: failedPromises },
|
|
1756
1757
|
}), 'danger');
|
|
1757
1758
|
}
|
|
@@ -1759,7 +1760,7 @@ class AXPEntityPerformDeleteAction extends AXPWorkflowAction {
|
|
|
1759
1760
|
else {
|
|
1760
1761
|
// No items to delete (no successful or failed promises)
|
|
1761
1762
|
if (showResult) {
|
|
1762
|
-
await this.dialogService.alert(await this.translationService.translateAsync('workflow.no-need'), await this.translationService.translateAsync('workflow.no-item'), 'primary');
|
|
1763
|
+
await this.dialogService.alert(await this.translationService.translateAsync('@general:workflow.no-need'), await this.translationService.translateAsync('@general:workflow.no-item'), 'primary');
|
|
1763
1764
|
}
|
|
1764
1765
|
}
|
|
1765
1766
|
}
|
|
@@ -1797,6 +1798,35 @@ const AXPDeleteEntityWorkflow = {
|
|
|
1797
1798
|
},
|
|
1798
1799
|
};
|
|
1799
1800
|
|
|
1801
|
+
class AXPEntityUpdateViewSectionViewModel {
|
|
1802
|
+
constructor(entity, section) {
|
|
1803
|
+
this.entity = entity;
|
|
1804
|
+
this.section = section;
|
|
1805
|
+
this.group = this.entity.groups?.find((c) => c.id == this.section.id);
|
|
1806
|
+
this.name = signal(this.group.id, ...(ngDevMode ? [{ debugName: "name" }] : []));
|
|
1807
|
+
this.title = computed(() => {
|
|
1808
|
+
return this.group.title ?? this.group.id;
|
|
1809
|
+
}, ...(ngDevMode ? [{ debugName: "title" }] : []));
|
|
1810
|
+
this.description = computed(() => {
|
|
1811
|
+
return this.group.description;
|
|
1812
|
+
}, ...(ngDevMode ? [{ debugName: "description" }] : []));
|
|
1813
|
+
this.layout = computed(() => {
|
|
1814
|
+
const source = cloneDeep(this.section.layout ?? {});
|
|
1815
|
+
set(source, 'positions.default.colSpan', 12);
|
|
1816
|
+
return source;
|
|
1817
|
+
}, ...(ngDevMode ? [{ debugName: "layout" }] : []));
|
|
1818
|
+
this.elements = computed(() => {
|
|
1819
|
+
const { interfaces, properties } = this.entity;
|
|
1820
|
+
const updateProps = interfaces?.master?.update?.properties ?? [];
|
|
1821
|
+
const updatePropNames = new Set(updateProps.map(({ name }) => name));
|
|
1822
|
+
const filteredProperties = properties.filter(({ groupId, schema, name }) => groupId === this.group.id && !schema.hidden && updatePropNames.has(name));
|
|
1823
|
+
return filteredProperties.map((property) => {
|
|
1824
|
+
const updateProp = updateProps.find(({ name }) => name === property.name);
|
|
1825
|
+
return new AXPEntityMasterUpdateElementViewModel(this.entity, property);
|
|
1826
|
+
});
|
|
1827
|
+
}, ...(ngDevMode ? [{ debugName: "elements" }] : []));
|
|
1828
|
+
}
|
|
1829
|
+
}
|
|
1800
1830
|
class AXPEntityMasterUpdateElementViewModel {
|
|
1801
1831
|
constructor(entity, property) {
|
|
1802
1832
|
this.entity = entity;
|
|
@@ -1862,6 +1892,13 @@ class AXPEntityMasterUpdateViewModel {
|
|
|
1862
1892
|
return new AXPEntityMasterUpdateElementViewModel(this.entityDef, e);
|
|
1863
1893
|
});
|
|
1864
1894
|
}, ...(ngDevMode ? [{ debugName: "elements" }] : []));
|
|
1895
|
+
this.sections = computed(() => {
|
|
1896
|
+
const { interfaces, properties } = this.entityDef;
|
|
1897
|
+
const updateProps = interfaces?.master?.update?.properties?.map(({ name }) => name) ?? [];
|
|
1898
|
+
const visibleProperties = properties.filter(({ groupId, schema, name }) => groupId && !schema.hidden && updateProps.includes(name));
|
|
1899
|
+
const sections = interfaces?.master?.update?.sections?.filter(({ id }) => visibleProperties.some(({ groupId }) => groupId === id)) ?? [];
|
|
1900
|
+
return sections.map((section) => new AXPEntityUpdateViewSectionViewModel(this.entityDef, section));
|
|
1901
|
+
}, ...(ngDevMode ? [{ debugName: "sections" }] : []));
|
|
1865
1902
|
}
|
|
1866
1903
|
async save() {
|
|
1867
1904
|
this.isInProgress.set(true);
|
|
@@ -1869,10 +1906,14 @@ class AXPEntityMasterUpdateViewModel {
|
|
|
1869
1906
|
try {
|
|
1870
1907
|
const com = this.entityDef.commands?.update;
|
|
1871
1908
|
if (com) {
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1909
|
+
return new Promise((resolve) => {
|
|
1910
|
+
setTimeout(async () => {
|
|
1911
|
+
const exec = com.execute;
|
|
1912
|
+
const result = await exec(this.context());
|
|
1913
|
+
this.builder.setStatus(AXPPageStatus.Submitted);
|
|
1914
|
+
resolve(result);
|
|
1915
|
+
});
|
|
1916
|
+
});
|
|
1876
1917
|
}
|
|
1877
1918
|
}
|
|
1878
1919
|
catch (error) {
|
|
@@ -2280,6 +2321,34 @@ const AXPEntityDetailViewModelResolver = (route, state, service = inject(AXPEnti
|
|
|
2280
2321
|
return service.create(moduleName, entityName, id);
|
|
2281
2322
|
};
|
|
2282
2323
|
|
|
2324
|
+
/**
|
|
2325
|
+
* Error type that can be thrown by middlewares to abort the chain with a structured payload.
|
|
2326
|
+
*/
|
|
2327
|
+
class AXPMiddlewareAbortError extends Error {
|
|
2328
|
+
constructor(message, options = {}) {
|
|
2329
|
+
super(message);
|
|
2330
|
+
this.message = message;
|
|
2331
|
+
this.options = options;
|
|
2332
|
+
this.name = 'AXPMiddlewareAbortError';
|
|
2333
|
+
}
|
|
2334
|
+
toResponse() {
|
|
2335
|
+
return {
|
|
2336
|
+
success: false,
|
|
2337
|
+
error: {
|
|
2338
|
+
code: this.options.code,
|
|
2339
|
+
message: this.message,
|
|
2340
|
+
status: this.options.status,
|
|
2341
|
+
details: this.options.details,
|
|
2342
|
+
},
|
|
2343
|
+
};
|
|
2344
|
+
}
|
|
2345
|
+
}
|
|
2346
|
+
/** Type guard for AXPMiddlewareAbortError */
|
|
2347
|
+
function isAXPMiddlewareAbortError(error) {
|
|
2348
|
+
return error instanceof AXPMiddlewareAbortError;
|
|
2349
|
+
}
|
|
2350
|
+
//#endregion
|
|
2351
|
+
|
|
2283
2352
|
const AXP_ENTITY_STORAGE_BACKEND = new InjectionToken('AXP_ENTITY_STORAGE_BACKEND');
|
|
2284
2353
|
const AXP_ENTITY_STORAGE_MIDDLEWARE = new InjectionToken('AXP_ENTITY_STORAGE_MIDDLEWARE');
|
|
2285
2354
|
|
|
@@ -2322,6 +2391,7 @@ class AXMEntityCrudServiceImpl {
|
|
|
2322
2391
|
this._storageService = inject(AXPEntityStorageService);
|
|
2323
2392
|
this.entityRegistery = inject(AXPEntityDefinitionRegistryService);
|
|
2324
2393
|
this._entityDataProvider = new AXPEntityDataProviderImpl(this._storageService, this.entityName);
|
|
2394
|
+
this._entityCategoryDataProvider = new AXPEntityDataProviderImpl(this._storageService, `${this.entityName}Category`);
|
|
2325
2395
|
}
|
|
2326
2396
|
async insertOne(request) {
|
|
2327
2397
|
return this._entityDataProvider.insertOne(request);
|
|
@@ -2401,6 +2471,9 @@ class AXMEntityCrudServiceImpl {
|
|
|
2401
2471
|
const result = await this._entityDataProvider.query(queryRequest);
|
|
2402
2472
|
return result;
|
|
2403
2473
|
}
|
|
2474
|
+
async getCategoriesList(request = { skip: 0, take: 1000 }) {
|
|
2475
|
+
return this._entityCategoryDataProvider.query(request);
|
|
2476
|
+
}
|
|
2404
2477
|
get storageService() {
|
|
2405
2478
|
return this._storageService;
|
|
2406
2479
|
}
|
|
@@ -2457,8 +2530,10 @@ class AXPMiddlewareEntityStorageService extends AXPEntityStorageService {
|
|
|
2457
2530
|
entityName,
|
|
2458
2531
|
locals: new Map(),
|
|
2459
2532
|
backend: {
|
|
2460
|
-
|
|
2461
|
-
|
|
2533
|
+
getOne: (name, id) => this.backend.getOne(name, id),
|
|
2534
|
+
insertOne: (name, e) => this.backend.insertOne(name, e),
|
|
2535
|
+
query: (name, request) => this.backend.query(name, request),
|
|
2536
|
+
updateOne: (name, id, data) => this.backend.updateOne(name, id, data),
|
|
2462
2537
|
},
|
|
2463
2538
|
...init,
|
|
2464
2539
|
};
|
|
@@ -2861,13 +2936,13 @@ class AXPPageDetailsConverter extends AXPBaseRelatedEntityConverter {
|
|
|
2861
2936
|
return {
|
|
2862
2937
|
commands: {
|
|
2863
2938
|
reject: {
|
|
2864
|
-
title: '
|
|
2939
|
+
title: '@general:actions.discard.title',
|
|
2865
2940
|
color: 'default',
|
|
2866
2941
|
visible: '{{context.isDirty()}}',
|
|
2867
2942
|
command: { name: 'discard' },
|
|
2868
2943
|
},
|
|
2869
2944
|
accept: {
|
|
2870
|
-
title: '
|
|
2945
|
+
title: '@general:actions.confirm.title',
|
|
2871
2946
|
color: 'secondary',
|
|
2872
2947
|
visible: '{{context.isDirty()}}',
|
|
2873
2948
|
command: { name: 'update-entity' },
|
|
@@ -3012,7 +3087,7 @@ class AXPPageListConverter extends AXPBaseRelatedEntityConverter {
|
|
|
3012
3087
|
module: entityDef.module,
|
|
3013
3088
|
title: entityDef.title,
|
|
3014
3089
|
parentKey: entityDef.parentKey,
|
|
3015
|
-
source: entityDef.
|
|
3090
|
+
source: `${entityDef.module}.${entityDef.name}`,
|
|
3016
3091
|
},
|
|
3017
3092
|
data: action.scope == AXPEntityCommandScope.Selected
|
|
3018
3093
|
? executeContext
|
|
@@ -3454,7 +3529,7 @@ class AXPMainEntityContentBuilder {
|
|
|
3454
3529
|
})),
|
|
3455
3530
|
];
|
|
3456
3531
|
// eslint-disable-next-line no-console
|
|
3457
|
-
console.debug('[AXP] merge-details sorted sections', debugSections);
|
|
3532
|
+
//console.debug('[AXP] merge-details sorted sections', debugSections);
|
|
3458
3533
|
}
|
|
3459
3534
|
catch { }
|
|
3460
3535
|
const getVisiblePropertyByGroupId = async (groupId) => {
|
|
@@ -3484,7 +3559,7 @@ class AXPMainEntityContentBuilder {
|
|
|
3484
3559
|
settings: {
|
|
3485
3560
|
commands: {
|
|
3486
3561
|
reject: {
|
|
3487
|
-
title: '
|
|
3562
|
+
title: '@general:actions.discard.title',
|
|
3488
3563
|
color: 'default',
|
|
3489
3564
|
visible: '{{context.isDirty()}}',
|
|
3490
3565
|
command: {
|
|
@@ -3492,7 +3567,7 @@ class AXPMainEntityContentBuilder {
|
|
|
3492
3567
|
},
|
|
3493
3568
|
},
|
|
3494
3569
|
accept: {
|
|
3495
|
-
title: '
|
|
3570
|
+
title: '@general:actions.confirm.title',
|
|
3496
3571
|
color: 'secondary',
|
|
3497
3572
|
visible: '{{context.isDirty()}}',
|
|
3498
3573
|
command: {
|
|
@@ -3514,57 +3589,68 @@ class AXPMainEntityContentBuilder {
|
|
|
3514
3589
|
};
|
|
3515
3590
|
},
|
|
3516
3591
|
execute: async (e, context) => {
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3592
|
+
try {
|
|
3593
|
+
if (e.name == 'update-entity') {
|
|
3594
|
+
const fn = entity?.commands?.update?.execute;
|
|
3595
|
+
const result = await fn(context);
|
|
3596
|
+
return {
|
|
3597
|
+
success: true,
|
|
3598
|
+
result: result,
|
|
3599
|
+
};
|
|
3600
|
+
}
|
|
3601
|
+
else {
|
|
3602
|
+
// Find action in single interface actions
|
|
3603
|
+
const action = actions.find((a) => a.name === e.name);
|
|
3604
|
+
if (action && dependencies?.workflowService) {
|
|
3605
|
+
// Evaluate action options with current context
|
|
3606
|
+
let evaluatedOptions = action.options;
|
|
3607
|
+
if (evaluateExpressions && action.options) {
|
|
3608
|
+
try {
|
|
3609
|
+
evaluatedOptions = await evaluateExpressions(action.options);
|
|
3610
|
+
}
|
|
3611
|
+
catch {
|
|
3612
|
+
// Keep original options if evaluation fails
|
|
3613
|
+
}
|
|
3534
3614
|
}
|
|
3535
|
-
|
|
3536
|
-
|
|
3615
|
+
const commandName = e.name.split('&')[0];
|
|
3616
|
+
if (this.workflowService.exists(commandName)) {
|
|
3617
|
+
await this.workflowService.execute(commandName, {
|
|
3618
|
+
entity: getEntityInfo(entity).source,
|
|
3619
|
+
data: context,
|
|
3620
|
+
entityInfo: {
|
|
3621
|
+
name: entity.name,
|
|
3622
|
+
module: entity.module,
|
|
3623
|
+
title: entity.title,
|
|
3624
|
+
parentKey: entity.parentKey,
|
|
3625
|
+
source: `${entity.module}.${entity.name}`,
|
|
3626
|
+
},
|
|
3627
|
+
options: evaluatedOptions,
|
|
3628
|
+
metadata: action.metadata,
|
|
3629
|
+
});
|
|
3630
|
+
return {
|
|
3631
|
+
success: true,
|
|
3632
|
+
};
|
|
3633
|
+
}
|
|
3634
|
+
if (this.commandService.exists(commandName)) {
|
|
3635
|
+
// check options for evaluation
|
|
3636
|
+
await this.commandService.execute(commandName, e.options);
|
|
3537
3637
|
}
|
|
3538
3638
|
}
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
module: entity.module,
|
|
3547
|
-
title: entity.title,
|
|
3548
|
-
parentKey: entity.parentKey,
|
|
3549
|
-
source: entity.source,
|
|
3550
|
-
},
|
|
3551
|
-
options: evaluatedOptions,
|
|
3552
|
-
metadata: action.metadata,
|
|
3553
|
-
});
|
|
3554
|
-
return {
|
|
3555
|
-
success: true,
|
|
3556
|
-
};
|
|
3557
|
-
}
|
|
3558
|
-
if (this.commandService.exists(commandName)) {
|
|
3559
|
-
// check options for evaluation
|
|
3560
|
-
await this.commandService.execute(commandName, e.options);
|
|
3561
|
-
}
|
|
3639
|
+
return {
|
|
3640
|
+
success: false,
|
|
3641
|
+
error: {
|
|
3642
|
+
code: 'invalid_command',
|
|
3643
|
+
message: 'Invalid command',
|
|
3644
|
+
},
|
|
3645
|
+
};
|
|
3562
3646
|
}
|
|
3647
|
+
}
|
|
3648
|
+
catch (error) {
|
|
3563
3649
|
return {
|
|
3564
3650
|
success: false,
|
|
3565
3651
|
error: {
|
|
3566
|
-
|
|
3567
|
-
message:
|
|
3652
|
+
//TODO: handle error as object
|
|
3653
|
+
message: error,
|
|
3568
3654
|
},
|
|
3569
3655
|
};
|
|
3570
3656
|
}
|
|
@@ -4235,7 +4321,7 @@ class AXPEntityListTableService {
|
|
|
4235
4321
|
module: entity.module,
|
|
4236
4322
|
title: entity.title,
|
|
4237
4323
|
parentKey: entity.parentKey,
|
|
4238
|
-
source: entity.
|
|
4324
|
+
source: `${entity.module}.${entity.name}`,
|
|
4239
4325
|
},
|
|
4240
4326
|
data: action?.scope == AXPEntityCommandScope.Selected ? selectedRows : data,
|
|
4241
4327
|
options: options,
|
|
@@ -4511,7 +4597,7 @@ class AXPEntityListWidgetViewComponent extends AXPValueWidgetComponent {
|
|
|
4511
4597
|
module: this.entity()?.module,
|
|
4512
4598
|
title: this.entity()?.title,
|
|
4513
4599
|
parentKey: this.entity()?.parentKey,
|
|
4514
|
-
source: this.entity()?.
|
|
4600
|
+
source: `${this.entity()?.module}.${this.entity()?.name}`,
|
|
4515
4601
|
},
|
|
4516
4602
|
data: action?.scope == AXPEntityCommandScope.Selected
|
|
4517
4603
|
? this.selectedItems()
|
|
@@ -4716,7 +4802,7 @@ class AXPEntityListWidgetViewComponent extends AXPValueWidgetComponent {
|
|
|
4716
4802
|
<ax-button
|
|
4717
4803
|
[class.ax-sm]="layoutThemeService.isSmall()"
|
|
4718
4804
|
[iconOnly]="layoutThemeService.isSmall()"
|
|
4719
|
-
[text]="'actions'"
|
|
4805
|
+
[text]="'@general:terms.workflow.actions' | translate | async"
|
|
4720
4806
|
[look]="layoutThemeService.isSmall() ? 'blank' : 'solid'"
|
|
4721
4807
|
[color]="'default'"
|
|
4722
4808
|
>
|
|
@@ -4770,7 +4856,7 @@ class AXPEntityListWidgetViewComponent extends AXPValueWidgetComponent {
|
|
|
4770
4856
|
></ng-container>
|
|
4771
4857
|
}
|
|
4772
4858
|
</div>
|
|
4773
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i3.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: AXPLayoutBuilderModule }, { kind: "directive", type: i3$1.AXPWidgetRendererDirective, selector: "[axp-widget-renderer]", inputs: ["parentNode", "index", "mode", "node"], outputs: ["onOptionsChanged", "onValueChanged"], exportAs: ["widgetRenderer"] }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i3$2.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$2.AXButtonItemComponent, selector: "ax-button-item", inputs: ["color", "disabled", "text", "selected", "divided", "data", "name"], outputs: ["onClick", "onFocus", "onBlur", "disabledChange"] }, { kind: "component", type: i3$2.AXButtonItemListComponent, selector: "ax-button-item-list", inputs: ["items"], outputs: ["onItemClick"] }, { kind: "ngmodule", type: AXDropdownModule }, { kind: "component", type: i4.AXDropdownPanelComponent, selector: "ax-dropdown-panel", inputs: ["isOpen", "fitParent", "dropdownWidth", "position", "placement", "_target", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4859
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i3.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: AXPLayoutBuilderModule }, { kind: "directive", type: i3$1.AXPWidgetRendererDirective, selector: "[axp-widget-renderer]", inputs: ["parentNode", "index", "mode", "node"], outputs: ["onOptionsChanged", "onValueChanged"], exportAs: ["widgetRenderer"] }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i3$2.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$2.AXButtonItemComponent, selector: "ax-button-item", inputs: ["color", "disabled", "text", "selected", "divided", "data", "name"], outputs: ["onClick", "onFocus", "onBlur", "disabledChange"] }, { kind: "component", type: i3$2.AXButtonItemListComponent, selector: "ax-button-item-list", inputs: ["items"], outputs: ["onItemClick"] }, { kind: "ngmodule", type: AXDropdownModule }, { kind: "component", type: i4.AXDropdownPanelComponent, selector: "ax-dropdown-panel", inputs: ["isOpen", "fitParent", "dropdownWidth", "position", "placement", "_target", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "pipe", type: i5.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4774
4860
|
}
|
|
4775
4861
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityListWidgetViewComponent, decorators: [{
|
|
4776
4862
|
type: Component,
|
|
@@ -4822,7 +4908,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImpor
|
|
|
4822
4908
|
<ax-button
|
|
4823
4909
|
[class.ax-sm]="layoutThemeService.isSmall()"
|
|
4824
4910
|
[iconOnly]="layoutThemeService.isSmall()"
|
|
4825
|
-
[text]="'actions'"
|
|
4911
|
+
[text]="'@general:terms.workflow.actions' | translate | async"
|
|
4826
4912
|
[look]="layoutThemeService.isSmall() ? 'blank' : 'solid'"
|
|
4827
4913
|
[color]="'default'"
|
|
4828
4914
|
>
|
|
@@ -4883,7 +4969,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImpor
|
|
|
4883
4969
|
},
|
|
4884
4970
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
4885
4971
|
providers: [AXPEntityListTableService, AXPEntityListToolbarService],
|
|
4886
|
-
imports: [CommonModule, AXDecoratorModule, AXPLayoutBuilderModule, AXButtonModule, AXDropdownModule],
|
|
4972
|
+
imports: [CommonModule, AXDecoratorModule, AXPLayoutBuilderModule, AXButtonModule, AXDropdownModule, AXTranslationModule],
|
|
4887
4973
|
}]
|
|
4888
4974
|
}] });
|
|
4889
4975
|
|
|
@@ -5174,383 +5260,193 @@ var lookupWidgetView_component = /*#__PURE__*/Object.freeze({
|
|
|
5174
5260
|
AXPLookupWidgetViewComponent: AXPLookupWidgetViewComponent
|
|
5175
5261
|
});
|
|
5176
5262
|
|
|
5177
|
-
|
|
5263
|
+
//#endregion
|
|
5264
|
+
class AXPEntityDataSelectorService {
|
|
5178
5265
|
constructor() {
|
|
5179
|
-
|
|
5180
|
-
this.
|
|
5181
|
-
this.
|
|
5182
|
-
this.
|
|
5183
|
-
this.allowSelect = computed(() => this.selectedItems().length > 0, ...(ngDevMode ? [{ debugName: "allowSelect" }] : []));
|
|
5184
|
-
}
|
|
5185
|
-
ngAfterViewInit() {
|
|
5186
|
-
if (this.initialSelectedItems.length > 0 && this.grid()) {
|
|
5187
|
-
this.grid()?.selectRows(...this.initialSelectedItems);
|
|
5188
|
-
}
|
|
5189
|
-
if (this.searchTerm) {
|
|
5190
|
-
this.vm.applyInlineFilter(this.searchTerm);
|
|
5191
|
-
}
|
|
5192
|
-
else {
|
|
5193
|
-
this.vm.applyFilterAndSort();
|
|
5194
|
-
}
|
|
5266
|
+
//#region ---- Services & Dependencies ----
|
|
5267
|
+
this.dataSelectorService = inject(AXPDataSelectorService);
|
|
5268
|
+
this.filterOperatorMiddleware = inject(AXPFilterOperatorMiddlewareService);
|
|
5269
|
+
this.widgetResolver = inject(AXPWidgetRegistryService);
|
|
5195
5270
|
}
|
|
5196
|
-
|
|
5197
|
-
|
|
5271
|
+
//#endregion
|
|
5272
|
+
//#region ---- Public Methods ----
|
|
5273
|
+
/**
|
|
5274
|
+
* Open entity data selector popup
|
|
5275
|
+
*/
|
|
5276
|
+
async open(options) {
|
|
5277
|
+
const config = this.createDataSelectorConfig(options);
|
|
5278
|
+
const result = await this.dataSelectorService.open(config);
|
|
5279
|
+
return result;
|
|
5198
5280
|
}
|
|
5199
|
-
|
|
5200
|
-
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
|
|
5204
|
-
|
|
5205
|
-
|
|
5206
|
-
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
}
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
}
|
|
5215
|
-
else {
|
|
5216
|
-
this.selectedItems.set([e.data]);
|
|
5217
|
-
}
|
|
5281
|
+
/**
|
|
5282
|
+
* Open entity data selector with category filter
|
|
5283
|
+
*/
|
|
5284
|
+
async openWithCategoryFilter(options, categoryFilterConfig) {
|
|
5285
|
+
const config = this.createDataSelectorConfig({
|
|
5286
|
+
...options,
|
|
5287
|
+
allowCreate: false
|
|
5288
|
+
});
|
|
5289
|
+
// Add category filter to config
|
|
5290
|
+
config.categoryFilter = {
|
|
5291
|
+
enabled: true,
|
|
5292
|
+
...categoryFilterConfig
|
|
5293
|
+
};
|
|
5294
|
+
const result = await this.dataSelectorService.open(config);
|
|
5295
|
+
return result;
|
|
5218
5296
|
}
|
|
5219
|
-
|
|
5220
|
-
|
|
5297
|
+
//#endregion
|
|
5298
|
+
//#region ---- Private Methods ----
|
|
5299
|
+
/**
|
|
5300
|
+
* Create data selector configuration from entity options
|
|
5301
|
+
*/
|
|
5302
|
+
createDataSelectorConfig(options) {
|
|
5303
|
+
const dataSource = this.createDataSource(options);
|
|
5304
|
+
const columns = this.createColumns(options);
|
|
5305
|
+
const searchFields = this.getSearchFields(options);
|
|
5306
|
+
return {
|
|
5307
|
+
title: options.title,
|
|
5308
|
+
dataSource,
|
|
5309
|
+
columns,
|
|
5310
|
+
selectionMode: options.allowMultiple ? 'multiple' : 'single',
|
|
5311
|
+
searchFields,
|
|
5312
|
+
parentField: options.entity.parentKey,
|
|
5313
|
+
allowCreate: options.allowCreate ?? this.canCreate(options.entity),
|
|
5314
|
+
// Note: Custom filters will be applied to the dataSource in createDataSource
|
|
5315
|
+
};
|
|
5221
5316
|
}
|
|
5222
|
-
|
|
5223
|
-
|
|
5224
|
-
|
|
5225
|
-
|
|
5226
|
-
|
|
5227
|
-
|
|
5228
|
-
this.close();
|
|
5229
|
-
await this.vm.create();
|
|
5230
|
-
}
|
|
5231
|
-
handleCloseClick() {
|
|
5232
|
-
this.close();
|
|
5233
|
-
}
|
|
5234
|
-
handleSelectClick() {
|
|
5235
|
-
this.close({ items: this.selectedItems() });
|
|
5236
|
-
}
|
|
5237
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPLookupWidgetSelectorComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
5238
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.8", type: AXPLookupWidgetSelectorComponent, isStandalone: true, selector: "ng-component", viewQueries: [{ propertyName: "grid", first: true, predicate: ["grid"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: `
|
|
5239
|
-
<div class="ax-p-4 ax-flex ax-flex-col ax-gap-4 ax-overflow-hidden">
|
|
5240
|
-
@if (vm.hasInlineFilters()) {
|
|
5241
|
-
<div class="ax-w-full">
|
|
5242
|
-
<ax-search-box
|
|
5243
|
-
[placeholder]="('widget.lookup.search' | translate | async) + vm.inlineFiltersPlaceholders().join(', ')"
|
|
5244
|
-
[value]="searchTerm"
|
|
5245
|
-
(onValueChanged)="handleChangeSearchValue($event)"
|
|
5246
|
-
[axAutoFocus]="true"
|
|
5247
|
-
><ax-clear-button></ax-clear-button
|
|
5248
|
-
></ax-search-box>
|
|
5249
|
-
</div>
|
|
5250
|
-
}
|
|
5251
|
-
<ax-data-table
|
|
5252
|
-
#grid
|
|
5253
|
-
[showFooter]="false"
|
|
5254
|
-
class="ax-h-[50vh]"
|
|
5255
|
-
[paging]="true"
|
|
5256
|
-
[fetchDataMode]="'manual'"
|
|
5257
|
-
[loading]="{ enabled: true, animation: true }"
|
|
5258
|
-
[dataSource]="vm.dataSource"
|
|
5259
|
-
[parentField]="vm.parentKey()"
|
|
5260
|
-
(selectedRowsChange)="handleSelectedRowsChange($event)"
|
|
5261
|
-
(onRowClick)="handleRowClick($event)"
|
|
5262
|
-
(onRowDbClick)="handleRowDbClick($event)"
|
|
5263
|
-
>
|
|
5264
|
-
@if (vm.allowMultiple()) {
|
|
5265
|
-
<ax-select-column fixed="start" [width]="'50px'"></ax-select-column>
|
|
5266
|
-
}
|
|
5267
|
-
@for (col of vm.columns(); track col.name) {
|
|
5268
|
-
@if (col.visible) {
|
|
5269
|
-
<axp-widget-column-renderer
|
|
5270
|
-
[expandHandler]="$index === 0 && vm.parentKey() ? true : false"
|
|
5271
|
-
[caption]="col.title | translate | async"
|
|
5272
|
-
[node]="col.node()"
|
|
5273
|
-
></axp-widget-column-renderer>
|
|
5274
|
-
}
|
|
5275
|
-
}
|
|
5276
|
-
</ax-data-table>
|
|
5277
|
-
</div>
|
|
5278
|
-
<ax-footer>
|
|
5279
|
-
<ax-suffix>
|
|
5280
|
-
<ax-button look="solid" [text]="('close' | translate | async)!" (onClick)="handleCloseClick()"> </ax-button>
|
|
5281
|
-
<ax-button
|
|
5282
|
-
look="solid"
|
|
5283
|
-
color="primary"
|
|
5284
|
-
[text]="('select' | translate | async)!"
|
|
5285
|
-
(onClick)="handleSelectClick()"
|
|
5286
|
-
[disabled]="allowSelect() === false"
|
|
5287
|
-
>
|
|
5288
|
-
</ax-button>
|
|
5289
|
-
@if (!vm.canCreate()) {
|
|
5290
|
-
<ax-button
|
|
5291
|
-
look="solid"
|
|
5292
|
-
color="primary"
|
|
5293
|
-
[text]="'Create-New' | translate | async"
|
|
5294
|
-
(onClick)="handleCreateNewClick()"
|
|
5295
|
-
>
|
|
5296
|
-
<ax-prefix>
|
|
5297
|
-
<ax-icon icon="fa-solid fa-add"></ax-icon>
|
|
5298
|
-
</ax-prefix>
|
|
5299
|
-
</ax-button>
|
|
5300
|
-
}
|
|
5301
|
-
</ax-suffix>
|
|
5302
|
-
</ax-footer>
|
|
5303
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXCommonModule }, { kind: "directive", type: i1$1.AXAutoFocusDirective, selector: "[axAutoFocus]", inputs: ["axAutoFocus", "axAutoFocusTime"] }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i3$2.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: AXFormModule }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i3.AXDecoratorClearButtonComponent, selector: "ax-clear-button", inputs: ["icon"] }, { kind: "component", type: i3.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: AXDropdownButtonModule }, { kind: "ngmodule", type: AXDataTableModule }, { kind: "component", type: i4$2.AXDataTableComponent, selector: "ax-data-table", inputs: ["dataSource", "selectedRows", "parentField", "rowTemplate", "emptyTemplate", "noDataTemplate", "alternative", "showHeader", "fixedHeader", "showFooter", "fixedFooter", "itemHeight", "allowReordering", "paging", "fetchDataMode", "loading", "focusedRow"], outputs: ["selectedRowsChange", "focusedRowChange", "onRowClick", "onRowDbClick", "onColumnsOrderChanged", "onColumnSizeChanged", "onPageChanged"] }, { kind: "component", type: i4$2.AXRowSelectColumnComponent, selector: "ax-select-column", inputs: ["width", "caption", "fixed"] }, { kind: "ngmodule", type: AXSearchBoxModule }, { kind: "component", type: i5.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: "ngmodule", type: AXPLayoutBuilderModule }, { kind: "component", type: i3$1.AXPWidgetColumnRendererComponent, selector: "axp-widget-column-renderer", inputs: ["caption", "customExpandIcon", "customCollapseIcon", "customWidth", "node", "footerTemplate", "expandHandler", "cellTemplate", "headerTemplate"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "pipe", type: i7.AsyncPipe, name: "async" }, { kind: "pipe", type: i8.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5304
|
-
}
|
|
5305
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPLookupWidgetSelectorComponent, decorators: [{
|
|
5306
|
-
type: Component,
|
|
5307
|
-
args: [{
|
|
5308
|
-
template: `
|
|
5309
|
-
<div class="ax-p-4 ax-flex ax-flex-col ax-gap-4 ax-overflow-hidden">
|
|
5310
|
-
@if (vm.hasInlineFilters()) {
|
|
5311
|
-
<div class="ax-w-full">
|
|
5312
|
-
<ax-search-box
|
|
5313
|
-
[placeholder]="('widget.lookup.search' | translate | async) + vm.inlineFiltersPlaceholders().join(', ')"
|
|
5314
|
-
[value]="searchTerm"
|
|
5315
|
-
(onValueChanged)="handleChangeSearchValue($event)"
|
|
5316
|
-
[axAutoFocus]="true"
|
|
5317
|
-
><ax-clear-button></ax-clear-button
|
|
5318
|
-
></ax-search-box>
|
|
5319
|
-
</div>
|
|
5320
|
-
}
|
|
5321
|
-
<ax-data-table
|
|
5322
|
-
#grid
|
|
5323
|
-
[showFooter]="false"
|
|
5324
|
-
class="ax-h-[50vh]"
|
|
5325
|
-
[paging]="true"
|
|
5326
|
-
[fetchDataMode]="'manual'"
|
|
5327
|
-
[loading]="{ enabled: true, animation: true }"
|
|
5328
|
-
[dataSource]="vm.dataSource"
|
|
5329
|
-
[parentField]="vm.parentKey()"
|
|
5330
|
-
(selectedRowsChange)="handleSelectedRowsChange($event)"
|
|
5331
|
-
(onRowClick)="handleRowClick($event)"
|
|
5332
|
-
(onRowDbClick)="handleRowDbClick($event)"
|
|
5333
|
-
>
|
|
5334
|
-
@if (vm.allowMultiple()) {
|
|
5335
|
-
<ax-select-column fixed="start" [width]="'50px'"></ax-select-column>
|
|
5336
|
-
}
|
|
5337
|
-
@for (col of vm.columns(); track col.name) {
|
|
5338
|
-
@if (col.visible) {
|
|
5339
|
-
<axp-widget-column-renderer
|
|
5340
|
-
[expandHandler]="$index === 0 && vm.parentKey() ? true : false"
|
|
5341
|
-
[caption]="col.title | translate | async"
|
|
5342
|
-
[node]="col.node()"
|
|
5343
|
-
></axp-widget-column-renderer>
|
|
5344
|
-
}
|
|
5345
|
-
}
|
|
5346
|
-
</ax-data-table>
|
|
5347
|
-
</div>
|
|
5348
|
-
<ax-footer>
|
|
5349
|
-
<ax-suffix>
|
|
5350
|
-
<ax-button look="solid" [text]="('close' | translate | async)!" (onClick)="handleCloseClick()"> </ax-button>
|
|
5351
|
-
<ax-button
|
|
5352
|
-
look="solid"
|
|
5353
|
-
color="primary"
|
|
5354
|
-
[text]="('select' | translate | async)!"
|
|
5355
|
-
(onClick)="handleSelectClick()"
|
|
5356
|
-
[disabled]="allowSelect() === false"
|
|
5357
|
-
>
|
|
5358
|
-
</ax-button>
|
|
5359
|
-
@if (!vm.canCreate()) {
|
|
5360
|
-
<ax-button
|
|
5361
|
-
look="solid"
|
|
5362
|
-
color="primary"
|
|
5363
|
-
[text]="'Create-New' | translate | async"
|
|
5364
|
-
(onClick)="handleCreateNewClick()"
|
|
5365
|
-
>
|
|
5366
|
-
<ax-prefix>
|
|
5367
|
-
<ax-icon icon="fa-solid fa-add"></ax-icon>
|
|
5368
|
-
</ax-prefix>
|
|
5369
|
-
</ax-button>
|
|
5370
|
-
}
|
|
5371
|
-
</ax-suffix>
|
|
5372
|
-
</ax-footer>
|
|
5373
|
-
`,
|
|
5374
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
5375
|
-
imports: [
|
|
5376
|
-
CommonModule,
|
|
5377
|
-
AXCommonModule,
|
|
5378
|
-
AXButtonModule,
|
|
5379
|
-
AXFormModule,
|
|
5380
|
-
AXDecoratorModule,
|
|
5381
|
-
AXDropdownButtonModule,
|
|
5382
|
-
AXDataTableModule,
|
|
5383
|
-
AXSearchBoxModule,
|
|
5384
|
-
AXPLayoutBuilderModule,
|
|
5385
|
-
AXTranslationModule,
|
|
5386
|
-
],
|
|
5387
|
-
inputs: [],
|
|
5388
|
-
}]
|
|
5389
|
-
}] });
|
|
5390
|
-
|
|
5391
|
-
class AXPLookupWidgetSelectorViewModel {
|
|
5392
|
-
constructor(injector, entityDef, options = {
|
|
5393
|
-
parentFilters: null,
|
|
5394
|
-
customFilter: null,
|
|
5395
|
-
sortedFields: [],
|
|
5396
|
-
columns: [],
|
|
5397
|
-
}) {
|
|
5398
|
-
this.injector = injector;
|
|
5399
|
-
this.entityDef = entityDef;
|
|
5400
|
-
this.options = options;
|
|
5401
|
-
this.workflow = this.injector.get(AXPWorkflowService);
|
|
5402
|
-
this.filterOperatorMiddleware = this.injector.get(AXPFilterOperatorMiddlewareService);
|
|
5403
|
-
this.widgetResolver = this.injector.get(AXPWidgetRegistryService);
|
|
5404
|
-
this.dataSource = new AXDataSource({
|
|
5317
|
+
/**
|
|
5318
|
+
* Create data source from entity definition
|
|
5319
|
+
*/
|
|
5320
|
+
createDataSource(options) {
|
|
5321
|
+
const { entity, customFilter, parentFilters } = options;
|
|
5322
|
+
return new AXDataSource({
|
|
5405
5323
|
byKey: (key) => {
|
|
5406
|
-
const func =
|
|
5324
|
+
const func = entity.queries.byKey.execute;
|
|
5407
5325
|
return func();
|
|
5408
5326
|
},
|
|
5409
5327
|
load: (e) => {
|
|
5410
|
-
const func =
|
|
5411
|
-
this.
|
|
5328
|
+
const func = entity.queries.list?.execute;
|
|
5329
|
+
this.mergeFilters(e, customFilter, parentFilters);
|
|
5412
5330
|
return func(e);
|
|
5413
5331
|
},
|
|
5414
5332
|
pageSize: 10,
|
|
5415
5333
|
key: 'id',
|
|
5416
5334
|
});
|
|
5417
|
-
|
|
5418
|
-
|
|
5419
|
-
|
|
5420
|
-
|
|
5421
|
-
|
|
5422
|
-
|
|
5423
|
-
|
|
5424
|
-
|
|
5425
|
-
|
|
5426
|
-
|
|
5427
|
-
|
|
5428
|
-
|
|
5429
|
-
|
|
5430
|
-
|
|
5431
|
-
|
|
5432
|
-
|
|
5433
|
-
|
|
5434
|
-
|
|
5435
|
-
|
|
5436
|
-
|
|
5437
|
-
|
|
5438
|
-
|
|
5439
|
-
|
|
5440
|
-
|
|
5441
|
-
|
|
5442
|
-
|
|
5443
|
-
|
|
5444
|
-
|
|
5445
|
-
title: column.title ?? '',
|
|
5446
|
-
schema: {
|
|
5447
|
-
dataType: 'string',
|
|
5448
|
-
interface: {
|
|
5449
|
-
type: column.showAs.type,
|
|
5450
|
-
options: column.showAs.options,
|
|
5451
|
-
},
|
|
5335
|
+
}
|
|
5336
|
+
/**
|
|
5337
|
+
* Create columns configuration from entity definition
|
|
5338
|
+
*/
|
|
5339
|
+
createColumns(options) {
|
|
5340
|
+
const { entity, columns = [] } = options;
|
|
5341
|
+
const { columns: entityColumns = [], properties } = entity;
|
|
5342
|
+
const visibleProperties = properties.filter(({ schema }) => !schema?.hidden);
|
|
5343
|
+
const visiblePropNames = new Set(visibleProperties.map(({ name }) => name));
|
|
5344
|
+
return entityColumns
|
|
5345
|
+
.filter(({ name, showAs }) => visiblePropNames.has(name) || showAs)
|
|
5346
|
+
.filter(({ name }) => columns.length === 0 || columns.includes(name))
|
|
5347
|
+
.map((column) => {
|
|
5348
|
+
let property;
|
|
5349
|
+
let widgetType;
|
|
5350
|
+
let widgetOptions;
|
|
5351
|
+
if (column.showAs) {
|
|
5352
|
+
// Use custom column configuration
|
|
5353
|
+
const widgetConfig = this.widgetResolver.resolve(column.showAs.type);
|
|
5354
|
+
property = {
|
|
5355
|
+
...widgetConfig,
|
|
5356
|
+
name: column.name,
|
|
5357
|
+
title: column.title ?? '',
|
|
5358
|
+
schema: {
|
|
5359
|
+
dataType: 'string',
|
|
5360
|
+
interface: {
|
|
5361
|
+
type: column.showAs.type,
|
|
5362
|
+
options: column.showAs.options,
|
|
5452
5363
|
},
|
|
5453
|
-
}
|
|
5454
|
-
|
|
5455
|
-
|
|
5456
|
-
|
|
5457
|
-
|
|
5458
|
-
|
|
5364
|
+
},
|
|
5365
|
+
};
|
|
5366
|
+
widgetType = column.showAs.type;
|
|
5367
|
+
widgetOptions = column.showAs.options;
|
|
5368
|
+
}
|
|
5369
|
+
else {
|
|
5370
|
+
// Use entity property configuration
|
|
5371
|
+
property = visibleProperties.find(({ name }) => name === column.name);
|
|
5372
|
+
widgetType = property.schema?.interface?.type || 'text';
|
|
5373
|
+
widgetOptions = property.schema?.interface?.options || {};
|
|
5374
|
+
}
|
|
5375
|
+
return {
|
|
5376
|
+
name: column.name,
|
|
5377
|
+
title: property.title || column.title || column.name,
|
|
5378
|
+
visible: true,
|
|
5379
|
+
widget: {
|
|
5380
|
+
type: widgetType,
|
|
5381
|
+
options: widgetOptions
|
|
5459
5382
|
}
|
|
5460
|
-
}
|
|
5461
|
-
};
|
|
5462
|
-
this.inlineFilters = {
|
|
5463
|
-
field: null,
|
|
5464
|
-
logic: 'or',
|
|
5465
|
-
operator: null,
|
|
5466
|
-
filters: [],
|
|
5467
|
-
};
|
|
5468
|
-
this.advanceFilters = {
|
|
5469
|
-
field: null,
|
|
5470
|
-
logic: 'and',
|
|
5471
|
-
operator: null,
|
|
5472
|
-
filters: [],
|
|
5473
|
-
};
|
|
5474
|
-
}
|
|
5475
|
-
async create() {
|
|
5476
|
-
await this.workflow.execute('create-entity', {
|
|
5477
|
-
entity: getEntityInfo(this.entityDef).source,
|
|
5383
|
+
};
|
|
5478
5384
|
});
|
|
5479
5385
|
}
|
|
5480
|
-
|
|
5481
|
-
|
|
5482
|
-
|
|
5483
|
-
|
|
5484
|
-
|
|
5485
|
-
|
|
5486
|
-
|
|
5487
|
-
operator: {
|
|
5488
|
-
type: 'contains',
|
|
5489
|
-
},
|
|
5490
|
-
value,
|
|
5491
|
-
});
|
|
5492
|
-
});
|
|
5386
|
+
/**
|
|
5387
|
+
* Get searchable fields from entity properties
|
|
5388
|
+
*/
|
|
5389
|
+
getSearchFields(options) {
|
|
5390
|
+
const { entity, searchFields } = options;
|
|
5391
|
+
if (searchFields && searchFields.length > 0) {
|
|
5392
|
+
return searchFields;
|
|
5493
5393
|
}
|
|
5494
|
-
|
|
5495
|
-
|
|
5394
|
+
// Auto-detect searchable fields from entity properties
|
|
5395
|
+
return entity.properties
|
|
5396
|
+
.filter(p => p.options?.filter?.inline?.enabled)
|
|
5397
|
+
.map(p => p.name);
|
|
5496
5398
|
}
|
|
5497
|
-
|
|
5498
|
-
|
|
5499
|
-
|
|
5500
|
-
|
|
5501
|
-
|
|
5502
|
-
|
|
5503
|
-
|
|
5504
|
-
|
|
5505
|
-
|
|
5399
|
+
/**
|
|
5400
|
+
* Check if entity supports create operation
|
|
5401
|
+
*/
|
|
5402
|
+
canCreate(entity) {
|
|
5403
|
+
return entity.commands?.create?.execute != null;
|
|
5404
|
+
}
|
|
5405
|
+
/**
|
|
5406
|
+
* Merge custom and parent filters into data source query
|
|
5407
|
+
*/
|
|
5408
|
+
mergeFilters(request, customFilter, parentFilters) {
|
|
5409
|
+
if (!customFilter && !parentFilters) {
|
|
5410
|
+
return request;
|
|
5411
|
+
}
|
|
5506
5412
|
const filters = [];
|
|
5507
|
-
|
|
5508
|
-
|
|
5413
|
+
// Add custom filter
|
|
5414
|
+
if (customFilter) {
|
|
5415
|
+
const cleanedFilters = AXPCleanNestedFilters([customFilter]);
|
|
5509
5416
|
if (cleanedFilters.length > 0) {
|
|
5510
5417
|
filters.push(this.filterOperatorMiddleware.transformFilter(cleanedFilters[0]));
|
|
5511
5418
|
}
|
|
5512
5419
|
}
|
|
5513
|
-
|
|
5514
|
-
|
|
5515
|
-
|
|
5516
|
-
if (hasParentFilters && this.options.parentFilters) {
|
|
5517
|
-
filters.push(this.options.parentFilters);
|
|
5518
|
-
}
|
|
5519
|
-
// Apply the filters to the dataSource
|
|
5520
|
-
this.dataSource.filter({
|
|
5521
|
-
field: null,
|
|
5522
|
-
logic: 'and',
|
|
5523
|
-
operator: null,
|
|
5524
|
-
filters: filters,
|
|
5525
|
-
});
|
|
5526
|
-
// Refresh the dataSource
|
|
5527
|
-
this.dataSource.refresh();
|
|
5528
|
-
}
|
|
5529
|
-
async find(value) {
|
|
5530
|
-
this.applyInlineFilter(value.trim(), false);
|
|
5531
|
-
const func = this.entityDef.queries.list?.execute;
|
|
5532
|
-
return (await func({ filter: this.inlineFilters, take: 10 })) ?? [];
|
|
5533
|
-
}
|
|
5534
|
-
setCustomFilter(filter) {
|
|
5535
|
-
this.options.customFilter = filter;
|
|
5536
|
-
this.applyFilterAndSort();
|
|
5537
|
-
}
|
|
5538
|
-
mergeFilter(request, filter) {
|
|
5539
|
-
if (!filter) {
|
|
5540
|
-
return request;
|
|
5420
|
+
// Add parent filters
|
|
5421
|
+
if (parentFilters) {
|
|
5422
|
+
filters.push(parentFilters);
|
|
5541
5423
|
}
|
|
5424
|
+
// Merge with existing filter
|
|
5542
5425
|
if (request.filter) {
|
|
5543
5426
|
request.filter = {
|
|
5544
5427
|
logic: 'and',
|
|
5545
|
-
filters: [...[request.filter], ...
|
|
5428
|
+
filters: [...[request.filter], ...filters]
|
|
5546
5429
|
};
|
|
5547
5430
|
}
|
|
5548
5431
|
else {
|
|
5549
|
-
request.filter =
|
|
5432
|
+
request.filter = {
|
|
5433
|
+
field: null,
|
|
5434
|
+
logic: 'and',
|
|
5435
|
+
operator: null,
|
|
5436
|
+
filters: filters,
|
|
5437
|
+
};
|
|
5550
5438
|
}
|
|
5551
5439
|
return request;
|
|
5552
5440
|
}
|
|
5441
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityDataSelectorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
5442
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityDataSelectorService, providedIn: 'root' }); }
|
|
5553
5443
|
}
|
|
5444
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityDataSelectorService, decorators: [{
|
|
5445
|
+
type: Injectable,
|
|
5446
|
+
args: [{
|
|
5447
|
+
providedIn: 'root'
|
|
5448
|
+
}]
|
|
5449
|
+
}] });
|
|
5554
5450
|
|
|
5555
5451
|
class AXPLookupWidgetEditComponent extends AXPValueWidgetComponent {
|
|
5556
5452
|
constructor() {
|
|
@@ -5559,6 +5455,7 @@ class AXPLookupWidgetEditComponent extends AXPValueWidgetComponent {
|
|
|
5559
5455
|
this.entityResolver = inject(AXPEntityResolver);
|
|
5560
5456
|
this.formatService = inject(AXFormatService);
|
|
5561
5457
|
this.popupService = inject(AXPopupService);
|
|
5458
|
+
this.entityDataSelectorService = inject(AXPEntityDataSelectorService);
|
|
5562
5459
|
this.translateService = inject(AXTranslationService);
|
|
5563
5460
|
this.expose = computed(() => this.options()['expose'], ...(ngDevMode ? [{ debugName: "expose" }] : []));
|
|
5564
5461
|
this.entity = computed(() => this.options()['entity'], ...(ngDevMode ? [{ debugName: "entity" }] : []));
|
|
@@ -5584,24 +5481,37 @@ class AXPLookupWidgetEditComponent extends AXPValueWidgetComponent {
|
|
|
5584
5481
|
}, ...(ngDevMode ? [{ debugName: "selectedItemsText" }] : []));
|
|
5585
5482
|
this.valueField = computed(() => this.entityDef()?.properties.find((c) => c.name == 'id')?.name ?? 'id', ...(ngDevMode ? [{ debugName: "valueField" }] : []));
|
|
5586
5483
|
this.entityDef = signal(null, ...(ngDevMode ? [{ debugName: "entityDef" }] : []));
|
|
5484
|
+
this.dataSource = computed(() => {
|
|
5485
|
+
const entity = this.entityDef();
|
|
5486
|
+
if (!entity)
|
|
5487
|
+
return null;
|
|
5488
|
+
return new AXDataSource({
|
|
5489
|
+
byKey: (key) => {
|
|
5490
|
+
const func = entity.queries.byKey.execute;
|
|
5491
|
+
return func();
|
|
5492
|
+
},
|
|
5493
|
+
load: (e) => {
|
|
5494
|
+
const func = entity.queries.list?.execute;
|
|
5495
|
+
this.mergeFilter(e, this.customFilter());
|
|
5496
|
+
return func(e);
|
|
5497
|
+
},
|
|
5498
|
+
pageSize: 10,
|
|
5499
|
+
key: 'id',
|
|
5500
|
+
});
|
|
5501
|
+
}, ...(ngDevMode ? [{ debugName: "dataSource" }] : []));
|
|
5587
5502
|
this.searchTerm = signal(null, ...(ngDevMode ? [{ debugName: "searchTerm" }] : []));
|
|
5588
5503
|
this.selectedItems = signal([], ...(ngDevMode ? [{ debugName: "selectedItems" }] : []));
|
|
5589
5504
|
this.textbox = viewChild(AXTagBoxComponent, ...(ngDevMode ? [{ debugName: "textbox" }] : []));
|
|
5590
5505
|
this.isLoading = signal(false, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
|
|
5591
5506
|
this.isOpen = signal(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : []));
|
|
5592
|
-
this.vm = signal(null, ...(ngDevMode ? [{ debugName: "vm" }] : []));
|
|
5593
5507
|
this.placeholder = computed(() => {
|
|
5594
5508
|
return this.selectedItems().length
|
|
5595
5509
|
? ''
|
|
5596
|
-
: this.translateService.translateSync('
|
|
5510
|
+
: this.translateService.translateSync('@general:widgets.lookup.search');
|
|
5597
5511
|
}, ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
5598
5512
|
this.#efEntity = effect(async () => {
|
|
5599
5513
|
const [module, entity] = this.entity().split('.');
|
|
5600
5514
|
this.entityDef.set(await this.entityResolver.get(module, entity));
|
|
5601
|
-
this.vm.set(new AXPLookupWidgetSelectorViewModel(this.injector, this.entityDef(), {
|
|
5602
|
-
parentFilters: this.filter,
|
|
5603
|
-
allowMultiple: this.multiple(),
|
|
5604
|
-
}));
|
|
5605
5515
|
}, ...(ngDevMode ? [{ debugName: "#efEntity" }] : []));
|
|
5606
5516
|
this.#efValue = effect(() => {
|
|
5607
5517
|
if (this.getValue()) {
|
|
@@ -5611,15 +5521,9 @@ class AXPLookupWidgetEditComponent extends AXPValueWidgetComponent {
|
|
|
5611
5521
|
this.clear();
|
|
5612
5522
|
}
|
|
5613
5523
|
}, ...(ngDevMode ? [{ debugName: "#efValue" }] : []));
|
|
5614
|
-
this.#efCustomFilter = effect(() => {
|
|
5615
|
-
if (this.customFilter()) {
|
|
5616
|
-
this.vm()?.setCustomFilter(this.customFilter());
|
|
5617
|
-
}
|
|
5618
|
-
}, ...(ngDevMode ? [{ debugName: "#efCustomFilter" }] : []));
|
|
5619
5524
|
}
|
|
5620
5525
|
#efEntity;
|
|
5621
5526
|
#efValue;
|
|
5622
|
-
#efCustomFilter;
|
|
5623
5527
|
async findByValue() {
|
|
5624
5528
|
this.isLoading.set(true);
|
|
5625
5529
|
const rawValue = this.getValue();
|
|
@@ -5644,31 +5548,29 @@ class AXPLookupWidgetEditComponent extends AXPValueWidgetComponent {
|
|
|
5644
5548
|
handleOnClick(e) {
|
|
5645
5549
|
this.showSelector();
|
|
5646
5550
|
}
|
|
5647
|
-
showSelector() {
|
|
5551
|
+
async showSelector() {
|
|
5648
5552
|
this.isOpen.set(true);
|
|
5649
|
-
|
|
5650
|
-
|
|
5651
|
-
|
|
5652
|
-
|
|
5653
|
-
|
|
5654
|
-
|
|
5655
|
-
|
|
5656
|
-
|
|
5657
|
-
|
|
5658
|
-
|
|
5659
|
-
|
|
5660
|
-
|
|
5661
|
-
|
|
5662
|
-
|
|
5663
|
-
|
|
5664
|
-
|
|
5665
|
-
|
|
5553
|
+
try {
|
|
5554
|
+
const result = await this.entityDataSelectorService.open({
|
|
5555
|
+
entity: this.entityDef(),
|
|
5556
|
+
title: `${this.translateService.translateSync('@general:widgets.lookup.search')} ${this.translateService.translateSync(this.entityDef()?.formats.plural ?? '')}`,
|
|
5557
|
+
allowMultiple: this.multiple(),
|
|
5558
|
+
customFilter: this.customFilter(),
|
|
5559
|
+
parentFilters: this.filter,
|
|
5560
|
+
columns: this.columns(),
|
|
5561
|
+
allowCreate: true
|
|
5562
|
+
});
|
|
5563
|
+
if (result && 'items' in result) {
|
|
5564
|
+
this.setItems(result.items);
|
|
5565
|
+
}
|
|
5566
|
+
}
|
|
5567
|
+
catch (error) {
|
|
5568
|
+
console.error('Error opening entity data selector:', error);
|
|
5569
|
+
}
|
|
5570
|
+
finally {
|
|
5666
5571
|
this.isOpen.set(false);
|
|
5667
5572
|
this.textbox()?.focus();
|
|
5668
|
-
|
|
5669
|
-
this.setItems(e.data?.items);
|
|
5670
|
-
}
|
|
5671
|
-
});
|
|
5573
|
+
}
|
|
5672
5574
|
}
|
|
5673
5575
|
selectBoxValueChange(e) {
|
|
5674
5576
|
const items = e.component.selectedItems;
|
|
@@ -5697,7 +5599,7 @@ class AXPLookupWidgetEditComponent extends AXPValueWidgetComponent {
|
|
|
5697
5599
|
this.searchTerm.set(value);
|
|
5698
5600
|
if ((keyEvent.code == 'Enter' || keyEvent.code == 'NumpadEnter') && value) {
|
|
5699
5601
|
this.isLoading.set(true);
|
|
5700
|
-
const result = await this.
|
|
5602
|
+
const result = await this.searchByValue(value);
|
|
5701
5603
|
if (result?.total == 1) {
|
|
5702
5604
|
this.setItems(result.items[0]);
|
|
5703
5605
|
}
|
|
@@ -5754,10 +5656,7 @@ class AXPLookupWidgetEditComponent extends AXPValueWidgetComponent {
|
|
|
5754
5656
|
}
|
|
5755
5657
|
refresh() {
|
|
5756
5658
|
this.clear();
|
|
5757
|
-
|
|
5758
|
-
this.vm()?.setCustomFilter(this.customFilter());
|
|
5759
|
-
}
|
|
5760
|
-
this.vm()?.dataSource.refresh();
|
|
5659
|
+
this.dataSource()?.refresh();
|
|
5761
5660
|
}
|
|
5762
5661
|
clear() {
|
|
5763
5662
|
this.setValue(null);
|
|
@@ -5768,15 +5667,53 @@ class AXPLookupWidgetEditComponent extends AXPValueWidgetComponent {
|
|
|
5768
5667
|
this.textbox()?.inputValue.set('');
|
|
5769
5668
|
this.searchTerm.set('');
|
|
5770
5669
|
}
|
|
5670
|
+
async searchByValue(value) {
|
|
5671
|
+
if (!this.entityDef())
|
|
5672
|
+
return null;
|
|
5673
|
+
const entity = this.entityDef();
|
|
5674
|
+
const searchFields = entity.properties.filter(p => p.options?.filter?.inline?.enabled);
|
|
5675
|
+
const inlineFilters = {
|
|
5676
|
+
field: null,
|
|
5677
|
+
logic: 'or',
|
|
5678
|
+
operator: null,
|
|
5679
|
+
filters: [],
|
|
5680
|
+
};
|
|
5681
|
+
if (value && searchFields.length > 0) {
|
|
5682
|
+
searchFields.forEach((p) => {
|
|
5683
|
+
inlineFilters.filters?.push({
|
|
5684
|
+
field: p.name,
|
|
5685
|
+
operator: { type: 'contains' },
|
|
5686
|
+
value,
|
|
5687
|
+
});
|
|
5688
|
+
});
|
|
5689
|
+
}
|
|
5690
|
+
const func = entity.queries.list?.execute;
|
|
5691
|
+
return await func({ filter: inlineFilters, take: 10 });
|
|
5692
|
+
}
|
|
5693
|
+
mergeFilter(request, filter) {
|
|
5694
|
+
if (!filter) {
|
|
5695
|
+
return request;
|
|
5696
|
+
}
|
|
5697
|
+
if (request.filter) {
|
|
5698
|
+
request.filter = {
|
|
5699
|
+
logic: 'and',
|
|
5700
|
+
filters: [...[request.filter], ...(filter.filters ?? [])]
|
|
5701
|
+
};
|
|
5702
|
+
}
|
|
5703
|
+
else {
|
|
5704
|
+
request.filter = filter;
|
|
5705
|
+
}
|
|
5706
|
+
return request;
|
|
5707
|
+
}
|
|
5771
5708
|
singleOrMultiple(values) {
|
|
5772
5709
|
return this.multiple() ? values : values[0];
|
|
5773
5710
|
}
|
|
5774
5711
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPLookupWidgetEditComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
5775
5712
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.8", type: AXPLookupWidgetEditComponent, isStandalone: true, selector: "axp-lookup-widget-edit", viewQueries: [{ propertyName: "textbox", first: true, predicate: AXTagBoxComponent, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: `
|
|
5776
|
-
@if(
|
|
5713
|
+
@if(dataSource()) {
|
|
5777
5714
|
@if (look() == 'select') {
|
|
5778
5715
|
<ax-select-box
|
|
5779
|
-
[dataSource]="
|
|
5716
|
+
[dataSource]="dataSource()!"
|
|
5780
5717
|
[ngModel]="selectedItems()"
|
|
5781
5718
|
[textField]="displayField()"
|
|
5782
5719
|
[valueField]="valueField()"
|
|
@@ -5839,19 +5776,19 @@ class AXPLookupWidgetEditComponent extends AXPValueWidgetComponent {
|
|
|
5839
5776
|
</ax-tag-box>
|
|
5840
5777
|
}
|
|
5841
5778
|
}
|
|
5842
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$
|
|
5779
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type:
|
|
5843
5780
|
//
|
|
5844
|
-
AXButtonModule }, { kind: "component", type: i3$2.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: i3.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i3.AXDecoratorClearButtonComponent, selector: "ax-clear-button", inputs: ["icon"] }, { kind: "component", type: i3.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: AXLoadingModule }, { kind: "component", type: i4$1.AXLoadingComponent, selector: "ax-loading", inputs: ["visible", "type", "context"], outputs: ["visibleChange"] }, { kind: "ngmodule", type: AXValidationModule }, { kind: "ngmodule", type: AXFormModule }, { kind: "directive", type: i5$1.AXValidationRuleDirective, selector: "ax-validation-rule", inputs: ["rule", "options", "message", "disabled"] }, { kind: "ngmodule", type: AXTagBoxModule }, { kind: "component", type: i6.AXTagBoxComponent, selector: "ax-tag-box", inputs: ["disabled", "tabIndex", "readonly", "value", "state", "name", "id", "placeholder", "allowNull", "type", "look", "addOnComma", "addOnEnter", "valueField", "textField", "readonlyField", "allowDuplicateValues"], outputs: ["onBlur", "onFocus", "valueChange", "stateChange", "onValueChanged", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "ngmodule", type: AXSelectBoxModule }, { kind: "component", type: i7
|
|
5781
|
+
AXButtonModule }, { kind: "component", type: i3$2.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: i3.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i3.AXDecoratorClearButtonComponent, selector: "ax-clear-button", inputs: ["icon"] }, { kind: "component", type: i3.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: AXLoadingModule }, { kind: "component", type: i4$1.AXLoadingComponent, selector: "ax-loading", inputs: ["visible", "type", "context"], outputs: ["visibleChange"] }, { kind: "ngmodule", type: AXValidationModule }, { kind: "ngmodule", type: AXFormModule }, { kind: "directive", type: i5$1.AXValidationRuleDirective, selector: "ax-validation-rule", inputs: ["rule", "options", "message", "disabled"] }, { kind: "ngmodule", type: AXTagBoxModule }, { kind: "component", type: i6$1.AXTagBoxComponent, selector: "ax-tag-box", inputs: ["disabled", "tabIndex", "readonly", "value", "state", "name", "id", "placeholder", "allowNull", "type", "look", "addOnComma", "addOnEnter", "valueField", "textField", "readonlyField", "allowDuplicateValues"], outputs: ["onBlur", "onFocus", "valueChange", "stateChange", "onValueChanged", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "ngmodule", type: AXSelectBoxModule }, { kind: "component", type: i7.AXSelectBoxComponent, selector: "ax-select-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "minValue", "maxValue", "value", "state", "name", "id", "type", "look", "multiple", "valueField", "textField", "disabledField", "textTemplate", "selectedItems", "isItemTruncated", "showItemTooltip", "dataSource", "minRecordsForSearch", "caption", "itemTemplate", "selectedTemplate", "emptyTemplate", "loadingTemplate", "dropdownWidth", "searchBoxAutoFocus"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onOpened", "onClosed", "onItemSelected", "onItemClick"] }, { kind: "component", type: 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: "pipe", type: i5.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5845
5782
|
}
|
|
5846
5783
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPLookupWidgetEditComponent, decorators: [{
|
|
5847
5784
|
type: Component,
|
|
5848
5785
|
args: [{
|
|
5849
5786
|
selector: 'axp-lookup-widget-edit',
|
|
5850
5787
|
template: `
|
|
5851
|
-
@if(
|
|
5788
|
+
@if(dataSource()) {
|
|
5852
5789
|
@if (look() == 'select') {
|
|
5853
5790
|
<ax-select-box
|
|
5854
|
-
[dataSource]="
|
|
5791
|
+
[dataSource]="dataSource()!"
|
|
5855
5792
|
[ngModel]="selectedItems()"
|
|
5856
5793
|
[textField]="displayField()"
|
|
5857
5794
|
[valueField]="valueField()"
|
|
@@ -5988,7 +5925,7 @@ class AXPEntityDetailPopoverComponent {
|
|
|
5988
5925
|
try {
|
|
5989
5926
|
const result = await this.queryService.fetch('Entity:GetDetails', {
|
|
5990
5927
|
entity: this.entity(),
|
|
5991
|
-
id: this.entityId()
|
|
5928
|
+
id: this.entityId(),
|
|
5992
5929
|
});
|
|
5993
5930
|
if (result?.success) {
|
|
5994
5931
|
this.entityDetails.set(result);
|
|
@@ -6021,7 +5958,7 @@ class AXPEntityDetailPopoverComponent {
|
|
|
6021
5958
|
}
|
|
6022
5959
|
async navigateToDetails() {
|
|
6023
5960
|
if (this.entityId()) {
|
|
6024
|
-
await this.commandService.execute(
|
|
5961
|
+
await this.commandService.execute('Entity:OpenDetails', {
|
|
6025
5962
|
entity: this.entity(),
|
|
6026
5963
|
data: { id: this.entityId() },
|
|
6027
5964
|
});
|
|
@@ -6054,9 +5991,6 @@ class AXPEntityDetailPopoverComponent {
|
|
|
6054
5991
|
[AXPWidgetsCatalog.text]: 100,
|
|
6055
5992
|
[AXPWidgetsCatalog.select]: 95,
|
|
6056
5993
|
[AXPWidgetsCatalog.number]: 90,
|
|
6057
|
-
[AXPWidgetsCatalog.email]: 88,
|
|
6058
|
-
[AXPWidgetsCatalog.phone]: 87,
|
|
6059
|
-
[AXPWidgetsCatalog.link]: 86,
|
|
6060
5994
|
[AXPWidgetsCatalog.dateTime]: 85,
|
|
6061
5995
|
[AXPWidgetsCatalog.richText]: 80,
|
|
6062
5996
|
[AXPWidgetsCatalog.largeText]: 75,
|
|
@@ -6096,7 +6030,7 @@ class AXPEntityDetailPopoverComponent {
|
|
|
6096
6030
|
{ keys: ['owner', 'assignee', 'assignedto'], score: 92 },
|
|
6097
6031
|
{ keys: ['email', 'phone', 'mobile', 'contact'], score: 90 },
|
|
6098
6032
|
{ keys: ['category', 'type', 'label', 'tag', 'note', 'notes'], score: 85 },
|
|
6099
|
-
{ keys: ['primary', 'active', 'active', 'enabled', 'archived', 'deleted', 'locked', 'disabled'], score: -2 } // send to bottom,
|
|
6033
|
+
{ keys: ['primary', 'active', 'active', 'enabled', 'archived', 'deleted', 'locked', 'disabled'], score: -2 }, // send to bottom,
|
|
6100
6034
|
];
|
|
6101
6035
|
for (const group of priorities) {
|
|
6102
6036
|
for (const key of group.keys) {
|
|
@@ -6123,16 +6057,16 @@ class AXPEntityDetailPopoverComponent {
|
|
|
6123
6057
|
const importantProperties = (entityDefinition.columns ?? [])
|
|
6124
6058
|
.map((prop, index) => {
|
|
6125
6059
|
const propName = prop.options?.dataPath ?? prop.name;
|
|
6126
|
-
const schema = prop.showAs?.type ?? entityDefinition.properties.find(p => p.name === propName)?.schema.interface?.type;
|
|
6127
|
-
const title = prop.title ?? entityDefinition.properties.find(p => p.name === propName)?.title ?? prop.name;
|
|
6060
|
+
const schema = prop.showAs?.type ?? entityDefinition.properties.find((p) => p.name === propName)?.schema.interface?.type;
|
|
6061
|
+
const title = prop.title ?? entityDefinition.properties.find((p) => p.name === propName)?.title ?? prop.name;
|
|
6128
6062
|
return {
|
|
6129
6063
|
...prop,
|
|
6130
6064
|
schema,
|
|
6131
6065
|
title,
|
|
6132
|
-
orderIndex: index
|
|
6066
|
+
orderIndex: index,
|
|
6133
6067
|
};
|
|
6134
6068
|
})
|
|
6135
|
-
.filter(prop => {
|
|
6069
|
+
.filter((prop) => {
|
|
6136
6070
|
// Exclude technical fields
|
|
6137
6071
|
if (prop.name === 'id' || prop.name === this.textField() || prop.name === this.valueField()) {
|
|
6138
6072
|
return false;
|
|
@@ -6142,7 +6076,7 @@ class AXPEntityDetailPopoverComponent {
|
|
|
6142
6076
|
return false;
|
|
6143
6077
|
}
|
|
6144
6078
|
// Filter by property importance based on schema and options
|
|
6145
|
-
const schema = prop.showAs?.type ?? entityDefinition.properties.find(p => p.name === prop.name)?.schema.interface?.type;
|
|
6079
|
+
const schema = prop.showAs?.type ?? entityDefinition.properties.find((p) => p.name === prop.name)?.schema.interface?.type;
|
|
6146
6080
|
// Include common important field types
|
|
6147
6081
|
const importantWidgets = [
|
|
6148
6082
|
AXPWidgetsCatalog.text,
|
|
@@ -6159,9 +6093,6 @@ class AXPEntityDetailPopoverComponent {
|
|
|
6159
6093
|
AXPWidgetsCatalog.dateTime,
|
|
6160
6094
|
AXPWidgetsCatalog.color,
|
|
6161
6095
|
AXPWidgetsCatalog.contact,
|
|
6162
|
-
AXPWidgetsCatalog.email,
|
|
6163
|
-
AXPWidgetsCatalog.link,
|
|
6164
|
-
AXPWidgetsCatalog.phone,
|
|
6165
6096
|
];
|
|
6166
6097
|
//
|
|
6167
6098
|
if (importantWidgets.includes(schema)) {
|
|
@@ -6192,13 +6123,13 @@ class AXPEntityDetailPopoverComponent {
|
|
|
6192
6123
|
return (a.orderIndex ?? 0) - (b.orderIndex ?? 0);
|
|
6193
6124
|
return a.name.localeCompare(b.name);
|
|
6194
6125
|
})
|
|
6195
|
-
.map(prop => {
|
|
6126
|
+
.map((prop) => {
|
|
6196
6127
|
// Create widget node based on property schema
|
|
6197
6128
|
const widgetNode = {
|
|
6198
6129
|
type: prop.schema || AXPWidgetsCatalog.text,
|
|
6199
6130
|
path: prop.options?.dataPath || prop.name,
|
|
6200
6131
|
options: prop.options ?? {},
|
|
6201
|
-
mode: 'view'
|
|
6132
|
+
mode: 'view',
|
|
6202
6133
|
};
|
|
6203
6134
|
return {
|
|
6204
6135
|
name: prop.name,
|
|
@@ -6210,11 +6141,18 @@ class AXPEntityDetailPopoverComponent {
|
|
|
6210
6141
|
return importantProperties;
|
|
6211
6142
|
}
|
|
6212
6143
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityDetailPopoverComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
6213
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.8", type: AXPEntityDetailPopoverComponent, isStandalone: true, selector: "axp-entity-detail-popover", inputs: { entity: { classPropertyName: "entity", publicName: "entity", isSignal: true, isRequired: true, transformFunction: null }, entityId: { classPropertyName: "entityId", publicName: "entityId", isSignal: true, isRequired: true, transformFunction: null }, textField: { classPropertyName: "textField", publicName: "textField", isSignal: true, isRequired: false, transformFunction: null }, valueField: { classPropertyName: "valueField", publicName: "valueField", isSignal: true, isRequired: false, transformFunction: null }, item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "detailPopover", first: true, predicate: ["detailPopover"], descendants: true, isSignal: true }], ngImport: i0, template: "<ax-popover [openOn]=\"'manual'\" #detailPopover (openChange)=\"onDetailPopoverOpenChange($event)\">\n <div class=\"ax-lightest-surface ax-border ax-rounded-lg ax-shadow-lg ax-p-4 ax-min-w-[400px]\">\n <div class=\"ax-mb-4 ax-border-b ax-pb-2\">\n <h3 class=\"ax-text-base ax-font-semibold ax-text-on-lightest-surface\">\n @if (entityDetails()?.entityData?.[textField()]) {\n {{ entityDetails()?.entityData[textField()] }}\n } @else {\n {{ item()?.[textField()] }}\n }\n </h3>\n </div>\n @if (isLoadingDetails()) {\n <div class=\"ax-flex ax-items-center ax-justify-center ax-py-8\">\n <ax-loading>Loading details...</ax-loading>\n </div>\n } @else if (entityDetails()) {\n <div class=\"ax-space-y-3 ax-mb-4\">\n <!-- Important Entity Data -->\n @if (entityDetails()?.entityData) {\n <axp-widgets-container [context]=\"entityDetails()?.entityData\">\n <div class=\"ax-space-y-2\">\n @for (item of getEntityPropertiesWithWidgets(); track item.name) {\n <div class=\"ax-flex ax-justify-between ax-items-center\">\n <span class=\"ax-text-sm ax-font-medium\">{{ item.title | translate | async }}:</span>\n <div class=\"ax-flex-1 ax-ml-2 ax-max-w-48\">\n <ng-container axp-widget-renderer [node]=\"item.node\" [mode]=\"'view'\"></ng-container>\n </div>\n </div>\n }\n </div>\n </axp-widgets-container>\n }\n </div>\n <div class=\"ax-flex ax-gap-2 ax-justify-end ax-sm\">\n <ax-button [color]=\"'primary'\" [look]=\"'solid'\" text=\"Open Details\" (click)=\"navigateToDetails()\"> </ax-button>\n </div>\n }\n </div>\n</ax-popover>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i3$2.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: AXPopoverModule }, { kind: "component", type: i2.AXPopoverComponent, selector: "ax-popover", inputs: ["width", "disabled", "offsetX", "offsetY", "target", "placement", "content", "openOn", "closeOn", "hasBackdrop", "openAfter", "closeAfter", "backdropClass", "panelClass", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "ngmodule", type: AXPLayoutBuilderModule }, { kind: "component", type: i3$1.AXPWidgetContainerComponent, selector: "axp-widgets-container", inputs: ["context", "functions"], outputs: ["onContextChanged"] }, { kind: "directive", type: i3$1.AXPWidgetRendererDirective, selector: "[axp-widget-renderer]", inputs: ["parentNode", "index", "mode", "node"], outputs: ["onOptionsChanged", "onValueChanged"], exportAs: ["widgetRenderer"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "ngmodule", type: AXLoadingModule }, { kind: "component", type: i4$1.AXLoadingComponent, selector: "ax-loading", inputs: ["visible", "type", "context"], outputs: ["visibleChange"] }, { kind: "pipe", type:
|
|
6144
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.8", type: AXPEntityDetailPopoverComponent, isStandalone: true, selector: "axp-entity-detail-popover", inputs: { entity: { classPropertyName: "entity", publicName: "entity", isSignal: true, isRequired: true, transformFunction: null }, entityId: { classPropertyName: "entityId", publicName: "entityId", isSignal: true, isRequired: true, transformFunction: null }, textField: { classPropertyName: "textField", publicName: "textField", isSignal: true, isRequired: false, transformFunction: null }, valueField: { classPropertyName: "valueField", publicName: "valueField", isSignal: true, isRequired: false, transformFunction: null }, item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "detailPopover", first: true, predicate: ["detailPopover"], descendants: true, isSignal: true }], ngImport: i0, template: "<ax-popover [openOn]=\"'manual'\" #detailPopover (openChange)=\"onDetailPopoverOpenChange($event)\">\n <div class=\"ax-lightest-surface ax-border ax-rounded-lg ax-shadow-lg ax-p-4 ax-min-w-[400px]\">\n <div class=\"ax-mb-4 ax-border-b ax-pb-2\">\n <h3 class=\"ax-text-base ax-font-semibold ax-text-on-lightest-surface\">\n @if (entityDetails()?.entityData?.[textField()]) {\n {{ entityDetails()?.entityData[textField()] }}\n } @else {\n {{ item()?.[textField()] }}\n }\n </h3>\n </div>\n @if (isLoadingDetails()) {\n <div class=\"ax-flex ax-items-center ax-justify-center ax-py-8\">\n <ax-loading>Loading details...</ax-loading>\n </div>\n } @else if (entityDetails()) {\n <div class=\"ax-space-y-3 ax-mb-4\">\n <!-- Important Entity Data -->\n @if (entityDetails()?.entityData) {\n <axp-widgets-container [context]=\"entityDetails()?.entityData\">\n <div class=\"ax-space-y-2\">\n @for (item of getEntityPropertiesWithWidgets(); track item.name) {\n <div class=\"ax-flex ax-justify-between ax-items-center\">\n <span class=\"ax-text-sm ax-font-medium\">{{ item.title | translate | async }}:</span>\n <div class=\"ax-flex-1 ax-ml-2 ax-max-w-48\">\n <ng-container axp-widget-renderer [node]=\"item.node\" [mode]=\"'view'\"></ng-container>\n </div>\n </div>\n }\n </div>\n </axp-widgets-container>\n }\n </div>\n <div class=\"ax-flex ax-gap-2 ax-justify-end ax-sm\">\n <ax-button [color]=\"'primary'\" [look]=\"'solid'\" text=\"Open Details\" (click)=\"navigateToDetails()\"> </ax-button>\n </div>\n }\n </div>\n</ax-popover>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i3$2.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: AXPopoverModule }, { kind: "component", type: i2.AXPopoverComponent, selector: "ax-popover", inputs: ["width", "disabled", "offsetX", "offsetY", "target", "placement", "content", "openOn", "closeOn", "hasBackdrop", "openAfter", "closeAfter", "backdropClass", "panelClass", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "ngmodule", type: AXPLayoutBuilderModule }, { kind: "component", type: i3$1.AXPWidgetContainerComponent, selector: "axp-widgets-container", inputs: ["context", "functions"], outputs: ["onContextChanged"] }, { kind: "directive", type: i3$1.AXPWidgetRendererDirective, selector: "[axp-widget-renderer]", inputs: ["parentNode", "index", "mode", "node"], outputs: ["onOptionsChanged", "onValueChanged"], exportAs: ["widgetRenderer"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "ngmodule", type: AXLoadingModule }, { kind: "component", type: i4$1.AXLoadingComponent, selector: "ax-loading", inputs: ["visible", "type", "context"], outputs: ["visibleChange"] }, { kind: "pipe", type: i5.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
6214
6145
|
}
|
|
6215
6146
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityDetailPopoverComponent, decorators: [{
|
|
6216
6147
|
type: Component,
|
|
6217
|
-
args: [{ selector: 'axp-entity-detail-popover', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
6148
|
+
args: [{ selector: 'axp-entity-detail-popover', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
6149
|
+
CommonModule,
|
|
6150
|
+
AXButtonModule,
|
|
6151
|
+
AXPopoverModule,
|
|
6152
|
+
AXPLayoutBuilderModule,
|
|
6153
|
+
AXTranslationModule,
|
|
6154
|
+
AXLoadingModule,
|
|
6155
|
+
], template: "<ax-popover [openOn]=\"'manual'\" #detailPopover (openChange)=\"onDetailPopoverOpenChange($event)\">\n <div class=\"ax-lightest-surface ax-border ax-rounded-lg ax-shadow-lg ax-p-4 ax-min-w-[400px]\">\n <div class=\"ax-mb-4 ax-border-b ax-pb-2\">\n <h3 class=\"ax-text-base ax-font-semibold ax-text-on-lightest-surface\">\n @if (entityDetails()?.entityData?.[textField()]) {\n {{ entityDetails()?.entityData[textField()] }}\n } @else {\n {{ item()?.[textField()] }}\n }\n </h3>\n </div>\n @if (isLoadingDetails()) {\n <div class=\"ax-flex ax-items-center ax-justify-center ax-py-8\">\n <ax-loading>Loading details...</ax-loading>\n </div>\n } @else if (entityDetails()) {\n <div class=\"ax-space-y-3 ax-mb-4\">\n <!-- Important Entity Data -->\n @if (entityDetails()?.entityData) {\n <axp-widgets-container [context]=\"entityDetails()?.entityData\">\n <div class=\"ax-space-y-2\">\n @for (item of getEntityPropertiesWithWidgets(); track item.name) {\n <div class=\"ax-flex ax-justify-between ax-items-center\">\n <span class=\"ax-text-sm ax-font-medium\">{{ item.title | translate | async }}:</span>\n <div class=\"ax-flex-1 ax-ml-2 ax-max-w-48\">\n <ng-container axp-widget-renderer [node]=\"item.node\" [mode]=\"'view'\"></ng-container>\n </div>\n </div>\n }\n </div>\n </axp-widgets-container>\n }\n </div>\n <div class=\"ax-flex ax-gap-2 ax-justify-end ax-sm\">\n <ax-button [color]=\"'primary'\" [look]=\"'solid'\" text=\"Open Details\" (click)=\"navigateToDetails()\"> </ax-button>\n </div>\n }\n </div>\n</ax-popover>\n" }]
|
|
6218
6156
|
}] });
|
|
6219
6157
|
|
|
6220
6158
|
class AXPEntityDetailPopoverService {
|
|
@@ -6583,7 +6521,7 @@ class AXPTagableBoxWidgetEditComponent extends AXPValueWidgetComponent {
|
|
|
6583
6521
|
</ax-prefix>
|
|
6584
6522
|
</ax-button>
|
|
6585
6523
|
</div>
|
|
6586
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: AXTextBoxModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$
|
|
6524
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: AXTextBoxModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: AXFormModule }, { kind: "directive", type: i5$1.AXValidationRuleDirective, selector: "ax-validation-rule", inputs: ["rule", "options", "message", "disabled"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i3.AXDecoratorClearButtonComponent, selector: "ax-clear-button", inputs: ["icon"] }, { kind: "component", type: i3.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: AXValidationModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i3$2.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: AXSelectBoxModule }, { kind: "component", type: i7.AXSelectBoxComponent, selector: "ax-select-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "minValue", "maxValue", "value", "state", "name", "id", "type", "look", "multiple", "valueField", "textField", "disabledField", "textTemplate", "selectedItems", "isItemTruncated", "showItemTooltip", "dataSource", "minRecordsForSearch", "caption", "itemTemplate", "selectedTemplate", "emptyTemplate", "loadingTemplate", "dropdownWidth", "searchBoxAutoFocus"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onOpened", "onClosed", "onItemSelected", "onItemClick"] }, { kind: "ngmodule", type: AXSearchBoxModule }, { kind: "component", type: i6$2.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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
6587
6525
|
}
|
|
6588
6526
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPTagableBoxWidgetEditComponent, decorators: [{
|
|
6589
6527
|
type: Component,
|
|
@@ -6880,7 +6818,7 @@ class AXPWidgetSelectorWidgetEditComponent extends AXPValueWidgetComponent {
|
|
|
6880
6818
|
<axp-widget-property-viewer [widget]="selectedWidgetNode()!" (onChanged)="handleChangeWidget($event)">
|
|
6881
6819
|
</axp-widget-property-viewer>
|
|
6882
6820
|
}
|
|
6883
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$
|
|
6821
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: AXSelectBoxModule }, { kind: "ngmodule", type: AXTextBoxModule }, { kind: "component", type: i2$1.AXTextBoxComponent, selector: "ax-text-box", inputs: ["disabled", "tabIndex", "readonly", "value", "state", "name", "id", "placeholder", "maxLength", "allowNull", "type", "autoComplete", "look", "mask-options", "class"], outputs: ["onBlur", "onFocus", "valueChange", "stateChange", "onValueChanged", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i3$2.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: i3.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i3.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: AXLoadingModule }, { kind: "ngmodule", type: AXValidationModule }, { kind: "ngmodule", type: AXFormModule }, { kind: "directive", type: i5$1.AXValidationRuleDirective, selector: "ax-validation-rule", inputs: ["rule", "options", "message", "disabled"] }, { kind: "component", type: AXPWidgetPropertyViewerComponent, selector: "axp-widget-property-viewer", inputs: ["widget", "mode"], outputs: ["onChanged"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
6884
6822
|
}
|
|
6885
6823
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPWidgetSelectorWidgetEditComponent, decorators: [{
|
|
6886
6824
|
type: Component,
|
|
@@ -6991,7 +6929,7 @@ class AXPEntityCreatePopupAction extends AXPWorkflowAction {
|
|
|
6991
6929
|
const result = await this.popupService.open(com, {
|
|
6992
6930
|
title: headerTitle
|
|
6993
6931
|
? headerTitle
|
|
6994
|
-
: `${await this.translateService.translateAsync('create
|
|
6932
|
+
: `${await this.translateService.translateAsync('@general:actions.create.title')} ${await this.translateService.translateAsync(entityRef.formats.individual)}`,
|
|
6995
6933
|
size: this.platform.is('Mobile') || this.platform.is('SM') ? 'full' : size ? size : 'md',
|
|
6996
6934
|
data: {
|
|
6997
6935
|
vm: await this.factory.create(module, entity, data, options),
|
|
@@ -7399,7 +7337,7 @@ class AXPEntityModule {
|
|
|
7399
7337
|
},
|
|
7400
7338
|
});
|
|
7401
7339
|
}
|
|
7402
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityModule, deps: [{ token: i1$
|
|
7340
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityModule, deps: [{ token: i1$2.AXPAppStartUpService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
7403
7341
|
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityModule, imports: [RouterModule, i2$2.AXPWorkflowModule, i3$1.AXPLayoutBuilderModule] }); }
|
|
7404
7342
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityModule, providers: [
|
|
7405
7343
|
{
|
|
@@ -7551,7 +7489,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImpor
|
|
|
7551
7489
|
]),
|
|
7552
7490
|
],
|
|
7553
7491
|
}]
|
|
7554
|
-
}], ctorParameters: () => [{ type: i1$
|
|
7492
|
+
}], ctorParameters: () => [{ type: i1$2.AXPAppStartUpService }, { type: i0.Injector }] });
|
|
7555
7493
|
|
|
7556
7494
|
//#endregion
|
|
7557
7495
|
//#region ---- Entity Open Details Command ----
|
|
@@ -7718,13 +7656,28 @@ function entityMasterDeleteAction() {
|
|
|
7718
7656
|
scope: AXPEntityCommandScope.Individual,
|
|
7719
7657
|
};
|
|
7720
7658
|
}
|
|
7721
|
-
function entityMasterCrudActions() {
|
|
7722
|
-
|
|
7723
|
-
|
|
7724
|
-
|
|
7725
|
-
|
|
7726
|
-
|
|
7727
|
-
|
|
7659
|
+
function entityMasterCrudActions(options) {
|
|
7660
|
+
const opts = {
|
|
7661
|
+
create: true,
|
|
7662
|
+
delete: true,
|
|
7663
|
+
view: true,
|
|
7664
|
+
edit: true,
|
|
7665
|
+
...options,
|
|
7666
|
+
};
|
|
7667
|
+
const actions = [];
|
|
7668
|
+
if (opts.create) {
|
|
7669
|
+
actions.push(entityMasterCreateAction());
|
|
7670
|
+
}
|
|
7671
|
+
if (opts.delete) {
|
|
7672
|
+
actions.push(entityMasterBulkDeleteAction());
|
|
7673
|
+
}
|
|
7674
|
+
if (opts.view) {
|
|
7675
|
+
actions.push(entityMasterViewAction());
|
|
7676
|
+
}
|
|
7677
|
+
if (opts.edit) {
|
|
7678
|
+
actions.push(entityMasterDeleteAction());
|
|
7679
|
+
}
|
|
7680
|
+
return actions;
|
|
7728
7681
|
}
|
|
7729
7682
|
function entityMasterRecordActions() {
|
|
7730
7683
|
return [entityMasterDeleteAction()];
|
|
@@ -7882,5 +7835,5 @@ const eventDispatchMiddleware = {
|
|
|
7882
7835
|
* Generated bundle index. Do not edit.
|
|
7883
7836
|
*/
|
|
7884
7837
|
|
|
7885
|
-
export { AXMEntityCrudService, AXMEntityCrudServiceImpl, AXPCreateEntityWorkflow, AXPDataSeederService, AXPDeleteEntityWorkflow, AXPEntityApplyUpdatesAction, AXPEntityCommandTriggerViewModel, AXPEntityCreateEvent, AXPEntityCreatePopupAction, AXPEntityCreateSubmittedAction, AXPEntityCreateViewElementViewModel, AXPEntityCreateViewModelFactory, AXPEntityCreateViewSectionViewModel, AXPEntityDataProvider, AXPEntityDataProviderImpl, AXPEntityDefinitionRegistryService, AXPEntityDeletedEvent, AXPEntityDetailListViewModel, AXPEntityDetailPopoverComponent, AXPEntityDetailPopoverService, AXPEntityDetailViewModelFactory, AXPEntityDetailViewModelResolver, AXPEntityEventDispatcherService, AXPEntityListViewColumnViewModel, AXPEntityListViewModelFactory, AXPEntityListViewModelResolver, AXPEntityMasterCreateViewModel, AXPEntityMasterListViewModel, AXPEntityMasterListViewQueryViewModel, AXPEntityMasterSingleElementViewModel, AXPEntityMasterSingleViewGroupViewModel, AXPEntityMasterSingleViewModel, AXPEntityMasterUpdateElementViewModel, AXPEntityMasterUpdateViewModel, AXPEntityMasterUpdateViewModelFactory, AXPEntityMiddleware, AXPEntityModifyConfirmedAction, AXPEntityModifyEvent, AXPEntityModifySectionPopupAction, AXPEntityModule, AXPEntityPerformDeleteAction, AXPEntityResolver, AXPEntityService, AXPEntityStorageService, AXPGetEntityDetailsQuery, AXPMiddlewareEntityStorageService, AXPModifyEntitySectionWorkflow, AXPOpenEntityDetailsCommand, AXPQuickEntityModifyPopupAction, AXPQuickModifyEntityWorkflow, AXPShowDetailViewAction, AXPShowDetailsViewWorkflow, AXPShowListViewAction, AXPShowListViewWorkflow, AXP_DATA_SEEDER_TOKEN, AXP_ENTITY_ACTION_PLUGIN, AXP_ENTITY_CONFIG_TOKEN, AXP_ENTITY_DEFINITION_LOADER, AXP_ENTITY_MODIFIER, AXP_ENTITY_STORAGE_BACKEND, AXP_ENTITY_STORAGE_MIDDLEWARE, DEFAULT_COLUMN_WIDTHS, actionExists, columnWidthMiddlewareFactory, columnWidthMiddlewareProvider, createColumnWidthMiddlewareProvider, createModifierContext, detectEntityChanges, ensureListActions, entityDetailsCreateActions, entityDetailsCrudActions, entityDetailsEditAction, entityDetailsReferenceCondition, entityDetailsReferenceCreateActions, entityDetailsSimpleCondition, entityMasterBulkDeleteAction, entityMasterCreateAction, entityMasterCrudActions, entityMasterDeleteAction, entityMasterRecordActions, entityMasterViewAction, entityOverrideDetailsViewAction, eventDispatchMiddleware };
|
|
7838
|
+
export { AXMEntityCrudService, AXMEntityCrudServiceImpl, AXPCreateEntityWorkflow, AXPDataSeederService, AXPDeleteEntityWorkflow, AXPEntityApplyUpdatesAction, AXPEntityCommandTriggerViewModel, AXPEntityCreateEvent, AXPEntityCreatePopupAction, AXPEntityCreateSubmittedAction, AXPEntityCreateViewElementViewModel, AXPEntityCreateViewModelFactory, AXPEntityCreateViewSectionViewModel, AXPEntityDataProvider, AXPEntityDataProviderImpl, AXPEntityDefinitionRegistryService, AXPEntityDeletedEvent, AXPEntityDetailListViewModel, AXPEntityDetailPopoverComponent, AXPEntityDetailPopoverService, AXPEntityDetailViewModelFactory, AXPEntityDetailViewModelResolver, AXPEntityEventDispatcherService, AXPEntityListViewColumnViewModel, AXPEntityListViewModelFactory, AXPEntityListViewModelResolver, AXPEntityMasterCreateViewModel, AXPEntityMasterListViewModel, AXPEntityMasterListViewQueryViewModel, AXPEntityMasterSingleElementViewModel, AXPEntityMasterSingleViewGroupViewModel, AXPEntityMasterSingleViewModel, AXPEntityMasterUpdateElementViewModel, AXPEntityMasterUpdateViewModel, AXPEntityMasterUpdateViewModelFactory, AXPEntityMiddleware, AXPEntityModifyConfirmedAction, AXPEntityModifyEvent, AXPEntityModifySectionPopupAction, AXPEntityModule, AXPEntityPerformDeleteAction, AXPEntityResolver, AXPEntityService, AXPEntityStorageService, AXPEntityUpdateViewSectionViewModel, AXPGetEntityDetailsQuery, AXPMiddlewareAbortError, AXPMiddlewareEntityStorageService, AXPModifyEntitySectionWorkflow, AXPOpenEntityDetailsCommand, AXPQuickEntityModifyPopupAction, AXPQuickModifyEntityWorkflow, AXPShowDetailViewAction, AXPShowDetailsViewWorkflow, AXPShowListViewAction, AXPShowListViewWorkflow, AXP_DATA_SEEDER_TOKEN, AXP_ENTITY_ACTION_PLUGIN, AXP_ENTITY_CONFIG_TOKEN, AXP_ENTITY_DEFINITION_LOADER, AXP_ENTITY_MODIFIER, AXP_ENTITY_STORAGE_BACKEND, AXP_ENTITY_STORAGE_MIDDLEWARE, DEFAULT_COLUMN_WIDTHS, actionExists, columnWidthMiddlewareFactory, columnWidthMiddlewareProvider, createColumnWidthMiddlewareProvider, createModifierContext, detectEntityChanges, ensureListActions, entityDetailsCreateActions, entityDetailsCrudActions, entityDetailsEditAction, entityDetailsReferenceCondition, entityDetailsReferenceCreateActions, entityDetailsSimpleCondition, entityMasterBulkDeleteAction, entityMasterCreateAction, entityMasterCrudActions, entityMasterDeleteAction, entityMasterRecordActions, entityMasterViewAction, entityOverrideDetailsViewAction, eventDispatchMiddleware, isAXPMiddlewareAbortError };
|
|
7886
7839
|
//# sourceMappingURL=acorex-platform-layout-entity.mjs.map
|