@rsuci/shared-form-components 1.0.118 → 1.0.119
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioInput.d.ts","sourceRoot":"","sources":["../../../src/components/inputs/RadioInput.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,
|
|
1
|
+
{"version":3,"file":"RadioInput.d.ts","sourceRoot":"","sources":["../../../src/components/inputs/RadioInput.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAKxE,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,kBAAkB,GAAG;QAAE,QAAQ,EAAE,OAAO,CAAA;KAAE,CAAC;IACrD,KAAK,EAAE,aAAa,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IACzC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAoDzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
'use client';
|
|
6
6
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
-
import { useEffect } from 'react';
|
|
8
7
|
import { VariableValueConverter } from '../../lib/utils/variableValueConverter';
|
|
9
8
|
import { applyComponentStyle } from '../../utils/styleUtils';
|
|
10
9
|
import { isComponentReadonly } from '../../utils/componentStateUtils';
|
|
@@ -18,12 +17,6 @@ const RadioInput = ({ variable, value, onChange, onBlur, error, disabled, isCons
|
|
|
18
17
|
const options = typeof optionsSource === 'string'
|
|
19
18
|
? VariableValueConverter.parseOptionsFromProperty(optionsSource)
|
|
20
19
|
: [];
|
|
21
|
-
// Sélectionner automatiquement la 1ere option si aucune n'est sélectionnée
|
|
22
|
-
useEffect(() => {
|
|
23
|
-
if (options.length > 0 && (value === null || value === undefined || value === '')) {
|
|
24
|
-
onChange(options[0].code);
|
|
25
|
-
}
|
|
26
|
-
}, [options.length]);
|
|
27
20
|
const handleChange = (selectedValue) => {
|
|
28
21
|
onChange(selectedValue || null);
|
|
29
22
|
};
|
package/package.json
CHANGED