import { EventEmitter } from '../../stencil-public-runtime'; /** * A format-aware time input component that displays only relevant input fields based on the specified format. * The component ensures consistency between the format property and both input validation and value emission. * * @slot label - Content to be placed as the label, will override the label prop. * @slot before-input - Content to be placed before the input text, outside the input container. * @slot after-input - Content to be placed after the input text, outside the input container. * @slot leading-input - Content to be placed before the input text, within the input container. * @slot error-description - Content to be placed as the error description, will override the errorDescription prop. * @slot description - Content to be placed as the description, will override the description prop. */ export declare class NvFieldtime { el: HTMLNvFieldtimeElement; private inputElements; private inputZeroAdded; private popoverElement; private typeFocused; /****************************************************************************/ hours: string; minutes: string; seconds: string; /****************************************************************************/ /** * The current value of the time input in the specified format. */ value: string; /** * Lets you define the text that explains what users should enter in the time * input field. It's a crucial element for making forms clear and * user-friendly. */ readonly label: string; /** * Sets the ID for the input element and the for attribute of the associated * label. If no ID is provided, a random one will be automatically generated * to ensure unique identification, facilitating proper label association and * accessibility. */ readonly inputId: string; /** * Display the input field's content without allowing users to change it. * Users can still click on it, select, and copy the text, but they won't be * able to type or delete anything. */ readonly readonly: boolean; /** * The disabled prop lets you turn off the input field so that users can't * interact with it. When disabled, the field is grayed out and won't respond to * clicks or touches. */ readonly disabled: boolean; /** * Marks the input field as required, ensuring that the user must fill it out * before submitting the form. * @note This uses the native HTML `required` attribute, which triggers browser validation. */ readonly required: boolean; /** * Marks the input field as required for accessibility purposes without triggering * native HTML validation. Use this when implementing custom validation logic. * @note When set, this uses `aria-required` instead of the native `required` attribute. * This allows developers to implement custom validation while maintaining accessibility. * @note If this prop is not explicitly set, the component will check for the HTML attribute * 'aria-required' directly to determine if it should be applied. */ readonly ariaRequiredAttr: boolean; /** * Defines the name attribute of the input field, which is crucial for form * submission. This value is used as the key in the key-value pair sent to * the server, representing the input's data in form submissions. */ readonly name: string; /** * Changes the input field’s appearance to indicate successful input or * validation. */ readonly success: boolean; /** * Alters the input field's appearance to indicate an error, helping users * identify fields that need correction. * @validator error */ readonly error: boolean; /** * A description that appears when there is an error related to the time * field. * @validator message */ readonly errorDescription: string; /** * Specifies the time format to be used. * Available formats: * - HH: 24-hour format (00-23) * - HH:mm: 24-hour format with minutes (00:00-23:59) * - HH:mm:ss: 24-hour format with minutes and seconds (00:00:00-23:59:59) * - hh: 12-hour format (01-12) * - hh:mm: 12-hour format with minutes (01:00-12:59) * - hh:mm:ss: 12-hour format with minutes and seconds (01:00:00-12:59:59) * * The component automatically shows only the relevant input fields based on the selected format. * When the format changes dynamically, the component re-parses the current value and updates * the visible fields accordingly. */ readonly format: 'HH' | 'HH:mm' | 'HH:mm:ss' | 'hh' | 'hh:mm' | 'hh:mm:ss'; /** * Add helpful hints or extra information under the time input field. This is * where you can clarify what users should enter or provide additional * instructions. */ readonly description: string; /** * State of the time picker popover. */ open: boolean; /** * The step interval in milliseconds for time increments/decrements. * This affects how the time changes when using arrow keys or spinners. */ readonly step: number; /** * The maximum time value that can be selected. */ readonly max: string; /** * The minimum time value that can be selected. */ readonly min: string; /** * Applies focus to the input field as soon as the component is mounted. This * is equivalent to setting the native autofocus attribute on an * element. */ readonly autofocus: boolean; /****************************************************************************/ /** * Emit an event when the time value changes. * The event detail contains the new time value in the format specified by the format property. * @bind value */ valueChanged: EventEmitter; /****************************************************************************/ handleKeyDown(event: KeyboardEvent): void; /****************************************************************************/ handleValueChange(newValue: string): void; handleOpenChange(newOpen: boolean): void; handleFormatChange(newFormat: string, oldFormat: string): void; /****************************************************************************/ private handleInputChange; private handleHoursChange; private handleMinutesChange; private handleSecondsChange; private parseTime; private reconstructTime; private handleFocus; private HandleDropdownIconClick; private updateHighlightedItem; private handleTimeOptionClick; private handleInputBlur; private handleClickOutside; private handleScroll; private generateTimeOptions; private generateHourOptions; /** * Parse hour value from min/max constraint strings for dropdown generation only. * This method is used exclusively for filtering dropdown options and should not * affect input values or validation. * @param {string} value - The time string to parse (e.g., "14:30" or "02:30") * @param {string} format - The time format string (e.g., "HH:mm" or "hh:mm") * @returns {string} The parsed hour string or null if invalid */ private parseHour; private generateMinuteOptions; /** * Parse minute value from min/max constraint strings for dropdown generation only. * This method is used exclusively for filtering dropdown options and should not * affect input values or validation. * @param {string} value - The time string to parse (e.g., "14:30" or "02:30") * @returns {number} The parsed minute number or null if invalid */ private parseMinute; private generateSecondOptions; /** * Parse second value from min/max constraint strings for dropdown generation only. * This method is used exclusively for filtering dropdown options and should not * affect input values or validation. * @param {string} value - The time string to parse (e.g., "14:30:45" or "02:30:45") * @returns {number} The parsed second number or null if invalid */ private parseSecond; private generateInfiniteTimeOptions; private updateColumnHighlight; private handleHostClick; private handleOpenChanged; /****************************************************************************/ componentWillLoad(): void; connectedCallback(): void; disconnectedCallback(): void; componentDidLoad(): void; /****************************************************************************/ /** * Calculates aria-required and native required values based on props and attributes * @returns {object} Object with ariaRequiredValue and useNativeRequired */ private getRequiredAttributes; /** * Renders input fields based on the current format * Only shows fields that are relevant to the selected format * @returns {HTMLElement[]} Array of HTML elements for time input fields */ private renderTimeInputFields; /** * Renders a single time input field for the specified type * @param {TimeType} type - The time type to render input for * @returns {HTMLInputElement} HTML input element for the specified time type */ private renderTimeInputField; /** * Renders dropdown columns based on the current format * Only shows columns that are relevant to the selected format * @returns {HTMLElement[]} Array of HTML elements for time dropdown columns */ private renderTimeDropdownColumns; private RenderTimeOptionsColumn; render(): any; }