@haiilo/catalyst 14.5.1 → 14.5.3

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 (52) hide show
  1. package/dist/catalyst/catalyst.esm.js +1 -1
  2. package/dist/catalyst/p-2539f869.entry.js +10 -0
  3. package/dist/catalyst/p-2539f869.entry.js.map +1 -0
  4. package/dist/cjs/cat-alert_32.cjs.entry.js +114 -81
  5. package/dist/cjs/catalyst.cjs.js +1 -1
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/collection/collection-manifest.json +1 -1
  8. package/dist/collection/components/cat-alert/cat-alert.js +1 -1
  9. package/dist/collection/components/cat-badge/cat-badge.js +1 -1
  10. package/dist/collection/components/cat-button-group/cat-button-group.js +1 -1
  11. package/dist/collection/components/cat-card/cat-card.js +1 -1
  12. package/dist/collection/components/cat-checkbox/cat-checkbox.js +2 -2
  13. package/dist/collection/components/cat-date/cat-date.js +2 -2
  14. package/dist/collection/components/cat-date-inline/cat-date-inline.js +4 -4
  15. package/dist/collection/components/cat-datepicker/cat-datepicker.js +3 -3
  16. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.js +2 -2
  17. package/dist/collection/components/cat-dropdown/cat-dropdown.js +31 -26
  18. package/dist/collection/components/cat-dropdown/cat-dropdown.js.map +1 -1
  19. package/dist/collection/components/cat-form-group/cat-form-group.js +1 -1
  20. package/dist/collection/components/cat-icon/cat-icon.js +1 -1
  21. package/dist/collection/components/cat-menu/cat-menu.js +8 -5
  22. package/dist/collection/components/cat-menu/cat-menu.js.map +1 -1
  23. package/dist/collection/components/cat-menu-item/cat-menu-item.js +37 -4
  24. package/dist/collection/components/cat-menu-item/cat-menu-item.js.map +1 -1
  25. package/dist/components/cat-alert.js +1 -1
  26. package/dist/components/cat-badge.js +1 -1
  27. package/dist/components/cat-button-group.js +1 -1
  28. package/dist/components/cat-card.js +1 -1
  29. package/dist/components/cat-checkbox2.js +2 -2
  30. package/dist/components/cat-date-inline2.js +4 -4
  31. package/dist/components/cat-date.js +2 -2
  32. package/dist/components/cat-datepicker-inline.js +2 -2
  33. package/dist/components/cat-datepicker.js +3 -3
  34. package/dist/components/cat-dropdown2.js +32 -9
  35. package/dist/components/cat-dropdown2.js.map +1 -1
  36. package/dist/components/cat-form-group.js +1 -1
  37. package/dist/components/cat-icon2.js +1 -1
  38. package/dist/components/cat-menu-item2.js +10 -5
  39. package/dist/components/cat-menu-item2.js.map +1 -1
  40. package/dist/components/cat-menu2.js +8 -6
  41. package/dist/components/cat-menu2.js.map +1 -1
  42. package/dist/components/floating-ui.dom.js +49 -45
  43. package/dist/components/floating-ui.dom.js.map +1 -1
  44. package/dist/esm/cat-alert_32.entry.js +114 -81
  45. package/dist/esm/catalyst.js +1 -1
  46. package/dist/esm/loader.js +1 -1
  47. package/dist/types/components/cat-dropdown/cat-dropdown.d.ts +10 -3
  48. package/dist/types/components/cat-menu-item/cat-menu-item.d.ts +3 -1
  49. package/dist/types/components.d.ts +8 -0
  50. package/package.json +2 -4
  51. package/dist/catalyst/p-c04eb2d3.entry.js +0 -10
  52. package/dist/catalyst/p-c04eb2d3.entry.js.map +0 -1
@@ -42,7 +42,7 @@ const CatAlert = class {
42
42
  setAttributeDefault(this, 'role', this.mapRole.get(this.color));
43
43
  }
44
44
  render() {
45
- return (h(Host, { key: '69fa5ac520b7473f3e64c7aa08f1f706a0e84777' }, !this.noIcon && h("cat-icon", { key: '6350faf2c7748f5366040eb861b999adb094f746', size: "l", icon: this.icon || this.mapIcon.get(this.color) }), h("div", { key: '566add2aa7d14f4118104a1f1ed43ae7600cd0b0', class: "content" }, h("slot", { key: '18cb577bd42e5386ddac4a6226426bcab9260415' }))));
45
+ return (h(Host, { key: '02844ee6d6dc5d365bee542ee873280b2b7040fc' }, !this.noIcon && h("cat-icon", { key: 'e3497771224d89279b9d4d1f4d83014066504ede', size: "l", icon: this.icon || this.mapIcon.get(this.color) }), h("div", { key: '219d03b29ec237228366c2df596c148429685483', class: "content" }, h("slot", { key: '13a11b580fe9a6ac0707e49120809e97e3b05cd5' }))));
46
46
  }
47
47
  get hostElement() { return getElement(this); }
48
48
  };
@@ -323,7 +323,7 @@ const CatBadge = class {
323
323
  }
324
324
  }
325
325
  render() {
326
- return (h(Host, { key: 'b11c4ad289bf67783fe98e9e6b9ac0d390fc9cdb', "data-icon-badge": this.isIconBadge ? this.size : null }, this.hasPrefixIcon ? h("cat-icon", { icon: this.icon, size: this.iconSize, part: "prefix" }) : null, this.isIconBadge ? (h("cat-icon", { icon: this.icon, size: this.iconSize, class: "icon-only" })) : (h("slot", null)), this.hasSuffixIcon ? h("cat-icon", { icon: this.icon, size: this.iconSize, part: "prefix" }) : null));
326
+ return (h(Host, { key: '5c22fb2216adbb84af5bbcbc1cdc97a4fc2e7f2a', "data-icon-badge": this.isIconBadge ? this.size : null }, this.hasPrefixIcon ? h("cat-icon", { icon: this.icon, size: this.iconSize, part: "prefix" }) : null, this.isIconBadge ? (h("cat-icon", { icon: this.icon, size: this.iconSize, class: "icon-only" })) : (h("slot", null)), this.hasSuffixIcon ? h("cat-icon", { icon: this.icon, size: this.iconSize, part: "prefix" }) : null));
327
327
  }
328
328
  get hostElement() { return getElement(this); }
329
329
  static get watchers() { return {
@@ -555,7 +555,7 @@ const CatButtonGroup = class {
555
555
  this.buttonElements = [];
556
556
  }
557
557
  render() {
558
- return (h(Host, { key: '3bf39dc84ed4e47a328927f937eb956ace5f6f71', role: "group", "aria-label": this.a11yLabel }, h("slot", { key: '843ae7ed619e04239a405250cd83f83e694bfde9', onSlotchange: this.onSlotChange.bind(this) })));
558
+ return (h(Host, { key: 'a34efc8e64ae1322adc48696bf2c04cc2d1e429c', role: "group", "aria-label": this.a11yLabel }, h("slot", { key: '9149f38be769cef00801abacbb03dd0c95850f12', onSlotchange: this.onSlotChange.bind(this) })));
559
559
  }
560
560
  onSlotChange() {
561
561
  this.buttonElements = Array.from(this.hostElement.querySelectorAll(':scope > cat-button, :scope > cat-tooltip > cat-button, :scope > cat-dropdown cat-button[slot="trigger"]'));
@@ -576,7 +576,7 @@ const CatCard = class {
576
576
  this.catLoad = createEvent(this, "catLoad");
577
577
  }
578
578
  render() {
579
- return h("slot", { key: '462ccb0dce9a3bb536ff1f69caf8a04c02565344' });
579
+ return h("slot", { key: '2ddd44a7ce4d8c664f1161710a7a65461c37875f' });
580
580
  }
581
581
  componentDidLoad() {
582
582
  this.catLoad.emit();
@@ -692,13 +692,13 @@ const CatCheckbox = class {
692
692
  this.input.blur();
693
693
  }
694
694
  render() {
695
- return (h(Host, { key: 'eb33a26363bc39edc83c1b1312c85f805e8e3894' }, h("label", { key: 'f8094c4c8859d30a4fe6096efad161a4503b2896', htmlFor: this.id, class: {
695
+ return (h(Host, { key: '3b747366d141c2e3c678f33841eca2983b9161c9' }, h("label", { key: '2ee8575df8a269ef821a980add768a668d3e208b', htmlFor: this.id, class: {
696
696
  'is-hidden': this.labelHidden,
697
697
  'is-disabled': this.disabled,
698
698
  'label-left': this.labelLeft,
699
699
  'align-center': this.alignment === 'center',
700
700
  'align-end': this.alignment === 'bottom'
701
- } }, h("input", { key: '02c15b7985af4252f45ff04ebd977e3c09883949', "data-test": this.testId, ...this.nativeAttributes, part: "input", ref: el => (this.input = el), id: this.id, type: "checkbox", name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, indeterminate: this.indeterminate, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this), "aria-describedby": this.hasHint ? this.id + '-hint' : undefined }), h("span", { key: 'b4a30c339f54ab5ae1b7f9e31f6d0c409c6c2613', class: "box", "aria-hidden": "true" }, h("svg", { key: 'e3d0faed8b2d2d59fab9b8a2c011dd4d6aa5b338', class: "check", viewBox: "0 0 12 10" }, h("polyline", { key: '7f1d041823ce9ed4c4b1496b61de9c5767979ff7', points: "1.5 6 4.5 9 10.5 1" })), h("svg", { key: 'dd636bd06ab6cf5918edaacb63091d9eb09ae0af', class: "dash", viewBox: "0 0 12 10" }, h("polyline", { key: 'b46f113aae6d0e8e3bb5cd1a2740a7d7422ea749', points: "1.5 5 10.5 5" }))), h("span", { key: 'c0266346a2d7b22f8e18dba57737cd098217b08a', class: { label: true, 'label-wrapper': !this.hasSlottedLabel }, part: "label" }, (this.hasSlottedLabel && h("slot", { key: '2416235aa2a02df58f4d96337215725e426a729a', name: "label" })) || this.label, h("span", { key: '4da54bdb128f377225732f2c7d69bf205d5098c1', class: "label-metadata" }, !this.required && (this.requiredMarker ?? 'optional').startsWith('optional') && (h("span", { key: '70b0dfdf0c4210394a09adb83866d6566a1df025', class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.optional'), ")")), this.required && this.requiredMarker?.startsWith('required') && (h("span", { key: 'a49f720ae915fd3054748184d89fbe9c784cc730', class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.required'), ")"))))), this.hasHint && (h("div", { key: '10630551393491643e19ff001840aed935f78645', class: { 'hint-wrapper': true, 'label-left': this.labelLeft } }, h("div", { key: 'f4236a3a4c2f573bcd77311ed009e4d09ffb73af', class: "box-placeholder" }), h(CatFormHint, { key: '85c1227154f23e6e52a36fe7184fcb1ab999160e', id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }) })))));
701
+ } }, h("input", { key: 'aad1de3b8d7dd4eeb0e72166ba1decd79bd25f18', "data-test": this.testId, ...this.nativeAttributes, part: "input", ref: el => (this.input = el), id: this.id, type: "checkbox", name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, indeterminate: this.indeterminate, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this), "aria-describedby": this.hasHint ? this.id + '-hint' : undefined }), h("span", { key: '387095d0a3fdb1820fdc7d3111c9475792865255', class: "box", "aria-hidden": "true" }, h("svg", { key: '94bc42f4729c8ac50d786029d1a2b4446371b1dd', class: "check", viewBox: "0 0 12 10" }, h("polyline", { key: 'b6c0c742108523bafa656aad76fde132748f673d', points: "1.5 6 4.5 9 10.5 1" })), h("svg", { key: '51d990d4002736670ea32bf9ee10f90918ea6856', class: "dash", viewBox: "0 0 12 10" }, h("polyline", { key: '882eb8cf57188490f0b57a052908c52780c708a3', points: "1.5 5 10.5 5" }))), h("span", { key: '36df32838873f91f1b86ed93f5f20e6f7fba8e83', class: { label: true, 'label-wrapper': !this.hasSlottedLabel }, part: "label" }, (this.hasSlottedLabel && h("slot", { key: '568163747405bb172ac389293d1e02eb586d2afe', name: "label" })) || this.label, h("span", { key: '1a95817d8a270fcfba8cdbd20832142358cf793c', class: "label-metadata" }, !this.required && (this.requiredMarker ?? 'optional').startsWith('optional') && (h("span", { key: '59b897e56020aedf0dc7f5d847b16cb4059505d5', class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.optional'), ")")), this.required && this.requiredMarker?.startsWith('required') && (h("span", { key: '3482694fe72455fb0e0d96d7760cdd01044cb45c', class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.required'), ")"))))), this.hasHint && (h("div", { key: 'f4d2064c5e48dc7131838e62baa941899fa7e3fc', class: { 'hint-wrapper': true, 'label-left': this.labelLeft } }, h("div", { key: '1909aa219d7476643da16e2985c5763c770ef382', class: "box-placeholder" }), h(CatFormHint, { key: 'bd850f88c63eadfc4f1082d71c0781db8cb558b6', id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }) })))));
702
702
  }
703
703
  get hasHint() {
704
704
  return !!this.hint || !!this.hasSlottedHint;
@@ -935,14 +935,14 @@ const CatDate = class {
935
935
  }
936
936
  render() {
937
937
  this.hostElement.tabIndex = Number(this.hostElement.getAttribute('tabindex')) || 0;
938
- return (h(Host, { key: '664187eb3780f94f61b463088cf6a056a3107af5' }, h("cat-input", { key: '42e6d9c9edff8a699c81d98873164eb755aeaeab', 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 => {
938
+ return (h(Host, { key: 'b579a4b31629206532b1a91ea9dd9b2634f0536b' }, h("cat-input", { key: '55c5c4dfaaa13d229e74d83569b6e99e7a5ce146', 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 => {
939
939
  this.inputFocused = e.target === this.input;
940
940
  e.stopPropagation();
941
941
  this.catFocus.emit(e.detail);
942
942
  }, onCatBlur: e => {
943
943
  e.stopPropagation();
944
944
  this.onInputBlur(e.detail);
945
- } }, h("span", { key: '36b14afb75c694a1559e4b5539a2bde0be1f59bc', slot: "label" }, this.label, h("span", { key: 'f541147e5515a679db3adcf4c93c52514b9c9cb3', class: "label-aria" }, " (", this.locale.formatStr, ")")), h("cat-dropdown", { key: '5a73b806ed95c3c6367a5b74d764b31cba4ded92', slot: "addon", placement: this.placement, arrowNavigation: "none", noResize: true, onCatOpen: () => this.dateInline?.resetView() }, h("cat-button", { key: 'ae9da7387e3baf2b1989c9b5d5c9b82d30257c69', slot: "trigger", icon: "$cat:datepicker-calendar", iconOnly: true, class: "cat-date-toggle", disabled: this.disabled, a11yLabel: this.getTriggerA11yLabel() }), h("div", { key: 'b255073bb1ce8e57def9f61c1b347880f9115533', slot: "content" }, h("cat-date-inline", { key: '07e019b2872994198e8cb56a54e12e24b2cb81a4', 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) }))))));
945
+ } }, h("span", { key: 'cb362f3eb82c46adb276ec16069b5f25181c342a', slot: "label" }, this.label, h("span", { key: '7c226f594c97ceda86dc5da3500ff78665381abc', class: "label-aria" }, " (", this.locale.formatStr, ")")), h("cat-dropdown", { key: '98f13bc9d41b2c3f946007bf5f2d42ac62faab9b', slot: "addon", placement: this.placement, arrowNavigation: "none", noResize: true, onCatOpen: () => this.dateInline?.resetView() }, h("cat-button", { key: 'a801df892743f0e60f4a205fde7c62546a24625b', slot: "trigger", icon: "$cat:datepicker-calendar", iconOnly: true, class: "cat-date-toggle", disabled: this.disabled, a11yLabel: this.getTriggerA11yLabel() }), h("div", { key: '5253067cb8500afa512d9e495610b17d08511edc', slot: "content" }, h("cat-date-inline", { key: '1867958d9ef4c9452a0f0ddcd8aed673f9c595b2', 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) }))))));
946
946
  }
947
947
  getTriggerA11yLabel() {
948
948
  const date = this.locale.fromLocalISO(this.value);
@@ -1766,12 +1766,12 @@ const CatDateInline = class {
1766
1766
  const [minDate, maxDate] = this.getMinMaxDate();
1767
1767
  const dateGrid = this.dateGrid(this.viewDate.getFullYear(), this.viewDate.getMonth());
1768
1768
  const [dateStart, dateEnd] = this.getValue();
1769
- return (h(Host, { key: '0f06004b6e4a37950a8933175e66694e685a254d', "aria-label": this.label || undefined }, h("div", { key: '50eb04ff252b57dfaca6fcd612e3f4b6defda40d', class: { 'label-container': true, 'label-hidden': this.labelHidden } }, (this.hasSlottedLabel || this.label) && (h("label", { key: 'f19844d5b24c2dc5de7b68d4de4988593582b6c3', id: `${this.id}-label`, htmlFor: this.id, part: "label", onClick: () => this.doFocus() }, h("span", { key: 'c5fd299ba527527ad4025d28fa3e74f7daba201f', class: "label-wrapper" }, (this.hasSlottedLabel && h("slot", { key: 'b20d1bd0440adac6f5c32e7cc11d5274882f913b', name: "label" })) || this.label, h("div", { key: '701a18fc68395264285e01d5bad7b111970f4f0a', class: "label-metadata" }, !this.required && (this.requiredMarker ?? 'optional').startsWith('optional') && (h("span", { key: '2d82d9fa7ffca66b45f17201467b1d3ecf6ff0df', class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.optional'), ")")), this.required && this.requiredMarker?.startsWith('required') && (h("span", { key: '06094565395b6054d89cac6ce4399947387d2c88', class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.required'), ")"))))))), h("div", { key: 'd5082f212000ef6738235d32a0bc117a06074573', class: { picker: true, 'picker-weeks': this.weeks }, id: this.id, "aria-describedby": `${this.id}-label` }, h("div", { key: 'd085532af173d7224e8b9f12e3fe332d3aba4030', class: "picker-head" }, h("cat-button", { key: '162d251a5a27bd2b14cb7e4a0dc1365ee55da01f', icon: "$cat:datepicker-year-prev", iconOnly: true, size: "xs", variant: "text", "a11y-label": this.locale.prevYear, disabled: isSameYear(this.viewDate, minDate), onClick: () => this.navigate('prev', 'year'), "data-dropdown-no-close": true }), h("cat-button", { key: 'eddfec3c6484b63c4292b688112966f23e0db900', icon: "$cat:datepicker-month-prev", iconOnly: true, size: "xs", variant: "text", "a11y-label": this.locale.prevMonth, disabled: isSameMonth(this.viewDate, minDate), onClick: () => this.navigate('prev', 'month'), "data-dropdown-no-close": true }), h("h3", { key: '874b1707cc80604429797ae273526d6db311619a' }, this.getHeadline()), h("cat-button", { key: '738f739252c1bd6e036aad7bfddbb76a86db3a17', icon: "$cat:datepicker-month-next", iconOnly: true, size: "xs", variant: "text", "a11y-label": this.locale.nextMonth, disabled: isSameMonth(this.viewDate, maxDate), onClick: () => this.navigate('next', 'month'), "data-dropdown-no-close": true }), h("cat-button", { key: '935f968b3a1ea7879a5aa38163d8edc4fcdaea64', icon: "$cat:datepicker-year-next", iconOnly: true, size: "xs", variant: "text", "a11y-label": this.locale.nextYear, disabled: isSameYear(this.viewDate, maxDate), onClick: () => this.navigate('next', 'year'), "data-dropdown-no-close": true })), h("div", { key: '7f9a940cf201568daed8b4b35e44e74f61967188', class: "picker-grid", onFocusin: () => this.setAriaLive(this.locale.arrowKeys) }, h("div", { key: '750c7dc2abe47cf05b75ba21e7c13ac153b07363', class: "picker-grid-head" }, Array.from(Array(7), (_, i) => {
1769
+ return (h(Host, { key: 'ca4f74e4e26b4240c2ac5a88a5ff501f6f9fbfc0', "aria-label": this.label || undefined }, h("div", { key: '30d452f2a08102ce54cc169fe444f83ac24521c4', class: { 'label-container': true, 'label-hidden': this.labelHidden } }, (this.hasSlottedLabel || this.label) && (h("label", { key: '3e5f7c62688dafcdd99cf77477b84ddcfcb262f6', id: `${this.id}-label`, htmlFor: this.id, part: "label", onClick: () => this.doFocus() }, h("span", { key: '3c6ce82acb14c46c83d56f50dda4015b4d30874e', class: "label-wrapper" }, (this.hasSlottedLabel && h("slot", { key: '1540ccc41e02740a69023a2c5ca839320d03e70d', name: "label" })) || this.label, h("div", { key: '64708a81ac29b0ab9509dc2f7fc8709a7594b400', class: "label-metadata" }, !this.required && (this.requiredMarker ?? 'optional').startsWith('optional') && (h("span", { key: '3f5da06e86b4c202f86c034ea74256e4f0c21dba', class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.optional'), ")")), this.required && this.requiredMarker?.startsWith('required') && (h("span", { key: 'd0a77ed00b40a9f676b4dbf27101783c038fea29', class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.required'), ")"))))))), h("div", { key: 'b7f667802033e1c2fe55268b1d677789ea7ae8fc', class: { picker: true, 'picker-weeks': this.weeks }, id: this.id, "aria-describedby": `${this.id}-label` }, h("div", { key: '9ef0de6c6d7dd9d87c1002c63317a6ce0fc64cc4', class: "picker-head" }, h("cat-button", { key: '12455ccb1d3fa0f68f18e4103a84dd0542a013e1', icon: "$cat:datepicker-year-prev", iconOnly: true, size: "xs", variant: "text", "a11y-label": this.locale.prevYear, disabled: isSameYear(this.viewDate, minDate), onClick: () => this.navigate('prev', 'year'), "data-dropdown-no-close": true }), h("cat-button", { key: '313d660fb3fa61b1de67a7b6b12dae22b48a8299', icon: "$cat:datepicker-month-prev", iconOnly: true, size: "xs", variant: "text", "a11y-label": this.locale.prevMonth, disabled: isSameMonth(this.viewDate, minDate), onClick: () => this.navigate('prev', 'month'), "data-dropdown-no-close": true }), h("h3", { key: 'c7628a8f071cba27d3b8ee6ed9a9239d26d0ed6e' }, this.getHeadline()), h("cat-button", { key: '11fd72dc5bd661ac9189bb2e0cd3eba0a25ce8ab', icon: "$cat:datepicker-month-next", iconOnly: true, size: "xs", variant: "text", "a11y-label": this.locale.nextMonth, disabled: isSameMonth(this.viewDate, maxDate), onClick: () => this.navigate('next', 'month'), "data-dropdown-no-close": true }), h("cat-button", { key: '56936eff41884c6e5112587843518d2031b86eda', icon: "$cat:datepicker-year-next", iconOnly: true, size: "xs", variant: "text", "a11y-label": this.locale.nextYear, disabled: isSameYear(this.viewDate, maxDate), onClick: () => this.navigate('next', 'year'), "data-dropdown-no-close": true })), h("div", { key: 'c8de1f15b1885a396c19b24344da471336036874', class: "picker-grid", onFocusin: () => this.setAriaLive(this.locale.arrowKeys) }, h("div", { key: 'fcb71d996b515d8d0cb36d69249c1737f79599be', class: "picker-grid-head" }, Array.from(Array(7), (_, i) => {
1770
1770
  const day = (i + this.locale.weekInfo.firstDay) % 7;
1771
1771
  return h("abbr", { title: this.locale.days.long[day] }, this.locale.days.short[day]);
1772
- })), this.weeks && (h("div", { key: '661cecfeef5e835e2e95b267c39a8608e40789d1', class: "picker-grid-weeks" }, dateGrid
1772
+ })), this.weeks && (h("div", { key: '2e9f70a7a94d7f19adfe5ad1a8c5079fbd0e25fd', class: "picker-grid-weeks" }, dateGrid
1773
1773
  .filter((_, i) => i % 7 === 0)
1774
- .map(day => (h("div", null, this.getWeekNumber(day)))))), h("div", { key: '215f61a30ec58c84d549181a8c216dc847bdbfa5', class: "picker-grid-days" }, dateGrid.map(day => {
1774
+ .map(day => (h("div", null, this.getWeekNumber(day)))))), h("div", { key: '59b9726035ea9a1ab7aa99228c841817522692c1', class: "picker-grid-days" }, dateGrid.map(day => {
1775
1775
  const isStartDate = isSameDay(dateStart, day);
1776
1776
  const isEndDate = isSameDay(dateEnd, day);
1777
1777
  const isRange = !!dateStart && !!dateEnd && day > dateStart && day < dateEnd;
@@ -1788,7 +1788,7 @@ const CatDateInline = class {
1788
1788
  'date-focusable': this.canFocus(day),
1789
1789
  'date-disabled': !this.canClick(day)
1790
1790
  }, nativeAttributes: !this.canFocus(day) ? { tabindex: '-1' } : {}, variant: isStartDate || isEndDate ? 'filled' : isToday ? 'outlined' : 'text', a11yLabel: this.locale.toLocalStr(day), active: isStartDate || isEndDate || isRange, color: isStartDate || isEndDate || isToday ? 'primary' : 'secondary', disabled: !this.canClick(day), onClick: () => this.select(day), "data-date": this.locale.toLocalISO(day) }, day.getDate()));
1791
- }))), h("div", { key: 'cede3e1fd2319aca96f3afccbab3113f17d4229b', class: "picker-foot" }, !this.noToday && this.canClick(this.locale.now()) && (h("cat-button", { key: '93dd8019983d1ae458706dbc62ad13e3131c29a5', size: "s", "data-dropdown-no-close": true, onClick: () => this.select(this.locale.now()) }, this.locale.today)), this.hint && h("p", { key: '4836275c3b11b58d94f31c1c1f00f5bb3e9645b5', class: "cursor-help" }, this.locale.arrowKeys), !this.noClear && (h("cat-button", { key: '58440f20e7ecd65dd8e2f136b11cb9b5a4379b79', size: "s", disabled: !this.value, "data-dropdown-no-close": true, onClick: () => this.clear() }, this.locale.clear)))), h("p", { key: '3a3507b2e3b4c0452e35f8eb78b2dd21c31e2c9d', class: "cursor-aria", "aria-live": "polite" })));
1791
+ }))), h("div", { key: 'e879de98e8433a0ef17f715ff48686307f401634', class: "picker-foot" }, !this.noToday && this.canClick(this.locale.now()) && (h("cat-button", { key: '34c99fbd08c4ef2dab9a390c2d208f726a2d7645', size: "s", "data-dropdown-no-close": true, onClick: () => this.select(this.locale.now()) }, this.locale.today)), this.hint && h("p", { key: 'd958de3864e0c29daf885af05162ed3f123c08f2', class: "cursor-help" }, this.locale.arrowKeys), !this.noClear && (h("cat-button", { key: 'd7f3902bc982a060318fb3e51e9e2a00b43af618', size: "s", disabled: !this.value, "data-dropdown-no-close": true, onClick: () => this.clear() }, this.locale.clear)))), h("p", { key: '68f6e23f25d229b31afcfb2b1f51c8f42eb28282', class: "cursor-aria", "aria-live": "polite" })));
1792
1792
  }
1793
1793
  focus(date, focus = true) {
1794
1794
  const [minDate, maxDate] = this.getMinMaxDate();
@@ -4719,10 +4719,6 @@ const oppositeSideMap = {
4719
4719
  bottom: 'top',
4720
4720
  top: 'bottom'
4721
4721
  };
4722
- const oppositeAlignmentMap = {
4723
- start: 'end',
4724
- end: 'start'
4725
- };
4726
4722
  function clamp(start, value, end) {
4727
4723
  return max(start, min(value, end));
4728
4724
  }
@@ -4741,9 +4737,9 @@ function getOppositeAxis(axis) {
4741
4737
  function getAxisLength(axis) {
4742
4738
  return axis === 'y' ? 'height' : 'width';
4743
4739
  }
4744
- const yAxisSides = /*#__PURE__*/new Set(['top', 'bottom']);
4745
4740
  function getSideAxis(placement) {
4746
- return yAxisSides.has(getSide(placement)) ? 'y' : 'x';
4741
+ const firstChar = placement[0];
4742
+ return firstChar === 't' || firstChar === 'b' ? 'y' : 'x';
4747
4743
  }
4748
4744
  function getAlignmentAxis(placement) {
4749
4745
  return getOppositeAxis(getSideAxis(placement));
@@ -4766,7 +4762,7 @@ function getExpandedPlacements(placement) {
4766
4762
  return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
4767
4763
  }
4768
4764
  function getOppositeAlignmentPlacement(placement) {
4769
- return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
4765
+ return placement.includes('start') ? placement.replace('start', 'end') : placement.replace('end', 'start');
4770
4766
  }
4771
4767
  const lrPlacement = ['left', 'right'];
4772
4768
  const rlPlacement = ['right', 'left'];
@@ -4797,7 +4793,8 @@ function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
4797
4793
  return list;
4798
4794
  }
4799
4795
  function getOppositePlacement(placement) {
4800
- return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);
4796
+ const side = getSide(placement);
4797
+ return oppositeSideMap[side] + placement.slice(side.length);
4801
4798
  }
4802
4799
  function expandPaddingObject(padding) {
4803
4800
  return {
@@ -4956,6 +4953,9 @@ async function detectOverflow(state, options) {
4956
4953
  };
4957
4954
  }
4958
4955
 
4956
+ // Maximum number of resets that can occur before bailing to avoid infinite reset loops.
4957
+ const MAX_RESET_COUNT = 50;
4958
+
4959
4959
  /**
4960
4960
  * Computes the `x` and `y` coordinates that will place the floating element
4961
4961
  * next to a given reference element.
@@ -4970,7 +4970,10 @@ const computePosition$1 = async (reference, floating, config) => {
4970
4970
  middleware = [],
4971
4971
  platform
4972
4972
  } = config;
4973
- const validMiddleware = middleware.filter(Boolean);
4973
+ const platformWithDetectOverflow = platform.detectOverflow ? platform : {
4974
+ ...platform,
4975
+ detectOverflow
4976
+ };
4974
4977
  const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
4975
4978
  let rects = await platform.getElementRects({
4976
4979
  reference,
@@ -4982,14 +4985,17 @@ const computePosition$1 = async (reference, floating, config) => {
4982
4985
  y
4983
4986
  } = computeCoordsFromPlacement(rects, placement, rtl);
4984
4987
  let statefulPlacement = placement;
4985
- let middlewareData = {};
4986
4988
  let resetCount = 0;
4987
- for (let i = 0; i < validMiddleware.length; i++) {
4988
- var _platform$detectOverf;
4989
+ const middlewareData = {};
4990
+ for (let i = 0; i < middleware.length; i++) {
4991
+ const currentMiddleware = middleware[i];
4992
+ if (!currentMiddleware) {
4993
+ continue;
4994
+ }
4989
4995
  const {
4990
4996
  name,
4991
4997
  fn
4992
- } = validMiddleware[i];
4998
+ } = currentMiddleware;
4993
4999
  const {
4994
5000
  x: nextX,
4995
5001
  y: nextY,
@@ -5003,10 +5009,7 @@ const computePosition$1 = async (reference, floating, config) => {
5003
5009
  strategy,
5004
5010
  middlewareData,
5005
5011
  rects,
5006
- platform: {
5007
- ...platform,
5008
- detectOverflow: (_platform$detectOverf = platform.detectOverflow) != null ? _platform$detectOverf : detectOverflow
5009
- },
5012
+ platform: platformWithDetectOverflow,
5010
5013
  elements: {
5011
5014
  reference,
5012
5015
  floating
@@ -5014,14 +5017,11 @@ const computePosition$1 = async (reference, floating, config) => {
5014
5017
  });
5015
5018
  x = nextX != null ? nextX : x;
5016
5019
  y = nextY != null ? nextY : y;
5017
- middlewareData = {
5018
- ...middlewareData,
5019
- [name]: {
5020
- ...middlewareData[name],
5021
- ...data
5022
- }
5020
+ middlewareData[name] = {
5021
+ ...middlewareData[name],
5022
+ ...data
5023
5023
  };
5024
- if (reset && resetCount <= 50) {
5024
+ if (reset && resetCount < MAX_RESET_COUNT) {
5025
5025
  resetCount++;
5026
5026
  if (typeof reset === 'object') {
5027
5027
  if (reset.placement) {
@@ -5476,7 +5476,6 @@ function isShadowRoot(value) {
5476
5476
  }
5477
5477
  return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
5478
5478
  }
5479
- const invalidOverflowDisplayValues = /*#__PURE__*/new Set(['inline', 'contents']);
5480
5479
  function isOverflowElement(element) {
5481
5480
  const {
5482
5481
  overflow,
@@ -5484,32 +5483,35 @@ function isOverflowElement(element) {
5484
5483
  overflowY,
5485
5484
  display
5486
5485
  } = getComputedStyle$1(element);
5487
- return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);
5486
+ return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== 'inline' && display !== 'contents';
5488
5487
  }
5489
- const tableElements = /*#__PURE__*/new Set(['table', 'td', 'th']);
5490
5488
  function isTableElement(element) {
5491
- return tableElements.has(getNodeName(element));
5489
+ return /^(table|td|th)$/.test(getNodeName(element));
5492
5490
  }
5493
- const topLayerSelectors = [':popover-open', ':modal'];
5494
5491
  function isTopLayer(element) {
5495
- return topLayerSelectors.some(selector => {
5496
- try {
5497
- return element.matches(selector);
5498
- } catch (_e) {
5499
- return false;
5492
+ try {
5493
+ if (element.matches(':popover-open')) {
5494
+ return true;
5500
5495
  }
5501
- });
5496
+ } catch (_e) {
5497
+ // no-op
5498
+ }
5499
+ try {
5500
+ return element.matches(':modal');
5501
+ } catch (_e) {
5502
+ return false;
5503
+ }
5502
5504
  }
5503
- const transformProperties = ['transform', 'translate', 'scale', 'rotate', 'perspective'];
5504
- const willChangeValues = ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'];
5505
- const containValues = ['paint', 'layout', 'strict', 'content'];
5505
+ const willChangeRe = /transform|translate|scale|rotate|perspective|filter/;
5506
+ const containRe = /paint|layout|strict|content/;
5507
+ const isNotNone = value => !!value && value !== 'none';
5508
+ let isWebKitValue;
5506
5509
  function isContainingBlock(elementOrCss) {
5507
- const webkit = isWebKit();
5508
5510
  const css = isElement(elementOrCss) ? getComputedStyle$1(elementOrCss) : elementOrCss;
5509
5511
 
5510
5512
  // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
5511
5513
  // https://drafts.csswg.org/css-transforms-2/#individual-transforms
5512
- return transformProperties.some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || willChangeValues.some(value => (css.willChange || '').includes(value)) || containValues.some(value => (css.contain || '').includes(value));
5514
+ return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || '') || containRe.test(css.contain || '');
5513
5515
  }
5514
5516
  function getContainingBlock(element) {
5515
5517
  let currentNode = getParentNode(element);
@@ -5524,12 +5526,13 @@ function getContainingBlock(element) {
5524
5526
  return null;
5525
5527
  }
5526
5528
  function isWebKit() {
5527
- if (typeof CSS === 'undefined' || !CSS.supports) return false;
5528
- return CSS.supports('-webkit-backdrop-filter', 'none');
5529
+ if (isWebKitValue == null) {
5530
+ isWebKitValue = typeof CSS !== 'undefined' && CSS.supports && CSS.supports('-webkit-backdrop-filter', 'none');
5531
+ }
5532
+ return isWebKitValue;
5529
5533
  }
5530
- const lastTraversableNodeNames = /*#__PURE__*/new Set(['html', 'body', '#document']);
5531
5534
  function isLastTraversableNode(node) {
5532
- return lastTraversableNodeNames.has(getNodeName(node));
5535
+ return /^(html|body|#document)$/.test(getNodeName(node));
5533
5536
  }
5534
5537
  function getComputedStyle$1(element) {
5535
5538
  return getWindow(element).getComputedStyle(element);
@@ -5585,8 +5588,9 @@ function getOverflowAncestors(node, list, traverseIframes) {
5585
5588
  if (isBody) {
5586
5589
  const frameElement = getFrameElement(win);
5587
5590
  return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
5591
+ } else {
5592
+ return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
5588
5593
  }
5589
- return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
5590
5594
  }
5591
5595
  function getFrameElement(win) {
5592
5596
  return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
@@ -6422,7 +6426,7 @@ const CatDatepickerFlat = class {
6422
6426
  }
6423
6427
  render() {
6424
6428
  return [
6425
- h("cat-input", { key: 'd81f695ecf9eb3dd175a14070811b8ca99e13f67', 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 => {
6429
+ h("cat-input", { key: '199c9fd2a919b876106eaab58a37a6d286654c27', 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 => {
6426
6430
  e.stopPropagation();
6427
6431
  this.value = e.detail || undefined;
6428
6432
  }, onCatFocus: e => {
@@ -6431,8 +6435,8 @@ const CatDatepickerFlat = class {
6431
6435
  }, onCatBlur: e => {
6432
6436
  e.stopPropagation();
6433
6437
  this.catBlur.emit(e.detail);
6434
- } }, this.hasSlottedLabel && (h("span", { key: '41f0dfcbe0a7ab562a80416a109ee6283d602147', slot: "label" }, h("slot", { key: '4148dec98c036b3f7d604b16c05dfed648ec16a3', name: "label" }))), this.hasSlottedHint && (h("span", { key: '8181253f8adadc606f0d66abe5bad5a85b7a0f7f', slot: "hint" }, h("slot", { key: 'c6807aed385298a19d67e1f2652de82473ea6f16', name: "hint" })))),
6435
- h("div", { key: '8b0f02c5f6cf61ad89dccd831937649c6740035c', ref: el => (this._calendarWrapper = el), class: "datepicker-wrapper" })
6438
+ } }, this.hasSlottedLabel && (h("span", { key: 'aedecd1ff7f34f8f038df57c3fb42bdd3282273e', slot: "label" }, h("slot", { key: 'a86b6a3bd04da7fde60ddb19df4142e9ff39c0fe', name: "label" }))), this.hasSlottedHint && (h("span", { key: '70f4739871308bcd4fa88e265a2ec5c8e5eeff35', slot: "hint" }, h("slot", { key: '8cc4b602ae9064da5816653ca2dfb918329e26d3', name: "hint" })))),
6439
+ h("div", { key: 'abc43645698cf1b209598f8a34432d6be0c9e519', ref: el => (this._calendarWrapper = el), class: "datepicker-wrapper" })
6436
6440
  ];
6437
6441
  }
6438
6442
  initDatepicker(input) {
@@ -6542,11 +6546,11 @@ const CatDatepickerInline = class {
6542
6546
  this.pickr = this.initDatepicker(this.input);
6543
6547
  }
6544
6548
  render() {
6545
- return (h(Host, { key: '22ff03e4cb6c74bc944e5022764308b6d2b2fe29' }, h("div", { key: '1c7e6b0beab570e1357014384ab8eaf76458858f', tabIndex: this.disabled || this.readonly ? -1 : undefined, class: {
6549
+ return (h(Host, { key: '3a51929cf5486122309a0949df55b414bfa83462' }, h("div", { key: 'ad94b1019c6013d04af429702d23d996927567a9', tabIndex: this.disabled || this.readonly ? -1 : undefined, class: {
6546
6550
  'datepicker-wrapper': true,
6547
6551
  'datepicker-disabled': this.disabled,
6548
6552
  'datepicker-readonly': this.readonly
6549
- } }, h("input", { key: '75edfdc337ba101bd0cb9afa1ddef11571e94bf9', ref: el => (this.input = el), value: this.value, disabled: this.disabled, readonly: this.readonly }))));
6553
+ } }, h("input", { key: '0edefcd24538d19c49fb57eab6cb4ed5a19f22ce', ref: el => (this.input = el), value: this.value, disabled: this.disabled, readonly: this.readonly }))));
6550
6554
  }
6551
6555
  initDatepicker(input) {
6552
6556
  if (!input) {
@@ -7686,6 +7690,9 @@ const CatDropdown = class {
7686
7690
  * @internal
7687
7691
  */
7688
7692
  this.focusTrap = true;
7693
+ this.boundWindowClickListener = this.windowClickListener.bind(this);
7694
+ this.boundWindowMousedownListener = this.windowMousedownListener.bind(this);
7695
+ this.boundWindowTouchStartListener = this.windowTouchStartListener.bind(this);
7689
7696
  }
7690
7697
  /**
7691
7698
  * Whether the dropdown is open.
@@ -7707,6 +7714,7 @@ const CatDropdown = class {
7707
7714
  path.includes(this.content) &&
7708
7715
  // check if click was not on a trigger for a sub-dropdown
7709
7716
  event.target?.slot !== 'trigger' &&
7717
+ !event.target.subMenu &&
7710
7718
  // check if click was not an element marked with data-dropdown-no-close
7711
7719
  !path.slice(0, path.indexOf(this.content)).find(el => this.hasAttribute(el, 'data-dropdown-no-close'))) {
7712
7720
  this.close();
@@ -7717,13 +7725,13 @@ const CatDropdown = class {
7717
7725
  this.close();
7718
7726
  }
7719
7727
  }
7720
- globalClickHandler(event) {
7728
+ windowClickListener(event) {
7721
7729
  this.handleClickOutside(event);
7722
7730
  }
7723
- globalMouseDownHandler(event) {
7731
+ windowMousedownListener(event) {
7724
7732
  this.handleClickOutside(event);
7725
7733
  }
7726
- globalTouchStartHandler(event) {
7734
+ windowTouchStartListener(event) {
7727
7735
  this.handleClickOutside(event);
7728
7736
  }
7729
7737
  /**
@@ -7761,6 +7769,8 @@ const CatDropdown = class {
7761
7769
  : createFocusTrap(this.content, {
7762
7770
  tabbableOptions: this.tabbableOptions,
7763
7771
  allowOutsideClick: true,
7772
+ clickOutsideDeactivates: event => this.shouldCloseByClickEvent(event),
7773
+ onPostDeactivate: () => this.close(),
7764
7774
  onPostActivate: () => this.catOpen.emit(),
7765
7775
  setReturnFocus: elem => (!this.isFocusVisible || this.noReturnFocus ? false : this.trigger || elem),
7766
7776
  isKeyForward: event => {
@@ -7786,6 +7796,7 @@ const CatDropdown = class {
7786
7796
  this.trap.activate();
7787
7797
  }
7788
7798
  else {
7799
+ this.addListeners();
7789
7800
  this.catOpen.emit();
7790
7801
  }
7791
7802
  });
@@ -7804,6 +7815,7 @@ const CatDropdown = class {
7804
7815
  if (shouldReturnFocus) {
7805
7816
  this.trigger?.focus();
7806
7817
  }
7818
+ this.removeListeners();
7807
7819
  // give CSS transition time to apply
7808
7820
  setTimeout(() => {
7809
7821
  this._isOpen = false;
@@ -7828,16 +7840,31 @@ const CatDropdown = class {
7828
7840
  this.cleanupFloatingUi = undefined;
7829
7841
  }
7830
7842
  render() {
7831
- return (h(Host, { key: 'b3cd898551dc3e6d5396db1a4a14bc97cf4a2024' }, h("slot", { key: '6875cfad353891deb54ebcd5155d7ea466384131', name: "anchor", ref: el => (this.anchorSlot = el) }), h("slot", { key: '93fdda4c49a7a956f72548699200feb309779081', name: "trigger", ref: el => (this.triggerSlot = el) }), h("div", { key: '13a68b5f706e61e87599c463e58f1bf932b2d261', id: this.contentId, class: { content: true, 'overflow-auto': !this.overflow, justified: this.justify, aligned: !this.justify }, ref: el => (this.content = el) }, h("slot", { key: '06357a4a970241938900853d78c88427c6a9e69a', name: "content" }))));
7843
+ return (h(Host, { key: 'bd6c2271fbd5a3f9222cb9eb8c59d7113dc72c7a' }, h("slot", { key: '26b1d2b753fffa0f91c8ee505209c46880e9233b', name: "anchor", ref: el => (this.anchorSlot = el) }), h("slot", { key: 'ac3b213022083bdb89edf4583cc216a5308bb1d2', name: "trigger", ref: el => (this.triggerSlot = el) }), h("div", { key: 'c4849c420a3e248bc7192db3a059e3372b7612fb', id: this.contentId, class: { content: true, 'overflow-auto': !this.overflow, justified: this.justify, aligned: !this.justify }, ref: el => (this.content = el) }, h("slot", { key: '1bbcaa8a86c2726e61aff6236e01b3f4ac6004e9', name: "content" }))));
7844
+ }
7845
+ addListeners() {
7846
+ window.addEventListener('click', this.boundWindowClickListener);
7847
+ window.addEventListener('mousedown', this.boundWindowMousedownListener);
7848
+ window.addEventListener('touchstart', this.boundWindowTouchStartListener);
7849
+ }
7850
+ removeListeners() {
7851
+ window.removeEventListener('click', this.boundWindowClickListener);
7852
+ window.removeEventListener('mousedown', this.boundWindowMousedownListener);
7853
+ window.removeEventListener('touchstart', this.boundWindowTouchStartListener);
7832
7854
  }
7833
7855
  handleClickOutside(event) {
7834
- if (!this.noAutoClose &&
7856
+ if (this.shouldCloseByClickEvent(event)) {
7857
+ this.close();
7858
+ }
7859
+ }
7860
+ shouldCloseByClickEvent(event) {
7861
+ return (!this.noAutoClose &&
7835
7862
  // check if click was outside of the dropdown content
7836
7863
  !event.composedPath().includes(this.content) &&
7864
+ // check if click was on trigger - this case is handled by trigger click listener
7865
+ !event.composedPath().includes(this.trigger) &&
7837
7866
  // check if click was not on an element marked with data-dropdown-no-close
7838
- !event.composedPath().find(el => this.hasAttribute(el, 'data-dropdown-no-close'))) {
7839
- this.close();
7840
- }
7867
+ !event.composedPath().find(el => this.hasAttribute(el, 'data-dropdown-no-close')));
7841
7868
  }
7842
7869
  get contentId() {
7843
7870
  return `cat-dropdown-${this.id}`;
@@ -7973,7 +8000,7 @@ const CatFormGroup = class {
7973
8000
  });
7974
8001
  }
7975
8002
  render() {
7976
- return (h(Host, { key: '256d7b8493d24b515d9989f6c0bfa3d2af99ba67', style: { '--label-size': this.labelSize } }, h("slot", { key: '806080ce0d61ce3b64819dcb50b7bc1651b31c98', onSlotchange: this.onSlotChange.bind(this) })));
8003
+ return (h(Host, { key: 'cb3ed29df264b00c7740a97558ef5283a018c0c4', style: { '--label-size': this.labelSize } }, h("slot", { key: 'da29f356a770a8c5abc99719353e76ea565bf483', onSlotchange: this.onSlotChange.bind(this) })));
7977
8004
  }
7978
8005
  onSlotChange() {
7979
8006
  this.formElements = Array.from(this.hostElement.querySelectorAll('cat-input, cat-textarea, cat-select, cat-datepicker, cat-date, cat-time'));
@@ -8004,7 +8031,7 @@ const CatIcon = class {
8004
8031
  this.size = 'm';
8005
8032
  }
8006
8033
  render() {
8007
- return (h("span", { key: 'b7c7a3e889ebc12349f1b8f35c227feb1992f8a8', innerHTML: this.iconSrc || (this.icon ? catIconRegistry.getIcon(this.icon) : ''), "aria-label": this.a11yLabel, "aria-hidden": this.a11yLabel ? null : 'true', part: "icon", class: {
8034
+ return (h("span", { key: '7d03b1a8d0443200d1daf1a77c14ed4d75a2f74e', innerHTML: this.iconSrc || (this.icon ? catIconRegistry.getIcon(this.icon) : ''), "aria-label": this.a11yLabel, "aria-hidden": this.a11yLabel ? null : 'true', part: "icon", class: {
8008
8035
  icon: true,
8009
8036
  [`icon-${this.size}`]: this.size !== 'inline'
8010
8037
  } }));
@@ -8323,17 +8350,19 @@ const CatMenu = class {
8323
8350
  return;
8324
8351
  }
8325
8352
  requestAnimationFrame(() => {
8326
- if (!this.isMenuItemInFocus()) {
8353
+ if (!this.isMenuItemInFocus() &&
8354
+ document.activeElement !== document.body &&
8355
+ document.activeElement !== this.hostElement) {
8327
8356
  this.dropdown?.close(false);
8328
8357
  }
8329
8358
  });
8330
8359
  }
8331
8360
  getDeepActiveElement() {
8332
8361
  let active = document.activeElement;
8333
- while (active?.shadowRoot?.activeElement && active.nodeName !== 'CAT-MENU-ITEM') {
8362
+ while (active?.shadowRoot?.activeElement) {
8334
8363
  active = active.shadowRoot.activeElement;
8335
8364
  }
8336
- return active;
8365
+ return active ? (findClosest('cat-menu-item', active) ?? active) : null;
8337
8366
  }
8338
8367
  onDocumentKeydown(event) {
8339
8368
  const navigationKeys = this.arrowNavigation === 'horizontal'
@@ -8401,10 +8430,10 @@ const CatMenu = class {
8401
8430
  this.catMenuItems = Array.from(this.hostElement.querySelectorAll('cat-menu-item'));
8402
8431
  }
8403
8432
  render() {
8404
- return (h(Host, { key: '1659f098d4d11e61119cde4f290bb89bf450f9d9' }, h("cat-dropdown", { key: 'a5ca6e28245167c0f208d1846c9f93a75991dee1', ref: el => (this.dropdown = el), focusTrap: false, placement: this.placement, justify: this.justify, arrowNavigation: "none", noResize: this.noResize, overflow: this.overflow, delayedTriggerInit: this.delayedTriggerInit, onCatOpen: this.onMenuOpen, onCatClose: () => this.catClose.emit() }, h("cat-button", { key: '63986a7d31784fdd59de48c79a5b5777cf198b94', slot: "trigger", part: "trigger", variant: this.triggerVariant, size: this.triggerSize, icon: this.triggerIcon ?? (this.triggerLabel === undefined ? 'more-horizontal-filled' : undefined), iconOnly: this.triggerIconOnly ?? this.triggerLabel === undefined, color: this.triggerColor, a11yLabel: this.triggerA11yLabel ?? this.triggerLabel, class: this.triggerClass, testId: this.triggerTestId, nativeAttributes: {
8433
+ return (h(Host, { key: '7f6a8d695af0d7f30b7da9ba5558f0c6983e4315' }, h("cat-dropdown", { key: '722ec1a940599257082c2a7b586dd662e09aab39', ref: el => (this.dropdown = el), focusTrap: false, placement: this.placement, justify: this.justify, arrowNavigation: "none", noResize: this.noResize, overflow: this.overflow, delayedTriggerInit: this.delayedTriggerInit, onCatOpen: this.onMenuOpen, onCatClose: () => this.catClose.emit() }, h("cat-button", { key: 'a1562b313b53ae8a736f096e3717ee3de78b9862', slot: "trigger", part: "trigger", variant: this.triggerVariant, size: this.triggerSize, icon: this.triggerIcon ?? (this.triggerLabel === undefined ? 'more-horizontal-filled' : undefined), iconOnly: this.triggerIconOnly ?? this.triggerLabel === undefined, color: this.triggerColor, a11yLabel: this.triggerA11yLabel ?? this.triggerLabel, class: this.triggerClass, testId: this.triggerTestId, nativeAttributes: {
8405
8434
  ...this.triggerNativeAttributes,
8406
8435
  'aria-haspopup': 'menu'
8407
- }, disabled: this.disabled, onCatClick: this.onTriggerClick }, !this.triggerIconOnly && h("slot", { key: 'c10341a8bec971b814ec88044a89aa6752f3be23', name: "trigger-label" }, this.triggerLabel)), h("nav", { key: '265da5937ea993d27ccec21f9c0bc84439208d6c', role: "menu", slot: "content", class: "cat-menu-list", "aria-orientation": this.arrowNavigation }, h("ul", { key: '9b8edcb90028b39690be08961f25ea8c7a769752' }, h("slot", { key: 'f30590ff83386f30ba4539e76d621a80b0aefffd' }))))));
8436
+ }, disabled: this.disabled, onCatClick: this.onTriggerClick }, !this.triggerIconOnly && h("slot", { key: 'f8cbc8e8841e4d9c2d28b38bae55bdbde2693a10', name: "trigger-label" }, this.triggerLabel)), h("nav", { key: 'bcd0eebb7e9bdbb23f2dbcfba7d6d13653789c06', role: "menu", slot: "content", class: "cat-menu-list", "aria-orientation": this.arrowNavigation }, h("ul", { key: '52ced18c6c0349795e1516090b33cd5c7bebb451' }, h("slot", { key: '3cedc5e3d1392fec9d49222165e9c96e7f40b0f2' }))))));
8408
8437
  }
8409
8438
  get hostElement() { return getElement(this); }
8410
8439
  };
@@ -8436,10 +8465,14 @@ const CatMenuItem = class {
8436
8465
  * Specifies that the menu item should be disabled.
8437
8466
  */
8438
8467
  this.disabled = false;
8468
+ this.subMenu = false;
8439
8469
  }
8440
8470
  get id() {
8441
8471
  return this.identifier || this._id;
8442
8472
  }
8473
+ onClick(event) {
8474
+ this.catClick.emit(event);
8475
+ }
8443
8476
  /**
8444
8477
  * Programmatically move focus to the menu item.
8445
8478
  */
@@ -8453,14 +8486,14 @@ const CatMenuItem = class {
8453
8486
  this.button?.doBlur();
8454
8487
  }
8455
8488
  render() {
8456
- return (h(Host, { key: '69db1c5c6d91ea31103639a5fe3cbb96da32aa40' }, h("li", { key: '88569a9541369cf5dbc7f79b562ef5b68c9905a3' }, h("cat-button", { key: '65b6e6c3ca873a07204f36b3cae69dfffbc51a0b', ref: el => (this.button = el), class: "cat-nav-item", buttonId: this.id, part: "menu-item", variant: this.variant, icon: this.icon, iconOnly: this.iconOnly, iconRight: this.iconRight, url: this.url, disabled: this.disabled, urlTarget: this.urlTarget, loading: this.loading, color: this.color, active: this.active, testId: this.testId, nativeAttributes: {
8489
+ return (h(Host, { key: 'ff1abf6c6d74fc9d0bbc7491d64e0ad3373f6899' }, h("li", { key: '45089d058d664822cb67bc7bbf802b06333c351e' }, h("cat-button", { key: '47a83844fe837313f65115d95571f0e9b6f7591b', ref: el => (this.button = el), class: "cat-nav-item", buttonId: this.id, part: "menu-item", variant: this.variant, icon: this.icon, iconOnly: this.iconOnly, iconRight: this.iconRight, url: this.url, disabled: this.disabled, urlTarget: this.urlTarget, loading: this.loading, color: this.color, active: this.active, testId: this.testId, nativeAttributes: {
8457
8490
  ...this.nativeAttributes,
8458
8491
  role: 'menuitem',
8459
8492
  tabindex: '-1'
8460
- }, onCatClick: this.onCatClick }, h("slot", { key: 'c8036dabc3f0cb762d96bee7797ac50f871ac44d' })))));
8493
+ }, onCatClick: event => this.click(event) }, h("slot", { key: '49bc9f6cc4a5ed1293e261cefb67351342b805fb' })))));
8461
8494
  }
8462
- onCatClick(event) {
8463
- this.catClick.emit(event.detail);
8495
+ click(event) {
8496
+ event.stopPropagation();
8464
8497
  }
8465
8498
  };
8466
8499