@govtechsg/sgds-web-component 3.21.2-rc.1 → 3.21.2-rc.2
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/components/ComboBox/index.umd.min.js +17 -9
- package/components/ComboBox/index.umd.min.js.map +1 -1
- package/components/ComboBox/sgds-combo-box.js +10 -2
- package/components/ComboBox/sgds-combo-box.js.map +1 -1
- package/components/Datepicker/datepicker-calendar.js +41 -30
- package/components/Datepicker/datepicker-calendar.js.map +1 -1
- package/components/Datepicker/datepicker-calendar2.js +1 -1
- package/components/Datepicker/datepicker-header.js +4 -3
- package/components/Datepicker/datepicker-header.js.map +1 -1
- package/components/Datepicker/index.umd.min.js +46 -35
- package/components/Datepicker/index.umd.min.js.map +1 -1
- package/components/Datepicker/sgds-datepicker.js +2 -2
- package/components/Datepicker/sgds-datepicker.js.map +1 -1
- package/components/Select/index.umd.min.js +10 -2
- package/components/Select/index.umd.min.js.map +1 -1
- package/components/Select/sgds-select.js +10 -2
- package/components/Select/sgds-select.js.map +1 -1
- package/components/index.umd.min.js +66 -39
- package/components/index.umd.min.js.map +1 -1
- package/css/fouc.css +1 -1
- package/custom-elements.json +645 -645
- package/index.umd.min.js +66 -39
- package/index.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/react/components/ComboBox/sgds-combo-box.cjs.js +10 -2
- package/react/components/ComboBox/sgds-combo-box.cjs.js.map +1 -1
- package/react/components/ComboBox/sgds-combo-box.js +10 -2
- package/react/components/ComboBox/sgds-combo-box.js.map +1 -1
- package/react/components/Datepicker/datepicker-calendar.cjs.js +41 -30
- package/react/components/Datepicker/datepicker-calendar.cjs.js.map +1 -1
- package/react/components/Datepicker/datepicker-calendar.cjs2.js +1 -1
- package/react/components/Datepicker/datepicker-calendar.js +41 -30
- package/react/components/Datepicker/datepicker-calendar.js.map +1 -1
- package/react/components/Datepicker/datepicker-calendar2.js +1 -1
- package/react/components/Datepicker/datepicker-header.cjs.js +4 -3
- package/react/components/Datepicker/datepicker-header.cjs.js.map +1 -1
- package/react/components/Datepicker/datepicker-header.js +4 -3
- package/react/components/Datepicker/datepicker-header.js.map +1 -1
- package/react/components/Datepicker/sgds-datepicker.cjs.js +2 -2
- package/react/components/Datepicker/sgds-datepicker.cjs.js.map +1 -1
- package/react/components/Datepicker/sgds-datepicker.js +2 -2
- package/react/components/Datepicker/sgds-datepicker.js.map +1 -1
- package/react/components/Select/sgds-select.cjs.js +10 -2
- package/react/components/Select/sgds-select.cjs.js.map +1 -1
- package/react/components/Select/sgds-select.js +10 -2
- package/react/components/Select/sgds-select.js.map +1 -1
- package/react/index.cjs.js +6 -6
- package/react/index.d.ts +1 -1
- package/react/index.js +1 -1
- package/types/react.d.ts +16 -16
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datepicker-calendar.cjs.js","sources":["../../../../src/components/Datepicker/datepicker-calendar.ts"],"sourcesContent":["import { format, isAfter, isEqual } from \"date-fns\";\nimport { HTMLTemplateResult, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport { createYearViewArray, setTimeToNoon } from \"../../utils/time\";\nimport { watch } from \"../../utils/watch\";\nimport { ViewEnum } from \"./types\";\nimport datepickerCalendarStyle from \"./datepicker-calendar.css\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\n\nconst TODAY_DATE = new Date();\n\nconst keyPressAction = {\n ArrowUp: {\n days: -7,\n months: -3,\n years: -3\n },\n ArrowDown: {\n days: 7,\n months: 3,\n years: 3\n },\n ArrowRight: {\n days: 1,\n months: 1,\n years: 1\n },\n ArrowLeft: {\n days: -1,\n months: -1,\n years: -1\n }\n};\nexport class DatepickerCalendar extends SgdsElement {\n static styles = [datepickerCalendarStyle];\n\n /** @internal */\n static DAY_LABELS = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"];\n\n /** @internal */\n static daysInMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n\n /** @internal */\n static MONTHVIEW_LABELS = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\"\n ];\n\n /** @internal */\n @property({ type: Array }) selectedDate: Date[] = [];\n\n /** @internal */\n @property({ attribute: false }) displayDate: Date;\n\n /** @internal */\n @property({ type: String }) minDate?: string;\n\n /** @internal */\n @property({ type: String }) maxDate?: string;\n\n /** @internal */\n @property({ type: String, reflect: true }) mode: \"single\" | \"range\" = \"single\";\n\n private focusedDate: Date;\n\n /** @internal */\n @property() view: ViewEnum;\n\n /** @internal */\n @property({ type: Boolean }) show: boolean;\n\n @property()\n focusedTabIndex: number;\n\n /**Shifts focus from Input to Calendar */\n public focusOnCalendar(toBlurEl: HTMLElement) {\n toBlurEl.blur();\n this._focusOnCalendarCell();\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n this.addEventListener(\"keydown\", this._handleKeyPress);\n /** Prevent validation from happening when navigating the calendar */\n this.addEventListener(\"blur\", e => e.stopPropagation());\n }\n\n updated() {\n /** For KeyboardNavigation (switching months) and ClickNavigation:\n * Runs after render has completed and td of next month has appeared.\n * For the case when calendar view changes to the next month\n * */\n\n if (this.focusedTabIndex === 3) {\n this._focusOnCalendarCell();\n }\n }\n\n @watch(\"displayDate\")\n _updateFocusedDate() {\n this.focusedDate = setTimeToNoon(this.displayDate);\n if (this.focusedDate.getFullYear() < 1900) {\n this.focusedDate.setFullYear(1900);\n }\n }\n\n private _setFocusedDate(shift: number) {\n const currentFocusedDate = this.focusedDate.getDate();\n const currentFocusedMonth = this.focusedDate.getMonth();\n const currentFocusedYear = this.focusedDate.getFullYear();\n switch (this.view) {\n case \"days\": {\n const newFocusedDate = setTimeToNoon(\n new Date(currentFocusedYear, currentFocusedMonth, currentFocusedDate + shift)\n );\n if (isAfter(newFocusedDate, new Date(0, 0, 1, 12)) || isEqual(newFocusedDate, new Date(0, 0, 1, 12)))\n this.focusedDate = newFocusedDate;\n break;\n }\n case \"months\": {\n const newFocusedDate = setTimeToNoon(\n new Date(currentFocusedYear, currentFocusedMonth + shift, currentFocusedDate)\n );\n\n if (isAfter(newFocusedDate, new Date(0, 0, 1, 12)) || isEqual(newFocusedDate, new Date(0, 0, 1, 12))) {\n this.focusedDate = newFocusedDate;\n }\n break;\n }\n case \"years\": {\n const newFocusedDate = setTimeToNoon(\n new Date(currentFocusedYear + shift, currentFocusedMonth, currentFocusedDate)\n );\n if (newFocusedDate.getFullYear() >= 1900) {\n this.focusedDate = newFocusedDate;\n }\n break;\n }\n }\n }\n private _handleEnterDateKeyboard(event: KeyboardEvent) {\n const targetElement = event.composedPath()[0] as HTMLElement;\n if (targetElement.classList.contains(\"disabled\")) return;\n\n switch (this.view) {\n case \"days\":\n this._onClickDay(event);\n break;\n case \"months\": {\n const { month } = targetElement.dataset;\n this._onClickMonth(parseInt(month));\n break;\n }\n case \"years\": {\n const { year } = targetElement.dataset;\n this._onClickYear(parseInt(year));\n }\n }\n }\n private _handleKeyPress(event: KeyboardEvent) {\n if (event.key === \"Enter\") {\n event.preventDefault();\n this._handleEnterDateKeyboard(event);\n return;\n }\n if (event.key === \"Tab\") {\n const targetEl: HTMLElement = this._getFocusedTarget();\n if (this.focusedTabIndex !== 3) targetEl.blur();\n return;\n }\n if (event.key.includes(\"Arrow\")) {\n event.preventDefault();\n this._blurCalendarCell();\n const keyShiftObject = keyPressAction[event.key];\n const shiftNumber = keyShiftObject[this.view];\n\n this._setFocusedDate(shiftNumber);\n\n this._focusOnCalendarCell();\n }\n }\n\n private _generateIncrementDates(): Date[] {\n const start = setTimeToNoon(this.selectedDate[0]);\n\n if (this.selectedDate.length < 2) {\n return [start];\n }\n\n const end = setTimeToNoon(this.selectedDate[1]);\n const arr: Date[] = [];\n if (start.getTime() < end.getTime()) {\n for (let dt = start; dt <= end; dt.setDate(dt.getDate() + 1)) {\n arr.push(new Date(dt));\n }\n } else {\n for (let dt = end; dt <= start; dt.setDate(dt.getDate() + 1)) {\n arr.push(new Date(dt));\n }\n }\n return arr;\n }\n\n private _onClickDay(event: MouseEvent | KeyboardEvent) {\n const { day, date } = (event.composedPath()[0] as HTMLTableCellElement).dataset;\n const displayDateClone = new Date(this.displayDate);\n displayDateClone.setDate(parseInt(day));\n /** update new focused date for mouse click */\n if (event.type === \"click\") {\n this.focusedDate = setTimeToNoon(new Date(date));\n }\n\n if (this.mode === \"single\") {\n // Single mode: Select a single date\n\n this.selectedDate = [displayDateClone];\n\n // Emit event with selected date\n this.emit(\"sgds-selectdates\", { detail: this.selectedDate });\n } else if (this.mode === \"range\") {\n // Range mode: Select a range of dates\n const selectedDates = [...this.selectedDate];\n\n if (selectedDates.length === 0 || selectedDates.length === 2) {\n // No dates selected yet or both dates already selected,\n // start a new range by clearing the selected dates array\n selectedDates.length = 0;\n }\n\n // Add the selected date to the range\n selectedDates.push(displayDateClone);\n\n // Update the selectedDate property\n this.selectedDate = selectedDates;\n\n // Emit event with the range of selected dates\n this.emit(\"sgds-selectdates\", { detail: this.selectedDate });\n }\n\n // Check if the selected date is before minDate or after maxDate\n const minimumDate = this.minDate ? setTimeToNoon(new Date(this.minDate)) : null;\n const maximumDate = this.maxDate ? setTimeToNoon(new Date(this.maxDate)) : null;\n\n const selectedDate = setTimeToNoon(displayDateClone);\n if ((minimumDate && selectedDate < minimumDate) || (maximumDate && selectedDate > maximumDate)) {\n event.stopPropagation();\n event.preventDefault();\n }\n }\n\n private _onClickMonth(month: number, year: number = this.focusedDate.getFullYear()) {\n const displayDateClone = new Date(this.displayDate);\n this.view = \"days\";\n displayDateClone.setMonth(month);\n displayDateClone.setFullYear(year);\n this.displayDate = displayDateClone;\n this.emit(\"sgds-view\", { detail: this.view });\n //once clicked, should change view to days, and hold value and change view\n this.emit(\"sgds-selectmonth\", { detail: this.displayDate });\n }\n\n private _onClickYear(year: number) {\n const displayDateClone = new Date(this.displayDate);\n displayDateClone.setFullYear(year);\n this.displayDate = displayDateClone;\n this.view = \"months\";\n this.emit(\"sgds-view\", { detail: this.view });\n\n this.emit(\"sgds-selectyear\", { detail: this.displayDate });\n }\n\n private _getFocusedTarget(): HTMLElement {\n const queryObj = {\n days: `td[data-date=\"${this.focusedDate.toISOString()}\"]`,\n months: `button[data-month=\"${this.focusedDate.getMonth()}\"][data-year=\"${this.focusedDate.getFullYear()}\"]`,\n years: `button[data-year=\"${this.focusedDate.getFullYear()}\"]`\n };\n const queryString = queryObj[this.view];\n const targetEl: HTMLElement = this.shadowRoot.querySelector(`${queryString}`);\n return targetEl;\n }\n private _blurCalendarCell() {\n const targetEl = this._getFocusedTarget();\n targetEl.setAttribute(\"tabindex\", \"-1\");\n targetEl.blur();\n }\n private _focusOnCalendarCell() {\n const targetEl = this._getFocusedTarget();\n if (targetEl) {\n targetEl.setAttribute(\"tabindex\", \"3\");\n targetEl.focus();\n this.emit(\"sgds-update-focus\", { detail: this.focusedDate });\n } else {\n /** Change month view */\n this.emit(\"sgds-change-calendar\", { detail: this.focusedDate });\n }\n }\n private _generateDays() {\n const selectedDates = this.selectedDate.map(d => setTimeToNoon(d));\n\n const rangeSelectedDates = this._generateIncrementDates();\n const minimumDate = this.minDate ? setTimeToNoon(new Date(this.minDate)) : null;\n const maximumDate = this.maxDate ? setTimeToNoon(new Date(this.maxDate)) : null;\n const year = this.displayDate.getFullYear();\n const month = this.displayDate.getMonth();\n const firstDateOfMonth = new Date(year, month, 1);\n const startingDayOfMonth = firstDateOfMonth.getDay();\n let monthLength = DatepickerCalendar.daysInMonth[month];\n if (month === 1) {\n if ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0) {\n monthLength = 29;\n }\n }\n\n const weeks = [];\n let day = 1;\n for (let i = 0; i < 9; i++) {\n const week = [];\n for (let j = 0; j <= 6; j++) {\n if (day <= monthLength && (i > 0 || j >= startingDayOfMonth)) {\n const dateObj = new Date(year, month, day, 12, 0, 0, 0);\n const dateStr = dateObj.toISOString();\n const beforeMinDate = minimumDate && Date.parse(dateStr) < Date.parse(minimumDate.toISOString());\n const afterMinDate = maximumDate && Date.parse(dateStr) > Date.parse(maximumDate.toISOString());\n const clickHandler = beforeMinDate || afterMinDate ? undefined : this._onClickDay;\n\n const isCurrentMonth = TODAY_DATE.getMonth() === this.displayDate.getMonth();\n const isCurrentYear = TODAY_DATE.getFullYear() === this.displayDate.getFullYear();\n const isCurrentDay = TODAY_DATE.getDate() === day;\n\n const isSelected =\n selectedDates.length > 0 &&\n rangeSelectedDates.some(d => Date.parse(dateStr) === Date.parse(d.toISOString()));\n const isFirstSelectedDate = selectedDates.length > 0 && rangeSelectedDates[0].toISOString() === dateStr;\n const isLastSelectedDate =\n selectedDates.length > 1 && rangeSelectedDates[rangeSelectedDates.length - 1].toISOString() === dateStr;\n const ariaLabel =\n `${isCurrentDay && isCurrentMonth && isCurrentYear ? \"Today's date, \" : \"\"}` + format(dateObj, \"PPPP\");\n week.push(\n html`<td\n key=${j}\n data-date=${dateStr}\n data-day=${day}\n aria-label=${ariaLabel}\n aria-current=${ifDefined(isCurrentDay && isCurrentMonth && isCurrentYear ? \"date\" : undefined)}\n class=${classMap({\n today: isCurrentDay && isCurrentMonth && isCurrentYear,\n \"selected-ends\": isFirstSelectedDate || isLastSelectedDate,\n active: isSelected,\n disabled: beforeMinDate || afterMinDate\n })}\n @click=${clickHandler}\n aria-selected=${ifDefined(isSelected ? \"true\" : undefined)}\n tabindex=${this.focusedDate === new Date(dateStr) ? \"3\" : \"-1\"}\n ?disabled=${beforeMinDate || afterMinDate}\n aria-disabled=${ifDefined(beforeMinDate || afterMinDate ? \"true\" : undefined)}\n role=\"button\"\n >\n ${day}\n </td>`\n );\n day++;\n } else {\n week.push(html`<td key=${j}></td>`);\n }\n }\n\n weeks.push(\n html`<tr key=${i}>\n ${week}\n </tr>`\n );\n if (day > monthLength) {\n break;\n }\n }\n\n const dayView = html`\n <table role=\"grid\">\n <thead>\n <tr>\n ${DatepickerCalendar.DAY_LABELS.map(\n (label: string, index: number) =>\n html` <th key=${index} abbr=${label} scope=\"col\">${label.slice(0, 3)}</th> `\n )}\n </tr>\n </thead>\n <tbody>\n ${weeks}\n </tbody>\n </table>\n `;\n return dayView;\n }\n\n private _generateMonths() {\n const rangeDates = this._generateIncrementDates();\n const selectedTime = rangeDates.map(e => setTimeToNoon(new Date(e.getFullYear(), e.getMonth())).getTime());\n\n const year = this.displayDate.getFullYear();\n\n const monthView = html`\n <div class=\"monthpicker\">\n ${DatepickerCalendar.MONTHVIEW_LABELS.map((m, idx) => {\n const isCurrentMonth = idx === TODAY_DATE.getMonth() && year === TODAY_DATE.getFullYear();\n const time = setTimeToNoon(new Date(year, idx)).getTime();\n const isFirstSelectedMonth = rangeDates[0].getMonth() === idx;\n const isFirstSelectedYear = rangeDates[0].getFullYear() === year;\n const isLastSelectedMonth = rangeDates[rangeDates.length - 1].getMonth() === idx;\n const isLastSelectedYear = rangeDates[rangeDates.length - 1].getFullYear() === year;\n const ariaLabel = isCurrentMonth ? `Current month ${m} ${year}` : `${m} ${year}`;\n return html` <button\n class=${classMap({\n active: selectedTime.includes(time),\n today: isCurrentMonth,\n month: true,\n \"selected-ends\":\n (isFirstSelectedMonth && isFirstSelectedYear) || (isLastSelectedMonth && isLastSelectedYear)\n })}\n @click=${() => this._onClickMonth(idx)}\n data-month=${idx}\n data-year=${year}\n tabindex=\"3\"\n aria-selected=${selectedTime.includes(time)}\n aria-label=${ariaLabel}\n >\n ${m.slice(0, 3)}\n </button>`;\n })}\n </div>\n `;\n return monthView;\n }\n\n private _generateYears() {\n const selectedYears = this._generateIncrementDates().map(e => e.getFullYear());\n const CURRENT_YEAR = TODAY_DATE.getFullYear();\n\n const yearArray = createYearViewArray(this.displayDate, CURRENT_YEAR);\n\n const yearView = html`\n <div class=\"sgds yearpicker\">\n ${yearArray.map(y => {\n const isFirstSelectedYear = selectedYears[0] === y;\n const isLastSectedYear = selectedYears[selectedYears.length - 1] === y;\n return html`\n <button\n class=${classMap({\n active: selectedYears.includes(y),\n year: true,\n today: CURRENT_YEAR === y,\n \"selected-ends\": isFirstSelectedYear || isLastSectedYear\n })}\n @click=${() => this._onClickYear(y)}\n data-year=${y}\n tabindex=\"3\"\n ?disabled=${y < 1900}\n aria-selected=${selectedYears.includes(y)}\n aria-label=${ifDefined(CURRENT_YEAR === y ? `Current year, ${y}` : undefined)}\n >\n ${y}\n </button>\n `;\n })}\n </div>\n `;\n return yearView;\n }\n render() {\n let viewContent: HTMLTemplateResult;\n\n switch (this.view) {\n case \"days\":\n viewContent = html` ${this._generateDays()} `;\n break;\n case \"months\":\n viewContent = html` ${this._generateMonths()} `;\n break;\n case \"years\":\n viewContent = html` ${this._generateYears()} `;\n break;\n default:\n viewContent = html` ${this._generateDays()} `; // Set a default view\n break;\n }\n\n return html` <div class=\"datepicker-body\">${viewContent}</div> `;\n }\n}\n\nexport default DatepickerCalendar;\n"],"names":["SgdsElement","setTimeToNoon","isAfter","isEqual","format","html","ifDefined","classMap","time","createYearViewArray","datepickerCalendarStyle","__decorate","property","watch"],"mappings":";;;;;;;;;;;;;;;;AAWA,MAAM,UAAU,GAAG,IAAI,IAAI,EAAE,CAAC;AAE9B,MAAM,cAAc,GAAG;AACrB,IAAA,OAAO,EAAE;QACP,IAAI,EAAE,CAAC,CAAC;QACR,MAAM,EAAE,CAAC,CAAC;QACV,KAAK,EAAE,CAAC,CAAC;AACV,KAAA;AACD,IAAA,SAAS,EAAE;AACT,QAAA,IAAI,EAAE,CAAC;AACP,QAAA,MAAM,EAAE,CAAC;AACT,QAAA,KAAK,EAAE,CAAC;AACT,KAAA;AACD,IAAA,UAAU,EAAE;AACV,QAAA,IAAI,EAAE,CAAC;AACP,QAAA,MAAM,EAAE,CAAC;AACT,QAAA,KAAK,EAAE,CAAC;AACT,KAAA;AACD,IAAA,SAAS,EAAE;QACT,IAAI,EAAE,CAAC,CAAC;QACR,MAAM,EAAE,CAAC,CAAC;QACV,KAAK,EAAE,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,CAAA;AAKnED,gBAAA,CAAA;AAAX,IAAAC,sBAAQ,EAAE;AAAgB,CAAA,EAAA,kBAAA,CAAA,SAAA,EAAA,MAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAGED,gBAAA,CAAA;AAA5B,IAAAC,sBAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAAe,CAAA,EAAA,kBAAA,CAAA,SAAA,EAAA,MAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAG3CD,gBAAA,CAAA;AADC,IAAAC,sBAAQ,EAAE;AACa,CAAA,EAAA,kBAAA,CAAA,SAAA,EAAA,iBAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AA2BxBD,gBAAA,CAAA;IADCE,WAAK,CAAC,aAAa,CAAC;AAMpB,CAAA,EAAA,kBAAA,CAAA,SAAA,EAAA,oBAAA,EAAA,IAAA,CAAA;;;;;"}
|
|
1
|
+
{"version":3,"file":"datepicker-calendar.cjs.js","sources":["../../../../src/components/Datepicker/datepicker-calendar.ts"],"sourcesContent":["import { format, isAfter, isEqual } from \"date-fns\";\nimport { HTMLTemplateResult, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport { createYearViewArray, setTimeToNoon } from \"../../utils/time\";\nimport { watch } from \"../../utils/watch\";\nimport { ViewEnum } from \"./types\";\nimport datepickerCalendarStyle from \"./datepicker-calendar.css\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\n\nconst TODAY_DATE = new Date();\n\nconst keyPressAction = {\n ArrowUp: {\n days: -7,\n months: -3,\n years: -3\n },\n ArrowDown: {\n days: 7,\n months: 3,\n years: 3\n },\n ArrowRight: {\n days: 1,\n months: 1,\n years: 1\n },\n ArrowLeft: {\n days: -1,\n months: -1,\n years: -1\n }\n};\nexport class DatepickerCalendar extends SgdsElement {\n static styles = [datepickerCalendarStyle];\n\n /** @internal */\n static DAY_LABELS = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"];\n\n /** @internal */\n static daysInMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n\n /** @internal */\n static MONTHVIEW_LABELS = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\"\n ];\n\n /** @internal */\n @property({ type: Array }) selectedDate: Date[] = [];\n\n /** @internal */\n @property({ attribute: false }) displayDate: Date;\n\n /** @internal */\n @property({ type: String }) minDate?: string;\n\n /** @internal */\n @property({ type: String }) maxDate?: string;\n\n /** @internal */\n @property({ type: String, reflect: true }) mode: \"single\" | \"range\" = \"single\";\n\n private focusedDate: Date;\n\n /** @internal */\n @property() view: ViewEnum;\n\n /** @internal */\n @property({ type: Boolean }) show: boolean;\n\n @property()\n focusedTabIndex: number;\n\n /**Shifts focus from Input to Calendar */\n public focusOnCalendar(toBlurEl: HTMLElement) {\n toBlurEl.blur();\n this._focusOnCalendarCell();\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n this.addEventListener(\"keydown\", this._handleKeyPress);\n /** Prevent validation from happening when navigating the calendar */\n this.addEventListener(\"blur\", e => e.stopPropagation());\n }\n\n updated() {\n /** For KeyboardNavigation (switching months) and ClickNavigation:\n * Runs after render has completed and td of next month has appeared.\n * For the case when calendar view changes to the next month\n * */\n\n if (this.focusedTabIndex === 3) {\n this._focusOnCalendarCell();\n }\n }\n\n @watch(\"displayDate\")\n _updateFocusedDate() {\n this.focusedDate = setTimeToNoon(this.displayDate);\n if (this.focusedDate.getFullYear() < 1900) {\n this.focusedDate.setFullYear(1900);\n }\n }\n\n private _setFocusedDate(shift: number) {\n const currentFocusedDate = this.focusedDate.getDate();\n const currentFocusedMonth = this.focusedDate.getMonth();\n const currentFocusedYear = this.focusedDate.getFullYear();\n switch (this.view) {\n case \"days\": {\n const newFocusedDate = setTimeToNoon(\n new Date(currentFocusedYear, currentFocusedMonth, currentFocusedDate + shift)\n );\n if (isAfter(newFocusedDate, new Date(0, 0, 1, 12)) || isEqual(newFocusedDate, new Date(0, 0, 1, 12)))\n this.focusedDate = newFocusedDate;\n break;\n }\n case \"months\": {\n const newFocusedDate = setTimeToNoon(\n new Date(currentFocusedYear, currentFocusedMonth + shift, currentFocusedDate)\n );\n\n if (isAfter(newFocusedDate, new Date(0, 0, 1, 12)) || isEqual(newFocusedDate, new Date(0, 0, 1, 12))) {\n this.focusedDate = newFocusedDate;\n }\n break;\n }\n case \"years\": {\n const newFocusedDate = setTimeToNoon(\n new Date(currentFocusedYear + shift, currentFocusedMonth, currentFocusedDate)\n );\n if (newFocusedDate.getFullYear() >= 1900) {\n this.focusedDate = newFocusedDate;\n }\n break;\n }\n }\n }\n private _handleEnterDateKeyboard(event: KeyboardEvent) {\n const targetElement = event.composedPath()[0] as HTMLElement;\n if (targetElement.classList.contains(\"disabled\")) return;\n\n switch (this.view) {\n case \"days\":\n this._onClickDay(event);\n break;\n case \"months\": {\n const { month } = targetElement.dataset;\n this._onClickMonth(parseInt(month));\n break;\n }\n case \"years\": {\n const { year } = targetElement.dataset;\n this._onClickYear(parseInt(year));\n }\n }\n }\n private _handleKeyPress(event: KeyboardEvent) {\n if (event.key === \"Enter\") {\n event.preventDefault();\n this._handleEnterDateKeyboard(event);\n return;\n }\n if (event.key === \"Tab\") {\n const targetEl: HTMLElement = this._getFocusedTarget();\n if (this.focusedTabIndex !== 3) targetEl.blur();\n return;\n }\n if (event.key.includes(\"Arrow\")) {\n event.preventDefault();\n this._blurCalendarCell();\n const keyShiftObject = keyPressAction[event.key];\n const shiftNumber = keyShiftObject[this.view];\n\n this._setFocusedDate(shiftNumber);\n\n this._focusOnCalendarCell();\n }\n }\n\n private _generateIncrementDates(): Date[] {\n const start = setTimeToNoon(this.selectedDate[0]);\n\n if (this.selectedDate.length < 2) {\n return [start];\n }\n\n const end = setTimeToNoon(this.selectedDate[1]);\n const arr: Date[] = [];\n if (start.getTime() < end.getTime()) {\n for (let dt = start; dt <= end; dt.setDate(dt.getDate() + 1)) {\n arr.push(new Date(dt));\n }\n } else {\n for (let dt = end; dt <= start; dt.setDate(dt.getDate() + 1)) {\n arr.push(new Date(dt));\n }\n }\n return arr;\n }\n\n private _onClickDay(event: MouseEvent | KeyboardEvent) {\n const { day, date } = (event.composedPath()[0] as HTMLTableCellElement).dataset;\n const displayDateClone = new Date(this.displayDate);\n displayDateClone.setDate(parseInt(day));\n /** update new focused date for mouse click */\n if (event.type === \"click\") {\n this.focusedDate = setTimeToNoon(new Date(date));\n }\n\n if (this.mode === \"single\") {\n // Single mode: Select a single date\n\n this.selectedDate = [displayDateClone];\n\n // Emit event with selected date\n this.emit(\"sgds-selectdates\", { detail: this.selectedDate });\n } else if (this.mode === \"range\") {\n // Range mode: Select a range of dates\n const selectedDates = [...this.selectedDate];\n\n if (selectedDates.length === 0 || selectedDates.length === 2) {\n // No dates selected yet or both dates already selected,\n // start a new range by clearing the selected dates array\n selectedDates.length = 0;\n }\n\n // Add the selected date to the range\n selectedDates.push(displayDateClone);\n\n // Update the selectedDate property\n this.selectedDate = selectedDates;\n\n // Emit event with the range of selected dates\n this.emit(\"sgds-selectdates\", { detail: this.selectedDate });\n }\n\n // Check if the selected date is before minDate or after maxDate\n const minimumDate = this.minDate ? setTimeToNoon(new Date(this.minDate)) : null;\n const maximumDate = this.maxDate ? setTimeToNoon(new Date(this.maxDate)) : null;\n\n const selectedDate = setTimeToNoon(displayDateClone);\n if ((minimumDate && selectedDate < minimumDate) || (maximumDate && selectedDate > maximumDate)) {\n event.stopPropagation();\n event.preventDefault();\n }\n }\n\n private _onClickMonth(month: number, year: number = this.focusedDate.getFullYear()) {\n const displayDateClone = new Date(this.displayDate);\n this.view = \"days\";\n displayDateClone.setMonth(month);\n displayDateClone.setFullYear(year);\n this.displayDate = displayDateClone;\n this.emit(\"sgds-view\", { detail: this.view });\n //once clicked, should change view to days, and hold value and change view\n this.emit(\"sgds-selectmonth\", { detail: this.displayDate });\n }\n\n private _onClickYear(year: number) {\n const displayDateClone = new Date(this.displayDate);\n displayDateClone.setFullYear(year);\n this.displayDate = displayDateClone;\n this.view = \"months\";\n this.emit(\"sgds-view\", { detail: this.view });\n\n this.emit(\"sgds-selectyear\", { detail: this.displayDate });\n }\n\n private _getFocusedTarget(): HTMLElement {\n const queryObj = {\n days: `td[data-date=\"${this.focusedDate.toISOString()}\"]`,\n months: `button[data-month=\"${this.focusedDate.getMonth()}\"][data-year=\"${this.focusedDate.getFullYear()}\"]`,\n years: `button[data-year=\"${this.focusedDate.getFullYear()}\"]`\n };\n const queryString = queryObj[this.view];\n const targetEl: HTMLElement = this.shadowRoot.querySelector(`${queryString}`);\n return targetEl;\n }\n private _blurCalendarCell() {\n const targetEl = this._getFocusedTarget();\n targetEl.setAttribute(\"tabindex\", \"-1\");\n targetEl.blur();\n }\n private _focusOnCalendarCell() {\n const targetEl = this._getFocusedTarget();\n if (targetEl) {\n targetEl.setAttribute(\"tabindex\", \"0\");\n targetEl.focus();\n this.emit(\"sgds-update-focus\", { detail: this.focusedDate });\n } else {\n /** Change month view */\n this.emit(\"sgds-change-calendar\", { detail: this.focusedDate });\n }\n }\n private _generateDays() {\n const selectedDates = this.selectedDate.map(d => setTimeToNoon(d));\n\n const rangeSelectedDates = this._generateIncrementDates();\n const minimumDate = this.minDate ? setTimeToNoon(new Date(this.minDate)) : null;\n const maximumDate = this.maxDate ? setTimeToNoon(new Date(this.maxDate)) : null;\n const year = this.displayDate.getFullYear();\n const month = this.displayDate.getMonth();\n const firstDateOfMonth = new Date(year, month, 1);\n const startingDayOfMonth = firstDateOfMonth.getDay();\n let monthLength = DatepickerCalendar.daysInMonth[month];\n if (month === 1) {\n if ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0) {\n monthLength = 29;\n }\n }\n\n const weeks = [];\n let day = 1;\n for (let i = 0; i < 9; i++) {\n const week = [];\n for (let j = 0; j <= 6; j++) {\n if (day <= monthLength && (i > 0 || j >= startingDayOfMonth)) {\n const dateObj = new Date(year, month, day, 12, 0, 0, 0);\n const dateStr = dateObj.toISOString();\n const beforeMinDate = minimumDate && Date.parse(dateStr) < Date.parse(minimumDate.toISOString());\n const afterMinDate = maximumDate && Date.parse(dateStr) > Date.parse(maximumDate.toISOString());\n const clickHandler = beforeMinDate || afterMinDate ? undefined : this._onClickDay;\n\n const isCurrentMonth = TODAY_DATE.getMonth() === this.displayDate.getMonth();\n const isCurrentYear = TODAY_DATE.getFullYear() === this.displayDate.getFullYear();\n const isCurrentDay = TODAY_DATE.getDate() === day;\n\n const isSelected =\n selectedDates.length > 0 &&\n rangeSelectedDates.some(d => Date.parse(dateStr) === Date.parse(d.toISOString()));\n const isFirstSelectedDate = selectedDates.length > 0 && rangeSelectedDates[0].toISOString() === dateStr;\n const isLastSelectedDate =\n selectedDates.length > 1 && rangeSelectedDates[rangeSelectedDates.length - 1].toISOString() === dateStr;\n const ariaLabel =\n `${isCurrentDay && isCurrentMonth && isCurrentYear ? \"Today's date, \" : \"\"}` + format(dateObj, \"PPPP\");\n week.push(\n html`<td\n key=${j}\n data-date=${dateStr}\n data-day=${day}\n aria-label=${ariaLabel}\n aria-current=${ifDefined(isCurrentDay && isCurrentMonth && isCurrentYear ? \"date\" : undefined)}\n class=${classMap({\n today: isCurrentDay && isCurrentMonth && isCurrentYear,\n \"selected-ends\": isFirstSelectedDate || isLastSelectedDate,\n active: isSelected,\n disabled: beforeMinDate || afterMinDate\n })}\n @click=${clickHandler}\n aria-selected=${isSelected ? \"true\" : \"false\"}\n tabindex=${this.focusedDate === new Date(dateStr) ? \"0\" : \"-1\"}\n ?disabled=${beforeMinDate || afterMinDate}\n aria-disabled=${ifDefined(beforeMinDate || afterMinDate ? \"true\" : undefined)}\n role=\"gridcell\"\n >\n ${day}\n </td>`\n );\n day++;\n } else {\n week.push(html`<td key=${j}></td>`);\n }\n }\n\n weeks.push(\n html`<tr key=${i}>\n ${week}\n </tr>`\n );\n if (day > monthLength) {\n break;\n }\n }\n\n const dayView = html`\n <table role=\"grid\">\n <thead>\n <tr>\n ${DatepickerCalendar.DAY_LABELS.map(\n (label: string, index: number) =>\n html` <th key=${index} abbr=${label} scope=\"col\">${label.slice(0, 3)}</th> `\n )}\n </tr>\n </thead>\n <tbody>\n ${weeks}\n </tbody>\n </table>\n `;\n return dayView;\n }\n\n private _generateMonths() {\n const rangeDates = this._generateIncrementDates();\n const selectedTime = rangeDates.map(e => setTimeToNoon(new Date(e.getFullYear(), e.getMonth())).getTime());\n\n const year = this.displayDate.getFullYear();\n\n const monthView = html`\n <div class=\"monthpicker\" role=\"grid\">\n ${[0, 1, 2, 3].map(\n row => html`\n <div role=\"row\">\n ${DatepickerCalendar.MONTHVIEW_LABELS.slice(row * 3, row * 3 + 3).map((m, i) => {\n const idx = row * 3 + i;\n const isCurrentMonth = idx === TODAY_DATE.getMonth() && year === TODAY_DATE.getFullYear();\n const time = setTimeToNoon(new Date(year, idx)).getTime();\n const isFirstSelectedMonth = rangeDates[0].getMonth() === idx;\n const isFirstSelectedYear = rangeDates[0].getFullYear() === year;\n const isLastSelectedMonth = rangeDates[rangeDates.length - 1].getMonth() === idx;\n const isLastSelectedYear = rangeDates[rangeDates.length - 1].getFullYear() === year;\n const ariaLabel = isCurrentMonth ? `Current month ${m} ${year}` : `${m} ${year}`;\n return html` <button\n role=\"gridcell\"\n class=${classMap({\n active: selectedTime.includes(time),\n today: isCurrentMonth,\n month: true,\n \"selected-ends\":\n (isFirstSelectedMonth && isFirstSelectedYear) || (isLastSelectedMonth && isLastSelectedYear)\n })}\n @click=${() => this._onClickMonth(idx)}\n data-month=${idx}\n data-year=${year}\n tabindex=\"0\"\n aria-selected=${selectedTime.includes(time) ? \"true\" : \"false\"}\n aria-label=${ariaLabel}\n >\n ${m.slice(0, 3)}\n </button>`;\n })}\n </div>\n `\n )}\n </div>\n `;\n return monthView;\n }\n\n private _generateYears() {\n const selectedYears = this._generateIncrementDates().map(e => e.getFullYear());\n const CURRENT_YEAR = TODAY_DATE.getFullYear();\n\n const yearArray = createYearViewArray(this.displayDate, CURRENT_YEAR);\n\n const yearView = html`\n <div class=\"sgds yearpicker\" role=\"grid\">\n ${[0, 1, 2, 3].map(\n row => html`\n <div role=\"row\">\n ${yearArray.slice(row * 3, row * 3 + 3).map(y => {\n const isFirstSelectedYear = selectedYears[0] === y;\n const isLastSectedYear = selectedYears[selectedYears.length - 1] === y;\n return html`\n <button\n role=\"gridcell\"\n class=${classMap({\n active: selectedYears.includes(y),\n year: true,\n today: CURRENT_YEAR === y,\n \"selected-ends\": isFirstSelectedYear || isLastSectedYear\n })}\n @click=${() => this._onClickYear(y)}\n data-year=${y}\n tabindex=\"0\"\n ?disabled=${y < 1900}\n aria-selected=${selectedYears.includes(y) ? \"true\" : \"false\"}\n aria-label=${ifDefined(CURRENT_YEAR === y ? `Current year, ${y}` : undefined)}\n >\n ${y}\n </button>\n `;\n })}\n </div>\n `\n )}\n </div>\n `;\n return yearView;\n }\n render() {\n let viewContent: HTMLTemplateResult;\n\n switch (this.view) {\n case \"days\":\n viewContent = html` ${this._generateDays()} `;\n break;\n case \"months\":\n viewContent = html` ${this._generateMonths()} `;\n break;\n case \"years\":\n viewContent = html` ${this._generateYears()} `;\n break;\n default:\n viewContent = html` ${this._generateDays()} `; // Set a default view\n break;\n }\n\n return html` <div class=\"datepicker-body\">${viewContent}</div> `;\n }\n}\n\nexport default DatepickerCalendar;\n"],"names":["SgdsElement","setTimeToNoon","isAfter","isEqual","format","html","ifDefined","classMap","time","createYearViewArray","datepickerCalendarStyle","__decorate","property","watch"],"mappings":";;;;;;;;;;;;;;;;AAWA,MAAM,UAAU,GAAG,IAAI,IAAI,EAAE,CAAC;AAE9B,MAAM,cAAc,GAAG;AACrB,IAAA,OAAO,EAAE;QACP,IAAI,EAAE,CAAC,CAAC;QACR,MAAM,EAAE,CAAC,CAAC;QACV,KAAK,EAAE,CAAC,CAAC;AACV,KAAA;AACD,IAAA,SAA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,EAAA,kBAAA,CAAA,SAAA,EAAA,iBAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AA2BxBD,gBAAA,CAAA;IADCE,WAAK,CAAC,aAAa,CAAC;AAMpB,CAAA,EAAA,kBAAA,CAAA,SAAA,EAAA,oBAAA,EAAA,IAAA,CAAA;;;;;"}
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
|
|
6
6
|
var lit = require('lit');
|
|
7
7
|
|
|
8
|
-
var css_248z = lit.css`.datepicker-body{color:var(--sgds-form-color-default);display:flex;justify-content:center}table{border-collapse:collapse;text-align:center}.monthpicker,.yearpicker{display:grid;grid-template-columns:repeat(3,6rem);grid-template-rows:repeat(4,2.5rem)}button.month,button.year{background-color:transparent;border:0;border-radius:var(--sgds-form-border-radius-sm);font-size:var(--sgds-font-size-label-sm);line-height:var(--sgds-line-height-2-xs);padding:0;position:relative}button.month.active:not(.selected-ends),button.year.active:not(.selected-ends),td[data-day].active:not(.selected-ends){background-color:var(--sgds-primary-surface-translucent);border-radius:0;cursor:pointer}button.month:hover:not(.active),button.year:hover:not(.active),td[data-day]:hover:not(.disabled):not(.selected-ends):not(.active){background-color:var(--sgds-bg-translucent-subtle);cursor:pointer}button.month:focus:not(.active),button.year:focus:not(.active),td[data-day]:focus:not(.disabled):not(.selected-ends):not(.active){background-color:var(--sgds-bg-translucent-subtle)}button.month:focus-visible,button.year:focus-visible,td[data-day]:focus-visible{outline:var(--sgds-form-outline-focus);outline-offset:var(--sgds-form-outline-offset-focus)}button.month.active:not(.selected-ends):focus,button.year.active:not(.selected-ends):focus,td[data-day].active:not(.selected-ends):focus{border-radius:var(--sgds-form-border-radius-sm)}button.year.active{background-color:var(--sgds-primary-surface-translucent);cursor:pointer}td,th{border-radius:var(--sgds-form-border-radius-sm);font-size:var(--sgds-font-size-label-sm);height:var(--sgds-form-height-lg);line-height:var(--sgds-line-height-2-xs);padding:0;position:relative;width:var(--sgds-form-width-md)}th{font-weight:var(--sgds-font-weight-semibold)}td[data-day]{cursor:pointer}button.month.active.selected-ends,button.year.active.selected-ends,td[data-day].active.selected-ends{background-color:var(--sgds-form-primary-surface-default);color:var(--sgds-form-color-fixed-light)}button.month.active.selected-ends:focus,button.month.active.selected-ends:hover,button.year.active.selected-ends:focus,button.year.active.selected-ends:hover,td[data-day].active.selected-ends:focus,td[data-day].active.selected-ends:hover{background-color:var(--sgds-form-primary-surface-emphasis)}td[data-day].disabled{cursor:not-allowed;opacity:var(--sgds-opacity-40)}.today{align-items:center;display:flex;flex-direction:column;justify-content:center}.today:after{background-color:var(--sgds-form-primary-surface-default);bottom:6px;content:".";line-height:4px;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' fill='none'%3E%3Ccircle cx='2' cy='2' r='2' fill='%235A42C0'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' fill='none'%3E%3Ccircle cx='2' cy='2' r='2' fill='%235A42C0'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;position:absolute;width:4px}.today.active.selected-ends:after{background-color:var(--sgds-form-color-inverse)}`;
|
|
8
|
+
var css_248z = lit.css`.datepicker-body{color:var(--sgds-form-color-default);display:flex;justify-content:center}table{border-collapse:collapse;text-align:center}.monthpicker,.yearpicker{display:grid;grid-template-columns:repeat(3,6rem);grid-template-rows:repeat(4,2.5rem)}.monthpicker [role=row],.yearpicker [role=row]{display:contents}button.month,button.year{background-color:transparent;border:0;border-radius:var(--sgds-form-border-radius-sm);font-size:var(--sgds-font-size-label-sm);line-height:var(--sgds-line-height-2-xs);padding:0;position:relative}button.month.active:not(.selected-ends),button.year.active:not(.selected-ends),td[data-day].active:not(.selected-ends){background-color:var(--sgds-primary-surface-translucent);border-radius:0;cursor:pointer}button.month:hover:not(.active),button.year:hover:not(.active),td[data-day]:hover:not(.disabled):not(.selected-ends):not(.active){background-color:var(--sgds-bg-translucent-subtle);cursor:pointer}button.month:focus:not(.active),button.year:focus:not(.active),td[data-day]:focus:not(.disabled):not(.selected-ends):not(.active){background-color:var(--sgds-bg-translucent-subtle)}button.month:focus-visible,button.year:focus-visible,td[data-day]:focus-visible{outline:var(--sgds-form-outline-focus);outline-offset:var(--sgds-form-outline-offset-focus)}button.month.active:not(.selected-ends):focus,button.year.active:not(.selected-ends):focus,td[data-day].active:not(.selected-ends):focus{border-radius:var(--sgds-form-border-radius-sm)}button.year.active{background-color:var(--sgds-primary-surface-translucent);cursor:pointer}td,th{border-radius:var(--sgds-form-border-radius-sm);font-size:var(--sgds-font-size-label-sm);height:var(--sgds-form-height-lg);line-height:var(--sgds-line-height-2-xs);padding:0;position:relative;width:var(--sgds-form-width-md)}th{font-weight:var(--sgds-font-weight-semibold)}td[data-day]{cursor:pointer}button.month.active.selected-ends,button.year.active.selected-ends,td[data-day].active.selected-ends{background-color:var(--sgds-form-primary-surface-default);color:var(--sgds-form-color-fixed-light)}button.month.active.selected-ends:focus,button.month.active.selected-ends:hover,button.year.active.selected-ends:focus,button.year.active.selected-ends:hover,td[data-day].active.selected-ends:focus,td[data-day].active.selected-ends:hover{background-color:var(--sgds-form-primary-surface-emphasis)}td[data-day].disabled{cursor:not-allowed;opacity:var(--sgds-opacity-40)}.today{align-items:center;display:flex;flex-direction:column;justify-content:center}.today:after{background-color:var(--sgds-form-primary-surface-default);bottom:6px;content:".";line-height:4px;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' fill='none'%3E%3Ccircle cx='2' cy='2' r='2' fill='%235A42C0'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' fill='none'%3E%3Ccircle cx='2' cy='2' r='2' fill='%235A42C0'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;position:absolute;width:4px}.today.active.selected-ends:after{background-color:var(--sgds-form-color-inverse)}`;
|
|
9
9
|
|
|
10
10
|
exports["default"] = css_248z;
|
|
11
11
|
//# sourceMappingURL=datepicker-calendar.cjs2.js.map
|
|
@@ -227,7 +227,7 @@ class DatepickerCalendar extends SgdsElement {
|
|
|
227
227
|
_focusOnCalendarCell() {
|
|
228
228
|
const targetEl = this._getFocusedTarget();
|
|
229
229
|
if (targetEl) {
|
|
230
|
-
targetEl.setAttribute("tabindex", "
|
|
230
|
+
targetEl.setAttribute("tabindex", "0");
|
|
231
231
|
targetEl.focus();
|
|
232
232
|
this.emit("sgds-update-focus", { detail: this.focusedDate });
|
|
233
233
|
}
|
|
@@ -283,11 +283,11 @@ class DatepickerCalendar extends SgdsElement {
|
|
|
283
283
|
disabled: beforeMinDate || afterMinDate
|
|
284
284
|
})}
|
|
285
285
|
@click=${clickHandler}
|
|
286
|
-
aria-selected=${
|
|
287
|
-
tabindex=${this.focusedDate === new Date(dateStr) ? "
|
|
286
|
+
aria-selected=${isSelected ? "true" : "false"}
|
|
287
|
+
tabindex=${this.focusedDate === new Date(dateStr) ? "0" : "-1"}
|
|
288
288
|
?disabled=${beforeMinDate || afterMinDate}
|
|
289
289
|
aria-disabled=${ifDefined(beforeMinDate || afterMinDate ? "true" : undefined)}
|
|
290
|
-
role="
|
|
290
|
+
role="gridcell"
|
|
291
291
|
>
|
|
292
292
|
${day}
|
|
293
293
|
</td>`);
|
|
@@ -323,8 +323,11 @@ class DatepickerCalendar extends SgdsElement {
|
|
|
323
323
|
const selectedTime = rangeDates.map(e => setTimeToNoon(new Date(e.getFullYear(), e.getMonth())).getTime());
|
|
324
324
|
const year = this.displayDate.getFullYear();
|
|
325
325
|
const monthView = html `
|
|
326
|
-
<div class="monthpicker">
|
|
327
|
-
${
|
|
326
|
+
<div class="monthpicker" role="grid">
|
|
327
|
+
${[0, 1, 2, 3].map(row => html `
|
|
328
|
+
<div role="row">
|
|
329
|
+
${DatepickerCalendar.MONTHVIEW_LABELS.slice(row * 3, row * 3 + 3).map((m, i) => {
|
|
330
|
+
const idx = row * 3 + i;
|
|
328
331
|
const isCurrentMonth = idx === TODAY_DATE.getMonth() && year === TODAY_DATE.getFullYear();
|
|
329
332
|
const time = setTimeToNoon(new Date(year, idx)).getTime();
|
|
330
333
|
const isFirstSelectedMonth = rangeDates[0].getMonth() === idx;
|
|
@@ -333,22 +336,25 @@ class DatepickerCalendar extends SgdsElement {
|
|
|
333
336
|
const isLastSelectedYear = rangeDates[rangeDates.length - 1].getFullYear() === year;
|
|
334
337
|
const ariaLabel = isCurrentMonth ? `Current month ${m} ${year}` : `${m} ${year}`;
|
|
335
338
|
return html ` <button
|
|
336
|
-
|
|
339
|
+
role="gridcell"
|
|
340
|
+
class=${classMap({
|
|
337
341
|
active: selectedTime.includes(time),
|
|
338
342
|
today: isCurrentMonth,
|
|
339
343
|
month: true,
|
|
340
344
|
"selected-ends": (isFirstSelectedMonth && isFirstSelectedYear) || (isLastSelectedMonth && isLastSelectedYear)
|
|
341
345
|
})}
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
346
|
+
@click=${() => this._onClickMonth(idx)}
|
|
347
|
+
data-month=${idx}
|
|
348
|
+
data-year=${year}
|
|
349
|
+
tabindex="0"
|
|
350
|
+
aria-selected=${selectedTime.includes(time) ? "true" : "false"}
|
|
351
|
+
aria-label=${ariaLabel}
|
|
352
|
+
>
|
|
353
|
+
${m.slice(0, 3)}
|
|
354
|
+
</button>`;
|
|
351
355
|
})}
|
|
356
|
+
</div>
|
|
357
|
+
`)}
|
|
352
358
|
</div>
|
|
353
359
|
`;
|
|
354
360
|
return monthView;
|
|
@@ -358,29 +364,34 @@ class DatepickerCalendar extends SgdsElement {
|
|
|
358
364
|
const CURRENT_YEAR = TODAY_DATE.getFullYear();
|
|
359
365
|
const yearArray = createYearViewArray(this.displayDate, CURRENT_YEAR);
|
|
360
366
|
const yearView = html `
|
|
361
|
-
<div class="sgds yearpicker">
|
|
362
|
-
${
|
|
367
|
+
<div class="sgds yearpicker" role="grid">
|
|
368
|
+
${[0, 1, 2, 3].map(row => html `
|
|
369
|
+
<div role="row">
|
|
370
|
+
${yearArray.slice(row * 3, row * 3 + 3).map(y => {
|
|
363
371
|
const isFirstSelectedYear = selectedYears[0] === y;
|
|
364
372
|
const isLastSectedYear = selectedYears[selectedYears.length - 1] === y;
|
|
365
373
|
return html `
|
|
366
|
-
|
|
367
|
-
|
|
374
|
+
<button
|
|
375
|
+
role="gridcell"
|
|
376
|
+
class=${classMap({
|
|
368
377
|
active: selectedYears.includes(y),
|
|
369
378
|
year: true,
|
|
370
379
|
today: CURRENT_YEAR === y,
|
|
371
380
|
"selected-ends": isFirstSelectedYear || isLastSectedYear
|
|
372
381
|
})}
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
382
|
+
@click=${() => this._onClickYear(y)}
|
|
383
|
+
data-year=${y}
|
|
384
|
+
tabindex="0"
|
|
385
|
+
?disabled=${y < 1900}
|
|
386
|
+
aria-selected=${selectedYears.includes(y) ? "true" : "false"}
|
|
387
|
+
aria-label=${ifDefined(CURRENT_YEAR === y ? `Current year, ${y}` : undefined)}
|
|
388
|
+
>
|
|
389
|
+
${y}
|
|
390
|
+
</button>
|
|
391
|
+
`;
|
|
383
392
|
})}
|
|
393
|
+
</div>
|
|
394
|
+
`)}
|
|
384
395
|
</div>
|
|
385
396
|
`;
|
|
386
397
|
return yearView;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datepicker-calendar.js","sources":["../../../../src/components/Datepicker/datepicker-calendar.ts"],"sourcesContent":["import { format, isAfter, isEqual } from \"date-fns\";\nimport { HTMLTemplateResult, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport { createYearViewArray, setTimeToNoon } from \"../../utils/time\";\nimport { watch } from \"../../utils/watch\";\nimport { ViewEnum } from \"./types\";\nimport datepickerCalendarStyle from \"./datepicker-calendar.css\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\n\nconst TODAY_DATE = new Date();\n\nconst keyPressAction = {\n ArrowUp: {\n days: -7,\n months: -3,\n years: -3\n },\n ArrowDown: {\n days: 7,\n months: 3,\n years: 3\n },\n ArrowRight: {\n days: 1,\n months: 1,\n years: 1\n },\n ArrowLeft: {\n days: -1,\n months: -1,\n years: -1\n }\n};\nexport class DatepickerCalendar extends SgdsElement {\n static styles = [datepickerCalendarStyle];\n\n /** @internal */\n static DAY_LABELS = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"];\n\n /** @internal */\n static daysInMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n\n /** @internal */\n static MONTHVIEW_LABELS = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\"\n ];\n\n /** @internal */\n @property({ type: Array }) selectedDate: Date[] = [];\n\n /** @internal */\n @property({ attribute: false }) displayDate: Date;\n\n /** @internal */\n @property({ type: String }) minDate?: string;\n\n /** @internal */\n @property({ type: String }) maxDate?: string;\n\n /** @internal */\n @property({ type: String, reflect: true }) mode: \"single\" | \"range\" = \"single\";\n\n private focusedDate: Date;\n\n /** @internal */\n @property() view: ViewEnum;\n\n /** @internal */\n @property({ type: Boolean }) show: boolean;\n\n @property()\n focusedTabIndex: number;\n\n /**Shifts focus from Input to Calendar */\n public focusOnCalendar(toBlurEl: HTMLElement) {\n toBlurEl.blur();\n this._focusOnCalendarCell();\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n this.addEventListener(\"keydown\", this._handleKeyPress);\n /** Prevent validation from happening when navigating the calendar */\n this.addEventListener(\"blur\", e => e.stopPropagation());\n }\n\n updated() {\n /** For KeyboardNavigation (switching months) and ClickNavigation:\n * Runs after render has completed and td of next month has appeared.\n * For the case when calendar view changes to the next month\n * */\n\n if (this.focusedTabIndex === 3) {\n this._focusOnCalendarCell();\n }\n }\n\n @watch(\"displayDate\")\n _updateFocusedDate() {\n this.focusedDate = setTimeToNoon(this.displayDate);\n if (this.focusedDate.getFullYear() < 1900) {\n this.focusedDate.setFullYear(1900);\n }\n }\n\n private _setFocusedDate(shift: number) {\n const currentFocusedDate = this.focusedDate.getDate();\n const currentFocusedMonth = this.focusedDate.getMonth();\n const currentFocusedYear = this.focusedDate.getFullYear();\n switch (this.view) {\n case \"days\": {\n const newFocusedDate = setTimeToNoon(\n new Date(currentFocusedYear, currentFocusedMonth, currentFocusedDate + shift)\n );\n if (isAfter(newFocusedDate, new Date(0, 0, 1, 12)) || isEqual(newFocusedDate, new Date(0, 0, 1, 12)))\n this.focusedDate = newFocusedDate;\n break;\n }\n case \"months\": {\n const newFocusedDate = setTimeToNoon(\n new Date(currentFocusedYear, currentFocusedMonth + shift, currentFocusedDate)\n );\n\n if (isAfter(newFocusedDate, new Date(0, 0, 1, 12)) || isEqual(newFocusedDate, new Date(0, 0, 1, 12))) {\n this.focusedDate = newFocusedDate;\n }\n break;\n }\n case \"years\": {\n const newFocusedDate = setTimeToNoon(\n new Date(currentFocusedYear + shift, currentFocusedMonth, currentFocusedDate)\n );\n if (newFocusedDate.getFullYear() >= 1900) {\n this.focusedDate = newFocusedDate;\n }\n break;\n }\n }\n }\n private _handleEnterDateKeyboard(event: KeyboardEvent) {\n const targetElement = event.composedPath()[0] as HTMLElement;\n if (targetElement.classList.contains(\"disabled\")) return;\n\n switch (this.view) {\n case \"days\":\n this._onClickDay(event);\n break;\n case \"months\": {\n const { month } = targetElement.dataset;\n this._onClickMonth(parseInt(month));\n break;\n }\n case \"years\": {\n const { year } = targetElement.dataset;\n this._onClickYear(parseInt(year));\n }\n }\n }\n private _handleKeyPress(event: KeyboardEvent) {\n if (event.key === \"Enter\") {\n event.preventDefault();\n this._handleEnterDateKeyboard(event);\n return;\n }\n if (event.key === \"Tab\") {\n const targetEl: HTMLElement = this._getFocusedTarget();\n if (this.focusedTabIndex !== 3) targetEl.blur();\n return;\n }\n if (event.key.includes(\"Arrow\")) {\n event.preventDefault();\n this._blurCalendarCell();\n const keyShiftObject = keyPressAction[event.key];\n const shiftNumber = keyShiftObject[this.view];\n\n this._setFocusedDate(shiftNumber);\n\n this._focusOnCalendarCell();\n }\n }\n\n private _generateIncrementDates(): Date[] {\n const start = setTimeToNoon(this.selectedDate[0]);\n\n if (this.selectedDate.length < 2) {\n return [start];\n }\n\n const end = setTimeToNoon(this.selectedDate[1]);\n const arr: Date[] = [];\n if (start.getTime() < end.getTime()) {\n for (let dt = start; dt <= end; dt.setDate(dt.getDate() + 1)) {\n arr.push(new Date(dt));\n }\n } else {\n for (let dt = end; dt <= start; dt.setDate(dt.getDate() + 1)) {\n arr.push(new Date(dt));\n }\n }\n return arr;\n }\n\n private _onClickDay(event: MouseEvent | KeyboardEvent) {\n const { day, date } = (event.composedPath()[0] as HTMLTableCellElement).dataset;\n const displayDateClone = new Date(this.displayDate);\n displayDateClone.setDate(parseInt(day));\n /** update new focused date for mouse click */\n if (event.type === \"click\") {\n this.focusedDate = setTimeToNoon(new Date(date));\n }\n\n if (this.mode === \"single\") {\n // Single mode: Select a single date\n\n this.selectedDate = [displayDateClone];\n\n // Emit event with selected date\n this.emit(\"sgds-selectdates\", { detail: this.selectedDate });\n } else if (this.mode === \"range\") {\n // Range mode: Select a range of dates\n const selectedDates = [...this.selectedDate];\n\n if (selectedDates.length === 0 || selectedDates.length === 2) {\n // No dates selected yet or both dates already selected,\n // start a new range by clearing the selected dates array\n selectedDates.length = 0;\n }\n\n // Add the selected date to the range\n selectedDates.push(displayDateClone);\n\n // Update the selectedDate property\n this.selectedDate = selectedDates;\n\n // Emit event with the range of selected dates\n this.emit(\"sgds-selectdates\", { detail: this.selectedDate });\n }\n\n // Check if the selected date is before minDate or after maxDate\n const minimumDate = this.minDate ? setTimeToNoon(new Date(this.minDate)) : null;\n const maximumDate = this.maxDate ? setTimeToNoon(new Date(this.maxDate)) : null;\n\n const selectedDate = setTimeToNoon(displayDateClone);\n if ((minimumDate && selectedDate < minimumDate) || (maximumDate && selectedDate > maximumDate)) {\n event.stopPropagation();\n event.preventDefault();\n }\n }\n\n private _onClickMonth(month: number, year: number = this.focusedDate.getFullYear()) {\n const displayDateClone = new Date(this.displayDate);\n this.view = \"days\";\n displayDateClone.setMonth(month);\n displayDateClone.setFullYear(year);\n this.displayDate = displayDateClone;\n this.emit(\"sgds-view\", { detail: this.view });\n //once clicked, should change view to days, and hold value and change view\n this.emit(\"sgds-selectmonth\", { detail: this.displayDate });\n }\n\n private _onClickYear(year: number) {\n const displayDateClone = new Date(this.displayDate);\n displayDateClone.setFullYear(year);\n this.displayDate = displayDateClone;\n this.view = \"months\";\n this.emit(\"sgds-view\", { detail: this.view });\n\n this.emit(\"sgds-selectyear\", { detail: this.displayDate });\n }\n\n private _getFocusedTarget(): HTMLElement {\n const queryObj = {\n days: `td[data-date=\"${this.focusedDate.toISOString()}\"]`,\n months: `button[data-month=\"${this.focusedDate.getMonth()}\"][data-year=\"${this.focusedDate.getFullYear()}\"]`,\n years: `button[data-year=\"${this.focusedDate.getFullYear()}\"]`\n };\n const queryString = queryObj[this.view];\n const targetEl: HTMLElement = this.shadowRoot.querySelector(`${queryString}`);\n return targetEl;\n }\n private _blurCalendarCell() {\n const targetEl = this._getFocusedTarget();\n targetEl.setAttribute(\"tabindex\", \"-1\");\n targetEl.blur();\n }\n private _focusOnCalendarCell() {\n const targetEl = this._getFocusedTarget();\n if (targetEl) {\n targetEl.setAttribute(\"tabindex\", \"3\");\n targetEl.focus();\n this.emit(\"sgds-update-focus\", { detail: this.focusedDate });\n } else {\n /** Change month view */\n this.emit(\"sgds-change-calendar\", { detail: this.focusedDate });\n }\n }\n private _generateDays() {\n const selectedDates = this.selectedDate.map(d => setTimeToNoon(d));\n\n const rangeSelectedDates = this._generateIncrementDates();\n const minimumDate = this.minDate ? setTimeToNoon(new Date(this.minDate)) : null;\n const maximumDate = this.maxDate ? setTimeToNoon(new Date(this.maxDate)) : null;\n const year = this.displayDate.getFullYear();\n const month = this.displayDate.getMonth();\n const firstDateOfMonth = new Date(year, month, 1);\n const startingDayOfMonth = firstDateOfMonth.getDay();\n let monthLength = DatepickerCalendar.daysInMonth[month];\n if (month === 1) {\n if ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0) {\n monthLength = 29;\n }\n }\n\n const weeks = [];\n let day = 1;\n for (let i = 0; i < 9; i++) {\n const week = [];\n for (let j = 0; j <= 6; j++) {\n if (day <= monthLength && (i > 0 || j >= startingDayOfMonth)) {\n const dateObj = new Date(year, month, day, 12, 0, 0, 0);\n const dateStr = dateObj.toISOString();\n const beforeMinDate = minimumDate && Date.parse(dateStr) < Date.parse(minimumDate.toISOString());\n const afterMinDate = maximumDate && Date.parse(dateStr) > Date.parse(maximumDate.toISOString());\n const clickHandler = beforeMinDate || afterMinDate ? undefined : this._onClickDay;\n\n const isCurrentMonth = TODAY_DATE.getMonth() === this.displayDate.getMonth();\n const isCurrentYear = TODAY_DATE.getFullYear() === this.displayDate.getFullYear();\n const isCurrentDay = TODAY_DATE.getDate() === day;\n\n const isSelected =\n selectedDates.length > 0 &&\n rangeSelectedDates.some(d => Date.parse(dateStr) === Date.parse(d.toISOString()));\n const isFirstSelectedDate = selectedDates.length > 0 && rangeSelectedDates[0].toISOString() === dateStr;\n const isLastSelectedDate =\n selectedDates.length > 1 && rangeSelectedDates[rangeSelectedDates.length - 1].toISOString() === dateStr;\n const ariaLabel =\n `${isCurrentDay && isCurrentMonth && isCurrentYear ? \"Today's date, \" : \"\"}` + format(dateObj, \"PPPP\");\n week.push(\n html`<td\n key=${j}\n data-date=${dateStr}\n data-day=${day}\n aria-label=${ariaLabel}\n aria-current=${ifDefined(isCurrentDay && isCurrentMonth && isCurrentYear ? \"date\" : undefined)}\n class=${classMap({\n today: isCurrentDay && isCurrentMonth && isCurrentYear,\n \"selected-ends\": isFirstSelectedDate || isLastSelectedDate,\n active: isSelected,\n disabled: beforeMinDate || afterMinDate\n })}\n @click=${clickHandler}\n aria-selected=${ifDefined(isSelected ? \"true\" : undefined)}\n tabindex=${this.focusedDate === new Date(dateStr) ? \"3\" : \"-1\"}\n ?disabled=${beforeMinDate || afterMinDate}\n aria-disabled=${ifDefined(beforeMinDate || afterMinDate ? \"true\" : undefined)}\n role=\"button\"\n >\n ${day}\n </td>`\n );\n day++;\n } else {\n week.push(html`<td key=${j}></td>`);\n }\n }\n\n weeks.push(\n html`<tr key=${i}>\n ${week}\n </tr>`\n );\n if (day > monthLength) {\n break;\n }\n }\n\n const dayView = html`\n <table role=\"grid\">\n <thead>\n <tr>\n ${DatepickerCalendar.DAY_LABELS.map(\n (label: string, index: number) =>\n html` <th key=${index} abbr=${label} scope=\"col\">${label.slice(0, 3)}</th> `\n )}\n </tr>\n </thead>\n <tbody>\n ${weeks}\n </tbody>\n </table>\n `;\n return dayView;\n }\n\n private _generateMonths() {\n const rangeDates = this._generateIncrementDates();\n const selectedTime = rangeDates.map(e => setTimeToNoon(new Date(e.getFullYear(), e.getMonth())).getTime());\n\n const year = this.displayDate.getFullYear();\n\n const monthView = html`\n <div class=\"monthpicker\">\n ${DatepickerCalendar.MONTHVIEW_LABELS.map((m, idx) => {\n const isCurrentMonth = idx === TODAY_DATE.getMonth() && year === TODAY_DATE.getFullYear();\n const time = setTimeToNoon(new Date(year, idx)).getTime();\n const isFirstSelectedMonth = rangeDates[0].getMonth() === idx;\n const isFirstSelectedYear = rangeDates[0].getFullYear() === year;\n const isLastSelectedMonth = rangeDates[rangeDates.length - 1].getMonth() === idx;\n const isLastSelectedYear = rangeDates[rangeDates.length - 1].getFullYear() === year;\n const ariaLabel = isCurrentMonth ? `Current month ${m} ${year}` : `${m} ${year}`;\n return html` <button\n class=${classMap({\n active: selectedTime.includes(time),\n today: isCurrentMonth,\n month: true,\n \"selected-ends\":\n (isFirstSelectedMonth && isFirstSelectedYear) || (isLastSelectedMonth && isLastSelectedYear)\n })}\n @click=${() => this._onClickMonth(idx)}\n data-month=${idx}\n data-year=${year}\n tabindex=\"3\"\n aria-selected=${selectedTime.includes(time)}\n aria-label=${ariaLabel}\n >\n ${m.slice(0, 3)}\n </button>`;\n })}\n </div>\n `;\n return monthView;\n }\n\n private _generateYears() {\n const selectedYears = this._generateIncrementDates().map(e => e.getFullYear());\n const CURRENT_YEAR = TODAY_DATE.getFullYear();\n\n const yearArray = createYearViewArray(this.displayDate, CURRENT_YEAR);\n\n const yearView = html`\n <div class=\"sgds yearpicker\">\n ${yearArray.map(y => {\n const isFirstSelectedYear = selectedYears[0] === y;\n const isLastSectedYear = selectedYears[selectedYears.length - 1] === y;\n return html`\n <button\n class=${classMap({\n active: selectedYears.includes(y),\n year: true,\n today: CURRENT_YEAR === y,\n \"selected-ends\": isFirstSelectedYear || isLastSectedYear\n })}\n @click=${() => this._onClickYear(y)}\n data-year=${y}\n tabindex=\"3\"\n ?disabled=${y < 1900}\n aria-selected=${selectedYears.includes(y)}\n aria-label=${ifDefined(CURRENT_YEAR === y ? `Current year, ${y}` : undefined)}\n >\n ${y}\n </button>\n `;\n })}\n </div>\n `;\n return yearView;\n }\n render() {\n let viewContent: HTMLTemplateResult;\n\n switch (this.view) {\n case \"days\":\n viewContent = html` ${this._generateDays()} `;\n break;\n case \"months\":\n viewContent = html` ${this._generateMonths()} `;\n break;\n case \"years\":\n viewContent = html` ${this._generateYears()} `;\n break;\n default:\n viewContent = html` ${this._generateDays()} `; // Set a default view\n break;\n }\n\n return html` <div class=\"datepicker-body\">${viewContent}</div> `;\n }\n}\n\nexport default DatepickerCalendar;\n"],"names":["datepick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,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAAkB,CAAA,EAAA,kBAAA,CAAA,SAAA,EAAA,SAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAGjB,UAAA,CAAA;AAA3B,IAAA,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAAkB,CAAA,EAAA,kBAAA,CAAA,SAAA,EAAA,SAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAGF,UAAA,CAAA;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAAqC,CAAA,EAAA,kBAAA,CAAA,SAAA,EAAA,MAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAKnE,UAAA,CAAA;AAAX,IAAA,QAAQ,EAAE;AAAgB,CAAA,EAAA,kBAAA,CAAA,SAAA,EAAA,MAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAGE,UAAA,CAAA;AAA5B,IAAA,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAAe,CAAA,EAAA,kBAAA,CAAA,SAAA,EAAA,MAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAG3C,UAAA,CAAA;AADC,IAAA,QAAQ,EAAE;AACa,CAAA,EAAA,kBAAA,CAAA,SAAA,EAAA,iBAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AA2BxB,UAAA,CAAA;IADC,KAAK,CAAC,aAAa,CAAC;AAMpB,CAAA,EAAA,kBAAA,CAAA,SAAA,EAAA,oBAAA,EAAA,IAAA,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"datepicker-calendar.js","sources":["../../../../src/components/Datepicker/datepicker-calendar.ts"],"sourcesContent":["import { format, isAfter, isEqual } from \"date-fns\";\nimport { HTMLTemplateResult, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport { createYearViewArray, setTimeToNoon } from \"../../utils/time\";\nimport { watch } from \"../../utils/watch\";\nimport { ViewEnum } from \"./types\";\nimport datepickerCalendarStyle from \"./datepicker-calendar.css\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\n\nconst TODAY_DATE = new Date();\n\nconst keyPressAction = {\n ArrowUp: {\n days: -7,\n months: -3,\n years: -3\n },\n ArrowDown: {\n days: 7,\n months: 3,\n years: 3\n },\n ArrowRight: {\n days: 1,\n months: 1,\n years: 1\n },\n ArrowLeft: {\n days: -1,\n months: -1,\n years: -1\n }\n};\nexport class DatepickerCalendar extends SgdsElement {\n static styles = [datepickerCalendarStyle];\n\n /** @internal */\n static DAY_LABELS = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"];\n\n /** @internal */\n static daysInMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n\n /** @internal */\n static MONTHVIEW_LABELS = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\"\n ];\n\n /** @internal */\n @property({ type: Array }) selectedDate: Date[] = [];\n\n /** @internal */\n @property({ attribute: false }) displayDate: Date;\n\n /** @internal */\n @property({ type: String }) minDate?: string;\n\n /** @internal */\n @property({ type: String }) maxDate?: string;\n\n /** @internal */\n @property({ type: String, reflect: true }) mode: \"single\" | \"range\" = \"single\";\n\n private focusedDate: Date;\n\n /** @internal */\n @property() view: ViewEnum;\n\n /** @internal */\n @property({ type: Boolean }) show: boolean;\n\n @property()\n focusedTabIndex: number;\n\n /**Shifts focus from Input to Calendar */\n public focusOnCalendar(toBlurEl: HTMLElement) {\n toBlurEl.blur();\n this._focusOnCalendarCell();\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n this.addEventListener(\"keydown\", this._handleKeyPress);\n /** Prevent validation from happening when navigating the calendar */\n this.addEventListener(\"blur\", e => e.stopPropagation());\n }\n\n updated() {\n /** For KeyboardNavigation (switching months) and ClickNavigation:\n * Runs after render has completed and td of next month has appeared.\n * For the case when calendar view changes to the next month\n * */\n\n if (this.focusedTabIndex === 3) {\n this._focusOnCalendarCell();\n }\n }\n\n @watch(\"displayDate\")\n _updateFocusedDate() {\n this.focusedDate = setTimeToNoon(this.displayDate);\n if (this.focusedDate.getFullYear() < 1900) {\n this.focusedDate.setFullYear(1900);\n }\n }\n\n private _setFocusedDate(shift: number) {\n const currentFocusedDate = this.focusedDate.getDate();\n const currentFocusedMonth = this.focusedDate.getMonth();\n const currentFocusedYear = this.focusedDate.getFullYear();\n switch (this.view) {\n case \"days\": {\n const newFocusedDate = setTimeToNoon(\n new Date(currentFocusedYear, currentFocusedMonth, currentFocusedDate + shift)\n );\n if (isAfter(newFocusedDate, new Date(0, 0, 1, 12)) || isEqual(newFocusedDate, new Date(0, 0, 1, 12)))\n this.focusedDate = newFocusedDate;\n break;\n }\n case \"months\": {\n const newFocusedDate = setTimeToNoon(\n new Date(currentFocusedYear, currentFocusedMonth + shift, currentFocusedDate)\n );\n\n if (isAfter(newFocusedDate, new Date(0, 0, 1, 12)) || isEqual(newFocusedDate, new Date(0, 0, 1, 12))) {\n this.focusedDate = newFocusedDate;\n }\n break;\n }\n case \"years\": {\n const newFocusedDate = setTimeToNoon(\n new Date(currentFocusedYear + shift, currentFocusedMonth, currentFocusedDate)\n );\n if (newFocusedDate.getFullYear() >= 1900) {\n this.focusedDate = newFocusedDate;\n }\n break;\n }\n }\n }\n private _handleEnterDateKeyboard(event: KeyboardEvent) {\n const targetElement = event.composedPath()[0] as HTMLElement;\n if (targetElement.classList.contains(\"disabled\")) return;\n\n switch (this.view) {\n case \"days\":\n this._onClickDay(event);\n break;\n case \"months\": {\n const { month } = targetElement.dataset;\n this._onClickMonth(parseInt(month));\n break;\n }\n case \"years\": {\n const { year } = targetElement.dataset;\n this._onClickYear(parseInt(year));\n }\n }\n }\n private _handleKeyPress(event: KeyboardEvent) {\n if (event.key === \"Enter\") {\n event.preventDefault();\n this._handleEnterDateKeyboard(event);\n return;\n }\n if (event.key === \"Tab\") {\n const targetEl: HTMLElement = this._getFocusedTarget();\n if (this.focusedTabIndex !== 3) targetEl.blur();\n return;\n }\n if (event.key.includes(\"Arrow\")) {\n event.preventDefault();\n this._blurCalendarCell();\n const keyShiftObject = keyPressAction[event.key];\n const shiftNumber = keyShiftObject[this.view];\n\n this._setFocusedDate(shiftNumber);\n\n this._focusOnCalendarCell();\n }\n }\n\n private _generateIncrementDates(): Date[] {\n const start = setTimeToNoon(this.selectedDate[0]);\n\n if (this.selectedDate.length < 2) {\n return [start];\n }\n\n const end = setTimeToNoon(this.selectedDate[1]);\n const arr: Date[] = [];\n if (start.getTime() < end.getTime()) {\n for (let dt = start; dt <= end; dt.setDate(dt.getDate() + 1)) {\n arr.push(new Date(dt));\n }\n } else {\n for (let dt = end; dt <= start; dt.setDate(dt.getDate() + 1)) {\n arr.push(new Date(dt));\n }\n }\n return arr;\n }\n\n private _onClickDay(event: MouseEvent | KeyboardEvent) {\n const { day, date } = (event.composedPath()[0] as HTMLTableCellElement).dataset;\n const displayDateClone = new Date(this.displayDate);\n displayDateClone.setDate(parseInt(day));\n /** update new focused date for mouse click */\n if (event.type === \"click\") {\n this.focusedDate = setTimeToNoon(new Date(date));\n }\n\n if (this.mode === \"single\") {\n // Single mode: Select a single date\n\n this.selectedDate = [displayDateClone];\n\n // Emit event with selected date\n this.emit(\"sgds-selectdates\", { detail: this.selectedDate });\n } else if (this.mode === \"range\") {\n // Range mode: Select a range of dates\n const selectedDates = [...this.selectedDate];\n\n if (selectedDates.length === 0 || selectedDates.length === 2) {\n // No dates selected yet or both dates already selected,\n // start a new range by clearing the selected dates array\n selectedDates.length = 0;\n }\n\n // Add the selected date to the range\n selectedDates.push(displayDateClone);\n\n // Update the selectedDate property\n this.selectedDate = selectedDates;\n\n // Emit event with the range of selected dates\n this.emit(\"sgds-selectdates\", { detail: this.selectedDate });\n }\n\n // Check if the selected date is before minDate or after maxDate\n const minimumDate = this.minDate ? setTimeToNoon(new Date(this.minDate)) : null;\n const maximumDate = this.maxDate ? setTimeToNoon(new Date(this.maxDate)) : null;\n\n const selectedDate = setTimeToNoon(displayDateClone);\n if ((minimumDate && selectedDate < minimumDate) || (maximumDate && selectedDate > maximumDate)) {\n event.stopPropagation();\n event.preventDefault();\n }\n }\n\n private _onClickMonth(month: number, year: number = this.focusedDate.getFullYear()) {\n const displayDateClone = new Date(this.displayDate);\n this.view = \"days\";\n displayDateClone.setMonth(month);\n displayDateClone.setFullYear(year);\n this.displayDate = displayDateClone;\n this.emit(\"sgds-view\", { detail: this.view });\n //once clicked, should change view to days, and hold value and change view\n this.emit(\"sgds-selectmonth\", { detail: this.displayDate });\n }\n\n private _onClickYear(year: number) {\n const displayDateClone = new Date(this.displayDate);\n displayDateClone.setFullYear(year);\n this.displayDate = displayDateClone;\n this.view = \"months\";\n this.emit(\"sgds-view\", { detail: this.view });\n\n this.emit(\"sgds-selectyear\", { detail: this.displayDate });\n }\n\n private _getFocusedTarget(): HTMLElement {\n const queryObj = {\n days: `td[data-date=\"${this.focusedDate.toISOString()}\"]`,\n months: `button[data-month=\"${this.focusedDate.getMonth()}\"][data-year=\"${this.focusedDate.getFullYear()}\"]`,\n years: `button[data-year=\"${this.focusedDate.getFullYear()}\"]`\n };\n const queryString = queryObj[this.view];\n const targetEl: HTMLElement = this.shadowRoot.querySelector(`${queryString}`);\n return targetEl;\n }\n private _blurCalendarCell() {\n const targetEl = this._getFocusedTarget();\n targetEl.setAttribute(\"tabindex\", \"-1\");\n targetEl.blur();\n }\n private _focusOnCalendarCell() {\n const targetEl = this._getFocusedTarget();\n if (targetEl) {\n targetEl.setAttribute(\"tabindex\", \"0\");\n targetEl.focus();\n this.emit(\"sgds-update-focus\", { detail: this.focusedDate });\n } else {\n /** Change month view */\n this.emit(\"sgds-change-calendar\", { detail: this.focusedDate });\n }\n }\n private _generateDays() {\n const selectedDates = this.selectedDate.map(d => setTimeToNoon(d));\n\n const rangeSelectedDates = this._generateIncrementDates();\n const minimumDate = this.minDate ? setTimeToNoon(new Date(this.minDate)) : null;\n const maximumDate = this.maxDate ? setTimeToNoon(new Date(this.maxDate)) : null;\n const year = this.displayDate.getFullYear();\n const month = this.displayDate.getMonth();\n const firstDateOfMonth = new Date(year, month, 1);\n const startingDayOfMonth = firstDateOfMonth.getDay();\n let monthLength = DatepickerCalendar.daysInMonth[month];\n if (month === 1) {\n if ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0) {\n monthLength = 29;\n }\n }\n\n const weeks = [];\n let day = 1;\n for (let i = 0; i < 9; i++) {\n const week = [];\n for (let j = 0; j <= 6; j++) {\n if (day <= monthLength && (i > 0 || j >= startingDayOfMonth)) {\n const dateObj = new Date(year, month, day, 12, 0, 0, 0);\n const dateStr = dateObj.toISOString();\n const beforeMinDate = minimumDate && Date.parse(dateStr) < Date.parse(minimumDate.toISOString());\n const afterMinDate = maximumDate && Date.parse(dateStr) > Date.parse(maximumDate.toISOString());\n const clickHandler = beforeMinDate || afterMinDate ? undefined : this._onClickDay;\n\n const isCurrentMonth = TODAY_DATE.getMonth() === this.displayDate.getMonth();\n const isCurrentYear = TODAY_DATE.getFullYear() === this.displayDate.getFullYear();\n const isCurrentDay = TODAY_DATE.getDate() === day;\n\n const isSelected =\n selectedDates.length > 0 &&\n rangeSelectedDates.some(d => Date.parse(dateStr) === Date.parse(d.toISOString()));\n const isFirstSelectedDate = selectedDates.length > 0 && rangeSelectedDates[0].toISOString() === dateStr;\n const isLastSelectedDate =\n selectedDates.length > 1 && rangeSelectedDates[rangeSelectedDates.length - 1].toISOString() === dateStr;\n const ariaLabel =\n `${isCurrentDay && isCurrentMonth && isCurrentYear ? \"Today's date, \" : \"\"}` + format(dateObj, \"PPPP\");\n week.push(\n html`<td\n key=${j}\n data-date=${dateStr}\n data-day=${day}\n aria-label=${ariaLabel}\n aria-current=${ifDefined(isCurrentDay && isCurrentMonth && isCurrentYear ? \"date\" : undefined)}\n class=${classMap({\n today: isCurrentDay && isCurrentMonth && isCurrentYear,\n \"selected-ends\": isFirstSelectedDate || isLastSelectedDate,\n active: isSelected,\n disabled: beforeMinDate || afterMinDate\n })}\n @click=${clickHandler}\n aria-selected=${isSelected ? \"true\" : \"false\"}\n tabindex=${this.focusedDate === new Date(dateStr) ? \"0\" : \"-1\"}\n ?disabled=${beforeMinDate || afterMinDate}\n aria-disabled=${ifDefined(beforeMinDate || afterMinDate ? \"true\" : undefined)}\n role=\"gridcell\"\n >\n ${day}\n </td>`\n );\n day++;\n } else {\n week.push(html`<td key=${j}></td>`);\n }\n }\n\n weeks.push(\n html`<tr key=${i}>\n ${week}\n </tr>`\n );\n if (day > monthLength) {\n break;\n }\n }\n\n const dayView = html`\n <table role=\"grid\">\n <thead>\n <tr>\n ${DatepickerCalendar.DAY_LABELS.map(\n (label: string, index: number) =>\n html` <th key=${index} abbr=${label} scope=\"col\">${label.slice(0, 3)}</th> `\n )}\n </tr>\n </thead>\n <tbody>\n ${weeks}\n </tbody>\n </table>\n `;\n return dayView;\n }\n\n private _generateMonths() {\n const rangeDates = this._generateIncrementDates();\n const selectedTime = rangeDates.map(e => setTimeToNoon(new Date(e.getFullYear(), e.getMonth())).getTime());\n\n const year = this.displayDate.getFullYear();\n\n const monthView = html`\n <div class=\"monthpicker\" role=\"grid\">\n ${[0, 1, 2, 3].map(\n row => html`\n <div role=\"row\">\n ${DatepickerCalendar.MONTHVIEW_LABELS.slice(row * 3, row * 3 + 3).map((m, i) => {\n const idx = row * 3 + i;\n const isCurrentMonth = idx === TODAY_DATE.getMonth() && year === TODAY_DATE.getFullYear();\n const time = setTimeToNoon(new Date(year, idx)).getTime();\n const isFirstSelectedMonth = rangeDates[0].getMonth() === idx;\n const isFirstSelectedYear = rangeDates[0].getFullYear() === year;\n const isLastSelectedMonth = rangeDates[rangeDates.length - 1].getMonth() === idx;\n const isLastSelectedYear = rangeDates[rangeDates.length - 1].getFullYear() === year;\n const ariaLabel = isCurrentMonth ? `Current month ${m} ${year}` : `${m} ${year}`;\n return html` <button\n role=\"gridcell\"\n class=${classMap({\n active: selectedTime.includes(time),\n today: isCurrentMonth,\n month: true,\n \"selected-ends\":\n (isFirstSelectedMonth && isFirstSelectedYear) || (isLastSelectedMonth && isLastSelectedYear)\n })}\n @click=${() => this._onClickMonth(idx)}\n data-month=${idx}\n data-year=${year}\n tabindex=\"0\"\n aria-selected=${selectedTime.includes(time) ? \"true\" : \"false\"}\n aria-label=${ariaLabel}\n >\n ${m.slice(0, 3)}\n </button>`;\n })}\n </div>\n `\n )}\n </div>\n `;\n return monthView;\n }\n\n private _generateYears() {\n const selectedYears = this._generateIncrementDates().map(e => e.getFullYear());\n const CURRENT_YEAR = TODAY_DATE.getFullYear();\n\n const yearArray = createYearViewArray(this.displayDate, CURRENT_YEAR);\n\n const yearView = html`\n <div class=\"sgds yearpicker\" role=\"grid\">\n ${[0, 1, 2, 3].map(\n row => html`\n <div role=\"row\">\n ${yearArray.slice(row * 3, row * 3 + 3).map(y => {\n const isFirstSelectedYear = selectedYears[0] === y;\n const isLastSectedYear = selectedYears[selectedYears.length - 1] === y;\n return html`\n <button\n role=\"gridcell\"\n class=${classMap({\n active: selectedYears.includes(y),\n year: true,\n today: CURRENT_YEAR === y,\n \"selected-ends\": isFirstSelectedYear || isLastSectedYear\n })}\n @click=${() => this._onClickYear(y)}\n data-year=${y}\n tabindex=\"0\"\n ?disabled=${y < 1900}\n aria-selected=${selectedYears.includes(y) ? \"true\" : \"false\"}\n aria-label=${ifDefined(CURRENT_YEAR === y ? `Current year, ${y}` : undefined)}\n >\n ${y}\n </button>\n `;\n })}\n </div>\n `\n )}\n </div>\n `;\n return yearView;\n }\n render() {\n let viewContent: HTMLTemplateResult;\n\n switch (this.view) {\n case \"days\":\n viewContent = html` ${this._generateDays()} `;\n break;\n case \"months\":\n viewContent = html` ${this._generateMonths()} `;\n break;\n case \"years\":\n viewContent = html` ${this._generateYears()} `;\n break;\n default:\n viewContent = html` ${this._generateDays()} `; // Set a default view\n break;\n }\n\n return html` <div class=\"datepicker-body\">${viewContent}</div> `;\n }\n}\n\nexport default DatepickerCalendar;\n"],"names":["datepickerCalendarStyle"],"mappings":";;;;;;;;;;;;AAWA,MAAM,UAAU,GAAG,IAAI,IAAI,EAAE,CAAC;AAE9B,MAAM,cAAc,GAAG;AACrB,IAAA,OAAO,EAAE;QACP,IAAI,EAAE,CAAC,CAAC;QACR,MAAM,EAAE,CAAC,CAAC;QACV,KAAK,EAAE,CAAC,CAAC;AACV,KAAA;AACD,IAAA,SAAS,EAAE;AACT,QAAA,IAAI,EAAE,CAAC;AACP,QAAA,MAAM,EAAE,CAAC;AACT,QAAA,KAAK,EAAE,CAAC;AACT,KAAA;AACD,IAAA,UAAU,EAAE;AACV,QAAA,IAAI,EAAE,CAAC;AACP,QAAA,MAAM,EAAE,CAAC;AACT,QAAA,KAAK,EAAE,CAAC;AACT,KAAA;AACD,IAAA,SAAS,EAAE;QACT,IAAI,EAAE,CAAC,CAAC;QACR,MAAM,EAAE,CAAC,CAAC;QACV,KAAK,EAAE,CAAC,CAAC;AACV,KAAA;CACF,CAAC;AACI,MAAO,kBAAmB,SAAQ,WAAW,CAAA;AAAnD,IAAA,WAAA,GAAA;;;QA0B6B,IAAY,CAAA,YAAA,GAAW,EAAE,CAAC;;QAYV,IAAI,CAAA,IAAA,GAAuB,QAAQ,CAAC;KA0bhF;;AA5aQ,IAAA,eAAe,CAAC,QAAqB,EAAA;QAC1C,QAAQ,CAAC,IAAI,EAAE,CAAC;QAChB,IAAI,CAAC,oBAAoB,EAAE,CAAC;KAC7B;IAED,iBAAiB,GAAA;QACf,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;;AAEvD,QAAA,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CA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EAAA,KAAA,CAAA,CAAA,CAAA;AAGE,UAAA,CAAA;AAA5B,IAAA,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAAe,CAAA,EAAA,kBAAA,CAAA,SAAA,EAAA,MAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAG3C,UAAA,CAAA;AADC,IAAA,QAAQ,EAAE;AACa,CAAA,EAAA,kBAAA,CAAA,SAAA,EAAA,iBAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AA2BxB,UAAA,CAAA;IADC,KAAK,CAAC,aAAa,CAAC;AAMpB,CAAA,EAAA,kBAAA,CAAA,SAAA,EAAA,oBAAA,EAAA,IAAA,CAAA;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { css } from 'lit';
|
|
3
3
|
|
|
4
|
-
var css_248z = css`.datepicker-body{color:var(--sgds-form-color-default);display:flex;justify-content:center}table{border-collapse:collapse;text-align:center}.monthpicker,.yearpicker{display:grid;grid-template-columns:repeat(3,6rem);grid-template-rows:repeat(4,2.5rem)}button.month,button.year{background-color:transparent;border:0;border-radius:var(--sgds-form-border-radius-sm);font-size:var(--sgds-font-size-label-sm);line-height:var(--sgds-line-height-2-xs);padding:0;position:relative}button.month.active:not(.selected-ends),button.year.active:not(.selected-ends),td[data-day].active:not(.selected-ends){background-color:var(--sgds-primary-surface-translucent);border-radius:0;cursor:pointer}button.month:hover:not(.active),button.year:hover:not(.active),td[data-day]:hover:not(.disabled):not(.selected-ends):not(.active){background-color:var(--sgds-bg-translucent-subtle);cursor:pointer}button.month:focus:not(.active),button.year:focus:not(.active),td[data-day]:focus:not(.disabled):not(.selected-ends):not(.active){background-color:var(--sgds-bg-translucent-subtle)}button.month:focus-visible,button.year:focus-visible,td[data-day]:focus-visible{outline:var(--sgds-form-outline-focus);outline-offset:var(--sgds-form-outline-offset-focus)}button.month.active:not(.selected-ends):focus,button.year.active:not(.selected-ends):focus,td[data-day].active:not(.selected-ends):focus{border-radius:var(--sgds-form-border-radius-sm)}button.year.active{background-color:var(--sgds-primary-surface-translucent);cursor:pointer}td,th{border-radius:var(--sgds-form-border-radius-sm);font-size:var(--sgds-font-size-label-sm);height:var(--sgds-form-height-lg);line-height:var(--sgds-line-height-2-xs);padding:0;position:relative;width:var(--sgds-form-width-md)}th{font-weight:var(--sgds-font-weight-semibold)}td[data-day]{cursor:pointer}button.month.active.selected-ends,button.year.active.selected-ends,td[data-day].active.selected-ends{background-color:var(--sgds-form-primary-surface-default);color:var(--sgds-form-color-fixed-light)}button.month.active.selected-ends:focus,button.month.active.selected-ends:hover,button.year.active.selected-ends:focus,button.year.active.selected-ends:hover,td[data-day].active.selected-ends:focus,td[data-day].active.selected-ends:hover{background-color:var(--sgds-form-primary-surface-emphasis)}td[data-day].disabled{cursor:not-allowed;opacity:var(--sgds-opacity-40)}.today{align-items:center;display:flex;flex-direction:column;justify-content:center}.today:after{background-color:var(--sgds-form-primary-surface-default);bottom:6px;content:".";line-height:4px;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' fill='none'%3E%3Ccircle cx='2' cy='2' r='2' fill='%235A42C0'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' fill='none'%3E%3Ccircle cx='2' cy='2' r='2' fill='%235A42C0'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;position:absolute;width:4px}.today.active.selected-ends:after{background-color:var(--sgds-form-color-inverse)}`;
|
|
4
|
+
var css_248z = css`.datepicker-body{color:var(--sgds-form-color-default);display:flex;justify-content:center}table{border-collapse:collapse;text-align:center}.monthpicker,.yearpicker{display:grid;grid-template-columns:repeat(3,6rem);grid-template-rows:repeat(4,2.5rem)}.monthpicker [role=row],.yearpicker [role=row]{display:contents}button.month,button.year{background-color:transparent;border:0;border-radius:var(--sgds-form-border-radius-sm);font-size:var(--sgds-font-size-label-sm);line-height:var(--sgds-line-height-2-xs);padding:0;position:relative}button.month.active:not(.selected-ends),button.year.active:not(.selected-ends),td[data-day].active:not(.selected-ends){background-color:var(--sgds-primary-surface-translucent);border-radius:0;cursor:pointer}button.month:hover:not(.active),button.year:hover:not(.active),td[data-day]:hover:not(.disabled):not(.selected-ends):not(.active){background-color:var(--sgds-bg-translucent-subtle);cursor:pointer}button.month:focus:not(.active),button.year:focus:not(.active),td[data-day]:focus:not(.disabled):not(.selected-ends):not(.active){background-color:var(--sgds-bg-translucent-subtle)}button.month:focus-visible,button.year:focus-visible,td[data-day]:focus-visible{outline:var(--sgds-form-outline-focus);outline-offset:var(--sgds-form-outline-offset-focus)}button.month.active:not(.selected-ends):focus,button.year.active:not(.selected-ends):focus,td[data-day].active:not(.selected-ends):focus{border-radius:var(--sgds-form-border-radius-sm)}button.year.active{background-color:var(--sgds-primary-surface-translucent);cursor:pointer}td,th{border-radius:var(--sgds-form-border-radius-sm);font-size:var(--sgds-font-size-label-sm);height:var(--sgds-form-height-lg);line-height:var(--sgds-line-height-2-xs);padding:0;position:relative;width:var(--sgds-form-width-md)}th{font-weight:var(--sgds-font-weight-semibold)}td[data-day]{cursor:pointer}button.month.active.selected-ends,button.year.active.selected-ends,td[data-day].active.selected-ends{background-color:var(--sgds-form-primary-surface-default);color:var(--sgds-form-color-fixed-light)}button.month.active.selected-ends:focus,button.month.active.selected-ends:hover,button.year.active.selected-ends:focus,button.year.active.selected-ends:hover,td[data-day].active.selected-ends:focus,td[data-day].active.selected-ends:hover{background-color:var(--sgds-form-primary-surface-emphasis)}td[data-day].disabled{cursor:not-allowed;opacity:var(--sgds-opacity-40)}.today{align-items:center;display:flex;flex-direction:column;justify-content:center}.today:after{background-color:var(--sgds-form-primary-surface-default);bottom:6px;content:".";line-height:4px;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' fill='none'%3E%3Ccircle cx='2' cy='2' r='2' fill='%235A42C0'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' fill='none'%3E%3Ccircle cx='2' cy='2' r='2' fill='%235A42C0'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;position:absolute;width:4px}.today.active.selected-ends:after{background-color:var(--sgds-form-color-inverse)}`;
|
|
5
5
|
|
|
6
6
|
export { css_248z as default };
|
|
7
7
|
//# sourceMappingURL=datepicker-calendar2.js.map
|
|
@@ -157,14 +157,14 @@ class DatepickerHeader extends sgdsElement["default"] {
|
|
|
157
157
|
}
|
|
158
158
|
render() {
|
|
159
159
|
return lit.html `
|
|
160
|
-
<div class="datepicker-header dropdown-header"
|
|
160
|
+
<div class="datepicker-header dropdown-header">
|
|
161
161
|
<sgds-icon-button
|
|
162
162
|
name="arrow-left"
|
|
163
163
|
size="sm"
|
|
164
164
|
variant="ghost"
|
|
165
165
|
@click="${this.handleClickPrevious}"
|
|
166
166
|
class=${classMap_js.classMap({ invisible: this._removeCaret() })}
|
|
167
|
-
|
|
167
|
+
.ariaLabel=${this._ariaLabelForPrevBtn()}
|
|
168
168
|
>
|
|
169
169
|
</sgds-icon-button>
|
|
170
170
|
<sgds-button
|
|
@@ -173,6 +173,7 @@ class DatepickerHeader extends sgdsElement["default"] {
|
|
|
173
173
|
size="sm"
|
|
174
174
|
@click=${this._changeView}
|
|
175
175
|
class=${classMap_js.classMap({ disabled: this.view === "years" })}
|
|
176
|
+
.ariaLabel=${this._ariaLabelForHeaderBtn()}
|
|
176
177
|
aria-disabled=${this.view === "years" ? "true" : "false"}
|
|
177
178
|
aria-live="polite"
|
|
178
179
|
>
|
|
@@ -183,7 +184,7 @@ class DatepickerHeader extends sgdsElement["default"] {
|
|
|
183
184
|
size="sm"
|
|
184
185
|
variant="ghost"
|
|
185
186
|
@click="${this._handleClickNext}"
|
|
186
|
-
|
|
187
|
+
.ariaLabel=${this._ariaLabelForNextBtn()}
|
|
187
188
|
>
|
|
188
189
|
</sgds-icon-button>
|
|
189
190
|
</div>
|