@acorex/platform 19.3.2 → 19.3.3-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/common/lib/layout/menu/menu.types.d.ts +0 -1
  2. package/core/lib/data/datasource-definition-provider.service.d.ts +32 -0
  3. package/core/lib/data/index.d.ts +1 -0
  4. package/core/lib/expression-evaluator/expression-evaluator.service.d.ts +2 -0
  5. package/core/lib/types/interactive.types.d.ts +21 -0
  6. package/core/lib/types/layout.types.d.ts +4 -4
  7. package/core/lib/utils/object-util.d.ts +1 -0
  8. package/fesm2022/acorex-platform-common.mjs +2 -1
  9. package/fesm2022/acorex-platform-common.mjs.map +1 -1
  10. package/fesm2022/acorex-platform-core.mjs +90 -12
  11. package/fesm2022/acorex-platform-core.mjs.map +1 -1
  12. package/fesm2022/acorex-platform-layout-builder.mjs +2 -1
  13. package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
  14. package/fesm2022/acorex-platform-layout-components.mjs +0 -1
  15. package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
  16. package/fesm2022/acorex-platform-layout-designer.mjs +2 -2
  17. package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
  18. package/fesm2022/acorex-platform-layout-entity.mjs +0 -2
  19. package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
  20. package/fesm2022/acorex-platform-layout-views.mjs +287 -0
  21. package/fesm2022/acorex-platform-layout-views.mjs.map +1 -0
  22. package/fesm2022/acorex-platform-themes-default-details-view.component-CAa99Vts.mjs +107 -0
  23. package/fesm2022/acorex-platform-themes-default-details-view.component-CAa99Vts.mjs.map +1 -0
  24. package/fesm2022/{acorex-platform-themes-default-entity-master-list-view.component-Ol8haGqF.mjs → acorex-platform-themes-default-entity-master-list-view.component-BgE6rxsd.mjs} +5 -6
  25. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-BgE6rxsd.mjs.map +1 -0
  26. package/fesm2022/{acorex-platform-themes-default-entity-master-single-view.component-BBJ7Aapd.mjs → acorex-platform-themes-default-entity-master-single-view.component-CnrccLHY.mjs} +9 -9
  27. package/fesm2022/{acorex-platform-themes-default-entity-master-single-view.component-BBJ7Aapd.mjs.map → acorex-platform-themes-default-entity-master-single-view.component-CnrccLHY.mjs.map} +1 -1
  28. package/fesm2022/acorex-platform-themes-default.mjs +45 -298
  29. package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
  30. package/fesm2022/acorex-platform-widgets.mjs +547 -64
  31. package/fesm2022/acorex-platform-widgets.mjs.map +1 -1
  32. package/layout/builder/lib/builder/index.d.ts +0 -1
  33. package/layout/builder/lib/builder/widget-map.d.ts +1 -0
  34. package/layout/builder/lib/builder/widget.types.d.ts +1 -0
  35. package/layout/{setting → views}/README.md +1 -1
  36. package/layout/views/index.d.ts +2 -0
  37. package/layout/views/lib/details-view/details-view-route.resolver.d.ts +3 -0
  38. package/layout/views/lib/details-view/details-view.adapter.d.ts +13 -0
  39. package/layout/views/lib/details-view/details-view.viewmodel.d.ts +30 -0
  40. package/layout/views/lib/details-view/index.d.ts +3 -0
  41. package/layout/views/lib/details-view/sample.d.ts +2 -0
  42. package/layout/views/lib/shared/index.d.ts +1 -0
  43. package/layout/views/lib/shared/layout.types.d.ts +7 -0
  44. package/package.json +4 -8
  45. package/themes/default/index.d.ts +0 -1
  46. package/themes/default/lib/layouts/base/base-page.component.d.ts +1 -4
  47. package/themes/default/lib/layouts/base/index.d.ts +0 -1
  48. package/themes/default/lib/layouts/base/page-layout/page-layout.component.d.ts +1 -0
  49. package/themes/default/lib/layouts/details-view/details-view.component.d.ts +45 -0
  50. package/widgets/lib/properties/layout.props.d.ts +1 -0
  51. package/widgets/lib/widgets/advance/cron-job/cron-job-widget-designer.component.d.ts +1 -0
  52. package/widgets/lib/widgets/advance/cron-job/cron-job-widget-edit.component.d.ts +1 -0
  53. package/widgets/lib/widgets/editors/time-duration/index.d.ts +6 -0
  54. package/widgets/lib/widgets/editors/time-duration/time-duration-widget-column.component.d.ts +6 -0
  55. package/widgets/lib/widgets/editors/time-duration/time-duration-widget-edit.component.d.ts +12 -0
  56. package/widgets/lib/widgets/editors/time-duration/time-duration-widget-filter.component.d.ts +6 -0
  57. package/widgets/lib/widgets/editors/time-duration/time-duration-widget-print.component.d.ts +6 -0
  58. package/widgets/lib/widgets/editors/time-duration/time-duration-widget-view.component.d.ts +7 -0
  59. package/widgets/lib/widgets/editors/time-duration/time-duration-widget.config.d.ts +11 -0
  60. package/widgets/lib/widgets/filters/select-filter/select-filter-widget-edit.component.d.ts +4 -1
  61. package/widgets/lib/widgets/layout/form-field/form-field-widget-designer.component.d.ts +2 -2
  62. package/widgets/lib/widgets/layout/tabset/index.d.ts +3 -0
  63. package/widgets/lib/widgets/layout/tabset/tabset-widget-designer.component.d.ts +6 -0
  64. package/widgets/lib/widgets/layout/tabset/tabset-widget-view.component.d.ts +19 -0
  65. package/widgets/lib/widgets/layout/tabset/tabset-widget.config.d.ts +2 -0
  66. package/widgets/lib/widgets/layout/tabset/tabset-widget.types.d.ts +2 -0
  67. package/widgets/lib/widgets/layout/tabset-item/index.d.ts +3 -0
  68. package/widgets/lib/widgets/layout/tabset-item/tabset-item-widget-designer.component.d.ts +6 -0
  69. package/widgets/lib/widgets/layout/tabset-item/tabset-item-widget-view.component.d.ts +10 -0
  70. package/widgets/lib/widgets/layout/tabset-item/tabset-item-widget.config.d.ts +2 -0
  71. package/widgets/lib/widgets/property-editors/flex-options/flex-options-widget-editor.component.d.ts +3 -3
  72. package/widgets/lib/widgets/property-editors/flex-options/flex-options-widget.type.d.ts +2 -2
  73. package/fesm2022/acorex-platform-layout-search.mjs +0 -279
  74. package/fesm2022/acorex-platform-layout-search.mjs.map +0 -1
  75. package/fesm2022/acorex-platform-layout-setting.mjs +0 -406
  76. package/fesm2022/acorex-platform-layout-setting.mjs.map +0 -1
  77. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-Ol8haGqF.mjs.map +0 -1
  78. package/fesm2022/acorex-platform-themes-default-search-popup.component-ChJiJ12h.mjs +0 -128
  79. package/fesm2022/acorex-platform-themes-default-search-popup.component-ChJiJ12h.mjs.map +0 -1
  80. package/fesm2022/acorex-platform-themes-default-setting-page.component-BxGzaKws.mjs +0 -219
  81. package/fesm2022/acorex-platform-themes-default-setting-page.component-BxGzaKws.mjs.map +0 -1
  82. package/fesm2022/acorex-platform-themes-default-setting-view.component-CjmlI9Jb.mjs +0 -103
  83. package/fesm2022/acorex-platform-themes-default-setting-view.component-CjmlI9Jb.mjs.map +0 -1
  84. package/layout/builder/lib/builder/view.types.d.ts +0 -94
  85. package/layout/search/README.md +0 -3
  86. package/layout/search/index.d.ts +0 -1
  87. package/layout/search/lib/index.d.ts +0 -3
  88. package/layout/search/lib/search-slot.component.d.ts +0 -9
  89. package/layout/search/lib/search.config.d.ts +0 -5
  90. package/layout/search/lib/search.module.d.ts +0 -11
  91. package/layout/search/lib/search.viewmodel.d.ts +0 -34
  92. package/layout/search/lib/workflows/search.workflow.d.ts +0 -11
  93. package/layout/setting/index.d.ts +0 -2
  94. package/layout/setting/lib/convert-setting-data.d.ts +0 -2
  95. package/layout/setting/lib/search-definition.provider.d.ts +0 -4
  96. package/layout/setting/lib/search.provider.d.ts +0 -9
  97. package/layout/setting/lib/setting.viewmodel.d.ts +0 -46
  98. package/layout/setting/lib/settings.module.d.ts +0 -9
  99. package/themes/default/lib/layouts/base/simple-page/index.d.ts +0 -1
  100. package/themes/default/lib/layouts/base/simple-page/simple-page.layout.d.ts +0 -78
  101. package/themes/default/lib/layouts/search-layout/search-popup.component.d.ts +0 -22
  102. package/themes/default/lib/layouts/setting-layout/setting-page/setting-page.component.d.ts +0 -65
  103. package/themes/default/lib/layouts/setting-layout/setting-view/setting-view.component.d.ts +0 -135
  104. package/themes/default/lib/layouts/view-layouts/index.d.ts +0 -1
  105. package/themes/default/lib/layouts/view-layouts/layout-detail-view/layout-detail-view.component.d.ts +0 -19
@@ -1,6 +1,6 @@
1
- import { get, isPlainObject, set, isArray, merge, isNil, isObjectLike, isUndefined, isEmpty, endsWith, startsWith, includes, lte, gte, lt, gt, isEqual, orderBy } from 'lodash-es';
1
+ import { get, isPlainObject, set, isArray, merge, isNil, isObjectLike, transform, isEmpty, isUndefined, endsWith, startsWith, includes, lte, gte, lt, gt, isEqual, orderBy } from 'lodash-es';
2
2
  import * as i0 from '@angular/core';
3
- import { input, effect, Directive, EventEmitter, HostListener, Output, Injectable, inject, signal, Pipe, provideAppInitializer } from '@angular/core';
3
+ import { InjectionToken, inject, Injectable, input, effect, Directive, EventEmitter, HostListener, Output, signal, Pipe, provideAppInitializer } from '@angular/core';
4
4
  import { Subject, interval } from 'rxjs';
5
5
  import { AXCalendarService } from '@acorex/core/date-time';
6
6
  import { startWith, map } from 'rxjs/operators';
@@ -280,6 +280,22 @@ function extractValue(value, key = 'id') {
280
280
  ;
281
281
  return isObjectLike(value) ? get(value, key) : value;
282
282
  }
283
+ function cleanDeep(obj) {
284
+ return transform(obj, (result, value, key) => {
285
+ if (isObjectLike(value)) {
286
+ const cleaned = cleanDeep(value);
287
+ if (!isEmpty(cleaned)) {
288
+ result[key] = cleaned;
289
+ }
290
+ }
291
+ else if (!isNil(value) && // not null or undefined
292
+ !(typeof value === 'string' && value.trim() === '') && // not empty string
293
+ !(Array.isArray(value) && value.length === 0) // not empty array
294
+ ) {
295
+ result[key] = value;
296
+ }
297
+ });
298
+ }
283
299
 
284
300
  function objectKeyValueTransforms(keyName) {
285
301
  return {
@@ -292,6 +308,31 @@ function objectKeyValueTransforms(keyName) {
292
308
  };
293
309
  }
294
310
 
311
+ const AXP_DATASOURCE_DEFINITION_PROVIDER = new InjectionToken('AXP_DATASOURCE_TYPE_PROVIDER');
312
+ class AXPDataSourceDefinitionProviderService {
313
+ constructor() {
314
+ this.providers = inject(AXP_DATASOURCE_DEFINITION_PROVIDER, { optional: true });
315
+ }
316
+ async items() {
317
+ const items = [];
318
+ if (Array.isArray(this.providers)) {
319
+ for (const provider of this.providers) {
320
+ items.push(...(await provider.items()));
321
+ }
322
+ }
323
+ return items;
324
+ }
325
+ async get(name) {
326
+ return (await this.items()).find((c) => c.name == name);
327
+ }
328
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPDataSourceDefinitionProviderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
329
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPDataSourceDefinitionProviderService, providedIn: 'root' }); }
330
+ }
331
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPDataSourceDefinitionProviderService, decorators: [{
332
+ type: Injectable,
333
+ args: [{ providedIn: 'root' }]
334
+ }] });
335
+
295
336
  class AXPElementDataDirective {
296
337
  constructor(elementRef) {
297
338
  this.elementRef = elementRef;
@@ -544,6 +585,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
544
585
  }], ctorParameters: () => [] });
545
586
 
546
587
  class AXPExpressionEvaluatorService {
588
+ constructor() {
589
+ // Memoization cache for compiled expressions
590
+ this.expressionCache = new Map();
591
+ }
592
+ getOrCompileFunction(expression) {
593
+ if (!this.expressionCache.has(expression)) {
594
+ const fn = new Function('scope', `with (scope) { return (async function() { return ${expression}; })(); }`);
595
+ this.expressionCache.set(expression, fn);
596
+ }
597
+ return this.expressionCache.get(expression);
598
+ }
547
599
  async evaluate(source, scope) {
548
600
  try {
549
601
  if (typeof source === 'string' && source.includes('{{')) {
@@ -575,16 +627,42 @@ class AXPExpressionEvaluatorService {
575
627
  }
576
628
  }
577
629
  async evaluateStringExpression(templateExpression, scope) {
578
- const expressionMatch = templateExpression.match(/\{\{\s*(.*?)\s*\}\}/);
579
- if (!expressionMatch) {
580
- throw Error(`No valid expression found in "${templateExpression}"`);
581
- }
582
- const expression = expressionMatch[1];
583
- const evaluationFunction = async () => {
584
- const sandbox = new Function('scope', `with (scope) { return (async function() { return ${expression}; })(); }`);
630
+ // Check if the input is exactly a single {{ ... }} expression
631
+ const exactMatch = templateExpression.match(/^\s*\{\{\s*(.*?)\s*\}\}\s*$/);
632
+ if (exactMatch) {
633
+ const expression = exactMatch[1];
634
+ const sandbox = this.getOrCompileFunction(expression);
585
635
  return await sandbox(scope);
586
- };
587
- return await evaluationFunction();
636
+ }
637
+ // Otherwise, interpolate all {{ ... }} expressions in the string
638
+ const regex = /\{\{\s*(.*?)\s*\}\}/g;
639
+ // Collect all matches and their positions
640
+ const matches = [];
641
+ let match;
642
+ while ((match = regex.exec(templateExpression)) !== null) {
643
+ matches.push({
644
+ expression: match[1],
645
+ start: match.index,
646
+ end: regex.lastIndex,
647
+ raw: match[0],
648
+ });
649
+ }
650
+ // Evaluate all expressions in parallel
651
+ const values = await Promise.all(matches.map(m => {
652
+ const sandbox = this.getOrCompileFunction(m.expression);
653
+ return sandbox(scope);
654
+ }));
655
+ // Reconstruct the string with evaluated values
656
+ let result = '';
657
+ let lastIndex = 0;
658
+ matches.forEach((m, i) => {
659
+ result += templateExpression.slice(lastIndex, m.start);
660
+ const value = values[i];
661
+ result += value !== undefined && value !== null ? value : '';
662
+ lastIndex = m.end;
663
+ });
664
+ result += templateExpression.slice(lastIndex);
665
+ return result;
588
666
  }
589
667
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPExpressionEvaluatorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
590
668
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPExpressionEvaluatorService, providedIn: 'root' }); }
@@ -1315,5 +1393,5 @@ const AXPAppStartUpProvider = provideAppInitializer(() => {
1315
1393
  * Generated bundle index. Do not edit.
1316
1394
  */
1317
1395
 
1318
- export { AXHighlightService, AXPAppStartUpProvider, AXPAppStartUpService, AXPBroadcastEventService, AXPComponentLogoConfig, AXPCountdownPipe, AXPDataGenerator, AXPDblClickDirective, AXPElementDataDirective, AXPExpressionEvaluatorService, AXPGridLayoutDirective, AXPHtmlUtils, AXPImageUrlLogoConfig, AXPPlatformScope, AXPSystemActions, applyFilterArray, applyPagination, applyQueryArray, applySortArray, extractNestedFieldsWildcard, extractValue, getNestedKeys, getSmart, objectKeyValueTransforms, resolvePlatformScopeKey, resolvePlatformScopeName, setSmart };
1396
+ export { AXHighlightService, AXPAppStartUpProvider, AXPAppStartUpService, AXPBroadcastEventService, AXPComponentLogoConfig, AXPCountdownPipe, AXPDataGenerator, AXPDataSourceDefinitionProviderService, AXPDblClickDirective, AXPElementDataDirective, AXPExpressionEvaluatorService, AXPGridLayoutDirective, AXPHtmlUtils, AXPImageUrlLogoConfig, AXPPlatformScope, AXPSystemActions, AXP_DATASOURCE_DEFINITION_PROVIDER, applyFilterArray, applyPagination, applyQueryArray, applySortArray, cleanDeep, extractNestedFieldsWildcard, extractValue, getNestedKeys, getSmart, objectKeyValueTransforms, resolvePlatformScopeKey, resolvePlatformScopeName, setSmart };
1319
1397
  //# sourceMappingURL=acorex-platform-core.mjs.map