@acorex/platform 20.3.0-next.1 → 20.3.0-next.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.
Files changed (113) hide show
  1. package/common/index.d.ts +120 -5
  2. package/core/index.d.ts +102 -61
  3. package/fesm2022/acorex-platform-auth.mjs +20 -20
  4. package/fesm2022/acorex-platform-auth.mjs.map +1 -1
  5. package/fesm2022/acorex-platform-common.mjs +136 -112
  6. package/fesm2022/acorex-platform-common.mjs.map +1 -1
  7. package/fesm2022/acorex-platform-core.mjs +287 -198
  8. package/fesm2022/acorex-platform-core.mjs.map +1 -1
  9. package/fesm2022/acorex-platform-domain.mjs +16 -16
  10. package/fesm2022/acorex-platform-domain.mjs.map +1 -1
  11. package/fesm2022/acorex-platform-layout-builder.mjs +1226 -687
  12. package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
  13. package/fesm2022/acorex-platform-layout-components.mjs +1525 -129
  14. package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
  15. package/fesm2022/acorex-platform-layout-designer.mjs +159 -204
  16. package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
  17. package/fesm2022/acorex-platform-layout-entity.mjs +3674 -1154
  18. package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
  19. package/fesm2022/acorex-platform-layout-views.mjs +387 -86
  20. package/fesm2022/acorex-platform-layout-views.mjs.map +1 -1
  21. package/fesm2022/acorex-platform-native.mjs +7 -7
  22. package/fesm2022/acorex-platform-native.mjs.map +1 -1
  23. package/fesm2022/acorex-platform-runtime.mjs +40 -40
  24. package/fesm2022/acorex-platform-runtime.mjs.map +1 -1
  25. package/fesm2022/{acorex-platform-themes-default-entity-master-create-view.component-hHXxHlFG.mjs → acorex-platform-themes-default-entity-master-create-view.component-BXbkGGei.mjs} +6 -6
  26. package/fesm2022/{acorex-platform-themes-default-entity-master-create-view.component-hHXxHlFG.mjs.map → acorex-platform-themes-default-entity-master-create-view.component-BXbkGGei.mjs.map} +1 -1
  27. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-X0hLRZhX.mjs +708 -0
  28. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-X0hLRZhX.mjs.map +1 -0
  29. package/fesm2022/{acorex-platform-themes-default-entity-master-modify-view.component-DC3MrDtI.mjs → acorex-platform-themes-default-entity-master-modify-view.component-Bp1JLsj1.mjs} +6 -13
  30. package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-Bp1JLsj1.mjs.map +1 -0
  31. package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-BExtm1JE.mjs +244 -0
  32. package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-BExtm1JE.mjs.map +1 -0
  33. package/fesm2022/{acorex-platform-themes-default-error-401.component-D4glpFvU.mjs → acorex-platform-themes-default-error-401.component-DrO1PEOH.mjs} +4 -4
  34. package/fesm2022/{acorex-platform-themes-default-error-401.component-D4glpFvU.mjs.map → acorex-platform-themes-default-error-401.component-DrO1PEOH.mjs.map} +1 -1
  35. package/fesm2022/{acorex-platform-themes-default-error-404.component-BvGeDMjo.mjs → acorex-platform-themes-default-error-404.component-DqVq0oHX.mjs} +4 -4
  36. package/fesm2022/{acorex-platform-themes-default-error-404.component-BvGeDMjo.mjs.map → acorex-platform-themes-default-error-404.component-DqVq0oHX.mjs.map} +1 -1
  37. package/fesm2022/{acorex-platform-themes-default-error-offline.component-BINy-Zo3.mjs → acorex-platform-themes-default-error-offline.component-Bt2PTL7_.mjs} +4 -4
  38. package/fesm2022/{acorex-platform-themes-default-error-offline.component-BINy-Zo3.mjs.map → acorex-platform-themes-default-error-offline.component-Bt2PTL7_.mjs.map} +1 -1
  39. package/fesm2022/acorex-platform-themes-default.mjs +64 -509
  40. package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
  41. package/fesm2022/{acorex-platform-themes-shared-icon-chooser-view.component-C833prGO.mjs → acorex-platform-themes-shared-icon-chooser-view.component-KpZWpnOJ.mjs} +4 -4
  42. package/fesm2022/{acorex-platform-themes-shared-icon-chooser-view.component-C833prGO.mjs.map → acorex-platform-themes-shared-icon-chooser-view.component-KpZWpnOJ.mjs.map} +1 -1
  43. package/fesm2022/acorex-platform-themes-shared-settings.provider-CXiRmniv.mjs.map +1 -1
  44. package/fesm2022/{acorex-platform-themes-shared-color-chooser-column.component-DjKLg513.mjs → acorex-platform-themes-shared-theme-color-chooser-column.component-BvOiVCgt.mjs} +4 -4
  45. package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-BvOiVCgt.mjs.map +1 -0
  46. package/fesm2022/{acorex-platform-themes-shared-color-chooser-view.component-DE0wO98F.mjs → acorex-platform-themes-shared-theme-color-chooser-view.component-BW0rfkjk.mjs} +4 -4
  47. package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-BW0rfkjk.mjs.map +1 -0
  48. package/fesm2022/acorex-platform-themes-shared.mjs +50 -52
  49. package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
  50. package/fesm2022/{acorex-platform-widgets-button-widget-designer.component-lNF95FJv.mjs → acorex-platform-widgets-button-widget-designer.component-C2Qn1YAW.mjs} +6 -6
  51. package/fesm2022/acorex-platform-widgets-button-widget-designer.component-C2Qn1YAW.mjs.map +1 -0
  52. package/fesm2022/{acorex-platform-widgets-checkbox-widget-column.component-BNBOATPB.mjs → acorex-platform-widgets-checkbox-widget-column.component-CzEFmKWG.mjs} +4 -5
  53. package/fesm2022/acorex-platform-widgets-checkbox-widget-column.component-CzEFmKWG.mjs.map +1 -0
  54. package/fesm2022/{acorex-platform-widgets-checkbox-widget-designer.component-BI18uzNZ.mjs → acorex-platform-widgets-checkbox-widget-designer.component-JC_nYunG.mjs} +5 -5
  55. package/fesm2022/acorex-platform-widgets-checkbox-widget-designer.component-JC_nYunG.mjs.map +1 -0
  56. package/fesm2022/{acorex-platform-widgets-checkbox-widget-view.component-C6-QPsnb.mjs → acorex-platform-widgets-checkbox-widget-view.component-C-4bWr9G.mjs} +4 -4
  57. package/fesm2022/{acorex-platform-widgets-checkbox-widget-view.component-C6-QPsnb.mjs.map → acorex-platform-widgets-checkbox-widget-view.component-C-4bWr9G.mjs.map} +1 -1
  58. package/fesm2022/{acorex-platform-widgets-color-box-widget-designer.component-pYOQv5g8.mjs → acorex-platform-widgets-color-box-widget-designer.component-CxgKO2VI.mjs} +5 -5
  59. package/fesm2022/acorex-platform-widgets-color-box-widget-designer.component-CxgKO2VI.mjs.map +1 -0
  60. package/fesm2022/acorex-platform-widgets-extra-properties-schema-widget-edit.component-D9mf08rU.mjs +50 -0
  61. package/fesm2022/acorex-platform-widgets-extra-properties-schema-widget-edit.component-D9mf08rU.mjs.map +1 -0
  62. package/fesm2022/acorex-platform-widgets-extra-properties-schema-widget-view.component-D6GQ-eyr.mjs +42 -0
  63. package/fesm2022/acorex-platform-widgets-extra-properties-schema-widget-view.component-D6GQ-eyr.mjs.map +1 -0
  64. package/fesm2022/acorex-platform-widgets-extra-properties-values-widget-edit.component-DVbIdVZ6.mjs +55 -0
  65. package/fesm2022/acorex-platform-widgets-extra-properties-values-widget-edit.component-DVbIdVZ6.mjs.map +1 -0
  66. package/fesm2022/acorex-platform-widgets-extra-properties-values-widget-view.component-D-aM64Hu.mjs +50 -0
  67. package/fesm2022/acorex-platform-widgets-extra-properties-values-widget-view.component-D-aM64Hu.mjs.map +1 -0
  68. package/fesm2022/acorex-platform-widgets-extra-properties-widget-edit.component-em2-aU8E.mjs +48 -0
  69. package/fesm2022/acorex-platform-widgets-extra-properties-widget-edit.component-em2-aU8E.mjs.map +1 -0
  70. package/fesm2022/acorex-platform-widgets-extra-properties-widget-view.component-BeuIofdr.mjs +42 -0
  71. package/fesm2022/acorex-platform-widgets-extra-properties-widget-view.component-BeuIofdr.mjs.map +1 -0
  72. package/fesm2022/{acorex-platform-widgets-file-list-popup.component-DFbPO0ud.mjs → acorex-platform-widgets-file-list-popup.component-rW2RD35f.mjs} +71 -6
  73. package/fesm2022/acorex-platform-widgets-file-list-popup.component-rW2RD35f.mjs.map +1 -0
  74. package/fesm2022/{acorex-platform-widgets-page-widget-designer.component-DRsLkulH.mjs → acorex-platform-widgets-page-widget-designer.component-DNvnQ4Mc.mjs} +77 -67
  75. package/fesm2022/acorex-platform-widgets-page-widget-designer.component-DNvnQ4Mc.mjs.map +1 -0
  76. package/fesm2022/{acorex-platform-widgets-rich-text-popup.component-CM_v-cL4.mjs → acorex-platform-widgets-rich-text-popup.component-Cydlpsat.mjs} +4 -4
  77. package/fesm2022/{acorex-platform-widgets-rich-text-popup.component-CM_v-cL4.mjs.map → acorex-platform-widgets-rich-text-popup.component-Cydlpsat.mjs.map} +1 -1
  78. package/fesm2022/{acorex-platform-widgets-tabular-data-edit-popup.component-nLZYiPnF.mjs → acorex-platform-widgets-tabular-data-edit-popup.component-CPVRbE8B.mjs} +8 -8
  79. package/fesm2022/{acorex-platform-widgets-tabular-data-edit-popup.component-nLZYiPnF.mjs.map → acorex-platform-widgets-tabular-data-edit-popup.component-CPVRbE8B.mjs.map} +1 -1
  80. package/fesm2022/{acorex-platform-widgets-tabular-data-view-popup.component-D6kiasYM.mjs → acorex-platform-widgets-tabular-data-view-popup.component-Dmg5DdX8.mjs} +6 -6
  81. package/fesm2022/{acorex-platform-widgets-tabular-data-view-popup.component-D6kiasYM.mjs.map → acorex-platform-widgets-tabular-data-view-popup.component-Dmg5DdX8.mjs.map} +1 -1
  82. package/fesm2022/{acorex-platform-widgets-text-block-widget-designer.component-CCMQtH3e.mjs → acorex-platform-widgets-text-block-widget-designer.component-yADN3Xji.mjs} +10 -14
  83. package/fesm2022/acorex-platform-widgets-text-block-widget-designer.component-yADN3Xji.mjs.map +1 -0
  84. package/fesm2022/acorex-platform-widgets.mjs +3953 -2138
  85. package/fesm2022/acorex-platform-widgets.mjs.map +1 -1
  86. package/fesm2022/acorex-platform-workflow.mjs +28 -25
  87. package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
  88. package/layout/builder/index.d.ts +361 -181
  89. package/layout/components/index.d.ts +372 -25
  90. package/layout/designer/index.d.ts +16 -47
  91. package/layout/entity/index.d.ts +255 -336
  92. package/layout/views/index.d.ts +129 -22
  93. package/package.json +23 -37
  94. package/widgets/index.d.ts +372 -230
  95. package/workflow/index.d.ts +4 -1
  96. package/fesm2022/acorex-platform-themes-default-create-entity-view.component-SY0oMDoH.mjs +0 -22
  97. package/fesm2022/acorex-platform-themes-default-create-entity-view.component-SY0oMDoH.mjs.map +0 -1
  98. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-hf4QOz_4.mjs +0 -665
  99. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-hf4QOz_4.mjs.map +0 -1
  100. package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-DC3MrDtI.mjs.map +0 -1
  101. package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-Bb90PeHq.mjs +0 -236
  102. package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-Bb90PeHq.mjs.map +0 -1
  103. package/fesm2022/acorex-platform-themes-shared-color-chooser-column.component-DjKLg513.mjs.map +0 -1
  104. package/fesm2022/acorex-platform-themes-shared-color-chooser-view.component-DE0wO98F.mjs.map +0 -1
  105. package/fesm2022/acorex-platform-widgets-button-widget-designer.component-lNF95FJv.mjs.map +0 -1
  106. package/fesm2022/acorex-platform-widgets-checkbox-widget-column.component-BNBOATPB.mjs.map +0 -1
  107. package/fesm2022/acorex-platform-widgets-checkbox-widget-designer.component-BI18uzNZ.mjs.map +0 -1
  108. package/fesm2022/acorex-platform-widgets-color-box-widget-designer.component-pYOQv5g8.mjs.map +0 -1
  109. package/fesm2022/acorex-platform-widgets-file-list-popup.component-DFbPO0ud.mjs.map +0 -1
  110. package/fesm2022/acorex-platform-widgets-file-rename-popup.component-DA_CgIvm.mjs +0 -211
  111. package/fesm2022/acorex-platform-widgets-file-rename-popup.component-DA_CgIvm.mjs.map +0 -1
  112. package/fesm2022/acorex-platform-widgets-page-widget-designer.component-DRsLkulH.mjs.map +0 -1
  113. package/fesm2022/acorex-platform-widgets-text-block-widget-designer.component-CCMQtH3e.mjs.map +0 -1
@@ -1,18 +1,19 @@
1
+ import * as i0 from '@angular/core';
2
+ import { signal, computed, Injectable, InjectionToken, inject, ElementRef, effect, Injector, ChangeDetectorRef, ViewChild, Input, ChangeDetectionStrategy, Component, EventEmitter, Output, input, output, ViewContainerRef, Directive, Optional, Inject, NgModule } from '@angular/core';
3
+ import { convertArrayToDataSource, AXDataSource } from '@acorex/cdk/common';
4
+ import { setSmart, AXPDataSourceDefinitionProviderService, extractValue, getSmart, AXPExpressionEvaluatorService } from '@acorex/platform/core';
5
+ import { set, cloneDeep, isEqual, get, merge, isNil, isUndefined, isObjectLike, sum, isEmpty, isString } from 'lodash-es';
6
+ import { Subject, BehaviorSubject, filter } from 'rxjs';
7
+ import { signalStore, withState, withComputed, withMethods, patchState } from '@ngrx/signals';
1
8
  import * as i1$1 from '@acorex/components/skeleton';
2
9
  import { AXSkeletonModule } from '@acorex/components/skeleton';
10
+ import * as i2 from '@acorex/core/translation';
11
+ import { AXTranslationService, AXTranslationModule } from '@acorex/core/translation';
3
12
  import { PortalModule } from '@angular/cdk/portal';
4
13
  import * as i1 from '@angular/common';
5
14
  import { CommonModule } from '@angular/common';
6
- import * as i0 from '@angular/core';
7
- import { signal, computed, Injectable, InjectionToken, inject, Injector, ChangeDetectorRef, ViewChild, Input, ChangeDetectionStrategy, Component, EventEmitter, effect, Output, input, output, ViewContainerRef, Directive, Optional, Inject, NgModule, ElementRef } from '@angular/core';
8
15
  import { AXDataTableColumnComponent, AXBaseDataTable } from '@acorex/components/data-table';
9
- import { set, merge, cloneDeep, isNil, isEqual, get, sum, isEmpty, isString, isUndefined, isObjectLike } from 'lodash-es';
10
- import { Subject, filter, BehaviorSubject } from 'rxjs';
11
- import { getSmart, setSmart, AXPExpressionEvaluatorService, AXPDataSourceDefinitionProviderService, extractValue } from '@acorex/platform/core';
12
- import { signalStore, withState, withComputed, withMethods, patchState } from '@ngrx/signals';
13
- import { AXTranslationService } from '@acorex/core/translation';
14
16
  import { AXUnsubscriber } from '@acorex/core/utils';
15
- import { convertArrayToDataSource, AXDataSource } from '@acorex/cdk/common';
16
17
 
17
18
  var AXPPageStatus;
18
19
  (function (AXPPageStatus) {
@@ -54,6 +55,7 @@ class AXPLayoutBuilderService {
54
55
  this.functions$ = signal({}, ...(ngDevMode ? [{ debugName: "functions$" }] : []));
55
56
  this.onRefresh = new Subject();
56
57
  this.widgets = new Map();
58
+ this.onWidgetRegistered = new Subject();
57
59
  this.status$ = signal(AXPPageStatus.Rendering, ...(ngDevMode ? [{ debugName: "status$" }] : []));
58
60
  this.status = this.status$.asReadonly();
59
61
  this.isBusy = computed(() => {
@@ -70,7 +72,7 @@ class AXPLayoutBuilderService {
70
72
  this.status$.update(() => this.detectStatus());
71
73
  }
72
74
  detectStatus() {
73
- const statuses = Array.from(this.widgets.values()).map(c => c.status());
75
+ const statuses = Array.from(this.widgets.values()).map((c) => c.status());
74
76
  // Rendering statuses
75
77
  if (statuses.some((status) => status === AXPWidgetStatus.Rendering)) {
76
78
  return AXPPageStatus.Rendering;
@@ -116,55 +118,164 @@ class AXPLayoutBuilderService {
116
118
  }
117
119
  registerWidget(id, widget) {
118
120
  this.widgets.set(id, widget);
121
+ this.onWidgetRegistered.next({ id, widget });
119
122
  }
120
123
  getWidget(id) {
121
124
  return this.widgets.get(id);
122
125
  }
123
- ngOnDestroy() {
126
+ /**
127
+ * Waits until a widget with the given id is registered, then resolves with it.
128
+ * If the widget is already registered, resolves immediately.
129
+ * Optionally accepts a timeout (in ms) after which it resolves with undefined.
130
+ */
131
+ async waitForWidget(id, timeoutMs) {
132
+ const existing = this.widgets.get(id);
133
+ if (existing) {
134
+ return existing;
135
+ }
136
+ return new Promise((resolve) => {
137
+ let resolved = false;
138
+ let timer = null;
139
+ const sub = this.onWidgetRegistered.subscribe(({ id: registeredId, widget }) => {
140
+ if (registeredId === id && !resolved) {
141
+ resolved = true;
142
+ sub.unsubscribe();
143
+ if (timer) {
144
+ clearTimeout(timer);
145
+ }
146
+ resolve(widget);
147
+ }
148
+ });
149
+ if (timeoutMs != null && timeoutMs > 0) {
150
+ timer = setTimeout(() => {
151
+ if (!resolved) {
152
+ resolved = true;
153
+ sub.unsubscribe();
154
+ resolve(undefined);
155
+ }
156
+ }, timeoutMs);
157
+ }
158
+ });
124
159
  }
125
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPLayoutBuilderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
126
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPLayoutBuilderService }); }
160
+ ngOnDestroy() { }
161
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPLayoutBuilderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
162
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPLayoutBuilderService }); }
127
163
  }
128
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPLayoutBuilderService, decorators: [{
164
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPLayoutBuilderService, decorators: [{
129
165
  type: Injectable
130
166
  }] });
131
167
 
132
- class AXPWidgetRegistryService {
133
- /**
134
- *
135
- */
136
- constructor() {
137
- this.types = new Map();
138
- AXPWidgetRegistryService.instance = this;
139
- }
140
- register(widget) {
141
- this.types.set(widget.name, widget);
142
- }
143
- extend(parentName, widget) {
144
- const parentWidget = this.resolve(parentName);
145
- const newWidget = merge({}, parentWidget, widget);
146
- newWidget.name = widget.name;
147
- this.register(newWidget);
148
- }
149
- resolve(name) {
150
- const widget = this.types.get(name);
151
- if (!widget) {
152
- throw new Error(`Widget with name "${name}" does not exist.`);
153
- }
154
- return widget;
155
- }
156
- all() {
157
- return Array.from(this.types.values());
158
- }
159
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPWidgetRegistryService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
160
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPWidgetRegistryService, providedIn: 'root' }); }
168
+ class AXPLayoutContextChangeEvent {
161
169
  }
162
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPWidgetRegistryService, decorators: [{
163
- type: Injectable,
164
- args: [{
165
- providedIn: 'root',
166
- }]
167
- }], ctorParameters: () => [] });
170
+ const AXPLayoutBuilderContextStore = signalStore(
171
+ // Initial State
172
+ withState(() => ({
173
+ data: {}, // Shared context data
174
+ state: 'initiated', // Current state
175
+ initialSnapshot: {}, // Snapshot of the first initialized state
176
+ previousSnapshot: {}, // Snapshot of the previous state
177
+ lastChange: {
178
+ state: 'initiated',
179
+ }, // Last change event
180
+ })),
181
+ // Computed Signals
182
+ withComputed(({ data, state, lastChange, initialSnapshot, previousSnapshot }) => ({
183
+ isChanged: computed(() => state() === 'changed'),
184
+ isReset: computed(() => state() === 'restored'),
185
+ isInitiated: computed(() => state() === 'initiated'),
186
+ isEmpty: computed(() => Object.keys(data()).length === 0),
187
+ isDirty: computed(() => !isEqual(data(), previousSnapshot())),
188
+ snapshot: computed(() => cloneDeep(data())), // Current data snapshot
189
+ initial: computed(() => cloneDeep(initialSnapshot())), // Initial snapshot
190
+ previous: computed(() => cloneDeep(previousSnapshot())), // Previous snapshot
191
+ changeEvent: computed(() => lastChange()), // Reactive last change event
192
+ })),
193
+ // Methods for State Management
194
+ withMethods((store) => ({
195
+ // Update a specific value
196
+ update(path, value) {
197
+ const currentData = cloneDeep(store.data());
198
+ const oldValue = get(currentData, path);
199
+ // Skip if the value hasn't changed
200
+ if (isEqual(oldValue, value)) {
201
+ return;
202
+ }
203
+ // Update the value and prepare the change event
204
+ const updatedData = setSmart(currentData, path, value);
205
+ const changeEvent = {
206
+ oldValue,
207
+ newValue: value,
208
+ path,
209
+ state: 'changed',
210
+ data: updatedData,
211
+ };
212
+ // Patch the state
213
+ patchState(store, {
214
+ previousSnapshot: store.snapshot(), // Save the previous state
215
+ data: updatedData,
216
+ state: 'changed',
217
+ lastChange: changeEvent,
218
+ });
219
+ },
220
+ patch(context) {
221
+ const currentData = cloneDeep(store.data());
222
+ // Update the value and prepare the change event
223
+ const updatedData = { ...currentData, ...context };
224
+ const changeEvent = {
225
+ state: 'patch',
226
+ data: updatedData,
227
+ };
228
+ // Patch the state
229
+ patchState(store, {
230
+ previousSnapshot: store.snapshot(), // Save the previous state
231
+ data: updatedData,
232
+ state: 'changed',
233
+ lastChange: changeEvent,
234
+ });
235
+ },
236
+ // Reset to the initial state
237
+ reset() {
238
+ const initialData = store.initial();
239
+ const changeEvent = {
240
+ oldValue: cloneDeep(store.data()), // Current data becomes old value
241
+ newValue: cloneDeep(initialData), // Reset to the initial state
242
+ path: '',
243
+ state: 'restored',
244
+ data: initialData,
245
+ };
246
+ patchState(store, {
247
+ previousSnapshot: store.snapshot(), // Save the previous state
248
+ data: initialData,
249
+ state: 'restored',
250
+ lastChange: changeEvent,
251
+ });
252
+ },
253
+ // Initialize the state
254
+ set(initialData) {
255
+ const currentData = store.data();
256
+ if (isEqual(currentData, initialData)) {
257
+ return; // Skip if the current state matches the initial state
258
+ }
259
+ const changeEvent = {
260
+ oldValue: null,
261
+ newValue: cloneDeep(initialData),
262
+ path: '',
263
+ state: 'initiated',
264
+ data: initialData,
265
+ };
266
+ patchState(store, {
267
+ initialSnapshot: cloneDeep(initialData), // Save the initial state
268
+ previousSnapshot: store.snapshot(), // Save the current state as the previous
269
+ data: initialData,
270
+ state: 'initiated',
271
+ lastChange: changeEvent,
272
+ });
273
+ },
274
+ // Get a specific value
275
+ getValue(path) {
276
+ return get(store.data(), path);
277
+ },
278
+ })));
168
279
 
169
280
  const AXPWidgetsCatalog = {
170
281
  timeDuration: 'time-duration',
@@ -194,6 +305,7 @@ const AXPWidgetsCatalog = {
194
305
  fileTypeExtension: 'file-type-extension',
195
306
  map: 'map',
196
307
  imageMarker: 'image-marker',
308
+ image: 'image',
197
309
  gallery: 'gallery',
198
310
  signature: 'signature',
199
311
  buttonAction: 'button-action',
@@ -214,6 +326,7 @@ const AXPWidgetsCatalog = {
214
326
  direction: 'direction',
215
327
  border: 'border',
216
328
  flexLayout: 'flex-layout',
329
+ flexItem: 'flex-item-layout',
217
330
  avatar: 'avatar',
218
331
  themePaletteChooser: 'theme-palette-chooser',
219
332
  themeModeChooser: 'theme-mode-chooser',
@@ -221,8 +334,9 @@ const AXPWidgetsCatalog = {
221
334
  fontStyleChooser: 'font-style-chooser',
222
335
  fontSizeChooser: 'font-size-chooser',
223
336
  iconChooser: 'icon-chooser',
224
- colorChooser: 'color-chooser',
337
+ themeColorChooser: 'theme-color-chooser',
225
338
  gridOptions: 'grid-options',
339
+ gridItemOptions: 'grid-item-options',
226
340
  advancedGridOptions: 'advanced-grid-options',
227
341
  stringFilter: 'string-filter',
228
342
  numberFilter: 'number-filter',
@@ -230,6 +344,7 @@ const AXPWidgetsCatalog = {
230
344
  booleanFilter: 'boolean-filter',
231
345
  lookupFilter: 'lookup-filter',
232
346
  flexOptions: 'flex-options',
347
+ flexItemOptions: 'flex-item-options',
233
348
  selectFilter: 'select-filter',
234
349
  requiredValidation: 'required-validation',
235
350
  regularExpressionValidation: 'regular-expression-validation',
@@ -254,8 +369,12 @@ const AXPWidgetsCatalog = {
254
369
  templateEditor: 'template-box-editor',
255
370
  panel: 'panel',
256
371
  notification: 'notification',
257
- taskList: 'task-list',
372
+ taskBoard: 'task-board',
258
373
  comment: 'comment',
374
+ list: 'list',
375
+ listToolbar: 'list-toolbar',
376
+ entityList: 'entity-list',
377
+ documentUploader: 'document-uploader',
259
378
  };
260
379
 
261
380
  function cloneProperty(property, values) {
@@ -340,295 +459,839 @@ function createSelectProperty(ctor) {
340
459
  const AXP_WIDGET_TOKEN = new InjectionToken('AXP_WIDGET_TOKEN');
341
460
  const AXP_WIDGET_COLUMN_TOKEN = new InjectionToken('AXP_WIDGET_COLUMN_TOKEN');
342
461
 
343
- class AXPWidgetColumnRendererComponent extends AXDataTableColumnComponent {
462
+ class AXPBaseWidgetComponent extends AXPLayoutElement {
344
463
  constructor() {
345
464
  super(...arguments);
346
- this.widgetRegistery = inject(AXPWidgetRegistryService);
347
- this.grid = inject(AXBaseDataTable);
348
- this.mergedOptions = signal({}, ...(ngDevMode ? [{ debugName: "mergedOptions" }] : []));
349
- this.loadingRow = signal(null, ...(ngDevMode ? [{ debugName: "loadingRow" }] : []));
350
- this.injector = inject(Injector);
351
- this.cdr = inject(ChangeDetectorRef);
465
+ this.token = inject(AXP_WIDGET_TOKEN);
466
+ this.host = inject(ElementRef).nativeElement;
467
+ this.layoutService = inject(AXPLayoutBuilderService);
468
+ this.contextService = inject(AXPLayoutBuilderContextStore);
469
+ this.config = this.token.config;
470
+ this.node = this.token.node;
471
+ this.name = this.token.node.name;
472
+ this._options = signal(this.token.options ?? {}, ...(ngDevMode ? [{ debugName: "_options" }] : []));
473
+ this.options = this._options.asReadonly();
474
+ this.onOptionsChanged = new Subject();
475
+ this._status = signal(AXPWidgetStatus.Rendering, ...(ngDevMode ? [{ debugName: "_status" }] : []));
476
+ this.status = this._status.asReadonly();
477
+ this.onStatusChanged = new BehaviorSubject(this._status());
478
+ this.#statusEffect = effect(() => {
479
+ this.onStatusChanged.next(this.status());
480
+ }, ...(ngDevMode ? [{ debugName: "#statusEffect" }] : []));
481
+ this.isBusy = computed(() => [AXPWidgetStatus.Rendering, AXPWidgetStatus.Processing].includes(this.status()), ...(ngDevMode ? [{ debugName: "isBusy" }] : []));
482
+ this._children = signal(this.token.node.children ?? [], ...(ngDevMode ? [{ debugName: "_children" }] : []));
483
+ this.children = this._children.asReadonly();
352
484
  }
353
- get node() {
354
- return this._node;
485
+ get id() {
486
+ return this._id;
355
487
  }
356
- set node(v) {
357
- this._node = v;
488
+ #statusEffect;
489
+ outputs() {
490
+ return [];
358
491
  }
359
- get renderFooterTemplate() {
360
- return this.footerTemplate ?? this._contentFooterTemplate;
492
+ ngOnInit() {
493
+ if (get(this.node, '__meta__.added')) {
494
+ this.onAdded();
495
+ }
496
+ this.setStatus(AXPWidgetStatus.Rendered);
361
497
  }
362
- get renderCellTemplate() {
363
- return this.cellTemplate ?? this._contentCellTemplate;
498
+ setStatus(status) {
499
+ this._status.set(status);
500
+ this.layoutService.updateStatus();
364
501
  }
365
- async handleExpandRow(row) {
366
- this.loadingRow.set(row);
367
- await this.grid.expandRow(row);
368
- this.loadingRow.set(null);
369
- // if (row.data?.__meta__?.expanded === undefined) {
370
- // this.width = `${parseInt(this.width as string) + 24}px`;
371
- // }
502
+ setOptions(values) {
503
+ const oldValue = this.options();
504
+ const value = cloneDeep(values);
505
+ this._options.set({ ...oldValue, ...value });
506
+ this.onOptionsChanged.next({ sender: this });
372
507
  }
373
- get renderHeaderTemplate() {
374
- return this.headerTemplate ?? this._contentHeaderTemplate;
508
+ output(name) {
509
+ const outputs = this.outputs().map((c) => (typeof c == 'string' ? { name: c, value: c } : c));
510
+ if (outputs.some((c) => c.name == name)) {
511
+ const opt = get(this, name);
512
+ if (typeof opt == 'function') {
513
+ return opt();
514
+ }
515
+ return opt;
516
+ }
517
+ return null;
375
518
  }
376
- get loadingEnabled() {
377
- return true;
519
+ call(name, ...args) {
520
+ const fn = get(this, name);
521
+ if (fn && typeof fn == 'function') {
522
+ fn.bind(this)(...args);
523
+ }
378
524
  }
379
- get name() {
380
- return `col-${this.node.path}`;
525
+ setChildren(children) {
526
+ this._children.set([...children]);
381
527
  }
382
- async ngOnInit() {
383
- const widget = this.widgetRegistery.resolve(this.node.type);
384
- const mode = 'column';
385
- this.component = await widget?.components[mode]?.component();
386
- //
387
- const props = widget?.components[mode]?.properties
388
- ?.filter((c) => c.schema.defaultValue)
389
- .map((c) => ({ [c.name]: c.schema.defaultValue }))
390
- .reduce((acc, curr) => {
391
- return { ...acc, ...curr };
392
- }, {});
393
- //
394
- this.mergedOptions.set(merge(props, this.node.options) || {});
395
- const tokenValue = {
396
- path: this.node.path,
397
- options: this.mergedOptions(),
398
- };
399
- this.widgetInjector = Injector.create({
400
- parent: this.injector,
401
- providers: [
402
- {
403
- provide: AXP_WIDGET_COLUMN_TOKEN,
404
- useValue: tokenValue,
405
- },
406
- ],
407
- });
408
- this.width = this.customWidth ? this.customWidth : this.mergedOptions().width ?? '200px';
409
- this.allowResizing = this.mergedOptions().allowResizing || true;
410
- this.cdr.detectChanges();
528
+ onAdded() { }
529
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPBaseWidgetComponent, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
530
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPBaseWidgetComponent }); }
531
+ }
532
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPBaseWidgetComponent, decorators: [{
533
+ type: Injectable
534
+ }] });
535
+ class AXPLayoutBaseWidgetComponent extends AXPBaseWidgetComponent {
536
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPLayoutBaseWidgetComponent, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
537
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPLayoutBaseWidgetComponent }); }
538
+ }
539
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPLayoutBaseWidgetComponent, decorators: [{
540
+ type: Injectable
541
+ }] });
542
+ class AXPValueWidgetComponent extends AXPLayoutBaseWidgetComponent {
543
+ constructor() {
544
+ super(...arguments);
545
+ this.path = this.token.node.path;
546
+ this.defaultValue = this.token.defaultValue ?? this.token.node.defaultValue;
547
+ this._isValueWidget = false;
548
+ this.isValueWidget = () => this._isValueWidget;
549
+ this.onValueChanged = new Subject();
550
+ this.fullPath = signal(null, ...(ngDevMode ? [{ debugName: "fullPath" }] : []));
551
+ this.parentPath = signal(null, ...(ngDevMode ? [{ debugName: "parentPath" }] : []));
552
+ this.getValue = computed(() => {
553
+ return this.fullPath() ? this.extractValue(this.fullPath()) : null;
554
+ }, ...(ngDevMode ? [{ debugName: "getValue", equal: isEqual }] : [{ equal: isEqual }]));
555
+ this.validationRules = computed(() => {
556
+ const validationsRaw = this.options()['validations'];
557
+ if (validationsRaw == null) {
558
+ return [];
559
+ }
560
+ return Object.values(this.options()['validations'])
561
+ .filter((c) => c != null)
562
+ .map((c) => ({
563
+ rule: c.rule,
564
+ message: c.message,
565
+ options: c.options,
566
+ }));
567
+ }, ...(ngDevMode ? [{ debugName: "validationRules" }] : []));
411
568
  }
412
- getInputs(data) {
413
- return {
414
- rawValue: getSmart(data, this.node.path),
415
- rowData: data
416
- };
569
+ ngOnInit() {
570
+ this._isValueWidget = this.config.properties?.some((c) => c.name == 'path') ?? false;
571
+ if (this.isValueWidget()) {
572
+ this.detectFullPath();
573
+ if (!isNil(this.defaultValue) && isNil(this.getValue())) {
574
+ this.setValue(this.defaultValue);
575
+ }
576
+ }
577
+ //
578
+ super.ngOnInit();
417
579
  }
418
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPWidgetColumnRendererComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
419
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: AXPWidgetColumnRendererComponent, isStandalone: false, selector: "axp-widget-column-renderer", inputs: { caption: "caption", customExpandIcon: "customExpandIcon", customCollapseIcon: "customCollapseIcon", customWidth: "customWidth", node: "node", footerTemplate: "footerTemplate", expandHandler: "expandHandler", cellTemplate: "cellTemplate", headerTemplate: "headerTemplate" }, providers: [
420
- AXPLayoutBuilderService,
421
- { provide: AXDataTableColumnComponent, useExisting: AXPWidgetColumnRendererComponent },
422
- ], viewQueries: [{ propertyName: "_contentFooterTemplate", first: true, predicate: ["footer"], descendants: true }, { propertyName: "_contentCellTemplate", first: true, predicate: ["cell"], descendants: true }, { propertyName: "_contentHeaderTemplate", first: true, predicate: ["header"], descendants: true }], usesInheritance: true, ngImport: i0, template: `
423
- <ng-template #header>{{ caption }}</ng-template>
424
- <ng-template #cell let-row>
425
- <div class="ax-flex ax-gap-2 ax-items-center">
426
- @if (expandHandler) {
427
- <div
428
- (click)="handleExpandRow(row)"
429
- class="ax-expand-handler"
430
- [class.ax-invisible]="row.data.hasChild === false"
431
- id="ax-expand-handler-container"
432
- [style.padding-inline-start.rem]="row.data?.__meta__?.level * 2"
433
- >
434
- @if (loadingRow() === row) {
435
- <i class="fas fa-spinner-third ax-animate-twSpin ax-animate-infinite"></i>
436
- } @else { @if (row.data?.__meta__?.expanded) {
437
- <i [class]="customCollapseIcon || 'far fa-minus-square ax-text-md ax-opacity-75'"></i>
438
- } @else {
439
- <i [class]="customExpandIcon || 'far fa-plus-square ax-text-md ax-opacity-75'"></i>
440
- } }
441
- </div>
442
- } @if(component && widgetInjector && row?.data) {
443
- <ng-container
444
- *ngComponentOutlet="component; injector: widgetInjector; inputs: getInputs(row.data)"
445
- ></ng-container>
580
+ extractValue(path) {
581
+ const rawValue = this.contextService.getValue(path);
582
+ if (this.node.valueTransforms?.getter) {
583
+ return this.node.valueTransforms?.getter(rawValue);
446
584
  }
447
- </div>
448
- </ng-template>
449
- <ng-template #footer></ng-template>
450
- `, isInline: true, dependencies: [{ kind: "directive", type: i1.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"], exportAs: ["ngComponentOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
451
- }
452
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPWidgetColumnRendererComponent, decorators: [{
453
- type: Component,
454
- args: [{
455
- selector: 'axp-widget-column-renderer',
456
- template: `
457
- <ng-template #header>{{ caption }}</ng-template>
458
- <ng-template #cell let-row>
459
- <div class="ax-flex ax-gap-2 ax-items-center">
460
- @if (expandHandler) {
461
- <div
462
- (click)="handleExpandRow(row)"
463
- class="ax-expand-handler"
464
- [class.ax-invisible]="row.data.hasChild === false"
465
- id="ax-expand-handler-container"
466
- [style.padding-inline-start.rem]="row.data?.__meta__?.level * 2"
467
- >
468
- @if (loadingRow() === row) {
469
- <i class="fas fa-spinner-third ax-animate-twSpin ax-animate-infinite"></i>
470
- } @else { @if (row.data?.__meta__?.expanded) {
471
- <i [class]="customCollapseIcon || 'far fa-minus-square ax-text-md ax-opacity-75'"></i>
472
- } @else {
473
- <i [class]="customExpandIcon || 'far fa-plus-square ax-text-md ax-opacity-75'"></i>
474
- } }
475
- </div>
476
- } @if(component && widgetInjector && row?.data) {
477
- <ng-container
478
- *ngComponentOutlet="component; injector: widgetInjector; inputs: getInputs(row.data)"
479
- ></ng-container>
585
+ return rawValue;
586
+ }
587
+ setValue(value) {
588
+ if (this.node.valueTransforms?.setter) {
589
+ value = this.node.valueTransforms?.setter(value);
590
+ }
591
+ const oldValue = this.getValue();
592
+ value = isUndefined(value) ? null : value;
593
+ if (isNil(value) && isNil(oldValue)) {
594
+ return;
480
595
  }
481
- </div>
482
- </ng-template>
483
- <ng-template #footer></ng-template>
484
- `,
485
- providers: [
486
- AXPLayoutBuilderService,
487
- { provide: AXDataTableColumnComponent, useExisting: AXPWidgetColumnRendererComponent },
488
- ],
489
- changeDetection: ChangeDetectionStrategy.OnPush,
490
- inputs: ['caption'],
491
- standalone: false,
492
- }]
493
- }], propDecorators: { customExpandIcon: [{
494
- type: Input
495
- }], customCollapseIcon: [{
496
- type: Input
497
- }], customWidth: [{
498
- type: Input
499
- }], node: [{
500
- type: Input,
501
- args: [{ required: true }]
502
- }], footerTemplate: [{
503
- type: Input
504
- }], _contentFooterTemplate: [{
505
- type: ViewChild,
506
- args: ['footer']
507
- }], expandHandler: [{
508
- type: Input
509
- }], cellTemplate: [{
510
- type: Input
511
- }], _contentCellTemplate: [{
512
- type: ViewChild,
513
- args: ['cell']
514
- }], headerTemplate: [{
515
- type: Input
516
- }], _contentHeaderTemplate: [{
517
- type: ViewChild,
518
- args: ['header']
519
- }] } });
520
-
521
- class AXPLayoutContextChangeEvent {
522
- }
523
- const AXPLayoutBuilderContextStore = signalStore(
524
- // Initial State
525
- withState(() => ({
526
- data: {}, // Shared context data
527
- state: 'initiated', // Current state
528
- initialSnapshot: {}, // Snapshot of the first initialized state
529
- previousSnapshot: {}, // Snapshot of the previous state
530
- lastChange: {
531
- state: 'initiated',
532
- }, // Last change event
533
- })),
534
- // Computed Signals
535
- withComputed(({ data, state, lastChange, initialSnapshot, previousSnapshot }) => ({
536
- isChanged: computed(() => state() === 'changed'),
537
- isReset: computed(() => state() === 'restored'),
538
- isInitiated: computed(() => state() === 'initiated'),
539
- isEmpty: computed(() => Object.keys(data()).length === 0),
540
- isDirty: computed(() => !isEqual(data(), previousSnapshot())),
541
- snapshot: computed(() => cloneDeep(data())), // Current data snapshot
542
- initial: computed(() => cloneDeep(initialSnapshot())), // Initial snapshot
543
- previous: computed(() => cloneDeep(previousSnapshot())), // Previous snapshot
544
- changeEvent: computed(() => lastChange()), // Reactive last change event
545
- })),
546
- // Methods for State Management
547
- withMethods((store) => ({
548
- // Update a specific value
549
- update(path, value) {
550
- const currentData = cloneDeep(store.data());
551
- const oldValue = get(currentData, path);
552
- // Skip if the value hasn't changed
553
596
  if (isEqual(oldValue, value)) {
554
597
  return;
555
598
  }
556
- // Update the value and prepare the change event
557
- const updatedData = setSmart(currentData, path, value);
558
- const changeEvent = {
559
- oldValue,
560
- newValue: value,
561
- path,
562
- state: 'changed',
563
- data: updatedData,
564
- };
565
- // Patch the state
566
- patchState(store, {
567
- previousSnapshot: store.snapshot(), // Save the previous state
568
- data: updatedData,
569
- state: 'changed',
570
- lastChange: changeEvent,
571
- });
572
- },
573
- patch(context) {
574
- const currentData = cloneDeep(store.data());
575
- // Update the value and prepare the change event
576
- const updatedData = { ...currentData, ...context };
577
- const changeEvent = {
578
- state: 'patch',
579
- data: updatedData,
580
- };
581
- // Patch the state
582
- patchState(store, {
583
- previousSnapshot: store.snapshot(), // Save the previous state
584
- data: updatedData,
585
- state: 'changed',
586
- lastChange: changeEvent,
587
- });
588
- },
589
- // Reset to the initial state
590
- reset() {
591
- const initialData = store.initial();
592
- const changeEvent = {
593
- oldValue: cloneDeep(store.data()), // Current data becomes old value
594
- newValue: cloneDeep(initialData), // Reset to the initial state
595
- path: '',
596
- state: 'restored',
597
- data: initialData,
598
- };
599
- patchState(store, {
600
- previousSnapshot: store.snapshot(), // Save the previous state
601
- data: initialData,
602
- state: 'restored',
603
- lastChange: changeEvent,
604
- });
605
- },
606
- // Initialize the state
607
- set(initialData) {
608
- const currentData = store.data();
609
- if (isEqual(currentData, initialData)) {
610
- return; // Skip if the current state matches the initial state
599
+ if (this.fullPath()) {
600
+ this.contextService.update(this.fullPath(), value);
601
+ this.onValueChanged.next({ sender: this });
611
602
  }
612
- const changeEvent = {
613
- oldValue: null,
614
- newValue: cloneDeep(initialData),
615
- path: '',
616
- state: 'initiated',
617
- data: initialData,
603
+ }
604
+ detectFullPath() {
605
+ const sections = [];
606
+ const ids = [];
607
+ //
608
+ let parent = this;
609
+ //
610
+ while (parent) {
611
+ const isValueWidget = parent instanceof AXPValueWidgetComponent && parent.isValueWidget();
612
+ const valueParent = parent;
613
+ const path = valueParent.path ?? (isValueWidget ? valueParent.name : null);
614
+ const id = valueParent.name;
615
+ //
616
+ if (path) {
617
+ sections.push(path);
618
+ }
619
+ if (parent.index != null && isValueWidget) {
620
+ sections.push(`[${parent.index}]`);
621
+ }
622
+ if (id) {
623
+ ids.push(id);
624
+ if (parent.index != null) {
625
+ ids.push(`${parent.index}`);
626
+ }
627
+ }
628
+ parent = parent.parent;
629
+ }
630
+ //
631
+ this.fullPath.set(sections.reverse().join('.'));
632
+ this.parentPath.set(sections.slice(0, sections.length - 1).join('.'));
633
+ this._id = this.name || this.parent ? ids.reverse().join('_') : null;
634
+ if (this._id) {
635
+ this.layoutService.registerWidget(this._id, this);
636
+ }
637
+ }
638
+ handleValueChanged(e) {
639
+ if (e.isUserInteraction) {
640
+ this.setValue(e.value);
641
+ }
642
+ }
643
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPValueWidgetComponent, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
644
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPValueWidgetComponent }); }
645
+ }
646
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPValueWidgetComponent, decorators: [{
647
+ type: Injectable
648
+ }] });
649
+ class AXPDataListWidgetComponent extends AXPValueWidgetComponent {
650
+ constructor() {
651
+ super(...arguments);
652
+ this.dataService = inject(AXPDataSourceDefinitionProviderService);
653
+ this.textField = computed(() => this.options()['textField'] ?? 'title', ...(ngDevMode ? [{ debugName: "textField" }] : []));
654
+ this.valueField = computed(() => this.options()['valueField'] ?? 'id', ...(ngDevMode ? [{ debugName: "valueField" }] : []));
655
+ this.dataSource = signal(convertArrayToDataSource([]), ...(ngDevMode ? [{ debugName: "dataSource" }] : []));
656
+ this.isReady = computed(() => {
657
+ const key = this.dataSource().config?.key;
658
+ const valueField = this.valueField();
659
+ const result = key == valueField;
660
+ return result;
661
+ }, ...(ngDevMode ? [{ debugName: "isReady" }] : []));
662
+ this.selectedItems = signal([], ...(ngDevMode ? [{ debugName: "selectedItems" }] : []));
663
+ this.rf = effect(async () => {
664
+ const rawValue = this.options()['dataSource'];
665
+ // static datasource class
666
+ if (rawValue instanceof AXDataSource) {
667
+ this.dataSource.set(rawValue);
668
+ }
669
+ // static array datasource
670
+ else if (Array.isArray(rawValue)) {
671
+ const ds = new AXDataSource({
672
+ key: this.valueField(),
673
+ pageSize: 10,
674
+ load: async (e) => {
675
+ const raw = this.options()['dataSource'];
676
+ return {
677
+ items: raw,
678
+ total: raw.length,
679
+ };
680
+ },
681
+ byKey: (key) => {
682
+ const raw = this.options()['dataSource'];
683
+ const item = raw.filter((c) => c[this.valueField()] == key);
684
+ return Promise.resolve(item[0]);
685
+ },
686
+ });
687
+ this.dataSource.set(ds);
688
+ }
689
+ // resolve data source by name
690
+ else if (rawValue && (typeof rawValue == 'string' || typeof rawValue == 'object')) {
691
+ const id = typeof rawValue == 'object' ? rawValue['id'] : rawValue;
692
+ const c = await this.dataService.get(id);
693
+ if (this.mode == 'designer' && c?.samples?.length) {
694
+ this.dataSource.set(convertArrayToDataSource(c.samples, {
695
+ key: this.valueField(),
696
+ pageSize: 500,
697
+ }));
698
+ }
699
+ else {
700
+ const ds = c?.source();
701
+ if (ds && ds instanceof Promise) {
702
+ const d = await ds;
703
+ this.dataSource.set(d);
704
+ }
705
+ else if (ds) {
706
+ this.dataSource.set(ds);
707
+ }
708
+ // empty datasource
709
+ else {
710
+ this.dataSource.set(convertArrayToDataSource([]));
711
+ }
712
+ }
713
+ }
714
+ // empty datasource
715
+ else {
716
+ this.dataSource.set(convertArrayToDataSource([]));
717
+ }
718
+ }, ...(ngDevMode ? [{ debugName: "rf" }] : []));
719
+ this.effect2 = effect(async () => {
720
+ const value = this.getValue();
721
+ const items = [];
722
+ if (Array.isArray(value)) {
723
+ items.push(...(await Promise.all(value.map((item) => this.extractItem(item)))));
724
+ }
725
+ else {
726
+ items.push(await this.extractItem(value));
727
+ }
728
+ this.selectedItems.set(items.filter((c) => c != null));
729
+ }, ...(ngDevMode ? [{ debugName: "effect2" }] : []));
730
+ }
731
+ async extractItem(item) {
732
+ if (isNil(item)) {
733
+ return null;
734
+ }
735
+ if (isObjectLike(item) && get(item, this.textField()) != null) {
736
+ return item;
737
+ }
738
+ const key = extractValue(item, this.valueField());
739
+ const ds = this.dataSource();
740
+ if (ds.config?.byKey) {
741
+ const found = await ds.config?.byKey(key);
742
+ if (found) {
743
+ return found;
744
+ }
745
+ }
746
+ return isObjectLike(item)
747
+ ? item
748
+ : {
749
+ [this.valueField()]: item,
750
+ [this.textField()]: item,
751
+ };
752
+ }
753
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPDataListWidgetComponent, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
754
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPDataListWidgetComponent }); }
755
+ }
756
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPDataListWidgetComponent, decorators: [{
757
+ type: Injectable
758
+ }] });
759
+ class AXPColumnWidgetComponent {
760
+ constructor() {
761
+ this.token = inject(AXP_WIDGET_COLUMN_TOKEN);
762
+ this.path = this.token.path;
763
+ this.options = this.token.options ?? {};
764
+ this.rawValue = null;
765
+ this.nullText = this.options['nullText'];
766
+ this.nullValue = this.options['nullValue'];
767
+ this.value = computed(() => {
768
+ if (isNil(this.rawValue) && !isNil(this.nullValue)) {
769
+ return this.nullValue;
770
+ }
771
+ return this.rawValue;
772
+ }, ...(ngDevMode ? [{ debugName: "value" }] : []));
773
+ }
774
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPColumnWidgetComponent, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
775
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPColumnWidgetComponent }); }
776
+ }
777
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPColumnWidgetComponent, decorators: [{
778
+ type: Injectable
779
+ }] });
780
+
781
+ class AXPBoxModelLayoutWidgetComponent extends AXPLayoutBaseWidgetComponent {
782
+ constructor() {
783
+ super(...arguments);
784
+ this.hostBoxStyle = computed(() => {
785
+ const options = this.options();
786
+ const style = {};
787
+ const spacing = options?.['spacing'];
788
+ const border = options?.['border'];
789
+ const backgroundColor = options?.['backgroundColor'];
790
+ const direction = options?.['direction'];
791
+ const overflow = options?.['overflow'];
792
+ const overflowX = options?.['overflowX'];
793
+ const overflowY = options?.['overflowY'];
794
+ style['background-color'] = backgroundColor ?? '';
795
+ style['padding'] = spacing?.padding ?? '';
796
+ style['margin'] = spacing?.margin ?? '';
797
+ style['border-radius'] = border?.radius ?? '';
798
+ style['border-width'] = border?.width ?? '';
799
+ style['border-color'] = border?.color ?? '';
800
+ style['border-style'] = border?.style ?? '';
801
+ style['overflow'] = overflow ?? '';
802
+ style['overflow-x'] = overflowX ?? '';
803
+ style['overflow-y'] = overflowY ?? '';
804
+ style['direction'] = direction ?? '';
805
+ return style;
806
+ }, ...(ngDevMode ? [{ debugName: "hostBoxStyle" }] : []));
807
+ this.blockStyle = computed(() => {
808
+ const options = this.options();
809
+ const style = { ...this.hostBoxStyle() };
810
+ const width = options?.['width'];
811
+ const minWidth = options?.['minWidth'];
812
+ const maxWidth = options?.['maxWidth'];
813
+ const height = options?.['height'];
814
+ const minHeight = options?.['minHeight'];
815
+ const maxHeight = options?.['maxHeight'];
816
+ style['min-width'] = minWidth ?? '';
817
+ style['width'] = width ?? '';
818
+ style['max-width'] = maxWidth ?? '';
819
+ style['min-height'] = minHeight ?? '';
820
+ style['height'] = height ?? '';
821
+ style['max-height'] = maxHeight ?? '';
822
+ return style;
823
+ }, ...(ngDevMode ? [{ debugName: "blockStyle" }] : []));
824
+ this.inlineStyle = computed(() => {
825
+ return { ...this.hostBoxStyle() };
826
+ }, ...(ngDevMode ? [{ debugName: "inlineStyle" }] : []));
827
+ this.blockClass = computed(() => {
828
+ return {
829
+ 'ax-block': true,
830
+ 'ax-w-full': true,
831
+ // 'ax-widget-outline': true,
832
+ };
833
+ }, ...(ngDevMode ? [{ debugName: "blockClass" }] : []));
834
+ this.inlineClass = computed(() => {
835
+ return {
836
+ 'ax-inline-block': true,
837
+ };
838
+ }, ...(ngDevMode ? [{ debugName: "inlineClass" }] : []));
839
+ }
840
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPBoxModelLayoutWidgetComponent, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
841
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPBoxModelLayoutWidgetComponent }); }
842
+ }
843
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPBoxModelLayoutWidgetComponent, decorators: [{
844
+ type: Injectable
845
+ }] });
846
+
847
+ class AXPBlockBaseLayoutWidgetComponent extends AXPBoxModelLayoutWidgetComponent {
848
+ constructor() {
849
+ super(...arguments);
850
+ this.hostClass = computed(() => this.blockClass(), ...(ngDevMode ? [{ debugName: "hostClass" }] : []));
851
+ this.hostStyle = computed(() => this.blockStyle(), ...(ngDevMode ? [{ debugName: "hostStyle" }] : []));
852
+ }
853
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPBlockBaseLayoutWidgetComponent, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
854
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPBlockBaseLayoutWidgetComponent }); }
855
+ }
856
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPBlockBaseLayoutWidgetComponent, decorators: [{
857
+ type: Injectable
858
+ }] });
859
+
860
+ class AXPFlexBaseLayoutWidgetComponent extends AXPBlockBaseLayoutWidgetComponent {
861
+ constructor() {
862
+ super(...arguments);
863
+ this.flex = computed(() => this.options(), ...(ngDevMode ? [{ debugName: "flex" }] : []));
864
+ this.hostFlexStyle = computed(() => {
865
+ const blockStyle = this.blockStyle();
866
+ const style = { ...blockStyle };
867
+ const flex = this.flex();
868
+ if (isNil(flex?.flexDirection)) {
869
+ style['flex-direction'] = '';
870
+ }
871
+ else {
872
+ style['flex-direction'] = flex.flexDirection;
873
+ }
874
+ if (isNil(flex?.flexWrap)) {
875
+ style['flex-wrap'] = '';
876
+ }
877
+ else {
878
+ style['flex-wrap'] = flex.flexWrap;
879
+ }
880
+ //TODO NEED TO FIX LATER
881
+ style['overflow'] = flex?.flexWrap === 'nowrap' ? 'auto' : '';
882
+ //END
883
+ if (isNil(flex?.justifyContent)) {
884
+ style['justify-content'] = '';
885
+ }
886
+ else {
887
+ style['justify-content'] = flex.justifyContent;
888
+ }
889
+ if (isNil(flex?.alignItems)) {
890
+ style['align-items'] = '';
891
+ }
892
+ else {
893
+ style['align-items'] = flex.alignItems;
894
+ }
895
+ if (isNil(flex?.gap)) {
896
+ style['gap'] = '';
897
+ }
898
+ else {
899
+ style['gap'] = flex.gap;
900
+ }
901
+ return style;
902
+ }, ...(ngDevMode ? [{ debugName: "hostFlexStyle" }] : []));
903
+ this.hostFlexClass = computed(() => {
904
+ return {
905
+ ...this.blockClass(),
906
+ 'ax-flex': true,
907
+ 'ax-h-full': true,
908
+ };
909
+ }, ...(ngDevMode ? [{ debugName: "hostFlexClass" }] : []));
910
+ this.hostClass = computed(() => {
911
+ return this.hostFlexClass();
912
+ }, ...(ngDevMode ? [{ debugName: "hostClass" }] : []));
913
+ this.hostStyle = computed(() => {
914
+ return this.hostFlexStyle();
915
+ }, ...(ngDevMode ? [{ debugName: "hostStyle" }] : []));
916
+ }
917
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPFlexBaseLayoutWidgetComponent, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
918
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPFlexBaseLayoutWidgetComponent }); }
919
+ }
920
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPFlexBaseLayoutWidgetComponent, decorators: [{
921
+ type: Injectable
922
+ }] });
923
+
924
+ class AXPInlineBaseLayoutWidgetComponent extends AXPBoxModelLayoutWidgetComponent {
925
+ constructor() {
926
+ super(...arguments);
927
+ this.hostClass = computed(() => this.inlineClass(), ...(ngDevMode ? [{ debugName: "hostClass" }] : []));
928
+ this.hostStyle = computed(() => this.inlineStyle(), ...(ngDevMode ? [{ debugName: "hostStyle" }] : []));
929
+ }
930
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPInlineBaseLayoutWidgetComponent, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
931
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPInlineBaseLayoutWidgetComponent }); }
932
+ }
933
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPInlineBaseLayoutWidgetComponent, decorators: [{
934
+ type: Injectable
935
+ }] });
936
+
937
+ class AXPFlexItemBaseLayoutWidgetComponent extends AXPInlineBaseLayoutWidgetComponent {
938
+ constructor() {
939
+ super(...arguments);
940
+ this.flexItem = computed(() => this.options(), ...(ngDevMode ? [{ debugName: "flexItem" }] : []));
941
+ this.hostFlexItemStyle = computed(() => {
942
+ const inlineStyle = this.blockStyle();
943
+ const style = { ...inlineStyle };
944
+ const fi = this.flexItem();
945
+ if (isNil(fi?.order)) {
946
+ style['order'] = '';
947
+ }
948
+ else {
949
+ style['order'] = fi.order;
950
+ }
951
+ if (isNil(fi?.grow)) {
952
+ style['flex-grow'] = '';
953
+ }
954
+ else {
955
+ style['flex-grow'] = fi.grow;
956
+ }
957
+ if (isNil(fi?.shrink)) {
958
+ style['flex-shrink'] = '';
959
+ }
960
+ else {
961
+ style['flex-shrink'] = fi.shrink;
962
+ }
963
+ if (isNil(fi?.basis)) {
964
+ style['flex-basis'] = '';
965
+ }
966
+ else {
967
+ style['flex-basis'] = fi.basis;
968
+ }
969
+ if (isNil(fi?.alignSelf)) {
970
+ style['align-self'] = '';
971
+ }
972
+ else {
973
+ style['align-self'] = fi.alignSelf;
974
+ }
975
+ return style;
976
+ }, ...(ngDevMode ? [{ debugName: "hostFlexItemStyle" }] : []));
977
+ this.hostFlexItemClass = computed(() => {
978
+ return {
979
+ ...this.blockClass(),
980
+ };
981
+ }, ...(ngDevMode ? [{ debugName: "hostFlexItemClass" }] : []));
982
+ this.hostClass = computed(() => {
983
+ return this.hostFlexItemClass();
984
+ }, ...(ngDevMode ? [{ debugName: "hostClass" }] : []));
985
+ this.hostStyle = computed(() => {
986
+ return this.hostFlexItemStyle();
987
+ }, ...(ngDevMode ? [{ debugName: "hostStyle" }] : []));
988
+ }
989
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPFlexItemBaseLayoutWidgetComponent, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
990
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPFlexItemBaseLayoutWidgetComponent }); }
991
+ }
992
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPFlexItemBaseLayoutWidgetComponent, decorators: [{
993
+ type: Injectable
994
+ }] });
995
+
996
+ class AXPGridBaseLayoutWidgetComponent extends AXPBlockBaseLayoutWidgetComponent {
997
+ constructor() {
998
+ super(...arguments);
999
+ this.grid = computed(() => this.options()?.grid, ...(ngDevMode ? [{ debugName: "grid" }] : []));
1000
+ this.hostGridStyle = computed(() => {
1001
+ const style = { ...this.inlineStyle() };
1002
+ const g = this.grid()?.default;
1003
+ if (g?.gap)
1004
+ style['gap'] = g.gap;
1005
+ return style;
1006
+ }, ...(ngDevMode ? [{ debugName: "hostGridStyle" }] : []));
1007
+ this.hostGridClass = computed(() => {
1008
+ const cls = {
1009
+ ...this.inlineClass(),
1010
+ 'ax-grid': true,
1011
+ };
1012
+ const g = this.grid()?.default;
1013
+ if (g?.columns)
1014
+ cls[`lg:ax-grid-cols-${g.columns}`] = true;
1015
+ if (g?.rows)
1016
+ cls[`lg:ax-grid-rows-${g.rows}`] = true;
1017
+ if (g?.justifyItems)
1018
+ cls[`lg:ax-justify-items-${g.justifyItems}`] = true;
1019
+ if (g?.alignItems)
1020
+ cls[`lg:ax-align-items-${g.alignItems}`] = true;
1021
+ if (g?.autoFlow)
1022
+ cls[`lg:ax-grid-flow-${g.autoFlow}`] = true;
1023
+ return cls;
1024
+ }, ...(ngDevMode ? [{ debugName: "hostGridClass" }] : []));
1025
+ this.hostClass = computed(() => this.hostGridClass(), ...(ngDevMode ? [{ debugName: "hostClass" }] : []));
1026
+ this.hostStyle = computed(() => this.hostGridStyle(), ...(ngDevMode ? [{ debugName: "hostStyle" }] : []));
1027
+ }
1028
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPGridBaseLayoutWidgetComponent, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
1029
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPGridBaseLayoutWidgetComponent }); }
1030
+ }
1031
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPGridBaseLayoutWidgetComponent, decorators: [{
1032
+ type: Injectable
1033
+ }] });
1034
+
1035
+ class AXPGridItemBaseLayoutWidgetComponent extends AXPFlexBaseLayoutWidgetComponent {
1036
+ constructor() {
1037
+ super(...arguments);
1038
+ this.gridItem = computed(() => this.options(), ...(ngDevMode ? [{ debugName: "gridItem" }] : []));
1039
+ this.hostGridItemStyle = computed(() => {
1040
+ const style = { ...this.hostFlexStyle() };
1041
+ const g = this.gridItem();
1042
+ if (g?.alignSelf)
1043
+ style['align-self'] = g.alignSelf;
1044
+ if (g?.justifySelf)
1045
+ style['justify-self'] = g.justifySelf;
1046
+ return style;
1047
+ }, ...(ngDevMode ? [{ debugName: "hostGridItemStyle" }] : []));
1048
+ this.hostGridItemClass = computed(() => {
1049
+ const cls = { ...this.hostFlexClass() };
1050
+ const g = this.gridItem();
1051
+ if (g?.colSpan)
1052
+ cls[`lg:ax-col-span-${g.colSpan}`] = true;
1053
+ if (g?.colStart)
1054
+ cls[`lg:ax-col-start-${g.colStart}`] = true;
1055
+ if (g?.colEnd)
1056
+ cls[`lg:ax-col-end-${g.colEnd}`] = true;
1057
+ if (g?.rowSpan)
1058
+ cls[`lg:ax-row-span-${g.rowSpan}`] = true;
1059
+ if (g?.rowStart)
1060
+ cls[`lg:ax-row-start-${g.rowStart}`] = true;
1061
+ if (g?.rowEnd)
1062
+ cls[`lg:ax-row-end-${g.rowEnd}`] = true;
1063
+ return cls;
1064
+ }, ...(ngDevMode ? [{ debugName: "hostGridItemClass" }] : []));
1065
+ this.hostClass = computed(() => this.hostGridItemClass(), ...(ngDevMode ? [{ debugName: "hostClass" }] : []));
1066
+ this.hostStyle = computed(() => this.hostGridItemStyle(), ...(ngDevMode ? [{ debugName: "hostStyle" }] : []));
1067
+ }
1068
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPGridItemBaseLayoutWidgetComponent, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
1069
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPGridItemBaseLayoutWidgetComponent }); }
1070
+ }
1071
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPGridItemBaseLayoutWidgetComponent, decorators: [{
1072
+ type: Injectable
1073
+ }] });
1074
+
1075
+ class AXPWidgetRegistryService {
1076
+ /**
1077
+ *
1078
+ */
1079
+ constructor() {
1080
+ this.types = new Map();
1081
+ AXPWidgetRegistryService.instance = this;
1082
+ }
1083
+ register(widget) {
1084
+ this.types.set(widget.name, widget);
1085
+ }
1086
+ extend(parentName, widget) {
1087
+ const parentWidget = this.resolve(parentName);
1088
+ const newWidget = merge({}, parentWidget, widget);
1089
+ newWidget.name = widget.name;
1090
+ this.register(newWidget);
1091
+ }
1092
+ resolve(name) {
1093
+ const widget = this.types.get(name);
1094
+ if (!widget) {
1095
+ throw new Error(`Widget with name "${name}" does not exist.`);
1096
+ }
1097
+ return widget;
1098
+ }
1099
+ all() {
1100
+ return Array.from(this.types.values());
1101
+ }
1102
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPWidgetRegistryService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1103
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPWidgetRegistryService, providedIn: 'root' }); }
1104
+ }
1105
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPWidgetRegistryService, decorators: [{
1106
+ type: Injectable,
1107
+ args: [{
1108
+ providedIn: 'root',
1109
+ }]
1110
+ }], ctorParameters: () => [] });
1111
+
1112
+ class AXPWidgetColumnRendererComponent extends AXDataTableColumnComponent {
1113
+ constructor() {
1114
+ super(...arguments);
1115
+ this.widgetRegistery = inject(AXPWidgetRegistryService);
1116
+ this.grid = inject(AXBaseDataTable);
1117
+ this.mergedOptions = signal({}, ...(ngDevMode ? [{ debugName: "mergedOptions" }] : []));
1118
+ this.loadingRow = signal(null, ...(ngDevMode ? [{ debugName: "loadingRow" }] : []));
1119
+ this.injector = inject(Injector);
1120
+ this.cdr = inject(ChangeDetectorRef);
1121
+ }
1122
+ get node() {
1123
+ return this._node;
1124
+ }
1125
+ set node(v) {
1126
+ this._node = v;
1127
+ }
1128
+ get renderFooterTemplate() {
1129
+ return this.footerTemplate ?? this._contentFooterTemplate;
1130
+ }
1131
+ get renderCellTemplate() {
1132
+ return this.cellTemplate ?? this._contentCellTemplate;
1133
+ }
1134
+ async handleExpandRow(row) {
1135
+ this.loadingRow.set(row);
1136
+ await this.grid.expandRow(row);
1137
+ this.loadingRow.set(null);
1138
+ // if (row.data?.__meta__?.expanded === undefined) {
1139
+ // this.width = `${parseInt(this.width as string) + 24}px`;
1140
+ // }
1141
+ }
1142
+ get renderHeaderTemplate() {
1143
+ return this.headerTemplate ?? this._contentHeaderTemplate;
1144
+ }
1145
+ get loadingEnabled() {
1146
+ return true;
1147
+ }
1148
+ get name() {
1149
+ return `col-${this.node.path}`;
1150
+ }
1151
+ async ngOnInit() {
1152
+ const widget = this.widgetRegistery.resolve(this.node.type);
1153
+ const mode = 'column';
1154
+ this.component = await widget?.components[mode]?.component();
1155
+ //
1156
+ const props = widget?.components[mode]?.properties
1157
+ ?.filter((c) => c.schema.defaultValue)
1158
+ .map((c) => ({ [c.name]: c.schema.defaultValue }))
1159
+ .reduce((acc, curr) => {
1160
+ return { ...acc, ...curr };
1161
+ }, {});
1162
+ //
1163
+ this.mergedOptions.set(merge(props, this.node.options) || {});
1164
+ const tokenValue = {
1165
+ path: this.node.path,
1166
+ options: this.mergedOptions(),
618
1167
  };
619
- patchState(store, {
620
- initialSnapshot: cloneDeep(initialData), // Save the initial state
621
- previousSnapshot: store.snapshot(), // Save the current state as the previous
622
- data: initialData,
623
- state: 'initiated',
624
- lastChange: changeEvent,
1168
+ this.widgetInjector = Injector.create({
1169
+ parent: this.injector,
1170
+ providers: [
1171
+ {
1172
+ provide: AXP_WIDGET_COLUMN_TOKEN,
1173
+ useValue: tokenValue,
1174
+ },
1175
+ ],
625
1176
  });
626
- },
627
- // Get a specific value
628
- getValue(path) {
629
- return get(store.data(), path);
630
- },
631
- })));
1177
+ this.width = this.customWidth ? this.customWidth : (this.mergedOptions().width ?? '200px');
1178
+ this.allowResizing = this.mergedOptions().allowResizing || true;
1179
+ this.cdr.detectChanges();
1180
+ }
1181
+ getInputs(data) {
1182
+ return {
1183
+ rawValue: getSmart(data, this.node.path),
1184
+ rowData: data,
1185
+ };
1186
+ }
1187
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPWidgetColumnRendererComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1188
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.8", type: AXPWidgetColumnRendererComponent, isStandalone: false, selector: "axp-widget-column-renderer", inputs: { caption: "caption", customExpandIcon: "customExpandIcon", customCollapseIcon: "customCollapseIcon", customWidth: "customWidth", node: "node", footerTemplate: "footerTemplate", expandHandler: "expandHandler", cellTemplate: "cellTemplate", headerTemplate: "headerTemplate" }, providers: [
1189
+ AXPLayoutBuilderService,
1190
+ { provide: AXDataTableColumnComponent, useExisting: AXPWidgetColumnRendererComponent },
1191
+ ], viewQueries: [{ propertyName: "_contentFooterTemplate", first: true, predicate: ["footer"], descendants: true }, { propertyName: "_contentCellTemplate", first: true, predicate: ["cell"], descendants: true }, { propertyName: "_contentHeaderTemplate", first: true, predicate: ["header"], descendants: true }], usesInheritance: true, ngImport: i0, template: `
1192
+ <ng-template #header>{{ caption | translate | async }}</ng-template>
1193
+ <ng-template #cell let-row>
1194
+ <div class="ax-flex ax-gap-2 ax-items-center">
1195
+ @if (expandHandler) {
1196
+ <div
1197
+ (click)="handleExpandRow(row)"
1198
+ class="ax-expand-handler"
1199
+ [class.ax-invisible]="row.data.hasChild === false"
1200
+ id="ax-expand-handler-container"
1201
+ [style.padding-inline-start.rem]="row.data?.__meta__?.level * 2"
1202
+ >
1203
+ @if (loadingRow() === row) {
1204
+ <i class="fas fa-spinner-third ax-animate-twSpin ax-animate-infinite"></i>
1205
+ } @else {
1206
+ @if (row.data?.__meta__?.expanded) {
1207
+ <i [class]="customCollapseIcon || 'far fa-minus-square ax-text-md ax-opacity-75'"></i>
1208
+ } @else {
1209
+ <i [class]="customExpandIcon || 'far fa-plus-square ax-text-md ax-opacity-75'"></i>
1210
+ }
1211
+ }
1212
+ </div>
1213
+ }
1214
+ @if (component && widgetInjector && row?.data) {
1215
+ <ng-container
1216
+ *ngComponentOutlet="component; injector: widgetInjector; inputs: getInputs(row.data)"
1217
+ ></ng-container>
1218
+ }
1219
+ </div>
1220
+ </ng-template>
1221
+ <ng-template #footer></ng-template>
1222
+ `, isInline: true, dependencies: [{ kind: "directive", type: i1.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"], exportAs: ["ngComponentOutlet"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1223
+ }
1224
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPWidgetColumnRendererComponent, decorators: [{
1225
+ type: Component,
1226
+ args: [{
1227
+ selector: 'axp-widget-column-renderer',
1228
+ template: `
1229
+ <ng-template #header>{{ caption | translate | async }}</ng-template>
1230
+ <ng-template #cell let-row>
1231
+ <div class="ax-flex ax-gap-2 ax-items-center">
1232
+ @if (expandHandler) {
1233
+ <div
1234
+ (click)="handleExpandRow(row)"
1235
+ class="ax-expand-handler"
1236
+ [class.ax-invisible]="row.data.hasChild === false"
1237
+ id="ax-expand-handler-container"
1238
+ [style.padding-inline-start.rem]="row.data?.__meta__?.level * 2"
1239
+ >
1240
+ @if (loadingRow() === row) {
1241
+ <i class="fas fa-spinner-third ax-animate-twSpin ax-animate-infinite"></i>
1242
+ } @else {
1243
+ @if (row.data?.__meta__?.expanded) {
1244
+ <i [class]="customCollapseIcon || 'far fa-minus-square ax-text-md ax-opacity-75'"></i>
1245
+ } @else {
1246
+ <i [class]="customExpandIcon || 'far fa-plus-square ax-text-md ax-opacity-75'"></i>
1247
+ }
1248
+ }
1249
+ </div>
1250
+ }
1251
+ @if (component && widgetInjector && row?.data) {
1252
+ <ng-container
1253
+ *ngComponentOutlet="component; injector: widgetInjector; inputs: getInputs(row.data)"
1254
+ ></ng-container>
1255
+ }
1256
+ </div>
1257
+ </ng-template>
1258
+ <ng-template #footer></ng-template>
1259
+ `,
1260
+ providers: [
1261
+ AXPLayoutBuilderService,
1262
+ { provide: AXDataTableColumnComponent, useExisting: AXPWidgetColumnRendererComponent },
1263
+ ],
1264
+ changeDetection: ChangeDetectionStrategy.OnPush,
1265
+ inputs: ['caption'],
1266
+ standalone: false,
1267
+ }]
1268
+ }], propDecorators: { customExpandIcon: [{
1269
+ type: Input
1270
+ }], customCollapseIcon: [{
1271
+ type: Input
1272
+ }], customWidth: [{
1273
+ type: Input
1274
+ }], node: [{
1275
+ type: Input,
1276
+ args: [{ required: true }]
1277
+ }], footerTemplate: [{
1278
+ type: Input
1279
+ }], _contentFooterTemplate: [{
1280
+ type: ViewChild,
1281
+ args: ['footer']
1282
+ }], expandHandler: [{
1283
+ type: Input
1284
+ }], cellTemplate: [{
1285
+ type: Input
1286
+ }], _contentCellTemplate: [{
1287
+ type: ViewChild,
1288
+ args: ['cell']
1289
+ }], headerTemplate: [{
1290
+ type: Input
1291
+ }], _contentHeaderTemplate: [{
1292
+ type: ViewChild,
1293
+ args: ['header']
1294
+ }] } });
632
1295
 
633
1296
  class AXPWidgetContainerComponent {
634
1297
  set context(value) {
@@ -653,10 +1316,16 @@ class AXPWidgetContainerComponent {
653
1316
  }
654
1317
  });
655
1318
  }
656
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPWidgetContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
657
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.6", type: AXPWidgetContainerComponent, isStandalone: false, selector: "axp-widgets-container", inputs: { context: "context", functions: "functions" }, outputs: { onContextChanged: "onContextChanged" }, host: { styleAttribute: "display: contents;" }, providers: [AXPLayoutBuilderService, AXPLayoutBuilderContextStore], ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1319
+ refresh() {
1320
+ this.builderService.refresh();
1321
+ }
1322
+ find(name) {
1323
+ return this.builderService.waitForWidget(name);
1324
+ }
1325
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPWidgetContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1326
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.8", type: AXPWidgetContainerComponent, isStandalone: false, selector: "axp-widgets-container", inputs: { context: "context", functions: "functions" }, outputs: { onContextChanged: "onContextChanged" }, host: { styleAttribute: "display: contents;" }, providers: [AXPLayoutBuilderService, AXPLayoutBuilderContextStore], ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
658
1327
  }
659
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPWidgetContainerComponent, decorators: [{
1328
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPWidgetContainerComponent, decorators: [{
660
1329
  type: Component,
661
1330
  args: [{
662
1331
  selector: 'axp-widgets-container',
@@ -675,12 +1344,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
675
1344
  }] } });
676
1345
 
677
1346
  class AXPWidgetPlaceholderComponent {
678
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPWidgetPlaceholderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
679
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.6", type: AXPWidgetPlaceholderComponent, isStandalone: true, selector: "axp-widget-placeholder", ngImport: i0, template: `<div>
1347
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPWidgetPlaceholderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1348
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.8", type: AXPWidgetPlaceholderComponent, isStandalone: true, selector: "axp-widget-placeholder", ngImport: i0, template: `<div>
680
1349
  <ax-skeleton class="ax-w-full ax-h-10 ax-rounded-md"></ax-skeleton>
681
1350
  </div>`, isInline: true, dependencies: [{ kind: "ngmodule", type: AXSkeletonModule }, { kind: "component", type: i1$1.AXSkeletonComponent, selector: "ax-skeleton", inputs: ["animated"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
682
1351
  }
683
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPWidgetPlaceholderComponent, decorators: [{
1352
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPWidgetPlaceholderComponent, decorators: [{
684
1353
  type: Component,
685
1354
  args: [{
686
1355
  selector: 'axp-widget-placeholder',
@@ -786,8 +1455,10 @@ class AXPWidgetRendererDirective {
786
1455
  //
787
1456
  const widget = this.widgetRegistery.resolve(this.node().type);
788
1457
  //
789
- const propertiesToProcess = [...(widget?.properties ?? []), ...(widget?.components[this.mode()]?.properties ?? [])]
790
- ?.filter((c) => c.schema.defaultValue != null);
1458
+ const propertiesToProcess = [
1459
+ ...(widget?.properties ?? []),
1460
+ ...(widget?.components[this.mode()]?.properties ?? []),
1461
+ ]?.filter((c) => c.schema.defaultValue != null);
791
1462
  // Process default values (evaluate expressions if needed)
792
1463
  const props = {};
793
1464
  for (const property of propertiesToProcess) {
@@ -893,7 +1564,7 @@ class AXPWidgetRendererDirective {
893
1564
  Object.entries(obj).forEach(([key, value]) => {
894
1565
  const currentPath = pathPrefix ? `${pathPrefix}.${key}` : key;
895
1566
  // CRITICAL FIX: Skip trigger actions during options processing
896
- //
1567
+ //
897
1568
  // PROBLEM: Trigger actions were being evaluated immediately during widget setup/options processing,
898
1569
  // causing them to execute before the actual trigger event occurred. This meant triggers would fire
899
1570
  // during initialization instead of when the specified context path actually changed.
@@ -1131,14 +1802,14 @@ class AXPWidgetRendererDirective {
1131
1802
  console.error('Error evaluating action expression:', templateExpression, error);
1132
1803
  }
1133
1804
  }
1134
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPWidgetRendererDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1135
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.1.6", type: AXPWidgetRendererDirective, isStandalone: false, selector: "[axp-widget-renderer]", inputs: { parentNode: { classPropertyName: "parentNode", publicName: "parentNode", isSignal: true, isRequired: false, transformFunction: null }, index: { classPropertyName: "index", publicName: "index", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: true, transformFunction: null }, node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { onOptionsChanged: "onOptionsChanged", onValueChanged: "onValueChanged" }, providers: [
1805
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPWidgetRendererDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1806
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.1.8", type: AXPWidgetRendererDirective, isStandalone: false, selector: "[axp-widget-renderer]", inputs: { parentNode: { classPropertyName: "parentNode", publicName: "parentNode", isSignal: true, isRequired: false, transformFunction: null }, index: { classPropertyName: "index", publicName: "index", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: true, transformFunction: null }, node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { onOptionsChanged: "onOptionsChanged", onValueChanged: "onValueChanged" }, providers: [
1136
1807
  {
1137
1808
  provide: AXUnsubscriber,
1138
1809
  },
1139
1810
  ], exportAs: ["widgetRenderer"], usesOnChanges: true, ngImport: i0 }); }
1140
1811
  }
1141
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPWidgetRendererDirective, decorators: [{
1812
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPWidgetRendererDirective, decorators: [{
1142
1813
  type: Directive,
1143
1814
  args: [{
1144
1815
  selector: '[axp-widget-renderer]',
@@ -1180,386 +1851,254 @@ class AXPLayoutBuilderModule {
1180
1851
  await Promise.all(config?.widgets?.map((w) => Promise.resolve(registry.register(w))) || []);
1181
1852
  await Promise.all(config?.extendedWidgets?.map((ew) => Promise.resolve(registry.extend(ew.parentName, ew.widget))) || []);
1182
1853
  },
1183
- deps: [AXPWidgetRegistryService],
1184
- multi: true,
1185
- },
1186
- ],
1187
- };
1188
- }
1189
- /**
1190
- * @ignore
1191
- */
1192
- constructor(instances) {
1193
- instances?.forEach((f) => {
1194
- f();
1195
- });
1196
- }
1197
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPLayoutBuilderModule, deps: [{ token: 'AXPLayoutBuilderModuleFactory', optional: true }], target: i0.ɵɵFactoryTarget.NgModule }); }
1198
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.6", ngImport: i0, type: AXPLayoutBuilderModule, declarations: [AXPWidgetContainerComponent, AXPWidgetColumnRendererComponent, AXPWidgetRendererDirective], imports: [CommonModule, PortalModule, AXSkeletonModule, CommonModule], exports: [AXPWidgetContainerComponent, AXPWidgetColumnRendererComponent, AXPWidgetRendererDirective] }); }
1199
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPLayoutBuilderModule, imports: [CommonModule, PortalModule, AXSkeletonModule, CommonModule] }); }
1200
- }
1201
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPLayoutBuilderModule, decorators: [{
1202
- type: NgModule,
1203
- args: [{
1204
- imports: [CommonModule, PortalModule, AXSkeletonModule, CommonModule],
1205
- exports: [...COMPONENTS],
1206
- declarations: [...COMPONENTS],
1207
- }]
1208
- }], ctorParameters: () => [{ type: undefined, decorators: [{
1209
- type: Optional
1210
- }, {
1211
- type: Inject,
1212
- args: ['AXPLayoutBuilderModuleFactory']
1213
- }] }] });
1214
-
1215
- const AXP_WIDGETS_LAYOUT_CATEGORY = {
1216
- name: 'layout',
1217
- order: 1,
1218
- title: 'Layout',
1219
- };
1220
- const AXP_WIDGETS_EDITOR_CATEGORY = {
1221
- name: 'editor',
1222
- order: 2,
1223
- title: 'Editors',
1224
- };
1225
- const AXP_WIDGETS_ACTION_CATEGORY = {
1226
- name: 'action',
1227
- order: 3,
1228
- title: 'Action',
1229
- };
1230
- const AXP_WIDGETS_ADVANCE_CATEGORY = {
1231
- name: 'advance',
1232
- order: 4,
1233
- title: 'Advance',
1234
- };
1235
- const AXP_WIDGETS_CATEGORIES = [
1236
- AXP_WIDGETS_LAYOUT_CATEGORY,
1237
- AXP_WIDGETS_EDITOR_CATEGORY,
1238
- AXP_WIDGETS_ACTION_CATEGORY,
1239
- AXP_WIDGETS_ADVANCE_CATEGORY,
1240
- ];
1241
-
1242
- var AXPWidgetGroupEnum;
1243
- (function (AXPWidgetGroupEnum) {
1244
- AXPWidgetGroupEnum["FormElement"] = "form-element";
1245
- AXPWidgetGroupEnum["DashboardWidget"] = "dashboard-widget";
1246
- AXPWidgetGroupEnum["FormTemplate"] = "form-template";
1247
- AXPWidgetGroupEnum["PropertyEditor"] = "property-editor";
1248
- AXPWidgetGroupEnum["MetaData"] = "meta-data";
1249
- AXPWidgetGroupEnum["SettingWidget"] = "setting-widget";
1250
- AXPWidgetGroupEnum["EntityWidget"] = "entity-widget";
1251
- })(AXPWidgetGroupEnum || (AXPWidgetGroupEnum = {}));
1252
-
1253
- class AXPBaseWidgetComponent extends AXPLayoutElement {
1254
- constructor() {
1255
- super(...arguments);
1256
- this.token = inject(AXP_WIDGET_TOKEN);
1257
- this.host = inject(ElementRef).nativeElement;
1258
- this.layoutService = inject(AXPLayoutBuilderService);
1259
- this.contextService = inject(AXPLayoutBuilderContextStore);
1260
- this.config = this.token.config;
1261
- this.node = this.token.node;
1262
- this.name = this.token.node.name;
1263
- this._options = signal(this.token.options ?? {}, ...(ngDevMode ? [{ debugName: "_options" }] : []));
1264
- this.options = this._options.asReadonly();
1265
- this.onOptionsChanged = new Subject();
1266
- this._status = signal(AXPWidgetStatus.Rendering, ...(ngDevMode ? [{ debugName: "_status" }] : []));
1267
- this.status = this._status.asReadonly();
1268
- this.onStatusChanged = new BehaviorSubject(this._status());
1269
- this.#statusEffect = effect(() => {
1270
- this.onStatusChanged.next(this.status());
1271
- }, ...(ngDevMode ? [{ debugName: "#statusEffect" }] : []));
1272
- this.isBusy = computed(() => [AXPWidgetStatus.Rendering, AXPWidgetStatus.Processing].includes(this.status()), ...(ngDevMode ? [{ debugName: "isBusy" }] : []));
1273
- this._children = signal(this.token.node.children ?? [], ...(ngDevMode ? [{ debugName: "_children" }] : []));
1274
- this.children = this._children.asReadonly();
1275
- }
1276
- get id() {
1277
- return this._id;
1278
- }
1279
- #statusEffect;
1280
- outputs() {
1281
- return [];
1282
- }
1283
- ngOnInit() {
1284
- if (get(this.node, '__meta__.added')) {
1285
- this.onAdded();
1286
- }
1287
- this.setStatus(AXPWidgetStatus.Rendered);
1288
- }
1289
- setStatus(status) {
1290
- this._status.set(status);
1291
- this.layoutService.updateStatus();
1292
- }
1293
- setOptions(values) {
1294
- this._options.set({ ...this.options(), ...values });
1295
- this.onOptionsChanged.next({ sender: this });
1296
- }
1297
- output(name) {
1298
- const outputs = this.outputs().map((c) => (typeof c == 'string' ? { name: c, value: c } : c));
1299
- if (outputs.some((c) => c.name == name)) {
1300
- const opt = get(this, name);
1301
- if (typeof opt == 'function') {
1302
- return opt();
1303
- }
1304
- return opt;
1305
- }
1306
- return null;
1307
- }
1308
- call(name, ...args) {
1309
- const fn = get(this, name);
1310
- if (fn && typeof fn == 'function') {
1311
- fn.bind(this)(...args);
1312
- }
1313
- }
1314
- setChildren(children) {
1315
- this._children.set([...children]);
1316
- }
1317
- onAdded() { }
1318
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPBaseWidgetComponent, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
1319
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPBaseWidgetComponent }); }
1320
- }
1321
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPBaseWidgetComponent, decorators: [{
1322
- type: Injectable
1323
- }] });
1324
- class AXPLayoutWidgetComponent extends AXPBaseWidgetComponent {
1325
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPLayoutWidgetComponent, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
1326
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPLayoutWidgetComponent }); }
1327
- }
1328
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPLayoutWidgetComponent, decorators: [{
1329
- type: Injectable
1330
- }] });
1331
- class AXPValueWidgetComponent extends AXPLayoutWidgetComponent {
1332
- constructor() {
1333
- super(...arguments);
1334
- this.path = this.token.node.path;
1335
- this.defaultValue = this.token.defaultValue ?? this.token.node.defaultValue;
1336
- this._isValueWidget = false;
1337
- this.isValueWidget = () => this._isValueWidget;
1338
- this.onValueChanged = new Subject();
1339
- this.fullPath = signal(null, ...(ngDevMode ? [{ debugName: "fullPath" }] : []));
1340
- this.parentPath = signal(null, ...(ngDevMode ? [{ debugName: "parentPath" }] : []));
1341
- this.getValue = computed(() => {
1342
- return this.fullPath() ? this.extractValue(this.fullPath()) : null;
1343
- }, ...(ngDevMode ? [{ debugName: "getValue", equal: isEqual }] : [{ equal: isEqual }]));
1344
- this.validationRules = computed(() => {
1345
- const validationsRaw = this.options()['validations'];
1346
- if (validationsRaw == null) {
1347
- return [];
1348
- }
1349
- return Object.values(this.options()['validations'])
1350
- .filter((c) => c != null)
1351
- .map((c) => ({
1352
- rule: c.rule,
1353
- message: c.message,
1354
- options: c.options,
1355
- }));
1356
- }, ...(ngDevMode ? [{ debugName: "validationRules" }] : []));
1854
+ deps: [AXPWidgetRegistryService],
1855
+ multi: true,
1856
+ },
1857
+ ],
1858
+ };
1357
1859
  }
1358
- ngOnInit() {
1359
- this._isValueWidget = this.config.properties?.some((c) => c.name == 'path') ?? false;
1360
- if (this.isValueWidget()) {
1361
- this.detectFullPath();
1362
- if (!isNil(this.defaultValue) && isNil(this.getValue())) {
1363
- this.setValue(this.defaultValue);
1364
- }
1365
- }
1366
- //
1367
- super.ngOnInit();
1860
+ /**
1861
+ * @ignore
1862
+ */
1863
+ constructor(instances) {
1864
+ instances?.forEach((f) => {
1865
+ f();
1866
+ });
1368
1867
  }
1369
- extractValue(path) {
1370
- const rawValue = this.contextService.getValue(path);
1371
- if (this.node.valueTransforms?.getter) {
1372
- return this.node.valueTransforms?.getter(rawValue);
1868
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPLayoutBuilderModule, deps: [{ token: 'AXPLayoutBuilderModuleFactory', optional: true }], target: i0.ɵɵFactoryTarget.NgModule }); }
1869
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.8", ngImport: i0, type: AXPLayoutBuilderModule, declarations: [AXPWidgetContainerComponent, AXPWidgetColumnRendererComponent, AXPWidgetRendererDirective], imports: [CommonModule, PortalModule, AXSkeletonModule, CommonModule, AXTranslationModule], exports: [AXPWidgetContainerComponent, AXPWidgetColumnRendererComponent, AXPWidgetRendererDirective] }); }
1870
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPLayoutBuilderModule, imports: [CommonModule, PortalModule, AXSkeletonModule, CommonModule, AXTranslationModule] }); }
1871
+ }
1872
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPLayoutBuilderModule, decorators: [{
1873
+ type: NgModule,
1874
+ args: [{
1875
+ imports: [CommonModule, PortalModule, AXSkeletonModule, CommonModule, AXTranslationModule],
1876
+ exports: [...COMPONENTS],
1877
+ declarations: [...COMPONENTS],
1878
+ }]
1879
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
1880
+ type: Optional
1881
+ }, {
1882
+ type: Inject,
1883
+ args: ['AXPLayoutBuilderModuleFactory']
1884
+ }] }] });
1885
+
1886
+ class AXPPropertyEditorHelper {
1887
+ static expandShorthand(values) {
1888
+ switch (values.length) {
1889
+ case 1:
1890
+ return [values[0], values[0], values[0], values[0]];
1891
+ case 2:
1892
+ return [values[0], values[1], values[0], values[1]];
1893
+ case 3:
1894
+ return [values[0], values[1], values[2], values[1]];
1895
+ case 4:
1896
+ return values;
1897
+ default:
1898
+ throw new Error(`Invalid shorthand value count. Input: ${values}`);
1373
1899
  }
1374
- return rawValue;
1375
1900
  }
1376
- setValue(value) {
1377
- if (this.node.valueTransforms?.setter) {
1378
- value = this.node.valueTransforms?.setter(value);
1379
- }
1380
- const oldValue = this.getValue();
1381
- value = isUndefined(value) ? null : value;
1382
- if (isNil(value) && isNil(oldValue)) {
1383
- return;
1901
+ static condenseShorthand(values) {
1902
+ if (values.length !== 4) {
1903
+ throw new Error('Expected 4 values for condensation.');
1384
1904
  }
1385
- if (isEqual(oldValue, value)) {
1386
- return;
1905
+ if (values[0] === values[1] && values[1] === values[2] && values[2] === values[3]) {
1906
+ return `${values[0]}`;
1387
1907
  }
1388
- if (this.fullPath()) {
1389
- this.contextService.update(this.fullPath(), value);
1390
- this.onValueChanged.next({ sender: this });
1908
+ else if (values[0] === values[2] && values[1] === values[3]) {
1909
+ return `${values[0]} ${values[1]}`;
1391
1910
  }
1392
- }
1393
- detectFullPath() {
1394
- const sections = [];
1395
- const ids = [];
1396
- //
1397
- let parent = this;
1398
- //
1399
- while (parent) {
1400
- const isValueWidget = parent instanceof AXPValueWidgetComponent && parent.isValueWidget();
1401
- const valueParent = parent;
1402
- const path = valueParent.path ?? (isValueWidget ? valueParent.name : null);
1403
- const id = valueParent.name;
1404
- //
1405
- if (path) {
1406
- sections.push(path);
1407
- }
1408
- if (parent.index != null && isValueWidget) {
1409
- sections.push(`[${parent.index}]`);
1410
- }
1411
- if (id) {
1412
- ids.push(id);
1413
- if (parent.index != null) {
1414
- ids.push(`${parent.index}`);
1415
- }
1416
- }
1417
- parent = parent.parent;
1911
+ else if (values[1] === values[3]) {
1912
+ return `${values[0]} ${values[1]} ${values[2]}`;
1418
1913
  }
1419
- //
1420
- this.fullPath.set(sections.reverse().join('.'));
1421
- this.parentPath.set(sections.slice(0, sections.length - 1).join('.'));
1422
- this._id = this.name || this.parent ? ids.reverse().join('_') : null;
1423
- if (this._id) {
1424
- this.layoutService.registerWidget(this._id, this);
1914
+ else {
1915
+ return `${values[0]} ${values[1]} ${values[2]} ${values[3]}`;
1425
1916
  }
1426
1917
  }
1427
- handleValueChanged(e) {
1428
- if (e.isUserInteraction) {
1429
- this.setValue(e.value);
1430
- }
1918
+ static parseSides(input) {
1919
+ const values = this.expandShorthand(input.match(/(?:rgb\([^)]+\)|[^ ]+)/g)?.map((value) => value.trim()) || []);
1920
+ return { top: values[0], right: values[1], bottom: values[2], left: values[3] };
1431
1921
  }
1432
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPValueWidgetComponent, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
1433
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPValueWidgetComponent }); }
1434
- }
1435
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPValueWidgetComponent, decorators: [{
1436
- type: Injectable
1437
- }] });
1438
- class AXPDataListWidgetComponent extends AXPValueWidgetComponent {
1439
- constructor() {
1440
- super(...arguments);
1441
- this.dataService = inject(AXPDataSourceDefinitionProviderService);
1442
- this.textField = computed(() => this.options()['textField'] ?? 'title', ...(ngDevMode ? [{ debugName: "textField" }] : []));
1443
- this.valueField = computed(() => this.options()['valueField'] ?? 'id', ...(ngDevMode ? [{ debugName: "valueField" }] : []));
1444
- this.dataSource = signal(convertArrayToDataSource([]), ...(ngDevMode ? [{ debugName: "dataSource" }] : []));
1445
- this.isReady = computed(() => {
1446
- const key = this.dataSource().config?.key;
1447
- const valueField = this.valueField();
1448
- const result = key == valueField;
1449
- return result;
1450
- }, ...(ngDevMode ? [{ debugName: "isReady" }] : []));
1451
- this.selectedItems = signal([], ...(ngDevMode ? [{ debugName: "selectedItems" }] : []));
1452
- this.rf = effect(async () => {
1453
- const rawValue = this.options()['dataSource'];
1454
- // static datasource class
1455
- if (rawValue instanceof AXDataSource) {
1456
- this.dataSource.set(rawValue);
1457
- }
1458
- // static array datasource
1459
- else if (Array.isArray(rawValue)) {
1460
- const ds = new AXDataSource({
1461
- key: this.valueField(),
1462
- pageSize: 10,
1463
- load: async (e) => {
1464
- const raw = this.options()['dataSource'];
1465
- return {
1466
- items: raw,
1467
- total: raw.length,
1468
- };
1469
- },
1470
- byKey: (key) => {
1471
- const raw = this.options()['dataSource'];
1472
- const item = raw.filter((c) => c[this.valueField()] == key);
1473
- return Promise.resolve(item[0]);
1474
- },
1475
- });
1476
- this.dataSource.set(ds);
1477
- }
1478
- // resolve data source by name
1479
- else if (rawValue && (typeof rawValue == 'string' || typeof rawValue == 'object')) {
1480
- const id = typeof rawValue == 'object' ? rawValue['id'] : rawValue;
1481
- const c = await this.dataService.get(id);
1482
- if (this.mode == 'designer' && c?.samples?.length) {
1483
- this.dataSource.set(convertArrayToDataSource(c.samples, {
1484
- key: this.valueField(),
1485
- pageSize: 500,
1486
- }));
1487
- }
1488
- else {
1489
- const ds = c?.source();
1490
- if (ds && ds instanceof Promise) {
1491
- const d = await ds;
1492
- this.dataSource.set(d);
1493
- }
1494
- else if (ds) {
1495
- this.dataSource.set(ds);
1496
- }
1497
- // empty datasource
1498
- else {
1499
- this.dataSource.set(convertArrayToDataSource([]));
1500
- }
1501
- }
1502
- }
1503
- // empty datasource
1504
- else {
1505
- this.dataSource.set(convertArrayToDataSource([]));
1506
- }
1507
- }, ...(ngDevMode ? [{ debugName: "rf" }] : []));
1508
- this.effect2 = effect(async () => {
1509
- const value = this.getValue();
1510
- const items = [];
1511
- if (Array.isArray(value)) {
1512
- items.push(...await Promise.all(value.map((item) => this.extractItem(item))));
1513
- }
1514
- else {
1515
- items.push(await this.extractItem(value));
1516
- }
1517
- this.selectedItems.set(items.filter((c) => c != null));
1518
- }, ...(ngDevMode ? [{ debugName: "effect2" }] : []));
1922
+ static parseSidesWithUnits(input) {
1923
+ const values = this.expandShorthand(input.match(/(?:rgb\([^)]+\)|[^ ]+)/g)?.map((value) => value.trim()) || []);
1924
+ return {
1925
+ top: AXPPropertyEditorHelper.getValueWithUnit(values[0]).value,
1926
+ right: AXPPropertyEditorHelper.getValueWithUnit(values[1]).value,
1927
+ bottom: AXPPropertyEditorHelper.getValueWithUnit(values[2]).value,
1928
+ left: AXPPropertyEditorHelper.getValueWithUnit(values[3]).value,
1929
+ };
1519
1930
  }
1520
- async extractItem(item) {
1521
- if (isNil(item)) {
1522
- return null;
1523
- }
1524
- if (isObjectLike(item) && get(item, this.textField()) != null) {
1525
- return item;
1931
+ static parseCorners(input) {
1932
+ const values = this.expandShorthand(input.split(' ').map((value) => value.trim()));
1933
+ return {
1934
+ 'top-left': AXPPropertyEditorHelper.getValueWithUnit(values[0]).value,
1935
+ 'top-right': AXPPropertyEditorHelper.getValueWithUnit(values[1]).value,
1936
+ 'bottom-left': AXPPropertyEditorHelper.getValueWithUnit(values[2]).value,
1937
+ 'bottom-right': AXPPropertyEditorHelper.getValueWithUnit(values[3]).value,
1938
+ };
1939
+ }
1940
+ static parseSpacingBox(input) {
1941
+ return {
1942
+ margin: this.parseSidesWithUnits(input.margin),
1943
+ padding: this.parseSidesWithUnits(input.padding),
1944
+ };
1945
+ }
1946
+ static parseBorderBox(input) {
1947
+ return {
1948
+ width: this.parseSidesWithUnits(input.width),
1949
+ radius: this.parseCorners(input.radius),
1950
+ color: this.parseSides(input.color),
1951
+ style: this.parseSides(input.style),
1952
+ };
1953
+ }
1954
+ static parseSpacingBoxReverse(input, units) {
1955
+ const format = (value, unit) => `${value}${unit}`;
1956
+ return {
1957
+ margin: AXPPropertyEditorHelper.condenseShorthand([
1958
+ format(input.margin.top, units.margin.top),
1959
+ format(input.margin.right, units.margin.right),
1960
+ format(input.margin.bottom, units.margin.bottom),
1961
+ format(input.margin.left, units.margin.left),
1962
+ ]),
1963
+ padding: AXPPropertyEditorHelper.condenseShorthand([
1964
+ format(input.padding.top, units.padding.top),
1965
+ format(input.padding.right, units.padding.right),
1966
+ format(input.padding.bottom, units.padding.bottom),
1967
+ format(input.padding.left, units.padding.left),
1968
+ ]),
1969
+ };
1970
+ }
1971
+ static parseBorderBoxReverse(input, units) {
1972
+ const format = (value, unit) => `${value}${unit}`;
1973
+ return {
1974
+ width: AXPPropertyEditorHelper.condenseShorthand([
1975
+ format(input.width.top, units.width.top),
1976
+ format(input.width.right, units.width.right),
1977
+ format(input.width.bottom, units.width.bottom),
1978
+ format(input.width.left, units.width.left),
1979
+ ]),
1980
+ radius: AXPPropertyEditorHelper.condenseShorthand([
1981
+ format(input.radius['top-left'], units.radius['top-left']),
1982
+ format(input.radius['top-right'], units.radius['top-right']),
1983
+ format(input.radius['bottom-right'], units.radius['bottom-right']),
1984
+ format(input.radius['bottom-left'], units.radius['bottom-left']),
1985
+ ]),
1986
+ color: AXPPropertyEditorHelper.condenseShorthand([
1987
+ `${input.color.top}${units.color.top}`,
1988
+ `${input.color.right}${units.color.right}`,
1989
+ `${input.color.bottom}${units.color.bottom}`,
1990
+ `${input.color.left}${units.color.left}`,
1991
+ ]),
1992
+ style: AXPPropertyEditorHelper.condenseShorthand([
1993
+ `${input.style.top}${units.style.top}`,
1994
+ `${input.style.right}${units.style.right}`,
1995
+ `${input.style.bottom}${units.style.bottom}`,
1996
+ `${input.style.left}${units.style.left}`,
1997
+ ]),
1998
+ };
1999
+ }
2000
+ static getValueWithUnit(input) {
2001
+ if (typeof input === 'number')
2002
+ return { value: input, unit: 'px' };
2003
+ if (input === 'auto')
2004
+ return { value: 0, unit: 'px' };
2005
+ const match = input.match(/^([0-9.]+)([a-z%]*)$/i);
2006
+ if (!match)
2007
+ throw new Error(`Invalid unit format: ${input}`);
2008
+ return { value: parseFloat(match[1]), unit: match[2] || '' };
2009
+ }
2010
+ static getValueFromUnit(value, unit) {
2011
+ return unit ? `${value}${unit}` : `${value}`;
2012
+ }
2013
+ static parseGap(gap) {
2014
+ const parts = gap.split(/\s+/);
2015
+ const match = parts[0].match(/^(\d+\.?\d*)([a-z%]+)$/);
2016
+ if (!match) {
2017
+ throw new Error('Invalid gap format');
1526
2018
  }
1527
- const key = extractValue(item, this.valueField());
1528
- const ds = this.dataSource();
1529
- if (ds.config?.byKey) {
1530
- const found = await ds.config?.byKey(key);
1531
- if (found) {
1532
- return found;
2019
+ const [, xValue, unit] = match;
2020
+ let yValue = parseFloat(xValue);
2021
+ if (parts.length === 2) {
2022
+ const secondMatch = parts[1].match(/^(\d+\.?\d*)[a-z%]+$/);
2023
+ if (!secondMatch) {
2024
+ throw new Error('Invalid gap format');
1533
2025
  }
2026
+ yValue = parseFloat(secondMatch[1]);
1534
2027
  }
1535
- return isObjectLike(item) ? item : {
1536
- [this.valueField()]: item,
1537
- [this.textField()]: item,
2028
+ return {
2029
+ values: {
2030
+ x: parseFloat(xValue),
2031
+ y: yValue,
2032
+ },
2033
+ unit,
1538
2034
  };
1539
2035
  }
1540
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPDataListWidgetComponent, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
1541
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPDataListWidgetComponent }); }
2036
+ static parseGridTemplate(gridTemplate) {
2037
+ const match = gridTemplate.match(/^repeat\((\d+),\s*(?:1fr|auto|minmax\([^)]*\))\)$/);
2038
+ if (!match) {
2039
+ throw new Error("Invalid grid template format. Expected 'repeat(N, 1fr|auto|minmax(...))'.");
2040
+ }
2041
+ return parseInt(match[1], 10);
2042
+ }
2043
+ static createGridTemplate(repetitionCount) {
2044
+ if (repetitionCount <= 0) {
2045
+ throw new Error('Repetition count must be a positive integer.');
2046
+ }
2047
+ return `repeat(${repetitionCount}, 1fr)`;
2048
+ }
1542
2049
  }
1543
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPDataListWidgetComponent, decorators: [{
1544
- type: Injectable
1545
- }] });
1546
- class AXPColumnWidgetComponent {
1547
- constructor() {
1548
- this.token = inject(AXP_WIDGET_COLUMN_TOKEN);
1549
- this.path = this.token.path;
1550
- this.options = this.token.options ?? {};
1551
- this.rawValue = null;
2050
+ function findNonEmptyBreakpoints(values) {
2051
+ const breakpoints = ['default', 'sm', 'md', 'lg', 'xl', '2xl', '3xl'];
2052
+ const nonEmptyBreakpoints = [];
2053
+ for (const breakpoint of breakpoints) {
2054
+ if (values[breakpoint] !== undefined) {
2055
+ nonEmptyBreakpoints.push(breakpoint);
2056
+ }
1552
2057
  }
1553
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPColumnWidgetComponent, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1554
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPColumnWidgetComponent }); }
2058
+ return nonEmptyBreakpoints;
1555
2059
  }
1556
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPColumnWidgetComponent, decorators: [{
1557
- type: Injectable
1558
- }] });
2060
+
2061
+ const AXP_WIDGETS_LAYOUT_CATEGORY = {
2062
+ name: 'layout',
2063
+ order: 1,
2064
+ title: 'Layout',
2065
+ };
2066
+ const AXP_WIDGETS_EDITOR_CATEGORY = {
2067
+ name: 'editor',
2068
+ order: 2,
2069
+ title: 'Editors',
2070
+ };
2071
+ const AXP_WIDGETS_ACTION_CATEGORY = {
2072
+ name: 'action',
2073
+ order: 3,
2074
+ title: 'Action',
2075
+ };
2076
+ const AXP_WIDGETS_ADVANCE_CATEGORY = {
2077
+ name: 'advance',
2078
+ order: 4,
2079
+ title: 'Advance',
2080
+ };
2081
+ const AXP_WIDGETS_CATEGORIES = [
2082
+ AXP_WIDGETS_LAYOUT_CATEGORY,
2083
+ AXP_WIDGETS_EDITOR_CATEGORY,
2084
+ AXP_WIDGETS_ACTION_CATEGORY,
2085
+ AXP_WIDGETS_ADVANCE_CATEGORY,
2086
+ ];
2087
+
2088
+ var AXPWidgetGroupEnum;
2089
+ (function (AXPWidgetGroupEnum) {
2090
+ AXPWidgetGroupEnum["FormElement"] = "form-element";
2091
+ AXPWidgetGroupEnum["DashboardWidget"] = "dashboard-widget";
2092
+ AXPWidgetGroupEnum["FormTemplate"] = "form-template";
2093
+ AXPWidgetGroupEnum["PropertyEditor"] = "property-editor";
2094
+ AXPWidgetGroupEnum["MetaData"] = "meta-data";
2095
+ AXPWidgetGroupEnum["SettingWidget"] = "setting-widget";
2096
+ AXPWidgetGroupEnum["EntityWidget"] = "entity-widget";
2097
+ })(AXPWidgetGroupEnum || (AXPWidgetGroupEnum = {}));
1559
2098
 
1560
2099
  /**
1561
2100
  * Generated bundle index. Do not edit.
1562
2101
  */
1563
2102
 
1564
- export { AXPBaseWidgetComponent, AXPColumnWidgetComponent, AXPDataListWidgetComponent, AXPLayoutBuilderContextStore, AXPLayoutBuilderModule, AXPLayoutBuilderService, AXPLayoutContextChangeEvent, AXPLayoutElement, AXPLayoutWidgetComponent, AXPPageStatus, AXPValueWidgetComponent, AXPWidgetColumnRendererComponent, AXPWidgetContainerComponent, AXPWidgetGroupEnum, AXPWidgetRegistryService, AXPWidgetRendererDirective, AXPWidgetStatus, AXPWidgetsCatalog, AXP_WIDGETS_ACTION_CATEGORY, AXP_WIDGETS_ADVANCE_CATEGORY, AXP_WIDGETS_CATEGORIES, AXP_WIDGETS_EDITOR_CATEGORY, AXP_WIDGETS_LAYOUT_CATEGORY, AXP_WIDGET_COLUMN_TOKEN, AXP_WIDGET_TOKEN, cloneProperty, createBooleanProperty, createNumberProperty, createSelectProperty, createStringProperty };
2103
+ export { AXPBaseWidgetComponent, AXPBlockBaseLayoutWidgetComponent, AXPBoxModelLayoutWidgetComponent, AXPColumnWidgetComponent, AXPDataListWidgetComponent, AXPFlexBaseLayoutWidgetComponent, AXPFlexItemBaseLayoutWidgetComponent, AXPGridBaseLayoutWidgetComponent, AXPGridItemBaseLayoutWidgetComponent, AXPInlineBaseLayoutWidgetComponent, AXPLayoutBaseWidgetComponent, AXPLayoutBuilderContextStore, AXPLayoutBuilderModule, AXPLayoutBuilderService, AXPLayoutContextChangeEvent, AXPLayoutElement, AXPPageStatus, AXPPropertyEditorHelper, AXPValueWidgetComponent, AXPWidgetColumnRendererComponent, AXPWidgetContainerComponent, AXPWidgetGroupEnum, AXPWidgetRegistryService, AXPWidgetRendererDirective, AXPWidgetStatus, AXPWidgetsCatalog, AXP_WIDGETS_ACTION_CATEGORY, AXP_WIDGETS_ADVANCE_CATEGORY, AXP_WIDGETS_CATEGORIES, AXP_WIDGETS_EDITOR_CATEGORY, AXP_WIDGETS_LAYOUT_CATEGORY, AXP_WIDGET_COLUMN_TOKEN, AXP_WIDGET_TOKEN, cloneProperty, createBooleanProperty, createNumberProperty, createSelectProperty, createStringProperty, findNonEmptyBreakpoints };
1565
2104
  //# sourceMappingURL=acorex-platform-layout-builder.mjs.map