UNPKG

@scania/tegel

Version:
68 lines (67 loc) 2.86 kB
import { EventEmitter } from '../../stencil-public-runtime'; export declare class TdsDatetime { /** Text-input for focus state */ textInput?: HTMLInputElement; /** Sets an input type */ type: 'datetime-local' | 'date' | 'month' | 'week' | 'time'; /** Value of the input text */ value: string; /** Sets min value. Example for different types: datetime="2023-01-31T00:00" date="2023-01-01" time="15:00" */ min: string; /** Sets max value. Example for different types: datetime="2023-01-31T00:00" date="2023-01-01" time="15:00" */ max: string; /** Default value of the component. Format for time: HH-MM. Format for date: YY-MM-DD. Format for month: YY-MM. Format for week: YY-Www Format for date-time: YY-MM-DDTHH-MM */ defaultValue: string | 'none'; /** Set input in disabled state */ disabled: boolean; /** Size of the input */ size: 'sm' | 'md' | 'lg'; /** Resets min width rule */ noMinWidth: boolean; /** Set the variant of the Datetime component. */ modeVariant: 'primary' | 'secondary'; /** Name property. Uses a unique ID as fallback if not specified. */ name: string; /** Error state of input */ state: string; /** Autofocus for input */ autofocus: boolean; /** Label text for the component */ label: string; /** Position of the label */ labelPosition: 'inside' | 'outside' | 'no-label'; /** Helper text for the component */ helper: string; /** Value for the aria-label attribute */ tdsAriaLabel: string; /** Listen to the focus state of the input */ focusInput: boolean; /** Change event for the Datetime */ tdsChange: EventEmitter; /** Blur event for the Datetime */ tdsBlur: EventEmitter<FocusEvent>; /** Focus event for the Datetime */ tdsFocus: EventEmitter<FocusEvent>; /** Input event for the Datetime */ tdsInput: EventEmitter<InputEvent>; /** Method that resets the value of the Datetime, using defaultValue if is not 'none' */ reset(): Promise<void>; /** Method that sets the value of the datetime element */ setValue(newValue: string): Promise<void>; /** Method to programmatically focus the datetime element */ focusElement(): Promise<void>; getDefaultValue: () => string; componentWillLoad(): void; handleFocusIn(): void; handleFocusOut(): void; handleInput(e: InputEvent): void; handleChange(e: Event): void; /** Set the input as focus when clicking the whole Datetime with suffix/prefix */ handleFocusClick(e: FocusEvent): void; /** Set the input as focus when clicking the whole Datetime with suffix/prefix */ handleBlur(e: FocusEvent): void; /** Method that resets the dateteime without emitting an event. */ private internalReset; connectedCallback(): void; render(): any; }