From 042c1a54cf1eb72be582feb92c8602bb32b7da28 Mon Sep 17 00:00:00 2001 From: Armin Mehinovic <4390250+arminmeh@users.noreply.github.com> Date: Fri, 22 Nov 2024 09:37:47 +0100 Subject: [PATCH] [DataGridPremium] Prompt input control (#15401) Signed-off-by: Armin Mehinovic <4390250+arminmeh@users.noreply.github.com> Co-authored-by: Rom Grk Co-authored-by: Kenan Yusuf Co-authored-by: Olivier Tassinari Co-authored-by: Andrew Cherniavskii Co-authored-by: Bilal Shafi --- docs/data/data-grid/localization/data.json | 140 ++++----- .../prompt/PromptWithDataSampling.js | 51 ++++ .../prompt/PromptWithDataSampling.tsx | 51 ++++ .../prompt/PromptWithDataSampling.tsx.preview | 6 + .../data-grid/prompt/PromptWithDataSource.js | 85 ++++++ .../data-grid/prompt/PromptWithDataSource.tsx | 86 ++++++ .../prompt/PromptWithDataSource.tsx.preview | 10 + .../data-grid/prompt/PromptWithExamples.js | 98 +++++++ .../data-grid/prompt/PromptWithExamples.tsx | 98 +++++++ .../prompt/PromptWithExamples.tsx.preview | 7 + docs/data/data-grid/prompt/prompt.md | 92 ++++++ .../x/api/data-grid/data-grid-premium.json | 42 +++ docs/pages/x/api/data-grid/data-grid-pro.json | 30 ++ docs/pages/x/api/data-grid/data-grid.json | 30 ++ .../x/api/data-grid/grid-actions-col-def.json | 1 + docs/pages/x/api/data-grid/grid-col-def.json | 1 + .../data-grid/grid-single-select-col-def.json | 1 + docs/pages/x/react-data-grid/prompt.js | 7 + .../data-grid-premium/data-grid-premium.json | 23 ++ .../data-grid-pro/data-grid-pro.json | 21 ++ .../data-grid/data-grid/data-grid.json | 21 ++ .../data-grid/grid-actions-col-def.json | 3 + .../api-docs/data-grid/grid-col-def.json | 3 + .../data-grid/grid-single-select-col-def.json | 3 + .../src/columns/employees.columns.tsx | 1 + .../src/constants/prompts.ts | 107 +++++++ .../src/services/index.ts | 1 + .../src/services/prompt-resolver.ts | 16 + .../src/components/index.ts | 1 + .../GridToolbarPromptControl.tsx | 277 ++++++++++++++++++ .../components/promptControl/RecordButton.tsx | 134 +++++++++ .../src/components/promptControl/index.ts | 1 + .../src/hooks/features/index.ts | 1 + .../src/hooks/features/promptControl/api.ts | 28 ++ .../src/hooks/features/promptControl/index.ts | 2 + .../src/hooks/features/promptControl/types.ts | 29 ++ .../src/material/icons.tsx | 10 + .../x-data-grid-premium/src/material/index.ts | 10 +- .../models/gridPremiumIconSlotsComponent.ts | 10 + .../x-data-grid/src/constants/gridClasses.ts | 25 ++ .../src/constants/localeTextConstants.ts | 13 + packages/x-data-grid/src/internals/index.ts | 1 + packages/x-data-grid/src/locales/arSD.ts | 12 + packages/x-data-grid/src/locales/beBY.ts | 12 + packages/x-data-grid/src/locales/bgBG.ts | 12 + packages/x-data-grid/src/locales/csCZ.ts | 12 + packages/x-data-grid/src/locales/daDK.ts | 12 + packages/x-data-grid/src/locales/deDE.ts | 12 + packages/x-data-grid/src/locales/elGR.ts | 12 + packages/x-data-grid/src/locales/esES.ts | 12 + packages/x-data-grid/src/locales/faIR.ts | 12 + packages/x-data-grid/src/locales/fiFI.ts | 12 + packages/x-data-grid/src/locales/frFR.ts | 12 + packages/x-data-grid/src/locales/heIL.ts | 12 + packages/x-data-grid/src/locales/hrHR.ts | 12 + packages/x-data-grid/src/locales/huHU.ts | 12 + packages/x-data-grid/src/locales/isIS.ts | 12 + packages/x-data-grid/src/locales/itIT.ts | 12 + packages/x-data-grid/src/locales/jaJP.ts | 12 + packages/x-data-grid/src/locales/koKR.ts | 12 + packages/x-data-grid/src/locales/nbNO.ts | 12 + packages/x-data-grid/src/locales/nlNL.ts | 12 + packages/x-data-grid/src/locales/nnNO.ts | 12 + packages/x-data-grid/src/locales/plPL.ts | 12 + packages/x-data-grid/src/locales/ptBR.ts | 12 + packages/x-data-grid/src/locales/ptPT.ts | 12 + packages/x-data-grid/src/locales/roRO.ts | 12 + packages/x-data-grid/src/locales/ruRU.ts | 12 + packages/x-data-grid/src/locales/skSK.ts | 12 + packages/x-data-grid/src/locales/svSE.ts | 12 + packages/x-data-grid/src/locales/trTR.ts | 12 + packages/x-data-grid/src/locales/ukUA.ts | 12 + packages/x-data-grid/src/locales/urPK.ts | 12 + packages/x-data-grid/src/locales/viVN.ts | 12 + packages/x-data-grid/src/locales/zhCN.ts | 12 + packages/x-data-grid/src/locales/zhHK.ts | 12 + packages/x-data-grid/src/locales/zhTW.ts | 12 + .../src/models/api/gridLocaleTextApi.ts | 12 + .../src/models/colDef/gridColDef.ts | 4 + scripts/x-data-grid-generator.exports.json | 1 + scripts/x-data-grid-premium.exports.json | 5 + 81 files changed, 1948 insertions(+), 71 deletions(-) create mode 100644 docs/data/data-grid/prompt/PromptWithDataSampling.js create mode 100644 docs/data/data-grid/prompt/PromptWithDataSampling.tsx create mode 100644 docs/data/data-grid/prompt/PromptWithDataSampling.tsx.preview create mode 100644 docs/data/data-grid/prompt/PromptWithDataSource.js create mode 100644 docs/data/data-grid/prompt/PromptWithDataSource.tsx create mode 100644 docs/data/data-grid/prompt/PromptWithDataSource.tsx.preview create mode 100644 docs/data/data-grid/prompt/PromptWithExamples.js create mode 100644 docs/data/data-grid/prompt/PromptWithExamples.tsx create mode 100644 docs/data/data-grid/prompt/PromptWithExamples.tsx.preview create mode 100644 docs/data/data-grid/prompt/prompt.md create mode 100644 docs/pages/x/react-data-grid/prompt.js create mode 100644 packages/x-data-grid-generator/src/constants/prompts.ts create mode 100644 packages/x-data-grid-generator/src/services/prompt-resolver.ts create mode 100644 packages/x-data-grid-premium/src/components/promptControl/GridToolbarPromptControl.tsx create mode 100644 packages/x-data-grid-premium/src/components/promptControl/RecordButton.tsx create mode 100644 packages/x-data-grid-premium/src/components/promptControl/index.ts create mode 100644 packages/x-data-grid-premium/src/hooks/features/promptControl/api.ts create mode 100644 packages/x-data-grid-premium/src/hooks/features/promptControl/index.ts create mode 100644 packages/x-data-grid-premium/src/hooks/features/promptControl/types.ts diff --git a/docs/data/data-grid/localization/data.json b/docs/data/data-grid/localization/data.json index e6d0c4013acee..f7718fbf0dafd 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": 9, - "totalKeysCount": 123, + "missingKeysCount": 19, + "totalKeysCount": 133, "githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/locales/arSD.ts" }, { "languageTag": "be-BY", "importName": "beBY", "localeName": "Belarusian", - "missingKeysCount": 35, - "totalKeysCount": 123, + "missingKeysCount": 45, + "totalKeysCount": 133, "githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/locales/beBY.ts" }, { "languageTag": "bg-BG", "importName": "bgBG", "localeName": "Bulgarian", - "missingKeysCount": 1, - "totalKeysCount": 123, + "missingKeysCount": 11, + "totalKeysCount": 133, "githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/locales/bgBG.ts" }, { "languageTag": "zh-HK", "importName": "zhHK", "localeName": "Chinese (Hong Kong)", - "missingKeysCount": 9, - "totalKeysCount": 123, + "missingKeysCount": 19, + "totalKeysCount": 133, "githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/locales/zhHK.ts" }, { "languageTag": "zh-CN", "importName": "zhCN", "localeName": "Chinese (Simplified)", - "missingKeysCount": 1, - "totalKeysCount": 123, + "missingKeysCount": 11, + "totalKeysCount": 133, "githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/locales/zhCN.ts" }, { "languageTag": "zh-TW", "importName": "zhTW", "localeName": "Chinese (Taiwan)", - "missingKeysCount": 9, - "totalKeysCount": 123, + "missingKeysCount": 19, + "totalKeysCount": 133, "githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/locales/zhTW.ts" }, { "languageTag": "hr-HR", "importName": "hrHR", "localeName": "Croatian", - "missingKeysCount": 1, - "totalKeysCount": 123, + "missingKeysCount": 11, + "totalKeysCount": 133, "githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/locales/hrHR.ts" }, { "languageTag": "cs-CZ", "importName": "csCZ", "localeName": "Czech", - "missingKeysCount": 5, - "totalKeysCount": 123, + "missingKeysCount": 15, + "totalKeysCount": 133, "githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/locales/csCZ.ts" }, { "languageTag": "da-DK", "importName": "daDK", "localeName": "Danish", - "missingKeysCount": 1, - "totalKeysCount": 123, + "missingKeysCount": 11, + "totalKeysCount": 133, "githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/locales/daDK.ts" }, { "languageTag": "nl-NL", "importName": "nlNL", "localeName": "Dutch", - "missingKeysCount": 5, - "totalKeysCount": 123, + "missingKeysCount": 15, + "totalKeysCount": 133, "githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/locales/nlNL.ts" }, { "languageTag": "fi-FI", "importName": "fiFI", "localeName": "Finnish", - "missingKeysCount": 5, - "totalKeysCount": 123, + "missingKeysCount": 15, + "totalKeysCount": 133, "githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/locales/fiFI.ts" }, { "languageTag": "fr-FR", "importName": "frFR", "localeName": "French", - "missingKeysCount": 1, - "totalKeysCount": 123, + "missingKeysCount": 11, + "totalKeysCount": 133, "githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/locales/frFR.ts" }, { "languageTag": "de-DE", "importName": "deDE", "localeName": "German", - "missingKeysCount": 1, - "totalKeysCount": 123, + "missingKeysCount": 11, + "totalKeysCount": 133, "githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/locales/deDE.ts" }, { "languageTag": "el-GR", "importName": "elGR", "localeName": "Greek", - "missingKeysCount": 9, - "totalKeysCount": 123, + "missingKeysCount": 19, + "totalKeysCount": 133, "githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/locales/elGR.ts" }, { "languageTag": "he-IL", "importName": "heIL", "localeName": "Hebrew", - "missingKeysCount": 5, - "totalKeysCount": 123, + "missingKeysCount": 15, + "totalKeysCount": 133, "githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/locales/heIL.ts" }, { "languageTag": "hu-HU", "importName": "huHU", "localeName": "Hungarian", - "missingKeysCount": 7, - "totalKeysCount": 123, + "missingKeysCount": 17, + "totalKeysCount": 133, "githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/locales/huHU.ts" }, { "languageTag": "is-IS", "importName": "isIS", "localeName": "Icelandic", - "missingKeysCount": 9, - "totalKeysCount": 123, + "missingKeysCount": 19, + "totalKeysCount": 133, "githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/locales/isIS.ts" }, { "languageTag": "it-IT", "importName": "itIT", "localeName": "Italian", - "missingKeysCount": 1, - "totalKeysCount": 123, + "missingKeysCount": 11, + "totalKeysCount": 133, "githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/locales/itIT.ts" }, { "languageTag": "ja-JP", "importName": "jaJP", "localeName": "Japanese", - "missingKeysCount": 1, - "totalKeysCount": 123, + "missingKeysCount": 11, + "totalKeysCount": 133, "githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/locales/jaJP.ts" }, { "languageTag": "ko-KR", "importName": "koKR", "localeName": "Korean", - "missingKeysCount": 36, - "totalKeysCount": 123, + "missingKeysCount": 46, + "totalKeysCount": 133, "githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/locales/koKR.ts" }, { "languageTag": "nb-NO", "importName": "nbNO", "localeName": "Norwegian (Bokmål)", - "missingKeysCount": 5, - "totalKeysCount": 123, + "missingKeysCount": 15, + "totalKeysCount": 133, "githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/locales/nbNO.ts" }, { "languageTag": "nn-NO", "importName": "nnNO", "localeName": "Norwegian (Nynorsk)", - "missingKeysCount": 5, - "totalKeysCount": 123, + "missingKeysCount": 15, + "totalKeysCount": 133, "githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/locales/nnNO.ts" }, { "languageTag": "fa-IR", "importName": "faIR", "localeName": "Persian", - "missingKeysCount": 5, - "totalKeysCount": 123, + "missingKeysCount": 15, + "totalKeysCount": 133, "githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/locales/faIR.ts" }, { "languageTag": "pl-PL", "importName": "plPL", "localeName": "Polish", - "missingKeysCount": 12, - "totalKeysCount": 123, + "missingKeysCount": 22, + "totalKeysCount": 133, "githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/locales/plPL.ts" }, { "languageTag": "pt-PT", "importName": "ptPT", "localeName": "Portuguese", - "missingKeysCount": 1, - "totalKeysCount": 123, + "missingKeysCount": 11, + "totalKeysCount": 133, "githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/locales/ptPT.ts" }, { "languageTag": "pt-BR", "importName": "ptBR", "localeName": "Portuguese (Brazil)", - "missingKeysCount": 1, - "totalKeysCount": 123, + "missingKeysCount": 11, + "totalKeysCount": 133, "githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/locales/ptBR.ts" }, { "languageTag": "ro-RO", "importName": "roRO", "localeName": "Romanian", - "missingKeysCount": 9, - "totalKeysCount": 123, + "missingKeysCount": 19, + "totalKeysCount": 133, "githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/locales/roRO.ts" }, { "languageTag": "ru-RU", "importName": "ruRU", "localeName": "Russian", - "missingKeysCount": 5, - "totalKeysCount": 123, + "missingKeysCount": 15, + "totalKeysCount": 133, "githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/locales/ruRU.ts" }, { "languageTag": "sk-SK", "importName": "skSK", "localeName": "Slovak", - "missingKeysCount": 6, - "totalKeysCount": 123, + "missingKeysCount": 16, + "totalKeysCount": 133, "githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/locales/skSK.ts" }, { "languageTag": "es-ES", "importName": "esES", "localeName": "Spanish", - "missingKeysCount": 1, - "totalKeysCount": 123, + "missingKeysCount": 11, + "totalKeysCount": 133, "githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/locales/esES.ts" }, { "languageTag": "sv-SE", "importName": "svSE", "localeName": "Swedish", - "missingKeysCount": 1, - "totalKeysCount": 123, + "missingKeysCount": 11, + "totalKeysCount": 133, "githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/locales/svSE.ts" }, { "languageTag": "tr-TR", "importName": "trTR", "localeName": "Turkish", - "missingKeysCount": 3, - "totalKeysCount": 123, + "missingKeysCount": 13, + "totalKeysCount": 133, "githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/locales/trTR.ts" }, { "languageTag": "uk-UA", "importName": "ukUA", "localeName": "Ukrainian", - "missingKeysCount": 9, - "totalKeysCount": 123, + "missingKeysCount": 19, + "totalKeysCount": 133, "githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/locales/ukUA.ts" }, { "languageTag": "ur-PK", "importName": "urPK", "localeName": "Urdu (Pakistan)", - "missingKeysCount": 9, - "totalKeysCount": 123, + "missingKeysCount": 19, + "totalKeysCount": 133, "githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/locales/urPK.ts" }, { "languageTag": "vi-VN", "importName": "viVN", "localeName": "Vietnamese", - "missingKeysCount": 1, - "totalKeysCount": 123, + "missingKeysCount": 11, + "totalKeysCount": 133, "githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/locales/viVN.ts" } ] diff --git a/docs/data/data-grid/prompt/PromptWithDataSampling.js b/docs/data/data-grid/prompt/PromptWithDataSampling.js new file mode 100644 index 0000000000000..b7cb1e9214d4d --- /dev/null +++ b/docs/data/data-grid/prompt/PromptWithDataSampling.js @@ -0,0 +1,51 @@ +import * as React from 'react'; +import { + DataGridPremium, + Unstable_GridToolbarPromptControl as GridToolbarPromptControl, + GridToolbar, +} from '@mui/x-data-grid-premium'; +import { mockPromptResolver, useDemoData } from '@mui/x-data-grid-generator'; +import Stack from '@mui/material/Stack'; +import Box from '@mui/material/Box'; + +function ToolbarWithPromptInput() { + return ( + + + + + + + ); +} + +const VISIBLE_FIELDS = [ + 'name', + 'email', + 'position', + 'company', + 'salary', + 'phone', + 'country', + 'dateCreated', + 'isAdmin', +]; + +export default function PromptWithDataSampling() { + const { data } = useDemoData({ + dataSet: 'Employee', + visibleFields: VISIBLE_FIELDS, + rowLength: 10000, + }); + + return ( +
+ +
+ ); +} diff --git a/docs/data/data-grid/prompt/PromptWithDataSampling.tsx b/docs/data/data-grid/prompt/PromptWithDataSampling.tsx new file mode 100644 index 0000000000000..b7cb1e9214d4d --- /dev/null +++ b/docs/data/data-grid/prompt/PromptWithDataSampling.tsx @@ -0,0 +1,51 @@ +import * as React from 'react'; +import { + DataGridPremium, + Unstable_GridToolbarPromptControl as GridToolbarPromptControl, + GridToolbar, +} from '@mui/x-data-grid-premium'; +import { mockPromptResolver, useDemoData } from '@mui/x-data-grid-generator'; +import Stack from '@mui/material/Stack'; +import Box from '@mui/material/Box'; + +function ToolbarWithPromptInput() { + return ( + + + + + + + ); +} + +const VISIBLE_FIELDS = [ + 'name', + 'email', + 'position', + 'company', + 'salary', + 'phone', + 'country', + 'dateCreated', + 'isAdmin', +]; + +export default function PromptWithDataSampling() { + const { data } = useDemoData({ + dataSet: 'Employee', + visibleFields: VISIBLE_FIELDS, + rowLength: 10000, + }); + + return ( +
+ +
+ ); +} diff --git a/docs/data/data-grid/prompt/PromptWithDataSampling.tsx.preview b/docs/data/data-grid/prompt/PromptWithDataSampling.tsx.preview new file mode 100644 index 0000000000000..c140559bcf94d --- /dev/null +++ b/docs/data/data-grid/prompt/PromptWithDataSampling.tsx.preview @@ -0,0 +1,6 @@ + \ No newline at end of file diff --git a/docs/data/data-grid/prompt/PromptWithDataSource.js b/docs/data/data-grid/prompt/PromptWithDataSource.js new file mode 100644 index 0000000000000..964711a513855 --- /dev/null +++ b/docs/data/data-grid/prompt/PromptWithDataSource.js @@ -0,0 +1,85 @@ +import * as React from 'react'; +import { + DataGridPremium, + Unstable_GridToolbarPromptControl as GridToolbarPromptControl, + GridToolbar, +} from '@mui/x-data-grid-premium'; +import { mockPromptResolver, useMockServer } from '@mui/x-data-grid-generator'; +import Stack from '@mui/material/Stack'; +import Box from '@mui/material/Box'; + +const VISIBLE_FIELDS = [ + 'name', + 'email', + 'position', + 'company', + 'salary', + 'phone', + 'country', + 'dateCreated', + 'isAdmin', +]; + +function ToolbarWithPromptInput() { + return ( + + + + + + + ); +} + +export default function PromptWithDataSource() { + const { columns, initialState, fetchRows } = useMockServer( + { dataSet: 'Employee', visibleFields: VISIBLE_FIELDS, maxColumns: 16 }, + { useCursorPagination: false }, + ); + + const dataSource = React.useMemo( + () => ({ + getRows: async (params) => { + const urlParams = new URLSearchParams({ + paginationModel: JSON.stringify(params.paginationModel), + filterModel: JSON.stringify(params.filterModel), + sortModel: JSON.stringify(params.sortModel), + }); + const getRowsResponse = await fetchRows( + `https://mui.com/x/api/data-grid?${urlParams.toString()}`, + ); + return { + rows: getRowsResponse.rows, + rowCount: getRowsResponse.rowCount, + }; + }, + }), + [fetchRows], + ); + + const initialStateWithPagination = React.useMemo( + () => ({ + ...initialState, + pagination: { + paginationModel: { pageSize: 10, page: 0 }, + rowCount: 0, + }, + }), + [initialState], + ); + + return ( +
+ +
+ ); +} diff --git a/docs/data/data-grid/prompt/PromptWithDataSource.tsx b/docs/data/data-grid/prompt/PromptWithDataSource.tsx new file mode 100644 index 0000000000000..0fb0132a59697 --- /dev/null +++ b/docs/data/data-grid/prompt/PromptWithDataSource.tsx @@ -0,0 +1,86 @@ +import * as React from 'react'; +import { + DataGridPremium, + Unstable_GridToolbarPromptControl as GridToolbarPromptControl, + GridToolbar, + GridDataSource, +} from '@mui/x-data-grid-premium'; +import { mockPromptResolver, useMockServer } from '@mui/x-data-grid-generator'; +import Stack from '@mui/material/Stack'; +import Box from '@mui/material/Box'; + +const VISIBLE_FIELDS = [ + 'name', + 'email', + 'position', + 'company', + 'salary', + 'phone', + 'country', + 'dateCreated', + 'isAdmin', +]; + +function ToolbarWithPromptInput() { + return ( + + + + + + + ); +} + +export default function PromptWithDataSource() { + const { columns, initialState, fetchRows } = useMockServer( + { dataSet: 'Employee', visibleFields: VISIBLE_FIELDS, maxColumns: 16 }, + { useCursorPagination: false }, + ); + + const dataSource: GridDataSource = React.useMemo( + () => ({ + getRows: async (params) => { + const urlParams = new URLSearchParams({ + paginationModel: JSON.stringify(params.paginationModel), + filterModel: JSON.stringify(params.filterModel), + sortModel: JSON.stringify(params.sortModel), + }); + const getRowsResponse = await fetchRows( + `https://mui.com/x/api/data-grid?${urlParams.toString()}`, + ); + return { + rows: getRowsResponse.rows, + rowCount: getRowsResponse.rowCount, + }; + }, + }), + [fetchRows], + ); + + const initialStateWithPagination = React.useMemo( + () => ({ + ...initialState, + pagination: { + paginationModel: { pageSize: 10, page: 0 }, + rowCount: 0, + }, + }), + [initialState], + ); + + return ( +
+ +
+ ); +} diff --git a/docs/data/data-grid/prompt/PromptWithDataSource.tsx.preview b/docs/data/data-grid/prompt/PromptWithDataSource.tsx.preview new file mode 100644 index 0000000000000..1c7559543c28a --- /dev/null +++ b/docs/data/data-grid/prompt/PromptWithDataSource.tsx.preview @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/docs/data/data-grid/prompt/PromptWithExamples.js b/docs/data/data-grid/prompt/PromptWithExamples.js new file mode 100644 index 0000000000000..abdd774d0d485 --- /dev/null +++ b/docs/data/data-grid/prompt/PromptWithExamples.js @@ -0,0 +1,98 @@ +import * as React from 'react'; +import { + DataGridPremium, + Unstable_GridToolbarPromptControl as GridToolbarPromptControl, + GridToolbar, +} from '@mui/x-data-grid-premium'; +import { + mockPromptResolver, + randomBoolean, + randomCompanyName, + randomCountry, + randomCreatedDate, + randomEmail, + randomInt, + randomJobTitle, + randomPhoneNumber, + randomTraderName, + useDemoData, +} from '@mui/x-data-grid-generator'; +import Stack from '@mui/material/Stack'; +import Box from '@mui/material/Box'; + +function ToolbarWithPromptInput() { + return ( + + + + + + + ); +} + +const VISIBLE_FIELDS = [ + 'name', + 'email', + 'position', + 'company', + 'salary', + 'phone', + 'country', + 'dateCreated', + 'isAdmin', +]; + +function createExamples(column) { + switch (column) { + case 'name': + return Array.from({ length: 5 }, () => randomTraderName()); + case 'email': + return Array.from({ length: 5 }, () => randomEmail()); + case 'position': + return Array.from({ length: 5 }, () => randomJobTitle()); + case 'company': + return Array.from({ length: 5 }, () => randomCompanyName()); + case 'salary': + return Array.from({ length: 5 }, () => randomInt(30000, 80000)); + case 'phone': + return Array.from({ length: 5 }, () => randomPhoneNumber()); + case 'country': + return Array.from({ length: 5 }, () => randomCountry()); + case 'dateCreated': + return Array.from({ length: 5 }, () => randomCreatedDate()); + case 'isAdmin': + return Array.from({ length: 5 }, () => randomBoolean()); + default: + return []; + } +} + +export default function PromptWithExamples() { + const { data } = useDemoData({ + dataSet: 'Employee', + visibleFields: VISIBLE_FIELDS, + rowLength: 10000, + }); + + const columns = React.useMemo( + () => + data.columns.map((column) => ({ + ...column, + unstable_examples: createExamples(column.field), + })), + [data.columns], + ); + + return ( +
+ +
+ ); +} diff --git a/docs/data/data-grid/prompt/PromptWithExamples.tsx b/docs/data/data-grid/prompt/PromptWithExamples.tsx new file mode 100644 index 0000000000000..dacd4e75a6019 --- /dev/null +++ b/docs/data/data-grid/prompt/PromptWithExamples.tsx @@ -0,0 +1,98 @@ +import * as React from 'react'; +import { + DataGridPremium, + Unstable_GridToolbarPromptControl as GridToolbarPromptControl, + GridToolbar, +} from '@mui/x-data-grid-premium'; +import { + mockPromptResolver, + randomBoolean, + randomCompanyName, + randomCountry, + randomCreatedDate, + randomEmail, + randomInt, + randomJobTitle, + randomPhoneNumber, + randomTraderName, + useDemoData, +} from '@mui/x-data-grid-generator'; +import Stack from '@mui/material/Stack'; +import Box from '@mui/material/Box'; + +function ToolbarWithPromptInput() { + return ( + + + + + + + ); +} + +const VISIBLE_FIELDS = [ + 'name', + 'email', + 'position', + 'company', + 'salary', + 'phone', + 'country', + 'dateCreated', + 'isAdmin', +]; + +function createExamples(column: string) { + switch (column) { + case 'name': + return Array.from({ length: 5 }, () => randomTraderName()); + case 'email': + return Array.from({ length: 5 }, () => randomEmail()); + case 'position': + return Array.from({ length: 5 }, () => randomJobTitle()); + case 'company': + return Array.from({ length: 5 }, () => randomCompanyName()); + case 'salary': + return Array.from({ length: 5 }, () => randomInt(30000, 80000)); + case 'phone': + return Array.from({ length: 5 }, () => randomPhoneNumber()); + case 'country': + return Array.from({ length: 5 }, () => randomCountry()); + case 'dateCreated': + return Array.from({ length: 5 }, () => randomCreatedDate()); + case 'isAdmin': + return Array.from({ length: 5 }, () => randomBoolean()); + default: + return []; + } +} + +export default function PromptWithExamples() { + const { data } = useDemoData({ + dataSet: 'Employee', + visibleFields: VISIBLE_FIELDS, + rowLength: 10000, + }); + + const columns = React.useMemo( + () => + data.columns.map((column) => ({ + ...column, + unstable_examples: createExamples(column.field), + })), + [data.columns], + ); + + return ( +
+ +
+ ); +} diff --git a/docs/data/data-grid/prompt/PromptWithExamples.tsx.preview b/docs/data/data-grid/prompt/PromptWithExamples.tsx.preview new file mode 100644 index 0000000000000..dc637e4603da1 --- /dev/null +++ b/docs/data/data-grid/prompt/PromptWithExamples.tsx.preview @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/docs/data/data-grid/prompt/prompt.md b/docs/data/data-grid/prompt/prompt.md new file mode 100644 index 0000000000000..6148eacf15d4a --- /dev/null +++ b/docs/data/data-grid/prompt/prompt.md @@ -0,0 +1,92 @@ +--- +title: Data Grid - Prompt +--- + +# Data Grid - Prompt [](/x/introduction/licensing/#premium-plan 'Premium plan') + +

Translate natural language into a set of grid state updates and apply them to the Data Grid component.

+ +:::warning +To use this feature, you need to have a prompt processing backend. MUI offers this service as a part of a premium package add-on. Check [licensing page](/x/introduction/licensing/) for more information. +::: + +The prompt feature allows users to interact with the Data Grid component using natural language. The user can type commands like "sort by name" or "show amounts larger than 1000" in the prompt input field, and the Data Grid will update accordingly. + +To increase the accuracy of the prompt processing, the user should provide example values for the available columns. +This can be done in following ways. + +:::info +Prompt demos use a utility function `mockPromptResolver` to simulate the api that resolves the user prompts. +In a real-world scenario, you should replace this with your own api. + +`mockPromptResolver` can handle a predefined set of prompts: + +- `sort by name` +- `sort by company name and employee name` +- `show people from the EU` +- `order companies by amount of people` + + ::: + +## Custom examples + +The user can provide custom examples for the prompt processing through the `unstable_examples` prop of the column in the `columns` array. +The `unstable_examples` prop should be an array of values that are possible values for that column. + +{{"demo": "PromptWithExamples.js", "bg": "inline"}} + +## Use row data for examples + +If you pass `allowDataSampling` flag to the `Unstable_GridToolbarPromptControl`, it uses the row data to generate examples for the prompt processing. +This is useful if you are dealing with non-sensitive data and want to skip creating custom examples for each column. + +{{"demo": "PromptWithDataSampling.js", "bg": "inline"}} + +## Using Server-side data + +An example of combining prompt toolbar with the [Server-side data](/x/react-data-grid/server-side-data/) + +{{"demo": "PromptWithDataSource.js", "bg": "inline"}} + +## Integration with MUI's API + +To integrate with MUI's API, an API key would be needed. +As the key cannot be exposed to the client, a small proxy server could be used that would receive prompt processing requests, add the `x-api-key` header, and pass the request further to the MUI's API. + +This is an example of a Fastify proxy for the prompt requests + +```ts +fastify.register(proxy, { + upstream: process.env.MUI_DATAGRID_API_URL, + prefix: '/api/datagrid/prompt', + rewritePrefix: '/api/v1/datagrid/prompt', + replyOptions: { + rewriteRequestHeaders: (_, headers) => ({ + ...headers, + 'x-api-key': process.env.MUI_DATAGRID_API_KEY, + }), + }, +}); +``` + +To make the integration easier, use the `unstable_gridDefaultPromptResolver` from `@mui/x-data-grid-premium` package. +It will add necessary headers and stringify the body in the right format for you. + +The example below shows a code that adds an additional prompt context for better results and uses `unstable_gridDefaultPromptResolver` to avoid dealing with the request details. + +```ts +const PROMPT_RESOLVER_PROXY_BASE_URL = + process.env.NODE_ENV === 'development' + ? 'http://localhost:3000' + : 'https://api.my-proxy.com'; + +function processPrompt(context: string, query: string) { + const extendedContext = `The rows represent: List of employees with their company, position and start date\n\n${context}`; + + return unstable_gridDefaultPromptResolver( + `${PROMPT_RESOLVER_PROXY_BASE_URL}/api/datagrid/prompt`, + extendedContext, + query, + ); +} +``` 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 ec134312c970d..478161ccf9672 100644 --- a/docs/pages/x/api/data-grid/data-grid-premium.json +++ b/docs/pages/x/api/data-grid/data-grid-premium.json @@ -1125,6 +1125,18 @@ "description": "Icon displayed in column menu for aggregation", "default": "GridFunctionsIcon", "class": null + }, + { + "name": "toolbarPromptSendIcon", + "description": "Icon used for the button that sends a prompt", + "default": "GridFunctionsIcon", + "class": null + }, + { + "name": "toolbarPromptRecordIcon", + "description": "Icon used for the button that starts/stops recording the prompt", + "default": "GridFunctionsIcon", + "class": null } ], "classes": [ @@ -1896,6 +1908,36 @@ "description": "Styles applied to the toolbar filter list element.", "isGlobal": false }, + { + "key": "toolbarPromptControl", + "className": "MuiDataGridPremium-toolbarPromptControl", + "description": "Styles applied to the toolbar prompt control element.", + "isGlobal": false + }, + { + "key": "toolbarPromptControl--recording", + "className": "MuiDataGridPremium-toolbarPromptControl--recording", + "description": "Styles applied to the toolbar prompt control element when recording.", + "isGlobal": false + }, + { + "key": "toolbarPromptControlRecordButton", + "className": "MuiDataGridPremium-toolbarPromptControlRecordButton", + "description": "Styles applied to the toolbar prompt control record button element.", + "isGlobal": false + }, + { + "key": "toolbarPromptControlRecordingIndicator", + "className": "MuiDataGridPremium-toolbarPromptControlRecordingIndicator", + "description": "Styles applied to the toolbar prompt control recording indicator element.", + "isGlobal": false + }, + { + "key": "toolbarPromptControlSendButton", + "className": "MuiDataGridPremium-toolbarPromptControlSendButton", + "description": "Styles applied to the toolbar prompt control send button element.", + "isGlobal": false + }, { "key": "treeDataGroupingCell", "className": "MuiDataGridPremium-treeDataGroupingCell", 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 8fba87d572249..2852fe9fa58eb 100644 --- a/docs/pages/x/api/data-grid/data-grid-pro.json +++ b/docs/pages/x/api/data-grid/data-grid-pro.json @@ -1810,6 +1810,36 @@ "description": "Styles applied to the toolbar filter list element.", "isGlobal": false }, + { + "key": "toolbarPromptControl", + "className": "MuiDataGridPro-toolbarPromptControl", + "description": "Styles applied to the toolbar prompt control element.", + "isGlobal": false + }, + { + "key": "toolbarPromptControl--recording", + "className": "MuiDataGridPro-toolbarPromptControl--recording", + "description": "Styles applied to the toolbar prompt control element when recording.", + "isGlobal": false + }, + { + "key": "toolbarPromptControlRecordButton", + "className": "MuiDataGridPro-toolbarPromptControlRecordButton", + "description": "Styles applied to the toolbar prompt control record button element.", + "isGlobal": false + }, + { + "key": "toolbarPromptControlRecordingIndicator", + "className": "MuiDataGridPro-toolbarPromptControlRecordingIndicator", + "description": "Styles applied to the toolbar prompt control recording indicator element.", + "isGlobal": false + }, + { + "key": "toolbarPromptControlSendButton", + "className": "MuiDataGridPro-toolbarPromptControlSendButton", + "description": "Styles applied to the toolbar prompt control send button element.", + "isGlobal": false + }, { "key": "treeDataGroupingCell", "className": "MuiDataGridPro-treeDataGroupingCell", diff --git a/docs/pages/x/api/data-grid/data-grid.json b/docs/pages/x/api/data-grid/data-grid.json index caf8c0b7d0357..a601729893981 100644 --- a/docs/pages/x/api/data-grid/data-grid.json +++ b/docs/pages/x/api/data-grid/data-grid.json @@ -1685,6 +1685,36 @@ "description": "Styles applied to the toolbar filter list element.", "isGlobal": false }, + { + "key": "toolbarPromptControl", + "className": "MuiDataGrid-toolbarPromptControl", + "description": "Styles applied to the toolbar prompt control element.", + "isGlobal": false + }, + { + "key": "toolbarPromptControl--recording", + "className": "MuiDataGrid-toolbarPromptControl--recording", + "description": "Styles applied to the toolbar prompt control element when recording.", + "isGlobal": false + }, + { + "key": "toolbarPromptControlRecordButton", + "className": "MuiDataGrid-toolbarPromptControlRecordButton", + "description": "Styles applied to the toolbar prompt control record button element.", + "isGlobal": false + }, + { + "key": "toolbarPromptControlRecordingIndicator", + "className": "MuiDataGrid-toolbarPromptControlRecordingIndicator", + "description": "Styles applied to the toolbar prompt control recording indicator element.", + "isGlobal": false + }, + { + "key": "toolbarPromptControlSendButton", + "className": "MuiDataGrid-toolbarPromptControlSendButton", + "description": "Styles applied to the toolbar prompt control send button element.", + "isGlobal": false + }, { "key": "treeDataGroupingCell", "className": "MuiDataGrid-treeDataGroupingCell", diff --git a/docs/pages/x/api/data-grid/grid-actions-col-def.json b/docs/pages/x/api/data-grid/grid-actions-col-def.json index eece855816ed8..7e938d8dd4386 100644 --- a/docs/pages/x/api/data-grid/grid-actions-col-def.json +++ b/docs/pages/x/api/data-grid/grid-actions-col-def.json @@ -93,6 +93,7 @@ "sortable": { "type": { "description": "boolean" }, "default": "true" }, "sortComparator": { "type": { "description": "GridComparatorFn<V>" } }, "sortingOrder": { "type": { "description": "readonly GridSortDirection[]" } }, + "unstable_examples": { "type": { "description": "V[]" } }, "valueFormatter": { "type": { "description": "GridValueFormatter<R, V, F>" } }, "valueGetter": { "type": { "description": "GridValueGetter<R, V, F>" } }, "valueParser": { "type": { "description": "GridValueParser<R, V, F>" } }, diff --git a/docs/pages/x/api/data-grid/grid-col-def.json b/docs/pages/x/api/data-grid/grid-col-def.json index 0546471b90ea7..bc07f52910954 100644 --- a/docs/pages/x/api/data-grid/grid-col-def.json +++ b/docs/pages/x/api/data-grid/grid-col-def.json @@ -87,6 +87,7 @@ "sortComparator": { "type": { "description": "GridComparatorFn<V>" } }, "sortingOrder": { "type": { "description": "readonly GridSortDirection[]" } }, "type": { "type": { "description": "GridColType" }, "default": "'singleSelect'" }, + "unstable_examples": { "type": { "description": "V[]" } }, "valueFormatter": { "type": { "description": "GridValueFormatter<R, V, F>" } }, "valueGetter": { "type": { "description": "GridValueGetter<R, V, F>" } }, "valueParser": { "type": { "description": "GridValueParser<R, V, F>" } }, diff --git a/docs/pages/x/api/data-grid/grid-single-select-col-def.json b/docs/pages/x/api/data-grid/grid-single-select-col-def.json index e07981f5de85a..5ed842ac602ec 100644 --- a/docs/pages/x/api/data-grid/grid-single-select-col-def.json +++ b/docs/pages/x/api/data-grid/grid-single-select-col-def.json @@ -93,6 +93,7 @@ "sortable": { "type": { "description": "boolean" }, "default": "true" }, "sortComparator": { "type": { "description": "GridComparatorFn<V>" } }, "sortingOrder": { "type": { "description": "readonly GridSortDirection[]" } }, + "unstable_examples": { "type": { "description": "V[]" } }, "valueFormatter": { "type": { "description": "GridValueFormatter<R, V, F>" } }, "valueGetter": { "type": { "description": "GridValueGetter<R, V, F>" } }, "valueOptions": { diff --git a/docs/pages/x/react-data-grid/prompt.js b/docs/pages/x/react-data-grid/prompt.js new file mode 100644 index 0000000000000..fc9cc8569c41b --- /dev/null +++ b/docs/pages/x/react-data-grid/prompt.js @@ -0,0 +1,7 @@ +import * as React from 'react'; +import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; +import * as pageProps from 'docsx/data/data-grid/prompt/prompt.md?muiMarkdown'; + +export default function Page() { + return ; +} 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 8879a0ba952c8..f32970f0f23a9 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 @@ -1199,6 +1199,27 @@ "description": "Styles applied to {{nodeName}}.", "nodeName": "the toolbar filter list element" }, + "toolbarPromptControl": { + "description": "Styles applied to {{nodeName}}.", + "nodeName": "the toolbar prompt control element" + }, + "toolbarPromptControl--recording": { + "description": "Styles applied to {{nodeName}} when {{conditions}}.", + "nodeName": "the toolbar prompt control element", + "conditions": "recording" + }, + "toolbarPromptControlRecordButton": { + "description": "Styles applied to {{nodeName}}.", + "nodeName": "the toolbar prompt control record button element" + }, + "toolbarPromptControlRecordingIndicator": { + "description": "Styles applied to {{nodeName}}.", + "nodeName": "the toolbar prompt control recording indicator element" + }, + "toolbarPromptControlSendButton": { + "description": "Styles applied to {{nodeName}}.", + "nodeName": "the toolbar prompt control send button element" + }, "treeDataGroupingCell": { "description": "Styles applied to {{nodeName}}.", "nodeName": "the root of the grouping column of the tree data" @@ -1309,6 +1330,8 @@ "rowReorderIcon": "Icon displayed on the reorder column type to reorder a row.", "skeletonCell": "Component rendered for each skeleton cell.", "toolbar": "Toolbar component rendered inside the Header component.", + "toolbarPromptRecordIcon": "Icon used for the button that starts/stops recording the prompt", + "toolbarPromptSendIcon": "Icon used for the button that sends a prompt", "treeDataCollapseIcon": "Icon displayed on the tree data toggling column when the children are expanded", "treeDataExpandIcon": "Icon displayed on the tree data toggling column when the children are collapsed" } 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 c56adbe4fb0be..c946f52e992b8 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 @@ -1137,6 +1137,27 @@ "description": "Styles applied to {{nodeName}}.", "nodeName": "the toolbar filter list element" }, + "toolbarPromptControl": { + "description": "Styles applied to {{nodeName}}.", + "nodeName": "the toolbar prompt control element" + }, + "toolbarPromptControl--recording": { + "description": "Styles applied to {{nodeName}} when {{conditions}}.", + "nodeName": "the toolbar prompt control element", + "conditions": "recording" + }, + "toolbarPromptControlRecordButton": { + "description": "Styles applied to {{nodeName}}.", + "nodeName": "the toolbar prompt control record button element" + }, + "toolbarPromptControlRecordingIndicator": { + "description": "Styles applied to {{nodeName}}.", + "nodeName": "the toolbar prompt control recording indicator element" + }, + "toolbarPromptControlSendButton": { + "description": "Styles applied to {{nodeName}}.", + "nodeName": "the toolbar prompt control send button element" + }, "treeDataGroupingCell": { "description": "Styles applied to {{nodeName}}.", "nodeName": "the root of the grouping column of the tree data" 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 77ba99fb40302..dc476f3453732 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 @@ -1017,6 +1017,27 @@ "description": "Styles applied to {{nodeName}}.", "nodeName": "the toolbar filter list element" }, + "toolbarPromptControl": { + "description": "Styles applied to {{nodeName}}.", + "nodeName": "the toolbar prompt control element" + }, + "toolbarPromptControl--recording": { + "description": "Styles applied to {{nodeName}} when {{conditions}}.", + "nodeName": "the toolbar prompt control element", + "conditions": "recording" + }, + "toolbarPromptControlRecordButton": { + "description": "Styles applied to {{nodeName}}.", + "nodeName": "the toolbar prompt control record button element" + }, + "toolbarPromptControlRecordingIndicator": { + "description": "Styles applied to {{nodeName}}.", + "nodeName": "the toolbar prompt control recording indicator element" + }, + "toolbarPromptControlSendButton": { + "description": "Styles applied to {{nodeName}}.", + "nodeName": "the toolbar prompt control send button element" + }, "treeDataGroupingCell": { "description": "Styles applied to {{nodeName}}.", "nodeName": "the root of the grouping column of the tree data" diff --git a/docs/translations/api-docs/data-grid/grid-actions-col-def.json b/docs/translations/api-docs/data-grid/grid-actions-col-def.json index ec34f0c620938..e1fd8bfe71eef 100644 --- a/docs/translations/api-docs/data-grid/grid-actions-col-def.json +++ b/docs/translations/api-docs/data-grid/grid-actions-col-def.json @@ -81,6 +81,9 @@ "sortable": { "description": "If true, the column is sortable." }, "sortComparator": { "description": "A comparator function used to sort rows." }, "sortingOrder": { "description": "The order of the sorting sequence." }, + "unstable_examples": { + "description": "Example values that can be used by the grid to get more context about the column." + }, "valueFormatter": { "description": "Function that allows to apply a formatter before rendering its value." }, diff --git a/docs/translations/api-docs/data-grid/grid-col-def.json b/docs/translations/api-docs/data-grid/grid-col-def.json index 1e63902cd79e5..f8dc2690582a6 100644 --- a/docs/translations/api-docs/data-grid/grid-col-def.json +++ b/docs/translations/api-docs/data-grid/grid-col-def.json @@ -80,6 +80,9 @@ "sortComparator": { "description": "A comparator function used to sort rows." }, "sortingOrder": { "description": "The order of the sorting sequence." }, "type": { "description": "The type of the column." }, + "unstable_examples": { + "description": "Example values that can be used by the grid to get more context about the column." + }, "valueFormatter": { "description": "Function that allows to apply a formatter before rendering its value." }, diff --git a/docs/translations/api-docs/data-grid/grid-single-select-col-def.json b/docs/translations/api-docs/data-grid/grid-single-select-col-def.json index 55fceed053c94..3d9e50019ee64 100644 --- a/docs/translations/api-docs/data-grid/grid-single-select-col-def.json +++ b/docs/translations/api-docs/data-grid/grid-single-select-col-def.json @@ -84,6 +84,9 @@ "sortable": { "description": "If true, the column is sortable." }, "sortComparator": { "description": "A comparator function used to sort rows." }, "sortingOrder": { "description": "The order of the sorting sequence." }, + "unstable_examples": { + "description": "Example values that can be used by the grid to get more context about the column." + }, "valueFormatter": { "description": "Function that allows to apply a formatter before rendering its value." }, diff --git a/packages/x-data-grid-generator/src/columns/employees.columns.tsx b/packages/x-data-grid-generator/src/columns/employees.columns.tsx index 4f29ce843a4af..44eeef5832ce0 100644 --- a/packages/x-data-grid-generator/src/columns/employees.columns.tsx +++ b/packages/x-data-grid-generator/src/columns/employees.columns.tsx @@ -132,6 +132,7 @@ export const getEmployeeColumns = (): GridColDefGenerator[] => [ }, { field: 'position', + description: 'Job title', headerName: 'Position', generateData: randomJobTitle, width: 180, diff --git a/packages/x-data-grid-generator/src/constants/prompts.ts b/packages/x-data-grid-generator/src/constants/prompts.ts new file mode 100644 index 0000000000000..36cb2f9bf8596 --- /dev/null +++ b/packages/x-data-grid-generator/src/constants/prompts.ts @@ -0,0 +1,107 @@ +import { unstable_PromptResponse as PromptResponse } from '@mui/x-data-grid-premium'; + +export const mockPrompts = new Map([ + [ + 'sort by name', + { + select: -1, + filters: [], + aggregation: {}, + sorting: [ + { + column: 'name', + direction: 'asc', + }, + ], + grouping: [], + error: null, + }, + ], + [ + 'sort by company name and employee name', + { + select: -1, + filters: [], + aggregation: {}, + sorting: [ + { + column: 'company', + direction: 'asc', + }, + { + column: 'name', + direction: 'asc', + }, + ], + grouping: [], + error: null, + }, + ], + [ + 'show people from the eu', + { + select: -1, + filters: [ + { + column: 'country', + operator: 'isAnyOf', + value: [ + 'AT', + 'BE', + 'BG', + 'CY', + 'CZ', + 'DE', + 'DK', + 'EE', + 'ES', + 'FI', + 'FR', + 'GR', + 'HR', + 'HU', + 'IE', + 'IT', + 'LT', + 'LU', + 'LV', + 'MT', + 'NL', + 'PL', + 'PT', + 'RO', + 'SE', + 'SI', + 'SK', + ], + }, + ], + aggregation: {}, + sorting: [], + grouping: [], + error: null, + }, + ], + [ + 'order companies by amount of people', + { + select: -1, + filters: [], + aggregation: { + id: 'size', + }, + sorting: [ + { + column: 'id', + direction: 'desc', + }, + ], + grouping: [ + { + column: 'company', + }, + ], + error: null, + }, + ], +]); diff --git a/packages/x-data-grid-generator/src/services/index.ts b/packages/x-data-grid-generator/src/services/index.ts index 168db701a2d2f..0c44fda46f07e 100644 --- a/packages/x-data-grid-generator/src/services/index.ts +++ b/packages/x-data-grid-generator/src/services/index.ts @@ -2,3 +2,4 @@ export * from './gridColDefGenerator'; export * from './random-generator'; export * from './real-data-service'; export * from './basic-data-service'; +export * from './prompt-resolver'; diff --git a/packages/x-data-grid-generator/src/services/prompt-resolver.ts b/packages/x-data-grid-generator/src/services/prompt-resolver.ts new file mode 100644 index 0000000000000..f393593b5f876 --- /dev/null +++ b/packages/x-data-grid-generator/src/services/prompt-resolver.ts @@ -0,0 +1,16 @@ +import { unstable_PromptResponse as PromptResponse } from '@mui/x-data-grid-premium'; +import { mockPrompts } from '../constants/prompts'; + +export const mockPromptResolver = (_: string, query: string) => { + const resolved = mockPrompts.get(query.toLowerCase().trim()); + + return new Promise((resolve, reject) => { + setTimeout(() => { + if (resolved) { + resolve(resolved); + } else { + reject(new Error('Unknown query')); + } + }, 1000); + }); +}; diff --git a/packages/x-data-grid-premium/src/components/index.ts b/packages/x-data-grid-premium/src/components/index.ts index 1204ebc04638a..d48932ab3a696 100644 --- a/packages/x-data-grid-premium/src/components/index.ts +++ b/packages/x-data-grid-premium/src/components/index.ts @@ -1,4 +1,5 @@ export * from './GridExcelExportMenuItem'; export * from '../material/icons'; export * from './GridColumnMenuAggregationItem'; +export * from './promptControl'; export { GridColumnMenuGroupingItem } from './GridPremiumColumnMenu'; diff --git a/packages/x-data-grid-premium/src/components/promptControl/GridToolbarPromptControl.tsx b/packages/x-data-grid-premium/src/components/promptControl/GridToolbarPromptControl.tsx new file mode 100644 index 0000000000000..7f08363cb4141 --- /dev/null +++ b/packages/x-data-grid-premium/src/components/promptControl/GridToolbarPromptControl.tsx @@ -0,0 +1,277 @@ +import * as React from 'react'; +import { styled } from '@mui/material/styles'; +import composeClasses from '@mui/utils/composeClasses'; +import useEventCallback from '@mui/utils/useEventCallback'; +import { + getDataGridUtilityClass, + GRID_CHECKBOX_SELECTION_FIELD, + gridColumnDefinitionsSelector, + gridColumnLookupSelector, + GridLogicOperator, + gridRowsLookupSelector, + GridSingleSelectColDef, +} from '@mui/x-data-grid'; +import { getValueOptions, getVisibleRows } from '@mui/x-data-grid/internals'; +import { DataGridPremiumProcessedProps } from '../../models/dataGridPremiumProps'; +import { GridApiPremium } from '../../models/gridApiPremium'; +import { useGridApiContext } from '../../hooks/utils/useGridApiContext'; +import { useGridRootProps } from '../../hooks/utils/useGridRootProps'; +import { PromptResponse } from '../../hooks/features/promptControl/types'; +import { RecordButton, BrowserSpeechRecognition } from './RecordButton'; + +type OwnerState = DataGridPremiumProcessedProps; + +const supportsSpeechRecognition = !!BrowserSpeechRecognition; + +const useUtilityClasses = (ownerState: OwnerState, recording: boolean) => { + const { classes } = ownerState; + + const slots = { + root: ['toolbarPromptControl', recording && 'toolbarPromptControl--recording'], + recordingIndicator: ['toolbarPromptControlRecordingIndicator'], + recordButton: ['toolbarPromptControlRecordButton'], + sendButton: ['toolbarPromptControlSendButton'], + }; + + return composeClasses(slots, getDataGridUtilityClass, classes); +}; + +const GridToolbarPromptControlRoot = styled('div', { + name: 'MuiDataGrid', + slot: 'ToolbarPromptControl', + overridesResolver: (_, styles) => styles.toolbarPromptControl, +})<{ ownerState: OwnerState }>({ + flex: 1, + display: 'flex', + flexDirection: 'row', +}); + +function sampleData(apiRef: React.MutableRefObject) { + const columns = gridColumnDefinitionsSelector(apiRef); + const rows = Object.values(gridRowsLookupSelector(apiRef)); + const columnExamples: Record = {}; + + columns.forEach((column) => { + columnExamples[column.field] = Array.from({ length: Math.min(5, rows.length) }).map(() => { + const row = rows[Math.floor(Math.random() * rows.length)]; + if (column.valueGetter) { + return column.valueGetter(row[column.field] as never, row, column, apiRef); + } + return row[column.field]; + }); + }); + + return columnExamples; +} + +function generateContext( + apiRef: React.MutableRefObject, + examples?: Record, +) { + const columns = gridColumnDefinitionsSelector(apiRef); + const columnsContext = columns.map((column) => ({ + field: column.field, + description: column.description ?? null, + examples: examples?.[column.field] ?? column.unstable_examples ?? [], + type: column.type ?? 'string', + allowedOperators: column.filterOperators?.map((operator) => operator.value) ?? [], + })); + + return `The columns are described by the following JSON:\n${JSON.stringify(columnsContext)}`; +} + +type GridToolbarPromptControlProps = { + /** + * Called when the new prompt is ready to be processed. + * Provides the prompt and the data context and expects the grid state updates to be returned. + * @param {string} context The context of the prompt + * @param {string} query The query to process + * @returns {Promise} The grid state updates + */ + onPrompt: (context: string, query: string) => Promise; + /** + * Allow taking couple of random cell values from each column to improve the prompt context. + * If allowed, samples are taken from different rows. + * If not allowed, the column examples are used. + * @default false + */ + allowDataSampling?: boolean; + /** + * The BCP 47 language tag to use for the speech recognition. + * @default HTML lang attribute value or the user agent's language setting + */ + lang?: string; +}; + +function GridToolbarPromptControl(props: GridToolbarPromptControlProps) { + const apiRef = useGridApiContext(); + const rootProps = useGridRootProps(); + const { onPrompt, lang, allowDataSampling = false } = props; + + const [isLoading, setLoading] = React.useState(false); + const [error, setError] = React.useState(null); + const [isRecording, setRecording] = React.useState(false); + const [query, setQuery] = React.useState(''); + + const classes = useUtilityClasses(rootProps, isRecording); + const examplesFromData = React.useMemo( + () => (allowDataSampling ? sampleData(apiRef) : undefined), + [apiRef, allowDataSampling], + ); + + const processPrompt = React.useCallback(() => { + const context = generateContext(apiRef, examplesFromData); + const columnsByField = gridColumnLookupSelector(apiRef); + + setLoading(true); + setError(null); + apiRef.current.setLoading(true); + + onPrompt(context, query) + .then((result) => { + const interestColumns = [] as string[]; + + apiRef.current.setFilterModel({ + items: result.filters.map((filter, index) => { + const item = { + id: index, + field: filter.column, + operator: filter.operator, + value: filter.value, + }; + + const column = columnsByField[filter.column]; + if (column.type === 'singleSelect') { + const options = getValueOptions(column as GridSingleSelectColDef) ?? []; + const found = options.find( + (option) => typeof option === 'object' && option.label === filter.value, + ); + if (found) { + item.value = (found as any).value; + } + } + + return item; + }), + logicOperator: (result.filterOperator as GridLogicOperator) ?? GridLogicOperator.And, + quickFilterValues: [], + }); + + apiRef.current.setRowGroupingModel(result.grouping.map((g) => g.column)); + apiRef.current.setAggregationModel(result.aggregation); + + apiRef.current.setSortModel( + result.sorting.map((s) => ({ field: s.column, sort: s.direction })), + ); + + const rows = getVisibleRows(apiRef, rootProps); + const selectedRowIds = + result.select === -1 + ? [] + : rows.rows.slice(0, result.select).map((r) => { + return apiRef.current.getRowId(r); + }); + apiRef.current.setRowSelectionModel(selectedRowIds); + + const columns = apiRef.current.getAllColumns(); + const targetIndex = + Number(columns.find((c) => c.field === GRID_CHECKBOX_SELECTION_FIELD) !== undefined) + + Number(result.grouping.length); + + interestColumns.push(...Object.keys(result.aggregation)); + interestColumns.push(...result.filters.map((f) => f.column)); + interestColumns.reverse().forEach((c) => apiRef.current.setColumnIndex(c, targetIndex)); + }) + .catch((_) => { + setError(apiRef.current.getLocaleText('toolbarPromptControlErrorMessage')); + }) + .finally(() => { + setLoading(false); + apiRef.current.setState((state) => ({ ...state, rows: { ...state.rows, loading: false } })); + }); + }, [apiRef, rootProps, onPrompt, examplesFromData, query]); + + const handleChange = useEventCallback((event: React.ChangeEvent) => { + setQuery(event.target.value); + }); + + const handleKeyDown = useEventCallback((event: React.KeyboardEvent) => { + if (event.code === 'Enter') { + processPrompt(); + } + }); + + const handleDone = useEventCallback((value: string) => { + setQuery(value); + if (value) { + processPrompt(); + } + }); + + const placeholder = supportsSpeechRecognition + ? apiRef.current.getLocaleText('toolbarPromptControlWithRecordingPlaceholder') + : apiRef.current.getLocaleText('toolbarPromptControlPlaceholder'); + + return ( + + + + + ), + endAdornment: ( + + +
+ + + +
+
+
+ ), + }} + /> +
+ ); +} + +export { GridToolbarPromptControl }; diff --git a/packages/x-data-grid-premium/src/components/promptControl/RecordButton.tsx b/packages/x-data-grid-premium/src/components/promptControl/RecordButton.tsx new file mode 100644 index 0000000000000..a3d678651999f --- /dev/null +++ b/packages/x-data-grid-premium/src/components/promptControl/RecordButton.tsx @@ -0,0 +1,134 @@ +import * as React from 'react'; +import { Timeout } from '@mui/utils/useTimeout'; +import useLazyRef from '@mui/utils/useLazyRef'; +import { useGridApiContext } from '../../hooks/utils/useGridApiContext'; +import { useGridRootProps } from '../../hooks/utils/useGridRootProps'; + +export const BrowserSpeechRecognition = + (globalThis as any).SpeechRecognition || (globalThis as any).webkitSpeechRecognition; + +type SpeechRecognitionOptions = { + onUpdate: (value: string) => void; + onDone: (value: string) => void; + onError: (error: string) => void; +}; + +interface RecordButtonProps extends SpeechRecognitionOptions { + disabled: boolean; + lang?: string; + recording: boolean; + setRecording: (value: boolean) => void; + className: string; +} + +function RecordButton(props: RecordButtonProps) { + const apiRef = useGridApiContext(); + const rootProps = useGridRootProps(); + const { lang, recording, setRecording, disabled, className, onDone, onUpdate, onError } = props; + const buttonRef = React.useRef(null); + + const recognition = useLazyRef(() => { + if (!BrowserSpeechRecognition) { + return { + start: () => {}, + abort: () => {}, + }; + } + + const timeout = new Timeout(); + const instance = new BrowserSpeechRecognition(); + instance.continuous = true; + instance.interimResults = true; + instance.lang = lang; + + let finalResult = ''; + let interimResult = ''; + + function start(options: SpeechRecognitionOptions) { + if (recording) { + return; + } + setRecording(true); + + instance.onresult = (event: any) => { + finalResult = ''; + interimResult = ''; + if (typeof event.results === 'undefined') { + instance.stop(); + return; + } + + for (let i = event.resultIndex; i < event.results.length; i += 1) { + if (event.results[i].isFinal) { + finalResult += event.results[i][0].transcript; + } else { + interimResult += event.results[i][0].transcript; + } + } + + if (finalResult === '') { + options.onUpdate(interimResult); + } + timeout.start(1000, () => instance.stop()); + }; + + instance.onsoundend = () => { + instance.stop(); + }; + + instance.onend = () => { + options.onDone(finalResult); + setRecording(false); + }; + + instance.onerror = (error: { error: string; message: string }) => { + options.onError(error.message); + instance.stop(); + setRecording(false); + }; + + instance.start(); + } + + function abort() { + instance.abort(); + } + + return { start, abort }; + }).current; + + const handleClick = () => { + if (!recording) { + recognition.start({ onDone, onUpdate, onError }); + return; + } + + recognition.abort(); + }; + + return ( + +
+ + + +
+
+ ); +} + +export { RecordButton }; diff --git a/packages/x-data-grid-premium/src/components/promptControl/index.ts b/packages/x-data-grid-premium/src/components/promptControl/index.ts new file mode 100644 index 0000000000000..1136cb8f5e85d --- /dev/null +++ b/packages/x-data-grid-premium/src/components/promptControl/index.ts @@ -0,0 +1 @@ +export { GridToolbarPromptControl as Unstable_GridToolbarPromptControl } from './GridToolbarPromptControl'; diff --git a/packages/x-data-grid-premium/src/hooks/features/index.ts b/packages/x-data-grid-premium/src/hooks/features/index.ts index c35c495dc027e..d76692090b145 100644 --- a/packages/x-data-grid-premium/src/hooks/features/index.ts +++ b/packages/x-data-grid-premium/src/hooks/features/index.ts @@ -3,3 +3,4 @@ export * from './aggregation'; export * from './rowGrouping'; export * from './export'; export * from './cellSelection'; +export * from './promptControl'; diff --git a/packages/x-data-grid-premium/src/hooks/features/promptControl/api.ts b/packages/x-data-grid-premium/src/hooks/features/promptControl/api.ts new file mode 100644 index 0000000000000..317476f5a51ed --- /dev/null +++ b/packages/x-data-grid-premium/src/hooks/features/promptControl/api.ts @@ -0,0 +1,28 @@ +import { PromptResponse } from './types'; + +type Result = { ok: false; message: string } | { ok: true; data: T }; + +export function gridDefaultPromptResolver(url: string, context: string, query: string) { + return fetch(url, { + mode: 'cors', + method: 'POST', + headers: { + 'content-type': 'application/json', + }, + credentials: 'include', + body: JSON.stringify({ + context, + query, + }), + }) + .then((result) => result.json()) + .then((result: Result) => { + if (result.ok === false) { + return Promise.reject(new Error(result.message)); + } + if (result.data.error) { + return Promise.reject(new Error(result.data.error)); + } + return result.data; + }); +} diff --git a/packages/x-data-grid-premium/src/hooks/features/promptControl/index.ts b/packages/x-data-grid-premium/src/hooks/features/promptControl/index.ts new file mode 100644 index 0000000000000..50eb0df5ddf5a --- /dev/null +++ b/packages/x-data-grid-premium/src/hooks/features/promptControl/index.ts @@ -0,0 +1,2 @@ +export { gridDefaultPromptResolver as unstable_gridDefaultPromptResolver } from './api'; +export type { PromptResponse as unstable_PromptResponse } from './types'; diff --git a/packages/x-data-grid-premium/src/hooks/features/promptControl/types.ts b/packages/x-data-grid-premium/src/hooks/features/promptControl/types.ts new file mode 100644 index 0000000000000..032d9d725fd51 --- /dev/null +++ b/packages/x-data-grid-premium/src/hooks/features/promptControl/types.ts @@ -0,0 +1,29 @@ +export type Sort = { + column: string; + direction: 'asc' | 'desc'; +}; + +export type Grouping = { + column: string; +}; + +export type Filter = { + operator: string; + value: string | number | boolean | string[] | number[]; + column: string; +}; + +export type AggregationFunction = 'avg' | 'sum' | 'min' | 'max' | 'size'; +export type Aggregation = { + [column: string]: AggregationFunction; +}; + +export type PromptResponse = { + select: number; + filters: Filter[]; + filterOperator?: 'and' | 'or'; + aggregation: Aggregation; + sorting: Sort[]; + grouping: Grouping[]; + error: string | null; +}; diff --git a/packages/x-data-grid-premium/src/material/icons.tsx b/packages/x-data-grid-premium/src/material/icons.tsx index 92fff6f8518ba..3f162f7cf5c52 100644 --- a/packages/x-data-grid-premium/src/material/icons.tsx +++ b/packages/x-data-grid-premium/src/material/icons.tsx @@ -17,3 +17,13 @@ export const GridFunctionsIcon = createSvgIcon( , 'Functions', ); + +export const GridSendPromptIcon = createSvgIcon( + , + 'SendPrompt', +); + +export const GridRecordPromptIcon = createSvgIcon( + , + 'RecordPrompt', +); diff --git a/packages/x-data-grid-premium/src/material/index.ts b/packages/x-data-grid-premium/src/material/index.ts index cf4beb20825be..1d36e3a190c54 100644 --- a/packages/x-data-grid-premium/src/material/index.ts +++ b/packages/x-data-grid-premium/src/material/index.ts @@ -1,10 +1,18 @@ import type { GridPremiumIconSlotsComponent } from '../models'; -import { GridWorkspacesIcon, GridGroupWorkIcon, GridFunctionsIcon } from './icons'; +import { + GridWorkspacesIcon, + GridGroupWorkIcon, + GridFunctionsIcon, + GridSendPromptIcon, + GridRecordPromptIcon, +} from './icons'; const iconsSlots: GridPremiumIconSlotsComponent = { columnMenuUngroupIcon: GridWorkspacesIcon, columnMenuGroupIcon: GridGroupWorkIcon, columnMenuAggregationIcon: GridFunctionsIcon, + toolbarPromptSendIcon: GridSendPromptIcon, + toolbarPromptRecordIcon: GridRecordPromptIcon, }; const materialSlots = { diff --git a/packages/x-data-grid-premium/src/models/gridPremiumIconSlotsComponent.ts b/packages/x-data-grid-premium/src/models/gridPremiumIconSlotsComponent.ts index 3730901b0d8a6..87f7f7be3f647 100644 --- a/packages/x-data-grid-premium/src/models/gridPremiumIconSlotsComponent.ts +++ b/packages/x-data-grid-premium/src/models/gridPremiumIconSlotsComponent.ts @@ -16,4 +16,14 @@ export interface GridPremiumIconSlotsComponent { * @default GridFunctionsIcon */ columnMenuAggregationIcon: React.JSXElementConstructor; + /** + * Icon used for the button that sends a prompt + * @default GridFunctionsIcon + */ + toolbarPromptSendIcon: React.JSXElementConstructor; + /** + * Icon used for the button that starts/stops recording the prompt + * @default GridFunctionsIcon + */ + toolbarPromptRecordIcon: React.JSXElementConstructor; } diff --git a/packages/x-data-grid/src/constants/gridClasses.ts b/packages/x-data-grid/src/constants/gridClasses.ts index 9082fae28e0ee..30e9df86d3d0c 100644 --- a/packages/x-data-grid/src/constants/gridClasses.ts +++ b/packages/x-data-grid/src/constants/gridClasses.ts @@ -592,6 +592,26 @@ export interface GridClasses { * Styles applied to the toolbar filter list element. */ toolbarFilterList: string; + /** + * Styles applied to the toolbar prompt control element. + */ + toolbarPromptControl: string; + /** + * Styles applied to the toolbar prompt control element when recording. + */ + 'toolbarPromptControl--recording': string; + /** + * Styles applied to the toolbar prompt control recording indicator element. + */ + toolbarPromptControlRecordingIndicator: string; + /** + * Styles applied to the toolbar prompt control record button element. + */ + toolbarPromptControlRecordButton: string; + /** + * Styles applied to the toolbar prompt control send button element. + */ + toolbarPromptControlSendButton: string; /** * Styles applied the grid if `showColumnVerticalBorder={true}`. */ @@ -803,6 +823,11 @@ export const gridClasses = generateUtilityClasses('MuiDataGrid', [ 'sortIcon', 'toolbarContainer', 'toolbarFilterList', + 'toolbarPromptControl', + 'toolbarPromptControl--recording', + 'toolbarPromptControlRecordingIndicator', + 'toolbarPromptControlRecordButton', + 'toolbarPromptControlSendButton', 'virtualScroller', 'virtualScroller--hasScrollX', 'virtualScrollerContent', diff --git a/packages/x-data-grid/src/constants/localeTextConstants.ts b/packages/x-data-grid/src/constants/localeTextConstants.ts index 395d73a7355b2..e1084f796c1e1 100644 --- a/packages/x-data-grid/src/constants/localeTextConstants.ts +++ b/packages/x-data-grid/src/constants/localeTextConstants.ts @@ -29,6 +29,19 @@ export const GRID_DEFAULT_LOCALE_TEXT: GridLocaleText = { toolbarQuickFilterLabel: 'Search', toolbarQuickFilterDeleteIconLabel: 'Clear', + // Prompt toolbar field + toolbarPromptControlPlaceholder: 'Type a prompt…', + toolbarPromptControlWithRecordingPlaceholder: 'Type or record a prompt…', + toolbarPromptControlRecordingPlaceholder: 'Listening for prompt…', + toolbarPromptControlLabel: 'Prompt input', + toolbarPromptControlDeleteIconLabel: 'Clear', + toolbarPromptControlRecordButtonDefaultLabel: 'Record', + toolbarPromptControlRecordButtonActiveLabel: 'Stop recording', + toolbarPromptControlSendActionLabel: 'Send', + toolbarPromptControlSendActionAriaLabel: 'Send prompt', + toolbarPromptControlErrorMessage: + 'An error occurred while processing the request. Please try again with a different prompt.', + // Export selector toolbar button text toolbarExport: 'Export', toolbarExportLabel: 'Export', diff --git a/packages/x-data-grid/src/internals/index.ts b/packages/x-data-grid/src/internals/index.ts index 41f12e166367d..f12ed42b1a35c 100644 --- a/packages/x-data-grid/src/internals/index.ts +++ b/packages/x-data-grid/src/internals/index.ts @@ -13,6 +13,7 @@ export { GridBaseColumnHeaders } from '../components/columnHeaders/GridBaseColum export { DATA_GRID_DEFAULT_SLOTS_COMPONENTS } from '../constants/defaultGridSlotsComponents'; export { getGridFilter } from '../components/panel/filterPanel/GridFilterPanel'; +export { getValueOptions } from '../components/panel/filterPanel/filterPanelUtils'; export { useGridRegisterPipeProcessor } from '../hooks/core/pipeProcessing'; export type { GridPipeProcessor } from '../hooks/core/pipeProcessing'; export { diff --git a/packages/x-data-grid/src/locales/arSD.ts b/packages/x-data-grid/src/locales/arSD.ts index b9aadc4d34bb9..f3feffb41c752 100644 --- a/packages/x-data-grid/src/locales/arSD.ts +++ b/packages/x-data-grid/src/locales/arSD.ts @@ -31,6 +31,18 @@ const arSDGrid: Partial = { toolbarQuickFilterLabel: 'بحث', toolbarQuickFilterDeleteIconLabel: 'أزال', + // Prompt toolbar field + // toolbarPromptControlPlaceholder: 'Type a prompt…', + // toolbarPromptControlWithRecordingPlaceholder: 'Type or record a prompt…', + // toolbarPromptControlRecordingPlaceholder: 'Listening for prompt…', + // toolbarPromptControlLabel: 'Prompt input', + // toolbarPromptControlDeleteIconLabel: 'Clear', + // toolbarPromptControlRecordButtonDefaultLabel: 'Record', + // toolbarPromptControlRecordButtonActiveLabel: 'Stop recording', + // toolbarPromptControlSendActionLabel: 'Send', + // toolbarPromptControlSendActionAriaLabel: 'Send prompt', + // toolbarPromptControlErrorMessage: 'An error occurred while processing the request. Please try again with a different prompt.', + // Export selector toolbar button text toolbarExport: 'تصدير', toolbarExportLabel: 'تصدير', diff --git a/packages/x-data-grid/src/locales/beBY.ts b/packages/x-data-grid/src/locales/beBY.ts index e11cb810e4cfd..0e0154b1b8566 100644 --- a/packages/x-data-grid/src/locales/beBY.ts +++ b/packages/x-data-grid/src/locales/beBY.ts @@ -54,6 +54,18 @@ const beBYGrid: Partial = { toolbarQuickFilterLabel: 'Пошук', toolbarQuickFilterDeleteIconLabel: 'Ачысціць', + // Prompt toolbar field + // toolbarPromptControlPlaceholder: 'Type a prompt…', + // toolbarPromptControlWithRecordingPlaceholder: 'Type or record a prompt…', + // toolbarPromptControlRecordingPlaceholder: 'Listening for prompt…', + // toolbarPromptControlLabel: 'Prompt input', + // toolbarPromptControlDeleteIconLabel: 'Clear', + // toolbarPromptControlRecordButtonDefaultLabel: 'Record', + // toolbarPromptControlRecordButtonActiveLabel: 'Stop recording', + // toolbarPromptControlSendActionLabel: 'Send', + // toolbarPromptControlSendActionAriaLabel: 'Send prompt', + // toolbarPromptControlErrorMessage: 'An error occurred while processing the request. Please try again with a different prompt.', + // Export selector toolbar button text toolbarExport: 'Экспарт', toolbarExportLabel: 'Экспарт', diff --git a/packages/x-data-grid/src/locales/bgBG.ts b/packages/x-data-grid/src/locales/bgBG.ts index a27adce61ffae..90a521efee20c 100644 --- a/packages/x-data-grid/src/locales/bgBG.ts +++ b/packages/x-data-grid/src/locales/bgBG.ts @@ -30,6 +30,18 @@ const bgBGGrid: Partial = { toolbarQuickFilterLabel: 'Търсене', toolbarQuickFilterDeleteIconLabel: 'Изчисти', + // Prompt toolbar field + // toolbarPromptControlPlaceholder: 'Type a prompt…', + // toolbarPromptControlWithRecordingPlaceholder: 'Type or record a prompt…', + // toolbarPromptControlRecordingPlaceholder: 'Listening for prompt…', + // toolbarPromptControlLabel: 'Prompt input', + // toolbarPromptControlDeleteIconLabel: 'Clear', + // toolbarPromptControlRecordButtonDefaultLabel: 'Record', + // toolbarPromptControlRecordButtonActiveLabel: 'Stop recording', + // toolbarPromptControlSendActionLabel: 'Send', + // toolbarPromptControlSendActionAriaLabel: 'Send prompt', + // toolbarPromptControlErrorMessage: 'An error occurred while processing the request. Please try again with a different prompt.', + // Export selector toolbar button text toolbarExport: 'Изтегли', toolbarExportLabel: 'Изтегли', diff --git a/packages/x-data-grid/src/locales/csCZ.ts b/packages/x-data-grid/src/locales/csCZ.ts index 18611554aa824..f6112b47e9717 100644 --- a/packages/x-data-grid/src/locales/csCZ.ts +++ b/packages/x-data-grid/src/locales/csCZ.ts @@ -38,6 +38,18 @@ const csCZGrid: Partial = { toolbarQuickFilterLabel: 'Hledat', toolbarQuickFilterDeleteIconLabel: 'Vymazat', + // Prompt toolbar field + // toolbarPromptControlPlaceholder: 'Type a prompt…', + // toolbarPromptControlWithRecordingPlaceholder: 'Type or record a prompt…', + // toolbarPromptControlRecordingPlaceholder: 'Listening for prompt…', + // toolbarPromptControlLabel: 'Prompt input', + // toolbarPromptControlDeleteIconLabel: 'Clear', + // toolbarPromptControlRecordButtonDefaultLabel: 'Record', + // toolbarPromptControlRecordButtonActiveLabel: 'Stop recording', + // toolbarPromptControlSendActionLabel: 'Send', + // toolbarPromptControlSendActionAriaLabel: 'Send prompt', + // toolbarPromptControlErrorMessage: 'An error occurred while processing the request. Please try again with a different prompt.', + // Export selector toolbar button text toolbarExport: 'Export', toolbarExportLabel: 'Export', diff --git a/packages/x-data-grid/src/locales/daDK.ts b/packages/x-data-grid/src/locales/daDK.ts index d6094d42ce260..001669e2c8da1 100644 --- a/packages/x-data-grid/src/locales/daDK.ts +++ b/packages/x-data-grid/src/locales/daDK.ts @@ -31,6 +31,18 @@ const daDKGrid: Partial = { toolbarQuickFilterLabel: 'Søg', toolbarQuickFilterDeleteIconLabel: 'Ryd', + // Prompt toolbar field + // toolbarPromptControlPlaceholder: 'Type a prompt…', + // toolbarPromptControlWithRecordingPlaceholder: 'Type or record a prompt…', + // toolbarPromptControlRecordingPlaceholder: 'Listening for prompt…', + // toolbarPromptControlLabel: 'Prompt input', + // toolbarPromptControlDeleteIconLabel: 'Clear', + // toolbarPromptControlRecordButtonDefaultLabel: 'Record', + // toolbarPromptControlRecordButtonActiveLabel: 'Stop recording', + // toolbarPromptControlSendActionLabel: 'Send', + // toolbarPromptControlSendActionAriaLabel: 'Send prompt', + // toolbarPromptControlErrorMessage: 'An error occurred while processing the request. Please try again with a different prompt.', + // Export selector toolbar button text toolbarExport: 'Eksport', toolbarExportLabel: 'Eksporter', diff --git a/packages/x-data-grid/src/locales/deDE.ts b/packages/x-data-grid/src/locales/deDE.ts index 48c894e57ecd6..9e1b1cf3be959 100644 --- a/packages/x-data-grid/src/locales/deDE.ts +++ b/packages/x-data-grid/src/locales/deDE.ts @@ -31,6 +31,18 @@ const deDEGrid: Partial = { toolbarQuickFilterLabel: 'Suchen', toolbarQuickFilterDeleteIconLabel: 'Löschen', + // Prompt toolbar field + // toolbarPromptControlPlaceholder: 'Type a prompt…', + // toolbarPromptControlWithRecordingPlaceholder: 'Type or record a prompt…', + // toolbarPromptControlRecordingPlaceholder: 'Listening for prompt…', + // toolbarPromptControlLabel: 'Prompt input', + // toolbarPromptControlDeleteIconLabel: 'Clear', + // toolbarPromptControlRecordButtonDefaultLabel: 'Record', + // toolbarPromptControlRecordButtonActiveLabel: 'Stop recording', + // toolbarPromptControlSendActionLabel: 'Send', + // toolbarPromptControlSendActionAriaLabel: 'Send prompt', + // toolbarPromptControlErrorMessage: 'An error occurred while processing the request. Please try again with a different prompt.', + // Export selector toolbar button text toolbarExport: 'Exportieren', toolbarExportLabel: 'Exportieren', diff --git a/packages/x-data-grid/src/locales/elGR.ts b/packages/x-data-grid/src/locales/elGR.ts index ad0c394d99efb..6e3c8d0f02d94 100644 --- a/packages/x-data-grid/src/locales/elGR.ts +++ b/packages/x-data-grid/src/locales/elGR.ts @@ -31,6 +31,18 @@ const elGRGrid: Partial = { toolbarQuickFilterLabel: 'Αναζήτηση', toolbarQuickFilterDeleteIconLabel: 'Καθαρισμός', + // Prompt toolbar field + // toolbarPromptControlPlaceholder: 'Type a prompt…', + // toolbarPromptControlWithRecordingPlaceholder: 'Type or record a prompt…', + // toolbarPromptControlRecordingPlaceholder: 'Listening for prompt…', + // toolbarPromptControlLabel: 'Prompt input', + // toolbarPromptControlDeleteIconLabel: 'Clear', + // toolbarPromptControlRecordButtonDefaultLabel: 'Record', + // toolbarPromptControlRecordButtonActiveLabel: 'Stop recording', + // toolbarPromptControlSendActionLabel: 'Send', + // toolbarPromptControlSendActionAriaLabel: 'Send prompt', + // toolbarPromptControlErrorMessage: 'An error occurred while processing the request. Please try again with a different prompt.', + // Export selector toolbar button text toolbarExport: 'Εξαγωγή', toolbarExportLabel: 'Εξαγωγή', diff --git a/packages/x-data-grid/src/locales/esES.ts b/packages/x-data-grid/src/locales/esES.ts index 87d6133d30a27..25ee23998fbae 100644 --- a/packages/x-data-grid/src/locales/esES.ts +++ b/packages/x-data-grid/src/locales/esES.ts @@ -31,6 +31,18 @@ const esESGrid: Partial = { toolbarQuickFilterLabel: 'Buscar', toolbarQuickFilterDeleteIconLabel: 'Limpiar', + // Prompt toolbar field + // toolbarPromptControlPlaceholder: 'Type a prompt…', + // toolbarPromptControlWithRecordingPlaceholder: 'Type or record a prompt…', + // toolbarPromptControlRecordingPlaceholder: 'Listening for prompt…', + // toolbarPromptControlLabel: 'Prompt input', + // toolbarPromptControlDeleteIconLabel: 'Clear', + // toolbarPromptControlRecordButtonDefaultLabel: 'Record', + // toolbarPromptControlRecordButtonActiveLabel: 'Stop recording', + // toolbarPromptControlSendActionLabel: 'Send', + // toolbarPromptControlSendActionAriaLabel: 'Send prompt', + // toolbarPromptControlErrorMessage: 'An error occurred while processing the request. Please try again with a different prompt.', + // Export selector toolbar button text toolbarExport: 'Exportar', toolbarExportLabel: 'Exportar', diff --git a/packages/x-data-grid/src/locales/faIR.ts b/packages/x-data-grid/src/locales/faIR.ts index 6fc24b6f734ed..d653346b0f035 100644 --- a/packages/x-data-grid/src/locales/faIR.ts +++ b/packages/x-data-grid/src/locales/faIR.ts @@ -31,6 +31,18 @@ const faIRGrid: Partial = { toolbarQuickFilterLabel: 'جستجو', toolbarQuickFilterDeleteIconLabel: 'حذف', + // Prompt toolbar field + // toolbarPromptControlPlaceholder: 'Type a prompt…', + // toolbarPromptControlWithRecordingPlaceholder: 'Type or record a prompt…', + // toolbarPromptControlRecordingPlaceholder: 'Listening for prompt…', + // toolbarPromptControlLabel: 'Prompt input', + // toolbarPromptControlDeleteIconLabel: 'Clear', + // toolbarPromptControlRecordButtonDefaultLabel: 'Record', + // toolbarPromptControlRecordButtonActiveLabel: 'Stop recording', + // toolbarPromptControlSendActionLabel: 'Send', + // toolbarPromptControlSendActionAriaLabel: 'Send prompt', + // toolbarPromptControlErrorMessage: 'An error occurred while processing the request. Please try again with a different prompt.', + // Export selector toolbar button text toolbarExport: 'خروجی', toolbarExportLabel: 'خروجی', diff --git a/packages/x-data-grid/src/locales/fiFI.ts b/packages/x-data-grid/src/locales/fiFI.ts index 00391b62b18cd..0abd2ed8a27e9 100644 --- a/packages/x-data-grid/src/locales/fiFI.ts +++ b/packages/x-data-grid/src/locales/fiFI.ts @@ -31,6 +31,18 @@ const fiFIGrid: Partial = { toolbarQuickFilterLabel: 'Hae', toolbarQuickFilterDeleteIconLabel: 'Tyhjennä', + // Prompt toolbar field + // toolbarPromptControlPlaceholder: 'Type a prompt…', + // toolbarPromptControlWithRecordingPlaceholder: 'Type or record a prompt…', + // toolbarPromptControlRecordingPlaceholder: 'Listening for prompt…', + // toolbarPromptControlLabel: 'Prompt input', + // toolbarPromptControlDeleteIconLabel: 'Clear', + // toolbarPromptControlRecordButtonDefaultLabel: 'Record', + // toolbarPromptControlRecordButtonActiveLabel: 'Stop recording', + // toolbarPromptControlSendActionLabel: 'Send', + // toolbarPromptControlSendActionAriaLabel: 'Send prompt', + // toolbarPromptControlErrorMessage: 'An error occurred while processing the request. Please try again with a different prompt.', + // Export selector toolbar button text toolbarExport: 'Vie', toolbarExportLabel: 'Vie', diff --git a/packages/x-data-grid/src/locales/frFR.ts b/packages/x-data-grid/src/locales/frFR.ts index e6928a00e57ab..865b161b884e9 100644 --- a/packages/x-data-grid/src/locales/frFR.ts +++ b/packages/x-data-grid/src/locales/frFR.ts @@ -31,6 +31,18 @@ const frFRGrid: Partial = { toolbarQuickFilterLabel: 'Recherche', toolbarQuickFilterDeleteIconLabel: 'Supprimer', + // Prompt toolbar field + // toolbarPromptControlPlaceholder: 'Type a prompt…', + // toolbarPromptControlWithRecordingPlaceholder: 'Type or record a prompt…', + // toolbarPromptControlRecordingPlaceholder: 'Listening for prompt…', + // toolbarPromptControlLabel: 'Prompt input', + // toolbarPromptControlDeleteIconLabel: 'Clear', + // toolbarPromptControlRecordButtonDefaultLabel: 'Record', + // toolbarPromptControlRecordButtonActiveLabel: 'Stop recording', + // toolbarPromptControlSendActionLabel: 'Send', + // toolbarPromptControlSendActionAriaLabel: 'Send prompt', + // toolbarPromptControlErrorMessage: 'An error occurred while processing the request. Please try again with a different prompt.', + // Export selector toolbar button text toolbarExport: 'Exporter', toolbarExportLabel: 'Exporter', diff --git a/packages/x-data-grid/src/locales/heIL.ts b/packages/x-data-grid/src/locales/heIL.ts index 7612d2a8cc397..8a6806ba7d1cf 100644 --- a/packages/x-data-grid/src/locales/heIL.ts +++ b/packages/x-data-grid/src/locales/heIL.ts @@ -31,6 +31,18 @@ const heILGrid: Partial = { toolbarQuickFilterLabel: 'חיפוש', toolbarQuickFilterDeleteIconLabel: 'ניקוי', + // Prompt toolbar field + // toolbarPromptControlPlaceholder: 'Type a prompt…', + // toolbarPromptControlWithRecordingPlaceholder: 'Type or record a prompt…', + // toolbarPromptControlRecordingPlaceholder: 'Listening for prompt…', + // toolbarPromptControlLabel: 'Prompt input', + // toolbarPromptControlDeleteIconLabel: 'Clear', + // toolbarPromptControlRecordButtonDefaultLabel: 'Record', + // toolbarPromptControlRecordButtonActiveLabel: 'Stop recording', + // toolbarPromptControlSendActionLabel: 'Send', + // toolbarPromptControlSendActionAriaLabel: 'Send prompt', + // toolbarPromptControlErrorMessage: 'An error occurred while processing the request. Please try again with a different prompt.', + // Export selector toolbar button text toolbarExport: 'ייצוא', toolbarExportLabel: 'ייצוא', diff --git a/packages/x-data-grid/src/locales/hrHR.ts b/packages/x-data-grid/src/locales/hrHR.ts index 5999823e9d726..edace0c4ba789 100644 --- a/packages/x-data-grid/src/locales/hrHR.ts +++ b/packages/x-data-grid/src/locales/hrHR.ts @@ -38,6 +38,18 @@ const hrHRGrid: Partial = { toolbarQuickFilterLabel: 'traži', toolbarQuickFilterDeleteIconLabel: 'Obriši', + // Prompt toolbar field + // toolbarPromptControlPlaceholder: 'Type a prompt…', + // toolbarPromptControlWithRecordingPlaceholder: 'Type or record a prompt…', + // toolbarPromptControlRecordingPlaceholder: 'Listening for prompt…', + // toolbarPromptControlLabel: 'Prompt input', + // toolbarPromptControlDeleteIconLabel: 'Clear', + // toolbarPromptControlRecordButtonDefaultLabel: 'Record', + // toolbarPromptControlRecordButtonActiveLabel: 'Stop recording', + // toolbarPromptControlSendActionLabel: 'Send', + // toolbarPromptControlSendActionAriaLabel: 'Send prompt', + // toolbarPromptControlErrorMessage: 'An error occurred while processing the request. Please try again with a different prompt.', + // Export selector toolbar button text toolbarExport: 'Izvoz', toolbarExportLabel: 'Izvoz', diff --git a/packages/x-data-grid/src/locales/huHU.ts b/packages/x-data-grid/src/locales/huHU.ts index 9d9d78e8a7f63..89ebf8fab800d 100644 --- a/packages/x-data-grid/src/locales/huHU.ts +++ b/packages/x-data-grid/src/locales/huHU.ts @@ -30,6 +30,18 @@ const huHUGrid: Partial = { toolbarQuickFilterLabel: 'Keresés', toolbarQuickFilterDeleteIconLabel: 'Törlés', + // Prompt toolbar field + // toolbarPromptControlPlaceholder: 'Type a prompt…', + // toolbarPromptControlWithRecordingPlaceholder: 'Type or record a prompt…', + // toolbarPromptControlRecordingPlaceholder: 'Listening for prompt…', + // toolbarPromptControlLabel: 'Prompt input', + // toolbarPromptControlDeleteIconLabel: 'Clear', + // toolbarPromptControlRecordButtonDefaultLabel: 'Record', + // toolbarPromptControlRecordButtonActiveLabel: 'Stop recording', + // toolbarPromptControlSendActionLabel: 'Send', + // toolbarPromptControlSendActionAriaLabel: 'Send prompt', + // toolbarPromptControlErrorMessage: 'An error occurred while processing the request. Please try again with a different prompt.', + // Export selector toolbar button text toolbarExport: 'Exportálás', toolbarExportLabel: 'Exportálás', diff --git a/packages/x-data-grid/src/locales/isIS.ts b/packages/x-data-grid/src/locales/isIS.ts index 70f9c45d61199..83c81b2b2e8a9 100644 --- a/packages/x-data-grid/src/locales/isIS.ts +++ b/packages/x-data-grid/src/locales/isIS.ts @@ -31,6 +31,18 @@ const isISGrid: Partial = { toolbarQuickFilterLabel: 'Leita', toolbarQuickFilterDeleteIconLabel: 'Eyða', + // Prompt toolbar field + // toolbarPromptControlPlaceholder: 'Type a prompt…', + // toolbarPromptControlWithRecordingPlaceholder: 'Type or record a prompt…', + // toolbarPromptControlRecordingPlaceholder: 'Listening for prompt…', + // toolbarPromptControlLabel: 'Prompt input', + // toolbarPromptControlDeleteIconLabel: 'Clear', + // toolbarPromptControlRecordButtonDefaultLabel: 'Record', + // toolbarPromptControlRecordButtonActiveLabel: 'Stop recording', + // toolbarPromptControlSendActionLabel: 'Send', + // toolbarPromptControlSendActionAriaLabel: 'Send prompt', + // toolbarPromptControlErrorMessage: 'An error occurred while processing the request. Please try again with a different prompt.', + // Export selector toolbar button text toolbarExport: 'Flytja út', toolbarExportLabel: 'Flytja út', diff --git a/packages/x-data-grid/src/locales/itIT.ts b/packages/x-data-grid/src/locales/itIT.ts index 7291525a07b83..259bc49e693e5 100644 --- a/packages/x-data-grid/src/locales/itIT.ts +++ b/packages/x-data-grid/src/locales/itIT.ts @@ -31,6 +31,18 @@ const itITGrid: Partial = { toolbarQuickFilterLabel: 'Cerca', toolbarQuickFilterDeleteIconLabel: 'Resetta', + // Prompt toolbar field + // toolbarPromptControlPlaceholder: 'Type a prompt…', + // toolbarPromptControlWithRecordingPlaceholder: 'Type or record a prompt…', + // toolbarPromptControlRecordingPlaceholder: 'Listening for prompt…', + // toolbarPromptControlLabel: 'Prompt input', + // toolbarPromptControlDeleteIconLabel: 'Clear', + // toolbarPromptControlRecordButtonDefaultLabel: 'Record', + // toolbarPromptControlRecordButtonActiveLabel: 'Stop recording', + // toolbarPromptControlSendActionLabel: 'Send', + // toolbarPromptControlSendActionAriaLabel: 'Send prompt', + // toolbarPromptControlErrorMessage: 'An error occurred while processing the request. Please try again with a different prompt.', + // Export selector toolbar button text toolbarExport: 'Esporta', toolbarExportLabel: 'Esporta', diff --git a/packages/x-data-grid/src/locales/jaJP.ts b/packages/x-data-grid/src/locales/jaJP.ts index fd2f69883cf85..2a53da98b87fe 100644 --- a/packages/x-data-grid/src/locales/jaJP.ts +++ b/packages/x-data-grid/src/locales/jaJP.ts @@ -30,6 +30,18 @@ const jaJPGrid: Partial = { toolbarQuickFilterLabel: '検索', toolbarQuickFilterDeleteIconLabel: 'クリア', + // Prompt toolbar field + // toolbarPromptControlPlaceholder: 'Type a prompt…', + // toolbarPromptControlWithRecordingPlaceholder: 'Type or record a prompt…', + // toolbarPromptControlRecordingPlaceholder: 'Listening for prompt…', + // toolbarPromptControlLabel: 'Prompt input', + // toolbarPromptControlDeleteIconLabel: 'Clear', + // toolbarPromptControlRecordButtonDefaultLabel: 'Record', + // toolbarPromptControlRecordButtonActiveLabel: 'Stop recording', + // toolbarPromptControlSendActionLabel: 'Send', + // toolbarPromptControlSendActionAriaLabel: 'Send prompt', + // toolbarPromptControlErrorMessage: 'An error occurred while processing the request. Please try again with a different prompt.', + // Export selector toolbar button text toolbarExport: 'エクスポート', toolbarExportLabel: 'エクスポート', diff --git a/packages/x-data-grid/src/locales/koKR.ts b/packages/x-data-grid/src/locales/koKR.ts index bacd936d8fd3a..66a4d2d7014fc 100644 --- a/packages/x-data-grid/src/locales/koKR.ts +++ b/packages/x-data-grid/src/locales/koKR.ts @@ -30,6 +30,18 @@ const koKRGrid: Partial = { toolbarQuickFilterLabel: '검색', toolbarQuickFilterDeleteIconLabel: '초기화', + // Prompt toolbar field + // toolbarPromptControlPlaceholder: 'Type a prompt…', + // toolbarPromptControlWithRecordingPlaceholder: 'Type or record a prompt…', + // toolbarPromptControlRecordingPlaceholder: 'Listening for prompt…', + // toolbarPromptControlLabel: 'Prompt input', + // toolbarPromptControlDeleteIconLabel: 'Clear', + // toolbarPromptControlRecordButtonDefaultLabel: 'Record', + // toolbarPromptControlRecordButtonActiveLabel: 'Stop recording', + // toolbarPromptControlSendActionLabel: 'Send', + // toolbarPromptControlSendActionAriaLabel: 'Send prompt', + // toolbarPromptControlErrorMessage: 'An error occurred while processing the request. Please try again with a different prompt.', + // Export selector toolbar button text toolbarExport: '내보내기', toolbarExportLabel: '내보내기', diff --git a/packages/x-data-grid/src/locales/nbNO.ts b/packages/x-data-grid/src/locales/nbNO.ts index 70bd33fc7704f..87cc4d26f459c 100644 --- a/packages/x-data-grid/src/locales/nbNO.ts +++ b/packages/x-data-grid/src/locales/nbNO.ts @@ -31,6 +31,18 @@ const nbNOGrid: Partial = { toolbarQuickFilterLabel: 'Søk', toolbarQuickFilterDeleteIconLabel: 'Slett', + // Prompt toolbar field + // toolbarPromptControlPlaceholder: 'Type a prompt…', + // toolbarPromptControlWithRecordingPlaceholder: 'Type or record a prompt…', + // toolbarPromptControlRecordingPlaceholder: 'Listening for prompt…', + // toolbarPromptControlLabel: 'Prompt input', + // toolbarPromptControlDeleteIconLabel: 'Clear', + // toolbarPromptControlRecordButtonDefaultLabel: 'Record', + // toolbarPromptControlRecordButtonActiveLabel: 'Stop recording', + // toolbarPromptControlSendActionLabel: 'Send', + // toolbarPromptControlSendActionAriaLabel: 'Send prompt', + // toolbarPromptControlErrorMessage: 'An error occurred while processing the request. Please try again with a different prompt.', + // Export selector toolbar button text toolbarExport: 'Eksporter', toolbarExportLabel: 'Eksporter', diff --git a/packages/x-data-grid/src/locales/nlNL.ts b/packages/x-data-grid/src/locales/nlNL.ts index 4f247c94b2d85..981f449015951 100644 --- a/packages/x-data-grid/src/locales/nlNL.ts +++ b/packages/x-data-grid/src/locales/nlNL.ts @@ -31,6 +31,18 @@ const nlNLGrid: Partial = { toolbarQuickFilterLabel: 'Zoeken', toolbarQuickFilterDeleteIconLabel: 'Wissen', + // Prompt toolbar field + // toolbarPromptControlPlaceholder: 'Type a prompt…', + // toolbarPromptControlWithRecordingPlaceholder: 'Type or record a prompt…', + // toolbarPromptControlRecordingPlaceholder: 'Listening for prompt…', + // toolbarPromptControlLabel: 'Prompt input', + // toolbarPromptControlDeleteIconLabel: 'Clear', + // toolbarPromptControlRecordButtonDefaultLabel: 'Record', + // toolbarPromptControlRecordButtonActiveLabel: 'Stop recording', + // toolbarPromptControlSendActionLabel: 'Send', + // toolbarPromptControlSendActionAriaLabel: 'Send prompt', + // toolbarPromptControlErrorMessage: 'An error occurred while processing the request. Please try again with a different prompt.', + // Export selector toolbar button text toolbarExport: 'Exporteren', toolbarExportLabel: 'Exporteren', diff --git a/packages/x-data-grid/src/locales/nnNO.ts b/packages/x-data-grid/src/locales/nnNO.ts index e97a9692adb55..987e6b5617781 100644 --- a/packages/x-data-grid/src/locales/nnNO.ts +++ b/packages/x-data-grid/src/locales/nnNO.ts @@ -31,6 +31,18 @@ const nnNOGrid: Partial = { toolbarQuickFilterLabel: 'Søk', toolbarQuickFilterDeleteIconLabel: 'Slett', + // Prompt toolbar field + // toolbarPromptControlPlaceholder: 'Type a prompt…', + // toolbarPromptControlWithRecordingPlaceholder: 'Type or record a prompt…', + // toolbarPromptControlRecordingPlaceholder: 'Listening for prompt…', + // toolbarPromptControlLabel: 'Prompt input', + // toolbarPromptControlDeleteIconLabel: 'Clear', + // toolbarPromptControlRecordButtonDefaultLabel: 'Record', + // toolbarPromptControlRecordButtonActiveLabel: 'Stop recording', + // toolbarPromptControlSendActionLabel: 'Send', + // toolbarPromptControlSendActionAriaLabel: 'Send prompt', + // toolbarPromptControlErrorMessage: 'An error occurred while processing the request. Please try again with a different prompt.', + // Export selector toolbar button text toolbarExport: 'Eksporter', toolbarExportLabel: 'Eksporter', diff --git a/packages/x-data-grid/src/locales/plPL.ts b/packages/x-data-grid/src/locales/plPL.ts index 772e84dd64e5e..b9e6467e20179 100644 --- a/packages/x-data-grid/src/locales/plPL.ts +++ b/packages/x-data-grid/src/locales/plPL.ts @@ -30,6 +30,18 @@ const plPLGrid: Partial = { toolbarQuickFilterLabel: 'Szukaj', toolbarQuickFilterDeleteIconLabel: 'Wyczyść', + // Prompt toolbar field + // toolbarPromptControlPlaceholder: 'Type a prompt…', + // toolbarPromptControlWithRecordingPlaceholder: 'Type or record a prompt…', + // toolbarPromptControlRecordingPlaceholder: 'Listening for prompt…', + // toolbarPromptControlLabel: 'Prompt input', + // toolbarPromptControlDeleteIconLabel: 'Clear', + // toolbarPromptControlRecordButtonDefaultLabel: 'Record', + // toolbarPromptControlRecordButtonActiveLabel: 'Stop recording', + // toolbarPromptControlSendActionLabel: 'Send', + // toolbarPromptControlSendActionAriaLabel: 'Send prompt', + // toolbarPromptControlErrorMessage: 'An error occurred while processing the request. Please try again with a different prompt.', + // Export selector toolbar button text toolbarExport: 'Eksportuj', toolbarExportLabel: 'Eksportuj', diff --git a/packages/x-data-grid/src/locales/ptBR.ts b/packages/x-data-grid/src/locales/ptBR.ts index a921b980bd904..df742838bff80 100644 --- a/packages/x-data-grid/src/locales/ptBR.ts +++ b/packages/x-data-grid/src/locales/ptBR.ts @@ -31,6 +31,18 @@ const ptBRGrid: Partial = { toolbarQuickFilterLabel: 'Procurar', toolbarQuickFilterDeleteIconLabel: 'Limpar', + // Prompt toolbar field + // toolbarPromptControlPlaceholder: 'Type a prompt…', + // toolbarPromptControlWithRecordingPlaceholder: 'Type or record a prompt…', + // toolbarPromptControlRecordingPlaceholder: 'Listening for prompt…', + // toolbarPromptControlLabel: 'Prompt input', + // toolbarPromptControlDeleteIconLabel: 'Clear', + // toolbarPromptControlRecordButtonDefaultLabel: 'Record', + // toolbarPromptControlRecordButtonActiveLabel: 'Stop recording', + // toolbarPromptControlSendActionLabel: 'Send', + // toolbarPromptControlSendActionAriaLabel: 'Send prompt', + // toolbarPromptControlErrorMessage: 'An error occurred while processing the request. Please try again with a different prompt.', + // Export selector toolbar button text toolbarExport: 'Exportar', toolbarExportLabel: 'Exportar', diff --git a/packages/x-data-grid/src/locales/ptPT.ts b/packages/x-data-grid/src/locales/ptPT.ts index 88fa81bdc1c0a..ee6f9ae387f3f 100644 --- a/packages/x-data-grid/src/locales/ptPT.ts +++ b/packages/x-data-grid/src/locales/ptPT.ts @@ -31,6 +31,18 @@ const ptPTGrid: Partial = { toolbarQuickFilterLabel: 'Procurar', toolbarQuickFilterDeleteIconLabel: 'Claro', + // Prompt toolbar field + // toolbarPromptControlPlaceholder: 'Type a prompt…', + // toolbarPromptControlWithRecordingPlaceholder: 'Type or record a prompt…', + // toolbarPromptControlRecordingPlaceholder: 'Listening for prompt…', + // toolbarPromptControlLabel: 'Prompt input', + // toolbarPromptControlDeleteIconLabel: 'Clear', + // toolbarPromptControlRecordButtonDefaultLabel: 'Record', + // toolbarPromptControlRecordButtonActiveLabel: 'Stop recording', + // toolbarPromptControlSendActionLabel: 'Send', + // toolbarPromptControlSendActionAriaLabel: 'Send prompt', + // toolbarPromptControlErrorMessage: 'An error occurred while processing the request. Please try again with a different prompt.', + // Export selector toolbar button text toolbarExport: 'Exportar', toolbarExportLabel: 'Exportar', diff --git a/packages/x-data-grid/src/locales/roRO.ts b/packages/x-data-grid/src/locales/roRO.ts index cc49a4f52e6d5..96201ac0c8f86 100644 --- a/packages/x-data-grid/src/locales/roRO.ts +++ b/packages/x-data-grid/src/locales/roRO.ts @@ -31,6 +31,18 @@ const roROGrid: Partial = { toolbarQuickFilterLabel: 'Căutare', toolbarQuickFilterDeleteIconLabel: 'Ștergere', + // Prompt toolbar field + // toolbarPromptControlPlaceholder: 'Type a prompt…', + // toolbarPromptControlWithRecordingPlaceholder: 'Type or record a prompt…', + // toolbarPromptControlRecordingPlaceholder: 'Listening for prompt…', + // toolbarPromptControlLabel: 'Prompt input', + // toolbarPromptControlDeleteIconLabel: 'Clear', + // toolbarPromptControlRecordButtonDefaultLabel: 'Record', + // toolbarPromptControlRecordButtonActiveLabel: 'Stop recording', + // toolbarPromptControlSendActionLabel: 'Send', + // toolbarPromptControlSendActionAriaLabel: 'Send prompt', + // toolbarPromptControlErrorMessage: 'An error occurred while processing the request. Please try again with a different prompt.', + // Export selector toolbar button text toolbarExport: 'Export', toolbarExportLabel: 'Export', diff --git a/packages/x-data-grid/src/locales/ruRU.ts b/packages/x-data-grid/src/locales/ruRU.ts index 61a1613e8ecdf..26e2df5b2b3b5 100644 --- a/packages/x-data-grid/src/locales/ruRU.ts +++ b/packages/x-data-grid/src/locales/ruRU.ts @@ -55,6 +55,18 @@ const ruRUGrid: Partial = { toolbarQuickFilterLabel: 'Поиск', toolbarQuickFilterDeleteIconLabel: 'Очистить', + // Prompt toolbar field + // toolbarPromptControlPlaceholder: 'Type a prompt…', + // toolbarPromptControlWithRecordingPlaceholder: 'Type or record a prompt…', + // toolbarPromptControlRecordingPlaceholder: 'Listening for prompt…', + // toolbarPromptControlLabel: 'Prompt input', + // toolbarPromptControlDeleteIconLabel: 'Clear', + // toolbarPromptControlRecordButtonDefaultLabel: 'Record', + // toolbarPromptControlRecordButtonActiveLabel: 'Stop recording', + // toolbarPromptControlSendActionLabel: 'Send', + // toolbarPromptControlSendActionAriaLabel: 'Send prompt', + // toolbarPromptControlErrorMessage: 'An error occurred while processing the request. Please try again with a different prompt.', + // Export selector toolbar button text toolbarExport: 'Экспорт', toolbarExportLabel: 'Экспорт', diff --git a/packages/x-data-grid/src/locales/skSK.ts b/packages/x-data-grid/src/locales/skSK.ts index bca93172c2214..adac6a559a22b 100644 --- a/packages/x-data-grid/src/locales/skSK.ts +++ b/packages/x-data-grid/src/locales/skSK.ts @@ -38,6 +38,18 @@ const skSKGrid: Partial = { toolbarQuickFilterLabel: 'Vyhľadať', toolbarQuickFilterDeleteIconLabel: 'Vymazať', + // Prompt toolbar field + // toolbarPromptControlPlaceholder: 'Type a prompt…', + // toolbarPromptControlWithRecordingPlaceholder: 'Type or record a prompt…', + // toolbarPromptControlRecordingPlaceholder: 'Listening for prompt…', + // toolbarPromptControlLabel: 'Prompt input', + // toolbarPromptControlDeleteIconLabel: 'Clear', + // toolbarPromptControlRecordButtonDefaultLabel: 'Record', + // toolbarPromptControlRecordButtonActiveLabel: 'Stop recording', + // toolbarPromptControlSendActionLabel: 'Send', + // toolbarPromptControlSendActionAriaLabel: 'Send prompt', + // toolbarPromptControlErrorMessage: 'An error occurred while processing the request. Please try again with a different prompt.', + // Export selector toolbar button text toolbarExport: 'Export', toolbarExportLabel: 'Export', diff --git a/packages/x-data-grid/src/locales/svSE.ts b/packages/x-data-grid/src/locales/svSE.ts index 46c5a6f089c58..3cb7837c85155 100644 --- a/packages/x-data-grid/src/locales/svSE.ts +++ b/packages/x-data-grid/src/locales/svSE.ts @@ -31,6 +31,18 @@ const svSEGrid: Partial = { toolbarQuickFilterLabel: 'Sök', toolbarQuickFilterDeleteIconLabel: 'Rensa', + // Prompt toolbar field + // toolbarPromptControlPlaceholder: 'Type a prompt…', + // toolbarPromptControlWithRecordingPlaceholder: 'Type or record a prompt…', + // toolbarPromptControlRecordingPlaceholder: 'Listening for prompt…', + // toolbarPromptControlLabel: 'Prompt input', + // toolbarPromptControlDeleteIconLabel: 'Clear', + // toolbarPromptControlRecordButtonDefaultLabel: 'Record', + // toolbarPromptControlRecordButtonActiveLabel: 'Stop recording', + // toolbarPromptControlSendActionLabel: 'Send', + // toolbarPromptControlSendActionAriaLabel: 'Send prompt', + // toolbarPromptControlErrorMessage: 'An error occurred while processing the request. Please try again with a different prompt.', + // Export selector toolbar button text toolbarExport: 'Exportera', toolbarExportLabel: 'Exportera', diff --git a/packages/x-data-grid/src/locales/trTR.ts b/packages/x-data-grid/src/locales/trTR.ts index 07dd3ee608eca..cd7477d8f6d64 100644 --- a/packages/x-data-grid/src/locales/trTR.ts +++ b/packages/x-data-grid/src/locales/trTR.ts @@ -30,6 +30,18 @@ const trTRGrid: Partial = { toolbarQuickFilterLabel: 'Ara', toolbarQuickFilterDeleteIconLabel: 'Temizle', + // Prompt toolbar field + // toolbarPromptControlPlaceholder: 'Type a prompt…', + // toolbarPromptControlWithRecordingPlaceholder: 'Type or record a prompt…', + // toolbarPromptControlRecordingPlaceholder: 'Listening for prompt…', + // toolbarPromptControlLabel: 'Prompt input', + // toolbarPromptControlDeleteIconLabel: 'Clear', + // toolbarPromptControlRecordButtonDefaultLabel: 'Record', + // toolbarPromptControlRecordButtonActiveLabel: 'Stop recording', + // toolbarPromptControlSendActionLabel: 'Send', + // toolbarPromptControlSendActionAriaLabel: 'Send prompt', + // toolbarPromptControlErrorMessage: 'An error occurred while processing the request. Please try again with a different prompt.', + // Export selector toolbar button text toolbarExport: 'Dışa aktar', toolbarExportLabel: 'Dışa aktar', diff --git a/packages/x-data-grid/src/locales/ukUA.ts b/packages/x-data-grid/src/locales/ukUA.ts index f04fa67e9b5d7..fe8e5ea7d42ba 100644 --- a/packages/x-data-grid/src/locales/ukUA.ts +++ b/packages/x-data-grid/src/locales/ukUA.ts @@ -55,6 +55,18 @@ const ukUAGrid: Partial = { toolbarQuickFilterLabel: 'Пошук', toolbarQuickFilterDeleteIconLabel: 'Очистити', + // Prompt toolbar field + // toolbarPromptControlPlaceholder: 'Type a prompt…', + // toolbarPromptControlWithRecordingPlaceholder: 'Type or record a prompt…', + // toolbarPromptControlRecordingPlaceholder: 'Listening for prompt…', + // toolbarPromptControlLabel: 'Prompt input', + // toolbarPromptControlDeleteIconLabel: 'Clear', + // toolbarPromptControlRecordButtonDefaultLabel: 'Record', + // toolbarPromptControlRecordButtonActiveLabel: 'Stop recording', + // toolbarPromptControlSendActionLabel: 'Send', + // toolbarPromptControlSendActionAriaLabel: 'Send prompt', + // toolbarPromptControlErrorMessage: 'An error occurred while processing the request. Please try again with a different prompt.', + // Export selector toolbar button text toolbarExport: 'Експорт', toolbarExportLabel: 'Експорт', diff --git a/packages/x-data-grid/src/locales/urPK.ts b/packages/x-data-grid/src/locales/urPK.ts index 2ea1572123cac..64a982e1644c5 100644 --- a/packages/x-data-grid/src/locales/urPK.ts +++ b/packages/x-data-grid/src/locales/urPK.ts @@ -31,6 +31,18 @@ const urPKGrid: Partial = { toolbarQuickFilterLabel: 'تلاش کریں', toolbarQuickFilterDeleteIconLabel: 'کلئیر کریں', + // Prompt toolbar field + // toolbarPromptControlPlaceholder: 'Type a prompt…', + // toolbarPromptControlWithRecordingPlaceholder: 'Type or record a prompt…', + // toolbarPromptControlRecordingPlaceholder: 'Listening for prompt…', + // toolbarPromptControlLabel: 'Prompt input', + // toolbarPromptControlDeleteIconLabel: 'Clear', + // toolbarPromptControlRecordButtonDefaultLabel: 'Record', + // toolbarPromptControlRecordButtonActiveLabel: 'Stop recording', + // toolbarPromptControlSendActionLabel: 'Send', + // toolbarPromptControlSendActionAriaLabel: 'Send prompt', + // toolbarPromptControlErrorMessage: 'An error occurred while processing the request. Please try again with a different prompt.', + // Export selector toolbar button text toolbarExport: 'ایکسپورٹ', toolbarExportLabel: 'ایکسپورٹ', diff --git a/packages/x-data-grid/src/locales/viVN.ts b/packages/x-data-grid/src/locales/viVN.ts index 354f9db689d34..17e744e5c2218 100644 --- a/packages/x-data-grid/src/locales/viVN.ts +++ b/packages/x-data-grid/src/locales/viVN.ts @@ -31,6 +31,18 @@ const viVNGrid: Partial = { toolbarQuickFilterLabel: 'Tìm kiếm', toolbarQuickFilterDeleteIconLabel: 'Xóa tìm kiếm', + // Prompt toolbar field + // toolbarPromptControlPlaceholder: 'Type a prompt…', + // toolbarPromptControlWithRecordingPlaceholder: 'Type or record a prompt…', + // toolbarPromptControlRecordingPlaceholder: 'Listening for prompt…', + // toolbarPromptControlLabel: 'Prompt input', + // toolbarPromptControlDeleteIconLabel: 'Clear', + // toolbarPromptControlRecordButtonDefaultLabel: 'Record', + // toolbarPromptControlRecordButtonActiveLabel: 'Stop recording', + // toolbarPromptControlSendActionLabel: 'Send', + // toolbarPromptControlSendActionAriaLabel: 'Send prompt', + // toolbarPromptControlErrorMessage: 'An error occurred while processing the request. Please try again with a different prompt.', + // Export selector toolbar button text toolbarExport: 'Xuất', toolbarExportLabel: 'Xuất', diff --git a/packages/x-data-grid/src/locales/zhCN.ts b/packages/x-data-grid/src/locales/zhCN.ts index 74574df253b86..d5d23dc46a538 100644 --- a/packages/x-data-grid/src/locales/zhCN.ts +++ b/packages/x-data-grid/src/locales/zhCN.ts @@ -30,6 +30,18 @@ const zhCNGrid: Partial = { toolbarQuickFilterLabel: '搜索', toolbarQuickFilterDeleteIconLabel: '清除', + // Prompt toolbar field + // toolbarPromptControlPlaceholder: 'Type a prompt…', + // toolbarPromptControlWithRecordingPlaceholder: 'Type or record a prompt…', + // toolbarPromptControlRecordingPlaceholder: 'Listening for prompt…', + // toolbarPromptControlLabel: 'Prompt input', + // toolbarPromptControlDeleteIconLabel: 'Clear', + // toolbarPromptControlRecordButtonDefaultLabel: 'Record', + // toolbarPromptControlRecordButtonActiveLabel: 'Stop recording', + // toolbarPromptControlSendActionLabel: 'Send', + // toolbarPromptControlSendActionAriaLabel: 'Send prompt', + // toolbarPromptControlErrorMessage: 'An error occurred while processing the request. Please try again with a different prompt.', + // Export selector toolbar button text toolbarExport: '导出', toolbarExportLabel: '导出', diff --git a/packages/x-data-grid/src/locales/zhHK.ts b/packages/x-data-grid/src/locales/zhHK.ts index 0e73634398a02..8b26659f82eec 100644 --- a/packages/x-data-grid/src/locales/zhHK.ts +++ b/packages/x-data-grid/src/locales/zhHK.ts @@ -31,6 +31,18 @@ const zhHKGrid: Partial = { toolbarQuickFilterLabel: '搜尋', toolbarQuickFilterDeleteIconLabel: '清除', + // Prompt toolbar field + // toolbarPromptControlPlaceholder: 'Type a prompt…', + // toolbarPromptControlWithRecordingPlaceholder: 'Type or record a prompt…', + // toolbarPromptControlRecordingPlaceholder: 'Listening for prompt…', + // toolbarPromptControlLabel: 'Prompt input', + // toolbarPromptControlDeleteIconLabel: 'Clear', + // toolbarPromptControlRecordButtonDefaultLabel: 'Record', + // toolbarPromptControlRecordButtonActiveLabel: 'Stop recording', + // toolbarPromptControlSendActionLabel: 'Send', + // toolbarPromptControlSendActionAriaLabel: 'Send prompt', + // toolbarPromptControlErrorMessage: 'An error occurred while processing the request. Please try again with a different prompt.', + // Export selector toolbar button text toolbarExport: '出口', toolbarExportLabel: '出口', diff --git a/packages/x-data-grid/src/locales/zhTW.ts b/packages/x-data-grid/src/locales/zhTW.ts index 0052bc7009641..c0378c558eb47 100644 --- a/packages/x-data-grid/src/locales/zhTW.ts +++ b/packages/x-data-grid/src/locales/zhTW.ts @@ -30,6 +30,18 @@ const zhTWGrid: Partial = { toolbarQuickFilterLabel: '搜尋', toolbarQuickFilterDeleteIconLabel: '清除', + // Prompt toolbar field + // toolbarPromptControlPlaceholder: 'Type a prompt…', + // toolbarPromptControlWithRecordingPlaceholder: 'Type or record a prompt…', + // toolbarPromptControlRecordingPlaceholder: 'Listening for prompt…', + // toolbarPromptControlLabel: 'Prompt input', + // toolbarPromptControlDeleteIconLabel: 'Clear', + // toolbarPromptControlRecordButtonDefaultLabel: 'Record', + // toolbarPromptControlRecordButtonActiveLabel: 'Stop recording', + // toolbarPromptControlSendActionLabel: 'Send', + // toolbarPromptControlSendActionAriaLabel: 'Send prompt', + // toolbarPromptControlErrorMessage: 'An error occurred while processing the request. Please try again with a different prompt.', + // Export selector toolbar button text toolbarExport: '匯出', toolbarExportLabel: '匯出', diff --git a/packages/x-data-grid/src/models/api/gridLocaleTextApi.ts b/packages/x-data-grid/src/models/api/gridLocaleTextApi.ts index 9573191b47561..8d68bb07669e7 100644 --- a/packages/x-data-grid/src/models/api/gridLocaleTextApi.ts +++ b/packages/x-data-grid/src/models/api/gridLocaleTextApi.ts @@ -41,6 +41,18 @@ export interface GridLocaleText { toolbarQuickFilterLabel: string; toolbarQuickFilterDeleteIconLabel: string; + // Prompt control toolbar field + toolbarPromptControlPlaceholder: string; + toolbarPromptControlWithRecordingPlaceholder: string; + toolbarPromptControlRecordingPlaceholder: string; + toolbarPromptControlLabel: string; + toolbarPromptControlDeleteIconLabel: string; + toolbarPromptControlRecordButtonDefaultLabel: string; + toolbarPromptControlRecordButtonActiveLabel: string; + toolbarPromptControlSendActionLabel: string; + toolbarPromptControlSendActionAriaLabel: string; + toolbarPromptControlErrorMessage: string; + // Export selector toolbar button text toolbarExport: React.ReactNode; toolbarExportLabel: string; diff --git a/packages/x-data-grid/src/models/colDef/gridColDef.ts b/packages/x-data-grid/src/models/colDef/gridColDef.ts index c7166347c4726..16630570eb28e 100644 --- a/packages/x-data-grid/src/models/colDef/gridColDef.ts +++ b/packages/x-data-grid/src/models/colDef/gridColDef.ts @@ -293,6 +293,10 @@ export interface GridBaseColDef; + /** + * Example values that can be used by the grid to get more context about the column. + */ + unstable_examples?: V[]; } /** diff --git a/scripts/x-data-grid-generator.exports.json b/scripts/x-data-grid-generator.exports.json index 06a34db6fa23f..de4ad2a23fbd0 100644 --- a/scripts/x-data-grid-generator.exports.json +++ b/scripts/x-data-grid-generator.exports.json @@ -20,6 +20,7 @@ { "name": "GridDataGeneratorContext", "kind": "Interface" }, { "name": "GridDemoData", "kind": "Interface" }, { "name": "loadServerRows", "kind": "Variable" }, + { "name": "mockPromptResolver", "kind": "Variable" }, { "name": "Movie", "kind": "TypeAlias" }, { "name": "QueryOptions", "kind": "Interface" }, { "name": "random", "kind": "Variable" }, diff --git a/scripts/x-data-grid-premium.exports.json b/scripts/x-data-grid-premium.exports.json index d532bf45e0c75..8328f45b09f11 100644 --- a/scripts/x-data-grid-premium.exports.json +++ b/scripts/x-data-grid-premium.exports.json @@ -480,6 +480,7 @@ { "name": "GridPushPinLeftIcon", "kind": "Variable" }, { "name": "GridPushPinRightIcon", "kind": "Variable" }, { "name": "gridQuickFilterValuesSelector", "kind": "Variable" }, + { "name": "GridRecordPromptIcon", "kind": "Variable" }, { "name": "GridRemoveIcon", "kind": "Variable" }, { "name": "GridRenderCellParams", "kind": "Interface" }, { "name": "GridRenderColumnsProps", "kind": "Interface" }, @@ -561,6 +562,7 @@ { "name": "GridScrollParams", "kind": "Interface" }, { "name": "GridSearchIcon", "kind": "Variable" }, { "name": "GridSelectedRowCount", "kind": "Variable" }, + { "name": "GridSendPromptIcon", "kind": "Variable" }, { "name": "GridSeparatorIcon", "kind": "Variable" }, { "name": "GridSignature", "kind": "Enum" }, { "name": "GridSingleSelectColDef", "kind": "Interface" }, @@ -667,6 +669,9 @@ { "name": "setupExcelExportWebWorker", "kind": "Function" }, { "name": "SkeletonCellPropsOverrides", "kind": "Interface" }, { "name": "ToolbarPropsOverrides", "kind": "Interface" }, + { "name": "unstable_gridDefaultPromptResolver", "kind": "Function" }, + { "name": "Unstable_GridToolbarPromptControl", "kind": "Function" }, + { "name": "unstable_PromptResponse", "kind": "TypeAlias" }, { "name": "unstable_resetCleanupTracking", "kind": "Variable" }, { "name": "useFirstRender", "kind": "Variable" }, { "name": "useGridApiContext", "kind": "Variable" },