Skip to content

Commit

Permalink
[pickers] Add context to onAccept callback (mui#13511)
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviendelangle authored and thomasmoon committed Sep 6, 2024
1 parent e13cfaa commit f138e04
Show file tree
Hide file tree
Showing 59 changed files with 218 additions and 57 deletions.
5 changes: 4 additions & 1 deletion docs/pages/x/api/date-pickers/date-picker.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@
"name": { "type": { "name": "string" } },
"onAccept": {
"type": { "name": "func" },
"signature": { "type": "function(value: TValue) => void", "describedArgs": ["value"] }
"signature": {
"type": "function(value: TValue, context: FieldChangeHandlerContext<TError>) => void",
"describedArgs": ["value", "context"]
}
},
"onChange": {
"type": { "name": "func" },
Expand Down
5 changes: 4 additions & 1 deletion docs/pages/x/api/date-pickers/date-range-picker.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@
"name": { "type": { "name": "string" } },
"onAccept": {
"type": { "name": "func" },
"signature": { "type": "function(value: TValue) => void", "describedArgs": ["value"] }
"signature": {
"type": "function(value: TValue, context: FieldChangeHandlerContext<TError>) => void",
"describedArgs": ["value", "context"]
}
},
"onChange": {
"type": { "name": "func" },
Expand Down
5 changes: 4 additions & 1 deletion docs/pages/x/api/date-pickers/date-time-picker.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@
"name": { "type": { "name": "string" } },
"onAccept": {
"type": { "name": "func" },
"signature": { "type": "function(value: TValue) => void", "describedArgs": ["value"] }
"signature": {
"type": "function(value: TValue, context: FieldChangeHandlerContext<TError>) => void",
"describedArgs": ["value", "context"]
}
},
"onChange": {
"type": { "name": "func" },
Expand Down
5 changes: 4 additions & 1 deletion docs/pages/x/api/date-pickers/date-time-range-picker.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@
"name": { "type": { "name": "string" } },
"onAccept": {
"type": { "name": "func" },
"signature": { "type": "function(value: TValue) => void", "describedArgs": ["value"] }
"signature": {
"type": "function(value: TValue, context: FieldChangeHandlerContext<TError>) => void",
"describedArgs": ["value", "context"]
}
},
"onChange": {
"type": { "name": "func" },
Expand Down
5 changes: 4 additions & 1 deletion docs/pages/x/api/date-pickers/desktop-date-picker.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@
"name": { "type": { "name": "string" } },
"onAccept": {
"type": { "name": "func" },
"signature": { "type": "function(value: TValue) => void", "describedArgs": ["value"] }
"signature": {
"type": "function(value: TValue, context: FieldChangeHandlerContext<TError>) => void",
"describedArgs": ["value", "context"]
}
},
"onChange": {
"type": { "name": "func" },
Expand Down
5 changes: 4 additions & 1 deletion docs/pages/x/api/date-pickers/desktop-date-range-picker.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@
"name": { "type": { "name": "string" } },
"onAccept": {
"type": { "name": "func" },
"signature": { "type": "function(value: TValue) => void", "describedArgs": ["value"] }
"signature": {
"type": "function(value: TValue, context: FieldChangeHandlerContext<TError>) => void",
"describedArgs": ["value", "context"]
}
},
"onChange": {
"type": { "name": "func" },
Expand Down
5 changes: 4 additions & 1 deletion docs/pages/x/api/date-pickers/desktop-date-time-picker.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@
"name": { "type": { "name": "string" } },
"onAccept": {
"type": { "name": "func" },
"signature": { "type": "function(value: TValue) => void", "describedArgs": ["value"] }
"signature": {
"type": "function(value: TValue, context: FieldChangeHandlerContext<TError>) => void",
"describedArgs": ["value", "context"]
}
},
"onChange": {
"type": { "name": "func" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@
"name": { "type": { "name": "string" } },
"onAccept": {
"type": { "name": "func" },
"signature": { "type": "function(value: TValue) => void", "describedArgs": ["value"] }
"signature": {
"type": "function(value: TValue, context: FieldChangeHandlerContext<TError>) => void",
"describedArgs": ["value", "context"]
}
},
"onChange": {
"type": { "name": "func" },
Expand Down
5 changes: 4 additions & 1 deletion docs/pages/x/api/date-pickers/desktop-time-picker.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@
"name": { "type": { "name": "string" } },
"onAccept": {
"type": { "name": "func" },
"signature": { "type": "function(value: TValue) => void", "describedArgs": ["value"] }
"signature": {
"type": "function(value: TValue, context: FieldChangeHandlerContext<TError>) => void",
"describedArgs": ["value", "context"]
}
},
"onChange": {
"type": { "name": "func" },
Expand Down
5 changes: 4 additions & 1 deletion docs/pages/x/api/date-pickers/mobile-date-picker.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@
"name": { "type": { "name": "string" } },
"onAccept": {
"type": { "name": "func" },
"signature": { "type": "function(value: TValue) => void", "describedArgs": ["value"] }
"signature": {
"type": "function(value: TValue, context: FieldChangeHandlerContext<TError>) => void",
"describedArgs": ["value", "context"]
}
},
"onChange": {
"type": { "name": "func" },
Expand Down
5 changes: 4 additions & 1 deletion docs/pages/x/api/date-pickers/mobile-date-range-picker.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@
"name": { "type": { "name": "string" } },
"onAccept": {
"type": { "name": "func" },
"signature": { "type": "function(value: TValue) => void", "describedArgs": ["value"] }
"signature": {
"type": "function(value: TValue, context: FieldChangeHandlerContext<TError>) => void",
"describedArgs": ["value", "context"]
}
},
"onChange": {
"type": { "name": "func" },
Expand Down
5 changes: 4 additions & 1 deletion docs/pages/x/api/date-pickers/mobile-date-time-picker.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@
"name": { "type": { "name": "string" } },
"onAccept": {
"type": { "name": "func" },
"signature": { "type": "function(value: TValue) => void", "describedArgs": ["value"] }
"signature": {
"type": "function(value: TValue, context: FieldChangeHandlerContext<TError>) => void",
"describedArgs": ["value", "context"]
}
},
"onChange": {
"type": { "name": "func" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@
"name": { "type": { "name": "string" } },
"onAccept": {
"type": { "name": "func" },
"signature": { "type": "function(value: TValue) => void", "describedArgs": ["value"] }
"signature": {
"type": "function(value: TValue, context: FieldChangeHandlerContext<TError>) => void",
"describedArgs": ["value", "context"]
}
},
"onChange": {
"type": { "name": "func" },
Expand Down
5 changes: 4 additions & 1 deletion docs/pages/x/api/date-pickers/mobile-time-picker.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@
"name": { "type": { "name": "string" } },
"onAccept": {
"type": { "name": "func" },
"signature": { "type": "function(value: TValue) => void", "describedArgs": ["value"] }
"signature": {
"type": "function(value: TValue, context: FieldChangeHandlerContext<TError>) => void",
"describedArgs": ["value", "context"]
}
},
"onChange": {
"type": { "name": "func" },
Expand Down
5 changes: 4 additions & 1 deletion docs/pages/x/api/date-pickers/static-date-picker.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@
},
"onAccept": {
"type": { "name": "func" },
"signature": { "type": "function(value: TValue) => void", "describedArgs": ["value"] }
"signature": {
"type": "function(value: TValue, context: FieldChangeHandlerContext<TError>) => void",
"describedArgs": ["value", "context"]
}
},
"onChange": {
"type": { "name": "func" },
Expand Down
5 changes: 4 additions & 1 deletion docs/pages/x/api/date-pickers/static-date-range-picker.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@
"minDate": { "type": { "name": "object" } },
"onAccept": {
"type": { "name": "func" },
"signature": { "type": "function(value: TValue) => void", "describedArgs": ["value"] }
"signature": {
"type": "function(value: TValue, context: FieldChangeHandlerContext<TError>) => void",
"describedArgs": ["value", "context"]
}
},
"onChange": {
"type": { "name": "func" },
Expand Down
5 changes: 4 additions & 1 deletion docs/pages/x/api/date-pickers/static-date-time-picker.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@
},
"onAccept": {
"type": { "name": "func" },
"signature": { "type": "function(value: TValue) => void", "describedArgs": ["value"] }
"signature": {
"type": "function(value: TValue, context: FieldChangeHandlerContext<TError>) => void",
"describedArgs": ["value", "context"]
}
},
"onChange": {
"type": { "name": "func" },
Expand Down
5 changes: 4 additions & 1 deletion docs/pages/x/api/date-pickers/static-time-picker.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
"minutesStep": { "type": { "name": "number" }, "default": "1" },
"onAccept": {
"type": { "name": "func" },
"signature": { "type": "function(value: TValue) => void", "describedArgs": ["value"] }
"signature": {
"type": "function(value: TValue, context: FieldChangeHandlerContext<TError>) => void",
"describedArgs": ["value", "context"]
}
},
"onChange": {
"type": { "name": "func" },
Expand Down
5 changes: 4 additions & 1 deletion docs/pages/x/api/date-pickers/time-picker.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@
"name": { "type": { "name": "string" } },
"onAccept": {
"type": { "name": "func" },
"signature": { "type": "function(value: TValue) => void", "describedArgs": ["value"] }
"signature": {
"type": "function(value: TValue, context: FieldChangeHandlerContext<TError>) => void",
"describedArgs": ["value", "context"]
}
},
"onChange": {
"type": { "name": "func" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@
},
"onAccept": {
"description": "Callback fired when the value is accepted.",
"typeDescriptions": { "value": "The value that was just accepted." }
"typeDescriptions": {
"value": "The value that was just accepted.",
"context": "The context containing the validation result of the current value."
}
},
"onChange": {
"description": "Callback fired when the value changes.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@
},
"onAccept": {
"description": "Callback fired when the value is accepted.",
"typeDescriptions": { "value": "The value that was just accepted." }
"typeDescriptions": {
"value": "The value that was just accepted.",
"context": "The context containing the validation result of the current value."
}
},
"onChange": {
"description": "Callback fired when the value changes.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@
},
"onAccept": {
"description": "Callback fired when the value is accepted.",
"typeDescriptions": { "value": "The value that was just accepted." }
"typeDescriptions": {
"value": "The value that was just accepted.",
"context": "The context containing the validation result of the current value."
}
},
"onChange": {
"description": "Callback fired when the value changes.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@
},
"onAccept": {
"description": "Callback fired when the value is accepted.",
"typeDescriptions": { "value": "The value that was just accepted." }
"typeDescriptions": {
"value": "The value that was just accepted.",
"context": "The context containing the validation result of the current value."
}
},
"onChange": {
"description": "Callback fired when the value changes.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@
},
"onAccept": {
"description": "Callback fired when the value is accepted.",
"typeDescriptions": { "value": "The value that was just accepted." }
"typeDescriptions": {
"value": "The value that was just accepted.",
"context": "The context containing the validation result of the current value."
}
},
"onChange": {
"description": "Callback fired when the value changes.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@
},
"onAccept": {
"description": "Callback fired when the value is accepted.",
"typeDescriptions": { "value": "The value that was just accepted." }
"typeDescriptions": {
"value": "The value that was just accepted.",
"context": "The context containing the validation result of the current value."
}
},
"onChange": {
"description": "Callback fired when the value changes.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@
},
"onAccept": {
"description": "Callback fired when the value is accepted.",
"typeDescriptions": { "value": "The value that was just accepted." }
"typeDescriptions": {
"value": "The value that was just accepted.",
"context": "The context containing the validation result of the current value."
}
},
"onChange": {
"description": "Callback fired when the value changes.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@
},
"onAccept": {
"description": "Callback fired when the value is accepted.",
"typeDescriptions": { "value": "The value that was just accepted." }
"typeDescriptions": {
"value": "The value that was just accepted.",
"context": "The context containing the validation result of the current value."
}
},
"onChange": {
"description": "Callback fired when the value changes.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@
},
"onAccept": {
"description": "Callback fired when the value is accepted.",
"typeDescriptions": { "value": "The value that was just accepted." }
"typeDescriptions": {
"value": "The value that was just accepted.",
"context": "The context containing the validation result of the current value."
}
},
"onChange": {
"description": "Callback fired when the value changes.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@
},
"onAccept": {
"description": "Callback fired when the value is accepted.",
"typeDescriptions": { "value": "The value that was just accepted." }
"typeDescriptions": {
"value": "The value that was just accepted.",
"context": "The context containing the validation result of the current value."
}
},
"onChange": {
"description": "Callback fired when the value changes.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@
},
"onAccept": {
"description": "Callback fired when the value is accepted.",
"typeDescriptions": { "value": "The value that was just accepted." }
"typeDescriptions": {
"value": "The value that was just accepted.",
"context": "The context containing the validation result of the current value."
}
},
"onChange": {
"description": "Callback fired when the value changes.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@
},
"onAccept": {
"description": "Callback fired when the value is accepted.",
"typeDescriptions": { "value": "The value that was just accepted." }
"typeDescriptions": {
"value": "The value that was just accepted.",
"context": "The context containing the validation result of the current value."
}
},
"onChange": {
"description": "Callback fired when the value changes.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@
},
"onAccept": {
"description": "Callback fired when the value is accepted.",
"typeDescriptions": { "value": "The value that was just accepted." }
"typeDescriptions": {
"value": "The value that was just accepted.",
"context": "The context containing the validation result of the current value."
}
},
"onChange": {
"description": "Callback fired when the value changes.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@
},
"onAccept": {
"description": "Callback fired when the value is accepted.",
"typeDescriptions": { "value": "The value that was just accepted." }
"typeDescriptions": {
"value": "The value that was just accepted.",
"context": "The context containing the validation result of the current value."
}
},
"onChange": {
"description": "Callback fired when the value changes.",
Expand Down
Loading

0 comments on commit f138e04

Please sign in to comment.