@devschile/chucao 1.8.0 → 2.1.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 +3 -0
- package/dist/chucao/chucao.esm.js +1 -1
- package/dist/chucao/chucao.esm.js.map +1 -1
- package/dist/chucao/{p-e8fe65bb.entry.js → p-04dbcfa0.entry.js} +2 -2
- package/dist/chucao/p-11083711.entry.js +2 -0
- package/dist/chucao/p-11083711.entry.js.map +1 -0
- package/dist/chucao/{p-cfb6db53.entry.js → p-121fbfc8.entry.js} +2 -2
- package/dist/chucao/p-1b1e56cd.entry.js +2 -0
- package/dist/chucao/p-1b1e56cd.entry.js.map +1 -0
- package/dist/chucao/{p-df73f786.entry.js → p-2ab4a6a8.entry.js} +2 -2
- package/dist/chucao/p-4bc8e098.entry.js +2 -0
- package/dist/chucao/p-4bc8e098.entry.js.map +1 -0
- package/dist/chucao/p-5fe8bfff.entry.js +2 -0
- package/dist/chucao/p-5fe8bfff.entry.js.map +1 -0
- package/dist/chucao/p-9bb81a65.entry.js +2 -0
- package/dist/chucao/p-9bb81a65.entry.js.map +1 -0
- package/dist/chucao/p-DWC12BJ-.js +3 -0
- package/dist/chucao/p-DWC12BJ-.js.map +1 -0
- package/dist/chucao/{p-2d7e81b2.entry.js → p-a955eebf.entry.js} +2 -2
- package/dist/chucao/{p-cbb2b478.entry.js → p-d5a9e340.entry.js} +2 -2
- package/dist/chucao/{p-1cc7042e.entry.js → p-ff5f5c1f.entry.js} +2 -2
- package/dist/cjs/ch-accordion.cjs.entry.js +1 -1
- package/dist/cjs/ch-alert_8.cjs.entry.js +186 -9
- 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-emoji.cjs.entry.js +104 -0
- package/dist/cjs/ch-emoji.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-link.cjs.entry.js +1 -1
- package/dist/cjs/ch-modal.cjs.entry.js +2 -2
- 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 +2 -2
- 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 +2 -2
- package/dist/cjs/chucao.cjs.js +3 -3
- package/dist/cjs/chucao.cjs.js.map +1 -1
- package/dist/cjs/{index-DMeDkSQU.js → index-C9cpLteP.js} +71 -12
- package/dist/cjs/index-C9cpLteP.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/ch-card/ch-card.js +1 -1
- 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-emoji/ch-emoji.css +33 -0
- package/dist/collection/components/ch-emoji/ch-emoji.js +151 -0
- package/dist/collection/components/ch-emoji/ch-emoji.js.map +1 -0
- 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-modal/ch-modal.js +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-spinner/ch-spinner.js +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-tabs/ch-tabs.js +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/collection/components/ch-tooltip/ch-tooltip.js +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-emoji.d.ts +11 -0
- package/dist/components/ch-emoji.js +2 -0
- package/dist/components/ch-emoji.js.map +1 -0
- 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-BhAZrOxf.js +2 -0
- package/dist/components/p-BhAZrOxf.js.map +1 -0
- package/dist/esm/ch-accordion.entry.js +1 -1
- package/dist/esm/ch-alert_8.entry.js +186 -9
- 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-emoji.entry.js +102 -0
- package/dist/esm/ch-emoji.entry.js.map +1 -0
- package/dist/esm/ch-link.entry.js +1 -1
- package/dist/esm/ch-modal.entry.js +2 -2
- 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 +2 -2
- 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 +2 -2
- package/dist/esm/chucao.js +4 -4
- package/dist/esm/chucao.js.map +1 -1
- package/dist/esm/{index-Bvah_WQV.js → index-DWC12BJ-.js} +71 -12
- package/dist/esm/index-DWC12BJ-.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-emoji/ch-emoji.d.ts +32 -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 +96 -0
- package/dist/types/stencil-public-runtime.d.ts +1 -0
- package/dist-react/components.d.ts +3 -0
- package/dist-react/components.js +9 -0
- package/dist-react/components.ts +12 -0
- package/dist-vue/index.d.ts +1 -0
- package/dist-vue/index.js +6 -0
- package/dist-vue/index.ts +8 -0
- package/hydrate/index.js +555 -63
- package/hydrate/index.mjs +555 -63
- package/loader/index.d.ts +1 -1
- package/package.json +5 -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-e8fe65bb.entry.js.map → p-04dbcfa0.entry.js.map} +0 -0
- /package/dist/chucao/{p-cfb6db53.entry.js.map → p-121fbfc8.entry.js.map} +0 -0
- /package/dist/chucao/{p-df73f786.entry.js.map → p-2ab4a6a8.entry.js.map} +0 -0
- /package/dist/chucao/{p-2d7e81b2.entry.js.map → p-a955eebf.entry.js.map} +0 -0
- /package/dist/chucao/{p-cbb2b478.entry.js.map → p-d5a9e340.entry.js.map} +0 -0
- /package/dist/chucao/{p-1cc7042e.entry.js.map → p-ff5f5c1f.entry.js.map} +0 -0
package/hydrate/index.mjs
CHANGED
|
@@ -133,7 +133,7 @@ const NAMESPACE = 'chucao';
|
|
|
133
133
|
const BUILD = /* chucao */ { hotModuleReplacement: false, slotRelocation: true, state: true, updatable: true};
|
|
134
134
|
|
|
135
135
|
/*
|
|
136
|
-
Stencil Hydrate Platform v4.44.
|
|
136
|
+
Stencil Hydrate Platform v4.44.2 | MIT Licensed | https://stenciljs.com
|
|
137
137
|
*/
|
|
138
138
|
var __create = Object.create;
|
|
139
139
|
var __defProp = Object.defineProperty;
|
|
@@ -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
|
}
|
|
@@ -1913,7 +1915,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
|
|
|
1913
1915
|
}
|
|
1914
1916
|
}
|
|
1915
1917
|
if (newValue == null || newValue === false) {
|
|
1916
|
-
if (newValue !== false || elm.getAttribute(memberName) === "") {
|
|
1918
|
+
if (newValue !== false || elm.getAttribute(memberName) === "" || flags & 4 /* isHost */ && !isEnumeratedAttribute(memberName)) {
|
|
1917
1919
|
{
|
|
1918
1920
|
elm.removeAttribute(memberName);
|
|
1919
1921
|
}
|
|
@@ -1926,6 +1928,8 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
|
|
|
1926
1928
|
}
|
|
1927
1929
|
}
|
|
1928
1930
|
};
|
|
1931
|
+
var ENUMERATED_ATTRIBUTES = /* @__PURE__ */ new Set(["draggable", "contenteditable", "spellcheck"]);
|
|
1932
|
+
var isEnumeratedAttribute = (attrName) => ENUMERATED_ATTRIBUTES.has(attrName) || attrName.startsWith("aria-");
|
|
1929
1933
|
var parseClassListRegex = /\s/;
|
|
1930
1934
|
var parseClassList = (value) => {
|
|
1931
1935
|
if (typeof value === "object" && value && "baseVal" in value) {
|
|
@@ -2379,7 +2383,7 @@ var insertBefore = (parent, newNode, reference, isInitialLoad) => {
|
|
|
2379
2383
|
return newNode;
|
|
2380
2384
|
}
|
|
2381
2385
|
}
|
|
2382
|
-
if (parent.__insertBefore) {
|
|
2386
|
+
if ((parent == null ? void 0 : parent.__insertBefore)) {
|
|
2383
2387
|
return parent.__insertBefore(newNode, reference);
|
|
2384
2388
|
} else {
|
|
2385
2389
|
return parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
@@ -2414,6 +2418,14 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
2414
2418
|
const isHostElement = isHost(renderFnResults);
|
|
2415
2419
|
const rootVnode = isHostElement ? renderFnResults : h(null, null, renderFnResults);
|
|
2416
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
|
+
}
|
|
2417
2429
|
if (isInitialLoad && rootVnode.$attrs$) {
|
|
2418
2430
|
for (const key of Object.keys(rootVnode.$attrs$)) {
|
|
2419
2431
|
if (hostElm.hasAttribute(key) && !["key", "ref", "style", "class"].includes(key)) {
|
|
@@ -2748,7 +2760,9 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
2748
2760
|
const instance = hostRef.$lazyInstance$ ;
|
|
2749
2761
|
newVal = parsePropertyValue(
|
|
2750
2762
|
newVal,
|
|
2751
|
-
cmpMeta.$members$[propName][0]
|
|
2763
|
+
cmpMeta.$members$[propName][0],
|
|
2764
|
+
!!(cmpMeta.$flags$ & 64 /* formAssociated */)
|
|
2765
|
+
);
|
|
2752
2766
|
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
2753
2767
|
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
2754
2768
|
if ((!(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
|
|
@@ -2787,8 +2801,6 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
2787
2801
|
}
|
|
2788
2802
|
}
|
|
2789
2803
|
};
|
|
2790
|
-
|
|
2791
|
-
// src/runtime/proxy-component.ts
|
|
2792
2804
|
var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
2793
2805
|
var _a2;
|
|
2794
2806
|
const prototype = Cstr.prototype;
|
|
@@ -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) {
|
|
@@ -5498,7 +5512,7 @@ class ChCard {
|
|
|
5498
5512
|
registerInstance(this, hostRef);
|
|
5499
5513
|
}
|
|
5500
5514
|
render() {
|
|
5501
|
-
return (hAsync(Host, { key: '
|
|
5515
|
+
return (hAsync(Host, { key: 'de570a460eff697eb242ef56fcedd5b400d6b03f' }, hAsync("div", { key: '3350619356a929c5d922948d52d6635420dc8547', class: "card" }, hAsync("slot", { key: 'b50679202b5fea142702de0babf62587186d4dc8' }))));
|
|
5502
5516
|
}
|
|
5503
5517
|
static get style() { return chCardCss(); }
|
|
5504
5518
|
static get cmpMeta() { return {
|
|
@@ -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: 'ad83b999d4dbafbd7b6f2369bae8fbce8e068cad' }, hAsync("label", { key: 'e5927ad9d76db7cd9418debe8e635767b597e27a', class: { 'control': true, 'control--disabled': this.disabled || this.formDisabled }, htmlFor: this.checkboxId }, hAsync("input", { key: '93c49822bf5a470d67a7077354adcd9144643843', 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: 'da90747e3339879a744569c98befed94507bebdd', class: "label-text" }, this.label)), this.hint && !(this.invalid && this.errorMessage) && (hAsync("p", { key: '3c10c9e29a943bc12983d4ef6b9fa00d95293c80', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (hAsync("p", { key: '76e4a8debadd36dae475bd2439410c0f2a82cb62', 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,124 @@ class ChDivider {
|
|
|
5627
5701
|
}; }
|
|
5628
5702
|
}
|
|
5629
5703
|
|
|
5630
|
-
const
|
|
5704
|
+
const aaaa = "aaaa";
|
|
5705
|
+
const ameno = "ameno";
|
|
5706
|
+
const heart = "huemul-love";
|
|
5707
|
+
const love = "huemul-love";
|
|
5708
|
+
const humo = "humo";
|
|
5709
|
+
const hypnotoad = "hypnotoad";
|
|
5710
|
+
const lmao = "lmao";
|
|
5711
|
+
const loading = "loading";
|
|
5712
|
+
const loco = "loco";
|
|
5713
|
+
const loco2 = "loco2";
|
|
5714
|
+
const lol = "lol";
|
|
5715
|
+
const lol2 = "lol2";
|
|
5716
|
+
const monea = "monea";
|
|
5717
|
+
const negative = "negative";
|
|
5718
|
+
var emojiMap = {
|
|
5719
|
+
aaaa: aaaa,
|
|
5720
|
+
ameno: ameno,
|
|
5721
|
+
"huemul-huaso": "huemul-huaso",
|
|
5722
|
+
"huemul-love": "huemul-love",
|
|
5723
|
+
heart: heart,
|
|
5724
|
+
love: love,
|
|
5725
|
+
"huemul-trusted": "huemul-trusted",
|
|
5726
|
+
humo: humo,
|
|
5727
|
+
hypnotoad: hypnotoad,
|
|
5728
|
+
"lets-fucking-go": "lets-fucking-go",
|
|
5729
|
+
lmao: lmao,
|
|
5730
|
+
loading: loading,
|
|
5731
|
+
loco: loco,
|
|
5732
|
+
loco2: loco2,
|
|
5733
|
+
lol: lol,
|
|
5734
|
+
lol2: lol2,
|
|
5735
|
+
monea: monea,
|
|
5736
|
+
negative: negative
|
|
5737
|
+
};
|
|
5738
|
+
|
|
5739
|
+
const chEmojiCss = () => `:host{display:inline-block;vertical-align:middle}.emoji{display:block;object-fit:contain}.emoji--sm{width:16px;height:16px}.emoji--md{width:24px;height:24px}.emoji--lg{width:32px;height:32px}.emoji--xl{width:48px;height:48px}.emoji--hidden{display:none}`;
|
|
5740
|
+
|
|
5741
|
+
const CDN_BASE = 'https://static.devschile.cl/emoji';
|
|
5742
|
+
const EXTENSIONS = ['png', 'gif', 'jpg', 'svg'];
|
|
5743
|
+
/**
|
|
5744
|
+
* Inline emoji from the devsChile CDN.
|
|
5745
|
+
*
|
|
5746
|
+
* Given a name (or alias from the emoji map), the component resolves the
|
|
5747
|
+
* asset URL and tries each possible file extension until one loads.
|
|
5748
|
+
* Size is controlled via the `size` prop.
|
|
5749
|
+
*/
|
|
5750
|
+
class ChEmoji {
|
|
5751
|
+
constructor(hostRef) {
|
|
5752
|
+
registerInstance(this, hostRef);
|
|
5753
|
+
}
|
|
5754
|
+
extIndex = 0;
|
|
5755
|
+
loaded = false;
|
|
5756
|
+
/**
|
|
5757
|
+
* The emoji name or alias, e.g. `"huemul-love"` or `"heart"`.
|
|
5758
|
+
*/
|
|
5759
|
+
name;
|
|
5760
|
+
/**
|
|
5761
|
+
* Accessible alt text for the image. Defaults to the `name` prop.
|
|
5762
|
+
*/
|
|
5763
|
+
alt;
|
|
5764
|
+
/**
|
|
5765
|
+
* Size of the emoji. Either `sm`, `md`, `lg`, or `xl`.
|
|
5766
|
+
*/
|
|
5767
|
+
size = 'md';
|
|
5768
|
+
componentWillLoad() {
|
|
5769
|
+
this.resolveAsset();
|
|
5770
|
+
}
|
|
5771
|
+
handleNameChange() {
|
|
5772
|
+
this.resolveAsset();
|
|
5773
|
+
}
|
|
5774
|
+
resolveAsset() {
|
|
5775
|
+
this.extIndex = 0;
|
|
5776
|
+
this.loaded = false;
|
|
5777
|
+
}
|
|
5778
|
+
get assetName() {
|
|
5779
|
+
return emojiMap[this.name] ?? this.name;
|
|
5780
|
+
}
|
|
5781
|
+
get currentSrc() {
|
|
5782
|
+
return `${CDN_BASE}/${this.assetName}.${EXTENSIONS[this.extIndex]}`;
|
|
5783
|
+
}
|
|
5784
|
+
handleError = () => {
|
|
5785
|
+
if (this.extIndex < EXTENSIONS.length - 1) {
|
|
5786
|
+
this.extIndex++;
|
|
5787
|
+
}
|
|
5788
|
+
};
|
|
5789
|
+
handleLoad = () => {
|
|
5790
|
+
this.loaded = true;
|
|
5791
|
+
};
|
|
5792
|
+
render() {
|
|
5793
|
+
return (hAsync(Host, { key: 'bfc646f047dae03aa8079825012305d7beb1fa6d' }, hAsync("img", { key: 'c397cc1f928c6871df10adc1f43874738e1cbf33', class: {
|
|
5794
|
+
'emoji': true,
|
|
5795
|
+
[`emoji--${this.size}`]: true,
|
|
5796
|
+
'emoji--hidden': !this.loaded,
|
|
5797
|
+
}, src: this.currentSrc, alt: this.alt ?? this.name, onError: this.handleError, onLoad: this.handleLoad })));
|
|
5798
|
+
}
|
|
5799
|
+
static get watchers() { return {
|
|
5800
|
+
"name": [{
|
|
5801
|
+
"handleNameChange": 0
|
|
5802
|
+
}]
|
|
5803
|
+
}; }
|
|
5804
|
+
static get style() { return chEmojiCss(); }
|
|
5805
|
+
static get cmpMeta() { return {
|
|
5806
|
+
"$flags$": 521,
|
|
5807
|
+
"$tagName$": "ch-emoji",
|
|
5808
|
+
"$members$": {
|
|
5809
|
+
"name": [1],
|
|
5810
|
+
"alt": [1],
|
|
5811
|
+
"size": [1],
|
|
5812
|
+
"extIndex": [32],
|
|
5813
|
+
"loaded": [32]
|
|
5814
|
+
},
|
|
5815
|
+
"$listeners$": undefined,
|
|
5816
|
+
"$lazyBundleId$": "-",
|
|
5817
|
+
"$attrsToReflect$": []
|
|
5818
|
+
}; }
|
|
5819
|
+
}
|
|
5820
|
+
|
|
5821
|
+
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
5822
|
|
|
5632
5823
|
let inputIds = 0;
|
|
5633
5824
|
class ChInput {
|
|
@@ -5635,10 +5826,21 @@ class ChInput {
|
|
|
5635
5826
|
registerInstance(this, hostRef);
|
|
5636
5827
|
this.chInput = createEvent(this, "chInput");
|
|
5637
5828
|
this.chChange = createEvent(this, "chChange");
|
|
5829
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
5830
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
5831
|
+
}
|
|
5832
|
+
else {
|
|
5833
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
5834
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
5835
|
+
}
|
|
5638
5836
|
}
|
|
5639
5837
|
inputId = `ch-input-${++inputIds}`;
|
|
5640
5838
|
hintId = `${this.inputId}-hint`;
|
|
5641
5839
|
errorId = `${this.inputId}-error`;
|
|
5840
|
+
initialValue = '';
|
|
5841
|
+
internals;
|
|
5842
|
+
formDisabled = false;
|
|
5843
|
+
get host() { return getElement(this); }
|
|
5642
5844
|
/**
|
|
5643
5845
|
* Visible label rendered above the input and associated with it via
|
|
5644
5846
|
* `for`/`id`, so assistive technology announces the input's purpose.
|
|
@@ -5697,6 +5899,39 @@ class ChInput {
|
|
|
5697
5899
|
this.value = ev.target.value;
|
|
5698
5900
|
this.chChange.emit(this.value);
|
|
5699
5901
|
};
|
|
5902
|
+
syncForm() {
|
|
5903
|
+
const internals = this.internals;
|
|
5904
|
+
if (typeof internals?.setFormValue !== 'function') {
|
|
5905
|
+
return;
|
|
5906
|
+
}
|
|
5907
|
+
internals.setFormValue(this.value);
|
|
5908
|
+
const flags = {};
|
|
5909
|
+
let message;
|
|
5910
|
+
if (this.required && this.value === '') {
|
|
5911
|
+
flags.valueMissing = true;
|
|
5912
|
+
}
|
|
5913
|
+
if (this.invalid && this.errorMessage) {
|
|
5914
|
+
flags.customError = true;
|
|
5915
|
+
}
|
|
5916
|
+
message = this.errorMessage ?? (flags.valueMissing ? 'Please fill out this field.' : undefined);
|
|
5917
|
+
internals.setValidity(flags, message);
|
|
5918
|
+
}
|
|
5919
|
+
componentDidLoad() {
|
|
5920
|
+
this.initialValue = this.value;
|
|
5921
|
+
this.syncForm();
|
|
5922
|
+
this.host.addEventListener('change', this.markTouched);
|
|
5923
|
+
this.host.addEventListener('focusout', this.markTouched);
|
|
5924
|
+
this.host.addEventListener('invalid', this.markTouched);
|
|
5925
|
+
}
|
|
5926
|
+
markTouched = () => {
|
|
5927
|
+
this.host.setAttribute('data-touched', '');
|
|
5928
|
+
};
|
|
5929
|
+
formResetCallback() {
|
|
5930
|
+
this.value = this.initialValue;
|
|
5931
|
+
}
|
|
5932
|
+
formDisabledCallback(isDisabled) {
|
|
5933
|
+
this.formDisabled = isDisabled;
|
|
5934
|
+
}
|
|
5700
5935
|
get describedBy() {
|
|
5701
5936
|
if (this.invalid && this.errorMessage) {
|
|
5702
5937
|
return this.errorId;
|
|
@@ -5707,27 +5942,43 @@ class ChInput {
|
|
|
5707
5942
|
return undefined;
|
|
5708
5943
|
}
|
|
5709
5944
|
render() {
|
|
5710
|
-
return (hAsync(Host, { key: '
|
|
5945
|
+
return (hAsync(Host, { key: '8a4b7cf5b80097afb849e2de9620fdd205774923' }, this.label && (hAsync("label", { key: '7400206e6c27d61e7b9afadeba8a2131059af59a', class: "label", htmlFor: this.inputId }, this.label)), hAsync("input", { key: '2c4fd9215d5b21f28d57a1c49eeaa64224e21e05', 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: '6e6a381f81442622784afc480eb79327ae8a8525', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (hAsync("p", { key: '743215633ca399d801c813194b054d40631b7be6', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
5711
5946
|
}
|
|
5947
|
+
static get formAssociated() { return true; }
|
|
5948
|
+
static get watchers() { return {
|
|
5949
|
+
"value": [{
|
|
5950
|
+
"syncForm": 0
|
|
5951
|
+
}],
|
|
5952
|
+
"required": [{
|
|
5953
|
+
"syncForm": 0
|
|
5954
|
+
}],
|
|
5955
|
+
"invalid": [{
|
|
5956
|
+
"syncForm": 0
|
|
5957
|
+
}],
|
|
5958
|
+
"errorMessage": [{
|
|
5959
|
+
"syncForm": 0
|
|
5960
|
+
}]
|
|
5961
|
+
}; }
|
|
5712
5962
|
static get style() { return chInputCss(); }
|
|
5713
5963
|
static get cmpMeta() { return {
|
|
5714
|
-
"$flags$":
|
|
5964
|
+
"$flags$": 585,
|
|
5715
5965
|
"$tagName$": "ch-input",
|
|
5716
5966
|
"$members$": {
|
|
5717
5967
|
"label": [1],
|
|
5718
5968
|
"type": [1],
|
|
5719
5969
|
"value": [1025],
|
|
5720
5970
|
"placeholder": [1],
|
|
5721
|
-
"name": [
|
|
5722
|
-
"disabled": [
|
|
5723
|
-
"required": [
|
|
5971
|
+
"name": [513],
|
|
5972
|
+
"disabled": [516],
|
|
5973
|
+
"required": [516],
|
|
5724
5974
|
"hint": [1],
|
|
5725
5975
|
"errorMessage": [1, "error-message"],
|
|
5726
|
-
"invalid": [4]
|
|
5976
|
+
"invalid": [4],
|
|
5977
|
+
"formDisabled": [32]
|
|
5727
5978
|
},
|
|
5728
5979
|
"$listeners$": undefined,
|
|
5729
5980
|
"$lazyBundleId$": "-",
|
|
5730
|
-
"$attrsToReflect$": []
|
|
5981
|
+
"$attrsToReflect$": [["name", "name"], ["disabled", "disabled"], ["required", "required"]]
|
|
5731
5982
|
}; }
|
|
5732
5983
|
}
|
|
5733
5984
|
|
|
@@ -5952,7 +6203,7 @@ class ChModal {
|
|
|
5952
6203
|
this.chClose.emit();
|
|
5953
6204
|
};
|
|
5954
6205
|
render() {
|
|
5955
|
-
return (hAsync(Host, { key: '
|
|
6206
|
+
return (hAsync(Host, { key: '8f5f8c340291feb4385076bfdefc02a849e08efe' }, hAsync("dialog", { key: 'e435367c1e3dc5c7e8102f6ac76792394f5097fa', class: "modal", "aria-label": this.label, ref: el => (this.dialog = el) }, hAsync("div", { key: '05a0d306dc7e3f917c47de28ed6359280c0472b8', class: "modal-head" }, hAsync("slot", { key: '79e25ed41f98a5ceee2dca9afc200d8980d9f284', name: "heading" }), this.closeLabel && (hAsync("button", { key: '0620b914cb51cae7ab74f2ccccb25e9fc324811f', class: "modal-close", type: "button", "aria-label": this.closeLabel, onClick: this.handleCloseClick }, hAsync("span", { key: 'e2a1e0ec6c1d1cbdb2de684bfe4c7e0ed07ceaee', "aria-hidden": "true" }, "\u00D7")))), hAsync("div", { key: 'af254d18e1538ea5dac06c421ba03d897ddf057d', class: "modal-body" }, hAsync("slot", { key: '645876d63f275108a2a9d27f563bb6918dcb9deb' })))));
|
|
5956
6207
|
}
|
|
5957
6208
|
static get watchers() { return {
|
|
5958
6209
|
"open": [{
|
|
@@ -5974,18 +6225,29 @@ class ChModal {
|
|
|
5974
6225
|
}; }
|
|
5975
6226
|
}
|
|
5976
6227
|
|
|
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)}`;
|
|
6228
|
+
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
6229
|
|
|
5979
6230
|
let radioIds = 0;
|
|
5980
6231
|
class ChRadio {
|
|
5981
6232
|
constructor(hostRef) {
|
|
5982
6233
|
registerInstance(this, hostRef);
|
|
5983
6234
|
this.chChange = createEvent(this, "chChange");
|
|
6235
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
6236
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
6237
|
+
}
|
|
6238
|
+
else {
|
|
6239
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
6240
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
6241
|
+
}
|
|
5984
6242
|
}
|
|
5985
6243
|
groupId = `ch-radio-${++radioIds}`;
|
|
5986
6244
|
labelId = `${this.groupId}-label`;
|
|
5987
6245
|
hintId = `${this.groupId}-hint`;
|
|
5988
6246
|
errorId = `${this.groupId}-error`;
|
|
6247
|
+
initialValue;
|
|
6248
|
+
internals;
|
|
6249
|
+
formDisabled = false;
|
|
6250
|
+
get host() { return getElement(this); }
|
|
5989
6251
|
/**
|
|
5990
6252
|
* Visible label describing the radio group, associated with it via
|
|
5991
6253
|
* `aria-labelledby`.
|
|
@@ -6033,6 +6295,39 @@ class ChRadio {
|
|
|
6033
6295
|
this.value = ev.target.value;
|
|
6034
6296
|
this.chChange.emit(this.value);
|
|
6035
6297
|
};
|
|
6298
|
+
syncForm() {
|
|
6299
|
+
const internals = this.internals;
|
|
6300
|
+
if (typeof internals?.setFormValue !== 'function') {
|
|
6301
|
+
return;
|
|
6302
|
+
}
|
|
6303
|
+
internals.setFormValue(this.value ?? null);
|
|
6304
|
+
const flags = {};
|
|
6305
|
+
let message;
|
|
6306
|
+
if (this.required && !this.value) {
|
|
6307
|
+
flags.valueMissing = true;
|
|
6308
|
+
}
|
|
6309
|
+
if (this.invalid && this.errorMessage) {
|
|
6310
|
+
flags.customError = true;
|
|
6311
|
+
}
|
|
6312
|
+
message = this.errorMessage ?? (flags.valueMissing ? 'Please fill out this field.' : undefined);
|
|
6313
|
+
internals.setValidity(flags, message);
|
|
6314
|
+
}
|
|
6315
|
+
componentDidLoad() {
|
|
6316
|
+
this.initialValue = this.value;
|
|
6317
|
+
this.syncForm();
|
|
6318
|
+
this.host.addEventListener('change', this.markTouched);
|
|
6319
|
+
this.host.addEventListener('focusout', this.markTouched);
|
|
6320
|
+
this.host.addEventListener('invalid', this.markTouched);
|
|
6321
|
+
}
|
|
6322
|
+
markTouched = () => {
|
|
6323
|
+
this.host.setAttribute('data-touched', '');
|
|
6324
|
+
};
|
|
6325
|
+
formResetCallback() {
|
|
6326
|
+
this.value = this.initialValue;
|
|
6327
|
+
}
|
|
6328
|
+
formDisabledCallback(isDisabled) {
|
|
6329
|
+
this.formDisabled = isDisabled;
|
|
6330
|
+
}
|
|
6036
6331
|
get describedBy() {
|
|
6037
6332
|
if (this.invalid && this.errorMessage) {
|
|
6038
6333
|
return this.errorId;
|
|
@@ -6044,40 +6339,67 @@ class ChRadio {
|
|
|
6044
6339
|
}
|
|
6045
6340
|
render() {
|
|
6046
6341
|
const groupName = this.name || `${this.groupId}-group`;
|
|
6047
|
-
return (hAsync(Host, { key: '
|
|
6342
|
+
return (hAsync(Host, { key: '2d0f02cbeae89b8c60664825f3885bbeeafd896a' }, this.label && (hAsync("span", { key: 'c32fd25be5eaf0d05c2d8d6aae01dda281f4b952', class: "group-label", id: this.labelId }, this.label)), hAsync("div", { key: 'bd05a360ad1fd794c95d8066dbb93300152a88dc', 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: '8c451f8d166c6002a4f30bfb72acd6b863ec38c2', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (hAsync("p", { key: '8ac12f60e463c908dff76d64d7ae0e216ed51489', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
6048
6343
|
}
|
|
6344
|
+
static get formAssociated() { return true; }
|
|
6345
|
+
static get watchers() { return {
|
|
6346
|
+
"value": [{
|
|
6347
|
+
"syncForm": 0
|
|
6348
|
+
}],
|
|
6349
|
+
"required": [{
|
|
6350
|
+
"syncForm": 0
|
|
6351
|
+
}],
|
|
6352
|
+
"invalid": [{
|
|
6353
|
+
"syncForm": 0
|
|
6354
|
+
}],
|
|
6355
|
+
"errorMessage": [{
|
|
6356
|
+
"syncForm": 0
|
|
6357
|
+
}]
|
|
6358
|
+
}; }
|
|
6049
6359
|
static get style() { return chRadioCss(); }
|
|
6050
6360
|
static get cmpMeta() { return {
|
|
6051
|
-
"$flags$":
|
|
6361
|
+
"$flags$": 585,
|
|
6052
6362
|
"$tagName$": "ch-radio",
|
|
6053
6363
|
"$members$": {
|
|
6054
6364
|
"label": [1],
|
|
6055
6365
|
"options": [16],
|
|
6056
6366
|
"value": [1025],
|
|
6057
|
-
"name": [
|
|
6058
|
-
"disabled": [
|
|
6059
|
-
"required": [
|
|
6367
|
+
"name": [513],
|
|
6368
|
+
"disabled": [516],
|
|
6369
|
+
"required": [516],
|
|
6060
6370
|
"hint": [1],
|
|
6061
6371
|
"errorMessage": [1, "error-message"],
|
|
6062
|
-
"invalid": [4]
|
|
6372
|
+
"invalid": [4],
|
|
6373
|
+
"formDisabled": [32]
|
|
6063
6374
|
},
|
|
6064
6375
|
"$listeners$": undefined,
|
|
6065
6376
|
"$lazyBundleId$": "-",
|
|
6066
|
-
"$attrsToReflect$": []
|
|
6377
|
+
"$attrsToReflect$": [["name", "name"], ["disabled", "disabled"], ["required", "required"]]
|
|
6067
6378
|
}; }
|
|
6068
6379
|
}
|
|
6069
6380
|
|
|
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)}`;
|
|
6381
|
+
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
6382
|
|
|
6072
6383
|
let selectIds = 0;
|
|
6073
6384
|
class ChSelect {
|
|
6074
6385
|
constructor(hostRef) {
|
|
6075
6386
|
registerInstance(this, hostRef);
|
|
6076
6387
|
this.chChange = createEvent(this, "chChange");
|
|
6388
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
6389
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
6390
|
+
}
|
|
6391
|
+
else {
|
|
6392
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
6393
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
6394
|
+
}
|
|
6077
6395
|
}
|
|
6078
6396
|
selectId = `ch-select-${++selectIds}`;
|
|
6079
6397
|
hintId = `${this.selectId}-hint`;
|
|
6080
6398
|
errorId = `${this.selectId}-error`;
|
|
6399
|
+
initialValue;
|
|
6400
|
+
internals;
|
|
6401
|
+
formDisabled = false;
|
|
6402
|
+
get host() { return getElement(this); }
|
|
6081
6403
|
/**
|
|
6082
6404
|
* Visible label rendered above the select and associated with it via
|
|
6083
6405
|
* `for`/`id`, so assistive technology announces the select's purpose.
|
|
@@ -6128,6 +6450,39 @@ class ChSelect {
|
|
|
6128
6450
|
this.value = ev.target.value;
|
|
6129
6451
|
this.chChange.emit(this.value);
|
|
6130
6452
|
};
|
|
6453
|
+
syncForm() {
|
|
6454
|
+
const internals = this.internals;
|
|
6455
|
+
if (typeof internals?.setFormValue !== 'function') {
|
|
6456
|
+
return;
|
|
6457
|
+
}
|
|
6458
|
+
internals.setFormValue(this.value ?? '');
|
|
6459
|
+
const flags = {};
|
|
6460
|
+
let message;
|
|
6461
|
+
if (this.required && !this.value) {
|
|
6462
|
+
flags.valueMissing = true;
|
|
6463
|
+
}
|
|
6464
|
+
if (this.invalid && this.errorMessage) {
|
|
6465
|
+
flags.customError = true;
|
|
6466
|
+
}
|
|
6467
|
+
message = this.errorMessage ?? (flags.valueMissing ? 'Please fill out this field.' : undefined);
|
|
6468
|
+
internals.setValidity(flags, message);
|
|
6469
|
+
}
|
|
6470
|
+
componentDidLoad() {
|
|
6471
|
+
this.initialValue = this.value;
|
|
6472
|
+
this.syncForm();
|
|
6473
|
+
this.host.addEventListener('change', this.markTouched);
|
|
6474
|
+
this.host.addEventListener('focusout', this.markTouched);
|
|
6475
|
+
this.host.addEventListener('invalid', this.markTouched);
|
|
6476
|
+
}
|
|
6477
|
+
markTouched = () => {
|
|
6478
|
+
this.host.setAttribute('data-touched', '');
|
|
6479
|
+
};
|
|
6480
|
+
formResetCallback() {
|
|
6481
|
+
this.value = this.initialValue;
|
|
6482
|
+
}
|
|
6483
|
+
formDisabledCallback(isDisabled) {
|
|
6484
|
+
this.formDisabled = isDisabled;
|
|
6485
|
+
}
|
|
6131
6486
|
get describedBy() {
|
|
6132
6487
|
if (this.invalid && this.errorMessage) {
|
|
6133
6488
|
return this.errorId;
|
|
@@ -6138,27 +6493,43 @@ class ChSelect {
|
|
|
6138
6493
|
return undefined;
|
|
6139
6494
|
}
|
|
6140
6495
|
render() {
|
|
6141
|
-
return (hAsync(Host, { key: '
|
|
6496
|
+
return (hAsync(Host, { key: 'ffca23504c723f60f7430e6db2e1fa00db1fd4d8' }, this.label && (hAsync("label", { key: '697998ec67f01f3ca2849b1fb2aa88790d98010b', class: "label", htmlFor: this.selectId }, this.label)), hAsync("select", { key: 'f344d240f38dd123bdfd2d34cd15fbc7b5ae0a2c', 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: '34200e96dad92ed55632f0430abde5bc34cf6e6a', 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: '55690dbf57cad7c974d0bf1b8eedb733ddc5b571', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (hAsync("p", { key: '7d4598b112d21ebc96ac04bca553f63dd5825996', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
6142
6497
|
}
|
|
6498
|
+
static get formAssociated() { return true; }
|
|
6499
|
+
static get watchers() { return {
|
|
6500
|
+
"value": [{
|
|
6501
|
+
"syncForm": 0
|
|
6502
|
+
}],
|
|
6503
|
+
"required": [{
|
|
6504
|
+
"syncForm": 0
|
|
6505
|
+
}],
|
|
6506
|
+
"invalid": [{
|
|
6507
|
+
"syncForm": 0
|
|
6508
|
+
}],
|
|
6509
|
+
"errorMessage": [{
|
|
6510
|
+
"syncForm": 0
|
|
6511
|
+
}]
|
|
6512
|
+
}; }
|
|
6143
6513
|
static get style() { return chSelectCss(); }
|
|
6144
6514
|
static get cmpMeta() { return {
|
|
6145
|
-
"$flags$":
|
|
6515
|
+
"$flags$": 585,
|
|
6146
6516
|
"$tagName$": "ch-select",
|
|
6147
6517
|
"$members$": {
|
|
6148
6518
|
"label": [1],
|
|
6149
6519
|
"options": [16],
|
|
6150
6520
|
"value": [1025],
|
|
6151
6521
|
"placeholder": [1],
|
|
6152
|
-
"name": [
|
|
6153
|
-
"disabled": [
|
|
6154
|
-
"required": [
|
|
6522
|
+
"name": [513],
|
|
6523
|
+
"disabled": [516],
|
|
6524
|
+
"required": [516],
|
|
6155
6525
|
"hint": [1],
|
|
6156
6526
|
"errorMessage": [1, "error-message"],
|
|
6157
|
-
"invalid": [4]
|
|
6527
|
+
"invalid": [4],
|
|
6528
|
+
"formDisabled": [32]
|
|
6158
6529
|
},
|
|
6159
6530
|
"$listeners$": undefined,
|
|
6160
6531
|
"$lazyBundleId$": "-",
|
|
6161
|
-
"$attrsToReflect$": []
|
|
6532
|
+
"$attrsToReflect$": [["name", "name"], ["disabled", "disabled"], ["required", "required"]]
|
|
6162
6533
|
}; }
|
|
6163
6534
|
}
|
|
6164
6535
|
|
|
@@ -6191,7 +6562,7 @@ class ChSpinner {
|
|
|
6191
6562
|
label;
|
|
6192
6563
|
render() {
|
|
6193
6564
|
const labelled = Boolean(this.label);
|
|
6194
|
-
return (hAsync(Host, { key: '
|
|
6565
|
+
return (hAsync(Host, { key: '9182eecf066be099714a870fa601f744362e697d' }, hAsync("span", { key: 'd67f2572ab80facadd4d49043a892b16816b4fef', class: { spinner: true, [`spinner--${this.size}`]: true }, role: labelled ? 'status' : undefined, "aria-label": labelled ? this.label : undefined, "aria-hidden": labelled ? undefined : 'true' })));
|
|
6195
6566
|
}
|
|
6196
6567
|
static get style() { return chSpinnerCss(); }
|
|
6197
6568
|
static get cmpMeta() { return {
|
|
@@ -6207,17 +6578,28 @@ class ChSpinner {
|
|
|
6207
6578
|
}; }
|
|
6208
6579
|
}
|
|
6209
6580
|
|
|
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)}`;
|
|
6581
|
+
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
6582
|
|
|
6212
6583
|
let switchIds = 0;
|
|
6213
6584
|
class ChSwitch {
|
|
6214
6585
|
constructor(hostRef) {
|
|
6215
6586
|
registerInstance(this, hostRef);
|
|
6216
6587
|
this.chChange = createEvent(this, "chChange");
|
|
6588
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
6589
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
6590
|
+
}
|
|
6591
|
+
else {
|
|
6592
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
6593
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
6594
|
+
}
|
|
6217
6595
|
}
|
|
6218
6596
|
switchId = `ch-switch-${++switchIds}`;
|
|
6219
6597
|
hintId = `${this.switchId}-hint`;
|
|
6220
6598
|
errorId = `${this.switchId}-error`;
|
|
6599
|
+
initialChecked = false;
|
|
6600
|
+
internals;
|
|
6601
|
+
formDisabled = false;
|
|
6602
|
+
get host() { return getElement(this); }
|
|
6221
6603
|
/**
|
|
6222
6604
|
* Visible label rendered next to the switch, associated with it via
|
|
6223
6605
|
* `for`/`id`, so assistive technology announces the switch's purpose.
|
|
@@ -6264,6 +6646,39 @@ class ChSwitch {
|
|
|
6264
6646
|
this.checked = ev.target.checked;
|
|
6265
6647
|
this.chChange.emit(this.checked);
|
|
6266
6648
|
};
|
|
6649
|
+
syncForm() {
|
|
6650
|
+
const internals = this.internals;
|
|
6651
|
+
if (typeof internals?.setFormValue !== 'function') {
|
|
6652
|
+
return;
|
|
6653
|
+
}
|
|
6654
|
+
internals.setFormValue(this.checked ? this.value : null);
|
|
6655
|
+
const flags = {};
|
|
6656
|
+
let message;
|
|
6657
|
+
if (this.required && !this.checked) {
|
|
6658
|
+
flags.valueMissing = true;
|
|
6659
|
+
}
|
|
6660
|
+
if (this.invalid && this.errorMessage) {
|
|
6661
|
+
flags.customError = true;
|
|
6662
|
+
}
|
|
6663
|
+
message = this.errorMessage ?? (flags.valueMissing ? 'Please fill out this field.' : undefined);
|
|
6664
|
+
internals.setValidity(flags, message);
|
|
6665
|
+
}
|
|
6666
|
+
componentDidLoad() {
|
|
6667
|
+
this.initialChecked = this.checked;
|
|
6668
|
+
this.syncForm();
|
|
6669
|
+
this.host.addEventListener('change', this.markTouched);
|
|
6670
|
+
this.host.addEventListener('focusout', this.markTouched);
|
|
6671
|
+
this.host.addEventListener('invalid', this.markTouched);
|
|
6672
|
+
}
|
|
6673
|
+
markTouched = () => {
|
|
6674
|
+
this.host.setAttribute('data-touched', '');
|
|
6675
|
+
};
|
|
6676
|
+
formResetCallback() {
|
|
6677
|
+
this.checked = this.initialChecked;
|
|
6678
|
+
}
|
|
6679
|
+
formDisabledCallback(isDisabled) {
|
|
6680
|
+
this.formDisabled = isDisabled;
|
|
6681
|
+
}
|
|
6267
6682
|
get describedBy() {
|
|
6268
6683
|
if (this.invalid && this.errorMessage) {
|
|
6269
6684
|
return this.errorId;
|
|
@@ -6274,26 +6689,42 @@ class ChSwitch {
|
|
|
6274
6689
|
return undefined;
|
|
6275
6690
|
}
|
|
6276
6691
|
render() {
|
|
6277
|
-
return (hAsync(Host, { key: '
|
|
6692
|
+
return (hAsync(Host, { key: 'c1a98e9b04710ed014a8c18d6591fee427df0033' }, hAsync("label", { key: '4b14ec7d7709090235b0e9b74a45d4c76dd52f25', class: { 'control': true, 'control--disabled': this.disabled || this.formDisabled }, htmlFor: this.switchId }, hAsync("input", { key: '4f2c9472b3bf34db582a94e307cc8b47b5dfcd38', 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: '6b2c20c6242178bba39f105a535bb12fc5198cd0', class: "track" }, hAsync("span", { key: '4ae0e675ce335417b867f6b688ec5545769b2d2c', class: "thumb" })), this.label && hAsync("span", { key: 'd5383fac3349441104c0926a6c88078b85bda05c', class: "label-text" }, this.label)), this.hint && !(this.invalid && this.errorMessage) && (hAsync("p", { key: '41ed07a95f8d627fb4ed8c903b6ba5ee39baa6a5', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (hAsync("p", { key: '71cf8526dec44e2099235e3bc744db2aa53d70f0', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
6278
6693
|
}
|
|
6694
|
+
static get formAssociated() { return true; }
|
|
6695
|
+
static get watchers() { return {
|
|
6696
|
+
"checked": [{
|
|
6697
|
+
"syncForm": 0
|
|
6698
|
+
}],
|
|
6699
|
+
"required": [{
|
|
6700
|
+
"syncForm": 0
|
|
6701
|
+
}],
|
|
6702
|
+
"invalid": [{
|
|
6703
|
+
"syncForm": 0
|
|
6704
|
+
}],
|
|
6705
|
+
"errorMessage": [{
|
|
6706
|
+
"syncForm": 0
|
|
6707
|
+
}]
|
|
6708
|
+
}; }
|
|
6279
6709
|
static get style() { return chSwitchCss(); }
|
|
6280
6710
|
static get cmpMeta() { return {
|
|
6281
|
-
"$flags$":
|
|
6711
|
+
"$flags$": 585,
|
|
6282
6712
|
"$tagName$": "ch-switch",
|
|
6283
6713
|
"$members$": {
|
|
6284
6714
|
"label": [1],
|
|
6285
|
-
"name": [
|
|
6715
|
+
"name": [513],
|
|
6286
6716
|
"value": [1],
|
|
6287
6717
|
"checked": [1028],
|
|
6288
|
-
"disabled": [
|
|
6289
|
-
"required": [
|
|
6718
|
+
"disabled": [516],
|
|
6719
|
+
"required": [516],
|
|
6290
6720
|
"hint": [1],
|
|
6291
6721
|
"errorMessage": [1, "error-message"],
|
|
6292
|
-
"invalid": [4]
|
|
6722
|
+
"invalid": [4],
|
|
6723
|
+
"formDisabled": [32]
|
|
6293
6724
|
},
|
|
6294
6725
|
"$listeners$": undefined,
|
|
6295
6726
|
"$lazyBundleId$": "-",
|
|
6296
|
-
"$attrsToReflect$": []
|
|
6727
|
+
"$attrsToReflect$": [["name", "name"], ["disabled", "disabled"], ["required", "required"]]
|
|
6297
6728
|
}; }
|
|
6298
6729
|
}
|
|
6299
6730
|
|
|
@@ -6381,7 +6812,7 @@ class ChTabs {
|
|
|
6381
6812
|
}
|
|
6382
6813
|
render() {
|
|
6383
6814
|
const active = this.activeValue;
|
|
6384
|
-
return (hAsync(Host, { key: '
|
|
6815
|
+
return (hAsync(Host, { key: '7c6b34c34e73f034eb03473ad9941eade91317c3' }, hAsync("div", { key: '601bae37f4fb3e5e0d07fb7a91968171b0bd18a3', class: "tablist", role: "tablist", "aria-label": this.label, onKeyDown: this.handleKeyDown, ref: el => (this.tablistEl = el) }, this.tabs.map(tab => {
|
|
6385
6816
|
const selected = tab.value === active;
|
|
6386
6817
|
return (hAsync("button", { key: tab.value, type: "button", class: { 'tab': true, 'tab--active': selected, 'tab--disabled': Boolean(tab.disabled) }, role: "tab", id: this.tabId(tab.value), "data-value": tab.value, "aria-selected": selected ? 'true' : 'false', "aria-controls": this.panelId(tab.value), tabIndex: selected ? FIRST_TAB_INDEX : LAST_TAB_INDEX, disabled: tab.disabled, onClick: () => this.select(tab.value) }, tab.label));
|
|
6387
6818
|
})), this.tabs.map(tab => (hAsync("div", { key: `${tab.value}-panel`, class: "tabpanel", id: this.panelId(tab.value), role: "tabpanel", "aria-labelledby": this.tabId(tab.value), tabIndex: FIRST_TAB_INDEX, hidden: tab.value !== active }, hAsync("slot", { name: `panel-${tab.value}` }))))));
|
|
@@ -6401,7 +6832,7 @@ class ChTabs {
|
|
|
6401
6832
|
}; }
|
|
6402
6833
|
}
|
|
6403
6834
|
|
|
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)}`;
|
|
6835
|
+
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
6836
|
|
|
6406
6837
|
let textareaIds = 0;
|
|
6407
6838
|
const DEFAULT_ROWS = 4;
|
|
@@ -6410,10 +6841,21 @@ class ChTextarea {
|
|
|
6410
6841
|
registerInstance(this, hostRef);
|
|
6411
6842
|
this.chInput = createEvent(this, "chInput");
|
|
6412
6843
|
this.chChange = createEvent(this, "chChange");
|
|
6844
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
6845
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
6846
|
+
}
|
|
6847
|
+
else {
|
|
6848
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
6849
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
6850
|
+
}
|
|
6413
6851
|
}
|
|
6414
6852
|
textareaId = `ch-textarea-${++textareaIds}`;
|
|
6415
6853
|
hintId = `${this.textareaId}-hint`;
|
|
6416
6854
|
errorId = `${this.textareaId}-error`;
|
|
6855
|
+
initialValue = '';
|
|
6856
|
+
internals;
|
|
6857
|
+
formDisabled = false;
|
|
6858
|
+
get host() { return getElement(this); }
|
|
6417
6859
|
/**
|
|
6418
6860
|
* Visible label rendered above the textarea and associated with it via
|
|
6419
6861
|
* `for`/`id`, so assistive technology announces the textarea's purpose.
|
|
@@ -6472,6 +6914,39 @@ class ChTextarea {
|
|
|
6472
6914
|
this.value = ev.target.value;
|
|
6473
6915
|
this.chChange.emit(this.value);
|
|
6474
6916
|
};
|
|
6917
|
+
syncForm() {
|
|
6918
|
+
const internals = this.internals;
|
|
6919
|
+
if (typeof internals?.setFormValue !== 'function') {
|
|
6920
|
+
return;
|
|
6921
|
+
}
|
|
6922
|
+
internals.setFormValue(this.value);
|
|
6923
|
+
const flags = {};
|
|
6924
|
+
let message;
|
|
6925
|
+
if (this.required && this.value === '') {
|
|
6926
|
+
flags.valueMissing = true;
|
|
6927
|
+
}
|
|
6928
|
+
if (this.invalid && this.errorMessage) {
|
|
6929
|
+
flags.customError = true;
|
|
6930
|
+
}
|
|
6931
|
+
message = this.errorMessage ?? (flags.valueMissing ? 'Please fill out this field.' : undefined);
|
|
6932
|
+
internals.setValidity(flags, message);
|
|
6933
|
+
}
|
|
6934
|
+
componentDidLoad() {
|
|
6935
|
+
this.initialValue = this.value;
|
|
6936
|
+
this.syncForm();
|
|
6937
|
+
this.host.addEventListener('change', this.markTouched);
|
|
6938
|
+
this.host.addEventListener('focusout', this.markTouched);
|
|
6939
|
+
this.host.addEventListener('invalid', this.markTouched);
|
|
6940
|
+
}
|
|
6941
|
+
markTouched = () => {
|
|
6942
|
+
this.host.setAttribute('data-touched', '');
|
|
6943
|
+
};
|
|
6944
|
+
formResetCallback() {
|
|
6945
|
+
this.value = this.initialValue;
|
|
6946
|
+
}
|
|
6947
|
+
formDisabledCallback(isDisabled) {
|
|
6948
|
+
this.formDisabled = isDisabled;
|
|
6949
|
+
}
|
|
6475
6950
|
get describedBy() {
|
|
6476
6951
|
if (this.invalid && this.errorMessage) {
|
|
6477
6952
|
return this.errorId;
|
|
@@ -6482,27 +6957,43 @@ class ChTextarea {
|
|
|
6482
6957
|
return undefined;
|
|
6483
6958
|
}
|
|
6484
6959
|
render() {
|
|
6485
|
-
return (hAsync(Host, { key: '
|
|
6960
|
+
return (hAsync(Host, { key: '6e738612514b114571c1edfad0fb85e2228653a8' }, this.label && (hAsync("label", { key: '3b58b49a02dd532430cfd9096c326288a5120d6d', class: "label", htmlFor: this.textareaId }, this.label)), hAsync("textarea", { key: '0922df038ea6ce6d1567ffe8d02c5b65534bec7a', 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: '6d3518345b9afaad782741a854053ed2b32e31db', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (hAsync("p", { key: '8a26edd5a1ef3647133813003fb1a53b1a5f99d6', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
6486
6961
|
}
|
|
6962
|
+
static get formAssociated() { return true; }
|
|
6963
|
+
static get watchers() { return {
|
|
6964
|
+
"value": [{
|
|
6965
|
+
"syncForm": 0
|
|
6966
|
+
}],
|
|
6967
|
+
"required": [{
|
|
6968
|
+
"syncForm": 0
|
|
6969
|
+
}],
|
|
6970
|
+
"invalid": [{
|
|
6971
|
+
"syncForm": 0
|
|
6972
|
+
}],
|
|
6973
|
+
"errorMessage": [{
|
|
6974
|
+
"syncForm": 0
|
|
6975
|
+
}]
|
|
6976
|
+
}; }
|
|
6487
6977
|
static get style() { return chTextareaCss(); }
|
|
6488
6978
|
static get cmpMeta() { return {
|
|
6489
|
-
"$flags$":
|
|
6979
|
+
"$flags$": 585,
|
|
6490
6980
|
"$tagName$": "ch-textarea",
|
|
6491
6981
|
"$members$": {
|
|
6492
6982
|
"label": [1],
|
|
6493
6983
|
"value": [1025],
|
|
6494
6984
|
"placeholder": [1],
|
|
6495
6985
|
"rows": [2],
|
|
6496
|
-
"name": [
|
|
6497
|
-
"disabled": [
|
|
6498
|
-
"required": [
|
|
6986
|
+
"name": [513],
|
|
6987
|
+
"disabled": [516],
|
|
6988
|
+
"required": [516],
|
|
6499
6989
|
"hint": [1],
|
|
6500
6990
|
"errorMessage": [1, "error-message"],
|
|
6501
|
-
"invalid": [4]
|
|
6991
|
+
"invalid": [4],
|
|
6992
|
+
"formDisabled": [32]
|
|
6502
6993
|
},
|
|
6503
6994
|
"$listeners$": undefined,
|
|
6504
6995
|
"$lazyBundleId$": "-",
|
|
6505
|
-
"$attrsToReflect$": []
|
|
6996
|
+
"$attrsToReflect$": [["name", "name"], ["disabled", "disabled"], ["required", "required"]]
|
|
6506
6997
|
}; }
|
|
6507
6998
|
}
|
|
6508
6999
|
|
|
@@ -6591,7 +7082,7 @@ class ChTooltip {
|
|
|
6591
7082
|
trigger.setAttribute('aria-describedby', content.id);
|
|
6592
7083
|
};
|
|
6593
7084
|
render() {
|
|
6594
|
-
return (hAsync(Host, { key: '
|
|
7085
|
+
return (hAsync(Host, { key: 'cebea73595fe515f952e60c72c42e92888e57133' }, hAsync("span", { key: 'c2eadb27d9d89b19d821ae1da93dcb7125d07bb0', class: "anchor" }, hAsync("slot", { key: '9eccdd49e741ffaed3d7d95c54697666e6e13cf0', name: "trigger", onSlotchange: this.associate }), hAsync("span", { key: '0842bbc4061da0be353e58bc897548e75c730e43', class: { 'bubble': true, [`bubble--${this.placement}`]: true, 'bubble--visible': this.visible } }, hAsync("slot", { key: '43812aac1e6e2853057e6d34f484906a17b16a5a', name: "content", onSlotchange: this.associate })))));
|
|
6595
7086
|
}
|
|
6596
7087
|
static get style() { return chTooltipCss(); }
|
|
6597
7088
|
static get cmpMeta() { return {
|
|
@@ -6617,6 +7108,7 @@ registerComponents([
|
|
|
6617
7108
|
ChCard,
|
|
6618
7109
|
ChCheckbox,
|
|
6619
7110
|
ChDivider,
|
|
7111
|
+
ChEmoji,
|
|
6620
7112
|
ChInput,
|
|
6621
7113
|
ChLink,
|
|
6622
7114
|
ChModal,
|
|
@@ -6728,7 +7220,7 @@ var NAMESPACE = (
|
|
|
6728
7220
|
);
|
|
6729
7221
|
|
|
6730
7222
|
/*
|
|
6731
|
-
Stencil Hydrate Runner v4.44.
|
|
7223
|
+
Stencil Hydrate Runner v4.44.2 | MIT Licensed | https://stenciljs.com
|
|
6732
7224
|
*/
|
|
6733
7225
|
var __create = Object.create;
|
|
6734
7226
|
var __defProp = Object.defineProperty;
|