@teselagen/ui 0.4.2 → 0.4.4
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.cjs.js +1943 -1397
- package/index.es.js +1944 -1398
- package/package.json +1 -1
- package/src/FormComponents/index.js +27 -5
package/package.json
CHANGED
|
@@ -828,8 +828,8 @@ export const renderSelect = props => {
|
|
|
828
828
|
placeholder && value === ""
|
|
829
829
|
? "__placeholder__"
|
|
830
830
|
: typeof value !== "string"
|
|
831
|
-
|
|
832
|
-
|
|
831
|
+
? sortify(value) //deterministically sort and stringify the object/number coming in because select fields only support string values
|
|
832
|
+
: value
|
|
833
833
|
}
|
|
834
834
|
disabled={disabled}
|
|
835
835
|
{...(hideValue ? { value: "" } : {})}
|
|
@@ -947,15 +947,37 @@ export const renderBlueprintRadioGroup = ({
|
|
|
947
947
|
...rest
|
|
948
948
|
}) => {
|
|
949
949
|
const optionsToUse = getOptions(options);
|
|
950
|
+
if (
|
|
951
|
+
options.some(opt => {
|
|
952
|
+
if (opt.value === "true") {
|
|
953
|
+
return true;
|
|
954
|
+
}
|
|
955
|
+
return false;
|
|
956
|
+
})
|
|
957
|
+
) {
|
|
958
|
+
throw new Error(
|
|
959
|
+
'RadioGroup values cannot be strings of "true" or "false", they must be actual booleans'
|
|
960
|
+
);
|
|
961
|
+
}
|
|
950
962
|
return (
|
|
951
963
|
<RadioGroup
|
|
952
964
|
{...input}
|
|
953
965
|
{...removeUnwantedProps(rest)}
|
|
954
966
|
selectedValue={input.value}
|
|
955
967
|
label={undefined} //removing label from radio group because our label already handles it
|
|
956
|
-
onChange={function (e
|
|
957
|
-
|
|
958
|
-
|
|
968
|
+
onChange={function (e) {
|
|
969
|
+
let val = e.target.value;
|
|
970
|
+
if (val === "true") {
|
|
971
|
+
val = true;
|
|
972
|
+
}
|
|
973
|
+
if (val === "false") {
|
|
974
|
+
val = false;
|
|
975
|
+
}
|
|
976
|
+
if (val === "") {
|
|
977
|
+
val = false;
|
|
978
|
+
}
|
|
979
|
+
input.onChange(val);
|
|
980
|
+
onFieldSubmit(val);
|
|
959
981
|
}}
|
|
960
982
|
options={optionsToUse}
|
|
961
983
|
/>
|