@acorex/platform 19.3.0-next.5 → 19.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/common/lib/app/index.d.ts +0 -1
  2. package/common/lib/common.module.d.ts +1 -1
  3. package/common/lib/configs/app.config.d.ts +12 -3
  4. package/common/lib/home-page/home-page.service.d.ts +6 -0
  5. package/common/lib/layout/logo/logo.component.d.ts +4 -0
  6. package/common/lib/settings/settings.service.d.ts +4 -1
  7. package/common/lib/utils/regional-util.service.d.ts +2 -2
  8. package/common/lib/utils/regional.types.d.ts +6 -16
  9. package/core/lib/index.d.ts +1 -0
  10. package/{common/lib/app → core/lib/startup}/app-startup.service.d.ts +1 -5
  11. package/core/lib/startup/app-startup.types.d.ts +6 -0
  12. package/core/lib/startup/index.d.ts +2 -0
  13. package/core/lib/types/logo.types.d.ts +5 -9
  14. package/fesm2022/acorex-platform-auth.mjs +5 -1
  15. package/fesm2022/acorex-platform-auth.mjs.map +1 -1
  16. package/fesm2022/acorex-platform-common.mjs +130 -85
  17. package/fesm2022/acorex-platform-common.mjs.map +1 -1
  18. package/fesm2022/acorex-platform-core.mjs +42 -13
  19. package/fesm2022/acorex-platform-core.mjs.map +1 -1
  20. package/fesm2022/acorex-platform-layout-builder.mjs +17 -0
  21. package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
  22. package/fesm2022/acorex-platform-layout-designer.mjs +2 -2
  23. package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
  24. package/fesm2022/acorex-platform-layout-entity.mjs +44 -20
  25. package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
  26. package/fesm2022/acorex-platform-layout-search.mjs +4 -3
  27. package/fesm2022/acorex-platform-layout-search.mjs.map +1 -1
  28. package/fesm2022/acorex-platform-layout-setting.mjs +5 -4
  29. package/fesm2022/acorex-platform-layout-setting.mjs.map +1 -1
  30. package/fesm2022/{acorex-platform-themes-default-entity-master-list-view.component-CuyWAi6X.mjs → acorex-platform-themes-default-entity-master-list-view.component-Ol8haGqF.mjs} +5 -4
  31. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-Ol8haGqF.mjs.map +1 -0
  32. package/fesm2022/acorex-platform-themes-default.mjs +18 -20
  33. package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
  34. package/fesm2022/acorex-platform-themes-shared.mjs +22 -18
  35. package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
  36. package/fesm2022/acorex-platform-widgets.mjs +770 -123
  37. package/fesm2022/acorex-platform-widgets.mjs.map +1 -1
  38. package/layout/builder/lib/builder/context-store.service.d.ts +2 -1
  39. package/layout/builder/lib/builder/widget-base.component.d.ts +1 -0
  40. package/layout/builder/lib/builder/widget-container.component.d.ts +1 -0
  41. package/layout/builder/lib/builder/widget-map.d.ts +1 -0
  42. package/layout/builder/lib/builder/widget-renderer.directive.d.ts +1 -0
  43. package/layout/entity/lib/entity-master-single.viewmodel.d.ts +1 -0
  44. package/layout/entity/lib/entity.module.d.ts +1 -1
  45. package/layout/entity/lib/widgets/lookup-widget/lookup-widget-column.component.d.ts +1 -1
  46. package/layout/entity/lib/widgets/lookup-widget/lookup-widget-edit.component.d.ts +1 -0
  47. package/layout/entity/lib/widgets/lookup-widget/lookup-widget.config.d.ts +0 -5
  48. package/layout/search/lib/search.module.d.ts +1 -1
  49. package/layout/setting/lib/settings.module.d.ts +1 -1
  50. package/package.json +4 -2
  51. package/themes/default/lib/layouts/root-layout/components/header/header.component.d.ts +12 -3
  52. package/themes/default/lib/layouts/root-layout/horizontal/horizontal-layout.component.d.ts +12 -6
  53. package/themes/default/lib/layouts/root-layout/root-layout.component.d.ts +2 -1
  54. package/themes/default/lib/layouts/root-layout/vertical/vertical-layout.component.d.ts +14 -5
  55. package/themes/shared/lib/shared.module.d.ts +1 -1
  56. package/widgets/lib/widgets/charts/bar-chart/bar-chart-widget.component.d.ts +31 -0
  57. package/widgets/lib/widgets/charts/gauge-chart/gauge-chart-widget.component.d.ts +18 -12
  58. package/widgets/lib/widgets/charts/index.d.ts +11 -0
  59. package/widgets/lib/widgets/charts/line-chart/index.d.ts +3 -0
  60. package/widgets/lib/widgets/charts/line-chart/line-chart-widget.component.d.ts +76 -0
  61. package/widgets/lib/widgets/charts/line-chart/line-chart-widget.config.d.ts +7 -0
  62. package/widgets/lib/widgets/charts/line-chart/line-chart.type.d.ts +41 -0
  63. package/widgets/lib/widgets/charts/shared/index.d.ts +3 -0
  64. package/widgets/lib/widgets/charts/weather/index.d.ts +0 -1
  65. package/widgets/lib/widgets/index.d.ts +3 -1
  66. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-CuyWAi6X.mjs.map +0 -1
  67. package/widgets/lib/widgets/charts/weather/weather.module.d.ts +0 -11
@@ -1,14 +1,14 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { InjectionToken, inject, Injectable, computed, signal, Injector, effect, HostBinding, ChangeDetectionStrategy, Component, viewChild, ViewChild, NgModule } from '@angular/core';
3
- import { castArray, get, cloneDeep, set, merge, isNil, sortBy } from 'lodash-es';
3
+ import { castArray, get, cloneDeep, set, merge, isNil, isEmpty, sortBy } from 'lodash-es';
4
4
  import * as i2 from '@acorex/components/common';
5
5
  import { AXDataSource, AXCommonModule } from '@acorex/components/common';
6
6
  import { AXFormatService } from '@acorex/core/format';
7
- import * as i1$4 from '@acorex/platform/common';
8
7
  import { resolveActionLook, AXPFilterOperatorMiddlewareService, AXPEntityCommandScope, getEntityInfo, AXPSettingService, AXPRefreshEvent, AXPCleanNestedFilters, AXPWorkflowNavigateAction, AXPToastAction, AXP_SEARCH_DEFINITION_PROVIDER } from '@acorex/platform/common';
9
8
  import * as i2$2 from '@acorex/platform/workflow';
10
9
  import { AXPWorkflowService, ofType, createWorkFlowEvent, AXPWorkflowAction, AXPWorkflowModule } from '@acorex/platform/workflow';
11
- import { AXPExpressionEvaluatorService, AXPPlatformScope, extractValue } from '@acorex/platform/core';
10
+ import * as i1$4 from '@acorex/platform/core';
11
+ import { AXPExpressionEvaluatorService, AXPPlatformScope, extractValue, setSmart } from '@acorex/platform/core';
12
12
  import * as i7 from '@acorex/platform/layout/builder';
13
13
  import { AXPPageStatus, AXPWidgetRegistryService, AXPValueWidgetComponent, AXPLayoutBuilderModule, AXPColumnWidgetComponent, AXPWidgetsCatalog, AXPWidgetGroupEnum, AXP_WIDGETS_EDITOR_CATEGORY } from '@acorex/platform/layout/builder';
14
14
  import { AXPLayoutThemeService } from '@acorex/platform/themes/shared';
@@ -1472,6 +1472,7 @@ class AXPEntityMasterSingleElementViewModel {
1472
1472
  this.propertyView = propertyView;
1473
1473
  this.property = this.entity.properties.find((c) => c.name == this.propertyView.name);
1474
1474
  this.name = signal(this.property.name);
1475
+ this.path = signal(this.propertyView.dataPath ?? this.property.name);
1475
1476
  this.title = signal(this.property.title);
1476
1477
  this.showLabel = signal(this.propertyView.layout?.label?.visible != false);
1477
1478
  this.description = signal(this.property.description);
@@ -1487,7 +1488,7 @@ class AXPEntityMasterSingleElementViewModel {
1487
1488
  return {
1488
1489
  type: widget.type,
1489
1490
  mode: 'view',
1490
- path: this.name(),
1491
+ path: this.path(),
1491
1492
  children: widget.children,
1492
1493
  formula: widget.formula,
1493
1494
  valueTransforms: widget.valueTransforms,
@@ -2255,19 +2256,23 @@ class AXPLookupWidgetEditComponent extends AXPValueWidgetComponent {
2255
2256
  #efValue;
2256
2257
  async findByValue() {
2257
2258
  this.isLoading.set(true);
2259
+ const rawValue = this.getValue();
2260
+ const values = castArray(rawValue);
2258
2261
  const byKey = this.entityDef()?.queries.byKey?.execute;
2259
- if (byKey) {
2260
- const rawValue = this.getValue();
2261
- const values = castArray(rawValue);
2262
+ if (byKey && values.length) {
2262
2263
  if (this.multiple()) {
2263
2264
  const items = await Promise.all(values.map((value) => byKey(extractValue(value, this.valueField()))));
2264
2265
  this.setItems(items);
2265
2266
  }
2266
2267
  else {
2267
- const item = await byKey(extractValue(values[0], this.valueField()));
2268
+ const id = extractValue(values[0], this.valueField());
2269
+ const item = await byKey(id);
2268
2270
  this.setItems(item);
2269
2271
  }
2270
2272
  }
2273
+ else {
2274
+ this.setItems([]);
2275
+ }
2271
2276
  this.isLoading.set(false);
2272
2277
  }
2273
2278
  handleOnClick(e) {
@@ -2299,7 +2304,12 @@ class AXPLookupWidgetEditComponent extends AXPValueWidgetComponent {
2299
2304
  }
2300
2305
  handleValueChange(e) {
2301
2306
  if (e.isUserInteraction) {
2302
- this.setValue(e.value);
2307
+ if (isNil(e.value) || isEmpty(e.value)) {
2308
+ this.clear();
2309
+ }
2310
+ else {
2311
+ this.setValue(this.singleOrMultiple(e.value));
2312
+ }
2303
2313
  }
2304
2314
  }
2305
2315
  handleOnBlur(e) {
@@ -2329,7 +2339,8 @@ class AXPLookupWidgetEditComponent extends AXPValueWidgetComponent {
2329
2339
  }
2330
2340
  }
2331
2341
  setItems(items) {
2332
- if (!items) {
2342
+ if (!items || items.length == 0) {
2343
+ this.selectedItems.set([]);
2333
2344
  return;
2334
2345
  }
2335
2346
  //
@@ -2337,25 +2348,33 @@ class AXPLookupWidgetEditComponent extends AXPValueWidgetComponent {
2337
2348
  this.clearInput();
2338
2349
  this.selectedItems.set(items);
2339
2350
  //
2340
- const values = items.map((item) => get(item, this.valueField()));
2351
+ const keys = items.map((item) => get(item, this.valueField()));
2341
2352
  //
2342
- this.setValue(values);
2353
+ this.setValue(this.singleOrMultiple(keys));
2343
2354
  //
2344
2355
  // extract data from valueField and set context by expose path
2345
2356
  if (this.expose()) {
2346
2357
  const exposeValue = castArray(this.expose());
2358
+ const itemToExpose = {};
2359
+ //
2347
2360
  exposeValue.forEach((i) => {
2361
+ debugger;
2348
2362
  if (typeof i == 'string') {
2349
- //const values = items.map(item => get(item, this.expose()));
2350
- const values = items.map((item) => set({}, this.expose(), get(item, this.expose())));
2351
- this.contextService.update(i, values);
2363
+ const values = items.map((item) => set({}, i, get(item, i)));
2364
+ //this.contextService.update(i, this.singleOrMultiple(values));
2365
+ setSmart(itemToExpose, i, this.singleOrMultiple(values));
2352
2366
  }
2353
2367
  else {
2354
2368
  // extract data from item by source path and set context by target path
2355
- const values = items.map((item) => set({}, i.source, get(item, i.source)));
2356
- this.contextService.update(i.target, values);
2369
+ const values = this.multiple() ?
2370
+ items.map((item) => set({}, i.source, get(item, i.source))) :
2371
+ items.map((item) => get(item, i.source));
2372
+ setSmart(itemToExpose, i.target, this.singleOrMultiple(values));
2357
2373
  }
2358
2374
  });
2375
+ debugger;
2376
+ this.contextService.patch(itemToExpose);
2377
+ //this.contextService.update(i.target, this.singleOrMultiple(values));
2359
2378
  }
2360
2379
  }
2361
2380
  handleClearClick() {
@@ -2370,6 +2389,9 @@ class AXPLookupWidgetEditComponent extends AXPValueWidgetComponent {
2370
2389
  this.textbox()?.inputValue.set('');
2371
2390
  this.searchTerm.set('');
2372
2391
  }
2392
+ singleOrMultiple(values) {
2393
+ return this.multiple() ? values : values[0];
2394
+ }
2373
2395
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPLookupWidgetEditComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
2374
2396
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", 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: `
2375
2397
  <ax-tag-box
@@ -2472,7 +2494,7 @@ class AXPLookupWidgetColumnComponent extends AXPColumnWidgetComponent {
2472
2494
  super(...arguments);
2473
2495
  this.valueField = this.options['valueField'] ?? 'id';
2474
2496
  this.textField = this.options['textField'] ?? 'title';
2475
- this.internalValue = computed(() => castArray(this.rawValue).map((item) => this.extractItem(item)));
2497
+ this.displayItems = computed(() => castArray(this.rawValue).map((item) => this.extractItem(item)));
2476
2498
  }
2477
2499
  extractItem(item) {
2478
2500
  return typeof item == 'object'
@@ -2488,7 +2510,7 @@ class AXPLookupWidgetColumnComponent extends AXPColumnWidgetComponent {
2488
2510
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPLookupWidgetColumnComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
2489
2511
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: AXPLookupWidgetColumnComponent, isStandalone: true, selector: "ng-component", inputs: { rawValue: "rawValue" }, usesInheritance: true, ngImport: i0, template: `
2490
2512
  <div class="ax-flex ax-gap-1">
2491
- @for (item of internalValue(); track $index) {
2513
+ @for (item of displayItems(); track $index) {
2492
2514
  <ax-badge [text]="item[this.textField]" color="primary"></ax-badge>
2493
2515
  }
2494
2516
  </div>
@@ -2499,7 +2521,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
2499
2521
  args: [{
2500
2522
  template: `
2501
2523
  <div class="ax-flex ax-gap-1">
2502
- @for (item of internalValue(); track $index) {
2524
+ @for (item of displayItems(); track $index) {
2503
2525
  <ax-badge [text]="item[this.textField]" color="primary"></ax-badge>
2504
2526
  }
2505
2527
  </div>
@@ -3393,6 +3415,7 @@ class AXPEntityModule {
3393
3415
  appInitService.registerTask({
3394
3416
  name: 'layout-theme',
3395
3417
  statusText: 'Preload entities ...',
3418
+ priority: 100,
3396
3419
  run: async () => {
3397
3420
  // load in background
3398
3421
  service.preload();
@@ -3401,6 +3424,7 @@ class AXPEntityModule {
3401
3424
  appInitService.registerTask({
3402
3425
  name: 'Seeder',
3403
3426
  statusText: 'Seed Data ...',
3427
+ priority: 100,
3404
3428
  run: async () => {
3405
3429
  await seederService.seed();
3406
3430
  },