@acorex/platform 21.0.0-next.3 → 21.0.0-next.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/auth/index.d.ts +6 -6
- package/common/index.d.ts +10 -5
- package/core/index.d.ts +55 -315
- package/fesm2022/acorex-platform-auth.mjs +18 -22
- package/fesm2022/acorex-platform-auth.mjs.map +1 -1
- package/fesm2022/acorex-platform-common.mjs +62 -38
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-core.mjs +150 -246
- package/fesm2022/acorex-platform-core.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-builder.mjs +11 -2
- package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-components.mjs +3 -3
- package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-entity.mjs +67 -83
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-widget-core.mjs +110 -33
- package/fesm2022/acorex-platform-layout-widget-core.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-widgets.mjs +19 -11
- package/fesm2022/acorex-platform-layout-widgets.mjs.map +1 -1
- package/fesm2022/{acorex-platform-themes-default-entity-master-list-view.component-DyDa_hyd.mjs → acorex-platform-themes-default-entity-master-list-view.component-DfJEx_bs.mjs} +2 -2
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-DfJEx_bs.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default.mjs +2 -2
- package/fesm2022/acorex-platform-workflow.mjs +1268 -1699
- package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
- package/layout/builder/index.d.ts +6 -0
- package/layout/entity/index.d.ts +2 -9
- package/layout/widget-core/index.d.ts +42 -4
- package/package.json +5 -5
- package/workflow/index.d.ts +650 -1074
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-DyDa_hyd.mjs.map +0 -1
|
@@ -1704,7 +1704,6 @@ class AXPWidgetRendererDirective {
|
|
|
1704
1704
|
this.applyOptions();
|
|
1705
1705
|
}
|
|
1706
1706
|
await this.updateVisibility();
|
|
1707
|
-
await this.updateValueBasedOnFormula();
|
|
1708
1707
|
}
|
|
1709
1708
|
else if (changed.path && this.isRelevantContextChange(changed.path)) {
|
|
1710
1709
|
// console.log(`🎯 [${this.node().type}] Context change detected: ${changed.path}`);
|
|
@@ -1788,14 +1787,6 @@ class AXPWidgetRendererDirective {
|
|
|
1788
1787
|
// console.log(`🔧 [${this.node().type}] Options updated (${optionsTime.toFixed(2)}ms)`);
|
|
1789
1788
|
this.applyOptions();
|
|
1790
1789
|
}
|
|
1791
|
-
// Check formulas for any of the changed paths
|
|
1792
|
-
const formulaStartTime = performance.now();
|
|
1793
|
-
const formulaNeedsUpdate = paths.some((path) => this.checkFormulaForUpdate(this.node().formula, path));
|
|
1794
|
-
if (formulaNeedsUpdate) {
|
|
1795
|
-
// console.log(`🧮 [${this.node().type}] Formula needs update`);
|
|
1796
|
-
await this.updateValueBasedOnFormula();
|
|
1797
|
-
}
|
|
1798
|
-
const formulaTime = performance.now() - formulaStartTime;
|
|
1799
1790
|
// Check visibility for any of the changed paths
|
|
1800
1791
|
const visibilityStartTime = performance.now();
|
|
1801
1792
|
const visibilityNeedsUpdate = paths.some((path) => this.hasVisibilityDependency(path));
|
|
@@ -1810,7 +1801,7 @@ class AXPWidgetRendererDirective {
|
|
|
1810
1801
|
});
|
|
1811
1802
|
const totalTime = performance.now() - startTime;
|
|
1812
1803
|
// console.log(
|
|
1813
|
-
// `✅ [${this.node().type}] Batch processing completed in ${totalTime.toFixed(2)}ms (options: ${optionsTime.toFixed(2)}ms,
|
|
1804
|
+
// `✅ [${this.node().type}] Batch processing completed in ${totalTime.toFixed(2)}ms (options: ${optionsTime.toFixed(2)}ms, visibility: ${visibilityTime.toFixed(2)}ms)`,
|
|
1814
1805
|
// );
|
|
1815
1806
|
}
|
|
1816
1807
|
//#endregion
|
|
@@ -1833,11 +1824,7 @@ class AXPWidgetRendererDirective {
|
|
|
1833
1824
|
if (this.hasExpressionDependency(changedPath)) {
|
|
1834
1825
|
return true;
|
|
1835
1826
|
}
|
|
1836
|
-
// 5.
|
|
1837
|
-
if (node.formula && this.checkFormulaForUpdate(node.formula, changedPath)) {
|
|
1838
|
-
return true;
|
|
1839
|
-
}
|
|
1840
|
-
// 6. Trigger dependency check - if widget has triggers that depend on this path
|
|
1827
|
+
// 5. Trigger dependency check - if widget has triggers that depend on this path
|
|
1841
1828
|
if (this.hasTriggerDependency(changedPath)) {
|
|
1842
1829
|
return true;
|
|
1843
1830
|
}
|
|
@@ -2159,7 +2146,6 @@ class AXPWidgetRendererDirective {
|
|
|
2159
2146
|
this.instance?.onValueChanged?.pipe(this.unsubscriber.takeUntilDestroy).subscribe((c) => {
|
|
2160
2147
|
this.onValueChanged.emit({ sender: this, widget: c.sender });
|
|
2161
2148
|
});
|
|
2162
|
-
await this.updateValueBasedOnFormula();
|
|
2163
2149
|
await this.updateVisibility();
|
|
2164
2150
|
await this.assignTriggers();
|
|
2165
2151
|
//
|
|
@@ -2234,16 +2220,6 @@ class AXPWidgetRendererDirective {
|
|
|
2234
2220
|
return !isEqual(newOptions, this.lastAppliedOptions);
|
|
2235
2221
|
}
|
|
2236
2222
|
// Removed deepCloneValue method - now using Lodash cloneDeep
|
|
2237
|
-
checkFormulaForUpdate(formula, path) {
|
|
2238
|
-
if (formula) {
|
|
2239
|
-
const regex = /context\.eval\('([^']+)'\)/g;
|
|
2240
|
-
const matches = formula.match(regex);
|
|
2241
|
-
const nodes = matches ? matches.map((match) => match.match(/'([^']+)'/)[1]) : [];
|
|
2242
|
-
return nodes.includes(path);
|
|
2243
|
-
}
|
|
2244
|
-
else
|
|
2245
|
-
return false;
|
|
2246
|
-
}
|
|
2247
2223
|
preprocessAndInitialOptions(obj, pathPrefix = '') {
|
|
2248
2224
|
if (!obj) {
|
|
2249
2225
|
return;
|
|
@@ -2351,12 +2327,6 @@ class AXPWidgetRendererDirective {
|
|
|
2351
2327
|
// );
|
|
2352
2328
|
return changedUpdates.length;
|
|
2353
2329
|
}
|
|
2354
|
-
async updateValueBasedOnFormula() {
|
|
2355
|
-
if (this.node().formula) {
|
|
2356
|
-
const value = await this.evaluateExpression(this.node().formula);
|
|
2357
|
-
this.instance.setValue(value);
|
|
2358
|
-
}
|
|
2359
|
-
}
|
|
2360
2330
|
async updateVisibility() {
|
|
2361
2331
|
const node = this.node();
|
|
2362
2332
|
const visibility = node.options?.['visible'] || this.mergedOptions()?.visible;
|
|
@@ -2842,6 +2812,113 @@ function findNonEmptyBreakpoints(values) {
|
|
|
2842
2812
|
return nonEmptyBreakpoints;
|
|
2843
2813
|
}
|
|
2844
2814
|
|
|
2815
|
+
//#region ---- Imports ----
|
|
2816
|
+
//#endregion
|
|
2817
|
+
//#region ---- Helper Class ----
|
|
2818
|
+
/**
|
|
2819
|
+
* Helper class for serializing and deserializing AXPWidgetNode to/from JSON
|
|
2820
|
+
*/
|
|
2821
|
+
class AXPWidgetSerializationHelper {
|
|
2822
|
+
/**
|
|
2823
|
+
* Removes non-serializable properties from widget node
|
|
2824
|
+
* @param node - The widget node to clean
|
|
2825
|
+
* @param options - Serialization options
|
|
2826
|
+
* @returns Cleaned widget node ready for JSON serialization
|
|
2827
|
+
*/
|
|
2828
|
+
static cleanNode(node, options = {}) {
|
|
2829
|
+
const { removeMeta = true, removeFunctions = true } = options;
|
|
2830
|
+
// Deep clone to avoid mutating original
|
|
2831
|
+
const cleaned = cloneDeep(node);
|
|
2832
|
+
// Remove meta property if requested
|
|
2833
|
+
if (removeMeta && 'meta' in cleaned) {
|
|
2834
|
+
delete cleaned.meta;
|
|
2835
|
+
}
|
|
2836
|
+
// Remove functions from options, triggers, and valueTransforms
|
|
2837
|
+
if (removeFunctions) {
|
|
2838
|
+
this.removeFunctions(cleaned);
|
|
2839
|
+
}
|
|
2840
|
+
// Recursively clean children
|
|
2841
|
+
if (cleaned.children && Array.isArray(cleaned.children)) {
|
|
2842
|
+
cleaned.children = cleaned.children.map((child) => this.cleanNode(child, options));
|
|
2843
|
+
}
|
|
2844
|
+
return cleaned;
|
|
2845
|
+
}
|
|
2846
|
+
/**
|
|
2847
|
+
* Recursively removes functions from object properties
|
|
2848
|
+
*/
|
|
2849
|
+
static removeFunctions(obj) {
|
|
2850
|
+
if (obj === null || obj === undefined) {
|
|
2851
|
+
return;
|
|
2852
|
+
}
|
|
2853
|
+
if (Array.isArray(obj)) {
|
|
2854
|
+
obj.forEach((item) => this.removeFunctions(item));
|
|
2855
|
+
return;
|
|
2856
|
+
}
|
|
2857
|
+
if (typeof obj === 'object') {
|
|
2858
|
+
for (const key in obj) {
|
|
2859
|
+
if (typeof obj[key] === 'function') {
|
|
2860
|
+
delete obj[key];
|
|
2861
|
+
}
|
|
2862
|
+
else if (typeof obj[key] === 'object') {
|
|
2863
|
+
this.removeFunctions(obj[key]);
|
|
2864
|
+
}
|
|
2865
|
+
}
|
|
2866
|
+
}
|
|
2867
|
+
}
|
|
2868
|
+
/**
|
|
2869
|
+
* Converts AXPWidgetNode to JSON string
|
|
2870
|
+
* @param node - The widget node to serialize
|
|
2871
|
+
* @param options - Serialization options
|
|
2872
|
+
* @returns JSON string representation of the widget node
|
|
2873
|
+
*/
|
|
2874
|
+
static toJson(node, options = {}) {
|
|
2875
|
+
const { pretty = false, ...cleanOptions } = options;
|
|
2876
|
+
const cleaned = this.cleanNode(node, cleanOptions);
|
|
2877
|
+
if (pretty) {
|
|
2878
|
+
return JSON.stringify(cleaned, null, 2);
|
|
2879
|
+
}
|
|
2880
|
+
return JSON.stringify(cleaned);
|
|
2881
|
+
}
|
|
2882
|
+
/**
|
|
2883
|
+
* Converts JSON string to AXPWidgetNode
|
|
2884
|
+
* @param json - JSON string to deserialize
|
|
2885
|
+
* @returns Parsed AXPWidgetNode object
|
|
2886
|
+
* @throws Error if JSON is invalid or doesn't match AXPWidgetNode structure
|
|
2887
|
+
*/
|
|
2888
|
+
static fromJson(json) {
|
|
2889
|
+
try {
|
|
2890
|
+
const parsed = JSON.parse(json);
|
|
2891
|
+
// Basic validation - ensure it has at least a type property
|
|
2892
|
+
if (!parsed || typeof parsed !== 'object') {
|
|
2893
|
+
throw new Error('Invalid JSON: Expected an object');
|
|
2894
|
+
}
|
|
2895
|
+
if (!parsed.type) {
|
|
2896
|
+
throw new Error('Invalid AXPWidgetNode: Missing required property "type"');
|
|
2897
|
+
}
|
|
2898
|
+
// Recursively validate and parse children if they exist
|
|
2899
|
+
if (parsed.children && Array.isArray(parsed.children)) {
|
|
2900
|
+
parsed.children = parsed.children.map((child) => this.fromJson(JSON.stringify(child)));
|
|
2901
|
+
}
|
|
2902
|
+
return parsed;
|
|
2903
|
+
}
|
|
2904
|
+
catch (error) {
|
|
2905
|
+
if (error instanceof SyntaxError) {
|
|
2906
|
+
throw new Error(`Invalid JSON string: ${error.message}`);
|
|
2907
|
+
}
|
|
2908
|
+
throw error;
|
|
2909
|
+
}
|
|
2910
|
+
}
|
|
2911
|
+
/**
|
|
2912
|
+
* Removes meta property from widget node (similar to designer service)
|
|
2913
|
+
* @param node - The widget node to process
|
|
2914
|
+
* @returns Widget node without meta property
|
|
2915
|
+
*/
|
|
2916
|
+
static removeMeta(node) {
|
|
2917
|
+
return this.cleanNode(node, { removeMeta: true, removeFunctions: false });
|
|
2918
|
+
}
|
|
2919
|
+
}
|
|
2920
|
+
//#endregion
|
|
2921
|
+
|
|
2845
2922
|
const AXP_WIDGETS_LAYOUT_CATEGORY = {
|
|
2846
2923
|
name: 'layout',
|
|
2847
2924
|
order: 1,
|
|
@@ -2885,5 +2962,5 @@ var AXPWidgetGroupEnum;
|
|
|
2885
2962
|
* Generated bundle index. Do not edit.
|
|
2886
2963
|
*/
|
|
2887
2964
|
|
|
2888
|
-
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, AXPWidgetStatus, AXPWidgetsCatalog, AXP_WIDGETS_ACTION_CATEGORY, AXP_WIDGETS_ADVANCE_CATEGORY, AXP_WIDGETS_CATEGORIES, AXP_WIDGETS_EDITOR_CATEGORY, AXP_WIDGETS_LAYOUT_CATEGORY, AXP_WIDGET_COLUMN_TOKEN, AXP_WIDGET_TOKEN, cloneProperty, createBooleanProperty, createNumberProperty, createSelectProperty, createStringProperty, findNonEmptyBreakpoints };
|
|
2965
|
+
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, AXPWidgetSerializationHelper, AXPWidgetStatus, AXPWidgetsCatalog, AXP_WIDGETS_ACTION_CATEGORY, AXP_WIDGETS_ADVANCE_CATEGORY, AXP_WIDGETS_CATEGORIES, AXP_WIDGETS_EDITOR_CATEGORY, AXP_WIDGETS_LAYOUT_CATEGORY, AXP_WIDGET_COLUMN_TOKEN, AXP_WIDGET_TOKEN, cloneProperty, createBooleanProperty, createNumberProperty, createSelectProperty, createStringProperty, findNonEmptyBreakpoints };
|
|
2889
2966
|
//# sourceMappingURL=acorex-platform-layout-widget-core.mjs.map
|