UNPKG

@duetds/date-picker

Version:

Duet Date Picker is an open source version of Duet Design System’s accessible date picker.

162 lines (161 loc) 6.89 kB
/* eslint-disable */ /* tslint:disable */ /** * This is an autogenerated file created by the Stencil compiler. * It contains typing information for all components that exist in this project. */ import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime"; import { DuetDatePickerChangeEvent, DuetDatePickerDirection, DuetDatePickerFocusEvent } from "./components/duet-date-picker/duet-date-picker"; import { DaysOfWeek } from "./components/duet-date-picker/date-utils"; import { DuetLocalizedText } from "./components/duet-date-picker/date-localization"; import { DuetDateAdapter } from "./components/duet-date-picker/date-adapter"; export namespace Components { interface DuetDatePicker { /** * Date adapter, for custom parsing/formatting. Must be object with a `parse` function which accepts a `string` and returns a `Date`, and a `format` function which accepts a `Date` and returns a `string`. Default is IS0-8601 parsing and formatting. */ "dateAdapter": DuetDateAdapter; /** * Forces the opening direction of the calendar modal to be always left or right. This setting can be useful when the input is smaller than the opening date picker would be as by default the picker always opens towards right. */ "direction": DuetDatePickerDirection; /** * Makes the date picker input component disabled. This prevents users from being able to interact with the input, and conveys its inactive state to assistive technologies. */ "disabled": boolean; /** * Which day is considered first day of the week? `0` for Sunday, `1` for Monday, etc. Default is Monday. */ "firstDayOfWeek": DaysOfWeek; /** * Hide the calendar modal. Set `moveFocusToButton` to false to prevent focus returning to the date picker's button. Default is true. */ "hide": (moveFocusToButton?: boolean) => Promise<void>; /** * Adds a unique identifier for the date picker input. Use this instead of html `id` attribute. */ "identifier": string; /** * Button labels, day names, month names, etc, used for localization. Default is English. */ "localization": DuetLocalizedText; /** * Maximum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD. This setting can be used alone or together with the min property. */ "max": string; /** * Minimum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD. This setting can be used alone or together with the max property. */ "min": string; /** * Name of the date picker input. */ "name": string; /** * Should the input be marked as required? */ "required": boolean; /** * Defines a specific role attribute for the date picker input. */ "role": string; /** * Sets focus on the date picker's input. Use this method instead of the global `focus()`. */ "setFocus": () => Promise<void>; /** * Show the calendar modal, moving focus to the calendar inside. */ "show": () => Promise<void>; /** * Date value. Must be in IS0-8601 format: YYYY-MM-DD. */ "value": string; } } declare global { interface HTMLDuetDatePickerElement extends Components.DuetDatePicker, HTMLStencilElement { } var HTMLDuetDatePickerElement: { prototype: HTMLDuetDatePickerElement; new (): HTMLDuetDatePickerElement; }; interface HTMLElementTagNameMap { "duet-date-picker": HTMLDuetDatePickerElement; } } declare namespace LocalJSX { interface DuetDatePicker { /** * Date adapter, for custom parsing/formatting. Must be object with a `parse` function which accepts a `string` and returns a `Date`, and a `format` function which accepts a `Date` and returns a `string`. Default is IS0-8601 parsing and formatting. */ "dateAdapter"?: DuetDateAdapter; /** * Forces the opening direction of the calendar modal to be always left or right. This setting can be useful when the input is smaller than the opening date picker would be as by default the picker always opens towards right. */ "direction"?: DuetDatePickerDirection; /** * Makes the date picker input component disabled. This prevents users from being able to interact with the input, and conveys its inactive state to assistive technologies. */ "disabled"?: boolean; /** * Which day is considered first day of the week? `0` for Sunday, `1` for Monday, etc. Default is Monday. */ "firstDayOfWeek"?: DaysOfWeek; /** * Adds a unique identifier for the date picker input. Use this instead of html `id` attribute. */ "identifier"?: string; /** * Button labels, day names, month names, etc, used for localization. Default is English. */ "localization"?: DuetLocalizedText; /** * Maximum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD. This setting can be used alone or together with the min property. */ "max"?: string; /** * Minimum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD. This setting can be used alone or together with the max property. */ "min"?: string; /** * Name of the date picker input. */ "name"?: string; /** * Event emitted the date picker input is blurred. */ "onDuetBlur"?: (event: CustomEvent<DuetDatePickerFocusEvent>) => void; /** * Event emitted when a date is selected. */ "onDuetChange"?: (event: CustomEvent<DuetDatePickerChangeEvent>) => void; /** * Event emitted the date picker input is focused. */ "onDuetFocus"?: (event: CustomEvent<DuetDatePickerFocusEvent>) => void; /** * Should the input be marked as required? */ "required"?: boolean; /** * Defines a specific role attribute for the date picker input. */ "role"?: string; /** * Date value. Must be in IS0-8601 format: YYYY-MM-DD. */ "value"?: string; } interface IntrinsicElements { "duet-date-picker": DuetDatePicker; } } export { LocalJSX as JSX }; declare module "@stencil/core" { export namespace JSX { interface IntrinsicElements { "duet-date-picker": LocalJSX.DuetDatePicker & JSXBase.HTMLAttributes<HTMLDuetDatePickerElement>; } } }