Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fix #7015: Calendar passthrough type definition and docs #7021

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions components/doc/calendar/theming/tailwinddoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ const Tailwind = {
'opacity-60 select-none pointer-events-none cursor-default': props.disabled
})
}),
input: {
root: ({ parent }) => ({
input: ({ props }) => ({
root: {
className: classNames('font-sans text-base text-gray-600 dark:text-white/80 bg-white dark:bg-gray-900 p-3 border border-gray-300 dark:border-blue-900/40 transition-colors duration-200 appearance-none', 'hover:border-blue-500', {
'rounded-lg': !parent.props.showIcon,
'border-r-0 rounded-l-lg': parent.props.showIcon
'rounded-lg': !props.showIcon,
'border-r-0 rounded-l-lg': props.showIcon
})
})
},
}
}),
dropdownButton: {
root: ({ props }) => ({
className: classNames({ 'rounded-l-none': props.icon })
Expand All @@ -53,7 +53,7 @@ const Tailwind = {
'hover:text-gray-700 dark:hover:text-white/80 hover:border-transparent hover:bg-gray-200 dark:hover:bg-gray-800/80 '
)
},
title: 'leading-8 mx-auto',
title: { className: 'leading-8 mx-auto' },
monthTitle: {
className: classNames('text-gray-700 dark:text-white/80 transition duration-200 font-semibold p-2', 'mr-2', 'hover:text-blue-500')
},
Expand All @@ -70,9 +70,9 @@ const Tailwind = {
table: {
className: classNames('border-collapse w-full', 'my-2')
},
tableHeaderCell: 'p-2',
weekday: 'text-gray-600 dark:text-white/70',
day: 'p-2',
tableHeaderCell: { className: 'p-2' },
weekday: { className: 'text-gray-600 dark:text-white/70' },
day: { className: 'p-2' },
dayLabel: ({ context }) => ({
className: classNames(
'w-10 h-10 rounded-full transition-shadow duration-200 border-transparent border',
Expand All @@ -88,7 +88,7 @@ const Tailwind = {
}
)
}),
monthPicker: 'my-2',
monthPicker: { className: 'my-2' },
month: ({ context }) => ({
className: classNames(
'w-1/3 inline-flex items-center justify-center cursor-pointer overflow-hidden relative',
Expand All @@ -114,11 +114,11 @@ const Tailwind = {
timePicker: {
className: classNames('flex justify-center items-center', 'border-t-1 border-solid border-gray-300 p-2')
},
separatorContainer: 'flex items-center flex-col px-2',
separator: 'text-xl',
hourPicker: 'flex items-center flex-col px-2',
minutePicker: 'flex items-center flex-col px-2',
ampmPicker: 'flex items-center flex-col px-2',
separatorContainer: { className: 'flex items-center flex-col px-2' },
separator: { className: 'text-xl' },
hourPicker: { className: 'flex items-center flex-col px-2' },
minutePicker: { className: 'flex items-center flex-col px-2' },
ampmPicker: { className: 'flex items-center flex-col px-2' },
incrementButton: {
className: classNames(
'flex items-center justify-center cursor-pointer overflow-hidden relative',
Expand All @@ -133,7 +133,7 @@ const Tailwind = {
'hover:text-gray-700 dark:hover:text-white/80 hover:border-transparent hover:bg-gray-200 dark:hover:bg-gray-800/80 '
)
},
groupContainer: 'flex',
groupContainer: { className: 'flex' },
group: {
className: classNames('flex-1', 'border-l border-gray-300 pr-0.5 pl-0.5 pt-0 pb-0', 'first:pl-0 first:border-l-0')
},
Expand Down
2 changes: 1 addition & 1 deletion components/doc/common/apidoc/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -7120,7 +7120,7 @@
"name": "input",
"optional": true,
"readonly": false,
"type": "InputTextPassThroughOptions",
"type": "CalendarPassThroughType<HTMLAttributes<HTMLInputElement>>",
"description": "Uses to pass attributes to the InputText component."
},
{
Expand Down
9 changes: 3 additions & 6 deletions components/lib/calendar/calendar.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import * as React from 'react';
import { CSSTransitionProps as ReactCSSTransitionProps } from 'react-transition-group/CSSTransition';
import { ComponentHooks } from '../componentbase/componentbase';
import { CSSTransitionProps } from '../csstransition';
import { InputText, InputTextPassThroughOptions } from '../inputtext/inputtext';
import { PassThroughOptions } from '../passthrough';
import { TooltipOptions } from '../tooltip/tooltipoptions';
import { FormEvent, Nullable } from '../ts-helpers';
Expand Down Expand Up @@ -40,12 +39,10 @@ export interface CalendarPassThroughOptions {
root?: CalendarPassThroughType<React.HTMLAttributes<HTMLSpanElement>>;
/**
* Uses to pass attributes to the InputText component.
* @see {@link CalendarPassThroughType}
*/
input?: InputTextPassThroughOptions;
input?: CalendarPassThroughType<React.HTMLAttributes<HTMLInputElement>>;
/**
* Uses to pass attributes to the Button component.
* @see {@link CalendarPassThroughType}
*/
dropdownButton?: CalendarPassThroughType<React.HTMLAttributes<HTMLButtonElement>>;
/**
Expand Down Expand Up @@ -1080,9 +1077,9 @@ export declare class Calendar extends React.Component<CalendarProps, any> {
public getElement(): HTMLSpanElement;
/**
* Used to get input element.
* @return {InputText} Input element
* @return {HTMLInputElement} Input element
*/
public getInput(): typeof InputText;
public getInput(): HTMLInputElement;
/**
* Used to get overlay element.
* @return {HTMLElement} Overlay element
Expand Down
Loading