@haiilo/catalyst 10.3.1 → 10.5.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/index.esm.js +1 -1
- package/dist/catalyst/index.esm.js.map +1 -1
- package/dist/catalyst/p-54544546.js +2 -0
- package/dist/catalyst/p-54544546.js.map +1 -0
- package/dist/catalyst/{p-8a1d505d.entry.js → p-66b41008.entry.js} +4 -4
- package/dist/catalyst/p-66b41008.entry.js.map +1 -0
- package/dist/cjs/{cat-alert_28.cjs.entry.js → cat-alert_29.cjs.entry.js} +269 -176
- package/dist/cjs/cat-alert_29.cjs.entry.js.map +1 -0
- package/dist/cjs/catalyst.cjs.js +1 -1
- package/dist/cjs/index.cjs.js +4 -1
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{of-45281229.js → of-8163b41f.js} +11 -3
- package/dist/cjs/of-8163b41f.js.map +1 -0
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/cat-button/cat-button.css +12 -2
- package/dist/collection/components/cat-date/cat-date.css +2 -96
- package/dist/collection/components/cat-date/cat-date.js +46 -254
- package/dist/collection/components/cat-date/cat-date.js.map +1 -1
- package/dist/collection/components/cat-date/cat-date.spec.js +2 -1
- package/dist/collection/components/cat-date/cat-date.spec.js.map +1 -1
- package/dist/collection/components/cat-date-inline/cat-date-inline.css +166 -0
- package/dist/collection/components/cat-date-inline/cat-date-inline.e2e.js +11 -0
- package/dist/collection/components/cat-date-inline/cat-date-inline.e2e.js.map +1 -0
- package/dist/collection/components/cat-date-inline/cat-date-inline.js +505 -0
- package/dist/collection/components/cat-date-inline/cat-date-inline.js.map +1 -0
- package/dist/collection/components/cat-date-inline/cat-date-inline.spec.js +16 -0
- package/dist/collection/components/cat-date-inline/cat-date-inline.spec.js.map +1 -0
- package/dist/collection/components/{cat-date → cat-date-inline}/cat-date-locale.js +22 -1
- package/dist/collection/components/cat-date-inline/cat-date-locale.js.map +1 -0
- package/dist/collection/components/cat-date-inline/cat-date-math.js.map +1 -0
- package/dist/collection/components/cat-datepicker/cat-datepicker.js +2 -2
- package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.js +2 -2
- package/dist/collection/components/cat-dropdown/cat-dropdown.js +5 -1
- package/dist/collection/components/cat-dropdown/cat-dropdown.js.map +1 -1
- package/dist/collection/components/cat-form-group/cat-form-group.js +4 -1
- package/dist/collection/components/cat-form-group/cat-form-group.js.map +1 -1
- package/dist/collection/components/cat-i18n/cat-i18n-registry.js +6 -0
- package/dist/collection/components/cat-i18n/cat-i18n-registry.js.map +1 -1
- package/dist/collection/components/cat-icon/cat-icon-registry.js +4 -2
- package/dist/collection/components/cat-icon/cat-icon-registry.js.map +1 -1
- package/dist/collection/components/cat-icon/cat-icon.js +1 -1
- package/dist/collection/components/cat-input/cat-input.js +4 -4
- package/dist/collection/components/cat-notification/cat-notification.js +3 -0
- package/dist/collection/components/cat-notification/cat-notification.js.map +1 -1
- package/dist/collection/components/cat-pagination/cat-pagination.js +2 -2
- package/dist/collection/components/cat-radio/cat-radio.js +1 -1
- package/dist/collection/components/cat-radio-group/cat-radio-group.js +1 -1
- package/dist/collection/components/cat-scrollable/cat-scrollable.js +3 -3
- package/dist/collection/components/cat-select-demo/cat-select-demo.js +1 -1
- package/dist/collection/components/cat-skeleton/cat-skeleton.js +1 -1
- package/dist/collection/components/cat-spinner/cat-spinner.js +2 -2
- package/dist/collection/components/cat-tab/cat-tab.js +1 -1
- package/dist/collection/components/cat-tabs/cat-tabs.js +1 -1
- package/dist/collection/components/cat-textarea/cat-textarea.js +3 -3
- package/dist/collection/components/cat-time/cat-time.js +4 -1
- package/dist/collection/components/cat-time/cat-time.js.map +1 -1
- package/dist/collection/components/cat-toggle/cat-toggle.js +1 -1
- package/dist/collection/components/cat-tooltip/cat-tooltip.js +7 -2
- package/dist/collection/components/cat-tooltip/cat-tooltip.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-inline.d.ts +11 -0
- package/dist/components/cat-date-inline.js +8 -0
- package/dist/components/cat-date-inline.js.map +1 -0
- package/dist/components/cat-date-inline2.js +386 -0
- package/dist/components/cat-date-inline2.js.map +1 -0
- package/dist/components/cat-date.js +50 -288
- package/dist/components/cat-date.js.map +1 -1
- package/dist/components/cat-datepicker-inline.js +2 -2
- package/dist/components/cat-datepicker.js +2 -2
- package/dist/components/cat-dropdown2.js +1 -1
- package/dist/components/cat-dropdown2.js.map +1 -1
- package/dist/components/cat-form-group.js +1 -1
- package/dist/components/cat-form-group.js.map +1 -1
- package/dist/components/cat-i18n-registry.js +6 -0
- package/dist/components/cat-i18n-registry.js.map +1 -1
- package/dist/components/cat-icon-registry.js +4 -2
- package/dist/components/cat-icon-registry.js.map +1 -1
- package/dist/components/cat-icon2.js +1 -1
- package/dist/components/cat-input2.js +4 -4
- package/dist/components/cat-pagination.js +2 -2
- package/dist/components/cat-radio-group.js +1 -1
- package/dist/components/cat-radio.js +1 -1
- package/dist/components/cat-scrollable2.js +3 -3
- package/dist/components/cat-select-demo.js +1 -1
- package/dist/components/cat-skeleton2.js +1 -1
- package/dist/components/cat-spinner2.js +2 -2
- package/dist/components/cat-tab.js +1 -1
- package/dist/components/cat-tabs.js +1 -1
- package/dist/components/cat-textarea.js +3 -3
- package/dist/components/cat-time.js +1 -1
- package/dist/components/cat-time.js.map +1 -1
- package/dist/components/cat-toggle.js +1 -1
- package/dist/components/cat-tooltip.js +2 -2
- package/dist/components/cat-tooltip.js.map +1 -1
- package/dist/components/index.js +3 -0
- package/dist/components/index.js.map +1 -1
- package/dist/esm/{cat-alert_28.entry.js → cat-alert_29.entry.js} +269 -177
- package/dist/esm/cat-alert_29.entry.js.map +1 -0
- package/dist/esm/catalyst.js +1 -1
- package/dist/esm/index.js +5 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{of-19888f3b.js → of-f4b9a3ca.js} +11 -3
- package/dist/esm/of-f4b9a3ca.js.map +1 -0
- package/dist/types/components/cat-date/cat-date.d.ts +8 -31
- package/dist/types/components/cat-date-inline/cat-date-inline.d.ts +81 -0
- package/dist/types/components/{cat-date → cat-date-inline}/cat-date-locale.d.ts +5 -0
- package/dist/types/components/cat-dropdown/cat-dropdown.d.ts +4 -0
- package/dist/types/components/cat-form-group/cat-form-group.d.ts +3 -0
- package/dist/types/components/cat-i18n/cat-i18n-registry.d.ts +6 -0
- package/dist/types/components/cat-icon/cat-icon-registry.d.ts +1 -0
- package/dist/types/components/cat-notification/cat-notification.d.ts +3 -0
- package/dist/types/components/cat-time/cat-time.d.ts +3 -0
- package/dist/types/components/cat-tooltip/cat-tooltip.d.ts +5 -0
- package/dist/types/components.d.ts +201 -5
- package/package.json +2 -2
- package/dist/catalyst/p-81800b65.js +0 -2
- package/dist/catalyst/p-81800b65.js.map +0 -1
- package/dist/catalyst/p-8a1d505d.entry.js.map +0 -1
- package/dist/cjs/cat-alert_28.cjs.entry.js.map +0 -1
- package/dist/cjs/of-45281229.js.map +0 -1
- package/dist/collection/components/cat-date/cat-date-locale.js.map +0 -1
- package/dist/collection/components/cat-date/cat-date-math.js.map +0 -1
- package/dist/esm/cat-alert_28.entry.js.map +0 -1
- package/dist/esm/of-19888f3b.js.map +0 -1
- /package/dist/collection/components/{cat-date → cat-date-inline}/cat-date-math.js +0 -0
- /package/dist/types/components/{cat-date → cat-date-inline}/cat-date-math.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
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,I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C,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 // select the initial value\n const [startDate, endDate] = this.getValue();\n this.select(startDate);\n if (this.range && endDate) {\n this.select(endDate);\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.toLocalStr(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,93 +1,13 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { g as getLocale, c as clampDate, d as defineCustomElement$6 } from './cat-date-inline2.js';
|
|
2
3
|
import { c as catI18nRegistry } from './cat-i18n-registry.js';
|
|
3
|
-
import { d as defineCustomElement$
|
|
4
|
+
import { d as defineCustomElement$7 } from './cat-button2.js';
|
|
4
5
|
import { d as defineCustomElement$5 } from './cat-dropdown2.js';
|
|
5
6
|
import { d as defineCustomElement$4 } from './cat-icon2.js';
|
|
6
7
|
import { d as defineCustomElement$3 } from './cat-input2.js';
|
|
7
8
|
import { d as defineCustomElement$2 } from './cat-spinner2.js';
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
const date = new Date();
|
|
11
|
-
const firstDayOfWeek = (date.getUTCDate() - date.getUTCDay() + 7) % 7;
|
|
12
|
-
const format = new Intl.DateTimeFormat(language, { weekday }).format;
|
|
13
|
-
return [...Array(7).keys()].map(day => format(new Date(date.getTime()).setUTCDate(firstDayOfWeek + day)));
|
|
14
|
-
}
|
|
15
|
-
function getMonths(language, month = 'long') {
|
|
16
|
-
const date = new Date(0);
|
|
17
|
-
const format = new Intl.DateTimeFormat(language, { month }).format;
|
|
18
|
-
return [...Array(12).keys()].map(month => format(new Date(date.getTime()).setUTCMonth(month)));
|
|
19
|
-
}
|
|
20
|
-
function getWeekInfo(language) {
|
|
21
|
-
const locale = new Intl.Locale(language);
|
|
22
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
23
|
-
const weekInfo = locale.getWeekInfo?.() ?? locale.weekInfo;
|
|
24
|
-
return {
|
|
25
|
-
firstDay: weekInfo?.firstDay ?? 1,
|
|
26
|
-
minDays: weekInfo?.minDays ?? 4,
|
|
27
|
-
weekend: weekInfo?.weekend ?? [6, 7]
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
function getFormat(language) {
|
|
31
|
-
const format = new Intl.DateTimeFormat(language, { year: 'numeric', month: '2-digit', day: '2-digit' })
|
|
32
|
-
.format(new Date(3456, 10, 22))
|
|
33
|
-
.replace('3456', 'YYYY')
|
|
34
|
-
.replace('56', 'YY')
|
|
35
|
-
.replace('11', 'MM')
|
|
36
|
-
.replace('22', 'DD');
|
|
37
|
-
return /^(YYYY|YY|MM|DD)\W(YYYY|YY|MM|DD)\W(YYYY|YY|MM|DD)$/.test(format) ? format : 'DD-MM-YYYY';
|
|
38
|
-
}
|
|
39
|
-
function getLocale(language) {
|
|
40
|
-
return {
|
|
41
|
-
prevYear: catI18nRegistry.t('datepicker.prevYear'),
|
|
42
|
-
nextYear: catI18nRegistry.t('datepicker.nextYear'),
|
|
43
|
-
prevMonth: catI18nRegistry.t('datepicker.prevMonth'),
|
|
44
|
-
nextMonth: catI18nRegistry.t('datepicker.nextMonth'),
|
|
45
|
-
arrowKeys: catI18nRegistry.t('datepicker.arrowKeys'),
|
|
46
|
-
today: catI18nRegistry.t('datepicker.today'),
|
|
47
|
-
change: catI18nRegistry.t('datepicker.change'),
|
|
48
|
-
choose: catI18nRegistry.t('datepicker.choose'),
|
|
49
|
-
formatStr: getFormat(language),
|
|
50
|
-
weekInfo: getWeekInfo(language),
|
|
51
|
-
days: {
|
|
52
|
-
short: getDays(language, 'short'),
|
|
53
|
-
long: getDays(language, 'long')
|
|
54
|
-
},
|
|
55
|
-
months: {
|
|
56
|
-
short: getMonths(language, 'short'),
|
|
57
|
-
long: getMonths(language, 'long')
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function isLeapYear(year) {
|
|
63
|
-
return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
|
|
64
|
-
}
|
|
65
|
-
function addDays(date, n) {
|
|
66
|
-
return new Date(date.getFullYear(), date.getMonth(), date.getDate() + n);
|
|
67
|
-
}
|
|
68
|
-
function addMonth(date, n) {
|
|
69
|
-
const [year, month, day] = [date.getFullYear(), date.getMonth(), date.getDate()];
|
|
70
|
-
const maxDays = [31, isLeapYear(year) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
71
|
-
const newDate = new Date(date);
|
|
72
|
-
newDate.setDate(1);
|
|
73
|
-
newDate.setMonth(newDate.getMonth() + n);
|
|
74
|
-
newDate.setDate(Math.min(day, maxDays[(month + (n % 12) + 12) % 12]));
|
|
75
|
-
return newDate;
|
|
76
|
-
}
|
|
77
|
-
function isSameYear(date1, date2) {
|
|
78
|
-
return !!date1 && !!date2 && date1.getFullYear() === date2.getFullYear();
|
|
79
|
-
}
|
|
80
|
-
function isSameMonth(date1, date2) {
|
|
81
|
-
return !!date1 && !!date2 && date1.getMonth() === date2.getMonth() && isSameYear(date1, date2);
|
|
82
|
-
}
|
|
83
|
-
function isSameDay(date1, date2) {
|
|
84
|
-
return !!date1 && !!date2 && date1.getDate() === date2.getDate() && isSameMonth(date1, date2);
|
|
85
|
-
}
|
|
86
|
-
function clampDate(min, date, max) {
|
|
87
|
-
return new Date(Math.min(Math.max(date.getTime(), min?.getTime() ?? -Infinity), max?.getTime() ?? Infinity));
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
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}.picker{padding:1rem;display:inline-flex;flex-direction:column}.picker-head{display:flex;gap:0.5rem;align-items:center}.picker-head h3{flex:1;text-align:center;margin:0}.picker-grid{display:grid;grid-template-rows:2rem repeat(6, 1fr);grid-template-columns:2rem repeat(7, 1fr);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\";margin:1rem 0 0.5rem}.picker-grid-head{grid-area:h;display:grid;grid-template-columns:repeat(7, 1fr);place-items:end center;padding-bottom:0.5rem}.picker-grid-weeks{grid-area:w;display:grid;grid-template-rows:repeat(6, 1fr);place-items:center right;padding-right:0.5rem}.picker-grid-days{grid-area:d;display:grid;grid-template-rows:repeat(6, 1fr);grid-template-columns:repeat(7, 1fr)}.picker-grid-head>*,.picker-grid-weeks>*{font-size:0.75rem;line-height:1rem;font-weight:600;color:rgb(var(--cat-font-color-muted, 81, 92, 108)) !important;text-decoration:none}.date-other{opacity:0.5}.date-disabled{opacity:0.25}.picker-foot{display:flex;gap:1rem;align-items:center}.cursor-help{flex:1;margin:0;font-size:0.875rem;line-height:1.125rem;font-weight:var(--cat-font-weight-body, 400);color:rgb(var(--cat-font-color-muted, 81, 92, 108)) !important;text-align:center}.cursor-help.cursor-right{text-align:right}.cursor-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}";
|
|
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}";
|
|
91
11
|
const CatDateStyle0 = catDateCss;
|
|
92
12
|
|
|
93
13
|
const CatDate$1 = /*@__PURE__*/ proxyCustomElement(class CatDate extends HTMLElement {
|
|
@@ -100,13 +20,8 @@ const CatDate$1 = /*@__PURE__*/ proxyCustomElement(class CatDate extends HTMLEle
|
|
|
100
20
|
this.catBlur = createEvent(this, "catBlur", 7);
|
|
101
21
|
this.language = catI18nRegistry.getLocale();
|
|
102
22
|
this.locale = getLocale(this.language);
|
|
103
|
-
this.isOpen = false;
|
|
104
|
-
// additonally store the focus date to ensure correct focus after potential re-render
|
|
105
|
-
this.focusDate = null;
|
|
106
23
|
this.hasSlottedLabel = false;
|
|
107
24
|
this.hasSlottedHint = false;
|
|
108
|
-
this.viewDate = this.now;
|
|
109
|
-
this.selectionDate = null;
|
|
110
25
|
this.requiredMarker = 'optional';
|
|
111
26
|
this.horizontal = false;
|
|
112
27
|
this.autoComplete = undefined;
|
|
@@ -132,29 +47,14 @@ const CatDate$1 = /*@__PURE__*/ proxyCustomElement(class CatDate extends HTMLEle
|
|
|
132
47
|
this.nativeAttributes = undefined;
|
|
133
48
|
this.placement = 'bottom-end';
|
|
134
49
|
}
|
|
135
|
-
get
|
|
136
|
-
const [y, m, d] = this.max?.split('-').map(Number) || [];
|
|
137
|
-
return this.max ? new Date(y, m - 1, d) : null;
|
|
138
|
-
}
|
|
139
|
-
get minDate() {
|
|
140
|
-
const [y, m, d] = this.min?.split('-').map(Number) || [];
|
|
141
|
-
return this.min ? new Date(y, m - 1, d) : null;
|
|
142
|
-
}
|
|
143
|
-
get now() {
|
|
144
|
-
const date = new Date();
|
|
145
|
-
return new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
|
146
|
-
}
|
|
147
|
-
get focusedDate() {
|
|
148
|
-
const [all, year, month, day] = this.hostElement.shadowRoot
|
|
149
|
-
?.querySelector(`[data-date]:focus`)
|
|
150
|
-
?.dataset.date?.match(/^(\d{4})-(\d{2})-(\d{2})/) ?? [];
|
|
151
|
-
return all ? new Date(Number(year), Number(month) - 1, Number(day)) : null;
|
|
152
|
-
}
|
|
153
|
-
componentWillLoad() {
|
|
50
|
+
get inputValue() {
|
|
154
51
|
const [match, year, month, day] = this.value?.match(/^(\d{4})-(\d{2})-(\d{2})/) ?? [];
|
|
155
52
|
if (match) {
|
|
156
|
-
|
|
53
|
+
const date = new Date(Number(year), Number(month) - 1, Number(day));
|
|
54
|
+
const format = new Intl.DateTimeFormat(this.language, { year: 'numeric', month: '2-digit', day: '2-digit' });
|
|
55
|
+
return format.format(date);
|
|
157
56
|
}
|
|
57
|
+
return '';
|
|
158
58
|
}
|
|
159
59
|
componentWillRender() {
|
|
160
60
|
this.hasSlottedLabel = !!this.hostElement.querySelector('[slot="label"]');
|
|
@@ -171,66 +71,6 @@ const CatDate$1 = /*@__PURE__*/ proxyCustomElement(class CatDate extends HTMLEle
|
|
|
171
71
|
datePattern: [p1, p2, p3]
|
|
172
72
|
});
|
|
173
73
|
}
|
|
174
|
-
componentDidRender() {
|
|
175
|
-
if (this.focusDate) {
|
|
176
|
-
this.hostElement.shadowRoot
|
|
177
|
-
?.querySelector(`[data-date="${this.toLocalISO(this.focusDate)}"]`)
|
|
178
|
-
?.doFocus();
|
|
179
|
-
this.focusDate = null;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
onOpen() {
|
|
183
|
-
this.isOpen = true;
|
|
184
|
-
this.setAriaLive('');
|
|
185
|
-
const viewDate = this.selectionDate
|
|
186
|
-
? new Date(this.selectionDate.getFullYear(), this.selectionDate.getMonth(), 1)
|
|
187
|
-
: this.now;
|
|
188
|
-
this.viewDate = clampDate(this.minDate, viewDate, this.maxDate);
|
|
189
|
-
}
|
|
190
|
-
onClose() {
|
|
191
|
-
this.isOpen = false;
|
|
192
|
-
}
|
|
193
|
-
onKeyDown(e) {
|
|
194
|
-
if (!this.isOpen || !['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'].includes(e.key)) {
|
|
195
|
-
return;
|
|
196
|
-
}
|
|
197
|
-
const focused = this.focusedDate;
|
|
198
|
-
if (!focused) {
|
|
199
|
-
e.preventDefault();
|
|
200
|
-
this.focus(this.selectionDate || this.now);
|
|
201
|
-
}
|
|
202
|
-
else if (e.key === 'ArrowLeft') {
|
|
203
|
-
e.preventDefault();
|
|
204
|
-
this.focus(e.shiftKey ? addMonth(focused, -1) : addDays(focused, -1));
|
|
205
|
-
}
|
|
206
|
-
else if (e.key === 'ArrowRight') {
|
|
207
|
-
e.preventDefault();
|
|
208
|
-
this.focus(e.shiftKey ? addMonth(focused, 1) : addDays(focused, 1));
|
|
209
|
-
}
|
|
210
|
-
else if (e.key === 'ArrowUp') {
|
|
211
|
-
e.preventDefault();
|
|
212
|
-
this.focus(addDays(focused, -7));
|
|
213
|
-
}
|
|
214
|
-
else if (e.key === 'ArrowDown') {
|
|
215
|
-
e.preventDefault();
|
|
216
|
-
this.focus(addDays(focused, 7));
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
/**
|
|
220
|
-
* Select a date in the picker.
|
|
221
|
-
*
|
|
222
|
-
* @param date The date to select.
|
|
223
|
-
*/
|
|
224
|
-
async select(date) {
|
|
225
|
-
const oldValue = this.value;
|
|
226
|
-
const newDate = clampDate(this.minDate, new Date(date.getFullYear(), date.getMonth(), date.getDate()), this.maxDate);
|
|
227
|
-
this.focus(newDate);
|
|
228
|
-
this.selectionDate = newDate;
|
|
229
|
-
this.value = newDate.toISOString();
|
|
230
|
-
if (oldValue !== this.value) {
|
|
231
|
-
this.catChange.emit(this.value);
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
74
|
/**
|
|
235
75
|
* Programmatically move focus to the input. Use this method instead of
|
|
236
76
|
* `input.focus()`.
|
|
@@ -255,136 +95,56 @@ const CatDate$1 = /*@__PURE__*/ proxyCustomElement(class CatDate extends HTMLEle
|
|
|
255
95
|
this.input?.clear();
|
|
256
96
|
}
|
|
257
97
|
render() {
|
|
258
|
-
|
|
259
|
-
return (h(Host, { key: 'ebb5f193ca43bc3306449c91d2e391cb25b3287c' }, h("cat-input", { key: '27292844d077a8d79022074a191c47e72736d2c5', class: "cat-date-input", ref: el => (this.input = el), requiredMarker: this.requiredMarker, horizontal: this.horizontal, autoComplete: this.autoComplete, clearable: this.clearable, disabled: this.disabled, hint: this.hint, icon: this.icon, iconRight: this.iconRight, identifier: this.identifier, labelHidden: this.labelHidden, name: this.name, placeholder: this.placeholder, textPrefix: this.textPrefix, textSuffix: this.textSuffix, readonly: this.readonly, required: this.required, errors: this.errors, errorUpdate: this.errorUpdate, nativeAttributes: this.nativeAttributes, value: this.getInputValue(), onCatFocus: e => this.catFocus.emit(e.detail), onCatBlur: e => this.onInputBlur(e.detail) }, h("span", { key: 'e9c9ad5b5374fcf944396a7ae45ae61775336be4', slot: "label" }, this.label, h("span", { key: '5a05917857fdc967bb122e0403f64b8b71ecf08a', class: "label-aria" }, " (", this.locale.formatStr, ")")), h("cat-dropdown", { key: 'ac1b7f5e1efae2648fa82acb31059ab41d0adb55', slot: "addon", placement: this.placement, arrowNavigation: "none", noResize: true }, h("cat-button", { key: 'bfaabd6f8120333b497b262894489628beb1d886', slot: "trigger", icon: "$cat:datepicker-calendar", iconOnly: true, class: "cat-date-toggle", disabled: this.disabled, a11yLabel: this.selectionDate
|
|
260
|
-
? `${this.locale.change}, ${this.getA11yLabelDay(this.selectionDate)}`
|
|
261
|
-
: this.locale.choose }), h("div", { key: '9cfb02ca034584dcdd23fadb5f41ca598552a605', class: "picker", slot: "content" }, h("div", { key: '4d09c5f3ca84346bbcc68f4c83f3413159b8b608', class: "picker-head" }, h("cat-button", { key: '9e8d1695f1a882f2388a2b57ccd8cc51e8b52483', icon: "$cat:datepicker-year-prev", iconOnly: true, size: "xs", variant: "text", "a11y-label": this.locale.prevYear, disabled: isSameYear(this.viewDate, this.minDate), onClick: () => this.navigate('prev', 'year'), "data-dropdown-no-close": true }), h("cat-button", { key: '5af1b092c2f0d13e5c12d49699e85ea5dded7580', icon: "$cat:datepicker-month-prev", iconOnly: true, size: "xs", variant: "text", "a11y-label": this.locale.prevMonth, disabled: isSameMonth(this.viewDate, this.minDate), onClick: () => this.navigate('prev', 'month'), "data-dropdown-no-close": true }), h("h3", { key: 'cd730386e0fc19a4b12ee2910e6de7f079133584' }, this.getHeadline()), h("cat-button", { key: 'f0c76ac04573977e255956d2e377dd197080a5b8', icon: "$cat:datepicker-month-next", iconOnly: true, size: "xs", variant: "text", "a11y-label": this.locale.nextMonth, disabled: isSameMonth(this.viewDate, this.maxDate), onClick: () => this.navigate('next', 'month'), "data-dropdown-no-close": true }), h("cat-button", { key: 'd58917e0665df029acc6dac35e7ab05eab60f9d4', icon: "$cat:datepicker-year-next", iconOnly: true, size: "xs", variant: "text", "a11y-label": this.locale.nextYear, disabled: isSameYear(this.viewDate, this.maxDate), onClick: () => this.navigate('next', 'year'), "data-dropdown-no-close": true })), h("div", { key: '5307170ba72c90fceef4276aa5feb74dc569c74d', class: "picker-grid", onFocusin: () => this.setAriaLive(this.locale.arrowKeys) }, h("div", { key: 'acd6b0e720722ed3e3d013463645fe294a75b68d', class: "picker-grid-head" }, Array.from(Array(7), (_, i) => (h("abbr", { title: this.locale.days.long[i] }, this.locale.days.short[i])))), h("div", { key: 'a8b349d48f3595b7a29a037fb48b130dfb9af438', class: "picker-grid-weeks" }, dateGrid
|
|
262
|
-
.filter((_, i) => i % 7 === 0)
|
|
263
|
-
.map(day => (h("div", null, this.getWeekNumber(day))))), h("div", { key: '1e7750157710763ad977d866bb2e511b6ec44d03', class: "picker-grid-days" }, dateGrid.map(day => (h("cat-button", { class: {
|
|
264
|
-
'cat-date-item': true,
|
|
265
|
-
'date-other': !isSameMonth(this.viewDate, day),
|
|
266
|
-
'date-today': isSameDay(this.now, day),
|
|
267
|
-
'date-selected': isSameDay(this.selectionDate, day),
|
|
268
|
-
'date-focusable': this.canFocus(day),
|
|
269
|
-
'date-disabled': !this.canClick(day)
|
|
270
|
-
}, nativeAttributes: !this.canFocus(day) ? { tabindex: '-1' } : {}, variant: isSameDay(this.selectionDate, day) ? 'filled' : isSameDay(this.now, day) ? 'outlined' : 'text', a11yLabel: this.getA11yLabelDay(day), active: isSameDay(this.selectionDate, day), color: isSameDay(this.selectionDate, day) || isSameDay(this.now, day) ? 'primary' : 'secondary', disabled: !this.canClick(day), onClick: () => this.select(day), "data-date": this.toLocalISO(day) }, day.getDate()))))), h("div", { key: 'd8874097357312b5ddd4bda5e4018d3e642aaf99', class: "picker-foot" }, this.canClick(this.now) && (h("cat-button", { size: "s", "data-dropdown-no-close": true, onClick: () => this.select(this.now) }, this.locale.today)), h("p", { key: '42d936d44ef0cb07375415ae42a95565cd7f342b', class: {
|
|
271
|
-
'cursor-help': true,
|
|
272
|
-
'cursor-right': this.canClick(this.now)
|
|
273
|
-
} }, this.locale.arrowKeys), h("p", { key: '6df5566486d5082b3c2cb79fde22cedd7608c8bf', class: "cursor-aria", "aria-live": "polite" })))))));
|
|
274
|
-
}
|
|
275
|
-
parse(value) {
|
|
276
|
-
const [, p1, d1, p2, p3] = /(\w+)([^\w]+)(\w+)[^\w]+(\w+)/.exec(this.locale.formatStr) || [];
|
|
277
|
-
const formatParts = [p1, p2, p3];
|
|
278
|
-
const parts = value.split(d1).map(s => Number(s || 'x'));
|
|
279
|
-
let year = parts[formatParts.indexOf('YYYY') || formatParts.indexOf('YY')] || this.now.getFullYear();
|
|
280
|
-
const month = parts[formatParts.indexOf('MM')];
|
|
281
|
-
const day = parts[formatParts.indexOf('DD')];
|
|
282
|
-
if (!Number.isInteger(month) || !Number.isInteger(day)) {
|
|
283
|
-
return null;
|
|
284
|
-
}
|
|
285
|
-
else if (year < 100) {
|
|
286
|
-
year += year < 50 ? 2000 : 1900;
|
|
287
|
-
}
|
|
288
|
-
return new Date(year, month - 1, day);
|
|
98
|
+
return (h(Host, { key: '6f8ed88396eb9932a91f26e1f32086a573f82add' }, h("cat-input", { key: 'e73ec2bceb1cd648e14d8917ebf7fb6c99079408', class: "cat-date-input", ref: el => (this.input = el), requiredMarker: this.requiredMarker, horizontal: this.horizontal, autoComplete: this.autoComplete, clearable: this.clearable, disabled: this.disabled, hint: this.hint, icon: this.icon, iconRight: this.iconRight, identifier: this.identifier, labelHidden: this.labelHidden, name: this.name, placeholder: this.placeholder, textPrefix: this.textPrefix, textSuffix: this.textSuffix, readonly: this.readonly, required: this.required, errors: this.errors, errorUpdate: this.errorUpdate, nativeAttributes: this.nativeAttributes, value: this.inputValue, onCatFocus: e => this.catFocus.emit(e.detail), onCatBlur: e => this.onInputBlur(e.detail) }, h("span", { key: '8fb02c395b64728db2a2f5d4896e3151b3dc5aec', slot: "label" }, this.label, h("span", { key: 'f08e83d369b1f35d45fb4c0b2c39a9ad52b68b77', class: "label-aria" }, " (", this.locale.formatStr, ")")), h("cat-dropdown", { key: '48ee8472fab9d59b511df69afbbc348aa7b04828', slot: "addon", placement: this.placement, arrowNavigation: "none", noResize: true, onCatOpen: () => this.dateInline?.resetView() }, h("cat-button", { key: 'b12ea88e170c2c8d916e9553b0bb205fae5e5d45', slot: "trigger", icon: "$cat:datepicker-calendar", iconOnly: true, class: "cat-date-toggle", disabled: this.disabled, a11yLabel: this.getTriggerA11yLabel() }), h("div", { key: '9173b680adcf83c32a7c10e818acbab188cfd979', slot: "content" }, h("cat-date-inline", { key: '997bc3bb5137d860893732234442feda61cd3d21', ref: el => (this.dateInline = el), min: this.min, max: this.max, value: this.value, noClear: true, onCatChange: this.onDateChange.bind(this) }))))));
|
|
289
99
|
}
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
this.hostElement.shadowRoot
|
|
294
|
-
?.querySelector(`[data-date="${this.toLocalISO(this.focusDate)}"]`)
|
|
295
|
-
?.doFocus();
|
|
296
|
-
}
|
|
297
|
-
navigate(direction, period) {
|
|
298
|
-
this.viewDate = new Date(direction === 'prev'
|
|
299
|
-
? period === 'year'
|
|
300
|
-
? this.viewDate.setFullYear(this.viewDate.getFullYear() - 1)
|
|
301
|
-
: this.viewDate.setMonth(this.viewDate.getMonth() - 1)
|
|
302
|
-
: period === 'year'
|
|
303
|
-
? this.viewDate.setFullYear(this.viewDate.getFullYear() + 1)
|
|
304
|
-
: this.viewDate.setMonth(this.viewDate.getMonth() + 1));
|
|
305
|
-
// announce the new month and year
|
|
306
|
-
this.setAriaLive(this.getHeadline());
|
|
307
|
-
}
|
|
308
|
-
setAriaLive(text) {
|
|
309
|
-
const node = this.hostElement.shadowRoot?.querySelector('.cursor-aria');
|
|
310
|
-
if (node) {
|
|
311
|
-
node.innerHTML = text;
|
|
312
|
-
}
|
|
100
|
+
getTriggerA11yLabel() {
|
|
101
|
+
const date = this.locale.fromLocalISO(this.value);
|
|
102
|
+
return date ? `${this.locale.change}, ${this.locale.toLocalStr(date)}` : this.locale.choose;
|
|
313
103
|
}
|
|
314
104
|
onInputBlur(e) {
|
|
315
105
|
if (!this.input) {
|
|
316
106
|
return;
|
|
317
107
|
}
|
|
318
108
|
const oldValue = this.value;
|
|
319
|
-
const
|
|
320
|
-
|
|
321
|
-
|
|
109
|
+
const dateParsed = this.parse(this.input.value ?? '');
|
|
110
|
+
const dateMin = this.locale.fromLocalISO(this.min);
|
|
111
|
+
const dateMax = this.locale.fromLocalISO(this.max);
|
|
112
|
+
const date = dateParsed ? clampDate(dateMin, dateParsed, dateMax) : null;
|
|
113
|
+
this.value = date ? this.locale.toLocalISO(date) : undefined;
|
|
322
114
|
if (oldValue !== this.value) {
|
|
115
|
+
if (date) {
|
|
116
|
+
this.dateInline?.select(date);
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
this.dateInline?.clear();
|
|
120
|
+
}
|
|
323
121
|
this.catChange.emit(this.value);
|
|
324
122
|
}
|
|
325
|
-
this.input.value = this.
|
|
123
|
+
this.input.value = this.inputValue;
|
|
326
124
|
this.catBlur.emit(e);
|
|
327
125
|
}
|
|
328
|
-
|
|
329
|
-
const
|
|
330
|
-
const
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
return [
|
|
335
|
-
...daysBefore.map(day => new Date(year, month - 1, day + 1)),
|
|
336
|
-
...days.map(day => new Date(year, month, day + 1)),
|
|
337
|
-
...daysAfter.map(day => new Date(year, month + 1, day + 1))
|
|
338
|
-
];
|
|
339
|
-
}
|
|
340
|
-
getHeadline() {
|
|
341
|
-
return `${this.locale.months.long[this.viewDate.getMonth()]} ${this.viewDate.getFullYear()}`;
|
|
342
|
-
}
|
|
343
|
-
getInputValue() {
|
|
344
|
-
const format = new Intl.DateTimeFormat(this.language, { year: 'numeric', month: '2-digit', day: '2-digit' });
|
|
345
|
-
return this.selectionDate ? format.format(this.selectionDate) : '';
|
|
346
|
-
}
|
|
347
|
-
getA11yLabelDay(date) {
|
|
348
|
-
const format = new Intl.DateTimeFormat(this.language, {
|
|
349
|
-
year: 'numeric',
|
|
350
|
-
month: 'long',
|
|
351
|
-
day: 'numeric',
|
|
352
|
-
weekday: 'long'
|
|
353
|
-
});
|
|
354
|
-
return format.format(date);
|
|
355
|
-
}
|
|
356
|
-
getWeekNumber(date, iso8601 = true) {
|
|
357
|
-
const currentDate = new Date(date.getTime());
|
|
358
|
-
const dayNum = iso8601 ? currentDate.getDay() || 7 : currentDate.getDay();
|
|
359
|
-
currentDate.setDate(currentDate.getDate() + 4 - dayNum);
|
|
360
|
-
const yearStart = new Date(currentDate.getFullYear(), 0, 1);
|
|
361
|
-
return Math.ceil(((+currentDate - +yearStart) / 86400000 + 1) / 7);
|
|
362
|
-
}
|
|
363
|
-
canFocus(date) {
|
|
364
|
-
const now = this.now;
|
|
365
|
-
const focused = this.focusedDate;
|
|
366
|
-
if (focused && isSameMonth(focused, this.viewDate)) {
|
|
367
|
-
return isSameMonth(focused, date) && isSameDay(focused, date);
|
|
126
|
+
onDateChange(e) {
|
|
127
|
+
const oldValue = this.value;
|
|
128
|
+
const date = e.detail ? new Date(e.detail) : null;
|
|
129
|
+
this.value = date ? this.locale.toLocalISO(date) : undefined;
|
|
130
|
+
if (oldValue !== this.value) {
|
|
131
|
+
this.catChange.emit(this.value);
|
|
368
132
|
}
|
|
369
|
-
|
|
370
|
-
|
|
133
|
+
}
|
|
134
|
+
parse(value) {
|
|
135
|
+
const [, p1, d1, p2, p3] = /(\w+)([^\w]+)(\w+)[^\w]+(\w+)/.exec(this.locale.formatStr) || [];
|
|
136
|
+
const formatParts = [p1, p2, p3];
|
|
137
|
+
const parts = value.split(d1).map(s => Number(s || 'x'));
|
|
138
|
+
let year = parts[formatParts.indexOf('YYYY') || formatParts.indexOf('YY')] || this.locale.now().getFullYear();
|
|
139
|
+
const month = parts[formatParts.indexOf('MM')];
|
|
140
|
+
const day = parts[formatParts.indexOf('DD')];
|
|
141
|
+
if (!Number.isInteger(month) || !Number.isInteger(day)) {
|
|
142
|
+
return null;
|
|
371
143
|
}
|
|
372
|
-
else if (
|
|
373
|
-
|
|
144
|
+
else if (year < 100) {
|
|
145
|
+
year += year < 50 ? 2000 : 1900;
|
|
374
146
|
}
|
|
375
|
-
|
|
376
|
-
return isSameMonth(this.viewDate, date) && date.getDate() === minDay;
|
|
377
|
-
}
|
|
378
|
-
canClick(date) {
|
|
379
|
-
const min = this.minDate;
|
|
380
|
-
const max = this.maxDate;
|
|
381
|
-
return (!min || min <= date) && (!max || max >= date);
|
|
382
|
-
}
|
|
383
|
-
toLocalISO(date) {
|
|
384
|
-
const year = date.getFullYear();
|
|
385
|
-
const month = (date.getMonth() + 1).toString().padStart(2, '0');
|
|
386
|
-
const day = date.getDate().toString().padStart(2, '0');
|
|
387
|
-
return `${year}-${month}-${day}`;
|
|
147
|
+
return new Date(year, month - 1, day);
|
|
388
148
|
}
|
|
389
149
|
get hostElement() { return this; }
|
|
390
150
|
static get style() { return CatDateStyle0; }
|
|
@@ -415,18 +175,15 @@ const CatDate$1 = /*@__PURE__*/ proxyCustomElement(class CatDate extends HTMLEle
|
|
|
415
175
|
"placement": [1],
|
|
416
176
|
"hasSlottedLabel": [32],
|
|
417
177
|
"hasSlottedHint": [32],
|
|
418
|
-
"viewDate": [32],
|
|
419
|
-
"selectionDate": [32],
|
|
420
|
-
"select": [64],
|
|
421
178
|
"doFocus": [64],
|
|
422
179
|
"doBlur": [64],
|
|
423
180
|
"clear": [64]
|
|
424
|
-
}
|
|
181
|
+
}]);
|
|
425
182
|
function defineCustomElement$1() {
|
|
426
183
|
if (typeof customElements === "undefined") {
|
|
427
184
|
return;
|
|
428
185
|
}
|
|
429
|
-
const components = ["cat-date", "cat-button", "cat-dropdown", "cat-icon", "cat-input", "cat-spinner"];
|
|
186
|
+
const components = ["cat-date", "cat-button", "cat-date-inline", "cat-dropdown", "cat-icon", "cat-input", "cat-spinner"];
|
|
430
187
|
components.forEach(tagName => { switch (tagName) {
|
|
431
188
|
case "cat-date":
|
|
432
189
|
if (!customElements.get(tagName)) {
|
|
@@ -434,6 +191,11 @@ function defineCustomElement$1() {
|
|
|
434
191
|
}
|
|
435
192
|
break;
|
|
436
193
|
case "cat-button":
|
|
194
|
+
if (!customElements.get(tagName)) {
|
|
195
|
+
defineCustomElement$7();
|
|
196
|
+
}
|
|
197
|
+
break;
|
|
198
|
+
case "cat-date-inline":
|
|
437
199
|
if (!customElements.get(tagName)) {
|
|
438
200
|
defineCustomElement$6();
|
|
439
201
|
}
|