From 6589a44d6621da65417387d5a84520558f284565 Mon Sep 17 00:00:00 2001 From: Kenan Yusuf Date: Thu, 21 Nov 2024 13:43:10 +0000 Subject: [PATCH] [DataGrid] Add prop to override search input props in `GridColumnsManagement` (#15476) Co-authored-by: Rajat --- docs/data/data-grid/localization/data.json | 140 +++++++++--------- .../x/api/data-grid/data-grid-premium.json | 6 + docs/pages/x/api/data-grid/data-grid-pro.json | 6 + docs/pages/x/api/data-grid/data-grid.json | 6 + .../data-grid-premium/data-grid-premium.json | 4 + .../data-grid-pro/data-grid-pro.json | 4 + .../data-grid/data-grid/data-grid.json | 4 + .../GridColumnsManagement.tsx | 59 +++++++- .../x-data-grid/src/constants/gridClasses.ts | 5 + .../src/constants/localeTextConstants.ts | 1 + packages/x-data-grid/src/locales/arSD.ts | 1 + packages/x-data-grid/src/locales/beBY.ts | 1 + packages/x-data-grid/src/locales/bgBG.ts | 1 + packages/x-data-grid/src/locales/csCZ.ts | 1 + packages/x-data-grid/src/locales/daDK.ts | 1 + packages/x-data-grid/src/locales/deDE.ts | 1 + packages/x-data-grid/src/locales/elGR.ts | 1 + packages/x-data-grid/src/locales/esES.ts | 1 + packages/x-data-grid/src/locales/faIR.ts | 1 + packages/x-data-grid/src/locales/fiFI.ts | 1 + packages/x-data-grid/src/locales/frFR.ts | 1 + packages/x-data-grid/src/locales/heIL.ts | 1 + packages/x-data-grid/src/locales/hrHR.ts | 1 + packages/x-data-grid/src/locales/huHU.ts | 1 + packages/x-data-grid/src/locales/isIS.ts | 1 + packages/x-data-grid/src/locales/itIT.ts | 1 + packages/x-data-grid/src/locales/jaJP.ts | 1 + packages/x-data-grid/src/locales/koKR.ts | 1 + packages/x-data-grid/src/locales/nbNO.ts | 1 + packages/x-data-grid/src/locales/nlNL.ts | 1 + packages/x-data-grid/src/locales/nnNO.ts | 1 + packages/x-data-grid/src/locales/plPL.ts | 1 + packages/x-data-grid/src/locales/ptBR.ts | 1 + packages/x-data-grid/src/locales/ptPT.ts | 1 + packages/x-data-grid/src/locales/roRO.ts | 1 + packages/x-data-grid/src/locales/ruRU.ts | 1 + packages/x-data-grid/src/locales/skSK.ts | 1 + packages/x-data-grid/src/locales/svSE.ts | 1 + packages/x-data-grid/src/locales/trTR.ts | 1 + packages/x-data-grid/src/locales/ukUA.ts | 1 + packages/x-data-grid/src/locales/urPK.ts | 1 + packages/x-data-grid/src/locales/viVN.ts | 1 + packages/x-data-grid/src/locales/zhCN.ts | 1 + packages/x-data-grid/src/locales/zhHK.ts | 1 + packages/x-data-grid/src/locales/zhTW.ts | 1 + .../src/models/api/gridLocaleTextApi.ts | 1 + .../src/tests/toolbar.DataGrid.test.tsx | 2 +- 47 files changed, 200 insertions(+), 73 deletions(-) diff --git a/docs/data/data-grid/localization/data.json b/docs/data/data-grid/localization/data.json index 11f8df422fca..fd05c60a5c02 100644 --- a/docs/data/data-grid/localization/data.json +++ b/docs/data/data-grid/localization/data.json @@ -3,280 +3,280 @@ "languageTag": "ar-SD", "importName": "arSD", "localeName": "Arabic (Sudan)", - "missingKeysCount": 8, - "totalKeysCount": 122, + "missingKeysCount": 9, + "totalKeysCount": 123, "githubLink": "https://github.com/mui/mui-x/blob/v7.x/packages/x-data-grid/src/locales/arSD.ts" }, { "languageTag": "be-BY", "importName": "beBY", "localeName": "Belarusian", - "missingKeysCount": 34, - "totalKeysCount": 122, + "missingKeysCount": 35, + "totalKeysCount": 123, "githubLink": "https://github.com/mui/mui-x/blob/v7.x/packages/x-data-grid/src/locales/beBY.ts" }, { "languageTag": "bg-BG", "importName": "bgBG", "localeName": "Bulgarian", - "missingKeysCount": 0, - "totalKeysCount": 122, + "missingKeysCount": 1, + "totalKeysCount": 123, "githubLink": "https://github.com/mui/mui-x/blob/v7.x/packages/x-data-grid/src/locales/bgBG.ts" }, { "languageTag": "zh-HK", "importName": "zhHK", "localeName": "Chinese (Hong Kong)", - "missingKeysCount": 8, - "totalKeysCount": 122, + "missingKeysCount": 9, + "totalKeysCount": 123, "githubLink": "https://github.com/mui/mui-x/blob/v7.x/packages/x-data-grid/src/locales/zhHK.ts" }, { "languageTag": "zh-CN", "importName": "zhCN", "localeName": "Chinese (Simplified)", - "missingKeysCount": 0, - "totalKeysCount": 122, + "missingKeysCount": 1, + "totalKeysCount": 123, "githubLink": "https://github.com/mui/mui-x/blob/v7.x/packages/x-data-grid/src/locales/zhCN.ts" }, { "languageTag": "zh-TW", "importName": "zhTW", "localeName": "Chinese (Taiwan)", - "missingKeysCount": 8, - "totalKeysCount": 122, + "missingKeysCount": 9, + "totalKeysCount": 123, "githubLink": "https://github.com/mui/mui-x/blob/v7.x/packages/x-data-grid/src/locales/zhTW.ts" }, { "languageTag": "hr-HR", "importName": "hrHR", "localeName": "Croatian", - "missingKeysCount": 0, - "totalKeysCount": 122, + "missingKeysCount": 1, + "totalKeysCount": 123, "githubLink": "https://github.com/mui/mui-x/blob/v7.x/packages/x-data-grid/src/locales/hrHR.ts" }, { "languageTag": "cs-CZ", "importName": "csCZ", "localeName": "Czech", - "missingKeysCount": 4, - "totalKeysCount": 122, + "missingKeysCount": 5, + "totalKeysCount": 123, "githubLink": "https://github.com/mui/mui-x/blob/v7.x/packages/x-data-grid/src/locales/csCZ.ts" }, { "languageTag": "da-DK", "importName": "daDK", "localeName": "Danish", - "missingKeysCount": 0, - "totalKeysCount": 122, + "missingKeysCount": 1, + "totalKeysCount": 123, "githubLink": "https://github.com/mui/mui-x/blob/v7.x/packages/x-data-grid/src/locales/daDK.ts" }, { "languageTag": "nl-NL", "importName": "nlNL", "localeName": "Dutch", - "missingKeysCount": 4, - "totalKeysCount": 122, + "missingKeysCount": 5, + "totalKeysCount": 123, "githubLink": "https://github.com/mui/mui-x/blob/v7.x/packages/x-data-grid/src/locales/nlNL.ts" }, { "languageTag": "fi-FI", "importName": "fiFI", "localeName": "Finnish", - "missingKeysCount": 4, - "totalKeysCount": 122, + "missingKeysCount": 5, + "totalKeysCount": 123, "githubLink": "https://github.com/mui/mui-x/blob/v7.x/packages/x-data-grid/src/locales/fiFI.ts" }, { "languageTag": "fr-FR", "importName": "frFR", "localeName": "French", - "missingKeysCount": 0, - "totalKeysCount": 122, + "missingKeysCount": 1, + "totalKeysCount": 123, "githubLink": "https://github.com/mui/mui-x/blob/v7.x/packages/x-data-grid/src/locales/frFR.ts" }, { "languageTag": "de-DE", "importName": "deDE", "localeName": "German", - "missingKeysCount": 0, - "totalKeysCount": 122, + "missingKeysCount": 1, + "totalKeysCount": 123, "githubLink": "https://github.com/mui/mui-x/blob/v7.x/packages/x-data-grid/src/locales/deDE.ts" }, { "languageTag": "el-GR", "importName": "elGR", "localeName": "Greek", - "missingKeysCount": 8, - "totalKeysCount": 122, + "missingKeysCount": 9, + "totalKeysCount": 123, "githubLink": "https://github.com/mui/mui-x/blob/v7.x/packages/x-data-grid/src/locales/elGR.ts" }, { "languageTag": "he-IL", "importName": "heIL", "localeName": "Hebrew", - "missingKeysCount": 4, - "totalKeysCount": 122, + "missingKeysCount": 5, + "totalKeysCount": 123, "githubLink": "https://github.com/mui/mui-x/blob/v7.x/packages/x-data-grid/src/locales/heIL.ts" }, { "languageTag": "hu-HU", "importName": "huHU", "localeName": "Hungarian", - "missingKeysCount": 6, - "totalKeysCount": 122, + "missingKeysCount": 7, + "totalKeysCount": 123, "githubLink": "https://github.com/mui/mui-x/blob/v7.x/packages/x-data-grid/src/locales/huHU.ts" }, { "languageTag": "is-IS", "importName": "isIS", "localeName": "Icelandic", - "missingKeysCount": 8, - "totalKeysCount": 122, + "missingKeysCount": 9, + "totalKeysCount": 123, "githubLink": "https://github.com/mui/mui-x/blob/v7.x/packages/x-data-grid/src/locales/isIS.ts" }, { "languageTag": "it-IT", "importName": "itIT", "localeName": "Italian", - "missingKeysCount": 0, - "totalKeysCount": 122, + "missingKeysCount": 1, + "totalKeysCount": 123, "githubLink": "https://github.com/mui/mui-x/blob/v7.x/packages/x-data-grid/src/locales/itIT.ts" }, { "languageTag": "ja-JP", "importName": "jaJP", "localeName": "Japanese", - "missingKeysCount": 0, - "totalKeysCount": 122, + "missingKeysCount": 1, + "totalKeysCount": 123, "githubLink": "https://github.com/mui/mui-x/blob/v7.x/packages/x-data-grid/src/locales/jaJP.ts" }, { "languageTag": "ko-KR", "importName": "koKR", "localeName": "Korean", - "missingKeysCount": 35, - "totalKeysCount": 122, + "missingKeysCount": 36, + "totalKeysCount": 123, "githubLink": "https://github.com/mui/mui-x/blob/v7.x/packages/x-data-grid/src/locales/koKR.ts" }, { "languageTag": "nb-NO", "importName": "nbNO", "localeName": "Norwegian (Bokmål)", - "missingKeysCount": 4, - "totalKeysCount": 122, + "missingKeysCount": 5, + "totalKeysCount": 123, "githubLink": "https://github.com/mui/mui-x/blob/v7.x/packages/x-data-grid/src/locales/nbNO.ts" }, { "languageTag": "nn-NO", "importName": "nnNO", "localeName": "Norwegian (Nynorsk)", - "missingKeysCount": 4, - "totalKeysCount": 122, + "missingKeysCount": 5, + "totalKeysCount": 123, "githubLink": "https://github.com/mui/mui-x/blob/v7.x/packages/x-data-grid/src/locales/nnNO.ts" }, { "languageTag": "fa-IR", "importName": "faIR", "localeName": "Persian", - "missingKeysCount": 4, - "totalKeysCount": 122, + "missingKeysCount": 5, + "totalKeysCount": 123, "githubLink": "https://github.com/mui/mui-x/blob/v7.x/packages/x-data-grid/src/locales/faIR.ts" }, { "languageTag": "pl-PL", "importName": "plPL", "localeName": "Polish", - "missingKeysCount": 35, - "totalKeysCount": 122, + "missingKeysCount": 36, + "totalKeysCount": 123, "githubLink": "https://github.com/mui/mui-x/blob/v7.x/packages/x-data-grid/src/locales/plPL.ts" }, { "languageTag": "pt-PT", "importName": "ptPT", "localeName": "Portuguese", - "missingKeysCount": 0, - "totalKeysCount": 122, + "missingKeysCount": 1, + "totalKeysCount": 123, "githubLink": "https://github.com/mui/mui-x/blob/v7.x/packages/x-data-grid/src/locales/ptPT.ts" }, { "languageTag": "pt-BR", "importName": "ptBR", "localeName": "Portuguese (Brazil)", - "missingKeysCount": 0, - "totalKeysCount": 122, + "missingKeysCount": 1, + "totalKeysCount": 123, "githubLink": "https://github.com/mui/mui-x/blob/v7.x/packages/x-data-grid/src/locales/ptBR.ts" }, { "languageTag": "ro-RO", "importName": "roRO", "localeName": "Romanian", - "missingKeysCount": 8, - "totalKeysCount": 122, + "missingKeysCount": 9, + "totalKeysCount": 123, "githubLink": "https://github.com/mui/mui-x/blob/v7.x/packages/x-data-grid/src/locales/roRO.ts" }, { "languageTag": "ru-RU", "importName": "ruRU", "localeName": "Russian", - "missingKeysCount": 4, - "totalKeysCount": 122, + "missingKeysCount": 5, + "totalKeysCount": 123, "githubLink": "https://github.com/mui/mui-x/blob/v7.x/packages/x-data-grid/src/locales/ruRU.ts" }, { "languageTag": "sk-SK", "importName": "skSK", "localeName": "Slovak", - "missingKeysCount": 5, - "totalKeysCount": 122, + "missingKeysCount": 6, + "totalKeysCount": 123, "githubLink": "https://github.com/mui/mui-x/blob/v7.x/packages/x-data-grid/src/locales/skSK.ts" }, { "languageTag": "es-ES", "importName": "esES", "localeName": "Spanish", - "missingKeysCount": 0, - "totalKeysCount": 122, + "missingKeysCount": 1, + "totalKeysCount": 123, "githubLink": "https://github.com/mui/mui-x/blob/v7.x/packages/x-data-grid/src/locales/esES.ts" }, { "languageTag": "sv-SE", "importName": "svSE", "localeName": "Swedish", - "missingKeysCount": 0, - "totalKeysCount": 122, + "missingKeysCount": 1, + "totalKeysCount": 123, "githubLink": "https://github.com/mui/mui-x/blob/v7.x/packages/x-data-grid/src/locales/svSE.ts" }, { "languageTag": "tr-TR", "importName": "trTR", "localeName": "Turkish", - "missingKeysCount": 2, - "totalKeysCount": 122, + "missingKeysCount": 3, + "totalKeysCount": 123, "githubLink": "https://github.com/mui/mui-x/blob/v7.x/packages/x-data-grid/src/locales/trTR.ts" }, { "languageTag": "uk-UA", "importName": "ukUA", "localeName": "Ukrainian", - "missingKeysCount": 8, - "totalKeysCount": 122, + "missingKeysCount": 9, + "totalKeysCount": 123, "githubLink": "https://github.com/mui/mui-x/blob/v7.x/packages/x-data-grid/src/locales/ukUA.ts" }, { "languageTag": "ur-PK", "importName": "urPK", "localeName": "Urdu (Pakistan)", - "missingKeysCount": 8, - "totalKeysCount": 122, + "missingKeysCount": 9, + "totalKeysCount": 123, "githubLink": "https://github.com/mui/mui-x/blob/v7.x/packages/x-data-grid/src/locales/urPK.ts" }, { "languageTag": "vi-VN", "importName": "viVN", "localeName": "Vietnamese", - "missingKeysCount": 0, - "totalKeysCount": 122, + "missingKeysCount": 1, + "totalKeysCount": 123, "githubLink": "https://github.com/mui/mui-x/blob/v7.x/packages/x-data-grid/src/locales/viVN.ts" } ] diff --git a/docs/pages/x/api/data-grid/data-grid-premium.json b/docs/pages/x/api/data-grid/data-grid-premium.json index 99283c51b8ae..7497389556f5 100644 --- a/docs/pages/x/api/data-grid/data-grid-premium.json +++ b/docs/pages/x/api/data-grid/data-grid-premium.json @@ -1464,6 +1464,12 @@ "description": "Styles applied to the columns management row element.", "isGlobal": false }, + { + "key": "columnsManagementSearchInput", + "className": "MuiDataGridPremium-columnsManagementSearchInput", + "description": "Styles applied to the columns management search input element.", + "isGlobal": false + }, { "key": "container--bottom", "className": "MuiDataGridPremium-container--bottom", diff --git a/docs/pages/x/api/data-grid/data-grid-pro.json b/docs/pages/x/api/data-grid/data-grid-pro.json index 3a0923e1a1d9..0c9713826173 100644 --- a/docs/pages/x/api/data-grid/data-grid-pro.json +++ b/docs/pages/x/api/data-grid/data-grid-pro.json @@ -1378,6 +1378,12 @@ "description": "Styles applied to the columns management row element.", "isGlobal": false }, + { + "key": "columnsManagementSearchInput", + "className": "MuiDataGridPro-columnsManagementSearchInput", + "description": "Styles applied to the columns management search input element.", + "isGlobal": false + }, { "key": "container--bottom", "className": "MuiDataGridPro-container--bottom", diff --git a/docs/pages/x/api/data-grid/data-grid.json b/docs/pages/x/api/data-grid/data-grid.json index 87da7c9e9a81..7effab95eb67 100644 --- a/docs/pages/x/api/data-grid/data-grid.json +++ b/docs/pages/x/api/data-grid/data-grid.json @@ -1253,6 +1253,12 @@ "description": "Styles applied to the columns management row element.", "isGlobal": false }, + { + "key": "columnsManagementSearchInput", + "className": "MuiDataGrid-columnsManagementSearchInput", + "description": "Styles applied to the columns management search input element.", + "isGlobal": false + }, { "key": "container--bottom", "className": "MuiDataGrid-container--bottom", diff --git a/docs/translations/api-docs/data-grid/data-grid-premium/data-grid-premium.json b/docs/translations/api-docs/data-grid/data-grid-premium/data-grid-premium.json index dc242fd21180..87146ea00c4f 100644 --- a/docs/translations/api-docs/data-grid/data-grid-premium/data-grid-premium.json +++ b/docs/translations/api-docs/data-grid/data-grid-premium/data-grid-premium.json @@ -923,6 +923,10 @@ "description": "Styles applied to {{nodeName}}.", "nodeName": "the columns management row element" }, + "columnsManagementSearchInput": { + "description": "Styles applied to {{nodeName}}.", + "nodeName": "the columns management search input element" + }, "container--bottom": { "description": "Styles applied to {{nodeName}}.", "nodeName": "the bottom container" diff --git a/docs/translations/api-docs/data-grid/data-grid-pro/data-grid-pro.json b/docs/translations/api-docs/data-grid/data-grid-pro/data-grid-pro.json index 42302d388bbf..1beda7ae96a8 100644 --- a/docs/translations/api-docs/data-grid/data-grid-pro/data-grid-pro.json +++ b/docs/translations/api-docs/data-grid/data-grid-pro/data-grid-pro.json @@ -861,6 +861,10 @@ "description": "Styles applied to {{nodeName}}.", "nodeName": "the columns management row element" }, + "columnsManagementSearchInput": { + "description": "Styles applied to {{nodeName}}.", + "nodeName": "the columns management search input element" + }, "container--bottom": { "description": "Styles applied to {{nodeName}}.", "nodeName": "the bottom container" diff --git a/docs/translations/api-docs/data-grid/data-grid/data-grid.json b/docs/translations/api-docs/data-grid/data-grid/data-grid.json index 141c83b1b2eb..ecd06e565a60 100644 --- a/docs/translations/api-docs/data-grid/data-grid/data-grid.json +++ b/docs/translations/api-docs/data-grid/data-grid/data-grid.json @@ -741,6 +741,10 @@ "description": "Styles applied to {{nodeName}}.", "nodeName": "the columns management row element" }, + "columnsManagementSearchInput": { + "description": "Styles applied to {{nodeName}}.", + "nodeName": "the columns management search input element" + }, "container--bottom": { "description": "Styles applied to {{nodeName}}.", "nodeName": "the bottom container" diff --git a/packages/x-data-grid/src/components/columnsManagement/GridColumnsManagement.tsx b/packages/x-data-grid/src/components/columnsManagement/GridColumnsManagement.tsx index 431736337d34..a5c15703ecb1 100644 --- a/packages/x-data-grid/src/components/columnsManagement/GridColumnsManagement.tsx +++ b/packages/x-data-grid/src/components/columnsManagement/GridColumnsManagement.tsx @@ -4,6 +4,8 @@ import PropTypes from 'prop-types'; import composeClasses from '@mui/utils/composeClasses'; import FormControlLabel from '@mui/material/FormControlLabel'; import { styled } from '@mui/material/styles'; +import TextField, { TextFieldProps } from '@mui/material/TextField'; +import { inputBaseClasses } from '@mui/material/InputBase'; import { gridColumnDefinitionsSelector, gridColumnVisibilityModelSelector, @@ -24,6 +26,7 @@ export interface GridColumnsManagementProps { */ sort?: 'asc' | 'desc'; searchPredicate?: (column: GridColDef, searchValue: string) => boolean; + searchInputProps?: Partial; /** * If `true`, the column search field will be focused automatically. * If `false`, the first column switch input will be focused automatically. @@ -66,6 +69,7 @@ const useUtilityClasses = (ownerState: OwnerState) => { const slots = { root: ['columnsManagement'], header: ['columnsManagementHeader'], + searchInput: ['columnsManagementSearchInput'], footer: ['columnsManagementFooter'], row: ['columnsManagementRow'], }; @@ -95,6 +99,7 @@ function GridColumnsManagement(props: GridColumnsManagementProps) { disableResetButton = false, toggleAllMode = 'all', getTogglableColumns, + searchInputProps, } = props; const isResetDisabled = React.useMemo( @@ -207,27 +212,59 @@ function GridColumnsManagement(props: GridColumnsManagementProps) { } return false; }; + const handleSearchReset = React.useCallback(() => { + setSearchValue(''); + searchInputRef.current!.focus(); + }, []); return ( - ), - sx: { pl: 1.5 }, + endAdornment: ( + + + + ), + }} + inputProps={{ + 'aria-label': apiRef.current.getLocaleText('columnsManagementSearchTitle'), }} + autoComplete="off" fullWidth {...rootProps.slotProps?.baseTextField} + {...searchInputProps} /> @@ -321,6 +358,7 @@ GridColumnsManagement.propTypes = { * @returns {GridColDef['field'][]} The list of togglable columns' field names. */ getTogglableColumns: PropTypes.func, + searchInputProps: PropTypes.object, searchPredicate: PropTypes.func, sort: PropTypes.oneOf(['asc', 'desc']), /** @@ -354,6 +392,23 @@ const GridColumnsManagementHeader = styled('div', { padding: theme.spacing(1.5, 3), })); +const SearchInput = styled(TextField, { + name: 'MuiDataGrid', + slot: 'ColumnsManagementSearchInput', + overridesResolver: (props, styles) => styles.columnsManagementSearchInput, +})<{ ownerState: OwnerState }>(({ theme }) => ({ + [`& .${inputBaseClasses.root}`]: { + padding: theme.spacing(0, 1.5, 0, 1.5), + }, + [`& .${inputBaseClasses.input}::-webkit-search-decoration, + & .${inputBaseClasses.input}::-webkit-search-cancel-button, + & .${inputBaseClasses.input}::-webkit-search-results-button, + & .${inputBaseClasses.input}::-webkit-search-results-decoration`]: { + /* clears the 'X' icon from Chrome */ + display: 'none', + }, +})); + const GridColumnsManagementFooter = styled('div', { name: 'MuiDataGrid', slot: 'ColumnsManagementFooter', diff --git a/packages/x-data-grid/src/constants/gridClasses.ts b/packages/x-data-grid/src/constants/gridClasses.ts index 06ce8915846a..9082fae28e0e 100644 --- a/packages/x-data-grid/src/constants/gridClasses.ts +++ b/packages/x-data-grid/src/constants/gridClasses.ts @@ -242,6 +242,10 @@ export interface GridClasses { * Styles applied to the columns management header element. */ columnsManagementHeader: string; + /** + * Styles applied to the columns management search input element. + */ + columnsManagementSearchInput: string; /** * Styles applied to the columns management footer element. */ @@ -720,6 +724,7 @@ export const gridClasses = generateUtilityClasses('MuiDataGrid', [ 'columnsManagement', 'columnsManagementRow', 'columnsManagementHeader', + 'columnsManagementSearchInput', 'columnsManagementFooter', 'container--top', 'container--bottom', diff --git a/packages/x-data-grid/src/constants/localeTextConstants.ts b/packages/x-data-grid/src/constants/localeTextConstants.ts index c0d29a97a0e9..395d73a7355b 100644 --- a/packages/x-data-grid/src/constants/localeTextConstants.ts +++ b/packages/x-data-grid/src/constants/localeTextConstants.ts @@ -41,6 +41,7 @@ export const GRID_DEFAULT_LOCALE_TEXT: GridLocaleText = { columnsManagementNoColumns: 'No columns', columnsManagementShowHideAllText: 'Show/Hide All', columnsManagementReset: 'Reset', + columnsManagementDeleteIconLabel: 'Clear', // Filter panel text filterPanelAddFilter: 'Add filter', diff --git a/packages/x-data-grid/src/locales/arSD.ts b/packages/x-data-grid/src/locales/arSD.ts index 5d3ebd5993e5..b9aadc4d34bb 100644 --- a/packages/x-data-grid/src/locales/arSD.ts +++ b/packages/x-data-grid/src/locales/arSD.ts @@ -43,6 +43,7 @@ const arSDGrid: Partial = { // columnsManagementNoColumns: 'No columns', // columnsManagementShowHideAllText: 'Show/Hide All', // columnsManagementReset: 'Reset', + // columnsManagementDeleteIconLabel: 'Clear', // Filter panel text filterPanelAddFilter: 'إضافة مرشِح', diff --git a/packages/x-data-grid/src/locales/beBY.ts b/packages/x-data-grid/src/locales/beBY.ts index bba9d37e0fbd..e11cb810e4cf 100644 --- a/packages/x-data-grid/src/locales/beBY.ts +++ b/packages/x-data-grid/src/locales/beBY.ts @@ -66,6 +66,7 @@ const beBYGrid: Partial = { // columnsManagementNoColumns: 'No columns', // columnsManagementShowHideAllText: 'Show/Hide All', // columnsManagementReset: 'Reset', + // columnsManagementDeleteIconLabel: 'Clear', // Filter panel text filterPanelAddFilter: 'Дадаць фільтр', diff --git a/packages/x-data-grid/src/locales/bgBG.ts b/packages/x-data-grid/src/locales/bgBG.ts index 3c360f174e45..a27adce61ffa 100644 --- a/packages/x-data-grid/src/locales/bgBG.ts +++ b/packages/x-data-grid/src/locales/bgBG.ts @@ -42,6 +42,7 @@ const bgBGGrid: Partial = { columnsManagementNoColumns: 'Няма колони', columnsManagementShowHideAllText: 'Покажи/Скрий Всичко', columnsManagementReset: 'Нулирай', + // columnsManagementDeleteIconLabel: 'Clear', // Filter panel text filterPanelAddFilter: 'Добави Филтър', diff --git a/packages/x-data-grid/src/locales/csCZ.ts b/packages/x-data-grid/src/locales/csCZ.ts index c5b26a3ce10e..18611554aa82 100644 --- a/packages/x-data-grid/src/locales/csCZ.ts +++ b/packages/x-data-grid/src/locales/csCZ.ts @@ -50,6 +50,7 @@ const csCZGrid: Partial = { columnsManagementNoColumns: 'Žádné sloupce', columnsManagementShowHideAllText: 'Zobrazit/skrýt vše', columnsManagementReset: 'Resetovat', + // columnsManagementDeleteIconLabel: 'Clear', // Filter panel text filterPanelAddFilter: 'Přidat filtr', diff --git a/packages/x-data-grid/src/locales/daDK.ts b/packages/x-data-grid/src/locales/daDK.ts index dc305634c30e..d6094d42ce26 100644 --- a/packages/x-data-grid/src/locales/daDK.ts +++ b/packages/x-data-grid/src/locales/daDK.ts @@ -43,6 +43,7 @@ const daDKGrid: Partial = { columnsManagementNoColumns: 'Ingen søjler', columnsManagementShowHideAllText: 'Vis/Skjul Alle', columnsManagementReset: 'Nulstil', + // columnsManagementDeleteIconLabel: 'Clear', // Filter panel text filterPanelAddFilter: 'Tilføj filter', diff --git a/packages/x-data-grid/src/locales/deDE.ts b/packages/x-data-grid/src/locales/deDE.ts index 31a9350cb5e1..48c894e57ecd 100644 --- a/packages/x-data-grid/src/locales/deDE.ts +++ b/packages/x-data-grid/src/locales/deDE.ts @@ -43,6 +43,7 @@ const deDEGrid: Partial = { columnsManagementNoColumns: 'Keine Spalten', columnsManagementShowHideAllText: 'Alle anzeigen/verbergen', columnsManagementReset: 'Zurücksetzen', + // columnsManagementDeleteIconLabel: 'Clear', // Filter panel text filterPanelAddFilter: 'Filter hinzufügen', diff --git a/packages/x-data-grid/src/locales/elGR.ts b/packages/x-data-grid/src/locales/elGR.ts index dbd6bdc36f3d..ad0c394d99ef 100644 --- a/packages/x-data-grid/src/locales/elGR.ts +++ b/packages/x-data-grid/src/locales/elGR.ts @@ -43,6 +43,7 @@ const elGRGrid: Partial = { // columnsManagementNoColumns: 'No columns', // columnsManagementShowHideAllText: 'Show/Hide All', // columnsManagementReset: 'Reset', + // columnsManagementDeleteIconLabel: 'Clear', // Filter panel text filterPanelAddFilter: 'Προσθήκη φίλτρου', diff --git a/packages/x-data-grid/src/locales/esES.ts b/packages/x-data-grid/src/locales/esES.ts index 51d21e31b688..87d6133d30a2 100644 --- a/packages/x-data-grid/src/locales/esES.ts +++ b/packages/x-data-grid/src/locales/esES.ts @@ -43,6 +43,7 @@ const esESGrid: Partial = { columnsManagementNoColumns: 'Sin columnas', columnsManagementShowHideAllText: 'Mostrar/Ocultar todas', columnsManagementReset: 'Restablecer', + // columnsManagementDeleteIconLabel: 'Clear', // Filter panel text filterPanelAddFilter: 'Agregar filtro', diff --git a/packages/x-data-grid/src/locales/faIR.ts b/packages/x-data-grid/src/locales/faIR.ts index 41dbdd4ca402..6fc24b6f734e 100644 --- a/packages/x-data-grid/src/locales/faIR.ts +++ b/packages/x-data-grid/src/locales/faIR.ts @@ -43,6 +43,7 @@ const faIRGrid: Partial = { columnsManagementNoColumns: 'بدون سطر', columnsManagementShowHideAllText: 'نمایش/مخفی کردن همه', columnsManagementReset: 'بازنشانی', + // columnsManagementDeleteIconLabel: 'Clear', // Filter panel text filterPanelAddFilter: 'افزودن فیلتر', diff --git a/packages/x-data-grid/src/locales/fiFI.ts b/packages/x-data-grid/src/locales/fiFI.ts index d8fee01123fb..00391b62b18c 100644 --- a/packages/x-data-grid/src/locales/fiFI.ts +++ b/packages/x-data-grid/src/locales/fiFI.ts @@ -43,6 +43,7 @@ const fiFIGrid: Partial = { columnsManagementNoColumns: 'Ei sarakkeita näytettäväksi', columnsManagementShowHideAllText: 'Näytä/Piilota kaikki', columnsManagementReset: 'Palauta', + // columnsManagementDeleteIconLabel: 'Clear', // Filter panel text filterPanelAddFilter: 'Lisää suodatin', diff --git a/packages/x-data-grid/src/locales/frFR.ts b/packages/x-data-grid/src/locales/frFR.ts index 96abb7fc40e9..e6928a00e57a 100644 --- a/packages/x-data-grid/src/locales/frFR.ts +++ b/packages/x-data-grid/src/locales/frFR.ts @@ -43,6 +43,7 @@ const frFRGrid: Partial = { columnsManagementNoColumns: 'Pas de colonnes', columnsManagementShowHideAllText: 'Afficher/masquer toutes', columnsManagementReset: 'Réinitialiser', + // columnsManagementDeleteIconLabel: 'Clear', // Filter panel text filterPanelAddFilter: 'Ajouter un filtre', diff --git a/packages/x-data-grid/src/locales/heIL.ts b/packages/x-data-grid/src/locales/heIL.ts index 61556403a76a..7612d2a8cc39 100644 --- a/packages/x-data-grid/src/locales/heIL.ts +++ b/packages/x-data-grid/src/locales/heIL.ts @@ -43,6 +43,7 @@ const heILGrid: Partial = { columnsManagementNoColumns: 'אין עמודות', columnsManagementShowHideAllText: 'הצג/הסתר הכל', columnsManagementReset: 'אתחול', + // columnsManagementDeleteIconLabel: 'Clear', // Filter panel text filterPanelAddFilter: 'הוסף מסנן', diff --git a/packages/x-data-grid/src/locales/hrHR.ts b/packages/x-data-grid/src/locales/hrHR.ts index 26493db593d9..5999823e9d72 100644 --- a/packages/x-data-grid/src/locales/hrHR.ts +++ b/packages/x-data-grid/src/locales/hrHR.ts @@ -50,6 +50,7 @@ const hrHRGrid: Partial = { columnsManagementNoColumns: 'Nema stupaca', columnsManagementShowHideAllText: 'Prikaži/Sakrij sve', columnsManagementReset: 'Ponovno namjesti', + // columnsManagementDeleteIconLabel: 'Clear', // Filter panel text filterPanelAddFilter: 'Dodaj filter', diff --git a/packages/x-data-grid/src/locales/huHU.ts b/packages/x-data-grid/src/locales/huHU.ts index f65c09cdba73..9d9d78e8a7f6 100644 --- a/packages/x-data-grid/src/locales/huHU.ts +++ b/packages/x-data-grid/src/locales/huHU.ts @@ -42,6 +42,7 @@ const huHUGrid: Partial = { columnsManagementNoColumns: 'Nincsenek oszlopok', columnsManagementShowHideAllText: 'Összes', columnsManagementReset: 'Visszavon', + // columnsManagementDeleteIconLabel: 'Clear', // Filter panel text filterPanelAddFilter: 'Szűrő hozzáadása', diff --git a/packages/x-data-grid/src/locales/isIS.ts b/packages/x-data-grid/src/locales/isIS.ts index 307231873d9d..70f9c45d6119 100644 --- a/packages/x-data-grid/src/locales/isIS.ts +++ b/packages/x-data-grid/src/locales/isIS.ts @@ -43,6 +43,7 @@ const isISGrid: Partial = { // columnsManagementNoColumns: 'No columns', // columnsManagementShowHideAllText: 'Show/Hide All', // columnsManagementReset: 'Reset', + // columnsManagementDeleteIconLabel: 'Clear', // Filter panel text filterPanelAddFilter: 'Bæta síu', diff --git a/packages/x-data-grid/src/locales/itIT.ts b/packages/x-data-grid/src/locales/itIT.ts index 2058096d6165..7291525a07b8 100644 --- a/packages/x-data-grid/src/locales/itIT.ts +++ b/packages/x-data-grid/src/locales/itIT.ts @@ -43,6 +43,7 @@ const itITGrid: Partial = { columnsManagementNoColumns: 'Nessuna colonna', columnsManagementShowHideAllText: 'Mostra/Nascondi Tutto', columnsManagementReset: 'Resetta', + // columnsManagementDeleteIconLabel: 'Clear', // Filter panel text filterPanelAddFilter: 'Aggiungi un filtro', diff --git a/packages/x-data-grid/src/locales/jaJP.ts b/packages/x-data-grid/src/locales/jaJP.ts index 00f626c51187..fd2f69883cf8 100644 --- a/packages/x-data-grid/src/locales/jaJP.ts +++ b/packages/x-data-grid/src/locales/jaJP.ts @@ -42,6 +42,7 @@ const jaJPGrid: Partial = { columnsManagementNoColumns: 'カラムなし', columnsManagementShowHideAllText: 'すべて表示/非表示', columnsManagementReset: 'リセット', + // columnsManagementDeleteIconLabel: 'Clear', // Filter panel text filterPanelAddFilter: 'フィルター追加', diff --git a/packages/x-data-grid/src/locales/koKR.ts b/packages/x-data-grid/src/locales/koKR.ts index 671f6abd0520..bacd936d8fd3 100644 --- a/packages/x-data-grid/src/locales/koKR.ts +++ b/packages/x-data-grid/src/locales/koKR.ts @@ -42,6 +42,7 @@ const koKRGrid: Partial = { // columnsManagementNoColumns: 'No columns', // columnsManagementShowHideAllText: 'Show/Hide All', // columnsManagementReset: 'Reset', + // columnsManagementDeleteIconLabel: 'Clear', // Filter panel text filterPanelAddFilter: '필터 추가', diff --git a/packages/x-data-grid/src/locales/nbNO.ts b/packages/x-data-grid/src/locales/nbNO.ts index 9fa25b0cc4f8..70bd33fc7704 100644 --- a/packages/x-data-grid/src/locales/nbNO.ts +++ b/packages/x-data-grid/src/locales/nbNO.ts @@ -43,6 +43,7 @@ const nbNOGrid: Partial = { columnsManagementNoColumns: 'Ingen kolonner', columnsManagementShowHideAllText: 'Vis/skjul alle', columnsManagementReset: 'Nullstill', + // columnsManagementDeleteIconLabel: 'Clear', // Filter panel text filterPanelAddFilter: 'Legg til filter', diff --git a/packages/x-data-grid/src/locales/nlNL.ts b/packages/x-data-grid/src/locales/nlNL.ts index ccc1f5378ab4..4f247c94b2d8 100644 --- a/packages/x-data-grid/src/locales/nlNL.ts +++ b/packages/x-data-grid/src/locales/nlNL.ts @@ -43,6 +43,7 @@ const nlNLGrid: Partial = { columnsManagementNoColumns: 'Geen kolommen', columnsManagementShowHideAllText: 'Toon/Verberg Alle', columnsManagementReset: 'Reset', + // columnsManagementDeleteIconLabel: 'Clear', // Filter panel text filterPanelAddFilter: 'Filter toevoegen', diff --git a/packages/x-data-grid/src/locales/nnNO.ts b/packages/x-data-grid/src/locales/nnNO.ts index 58595a0a4456..e97a9692adb5 100644 --- a/packages/x-data-grid/src/locales/nnNO.ts +++ b/packages/x-data-grid/src/locales/nnNO.ts @@ -43,6 +43,7 @@ const nnNOGrid: Partial = { columnsManagementNoColumns: 'Ingen kolonner', columnsManagementShowHideAllText: 'Vis/skjul alle', columnsManagementReset: 'Nullstill', + // columnsManagementDeleteIconLabel: 'Clear', // Filter panel text filterPanelAddFilter: 'Legg til filter', diff --git a/packages/x-data-grid/src/locales/plPL.ts b/packages/x-data-grid/src/locales/plPL.ts index 07ea181044ea..6a183ff8993a 100644 --- a/packages/x-data-grid/src/locales/plPL.ts +++ b/packages/x-data-grid/src/locales/plPL.ts @@ -42,6 +42,7 @@ const plPLGrid: Partial = { // columnsManagementNoColumns: 'No columns', // columnsManagementShowHideAllText: 'Show/Hide All', // columnsManagementReset: 'Reset', + // columnsManagementDeleteIconLabel: 'Clear', // Filter panel text filterPanelAddFilter: 'Dodaj filtr', diff --git a/packages/x-data-grid/src/locales/ptBR.ts b/packages/x-data-grid/src/locales/ptBR.ts index 4dbd7b806024..a921b980bd90 100644 --- a/packages/x-data-grid/src/locales/ptBR.ts +++ b/packages/x-data-grid/src/locales/ptBR.ts @@ -43,6 +43,7 @@ const ptBRGrid: Partial = { columnsManagementNoColumns: 'Nenhuma coluna', columnsManagementShowHideAllText: 'Mostrar/Ocultar Todas', columnsManagementReset: 'Redefinir', + // columnsManagementDeleteIconLabel: 'Clear', // Filter panel text filterPanelAddFilter: 'Adicionar filtro', diff --git a/packages/x-data-grid/src/locales/ptPT.ts b/packages/x-data-grid/src/locales/ptPT.ts index 1024917ed9c3..88fa81bdc1c0 100644 --- a/packages/x-data-grid/src/locales/ptPT.ts +++ b/packages/x-data-grid/src/locales/ptPT.ts @@ -43,6 +43,7 @@ const ptPTGrid: Partial = { columnsManagementNoColumns: 'Sem colunas', columnsManagementShowHideAllText: 'Mostrar/Ocultar Todas', columnsManagementReset: 'Repor', + // columnsManagementDeleteIconLabel: 'Clear', // Filter panel text filterPanelAddFilter: 'Adicionar filtro', diff --git a/packages/x-data-grid/src/locales/roRO.ts b/packages/x-data-grid/src/locales/roRO.ts index 2a2db174eeac..cc49a4f52e6d 100644 --- a/packages/x-data-grid/src/locales/roRO.ts +++ b/packages/x-data-grid/src/locales/roRO.ts @@ -43,6 +43,7 @@ const roROGrid: Partial = { // columnsManagementNoColumns: 'No columns', // columnsManagementShowHideAllText: 'Show/Hide All', // columnsManagementReset: 'Reset', + // columnsManagementDeleteIconLabel: 'Clear', // Filter panel text filterPanelAddFilter: 'Adăugare filtru', diff --git a/packages/x-data-grid/src/locales/ruRU.ts b/packages/x-data-grid/src/locales/ruRU.ts index 54a7b8514962..61a1613e8ecd 100644 --- a/packages/x-data-grid/src/locales/ruRU.ts +++ b/packages/x-data-grid/src/locales/ruRU.ts @@ -67,6 +67,7 @@ const ruRUGrid: Partial = { columnsManagementNoColumns: 'Нет столбцов', columnsManagementShowHideAllText: 'Показать/Скрыть Всё', columnsManagementReset: 'Сбросить', + // columnsManagementDeleteIconLabel: 'Clear', // Filter panel text filterPanelAddFilter: 'Добавить фильтр', diff --git a/packages/x-data-grid/src/locales/skSK.ts b/packages/x-data-grid/src/locales/skSK.ts index f1d2f3be0513..bca93172c221 100644 --- a/packages/x-data-grid/src/locales/skSK.ts +++ b/packages/x-data-grid/src/locales/skSK.ts @@ -50,6 +50,7 @@ const skSKGrid: Partial = { columnsManagementNoColumns: 'Žiadne stĺpce', columnsManagementShowHideAllText: 'Zobraziť/Skryť všetko', // columnsManagementReset: 'Reset', + // columnsManagementDeleteIconLabel: 'Clear', // Filter panel text filterPanelAddFilter: 'Pridať filter', diff --git a/packages/x-data-grid/src/locales/svSE.ts b/packages/x-data-grid/src/locales/svSE.ts index 20c42538304b..46c5a6f089c5 100644 --- a/packages/x-data-grid/src/locales/svSE.ts +++ b/packages/x-data-grid/src/locales/svSE.ts @@ -43,6 +43,7 @@ const svSEGrid: Partial = { columnsManagementNoColumns: 'Inga kolumner', columnsManagementShowHideAllText: 'Visa/Dölj alla', columnsManagementReset: 'Återställ', + // columnsManagementDeleteIconLabel: 'Clear', // Filter panel text filterPanelAddFilter: 'Lägg till filter', diff --git a/packages/x-data-grid/src/locales/trTR.ts b/packages/x-data-grid/src/locales/trTR.ts index aac3da7f9772..07dd3ee608ec 100644 --- a/packages/x-data-grid/src/locales/trTR.ts +++ b/packages/x-data-grid/src/locales/trTR.ts @@ -42,6 +42,7 @@ const trTRGrid: Partial = { columnsManagementNoColumns: 'Kolon yok', columnsManagementShowHideAllText: 'Hepsini Göster/Gizle', columnsManagementReset: 'Sıfırla', + // columnsManagementDeleteIconLabel: 'Clear', // Filter panel text filterPanelAddFilter: 'Filtre Ekle', diff --git a/packages/x-data-grid/src/locales/ukUA.ts b/packages/x-data-grid/src/locales/ukUA.ts index 456bf8b00f06..f04fa67e9b5d 100644 --- a/packages/x-data-grid/src/locales/ukUA.ts +++ b/packages/x-data-grid/src/locales/ukUA.ts @@ -67,6 +67,7 @@ const ukUAGrid: Partial = { // columnsManagementNoColumns: 'No columns', // columnsManagementShowHideAllText: 'Show/Hide All', // columnsManagementReset: 'Reset', + // columnsManagementDeleteIconLabel: 'Clear', // Filter panel text filterPanelAddFilter: 'Додати фільтр', diff --git a/packages/x-data-grid/src/locales/urPK.ts b/packages/x-data-grid/src/locales/urPK.ts index 2001e0ea29d1..2ea1572123ca 100644 --- a/packages/x-data-grid/src/locales/urPK.ts +++ b/packages/x-data-grid/src/locales/urPK.ts @@ -43,6 +43,7 @@ const urPKGrid: Partial = { // columnsManagementNoColumns: 'No columns', // columnsManagementShowHideAllText: 'Show/Hide All', // columnsManagementReset: 'Reset', + // columnsManagementDeleteIconLabel: 'Clear', // Filter panel text filterPanelAddFilter: 'نیا فلٹر', diff --git a/packages/x-data-grid/src/locales/viVN.ts b/packages/x-data-grid/src/locales/viVN.ts index a76c4783b593..354f9db689d3 100644 --- a/packages/x-data-grid/src/locales/viVN.ts +++ b/packages/x-data-grid/src/locales/viVN.ts @@ -43,6 +43,7 @@ const viVNGrid: Partial = { columnsManagementNoColumns: 'Không có cột', columnsManagementShowHideAllText: 'Hiện/Ẩn Tất cả', columnsManagementReset: 'Đặt lại', + // columnsManagementDeleteIconLabel: 'Clear', // Filter panel text filterPanelAddFilter: 'Thêm bộ lọc', diff --git a/packages/x-data-grid/src/locales/zhCN.ts b/packages/x-data-grid/src/locales/zhCN.ts index 4badeddc8aef..74574df253b8 100644 --- a/packages/x-data-grid/src/locales/zhCN.ts +++ b/packages/x-data-grid/src/locales/zhCN.ts @@ -42,6 +42,7 @@ const zhCNGrid: Partial = { columnsManagementNoColumns: '没有列', columnsManagementShowHideAllText: '显示/隐藏所有', columnsManagementReset: '重置', + // columnsManagementDeleteIconLabel: 'Clear', // Filter panel text filterPanelAddFilter: '添加筛选器', diff --git a/packages/x-data-grid/src/locales/zhHK.ts b/packages/x-data-grid/src/locales/zhHK.ts index 3f53e6b7d9ee..0e73634398a0 100644 --- a/packages/x-data-grid/src/locales/zhHK.ts +++ b/packages/x-data-grid/src/locales/zhHK.ts @@ -43,6 +43,7 @@ const zhHKGrid: Partial = { // columnsManagementNoColumns: 'No columns', // columnsManagementShowHideAllText: 'Show/Hide All', // columnsManagementReset: 'Reset', + // columnsManagementDeleteIconLabel: 'Clear', // Filter panel text filterPanelAddFilter: '新增過濾器', diff --git a/packages/x-data-grid/src/locales/zhTW.ts b/packages/x-data-grid/src/locales/zhTW.ts index facba1f16343..0052bc700964 100644 --- a/packages/x-data-grid/src/locales/zhTW.ts +++ b/packages/x-data-grid/src/locales/zhTW.ts @@ -42,6 +42,7 @@ const zhTWGrid: Partial = { // columnsManagementNoColumns: 'No columns', // columnsManagementShowHideAllText: 'Show/Hide All', // columnsManagementReset: 'Reset', + // columnsManagementDeleteIconLabel: 'Clear', // Filter panel text filterPanelAddFilter: '增加篩選器', diff --git a/packages/x-data-grid/src/models/api/gridLocaleTextApi.ts b/packages/x-data-grid/src/models/api/gridLocaleTextApi.ts index b2ce738ff721..9573191b4756 100644 --- a/packages/x-data-grid/src/models/api/gridLocaleTextApi.ts +++ b/packages/x-data-grid/src/models/api/gridLocaleTextApi.ts @@ -53,6 +53,7 @@ export interface GridLocaleText { columnsManagementNoColumns: string; columnsManagementShowHideAllText: string; columnsManagementReset: string; + columnsManagementDeleteIconLabel: string; // Filter panel text filterPanelAddFilter: React.ReactNode; diff --git a/packages/x-data-grid/src/tests/toolbar.DataGrid.test.tsx b/packages/x-data-grid/src/tests/toolbar.DataGrid.test.tsx index 92cea1015317..5f35b8c50009 100644 --- a/packages/x-data-grid/src/tests/toolbar.DataGrid.test.tsx +++ b/packages/x-data-grid/src/tests/toolbar.DataGrid.test.tsx @@ -154,7 +154,7 @@ describe(' - Toolbar', () => { fireEvent.click(screen.getByText('Columns')); - const searchInput = document.querySelector('input[type="text"]')!; + const searchInput = document.querySelector('input[type="search"]')!; fireEvent.change(searchInput, { target: { value: 'test' } }); expect(document.querySelector('[role="tooltip"] [name="id"]')).not.to.equal(null);