@haiilo/catalyst 10.17.1 → 10.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/dist/catalyst/catalyst.esm.js +1 -1
  2. package/dist/catalyst/catalyst.esm.js.map +1 -1
  3. package/dist/catalyst/{p-b1cd12bb.entry.js → p-b130db4e.entry.js} +4 -4
  4. package/dist/catalyst/p-b130db4e.entry.js.map +1 -0
  5. package/dist/cjs/cat-alert_29.cjs.entry.js +72 -61
  6. package/dist/cjs/cat-alert_29.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/collection-manifest.json +2 -2
  10. package/dist/collection/components/cat-alert/cat-alert.js +1 -1
  11. package/dist/collection/components/cat-badge/cat-badge.js +1 -1
  12. package/dist/collection/components/cat-button/cat-button.css +3 -0
  13. package/dist/collection/components/cat-button/cat-button.js +14 -1
  14. package/dist/collection/components/cat-button/cat-button.js.map +1 -1
  15. package/dist/collection/components/cat-button/cat-button.spec.js +1 -1
  16. package/dist/collection/components/cat-button/cat-button.spec.js.map +1 -1
  17. package/dist/collection/components/cat-button-group/cat-button-group.js +1 -1
  18. package/dist/collection/components/cat-card/cat-card.js +1 -1
  19. package/dist/collection/components/cat-checkbox/cat-checkbox.js +2 -2
  20. package/dist/collection/components/cat-date/cat-date.js +2 -2
  21. package/dist/collection/components/cat-date-inline/cat-date-inline.js +4 -4
  22. package/dist/collection/components/cat-datepicker/cat-datepicker.js +3 -3
  23. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.js +2 -2
  24. package/dist/collection/components/cat-dropdown/cat-dropdown.js +1 -1
  25. package/dist/collection/components/cat-form-group/cat-form-group.js +1 -1
  26. package/dist/collection/components/cat-icon/cat-icon.js +1 -1
  27. package/dist/collection/components/cat-input/cat-input.js +4 -4
  28. package/dist/collection/components/cat-pagination/cat-pagination.js +2 -2
  29. package/dist/collection/components/cat-radio/cat-radio.js +2 -2
  30. package/dist/collection/components/cat-radio-group/cat-radio-group.js +1 -1
  31. package/dist/collection/components/cat-scrollable/cat-scrollable.js +3 -3
  32. package/dist/collection/components/cat-select-demo/cat-select-demo.js +1 -1
  33. package/dist/collection/components/cat-skeleton/cat-skeleton.js +1 -1
  34. package/dist/collection/components/cat-spinner/cat-spinner.js +2 -2
  35. package/dist/collection/components/cat-tab/cat-tab.js +1 -1
  36. package/dist/collection/components/cat-tabs/cat-tabs.js +1 -1
  37. package/dist/collection/components/cat-textarea/cat-textarea.js +3 -3
  38. package/dist/collection/components/cat-time/cat-time.js +2 -2
  39. package/dist/collection/components/cat-toggle/cat-toggle.js +2 -2
  40. package/dist/collection/components/cat-tooltip/cat-tooltip.js +7 -7
  41. package/dist/collection/components/cat-tooltip/cat-tooltip.js.map +1 -1
  42. package/dist/collection/index.js.map +1 -1
  43. package/dist/components/cat-alert.js +1 -1
  44. package/dist/components/cat-badge.js +1 -1
  45. package/dist/components/cat-button-group.js +1 -1
  46. package/dist/components/cat-button2.js +27 -2
  47. package/dist/components/cat-button2.js.map +1 -1
  48. package/dist/components/cat-card.js +1 -1
  49. package/dist/components/cat-checkbox2.js +2 -2
  50. package/dist/components/cat-date-inline2.js +4 -4
  51. package/dist/components/cat-date.js +2 -2
  52. package/dist/components/cat-datepicker-inline.js +2 -2
  53. package/dist/components/cat-datepicker.js +4 -17
  54. package/dist/components/cat-datepicker.js.map +1 -1
  55. package/dist/components/cat-dropdown2.js +1 -1
  56. package/dist/components/cat-form-group.js +1 -1
  57. package/dist/components/cat-icon2.js +1 -1
  58. package/dist/components/cat-input2.js +4 -4
  59. package/dist/components/cat-pagination.js +2 -2
  60. package/dist/components/cat-radio-group.js +1 -1
  61. package/dist/components/cat-radio.js +2 -2
  62. package/dist/components/cat-scrollable2.js +3 -3
  63. package/dist/components/cat-select-demo.js +1 -1
  64. package/dist/components/cat-skeleton2.js +1 -1
  65. package/dist/components/cat-spinner2.js +2 -2
  66. package/dist/components/cat-tab.js +1 -1
  67. package/dist/components/cat-tabs.js +1 -1
  68. package/dist/components/cat-textarea.js +3 -3
  69. package/dist/components/cat-time.js +2 -2
  70. package/dist/components/cat-toggle.js +2 -2
  71. package/dist/components/cat-tooltip.js +2 -2
  72. package/dist/components/cat-tooltip.js.map +1 -1
  73. package/dist/esm/cat-alert_29.entry.js +72 -61
  74. package/dist/esm/cat-alert_29.entry.js.map +1 -1
  75. package/dist/esm/catalyst.js +1 -1
  76. package/dist/esm/loader.js +1 -1
  77. package/dist/types/components/cat-button/cat-button.d.ts +3 -0
  78. package/dist/types/components/cat-tooltip/cat-tooltip.d.ts +2 -1
  79. package/dist/types/components.d.ts +4 -2
  80. package/dist/types/index.d.ts +1 -0
  81. package/package.json +2 -2
  82. package/dist/catalyst/p-b1cd12bb.entry.js.map +0 -1
@@ -110,19 +110,19 @@ export class CatInput {
110
110
  }
111
111
  }
112
112
  render() {
113
- return (h("div", { key: '710fc250d8f11176a961b5206bc1f9232aa84be4', class: {
113
+ return (h("div", { key: '7258b5dca8a1bb2660421411399376affcd7412b', class: {
114
114
  'input-field': true,
115
115
  'input-horizontal': this.horizontal
116
- } }, h("div", { key: 'd57a83ea90d24a5afaed81088b708567daa0b4bf', class: { 'label-container': true, hidden: this.labelHidden } }, (this.hasSlottedLabel || this.label) && (h("label", { key: '61b641051a272bc80177d228e4d56df470fdcd40', htmlFor: this.id, part: "label" }, h("span", { key: 'a522fa48dfadd05cc2ec3175cab8ca3f2d23e73d', class: "label-wrapper" }, (this.hasSlottedLabel && h("slot", { key: 'd6d746332b369ef0c4b3f73ef15b020411e50d73', name: "label" })) || this.label, h("div", { key: 'ecf148a66a061e6e6dcf1b064b81d9f0f17efbfb', class: "label-metadata" }, !this.required && (this.requiredMarker ?? 'optional').startsWith('optional') && (h("span", { key: 'e0caa04516b0185d3f5916ef3f72742979d3e8f2', class: "label-optional", "aria-hidden": "true" }, "(", i18n.t('input.optional'), ")")), this.required && this.requiredMarker?.startsWith('required') && (h("span", { key: '392aa2bb291df5b0c34a7f38deb0a2ee2e24a0bd', class: "label-optional", "aria-hidden": "true" }, "(", i18n.t('input.required'), ")")), this.maxLength && (h("div", { key: '17926bcd4830cffd1373c4ffd7cd5e3af13aa9bd', class: "label-character-count", "aria-hidden": "true" }, this.value?.toString().length ?? 0, "/", this.maxLength))))))), h("div", { key: '54b16ece948552768266937a22cf01005e1173c3', class: "input-container" }, h("div", { key: 'c1f5879a29b9178a72587daa852fbbdb26faddf0', class: "input-outer-wrapper" }, h("div", { key: 'f69ecc01540efc059696a5e25b180355433820bf', class: {
116
+ } }, h("div", { key: '9c02edf0f50dcd805d503d8d9b7c6ecde3b3714c', class: { 'label-container': true, hidden: this.labelHidden } }, (this.hasSlottedLabel || this.label) && (h("label", { key: '06ce0c061f259aaf206d201d41b4d4c005b0cc84', htmlFor: this.id, part: "label" }, h("span", { key: '2de7d35216fa0beea4b614da4b8b7df8d99d5b04', class: "label-wrapper" }, (this.hasSlottedLabel && h("slot", { key: '495aebfd1bf2ee81012f98f3a4a0658c90c9e804', name: "label" })) || this.label, h("div", { key: '4192b2e57f8d8a7b378bc0425f5330bc7a04f401', class: "label-metadata" }, !this.required && (this.requiredMarker ?? 'optional').startsWith('optional') && (h("span", { key: '5f426128dcf6ddc8bcab0c6438aec0568a35b23c', class: "label-optional", "aria-hidden": "true" }, "(", i18n.t('input.optional'), ")")), this.required && this.requiredMarker?.startsWith('required') && (h("span", { key: 'f2f1a36e5e1066724db5a4da99c1d06c8cc86f66', class: "label-optional", "aria-hidden": "true" }, "(", i18n.t('input.required'), ")")), this.maxLength && (h("div", { key: 'e29f07bfa9f91c295be6037aaa05038809c91fe6', class: "label-character-count", "aria-hidden": "true" }, this.value?.toString().length ?? 0, "/", this.maxLength))))))), h("div", { key: '85efdbe3dbfdd4e85651b7e8329e5f9f15e052d7', class: "input-container" }, h("div", { key: 'b8829ba90a01a17fe88ee48b715b4350322ad6f6', class: "input-outer-wrapper" }, h("div", { key: '76a04b883427a20af6e03b9677e4caec28c2caaa', class: {
117
117
  'input-wrapper': true,
118
118
  'input-round': this.round,
119
119
  'input-readonly': this.readonly,
120
120
  'input-disabled': this.disabled,
121
121
  'input-invalid': this.invalid
122
- }, onClick: () => this.input.focus() }, this.textPrefix && (h("span", { key: '2e3d91279deb4179162d975335ebfa9f0e9d2b2e', class: "text-prefix", part: "prefix" }, this.textPrefix)), this.icon && !this.iconRight && (h("cat-icon", { key: '80b26a819294fb17b37bf773f9cd083a45dbe483', icon: this.icon, class: "icon-prefix", size: "l", onClick: () => this.doFocus() })), h("div", { key: '43efb99f56314c8bd5cfce38753244f108a5a610', class: "input-inner-wrapper" }, h("input", { key: '2be965730ab7d0492e0b0d91d0a90d8d288e0203', ...this.nativeAttributes, part: "input", ref: el => (this.input = el), id: this.id, class: {
122
+ }, onClick: () => this.input.focus() }, this.textPrefix && (h("span", { key: '62386cdfd8f78d6c53837d7ab98dc1fe4a29ef98', class: "text-prefix", part: "prefix" }, this.textPrefix)), this.icon && !this.iconRight && (h("cat-icon", { key: 'e1412bc20af17cd70c0b23ba10d2ce078137b3b8', icon: this.icon, class: "icon-prefix", size: "l", onClick: () => this.doFocus() })), h("div", { key: '03cc4198c7880a0e5c0addac542b5aa43c39302f', class: "input-inner-wrapper" }, h("input", { key: '9275ba8b28f73ab8d017f861da0edbcbf0ef9e28', ...this.nativeAttributes, part: "input", ref: el => (this.input = el), id: this.id, class: {
123
123
  'has-clearable': this.clearable && !this.disabled && !this.readonly && !!this.value,
124
124
  'has-toggle-password': this.togglePassword && !this.disabled && !this.readonly && !!this.value
125
- }, autocomplete: this.autoComplete, disabled: this.disabled, max: this.max, maxlength: this.maxLength, min: this.min, minlength: this.minLength, name: this.name, placeholder: this.placeholder, readonly: this.readonly, required: this.required, type: this.isPasswordShown ? 'text' : this.type, value: this.value, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this), "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.hasHint ? this.id + '-hint' : undefined }), this.clearable && !this.disabled && !this.readonly && this.value && (h("cat-button", { key: '2368492bdefb956c46767bdc5d27bee18b0723dc', class: "clearable", icon: "$cat:input-close", "icon-only": "true", size: "s", variant: "text", "a11y-label": i18n.t('input.clear'), onClick: this.clear.bind(this), "data-dropdown-no-close": true })), this.togglePassword && !this.disabled && !this.readonly && this.value && (h("cat-button", { key: 'c6cd66169ea99ee2975aa96dfcd3761186d9a574', class: "toggle-password", icon: this.isPasswordShown ? '$cat:input-password-hide' : '$cat:input-password-show', "icon-only": "true", size: "s", variant: "text", "a11y-label": i18n.t(this.isPasswordShown ? 'input.hidePassword' : 'input.showPassword'), onClick: this.doTogglePassword.bind(this) }))), !this.invalid && this.icon && this.iconRight && (h("cat-icon", { key: '6262a983d66c3355a131a7a37bdb7dab8a169f41', icon: this.icon, class: "icon-suffix", size: "l", onClick: () => this.doFocus() })), this.invalid && (h("cat-icon", { key: 'c50c15e17b515bff2933e36e40ea12d62f719b95', icon: "$cat:input-error", class: "icon-suffix cat-text-danger", size: "l" })), this.textSuffix && (h("span", { key: '937984d04d867aff813f8bf204904d8277521a41', class: "text-suffix", part: "suffix" }, this.textSuffix))), h("slot", { key: 'a5d6ea59f76885ca72c66371771452544692be22', name: "addon" })), this.hasHint && (h(CatFormHint, { key: '15ace5d211cf0abce63bd7fc277b913914ca415a', id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }), errorMap: this.errorMap })))));
125
+ }, autocomplete: this.autoComplete, disabled: this.disabled, max: this.max, maxlength: this.maxLength, min: this.min, minlength: this.minLength, name: this.name, placeholder: this.placeholder, readonly: this.readonly, required: this.required, type: this.isPasswordShown ? 'text' : this.type, value: this.value, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this), "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.hasHint ? this.id + '-hint' : undefined }), this.clearable && !this.disabled && !this.readonly && this.value && (h("cat-button", { key: '22bafaef74f81c9d5548ee1090d1e9633cc138d3', class: "clearable", icon: "$cat:input-close", "icon-only": "true", size: "s", variant: "text", "a11y-label": i18n.t('input.clear'), onClick: this.clear.bind(this), "data-dropdown-no-close": true })), this.togglePassword && !this.disabled && !this.readonly && this.value && (h("cat-button", { key: '766c223a69c50dfb040f5bad604fcfc91a06a54e', class: "toggle-password", icon: this.isPasswordShown ? '$cat:input-password-hide' : '$cat:input-password-show', "icon-only": "true", size: "s", variant: "text", "a11y-label": i18n.t(this.isPasswordShown ? 'input.hidePassword' : 'input.showPassword'), onClick: this.doTogglePassword.bind(this) }))), !this.invalid && this.icon && this.iconRight && (h("cat-icon", { key: '67c5389ac4d9e782fc067d1c13078574e563e974', icon: this.icon, class: "icon-suffix", size: "l", onClick: () => this.doFocus() })), this.invalid && (h("cat-icon", { key: 'a30da2261ddb64eedd211c2d1b9a3d581763836f', icon: "$cat:input-error", class: "icon-suffix cat-text-danger", size: "l" })), this.textSuffix && (h("span", { key: 'c9847ed51bac5908df4d370bd18a86a0d61e544e', class: "text-suffix", part: "suffix" }, this.textSuffix))), h("slot", { key: '78f753ce80a50aa9c82f1fe2e12cdb929d4dd0dd', name: "addon" })), this.hasHint && (h(CatFormHint, { key: '27c27c004374fcf6348551199d0bb78f33f2eec5', id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }), errorMap: this.errorMap })))));
126
126
  }
127
127
  get hasHint() {
128
128
  return !!this.hint || !!this.hasSlottedHint || this.invalid;
@@ -21,9 +21,9 @@ export class CatPagination {
21
21
  this.iconNext = '$cat:pagination-right';
22
22
  }
23
23
  render() {
24
- return (h("nav", { key: 'e0afa5efde129998d5899191374849c2538d5656', role: "navigation" }, h("ol", { key: '3b6d1838f508a3323d0ff11b95318eee5cfe5c89', class: {
24
+ return (h("nav", { key: '817cbf68d26fef6f6603a2455e7586fefea63b77', role: "navigation" }, h("ol", { key: '8cc898b619508d2ef2c05fed178d0976fb0c5abf', class: {
25
25
  [`cat-pagination-${this.size}`]: Boolean(this.size)
26
- } }, h("li", { key: 'fffae2ea8d502b03c01841f2cdf281150d6b62b5' }, h("cat-button", { key: '8f320c285b322ca8ae618143b70fdf85b227c232', variant: this.variant, size: this.size, round: this.round, disabled: this.isFirst, a11yLabel: i18n.t('pagination.prev'), icon: this.iconPrev, iconOnly: true, onClick: () => this.setPage(this.page - 1) })), this.content, h("li", { key: '77d3aa0acb4a27cd8c65d7396dab318dcce7825c' }, h("cat-button", { key: 'fe70cf4c908cbc7ac2bd2167f778f42fa3b49025', variant: this.variant, size: this.size, round: this.round, disabled: this.isLast, a11yLabel: i18n.t('pagination.next'), icon: this.iconNext, iconOnly: true, onClick: () => this.setPage(this.page + 1) })))));
26
+ } }, h("li", { key: 'b4df49303de82b5bca6eb32e1b984f3204675baa' }, h("cat-button", { key: 'b73cd4eadf9811bfbc681d77d9339738227c5e24', variant: this.variant, size: this.size, round: this.round, disabled: this.isFirst, a11yLabel: i18n.t('pagination.prev'), icon: this.iconPrev, iconOnly: true, onClick: () => this.setPage(this.page - 1) })), this.content, h("li", { key: '119fbe96e02ab847e1a70dd2a7778f31488eb42e' }, h("cat-button", { key: '903151fcd987ef8a106715a37dcadc294c14567f', variant: this.variant, size: this.size, round: this.round, disabled: this.isLast, a11yLabel: i18n.t('pagination.next'), icon: this.iconNext, iconOnly: true, onClick: () => this.setPage(this.page + 1) })))));
27
27
  }
28
28
  get isFirst() {
29
29
  return this.page === 0;
@@ -53,13 +53,13 @@ export class CatRadio {
53
53
  this.input.blur();
54
54
  }
55
55
  render() {
56
- return (h(Host, { key: 'a5c45b93c04dd890962afea152680fa2da41d26b' }, h("label", { key: 'f11eb0392f18af07b34240bc2fa05c92ddbca62b', htmlFor: this.id, class: {
56
+ return (h(Host, { key: 'e49a46a798bf9e1763c3bb7d393d017bc717b867' }, h("label", { key: '2c54e7ce7635e828d08c57a6dec3dac6f9655ea7', htmlFor: this.id, class: {
57
57
  'is-hidden': this.labelHidden,
58
58
  'is-disabled': this.disabled,
59
59
  'label-left': this.labelLeft,
60
60
  'align-center': this.alignment === 'center',
61
61
  'align-end': this.alignment === 'bottom'
62
- }, role: "radio", "aria-checked": this.checked ? 'true' : 'false' }, h("span", { key: '95152536359c135a0dffe9b9e8f5dd0275da7521', class: "radio" }, h("input", { key: '2dec9b790dcfb178459d5c6a58b9468350ba2797', ...this.nativeAttributes, part: "input", ref: el => (this.input = el), id: this.identifier || this.id, type: "radio", name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, 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: 'a3053e1a599f78d46093d26f36367f52d27959c0', class: "circle" })), h("span", { key: '70a5495aa595fffebf21adc9da5ca2d6d9cace22', class: "label", part: "label" }, (this.hasSlottedLabel && h("slot", { key: '71a6e06c7e1d97635c3cdd692a31e3edc436ede7', name: "label" })) || this.label)), this.hasHint && (h("div", { key: '770e78a9dafb75fed3c94cf86f36d7de01b9f743', class: { 'hint-wrapper': true, 'label-left': this.labelLeft } }, h("div", { key: '2398ef4f89bd6b6a7fa4a694786868c710924222', class: "circle-placeholder" }), h(CatFormHint, { key: 'f127cb78608b03b3c54f3f0e4d69c33892c268ff', id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }) })))));
62
+ }, role: "radio", "aria-checked": this.checked ? 'true' : 'false' }, h("span", { key: '750a09db89be9e14bd0b830f6ab9d667b5154faa', class: "radio" }, h("input", { key: 'd34a558d03b1af53eb8afe65f33cdf400a38dd8a', ...this.nativeAttributes, part: "input", ref: el => (this.input = el), id: this.identifier || this.id, type: "radio", name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, 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: '4da4710794e6a1939e947461986798f952a43c28', class: "circle" })), h("span", { key: '812920e2ce41d6415fb39306a3c5c90c547292ed', class: "label", part: "label" }, (this.hasSlottedLabel && h("slot", { key: '141e716d778a2838dc5da2f36342483a07a887e0', name: "label" })) || this.label)), this.hasHint && (h("div", { key: '84e7ed4970ff487801c96dfdd16fbc5bf5fa7ee0', class: { 'hint-wrapper': true, 'label-left': this.labelLeft } }, h("div", { key: '7067ca10bf24d84beaf5f89a8e2e65a22766784c', class: "circle-placeholder" }), h(CatFormHint, { key: 'a6a006b626516a1fa3f86d25eb6ae5da93ff9d66', id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }) })))));
63
63
  }
64
64
  get hasHint() {
65
65
  return !!this.hint || !!this.hasSlottedHint;
@@ -67,7 +67,7 @@ export class CatRadioGroup {
67
67
  }
68
68
  }
69
69
  render() {
70
- return (h("div", { key: '597881a52c2314f3cc6e159473d8dc83e5944900', role: "radiogroup", "aria-label": this.a11yLabel }, h("slot", { key: 'ca1d499d74100334a86bf75362bd61f3674d31fa' })));
70
+ return (h("div", { key: '3ca0cc9f011a75bbe5fbe78f3ccc34f2b89cfa0d', role: "radiogroup", "aria-label": this.a11yLabel }, h("slot", { key: 'ab891802eba920792de0dbbd645df119cbbfd35a' })));
71
71
  }
72
72
  init() {
73
73
  this.catRadioGroup = Array.from(this.hostElement.querySelectorAll(`cat-radio`));
@@ -57,13 +57,13 @@ export class CatScrollable {
57
57
  }
58
58
  render() {
59
59
  return [
60
- h("div", { key: '3fa7e90419b11118694def5d300036b1062fb685', class: "scrollable-wrapper", ref: el => (this.scrollWrapperElement = el) }, !this.noShadowY && h("div", { key: '3f7a3b2aa4a8b434ab66fc676e02771e056dfc95', class: "shadow-top" }), !this.noShadowX && h("div", { key: '450547a0b1a08a15903e605f2bd12c1eb2637089', class: "shadow-left" }), !this.noShadowX && h("div", { key: '69fe8dc3f0282d9d8bf1ccd65add30c0046789c4', class: "shadow-right" }), !this.noShadowY && h("div", { key: 'b2f1df225d3653cd778b28f2f94724ff1f7a7729', class: "shadow-bottom" })),
61
- h("div", { key: '56833efe4ee21f847c2321e89e0b3e2fa9a7240b', ref: el => (this.scrollElement = el), class: {
60
+ h("div", { key: '1639675c47648368c53430e764a8add07e9452ae', class: "scrollable-wrapper", ref: el => (this.scrollWrapperElement = el) }, !this.noShadowY && h("div", { key: '1ee0d5c5bfc7b726addac6474b098237ff447c3c', class: "shadow-top" }), !this.noShadowX && h("div", { key: '266026a4369bdcd9464deb4aa44d1e438a05e191', class: "shadow-left" }), !this.noShadowX && h("div", { key: 'd4ec793e68cde3ca8aa14e4eec57995112722d9b', class: "shadow-right" }), !this.noShadowY && h("div", { key: 'c30408dc0b5e10a9dceece389ce0729d46fdcbe2', class: "shadow-bottom" })),
61
+ h("div", { key: '8e17123e46a59b561122d07a2124ab20bf0cc58f', ref: el => (this.scrollElement = el), class: {
62
62
  'scrollable-content': true,
63
63
  'scroll-x': !this.noOverflowX,
64
64
  'scroll-y': !this.noOverflowY,
65
65
  'no-overscroll': this.noOverscroll
66
- } }, h("slot", { key: 'c959b7cbbd06a0233ad773738ef925b05bd76be3' }))
66
+ } }, h("slot", { key: '026b0d81a1de88cbd4b401bde7fb98caaabfe811' }))
67
67
  ];
68
68
  }
69
69
  attachEmitter(from, emitter) {
@@ -139,7 +139,7 @@ export class CatSelectTest {
139
139
  setTimeout(() => this.multipleSelect && (this.multipleSelect.value = []), 5000);
140
140
  }
141
141
  render() {
142
- return (h(Host, { key: '745d55bbd0e1c38377f5f7ed138dc78213b47960', style: { display: 'flex', flexDirection: 'column' }, class: "cat-form" }, h("cat-select", { key: '7c201ebc18e36a8551899b7e5276a63ded6bb6c8', label: "Multiple Select", hint: "This is a hint!", ref: el => (this.multipleSelect = el), value: ['1'], placeholder: "Hello World", onCatChange: () => console.log('Multiple change', this.multipleSelect?.value), onCatBlur: e => console.log('Multiple blur', e), multiple: true, noItems: "No results", clearable: true, errorUpdate: false }, h("span", { key: 'a0c9f9514070e2101c84839292bbc749a7969eab', slot: "hint" }, "Searching for \"no\" -", '>', " no options are returned!")), h("cat-select", { key: 'b648ecf10f825cb33a11da79b6528caf78b7b07c', label: "Multiple with img", ref: el => (this.multipleSelectAvatar = el), value: ['1'], placeholder: "Hello World", multiple: true, clearable: true, errorUpdate: false }), h("cat-select", { key: '23e6ab45009463f2d703d8913b232ade2f1abfa3', label: "Multiple with initials", ref: el => (this.multipleSelectAvatarInitials = el), value: ['1'], placeholder: "Hello World", multiple: true, clearable: true, errorUpdate: false }), h("cat-select", { key: '18f247000136a32e7ec202c7be7f01e625a4a40d', label: "Multiple with tagging support", hint: "This is a hint!", ref: el => (this.multipleSelectTagging = el), value: { ids: ['1'], tags: ['Test', 'Albania', 'Algeria'] }, placeholder: "Select country", onCatChange: () => console.log('Multiple tagging change', this.multipleSelectTagging?.value), multiple: true, tags: true, clearable: true, errorUpdate: false }), h("cat-select", { key: '445e29437d8af225222a9af1e2cd87e730d23b8f', label: "Single Select", hint: "This is a hint!", ref: el => (this.singleSelect = el), placeholder: "Search for a country or capital", onCatBlur: e => console.log('Single blur', e), clearable: true, errorUpdate: false }), h("cat-select", { key: '781b635fbe75a7cc9f8bfb840b0614b65f53b7f6', label: "Single with img", ref: el => (this.singleSelectAvatar = el), value: '1', placeholder: "Search for a country or capital", clearable: true, errorUpdate: false }), h("cat-select", { key: '2078bf8f1778a21c1b6a4180292b244a8b11eb62', label: "Single with initials", ref: el => (this.singleSelectAvatarInitials = el), placeholder: "Hello World", clearable: true, errorUpdate: false }), h("cat-dropdown", { key: '42a8847c8e88d349f4919794ca93e067a25ecf36', overflow: true }, h("cat-button", { key: '55f407b6d3316311faa138169f1eb8725757f588', slot: "trigger", style: { width: '50%' } }, "Open select"), h("div", { key: 'c68ad1b486b5985bb550d026ba2969a786995c48', slot: "content", style: { width: '400px' } }, h("cat-select", { key: '2a32550e0f87e8aa3f90abbe819c7ceab0d9c773', label: "Single with tagging support", ref: el => (this.singleSelectTagging = el), value: { id: '', tag: 'Albania' }, placeholder: "Search for a country or capital", onCatChange: () => console.log('Single change', this.singleSelectTagging?.value), tagHint: "new country", tags: true, clearable: true, errorUpdate: false, style: { width: '90%' } })))));
142
+ return (h(Host, { key: '4d1262f7c176a3699eec1b24dcfd24eb73e4794d', style: { display: 'flex', flexDirection: 'column' }, class: "cat-form" }, h("cat-select", { key: '50af5fabe85cf9d5cabc22e8eaac0fd79ca37ef6', label: "Multiple Select", hint: "This is a hint!", ref: el => (this.multipleSelect = el), value: ['1'], placeholder: "Hello World", onCatChange: () => console.log('Multiple change', this.multipleSelect?.value), onCatBlur: e => console.log('Multiple blur', e), multiple: true, noItems: "No results", clearable: true, errorUpdate: false }, h("span", { key: 'd0b3ff47fa0ae1fcaca58fa1c978d160bd90ec25', slot: "hint" }, "Searching for \"no\" -", '>', " no options are returned!")), h("cat-select", { key: '8b279857cb7bc615049315d3347ad2167f79f515', label: "Multiple with img", ref: el => (this.multipleSelectAvatar = el), value: ['1'], placeholder: "Hello World", multiple: true, clearable: true, errorUpdate: false }), h("cat-select", { key: '8133ad06671dda0dec6847558cc5f2298ffd0910', label: "Multiple with initials", ref: el => (this.multipleSelectAvatarInitials = el), value: ['1'], placeholder: "Hello World", multiple: true, clearable: true, errorUpdate: false }), h("cat-select", { key: 'fe7e7c01ed578dbccea9dedb77722ccc873aa882', label: "Multiple with tagging support", hint: "This is a hint!", ref: el => (this.multipleSelectTagging = el), value: { ids: ['1'], tags: ['Test', 'Albania', 'Algeria'] }, placeholder: "Select country", onCatChange: () => console.log('Multiple tagging change', this.multipleSelectTagging?.value), multiple: true, tags: true, clearable: true, errorUpdate: false }), h("cat-select", { key: 'f632770bcf0100328294b4722bf788619d381ba9', label: "Single Select", hint: "This is a hint!", ref: el => (this.singleSelect = el), placeholder: "Search for a country or capital", onCatBlur: e => console.log('Single blur', e), clearable: true, errorUpdate: false }), h("cat-select", { key: 'b38796d22f1f88bead1e97820d48214b7ba3f649', label: "Single with img", ref: el => (this.singleSelectAvatar = el), value: '1', placeholder: "Search for a country or capital", clearable: true, errorUpdate: false }), h("cat-select", { key: '24bff1c9438de8a2bce7801b161c6e0ed40a0f53', label: "Single with initials", ref: el => (this.singleSelectAvatarInitials = el), placeholder: "Hello World", clearable: true, errorUpdate: false }), h("cat-dropdown", { key: '263cf8e741c9f16f2602150cb2bc054b11deff3b', overflow: true }, h("cat-button", { key: '7bc7b524dfb08bb1691e3ebb391e44229345a98b', slot: "trigger", style: { width: '50%' } }, "Open select"), h("div", { key: '81565908aa8e60a82727269b3af83f9d9cc00e89', slot: "content", style: { width: '400px' } }, h("cat-select", { key: '530b39c7402fd04af9a92a8860994babbb26ca16', label: "Single with tagging support", ref: el => (this.singleSelectTagging = el), value: { id: '', tag: 'Albania' }, placeholder: "Search for a country or capital", onCatChange: () => console.log('Single change', this.singleSelectTagging?.value), tagHint: "new country", tags: true, clearable: true, errorUpdate: false, style: { width: '90%' } })))));
143
143
  }
144
144
  get countryConnector() {
145
145
  return {
@@ -10,7 +10,7 @@ export class CatSkeleton {
10
10
  this.lines = undefined;
11
11
  }
12
12
  render() {
13
- return (h(Host, { key: 'aac4684f2816b1be2367866041d15e9fac0de7ac' }, Array.from(Array(this.count)).map(() => (h("div", { style: this.style, class: {
13
+ return (h(Host, { key: 'aed2e7fe276bc83e749cddeba379a495040850ea' }, Array.from(Array(this.count)).map(() => (h("div", { style: this.style, class: {
14
14
  skeleton: true,
15
15
  [`skeleton-${this.effect}`]: Boolean(this.effect),
16
16
  [`skeleton-${this.variant}`]: Boolean(this.variant),
@@ -8,9 +8,9 @@ export class CatSpinner {
8
8
  this.a11yLabel = undefined;
9
9
  }
10
10
  render() {
11
- return (h("span", { key: '6e6fe85607e6f6b00fd095c176604aecc05ea75a', "aria-label": this.a11yLabel, "aria-hidden": this.a11yLabel ? null : 'true', class: {
11
+ return (h("span", { key: '1cbc0ce9b663ba8edec261bc23822da72bca0e09', "aria-label": this.a11yLabel, "aria-hidden": this.a11yLabel ? null : 'true', class: {
12
12
  [`spinner-${this.size}`]: this.size !== 'inline'
13
- } }, h("svg", { key: '9c5823b8f4ab7796a34342901e1d1278a3c34537', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 48 48" }, h("circle", { key: '386e29a6dd880ae337f20ba1c4074edb7484c8f6', cx: "24", cy: "24", r: "21.5" }))));
13
+ } }, h("svg", { key: '8f282cdab11de5ae0ce0d5c33e8261d28642e8b3', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 48 48" }, h("circle", { key: '1b283f2cca79367c1bbb284954f4c62b422d18ae', cx: "24", cy: "24", r: "21.5" }))));
14
14
  }
15
15
  static get is() { return "cat-spinner"; }
16
16
  static get encapsulation() { return "shadow"; }
@@ -24,7 +24,7 @@ export class CatTab {
24
24
  this.catClick.emit(event);
25
25
  }
26
26
  render() {
27
- return h(Host, { key: '423a9d58be83b8acccdbe72ffb0f75733dc91cc7' });
27
+ return h(Host, { key: '3a0763022fe3c66e8405914f3212ba1d19fe1549' });
28
28
  }
29
29
  static get is() { return "cat-tab"; }
30
30
  static get encapsulation() { return "shadow"; }
@@ -58,7 +58,7 @@ export class CatTabs {
58
58
  this.activate(this.tabs[index]);
59
59
  }
60
60
  render() {
61
- return (h(Host, { key: 'b3119423d8f6cae90991af25bd6d7d6ef94b5609' }, this.tabs.map((tab) => {
61
+ return (h(Host, { key: '16cb1359d4242593e1caf1b2475c0fe24b91a69b' }, this.tabs.map((tab) => {
62
62
  return (h("cat-button", { buttonId: tab.id, role: "tab", part: "tab", class: {
63
63
  'cat-tab': true,
64
64
  'cat-tab-active': tab.id === this.activeTab,
@@ -88,15 +88,15 @@ export class CatTextarea {
88
88
  }
89
89
  }
90
90
  render() {
91
- return (h(Host, { key: '75665cdb53070b131971482ec39853e07d2f4ca9' }, h("div", { key: 'a2439d68f9e7314a9f970ff10f900c4c04e23e4a', class: {
91
+ return (h(Host, { key: 'fda117cd95fc6e41b9cd939b65ab22f977dde6ef' }, h("div", { key: '1f96b31c31880e8a75c8ad67c4057fb3010b1c9e', class: {
92
92
  'textarea-field': true,
93
93
  'textarea-horizontal': this.horizontal
94
- } }, h("div", { key: 'fc3556d42d3b02cf31d83cccf03b0226d53c9517', class: { 'label-container': true, hidden: this.labelHidden } }, (this.hasSlottedLabel || this.label) && (h("label", { key: '1e7a169e766a4a349a080fab967aa6c678b27ede', htmlFor: this.id, part: "label" }, h("span", { key: '3658d2fc258162a3c1c635fa1b5148005d1e1bac', class: "label-wrapper" }, (this.hasSlottedLabel && h("slot", { key: '2ce32b2a5984547d09aa8921f9ee33b918e1aab2', name: "label" })) || this.label, h("div", { key: '36ef608cdee7550adc0be30270db64f3dcd4ea2e', class: "label-metadata" }, !this.required && (this.requiredMarker ?? 'optional').startsWith('optional') && (h("span", { key: '4a7480181592a16d39db92273dd9a32fe338388a', class: "label-optional", "aria-hidden": "true" }, "(", i18n.t('input.optional'), ")")), this.required && this.requiredMarker?.startsWith('required') && (h("span", { key: 'de54a7e25c78c6cdc1f8683c8e5c1773714323ce', class: "label-optional", "aria-hidden": "true" }, "(", i18n.t('input.required'), ")")), this.maxLength && (h("div", { key: '05a49aeae9c47c22c5ee0c95a5d4d1708f8aeff1', class: "label-character-count", "aria-hidden": "true" }, this.value?.length ?? 0, "/", this.maxLength))))))), h("div", { key: 'b2a6bc4d2f61b4a5683fd7fdf39123c8c0c4c39e', class: "textarea-container" }, h("div", { key: '79a4291af19da695a14b80539cfc6d6e9313ccaf', class: {
94
+ } }, h("div", { key: '524ec0321e709ad45216275d0c554b7efde80f19', class: { 'label-container': true, hidden: this.labelHidden } }, (this.hasSlottedLabel || this.label) && (h("label", { key: '3aa9116de299d6eadf551159788cd0e244b5e919', htmlFor: this.id, part: "label" }, h("span", { key: 'ae397abd1be97bbb5c58fa35f4b560506cbbd5d1', class: "label-wrapper" }, (this.hasSlottedLabel && h("slot", { key: '81bb3f8151354ae9c6539f6816d963700beb861b', name: "label" })) || this.label, h("div", { key: '96000f760849536cb97eedd704e8a1bec14c15fa', class: "label-metadata" }, !this.required && (this.requiredMarker ?? 'optional').startsWith('optional') && (h("span", { key: '1ab3077d0d7a94c2459a2d5b6717cc4a3857b122', class: "label-optional", "aria-hidden": "true" }, "(", i18n.t('input.optional'), ")")), this.required && this.requiredMarker?.startsWith('required') && (h("span", { key: '73944c3f9366064342fca115ae50612b9c75489e', class: "label-optional", "aria-hidden": "true" }, "(", i18n.t('input.required'), ")")), this.maxLength && (h("div", { key: 'fe11e06174bcbf8e1957771be702fc052a4e5114', class: "label-character-count", "aria-hidden": "true" }, this.value?.length ?? 0, "/", this.maxLength))))))), h("div", { key: '94a9992673d408933040f359335f642fcc053182', class: "textarea-container" }, h("div", { key: 'df53a47f398d48cec2b50dff469eb9a91c59bc72', class: {
95
95
  'textarea-wrapper': true,
96
96
  'textarea-readonly': this.readonly,
97
97
  'textarea-disabled': this.disabled,
98
98
  'textarea-invalid': this.invalid
99
- } }, h("textarea", { key: '3e06a6c68119338adf15b93d717da4a3dbc4e8cb', ...this.nativeAttributes, part: "textarea", ref: el => (this.textarea = el), id: this.id, disabled: this.disabled, maxlength: this.maxLength, minlength: this.minLength, name: this.name, placeholder: this.placeholder, readonly: this.readonly, required: this.required, rows: this.rows, value: this.value, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this), "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.hasHint ? this.id + '-hint' : undefined }), this.invalid && (h("cat-icon", { key: '3845c0f84764b5f382b8e36ff90571548c057087', icon: "$cat:input-error", class: "icon-suffix cat-text-danger", size: "l", onClick: () => this.textarea.focus() }))), this.hasHint && (h(CatFormHint, { key: '564729eaa387e7b08c35415dd9ac16ad6e2c806a', id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }), errorMap: this.errorMap }))))));
99
+ } }, h("textarea", { key: 'd7d7f168763ea7194b97ddb505b4741b4ba0d91a', ...this.nativeAttributes, part: "textarea", ref: el => (this.textarea = el), id: this.id, disabled: this.disabled, maxlength: this.maxLength, minlength: this.minLength, name: this.name, placeholder: this.placeholder, readonly: this.readonly, required: this.required, rows: this.rows, value: this.value, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this), "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.hasHint ? this.id + '-hint' : undefined }), this.invalid && (h("cat-icon", { key: 'f9d4fc754bf0da656ee08f2b5b68fedba99c727c', icon: "$cat:input-error", class: "icon-suffix cat-text-danger", size: "l", onClick: () => this.textarea.focus() }))), this.hasHint && (h(CatFormHint, { key: '3112b8a801c9b5e51129df6349f89c097beb6f0d', id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }), errorMap: this.errorMap }))))));
100
100
  }
101
101
  get hasHint() {
102
102
  return !!this.hint || !!this.hasSlottedHint || this.invalid;
@@ -124,14 +124,14 @@ export class CatTime {
124
124
  this.input?.clear();
125
125
  }
126
126
  render() {
127
- return (h(Host, { key: '4f78a1c5d3dd09a6f7476a4fed55ba1241305b4b' }, h("cat-input", { key: 'e783cd952c5a9bfc1b205eabf62b4b7e42684695', class: "cat-time-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, 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.format(this.selectionTime, false), errors: this.errors, errorUpdate: this.errorUpdate, nativeAttributes: this.nativeAttributes, onCatFocus: e => this.catFocus.emit(e.detail), onCatBlur: e => this.onInputBlur(e.detail) }, h("span", { key: '945c465de003a32f67c6cab827afe8667c3d8436', slot: "label" }, this.hasSlottedLabel && h("slot", { key: '801d55325c6ec485c8519586a1fe03751b7ea4a2', name: "label" }), !this.hasSlottedLabel && this.label, h("span", { key: '0dacef4090d789d0a600b5db2881bd9598e38a18', class: "label-aria" }, " (HH:mm)")), h("div", { key: '209dfdb875dbb40a0865dde72fd4aaa217a2592f', slot: "addon", class: "cat-time-addon" }, this.locale.timeFormat === '12' && (h("cat-button", { key: 'd3b901214820efebe32769996a8aa188d3a1e3e2', class: "cat-time-format", disabled: this.disabled || this.readonly, onCatClick: () => this.toggleAm() }, this.isAm ? 'AM' : 'PM')), h("cat-dropdown", { key: 'b25d55512fc792bcb159e016ea71547032856aca', slot: "addon", placement: this.placement }, h("cat-button", { key: '5b6d1cf64a4c561b7d56ddbbaecf4e035e1ec3d4', slot: "trigger", class: "cat-time-toggle", disabled: this.disabled || this.readonly, icon: "$cat:timepicker-clock", iconOnly: true, a11yLabel: this.selectionTime ? `${this.locale.change}, ${this.format(this.selectionTime)}` : this.locale.choose }), h("nav", { key: 'b24b73a4374c5304b600c07c8c5f6c01e478f990', slot: "content", class: "cat-nav" }, h("ul", { key: '386fda017f42a0152b0095f3a107f892c425f844' }, this.timeArray().map(time => {
127
+ return (h(Host, { key: 'e9bfaeee8aa39aa58ac287afeaed1a2fc39d7b83' }, h("cat-input", { key: '1e200e6041b06a0859e392cfc6b6b03668b3eb35', class: "cat-time-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, 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.format(this.selectionTime, false), errors: this.errors, errorUpdate: this.errorUpdate, nativeAttributes: this.nativeAttributes, onCatFocus: e => this.catFocus.emit(e.detail), onCatBlur: e => this.onInputBlur(e.detail) }, h("span", { key: 'e91e3e12272c24858a71b485e00e54cf00d7386f', slot: "label" }, this.hasSlottedLabel && h("slot", { key: '2449ea042497293868bcc767b1626070b3a1dcec', name: "label" }), !this.hasSlottedLabel && this.label, h("span", { key: '3bab583a7629d01350fbd9e54d3fe1f113e0b372', class: "label-aria" }, " (HH:mm)")), h("div", { key: '8340d31e70e30ebe1d020f456b3a7bc5bed6b998', slot: "addon", class: "cat-time-addon" }, this.locale.timeFormat === '12' && (h("cat-button", { key: 'e6bb50abe2c3296cee7c3d5c02a6cef7c69f8678', class: "cat-time-format", disabled: this.disabled || this.readonly, onCatClick: () => this.toggleAm() }, this.isAm ? 'AM' : 'PM')), h("cat-dropdown", { key: 'e79b7f58ffdc4d356e94f3e96afb6727d3e9be26', slot: "addon", placement: this.placement }, h("cat-button", { key: 'd6bd905d7760e0ae7e9ab8c23e87f7c926769aa9', slot: "trigger", class: "cat-time-toggle", disabled: this.disabled || this.readonly, icon: "$cat:timepicker-clock", iconOnly: true, a11yLabel: this.selectionTime ? `${this.locale.change}, ${this.format(this.selectionTime)}` : this.locale.choose }), h("nav", { key: 'c2ae49020a1e8cafedd27b8a7e061e63dbb4c6d2', slot: "content", class: "cat-nav" }, h("ul", { key: 'b918672be1b65ca3a1c2daa239a196d4117b52f7' }, this.timeArray().map(time => {
128
128
  const isoTime = formatIso(time);
129
129
  const disabled = isBefore(time, this.min ?? null) || isAfter(time, this.max ?? null);
130
130
  return (h("li", null, h("cat-button", { class: {
131
131
  'cat-nav-item': true,
132
132
  'time-disabled': disabled
133
133
  }, disabled: disabled, active: isoTime === this.value, color: isoTime === this.value ? 'primary' : 'secondary', variant: isoTime === this.value ? 'filled' : 'outlined', onCatClick: () => this.select(time), "data-time": isoTime }, this.format(time))));
134
- }))))), this.hasSlottedHint && (h("span", { key: 'e563a161e00cc919f39ecf663cc93065ca078f9a', slot: "hint" }, h("slot", { key: 'c302e5d24d005b43fe035865488318d03389d7cb', name: "hint" }))))));
134
+ }))))), this.hasSlottedHint && (h("span", { key: '817f2b58417911affc39ce6977160998c39ebf71', slot: "hint" }, h("slot", { key: 'a1ffdd541103064abf49311801088fe15d5ed88d', name: "hint" }))))));
135
135
  }
136
136
  timeArray() {
137
137
  const result = [];
@@ -58,13 +58,13 @@ export class CatToggle {
58
58
  this.input.blur();
59
59
  }
60
60
  render() {
61
- return (h(Host, { key: 'bb91d759083937e929c68198caa5c201174c929a' }, h("label", { key: '2e506a58f0db88b7bfef12ebb3c70331b34a572a', htmlFor: this.id, class: {
61
+ return (h(Host, { key: '021e20f2f3e8a37d085a11966df3980758fd4662' }, h("label", { key: '8454945f873a5cef9b0ab52fd533289059d5d77c', htmlFor: this.id, class: {
62
62
  'is-hidden': this.labelHidden,
63
63
  'is-disabled': this.disabled,
64
64
  'label-left': this.labelLeft,
65
65
  'align-center': this.alignment === 'center',
66
66
  'align-end': this.alignment === 'bottom'
67
- } }, h("input", { key: '24347bf7bf6faece089c1566f1a2e6ec73f55f51', ...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, class: "form-check-input", role: "switch", 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: 'f677b6651be206bd19d5f1f615dd013ebdc4d0cf', class: "toggle" }), h("span", { key: 'a4769d262bae63c908fa52d76f619e401b6fd7c4', class: "label", part: "label" }, (this.hasSlottedLabel && h("slot", { key: 'b298a55112a909a8eab9d7f09e7a4af1751c54f0', name: "label" })) || this.label)), this.hasHint && (h("div", { key: 'b2df03f3bd345b02bd179804eee49a6cd6c6ae9a', class: { 'hint-wrapper': true, 'label-left': this.labelLeft } }, h("div", { key: 'e24ed4717befcc9ecd11a8d1138637280f94fcc7', class: "toggle-placeholder" }), h(CatFormHint, { key: 'd41d9070b15cf1e06afb972642606c4b4c67e631', id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }) })))));
67
+ } }, h("input", { key: '7eb1ab9de417cf27856caf257422be3221c17d94', ...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, class: "form-check-input", role: "switch", 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: 'eb6c4b072ca903fd7df8a30e570be54c6df4133e', class: "toggle" }), h("span", { key: 'b07bb543bb4ac09fecd8ce1c0f0c1276846aa1e1', class: "label", part: "label" }, (this.hasSlottedLabel && h("slot", { key: '199cc06d3b54bb910c15449185b63d04f91163fd', name: "label" })) || this.label)), this.hasHint && (h("div", { key: '43145cb96e769390309ed4003e94b04c1bea1a53', class: { 'hint-wrapper': true, 'label-left': this.labelLeft } }, h("div", { key: 'f0cbb265cec353a7f68432e369f0f2c7d042c3c7', class: "toggle-placeholder" }), h(CatFormHint, { key: '06692bcf33bf7a3202cc8977238003b96b9e4b8c', id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }) })))));
68
68
  }
69
69
  get hasHint() {
70
70
  return !!this.hint || !!this.hasSlottedHint;
@@ -64,12 +64,12 @@ export class CatTooltip {
64
64
  }
65
65
  }
66
66
  render() {
67
- return (h(Host, { key: '22e95841f5029e24e0ae9b08e0843fd8b8d360df' }, h("slot", { key: 'b9fc1e2472dc4610fe61ffc16274fa7b49510ecf' }), h("div", { key: 'e2971ec2746574a27b066ae9b3cece3236aa1bd9', ref: el => (this.tooltip = el), id: this.id, role: "tooltip", "aria-hidden": !this.open, "aria-live": this.open ? 'polite' : 'off', class: {
67
+ return (h(Host, { key: '7d72ac4a2ccb057d7bca7290d6fc4e06c02c644c' }, h("slot", { key: '260fb1edf80d86a93892eed9df3ce4622cc441a3' }), h("div", { key: 'f7a7dc3f3333be42ed1a795dad64f74e9194201a', ref: el => (this.tooltip = el), id: this.id, role: "tooltip", "aria-hidden": !this.open, "aria-live": this.open ? 'polite' : 'off', class: {
68
68
  tooltip: true,
69
69
  'tooltip-hidden': this.inactive,
70
70
  'tooltip-round': this.round,
71
71
  [`tooltip-${this.size}`]: Boolean(this.size)
72
- } }, h("slot", { key: 'afbcad951679fb8d139c8415a7305f498072276c', name: "content" }, h("p", { key: '6e10ef094c479288a02f8b874d48206158dece38' }, this.content)))));
72
+ } }, h("slot", { key: 'ebed88ce3b9481d6046cf5a70245c26a3dbc0a03', name: "content" }, h("p", { key: '455f894145ba5d1b8a8c001a6a4017d8aac81771' }, this.content)))));
73
73
  }
74
74
  async update() {
75
75
  if (this.trigger && this.tooltip) {
@@ -197,13 +197,13 @@ export class CatTooltip {
197
197
  "type": "string",
198
198
  "mutable": false,
199
199
  "complexType": {
200
- "original": "Placement",
200
+ "original": "TooltipPlacement",
201
201
  "resolved": "\"bottom\" | \"bottom-end\" | \"bottom-start\" | \"left\" | \"left-end\" | \"left-start\" | \"right\" | \"right-end\" | \"right-start\" | \"top\" | \"top-end\" | \"top-start\"",
202
202
  "references": {
203
- "Placement": {
204
- "location": "import",
205
- "path": "@floating-ui/dom",
206
- "id": "../node_modules/.pnpm/@floating-ui+dom@1.6.5/node_modules/@floating-ui/dom/dist/floating-ui.dom.d.ts::Placement"
203
+ "TooltipPlacement": {
204
+ "location": "local",
205
+ "path": "/home/runner/work/catalyst/catalyst/core/src/components/cat-tooltip/cat-tooltip.tsx",
206
+ "id": "src/components/cat-tooltip/cat-tooltip.tsx::TooltipPlacement"
207
207
  }
208
208
  }
209
209
  },
@@ -1 +1 @@
1
- {"version":3,"file":"cat-tooltip.js","sourceRoot":"","sources":["../../../src/components/cat-tooltip/cat-tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,EAAa,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC/F,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACjF,OAAO,aAA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C,CAAC;QAC/C,IAAI,CAAC,iBAAiB,EAAE,EAAE,CAAC;QAC3B,IAAI,CAAC,iBAAiB,GAAG,SAAS,CAAC;IACrC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAvNuB,iBAAM,GAAG,CAAC,AAAJ,CAAK;AACX,wBAAa,GAAG,CAAC,AAAJ,CAAK","sourcesContent":["import { autoUpdate, computePosition, flip, offset, Placement, shift } from '@floating-ui/dom';\nimport { Component, Element, h, Host, Listen, Prop, State } from '@stencil/core';\nimport isTouchScreen from '../../utils/is-touch-screen';\n\nlet nextUniqueId = 0;\n\n/**\n * Tooltips display additional information when the user hovers over or\n * interacts with a trigger element. The tooltip can be customized with\n * different placements, sizes, and styles.\n */\n@Component({\n tag: 'cat-tooltip',\n styleUrl: 'cat-tooltip.scss',\n shadow: true\n})\nexport class CatTooltip {\n private static readonly OFFSET = 4;\n private static readonly SHIFT_PADDING = 4;\n private readonly id = `cat-tooltip-${nextUniqueId++}`;\n private tooltip?: HTMLElement;\n private trigger?: Element;\n private showTimeout?: number;\n private hideTimeout?: number;\n private touchTimeout?: number;\n private inactive = false;\n private cleanupFloatingUi?: () => void;\n\n private readonly boundShowListener: () => void;\n private readonly boundHideListener: () => void;\n private readonly boundWindowTouchStartListener: () => void;\n private readonly boundTouchStartListener: (event: Event) => void;\n private readonly boundTouchEndListener: () => void;\n\n constructor() {\n this.boundShowListener = this.showListener.bind(this);\n this.boundHideListener = this.hideListener.bind(this);\n this.boundWindowTouchStartListener = this.windowTouchStartListener.bind(this);\n this.boundTouchStartListener = this.touchStartListener.bind(this);\n this.boundTouchEndListener = this.touchEndListener.bind(this);\n }\n\n @Element() hostElement!: HTMLElement;\n\n @State() open = false;\n\n /**\n * The content of the tooltip.\n */\n @Prop() content = '';\n\n /**\n * Specifies that the tooltip should be disabled. A disabled tooltip is unusable,\n * and invisible. Corresponds with the native HTML disabled attribute.\n */\n @Prop() disabled = false;\n\n /**\n * The placement of the tooltip.\n */\n @Prop() placement: Placement = 'top';\n\n /**\n * Use round tooltip edges.\n */\n @Prop() round = false;\n\n /**\n * The size of the tooltip.\n */\n @Prop() size: 's' | 'm' | 'l' = 'm';\n\n /**\n * The delay time for showing tooltip in ms.\n */\n @Prop() showDelay = 250;\n\n /**\n * The delay time for hiding tooltip in ms.\n */\n @Prop() hideDelay = 0;\n\n /**\n * The duration of tap to show the tooltip.\n */\n @Prop() longTouchDuration = 1000;\n\n @Listen('keydown', { target: 'window' })\n handleKeyDown({ key }: KeyboardEvent) {\n key === 'Escape' && this.hideTooltip();\n }\n\n componentDidLoad(): void {\n const slot = this.hostElement.shadowRoot?.querySelector('slot');\n this.trigger = slot?.assignedElements?.()?.[0];\n if (this.trigger && !this.trigger.hasAttribute('aria-describedby')) {\n this.trigger.setAttribute('aria-describedby', this.id);\n }\n\n if (isTouchScreen) {\n window.addEventListener('touchstart', this.boundWindowTouchStartListener);\n this.trigger?.addEventListener('touchstart', this.boundTouchStartListener);\n this.trigger?.addEventListener('touchend', this.boundTouchEndListener);\n } else {\n this.trigger?.addEventListener('focusin', this.boundShowListener);\n this.trigger?.addEventListener('focusout', this.boundHideListener);\n this.trigger?.addEventListener('mouseenter', this.boundShowListener);\n this.trigger?.addEventListener('mouseleave', this.boundHideListener);\n }\n }\n\n componentWillRender(): void {\n this.inactive = this.disabled || (!this.content && !this.hostElement.querySelector('[slot=\"content\"]'));\n }\n\n disconnectedCallback(): void {\n if (isTouchScreen) {\n window.removeEventListener('touchstart', this.boundWindowTouchStartListener);\n this.trigger?.removeEventListener('touchstart', this.boundTouchStartListener);\n this.trigger?.removeEventListener('touchend', this.boundTouchEndListener);\n } else {\n this.trigger?.removeEventListener('mouseenter', this.boundShowListener);\n this.trigger?.removeEventListener('mouseleave', this.boundHideListener);\n this.trigger?.removeEventListener('focusin', this.boundShowListener);\n this.trigger?.removeEventListener('focusout', this.boundHideListener);\n }\n }\n\n render() {\n return (\n <Host>\n <slot />\n <div\n ref={el => (this.tooltip = el)}\n id={this.id}\n role=\"tooltip\"\n aria-hidden={!this.open}\n aria-live={this.open ? 'polite' : 'off'}\n class={{\n tooltip: true,\n 'tooltip-hidden': this.inactive,\n 'tooltip-round': this.round,\n [`tooltip-${this.size}`]: Boolean(this.size)\n }}\n >\n <slot name=\"content\">\n {/* The paragraph is needed here to make aria-live work properly. */}\n <p>{this.content}</p>\n </slot>\n </div>\n </Host>\n );\n }\n\n private async update() {\n if (this.trigger && this.tooltip) {\n await computePosition(this.trigger, this.tooltip, {\n strategy: 'fixed',\n placement: this.placement,\n middleware: [\n offset(CatTooltip.OFFSET),\n flip({ fallbackAxisSideDirection: 'start' }),\n shift({ padding: CatTooltip.SHIFT_PADDING })\n ]\n }).then(({ x, y }) => {\n if (this.tooltip) {\n Object.assign(this.tooltip.style, {\n left: `${Math.max(0, x)}px`,\n top: `${y}px`\n });\n }\n });\n }\n }\n\n private showListener() {\n window.clearTimeout(this.hideTimeout);\n this.hideTimeout = undefined;\n if (!this.showTimeout) {\n this.showTimeout = window.setTimeout(() => {\n this.showTimeout = undefined;\n this.showTooltip();\n }, this.showDelay);\n }\n }\n\n private hideListener() {\n window.clearTimeout(this.showTimeout);\n this.showTimeout = undefined;\n if (!this.hideTimeout) {\n this.hideTimeout = window.setTimeout(() => {\n this.hideTimeout = undefined;\n this.hideTooltip();\n }, this.hideDelay);\n }\n }\n\n private touchStartListener(event: Event) {\n event.stopPropagation();\n if (!this.touchTimeout) {\n this.touchTimeout = window.setTimeout(() => {\n this.touchTimeout = undefined;\n this.showTooltip();\n }, this.longTouchDuration);\n }\n }\n\n private touchEndListener() {\n window.clearTimeout(this.touchTimeout);\n this.touchTimeout = undefined;\n this.hideTooltip();\n }\n\n private windowTouchStartListener() {\n this.hideTooltip();\n }\n\n private showTooltip() {\n if (this.trigger && this.tooltip) {\n this.cleanupFloatingUi = autoUpdate(this.trigger, this.tooltip, () => this.update());\n }\n if (!this.inactive) {\n this.open = true;\n this.tooltip?.classList.add('tooltip-show');\n }\n }\n\n private hideTooltip() {\n this.open = false;\n this.tooltip?.classList.remove('tooltip-show');\n this.cleanupFloatingUi?.();\n this.cleanupFloatingUi = undefined;\n }\n}\n"]}
1
+ {"version":3,"file":"cat-tooltip.js","sourceRoot":"","sources":["../../../src/components/cat-tooltip/cat-tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,EAAa,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC/F,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACjF,OAAO,aAAa,MAAM,6BAA6B,CAAC;AAExD,IAAI,YAAY,GAAG,CAAC,CAAC;AAIrB;;;;GAIG;AAMH,MAAM,OAAO,UAAU;IAkBrB;QAfiB,OAAE,GAAG,eAAe,YAAY,EAAE,EAAE,CAAC;QAM9C,aAAQ,GAAG,KAAK,CAAC;oBAmBT,KAAK;uBAKH,EAAE;wBAMD,KAAK;yBAKc,KAAK;qBAK3B,KAAK;oBAKW,GAAG;yBAKf,GAAG;yBAKH,CAAC;iCAKO,IAAI;QAlD9B,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACtD,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACtD,IAAI,CAAC,6BAA6B,GAAG,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC9E,IAAI,CAAC,uBAAuB,GAAG,IAAI,CAAC,kBA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C;IAEO,wBAAwB;QAC9B,IAAI,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;IAEO,WAAW;QACjB,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjC,IAAI,CAAC,iBAAiB,GAAG,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;QACvF,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;YACjB,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC;IAEO,WAAW;QACjB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;QAClB,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;QAC/C,IAAI,CAAC,iBAAiB,EAAE,EAAE,CAAC;QAC3B,IAAI,CAAC,iBAAiB,GAAG,SAAS,CAAC;IACrC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAvNuB,iBAAM,GAAG,CAAC,AAAJ,CAAK;AACX,wBAAa,GAAG,CAAC,AAAJ,CAAK","sourcesContent":["import { autoUpdate, computePosition, flip, offset, Placement, shift } from '@floating-ui/dom';\nimport { Component, Element, h, Host, Listen, Prop, State } from '@stencil/core';\nimport isTouchScreen from '../../utils/is-touch-screen';\n\nlet nextUniqueId = 0;\n\nexport type TooltipPlacement = Placement;\n\n/**\n * Tooltips display additional information when the user hovers over or\n * interacts with a trigger element. The tooltip can be customized with\n * different placements, sizes, and styles.\n */\n@Component({\n tag: 'cat-tooltip',\n styleUrl: 'cat-tooltip.scss',\n shadow: true\n})\nexport class CatTooltip {\n private static readonly OFFSET = 4;\n private static readonly SHIFT_PADDING = 4;\n private readonly id = `cat-tooltip-${nextUniqueId++}`;\n private tooltip?: HTMLElement;\n private trigger?: Element;\n private showTimeout?: number;\n private hideTimeout?: number;\n private touchTimeout?: number;\n private inactive = false;\n private cleanupFloatingUi?: () => void;\n\n private readonly boundShowListener: () => void;\n private readonly boundHideListener: () => void;\n private readonly boundWindowTouchStartListener: () => void;\n private readonly boundTouchStartListener: (event: Event) => void;\n private readonly boundTouchEndListener: () => void;\n\n constructor() {\n this.boundShowListener = this.showListener.bind(this);\n this.boundHideListener = this.hideListener.bind(this);\n this.boundWindowTouchStartListener = this.windowTouchStartListener.bind(this);\n this.boundTouchStartListener = this.touchStartListener.bind(this);\n this.boundTouchEndListener = this.touchEndListener.bind(this);\n }\n\n @Element() hostElement!: HTMLElement;\n\n @State() open = false;\n\n /**\n * The content of the tooltip.\n */\n @Prop() content = '';\n\n /**\n * Specifies that the tooltip should be disabled. A disabled tooltip is unusable,\n * and invisible. Corresponds with the native HTML disabled attribute.\n */\n @Prop() disabled = false;\n\n /**\n * The placement of the tooltip.\n */\n @Prop() placement: TooltipPlacement = 'top';\n\n /**\n * Use round tooltip edges.\n */\n @Prop() round = false;\n\n /**\n * The size of the tooltip.\n */\n @Prop() size: 's' | 'm' | 'l' = 'm';\n\n /**\n * The delay time for showing tooltip in ms.\n */\n @Prop() showDelay = 250;\n\n /**\n * The delay time for hiding tooltip in ms.\n */\n @Prop() hideDelay = 0;\n\n /**\n * The duration of tap to show the tooltip.\n */\n @Prop() longTouchDuration = 1000;\n\n @Listen('keydown', { target: 'window' })\n handleKeyDown({ key }: KeyboardEvent) {\n key === 'Escape' && this.hideTooltip();\n }\n\n componentDidLoad(): void {\n const slot = this.hostElement.shadowRoot?.querySelector('slot');\n this.trigger = slot?.assignedElements?.()?.[0];\n if (this.trigger && !this.trigger.hasAttribute('aria-describedby')) {\n this.trigger.setAttribute('aria-describedby', this.id);\n }\n\n if (isTouchScreen) {\n window.addEventListener('touchstart', this.boundWindowTouchStartListener);\n this.trigger?.addEventListener('touchstart', this.boundTouchStartListener);\n this.trigger?.addEventListener('touchend', this.boundTouchEndListener);\n } else {\n this.trigger?.addEventListener('focusin', this.boundShowListener);\n this.trigger?.addEventListener('focusout', this.boundHideListener);\n this.trigger?.addEventListener('mouseenter', this.boundShowListener);\n this.trigger?.addEventListener('mouseleave', this.boundHideListener);\n }\n }\n\n componentWillRender(): void {\n this.inactive = this.disabled || (!this.content && !this.hostElement.querySelector('[slot=\"content\"]'));\n }\n\n disconnectedCallback(): void {\n if (isTouchScreen) {\n window.removeEventListener('touchstart', this.boundWindowTouchStartListener);\n this.trigger?.removeEventListener('touchstart', this.boundTouchStartListener);\n this.trigger?.removeEventListener('touchend', this.boundTouchEndListener);\n } else {\n this.trigger?.removeEventListener('mouseenter', this.boundShowListener);\n this.trigger?.removeEventListener('mouseleave', this.boundHideListener);\n this.trigger?.removeEventListener('focusin', this.boundShowListener);\n this.trigger?.removeEventListener('focusout', this.boundHideListener);\n }\n }\n\n render() {\n return (\n <Host>\n <slot />\n <div\n ref={el => (this.tooltip = el)}\n id={this.id}\n role=\"tooltip\"\n aria-hidden={!this.open}\n aria-live={this.open ? 'polite' : 'off'}\n class={{\n tooltip: true,\n 'tooltip-hidden': this.inactive,\n 'tooltip-round': this.round,\n [`tooltip-${this.size}`]: Boolean(this.size)\n }}\n >\n <slot name=\"content\">\n {/* The paragraph is needed here to make aria-live work properly. */}\n <p>{this.content}</p>\n </slot>\n </div>\n </Host>\n );\n }\n\n private async update() {\n if (this.trigger && this.tooltip) {\n await computePosition(this.trigger, this.tooltip, {\n strategy: 'fixed',\n placement: this.placement,\n middleware: [\n offset(CatTooltip.OFFSET),\n flip({ fallbackAxisSideDirection: 'start' }),\n shift({ padding: CatTooltip.SHIFT_PADDING })\n ]\n }).then(({ x, y }) => {\n if (this.tooltip) {\n Object.assign(this.tooltip.style, {\n left: `${Math.max(0, x)}px`,\n top: `${y}px`\n });\n }\n });\n }\n }\n\n private showListener() {\n window.clearTimeout(this.hideTimeout);\n this.hideTimeout = undefined;\n if (!this.showTimeout) {\n this.showTimeout = window.setTimeout(() => {\n this.showTimeout = undefined;\n this.showTooltip();\n }, this.showDelay);\n }\n }\n\n private hideListener() {\n window.clearTimeout(this.showTimeout);\n this.showTimeout = undefined;\n if (!this.hideTimeout) {\n this.hideTimeout = window.setTimeout(() => {\n this.hideTimeout = undefined;\n this.hideTooltip();\n }, this.hideDelay);\n }\n }\n\n private touchStartListener(event: Event) {\n event.stopPropagation();\n if (!this.touchTimeout) {\n this.touchTimeout = window.setTimeout(() => {\n this.touchTimeout = undefined;\n this.showTooltip();\n }, this.longTouchDuration);\n }\n }\n\n private touchEndListener() {\n window.clearTimeout(this.touchTimeout);\n this.touchTimeout = undefined;\n this.hideTooltip();\n }\n\n private windowTouchStartListener() {\n this.hideTooltip();\n }\n\n private showTooltip() {\n if (this.trigger && this.tooltip) {\n this.cleanupFloatingUi = autoUpdate(this.trigger, this.tooltip, () => this.update());\n }\n if (!this.inactive) {\n this.open = true;\n this.tooltip?.classList.add('tooltip-show');\n }\n }\n\n private hideTooltip() {\n this.open = false;\n this.tooltip?.classList.remove('tooltip-show');\n this.cleanupFloatingUi?.();\n this.cleanupFloatingUi = undefined;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAwB,eAAe,EAAE,MAAM,yCAAyC,CAAC;AACjH,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC3F,OAAO,EACL,sBAAsB,EAEtB,sBAAsB,EACvB,MAAM,gDAAgD,CAAC;AASxD,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC","sourcesContent":["export { Components, JSX } from './components';\nexport { CatI18nRegistry, CatI18nTranslationFn, catI18nRegistry } from './components/cat-i18n/cat-i18n-registry';\nexport { CatIconRegistry, catIconRegistry } from './components/cat-icon/cat-icon-registry';\nexport {\n CatNotificationService,\n ToastOptions,\n catNotificationService\n} from './components/cat-notification/cat-notification';\nexport {\n CatSelectConnector,\n CatSelectMultipleTaggingValue,\n CatSelectTaggingValue,\n Item,\n Page,\n RenderInfo\n} from './components/cat-select/cat-select';\nexport { objectArrayConnector, stringArrayConnector, stringMapConnector } from './components/cat-select/connectors';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAwB,eAAe,EAAE,MAAM,yCAAyC,CAAC;AACjH,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC3F,OAAO,EACL,sBAAsB,EAEtB,sBAAsB,EACvB,MAAM,gDAAgD,CAAC;AASxD,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC","sourcesContent":["export { Components, JSX } from './components';\nexport { CatI18nRegistry, CatI18nTranslationFn, catI18nRegistry } from './components/cat-i18n/cat-i18n-registry';\nexport { CatIconRegistry, catIconRegistry } from './components/cat-icon/cat-icon-registry';\nexport {\n CatNotificationService,\n ToastOptions,\n catNotificationService\n} from './components/cat-notification/cat-notification';\nexport {\n CatSelectConnector,\n CatSelectMultipleTaggingValue,\n CatSelectTaggingValue,\n Item,\n Page,\n RenderInfo\n} from './components/cat-select/cat-select';\nexport { objectArrayConnector, stringArrayConnector, stringMapConnector } from './components/cat-select/connectors';\nexport { TooltipPlacement } from './components/cat-tooltip/cat-tooltip';\n"]}
@@ -40,7 +40,7 @@ const CatAlert$1 = /*@__PURE__*/ proxyCustomElement(class CatAlert extends HTMLE
40
40
  setAttributeDefault(this, 'role', this.mapRole.get(this.color));
41
41
  }
42
42
  render() {
43
- return (h(Host, { key: '7a1be6c2ec8bf0638bc0e6197f85ef2047b3e125' }, !this.noIcon && h("cat-icon", { key: '3505dc2c7c9ca0b28fc5145eab55beaedb4a2500', size: "l", icon: this.icon || this.mapIcon.get(this.color) }), h("div", { key: '6cac35c1cba20613515c75e066cfd91f5dd9670c', class: "content" }, h("slot", { key: '0d845eb31d8df70d4a0bf089fbe764a9c5359502' }))));
43
+ return (h(Host, { key: 'c02988c259d20cfb381b69a43cd9800a075f9c97' }, !this.noIcon && h("cat-icon", { key: 'fee7a2b021437de0c7617187e48c3e436218b50f', size: "l", icon: this.icon || this.mapIcon.get(this.color) }), h("div", { key: '4bb19866ff246d7ec956c213e39f8d09080f02da', class: "content" }, h("slot", { key: 'a3356a8b51747570f01c33cd77106156aed5c404' }))));
44
44
  }
45
45
  get hostElement() { return this; }
46
46
  static get style() { return CatAlertStyle0; }
@@ -15,7 +15,7 @@ const CatBadge$1 = /*@__PURE__*/ proxyCustomElement(class CatBadge extends HTMLE
15
15
  this.pulse = false;
16
16
  }
17
17
  render() {
18
- return h("slot", { key: '68b23417a5826a8a39c0ed38bcae472c2d5d8c9d' });
18
+ return h("slot", { key: '23ddf7fc9b33cb4410ba74dbafda8d084cdc3606' });
19
19
  }
20
20
  get hostElement() { return this; }
21
21
  static get style() { return CatBadgeStyle0; }
@@ -12,7 +12,7 @@ const CatButtonGroup$1 = /*@__PURE__*/ proxyCustomElement(class CatButtonGroup e
12
12
  this.a11yLabel = undefined;
13
13
  }
14
14
  render() {
15
- return (h(Host, { key: 'adf2bd20526672d6b485b7f84422510e40301415', role: "group", "aria-label": this.a11yLabel }, h("slot", { key: 'cd9e705fb12cf83bc4b7a7efb65ebd7b0e2652e9', onSlotchange: this.onSlotChange.bind(this) })));
15
+ return (h(Host, { key: 'ca23ccee6536ec2cef9d82832cf16dacac31ef2a', role: "group", "aria-label": this.a11yLabel }, h("slot", { key: 'b4a3485c8595874779ef41468e5af98163c6573c', onSlotchange: this.onSlotChange.bind(this) })));
16
16
  }
17
17
  onSlotChange() {
18
18
  this.formElements = Array.from(this.hostElement.querySelectorAll('cat-button'));
@@ -118,7 +118,20 @@ function createEmptyStyleRule(query) {
118
118
  }
119
119
  }
120
120
 
121
- const catButtonCss = ":host{display:inline-block;max-width:100%;vertical-align:middle;-webkit-user-select:none;-ms-user-select:none;user-select:none;}:host([hidden]){display:none}.cat-button{position:relative;font:inherit;display:flex;align-items:center;justify-content:center;border:none;border-radius:var(--cat-border-radius-m, 0.25rem);text-decoration:none;width:100%;box-sizing:border-box;cursor:pointer;transition:color 125ms linear, border-color 125ms linear, background-color 125ms linear, box-shadow 125ms linear}.cat-button:focus-visible{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.cat-button-content{display:flex;flex-direction:column;min-width:0}.cat-button-content-inner{word-wrap:break-word;word-break:break-word}.cat-button-ellipsed .cat-button-content-inner{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.cat-button-disabled{cursor:not-allowed}.cat-button-round{border-radius:10rem}.cat-button-loading{cursor:default}.cat-button-loading cat-spinner{position:absolute}.cat-button-loading>*:not(cat-spinner){visibility:hidden}.cat-group-button-first{border-top-right-radius:0;border-bottom-right-radius:0}.cat-group-button-middle{border-radius:0}.cat-group-button-last{border-top-left-radius:0;border-bottom-left-radius:0}.cat-group-button:hover{z-index:1}.cat-group-button:focus-visible{z-index:2}.cat-button-filled{background-color:rgb(var(--bg));color:rgb(var(--fill));font-weight:var(--cat-font-weight-button, 600);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:greyscale}.cat-button-filled.cat-button-disabled{--bg:242, 244, 247;--fill:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-outlined{background-color:white;box-shadow:inset 0 0 0 1px rgba(var(--base), 0.2);color:rgb(var(--text))}.cat-button-outlined.cat-button-disabled{--base:var(--cat-font-color-muted, 81, 92, 108);--text:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-outlined:hover:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-outlined.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-outlined:active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-text{background-color:transparent;color:rgb(var(--text));text-decoration:var(--cat-link-button-decoration, none)}.cat-button-text.cat-button-disabled{--text:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-text:hover:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-text.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-link{background-color:transparent;color:rgb(var(--text))}.cat-button-link.cat-button-disabled{--text:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-link:hover:not(.cat-button-disabled):not(.cat-button-loading){text-decoration:var(--cat-link-decoration-hover, underline)}.cat-button-link.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading){text-decoration:var(--cat-link-decoration-hover, underline)}.cat-button-primary{--bg:var(--cat-primary-bg, 0, 129, 148);--fill:var(--cat-primary-fill, 255, 255, 255);--text:var(--cat-primary-text, 0, 129, 148);--base:var(--cat-primary-text, 0, 129, 148)}.cat-button-primary:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-primary-bg-hover, 1, 115, 132);--fill:var(--cat-primary-fill-hover, 255, 255, 255);--text:var(--cat-primary-text-hover, 1, 115, 132)}.cat-button-primary.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-primary:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-primary-bg-active, 2, 99, 113);--fill:var(--cat-primary-fill-active, 255, 255, 255);--text:var(--cat-primary-text-active, 2, 99, 113)}.cat-button-secondary{--bg:var(--cat-secondary-bg, 105, 118, 135);--fill:var(--cat-secondary-fill, 255, 255, 255);--text:var(--cat-secondary-text, 0, 0, 0);--base:var(--cat-secondary-bg, 105, 118, 135)}.cat-button-secondary:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-secondary-bg-hover, 105, 118, 135);--fill:var(--cat-secondary-fill-hover, 255, 255, 255);--text:var(--cat-secondary-text-hover, 0, 0, 0)}.cat-button-secondary.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-secondary:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-secondary-bg-active, 105, 118, 135);--fill:var(--cat-secondary-fill-active, 255, 255, 255);--text:var(--cat-secondary-text-active, 0, 0, 0)}.cat-button-info{--bg:var(--cat-info-bg, 0, 115, 230);--fill:var(--cat-info-fill, 255, 255, 255);--text:var(--cat-info-text, 0, 115, 230);--base:var(--cat-info-text, 0, 115, 230)}.cat-button-info:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-info-bg-hover, 0, 107, 227);--fill:var(--cat-info-fill-hover, 255, 255, 255);--text:var(--cat-info-text-hover, 0, 107, 227)}.cat-button-info.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-info:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-info-bg-active, 0, 96, 223);--fill:var(--cat-info-fill-active, 255, 255, 255);--text:var(--cat-info-text-active, 0, 96, 223)}.cat-button-success{--bg:var(--cat-success-bg, 0, 132, 88);--fill:var(--cat-success-fill, 255, 255, 255);--text:var(--cat-success-text, 0, 132, 88);--base:var(--cat-success-text, 0, 132, 88)}.cat-button-success:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-success-bg-hover, 0, 117, 78);--fill:var(--cat-success-fill-hover, 255, 255, 255);--text:var(--cat-success-text-hover, 0, 117, 78)}.cat-button-success.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-success:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-success-bg-active, 0, 105, 70);--fill:var(--cat-success-fill-active, 255, 255, 255);--text:var(--cat-success-text-active, 0, 105, 70)}.cat-button-warning{--bg:var(--cat-warning-bg, 255, 206, 128);--fill:var(--cat-warning-fill, 0, 0, 0);--text:var(--cat-warning-text, 159, 97, 0);--base:var(--cat-warning-text, 159, 97, 0)}.cat-button-warning:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-warning-bg-hover, 255, 214, 148);--fill:var(--cat-warning-fill-hover, 0, 0, 0);--text:var(--cat-warning-text-hover, 159, 97, 0)}.cat-button-warning.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-warning:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-warning-bg-active, 255, 222, 168);--fill:var(--cat-warning-fill-active, 0, 0, 0);--text:var(--cat-warning-text-active, 159, 97, 0)}.cat-button-danger{--bg:var(--cat-danger-bg, 217, 52, 13);--fill:var(--cat-danger-fill, 255, 255, 255);--text:var(--cat-danger-text, 217, 52, 13);--base:var(--cat-danger-text, 217, 52, 13)}.cat-button-danger:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-danger-bg-hover, 194, 46, 11);--fill:var(--cat-danger-fill-hover, 255, 255, 255);--text:var(--cat-danger-text-hover, 194, 46, 11)}.cat-button-danger.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-danger:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-danger-bg-active, 174, 42, 10);--fill:var(--cat-danger-fill-active, 255, 255, 255);--text:var(--cat-danger-text-active, 174, 42, 10)}:host(.cat-button-pull:not([size])){margin:-0.625rem -0.75rem}:host(.cat-button-pull-h:not([size])){margin-left:-0.75rem;margin-right:-0.75rem}:host(.cat-button-pull-v:not([size])){margin-top:-0.625rem;margin-bottom:-0.625rem}:host(.cat-button-pull-t:not([size])){margin-top:-0.625rem}:host(.cat-button-pull-l:not([size])){margin-left:-0.75rem}:host(.cat-button-pull-b:not([size])){margin-bottom:-0.625rem}:host(.cat-button-pull-r:not([size])){margin-right:-0.75rem}.cat-button-xs{min-width:1.5rem;padding:0.1875rem 0.25rem;font-size:0.875rem;line-height:1.125rem;gap:0.25rem}.cat-button-xs.cat-button-icon{width:1.5rem;height:1.5rem;padding:0}:host(.cat-button-pull[size=xs]){margin:-0.1875rem -0.25rem}:host(.cat-button-pull-h[size=xs]){margin-left:-0.25rem;margin-right:-0.25rem}:host(.cat-button-pull-v[size=xs]){margin-top:-0.1875rem;margin-bottom:-0.1875rem}:host(.cat-button-pull-t[size=xs]){margin-top:-0.1875rem}:host(.cat-button-pull-l[size=xs]){margin-left:-0.25rem}:host(.cat-button-pull-b[size=xs]){margin-bottom:-0.1875rem}:host(.cat-button-pull-r[size=xs]){margin-right:-0.25rem}.cat-button-s{min-width:2rem;padding:0.375rem 0.5rem;font-size:0.9375rem;line-height:1.25rem;gap:0.25rem}.cat-button-s cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-s.cat-button-icon{width:2rem;height:2rem;padding:0}:host(.cat-button-pull[size=s]){margin:-0.375rem -0.5rem}:host(.cat-button-pull-h[size=s]){margin-left:-0.5rem;margin-right:-0.5rem}:host(.cat-button-pull-v[size=s]){margin-top:-0.375rem;margin-bottom:-0.375rem}:host(.cat-button-pull-t[size=s]){margin-top:-0.375rem}:host(.cat-button-pull-l[size=s]){margin-left:-0.5rem}:host(.cat-button-pull-b[size=s]){margin-bottom:-0.375rem}:host(.cat-button-pull-r[size=s]){margin-right:-0.5rem}.cat-button-m{min-width:2.5rem;padding:0.625rem 0.75rem;font-size:0.9375rem;line-height:1.25rem;gap:0.25rem}.cat-button-m cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-m.cat-button-icon{width:2.5rem;height:2.5rem;padding:0}:host(.cat-button-pull[size=m]){margin:-0.625rem -0.75rem}:host(.cat-button-pull-h[size=m]){margin-left:-0.75rem;margin-right:-0.75rem}:host(.cat-button-pull-v[size=m]){margin-top:-0.625rem;margin-bottom:-0.625rem}:host(.cat-button-pull-t[size=m]){margin-top:-0.625rem}:host(.cat-button-pull-l[size=m]){margin-left:-0.75rem}:host(.cat-button-pull-b[size=m]){margin-bottom:-0.625rem}:host(.cat-button-pull-r[size=m]){margin-right:-0.75rem}.cat-button-l{min-width:3rem;padding:0.875rem 1rem;font-size:0.9375rem;line-height:1.25rem;gap:0.25rem}.cat-button-l cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-l.cat-button-icon{width:3rem;height:3rem;padding:0}:host(.cat-button-pull[size=l]){margin:-0.875rem -1rem}:host(.cat-button-pull-h[size=l]){margin-left:-1rem;margin-right:-1rem}:host(.cat-button-pull-v[size=l]){margin-top:-0.875rem;margin-bottom:-0.875rem}:host(.cat-button-pull-t[size=l]){margin-top:-0.875rem}:host(.cat-button-pull-l[size=l]){margin-left:-1rem}:host(.cat-button-pull-b[size=l]){margin-bottom:-0.875rem}:host(.cat-button-pull-r[size=l]){margin-right:-1rem}.cat-button-xl{min-width:3.5rem;padding:1rem 1.25rem;font-size:1.125rem;line-height:1.5rem;gap:0.25rem}.cat-button-xl.cat-button-icon{width:3.5rem;height:3.5rem;padding:0}:host(.cat-button-pull[size=xl]){margin:-1rem -1.25rem}:host(.cat-button-pull-h[size=xl]){margin-left:-1.25rem;margin-right:-1.25rem}:host(.cat-button-pull-v[size=xl]){margin-top:-1rem;margin-bottom:-1rem}:host(.cat-button-pull-t[size=xl]){margin-top:-1rem}:host(.cat-button-pull-l[size=xl]){margin-left:-1.25rem}:host(.cat-button-pull-b[size=xl]){margin-bottom:-1rem}:host(.cat-button-pull-r[size=xl]){margin-right:-1.25rem}:host(.cat-tab)::part(button){padding:1.125rem 0.75rem;--cat-secondary-bg:transparent;--cat-primary-text:transparent;--cat-danger-text:transparent}:host(.cat-tab)::part(content)::before{content:attr(data-text);content:attr(data-text)/\"\";height:0;visibility:hidden;overflow:hidden;user-select:none;pointer-events:none;font-weight:700}:host(.cat-text-left) .cat-button{justify-content:left;text-align:left}:host(.cat-text-right) .cat-button{justify-content:right;text-align:right}:host(.cat-nav-item){width:100%}:host(.cat-nav-item) .cat-button{box-shadow:none;justify-content:left;gap:0.5rem}:host(.cat-nav-item) .cat-button:focus-visible{outline-offset:-2px}:host(.cat-time-format) .cat-button{border-radius:0}:host(.cat-date-toggle) .cat-button,:host(.cat-time-toggle) .cat-button{margin-left:-1px;border-top-left-radius:0;border-bottom-left-radius:0}:host(.cat-date-item) .cat-button:hover,:host(.cat-date-toggle) .cat-button:hover,:host(.cat-time-format) .cat-button:hover,:host(.cat-time-toggle) .cat-button:hover{z-index:1}:host(.cat-date-item) .cat-button:focus-visible,:host(.cat-date-toggle) .cat-button:focus-visible,:host(.cat-time-format) .cat-button:focus-visible,:host(.cat-time-toggle) .cat-button:focus-visible{z-index:2}:host(.cat-date-item) .cat-button{padding:0;min-width:2rem;max-height:3rem;aspect-ratio:1}:host(.date-start:not(.date-end)) .cat-button{border-top-right-radius:0;border-bottom-right-radius:0}:host(.date-end:not(.date-start)) .cat-button{border-top-left-radius:0;border-bottom-left-radius:0}";
121
+ /**
122
+ * Find the closest parent element matching the given selector while traversing
123
+ * up the DOM tree (including Shadow DOM).
124
+ */
125
+ function findClosest(selector, element) {
126
+ if (element instanceof Element && element.matches(selector)) {
127
+ return element;
128
+ }
129
+ // Search in parent element or Shadow DOM host
130
+ const nextElement = element instanceof ShadowRoot ? element.host : element.parentElement || element.getRootNode().host;
131
+ return nextElement ? findClosest(selector, nextElement) : null;
132
+ }
133
+
134
+ const catButtonCss = ":host{display:inline-block;max-width:100%;vertical-align:middle;-webkit-user-select:none;-ms-user-select:none;user-select:none;}:host([hidden]){display:none}.cat-button{position:relative;font:inherit;display:flex;align-items:center;justify-content:center;border:none;border-radius:var(--cat-border-radius-m, 0.25rem);text-decoration:none;width:100%;box-sizing:border-box;cursor:pointer;transition:color 125ms linear, border-color 125ms linear, background-color 125ms linear, box-shadow 125ms linear}.cat-button:focus-visible{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.cat-button-content{display:flex;flex-direction:column;min-width:0}.cat-button-empty .cat-button-content{display:none}.cat-button-content-inner{word-wrap:break-word;word-break:break-word}.cat-button-ellipsed .cat-button-content-inner{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.cat-button-disabled{cursor:not-allowed}.cat-button-round{border-radius:10rem}.cat-button-loading{cursor:default}.cat-button-loading cat-spinner{position:absolute}.cat-button-loading>*:not(cat-spinner){visibility:hidden}.cat-group-button-first{border-top-right-radius:0;border-bottom-right-radius:0}.cat-group-button-middle{border-radius:0}.cat-group-button-last{border-top-left-radius:0;border-bottom-left-radius:0}.cat-group-button:hover{z-index:1}.cat-group-button:focus-visible{z-index:2}.cat-button-filled{background-color:rgb(var(--bg));color:rgb(var(--fill));font-weight:var(--cat-font-weight-button, 600);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:greyscale}.cat-button-filled.cat-button-disabled{--bg:242, 244, 247;--fill:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-outlined{background-color:white;box-shadow:inset 0 0 0 1px rgba(var(--base), 0.2);color:rgb(var(--text))}.cat-button-outlined.cat-button-disabled{--base:var(--cat-font-color-muted, 81, 92, 108);--text:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-outlined:hover:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-outlined.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-outlined:active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-text{background-color:transparent;color:rgb(var(--text));text-decoration:var(--cat-link-button-decoration, none)}.cat-button-text.cat-button-disabled{--text:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-text:hover:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-text.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-link{background-color:transparent;color:rgb(var(--text))}.cat-button-link.cat-button-disabled{--text:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-link:hover:not(.cat-button-disabled):not(.cat-button-loading){text-decoration:var(--cat-link-decoration-hover, underline)}.cat-button-link.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading){text-decoration:var(--cat-link-decoration-hover, underline)}.cat-button-primary{--bg:var(--cat-primary-bg, 0, 129, 148);--fill:var(--cat-primary-fill, 255, 255, 255);--text:var(--cat-primary-text, 0, 129, 148);--base:var(--cat-primary-text, 0, 129, 148)}.cat-button-primary:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-primary-bg-hover, 1, 115, 132);--fill:var(--cat-primary-fill-hover, 255, 255, 255);--text:var(--cat-primary-text-hover, 1, 115, 132)}.cat-button-primary.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-primary:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-primary-bg-active, 2, 99, 113);--fill:var(--cat-primary-fill-active, 255, 255, 255);--text:var(--cat-primary-text-active, 2, 99, 113)}.cat-button-secondary{--bg:var(--cat-secondary-bg, 105, 118, 135);--fill:var(--cat-secondary-fill, 255, 255, 255);--text:var(--cat-secondary-text, 0, 0, 0);--base:var(--cat-secondary-bg, 105, 118, 135)}.cat-button-secondary:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-secondary-bg-hover, 105, 118, 135);--fill:var(--cat-secondary-fill-hover, 255, 255, 255);--text:var(--cat-secondary-text-hover, 0, 0, 0)}.cat-button-secondary.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-secondary:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-secondary-bg-active, 105, 118, 135);--fill:var(--cat-secondary-fill-active, 255, 255, 255);--text:var(--cat-secondary-text-active, 0, 0, 0)}.cat-button-info{--bg:var(--cat-info-bg, 0, 115, 230);--fill:var(--cat-info-fill, 255, 255, 255);--text:var(--cat-info-text, 0, 115, 230);--base:var(--cat-info-text, 0, 115, 230)}.cat-button-info:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-info-bg-hover, 0, 107, 227);--fill:var(--cat-info-fill-hover, 255, 255, 255);--text:var(--cat-info-text-hover, 0, 107, 227)}.cat-button-info.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-info:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-info-bg-active, 0, 96, 223);--fill:var(--cat-info-fill-active, 255, 255, 255);--text:var(--cat-info-text-active, 0, 96, 223)}.cat-button-success{--bg:var(--cat-success-bg, 0, 132, 88);--fill:var(--cat-success-fill, 255, 255, 255);--text:var(--cat-success-text, 0, 132, 88);--base:var(--cat-success-text, 0, 132, 88)}.cat-button-success:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-success-bg-hover, 0, 117, 78);--fill:var(--cat-success-fill-hover, 255, 255, 255);--text:var(--cat-success-text-hover, 0, 117, 78)}.cat-button-success.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-success:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-success-bg-active, 0, 105, 70);--fill:var(--cat-success-fill-active, 255, 255, 255);--text:var(--cat-success-text-active, 0, 105, 70)}.cat-button-warning{--bg:var(--cat-warning-bg, 255, 206, 128);--fill:var(--cat-warning-fill, 0, 0, 0);--text:var(--cat-warning-text, 159, 97, 0);--base:var(--cat-warning-text, 159, 97, 0)}.cat-button-warning:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-warning-bg-hover, 255, 214, 148);--fill:var(--cat-warning-fill-hover, 0, 0, 0);--text:var(--cat-warning-text-hover, 159, 97, 0)}.cat-button-warning.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-warning:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-warning-bg-active, 255, 222, 168);--fill:var(--cat-warning-fill-active, 0, 0, 0);--text:var(--cat-warning-text-active, 159, 97, 0)}.cat-button-danger{--bg:var(--cat-danger-bg, 217, 52, 13);--fill:var(--cat-danger-fill, 255, 255, 255);--text:var(--cat-danger-text, 217, 52, 13);--base:var(--cat-danger-text, 217, 52, 13)}.cat-button-danger:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-danger-bg-hover, 194, 46, 11);--fill:var(--cat-danger-fill-hover, 255, 255, 255);--text:var(--cat-danger-text-hover, 194, 46, 11)}.cat-button-danger.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-danger:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-danger-bg-active, 174, 42, 10);--fill:var(--cat-danger-fill-active, 255, 255, 255);--text:var(--cat-danger-text-active, 174, 42, 10)}:host(.cat-button-pull:not([size])){margin:-0.625rem -0.75rem}:host(.cat-button-pull-h:not([size])){margin-left:-0.75rem;margin-right:-0.75rem}:host(.cat-button-pull-v:not([size])){margin-top:-0.625rem;margin-bottom:-0.625rem}:host(.cat-button-pull-t:not([size])){margin-top:-0.625rem}:host(.cat-button-pull-l:not([size])){margin-left:-0.75rem}:host(.cat-button-pull-b:not([size])){margin-bottom:-0.625rem}:host(.cat-button-pull-r:not([size])){margin-right:-0.75rem}.cat-button-xs{min-width:1.5rem;padding:0.1875rem 0.25rem;font-size:0.875rem;line-height:1.125rem;gap:0.25rem}.cat-button-xs.cat-button-icon{width:1.5rem;height:1.5rem;padding:0}:host(.cat-button-pull[size=xs]){margin:-0.1875rem -0.25rem}:host(.cat-button-pull-h[size=xs]){margin-left:-0.25rem;margin-right:-0.25rem}:host(.cat-button-pull-v[size=xs]){margin-top:-0.1875rem;margin-bottom:-0.1875rem}:host(.cat-button-pull-t[size=xs]){margin-top:-0.1875rem}:host(.cat-button-pull-l[size=xs]){margin-left:-0.25rem}:host(.cat-button-pull-b[size=xs]){margin-bottom:-0.1875rem}:host(.cat-button-pull-r[size=xs]){margin-right:-0.25rem}.cat-button-s{min-width:2rem;padding:0.375rem 0.5rem;font-size:0.9375rem;line-height:1.25rem;gap:0.25rem}.cat-button-s cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-s.cat-button-icon{width:2rem;height:2rem;padding:0}:host(.cat-button-pull[size=s]){margin:-0.375rem -0.5rem}:host(.cat-button-pull-h[size=s]){margin-left:-0.5rem;margin-right:-0.5rem}:host(.cat-button-pull-v[size=s]){margin-top:-0.375rem;margin-bottom:-0.375rem}:host(.cat-button-pull-t[size=s]){margin-top:-0.375rem}:host(.cat-button-pull-l[size=s]){margin-left:-0.5rem}:host(.cat-button-pull-b[size=s]){margin-bottom:-0.375rem}:host(.cat-button-pull-r[size=s]){margin-right:-0.5rem}.cat-button-m{min-width:2.5rem;padding:0.625rem 0.75rem;font-size:0.9375rem;line-height:1.25rem;gap:0.25rem}.cat-button-m cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-m.cat-button-icon{width:2.5rem;height:2.5rem;padding:0}:host(.cat-button-pull[size=m]){margin:-0.625rem -0.75rem}:host(.cat-button-pull-h[size=m]){margin-left:-0.75rem;margin-right:-0.75rem}:host(.cat-button-pull-v[size=m]){margin-top:-0.625rem;margin-bottom:-0.625rem}:host(.cat-button-pull-t[size=m]){margin-top:-0.625rem}:host(.cat-button-pull-l[size=m]){margin-left:-0.75rem}:host(.cat-button-pull-b[size=m]){margin-bottom:-0.625rem}:host(.cat-button-pull-r[size=m]){margin-right:-0.75rem}.cat-button-l{min-width:3rem;padding:0.875rem 1rem;font-size:0.9375rem;line-height:1.25rem;gap:0.25rem}.cat-button-l cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-l.cat-button-icon{width:3rem;height:3rem;padding:0}:host(.cat-button-pull[size=l]){margin:-0.875rem -1rem}:host(.cat-button-pull-h[size=l]){margin-left:-1rem;margin-right:-1rem}:host(.cat-button-pull-v[size=l]){margin-top:-0.875rem;margin-bottom:-0.875rem}:host(.cat-button-pull-t[size=l]){margin-top:-0.875rem}:host(.cat-button-pull-l[size=l]){margin-left:-1rem}:host(.cat-button-pull-b[size=l]){margin-bottom:-0.875rem}:host(.cat-button-pull-r[size=l]){margin-right:-1rem}.cat-button-xl{min-width:3.5rem;padding:1rem 1.25rem;font-size:1.125rem;line-height:1.5rem;gap:0.25rem}.cat-button-xl.cat-button-icon{width:3.5rem;height:3.5rem;padding:0}:host(.cat-button-pull[size=xl]){margin:-1rem -1.25rem}:host(.cat-button-pull-h[size=xl]){margin-left:-1.25rem;margin-right:-1.25rem}:host(.cat-button-pull-v[size=xl]){margin-top:-1rem;margin-bottom:-1rem}:host(.cat-button-pull-t[size=xl]){margin-top:-1rem}:host(.cat-button-pull-l[size=xl]){margin-left:-1.25rem}:host(.cat-button-pull-b[size=xl]){margin-bottom:-1rem}:host(.cat-button-pull-r[size=xl]){margin-right:-1.25rem}:host(.cat-tab)::part(button){padding:1.125rem 0.75rem;--cat-secondary-bg:transparent;--cat-primary-text:transparent;--cat-danger-text:transparent}:host(.cat-tab)::part(content)::before{content:attr(data-text);content:attr(data-text)/\"\";height:0;visibility:hidden;overflow:hidden;user-select:none;pointer-events:none;font-weight:700}:host(.cat-text-left) .cat-button{justify-content:left;text-align:left}:host(.cat-text-right) .cat-button{justify-content:right;text-align:right}:host(.cat-nav-item){width:100%}:host(.cat-nav-item) .cat-button{box-shadow:none;justify-content:left;gap:0.5rem}:host(.cat-nav-item) .cat-button:focus-visible{outline-offset:-2px}:host(.cat-time-format) .cat-button{border-radius:0}:host(.cat-date-toggle) .cat-button,:host(.cat-time-toggle) .cat-button{margin-left:-1px;border-top-left-radius:0;border-bottom-left-radius:0}:host(.cat-date-item) .cat-button:hover,:host(.cat-date-toggle) .cat-button:hover,:host(.cat-time-format) .cat-button:hover,:host(.cat-time-toggle) .cat-button:hover{z-index:1}:host(.cat-date-item) .cat-button:focus-visible,:host(.cat-date-toggle) .cat-button:focus-visible,:host(.cat-time-format) .cat-button:focus-visible,:host(.cat-time-toggle) .cat-button:focus-visible{z-index:2}:host(.cat-date-item) .cat-button{padding:0;min-width:2rem;max-height:3rem;aspect-ratio:1}:host(.date-start:not(.date-end)) .cat-button{border-top-right-radius:0;border-bottom-right-radius:0}:host(.date-end:not(.date-start)) .cat-button{border-top-left-radius:0;border-bottom-left-radius:0}";
122
135
  const CatButtonStyle0 = catButtonCss;
123
136
 
124
137
  const CatButton = /*@__PURE__*/ proxyCustomElement(class CatButton extends HTMLElement {
@@ -130,6 +143,7 @@ const CatButton = /*@__PURE__*/ proxyCustomElement(class CatButton extends HTMLE
130
143
  this.catFocus = createEvent(this, "catFocus", 7);
131
144
  this.catBlur = createEvent(this, "catBlur", 7);
132
145
  this._iconOnly = true;
146
+ this.hasSlottedContent = false;
133
147
  this.variant = 'outlined';
134
148
  this.color = 'secondary';
135
149
  this.active = false;
@@ -174,11 +188,18 @@ const CatButton = /*@__PURE__*/ proxyCustomElement(class CatButton extends HTMLE
174
188
  componentWillLoad() {
175
189
  this.onIconOnlyChanged(this.iconOnly);
176
190
  }
191
+ componentWillRender() {
192
+ this.hasSlottedContent = this.hostElement.hasChildNodes();
193
+ }
177
194
  haltDisabledEvents(event) {
178
195
  if (this.disabled || this.loading) {
179
196
  event.preventDefault();
180
197
  event.stopImmediatePropagation();
181
198
  }
199
+ else if (this.submit) {
200
+ const form = findClosest('form', this.hostElement);
201
+ form?.dispatchEvent(new SubmitEvent('submit', { submitter: this.button }));
202
+ }
182
203
  }
183
204
  /**
184
205
  * Programmatically move focus to the button. Use this method instead of
@@ -207,6 +228,7 @@ const CatButton = /*@__PURE__*/ proxyCustomElement(class CatButton extends HTMLE
207
228
  if (this.url) {
208
229
  return (h("a", { ...this.nativeAttributes, ref: el => (this.button = el), href: this.disabled ? undefined : this.url, target: this.urlTarget, "aria-disabled": this.disabled ? 'true' : null, "aria-label": this.a11yLabel, "aria-current": this.a11yCurrent, id: this.buttonId, part: "button", class: {
209
230
  'cat-button': true,
231
+ 'cat-button-empty': !this.hasSlottedContent,
210
232
  'cat-button-active': this.active,
211
233
  'cat-button-icon': this.isIconButton,
212
234
  'cat-button-round': this.round,
@@ -221,6 +243,7 @@ const CatButton = /*@__PURE__*/ proxyCustomElement(class CatButton extends HTMLE
221
243
  else {
222
244
  return (h("button", { ...this.nativeAttributes, ref: el => (this.button = el), type: this.submit ? 'submit' : 'button', name: this.name, value: this.value, disabled: this.disabled, "aria-disabled": this.disabled ? 'true' : null, "aria-label": this.a11yLabel, "aria-current": this.a11yCurrent, id: this.buttonId, part: "button", class: {
223
245
  'cat-button': true,
246
+ 'cat-button-empty': !this.hasSlottedContent,
224
247
  'cat-button-active': this.active,
225
248
  'cat-button-icon': this.isIconButton,
226
249
  'cat-button-round': this.round ?? this.isIconButton,
@@ -277,6 +300,7 @@ const CatButton = /*@__PURE__*/ proxyCustomElement(class CatButton extends HTMLE
277
300
  onBlur(event) {
278
301
  this.catBlur.emit(event);
279
302
  }
303
+ get hostElement() { return this; }
280
304
  static get watchers() { return {
281
305
  "iconOnly": ["onIconOnlyChanged"]
282
306
  }; }
@@ -305,6 +329,7 @@ const CatButton = /*@__PURE__*/ proxyCustomElement(class CatButton extends HTMLE
305
329
  "nativeContentAttributes": [16],
306
330
  "buttonGroupPosition": [1, "button-group-position"],
307
331
  "_iconOnly": [32],
332
+ "hasSlottedContent": [32],
308
333
  "doFocus": [64],
309
334
  "doBlur": [64],
310
335
  "doClick": [64]
@@ -335,6 +360,6 @@ function defineCustomElement() {
335
360
  } });
336
361
  }
337
362
 
338
- export { CatButton as C, defineCustomElement as d };
363
+ export { CatButton as C, defineCustomElement as d, findClosest as f };
339
364
 
340
365
  //# sourceMappingURL=cat-button2.js.map