@acorex/platform 20.3.0-next.12 → 20.3.0-next.14

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 (118) hide show
  1. package/common/index.d.ts +399 -368
  2. package/core/index.d.ts +3 -2
  3. package/fesm2022/acorex-platform-auth.mjs +19 -19
  4. package/fesm2022/acorex-platform-auth.mjs.map +1 -1
  5. package/fesm2022/acorex-platform-common.mjs +114 -162
  6. package/fesm2022/acorex-platform-common.mjs.map +1 -1
  7. package/fesm2022/acorex-platform-core.mjs +45 -44
  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 +1231 -2418
  12. package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
  13. package/fesm2022/acorex-platform-layout-components.mjs +1317 -254
  14. package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
  15. package/fesm2022/acorex-platform-layout-designer.mjs +81 -81
  16. package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
  17. package/fesm2022/{acorex-platform-layout-entity-create-entity.command-764ie8R8.mjs → acorex-platform-layout-entity-create-entity.command-CuueLekJ.mjs} +4 -4
  18. package/fesm2022/{acorex-platform-layout-entity-create-entity.command-764ie8R8.mjs.map → acorex-platform-layout-entity-create-entity.command-CuueLekJ.mjs.map} +1 -1
  19. package/fesm2022/acorex-platform-layout-entity.mjs +491 -185
  20. package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
  21. package/fesm2022/acorex-platform-layout-views.mjs +25 -23
  22. package/fesm2022/acorex-platform-layout-views.mjs.map +1 -1
  23. package/fesm2022/acorex-platform-layout-widget-core.mjs +2667 -0
  24. package/fesm2022/acorex-platform-layout-widget-core.mjs.map +1 -0
  25. package/fesm2022/{acorex-platform-widgets-button-widget-designer.component-DSaD9Fwc.mjs → acorex-platform-layout-widgets-button-widget-designer.component-C82aG5Rf.mjs} +5 -5
  26. package/fesm2022/acorex-platform-layout-widgets-button-widget-designer.component-C82aG5Rf.mjs.map +1 -0
  27. package/fesm2022/{acorex-platform-widgets-extra-properties-schema-widget-edit.component-D9mf08rU.mjs → acorex-platform-layout-widgets-extra-properties-schema-widget-edit.component-CMmz70I8.mjs} +5 -5
  28. package/fesm2022/acorex-platform-layout-widgets-extra-properties-schema-widget-edit.component-CMmz70I8.mjs.map +1 -0
  29. package/fesm2022/{acorex-platform-widgets-extra-properties-schema-widget-view.component-D6GQ-eyr.mjs → acorex-platform-layout-widgets-extra-properties-schema-widget-view.component-DDOyf7NG.mjs} +5 -5
  30. package/fesm2022/acorex-platform-layout-widgets-extra-properties-schema-widget-view.component-DDOyf7NG.mjs.map +1 -0
  31. package/fesm2022/{acorex-platform-widgets-extra-properties-values-widget-edit.component-DVbIdVZ6.mjs → acorex-platform-layout-widgets-extra-properties-values-widget-edit.component-flsveRJc.mjs} +5 -5
  32. package/fesm2022/acorex-platform-layout-widgets-extra-properties-values-widget-edit.component-flsveRJc.mjs.map +1 -0
  33. package/fesm2022/{acorex-platform-widgets-extra-properties-values-widget-view.component-D-aM64Hu.mjs → acorex-platform-layout-widgets-extra-properties-values-widget-view.component-CFXLM9Ls.mjs} +5 -5
  34. package/fesm2022/acorex-platform-layout-widgets-extra-properties-values-widget-view.component-CFXLM9Ls.mjs.map +1 -0
  35. package/fesm2022/{acorex-platform-widgets-extra-properties-widget-edit.component-em2-aU8E.mjs → acorex-platform-layout-widgets-extra-properties-widget-edit.component-1Wd5IUpo.mjs} +5 -5
  36. package/fesm2022/acorex-platform-layout-widgets-extra-properties-widget-edit.component-1Wd5IUpo.mjs.map +1 -0
  37. package/fesm2022/{acorex-platform-widgets-extra-properties-widget-view.component-BeuIofdr.mjs → acorex-platform-layout-widgets-extra-properties-widget-view.component-WLyXXg19.mjs} +5 -5
  38. package/fesm2022/acorex-platform-layout-widgets-extra-properties-widget-view.component-WLyXXg19.mjs.map +1 -0
  39. package/fesm2022/{acorex-platform-widgets-file-list-popup.component-Cmtq2bBV.mjs → acorex-platform-layout-widgets-file-list-popup.component-DxTXIO_k.mjs} +8 -8
  40. package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-DxTXIO_k.mjs.map +1 -0
  41. package/fesm2022/{acorex-platform-widgets-page-widget-designer.component-B-ZEi2yd.mjs → acorex-platform-layout-widgets-page-widget-designer.component-44YSAqDc.mjs} +7 -7
  42. package/fesm2022/acorex-platform-layout-widgets-page-widget-designer.component-44YSAqDc.mjs.map +1 -0
  43. package/fesm2022/{acorex-platform-widgets-tabular-data-edit-popup.component-CMqq_iOj.mjs → acorex-platform-layout-widgets-tabular-data-edit-popup.component-Dat0cqWe.mjs} +8 -8
  44. package/fesm2022/acorex-platform-layout-widgets-tabular-data-edit-popup.component-Dat0cqWe.mjs.map +1 -0
  45. package/fesm2022/{acorex-platform-widgets-tabular-data-view-popup.component-CRpjdiNz.mjs → acorex-platform-layout-widgets-tabular-data-view-popup.component-CtJBzqq_.mjs} +4 -4
  46. package/fesm2022/acorex-platform-layout-widgets-tabular-data-view-popup.component-CtJBzqq_.mjs.map +1 -0
  47. package/fesm2022/{acorex-platform-widgets-text-block-widget-designer.component-DeSmBqMa.mjs → acorex-platform-layout-widgets-text-block-widget-designer.component-Djpj1fNO.mjs} +5 -5
  48. package/fesm2022/acorex-platform-layout-widgets-text-block-widget-designer.component-Djpj1fNO.mjs.map +1 -0
  49. package/fesm2022/{acorex-platform-widgets.mjs → acorex-platform-layout-widgets.mjs} +1020 -629
  50. package/fesm2022/acorex-platform-layout-widgets.mjs.map +1 -0
  51. package/fesm2022/acorex-platform-native.mjs +7 -7
  52. package/fesm2022/acorex-platform-native.mjs.map +1 -1
  53. package/fesm2022/acorex-platform-runtime.mjs +40 -40
  54. package/fesm2022/acorex-platform-runtime.mjs.map +1 -1
  55. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-oOA674Jd.mjs +115 -0
  56. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-oOA674Jd.mjs.map +1 -0
  57. package/fesm2022/{acorex-platform-themes-default-entity-master-list-view.component-7BB4LdjK.mjs → acorex-platform-themes-default-entity-master-list-view.component-Bk4p9oHD.mjs} +15 -15
  58. package/fesm2022/{acorex-platform-themes-default-entity-master-list-view.component-7BB4LdjK.mjs.map → acorex-platform-themes-default-entity-master-list-view.component-Bk4p9oHD.mjs.map} +1 -1
  59. package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-CrDQOCpB.mjs +101 -0
  60. package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-CrDQOCpB.mjs.map +1 -0
  61. package/fesm2022/{acorex-platform-themes-default-entity-master-single-view.component-BExtm1JE.mjs → acorex-platform-themes-default-entity-master-single-view.component-CT-1gX4H.mjs} +17 -17
  62. package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-CT-1gX4H.mjs.map +1 -0
  63. package/fesm2022/{acorex-platform-themes-default-error-401.component-DrO1PEOH.mjs → acorex-platform-themes-default-error-401.component-CHJFmJ2W.mjs} +4 -4
  64. package/fesm2022/{acorex-platform-themes-default-error-401.component-DrO1PEOH.mjs.map → acorex-platform-themes-default-error-401.component-CHJFmJ2W.mjs.map} +1 -1
  65. package/fesm2022/{acorex-platform-themes-default-error-404.component-DqVq0oHX.mjs → acorex-platform-themes-default-error-404.component-Db8KkVIF.mjs} +4 -4
  66. package/fesm2022/{acorex-platform-themes-default-error-404.component-DqVq0oHX.mjs.map → acorex-platform-themes-default-error-404.component-Db8KkVIF.mjs.map} +1 -1
  67. package/fesm2022/{acorex-platform-themes-default-error-offline.component-Bt2PTL7_.mjs → acorex-platform-themes-default-error-offline.component-DH39Viy-.mjs} +4 -4
  68. package/fesm2022/{acorex-platform-themes-default-error-offline.component-Bt2PTL7_.mjs.map → acorex-platform-themes-default-error-offline.component-DH39Viy-.mjs.map} +1 -1
  69. package/fesm2022/acorex-platform-themes-default.mjs +44 -44
  70. package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
  71. package/fesm2022/{acorex-platform-themes-shared-icon-chooser-view.component-BgEh06Tn.mjs → acorex-platform-themes-shared-icon-chooser-view.component-mFBYGE0_.mjs} +5 -5
  72. package/fesm2022/acorex-platform-themes-shared-icon-chooser-view.component-mFBYGE0_.mjs.map +1 -0
  73. package/fesm2022/{acorex-platform-themes-shared-settings.provider-CLUKU4y0.mjs → acorex-platform-themes-shared-settings.provider-DY2xFnrv.mjs} +8 -8
  74. package/fesm2022/acorex-platform-themes-shared-settings.provider-DY2xFnrv.mjs.map +1 -0
  75. package/fesm2022/{acorex-platform-themes-shared-theme-color-chooser-column.component-AeOQxjbS.mjs → acorex-platform-themes-shared-theme-color-chooser-column.component-viyyova6.mjs} +5 -5
  76. package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-viyyova6.mjs.map +1 -0
  77. package/fesm2022/{acorex-platform-themes-shared-theme-color-chooser-view.component-DEVzRd6-.mjs → acorex-platform-themes-shared-theme-color-chooser-view.component-BrUtKTXd.mjs} +5 -5
  78. package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-BrUtKTXd.mjs.map +1 -0
  79. package/fesm2022/acorex-platform-themes-shared.mjs +66 -55
  80. package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
  81. package/fesm2022/acorex-platform-workflow.mjs +27 -39
  82. package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
  83. package/layout/builder/README.md +2 -3
  84. package/layout/builder/index.d.ts +456 -879
  85. package/layout/components/index.d.ts +261 -81
  86. package/layout/designer/index.d.ts +4 -4
  87. package/layout/entity/index.d.ts +551 -13
  88. package/layout/views/index.d.ts +13 -13
  89. package/layout/widget-core/README.md +4 -0
  90. package/layout/widget-core/index.d.ts +950 -0
  91. package/layout/widgets/README.md +4 -0
  92. package/{widgets → layout/widgets}/index.d.ts +98 -61
  93. package/package.json +13 -9
  94. package/themes/shared/index.d.ts +2 -2
  95. package/workflow/index.d.ts +3 -173
  96. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-Ct-ri59W.mjs +0 -115
  97. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-Ct-ri59W.mjs.map +0 -1
  98. package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-BDJR088o.mjs +0 -101
  99. package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-BDJR088o.mjs.map +0 -1
  100. package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-BExtm1JE.mjs.map +0 -1
  101. package/fesm2022/acorex-platform-themes-shared-icon-chooser-view.component-BgEh06Tn.mjs.map +0 -1
  102. package/fesm2022/acorex-platform-themes-shared-settings.provider-CLUKU4y0.mjs.map +0 -1
  103. package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-AeOQxjbS.mjs.map +0 -1
  104. package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-DEVzRd6-.mjs.map +0 -1
  105. package/fesm2022/acorex-platform-widgets-button-widget-designer.component-DSaD9Fwc.mjs.map +0 -1
  106. package/fesm2022/acorex-platform-widgets-extra-properties-schema-widget-edit.component-D9mf08rU.mjs.map +0 -1
  107. package/fesm2022/acorex-platform-widgets-extra-properties-schema-widget-view.component-D6GQ-eyr.mjs.map +0 -1
  108. package/fesm2022/acorex-platform-widgets-extra-properties-values-widget-edit.component-DVbIdVZ6.mjs.map +0 -1
  109. package/fesm2022/acorex-platform-widgets-extra-properties-values-widget-view.component-D-aM64Hu.mjs.map +0 -1
  110. package/fesm2022/acorex-platform-widgets-extra-properties-widget-edit.component-em2-aU8E.mjs.map +0 -1
  111. package/fesm2022/acorex-platform-widgets-extra-properties-widget-view.component-BeuIofdr.mjs.map +0 -1
  112. package/fesm2022/acorex-platform-widgets-file-list-popup.component-Cmtq2bBV.mjs.map +0 -1
  113. package/fesm2022/acorex-platform-widgets-page-widget-designer.component-B-ZEi2yd.mjs.map +0 -1
  114. package/fesm2022/acorex-platform-widgets-tabular-data-edit-popup.component-CMqq_iOj.mjs.map +0 -1
  115. package/fesm2022/acorex-platform-widgets-tabular-data-view-popup.component-CRpjdiNz.mjs.map +0 -1
  116. package/fesm2022/acorex-platform-widgets-text-block-widget-designer.component-DeSmBqMa.mjs.map +0 -1
  117. package/fesm2022/acorex-platform-widgets.mjs.map +0 -1
  118. package/widgets/README.md +0 -4
@@ -0,0 +1,2667 @@
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, createComponent } 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';
8
+ import * as i1$1 from '@acorex/components/skeleton';
9
+ import { AXSkeletonModule } from '@acorex/components/skeleton';
10
+ import * as i2 from '@acorex/core/translation';
11
+ import { AXTranslationService, AXTranslationModule } from '@acorex/core/translation';
12
+ import { PortalModule } from '@angular/cdk/portal';
13
+ import * as i1 from '@angular/common';
14
+ import { CommonModule } from '@angular/common';
15
+ import { AXDataTableColumnComponent, AXBaseDataTable } from '@acorex/components/data-table';
16
+ import { AXUnsubscriber } from '@acorex/core/utils';
17
+
18
+ var AXPPageStatus;
19
+ (function (AXPPageStatus) {
20
+ // Idle statuses
21
+ AXPPageStatus["Idle"] = "idle";
22
+ // Rendering statuses
23
+ AXPPageStatus["Rendering"] = "rendering";
24
+ AXPPageStatus["Rendered"] = "rendered";
25
+ // Processing statuses
26
+ AXPPageStatus["Processing"] = "processing";
27
+ // Submission statuses
28
+ AXPPageStatus["Submitting"] = "submitting";
29
+ AXPPageStatus["Submitted"] = "submitted";
30
+ // Validation statuses
31
+ AXPPageStatus["Validating"] = "validating";
32
+ AXPPageStatus["Validated"] = "validated";
33
+ // Error handling
34
+ AXPPageStatus["Error"] = "error";
35
+ })(AXPPageStatus || (AXPPageStatus = {}));
36
+ var AXPWidgetStatus;
37
+ (function (AXPWidgetStatus) {
38
+ // Rendering statuses
39
+ AXPWidgetStatus["Rendering"] = "rendering";
40
+ AXPWidgetStatus["Rendered"] = "rendered";
41
+ // Processing statuses
42
+ AXPWidgetStatus["Processing"] = "processing";
43
+ // Error handling
44
+ AXPWidgetStatus["Error"] = "error";
45
+ })(AXPWidgetStatus || (AXPWidgetStatus = {}));
46
+
47
+ class AXPWidgetCoreElement {
48
+ api() {
49
+ return {};
50
+ }
51
+ }
52
+ class AXPWidgetCoreService {
53
+ constructor() {
54
+ this.variables$ = signal({}, ...(ngDevMode ? [{ debugName: "variables$" }] : []));
55
+ this.functions$ = signal({}, ...(ngDevMode ? [{ debugName: "functions$" }] : []));
56
+ this.onRefresh = new Subject();
57
+ this.widgets = new Map();
58
+ this.onWidgetRegistered = new Subject();
59
+ this.status$ = signal(AXPPageStatus.Rendering, ...(ngDevMode ? [{ debugName: "status$" }] : []));
60
+ this.status = this.status$.asReadonly();
61
+ this.isBusy = computed(() => {
62
+ return [AXPPageStatus.Processing, AXPPageStatus.Submitting, AXPPageStatus.Rendering].includes(this.status());
63
+ }, ...(ngDevMode ? [{ debugName: "isBusy" }] : []));
64
+ }
65
+ get variables() {
66
+ return this.variables$();
67
+ }
68
+ get functions() {
69
+ return this.functions$();
70
+ }
71
+ updateStatus() {
72
+ this.status$.update(() => this.detectStatus());
73
+ }
74
+ detectStatus() {
75
+ const statuses = Array.from(this.widgets.values()).map((c) => c.status());
76
+ // Rendering statuses
77
+ if (statuses.some((status) => status === AXPWidgetStatus.Rendering)) {
78
+ return AXPPageStatus.Rendering;
79
+ }
80
+ if (statuses.every((status) => status === AXPWidgetStatus.Rendered)) {
81
+ return AXPPageStatus.Rendered;
82
+ }
83
+ // Processing statuses
84
+ if (statuses.some((status) => status === AXPWidgetStatus.Processing)) {
85
+ return AXPPageStatus.Processing;
86
+ }
87
+ // Error handling
88
+ if (statuses.some((status) => status === AXPWidgetStatus.Error)) {
89
+ return AXPPageStatus.Error;
90
+ }
91
+ return AXPPageStatus.Rendered; // Default to Loaded when all widgets are in a completed state
92
+ }
93
+ refresh() {
94
+ setTimeout(() => {
95
+ this.onRefresh.next();
96
+ }, 0);
97
+ }
98
+ setStatus(status) {
99
+ this.status$.set(status);
100
+ }
101
+ setVariables(...args) {
102
+ if (args.length == 0)
103
+ return;
104
+ else if (args.length == 1)
105
+ this.variables$.set(args[0]);
106
+ else if (args.length == 2) {
107
+ this.variables$.update((v) => set(v, args[0], args[1]));
108
+ }
109
+ }
110
+ setFunctions(...args) {
111
+ if (args.length == 0)
112
+ return;
113
+ else if (args.length == 1)
114
+ this.functions$.set(args[0]);
115
+ else if (args.length == 2) {
116
+ this.functions$.update((v) => set(v, args[0], args[1]));
117
+ }
118
+ }
119
+ registerWidget(id, widget) {
120
+ this.widgets.set(id, widget);
121
+ this.onWidgetRegistered.next({ id, widget });
122
+ }
123
+ getWidget(id) {
124
+ return this.widgets.get(id);
125
+ }
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
+ });
159
+ }
160
+ ngOnDestroy() { }
161
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXPWidgetCoreService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
162
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXPWidgetCoreService }); }
163
+ }
164
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXPWidgetCoreService, decorators: [{
165
+ type: Injectable
166
+ }] });
167
+
168
+ class AXPWidgetCoreContextChangeEvent {
169
+ }
170
+ const AXPWidgetCoreContextStore = 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
+ })));
279
+
280
+ const AXPWidgetsCatalog = {
281
+ timeDuration: 'time-duration',
282
+ tagable: 'tagable-editor',
283
+ checkbox: 'checkbox-editor',
284
+ color: 'color-editor',
285
+ contact: 'contact-editor',
286
+ dateTime: 'date-time-editor',
287
+ largeText: 'large-text-editor',
288
+ number: 'number-editor',
289
+ numberUnit: 'number-unit-editor',
290
+ password: 'password-editor',
291
+ richText: 'rich-text-editor',
292
+ select: 'select-editor',
293
+ selectionList: 'selection-list-editor',
294
+ text: 'text-editor',
295
+ table: 'table-editor',
296
+ toggle: 'toggle-editor',
297
+ blockLayout: 'block-layout',
298
+ pageLayout: 'page-layout',
299
+ repeaterLayout: 'repeater-layout',
300
+ textBlockLayout: 'text-block-layout',
301
+ fileUploader: 'file-uploader',
302
+ fileTypeExtension: 'file-type-extension',
303
+ map: 'map',
304
+ imageMarker: 'image-marker',
305
+ image: 'image',
306
+ gallery: 'gallery',
307
+ signature: 'signature',
308
+ buttonAction: 'button-action',
309
+ document: 'document-layout',
310
+ lookup: 'lookup-editor',
311
+ formField: 'form-field',
312
+ qrcode: 'qrcode',
313
+ advancedGrid: 'advanced-grid-layout',
314
+ advancedGridItem: 'advanced-grid-item-layout',
315
+ grid: 'grid-layout',
316
+ gridItem: 'grid-item-layout',
317
+ // gridRow: 'grid-row-layout',
318
+ widgetSelector: 'widget-selector',
319
+ template: 'template',
320
+ templateDesigner: 'template-designer',
321
+ cronJob: 'cron-job',
322
+ spacing: 'spacing',
323
+ direction: 'direction',
324
+ border: 'border',
325
+ flexLayout: 'flex-layout',
326
+ flexItem: 'flex-item-layout',
327
+ tableLayout: 'table-layout',
328
+ tableItem: 'table-item-layout',
329
+ avatar: 'avatar',
330
+ themePaletteChooser: 'theme-palette-chooser',
331
+ themeModeChooser: 'theme-mode-chooser',
332
+ menuOrientationChooser: 'menu-orientation-chooser',
333
+ fontStyleChooser: 'font-style-chooser',
334
+ fontSizeChooser: 'font-size-chooser',
335
+ iconChooser: 'icon-chooser',
336
+ themeColorChooser: 'theme-color-chooser',
337
+ gridOptions: 'grid-options',
338
+ gridItemOptions: 'grid-item-options',
339
+ advancedGridOptions: 'advanced-grid-options',
340
+ stringFilter: 'string-filter',
341
+ numberFilter: 'number-filter',
342
+ dateTimeFilter: 'datetime-filter',
343
+ booleanFilter: 'boolean-filter',
344
+ lookupFilter: 'lookup-filter',
345
+ flexOptions: 'flex-options',
346
+ flexItemOptions: 'flex-item-options',
347
+ selectFilter: 'select-filter',
348
+ requiredValidation: 'required-validation',
349
+ regularExpressionValidation: 'regular-expression-validation',
350
+ minLengthValidation: 'min-length-validation',
351
+ maxLengthValidation: 'max-length-validation',
352
+ lessThanValidation: 'less-than-validation',
353
+ greaterThanValidation: 'greater-than-validation',
354
+ betweenValidation: 'between-validation',
355
+ equalValidation: 'equal-validation',
356
+ callbackValidation: 'callback-validation',
357
+ donutChart: 'donut-chart',
358
+ lineChart: 'line-chart',
359
+ barChart: 'bar-chart',
360
+ gaugeChart: 'gauge-chart',
361
+ stickyNote: 'sticky-note',
362
+ clockCalendar: 'clock-calendar',
363
+ analogClock: 'analog-clock',
364
+ weather: 'weather',
365
+ minimalWeather: 'minimal-weather',
366
+ advancedWeather: 'advanced-weather',
367
+ metaData: 'meta-data-editor',
368
+ templateEditor: 'template-box-editor',
369
+ panel: 'panel',
370
+ notification: 'notification',
371
+ taskBoard: 'task-board',
372
+ comment: 'comment',
373
+ list: 'list',
374
+ listToolbar: 'list-toolbar',
375
+ entityList: 'entity-list',
376
+ documentUploader: 'document-uploader',
377
+ };
378
+
379
+ function cloneProperty(property, values) {
380
+ return merge(cloneDeep(property), values);
381
+ }
382
+ function createStringProperty(ctor) {
383
+ return {
384
+ name: ctor.name,
385
+ title: ctor.title,
386
+ group: ctor.group,
387
+ schema: {
388
+ dataType: 'string',
389
+ defaultValue: ctor.defaultValue,
390
+ interface: {
391
+ name: ctor.name,
392
+ path: ctor.path ?? ctor.name,
393
+ type: AXPWidgetsCatalog.text,
394
+ },
395
+ },
396
+ visible: !isNil(ctor.visible) ? ctor.visible : true,
397
+ };
398
+ }
399
+ function createNumberProperty(ctor) {
400
+ return {
401
+ name: ctor.name,
402
+ title: ctor.title,
403
+ group: ctor.group,
404
+ schema: {
405
+ dataType: 'number',
406
+ defaultValue: ctor.defaultValue,
407
+ interface: {
408
+ name: ctor.name,
409
+ path: ctor.path ?? ctor.name,
410
+ type: AXPWidgetsCatalog.number,
411
+ options: ctor.options,
412
+ },
413
+ },
414
+ visible: !isNil(ctor.visible) ? ctor.visible : true,
415
+ };
416
+ }
417
+ function createBooleanProperty(ctor) {
418
+ return {
419
+ name: ctor.name,
420
+ title: ctor.title,
421
+ group: ctor.group,
422
+ schema: {
423
+ dataType: 'boolean',
424
+ defaultValue: ctor.defaultValue ?? false,
425
+ interface: {
426
+ name: ctor.name,
427
+ path: ctor.path ?? ctor.name,
428
+ type: AXPWidgetsCatalog.toggle,
429
+ },
430
+ },
431
+ visible: ctor.visible ?? true,
432
+ };
433
+ }
434
+ function createSelectProperty(ctor) {
435
+ return {
436
+ name: ctor.name,
437
+ title: ctor.title,
438
+ group: ctor.group,
439
+ schema: {
440
+ dataType: 'string',
441
+ defaultValue: Array.isArray(ctor.defaultValue)
442
+ ? ctor.defaultValue.map((item) => (typeof item === 'string' ? { id: item } : item))
443
+ : typeof ctor.defaultValue === 'string'
444
+ ? { id: ctor.defaultValue, title: ctor.defaultValue }
445
+ : ctor.defaultValue,
446
+ interface: {
447
+ name: ctor.name,
448
+ path: ctor.path ?? ctor.name,
449
+ type: AXPWidgetsCatalog.select,
450
+ options: {
451
+ dataSource: ctor.dataSource.map((item) => (typeof item === 'string' ? { id: item, title: item } : item)),
452
+ },
453
+ },
454
+ },
455
+ visible: ctor.visible ?? true,
456
+ };
457
+ }
458
+ const AXP_WIDGET_TOKEN = new InjectionToken('AXP_WIDGET_TOKEN');
459
+ const AXP_WIDGET_COLUMN_TOKEN = new InjectionToken('AXP_WIDGET_COLUMN_TOKEN');
460
+
461
+ class AXPBaseWidgetComponent extends AXPWidgetCoreElement {
462
+ constructor() {
463
+ super(...arguments);
464
+ this.token = inject(AXP_WIDGET_TOKEN);
465
+ this.host = inject(ElementRef).nativeElement;
466
+ this.layoutService = inject(AXPWidgetCoreService);
467
+ this.contextService = inject(AXPWidgetCoreContextStore);
468
+ this.config = this.token.config;
469
+ this.node = this.token.node;
470
+ this.name = this.token.node.name;
471
+ this.component = this;
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();
484
+ }
485
+ get id() {
486
+ return this._id;
487
+ }
488
+ #statusEffect;
489
+ outputs() {
490
+ return [];
491
+ }
492
+ ngOnInit() {
493
+ if (get(this.node, '__meta__.added')) {
494
+ this.onAdded();
495
+ }
496
+ this.setStatus(AXPWidgetStatus.Rendered);
497
+ }
498
+ setStatus(status) {
499
+ this._status.set(status);
500
+ this.layoutService.updateStatus();
501
+ }
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 });
507
+ }
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;
518
+ }
519
+ call(name, ...args) {
520
+ const fn = get(this, name);
521
+ if (fn && typeof fn == 'function') {
522
+ fn.bind(this)(...args);
523
+ }
524
+ }
525
+ setChildren(children) {
526
+ this._children.set([...children]);
527
+ }
528
+ onAdded() { }
529
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXPBaseWidgetComponent, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
530
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXPBaseWidgetComponent }); }
531
+ }
532
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", 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.2.4", ngImport: i0, type: AXPLayoutBaseWidgetComponent, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
537
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXPLayoutBaseWidgetComponent }); }
538
+ }
539
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", 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" }] : []));
568
+ }
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();
579
+ }
580
+ extractValue(path) {
581
+ const rawValue = this.contextService.getValue(path);
582
+ if (this.node.valueTransforms?.getter) {
583
+ return this.node.valueTransforms?.getter(rawValue);
584
+ }
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;
595
+ }
596
+ if (isEqual(oldValue, value)) {
597
+ return;
598
+ }
599
+ if (this.fullPath()) {
600
+ this.contextService.update(this.fullPath(), value);
601
+ this.onValueChanged.next({ sender: this });
602
+ }
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.2.4", ngImport: i0, type: AXPValueWidgetComponent, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
644
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXPValueWidgetComponent }); }
645
+ }
646
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", 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.2.4", ngImport: i0, type: AXPDataListWidgetComponent, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
754
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXPDataListWidgetComponent }); }
755
+ }
756
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", 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.2.4", ngImport: i0, type: AXPColumnWidgetComponent, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
775
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXPColumnWidgetComponent }); }
776
+ }
777
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", 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.2.4", ngImport: i0, type: AXPBoxModelLayoutWidgetComponent, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
841
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXPBoxModelLayoutWidgetComponent }); }
842
+ }
843
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", 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.2.4", ngImport: i0, type: AXPBlockBaseLayoutWidgetComponent, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
854
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXPBlockBaseLayoutWidgetComponent }); }
855
+ }
856
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", 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.2.4", ngImport: i0, type: AXPFlexBaseLayoutWidgetComponent, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
918
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXPFlexBaseLayoutWidgetComponent }); }
919
+ }
920
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", 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.2.4", ngImport: i0, type: AXPInlineBaseLayoutWidgetComponent, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
931
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXPInlineBaseLayoutWidgetComponent }); }
932
+ }
933
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", 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.2.4", ngImport: i0, type: AXPFlexItemBaseLayoutWidgetComponent, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
990
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXPFlexItemBaseLayoutWidgetComponent }); }
991
+ }
992
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", 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.2.4", ngImport: i0, type: AXPGridBaseLayoutWidgetComponent, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
1029
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXPGridBaseLayoutWidgetComponent }); }
1030
+ }
1031
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", 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.2.4", ngImport: i0, type: AXPGridItemBaseLayoutWidgetComponent, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
1069
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXPGridItemBaseLayoutWidgetComponent }); }
1070
+ }
1071
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXPGridItemBaseLayoutWidgetComponent, decorators: [{
1072
+ type: Injectable
1073
+ }] });
1074
+
1075
+ class AXPTableBaseLayoutWidgetComponent extends AXPBlockBaseLayoutWidgetComponent {
1076
+ constructor() {
1077
+ super(...arguments);
1078
+ this.hostTableClass = computed(() => ({
1079
+ ...this.blockClass(),
1080
+ }), ...(ngDevMode ? [{ debugName: "hostTableClass" }] : []));
1081
+ this.hostTableStyle = computed(() => {
1082
+ const style = { ...this.blockStyle() };
1083
+ style['overflow-x'] = 'auto';
1084
+ return style;
1085
+ }, ...(ngDevMode ? [{ debugName: "hostTableStyle" }] : []));
1086
+ this.hostClass = computed(() => this.hostTableClass(), ...(ngDevMode ? [{ debugName: "hostClass" }] : []));
1087
+ this.hostStyle = computed(() => this.hostTableStyle(), ...(ngDevMode ? [{ debugName: "hostStyle" }] : []));
1088
+ }
1089
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXPTableBaseLayoutWidgetComponent, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
1090
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXPTableBaseLayoutWidgetComponent }); }
1091
+ }
1092
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXPTableBaseLayoutWidgetComponent, decorators: [{
1093
+ type: Injectable
1094
+ }] });
1095
+
1096
+ class AXPTableItemOpsBaseLayoutWidgetComponent extends AXPBlockBaseLayoutWidgetComponent {
1097
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXPTableItemOpsBaseLayoutWidgetComponent, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
1098
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXPTableItemOpsBaseLayoutWidgetComponent }); }
1099
+ }
1100
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXPTableItemOpsBaseLayoutWidgetComponent, decorators: [{
1101
+ type: Injectable
1102
+ }] });
1103
+
1104
+ class AXPTableItemBaseLayoutWidgetComponent extends AXPTableItemOpsBaseLayoutWidgetComponent {
1105
+ constructor() {
1106
+ super(...arguments);
1107
+ this.colSpan = computed(() => {
1108
+ const v = this.options()?.colSpan;
1109
+ return v ? Math.max(1, v) : 1;
1110
+ }, ...(ngDevMode ? [{ debugName: "colSpan" }] : []));
1111
+ this.rowSpan = computed(() => {
1112
+ const v = this.options()?.rowSpan;
1113
+ return v ? Math.max(1, v) : 1;
1114
+ }, ...(ngDevMode ? [{ debugName: "rowSpan" }] : []));
1115
+ this.hostClass = computed(() => this.blockClass(), ...(ngDevMode ? [{ debugName: "hostClass" }] : []));
1116
+ this.hostStyle = computed(() => this.blockStyle(), ...(ngDevMode ? [{ debugName: "hostStyle" }] : []));
1117
+ }
1118
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXPTableItemBaseLayoutWidgetComponent, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
1119
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXPTableItemBaseLayoutWidgetComponent }); }
1120
+ }
1121
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXPTableItemBaseLayoutWidgetComponent, decorators: [{
1122
+ type: Injectable
1123
+ }] });
1124
+
1125
+ class AXPWidgetRegistryService {
1126
+ /**
1127
+ *
1128
+ */
1129
+ constructor() {
1130
+ this.types = new Map();
1131
+ AXPWidgetRegistryService.instance = this;
1132
+ }
1133
+ register(widget) {
1134
+ this.types.set(widget.name, widget);
1135
+ }
1136
+ extend(parentName, widget) {
1137
+ const parentWidget = this.resolve(parentName);
1138
+ const newWidget = merge({}, parentWidget, widget);
1139
+ newWidget.name = widget.name;
1140
+ this.register(newWidget);
1141
+ }
1142
+ resolve(name) {
1143
+ const widget = this.types.get(name);
1144
+ if (!widget) {
1145
+ throw new Error(`Widget with name "${name}" does not exist.`);
1146
+ }
1147
+ return widget;
1148
+ }
1149
+ all() {
1150
+ return Array.from(this.types.values());
1151
+ }
1152
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXPWidgetRegistryService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1153
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXPWidgetRegistryService, providedIn: 'root' }); }
1154
+ }
1155
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXPWidgetRegistryService, decorators: [{
1156
+ type: Injectable,
1157
+ args: [{
1158
+ providedIn: 'root',
1159
+ }]
1160
+ }], ctorParameters: () => [] });
1161
+
1162
+ class AXPWidgetColumnRendererComponent extends AXDataTableColumnComponent {
1163
+ constructor() {
1164
+ super(...arguments);
1165
+ this.widgetRegistery = inject(AXPWidgetRegistryService);
1166
+ this.grid = inject(AXBaseDataTable);
1167
+ this.mergedOptions = signal({}, ...(ngDevMode ? [{ debugName: "mergedOptions" }] : []));
1168
+ this.loadingRow = signal(null, ...(ngDevMode ? [{ debugName: "loadingRow" }] : []));
1169
+ this.injector = inject(Injector);
1170
+ this.cdr = inject(ChangeDetectorRef);
1171
+ }
1172
+ get node() {
1173
+ return this._node;
1174
+ }
1175
+ set node(v) {
1176
+ this._node = v;
1177
+ }
1178
+ get renderFooterTemplate() {
1179
+ return this.footerTemplate ?? this._contentFooterTemplate;
1180
+ }
1181
+ get renderCellTemplate() {
1182
+ return this.cellTemplate ?? this._contentCellTemplate;
1183
+ }
1184
+ async handleExpandRow(row) {
1185
+ this.loadingRow.set(row);
1186
+ await this.grid.expandRow(row);
1187
+ this.loadingRow.set(null);
1188
+ // if (row.data?.__meta__?.expanded === undefined) {
1189
+ // this.width = `${parseInt(this.width as string) + 24}px`;
1190
+ // }
1191
+ }
1192
+ get renderHeaderTemplate() {
1193
+ return this.headerTemplate ?? this._contentHeaderTemplate;
1194
+ }
1195
+ get loadingEnabled() {
1196
+ return true;
1197
+ }
1198
+ get name() {
1199
+ return `col-${this.node.path}`;
1200
+ }
1201
+ async ngOnInit() {
1202
+ const widget = this.widgetRegistery.resolve(this.node.type);
1203
+ const mode = 'column';
1204
+ this.component = await widget?.components[mode]?.component();
1205
+ //
1206
+ const props = widget?.components[mode]?.properties
1207
+ ?.filter((c) => c.schema.defaultValue)
1208
+ .map((c) => ({ [c.name]: c.schema.defaultValue }))
1209
+ .reduce((acc, curr) => {
1210
+ return { ...acc, ...curr };
1211
+ }, {});
1212
+ //
1213
+ this.mergedOptions.set(merge(props, this.node.options) || {});
1214
+ const tokenValue = {
1215
+ path: this.node.path,
1216
+ options: this.mergedOptions(),
1217
+ };
1218
+ this.widgetInjector = Injector.create({
1219
+ parent: this.injector,
1220
+ providers: [
1221
+ {
1222
+ provide: AXP_WIDGET_COLUMN_TOKEN,
1223
+ useValue: tokenValue,
1224
+ },
1225
+ ],
1226
+ });
1227
+ this.width = this.customWidth ? this.customWidth : (this.mergedOptions().width ?? '200px');
1228
+ this.allowResizing = this.mergedOptions().allowResizing || true;
1229
+ this.cdr.detectChanges();
1230
+ }
1231
+ getInputs(data) {
1232
+ return {
1233
+ rawValue: getSmart(data, this.node.path),
1234
+ rowData: data,
1235
+ };
1236
+ }
1237
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXPWidgetColumnRendererComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1238
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.4", 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: [
1239
+ AXPWidgetCoreService,
1240
+ { provide: AXDataTableColumnComponent, useExisting: AXPWidgetColumnRendererComponent },
1241
+ ], 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: `
1242
+ <ng-template #header>{{ caption | translate | async }}</ng-template>
1243
+ <ng-template #cell let-row>
1244
+ <div class="ax-flex ax-gap-2 ax-items-center">
1245
+ @if (expandHandler) {
1246
+ <div
1247
+ (click)="handleExpandRow(row)"
1248
+ class="ax-expand-handler"
1249
+ [class.ax-invisible]="row.data.hasChild === false"
1250
+ id="ax-expand-handler-container"
1251
+ [style.padding-inline-start.rem]="row.data?.__meta__?.level * 2"
1252
+ >
1253
+ @if (loadingRow() === row) {
1254
+ <i class="fas fa-spinner-third ax-animate-twSpin ax-animate-infinite"></i>
1255
+ } @else {
1256
+ @if (row.data?.__meta__?.expanded) {
1257
+ <i [class]="customCollapseIcon || 'far fa-minus-square ax-text-md ax-opacity-75'"></i>
1258
+ } @else {
1259
+ <i [class]="customExpandIcon || 'far fa-plus-square ax-text-md ax-opacity-75'"></i>
1260
+ }
1261
+ }
1262
+ </div>
1263
+ }
1264
+ @if (component && widgetInjector && row?.data) {
1265
+ <ng-container
1266
+ *ngComponentOutlet="component; injector: widgetInjector; inputs: getInputs(row.data)"
1267
+ ></ng-container>
1268
+ }
1269
+ </div>
1270
+ </ng-template>
1271
+ <ng-template #footer></ng-template>
1272
+ `, 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 }); }
1273
+ }
1274
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXPWidgetColumnRendererComponent, decorators: [{
1275
+ type: Component,
1276
+ args: [{
1277
+ selector: 'axp-widget-column-renderer',
1278
+ template: `
1279
+ <ng-template #header>{{ caption | translate | async }}</ng-template>
1280
+ <ng-template #cell let-row>
1281
+ <div class="ax-flex ax-gap-2 ax-items-center">
1282
+ @if (expandHandler) {
1283
+ <div
1284
+ (click)="handleExpandRow(row)"
1285
+ class="ax-expand-handler"
1286
+ [class.ax-invisible]="row.data.hasChild === false"
1287
+ id="ax-expand-handler-container"
1288
+ [style.padding-inline-start.rem]="row.data?.__meta__?.level * 2"
1289
+ >
1290
+ @if (loadingRow() === row) {
1291
+ <i class="fas fa-spinner-third ax-animate-twSpin ax-animate-infinite"></i>
1292
+ } @else {
1293
+ @if (row.data?.__meta__?.expanded) {
1294
+ <i [class]="customCollapseIcon || 'far fa-minus-square ax-text-md ax-opacity-75'"></i>
1295
+ } @else {
1296
+ <i [class]="customExpandIcon || 'far fa-plus-square ax-text-md ax-opacity-75'"></i>
1297
+ }
1298
+ }
1299
+ </div>
1300
+ }
1301
+ @if (component && widgetInjector && row?.data) {
1302
+ <ng-container
1303
+ *ngComponentOutlet="component; injector: widgetInjector; inputs: getInputs(row.data)"
1304
+ ></ng-container>
1305
+ }
1306
+ </div>
1307
+ </ng-template>
1308
+ <ng-template #footer></ng-template>
1309
+ `,
1310
+ providers: [
1311
+ AXPWidgetCoreService,
1312
+ { provide: AXDataTableColumnComponent, useExisting: AXPWidgetColumnRendererComponent },
1313
+ ],
1314
+ changeDetection: ChangeDetectionStrategy.OnPush,
1315
+ inputs: ['caption'],
1316
+ standalone: false,
1317
+ }]
1318
+ }], propDecorators: { customExpandIcon: [{
1319
+ type: Input
1320
+ }], customCollapseIcon: [{
1321
+ type: Input
1322
+ }], customWidth: [{
1323
+ type: Input
1324
+ }], node: [{
1325
+ type: Input,
1326
+ args: [{ required: true }]
1327
+ }], footerTemplate: [{
1328
+ type: Input
1329
+ }], _contentFooterTemplate: [{
1330
+ type: ViewChild,
1331
+ args: ['footer']
1332
+ }], expandHandler: [{
1333
+ type: Input
1334
+ }], cellTemplate: [{
1335
+ type: Input
1336
+ }], _contentCellTemplate: [{
1337
+ type: ViewChild,
1338
+ args: ['cell']
1339
+ }], headerTemplate: [{
1340
+ type: Input
1341
+ }], _contentHeaderTemplate: [{
1342
+ type: ViewChild,
1343
+ args: ['header']
1344
+ }] } });
1345
+
1346
+ class AXPWidgetContainerComponent {
1347
+ set context(value) {
1348
+ this.contextService.set(value);
1349
+ }
1350
+ set functions(v) {
1351
+ this.builderService.setFunctions(v);
1352
+ }
1353
+ constructor() {
1354
+ this.contextService = inject(AXPWidgetCoreContextStore);
1355
+ this.builderService = inject(AXPWidgetCoreService);
1356
+ this.onContextChanged = new EventEmitter();
1357
+ this.status = computed(() => {
1358
+ return this.builderService.status();
1359
+ }, ...(ngDevMode ? [{ debugName: "status" }] : []));
1360
+ this.isBusy = computed(() => {
1361
+ return this.builderService.isBusy();
1362
+ }, ...(ngDevMode ? [{ debugName: "isBusy" }] : []));
1363
+ effect(() => {
1364
+ if (this.contextService.isChanged()) {
1365
+ this.onContextChanged.emit(this.contextService.changeEvent());
1366
+ }
1367
+ });
1368
+ }
1369
+ refresh() {
1370
+ this.builderService.refresh();
1371
+ }
1372
+ find(name) {
1373
+ return this.builderService.waitForWidget(name);
1374
+ }
1375
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXPWidgetContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1376
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.4", type: AXPWidgetContainerComponent, isStandalone: false, selector: "axp-widgets-container", inputs: { context: "context", functions: "functions" }, outputs: { onContextChanged: "onContextChanged" }, host: { styleAttribute: "display: contents;" }, providers: [AXPWidgetCoreService, AXPWidgetCoreContextStore], ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1377
+ }
1378
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXPWidgetContainerComponent, decorators: [{
1379
+ type: Component,
1380
+ args: [{
1381
+ selector: 'axp-widgets-container',
1382
+ template: `<ng-content></ng-content>`,
1383
+ changeDetection: ChangeDetectionStrategy.OnPush,
1384
+ host: { style: 'display: contents;' },
1385
+ providers: [AXPWidgetCoreService, AXPWidgetCoreContextStore],
1386
+ standalone: false,
1387
+ }]
1388
+ }], ctorParameters: () => [], propDecorators: { onContextChanged: [{
1389
+ type: Output
1390
+ }], context: [{
1391
+ type: Input
1392
+ }], functions: [{
1393
+ type: Input
1394
+ }] } });
1395
+
1396
+ class AXPWidgetPlaceholderComponent {
1397
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXPWidgetPlaceholderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1398
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.4", type: AXPWidgetPlaceholderComponent, isStandalone: true, selector: "axp-widget-placeholder", ngImport: i0, template: `<div>
1399
+ <ax-skeleton class="ax-w-full ax-h-10 ax-rounded-md"></ax-skeleton>
1400
+ </div>`, isInline: true, dependencies: [{ kind: "ngmodule", type: AXSkeletonModule }, { kind: "component", type: i1$1.AXSkeletonComponent, selector: "ax-skeleton", inputs: ["animated"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1401
+ }
1402
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXPWidgetPlaceholderComponent, decorators: [{
1403
+ type: Component,
1404
+ args: [{
1405
+ selector: 'axp-widget-placeholder',
1406
+ template: `<div>
1407
+ <ax-skeleton class="ax-w-full ax-h-10 ax-rounded-md"></ax-skeleton>
1408
+ </div>`,
1409
+ changeDetection: ChangeDetectionStrategy.OnPush,
1410
+ imports: [AXSkeletonModule],
1411
+ standalone: true,
1412
+ }]
1413
+ }] });
1414
+
1415
+ class AXPWidgetRendererDirective {
1416
+ //#endregion
1417
+ //#endregion
1418
+ constructor() {
1419
+ this.parentNode = input(...(ngDevMode ? [undefined, { debugName: "parentNode" }] : []));
1420
+ this.index = input(...(ngDevMode ? [undefined, { debugName: "index" }] : []));
1421
+ this.mode = input.required(...(ngDevMode ? [{ debugName: "mode" }] : []));
1422
+ this.node = input.required(...(ngDevMode ? [{ debugName: "node" }] : []));
1423
+ this._options = signal({}, ...(ngDevMode ? [{ debugName: "_options" }] : []));
1424
+ this.options = this._options.asReadonly();
1425
+ this.onOptionsChanged = output();
1426
+ this.onValueChanged = output();
1427
+ //#region ---- Properties ----
1428
+ this.mergedOptions = signal({}, ...(ngDevMode ? [{ debugName: "mergedOptions" }] : []));
1429
+ this.injector = inject(Injector);
1430
+ this.builderService = inject(AXPWidgetCoreService);
1431
+ this.contextService = inject(AXPWidgetCoreContextStore);
1432
+ this.widgetRegistery = inject(AXPWidgetRegistryService);
1433
+ this.unsubscriber = inject(AXUnsubscriber);
1434
+ this.translateService = inject(AXTranslationService);
1435
+ this.widgetService = inject(AXPWidgetRegistryService);
1436
+ this.expressionEvaluator = inject(AXPExpressionEvaluatorService);
1437
+ this.viewContainerRef = inject(ViewContainerRef);
1438
+ this.isLoading = signal(false, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
1439
+ this.expressionEvaluators = new Map();
1440
+ this.renderTimeoutId = null;
1441
+ this.hasInitialRender = false;
1442
+ this.onContextChanged = new Subject();
1443
+ //#region ---- Performance Optimization Properties ----
1444
+ this.contextUpdateQueue = new Set();
1445
+ this.contextUpdateTimeout = null;
1446
+ this.CONTEXT_UPDATE_DEBOUNCE_MS = 4; // ~250fps for large forms
1447
+ // Removed visibility detection - not needed for current implementation
1448
+ // Expression result caching
1449
+ this.expressionCache = new Map();
1450
+ this.EXPRESSION_CACHE_TTL = 500; // Cache for 500ms (increased for better hit rate)
1451
+ // Options change tracking
1452
+ this.lastAppliedOptions = null;
1453
+ // Expression result tracking
1454
+ this.lastExpressionResults = new Map();
1455
+ // Buffer for context changes that happen before initial render completes
1456
+ this.preRenderContextQueue = new Set();
1457
+ effect(async () => {
1458
+ const changed = this.contextService.changeEvent();
1459
+ // Don't trigger re-render during initial setup
1460
+ if (!this.hasInitialRender) {
1461
+ if (changed.path) {
1462
+ this.preRenderContextQueue.add(changed.path);
1463
+ // console.log(`📝 [${this.node().type}] Buffered pre-render context change: ${changed.path}`);
1464
+ }
1465
+ return;
1466
+ }
1467
+ // CRITICAL PERFORMANCE FIX: Only respond to relevant context changes
1468
+ if (changed.path && this.isRelevantContextChange(changed.path)) {
1469
+ // console.log(`🎯 [${this.node().type}] Context change detected: ${changed.path}`);
1470
+ this.queueContextUpdate(changed.path);
1471
+ }
1472
+ });
1473
+ this.builderService.onRefresh.pipe(this.unsubscriber.takeUntilDestroy).subscribe(async () => {
1474
+ await this.processBatchedUpdates();
1475
+ });
1476
+ }
1477
+ //#region ---- Expression Caching Methods ----
1478
+ getCachedExpressionResult(expressionKey) {
1479
+ const cached = this.expressionCache.get(expressionKey);
1480
+ if (cached && performance.now() - cached.timestamp < this.EXPRESSION_CACHE_TTL) {
1481
+ // console.log(`💾 [${this.node().type}] Using cached expression result for '${expressionKey}'`);
1482
+ return cached.value;
1483
+ }
1484
+ return null;
1485
+ }
1486
+ setCachedExpressionResult(expressionKey, value) {
1487
+ this.expressionCache.set(expressionKey, {
1488
+ value,
1489
+ timestamp: performance.now(),
1490
+ });
1491
+ }
1492
+ clearExpressionCache() {
1493
+ this.expressionCache.clear();
1494
+ }
1495
+ isPathAffectingExpressions(changedPath) {
1496
+ // console.log(
1497
+ // `🔍 [${this.node().type}] Checking if path '${changedPath}' affects expressions. Expression count: ${this.expressionEvaluators.size}`,
1498
+ // );
1499
+ // If widget has no expressions, no need to clear cache
1500
+ if (this.expressionEvaluators.size === 0) {
1501
+ // console.log(`🔍 [${this.node().type}] Path '${changedPath}' - no expressions, keeping cache`);
1502
+ return false;
1503
+ }
1504
+ // Use the same logic as hasExpressionDependency to check for actual dependencies
1505
+ if (this.hasExpressionDependency(changedPath)) {
1506
+ // console.log(`🔍 [${this.node().type}] Path '${changedPath}' affects expressions - clearing cache`);
1507
+ return true;
1508
+ }
1509
+ // console.log(`🔍 [${this.node().type}] Path '${changedPath}' does not affect expressions - keeping cache`);
1510
+ return false;
1511
+ }
1512
+ //#endregion
1513
+ //#region ---- Context Batching Methods ----
1514
+ queueContextUpdate(path) {
1515
+ if (path) {
1516
+ // console.log(`🔄 [${this.node().type}] Queueing context update for path: ${path}`);
1517
+ this.contextUpdateQueue.add(path);
1518
+ // Clear existing timeout
1519
+ if (this.contextUpdateTimeout) {
1520
+ clearTimeout(this.contextUpdateTimeout);
1521
+ }
1522
+ // Debounce updates
1523
+ this.contextUpdateTimeout = setTimeout(() => {
1524
+ // console.log(`⚡ [${this.node().type}] Processing batched updates for ${this.contextUpdateQueue.size} paths`);
1525
+ this.processBatchedUpdates();
1526
+ }, this.CONTEXT_UPDATE_DEBOUNCE_MS);
1527
+ }
1528
+ }
1529
+ async processBatchedUpdates() {
1530
+ if (this.contextUpdateQueue.size === 0)
1531
+ return;
1532
+ const startTime = performance.now();
1533
+ const paths = Array.from(this.contextUpdateQueue);
1534
+ this.contextUpdateQueue.clear();
1535
+ // console.log(`📊 [${this.node().type}] Processing ${paths.length} paths:`, paths);
1536
+ // Clear expression cache only if changed paths affect this widget's expressions
1537
+ const shouldClearCache = paths.some((path) => this.isPathAffectingExpressions(path));
1538
+ if (shouldClearCache) {
1539
+ // console.log(`🗑️ [${this.node().type}] Clearing expression cache due to expression-affecting path change`);
1540
+ this.clearExpressionCache();
1541
+ }
1542
+ // Process updates in batches
1543
+ const optionsStartTime = performance.now();
1544
+ const hasOptionsUpdate = await this.updateOptionsBasedOnContext();
1545
+ const optionsTime = performance.now() - optionsStartTime;
1546
+ if (typeof hasOptionsUpdate === 'number' && hasOptionsUpdate > 0) {
1547
+ // console.log(`🔧 [${this.node().type}] Options updated (${optionsTime.toFixed(2)}ms)`);
1548
+ this.applyOptions();
1549
+ }
1550
+ // Check formulas for any of the changed paths
1551
+ const formulaStartTime = performance.now();
1552
+ const formulaNeedsUpdate = paths.some((path) => this.checkFormulaForUpdate(this.node().formula, path));
1553
+ if (formulaNeedsUpdate) {
1554
+ // console.log(`🧮 [${this.node().type}] Formula needs update`);
1555
+ await this.updateValueBasedOnFormula();
1556
+ }
1557
+ const formulaTime = performance.now() - formulaStartTime;
1558
+ // Emit context changes
1559
+ paths.forEach((path) => {
1560
+ this.onContextChanged.next({ path });
1561
+ });
1562
+ const totalTime = performance.now() - startTime;
1563
+ // console.log(
1564
+ // `✅ [${this.node().type}] Batch processing completed in ${totalTime.toFixed(2)}ms (options: ${optionsTime.toFixed(2)}ms, formula: ${formulaTime.toFixed(2)}ms)`,
1565
+ // );
1566
+ }
1567
+ //#endregion
1568
+ //#region ---- Context Relevance Filtering ----
1569
+ isRelevantContextChange(changedPath) {
1570
+ const node = this.node();
1571
+ // 1. Direct path match - widget's own field
1572
+ if (node.path === changedPath) {
1573
+ return true;
1574
+ }
1575
+ // 2. Parent path match - widget is inside the changed container
1576
+ if (node.path && changedPath.startsWith(node.path + '.')) {
1577
+ return true;
1578
+ }
1579
+ // 3. Child path match - changed field is inside this widget's container
1580
+ if (node.path && node.path.startsWith(changedPath + '.')) {
1581
+ return true;
1582
+ }
1583
+ // 4. Expression dependency check - if widget has expressions that depend on this path
1584
+ if (this.hasExpressionDependency(changedPath)) {
1585
+ return true;
1586
+ }
1587
+ // 5. Formula dependency check - if widget's formula depends on this path
1588
+ if (node.formula && this.checkFormulaForUpdate(node.formula, changedPath)) {
1589
+ return true;
1590
+ }
1591
+ // 6. Trigger dependency check - if widget has triggers that depend on this path
1592
+ if (this.hasTriggerDependency(changedPath)) {
1593
+ return true;
1594
+ }
1595
+ return false;
1596
+ }
1597
+ hasExpressionDependency(changedPath) {
1598
+ // Check if any cached expressions depend on the changed path
1599
+ for (const [path, evaluator] of this.expressionEvaluators) {
1600
+ // Check if the expression path itself contains the changed path
1601
+ if (path.includes(changedPath)) {
1602
+ return true;
1603
+ }
1604
+ // Parse the actual expression content to check for context.eval() calls
1605
+ // We need to get the original expression string to analyze it
1606
+ const node = this.node();
1607
+ const expressionValue = this.getExpressionValueFromNode(node, path);
1608
+ if (expressionValue && typeof expressionValue === 'string') {
1609
+ // Look for context.eval() calls that reference the changed path
1610
+ const contextEvalRegex = /context\.eval\(['"]([^'\"]+)['"]\)/g;
1611
+ let match;
1612
+ while ((match = contextEvalRegex.exec(expressionValue)) !== null) {
1613
+ const evalPath = match[1];
1614
+ // Normalize Id-suffixed segments to dot-id form (e.g., 'typeId' -> 'type.id', 'party.typeId' -> 'party.type.id')
1615
+ const normalizePath = (p) => {
1616
+ if (!p)
1617
+ return p;
1618
+ const parts = p.split('.');
1619
+ const last = parts[parts.length - 1];
1620
+ if (last && last.endsWith('Id')) {
1621
+ parts.splice(parts.length - 1, 1, last.slice(0, -2), 'id');
1622
+ }
1623
+ return parts.join('.');
1624
+ };
1625
+ const isSegmentSuffix = (a, b) => {
1626
+ if (!a || !b)
1627
+ return false;
1628
+ const pa = a.split('.');
1629
+ const pb = b.split('.');
1630
+ if (pb.length > pa.length)
1631
+ return false;
1632
+ for (let i = 1; i <= pb.length; i++) {
1633
+ if (pa[pa.length - i] !== pb[pb.length - i])
1634
+ return false;
1635
+ }
1636
+ return true;
1637
+ };
1638
+ const evalNorm = normalizePath(evalPath);
1639
+ const changedNorm = normalizePath(changedPath);
1640
+ // Debug log for dependency check
1641
+ // console.log(
1642
+ // `🧭 [${this.node().type}] dep-check expr='${path}', changed='${changedPath}', eval='${evalPath}', evalNorm='${evalNorm}', changedNorm='${changedNorm}'`,
1643
+ // );
1644
+ // Generic direct and hierarchical dependency checks (raw and normalized)
1645
+ const rawMatch = evalPath === changedPath ||
1646
+ evalPath.startsWith(changedPath + '.') ||
1647
+ changedPath.startsWith(evalPath + '.') ||
1648
+ isSegmentSuffix(evalPath, changedPath) ||
1649
+ isSegmentSuffix(changedPath, evalPath);
1650
+ const normMatch = evalNorm === changedNorm ||
1651
+ evalNorm.startsWith(changedNorm + '.') ||
1652
+ changedNorm.startsWith(evalNorm + '.') ||
1653
+ isSegmentSuffix(evalNorm, changedNorm) ||
1654
+ isSegmentSuffix(changedNorm, evalNorm);
1655
+ if (rawMatch || normMatch) {
1656
+ // console.log(
1657
+ // `🔍 [${this.node().type}] Expression '${path}' depends on '${changedPath}' via context.eval('${evalPath}') (generic match)`,
1658
+ // );
1659
+ return true;
1660
+ }
1661
+ // Check for path aliases/mappings (e.g., typeId.id <-> type.id)
1662
+ if (this.isPathAlias(evalPath, changedPath)) {
1663
+ // console.log(
1664
+ // `🔍 [${this.node().type}] Expression '${path}' depends on '${changedPath}' via context.eval('${evalPath}') (path alias)`,
1665
+ // );
1666
+ return true;
1667
+ }
1668
+ }
1669
+ }
1670
+ }
1671
+ return false;
1672
+ }
1673
+ isPathAlias(evalPath, changedPath) {
1674
+ // Dynamic path alias detection based on 'Id' suffix pattern
1675
+ // Examples: typeId.id <-> type.id, categoryId.name <-> category.name
1676
+ // Check if evalPath ends with 'Id' and has a property
1677
+ if (evalPath.endsWith('Id') && evalPath.includes('.')) {
1678
+ const basePath = evalPath.substring(0, evalPath.lastIndexOf('Id'));
1679
+ const property = evalPath.substring(evalPath.lastIndexOf('.') + 1);
1680
+ const mappedPath = `${basePath}.${property}`;
1681
+ if (changedPath === mappedPath) {
1682
+ // console.log(`🔍 [${this.node().type}] Path alias detected: '${evalPath}' <-> '${changedPath}'`);
1683
+ return true;
1684
+ }
1685
+ }
1686
+ // Check if changedPath ends with 'Id' and has a property
1687
+ if (changedPath.endsWith('Id') && changedPath.includes('.')) {
1688
+ const basePath = changedPath.substring(0, changedPath.lastIndexOf('Id'));
1689
+ const property = changedPath.substring(changedPath.lastIndexOf('.') + 1);
1690
+ const mappedPath = `${basePath}.${property}`;
1691
+ if (evalPath === mappedPath) {
1692
+ // console.log(`🔍 [${this.node().type}] Path alias detected: '${evalPath}' <-> '${changedPath}'`);
1693
+ return true;
1694
+ }
1695
+ }
1696
+ // Check for direct 'Id' suffix mapping (e.g., typeId <-> type.id)
1697
+ if (evalPath.endsWith('Id') && !evalPath.includes('.')) {
1698
+ const basePath = evalPath.substring(0, evalPath.lastIndexOf('Id'));
1699
+ const mappedPath = `${basePath}.id`;
1700
+ if (changedPath === mappedPath) {
1701
+ // console.log(`🔍 [${this.node().type}] Path alias detected: '${evalPath}' <-> '${changedPath}'`);
1702
+ return true;
1703
+ }
1704
+ }
1705
+ if (changedPath.endsWith('Id') && !changedPath.includes('.')) {
1706
+ const basePath = changedPath.substring(0, changedPath.lastIndexOf('Id'));
1707
+ const mappedPath = `${basePath}.id`;
1708
+ if (evalPath === mappedPath) {
1709
+ // console.log(`🔍 [${this.node().type}] Path alias detected: '${evalPath}' <-> '${changedPath}'`);
1710
+ return true;
1711
+ }
1712
+ }
1713
+ return false;
1714
+ }
1715
+ getExpressionValueFromNode(node, path) {
1716
+ try {
1717
+ // Navigate through the node structure to find the expression value
1718
+ const pathParts = path.split('.');
1719
+ let current = node.options || {};
1720
+ // Navigate through the path parts
1721
+ for (const part of pathParts) {
1722
+ if (current && typeof current === 'object' && part in current) {
1723
+ current = current[part];
1724
+ }
1725
+ else {
1726
+ return null;
1727
+ }
1728
+ }
1729
+ return typeof current === 'string' ? current : null;
1730
+ }
1731
+ catch (error) {
1732
+ // console.error('Error extracting expression value from node:', error);
1733
+ return null;
1734
+ }
1735
+ }
1736
+ hasTriggerDependency(changedPath) {
1737
+ const node = this.node();
1738
+ const triggers = node.triggers || node.options?.['triggers'] || this.mergedOptions()?.triggers;
1739
+ if (!triggers)
1740
+ return false;
1741
+ // Check if any trigger event depends on the changed path
1742
+ for (const trigger of triggers) {
1743
+ if (trigger.event && trigger.event.includes(changedPath)) {
1744
+ return true;
1745
+ }
1746
+ }
1747
+ return false;
1748
+ }
1749
+ //#endregion
1750
+ // Removed visibility detection methods - not needed for current implementation
1751
+ // Detect input changes
1752
+ ngOnChanges(changes) {
1753
+ if (changes['mode'] || changes['node']) {
1754
+ // Check if either 'mode' or 'node' has changed
1755
+ this.rerenderComponent();
1756
+ }
1757
+ }
1758
+ rerenderComponent() {
1759
+ // Clear any pending render operation to prevent double rendering
1760
+ if (this.renderTimeoutId) {
1761
+ clearTimeout(this.renderTimeoutId);
1762
+ this.renderTimeoutId = null;
1763
+ }
1764
+ // Reset loading state to allow re-rendering
1765
+ this.isLoading.set(false);
1766
+ // Schedule the component loading
1767
+ this.renderTimeoutId = setTimeout(async () => {
1768
+ await this.loadComponent();
1769
+ this.renderTimeoutId = null;
1770
+ });
1771
+ }
1772
+ ngOnDestroy() {
1773
+ if (this.renderTimeoutId) {
1774
+ clearTimeout(this.renderTimeoutId);
1775
+ }
1776
+ if (this.contextUpdateTimeout) {
1777
+ clearTimeout(this.contextUpdateTimeout);
1778
+ }
1779
+ if (this.componentRef) {
1780
+ this.componentRef.destroy();
1781
+ }
1782
+ }
1783
+ async loadComponent() {
1784
+ if (this.isLoading()) {
1785
+ return;
1786
+ }
1787
+ this.isLoading.set(true);
1788
+ try {
1789
+ // Destroy the existing component if it exists
1790
+ if (this.componentRef) {
1791
+ this.componentRef.destroy();
1792
+ }
1793
+ this.viewContainerRef.clear();
1794
+ //
1795
+ const widget = this.widgetRegistery.resolve(this.node().type);
1796
+ //
1797
+ const propertiesToProcess = [
1798
+ ...(widget?.properties ?? []),
1799
+ ...(widget?.components[this.mode()]?.properties ?? []),
1800
+ ]?.filter((c) => c.schema.defaultValue != null);
1801
+ // Process default values (evaluate expressions if needed)
1802
+ const props = {};
1803
+ for (const property of propertiesToProcess) {
1804
+ const defaultValue = property.schema.defaultValue;
1805
+ if (typeof defaultValue === 'string' && this.expressionEvaluator.isExpression(defaultValue)) {
1806
+ // Evaluate expression for default value
1807
+ try {
1808
+ const evaluatedValue = await this.evaluateExpression(defaultValue);
1809
+ props[property.name] = evaluatedValue;
1810
+ }
1811
+ catch (error) {
1812
+ // console.error(`Error evaluating default value expression for property ${property.name}:`, error);
1813
+ props[property.name] = cloneDeep(defaultValue); // Fallback to original value
1814
+ }
1815
+ }
1816
+ else {
1817
+ // Use static default value
1818
+ props[property.name] = cloneDeep(defaultValue);
1819
+ }
1820
+ }
1821
+ //
1822
+ this.mergedOptions.set(merge(props, widget?.options, this.node().options) || {});
1823
+ this.expressionEvaluators.clear();
1824
+ // Register expressions from widget defaults and node options to cover related-entity cases
1825
+ this.preprocessAndInitialOptions(cloneDeep(widget?.options));
1826
+ this.preprocessAndInitialOptions(cloneDeep(this.node().options));
1827
+ await this.updateOptionsBasedOnContext();
1828
+ //
1829
+ this._options.update((val) => ({ ...val, ...this.mergedOptions() }));
1830
+ // Evaluate default value
1831
+ let defaultValue = this.node().defaultValue;
1832
+ if (defaultValue && this.expressionEvaluator.isExpression(defaultValue)) {
1833
+ defaultValue = await this.evaluateExpression(defaultValue);
1834
+ }
1835
+ //
1836
+ const tokenValue = {
1837
+ node: this.node(),
1838
+ defaultValue: defaultValue,
1839
+ options: this.mergedOptions(),
1840
+ config: widget,
1841
+ };
1842
+ const token = Injector.create({
1843
+ parent: this.injector,
1844
+ providers: [
1845
+ {
1846
+ provide: AXP_WIDGET_TOKEN,
1847
+ useValue: tokenValue,
1848
+ },
1849
+ ],
1850
+ });
1851
+ //
1852
+ const loadingRef = this.viewContainerRef.createComponent(AXPWidgetPlaceholderComponent);
1853
+ //
1854
+ const com = await widget?.components[this.mode()]?.component();
1855
+ if (!com) {
1856
+ // console.error(`${this.node().type} widget component not found with mode: ${this.mode()}`);
1857
+ return;
1858
+ }
1859
+ this.componentRef = this.viewContainerRef.createComponent(com, { injector: token });
1860
+ this.instance = this.componentRef.instance;
1861
+ this.instance.setStatus(AXPWidgetStatus.Rendering);
1862
+ this.instance.parent = this.parentNode();
1863
+ this.instance.index = this.index();
1864
+ this.instance.mode = this.mode();
1865
+ this.instance.setStatus(AXPWidgetStatus.Rendered);
1866
+ this.instance?.onOptionsChanged?.pipe(this.unsubscriber.takeUntilDestroy).subscribe((c) => {
1867
+ this.onOptionsChanged.emit({ sender: this, widget: c.sender });
1868
+ });
1869
+ this.instance?.onValueChanged?.pipe(this.unsubscriber.takeUntilDestroy).subscribe((c) => {
1870
+ this.onValueChanged.emit({ sender: this, widget: c.sender });
1871
+ });
1872
+ await this.updateValueBasedOnFormula();
1873
+ await this.assignTriggers();
1874
+ //
1875
+ loadingRef.destroy();
1876
+ // Mark that initial render is complete
1877
+ this.hasInitialRender = true;
1878
+ // Re-evaluate expressions after initial render to catch late-arriving related context
1879
+ if (this.expressionEvaluators.size > 0) {
1880
+ // console.log(`🔄 [${this.node().type}] Re-evaluating expressions after initial render`);
1881
+ await this.updateOptionsBasedOnContext();
1882
+ this.applyOptions();
1883
+ }
1884
+ // Process any buffered pre-render context changes now that the component is ready
1885
+ if (this.preRenderContextQueue.size > 0) {
1886
+ // console.log(
1887
+ // `🚀 [${this.node().type}] Processing ${this.preRenderContextQueue.size} buffered pre-render changes`,
1888
+ // );
1889
+ this.preRenderContextQueue.forEach((p) => this.contextUpdateQueue.add(p));
1890
+ this.preRenderContextQueue.clear();
1891
+ await this.processBatchedUpdates();
1892
+ }
1893
+ }
1894
+ catch (error) {
1895
+ // console.error('Error loading component:', error);
1896
+ }
1897
+ finally {
1898
+ this.isLoading.set(false);
1899
+ }
1900
+ }
1901
+ applyOptions() {
1902
+ if (!this.instance)
1903
+ return;
1904
+ const currentOptions = this.mergedOptions();
1905
+ // Check if options have actually changed
1906
+ if (this.hasOptionsChanged(currentOptions)) {
1907
+ // console.log('applyOptions', this.node().path, '- options changed');
1908
+ this._options.update((val) => ({ ...val, ...currentOptions }));
1909
+ this.instance.setOptions(currentOptions);
1910
+ this.lastAppliedOptions = cloneDeep(currentOptions); // Deep clone using Lodash
1911
+ }
1912
+ else {
1913
+ // console.log('applyOptions', this.node().path, '- no changes, skipping');
1914
+ }
1915
+ }
1916
+ hasOptionsChanged(newOptions) {
1917
+ if (!this.lastAppliedOptions) {
1918
+ return true; // First time, always apply
1919
+ }
1920
+ // Deep comparison of options using Lodash isEqual
1921
+ return !isEqual(newOptions, this.lastAppliedOptions);
1922
+ }
1923
+ // Removed deepCloneValue method - now using Lodash cloneDeep
1924
+ checkFormulaForUpdate(formula, path) {
1925
+ if (formula) {
1926
+ const regex = /context\.eval\('([^']+)'\)/g;
1927
+ const matches = formula.match(regex);
1928
+ const nodes = matches ? matches.map((match) => match.match(/'([^']+)'/)[1]) : [];
1929
+ return nodes.includes(path);
1930
+ }
1931
+ else
1932
+ return false;
1933
+ }
1934
+ preprocessAndInitialOptions(obj, pathPrefix = '') {
1935
+ if (!obj) {
1936
+ return;
1937
+ }
1938
+ Object.entries(obj).forEach(([key, value]) => {
1939
+ const currentPath = pathPrefix ? `${pathPrefix}.${key}` : key;
1940
+ // CRITICAL FIX: Skip trigger actions during options processing
1941
+ //
1942
+ // PROBLEM: Trigger actions were being evaluated immediately during widget setup/options processing,
1943
+ // causing them to execute before the actual trigger event occurred. This meant triggers would fire
1944
+ // during initialization instead of when the specified context path actually changed.
1945
+ //
1946
+ // ROOT CAUSE: The expression evaluator was processing trigger action expressions (like console.log
1947
+ // or widget.setValue calls) as part of the normal options preprocessing, treating them as dynamic
1948
+ // expressions that needed immediate evaluation.
1949
+ //
1950
+ // SOLUTION: Detect when we're processing trigger actions and store them as static values without
1951
+ // expression evaluation. This ensures trigger actions are only evaluated when the trigger's
1952
+ // subscription callback actually fires (when the event condition is met).
1953
+ //
1954
+ // RESULT: Triggers now only execute when their event filters pass (e.g., when the specified
1955
+ // context path changes), not during widget initialization.
1956
+ if (currentPath.includes('triggers') && (key === 'action' || currentPath.endsWith('.action'))) {
1957
+ // Apply static values directly without expression evaluation
1958
+ this.mergedOptions.update((currentOptions) => {
1959
+ return set(currentOptions, currentPath, value);
1960
+ });
1961
+ return;
1962
+ }
1963
+ if (typeof value === 'string' && this.expressionEvaluator.isExpression(value)) {
1964
+ // Cache dynamic expression for later evaluation
1965
+ this.expressionEvaluators.set(currentPath, () => this.evaluateExpression(value));
1966
+ }
1967
+ else if (typeof value === 'object' &&
1968
+ value !== null &&
1969
+ (value.constructor === Object || Array.isArray(value))) {
1970
+ // Recursively handle nested objects
1971
+ this.preprocessAndInitialOptions(value, currentPath);
1972
+ }
1973
+ else {
1974
+ // Apply static values directly
1975
+ this.mergedOptions.update((currentOptions) => {
1976
+ return set(currentOptions, currentPath, value);
1977
+ });
1978
+ }
1979
+ });
1980
+ }
1981
+ async updateOptionsBasedOnContext() {
1982
+ // Early return if no expressions to evaluate
1983
+ if (this.expressionEvaluators.size === 0) {
1984
+ return 0;
1985
+ }
1986
+ // console.log(`🔍 [${this.node().type}] Evaluating ${this.expressionEvaluators.size} expressions`);
1987
+ const updatePromises = Array.from(this.expressionEvaluators).map(async ([path, evaluator]) => {
1988
+ // Check cache first
1989
+ const cachedValue = this.getCachedExpressionResult(path);
1990
+ if (cachedValue !== null) {
1991
+ // console.log(`💾 [${this.node().type}] Using cached expression result for '${path}'`);
1992
+ return { path, newValue: cachedValue, fromCache: true };
1993
+ }
1994
+ // Evaluate expression if not cached
1995
+ const evalStartTime = performance.now();
1996
+ const newValue = await evaluator();
1997
+ const evalTime = performance.now() - evalStartTime;
1998
+ // Check if result has actually changed using Lodash isEqual
1999
+ const lastValue = this.lastExpressionResults.get(path);
2000
+ const hasChanged = !isEqual(newValue, lastValue);
2001
+ if (hasChanged) {
2002
+ // console.log(
2003
+ // `📝 [${this.node().type}] Expression '${path}' evaluated in ${evalTime.toFixed(2)}ms - value changed`,
2004
+ // );
2005
+ // Cache the result and track it
2006
+ this.setCachedExpressionResult(path, newValue);
2007
+ this.lastExpressionResults.set(path, cloneDeep(newValue));
2008
+ return { path, newValue, fromCache: false, hasChanged: true };
2009
+ }
2010
+ else {
2011
+ // console.log(
2012
+ // `📝 [${this.node().type}] Expression '${path}' evaluated in ${evalTime.toFixed(2)}ms - value unchanged, skipping update`,
2013
+ // );
2014
+ // Cache the result but don't update
2015
+ this.setCachedExpressionResult(path, newValue);
2016
+ this.lastExpressionResults.set(path, cloneDeep(newValue));
2017
+ return { path, newValue, fromCache: false, hasChanged: false };
2018
+ }
2019
+ });
2020
+ // Wait for all evaluators to complete
2021
+ const updates = await Promise.all(updatePromises);
2022
+ // Filter updates to only include those that have actually changed
2023
+ const changedUpdates = updates.filter((update) => update.hasChanged !== false);
2024
+ // Apply updates to mergedOptions only for changed values
2025
+ if (changedUpdates.length > 0) {
2026
+ this.mergedOptions.update((o) => {
2027
+ const updatedOptions = { ...o };
2028
+ changedUpdates.forEach(({ path, newValue }) => {
2029
+ set(updatedOptions, path, newValue);
2030
+ });
2031
+ return updatedOptions;
2032
+ });
2033
+ }
2034
+ const cacheHits = updates.filter((update) => update.fromCache).length;
2035
+ const skippedUpdates = updates.length - changedUpdates.length;
2036
+ // console.log(
2037
+ // `📋 [${this.node().type}] Applied ${changedUpdates.length} expression updates (${cacheHits} cache hits, ${skippedUpdates} skipped)`,
2038
+ // );
2039
+ return changedUpdates.length;
2040
+ }
2041
+ async updateValueBasedOnFormula() {
2042
+ if (this.node().formula) {
2043
+ const value = await this.evaluateExpression(this.node().formula);
2044
+ this.instance.setValue(value);
2045
+ }
2046
+ }
2047
+ async evaluateExpression(templateExpression) {
2048
+ try {
2049
+ const scope = this.buildExpressionScope();
2050
+ return await this.expressionEvaluator.evaluate(templateExpression, scope);
2051
+ }
2052
+ catch (error) {
2053
+ // console.error('Error evaluating expression:', error);
2054
+ return false;
2055
+ }
2056
+ }
2057
+ buildExpressionScope() {
2058
+ return {
2059
+ context: this.getContextScope(),
2060
+ events: this.getEventScope(),
2061
+ widget: this.getWidgetScope(),
2062
+ methods: this.getFunctionScope(),
2063
+ vars: this.getVariablesScope(),
2064
+ };
2065
+ }
2066
+ getContextScope() {
2067
+ return {
2068
+ eval: (path) => {
2069
+ //TODO: Handle array index
2070
+ const fullPath = path.startsWith('>') ? `${this.instance?.parentPath()}.${path.substring(1)}` : path;
2071
+ const value = this.contextService.getValue(fullPath);
2072
+ return value;
2073
+ },
2074
+ set: (path, value) => {
2075
+ this.contextService.update(path, value);
2076
+ },
2077
+ data: () => {
2078
+ return this.contextService.data();
2079
+ },
2080
+ isDirty: () => {
2081
+ return this.contextService.isDirty();
2082
+ },
2083
+ };
2084
+ }
2085
+ getEventScope() {
2086
+ return {
2087
+ context: (path) => {
2088
+ return this.onContextChanged.pipe(filter((c) => {
2089
+ // If no path filter specified, pass all events
2090
+ if (path == null || path === '') {
2091
+ return true;
2092
+ }
2093
+ // Ensure c.path exists
2094
+ if (!c.path) {
2095
+ return false;
2096
+ }
2097
+ // Pattern: "prefix*" - matches paths that start with prefix
2098
+ if (path.endsWith('*')) {
2099
+ const prefix = path.substring(0, path.length - 1);
2100
+ return c.path.startsWith(prefix);
2101
+ }
2102
+ // Pattern: "*suffix" - matches paths that end with suffix
2103
+ else if (path.startsWith('*')) {
2104
+ const suffix = path.substring(1);
2105
+ return c.path.endsWith(suffix);
2106
+ }
2107
+ // Exact match
2108
+ else {
2109
+ return c.path === path;
2110
+ }
2111
+ }));
2112
+ },
2113
+ from: (event) => get(this.instance.api(), event),
2114
+ };
2115
+ }
2116
+ getWidgetScope() {
2117
+ return {
2118
+ call: (name, ...args) => {
2119
+ this.instance.call(name, ...args);
2120
+ },
2121
+ setValue: (value) => {
2122
+ this.instance.setValue(value);
2123
+ },
2124
+ clear: () => {
2125
+ this.instance.setValue(undefined);
2126
+ },
2127
+ refresh: () => {
2128
+ const refresh = this.instance?.['refresh'];
2129
+ if (refresh && typeof refresh === 'function') {
2130
+ refresh.bind(this.instance)();
2131
+ }
2132
+ },
2133
+ output: (name) => {
2134
+ this.instance.output(name);
2135
+ },
2136
+ find: (id) => {
2137
+ return this.builderService.getWidget(id);
2138
+ },
2139
+ };
2140
+ }
2141
+ getFunctionScope() {
2142
+ const scope = {
2143
+ sum: (values) => {
2144
+ return sum(values);
2145
+ },
2146
+ translate: (text, options) => {
2147
+ return this.translateService.translateAsync(text, options);
2148
+ },
2149
+ widgetInfo: (name) => {
2150
+ return this.widgetService.resolve(name);
2151
+ },
2152
+ };
2153
+ // Add custom functions from builder service
2154
+ Object.entries(this.builderService.functions).forEach(([key, fn]) => {
2155
+ scope[key] = (...args) => {
2156
+ return fn(...args);
2157
+ };
2158
+ });
2159
+ return scope;
2160
+ }
2161
+ getVariablesScope() {
2162
+ return {
2163
+ eval: (path) => get(this.builderService.variables, path),
2164
+ };
2165
+ }
2166
+ async assignTriggers() {
2167
+ const node = this.node();
2168
+ // Check multiple possible locations for triggers
2169
+ const triggers = node.triggers || node.options?.['triggers'] || this.mergedOptions()?.triggers;
2170
+ if (!triggers) {
2171
+ return;
2172
+ }
2173
+ for (const trigger of triggers) {
2174
+ try {
2175
+ const event = await this.evaluateTrigger(trigger.event);
2176
+ if (event) {
2177
+ event.pipe(this.unsubscriber.takeUntilDestroy).subscribe(() => {
2178
+ const exec = async (action) => {
2179
+ if (!isEmpty(action) && isString(action)) {
2180
+ await this.evaluateAction(action);
2181
+ }
2182
+ };
2183
+ const actions = Array.isArray(trigger.action) ? trigger.action : [trigger.action];
2184
+ actions.forEach(async (a) => await exec(a));
2185
+ });
2186
+ }
2187
+ }
2188
+ catch (error) {
2189
+ // console.error('Error assigning trigger:', error);
2190
+ }
2191
+ }
2192
+ }
2193
+ async evaluateTrigger(templateExpression) {
2194
+ try {
2195
+ const scope = this.buildExpressionScope();
2196
+ const result = await this.expressionEvaluator.evaluate(templateExpression, scope);
2197
+ // Check if result is an Observable
2198
+ if (result && typeof result.subscribe === 'function') {
2199
+ return result;
2200
+ }
2201
+ else {
2202
+ return null;
2203
+ }
2204
+ }
2205
+ catch (error) {
2206
+ // console.error('Error evaluating trigger expression:', error);
2207
+ return null;
2208
+ }
2209
+ }
2210
+ async evaluateAction(templateExpression) {
2211
+ try {
2212
+ const scope = this.buildExpressionScope();
2213
+ await this.expressionEvaluator.evaluate(templateExpression, scope);
2214
+ }
2215
+ catch (error) {
2216
+ // console.error('Error evaluating action expression:', templateExpression, error);
2217
+ }
2218
+ }
2219
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXPWidgetRendererDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
2220
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.2.4", 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: [
2221
+ {
2222
+ provide: AXUnsubscriber,
2223
+ },
2224
+ ], exportAs: ["widgetRenderer"], usesOnChanges: true, ngImport: i0 }); }
2225
+ }
2226
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXPWidgetRendererDirective, decorators: [{
2227
+ type: Directive,
2228
+ args: [{
2229
+ selector: '[axp-widget-renderer]',
2230
+ exportAs: 'widgetRenderer',
2231
+ providers: [
2232
+ {
2233
+ provide: AXUnsubscriber,
2234
+ },
2235
+ ],
2236
+ standalone: false,
2237
+ }]
2238
+ }], ctorParameters: () => [] });
2239
+
2240
+ const COMPONENTS = [AXPWidgetContainerComponent, AXPWidgetColumnRendererComponent, AXPWidgetRendererDirective];
2241
+ class AXPWidgetCoreModule {
2242
+ static forRoot(config) {
2243
+ return {
2244
+ ngModule: AXPWidgetCoreModule,
2245
+ providers: [
2246
+ {
2247
+ provide: 'AXPWidgetCoreModuleFactory',
2248
+ useFactory: (registry) => async () => {
2249
+ await Promise.all(config?.widgets?.map((w) => Promise.resolve(registry.register(w))) || []);
2250
+ await Promise.all(config?.extendedWidgets?.map((ew) => Promise.resolve(registry.extend(ew.parentName, ew.widget))) || []);
2251
+ },
2252
+ deps: [AXPWidgetRegistryService],
2253
+ multi: true,
2254
+ },
2255
+ ],
2256
+ };
2257
+ }
2258
+ static forChild(config) {
2259
+ return {
2260
+ ngModule: AXPWidgetCoreModule,
2261
+ providers: [
2262
+ {
2263
+ provide: 'AXPWidgetCoreModuleFactory',
2264
+ useFactory: (registry) => async () => {
2265
+ await Promise.all(config?.widgets?.map((w) => Promise.resolve(registry.register(w))) || []);
2266
+ await Promise.all(config?.extendedWidgets?.map((ew) => Promise.resolve(registry.extend(ew.parentName, ew.widget))) || []);
2267
+ },
2268
+ deps: [AXPWidgetRegistryService],
2269
+ multi: true,
2270
+ },
2271
+ ],
2272
+ };
2273
+ }
2274
+ /**
2275
+ * @ignore
2276
+ */
2277
+ constructor(instances) {
2278
+ instances?.forEach((f) => {
2279
+ f();
2280
+ });
2281
+ }
2282
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXPWidgetCoreModule, deps: [{ token: 'AXPWidgetCoreModuleFactory', optional: true }], target: i0.ɵɵFactoryTarget.NgModule }); }
2283
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.2.4", ngImport: i0, type: AXPWidgetCoreModule, declarations: [AXPWidgetContainerComponent, AXPWidgetColumnRendererComponent, AXPWidgetRendererDirective], imports: [CommonModule, PortalModule, AXSkeletonModule, CommonModule, AXTranslationModule], exports: [AXPWidgetContainerComponent, AXPWidgetColumnRendererComponent, AXPWidgetRendererDirective] }); }
2284
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXPWidgetCoreModule, imports: [CommonModule, PortalModule, AXSkeletonModule, CommonModule, AXTranslationModule] }); }
2285
+ }
2286
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXPWidgetCoreModule, decorators: [{
2287
+ type: NgModule,
2288
+ args: [{
2289
+ imports: [CommonModule, PortalModule, AXSkeletonModule, CommonModule, AXTranslationModule],
2290
+ exports: [...COMPONENTS],
2291
+ declarations: [...COMPONENTS],
2292
+ }]
2293
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
2294
+ type: Optional
2295
+ }, {
2296
+ type: Inject,
2297
+ args: ['AXPWidgetCoreModuleFactory']
2298
+ }] }] });
2299
+
2300
+ class AXPPropertyEditorHelper {
2301
+ static expandShorthand(values) {
2302
+ switch (values.length) {
2303
+ case 1:
2304
+ return [values[0], values[0], values[0], values[0]];
2305
+ case 2:
2306
+ return [values[0], values[1], values[0], values[1]];
2307
+ case 3:
2308
+ return [values[0], values[1], values[2], values[1]];
2309
+ case 4:
2310
+ return values;
2311
+ default:
2312
+ throw new Error(`Invalid shorthand value count. Input: ${values}`);
2313
+ }
2314
+ }
2315
+ static condenseShorthand(values) {
2316
+ if (values.length !== 4) {
2317
+ throw new Error('Expected 4 values for condensation.');
2318
+ }
2319
+ if (values[0] === values[1] && values[1] === values[2] && values[2] === values[3]) {
2320
+ return `${values[0]}`;
2321
+ }
2322
+ else if (values[0] === values[2] && values[1] === values[3]) {
2323
+ return `${values[0]} ${values[1]}`;
2324
+ }
2325
+ else if (values[1] === values[3]) {
2326
+ return `${values[0]} ${values[1]} ${values[2]}`;
2327
+ }
2328
+ else {
2329
+ return `${values[0]} ${values[1]} ${values[2]} ${values[3]}`;
2330
+ }
2331
+ }
2332
+ static parseSides(input) {
2333
+ const values = this.expandShorthand(input.match(/(?:rgb\([^)]+\)|[^ ]+)/g)?.map((value) => value.trim()) || []);
2334
+ return { top: values[0], right: values[1], bottom: values[2], left: values[3] };
2335
+ }
2336
+ static parseSidesWithUnits(input) {
2337
+ const values = this.expandShorthand(input.match(/(?:rgb\([^)]+\)|[^ ]+)/g)?.map((value) => value.trim()) || []);
2338
+ return {
2339
+ top: AXPPropertyEditorHelper.getValueWithUnit(values[0]).value,
2340
+ right: AXPPropertyEditorHelper.getValueWithUnit(values[1]).value,
2341
+ bottom: AXPPropertyEditorHelper.getValueWithUnit(values[2]).value,
2342
+ left: AXPPropertyEditorHelper.getValueWithUnit(values[3]).value,
2343
+ };
2344
+ }
2345
+ static parseCorners(input) {
2346
+ const values = this.expandShorthand(input.split(' ').map((value) => value.trim()));
2347
+ return {
2348
+ 'top-left': AXPPropertyEditorHelper.getValueWithUnit(values[0]).value,
2349
+ 'top-right': AXPPropertyEditorHelper.getValueWithUnit(values[1]).value,
2350
+ 'bottom-left': AXPPropertyEditorHelper.getValueWithUnit(values[2]).value,
2351
+ 'bottom-right': AXPPropertyEditorHelper.getValueWithUnit(values[3]).value,
2352
+ };
2353
+ }
2354
+ static parseSpacingBox(input) {
2355
+ return {
2356
+ margin: this.parseSidesWithUnits(input.margin),
2357
+ padding: this.parseSidesWithUnits(input.padding),
2358
+ };
2359
+ }
2360
+ static parseBorderBox(input) {
2361
+ return {
2362
+ width: this.parseSidesWithUnits(input.width),
2363
+ radius: this.parseCorners(input.radius),
2364
+ color: this.parseSides(input.color),
2365
+ style: this.parseSides(input.style),
2366
+ };
2367
+ }
2368
+ static parseSpacingBoxReverse(input, units) {
2369
+ const format = (value, unit) => `${value}${unit}`;
2370
+ return {
2371
+ margin: AXPPropertyEditorHelper.condenseShorthand([
2372
+ format(input.margin.top, units.margin.top),
2373
+ format(input.margin.right, units.margin.right),
2374
+ format(input.margin.bottom, units.margin.bottom),
2375
+ format(input.margin.left, units.margin.left),
2376
+ ]),
2377
+ padding: AXPPropertyEditorHelper.condenseShorthand([
2378
+ format(input.padding.top, units.padding.top),
2379
+ format(input.padding.right, units.padding.right),
2380
+ format(input.padding.bottom, units.padding.bottom),
2381
+ format(input.padding.left, units.padding.left),
2382
+ ]),
2383
+ };
2384
+ }
2385
+ static parseBorderBoxReverse(input, units) {
2386
+ const format = (value, unit) => `${value}${unit}`;
2387
+ return {
2388
+ width: AXPPropertyEditorHelper.condenseShorthand([
2389
+ format(input.width.top, units.width.top),
2390
+ format(input.width.right, units.width.right),
2391
+ format(input.width.bottom, units.width.bottom),
2392
+ format(input.width.left, units.width.left),
2393
+ ]),
2394
+ radius: AXPPropertyEditorHelper.condenseShorthand([
2395
+ format(input.radius['top-left'], units.radius['top-left']),
2396
+ format(input.radius['top-right'], units.radius['top-right']),
2397
+ format(input.radius['bottom-right'], units.radius['bottom-right']),
2398
+ format(input.radius['bottom-left'], units.radius['bottom-left']),
2399
+ ]),
2400
+ color: AXPPropertyEditorHelper.condenseShorthand([
2401
+ `${input.color.top}${units.color.top}`,
2402
+ `${input.color.right}${units.color.right}`,
2403
+ `${input.color.bottom}${units.color.bottom}`,
2404
+ `${input.color.left}${units.color.left}`,
2405
+ ]),
2406
+ style: AXPPropertyEditorHelper.condenseShorthand([
2407
+ `${input.style.top}${units.style.top}`,
2408
+ `${input.style.right}${units.style.right}`,
2409
+ `${input.style.bottom}${units.style.bottom}`,
2410
+ `${input.style.left}${units.style.left}`,
2411
+ ]),
2412
+ };
2413
+ }
2414
+ static getValueWithUnit(input) {
2415
+ if (typeof input === 'number')
2416
+ return { value: input, unit: 'px' };
2417
+ if (input === 'auto')
2418
+ return { value: 0, unit: 'px' };
2419
+ const match = input.match(/^([0-9.]+)([a-z%]*)$/i);
2420
+ if (!match)
2421
+ throw new Error(`Invalid unit format: ${input}`);
2422
+ return { value: parseFloat(match[1]), unit: match[2] || '' };
2423
+ }
2424
+ static getValueFromUnit(value, unit) {
2425
+ return unit ? `${value}${unit}` : `${value}`;
2426
+ }
2427
+ static parseGap(gap) {
2428
+ const parts = gap.split(/\s+/);
2429
+ const match = parts[0].match(/^(\d+\.?\d*)([a-z%]+)$/);
2430
+ if (!match) {
2431
+ throw new Error('Invalid gap format');
2432
+ }
2433
+ const [, xValue, unit] = match;
2434
+ let yValue = parseFloat(xValue);
2435
+ if (parts.length === 2) {
2436
+ const secondMatch = parts[1].match(/^(\d+\.?\d*)[a-z%]+$/);
2437
+ if (!secondMatch) {
2438
+ throw new Error('Invalid gap format');
2439
+ }
2440
+ yValue = parseFloat(secondMatch[1]);
2441
+ }
2442
+ return {
2443
+ values: {
2444
+ x: parseFloat(xValue),
2445
+ y: yValue,
2446
+ },
2447
+ unit,
2448
+ };
2449
+ }
2450
+ static parseGridTemplate(gridTemplate) {
2451
+ const match = gridTemplate.match(/^repeat\((\d+),\s*(?:1fr|auto|minmax\([^)]*\))\)$/);
2452
+ if (!match) {
2453
+ throw new Error("Invalid grid template format. Expected 'repeat(N, 1fr|auto|minmax(...))'.");
2454
+ }
2455
+ return parseInt(match[1], 10);
2456
+ }
2457
+ static createGridTemplate(repetitionCount) {
2458
+ if (repetitionCount <= 0) {
2459
+ throw new Error('Repetition count must be a positive integer.');
2460
+ }
2461
+ return `repeat(${repetitionCount}, 1fr)`;
2462
+ }
2463
+ }
2464
+ function findNonEmptyBreakpoints(values) {
2465
+ const breakpoints = ['default', 'sm', 'md', 'lg', 'xl', '2xl', '3xl'];
2466
+ const nonEmptyBreakpoints = [];
2467
+ for (const breakpoint of breakpoints) {
2468
+ if (values[breakpoint] !== undefined) {
2469
+ nonEmptyBreakpoints.push(breakpoint);
2470
+ }
2471
+ }
2472
+ return nonEmptyBreakpoints;
2473
+ }
2474
+
2475
+ const AXP_WIDGETS_LAYOUT_CATEGORY = {
2476
+ name: 'layout',
2477
+ order: 1,
2478
+ title: 'Layout',
2479
+ };
2480
+ const AXP_WIDGETS_EDITOR_CATEGORY = {
2481
+ name: 'editor',
2482
+ order: 2,
2483
+ title: 'Editors',
2484
+ };
2485
+ const AXP_WIDGETS_ACTION_CATEGORY = {
2486
+ name: 'action',
2487
+ order: 3,
2488
+ title: 'Action',
2489
+ };
2490
+ const AXP_WIDGETS_ADVANCE_CATEGORY = {
2491
+ name: 'advance',
2492
+ order: 4,
2493
+ title: 'Advance',
2494
+ };
2495
+ const AXP_WIDGETS_CATEGORIES = [
2496
+ AXP_WIDGETS_LAYOUT_CATEGORY,
2497
+ AXP_WIDGETS_EDITOR_CATEGORY,
2498
+ AXP_WIDGETS_ACTION_CATEGORY,
2499
+ AXP_WIDGETS_ADVANCE_CATEGORY,
2500
+ ];
2501
+
2502
+ var AXPWidgetGroupEnum;
2503
+ (function (AXPWidgetGroupEnum) {
2504
+ AXPWidgetGroupEnum["FormElement"] = "form-element";
2505
+ AXPWidgetGroupEnum["DashboardWidget"] = "dashboard-widget";
2506
+ AXPWidgetGroupEnum["FormTemplate"] = "form-template";
2507
+ AXPWidgetGroupEnum["PropertyEditor"] = "property-editor";
2508
+ AXPWidgetGroupEnum["MetaData"] = "meta-data";
2509
+ AXPWidgetGroupEnum["SettingWidget"] = "setting-widget";
2510
+ AXPWidgetGroupEnum["EntityWidget"] = "entity-widget";
2511
+ })(AXPWidgetGroupEnum || (AXPWidgetGroupEnum = {}));
2512
+
2513
+ class AXPWidgetStandaloneRendererHostComponent {
2514
+ constructor() {
2515
+ this.mode = 'edit';
2516
+ }
2517
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXPWidgetStandaloneRendererHostComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2518
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.4", type: AXPWidgetStandaloneRendererHostComponent, isStandalone: true, selector: "axp-widget-standalone-renderer-host", inputs: { mode: "mode", node: "node", context: "context", functions: "functions" }, ngImport: i0, template: `
2519
+ <axp-widgets-container [context]="context" [functions]="functions">
2520
+ <ng-container axp-widget-renderer [mode]="mode" [node]="node"></ng-container>
2521
+ </axp-widgets-container>
2522
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: AXPWidgetCoreModule }, { kind: "component", type: AXPWidgetContainerComponent, selector: "axp-widgets-container", inputs: ["context", "functions"], outputs: ["onContextChanged"] }, { kind: "directive", type: AXPWidgetRendererDirective, selector: "[axp-widget-renderer]", inputs: ["parentNode", "index", "mode", "node"], outputs: ["onOptionsChanged", "onValueChanged"], exportAs: ["widgetRenderer"] }] }); }
2523
+ }
2524
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXPWidgetStandaloneRendererHostComponent, decorators: [{
2525
+ type: Component,
2526
+ args: [{
2527
+ selector: 'axp-widget-standalone-renderer-host',
2528
+ template: `
2529
+ <axp-widgets-container [context]="context" [functions]="functions">
2530
+ <ng-container axp-widget-renderer [mode]="mode" [node]="node"></ng-container>
2531
+ </axp-widgets-container>
2532
+ `,
2533
+ standalone: true,
2534
+ imports: [AXPWidgetCoreModule]
2535
+ }]
2536
+ }], propDecorators: { mode: [{
2537
+ type: Input
2538
+ }], node: [{
2539
+ type: Input
2540
+ }], context: [{
2541
+ type: Input
2542
+ }], functions: [{
2543
+ type: Input
2544
+ }] } });
2545
+
2546
+ const LAYOUT_WIDGET_RENDER_ENGINE = new InjectionToken('LAYOUT_WIDGET_RENDER_ENGINE');
2547
+ class WidgetCoreRendererEngine {
2548
+ constructor(appRef, env) {
2549
+ this.appRef = appRef;
2550
+ this.env = env;
2551
+ }
2552
+ render(node, target, context, mode = 'edit') {
2553
+ const compRef = createComponent(AXPWidgetStandaloneRendererHostComponent, { environmentInjector: this.env });
2554
+ compRef.setInput('mode', mode);
2555
+ compRef.setInput('node', node);
2556
+ if (context) {
2557
+ compRef.setInput('context', context);
2558
+ }
2559
+ this.appRef.attachView(compRef.hostView);
2560
+ target.appendChild(compRef.location.nativeElement);
2561
+ return {
2562
+ element: compRef.location.nativeElement,
2563
+ destroy: () => {
2564
+ try {
2565
+ this.appRef.detachView(compRef.hostView);
2566
+ }
2567
+ catch { }
2568
+ compRef.destroy();
2569
+ },
2570
+ };
2571
+ }
2572
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: WidgetCoreRendererEngine, deps: [{ token: i0.ApplicationRef }, { token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable }); }
2573
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: WidgetCoreRendererEngine, providedIn: 'root' }); }
2574
+ }
2575
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: WidgetCoreRendererEngine, decorators: [{
2576
+ type: Injectable,
2577
+ args: [{ providedIn: 'root' }]
2578
+ }], ctorParameters: () => [{ type: i0.ApplicationRef }, { type: i0.EnvironmentInjector }] });
2579
+ class SimpleDomRendererEngine {
2580
+ render(node, target) {
2581
+ const element = this.createElement(node);
2582
+ target.appendChild(element);
2583
+ return {
2584
+ element,
2585
+ destroy: () => {
2586
+ if (element.parentElement) {
2587
+ element.parentElement.removeChild(element);
2588
+ }
2589
+ },
2590
+ };
2591
+ }
2592
+ createElement(node) {
2593
+ const container = document.createElement('div');
2594
+ container.className = `axp-widget axp-widget-${node.type}`;
2595
+ switch (String(node.type)) {
2596
+ case 'text-block-layout':
2597
+ case 'static-text':
2598
+ this.renderText(container, node);
2599
+ break;
2600
+ case 'tag':
2601
+ this.renderTag(container, node);
2602
+ break;
2603
+ case 'text-editor':
2604
+ this.renderTextBox(container, node);
2605
+ break;
2606
+ default:
2607
+ this.renderGeneric(container, node);
2608
+ break;
2609
+ }
2610
+ return container;
2611
+ }
2612
+ renderText(container, node) {
2613
+ const anyNode = node;
2614
+ const content = (anyNode.options && (anyNode.options.content || anyNode.options.label)) || '';
2615
+ container.innerHTML = typeof content === 'string' ? content : String(content);
2616
+ }
2617
+ renderTag(container, node) {
2618
+ const label = node.options?.label || 'Tag';
2619
+ const tone = node.options?.tone || 'primary';
2620
+ container.innerHTML = `<span class="tag tag-${tone}" style="
2621
+ display: inline-block;
2622
+ padding: 4px 12px;
2623
+ border-radius: 12px;
2624
+ font-size: 12px;
2625
+ font-weight: 500;
2626
+ background: ${tone === 'success' ? '#d4edda' : '#cce5ff'};
2627
+ color: ${tone === 'success' ? '#155724' : '#004085'};
2628
+ border: 1px solid ${tone === 'success' ? '#c3e6cb' : '#b8daff'};
2629
+ ">${label}</span>`;
2630
+ }
2631
+ renderTextBox(container, node) {
2632
+ const placeholder = node.options?.placeholder || '';
2633
+ const input = document.createElement('input');
2634
+ input.type = 'text';
2635
+ input.placeholder = placeholder;
2636
+ input.style.cssText = `
2637
+ width: 100%;
2638
+ padding: 8px 12px;
2639
+ border: 1px solid #ddd;
2640
+ border-radius: 4px;
2641
+ font-size: 14px;
2642
+ `;
2643
+ container.appendChild(input);
2644
+ }
2645
+ renderGeneric(container, node) {
2646
+ const anyNode = node;
2647
+ if (anyNode.options?.content) {
2648
+ container.innerHTML = anyNode.options.content;
2649
+ }
2650
+ else {
2651
+ container.textContent = `[${String(node.type)}]`;
2652
+ }
2653
+ }
2654
+ }
2655
+ function provideWidgetCoreRenderer() {
2656
+ return [{ provide: LAYOUT_WIDGET_RENDER_ENGINE, useClass: WidgetCoreRendererEngine }];
2657
+ }
2658
+ function provideSimpleDomRenderer() {
2659
+ return [{ provide: LAYOUT_WIDGET_RENDER_ENGINE, useClass: SimpleDomRendererEngine }];
2660
+ }
2661
+
2662
+ /**
2663
+ * Generated bundle index. Do not edit.
2664
+ */
2665
+
2666
+ export { AXPBaseWidgetComponent, AXPBlockBaseLayoutWidgetComponent, AXPBoxModelLayoutWidgetComponent, AXPColumnWidgetComponent, AXPDataListWidgetComponent, AXPFlexBaseLayoutWidgetComponent, AXPFlexItemBaseLayoutWidgetComponent, AXPGridBaseLayoutWidgetComponent, AXPGridItemBaseLayoutWidgetComponent, AXPInlineBaseLayoutWidgetComponent, AXPLayoutBaseWidgetComponent, AXPPageStatus, AXPPropertyEditorHelper, AXPTableBaseLayoutWidgetComponent, AXPTableItemBaseLayoutWidgetComponent, AXPTableItemOpsBaseLayoutWidgetComponent, AXPValueWidgetComponent, AXPWidgetColumnRendererComponent, AXPWidgetContainerComponent, AXPWidgetCoreContextChangeEvent, AXPWidgetCoreContextStore, AXPWidgetCoreElement, AXPWidgetCoreModule, AXPWidgetCoreService, AXPWidgetGroupEnum, AXPWidgetRegistryService, AXPWidgetRendererDirective, AXPWidgetStandaloneRendererHostComponent, 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, LAYOUT_WIDGET_RENDER_ENGINE, SimpleDomRendererEngine, WidgetCoreRendererEngine, cloneProperty, createBooleanProperty, createNumberProperty, createSelectProperty, createStringProperty, findNonEmptyBreakpoints, provideSimpleDomRenderer, provideWidgetCoreRenderer };
2667
+ //# sourceMappingURL=acorex-platform-layout-widget-core.mjs.map