@acorex/platform 19.2.9 → 19.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/common/lib/app/application.types.d.ts +3 -2
- package/common/lib/settings/settings.service.d.ts +1 -0
- package/common/lib/utils/expression-evaluator.service.d.ts +3 -1
- package/fesm2022/acorex-platform-common.mjs +49 -15
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-builder.mjs +25 -6
- package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-designer.mjs +31 -12
- package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-entity.mjs +102 -86
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
- package/fesm2022/{acorex-platform-themes-default-entity-master-create-view.component-BK8BItxL.mjs → acorex-platform-themes-default-entity-master-create-view.component-Bvwr0PVk.mjs} +8 -4
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-Bvwr0PVk.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-entity-master-list-view.component-De61n012.mjs → acorex-platform-themes-default-entity-master-list-view.component-7KY7G6qo.mjs} +9 -16
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-7KY7G6qo.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-entity-master-modify-view.component-U8aBv1Ql.mjs → acorex-platform-themes-default-entity-master-modify-view.component-BAU_s90_.mjs} +8 -4
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-BAU_s90_.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-setting-page.component-CN2NCgUv.mjs → acorex-platform-themes-default-setting-page.component-DYumYm5k.mjs} +3 -3
- package/fesm2022/{acorex-platform-themes-default-setting-page.component-CN2NCgUv.mjs.map → acorex-platform-themes-default-setting-page.component-DYumYm5k.mjs.map} +1 -1
- package/fesm2022/acorex-platform-themes-default.mjs +15 -16
- package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
- package/fesm2022/acorex-platform-widgets.mjs +546 -341
- package/fesm2022/acorex-platform-widgets.mjs.map +1 -1
- package/layout/builder/lib/builder/widget-column-renderer.d.ts +2 -1
- package/layout/builder/lib/builder/widget-map.d.ts +2 -0
- package/layout/builder/lib/builder/widget.types.d.ts +13 -0
- package/layout/designer/lib/designer/components/drawers/data-sources/data-sources.component.d.ts +3 -0
- package/layout/entity/lib/entity-master-create.viewmodel.d.ts +2 -1
- package/layout/entity/lib/entity-master-list.viewmodel.d.ts +2 -2
- package/layout/entity/lib/entity-master-update.viewmodel.d.ts +4 -3
- package/layout/entity/lib/entity.viewmodel.d.ts +3 -0
- package/package.json +5 -5
- package/themes/default/lib/layouts/entity-layouts/entity-master-create-view/entity-master-create-view.component.d.ts +2 -0
- package/themes/default/lib/layouts/entity-layouts/entity-master-list-view/entity-master-list-view.component.d.ts +2 -1
- package/themes/default/lib/layouts/entity-layouts/entity-master-modify-view/entity-master-modify-view.component.d.ts +2 -0
- package/themes/default/lib/layouts/root-layout/root-layout.component.d.ts +0 -1
- package/widgets/lib/widgets/advance/file/file-box-widget-edit.component.d.ts +6 -4
- package/widgets/lib/widgets/advance/file/file-box-widget-view.component.d.ts +9 -7
- package/widgets/lib/widgets/charts/bar-chart/bar-chart-widget-edit.component.d.ts +21 -14
- package/widgets/lib/widgets/charts/bar-chart/bar-chart.type.d.ts +4 -12
- package/widgets/lib/widgets/charts/gauge-chart/gauge-chart-widget-edit.component.d.ts +42 -0
- package/widgets/lib/widgets/charts/gauge-chart/gauge-chart-widget.config.d.ts +7 -0
- package/widgets/lib/widgets/charts/gauge-chart/gauge-chart.type.d.ts +21 -0
- package/widgets/lib/widgets/charts/gauge-chart/index.d.ts +2 -0
- package/widgets/lib/widgets/charts/sticky-note/index.d.ts +2 -0
- package/widgets/lib/widgets/charts/sticky-note/sticky-note-widget-edit.component.d.ts +9 -0
- package/widgets/lib/widgets/charts/sticky-note/sticky-note-widget.config.d.ts +7 -0
- package/widgets/lib/widgets/editors/tabular-data/index.d.ts +3 -3
- package/widgets/lib/widgets/editors/tabular-data/{table-widget-column.component.d.ts → tabular-data-column.component.d.ts} +3 -3
- package/widgets/lib/widgets/editors/tabular-data/tabular-data-filter.component.d.ts +6 -0
- package/widgets/lib/widgets/editors/tabular-data/tabular-data-widget-edit.component.d.ts +3 -3
- package/widgets/lib/widgets/editors/tabular-data/{table-widget-print.component.d.ts → tabular-data-widget-print.component.d.ts} +3 -3
- package/widgets/lib/widgets/index.d.ts +2 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-BK8BItxL.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-De61n012.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-U8aBv1Ql.mjs.map +0 -1
- package/widgets/lib/widgets/editors/tabular-data/table-widget-filter.component.d.ts +0 -6
|
@@ -2,16 +2,16 @@ import * as i2$1 from '@acorex/components/common';
|
|
|
2
2
|
import { AXDataSource, AXCommonModule } from '@acorex/components/common';
|
|
3
3
|
import { AXFormatService } from '@acorex/core/format';
|
|
4
4
|
import * as i1$3 from '@acorex/platform/common';
|
|
5
|
-
import { resolveActionLook, AXPFilterOperatorMiddlewareService, AXPExpressionEvaluatorService, AXPEntityCommandScope, getEntityInfo,
|
|
5
|
+
import { resolveActionLook, AXPFilterOperatorMiddlewareService, AXPExpressionEvaluatorService, AXPEntityCommandScope, getEntityInfo, AXPSettingService, AXPRefreshEvent, AXPSettingScope, AXPWorkflowNavigateAction, AXP_SEARCH_DEFINITION_PROVIDER, AXPToastAction } from '@acorex/platform/common';
|
|
6
6
|
import * as i2$3 from '@acorex/platform/workflow';
|
|
7
7
|
import { AXPWorkflowService, ofType, createWorkFlowEvent, AXPWorkflowAction, AXPWorkflowModule } from '@acorex/platform/workflow';
|
|
8
8
|
import * as i0 from '@angular/core';
|
|
9
9
|
import { InjectionToken, inject, Injectable, computed, signal, Injector, effect, Component, ChangeDetectionStrategy, HostBinding, DestroyRef, ViewChild, NgModule } from '@angular/core';
|
|
10
10
|
import { get, cloneDeep, set, merge, isNil, sortBy } from 'lodash-es';
|
|
11
|
+
import * as i7 from '@acorex/platform/layout/builder';
|
|
12
|
+
import { AXPPageStatus, AXPWidgetRegistryService, AXPWidgetComponent, AXPLayoutBuilderModule, AXPColumnWidgetComponent, AXP_WIDGETS_EDITOR_GROUP, AXPWidgetsCatalog } from '@acorex/platform/layout/builder';
|
|
11
13
|
import { AXPLayoutThemeService } from '@acorex/platform/themes/shared';
|
|
12
14
|
import { AXPSessionService, AXPAuthGuard } from '@acorex/platform/auth';
|
|
13
|
-
import * as i7 from '@acorex/platform/layout/builder';
|
|
14
|
-
import { AXPWidgetRegistryService, AXPWidgetComponent, AXPLayoutBuilderModule, AXPColumnWidgetComponent, AXP_WIDGETS_EDITOR_GROUP, AXPWidgetsCatalog } from '@acorex/platform/layout/builder';
|
|
15
15
|
import { Subject, takeUntil } from 'rxjs';
|
|
16
16
|
import * as i8 from '@acorex/core/translation';
|
|
17
17
|
import { AXTranslationService, AXTranslationModule } from '@acorex/core/translation';
|
|
@@ -79,6 +79,7 @@ class AXPEntityCommandTriggerViewModel {
|
|
|
79
79
|
constructor(entity, action) {
|
|
80
80
|
this.name = `${typeof action.command === 'string' ? action.command : action.command.name}&${action.name}`;
|
|
81
81
|
this.options = typeof action.command === 'object' ? action.command.options : undefined;
|
|
82
|
+
this.metadata = typeof action.command === 'object' ? action.command.metadata : undefined;
|
|
82
83
|
const resolvedLook = resolveActionLook(action);
|
|
83
84
|
this.priority = action.priority;
|
|
84
85
|
this.title = action.title;
|
|
@@ -227,22 +228,7 @@ class AXPEntityDetailListViewModel {
|
|
|
227
228
|
},
|
|
228
229
|
},
|
|
229
230
|
};
|
|
230
|
-
|
|
231
|
-
const evaluatedData = {};
|
|
232
|
-
for (const key in data) {
|
|
233
|
-
if (typeof data[key] === 'object' && data[key] !== null) {
|
|
234
|
-
evaluatedData[key] = await evaluateRecursive(data[key]);
|
|
235
|
-
}
|
|
236
|
-
else if (typeof data[key] === 'string' && data[key].includes('{{')) {
|
|
237
|
-
evaluatedData[key] = await this.expressionEvaluator.evaluateExpression(parentData, data[key], scope);
|
|
238
|
-
}
|
|
239
|
-
else {
|
|
240
|
-
evaluatedData[key] = data[key];
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
return evaluatedData;
|
|
244
|
-
};
|
|
245
|
-
return await evaluateRecursive(actionData);
|
|
231
|
+
return await this.expressionEvaluator.evaluateExpression(parentData, actionData, scope);
|
|
246
232
|
};
|
|
247
233
|
this.initialize();
|
|
248
234
|
}
|
|
@@ -316,34 +302,19 @@ class AXPEntityDetailListViewModel {
|
|
|
316
302
|
}
|
|
317
303
|
//****************** Commands ******************//
|
|
318
304
|
async executeCommand(commandName, data = null) {
|
|
319
|
-
const action = this.allActions().find((c) =>
|
|
320
|
-
|
|
305
|
+
const action = this.allActions().find((c) => {
|
|
306
|
+
const isSelectedScope = this.selectedItems().length
|
|
321
307
|
? c.scope == AXPEntityCommandScope.Selected
|
|
322
|
-
: c.scope == AXPEntityCommandScope.Individual
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
// if (condition.value == 'id') {
|
|
331
|
-
// relatedColumn = condition.name;
|
|
332
|
-
// }
|
|
333
|
-
// });
|
|
334
|
-
// if (relatedColumn != null) {
|
|
335
|
-
// data[relatedColumn] = this.parent.data['id'];
|
|
336
|
-
// }
|
|
337
|
-
// }
|
|
338
|
-
const actionData = action?.options?.process?.data;
|
|
339
|
-
let initialData = {};
|
|
340
|
-
if (actionData) {
|
|
341
|
-
initialData = await this.evaluateExpressions(actionData);
|
|
342
|
-
}
|
|
343
|
-
const command = commandName.split('&')[0];
|
|
344
|
-
await this.workflow.execute(command, {
|
|
308
|
+
: c.scope == AXPEntityCommandScope.Individual;
|
|
309
|
+
return c.name == commandName && (isSelectedScope || c.scope == AXPEntityCommandScope.TypeLevel);
|
|
310
|
+
});
|
|
311
|
+
if (!action)
|
|
312
|
+
return;
|
|
313
|
+
const actionData = action.options?.process?.data;
|
|
314
|
+
const initialData = actionData ? { ...data, ...(await this.evaluateExpressions(actionData)) } : data;
|
|
315
|
+
await this.workflow.execute(commandName.split('&')[0], {
|
|
345
316
|
entity: getEntityInfo(this.detailEntity()).source,
|
|
346
|
-
data: action
|
|
317
|
+
data: action.scope == AXPEntityCommandScope.Selected ? this.selectedItems() : initialData,
|
|
347
318
|
entityInfo: {
|
|
348
319
|
name: this.detailEntity()?.name,
|
|
349
320
|
module: this.detailEntity()?.module,
|
|
@@ -351,7 +322,7 @@ class AXPEntityDetailListViewModel {
|
|
|
351
322
|
parentKey: this.detailEntity()?.parentKey,
|
|
352
323
|
source: this.detailEntity()?.source,
|
|
353
324
|
},
|
|
354
|
-
options: action
|
|
325
|
+
options: action.options,
|
|
355
326
|
});
|
|
356
327
|
}
|
|
357
328
|
}
|
|
@@ -542,8 +513,8 @@ class AXPEntityMasterCreateViewModel {
|
|
|
542
513
|
this.context = signal(this.initialData ?? {});
|
|
543
514
|
this.options = signal(this.commandOptions ?? {});
|
|
544
515
|
this.isInProgress = signal(false);
|
|
545
|
-
this.canCreateNewOne = signal(
|
|
546
|
-
this.redirect = signal(
|
|
516
|
+
this.canCreateNewOne = signal(true);
|
|
517
|
+
this.redirect = signal(true);
|
|
547
518
|
this.sections = computed(() => {
|
|
548
519
|
const { interfaces, properties } = this.entityDef;
|
|
549
520
|
const createProps = interfaces?.master?.create?.properties?.map(({ name }) => name) ?? [];
|
|
@@ -567,15 +538,21 @@ class AXPEntityMasterCreateViewModel {
|
|
|
567
538
|
this.context.set(initialData);
|
|
568
539
|
this.options.set(commandOptions);
|
|
569
540
|
//
|
|
570
|
-
const { redirect =
|
|
541
|
+
const { redirect = true, canCreateNewOne = true } = commandOptions?.['process'] ?? {};
|
|
571
542
|
this.canCreateNewOne.set(canCreateNewOne);
|
|
572
543
|
this.redirect.set(redirect);
|
|
573
544
|
}
|
|
574
545
|
async save() {
|
|
575
546
|
try {
|
|
576
547
|
this.isInProgress.set(true);
|
|
548
|
+
this.builder.setStatus(AXPPageStatus.Submitting);
|
|
577
549
|
const exec = this.entityDef.commands?.create?.execute;
|
|
578
|
-
|
|
550
|
+
const result = await exec(this.context());
|
|
551
|
+
this.builder.setStatus(AXPPageStatus.Submitted);
|
|
552
|
+
return result;
|
|
553
|
+
}
|
|
554
|
+
catch (error) {
|
|
555
|
+
this.builder.setStatus(AXPPageStatus.Error);
|
|
579
556
|
}
|
|
580
557
|
finally {
|
|
581
558
|
this.isInProgress.set(false);
|
|
@@ -596,7 +573,7 @@ class AXPEntityCreateViewModelFactory {
|
|
|
596
573
|
this.layout = inject(AXPLayoutThemeService);
|
|
597
574
|
this.injector = inject(Injector);
|
|
598
575
|
}
|
|
599
|
-
async create(moduleName, entityName, initialData = null, options = { canCreateNewOne:
|
|
576
|
+
async create(moduleName, entityName, initialData = null, options = { canCreateNewOne: true, redirect: true }) {
|
|
600
577
|
this.layout.setNavigationLoading(true);
|
|
601
578
|
const config = await this.entityService.resolve(moduleName, entityName);
|
|
602
579
|
this.layout.setNavigationLoading(false);
|
|
@@ -626,12 +603,10 @@ class AXPEntityMasterListViewQueryViewModel {
|
|
|
626
603
|
}
|
|
627
604
|
class AXPEntityMasterListViewModel {
|
|
628
605
|
async setView(viewName = null) {
|
|
629
|
-
|
|
630
|
-
const
|
|
631
|
-
// this.settings.set()
|
|
606
|
+
const entitySetting = await this.settings.get(this.settingEntityKey);
|
|
607
|
+
const selectedViewName = entitySetting?.list?.currentView;
|
|
632
608
|
if (viewName != this.view().name) {
|
|
633
|
-
this.view.set(this.views().find((c) => c.name == (viewName ||
|
|
634
|
-
this.settings.scope(AXPSettingScope.User).set(this.settingSelectedViewKey, this.view().name);
|
|
609
|
+
this.view.set(this.views().find((c) => c.name == (viewName || selectedViewName)) ?? this.views()[0]);
|
|
635
610
|
this.applyViewSorts();
|
|
636
611
|
this.applyViewColumns();
|
|
637
612
|
this.applyViewFilters();
|
|
@@ -651,8 +626,7 @@ class AXPEntityMasterListViewModel {
|
|
|
651
626
|
this.widgetResolver = this.injector.get(AXPWidgetRegistryService);
|
|
652
627
|
this.expressionEvaluator = this.injector.get(AXPExpressionEvaluatorService);
|
|
653
628
|
this.filterOperatorMiddleware = this.injector.get(AXPFilterOperatorMiddlewareService);
|
|
654
|
-
this.
|
|
655
|
-
this.settingSelectedViewKey = '';
|
|
629
|
+
this.settingEntityKey = `${this.config.module}:${this.config.name}`;
|
|
656
630
|
this.destroyed = new Subject();
|
|
657
631
|
this.events$ = new Subject();
|
|
658
632
|
//****************** Views ******************//
|
|
@@ -807,14 +781,58 @@ class AXPEntityMasterListViewModel {
|
|
|
807
781
|
this.sortedFields.set(this.sortableFields());
|
|
808
782
|
}
|
|
809
783
|
async applySettings() {
|
|
810
|
-
this.
|
|
811
|
-
const listViewSetting = await this.settings.get(this.
|
|
784
|
+
this.saveSettings('view');
|
|
785
|
+
const listViewSetting = await this.settings.get(this.settingEntityKey);
|
|
812
786
|
if (listViewSetting) {
|
|
813
|
-
const
|
|
787
|
+
const columns = listViewSetting.list.views[this.view().name].columns;
|
|
788
|
+
const columnVisibilityMap = new Map(columns.map((col) => [col.name, col.visible]));
|
|
789
|
+
const columnWidthsMap = new Map(columns.map((col) => [col.name, col.width]));
|
|
814
790
|
this.columns.update((prev) => prev
|
|
815
|
-
.map((c) =>
|
|
816
|
-
|
|
817
|
-
|
|
791
|
+
.map((c) => {
|
|
792
|
+
return { ...c, width: columnWidthsMap.get(c.name), visible: columnVisibilityMap.get(c.name) ?? c.visible };
|
|
793
|
+
}) // Update visibility
|
|
794
|
+
.sort((a, b) => columns.findIndex((col) => col.name === a.name) -
|
|
795
|
+
columns.findIndex((col) => col.name === b.name)));
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
async saveSettings(changesType, data) {
|
|
799
|
+
const updateSettings = (updateFn) => {
|
|
800
|
+
this.settings.scope(AXPSettingScope.User).update(this.settingEntityKey, updateFn);
|
|
801
|
+
};
|
|
802
|
+
switch (changesType) {
|
|
803
|
+
case 'columnSizes':
|
|
804
|
+
updateSettings((prev) => {
|
|
805
|
+
const field = data.dataField.split('-')[1];
|
|
806
|
+
const newSettings = { ...prev };
|
|
807
|
+
set(newSettings, `list.views.${this.view().name}.columns`, prev?.list?.views?.[this.view().name]?.columns?.map((c) => ({
|
|
808
|
+
...c,
|
|
809
|
+
width: c.name === field ? data.width : c.width,
|
|
810
|
+
})));
|
|
811
|
+
return newSettings;
|
|
812
|
+
});
|
|
813
|
+
break;
|
|
814
|
+
case 'columnOrders':
|
|
815
|
+
updateSettings((prev) => {
|
|
816
|
+
const newSettings = { ...prev };
|
|
817
|
+
set(newSettings, `list.views.${this.view().name}.columns`, data.map((c) => ({
|
|
818
|
+
name: c.name,
|
|
819
|
+
visible: c.visible,
|
|
820
|
+
width: c.width,
|
|
821
|
+
})));
|
|
822
|
+
return newSettings;
|
|
823
|
+
});
|
|
824
|
+
break;
|
|
825
|
+
case 'view':
|
|
826
|
+
updateSettings((prev) => ({
|
|
827
|
+
...prev,
|
|
828
|
+
list: {
|
|
829
|
+
...prev?.list,
|
|
830
|
+
currentView: this.view().name,
|
|
831
|
+
},
|
|
832
|
+
}));
|
|
833
|
+
break;
|
|
834
|
+
default:
|
|
835
|
+
break;
|
|
818
836
|
}
|
|
819
837
|
}
|
|
820
838
|
clearSelection() {
|
|
@@ -832,14 +850,10 @@ class AXPEntityMasterListViewModel {
|
|
|
832
850
|
const actions = await Promise.all(this.allActions()
|
|
833
851
|
.filter((a) => a.scope === AXPEntityCommandScope.Individual && a.priority === 'secondary')
|
|
834
852
|
.map(async (a) => {
|
|
835
|
-
const isHidden =
|
|
836
|
-
? await this.expressionEvaluator.evaluateExpression(rowData, a.hidden, scope)
|
|
837
|
-
: a.hidden;
|
|
853
|
+
const isHidden = await this.expressionEvaluator.evaluateExpression(rowData, a.hidden, scope);
|
|
838
854
|
if (isHidden)
|
|
839
855
|
return null;
|
|
840
|
-
const disabled =
|
|
841
|
-
? await this.expressionEvaluator.evaluateExpression(rowData, a.disabled, scope)
|
|
842
|
-
: a.disabled;
|
|
856
|
+
const disabled = await this.expressionEvaluator.evaluateExpression(rowData, a.disabled, scope);
|
|
843
857
|
return { ...a, disabled };
|
|
844
858
|
}));
|
|
845
859
|
return actions.filter(Boolean);
|
|
@@ -963,13 +977,7 @@ class AXPEntityMasterListViewModel {
|
|
|
963
977
|
this.applyViewColumns();
|
|
964
978
|
}
|
|
965
979
|
async onColumnsChanged(columns) {
|
|
966
|
-
|
|
967
|
-
if (this.settingListViewKey) {
|
|
968
|
-
this.settings.scope(AXPSettingScope.User).set(this.settingListViewKey, {
|
|
969
|
-
...listViewSetting,
|
|
970
|
-
columns: columns.map((c) => ({ name: c.name, visible: c.visible })),
|
|
971
|
-
});
|
|
972
|
-
}
|
|
980
|
+
this.saveSettings('columnOrders', columns);
|
|
973
981
|
}
|
|
974
982
|
applyViewColumns() {
|
|
975
983
|
const cols = this.view().columns;
|
|
@@ -1031,6 +1039,7 @@ class AXPEntityMasterListViewModel {
|
|
|
1031
1039
|
},
|
|
1032
1040
|
data: action?.scope == AXPEntityCommandScope.Selected ? this.selectedItems() : data,
|
|
1033
1041
|
options: action?.options,
|
|
1042
|
+
metadata: action?.metadata,
|
|
1034
1043
|
});
|
|
1035
1044
|
}
|
|
1036
1045
|
//
|
|
@@ -1214,12 +1223,12 @@ class AXPEntityMasterUpdateElementViewModel {
|
|
|
1214
1223
|
return !(this.property.schema.readonly ?? false);
|
|
1215
1224
|
});
|
|
1216
1225
|
this.isRequired = computed(() => {
|
|
1217
|
-
return this.property.validations?.some(c => c.rule == 'required') || false;
|
|
1226
|
+
return this.property.validations?.some((c) => c.rule == 'required') || false;
|
|
1218
1227
|
});
|
|
1219
1228
|
this.layout = computed(() => {
|
|
1220
|
-
const updateProp = this.entity.interfaces?.master?.update?.properties?.find(c => c.name == this.property.name);
|
|
1229
|
+
const updateProp = this.entity.interfaces?.master?.update?.properties?.find((c) => c.name == this.property.name);
|
|
1221
1230
|
const source = cloneDeep(updateProp?.layout ?? {});
|
|
1222
|
-
set(source,
|
|
1231
|
+
set(source, 'positions.default.colSpan', 12);
|
|
1223
1232
|
return source;
|
|
1224
1233
|
});
|
|
1225
1234
|
this.node = computed(() => {
|
|
@@ -1233,7 +1242,9 @@ class AXPEntityMasterUpdateElementViewModel {
|
|
|
1233
1242
|
formula: widget.formula,
|
|
1234
1243
|
triggers: widget.triggers,
|
|
1235
1244
|
valueTransforms: widget.valueTransforms,
|
|
1236
|
-
options: merge(schema.interface?.options, {
|
|
1245
|
+
options: merge(schema.interface?.options, {
|
|
1246
|
+
validations: this.property.validations?.map((c) => ({ rule: c.rule, message: c.message, options: c.options })),
|
|
1247
|
+
}),
|
|
1237
1248
|
};
|
|
1238
1249
|
});
|
|
1239
1250
|
}
|
|
@@ -1249,22 +1260,27 @@ class AXPEntityMasterUpdateViewModel {
|
|
|
1249
1260
|
this.isInProgress = signal(false);
|
|
1250
1261
|
this.context = signal(cloneDeep(this.entityData));
|
|
1251
1262
|
this.elements = computed(() => {
|
|
1252
|
-
const props = this.entityDef.properties.filter(c => this.props.includes(c.name) &&
|
|
1253
|
-
|
|
1254
|
-
return props.map(e => {
|
|
1263
|
+
const props = this.entityDef.properties.filter((c) => this.props.includes(c.name) && c.schema.hidden != true);
|
|
1264
|
+
return props.map((e) => {
|
|
1255
1265
|
return new AXPEntityMasterUpdateElementViewModel(this.entityDef, e);
|
|
1256
1266
|
});
|
|
1257
1267
|
});
|
|
1258
1268
|
}
|
|
1259
1269
|
async save() {
|
|
1260
1270
|
this.isInProgress.set(true);
|
|
1271
|
+
this.builder.setStatus(AXPPageStatus.Submitting);
|
|
1261
1272
|
try {
|
|
1262
1273
|
const com = this.entityDef.commands?.update;
|
|
1263
1274
|
if (com) {
|
|
1264
1275
|
const exec = com.execute;
|
|
1265
|
-
|
|
1276
|
+
const result = await exec(this.context());
|
|
1277
|
+
this.builder.setStatus(AXPPageStatus.Submitted);
|
|
1278
|
+
return result;
|
|
1266
1279
|
}
|
|
1267
1280
|
}
|
|
1281
|
+
catch (error) {
|
|
1282
|
+
this.builder.setStatus(AXPPageStatus.Error);
|
|
1283
|
+
}
|
|
1268
1284
|
finally {
|
|
1269
1285
|
this.isInProgress.set(false);
|
|
1270
1286
|
}
|
|
@@ -1870,7 +1886,7 @@ class AXPLookupWidgetSelectorComponent extends AXBasePageComponent {
|
|
|
1870
1886
|
}
|
|
1871
1887
|
</ax-suffix>
|
|
1872
1888
|
</ax-footer>
|
|
1873
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: AXCommonModule }, { kind: "directive", type: i2$1.AXAutoFocusDirective, selector: "[axAutoFocus]", inputs: ["axAutoFocus", "axAutoFocusTime"] }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i3.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXFormModule }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i4.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i4.AXDecoratorClearButtonComponent, selector: "ax-clear-button", inputs: ["icon"] }, { kind: "component", type: i4.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: i5.AXDataTableComponent, selector: "ax-data-table", inputs: ["dataSource", "parentField", "rowTemplate", "emptyTemplate", "alternative", "showHeader", "fixedHeader", "showFooter", "fixedFooter", "itemHeight", "allowReordering", "paging", "fetchDataMode", "loading", "focusedRow"], outputs: ["selectedRowsChange", "focusedRowChange", "onRowClick", "onRowDbClick", "onColumnsOrderChanged", "onColumnSizeChanged"] }, { kind: "ngmodule", type: AXSearchBoxModule }, { kind: "component", type: i6.AXSearchBoxComponent, selector: "ax-search-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "value", "state", "name", "id", "look", "class", "delayTime"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "ngmodule", type: AXPLayoutBuilderModule }, { kind: "component", type: i7.AXPWidgetColumnRendererComponent, selector: "axp-widget-column-renderer", inputs: ["caption", "customExpandIcon", "customCollapseIcon", "node", "footerTemplate", "expandHandler", "cellTemplate", "headerTemplate"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "pipe", type: i8.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1889
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: AXCommonModule }, { kind: "directive", type: i2$1.AXAutoFocusDirective, selector: "[axAutoFocus]", inputs: ["axAutoFocus", "axAutoFocusTime"] }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i3.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXFormModule }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i4.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i4.AXDecoratorClearButtonComponent, selector: "ax-clear-button", inputs: ["icon"] }, { kind: "component", type: i4.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: i5.AXDataTableComponent, selector: "ax-data-table", inputs: ["dataSource", "parentField", "rowTemplate", "emptyTemplate", "alternative", "showHeader", "fixedHeader", "showFooter", "fixedFooter", "itemHeight", "allowReordering", "paging", "fetchDataMode", "loading", "focusedRow"], outputs: ["selectedRowsChange", "focusedRowChange", "onRowClick", "onRowDbClick", "onColumnsOrderChanged", "onColumnSizeChanged"] }, { kind: "ngmodule", type: AXSearchBoxModule }, { kind: "component", type: i6.AXSearchBoxComponent, selector: "ax-search-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "value", "state", "name", "id", "look", "class", "delayTime"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "ngmodule", type: AXPLayoutBuilderModule }, { kind: "component", type: i7.AXPWidgetColumnRendererComponent, selector: "axp-widget-column-renderer", inputs: ["caption", "customExpandIcon", "customCollapseIcon", "customWidth", "node", "footerTemplate", "expandHandler", "cellTemplate", "headerTemplate"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "pipe", type: i8.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1874
1890
|
}
|
|
1875
1891
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPLookupWidgetSelectorComponent, decorators: [{
|
|
1876
1892
|
type: Component,
|