From 34717cdf50baa9486c4a1835055f8a59ea13d359 Mon Sep 17 00:00:00 2001 From: dylanBetty <78550663+dylanBetty@users.noreply.github.com> Date: Mon, 8 Apr 2024 13:32:07 +0200 Subject: [PATCH] Revert "Revert "Release"" --- CHANGELOG.md | 7 +++++ package.json | 2 +- src/components/autocompleteInput.js | 3 ++ src/components/checkboxGroup.js | 4 +++ src/components/checkboxinput.js | 8 ++++- src/components/dateTimePickerInput.js | 4 ++- src/components/fileUploadInput.js | 13 +++++++-- src/components/multiAutoCompleteInput.js | 3 ++ src/components/radioinput.js | 37 +++++++++++++++++------- src/components/ratingInput.js | 6 ++-- src/components/richTextInput.js | 17 +++++++---- src/components/selectInput.js | 12 +++++++- src/components/textinput.js | 6 +++- 13 files changed, 98 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c8775cd7..4974995ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [2.187.0](https://github.com/bettyblocks/material-ui-component-set/compare/v2.186.0...v2.187.0) (2024-04-03) + + +### Features + +* add for and id attributes to textfield ([0ce2cc1](https://github.com/bettyblocks/material-ui-component-set/commit/0ce2cc1a35a5ecb265e9088dd3518915c53f2bb6)) + # [2.186.0](https://github.com/bettyblocks/material-ui-component-set/compare/v2.185.0...v2.186.0) (2024-03-19) diff --git a/package.json b/package.json index 7568cd369..fd8fe4ea3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "component-set", - "version": "2.186.0", + "version": "2.187.0", "main": "dist/templates.json", "license": "UNLICENSED", "private": false, diff --git a/src/components/autocompleteInput.js b/src/components/autocompleteInput.js index 6f3595985..e49ff0390 100644 --- a/src/components/autocompleteInput.js +++ b/src/components/autocompleteInput.js @@ -12,6 +12,7 @@ InteractionScope, ModelProvider, env, + generateUUID, getIdProperty, getModel, getProperty, @@ -95,6 +96,7 @@ const [debouncedCurrentValue, setDebouncedCurrentValue] = useState(); const [interactionFilter, setInteractionFilter] = useState({}); const defaultValueEvaluatedRef = useRef(false); + const { current: labelControlRef } = useRef(generateUUID()); const isNumberType = type === 'number'; @@ -733,6 +735,7 @@ error={errorState} > { + const labelControlRef = generateUUID(); return ( } + htmlFor={labelControlRef} label={checkboxLabel} labelPlacement={position} checked={values.includes(checkboxValue)} diff --git a/src/components/checkboxinput.js b/src/components/checkboxinput.js index a40bac337..583ea9443 100644 --- a/src/components/checkboxinput.js +++ b/src/components/checkboxinput.js @@ -17,19 +17,23 @@ isSwitch, dataComponentAttribute = ['Checkbox'], } = options; - const { env, useText } = B; + const { env, generateUUID, useText } = B; const isDev = env === 'dev'; function boolify(textValue) { if (typeof textValue === 'boolean') { return textValue; } + if (typeof textValue === 'undefined') { + return undefined; + } return ['on', 'true', 'yes'].includes(textValue.trim().toLowerCase()); } const [errorState, setErrorState] = useState(false); const [helper, setHelper] = useState(useText(helperText)); const mounted = useRef(false); + const { current: labelControlRef } = useRef(generateUUID()); const parsedLabel = useText(label); const labelText = parsedLabel; const resolvedValue = useText(value); @@ -105,6 +109,7 @@ }, [isDev, helperTextResolved, resolvedValue]); const props = { + id: labelControlRef, checked, required, onInvalid: invalidHandler, @@ -143,6 +148,7 @@ classes={{ root: classes.formControl }} > { - const { env, useText, Icon, usePresignedUpload, useProperty } = B; + const { + Icon, + env, + generateUUID, + usePresignedUpload, + useProperty, + useText, + } = B; const { FormControl, FormHelperText, Typography, IconButton } = window.MaterialUI.Core; const { @@ -34,6 +41,7 @@ const acceptedValue = useText(accept) || 'image/*'; const dataComponentAttributeValue = useText(dataComponentAttribute); const requiredText = required ? '*' : ''; + const { current: labelControlRef } = useRef(generateUUID()); const getPropertyId = (property) => { if (typeof property === 'string') { @@ -179,6 +187,7 @@ > {children} -