@haiilo/catalyst 10.5.0 → 10.7.1

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 (75) hide show
  1. package/dist/catalyst/catalyst.css +2 -2
  2. package/dist/catalyst/catalyst.esm.js +1 -1
  3. package/dist/catalyst/catalyst.esm.js.map +1 -1
  4. package/dist/catalyst/index.esm.js +1 -1
  5. package/dist/catalyst/{p-54544546.js → p-2c8ac8cf.js} +1 -1
  6. package/dist/catalyst/p-2c8ac8cf.js.map +1 -0
  7. package/dist/catalyst/p-8b22b7fc.entry.js +10 -0
  8. package/dist/catalyst/p-8b22b7fc.entry.js.map +1 -0
  9. package/dist/catalyst/scss/_variables.scss +0 -1
  10. package/dist/catalyst/scss/core/_form.scss +2 -2
  11. package/dist/cjs/cat-alert_29.cjs.entry.js +133 -56
  12. package/dist/cjs/cat-alert_29.cjs.entry.js.map +1 -1
  13. package/dist/cjs/catalyst.cjs.js +1 -1
  14. package/dist/cjs/index.cjs.js +1 -1
  15. package/dist/cjs/loader.cjs.js +1 -1
  16. package/dist/cjs/{of-8163b41f.js → of-f2844da8.js} +2 -2
  17. package/dist/cjs/of-f2844da8.js.map +1 -0
  18. package/dist/collection/components/cat-checkbox/cat-checkbox.css +2 -1
  19. package/dist/collection/components/cat-date/cat-date.js +41 -1
  20. package/dist/collection/components/cat-date/cat-date.js.map +1 -1
  21. package/dist/collection/components/cat-date-inline/cat-date-inline.js +9 -8
  22. package/dist/collection/components/cat-date-inline/cat-date-inline.js.map +1 -1
  23. package/dist/collection/components/cat-dropdown/cat-dropdown.js +25 -2
  24. package/dist/collection/components/cat-dropdown/cat-dropdown.js.map +1 -1
  25. package/dist/collection/components/cat-radio/cat-radio.css +1 -1
  26. package/dist/collection/components/cat-select/cat-select.js +5 -5
  27. package/dist/collection/components/cat-time/cat-time-locale.js +3 -0
  28. package/dist/collection/components/cat-time/cat-time-locale.js.map +1 -1
  29. package/dist/collection/components/cat-time/cat-time.js +36 -8
  30. package/dist/collection/components/cat-time/cat-time.js.map +1 -1
  31. package/dist/collection/components/cat-toggle/cat-toggle.css +1 -1
  32. package/dist/collection/scss/_variables.scss +0 -1
  33. package/dist/collection/scss/core/_form.scss +2 -2
  34. package/dist/components/cat-checkbox2.js +1 -1
  35. package/dist/components/cat-checkbox2.js.map +1 -1
  36. package/dist/components/cat-date-inline2.js +9 -8
  37. package/dist/components/cat-date-inline2.js.map +1 -1
  38. package/dist/components/cat-date.js +39 -1
  39. package/dist/components/cat-date.js.map +1 -1
  40. package/dist/components/cat-dropdown2.js +8 -2
  41. package/dist/components/cat-dropdown2.js.map +1 -1
  42. package/dist/components/cat-radio.js +1 -1
  43. package/dist/components/cat-radio.js.map +1 -1
  44. package/dist/components/cat-scrollable2.js +5 -3
  45. package/dist/components/cat-scrollable2.js.map +1 -1
  46. package/dist/components/cat-select-demo.js +2 -2
  47. package/dist/components/cat-select-demo.js.map +1 -1
  48. package/dist/components/cat-select2.js.map +1 -1
  49. package/dist/components/cat-time.js +37 -8
  50. package/dist/components/cat-time.js.map +1 -1
  51. package/dist/components/cat-toggle.js +1 -1
  52. package/dist/components/cat-toggle.js.map +1 -1
  53. package/dist/components/floating-ui.dom.esm.js +38 -30
  54. package/dist/components/floating-ui.dom.esm.js.map +1 -1
  55. package/dist/components/from.js +1 -1
  56. package/dist/components/from.js.map +1 -1
  57. package/dist/components/of.js.map +1 -1
  58. package/dist/esm/cat-alert_29.entry.js +133 -56
  59. package/dist/esm/cat-alert_29.entry.js.map +1 -1
  60. package/dist/esm/catalyst.js +1 -1
  61. package/dist/esm/index.js +2 -2
  62. package/dist/esm/loader.js +1 -1
  63. package/dist/esm/{of-f4b9a3ca.js → of-53334b95.js} +2 -2
  64. package/dist/esm/of-53334b95.js.map +1 -0
  65. package/dist/types/components/cat-date/cat-date.d.ts +3 -0
  66. package/dist/types/components/cat-dropdown/cat-dropdown.d.ts +5 -0
  67. package/dist/types/components/cat-time/cat-time-locale.d.ts +1 -0
  68. package/dist/types/components/cat-time/cat-time.d.ts +3 -1
  69. package/dist/types/components.d.ts +8 -0
  70. package/package.json +2 -2
  71. package/dist/catalyst/p-54544546.js.map +0 -1
  72. package/dist/catalyst/p-66b41008.entry.js +0 -10
  73. package/dist/catalyst/p-66b41008.entry.js.map +0 -1
  74. package/dist/cjs/of-8163b41f.js.map +0 -1
  75. package/dist/esm/of-f4b9a3ca.js.map +0 -1
@@ -19,7 +19,6 @@ $cat-font-color-mono: rgb(var(--cat-font-color-mono));
19
19
 
20
20
  $cat-head-margin-bottom: 1rem;
21
21
  $cat-body-margin-bottom: 2rem;
22
- $cat-form-margin-bottom: 1.5rem;
23
22
  $cat-nav-padding-horizontal: 0.75rem;
24
23
 
25
24
  // --------
@@ -15,11 +15,11 @@
15
15
  cat-date,
16
16
  cat-time
17
17
  ):not(:last-child) {
18
- margin-bottom: calc($cat-form-margin-bottom * var(--cat-form-spacer, 1));
18
+ margin-bottom: calc(1rem * var(--cat-form-spacer, 1));
19
19
  }
20
20
 
21
21
  cat-radio:not(:last-child) {
22
- margin-bottom: 0.5rem;
22
+ margin-bottom: 0.75rem;
23
23
  }
24
24
  }
25
25
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-13aff0b4.js');
6
- const of = require('./of-8163b41f.js');
6
+ const of = require('./of-f2844da8.js');
7
7
 
8
8
  const ObjectUnsubscribedError = of.createErrorClass((_super) => function ObjectUnsubscribedErrorImpl() {
9
9
  _super(this);
@@ -179,6 +179,7 @@ class AsyncAction extends Action {
179
179
  this.pending = false;
180
180
  }
181
181
  schedule(state, delay = 0) {
182
+ var _a;
182
183
  if (this.closed) {
183
184
  return this;
184
185
  }
@@ -190,7 +191,7 @@ class AsyncAction extends Action {
190
191
  }
191
192
  this.pending = true;
192
193
  this.delay = delay;
193
- this.id = this.id || this.requestAsyncId(scheduler, this.id, delay);
194
+ this.id = (_a = this.id) !== null && _a !== void 0 ? _a : this.requestAsyncId(scheduler, this.id, delay);
194
195
  return this;
195
196
  }
196
197
  requestAsyncId(scheduler, _id, delay = 0) {
@@ -200,7 +201,9 @@ class AsyncAction extends Action {
200
201
  if (delay != null && this.delay === delay && this.pending === false) {
201
202
  return id;
202
203
  }
203
- intervalProvider.clearInterval(id);
204
+ if (id != null) {
205
+ intervalProvider.clearInterval(id);
206
+ }
204
207
  return undefined;
205
208
  }
206
209
  execute(state, delay) {
@@ -263,7 +266,6 @@ class AsyncScheduler extends Scheduler {
263
266
  super(SchedulerAction, now);
264
267
  this.actions = [];
265
268
  this._active = false;
266
- this._scheduled = undefined;
267
269
  }
268
270
  flush(action) {
269
271
  const { actions } = this;
@@ -653,7 +655,7 @@ function delayWhen(delayDurationSelector, subscriptionDelay) {
653
655
  if (subscriptionDelay) {
654
656
  return (source) => concat(subscriptionDelay.pipe(take(1), ignoreElements()), source.pipe(delayWhen(delayDurationSelector)));
655
657
  }
656
- return mergeMap((value, index) => delayDurationSelector(value, index).pipe(take(1), mapTo(value)));
658
+ return mergeMap((value, index) => of.innerFrom(delayDurationSelector(value, index)).pipe(take(1), mapTo(value)));
657
659
  }
658
660
 
659
661
  function delay$1(due, scheduler = asyncScheduler) {
@@ -1265,7 +1267,7 @@ const CatFormHint = props => {
1265
1267
  ]));
1266
1268
  };
1267
1269
 
1268
- const catCheckboxCss = ".hint-wrapper{flex:0 1 auto;display:flex;gap:0.5rem}.hint-section{flex:1 1 auto;display:flex;flex-direction:column;gap:0.25rem;color:rgb(var(--cat-font-color-muted, 81, 92, 108));font-size:0.875rem;line-height:1.125rem}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){margin:0 !important}:host{display:flex;flex-direction:column;gap:0.5rem}:host([hidden]){display:none}label{flex:0 1 auto;display:flex;gap:0.5rem;font-size:0.9375rem;line-height:1.25rem;font-weight:var(--cat-font-weight-body, 400);-webkit-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;position:relative}.label-left{flex-direction:row-reverse}.label-left input{right:1px;left:unset}input{position:absolute;width:1.25rem;height:1.25rem;margin:0;opacity:0;cursor:inherit;left:1px;top:0.5px}.box-placeholder{width:calc(1.25rem + 2px);flex-shrink:0}.box{flex:0 0 auto;display:flex;position:relative;height:1.25rem;width:1.25rem;background-color:white;border:1px solid rgb(var(--cat-border-color-dark, 215, 219, 224));border-radius:var(--cat-border-radius-s, 0.125rem);transition:background-color 125ms ease, border-color 125ms ease;pointer-events:none}.box svg{fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:16px;stroke-dashoffset:16px;transition:all 125ms ease;width:50%;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%) scale(0.99)}:checked+.box{background-color:rgb(var(--cat-primary-bg, 0, 129, 148));border-color:rgb(var(--cat-primary-bg, 0, 129, 148));stroke:rgb(var(--cat-primary-fill, 255, 255, 255))}:checked+.box .check{stroke-dashoffset:0}:indeterminate+.box{background-color:rgb(var(--cat-primary-bg, 0, 129, 148));border-color:rgb(var(--cat-primary-bg, 0, 129, 148));stroke:rgb(var(--cat-primary-fill, 255, 255, 255))}:indeterminate+.box .check{stroke-dashoffset:16px}:indeterminate+.box .dash{stroke-dashoffset:0}:focus-visible+.box{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.is-disabled .box{background-color:#f2f4f7;border-color:rgb(var(--cat-border-color-dark, 215, 219, 224));stroke:rgb(var(--cat-font-color-muted, 81, 92, 108))}:host(.cat-error) .box{border:1px solid rgb(var(--cat-danger-bg, 217, 52, 13))}:host(.cat-error) :checked+.box,:host(.cat-error) :indeterminate+.box{background-color:rgb(var(--cat-danger-bg, 217, 52, 13));border-color:rgb(var(--cat-danger-bg, 217, 52, 13));stroke:rgb(var(--cat-danger-fill, 255, 255, 255))}.label{flex:1 1 auto;min-width:0}.is-hidden .label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.is-disabled{cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 81, 92, 108))}";
1270
+ const catCheckboxCss = ".hint-wrapper{flex:0 1 auto;display:flex;gap:0.5rem}.hint-section{flex:1 1 auto;display:flex;flex-direction:column;gap:0.25rem;color:rgb(var(--cat-font-color-muted, 81, 92, 108));font-size:0.875rem;line-height:1.125rem}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){margin:0 !important}:host{display:flex;flex-direction:column;gap:0.25rem}:host([hidden]){display:none}label{flex:0 1 auto;display:flex;gap:0.5rem;font-size:0.9375rem;line-height:1.25rem;font-weight:var(--cat-font-weight-body, 400);-webkit-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;position:relative}.label-left{flex-direction:row-reverse}.label-left input{right:1px;left:unset}input{position:absolute;width:1.25rem;height:1.25rem;margin:0;opacity:0;cursor:inherit;left:1px;top:0.5px}.box-placeholder{width:calc(1.25rem + 2px);flex-shrink:0}.box{flex:0 0 auto;display:flex;position:relative;height:1.25rem;width:1.25rem;background-color:white;border:1px solid rgb(var(--cat-border-color-dark, 215, 219, 224));border-radius:var(--cat-border-radius-s, 0.125rem);transition:background-color 125ms ease, border-color 125ms ease;pointer-events:none;box-sizing:border-box}.box svg{fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:16px;stroke-dashoffset:16px;transition:all 125ms ease;width:50%;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%) scale(0.99)}:checked+.box{background-color:rgb(var(--cat-primary-bg, 0, 129, 148));border-color:rgb(var(--cat-primary-bg, 0, 129, 148));stroke:rgb(var(--cat-primary-fill, 255, 255, 255))}:checked+.box .check{stroke-dashoffset:0}:indeterminate+.box{background-color:rgb(var(--cat-primary-bg, 0, 129, 148));border-color:rgb(var(--cat-primary-bg, 0, 129, 148));stroke:rgb(var(--cat-primary-fill, 255, 255, 255))}:indeterminate+.box .check{stroke-dashoffset:16px}:indeterminate+.box .dash{stroke-dashoffset:0}:focus-visible+.box{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.is-disabled .box{background-color:#f2f4f7;border-color:rgb(var(--cat-border-color-dark, 215, 219, 224));stroke:rgb(var(--cat-font-color-muted, 81, 92, 108))}:host(.cat-error) .box{border:1px solid rgb(var(--cat-danger-bg, 217, 52, 13))}:host(.cat-error) :checked+.box,:host(.cat-error) :indeterminate+.box{background-color:rgb(var(--cat-danger-bg, 217, 52, 13));border-color:rgb(var(--cat-danger-bg, 217, 52, 13));stroke:rgb(var(--cat-danger-fill, 255, 255, 255))}.label{flex:1 1 auto;min-width:0}.is-hidden .label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.is-disabled{cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 81, 92, 108))}";
1269
1271
  const CatCheckboxStyle0 = catCheckboxCss;
1270
1272
 
1271
1273
  let nextUniqueId$8 = 0;
@@ -1488,6 +1490,16 @@ const CatDate = class {
1488
1490
  this.nativeAttributes = undefined;
1489
1491
  this.placement = 'bottom-end';
1490
1492
  }
1493
+ onMinChanged(min, oldMin) {
1494
+ if (min !== oldMin) {
1495
+ this.reclamp('min', min);
1496
+ }
1497
+ }
1498
+ onMaxChanged(max, oldMax) {
1499
+ if (max !== oldMax) {
1500
+ this.reclamp('max', max);
1501
+ }
1502
+ }
1491
1503
  get inputValue() {
1492
1504
  const [match, year, month, day] = this.value?.match(/^(\d{4})-(\d{2})-(\d{2})/) ?? [];
1493
1505
  if (match) {
@@ -1536,7 +1548,13 @@ const CatDate = class {
1536
1548
  this.input?.clear();
1537
1549
  }
1538
1550
  render() {
1539
- return (index.h(index.Host, { key: '6f8ed88396eb9932a91f26e1f32086a573f82add' }, index.h("cat-input", { key: 'e73ec2bceb1cd648e14d8917ebf7fb6c99079408', class: "cat-date-input", ref: el => (this.input = el), requiredMarker: this.requiredMarker, horizontal: this.horizontal, autoComplete: this.autoComplete, clearable: this.clearable, disabled: this.disabled, hint: this.hint, icon: this.icon, iconRight: this.iconRight, identifier: this.identifier, labelHidden: this.labelHidden, name: this.name, placeholder: this.placeholder, textPrefix: this.textPrefix, textSuffix: this.textSuffix, readonly: this.readonly, required: this.required, errors: this.errors, errorUpdate: this.errorUpdate, nativeAttributes: this.nativeAttributes, value: this.inputValue, onCatFocus: e => this.catFocus.emit(e.detail), onCatBlur: e => this.onInputBlur(e.detail) }, index.h("span", { key: '8fb02c395b64728db2a2f5d4896e3151b3dc5aec', slot: "label" }, this.label, index.h("span", { key: 'f08e83d369b1f35d45fb4c0b2c39a9ad52b68b77', class: "label-aria" }, " (", this.locale.formatStr, ")")), index.h("cat-dropdown", { key: '48ee8472fab9d59b511df69afbbc348aa7b04828', slot: "addon", placement: this.placement, arrowNavigation: "none", noResize: true, onCatOpen: () => this.dateInline?.resetView() }, index.h("cat-button", { key: 'b12ea88e170c2c8d916e9553b0bb205fae5e5d45', slot: "trigger", icon: "$cat:datepicker-calendar", iconOnly: true, class: "cat-date-toggle", disabled: this.disabled, a11yLabel: this.getTriggerA11yLabel() }), index.h("div", { key: '9173b680adcf83c32a7c10e818acbab188cfd979', slot: "content" }, index.h("cat-date-inline", { key: '997bc3bb5137d860893732234442feda61cd3d21', ref: el => (this.dateInline = el), min: this.min, max: this.max, value: this.value, noClear: true, onCatChange: this.onDateChange.bind(this) }))))));
1551
+ return (index.h(index.Host, { key: 'd588c96f031fc8ab9518d13dfaac730a0d424caa' }, index.h("cat-input", { key: 'f49f0682e2f2fe3dfcd89477bda91fe46ed44dfa', class: "cat-date-input", ref: el => (this.input = el), requiredMarker: this.requiredMarker, horizontal: this.horizontal, autoComplete: this.autoComplete, clearable: this.clearable, disabled: this.disabled, hint: this.hint, icon: this.icon, iconRight: this.iconRight, identifier: this.identifier, labelHidden: this.labelHidden, name: this.name, placeholder: this.placeholder, textPrefix: this.textPrefix, textSuffix: this.textSuffix, readonly: this.readonly, required: this.required, errors: this.errors, errorUpdate: this.errorUpdate, nativeAttributes: this.nativeAttributes, value: this.inputValue, onCatFocus: e => {
1552
+ e.stopPropagation();
1553
+ this.catFocus.emit(e.detail);
1554
+ }, onCatBlur: e => {
1555
+ e.stopPropagation();
1556
+ this.onInputBlur(e.detail);
1557
+ } }, index.h("span", { key: '68ef0708d25128b9a52d60c5b1a7b34e0ffb2ef1', slot: "label" }, this.label, index.h("span", { key: 'ac017335567a4e0059631e7535455d52f61f2e43', class: "label-aria" }, " (", this.locale.formatStr, ")")), index.h("cat-dropdown", { key: '16a6e95f6e4f6a9b0ddd7716f0b713c8fac3fdff', slot: "addon", placement: this.placement, arrowNavigation: "none", noResize: true, onCatOpen: () => this.dateInline?.resetView() }, index.h("cat-button", { key: 'cf7f2aaa2c5775b23f3e8826e9b0e722c4ce8be6', slot: "trigger", icon: "$cat:datepicker-calendar", iconOnly: true, class: "cat-date-toggle", disabled: this.disabled, a11yLabel: this.getTriggerA11yLabel() }), index.h("div", { key: 'f90eef976a3102855801df5ffeee770d45e7eaba', slot: "content" }, index.h("cat-date-inline", { key: '853b3adee0ea8f9c9b2a1276a10fcaa299044b42', ref: el => (this.dateInline = el), min: this.min, max: this.max, value: this.value, noClear: true, onCatChange: this.onDateChange.bind(this) }))))));
1540
1558
  }
1541
1559
  getTriggerA11yLabel() {
1542
1560
  const date = this.locale.fromLocalISO(this.value);
@@ -1565,6 +1583,7 @@ const CatDate = class {
1565
1583
  this.catBlur.emit(e);
1566
1584
  }
1567
1585
  onDateChange(e) {
1586
+ e.stopPropagation();
1568
1587
  const oldValue = this.value;
1569
1588
  const date = e.detail ? new Date(e.detail) : null;
1570
1589
  this.value = date ? this.locale.toLocalISO(date) : undefined;
@@ -1587,7 +1606,25 @@ const CatDate = class {
1587
1606
  }
1588
1607
  return new Date(year, month - 1, day);
1589
1608
  }
1609
+ reclamp(mode, limit) {
1610
+ const oldValue = this.value;
1611
+ const oldDate = this.locale.fromLocalISO(oldValue);
1612
+ const limitDate = this.locale.fromLocalISO(limit);
1613
+ if (!oldDate || !limitDate) {
1614
+ return;
1615
+ }
1616
+ const newDate = clampDate(mode === 'min' ? limitDate : null, oldDate, mode === 'max' ? limitDate : null);
1617
+ const newValue = this.locale.toLocalISO(newDate);
1618
+ if (oldValue !== newValue) {
1619
+ this.value = newValue;
1620
+ this.catChange.emit(newValue);
1621
+ }
1622
+ }
1590
1623
  get hostElement() { return index.getElement(this); }
1624
+ static get watchers() { return {
1625
+ "min": ["onMinChanged"],
1626
+ "max": ["onMaxChanged"]
1627
+ }; }
1591
1628
  };
1592
1629
  CatDate.style = CatDateStyle0;
1593
1630
 
@@ -1620,18 +1657,19 @@ const CatDateInline = class {
1620
1657
  return all ? new Date(Number(year), Number(month) - 1, Number(day)) : null;
1621
1658
  }
1622
1659
  componentWillLoad() {
1623
- // select the initial value
1624
1660
  const [startDate, endDate] = this.getValue();
1625
- this.select(startDate);
1626
- if (this.range && endDate) {
1627
- this.select(endDate);
1661
+ if (endDate) {
1662
+ this.focus(endDate);
1663
+ }
1664
+ else if (startDate) {
1665
+ this.focus(startDate);
1628
1666
  }
1629
1667
  }
1630
1668
  componentDidRender() {
1631
1669
  if (this.focusDate) {
1632
1670
  // re-focus the previously focused date after re-render
1633
1671
  this.hostElement.shadowRoot
1634
- ?.querySelector(`[data-date="${this.locale.toLocalStr(this.focusDate)}"]`)
1672
+ ?.querySelector(`[data-date="${this.locale.toLocalISO(this.focusDate)}"]`)
1635
1673
  ?.doFocus();
1636
1674
  this.focusDate = null;
1637
1675
  }
@@ -1714,9 +1752,9 @@ const CatDateInline = class {
1714
1752
  const [minDate, maxDate] = this.getMinMaxDate();
1715
1753
  const dateGrid = this.dateGrid(this.viewDate.getFullYear(), this.viewDate.getMonth());
1716
1754
  const [dateStart, dateEnd] = this.getValue();
1717
- return (index.h(index.Host, { key: '2b21e43ebc9a69988b475f2eae1eb2f2aeee97cb' }, index.h("div", { key: '3f256483614d09440bee07be4e8996bc1c187d2b', class: { picker: true, 'picker-small': this.size === 's', 'picker-weeks': !this.noWeeks } }, index.h("div", { key: 'c9d82a518d78439164e99240fa13afabcc81e267', class: "picker-head" }, index.h("cat-button", { key: 'bcc803acb0ac2d7947fa53615ca105d77063e9f9', icon: "$cat:datepicker-year-prev", iconOnly: true, size: "xs", variant: "text", "a11y-label": this.locale.prevYear, disabled: isSameYear(this.viewDate, minDate), onClick: () => this.navigate('prev', 'year'), "data-dropdown-no-close": true }), index.h("cat-button", { key: '3626bbe3e1a79c08d7a6257cb78ce398ceb1b750', icon: "$cat:datepicker-month-prev", iconOnly: true, size: "xs", variant: "text", "a11y-label": this.locale.prevMonth, disabled: isSameMonth(this.viewDate, minDate), onClick: () => this.navigate('prev', 'month'), "data-dropdown-no-close": true }), index.h("h3", { key: '92462a6702792afd573c91f0c12e2bae599378ae' }, this.getHeadline()), index.h("cat-button", { key: '4ce63e1451b820098feea0ff2f45d9b7d0b5cc28', icon: "$cat:datepicker-month-next", iconOnly: true, size: "xs", variant: "text", "a11y-label": this.locale.nextMonth, disabled: isSameMonth(this.viewDate, maxDate), onClick: () => this.navigate('next', 'month'), "data-dropdown-no-close": true }), index.h("cat-button", { key: '97adedac70ce8f19ba0725ca6a1bb836a1d8c0c3', icon: "$cat:datepicker-year-next", iconOnly: true, size: "xs", variant: "text", "a11y-label": this.locale.nextYear, disabled: isSameYear(this.viewDate, maxDate), onClick: () => this.navigate('next', 'year'), "data-dropdown-no-close": true })), index.h("div", { key: '9bbc58c07f911e928cd231a784604abada3698ea', class: "picker-grid", onFocusin: () => this.setAriaLive(this.locale.arrowKeys) }, index.h("div", { key: '2eff946487bfdbce49521b513d6065bd42c78ac0', class: "picker-grid-head" }, Array.from(Array(7), (_, i) => (index.h("abbr", { title: this.locale.days.long[i] }, this.locale.days.short[i])))), !this.noWeeks && (index.h("div", { class: "picker-grid-weeks" }, dateGrid
1755
+ return (index.h(index.Host, { key: 'a7d905c8e87ff74d81dfc74af7ba373297e236f0' }, index.h("div", { key: '1da4117e24b346e7c8b0fb02bee21cf4ab0b4811', class: { picker: true, 'picker-small': this.size === 's', 'picker-weeks': !this.noWeeks } }, index.h("div", { key: 'fc0b889a89e79962ae83e871678b8994b110df26', class: "picker-head" }, index.h("cat-button", { key: '6a12fb84c1047342bed4c27919bb3e5581c628ef', icon: "$cat:datepicker-year-prev", iconOnly: true, size: "xs", variant: "text", "a11y-label": this.locale.prevYear, disabled: isSameYear(this.viewDate, minDate), onClick: () => this.navigate('prev', 'year'), "data-dropdown-no-close": true }), index.h("cat-button", { key: '40d96782ca7d4f2c6ea2e4fbc7ebe51a2c8c1eba', icon: "$cat:datepicker-month-prev", iconOnly: true, size: "xs", variant: "text", "a11y-label": this.locale.prevMonth, disabled: isSameMonth(this.viewDate, minDate), onClick: () => this.navigate('prev', 'month'), "data-dropdown-no-close": true }), index.h("h3", { key: 'd40d0418bee1337559939c56ef22dcdfbf9afa3d' }, this.getHeadline()), index.h("cat-button", { key: '1265b3ee5423afef7006ed9e590c42fec5a461c0', icon: "$cat:datepicker-month-next", iconOnly: true, size: "xs", variant: "text", "a11y-label": this.locale.nextMonth, disabled: isSameMonth(this.viewDate, maxDate), onClick: () => this.navigate('next', 'month'), "data-dropdown-no-close": true }), index.h("cat-button", { key: 'a0872674a56e6b9a48206d9bd05f669dc2b720f2', icon: "$cat:datepicker-year-next", iconOnly: true, size: "xs", variant: "text", "a11y-label": this.locale.nextYear, disabled: isSameYear(this.viewDate, maxDate), onClick: () => this.navigate('next', 'year'), "data-dropdown-no-close": true })), index.h("div", { key: 'a2f5d372f4693bfbd95c305add8a5ae9d2b93016', class: "picker-grid", onFocusin: () => this.setAriaLive(this.locale.arrowKeys) }, index.h("div", { key: '8ce7da396804f56ffbddeca8f106ed7bcdd0a82c', class: "picker-grid-head" }, Array.from(Array(7), (_, i) => (index.h("abbr", { title: this.locale.days.long[i] }, this.locale.days.short[i])))), !this.noWeeks && (index.h("div", { class: "picker-grid-weeks" }, dateGrid
1718
1756
  .filter((_, i) => i % 7 === 0)
1719
- .map(day => (index.h("div", null, this.getWeekNumber(day)))))), index.h("div", { key: '48f7b239e8ccb0d56b4f7c80d8892b79c2908990', class: "picker-grid-days" }, dateGrid.map(day => {
1757
+ .map(day => (index.h("div", null, this.getWeekNumber(day)))))), index.h("div", { key: '94446fe590c51c48b73e6d482a3f1d4d4fb03a82', class: "picker-grid-days" }, dateGrid.map(day => {
1720
1758
  const isStartDate = isSameDay(dateStart, day);
1721
1759
  const isEndDate = isSameDay(dateEnd, day);
1722
1760
  const isRange = !!dateStart && !!dateEnd && day > dateStart && day < dateEnd;
@@ -1731,7 +1769,7 @@ const CatDateInline = class {
1731
1769
  'date-focusable': this.canFocus(day),
1732
1770
  'date-disabled': !this.canClick(day)
1733
1771
  }, size: this.size, nativeAttributes: !this.canFocus(day) ? { tabindex: '-1' } : {}, variant: isStartDate || isEndDate ? 'filled' : isToday ? 'outlined' : 'text', a11yLabel: this.locale.toLocalStr(day), active: isStartDate || isEndDate || isRange, color: isStartDate || isEndDate || isToday ? 'primary' : 'secondary', disabled: !this.canClick(day), onClick: () => this.select(day), "data-date": this.locale.toLocalISO(day) }, day.getDate()));
1734
- }))), index.h("div", { key: 'e6c30b78568d92d3a17936fdff4c7fec1ac4965f', class: "picker-foot" }, !this.noToday && this.canClick(this.locale.now()) && (index.h("cat-button", { size: "s", "data-dropdown-no-close": true, onClick: () => this.select(this.locale.now()) }, this.locale.today)), !this.noHint && index.h("p", { class: "cursor-help" }, this.locale.arrowKeys), !this.noClear && (index.h("cat-button", { size: "s", disabled: !this.value, "data-dropdown-no-close": true, onClick: () => this.clear() }, this.locale.clear)))), index.h("p", { key: 'e31cabf38ed3545ddd4acc32c2540eb5706bc17c', class: "cursor-aria", "aria-live": "polite" })));
1772
+ }))), index.h("div", { key: '2c3386a794b6ebdfb644a41e892448fd454d7aaa', class: "picker-foot" }, !this.noToday && this.canClick(this.locale.now()) && (index.h("cat-button", { size: "s", "data-dropdown-no-close": true, onClick: () => this.select(this.locale.now()) }, this.locale.today)), !this.noHint && index.h("p", { class: "cursor-help" }, this.locale.arrowKeys), !this.noClear && (index.h("cat-button", { size: "s", disabled: !this.value, "data-dropdown-no-close": true, onClick: () => this.clear() }, this.locale.clear)))), index.h("p", { key: '6193ca5ae8ff21d847a377ad7c269f22bc52d9a8', class: "cursor-aria", "aria-live": "polite" })));
1735
1773
  }
1736
1774
  focus(date) {
1737
1775
  const [minDate, maxDate] = this.getMinMaxDate();
@@ -4633,8 +4671,18 @@ function getLocale$1(language) {
4633
4671
  };
4634
4672
  }
4635
4673
 
4636
- const min$1 = Math.min;
4637
- const max$1 = Math.max;
4674
+ /**
4675
+ * Custom positioning reference element.
4676
+ * @see https://floating-ui.com/docs/virtual-elements
4677
+ */
4678
+ const min = Math.min;
4679
+ const max = Math.max;
4680
+ const round = Math.round;
4681
+ const floor = Math.floor;
4682
+ const createCoords = v => ({
4683
+ x: v,
4684
+ y: v
4685
+ });
4638
4686
  const oppositeSideMap = {
4639
4687
  left: 'right',
4640
4688
  right: 'left',
@@ -4646,7 +4694,7 @@ const oppositeAlignmentMap = {
4646
4694
  end: 'start'
4647
4695
  };
4648
4696
  function clamp(start, value, end) {
4649
- return max$1(start, min$1(value, end));
4697
+ return max(start, min(value, end));
4650
4698
  }
4651
4699
  function evaluate(value, param) {
4652
4700
  return typeof value === 'function' ? value(param) : value;
@@ -4805,7 +4853,7 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
4805
4853
 
4806
4854
  /**
4807
4855
  * Computes the `x` and `y` coordinates that will place the floating element
4808
- * next to a reference element when it is given a certain positioning strategy.
4856
+ * next to a given reference element.
4809
4857
  *
4810
4858
  * This export does not have any `platform` interface logic. You will need to
4811
4859
  * write one for the platform you are using Floating UI with.
@@ -4883,7 +4931,6 @@ const computePosition$1 = async (reference, floating, config) => {
4883
4931
  } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
4884
4932
  }
4885
4933
  i = -1;
4886
- continue;
4887
4934
  }
4888
4935
  }
4889
4936
  return {
@@ -4946,6 +4993,7 @@ async function detectOverflow(state, options) {
4946
4993
  y: 1
4947
4994
  };
4948
4995
  const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
4996
+ elements,
4949
4997
  rect,
4950
4998
  offsetParent,
4951
4999
  strategy
@@ -5075,6 +5123,7 @@ const flip$1 = function (options) {
5075
5123
 
5076
5124
  // For type backwards-compatibility, the `OffsetOptions` type was also
5077
5125
  // Derivable.
5126
+
5078
5127
  async function convertValueToCoords(state, options) {
5079
5128
  const {
5080
5129
  placement,
@@ -5088,8 +5137,6 @@ async function convertValueToCoords(state, options) {
5088
5137
  const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
5089
5138
  const crossAxisMulti = rtl && isVertical ? -1 : 1;
5090
5139
  const rawValue = evaluate(options, state);
5091
-
5092
- // eslint-disable-next-line prefer-const
5093
5140
  let {
5094
5141
  mainAxis,
5095
5142
  crossAxis,
@@ -5131,15 +5178,27 @@ const offset = function (options) {
5131
5178
  name: 'offset',
5132
5179
  options,
5133
5180
  async fn(state) {
5181
+ var _middlewareData$offse, _middlewareData$arrow;
5134
5182
  const {
5135
5183
  x,
5136
- y
5184
+ y,
5185
+ placement,
5186
+ middlewareData
5137
5187
  } = state;
5138
5188
  const diffCoords = await convertValueToCoords(state, options);
5189
+
5190
+ // If the placement is the same and the arrow caused an alignment offset
5191
+ // then we don't need to change the positioning coordinates.
5192
+ if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
5193
+ return {};
5194
+ }
5139
5195
  return {
5140
5196
  x: x + diffCoords.x,
5141
5197
  y: y + diffCoords.y,
5142
- data: diffCoords
5198
+ data: {
5199
+ ...diffCoords,
5200
+ placement
5201
+ }
5143
5202
  };
5144
5203
  }
5145
5204
  };
@@ -5267,20 +5326,20 @@ const size$1 = function (options) {
5267
5326
  let availableWidth = overflowAvailableWidth;
5268
5327
  if (isYAxis) {
5269
5328
  const maximumClippingWidth = width - overflow.left - overflow.right;
5270
- availableWidth = alignment || noShift ? min$1(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth;
5329
+ availableWidth = alignment || noShift ? min(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth;
5271
5330
  } else {
5272
5331
  const maximumClippingHeight = height - overflow.top - overflow.bottom;
5273
- availableHeight = alignment || noShift ? min$1(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight;
5332
+ availableHeight = alignment || noShift ? min(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight;
5274
5333
  }
5275
5334
  if (noShift && !alignment) {
5276
- const xMin = max$1(overflow.left, 0);
5277
- const xMax = max$1(overflow.right, 0);
5278
- const yMin = max$1(overflow.top, 0);
5279
- const yMax = max$1(overflow.bottom, 0);
5335
+ const xMin = max(overflow.left, 0);
5336
+ const xMax = max(overflow.right, 0);
5337
+ const yMin = max(overflow.top, 0);
5338
+ const yMax = max(overflow.bottom, 0);
5280
5339
  if (isYAxis) {
5281
- availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max$1(overflow.left, overflow.right));
5340
+ availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));
5282
5341
  } else {
5283
- availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max$1(overflow.top, overflow.bottom));
5342
+ availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));
5284
5343
  }
5285
5344
  }
5286
5345
  await apply({
@@ -5301,19 +5360,6 @@ const size$1 = function (options) {
5301
5360
  };
5302
5361
  };
5303
5362
 
5304
- /**
5305
- * Custom positioning reference element.
5306
- * @see https://floating-ui.com/docs/virtual-elements
5307
- */
5308
- const min = Math.min;
5309
- const max = Math.max;
5310
- const round = Math.round;
5311
- const floor = Math.floor;
5312
- const createCoords = v => ({
5313
- x: v,
5314
- y: v
5315
- });
5316
-
5317
5363
  function getNodeName(node) {
5318
5364
  if (isNode(node)) {
5319
5365
  return (node.nodeName || '').toLowerCase();
@@ -7856,6 +7902,7 @@ const CatDropdown = class {
7856
7902
  this.arrowNavigation = 'vertical';
7857
7903
  this.noResize = false;
7858
7904
  this.overflow = false;
7905
+ this.noInitialFocus = false;
7859
7906
  }
7860
7907
  clickHandler(event) {
7861
7908
  // we need to delay the initialization of the trigger until first
@@ -7887,6 +7934,9 @@ const CatDropdown = class {
7887
7934
  * Opens the dropdown.
7888
7935
  */
7889
7936
  async open() {
7937
+ if (!this.trigger) {
7938
+ this.initTrigger();
7939
+ }
7890
7940
  if (this.isOpen === null || this.isOpen) {
7891
7941
  return; // busy or open
7892
7942
  }
@@ -7927,7 +7977,8 @@ const CatDropdown = class {
7927
7977
  return true;
7928
7978
  }
7929
7979
  return event.key === 'Tab' && event.shiftKey;
7930
- }
7980
+ },
7981
+ initialFocus: () => (this.noInitialFocus ? false : undefined)
7931
7982
  });
7932
7983
  this.trap.activate();
7933
7984
  });
@@ -7952,7 +8003,7 @@ const CatDropdown = class {
7952
8003
  }, timeTransitionS);
7953
8004
  }
7954
8005
  render() {
7955
- return (index.h(index.Host, { key: '5e8a36f00643aa9717333a38ef215b27d328c167' }, index.h("slot", { key: '86a79d3b71d98a57e78be7c94caf35bbf8dbdfdd', name: "trigger", ref: el => (this.triggerSlot = el) }), index.h("div", { key: '1367ba9d60feb7abb4ae5993ba0b5c48ee44e308', id: this.contentId, class: { content: true, 'overflow-auto': !this.overflow }, ref: el => (this.content = el) }, index.h("slot", { key: '816d07aa40e29aff294b1110370286f2b968fc46', name: "content" }))));
8006
+ return (index.h(index.Host, { key: '6cde42e7f7bfc2df858b7179157a1f52e0c23e0e' }, index.h("slot", { key: '91633464f448a8142f52b6e1e62420974a929e84', name: "trigger", ref: el => (this.triggerSlot = el) }), index.h("div", { key: '2ed9bd2dcc58b83ec1e7781959456e67d9397c48', id: this.contentId, class: { content: true, 'overflow-auto': !this.overflow }, ref: el => (this.content = el) }, index.h("slot", { key: 'a91710cd8455cb006f60e48dd49aee7f6d114877', name: "content" }))));
7956
8007
  }
7957
8008
  get contentId() {
7958
8009
  return `cat-dropdown-${this.id}`;
@@ -9895,7 +9946,7 @@ const CatPagination = class {
9895
9946
  };
9896
9947
  CatPagination.style = CatPaginationStyle0;
9897
9948
 
9898
- const catRadioCss = ".hint-wrapper{flex:0 1 auto;display:flex;gap:0.5rem}.hint-section{flex:1 1 auto;display:flex;flex-direction:column;gap:0.25rem;color:rgb(var(--cat-font-color-muted, 81, 92, 108));font-size:0.875rem;line-height:1.125rem}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){margin:0 !important}:host{display:flex;flex-direction:column;gap:0.5rem}:host([hidden]){display:none}label{display:flex;gap:0.5rem;font-size:0.9375rem;line-height:1.25rem;font-weight:var(--cat-font-weight-body, 400);cursor:pointer}.label-left{flex-direction:row-reverse}.radio{display:flex;position:relative;align-self:flex-start}.circle-placeholder{width:calc(1.25rem + 1px);flex-shrink:0}.circle{position:absolute;width:0.75rem;height:0.75rem;background-color:rgb(var(--cat-primary-bg, 0, 129, 148));border-radius:10rem;top:calc(50% - 0.375rem);left:calc(50% - 0.375rem);visibility:hidden;pointer-events:none}input{margin:0;width:1.25rem;height:1.25rem;appearance:none;background-color:white;border:1px solid rgb(var(--cat-border-color-dark, 215, 219, 224));border-radius:10rem;cursor:inherit}input:checked{border-color:rgb(var(--cat-primary-bg, 0, 129, 148))}input:checked+.circle{visibility:visible}input:focus-visible{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}:host(.cat-error) input{border-color:rgb(var(--cat-danger-bg, 217, 52, 13))}:host(.cat-error) .circle{background-color:rgb(var(--cat-danger-bg, 217, 52, 13))}.label{flex:1 1 auto}.is-hidden .label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.is-disabled{cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 81, 92, 108))}.is-disabled input{background-color:#f2f4f7}.is-disabled input:checked{border-color:rgb(var(--cat-border-color-dark, 215, 219, 224))}.is-disabled .circle{background-color:rgb(var(--cat-border-color-dark, 215, 219, 224))}";
9949
+ const catRadioCss = ".hint-wrapper{flex:0 1 auto;display:flex;gap:0.5rem}.hint-section{flex:1 1 auto;display:flex;flex-direction:column;gap:0.25rem;color:rgb(var(--cat-font-color-muted, 81, 92, 108));font-size:0.875rem;line-height:1.125rem}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){margin:0 !important}:host{display:flex;flex-direction:column;gap:0.25rem}:host([hidden]){display:none}label{display:flex;gap:0.5rem;font-size:0.9375rem;line-height:1.25rem;font-weight:var(--cat-font-weight-body, 400);cursor:pointer}.label-left{flex-direction:row-reverse}.radio{display:flex;position:relative;align-self:flex-start}.circle-placeholder{width:calc(1.25rem + 1px);flex-shrink:0}.circle{position:absolute;width:0.75rem;height:0.75rem;background-color:rgb(var(--cat-primary-bg, 0, 129, 148));border-radius:10rem;top:calc(50% - 0.375rem);left:calc(50% - 0.375rem);visibility:hidden;pointer-events:none}input{margin:0;width:1.25rem;height:1.25rem;appearance:none;background-color:white;border:1px solid rgb(var(--cat-border-color-dark, 215, 219, 224));border-radius:10rem;cursor:inherit}input:checked{border-color:rgb(var(--cat-primary-bg, 0, 129, 148))}input:checked+.circle{visibility:visible}input:focus-visible{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}:host(.cat-error) input{border-color:rgb(var(--cat-danger-bg, 217, 52, 13))}:host(.cat-error) .circle{background-color:rgb(var(--cat-danger-bg, 217, 52, 13))}.label{flex:1 1 auto}.is-hidden .label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.is-disabled{cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 81, 92, 108))}.is-disabled input{background-color:#f2f4f7}.is-disabled input:checked{border-color:rgb(var(--cat-border-color-dark, 215, 219, 224))}.is-disabled .circle{background-color:rgb(var(--cat-border-color-dark, 215, 219, 224))}";
9899
9950
  const CatRadioStyle0 = catRadioCss;
9900
9951
 
9901
9952
  let nextUniqueId$5 = 0;
@@ -12660,6 +12711,9 @@ function getLocale(language) {
12660
12711
  timeFormat: getHour12(language) ? '12' : '24'
12661
12712
  };
12662
12713
  }
12714
+ function formatIso(date) {
12715
+ return `${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}`;
12716
+ }
12663
12717
 
12664
12718
  function clampTime(min, date, max) {
12665
12719
  const [, hhMin, mmMin] = min?.match(/(\d{2}):(\d{2})/)?.map(Number) ?? [];
@@ -12730,6 +12784,16 @@ const CatTime = class {
12730
12784
  this.placement = 'bottom-end';
12731
12785
  this.step = 30;
12732
12786
  }
12787
+ onMinChanged(min, oldMin) {
12788
+ if (min !== oldMin) {
12789
+ this.reclamp('min', min);
12790
+ }
12791
+ }
12792
+ onMaxChanged(max, oldMax) {
12793
+ if (max !== oldMax) {
12794
+ this.reclamp('max', max);
12795
+ }
12796
+ }
12733
12797
  componentWillLoad() {
12734
12798
  this.syncValue(this.value ?? '');
12735
12799
  }
@@ -12747,9 +12811,9 @@ const CatTime = class {
12747
12811
  onOpen() {
12748
12812
  const query = (selector) => this.hostElement.shadowRoot?.querySelector(selector);
12749
12813
  const time = clampTime(this.min ?? null, this.selectionTime ?? new Date(2000, 5, 1, 8), this.max ?? null);
12750
- const elem1 = query(`[data-time="${this.formatIso(time)}"]`);
12814
+ const elem1 = query(`[data-time="${formatIso(time)}"]`);
12751
12815
  time.setMinutes(Math.floor(time.getMinutes() / this.step) * this.step);
12752
- const elem2 = query(`[data-time="${this.formatIso(time)}"]`);
12816
+ const elem2 = query(`[data-time="${formatIso(time)}"]`);
12753
12817
  setTimeout(() => {
12754
12818
  (elem2 ?? elem1)?.doFocus();
12755
12819
  (elem2 ?? elem1)?.scrollIntoView(this.selectionTime ? { block: 'center' } : undefined);
@@ -12770,7 +12834,7 @@ const CatTime = class {
12770
12834
  const time = clampTime(this.min ?? null, date, this.max ?? null);
12771
12835
  this.isAm = this.format(time).toLowerCase().includes('am');
12772
12836
  this.selectionTime = time;
12773
- this.value = this.formatIso(time);
12837
+ this.value = formatIso(time);
12774
12838
  }
12775
12839
  // we need to set the input explicitly to sync the input even without a
12776
12840
  // rerender (if the value is not changed)
@@ -12805,8 +12869,8 @@ const CatTime = class {
12805
12869
  this.input?.clear();
12806
12870
  }
12807
12871
  render() {
12808
- return (index.h(index.Host, { key: '899fb8f5f263ba560bacb99d111792e9219e057a' }, index.h("cat-input", { key: 'e2b84c644e265cdc166c7ec50cb873d79ddeb12e', 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) }, index.h("span", { key: '097ee8e93a2d05d35051ddc1aa105b1e9ebf0528', slot: "label" }, this.hasSlottedLabel && index.h("slot", { name: "label" }), !this.hasSlottedLabel && this.label, index.h("span", { key: '5d526fe661331f8eb1a887ddc0eabc3f3338747a', class: "label-aria" }, " (HH:mm)")), index.h("div", { key: '28fcd51b6e297d552e121a01813c92c564cccbda', slot: "addon", class: "cat-time-addon" }, this.locale.timeFormat === '12' && (index.h("cat-button", { class: "cat-time-format", disabled: this.disabled || this.readonly, onCatClick: () => this.toggleAm() }, this.isAm ? 'AM' : 'PM')), index.h("cat-dropdown", { key: 'f93687883da3f3c32027edcd89d6989caad8e504', slot: "addon", placement: this.placement }, index.h("cat-button", { key: 'eae27c8538ff6564d6b5a735b30e8c2aac07751d', 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 }), index.h("nav", { key: 'a334804d935c713bb95e3bb88fce40fa7f05724c', slot: "content", class: "cat-nav" }, index.h("ul", { key: '713181fc8597cf4b9486f2fb7aa63fb412180054' }, this.timeArray().map(time => {
12809
- const isoTime = this.formatIso(time);
12872
+ return (index.h(index.Host, { key: 'c7ebe7c00d372720ce9c34907438f47150df0820' }, index.h("cat-input", { key: 'e83d9bddbdff4d1e0c97531f3684618e0f4251a8', 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) }, index.h("span", { key: '504e24bcf7d7fa3e0eddb7df91261778e720cc87', slot: "label" }, this.hasSlottedLabel && index.h("slot", { name: "label" }), !this.hasSlottedLabel && this.label, index.h("span", { key: 'c617e13394f44bd851beae13e809f791a56dfa42', class: "label-aria" }, " (HH:mm)")), index.h("div", { key: '601bd57b6137a44901a3d32ce10f881aae67a2a8', slot: "addon", class: "cat-time-addon" }, this.locale.timeFormat === '12' && (index.h("cat-button", { class: "cat-time-format", disabled: this.disabled || this.readonly, onCatClick: () => this.toggleAm() }, this.isAm ? 'AM' : 'PM')), index.h("cat-dropdown", { key: 'ecdd2fb5987eb30890c9258ece4bd1e176b2d6c6', slot: "addon", placement: this.placement }, index.h("cat-button", { key: 'a38158d199940ff276b5263833c39cdbea04d194', 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 }), index.h("nav", { key: 'e2e77112f74467cc2db37d24f38165389888978a', slot: "content", class: "cat-nav" }, index.h("ul", { key: 'c005ac2b43037f3e5953117e968a967ce60be477' }, this.timeArray().map(time => {
12873
+ const isoTime = formatIso(time);
12810
12874
  const disabled = isBefore(time, this.min ?? null) || isAfter(time, this.max ?? null);
12811
12875
  return (index.h("li", null, index.h("cat-button", { class: {
12812
12876
  'cat-nav-item': true,
@@ -12855,14 +12919,27 @@ const CatTime = class {
12855
12919
  : '';
12856
12920
  return includeAmPm ? str : str.replace(/\s?(am|pm)/i, '');
12857
12921
  }
12858
- formatIso(date) {
12859
- return `${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}`;
12922
+ reclamp(mode, limit) {
12923
+ if (!this.value)
12924
+ return;
12925
+ const min = (mode === 'min' ? limit : this.min) ?? null;
12926
+ const max = (mode === 'max' ? limit : this.max) ?? null;
12927
+ const [match, hh, mm] = this.value.match(/(\d{2}):(\d{2})/) ?? [];
12928
+ const newValue = match ? formatIso(clampTime(min, new Date(2000, 5, 1, Number(hh), Number(mm)), max)) : undefined;
12929
+ if (this.value !== newValue) {
12930
+ this.syncValue(newValue ?? '');
12931
+ this.catChange.emit(newValue);
12932
+ }
12860
12933
  }
12861
12934
  get hostElement() { return index.getElement(this); }
12935
+ static get watchers() { return {
12936
+ "min": ["onMinChanged"],
12937
+ "max": ["onMaxChanged"]
12938
+ }; }
12862
12939
  };
12863
12940
  CatTime.style = CatTimeStyle0;
12864
12941
 
12865
- const catToggleCss = ".hint-wrapper{flex:0 1 auto;display:flex;gap:0.5rem}.hint-section{flex:1 1 auto;display:flex;flex-direction:column;gap:0.25rem;color:rgb(var(--cat-font-color-muted, 81, 92, 108));font-size:0.875rem;line-height:1.125rem}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){margin:0 !important}:host{display:flex;flex-direction:column;gap:0.5rem}:host([hidden]){display:none}label{flex:0 1 auto;display:flex;gap:0.5rem;font-size:0.9375rem;line-height:1.25rem;font-weight:var(--cat-font-weight-body, 400);-webkit-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer}.label-left{flex-direction:row-reverse}input{position:absolute;margin:0;width:2rem;height:1.25rem;opacity:0;cursor:inherit}.toggle-placeholder{width:calc(2rem + 1px);flex-shrink:0}.toggle{flex:0 0 auto;display:flex;align-items:center;justify-content:center;position:relative;width:2rem;height:1.25rem;border-radius:10rem;background-color:rgb(var(--cat-border-color-dark, 215, 219, 224));transition:background-color 125ms ease;pointer-events:none}:checked+.toggle{background-color:rgb(var(--cat-primary-bg, 0, 129, 148))}:focus-visible+.toggle{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.toggle::after{content:\"\";position:absolute;width:1rem;height:1rem;background:#fff;border-radius:10rem;transform:translateX(calc(2px - 0.5rem));transition:transform 125ms linear;box-shadow:0 1px 2px rgba(27, 31, 38, 0.06), 0 1px 3px rgba(27, 31, 38, 0.1)}:checked+.toggle::after{transform:translateX(calc(-2px + 0.5rem));background:rgb(var(--cat-primary-fill, 255, 255, 255))}.is-disabled .toggle{background-color:rgb(var(--cat-border-color-dark, 215, 219, 224))}:host(.cat-error) .toggle{background-color:rgba(var(--cat-danger-bg, 217, 52, 13), 0.2)}:host(.cat-error) :checked+.toggle{background-color:rgb(var(--cat-danger-bg, 217, 52, 13))}:host(.cat-error) :checked+.toggle::after{background:rgb(var(--cat-danger-fill, 255, 255, 255))}.label{flex:1 1 auto}.is-hidden .label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.is-disabled{cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 81, 92, 108))}";
12942
+ const catToggleCss = ".hint-wrapper{flex:0 1 auto;display:flex;gap:0.5rem}.hint-section{flex:1 1 auto;display:flex;flex-direction:column;gap:0.25rem;color:rgb(var(--cat-font-color-muted, 81, 92, 108));font-size:0.875rem;line-height:1.125rem}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){margin:0 !important}:host{display:flex;flex-direction:column;gap:0.25rem}:host([hidden]){display:none}label{flex:0 1 auto;display:flex;gap:0.5rem;font-size:0.9375rem;line-height:1.25rem;font-weight:var(--cat-font-weight-body, 400);-webkit-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer}.label-left{flex-direction:row-reverse}input{position:absolute;margin:0;width:2rem;height:1.25rem;opacity:0;cursor:inherit}.toggle-placeholder{width:calc(2rem + 1px);flex-shrink:0}.toggle{flex:0 0 auto;display:flex;align-items:center;justify-content:center;position:relative;width:2rem;height:1.25rem;border-radius:10rem;background-color:rgb(var(--cat-border-color-dark, 215, 219, 224));transition:background-color 125ms ease;pointer-events:none}:checked+.toggle{background-color:rgb(var(--cat-primary-bg, 0, 129, 148))}:focus-visible+.toggle{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.toggle::after{content:\"\";position:absolute;width:1rem;height:1rem;background:#fff;border-radius:10rem;transform:translateX(calc(2px - 0.5rem));transition:transform 125ms linear;box-shadow:0 1px 2px rgba(27, 31, 38, 0.06), 0 1px 3px rgba(27, 31, 38, 0.1)}:checked+.toggle::after{transform:translateX(calc(-2px + 0.5rem));background:rgb(var(--cat-primary-fill, 255, 255, 255))}.is-disabled .toggle{background-color:rgb(var(--cat-border-color-dark, 215, 219, 224))}:host(.cat-error) .toggle{background-color:rgba(var(--cat-danger-bg, 217, 52, 13), 0.2)}:host(.cat-error) :checked+.toggle{background-color:rgb(var(--cat-danger-bg, 217, 52, 13))}:host(.cat-error) :checked+.toggle::after{background:rgb(var(--cat-danger-fill, 255, 255, 255))}.label{flex:1 1 auto}.is-hidden .label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.is-disabled{cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 81, 92, 108))}";
12866
12943
  const CatToggleStyle0 = catToggleCss;
12867
12944
 
12868
12945
  let nextUniqueId$1 = 0;