@nubitio/crud 0.5.9 → 0.5.10
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/dist/index.d.cts +12 -2
- package/dist/index.d.mts +12 -2
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -80,17 +80,27 @@ type CompareRule = {
|
|
|
80
80
|
message?: string;
|
|
81
81
|
};
|
|
82
82
|
};
|
|
83
|
+
/**
|
|
84
|
+
* What the form engine actually passes to custom/async callbacks
|
|
85
|
+
* (NativeFormView calls `validationCallback({ value, data })`).
|
|
86
|
+
*/
|
|
87
|
+
interface ValidationCallbackContext {
|
|
88
|
+
/** Current value of the field being validated. */
|
|
89
|
+
value: unknown;
|
|
90
|
+
/** Full form data snapshot, for cross-field rules. */
|
|
91
|
+
data: Record<string, unknown>;
|
|
92
|
+
}
|
|
83
93
|
type CustomRule = {
|
|
84
94
|
type: 'custom';
|
|
85
95
|
options: {
|
|
86
|
-
validationCallback: (
|
|
96
|
+
validationCallback: (ctx: ValidationCallbackContext) => boolean;
|
|
87
97
|
message?: string;
|
|
88
98
|
};
|
|
89
99
|
};
|
|
90
100
|
type AsyncRule = {
|
|
91
101
|
type: 'async';
|
|
92
102
|
options: {
|
|
93
|
-
validationCallback: (
|
|
103
|
+
validationCallback: (ctx: ValidationCallbackContext) => Promise<boolean>;
|
|
94
104
|
message?: string;
|
|
95
105
|
};
|
|
96
106
|
};
|
package/dist/index.d.mts
CHANGED
|
@@ -80,17 +80,27 @@ type CompareRule = {
|
|
|
80
80
|
message?: string;
|
|
81
81
|
};
|
|
82
82
|
};
|
|
83
|
+
/**
|
|
84
|
+
* What the form engine actually passes to custom/async callbacks
|
|
85
|
+
* (NativeFormView calls `validationCallback({ value, data })`).
|
|
86
|
+
*/
|
|
87
|
+
interface ValidationCallbackContext {
|
|
88
|
+
/** Current value of the field being validated. */
|
|
89
|
+
value: unknown;
|
|
90
|
+
/** Full form data snapshot, for cross-field rules. */
|
|
91
|
+
data: Record<string, unknown>;
|
|
92
|
+
}
|
|
83
93
|
type CustomRule = {
|
|
84
94
|
type: 'custom';
|
|
85
95
|
options: {
|
|
86
|
-
validationCallback: (
|
|
96
|
+
validationCallback: (ctx: ValidationCallbackContext) => boolean;
|
|
87
97
|
message?: string;
|
|
88
98
|
};
|
|
89
99
|
};
|
|
90
100
|
type AsyncRule = {
|
|
91
101
|
type: 'async';
|
|
92
102
|
options: {
|
|
93
|
-
validationCallback: (
|
|
103
|
+
validationCallback: (ctx: ValidationCallbackContext) => Promise<boolean>;
|
|
94
104
|
message?: string;
|
|
95
105
|
};
|
|
96
106
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nubitio/crud",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Declarative CRUD engine with field DSL, forms, datagrids, RBAC, conditional logic and pluggable adapters (Hydra/REST).",
|
|
6
6
|
"license": "MIT",
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"react-dom": "^19.0.0",
|
|
57
57
|
"react-i18next": "^14.0.0",
|
|
58
58
|
"react-router-dom": "^6.0.0",
|
|
59
|
-
"@nubitio/core": "^0.5.
|
|
60
|
-
"@nubitio/ui": "^0.5.
|
|
59
|
+
"@nubitio/core": "^0.5.10",
|
|
60
|
+
"@nubitio/ui": "^0.5.10"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"react-dropzone": "^15.0.0"
|