Skip to content

Commit 1363bba

Browse files
committed
feat(VColorInput, VDateInput): add picker-props
1 parent 5dbc995 commit 1363bba

File tree

3 files changed

+28
-19
lines changed

3 files changed

+28
-19
lines changed

packages/api-generator/src/locale/en/generic.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"origin": "Sets the transition origin on the element. You can find more information on the MDN documentation [for transition origin](https://developer.mozilla.org/en-US/docs/Web/CSS/transform-origin).",
4848
"persistent": "Clicking outside or pressing **esc** key will not dismiss the dialog.",
4949
"persistentCounter": "Forces counter to always be visible.",
50+
"pickerProps": "Pass props through to the picker component. Intended for props that conflict with `v-text-field` (`color`, `width`, `rounded`, etc.)",
5051
"prependAvatar": "Prepends a [v-avatar](/components/avatars/) component in the **prepend** slot before default content.",
5152
"prependIcon": "Creates a [v-icon](/api/v-icon/) component in the **prepend** slot before default content.",
5253
"ripple": "Applies the [v-ripple](/directives/ripple) directive.",

packages/vuetify/src/labs/VColorInput/VColorInput.tsx

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ export const makeVColorInputProps = propsFactory({
5050
type: String as PropType<VAvatar['$props']['variant']>,
5151
default: 'text',
5252
},
53+
pickerProps: Object as PropType<VColorPicker['$props']>,
5354

5455
...makeFocusProps(),
5556
...makeVConfirmEditProps(),
@@ -111,15 +112,18 @@ export const VColorInput = genericComponent<VColorInputSlots>()({
111112

112113
useRender(() => {
113114
const confirmEditProps = VConfirmEdit.filterProps(props)
114-
const colorPickerProps = VColorPicker.filterProps(omit(props, [
115-
'active',
116-
'bgColor',
117-
'color',
118-
'rounded',
119-
'maxWidth',
120-
'minWidth',
121-
'width',
122-
]))
115+
const colorPickerProps = {
116+
...VColorPicker.filterProps(omit(props, [
117+
'active',
118+
'bgColor',
119+
'color',
120+
'rounded',
121+
'maxWidth',
122+
'minWidth',
123+
'width',
124+
])),
125+
...props.pickerProps,
126+
}
123127
const textFieldProps = VTextField.filterProps(props)
124128

125129
const slotWithPip = props.hidePip

packages/vuetify/src/labs/VDateInput/VDateInput.tsx

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export const makeVDateInputProps = propsFactory({
5353
type: Array as PropType<('blur' | 'enter')[]>,
5454
default: () => ['blur', 'enter'],
5555
},
56+
pickerProps: Object as PropType<VDatePicker['$props']>,
5657

5758
...makeDateFormatProps(),
5859
...makeDisplayProps({
@@ -260,16 +261,19 @@ export const VDateInput = genericComponent<new <
260261

261262
useRender(() => {
262263
const confirmEditProps = VConfirmEdit.filterProps(props)
263-
const datePickerProps = VDatePicker.filterProps(omit(props, [
264-
'active',
265-
'bgColor',
266-
'color',
267-
'location',
268-
'rounded',
269-
'maxWidth',
270-
'minWidth',
271-
'width',
272-
]))
264+
const datePickerProps = {
265+
...VDatePicker.filterProps(omit(props, [
266+
'active',
267+
'bgColor',
268+
'color',
269+
'location',
270+
'rounded',
271+
'maxWidth',
272+
'minWidth',
273+
'width',
274+
])),
275+
...props.pickerProps,
276+
}
273277
const datePickerSlots = pick(slots, ['title', 'header', 'day', 'month', 'year'])
274278
const textFieldProps = VTextField.filterProps(omit(props, ['placeholder']))
275279

0 commit comments

Comments
 (0)