@registrucentras/rc-ses-react-components 1.10.0 → 2.0.0-rc.0
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/dist/assets/icons/ArrowLeftIcon.d.ts +1 -1
- package/dist/assets/icons/ArrowRightIcon.d.ts +1 -1
- package/dist/assets/icons/ArrowsClockwiseIcon.d.ts +1 -1
- package/dist/assets/icons/BarcodeIcon.d.ts +1 -1
- package/dist/assets/icons/CalendarBlankIcon.d.ts +1 -1
- package/dist/assets/icons/CaretDoubleLeftBoldIcon.d.ts +1 -1
- package/dist/assets/icons/CaretDoubleRightBoldIcon.d.ts +1 -1
- package/dist/assets/icons/CaretDownBoldIcon.d.ts +1 -1
- package/dist/assets/icons/CaretDownFill.d.ts +1 -1
- package/dist/assets/icons/CaretDownIcon.d.ts +1 -1
- package/dist/assets/icons/CaretLeftBoldIcon.d.ts +1 -1
- package/dist/assets/icons/CaretLeftIcon.d.ts +1 -1
- package/dist/assets/icons/CaretRightBoldIcon.d.ts +1 -1
- package/dist/assets/icons/CheckBoldIcon.d.ts +1 -1
- package/dist/assets/icons/CheckCircleFillIcon.d.ts +1 -1
- package/dist/assets/icons/CheckIcon.d.ts +1 -1
- package/dist/assets/icons/CheckUncheckedBoldIcon.d.ts +1 -1
- package/dist/assets/icons/CircleFilledIcon.d.ts +1 -1
- package/dist/assets/icons/CloseIcon.d.ts +1 -1
- package/dist/assets/icons/CollapseChevronsIcon.d.ts +1 -1
- package/dist/assets/icons/CopyIcon.d.ts +1 -1
- package/dist/assets/icons/DotCircleFilledIcon.d.ts +1 -1
- package/dist/assets/icons/ExpandChevronsIcon.d.ts +1 -1
- package/dist/assets/icons/InfoFillIcon.d.ts +1 -1
- package/dist/assets/icons/MagnifyingGlassIcon.d.ts +1 -1
- package/dist/assets/icons/MapPinAreaIcon.d.ts +1 -1
- package/dist/assets/icons/MinusBoldIcon.d.ts +1 -1
- package/dist/assets/icons/PencilSimpleLineIcon.d.ts +1 -1
- package/dist/assets/icons/PlusBoldIcon.d.ts +1 -1
- package/dist/assets/icons/QuestionFillIcon.d.ts +1 -1
- package/dist/assets/icons/QuestionIcon.d.ts +1 -1
- package/dist/assets/icons/ScalesIcon.d.ts +1 -1
- package/dist/assets/icons/ScrollIcon.d.ts +1 -1
- package/dist/assets/icons/SearchHelpIcon.d.ts +1 -1
- package/dist/assets/icons/SearchXIcon.d.ts +1 -1
- package/dist/assets/icons/SpinnerGapBoldIcon.d.ts +1 -1
- package/dist/assets/icons/UploadSimpleIcon.d.ts +1 -1
- package/dist/assets/icons/WarningCircleIcon.d.ts +1 -1
- package/dist/assets/icons/WarningDiamondFillIcon.d.ts +1 -1
- package/dist/assets/icons/WarningFillIcon.d.ts +1 -1
- package/dist/assets/icons/XCircleFillIcon.d.ts +1 -1
- package/dist/components/common/Accordion/index.d.ts +1 -1
- package/dist/components/common/Alert/index.d.ts +1 -1
- package/dist/components/common/Badge/index.d.ts +10 -0
- package/dist/components/common/Breadcrumbs/index.d.ts +1 -1
- package/dist/components/common/Button/ButtonWithPopover.d.ts +1 -1
- package/dist/components/common/Button/index.d.ts +2 -4
- package/dist/components/common/Card/index.d.ts +1 -1
- package/dist/components/common/DataPagination/components/DataPaginationSkeleton.d.ts +1 -1
- package/dist/components/common/DataPagination/components/PaginationButton.d.ts +1 -1
- package/dist/components/common/DataPagination/index.d.ts +1 -1
- package/dist/components/common/IconWithCircularBackground.d.ts +1 -1
- package/dist/components/common/ImageCard/index.d.ts +1 -1
- package/dist/components/common/ListWithIcons/components/ListWithIconsItem.d.ts +1 -1
- package/dist/components/common/ListWithIcons/index.d.ts +1 -1
- package/dist/components/common/Popover/index.d.ts +1 -1
- package/dist/components/common/SelectableCardList/components/SelectableCardListItem.d.ts +1 -1
- package/dist/components/common/SelectableCardList/index.d.ts +1 -1
- package/dist/components/common/Snackbar/SnackbarProvider.d.ts +1 -1
- package/dist/components/common/Snackbar/index.d.ts +1 -1
- package/dist/components/common/Switch/index.d.ts +10 -0
- package/dist/components/common/Tabs/TabPanel.d.ts +1 -1
- package/dist/components/common/Tabs/TabsWrapper.d.ts +1 -1
- package/dist/components/form/components/FormControlWrapper/components/FieldSuffix.d.ts +1 -1
- package/dist/components/form/components/FormControlWrapper/index.d.ts +1 -1
- package/dist/components/form/inputs/Checkbox.d.ts +1 -1
- package/dist/components/form/inputs/CheckboxFormControl.d.ts +1 -1
- package/dist/components/form/inputs/Datepicker/components/RcSesDatepickerActionBar.d.ts +1 -1
- package/dist/components/form/inputs/Datepicker/components/RcSesDatepickerCalendarHeader.d.ts +2 -1
- package/dist/components/form/inputs/Datepicker/index.d.ts +1 -1
- package/dist/components/form/inputs/FileDropzone.d.ts +1 -1
- package/dist/components/form/inputs/FileUpload.d.ts +1 -1
- package/dist/components/form/inputs/FormControlLabel.d.ts +2 -2
- package/dist/components/form/inputs/NumberStepper.d.ts +2 -1
- package/dist/components/form/inputs/PhoneInput.d.ts +2 -1
- package/dist/components/form/inputs/PhoneInputFormControl/components/AutocompleteInput.d.ts +1 -1
- package/dist/components/form/inputs/PhoneInputFormControl/components/ListboxComponent.d.ts +13 -0
- package/dist/components/form/inputs/PhoneInputFormControl/components/PopperComponent.d.ts +1 -1
- package/dist/components/form/inputs/PhoneInputFormControl/components/RowComponent.d.ts +5 -2
- package/dist/components/form/inputs/PhoneInputFormControl/index.d.ts +2 -1
- package/dist/components/form/inputs/Select/index.d.ts +2 -1
- package/dist/components/form/inputs/SimpleCheckbox.d.ts +2 -1
- package/dist/components/layout/Footer/index.d.ts +1 -1
- package/dist/components/layout/ServiceFormActions.d.ts +1 -1
- package/dist/components/layout/ServiceFormContainer/AccordionFormContainer/components/AccordionCollapseControls.d.ts +1 -1
- package/dist/components/layout/ServiceFormContainer/AccordionFormContainer/index.d.ts +1 -1
- package/dist/components/layout/ServiceFormContainer/CardFormContainer/index.d.ts +1 -1
- package/dist/components/layout/ServiceHeader.d.ts +1 -1
- package/dist/components/layout/ServicePage.d.ts +1 -1
- package/dist/components/layout/ServiceWizardStepper/components/CustomStepIcon.d.ts +1 -1
- package/dist/components/layout/ServiceWizardStepper/components/DesktopStepper.d.ts +1 -1
- package/dist/components/layout/ServiceWizardStepper/components/HorizontalStepperButton.d.ts +1 -1
- package/dist/components/layout/ServiceWizardStepper/components/MobileStepper.d.ts +1 -1
- package/dist/components/layout/ServiceWizardStepper/index.d.ts +1 -1
- package/dist/components/loaders/FullPageLoader/index.d.ts +1 -1
- package/dist/components/loaders/Loader/index.d.ts +1 -1
- package/dist/components/loaders/LoadingSpinner/index.d.ts +1 -1
- package/dist/components/overlays/Dialog/index.d.ts +1 -1
- package/dist/components/overlays/Modal/index.d.ts +1 -1
- package/dist/components/utils/loading.d.ts +1 -1
- package/dist/i18n/@mui/x-date-pickers/ltLT.d.ts +1 -71
- package/dist/library/index.d.ts +3 -1
- package/dist/registrucentras-rc-ses-react-components.cjs +1 -30
- package/dist/registrucentras-rc-ses-react-components.js +6258 -7835
- package/dist/stories/assets/Logo.stories.d.ts +1 -1
- package/dist/stories/components/actions/Button.stories.d.ts +2 -2
- package/dist/stories/components/actions/ButtonWithPopover.stories.d.ts +1 -1
- package/dist/stories/components/display/Badge.stories.d.ts +9 -0
- package/dist/stories/components/display/Card.stories.d.ts +1 -1
- package/dist/stories/components/display/ImageCard.stories.d.ts +1 -1
- package/dist/stories/components/display/ListWithIcons.stories.d.ts +2 -2
- package/dist/stories/components/display/SegmentedControl.stories.d.ts +9 -9
- package/dist/stories/components/display/SelectableCardList.stories.d.ts +2 -2
- package/dist/stories/components/feedback/Alert.stories.d.ts +1 -1
- package/dist/stories/components/feedback/Snackbar.stories.d.ts +7 -7
- package/dist/stories/components/form/CardFormContainer.stories.d.ts +1 -1
- package/dist/stories/components/form/CheckboxFormControl.stories.d.ts +1 -1
- package/dist/stories/components/form/FormControlWrapper.stories.d.ts +1 -1
- package/dist/stories/components/form/ServiceFormActions.stories.d.ts +1 -1
- package/dist/stories/components/form/ServiceFormContainer.stories.d.ts +2 -2
- package/dist/stories/components/form/SimpleCheckbox.stories.d.ts +1 -1
- package/dist/stories/components/icons/IconWithCircularBackground.stories.d.ts +1 -1
- package/dist/stories/components/icons/Icons.stories.d.ts +1 -1
- package/dist/stories/components/inputs/Checkbox.stories.d.ts +2 -2
- package/dist/stories/components/inputs/DatePicker.stories.d.ts +2 -2
- package/dist/stories/components/inputs/FileDropzone.stories.d.ts +1 -1
- package/dist/stories/components/inputs/FileUpload.stories.d.ts +2 -2
- package/dist/stories/components/inputs/NumberStepper.stories.d.ts +1 -1
- package/dist/stories/components/inputs/PhoneInput.stories.d.ts +2 -2
- package/dist/stories/components/inputs/PhoneInputFormControl.stories.d.ts +1 -1
- package/dist/stories/components/inputs/RadioButtonGroup.stories.d.ts +1 -1
- package/dist/stories/components/inputs/SearchInput.stories.d.ts +1 -1
- package/dist/stories/components/inputs/SearchableField.stories.d.ts +1 -1
- package/dist/stories/components/inputs/Select.stories.d.ts +1 -1
- package/dist/stories/components/inputs/Switch.stories.d.ts +17 -0
- package/dist/stories/components/inputs/TextField.stories.d.ts +1 -1
- package/dist/stories/components/layout/Footer.stories.d.ts +1 -1
- package/dist/stories/components/layout/ServiceHeader.stories.d.ts +1 -1
- package/dist/stories/components/layout/ServicePage.stories.d.ts +1 -1
- package/dist/stories/components/loaders/FullPageLoader.stories.d.ts +1 -1
- package/dist/stories/components/loaders/Loader.stories.d.ts +1 -1
- package/dist/stories/components/loaders/LoadingSpinner.stories.d.ts +1 -1
- package/dist/stories/components/navigation/Accordion.stories.d.ts +2 -2
- package/dist/stories/components/navigation/Breadcrumbs.stories.d.ts +1 -1
- package/dist/stories/components/navigation/DataPagination.stories.d.ts +2 -2
- package/dist/stories/components/navigation/ServiceWizardStepper.stories.d.ts +1 -1
- package/dist/stories/components/overlays/Dialog.stories.d.ts +1 -1
- package/dist/stories/components/overlays/Modal.stories.d.ts +1 -1
- package/dist/stories/components/tabs/Tab.stories.d.ts +1 -1
- package/dist/stories/components/tabs/TabPanel.stories.d.ts +1 -1
- package/dist/stories/components/tabs/Tabs.stories.d.ts +1 -1
- package/dist/stories/components/tabs/TabsWrapper.stories.d.ts +1 -1
- package/dist/theme/light/MuiSwitch.d.ts +3 -0
- package/package.json +63 -62
- package/src/components/common/Accordion/index.tsx +0 -1
- package/src/components/common/Alert/index.test.tsx +1 -1
- package/src/components/common/Badge/index.test.tsx +129 -0
- package/src/components/common/Badge/index.tsx +162 -0
- package/src/components/common/Button/index.test.tsx +5 -2
- package/src/components/common/Button/index.tsx +10 -4
- package/src/components/common/Card/index.test.tsx +1 -1
- package/src/components/common/DataPagination/index.test.tsx +1 -1
- package/src/components/common/DataPagination/index.tsx +14 -2
- package/src/components/common/ImageCard/index.test.tsx +1 -1
- package/src/components/common/ListWithIcons/index.test.tsx +1 -1
- package/src/components/common/SegmentedControl/components/SegmentButton/index.test.tsx +1 -1
- package/src/components/common/SegmentedControl/components/SegmentButton/index.tsx +2 -0
- package/src/components/common/SegmentedControl/index.test.tsx +1 -1
- package/src/components/common/SelectableCardList/components/SelectableCardListItem.tsx +14 -2
- package/src/components/common/SelectableCardList/index.test.tsx +1 -1
- package/src/components/common/Snackbar/SnackbarProvider.tsx +1 -1
- package/src/components/common/Snackbar/index.test.tsx +1 -1
- package/src/components/common/Snackbar/index.tsx +3 -1
- package/src/components/common/Switch/index.test.tsx +214 -0
- package/src/components/common/Switch/index.tsx +64 -0
- package/src/components/form/components/FormControlWrapper/const/FormControlLayoutVariables.ts +1 -1
- package/src/components/form/inputs/CheckboxFormControl.tsx +7 -3
- package/src/components/form/inputs/Datepicker/components/RcSesDatepickerActionBar.tsx +8 -5
- package/src/components/form/inputs/Datepicker/components/RcSesDatepickerCalendarHeader.tsx +12 -12
- package/src/components/form/inputs/Datepicker/index.tsx +37 -32
- package/src/components/form/inputs/FileDropzone.tsx +6 -1
- package/src/components/form/inputs/NumberStepper.tsx +10 -5
- package/src/components/form/inputs/PhoneInputFormControl/components/AutocompleteInput.tsx +15 -11
- package/src/components/form/inputs/PhoneInputFormControl/components/ListboxComponent.tsx +31 -27
- package/src/components/form/inputs/PhoneInputFormControl/components/RowComponent.tsx +8 -4
- package/src/components/form/inputs/PhoneInputFormControl/index.test.tsx +57 -2
- package/src/components/form/inputs/PhoneInputFormControl/index.tsx +66 -53
- package/src/components/form/inputs/RadioButtonGroup.tsx +0 -1
- package/src/components/form/inputs/SearchInput/index.test.tsx +1 -1
- package/src/components/form/inputs/SearchInput/index.tsx +23 -13
- package/src/components/form/inputs/SearchableField.test.tsx +126 -0
- package/src/components/form/inputs/SearchableField.tsx +29 -24
- package/src/components/form/inputs/Select/index.tsx +67 -36
- package/src/components/form/inputs/TextField.tsx +1 -7
- package/src/components/layout/Footer/index.test.tsx +1 -1
- package/src/components/layout/ServiceFormActions.tsx +3 -3
- package/src/components/layout/ServiceFormContainer/AccordionFormContainer/components/AccordionCollapseControls.tsx +2 -2
- package/src/components/layout/ServiceFormContainer/AccordionFormContainer/index.tsx +2 -2
- package/src/components/layout/ServiceFormContainer/CardFormContainer/index.test.tsx +1 -1
- package/src/components/layout/ServiceWizardStepper/components/DesktopStepper.tsx +2 -1
- package/src/components/layout/ServiceWizardStepper/components/MobileStepper.test.tsx +8 -6
- package/src/components/layout/ServiceWizardStepper/components/MobileStepper.tsx +2 -1
- package/src/components/loaders/FullPageLoader/index.test.tsx +1 -1
- package/src/components/loaders/FullPageLoader/index.tsx +4 -3
- package/src/components/loaders/Loader/index.test.tsx +1 -1
- package/src/components/loaders/Loader/index.tsx +14 -4
- package/src/components/loaders/LoadingSpinner/index.test.tsx +1 -1
- package/src/components/overlays/Dialog/index.test.tsx +1 -1
- package/src/components/overlays/Dialog/index.tsx +7 -5
- package/src/components/overlays/Modal/index.test.tsx +1 -1
- package/src/components/overlays/Modal/index.tsx +4 -2
- package/src/env.tsx +1 -1
- package/src/examples/MultipleStepForm/components/ServiceDetailsForm.tsx +0 -5
- package/src/examples/MultipleStepForm/components/ServiceIssuanceForm.tsx +0 -2
- package/src/examples/MultipleStepForm/components/TermsAndConditionsForm.tsx +2 -2
- package/src/examples/SingleStepForm/components/ObjectIdentifierSearchModal.tsx +12 -8
- package/src/examples/SingleStepForm/index.tsx +0 -2
- package/src/i18n/@mui/x-date-pickers/ltLT.ts +15 -1
- package/src/i18n/namespaces/input/en.json +6 -0
- package/src/i18n/namespaces/input/lt.json +6 -0
- package/src/library/index.ts +4 -0
- package/src/main.tsx +1 -1
- package/src/stories/Colors.mdx +1 -1
- package/src/stories/Welcome.mdx +1 -1
- package/src/stories/assets/Logo.stories.tsx +1 -1
- package/src/stories/components/actions/Button.stories.tsx +2 -2
- package/src/stories/components/actions/ButtonWithPopover.stories.tsx +1 -1
- package/src/stories/components/display/Badge.stories.tsx +184 -0
- package/src/stories/components/display/Card.stories.tsx +1 -1
- package/src/stories/components/display/ImageCard.stories.tsx +1 -1
- package/src/stories/components/display/ListWithIcons.stories.tsx +1 -1
- package/src/stories/components/display/SegmentedControl.stories.tsx +1 -1
- package/src/stories/components/display/SelectableCardList.stories.tsx +1 -1
- package/src/stories/components/feedback/Alert.stories.tsx +1 -1
- package/src/stories/components/feedback/Snackbar.stories.tsx +1 -1
- package/src/stories/components/form/CardFormContainer.stories.tsx +1 -1
- package/src/stories/components/form/CheckboxFormControl.stories.tsx +1 -1
- package/src/stories/components/form/FormControlWrapper.stories.tsx +1 -1
- package/src/stories/components/form/ServiceFormActions.stories.tsx +1 -1
- package/src/stories/components/form/ServiceFormContainer.stories.tsx +1 -3
- package/src/stories/components/form/SimpleCheckbox.stories.tsx +1 -1
- package/src/stories/components/icons/IconWithCircularBackground.stories.tsx +1 -1
- package/src/stories/components/icons/Icons.stories.tsx +1 -2
- package/src/stories/components/inputs/Checkbox.stories.tsx +1 -2
- package/src/stories/components/inputs/DatePicker.stories.tsx +2 -3
- package/src/stories/components/inputs/FileDropzone.stories.tsx +1 -1
- package/src/stories/components/inputs/FileUpload.stories.tsx +1 -2
- package/src/stories/components/inputs/NumberStepper.stories.tsx +1 -1
- package/src/stories/components/inputs/PhoneInput.stories.tsx +1 -2
- package/src/stories/components/inputs/PhoneInputFormControl.stories.tsx +3 -2
- package/src/stories/components/inputs/RadioButtonGroup.stories.tsx +1 -1
- package/src/stories/components/inputs/SearchInput.stories.tsx +2 -2
- package/src/stories/components/inputs/SearchableField.stories.tsx +1 -1
- package/src/stories/components/inputs/Select.stories.tsx +1 -2
- package/src/stories/components/inputs/Switch.stories.tsx +70 -0
- package/src/stories/components/inputs/TextField.stories.tsx +1 -1
- package/src/stories/components/layout/Footer.stories.tsx +1 -1
- package/src/stories/components/layout/ServiceHeader.stories.tsx +1 -1
- package/src/stories/components/layout/ServicePage.stories.tsx +1 -1
- package/src/stories/components/loaders/FullPageLoader.stories.tsx +1 -1
- package/src/stories/components/loaders/Loader.stories.tsx +1 -1
- package/src/stories/components/loaders/LoadingSpinner.stories.tsx +1 -1
- package/src/stories/components/navigation/Accordion.stories.tsx +1 -2
- package/src/stories/components/navigation/Breadcrumbs.stories.tsx +1 -1
- package/src/stories/components/navigation/DataPagination.stories.tsx +8 -2
- package/src/stories/components/navigation/ServiceWizardStepper.stories.tsx +1 -1
- package/src/stories/components/overlays/Dialog.stories.tsx +1 -1
- package/src/stories/components/overlays/Modal.stories.tsx +1 -1
- package/src/stories/components/tabs/Tab.stories.tsx +12 -1
- package/src/stories/components/tabs/TabPanel.stories.tsx +1 -1
- package/src/stories/components/tabs/Tabs.stories.tsx +1 -1
- package/src/stories/components/tabs/TabsWrapper.stories.tsx +1 -1
- package/src/theme/light/MuiAlert.tsx +82 -75
- package/src/theme/light/MuiLinearProgress.ts +6 -2
- package/src/theme/light/MuiPickersLayout.ts +4 -4
- package/src/theme/light/MuiSwitch.tsx +77 -0
- package/src/theme/light/MuiTabs.tsx +2 -1
- package/src/theme/light/index.tsx +2 -0
- package/src/types/common/ColorType.tsx +1 -7
- package/dist/components/form/inputs/PhoneInputFormControl/components/OuterElementType.d.ts +0 -5
- package/dist/components/form/inputs/PhoneInputFormControl/hooks/useResetCache.d.ts +0 -4
- package/src/components/form/inputs/PhoneInputFormControl/components/OuterElementType.tsx +0 -13
- package/src/components/form/inputs/PhoneInputFormControl/hooks/useResetCache.ts +0 -14
|
@@ -1,51 +1,55 @@
|
|
|
1
1
|
import Box from '@mui/material/Box'
|
|
2
2
|
import React from 'react'
|
|
3
|
-
import {
|
|
3
|
+
import { List } from 'react-window'
|
|
4
4
|
|
|
5
|
-
import useResetCache from '../hooks/useResetCache'
|
|
6
|
-
import OuterElementType, { OuterElementContext } from './OuterElementType'
|
|
7
5
|
import RowComponent from './RowComponent'
|
|
8
6
|
|
|
7
|
+
const ROW_HEIGHT = 44
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* react-window 2 replaced VariableSizeList with List: itemCount/itemSize/itemData
|
|
11
|
+
* became rowCount/rowHeight/rowProps, the row renderer moved from `children` to
|
|
12
|
+
* `rowComponent`, and innerElementType/outerElementType were dropped in favour of
|
|
13
|
+
* a single element whose tag comes from `tagName` and which receives rest props
|
|
14
|
+
* directly.
|
|
15
|
+
*
|
|
16
|
+
* That removes two helpers:
|
|
17
|
+
* - OuterElementType existed only to forward Autocomplete's listbox props onto the
|
|
18
|
+
* outer element through a context; List spreads them itself now.
|
|
19
|
+
* - useResetCache called resetAfterIndex on every data change; rows are a fixed
|
|
20
|
+
* height and v2 has no such cache.
|
|
21
|
+
*/
|
|
9
22
|
const ListboxComponent = React.forwardRef<
|
|
10
23
|
HTMLDivElement,
|
|
11
24
|
React.HTMLAttributes<HTMLElement>
|
|
12
25
|
>((props, ref) => {
|
|
13
26
|
const { children, ...other } = props
|
|
14
|
-
const
|
|
27
|
+
const items: React.ReactElement<unknown>[] = []
|
|
15
28
|
;(children as React.ReactElement<unknown>[]).forEach(
|
|
16
29
|
(
|
|
17
30
|
item: React.ReactElement<unknown> & {
|
|
18
31
|
children?: React.ReactElement<unknown>[]
|
|
19
32
|
},
|
|
20
33
|
) => {
|
|
21
|
-
|
|
22
|
-
|
|
34
|
+
items.push(item)
|
|
35
|
+
items.push(...(item.children || []))
|
|
23
36
|
},
|
|
24
37
|
)
|
|
25
38
|
|
|
26
|
-
const itemCount = itemData.length
|
|
27
|
-
const itemSize = 44
|
|
28
|
-
|
|
29
|
-
const gridRef = useResetCache(itemCount)
|
|
30
|
-
|
|
31
39
|
return (
|
|
32
40
|
<Box lang='en' ref={ref} sx={{ m: 0.75, ul: { m: 0, p: 0, width: 'auto' } }}>
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
>
|
|
46
|
-
{RowComponent}
|
|
47
|
-
</VariableSizeList>
|
|
48
|
-
</OuterElementContext.Provider>
|
|
41
|
+
<List
|
|
42
|
+
{...other}
|
|
43
|
+
overscanCount={5}
|
|
44
|
+
rowComponent={RowComponent}
|
|
45
|
+
rowCount={items.length}
|
|
46
|
+
rowHeight={ROW_HEIGHT}
|
|
47
|
+
rowProps={{ items }}
|
|
48
|
+
tagName='ul'
|
|
49
|
+
// Height tracks the content, as it did under v1, leaving the surrounding
|
|
50
|
+
// Autocomplete popper responsible for clipping and scrolling.
|
|
51
|
+
style={{ height: items.length * ROW_HEIGHT, overflow: 'hidden auto' }}
|
|
52
|
+
/>
|
|
49
53
|
</Box>
|
|
50
54
|
)
|
|
51
55
|
})
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import Box from '@mui/material/Box'
|
|
2
2
|
import Stack from '@mui/material/Stack'
|
|
3
3
|
import Typography from '@mui/material/Typography'
|
|
4
|
-
import {
|
|
4
|
+
import type { RowComponentProps } from 'react-window'
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
// react-window 2 passes `index` and `style` plus whatever is given in `rowProps`,
|
|
7
|
+
// replacing v1's single `data` array.
|
|
8
|
+
type Props = RowComponentProps<{ items: any[] }>
|
|
9
|
+
|
|
10
|
+
function RowComponent(props: Props) {
|
|
11
|
+
const { items, index, style } = props
|
|
12
|
+
const [{ key, ...optionProps }, option] = items[index]
|
|
9
13
|
|
|
10
14
|
return (
|
|
11
15
|
<Stack
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ThemeProvider } from '@mui/material/styles'
|
|
2
|
-
import { render, screen } from '@testing-library/react'
|
|
2
|
+
import { fireEvent, render, screen } from '@testing-library/react'
|
|
3
3
|
import { useForm } from 'react-hook-form'
|
|
4
4
|
import { vi } from 'vitest'
|
|
5
5
|
|
|
6
6
|
import theme from '@/theme/light'
|
|
7
7
|
|
|
8
|
-
import RcSesPhoneInputFormControl from '
|
|
8
|
+
import RcSesPhoneInputFormControl from '.'
|
|
9
9
|
|
|
10
10
|
// Mock i18next
|
|
11
11
|
vi.mock('react-i18next', () => ({
|
|
@@ -44,4 +44,59 @@ describe('RcSesPhoneInputFormControl', () => {
|
|
|
44
44
|
expect(input.getAttribute('placeholder')).toBe('### ## ###')
|
|
45
45
|
expect(screen.getByText('+370')).toBeInTheDocument()
|
|
46
46
|
})
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The country dropdown renders through a virtualised react-window list, which
|
|
50
|
+
* no other check reaches: it only mounts on click, so the visual baselines
|
|
51
|
+
* (static screenshots) never see it. Added ahead of the react-window 1 -> 2
|
|
52
|
+
* migration so that rewrite is verifiable.
|
|
53
|
+
*/
|
|
54
|
+
describe('country dropdown', () => {
|
|
55
|
+
// Opening the dropdown renders all ~244 countries (see the note below), which
|
|
56
|
+
// is slow enough in jsdom to exceed the 5s default - more so since jsdom 29.
|
|
57
|
+
vi.setConfig({ testTimeout: 20_000 })
|
|
58
|
+
|
|
59
|
+
const openDropdown = () => {
|
|
60
|
+
fireEvent.click(screen.getByRole('button', { name: 'aria.countrySelectorLabel' }))
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
test('renders the full country list when opened', () => {
|
|
64
|
+
render(<TestComponent />)
|
|
65
|
+
openDropdown()
|
|
66
|
+
|
|
67
|
+
// Every country renders rather than a virtualised window: the list's height
|
|
68
|
+
// is set to rowCount * rowHeight, so react-window considers all rows
|
|
69
|
+
// visible. Pinned as-is to keep the react-window 2 migration comparable.
|
|
70
|
+
expect(screen.getAllByRole('option').length).toBeGreaterThan(200)
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
test('shows country name and dial code on a row', () => {
|
|
74
|
+
render(<TestComponent />)
|
|
75
|
+
openDropdown()
|
|
76
|
+
|
|
77
|
+
expect(screen.getByText('Lithuania')).toBeInTheDocument()
|
|
78
|
+
expect(screen.getAllByText('+370').length).toBeGreaterThan(0)
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
test('filters rows by the search input', () => {
|
|
82
|
+
render(<TestComponent />)
|
|
83
|
+
openDropdown()
|
|
84
|
+
|
|
85
|
+
const search = screen.getByPlaceholderText('search')
|
|
86
|
+
fireEvent.change(search, { target: { value: 'LATV' } })
|
|
87
|
+
|
|
88
|
+
expect(screen.getByText('Latvia')).toBeInTheDocument()
|
|
89
|
+
expect(screen.queryByText('Lithuania')).not.toBeInTheDocument()
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
test('selecting a country updates the dial code and mask', () => {
|
|
93
|
+
render(<TestComponent />)
|
|
94
|
+
openDropdown()
|
|
95
|
+
|
|
96
|
+
fireEvent.click(screen.getByText('Latvia'))
|
|
97
|
+
|
|
98
|
+
expect(screen.getByText('+371')).toBeInTheDocument()
|
|
99
|
+
expect(screen.queryByText('+370')).not.toBeInTheDocument()
|
|
100
|
+
})
|
|
101
|
+
})
|
|
47
102
|
})
|
|
@@ -124,60 +124,68 @@ function RcSesPhoneInputFormControl(props: Props) {
|
|
|
124
124
|
<TextField
|
|
125
125
|
{...controllerProps}
|
|
126
126
|
fullWidth
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
>
|
|
143
|
-
<
|
|
144
|
-
|
|
127
|
+
slotProps={{
|
|
128
|
+
// Was inputProps: targets the native <input>.
|
|
129
|
+
htmlInput: {
|
|
130
|
+
id,
|
|
131
|
+
pattern: '^[0-9\\(\\)\\- ]*$/',
|
|
132
|
+
},
|
|
133
|
+
// Was InputProps: targets the OutlinedInput wrapper.
|
|
134
|
+
input: {
|
|
135
|
+
startAdornment: (
|
|
136
|
+
<Stack
|
|
137
|
+
direction='row'
|
|
138
|
+
sx={{
|
|
139
|
+
alignItems: 'center',
|
|
140
|
+
}}
|
|
141
|
+
>
|
|
142
|
+
<InputAdornment position='start' sx={{ mr: 0 }}>
|
|
143
|
+
<Button
|
|
144
|
+
aria-describedby={popperId}
|
|
145
|
+
aria-label={t('aria.countrySelectorLabel')}
|
|
146
|
+
aria-haspopup
|
|
147
|
+
color='inherit'
|
|
148
|
+
onClick={handleClick}
|
|
145
149
|
sx={{
|
|
146
|
-
|
|
147
|
-
|
|
150
|
+
backgroundColor: 'white',
|
|
151
|
+
minWidth: 'unset',
|
|
152
|
+
px: 1.5,
|
|
153
|
+
}}
|
|
154
|
+
>
|
|
155
|
+
<Box
|
|
156
|
+
className={`flag-sprite-map flag-${country?.iso}`}
|
|
157
|
+
sx={{
|
|
158
|
+
backgroundSize: '2rem auto',
|
|
159
|
+
borderRadius: '50%',
|
|
160
|
+
height: '1.25rem',
|
|
161
|
+
width: '1.25rem',
|
|
162
|
+
}}
|
|
163
|
+
title={country?.name}
|
|
164
|
+
/>
|
|
165
|
+
<Box component='span' sx={{ display: 'flex', ml: 1 }}>
|
|
166
|
+
<CaretDownFill aria-hidden size={12} />
|
|
167
|
+
</Box>
|
|
168
|
+
</Button>
|
|
169
|
+
</InputAdornment>
|
|
170
|
+
|
|
171
|
+
<InputAdornment position='start'>
|
|
172
|
+
<Divider
|
|
173
|
+
orientation='vertical'
|
|
174
|
+
sx={{
|
|
175
|
+
borderColor: palette.grey[500],
|
|
148
176
|
height: '1.25rem',
|
|
149
|
-
width: '1.25rem',
|
|
150
177
|
}}
|
|
151
|
-
title={country?.name}
|
|
152
178
|
/>
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
borderColor: palette.grey[500],
|
|
164
|
-
height: '1.25rem',
|
|
165
|
-
}}
|
|
166
|
-
/>
|
|
167
|
-
</InputAdornment>
|
|
168
|
-
|
|
169
|
-
<InputAdornment position='start'>
|
|
170
|
-
<Typography color={palette.grey[900]} component='span'>
|
|
171
|
-
{country.code}
|
|
172
|
-
</Typography>
|
|
173
|
-
</InputAdornment>
|
|
174
|
-
</Stack>
|
|
175
|
-
),
|
|
176
|
-
}}
|
|
177
|
-
// eslint-disable-next-line react/jsx-no-duplicate-props
|
|
178
|
-
inputProps={{
|
|
179
|
-
id,
|
|
180
|
-
pattern: '^[0-9\\(\\)\\- ]*$/',
|
|
179
|
+
</InputAdornment>
|
|
180
|
+
|
|
181
|
+
<InputAdornment position='start'>
|
|
182
|
+
<Typography color={palette.grey[900]} component='span'>
|
|
183
|
+
{country.code}
|
|
184
|
+
</Typography>
|
|
185
|
+
</InputAdornment>
|
|
186
|
+
</Stack>
|
|
187
|
+
),
|
|
188
|
+
},
|
|
181
189
|
}}
|
|
182
190
|
placeholder={mask.opts.mask?.toString()}
|
|
183
191
|
value={mask.masked(phoneValue.replace(country.code ?? '', ''))}
|
|
@@ -188,7 +196,6 @@ function RcSesPhoneInputFormControl(props: Props) {
|
|
|
188
196
|
})
|
|
189
197
|
}
|
|
190
198
|
/>
|
|
191
|
-
|
|
192
199
|
<Popper
|
|
193
200
|
anchorEl={anchorEl}
|
|
194
201
|
id={popperId}
|
|
@@ -216,7 +223,6 @@ function RcSesPhoneInputFormControl(props: Props) {
|
|
|
216
223
|
}
|
|
217
224
|
getOptionLabel={(option) => option.name}
|
|
218
225
|
isOptionEqualToValue={(o, v) => o.code === v.code}
|
|
219
|
-
ListboxComponent={ListboxComponent}
|
|
220
226
|
onChange={(e, selection) => {
|
|
221
227
|
e.preventDefault()
|
|
222
228
|
setAnchorEl(null)
|
|
@@ -225,13 +231,20 @@ function RcSesPhoneInputFormControl(props: Props) {
|
|
|
225
231
|
}}
|
|
226
232
|
open
|
|
227
233
|
options={countryOptions}
|
|
228
|
-
PopperComponent={PopperComponent}
|
|
229
234
|
renderInput={AutocompleteInput}
|
|
230
235
|
renderOption={(optionProps, option) =>
|
|
231
236
|
[optionProps, option] as React.ReactNode
|
|
232
237
|
}
|
|
233
238
|
sx={{ width: 300 }}
|
|
234
239
|
{...slotProps?.autocomplete}
|
|
240
|
+
slots={{
|
|
241
|
+
popper: PopperComponent,
|
|
242
|
+
}}
|
|
243
|
+
slotProps={{
|
|
244
|
+
listbox: {
|
|
245
|
+
component: ListboxComponent,
|
|
246
|
+
},
|
|
247
|
+
}}
|
|
235
248
|
/>
|
|
236
249
|
</Box>
|
|
237
250
|
</ClickAwayListener>
|
|
@@ -88,11 +88,12 @@ const RcSesSearchInput = React.forwardRef<HTMLInputElement, Props>((props, ref)
|
|
|
88
88
|
name,
|
|
89
89
|
id: providedId,
|
|
90
90
|
} = props
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
91
|
+
// BREAKING (2.0.0): consumers used to pass slotProps.field.InputProps and
|
|
92
|
+
// slotProps.field.inputProps. MUI 9 removed both from TextFieldProps, so this
|
|
93
|
+
// now mirrors MUI's shape - slotProps.field.slotProps.input and .htmlInput.
|
|
94
|
+
const { slotProps: slotFieldSlotProps, ...restFieldProps } = slotProps?.field ?? {}
|
|
95
|
+
const slotFieldInputProps = slotFieldSlotProps?.input
|
|
96
|
+
const slotFieldNativeInputProps = slotFieldSlotProps?.htmlInput
|
|
96
97
|
const id = useMemo(() => providedId ?? uuidv4(), [providedId])
|
|
97
98
|
|
|
98
99
|
const hasRequiredRule = rules?.required !== undefined
|
|
@@ -167,11 +168,16 @@ const RcSesSearchInput = React.forwardRef<HTMLInputElement, Props>((props, ref)
|
|
|
167
168
|
onChange(parsedValue)
|
|
168
169
|
}
|
|
169
170
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
171
|
+
// MUI 9's slot props may be either an object or a callback taking ownerState.
|
|
172
|
+
// Only the object form can be merged here; the callback form is not supported
|
|
173
|
+
// for this slot and is ignored rather than silently mis-spread.
|
|
174
|
+
const nativeInputSlot =
|
|
175
|
+
typeof slotFieldNativeInputProps === 'function'
|
|
176
|
+
? {}
|
|
177
|
+
: (slotFieldNativeInputProps ?? {})
|
|
178
|
+
|
|
179
|
+
const mergedNativeInputProps: React.InputHTMLAttributes<HTMLInputElement> = {
|
|
180
|
+
...nativeInputSlot,
|
|
175
181
|
...(onlyNumbers
|
|
176
182
|
? {
|
|
177
183
|
inputMode: 'numeric',
|
|
@@ -180,9 +186,10 @@ const RcSesSearchInput = React.forwardRef<HTMLInputElement, Props>((props, ref)
|
|
|
180
186
|
: {}),
|
|
181
187
|
}
|
|
182
188
|
|
|
183
|
-
|
|
189
|
+
// The native-input half is no longer nested here; it is passed separately as
|
|
190
|
+
// slotProps.htmlInput below.
|
|
191
|
+
const mergedTextFieldInputProps = {
|
|
184
192
|
...slotFieldInputProps,
|
|
185
|
-
inputProps: mergedNativeInputProps,
|
|
186
193
|
startAdornment: (
|
|
187
194
|
<InputAdornment position='start' onClick={() => internalInputRef.current?.focus()}>
|
|
188
195
|
<Box
|
|
@@ -234,7 +241,10 @@ const RcSesSearchInput = React.forwardRef<HTMLInputElement, Props>((props, ref)
|
|
|
234
241
|
<TextField
|
|
235
242
|
id={id}
|
|
236
243
|
inputRef={setInputRef}
|
|
237
|
-
|
|
244
|
+
slotProps={{
|
|
245
|
+
input: mergedTextFieldInputProps,
|
|
246
|
+
htmlInput: mergedNativeInputProps,
|
|
247
|
+
}}
|
|
238
248
|
error={!!visibleErrors}
|
|
239
249
|
fullWidth
|
|
240
250
|
{...restFieldProps}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { ThemeProvider } from '@mui/material/styles'
|
|
2
|
+
import { fireEvent, render, screen } from '@testing-library/react'
|
|
3
|
+
import { useForm } from 'react-hook-form'
|
|
4
|
+
import { vi } from 'vitest'
|
|
5
|
+
|
|
6
|
+
import theme from '@/theme/light'
|
|
7
|
+
|
|
8
|
+
import RcSesSearchableField from './SearchableField'
|
|
9
|
+
|
|
10
|
+
vi.mock('react-i18next', () => ({
|
|
11
|
+
useTranslation: () => ({
|
|
12
|
+
t: (key: string) => key,
|
|
13
|
+
}),
|
|
14
|
+
initReactI18next: {
|
|
15
|
+
type: '3rdParty',
|
|
16
|
+
init: () => {},
|
|
17
|
+
},
|
|
18
|
+
}))
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Added ahead of the inputProps -> slotProps migration (SAV-5648 / LIB-08b).
|
|
22
|
+
* This component had no tests, and its "click the field to open the modal"
|
|
23
|
+
* behaviour is wired through the input slot - the same API that silently stopped
|
|
24
|
+
* forwarding event handlers on Switch in MUI 6, where types keep passing and only
|
|
25
|
+
* the runtime breaks. These tests pin the behaviour so the migration is verifiable.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
type ModalProps = {
|
|
29
|
+
open: boolean
|
|
30
|
+
onSubmit: (value: string) => void
|
|
31
|
+
onClose: () => void
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const StubModal = ({ open, onSubmit, onClose }: ModalProps) =>
|
|
35
|
+
open ? (
|
|
36
|
+
<div data-testid='stub-modal'>
|
|
37
|
+
<button type='button' onClick={() => onSubmit('picked-value')}>
|
|
38
|
+
pick
|
|
39
|
+
</button>
|
|
40
|
+
<button type='button' onClick={onClose}>
|
|
41
|
+
close
|
|
42
|
+
</button>
|
|
43
|
+
</div>
|
|
44
|
+
) : null
|
|
45
|
+
|
|
46
|
+
const TestWrapper = ({ defaultValue = '' }: { defaultValue?: string }) => {
|
|
47
|
+
const { control } = useForm({ defaultValues: { object: defaultValue } })
|
|
48
|
+
return (
|
|
49
|
+
<ThemeProvider theme={theme}>
|
|
50
|
+
<RcSesSearchableField
|
|
51
|
+
id='object'
|
|
52
|
+
name='object'
|
|
53
|
+
control={control}
|
|
54
|
+
label='Objektas'
|
|
55
|
+
ModalComponent={StubModal}
|
|
56
|
+
/>
|
|
57
|
+
</ThemeProvider>
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const getField = () => screen.getByRole('textbox') as HTMLInputElement
|
|
62
|
+
|
|
63
|
+
describe('RcSesSearchableField', () => {
|
|
64
|
+
it('should render the field with the value from the form', () => {
|
|
65
|
+
render(<TestWrapper defaultValue='1099-2018-8012' />)
|
|
66
|
+
expect(getField().value).toBe('1099-2018-8012')
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
it('should keep the field read-only so the value can only come from the modal', () => {
|
|
70
|
+
render(<TestWrapper />)
|
|
71
|
+
expect(getField()).toHaveAttribute('readonly')
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
it('should not show the modal initially', () => {
|
|
75
|
+
render(<TestWrapper />)
|
|
76
|
+
expect(screen.queryByTestId('stub-modal')).not.toBeInTheDocument()
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
// The behaviour most at risk from the slot migration: this onClick is passed
|
|
80
|
+
// through the input slot rather than directly on the element.
|
|
81
|
+
it('should open the modal when the field itself is clicked', () => {
|
|
82
|
+
render(<TestWrapper />)
|
|
83
|
+
fireEvent.click(getField())
|
|
84
|
+
expect(screen.getByTestId('stub-modal')).toBeInTheDocument()
|
|
85
|
+
})
|
|
86
|
+
|
|
87
|
+
it('should open the modal when the search adornment button is clicked', () => {
|
|
88
|
+
render(<TestWrapper />)
|
|
89
|
+
fireEvent.click(screen.getByRole('button', { name: 'searchAriaLabel' }))
|
|
90
|
+
expect(screen.getByTestId('stub-modal')).toBeInTheDocument()
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
it('should write the value chosen in the modal back into the field', () => {
|
|
94
|
+
render(<TestWrapper />)
|
|
95
|
+
fireEvent.click(getField())
|
|
96
|
+
fireEvent.click(screen.getByText('pick'))
|
|
97
|
+
expect(getField().value).toBe('picked-value')
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
it('should close the modal without changing the value', () => {
|
|
101
|
+
render(<TestWrapper defaultValue='kept' />)
|
|
102
|
+
fireEvent.click(getField())
|
|
103
|
+
fireEvent.click(screen.getByText('close'))
|
|
104
|
+
expect(screen.queryByTestId('stub-modal')).not.toBeInTheDocument()
|
|
105
|
+
expect(getField().value).toBe('kept')
|
|
106
|
+
})
|
|
107
|
+
|
|
108
|
+
it('should only offer the clear button once there is a value', () => {
|
|
109
|
+
const { unmount } = render(<TestWrapper />)
|
|
110
|
+
expect(
|
|
111
|
+
screen.queryByRole('button', { name: 'clearValueAriaLabel' }),
|
|
112
|
+
).not.toBeInTheDocument()
|
|
113
|
+
unmount()
|
|
114
|
+
|
|
115
|
+
render(<TestWrapper defaultValue='1099-2018-8012' />)
|
|
116
|
+
expect(
|
|
117
|
+
screen.getByRole('button', { name: 'clearValueAriaLabel' }),
|
|
118
|
+
).toBeInTheDocument()
|
|
119
|
+
})
|
|
120
|
+
|
|
121
|
+
it('should clear the value when the clear button is clicked', () => {
|
|
122
|
+
render(<TestWrapper defaultValue='1099-2018-8012' />)
|
|
123
|
+
fireEvent.click(screen.getByRole('button', { name: 'clearValueAriaLabel' }))
|
|
124
|
+
expect(getField().value).toBe('')
|
|
125
|
+
})
|
|
126
|
+
})
|
|
@@ -72,33 +72,38 @@ const RcSesSearchableField = React.forwardRef<HTMLInputElement, Props>((props, r
|
|
|
72
72
|
<TextField
|
|
73
73
|
id={id}
|
|
74
74
|
inputRef={ref}
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
slotProps={{
|
|
76
|
+
// Was InputProps: targets the OutlinedInput wrapper.
|
|
77
|
+
input: {
|
|
78
|
+
readOnly: true,
|
|
79
|
+
startAdornment: (
|
|
80
|
+
<InputAdornment position='start'>
|
|
81
|
+
<IconButton
|
|
82
|
+
aria-label={t('searchAriaLabel')}
|
|
83
|
+
onClick={() => setModalOpen(true)}
|
|
84
|
+
>
|
|
85
|
+
<MagnifyingGlassIcon />
|
|
86
|
+
</IconButton>
|
|
87
|
+
</InputAdornment>
|
|
88
|
+
),
|
|
89
|
+
endAdornment: !!value && (
|
|
90
|
+
<InputAdornment position='end'>
|
|
91
|
+
<IconButton
|
|
92
|
+
aria-label={t('clearValueAriaLabel')}
|
|
93
|
+
onClick={() => onChange('')}
|
|
94
|
+
>
|
|
95
|
+
<XCircleFillIcon />
|
|
96
|
+
</IconButton>
|
|
97
|
+
</InputAdornment>
|
|
98
|
+
),
|
|
99
|
+
sx: { cursor: 'pointer' },
|
|
100
|
+
},
|
|
101
|
+
// Was the inputProps nested inside InputProps: targets the native
|
|
102
|
+
// <input>. This is what makes clicking the field open the modal.
|
|
103
|
+
htmlInput: {
|
|
77
104
|
onClick: () => setModalOpen(true),
|
|
78
105
|
sx: { cursor: 'pointer' },
|
|
79
106
|
},
|
|
80
|
-
readOnly: true,
|
|
81
|
-
startAdornment: (
|
|
82
|
-
<InputAdornment position='start'>
|
|
83
|
-
<IconButton
|
|
84
|
-
aria-label={t('searchAriaLabel')}
|
|
85
|
-
onClick={() => setModalOpen(true)}
|
|
86
|
-
>
|
|
87
|
-
<MagnifyingGlassIcon />
|
|
88
|
-
</IconButton>
|
|
89
|
-
</InputAdornment>
|
|
90
|
-
),
|
|
91
|
-
endAdornment: !!value && (
|
|
92
|
-
<InputAdornment position='end'>
|
|
93
|
-
<IconButton
|
|
94
|
-
aria-label={t('clearValueAriaLabel')}
|
|
95
|
-
onClick={() => onChange('')}
|
|
96
|
-
>
|
|
97
|
-
<XCircleFillIcon />
|
|
98
|
-
</IconButton>
|
|
99
|
-
</InputAdornment>
|
|
100
|
-
),
|
|
101
|
-
sx: { cursor: 'pointer' },
|
|
102
107
|
}}
|
|
103
108
|
error={!!errors}
|
|
104
109
|
fullWidth
|