carbon-custom-elements
Version:
A Carbon Design System variant that's as easy to use as native HTML elements, with no framework tax, no framework silo.
193 lines (191 loc) • 5.57 kB
TypeScript
/**
* @license
*
* Copyright IBM Corp. 2019, 2020
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
import { LitElement } from 'lit-element';
import { Instance as FlatpickrInstance } from 'flatpickr/dist/types/instance';
import { Locale as FlatpickrLocale } from 'flatpickr/dist/types/locale';
/**
* Date picker.
* @element bx-date-picker
* @fires bx-date-picker-changed - The custom event fired on this element when Flatpickr updates its value.
*/
declare class BXDatePicker extends LitElement {
/**
* The handle for the listener of `${prefix}-date-picker-changed` event.
*/
private _hAfterChange;
/**
* The slotted `<bx-date-input kind="from">`.
*/
private _dateInteractNode;
/**
* The element to put calendar dropdown in.
*/
private _floatingMenuContainerNode;
/**
* The internal placeholder for the `value` property.
*/
private _value;
/**
* @returns The effective date picker mode, determined by the child `<bx-date-picker-input>`.
*/
private get _mode();
/**
* @returns The Flatpickr plugins to use.
*/
private get _datePickerPlugins();
/**
* @returns The options to instantiate Flatpickr with.
*/
private get _datePickerOptions();
/**
* Handles `${prefix}-date-picker-changed` event on this element.
*/
private _handleChange;
/**
* Handles `slotchange` event in the `<slot>`.
*/
private _handleSlotChange;
/**
* Fires a custom event to notify an error in Flatpickr.
*/
private _handleFlatpickrError;
/**
* Instantiates Flatpickr.
* @returns The Flatpickr instance.
*/
private _instantiateDatePicker;
/**
* Releases Flatpickr instances.
*/
private _releaseDatePicker;
/**
* The Flatpickr instance.
*/
calendar: FlatpickrInstance | null;
/**
* The date format to let Flatpickr use.
*/
dateFormat: string;
/**
* The localization data.
*/
locale: FlatpickrLocale;
/**
* The date range that a user can pick in calendar dropdown.
*/
enabledRange: string;
/**
* `true` if the date picker should be open.
*/
open: boolean;
/**
* The date(s) in ISO8601 format (date portion only), for range mode, '/' is used for separate start/end dates.
*/
get value(): string;
set value(value: string);
connectedCallback(): void;
disconnectedCallback(): void;
updated(changedProperties: any): void;
render(): import("lit-element").TemplateResult;
/**
* The CSS selector for Flatpickr's month/year portion.
*/
private static _selectorFlatpickrMonthYearContainer;
/**
* The CSS selector for Flatpickr's year portion.
*/
private static _selectorFlatpickrYearContainer;
/**
* The CSS selector for the inner element of Flatpickr's month portion.
*/
private static _selectorFlatpickrCurrentMonth;
/**
* The CSS selector for Flatpickr's month navigator.
*/
private static _selectorFlatpickrMonth;
/**
* The CSS selector for Flatpickr's container of the weekdays.
*/
private static _selectorFlatpickrWeekdays;
/**
* The CSS selector for Flatpickr's container of the days.
*/
private static _selectorFlatpickrDays;
/**
* The CSS selector applied to Flatpickr's each weekdays.
*/
private static _selectorFlatpickrWeekday;
/**
* The CSS selector applied to Flatpickr's each days.
*/
private static _selectorFlatpickrDay;
/**
* The CSS class for the inner element of Flatpickr's month portion.
*/
private static _classFlatpickrCurrentMonth;
/**
* The CSS class applied to Flatpickr's "today" highlight.
*/
private static _classFlatpickrToday;
/**
* The CSS class for the calendar dropdown.
*/
static get classCalendarContainer(): string;
/**
* The CSS class for the month navigator.
*/
static get classMonth(): string;
/**
* The CSS class for the container of the weekdays.
*/
static get classWeekdays(): string;
/**
* The CSS class for the container of the days.
*/
static get classDays(): string;
/**
* The CSS class applied to each weekdays.
*/
static get classWeekday(): string;
/**
* The CSS class applied to each days.
*/
static get classDay(): string;
/**
* The CSS class applied to the "today" highlight if there are any dates selected.
*/
static classNoBorder: string;
/**
* The default date format.
*/
static defaultDateFormat: string;
/**
* The default localization data.
*/
static defaultLocale: import("flatpickr/dist/types/locale").CustomLocale & FlatpickrLocale;
/**
* A selector that will return the `<input>` to enter starting date.
*/
static get selectorInputFrom(): string;
/**
* A selector that will return the `<input>` to enter end date.
*/
static get selectorInputTo(): string;
/**
* The name of the custom event when Flatpickr throws an error.
*/
static get eventFlatpickrError(): string;
/**
* The name of the custom event fired on this element when Flatpickr updates its value.
*/
static get eventChange(): string;
static styles: any;
}
export default BXDatePicker;
//# sourceMappingURL=date-picker.d.ts.map