@haiilo/catalyst 10.35.0 → 10.37.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.
- package/dist/catalyst/catalyst.esm.js +1 -1
- package/dist/catalyst/catalyst.esm.js.map +1 -1
- package/dist/catalyst/{p-98a95fb7.entry.js → p-3a3e9083.entry.js} +4 -4
- package/dist/catalyst/p-3a3e9083.entry.js.map +1 -0
- package/dist/catalyst/p-7f3bcfb9.js +3 -0
- package/dist/{esm/index-30afba72.js.map → catalyst/p-7f3bcfb9.js.map} +1 -1
- package/dist/cjs/cat-alert_30.cjs.entry.js +61 -15
- package/dist/cjs/cat-alert_30.cjs.entry.js.map +1 -1
- package/dist/cjs/catalyst.cjs.js +2 -2
- package/dist/cjs/{index-0c9af7fb.js → index-1094f0fc.js} +30 -2
- package/dist/cjs/index-1094f0fc.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/components/cat-checkbox/cat-checkbox.js +6 -2
- package/dist/collection/components/cat-checkbox/cat-checkbox.js.map +1 -1
- package/dist/collection/components/cat-dropdown/cat-dropdown.js +27 -3
- package/dist/collection/components/cat-dropdown/cat-dropdown.js.map +1 -1
- package/dist/collection/components/cat-input/cat-input.js +8 -4
- package/dist/collection/components/cat-input/cat-input.js.map +1 -1
- package/dist/collection/components/cat-textarea/cat-textarea.js +7 -3
- package/dist/collection/components/cat-textarea/cat-textarea.js.map +1 -1
- package/dist/collection/components/cat-toggle/cat-toggle.js +6 -2
- package/dist/collection/components/cat-toggle/cat-toggle.js.map +1 -1
- package/dist/components/cat-checkbox2.js +7 -3
- package/dist/components/cat-checkbox2.js.map +1 -1
- package/dist/components/cat-dropdown2.js +10 -3
- package/dist/components/cat-dropdown2.js.map +1 -1
- package/dist/components/cat-input2.js +9 -5
- package/dist/components/cat-input2.js.map +1 -1
- package/dist/components/cat-textarea.js +8 -4
- package/dist/components/cat-textarea.js.map +1 -1
- package/dist/components/cat-toggle.js +7 -3
- package/dist/components/cat-toggle.js.map +1 -1
- package/dist/esm/cat-alert_30.entry.js +61 -15
- package/dist/esm/cat-alert_30.entry.js.map +1 -1
- package/dist/esm/catalyst.js +3 -3
- package/dist/esm/{index-30afba72.js → index-e8c0ddf2.js} +30 -2
- package/dist/esm/index-e8c0ddf2.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/types/components/cat-checkbox/cat-checkbox.d.ts +1 -0
- package/dist/types/components/cat-dropdown/cat-dropdown.d.ts +6 -0
- package/dist/types/components/cat-input/cat-input.d.ts +1 -0
- package/dist/types/components/cat-textarea/cat-textarea.d.ts +1 -0
- package/dist/types/components/cat-toggle/cat-toggle.d.ts +1 -0
- package/dist/types/components.d.ts +8 -0
- package/package.json +4 -4
- package/dist/catalyst/p-98a95fb7.entry.js.map +0 -1
- package/dist/catalyst/p-c3a9aef7.js +0 -3
- package/dist/catalyst/p-c3a9aef7.js.map +0 -1
- package/dist/cjs/index-0c9af7fb.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-
|
|
1
|
+
import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-e8c0ddf2.js';
|
|
2
2
|
import { e as createErrorClass, O as Observable, f as errorContext, E as EMPTY_SUBSCRIPTION, S as Subscription, g as arrRemove, h as operate, i as createOperatorSubscriber, j as innerFrom, k as executeSchedule, l as isFunction, m as identity, n as from, p as popScheduler, q as isArrayLike, r as isScheduler, s as popNumber, t as noop, u as log, a as catI18nRegistry, c as commonjsGlobal$1, d as catIconRegistry, o as of } from './of-e4ec2eb4.js';
|
|
3
3
|
|
|
4
4
|
const ObjectUnsubscribedError = createErrorClass((_super) => function ObjectUnsubscribedErrorImpl() {
|
|
@@ -1350,6 +1350,13 @@ const CatCheckbox = class {
|
|
|
1350
1350
|
this.catChange = createEvent(this, "catChange", 7);
|
|
1351
1351
|
this.catFocus = createEvent(this, "catFocus", 7);
|
|
1352
1352
|
this.catBlur = createEvent(this, "catBlur", 7);
|
|
1353
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
1354
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
1355
|
+
}
|
|
1356
|
+
else {
|
|
1357
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
1358
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
1359
|
+
}
|
|
1353
1360
|
this._id = `cat-checkbox-${nextUniqueId$a++}`;
|
|
1354
1361
|
this.hasSlottedLabel = false;
|
|
1355
1362
|
this.hasSlottedHint = false;
|
|
@@ -1378,6 +1385,7 @@ const CatCheckbox = class {
|
|
|
1378
1385
|
this.updateResolved();
|
|
1379
1386
|
}
|
|
1380
1387
|
componentWillRender() {
|
|
1388
|
+
this.internals.setFormValue(this.checked ? (this.value ?? 'on') : (this.noValue ?? null));
|
|
1381
1389
|
this.hasSlottedLabel = !!this.hostElement.querySelector('[slot="label"]');
|
|
1382
1390
|
this.hasSlottedHint = !!this.hostElement.querySelector('[slot="hint"]');
|
|
1383
1391
|
}
|
|
@@ -1399,19 +1407,20 @@ const CatCheckbox = class {
|
|
|
1399
1407
|
this.input.blur();
|
|
1400
1408
|
}
|
|
1401
1409
|
render() {
|
|
1402
|
-
return (h(Host, { key: '
|
|
1410
|
+
return (h(Host, { key: '05b68d962533497b453115b800e3ea303158212c' }, h("label", { key: 'd15945284e20c6d58cf2df7688b036b2e5425f0f', htmlFor: this.id, class: {
|
|
1403
1411
|
'is-hidden': this.labelHidden,
|
|
1404
1412
|
'is-disabled': this.disabled,
|
|
1405
1413
|
'label-left': this.labelLeft,
|
|
1406
1414
|
'align-center': this.alignment === 'center',
|
|
1407
1415
|
'align-end': this.alignment === 'bottom'
|
|
1408
|
-
} }, h("input", { key: '
|
|
1416
|
+
} }, h("input", { key: 'a5d6f3093e75db63e7c300253518e42106760a52', "data-test": this.testId, ...this.nativeAttributes, part: "input", ref: el => (this.input = el), id: this.id, type: "checkbox", name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, indeterminate: this.indeterminate, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this), "aria-describedby": this.hasHint ? this.id + '-hint' : undefined }), h("span", { key: '0c65b6e371a36520133fd172be153df28196491d', class: "box", "aria-hidden": "true" }, h("svg", { key: '044cab34d712b243c9329922482df42694950cfc', class: "check", viewBox: "0 0 12 10" }, h("polyline", { key: 'a573d56014dc292b1f41cb1b01f28d814b4a5516', points: "1.5 6 4.5 9 10.5 1" })), h("svg", { key: 'f09647dc93bfb204ce076dc77ec32ca9d024ea65', class: "dash", viewBox: "0 0 12 10" }, h("polyline", { key: '9cb83216b18ba26d53936911c73e2f3de67916c3', points: "1.5 5 10.5 5" }))), h("span", { key: '84c1bee050ca233c8fdda98ceace71de343a350d', class: { label: true, 'label-wrapper': !this.hasSlottedLabel }, part: "label" }, (this.hasSlottedLabel && h("slot", { key: '61a771b1bad26a055baed80e762c0aaac09bc3f4', name: "label" })) || this.label, h("span", { key: '5a330f42046052f38bb46e149fc029daa8fb8f3e', class: "label-metadata" }, !this.required && (this.requiredMarker ?? 'optional').startsWith('optional') && (h("span", { key: '4579818c0b721db3e9f177c9510072eaef451dba', class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.optional'), ")")), this.required && this.requiredMarker?.startsWith('required') && (h("span", { key: 'a5ca8a8bc0753aef66d36f86f6c61c31ec4a4069', class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.required'), ")"))))), this.hasHint && (h("div", { key: '15312bf5c2d948928fb70e6055b28ae996ffdd1b', class: { 'hint-wrapper': true, 'label-left': this.labelLeft } }, h("div", { key: 'f1bf992ec81de9aa642093aafa8bd8da73d237f8', class: "box-placeholder" }), h(CatFormHint, { key: '66354c340d274a802a21eac6d95b1e4390cfde71', id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }) })))));
|
|
1409
1417
|
}
|
|
1410
1418
|
get hasHint() {
|
|
1411
1419
|
return !!this.hint || !!this.hasSlottedHint;
|
|
1412
1420
|
}
|
|
1413
1421
|
onInput() {
|
|
1414
1422
|
this.checked = this.input.checked;
|
|
1423
|
+
this.internals.setFormValue(this.input.checked ? (this.value ?? 'on') : (this.noValue ?? null));
|
|
1415
1424
|
this.indeterminate = this.input.indeterminate;
|
|
1416
1425
|
this.updateResolved();
|
|
1417
1426
|
this.catChange.emit(this.resolvedValue);
|
|
@@ -1425,6 +1434,7 @@ const CatCheckbox = class {
|
|
|
1425
1434
|
updateResolved() {
|
|
1426
1435
|
this.resolvedValue = this.checked ? (this.value ?? true) : (this.noValue ?? false);
|
|
1427
1436
|
}
|
|
1437
|
+
static get formAssociated() { return true; }
|
|
1428
1438
|
get hostElement() { return getElement(this); }
|
|
1429
1439
|
};
|
|
1430
1440
|
CatCheckbox.style = CatCheckboxStyle0;
|
|
@@ -8675,6 +8685,7 @@ const CatDropdown = class {
|
|
|
8675
8685
|
*/
|
|
8676
8686
|
this.hasInitialFocus = false;
|
|
8677
8687
|
this.placement = 'bottom-start';
|
|
8688
|
+
this.justify = false;
|
|
8678
8689
|
this.noAutoClose = false;
|
|
8679
8690
|
this.arrowNavigation = 'vertical';
|
|
8680
8691
|
this.noResize = false;
|
|
@@ -8789,7 +8800,7 @@ const CatDropdown = class {
|
|
|
8789
8800
|
}, timeTransitionS);
|
|
8790
8801
|
}
|
|
8791
8802
|
render() {
|
|
8792
|
-
return (h(Host, { key: '
|
|
8803
|
+
return (h(Host, { key: 'abd5eb8eb84977f0981113b3f7958ec2a31a47bb' }, h("slot", { key: '6049c92c9b30e3fba338fb94d17543476620fe37', name: "anchor", ref: el => (this.anchorSlot = el) }), h("slot", { key: '6eb5f52f222ad08b4a7f0d41d4ace943b371a6b7', name: "trigger", ref: el => (this.triggerSlot = el) }), h("div", { key: 'e186f63a79fcc457bee344ee188fef37f2c27383', id: this.contentId, class: { content: true, 'overflow-auto': !this.overflow }, ref: el => (this.content = el) }, h("slot", { key: 'c0060ac95085f3794f61fd88922368c59a31b1b7', name: "content" }))));
|
|
8793
8804
|
}
|
|
8794
8805
|
componentDidLoad() {
|
|
8795
8806
|
this.initAnchor();
|
|
@@ -8837,14 +8848,19 @@ const CatDropdown = class {
|
|
|
8837
8848
|
}
|
|
8838
8849
|
return trigger;
|
|
8839
8850
|
}
|
|
8840
|
-
update(anchorElement) {
|
|
8851
|
+
update(anchorElement, justify = this.justify) {
|
|
8841
8852
|
if (anchorElement) {
|
|
8842
8853
|
const resize = this.noResize
|
|
8843
8854
|
? []
|
|
8844
8855
|
: [
|
|
8845
8856
|
size({
|
|
8846
8857
|
padding: CatDropdown.OFFSET,
|
|
8847
|
-
apply({ availableWidth, availableHeight, elements }) {
|
|
8858
|
+
apply({ rects, availableWidth, availableHeight, elements }) {
|
|
8859
|
+
if (justify) {
|
|
8860
|
+
Object.assign(elements.floating.style, {
|
|
8861
|
+
minWidth: `${rects.reference.width}px`
|
|
8862
|
+
});
|
|
8863
|
+
}
|
|
8848
8864
|
Object.assign(elements.floating.style, {
|
|
8849
8865
|
maxWidth: `${availableWidth}px`,
|
|
8850
8866
|
maxHeight: `${availableHeight}px`
|
|
@@ -10511,6 +10527,13 @@ const CatInput = class {
|
|
|
10511
10527
|
this.catChange = createEvent(this, "catChange", 7);
|
|
10512
10528
|
this.catFocus = createEvent(this, "catFocus", 7);
|
|
10513
10529
|
this.catBlur = createEvent(this, "catBlur", 7);
|
|
10530
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
10531
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
10532
|
+
}
|
|
10533
|
+
else {
|
|
10534
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
10535
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
10536
|
+
}
|
|
10514
10537
|
this._id = `cat-input-${nextUniqueId$7++}`;
|
|
10515
10538
|
this.hasSlottedLabel = false;
|
|
10516
10539
|
this.hasSlottedHint = false;
|
|
@@ -10555,6 +10578,7 @@ const CatInput = class {
|
|
|
10555
10578
|
this.onErrorsChanged(this.errors, undefined, false);
|
|
10556
10579
|
}
|
|
10557
10580
|
componentWillRender() {
|
|
10581
|
+
this.internals.setFormValue(this.value ?? null);
|
|
10558
10582
|
this.hasSlottedLabel = !!this.hostElement.querySelector('[slot="label"]');
|
|
10559
10583
|
this.hasSlottedHint = !!this.hostElement.querySelector('[slot="hint"]');
|
|
10560
10584
|
this.hasSlottedCounter = !!this.hostElement.querySelector('[slot="counter"]');
|
|
@@ -10610,19 +10634,19 @@ const CatInput = class {
|
|
|
10610
10634
|
}
|
|
10611
10635
|
render() {
|
|
10612
10636
|
this.hostElement.tabIndex = Number(this.hostElement.getAttribute('tabindex')) || 0;
|
|
10613
|
-
return (h("div", { key: '
|
|
10637
|
+
return (h("div", { key: '72c7cf2c86831c1aca03467ec92149fa0a58b05a', class: {
|
|
10614
10638
|
'input-field': true,
|
|
10615
10639
|
'input-horizontal': this.horizontal
|
|
10616
|
-
} }, h("div", { key: '
|
|
10640
|
+
} }, h("div", { key: '7cc76563550305d886b1a18d2344bf59b27f6fc2', class: { 'label-container': true, hidden: this.labelHidden } }, (this.hasSlottedLabel || this.label) && (h("label", { key: '247ad3243e98e5ecf1002e59a84f8f2d1b4f17f4', htmlFor: this.id, part: "label" }, h("span", { key: '0d5f489a87735fc11c9dbacf9acded6d7523926a', class: "label-wrapper" }, (this.hasSlottedLabel && h("slot", { key: '3ade7278530f2b79a3dda8db8923392b84629feb', name: "label" })) || this.label, h("div", { key: '0c1bea5d04c65ceace3ba7a10f7d513301709f86', class: "label-metadata" }, !this.required && (this.requiredMarker ?? 'optional').startsWith('optional') && (h("span", { key: '437f7c224b323514b2a4dcca8ffd6cdc83d3c384', class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.optional'), ")")), this.required && this.requiredMarker?.startsWith('required') && (h("span", { key: 'cbc29c60d0f624bcceb1b5e55ba6bc38afc8d514', class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.required'), ")")), (this.maxLength || this.hasSlottedCounter) && (h("div", { key: 'f00cdace4e8f842019d7ffae484aca11925e2bc2', class: "label-character-count", "aria-hidden": "true" }, this.hasSlottedCounter ? (h("slot", { name: "counter" })) : (`${this.value?.length ?? 0}/${this.maxLength}`)))))))), h("div", { key: '8c961aaf1d0451118d9f5ae583a228be54b320eb', class: "input-container" }, h("div", { key: '6e9e98caaabea18e4a71b8b09baea5355f2eac7b', class: "input-outer-wrapper" }, h("div", { key: '38a5db004dbee08ce542dd36bf0da13156887e26', class: {
|
|
10617
10641
|
'input-wrapper': true,
|
|
10618
10642
|
'input-round': this.round,
|
|
10619
10643
|
'input-readonly': this.readonly,
|
|
10620
10644
|
'input-disabled': this.disabled,
|
|
10621
10645
|
'input-invalid': this.invalid
|
|
10622
|
-
}, onClick: () => this.input.focus() }, this.textPrefix && (h("span", { key: '
|
|
10646
|
+
}, onClick: () => this.input.focus() }, this.textPrefix && (h("span", { key: '350c53ffd8b59df4aa63d23c44213425df9add95', class: "text-prefix", part: "prefix" }, this.textPrefix)), this.icon && !this.iconRight && (h("cat-icon", { key: '5f4794dac4ded82db99a395f1fe34fa9d393498f', icon: this.icon, class: "icon-prefix", size: "l", onClick: () => this.doFocus() })), h("div", { key: '5514838423e9ecfed27f877edc2bedaeeebb1584', class: "input-inner-wrapper" }, h("input", { key: '2dd5de3d46df35470caf488d3f48b5339081c537', "data-test": this.testId, ...this.nativeAttributes, part: "input", ref: el => (this.input = el), id: this.id, class: {
|
|
10623
10647
|
'has-clearable': this.clearable && !this.disabled && !this.readonly && !!this.value,
|
|
10624
10648
|
'has-toggle-password': this.togglePassword && !this.disabled && !this.readonly && !!this.value
|
|
10625
|
-
}, 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: '
|
|
10649
|
+
}, 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: '0392b61e401ad12bcc32fe6de7f2acdf49184093', class: "clearable", icon: "$cat:input-close", "icon-only": "true", size: "s", variant: "text", "a11y-label": catI18nRegistry.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: 'c33c6b188af0d2ccbf67b4a3527d7dc53af8a1fb', class: "toggle-password", icon: this.isPasswordShown ? '$cat:input-password-hide' : '$cat:input-password-show', "icon-only": "true", size: "s", variant: "text", "a11y-label": catI18nRegistry.t(this.isPasswordShown ? 'input.hidePassword' : 'input.showPassword'), onClick: this.doTogglePassword.bind(this) }))), this.loading && h("cat-spinner", { key: '3c51656392e532a3a16efcc5dbf181c40b96ed32', size: "m", class: "icon-loading" }), !this.invalid && this.icon && this.iconRight && (h("cat-icon", { key: 'f3a527250b2ab0ae5bb56217366cabe00c5e7bee', icon: this.icon, class: "icon-suffix", size: "l", onClick: () => this.doFocus() })), this.invalid && (h("cat-icon", { key: '063104b3c65eceb1260109c0f55944ca39c5c2ac', icon: "$cat:input-error", class: "icon-suffix cat-text-danger", size: "l" })), this.textSuffix && (h("span", { key: '0508e322d57cc28a245a8e1fe2f16e02af04679b', class: "text-suffix", part: "suffix" }, this.textSuffix))), h("slot", { key: 'b5ea42f17934631b97c05c0ccfbadd8a1554d779', name: "addon" })), this.hasHint && (h(CatFormHint, { key: '549e082c4e1ff946d2d26ce3843db26af96333d3', id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }), errorMap: this.errorMap })))));
|
|
10626
10650
|
}
|
|
10627
10651
|
get hasHint() {
|
|
10628
10652
|
return !!this.hint || !!this.hasSlottedHint || this.invalid;
|
|
@@ -10632,6 +10656,7 @@ const CatInput = class {
|
|
|
10632
10656
|
}
|
|
10633
10657
|
onInput() {
|
|
10634
10658
|
this.value = this.input.value;
|
|
10659
|
+
this.internals.setFormValue(this.input.value);
|
|
10635
10660
|
this.catChange.emit(this.value);
|
|
10636
10661
|
this.showErrorsIfTimeout();
|
|
10637
10662
|
}
|
|
@@ -10675,6 +10700,7 @@ const CatInput = class {
|
|
|
10675
10700
|
return undefined;
|
|
10676
10701
|
}
|
|
10677
10702
|
static get delegatesFocus() { return true; }
|
|
10703
|
+
static get formAssociated() { return true; }
|
|
10678
10704
|
get hostElement() { return getElement(this); }
|
|
10679
10705
|
static get watchers() { return {
|
|
10680
10706
|
"errors": ["onErrorsChanged"]
|
|
@@ -13564,6 +13590,13 @@ const CatTextarea = class {
|
|
|
13564
13590
|
this.catChange = createEvent(this, "catChange", 7);
|
|
13565
13591
|
this.catFocus = createEvent(this, "catFocus", 7);
|
|
13566
13592
|
this.catBlur = createEvent(this, "catBlur", 7);
|
|
13593
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
13594
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
13595
|
+
}
|
|
13596
|
+
else {
|
|
13597
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
13598
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
13599
|
+
}
|
|
13567
13600
|
this._id = `cat-textarea-${nextUniqueId$2++}`;
|
|
13568
13601
|
this.hasSlottedLabel = false;
|
|
13569
13602
|
this.hasSlottedHint = false;
|
|
@@ -13597,6 +13630,7 @@ const CatTextarea = class {
|
|
|
13597
13630
|
this.onErrorsChanged(this.errors, undefined, false);
|
|
13598
13631
|
}
|
|
13599
13632
|
componentWillRender() {
|
|
13633
|
+
this.internals.setFormValue(this.value ?? null);
|
|
13600
13634
|
this.hasSlottedLabel = !!this.hostElement.querySelector('[slot="label"]');
|
|
13601
13635
|
this.hasSlottedHint = !!this.hostElement.querySelector('[slot="hint"]');
|
|
13602
13636
|
this.hasSlottedCounter = !!this.hostElement.querySelector('[slot="counter"]');
|
|
@@ -13643,15 +13677,15 @@ const CatTextarea = class {
|
|
|
13643
13677
|
}
|
|
13644
13678
|
render() {
|
|
13645
13679
|
this.hostElement.tabIndex = Number(this.hostElement.getAttribute('tabindex')) || 0;
|
|
13646
|
-
return (h(Host, { key: '
|
|
13680
|
+
return (h(Host, { key: '15b9959f246c2252a40612928bcbbb3062f5ee33' }, h("div", { key: '559389b16d2ffbc57f220f042a8bf5406ab38c46', class: {
|
|
13647
13681
|
'textarea-field': true,
|
|
13648
13682
|
'textarea-horizontal': this.horizontal
|
|
13649
|
-
} }, h("div", { key: '
|
|
13683
|
+
} }, h("div", { key: '5b02ba0adc0df7aa500f4031bbeab1b2c7ab8c12', class: { 'label-container': true, hidden: this.labelHidden } }, (this.hasSlottedLabel || this.label) && (h("label", { key: '3b40ff524f852b431f6e98197810503d981ee315', htmlFor: this.id, part: "label" }, h("span", { key: 'afcad9c98545e36b1d1f199bf166145114932df1', class: "label-wrapper" }, (this.hasSlottedLabel && h("slot", { key: '6846020e1fa1600ff7bbc2cabc789b7289aed021', name: "label" })) || this.label, h("div", { key: '92ea11607812b8f3892aee8c0ce4ac2ca8dd5e02', class: "label-metadata" }, !this.required && (this.requiredMarker ?? 'optional').startsWith('optional') && (h("span", { key: '47ea9bca97afbfe7fa4433260311342425fbfeda', class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.optional'), ")")), this.required && this.requiredMarker?.startsWith('required') && (h("span", { key: '9c084e2bc9f2cd6c601bd43d2dc01af7ce9bfa7d', class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.required'), ")")), (this.maxLength || this.hasSlottedCounter) && (h("div", { key: '1de2f7b5006f76b79b730fa75eff5829e29dc113', class: "label-character-count", "aria-hidden": "true" }, this.hasSlottedCounter ? (h("slot", { name: "counter" })) : (`${this.value?.length ?? 0}/${this.maxLength}`)))))))), h("div", { key: 'b06f84a61994d2648a154b50fc2b75bb440901ff', class: "textarea-container" }, h("div", { key: '7e64f6176bd76f10c20c7fc952ba1ac55ad2e401', class: {
|
|
13650
13684
|
'textarea-wrapper': true,
|
|
13651
13685
|
'textarea-readonly': this.readonly,
|
|
13652
13686
|
'textarea-disabled': this.disabled,
|
|
13653
13687
|
'textarea-invalid': this.invalid
|
|
13654
|
-
} }, h("textarea", { key: '
|
|
13688
|
+
} }, h("textarea", { key: '04189852da504f91cb6219aefb58c1ed393996f1', "data-test": this.testId, ...this.nativeAttributes, part: "textarea", ref: el => (this.textarea = el), id: this.id, disabled: this.disabled, autocomplete: this.autoComplete, 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: '794c3208f8a8db16c912960b643a6f5207496111', icon: "$cat:input-error", class: "icon-suffix cat-text-danger", size: "l", onClick: () => this.textarea.focus() }))), this.hasHint && (h(CatFormHint, { key: '96a271ee88d1608283efbc5f8913586da8e787e3', id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }), errorMap: this.errorMap }))))));
|
|
13655
13689
|
}
|
|
13656
13690
|
get hasHint() {
|
|
13657
13691
|
return !!this.hint || !!this.hasSlottedHint || this.invalid;
|
|
@@ -13661,6 +13695,7 @@ const CatTextarea = class {
|
|
|
13661
13695
|
}
|
|
13662
13696
|
onInput() {
|
|
13663
13697
|
this.value = this.textarea.value;
|
|
13698
|
+
this.internals.setFormValue(this.textarea.value);
|
|
13664
13699
|
this.catChange.emit(this.value);
|
|
13665
13700
|
this.showErrorsIfTimeout();
|
|
13666
13701
|
}
|
|
@@ -13692,6 +13727,7 @@ const CatTextarea = class {
|
|
|
13692
13727
|
}
|
|
13693
13728
|
}
|
|
13694
13729
|
static get delegatesFocus() { return true; }
|
|
13730
|
+
static get formAssociated() { return true; }
|
|
13695
13731
|
get hostElement() { return getElement(this); }
|
|
13696
13732
|
static get watchers() { return {
|
|
13697
13733
|
"errors": ["onErrorsChanged"]
|
|
@@ -13977,6 +14013,13 @@ const CatToggle = class {
|
|
|
13977
14013
|
this.catChange = createEvent(this, "catChange", 7);
|
|
13978
14014
|
this.catFocus = createEvent(this, "catFocus", 7);
|
|
13979
14015
|
this.catBlur = createEvent(this, "catBlur", 7);
|
|
14016
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
14017
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
14018
|
+
}
|
|
14019
|
+
else {
|
|
14020
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
14021
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
14022
|
+
}
|
|
13980
14023
|
this._id = `cat-toggle-${nextUniqueId$1++}`;
|
|
13981
14024
|
this.hasSlottedLabel = false;
|
|
13982
14025
|
this.hasSlottedHint = false;
|
|
@@ -14003,6 +14046,7 @@ const CatToggle = class {
|
|
|
14003
14046
|
this.updateResolved();
|
|
14004
14047
|
}
|
|
14005
14048
|
componentWillRender() {
|
|
14049
|
+
this.internals.setFormValue(this.checked ? (this.value ?? 'on') : (this.noValue ?? null));
|
|
14006
14050
|
this.hasSlottedLabel = !!this.hostElement.querySelector('[slot="label"]');
|
|
14007
14051
|
this.hasSlottedHint = !!this.hostElement.querySelector('[slot="hint"]');
|
|
14008
14052
|
}
|
|
@@ -14025,19 +14069,20 @@ const CatToggle = class {
|
|
|
14025
14069
|
}
|
|
14026
14070
|
render() {
|
|
14027
14071
|
this.hostElement.tabIndex = Number(this.hostElement.getAttribute('tabindex')) || 0;
|
|
14028
|
-
return (h(Host, { key: '
|
|
14072
|
+
return (h(Host, { key: '4648a8de33b6a63ba94cd5fd15b6e3e65986470d' }, h("label", { key: '063aa2a20504db693e4ae6d96733f96217dcc4b4', htmlFor: this.id, class: {
|
|
14029
14073
|
'is-hidden': this.labelHidden,
|
|
14030
14074
|
'is-disabled': this.disabled,
|
|
14031
14075
|
'label-left': this.labelLeft,
|
|
14032
14076
|
'align-center': this.alignment === 'center',
|
|
14033
14077
|
'align-end': this.alignment === 'bottom'
|
|
14034
|
-
} }, h("input", { key: '
|
|
14078
|
+
} }, h("input", { key: 'd7ed53b6668b5335621e92fe648f28d34e43d371', "data-test": this.testId, ...this.nativeAttributes, part: "input", ref: el => (this.input = el), id: this.id, type: "checkbox", name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, 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: '852f811c47488c5ee7ba5536c79c82502dd18f92', class: "toggle" }), h("span", { key: '00efe1901a1b2ad93b24362124c7d5b604ca62a9', class: "label", part: "label" }, (this.hasSlottedLabel && h("slot", { key: '039e0fdcd80e110bb1b2ab6ac74472ff9d2e82f4', name: "label" })) || this.label)), this.hasHint && (h("div", { key: '4c59d7a015ac1d0c9430e569244ba20bd71886e2', class: { 'hint-wrapper': true, 'label-left': this.labelLeft } }, h("div", { key: '53f611eaded0a9048c79d82a444144c104589208', class: "toggle-placeholder" }), h(CatFormHint, { key: '250ebfbbbeafe28c1e47c857c6af1ee2429edcb5', id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }) })))));
|
|
14035
14079
|
}
|
|
14036
14080
|
get hasHint() {
|
|
14037
14081
|
return !!this.hint || !!this.hasSlottedHint;
|
|
14038
14082
|
}
|
|
14039
14083
|
onInput() {
|
|
14040
14084
|
this.checked = this.input.checked;
|
|
14085
|
+
this.internals.setFormValue(this.input.checked ? (this.value ?? 'on') : (this.noValue ?? null));
|
|
14041
14086
|
this.updateResolved();
|
|
14042
14087
|
this.catChange.emit(this.resolvedValue);
|
|
14043
14088
|
}
|
|
@@ -14051,6 +14096,7 @@ const CatToggle = class {
|
|
|
14051
14096
|
this.resolvedValue = this.checked ? (this.value ?? true) : (this.noValue ?? false);
|
|
14052
14097
|
}
|
|
14053
14098
|
static get delegatesFocus() { return true; }
|
|
14099
|
+
static get formAssociated() { return true; }
|
|
14054
14100
|
get hostElement() { return getElement(this); }
|
|
14055
14101
|
};
|
|
14056
14102
|
CatToggle.style = CatToggleStyle0;
|