@haiilo/catalyst 10.7.1 → 10.8.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/dist/catalyst/catalyst.esm.js +1 -1
- package/dist/catalyst/catalyst.esm.js.map +1 -1
- package/dist/catalyst/{p-8b22b7fc.entry.js → p-93f91f74.entry.js} +2 -2
- package/dist/catalyst/p-93f91f74.entry.js.map +1 -0
- package/dist/cjs/cat-alert_29.cjs.entry.js +10 -11
- package/dist/cjs/cat-alert_29.cjs.entry.js.map +1 -1
- package/dist/cjs/catalyst.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/cat-button/cat-button.css +2 -0
- package/dist/collection/components/cat-date/cat-date.css +1 -0
- package/dist/collection/components/cat-date/cat-date.js +1 -1
- package/dist/collection/components/cat-date/cat-date.js.map +1 -1
- package/dist/collection/components/cat-date-inline/cat-date-inline.css +36 -43
- package/dist/collection/components/cat-date-inline/cat-date-inline.js +12 -31
- package/dist/collection/components/cat-date-inline/cat-date-inline.js.map +1 -1
- package/dist/components/cat-button2.js +1 -1
- package/dist/components/cat-button2.js.map +1 -1
- package/dist/components/cat-date-inline2.js +9 -11
- package/dist/components/cat-date-inline2.js.map +1 -1
- package/dist/components/cat-date.js +2 -2
- package/dist/components/cat-date.js.map +1 -1
- package/dist/esm/cat-alert_29.entry.js +10 -11
- package/dist/esm/cat-alert_29.entry.js.map +1 -1
- package/dist/esm/catalyst.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/cat-date-inline/cat-date-inline.d.ts +4 -8
- package/dist/types/components.d.ts +16 -24
- package/package.json +2 -2
- package/dist/catalyst/p-8b22b7fc.entry.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"cat-date-inline2.js","mappings":";;;;;;AAEA,SAAS,OAAO,CAAC,QAAgB,EAAE,UAAuC,MAAM;IAC9E,MAAM,IAAI,GAAG,IAAI,IAAI,EAAE,CA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AAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;SACjF;aAAM;YACL,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,CAAC;SACrD;KACF;IAEO,YAAY,CAAC,SAAsB,EAAE,OAAoB;QAC/D,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,GAAG,CAAC,IAAI,KAAK,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;KACvG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["i18n"],"sources":["src/components/cat-date-inline/cat-date-locale.ts","src/components/cat-date-inline/cat-date-math.ts","src/components/cat-date-inline/cat-date-inline.scss?tag=cat-date-inline&encapsulation=shadow","src/components/cat-date-inline/cat-date-inline.tsx"],"sourcesContent":["import { catI18nRegistry as i18n } from '../cat-i18n/cat-i18n-registry';\n\nfunction getDays(language: string, weekday: 'long' | 'short' | 'narrow' = 'long') {\n const date = new Date();\n const firstDayOfWeek = (date.getUTCDate() - date.getUTCDay() + 7) % 7;\n const format = new Intl.DateTimeFormat(language, { weekday }).format;\n return [...Array(7).keys()].map(day => format(new Date(date.getTime()).setUTCDate(firstDayOfWeek + day)));\n}\n\nfunction getMonths(language: string, month: 'long' | 'short' = 'long') {\n const date = new Date(0);\n const format = new Intl.DateTimeFormat(language, { month }).format;\n return [...Array(12).keys()].map(month => format(new Date(date.getTime()).setUTCMonth(month)));\n}\n\nfunction getWeekInfo(language: string) {\n const locale = new Intl.Locale(language);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const weekInfo = (locale as any).getWeekInfo?.() ?? (locale as any).weekInfo;\n return {\n firstDay: weekInfo?.firstDay ?? 1,\n minDays: weekInfo?.minDays ?? 4,\n weekend: weekInfo?.weekend ?? [6, 7]\n };\n}\n\nfunction getFormat(language: string) {\n const format = new Intl.DateTimeFormat(language, { year: 'numeric', month: '2-digit', day: '2-digit' })\n .format(new Date(3456, 10, 22))\n .replace('3456', 'YYYY')\n .replace('56', 'YY')\n .replace('11', 'MM')\n .replace('22', 'DD');\n return /^(YYYY|YY|MM|DD)\\W(YYYY|YY|MM|DD)\\W(YYYY|YY|MM|DD)$/.test(format) ? format : 'DD-MM-YYYY';\n}\n\nexport function getLocale(language: string) {\n return {\n prevYear: i18n.t('datepicker.prevYear'),\n nextYear: i18n.t('datepicker.nextYear'),\n prevMonth: i18n.t('datepicker.prevMonth'),\n nextMonth: i18n.t('datepicker.nextMonth'),\n arrowKeys: i18n.t('datepicker.arrowKeys'),\n today: i18n.t('datepicker.today'),\n change: i18n.t('datepicker.change'),\n choose: i18n.t('datepicker.choose'),\n clear: i18n.t('datepicker.clear'),\n formatStr: getFormat(language),\n weekInfo: getWeekInfo(language),\n days: {\n short: getDays(language, 'short'),\n long: getDays(language, 'long')\n },\n months: {\n short: getMonths(language, 'short'),\n long: getMonths(language, 'long')\n },\n now: () => {\n const date = new Date();\n return new Date(date.getFullYear(), date.getMonth(), date.getDate());\n },\n fromLocalISO: (date?: string | null) => {\n const [match, year, month, day] = date?.match(/^(\\d{4})-(\\d{2})-(\\d{2})/) ?? [];\n return match ? new Date(Number(year), Number(month) - 1, Number(day)) : null;\n },\n toLocalISO: (date: Date) => {\n const year = date.getFullYear();\n const month = (date.getMonth() + 1).toString().padStart(2, '0');\n const day = date.getDate().toString().padStart(2, '0');\n return `${year}-${month}-${day}`;\n },\n toLocalStr: (date: Date) =>\n new Intl.DateTimeFormat(language, {\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n weekday: 'long'\n }).format(date)\n };\n}\n","export function isLeapYear(year: number): boolean {\n return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;\n}\n\nexport function addDays(date: Date, n: number): Date {\n return new Date(date.getFullYear(), date.getMonth(), date.getDate() + n);\n}\n\nexport function addMonth(date: Date, n: number): Date {\n const [year, month, day] = [date.getFullYear(), date.getMonth(), date.getDate()];\n const maxDays = [31, isLeapYear(year) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n const newDate = new Date(date);\n newDate.setDate(1);\n newDate.setMonth(newDate.getMonth() + n);\n newDate.setDate(Math.min(day, maxDays[(month + (n % 12) + 12) % 12]));\n return newDate;\n}\n\nexport function isSameYear(date1: Date | null, date2: Date | null): boolean {\n return !!date1 && !!date2 && date1.getFullYear() === date2.getFullYear();\n}\n\nexport function isSameMonth(date1: Date | null, date2: Date | null): boolean {\n return !!date1 && !!date2 && date1.getMonth() === date2.getMonth() && isSameYear(date1, date2);\n}\n\nexport function isSameDay(date1: Date | null, date2: Date | null): boolean {\n return !!date1 && !!date2 && date1.getDate() === date2.getDate() && isSameMonth(date1, date2);\n}\n\nexport function clampDate(min: Date | null, date: Date, max: Date | null): Date {\n return new Date(Math.min(Math.max(date.getTime(), min?.getTime() ?? -Infinity), max?.getTime() ?? Infinity));\n}\n","@use 'variables' as *;\n@use 'mixins' as *;\n\n:host {\n display: inline-block;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n.picker {\n display: flex;\n flex-direction: column;\n min-width: calc(2rem + 7 * 2.5rem);\n max-width: calc(2rem + 7 * 4rem);\n\n &.picker-weeks {\n min-width: calc(7 * 2.5rem);\n max-width: calc(7 * 4rem);\n }\n\n &.picker-small {\n min-width: calc(2rem + 7 * 2rem);\n max-width: calc(2rem + 7 * 3rem);\n\n &.picker-weeks {\n min-width: calc(7 * 2rem);\n max-width: calc(7 * 3rem);\n }\n }\n}\n\n.picker-head {\n display: flex;\n gap: 0.5rem;\n align-items: center;\n\n h3 {\n @include cat-head(4);\n flex: 1;\n text-align: center;\n margin: 0;\n }\n\n .picker-small & {\n gap: 0.25rem;\n\n h3 {\n @include cat-head(5);\n }\n }\n}\n\n.picker-grid {\n display: grid;\n /* stylelint-disable declaration-block-no-redundant-longhand-properties */\n grid-template-rows: 2rem repeat(6, 1fr);\n grid-template-columns: repeat(7, 1fr);\n grid-template-areas:\n 'h h h h h h h'\n 'd d d d d d d'\n 'd d d d d d d'\n 'd d d d d d d'\n 'd d d d d d d'\n 'd d d d d d d'\n 'd d d d d d d';\n /* stylelint-enable declaration-block-no-redundant-longhand-properties */\n margin: 1rem 0 0.5rem;\n\n .picker-weeks & {\n /* stylelint-disable declaration-block-no-redundant-longhand-properties */\n grid-template-columns: 2rem repeat(7, 1fr);\n grid-template-areas:\n '. h h h h h h h'\n 'w d d d d d d d'\n 'w d d d d d d d'\n 'w d d d d d d d'\n 'w d d d d d d d'\n 'w d d d d d d d'\n 'w d d d d d d d';\n /* stylelint-enable declaration-block-no-redundant-longhand-properties */\n }\n\n .picker-small & {\n margin: 0.5rem 0;\n }\n}\n\n.picker-grid-head {\n grid-area: h;\n display: grid;\n grid-template-columns: repeat(7, 1fr);\n place-items: end center;\n padding-bottom: 0.5rem;\n}\n\n.picker-grid-weeks {\n grid-area: w;\n display: grid;\n grid-template-rows: repeat(6, 1fr);\n place-items: center right;\n padding-right: 0.5rem;\n}\n\n.picker-grid-days {\n grid-area: d;\n display: grid;\n grid-template-rows: repeat(6, 1fr);\n grid-template-columns: repeat(7, 1fr);\n}\n\n.picker-grid-head > *,\n.picker-grid-weeks > * {\n @include cat-body('xs', 600);\n color: cat-token('color.ui.font.muted') !important;\n text-decoration: none;\n}\n\n.date-other {\n opacity: 0.5;\n}\n\n.date-disabled {\n opacity: 0.25;\n}\n\n.picker-foot {\n display: flex;\n gap: 1rem;\n align-items: center;\n width: min-content;\n min-width: 100%;\n justify-content: space-between;\n\n .picker-small & {\n gap: 0.5rem;\n }\n}\n\n.cursor-help {\n margin: 0;\n @include cat-body('s');\n color: cat-token('color.ui.font.muted') !important;\n text-align: center;\n flex: 1;\n\n &:first-child {\n text-align: left;\n }\n\n &:last-child {\n text-align: right;\n }\n\n &:only-child {\n text-align: center;\n }\n\n .picker-small & {\n @include cat-body('xs');\n }\n}\n\n.cursor-aria {\n @include cat-visually-hidden;\n}\n\n.date-range {\n --cat-border-radius-m: 0;\n}\n","import { Component, Element, Event, EventEmitter, Host, Listen, Method, Prop, State, h } from '@stencil/core';\nimport { catI18nRegistry as i18n } from '../cat-i18n/cat-i18n-registry';\nimport { getLocale } from './cat-date-locale';\nimport { addDays, addMonth, clampDate, isSameDay, isSameMonth, isSameYear } from './cat-date-math';\n\n/**\n * An inline date picker component to select a date.\n */\n@Component({\n tag: 'cat-date-inline',\n styleUrl: 'cat-date-inline.scss',\n shadow: true\n})\nexport class CatDateInline {\n private readonly language = i18n.getLocale();\n private readonly locale = getLocale(this.language);\n // additonally store the focus date to ensure correct focus after potential re-render\n private focusDate: Date | null = null;\n\n @Element() hostElement!: HTMLElement;\n\n @State() viewDate: Date = this.locale.now();\n\n /**\n * Hides the clear button.\n */\n @Prop() noClear = false;\n\n /**\n * Hides the arrow navigation hint.\n */\n @Prop() noHint = false;\n\n /**\n * Hides the today button.\n */\n @Prop() noToday = false;\n\n /**\n * Hides the week numbers.\n */\n @Prop() noWeeks = false;\n\n /**\n * The size of the date picker.\n */\n @Prop() size: 's' | 'm' = 'm';\n\n /**\n * A minimum value for the date, given in local ISO 8601 date format YYYY-MM-DD.\n */\n @Prop() min?: string;\n\n /**\n * A maximum value for the date, given in local ISO 8601 date format YYYY-MM-DD.\n */\n @Prop() max?: string;\n\n /**\n * Allow the selection of a range of dates, i.e. start and end date.\n */\n @Prop() range = false;\n\n /**\n * The value of the control, given in local ISO 8601 date format YYYY-MM-DD.\n */\n @Prop({ mutable: true }) value?: string;\n\n /**\n * Emitted when the value is changed.\n */\n @Event() catChange!: EventEmitter<string>;\n\n private get focusedDate() {\n const [all, year, month, day] =\n this.hostElement.shadowRoot\n ?.querySelector<HTMLCatButtonElement>(`[data-date]:focus`)\n ?.dataset.date?.match(/^(\\d{4})-(\\d{2})-(\\d{2})/) ?? [];\n return all ? new Date(Number(year), Number(month) - 1, Number(day)) : null;\n }\n\n componentWillLoad() {\n const [startDate, endDate] = this.getValue();\n if (endDate) {\n this.focus(endDate);\n } else if (startDate) {\n this.focus(startDate);\n }\n }\n\n componentDidRender() {\n if (this.focusDate) {\n // re-focus the previously focused date after re-render\n this.hostElement.shadowRoot\n ?.querySelector<HTMLCatButtonElement>(`[data-date=\"${this.locale.toLocalISO(this.focusDate)}\"]`)\n ?.doFocus();\n this.focusDate = null;\n }\n }\n\n @Listen('keydown')\n onKeyDown(e: KeyboardEvent) {\n if (!['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'].includes(e.key)) {\n return;\n }\n const focusedDate = this.focusedDate;\n if (!focusedDate) {\n e.preventDefault();\n const [startDate] = this.getValue();\n this.focus(startDate || this.locale.now());\n } else if (e.key === 'ArrowLeft') {\n e.preventDefault();\n this.focus(e.shiftKey ? addMonth(focusedDate, -1) : addDays(focusedDate, -1));\n } else if (e.key === 'ArrowRight') {\n e.preventDefault();\n this.focus(e.shiftKey ? addMonth(focusedDate, 1) : addDays(focusedDate, 1));\n } else if (e.key === 'ArrowUp') {\n e.preventDefault();\n this.focus(addDays(focusedDate, -7));\n } else if (e.key === 'ArrowDown') {\n e.preventDefault();\n this.focus(addDays(focusedDate, 7));\n }\n }\n\n /**\n * Select a date in the picker.\n *\n * @param date The date to select.\n */\n @Method()\n async select(date: Date | null): Promise<void> {\n if (!date) {\n return this.clear();\n }\n const oldValue = this.value;\n const [minDate, maxDate] = this.getMinMaxDate();\n const newDate = clampDate(minDate, new Date(date.getFullYear(), date.getMonth(), date.getDate()), maxDate);\n this.focus(newDate);\n\n if (this.range) {\n const [startDate, endDate] = this.getValue();\n if (!startDate || endDate || newDate < startDate) {\n this.value = this.toRangeValue(newDate, null);\n } else {\n this.value = this.toRangeValue(startDate, newDate);\n }\n } else {\n this.value = this.locale.toLocalISO(newDate);\n }\n\n if (oldValue !== this.value) {\n this.catChange.emit(this.value);\n }\n }\n\n /**\n * Clear the picker.\n */\n @Method()\n async clear(): Promise<void> {\n const oldValue = this.value;\n this.value = undefined;\n if (oldValue !== this.value) {\n this.catChange.emit(this.value);\n }\n }\n\n /**\n * Resets the view of the picker.\n */\n @Method()\n async resetView(): Promise<void> {\n const [minDate, maxDate] = this.getMinMaxDate();\n const [dateStart] = this.getValue();\n this.viewDate = dateStart ?? clampDate(minDate, this.locale.now(), maxDate);\n }\n\n render() {\n const [minDate, maxDate] = this.getMinMaxDate();\n const dateGrid = this.dateGrid(this.viewDate.getFullYear(), this.viewDate.getMonth());\n const [dateStart, dateEnd] = this.getValue();\n return (\n <Host>\n <div class={{ picker: true, 'picker-small': this.size === 's', 'picker-weeks': !this.noWeeks }}>\n <div class=\"picker-head\">\n <cat-button\n icon=\"$cat:datepicker-year-prev\"\n iconOnly\n size=\"xs\"\n variant=\"text\"\n a11y-label={this.locale.prevYear}\n disabled={isSameYear(this.viewDate, minDate)}\n onClick={() => this.navigate('prev', 'year')}\n data-dropdown-no-close\n ></cat-button>\n <cat-button\n icon=\"$cat:datepicker-month-prev\"\n iconOnly\n size=\"xs\"\n variant=\"text\"\n a11y-label={this.locale.prevMonth}\n disabled={isSameMonth(this.viewDate, minDate)}\n onClick={() => this.navigate('prev', 'month')}\n data-dropdown-no-close\n ></cat-button>\n <h3>{this.getHeadline()}</h3>\n <cat-button\n icon=\"$cat:datepicker-month-next\"\n iconOnly\n size=\"xs\"\n variant=\"text\"\n a11y-label={this.locale.nextMonth}\n disabled={isSameMonth(this.viewDate, maxDate)}\n onClick={() => this.navigate('next', 'month')}\n data-dropdown-no-close\n ></cat-button>\n <cat-button\n icon=\"$cat:datepicker-year-next\"\n iconOnly\n size=\"xs\"\n variant=\"text\"\n a11y-label={this.locale.nextYear}\n disabled={isSameYear(this.viewDate, maxDate)}\n onClick={() => this.navigate('next', 'year')}\n data-dropdown-no-close\n ></cat-button>\n </div>\n <div class=\"picker-grid\" onFocusin={() => this.setAriaLive(this.locale.arrowKeys)}>\n <div class=\"picker-grid-head\">\n {Array.from(Array(7), (_, i) => (\n <abbr title={this.locale.days.long[i]}>{this.locale.days.short[i]}</abbr>\n ))}\n </div>\n {!this.noWeeks && (\n <div class=\"picker-grid-weeks\">\n {dateGrid\n .filter((_, i) => i % 7 === 0)\n .map(day => (\n <div>{this.getWeekNumber(day)}</div>\n ))}\n </div>\n )}\n <div class=\"picker-grid-days\">\n {dateGrid.map(day => {\n const isStartDate = isSameDay(dateStart, day);\n const isEndDate = isSameDay(dateEnd, day);\n const isRange = !!dateStart && !!dateEnd && day > dateStart && day < dateEnd;\n const isToday = isSameDay(this.locale.now(), day);\n return (\n <cat-button\n class={{\n 'cat-date-item': true,\n 'date-other': !isSameMonth(this.viewDate, day),\n 'date-today': isToday,\n 'date-start': this.range && isStartDate,\n 'date-range': this.range && isRange,\n 'date-end': this.range && isEndDate,\n 'date-focusable': this.canFocus(day),\n 'date-disabled': !this.canClick(day)\n }}\n size={this.size}\n nativeAttributes={!this.canFocus(day) ? { tabindex: '-1' } : {}}\n variant={isStartDate || isEndDate ? 'filled' : isToday ? 'outlined' : 'text'}\n a11yLabel={this.locale.toLocalStr(day)}\n active={isStartDate || isEndDate || isRange}\n color={isStartDate || isEndDate || isToday ? 'primary' : 'secondary'}\n disabled={!this.canClick(day)}\n onClick={() => this.select(day)}\n data-date={this.locale.toLocalISO(day)}\n >\n {day.getDate()}\n </cat-button>\n );\n })}\n </div>\n </div>\n <div class=\"picker-foot\">\n {!this.noToday && this.canClick(this.locale.now()) && (\n <cat-button size=\"s\" data-dropdown-no-close onClick={() => this.select(this.locale.now())}>\n {this.locale.today}\n </cat-button>\n )}\n {!this.noHint && <p class=\"cursor-help\">{this.locale.arrowKeys}</p>}\n {!this.noClear && (\n <cat-button size=\"s\" disabled={!this.value} data-dropdown-no-close onClick={() => this.clear()}>\n {this.locale.clear}\n </cat-button>\n )}\n </div>\n </div>\n <p class=\"cursor-aria\" aria-live=\"polite\"></p>\n </Host>\n );\n }\n\n private focus(date: Date) {\n const [minDate, maxDate] = this.getMinMaxDate();\n this.focusDate = clampDate(minDate, date, maxDate);\n this.viewDate = new Date(this.focusDate.getFullYear(), this.focusDate.getMonth());\n this.hostElement.shadowRoot\n ?.querySelector<HTMLCatButtonElement>(`[data-date=\"${this.locale.toLocalISO(this.focusDate)}\"]`)\n ?.doFocus();\n }\n\n private navigate(direction: 'prev' | 'next', period: 'year' | 'month') {\n this.viewDate = new Date(\n direction === 'prev'\n ? period === 'year'\n ? this.viewDate.setFullYear(this.viewDate.getFullYear() - 1)\n : this.viewDate.setMonth(this.viewDate.getMonth() - 1)\n : period === 'year'\n ? this.viewDate.setFullYear(this.viewDate.getFullYear() + 1)\n : this.viewDate.setMonth(this.viewDate.getMonth() + 1)\n );\n // announce the new month and year\n this.setAriaLive(this.getHeadline());\n }\n\n private setAriaLive(text: string) {\n const node = this.hostElement.shadowRoot?.querySelector('.cursor-aria');\n if (node) {\n node.innerHTML = text;\n }\n }\n\n private dateGrid(year: number, month: number) {\n const firstDayOfWeek = new Date(year, month, 1).getDay();\n const daysInMonth = new Date(year, month + 1, 0).getDate();\n const days = [...Array(daysInMonth).keys()];\n const daysBefore = [...Array(firstDayOfWeek).keys()].map(day =>\n new Date(year, month, day - firstDayOfWeek).getDate()\n );\n const daysAfter = [...Array(42 - days.length - daysBefore.length).keys()];\n return [\n ...daysBefore.map(day => new Date(year, month - 1, day + 1)),\n ...days.map(day => new Date(year, month, day + 1)),\n ...daysAfter.map(day => new Date(year, month + 1, day + 1))\n ];\n }\n\n private getHeadline() {\n return `${this.locale.months.long[this.viewDate.getMonth()]} ${this.viewDate.getFullYear()}`;\n }\n\n private getWeekNumber(date: Date, iso8601 = true) {\n const currentDate = new Date(date.getTime());\n const dayNum = iso8601 ? currentDate.getDay() || 7 : currentDate.getDay();\n currentDate.setDate(currentDate.getDate() + 4 - dayNum);\n const yearStart = new Date(currentDate.getFullYear(), 0, 1);\n return Math.ceil(((+currentDate - +yearStart) / 86400000 + 1) / 7);\n }\n\n private canFocus(date: Date): boolean {\n const now = this.locale.now();\n const [minDate] = this.getMinMaxDate();\n const focusedDate = this.focusedDate;\n const [startDate] = this.getValue();\n if (focusedDate && isSameMonth(focusedDate, this.viewDate)) {\n return isSameMonth(focusedDate, date) && isSameDay(focusedDate, date);\n } else if (startDate && isSameMonth(startDate, this.viewDate)) {\n return isSameMonth(startDate, date) && isSameDay(startDate, date);\n } else if (isSameMonth(this.viewDate, now) && (!minDate || minDate <= now)) {\n return isSameMonth(this.viewDate, date) && isSameDay(now, date);\n }\n const minDay = isSameMonth(date, minDate) ? minDate?.getDate() ?? 1 : 1;\n return isSameMonth(this.viewDate, date) && date.getDate() === minDay;\n }\n\n private canClick(date: Date) {\n const [minDate, maxDate] = this.getMinMaxDate();\n return (!minDate || minDate <= date) && (!maxDate || maxDate >= date);\n }\n\n private getMinMaxDate() {\n const minDate = this.locale.fromLocalISO(this.min);\n const maxDate = this.locale.fromLocalISO(this.max);\n return [minDate, maxDate];\n }\n\n private getValue(): [Date | null, Date | null] {\n if (this.range) {\n const [startDate, endDate] = JSON.parse(this.value || '[]') as [string | null, string | null];\n return [this.locale.fromLocalISO(startDate), this.locale.fromLocalISO(endDate)];\n } else {\n return [this.locale.fromLocalISO(this.value), null];\n }\n }\n\n private toRangeValue(startDate: Date | null, endDate: Date | null): string {\n return JSON.stringify([startDate, endDate].map(date => (date ? this.locale.toLocalISO(date) : null)));\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"cat-date-inline2.js","mappings":";;;;;;AAEA,SAAS,OAAO,CAAC,QAAgB,EAAE,UAAuC,MAAM;IAC9E,MAAM,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;IACxB,MAAM,cAAc,GAAG,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,IAAI,CAAC,SAAS,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;IACtE,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC;IACrE,O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AAI,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;KACvG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["i18n"],"sources":["src/components/cat-date-inline/cat-date-locale.ts","src/components/cat-date-inline/cat-date-math.ts","src/components/cat-date-inline/cat-date-inline.scss?tag=cat-date-inline&encapsulation=shadow","src/components/cat-date-inline/cat-date-inline.tsx"],"sourcesContent":["import { catI18nRegistry as i18n } from '../cat-i18n/cat-i18n-registry';\n\nfunction getDays(language: string, weekday: 'long' | 'short' | 'narrow' = 'long') {\n const date = new Date();\n const firstDayOfWeek = (date.getUTCDate() - date.getUTCDay() + 7) % 7;\n const format = new Intl.DateTimeFormat(language, { weekday }).format;\n return [...Array(7).keys()].map(day => format(new Date(date.getTime()).setUTCDate(firstDayOfWeek + day)));\n}\n\nfunction getMonths(language: string, month: 'long' | 'short' = 'long') {\n const date = new Date(0);\n const format = new Intl.DateTimeFormat(language, { month }).format;\n return [...Array(12).keys()].map(month => format(new Date(date.getTime()).setUTCMonth(month)));\n}\n\nfunction getWeekInfo(language: string) {\n const locale = new Intl.Locale(language);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const weekInfo = (locale as any).getWeekInfo?.() ?? (locale as any).weekInfo;\n return {\n firstDay: weekInfo?.firstDay ?? 1,\n minDays: weekInfo?.minDays ?? 4,\n weekend: weekInfo?.weekend ?? [6, 7]\n };\n}\n\nfunction getFormat(language: string) {\n const format = new Intl.DateTimeFormat(language, { year: 'numeric', month: '2-digit', day: '2-digit' })\n .format(new Date(3456, 10, 22))\n .replace('3456', 'YYYY')\n .replace('56', 'YY')\n .replace('11', 'MM')\n .replace('22', 'DD');\n return /^(YYYY|YY|MM|DD)\\W(YYYY|YY|MM|DD)\\W(YYYY|YY|MM|DD)$/.test(format) ? format : 'DD-MM-YYYY';\n}\n\nexport function getLocale(language: string) {\n return {\n prevYear: i18n.t('datepicker.prevYear'),\n nextYear: i18n.t('datepicker.nextYear'),\n prevMonth: i18n.t('datepicker.prevMonth'),\n nextMonth: i18n.t('datepicker.nextMonth'),\n arrowKeys: i18n.t('datepicker.arrowKeys'),\n today: i18n.t('datepicker.today'),\n change: i18n.t('datepicker.change'),\n choose: i18n.t('datepicker.choose'),\n clear: i18n.t('datepicker.clear'),\n formatStr: getFormat(language),\n weekInfo: getWeekInfo(language),\n days: {\n short: getDays(language, 'short'),\n long: getDays(language, 'long')\n },\n months: {\n short: getMonths(language, 'short'),\n long: getMonths(language, 'long')\n },\n now: () => {\n const date = new Date();\n return new Date(date.getFullYear(), date.getMonth(), date.getDate());\n },\n fromLocalISO: (date?: string | null) => {\n const [match, year, month, day] = date?.match(/^(\\d{4})-(\\d{2})-(\\d{2})/) ?? [];\n return match ? new Date(Number(year), Number(month) - 1, Number(day)) : null;\n },\n toLocalISO: (date: Date) => {\n const year = date.getFullYear();\n const month = (date.getMonth() + 1).toString().padStart(2, '0');\n const day = date.getDate().toString().padStart(2, '0');\n return `${year}-${month}-${day}`;\n },\n toLocalStr: (date: Date) =>\n new Intl.DateTimeFormat(language, {\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n weekday: 'long'\n }).format(date)\n };\n}\n","export function isLeapYear(year: number): boolean {\n return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;\n}\n\nexport function addDays(date: Date, n: number): Date {\n return new Date(date.getFullYear(), date.getMonth(), date.getDate() + n);\n}\n\nexport function addMonth(date: Date, n: number): Date {\n const [year, month, day] = [date.getFullYear(), date.getMonth(), date.getDate()];\n const maxDays = [31, isLeapYear(year) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n const newDate = new Date(date);\n newDate.setDate(1);\n newDate.setMonth(newDate.getMonth() + n);\n newDate.setDate(Math.min(day, maxDays[(month + (n % 12) + 12) % 12]));\n return newDate;\n}\n\nexport function isSameYear(date1: Date | null, date2: Date | null): boolean {\n return !!date1 && !!date2 && date1.getFullYear() === date2.getFullYear();\n}\n\nexport function isSameMonth(date1: Date | null, date2: Date | null): boolean {\n return !!date1 && !!date2 && date1.getMonth() === date2.getMonth() && isSameYear(date1, date2);\n}\n\nexport function isSameDay(date1: Date | null, date2: Date | null): boolean {\n return !!date1 && !!date2 && date1.getDate() === date2.getDate() && isSameMonth(date1, date2);\n}\n\nexport function clampDate(min: Date | null, date: Date, max: Date | null): Date {\n return new Date(Math.min(Math.max(date.getTime(), min?.getTime() ?? -Infinity), max?.getTime() ?? Infinity));\n}\n","@use 'variables' as *;\n@use 'mixins' as *;\n\n:host {\n display: block;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n.picker {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n}\n\n.picker-head {\n display: flex;\n align-items: center;\n container-type: inline-size;\n\n > :not(:last-child) {\n // we use margin here instead of gap to be able to properly adjust by container query\n margin-right: 0.25rem;\n }\n\n h3 {\n @include cat-head(5);\n flex: 1;\n text-align: center;\n margin-block: 0;\n }\n\n @container (min-width: 20rem) {\n h3 {\n @include cat-head(4);\n }\n\n > :not(:last-child) {\n margin-right: 0.5rem;\n }\n }\n}\n\n.picker-grid {\n display: grid;\n /* stylelint-disable declaration-block-no-redundant-longhand-properties */\n grid-template-rows: 2rem repeat(6, 1fr);\n grid-template-columns: repeat(7, 1fr);\n grid-template-areas:\n 'h h h h h h h'\n 'd d d d d d d'\n 'd d d d d d d'\n 'd d d d d d d'\n 'd d d d d d d'\n 'd d d d d d d'\n 'd d d d d d d';\n /* stylelint-enable declaration-block-no-redundant-longhand-properties */\n\n .picker-weeks & {\n /* stylelint-disable declaration-block-no-redundant-longhand-properties */\n grid-template-columns: 2rem repeat(7, 1fr);\n grid-template-areas:\n '. h h h h h h h'\n 'w d d d d d d d'\n 'w d d d d d d d'\n 'w d d d d d d d'\n 'w d d d d d d d'\n 'w d d d d d d d'\n 'w d d d d d d d';\n /* stylelint-enable declaration-block-no-redundant-longhand-properties */\n }\n}\n\n.picker-grid-head {\n grid-area: h;\n display: grid;\n grid-template-columns: repeat(7, 1fr);\n place-items: end center;\n padding-bottom: 0.5rem;\n}\n\n.picker-grid-weeks {\n grid-area: w;\n display: grid;\n grid-template-rows: repeat(6, 1fr);\n place-items: center right;\n padding-right: 0.5rem;\n}\n\n.picker-grid-days {\n grid-area: d;\n display: grid;\n grid-template-rows: repeat(6, 1fr);\n grid-template-columns: repeat(7, 1fr);\n}\n\n.picker-grid-head > *,\n.picker-grid-weeks > * {\n @include cat-body('xs', 600);\n color: cat-token('color.ui.font.muted') !important;\n text-decoration: none;\n}\n\n.date-other {\n opacity: 0.5;\n}\n\n.date-disabled {\n opacity: 0.25;\n}\n\n.picker-foot {\n display: flex;\n align-items: center;\n width: min-content;\n min-width: 100%;\n justify-content: space-between;\n container-type: inline-size;\n\n > :not(:last-child) {\n // we use margin here instead of gap to be able to properly adjust by container query\n margin-right: 0.25rem;\n }\n\n @container (min-width: 20rem) {\n > :not(:last-child) {\n margin-right: 0.5rem;\n }\n\n .cursor-help {\n @include cat-body('s');\n }\n }\n}\n\n.cursor-help {\n margin-block: 0;\n @include cat-body('xs');\n color: cat-token('color.ui.font.muted') !important;\n text-align: center;\n flex: 1;\n\n &:first-child {\n text-align: left;\n }\n\n &:last-child {\n text-align: right;\n }\n\n &:only-child {\n text-align: center;\n }\n}\n\n.cursor-aria {\n @include cat-visually-hidden;\n}\n\n.date-range {\n --cat-border-radius-m: 0;\n}\n","import { Component, Element, Event, EventEmitter, Host, Listen, Method, Prop, State, h } from '@stencil/core';\nimport { catI18nRegistry as i18n } from '../cat-i18n/cat-i18n-registry';\nimport { getLocale } from './cat-date-locale';\nimport { addDays, addMonth, clampDate, isSameDay, isSameMonth, isSameYear } from './cat-date-math';\n\n/**\n * An inline date picker component to select a date.\n */\n@Component({\n tag: 'cat-date-inline',\n styleUrl: 'cat-date-inline.scss',\n shadow: true\n})\nexport class CatDateInline {\n private readonly language = i18n.getLocale();\n private readonly locale = getLocale(this.language);\n // additonally store the focus date to ensure correct focus after potential re-render\n private focusDate: Date | null = null;\n\n @Element() hostElement!: HTMLElement;\n\n @State() viewDate: Date = this.locale.now();\n\n /**\n * Hides the clear button.\n */\n @Prop() noClear = false;\n\n /**\n * Shows an arrow keys navigation hint.\n */\n @Prop() hint = false;\n\n /**\n * Hides the today button.\n */\n @Prop() noToday = false;\n\n /**\n * Show week numbers.\n */\n @Prop() weeks = false;\n\n /**\n * A minimum value for the date, given in local ISO 8601 date format YYYY-MM-DD.\n */\n @Prop() min?: string;\n\n /**\n * A maximum value for the date, given in local ISO 8601 date format YYYY-MM-DD.\n */\n @Prop() max?: string;\n\n /**\n * Allow the selection of a range of dates, i.e. start and end date.\n */\n @Prop() range = false;\n\n /**\n * The value of the control, given in local ISO 8601 date format YYYY-MM-DD.\n */\n @Prop({ mutable: true }) value?: string;\n\n /**\n * Emitted when the value is changed.\n */\n @Event() catChange!: EventEmitter<string>;\n\n private get focusedDate() {\n const [all, year, month, day] =\n this.hostElement.shadowRoot\n ?.querySelector<HTMLCatButtonElement>(`[data-date]:focus`)\n ?.dataset.date?.match(/^(\\d{4})-(\\d{2})-(\\d{2})/) ?? [];\n return all ? new Date(Number(year), Number(month) - 1, Number(day)) : null;\n }\n\n componentWillLoad() {\n const [startDate, endDate] = this.getValue();\n if (endDate) {\n this.focus(endDate);\n } else if (startDate) {\n this.focus(startDate);\n }\n }\n\n componentDidRender() {\n if (this.focusDate) {\n // re-focus the previously focused date after re-render\n this.hostElement.shadowRoot\n ?.querySelector<HTMLCatButtonElement>(`[data-date=\"${this.locale.toLocalISO(this.focusDate)}\"]`)\n ?.doFocus();\n this.focusDate = null;\n }\n }\n\n @Listen('keydown')\n onKeyDown(e: KeyboardEvent) {\n if (!['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'].includes(e.key)) {\n return;\n }\n const focusedDate = this.focusedDate;\n if (!focusedDate) {\n e.preventDefault();\n const [startDate] = this.getValue();\n this.focus(startDate || this.locale.now());\n } else if (e.key === 'ArrowLeft') {\n e.preventDefault();\n this.focus(e.shiftKey ? addMonth(focusedDate, -1) : addDays(focusedDate, -1));\n } else if (e.key === 'ArrowRight') {\n e.preventDefault();\n this.focus(e.shiftKey ? addMonth(focusedDate, 1) : addDays(focusedDate, 1));\n } else if (e.key === 'ArrowUp') {\n e.preventDefault();\n this.focus(addDays(focusedDate, -7));\n } else if (e.key === 'ArrowDown') {\n e.preventDefault();\n this.focus(addDays(focusedDate, 7));\n }\n }\n\n /**\n * Select a date in the picker.\n *\n * @param date The date to select.\n */\n @Method()\n async select(date: Date | null): Promise<void> {\n if (!date) {\n return this.clear();\n }\n const oldValue = this.value;\n const [minDate, maxDate] = this.getMinMaxDate();\n const newDate = clampDate(minDate, new Date(date.getFullYear(), date.getMonth(), date.getDate()), maxDate);\n this.focus(newDate);\n\n if (this.range) {\n const [startDate, endDate] = this.getValue();\n if (!startDate || endDate || newDate < startDate) {\n this.value = this.toRangeValue(newDate, null);\n } else {\n this.value = this.toRangeValue(startDate, newDate);\n }\n } else {\n this.value = this.locale.toLocalISO(newDate);\n }\n\n if (oldValue !== this.value) {\n this.catChange.emit(this.value);\n }\n }\n\n /**\n * Clear the picker.\n */\n @Method()\n async clear(): Promise<void> {\n const oldValue = this.value;\n this.value = undefined;\n if (oldValue !== this.value) {\n this.catChange.emit(this.value);\n }\n }\n\n /**\n * Resets the view of the picker.\n */\n @Method()\n async resetView(): Promise<void> {\n const [minDate, maxDate] = this.getMinMaxDate();\n const [dateStart] = this.getValue();\n this.viewDate = dateStart ?? clampDate(minDate, this.locale.now(), maxDate);\n }\n\n render() {\n const [minDate, maxDate] = this.getMinMaxDate();\n const dateGrid = this.dateGrid(this.viewDate.getFullYear(), this.viewDate.getMonth());\n const [dateStart, dateEnd] = this.getValue();\n return (\n <Host>\n <div class={{ picker: true, 'picker-weeks': this.weeks }}>\n <div class=\"picker-head\">\n <cat-button\n icon=\"$cat:datepicker-year-prev\"\n iconOnly\n size=\"xs\"\n variant=\"text\"\n a11y-label={this.locale.prevYear}\n disabled={isSameYear(this.viewDate, minDate)}\n onClick={() => this.navigate('prev', 'year')}\n data-dropdown-no-close\n ></cat-button>\n <cat-button\n icon=\"$cat:datepicker-month-prev\"\n iconOnly\n size=\"xs\"\n variant=\"text\"\n a11y-label={this.locale.prevMonth}\n disabled={isSameMonth(this.viewDate, minDate)}\n onClick={() => this.navigate('prev', 'month')}\n data-dropdown-no-close\n ></cat-button>\n <h3>{this.getHeadline()}</h3>\n <cat-button\n icon=\"$cat:datepicker-month-next\"\n iconOnly\n size=\"xs\"\n variant=\"text\"\n a11y-label={this.locale.nextMonth}\n disabled={isSameMonth(this.viewDate, maxDate)}\n onClick={() => this.navigate('next', 'month')}\n data-dropdown-no-close\n ></cat-button>\n <cat-button\n icon=\"$cat:datepicker-year-next\"\n iconOnly\n size=\"xs\"\n variant=\"text\"\n a11y-label={this.locale.nextYear}\n disabled={isSameYear(this.viewDate, maxDate)}\n onClick={() => this.navigate('next', 'year')}\n data-dropdown-no-close\n ></cat-button>\n </div>\n <div class=\"picker-grid\" onFocusin={() => this.setAriaLive(this.locale.arrowKeys)}>\n <div class=\"picker-grid-head\">\n {Array.from(Array(7), (_, i) => (\n <abbr title={this.locale.days.long[i]}>{this.locale.days.short[i]}</abbr>\n ))}\n </div>\n {this.weeks && (\n <div class=\"picker-grid-weeks\">\n {dateGrid\n .filter((_, i) => i % 7 === 0)\n .map(day => (\n <div>{this.getWeekNumber(day)}</div>\n ))}\n </div>\n )}\n <div class=\"picker-grid-days\">\n {dateGrid.map(day => {\n const isStartDate = isSameDay(dateStart, day);\n const isEndDate = isSameDay(dateEnd, day);\n const isRange = !!dateStart && !!dateEnd && day > dateStart && day < dateEnd;\n const isToday = isSameDay(this.locale.now(), day);\n return (\n <cat-button\n class={{\n 'cat-date-item': true,\n 'date-other': !isSameMonth(this.viewDate, day),\n 'date-today': isToday,\n 'date-start': this.range && isStartDate,\n 'date-range': this.range && isRange,\n 'date-end': this.range && isEndDate,\n 'date-focusable': this.canFocus(day),\n 'date-disabled': !this.canClick(day)\n }}\n nativeAttributes={!this.canFocus(day) ? { tabindex: '-1' } : {}}\n variant={isStartDate || isEndDate ? 'filled' : isToday ? 'outlined' : 'text'}\n a11yLabel={this.locale.toLocalStr(day)}\n active={isStartDate || isEndDate || isRange}\n color={isStartDate || isEndDate || isToday ? 'primary' : 'secondary'}\n disabled={!this.canClick(day)}\n onClick={() => this.select(day)}\n data-date={this.locale.toLocalISO(day)}\n >\n {day.getDate()}\n </cat-button>\n );\n })}\n </div>\n </div>\n <div class=\"picker-foot\">\n {!this.noToday && this.canClick(this.locale.now()) && (\n <cat-button size=\"s\" data-dropdown-no-close onClick={() => this.select(this.locale.now())}>\n {this.locale.today}\n </cat-button>\n )}\n {this.hint && <p class=\"cursor-help\">{this.locale.arrowKeys}</p>}\n {!this.noClear && (\n <cat-button size=\"s\" disabled={!this.value} data-dropdown-no-close onClick={() => this.clear()}>\n {this.locale.clear}\n </cat-button>\n )}\n </div>\n </div>\n <p class=\"cursor-aria\" aria-live=\"polite\"></p>\n </Host>\n );\n }\n\n private focus(date: Date) {\n const [minDate, maxDate] = this.getMinMaxDate();\n this.focusDate = clampDate(minDate, date, maxDate);\n this.viewDate = new Date(this.focusDate.getFullYear(), this.focusDate.getMonth());\n this.hostElement.shadowRoot\n ?.querySelector<HTMLCatButtonElement>(`[data-date=\"${this.locale.toLocalISO(this.focusDate)}\"]`)\n ?.doFocus();\n }\n\n private navigate(direction: 'prev' | 'next', period: 'year' | 'month') {\n this.viewDate = new Date(\n direction === 'prev'\n ? period === 'year'\n ? this.viewDate.setFullYear(this.viewDate.getFullYear() - 1)\n : this.viewDate.setMonth(this.viewDate.getMonth() - 1)\n : period === 'year'\n ? this.viewDate.setFullYear(this.viewDate.getFullYear() + 1)\n : this.viewDate.setMonth(this.viewDate.getMonth() + 1)\n );\n // announce the new month and year\n this.setAriaLive(this.getHeadline());\n }\n\n private setAriaLive(text: string) {\n const node = this.hostElement.shadowRoot?.querySelector('.cursor-aria');\n if (node) {\n node.innerHTML = text;\n }\n }\n\n private dateGrid(year: number, month: number) {\n const firstDayOfWeek = new Date(year, month, 1).getDay();\n const daysInMonth = new Date(year, month + 1, 0).getDate();\n const days = [...Array(daysInMonth).keys()];\n const daysBefore = [...Array(firstDayOfWeek).keys()].map(day =>\n new Date(year, month, day - firstDayOfWeek).getDate()\n );\n const daysAfter = [...Array(42 - days.length - daysBefore.length).keys()];\n return [\n ...daysBefore.map(day => new Date(year, month - 1, day + 1)),\n ...days.map(day => new Date(year, month, day + 1)),\n ...daysAfter.map(day => new Date(year, month + 1, day + 1))\n ];\n }\n\n private getHeadline() {\n return `${this.locale.months.long[this.viewDate.getMonth()]} ${this.viewDate.getFullYear()}`;\n }\n\n private getWeekNumber(date: Date, iso8601 = true) {\n const currentDate = new Date(date.getTime());\n const dayNum = iso8601 ? currentDate.getDay() || 7 : currentDate.getDay();\n currentDate.setDate(currentDate.getDate() + 4 - dayNum);\n const yearStart = new Date(currentDate.getFullYear(), 0, 1);\n return Math.ceil(((+currentDate - +yearStart) / 86400000 + 1) / 7);\n }\n\n private canFocus(date: Date): boolean {\n const now = this.locale.now();\n const [minDate] = this.getMinMaxDate();\n const focusedDate = this.focusedDate;\n const [startDate] = this.getValue();\n if (focusedDate && isSameMonth(focusedDate, this.viewDate)) {\n return isSameMonth(focusedDate, date) && isSameDay(focusedDate, date);\n } else if (startDate && isSameMonth(startDate, this.viewDate)) {\n return isSameMonth(startDate, date) && isSameDay(startDate, date);\n } else if (isSameMonth(this.viewDate, now) && (!minDate || minDate <= now)) {\n return isSameMonth(this.viewDate, date) && isSameDay(now, date);\n }\n const minDay = isSameMonth(date, minDate) ? minDate?.getDate() ?? 1 : 1;\n return isSameMonth(this.viewDate, date) && date.getDate() === minDay;\n }\n\n private canClick(date: Date) {\n const [minDate, maxDate] = this.getMinMaxDate();\n return (!minDate || minDate <= date) && (!maxDate || maxDate >= date);\n }\n\n private getMinMaxDate() {\n const minDate = this.locale.fromLocalISO(this.min);\n const maxDate = this.locale.fromLocalISO(this.max);\n return [minDate, maxDate];\n }\n\n private getValue(): [Date | null, Date | null] {\n if (this.range) {\n const [startDate, endDate] = JSON.parse(this.value || '[]') as [string | null, string | null];\n return [this.locale.fromLocalISO(startDate), this.locale.fromLocalISO(endDate)];\n } else {\n return [this.locale.fromLocalISO(this.value), null];\n }\n }\n\n private toRangeValue(startDate: Date | null, endDate: Date | null): string {\n return JSON.stringify([startDate, endDate].map(date => (date ? this.locale.toLocalISO(date) : null)));\n }\n}\n"],"version":3}
|
|
@@ -7,7 +7,7 @@ import { d as defineCustomElement$4 } from './cat-icon2.js';
|
|
|
7
7
|
import { d as defineCustomElement$3 } from './cat-input2.js';
|
|
8
8
|
import { d as defineCustomElement$2 } from './cat-spinner2.js';
|
|
9
9
|
|
|
10
|
-
const catDateCss = ":host{display:block}:host([hidden]){display:none}.label-aria{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}cat-date-inline{margin:1rem}";
|
|
10
|
+
const catDateCss = ":host{display:block}:host([hidden]){display:none}.label-aria{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}cat-date-inline{margin:1rem;width:20rem}";
|
|
11
11
|
const CatDateStyle0 = catDateCss;
|
|
12
12
|
|
|
13
13
|
const CatDate$1 = /*@__PURE__*/ proxyCustomElement(class CatDate extends HTMLElement {
|
|
@@ -111,7 +111,7 @@ const CatDate$1 = /*@__PURE__*/ proxyCustomElement(class CatDate extends HTMLEle
|
|
|
111
111
|
}, onCatBlur: e => {
|
|
112
112
|
e.stopPropagation();
|
|
113
113
|
this.onInputBlur(e.detail);
|
|
114
|
-
} }, h("span", { key: '68ef0708d25128b9a52d60c5b1a7b34e0ffb2ef1', slot: "label" }, this.label, h("span", { key: 'ac017335567a4e0059631e7535455d52f61f2e43', class: "label-aria" }, " (", this.locale.formatStr, ")")), h("cat-dropdown", { key: '16a6e95f6e4f6a9b0ddd7716f0b713c8fac3fdff', slot: "addon", placement: this.placement, arrowNavigation: "none", noResize: true, onCatOpen: () => this.dateInline?.resetView() }, h("cat-button", { key: 'cf7f2aaa2c5775b23f3e8826e9b0e722c4ce8be6', slot: "trigger", icon: "$cat:datepicker-calendar", iconOnly: true, class: "cat-date-toggle", disabled: this.disabled, a11yLabel: this.getTriggerA11yLabel() }), h("div", { key: 'f90eef976a3102855801df5ffeee770d45e7eaba', slot: "content" }, h("cat-date-inline", { key: '
|
|
114
|
+
} }, h("span", { key: '68ef0708d25128b9a52d60c5b1a7b34e0ffb2ef1', slot: "label" }, this.label, h("span", { key: 'ac017335567a4e0059631e7535455d52f61f2e43', class: "label-aria" }, " (", this.locale.formatStr, ")")), h("cat-dropdown", { key: '16a6e95f6e4f6a9b0ddd7716f0b713c8fac3fdff', slot: "addon", placement: this.placement, arrowNavigation: "none", noResize: true, onCatOpen: () => this.dateInline?.resetView() }, h("cat-button", { key: 'cf7f2aaa2c5775b23f3e8826e9b0e722c4ce8be6', slot: "trigger", icon: "$cat:datepicker-calendar", iconOnly: true, class: "cat-date-toggle", disabled: this.disabled, a11yLabel: this.getTriggerA11yLabel() }), h("div", { key: 'f90eef976a3102855801df5ffeee770d45e7eaba', slot: "content" }, h("cat-date-inline", { key: '2a0ee2889e1077a6e403458bd3e114396590d0ed', ref: el => (this.dateInline = el), min: this.min, max: this.max, value: this.value, hint: true, weeks: true, noClear: true, onCatChange: this.onDateChange.bind(this) }))))));
|
|
115
115
|
}
|
|
116
116
|
getTriggerA11yLabel() {
|
|
117
117
|
const date = this.locale.fromLocalISO(this.value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"cat-date.js","mappings":";;;;;;;;;AAAA,MAAM,UAAU,GAAG,6TAA6T,CAAC;AACjV,sBAAe,UAAU;;MCcZA,SAAO;;;;;;;;QACD,aAAQ,GAAGC,eAAI,CAA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AS,CAAC,IAAI,KAAK,KAAK,GAAG,SAAS,GAAG,IAAI,EAAE,OAAO,EAAE,IAAI,KAAK,KAAK,GAAG,SAAS,GAAG,IAAI,CAAC,CAAC;QACzG,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACjD,IAAI,QAAQ,KAAK,QAAQ,EAAE;YACzB,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC;YACtB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SAC/B;KACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["CatDate","i18n"],"sources":["src/components/cat-date/cat-date.scss?tag=cat-date&encapsulation=shadow","src/components/cat-date/cat-date.tsx"],"sourcesContent":["@use 'variables' as *;\n@use 'mixins' as *;\n\n:host {\n display: block;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n.label-aria {\n @include cat-visually-hidden;\n}\n\ncat-date-inline {\n margin: 1rem;\n}\n","import { Placement } from '@floating-ui/dom';\nimport { Component, Element, Event, EventEmitter, Host, Method, Prop, State, Watch, h } from '@stencil/core';\nimport { getLocale } from '../cat-date-inline/cat-date-locale';\nimport { clampDate } from '../cat-date-inline/cat-date-math';\nimport { ErrorMap } from '../cat-form-hint/cat-form-hint';\nimport { catI18nRegistry as i18n } from '../cat-i18n/cat-i18n-registry';\n\n/**\n * A date input component to select a date from a calendar in a dropdown.\n */\n@Component({\n tag: 'cat-date',\n styleUrl: 'cat-date.scss',\n shadow: true\n})\nexport class CatDate {\n private readonly language = i18n.getLocale();\n private readonly locale = getLocale(this.language);\n private input?: HTMLCatInputElement;\n private dateInline?: HTMLCatDateInlineElement;\n\n @Element() hostElement!: HTMLElement;\n\n @State() hasSlottedLabel = false;\n\n @State() hasSlottedHint = false;\n\n /**\n * Whether the label need a marker to shown if the input is required or optional.\n */\n @Prop() requiredMarker?: 'none' | 'required' | 'optional' | 'none!' | 'optional!' | 'required!' = 'optional';\n\n /**\n * Whether the label is on top or left.\n */\n @Prop() horizontal = false;\n\n /**\n * Hint for form autofill feature.\n */\n @Prop() autoComplete?: string;\n\n /**\n * Whether the input should show a clear button.\n */\n @Prop() clearable = false;\n\n /**\n * Whether the input is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * Optional hint text(s) to be displayed with the input.\n */\n @Prop() hint?: string | string[];\n\n /**\n * The name of an icon to be displayed in the input.\n */\n @Prop() icon?: string;\n\n /**\n * Display the icon on the right.\n */\n @Prop() iconRight = false;\n\n /**\n * A unique identifier for the input.\n */\n @Prop() identifier?: string;\n\n /**\n * The label for the input.\n */\n @Prop() label = '';\n\n /**\n * Visually hide the label, but still show it to assistive technologies like screen readers.\n */\n @Prop() labelHidden = false;\n\n /**\n * A maximum value for the date, given in local ISO 8601 date format YYYY-MM-DD.\n */\n @Prop() max?: string;\n\n /**\n * A minimum value for the date, given in local ISO 8601 date format YYYY-MM-DD.\n */\n @Prop() min?: string;\n\n /**\n * The name of the form control. Submitted with the form as part of a name/value pair.\n */\n @Prop() name?: string;\n\n /**\n * The placeholder text to display within the input.\n */\n @Prop() placeholder?: string;\n\n /**\n * A textual prefix to be displayed in the input.\n */\n @Prop() textPrefix?: string;\n\n /**\n * A textual suffix to be displayed in the input.\n */\n @Prop() textSuffix?: string;\n\n /**\n * The value is not editable.\n */\n @Prop() readonly = false;\n\n /**\n * A value is required or must be check for the form to be submittable.\n */\n @Prop() required = false;\n\n /**\n * The value of the control, given in local ISO 8601 date format YYYY-MM-DD.\n */\n @Prop({ mutable: true }) value?: string;\n\n /**\n * The validation errors for this input. Will render a hint under the input\n * with the translated error message(s) `error.${key}`. If an object is\n * passed, the keys will be used as error keys and the values translation\n * parameters.\n * If the value is `true`, the input will be marked as invalid without any\n * hints under the input.\n */\n @Prop() errors?: boolean | string[] | ErrorMap;\n\n /**\n * Fine-grained control over when the errors are shown. Can be `false` to\n * never show errors, `true` to show errors on blur, or a number to show\n * errors on change with the given delay in milliseconds.\n */\n @Prop() errorUpdate: boolean | number = 0;\n\n /**\n * Attributes that will be added to the native HTML input element.\n */\n @Prop() nativeAttributes?: { [key: string]: string };\n\n /**\n * The placement of the dropdown.\n */\n @Prop() placement: Placement = 'bottom-end';\n\n @Watch('min')\n onMinChanged(min?: string, oldMin?: string) {\n if (min !== oldMin) {\n this.reclamp('min', min);\n }\n }\n\n @Watch('max')\n onMaxChanged(max?: string, oldMax?: string) {\n if (max !== oldMax) {\n this.reclamp('max', max);\n }\n }\n\n /**\n * Emitted when the value is changed.\n */\n @Event() catChange!: EventEmitter<string>;\n\n /**\n * Emitted when the input received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n private get inputValue() {\n const [match, year, month, day] = this.value?.match(/^(\\d{4})-(\\d{2})-(\\d{2})/) ?? [];\n if (match) {\n const date = new Date(Number(year), Number(month) - 1, Number(day));\n const format = new Intl.DateTimeFormat(this.language, { year: 'numeric', month: '2-digit', day: '2-digit' });\n return format.format(date);\n }\n return '';\n }\n\n componentWillRender(): void {\n this.hasSlottedLabel = !!this.hostElement.querySelector('[slot=\"label\"]');\n this.hasSlottedHint = !!this.hostElement.querySelector('[slot=\"hint\"]');\n }\n\n componentDidLoad() {\n const format = this.locale.formatStr.replace('YYYY', 'Y').replace('YY', 'y').replace('MM', 'm').replace('DD', 'd');\n const [, p1, d1, p2, p3] = /(\\w+)([^\\w]+)(\\w+)[^\\w]+(\\w+)/.exec(format) || [];\n this.input?.mask({\n date: true,\n dateMin: this.min,\n dateMax: this.max,\n delimiter: d1,\n datePattern: [p1, p2, p3]\n });\n }\n\n /**\n * Programmatically move focus to the input. Use this method instead of\n * `input.focus()`.\n *\n * @param options An optional object providing options to control aspects of\n * the focusing process.\n */\n @Method()\n async doFocus(options?: FocusOptions): Promise<void> {\n this.input?.doFocus(options);\n }\n\n /**\n * Programmatically remove focus from the input. Use this method instead of\n * `input.blur()`.\n */\n @Method()\n async doBlur(): Promise<void> {\n this.input?.doBlur();\n }\n\n /**\n * Clear the input.\n */\n @Method()\n async clear(): Promise<void> {\n this.input?.clear();\n }\n\n render() {\n return (\n <Host>\n <cat-input\n class=\"cat-date-input\"\n ref={el => (this.input = el as HTMLCatInputElement)}\n requiredMarker={this.requiredMarker}\n horizontal={this.horizontal}\n autoComplete={this.autoComplete}\n clearable={this.clearable}\n disabled={this.disabled}\n hint={this.hint}\n icon={this.icon}\n iconRight={this.iconRight}\n identifier={this.identifier}\n labelHidden={this.labelHidden}\n name={this.name}\n placeholder={this.placeholder}\n textPrefix={this.textPrefix}\n textSuffix={this.textSuffix}\n readonly={this.readonly}\n required={this.required}\n errors={this.errors}\n errorUpdate={this.errorUpdate}\n nativeAttributes={this.nativeAttributes}\n value={this.inputValue}\n onCatFocus={e => {\n e.stopPropagation();\n this.catFocus.emit(e.detail);\n }}\n onCatBlur={e => {\n e.stopPropagation();\n this.onInputBlur(e.detail);\n }}\n >\n <span slot=\"label\">\n {this.label}\n <span class=\"label-aria\"> ({this.locale.formatStr})</span>\n </span>\n <cat-dropdown\n slot=\"addon\"\n placement={this.placement}\n arrowNavigation=\"none\"\n noResize\n onCatOpen={() => this.dateInline?.resetView()}\n >\n <cat-button\n slot=\"trigger\"\n icon=\"$cat:datepicker-calendar\"\n iconOnly\n class=\"cat-date-toggle\"\n disabled={this.disabled}\n a11yLabel={this.getTriggerA11yLabel()}\n ></cat-button>\n <div slot=\"content\">\n <cat-date-inline\n ref={el => (this.dateInline = el as HTMLCatDateInlineElement)}\n min={this.min}\n max={this.max}\n value={this.value}\n noClear\n onCatChange={this.onDateChange.bind(this)}\n ></cat-date-inline>\n </div>\n </cat-dropdown>\n </cat-input>\n </Host>\n );\n }\n\n private getTriggerA11yLabel() {\n const date = this.locale.fromLocalISO(this.value);\n return date ? `${this.locale.change}, ${this.locale.toLocalStr(date)}` : this.locale.choose;\n }\n\n private onInputBlur(e: FocusEvent) {\n if (!this.input) {\n return;\n }\n const oldValue = this.value;\n const dateParsed = this.parse(this.input.value ?? '');\n const dateMin = this.locale.fromLocalISO(this.min);\n const dateMax = this.locale.fromLocalISO(this.max);\n const date = dateParsed ? clampDate(dateMin, dateParsed, dateMax) : null;\n this.value = date ? this.locale.toLocalISO(date) : undefined;\n if (oldValue !== this.value) {\n if (date) {\n this.dateInline?.select(date);\n } else {\n this.dateInline?.clear();\n }\n this.catChange.emit(this.value);\n }\n this.input.value = this.inputValue;\n this.catBlur.emit(e);\n }\n\n private onDateChange(e: CustomEvent<string>) {\n e.stopPropagation();\n const oldValue = this.value;\n const date = e.detail ? new Date(e.detail) : null;\n this.value = date ? this.locale.toLocalISO(date) : undefined;\n if (oldValue !== this.value) {\n this.catChange.emit(this.value);\n }\n }\n\n private parse(value: string) {\n const [, p1, d1, p2, p3] = /(\\w+)([^\\w]+)(\\w+)[^\\w]+(\\w+)/.exec(this.locale.formatStr) || [];\n const formatParts = [p1, p2, p3];\n const parts = value.split(d1).map(s => Number(s || 'x'));\n let year = parts[formatParts.indexOf('YYYY') || formatParts.indexOf('YY')] || this.locale.now().getFullYear();\n const month = parts[formatParts.indexOf('MM')];\n const day = parts[formatParts.indexOf('DD')];\n if (!Number.isInteger(month) || !Number.isInteger(day)) {\n return null;\n } else if (year < 100) {\n year += year < 50 ? 2000 : 1900;\n }\n return new Date(year, month - 1, day);\n }\n\n private reclamp(mode: 'min' | 'max', limit: string | undefined) {\n const oldValue = this.value;\n const oldDate = this.locale.fromLocalISO(oldValue);\n const limitDate = this.locale.fromLocalISO(limit);\n if (!oldDate || !limitDate) {\n return;\n }\n const newDate = clampDate(mode === 'min' ? limitDate : null, oldDate, mode === 'max' ? limitDate : null);\n const newValue = this.locale.toLocalISO(newDate);\n if (oldValue !== newValue) {\n this.value = newValue;\n this.catChange.emit(newValue);\n }\n }\n}\n"],"version":3}
|
|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C;QACnD,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QAClD,IAAI,CAAC,OAAO,IAAI,CAAC,SAAS,EAAE;YAC1B,OAAO;SACR;QACD,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,KAAK,KAAK,GAAG,SAAS,GAAG,IAAI,EAAE,OAAO,EAAE,IAAI,KAAK,KAAK,GAAG,SAAS,GAAG,IAAI,CAAC,CAAC;QACzG,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACjD,IAAI,QAAQ,KAAK,QAAQ,EAAE;YACzB,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC;YACtB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SAC/B;KACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["CatDate","i18n"],"sources":["src/components/cat-date/cat-date.scss?tag=cat-date&encapsulation=shadow","src/components/cat-date/cat-date.tsx"],"sourcesContent":["@use 'variables' as *;\n@use 'mixins' as *;\n\n:host {\n display: block;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n.label-aria {\n @include cat-visually-hidden;\n}\n\ncat-date-inline {\n margin: 1rem;\n width: 20rem;\n}\n","import { Placement } from '@floating-ui/dom';\nimport { Component, Element, Event, EventEmitter, Host, Method, Prop, State, Watch, h } from '@stencil/core';\nimport { getLocale } from '../cat-date-inline/cat-date-locale';\nimport { clampDate } from '../cat-date-inline/cat-date-math';\nimport { ErrorMap } from '../cat-form-hint/cat-form-hint';\nimport { catI18nRegistry as i18n } from '../cat-i18n/cat-i18n-registry';\n\n/**\n * A date input component to select a date from a calendar in a dropdown.\n */\n@Component({\n tag: 'cat-date',\n styleUrl: 'cat-date.scss',\n shadow: true\n})\nexport class CatDate {\n private readonly language = i18n.getLocale();\n private readonly locale = getLocale(this.language);\n private input?: HTMLCatInputElement;\n private dateInline?: HTMLCatDateInlineElement;\n\n @Element() hostElement!: HTMLElement;\n\n @State() hasSlottedLabel = false;\n\n @State() hasSlottedHint = false;\n\n /**\n * Whether the label need a marker to shown if the input is required or optional.\n */\n @Prop() requiredMarker?: 'none' | 'required' | 'optional' | 'none!' | 'optional!' | 'required!' = 'optional';\n\n /**\n * Whether the label is on top or left.\n */\n @Prop() horizontal = false;\n\n /**\n * Hint for form autofill feature.\n */\n @Prop() autoComplete?: string;\n\n /**\n * Whether the input should show a clear button.\n */\n @Prop() clearable = false;\n\n /**\n * Whether the input is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * Optional hint text(s) to be displayed with the input.\n */\n @Prop() hint?: string | string[];\n\n /**\n * The name of an icon to be displayed in the input.\n */\n @Prop() icon?: string;\n\n /**\n * Display the icon on the right.\n */\n @Prop() iconRight = false;\n\n /**\n * A unique identifier for the input.\n */\n @Prop() identifier?: string;\n\n /**\n * The label for the input.\n */\n @Prop() label = '';\n\n /**\n * Visually hide the label, but still show it to assistive technologies like screen readers.\n */\n @Prop() labelHidden = false;\n\n /**\n * A maximum value for the date, given in local ISO 8601 date format YYYY-MM-DD.\n */\n @Prop() max?: string;\n\n /**\n * A minimum value for the date, given in local ISO 8601 date format YYYY-MM-DD.\n */\n @Prop() min?: string;\n\n /**\n * The name of the form control. Submitted with the form as part of a name/value pair.\n */\n @Prop() name?: string;\n\n /**\n * The placeholder text to display within the input.\n */\n @Prop() placeholder?: string;\n\n /**\n * A textual prefix to be displayed in the input.\n */\n @Prop() textPrefix?: string;\n\n /**\n * A textual suffix to be displayed in the input.\n */\n @Prop() textSuffix?: string;\n\n /**\n * The value is not editable.\n */\n @Prop() readonly = false;\n\n /**\n * A value is required or must be check for the form to be submittable.\n */\n @Prop() required = false;\n\n /**\n * The value of the control, given in local ISO 8601 date format YYYY-MM-DD.\n */\n @Prop({ mutable: true }) value?: string;\n\n /**\n * The validation errors for this input. Will render a hint under the input\n * with the translated error message(s) `error.${key}`. If an object is\n * passed, the keys will be used as error keys and the values translation\n * parameters.\n * If the value is `true`, the input will be marked as invalid without any\n * hints under the input.\n */\n @Prop() errors?: boolean | string[] | ErrorMap;\n\n /**\n * Fine-grained control over when the errors are shown. Can be `false` to\n * never show errors, `true` to show errors on blur, or a number to show\n * errors on change with the given delay in milliseconds.\n */\n @Prop() errorUpdate: boolean | number = 0;\n\n /**\n * Attributes that will be added to the native HTML input element.\n */\n @Prop() nativeAttributes?: { [key: string]: string };\n\n /**\n * The placement of the dropdown.\n */\n @Prop() placement: Placement = 'bottom-end';\n\n @Watch('min')\n onMinChanged(min?: string, oldMin?: string) {\n if (min !== oldMin) {\n this.reclamp('min', min);\n }\n }\n\n @Watch('max')\n onMaxChanged(max?: string, oldMax?: string) {\n if (max !== oldMax) {\n this.reclamp('max', max);\n }\n }\n\n /**\n * Emitted when the value is changed.\n */\n @Event() catChange!: EventEmitter<string>;\n\n /**\n * Emitted when the input received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n private get inputValue() {\n const [match, year, month, day] = this.value?.match(/^(\\d{4})-(\\d{2})-(\\d{2})/) ?? [];\n if (match) {\n const date = new Date(Number(year), Number(month) - 1, Number(day));\n const format = new Intl.DateTimeFormat(this.language, { year: 'numeric', month: '2-digit', day: '2-digit' });\n return format.format(date);\n }\n return '';\n }\n\n componentWillRender(): void {\n this.hasSlottedLabel = !!this.hostElement.querySelector('[slot=\"label\"]');\n this.hasSlottedHint = !!this.hostElement.querySelector('[slot=\"hint\"]');\n }\n\n componentDidLoad() {\n const format = this.locale.formatStr.replace('YYYY', 'Y').replace('YY', 'y').replace('MM', 'm').replace('DD', 'd');\n const [, p1, d1, p2, p3] = /(\\w+)([^\\w]+)(\\w+)[^\\w]+(\\w+)/.exec(format) || [];\n this.input?.mask({\n date: true,\n dateMin: this.min,\n dateMax: this.max,\n delimiter: d1,\n datePattern: [p1, p2, p3]\n });\n }\n\n /**\n * Programmatically move focus to the input. Use this method instead of\n * `input.focus()`.\n *\n * @param options An optional object providing options to control aspects of\n * the focusing process.\n */\n @Method()\n async doFocus(options?: FocusOptions): Promise<void> {\n this.input?.doFocus(options);\n }\n\n /**\n * Programmatically remove focus from the input. Use this method instead of\n * `input.blur()`.\n */\n @Method()\n async doBlur(): Promise<void> {\n this.input?.doBlur();\n }\n\n /**\n * Clear the input.\n */\n @Method()\n async clear(): Promise<void> {\n this.input?.clear();\n }\n\n render() {\n return (\n <Host>\n <cat-input\n class=\"cat-date-input\"\n ref={el => (this.input = el as HTMLCatInputElement)}\n requiredMarker={this.requiredMarker}\n horizontal={this.horizontal}\n autoComplete={this.autoComplete}\n clearable={this.clearable}\n disabled={this.disabled}\n hint={this.hint}\n icon={this.icon}\n iconRight={this.iconRight}\n identifier={this.identifier}\n labelHidden={this.labelHidden}\n name={this.name}\n placeholder={this.placeholder}\n textPrefix={this.textPrefix}\n textSuffix={this.textSuffix}\n readonly={this.readonly}\n required={this.required}\n errors={this.errors}\n errorUpdate={this.errorUpdate}\n nativeAttributes={this.nativeAttributes}\n value={this.inputValue}\n onCatFocus={e => {\n e.stopPropagation();\n this.catFocus.emit(e.detail);\n }}\n onCatBlur={e => {\n e.stopPropagation();\n this.onInputBlur(e.detail);\n }}\n >\n <span slot=\"label\">\n {this.label}\n <span class=\"label-aria\"> ({this.locale.formatStr})</span>\n </span>\n <cat-dropdown\n slot=\"addon\"\n placement={this.placement}\n arrowNavigation=\"none\"\n noResize\n onCatOpen={() => this.dateInline?.resetView()}\n >\n <cat-button\n slot=\"trigger\"\n icon=\"$cat:datepicker-calendar\"\n iconOnly\n class=\"cat-date-toggle\"\n disabled={this.disabled}\n a11yLabel={this.getTriggerA11yLabel()}\n ></cat-button>\n <div slot=\"content\">\n <cat-date-inline\n ref={el => (this.dateInline = el as HTMLCatDateInlineElement)}\n min={this.min}\n max={this.max}\n value={this.value}\n hint\n weeks\n noClear\n onCatChange={this.onDateChange.bind(this)}\n ></cat-date-inline>\n </div>\n </cat-dropdown>\n </cat-input>\n </Host>\n );\n }\n\n private getTriggerA11yLabel() {\n const date = this.locale.fromLocalISO(this.value);\n return date ? `${this.locale.change}, ${this.locale.toLocalStr(date)}` : this.locale.choose;\n }\n\n private onInputBlur(e: FocusEvent) {\n if (!this.input) {\n return;\n }\n const oldValue = this.value;\n const dateParsed = this.parse(this.input.value ?? '');\n const dateMin = this.locale.fromLocalISO(this.min);\n const dateMax = this.locale.fromLocalISO(this.max);\n const date = dateParsed ? clampDate(dateMin, dateParsed, dateMax) : null;\n this.value = date ? this.locale.toLocalISO(date) : undefined;\n if (oldValue !== this.value) {\n if (date) {\n this.dateInline?.select(date);\n } else {\n this.dateInline?.clear();\n }\n this.catChange.emit(this.value);\n }\n this.input.value = this.inputValue;\n this.catBlur.emit(e);\n }\n\n private onDateChange(e: CustomEvent<string>) {\n e.stopPropagation();\n const oldValue = this.value;\n const date = e.detail ? new Date(e.detail) : null;\n this.value = date ? this.locale.toLocalISO(date) : undefined;\n if (oldValue !== this.value) {\n this.catChange.emit(this.value);\n }\n }\n\n private parse(value: string) {\n const [, p1, d1, p2, p3] = /(\\w+)([^\\w]+)(\\w+)[^\\w]+(\\w+)/.exec(this.locale.formatStr) || [];\n const formatParts = [p1, p2, p3];\n const parts = value.split(d1).map(s => Number(s || 'x'));\n let year = parts[formatParts.indexOf('YYYY') || formatParts.indexOf('YY')] || this.locale.now().getFullYear();\n const month = parts[formatParts.indexOf('MM')];\n const day = parts[formatParts.indexOf('DD')];\n if (!Number.isInteger(month) || !Number.isInteger(day)) {\n return null;\n } else if (year < 100) {\n year += year < 50 ? 2000 : 1900;\n }\n return new Date(year, month - 1, day);\n }\n\n private reclamp(mode: 'min' | 'max', limit: string | undefined) {\n const oldValue = this.value;\n const oldDate = this.locale.fromLocalISO(oldValue);\n const limitDate = this.locale.fromLocalISO(limit);\n if (!oldDate || !limitDate) {\n return;\n }\n const newDate = clampDate(mode === 'min' ? limitDate : null, oldDate, mode === 'max' ? limitDate : null);\n const newValue = this.locale.toLocalISO(newDate);\n if (oldValue !== newValue) {\n this.value = newValue;\n this.catChange.emit(newValue);\n }\n }\n}\n"],"version":3}
|
|
@@ -1042,7 +1042,7 @@ function createEmptyStyleRule(query) {
|
|
|
1042
1042
|
}
|
|
1043
1043
|
}
|
|
1044
1044
|
|
|
1045
|
-
const catButtonCss = ":host{display:inline-block;max-width:100%;vertical-align:middle;-webkit-user-select:none;-ms-user-select:none;user-select:none;}:host([hidden]){display:none}.cat-button{position:relative;font:inherit;display:flex;align-items:center;justify-content:center;border:none;border-radius:var(--cat-border-radius-m, 0.25rem);text-decoration:none;width:100%;box-sizing:border-box;cursor:pointer;transition:color 125ms linear, border-color 125ms linear, background-color 125ms linear, box-shadow 125ms linear}.cat-button:focus-visible{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.cat-button-content{display:flex;flex-direction:column;min-width:0}.cat-button-content-inner{word-wrap:break-word;word-break:break-word}.cat-button-ellipsed .cat-button-content-inner{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.cat-button-disabled{cursor:not-allowed}.cat-button-round{border-radius:10rem}.cat-button-loading{cursor:default}.cat-button-loading cat-spinner{position:absolute}.cat-button-loading>*:not(cat-spinner){visibility:hidden}.cat-group-button-first{border-top-right-radius:0;border-bottom-right-radius:0}.cat-group-button-middle{border-radius:0}.cat-group-button-last{border-top-left-radius:0;border-bottom-left-radius:0}.cat-group-button:hover{z-index:1}.cat-group-button:focus-visible{z-index:2}.cat-button-filled{background-color:rgb(var(--bg));color:rgb(var(--fill));font-weight:var(--cat-font-weight-button, 600);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:greyscale}.cat-button-filled.cat-button-disabled{--bg:242, 244, 247;--fill:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-outlined{background-color:white;box-shadow:inset 0 0 0 1px rgba(var(--base), 0.2);color:rgb(var(--text))}.cat-button-outlined.cat-button-disabled{--base:var(--cat-font-color-muted, 81, 92, 108);--text:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-outlined:hover:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-outlined.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-outlined:active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-text{background-color:transparent;color:rgb(var(--text));text-decoration:var(--cat-link-button-decoration, none)}.cat-button-text.cat-button-disabled{--text:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-text:hover:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-text.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-link{background-color:transparent;color:rgb(var(--text))}.cat-button-link.cat-button-disabled{--text:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-link:hover:not(.cat-button-disabled):not(.cat-button-loading){text-decoration:var(--cat-link-decoration-hover, underline)}.cat-button-link.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading){text-decoration:var(--cat-link-decoration-hover, underline)}.cat-button-primary{--bg:var(--cat-primary-bg, 0, 129, 148);--fill:var(--cat-primary-fill, 255, 255, 255);--text:var(--cat-primary-text, 0, 129, 148);--base:var(--cat-primary-text, 0, 129, 148)}.cat-button-primary:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-primary-bg-hover, 1, 115, 132);--fill:var(--cat-primary-fill-hover, 255, 255, 255);--text:var(--cat-primary-text-hover, 1, 115, 132)}.cat-button-primary.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-primary:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-primary-bg-active, 2, 99, 113);--fill:var(--cat-primary-fill-active, 255, 255, 255);--text:var(--cat-primary-text-active, 2, 99, 113)}.cat-button-secondary{--bg:var(--cat-secondary-bg, 105, 118, 135);--fill:var(--cat-secondary-fill, 255, 255, 255);--text:var(--cat-secondary-text, 0, 0, 0);--base:var(--cat-secondary-bg, 105, 118, 135)}.cat-button-secondary:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-secondary-bg-hover, 105, 118, 135);--fill:var(--cat-secondary-fill-hover, 255, 255, 255);--text:var(--cat-secondary-text-hover, 0, 0, 0)}.cat-button-secondary.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-secondary:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-secondary-bg-active, 105, 118, 135);--fill:var(--cat-secondary-fill-active, 255, 255, 255);--text:var(--cat-secondary-text-active, 0, 0, 0)}.cat-button-info{--bg:var(--cat-info-bg, 0, 115, 230);--fill:var(--cat-info-fill, 255, 255, 255);--text:var(--cat-info-text, 0, 115, 230);--base:var(--cat-info-text, 0, 115, 230)}.cat-button-info:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-info-bg-hover, 0, 107, 227);--fill:var(--cat-info-fill-hover, 255, 255, 255);--text:var(--cat-info-text-hover, 0, 107, 227)}.cat-button-info.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-info:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-info-bg-active, 0, 96, 223);--fill:var(--cat-info-fill-active, 255, 255, 255);--text:var(--cat-info-text-active, 0, 96, 223)}.cat-button-success{--bg:var(--cat-success-bg, 0, 132, 88);--fill:var(--cat-success-fill, 255, 255, 255);--text:var(--cat-success-text, 0, 132, 88);--base:var(--cat-success-text, 0, 132, 88)}.cat-button-success:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-success-bg-hover, 0, 117, 78);--fill:var(--cat-success-fill-hover, 255, 255, 255);--text:var(--cat-success-text-hover, 0, 117, 78)}.cat-button-success.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-success:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-success-bg-active, 0, 105, 70);--fill:var(--cat-success-fill-active, 255, 255, 255);--text:var(--cat-success-text-active, 0, 105, 70)}.cat-button-warning{--bg:var(--cat-warning-bg, 255, 206, 128);--fill:var(--cat-warning-fill, 0, 0, 0);--text:var(--cat-warning-text, 159, 97, 0);--base:var(--cat-warning-text, 159, 97, 0)}.cat-button-warning:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-warning-bg-hover, 255, 214, 148);--fill:var(--cat-warning-fill-hover, 0, 0, 0);--text:var(--cat-warning-text-hover, 159, 97, 0)}.cat-button-warning.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-warning:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-warning-bg-active, 255, 222, 168);--fill:var(--cat-warning-fill-active, 0, 0, 0);--text:var(--cat-warning-text-active, 159, 97, 0)}.cat-button-danger{--bg:var(--cat-danger-bg, 217, 52, 13);--fill:var(--cat-danger-fill, 255, 255, 255);--text:var(--cat-danger-text, 217, 52, 13);--base:var(--cat-danger-text, 217, 52, 13)}.cat-button-danger:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-danger-bg-hover, 194, 46, 11);--fill:var(--cat-danger-fill-hover, 255, 255, 255);--text:var(--cat-danger-text-hover, 194, 46, 11)}.cat-button-danger.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-danger:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-danger-bg-active, 174, 42, 10);--fill:var(--cat-danger-fill-active, 255, 255, 255);--text:var(--cat-danger-text-active, 174, 42, 10)}:host(.cat-button-pull:not([size])){margin:-0.625rem -0.75rem}:host(.cat-button-pull-h:not([size])){margin-left:-0.75rem;margin-right:-0.75rem}:host(.cat-button-pull-v:not([size])){margin-top:-0.625rem;margin-bottom:-0.625rem}:host(.cat-button-pull-t:not([size])){margin-top:-0.625rem}:host(.cat-button-pull-l:not([size])){margin-left:-0.75rem}:host(.cat-button-pull-b:not([size])){margin-bottom:-0.625rem}:host(.cat-button-pull-r:not([size])){margin-right:-0.75rem}.cat-button-xs{min-width:1.5rem;padding:0.1875rem 0.25rem;font-size:0.875rem;line-height:1.125rem;gap:0.25rem}.cat-button-xs.cat-button-icon{width:1.5rem;height:1.5rem;padding:0}:host(.cat-button-pull[size=xs]){margin:-0.1875rem -0.25rem}:host(.cat-button-pull-h[size=xs]){margin-left:-0.25rem;margin-right:-0.25rem}:host(.cat-button-pull-v[size=xs]){margin-top:-0.1875rem;margin-bottom:-0.1875rem}:host(.cat-button-pull-t[size=xs]){margin-top:-0.1875rem}:host(.cat-button-pull-l[size=xs]){margin-left:-0.25rem}:host(.cat-button-pull-b[size=xs]){margin-bottom:-0.1875rem}:host(.cat-button-pull-r[size=xs]){margin-right:-0.25rem}.cat-button-s{min-width:2rem;padding:0.375rem 0.5rem;font-size:0.9375rem;line-height:1.25rem;gap:0.25rem}.cat-button-s cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-s.cat-button-icon{width:2rem;height:2rem;padding:0}:host(.cat-button-pull[size=s]){margin:-0.375rem -0.5rem}:host(.cat-button-pull-h[size=s]){margin-left:-0.5rem;margin-right:-0.5rem}:host(.cat-button-pull-v[size=s]){margin-top:-0.375rem;margin-bottom:-0.375rem}:host(.cat-button-pull-t[size=s]){margin-top:-0.375rem}:host(.cat-button-pull-l[size=s]){margin-left:-0.5rem}:host(.cat-button-pull-b[size=s]){margin-bottom:-0.375rem}:host(.cat-button-pull-r[size=s]){margin-right:-0.5rem}.cat-button-m{min-width:2.5rem;padding:0.625rem 0.75rem;font-size:0.9375rem;line-height:1.25rem;gap:0.25rem}.cat-button-m cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-m.cat-button-icon{width:2.5rem;height:2.5rem;padding:0}:host(.cat-button-pull[size=m]){margin:-0.625rem -0.75rem}:host(.cat-button-pull-h[size=m]){margin-left:-0.75rem;margin-right:-0.75rem}:host(.cat-button-pull-v[size=m]){margin-top:-0.625rem;margin-bottom:-0.625rem}:host(.cat-button-pull-t[size=m]){margin-top:-0.625rem}:host(.cat-button-pull-l[size=m]){margin-left:-0.75rem}:host(.cat-button-pull-b[size=m]){margin-bottom:-0.625rem}:host(.cat-button-pull-r[size=m]){margin-right:-0.75rem}.cat-button-l{min-width:3rem;padding:0.875rem 1rem;font-size:0.9375rem;line-height:1.25rem;gap:0.25rem}.cat-button-l cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-l.cat-button-icon{width:3rem;height:3rem;padding:0}:host(.cat-button-pull[size=l]){margin:-0.875rem -1rem}:host(.cat-button-pull-h[size=l]){margin-left:-1rem;margin-right:-1rem}:host(.cat-button-pull-v[size=l]){margin-top:-0.875rem;margin-bottom:-0.875rem}:host(.cat-button-pull-t[size=l]){margin-top:-0.875rem}:host(.cat-button-pull-l[size=l]){margin-left:-1rem}:host(.cat-button-pull-b[size=l]){margin-bottom:-0.875rem}:host(.cat-button-pull-r[size=l]){margin-right:-1rem}.cat-button-xl{min-width:3.5rem;padding:1rem 1.25rem;font-size:1.125rem;line-height:1.5rem;gap:0.25rem}.cat-button-xl.cat-button-icon{width:3.5rem;height:3.5rem;padding:0}:host(.cat-button-pull[size=xl]){margin:-1rem -1.25rem}:host(.cat-button-pull-h[size=xl]){margin-left:-1.25rem;margin-right:-1.25rem}:host(.cat-button-pull-v[size=xl]){margin-top:-1rem;margin-bottom:-1rem}:host(.cat-button-pull-t[size=xl]){margin-top:-1rem}:host(.cat-button-pull-l[size=xl]){margin-left:-1.25rem}:host(.cat-button-pull-b[size=xl]){margin-bottom:-1rem}:host(.cat-button-pull-r[size=xl]){margin-right:-1.25rem}:host(.cat-tab)::part(button){padding:1.125rem 0.75rem;--cat-secondary-bg:transparent;--cat-primary-text:transparent;--cat-danger-text:transparent}:host(.cat-tab)::part(content)::before{content:attr(data-text);content:attr(data-text)/\"\";height:0;visibility:hidden;overflow:hidden;user-select:none;pointer-events:none;font-weight:700}:host(.cat-text-left) .cat-button{justify-content:left}:host(.cat-text-right) .cat-button{justify-content:right}:host(.cat-nav-item){width:100%}:host(.cat-nav-item) .cat-button{box-shadow:none;justify-content:left;gap:0.5rem}:host(.cat-nav-item) .cat-button:focus-visible{outline-offset:-2px}:host(.cat-time-format) .cat-button{border-radius:0}:host(.cat-date-toggle) .cat-button,:host(.cat-time-toggle) .cat-button{margin-left:-1px;border-top-left-radius:0;border-bottom-left-radius:0}:host(.cat-date-item) .cat-button:hover,:host(.cat-date-toggle) .cat-button:hover,:host(.cat-time-format) .cat-button:hover,:host(.cat-time-toggle) .cat-button:hover{z-index:1}:host(.cat-date-item) .cat-button:focus-visible,:host(.cat-date-toggle) .cat-button:focus-visible,:host(.cat-time-format) .cat-button:focus-visible,:host(.cat-time-toggle) .cat-button:focus-visible{z-index:2}:host(.cat-date-item) .cat-button{padding:0;aspect-ratio:1}:host(.date-start:not(.date-end)) .cat-button{border-top-right-radius:0;border-bottom-right-radius:0}:host(.date-end:not(.date-start)) .cat-button{border-top-left-radius:0;border-bottom-left-radius:0}";
|
|
1045
|
+
const catButtonCss = ":host{display:inline-block;max-width:100%;vertical-align:middle;-webkit-user-select:none;-ms-user-select:none;user-select:none;}:host([hidden]){display:none}.cat-button{position:relative;font:inherit;display:flex;align-items:center;justify-content:center;border:none;border-radius:var(--cat-border-radius-m, 0.25rem);text-decoration:none;width:100%;box-sizing:border-box;cursor:pointer;transition:color 125ms linear, border-color 125ms linear, background-color 125ms linear, box-shadow 125ms linear}.cat-button:focus-visible{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.cat-button-content{display:flex;flex-direction:column;min-width:0}.cat-button-content-inner{word-wrap:break-word;word-break:break-word}.cat-button-ellipsed .cat-button-content-inner{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.cat-button-disabled{cursor:not-allowed}.cat-button-round{border-radius:10rem}.cat-button-loading{cursor:default}.cat-button-loading cat-spinner{position:absolute}.cat-button-loading>*:not(cat-spinner){visibility:hidden}.cat-group-button-first{border-top-right-radius:0;border-bottom-right-radius:0}.cat-group-button-middle{border-radius:0}.cat-group-button-last{border-top-left-radius:0;border-bottom-left-radius:0}.cat-group-button:hover{z-index:1}.cat-group-button:focus-visible{z-index:2}.cat-button-filled{background-color:rgb(var(--bg));color:rgb(var(--fill));font-weight:var(--cat-font-weight-button, 600);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:greyscale}.cat-button-filled.cat-button-disabled{--bg:242, 244, 247;--fill:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-outlined{background-color:white;box-shadow:inset 0 0 0 1px rgba(var(--base), 0.2);color:rgb(var(--text))}.cat-button-outlined.cat-button-disabled{--base:var(--cat-font-color-muted, 81, 92, 108);--text:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-outlined:hover:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-outlined.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-outlined:active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-text{background-color:transparent;color:rgb(var(--text));text-decoration:var(--cat-link-button-decoration, none)}.cat-button-text.cat-button-disabled{--text:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-text:hover:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-text.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-link{background-color:transparent;color:rgb(var(--text))}.cat-button-link.cat-button-disabled{--text:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-link:hover:not(.cat-button-disabled):not(.cat-button-loading){text-decoration:var(--cat-link-decoration-hover, underline)}.cat-button-link.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading){text-decoration:var(--cat-link-decoration-hover, underline)}.cat-button-primary{--bg:var(--cat-primary-bg, 0, 129, 148);--fill:var(--cat-primary-fill, 255, 255, 255);--text:var(--cat-primary-text, 0, 129, 148);--base:var(--cat-primary-text, 0, 129, 148)}.cat-button-primary:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-primary-bg-hover, 1, 115, 132);--fill:var(--cat-primary-fill-hover, 255, 255, 255);--text:var(--cat-primary-text-hover, 1, 115, 132)}.cat-button-primary.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-primary:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-primary-bg-active, 2, 99, 113);--fill:var(--cat-primary-fill-active, 255, 255, 255);--text:var(--cat-primary-text-active, 2, 99, 113)}.cat-button-secondary{--bg:var(--cat-secondary-bg, 105, 118, 135);--fill:var(--cat-secondary-fill, 255, 255, 255);--text:var(--cat-secondary-text, 0, 0, 0);--base:var(--cat-secondary-bg, 105, 118, 135)}.cat-button-secondary:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-secondary-bg-hover, 105, 118, 135);--fill:var(--cat-secondary-fill-hover, 255, 255, 255);--text:var(--cat-secondary-text-hover, 0, 0, 0)}.cat-button-secondary.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-secondary:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-secondary-bg-active, 105, 118, 135);--fill:var(--cat-secondary-fill-active, 255, 255, 255);--text:var(--cat-secondary-text-active, 0, 0, 0)}.cat-button-info{--bg:var(--cat-info-bg, 0, 115, 230);--fill:var(--cat-info-fill, 255, 255, 255);--text:var(--cat-info-text, 0, 115, 230);--base:var(--cat-info-text, 0, 115, 230)}.cat-button-info:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-info-bg-hover, 0, 107, 227);--fill:var(--cat-info-fill-hover, 255, 255, 255);--text:var(--cat-info-text-hover, 0, 107, 227)}.cat-button-info.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-info:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-info-bg-active, 0, 96, 223);--fill:var(--cat-info-fill-active, 255, 255, 255);--text:var(--cat-info-text-active, 0, 96, 223)}.cat-button-success{--bg:var(--cat-success-bg, 0, 132, 88);--fill:var(--cat-success-fill, 255, 255, 255);--text:var(--cat-success-text, 0, 132, 88);--base:var(--cat-success-text, 0, 132, 88)}.cat-button-success:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-success-bg-hover, 0, 117, 78);--fill:var(--cat-success-fill-hover, 255, 255, 255);--text:var(--cat-success-text-hover, 0, 117, 78)}.cat-button-success.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-success:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-success-bg-active, 0, 105, 70);--fill:var(--cat-success-fill-active, 255, 255, 255);--text:var(--cat-success-text-active, 0, 105, 70)}.cat-button-warning{--bg:var(--cat-warning-bg, 255, 206, 128);--fill:var(--cat-warning-fill, 0, 0, 0);--text:var(--cat-warning-text, 159, 97, 0);--base:var(--cat-warning-text, 159, 97, 0)}.cat-button-warning:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-warning-bg-hover, 255, 214, 148);--fill:var(--cat-warning-fill-hover, 0, 0, 0);--text:var(--cat-warning-text-hover, 159, 97, 0)}.cat-button-warning.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-warning:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-warning-bg-active, 255, 222, 168);--fill:var(--cat-warning-fill-active, 0, 0, 0);--text:var(--cat-warning-text-active, 159, 97, 0)}.cat-button-danger{--bg:var(--cat-danger-bg, 217, 52, 13);--fill:var(--cat-danger-fill, 255, 255, 255);--text:var(--cat-danger-text, 217, 52, 13);--base:var(--cat-danger-text, 217, 52, 13)}.cat-button-danger:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-danger-bg-hover, 194, 46, 11);--fill:var(--cat-danger-fill-hover, 255, 255, 255);--text:var(--cat-danger-text-hover, 194, 46, 11)}.cat-button-danger.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-danger:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-danger-bg-active, 174, 42, 10);--fill:var(--cat-danger-fill-active, 255, 255, 255);--text:var(--cat-danger-text-active, 174, 42, 10)}:host(.cat-button-pull:not([size])){margin:-0.625rem -0.75rem}:host(.cat-button-pull-h:not([size])){margin-left:-0.75rem;margin-right:-0.75rem}:host(.cat-button-pull-v:not([size])){margin-top:-0.625rem;margin-bottom:-0.625rem}:host(.cat-button-pull-t:not([size])){margin-top:-0.625rem}:host(.cat-button-pull-l:not([size])){margin-left:-0.75rem}:host(.cat-button-pull-b:not([size])){margin-bottom:-0.625rem}:host(.cat-button-pull-r:not([size])){margin-right:-0.75rem}.cat-button-xs{min-width:1.5rem;padding:0.1875rem 0.25rem;font-size:0.875rem;line-height:1.125rem;gap:0.25rem}.cat-button-xs.cat-button-icon{width:1.5rem;height:1.5rem;padding:0}:host(.cat-button-pull[size=xs]){margin:-0.1875rem -0.25rem}:host(.cat-button-pull-h[size=xs]){margin-left:-0.25rem;margin-right:-0.25rem}:host(.cat-button-pull-v[size=xs]){margin-top:-0.1875rem;margin-bottom:-0.1875rem}:host(.cat-button-pull-t[size=xs]){margin-top:-0.1875rem}:host(.cat-button-pull-l[size=xs]){margin-left:-0.25rem}:host(.cat-button-pull-b[size=xs]){margin-bottom:-0.1875rem}:host(.cat-button-pull-r[size=xs]){margin-right:-0.25rem}.cat-button-s{min-width:2rem;padding:0.375rem 0.5rem;font-size:0.9375rem;line-height:1.25rem;gap:0.25rem}.cat-button-s cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-s.cat-button-icon{width:2rem;height:2rem;padding:0}:host(.cat-button-pull[size=s]){margin:-0.375rem -0.5rem}:host(.cat-button-pull-h[size=s]){margin-left:-0.5rem;margin-right:-0.5rem}:host(.cat-button-pull-v[size=s]){margin-top:-0.375rem;margin-bottom:-0.375rem}:host(.cat-button-pull-t[size=s]){margin-top:-0.375rem}:host(.cat-button-pull-l[size=s]){margin-left:-0.5rem}:host(.cat-button-pull-b[size=s]){margin-bottom:-0.375rem}:host(.cat-button-pull-r[size=s]){margin-right:-0.5rem}.cat-button-m{min-width:2.5rem;padding:0.625rem 0.75rem;font-size:0.9375rem;line-height:1.25rem;gap:0.25rem}.cat-button-m cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-m.cat-button-icon{width:2.5rem;height:2.5rem;padding:0}:host(.cat-button-pull[size=m]){margin:-0.625rem -0.75rem}:host(.cat-button-pull-h[size=m]){margin-left:-0.75rem;margin-right:-0.75rem}:host(.cat-button-pull-v[size=m]){margin-top:-0.625rem;margin-bottom:-0.625rem}:host(.cat-button-pull-t[size=m]){margin-top:-0.625rem}:host(.cat-button-pull-l[size=m]){margin-left:-0.75rem}:host(.cat-button-pull-b[size=m]){margin-bottom:-0.625rem}:host(.cat-button-pull-r[size=m]){margin-right:-0.75rem}.cat-button-l{min-width:3rem;padding:0.875rem 1rem;font-size:0.9375rem;line-height:1.25rem;gap:0.25rem}.cat-button-l cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-l.cat-button-icon{width:3rem;height:3rem;padding:0}:host(.cat-button-pull[size=l]){margin:-0.875rem -1rem}:host(.cat-button-pull-h[size=l]){margin-left:-1rem;margin-right:-1rem}:host(.cat-button-pull-v[size=l]){margin-top:-0.875rem;margin-bottom:-0.875rem}:host(.cat-button-pull-t[size=l]){margin-top:-0.875rem}:host(.cat-button-pull-l[size=l]){margin-left:-1rem}:host(.cat-button-pull-b[size=l]){margin-bottom:-0.875rem}:host(.cat-button-pull-r[size=l]){margin-right:-1rem}.cat-button-xl{min-width:3.5rem;padding:1rem 1.25rem;font-size:1.125rem;line-height:1.5rem;gap:0.25rem}.cat-button-xl.cat-button-icon{width:3.5rem;height:3.5rem;padding:0}:host(.cat-button-pull[size=xl]){margin:-1rem -1.25rem}:host(.cat-button-pull-h[size=xl]){margin-left:-1.25rem;margin-right:-1.25rem}:host(.cat-button-pull-v[size=xl]){margin-top:-1rem;margin-bottom:-1rem}:host(.cat-button-pull-t[size=xl]){margin-top:-1rem}:host(.cat-button-pull-l[size=xl]){margin-left:-1.25rem}:host(.cat-button-pull-b[size=xl]){margin-bottom:-1rem}:host(.cat-button-pull-r[size=xl]){margin-right:-1.25rem}:host(.cat-tab)::part(button){padding:1.125rem 0.75rem;--cat-secondary-bg:transparent;--cat-primary-text:transparent;--cat-danger-text:transparent}:host(.cat-tab)::part(content)::before{content:attr(data-text);content:attr(data-text)/\"\";height:0;visibility:hidden;overflow:hidden;user-select:none;pointer-events:none;font-weight:700}:host(.cat-text-left) .cat-button{justify-content:left}:host(.cat-text-right) .cat-button{justify-content:right}:host(.cat-nav-item){width:100%}:host(.cat-nav-item) .cat-button{box-shadow:none;justify-content:left;gap:0.5rem}:host(.cat-nav-item) .cat-button:focus-visible{outline-offset:-2px}:host(.cat-time-format) .cat-button{border-radius:0}:host(.cat-date-toggle) .cat-button,:host(.cat-time-toggle) .cat-button{margin-left:-1px;border-top-left-radius:0;border-bottom-left-radius:0}:host(.cat-date-item) .cat-button:hover,:host(.cat-date-toggle) .cat-button:hover,:host(.cat-time-format) .cat-button:hover,:host(.cat-time-toggle) .cat-button:hover{z-index:1}:host(.cat-date-item) .cat-button:focus-visible,:host(.cat-date-toggle) .cat-button:focus-visible,:host(.cat-time-format) .cat-button:focus-visible,:host(.cat-time-toggle) .cat-button:focus-visible{z-index:2}:host(.cat-date-item) .cat-button{padding:0;min-width:2rem;max-height:3rem;aspect-ratio:1}:host(.date-start:not(.date-end)) .cat-button{border-top-right-radius:0;border-bottom-right-radius:0}:host(.date-end:not(.date-start)) .cat-button{border-top-left-radius:0;border-bottom-left-radius:0}";
|
|
1046
1046
|
const CatButtonStyle0 = catButtonCss;
|
|
1047
1047
|
|
|
1048
1048
|
const CatButton = class {
|
|
@@ -1448,7 +1448,7 @@ function clampDate(min, date, max) {
|
|
|
1448
1448
|
return new Date(Math.min(Math.max(date.getTime(), min?.getTime() ?? -Infinity), max?.getTime() ?? Infinity));
|
|
1449
1449
|
}
|
|
1450
1450
|
|
|
1451
|
-
const catDateCss = ":host{display:block}:host([hidden]){display:none}.label-aria{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}cat-date-inline{margin:1rem}";
|
|
1451
|
+
const catDateCss = ":host{display:block}:host([hidden]){display:none}.label-aria{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}cat-date-inline{margin:1rem;width:20rem}";
|
|
1452
1452
|
const CatDateStyle0 = catDateCss;
|
|
1453
1453
|
|
|
1454
1454
|
const CatDate = class {
|
|
@@ -1550,7 +1550,7 @@ const CatDate = class {
|
|
|
1550
1550
|
}, onCatBlur: e => {
|
|
1551
1551
|
e.stopPropagation();
|
|
1552
1552
|
this.onInputBlur(e.detail);
|
|
1553
|
-
} }, h("span", { key: '68ef0708d25128b9a52d60c5b1a7b34e0ffb2ef1', slot: "label" }, this.label, h("span", { key: 'ac017335567a4e0059631e7535455d52f61f2e43', class: "label-aria" }, " (", this.locale.formatStr, ")")), h("cat-dropdown", { key: '16a6e95f6e4f6a9b0ddd7716f0b713c8fac3fdff', slot: "addon", placement: this.placement, arrowNavigation: "none", noResize: true, onCatOpen: () => this.dateInline?.resetView() }, h("cat-button", { key: 'cf7f2aaa2c5775b23f3e8826e9b0e722c4ce8be6', slot: "trigger", icon: "$cat:datepicker-calendar", iconOnly: true, class: "cat-date-toggle", disabled: this.disabled, a11yLabel: this.getTriggerA11yLabel() }), h("div", { key: 'f90eef976a3102855801df5ffeee770d45e7eaba', slot: "content" }, h("cat-date-inline", { key: '
|
|
1553
|
+
} }, h("span", { key: '68ef0708d25128b9a52d60c5b1a7b34e0ffb2ef1', slot: "label" }, this.label, h("span", { key: 'ac017335567a4e0059631e7535455d52f61f2e43', class: "label-aria" }, " (", this.locale.formatStr, ")")), h("cat-dropdown", { key: '16a6e95f6e4f6a9b0ddd7716f0b713c8fac3fdff', slot: "addon", placement: this.placement, arrowNavigation: "none", noResize: true, onCatOpen: () => this.dateInline?.resetView() }, h("cat-button", { key: 'cf7f2aaa2c5775b23f3e8826e9b0e722c4ce8be6', slot: "trigger", icon: "$cat:datepicker-calendar", iconOnly: true, class: "cat-date-toggle", disabled: this.disabled, a11yLabel: this.getTriggerA11yLabel() }), h("div", { key: 'f90eef976a3102855801df5ffeee770d45e7eaba', slot: "content" }, h("cat-date-inline", { key: '2a0ee2889e1077a6e403458bd3e114396590d0ed', ref: el => (this.dateInline = el), min: this.min, max: this.max, value: this.value, hint: true, weeks: true, noClear: true, onCatChange: this.onDateChange.bind(this) }))))));
|
|
1554
1554
|
}
|
|
1555
1555
|
getTriggerA11yLabel() {
|
|
1556
1556
|
const date = this.locale.fromLocalISO(this.value);
|
|
@@ -1624,7 +1624,7 @@ const CatDate = class {
|
|
|
1624
1624
|
};
|
|
1625
1625
|
CatDate.style = CatDateStyle0;
|
|
1626
1626
|
|
|
1627
|
-
const catDateInlineCss = ":host{display:
|
|
1627
|
+
const catDateInlineCss = "/**\n * Auto-generated file. Do not edit directly.\n */\n/* stylelint-disable value-keyword-case */\n/* stylelint-enable value-keyword-case */\n:host {\n display: block;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n.picker {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n}\n\n.picker-head {\n display: flex;\n align-items: center;\n container-type: inline-size;\n}\n.picker-head > :not(:last-child) {\n margin-right: 0.25rem;\n}\n.picker-head h3 {\n font-size: 0.9375rem;\n line-height: 1.25rem;\n font-weight: var(--cat-font-weight-head, 600);\n font-feature-settings: \"pnum\";\n flex: 1;\n text-align: center;\n margin-block: 0;\n}\n@container (min-width: 20rem) {\n .picker-head h3 {\n font-size: 1.125rem;\n line-height: 1.5rem;\n font-weight: var(--cat-font-weight-head, 600);\n font-feature-settings: \"pnum\";\n }\n .picker-head > :not(:last-child) {\n margin-right: 0.5rem;\n }\n}\n\n.picker-grid {\n display: grid;\n /* stylelint-disable declaration-block-no-redundant-longhand-properties */\n grid-template-rows: 2rem repeat(6, 1fr);\n grid-template-columns: repeat(7, 1fr);\n grid-template-areas: \"h h h h h h h\" \"d d d d d d d\" \"d d d d d d d\" \"d d d d d d d\" \"d d d d d d d\" \"d d d d d d d\" \"d d d d d d d\";\n /* stylelint-enable declaration-block-no-redundant-longhand-properties */\n}\n.picker-weeks .picker-grid {\n /* stylelint-disable declaration-block-no-redundant-longhand-properties */\n grid-template-columns: 2rem repeat(7, 1fr);\n grid-template-areas: \". h h h h h h h\" \"w d d d d d d d\" \"w d d d d d d d\" \"w d d d d d d d\" \"w d d d d d d d\" \"w d d d d d d d\" \"w d d d d d d d\";\n /* stylelint-enable declaration-block-no-redundant-longhand-properties */\n}\n\n.picker-grid-head {\n grid-area: h;\n display: grid;\n grid-template-columns: repeat(7, 1fr);\n place-items: end center;\n padding-bottom: 0.5rem;\n}\n\n.picker-grid-weeks {\n grid-area: w;\n display: grid;\n grid-template-rows: repeat(6, 1fr);\n place-items: center right;\n padding-right: 0.5rem;\n}\n\n.picker-grid-days {\n grid-area: d;\n display: grid;\n grid-template-rows: repeat(6, 1fr);\n grid-template-columns: repeat(7, 1fr);\n}\n\n.picker-grid-head > *,\n.picker-grid-weeks > * {\n font-size: 0.75rem;\n line-height: 1rem;\n font-weight: 600;\n color: rgb(var(--cat-font-color-muted, 81, 92, 108)) !important;\n text-decoration: none;\n}\n\n.date-other {\n opacity: 0.5;\n}\n\n.date-disabled {\n opacity: 0.25;\n}\n\n.picker-foot {\n display: flex;\n align-items: center;\n width: min-content;\n min-width: 100%;\n justify-content: space-between;\n container-type: inline-size;\n}\n.picker-foot > :not(:last-child) {\n margin-right: 0.25rem;\n}\n@container (min-width: 20rem) {\n .picker-foot > :not(:last-child) {\n margin-right: 0.5rem;\n }\n .picker-foot .cursor-help {\n font-size: 0.875rem;\n line-height: 1.125rem;\n font-weight: var(--cat-font-weight-body, 400);\n }\n}\n\n.cursor-help {\n margin-block: 0;\n font-size: 0.75rem;\n line-height: 1rem;\n font-weight: var(--cat-font-weight-body, 400);\n color: rgb(var(--cat-font-color-muted, 81, 92, 108)) !important;\n text-align: center;\n flex: 1;\n}\n.cursor-help:first-child {\n text-align: left;\n}\n.cursor-help:last-child {\n text-align: right;\n}\n.cursor-help:only-child {\n text-align: center;\n}\n\n.cursor-aria {\n position: absolute !important;\n width: 1px !important;\n height: 1px !important;\n padding: 0 !important;\n margin: -1px !important;\n overflow: hidden !important;\n clip: rect(0, 0, 0, 0) !important;\n white-space: nowrap !important;\n border: 0 !important;\n}\n\n.date-range {\n --cat-border-radius-m: 0;\n}";
|
|
1628
1628
|
const CatDateInlineStyle0 = catDateInlineCss;
|
|
1629
1629
|
|
|
1630
1630
|
const CatDateInline = class {
|
|
@@ -1637,10 +1637,9 @@ const CatDateInline = class {
|
|
|
1637
1637
|
this.focusDate = null;
|
|
1638
1638
|
this.viewDate = this.locale.now();
|
|
1639
1639
|
this.noClear = false;
|
|
1640
|
-
this.
|
|
1640
|
+
this.hint = false;
|
|
1641
1641
|
this.noToday = false;
|
|
1642
|
-
this.
|
|
1643
|
-
this.size = 'm';
|
|
1642
|
+
this.weeks = false;
|
|
1644
1643
|
this.min = undefined;
|
|
1645
1644
|
this.max = undefined;
|
|
1646
1645
|
this.range = false;
|
|
@@ -1748,9 +1747,9 @@ const CatDateInline = class {
|
|
|
1748
1747
|
const [minDate, maxDate] = this.getMinMaxDate();
|
|
1749
1748
|
const dateGrid = this.dateGrid(this.viewDate.getFullYear(), this.viewDate.getMonth());
|
|
1750
1749
|
const [dateStart, dateEnd] = this.getValue();
|
|
1751
|
-
return (h(Host, { key: '
|
|
1750
|
+
return (h(Host, { key: 'c48f887b0942699c3f319922df98b2d0f28851a0' }, h("div", { key: 'fb3eff378bb846effd327fb589d1e006cba78c87', class: { picker: true, 'picker-weeks': this.weeks } }, h("div", { key: '6b7b3c2d9ccbf8f5e247c4ddfa519e6e31a3a312', class: "picker-head" }, h("cat-button", { key: '755823de9dbee2dc7e52e1792d20ff3c56ccef8d', icon: "$cat:datepicker-year-prev", iconOnly: true, size: "xs", variant: "text", "a11y-label": this.locale.prevYear, disabled: isSameYear(this.viewDate, minDate), onClick: () => this.navigate('prev', 'year'), "data-dropdown-no-close": true }), h("cat-button", { key: '90e7420d4bc9c474d322d303413bc7e0bc4ac33d', icon: "$cat:datepicker-month-prev", iconOnly: true, size: "xs", variant: "text", "a11y-label": this.locale.prevMonth, disabled: isSameMonth(this.viewDate, minDate), onClick: () => this.navigate('prev', 'month'), "data-dropdown-no-close": true }), h("h3", { key: 'e6a39d6e56a360a14bd5db15d53d12b5743071fc' }, this.getHeadline()), h("cat-button", { key: '18bbfccbef72377967d96d1481196a0dfd1297fb', icon: "$cat:datepicker-month-next", iconOnly: true, size: "xs", variant: "text", "a11y-label": this.locale.nextMonth, disabled: isSameMonth(this.viewDate, maxDate), onClick: () => this.navigate('next', 'month'), "data-dropdown-no-close": true }), h("cat-button", { key: 'e0773fe064c5b70a59437b388e9c4877a4ff66cd', icon: "$cat:datepicker-year-next", iconOnly: true, size: "xs", variant: "text", "a11y-label": this.locale.nextYear, disabled: isSameYear(this.viewDate, maxDate), onClick: () => this.navigate('next', 'year'), "data-dropdown-no-close": true })), h("div", { key: 'f6d969e0cbfc0700f3db9931ab8087ea9cab9c30', class: "picker-grid", onFocusin: () => this.setAriaLive(this.locale.arrowKeys) }, h("div", { key: 'ecf39be602c6538f97ccbea7d5060c8e4b0b7f9f', class: "picker-grid-head" }, Array.from(Array(7), (_, i) => (h("abbr", { title: this.locale.days.long[i] }, this.locale.days.short[i])))), this.weeks && (h("div", { class: "picker-grid-weeks" }, dateGrid
|
|
1752
1751
|
.filter((_, i) => i % 7 === 0)
|
|
1753
|
-
.map(day => (h("div", null, this.getWeekNumber(day)))))), h("div", { key: '
|
|
1752
|
+
.map(day => (h("div", null, this.getWeekNumber(day)))))), h("div", { key: '1a8ace7365879688d6952bd68eaefe73b81683de', class: "picker-grid-days" }, dateGrid.map(day => {
|
|
1754
1753
|
const isStartDate = isSameDay(dateStart, day);
|
|
1755
1754
|
const isEndDate = isSameDay(dateEnd, day);
|
|
1756
1755
|
const isRange = !!dateStart && !!dateEnd && day > dateStart && day < dateEnd;
|
|
@@ -1764,8 +1763,8 @@ const CatDateInline = class {
|
|
|
1764
1763
|
'date-end': this.range && isEndDate,
|
|
1765
1764
|
'date-focusable': this.canFocus(day),
|
|
1766
1765
|
'date-disabled': !this.canClick(day)
|
|
1767
|
-
},
|
|
1768
|
-
}))), h("div", { key: '
|
|
1766
|
+
}, nativeAttributes: !this.canFocus(day) ? { tabindex: '-1' } : {}, variant: isStartDate || isEndDate ? 'filled' : isToday ? 'outlined' : 'text', a11yLabel: this.locale.toLocalStr(day), active: isStartDate || isEndDate || isRange, color: isStartDate || isEndDate || isToday ? 'primary' : 'secondary', disabled: !this.canClick(day), onClick: () => this.select(day), "data-date": this.locale.toLocalISO(day) }, day.getDate()));
|
|
1767
|
+
}))), h("div", { key: '62d01f9063d213411a12315637d4835cedb975e3', class: "picker-foot" }, !this.noToday && this.canClick(this.locale.now()) && (h("cat-button", { size: "s", "data-dropdown-no-close": true, onClick: () => this.select(this.locale.now()) }, this.locale.today)), this.hint && h("p", { class: "cursor-help" }, this.locale.arrowKeys), !this.noClear && (h("cat-button", { size: "s", disabled: !this.value, "data-dropdown-no-close": true, onClick: () => this.clear() }, this.locale.clear)))), h("p", { key: '5709adcbf7b1bb39ef9a2ae2525a28afc23c766d', class: "cursor-aria", "aria-live": "polite" })));
|
|
1769
1768
|
}
|
|
1770
1769
|
focus(date) {
|
|
1771
1770
|
const [minDate, maxDate] = this.getMinMaxDate();
|