@govtechsg/sgds-web-component 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Masthead/index.js +1 -1
- package/base/sgds-element.cjs2.js +1 -1
- package/base/sgds-element2.js +1 -1
- package/components/Accordion/index.umd.js +3 -3
- package/components/Accordion/index.umd.js.map +1 -1
- package/components/Accordion/sgds-accordion.cjs.js +2 -2
- package/components/Accordion/sgds-accordion.cjs.js.map +1 -1
- package/components/Accordion/sgds-accordion.js +2 -2
- package/components/Accordion/sgds-accordion.js.map +1 -1
- package/components/ActionCard/index.umd.js +1 -1
- package/components/Alert/index.umd.js +1 -1
- package/components/Badge/index.umd.js +1 -1
- package/components/Breadcrumb/index.umd.js +1 -1
- package/components/Button/index.umd.js +1 -1
- package/components/Card/index.umd.js +1 -1
- package/components/Checkbox/index.umd.js +1 -1
- package/components/ComboBox/index.umd.js +10 -5
- package/components/ComboBox/index.umd.js.map +1 -1
- package/components/Datepicker/datepicker-calendar.cjs.js +43 -23
- package/components/Datepicker/datepicker-calendar.cjs.js.map +1 -1
- package/components/Datepicker/datepicker-calendar.cjs2.js +1 -1
- package/components/Datepicker/datepicker-calendar.d.ts +0 -1
- package/components/Datepicker/datepicker-calendar.js +43 -23
- package/components/Datepicker/datepicker-calendar.js.map +1 -1
- package/components/Datepicker/datepicker-calendar2.js +1 -1
- package/components/Datepicker/datepicker-header.cjs.js +44 -9
- package/components/Datepicker/datepicker-header.cjs.js.map +1 -1
- package/components/Datepicker/datepicker-header.cjs2.js +1 -1
- package/components/Datepicker/datepicker-header.d.ts +5 -1
- package/components/Datepicker/datepicker-header.js +44 -9
- package/components/Datepicker/datepicker-header.js.map +1 -1
- package/components/Datepicker/datepicker-header2.js +1 -1
- package/components/Datepicker/datepicker-input.cjs.js +4 -0
- package/components/Datepicker/datepicker-input.cjs.js.map +1 -1
- package/components/Datepicker/datepicker-input.d.ts +1 -0
- package/components/Datepicker/datepicker-input.js +4 -0
- package/components/Datepicker/datepicker-input.js.map +1 -1
- package/components/Datepicker/index.umd.js +252 -166
- package/components/Datepicker/index.umd.js.map +1 -1
- package/components/Datepicker/sgds-datepicker.cjs.js +25 -2
- package/components/Datepicker/sgds-datepicker.cjs.js.map +1 -1
- package/components/Datepicker/sgds-datepicker.d.ts +7 -1
- package/components/Datepicker/sgds-datepicker.js +25 -2
- package/components/Datepicker/sgds-datepicker.js.map +1 -1
- package/components/Datepicker/types.d.ts +0 -3
- package/components/Drawer/index.umd.js +1 -1
- package/components/Dropdown/index.umd.js +1 -1
- package/components/FileUpload/index.umd.js +2 -1
- package/components/FileUpload/index.umd.js.map +1 -1
- package/components/FileUpload/sgds-file-upload.cjs.js +1 -0
- package/components/FileUpload/sgds-file-upload.cjs.js.map +1 -1
- package/components/FileUpload/sgds-file-upload.d.ts +1 -0
- package/components/FileUpload/sgds-file-upload.js +1 -0
- package/components/FileUpload/sgds-file-upload.js.map +1 -1
- package/components/Footer/index.umd.js +1 -1
- package/components/Input/index.umd.js +10 -5
- package/components/Input/index.umd.js.map +1 -1
- package/components/Input/sgds-input.cjs.js +9 -4
- package/components/Input/sgds-input.cjs.js.map +1 -1
- package/components/Input/sgds-input.d.ts +1 -0
- package/components/Input/sgds-input.js +9 -4
- package/components/Input/sgds-input.js.map +1 -1
- package/components/Mainnav/index.umd.js +5989 -6128
- package/components/Mainnav/index.umd.js.map +1 -1
- package/components/Mainnav/sgds-mainnav.cjs.js +102 -29
- package/components/Mainnav/sgds-mainnav.cjs.js.map +1 -1
- package/components/Mainnav/sgds-mainnav.d.ts +16 -4
- package/components/Mainnav/sgds-mainnav.js +103 -26
- package/components/Mainnav/sgds-mainnav.js.map +1 -1
- package/components/Masthead/index.umd.js +1 -1
- package/components/Modal/index.umd.js +1 -1
- package/components/Pagination/index.umd.js +231 -41
- package/components/Pagination/index.umd.js.map +1 -1
- package/components/Pagination/sgds-pagination.cjs.js +94 -39
- package/components/Pagination/sgds-pagination.cjs.js.map +1 -1
- package/components/Pagination/sgds-pagination.cjs2.js +1 -1
- package/components/Pagination/sgds-pagination.d.ts +20 -13
- package/components/Pagination/sgds-pagination.js +95 -40
- package/components/Pagination/sgds-pagination.js.map +1 -1
- package/components/Pagination/sgds-pagination2.js +1 -1
- package/components/Progress/index.umd.js +1 -1
- package/components/QuantityToggle/index.umd.js +26 -8
- package/components/QuantityToggle/index.umd.js.map +1 -1
- package/components/QuantityToggle/sgds-quantity-toggle.cjs.js +25 -7
- package/components/QuantityToggle/sgds-quantity-toggle.cjs.js.map +1 -1
- package/components/QuantityToggle/sgds-quantity-toggle.d.ts +1 -0
- package/components/QuantityToggle/sgds-quantity-toggle.js +25 -7
- package/components/QuantityToggle/sgds-quantity-toggle.js.map +1 -1
- package/components/Radio/index.umd.js +1 -1
- package/components/Sidenav/index.umd.js +505 -1648
- package/components/Sidenav/index.umd.js.map +1 -1
- package/components/Sidenav/sgds-sidenav-item.cjs.js +122 -45
- package/components/Sidenav/sgds-sidenav-item.cjs.js.map +1 -1
- package/components/Sidenav/sgds-sidenav-item.d.ts +19 -8
- package/components/Sidenav/sgds-sidenav-item.js +123 -42
- package/components/Sidenav/sgds-sidenav-item.js.map +1 -1
- package/components/Sidenav/sgds-sidenav.cjs.js +38 -12
- package/components/Sidenav/sgds-sidenav.cjs.js.map +1 -1
- package/components/Sidenav/sgds-sidenav.cjs2.js +1 -1
- package/components/Sidenav/sgds-sidenav.d.ts +9 -0
- package/components/Sidenav/sgds-sidenav.js +39 -13
- package/components/Sidenav/sgds-sidenav.js.map +1 -1
- package/components/Sidenav/sgds-sidenav2.js +1 -1
- package/components/Spinner/index.umd.js +1 -1
- package/components/Stepper/index.umd.js +1 -1
- package/components/Tab/index.umd.js +1 -1
- package/components/Table/index.umd.js +1 -1
- package/components/Textarea/index.umd.js +1 -1
- package/components/Toast/index.umd.js +1 -1
- package/components/Tooltip/index.umd.js +1 -1
- package/components/index.umd.js +534 -539
- package/components/index.umd.js.map +1 -1
- package/index.umd.js +534 -539
- package/index.umd.js.map +1 -1
- package/package.json +2 -2
- package/react/mainnav/index.cjs.js +6 -1
- package/react/mainnav/index.cjs.js.map +1 -1
- package/react/mainnav/index.js +6 -1
- package/react/mainnav/index.js.map +1 -1
- package/react/sidenav-item/index.cjs.js +5 -1
- package/react/sidenav-item/index.cjs.js.map +1 -1
- package/react/sidenav-item/index.js +5 -1
- package/react/sidenav-item/index.js.map +1 -1
|
@@ -7,16 +7,16 @@ var scopedElements = require('@open-wc/scoped-elements');
|
|
|
7
7
|
var dateFns = require('date-fns');
|
|
8
8
|
var lit = require('lit');
|
|
9
9
|
var decorators_js = require('lit/decorators.js');
|
|
10
|
+
var classMap_js = require('lit/directives/class-map.js');
|
|
10
11
|
var live_js = require('lit/directives/live.js');
|
|
11
12
|
var ref_js = require('lit/directives/ref.js');
|
|
12
13
|
var dropdownElement = require('../../base/dropdown-element.cjs.js');
|
|
14
|
+
var time = require('../../utils/time.cjs.js');
|
|
13
15
|
var watch = require('../../utils/watch.cjs.js');
|
|
14
16
|
var datepickerCalendar = require('./datepicker-calendar.cjs.js');
|
|
15
17
|
var datepickerHeader = require('./datepicker-header.cjs.js');
|
|
16
18
|
var datepickerInput = require('./datepicker-input.cjs.js');
|
|
17
19
|
var sgdsDatepicker = require('./sgds-datepicker.cjs2.js');
|
|
18
|
-
var time = require('../../utils/time.cjs.js');
|
|
19
|
-
var classMap_js = require('lit/directives/class-map.js');
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* @summary The `DatePicker` Component is built using `Dropdown`, `Input` and `Button` components. By default, the Calendar points to today's date and input has no value. Users can either pick dates from the calendar or type dates through the input
|
|
@@ -75,6 +75,7 @@ class SgdsDatepicker extends scopedElements.ScopedElementsMixin(dropdownElement.
|
|
|
75
75
|
this.noFlip = false;
|
|
76
76
|
/** The drop position of menu relative to the toggle button */
|
|
77
77
|
this.drop = "down";
|
|
78
|
+
/**@internal */
|
|
78
79
|
this.value = "";
|
|
79
80
|
this.view = "days";
|
|
80
81
|
this.selectedDateRange = [];
|
|
@@ -102,6 +103,11 @@ class SgdsDatepicker extends scopedElements.ScopedElementsMixin(dropdownElement.
|
|
|
102
103
|
}
|
|
103
104
|
return this.value;
|
|
104
105
|
};
|
|
106
|
+
this._dialogAriaLabels = {
|
|
107
|
+
days: "Choose date",
|
|
108
|
+
months: "Choose month",
|
|
109
|
+
years: "Choose year"
|
|
110
|
+
};
|
|
105
111
|
this._internals = this.attachInternals();
|
|
106
112
|
/**@internal */
|
|
107
113
|
this.modifierOpt = [
|
|
@@ -125,6 +131,7 @@ class SgdsDatepicker extends scopedElements.ScopedElementsMixin(dropdownElement.
|
|
|
125
131
|
this.addEventListener("sgds-empty-input", this._handleEmptyInput);
|
|
126
132
|
this.addEventListener("keydown", this._handleTab);
|
|
127
133
|
this.addEventListener("sgds-hide", this._handleCloseMenu);
|
|
134
|
+
this.addEventListener("sgds-show", this._handleOpenMenu);
|
|
128
135
|
this.initialDisplayDate = this.displayDate || new Date();
|
|
129
136
|
if (this.initialValue && this.initialValue.length > 0) {
|
|
130
137
|
// Validate initialValue against the dateFormat regex
|
|
@@ -189,6 +196,9 @@ class SgdsDatepicker extends scopedElements.ScopedElementsMixin(dropdownElement.
|
|
|
189
196
|
this._setInternalFormValue(this.value);
|
|
190
197
|
}
|
|
191
198
|
async _handleCloseMenu() {
|
|
199
|
+
//return focus to input when menu closes
|
|
200
|
+
const input = await this.datepickerInputAsync;
|
|
201
|
+
input.focus();
|
|
192
202
|
if (this.selectedDateRange.length === 0) {
|
|
193
203
|
this.displayDate = this.initialDisplayDate;
|
|
194
204
|
}
|
|
@@ -199,6 +209,11 @@ class SgdsDatepicker extends scopedElements.ScopedElementsMixin(dropdownElement.
|
|
|
199
209
|
calendar._updateFocusedDate();
|
|
200
210
|
}
|
|
201
211
|
}
|
|
212
|
+
async _handleOpenMenu() {
|
|
213
|
+
const cal = await this.calendar;
|
|
214
|
+
const input = await this.datepickerInputAsync;
|
|
215
|
+
cal.focusOnCalendar(input);
|
|
216
|
+
}
|
|
202
217
|
_handleSelectDatesInput(event) {
|
|
203
218
|
this._handleSelectDates(event.detail);
|
|
204
219
|
this._manageInternalsDefault(this._shadowInput);
|
|
@@ -363,6 +378,7 @@ class SgdsDatepicker extends scopedElements.ScopedElementsMixin(dropdownElement.
|
|
|
363
378
|
class="sgds datepicker dropdown-menu"
|
|
364
379
|
role="dialog"
|
|
365
380
|
part="menu"
|
|
381
|
+
aria-label=${this._dialogAriaLabels[this.view]}
|
|
366
382
|
@click=${(event) => event.stopPropagation()}
|
|
367
383
|
>
|
|
368
384
|
<sgds-datepicker-header
|
|
@@ -388,6 +404,7 @@ class SgdsDatepicker extends scopedElements.ScopedElementsMixin(dropdownElement.
|
|
|
388
404
|
}
|
|
389
405
|
}
|
|
390
406
|
SgdsDatepicker.styles = [dropdownElement.DropdownElement.styles, sgdsDatepicker["default"]];
|
|
407
|
+
/**@internal */
|
|
391
408
|
SgdsDatepicker.formAssociated = true;
|
|
392
409
|
tslib.__decorate([
|
|
393
410
|
decorators_js.property({ type: Boolean, reflect: true })
|
|
@@ -446,12 +463,18 @@ tslib.__decorate([
|
|
|
446
463
|
tslib.__decorate([
|
|
447
464
|
decorators_js.state()
|
|
448
465
|
], SgdsDatepicker.prototype, "focusedTabIndex", void 0);
|
|
466
|
+
tslib.__decorate([
|
|
467
|
+
decorators_js.state()
|
|
468
|
+
], SgdsDatepicker.prototype, "dialogAriaLabel", void 0);
|
|
449
469
|
tslib.__decorate([
|
|
450
470
|
decorators_js.queryAsync("sgds-datepicker-calendar")
|
|
451
471
|
], SgdsDatepicker.prototype, "calendar", void 0);
|
|
452
472
|
tslib.__decorate([
|
|
453
473
|
decorators_js.queryAsync("sgds-datepicker-input")
|
|
454
474
|
], SgdsDatepicker.prototype, "datepickerInputAsync", void 0);
|
|
475
|
+
tslib.__decorate([
|
|
476
|
+
decorators_js.queryAsync("sgds-datepicker-header")
|
|
477
|
+
], SgdsDatepicker.prototype, "datepickerHeaderAsync", void 0);
|
|
455
478
|
tslib.__decorate([
|
|
456
479
|
decorators_js.query("sgds-datepicker-input")
|
|
457
480
|
], SgdsDatepicker.prototype, "datepickerInput", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sgds-datepicker.cjs.js","sources":["../../../src/components/Datepicker/sgds-datepicker.ts"],"sourcesContent":["import { ScopedElementsMixin } from \"@open-wc/scoped-elements\";\nimport { format, parse } from \"date-fns\";\nimport { html } from \"lit\";\nimport { property, query, queryAsync, state } from \"lit/decorators.js\";\nimport { live } from \"lit/directives/live.js\";\nimport { ref } from \"lit/directives/ref.js\";\nimport { DropdownElement } from \"../../base/dropdown-element\";\nimport { watch } from \"../../utils/watch\";\nimport { DatepickerCalendar } from \"./datepicker-calendar\";\nimport { DatepickerHeader } from \"./datepicker-header\";\nimport DatepickerInput from \"./datepicker-input\";\nimport styles from \"./sgds-datepicker.scss\";\nimport { ViewEnum } from \"./types\";\nimport { DATE_PATTERNS, setTimeToNoon } from \"../../utils/time\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { type SgdsFormControl } from \"../../utils/form\";\n\nexport type DateFormat = \"MM/DD/YYYY\" | \"DD/MM/YYYY\" | \"YYYY/MM/DD\";\n\n/**\n * @summary The `DatePicker` Component is built using `Dropdown`, `Input` and `Button` components. By default, the Calendar points to today's date and input has no value. Users can either pick dates from the calendar or type dates through the input\n *\n * @event sgds-change-date - Emitted when the state of datepicker's input changes during first load, close button reset click & date click. Date values can be accessed via event.target.value\n *\n * @cssproperty --datepicker-theme-color - Datepicker's overall theme color\n * @cssproperty --datepicker-hover-bg-color - Datepicker's calendar menu hover color\n * @cssproperty --datepicker-bg-color - Datepicker's menu background color\n * @cssproperty --datepicker-closebutton-bg-color - Datepicker's close button background color\n * @cssproperty --datepicker-closebutton-hover-bg-color - Datepicker's close button hover background color\n * @cssproperty --datepicker-closebutton-color - Datepicker's close button color\n * @cssproperty --datepicker-selected-date-bg-color - Selected date's background color\n * @cssproperty --datepicker-selected-date-text-color - Selected date's text color\n *\n * @description displayDate sets the month, year views of the calendar while focusedDate follows the focus which also directly changes\n * displayDate on certain occasions. Example, when keyboard moves up to the next month, it updates displayDate which then affect the current\n * date view of the calendar\n */\nexport class SgdsDatepicker extends ScopedElementsMixin(DropdownElement) implements SgdsFormControl {\n static styles = [DropdownElement.styles, styles];\n static formAssociated = true;\n private _internals: ElementInternals;\n\n /**@internal */\n static get scopedElements() {\n return {\n \"sgds-datepicker-input\": DatepickerInput,\n \"sgds-datepicker-calendar\": DatepickerCalendar,\n \"sgds-datepicker-header\": DatepickerHeader\n };\n }\n\n /** When true, adds required attribute to input element */\n @property({ type: Boolean, reflect: true }) required = false;\n /**The datepicker input's name attribute */\n @property({ reflect: true }) name: string;\n /** When true, adds disabled attribute to input and button element */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** The initial value of DatePicker on first load for single & range mode as array of string. eg.'[\"22/12/2023\"]' for single & '[\"22/12/2023\",\"25/12/2023\"]' for range respectively */\n @property({ type: Array, reflect: true }) initialValue: string[] = [];\n\n /** Date format reflected on input */\n @property({ type: String }) dateFormat: DateFormat = \"DD/MM/YYYY\";\n\n /** ISO date string to set the lowest allowable date value. e.g. \"2016-05-19T12:00:00.000Z\" */\n @property({ type: String }) minDate = \"\";\n\n /** ISO date string to set the highest allowable date value. e.g. \"2016-05-19T12:00:00.000Z\" */\n @property({ type: String }) maxDate = \"\";\n\n /** Changes DatePicker to single date selection or range date selection */\n @property({ type: String, reflect: true }) mode: \"single\" | \"range\" = \"single\";\n\n /**Feedback text for error state when date input is invalid */\n @property({ type: String, reflect: true }) invalidFeedback = \"Please enter a valid date\";\n\n /** The datepicker input's label */\n @property({ reflect: true }) label = \"\";\n\n /** The datepicker input's hint text below the label */\n @property({ reflect: true }) hintText = \"\";\n\n /** Controls auto-flipping of menu */\n @property({ type: Boolean, reflect: true, state: false })\n noFlip = false;\n\n /** The drop position of menu relative to the toggle button */\n @property({ type: String, reflect: true, state: false })\n drop: \"up\" | \"down\" = \"down\";\n\n /** Provides the date context for Calendar to present the appropriate view. Defaults to today's date */\n @property({ attribute: false }) displayDate: Date;\n\n @state() value = \"\";\n\n @state()\n private view: ViewEnum = \"days\";\n\n @state() private selectedDateRange: Date[] = [];\n\n @state() private focusedDate: Date;\n\n @state() private focusedTabIndex = 3;\n\n private initialDisplayDate: Date;\n\n @queryAsync(\"sgds-datepicker-calendar\")\n private calendar: Promise<DatepickerCalendar>;\n\n @queryAsync(\"sgds-datepicker-input\")\n private datepickerInputAsync: Promise<DatepickerInput>;\n\n @query(\"sgds-datepicker-input\")\n private datepickerInput: DatepickerInput;\n\n /** Checks for validity and shows the browser's validation message if the control is invalid. */\n public reportValidity(): boolean {\n return this._internals.reportValidity();\n }\n constructor() {\n super();\n this._internals = this.attachInternals();\n /**@internal */\n this.modifierOpt = [\n {\n name: \"offset\",\n options: {\n offset: [0, 10]\n }\n }\n ];\n }\n\n async connectedCallback() {\n super.connectedCallback();\n this.addEventListener(\"sgds-view\", this._handleViewChanged);\n this.addEventListener(\"sgds-change-calendar\", this._handleDateChanged);\n this.addEventListener(\"sgds-update-focus\", this._handleFocusDateChanged);\n this.addEventListener(\"sgds-selectmonth\", this._handleSelectMonth);\n this.addEventListener(\"sgds-selectyear\", this._handleSelectYear);\n this.addEventListener(\"sgds-selectdates\", this._handleSelectDatesAndClose);\n this.addEventListener(\"sgds-selectdates-input\", this._handleSelectDatesInput);\n this.addEventListener(\"sgds-empty-input\", this._handleEmptyInput);\n this.addEventListener(\"keydown\", this._handleTab);\n this.addEventListener(\"sgds-hide\", this._handleCloseMenu);\n this.initialDisplayDate = this.displayDate || new Date();\n if (this.initialValue && this.initialValue.length > 0) {\n // Validate initialValue against the dateFormat regex\n const dateFormatRegex = new RegExp(this._getDateFormatRegex());\n // const startDateString = this.initialValue[0];\n const invalidDates = this.initialValue.filter(v => !dateFormatRegex.test(v));\n if (invalidDates.length > 0) {\n return console.error(\"Invalid date format in initialValue:\", invalidDates);\n } else {\n const initialSelectedDates = this.initialValue.map(v =>\n setTimeToNoon(parse(v, DATE_PATTERNS[this.dateFormat].fnsPattern, new Date()))\n );\n this._handleSelectDates(initialSelectedDates);\n }\n } else {\n this.displayDate = this.initialDisplayDate;\n }\n }\n\n async firstUpdated() {\n super.firstUpdated();\n if (this.menuIsOpen) {\n const input = await this.datepickerInputAsync;\n this.showMenu();\n const cal = await this.calendar;\n cal.focusOnCalendar(input);\n }\n\n const shadowInput = await this.datepickerInput.shadowInput;\n this._manageInternalsDefault(shadowInput);\n this._internals.setValidity(shadowInput.validity, shadowInput.validationMessage, shadowInput);\n }\n\n /** @internal */\n private _getDateFormatRegex(): string {\n // validate date strings and adhere to the specified date format\n return (\n this.dateFormat\n // Replace any special characters with their escaped version using \"\\\\$&\"\n .replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")\n // Replace 'MM' with '\\\\d{2}', which matches two digits representing the month (e.g., 01, 12)\n .replace(\"MM\", \"\\\\d{2}\")\n // Replace 'DD' with '\\\\d{2}', which matches two digits representing the day (e.g., 01, 31)\n .replace(\"DD\", \"\\\\d{2}\")\n // Replace 'YYYY' with '\\\\d{4}', which matches four digits representing the year (e.g., 2021)\n .replace(\"YYYY\", \"\\\\d{4}\")\n // Replace '/' with '\\\\/', which matches the forward slash character\n .replace(\"/\", \"\\\\/\")\n );\n }\n private _handleTab(event: KeyboardEvent) {\n if (!this.menuIsOpen) {\n return;\n }\n const tabIndexArray = Array(4);\n if (event.shiftKey && event.key === \"Tab\") {\n event.preventDefault();\n this.focusedTabIndex = (this.focusedTabIndex - 1 + tabIndexArray.length) % tabIndexArray.length;\n } else if (event.key === \"Tab\") {\n event.preventDefault();\n this.focusedTabIndex = (this.focusedTabIndex + 1 + tabIndexArray.length) % tabIndexArray.length;\n }\n }\n\n @watch(\"value\")\n _handleValueChange() {\n this.emit(\"sgds-change-date\");\n this._setInternalFormValue(this.value);\n }\n\n private async _handleCloseMenu() {\n if (this.selectedDateRange.length === 0) {\n this.displayDate = this.initialDisplayDate;\n } else {\n const selectedDatesLength = this.selectedDateRange.length;\n this.displayDate = this.selectedDateRange[selectedDatesLength - 1];\n const calendar = await this.calendar;\n calendar._updateFocusedDate();\n }\n }\n\n private _makeInputValueString = (startDate: Date, endDate: Date, dateFormat: string) => {\n if (!startDate && !endDate) return this.value;\n const formatDate = (date: Date) => format(date, DATE_PATTERNS[dateFormat].fnsPattern);\n switch (this.mode) {\n case \"single\": {\n if (startDate) {\n this.value = formatDate(startDate);\n }\n break;\n }\n case \"range\": {\n if (startDate && endDate) {\n this.value = `${formatDate(startDate)} - ${formatDate(endDate)}`;\n }\n if (startDate && !endDate) {\n this.value = `${formatDate(startDate)} - ${this.dateFormat.toLowerCase()}`;\n }\n break;\n }\n }\n return this.value;\n };\n private _handleSelectDatesInput(event: CustomEvent<Date[]>) {\n this._handleSelectDates(event.detail);\n this._manageInternalsDefault(this._shadowInput);\n }\n private async _handleSelectDates(newSelectedDates: Date[]) {\n newSelectedDates.sort((a: Date, b: Date) => a.getTime() - b.getTime());\n this.displayDate = newSelectedDates[0];\n this.focusedDate = newSelectedDates[0];\n this.selectedDateRange = newSelectedDates;\n\n // Get the formattedDate value for the selected dates\n const formattedDate = this._makeInputValueString(\n this.selectedDateRange[0],\n this.selectedDateRange[1],\n this.dateFormat\n );\n\n // Set formattedDate value as the new value for sgds-input\n this.value = formattedDate;\n const input = await this.datepickerInputAsync;\n input.updateMaskValue();\n }\n\n private get _shadowInput() {\n return this.datepickerInput.shadowRoot.querySelector(\"input\");\n }\n private _handleSelectDatesAndClose(event: CustomEvent<Date[]>) {\n this._handleSelectDates(event.detail);\n\n if (this.mode === \"range\" && this.selectedDateRange.length === 2) {\n this.hideMenu();\n } else if (this.mode === \"single\" && this.selectedDateRange.length === 1) {\n this.hideMenu();\n }\n this._manageInternalsValid();\n }\n\n /** update latest view state from datepicker-header */\n private _handleViewChanged(event: CustomEvent<string>) {\n this.view = event.detail as ViewEnum;\n }\n\n private _handleDateChanged(event: CustomEvent<Date>) {\n this.displayDate = event.detail;\n }\n private _handleFocusDateChanged(event: CustomEvent<Date>) {\n this.focusedDate = event.detail;\n }\n\n private _handleSelectMonth(event: CustomEvent<Date>) {\n this.displayDate = event.detail;\n }\n\n private _handleSelectYear(event: CustomEvent<Date>) {\n this.displayDate = event.detail;\n }\n private async _handleInvalidInput() {\n this.selectedDateRange = [];\n this.displayDate = this.initialDisplayDate;\n this._manageInternalsBadInput();\n }\n private async _handleButtonResetClick() {\n this.displayDate = this.initialDisplayDate;\n this.selectedDateRange = [];\n this.value = \"\";\n this.view = \"days\";\n this.hideMenu();\n const input = await this.datepickerInputAsync;\n input.setInvalid(false);\n input.destroyInputMask();\n await input.applyInputMask();\n\n this._manageInternalsRequired();\n }\n\n private async _handleEmptyInput() {\n this._manageInternalsRequired();\n }\n\n private _manageInternalsRequired() {\n this.required\n ? this._internals.setValidity(\n {\n valueMissing: true\n },\n \"Please fill in this field\",\n this._shadowInput\n )\n : this._internals.setValidity({});\n }\n private _manageInternalsBadInput() {\n this._internals.setValidity(\n {\n badInput: true\n },\n \"The chosen date(s) are invalid\",\n this._shadowInput\n );\n }\n\n private _manageInternalsValid() {\n this._internals.setValidity({});\n }\n\n private _manageInternalsDefault(inputEl: HTMLInputElement) {\n this._internals.setValidity(inputEl.validity, inputEl.validationMessage, inputEl);\n }\n\n private _setInternalFormValue(value: string) {\n this._internals.setFormValue(value);\n }\n\n private async _handleInputMaskChange(e: CustomEvent) {\n this.value = e.detail;\n }\n render() {\n const svgEl = html`\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n fill=\"currentColor\"\n class=\"bi bi-x\"\n viewBox=\"0 0 16 16\"\n >\n <path\n d=\"M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z\"\n />\n </svg>\n `;\n\n return html`\n <div>\n <sgds-datepicker-input\n .value=${live(this.value)}\n ?required=${this.required}\n ?disabled=${this.disabled}\n placeholder=\"\"\n ${ref(this.myDropdown)}\n mode=${this.mode}\n dateFormat=${this.dateFormat}\n invalidFeedback=${this.invalidFeedback}\n @sgds-mask-input-change=${this._handleInputMaskChange}\n @sgds-invalid-input=${this._handleInvalidInput}\n minDate=${this.minDate}\n maxDate=${this.maxDate}\n label=${this.label}\n hintText=${this.hintText}\n name=${this.name}\n >\n <button\n slot=\"calendar-btn\"\n class=${classMap({\n \"sgds btn rounded-0 border btn-outline-dark\": true\n })}\n aria-expanded=\"${this.menuIsOpen}\"\n aria-haspopup=\"dialog\"\n aria-controls=${this.dropdownMenuId}\n @click=${() => this.toggleMenu()}\n aria-label=${this.menuIsOpen ? \"Close Calendar\" : \"Open Calendar\"}\n ?disabled=${this.disabled}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n fill=\"currentColor\"\n class=\"bi bi-calendar\"\n viewBox=\"0 0 16 16\"\n >\n <path\n d=\"M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5M1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4z\"\n />\n </svg>\n </button>\n <button\n slot=\"reset-btn\"\n ?disabled=${this.disabled}\n class=\"btn sgds rounded-0 reset-btn\"\n @click=${() => this._handleButtonResetClick()}\n aria-label=\"Reset Datepicker\"\n >\n ${svgEl}\n </button>\n </sgds-datepicker-input>\n\n <ul\n id=${this.dropdownMenuId}\n class=\"sgds datepicker dropdown-menu\"\n role=\"dialog\"\n part=\"menu\"\n @click=${(event: MouseEvent) => event.stopPropagation()}\n >\n <sgds-datepicker-header\n .view=${this.view}\n .displayDate=${this.displayDate}\n .focusedDate=${this.focusedDate}\n .selectedDate=${this.selectedDateRange}\n .focusedTabIndex=${this.focusedTabIndex}\n ></sgds-datepicker-header>\n <sgds-datepicker-calendar\n .show=${this.menuIsOpen}\n .view=${this.view}\n .displayDate=${this.displayDate}\n .mode=${this.mode}\n minDate=${this.minDate}\n maxDate=${this.maxDate}\n .selectedDate=${this.selectedDateRange}\n .focusedTabIndex=${this.focusedTabIndex}\n ></sgds-datepicker-calendar>\n </ul>\n </div>\n `;\n }\n}\n\nexport default SgdsDatepicker;\n"],"names":["ScopedElementsMixin","DropdownElement","DatepickerInput","DatepickerCalendar","DatepickerHeader","format","DATE_PATTERNS","setTimeToNoon","parse","html","live","ref","classMap","styles","__decorate","property","state","queryAsync","query","watch"],"mappings":";;;;;;;;;;;;;;;;;;;;AAmBA;;;;;;;;;;;;;;;;;AAiBG;MACU,cAAe,SAAQA,kCAAmB,CAACC,+BAAe,CAAC,CAAA;;AAMtE,IAAA,WAAW,cAAc,GAAA;QACvB,OAAO;AACL,YAAA,uBAAuB,EAAEC,+BAAe;AACxC,YAAA,0BAA0B,EAAEC,qCAAkB;AAC9C,YAAA,wBAAwB,EAAEC,iCAAgB;SAC3C,CAAC;KACH;;IAmEM,cAAc,GAAA;AACnB,QAAA,OAAO,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE,CAAC;KACzC;AACD,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE,CAAC;;QApEkC,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;;QAIjB,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;;QAGnB,IAAY,CAAA,YAAA,GAAa,EAAE,CAAC;;QAG1C,IAAU,CAAA,UAAA,GAAe,YAAY,CAAC;;QAGtC,IAAO,CAAA,OAAA,GAAG,EAAE,CAAC;;QAGb,IAAO,CAAA,OAAA,GAAG,EAAE,CAAC;;QAGE,IAAI,CAAA,IAAA,GAAuB,QAAQ,CA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A,CAAA;IADCK,WAAK,CAAC,OAAO,CAAC;AAId,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,oBAAA,EAAA,IAAA,CAAA;;;;;"}
|
|
1
|
+
{"version":3,"file":"sgds-datepicker.cjs.js","sources":["../../../src/components/Datepicker/sgds-datepicker.ts"],"sourcesContent":["import { ScopedElementsMixin } from \"@open-wc/scoped-elements\";\nimport { format, parse } from \"date-fns\";\nimport { html } from \"lit\";\nimport { property, query, queryAsync, state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { live } from \"lit/directives/live.js\";\nimport { ref } from \"lit/directives/ref.js\";\nimport { DropdownElement } from \"../../base/dropdown-element\";\nimport { type SgdsFormControl } from \"../../utils/form\";\nimport { DATE_PATTERNS, setTimeToNoon } from \"../../utils/time\";\nimport { watch } from \"../../utils/watch\";\nimport { DatepickerCalendar } from \"./datepicker-calendar\";\nimport { DatepickerHeader } from \"./datepicker-header\";\nimport DatepickerInput from \"./datepicker-input\";\nimport styles from \"./sgds-datepicker.scss\";\nimport { ViewEnum } from \"./types\";\n\nexport type DateFormat = \"MM/DD/YYYY\" | \"DD/MM/YYYY\" | \"YYYY/MM/DD\";\n\n/**\n * @summary The `DatePicker` Component is built using `Dropdown`, `Input` and `Button` components. By default, the Calendar points to today's date and input has no value. Users can either pick dates from the calendar or type dates through the input\n *\n * @event sgds-change-date - Emitted when the state of datepicker's input changes during first load, close button reset click & date click. Date values can be accessed via event.target.value\n *\n * @cssproperty --datepicker-theme-color - Datepicker's overall theme color\n * @cssproperty --datepicker-hover-bg-color - Datepicker's calendar menu hover color\n * @cssproperty --datepicker-bg-color - Datepicker's menu background color\n * @cssproperty --datepicker-closebutton-bg-color - Datepicker's close button background color\n * @cssproperty --datepicker-closebutton-hover-bg-color - Datepicker's close button hover background color\n * @cssproperty --datepicker-closebutton-color - Datepicker's close button color\n * @cssproperty --datepicker-selected-date-bg-color - Selected date's background color\n * @cssproperty --datepicker-selected-date-text-color - Selected date's text color\n *\n * @description displayDate sets the month, year views of the calendar while focusedDate follows the focus which also directly changes\n * displayDate on certain occasions. Example, when keyboard moves up to the next month, it updates displayDate which then affect the current\n * date view of the calendar\n */\nexport class SgdsDatepicker extends ScopedElementsMixin(DropdownElement) implements SgdsFormControl {\n static styles = [DropdownElement.styles, styles];\n /**@internal */\n static formAssociated = true;\n private _internals: ElementInternals;\n\n /**@internal */\n static get scopedElements() {\n return {\n \"sgds-datepicker-input\": DatepickerInput,\n \"sgds-datepicker-calendar\": DatepickerCalendar,\n \"sgds-datepicker-header\": DatepickerHeader\n };\n }\n\n /** When true, adds required attribute to input element */\n @property({ type: Boolean, reflect: true }) required = false;\n /**The datepicker input's name attribute */\n @property({ reflect: true }) name: string;\n /** When true, adds disabled attribute to input and button element */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** The initial value of DatePicker on first load for single & range mode as array of string. eg.'[\"22/12/2023\"]' for single & '[\"22/12/2023\",\"25/12/2023\"]' for range respectively */\n @property({ type: Array, reflect: true }) initialValue: string[] = [];\n\n /** Date format reflected on input */\n @property({ type: String }) dateFormat: DateFormat = \"DD/MM/YYYY\";\n\n /** ISO date string to set the lowest allowable date value. e.g. \"2016-05-19T12:00:00.000Z\" */\n @property({ type: String }) minDate = \"\";\n\n /** ISO date string to set the highest allowable date value. e.g. \"2016-05-19T12:00:00.000Z\" */\n @property({ type: String }) maxDate = \"\";\n\n /** Changes DatePicker to single date selection or range date selection */\n @property({ type: String, reflect: true }) mode: \"single\" | \"range\" = \"single\";\n\n /**Feedback text for error state when date input is invalid */\n @property({ type: String, reflect: true }) invalidFeedback = \"Please enter a valid date\";\n\n /** The datepicker input's label */\n @property({ reflect: true }) label = \"\";\n\n /** The datepicker input's hint text below the label */\n @property({ reflect: true }) hintText = \"\";\n\n /** Controls auto-flipping of menu */\n @property({ type: Boolean, reflect: true, state: false })\n noFlip = false;\n\n /** The drop position of menu relative to the toggle button */\n @property({ type: String, reflect: true, state: false })\n drop: \"up\" | \"down\" = \"down\";\n\n /** Provides the date context for Calendar to present the appropriate view. Defaults to today's date */\n @property({ attribute: false }) displayDate: Date;\n /**@internal */\n @state() value = \"\";\n\n @state()\n private view: ViewEnum = \"days\";\n\n @state() private selectedDateRange: Date[] = [];\n\n @state() private focusedDate: Date;\n\n @state() private focusedTabIndex = 3;\n\n @state() dialogAriaLabel: string;\n\n private initialDisplayDate: Date;\n\n @queryAsync(\"sgds-datepicker-calendar\")\n private calendar: Promise<DatepickerCalendar>;\n\n @queryAsync(\"sgds-datepicker-input\")\n private datepickerInputAsync: Promise<DatepickerInput>;\n\n @queryAsync(\"sgds-datepicker-header\")\n private datepickerHeaderAsync: Promise<DatepickerHeader>;\n\n @query(\"sgds-datepicker-input\")\n private datepickerInput: DatepickerInput;\n\n /** Checks for validity and shows the browser's validation message if the control is invalid. */\n public reportValidity(): boolean {\n return this._internals.reportValidity();\n }\n constructor() {\n super();\n this._internals = this.attachInternals();\n /**@internal */\n this.modifierOpt = [\n {\n name: \"offset\",\n options: {\n offset: [0, 10]\n }\n }\n ];\n }\n\n async connectedCallback() {\n super.connectedCallback();\n this.addEventListener(\"sgds-view\", this._handleViewChanged);\n this.addEventListener(\"sgds-change-calendar\", this._handleDateChanged);\n this.addEventListener(\"sgds-update-focus\", this._handleFocusDateChanged);\n this.addEventListener(\"sgds-selectmonth\", this._handleSelectMonth);\n this.addEventListener(\"sgds-selectyear\", this._handleSelectYear);\n this.addEventListener(\"sgds-selectdates\", this._handleSelectDatesAndClose);\n this.addEventListener(\"sgds-selectdates-input\", this._handleSelectDatesInput);\n this.addEventListener(\"sgds-empty-input\", this._handleEmptyInput);\n this.addEventListener(\"keydown\", this._handleTab);\n this.addEventListener(\"sgds-hide\", this._handleCloseMenu);\n this.addEventListener(\"sgds-show\", this._handleOpenMenu);\n this.initialDisplayDate = this.displayDate || new Date();\n if (this.initialValue && this.initialValue.length > 0) {\n // Validate initialValue against the dateFormat regex\n const dateFormatRegex = new RegExp(this._getDateFormatRegex());\n // const startDateString = this.initialValue[0];\n const invalidDates = this.initialValue.filter(v => !dateFormatRegex.test(v));\n if (invalidDates.length > 0) {\n return console.error(\"Invalid date format in initialValue:\", invalidDates);\n } else {\n const initialSelectedDates = this.initialValue.map(v =>\n setTimeToNoon(parse(v, DATE_PATTERNS[this.dateFormat].fnsPattern, new Date()))\n );\n this._handleSelectDates(initialSelectedDates);\n }\n } else {\n this.displayDate = this.initialDisplayDate;\n }\n }\n\n async firstUpdated() {\n super.firstUpdated();\n if (this.menuIsOpen) {\n const input = await this.datepickerInputAsync;\n this.showMenu();\n const cal = await this.calendar;\n cal.focusOnCalendar(input);\n }\n\n const shadowInput = await this.datepickerInput.shadowInput;\n this._manageInternalsDefault(shadowInput);\n this._internals.setValidity(shadowInput.validity, shadowInput.validationMessage, shadowInput);\n }\n\n /** @internal */\n private _getDateFormatRegex(): string {\n // validate date strings and adhere to the specified date format\n return (\n this.dateFormat\n // Replace any special characters with their escaped version using \"\\\\$&\"\n .replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")\n // Replace 'MM' with '\\\\d{2}', which matches two digits representing the month (e.g., 01, 12)\n .replace(\"MM\", \"\\\\d{2}\")\n // Replace 'DD' with '\\\\d{2}', which matches two digits representing the day (e.g., 01, 31)\n .replace(\"DD\", \"\\\\d{2}\")\n // Replace 'YYYY' with '\\\\d{4}', which matches four digits representing the year (e.g., 2021)\n .replace(\"YYYY\", \"\\\\d{4}\")\n // Replace '/' with '\\\\/', which matches the forward slash character\n .replace(\"/\", \"\\\\/\")\n );\n }\n private _handleTab(event: KeyboardEvent) {\n if (!this.menuIsOpen) {\n return;\n }\n const tabIndexArray = Array(4);\n if (event.shiftKey && event.key === \"Tab\") {\n event.preventDefault();\n this.focusedTabIndex = (this.focusedTabIndex - 1 + tabIndexArray.length) % tabIndexArray.length;\n } else if (event.key === \"Tab\") {\n event.preventDefault();\n this.focusedTabIndex = (this.focusedTabIndex + 1 + tabIndexArray.length) % tabIndexArray.length;\n }\n }\n\n @watch(\"value\")\n _handleValueChange() {\n this.emit(\"sgds-change-date\");\n this._setInternalFormValue(this.value);\n }\n\n private async _handleCloseMenu() {\n //return focus to input when menu closes\n const input = await this.datepickerInputAsync;\n input.focus();\n\n if (this.selectedDateRange.length === 0) {\n this.displayDate = this.initialDisplayDate;\n } else {\n const selectedDatesLength = this.selectedDateRange.length;\n this.displayDate = this.selectedDateRange[selectedDatesLength - 1];\n const calendar = await this.calendar;\n calendar._updateFocusedDate();\n }\n }\n private async _handleOpenMenu() {\n const cal = await this.calendar;\n const input = await this.datepickerInputAsync;\n cal.focusOnCalendar(input);\n }\n\n private _makeInputValueString = (startDate: Date, endDate: Date, dateFormat: string) => {\n if (!startDate && !endDate) return this.value;\n const formatDate = (date: Date) => format(date, DATE_PATTERNS[dateFormat].fnsPattern);\n switch (this.mode) {\n case \"single\": {\n if (startDate) {\n this.value = formatDate(startDate);\n }\n break;\n }\n case \"range\": {\n if (startDate && endDate) {\n this.value = `${formatDate(startDate)} - ${formatDate(endDate)}`;\n }\n if (startDate && !endDate) {\n this.value = `${formatDate(startDate)} - ${this.dateFormat.toLowerCase()}`;\n }\n break;\n }\n }\n return this.value;\n };\n private _handleSelectDatesInput(event: CustomEvent<Date[]>) {\n this._handleSelectDates(event.detail);\n this._manageInternalsDefault(this._shadowInput);\n }\n private async _handleSelectDates(newSelectedDates: Date[]) {\n newSelectedDates.sort((a: Date, b: Date) => a.getTime() - b.getTime());\n this.displayDate = newSelectedDates[0];\n this.focusedDate = newSelectedDates[0];\n this.selectedDateRange = newSelectedDates;\n\n // Get the formattedDate value for the selected dates\n const formattedDate = this._makeInputValueString(\n this.selectedDateRange[0],\n this.selectedDateRange[1],\n this.dateFormat\n );\n\n // Set formattedDate value as the new value for sgds-input\n this.value = formattedDate;\n const input = await this.datepickerInputAsync;\n input.updateMaskValue();\n }\n\n private get _shadowInput() {\n return this.datepickerInput.shadowRoot.querySelector(\"input\");\n }\n private _handleSelectDatesAndClose(event: CustomEvent<Date[]>) {\n this._handleSelectDates(event.detail);\n\n if (this.mode === \"range\" && this.selectedDateRange.length === 2) {\n this.hideMenu();\n } else if (this.mode === \"single\" && this.selectedDateRange.length === 1) {\n this.hideMenu();\n }\n this._manageInternalsValid();\n }\n\n /** update latest view state from datepicker-header */\n private _handleViewChanged(event: CustomEvent<string>) {\n this.view = event.detail as ViewEnum;\n }\n\n private _handleDateChanged(event: CustomEvent<Date>) {\n this.displayDate = event.detail;\n }\n private _handleFocusDateChanged(event: CustomEvent<Date>) {\n this.focusedDate = event.detail;\n }\n\n private _handleSelectMonth(event: CustomEvent<Date>) {\n this.displayDate = event.detail;\n }\n\n private _handleSelectYear(event: CustomEvent<Date>) {\n this.displayDate = event.detail;\n }\n private async _handleInvalidInput() {\n this.selectedDateRange = [];\n this.displayDate = this.initialDisplayDate;\n this._manageInternalsBadInput();\n }\n private async _handleButtonResetClick() {\n this.displayDate = this.initialDisplayDate;\n this.selectedDateRange = [];\n this.value = \"\";\n this.view = \"days\";\n this.hideMenu();\n const input = await this.datepickerInputAsync;\n input.setInvalid(false);\n input.destroyInputMask();\n await input.applyInputMask();\n\n this._manageInternalsRequired();\n }\n\n private async _handleEmptyInput() {\n this._manageInternalsRequired();\n }\n\n private _manageInternalsRequired() {\n this.required\n ? this._internals.setValidity(\n {\n valueMissing: true\n },\n \"Please fill in this field\",\n this._shadowInput\n )\n : this._internals.setValidity({});\n }\n private _manageInternalsBadInput() {\n this._internals.setValidity(\n {\n badInput: true\n },\n \"The chosen date(s) are invalid\",\n this._shadowInput\n );\n }\n\n private _manageInternalsValid() {\n this._internals.setValidity({});\n }\n\n private _manageInternalsDefault(inputEl: HTMLInputElement) {\n this._internals.setValidity(inputEl.validity, inputEl.validationMessage, inputEl);\n }\n\n private _setInternalFormValue(value: string) {\n this._internals.setFormValue(value);\n }\n\n private async _handleInputMaskChange(e: CustomEvent) {\n this.value = e.detail;\n }\n\n private _dialogAriaLabels = {\n days: \"Choose date\",\n months: \"Choose month\",\n years: \"Choose year\"\n };\n\n render() {\n const svgEl = html`\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n fill=\"currentColor\"\n class=\"bi bi-x\"\n viewBox=\"0 0 16 16\"\n >\n <path\n d=\"M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z\"\n />\n </svg>\n `;\n\n return html`\n <div>\n <sgds-datepicker-input\n .value=${live(this.value)}\n ?required=${this.required}\n ?disabled=${this.disabled}\n placeholder=\"\"\n ${ref(this.myDropdown)}\n mode=${this.mode}\n dateFormat=${this.dateFormat}\n invalidFeedback=${this.invalidFeedback}\n @sgds-mask-input-change=${this._handleInputMaskChange}\n @sgds-invalid-input=${this._handleInvalidInput}\n minDate=${this.minDate}\n maxDate=${this.maxDate}\n label=${this.label}\n hintText=${this.hintText}\n name=${this.name}\n >\n <button\n slot=\"calendar-btn\"\n class=${classMap({\n \"sgds btn rounded-0 border btn-outline-dark\": true\n })}\n aria-expanded=\"${this.menuIsOpen}\"\n aria-haspopup=\"dialog\"\n aria-controls=${this.dropdownMenuId}\n @click=${() => this.toggleMenu()}\n aria-label=${this.menuIsOpen ? \"Close Calendar\" : \"Open Calendar\"}\n ?disabled=${this.disabled}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n fill=\"currentColor\"\n class=\"bi bi-calendar\"\n viewBox=\"0 0 16 16\"\n >\n <path\n d=\"M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5M1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4z\"\n />\n </svg>\n </button>\n <button\n slot=\"reset-btn\"\n ?disabled=${this.disabled}\n class=\"btn sgds rounded-0 reset-btn\"\n @click=${() => this._handleButtonResetClick()}\n aria-label=\"Reset Datepicker\"\n >\n ${svgEl}\n </button>\n </sgds-datepicker-input>\n\n <ul\n id=${this.dropdownMenuId}\n class=\"sgds datepicker dropdown-menu\"\n role=\"dialog\"\n part=\"menu\"\n aria-label=${this._dialogAriaLabels[this.view]}\n @click=${(event: MouseEvent) => event.stopPropagation()}\n >\n <sgds-datepicker-header\n .view=${this.view}\n .displayDate=${this.displayDate}\n .focusedDate=${this.focusedDate}\n .selectedDate=${this.selectedDateRange}\n .focusedTabIndex=${this.focusedTabIndex}\n ></sgds-datepicker-header>\n <sgds-datepicker-calendar\n .show=${this.menuIsOpen}\n .view=${this.view}\n .displayDate=${this.displayDate}\n .mode=${this.mode}\n minDate=${this.minDate}\n maxDate=${this.maxDate}\n .selectedDate=${this.selectedDateRange}\n .focusedTabIndex=${this.focusedTabIndex}\n ></sgds-datepicker-calendar>\n </ul>\n </div>\n `;\n }\n}\n\nexport default SgdsDatepicker;\n"],"names":["ScopedElementsMixin","DropdownElement","DatepickerInput","DatepickerCalendar","DatepickerHeader","format","DATE_PATTERNS","setTimeToNoon","parse","html","live","ref","classMap","styles","__decorate","property","state","queryAsync","query","watch"],"mappings":";;;;;;;;;;;;;;;;;;;;AAmBA;;;;;;;;;;;;;;;;;AAiBG;MACU,cAAe,SAAQA,kCAAmB,CAACC,+BAAe,CAAC,CAAA;;AAOtE,IAAA,WAAW,cAAc,GAAA;QACvB,OAAO;AACL,YAAA,uBAAuB,EAAEC,+BAAe;AACxC,YAAA,0BAA0B,EAAEC,qCAAkB;AAC9C,YAAA,wBAAwB,EAAEC,iCAAgB;SAC3C,CAAC;KACH;;IAwEM,cAAc,GAAA;AACnB,QAAA,OAAO,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE,CAAC;KACzC;AACD,IAAA,WAAA,GAAA;A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K,WAAK,CAAC,OAAO,CAAC;AAId,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,oBAAA,EAAA,IAAA,CAAA;;;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { DropdownElement } from "../../base/dropdown-element";
|
|
2
|
+
import { type SgdsFormControl } from "../../utils/form";
|
|
2
3
|
import { DatepickerCalendar } from "./datepicker-calendar";
|
|
3
4
|
import { DatepickerHeader } from "./datepicker-header";
|
|
4
5
|
import DatepickerInput from "./datepicker-input";
|
|
5
|
-
import { type SgdsFormControl } from "../../utils/form";
|
|
6
6
|
export type DateFormat = "MM/DD/YYYY" | "DD/MM/YYYY" | "YYYY/MM/DD";
|
|
7
7
|
declare const SgdsDatepicker_base: typeof DropdownElement & import("@open-wc/dedupe-mixin").Constructor<import("@open-wc/scoped-elements/types/src/types").ScopedElementsHost>;
|
|
8
8
|
/**
|
|
@@ -25,6 +25,7 @@ declare const SgdsDatepicker_base: typeof DropdownElement & import("@open-wc/ded
|
|
|
25
25
|
*/
|
|
26
26
|
export declare class SgdsDatepicker extends SgdsDatepicker_base implements SgdsFormControl {
|
|
27
27
|
static styles: import("lit").CSSResultGroup[];
|
|
28
|
+
/**@internal */
|
|
28
29
|
static formAssociated: boolean;
|
|
29
30
|
private _internals;
|
|
30
31
|
/**@internal */
|
|
@@ -61,14 +62,17 @@ export declare class SgdsDatepicker extends SgdsDatepicker_base implements SgdsF
|
|
|
61
62
|
drop: "up" | "down";
|
|
62
63
|
/** Provides the date context for Calendar to present the appropriate view. Defaults to today's date */
|
|
63
64
|
displayDate: Date;
|
|
65
|
+
/**@internal */
|
|
64
66
|
value: string;
|
|
65
67
|
private view;
|
|
66
68
|
private selectedDateRange;
|
|
67
69
|
private focusedDate;
|
|
68
70
|
private focusedTabIndex;
|
|
71
|
+
dialogAriaLabel: string;
|
|
69
72
|
private initialDisplayDate;
|
|
70
73
|
private calendar;
|
|
71
74
|
private datepickerInputAsync;
|
|
75
|
+
private datepickerHeaderAsync;
|
|
72
76
|
private datepickerInput;
|
|
73
77
|
/** Checks for validity and shows the browser's validation message if the control is invalid. */
|
|
74
78
|
reportValidity(): boolean;
|
|
@@ -80,6 +84,7 @@ export declare class SgdsDatepicker extends SgdsDatepicker_base implements SgdsF
|
|
|
80
84
|
private _handleTab;
|
|
81
85
|
_handleValueChange(): void;
|
|
82
86
|
private _handleCloseMenu;
|
|
87
|
+
private _handleOpenMenu;
|
|
83
88
|
private _makeInputValueString;
|
|
84
89
|
private _handleSelectDatesInput;
|
|
85
90
|
private _handleSelectDates;
|
|
@@ -100,6 +105,7 @@ export declare class SgdsDatepicker extends SgdsDatepicker_base implements SgdsF
|
|
|
100
105
|
private _manageInternalsDefault;
|
|
101
106
|
private _setInternalFormValue;
|
|
102
107
|
private _handleInputMaskChange;
|
|
108
|
+
private _dialogAriaLabels;
|
|
103
109
|
render(): import("lit-html").TemplateResult<1>;
|
|
104
110
|
}
|
|
105
111
|
export default SgdsDatepicker;
|
|
@@ -3,16 +3,16 @@ import { ScopedElementsMixin } from '@open-wc/scoped-elements';
|
|
|
3
3
|
import { parse, format } from 'date-fns';
|
|
4
4
|
import { html } from 'lit';
|
|
5
5
|
import { property, state, queryAsync, query } from 'lit/decorators.js';
|
|
6
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
6
7
|
import { live } from 'lit/directives/live.js';
|
|
7
8
|
import { ref } from 'lit/directives/ref.js';
|
|
8
9
|
import { DropdownElement } from '../../base/dropdown-element.js';
|
|
10
|
+
import { setTimeToNoon, DATE_PATTERNS } from '../../utils/time.js';
|
|
9
11
|
import { watch } from '../../utils/watch.js';
|
|
10
12
|
import { DatepickerCalendar } from './datepicker-calendar.js';
|
|
11
13
|
import { DatepickerHeader } from './datepicker-header.js';
|
|
12
14
|
import { DatepickerInput } from './datepicker-input.js';
|
|
13
15
|
import css_248z from './sgds-datepicker2.js';
|
|
14
|
-
import { setTimeToNoon, DATE_PATTERNS } from '../../utils/time.js';
|
|
15
|
-
import { classMap } from 'lit/directives/class-map.js';
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* @summary The `DatePicker` Component is built using `Dropdown`, `Input` and `Button` components. By default, the Calendar points to today's date and input has no value. Users can either pick dates from the calendar or type dates through the input
|
|
@@ -71,6 +71,7 @@ class SgdsDatepicker extends ScopedElementsMixin(DropdownElement) {
|
|
|
71
71
|
this.noFlip = false;
|
|
72
72
|
/** The drop position of menu relative to the toggle button */
|
|
73
73
|
this.drop = "down";
|
|
74
|
+
/**@internal */
|
|
74
75
|
this.value = "";
|
|
75
76
|
this.view = "days";
|
|
76
77
|
this.selectedDateRange = [];
|
|
@@ -98,6 +99,11 @@ class SgdsDatepicker extends ScopedElementsMixin(DropdownElement) {
|
|
|
98
99
|
}
|
|
99
100
|
return this.value;
|
|
100
101
|
};
|
|
102
|
+
this._dialogAriaLabels = {
|
|
103
|
+
days: "Choose date",
|
|
104
|
+
months: "Choose month",
|
|
105
|
+
years: "Choose year"
|
|
106
|
+
};
|
|
101
107
|
this._internals = this.attachInternals();
|
|
102
108
|
/**@internal */
|
|
103
109
|
this.modifierOpt = [
|
|
@@ -121,6 +127,7 @@ class SgdsDatepicker extends ScopedElementsMixin(DropdownElement) {
|
|
|
121
127
|
this.addEventListener("sgds-empty-input", this._handleEmptyInput);
|
|
122
128
|
this.addEventListener("keydown", this._handleTab);
|
|
123
129
|
this.addEventListener("sgds-hide", this._handleCloseMenu);
|
|
130
|
+
this.addEventListener("sgds-show", this._handleOpenMenu);
|
|
124
131
|
this.initialDisplayDate = this.displayDate || new Date();
|
|
125
132
|
if (this.initialValue && this.initialValue.length > 0) {
|
|
126
133
|
// Validate initialValue against the dateFormat regex
|
|
@@ -185,6 +192,9 @@ class SgdsDatepicker extends ScopedElementsMixin(DropdownElement) {
|
|
|
185
192
|
this._setInternalFormValue(this.value);
|
|
186
193
|
}
|
|
187
194
|
async _handleCloseMenu() {
|
|
195
|
+
//return focus to input when menu closes
|
|
196
|
+
const input = await this.datepickerInputAsync;
|
|
197
|
+
input.focus();
|
|
188
198
|
if (this.selectedDateRange.length === 0) {
|
|
189
199
|
this.displayDate = this.initialDisplayDate;
|
|
190
200
|
}
|
|
@@ -195,6 +205,11 @@ class SgdsDatepicker extends ScopedElementsMixin(DropdownElement) {
|
|
|
195
205
|
calendar._updateFocusedDate();
|
|
196
206
|
}
|
|
197
207
|
}
|
|
208
|
+
async _handleOpenMenu() {
|
|
209
|
+
const cal = await this.calendar;
|
|
210
|
+
const input = await this.datepickerInputAsync;
|
|
211
|
+
cal.focusOnCalendar(input);
|
|
212
|
+
}
|
|
198
213
|
_handleSelectDatesInput(event) {
|
|
199
214
|
this._handleSelectDates(event.detail);
|
|
200
215
|
this._manageInternalsDefault(this._shadowInput);
|
|
@@ -359,6 +374,7 @@ class SgdsDatepicker extends ScopedElementsMixin(DropdownElement) {
|
|
|
359
374
|
class="sgds datepicker dropdown-menu"
|
|
360
375
|
role="dialog"
|
|
361
376
|
part="menu"
|
|
377
|
+
aria-label=${this._dialogAriaLabels[this.view]}
|
|
362
378
|
@click=${(event) => event.stopPropagation()}
|
|
363
379
|
>
|
|
364
380
|
<sgds-datepicker-header
|
|
@@ -384,6 +400,7 @@ class SgdsDatepicker extends ScopedElementsMixin(DropdownElement) {
|
|
|
384
400
|
}
|
|
385
401
|
}
|
|
386
402
|
SgdsDatepicker.styles = [DropdownElement.styles, css_248z];
|
|
403
|
+
/**@internal */
|
|
387
404
|
SgdsDatepicker.formAssociated = true;
|
|
388
405
|
__decorate([
|
|
389
406
|
property({ type: Boolean, reflect: true })
|
|
@@ -442,12 +459,18 @@ __decorate([
|
|
|
442
459
|
__decorate([
|
|
443
460
|
state()
|
|
444
461
|
], SgdsDatepicker.prototype, "focusedTabIndex", void 0);
|
|
462
|
+
__decorate([
|
|
463
|
+
state()
|
|
464
|
+
], SgdsDatepicker.prototype, "dialogAriaLabel", void 0);
|
|
445
465
|
__decorate([
|
|
446
466
|
queryAsync("sgds-datepicker-calendar")
|
|
447
467
|
], SgdsDatepicker.prototype, "calendar", void 0);
|
|
448
468
|
__decorate([
|
|
449
469
|
queryAsync("sgds-datepicker-input")
|
|
450
470
|
], SgdsDatepicker.prototype, "datepickerInputAsync", void 0);
|
|
471
|
+
__decorate([
|
|
472
|
+
queryAsync("sgds-datepicker-header")
|
|
473
|
+
], SgdsDatepicker.prototype, "datepickerHeaderAsync", void 0);
|
|
451
474
|
__decorate([
|
|
452
475
|
query("sgds-datepicker-input")
|
|
453
476
|
], SgdsDatepicker.prototype, "datepickerInput", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sgds-datepicker.js","sources":["../../../src/components/Datepicker/sgds-datepicker.ts"],"sourcesContent":["import { ScopedElementsMixin } from \"@open-wc/scoped-elements\";\nimport { format, parse } from \"date-fns\";\nimport { html } from \"lit\";\nimport { property, query, queryAsync, state } from \"lit/decorators.js\";\nimport { live } from \"lit/directives/live.js\";\nimport { ref } from \"lit/directives/ref.js\";\nimport { DropdownElement } from \"../../base/dropdown-element\";\nimport { watch } from \"../../utils/watch\";\nimport { DatepickerCalendar } from \"./datepicker-calendar\";\nimport { DatepickerHeader } from \"./datepicker-header\";\nimport DatepickerInput from \"./datepicker-input\";\nimport styles from \"./sgds-datepicker.scss\";\nimport { ViewEnum } from \"./types\";\nimport { DATE_PATTERNS, setTimeToNoon } from \"../../utils/time\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { type SgdsFormControl } from \"../../utils/form\";\n\nexport type DateFormat = \"MM/DD/YYYY\" | \"DD/MM/YYYY\" | \"YYYY/MM/DD\";\n\n/**\n * @summary The `DatePicker` Component is built using `Dropdown`, `Input` and `Button` components. By default, the Calendar points to today's date and input has no value. Users can either pick dates from the calendar or type dates through the input\n *\n * @event sgds-change-date - Emitted when the state of datepicker's input changes during first load, close button reset click & date click. Date values can be accessed via event.target.value\n *\n * @cssproperty --datepicker-theme-color - Datepicker's overall theme color\n * @cssproperty --datepicker-hover-bg-color - Datepicker's calendar menu hover color\n * @cssproperty --datepicker-bg-color - Datepicker's menu background color\n * @cssproperty --datepicker-closebutton-bg-color - Datepicker's close button background color\n * @cssproperty --datepicker-closebutton-hover-bg-color - Datepicker's close button hover background color\n * @cssproperty --datepicker-closebutton-color - Datepicker's close button color\n * @cssproperty --datepicker-selected-date-bg-color - Selected date's background color\n * @cssproperty --datepicker-selected-date-text-color - Selected date's text color\n *\n * @description displayDate sets the month, year views of the calendar while focusedDate follows the focus which also directly changes\n * displayDate on certain occasions. Example, when keyboard moves up to the next month, it updates displayDate which then affect the current\n * date view of the calendar\n */\nexport class SgdsDatepicker extends ScopedElementsMixin(DropdownElement) implements SgdsFormControl {\n static styles = [DropdownElement.styles, styles];\n static formAssociated = true;\n private _internals: ElementInternals;\n\n /**@internal */\n static get scopedElements() {\n return {\n \"sgds-datepicker-input\": DatepickerInput,\n \"sgds-datepicker-calendar\": DatepickerCalendar,\n \"sgds-datepicker-header\": DatepickerHeader\n };\n }\n\n /** When true, adds required attribute to input element */\n @property({ type: Boolean, reflect: true }) required = false;\n /**The datepicker input's name attribute */\n @property({ reflect: true }) name: string;\n /** When true, adds disabled attribute to input and button element */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** The initial value of DatePicker on first load for single & range mode as array of string. eg.'[\"22/12/2023\"]' for single & '[\"22/12/2023\",\"25/12/2023\"]' for range respectively */\n @property({ type: Array, reflect: true }) initialValue: string[] = [];\n\n /** Date format reflected on input */\n @property({ type: String }) dateFormat: DateFormat = \"DD/MM/YYYY\";\n\n /** ISO date string to set the lowest allowable date value. e.g. \"2016-05-19T12:00:00.000Z\" */\n @property({ type: String }) minDate = \"\";\n\n /** ISO date string to set the highest allowable date value. e.g. \"2016-05-19T12:00:00.000Z\" */\n @property({ type: String }) maxDate = \"\";\n\n /** Changes DatePicker to single date selection or range date selection */\n @property({ type: String, reflect: true }) mode: \"single\" | \"range\" = \"single\";\n\n /**Feedback text for error state when date input is invalid */\n @property({ type: String, reflect: true }) invalidFeedback = \"Please enter a valid date\";\n\n /** The datepicker input's label */\n @property({ reflect: true }) label = \"\";\n\n /** The datepicker input's hint text below the label */\n @property({ reflect: true }) hintText = \"\";\n\n /** Controls auto-flipping of menu */\n @property({ type: Boolean, reflect: true, state: false })\n noFlip = false;\n\n /** The drop position of menu relative to the toggle button */\n @property({ type: String, reflect: true, state: false })\n drop: \"up\" | \"down\" = \"down\";\n\n /** Provides the date context for Calendar to present the appropriate view. Defaults to today's date */\n @property({ attribute: false }) displayDate: Date;\n\n @state() value = \"\";\n\n @state()\n private view: ViewEnum = \"days\";\n\n @state() private selectedDateRange: Date[] = [];\n\n @state() private focusedDate: Date;\n\n @state() private focusedTabIndex = 3;\n\n private initialDisplayDate: Date;\n\n @queryAsync(\"sgds-datepicker-calendar\")\n private calendar: Promise<DatepickerCalendar>;\n\n @queryAsync(\"sgds-datepicker-input\")\n private datepickerInputAsync: Promise<DatepickerInput>;\n\n @query(\"sgds-datepicker-input\")\n private datepickerInput: DatepickerInput;\n\n /** Checks for validity and shows the browser's validation message if the control is invalid. */\n public reportValidity(): boolean {\n return this._internals.reportValidity();\n }\n constructor() {\n super();\n this._internals = this.attachInternals();\n /**@internal */\n this.modifierOpt = [\n {\n name: \"offset\",\n options: {\n offset: [0, 10]\n }\n }\n ];\n }\n\n async connectedCallback() {\n super.connectedCallback();\n this.addEventListener(\"sgds-view\", this._handleViewChanged);\n this.addEventListener(\"sgds-change-calendar\", this._handleDateChanged);\n this.addEventListener(\"sgds-update-focus\", this._handleFocusDateChanged);\n this.addEventListener(\"sgds-selectmonth\", this._handleSelectMonth);\n this.addEventListener(\"sgds-selectyear\", this._handleSelectYear);\n this.addEventListener(\"sgds-selectdates\", this._handleSelectDatesAndClose);\n this.addEventListener(\"sgds-selectdates-input\", this._handleSelectDatesInput);\n this.addEventListener(\"sgds-empty-input\", this._handleEmptyInput);\n this.addEventListener(\"keydown\", this._handleTab);\n this.addEventListener(\"sgds-hide\", this._handleCloseMenu);\n this.initialDisplayDate = this.displayDate || new Date();\n if (this.initialValue && this.initialValue.length > 0) {\n // Validate initialValue against the dateFormat regex\n const dateFormatRegex = new RegExp(this._getDateFormatRegex());\n // const startDateString = this.initialValue[0];\n const invalidDates = this.initialValue.filter(v => !dateFormatRegex.test(v));\n if (invalidDates.length > 0) {\n return console.error(\"Invalid date format in initialValue:\", invalidDates);\n } else {\n const initialSelectedDates = this.initialValue.map(v =>\n setTimeToNoon(parse(v, DATE_PATTERNS[this.dateFormat].fnsPattern, new Date()))\n );\n this._handleSelectDates(initialSelectedDates);\n }\n } else {\n this.displayDate = this.initialDisplayDate;\n }\n }\n\n async firstUpdated() {\n super.firstUpdated();\n if (this.menuIsOpen) {\n const input = await this.datepickerInputAsync;\n this.showMenu();\n const cal = await this.calendar;\n cal.focusOnCalendar(input);\n }\n\n const shadowInput = await this.datepickerInput.shadowInput;\n this._manageInternalsDefault(shadowInput);\n this._internals.setValidity(shadowInput.validity, shadowInput.validationMessage, shadowInput);\n }\n\n /** @internal */\n private _getDateFormatRegex(): string {\n // validate date strings and adhere to the specified date format\n return (\n this.dateFormat\n // Replace any special characters with their escaped version using \"\\\\$&\"\n .replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")\n // Replace 'MM' with '\\\\d{2}', which matches two digits representing the month (e.g., 01, 12)\n .replace(\"MM\", \"\\\\d{2}\")\n // Replace 'DD' with '\\\\d{2}', which matches two digits representing the day (e.g., 01, 31)\n .replace(\"DD\", \"\\\\d{2}\")\n // Replace 'YYYY' with '\\\\d{4}', which matches four digits representing the year (e.g., 2021)\n .replace(\"YYYY\", \"\\\\d{4}\")\n // Replace '/' with '\\\\/', which matches the forward slash character\n .replace(\"/\", \"\\\\/\")\n );\n }\n private _handleTab(event: KeyboardEvent) {\n if (!this.menuIsOpen) {\n return;\n }\n const tabIndexArray = Array(4);\n if (event.shiftKey && event.key === \"Tab\") {\n event.preventDefault();\n this.focusedTabIndex = (this.focusedTabIndex - 1 + tabIndexArray.length) % tabIndexArray.length;\n } else if (event.key === \"Tab\") {\n event.preventDefault();\n this.focusedTabIndex = (this.focusedTabIndex + 1 + tabIndexArray.length) % tabIndexArray.length;\n }\n }\n\n @watch(\"value\")\n _handleValueChange() {\n this.emit(\"sgds-change-date\");\n this._setInternalFormValue(this.value);\n }\n\n private async _handleCloseMenu() {\n if (this.selectedDateRange.length === 0) {\n this.displayDate = this.initialDisplayDate;\n } else {\n const selectedDatesLength = this.selectedDateRange.length;\n this.displayDate = this.selectedDateRange[selectedDatesLength - 1];\n const calendar = await this.calendar;\n calendar._updateFocusedDate();\n }\n }\n\n private _makeInputValueString = (startDate: Date, endDate: Date, dateFormat: string) => {\n if (!startDate && !endDate) return this.value;\n const formatDate = (date: Date) => format(date, DATE_PATTERNS[dateFormat].fnsPattern);\n switch (this.mode) {\n case \"single\": {\n if (startDate) {\n this.value = formatDate(startDate);\n }\n break;\n }\n case \"range\": {\n if (startDate && endDate) {\n this.value = `${formatDate(startDate)} - ${formatDate(endDate)}`;\n }\n if (startDate && !endDate) {\n this.value = `${formatDate(startDate)} - ${this.dateFormat.toLowerCase()}`;\n }\n break;\n }\n }\n return this.value;\n };\n private _handleSelectDatesInput(event: CustomEvent<Date[]>) {\n this._handleSelectDates(event.detail);\n this._manageInternalsDefault(this._shadowInput);\n }\n private async _handleSelectDates(newSelectedDates: Date[]) {\n newSelectedDates.sort((a: Date, b: Date) => a.getTime() - b.getTime());\n this.displayDate = newSelectedDates[0];\n this.focusedDate = newSelectedDates[0];\n this.selectedDateRange = newSelectedDates;\n\n // Get the formattedDate value for the selected dates\n const formattedDate = this._makeInputValueString(\n this.selectedDateRange[0],\n this.selectedDateRange[1],\n this.dateFormat\n );\n\n // Set formattedDate value as the new value for sgds-input\n this.value = formattedDate;\n const input = await this.datepickerInputAsync;\n input.updateMaskValue();\n }\n\n private get _shadowInput() {\n return this.datepickerInput.shadowRoot.querySelector(\"input\");\n }\n private _handleSelectDatesAndClose(event: CustomEvent<Date[]>) {\n this._handleSelectDates(event.detail);\n\n if (this.mode === \"range\" && this.selectedDateRange.length === 2) {\n this.hideMenu();\n } else if (this.mode === \"single\" && this.selectedDateRange.length === 1) {\n this.hideMenu();\n }\n this._manageInternalsValid();\n }\n\n /** update latest view state from datepicker-header */\n private _handleViewChanged(event: CustomEvent<string>) {\n this.view = event.detail as ViewEnum;\n }\n\n private _handleDateChanged(event: CustomEvent<Date>) {\n this.displayDate = event.detail;\n }\n private _handleFocusDateChanged(event: CustomEvent<Date>) {\n this.focusedDate = event.detail;\n }\n\n private _handleSelectMonth(event: CustomEvent<Date>) {\n this.displayDate = event.detail;\n }\n\n private _handleSelectYear(event: CustomEvent<Date>) {\n this.displayDate = event.detail;\n }\n private async _handleInvalidInput() {\n this.selectedDateRange = [];\n this.displayDate = this.initialDisplayDate;\n this._manageInternalsBadInput();\n }\n private async _handleButtonResetClick() {\n this.displayDate = this.initialDisplayDate;\n this.selectedDateRange = [];\n this.value = \"\";\n this.view = \"days\";\n this.hideMenu();\n const input = await this.datepickerInputAsync;\n input.setInvalid(false);\n input.destroyInputMask();\n await input.applyInputMask();\n\n this._manageInternalsRequired();\n }\n\n private async _handleEmptyInput() {\n this._manageInternalsRequired();\n }\n\n private _manageInternalsRequired() {\n this.required\n ? this._internals.setValidity(\n {\n valueMissing: true\n },\n \"Please fill in this field\",\n this._shadowInput\n )\n : this._internals.setValidity({});\n }\n private _manageInternalsBadInput() {\n this._internals.setValidity(\n {\n badInput: true\n },\n \"The chosen date(s) are invalid\",\n this._shadowInput\n );\n }\n\n private _manageInternalsValid() {\n this._internals.setValidity({});\n }\n\n private _manageInternalsDefault(inputEl: HTMLInputElement) {\n this._internals.setValidity(inputEl.validity, inputEl.validationMessage, inputEl);\n }\n\n private _setInternalFormValue(value: string) {\n this._internals.setFormValue(value);\n }\n\n private async _handleInputMaskChange(e: CustomEvent) {\n this.value = e.detail;\n }\n render() {\n const svgEl = html`\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n fill=\"currentColor\"\n class=\"bi bi-x\"\n viewBox=\"0 0 16 16\"\n >\n <path\n d=\"M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z\"\n />\n </svg>\n `;\n\n return html`\n <div>\n <sgds-datepicker-input\n .value=${live(this.value)}\n ?required=${this.required}\n ?disabled=${this.disabled}\n placeholder=\"\"\n ${ref(this.myDropdown)}\n mode=${this.mode}\n dateFormat=${this.dateFormat}\n invalidFeedback=${this.invalidFeedback}\n @sgds-mask-input-change=${this._handleInputMaskChange}\n @sgds-invalid-input=${this._handleInvalidInput}\n minDate=${this.minDate}\n maxDate=${this.maxDate}\n label=${this.label}\n hintText=${this.hintText}\n name=${this.name}\n >\n <button\n slot=\"calendar-btn\"\n class=${classMap({\n \"sgds btn rounded-0 border btn-outline-dark\": true\n })}\n aria-expanded=\"${this.menuIsOpen}\"\n aria-haspopup=\"dialog\"\n aria-controls=${this.dropdownMenuId}\n @click=${() => this.toggleMenu()}\n aria-label=${this.menuIsOpen ? \"Close Calendar\" : \"Open Calendar\"}\n ?disabled=${this.disabled}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n fill=\"currentColor\"\n class=\"bi bi-calendar\"\n viewBox=\"0 0 16 16\"\n >\n <path\n d=\"M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5M1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4z\"\n />\n </svg>\n </button>\n <button\n slot=\"reset-btn\"\n ?disabled=${this.disabled}\n class=\"btn sgds rounded-0 reset-btn\"\n @click=${() => this._handleButtonResetClick()}\n aria-label=\"Reset Datepicker\"\n >\n ${svgEl}\n </button>\n </sgds-datepicker-input>\n\n <ul\n id=${this.dropdownMenuId}\n class=\"sgds datepicker dropdown-menu\"\n role=\"dialog\"\n part=\"menu\"\n @click=${(event: MouseEvent) => event.stopPropagation()}\n >\n <sgds-datepicker-header\n .view=${this.view}\n .displayDate=${this.displayDate}\n .focusedDate=${this.focusedDate}\n .selectedDate=${this.selectedDateRange}\n .focusedTabIndex=${this.focusedTabIndex}\n ></sgds-datepicker-header>\n <sgds-datepicker-calendar\n .show=${this.menuIsOpen}\n .view=${this.view}\n .displayDate=${this.displayDate}\n .mode=${this.mode}\n minDate=${this.minDate}\n maxDate=${this.maxDate}\n .selectedDate=${this.selectedDateRange}\n .focusedTabIndex=${this.focusedTabIndex}\n ></sgds-datepicker-calendar>\n </ul>\n </div>\n `;\n }\n}\n\nexport default SgdsDatepicker;\n"],"names":["styles"],"mappings":";;;;;;;;;;;;;;;;AAmBA;;;;;;;;;;;;;;;;;AAiBG;MACU,cAAe,SAAQ,mBAAmB,CAAC,eAAe,CAAC,CAAA;;AAMtE,IAAA,WAAW,cAAc,GAAA;QACvB,OAAO;AACL,YAAA,uBAAuB,EAAE,eAAe;AACxC,YAAA,0BAA0B,EAAE,kBAAkB;AAC9C,YAAA,wBAAwB,EAAE,gBAAgB;SAC3C,CAAC;KACH;;IAmEM,cAAc,GAAA;AACnB,QAAA,OAAO,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE,CAAC;KACzC;AACD,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE,CAAC;;QApEkC,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;;QAIjB,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;;QAGnB,IAAY,CAAA,YAAA,GAAa,EAAE,CAAC;;QAG1C,IAAU,CAAA,UAAA,GAAe,YAAY,CAAC;;QAGtC,IAAO,CAAA,OAAA,GAAG,EAAE,CAAC;;QAGb,IAA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AA,cAAA,CAAA,SAAA,EAAA,oBAAA,EAAA,IAAA,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"sgds-datepicker.js","sources":["../../../src/components/Datepicker/sgds-datepicker.ts"],"sourcesContent":["import { ScopedElementsMixin } from \"@open-wc/scoped-elements\";\nimport { format, parse } from \"date-fns\";\nimport { html } from \"lit\";\nimport { property, query, queryAsync, state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { live } from \"lit/directives/live.js\";\nimport { ref } from \"lit/directives/ref.js\";\nimport { DropdownElement } from \"../../base/dropdown-element\";\nimport { type SgdsFormControl } from \"../../utils/form\";\nimport { DATE_PATTERNS, setTimeToNoon } from \"../../utils/time\";\nimport { watch } from \"../../utils/watch\";\nimport { DatepickerCalendar } from \"./datepicker-calendar\";\nimport { DatepickerHeader } from \"./datepicker-header\";\nimport DatepickerInput from \"./datepicker-input\";\nimport styles from \"./sgds-datepicker.scss\";\nimport { ViewEnum } from \"./types\";\n\nexport type DateFormat = \"MM/DD/YYYY\" | \"DD/MM/YYYY\" | \"YYYY/MM/DD\";\n\n/**\n * @summary The `DatePicker` Component is built using `Dropdown`, `Input` and `Button` components. By default, the Calendar points to today's date and input has no value. Users can either pick dates from the calendar or type dates through the input\n *\n * @event sgds-change-date - Emitted when the state of datepicker's input changes during first load, close button reset click & date click. Date values can be accessed via event.target.value\n *\n * @cssproperty --datepicker-theme-color - Datepicker's overall theme color\n * @cssproperty --datepicker-hover-bg-color - Datepicker's calendar menu hover color\n * @cssproperty --datepicker-bg-color - Datepicker's menu background color\n * @cssproperty --datepicker-closebutton-bg-color - Datepicker's close button background color\n * @cssproperty --datepicker-closebutton-hover-bg-color - Datepicker's close button hover background color\n * @cssproperty --datepicker-closebutton-color - Datepicker's close button color\n * @cssproperty --datepicker-selected-date-bg-color - Selected date's background color\n * @cssproperty --datepicker-selected-date-text-color - Selected date's text color\n *\n * @description displayDate sets the month, year views of the calendar while focusedDate follows the focus which also directly changes\n * displayDate on certain occasions. Example, when keyboard moves up to the next month, it updates displayDate which then affect the current\n * date view of the calendar\n */\nexport class SgdsDatepicker extends ScopedElementsMixin(DropdownElement) implements SgdsFormControl {\n static styles = [DropdownElement.styles, styles];\n /**@internal */\n static formAssociated = true;\n private _internals: ElementInternals;\n\n /**@internal */\n static get scopedElements() {\n return {\n \"sgds-datepicker-input\": DatepickerInput,\n \"sgds-datepicker-calendar\": DatepickerCalendar,\n \"sgds-datepicker-header\": DatepickerHeader\n };\n }\n\n /** When true, adds required attribute to input element */\n @property({ type: Boolean, reflect: true }) required = false;\n /**The datepicker input's name attribute */\n @property({ reflect: true }) name: string;\n /** When true, adds disabled attribute to input and button element */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** The initial value of DatePicker on first load for single & range mode as array of string. eg.'[\"22/12/2023\"]' for single & '[\"22/12/2023\",\"25/12/2023\"]' for range respectively */\n @property({ type: Array, reflect: true }) initialValue: string[] = [];\n\n /** Date format reflected on input */\n @property({ type: String }) dateFormat: DateFormat = \"DD/MM/YYYY\";\n\n /** ISO date string to set the lowest allowable date value. e.g. \"2016-05-19T12:00:00.000Z\" */\n @property({ type: String }) minDate = \"\";\n\n /** ISO date string to set the highest allowable date value. e.g. \"2016-05-19T12:00:00.000Z\" */\n @property({ type: String }) maxDate = \"\";\n\n /** Changes DatePicker to single date selection or range date selection */\n @property({ type: String, reflect: true }) mode: \"single\" | \"range\" = \"single\";\n\n /**Feedback text for error state when date input is invalid */\n @property({ type: String, reflect: true }) invalidFeedback = \"Please enter a valid date\";\n\n /** The datepicker input's label */\n @property({ reflect: true }) label = \"\";\n\n /** The datepicker input's hint text below the label */\n @property({ reflect: true }) hintText = \"\";\n\n /** Controls auto-flipping of menu */\n @property({ type: Boolean, reflect: true, state: false })\n noFlip = false;\n\n /** The drop position of menu relative to the toggle button */\n @property({ type: String, reflect: true, state: false })\n drop: \"up\" | \"down\" = \"down\";\n\n /** Provides the date context for Calendar to present the appropriate view. Defaults to today's date */\n @property({ attribute: false }) displayDate: Date;\n /**@internal */\n @state() value = \"\";\n\n @state()\n private view: ViewEnum = \"days\";\n\n @state() private selectedDateRange: Date[] = [];\n\n @state() private focusedDate: Date;\n\n @state() private focusedTabIndex = 3;\n\n @state() dialogAriaLabel: string;\n\n private initialDisplayDate: Date;\n\n @queryAsync(\"sgds-datepicker-calendar\")\n private calendar: Promise<DatepickerCalendar>;\n\n @queryAsync(\"sgds-datepicker-input\")\n private datepickerInputAsync: Promise<DatepickerInput>;\n\n @queryAsync(\"sgds-datepicker-header\")\n private datepickerHeaderAsync: Promise<DatepickerHeader>;\n\n @query(\"sgds-datepicker-input\")\n private datepickerInput: DatepickerInput;\n\n /** Checks for validity and shows the browser's validation message if the control is invalid. */\n public reportValidity(): boolean {\n return this._internals.reportValidity();\n }\n constructor() {\n super();\n this._internals = this.attachInternals();\n /**@internal */\n this.modifierOpt = [\n {\n name: \"offset\",\n options: {\n offset: [0, 10]\n }\n }\n ];\n }\n\n async connectedCallback() {\n super.connectedCallback();\n this.addEventListener(\"sgds-view\", this._handleViewChanged);\n this.addEventListener(\"sgds-change-calendar\", this._handleDateChanged);\n this.addEventListener(\"sgds-update-focus\", this._handleFocusDateChanged);\n this.addEventListener(\"sgds-selectmonth\", this._handleSelectMonth);\n this.addEventListener(\"sgds-selectyear\", this._handleSelectYear);\n this.addEventListener(\"sgds-selectdates\", this._handleSelectDatesAndClose);\n this.addEventListener(\"sgds-selectdates-input\", this._handleSelectDatesInput);\n this.addEventListener(\"sgds-empty-input\", this._handleEmptyInput);\n this.addEventListener(\"keydown\", this._handleTab);\n this.addEventListener(\"sgds-hide\", this._handleCloseMenu);\n this.addEventListener(\"sgds-show\", this._handleOpenMenu);\n this.initialDisplayDate = this.displayDate || new Date();\n if (this.initialValue && this.initialValue.length > 0) {\n // Validate initialValue against the dateFormat regex\n const dateFormatRegex = new RegExp(this._getDateFormatRegex());\n // const startDateString = this.initialValue[0];\n const invalidDates = this.initialValue.filter(v => !dateFormatRegex.test(v));\n if (invalidDates.length > 0) {\n return console.error(\"Invalid date format in initialValue:\", invalidDates);\n } else {\n const initialSelectedDates = this.initialValue.map(v =>\n setTimeToNoon(parse(v, DATE_PATTERNS[this.dateFormat].fnsPattern, new Date()))\n );\n this._handleSelectDates(initialSelectedDates);\n }\n } else {\n this.displayDate = this.initialDisplayDate;\n }\n }\n\n async firstUpdated() {\n super.firstUpdated();\n if (this.menuIsOpen) {\n const input = await this.datepickerInputAsync;\n this.showMenu();\n const cal = await this.calendar;\n cal.focusOnCalendar(input);\n }\n\n const shadowInput = await this.datepickerInput.shadowInput;\n this._manageInternalsDefault(shadowInput);\n this._internals.setValidity(shadowInput.validity, shadowInput.validationMessage, shadowInput);\n }\n\n /** @internal */\n private _getDateFormatRegex(): string {\n // validate date strings and adhere to the specified date format\n return (\n this.dateFormat\n // Replace any special characters with their escaped version using \"\\\\$&\"\n .replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")\n // Replace 'MM' with '\\\\d{2}', which matches two digits representing the month (e.g., 01, 12)\n .replace(\"MM\", \"\\\\d{2}\")\n // Replace 'DD' with '\\\\d{2}', which matches two digits representing the day (e.g., 01, 31)\n .replace(\"DD\", \"\\\\d{2}\")\n // Replace 'YYYY' with '\\\\d{4}', which matches four digits representing the year (e.g., 2021)\n .replace(\"YYYY\", \"\\\\d{4}\")\n // Replace '/' with '\\\\/', which matches the forward slash character\n .replace(\"/\", \"\\\\/\")\n );\n }\n private _handleTab(event: KeyboardEvent) {\n if (!this.menuIsOpen) {\n return;\n }\n const tabIndexArray = Array(4);\n if (event.shiftKey && event.key === \"Tab\") {\n event.preventDefault();\n this.focusedTabIndex = (this.focusedTabIndex - 1 + tabIndexArray.length) % tabIndexArray.length;\n } else if (event.key === \"Tab\") {\n event.preventDefault();\n this.focusedTabIndex = (this.focusedTabIndex + 1 + tabIndexArray.length) % tabIndexArray.length;\n }\n }\n\n @watch(\"value\")\n _handleValueChange() {\n this.emit(\"sgds-change-date\");\n this._setInternalFormValue(this.value);\n }\n\n private async _handleCloseMenu() {\n //return focus to input when menu closes\n const input = await this.datepickerInputAsync;\n input.focus();\n\n if (this.selectedDateRange.length === 0) {\n this.displayDate = this.initialDisplayDate;\n } else {\n const selectedDatesLength = this.selectedDateRange.length;\n this.displayDate = this.selectedDateRange[selectedDatesLength - 1];\n const calendar = await this.calendar;\n calendar._updateFocusedDate();\n }\n }\n private async _handleOpenMenu() {\n const cal = await this.calendar;\n const input = await this.datepickerInputAsync;\n cal.focusOnCalendar(input);\n }\n\n private _makeInputValueString = (startDate: Date, endDate: Date, dateFormat: string) => {\n if (!startDate && !endDate) return this.value;\n const formatDate = (date: Date) => format(date, DATE_PATTERNS[dateFormat].fnsPattern);\n switch (this.mode) {\n case \"single\": {\n if (startDate) {\n this.value = formatDate(startDate);\n }\n break;\n }\n case \"range\": {\n if (startDate && endDate) {\n this.value = `${formatDate(startDate)} - ${formatDate(endDate)}`;\n }\n if (startDate && !endDate) {\n this.value = `${formatDate(startDate)} - ${this.dateFormat.toLowerCase()}`;\n }\n break;\n }\n }\n return this.value;\n };\n private _handleSelectDatesInput(event: CustomEvent<Date[]>) {\n this._handleSelectDates(event.detail);\n this._manageInternalsDefault(this._shadowInput);\n }\n private async _handleSelectDates(newSelectedDates: Date[]) {\n newSelectedDates.sort((a: Date, b: Date) => a.getTime() - b.getTime());\n this.displayDate = newSelectedDates[0];\n this.focusedDate = newSelectedDates[0];\n this.selectedDateRange = newSelectedDates;\n\n // Get the formattedDate value for the selected dates\n const formattedDate = this._makeInputValueString(\n this.selectedDateRange[0],\n this.selectedDateRange[1],\n this.dateFormat\n );\n\n // Set formattedDate value as the new value for sgds-input\n this.value = formattedDate;\n const input = await this.datepickerInputAsync;\n input.updateMaskValue();\n }\n\n private get _shadowInput() {\n return this.datepickerInput.shadowRoot.querySelector(\"input\");\n }\n private _handleSelectDatesAndClose(event: CustomEvent<Date[]>) {\n this._handleSelectDates(event.detail);\n\n if (this.mode === \"range\" && this.selectedDateRange.length === 2) {\n this.hideMenu();\n } else if (this.mode === \"single\" && this.selectedDateRange.length === 1) {\n this.hideMenu();\n }\n this._manageInternalsValid();\n }\n\n /** update latest view state from datepicker-header */\n private _handleViewChanged(event: CustomEvent<string>) {\n this.view = event.detail as ViewEnum;\n }\n\n private _handleDateChanged(event: CustomEvent<Date>) {\n this.displayDate = event.detail;\n }\n private _handleFocusDateChanged(event: CustomEvent<Date>) {\n this.focusedDate = event.detail;\n }\n\n private _handleSelectMonth(event: CustomEvent<Date>) {\n this.displayDate = event.detail;\n }\n\n private _handleSelectYear(event: CustomEvent<Date>) {\n this.displayDate = event.detail;\n }\n private async _handleInvalidInput() {\n this.selectedDateRange = [];\n this.displayDate = this.initialDisplayDate;\n this._manageInternalsBadInput();\n }\n private async _handleButtonResetClick() {\n this.displayDate = this.initialDisplayDate;\n this.selectedDateRange = [];\n this.value = \"\";\n this.view = \"days\";\n this.hideMenu();\n const input = await this.datepickerInputAsync;\n input.setInvalid(false);\n input.destroyInputMask();\n await input.applyInputMask();\n\n this._manageInternalsRequired();\n }\n\n private async _handleEmptyInput() {\n this._manageInternalsRequired();\n }\n\n private _manageInternalsRequired() {\n this.required\n ? this._internals.setValidity(\n {\n valueMissing: true\n },\n \"Please fill in this field\",\n this._shadowInput\n )\n : this._internals.setValidity({});\n }\n private _manageInternalsBadInput() {\n this._internals.setValidity(\n {\n badInput: true\n },\n \"The chosen date(s) are invalid\",\n this._shadowInput\n );\n }\n\n private _manageInternalsValid() {\n this._internals.setValidity({});\n }\n\n private _manageInternalsDefault(inputEl: HTMLInputElement) {\n this._internals.setValidity(inputEl.validity, inputEl.validationMessage, inputEl);\n }\n\n private _setInternalFormValue(value: string) {\n this._internals.setFormValue(value);\n }\n\n private async _handleInputMaskChange(e: CustomEvent) {\n this.value = e.detail;\n }\n\n private _dialogAriaLabels = {\n days: \"Choose date\",\n months: \"Choose month\",\n years: \"Choose year\"\n };\n\n render() {\n const svgEl = html`\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n fill=\"currentColor\"\n class=\"bi bi-x\"\n viewBox=\"0 0 16 16\"\n >\n <path\n d=\"M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z\"\n />\n </svg>\n `;\n\n return html`\n <div>\n <sgds-datepicker-input\n .value=${live(this.value)}\n ?required=${this.required}\n ?disabled=${this.disabled}\n placeholder=\"\"\n ${ref(this.myDropdown)}\n mode=${this.mode}\n dateFormat=${this.dateFormat}\n invalidFeedback=${this.invalidFeedback}\n @sgds-mask-input-change=${this._handleInputMaskChange}\n @sgds-invalid-input=${this._handleInvalidInput}\n minDate=${this.minDate}\n maxDate=${this.maxDate}\n label=${this.label}\n hintText=${this.hintText}\n name=${this.name}\n >\n <button\n slot=\"calendar-btn\"\n class=${classMap({\n \"sgds btn rounded-0 border btn-outline-dark\": true\n })}\n aria-expanded=\"${this.menuIsOpen}\"\n aria-haspopup=\"dialog\"\n aria-controls=${this.dropdownMenuId}\n @click=${() => this.toggleMenu()}\n aria-label=${this.menuIsOpen ? \"Close Calendar\" : \"Open Calendar\"}\n ?disabled=${this.disabled}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n fill=\"currentColor\"\n class=\"bi bi-calendar\"\n viewBox=\"0 0 16 16\"\n >\n <path\n d=\"M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5M1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4z\"\n />\n </svg>\n </button>\n <button\n slot=\"reset-btn\"\n ?disabled=${this.disabled}\n class=\"btn sgds rounded-0 reset-btn\"\n @click=${() => this._handleButtonResetClick()}\n aria-label=\"Reset Datepicker\"\n >\n ${svgEl}\n </button>\n </sgds-datepicker-input>\n\n <ul\n id=${this.dropdownMenuId}\n class=\"sgds datepicker dropdown-menu\"\n role=\"dialog\"\n part=\"menu\"\n aria-label=${this._dialogAriaLabels[this.view]}\n @click=${(event: MouseEvent) => event.stopPropagation()}\n >\n <sgds-datepicker-header\n .view=${this.view}\n .displayDate=${this.displayDate}\n .focusedDate=${this.focusedDate}\n .selectedDate=${this.selectedDateRange}\n .focusedTabIndex=${this.focusedTabIndex}\n ></sgds-datepicker-header>\n <sgds-datepicker-calendar\n .show=${this.menuIsOpen}\n .view=${this.view}\n .displayDate=${this.displayDate}\n .mode=${this.mode}\n minDate=${this.minDate}\n maxDate=${this.maxDate}\n .selectedDate=${this.selectedDateRange}\n .focusedTabIndex=${this.focusedTabIndex}\n ></sgds-datepicker-calendar>\n </ul>\n </div>\n `;\n }\n}\n\nexport default SgdsDatepicker;\n"],"names":["styles"],"mappings":";;;;;;;;;;;;;;;;AAmBA;;;;;;;;;;;;;;;;;AAiBG;MACU,cAAe,SAAQ,mBAAmB,CAAC,eAAe,CAAC,CAAA;;AAOtE,IAAA,WAAW,cAAc,GAAA;QACvB,OAAO;AACL,YAAA,uBAAuB,EAAE,eAAe;AACxC,YAAA,0BAA0B,EAAE,kBAAkB;AAC9C,YAAA,wBAAwB,EAAE,gBAAgB;SAC3C,CAAC;KACH;;IAwEM,cAAc,GAAA;AACnB,QAAA,OAAO,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE,CAAC;KACzC;AACD,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE,CAAC;;QAzEkC,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;;QAIjB,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;;QAGnB,IAAY,CAAA,YAAA,GAAa,EAAE,CAAC;;QAG1C,IAAU,CAAA,UAAA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