Skip to content

Commit

Permalink
Update Calendar.d.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
tugcekucukoglu committed Apr 1, 2024
1 parent bfcc09e commit b58b82f
Showing 1 changed file with 16 additions and 56 deletions.
72 changes: 16 additions & 56 deletions components/lib/calendar/Calendar.d.ts
Expand Up @@ -11,7 +11,7 @@ import { HTMLAttributes, InputHTMLAttributes, TransitionProps, VNode } from 'vue
import { ComponentHooks } from '../basecomponent';
import { ButtonPassThroughOptions } from '../button';
import { PassThroughOptions } from '../passthrough';
import { ClassComponent, GlobalComponentConstructor, PassThrough, HintedString } from '../ts-helpers';
import { ClassComponent, GlobalComponentConstructor, HintedString, PassThrough } from '../ts-helpers';

export declare type CalendarPassThroughOptionType = CalendarPassThroughAttributes | ((options: CalendarPassThroughMethodOptions) => CalendarPassThroughAttributes | string) | string | null | undefined;

Expand Down Expand Up @@ -126,7 +126,7 @@ export interface CalendarBlurEvent {

/**
* Custom passthrough(pt) options.
* @see {@link BaseCalendarProps.pt}
* @see {@link CalendarProps.pt}
*/
export interface CalendarPassThroughOptions {
/**
Expand Down Expand Up @@ -494,9 +494,19 @@ export interface CalendarYearOptions {
}

/**
* Defines valid base properties in Calendar component.
* Defines valid properties in Calendar component.
*/
interface BaseCalendarProps {
export interface CalendarProps {
/**
* Value of the component.
* @defaultValue null
*/
modelValue?: Date | Array<Date> | Array<Date | null> | undefined | null;
/**
* Defines the quantity of the selection.
* @defaultValue single
*/
selectionMode?: 'single' | 'multiple' | 'range' | undefined;
/**
* Format of the date. Defaults to PrimeVue Locale configuration.
*/
Expand Down Expand Up @@ -787,56 +797,6 @@ interface BaseCalendarProps {
unstyled?: boolean;
}

/**
* Defines valid single selection properties in Calendar component.
*/
interface CalendarPropsSingle extends BaseCalendarProps {
/**
* Value of the component.
* @defaultValue null
*/
modelValue?: Date | undefined | null;
/**
* Defines the quantity of the selection.
* @defaultValue single
*/
selectionMode?: 'single' | undefined;
}

/**
* Defines valid range selection properties in Calendar component.
*/
interface CalendarPropsRange extends BaseCalendarProps {
/**
* Value of the component.
* @defaultValue null
*/
modelValue?: Array<Date | null> | undefined | null;
/**
* Defines the quantity of the selection.
* @defaultValue single
*/
selectionMode?: 'range';
}

/**
* Defines valid multiple selection properties in Calendar component.
*/
interface CalendarPropsMultiple extends BaseCalendarProps {
/**
* Value of the component.
* @defaultValue null
*/
modelValue?: Array<Date> | undefined | null;
/**
* Defines the quantity of the selection.
* @defaultValue single
*/
selectionMode?: 'multiple';
}

export type CalendarProps = CalendarPropsSingle | CalendarPropsRange | CalendarPropsMultiple;

/**
* Defines valid options of the date slot in Calendar component.
*/
Expand Down Expand Up @@ -979,9 +939,9 @@ export interface CalendarSlots {
export interface CalendarEmits {
/**
* Emitted when the value changes.
* @param {Date | Array<Date | null> | null} value - New value.
* @param {string | Date | string[] | Date[] | undefined} value - New value.
*/
'update:modelValue'(value: Date | Array<Date | null> | null): void;
'update:modelValue'(value: Date | Array<Date> | Array<Date | null> | undefined | null): void;
/**
* Callback to invoke when input field is being typed.
* @param {Event} event - Browser event
Expand Down

0 comments on commit b58b82f

Please sign in to comment.