Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pickers] Add satisfies casting to slotProps #7859

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ module.exports = function getBabelConfig(api) {
root: ['./'],
},
]);
// test environment is not happy about "satisfies" without this plugin in the chain
plugins.push(['@babel/plugin-transform-typescript', { isTSX: true }]);
}

return {
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"docs:size-why": "cross-env DOCS_STATS_ENABLED=true yarn docs:build",
"docs:deploy": "yarn workspace docs deploy",
"deduplicate": "node scripts/deduplicate.mjs",
"deduplicate:yarn": "yarn-deduplicate yarn.lock",
"dataset:file-tree": "babel-node -x .ts ./scripts/treeDataFromFileTree.ts",
"l10n": "babel-node -x .ts ./scripts/l10n.ts",
"jsonlint": "node ./scripts/jsonlint.mjs",
Expand Down Expand Up @@ -75,6 +76,7 @@
"@babel/plugin-transform-object-assign": "^7.18.6",
"@babel/plugin-transform-react-constant-elements": "^7.20.2",
"@babel/plugin-transform-runtime": "^7.19.6",
"@babel/plugin-transform-typescript": "^7.20.13",
"@babel/preset-env": "^7.20.2",
"@babel/preset-react": "^7.18.6",
"@babel/preset-typescript": "^7.18.6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const DesktopDateRangePicker = React.forwardRef(function DesktopDateRangePicker<
hidden: true,
...defaultizedProps.slotProps?.toolbar,
},
},
} satisfies DesktopDateRangePickerProps<TDate>['slotProps'],
};

const { renderPicker } = useDesktopRangePicker<TDate, 'day', typeof props>({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const MobileDateRangePicker = React.forwardRef(function MobileDateRangePicker<TD
hidden: false,
...defaultizedProps.slotProps?.toolbar,
},
},
} satisfies MobileDateRangePickerProps<TDate>['slotProps'],
};

const { renderPicker } = useMobileRangePicker<TDate, 'day', typeof props>({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const StaticDateRangePicker = React.forwardRef(function StaticDateRangePicker<TD
hidden: displayStaticWrapperAs === 'desktop',
...defaultizedProps.slotProps?.toolbar,
},
},
} satisfies StaticDateRangePickerProps<TDate>['slotProps'],
};

const { renderPicker } = useStaticRangePicker<TDate, 'day', typeof props>({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const DesktopDatePicker = React.forwardRef(function DesktopDatePicker<TDate>(
hidden: true,
...defaultizedProps.slotProps?.toolbar,
},
},
} satisfies DesktopDatePickerProps<TDate>['slotProps'],
};

const { renderPicker } = useDesktopPicker<TDate, DateView, typeof props>({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const DesktopDateTimePicker = React.forwardRef(function DesktopDateTimePicker<TD
hidden: true,
...defaultizedProps.slotProps?.tabs,
},
},
} satisfies DesktopDateTimePickerProps<TDate>['slotProps'],
};

const { renderPicker } = useDesktopPicker<TDate, DateOrTimeView, typeof props>({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const DesktopTimePicker = React.forwardRef(function DesktopTimePicker<TDate>(
hidden: true,
...defaultizedProps.slotProps?.toolbar,
},
},
} satisfies DesktopTimePickerProps<TDate>['slotProps'],
};

const { renderPicker } = useDesktopPicker<TDate, TimeView, typeof props>({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const MobileDatePicker = React.forwardRef(function MobileDatePicker<TDate>(
hidden: false,
...defaultizedProps.slotProps?.toolbar,
},
},
} satisfies MobileDatePickerProps<TDate>['slotProps'],
};

const { renderPicker } = useMobilePicker<TDate, DateView, typeof props>({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const MobileDateTimePicker = React.forwardRef(function MobileDateTimePicker<TDat
hidden: false,
...defaultizedProps.slotProps?.tabs,
},
},
} satisfies MobileDateTimePickerProps<TDate>['slotProps'],
};

const { renderPicker } = useMobilePicker<TDate, DateOrTimeView, typeof props>({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const MobileTimePicker = React.forwardRef(function MobileTimePicker<TDate>(
hidden: false,
...defaultizedProps.slotProps?.toolbar,
},
},
} satisfies MobileTimePickerProps<TDate>['slotProps'],
};

const { renderPicker } = useMobilePicker<TDate, TimeView, typeof props>({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const StaticDatePicker = React.forwardRef(function StaticDatePicker<TDate>(
hidden: displayStaticWrapperAs === 'desktop',
...defaultizedProps.slotProps?.toolbar,
},
},
} satisfies StaticDatePickerProps<TDate>['slotProps'],
};

const { renderPicker } = useStaticPicker<TDate, DateView, typeof props>({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const StaticDateTimePicker = React.forwardRef(function StaticDateTimePicker<TDat
hidden: displayStaticWrapperAs === 'desktop',
...defaultizedProps.slotProps?.toolbar,
},
},
} satisfies StaticDateTimePickerProps<TDate>['slotProps'],
};

const { renderPicker } = useStaticPicker<TDate, DateOrTimeView, typeof props>({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const StaticTimePicker = React.forwardRef(function StaticTimePicker<TDate>(
hidden: displayStaticWrapperAs === 'desktop',
...defaultizedProps.slotProps?.toolbar,
},
},
} satisfies StaticTimePickerProps<TDate>['slotProps'],
};

const { renderPicker } = useStaticPicker<TDate, TimeView, typeof props>({
Expand Down
84 changes: 43 additions & 41 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -229,17 +229,18 @@
lru-cache "^5.1.1"
semver "^6.3.0"

"@babel/helper-create-class-features-plugin@^7.18.6":
version "7.18.6"
resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.18.6.tgz#6f15f8459f3b523b39e00a99982e2c040871ed72"
integrity sha512-YfDzdnoxHGV8CzqHGyCbFvXg5QESPFkXlHtvdCkesLjjVMT2Adxe4FGUR5ChIb3DxSaXO12iIOCWoXdsUVwnqw==
"@babel/helper-create-class-features-plugin@^7.18.6", "@babel/helper-create-class-features-plugin@^7.20.12":
version "7.20.12"
resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.20.12.tgz#4349b928e79be05ed2d1643b20b99bb87c503819"
integrity sha512-9OunRkbT0JQcednL0UFvbfXpAsUXiGjUk0a7sN8fUXX7Mue79cUSMjHGDRRi/Vz9vYlpIhLV5fMD5dKoMhhsNQ==
dependencies:
"@babel/helper-annotate-as-pure" "^7.18.6"
"@babel/helper-environment-visitor" "^7.18.6"
"@babel/helper-function-name" "^7.18.6"
"@babel/helper-member-expression-to-functions" "^7.18.6"
"@babel/helper-environment-visitor" "^7.18.9"
"@babel/helper-function-name" "^7.19.0"
"@babel/helper-member-expression-to-functions" "^7.20.7"
"@babel/helper-optimise-call-expression" "^7.18.6"
"@babel/helper-replace-supers" "^7.18.6"
"@babel/helper-replace-supers" "^7.20.7"
"@babel/helper-skip-transparent-expression-wrappers" "^7.20.0"
"@babel/helper-split-export-declaration" "^7.18.6"

"@babel/helper-create-regexp-features-plugin@^7.18.6", "@babel/helper-create-regexp-features-plugin@^7.19.0":
Expand All @@ -262,7 +263,7 @@
resolve "^1.14.2"
semver "^6.1.2"

"@babel/helper-environment-visitor@^7.18.6", "@babel/helper-environment-visitor@^7.18.9":
"@babel/helper-environment-visitor@^7.18.9":
version "7.18.9"
resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz#0c0cee9b35d2ca190478756865bb3528422f51be"
integrity sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==
Expand All @@ -274,7 +275,7 @@
dependencies:
"@babel/types" "^7.18.6"

"@babel/helper-function-name@^7.18.6", "@babel/helper-function-name@^7.18.9", "@babel/helper-function-name@^7.19.0":
"@babel/helper-function-name@^7.18.9", "@babel/helper-function-name@^7.19.0":
version "7.19.0"
resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.19.0.tgz#941574ed5390682e872e52d3f38ce9d1bef4648c"
integrity sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w==
Expand All @@ -289,12 +290,12 @@
dependencies:
"@babel/types" "^7.18.6"

"@babel/helper-member-expression-to-functions@^7.18.6", "@babel/helper-member-expression-to-functions@^7.18.9":
version "7.18.9"
resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.18.9.tgz#1531661e8375af843ad37ac692c132841e2fd815"
integrity sha512-RxifAh2ZoVU67PyKIO4AMi1wTenGfMR/O/ae0CCRqwgBAt5v7xjdtRw7UoSbsreKrQn5t7r89eruK/9JjYHuDg==
"@babel/helper-member-expression-to-functions@^7.20.7":
version "7.20.7"
resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.20.7.tgz#a6f26e919582275a93c3aa6594756d71b0bb7f05"
integrity sha512-9J0CxJLq315fEdi4s7xK5TQaNYjZw+nDVpVqr1axNGKzdrdwYBD5b4uKv3n75aABG0rCCTK8Im8Ww7eYfMrZgw==
dependencies:
"@babel/types" "^7.18.9"
"@babel/types" "^7.20.7"

"@babel/helper-module-imports@^7.0.0", "@babel/helper-module-imports@^7.16.7", "@babel/helper-module-imports@^7.18.6":
version "7.18.6"
Expand Down Expand Up @@ -339,16 +340,17 @@
"@babel/helper-wrap-function" "^7.18.9"
"@babel/types" "^7.18.9"

"@babel/helper-replace-supers@^7.18.6", "@babel/helper-replace-supers@^7.19.1":
version "7.19.1"
resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.19.1.tgz#e1592a9b4b368aa6bdb8784a711e0bcbf0612b78"
integrity sha512-T7ahH7wV0Hfs46SFh5Jz3s0B6+o8g3c+7TMxu7xKfmHikg7EAZ3I2Qk9LFhjxXq8sL7UkP5JflezNwoZa8WvWw==
"@babel/helper-replace-supers@^7.18.6", "@babel/helper-replace-supers@^7.19.1", "@babel/helper-replace-supers@^7.20.7":
version "7.20.7"
resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.20.7.tgz#243ecd2724d2071532b2c8ad2f0f9f083bcae331"
integrity sha512-vujDMtB6LVfNW13jhlCrp48QNslK6JXi7lQG736HVbHz/mbf4Dc7tIRh1Xf5C0rF7BP8iiSxGMCmY6Ci1ven3A==
dependencies:
"@babel/helper-environment-visitor" "^7.18.9"
"@babel/helper-member-expression-to-functions" "^7.18.9"
"@babel/helper-member-expression-to-functions" "^7.20.7"
"@babel/helper-optimise-call-expression" "^7.18.6"
"@babel/traverse" "^7.19.1"
"@babel/types" "^7.19.0"
"@babel/template" "^7.20.7"
"@babel/traverse" "^7.20.7"
"@babel/types" "^7.20.7"

"@babel/helper-simple-access@^7.19.4", "@babel/helper-simple-access@^7.20.2":
version "7.20.2"
Expand All @@ -357,12 +359,12 @@
dependencies:
"@babel/types" "^7.20.2"

"@babel/helper-skip-transparent-expression-wrappers@^7.18.9":
version "7.18.9"
resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.18.9.tgz#778d87b3a758d90b471e7b9918f34a9a02eb5818"
integrity sha512-imytd2gHi3cJPsybLRbmFrF7u5BIEuI2cNheyKi3/iOBC63kNn3q8Crn2xVuESli0aM4KYsyEqKyS7lFL8YVtw==
"@babel/helper-skip-transparent-expression-wrappers@^7.18.9", "@babel/helper-skip-transparent-expression-wrappers@^7.20.0":
version "7.20.0"
resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.20.0.tgz#fbe4c52f60518cab8140d77101f0e63a8a230684"
integrity sha512-5y1JYeNKfvnT8sZcK9DVRtpTbGiomYIHviSP3OQWmDPU3DeH4a1ZlT/N2lyQ5P8egjcRaT/Y9aNqUxK0WsnIIg==
dependencies:
"@babel/types" "^7.18.9"
"@babel/types" "^7.20.0"

"@babel/helper-split-export-declaration@^7.18.6":
version "7.18.6"
Expand Down Expand Up @@ -695,12 +697,12 @@
dependencies:
"@babel/helper-plugin-utils" "^7.14.5"

"@babel/plugin-syntax-typescript@^7.18.6":
version "7.18.6"
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.18.6.tgz#1c09cd25795c7c2b8a4ba9ae49394576d4133285"
integrity sha512-mAWAuq4rvOepWCBid55JuRNvpTNf2UGVgoz4JV0fXEKolsVZDzsa4NqCef758WZJj/GDu0gVGItjKFiClTAmZA==
"@babel/plugin-syntax-typescript@^7.20.0":
version "7.20.0"
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.20.0.tgz#4e9a0cfc769c85689b77a2e642d24e9f697fc8c7"
integrity sha512-rd9TkG+u1CExzS4SM1BlMEhMXwFLKVjOAFFCDx9PbX5ycJWDoWMcwdJH9RhkPu1dOgn5TrxLot/Gx6lWFuAUNQ==
dependencies:
"@babel/helper-plugin-utils" "^7.18.6"
"@babel/helper-plugin-utils" "^7.19.0"

"@babel/plugin-transform-arrow-functions@^7.18.6":
version "7.18.6"
Expand Down Expand Up @@ -1004,14 +1006,14 @@
dependencies:
"@babel/helper-plugin-utils" "^7.18.9"

"@babel/plugin-transform-typescript@^7.18.6":
version "7.18.6"
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.18.6.tgz#8f4ade1a9cf253e5cf7c7c20173082c2c08a50a7"
integrity sha512-ijHNhzIrLj5lQCnI6aaNVRtGVuUZhOXFLRVFs7lLrkXTHip4FKty5oAuQdk4tywG0/WjXmjTfQCWmuzrvFer1w==
"@babel/plugin-transform-typescript@^7.18.6", "@babel/plugin-transform-typescript@^7.20.13":
version "7.20.13"
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.20.13.tgz#e3581b356b8694f6ff450211fe6774eaff8d25ab"
integrity sha512-O7I/THxarGcDZxkgWKMUrk7NK1/WbHAg3Xx86gqS6x9MTrNL6AwIluuZ96ms4xeDe6AVx6rjHbWHP7x26EPQBA==
dependencies:
"@babel/helper-create-class-features-plugin" "^7.18.6"
"@babel/helper-plugin-utils" "^7.18.6"
"@babel/plugin-syntax-typescript" "^7.18.6"
"@babel/helper-create-class-features-plugin" "^7.20.12"
"@babel/helper-plugin-utils" "^7.20.2"
"@babel/plugin-syntax-typescript" "^7.20.0"

"@babel/plugin-transform-unicode-escapes@^7.18.10":
version "7.18.10"
Expand Down Expand Up @@ -1185,7 +1187,7 @@
"@babel/parser" "^7.20.7"
"@babel/types" "^7.20.7"

"@babel/traverse@^7.1.6", "@babel/traverse@^7.18.11", "@babel/traverse@^7.19.1", "@babel/traverse@^7.20.10", "@babel/traverse@^7.20.12", "@babel/traverse@^7.20.13", "@babel/traverse@^7.20.7", "@babel/traverse@^7.4.5":
"@babel/traverse@^7.1.6", "@babel/traverse@^7.18.11", "@babel/traverse@^7.20.10", "@babel/traverse@^7.20.12", "@babel/traverse@^7.20.13", "@babel/traverse@^7.20.7", "@babel/traverse@^7.4.5":
version "7.20.13"
resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.20.13.tgz#817c1ba13d11accca89478bd5481b2d168d07473"
integrity sha512-kMJXfF0T6DIS9E8cgdLCSAL+cuCK+YEZHWiLK0SXpTo8YRj5lpJu3CDNKiIBCne4m9hhTIqUg6SYTAI39tAiVQ==
Expand All @@ -1201,7 +1203,7 @@
debug "^4.1.0"
globals "^11.1.0"

"@babel/types@^7.0.0", "@babel/types@^7.11.0", "@babel/types@^7.18.10", "@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.19.0", "@babel/types@^7.2.0", "@babel/types@^7.20.2", "@babel/types@^7.20.7", "@babel/types@^7.3.0", "@babel/types@^7.4.4", "@babel/types@^7.6.1":
"@babel/types@^7.0.0", "@babel/types@^7.11.0", "@babel/types@^7.18.10", "@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.19.0", "@babel/types@^7.2.0", "@babel/types@^7.20.0", "@babel/types@^7.20.2", "@babel/types@^7.20.7", "@babel/types@^7.3.0", "@babel/types@^7.4.4", "@babel/types@^7.6.1":
version "7.20.7"
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.20.7.tgz#54ec75e252318423fc07fb644dc6a58a64c09b7f"
integrity sha512-69OnhBxSSgK0OzTJai4kyPDiKTIe3j+ctaHdIGVbRahTLAT7L3R9oeXHC2aVSuGYt3cVnoAMDmOCgJ2yaiLMvg==
Expand Down