@haiilo/catalyst 13.0.0 → 13.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/catalyst/catalyst.esm.js +1 -1
  2. package/dist/catalyst/p-bbf8cfa7.entry.js +10 -0
  3. package/dist/catalyst/p-bbf8cfa7.entry.js.map +1 -0
  4. package/dist/catalyst/scss/_snippets/_form-label.scss +4 -0
  5. package/dist/cjs/cat-alert_30.cjs.entry.js +30 -54
  6. package/dist/cjs/cat-alert_30.cjs.entry.js.map +1 -1
  7. package/dist/cjs/catalyst.cjs.js +1 -1
  8. package/dist/cjs/loader.cjs.js +1 -1
  9. package/dist/collection/components/cat-checkbox/cat-checkbox.css +5 -0
  10. package/dist/collection/components/cat-date/cat-date.js +27 -10
  11. package/dist/collection/components/cat-date/cat-date.js.map +1 -1
  12. package/dist/collection/components/cat-date-inline/cat-date-inline.css +5 -0
  13. package/dist/collection/components/cat-datepicker/cat-datepicker.js +28 -11
  14. package/dist/collection/components/cat-datepicker/cat-datepicker.js.map +1 -1
  15. package/dist/collection/components/cat-form-group/cat-form-group.js +3 -3
  16. package/dist/collection/components/cat-form-group/cat-form-group.js.map +1 -1
  17. package/dist/collection/components/cat-input/cat-input.css +5 -0
  18. package/dist/collection/components/cat-input/cat-input.js +30 -13
  19. package/dist/collection/components/cat-input/cat-input.js.map +1 -1
  20. package/dist/collection/components/cat-select/cat-select.css +5 -0
  21. package/dist/collection/components/cat-select/cat-select.js +30 -13
  22. package/dist/collection/components/cat-select/cat-select.js.map +1 -1
  23. package/dist/collection/components/cat-tag/cat-tag.css +5 -0
  24. package/dist/collection/components/cat-textarea/cat-textarea.css +5 -0
  25. package/dist/collection/components/cat-textarea/cat-textarea.js +29 -12
  26. package/dist/collection/components/cat-textarea/cat-textarea.js.map +1 -1
  27. package/dist/collection/components/cat-time/cat-time.js +27 -10
  28. package/dist/collection/components/cat-time/cat-time.js.map +1 -1
  29. package/dist/collection/scss/_snippets/_form-label.scss +4 -0
  30. package/dist/components/cat-checkbox2.js +1 -1
  31. package/dist/components/cat-checkbox2.js.map +1 -1
  32. package/dist/components/cat-date-inline2.js +1 -1
  33. package/dist/components/cat-date-inline2.js.map +1 -1
  34. package/dist/components/cat-date.js +3 -6
  35. package/dist/components/cat-date.js.map +1 -1
  36. package/dist/components/cat-datepicker.js +4 -7
  37. package/dist/components/cat-datepicker.js.map +1 -1
  38. package/dist/components/cat-form-group.js +3 -3
  39. package/dist/components/cat-form-group.js.map +1 -1
  40. package/dist/components/cat-input2.js +7 -10
  41. package/dist/components/cat-input2.js.map +1 -1
  42. package/dist/components/cat-select2.js +7 -10
  43. package/dist/components/cat-select2.js.map +1 -1
  44. package/dist/components/cat-tag.js +1 -1
  45. package/dist/components/cat-tag.js.map +1 -1
  46. package/dist/components/cat-textarea.js +6 -9
  47. package/dist/components/cat-textarea.js.map +1 -1
  48. package/dist/components/cat-time.js +3 -6
  49. package/dist/components/cat-time.js.map +1 -1
  50. package/dist/esm/cat-alert_30.entry.js +30 -54
  51. package/dist/esm/cat-alert_30.entry.js.map +1 -1
  52. package/dist/esm/catalyst.js +1 -1
  53. package/dist/esm/loader.js +1 -1
  54. package/dist/types/components/cat-date/cat-date.d.ts +6 -1
  55. package/dist/types/components/cat-datepicker/cat-datepicker.d.ts +6 -1
  56. package/dist/types/components/cat-input/cat-input.d.ts +6 -1
  57. package/dist/types/components/cat-select/cat-select.d.ts +6 -1
  58. package/dist/types/components/cat-textarea/cat-textarea.d.ts +6 -1
  59. package/dist/types/components/cat-time/cat-time.d.ts +6 -1
  60. package/dist/types/components.d.ts +30 -6
  61. package/package.json +2 -2
  62. package/dist/catalyst/p-02e41ad7.entry.js +0 -10
  63. package/dist/catalyst/p-02e41ad7.entry.js.map +0 -1
@@ -1 +1 @@
1
- {"file":"cat-date-inline2.js","mappings":";;;;;;;AAEA,SAAS,OAAO,CAAC,QAAgB,EAAE,UAAuC,MAAM,EAAA;AA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;IAI/C,YAAY,CAAC,SAAsB,EAAE,OAAoB,EAAA;AAC/D,QAAA,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["i18n","__stencil_proxyCustomElement"],"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 format = new Intl.DateTimeFormat(language, { weekday }).format;\n return [...Array(7).keys()].map(day => format(new Date(2000, 4, 14 + day)));\n}\n\nfunction getMonths(language: string, month: 'long' | 'short' = 'long') {\n const format = new Intl.DateTimeFormat(language, { month }).format;\n return [...Array(12).keys()].map(month => format(new Date(2000, month, 15)));\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@use '_snippets/form-label';\n\n:host {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n.label-hidden,\n.label-container:empty {\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';\nimport firstTabbable from '../../utils/first-tabbable';\n\nlet nextUniqueId = 0;\n\n/**\n * An inline date picker component to select a date.\n *\n * @part label - The native label element.\n */\n@Component({\n tag: 'cat-date-inline',\n styleUrl: 'cat-date-inline.scss',\n shadow: {\n delegatesFocus: true\n }\n})\nexport class CatDateInline {\n private readonly _id = `cat-date-inline-${nextUniqueId++}`;\n private get id() {\n return this.identifier || this._id;\n }\n\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() hasSlottedLabel = false;\n @State() hasSlottedHint = false;\n\n @State() viewDate: Date = this.locale.now();\n\n /**\n * Hides the clear button.\n */\n @Prop() noClear = false;\n\n /**\n * A unique identifier for the input.\n */\n @Prop() identifier?: string;\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 * 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 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 * A value is required or must be check for the form to be submittable.\n */\n @Prop() required = false;\n\n /**\n * Adds accessible label for the datepicker. The label will be read by\n * assistive technology upon focusing the datepicker.\n */\n @Prop({ attribute: 'a11y-label' }) a11yLabel?: string;\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 * 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, false);\n } else if (startDate) {\n this.focus(startDate, false);\n }\n this.hostElement.addEventListener('focusin', () => this.setAriaLive(this.a11yLabel));\n }\n\n componentWillRender(): void {\n this.hasSlottedLabel = !!this.hostElement.querySelector('[slot=\"label\"]');\n this.hasSlottedHint = !!this.hostElement.querySelector('[slot=\"hint\"]');\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 /**\n * Programmatically move focus to the inline datepicker, i,e, the first\n * focusable date.\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 firstTabbable(this.hostElement.shadowRoot?.querySelector('.picker-grid-days'))?.focus(options);\n }\n\n render() {\n this.hostElement.tabIndex = Number(this.hostElement.getAttribute('tabindex')) || 0;\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 aria-label={this.label || undefined}>\n <div class={{ 'label-container': true, 'label-hidden': this.labelHidden }}>\n {(this.hasSlottedLabel || this.label) && (\n <label id={`${this.id}-label`} htmlFor={this.id} part=\"label\" onClick={() => this.doFocus()}>\n <span class=\"label-wrapper\">\n {(this.hasSlottedLabel && <slot name=\"label\"></slot>) || this.label}\n <div class=\"label-metadata\">\n {!this.required && (this.requiredMarker ?? 'optional').startsWith('optional') && (\n <span class=\"label-optional\" aria-hidden=\"true\">\n ({i18n.t('input.optional')})\n </span>\n )}\n {this.required && this.requiredMarker?.startsWith('required') && (\n <span class=\"label-optional\" aria-hidden=\"true\">\n ({i18n.t('input.required')})\n </span>\n )}\n </div>\n </span>\n </label>\n )}\n </div>\n <div class={{ picker: true, 'picker-weeks': this.weeks }} id={this.id} aria-describedby={`${this.id}-label`}>\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 const day = (i + this.locale.weekInfo.firstDay) % 7;\n return <abbr title={this.locale.days.long[day]}>{this.locale.days.short[day]}</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 const isWeekend = this.locale.weekInfo.weekend.includes(day.getDay() || 7);\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-weekend': isWeekend,\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, focus = true) {\n const [minDate, maxDate] = this.getMinMaxDate();\n const focusDate = clampDate(minDate, date, maxDate);\n this.viewDate = new Date(focusDate.getFullYear(), focusDate.getMonth());\n if (focus) {\n this.focusDate = focusDate;\n this.hostElement.shadowRoot\n ?.querySelector<HTMLCatButtonElement>(`[data-date=\"${this.locale.toLocalISO(focusDate)}\"]`)\n ?.doFocus();\n }\n }\n\n private navigate(direction: 'prev' | 'next', period: 'year' | 'month') {\n const offset = direction === 'prev' ? -1 : 1;\n const targetYear = this.viewDate.getFullYear() + (period === 'year' ? offset : 0);\n const targetMonth = this.viewDate.getMonth() + (period === 'month' ? offset : 0);\n\n const date = new Date(this.viewDate);\n date.setFullYear(targetYear);\n date.setMonth(targetMonth);\n\n const minDate = new Date(targetYear, targetMonth, 1);\n const maxDay = new Date(targetYear, targetMonth + 1, 0).getDate();\n const maxDate = new Date(targetYear, targetMonth, maxDay);\n this.viewDate = clampDate(minDate, date, maxDate);\n this.setAriaLive(this.getHeadline());\n }\n\n private setAriaLive(text?: string) {\n const node = this.hostElement.shadowRoot?.querySelector('.cursor-aria');\n if (node && text) {\n node.innerHTML = text;\n }\n }\n\n private dateGrid(year: number, month: number) {\n const daysOffset = (new Date(year, month, 1).getDay() - this.locale.weekInfo.firstDay + 7) % 7;\n const daysInMonth = new Date(year, month + 1, 0).getDate();\n const days = [...Array(daysInMonth).keys()];\n const daysBefore = this.getLastDaysOfMonth(year, month, daysOffset);\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 getLastDaysOfMonth(year: number, month: number, x: number): number[] {\n const lastDayOfMonth = new Date(year, month, 0).getDate();\n const daysOfMonth = Array.from({ length: lastDayOfMonth }, (_, index) => index);\n return x ? daysOfMonth.slice(-x) : [];\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,EAAA;AAC9E,IAAA,MAAM,MAAM,GAAG,IA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E,OAAoB,EAAA;AAC/D,QAAA,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["i18n","__stencil_proxyCustomElement"],"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 format = new Intl.DateTimeFormat(language, { weekday }).format;\n return [...Array(7).keys()].map(day => format(new Date(2000, 4, 14 + day)));\n}\n\nfunction getMonths(language: string, month: 'long' | 'short' = 'long') {\n const format = new Intl.DateTimeFormat(language, { month }).format;\n return [...Array(12).keys()].map(month => format(new Date(2000, month, 15)));\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@use '_snippets/form-label';\n\n:host {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n.label-hidden,\n.label-container:empty {\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';\nimport firstTabbable from '../../utils/first-tabbable';\n\nlet nextUniqueId = 0;\n\n/**\n * An inline date picker component to select a date.\n *\n * @part label - The native label element.\n */\n@Component({\n tag: 'cat-date-inline',\n styleUrl: 'cat-date-inline.scss',\n shadow: {\n delegatesFocus: true\n }\n})\nexport class CatDateInline {\n private readonly _id = `cat-date-inline-${nextUniqueId++}`;\n private get id() {\n return this.identifier || this._id;\n }\n\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() hasSlottedLabel = false;\n @State() hasSlottedHint = false;\n\n @State() viewDate: Date = this.locale.now();\n\n /**\n * Hides the clear button.\n */\n @Prop() noClear = false;\n\n /**\n * A unique identifier for the input.\n */\n @Prop() identifier?: string;\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 * 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 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 * A value is required or must be check for the form to be submittable.\n */\n @Prop() required = false;\n\n /**\n * Adds accessible label for the datepicker. The label will be read by\n * assistive technology upon focusing the datepicker.\n */\n @Prop({ attribute: 'a11y-label' }) a11yLabel?: string;\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 * 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, false);\n } else if (startDate) {\n this.focus(startDate, false);\n }\n this.hostElement.addEventListener('focusin', () => this.setAriaLive(this.a11yLabel));\n }\n\n componentWillRender(): void {\n this.hasSlottedLabel = !!this.hostElement.querySelector('[slot=\"label\"]');\n this.hasSlottedHint = !!this.hostElement.querySelector('[slot=\"hint\"]');\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 /**\n * Programmatically move focus to the inline datepicker, i,e, the first\n * focusable date.\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 firstTabbable(this.hostElement.shadowRoot?.querySelector('.picker-grid-days'))?.focus(options);\n }\n\n render() {\n this.hostElement.tabIndex = Number(this.hostElement.getAttribute('tabindex')) || 0;\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 aria-label={this.label || undefined}>\n <div class={{ 'label-container': true, 'label-hidden': this.labelHidden }}>\n {(this.hasSlottedLabel || this.label) && (\n <label id={`${this.id}-label`} htmlFor={this.id} part=\"label\" onClick={() => this.doFocus()}>\n <span class=\"label-wrapper\">\n {(this.hasSlottedLabel && <slot name=\"label\"></slot>) || this.label}\n <div class=\"label-metadata\">\n {!this.required && (this.requiredMarker ?? 'optional').startsWith('optional') && (\n <span class=\"label-optional\" aria-hidden=\"true\">\n ({i18n.t('input.optional')})\n </span>\n )}\n {this.required && this.requiredMarker?.startsWith('required') && (\n <span class=\"label-optional\" aria-hidden=\"true\">\n ({i18n.t('input.required')})\n </span>\n )}\n </div>\n </span>\n </label>\n )}\n </div>\n <div class={{ picker: true, 'picker-weeks': this.weeks }} id={this.id} aria-describedby={`${this.id}-label`}>\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 const day = (i + this.locale.weekInfo.firstDay) % 7;\n return <abbr title={this.locale.days.long[day]}>{this.locale.days.short[day]}</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 const isWeekend = this.locale.weekInfo.weekend.includes(day.getDay() || 7);\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-weekend': isWeekend,\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, focus = true) {\n const [minDate, maxDate] = this.getMinMaxDate();\n const focusDate = clampDate(minDate, date, maxDate);\n this.viewDate = new Date(focusDate.getFullYear(), focusDate.getMonth());\n if (focus) {\n this.focusDate = focusDate;\n this.hostElement.shadowRoot\n ?.querySelector<HTMLCatButtonElement>(`[data-date=\"${this.locale.toLocalISO(focusDate)}\"]`)\n ?.doFocus();\n }\n }\n\n private navigate(direction: 'prev' | 'next', period: 'year' | 'month') {\n const offset = direction === 'prev' ? -1 : 1;\n const targetYear = this.viewDate.getFullYear() + (period === 'year' ? offset : 0);\n const targetMonth = this.viewDate.getMonth() + (period === 'month' ? offset : 0);\n\n const date = new Date(this.viewDate);\n date.setFullYear(targetYear);\n date.setMonth(targetMonth);\n\n const minDate = new Date(targetYear, targetMonth, 1);\n const maxDay = new Date(targetYear, targetMonth + 1, 0).getDate();\n const maxDate = new Date(targetYear, targetMonth, maxDay);\n this.viewDate = clampDate(minDate, date, maxDate);\n this.setAriaLive(this.getHeadline());\n }\n\n private setAriaLive(text?: string) {\n const node = this.hostElement.shadowRoot?.querySelector('.cursor-aria');\n if (node && text) {\n node.innerHTML = text;\n }\n }\n\n private dateGrid(year: number, month: number) {\n const daysOffset = (new Date(year, month, 1).getDay() - this.locale.weekInfo.firstDay + 7) % 7;\n const daysInMonth = new Date(year, month + 1, 0).getDate();\n const days = [...Array(daysInMonth).keys()];\n const daysBefore = this.getLastDaysOfMonth(year, month, daysOffset);\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 getLastDaysOfMonth(year: number, month: number, x: number): number[] {\n const lastDayOfMonth = new Date(year, month, 0).getDate();\n const daysOfMonth = Array.from({ length: lastDayOfMonth }, (_, index) => index);\n return x ? daysOfMonth.slice(-x) : [];\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}
@@ -24,10 +24,6 @@ const CatDate$1 = /*@__PURE__*/ proxyCustomElement(class CatDate extends HTMLEle
24
24
  * Whether the label need a marker to shown if the input is required or optional.
25
25
  */
26
26
  this.requiredMarker = 'optional';
27
- /**
28
- * Whether the label is on top or left.
29
- */
30
- this.horizontal = false;
31
27
  /**
32
28
  * Hint for form autofill feature.
33
29
  */
@@ -125,14 +121,14 @@ const CatDate$1 = /*@__PURE__*/ proxyCustomElement(class CatDate extends HTMLEle
125
121
  }
126
122
  render() {
127
123
  this.hostElement.tabIndex = Number(this.hostElement.getAttribute('tabindex')) || 0;
128
- return (h(Host, { key: '38c0f6d0b6edfcd762840f7fedcb47157b0f4a4c' }, h("cat-input", { key: '71a9ebc03ea49b1584b178ad8cb0f61306644e15', 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, testId: this.testId, nativeAttributes: this.nativeAttributes, value: this.inputValue, dateMaskOptions: this.dateMaskOptions, onCatFocus: e => {
124
+ return (h(Host, { key: '976bd5ab47f91d0fd2558da90110dfe7215708c2' }, h("cat-input", { key: 'd7fc538825bbf227cdac59594f4d9388c6f45af1', class: "cat-date-input", ref: el => (this.input = el), requiredMarker: this.requiredMarker, horizontal: this.horizontal ?? this.fallbackHorizontal, 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, testId: this.testId, nativeAttributes: this.nativeAttributes, value: this.inputValue, dateMaskOptions: this.dateMaskOptions, onCatFocus: e => {
129
125
  this.inputFocused = e.target === this.input;
130
126
  e.stopPropagation();
131
127
  this.catFocus.emit(e.detail);
132
128
  }, onCatBlur: e => {
133
129
  e.stopPropagation();
134
130
  this.onInputBlur(e.detail);
135
- } }, h("span", { key: 'ca8eb678246d9047ba2f5e38b0e392333cb20f70', slot: "label" }, this.label, h("span", { key: 'd72fd4de36d76793515480db04b25909b703521e', class: "label-aria" }, " (", this.locale.formatStr, ")")), h("cat-dropdown", { key: 'c58fd79c97821495b73ddef3311235065ff10ce3', slot: "addon", placement: this.placement, arrowNavigation: "none", noResize: true, onCatOpen: () => this.dateInline?.resetView() }, h("cat-button", { key: 'f0f4b2ff2be00dfba6c93fb0218c35f0361c5c63', slot: "trigger", icon: "$cat:datepicker-calendar", iconOnly: true, class: "cat-date-toggle", disabled: this.disabled, a11yLabel: this.getTriggerA11yLabel() }), h("div", { key: 'b5c78f6d0cd4a94af38f3c5d2f7aeceea02eaff5', slot: "content" }, h("cat-date-inline", { key: '71f66a073ba5e5e107defac3771064ac5d48eee9', 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) }))))));
131
+ } }, h("span", { key: 'acde26c15c84b0313e77bb71f2cfa2c4e9e6ed0f', slot: "label" }, this.label, h("span", { key: '4c6df5b6d7e1657eb27b956a206f5edf50984b06', class: "label-aria" }, " (", this.locale.formatStr, ")")), h("cat-dropdown", { key: 'aeb4b595f4b3b76aa38e24932550424c4b079405', slot: "addon", placement: this.placement, arrowNavigation: "none", noResize: true, onCatOpen: () => this.dateInline?.resetView() }, h("cat-button", { key: 'aa1a08b022ecfa45a6f891c9920279a8c396c515', slot: "trigger", icon: "$cat:datepicker-calendar", iconOnly: true, class: "cat-date-toggle", disabled: this.disabled, a11yLabel: this.getTriggerA11yLabel() }), h("div", { key: '7b975f163b67a61cfc5ed146b614ff36c79b51cd', slot: "content" }, h("cat-date-inline", { key: 'a197d8c60a92626960ade852765a29ab737725fd', 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) }))))));
136
132
  }
137
133
  getTriggerA11yLabel() {
138
134
  const date = this.locale.fromLocalISO(this.value);
@@ -209,6 +205,7 @@ const CatDate$1 = /*@__PURE__*/ proxyCustomElement(class CatDate extends HTMLEle
209
205
  }, [17, "cat-date", {
210
206
  "requiredMarker": [1, "required-marker"],
211
207
  "horizontal": [4],
208
+ "fallbackHorizontal": [4, "fallback-horizontal"],
212
209
  "autoComplete": [1, "auto-complete"],
213
210
  "clearable": [4],
214
211
  "disabled": [4],
@@ -1 +1 @@
1
- {"file":"cat-date.js","mappings":";;;;;;;;;AAAA,MAAM,UAAU,GAAG,yUAAyU;;MCkB/UA,SAAO,iBAAAC,kBAAA,CAAA,MAAA,OAAA,SAAA,WAAA,CAAA;AAPpB,IAAA,WAAA,GAAA;;;;;;;AAQmB,QAAA,IAAA,CAAA,QAAQ,GAAGC,eAAI,CAAC,SAAS,EAAE;QAC3B,IAAA,CAAA,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;AAG1C,QAAA,IAAY,CAAA,YAAA,GAAG,KAAK;AAM5B;;AAEG;AACK,QAAA,IAAc,CAAA,cAAA,GAA4E,UAAU;AAE5G;;AAEG;AACK,QAAA,IAAU,CAAA,UAAA,GAAG,KAAK;AAE1B;;AAEG;AACK,QAAA,IAAY,CAAA,YAAA,GAAG,KAAK;AAE5B;;AAEG;AACK,QAAA,IAAS,CAAA,SAAA,GAAG,KAAK;AAEzB;;AAEG;AACK,QAAA,IAAQ,CAAA,QAAA,GAAG,KAAK;AAYxB;;AAEG;AACK,QAAA,IAAS,CAAA,SAAA,GAAG,KAAK;AAOzB;;AAEG;AACK,QAAA,IAAK,CAAA,KAAA,GAAG,EAAE;AAElB;;AAEG;AACK,QAAA,IAAW,CAAA,WAAA,GAAG,KAAK;AAgC3B;;AAEG;AACK,QAAA,IAAQ,CAAA,QAAA,GAAG,KAAK;AAExB;;AAEG;AACK,QAAA,IAAQ,CAAA,QAAA,GAAG,KAAK;AAiBxB;;;;AAIG;AACK,QAAA,IAAW,CAA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AI,GAAG,IAAI;;QAEjC,OAAO,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,GAAG,CAAC,EAAE,GAAG,CAAC;;IAG/B,OAAO,CAAC,IAAmB,EAAE,KAAyB,EAAA;AAC5D,QAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK;QAC3B,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC;QAClD,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC;AACjD,QAAA,IAAI,CAAC,OAAO,IAAI,CAAC,SAAS,EAAE;YAC1B;;AAEF,QAAA,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,KAAK,KAAK,GAAG,SAAS,GAAG,IAAI,EAAE,OAAO,EAAE,IAAI,KAAK,KAAK,GAAG,SAAS,GAAG,IAAI,CAAC;QACxG,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC;AAChD,QAAA,IAAI,QAAQ,KAAK,QAAQ,EAAE;AACzB,YAAA,IAAI,CAAC,KAAK,GAAG,QAAQ;AACrB,YAAA,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["CatDate","__stencil_proxyCustomElement","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, Watch, h, State } 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';\nimport { DateUnit, FormatDateOptions } from 'cleave-zen';\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: {\n delegatesFocus: true\n }\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 private inputFocused = false;\n\n @Element() hostElement!: HTMLElement;\n\n @State() dateMaskOptions?: FormatDateOptions;\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 = 'off';\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 change with the given delay in milliseconds or immediately on blur.\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 * A unique identifier for the underlying native element that is used for\n * testing purposes. The attribute is added as `data-test` attribute and acts\n * as a shorthand for `nativeAttributes={ 'data-test': 'test-Id' }`.\n */\n @Prop() testId?: 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 componentWillLoad() {\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.dateMaskOptions = {\n dateMin: this.min,\n dateMax: this.max,\n delimiter: d1,\n datePattern: [p1 as DateUnit, p2 as DateUnit, p3 as DateUnit]\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 this.hostElement.tabIndex = Number(this.hostElement.getAttribute('tabindex')) || 0;\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 testId={this.testId}\n nativeAttributes={this.nativeAttributes}\n value={this.inputValue}\n dateMaskOptions={this.dateMaskOptions}\n onCatFocus={e => {\n this.inputFocused = e.target === this.input;\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 || !this.inputFocused) {\n return;\n }\n this.inputFocused = false;\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 ? this.locale.fromLocalISO(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}
1
+ {"file":"cat-date.js","mappings":";;;;;;;;;AAAA,MAAM,UAAU,GAAG,yUAAyU;;MCkB/UA,SAAO,iBAAAC,kBAAA,CAAA,MAAA,OAAA,SAAA,WAAA,CAAA;AAPpB,IAAA,WAAA,GAAA;;;;;;;AAQmB,QAAA,IAAA,CAAA,QAAQ,GAAGC,eAAI,CAAC,SAAS,EAAE;QAC3B,IAAA,CAAA,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;AAG1C,QAAA,IAAY,CAAA,YAAA,GAAG,KAAK;AAM5B;;AAEG;AACK,QAAA,IAAc,CAAA,cAAA,GAA4E,UAAU;AAa5G;;AAEG;AACK,QAAA,IAAY,CAAA,YAAA,GAAG,KAAK;AAE5B;;AAEG;AACK,QAAA,IAAS,CAAA,SAAA,GAAG,KAAK;AAEzB;;AAEG;AACK,QAA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;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["CatDate","__stencil_proxyCustomElement","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, Watch, h, State } 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';\nimport { DateUnit, FormatDateOptions } from 'cleave-zen';\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: {\n delegatesFocus: true\n }\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 private inputFocused = false;\n\n @Element() hostElement!: HTMLElement;\n\n @State() dateMaskOptions?: FormatDateOptions;\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?: boolean;\n\n /**\n * If the horizontal value is not provided, this fallback value is used. Can be set by form-group.\n * @internal\n */\n @Prop() fallbackHorizontal?: boolean;\n\n /**\n * Hint for form autofill feature.\n */\n @Prop() autoComplete = 'off';\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 change with the given delay in milliseconds or immediately on blur.\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 * A unique identifier for the underlying native element that is used for\n * testing purposes. The attribute is added as `data-test` attribute and acts\n * as a shorthand for `nativeAttributes={ 'data-test': 'test-Id' }`.\n */\n @Prop() testId?: 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 componentWillLoad() {\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.dateMaskOptions = {\n dateMin: this.min,\n dateMax: this.max,\n delimiter: d1,\n datePattern: [p1 as DateUnit, p2 as DateUnit, p3 as DateUnit]\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 this.hostElement.tabIndex = Number(this.hostElement.getAttribute('tabindex')) || 0;\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 ?? this.fallbackHorizontal}\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 testId={this.testId}\n nativeAttributes={this.nativeAttributes}\n value={this.inputValue}\n dateMaskOptions={this.dateMaskOptions}\n onCatFocus={e => {\n this.inputFocused = e.target === this.input;\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 || !this.inputFocused) {\n return;\n }\n this.inputFocused = false;\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 ? this.locale.fromLocalISO(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}
@@ -23,10 +23,6 @@ const CatDatepickerFlat = /*@__PURE__*/ proxyCustomElement(class CatDatepickerFl
23
23
  * Whether the label need a marker to shown if the input is required or optional.
24
24
  */
25
25
  this.requiredMarker = 'optional';
26
- /**
27
- * Whether the label is on top or left.
28
- */
29
- this.horizontal = false;
30
26
  /**
31
27
  * Hint for form autofill feature.
32
28
  */
@@ -139,7 +135,7 @@ const CatDatepickerFlat = /*@__PURE__*/ proxyCustomElement(class CatDatepickerFl
139
135
  }
140
136
  render() {
141
137
  return [
142
- h("cat-input", { key: '472e33835c2ac42e3e648d7b4b80551bfad276bb', 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, label: this.label, labelHidden: this.labelHidden, name: this.name, placeholder: this.placeholder, textPrefix: this.textPrefix, textSuffix: this.textSuffix, readonly: this.readonly, required: this.required, value: this.value, errors: this.errors, errorUpdate: this.errorUpdate, nativeAttributes: this.nativeAttributes, onCatChange: e => {
138
+ h("cat-input", { key: '9e47a3a8ed8daa56c7bb50d226496a90fe5a6fbe', ref: el => (this._input = el), requiredMarker: this.requiredMarker, horizontal: this.horizontal ?? this.fallbackHorizontal, autoComplete: this.autoComplete, clearable: this.clearable, disabled: this.disabled, hint: this.hint, icon: this.icon, iconRight: this.iconRight, identifier: this.identifier, label: this.label, labelHidden: this.labelHidden, name: this.name, placeholder: this.placeholder, textPrefix: this.textPrefix, textSuffix: this.textSuffix, readonly: this.readonly, required: this.required, value: this.value, errors: this.errors, errorUpdate: this.errorUpdate, nativeAttributes: this.nativeAttributes, onCatChange: e => {
143
139
  e.stopPropagation();
144
140
  this.value = e.detail || undefined;
145
141
  }, onCatFocus: e => {
@@ -148,8 +144,8 @@ const CatDatepickerFlat = /*@__PURE__*/ proxyCustomElement(class CatDatepickerFl
148
144
  }, onCatBlur: e => {
149
145
  e.stopPropagation();
150
146
  this.catBlur.emit(e.detail);
151
- } }, this.hasSlottedLabel && (h("span", { key: '9e883cc02c66b78e8be8221a5632f37b016df965', slot: "label" }, h("slot", { key: '892603e7cb7e645e92503a30f2eb89dc5b2be9bc', name: "label" }))), this.hasSlottedHint && (h("span", { key: 'b5f4e4fad0aca02ab0d9c1a94d4f5e7582634490', slot: "hint" }, h("slot", { key: '4d9184fd37321b6b7709a25a3cee17057b5cfcb7', name: "hint" })))),
152
- h("div", { key: '8eccd0924e6dfcd2fdf2d71feba880ca84d44e87', ref: el => (this._calendarWrapper = el), class: "datepicker-wrapper" })
147
+ } }, this.hasSlottedLabel && (h("span", { key: '9aa4a8f3b357bd599b1c9e0c1241269205140dbc', slot: "label" }, h("slot", { key: '0e9e849371bc530561a2d538f776259b7fc3f44a', name: "label" }))), this.hasSlottedHint && (h("span", { key: 'bd1666fe3725e032ec117ad9cd860e151a89569a', slot: "hint" }, h("slot", { key: 'c75f0b32ab9019912b443205bf34b00371db9e70', name: "hint" })))),
148
+ h("div", { key: '9916d66043f972b18a9d33b37b79fc52cf310542', ref: el => (this._calendarWrapper = el), class: "datepicker-wrapper" })
153
149
  ];
154
150
  }
155
151
  initDatepicker(input) {
@@ -215,6 +211,7 @@ const CatDatepickerFlat = /*@__PURE__*/ proxyCustomElement(class CatDatepickerFl
215
211
  }, [1, "cat-datepicker", {
216
212
  "requiredMarker": [1, "required-marker"],
217
213
  "horizontal": [4],
214
+ "fallbackHorizontal": [4, "fallback-horizontal"],
218
215
  "autoComplete": [1, "auto-complete"],
219
216
  "clearable": [4],
220
217
  "disabled": [4],
@@ -1 +1 @@
1
- {"file":"cat-datepicker.js","mappings":";;;;;;;;;AAAA,MAAM,gBAAgB,GAAG,m5vBAAm5vB;;MCiB/5vB,iBAAiB,iBAAAA,kBAAA,CAAA,MAAA,iBAAA,SAAA,WAAA,CAAA;AAL9B,IAAA,WAAA,GAAA;;;;;;;AAeW,QAAA,IAAe,CAAA,eAAA,GAAG,KAAK;AAEvB,QAAA,IAAc,CAAA,cAAA,GAAG,KAAK;AAE/B;;AAEG;AACK,Q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AAC,iBAAiB,CAAC,OAAO,CAAC,SAAS,GAAG,SAAS;oBACzD,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE;wBAC/C,IAAI,EAAE,CAAG,EAAA,CAAC,CAAI,EAAA,CAAA;wBACd,GAAG,EAAE,CAAG,EAAA,CAAC,CAAI,EAAA,CAAA;AACb,wBAAA,QAAQ,EAAE;AACX,qBAAA,CAAC;;AAEN,aAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","i18n"],"sources":["src/components/cat-datepicker/cat-datepicker.scss?tag=cat-datepicker&encapsulation=shadow","src/components/cat-datepicker/cat-datepicker.tsx"],"sourcesContent":["@use 'variables' as *;\n@use 'mixins' as *;\n@import '~flatpickr/dist/flatpickr.css';\n@import 'vendor/flatpickr';\n\n:host {\n display: flex;\n}\n\n:host([hidden]) {\n display: none;\n}\n\ncat-input {\n flex: 1 1 auto;\n margin: 0;\n}\n","import { Component, Element, Event, EventEmitter, Method, Prop, State, Watch, h } from '@stencil/core';\nimport flatpickr from 'flatpickr';\nimport { findClosest } from '../../utils/find-closest';\nimport { ErrorMap } from '../cat-form-hint/cat-form-hint';\nimport { catI18nRegistry as i18n } from '../cat-i18n/cat-i18n-registry';\nimport { getConfig } from './cat-datepicker.config';\nimport { getFormat } from './cat-datepicker.format';\nimport { getLocale } from './cat-datepicker.locale';\nimport { CatDatepickerMode } from './cat-datepicker.mode';\nimport { autoUpdate, computePosition, flip, Placement, ReferenceElement } from '@floating-ui/dom';\nimport { BaseOptions } from 'flatpickr/dist/types/options';\n\n@Component({\n tag: 'cat-datepicker',\n styleUrl: 'cat-datepicker.scss',\n shadow: true\n})\nexport class CatDatepickerFlat {\n private pickr?: flatpickr.Instance;\n private _input?: HTMLCatInputElement;\n private _calendarWrapper?: HTMLDivElement;\n private get input(): HTMLInputElement | undefined {\n return this._input?.shadowRoot?.querySelector('input') ?? undefined;\n }\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 = 'off';\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 as ISO Date string, e.g. 2017-03-04T01:23:43.000Z.\n */\n @Prop() max?: string;\n\n /**\n * A minimum value as ISO Date string, e.g. 2017-03-04T01:23:43.000Z.\n */\n @Prop() min?: string;\n\n /**\n * The mode of the datepicker, to select a date, time, both, a date range or a week number.\n */\n @Prop() mode: CatDatepickerMode = 'date';\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 step size to use when changing the time.\n */\n @Prop() step = 5;\n\n /**\n * Instead of body, appends the calendar to the cat-datepicker element instead\n */\n @Prop() attachToElement = false;\n\n /**\n * Where the calendar is rendered relative to the input vertically and horizontally.\n * In the format of \"[vertical] [horizontal]\". Vertical can be auto, above or below (required).\n * Horizontal can be left, center or right.\n * If @attachToElement is passed the value should be in Placement format\n */\n @Prop() position?: BaseOptions['position'] | Placement;\n\n /**\n * The value as ISO Date string, e.g. 2017-03-04T01:23:43.000Z or as a week number string.\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 change with the given delay in milliseconds or immediately on blur.\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 * Attributes that will be added to the rendered HTML datepicker element.\n */\n @Prop() nativePickerAttributes?: { [key: string]: string };\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 @Watch('value')\n onValueChanged(value: string) {\n if (value) {\n this.pickr?.setDate(value, false);\n if (this.mode !== 'daterange' || value.includes(' - ')) {\n this.catChange.emit(value);\n }\n } else {\n this.pickr?.clear(false);\n this.catChange.emit(undefined);\n }\n }\n\n @Watch('disabled')\n @Watch('readonly')\n @Watch('mode')\n onDisabledChanged() {\n // Dynamically changing config value is not working due to a bug in the\n // library. We thus need to fully recreate the date picker after the value\n // has been updated.\n this.pickr?.destroy();\n this.pickr = undefined;\n setTimeout(() => {\n this.input ? (this.input.disabled = this.disabled) : null;\n this.pickr = this.initDatepicker(this.input);\n });\n }\n\n componentDidLoad() {\n this.pickr = this.initDatepicker(this.input);\n }\n\n componentWillRender(): void {\n this.hasSlottedLabel = !!this.hostElement.querySelector('[slot=\"label\"]');\n this.hasSlottedHint = !!this.hostElement.querySelector('[slot=\"hint\"]');\n }\n\n @Watch('min')\n @Watch('max')\n onMinChanged() {\n this.pickr?.set('minDate', this.min);\n this.pickr?.set('maxDate', this.max);\n if (this.value && !this.pickr?.selectedDates?.length) {\n // Dynamically changing 'minDate' or 'maxDate' does not emit a change if\n // the value is cleared due to an invalid date.\n this.pickr?.clear();\n }\n }\n\n /**\n * Programmatically move focus to the datepicker. 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 datepicker. Use this method instead of\n * `input.blur()`.\n */\n @Method()\n async doBlur(): Promise<void> {\n this._input?.doBlur();\n }\n\n render() {\n return [\n <cat-input\n ref={el => (this._input = el)}\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 label={this.label}\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 value={this.value}\n errors={this.errors}\n errorUpdate={this.errorUpdate}\n nativeAttributes={this.nativeAttributes}\n onCatChange={e => {\n e.stopPropagation();\n this.value = e.detail || undefined;\n }}\n onCatFocus={e => {\n e.stopPropagation();\n this.catFocus.emit(e.detail);\n }}\n onCatBlur={e => {\n e.stopPropagation();\n this.catBlur.emit(e.detail);\n }}\n >\n {this.hasSlottedLabel && (\n <span slot=\"label\">\n <slot name=\"label\"></slot>\n </span>\n )}\n {this.hasSlottedHint && (\n <span slot=\"hint\">\n <slot name=\"hint\"></slot>\n </span>\n )}\n </cat-input>,\n <div ref={el => (this._calendarWrapper = el)} class=\"datepicker-wrapper\"></div>\n ];\n }\n\n private initDatepicker(input?: HTMLInputElement): flatpickr.Instance | undefined {\n if (!input) {\n return;\n }\n\n // avoid dropdown closing if datepicker is part of a dropdown\n const withinDropdown = !!findClosest('cat-dropdown', input);\n const nativePickerAttributes: { [key: string]: string } = withinDropdown ? { 'data-dropdown-no-close': '' } : {};\n\n return flatpickr(\n input,\n getConfig({\n locale: getLocale(i18n.getLocale()),\n format: getFormat(i18n.getLocale(), this.mode),\n mode: this.mode,\n min: this.min,\n max: this.max,\n step: this.step,\n disabled: this.disabled,\n readonly: this.readonly,\n appendTo: this.attachToElement ? this._calendarWrapper : undefined,\n nativePickerAttributes: { ...nativePickerAttributes, ...this.nativePickerAttributes },\n // flatpickr has open bug about incorrect positioning when appendTo is used,\n // we have to use custom logic to calculate position\n // https://github.com/flatpickr/flatpickr/issues/1619\n position: this.attachToElement\n ? (flatpickr, positionElement) => {\n this.updatePosition(flatpickr, positionElement);\n }\n : (this.position as BaseOptions['position']) || undefined,\n onReady: (_dates, _dateStr, flatpickr) => {\n autoUpdate(input, flatpickr.calendarContainer, () => this.updatePosition(flatpickr, flatpickr._input));\n },\n applyChange: value => (this.value = value)\n })\n );\n }\n\n private updatePosition(flatpickr: flatpickr.Instance, positionElement: HTMLElement | undefined): void {\n if (positionElement) {\n computePosition(positionElement as ReferenceElement, flatpickr.calendarContainer, {\n strategy: 'fixed',\n placement: (this.position as Placement) || 'bottom-start',\n middleware: [flip()]\n }).then(({ x, y, placement }) => {\n if (flatpickr.calendarContainer) {\n flatpickr.calendarContainer.dataset.placement = placement;\n Object.assign(flatpickr.calendarContainer.style, {\n left: `${x}px`,\n top: `${y}px`,\n position: 'fixed'\n });\n }\n });\n }\n }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AA,QAAQ,EAAE,OAAO;AACjB,gBAAA,SAAS,EAAG,IAAI,CAAC,QAAsB,IAAI,cAAc;AACzD,gBAAA,UAAU,EAAE,CAAC,IAAI,EAAE;AACpB,aAAA,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,KAAI;AAC9B,gBAAA,IAAI,SAAS,CAAC,iBAAiB,EAAE;oBAC/B,SAAS,CAAC,iBAAiB,CAAC,OAAO,CAAC,SAAS,GAAG,SAAS;oBACzD,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE;wBAC/C,IAAI,EAAE,CAAG,EAAA,CAAC,CAAI,EAAA,CAAA;wBACd,GAAG,EAAE,CAAG,EAAA,CAAC,CAAI,EAAA,CAAA;AACb,wBAAA,QAAQ,EAAE;AACX,qBAAA,CAAC;;AAEN,aAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","i18n"],"sources":["src/components/cat-datepicker/cat-datepicker.scss?tag=cat-datepicker&encapsulation=shadow","src/components/cat-datepicker/cat-datepicker.tsx"],"sourcesContent":["@use 'variables' as *;\n@use 'mixins' as *;\n@import '~flatpickr/dist/flatpickr.css';\n@import 'vendor/flatpickr';\n\n:host {\n display: flex;\n}\n\n:host([hidden]) {\n display: none;\n}\n\ncat-input {\n flex: 1 1 auto;\n margin: 0;\n}\n","import { Component, Element, Event, EventEmitter, Method, Prop, State, Watch, h } from '@stencil/core';\nimport flatpickr from 'flatpickr';\nimport { findClosest } from '../../utils/find-closest';\nimport { ErrorMap } from '../cat-form-hint/cat-form-hint';\nimport { catI18nRegistry as i18n } from '../cat-i18n/cat-i18n-registry';\nimport { getConfig } from './cat-datepicker.config';\nimport { getFormat } from './cat-datepicker.format';\nimport { getLocale } from './cat-datepicker.locale';\nimport { CatDatepickerMode } from './cat-datepicker.mode';\nimport { autoUpdate, computePosition, flip, Placement, ReferenceElement } from '@floating-ui/dom';\nimport { BaseOptions } from 'flatpickr/dist/types/options';\n\n@Component({\n tag: 'cat-datepicker',\n styleUrl: 'cat-datepicker.scss',\n shadow: true\n})\nexport class CatDatepickerFlat {\n private pickr?: flatpickr.Instance;\n private _input?: HTMLCatInputElement;\n private _calendarWrapper?: HTMLDivElement;\n private get input(): HTMLInputElement | undefined {\n return this._input?.shadowRoot?.querySelector('input') ?? undefined;\n }\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?: boolean;\n\n /**\n * If the horizontal value is not provided, this fallback value is used. Can be set by form-group.\n * @internal\n */\n @Prop() fallbackHorizontal?: boolean;\n\n /**\n * Hint for form autofill feature.\n */\n @Prop() autoComplete = 'off';\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 as ISO Date string, e.g. 2017-03-04T01:23:43.000Z.\n */\n @Prop() max?: string;\n\n /**\n * A minimum value as ISO Date string, e.g. 2017-03-04T01:23:43.000Z.\n */\n @Prop() min?: string;\n\n /**\n * The mode of the datepicker, to select a date, time, both, a date range or a week number.\n */\n @Prop() mode: CatDatepickerMode = 'date';\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 step size to use when changing the time.\n */\n @Prop() step = 5;\n\n /**\n * Instead of body, appends the calendar to the cat-datepicker element instead\n */\n @Prop() attachToElement = false;\n\n /**\n * Where the calendar is rendered relative to the input vertically and horizontally.\n * In the format of \"[vertical] [horizontal]\". Vertical can be auto, above or below (required).\n * Horizontal can be left, center or right.\n * If @attachToElement is passed the value should be in Placement format\n */\n @Prop() position?: BaseOptions['position'] | Placement;\n\n /**\n * The value as ISO Date string, e.g. 2017-03-04T01:23:43.000Z or as a week number string.\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 change with the given delay in milliseconds or immediately on blur.\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 * Attributes that will be added to the rendered HTML datepicker element.\n */\n @Prop() nativePickerAttributes?: { [key: string]: string };\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 @Watch('value')\n onValueChanged(value: string) {\n if (value) {\n this.pickr?.setDate(value, false);\n if (this.mode !== 'daterange' || value.includes(' - ')) {\n this.catChange.emit(value);\n }\n } else {\n this.pickr?.clear(false);\n this.catChange.emit(undefined);\n }\n }\n\n @Watch('disabled')\n @Watch('readonly')\n @Watch('mode')\n onDisabledChanged() {\n // Dynamically changing config value is not working due to a bug in the\n // library. We thus need to fully recreate the date picker after the value\n // has been updated.\n this.pickr?.destroy();\n this.pickr = undefined;\n setTimeout(() => {\n this.input ? (this.input.disabled = this.disabled) : null;\n this.pickr = this.initDatepicker(this.input);\n });\n }\n\n componentDidLoad() {\n this.pickr = this.initDatepicker(this.input);\n }\n\n componentWillRender(): void {\n this.hasSlottedLabel = !!this.hostElement.querySelector('[slot=\"label\"]');\n this.hasSlottedHint = !!this.hostElement.querySelector('[slot=\"hint\"]');\n }\n\n @Watch('min')\n @Watch('max')\n onMinChanged() {\n this.pickr?.set('minDate', this.min);\n this.pickr?.set('maxDate', this.max);\n if (this.value && !this.pickr?.selectedDates?.length) {\n // Dynamically changing 'minDate' or 'maxDate' does not emit a change if\n // the value is cleared due to an invalid date.\n this.pickr?.clear();\n }\n }\n\n /**\n * Programmatically move focus to the datepicker. 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 datepicker. Use this method instead of\n * `input.blur()`.\n */\n @Method()\n async doBlur(): Promise<void> {\n this._input?.doBlur();\n }\n\n render() {\n return [\n <cat-input\n ref={el => (this._input = el)}\n requiredMarker={this.requiredMarker}\n horizontal={this.horizontal ?? this.fallbackHorizontal}\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 label={this.label}\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 value={this.value}\n errors={this.errors}\n errorUpdate={this.errorUpdate}\n nativeAttributes={this.nativeAttributes}\n onCatChange={e => {\n e.stopPropagation();\n this.value = e.detail || undefined;\n }}\n onCatFocus={e => {\n e.stopPropagation();\n this.catFocus.emit(e.detail);\n }}\n onCatBlur={e => {\n e.stopPropagation();\n this.catBlur.emit(e.detail);\n }}\n >\n {this.hasSlottedLabel && (\n <span slot=\"label\">\n <slot name=\"label\"></slot>\n </span>\n )}\n {this.hasSlottedHint && (\n <span slot=\"hint\">\n <slot name=\"hint\"></slot>\n </span>\n )}\n </cat-input>,\n <div ref={el => (this._calendarWrapper = el)} class=\"datepicker-wrapper\"></div>\n ];\n }\n\n private initDatepicker(input?: HTMLInputElement): flatpickr.Instance | undefined {\n if (!input) {\n return;\n }\n\n // avoid dropdown closing if datepicker is part of a dropdown\n const withinDropdown = !!findClosest('cat-dropdown', input);\n const nativePickerAttributes: { [key: string]: string } = withinDropdown ? { 'data-dropdown-no-close': '' } : {};\n\n return flatpickr(\n input,\n getConfig({\n locale: getLocale(i18n.getLocale()),\n format: getFormat(i18n.getLocale(), this.mode),\n mode: this.mode,\n min: this.min,\n max: this.max,\n step: this.step,\n disabled: this.disabled,\n readonly: this.readonly,\n appendTo: this.attachToElement ? this._calendarWrapper : undefined,\n nativePickerAttributes: { ...nativePickerAttributes, ...this.nativePickerAttributes },\n // flatpickr has open bug about incorrect positioning when appendTo is used,\n // we have to use custom logic to calculate position\n // https://github.com/flatpickr/flatpickr/issues/1619\n position: this.attachToElement\n ? (flatpickr, positionElement) => {\n this.updatePosition(flatpickr, positionElement);\n }\n : (this.position as BaseOptions['position']) || undefined,\n onReady: (_dates, _dateStr, flatpickr) => {\n autoUpdate(input, flatpickr.calendarContainer, () => this.updatePosition(flatpickr, flatpickr._input));\n },\n applyChange: value => (this.value = value)\n })\n );\n }\n\n private updatePosition(flatpickr: flatpickr.Instance, positionElement: HTMLElement | undefined): void {\n if (positionElement) {\n computePosition(positionElement as ReferenceElement, flatpickr.calendarContainer, {\n strategy: 'fixed',\n placement: (this.position as Placement) || 'bottom-start',\n middleware: [flip()]\n }).then(({ x, y, placement }) => {\n if (flatpickr.calendarContainer) {\n flatpickr.calendarContainer.dataset.placement = placement;\n Object.assign(flatpickr.calendarContainer.style, {\n left: `${x}px`,\n top: `${y}px`,\n position: 'fixed'\n });\n }\n });\n }\n }\n}\n"],"version":3}
@@ -27,14 +27,14 @@ const CatFormGroup$1 = /*@__PURE__*/ proxyCustomElement(class CatFormGroup exten
27
27
  }
28
28
  onHorizontalChanged(newHorizontal) {
29
29
  this.formElements.forEach(element => {
30
- element.horizontal = element.horizontal ?? newHorizontal;
30
+ element.fallbackHorizontal = newHorizontal;
31
31
  });
32
32
  }
33
33
  render() {
34
- return (h(Host, { key: 'db0a498ef54f74b0db89f17ba628626576fe4410', style: { '--label-size': this.labelSize } }, h("slot", { key: '28391f2acbd06baca30aaebb57e6bd3d20ab6532', onSlotchange: this.onSlotChange.bind(this) })));
34
+ return (h(Host, { key: 'd9cf4d831edfd4ec8813ba2df5f4a4928408966d', style: { '--label-size': this.labelSize } }, h("slot", { key: 'bca4d87e0a954bc3f227dc230a66fdcc4cdd4015', onSlotchange: this.onSlotChange.bind(this) })));
35
35
  }
36
36
  onSlotChange() {
37
- this.formElements = Array.from(this.hostElement.querySelectorAll('cat-input, cat-textarea, cat-select, cat-datepicker'));
37
+ this.formElements = Array.from(this.hostElement.querySelectorAll('cat-input, cat-textarea, cat-select, cat-datepicker, cat-date, cat-time'));
38
38
  this.onRequiredMarkerChanged(this.requiredMarker);
39
39
  this.onHorizontalChanged(this.horizontal);
40
40
  }
@@ -1 +1 @@
1
- {"file":"cat-form-group.js","mappings":";;AAAA,MAAM,eAAe,GAAG,sBAAs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AI,CAAC,cAAc,CAAC;AACjD,QAAA,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,UAAU,CAAC;;AAGnC,IAAA,SAAS,CAAC,QAAmC,EAAA;AACnD,QAAA,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,MAAM;AACvE,QAAA,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,GAAG,cAAc;QACvD,OAAO,cAAc,IAAI,cAAc,GAAG,UAAU,GAAG,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["CatFormGroup","__stencil_proxyCustomElement"],"sources":["src/components/cat-form-group/cat-form-group.scss?tag=cat-form-group&encapsulation=shadow","src/components/cat-form-group/cat-form-group.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Element, h, Host, Prop, Watch } from '@stencil/core';\n\ntype HTMLCatFormFieldElement =\n | HTMLCatInputElement\n | HTMLCatTextareaElement\n | HTMLCatSelectElement\n | HTMLCatDatepickerElement;\n\n/**\n * A form group component to group form fields and labels.\n */\n@Component({\n tag: 'cat-form-group',\n styleUrl: 'cat-form-group.scss',\n shadow: true\n})\nexport class CatFormGroup {\n private formElements: HTMLCatFormFieldElement[] = [];\n\n @Element() hostElement!: HTMLElement;\n\n /**\n * Whether the labels need a marker to shown if the forms fields are required or optional.<br /><br />\n * By default, it is set to auto, it will display the mark depending on the number of required and optional fields: <br />\n * - If there are more required, the optional will be marked.<br />\n * - If there are less required, it will mark the required.<br /><br />\n * If a form field had \"!\", the requiredMarked of the field would not change.\n */\n @Prop() requiredMarker: 'none' | 'required' | 'optional' | 'auto' = 'auto';\n\n /**\n * Whether the label is on top or left.\n */\n @Prop() horizontal = false;\n\n /**\n * The space allocated to the input label\n */\n @Prop() labelSize?: string;\n\n @Watch('requiredMarker')\n onRequiredMarkerChanged(newRequiredMarker: 'none' | 'required' | 'optional' | 'auto') {\n const updateMarker = newRequiredMarker === 'auto' ? this.calculate(this.formElements) : newRequiredMarker;\n this.formElements.forEach(\n element => !element.requiredMarker?.endsWith('!') && (element.requiredMarker = updateMarker)\n );\n }\n\n @Watch('horizontal')\n onHorizontalChanged(newHorizontal: boolean) {\n this.formElements.forEach(element => {\n element.horizontal = element.horizontal ?? newHorizontal;\n });\n }\n\n render() {\n return (\n <Host style={{ '--label-size': this.labelSize }}>\n <slot onSlotchange={this.onSlotChange.bind(this)}></slot>\n </Host>\n );\n }\n\n private onSlotChange(): void {\n this.formElements = Array.from(\n this.hostElement.querySelectorAll('cat-input, cat-textarea, cat-select, cat-datepicker')\n ) as HTMLCatFormFieldElement[];\n this.onRequiredMarkerChanged(this.requiredMarker);\n this.onHorizontalChanged(this.horizontal);\n }\n\n private calculate(elements: HTMLCatFormFieldElement[]): 'optional' | 'required' {\n const optionalFields = elements.filter(value => !value.required).length;\n const requiredFields = elements.length - optionalFields;\n return requiredFields >= optionalFields ? 'optional' : 'required';\n }\n}\n"],"version":3}
1
+ {"file":"cat-form-group.js","mappings":";;AAAA,MAAM,eAAe,GAAG,sBAAsB;;MCkBjCA,cAAY,iBAAAC,kBAAA,CAAA,MAAA,YAAA,SAAA,WAAA,CAAA;AALzB,IAAA,WAAA,GAAA;;;;AAMU,QAAA,IAAY,CAAA,YAAA,GAA8B,EAAE;AAIpD;;;;;;AAMG;AACK,QAAA,IAAc,CAAA,cAAA,GAA8C,MAAM;AAE1E;;AAEG;AACK,QAAA,IAAU,CAAA,UAAA,GAAG,KAAK;AA2C3B;AAnCC,IAAA,uBAAuB,CAAC,iBAA4D,EAAA;QAClF,MAAM,YAAY,GAAG,iBAAiB,KAAK,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,iBAAiB;QACzG,IAAI,CAAC,YAAY,CAAC,OAAO,CACvB,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,QAAQ,CAAC,GAAG,CAAC,KAAK,OAAO,CAAC,cAAc,GAAG,YAAY,CAAC,CAC7F;;AAIH,IAAA,mBAAmB,CAAC,aAAsB,EAAA;AACxC,QAAA,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,IAAG;AAClC,YAAA,OAAO,CAAC,kBAAkB,GAAG,aAAa;AAC5C,SAAC,CAAC;;IAGJ,MAAM,GAAA;QACJ,QACE,CAAA,CAAC,IAAI,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAC,KAAK,EAAE,EAAE,cAAc,EAAE,IAAI,CAAC,SAAS,EAAE,EAAA,EAC7C,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,YAAY,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAAS,CAAA,CACpD;;IAIH,YAAY,GAAA;AAClB,QAAA,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,IAAI,CAC5B,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,yEAAyE,CAAC,CAChF;AAC9B,QAAA,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,cAAc,CAAC;AACjD,QAAA,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,UAAU,CAAC;;AAGnC,IAAA,SAAS,CAAC,QAAmC,EAAA;AACnD,QAAA,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,MAAM;AACvE,QAAA,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,GAAG,cAAc;QACvD,OAAO,cAAc,IAAI,cAAc,GAAG,UAAU,GAAG,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["CatFormGroup","__stencil_proxyCustomElement"],"sources":["src/components/cat-form-group/cat-form-group.scss?tag=cat-form-group&encapsulation=shadow","src/components/cat-form-group/cat-form-group.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Element, h, Host, Prop, Watch } from '@stencil/core';\n\ntype HTMLCatFormFieldElement =\n | HTMLCatInputElement\n | HTMLCatTextareaElement\n | HTMLCatSelectElement\n | HTMLCatDatepickerElement\n | HTMLCatDateElement\n | HTMLCatTimeElement;\n\n/**\n * A form group component to group form fields and labels.\n */\n@Component({\n tag: 'cat-form-group',\n styleUrl: 'cat-form-group.scss',\n shadow: true\n})\nexport class CatFormGroup {\n private formElements: HTMLCatFormFieldElement[] = [];\n\n @Element() hostElement!: HTMLElement;\n\n /**\n * Whether the labels need a marker to shown if the forms fields are required or optional.<br /><br />\n * By default, it is set to auto, it will display the mark depending on the number of required and optional fields: <br />\n * - If there are more required, the optional will be marked.<br />\n * - If there are less required, it will mark the required.<br /><br />\n * If a form field had \"!\", the requiredMarked of the field would not change.\n */\n @Prop() requiredMarker: 'none' | 'required' | 'optional' | 'auto' = 'auto';\n\n /**\n * Whether the label is on top or left.\n */\n @Prop() horizontal = false;\n\n /**\n * The space allocated to the input label\n */\n @Prop() labelSize?: string;\n\n @Watch('requiredMarker')\n onRequiredMarkerChanged(newRequiredMarker: 'none' | 'required' | 'optional' | 'auto') {\n const updateMarker = newRequiredMarker === 'auto' ? this.calculate(this.formElements) : newRequiredMarker;\n this.formElements.forEach(\n element => !element.requiredMarker?.endsWith('!') && (element.requiredMarker = updateMarker)\n );\n }\n\n @Watch('horizontal')\n onHorizontalChanged(newHorizontal: boolean) {\n this.formElements.forEach(element => {\n element.fallbackHorizontal = newHorizontal;\n });\n }\n\n render() {\n return (\n <Host style={{ '--label-size': this.labelSize }}>\n <slot onSlotchange={this.onSlotChange.bind(this)}></slot>\n </Host>\n );\n }\n\n private onSlotChange(): void {\n this.formElements = Array.from(\n this.hostElement.querySelectorAll('cat-input, cat-textarea, cat-select, cat-datepicker, cat-date, cat-time')\n ) as HTMLCatFormFieldElement[];\n this.onRequiredMarkerChanged(this.requiredMarker);\n this.onHorizontalChanged(this.horizontal);\n }\n\n private calculate(elements: HTMLCatFormFieldElement[]): 'optional' | 'required' {\n const optionalFields = elements.filter(value => !value.required).length;\n const requiredFields = elements.length - optionalFields;\n return requiredFields >= optionalFields ? 'optional' : 'required';\n }\n}\n"],"version":3}