@object-ui/core 4.2.1 → 4.3.0
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/CHANGELOG.md
CHANGED
|
@@ -157,7 +157,7 @@ export type NavigationHandler = (url: string, options?: {
|
|
|
157
157
|
* for collecting ActionParam values before action execution.
|
|
158
158
|
* Returns collected values, or null if cancelled.
|
|
159
159
|
*/
|
|
160
|
-
export type ParamCollectionHandler = (params: ActionParamDef[]) => Promise<Record<string, any> | null>;
|
|
160
|
+
export type ParamCollectionHandler = (params: ActionParamDef[], action?: ActionDef) => Promise<Record<string, any> | null>;
|
|
161
161
|
/**
|
|
162
162
|
* ActionParam definition accepted by the runner.
|
|
163
163
|
* Compatible with @objectstack/spec ActionParam.
|
|
@@ -169,13 +169,18 @@ export class ActionRunner {
|
|
|
169
169
|
: (Array.isArray(action.params) ? action.params : undefined);
|
|
170
170
|
if (paramDefs && paramDefs.length > 0) {
|
|
171
171
|
if (this.paramCollectionHandler) {
|
|
172
|
-
const collected = await this.paramCollectionHandler(paramDefs);
|
|
172
|
+
const collected = await this.paramCollectionHandler(paramDefs, action);
|
|
173
173
|
if (collected === null) {
|
|
174
174
|
return { success: false, error: 'Action cancelled by user (params)' };
|
|
175
175
|
}
|
|
176
176
|
// Merge collected params into action.params as a values map for downstream consumers.
|
|
177
|
-
//
|
|
178
|
-
|
|
177
|
+
// Preserve any pre-attached row context (`_rowRecord`) used by list_item
|
|
178
|
+
// actions so downstream handlers (apiHandler) can inject the row id.
|
|
179
|
+
const priorParams = Array.isArray(action.params) ? {} : (action.params || {});
|
|
180
|
+
const rowRecord = priorParams._rowRecord;
|
|
181
|
+
action.params = { ...priorParams, ...collected };
|
|
182
|
+
if (rowRecord !== undefined)
|
|
183
|
+
action.params._rowRecord = rowRecord;
|
|
179
184
|
}
|
|
180
185
|
}
|
|
181
186
|
// Check for a registered custom handler first
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@object-ui/core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "MIT",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@objectstack/spec": "^4.0.5",
|
|
29
29
|
"lodash": "^4.18.1",
|
|
30
30
|
"zod": "^4.4.3",
|
|
31
|
-
"@object-ui/types": "4.
|
|
31
|
+
"@object-ui/types": "4.3.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"typescript": "^6.0.3",
|