@acorex/platform 20.7.7 → 20.7.9
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/common/index.d.ts +8 -4
- package/fesm2022/acorex-platform-common.mjs +5 -1
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-builder.mjs +31 -4
- package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
- package/fesm2022/{acorex-platform-layout-components-binding-expression-editor-popup.component-ZnTG7wlJ.mjs → acorex-platform-layout-components-binding-expression-editor-popup.component-Cb6Lk4Ch.mjs} +5 -5
- package/fesm2022/{acorex-platform-layout-components-binding-expression-editor-popup.component-ZnTG7wlJ.mjs.map → acorex-platform-layout-components-binding-expression-editor-popup.component-Cb6Lk4Ch.mjs.map} +1 -1
- package/fesm2022/acorex-platform-layout-components.mjs +913 -36
- package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-entity.mjs +462 -771
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-widget-core.mjs +1 -0
- package/fesm2022/acorex-platform-layout-widget-core.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-widgets.mjs +105 -192
- package/fesm2022/acorex-platform-layout-widgets.mjs.map +1 -1
- package/layout/builder/index.d.ts +25 -14
- package/layout/components/index.d.ts +295 -2
- package/layout/entity/index.d.ts +36 -57
- package/layout/widgets/index.d.ts +32 -31
- package/package.json +5 -5
|
@@ -1481,6 +1481,10 @@ class DialogContainerBuilder {
|
|
|
1481
1481
|
}
|
|
1482
1482
|
return this;
|
|
1483
1483
|
}
|
|
1484
|
+
onAction(handler) {
|
|
1485
|
+
(this.dialogState.dialogOptions ??= {}).onAction = handler;
|
|
1486
|
+
return this;
|
|
1487
|
+
}
|
|
1484
1488
|
addCustomAction(action) {
|
|
1485
1489
|
// Add to actions based on position
|
|
1486
1490
|
const position = action.position || 'suffix';
|
|
@@ -1538,6 +1542,7 @@ class DialogContainerBuilder {
|
|
|
1538
1542
|
context: initialContext,
|
|
1539
1543
|
definition: dialogNode,
|
|
1540
1544
|
actions: this.dialogState.actions,
|
|
1545
|
+
onAction: this.dialogState.dialogOptions?.onAction,
|
|
1541
1546
|
};
|
|
1542
1547
|
// The Promise resolves when user clicks an action button
|
|
1543
1548
|
return new Promise(async (resolve) => {
|
|
@@ -1550,7 +1555,6 @@ class DialogContainerBuilder {
|
|
|
1550
1555
|
data: {
|
|
1551
1556
|
config: dialogConfig,
|
|
1552
1557
|
callBack: (result) => {
|
|
1553
|
-
// Resolve with the dialog reference when user clicks an action
|
|
1554
1558
|
resolve(result);
|
|
1555
1559
|
},
|
|
1556
1560
|
},
|
|
@@ -2249,16 +2253,39 @@ class AXPDialogRendererComponent extends AXBasePageComponent {
|
|
|
2249
2253
|
return;
|
|
2250
2254
|
}
|
|
2251
2255
|
}
|
|
2256
|
+
const context = this.context();
|
|
2257
|
+
const onAction = this.config?.onAction;
|
|
2258
|
+
if (onAction) {
|
|
2259
|
+
const dialogRef = {
|
|
2260
|
+
close: (res) => this.close(res),
|
|
2261
|
+
context: () => this.context(),
|
|
2262
|
+
action: () => cmd ?? undefined,
|
|
2263
|
+
setLoading: (loading) => this.isDialogLoading.set(loading),
|
|
2264
|
+
};
|
|
2265
|
+
try {
|
|
2266
|
+
this.isDialogLoading.set(true);
|
|
2267
|
+
const result = await Promise.resolve(onAction(dialogRef));
|
|
2268
|
+
this.callBack(result);
|
|
2269
|
+
this.close(result);
|
|
2270
|
+
}
|
|
2271
|
+
catch {
|
|
2272
|
+
// Handler threw: stay open for retry, actions remain clickable
|
|
2273
|
+
}
|
|
2274
|
+
finally {
|
|
2275
|
+
this.isDialogLoading.set(false);
|
|
2276
|
+
}
|
|
2277
|
+
return;
|
|
2278
|
+
}
|
|
2252
2279
|
// Fallback: treat as regular dialog action (cancel/confirm/custom)
|
|
2253
|
-
const result = { context
|
|
2280
|
+
const result = { context, action: cmd };
|
|
2254
2281
|
this.dialogResult = result;
|
|
2255
2282
|
if (this.data) {
|
|
2256
2283
|
this.data.context = result.context;
|
|
2257
2284
|
this.data.action = result.action;
|
|
2258
2285
|
}
|
|
2259
2286
|
this.callBack({
|
|
2260
|
-
close: (
|
|
2261
|
-
this.close(
|
|
2287
|
+
close: (res) => {
|
|
2288
|
+
this.close(res);
|
|
2262
2289
|
},
|
|
2263
2290
|
context: () => this.context(),
|
|
2264
2291
|
action: () => result.action,
|