@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.mjs
CHANGED
|
@@ -1779,7 +1779,9 @@ var parsePropertyValue = (propValue, propType, isFormAssociated) => {
|
|
|
1779
1779
|
}
|
|
1780
1780
|
if (propValue != null && !isComplexType(propValue)) {
|
|
1781
1781
|
if (propType & 4 /* Boolean */) {
|
|
1782
|
-
{
|
|
1782
|
+
if (isFormAssociated && typeof propValue === "string") {
|
|
1783
|
+
return propValue === "" || !!propValue;
|
|
1784
|
+
} else {
|
|
1783
1785
|
return propValue === "false" ? false : propValue === "" || !!propValue;
|
|
1784
1786
|
}
|
|
1785
1787
|
}
|
|
@@ -2414,6 +2416,14 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
2414
2416
|
const isHostElement = isHost(renderFnResults);
|
|
2415
2417
|
const rootVnode = isHostElement ? renderFnResults : h(null, null, renderFnResults);
|
|
2416
2418
|
hostTagName = hostElm.tagName;
|
|
2419
|
+
if (cmpMeta.$attrsToReflect$) {
|
|
2420
|
+
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
|
2421
|
+
cmpMeta.$attrsToReflect$.forEach(([propName, attribute]) => {
|
|
2422
|
+
{
|
|
2423
|
+
rootVnode.$attrs$[attribute] = hostElm[propName];
|
|
2424
|
+
}
|
|
2425
|
+
});
|
|
2426
|
+
}
|
|
2417
2427
|
if (isInitialLoad && rootVnode.$attrs$) {
|
|
2418
2428
|
for (const key of Object.keys(rootVnode.$attrs$)) {
|
|
2419
2429
|
if (hostElm.hasAttribute(key) && !["key", "ref", "style", "class"].includes(key)) {
|
|
@@ -2748,7 +2758,9 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
2748
2758
|
const instance = hostRef.$lazyInstance$ ;
|
|
2749
2759
|
newVal = parsePropertyValue(
|
|
2750
2760
|
newVal,
|
|
2751
|
-
cmpMeta.$members$[propName][0]
|
|
2761
|
+
cmpMeta.$members$[propName][0],
|
|
2762
|
+
!!(cmpMeta.$flags$ & 64 /* formAssociated */)
|
|
2763
|
+
);
|
|
2752
2764
|
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
2753
2765
|
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
2754
2766
|
if ((!(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
|
|
@@ -2841,7 +2853,9 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
2841
2853
|
origSetter.apply(this, [
|
|
2842
2854
|
parsePropertyValue(
|
|
2843
2855
|
newValue,
|
|
2844
|
-
memberFlags
|
|
2856
|
+
memberFlags,
|
|
2857
|
+
!!(cmpMeta.$flags$ & 64 /* formAssociated */)
|
|
2858
|
+
)
|
|
2845
2859
|
]);
|
|
2846
2860
|
newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
2847
2861
|
setValue(this, memberName, newValue, cmpMeta);
|
|
@@ -4872,7 +4886,7 @@ function proxyHostElement(elm, cstr) {
|
|
|
4872
4886
|
attrPropVal = cstr.prototype[methodName](attrValue, memberName);
|
|
4873
4887
|
}
|
|
4874
4888
|
} else {
|
|
4875
|
-
attrPropVal = parsePropertyValue(attrValue, memberFlags);
|
|
4889
|
+
attrPropVal = parsePropertyValue(attrValue, memberFlags, !!(cmpMeta.$flags$ & 64 /* formAssociated */));
|
|
4876
4890
|
}
|
|
4877
4891
|
}
|
|
4878
4892
|
if (propValue !== void 0) {
|
|
@@ -5511,17 +5525,28 @@ class ChCard {
|
|
|
5511
5525
|
}; }
|
|
5512
5526
|
}
|
|
5513
5527
|
|
|
5514
|
-
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)}`;
|
|
5528
|
+
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)}`;
|
|
5515
5529
|
|
|
5516
5530
|
let checkboxIds = 0;
|
|
5517
5531
|
class ChCheckbox {
|
|
5518
5532
|
constructor(hostRef) {
|
|
5519
5533
|
registerInstance(this, hostRef);
|
|
5520
5534
|
this.chChange = createEvent(this, "chChange");
|
|
5535
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
5536
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
5537
|
+
}
|
|
5538
|
+
else {
|
|
5539
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
5540
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
5541
|
+
}
|
|
5521
5542
|
}
|
|
5522
5543
|
checkboxId = `ch-checkbox-${++checkboxIds}`;
|
|
5523
5544
|
hintId = `${this.checkboxId}-hint`;
|
|
5524
5545
|
errorId = `${this.checkboxId}-error`;
|
|
5546
|
+
initialChecked = false;
|
|
5547
|
+
internals;
|
|
5548
|
+
formDisabled = false;
|
|
5549
|
+
get host() { return getElement(this); }
|
|
5525
5550
|
/**
|
|
5526
5551
|
* Visible label rendered next to the checkbox, associated with it via
|
|
5527
5552
|
* `for`/`id`, so assistive technology announces the checkbox's purpose.
|
|
@@ -5568,6 +5593,39 @@ class ChCheckbox {
|
|
|
5568
5593
|
this.checked = ev.target.checked;
|
|
5569
5594
|
this.chChange.emit(this.checked);
|
|
5570
5595
|
};
|
|
5596
|
+
syncForm() {
|
|
5597
|
+
const internals = this.internals;
|
|
5598
|
+
if (typeof internals?.setFormValue !== 'function') {
|
|
5599
|
+
return;
|
|
5600
|
+
}
|
|
5601
|
+
internals.setFormValue(this.checked ? this.value : null);
|
|
5602
|
+
const flags = {};
|
|
5603
|
+
let message;
|
|
5604
|
+
if (this.required && !this.checked) {
|
|
5605
|
+
flags.valueMissing = true;
|
|
5606
|
+
}
|
|
5607
|
+
if (this.invalid && this.errorMessage) {
|
|
5608
|
+
flags.customError = true;
|
|
5609
|
+
}
|
|
5610
|
+
message = this.errorMessage ?? (flags.valueMissing ? 'Please fill out this field.' : undefined);
|
|
5611
|
+
internals.setValidity(flags, message);
|
|
5612
|
+
}
|
|
5613
|
+
componentDidLoad() {
|
|
5614
|
+
this.initialChecked = this.checked;
|
|
5615
|
+
this.syncForm();
|
|
5616
|
+
this.host.addEventListener('change', this.markTouched);
|
|
5617
|
+
this.host.addEventListener('focusout', this.markTouched);
|
|
5618
|
+
this.host.addEventListener('invalid', this.markTouched);
|
|
5619
|
+
}
|
|
5620
|
+
markTouched = () => {
|
|
5621
|
+
this.host.setAttribute('data-touched', '');
|
|
5622
|
+
};
|
|
5623
|
+
formResetCallback() {
|
|
5624
|
+
this.checked = this.initialChecked;
|
|
5625
|
+
}
|
|
5626
|
+
formDisabledCallback(isDisabled) {
|
|
5627
|
+
this.formDisabled = isDisabled;
|
|
5628
|
+
}
|
|
5571
5629
|
get describedBy() {
|
|
5572
5630
|
if (this.invalid && this.errorMessage) {
|
|
5573
5631
|
return this.errorId;
|
|
@@ -5578,26 +5636,42 @@ class ChCheckbox {
|
|
|
5578
5636
|
return undefined;
|
|
5579
5637
|
}
|
|
5580
5638
|
render() {
|
|
5581
|
-
return (hAsync(Host, { key: '
|
|
5639
|
+
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))));
|
|
5582
5640
|
}
|
|
5641
|
+
static get formAssociated() { return true; }
|
|
5642
|
+
static get watchers() { return {
|
|
5643
|
+
"checked": [{
|
|
5644
|
+
"syncForm": 0
|
|
5645
|
+
}],
|
|
5646
|
+
"required": [{
|
|
5647
|
+
"syncForm": 0
|
|
5648
|
+
}],
|
|
5649
|
+
"invalid": [{
|
|
5650
|
+
"syncForm": 0
|
|
5651
|
+
}],
|
|
5652
|
+
"errorMessage": [{
|
|
5653
|
+
"syncForm": 0
|
|
5654
|
+
}]
|
|
5655
|
+
}; }
|
|
5583
5656
|
static get style() { return chCheckboxCss(); }
|
|
5584
5657
|
static get cmpMeta() { return {
|
|
5585
|
-
"$flags$":
|
|
5658
|
+
"$flags$": 585,
|
|
5586
5659
|
"$tagName$": "ch-checkbox",
|
|
5587
5660
|
"$members$": {
|
|
5588
5661
|
"label": [1],
|
|
5589
|
-
"name": [
|
|
5662
|
+
"name": [513],
|
|
5590
5663
|
"value": [1],
|
|
5591
5664
|
"checked": [1028],
|
|
5592
|
-
"disabled": [
|
|
5593
|
-
"required": [
|
|
5665
|
+
"disabled": [516],
|
|
5666
|
+
"required": [516],
|
|
5594
5667
|
"hint": [1],
|
|
5595
5668
|
"errorMessage": [1, "error-message"],
|
|
5596
|
-
"invalid": [4]
|
|
5669
|
+
"invalid": [4],
|
|
5670
|
+
"formDisabled": [32]
|
|
5597
5671
|
},
|
|
5598
5672
|
"$listeners$": undefined,
|
|
5599
5673
|
"$lazyBundleId$": "-",
|
|
5600
|
-
"$attrsToReflect$": []
|
|
5674
|
+
"$attrsToReflect$": [["name", "name"], ["disabled", "disabled"], ["required", "required"]]
|
|
5601
5675
|
}; }
|
|
5602
5676
|
}
|
|
5603
5677
|
|
|
@@ -5627,7 +5701,7 @@ class ChDivider {
|
|
|
5627
5701
|
}; }
|
|
5628
5702
|
}
|
|
5629
5703
|
|
|
5630
|
-
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)}`;
|
|
5704
|
+
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)}`;
|
|
5631
5705
|
|
|
5632
5706
|
let inputIds = 0;
|
|
5633
5707
|
class ChInput {
|
|
@@ -5635,10 +5709,21 @@ class ChInput {
|
|
|
5635
5709
|
registerInstance(this, hostRef);
|
|
5636
5710
|
this.chInput = createEvent(this, "chInput");
|
|
5637
5711
|
this.chChange = createEvent(this, "chChange");
|
|
5712
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
5713
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
5714
|
+
}
|
|
5715
|
+
else {
|
|
5716
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
5717
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
5718
|
+
}
|
|
5638
5719
|
}
|
|
5639
5720
|
inputId = `ch-input-${++inputIds}`;
|
|
5640
5721
|
hintId = `${this.inputId}-hint`;
|
|
5641
5722
|
errorId = `${this.inputId}-error`;
|
|
5723
|
+
initialValue = '';
|
|
5724
|
+
internals;
|
|
5725
|
+
formDisabled = false;
|
|
5726
|
+
get host() { return getElement(this); }
|
|
5642
5727
|
/**
|
|
5643
5728
|
* Visible label rendered above the input and associated with it via
|
|
5644
5729
|
* `for`/`id`, so assistive technology announces the input's purpose.
|
|
@@ -5697,6 +5782,39 @@ class ChInput {
|
|
|
5697
5782
|
this.value = ev.target.value;
|
|
5698
5783
|
this.chChange.emit(this.value);
|
|
5699
5784
|
};
|
|
5785
|
+
syncForm() {
|
|
5786
|
+
const internals = this.internals;
|
|
5787
|
+
if (typeof internals?.setFormValue !== 'function') {
|
|
5788
|
+
return;
|
|
5789
|
+
}
|
|
5790
|
+
internals.setFormValue(this.value);
|
|
5791
|
+
const flags = {};
|
|
5792
|
+
let message;
|
|
5793
|
+
if (this.required && this.value === '') {
|
|
5794
|
+
flags.valueMissing = true;
|
|
5795
|
+
}
|
|
5796
|
+
if (this.invalid && this.errorMessage) {
|
|
5797
|
+
flags.customError = true;
|
|
5798
|
+
}
|
|
5799
|
+
message = this.errorMessage ?? (flags.valueMissing ? 'Please fill out this field.' : undefined);
|
|
5800
|
+
internals.setValidity(flags, message);
|
|
5801
|
+
}
|
|
5802
|
+
componentDidLoad() {
|
|
5803
|
+
this.initialValue = this.value;
|
|
5804
|
+
this.syncForm();
|
|
5805
|
+
this.host.addEventListener('change', this.markTouched);
|
|
5806
|
+
this.host.addEventListener('focusout', this.markTouched);
|
|
5807
|
+
this.host.addEventListener('invalid', this.markTouched);
|
|
5808
|
+
}
|
|
5809
|
+
markTouched = () => {
|
|
5810
|
+
this.host.setAttribute('data-touched', '');
|
|
5811
|
+
};
|
|
5812
|
+
formResetCallback() {
|
|
5813
|
+
this.value = this.initialValue;
|
|
5814
|
+
}
|
|
5815
|
+
formDisabledCallback(isDisabled) {
|
|
5816
|
+
this.formDisabled = isDisabled;
|
|
5817
|
+
}
|
|
5700
5818
|
get describedBy() {
|
|
5701
5819
|
if (this.invalid && this.errorMessage) {
|
|
5702
5820
|
return this.errorId;
|
|
@@ -5707,27 +5825,43 @@ class ChInput {
|
|
|
5707
5825
|
return undefined;
|
|
5708
5826
|
}
|
|
5709
5827
|
render() {
|
|
5710
|
-
return (hAsync(Host, { key: '
|
|
5828
|
+
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))));
|
|
5711
5829
|
}
|
|
5830
|
+
static get formAssociated() { return true; }
|
|
5831
|
+
static get watchers() { return {
|
|
5832
|
+
"value": [{
|
|
5833
|
+
"syncForm": 0
|
|
5834
|
+
}],
|
|
5835
|
+
"required": [{
|
|
5836
|
+
"syncForm": 0
|
|
5837
|
+
}],
|
|
5838
|
+
"invalid": [{
|
|
5839
|
+
"syncForm": 0
|
|
5840
|
+
}],
|
|
5841
|
+
"errorMessage": [{
|
|
5842
|
+
"syncForm": 0
|
|
5843
|
+
}]
|
|
5844
|
+
}; }
|
|
5712
5845
|
static get style() { return chInputCss(); }
|
|
5713
5846
|
static get cmpMeta() { return {
|
|
5714
|
-
"$flags$":
|
|
5847
|
+
"$flags$": 585,
|
|
5715
5848
|
"$tagName$": "ch-input",
|
|
5716
5849
|
"$members$": {
|
|
5717
5850
|
"label": [1],
|
|
5718
5851
|
"type": [1],
|
|
5719
5852
|
"value": [1025],
|
|
5720
5853
|
"placeholder": [1],
|
|
5721
|
-
"name": [
|
|
5722
|
-
"disabled": [
|
|
5723
|
-
"required": [
|
|
5854
|
+
"name": [513],
|
|
5855
|
+
"disabled": [516],
|
|
5856
|
+
"required": [516],
|
|
5724
5857
|
"hint": [1],
|
|
5725
5858
|
"errorMessage": [1, "error-message"],
|
|
5726
|
-
"invalid": [4]
|
|
5859
|
+
"invalid": [4],
|
|
5860
|
+
"formDisabled": [32]
|
|
5727
5861
|
},
|
|
5728
5862
|
"$listeners$": undefined,
|
|
5729
5863
|
"$lazyBundleId$": "-",
|
|
5730
|
-
"$attrsToReflect$": []
|
|
5864
|
+
"$attrsToReflect$": [["name", "name"], ["disabled", "disabled"], ["required", "required"]]
|
|
5731
5865
|
}; }
|
|
5732
5866
|
}
|
|
5733
5867
|
|
|
@@ -5974,18 +6108,29 @@ class ChModal {
|
|
|
5974
6108
|
}; }
|
|
5975
6109
|
}
|
|
5976
6110
|
|
|
5977
|
-
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)}`;
|
|
6111
|
+
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)}`;
|
|
5978
6112
|
|
|
5979
6113
|
let radioIds = 0;
|
|
5980
6114
|
class ChRadio {
|
|
5981
6115
|
constructor(hostRef) {
|
|
5982
6116
|
registerInstance(this, hostRef);
|
|
5983
6117
|
this.chChange = createEvent(this, "chChange");
|
|
6118
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
6119
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
6120
|
+
}
|
|
6121
|
+
else {
|
|
6122
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
6123
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
6124
|
+
}
|
|
5984
6125
|
}
|
|
5985
6126
|
groupId = `ch-radio-${++radioIds}`;
|
|
5986
6127
|
labelId = `${this.groupId}-label`;
|
|
5987
6128
|
hintId = `${this.groupId}-hint`;
|
|
5988
6129
|
errorId = `${this.groupId}-error`;
|
|
6130
|
+
initialValue;
|
|
6131
|
+
internals;
|
|
6132
|
+
formDisabled = false;
|
|
6133
|
+
get host() { return getElement(this); }
|
|
5989
6134
|
/**
|
|
5990
6135
|
* Visible label describing the radio group, associated with it via
|
|
5991
6136
|
* `aria-labelledby`.
|
|
@@ -6033,6 +6178,39 @@ class ChRadio {
|
|
|
6033
6178
|
this.value = ev.target.value;
|
|
6034
6179
|
this.chChange.emit(this.value);
|
|
6035
6180
|
};
|
|
6181
|
+
syncForm() {
|
|
6182
|
+
const internals = this.internals;
|
|
6183
|
+
if (typeof internals?.setFormValue !== 'function') {
|
|
6184
|
+
return;
|
|
6185
|
+
}
|
|
6186
|
+
internals.setFormValue(this.value ?? null);
|
|
6187
|
+
const flags = {};
|
|
6188
|
+
let message;
|
|
6189
|
+
if (this.required && !this.value) {
|
|
6190
|
+
flags.valueMissing = true;
|
|
6191
|
+
}
|
|
6192
|
+
if (this.invalid && this.errorMessage) {
|
|
6193
|
+
flags.customError = true;
|
|
6194
|
+
}
|
|
6195
|
+
message = this.errorMessage ?? (flags.valueMissing ? 'Please fill out this field.' : undefined);
|
|
6196
|
+
internals.setValidity(flags, message);
|
|
6197
|
+
}
|
|
6198
|
+
componentDidLoad() {
|
|
6199
|
+
this.initialValue = this.value;
|
|
6200
|
+
this.syncForm();
|
|
6201
|
+
this.host.addEventListener('change', this.markTouched);
|
|
6202
|
+
this.host.addEventListener('focusout', this.markTouched);
|
|
6203
|
+
this.host.addEventListener('invalid', this.markTouched);
|
|
6204
|
+
}
|
|
6205
|
+
markTouched = () => {
|
|
6206
|
+
this.host.setAttribute('data-touched', '');
|
|
6207
|
+
};
|
|
6208
|
+
formResetCallback() {
|
|
6209
|
+
this.value = this.initialValue;
|
|
6210
|
+
}
|
|
6211
|
+
formDisabledCallback(isDisabled) {
|
|
6212
|
+
this.formDisabled = isDisabled;
|
|
6213
|
+
}
|
|
6036
6214
|
get describedBy() {
|
|
6037
6215
|
if (this.invalid && this.errorMessage) {
|
|
6038
6216
|
return this.errorId;
|
|
@@ -6044,40 +6222,67 @@ class ChRadio {
|
|
|
6044
6222
|
}
|
|
6045
6223
|
render() {
|
|
6046
6224
|
const groupName = this.name || `${this.groupId}-group`;
|
|
6047
|
-
return (hAsync(Host, { key: '
|
|
6225
|
+
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))));
|
|
6048
6226
|
}
|
|
6227
|
+
static get formAssociated() { return true; }
|
|
6228
|
+
static get watchers() { return {
|
|
6229
|
+
"value": [{
|
|
6230
|
+
"syncForm": 0
|
|
6231
|
+
}],
|
|
6232
|
+
"required": [{
|
|
6233
|
+
"syncForm": 0
|
|
6234
|
+
}],
|
|
6235
|
+
"invalid": [{
|
|
6236
|
+
"syncForm": 0
|
|
6237
|
+
}],
|
|
6238
|
+
"errorMessage": [{
|
|
6239
|
+
"syncForm": 0
|
|
6240
|
+
}]
|
|
6241
|
+
}; }
|
|
6049
6242
|
static get style() { return chRadioCss(); }
|
|
6050
6243
|
static get cmpMeta() { return {
|
|
6051
|
-
"$flags$":
|
|
6244
|
+
"$flags$": 585,
|
|
6052
6245
|
"$tagName$": "ch-radio",
|
|
6053
6246
|
"$members$": {
|
|
6054
6247
|
"label": [1],
|
|
6055
6248
|
"options": [16],
|
|
6056
6249
|
"value": [1025],
|
|
6057
|
-
"name": [
|
|
6058
|
-
"disabled": [
|
|
6059
|
-
"required": [
|
|
6250
|
+
"name": [513],
|
|
6251
|
+
"disabled": [516],
|
|
6252
|
+
"required": [516],
|
|
6060
6253
|
"hint": [1],
|
|
6061
6254
|
"errorMessage": [1, "error-message"],
|
|
6062
|
-
"invalid": [4]
|
|
6255
|
+
"invalid": [4],
|
|
6256
|
+
"formDisabled": [32]
|
|
6063
6257
|
},
|
|
6064
6258
|
"$listeners$": undefined,
|
|
6065
6259
|
"$lazyBundleId$": "-",
|
|
6066
|
-
"$attrsToReflect$": []
|
|
6260
|
+
"$attrsToReflect$": [["name", "name"], ["disabled", "disabled"], ["required", "required"]]
|
|
6067
6261
|
}; }
|
|
6068
6262
|
}
|
|
6069
6263
|
|
|
6070
|
-
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)}`;
|
|
6264
|
+
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)}`;
|
|
6071
6265
|
|
|
6072
6266
|
let selectIds = 0;
|
|
6073
6267
|
class ChSelect {
|
|
6074
6268
|
constructor(hostRef) {
|
|
6075
6269
|
registerInstance(this, hostRef);
|
|
6076
6270
|
this.chChange = createEvent(this, "chChange");
|
|
6271
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
6272
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
6273
|
+
}
|
|
6274
|
+
else {
|
|
6275
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
6276
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
6277
|
+
}
|
|
6077
6278
|
}
|
|
6078
6279
|
selectId = `ch-select-${++selectIds}`;
|
|
6079
6280
|
hintId = `${this.selectId}-hint`;
|
|
6080
6281
|
errorId = `${this.selectId}-error`;
|
|
6282
|
+
initialValue;
|
|
6283
|
+
internals;
|
|
6284
|
+
formDisabled = false;
|
|
6285
|
+
get host() { return getElement(this); }
|
|
6081
6286
|
/**
|
|
6082
6287
|
* Visible label rendered above the select and associated with it via
|
|
6083
6288
|
* `for`/`id`, so assistive technology announces the select's purpose.
|
|
@@ -6128,6 +6333,39 @@ class ChSelect {
|
|
|
6128
6333
|
this.value = ev.target.value;
|
|
6129
6334
|
this.chChange.emit(this.value);
|
|
6130
6335
|
};
|
|
6336
|
+
syncForm() {
|
|
6337
|
+
const internals = this.internals;
|
|
6338
|
+
if (typeof internals?.setFormValue !== 'function') {
|
|
6339
|
+
return;
|
|
6340
|
+
}
|
|
6341
|
+
internals.setFormValue(this.value ?? '');
|
|
6342
|
+
const flags = {};
|
|
6343
|
+
let message;
|
|
6344
|
+
if (this.required && !this.value) {
|
|
6345
|
+
flags.valueMissing = true;
|
|
6346
|
+
}
|
|
6347
|
+
if (this.invalid && this.errorMessage) {
|
|
6348
|
+
flags.customError = true;
|
|
6349
|
+
}
|
|
6350
|
+
message = this.errorMessage ?? (flags.valueMissing ? 'Please fill out this field.' : undefined);
|
|
6351
|
+
internals.setValidity(flags, message);
|
|
6352
|
+
}
|
|
6353
|
+
componentDidLoad() {
|
|
6354
|
+
this.initialValue = this.value;
|
|
6355
|
+
this.syncForm();
|
|
6356
|
+
this.host.addEventListener('change', this.markTouched);
|
|
6357
|
+
this.host.addEventListener('focusout', this.markTouched);
|
|
6358
|
+
this.host.addEventListener('invalid', this.markTouched);
|
|
6359
|
+
}
|
|
6360
|
+
markTouched = () => {
|
|
6361
|
+
this.host.setAttribute('data-touched', '');
|
|
6362
|
+
};
|
|
6363
|
+
formResetCallback() {
|
|
6364
|
+
this.value = this.initialValue;
|
|
6365
|
+
}
|
|
6366
|
+
formDisabledCallback(isDisabled) {
|
|
6367
|
+
this.formDisabled = isDisabled;
|
|
6368
|
+
}
|
|
6131
6369
|
get describedBy() {
|
|
6132
6370
|
if (this.invalid && this.errorMessage) {
|
|
6133
6371
|
return this.errorId;
|
|
@@ -6138,27 +6376,43 @@ class ChSelect {
|
|
|
6138
6376
|
return undefined;
|
|
6139
6377
|
}
|
|
6140
6378
|
render() {
|
|
6141
|
-
return (hAsync(Host, { key: '
|
|
6379
|
+
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))));
|
|
6142
6380
|
}
|
|
6381
|
+
static get formAssociated() { return true; }
|
|
6382
|
+
static get watchers() { return {
|
|
6383
|
+
"value": [{
|
|
6384
|
+
"syncForm": 0
|
|
6385
|
+
}],
|
|
6386
|
+
"required": [{
|
|
6387
|
+
"syncForm": 0
|
|
6388
|
+
}],
|
|
6389
|
+
"invalid": [{
|
|
6390
|
+
"syncForm": 0
|
|
6391
|
+
}],
|
|
6392
|
+
"errorMessage": [{
|
|
6393
|
+
"syncForm": 0
|
|
6394
|
+
}]
|
|
6395
|
+
}; }
|
|
6143
6396
|
static get style() { return chSelectCss(); }
|
|
6144
6397
|
static get cmpMeta() { return {
|
|
6145
|
-
"$flags$":
|
|
6398
|
+
"$flags$": 585,
|
|
6146
6399
|
"$tagName$": "ch-select",
|
|
6147
6400
|
"$members$": {
|
|
6148
6401
|
"label": [1],
|
|
6149
6402
|
"options": [16],
|
|
6150
6403
|
"value": [1025],
|
|
6151
6404
|
"placeholder": [1],
|
|
6152
|
-
"name": [
|
|
6153
|
-
"disabled": [
|
|
6154
|
-
"required": [
|
|
6405
|
+
"name": [513],
|
|
6406
|
+
"disabled": [516],
|
|
6407
|
+
"required": [516],
|
|
6155
6408
|
"hint": [1],
|
|
6156
6409
|
"errorMessage": [1, "error-message"],
|
|
6157
|
-
"invalid": [4]
|
|
6410
|
+
"invalid": [4],
|
|
6411
|
+
"formDisabled": [32]
|
|
6158
6412
|
},
|
|
6159
6413
|
"$listeners$": undefined,
|
|
6160
6414
|
"$lazyBundleId$": "-",
|
|
6161
|
-
"$attrsToReflect$": []
|
|
6415
|
+
"$attrsToReflect$": [["name", "name"], ["disabled", "disabled"], ["required", "required"]]
|
|
6162
6416
|
}; }
|
|
6163
6417
|
}
|
|
6164
6418
|
|
|
@@ -6207,17 +6461,28 @@ class ChSpinner {
|
|
|
6207
6461
|
}; }
|
|
6208
6462
|
}
|
|
6209
6463
|
|
|
6210
|
-
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)}`;
|
|
6464
|
+
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)}`;
|
|
6211
6465
|
|
|
6212
6466
|
let switchIds = 0;
|
|
6213
6467
|
class ChSwitch {
|
|
6214
6468
|
constructor(hostRef) {
|
|
6215
6469
|
registerInstance(this, hostRef);
|
|
6216
6470
|
this.chChange = createEvent(this, "chChange");
|
|
6471
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
6472
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
6473
|
+
}
|
|
6474
|
+
else {
|
|
6475
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
6476
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
6477
|
+
}
|
|
6217
6478
|
}
|
|
6218
6479
|
switchId = `ch-switch-${++switchIds}`;
|
|
6219
6480
|
hintId = `${this.switchId}-hint`;
|
|
6220
6481
|
errorId = `${this.switchId}-error`;
|
|
6482
|
+
initialChecked = false;
|
|
6483
|
+
internals;
|
|
6484
|
+
formDisabled = false;
|
|
6485
|
+
get host() { return getElement(this); }
|
|
6221
6486
|
/**
|
|
6222
6487
|
* Visible label rendered next to the switch, associated with it via
|
|
6223
6488
|
* `for`/`id`, so assistive technology announces the switch's purpose.
|
|
@@ -6264,6 +6529,39 @@ class ChSwitch {
|
|
|
6264
6529
|
this.checked = ev.target.checked;
|
|
6265
6530
|
this.chChange.emit(this.checked);
|
|
6266
6531
|
};
|
|
6532
|
+
syncForm() {
|
|
6533
|
+
const internals = this.internals;
|
|
6534
|
+
if (typeof internals?.setFormValue !== 'function') {
|
|
6535
|
+
return;
|
|
6536
|
+
}
|
|
6537
|
+
internals.setFormValue(this.checked ? this.value : null);
|
|
6538
|
+
const flags = {};
|
|
6539
|
+
let message;
|
|
6540
|
+
if (this.required && !this.checked) {
|
|
6541
|
+
flags.valueMissing = true;
|
|
6542
|
+
}
|
|
6543
|
+
if (this.invalid && this.errorMessage) {
|
|
6544
|
+
flags.customError = true;
|
|
6545
|
+
}
|
|
6546
|
+
message = this.errorMessage ?? (flags.valueMissing ? 'Please fill out this field.' : undefined);
|
|
6547
|
+
internals.setValidity(flags, message);
|
|
6548
|
+
}
|
|
6549
|
+
componentDidLoad() {
|
|
6550
|
+
this.initialChecked = this.checked;
|
|
6551
|
+
this.syncForm();
|
|
6552
|
+
this.host.addEventListener('change', this.markTouched);
|
|
6553
|
+
this.host.addEventListener('focusout', this.markTouched);
|
|
6554
|
+
this.host.addEventListener('invalid', this.markTouched);
|
|
6555
|
+
}
|
|
6556
|
+
markTouched = () => {
|
|
6557
|
+
this.host.setAttribute('data-touched', '');
|
|
6558
|
+
};
|
|
6559
|
+
formResetCallback() {
|
|
6560
|
+
this.checked = this.initialChecked;
|
|
6561
|
+
}
|
|
6562
|
+
formDisabledCallback(isDisabled) {
|
|
6563
|
+
this.formDisabled = isDisabled;
|
|
6564
|
+
}
|
|
6267
6565
|
get describedBy() {
|
|
6268
6566
|
if (this.invalid && this.errorMessage) {
|
|
6269
6567
|
return this.errorId;
|
|
@@ -6274,26 +6572,42 @@ class ChSwitch {
|
|
|
6274
6572
|
return undefined;
|
|
6275
6573
|
}
|
|
6276
6574
|
render() {
|
|
6277
|
-
return (hAsync(Host, { key: '
|
|
6575
|
+
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))));
|
|
6278
6576
|
}
|
|
6577
|
+
static get formAssociated() { return true; }
|
|
6578
|
+
static get watchers() { return {
|
|
6579
|
+
"checked": [{
|
|
6580
|
+
"syncForm": 0
|
|
6581
|
+
}],
|
|
6582
|
+
"required": [{
|
|
6583
|
+
"syncForm": 0
|
|
6584
|
+
}],
|
|
6585
|
+
"invalid": [{
|
|
6586
|
+
"syncForm": 0
|
|
6587
|
+
}],
|
|
6588
|
+
"errorMessage": [{
|
|
6589
|
+
"syncForm": 0
|
|
6590
|
+
}]
|
|
6591
|
+
}; }
|
|
6279
6592
|
static get style() { return chSwitchCss(); }
|
|
6280
6593
|
static get cmpMeta() { return {
|
|
6281
|
-
"$flags$":
|
|
6594
|
+
"$flags$": 585,
|
|
6282
6595
|
"$tagName$": "ch-switch",
|
|
6283
6596
|
"$members$": {
|
|
6284
6597
|
"label": [1],
|
|
6285
|
-
"name": [
|
|
6598
|
+
"name": [513],
|
|
6286
6599
|
"value": [1],
|
|
6287
6600
|
"checked": [1028],
|
|
6288
|
-
"disabled": [
|
|
6289
|
-
"required": [
|
|
6601
|
+
"disabled": [516],
|
|
6602
|
+
"required": [516],
|
|
6290
6603
|
"hint": [1],
|
|
6291
6604
|
"errorMessage": [1, "error-message"],
|
|
6292
|
-
"invalid": [4]
|
|
6605
|
+
"invalid": [4],
|
|
6606
|
+
"formDisabled": [32]
|
|
6293
6607
|
},
|
|
6294
6608
|
"$listeners$": undefined,
|
|
6295
6609
|
"$lazyBundleId$": "-",
|
|
6296
|
-
"$attrsToReflect$": []
|
|
6610
|
+
"$attrsToReflect$": [["name", "name"], ["disabled", "disabled"], ["required", "required"]]
|
|
6297
6611
|
}; }
|
|
6298
6612
|
}
|
|
6299
6613
|
|
|
@@ -6401,7 +6715,7 @@ class ChTabs {
|
|
|
6401
6715
|
}; }
|
|
6402
6716
|
}
|
|
6403
6717
|
|
|
6404
|
-
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)}`;
|
|
6718
|
+
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)}`;
|
|
6405
6719
|
|
|
6406
6720
|
let textareaIds = 0;
|
|
6407
6721
|
const DEFAULT_ROWS = 4;
|
|
@@ -6410,10 +6724,21 @@ class ChTextarea {
|
|
|
6410
6724
|
registerInstance(this, hostRef);
|
|
6411
6725
|
this.chInput = createEvent(this, "chInput");
|
|
6412
6726
|
this.chChange = createEvent(this, "chChange");
|
|
6727
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
6728
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
6729
|
+
}
|
|
6730
|
+
else {
|
|
6731
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
6732
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
6733
|
+
}
|
|
6413
6734
|
}
|
|
6414
6735
|
textareaId = `ch-textarea-${++textareaIds}`;
|
|
6415
6736
|
hintId = `${this.textareaId}-hint`;
|
|
6416
6737
|
errorId = `${this.textareaId}-error`;
|
|
6738
|
+
initialValue = '';
|
|
6739
|
+
internals;
|
|
6740
|
+
formDisabled = false;
|
|
6741
|
+
get host() { return getElement(this); }
|
|
6417
6742
|
/**
|
|
6418
6743
|
* Visible label rendered above the textarea and associated with it via
|
|
6419
6744
|
* `for`/`id`, so assistive technology announces the textarea's purpose.
|
|
@@ -6472,6 +6797,39 @@ class ChTextarea {
|
|
|
6472
6797
|
this.value = ev.target.value;
|
|
6473
6798
|
this.chChange.emit(this.value);
|
|
6474
6799
|
};
|
|
6800
|
+
syncForm() {
|
|
6801
|
+
const internals = this.internals;
|
|
6802
|
+
if (typeof internals?.setFormValue !== 'function') {
|
|
6803
|
+
return;
|
|
6804
|
+
}
|
|
6805
|
+
internals.setFormValue(this.value);
|
|
6806
|
+
const flags = {};
|
|
6807
|
+
let message;
|
|
6808
|
+
if (this.required && this.value === '') {
|
|
6809
|
+
flags.valueMissing = true;
|
|
6810
|
+
}
|
|
6811
|
+
if (this.invalid && this.errorMessage) {
|
|
6812
|
+
flags.customError = true;
|
|
6813
|
+
}
|
|
6814
|
+
message = this.errorMessage ?? (flags.valueMissing ? 'Please fill out this field.' : undefined);
|
|
6815
|
+
internals.setValidity(flags, message);
|
|
6816
|
+
}
|
|
6817
|
+
componentDidLoad() {
|
|
6818
|
+
this.initialValue = this.value;
|
|
6819
|
+
this.syncForm();
|
|
6820
|
+
this.host.addEventListener('change', this.markTouched);
|
|
6821
|
+
this.host.addEventListener('focusout', this.markTouched);
|
|
6822
|
+
this.host.addEventListener('invalid', this.markTouched);
|
|
6823
|
+
}
|
|
6824
|
+
markTouched = () => {
|
|
6825
|
+
this.host.setAttribute('data-touched', '');
|
|
6826
|
+
};
|
|
6827
|
+
formResetCallback() {
|
|
6828
|
+
this.value = this.initialValue;
|
|
6829
|
+
}
|
|
6830
|
+
formDisabledCallback(isDisabled) {
|
|
6831
|
+
this.formDisabled = isDisabled;
|
|
6832
|
+
}
|
|
6475
6833
|
get describedBy() {
|
|
6476
6834
|
if (this.invalid && this.errorMessage) {
|
|
6477
6835
|
return this.errorId;
|
|
@@ -6482,27 +6840,43 @@ class ChTextarea {
|
|
|
6482
6840
|
return undefined;
|
|
6483
6841
|
}
|
|
6484
6842
|
render() {
|
|
6485
|
-
return (hAsync(Host, { key: '
|
|
6843
|
+
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))));
|
|
6486
6844
|
}
|
|
6845
|
+
static get formAssociated() { return true; }
|
|
6846
|
+
static get watchers() { return {
|
|
6847
|
+
"value": [{
|
|
6848
|
+
"syncForm": 0
|
|
6849
|
+
}],
|
|
6850
|
+
"required": [{
|
|
6851
|
+
"syncForm": 0
|
|
6852
|
+
}],
|
|
6853
|
+
"invalid": [{
|
|
6854
|
+
"syncForm": 0
|
|
6855
|
+
}],
|
|
6856
|
+
"errorMessage": [{
|
|
6857
|
+
"syncForm": 0
|
|
6858
|
+
}]
|
|
6859
|
+
}; }
|
|
6487
6860
|
static get style() { return chTextareaCss(); }
|
|
6488
6861
|
static get cmpMeta() { return {
|
|
6489
|
-
"$flags$":
|
|
6862
|
+
"$flags$": 585,
|
|
6490
6863
|
"$tagName$": "ch-textarea",
|
|
6491
6864
|
"$members$": {
|
|
6492
6865
|
"label": [1],
|
|
6493
6866
|
"value": [1025],
|
|
6494
6867
|
"placeholder": [1],
|
|
6495
6868
|
"rows": [2],
|
|
6496
|
-
"name": [
|
|
6497
|
-
"disabled": [
|
|
6498
|
-
"required": [
|
|
6869
|
+
"name": [513],
|
|
6870
|
+
"disabled": [516],
|
|
6871
|
+
"required": [516],
|
|
6499
6872
|
"hint": [1],
|
|
6500
6873
|
"errorMessage": [1, "error-message"],
|
|
6501
|
-
"invalid": [4]
|
|
6874
|
+
"invalid": [4],
|
|
6875
|
+
"formDisabled": [32]
|
|
6502
6876
|
},
|
|
6503
6877
|
"$listeners$": undefined,
|
|
6504
6878
|
"$lazyBundleId$": "-",
|
|
6505
|
-
"$attrsToReflect$": []
|
|
6879
|
+
"$attrsToReflect$": [["name", "name"], ["disabled", "disabled"], ["required", "required"]]
|
|
6506
6880
|
}; }
|
|
6507
6881
|
}
|
|
6508
6882
|
|