@abgov/jsonforms-components 1.26.0 → 1.26.1
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/index.esm.js +26 -1
- package/package.json +1 -1
- package/src/lib/util/inputControlUtils.d.ts +5 -0
package/index.esm.js
CHANGED
|
@@ -2635,6 +2635,25 @@ const onChangeForDateControl = props => {
|
|
|
2635
2635
|
}
|
|
2636
2636
|
}
|
|
2637
2637
|
};
|
|
2638
|
+
/**
|
|
2639
|
+
* Helper function to process onChange event for Input controls.
|
|
2640
|
+
* @param props - EventChangeControlProps
|
|
2641
|
+
*/
|
|
2642
|
+
const onChangeForInputControl = props => {
|
|
2643
|
+
const {
|
|
2644
|
+
value
|
|
2645
|
+
} = props;
|
|
2646
|
+
const {
|
|
2647
|
+
controlProps
|
|
2648
|
+
} = props;
|
|
2649
|
+
const {
|
|
2650
|
+
handleChange,
|
|
2651
|
+
path
|
|
2652
|
+
} = controlProps;
|
|
2653
|
+
if (value && value !== null) {
|
|
2654
|
+
handleChange(path, value);
|
|
2655
|
+
}
|
|
2656
|
+
};
|
|
2638
2657
|
/**
|
|
2639
2658
|
* Helper function to process onChange event for Date controls.
|
|
2640
2659
|
* @param props - EventChangeControlProps
|
|
@@ -3438,7 +3457,13 @@ const GoAInputText = props => {
|
|
|
3438
3457
|
// Don't use handleChange in the onChange event, use the keyPress or onBlur.
|
|
3439
3458
|
// If you use it onChange along with keyPress event it will cause a
|
|
3440
3459
|
// side effect that causes the validation to render when it shouldn't.
|
|
3441
|
-
onChange: (name, value) => {
|
|
3460
|
+
onChange: (name, value) => {
|
|
3461
|
+
onChangeForInputControl({
|
|
3462
|
+
name,
|
|
3463
|
+
value,
|
|
3464
|
+
controlProps: props
|
|
3465
|
+
});
|
|
3466
|
+
},
|
|
3442
3467
|
onKeyPress: (name, value, key) => {
|
|
3443
3468
|
onKeyPressForTextControl({
|
|
3444
3469
|
name,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abgov/jsonforms-components",
|
|
3
|
-
"version": "1.26.
|
|
3
|
+
"version": "1.26.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Government of Alberta - React renderers for JSON Forms based on the design system.",
|
|
6
6
|
"repository": "https://github.com/GovAlta/adsp-monorepo",
|
|
@@ -57,6 +57,11 @@ export declare const onBlurForTimeControl: (props: EventBlurControlProps) => voi
|
|
|
57
57
|
* @param props - EventChangeControlProps
|
|
58
58
|
*/
|
|
59
59
|
export declare const onChangeForDateControl: (props: EventChangeControlProps) => void;
|
|
60
|
+
/**
|
|
61
|
+
* Helper function to process onChange event for Input controls.
|
|
62
|
+
* @param props - EventChangeControlProps
|
|
63
|
+
*/
|
|
64
|
+
export declare const onChangeForInputControl: (props: EventChangeControlProps) => void;
|
|
60
65
|
/**
|
|
61
66
|
* Helper function to process onChange event for Date controls.
|
|
62
67
|
* @param props - EventChangeControlProps
|