diff --git a/.github/workflows/closed-issue-message.yaml b/.github/workflows/closed-issue-message.yaml index 4bd174876fa5d..f909691aa5356 100644 --- a/.github/workflows/closed-issue-message.yaml +++ b/.github/workflows/closed-issue-message.yaml @@ -1,4 +1,4 @@ -name: Add comment +name: Add closing message to issue on: issues: @@ -9,30 +9,9 @@ permissions: {} jobs: add-comment: - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GH_REPO: ${{ github.repository }} - NUMBER: ${{ github.event.issue.number }} - BODY: | - :warning: **This issue has been closed.** If you have a similar problem but not exactly the same, please open a [new issue](https://github.com/mui/mui-x/issues/new/choose). - Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment. - APPENDIX: | - - @${{ github.event.issue.user.login }}: How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short [Support Satisfaction survey](https://tally.so/r/w4r5Mk?issue=${{ github.event.issue.number }}&productId=x). - - if: github.event.issue.state_reason != 'inactivity' - runs-on: ubuntu-latest + name: Add closing message + if: github.event.issue.state_reason == 'completed' + uses: mui/mui-public/.github/workflows/issues_add-closing-message.yml@master permissions: + contents: read issues: write - steps: - - uses: actions-cool/check-user-permission@956b2e73cdfe3bcb819bb7225e490cb3b18fd76e - id: checkUser - with: - require: 'write' - username: ${{ github.event.issue.user.login }} - - name: Add comment for outside contributors - if: steps.checkUser.outputs.check-result == false - run: gh issue comment "$NUMBER" --body "$BODY $APPENDIX" - - name: Add comment for maintainers - if: steps.checkUser.outputs.check-result == true - run: gh issue comment "$NUMBER" --body "$BODY" diff --git a/docs/translations/api-docs/charts/default-heatmap-tooltip/default-heatmap-tooltip.json b/docs/translations/api-docs/charts/default-heatmap-tooltip/default-heatmap-tooltip.json index c7ea4d31307fb..0c7b9190337e2 100644 --- a/docs/translations/api-docs/charts/default-heatmap-tooltip/default-heatmap-tooltip.json +++ b/docs/translations/api-docs/charts/default-heatmap-tooltip/default-heatmap-tooltip.json @@ -10,7 +10,7 @@ } }, "itemData": { "description": "The data used to identify the triggered item." }, - "series": { "description": "The series linked to the triggered axis." } + "series": { "description": "The series linked to the triggered item." } }, "classDescriptions": { "cell": { "description": "Styles applied to {{nodeName}}.", "nodeName": "the cell element" }, diff --git a/docs/translations/api-docs/date-pickers/date-field/date-field.json b/docs/translations/api-docs/date-pickers/date-field/date-field.json index 618744b87c466..f5c8a7ea37b8d 100644 --- a/docs/translations/api-docs/date-pickers/date-field/date-field.json +++ b/docs/translations/api-docs/date-pickers/date-field/date-field.json @@ -66,10 +66,10 @@ }, "onClear": { "description": "Callback fired when the clear button is clicked." }, "onError": { - "description": "Callback fired when the error associated to the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", + "description": "Callback fired when the error associated with the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", "typeDescriptions": { "error": "The reason why the current value is not valid.", - "value": "The value associated to the error" + "value": "The value associated with the error." } }, "onSelectedSectionsChange": { diff --git a/docs/translations/api-docs/date-pickers/date-picker/date-picker.json b/docs/translations/api-docs/date-pickers/date-picker/date-picker.json index 5555b7f4ffa45..8536e255a604c 100644 --- a/docs/translations/api-docs/date-pickers/date-picker/date-picker.json +++ b/docs/translations/api-docs/date-pickers/date-picker/date-picker.json @@ -77,10 +77,10 @@ "description": "Callback fired when the popup requests to be closed. Use in controlled mode (see open)." }, "onError": { - "description": "Callback fired when the error associated to the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", + "description": "Callback fired when the error associated with the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", "typeDescriptions": { "error": "The reason why the current value is not valid.", - "value": "The value associated to the error" + "value": "The value associated with the error." } }, "onMonthChange": { diff --git a/docs/translations/api-docs/date-pickers/date-range-picker/date-range-picker.json b/docs/translations/api-docs/date-pickers/date-range-picker/date-range-picker.json index e36497d596783..3d2165e374fec 100644 --- a/docs/translations/api-docs/date-pickers/date-range-picker/date-range-picker.json +++ b/docs/translations/api-docs/date-pickers/date-range-picker/date-range-picker.json @@ -91,10 +91,10 @@ "description": "Callback fired when the popup requests to be closed. Use in controlled mode (see open)." }, "onError": { - "description": "Callback fired when the error associated to the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", + "description": "Callback fired when the error associated with the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", "typeDescriptions": { "error": "The reason why the current value is not valid.", - "value": "The value associated to the error" + "value": "The value associated with the error." } }, "onMonthChange": { diff --git a/docs/translations/api-docs/date-pickers/date-time-field/date-time-field.json b/docs/translations/api-docs/date-pickers/date-time-field/date-time-field.json index 95121dacea2d8..40143ace91933 100644 --- a/docs/translations/api-docs/date-pickers/date-time-field/date-time-field.json +++ b/docs/translations/api-docs/date-pickers/date-time-field/date-time-field.json @@ -83,10 +83,10 @@ }, "onClear": { "description": "Callback fired when the clear button is clicked." }, "onError": { - "description": "Callback fired when the error associated to the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", + "description": "Callback fired when the error associated with the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", "typeDescriptions": { "error": "The reason why the current value is not valid.", - "value": "The value associated to the error" + "value": "The value associated with the error." } }, "onSelectedSectionsChange": { diff --git a/docs/translations/api-docs/date-pickers/date-time-picker/date-time-picker.json b/docs/translations/api-docs/date-pickers/date-time-picker/date-time-picker.json index d9f6a88b0bac8..d8994c789b60f 100644 --- a/docs/translations/api-docs/date-pickers/date-time-picker/date-time-picker.json +++ b/docs/translations/api-docs/date-pickers/date-time-picker/date-time-picker.json @@ -97,10 +97,10 @@ "description": "Callback fired when the popup requests to be closed. Use in controlled mode (see open)." }, "onError": { - "description": "Callback fired when the error associated to the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", + "description": "Callback fired when the error associated with the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", "typeDescriptions": { "error": "The reason why the current value is not valid.", - "value": "The value associated to the error" + "value": "The value associated with the error." } }, "onMonthChange": { diff --git a/docs/translations/api-docs/date-pickers/date-time-range-picker/date-time-range-picker.json b/docs/translations/api-docs/date-pickers/date-time-range-picker/date-time-range-picker.json index 5c365483d5c30..d9cbe6026fe58 100644 --- a/docs/translations/api-docs/date-pickers/date-time-range-picker/date-time-range-picker.json +++ b/docs/translations/api-docs/date-pickers/date-time-range-picker/date-time-range-picker.json @@ -108,10 +108,10 @@ "description": "Callback fired when the popup requests to be closed. Use in controlled mode (see open)." }, "onError": { - "description": "Callback fired when the error associated to the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", + "description": "Callback fired when the error associated with the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", "typeDescriptions": { "error": "The reason why the current value is not valid.", - "value": "The value associated to the error" + "value": "The value associated with the error." } }, "onMonthChange": { diff --git a/docs/translations/api-docs/date-pickers/desktop-date-picker/desktop-date-picker.json b/docs/translations/api-docs/date-pickers/desktop-date-picker/desktop-date-picker.json index c87e5e21816dc..0235dcbeb4f11 100644 --- a/docs/translations/api-docs/date-pickers/desktop-date-picker/desktop-date-picker.json +++ b/docs/translations/api-docs/date-pickers/desktop-date-picker/desktop-date-picker.json @@ -74,10 +74,10 @@ "description": "Callback fired when the popup requests to be closed. Use in controlled mode (see open)." }, "onError": { - "description": "Callback fired when the error associated to the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", + "description": "Callback fired when the error associated with the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", "typeDescriptions": { "error": "The reason why the current value is not valid.", - "value": "The value associated to the error" + "value": "The value associated with the error." } }, "onMonthChange": { diff --git a/docs/translations/api-docs/date-pickers/desktop-date-range-picker/desktop-date-range-picker.json b/docs/translations/api-docs/date-pickers/desktop-date-range-picker/desktop-date-range-picker.json index 0640005848218..a8e7907b7f9f8 100644 --- a/docs/translations/api-docs/date-pickers/desktop-date-range-picker/desktop-date-range-picker.json +++ b/docs/translations/api-docs/date-pickers/desktop-date-range-picker/desktop-date-range-picker.json @@ -88,10 +88,10 @@ "description": "Callback fired when the popup requests to be closed. Use in controlled mode (see open)." }, "onError": { - "description": "Callback fired when the error associated to the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", + "description": "Callback fired when the error associated with the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", "typeDescriptions": { "error": "The reason why the current value is not valid.", - "value": "The value associated to the error" + "value": "The value associated with the error." } }, "onMonthChange": { diff --git a/docs/translations/api-docs/date-pickers/desktop-date-time-picker/desktop-date-time-picker.json b/docs/translations/api-docs/date-pickers/desktop-date-time-picker/desktop-date-time-picker.json index fd18750143b3c..41c3552ab7732 100644 --- a/docs/translations/api-docs/date-pickers/desktop-date-time-picker/desktop-date-time-picker.json +++ b/docs/translations/api-docs/date-pickers/desktop-date-time-picker/desktop-date-time-picker.json @@ -94,10 +94,10 @@ "description": "Callback fired when the popup requests to be closed. Use in controlled mode (see open)." }, "onError": { - "description": "Callback fired when the error associated to the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", + "description": "Callback fired when the error associated with the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", "typeDescriptions": { "error": "The reason why the current value is not valid.", - "value": "The value associated to the error" + "value": "The value associated with the error." } }, "onMonthChange": { diff --git a/docs/translations/api-docs/date-pickers/desktop-date-time-range-picker/desktop-date-time-range-picker.json b/docs/translations/api-docs/date-pickers/desktop-date-time-range-picker/desktop-date-time-range-picker.json index e078dbbc15d4d..9e40b5b86f956 100644 --- a/docs/translations/api-docs/date-pickers/desktop-date-time-range-picker/desktop-date-time-range-picker.json +++ b/docs/translations/api-docs/date-pickers/desktop-date-time-range-picker/desktop-date-time-range-picker.json @@ -105,10 +105,10 @@ "description": "Callback fired when the popup requests to be closed. Use in controlled mode (see open)." }, "onError": { - "description": "Callback fired when the error associated to the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", + "description": "Callback fired when the error associated with the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", "typeDescriptions": { "error": "The reason why the current value is not valid.", - "value": "The value associated to the error" + "value": "The value associated with the error." } }, "onMonthChange": { diff --git a/docs/translations/api-docs/date-pickers/desktop-time-picker/desktop-time-picker.json b/docs/translations/api-docs/date-pickers/desktop-time-picker/desktop-time-picker.json index 4ddf39b2d428c..1b755973312e0 100644 --- a/docs/translations/api-docs/date-pickers/desktop-time-picker/desktop-time-picker.json +++ b/docs/translations/api-docs/date-pickers/desktop-time-picker/desktop-time-picker.json @@ -66,10 +66,10 @@ "description": "Callback fired when the popup requests to be closed. Use in controlled mode (see open)." }, "onError": { - "description": "Callback fired when the error associated to the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", + "description": "Callback fired when the error associated with the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", "typeDescriptions": { "error": "The reason why the current value is not valid.", - "value": "The value associated to the error" + "value": "The value associated with the error." } }, "onOpen": { diff --git a/docs/translations/api-docs/date-pickers/mobile-date-picker/mobile-date-picker.json b/docs/translations/api-docs/date-pickers/mobile-date-picker/mobile-date-picker.json index 79e03e0738980..196f25f2be157 100644 --- a/docs/translations/api-docs/date-pickers/mobile-date-picker/mobile-date-picker.json +++ b/docs/translations/api-docs/date-pickers/mobile-date-picker/mobile-date-picker.json @@ -74,10 +74,10 @@ "description": "Callback fired when the popup requests to be closed. Use in controlled mode (see open)." }, "onError": { - "description": "Callback fired when the error associated to the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", + "description": "Callback fired when the error associated with the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", "typeDescriptions": { "error": "The reason why the current value is not valid.", - "value": "The value associated to the error" + "value": "The value associated with the error." } }, "onMonthChange": { diff --git a/docs/translations/api-docs/date-pickers/mobile-date-range-picker/mobile-date-range-picker.json b/docs/translations/api-docs/date-pickers/mobile-date-range-picker/mobile-date-range-picker.json index 9979387f247d7..33656bf53c5f7 100644 --- a/docs/translations/api-docs/date-pickers/mobile-date-range-picker/mobile-date-range-picker.json +++ b/docs/translations/api-docs/date-pickers/mobile-date-range-picker/mobile-date-range-picker.json @@ -85,10 +85,10 @@ "description": "Callback fired when the popup requests to be closed. Use in controlled mode (see open)." }, "onError": { - "description": "Callback fired when the error associated to the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", + "description": "Callback fired when the error associated with the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", "typeDescriptions": { "error": "The reason why the current value is not valid.", - "value": "The value associated to the error" + "value": "The value associated with the error." } }, "onMonthChange": { diff --git a/docs/translations/api-docs/date-pickers/mobile-date-time-picker/mobile-date-time-picker.json b/docs/translations/api-docs/date-pickers/mobile-date-time-picker/mobile-date-time-picker.json index 4d5af55928457..1b95ab814138c 100644 --- a/docs/translations/api-docs/date-pickers/mobile-date-time-picker/mobile-date-time-picker.json +++ b/docs/translations/api-docs/date-pickers/mobile-date-time-picker/mobile-date-time-picker.json @@ -94,10 +94,10 @@ "description": "Callback fired when the popup requests to be closed. Use in controlled mode (see open)." }, "onError": { - "description": "Callback fired when the error associated to the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", + "description": "Callback fired when the error associated with the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", "typeDescriptions": { "error": "The reason why the current value is not valid.", - "value": "The value associated to the error" + "value": "The value associated with the error." } }, "onMonthChange": { diff --git a/docs/translations/api-docs/date-pickers/mobile-date-time-range-picker/mobile-date-time-range-picker.json b/docs/translations/api-docs/date-pickers/mobile-date-time-range-picker/mobile-date-time-range-picker.json index c2eb9b111653d..88e8272c5347e 100644 --- a/docs/translations/api-docs/date-pickers/mobile-date-time-range-picker/mobile-date-time-range-picker.json +++ b/docs/translations/api-docs/date-pickers/mobile-date-time-range-picker/mobile-date-time-range-picker.json @@ -102,10 +102,10 @@ "description": "Callback fired when the popup requests to be closed. Use in controlled mode (see open)." }, "onError": { - "description": "Callback fired when the error associated to the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", + "description": "Callback fired when the error associated with the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", "typeDescriptions": { "error": "The reason why the current value is not valid.", - "value": "The value associated to the error" + "value": "The value associated with the error." } }, "onMonthChange": { diff --git a/docs/translations/api-docs/date-pickers/mobile-time-picker/mobile-time-picker.json b/docs/translations/api-docs/date-pickers/mobile-time-picker/mobile-time-picker.json index 9e4aee022d836..48fdc89e4bd9f 100644 --- a/docs/translations/api-docs/date-pickers/mobile-time-picker/mobile-time-picker.json +++ b/docs/translations/api-docs/date-pickers/mobile-time-picker/mobile-time-picker.json @@ -66,10 +66,10 @@ "description": "Callback fired when the popup requests to be closed. Use in controlled mode (see open)." }, "onError": { - "description": "Callback fired when the error associated to the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", + "description": "Callback fired when the error associated with the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", "typeDescriptions": { "error": "The reason why the current value is not valid.", - "value": "The value associated to the error" + "value": "The value associated with the error." } }, "onOpen": { diff --git a/docs/translations/api-docs/date-pickers/multi-input-date-range-field/multi-input-date-range-field.json b/docs/translations/api-docs/date-pickers/multi-input-date-range-field/multi-input-date-range-field.json index 5091832ca274a..b2bbe71d889f4 100644 --- a/docs/translations/api-docs/date-pickers/multi-input-date-range-field/multi-input-date-range-field.json +++ b/docs/translations/api-docs/date-pickers/multi-input-date-range-field/multi-input-date-range-field.json @@ -34,10 +34,10 @@ } }, "onError": { - "description": "Callback fired when the error associated to the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", + "description": "Callback fired when the error associated with the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", "typeDescriptions": { "error": "The reason why the current value is not valid.", - "value": "The value associated to the error" + "value": "The value associated with the error." } }, "onSelectedSectionsChange": { diff --git a/docs/translations/api-docs/date-pickers/multi-input-date-time-range-field/multi-input-date-time-range-field.json b/docs/translations/api-docs/date-pickers/multi-input-date-time-range-field/multi-input-date-time-range-field.json index 2657b5ed1a3fb..df8eddfa4dfcd 100644 --- a/docs/translations/api-docs/date-pickers/multi-input-date-time-range-field/multi-input-date-time-range-field.json +++ b/docs/translations/api-docs/date-pickers/multi-input-date-time-range-field/multi-input-date-time-range-field.json @@ -51,10 +51,10 @@ } }, "onError": { - "description": "Callback fired when the error associated to the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", + "description": "Callback fired when the error associated with the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", "typeDescriptions": { "error": "The reason why the current value is not valid.", - "value": "The value associated to the error" + "value": "The value associated with the error." } }, "onSelectedSectionsChange": { diff --git a/docs/translations/api-docs/date-pickers/multi-input-time-range-field/multi-input-time-range-field.json b/docs/translations/api-docs/date-pickers/multi-input-time-range-field/multi-input-time-range-field.json index 29a60e20be62b..f041ee14ff3e5 100644 --- a/docs/translations/api-docs/date-pickers/multi-input-time-range-field/multi-input-time-range-field.json +++ b/docs/translations/api-docs/date-pickers/multi-input-time-range-field/multi-input-time-range-field.json @@ -43,10 +43,10 @@ } }, "onError": { - "description": "Callback fired when the error associated to the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", + "description": "Callback fired when the error associated with the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", "typeDescriptions": { "error": "The reason why the current value is not valid.", - "value": "The value associated to the error" + "value": "The value associated with the error." } }, "onSelectedSectionsChange": { diff --git a/docs/translations/api-docs/date-pickers/single-input-date-range-field/single-input-date-range-field.json b/docs/translations/api-docs/date-pickers/single-input-date-range-field/single-input-date-range-field.json index a24a00361f7d6..fa08acde2c924 100644 --- a/docs/translations/api-docs/date-pickers/single-input-date-range-field/single-input-date-range-field.json +++ b/docs/translations/api-docs/date-pickers/single-input-date-range-field/single-input-date-range-field.json @@ -67,10 +67,10 @@ }, "onClear": { "description": "Callback fired when the clear button is clicked." }, "onError": { - "description": "Callback fired when the error associated to the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", + "description": "Callback fired when the error associated with the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", "typeDescriptions": { "error": "The reason why the current value is not valid.", - "value": "The value associated to the error" + "value": "The value associated with the error." } }, "onSelectedSectionsChange": { diff --git a/docs/translations/api-docs/date-pickers/single-input-date-time-range-field/single-input-date-time-range-field.json b/docs/translations/api-docs/date-pickers/single-input-date-time-range-field/single-input-date-time-range-field.json index e98b84401aca0..4f40fa23b513b 100644 --- a/docs/translations/api-docs/date-pickers/single-input-date-time-range-field/single-input-date-time-range-field.json +++ b/docs/translations/api-docs/date-pickers/single-input-date-time-range-field/single-input-date-time-range-field.json @@ -84,10 +84,10 @@ }, "onClear": { "description": "Callback fired when the clear button is clicked." }, "onError": { - "description": "Callback fired when the error associated to the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", + "description": "Callback fired when the error associated with the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", "typeDescriptions": { "error": "The reason why the current value is not valid.", - "value": "The value associated to the error" + "value": "The value associated with the error." } }, "onSelectedSectionsChange": { diff --git a/docs/translations/api-docs/date-pickers/single-input-time-range-field/single-input-time-range-field.json b/docs/translations/api-docs/date-pickers/single-input-time-range-field/single-input-time-range-field.json index 7814309458a6f..7b4b4799c40f1 100644 --- a/docs/translations/api-docs/date-pickers/single-input-time-range-field/single-input-time-range-field.json +++ b/docs/translations/api-docs/date-pickers/single-input-time-range-field/single-input-time-range-field.json @@ -76,10 +76,10 @@ }, "onClear": { "description": "Callback fired when the clear button is clicked." }, "onError": { - "description": "Callback fired when the error associated to the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", + "description": "Callback fired when the error associated with the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", "typeDescriptions": { "error": "The reason why the current value is not valid.", - "value": "The value associated to the error" + "value": "The value associated with the error." } }, "onSelectedSectionsChange": { diff --git a/docs/translations/api-docs/date-pickers/static-date-picker/static-date-picker.json b/docs/translations/api-docs/date-pickers/static-date-picker/static-date-picker.json index 289d1ade78f4e..d8487afd8015e 100644 --- a/docs/translations/api-docs/date-pickers/static-date-picker/static-date-picker.json +++ b/docs/translations/api-docs/date-pickers/static-date-picker/static-date-picker.json @@ -60,10 +60,10 @@ "description": "Callback fired when component requests to be closed. Can be fired when selecting (by default on desktop mode) or clearing a value." }, "onError": { - "description": "Callback fired when the error associated to the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", + "description": "Callback fired when the error associated with the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", "typeDescriptions": { "error": "The reason why the current value is not valid.", - "value": "The value associated to the error" + "value": "The value associated with the error." } }, "onMonthChange": { diff --git a/docs/translations/api-docs/date-pickers/static-date-range-picker/static-date-range-picker.json b/docs/translations/api-docs/date-pickers/static-date-range-picker/static-date-range-picker.json index 902cddeda7033..993e0008d0753 100644 --- a/docs/translations/api-docs/date-pickers/static-date-range-picker/static-date-range-picker.json +++ b/docs/translations/api-docs/date-pickers/static-date-range-picker/static-date-range-picker.json @@ -70,10 +70,10 @@ "description": "Callback fired when component requests to be closed. Can be fired when selecting (by default on desktop mode) or clearing a value." }, "onError": { - "description": "Callback fired when the error associated to the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", + "description": "Callback fired when the error associated with the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", "typeDescriptions": { "error": "The reason why the current value is not valid.", - "value": "The value associated to the error" + "value": "The value associated with the error." } }, "onMonthChange": { diff --git a/docs/translations/api-docs/date-pickers/static-date-time-picker/static-date-time-picker.json b/docs/translations/api-docs/date-pickers/static-date-time-picker/static-date-time-picker.json index f249adf4217e2..ffe8c876b512d 100644 --- a/docs/translations/api-docs/date-pickers/static-date-time-picker/static-date-time-picker.json +++ b/docs/translations/api-docs/date-pickers/static-date-time-picker/static-date-time-picker.json @@ -80,10 +80,10 @@ "description": "Callback fired when component requests to be closed. Can be fired when selecting (by default on desktop mode) or clearing a value." }, "onError": { - "description": "Callback fired when the error associated to the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", + "description": "Callback fired when the error associated with the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", "typeDescriptions": { "error": "The reason why the current value is not valid.", - "value": "The value associated to the error" + "value": "The value associated with the error." } }, "onMonthChange": { diff --git a/docs/translations/api-docs/date-pickers/static-time-picker/static-time-picker.json b/docs/translations/api-docs/date-pickers/static-time-picker/static-time-picker.json index df19b36acd95c..61e15cc5ee02f 100644 --- a/docs/translations/api-docs/date-pickers/static-time-picker/static-time-picker.json +++ b/docs/translations/api-docs/date-pickers/static-time-picker/static-time-picker.json @@ -52,10 +52,10 @@ "description": "Callback fired when component requests to be closed. Can be fired when selecting (by default on desktop mode) or clearing a value." }, "onError": { - "description": "Callback fired when the error associated to the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", + "description": "Callback fired when the error associated with the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", "typeDescriptions": { "error": "The reason why the current value is not valid.", - "value": "The value associated to the error" + "value": "The value associated with the error." } }, "onViewChange": { diff --git a/docs/translations/api-docs/date-pickers/time-field/time-field.json b/docs/translations/api-docs/date-pickers/time-field/time-field.json index e54b304b64b5a..f7e8c72ad8605 100644 --- a/docs/translations/api-docs/date-pickers/time-field/time-field.json +++ b/docs/translations/api-docs/date-pickers/time-field/time-field.json @@ -75,10 +75,10 @@ }, "onClear": { "description": "Callback fired when the clear button is clicked." }, "onError": { - "description": "Callback fired when the error associated to the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", + "description": "Callback fired when the error associated with the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", "typeDescriptions": { "error": "The reason why the current value is not valid.", - "value": "The value associated to the error" + "value": "The value associated with the error." } }, "onSelectedSectionsChange": { diff --git a/docs/translations/api-docs/date-pickers/time-picker/time-picker.json b/docs/translations/api-docs/date-pickers/time-picker/time-picker.json index 17d4ee6c9f6ac..8559abcfcb560 100644 --- a/docs/translations/api-docs/date-pickers/time-picker/time-picker.json +++ b/docs/translations/api-docs/date-pickers/time-picker/time-picker.json @@ -69,10 +69,10 @@ "description": "Callback fired when the popup requests to be closed. Use in controlled mode (see open)." }, "onError": { - "description": "Callback fired when the error associated to the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", + "description": "Callback fired when the error associated with the current value changes. When a validation error is detected, the error parameter contains a non-null value. This can be used to render an appropriate form error.", "typeDescriptions": { "error": "The reason why the current value is not valid.", - "value": "The value associated to the error" + "value": "The value associated with the error." } }, "onOpen": { diff --git a/packages/x-charts-pro/src/Heatmap/DefaultHeatmapTooltip.tsx b/packages/x-charts-pro/src/Heatmap/DefaultHeatmapTooltip.tsx index cb83e1cfed685..a87dbf64a4bd8 100644 --- a/packages/x-charts-pro/src/Heatmap/DefaultHeatmapTooltip.tsx +++ b/packages/x-charts-pro/src/Heatmap/DefaultHeatmapTooltip.tsx @@ -89,7 +89,7 @@ DefaultHeatmapTooltip.propTypes = { type: PropTypes.oneOf(['heatmap']).isRequired, }).isRequired, /** - * The series linked to the triggered axis. + * The series linked to the triggered item. */ series: PropTypes.object.isRequired, sx: PropTypes.oneOfType([ diff --git a/packages/x-charts/src/ChartsTooltip/ChartsItemTooltipContent.tsx b/packages/x-charts/src/ChartsTooltip/ChartsItemTooltipContent.tsx index 54c7fd602f2e5..8a941f4d9c68b 100644 --- a/packages/x-charts/src/ChartsTooltip/ChartsItemTooltipContent.tsx +++ b/packages/x-charts/src/ChartsTooltip/ChartsItemTooltipContent.tsx @@ -16,7 +16,7 @@ export interface ChartsItemContentProps { */ itemData: ItemInteractionData; /** - * The series linked to the triggered axis. + * The series linked to the triggered item. */ series: ChartSeriesDefaultized; /** diff --git a/packages/x-date-pickers-pro/src/DateRangeCalendar/DateRangeCalendar.tsx b/packages/x-date-pickers-pro/src/DateRangeCalendar/DateRangeCalendar.tsx index 3e0272ae130c7..aaa0bee3165c4 100644 --- a/packages/x-date-pickers-pro/src/DateRangeCalendar/DateRangeCalendar.tsx +++ b/packages/x-date-pickers-pro/src/DateRangeCalendar/DateRangeCalendar.tsx @@ -705,7 +705,7 @@ DateRangeCalendar.propTypes = { minDate: PropTypes.object, /** * Callback fired when the value changes. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. * @template TView The view type. Will be one of date or time views. * @param {TValue} value The new value. * @param {PickerSelectionState | undefined} selectionState Indicates if the date selection is complete. diff --git a/packages/x-date-pickers-pro/src/DateRangePicker/DateRangePicker.tsx b/packages/x-date-pickers-pro/src/DateRangePicker/DateRangePicker.tsx index 8002fc939798d..f24af1d702eb4 100644 --- a/packages/x-date-pickers-pro/src/DateRangePicker/DateRangePicker.tsx +++ b/packages/x-date-pickers-pro/src/DateRangePicker/DateRangePicker.tsx @@ -196,16 +196,16 @@ DateRangePicker.propTypes = { name: PropTypes.string, /** * Callback fired when the value is accepted. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The value that was just accepted. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ onAccept: PropTypes.func, /** * Callback fired when the value changes. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The new value. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ @@ -216,13 +216,13 @@ DateRangePicker.propTypes = { */ onClose: PropTypes.func, /** - * Callback fired when the error associated to the current value changes. + * Callback fired when the error associated with the current value changes. * When a validation error is detected, the `error` parameter contains a non-null value. * This can be used to render an appropriate form error. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. * @param {TError} error The reason why the current value is not valid. - * @param {TValue} value The value associated to the error + * @param {TValue} value The value associated with the error. */ onError: PropTypes.func, /** diff --git a/packages/x-date-pickers-pro/src/DateTimeRangePicker/DateTimeRangePicker.tsx b/packages/x-date-pickers-pro/src/DateTimeRangePicker/DateTimeRangePicker.tsx index 9249006814e55..6985cce40ca0c 100644 --- a/packages/x-date-pickers-pro/src/DateTimeRangePicker/DateTimeRangePicker.tsx +++ b/packages/x-date-pickers-pro/src/DateTimeRangePicker/DateTimeRangePicker.tsx @@ -229,16 +229,16 @@ DateTimeRangePicker.propTypes = { name: PropTypes.string, /** * Callback fired when the value is accepted. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The value that was just accepted. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ onAccept: PropTypes.func, /** * Callback fired when the value changes. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The new value. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ @@ -249,13 +249,13 @@ DateTimeRangePicker.propTypes = { */ onClose: PropTypes.func, /** - * Callback fired when the error associated to the current value changes. + * Callback fired when the error associated with the current value changes. * When a validation error is detected, the `error` parameter contains a non-null value. * This can be used to render an appropriate form error. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. * @param {TError} error The reason why the current value is not valid. - * @param {TValue} value The value associated to the error + * @param {TValue} value The value associated with the error. */ onError: PropTypes.func, /** diff --git a/packages/x-date-pickers-pro/src/DesktopDateRangePicker/DesktopDateRangePicker.tsx b/packages/x-date-pickers-pro/src/DesktopDateRangePicker/DesktopDateRangePicker.tsx index 025c7c1ca7865..f76e7d1ad76ba 100644 --- a/packages/x-date-pickers-pro/src/DesktopDateRangePicker/DesktopDateRangePicker.tsx +++ b/packages/x-date-pickers-pro/src/DesktopDateRangePicker/DesktopDateRangePicker.tsx @@ -1,7 +1,6 @@ import * as React from 'react'; import PropTypes from 'prop-types'; -import { PickerViewRendererLookup } from '@mui/x-date-pickers/internals'; -import { extractValidationProps } from '@mui/x-date-pickers/validation'; +import { extractValidationProps, PickerViewRendererLookup } from '@mui/x-date-pickers/internals'; import { PickerValidDate } from '@mui/x-date-pickers/models'; import resolveComponentProps from '@mui/utils/resolveComponentProps'; import { refType } from '@mui/utils'; @@ -11,7 +10,7 @@ import { useDateRangePickerDefaultizedProps } from '../DateRangePicker/shared'; import { renderDateRangeViewCalendar } from '../dateRangeViewRenderers'; import { MultiInputDateRangeField } from '../MultiInputDateRangeField'; import { useDesktopRangePicker } from '../internals/hooks/useDesktopRangePicker'; -import { validateDateRange } from '../validation'; +import { validateDateRange } from '../internals/utils/validation/validateDateRange'; import { DateRange } from '../models'; type DesktopDateRangePickerComponent = (< @@ -232,16 +231,16 @@ DesktopDateRangePicker.propTypes = { name: PropTypes.string, /** * Callback fired when the value is accepted. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The value that was just accepted. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ onAccept: PropTypes.func, /** * Callback fired when the value changes. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The new value. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ @@ -252,13 +251,13 @@ DesktopDateRangePicker.propTypes = { */ onClose: PropTypes.func, /** - * Callback fired when the error associated to the current value changes. + * Callback fired when the error associated with the current value changes. * When a validation error is detected, the `error` parameter contains a non-null value. * This can be used to render an appropriate form error. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. * @param {TError} error The reason why the current value is not valid. - * @param {TValue} value The value associated to the error + * @param {TValue} value The value associated with the error. */ onError: PropTypes.func, /** diff --git a/packages/x-date-pickers-pro/src/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.tsx b/packages/x-date-pickers-pro/src/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.tsx index 89e375c96dab0..b25801087ea91 100644 --- a/packages/x-date-pickers-pro/src/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.tsx +++ b/packages/x-date-pickers-pro/src/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.tsx @@ -2,6 +2,7 @@ import * as React from 'react'; import PropTypes from 'prop-types'; import { DefaultizedProps, + extractValidationProps, isDatePickerView, isInternalTimeView, PickerViewRenderer, @@ -9,7 +10,6 @@ import { resolveDateTimeFormat, useUtils, } from '@mui/x-date-pickers/internals'; -import { extractValidationProps } from '@mui/x-date-pickers/validation'; import { PickerValidDate } from '@mui/x-date-pickers/models'; import resolveComponentProps from '@mui/utils/resolveComponentProps'; import { refType } from '@mui/utils'; @@ -32,7 +32,7 @@ import { useDesktopRangePicker, UseDesktopRangePickerProps, } from '../internals/hooks/useDesktopRangePicker'; -import { validateDateTimeRange } from '../validation'; +import { validateDateTimeRange } from '../internals/utils/validation/validateDateTimeRange'; import { DateTimeRangePickerView } from '../internals/models'; import { DateRange } from '../models'; import { @@ -397,16 +397,16 @@ DesktopDateTimeRangePicker.propTypes = { name: PropTypes.string, /** * Callback fired when the value is accepted. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The value that was just accepted. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ onAccept: PropTypes.func, /** * Callback fired when the value changes. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The new value. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ @@ -417,13 +417,13 @@ DesktopDateTimeRangePicker.propTypes = { */ onClose: PropTypes.func, /** - * Callback fired when the error associated to the current value changes. + * Callback fired when the error associated with the current value changes. * When a validation error is detected, the `error` parameter contains a non-null value. * This can be used to render an appropriate form error. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. * @param {TError} error The reason why the current value is not valid. - * @param {TValue} value The value associated to the error + * @param {TValue} value The value associated with the error. */ onError: PropTypes.func, /** diff --git a/packages/x-date-pickers-pro/src/MobileDateRangePicker/MobileDateRangePicker.tsx b/packages/x-date-pickers-pro/src/MobileDateRangePicker/MobileDateRangePicker.tsx index c3605de2d5ace..6cb841389f50c 100644 --- a/packages/x-date-pickers-pro/src/MobileDateRangePicker/MobileDateRangePicker.tsx +++ b/packages/x-date-pickers-pro/src/MobileDateRangePicker/MobileDateRangePicker.tsx @@ -1,7 +1,6 @@ import * as React from 'react'; import PropTypes from 'prop-types'; -import { PickerViewRendererLookup } from '@mui/x-date-pickers/internals'; -import { extractValidationProps } from '@mui/x-date-pickers/validation'; +import { extractValidationProps, PickerViewRendererLookup } from '@mui/x-date-pickers/internals'; import { PickerValidDate } from '@mui/x-date-pickers/models'; import resolveComponentProps from '@mui/utils/resolveComponentProps'; import { refType } from '@mui/utils'; @@ -11,7 +10,7 @@ import { useDateRangePickerDefaultizedProps } from '../DateRangePicker/shared'; import { renderDateRangeViewCalendar } from '../dateRangeViewRenderers'; import { MultiInputDateRangeField } from '../MultiInputDateRangeField'; import { useMobileRangePicker } from '../internals/hooks/useMobileRangePicker'; -import { validateDateRange } from '../validation'; +import { validateDateRange } from '../internals/utils/validation/validateDateRange'; import { DateRange } from '../models'; type MobileDateRangePickerComponent = (< @@ -228,16 +227,16 @@ MobileDateRangePicker.propTypes = { name: PropTypes.string, /** * Callback fired when the value is accepted. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The value that was just accepted. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ onAccept: PropTypes.func, /** * Callback fired when the value changes. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The new value. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ @@ -248,13 +247,13 @@ MobileDateRangePicker.propTypes = { */ onClose: PropTypes.func, /** - * Callback fired when the error associated to the current value changes. + * Callback fired when the error associated with the current value changes. * When a validation error is detected, the `error` parameter contains a non-null value. * This can be used to render an appropriate form error. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. * @param {TError} error The reason why the current value is not valid. - * @param {TValue} value The value associated to the error + * @param {TValue} value The value associated with the error. */ onError: PropTypes.func, /** diff --git a/packages/x-date-pickers-pro/src/MobileDateTimeRangePicker/MobileDateTimeRangePicker.tsx b/packages/x-date-pickers-pro/src/MobileDateTimeRangePicker/MobileDateTimeRangePicker.tsx index cdbabfe04eeae..63637dbce3747 100644 --- a/packages/x-date-pickers-pro/src/MobileDateTimeRangePicker/MobileDateTimeRangePicker.tsx +++ b/packages/x-date-pickers-pro/src/MobileDateTimeRangePicker/MobileDateTimeRangePicker.tsx @@ -4,6 +4,7 @@ import { refType } from '@mui/utils'; import { DIALOG_WIDTH, VIEW_HEIGHT, + extractValidationProps, isInternalTimeView, isDatePickerView, PickerViewRenderer, @@ -13,7 +14,6 @@ import { resolveDateTimeFormat, useUtils, } from '@mui/x-date-pickers/internals'; -import { extractValidationProps } from '@mui/x-date-pickers/validation'; import { PickerValidDate } from '@mui/x-date-pickers/models'; import resolveComponentProps from '@mui/utils/resolveComponentProps'; import { @@ -32,7 +32,7 @@ import { UseMobileRangePickerProps, useMobileRangePicker, } from '../internals/hooks/useMobileRangePicker'; -import { validateDateTimeRange } from '../validation'; +import { validateDateTimeRange } from '../internals/utils/validation/validateDateTimeRange'; import { DateTimeRangePickerView } from '../internals/models'; import { DateRange } from '../models'; import { @@ -387,16 +387,16 @@ MobileDateTimeRangePicker.propTypes = { name: PropTypes.string, /** * Callback fired when the value is accepted. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The value that was just accepted. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ onAccept: PropTypes.func, /** * Callback fired when the value changes. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The new value. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ @@ -407,13 +407,13 @@ MobileDateTimeRangePicker.propTypes = { */ onClose: PropTypes.func, /** - * Callback fired when the error associated to the current value changes. + * Callback fired when the error associated with the current value changes. * When a validation error is detected, the `error` parameter contains a non-null value. * This can be used to render an appropriate form error. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. * @param {TError} error The reason why the current value is not valid. - * @param {TValue} value The value associated to the error + * @param {TValue} value The value associated with the error. */ onError: PropTypes.func, /** diff --git a/packages/x-date-pickers-pro/src/MultiInputDateRangeField/MultiInputDateRangeField.tsx b/packages/x-date-pickers-pro/src/MultiInputDateRangeField/MultiInputDateRangeField.tsx index f03de14dc1b68..24417abcd17f6 100644 --- a/packages/x-date-pickers-pro/src/MultiInputDateRangeField/MultiInputDateRangeField.tsx +++ b/packages/x-date-pickers-pro/src/MultiInputDateRangeField/MultiInputDateRangeField.tsx @@ -22,7 +22,7 @@ import { MultiInputDateRangeFieldSlotProps, } from './MultiInputDateRangeField.types'; import { useMultiInputDateRangeField } from '../internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField'; -import { MultiInputRangeFieldClasses, RangePosition } from '../models'; +import { MultiInputRangeFieldClasses, RangePosition, UseDateRangeFieldProps } from '../models'; export const multiInputDateRangeFieldClasses: MultiInputRangeFieldClasses = generateUtilityClasses( 'MuiMultiInputDateRangeField', @@ -91,7 +91,10 @@ const MultiInputDateRangeField = React.forwardRef(function MultiInputDateRangeFi name: 'MuiMultiInputDateRangeField', }); - const { internalProps, forwardedProps } = splitFieldInternalAndForwardedProps(themeProps, 'date'); + const { internalProps, forwardedProps } = splitFieldInternalAndForwardedProps< + typeof themeProps, + keyof Omit, 'clearable' | 'onClear'> + >(themeProps, 'date'); const { slots, @@ -259,20 +262,20 @@ MultiInputDateRangeField.propTypes = { minDate: PropTypes.object, /** * Callback fired when the value changes. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The new value. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ onChange: PropTypes.func, /** - * Callback fired when the error associated to the current value changes. + * Callback fired when the error associated with the current value changes. * When a validation error is detected, the `error` parameter contains a non-null value. * This can be used to render an appropriate form error. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. * @param {TError} error The reason why the current value is not valid. - * @param {TValue} value The value associated to the error + * @param {TValue} value The value associated with the error. */ onError: PropTypes.func, /** diff --git a/packages/x-date-pickers-pro/src/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.tsx b/packages/x-date-pickers-pro/src/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.tsx index 25fc8def4ee62..3b4cdd1aa8648 100644 --- a/packages/x-date-pickers-pro/src/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.tsx +++ b/packages/x-date-pickers-pro/src/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.tsx @@ -22,6 +22,7 @@ import { MultiInputDateTimeRangeFieldSlotProps, } from './MultiInputDateTimeRangeField.types'; import { useMultiInputDateTimeRangeField } from '../internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField'; +import { UseDateTimeRangeFieldProps } from '../internals/models/dateTimeRange'; import { MultiInputRangeFieldClasses, RangePosition } from '../models'; export const multiInputDateTimeRangeFieldClasses: MultiInputRangeFieldClasses = @@ -89,10 +90,10 @@ const MultiInputDateTimeRangeField = React.forwardRef(function MultiInputDateTim name: 'MuiMultiInputDateTimeRangeField', }); - const { internalProps, forwardedProps } = splitFieldInternalAndForwardedProps( - themeProps, - 'date-time', - ); + const { internalProps, forwardedProps } = splitFieldInternalAndForwardedProps< + typeof themeProps, + keyof Omit, 'clearable' | 'onClear'> + >(themeProps, 'date-time'); const { slots, @@ -293,20 +294,20 @@ MultiInputDateTimeRangeField.propTypes = { minutesStep: PropTypes.number, /** * Callback fired when the value changes. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The new value. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ onChange: PropTypes.func, /** - * Callback fired when the error associated to the current value changes. + * Callback fired when the error associated with the current value changes. * When a validation error is detected, the `error` parameter contains a non-null value. * This can be used to render an appropriate form error. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. * @param {TError} error The reason why the current value is not valid. - * @param {TValue} value The value associated to the error + * @param {TValue} value The value associated with the error. */ onError: PropTypes.func, /** diff --git a/packages/x-date-pickers-pro/src/MultiInputTimeRangeField/MultiInputTimeRangeField.tsx b/packages/x-date-pickers-pro/src/MultiInputTimeRangeField/MultiInputTimeRangeField.tsx index adfca0f3dd58f..16344a1013828 100644 --- a/packages/x-date-pickers-pro/src/MultiInputTimeRangeField/MultiInputTimeRangeField.tsx +++ b/packages/x-date-pickers-pro/src/MultiInputTimeRangeField/MultiInputTimeRangeField.tsx @@ -22,6 +22,7 @@ import { MultiInputTimeRangeFieldSlotProps, } from './MultiInputTimeRangeField.types'; import { useMultiInputTimeRangeField } from '../internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField'; +import { UseTimeRangeFieldProps } from '../internals/models/timeRange'; import { MultiInputRangeFieldClasses, RangePosition } from '../models'; export const multiInputTimeRangeFieldClasses: MultiInputRangeFieldClasses = generateUtilityClasses( @@ -91,7 +92,10 @@ const MultiInputTimeRangeField = React.forwardRef(function MultiInputTimeRangeFi name: 'MuiMultiInputTimeRangeField', }); - const { internalProps, forwardedProps } = splitFieldInternalAndForwardedProps(themeProps, 'time'); + const { internalProps, forwardedProps } = splitFieldInternalAndForwardedProps< + typeof themeProps, + keyof Omit, 'clearable' | 'onClear'> + >(themeProps, 'time'); const { slots, @@ -275,20 +279,20 @@ MultiInputTimeRangeField.propTypes = { minutesStep: PropTypes.number, /** * Callback fired when the value changes. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The new value. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ onChange: PropTypes.func, /** - * Callback fired when the error associated to the current value changes. + * Callback fired when the error associated with the current value changes. * When a validation error is detected, the `error` parameter contains a non-null value. * This can be used to render an appropriate form error. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. * @param {TError} error The reason why the current value is not valid. - * @param {TValue} value The value associated to the error + * @param {TValue} value The value associated with the error. */ onError: PropTypes.func, /** diff --git a/packages/x-date-pickers-pro/src/SingleInputDateRangeField/SingleInputDateRangeField.tsx b/packages/x-date-pickers-pro/src/SingleInputDateRangeField/SingleInputDateRangeField.tsx index 88e25ad3ff8e6..e9df9fc89acfd 100644 --- a/packages/x-date-pickers-pro/src/SingleInputDateRangeField/SingleInputDateRangeField.tsx +++ b/packages/x-date-pickers-pro/src/SingleInputDateRangeField/SingleInputDateRangeField.tsx @@ -218,8 +218,8 @@ SingleInputDateRangeField.propTypes = { onBlur: PropTypes.func, /** * Callback fired when the value changes. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The new value. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ @@ -229,13 +229,13 @@ SingleInputDateRangeField.propTypes = { */ onClear: PropTypes.func, /** - * Callback fired when the error associated to the current value changes. + * Callback fired when the error associated with the current value changes. * When a validation error is detected, the `error` parameter contains a non-null value. * This can be used to render an appropriate form error. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. * @param {TError} error The reason why the current value is not valid. - * @param {TValue} value The value associated to the error + * @param {TValue} value The value associated with the error. */ onError: PropTypes.func, onFocus: PropTypes.func, diff --git a/packages/x-date-pickers-pro/src/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.tsx b/packages/x-date-pickers-pro/src/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.tsx index aded6d5ac2052..579c6a62010f6 100644 --- a/packages/x-date-pickers-pro/src/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.tsx +++ b/packages/x-date-pickers-pro/src/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.tsx @@ -251,8 +251,8 @@ SingleInputDateTimeRangeField.propTypes = { onBlur: PropTypes.func, /** * Callback fired when the value changes. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The new value. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ @@ -262,13 +262,13 @@ SingleInputDateTimeRangeField.propTypes = { */ onClear: PropTypes.func, /** - * Callback fired when the error associated to the current value changes. + * Callback fired when the error associated with the current value changes. * When a validation error is detected, the `error` parameter contains a non-null value. * This can be used to render an appropriate form error. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. * @param {TError} error The reason why the current value is not valid. - * @param {TValue} value The value associated to the error + * @param {TValue} value The value associated with the error. */ onError: PropTypes.func, onFocus: PropTypes.func, diff --git a/packages/x-date-pickers-pro/src/SingleInputTimeRangeField/SingleInputTimeRangeField.tsx b/packages/x-date-pickers-pro/src/SingleInputTimeRangeField/SingleInputTimeRangeField.tsx index 414b36c21cf21..73bf67c73ac39 100644 --- a/packages/x-date-pickers-pro/src/SingleInputTimeRangeField/SingleInputTimeRangeField.tsx +++ b/packages/x-date-pickers-pro/src/SingleInputTimeRangeField/SingleInputTimeRangeField.tsx @@ -233,8 +233,8 @@ SingleInputTimeRangeField.propTypes = { onBlur: PropTypes.func, /** * Callback fired when the value changes. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The new value. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ @@ -244,13 +244,13 @@ SingleInputTimeRangeField.propTypes = { */ onClear: PropTypes.func, /** - * Callback fired when the error associated to the current value changes. + * Callback fired when the error associated with the current value changes. * When a validation error is detected, the `error` parameter contains a non-null value. * This can be used to render an appropriate form error. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. * @param {TError} error The reason why the current value is not valid. - * @param {TValue} value The value associated to the error + * @param {TValue} value The value associated with the error. */ onError: PropTypes.func, onFocus: PropTypes.func, diff --git a/packages/x-date-pickers-pro/src/StaticDateRangePicker/StaticDateRangePicker.tsx b/packages/x-date-pickers-pro/src/StaticDateRangePicker/StaticDateRangePicker.tsx index 163cfddca378b..5283f9efdac60 100644 --- a/packages/x-date-pickers-pro/src/StaticDateRangePicker/StaticDateRangePicker.tsx +++ b/packages/x-date-pickers-pro/src/StaticDateRangePicker/StaticDateRangePicker.tsx @@ -7,7 +7,7 @@ import { StaticDateRangePickerProps } from './StaticDateRangePicker.types'; import { useDateRangePickerDefaultizedProps } from '../DateRangePicker/shared'; import { renderDateRangeViewCalendar } from '../dateRangeViewRenderers'; import { rangeValueManager } from '../internals/utils/valueManagers'; -import { validateDateRange } from '../validation'; +import { validateDateRange } from '../internals/utils/validation/validateDateRange'; import { DateRange } from '../models'; type StaticDateRangePickerComponent = (( @@ -175,16 +175,16 @@ StaticDateRangePicker.propTypes = { minDate: PropTypes.object, /** * Callback fired when the value is accepted. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The value that was just accepted. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ onAccept: PropTypes.func, /** * Callback fired when the value changes. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The new value. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ @@ -196,13 +196,13 @@ StaticDateRangePicker.propTypes = { */ onClose: PropTypes.func, /** - * Callback fired when the error associated to the current value changes. + * Callback fired when the error associated with the current value changes. * When a validation error is detected, the `error` parameter contains a non-null value. * This can be used to render an appropriate form error. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. * @param {TError} error The reason why the current value is not valid. - * @param {TValue} value The value associated to the error + * @param {TValue} value The value associated with the error. */ onError: PropTypes.func, /** diff --git a/packages/x-date-pickers/src/DateCalendar/DateCalendar.tsx b/packages/x-date-pickers/src/DateCalendar/DateCalendar.tsx index 765f75bd9fbe2..380dae01c035e 100644 --- a/packages/x-date-pickers/src/DateCalendar/DateCalendar.tsx +++ b/packages/x-date-pickers/src/DateCalendar/DateCalendar.tsx @@ -487,7 +487,7 @@ DateCalendar.propTypes = { monthsPerRow: PropTypes.oneOf([3, 4]), /** * Callback fired when the value changes. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. * @template TView The view type. Will be one of date or time views. * @param {TValue} value The new value. * @param {PickerSelectionState | undefined} selectionState Indicates if the date selection is complete. diff --git a/packages/x-date-pickers/src/DateField/DateField.tsx b/packages/x-date-pickers/src/DateField/DateField.tsx index 9a8b2f4d5bb15..7f6a1ec7ed458 100644 --- a/packages/x-date-pickers/src/DateField/DateField.tsx +++ b/packages/x-date-pickers/src/DateField/DateField.tsx @@ -210,8 +210,8 @@ DateField.propTypes = { onBlur: PropTypes.func, /** * Callback fired when the value changes. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The new value. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ @@ -221,13 +221,13 @@ DateField.propTypes = { */ onClear: PropTypes.func, /** - * Callback fired when the error associated to the current value changes. + * Callback fired when the error associated with the current value changes. * When a validation error is detected, the `error` parameter contains a non-null value. * This can be used to render an appropriate form error. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. * @param {TError} error The reason why the current value is not valid. - * @param {TValue} value The value associated to the error + * @param {TValue} value The value associated with the error. */ onError: PropTypes.func, onFocus: PropTypes.func, diff --git a/packages/x-date-pickers/src/DatePicker/DatePicker.tsx b/packages/x-date-pickers/src/DatePicker/DatePicker.tsx index 15836ef4d4c1d..a75adf37b6e27 100644 --- a/packages/x-date-pickers/src/DatePicker/DatePicker.tsx +++ b/packages/x-date-pickers/src/DatePicker/DatePicker.tsx @@ -173,16 +173,16 @@ DatePicker.propTypes = { name: PropTypes.string, /** * Callback fired when the value is accepted. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The value that was just accepted. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ onAccept: PropTypes.func, /** * Callback fired when the value changes. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The new value. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ @@ -193,13 +193,13 @@ DatePicker.propTypes = { */ onClose: PropTypes.func, /** - * Callback fired when the error associated to the current value changes. + * Callback fired when the error associated with the current value changes. * When a validation error is detected, the `error` parameter contains a non-null value. * This can be used to render an appropriate form error. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. * @param {TError} error The reason why the current value is not valid. - * @param {TValue} value The value associated to the error + * @param {TValue} value The value associated with the error. */ onError: PropTypes.func, /** diff --git a/packages/x-date-pickers/src/DateTimeField/DateTimeField.tsx b/packages/x-date-pickers/src/DateTimeField/DateTimeField.tsx index 1b56a21d24e3b..ab78822ead2cb 100644 --- a/packages/x-date-pickers/src/DateTimeField/DateTimeField.tsx +++ b/packages/x-date-pickers/src/DateTimeField/DateTimeField.tsx @@ -243,8 +243,8 @@ DateTimeField.propTypes = { onBlur: PropTypes.func, /** * Callback fired when the value changes. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The new value. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ @@ -254,13 +254,13 @@ DateTimeField.propTypes = { */ onClear: PropTypes.func, /** - * Callback fired when the error associated to the current value changes. + * Callback fired when the error associated with the current value changes. * When a validation error is detected, the `error` parameter contains a non-null value. * This can be used to render an appropriate form error. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. * @param {TError} error The reason why the current value is not valid. - * @param {TValue} value The value associated to the error + * @param {TValue} value The value associated with the error. */ onError: PropTypes.func, onFocus: PropTypes.func, diff --git a/packages/x-date-pickers/src/DateTimePicker/DateTimePicker.tsx b/packages/x-date-pickers/src/DateTimePicker/DateTimePicker.tsx index 6008984bf9b9c..fc5cab3f50edd 100644 --- a/packages/x-date-pickers/src/DateTimePicker/DateTimePicker.tsx +++ b/packages/x-date-pickers/src/DateTimePicker/DateTimePicker.tsx @@ -211,16 +211,16 @@ DateTimePicker.propTypes = { name: PropTypes.string, /** * Callback fired when the value is accepted. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The value that was just accepted. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ onAccept: PropTypes.func, /** * Callback fired when the value changes. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The new value. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ @@ -231,13 +231,13 @@ DateTimePicker.propTypes = { */ onClose: PropTypes.func, /** - * Callback fired when the error associated to the current value changes. + * Callback fired when the error associated with the current value changes. * When a validation error is detected, the `error` parameter contains a non-null value. * This can be used to render an appropriate form error. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. * @param {TError} error The reason why the current value is not valid. - * @param {TValue} value The value associated to the error + * @param {TValue} value The value associated with the error. */ onError: PropTypes.func, /** diff --git a/packages/x-date-pickers/src/DesktopDatePicker/DesktopDatePicker.tsx b/packages/x-date-pickers/src/DesktopDatePicker/DesktopDatePicker.tsx index df305d499291f..663e4174dd445 100644 --- a/packages/x-date-pickers/src/DesktopDatePicker/DesktopDatePicker.tsx +++ b/packages/x-date-pickers/src/DesktopDatePicker/DesktopDatePicker.tsx @@ -7,11 +7,12 @@ import { DesktopDatePickerProps } from './DesktopDatePicker.types'; import { DatePickerViewRenderers, useDatePickerDefaultizedProps } from '../DatePicker/shared'; import { usePickersTranslations } from '../hooks/usePickersTranslations'; import { useUtils } from '../internals/hooks/useUtils'; +import { validateDate } from '../internals/utils/validation/validateDate'; import { DateView, PickerValidDate } from '../models'; import { useDesktopPicker } from '../internals/hooks/useDesktopPicker'; import { CalendarIcon } from '../icons'; import { DateField } from '../DateField'; -import { extractValidationProps, validateDate } from '../validation'; +import { extractValidationProps } from '../internals/utils/validation/extractValidationProps'; import { renderDateViewCalendar } from '../dateViewRenderers'; import { resolveDateFormat } from '../internals/utils/date-utils'; @@ -217,16 +218,16 @@ DesktopDatePicker.propTypes = { name: PropTypes.string, /** * Callback fired when the value is accepted. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The value that was just accepted. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ onAccept: PropTypes.func, /** * Callback fired when the value changes. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The new value. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ @@ -237,13 +238,13 @@ DesktopDatePicker.propTypes = { */ onClose: PropTypes.func, /** - * Callback fired when the error associated to the current value changes. + * Callback fired when the error associated with the current value changes. * When a validation error is detected, the `error` parameter contains a non-null value. * This can be used to render an appropriate form error. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. * @param {TError} error The reason why the current value is not valid. - * @param {TValue} value The value associated to the error + * @param {TValue} value The value associated with the error. */ onError: PropTypes.func, /** diff --git a/packages/x-date-pickers/src/DesktopDateTimePicker/DesktopDateTimePicker.tsx b/packages/x-date-pickers/src/DesktopDateTimePicker/DesktopDateTimePicker.tsx index cdc5ab894cb57..08342cd65fa6c 100644 --- a/packages/x-date-pickers/src/DesktopDateTimePicker/DesktopDateTimePicker.tsx +++ b/packages/x-date-pickers/src/DesktopDateTimePicker/DesktopDateTimePicker.tsx @@ -13,10 +13,11 @@ import { import { renderDateViewCalendar } from '../dateViewRenderers/dateViewRenderers'; import { usePickersTranslations } from '../hooks/usePickersTranslations'; import { useUtils } from '../internals/hooks/useUtils'; +import { validateDateTime } from '../internals/utils/validation/validateDateTime'; import { DateOrTimeViewWithMeridiem } from '../internals/models'; import { CalendarIcon } from '../icons'; import { UseDesktopPickerProps, useDesktopPicker } from '../internals/hooks/useDesktopPicker'; -import { extractValidationProps, validateDateTime } from '../validation'; +import { extractValidationProps } from '../internals/utils/validation/extractValidationProps'; import { PickerViewsRendererProps } from '../internals/hooks/usePicker'; import { resolveDateTimeFormat, @@ -391,16 +392,16 @@ DesktopDateTimePicker.propTypes = { name: PropTypes.string, /** * Callback fired when the value is accepted. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The value that was just accepted. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ onAccept: PropTypes.func, /** * Callback fired when the value changes. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The new value. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ @@ -411,13 +412,13 @@ DesktopDateTimePicker.propTypes = { */ onClose: PropTypes.func, /** - * Callback fired when the error associated to the current value changes. + * Callback fired when the error associated with the current value changes. * When a validation error is detected, the `error` parameter contains a non-null value. * This can be used to render an appropriate form error. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. * @param {TError} error The reason why the current value is not valid. - * @param {TValue} value The value associated to the error + * @param {TValue} value The value associated with the error. */ onError: PropTypes.func, /** diff --git a/packages/x-date-pickers/src/DesktopTimePicker/DesktopTimePicker.tsx b/packages/x-date-pickers/src/DesktopTimePicker/DesktopTimePicker.tsx index aecc9706b9df6..7a24c686d98df 100644 --- a/packages/x-date-pickers/src/DesktopTimePicker/DesktopTimePicker.tsx +++ b/packages/x-date-pickers/src/DesktopTimePicker/DesktopTimePicker.tsx @@ -8,9 +8,9 @@ import { DesktopTimePickerProps } from './DesktopTimePicker.types'; import { TimePickerViewRenderers, useTimePickerDefaultizedProps } from '../TimePicker/shared'; import { usePickersTranslations } from '../hooks/usePickersTranslations'; import { useUtils } from '../internals/hooks/useUtils'; +import { extractValidationProps, validateTime } from '../validation'; import { ClockIcon } from '../icons'; import { useDesktopPicker } from '../internals/hooks/useDesktopPicker'; -import { extractValidationProps, validateTime } from '../validation'; import { renderDigitalClockTimeView, renderMultiSectionDigitalClockTimeView, @@ -243,16 +243,16 @@ DesktopTimePicker.propTypes = { name: PropTypes.string, /** * Callback fired when the value is accepted. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The value that was just accepted. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ onAccept: PropTypes.func, /** * Callback fired when the value changes. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The new value. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ @@ -263,13 +263,13 @@ DesktopTimePicker.propTypes = { */ onClose: PropTypes.func, /** - * Callback fired when the error associated to the current value changes. + * Callback fired when the error associated with the current value changes. * When a validation error is detected, the `error` parameter contains a non-null value. * This can be used to render an appropriate form error. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. * @param {TError} error The reason why the current value is not valid. - * @param {TValue} value The value associated to the error + * @param {TValue} value The value associated with the error. */ onError: PropTypes.func, /** diff --git a/packages/x-date-pickers/src/DigitalClock/DigitalClock.tsx b/packages/x-date-pickers/src/DigitalClock/DigitalClock.tsx index e2e2c75585409..5119b2b0b6436 100644 --- a/packages/x-date-pickers/src/DigitalClock/DigitalClock.tsx +++ b/packages/x-date-pickers/src/DigitalClock/DigitalClock.tsx @@ -405,7 +405,7 @@ DigitalClock.propTypes = { minutesStep: PropTypes.number, /** * Callback fired when the value changes. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. * @template TView The view type. Will be one of date or time views. * @param {TValue} value The new value. * @param {PickerSelectionState | undefined} selectionState Indicates if the date selection is complete. diff --git a/packages/x-date-pickers/src/MobileDatePicker/MobileDatePicker.tsx b/packages/x-date-pickers/src/MobileDatePicker/MobileDatePicker.tsx index bfe87f5b6f3cc..3ecf12174a89b 100644 --- a/packages/x-date-pickers/src/MobileDatePicker/MobileDatePicker.tsx +++ b/packages/x-date-pickers/src/MobileDatePicker/MobileDatePicker.tsx @@ -7,9 +7,9 @@ import { MobileDatePickerProps } from './MobileDatePicker.types'; import { DatePickerViewRenderers, useDatePickerDefaultizedProps } from '../DatePicker/shared'; import { usePickersTranslations } from '../hooks/usePickersTranslations'; import { useUtils } from '../internals/hooks/useUtils'; +import { extractValidationProps, validateDate } from '../validation'; import { DateView, PickerValidDate } from '../models'; import { DateField } from '../DateField'; -import { extractValidationProps, validateDate } from '../validation'; import { singleItemValueManager } from '../internals/utils/valueManagers'; import { renderDateViewCalendar } from '../dateViewRenderers'; import { resolveDateFormat } from '../internals/utils/date-utils'; @@ -214,16 +214,16 @@ MobileDatePicker.propTypes = { name: PropTypes.string, /** * Callback fired when the value is accepted. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The value that was just accepted. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ onAccept: PropTypes.func, /** * Callback fired when the value changes. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The new value. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ @@ -234,13 +234,13 @@ MobileDatePicker.propTypes = { */ onClose: PropTypes.func, /** - * Callback fired when the error associated to the current value changes. + * Callback fired when the error associated with the current value changes. * When a validation error is detected, the `error` parameter contains a non-null value. * This can be used to render an appropriate form error. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. * @param {TError} error The reason why the current value is not valid. - * @param {TValue} value The value associated to the error + * @param {TValue} value The value associated with the error. */ onError: PropTypes.func, /** diff --git a/packages/x-date-pickers/src/MobileDateTimePicker/MobileDateTimePicker.tsx b/packages/x-date-pickers/src/MobileDateTimePicker/MobileDateTimePicker.tsx index 24ede5a090c77..5ee3e390f4f2a 100644 --- a/packages/x-date-pickers/src/MobileDateTimePicker/MobileDateTimePicker.tsx +++ b/packages/x-date-pickers/src/MobileDateTimePicker/MobileDateTimePicker.tsx @@ -11,9 +11,9 @@ import { } from '../DateTimePicker/shared'; import { usePickersTranslations } from '../hooks/usePickersTranslations'; import { useUtils } from '../internals/hooks/useUtils'; +import { extractValidationProps, validateDateTime } from '../validation'; import { DateOrTimeView, PickerValidDate } from '../models'; import { useMobilePicker } from '../internals/hooks/useMobilePicker'; -import { extractValidationProps, validateDateTime } from '../validation'; import { renderDateViewCalendar } from '../dateViewRenderers'; import { renderTimeViewClock } from '../timeViewRenderers'; import { resolveDateTimeFormat } from '../internals/utils/date-time-utils'; @@ -267,16 +267,16 @@ MobileDateTimePicker.propTypes = { name: PropTypes.string, /** * Callback fired when the value is accepted. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The value that was just accepted. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ onAccept: PropTypes.func, /** * Callback fired when the value changes. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The new value. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ @@ -287,13 +287,13 @@ MobileDateTimePicker.propTypes = { */ onClose: PropTypes.func, /** - * Callback fired when the error associated to the current value changes. + * Callback fired when the error associated with the current value changes. * When a validation error is detected, the `error` parameter contains a non-null value. * This can be used to render an appropriate form error. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. * @param {TError} error The reason why the current value is not valid. - * @param {TValue} value The value associated to the error + * @param {TValue} value The value associated with the error. */ onError: PropTypes.func, /** diff --git a/packages/x-date-pickers/src/MobileTimePicker/MobileTimePicker.tsx b/packages/x-date-pickers/src/MobileTimePicker/MobileTimePicker.tsx index d0c69b038c5b0..5c2c0435eb59b 100644 --- a/packages/x-date-pickers/src/MobileTimePicker/MobileTimePicker.tsx +++ b/packages/x-date-pickers/src/MobileTimePicker/MobileTimePicker.tsx @@ -8,9 +8,9 @@ import { MobileTimePickerProps } from './MobileTimePicker.types'; import { TimePickerViewRenderers, useTimePickerDefaultizedProps } from '../TimePicker/shared'; import { usePickersTranslations } from '../hooks/usePickersTranslations'; import { useUtils } from '../internals/hooks/useUtils'; +import { extractValidationProps, validateTime } from '../validation'; import { PickerValidDate, TimeView } from '../models'; import { useMobilePicker } from '../internals/hooks/useMobilePicker'; -import { extractValidationProps, validateTime } from '../validation'; import { renderTimeViewClock } from '../timeViewRenderers'; import { resolveTimeFormat } from '../internals/utils/time-utils'; @@ -206,16 +206,16 @@ MobileTimePicker.propTypes = { name: PropTypes.string, /** * Callback fired when the value is accepted. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The value that was just accepted. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ onAccept: PropTypes.func, /** * Callback fired when the value changes. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The new value. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ @@ -226,13 +226,13 @@ MobileTimePicker.propTypes = { */ onClose: PropTypes.func, /** - * Callback fired when the error associated to the current value changes. + * Callback fired when the error associated with the current value changes. * When a validation error is detected, the `error` parameter contains a non-null value. * This can be used to render an appropriate form error. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. * @param {TError} error The reason why the current value is not valid. - * @param {TValue} value The value associated to the error + * @param {TValue} value The value associated with the error. */ onError: PropTypes.func, /** diff --git a/packages/x-date-pickers/src/MultiSectionDigitalClock/MultiSectionDigitalClock.tsx b/packages/x-date-pickers/src/MultiSectionDigitalClock/MultiSectionDigitalClock.tsx index 39a8b24956603..dabbbb69619bf 100644 --- a/packages/x-date-pickers/src/MultiSectionDigitalClock/MultiSectionDigitalClock.tsx +++ b/packages/x-date-pickers/src/MultiSectionDigitalClock/MultiSectionDigitalClock.tsx @@ -511,7 +511,7 @@ MultiSectionDigitalClock.propTypes = { minutesStep: PropTypes.number, /** * Callback fired when the value changes. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. * @template TView The view type. Will be one of date or time views. * @param {TValue} value The new value. * @param {PickerSelectionState | undefined} selectionState Indicates if the date selection is complete. diff --git a/packages/x-date-pickers/src/StaticDatePicker/StaticDatePicker.tsx b/packages/x-date-pickers/src/StaticDatePicker/StaticDatePicker.tsx index a17c01f09a799..46e6308aba4d7 100644 --- a/packages/x-date-pickers/src/StaticDatePicker/StaticDatePicker.tsx +++ b/packages/x-date-pickers/src/StaticDatePicker/StaticDatePicker.tsx @@ -153,16 +153,16 @@ StaticDatePicker.propTypes = { monthsPerRow: PropTypes.oneOf([3, 4]), /** * Callback fired when the value is accepted. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The value that was just accepted. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ onAccept: PropTypes.func, /** * Callback fired when the value changes. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The new value. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ @@ -174,13 +174,13 @@ StaticDatePicker.propTypes = { */ onClose: PropTypes.func, /** - * Callback fired when the error associated to the current value changes. + * Callback fired when the error associated with the current value changes. * When a validation error is detected, the `error` parameter contains a non-null value. * This can be used to render an appropriate form error. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. * @param {TError} error The reason why the current value is not valid. - * @param {TValue} value The value associated to the error + * @param {TValue} value The value associated with the error. */ onError: PropTypes.func, /** diff --git a/packages/x-date-pickers/src/StaticDateTimePicker/StaticDateTimePicker.tsx b/packages/x-date-pickers/src/StaticDateTimePicker/StaticDateTimePicker.tsx index 50cab5e658830..f1f7a5005e494 100644 --- a/packages/x-date-pickers/src/StaticDateTimePicker/StaticDateTimePicker.tsx +++ b/packages/x-date-pickers/src/StaticDateTimePicker/StaticDateTimePicker.tsx @@ -205,16 +205,16 @@ StaticDateTimePicker.propTypes = { monthsPerRow: PropTypes.oneOf([3, 4]), /** * Callback fired when the value is accepted. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The value that was just accepted. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ onAccept: PropTypes.func, /** * Callback fired when the value changes. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The new value. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ @@ -226,13 +226,13 @@ StaticDateTimePicker.propTypes = { */ onClose: PropTypes.func, /** - * Callback fired when the error associated to the current value changes. + * Callback fired when the error associated with the current value changes. * When a validation error is detected, the `error` parameter contains a non-null value. * This can be used to render an appropriate form error. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. * @param {TError} error The reason why the current value is not valid. - * @param {TValue} value The value associated to the error + * @param {TValue} value The value associated with the error. */ onError: PropTypes.func, /** diff --git a/packages/x-date-pickers/src/StaticTimePicker/StaticTimePicker.tsx b/packages/x-date-pickers/src/StaticTimePicker/StaticTimePicker.tsx index 14a4a493badd3..31a54d09e0db9 100644 --- a/packages/x-date-pickers/src/StaticTimePicker/StaticTimePicker.tsx +++ b/packages/x-date-pickers/src/StaticTimePicker/StaticTimePicker.tsx @@ -144,16 +144,16 @@ StaticTimePicker.propTypes = { minutesStep: PropTypes.number, /** * Callback fired when the value is accepted. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The value that was just accepted. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ onAccept: PropTypes.func, /** * Callback fired when the value changes. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The new value. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ @@ -165,13 +165,13 @@ StaticTimePicker.propTypes = { */ onClose: PropTypes.func, /** - * Callback fired when the error associated to the current value changes. + * Callback fired when the error associated with the current value changes. * When a validation error is detected, the `error` parameter contains a non-null value. * This can be used to render an appropriate form error. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. * @param {TError} error The reason why the current value is not valid. - * @param {TValue} value The value associated to the error + * @param {TValue} value The value associated with the error. */ onError: PropTypes.func, /** diff --git a/packages/x-date-pickers/src/TimeClock/TimeClock.tsx b/packages/x-date-pickers/src/TimeClock/TimeClock.tsx index ee896e15730ea..44a9581ea1026 100644 --- a/packages/x-date-pickers/src/TimeClock/TimeClock.tsx +++ b/packages/x-date-pickers/src/TimeClock/TimeClock.tsx @@ -460,7 +460,7 @@ TimeClock.propTypes = { minutesStep: PropTypes.number, /** * Callback fired when the value changes. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. * @template TView The view type. Will be one of date or time views. * @param {TValue} value The new value. * @param {PickerSelectionState | undefined} selectionState Indicates if the date selection is complete. diff --git a/packages/x-date-pickers/src/TimeField/TimeField.tsx b/packages/x-date-pickers/src/TimeField/TimeField.tsx index e11d67c90237a..d609f295ecd63 100644 --- a/packages/x-date-pickers/src/TimeField/TimeField.tsx +++ b/packages/x-date-pickers/src/TimeField/TimeField.tsx @@ -225,8 +225,8 @@ TimeField.propTypes = { onBlur: PropTypes.func, /** * Callback fired when the value changes. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The new value. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ @@ -236,13 +236,13 @@ TimeField.propTypes = { */ onClear: PropTypes.func, /** - * Callback fired when the error associated to the current value changes. + * Callback fired when the error associated with the current value changes. * When a validation error is detected, the `error` parameter contains a non-null value. * This can be used to render an appropriate form error. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. * @param {TError} error The reason why the current value is not valid. - * @param {TValue} value The value associated to the error + * @param {TValue} value The value associated with the error. */ onError: PropTypes.func, onFocus: PropTypes.func, diff --git a/packages/x-date-pickers/src/TimePicker/TimePicker.tsx b/packages/x-date-pickers/src/TimePicker/TimePicker.tsx index ffdf2a0602577..534bead56e177 100644 --- a/packages/x-date-pickers/src/TimePicker/TimePicker.tsx +++ b/packages/x-date-pickers/src/TimePicker/TimePicker.tsx @@ -161,16 +161,16 @@ TimePicker.propTypes = { name: PropTypes.string, /** * Callback fired when the value is accepted. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The value that was just accepted. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ onAccept: PropTypes.func, /** * Callback fired when the value changes. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The new value. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ @@ -181,13 +181,13 @@ TimePicker.propTypes = { */ onClose: PropTypes.func, /** - * Callback fired when the error associated to the current value changes. + * Callback fired when the error associated with the current value changes. * When a validation error is detected, the `error` parameter contains a non-null value. * This can be used to render an appropriate form error. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. * @param {TError} error The reason why the current value is not valid. - * @param {TValue} value The value associated to the error + * @param {TValue} value The value associated with the error. */ onError: PropTypes.func, /** diff --git a/packages/x-date-pickers/src/internals/hooks/useField/useField.types.ts b/packages/x-date-pickers/src/internals/hooks/useField/useField.types.ts index 2d4d0c292e12a..e558a7b3b7ee9 100644 --- a/packages/x-date-pickers/src/internals/hooks/useField/useField.types.ts +++ b/packages/x-date-pickers/src/internals/hooks/useField/useField.types.ts @@ -67,8 +67,8 @@ export interface UseFieldInternalProps< referenceDate?: TDate; /** * Callback fired when the value changes. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The new value. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ diff --git a/packages/x-date-pickers/src/internals/hooks/usePicker/usePickerValue.types.ts b/packages/x-date-pickers/src/internals/hooks/usePicker/usePickerValue.types.ts index 94c43c8c3c1b6..a2882f62f57fd 100644 --- a/packages/x-date-pickers/src/internals/hooks/usePicker/usePickerValue.types.ts +++ b/packages/x-date-pickers/src/internals/hooks/usePicker/usePickerValue.types.ts @@ -221,16 +221,16 @@ export interface UsePickerValueBaseProps extends OnErrorProps} context The context containing the validation result of the current value. */ onChange?: (value: TValue, context: PickerChangeHandlerContext) => void; /** * Callback fired when the value is accepted. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. * @param {TValue} value The value that was just accepted. * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value. */ diff --git a/packages/x-date-pickers/src/internals/hooks/useViews.tsx b/packages/x-date-pickers/src/internals/hooks/useViews.tsx index c5c25387d2bf5..e76c9f792049c 100644 --- a/packages/x-date-pickers/src/internals/hooks/useViews.tsx +++ b/packages/x-date-pickers/src/internals/hooks/useViews.tsx @@ -14,7 +14,7 @@ export type PickerOnChangeFn = ( export interface UseViewsOptions { /** * Callback fired when the value changes. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. * @template TView The view type. Will be one of date or time views. * @param {TValue} value The new value. * @param {PickerSelectionState | undefined} selectionState Indicates if the date selection is complete. diff --git a/packages/x-date-pickers/src/models/validation.ts b/packages/x-date-pickers/src/models/validation.ts index 6d25a672e0f63..5dcee050db5ff 100644 --- a/packages/x-date-pickers/src/models/validation.ts +++ b/packages/x-date-pickers/src/models/validation.ts @@ -24,13 +24,13 @@ export type DateTimeValidationError = DateValidationError | TimeValidationError; export interface OnErrorProps { /** - * Callback fired when the error associated to the current value changes. + * Callback fired when the error associated with the current value changes. * When a validation error is detected, the `error` parameter contains a non-null value. * This can be used to render an appropriate form error. - * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. - * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. + * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value. + * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. * @param {TError} error The reason why the current value is not valid. - * @param {TValue} value The value associated to the error + * @param {TValue} value The value associated with the error. */ onError?: (error: TError, value: TValue) => void; }