@devschile/chucao 2.6.0 → 2.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chucao/chucao.esm.js +1 -1
- package/dist/chucao/{p-ffaf1a31.entry.js → p-01b6c7bf.entry.js} +2 -2
- package/dist/chucao/{p-2c1bc8bd.entry.js → p-0c7f6f8d.entry.js} +2 -2
- package/dist/chucao/p-10f6801e.entry.js +2 -0
- package/dist/chucao/p-10f6801e.entry.js.map +1 -0
- package/dist/chucao/{p-0409c063.entry.js → p-15d27bb7.entry.js} +2 -2
- package/dist/chucao/{p-e6f959f4.entry.js → p-1b70e3f1.entry.js} +2 -2
- package/dist/chucao/{p-66ae9e2c.entry.js → p-1e4cd3aa.entry.js} +2 -2
- package/dist/chucao/{p-c1b35f1b.entry.js → p-2e37c61b.entry.js} +2 -2
- package/dist/chucao/{p-f7305552.entry.js → p-42028c97.entry.js} +2 -2
- package/dist/chucao/{p-090d26f1.entry.js → p-472ec451.entry.js} +2 -2
- package/dist/chucao/{p-81b6622f.entry.js → p-5240f5ac.entry.js} +2 -2
- package/dist/chucao/p-60e1c1df.entry.js +2 -0
- package/dist/chucao/{p-b56f4a29.entry.js.map → p-60e1c1df.entry.js.map} +1 -1
- package/dist/chucao/{p-b9b47942.entry.js → p-7cdc71cc.entry.js} +2 -2
- package/dist/chucao/{p-50cbea7f.entry.js → p-8ae680a4.entry.js} +2 -2
- package/dist/chucao/{p-20ea1b18.entry.js → p-90284ebe.entry.js} +2 -2
- package/dist/chucao/p-9db118d9.entry.js +2 -0
- package/dist/chucao/p-9ebcc7be.entry.js +2 -0
- package/dist/chucao/p-9ebcc7be.entry.js.map +1 -0
- package/dist/chucao/{p-207648f9.entry.js → p-a7c674b7.entry.js} +2 -2
- package/dist/chucao/{p-79f20bfd.entry.js → p-c4b2bd1f.entry.js} +2 -2
- package/dist/chucao/{p-7d4336bd.entry.js → p-c90da3c0.entry.js} +2 -2
- package/dist/chucao/p-d8b71751.entry.js +2 -0
- package/dist/chucao/p-d8b71751.entry.js.map +1 -0
- package/dist/chucao/{p-925af6b8.entry.js → p-deb2571b.entry.js} +2 -2
- package/dist/chucao/{p-9794a3fa.entry.js → p-e77d35c3.entry.js} +2 -2
- package/dist/chucao/{p-21ca2235.entry.js → p-f6ab0a11.entry.js} +2 -2
- package/dist/chucao/p-f917d34f.entry.js +2 -0
- package/dist/chucao/{p-e2f725bd.entry.js.map → p-f917d34f.entry.js.map} +1 -1
- package/dist/chucao/{p-f0aea6ed.entry.js → p-ffecdf25.entry.js} +2 -2
- package/dist/cjs/ch-accordion.cjs.entry.js +1 -1
- package/dist/cjs/ch-alert_8.cjs.entry.js +7 -7
- package/dist/cjs/ch-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/ch-cluster.cjs.entry.js +2 -2
- package/dist/cjs/ch-description-list.cjs.entry.js +1 -1
- package/dist/cjs/ch-divider.cjs.entry.js +1 -1
- package/dist/cjs/ch-drawer.cjs.entry.js +1 -1
- package/dist/cjs/ch-emoji.cjs.entry.js +1 -1
- package/dist/cjs/ch-empty-state.cjs.entry.js +1 -1
- package/dist/cjs/ch-grid.cjs.entry.js +1 -1
- package/dist/cjs/ch-icon-button.cjs.entry.js +1 -1
- package/dist/cjs/ch-icon.cjs.entry.js +1 -1
- package/dist/cjs/ch-modal.cjs.entry.js +1 -1
- package/dist/cjs/ch-number-input.cjs.entry.js +237 -0
- package/dist/cjs/ch-number-input.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-page-header.cjs.entry.js +1 -1
- package/dist/cjs/ch-radio.cjs.entry.js +1 -1
- package/dist/cjs/ch-segmented-control.cjs.entry.js +1 -1
- package/dist/cjs/ch-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/ch-stack.cjs.entry.js +1 -1
- package/dist/cjs/ch-stat.cjs.entry.js +2 -2
- package/dist/cjs/ch-table.cjs.entry.js +145 -0
- package/dist/cjs/ch-table.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-tabs.cjs.entry.js +1 -1
- package/dist/cjs/ch-textarea.cjs.entry.js +1 -1
- package/dist/cjs/ch-timeline.cjs.entry.js +1 -1
- package/dist/cjs/ch-tooltip.cjs.entry.js +24 -7
- package/dist/cjs/ch-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/chucao.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/ch-accordion/ch-accordion.js +1 -1
- package/dist/collection/components/ch-alert/ch-alert.js +1 -1
- package/dist/collection/components/ch-badge/ch-badge.js +1 -1
- package/dist/collection/components/ch-card/ch-card.js +1 -1
- package/dist/collection/components/ch-checkbox/ch-checkbox.js +1 -1
- package/dist/collection/components/ch-cluster/ch-cluster.js +2 -2
- package/dist/collection/components/ch-description-list/ch-description-list.js +1 -1
- package/dist/collection/components/ch-divider/ch-divider.js +1 -1
- package/dist/collection/components/ch-drawer/ch-drawer.js +1 -1
- package/dist/collection/components/ch-emoji/ch-emoji.js +1 -1
- package/dist/collection/components/ch-empty-state/ch-empty-state.js +1 -1
- package/dist/collection/components/ch-grid/ch-grid.js +1 -1
- package/dist/collection/components/ch-icon/ch-icon.js +1 -1
- package/dist/collection/components/ch-icon-button/ch-icon-button.js +1 -1
- package/dist/collection/components/ch-input/ch-input.js +1 -1
- package/dist/collection/components/ch-modal/ch-modal.js +1 -1
- package/dist/collection/components/ch-number-input/ch-number-input.css +74 -0
- package/dist/collection/components/ch-number-input/ch-number-input.js +555 -0
- package/dist/collection/components/ch-number-input/ch-number-input.js.map +1 -0
- package/dist/collection/components/ch-page-header/ch-page-header.js +1 -1
- package/dist/collection/components/ch-radio/ch-radio.js +1 -1
- package/dist/collection/components/ch-segmented-control/ch-segmented-control.js +1 -1
- package/dist/collection/components/ch-select/ch-select.js +1 -1
- package/dist/collection/components/ch-skeleton/ch-skeleton.js +1 -1
- package/dist/collection/components/ch-spinner/ch-spinner.js +1 -1
- package/dist/collection/components/ch-stack/ch-stack.js +1 -1
- package/dist/collection/components/ch-stat/ch-stat.js +2 -2
- package/dist/collection/components/ch-switch/ch-switch.js +1 -1
- package/dist/collection/components/ch-table/ch-table.css +107 -0
- package/dist/collection/components/ch-table/ch-table.js +347 -0
- package/dist/collection/components/ch-table/ch-table.js.map +1 -0
- package/dist/collection/components/ch-tabs/ch-tabs.js +1 -1
- package/dist/collection/components/ch-textarea/ch-textarea.js +1 -1
- package/dist/collection/components/ch-timeline/ch-timeline.js +1 -1
- package/dist/collection/components/ch-tooltip/ch-tooltip.css +11 -0
- package/dist/collection/components/ch-tooltip/ch-tooltip.js +23 -6
- package/dist/collection/components/ch-tooltip/ch-tooltip.js.map +1 -1
- package/dist/collection/utils/overlay.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-card.js.map +1 -1
- package/dist/components/ch-checkbox.js +1 -1
- package/dist/components/ch-cluster.js +1 -1
- package/dist/components/ch-description-list.js +1 -1
- package/dist/components/ch-divider.js +1 -1
- package/dist/components/ch-drawer.js +1 -1
- package/dist/components/ch-emoji.js +1 -1
- package/dist/components/ch-empty-state.js +1 -1
- package/dist/components/ch-grid.js +1 -1
- package/dist/components/ch-icon-button.js +1 -1
- package/dist/components/ch-icon.js +1 -1
- package/dist/components/ch-input.js +1 -1
- package/dist/components/ch-modal.js +1 -1
- package/dist/components/ch-number-input.d.ts +11 -0
- package/dist/components/ch-number-input.js +2 -0
- package/dist/components/ch-number-input.js.map +1 -0
- package/dist/components/ch-page-header.js +1 -1
- package/dist/components/ch-radio.js +1 -1
- package/dist/components/ch-segmented-control.js +1 -1
- package/dist/components/ch-select.js +1 -1
- package/dist/components/ch-skeleton.js +1 -1
- package/dist/components/ch-spinner.js +1 -1
- package/dist/components/ch-stack.js +1 -1
- package/dist/components/ch-stat.js +1 -1
- package/dist/components/ch-switch.js +1 -1
- package/dist/components/ch-table.d.ts +11 -0
- package/dist/components/ch-table.js +2 -0
- package/dist/components/ch-table.js.map +1 -0
- package/dist/components/ch-tabs.js +1 -1
- package/dist/components/ch-textarea.js +1 -1
- package/dist/components/ch-timeline.js +1 -1
- package/dist/components/ch-tooltip.js +1 -1
- package/dist/components/ch-tooltip.js.map +1 -1
- package/dist/components/{p-Cw0b4OGc.js → p-DiUN1WGc.js} +2 -2
- package/dist/esm/ch-accordion.entry.js +1 -1
- package/dist/esm/ch-alert_8.entry.js +7 -7
- package/dist/esm/ch-checkbox.entry.js +1 -1
- package/dist/esm/ch-cluster.entry.js +2 -2
- package/dist/esm/ch-description-list.entry.js +1 -1
- package/dist/esm/ch-divider.entry.js +1 -1
- package/dist/esm/ch-drawer.entry.js +1 -1
- package/dist/esm/ch-emoji.entry.js +1 -1
- package/dist/esm/ch-empty-state.entry.js +1 -1
- package/dist/esm/ch-grid.entry.js +1 -1
- package/dist/esm/ch-icon-button.entry.js +1 -1
- package/dist/esm/ch-icon.entry.js +1 -1
- package/dist/esm/ch-modal.entry.js +1 -1
- package/dist/esm/ch-number-input.entry.js +235 -0
- package/dist/esm/ch-number-input.entry.js.map +1 -0
- package/dist/esm/ch-page-header.entry.js +1 -1
- package/dist/esm/ch-radio.entry.js +1 -1
- package/dist/esm/ch-segmented-control.entry.js +1 -1
- package/dist/esm/ch-skeleton.entry.js +1 -1
- package/dist/esm/ch-stack.entry.js +1 -1
- package/dist/esm/ch-stat.entry.js +2 -2
- package/dist/esm/ch-table.entry.js +143 -0
- package/dist/esm/ch-table.entry.js.map +1 -0
- package/dist/esm/ch-tabs.entry.js +1 -1
- package/dist/esm/ch-textarea.entry.js +1 -1
- package/dist/esm/ch-timeline.entry.js +1 -1
- package/dist/esm/ch-tooltip.entry.js +24 -7
- package/dist/esm/ch-tooltip.entry.js.map +1 -1
- package/dist/esm/chucao.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/ch-number-input/ch-number-input.d.ts +105 -0
- package/dist/types/components/ch-table/ch-table.d.ts +106 -0
- package/dist/types/components/ch-tooltip/ch-tooltip.d.ts +7 -0
- package/dist/types/components.d.ts +459 -0
- package/dist/types/utils/overlay.d.ts +1 -1
- package/dist-react/components.d.ts +15 -1
- package/dist-react/components.js +21 -0
- package/dist-react/components.ts +31 -1
- package/dist-vue/index.d.ts +2 -0
- package/dist-vue/index.js +33 -0
- package/dist-vue/index.ts +37 -0
- package/hydrate/index.js +519 -37
- package/hydrate/index.mjs +519 -37
- package/package.json +9 -1
- package/dist/chucao/p-370d9629.entry.js +0 -2
- package/dist/chucao/p-370d9629.entry.js.map +0 -1
- package/dist/chucao/p-95061461.entry.js +0 -2
- package/dist/chucao/p-b56f4a29.entry.js +0 -2
- package/dist/chucao/p-e2f725bd.entry.js +0 -2
- /package/dist/chucao/{p-ffaf1a31.entry.js.map → p-01b6c7bf.entry.js.map} +0 -0
- /package/dist/chucao/{p-2c1bc8bd.entry.js.map → p-0c7f6f8d.entry.js.map} +0 -0
- /package/dist/chucao/{p-0409c063.entry.js.map → p-15d27bb7.entry.js.map} +0 -0
- /package/dist/chucao/{p-e6f959f4.entry.js.map → p-1b70e3f1.entry.js.map} +0 -0
- /package/dist/chucao/{p-66ae9e2c.entry.js.map → p-1e4cd3aa.entry.js.map} +0 -0
- /package/dist/chucao/{p-c1b35f1b.entry.js.map → p-2e37c61b.entry.js.map} +0 -0
- /package/dist/chucao/{p-f7305552.entry.js.map → p-42028c97.entry.js.map} +0 -0
- /package/dist/chucao/{p-090d26f1.entry.js.map → p-472ec451.entry.js.map} +0 -0
- /package/dist/chucao/{p-81b6622f.entry.js.map → p-5240f5ac.entry.js.map} +0 -0
- /package/dist/chucao/{p-b9b47942.entry.js.map → p-7cdc71cc.entry.js.map} +0 -0
- /package/dist/chucao/{p-50cbea7f.entry.js.map → p-8ae680a4.entry.js.map} +0 -0
- /package/dist/chucao/{p-20ea1b18.entry.js.map → p-90284ebe.entry.js.map} +0 -0
- /package/dist/chucao/{p-95061461.entry.js.map → p-9db118d9.entry.js.map} +0 -0
- /package/dist/chucao/{p-207648f9.entry.js.map → p-a7c674b7.entry.js.map} +0 -0
- /package/dist/chucao/{p-79f20bfd.entry.js.map → p-c4b2bd1f.entry.js.map} +0 -0
- /package/dist/chucao/{p-7d4336bd.entry.js.map → p-c90da3c0.entry.js.map} +0 -0
- /package/dist/chucao/{p-925af6b8.entry.js.map → p-deb2571b.entry.js.map} +0 -0
- /package/dist/chucao/{p-9794a3fa.entry.js.map → p-e77d35c3.entry.js.map} +0 -0
- /package/dist/chucao/{p-21ca2235.entry.js.map → p-f6ab0a11.entry.js.map} +0 -0
- /package/dist/chucao/{p-f0aea6ed.entry.js.map → p-ffecdf25.entry.js.map} +0 -0
- /package/dist/components/{p-Cw0b4OGc.js.map → p-DiUN1WGc.js.map} +0 -0
|
@@ -50,7 +50,7 @@ const ChAlert = class {
|
|
|
50
50
|
render() {
|
|
51
51
|
const role = this.variant === 'warning' ? 'alert' : 'status';
|
|
52
52
|
const shapes = this.statusCue ? chIcons[VARIANT_ICON[this.variant]] : undefined;
|
|
53
|
-
return (h(Host, { key: '
|
|
53
|
+
return (h(Host, { key: 'a223f49acce9b1336d1791c547be15e76e6fd740' }, h("div", { key: role, class: { alert: true, [`alert--${this.variant}`]: true }, role: role }, shapes && (h("svg", { key: 'd14bf776a7c2c570203d4785c51a7e2e2110a837', class: "alert-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true", focusable: "false" }, shapes.map(shape => h(shape.tag, shape.attrs)))), h("div", { key: 'be4eb0acb06ba3b95eae29a08911f4e3a76a5998', class: "alert-content" }, h("slot", { key: '1ebb312baa833210658003113d6aee562a05cb50' })), this.dismissLabel && (h("button", { key: '388986c78e41cf66e74071a27c0ffa9a146fcacb', class: "alert-dismiss", type: "button", "aria-label": this.dismissLabel, onClick: this.handleDismiss }, h("span", { key: '24c24edbee8549bb64a6e9dcc381ebdae8d5d72d', "aria-hidden": "true" }, "\u00D7"))))));
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
56
|
ChAlert.style = chAlertCss();
|
|
@@ -72,7 +72,7 @@ const ChBadge = class {
|
|
|
72
72
|
*/
|
|
73
73
|
statusCue = true;
|
|
74
74
|
render() {
|
|
75
|
-
return (h(Host, { key: '
|
|
75
|
+
return (h(Host, { key: '8d92a45ab1f2932deb6a316d20e3aecd59d35498' }, h("span", { key: '16e499ffe26d47e2da057fd49fa214fba0dc9277', class: { badge: true, [`badge--${this.variant}`]: true } }, this.statusCue && h("span", { key: '040dbe5203403812ed98f84b03029ae38071f533', class: "badge-dot", "aria-hidden": "true" }), h("slot", { key: '89c1c35f937bc141bad71a9bee0f76d8b2d28666' }))));
|
|
76
76
|
}
|
|
77
77
|
};
|
|
78
78
|
ChBadge.style = chBadgeCss();
|
|
@@ -176,7 +176,7 @@ const ChCard = class {
|
|
|
176
176
|
registerInstance(this, hostRef);
|
|
177
177
|
}
|
|
178
178
|
render() {
|
|
179
|
-
return (h(Host, { key: '
|
|
179
|
+
return (h(Host, { key: '2857d45b454709a8285fd52dbaa0943d571908b1' }, h("div", { key: 'a252222f7d25a697b4d6e8cd240564668a908652', class: "card" }, h("slot", { key: '4cadc2ad7fdbb2141d2a77bc19d5e6344e574b7a' }))));
|
|
180
180
|
}
|
|
181
181
|
};
|
|
182
182
|
ChCard.style = chCardCss();
|
|
@@ -302,7 +302,7 @@ const ChInput = class {
|
|
|
302
302
|
return undefined;
|
|
303
303
|
}
|
|
304
304
|
render() {
|
|
305
|
-
return (h(Host, { key: '
|
|
305
|
+
return (h(Host, { key: '2b6755db381eeecb5c7c15730f351b5a28b2f89a' }, this.label && (h("label", { key: 'a4c4be2f9ca0dddc175597a12d2e48c3a5030131', class: "label", htmlFor: this.inputId }, this.label)), h("input", { key: 'b080e37229425a745588d6080bab48cf62be8aa8', 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) && (h("p", { key: '857edf91f7b9657b34763fa06bae3d57e07d861c', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (h("p", { key: '4516a30cd0d40e3b9e53430416934497c92b1f88', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
306
306
|
}
|
|
307
307
|
static get formAssociated() { return true; }
|
|
308
308
|
static get watchers() { return {
|
|
@@ -434,7 +434,7 @@ const ChSelect = class {
|
|
|
434
434
|
return undefined;
|
|
435
435
|
}
|
|
436
436
|
render() {
|
|
437
|
-
return (h(Host, { key: '
|
|
437
|
+
return (h(Host, { key: 'f57fbcbfaaf64a9cbf1f201edd2f9f714db9afee' }, this.label && (h("label", { key: 'e7a4a802ff85cd597e5bdb9a54858e3cbbbcf73b', class: "label", htmlFor: this.selectId }, this.label)), h("select", { key: '5d70a598757d9440d90351e8639a876388b5f7a7', 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 && (h("option", { key: '9a002af8f52ab2bb2d2c762417cad071b7dd06c7', value: "", disabled: true, hidden: true, selected: !this.value }, this.placeholder)), this.options.map(option => (h("option", { value: option.value, disabled: option.disabled, selected: option.value === this.value }, option.label)))), this.hint && !(this.invalid && this.errorMessage) && (h("p", { key: '0224ab6e0a54b925e0754c43bb15ceaab84c34a4', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (h("p", { key: '1624ae9938d47971ee8195f986c45454dad7f846', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
438
438
|
}
|
|
439
439
|
static get formAssociated() { return true; }
|
|
440
440
|
static get watchers() { return {
|
|
@@ -475,7 +475,7 @@ const ChSpinner = class {
|
|
|
475
475
|
label;
|
|
476
476
|
render() {
|
|
477
477
|
const labelled = Boolean(this.label);
|
|
478
|
-
return (h(Host, { key: '
|
|
478
|
+
return (h(Host, { key: '1d8ef18f03d7a52d61854cc84fb39994ee8ce0a9' }, h("span", { key: '28ec4657d1a0de9181f9d31742fc6bd26b284b14', class: { spinner: true, [`spinner--${this.size}`]: true }, role: labelled ? 'status' : undefined, "aria-label": labelled ? this.label : undefined, "aria-hidden": labelled ? undefined : 'true' })));
|
|
479
479
|
}
|
|
480
480
|
};
|
|
481
481
|
ChSpinner.style = chSpinnerCss();
|
|
@@ -588,7 +588,7 @@ const ChSwitch = class {
|
|
|
588
588
|
return undefined;
|
|
589
589
|
}
|
|
590
590
|
render() {
|
|
591
|
-
return (h(Host, { key: '
|
|
591
|
+
return (h(Host, { key: '8bafcbe9b03858f278f0884d43b9ce579a98c84e' }, h("label", { key: '8783c0e8ce0bb9c03a3772a08afb383e338b5be4', class: { 'control': true, 'control--disabled': this.disabled || this.formDisabled }, htmlFor: this.switchId }, h("input", { key: '4093d398ed167ede08749050b6a9c9d5b25f2470', 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 }), h("span", { key: 'eea728ebbf6c6fefd761415bf8cb00765e5c2e76', class: "track" }, h("span", { key: '4d18d8c9ed871bbf6e537b93bcce14c0f00f00e9', class: "thumb" })), this.label && h("span", { key: '048657735d8fdf9a03a89b83cf3f3d65a466d886', class: "label-text" }, this.label)), this.hint && !(this.invalid && this.errorMessage) && (h("p", { key: '869a40f9ce8bd2f93d918426f119c637039ac5e9', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (h("p", { key: '08d947e2909706290b7efbb3e8af6999ad249dea', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
592
592
|
}
|
|
593
593
|
static get formAssociated() { return true; }
|
|
594
594
|
static get watchers() { return {
|
|
@@ -109,7 +109,7 @@ const ChCheckbox = class {
|
|
|
109
109
|
return undefined;
|
|
110
110
|
}
|
|
111
111
|
render() {
|
|
112
|
-
return (h(Host, { key: '
|
|
112
|
+
return (h(Host, { key: 'b3ea4a0cfad08ea8c00ac1fbdb54f130a76943b4' }, h("label", { key: '7e1736c41138ab6b73ee30590f290768feb786a1', class: { 'control': true, 'control--disabled': this.disabled || this.formDisabled }, htmlFor: this.checkboxId }, h("input", { key: '1d70b3936da371de75a931e3033f08ed05b62101', 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 && h("span", { key: '581b62c2a907bc9634d8c137f2539e47c90f79e1', class: "label-text" }, this.label)), this.hint && !(this.invalid && this.errorMessage) && (h("p", { key: '51ea863dd984d90fdf70a6f6d8dabdffa92d7340', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (h("p", { key: '561ef3469af4bbf8f4eef568a0372f78618c047b', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
113
113
|
}
|
|
114
114
|
static get formAssociated() { return true; }
|
|
115
115
|
static get watchers() { return {
|
|
@@ -28,13 +28,13 @@ const ChCluster = class {
|
|
|
28
28
|
return GAPS.has(this.gap) ? this.gap : 'md';
|
|
29
29
|
}
|
|
30
30
|
render() {
|
|
31
|
-
return (h(Host, { key: '
|
|
31
|
+
return (h(Host, { key: '63f10662f55078a9aec2680653c040c8411cd80f', class: {
|
|
32
32
|
'cluster': true,
|
|
33
33
|
[`cluster--gap-${this.gapStep}`]: true,
|
|
34
34
|
[`cluster--align-${this.align}`]: true,
|
|
35
35
|
[`cluster--justify-${this.justify}`]: true,
|
|
36
36
|
'cluster--nowrap': !this.wrap,
|
|
37
|
-
} }, h("slot", { key: '
|
|
37
|
+
} }, h("slot", { key: '60f9896089d707fe0ef1980dcb9115bcf3308a2f' })));
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
40
|
ChCluster.style = chClusterCss();
|
|
@@ -16,7 +16,7 @@ const ChDescriptionList = class {
|
|
|
16
16
|
return COLUMNS.has(this.columns) ? this.columns : '1';
|
|
17
17
|
}
|
|
18
18
|
render() {
|
|
19
|
-
return (h(Host, { key: '
|
|
19
|
+
return (h(Host, { key: '2f349aa14dc442e4e531dacc2d9f6b02fc2b141a' }, h("dl", { key: 'de4bf1b60c31f0319bc5e169304134c8e0046912', class: `list list--columns-${this.columnCount}` }, h("slot", { key: '4ef568fa3e64048ba6e586ae9e8d10c21ad326aa' }))));
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
ChDescriptionList.style = chDescriptionListCss();
|
|
@@ -11,7 +11,7 @@ const ChDivider = class {
|
|
|
11
11
|
*/
|
|
12
12
|
orientation = 'horizontal';
|
|
13
13
|
render() {
|
|
14
|
-
return (h(Host, { key: '
|
|
14
|
+
return (h(Host, { key: '0ae19c8f91c810836781f7dac098b49b99c01389', class: { 'divider--vertical': this.orientation === 'vertical' } }, h("hr", { key: 'f5b782f7d67da28ec659fceef32ebf0f4d8ca521', class: { divider: true, [`divider--${this.orientation}`]: true }, "aria-orientation": this.orientation })));
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
17
|
ChDivider.style = chDividerCss();
|
|
@@ -136,7 +136,7 @@ const ChDrawer = class {
|
|
|
136
136
|
this.chClose.emit();
|
|
137
137
|
};
|
|
138
138
|
render() {
|
|
139
|
-
return (h(Host, { key: '
|
|
139
|
+
return (h(Host, { key: '871af03f0944e4272be64c1452cc28a0a39ac0f2' }, h("dialog", { key: '540da9d2bff68d5528e65146b2a049adbc9723c2', class: { drawer: true, [`drawer--${this.side}`]: true }, "aria-label": this.label, ref: el => (this.dialog = el) }, h("div", { key: 'de569a4d239dd5e2bf6b2741b77307eb70ddced1', class: "drawer-head" }, h("slot", { key: 'e28ade42e0835a919aa5447dafbbbfff2de903d7', name: "header" }), this.closeLabel && (h("button", { key: '5cf29d8b791652fce663459f479826564637d6ca', class: "drawer-close", type: "button", "aria-label": this.closeLabel, onClick: this.handleCloseClick }, h("span", { key: '06a24d8b140db10b9d543530ea5dfbd8dd991019', "aria-hidden": "true" }, "\u00D7")))), h("div", { key: 'b593bac5fb45234d501d3ec540f00d804ae5e066', class: "drawer-body" }, h("slot", { key: '854cb053b30234aa31d59fcf27bb7d2820311eb3' })), h("slot", { key: '5c1fb51d3636af1762b26d72f5eaa79c5f779a60', name: "footer" }))));
|
|
140
140
|
}
|
|
141
141
|
static get watchers() { return {
|
|
142
142
|
"open": [{
|
|
@@ -82,7 +82,7 @@ const ChEmoji = class {
|
|
|
82
82
|
this.loaded = true;
|
|
83
83
|
};
|
|
84
84
|
render() {
|
|
85
|
-
return (h(Host, { key: '
|
|
85
|
+
return (h(Host, { key: '8444f71f1c84fd8b1940503c5e7bf5ff62bbb9e6' }, h("img", { key: 'ce9c083238c87557f71838ab8de50038fc43a2bd', class: {
|
|
86
86
|
'emoji': true,
|
|
87
87
|
[`emoji--${this.size}`]: true,
|
|
88
88
|
'emoji--hidden': !this.loaded,
|
|
@@ -21,7 +21,7 @@ const ChEmptyState = class {
|
|
|
21
21
|
*/
|
|
22
22
|
size = 'md';
|
|
23
23
|
render() {
|
|
24
|
-
return (h(Host, { key: '
|
|
24
|
+
return (h(Host, { key: '8ed0e4e1712c415ccc38050011af09c778a6bb48', class: { 'empty-state': true, [`empty-state--${this.size}`]: true } }, h("div", { key: '63a6dd1e1678c48da81af7e89dc90fd2288fdbfa', class: "empty-state__inner" }, h("div", { key: '3753c28a9268eff9ebb936f3b8f9d4257e63ca41', class: "empty-state__icon", "aria-hidden": "true" }, h("slot", { key: 'abc7a5a2b84d7d4d5be3cd5dcfa3da217e480a4f', name: "icon" })), h("h3", { key: 'c6be0381802f307f35ea81a58fe8571d0799b97a', class: "empty-state__title" }, this.title), this.description && h("p", { key: 'e8c953d3ed017ed9fd06c572a7d601217be317e3', class: "empty-state__description" }, this.description), h("div", { key: 'da062b6ceabc34cced61ed900f09025a83f401f4', class: "empty-state__actions" }, h("slot", { key: '18930706af315dfbb2da7a492c79d3a468be3574' })))));
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
27
|
ChEmptyState.style = chEmptyStateCss();
|
|
@@ -46,7 +46,7 @@ const ChGrid = class {
|
|
|
46
46
|
this.el.style.setProperty('--ch-grid-columns', template);
|
|
47
47
|
}
|
|
48
48
|
render() {
|
|
49
|
-
return (h(Host, { key: '
|
|
49
|
+
return (h(Host, { key: 'de6c2d15da9a5d735327df077c6b58abe9775267', class: { grid: true, [`grid--gap-${this.gapStep}`]: true } }, h("slot", { key: '348289bcf2f46fb07e7392afa00c4619d6614fef' })));
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
52
|
ChGrid.style = chGridCss();
|
|
@@ -38,7 +38,7 @@ const ChIconButton = class {
|
|
|
38
38
|
};
|
|
39
39
|
render() {
|
|
40
40
|
const shapes = this.name ? chIcons[this.name] : undefined;
|
|
41
|
-
return (h(Host, { key: '
|
|
41
|
+
return (h(Host, { key: 'cdef3ba2a7577cb7119aa943138746905de21dbb' }, h("button", { key: '2b3afb472d1483b84927a47e997d1f44665f5c62', class: `button button--${this.size}`, type: this.type, "aria-label": this.label, "aria-busy": this.loading ? 'true' : undefined, "aria-disabled": this.disabled ? 'true' : undefined, onClick: this.handleClick }, h("svg", { key: 'cdbe7d1bcb75b9a3bc9c6613a5baf3a7421b20d9', class: "icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true", focusable: "false" }, (shapes ?? []).map(shape => h(shape.tag, shape.attrs))))));
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
ChIconButton.style = chIconButtonCss();
|
|
@@ -25,7 +25,7 @@ const ChIcon = class {
|
|
|
25
25
|
render() {
|
|
26
26
|
const shapes = this.name ? chIcons[this.name] : undefined;
|
|
27
27
|
const decorative = !this.label;
|
|
28
|
-
return (h(Host, { key: '
|
|
28
|
+
return (h(Host, { key: 'f45fcd8a7f620f12942e3c1dd1c68a16009905ad' }, h("svg", { key: 'c529a79b5ae690200fa0f66aa7eb482e26409ed5', class: `icon icon--${this.size}`, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", role: decorative ? undefined : 'img', "aria-label": this.label, "aria-hidden": decorative ? 'true' : undefined, focusable: "false" }, (shapes ?? []).map(shape => h(shape.tag, shape.attrs)))));
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
ChIcon.style = chIconCss();
|
|
@@ -138,7 +138,7 @@ const ChModal = class {
|
|
|
138
138
|
this.chClose.emit();
|
|
139
139
|
};
|
|
140
140
|
render() {
|
|
141
|
-
return (h(Host, { key: '
|
|
141
|
+
return (h(Host, { key: 'b0fced593159cc6e6952831f9460cce1efd532d4' }, h("dialog", { key: '81180fe5cdd62df43f5aa35a8358b4e86cc8dc40', class: { modal: true, [`modal--${this.size}`]: true }, "aria-label": this.label, ref: el => (this.dialog = el) }, h("div", { key: '4c13adb1131ee26978f607b86e7eb8a9e65ce3a7', class: "modal-head" }, h("slot", { key: '4cb35bd7f0c290ef0c7aec5df60a839f8c383e66', name: "heading" }), this.closeLabel && (h("button", { key: 'f967cf89873760e1156081a77402d12252cbc20d', class: "modal-close", type: "button", "aria-label": this.closeLabel, onClick: this.handleCloseClick }, h("span", { key: '719e26b74726be28f50587dca769c257db3ecdec', "aria-hidden": "true" }, "\u00D7")))), h("div", { key: 'b6a44ef698e580031aa9efa5b5a177c9c1218488', class: "modal-body" }, h("slot", { key: '27c107491182196ee3ea3aa8d6746da0a9be40a6' })))));
|
|
142
142
|
}
|
|
143
143
|
static get watchers() { return {
|
|
144
144
|
"open": [{
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, a as getElement, h, H as Host } from './index-CIV5Gg1o.js';
|
|
2
|
+
import { r as resolveValidity } from './validation-message-BXzZsX2r.js';
|
|
3
|
+
|
|
4
|
+
const chNumberInputCss = () => `: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)}`;
|
|
5
|
+
|
|
6
|
+
let numberInputIds = 0;
|
|
7
|
+
const ChNumberInput = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
registerInstance(this, hostRef);
|
|
10
|
+
this.chInput = createEvent(this, "chInput");
|
|
11
|
+
this.chChange = createEvent(this, "chChange");
|
|
12
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
13
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
17
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
inputId = `ch-number-input-${++numberInputIds}`;
|
|
21
|
+
hintId = `${this.inputId}-hint`;
|
|
22
|
+
errorId = `${this.inputId}-error`;
|
|
23
|
+
initialValue = '';
|
|
24
|
+
internals;
|
|
25
|
+
formDisabled = false;
|
|
26
|
+
get host() { return getElement(this); }
|
|
27
|
+
/** Visible label, associated with the input via `for`/`id`. */
|
|
28
|
+
label;
|
|
29
|
+
/**
|
|
30
|
+
* Canonical value: digits only for `clp`, a plain decimal string for `plain`.
|
|
31
|
+
* Never formatted — formatting lives in the rendered text.
|
|
32
|
+
*/
|
|
33
|
+
value = '';
|
|
34
|
+
/** How the number is displayed while typing. */
|
|
35
|
+
format = 'plain';
|
|
36
|
+
/** Placeholder shown when the field is empty. */
|
|
37
|
+
placeholder;
|
|
38
|
+
/** Name submitted with the form. */
|
|
39
|
+
name;
|
|
40
|
+
/** Whether the field is disabled. */
|
|
41
|
+
disabled = false;
|
|
42
|
+
/** Whether a value is required; an empty field is then invalid. */
|
|
43
|
+
required = false;
|
|
44
|
+
/** Minimum accepted value. */
|
|
45
|
+
min;
|
|
46
|
+
/** Maximum accepted value. */
|
|
47
|
+
max;
|
|
48
|
+
/** Stepping increment. `'any'` disables stepping validation. */
|
|
49
|
+
step = 'any';
|
|
50
|
+
/** Helper text, replaced by `errorMessage` when invalid. */
|
|
51
|
+
hint;
|
|
52
|
+
/** Custom error message; wins over the built-in range messages. */
|
|
53
|
+
errorMessage;
|
|
54
|
+
/** Whether the field is marked invalid by the consumer. */
|
|
55
|
+
invalid = false;
|
|
56
|
+
/** Emitted on every keystroke with the canonical value. */
|
|
57
|
+
chInput;
|
|
58
|
+
/** Emitted on commit (native `change`) with the canonical value. */
|
|
59
|
+
chChange;
|
|
60
|
+
/**
|
|
61
|
+
* The text in the input, which may be a partial number like `-` or `1.`.
|
|
62
|
+
* This is the only thing rendered, so it is also what a reset must restore.
|
|
63
|
+
*/
|
|
64
|
+
draft = '';
|
|
65
|
+
/**
|
|
66
|
+
* Whether the user has typed since the last commit. While false the input
|
|
67
|
+
* renders `value` directly, which is what makes `formResetCallback` and a
|
|
68
|
+
* consumer assigning `.value` repaint without extra bookkeeping.
|
|
69
|
+
*/
|
|
70
|
+
typing = false;
|
|
71
|
+
componentWillLoad() {
|
|
72
|
+
this.draft = this.formatDisplay(this.value);
|
|
73
|
+
}
|
|
74
|
+
get decimals() {
|
|
75
|
+
return this.format !== 'clp';
|
|
76
|
+
}
|
|
77
|
+
/** Formats a canonical value for display. */
|
|
78
|
+
formatDisplay(value) {
|
|
79
|
+
if (value === '') {
|
|
80
|
+
return '';
|
|
81
|
+
}
|
|
82
|
+
if (this.format === 'clp') {
|
|
83
|
+
const digits = value.replace(/\D/gu, '');
|
|
84
|
+
return digits === '' ? '' : Number(digits).toLocaleString('es-CL');
|
|
85
|
+
}
|
|
86
|
+
return value;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Strips display formatting back to the canonical string: digits only for
|
|
90
|
+
* CLP; a leading sign, digits and one decimal separator for `plain`.
|
|
91
|
+
*/
|
|
92
|
+
toCanonical(text) {
|
|
93
|
+
if (this.format === 'clp') {
|
|
94
|
+
return text.replace(/\D/gu, '');
|
|
95
|
+
}
|
|
96
|
+
const normalised = text.replace(/\s/gu, '').replace(',', '.');
|
|
97
|
+
const match = /^-?\d*(?:\.\d*)?/u.exec(normalised);
|
|
98
|
+
return match ? match[0] : '';
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Whether the field holds a real number. A draft that is only a sign or a
|
|
102
|
+
* separator (`-`, `.`) is still being typed and submits as empty.
|
|
103
|
+
*/
|
|
104
|
+
get isEmpty() {
|
|
105
|
+
return !/^-?\d/u.test(this.toCanonical(this.draft));
|
|
106
|
+
}
|
|
107
|
+
/** What the form receives and `value` exposes. */
|
|
108
|
+
get canonical() {
|
|
109
|
+
return this.isEmpty ? '' : this.toCanonical(this.draft);
|
|
110
|
+
}
|
|
111
|
+
get numericValue() {
|
|
112
|
+
return Number(this.canonical);
|
|
113
|
+
}
|
|
114
|
+
/** The message for a value outside `min`/`max`, if there is one. */
|
|
115
|
+
outOfRange(parsed) {
|
|
116
|
+
const { min, max } = this;
|
|
117
|
+
if (min !== undefined && parsed < min) {
|
|
118
|
+
return `Enter a value of at least ${min}.`;
|
|
119
|
+
}
|
|
120
|
+
if (max !== undefined && parsed > max) {
|
|
121
|
+
return `Enter a value of at most ${max}.`;
|
|
122
|
+
}
|
|
123
|
+
return undefined;
|
|
124
|
+
}
|
|
125
|
+
rangeError() {
|
|
126
|
+
if (this.errorMessage || this.isEmpty || this.invalid) {
|
|
127
|
+
return undefined;
|
|
128
|
+
}
|
|
129
|
+
const parsed = this.numericValue;
|
|
130
|
+
return Number.isNaN(parsed) ? 'Enter a valid number.' : this.outOfRange(parsed);
|
|
131
|
+
}
|
|
132
|
+
syncForm() {
|
|
133
|
+
const { internals, required, invalid, errorMessage, canonical } = this;
|
|
134
|
+
if (typeof internals?.setFormValue !== 'function') {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
internals.setFormValue(canonical);
|
|
138
|
+
const base = resolveValidity({ required, empty: canonical === '', invalid, errorMessage });
|
|
139
|
+
const rangeMessage = this.rangeError();
|
|
140
|
+
if (rangeMessage) {
|
|
141
|
+
internals.setValidity({ ...base.flags, badInput: true }, rangeMessage);
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
internals.setValidity(base.flags, base.message);
|
|
145
|
+
}
|
|
146
|
+
componentDidLoad() {
|
|
147
|
+
this.initialValue = this.value;
|
|
148
|
+
this.syncForm();
|
|
149
|
+
this.host.addEventListener('change', this.markTouched);
|
|
150
|
+
this.host.addEventListener('focusout', this.markTouched);
|
|
151
|
+
this.host.addEventListener('invalid', this.markTouched);
|
|
152
|
+
}
|
|
153
|
+
markTouched = () => {
|
|
154
|
+
this.host.setAttribute('data-touched', '');
|
|
155
|
+
};
|
|
156
|
+
formResetCallback() {
|
|
157
|
+
this.value = this.initialValue;
|
|
158
|
+
this.draft = this.formatDisplay(this.initialValue);
|
|
159
|
+
this.typing = false;
|
|
160
|
+
this.syncForm();
|
|
161
|
+
// The vdom does not push a re-rendered `value` onto a live `<input>`: the
|
|
162
|
+
// property is set by the browser's own typing and the diff sees no change.
|
|
163
|
+
// A reset restores the text directly.
|
|
164
|
+
const input = this.host.shadowRoot?.querySelector('input');
|
|
165
|
+
if (input) {
|
|
166
|
+
input.value = this.formatDisplay(this.initialValue);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
formDisabledCallback(isDisabled) {
|
|
170
|
+
this.formDisabled = isDisabled;
|
|
171
|
+
}
|
|
172
|
+
commit(text) {
|
|
173
|
+
this.typing = true;
|
|
174
|
+
this.draft = text;
|
|
175
|
+
this.value = this.canonical;
|
|
176
|
+
this.chInput.emit(this.value);
|
|
177
|
+
this.syncForm();
|
|
178
|
+
}
|
|
179
|
+
handleInput = (ev) => {
|
|
180
|
+
this.commit(ev.target.value);
|
|
181
|
+
};
|
|
182
|
+
handleChange = (ev) => {
|
|
183
|
+
this.commit(ev.target.value);
|
|
184
|
+
this.chChange.emit(this.value);
|
|
185
|
+
};
|
|
186
|
+
/** Reformats grouped CLP digits once the field loses focus. */
|
|
187
|
+
handleBlur = () => {
|
|
188
|
+
if (this.format === 'clp') {
|
|
189
|
+
this.draft = this.formatDisplay(this.canonical);
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
get isInvalid() {
|
|
193
|
+
return this.invalid || this.rangeError() !== undefined;
|
|
194
|
+
}
|
|
195
|
+
get describedBy() {
|
|
196
|
+
if (this.isInvalid && this.errorMessage) {
|
|
197
|
+
return this.errorId;
|
|
198
|
+
}
|
|
199
|
+
if (this.hint) {
|
|
200
|
+
return this.hintId;
|
|
201
|
+
}
|
|
202
|
+
return undefined;
|
|
203
|
+
}
|
|
204
|
+
render() {
|
|
205
|
+
const showError = this.isInvalid && this.errorMessage;
|
|
206
|
+
return (h(Host, { key: '1c424d9d76ec39e6cc6018d6ba483f95bd203d32' }, this.label && (h("label", { key: '4fc03334128c33cc425da773df063cd99fee215c', class: "label", htmlFor: this.inputId }, this.label)), h("input", { key: 'ece15737f83c181d615e906aba5cce80c0bcb8ba', id: this.label ? this.inputId : undefined, class: { 'input': true, 'input--invalid': this.isInvalid },
|
|
207
|
+
// `text` with `inputmode`, not `type="number"`: a number input drops
|
|
208
|
+
// partial values and cannot show grouped digits.
|
|
209
|
+
type: "text", inputMode: this.decimals ? 'decimal' : 'numeric', name: this.name, placeholder: this.placeholder, disabled: this.disabled || this.formDisabled, required: this.required, value: this.typing ? this.draft : this.formatDisplay(this.value), "aria-invalid": this.isInvalid ? 'true' : undefined, "aria-describedby": this.describedBy, onInput: this.handleInput, onChange: this.handleChange, onBlur: this.handleBlur }), this.hint && !showError && (h("p", { key: '7a2e3031b8bfebf26857dd60eb18340f21a01f3d', class: "hint", id: this.hintId }, this.hint)), showError && (h("p", { key: 'f90492532d27088f18b258f885d5d471f31d27cb', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
210
|
+
}
|
|
211
|
+
static get formAssociated() { return true; }
|
|
212
|
+
static get watchers() { return {
|
|
213
|
+
"required": [{
|
|
214
|
+
"syncForm": 0
|
|
215
|
+
}],
|
|
216
|
+
"invalid": [{
|
|
217
|
+
"syncForm": 0
|
|
218
|
+
}],
|
|
219
|
+
"errorMessage": [{
|
|
220
|
+
"syncForm": 0
|
|
221
|
+
}],
|
|
222
|
+
"min": [{
|
|
223
|
+
"syncForm": 0
|
|
224
|
+
}],
|
|
225
|
+
"max": [{
|
|
226
|
+
"syncForm": 0
|
|
227
|
+
}]
|
|
228
|
+
}; }
|
|
229
|
+
};
|
|
230
|
+
ChNumberInput.style = chNumberInputCss();
|
|
231
|
+
|
|
232
|
+
export { ChNumberInput as ch_number_input };
|
|
233
|
+
//# sourceMappingURL=ch-number-input.entry.js.map
|
|
234
|
+
|
|
235
|
+
//# sourceMappingURL=ch-number-input.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ch-number-input.entry.js","sources":["src/components/ch-number-input/ch-number-input.css?tag=ch-number-input&encapsulation=shadow","src/components/ch-number-input/ch-number-input.tsx"],"sourcesContent":[":host {\n display: inline-block;\n width: 100%;\n}\n\n.label {\n display: block;\n margin-bottom: var(--spacing-sm);\n font-size: var(--typography-size-sm);\n font-weight: var(--typography-weight-semibold);\n color: var(--text);\n}\n\n.input {\n box-sizing: border-box;\n width: 100%;\n padding: var(--spacing-xl) var(--spacing-3xl);\n border-radius: var(--radius);\n border: var(--border-width) solid var(--border);\n background: var(--surface);\n color: var(--text);\n backdrop-filter: blur(var(--effect-blur));\n font-family: inherit;\n font-size: inherit;\n transition:\n border-color var(--duration-normal) var(--easing-default),\n box-shadow var(--duration-normal) var(--easing-default);\n}\n\n.input::placeholder {\n color: var(--text-muted);\n}\n\n.input:focus {\n border-color: var(--accent);\n box-shadow: var(--shadow-focus-ring);\n outline: none;\n}\n\n.input--invalid {\n border-color: var(--color-status-warning);\n}\n\n.input--invalid:focus {\n border-color: var(--color-status-warning);\n box-shadow: 0 0 0 3px var(--color-status-warning-background);\n}\n\n:host([data-touched]:invalid) .input,\n:host(:user-invalid) .input {\n border-color: var(--color-status-warning);\n}\n\n:host([data-touched]:invalid) .input:focus,\n:host(:user-invalid) .input:focus {\n border-color: var(--color-status-warning);\n box-shadow: 0 0 0 3px var(--color-status-warning-background);\n}\n\n.input:disabled {\n opacity: var(--opacity-disabled);\n cursor: not-allowed;\n}\n\n.hint,\n.error {\n margin: var(--spacing-sm) 0 0;\n font-size: var(--typography-size-sm);\n color: var(--text-muted);\n}\n\n.error {\n color: var(--color-status-warning);\n}\n","import { AttachInternals, Component, Element, Event, type EventEmitter, Host, Prop, State, Watch, h } from '@stencil/core';\n\nimport { resolveValidity } from '../../utils/validation-message';\n\nexport type ChNumberInputFormat = 'plain' | 'clp';\n\nexport type ChNumberInputStep = number | 'any';\n\nlet numberInputIds = 0;\n\n/**\n * Numeric input that keeps what the user is typing separate from the value the\n * form submits.\n *\n * The display is formatted (`1.234.567` for CLP) while `value` and `FormData`\n * carry a canonical machine-readable string: digits only for CLP, the plain\n * decimal for `plain`. Parsing on every keystroke cannot represent the\n * intermediate states people actually type — `-`, `1.`, `0,` — so those stay as\n * text and are validated at the end.\n *\n * Empty is not zero. A cleared field submits `''` and reports `valueMissing`\n * when required; it never becomes `0`.\n *\n * There is no separate currency component: `format=\"clp\"` is the currency\n * boundary for Chilean pesos, the only case with a real consumer.\n */\n@Component({\n tag: 'ch-number-input',\n styleUrl: 'ch-number-input.css',\n shadow: true,\n formAssociated: true,\n})\nexport class ChNumberInput {\n private readonly inputId = `ch-number-input-${++numberInputIds}`;\n private readonly hintId = `${this.inputId}-hint`;\n private readonly errorId = `${this.inputId}-error`;\n private initialValue = '';\n\n @AttachInternals() internals!: ElementInternals;\n @State() formDisabled = false;\n @Element() private host!: HTMLElement;\n\n /** Visible label, associated with the input via `for`/`id`. */\n @Prop() label?: string;\n\n /**\n * Canonical value: digits only for `clp`, a plain decimal string for `plain`.\n * Never formatted — formatting lives in the rendered text.\n */\n @Prop({ mutable: true }) value = '';\n\n /** How the number is displayed while typing. */\n @Prop() format: ChNumberInputFormat = 'plain';\n\n /** Placeholder shown when the field is empty. */\n @Prop() placeholder?: string;\n\n /** Name submitted with the form. */\n @Prop({ reflect: true }) name?: string;\n\n /** Whether the field is disabled. */\n @Prop({ reflect: true }) disabled = false;\n\n /** Whether a value is required; an empty field is then invalid. */\n @Prop({ reflect: true }) required = false;\n\n /** Minimum accepted value. */\n @Prop() min?: number;\n\n /** Maximum accepted value. */\n @Prop() max?: number;\n\n /** Stepping increment. `'any'` disables stepping validation. */\n @Prop() step: ChNumberInputStep = 'any';\n\n /** Helper text, replaced by `errorMessage` when invalid. */\n @Prop() hint?: string;\n\n /** Custom error message; wins over the built-in range messages. */\n @Prop() errorMessage?: string;\n\n /** Whether the field is marked invalid by the consumer. */\n @Prop() invalid = false;\n\n /** Emitted on every keystroke with the canonical value. */\n @Event() chInput: EventEmitter<string>;\n\n /** Emitted on commit (native `change`) with the canonical value. */\n @Event() chChange: EventEmitter<string>;\n\n /**\n * The text in the input, which may be a partial number like `-` or `1.`.\n * This is the only thing rendered, so it is also what a reset must restore.\n */\n @State() private draft = '';\n\n /**\n * Whether the user has typed since the last commit. While false the input\n * renders `value` directly, which is what makes `formResetCallback` and a\n * consumer assigning `.value` repaint without extra bookkeeping.\n */\n @State() private typing = false;\n\n componentWillLoad() {\n this.draft = this.formatDisplay(this.value);\n }\n\n private get decimals(): boolean {\n return this.format !== 'clp';\n }\n\n /** Formats a canonical value for display. */\n private formatDisplay(value: string): string {\n if (value === '') {\n return '';\n }\n if (this.format === 'clp') {\n const digits = value.replace(/\\D/gu, '');\n return digits === '' ? '' : Number(digits).toLocaleString('es-CL');\n }\n return value;\n }\n\n /**\n * Strips display formatting back to the canonical string: digits only for\n * CLP; a leading sign, digits and one decimal separator for `plain`.\n */\n private toCanonical(text: string): string {\n if (this.format === 'clp') {\n return text.replace(/\\D/gu, '');\n }\n const normalised = text.replace(/\\s/gu, '').replace(',', '.');\n const match = /^-?\\d*(?:\\.\\d*)?/u.exec(normalised);\n return match ? match[0] : '';\n }\n\n /**\n * Whether the field holds a real number. A draft that is only a sign or a\n * separator (`-`, `.`) is still being typed and submits as empty.\n */\n private get isEmpty(): boolean {\n return !/^-?\\d/u.test(this.toCanonical(this.draft));\n }\n\n /** What the form receives and `value` exposes. */\n private get canonical(): string {\n return this.isEmpty ? '' : this.toCanonical(this.draft);\n }\n\n private get numericValue(): number {\n return Number(this.canonical);\n }\n\n /** The message for a value outside `min`/`max`, if there is one. */\n private outOfRange(parsed: number): string | undefined {\n const { min, max } = this;\n if (min !== undefined && parsed < min) {\n return `Enter a value of at least ${min}.`;\n }\n if (max !== undefined && parsed > max) {\n return `Enter a value of at most ${max}.`;\n }\n return undefined;\n }\n\n private rangeError(): string | undefined {\n if (this.errorMessage || this.isEmpty || this.invalid) {\n return undefined;\n }\n const parsed = this.numericValue;\n return Number.isNaN(parsed) ? 'Enter a valid number.' : this.outOfRange(parsed);\n }\n\n @Watch('required')\n @Watch('invalid')\n @Watch('errorMessage')\n @Watch('min')\n @Watch('max')\n protected syncForm(): void {\n const { internals, required, invalid, errorMessage, canonical } = this;\n if (typeof internals?.setFormValue !== 'function') {\n return;\n }\n internals.setFormValue(canonical);\n\n const base = resolveValidity({ required, empty: canonical === '', invalid, errorMessage });\n const rangeMessage = this.rangeError();\n if (rangeMessage) {\n internals.setValidity({ ...base.flags, badInput: true }, rangeMessage);\n return;\n }\n internals.setValidity(base.flags, base.message);\n }\n\n componentDidLoad() {\n this.initialValue = this.value;\n this.syncForm();\n this.host.addEventListener('change', this.markTouched);\n this.host.addEventListener('focusout', this.markTouched);\n this.host.addEventListener('invalid', this.markTouched);\n }\n\n private markTouched = (): void => {\n this.host.setAttribute('data-touched', '');\n };\n\n formResetCallback(): void {\n this.value = this.initialValue;\n this.draft = this.formatDisplay(this.initialValue);\n this.typing = false;\n this.syncForm();\n // The vdom does not push a re-rendered `value` onto a live `<input>`: the\n // property is set by the browser's own typing and the diff sees no change.\n // A reset restores the text directly.\n const input = this.host.shadowRoot?.querySelector('input');\n if (input) {\n input.value = this.formatDisplay(this.initialValue);\n }\n }\n\n formDisabledCallback(isDisabled: boolean): void {\n this.formDisabled = isDisabled;\n }\n\n private commit(text: string): void {\n this.typing = true;\n this.draft = text;\n this.value = this.canonical;\n this.chInput.emit(this.value);\n this.syncForm();\n }\n\n private handleInput = (ev: InputEvent) => {\n this.commit((ev.target as HTMLInputElement).value);\n };\n\n private handleChange = (ev: Event) => {\n this.commit((ev.target as HTMLInputElement).value);\n this.chChange.emit(this.value);\n };\n\n /** Reformats grouped CLP digits once the field loses focus. */\n private handleBlur = () => {\n if (this.format === 'clp') {\n this.draft = this.formatDisplay(this.canonical);\n }\n };\n\n private get isInvalid(): boolean {\n return this.invalid || this.rangeError() !== undefined;\n }\n\n private get describedBy(): string | undefined {\n if (this.isInvalid && this.errorMessage) {\n return this.errorId;\n }\n if (this.hint) {\n return this.hintId;\n }\n return undefined;\n }\n\n render() {\n const showError = this.isInvalid && this.errorMessage;\n return (\n <Host>\n {this.label && (\n <label class=\"label\" htmlFor={this.inputId}>\n {this.label}\n </label>\n )}\n <input\n id={this.label ? this.inputId : undefined}\n class={{ 'input': true, 'input--invalid': this.isInvalid }}\n // `text` with `inputmode`, not `type=\"number\"`: a number input drops\n // partial values and cannot show grouped digits.\n type=\"text\"\n inputMode={this.decimals ? 'decimal' : 'numeric'}\n name={this.name}\n placeholder={this.placeholder}\n disabled={this.disabled || this.formDisabled}\n required={this.required}\n value={this.typing ? this.draft : this.formatDisplay(this.value)}\n aria-invalid={this.isInvalid ? 'true' : undefined}\n aria-describedby={this.describedBy}\n onInput={this.handleInput}\n onChange={this.handleChange}\n onBlur={this.handleBlur}\n />\n {this.hint && !showError && (\n <p class=\"hint\" id={this.hintId}>\n {this.hint}\n </p>\n )}\n {showError && (\n <p class=\"error\" id={this.errorId} role=\"alert\">\n {this.errorMessage}\n </p>\n )}\n </Host>\n );\n }\n}\n"],"names":[],"mappings":";;;AAAA,MAAM,gBAAgB,GAAG,MAAM,CAAC,m4CAAm4C,CAAC;;ACQp6C,IAAI,cAAc,GAAG,CAAC;MAwBT,aAAa,GAAA,MAAA;;;;;;;;;;;;;AACP,IAAA,OAAO,GAAG,CAAA,gBAAA,EAAmB,EAAE,cAAc,EAAE;AAC/C,IAAA,MAAM,GAAG,CAAA,EAAG,IAAI,CAAC,OAAO,OAAO;AAC/B,IAAA,OAAO,GAAG,CAAA,EAAG,IAAI,CAAC,OAAO,QAAQ;IAC1C,YAAY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BAC/B,IAAI,CAAC,WAAW,EAClC,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,QAAQ,EAAE,IAAI,CAAC,YAAY,EAC3B,MAAM,EAAE,IAAI,CAAC,UAAU,EAAA,CACvB,EACD,IAAI,CAAC,IAAI,IAAI,CAAC,SAAS,KACtB,CAAA,CAAA,GAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAG,KAAK,EAAC,MAAM,EAAC,EAAE,EAAE,IAAI,CAAC,MAAM,IAC5B,IAAI,CAAC,IAAI,CACR,CACL,EACA,SAAS,KACR,CAAA,CAAA,GAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAG,KAAK,EAAC,OAAO,EAAC,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,EAAC,OAAO,EAAA,EAC5C,IAAI,CAAC,YAAY,CAChB,CACL,CACI;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -32,7 +32,7 @@ const ChPageHeader = class {
|
|
|
32
32
|
actionsStacked = false;
|
|
33
33
|
render() {
|
|
34
34
|
const Heading = this.headingLevel;
|
|
35
|
-
return (h(Host, { key: '
|
|
35
|
+
return (h(Host, { key: '3d8de76e3df7fba8be55d0708861c7d136b05722' }, h("div", { key: '057d2b4359b9faff34b9fbf6886b04d5d89dc9ac', class: { 'header': true, 'header--stacked': this.actionsStacked } }, h("div", { key: '1ff40b1cd100d41a72d80ab35e619f93b4a43633', class: "header-text" }, this.eyebrow && h("p", { key: '6c2538bf1d450a6dca25fd2815968a9622f7fcbf', class: "header-eyebrow" }, this.eyebrow), h(Heading, { key: '54cdf8e62468e11cf9fe084023e4fe624f958452', class: "header-title" }, this.title), this.description && h("p", { key: 'fe9c6cc78354b38b8833871ddc53d412007abe29', class: "header-description" }, this.description)), h("div", { key: 'e91a66715e2c23478c375ce9ddcf29c04f85b3eb', class: "header-actions" }, h("slot", { key: '06654c2a28d004791ed5b9c213cd66ef80bbcc85', name: "actions" })))));
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
ChPageHeader.style = chPageHeaderCss();
|
|
@@ -112,7 +112,7 @@ const ChRadio = class {
|
|
|
112
112
|
}
|
|
113
113
|
render() {
|
|
114
114
|
const groupName = this.name || `${this.groupId}-group`;
|
|
115
|
-
return (h(Host, { key: '
|
|
115
|
+
return (h(Host, { key: 'a027da2d803a6e8a2a35afa1920dd3b0f8e06b01' }, this.label && (h("span", { key: '28e11cd1148a89a4f3e85d331f00e39f1d7751ce', class: "group-label", id: this.labelId }, this.label)), h("div", { key: '43d8a53c9bec1dc129b6588c0118ebe2109b4b7e', class: "radio-group", role: "radiogroup", "aria-labelledby": this.label ? this.labelId : undefined }, this.options.map(option => (h("label", { class: { 'control': true, 'control--disabled': this.disabled || this.formDisabled || option.disabled } }, h("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 }), h("span", { class: "mark" }), h("span", { class: "label-text" }, option.label))))), this.hint && !(this.invalid && this.errorMessage) && (h("p", { key: '27335cc50f8b280f93857eea370aa37e2290b46b', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (h("p", { key: '83f93bdc0739961136062acb784a3d6e666de349', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
116
116
|
}
|
|
117
117
|
static get formAssociated() { return true; }
|
|
118
118
|
static get watchers() { return {
|
|
@@ -91,7 +91,7 @@ const ChSegmentedControl = class {
|
|
|
91
91
|
}
|
|
92
92
|
render() {
|
|
93
93
|
const groupName = this.name || `${this.groupId}-group`;
|
|
94
|
-
return (h(Host, { key: '
|
|
94
|
+
return (h(Host, { key: '59e0782a5c120cd243bbd67eb727ba1a7755d45f' }, this.label && (h("span", { key: 'f1faf9b240224e4c2b10059ed7bf667e24e5997d', class: "group-label", id: this.labelId }, this.label)), h("div", { key: 'b9e59c0fbd4af04ad4d079415497440ec0a60801', class: { segmented: true, [`segmented--${this.size}`]: true }, role: "radiogroup", "aria-labelledby": this.label ? this.labelId : undefined }, this.options.map(option => (h("label", { class: { 'control': true, 'control--disabled': this.disabled || this.formDisabled || option.disabled } }, h("input", { class: "input", type: "radio", name: groupName, value: option.value, checked: option.value === this.value, disabled: this.disabled || this.formDisabled || option.disabled, onChange: this.handleChange }), h("span", { class: "label-text" }, option.label)))))));
|
|
95
95
|
}
|
|
96
96
|
static get formAssociated() { return true; }
|
|
97
97
|
static get watchers() { return {
|
|
@@ -45,7 +45,7 @@ const ChSkeleton = class {
|
|
|
45
45
|
return { width: this.width, height: this.height };
|
|
46
46
|
}
|
|
47
47
|
render() {
|
|
48
|
-
return (h(Host, { key: '
|
|
48
|
+
return (h(Host, { key: 'b28cd1be6da1721ff6b93ed1e4bab119ea066ad4', "aria-hidden": "true", class: { 'skeleton': true, [`skeleton--${this.shape}`]: true, 'skeleton--animated': this.animated } }, Array.from({ length: this.items }).map((value, index) => (h("span", { class: "skeleton__item", style: this.sizeStyle, key: index, "data-index": String(value) })))));
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
51
|
ChSkeleton.style = chSkeletonCss();
|
|
@@ -24,7 +24,7 @@ const ChStack = class {
|
|
|
24
24
|
return GAPS.has(this.gap) ? this.gap : 'md';
|
|
25
25
|
}
|
|
26
26
|
render() {
|
|
27
|
-
return (h(Host, { key: '
|
|
27
|
+
return (h(Host, { key: '1c70344ce291ba78a533f99ac6c4c135296251e1', class: { stack: true, [`stack--gap-${this.gapStep}`]: true, [`stack--align-${this.align}`]: true, [`stack--justify-${this.justify}`]: true } }, h("slot", { key: 'f4167e47a2fdee42f97611fba5907d79f8d0448d' })));
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
30
|
ChStack.style = chStackCss();
|
|
@@ -30,10 +30,10 @@ const ChStat = class {
|
|
|
30
30
|
}
|
|
31
31
|
render() {
|
|
32
32
|
const cue = this.toneClass === 'positive' ? '+' : this.toneClass === 'negative' ? '−' : null;
|
|
33
|
-
return (h(Host, { key: '
|
|
33
|
+
return (h(Host, { key: '76d71c964efeb4e5a07aabff0b895f1ded21b345', class: "stat" }, h("div", { key: '103db766f21c91c8406e8d3368049f4e4a018007', class: "stat__inner" }, h("span", { key: '74e45654072a92ba4f894aee5366852561f8f352', class: "stat__label" }, this.label), h("span", { key: 'deb8d0d20c70d7fbab392641fd9d0e617ab8daf5', class: {
|
|
34
34
|
stat__value: true,
|
|
35
35
|
[`stat__value--${this.toneClass}`]: this.toneClass !== 'default',
|
|
36
|
-
} }, cue && (h("span", { key: '
|
|
36
|
+
} }, cue && (h("span", { key: '82b83cb7182f10ceca5172fc790aad01882645cc', class: "stat__cue", "aria-hidden": "true" }, cue)), h("slot", { key: 'e9c3095eca4ed3907fc0e95395f3cc62bfd4158a', name: "value" }, this.value)), this.hint && h("span", { key: '4b892b35299def40a62c386e6af7c5f19aebe44b', class: "stat__hint" }, this.hint), h("div", { key: '0535d9fb62ddf5ed1ee2b5993689cb080f753ff9', class: "stat__footer" }, h("slot", { key: '1d8e09fa8db2d4a6e188f8deaa93631df9cc2a36', name: "footer" })))));
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
39
|
ChStat.style = chStatCss();
|