@geogirafe/lib-geoportal
Version:
GeoGirafe is a flexible application to build online geoportals.
41 lines (40 loc) • 1.79 kB
TypeScript
import TimeWidget, { TimeRangeLimit } from '../tools/timewidget.js';
/**
* A component consisting of two `<input>` elements of type date picker for temporal layer filtering.
* It supports specifying single-dates or date ranges.
* The widget validates input dates based on the specified `timeOptions`. In `range` mode, it validates
* lower and upper range limits so that they do not cross each other.
*/
declare class TimePickerComponent extends TimeWidget {
protected templateUrl: string | null;
protected styleUrls: string[] | null;
template: () => import("uhtml").Hole;
constructor();
renderComponent(): void;
/**
* Sets the value of the specified input element.
*
* @param {string} dateStr - The date string to be set as the value.
* @param {TimeRangeLimit} [limit='lower'] - The time range limit for which the value is to be set ('lower' or 'upper').
*/
setValue(dateStr: string, limit?: TimeRangeLimit): void;
/**
* Resets the input elements to their default states. This either will be empty strings
* or the optionally defined `minDefaultValue` and `maxDefaultValue`.
* The method will trigger a `TimeChangeEvent` that bubbles up to the parent component.
*/
reset(): void;
/**
* Sets the HTML element attributes to the initial values. Must only be called ones.
*/
private configureInputElements;
private getHtmlInputType;
/**
* Attaches event listeners to input elements to validate their values when user interactions occur.
* Updates the min/max settings of one datepicker whenever the value of the other is changed.
*/
private addEventListeners;
private validateLowerLimit;
private validateUpperLimit;
}
export default TimePickerComponent;