From b40cb9b3e51eacb261dc69d2c3b55a22e22a79ea Mon Sep 17 00:00:00 2001 From: Florent MILLOT <75525996+flomillot@users.noreply.github.com> Date: Mon, 1 Dec 2025 18:34:18 +0100 Subject: [PATCH 1/2] Refactor DirectoryItemsInput to use MUI Select with improved UX - Replace input by MUI Select/OutlinedInput component - Add proper label support with InputLabel - Implement chip-based multi-selection with click handlers - Add event propagation control for chip interactions - Update OverflowableChip and OverflowableChipWithHelperText with boxSx prop - Prevent tooltip click propagation in OverflowableText - Update demo with DirectoryItemsInput example Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com> --- demo/src/InputsTab.jsx | 16 ++ demo/src/app.jsx | 6 +- .../reactHookForm/DirectoryItemsInput.tsx | 223 +++++++++++------- .../inputs/reactHookForm/OverflowableChip.tsx | 40 ++-- .../OverflowableChipWithHelperText.tsx | 16 +- .../overflowableText/OverflowableText.tsx | 10 +- src/translations/en/inputsEn.ts | 2 +- src/translations/fr/inputsFr.ts | 2 +- 8 files changed, 208 insertions(+), 107 deletions(-) diff --git a/demo/src/InputsTab.jsx b/demo/src/InputsTab.jsx index 7553eaa69..92d8f8370 100644 --- a/demo/src/InputsTab.jsx +++ b/demo/src/InputsTab.jsx @@ -24,6 +24,8 @@ import { ExpandingTextField, CustomFormProvider, SelectClearable, + DirectoryItemsInput, + ElementType, } from '../../src'; const AUTOCOMPLETE_INPUT = 'autocomplete'; @@ -36,6 +38,7 @@ const INTEGER_INPUT = 'integer'; const FLOAT_INPUT = 'float'; const CHECKBOX_INPUT = 'checkbox'; const SWITCH_INPUT = 'switch'; +const DIRECTORY_ITEMS_INPUT = 'directoryItems'; const emptyFormData = { [AUTOCOMPLETE_INPUT]: null, @@ -48,6 +51,7 @@ const emptyFormData = { [FLOAT_INPUT]: null, [CHECKBOX_INPUT]: false, // or null, but should then be nullable in schema [SWITCH_INPUT]: false, // or null, but should then be nullable in schema + [DIRECTORY_ITEMS_INPUT]: [], }; const formSchema = yup.object().shape({ @@ -61,6 +65,7 @@ const formSchema = yup.object().shape({ [FLOAT_INPUT]: yup.number().nullable(), [CHECKBOX_INPUT]: yup.boolean(), [SWITCH_INPUT]: yup.boolean(), + [DIRECTORY_ITEMS_INPUT]: yup.array().of(yup.object()).default([]), }); const options = [ @@ -166,6 +171,17 @@ function InputsTab() { + + +