diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 942c4e9584b74..000d98c93ec67 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -19,7 +19,7 @@ jobs: uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@ea9e4e37992a54ee68a9622e985e60c8e8f12d9f # v3.27.4 + uses: github/codeql-action/init@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3.27.5 with: languages: typescript # If you wish to specify custom queries, you can do so here or in a config file. @@ -29,4 +29,4 @@ jobs: # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs # queries: security-extended,security-and-quality - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@ea9e4e37992a54ee68a9622e985e60c8e8f12d9f # v3.27.4 + uses: github/codeql-action/analyze@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3.27.5 diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml index 900a104519fb8..252d4ba7cce10 100644 --- a/.github/workflows/scorecards.yml +++ b/.github/workflows/scorecards.yml @@ -44,6 +44,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: Upload to code-scanning - uses: github/codeql-action/upload-sarif@ea9e4e37992a54ee68a9622e985e60c8e8f12d9f # v3.27.4 + uses: github/codeql-action/upload-sarif@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3.27.5 with: sarif_file: results.sarif diff --git a/docs/data/charts/tooltip/ItemTooltipTopElement.js b/docs/data/charts/tooltip/ItemTooltipTopElement.js index 2625c997155f1..a601caee56d57 100644 --- a/docs/data/charts/tooltip/ItemTooltipTopElement.js +++ b/docs/data/charts/tooltip/ItemTooltipTopElement.js @@ -72,7 +72,8 @@ export function ItemTooltipTopElement({ children }) { if ( tooltipData.identifier.type !== 'bar' || tooltipData.identifier.dataIndex === undefined || - tooltipData.value === null + tooltipData.value === null || + svgRef.current === null ) { // This demo is only about bar charts return null; diff --git a/docs/data/charts/tooltip/ItemTooltipTopElement.tsx b/docs/data/charts/tooltip/ItemTooltipTopElement.tsx index d3f359951d83d..a36f5048d00f5 100644 --- a/docs/data/charts/tooltip/ItemTooltipTopElement.tsx +++ b/docs/data/charts/tooltip/ItemTooltipTopElement.tsx @@ -78,7 +78,8 @@ export function ItemTooltipTopElement({ children }: React.PropsWithChildren) { if ( tooltipData.identifier.type !== 'bar' || tooltipData.identifier.dataIndex === undefined || - tooltipData.value === null + tooltipData.value === null || + svgRef.current === null ) { // This demo is only about bar charts return null; diff --git a/docs/data/data-grid/localization/data.json b/docs/data/data-grid/localization/data.json index 8ce145a0b640f..f36d84f29e31a 100644 --- a/docs/data/data-grid/localization/data.json +++ b/docs/data/data-grid/localization/data.json @@ -3,192 +3,192 @@ "languageTag": "ar-SD", "importName": "arSD", "localeName": "Arabic (Sudan)", - "missingKeysCount": 19, - "totalKeysCount": 133, + "missingKeysCount": 18, + "totalKeysCount": 132, "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": 45, - "totalKeysCount": 133, + "missingKeysCount": 44, + "totalKeysCount": 132, "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": 11, - "totalKeysCount": 133, + "missingKeysCount": 10, + "totalKeysCount": 132, "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": 19, - "totalKeysCount": 133, + "missingKeysCount": 18, + "totalKeysCount": 132, "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": 11, - "totalKeysCount": 133, + "missingKeysCount": 0, + "totalKeysCount": 132, "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": 19, - "totalKeysCount": 133, + "missingKeysCount": 18, + "totalKeysCount": 132, "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": 11, - "totalKeysCount": 133, + "missingKeysCount": 10, + "totalKeysCount": 132, "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": 15, - "totalKeysCount": 133, + "missingKeysCount": 14, + "totalKeysCount": 132, "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": 11, - "totalKeysCount": 133, + "missingKeysCount": 10, + "totalKeysCount": 132, "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": 15, - "totalKeysCount": 133, + "missingKeysCount": 14, + "totalKeysCount": 132, "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": 15, - "totalKeysCount": 133, + "missingKeysCount": 14, + "totalKeysCount": 132, "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": 11, - "totalKeysCount": 133, + "missingKeysCount": 10, + "totalKeysCount": 132, "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": 11, - "totalKeysCount": 133, + "missingKeysCount": 10, + "totalKeysCount": 132, "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": 19, - "totalKeysCount": 133, + "missingKeysCount": 18, + "totalKeysCount": 132, "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": 15, - "totalKeysCount": 133, + "missingKeysCount": 14, + "totalKeysCount": 132, "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": 17, - "totalKeysCount": 133, + "missingKeysCount": 16, + "totalKeysCount": 132, "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": 19, - "totalKeysCount": 133, + "missingKeysCount": 18, + "totalKeysCount": 132, "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": 11, - "totalKeysCount": 133, + "missingKeysCount": 10, + "totalKeysCount": 132, "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": 11, - "totalKeysCount": 133, + "missingKeysCount": 10, + "totalKeysCount": 132, "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": 46, - "totalKeysCount": 133, + "missingKeysCount": 45, + "totalKeysCount": 132, "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": 15, - "totalKeysCount": 133, + "missingKeysCount": 14, + "totalKeysCount": 132, "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": 15, - "totalKeysCount": 133, + "missingKeysCount": 14, + "totalKeysCount": 132, "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": 15, - "totalKeysCount": 133, + "missingKeysCount": 14, + "totalKeysCount": 132, "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": 22, - "totalKeysCount": 133, + "missingKeysCount": 21, + "totalKeysCount": 132, "githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/locales/plPL.ts" }, { @@ -196,7 +196,7 @@ "importName": "ptPT", "localeName": "Portuguese", "missingKeysCount": 0, - "totalKeysCount": 133, + "totalKeysCount": 132, "githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/locales/ptPT.ts" }, { @@ -204,31 +204,31 @@ "importName": "ptBR", "localeName": "Portuguese (Brazil)", "missingKeysCount": 0, - "totalKeysCount": 133, + "totalKeysCount": 132, "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": 19, - "totalKeysCount": 133, + "missingKeysCount": 18, + "totalKeysCount": 132, "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": 15, - "totalKeysCount": 133, + "missingKeysCount": 14, + "totalKeysCount": 132, "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": 16, - "totalKeysCount": 133, + "missingKeysCount": 15, + "totalKeysCount": 132, "githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/locales/skSK.ts" }, { @@ -236,47 +236,47 @@ "importName": "esES", "localeName": "Spanish", "missingKeysCount": 0, - "totalKeysCount": 133, + "totalKeysCount": 132, "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": 11, - "totalKeysCount": 133, + "missingKeysCount": 10, + "totalKeysCount": 132, "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": 13, - "totalKeysCount": 133, + "missingKeysCount": 12, + "totalKeysCount": 132, "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": 19, - "totalKeysCount": 133, + "missingKeysCount": 18, + "totalKeysCount": 132, "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": 19, - "totalKeysCount": 133, + "missingKeysCount": 18, + "totalKeysCount": 132, "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": 11, - "totalKeysCount": 133, + "missingKeysCount": 10, + "totalKeysCount": 132, "githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/locales/viVN.ts" } ] diff --git a/docs/data/date-pickers/custom-components/custom-components.md b/docs/data/date-pickers/custom-components/custom-components.md index e05e9c6e808ab..ab573ddf7a56f 100644 --- a/docs/data/date-pickers/custom-components/custom-components.md +++ b/docs/data/date-pickers/custom-components/custom-components.md @@ -34,8 +34,8 @@ You can override the actions displayed by passing the `actions` prop to the `act actions: ['clear'], }, // The actions will be different between desktop and mobile - actionBar: ({ wrapperVariant }) => ({ - actions: wrapperVariant === 'desktop' ? [] : ['clear'], + actionBar: ({ variant }) => ({ + actions: variant === 'desktop' ? [] : ['clear'], }), }} /> diff --git a/docs/data/date-pickers/custom-layout/AddComponent.js b/docs/data/date-pickers/custom-layout/AddComponent.js index d6e0d1db8b6fe..0e904ef3d2889 100644 --- a/docs/data/date-pickers/custom-layout/AddComponent.js +++ b/docs/data/date-pickers/custom-layout/AddComponent.js @@ -58,11 +58,11 @@ function RestaurantHeader() { } function CustomLayout(props) { - const { toolbar, tabs, content, actionBar } = usePickerLayout(props); + const { toolbar, tabs, content, actionBar, ownerState } = usePickerLayout(props); return ( {toolbar} {actionBar} - + {tabs} {content} diff --git a/docs/data/date-pickers/custom-layout/AddComponent.tsx b/docs/data/date-pickers/custom-layout/AddComponent.tsx index 2584a13756edf..9fc41c2b0666b 100644 --- a/docs/data/date-pickers/custom-layout/AddComponent.tsx +++ b/docs/data/date-pickers/custom-layout/AddComponent.tsx @@ -59,11 +59,11 @@ function RestaurantHeader() { } function CustomLayout(props: PickersLayoutProps) { - const { toolbar, tabs, content, actionBar } = usePickerLayout(props); + const { toolbar, tabs, content, actionBar, ownerState } = usePickerLayout(props); return ( ) { {toolbar} {actionBar} - + {tabs} {content} diff --git a/docs/data/date-pickers/custom-layout/custom-layout.md b/docs/data/date-pickers/custom-layout/custom-layout.md index ca327aaa57b69..0125630db5b10 100644 --- a/docs/data/date-pickers/custom-layout/custom-layout.md +++ b/docs/data/date-pickers/custom-layout/custom-layout.md @@ -86,14 +86,17 @@ import { } from '@mui/x-date-pickers/PickersLayout'; function MyCustomLayout(props) { - const { toolbar, tabs, content, actionBar } = usePickerLayout(props); + const { toolbar, tabs, content, actionBar, ownerState } = usePickerLayout(props); // Put the action bar before the content return ( - + {toolbar} {actionBar} - + {tabs} {content} diff --git a/docs/data/migration/migration-charts-v7/migration-charts-v7.md b/docs/data/migration/migration-charts-v7/migration-charts-v7.md index 5fe6c6f9c75e0..a9dda433ea29c 100644 --- a/docs/data/migration/migration-charts-v7/migration-charts-v7.md +++ b/docs/data/migration/migration-charts-v7/migration-charts-v7.md @@ -38,10 +38,10 @@ You can either run it on a specific file, folder, or your entire codebase when c ```bash -// Charts specific +# Charts-specific npx @mui/x-codemod@latest v8.0.0/charts/preset-safe -// Target the other packages as well +# Target the other packages as well npx @mui/x-codemod@latest v8.0.0/preset-safe ``` diff --git a/docs/data/migration/migration-data-grid-v5/migration-data-grid-v5.md b/docs/data/migration/migration-data-grid-v5/migration-data-grid-v5.md index 2ed5e027a87fd..4c96cc025e119 100644 --- a/docs/data/migration/migration-data-grid-v5/migration-data-grid-v5.md +++ b/docs/data/migration/migration-data-grid-v5/migration-data-grid-v5.md @@ -30,9 +30,10 @@ The `preset-safe` codemod will automatically adjust the bulk of your code to acc You can either run it on a specific file, folder, or your entire codebase when choosing the `` argument. ```bash -// Data Grid specific +# Data Grid specific npx @mui/x-codemod@latest v6.0.0/data-grid/preset-safe -// Target Date and Time Pickers as well + +# Target Date and Time Pickers as well npx @mui/x-codemod@latest v6.0.0/preset-safe ``` diff --git a/docs/data/migration/migration-data-grid-v6/migration-data-grid-v6.md b/docs/data/migration/migration-data-grid-v6/migration-data-grid-v6.md index fd145877d6b2d..da8288a8a8c3b 100644 --- a/docs/data/migration/migration-data-grid-v6/migration-data-grid-v6.md +++ b/docs/data/migration/migration-data-grid-v6/migration-data-grid-v6.md @@ -62,10 +62,10 @@ You can either run it on a specific file, folder, or your entire codebase when c ```bash -// Data Grid specific +# Data Grid specific npx @mui/x-codemod@latest v7.0.0/data-grid/preset-safe -// Target other MUI X components as well +# Target other MUI X components as well npx @mui/x-codemod@latest v7.0.0/preset-safe ``` diff --git a/docs/data/migration/migration-pickers-v5/MobileKeyboardView.js b/docs/data/migration/migration-pickers-v5/MobileKeyboardView.js index 95819b45ed99f..c2810ae4c1e2f 100644 --- a/docs/data/migration/migration-pickers-v5/MobileKeyboardView.js +++ b/docs/data/migration/migration-pickers-v5/MobileKeyboardView.js @@ -1,100 +1,16 @@ import * as React from 'react'; -import Box from '@mui/material/Box'; -import Stack from '@mui/material/Stack'; -import IconButton from '@mui/material/IconButton'; -import ModeEditIcon from '@mui/icons-material/ModeEdit'; -import CalendarMonthIcon from '@mui/icons-material/CalendarMonth'; -import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'; -import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'; - -import { - pickersLayoutClasses, - PickersLayoutContentWrapper, - PickersLayoutRoot, - usePickerLayout, -} from '@mui/x-date-pickers/PickersLayout'; -import { MobileDatePicker } from '@mui/x-date-pickers/MobileDatePicker'; -import { DateField } from '@mui/x-date-pickers/DateField'; -import { DatePickerToolbar } from '@mui/x-date-pickers/DatePicker'; - -function LayoutWithKeyboardView(props) { - const { value, onChange } = props; - const [showKeyboardView, setShowKeyboardView] = React.useState(false); - - const { toolbar, tabs, content, actionBar } = usePickerLayout({ - ...props, - slotProps: { - ...props.slotProps, - toolbar: { - ...props.slotProps?.toolbar, - // @ts-ignore - showKeyboardViewSwitch: props.wrapperVariant === 'mobile', - showKeyboardView, - setShowKeyboardView, - }, - }, - }); - - return ( - - {toolbar} - {actionBar} - - {tabs} - {showKeyboardView ? ( - - - - ) : ( - content - )} - - - ); -} - -function ToolbarWithKeyboardViewSwitch(props) { - const { showKeyboardViewSwitch, showKeyboardView, setShowKeyboardView, ...other } = - props; - - if (showKeyboardViewSwitch) { - return ( - - - setShowKeyboardView((prev) => !prev)} - > - {showKeyboardView ? : } - - - ); - } - - return ; -} export default function MobileKeyboardView() { return ( - - - +