@acorex/platform 19.1.1 → 19.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/common/index.d.ts +1 -0
- package/common/lib/app/application.types.d.ts +14 -9
- package/common/lib/configs/app.config.d.ts +0 -1
- package/common/lib/filters/filters.service.d.ts +8 -0
- package/common/lib/filters/filters.types.d.ts +18 -0
- package/common/lib/filters/index.d.ts +2 -0
- package/common/lib/settings/setting-definition.provider.d.ts +4 -2
- package/common/lib/settings/setting.builder.d.ts +3 -5
- package/common/lib/settings/settings.types.d.ts +1 -0
- package/fesm2022/acorex-platform-auth.mjs +5 -4
- package/fesm2022/acorex-platform-auth.mjs.map +1 -1
- package/fesm2022/acorex-platform-common.mjs +72 -15
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-builder.mjs +80 -28
- package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-designer.mjs +7 -7
- package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-entity.mjs +364 -256
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-filters.mjs +47 -0
- package/fesm2022/acorex-platform-layout-filters.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-setting.mjs +175 -70
- package/fesm2022/acorex-platform-layout-setting.mjs.map +1 -1
- package/fesm2022/acorex-platform-layouts.mjs +1 -1
- package/fesm2022/acorex-platform-layouts.mjs.map +1 -1
- package/fesm2022/{acorex-platform-themes-default-entity-master-create-view.component-CJ_HVKX-.mjs → acorex-platform-themes-default-entity-master-create-view.component-CSyR4pYp.mjs} +4 -4
- package/fesm2022/{acorex-platform-themes-default-entity-master-create-view.component-CJ_HVKX-.mjs.map → acorex-platform-themes-default-entity-master-create-view.component-CSyR4pYp.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-themes-default-entity-master-list-view.component-BJ-ELNnN.mjs → acorex-platform-themes-default-entity-master-list-view.component-xHWp2Lk-.mjs} +83 -20
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-xHWp2Lk-.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-entity-master-modify-view.component-DveB-N1Z.mjs → acorex-platform-themes-default-entity-master-modify-view.component-n7mYNduJ.mjs} +4 -4
- package/fesm2022/{acorex-platform-themes-default-entity-master-modify-view.component-DveB-N1Z.mjs.map → acorex-platform-themes-default-entity-master-modify-view.component-n7mYNduJ.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-themes-default-entity-master-single-view.component-q_DOP0cT.mjs → acorex-platform-themes-default-entity-master-single-view.component-DjyYU0Gy.mjs} +11 -11
- package/fesm2022/{acorex-platform-themes-default-entity-master-single-view.component-q_DOP0cT.mjs.map → acorex-platform-themes-default-entity-master-single-view.component-DjyYU0Gy.mjs.map} +1 -1
- package/fesm2022/acorex-platform-themes-default-setting-page.component-6Dd8MGqr.mjs +78 -0
- package/fesm2022/acorex-platform-themes-default-setting-page.component-6Dd8MGqr.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-setting-view.component-BgiMClew.mjs +58 -0
- package/fesm2022/acorex-platform-themes-default-setting-view.component-BgiMClew.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default.mjs +47 -98
- package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
- package/fesm2022/acorex-platform-themes-shared.mjs +248 -54
- package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
- package/fesm2022/acorex-platform-widgets.mjs +258 -34
- package/fesm2022/acorex-platform-widgets.mjs.map +1 -1
- package/layout/builder/lib/builder/widget-renderer.component.directive.d.ts +3 -4
- package/layout/builder/lib/builder/widget.types.d.ts +12 -5
- package/layout/entity/lib/entity-master-create.viewmodel.d.ts +3 -3
- package/layout/entity/lib/entity-master-list.viewmodel.d.ts +2 -1
- package/layout/entity/lib/entity.viewmodel.d.ts +1 -0
- package/layout/entity/lib/workflows/modify-entity.workflow.d.ts +14 -0
- package/layout/filters/README.md +3 -0
- package/layout/filters/index.d.ts +1 -0
- package/layout/filters/lib/filters.viewmodel.d.ts +20 -0
- package/layout/setting/lib/setting.viewmodel.d.ts +23 -21
- package/package.json +15 -11
- package/themes/default/index.d.ts +0 -1
- package/themes/default/lib/layouts/base/simple-page/simple-page.layout.d.ts +48 -3
- package/themes/default/lib/layouts/entity-layouts/entity-master-list-view/list-view-option-filters/list-view-option-filters.component.d.ts +11 -0
- package/themes/default/lib/layouts/filters-layout/simple-filter-builder/filters-view.component.d.ts +12 -0
- package/themes/default/lib/layouts/setting-layout/setting-page/setting-page.component.d.ts +51 -0
- package/themes/default/lib/layouts/setting-layout/setting-view/setting-view.component.d.ts +43 -0
- package/themes/shared/lib/components/layout-elements/index.d.ts +5 -1
- package/themes/shared/lib/components/layout-elements/layout-actions.component.d.ts +20 -0
- package/themes/shared/lib/components/layout-elements/layout-blocks.component.d.ts +1 -1
- package/themes/shared/lib/components/layout-elements/layout-header.component.d.ts +12 -0
- package/themes/shared/lib/components/layout-elements/layout-list-component.d.ts +13 -0
- package/themes/shared/lib/components/layout-elements/layout-section.component.d.ts +9 -0
- package/themes/shared/lib/components/layout-elements/layout-side.component.d.ts +9 -0
- package/themes/shared/lib/shared.module.d.ts +3 -1
- package/widgets/lib/properties/editors.props.d.ts +2 -0
- package/widgets/lib/properties/layout.props.d.ts +2 -0
- package/widgets/lib/widgets/editors/select/select-box-widget-edit.component.d.ts +1 -0
- package/widgets/lib/widgets/index.d.ts +1 -0
- package/widgets/lib/widgets/property-editors/border/border-widget-editor.component.d.ts +12 -0
- package/widgets/lib/widgets/property-editors/border/border-widget-type.d.ts +18 -0
- package/widgets/lib/widgets/property-editors/border/border-widget.config.d.ts +7 -0
- package/widgets/lib/widgets/property-editors/border/index.d.ts +3 -0
- package/widgets/lib/widgets/property-editors/spacing/spacing-widget-editor.component.d.ts +14 -4
- package/widgets/lib/widgets/property-editors/spacing/spacing-widget-type.d.ts +9 -3
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-BJ-ELNnN.mjs.map +0 -1
- package/themes/default/lib/layouts/setting-layout/index.d.ts +0 -2
- package/themes/default/lib/layouts/setting-layout/setting-menu/setting-menu.component.d.ts +0 -10
- package/themes/shared/lib/components/layout-elements/layout-page-header.component.d.ts +0 -11
|
@@ -7,8 +7,8 @@ import { CommonModule } from '@angular/common';
|
|
|
7
7
|
import * as i0 from '@angular/core';
|
|
8
8
|
import { signal, Injectable, InjectionToken, inject, ElementRef, afterNextRender, computed, effect, Injector, Component, ChangeDetectionStrategy, Input, EventEmitter, model, Output, ChangeDetectorRef, ViewChild, input, ViewContainerRef, Directive, NgModule, Optional, Inject } from '@angular/core';
|
|
9
9
|
import { AXUnsubscriber } from '@acorex/core/utils';
|
|
10
|
-
import { set, get, isEqual, clone, merge,
|
|
11
|
-
import { Subject,
|
|
10
|
+
import { set, get, isEqual, clone, merge, isNil, cloneDeep, isUndefined, sum } from 'lodash-es';
|
|
11
|
+
import { Subject, filter } from 'rxjs';
|
|
12
12
|
import { convertArrayToDataSource, AXDataSource } from '@acorex/components/common';
|
|
13
13
|
import { AXDataTableColumnComponent, AXBaseDataTable } from '@acorex/components/data-table';
|
|
14
14
|
|
|
@@ -67,25 +67,33 @@ class AXPLayoutBuilderService {
|
|
|
67
67
|
if (isEqual(oldValue, value)) {
|
|
68
68
|
return;
|
|
69
69
|
}
|
|
70
|
-
if (!this.debouncers[path]) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
70
|
+
// if (!this.debouncers[path]) {
|
|
71
|
+
// // Create a new Subject for debouncing if it doesn't exist
|
|
72
|
+
// this.debouncers[path] = new Subject<{ path: string; value: any; init: boolean }>();
|
|
73
|
+
// // Subscribe to the subject with debounceTime
|
|
74
|
+
// this.debouncerSubscriptions[path] = this.debouncers[path].pipe(debounceTime(150)).subscribe(({ value, init }) => {
|
|
75
|
+
// // Only emit onChanged event after debounce time
|
|
76
|
+
// this.onChanged.next({
|
|
77
|
+
// oldValue: oldValue,
|
|
78
|
+
// newValue: value,
|
|
79
|
+
// data: this.context(),
|
|
80
|
+
// path,
|
|
81
|
+
// init,
|
|
82
|
+
// });
|
|
83
|
+
// });
|
|
84
|
+
// }
|
|
85
85
|
// Update context immediately
|
|
86
86
|
this.context$.update((ctx) => set(clone(ctx), path, value));
|
|
87
|
+
//
|
|
88
|
+
this.onChanged.next({
|
|
89
|
+
oldValue: oldValue,
|
|
90
|
+
newValue: value,
|
|
91
|
+
data: this.context(),
|
|
92
|
+
path,
|
|
93
|
+
init,
|
|
94
|
+
});
|
|
87
95
|
// Emit value through the debouncer subject
|
|
88
|
-
this.debouncers[path].next({ path, value, init });
|
|
96
|
+
//this.debouncers[path].next({ path, value, init });
|
|
89
97
|
}
|
|
90
98
|
getValue(path) {
|
|
91
99
|
return get(this.context(), path);
|
|
@@ -208,8 +216,23 @@ const AXPWidgetsCatalog = {
|
|
|
208
216
|
templateDesigner: 'template-designer',
|
|
209
217
|
cronJob: 'cron-job',
|
|
210
218
|
spacing: 'spacing',
|
|
219
|
+
border: 'border',
|
|
211
220
|
};
|
|
212
221
|
|
|
222
|
+
function objectKeyValueTransforms(keyName) {
|
|
223
|
+
return {
|
|
224
|
+
getter: (value) => {
|
|
225
|
+
if (isNil(value))
|
|
226
|
+
return undefined;
|
|
227
|
+
return typeof value == 'object' ? value[keyName] : value;
|
|
228
|
+
},
|
|
229
|
+
setter: (value) => {
|
|
230
|
+
if (isNil(value))
|
|
231
|
+
return undefined;
|
|
232
|
+
return typeof value == 'object' ? value[keyName] : value;
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
}
|
|
213
236
|
function cloneProperty(property, values) {
|
|
214
237
|
return merge(cloneDeep(property), values);
|
|
215
238
|
}
|
|
@@ -310,6 +333,9 @@ class AXPWidgetComponent extends AXPLayoutElement {
|
|
|
310
333
|
get id() {
|
|
311
334
|
return this._id;
|
|
312
335
|
}
|
|
336
|
+
outputs() {
|
|
337
|
+
return [];
|
|
338
|
+
}
|
|
313
339
|
ngOnInit() {
|
|
314
340
|
this.initRender();
|
|
315
341
|
}
|
|
@@ -348,11 +374,20 @@ class AXPWidgetComponent extends AXPLayoutElement {
|
|
|
348
374
|
if (this.fullPath()) {
|
|
349
375
|
this.contextService.setValue(this.fullPath(), value, init);
|
|
350
376
|
}
|
|
351
|
-
this.onValueChanged(oldValue, value);
|
|
377
|
+
this.onValueChanged(oldValue, value, init);
|
|
352
378
|
}
|
|
353
379
|
setOptions(values) {
|
|
354
380
|
this._options.set({ ...this.options(), ...values });
|
|
355
381
|
}
|
|
382
|
+
output(name) {
|
|
383
|
+
if (this.outputs().includes(name)) {
|
|
384
|
+
const opt = get(this, name);
|
|
385
|
+
if (typeof opt == 'function') {
|
|
386
|
+
return opt();
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
return null;
|
|
390
|
+
}
|
|
356
391
|
call(name, ...args) {
|
|
357
392
|
const fn = get(this, name);
|
|
358
393
|
if (fn && typeof fn == 'function') {
|
|
@@ -362,7 +397,7 @@ class AXPWidgetComponent extends AXPLayoutElement {
|
|
|
362
397
|
setChildren(children) {
|
|
363
398
|
this._children.set([...children]);
|
|
364
399
|
}
|
|
365
|
-
onValueChanged(oldValue, newValue) { }
|
|
400
|
+
onValueChanged(oldValue, newValue, init = false) { }
|
|
366
401
|
onAdded() { }
|
|
367
402
|
detectFullPath() {
|
|
368
403
|
const sections = [];
|
|
@@ -411,9 +446,9 @@ class AXPDataListWidgetComponent extends AXPWidgetComponent {
|
|
|
411
446
|
super(...arguments);
|
|
412
447
|
this.dataService = inject(AXPWidgetDataSourceProviderService);
|
|
413
448
|
this.dataSource = signal(convertArrayToDataSource([]));
|
|
414
|
-
//protected items = computed<any[]>(() => this.options()['items'] ?? []);
|
|
415
449
|
this.textField = computed(() => this.options()['textField'] ?? 'title');
|
|
416
450
|
this.valueField = computed(() => this.options()['valueField'] ?? 'id');
|
|
451
|
+
this.selectedItems = signal([]);
|
|
417
452
|
this.rf = effect(() => {
|
|
418
453
|
const rawValue = this.options()['dataSource'];
|
|
419
454
|
// static datasource class
|
|
@@ -421,13 +456,19 @@ class AXPDataListWidgetComponent extends AXPWidgetComponent {
|
|
|
421
456
|
this.dataSource.set(rawValue);
|
|
422
457
|
} // static array datasource
|
|
423
458
|
else if (Array.isArray(rawValue)) {
|
|
424
|
-
this.dataSource.set(convertArrayToDataSource(rawValue
|
|
459
|
+
this.dataSource.set(convertArrayToDataSource(rawValue, {
|
|
460
|
+
key: this.valueField(),
|
|
461
|
+
pageSize: 100,
|
|
462
|
+
}));
|
|
425
463
|
} // resolve data source by name
|
|
426
464
|
else if (rawValue && (typeof rawValue == 'string' || typeof rawValue == 'object')) {
|
|
427
465
|
const name = typeof rawValue == 'object' ? rawValue[this.valueField()] : rawValue;
|
|
428
466
|
this.dataService.get(name).then((c) => {
|
|
429
467
|
if (this.mode == 'designer' && c?.samples?.length) {
|
|
430
|
-
this.dataSource.set(convertArrayToDataSource(c.samples
|
|
468
|
+
this.dataSource.set(convertArrayToDataSource(c.samples, {
|
|
469
|
+
key: this.valueField(),
|
|
470
|
+
pageSize: 500,
|
|
471
|
+
}));
|
|
431
472
|
}
|
|
432
473
|
else {
|
|
433
474
|
const ds = c?.source();
|
|
@@ -992,7 +1033,7 @@ class AXPWidgetRendererDirective {
|
|
|
992
1033
|
this.index = input();
|
|
993
1034
|
this.mode = input.required();
|
|
994
1035
|
this.node = input.required();
|
|
995
|
-
this._options = signal({
|
|
1036
|
+
this._options = signal({});
|
|
996
1037
|
this.options = this._options.asReadonly();
|
|
997
1038
|
this.mergedOptions = signal({});
|
|
998
1039
|
this.injector = inject(Injector);
|
|
@@ -1050,7 +1091,6 @@ class AXPWidgetRendererDirective {
|
|
|
1050
1091
|
//
|
|
1051
1092
|
const widget = this.widgetRegistery.resolve(this.node().type);
|
|
1052
1093
|
//
|
|
1053
|
-
this._options.update((val) => ({ ...val, ...widget?.options }));
|
|
1054
1094
|
//
|
|
1055
1095
|
const props = [...(widget?.properties ?? []), ...(widget?.components[this.mode()]?.properties ?? [])]
|
|
1056
1096
|
?.filter((c) => c.schema.defaultValue != null)
|
|
@@ -1063,6 +1103,8 @@ class AXPWidgetRendererDirective {
|
|
|
1063
1103
|
this.preprocessAndInitialOptions(cloneDeep(this.node().options));
|
|
1064
1104
|
await this.updateOptionsBasedOnContext();
|
|
1065
1105
|
//
|
|
1106
|
+
this._options.update((val) => ({ ...val, ...this.mergedOptions() }));
|
|
1107
|
+
//
|
|
1066
1108
|
const tokenValue = {
|
|
1067
1109
|
node: this.node(),
|
|
1068
1110
|
options: this.mergedOptions(),
|
|
@@ -1092,6 +1134,7 @@ class AXPWidgetRendererDirective {
|
|
|
1092
1134
|
applyOptions() {
|
|
1093
1135
|
if (!this.instance)
|
|
1094
1136
|
return;
|
|
1137
|
+
this._options.update((val) => ({ ...val, ...this.mergedOptions() }));
|
|
1095
1138
|
this.instance.setOptions(this.mergedOptions());
|
|
1096
1139
|
}
|
|
1097
1140
|
checkFormulaForUpdate(formula, path) {
|
|
@@ -1200,6 +1243,9 @@ class AXPWidgetRendererDirective {
|
|
|
1200
1243
|
getContextScope() {
|
|
1201
1244
|
const scope = {};
|
|
1202
1245
|
set(scope, 'eval', (path) => this.builderService.getValue(path));
|
|
1246
|
+
set(scope, 'set', (path, value) => {
|
|
1247
|
+
this.builderService.setValue(path, value);
|
|
1248
|
+
});
|
|
1203
1249
|
return scope;
|
|
1204
1250
|
}
|
|
1205
1251
|
getEventScope() {
|
|
@@ -1213,8 +1259,14 @@ class AXPWidgetRendererDirective {
|
|
|
1213
1259
|
set(scope, 'call', (name, ...args) => {
|
|
1214
1260
|
this.instance.call(name, ...args);
|
|
1215
1261
|
});
|
|
1262
|
+
set(scope, 'setValue', (value) => {
|
|
1263
|
+
this.instance.setValue(value);
|
|
1264
|
+
});
|
|
1265
|
+
set(scope, 'output', (name) => {
|
|
1266
|
+
this.instance.output(name);
|
|
1267
|
+
});
|
|
1216
1268
|
set(scope, 'find', (id) => {
|
|
1217
|
-
return this.builderService.getWidget(id)
|
|
1269
|
+
return this.builderService.getWidget(id);
|
|
1218
1270
|
});
|
|
1219
1271
|
return scope;
|
|
1220
1272
|
}
|
|
@@ -1287,7 +1339,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
|
1287
1339
|
type: Directive,
|
|
1288
1340
|
args: [{
|
|
1289
1341
|
selector: '[axp-widget-renderer]',
|
|
1290
|
-
exportAs: 'widgetRenderer',
|
|
1342
|
+
exportAs: 'widgetRenderer',
|
|
1291
1343
|
providers: [
|
|
1292
1344
|
{
|
|
1293
1345
|
provide: AXUnsubscriber,
|
|
@@ -1386,5 +1438,5 @@ const AXP_WIDGETS_GROUPS = [
|
|
|
1386
1438
|
* Generated bundle index. Do not edit.
|
|
1387
1439
|
*/
|
|
1388
1440
|
|
|
1389
|
-
export { AXPColumnWidgetComponent, AXPDataListWidgetComponent, AXPLayoutBuilderModule, AXPLayoutBuilderService, AXPLayoutElement, AXPWidgetColumnRendererComponent, AXPWidgetComponent, AXPWidgetContainerComponent, AXPWidgetDataSourceProviderService, AXPWidgetRegistryService, AXPWidgetRendererComponent, AXPWidgetRendererDirective, AXPWidgetsCatalog, AXP_WIDGETS_ACTION_GROUP, AXP_WIDGETS_ADVANCE_GROUP, AXP_WIDGETS_EDITOR_GROUP, AXP_WIDGETS_GROUPS, AXP_WIDGETS_LAYOUT_GROUP, AXP_WIDGET_COLUMN_TOKEN, AXP_WIDGET_DATASOURCE_PROVIDER, AXP_WIDGET_TOKEN, cloneProperty, createBooleanProperty, createSelectProperty, createStringProperty };
|
|
1441
|
+
export { AXPColumnWidgetComponent, AXPDataListWidgetComponent, AXPLayoutBuilderModule, AXPLayoutBuilderService, AXPLayoutElement, AXPWidgetColumnRendererComponent, AXPWidgetComponent, AXPWidgetContainerComponent, AXPWidgetDataSourceProviderService, AXPWidgetRegistryService, AXPWidgetRendererComponent, AXPWidgetRendererDirective, AXPWidgetsCatalog, AXP_WIDGETS_ACTION_GROUP, AXP_WIDGETS_ADVANCE_GROUP, AXP_WIDGETS_EDITOR_GROUP, AXP_WIDGETS_GROUPS, AXP_WIDGETS_LAYOUT_GROUP, AXP_WIDGET_COLUMN_TOKEN, AXP_WIDGET_DATASOURCE_PROVIDER, AXP_WIDGET_TOKEN, cloneProperty, createBooleanProperty, createSelectProperty, createStringProperty, objectKeyValueTransforms };
|
|
1390
1442
|
//# sourceMappingURL=acorex-platform-layout-builder.mjs.map
|