@devschile/chucao 1.8.0 → 2.0.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/README.md +1 -0
- package/dist/chucao/chucao.esm.js +1 -1
- package/dist/chucao/p-10658dc9.entry.js +2 -0
- package/dist/chucao/p-10658dc9.entry.js.map +1 -0
- package/dist/chucao/p-19dde4f9.entry.js +2 -0
- package/dist/chucao/p-19dde4f9.entry.js.map +1 -0
- package/dist/chucao/p-2e20c7a1.entry.js +2 -0
- package/dist/chucao/p-2e20c7a1.entry.js.map +1 -0
- package/dist/chucao/{p-2d7e81b2.entry.js → p-66dce533.entry.js} +2 -2
- package/dist/chucao/p-75184fe1.entry.js +2 -0
- package/dist/chucao/p-75184fe1.entry.js.map +1 -0
- package/dist/chucao/{p-cbb2b478.entry.js → p-96c852f5.entry.js} +2 -2
- package/dist/chucao/p-BaKXvAYc.js +3 -0
- package/dist/chucao/p-BaKXvAYc.js.map +1 -0
- package/dist/chucao/{p-e8fe65bb.entry.js → p-a0ec231a.entry.js} +2 -2
- package/dist/chucao/{p-df73f786.entry.js → p-e48912c7.entry.js} +2 -2
- package/dist/chucao/{p-cfb6db53.entry.js → p-f04d2f75.entry.js} +2 -2
- package/dist/chucao/{p-1cc7042e.entry.js → p-f62e1da2.entry.js} +2 -2
- package/dist/cjs/ch-accordion.cjs.entry.js +1 -1
- package/dist/cjs/ch-alert_8.cjs.entry.js +184 -7
- package/dist/cjs/ch-alert_8.cjs.entry.js.map +1 -1
- package/dist/cjs/ch-checkbox.cjs.entry.js +62 -3
- package/dist/cjs/ch-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/ch-divider.cjs.entry.js +1 -1
- package/dist/cjs/ch-link.cjs.entry.js +1 -1
- package/dist/cjs/ch-modal.cjs.entry.js +1 -1
- package/dist/cjs/ch-radio.cjs.entry.js +62 -3
- package/dist/cjs/ch-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/ch-tabs.cjs.entry.js +1 -1
- package/dist/cjs/ch-textarea.cjs.entry.js +62 -3
- package/dist/cjs/ch-textarea.cjs.entry.js.map +1 -1
- package/dist/cjs/ch-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/chucao.cjs.js +2 -2
- package/dist/cjs/{index-DMeDkSQU.js → index-C9Abf0td.js} +58 -6
- package/dist/cjs/index-C9Abf0td.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/components/ch-checkbox/ch-checkbox.css +10 -0
- package/dist/collection/components/ch-checkbox/ch-checkbox.js +64 -4
- package/dist/collection/components/ch-checkbox/ch-checkbox.js.map +1 -1
- package/dist/collection/components/ch-input/ch-input.css +11 -0
- package/dist/collection/components/ch-input/ch-input.js +64 -4
- package/dist/collection/components/ch-input/ch-input.js.map +1 -1
- package/dist/collection/components/ch-radio/ch-radio.css +10 -0
- package/dist/collection/components/ch-radio/ch-radio.js +64 -4
- package/dist/collection/components/ch-radio/ch-radio.js.map +1 -1
- package/dist/collection/components/ch-select/ch-select.css +11 -0
- package/dist/collection/components/ch-select/ch-select.js +64 -4
- package/dist/collection/components/ch-select/ch-select.js.map +1 -1
- package/dist/collection/components/ch-switch/ch-switch.css +10 -0
- package/dist/collection/components/ch-switch/ch-switch.js +64 -4
- package/dist/collection/components/ch-switch/ch-switch.js.map +1 -1
- package/dist/collection/components/ch-textarea/ch-textarea.css +11 -0
- package/dist/collection/components/ch-textarea/ch-textarea.js +64 -4
- package/dist/collection/components/ch-textarea/ch-textarea.js.map +1 -1
- package/dist/components/ch-accordion.js +1 -1
- package/dist/components/ch-alert.js +1 -1
- package/dist/components/ch-badge.js +1 -1
- package/dist/components/ch-button.js +1 -1
- package/dist/components/ch-card.js +1 -1
- package/dist/components/ch-checkbox.js +1 -1
- package/dist/components/ch-checkbox.js.map +1 -1
- package/dist/components/ch-divider.js +1 -1
- package/dist/components/ch-input.js +1 -1
- package/dist/components/ch-input.js.map +1 -1
- package/dist/components/ch-link.js +1 -1
- package/dist/components/ch-modal.js +1 -1
- package/dist/components/ch-radio.js +1 -1
- package/dist/components/ch-radio.js.map +1 -1
- package/dist/components/ch-select.js +1 -1
- package/dist/components/ch-select.js.map +1 -1
- package/dist/components/ch-spinner.js +1 -1
- package/dist/components/ch-switch.js +1 -1
- package/dist/components/ch-switch.js.map +1 -1
- package/dist/components/ch-tabs.js +1 -1
- package/dist/components/ch-textarea.js +1 -1
- package/dist/components/ch-textarea.js.map +1 -1
- package/dist/components/ch-tooltip.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/p-DL-bL54o.js +2 -0
- package/dist/components/p-DL-bL54o.js.map +1 -0
- package/dist/esm/ch-accordion.entry.js +1 -1
- package/dist/esm/ch-alert_8.entry.js +184 -7
- package/dist/esm/ch-alert_8.entry.js.map +1 -1
- package/dist/esm/ch-checkbox.entry.js +62 -3
- package/dist/esm/ch-checkbox.entry.js.map +1 -1
- package/dist/esm/ch-divider.entry.js +1 -1
- package/dist/esm/ch-link.entry.js +1 -1
- package/dist/esm/ch-modal.entry.js +1 -1
- package/dist/esm/ch-radio.entry.js +62 -3
- package/dist/esm/ch-radio.entry.js.map +1 -1
- package/dist/esm/ch-tabs.entry.js +1 -1
- package/dist/esm/ch-textarea.entry.js +62 -3
- package/dist/esm/ch-textarea.entry.js.map +1 -1
- package/dist/esm/ch-tooltip.entry.js +1 -1
- package/dist/esm/chucao.js +3 -3
- package/dist/esm/{index-Bvah_WQV.js → index-BaKXvAYc.js} +58 -6
- package/dist/esm/index-BaKXvAYc.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/types/components/ch-checkbox/ch-checkbox.d.ts +9 -0
- package/dist/types/components/ch-input/ch-input.d.ts +9 -0
- package/dist/types/components/ch-radio/ch-radio.d.ts +9 -0
- package/dist/types/components/ch-select/ch-select.d.ts +9 -0
- package/dist/types/components/ch-switch/ch-switch.d.ts +9 -0
- package/dist/types/components/ch-textarea/ch-textarea.d.ts +9 -0
- package/dist/types/components.d.ts +24 -0
- package/hydrate/index.js +426 -52
- package/hydrate/index.mjs +426 -52
- package/package.json +4 -1
- package/dist/chucao/p-13ab5f9a.entry.js +0 -2
- package/dist/chucao/p-13ab5f9a.entry.js.map +0 -1
- package/dist/chucao/p-23c5220b.entry.js +0 -2
- package/dist/chucao/p-23c5220b.entry.js.map +0 -1
- package/dist/chucao/p-421cda05.entry.js +0 -2
- package/dist/chucao/p-421cda05.entry.js.map +0 -1
- package/dist/chucao/p-Bvah_WQV.js +0 -3
- package/dist/chucao/p-Bvah_WQV.js.map +0 -1
- package/dist/chucao/p-c16b18b7.entry.js +0 -2
- package/dist/chucao/p-c16b18b7.entry.js.map +0 -1
- package/dist/cjs/index-DMeDkSQU.js.map +0 -1
- package/dist/components/p-hyy-cLgi.js +0 -2
- package/dist/components/p-hyy-cLgi.js.map +0 -1
- package/dist/esm/index-Bvah_WQV.js.map +0 -1
- /package/dist/chucao/{p-2d7e81b2.entry.js.map → p-66dce533.entry.js.map} +0 -0
- /package/dist/chucao/{p-cbb2b478.entry.js.map → p-96c852f5.entry.js.map} +0 -0
- /package/dist/chucao/{p-e8fe65bb.entry.js.map → p-a0ec231a.entry.js.map} +0 -0
- /package/dist/chucao/{p-df73f786.entry.js.map → p-e48912c7.entry.js.map} +0 -0
- /package/dist/chucao/{p-cfb6db53.entry.js.map → p-f04d2f75.entry.js.map} +0 -0
- /package/dist/chucao/{p-1cc7042e.entry.js.map → p-f62e1da2.entry.js.map} +0 -0
package/hydrate/index.js
CHANGED
|
@@ -1781,7 +1781,9 @@ var parsePropertyValue = (propValue, propType, isFormAssociated) => {
|
|
|
1781
1781
|
}
|
|
1782
1782
|
if (propValue != null && !isComplexType(propValue)) {
|
|
1783
1783
|
if (propType & 4 /* Boolean */) {
|
|
1784
|
-
{
|
|
1784
|
+
if (isFormAssociated && typeof propValue === "string") {
|
|
1785
|
+
return propValue === "" || !!propValue;
|
|
1786
|
+
} else {
|
|
1785
1787
|
return propValue === "false" ? false : propValue === "" || !!propValue;
|
|
1786
1788
|
}
|
|
1787
1789
|
}
|
|
@@ -2416,6 +2418,14 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
2416
2418
|
const isHostElement = isHost(renderFnResults);
|
|
2417
2419
|
const rootVnode = isHostElement ? renderFnResults : h(null, null, renderFnResults);
|
|
2418
2420
|
hostTagName = hostElm.tagName;
|
|
2421
|
+
if (cmpMeta.$attrsToReflect$) {
|
|
2422
|
+
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
|
2423
|
+
cmpMeta.$attrsToReflect$.forEach(([propName, attribute]) => {
|
|
2424
|
+
{
|
|
2425
|
+
rootVnode.$attrs$[attribute] = hostElm[propName];
|
|
2426
|
+
}
|
|
2427
|
+
});
|
|
2428
|
+
}
|
|
2419
2429
|
if (isInitialLoad && rootVnode.$attrs$) {
|
|
2420
2430
|
for (const key of Object.keys(rootVnode.$attrs$)) {
|
|
2421
2431
|
if (hostElm.hasAttribute(key) && !["key", "ref", "style", "class"].includes(key)) {
|
|
@@ -2750,7 +2760,9 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
2750
2760
|
const instance = hostRef.$lazyInstance$ ;
|
|
2751
2761
|
newVal = parsePropertyValue(
|
|
2752
2762
|
newVal,
|
|
2753
|
-
cmpMeta.$members$[propName][0]
|
|
2763
|
+
cmpMeta.$members$[propName][0],
|
|
2764
|
+
!!(cmpMeta.$flags$ & 64 /* formAssociated */)
|
|
2765
|
+
);
|
|
2754
2766
|
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
2755
2767
|
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
2756
2768
|
if ((!(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
|
|
@@ -2843,7 +2855,9 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
2843
2855
|
origSetter.apply(this, [
|
|
2844
2856
|
parsePropertyValue(
|
|
2845
2857
|
newValue,
|
|
2846
|
-
memberFlags
|
|
2858
|
+
memberFlags,
|
|
2859
|
+
!!(cmpMeta.$flags$ & 64 /* formAssociated */)
|
|
2860
|
+
)
|
|
2847
2861
|
]);
|
|
2848
2862
|
newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
2849
2863
|
setValue(this, memberName, newValue, cmpMeta);
|
|
@@ -4874,7 +4888,7 @@ function proxyHostElement(elm, cstr) {
|
|
|
4874
4888
|
attrPropVal = cstr.prototype[methodName](attrValue, memberName);
|
|
4875
4889
|
}
|
|
4876
4890
|
} else {
|
|
4877
|
-
attrPropVal = parsePropertyValue(attrValue, memberFlags);
|
|
4891
|
+
attrPropVal = parsePropertyValue(attrValue, memberFlags, !!(cmpMeta.$flags$ & 64 /* formAssociated */));
|
|
4878
4892
|
}
|
|
4879
4893
|
}
|
|
4880
4894
|
if (propValue !== void 0) {
|
|
@@ -5513,17 +5527,28 @@ class ChCard {
|
|
|
5513
5527
|
}; }
|
|
5514
5528
|
}
|
|
5515
5529
|
|
|
5516
|
-
const chCheckboxCss = () => `:host{display:inline-block}.control{display:inline-flex;align-items:center;gap:var(--spacing-lg);cursor:pointer}.control--disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.input{appearance:none;-webkit-appearance:none;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--spacing-4xl);height:var(--spacing-4xl);margin:0;flex-shrink:0;border:var(--border-width) solid var(--border);border-radius:var(--radius-sm);background:var(--surface);cursor:pointer;transition:border-color var(--duration-normal) var(--easing-default), background-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.input:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.input:checked{border-color:var(--accent);background:var(--accent)}.input:checked::before{content:'';width:var(--spacing-xs);height:var(--spacing-lg);border:solid var(--color-accent-text);border-width:0 var(--spacing-shift) var(--spacing-shift) 0;transform:rotate(45deg);margin-top:calc(-1 * var(--spacing-2xs))}.input--invalid{border-color:var(--color-status-warning)}.input--invalid:focus-visible{outline-color:var(--color-status-warning)}.label-text{color:var(--text)}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;
|
|
5530
|
+
const chCheckboxCss = () => `:host{display:inline-block}.control{display:inline-flex;align-items:center;gap:var(--spacing-lg);cursor:pointer}.control--disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.input{appearance:none;-webkit-appearance:none;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--spacing-4xl);height:var(--spacing-4xl);margin:0;flex-shrink:0;border:var(--border-width) solid var(--border);border-radius:var(--radius-sm);background:var(--surface);cursor:pointer;transition:border-color var(--duration-normal) var(--easing-default), background-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.input:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.input:checked{border-color:var(--accent);background:var(--accent)}.input:checked::before{content:'';width:var(--spacing-xs);height:var(--spacing-lg);border:solid var(--color-accent-text);border-width:0 var(--spacing-shift) var(--spacing-shift) 0;transform:rotate(45deg);margin-top:calc(-1 * var(--spacing-2xs))}.input--invalid{border-color:var(--color-status-warning)}.input--invalid:focus-visible{outline-color:var(--color-status-warning)}:host([data-touched]:invalid) .input,:host(:user-invalid) .input{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .input:focus-visible,:host(:user-invalid) .input:focus-visible{outline-color:var(--color-status-warning)}.label-text{color:var(--text)}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;
|
|
5517
5531
|
|
|
5518
5532
|
let checkboxIds = 0;
|
|
5519
5533
|
class ChCheckbox {
|
|
5520
5534
|
constructor(hostRef) {
|
|
5521
5535
|
registerInstance(this, hostRef);
|
|
5522
5536
|
this.chChange = createEvent(this, "chChange");
|
|
5537
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
5538
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
5539
|
+
}
|
|
5540
|
+
else {
|
|
5541
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
5542
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
5543
|
+
}
|
|
5523
5544
|
}
|
|
5524
5545
|
checkboxId = `ch-checkbox-${++checkboxIds}`;
|
|
5525
5546
|
hintId = `${this.checkboxId}-hint`;
|
|
5526
5547
|
errorId = `${this.checkboxId}-error`;
|
|
5548
|
+
initialChecked = false;
|
|
5549
|
+
internals;
|
|
5550
|
+
formDisabled = false;
|
|
5551
|
+
get host() { return getElement(this); }
|
|
5527
5552
|
/**
|
|
5528
5553
|
* Visible label rendered next to the checkbox, associated with it via
|
|
5529
5554
|
* `for`/`id`, so assistive technology announces the checkbox's purpose.
|
|
@@ -5570,6 +5595,39 @@ class ChCheckbox {
|
|
|
5570
5595
|
this.checked = ev.target.checked;
|
|
5571
5596
|
this.chChange.emit(this.checked);
|
|
5572
5597
|
};
|
|
5598
|
+
syncForm() {
|
|
5599
|
+
const internals = this.internals;
|
|
5600
|
+
if (typeof internals?.setFormValue !== 'function') {
|
|
5601
|
+
return;
|
|
5602
|
+
}
|
|
5603
|
+
internals.setFormValue(this.checked ? this.value : null);
|
|
5604
|
+
const flags = {};
|
|
5605
|
+
let message;
|
|
5606
|
+
if (this.required && !this.checked) {
|
|
5607
|
+
flags.valueMissing = true;
|
|
5608
|
+
}
|
|
5609
|
+
if (this.invalid && this.errorMessage) {
|
|
5610
|
+
flags.customError = true;
|
|
5611
|
+
}
|
|
5612
|
+
message = this.errorMessage ?? (flags.valueMissing ? 'Please fill out this field.' : undefined);
|
|
5613
|
+
internals.setValidity(flags, message);
|
|
5614
|
+
}
|
|
5615
|
+
componentDidLoad() {
|
|
5616
|
+
this.initialChecked = this.checked;
|
|
5617
|
+
this.syncForm();
|
|
5618
|
+
this.host.addEventListener('change', this.markTouched);
|
|
5619
|
+
this.host.addEventListener('focusout', this.markTouched);
|
|
5620
|
+
this.host.addEventListener('invalid', this.markTouched);
|
|
5621
|
+
}
|
|
5622
|
+
markTouched = () => {
|
|
5623
|
+
this.host.setAttribute('data-touched', '');
|
|
5624
|
+
};
|
|
5625
|
+
formResetCallback() {
|
|
5626
|
+
this.checked = this.initialChecked;
|
|
5627
|
+
}
|
|
5628
|
+
formDisabledCallback(isDisabled) {
|
|
5629
|
+
this.formDisabled = isDisabled;
|
|
5630
|
+
}
|
|
5573
5631
|
get describedBy() {
|
|
5574
5632
|
if (this.invalid && this.errorMessage) {
|
|
5575
5633
|
return this.errorId;
|
|
@@ -5580,26 +5638,42 @@ class ChCheckbox {
|
|
|
5580
5638
|
return undefined;
|
|
5581
5639
|
}
|
|
5582
5640
|
render() {
|
|
5583
|
-
return (hAsync(Host, { key: '
|
|
5641
|
+
return (hAsync(Host, { key: 'ca6c6f1297434052eeee68fd76cf21d6a7b99aae' }, hAsync("label", { key: '1f3538da6eb2ce91a75cf73044e2103ba472d4ed', class: { 'control': true, 'control--disabled': this.disabled || this.formDisabled }, htmlFor: this.checkboxId }, hAsync("input", { key: '7ed674616bc70af42b025a2b945378192ce48a58', id: this.checkboxId, class: { 'input': true, 'input--invalid': this.invalid }, type: "checkbox", name: this.name, value: this.value, checked: this.checked, disabled: this.disabled || this.formDisabled, required: this.required, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onChange: this.handleChange }), this.label && hAsync("span", { key: '4f5ccc7b28d95d012aa5cd87ec2411be34672d9e', class: "label-text" }, this.label)), this.hint && !(this.invalid && this.errorMessage) && (hAsync("p", { key: 'b7d2b09c54ed61907e4e7110af867b2a0592924c', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (hAsync("p", { key: '2340791705a5fce22b810a3a32377a7b1ccef852', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
5584
5642
|
}
|
|
5643
|
+
static get formAssociated() { return true; }
|
|
5644
|
+
static get watchers() { return {
|
|
5645
|
+
"checked": [{
|
|
5646
|
+
"syncForm": 0
|
|
5647
|
+
}],
|
|
5648
|
+
"required": [{
|
|
5649
|
+
"syncForm": 0
|
|
5650
|
+
}],
|
|
5651
|
+
"invalid": [{
|
|
5652
|
+
"syncForm": 0
|
|
5653
|
+
}],
|
|
5654
|
+
"errorMessage": [{
|
|
5655
|
+
"syncForm": 0
|
|
5656
|
+
}]
|
|
5657
|
+
}; }
|
|
5585
5658
|
static get style() { return chCheckboxCss(); }
|
|
5586
5659
|
static get cmpMeta() { return {
|
|
5587
|
-
"$flags$":
|
|
5660
|
+
"$flags$": 585,
|
|
5588
5661
|
"$tagName$": "ch-checkbox",
|
|
5589
5662
|
"$members$": {
|
|
5590
5663
|
"label": [1],
|
|
5591
|
-
"name": [
|
|
5664
|
+
"name": [513],
|
|
5592
5665
|
"value": [1],
|
|
5593
5666
|
"checked": [1028],
|
|
5594
|
-
"disabled": [
|
|
5595
|
-
"required": [
|
|
5667
|
+
"disabled": [516],
|
|
5668
|
+
"required": [516],
|
|
5596
5669
|
"hint": [1],
|
|
5597
5670
|
"errorMessage": [1, "error-message"],
|
|
5598
|
-
"invalid": [4]
|
|
5671
|
+
"invalid": [4],
|
|
5672
|
+
"formDisabled": [32]
|
|
5599
5673
|
},
|
|
5600
5674
|
"$listeners$": undefined,
|
|
5601
5675
|
"$lazyBundleId$": "-",
|
|
5602
|
-
"$attrsToReflect$": []
|
|
5676
|
+
"$attrsToReflect$": [["name", "name"], ["disabled", "disabled"], ["required", "required"]]
|
|
5603
5677
|
}; }
|
|
5604
5678
|
}
|
|
5605
5679
|
|
|
@@ -5629,7 +5703,7 @@ class ChDivider {
|
|
|
5629
5703
|
}; }
|
|
5630
5704
|
}
|
|
5631
5705
|
|
|
5632
|
-
const chInputCss = () => `:host{display:inline-block;width:100%}.label{display:block;margin-bottom:var(--spacing-sm);font-size:var(--typography-size-sm);font-weight:var(--typography-weight-semibold);color:var(--text)}.input{box-sizing:border-box;width:100%;padding:var(--spacing-xl) var(--spacing-3xl);border-radius:var(--radius);border:var(--border-width) solid var(--border);background:var(--surface);color:var(--text);backdrop-filter:blur(var(--effect-blur));font-family:inherit;font-size:inherit;transition:border-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.input::placeholder{color:var(--text-muted)}.input:focus{border-color:var(--accent);box-shadow:var(--shadow-focus-ring);outline:none}.input--invalid{border-color:var(--color-status-warning)}.input--invalid:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}.input:disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;
|
|
5706
|
+
const chInputCss = () => `:host{display:inline-block;width:100%}.label{display:block;margin-bottom:var(--spacing-sm);font-size:var(--typography-size-sm);font-weight:var(--typography-weight-semibold);color:var(--text)}.input{box-sizing:border-box;width:100%;padding:var(--spacing-xl) var(--spacing-3xl);border-radius:var(--radius);border:var(--border-width) solid var(--border);background:var(--surface);color:var(--text);backdrop-filter:blur(var(--effect-blur));font-family:inherit;font-size:inherit;transition:border-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.input::placeholder{color:var(--text-muted)}.input:focus{border-color:var(--accent);box-shadow:var(--shadow-focus-ring);outline:none}.input--invalid{border-color:var(--color-status-warning)}.input--invalid:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}:host([data-touched]:invalid) .input,:host(:user-invalid) .input{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .input:focus,:host(:user-invalid) .input:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}.input:disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;
|
|
5633
5707
|
|
|
5634
5708
|
let inputIds = 0;
|
|
5635
5709
|
class ChInput {
|
|
@@ -5637,10 +5711,21 @@ class ChInput {
|
|
|
5637
5711
|
registerInstance(this, hostRef);
|
|
5638
5712
|
this.chInput = createEvent(this, "chInput");
|
|
5639
5713
|
this.chChange = createEvent(this, "chChange");
|
|
5714
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
5715
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
5716
|
+
}
|
|
5717
|
+
else {
|
|
5718
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
5719
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
5720
|
+
}
|
|
5640
5721
|
}
|
|
5641
5722
|
inputId = `ch-input-${++inputIds}`;
|
|
5642
5723
|
hintId = `${this.inputId}-hint`;
|
|
5643
5724
|
errorId = `${this.inputId}-error`;
|
|
5725
|
+
initialValue = '';
|
|
5726
|
+
internals;
|
|
5727
|
+
formDisabled = false;
|
|
5728
|
+
get host() { return getElement(this); }
|
|
5644
5729
|
/**
|
|
5645
5730
|
* Visible label rendered above the input and associated with it via
|
|
5646
5731
|
* `for`/`id`, so assistive technology announces the input's purpose.
|
|
@@ -5699,6 +5784,39 @@ class ChInput {
|
|
|
5699
5784
|
this.value = ev.target.value;
|
|
5700
5785
|
this.chChange.emit(this.value);
|
|
5701
5786
|
};
|
|
5787
|
+
syncForm() {
|
|
5788
|
+
const internals = this.internals;
|
|
5789
|
+
if (typeof internals?.setFormValue !== 'function') {
|
|
5790
|
+
return;
|
|
5791
|
+
}
|
|
5792
|
+
internals.setFormValue(this.value);
|
|
5793
|
+
const flags = {};
|
|
5794
|
+
let message;
|
|
5795
|
+
if (this.required && this.value === '') {
|
|
5796
|
+
flags.valueMissing = true;
|
|
5797
|
+
}
|
|
5798
|
+
if (this.invalid && this.errorMessage) {
|
|
5799
|
+
flags.customError = true;
|
|
5800
|
+
}
|
|
5801
|
+
message = this.errorMessage ?? (flags.valueMissing ? 'Please fill out this field.' : undefined);
|
|
5802
|
+
internals.setValidity(flags, message);
|
|
5803
|
+
}
|
|
5804
|
+
componentDidLoad() {
|
|
5805
|
+
this.initialValue = this.value;
|
|
5806
|
+
this.syncForm();
|
|
5807
|
+
this.host.addEventListener('change', this.markTouched);
|
|
5808
|
+
this.host.addEventListener('focusout', this.markTouched);
|
|
5809
|
+
this.host.addEventListener('invalid', this.markTouched);
|
|
5810
|
+
}
|
|
5811
|
+
markTouched = () => {
|
|
5812
|
+
this.host.setAttribute('data-touched', '');
|
|
5813
|
+
};
|
|
5814
|
+
formResetCallback() {
|
|
5815
|
+
this.value = this.initialValue;
|
|
5816
|
+
}
|
|
5817
|
+
formDisabledCallback(isDisabled) {
|
|
5818
|
+
this.formDisabled = isDisabled;
|
|
5819
|
+
}
|
|
5702
5820
|
get describedBy() {
|
|
5703
5821
|
if (this.invalid && this.errorMessage) {
|
|
5704
5822
|
return this.errorId;
|
|
@@ -5709,27 +5827,43 @@ class ChInput {
|
|
|
5709
5827
|
return undefined;
|
|
5710
5828
|
}
|
|
5711
5829
|
render() {
|
|
5712
|
-
return (hAsync(Host, { key: '
|
|
5830
|
+
return (hAsync(Host, { key: '8ac09d33deda0e98464108b77ef5e79ca1696e3f' }, this.label && (hAsync("label", { key: 'e66ab373c5234c2fdacf6bbb796b42ed212c3fd8', class: "label", htmlFor: this.inputId }, this.label)), hAsync("input", { key: 'ae23f4e30970287927f418aebd3b1f83be6d7738', id: this.label ? this.inputId : undefined, class: { 'input': true, 'input--invalid': this.invalid }, type: this.type, name: this.name, placeholder: this.placeholder, disabled: this.disabled || this.formDisabled, required: this.required, value: this.value, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onInput: this.handleInput, onChange: this.handleChange }), this.hint && !(this.invalid && this.errorMessage) && (hAsync("p", { key: '8a6ff789e40a0b3595a34c1e94c3d779d4169bf0', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (hAsync("p", { key: 'aa4c0d89748ad91d91f6483fcf9b3641b44ee864', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
5713
5831
|
}
|
|
5832
|
+
static get formAssociated() { return true; }
|
|
5833
|
+
static get watchers() { return {
|
|
5834
|
+
"value": [{
|
|
5835
|
+
"syncForm": 0
|
|
5836
|
+
}],
|
|
5837
|
+
"required": [{
|
|
5838
|
+
"syncForm": 0
|
|
5839
|
+
}],
|
|
5840
|
+
"invalid": [{
|
|
5841
|
+
"syncForm": 0
|
|
5842
|
+
}],
|
|
5843
|
+
"errorMessage": [{
|
|
5844
|
+
"syncForm": 0
|
|
5845
|
+
}]
|
|
5846
|
+
}; }
|
|
5714
5847
|
static get style() { return chInputCss(); }
|
|
5715
5848
|
static get cmpMeta() { return {
|
|
5716
|
-
"$flags$":
|
|
5849
|
+
"$flags$": 585,
|
|
5717
5850
|
"$tagName$": "ch-input",
|
|
5718
5851
|
"$members$": {
|
|
5719
5852
|
"label": [1],
|
|
5720
5853
|
"type": [1],
|
|
5721
5854
|
"value": [1025],
|
|
5722
5855
|
"placeholder": [1],
|
|
5723
|
-
"name": [
|
|
5724
|
-
"disabled": [
|
|
5725
|
-
"required": [
|
|
5856
|
+
"name": [513],
|
|
5857
|
+
"disabled": [516],
|
|
5858
|
+
"required": [516],
|
|
5726
5859
|
"hint": [1],
|
|
5727
5860
|
"errorMessage": [1, "error-message"],
|
|
5728
|
-
"invalid": [4]
|
|
5861
|
+
"invalid": [4],
|
|
5862
|
+
"formDisabled": [32]
|
|
5729
5863
|
},
|
|
5730
5864
|
"$listeners$": undefined,
|
|
5731
5865
|
"$lazyBundleId$": "-",
|
|
5732
|
-
"$attrsToReflect$": []
|
|
5866
|
+
"$attrsToReflect$": [["name", "name"], ["disabled", "disabled"], ["required", "required"]]
|
|
5733
5867
|
}; }
|
|
5734
5868
|
}
|
|
5735
5869
|
|
|
@@ -5976,18 +6110,29 @@ class ChModal {
|
|
|
5976
6110
|
}; }
|
|
5977
6111
|
}
|
|
5978
6112
|
|
|
5979
|
-
const chRadioCss = () => `:host{display:inline-block}.group-label{display:block;margin-bottom:var(--spacing-sm);font-size:var(--typography-size-sm);font-weight:var(--typography-weight-semibold);color:var(--text)}.radio-group{display:flex;flex-direction:column;gap:var(--spacing-lg)}.control{display:inline-flex;align-items:center;gap:var(--spacing-lg);cursor:pointer}.control--disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.input{appearance:none;-webkit-appearance:none;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--spacing-4xl);height:var(--spacing-4xl);margin:0;flex-shrink:0;border:var(--border-width) solid var(--border);border-radius:50%;background:var(--surface);cursor:pointer;transition:border-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.input:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.input:checked{border-color:var(--accent)}.input:checked::before{content:'';width:var(--spacing-md);height:var(--spacing-md);border-radius:50%;background:var(--accent)}.input--invalid{border-color:var(--color-status-warning)}.input--invalid:focus-visible{outline-color:var(--color-status-warning)}.label-text{color:var(--text)}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;
|
|
6113
|
+
const chRadioCss = () => `:host{display:inline-block}.group-label{display:block;margin-bottom:var(--spacing-sm);font-size:var(--typography-size-sm);font-weight:var(--typography-weight-semibold);color:var(--text)}.radio-group{display:flex;flex-direction:column;gap:var(--spacing-lg)}.control{display:inline-flex;align-items:center;gap:var(--spacing-lg);cursor:pointer}.control--disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.input{appearance:none;-webkit-appearance:none;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--spacing-4xl);height:var(--spacing-4xl);margin:0;flex-shrink:0;border:var(--border-width) solid var(--border);border-radius:50%;background:var(--surface);cursor:pointer;transition:border-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.input:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.input:checked{border-color:var(--accent)}.input:checked::before{content:'';width:var(--spacing-md);height:var(--spacing-md);border-radius:50%;background:var(--accent)}.input--invalid{border-color:var(--color-status-warning)}.input--invalid:focus-visible{outline-color:var(--color-status-warning)}:host([data-touched]:invalid) .input,:host(:user-invalid) .input{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .input:focus-visible,:host(:user-invalid) .input:focus-visible{outline-color:var(--color-status-warning)}.label-text{color:var(--text)}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;
|
|
5980
6114
|
|
|
5981
6115
|
let radioIds = 0;
|
|
5982
6116
|
class ChRadio {
|
|
5983
6117
|
constructor(hostRef) {
|
|
5984
6118
|
registerInstance(this, hostRef);
|
|
5985
6119
|
this.chChange = createEvent(this, "chChange");
|
|
6120
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
6121
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
6122
|
+
}
|
|
6123
|
+
else {
|
|
6124
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
6125
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
6126
|
+
}
|
|
5986
6127
|
}
|
|
5987
6128
|
groupId = `ch-radio-${++radioIds}`;
|
|
5988
6129
|
labelId = `${this.groupId}-label`;
|
|
5989
6130
|
hintId = `${this.groupId}-hint`;
|
|
5990
6131
|
errorId = `${this.groupId}-error`;
|
|
6132
|
+
initialValue;
|
|
6133
|
+
internals;
|
|
6134
|
+
formDisabled = false;
|
|
6135
|
+
get host() { return getElement(this); }
|
|
5991
6136
|
/**
|
|
5992
6137
|
* Visible label describing the radio group, associated with it via
|
|
5993
6138
|
* `aria-labelledby`.
|
|
@@ -6035,6 +6180,39 @@ class ChRadio {
|
|
|
6035
6180
|
this.value = ev.target.value;
|
|
6036
6181
|
this.chChange.emit(this.value);
|
|
6037
6182
|
};
|
|
6183
|
+
syncForm() {
|
|
6184
|
+
const internals = this.internals;
|
|
6185
|
+
if (typeof internals?.setFormValue !== 'function') {
|
|
6186
|
+
return;
|
|
6187
|
+
}
|
|
6188
|
+
internals.setFormValue(this.value ?? null);
|
|
6189
|
+
const flags = {};
|
|
6190
|
+
let message;
|
|
6191
|
+
if (this.required && !this.value) {
|
|
6192
|
+
flags.valueMissing = true;
|
|
6193
|
+
}
|
|
6194
|
+
if (this.invalid && this.errorMessage) {
|
|
6195
|
+
flags.customError = true;
|
|
6196
|
+
}
|
|
6197
|
+
message = this.errorMessage ?? (flags.valueMissing ? 'Please fill out this field.' : undefined);
|
|
6198
|
+
internals.setValidity(flags, message);
|
|
6199
|
+
}
|
|
6200
|
+
componentDidLoad() {
|
|
6201
|
+
this.initialValue = this.value;
|
|
6202
|
+
this.syncForm();
|
|
6203
|
+
this.host.addEventListener('change', this.markTouched);
|
|
6204
|
+
this.host.addEventListener('focusout', this.markTouched);
|
|
6205
|
+
this.host.addEventListener('invalid', this.markTouched);
|
|
6206
|
+
}
|
|
6207
|
+
markTouched = () => {
|
|
6208
|
+
this.host.setAttribute('data-touched', '');
|
|
6209
|
+
};
|
|
6210
|
+
formResetCallback() {
|
|
6211
|
+
this.value = this.initialValue;
|
|
6212
|
+
}
|
|
6213
|
+
formDisabledCallback(isDisabled) {
|
|
6214
|
+
this.formDisabled = isDisabled;
|
|
6215
|
+
}
|
|
6038
6216
|
get describedBy() {
|
|
6039
6217
|
if (this.invalid && this.errorMessage) {
|
|
6040
6218
|
return this.errorId;
|
|
@@ -6046,40 +6224,67 @@ class ChRadio {
|
|
|
6046
6224
|
}
|
|
6047
6225
|
render() {
|
|
6048
6226
|
const groupName = this.name || `${this.groupId}-group`;
|
|
6049
|
-
return (hAsync(Host, { key: '
|
|
6227
|
+
return (hAsync(Host, { key: '1a2562301b8daf00c557764c7f4cdfd54e6e11ef' }, this.label && (hAsync("span", { key: '873958acd3422069572031d59be22c06e3e705a6', class: "group-label", id: this.labelId }, this.label)), hAsync("div", { key: '860c71f128b6fb84dce3c14d2086fd77cc1a4a1e', class: "radio-group", role: "radiogroup", "aria-labelledby": this.label ? this.labelId : undefined }, this.options.map(option => (hAsync("label", { class: { 'control': true, 'control--disabled': this.disabled || this.formDisabled || option.disabled } }, hAsync("input", { class: { 'input': true, 'input--invalid': this.invalid }, type: "radio", name: groupName, value: option.value, checked: option.value === this.value, disabled: this.disabled || this.formDisabled || option.disabled, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onChange: this.handleChange }), hAsync("span", { class: "mark" }), hAsync("span", { class: "label-text" }, option.label))))), this.hint && !(this.invalid && this.errorMessage) && (hAsync("p", { key: '2b358f659d1ef21b1e90ecb67c41d6a0054806e3', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (hAsync("p", { key: '4e60f0303e42668c4532f076143a47daa216dff8', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
6050
6228
|
}
|
|
6229
|
+
static get formAssociated() { return true; }
|
|
6230
|
+
static get watchers() { return {
|
|
6231
|
+
"value": [{
|
|
6232
|
+
"syncForm": 0
|
|
6233
|
+
}],
|
|
6234
|
+
"required": [{
|
|
6235
|
+
"syncForm": 0
|
|
6236
|
+
}],
|
|
6237
|
+
"invalid": [{
|
|
6238
|
+
"syncForm": 0
|
|
6239
|
+
}],
|
|
6240
|
+
"errorMessage": [{
|
|
6241
|
+
"syncForm": 0
|
|
6242
|
+
}]
|
|
6243
|
+
}; }
|
|
6051
6244
|
static get style() { return chRadioCss(); }
|
|
6052
6245
|
static get cmpMeta() { return {
|
|
6053
|
-
"$flags$":
|
|
6246
|
+
"$flags$": 585,
|
|
6054
6247
|
"$tagName$": "ch-radio",
|
|
6055
6248
|
"$members$": {
|
|
6056
6249
|
"label": [1],
|
|
6057
6250
|
"options": [16],
|
|
6058
6251
|
"value": [1025],
|
|
6059
|
-
"name": [
|
|
6060
|
-
"disabled": [
|
|
6061
|
-
"required": [
|
|
6252
|
+
"name": [513],
|
|
6253
|
+
"disabled": [516],
|
|
6254
|
+
"required": [516],
|
|
6062
6255
|
"hint": [1],
|
|
6063
6256
|
"errorMessage": [1, "error-message"],
|
|
6064
|
-
"invalid": [4]
|
|
6257
|
+
"invalid": [4],
|
|
6258
|
+
"formDisabled": [32]
|
|
6065
6259
|
},
|
|
6066
6260
|
"$listeners$": undefined,
|
|
6067
6261
|
"$lazyBundleId$": "-",
|
|
6068
|
-
"$attrsToReflect$": []
|
|
6262
|
+
"$attrsToReflect$": [["name", "name"], ["disabled", "disabled"], ["required", "required"]]
|
|
6069
6263
|
}; }
|
|
6070
6264
|
}
|
|
6071
6265
|
|
|
6072
|
-
const chSelectCss = () => `:host{display:inline-block;width:100%}.label{display:block;margin-bottom:var(--spacing-sm);font-size:var(--typography-size-sm);font-weight:var(--typography-weight-semibold);color:var(--text)}.select{box-sizing:border-box;width:100%;padding:var(--spacing-xl) var(--spacing-3xl);border-radius:var(--radius);border:var(--border-width) solid var(--border);background:var(--surface);color:var(--text);backdrop-filter:blur(var(--effect-blur));font-family:inherit;font-size:inherit;cursor:pointer;transition:border-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.select:focus{border-color:var(--accent);box-shadow:var(--shadow-focus-ring);outline:none}.select--invalid{border-color:var(--color-status-warning)}.select--invalid:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}.select:disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.select option{background:var(--bg);color:var(--text)}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;
|
|
6266
|
+
const chSelectCss = () => `:host{display:inline-block;width:100%}.label{display:block;margin-bottom:var(--spacing-sm);font-size:var(--typography-size-sm);font-weight:var(--typography-weight-semibold);color:var(--text)}.select{box-sizing:border-box;width:100%;padding:var(--spacing-xl) var(--spacing-3xl);border-radius:var(--radius);border:var(--border-width) solid var(--border);background:var(--surface);color:var(--text);backdrop-filter:blur(var(--effect-blur));font-family:inherit;font-size:inherit;cursor:pointer;transition:border-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.select:focus{border-color:var(--accent);box-shadow:var(--shadow-focus-ring);outline:none}.select--invalid{border-color:var(--color-status-warning)}.select--invalid:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}:host([data-touched]:invalid) .select,:host(:user-invalid) .select{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .select:focus,:host(:user-invalid) .select:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}.select:disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.select option{background:var(--bg);color:var(--text)}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;
|
|
6073
6267
|
|
|
6074
6268
|
let selectIds = 0;
|
|
6075
6269
|
class ChSelect {
|
|
6076
6270
|
constructor(hostRef) {
|
|
6077
6271
|
registerInstance(this, hostRef);
|
|
6078
6272
|
this.chChange = createEvent(this, "chChange");
|
|
6273
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
6274
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
6275
|
+
}
|
|
6276
|
+
else {
|
|
6277
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
6278
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
6279
|
+
}
|
|
6079
6280
|
}
|
|
6080
6281
|
selectId = `ch-select-${++selectIds}`;
|
|
6081
6282
|
hintId = `${this.selectId}-hint`;
|
|
6082
6283
|
errorId = `${this.selectId}-error`;
|
|
6284
|
+
initialValue;
|
|
6285
|
+
internals;
|
|
6286
|
+
formDisabled = false;
|
|
6287
|
+
get host() { return getElement(this); }
|
|
6083
6288
|
/**
|
|
6084
6289
|
* Visible label rendered above the select and associated with it via
|
|
6085
6290
|
* `for`/`id`, so assistive technology announces the select's purpose.
|
|
@@ -6130,6 +6335,39 @@ class ChSelect {
|
|
|
6130
6335
|
this.value = ev.target.value;
|
|
6131
6336
|
this.chChange.emit(this.value);
|
|
6132
6337
|
};
|
|
6338
|
+
syncForm() {
|
|
6339
|
+
const internals = this.internals;
|
|
6340
|
+
if (typeof internals?.setFormValue !== 'function') {
|
|
6341
|
+
return;
|
|
6342
|
+
}
|
|
6343
|
+
internals.setFormValue(this.value ?? '');
|
|
6344
|
+
const flags = {};
|
|
6345
|
+
let message;
|
|
6346
|
+
if (this.required && !this.value) {
|
|
6347
|
+
flags.valueMissing = true;
|
|
6348
|
+
}
|
|
6349
|
+
if (this.invalid && this.errorMessage) {
|
|
6350
|
+
flags.customError = true;
|
|
6351
|
+
}
|
|
6352
|
+
message = this.errorMessage ?? (flags.valueMissing ? 'Please fill out this field.' : undefined);
|
|
6353
|
+
internals.setValidity(flags, message);
|
|
6354
|
+
}
|
|
6355
|
+
componentDidLoad() {
|
|
6356
|
+
this.initialValue = this.value;
|
|
6357
|
+
this.syncForm();
|
|
6358
|
+
this.host.addEventListener('change', this.markTouched);
|
|
6359
|
+
this.host.addEventListener('focusout', this.markTouched);
|
|
6360
|
+
this.host.addEventListener('invalid', this.markTouched);
|
|
6361
|
+
}
|
|
6362
|
+
markTouched = () => {
|
|
6363
|
+
this.host.setAttribute('data-touched', '');
|
|
6364
|
+
};
|
|
6365
|
+
formResetCallback() {
|
|
6366
|
+
this.value = this.initialValue;
|
|
6367
|
+
}
|
|
6368
|
+
formDisabledCallback(isDisabled) {
|
|
6369
|
+
this.formDisabled = isDisabled;
|
|
6370
|
+
}
|
|
6133
6371
|
get describedBy() {
|
|
6134
6372
|
if (this.invalid && this.errorMessage) {
|
|
6135
6373
|
return this.errorId;
|
|
@@ -6140,27 +6378,43 @@ class ChSelect {
|
|
|
6140
6378
|
return undefined;
|
|
6141
6379
|
}
|
|
6142
6380
|
render() {
|
|
6143
|
-
return (hAsync(Host, { key: '
|
|
6381
|
+
return (hAsync(Host, { key: 'b3336d43945543f23e903df41eaefef23fde6ff4' }, this.label && (hAsync("label", { key: '1928d359fce76001c24c969ccc59c5bc7c67e676', class: "label", htmlFor: this.selectId }, this.label)), hAsync("select", { key: '7896282971021ef35d9bd3926335e02bc0efc804', id: this.label ? this.selectId : undefined, class: { 'select': true, 'select--invalid': this.invalid }, name: this.name, disabled: this.disabled || this.formDisabled, required: this.required, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onChange: this.handleChange }, this.placeholder && (hAsync("option", { key: '4acfff84e5616092c6a8d0741cdf6bf959a4cfee', value: "", disabled: true, hidden: true, selected: !this.value }, this.placeholder)), this.options.map(option => (hAsync("option", { value: option.value, disabled: option.disabled, selected: option.value === this.value }, option.label)))), this.hint && !(this.invalid && this.errorMessage) && (hAsync("p", { key: 'cb079b5ed1a64e53b6bc3ba07f63dee0baa0f78f', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (hAsync("p", { key: '87e730d857a4a8c44378c98759ac8ecc7cfde366', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
6144
6382
|
}
|
|
6383
|
+
static get formAssociated() { return true; }
|
|
6384
|
+
static get watchers() { return {
|
|
6385
|
+
"value": [{
|
|
6386
|
+
"syncForm": 0
|
|
6387
|
+
}],
|
|
6388
|
+
"required": [{
|
|
6389
|
+
"syncForm": 0
|
|
6390
|
+
}],
|
|
6391
|
+
"invalid": [{
|
|
6392
|
+
"syncForm": 0
|
|
6393
|
+
}],
|
|
6394
|
+
"errorMessage": [{
|
|
6395
|
+
"syncForm": 0
|
|
6396
|
+
}]
|
|
6397
|
+
}; }
|
|
6145
6398
|
static get style() { return chSelectCss(); }
|
|
6146
6399
|
static get cmpMeta() { return {
|
|
6147
|
-
"$flags$":
|
|
6400
|
+
"$flags$": 585,
|
|
6148
6401
|
"$tagName$": "ch-select",
|
|
6149
6402
|
"$members$": {
|
|
6150
6403
|
"label": [1],
|
|
6151
6404
|
"options": [16],
|
|
6152
6405
|
"value": [1025],
|
|
6153
6406
|
"placeholder": [1],
|
|
6154
|
-
"name": [
|
|
6155
|
-
"disabled": [
|
|
6156
|
-
"required": [
|
|
6407
|
+
"name": [513],
|
|
6408
|
+
"disabled": [516],
|
|
6409
|
+
"required": [516],
|
|
6157
6410
|
"hint": [1],
|
|
6158
6411
|
"errorMessage": [1, "error-message"],
|
|
6159
|
-
"invalid": [4]
|
|
6412
|
+
"invalid": [4],
|
|
6413
|
+
"formDisabled": [32]
|
|
6160
6414
|
},
|
|
6161
6415
|
"$listeners$": undefined,
|
|
6162
6416
|
"$lazyBundleId$": "-",
|
|
6163
|
-
"$attrsToReflect$": []
|
|
6417
|
+
"$attrsToReflect$": [["name", "name"], ["disabled", "disabled"], ["required", "required"]]
|
|
6164
6418
|
}; }
|
|
6165
6419
|
}
|
|
6166
6420
|
|
|
@@ -6209,17 +6463,28 @@ class ChSpinner {
|
|
|
6209
6463
|
}; }
|
|
6210
6464
|
}
|
|
6211
6465
|
|
|
6212
|
-
const chSwitchCss = () => `:host{display:inline-block}.control{position:relative;display:inline-flex;align-items:center;gap:var(--spacing-lg);cursor:pointer}.control--disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}.input:focus-visible~.track{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.track{position:relative;box-sizing:border-box;width:var(--spacing-6xl);height:var(--spacing-5xl);flex-shrink:0;border:var(--border-width) solid var(--border);border-radius:var(--radius-pill);background:var(--surface);transition:border-color var(--duration-normal) var(--easing-default), background-color var(--duration-normal) var(--easing-default)}.thumb{position:absolute;top:50%;left:var(--spacing-2xs);width:var(--spacing-2xl);height:var(--spacing-2xl);border-radius:50%;background:var(--text-muted);transform:translateY(-50%);transition:left var(--duration-normal) var(--easing-default), background-color var(--duration-normal) var(--easing-default)}.input:checked~.track{border-color:var(--accent);background:var(--accent)}.input:checked~.track .thumb{left:calc(100% - var(--spacing-2xl) - var(--spacing-2xs));background:var(--color-accent-text)}.input--invalid~.track{border-color:var(--color-status-warning)}.input--invalid:focus-visible~.track{outline-color:var(--color-status-warning)}.label-text{color:var(--text)}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;
|
|
6466
|
+
const chSwitchCss = () => `:host{display:inline-block}.control{position:relative;display:inline-flex;align-items:center;gap:var(--spacing-lg);cursor:pointer}.control--disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}.input:focus-visible~.track{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.track{position:relative;box-sizing:border-box;width:var(--spacing-6xl);height:var(--spacing-5xl);flex-shrink:0;border:var(--border-width) solid var(--border);border-radius:var(--radius-pill);background:var(--surface);transition:border-color var(--duration-normal) var(--easing-default), background-color var(--duration-normal) var(--easing-default)}.thumb{position:absolute;top:50%;left:var(--spacing-2xs);width:var(--spacing-2xl);height:var(--spacing-2xl);border-radius:50%;background:var(--text-muted);transform:translateY(-50%);transition:left var(--duration-normal) var(--easing-default), background-color var(--duration-normal) var(--easing-default)}.input:checked~.track{border-color:var(--accent);background:var(--accent)}.input:checked~.track .thumb{left:calc(100% - var(--spacing-2xl) - var(--spacing-2xs));background:var(--color-accent-text)}.input--invalid~.track{border-color:var(--color-status-warning)}.input--invalid:focus-visible~.track{outline-color:var(--color-status-warning)}:host([data-touched]:invalid) .track,:host(:user-invalid) .track{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .input:focus-visible~.track,:host(:user-invalid) .input:focus-visible~.track{outline-color:var(--color-status-warning)}.label-text{color:var(--text)}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;
|
|
6213
6467
|
|
|
6214
6468
|
let switchIds = 0;
|
|
6215
6469
|
class ChSwitch {
|
|
6216
6470
|
constructor(hostRef) {
|
|
6217
6471
|
registerInstance(this, hostRef);
|
|
6218
6472
|
this.chChange = createEvent(this, "chChange");
|
|
6473
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
6474
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
6475
|
+
}
|
|
6476
|
+
else {
|
|
6477
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
6478
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
6479
|
+
}
|
|
6219
6480
|
}
|
|
6220
6481
|
switchId = `ch-switch-${++switchIds}`;
|
|
6221
6482
|
hintId = `${this.switchId}-hint`;
|
|
6222
6483
|
errorId = `${this.switchId}-error`;
|
|
6484
|
+
initialChecked = false;
|
|
6485
|
+
internals;
|
|
6486
|
+
formDisabled = false;
|
|
6487
|
+
get host() { return getElement(this); }
|
|
6223
6488
|
/**
|
|
6224
6489
|
* Visible label rendered next to the switch, associated with it via
|
|
6225
6490
|
* `for`/`id`, so assistive technology announces the switch's purpose.
|
|
@@ -6266,6 +6531,39 @@ class ChSwitch {
|
|
|
6266
6531
|
this.checked = ev.target.checked;
|
|
6267
6532
|
this.chChange.emit(this.checked);
|
|
6268
6533
|
};
|
|
6534
|
+
syncForm() {
|
|
6535
|
+
const internals = this.internals;
|
|
6536
|
+
if (typeof internals?.setFormValue !== 'function') {
|
|
6537
|
+
return;
|
|
6538
|
+
}
|
|
6539
|
+
internals.setFormValue(this.checked ? this.value : null);
|
|
6540
|
+
const flags = {};
|
|
6541
|
+
let message;
|
|
6542
|
+
if (this.required && !this.checked) {
|
|
6543
|
+
flags.valueMissing = true;
|
|
6544
|
+
}
|
|
6545
|
+
if (this.invalid && this.errorMessage) {
|
|
6546
|
+
flags.customError = true;
|
|
6547
|
+
}
|
|
6548
|
+
message = this.errorMessage ?? (flags.valueMissing ? 'Please fill out this field.' : undefined);
|
|
6549
|
+
internals.setValidity(flags, message);
|
|
6550
|
+
}
|
|
6551
|
+
componentDidLoad() {
|
|
6552
|
+
this.initialChecked = this.checked;
|
|
6553
|
+
this.syncForm();
|
|
6554
|
+
this.host.addEventListener('change', this.markTouched);
|
|
6555
|
+
this.host.addEventListener('focusout', this.markTouched);
|
|
6556
|
+
this.host.addEventListener('invalid', this.markTouched);
|
|
6557
|
+
}
|
|
6558
|
+
markTouched = () => {
|
|
6559
|
+
this.host.setAttribute('data-touched', '');
|
|
6560
|
+
};
|
|
6561
|
+
formResetCallback() {
|
|
6562
|
+
this.checked = this.initialChecked;
|
|
6563
|
+
}
|
|
6564
|
+
formDisabledCallback(isDisabled) {
|
|
6565
|
+
this.formDisabled = isDisabled;
|
|
6566
|
+
}
|
|
6269
6567
|
get describedBy() {
|
|
6270
6568
|
if (this.invalid && this.errorMessage) {
|
|
6271
6569
|
return this.errorId;
|
|
@@ -6276,26 +6574,42 @@ class ChSwitch {
|
|
|
6276
6574
|
return undefined;
|
|
6277
6575
|
}
|
|
6278
6576
|
render() {
|
|
6279
|
-
return (hAsync(Host, { key: '
|
|
6577
|
+
return (hAsync(Host, { key: '1f868bf2f0a95e5eb0b0013de2a1414034a0af78' }, hAsync("label", { key: 'bfa3ff8ca66a9c367882808718b882bb1679d5fd', class: { 'control': true, 'control--disabled': this.disabled || this.formDisabled }, htmlFor: this.switchId }, hAsync("input", { key: '49d10196b6df781b1e76d0b33118cc21294136f4', id: this.switchId, class: { 'input': true, 'input--invalid': this.invalid }, type: "checkbox", role: "switch", name: this.name, value: this.value, checked: this.checked, disabled: this.disabled || this.formDisabled, required: this.required, "aria-checked": this.checked ? 'true' : 'false', "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onChange: this.handleChange }), hAsync("span", { key: '79948dc41567e2c52023e1c0ddd17888b4a04335', class: "track" }, hAsync("span", { key: 'd07b297ff5edd963954e4ab2b7e678176a1823f6', class: "thumb" })), this.label && hAsync("span", { key: '33695230dab7fc68c0dc1b06cc21b7f8bf7bb1ec', class: "label-text" }, this.label)), this.hint && !(this.invalid && this.errorMessage) && (hAsync("p", { key: '3be08bad4526e8c1adde62a154654079b17d6910', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (hAsync("p", { key: '623cff85e039ecb640238d9e41fd3aa82c671ddd', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
6280
6578
|
}
|
|
6579
|
+
static get formAssociated() { return true; }
|
|
6580
|
+
static get watchers() { return {
|
|
6581
|
+
"checked": [{
|
|
6582
|
+
"syncForm": 0
|
|
6583
|
+
}],
|
|
6584
|
+
"required": [{
|
|
6585
|
+
"syncForm": 0
|
|
6586
|
+
}],
|
|
6587
|
+
"invalid": [{
|
|
6588
|
+
"syncForm": 0
|
|
6589
|
+
}],
|
|
6590
|
+
"errorMessage": [{
|
|
6591
|
+
"syncForm": 0
|
|
6592
|
+
}]
|
|
6593
|
+
}; }
|
|
6281
6594
|
static get style() { return chSwitchCss(); }
|
|
6282
6595
|
static get cmpMeta() { return {
|
|
6283
|
-
"$flags$":
|
|
6596
|
+
"$flags$": 585,
|
|
6284
6597
|
"$tagName$": "ch-switch",
|
|
6285
6598
|
"$members$": {
|
|
6286
6599
|
"label": [1],
|
|
6287
|
-
"name": [
|
|
6600
|
+
"name": [513],
|
|
6288
6601
|
"value": [1],
|
|
6289
6602
|
"checked": [1028],
|
|
6290
|
-
"disabled": [
|
|
6291
|
-
"required": [
|
|
6603
|
+
"disabled": [516],
|
|
6604
|
+
"required": [516],
|
|
6292
6605
|
"hint": [1],
|
|
6293
6606
|
"errorMessage": [1, "error-message"],
|
|
6294
|
-
"invalid": [4]
|
|
6607
|
+
"invalid": [4],
|
|
6608
|
+
"formDisabled": [32]
|
|
6295
6609
|
},
|
|
6296
6610
|
"$listeners$": undefined,
|
|
6297
6611
|
"$lazyBundleId$": "-",
|
|
6298
|
-
"$attrsToReflect$": []
|
|
6612
|
+
"$attrsToReflect$": [["name", "name"], ["disabled", "disabled"], ["required", "required"]]
|
|
6299
6613
|
}; }
|
|
6300
6614
|
}
|
|
6301
6615
|
|
|
@@ -6403,7 +6717,7 @@ class ChTabs {
|
|
|
6403
6717
|
}; }
|
|
6404
6718
|
}
|
|
6405
6719
|
|
|
6406
|
-
const chTextareaCss = () => `:host{display:inline-block;width:100%}.label{display:block;margin-bottom:var(--spacing-sm);font-size:var(--typography-size-sm);font-weight:var(--typography-weight-semibold);color:var(--text)}.textarea{box-sizing:border-box;width:100%;min-height:var(--spacing-6xl);padding:var(--spacing-xl) var(--spacing-3xl);border-radius:var(--radius);border:var(--border-width) solid var(--border);background:var(--surface);color:var(--text);backdrop-filter:blur(var(--effect-blur));font-family:inherit;font-size:inherit;line-height:var(--spacing-5xl);resize:vertical;transition:border-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.textarea::placeholder{color:var(--text-muted)}.textarea:focus{border-color:var(--accent);box-shadow:var(--shadow-focus-ring);outline:none}.textarea--invalid{border-color:var(--color-status-warning)}.textarea--invalid:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}.textarea:disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;
|
|
6720
|
+
const chTextareaCss = () => `:host{display:inline-block;width:100%}.label{display:block;margin-bottom:var(--spacing-sm);font-size:var(--typography-size-sm);font-weight:var(--typography-weight-semibold);color:var(--text)}.textarea{box-sizing:border-box;width:100%;min-height:var(--spacing-6xl);padding:var(--spacing-xl) var(--spacing-3xl);border-radius:var(--radius);border:var(--border-width) solid var(--border);background:var(--surface);color:var(--text);backdrop-filter:blur(var(--effect-blur));font-family:inherit;font-size:inherit;line-height:var(--spacing-5xl);resize:vertical;transition:border-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.textarea::placeholder{color:var(--text-muted)}.textarea:focus{border-color:var(--accent);box-shadow:var(--shadow-focus-ring);outline:none}.textarea--invalid{border-color:var(--color-status-warning)}.textarea--invalid:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}:host([data-touched]:invalid) .textarea,:host(:user-invalid) .textarea{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .textarea:focus,:host(:user-invalid) .textarea:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}.textarea:disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;
|
|
6407
6721
|
|
|
6408
6722
|
let textareaIds = 0;
|
|
6409
6723
|
const DEFAULT_ROWS = 4;
|
|
@@ -6412,10 +6726,21 @@ class ChTextarea {
|
|
|
6412
6726
|
registerInstance(this, hostRef);
|
|
6413
6727
|
this.chInput = createEvent(this, "chInput");
|
|
6414
6728
|
this.chChange = createEvent(this, "chChange");
|
|
6729
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
6730
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
6731
|
+
}
|
|
6732
|
+
else {
|
|
6733
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
6734
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
6735
|
+
}
|
|
6415
6736
|
}
|
|
6416
6737
|
textareaId = `ch-textarea-${++textareaIds}`;
|
|
6417
6738
|
hintId = `${this.textareaId}-hint`;
|
|
6418
6739
|
errorId = `${this.textareaId}-error`;
|
|
6740
|
+
initialValue = '';
|
|
6741
|
+
internals;
|
|
6742
|
+
formDisabled = false;
|
|
6743
|
+
get host() { return getElement(this); }
|
|
6419
6744
|
/**
|
|
6420
6745
|
* Visible label rendered above the textarea and associated with it via
|
|
6421
6746
|
* `for`/`id`, so assistive technology announces the textarea's purpose.
|
|
@@ -6474,6 +6799,39 @@ class ChTextarea {
|
|
|
6474
6799
|
this.value = ev.target.value;
|
|
6475
6800
|
this.chChange.emit(this.value);
|
|
6476
6801
|
};
|
|
6802
|
+
syncForm() {
|
|
6803
|
+
const internals = this.internals;
|
|
6804
|
+
if (typeof internals?.setFormValue !== 'function') {
|
|
6805
|
+
return;
|
|
6806
|
+
}
|
|
6807
|
+
internals.setFormValue(this.value);
|
|
6808
|
+
const flags = {};
|
|
6809
|
+
let message;
|
|
6810
|
+
if (this.required && this.value === '') {
|
|
6811
|
+
flags.valueMissing = true;
|
|
6812
|
+
}
|
|
6813
|
+
if (this.invalid && this.errorMessage) {
|
|
6814
|
+
flags.customError = true;
|
|
6815
|
+
}
|
|
6816
|
+
message = this.errorMessage ?? (flags.valueMissing ? 'Please fill out this field.' : undefined);
|
|
6817
|
+
internals.setValidity(flags, message);
|
|
6818
|
+
}
|
|
6819
|
+
componentDidLoad() {
|
|
6820
|
+
this.initialValue = this.value;
|
|
6821
|
+
this.syncForm();
|
|
6822
|
+
this.host.addEventListener('change', this.markTouched);
|
|
6823
|
+
this.host.addEventListener('focusout', this.markTouched);
|
|
6824
|
+
this.host.addEventListener('invalid', this.markTouched);
|
|
6825
|
+
}
|
|
6826
|
+
markTouched = () => {
|
|
6827
|
+
this.host.setAttribute('data-touched', '');
|
|
6828
|
+
};
|
|
6829
|
+
formResetCallback() {
|
|
6830
|
+
this.value = this.initialValue;
|
|
6831
|
+
}
|
|
6832
|
+
formDisabledCallback(isDisabled) {
|
|
6833
|
+
this.formDisabled = isDisabled;
|
|
6834
|
+
}
|
|
6477
6835
|
get describedBy() {
|
|
6478
6836
|
if (this.invalid && this.errorMessage) {
|
|
6479
6837
|
return this.errorId;
|
|
@@ -6484,27 +6842,43 @@ class ChTextarea {
|
|
|
6484
6842
|
return undefined;
|
|
6485
6843
|
}
|
|
6486
6844
|
render() {
|
|
6487
|
-
return (hAsync(Host, { key: '
|
|
6845
|
+
return (hAsync(Host, { key: 'de54ff9593c43939689cfbe2e13de538fcc7c022' }, this.label && (hAsync("label", { key: 'bfab3a6e82c1dbb03bd8f3477e6def631eca2e26', class: "label", htmlFor: this.textareaId }, this.label)), hAsync("textarea", { key: 'a2de483052ac7849f9f7ff61b4052d068cf7fcf6', id: this.label ? this.textareaId : undefined, class: { 'textarea': true, 'textarea--invalid': this.invalid }, rows: this.rows, name: this.name, placeholder: this.placeholder, disabled: this.disabled || this.formDisabled, required: this.required, value: this.value, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onInput: this.handleInput, onChange: this.handleChange }), this.hint && !(this.invalid && this.errorMessage) && (hAsync("p", { key: '80e2a1a36274eaff1609b60882dee02c34138687', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (hAsync("p", { key: 'b086d35f6579c56debdb8445aefa79ae953c8734', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
6488
6846
|
}
|
|
6847
|
+
static get formAssociated() { return true; }
|
|
6848
|
+
static get watchers() { return {
|
|
6849
|
+
"value": [{
|
|
6850
|
+
"syncForm": 0
|
|
6851
|
+
}],
|
|
6852
|
+
"required": [{
|
|
6853
|
+
"syncForm": 0
|
|
6854
|
+
}],
|
|
6855
|
+
"invalid": [{
|
|
6856
|
+
"syncForm": 0
|
|
6857
|
+
}],
|
|
6858
|
+
"errorMessage": [{
|
|
6859
|
+
"syncForm": 0
|
|
6860
|
+
}]
|
|
6861
|
+
}; }
|
|
6489
6862
|
static get style() { return chTextareaCss(); }
|
|
6490
6863
|
static get cmpMeta() { return {
|
|
6491
|
-
"$flags$":
|
|
6864
|
+
"$flags$": 585,
|
|
6492
6865
|
"$tagName$": "ch-textarea",
|
|
6493
6866
|
"$members$": {
|
|
6494
6867
|
"label": [1],
|
|
6495
6868
|
"value": [1025],
|
|
6496
6869
|
"placeholder": [1],
|
|
6497
6870
|
"rows": [2],
|
|
6498
|
-
"name": [
|
|
6499
|
-
"disabled": [
|
|
6500
|
-
"required": [
|
|
6871
|
+
"name": [513],
|
|
6872
|
+
"disabled": [516],
|
|
6873
|
+
"required": [516],
|
|
6501
6874
|
"hint": [1],
|
|
6502
6875
|
"errorMessage": [1, "error-message"],
|
|
6503
|
-
"invalid": [4]
|
|
6876
|
+
"invalid": [4],
|
|
6877
|
+
"formDisabled": [32]
|
|
6504
6878
|
},
|
|
6505
6879
|
"$listeners$": undefined,
|
|
6506
6880
|
"$lazyBundleId$": "-",
|
|
6507
|
-
"$attrsToReflect$": []
|
|
6881
|
+
"$attrsToReflect$": [["name", "name"], ["disabled", "disabled"], ["required", "required"]]
|
|
6508
6882
|
}; }
|
|
6509
6883
|
}
|
|
6510
6884
|
|