123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921 |
- /*!
- * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
- * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
- * v1.0.0-beta.97
- */
- import { h, Host, Build } from "@stencil/core";
- import { getLocaleData, getValueAsDateRange } from "./utils";
- import { dateFromRange, dateFromISO, dateToISO, getDaysDiff, setEndOfDay } from "../../utils/date";
- import { HEADING_LEVEL, TEXT } from "./resources";
- import { connectLocalized, disconnectLocalized, numberStringFormatter } from "../../utils/locale";
- export class DatePicker {
- constructor() {
- /**
- * Localized string for "previous month" (used for aria label)
- *
- * @default "Previous month"
- */
- this.intlPrevMonth = TEXT.prevMonth;
- /**
- * Localized string for "next month" (used for aria label)
- *
- * @default "Next month"
- */
- this.intlNextMonth = TEXT.nextMonth;
- /**
- * Localized string for "year" (used for aria label)
- *
- * @default "Year"
- */
- this.intlYear = TEXT.year;
- /** specify the scale of the date picker */
- this.scale = "m";
- /** Range mode activation */
- this.range = false;
- /** Disables the default behaviour on the third click of narrowing or extending the range and instead starts a new range. */
- this.proximitySelectionDisabled = false;
- this.globalAttributes = {};
- //--------------------------------------------------------------------------
- //
- // Private State/Props
- //
- //--------------------------------------------------------------------------
- this.effectiveLocale = "";
- //--------------------------------------------------------------------------
- //
- // Private Methods
- //
- //--------------------------------------------------------------------------
- this.keyDownHandler = (event) => {
- if (event.key === "Escape") {
- this.reset();
- }
- };
- this.monthHeaderSelectChange = (event) => {
- const date = new Date(event.detail);
- if (!this.range) {
- this.activeDate = date;
- }
- else {
- if (this.activeRange === "end") {
- this.activeEndDate = date;
- }
- else {
- this.activeStartDate = date;
- }
- this.mostRecentRangeValue = date;
- }
- };
- this.monthActiveDateChange = (event) => {
- const date = new Date(event.detail);
- if (!this.range) {
- this.activeDate = date;
- }
- else {
- if (this.activeRange === "end") {
- this.activeEndDate = date;
- }
- else {
- this.activeStartDate = date;
- }
- this.mostRecentRangeValue = date;
- }
- };
- this.monthHoverChange = (event) => {
- if (!this.startAsDate) {
- this.hoverRange = undefined;
- return;
- }
- const date = new Date(event.detail);
- this.hoverRange = {
- focused: this.activeRange || "start",
- start: this.startAsDate,
- end: this.endAsDate
- };
- if (!this.proximitySelectionDisabled) {
- if (this.endAsDate) {
- const startDiff = getDaysDiff(date, this.startAsDate);
- const endDiff = getDaysDiff(date, this.endAsDate);
- if (endDiff > 0) {
- this.hoverRange.end = date;
- this.hoverRange.focused = "end";
- }
- else if (startDiff < 0) {
- this.hoverRange.start = date;
- this.hoverRange.focused = "start";
- }
- else if (startDiff > endDiff) {
- this.hoverRange.start = date;
- this.hoverRange.focused = "start";
- }
- else {
- this.hoverRange.end = date;
- this.hoverRange.focused = "end";
- }
- }
- else {
- if (date < this.startAsDate) {
- this.hoverRange = {
- focused: "start",
- start: date,
- end: this.startAsDate
- };
- }
- else {
- this.hoverRange.end = date;
- this.hoverRange.focused = "end";
- }
- }
- }
- else {
- if (!this.endAsDate) {
- if (date < this.startAsDate) {
- this.hoverRange = {
- focused: "start",
- start: date,
- end: this.startAsDate
- };
- }
- else {
- this.hoverRange.end = date;
- this.hoverRange.focused = "end";
- }
- }
- else {
- this.hoverRange = undefined;
- }
- }
- event.stopPropagation();
- };
- this.monthMouseOutChange = () => {
- if (this.hoverRange) {
- this.hoverRange = undefined;
- }
- };
- /**
- * Reset active date and close
- */
- this.reset = () => {
- var _a, _b, _c, _d, _e, _f;
- if (!Array.isArray(this.valueAsDate) &&
- this.valueAsDate &&
- ((_a = this.valueAsDate) === null || _a === void 0 ? void 0 : _a.getTime()) !== ((_b = this.activeDate) === null || _b === void 0 ? void 0 : _b.getTime())) {
- this.activeDate = new Date(this.valueAsDate);
- }
- if (this.startAsDate && ((_c = this.startAsDate) === null || _c === void 0 ? void 0 : _c.getTime()) !== ((_d = this.activeStartDate) === null || _d === void 0 ? void 0 : _d.getTime())) {
- this.activeStartDate = new Date(this.startAsDate);
- }
- if (this.endAsDate && ((_e = this.endAsDate) === null || _e === void 0 ? void 0 : _e.getTime()) !== ((_f = this.activeEndDate) === null || _f === void 0 ? void 0 : _f.getTime())) {
- this.activeEndDate = new Date(this.endAsDate);
- }
- };
- /**
- * Event handler for when the selected date changes
- *
- * @param event
- */
- this.monthDateChange = (event) => {
- const date = new Date(event.detail);
- if (!this.range) {
- this.value = date ? dateToISO(date) : "";
- this.valueAsDate = date || null;
- this.activeDate = date || null;
- this.calciteDatePickerChange.emit(date);
- return;
- }
- if (!this.startAsDate || (!this.endAsDate && date < this.startAsDate)) {
- if (this.startAsDate) {
- this.setEndDate(new Date(this.startAsDate));
- }
- if (this.activeRange == "end") {
- this.setEndDate(date);
- }
- else {
- this.setStartDate(date);
- }
- }
- else if (!this.endAsDate) {
- this.setEndDate(date);
- }
- else {
- if (!this.proximitySelectionDisabled) {
- if (this.activeRange) {
- if (this.activeRange == "end") {
- this.setEndDate(date);
- }
- else {
- this.setStartDate(date);
- }
- }
- else {
- const startDiff = getDaysDiff(date, this.startAsDate);
- const endDiff = getDaysDiff(date, this.endAsDate);
- if (endDiff === 0 || startDiff < 0) {
- this.setStartDate(date);
- }
- else if (startDiff === 0 || endDiff < 0) {
- this.setEndDate(date);
- }
- else if (startDiff < endDiff) {
- this.setStartDate(date);
- }
- else {
- this.setEndDate(date);
- }
- }
- }
- else {
- this.setStartDate(date);
- this.endAsDate = this.activeEndDate = this.end = undefined;
- }
- }
- this.calciteDatePickerChange.emit(date);
- };
- }
- handleValueAsDate(date) {
- if (!Array.isArray(date) && date && date !== this.activeDate) {
- this.activeDate = date;
- }
- }
- handleRangeChange() {
- const { startAsDate: startDate, endAsDate: endDate } = this;
- this.activeEndDate = endDate;
- this.activeStartDate = startDate;
- }
- onMinChanged(min) {
- if (min) {
- this.minAsDate = dateFromISO(min);
- }
- }
- onMaxChanged(max) {
- if (max) {
- this.maxAsDate = dateFromISO(max);
- }
- }
- // --------------------------------------------------------------------------
- //
- // Lifecycle
- //
- // --------------------------------------------------------------------------
- connectedCallback() {
- connectLocalized(this);
- if (Array.isArray(this.value)) {
- this.valueAsDate = getValueAsDateRange(this.value);
- this.start = this.value[0];
- this.end = this.value[1];
- }
- else if (this.value) {
- this.valueAsDate = dateFromISO(this.value);
- }
- if (this.start) {
- this.setStartAsDate(dateFromISO(this.start));
- }
- if (this.end) {
- this.setEndAsDate(dateFromISO(this.end));
- }
- if (this.min) {
- this.minAsDate = dateFromISO(this.min);
- }
- if (this.max) {
- this.maxAsDate = dateFromISO(this.max);
- }
- }
- disconnectedCallback() {
- disconnectLocalized(this);
- }
- async componentWillLoad() {
- await this.loadLocaleData();
- this.onMinChanged(this.min);
- this.onMaxChanged(this.max);
- }
- render() {
- var _a;
- const date = dateFromRange(this.range ? this.startAsDate : this.valueAsDate, this.minAsDate, this.maxAsDate);
- const activeStartDate = this.range
- ? this.getActiveStartDate(date, this.minAsDate, this.maxAsDate)
- : this.getActiveDate(date, this.minAsDate, this.maxAsDate);
- let activeDate = activeStartDate;
- const endDate = this.range
- ? dateFromRange(this.endAsDate, this.minAsDate, this.maxAsDate)
- : null;
- const activeEndDate = this.getActiveEndDate(endDate, this.minAsDate, this.maxAsDate);
- if ((this.activeRange === "end" ||
- (((_a = this.hoverRange) === null || _a === void 0 ? void 0 : _a.focused) === "end" && (!this.proximitySelectionDisabled || endDate))) &&
- activeEndDate) {
- activeDate = activeEndDate;
- }
- if (this.range && this.mostRecentRangeValue) {
- activeDate = this.mostRecentRangeValue;
- }
- const minDate = this.range && this.activeRange
- ? this.activeRange === "start"
- ? this.minAsDate
- : date || this.minAsDate
- : this.minAsDate;
- const maxDate = this.range && this.activeRange
- ? this.activeRange === "start"
- ? endDate || this.maxAsDate
- : this.maxAsDate
- : this.maxAsDate;
- return (h(Host, { onBlur: this.reset, onKeyDown: this.keyDownHandler, role: "application" }, this.renderCalendar(activeDate, maxDate, minDate, date, endDate)));
- }
- valueHandler(value) {
- if (Array.isArray(value)) {
- this.valueAsDate = getValueAsDateRange(value);
- this.start = value[0];
- this.end = value[1];
- }
- else if (value) {
- this.valueAsDate = dateFromISO(value);
- this.start = "";
- this.end = "";
- }
- }
- startWatcher(start) {
- this.setStartAsDate(dateFromISO(start));
- }
- endWatcher(end) {
- this.setEndAsDate(dateFromISO(end));
- }
- async loadLocaleData() {
- if (!Build.isBrowser) {
- return;
- }
- numberStringFormatter.numberFormatOptions = {
- numberingSystem: this.numberingSystem,
- locale: this.effectiveLocale,
- useGrouping: false
- };
- this.localeData = await getLocaleData(this.effectiveLocale);
- }
- /**
- * Render calcite-date-picker-month-header and calcite-date-picker-month
- *
- * @param activeDate
- * @param maxDate
- * @param minDate
- * @param date
- * @param endDate
- */
- renderCalendar(activeDate, maxDate, minDate, date, endDate) {
- return (this.localeData && [
- h("calcite-date-picker-month-header", { activeDate: activeDate, headingLevel: this.headingLevel || HEADING_LEVEL, intlNextMonth: this.intlNextMonth, intlPrevMonth: this.intlPrevMonth, intlYear: this.intlYear, localeData: this.localeData, max: maxDate, min: minDate, onCalciteDatePickerSelect: this.monthHeaderSelectChange, scale: this.scale, selectedDate: this.activeRange === "end" ? endDate : date || new Date() }),
- h("calcite-date-picker-month", { activeDate: activeDate, endDate: this.range ? endDate : undefined, hoverRange: this.hoverRange, localeData: this.localeData, max: maxDate, min: minDate, onCalciteDatePickerActiveDateChange: this.monthActiveDateChange, onCalciteDatePickerSelect: this.monthDateChange, onCalciteInternalDatePickerHover: this.monthHoverChange, onCalciteInternalDatePickerMouseOut: this.monthMouseOutChange, scale: this.scale, selectedDate: this.activeRange === "end" ? endDate : date, startDate: this.range ? date : undefined })
- ]);
- }
- /**
- * Update date instance of start if valid
- *
- * @param startDate
- * @param emit
- */
- setStartAsDate(startDate, emit) {
- this.startAsDate = startDate;
- this.mostRecentRangeValue = this.startAsDate;
- if (emit) {
- this.calciteDatePickerRangeChange.emit({
- startDate,
- endDate: this.endAsDate
- });
- }
- }
- /**
- * Update date instance of end if valid
- *
- * @param endDate
- * @param emit
- */
- setEndAsDate(endDate, emit) {
- this.endAsDate = endDate ? setEndOfDay(endDate) : endDate;
- this.mostRecentRangeValue = this.endAsDate;
- if (emit) {
- this.calciteDatePickerRangeChange.emit({
- startDate: this.startAsDate,
- endDate
- });
- }
- }
- setEndDate(date) {
- this.end = date ? dateToISO(date) : "";
- this.setEndAsDate(date, true);
- this.activeEndDate = date || null;
- }
- setStartDate(date) {
- this.start = date ? dateToISO(date) : "";
- this.setStartAsDate(date, true);
- this.activeStartDate = date || null;
- }
- /**
- * Get an active date using the value, or current date as default
- *
- * @param value
- * @param min
- * @param max
- */
- getActiveDate(value, min, max) {
- return dateFromRange(this.activeDate, min, max) || value || dateFromRange(new Date(), min, max);
- }
- getActiveStartDate(value, min, max) {
- return (dateFromRange(this.activeStartDate, min, max) || value || dateFromRange(new Date(), min, max));
- }
- getActiveEndDate(value, min, max) {
- return (dateFromRange(this.activeEndDate, min, max) || value || dateFromRange(new Date(), min, max));
- }
- static get is() { return "calcite-date-picker"; }
- static get encapsulation() { return "shadow"; }
- static get originalStyleUrls() {
- return {
- "$": ["date-picker.scss"]
- };
- }
- static get styleUrls() {
- return {
- "$": ["date-picker.css"]
- };
- }
- static get assetsDirs() { return ["assets"]; }
- static get properties() {
- return {
- "activeRange": {
- "type": "string",
- "mutable": false,
- "complexType": {
- "original": "\"start\" | \"end\"",
- "resolved": "\"end\" | \"start\"",
- "references": {}
- },
- "required": false,
- "optional": true,
- "docs": {
- "tags": [],
- "text": "Active range"
- },
- "attribute": "active-range",
- "reflect": true
- },
- "value": {
- "type": "string",
- "mutable": true,
- "complexType": {
- "original": "string | string[]",
- "resolved": "string | string[]",
- "references": {}
- },
- "required": false,
- "optional": true,
- "docs": {
- "tags": [],
- "text": "Selected date"
- },
- "attribute": "value",
- "reflect": false
- },
- "headingLevel": {
- "type": "number",
- "mutable": false,
- "complexType": {
- "original": "HeadingLevel",
- "resolved": "1 | 2 | 3 | 4 | 5 | 6",
- "references": {
- "HeadingLevel": {
- "location": "import",
- "path": "../functional/Heading"
- }
- }
- },
- "required": false,
- "optional": false,
- "docs": {
- "tags": [],
- "text": "Number at which section headings should start for this component."
- },
- "attribute": "heading-level",
- "reflect": true
- },
- "valueAsDate": {
- "type": "unknown",
- "mutable": true,
- "complexType": {
- "original": "Date | Date[]",
- "resolved": "Date | Date[]",
- "references": {
- "Date": {
- "location": "global"
- }
- }
- },
- "required": false,
- "optional": true,
- "docs": {
- "tags": [],
- "text": "Selected date as full date object"
- }
- },
- "startAsDate": {
- "type": "unknown",
- "mutable": true,
- "complexType": {
- "original": "Date",
- "resolved": "Date",
- "references": {
- "Date": {
- "location": "global"
- }
- }
- },
- "required": false,
- "optional": true,
- "docs": {
- "tags": [{
- "name": "deprecated",
- "text": "use valueAsDate instead"
- }],
- "text": "Selected start date as full date object"
- }
- },
- "endAsDate": {
- "type": "unknown",
- "mutable": true,
- "complexType": {
- "original": "Date",
- "resolved": "Date",
- "references": {
- "Date": {
- "location": "global"
- }
- }
- },
- "required": false,
- "optional": true,
- "docs": {
- "tags": [{
- "name": "deprecated",
- "text": "use valueAsDate instead"
- }],
- "text": "Selected end date as full date object"
- }
- },
- "minAsDate": {
- "type": "unknown",
- "mutable": true,
- "complexType": {
- "original": "Date",
- "resolved": "Date",
- "references": {
- "Date": {
- "location": "global"
- }
- }
- },
- "required": false,
- "optional": true,
- "docs": {
- "tags": [],
- "text": "Earliest allowed date as full date object"
- }
- },
- "maxAsDate": {
- "type": "unknown",
- "mutable": true,
- "complexType": {
- "original": "Date",
- "resolved": "Date",
- "references": {
- "Date": {
- "location": "global"
- }
- }
- },
- "required": false,
- "optional": true,
- "docs": {
- "tags": [],
- "text": "Latest allowed date as full date object"
- }
- },
- "min": {
- "type": "string",
- "mutable": true,
- "complexType": {
- "original": "string",
- "resolved": "string",
- "references": {}
- },
- "required": false,
- "optional": true,
- "docs": {
- "tags": [],
- "text": "Earliest allowed date (\"yyyy-mm-dd\")"
- },
- "attribute": "min",
- "reflect": true
- },
- "max": {
- "type": "string",
- "mutable": true,
- "complexType": {
- "original": "string",
- "resolved": "string",
- "references": {}
- },
- "required": false,
- "optional": true,
- "docs": {
- "tags": [],
- "text": "Latest allowed date (\"yyyy-mm-dd\")"
- },
- "attribute": "max",
- "reflect": true
- },
- "intlPrevMonth": {
- "type": "string",
- "mutable": false,
- "complexType": {
- "original": "string",
- "resolved": "string",
- "references": {}
- },
- "required": false,
- "optional": true,
- "docs": {
- "tags": [{
- "name": "default",
- "text": "\"Previous month\""
- }],
- "text": "Localized string for \"previous month\" (used for aria label)"
- },
- "attribute": "intl-prev-month",
- "reflect": false,
- "defaultValue": "TEXT.prevMonth"
- },
- "intlNextMonth": {
- "type": "string",
- "mutable": false,
- "complexType": {
- "original": "string",
- "resolved": "string",
- "references": {}
- },
- "required": false,
- "optional": true,
- "docs": {
- "tags": [{
- "name": "default",
- "text": "\"Next month\""
- }],
- "text": "Localized string for \"next month\" (used for aria label)"
- },
- "attribute": "intl-next-month",
- "reflect": false,
- "defaultValue": "TEXT.nextMonth"
- },
- "intlYear": {
- "type": "string",
- "mutable": false,
- "complexType": {
- "original": "string",
- "resolved": "string",
- "references": {}
- },
- "required": false,
- "optional": true,
- "docs": {
- "tags": [{
- "name": "default",
- "text": "\"Year\""
- }],
- "text": "Localized string for \"year\" (used for aria label)"
- },
- "attribute": "intl-year",
- "reflect": false,
- "defaultValue": "TEXT.year"
- },
- "locale": {
- "type": "string",
- "mutable": false,
- "complexType": {
- "original": "string",
- "resolved": "string",
- "references": {}
- },
- "required": false,
- "optional": true,
- "docs": {
- "tags": [{
- "name": "deprecated",
- "text": "set the global `lang` attribute on the element instead."
- }, {
- "name": "mdn",
- "text": "[lang](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang)"
- }],
- "text": "Specifies the BCP 47 language tag for the desired language and country format."
- },
- "attribute": "locale",
- "reflect": false
- },
- "numberingSystem": {
- "type": "string",
- "mutable": false,
- "complexType": {
- "original": "NumberingSystem",
- "resolved": "\"arab\" | \"arabext\" | \"bali\" | \"beng\" | \"deva\" | \"fullwide\" | \"gujr\" | \"guru\" | \"hanidec\" | \"khmr\" | \"knda\" | \"laoo\" | \"latn\" | \"limb\" | \"mlym\" | \"mong\" | \"mymr\" | \"orya\" | \"tamldec\" | \"telu\" | \"thai\" | \"tibt\"",
- "references": {
- "NumberingSystem": {
- "location": "import",
- "path": "../../utils/locale"
- }
- }
- },
- "required": false,
- "optional": true,
- "docs": {
- "tags": [],
- "text": "Specifies the Unicode numeral system used by the component for localization. This property cannot be dynamically changed."
- },
- "attribute": "numbering-system",
- "reflect": true
- },
- "scale": {
- "type": "string",
- "mutable": false,
- "complexType": {
- "original": "\"s\" | \"m\" | \"l\"",
- "resolved": "\"l\" | \"m\" | \"s\"",
- "references": {}
- },
- "required": false,
- "optional": false,
- "docs": {
- "tags": [],
- "text": "specify the scale of the date picker"
- },
- "attribute": "scale",
- "reflect": true,
- "defaultValue": "\"m\""
- },
- "range": {
- "type": "boolean",
- "mutable": false,
- "complexType": {
- "original": "boolean",
- "resolved": "boolean",
- "references": {}
- },
- "required": false,
- "optional": false,
- "docs": {
- "tags": [],
- "text": "Range mode activation"
- },
- "attribute": "range",
- "reflect": true,
- "defaultValue": "false"
- },
- "start": {
- "type": "string",
- "mutable": true,
- "complexType": {
- "original": "string",
- "resolved": "string",
- "references": {}
- },
- "required": false,
- "optional": true,
- "docs": {
- "tags": [{
- "name": "deprecated",
- "text": "use value instead"
- }],
- "text": "Selected start date"
- },
- "attribute": "start",
- "reflect": true
- },
- "end": {
- "type": "string",
- "mutable": true,
- "complexType": {
- "original": "string",
- "resolved": "string",
- "references": {}
- },
- "required": false,
- "optional": true,
- "docs": {
- "tags": [{
- "name": "deprecated",
- "text": "use value instead"
- }],
- "text": "Selected end date"
- },
- "attribute": "end",
- "reflect": true
- },
- "proximitySelectionDisabled": {
- "type": "boolean",
- "mutable": false,
- "complexType": {
- "original": "boolean",
- "resolved": "boolean",
- "references": {}
- },
- "required": false,
- "optional": false,
- "docs": {
- "tags": [],
- "text": "Disables the default behaviour on the third click of narrowing or extending the range and instead starts a new range."
- },
- "attribute": "proximity-selection-disabled",
- "reflect": true,
- "defaultValue": "false"
- }
- };
- }
- static get states() {
- return {
- "activeDate": {},
- "activeStartDate": {},
- "activeEndDate": {},
- "globalAttributes": {},
- "effectiveLocale": {},
- "localeData": {},
- "hoverRange": {}
- };
- }
- static get events() {
- return [{
- "method": "calciteDatePickerChange",
- "name": "calciteDatePickerChange",
- "bubbles": true,
- "cancelable": false,
- "composed": true,
- "docs": {
- "tags": [],
- "text": "Trigger calcite date change when a user changes the date."
- },
- "complexType": {
- "original": "Date",
- "resolved": "Date",
- "references": {
- "Date": {
- "location": "global"
- }
- }
- }
- }, {
- "method": "calciteDatePickerRangeChange",
- "name": "calciteDatePickerRangeChange",
- "bubbles": true,
- "cancelable": false,
- "composed": true,
- "docs": {
- "tags": [{
- "name": "see",
- "text": "[DateRangeChange](https://github.com/Esri/calcite-components/blob/master/src/components/date-picker/interfaces.ts#L1)"
- }],
- "text": "Trigger calcite date change when a user changes the date range."
- },
- "complexType": {
- "original": "DateRangeChange",
- "resolved": "DateRangeChange",
- "references": {
- "DateRangeChange": {
- "location": "import",
- "path": "./interfaces"
- }
- }
- }
- }];
- }
- static get elementRef() { return "el"; }
- static get watchers() {
- return [{
- "propName": "valueAsDate",
- "methodName": "handleValueAsDate"
- }, {
- "propName": "startAsDate",
- "methodName": "handleRangeChange"
- }, {
- "propName": "endAsDate",
- "methodName": "handleRangeChange"
- }, {
- "propName": "min",
- "methodName": "onMinChanged"
- }, {
- "propName": "max",
- "methodName": "onMaxChanged"
- }, {
- "propName": "value",
- "methodName": "valueHandler"
- }, {
- "propName": "start",
- "methodName": "startWatcher"
- }, {
- "propName": "end",
- "methodName": "endWatcher"
- }, {
- "propName": "effectiveLocale",
- "methodName": "loadLocaleData"
- }];
- }
- }
|