@haiilo/catalyst 10.25.2 → 10.25.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/catalyst/catalyst.esm.js +1 -1
- package/dist/catalyst/{p-33cfd838.entry.js → p-57a035f5.entry.js} +2 -2
- package/dist/catalyst/p-57a035f5.entry.js.map +1 -0
- package/dist/cjs/cat-alert_30.cjs.entry.js +7 -4
- package/dist/cjs/cat-alert_30.cjs.entry.js.map +1 -1
- package/dist/collection/components/cat-date/cat-date.js +7 -4
- package/dist/collection/components/cat-date/cat-date.js.map +1 -1
- package/dist/components/cat-date.js +7 -4
- package/dist/components/cat-date.js.map +1 -1
- package/dist/esm/cat-alert_30.entry.js +7 -4
- package/dist/esm/cat-alert_30.entry.js.map +1 -1
- package/dist/types/components/cat-date/cat-date.d.ts +1 -0
- package/package.json +2 -2
- package/dist/catalyst/p-33cfd838.entry.js.map +0 -1
|
@@ -1489,6 +1489,7 @@ const CatDate = class {
|
|
|
1489
1489
|
this.catBlur = index.createEvent(this, "catBlur", 7);
|
|
1490
1490
|
this.language = of.catI18nRegistry.getLocale();
|
|
1491
1491
|
this.locale = getLocale$2(this.language);
|
|
1492
|
+
this.inputFocused = false;
|
|
1492
1493
|
this.requiredMarker = 'optional';
|
|
1493
1494
|
this.horizontal = false;
|
|
1494
1495
|
this.autoComplete = undefined;
|
|
@@ -1568,22 +1569,24 @@ const CatDate = class {
|
|
|
1568
1569
|
this.input?.clear();
|
|
1569
1570
|
}
|
|
1570
1571
|
render() {
|
|
1571
|
-
return (index.h(index.Host, { key: '
|
|
1572
|
+
return (index.h(index.Host, { key: '0dddaceee870f7e1d16131988a1c344b22656594' }, index.h("cat-input", { key: '969ebd4ca18452f0eb5550b440666886ddc664ec', 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 => {
|
|
1573
|
+
this.inputFocused = e.target === this.input;
|
|
1572
1574
|
e.stopPropagation();
|
|
1573
1575
|
this.catFocus.emit(e.detail);
|
|
1574
1576
|
}, onCatBlur: e => {
|
|
1575
1577
|
e.stopPropagation();
|
|
1576
1578
|
this.onInputBlur(e.detail);
|
|
1577
|
-
} }, index.h("span", { key: '
|
|
1579
|
+
} }, index.h("span", { key: '7bf41bdd4f7b8f0b69ef43f11fe075d05ac7e959', slot: "label" }, this.label, index.h("span", { key: '0c454cbb586b0e3e45af2a0601bb735836a17105', class: "label-aria" }, " (", this.locale.formatStr, ")")), index.h("cat-dropdown", { key: 'ce4169eb447fb61b1e98da380446aeb744b1e319', slot: "addon", placement: this.placement, arrowNavigation: "none", noResize: true, onCatOpen: () => this.dateInline?.resetView() }, index.h("cat-button", { key: '2c9f064a88a711d38fe5f293764ab963cee71782', slot: "trigger", icon: "$cat:datepicker-calendar", iconOnly: true, class: "cat-date-toggle", disabled: this.disabled, a11yLabel: this.getTriggerA11yLabel() }), index.h("div", { key: 'fe782bbda78ff445f760f80547a0a57252d041ba', slot: "content" }, index.h("cat-date-inline", { key: '8ecfa83e38d2016148e1d970f0142ce62d5d58e4', ref: el => (this.dateInline = el), min: this.min, max: this.max, value: this.value, hint: true, weeks: true, noClear: true, onCatChange: this.onDateChange.bind(this) }))))));
|
|
1578
1580
|
}
|
|
1579
1581
|
getTriggerA11yLabel() {
|
|
1580
1582
|
const date = this.locale.fromLocalISO(this.value);
|
|
1581
1583
|
return date ? `${this.locale.change}, ${this.locale.toLocalStr(date)}` : this.locale.choose;
|
|
1582
1584
|
}
|
|
1583
1585
|
onInputBlur(e) {
|
|
1584
|
-
if (!this.input) {
|
|
1586
|
+
if (!this.input || !this.inputFocused) {
|
|
1585
1587
|
return;
|
|
1586
1588
|
}
|
|
1589
|
+
this.inputFocused = false;
|
|
1587
1590
|
const oldValue = this.value;
|
|
1588
1591
|
const dateParsed = this.parse(this.input.value ?? '');
|
|
1589
1592
|
const dateMin = this.locale.fromLocalISO(this.min);
|
|
@@ -1605,7 +1608,7 @@ const CatDate = class {
|
|
|
1605
1608
|
onDateChange(e) {
|
|
1606
1609
|
e.stopPropagation();
|
|
1607
1610
|
const oldValue = this.value;
|
|
1608
|
-
const date = e.detail ?
|
|
1611
|
+
const date = e.detail ? this.locale.fromLocalISO(e.detail) : null;
|
|
1609
1612
|
this.value = date ? this.locale.toLocalISO(date) : undefined;
|
|
1610
1613
|
if (oldValue !== this.value) {
|
|
1611
1614
|
this.catChange.emit(this.value);
|