@devschile/chucao 2.7.0 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chucao/chucao.esm.js +1 -1
- package/dist/chucao/{p-10109256.entry.js → p-0831c6f2.entry.js} +2 -2
- package/dist/chucao/p-0d7fc720.entry.js +2 -0
- package/dist/chucao/{p-62e762f7.entry.js.map → p-0d7fc720.entry.js.map} +1 -1
- package/dist/chucao/{p-999dba28.entry.js → p-19d90f87.entry.js} +2 -2
- package/dist/chucao/{p-afe45116.entry.js → p-25f4f815.entry.js} +2 -2
- package/dist/chucao/{p-14184080.entry.js → p-3e0d7585.entry.js} +2 -2
- package/dist/chucao/{p-afacd489.entry.js → p-46dae34b.entry.js} +2 -2
- package/dist/chucao/{p-d1e9f563.entry.js → p-5093c486.entry.js} +2 -2
- package/dist/chucao/{p-337d7f68.entry.js → p-51f6327c.entry.js} +2 -2
- package/dist/chucao/{p-bf036509.entry.js → p-5577e0a0.entry.js} +2 -2
- package/dist/chucao/{p-339e3c30.entry.js → p-56e41372.entry.js} +2 -2
- package/dist/chucao/{p-a84d4493.entry.js → p-6c2e5931.entry.js} +2 -2
- package/dist/chucao/{p-1e8d921d.entry.js → p-6e93c392.entry.js} +2 -2
- package/dist/chucao/{p-93f25dd5.entry.js → p-7f99ae48.entry.js} +2 -2
- package/dist/chucao/p-8b09ad3c.entry.js +2 -0
- package/dist/chucao/p-8b09ad3c.entry.js.map +1 -0
- package/dist/chucao/{p-e2fe7c5d.entry.js → p-8fcf6d36.entry.js} +2 -2
- package/dist/chucao/{p-CIV5Gg1o.js → p-8l_6qAY9.js} +3 -3
- package/dist/chucao/p-8l_6qAY9.js.map +1 -0
- package/dist/chucao/{p-d2077ae4.entry.js → p-920d5727.entry.js} +2 -2
- package/dist/chucao/{p-1852dfdb.entry.js → p-ad41da02.entry.js} +2 -2
- package/dist/chucao/p-af088ffd.entry.js +2 -0
- package/dist/chucao/p-af088ffd.entry.js.map +1 -0
- package/dist/chucao/{p-08d90a3d.entry.js → p-b42ec9bf.entry.js} +2 -2
- package/dist/chucao/{p-36c59ad1.entry.js → p-b80c39c3.entry.js} +2 -2
- package/dist/chucao/{p-507d4b69.entry.js → p-ba589c2f.entry.js} +2 -2
- package/dist/chucao/{p-39815ee2.entry.js → p-c4d68ab7.entry.js} +2 -2
- package/dist/chucao/{p-3e6614ee.entry.js → p-c98e2a50.entry.js} +2 -2
- package/dist/chucao/{p-4c8838a0.entry.js → p-ca3179ae.entry.js} +2 -2
- package/dist/chucao/{p-3f9894a4.entry.js → p-d630f662.entry.js} +2 -2
- package/dist/chucao/{p-4cda7f71.entry.js → p-d868bdbc.entry.js} +2 -2
- package/dist/chucao/{p-f17b186f.entry.js → p-e6b7b2da.entry.js} +2 -2
- package/dist/chucao/p-eb39b9c2.entry.js +2 -0
- package/dist/chucao/p-eb39b9c2.entry.js.map +1 -0
- package/dist/chucao/p-f0c288db.entry.js +2 -0
- package/dist/chucao/p-f0c288db.entry.js.map +1 -0
- package/dist/cjs/ch-accordion.cjs.entry.js +2 -2
- package/dist/cjs/ch-alert_8.cjs.entry.js +8 -8
- package/dist/cjs/ch-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/ch-cluster.cjs.entry.js +3 -3
- package/dist/cjs/ch-confirm-dialog.cjs.entry.js +138 -0
- package/dist/cjs/ch-confirm-dialog.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-description-list.cjs.entry.js +2 -2
- package/dist/cjs/ch-divider.cjs.entry.js +2 -2
- package/dist/cjs/ch-drawer.cjs.entry.js +2 -2
- package/dist/cjs/ch-emoji.cjs.entry.js +2 -2
- package/dist/cjs/ch-empty-state.cjs.entry.js +2 -2
- package/dist/cjs/ch-grid.cjs.entry.js +2 -2
- package/dist/cjs/ch-icon-button.cjs.entry.js +2 -2
- package/dist/cjs/ch-icon.cjs.entry.js +2 -2
- package/dist/cjs/ch-link.cjs.entry.js +1 -1
- package/dist/cjs/ch-modal.cjs.entry.js +2 -2
- package/dist/cjs/ch-number-input.cjs.entry.js +3 -3
- package/dist/cjs/ch-otp-input.cjs.entry.js +196 -0
- package/dist/cjs/ch-otp-input.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-page-header.cjs.entry.js +2 -2
- package/dist/cjs/ch-pagination.cjs.entry.js +67 -0
- package/dist/cjs/ch-pagination.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-radio.cjs.entry.js +2 -2
- package/dist/cjs/ch-segmented-control.cjs.entry.js +2 -2
- package/dist/cjs/ch-skeleton.cjs.entry.js +2 -2
- package/dist/cjs/ch-stack.cjs.entry.js +2 -2
- package/dist/cjs/ch-stat.cjs.entry.js +3 -3
- package/dist/cjs/ch-table.cjs.entry.js +2 -2
- package/dist/cjs/ch-tabs.cjs.entry.js +2 -2
- package/dist/cjs/ch-textarea.cjs.entry.js +2 -2
- package/dist/cjs/ch-timeline.cjs.entry.js +2 -2
- package/dist/cjs/ch-tooltip.cjs.entry.js +25 -8
- package/dist/cjs/ch-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/chucao.cjs.js +2 -2
- package/dist/cjs/{index-ByZY6aTj.js → index-C6khqyw3.js} +19 -2
- package/dist/cjs/index-C6khqyw3.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +3 -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-confirm-dialog/ch-confirm-dialog.css +71 -0
- package/dist/collection/components/ch-confirm-dialog/ch-confirm-dialog.js +382 -0
- package/dist/collection/components/ch-confirm-dialog/ch-confirm-dialog.js.map +1 -0
- 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.js +2 -2
- package/dist/collection/components/ch-otp-input/ch-otp-input.css +86 -0
- package/dist/collection/components/ch-otp-input/ch-otp-input.js +478 -0
- package/dist/collection/components/ch-otp-input/ch-otp-input.js.map +1 -0
- package/dist/collection/components/ch-page-header/ch-page-header.js +1 -1
- package/dist/collection/components/ch-pagination/ch-pagination.css +63 -0
- package/dist/collection/components/ch-pagination/ch-pagination.js +228 -0
- package/dist/collection/components/ch-pagination/ch-pagination.js.map +1 -0
- 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.js +1 -1
- 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-checkbox.js +1 -1
- package/dist/components/ch-cluster.js +1 -1
- package/dist/components/ch-confirm-dialog.d.ts +11 -0
- package/dist/components/ch-confirm-dialog.js +2 -0
- package/dist/components/ch-confirm-dialog.js.map +1 -0
- 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-modal.js.map +1 -1
- package/dist/components/ch-number-input.js +1 -1
- package/dist/components/ch-otp-input.d.ts +11 -0
- package/dist/components/ch-otp-input.js +2 -0
- package/dist/components/ch-otp-input.js.map +1 -0
- package/dist/components/ch-page-header.js +1 -1
- package/dist/components/ch-pagination.d.ts +11 -0
- package/dist/components/ch-pagination.js +2 -0
- package/dist/components/ch-pagination.js.map +1 -0
- 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.js +1 -1
- 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-CuczWSQU.js → p-CF1yV0aa.js} +2 -2
- package/dist/components/p-CmMN-UuJ.js +2 -0
- package/dist/components/p-CmMN-UuJ.js.map +1 -0
- package/dist/components/p-qP_9qshx.js.map +1 -1
- package/dist/esm/ch-accordion.entry.js +2 -2
- package/dist/esm/ch-alert_8.entry.js +8 -8
- package/dist/esm/ch-checkbox.entry.js +2 -2
- package/dist/esm/ch-cluster.entry.js +3 -3
- package/dist/esm/ch-confirm-dialog.entry.js +136 -0
- package/dist/esm/ch-confirm-dialog.entry.js.map +1 -0
- package/dist/esm/ch-description-list.entry.js +2 -2
- package/dist/esm/ch-divider.entry.js +2 -2
- package/dist/esm/ch-drawer.entry.js +2 -2
- package/dist/esm/ch-emoji.entry.js +2 -2
- package/dist/esm/ch-empty-state.entry.js +2 -2
- package/dist/esm/ch-grid.entry.js +2 -2
- package/dist/esm/ch-icon-button.entry.js +2 -2
- package/dist/esm/ch-icon.entry.js +2 -2
- package/dist/esm/ch-link.entry.js +1 -1
- package/dist/esm/ch-modal.entry.js +2 -2
- package/dist/esm/ch-number-input.entry.js +3 -3
- package/dist/esm/ch-otp-input.entry.js +194 -0
- package/dist/esm/ch-otp-input.entry.js.map +1 -0
- package/dist/esm/ch-page-header.entry.js +2 -2
- package/dist/esm/ch-pagination.entry.js +65 -0
- package/dist/esm/ch-pagination.entry.js.map +1 -0
- package/dist/esm/ch-radio.entry.js +2 -2
- package/dist/esm/ch-segmented-control.entry.js +2 -2
- package/dist/esm/ch-skeleton.entry.js +2 -2
- package/dist/esm/ch-stack.entry.js +2 -2
- package/dist/esm/ch-stat.entry.js +3 -3
- package/dist/esm/ch-table.entry.js +2 -2
- package/dist/esm/ch-tabs.entry.js +2 -2
- package/dist/esm/ch-textarea.entry.js +2 -2
- package/dist/esm/ch-timeline.entry.js +2 -2
- package/dist/esm/ch-tooltip.entry.js +25 -8
- package/dist/esm/ch-tooltip.entry.js.map +1 -1
- package/dist/esm/chucao.js +3 -3
- package/dist/esm/{index-CIV5Gg1o.js → index-8l_6qAY9.js} +19 -2
- package/dist/esm/index-8l_6qAY9.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/types/components/ch-confirm-dialog/ch-confirm-dialog.d.ts +81 -0
- package/dist/types/components/ch-otp-input/ch-otp-input.d.ts +79 -0
- package/dist/types/components/ch-pagination/ch-pagination.d.ts +44 -0
- package/dist/types/components/ch-tooltip/ch-tooltip.d.ts +7 -0
- package/dist/types/components.d.ts +548 -0
- package/dist/types/utils/overlay.d.ts +1 -1
- package/dist-react/components.d.ts +21 -1
- package/dist-react/components.js +33 -0
- package/dist-react/components.ts +49 -1
- package/dist-vue/index.d.ts +3 -0
- package/dist-vue/index.js +48 -0
- package/dist-vue/index.ts +54 -0
- package/hydrate/index.js +540 -40
- package/hydrate/index.mjs +540 -40
- package/package.json +13 -1
- package/dist/chucao/p-5c253fa0.entry.js +0 -2
- package/dist/chucao/p-5c253fa0.entry.js.map +0 -1
- package/dist/chucao/p-62e762f7.entry.js +0 -2
- package/dist/chucao/p-CIV5Gg1o.js.map +0 -1
- package/dist/cjs/index-ByZY6aTj.js.map +0 -1
- package/dist/esm/index-CIV5Gg1o.js.map +0 -1
- /package/dist/chucao/{p-10109256.entry.js.map → p-0831c6f2.entry.js.map} +0 -0
- /package/dist/chucao/{p-999dba28.entry.js.map → p-19d90f87.entry.js.map} +0 -0
- /package/dist/chucao/{p-afe45116.entry.js.map → p-25f4f815.entry.js.map} +0 -0
- /package/dist/chucao/{p-14184080.entry.js.map → p-3e0d7585.entry.js.map} +0 -0
- /package/dist/chucao/{p-afacd489.entry.js.map → p-46dae34b.entry.js.map} +0 -0
- /package/dist/chucao/{p-d1e9f563.entry.js.map → p-5093c486.entry.js.map} +0 -0
- /package/dist/chucao/{p-337d7f68.entry.js.map → p-51f6327c.entry.js.map} +0 -0
- /package/dist/chucao/{p-bf036509.entry.js.map → p-5577e0a0.entry.js.map} +0 -0
- /package/dist/chucao/{p-339e3c30.entry.js.map → p-56e41372.entry.js.map} +0 -0
- /package/dist/chucao/{p-a84d4493.entry.js.map → p-6c2e5931.entry.js.map} +0 -0
- /package/dist/chucao/{p-1e8d921d.entry.js.map → p-6e93c392.entry.js.map} +0 -0
- /package/dist/chucao/{p-93f25dd5.entry.js.map → p-7f99ae48.entry.js.map} +0 -0
- /package/dist/chucao/{p-e2fe7c5d.entry.js.map → p-8fcf6d36.entry.js.map} +0 -0
- /package/dist/chucao/{p-d2077ae4.entry.js.map → p-920d5727.entry.js.map} +0 -0
- /package/dist/chucao/{p-1852dfdb.entry.js.map → p-ad41da02.entry.js.map} +0 -0
- /package/dist/chucao/{p-08d90a3d.entry.js.map → p-b42ec9bf.entry.js.map} +0 -0
- /package/dist/chucao/{p-36c59ad1.entry.js.map → p-b80c39c3.entry.js.map} +0 -0
- /package/dist/chucao/{p-507d4b69.entry.js.map → p-ba589c2f.entry.js.map} +0 -0
- /package/dist/chucao/{p-39815ee2.entry.js.map → p-c4d68ab7.entry.js.map} +0 -0
- /package/dist/chucao/{p-3e6614ee.entry.js.map → p-c98e2a50.entry.js.map} +0 -0
- /package/dist/chucao/{p-4c8838a0.entry.js.map → p-ca3179ae.entry.js.map} +0 -0
- /package/dist/chucao/{p-3f9894a4.entry.js.map → p-d630f662.entry.js.map} +0 -0
- /package/dist/chucao/{p-4cda7f71.entry.js.map → p-d868bdbc.entry.js.map} +0 -0
- /package/dist/chucao/{p-f17b186f.entry.js.map → p-e6b7b2da.entry.js.map} +0 -0
- /package/dist/components/{p-CuczWSQU.js.map → p-CF1yV0aa.js.map} +0 -0
package/hydrate/index.js
CHANGED
|
@@ -2822,6 +2822,9 @@ var postUpdateComponent = (hostRef) => {
|
|
|
2822
2822
|
safeCall(instance, "componentDidUpdate", void 0, elm);
|
|
2823
2823
|
endPostUpdate();
|
|
2824
2824
|
}
|
|
2825
|
+
{
|
|
2826
|
+
hostRef.$onInstanceResolve$(elm);
|
|
2827
|
+
}
|
|
2825
2828
|
{
|
|
2826
2829
|
if (hostRef.$onRenderResolve$) {
|
|
2827
2830
|
hostRef.$onRenderResolve$();
|
|
@@ -5500,7 +5503,7 @@ class ChAccordion {
|
|
|
5500
5503
|
this.chChange.emit(this.value);
|
|
5501
5504
|
};
|
|
5502
5505
|
render() {
|
|
5503
|
-
return (hAsync(Host, { key: '
|
|
5506
|
+
return (hAsync(Host, { key: 'da264a6faa4d8da510d2964bef410d7c733bc507' }, this.items.map(item => {
|
|
5504
5507
|
const open = this.value === item.value;
|
|
5505
5508
|
return (hAsync("div", { key: item.value, class: { 'item': true, 'item--open': open } }, hAsync("h3", { class: "item-head" }, hAsync("button", { type: "button", class: "item-toggle", id: this.headerId(item.value), "data-value": item.value, "aria-expanded": open ? 'true' : 'false', "aria-controls": this.panelId(item.value), disabled: item.disabled, onClick: () => this.toggle(item.value) }, item.title)), hAsync("div", { class: "item-panel", id: this.panelId(item.value), role: "region", "aria-labelledby": this.headerId(item.value), hidden: !open }, hAsync("slot", { name: `panel-${item.value}` }))));
|
|
5506
5509
|
})));
|
|
@@ -5663,7 +5666,7 @@ class ChAlert {
|
|
|
5663
5666
|
render() {
|
|
5664
5667
|
const role = this.variant === 'warning' ? 'alert' : 'status';
|
|
5665
5668
|
const shapes = this.statusCue ? chIcons[VARIANT_ICON[this.variant]] : undefined;
|
|
5666
|
-
return (hAsync(Host, { key: '
|
|
5669
|
+
return (hAsync(Host, { key: 'c7fb041416b2958fcda758a3297a0f9546456ef3' }, hAsync("div", { key: role, class: { alert: true, [`alert--${this.variant}`]: true }, role: role }, shapes && (hAsync("svg", { key: '1a89cc6797bd6b425920f61f545f407326422e93', 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 => hAsync(shape.tag, shape.attrs)))), hAsync("div", { key: 'd30f1b3897d3ce681789507aa2677b29a83e8346', class: "alert-content" }, hAsync("slot", { key: 'a4bc52ace056a573b21ecec083d017b3c5c22245' })), this.dismissLabel && (hAsync("button", { key: '571947bd96a9c2f22b7af7989abd406dff860256', class: "alert-dismiss", type: "button", "aria-label": this.dismissLabel, onClick: this.handleDismiss }, hAsync("span", { key: 'e8d282730aa25aad78f05ce118cb65fce9ea85c5', "aria-hidden": "true" }, "\u00D7"))))));
|
|
5667
5670
|
}
|
|
5668
5671
|
static get style() { return chAlertCss(); }
|
|
5669
5672
|
static get cmpMeta() { return {
|
|
@@ -5705,7 +5708,7 @@ class ChBadge {
|
|
|
5705
5708
|
*/
|
|
5706
5709
|
statusCue = true;
|
|
5707
5710
|
render() {
|
|
5708
|
-
return (hAsync(Host, { key: '
|
|
5711
|
+
return (hAsync(Host, { key: '712c653d4047845d6afce4655271f2c80e3fe6a8' }, hAsync("span", { key: 'dd24bf1f555b229bee277b77c175b485f4a10680', class: { badge: true, [`badge--${this.variant}`]: true } }, this.statusCue && hAsync("span", { key: 'cef4173e40dac2798c2a26381763bb470cf0bacc', class: "badge-dot", "aria-hidden": "true" }), hAsync("slot", { key: '6e8c09dd9260d80c9fda09b402dfc3b1cef53907' }))));
|
|
5709
5712
|
}
|
|
5710
5713
|
static get style() { return chBadgeCss(); }
|
|
5711
5714
|
static get cmpMeta() { return {
|
|
@@ -5836,7 +5839,7 @@ class ChCard {
|
|
|
5836
5839
|
registerInstance(this, hostRef);
|
|
5837
5840
|
}
|
|
5838
5841
|
render() {
|
|
5839
|
-
return (hAsync(Host, { key: '
|
|
5842
|
+
return (hAsync(Host, { key: 'f237dce6afd9f9c88f52784de63073d3b4dc31fd' }, hAsync("div", { key: '2256360ad3b736aaf595cb0440903eb90ffc9968', class: "card" }, hAsync("slot", { key: '5ce63027b9e1abd925b4a1d7261752a4b579b336' }))));
|
|
5840
5843
|
}
|
|
5841
5844
|
static get style() { return chCardCss(); }
|
|
5842
5845
|
static get cmpMeta() { return {
|
|
@@ -5977,7 +5980,7 @@ class ChCheckbox {
|
|
|
5977
5980
|
return undefined;
|
|
5978
5981
|
}
|
|
5979
5982
|
render() {
|
|
5980
|
-
return (hAsync(Host, { key: '
|
|
5983
|
+
return (hAsync(Host, { key: '3e0f2f162d1ec1a4715b44a37211a30c63f830b2' }, hAsync("label", { key: '8042cb81ab53a9451a8757dfa63ef8cea8f41954', class: { 'control': true, 'control--disabled': this.disabled || this.formDisabled }, htmlFor: this.checkboxId }, hAsync("input", { key: '0d55f22c4625f48c8bf2eee15a7710cfb80c4328', 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: '146e3b4fa88237da4af8f8b0a408909b4d11555e', class: "label-text" }, this.label)), this.hint && !(this.invalid && this.errorMessage) && (hAsync("p", { key: 'd82032ae57e8e818a91fa04cfd5e505dea47c22d', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (hAsync("p", { key: '9f418c648d4929086a77ca868a7c13cdccb328cb', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
5981
5984
|
}
|
|
5982
5985
|
static get formAssociated() { return true; }
|
|
5983
5986
|
static get watchers() { return {
|
|
@@ -6048,13 +6051,13 @@ class ChCluster {
|
|
|
6048
6051
|
return GAPS$2.has(this.gap) ? this.gap : 'md';
|
|
6049
6052
|
}
|
|
6050
6053
|
render() {
|
|
6051
|
-
return (hAsync(Host, { key: '
|
|
6054
|
+
return (hAsync(Host, { key: 'd1852bc490835eb559f31039e14b87d59b151b11', class: {
|
|
6052
6055
|
'cluster': true,
|
|
6053
6056
|
[`cluster--gap-${this.gapStep}`]: true,
|
|
6054
6057
|
[`cluster--align-${this.align}`]: true,
|
|
6055
6058
|
[`cluster--justify-${this.justify}`]: true,
|
|
6056
6059
|
'cluster--nowrap': !this.wrap,
|
|
6057
|
-
} }, hAsync("slot", { key: '
|
|
6060
|
+
} }, hAsync("slot", { key: '7dc3c83e40d8e0d5dd18052bb9c36898a443ce23' })));
|
|
6058
6061
|
}
|
|
6059
6062
|
static get style() { return chClusterCss(); }
|
|
6060
6063
|
static get cmpMeta() { return {
|
|
@@ -6072,6 +6075,173 @@ class ChCluster {
|
|
|
6072
6075
|
}; }
|
|
6073
6076
|
}
|
|
6074
6077
|
|
|
6078
|
+
const chConfirmDialogCss = () => `:host{display:contents;font-family:var(--typography-body)}.confirm__heading{margin:0;font-family:var(--typography-heading);font-size:var(--typography-size-lg);font-weight:var(--typography-weight-semibold);color:var(--color-text-primary)}.confirm__message{margin:0;font-size:var(--typography-size-sm);color:var(--color-text-secondary);overflow-wrap:break-word}.confirm__actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:var(--spacing-md);margin-top:var(--spacing-2xl)}.confirm__button{display:inline-flex;align-items:center;justify-content:center;min-height:2.25rem;padding:0 var(--spacing-lg);border:var(--border-width) solid var(--color-border-default);border-radius:var(--radius-sm);background:var(--color-surface-default);color:var(--color-text-primary);font-family:var(--typography-body);font-size:var(--typography-size-sm);font-weight:var(--typography-weight-semibold);cursor:pointer}.confirm__button:focus-visible{outline:2px solid var(--color-accent-default);outline-offset:2px}.confirm__button:disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.confirm__button--confirm{border-color:var(--color-accent-default);background:var(--color-accent-default);color:var(--color-accent-text)}.confirm__button--danger{border-color:var(--color-status-warning);background:var(--color-status-warning);color:var(--color-text-primary)}.confirm__button--danger::before{content:'⚠';margin-right:var(--spacing-xs)}`;
|
|
6079
|
+
|
|
6080
|
+
/**
|
|
6081
|
+
* A confirmation dialog over `ch-modal`.
|
|
6082
|
+
*
|
|
6083
|
+
* Declarative only: the consumer opens it with `open` and handles the outcome.
|
|
6084
|
+
* The imperative `confirm()` helper is a separate concern and a separate issue,
|
|
6085
|
+
* because a promise-returning helper has to own mounting, focus and unhandled
|
|
6086
|
+
* rejection, none of which a component should decide for its consumer.
|
|
6087
|
+
*
|
|
6088
|
+
* The guarantees this adds over a plain `ch-modal` are the ones that make a
|
|
6089
|
+
* confirmation safe:
|
|
6090
|
+
*
|
|
6091
|
+
* - exactly one outcome per interaction — a double click on Confirm emits once;
|
|
6092
|
+
* - every dismissal path (Cancel, Escape, backdrop, confirm) is reported, so a
|
|
6093
|
+
* consumer awaiting an answer cannot hang;
|
|
6094
|
+
* - focus lands on Cancel for a destructive action, so the absent-minded Enter
|
|
6095
|
+
* does not destroy anything;
|
|
6096
|
+
* - `pending` is not a cancellation: a slow request keeps the dialog open.
|
|
6097
|
+
*/
|
|
6098
|
+
class ChConfirmDialog {
|
|
6099
|
+
constructor(hostRef) {
|
|
6100
|
+
registerInstance(this, hostRef);
|
|
6101
|
+
this.chConfirm = createEvent(this, "chConfirm");
|
|
6102
|
+
this.chCancel = createEvent(this, "chCancel");
|
|
6103
|
+
}
|
|
6104
|
+
get el() { return getElement(this); }
|
|
6105
|
+
/** Whether the dialog is open. Kept in sync when it is dismissed. */
|
|
6106
|
+
open = false;
|
|
6107
|
+
/**
|
|
6108
|
+
* The question, set as the dialog's accessible name. Required: a dialog
|
|
6109
|
+
* without a name is announced as an unlabelled group.
|
|
6110
|
+
*/
|
|
6111
|
+
heading;
|
|
6112
|
+
/** Supporting text, rendered under the heading. */
|
|
6113
|
+
message;
|
|
6114
|
+
/** Label of the confirming action. */
|
|
6115
|
+
confirmLabel = 'Confirm';
|
|
6116
|
+
/** Label of the dismissing action. */
|
|
6117
|
+
cancelLabel = 'Cancel';
|
|
6118
|
+
/**
|
|
6119
|
+
* `danger` styles the confirm action as destructive and moves the initial
|
|
6120
|
+
* focus to Cancel, so the safe choice is the default one.
|
|
6121
|
+
*/
|
|
6122
|
+
tone = 'default';
|
|
6123
|
+
/** Whether the confirm action is in flight; both buttons are then disabled. */
|
|
6124
|
+
pending = false;
|
|
6125
|
+
/**
|
|
6126
|
+
* Whether Escape and the backdrop dismiss the dialog. When false, the only
|
|
6127
|
+
* way out is one of the two buttons — use it only for a decision that must
|
|
6128
|
+
* be answered rather than abandoned.
|
|
6129
|
+
*/
|
|
6130
|
+
dismissible = true;
|
|
6131
|
+
/** Emitted once when the user confirms. */
|
|
6132
|
+
chConfirm;
|
|
6133
|
+
/** Emitted once when the dialog is dismissed without confirming. */
|
|
6134
|
+
chCancel;
|
|
6135
|
+
/** `true` once an outcome has been emitted for the current opening. */
|
|
6136
|
+
settled = false;
|
|
6137
|
+
cancelButton;
|
|
6138
|
+
confirmButton;
|
|
6139
|
+
componentDidLoad() {
|
|
6140
|
+
if (this.open) {
|
|
6141
|
+
this.onOpening();
|
|
6142
|
+
}
|
|
6143
|
+
}
|
|
6144
|
+
handleOpenChange(open) {
|
|
6145
|
+
if (open) {
|
|
6146
|
+
this.onOpening();
|
|
6147
|
+
return;
|
|
6148
|
+
}
|
|
6149
|
+
this.settled = false;
|
|
6150
|
+
}
|
|
6151
|
+
onOpening() {
|
|
6152
|
+
this.settled = false;
|
|
6153
|
+
// Focus is moved once the dialog is actually shown; the modal handles
|
|
6154
|
+
// moving focus into itself, and this refines where it lands.
|
|
6155
|
+
requestAnimationFrame(() => {
|
|
6156
|
+
const target = this.tone === 'danger' ? this.cancelButton : this.confirmButton;
|
|
6157
|
+
target?.focus();
|
|
6158
|
+
});
|
|
6159
|
+
}
|
|
6160
|
+
settle(outcome) {
|
|
6161
|
+
if (this.settled) {
|
|
6162
|
+
return;
|
|
6163
|
+
}
|
|
6164
|
+
this.settled = true;
|
|
6165
|
+
if (outcome === 'confirm') {
|
|
6166
|
+
this.chConfirm.emit();
|
|
6167
|
+
return;
|
|
6168
|
+
}
|
|
6169
|
+
this.chCancel.emit();
|
|
6170
|
+
}
|
|
6171
|
+
handleConfirm = () => {
|
|
6172
|
+
if (this.pending) {
|
|
6173
|
+
return;
|
|
6174
|
+
}
|
|
6175
|
+
this.settle('confirm');
|
|
6176
|
+
};
|
|
6177
|
+
handleCancel = () => {
|
|
6178
|
+
if (this.pending) {
|
|
6179
|
+
return;
|
|
6180
|
+
}
|
|
6181
|
+
this.open = false;
|
|
6182
|
+
this.settle('cancel');
|
|
6183
|
+
};
|
|
6184
|
+
/**
|
|
6185
|
+
* `ch-modal` reports every close that was not requested by the consumer —
|
|
6186
|
+
* Escape and the backdrop. A close while `pending` is the consumer's own
|
|
6187
|
+
* doing and is not a cancellation.
|
|
6188
|
+
*/
|
|
6189
|
+
handleModalClose = () => {
|
|
6190
|
+
this.open = false;
|
|
6191
|
+
if (this.pending) {
|
|
6192
|
+
return;
|
|
6193
|
+
}
|
|
6194
|
+
this.settle('cancel');
|
|
6195
|
+
};
|
|
6196
|
+
/**
|
|
6197
|
+
* Escape is a platform close request on the inner `<dialog>`, so a
|
|
6198
|
+
* non-dismissible dialog cancels it before it takes effect. The backdrop is
|
|
6199
|
+
* handled by `ch-modal` and is suppressed the same way.
|
|
6200
|
+
*/
|
|
6201
|
+
handleKeyDown = (event) => {
|
|
6202
|
+
if (this.dismissible || event.key !== 'Escape') {
|
|
6203
|
+
return;
|
|
6204
|
+
}
|
|
6205
|
+
event.preventDefault();
|
|
6206
|
+
event.stopPropagation();
|
|
6207
|
+
};
|
|
6208
|
+
/**
|
|
6209
|
+
* Focus the safe action. Exposed so a consumer can return focus deliberately
|
|
6210
|
+
* after a request settles.
|
|
6211
|
+
*/
|
|
6212
|
+
async focusCancel() {
|
|
6213
|
+
this.cancelButton?.focus();
|
|
6214
|
+
}
|
|
6215
|
+
render() {
|
|
6216
|
+
return (hAsync(Host, { key: '7aa8fd72a281369f47ce7f1eb99c52ab60ba4ee0', onKeyDown: this.handleKeyDown }, hAsync("ch-modal", { key: '019663f042f5c2ce3dd1f58433faee170c01e8e6', open: this.open, label: this.heading, size: "sm", onChClose: this.handleModalClose, onChOpen: () => this.onOpening() }, hAsync("h2", { key: '9d97f437e535a3a9feb181e9807dc9c532efd872', slot: "heading", class: "confirm__heading" }, this.heading), this.message && hAsync("p", { key: 'a0d64b2b915624473162557972eabdf80b445d58', class: "confirm__message" }, this.message), hAsync("div", { key: '0b44308d6eb7a4aea2c1166f8a7f6f19c41cdbb7', class: "confirm__actions" }, hAsync("button", { key: '7908d0db96e7c59c7b4673220aa62c2170b29d54', class: { 'confirm__button': true, 'confirm__button--cancel': true }, type: "button", ref: el => (this.cancelButton = el), disabled: this.pending, onClick: this.handleCancel }, this.cancelLabel), hAsync("button", { key: '43657105b474b303160da19e1fa5fda47f63207c', class: { 'confirm__button': true, 'confirm__button--confirm': true, 'confirm__button--danger': this.tone === 'danger' }, type: "button", ref: el => (this.confirmButton = el), disabled: this.pending, "aria-busy": this.pending ? 'true' : undefined, onClick: this.handleConfirm }, this.confirmLabel)))));
|
|
6217
|
+
}
|
|
6218
|
+
static get watchers() { return {
|
|
6219
|
+
"open": [{
|
|
6220
|
+
"handleOpenChange": 0
|
|
6221
|
+
}]
|
|
6222
|
+
}; }
|
|
6223
|
+
static get style() { return chConfirmDialogCss(); }
|
|
6224
|
+
static get cmpMeta() { return {
|
|
6225
|
+
"$flags$": 521,
|
|
6226
|
+
"$tagName$": "ch-confirm-dialog",
|
|
6227
|
+
"$members$": {
|
|
6228
|
+
"open": [1028],
|
|
6229
|
+
"heading": [1],
|
|
6230
|
+
"message": [1],
|
|
6231
|
+
"confirmLabel": [1, "confirm-label"],
|
|
6232
|
+
"cancelLabel": [1, "cancel-label"],
|
|
6233
|
+
"tone": [1],
|
|
6234
|
+
"pending": [4],
|
|
6235
|
+
"dismissible": [4],
|
|
6236
|
+
"settled": [32],
|
|
6237
|
+
"focusCancel": [64]
|
|
6238
|
+
},
|
|
6239
|
+
"$listeners$": undefined,
|
|
6240
|
+
"$lazyBundleId$": "-",
|
|
6241
|
+
"$attrsToReflect$": []
|
|
6242
|
+
}; }
|
|
6243
|
+
}
|
|
6244
|
+
|
|
6075
6245
|
const chDescriptionListCss = () => `:host{display:block;font-family:var(--typography-body);color:var(--color-text-secondary)}:host([hidden]){display:none}.list{margin:0;display:grid;grid-template-columns:repeat(1, minmax(0, 1fr));gap:var(--spacing-sm) var(--spacing-2xl)}.list--columns-2,.list--columns-3{grid-template-columns:repeat(2, minmax(0, 1fr))}.list--columns-3{grid-template-columns:repeat(3, minmax(0, 1fr))}@media (max-width: 48rem){.list--columns-2,.list--columns-3{grid-template-columns:minmax(0, 1fr)}}::slotted(div){display:grid;grid-template-columns:fit-content(min(12rem, 40%)) minmax(0, 1fr);gap:var(--spacing-sm);align-items:baseline}::slotted(dt){font-family:var(--typography-heading);font-weight:var(--typography-weight-semibold);font-size:var(--typography-size-sm);color:var(--color-text-primary)}::slotted(dd){margin:0;font-size:var(--typography-size-sm);min-width:0;overflow-wrap:break-word}`;
|
|
6076
6246
|
|
|
6077
6247
|
const COLUMNS = new Set(['1', '2', '3']);
|
|
@@ -6108,7 +6278,7 @@ class ChDescriptionList {
|
|
|
6108
6278
|
return COLUMNS.has(this.columns) ? this.columns : '1';
|
|
6109
6279
|
}
|
|
6110
6280
|
render() {
|
|
6111
|
-
return (hAsync(Host, { key: '
|
|
6281
|
+
return (hAsync(Host, { key: '590fc24614ba9240d7708cff6cb6027eca5904bf' }, hAsync("dl", { key: '868ee275cd6c792bff933c2429fe23985b9c30e3', class: `list list--columns-${this.columnCount}` }, hAsync("slot", { key: '7433fcda6f0e6b2c738c790839169669c31bd266' }))));
|
|
6112
6282
|
}
|
|
6113
6283
|
static get style() { return chDescriptionListCss(); }
|
|
6114
6284
|
static get cmpMeta() { return {
|
|
@@ -6134,7 +6304,7 @@ class ChDivider {
|
|
|
6134
6304
|
*/
|
|
6135
6305
|
orientation = 'horizontal';
|
|
6136
6306
|
render() {
|
|
6137
|
-
return (hAsync(Host, { key: '
|
|
6307
|
+
return (hAsync(Host, { key: '068a29854d312d17f5f5b768975996e1b8db9317', class: { 'divider--vertical': this.orientation === 'vertical' } }, hAsync("hr", { key: 'c2dca357f717b822caa028fae4c1d5e4709ae75c', class: { divider: true, [`divider--${this.orientation}`]: true }, "aria-orientation": this.orientation })));
|
|
6138
6308
|
}
|
|
6139
6309
|
static get style() { return chDividerCss(); }
|
|
6140
6310
|
static get cmpMeta() { return {
|
|
@@ -6339,7 +6509,7 @@ class ChDrawer {
|
|
|
6339
6509
|
this.chClose.emit();
|
|
6340
6510
|
};
|
|
6341
6511
|
render() {
|
|
6342
|
-
return (hAsync(Host, { key: '
|
|
6512
|
+
return (hAsync(Host, { key: 'f20d997fbaec9bcb5a4435c53bc893513e07bf05' }, hAsync("dialog", { key: '216248a651d9fbd61c659da772cb2c1cd9cdb029', class: { drawer: true, [`drawer--${this.side}`]: true }, "aria-label": this.label, ref: el => (this.dialog = el) }, hAsync("div", { key: '2d0f9c5a66ae0f609185479722236bfa35fc15ff', class: "drawer-head" }, hAsync("slot", { key: '3e3fc15109e4e463cfcff4a96cffd943a0c48f3d', name: "header" }), this.closeLabel && (hAsync("button", { key: 'a6e3b3d7ab9955cb9e84405c3313c85389bb1b5a', class: "drawer-close", type: "button", "aria-label": this.closeLabel, onClick: this.handleCloseClick }, hAsync("span", { key: '2dcb7632e635f763c0973cdb4fb7fe8dfa09fd4b', "aria-hidden": "true" }, "\u00D7")))), hAsync("div", { key: '0a73837b9dcae4d31d7abb4cec14d93a9bbdec4a', class: "drawer-body" }, hAsync("slot", { key: 'f9786b2da1062eeb7d7019b849508eb3a5fc83b7' })), hAsync("slot", { key: '85e518742d2c5435ce50c52100d24576caae9a8b', name: "footer" }))));
|
|
6343
6513
|
}
|
|
6344
6514
|
static get watchers() { return {
|
|
6345
6515
|
"open": [{
|
|
@@ -6451,7 +6621,7 @@ class ChEmoji {
|
|
|
6451
6621
|
this.loaded = true;
|
|
6452
6622
|
};
|
|
6453
6623
|
render() {
|
|
6454
|
-
return (hAsync(Host, { key: '
|
|
6624
|
+
return (hAsync(Host, { key: 'fd0f1f45a986a2668adb3cda893e4f6666f78eeb' }, hAsync("img", { key: '207a6d2d6111fd13d724e4f3ce5dcc1d299f1228', class: {
|
|
6455
6625
|
'emoji': true,
|
|
6456
6626
|
[`emoji--${this.size}`]: true,
|
|
6457
6627
|
'emoji--hidden': !this.loaded,
|
|
@@ -6507,7 +6677,7 @@ class ChEmptyState {
|
|
|
6507
6677
|
*/
|
|
6508
6678
|
size = 'md';
|
|
6509
6679
|
render() {
|
|
6510
|
-
return (hAsync(Host, { key: '
|
|
6680
|
+
return (hAsync(Host, { key: 'ad3644cfbad791e9684b20b9776c8c68d15036e2', class: { 'empty-state': true, [`empty-state--${this.size}`]: true } }, hAsync("div", { key: '88479d9470be1db6d4d9968ad656297f06a2526c', class: "empty-state__inner" }, hAsync("div", { key: '07b46c4f6e086921367b466df1b40eb3f49aeeac', class: "empty-state__icon", "aria-hidden": "true" }, hAsync("slot", { key: 'f2b769787d5b2aaa04493157f39e20c164df2322', name: "icon" })), hAsync("h3", { key: '83131b17b5dac383141f2997ac2dfdde2b620d16', class: "empty-state__title" }, this.title), this.description && hAsync("p", { key: 'ca76152650118f55229ebac53c2963cb84982e77', class: "empty-state__description" }, this.description), hAsync("div", { key: '552f1319198b0c182cace7956e84ddc9e837043e', class: "empty-state__actions" }, hAsync("slot", { key: 'b99db3bfac784acf8389f100362371c3a44f4ace' })))));
|
|
6511
6681
|
}
|
|
6512
6682
|
static get style() { return chEmptyStateCss(); }
|
|
6513
6683
|
static get cmpMeta() { return {
|
|
@@ -6578,7 +6748,7 @@ class ChGrid {
|
|
|
6578
6748
|
this.el.style.setProperty('--ch-grid-columns', template);
|
|
6579
6749
|
}
|
|
6580
6750
|
render() {
|
|
6581
|
-
return (hAsync(Host, { key: '
|
|
6751
|
+
return (hAsync(Host, { key: '7e22752629d6e8dae0dd6ae05eb12aba96c97fc2', class: { grid: true, [`grid--gap-${this.gapStep}`]: true } }, hAsync("slot", { key: 'dc7286fa1b34610aa802afc7298422147d936cbd' })));
|
|
6582
6752
|
}
|
|
6583
6753
|
static get style() { return chGridCss(); }
|
|
6584
6754
|
static get cmpMeta() { return {
|
|
@@ -6628,7 +6798,7 @@ class ChIcon {
|
|
|
6628
6798
|
render() {
|
|
6629
6799
|
const shapes = this.name ? chIcons[this.name] : undefined;
|
|
6630
6800
|
const decorative = !this.label;
|
|
6631
|
-
return (hAsync(Host, { key: '
|
|
6801
|
+
return (hAsync(Host, { key: '4d1ec8879f2715fa6973c1e06de4109f68f7b439' }, hAsync("svg", { key: 'e2a72cd9a83a9672e04484f042801041f80a2b81', 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 => hAsync(shape.tag, shape.attrs)))));
|
|
6632
6802
|
}
|
|
6633
6803
|
static get style() { return chIconCss(); }
|
|
6634
6804
|
static get cmpMeta() { return {
|
|
@@ -6691,7 +6861,7 @@ class ChIconButton {
|
|
|
6691
6861
|
};
|
|
6692
6862
|
render() {
|
|
6693
6863
|
const shapes = this.name ? chIcons[this.name] : undefined;
|
|
6694
|
-
return (hAsync(Host, { key: '
|
|
6864
|
+
return (hAsync(Host, { key: 'eb744fa706b32c5ffca8b174f5cfc5e5cb546879' }, hAsync("button", { key: 'a0923d38dc46adce13ae3d8e12426a419fe37c4a', 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 }, hAsync("svg", { key: 'db67ffae9402ea67849f8b4aa487bf3fb152da63', 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 => hAsync(shape.tag, shape.attrs))))));
|
|
6695
6865
|
}
|
|
6696
6866
|
static get style() { return chIconButtonCss(); }
|
|
6697
6867
|
static get cmpMeta() { return {
|
|
@@ -6832,7 +7002,7 @@ class ChInput {
|
|
|
6832
7002
|
return undefined;
|
|
6833
7003
|
}
|
|
6834
7004
|
render() {
|
|
6835
|
-
return (hAsync(Host, { key: '
|
|
7005
|
+
return (hAsync(Host, { key: '2a892c87f8c2d7840c89b546e53b1cd4274de6d1' }, this.label && (hAsync("label", { key: '7c10ad2de5992e8e96accb3752bb62a7ecc5a562', class: "label", htmlFor: this.inputId }, this.label)), hAsync("input", { key: '746c04af3a66f8bd3789f037d77560f30b79ae67', 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: '5c1985773e1ec0de670e5fa0d94b33cea81b9e63', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (hAsync("p", { key: '48a2823957aba104c6a6599dbd409824c2f60f79', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
6836
7006
|
}
|
|
6837
7007
|
static get formAssociated() { return true; }
|
|
6838
7008
|
static get watchers() { return {
|
|
@@ -7081,7 +7251,7 @@ class ChModal {
|
|
|
7081
7251
|
this.chClose.emit();
|
|
7082
7252
|
};
|
|
7083
7253
|
render() {
|
|
7084
|
-
return (hAsync(Host, { key: '
|
|
7254
|
+
return (hAsync(Host, { key: 'e9b0fe7e84f3de036e01f836bb431849b4486ab3' }, hAsync("dialog", { key: '0c5017b5e773534c11a74504a0773ae555b32322', class: { modal: true, [`modal--${this.size}`]: true }, "aria-label": this.label, ref: el => (this.dialog = el) }, hAsync("div", { key: 'ae8988208ac3856792eff026e8ebd1f9e696b175', class: "modal-head" }, hAsync("slot", { key: 'f7f231f4a5b8541ce2da8ea000b5ce95d58484b3', name: "heading" }), this.closeLabel && (hAsync("button", { key: 'dbf0962e6244cff373887fa1e1501aaae6e15250', class: "modal-close", type: "button", "aria-label": this.closeLabel, onClick: this.handleCloseClick }, hAsync("span", { key: 'e7e1493a5eca9afb0f9fef279efdd5692157755a', "aria-hidden": "true" }, "\u00D7")))), hAsync("div", { key: '95b719095bac72ce64e6201ef4465c1173dfb16f', class: "modal-body" }, hAsync("slot", { key: 'bad31888a31219e6dffd294ca18a749e9916c0f2' })))));
|
|
7085
7255
|
}
|
|
7086
7256
|
static get watchers() { return {
|
|
7087
7257
|
"open": [{
|
|
@@ -7322,10 +7492,10 @@ class ChNumberInput {
|
|
|
7322
7492
|
}
|
|
7323
7493
|
render() {
|
|
7324
7494
|
const showError = this.isInvalid && this.errorMessage;
|
|
7325
|
-
return (hAsync(Host, { key: '
|
|
7495
|
+
return (hAsync(Host, { key: 'cf109ceb6d832f6c9dcedd666beee69fb4e434f6' }, this.label && (hAsync("label", { key: 'cc6bb3e172738febaf91777499bd8f9c9e6c9701', class: "label", htmlFor: this.inputId }, this.label)), hAsync("input", { key: '44f4199e9d18f4dd3600183f2a4ba4e451013bc6', id: this.label ? this.inputId : undefined, class: { 'input': true, 'input--invalid': this.isInvalid },
|
|
7326
7496
|
// `text` with `inputmode`, not `type="number"`: a number input drops
|
|
7327
7497
|
// partial values and cannot show grouped digits.
|
|
7328
|
-
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 && (hAsync("p", { key: '
|
|
7498
|
+
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 && (hAsync("p", { key: '30c755eee77a4fce6c04350e61ffa084a33a085d', class: "hint", id: this.hintId }, this.hint)), showError && (hAsync("p", { key: '3bd96e7dae46ba2a16b23db0d7d1d528590468c9', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
7329
7499
|
}
|
|
7330
7500
|
static get formAssociated() { return true; }
|
|
7331
7501
|
static get watchers() { return {
|
|
@@ -7373,6 +7543,227 @@ class ChNumberInput {
|
|
|
7373
7543
|
}; }
|
|
7374
7544
|
}
|
|
7375
7545
|
|
|
7546
|
+
const chOtpInputCss = () => `: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)}.input{font-family:var(--typography-heading);font-size:var(--typography-size-lg);letter-spacing:0.4em;text-align:center;font-variant-numeric:tabular-nums}`;
|
|
7547
|
+
|
|
7548
|
+
let otpIds = 0;
|
|
7549
|
+
/**
|
|
7550
|
+
* One-time-code input.
|
|
7551
|
+
*
|
|
7552
|
+
* One native `<input>` holds the whole code, not a box per digit. Per-digit
|
|
7553
|
+
* inputs break paste, break SMS autofill (the platform fills a single field
|
|
7554
|
+
* carrying `autocomplete="one-time-code"`), and give a keyboard user several
|
|
7555
|
+
* tab stops for what is one value. The segmented look is drawn by the shadow
|
|
7556
|
+
* CSS over the single field.
|
|
7557
|
+
*
|
|
7558
|
+
* It never submits on completion: a code entered is not a decision to send it,
|
|
7559
|
+
* so the consumer listens to `chComplete` and submits when it decides to.
|
|
7560
|
+
*/
|
|
7561
|
+
class ChOtpInput {
|
|
7562
|
+
constructor(hostRef) {
|
|
7563
|
+
registerInstance(this, hostRef);
|
|
7564
|
+
this.chInput = createEvent(this, "chInput");
|
|
7565
|
+
this.chComplete = createEvent(this, "chComplete");
|
|
7566
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
7567
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
7568
|
+
}
|
|
7569
|
+
else {
|
|
7570
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
7571
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
7572
|
+
}
|
|
7573
|
+
}
|
|
7574
|
+
inputId = `ch-otp-input-${++otpIds}`;
|
|
7575
|
+
hintId = `${this.inputId}-hint`;
|
|
7576
|
+
errorId = `${this.inputId}-error`;
|
|
7577
|
+
initialValue = '';
|
|
7578
|
+
internals;
|
|
7579
|
+
formDisabled = false;
|
|
7580
|
+
get host() { return getElement(this); }
|
|
7581
|
+
/** Visible label, associated with the input via `for`/`id`. */
|
|
7582
|
+
label;
|
|
7583
|
+
/** The code without separators. Filtered to alphanumerics on every change. */
|
|
7584
|
+
value = '';
|
|
7585
|
+
/** How many characters make a complete code. */
|
|
7586
|
+
length = 6;
|
|
7587
|
+
/**
|
|
7588
|
+
* `numeric` restricts input to digits, which is the shape of nearly every
|
|
7589
|
+
* one-time code and lets a phone open the number pad.
|
|
7590
|
+
*/
|
|
7591
|
+
inputMode = 'numeric';
|
|
7592
|
+
/** Whether the codes are masked, as for a short-lived secret. */
|
|
7593
|
+
secret = false;
|
|
7594
|
+
/** Placeholder shown when empty. */
|
|
7595
|
+
placeholder;
|
|
7596
|
+
/** Name submitted with the form. */
|
|
7597
|
+
name;
|
|
7598
|
+
/** Whether the field is disabled. */
|
|
7599
|
+
disabled = false;
|
|
7600
|
+
/** Whether a complete code is required for the field to be valid. */
|
|
7601
|
+
required = false;
|
|
7602
|
+
/** Helper text, replaced by `errorMessage` when invalid. */
|
|
7603
|
+
hint;
|
|
7604
|
+
/** Custom error message; wins over the built-in incomplete-code message. */
|
|
7605
|
+
errorMessage;
|
|
7606
|
+
/** Whether the field is marked invalid by the consumer. */
|
|
7607
|
+
invalid = false;
|
|
7608
|
+
/** Emitted on every change with the current (possibly partial) code. */
|
|
7609
|
+
chInput;
|
|
7610
|
+
/**
|
|
7611
|
+
* Emitted once, when the code becomes complete and valid after not being so.
|
|
7612
|
+
* Never fires again while it stays complete, so holding a code cannot
|
|
7613
|
+
* resubmit it.
|
|
7614
|
+
*/
|
|
7615
|
+
chComplete;
|
|
7616
|
+
wasComplete = false;
|
|
7617
|
+
componentDidLoad() {
|
|
7618
|
+
this.initialValue = this.value;
|
|
7619
|
+
this.wasComplete = this.isComplete;
|
|
7620
|
+
this.syncForm();
|
|
7621
|
+
this.host.addEventListener('focusout', this.markTouched);
|
|
7622
|
+
this.host.addEventListener('invalid', this.markTouched);
|
|
7623
|
+
}
|
|
7624
|
+
/**
|
|
7625
|
+
* Leaving the field is what turns an unfinished code into an error. The
|
|
7626
|
+
* validity has to be recomputed here: `syncForm` reads the attribute, and
|
|
7627
|
+
* setting it alone would not update `ElementInternals`.
|
|
7628
|
+
*/
|
|
7629
|
+
markTouched = () => {
|
|
7630
|
+
this.host.setAttribute('data-touched', '');
|
|
7631
|
+
this.syncForm();
|
|
7632
|
+
};
|
|
7633
|
+
/** Whether the value is a complete, correctly shaped code. */
|
|
7634
|
+
get isComplete() {
|
|
7635
|
+
if (this.value.length !== this.length) {
|
|
7636
|
+
return false;
|
|
7637
|
+
}
|
|
7638
|
+
return this.inputMode === 'numeric' ? /^\d+$/u.test(this.value) : /^[a-z0-9]+$/iu.test(this.value);
|
|
7639
|
+
}
|
|
7640
|
+
/** The message for an incomplete code, which is what makes it invalid. */
|
|
7641
|
+
get incompleteMessage() {
|
|
7642
|
+
if (this.errorMessage || this.invalid || this.value === '') {
|
|
7643
|
+
return undefined;
|
|
7644
|
+
}
|
|
7645
|
+
return this.isComplete ? undefined : `Enter the ${this.length}-character code.`;
|
|
7646
|
+
}
|
|
7647
|
+
syncForm() {
|
|
7648
|
+
const internals = this.internals;
|
|
7649
|
+
if (typeof internals?.setFormValue !== 'function') {
|
|
7650
|
+
return;
|
|
7651
|
+
}
|
|
7652
|
+
internals.setFormValue(this.value);
|
|
7653
|
+
const empty = this.value === '';
|
|
7654
|
+
const base = resolveValidity({ required: this.required, empty, invalid: this.invalid, errorMessage: this.errorMessage });
|
|
7655
|
+
// A partially typed code is what the user is doing, not an error, unless
|
|
7656
|
+
// they have already left the field once.
|
|
7657
|
+
const touched = this.host.hasAttribute('data-touched');
|
|
7658
|
+
const incomplete = this.incompleteMessage;
|
|
7659
|
+
if (incomplete && touched && !empty) {
|
|
7660
|
+
internals.setValidity({ ...base.flags, customError: true }, incomplete);
|
|
7661
|
+
return;
|
|
7662
|
+
}
|
|
7663
|
+
internals.setValidity(base.flags, base.message);
|
|
7664
|
+
}
|
|
7665
|
+
formResetCallback() {
|
|
7666
|
+
this.value = this.initialValue;
|
|
7667
|
+
this.wasComplete = this.isComplete;
|
|
7668
|
+
this.syncForm();
|
|
7669
|
+
const input = this.host.shadowRoot?.querySelector('input');
|
|
7670
|
+
if (input) {
|
|
7671
|
+
input.value = this.value;
|
|
7672
|
+
}
|
|
7673
|
+
}
|
|
7674
|
+
formDisabledCallback(isDisabled) {
|
|
7675
|
+
this.formDisabled = isDisabled;
|
|
7676
|
+
}
|
|
7677
|
+
/** Strips everything the input mode does not allow, then caps the length. */
|
|
7678
|
+
sanitize(raw) {
|
|
7679
|
+
const allowed = this.inputMode === 'numeric' ? raw.replace(/\D/gu, '') : raw.replace(/[^a-z0-9]/giu, '');
|
|
7680
|
+
return allowed.slice(0, Math.max(1, this.length));
|
|
7681
|
+
}
|
|
7682
|
+
handleInput = (ev) => {
|
|
7683
|
+
const input = ev.target;
|
|
7684
|
+
const clean = this.sanitize(input.value);
|
|
7685
|
+
// The element holds the raw text, so a rejected character has to be
|
|
7686
|
+
// written back or it stays visible while the value says otherwise.
|
|
7687
|
+
if (input.value !== clean) {
|
|
7688
|
+
input.value = clean;
|
|
7689
|
+
}
|
|
7690
|
+
this.value = clean;
|
|
7691
|
+
this.chInput.emit(clean);
|
|
7692
|
+
const complete = this.isComplete;
|
|
7693
|
+
if (complete && !this.wasComplete) {
|
|
7694
|
+
this.chComplete.emit(clean);
|
|
7695
|
+
}
|
|
7696
|
+
this.wasComplete = complete;
|
|
7697
|
+
this.syncForm();
|
|
7698
|
+
};
|
|
7699
|
+
handleBlur = () => {
|
|
7700
|
+
this.syncForm();
|
|
7701
|
+
};
|
|
7702
|
+
get isInvalid() {
|
|
7703
|
+
return this.invalid || (this.host.hasAttribute('data-touched') && this.incompleteMessage !== undefined);
|
|
7704
|
+
}
|
|
7705
|
+
get describedBy() {
|
|
7706
|
+
if (this.isInvalid && this.errorMessage) {
|
|
7707
|
+
return this.errorId;
|
|
7708
|
+
}
|
|
7709
|
+
if (this.hint) {
|
|
7710
|
+
return this.hintId;
|
|
7711
|
+
}
|
|
7712
|
+
return undefined;
|
|
7713
|
+
}
|
|
7714
|
+
render() {
|
|
7715
|
+
const showError = this.isInvalid && this.errorMessage;
|
|
7716
|
+
return (hAsync(Host, { key: 'addfb3ad7a6a5fabefe89dd5cde1d4e5b79d7c7c' }, this.label && (hAsync("label", { key: 'e2ad53ac281a2334712d04ff6e09070616a38e7f', class: "label", htmlFor: this.inputId }, this.label)), hAsync("input", { key: '4ea2123ba313a2626105346db50af219f5542de3', id: this.label ? this.inputId : undefined, class: { 'input': true, 'input--invalid': this.isInvalid }, type: this.secret ? 'password' : 'text', inputMode: this.inputMode,
|
|
7717
|
+
// The platform fills a single field carrying this attribute; per-digit
|
|
7718
|
+
// inputs never receive the SMS code.
|
|
7719
|
+
autocomplete: "one-time-code", autocapitalize: this.inputMode === 'text' ? 'characters' : 'off', spellcheck: false, name: this.name, placeholder: this.placeholder, maxLength: this.length, disabled: this.disabled || this.formDisabled, required: this.required, value: this.value, "aria-invalid": this.isInvalid ? 'true' : undefined, "aria-describedby": this.describedBy, onInput: this.handleInput, onBlur: this.handleBlur }), this.hint && !showError && (hAsync("p", { key: '6ecfc85e27b82b2afe94f66959e3f5cb99708189', class: "hint", id: this.hintId }, this.hint)), showError && (hAsync("p", { key: '9b429bcea9bfb40c9583778dcdc4e8f64a84b552', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
7720
|
+
}
|
|
7721
|
+
static get formAssociated() { return true; }
|
|
7722
|
+
static get watchers() { return {
|
|
7723
|
+
"value": [{
|
|
7724
|
+
"syncForm": 0
|
|
7725
|
+
}],
|
|
7726
|
+
"required": [{
|
|
7727
|
+
"syncForm": 0
|
|
7728
|
+
}],
|
|
7729
|
+
"invalid": [{
|
|
7730
|
+
"syncForm": 0
|
|
7731
|
+
}],
|
|
7732
|
+
"errorMessage": [{
|
|
7733
|
+
"syncForm": 0
|
|
7734
|
+
}],
|
|
7735
|
+
"length": [{
|
|
7736
|
+
"syncForm": 0
|
|
7737
|
+
}],
|
|
7738
|
+
"inputMode": [{
|
|
7739
|
+
"syncForm": 0
|
|
7740
|
+
}]
|
|
7741
|
+
}; }
|
|
7742
|
+
static get style() { return chOtpInputCss(); }
|
|
7743
|
+
static get cmpMeta() { return {
|
|
7744
|
+
"$flags$": 585,
|
|
7745
|
+
"$tagName$": "ch-otp-input",
|
|
7746
|
+
"$members$": {
|
|
7747
|
+
"label": [1],
|
|
7748
|
+
"value": [1025],
|
|
7749
|
+
"length": [2],
|
|
7750
|
+
"inputMode": [1, "input-mode"],
|
|
7751
|
+
"secret": [4],
|
|
7752
|
+
"placeholder": [1],
|
|
7753
|
+
"name": [513],
|
|
7754
|
+
"disabled": [516],
|
|
7755
|
+
"required": [516],
|
|
7756
|
+
"hint": [1],
|
|
7757
|
+
"errorMessage": [1, "error-message"],
|
|
7758
|
+
"invalid": [4],
|
|
7759
|
+
"formDisabled": [32]
|
|
7760
|
+
},
|
|
7761
|
+
"$listeners$": undefined,
|
|
7762
|
+
"$lazyBundleId$": "-",
|
|
7763
|
+
"$attrsToReflect$": [["name", "name"], ["disabled", "disabled"], ["required", "required"]]
|
|
7764
|
+
}; }
|
|
7765
|
+
}
|
|
7766
|
+
|
|
7376
7767
|
const chPageHeaderCss = () => `:host{display:block}.header{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:var(--spacing-2xl);padding-bottom:var(--spacing-2xl);border-bottom:var(--border-width) solid var(--border)}.header-text{display:flex;flex-direction:column;gap:var(--spacing-xs);flex:1 1 20rem;min-width:0}.header-eyebrow{margin:0;color:var(--text-secondary);font-family:var(--font-heading);font-size:var(--typography-size-xs);letter-spacing:var(--typography-tracking-badge);text-transform:uppercase}.header-title{margin:0;color:var(--text);font-family:var(--font-heading);font-size:var(--typography-size-xl);font-weight:var(--typography-weight-bold);line-height:1.2;overflow-wrap:anywhere}.header-description{margin:0;color:var(--text-secondary);font-size:var(--typography-size-sm);line-height:1.5;overflow-wrap:anywhere}.header-actions{display:flex;flex-wrap:wrap;align-items:center;gap:var(--spacing-md);max-width:100%}.header-actions:empty{display:none}.header--stacked .header-actions{flex-basis:100%}@media (max-width: 30rem){.header{flex-direction:column}.header-actions{width:100%}}@media (forced-colors: active){.header{border-bottom-color:CanvasText}}`;
|
|
7377
7768
|
|
|
7378
7769
|
/**
|
|
@@ -7416,7 +7807,7 @@ class ChPageHeader {
|
|
|
7416
7807
|
actionsStacked = false;
|
|
7417
7808
|
render() {
|
|
7418
7809
|
const Heading = this.headingLevel;
|
|
7419
|
-
return (hAsync(Host, { key: '
|
|
7810
|
+
return (hAsync(Host, { key: '1cafd07a2f349f4430ba34013c05e5183965fbbb' }, hAsync("div", { key: '177e37bd58f4284e2ec0e8777d81141eac9f00df', class: { 'header': true, 'header--stacked': this.actionsStacked } }, hAsync("div", { key: '343b3a0b688d7e4c120e3f4d937fa8780f832937', class: "header-text" }, this.eyebrow && hAsync("p", { key: '27f87c70c45c34abb331703dab225ec94d8365c3', class: "header-eyebrow" }, this.eyebrow), hAsync(Heading, { key: '57d7d9f930284597705e7369ab2ce6f401a08ace', class: "header-title" }, this.title), this.description && hAsync("p", { key: '5213e3d9df7c05f3acf8e4b93c57c84ddc9f665c', class: "header-description" }, this.description)), hAsync("div", { key: '605e9ca206d4af6dade53df096a621fae89f595a', class: "header-actions" }, hAsync("slot", { key: 'dacaf1353ca517d10819eaa94f158e3a148319be', name: "actions" })))));
|
|
7420
7811
|
}
|
|
7421
7812
|
static get style() { return chPageHeaderCss(); }
|
|
7422
7813
|
static get cmpMeta() { return {
|
|
@@ -7435,6 +7826,95 @@ class ChPageHeader {
|
|
|
7435
7826
|
}; }
|
|
7436
7827
|
}
|
|
7437
7828
|
|
|
7829
|
+
const chPaginationCss = () => `:host{display:block;font-family:var(--typography-body);color:var(--color-text-primary)}:host([hidden]){display:none}.pager{display:flex;align-items:center;gap:var(--spacing-md)}.pager__button{display:inline-flex;align-items:center;justify-content:center;min-width:2rem;height:2rem;padding:0 var(--spacing-sm);border:var(--border-width) solid var(--color-border-default);border-radius:var(--radius-sm);background:var(--color-surface-default);color:var(--color-text-primary);font-size:var(--typography-size-md);line-height:1;cursor:pointer}.pager__button:hover:not(:disabled){border-color:var(--color-border-hover);background:var(--color-surface-hover)}.pager__button:focus-visible{outline:2px solid var(--color-accent-default);outline-offset:2px}.pager__button:disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.pager__summary{margin:0;font-size:var(--typography-size-sm);color:var(--color-text-secondary);font-variant-numeric:tabular-nums}.pager--sm .pager__button{min-width:1.5rem;height:1.5rem}.pager--sm .pager__summary{font-size:var(--typography-size-xs)}`;
|
|
7830
|
+
|
|
7831
|
+
let paginationIds = 0;
|
|
7832
|
+
/**
|
|
7833
|
+
* Controlled pagination for a known total.
|
|
7834
|
+
*
|
|
7835
|
+
* It holds no page state: `page` and `pageSize` come from the consumer and
|
|
7836
|
+
* every action emits `chPageChange` with the page it wants. That matches
|
|
7837
|
+
* `ch-table`, so a consumer wiring the two together has one model to reason
|
|
7838
|
+
* about — the table shows the rows for `page`, the pagination asks for the
|
|
7839
|
+
* next one, and nothing moves until the consumer's data does.
|
|
7840
|
+
*
|
|
7841
|
+
* No numbered page list. A list of numbers is wrong more often than it is
|
|
7842
|
+
* right (it depends on how many pages fit, which depends on the font, the
|
|
7843
|
+
* locale and the container), and it is the part consumers most often need to
|
|
7844
|
+
* replace with their own. Prev/next plus a position summary covers the
|
|
7845
|
+
* default case; the summary is what tells a screen-reader user where they are.
|
|
7846
|
+
*/
|
|
7847
|
+
class ChPagination {
|
|
7848
|
+
constructor(hostRef) {
|
|
7849
|
+
registerInstance(this, hostRef);
|
|
7850
|
+
this.chPageChange = createEvent(this, "chPageChange");
|
|
7851
|
+
}
|
|
7852
|
+
labelId = `ch-pagination-${++paginationIds}`;
|
|
7853
|
+
/** The current page, 1-based. Controlled by the consumer. */
|
|
7854
|
+
page = 1;
|
|
7855
|
+
/** How many rows a page holds. Controlled by the consumer. */
|
|
7856
|
+
pageSize = 10;
|
|
7857
|
+
/** How many rows exist in total. Zero renders a disabled, empty pager. */
|
|
7858
|
+
total = 0;
|
|
7859
|
+
/** Accessible name for the navigation landmark. */
|
|
7860
|
+
label = 'Pagination';
|
|
7861
|
+
/** Size of the controls. */
|
|
7862
|
+
size = 'md';
|
|
7863
|
+
/** Whether the whole control is disabled. */
|
|
7864
|
+
disabled = false;
|
|
7865
|
+
/** Emitted when the user asks for another page. The consumer applies it. */
|
|
7866
|
+
chPageChange;
|
|
7867
|
+
get pageCount() {
|
|
7868
|
+
if (this.total <= 0 || this.pageSize <= 0) {
|
|
7869
|
+
return 0;
|
|
7870
|
+
}
|
|
7871
|
+
return Math.ceil(this.total / this.pageSize);
|
|
7872
|
+
}
|
|
7873
|
+
/** How many rows this page shows, which is short on the last page. */
|
|
7874
|
+
get rowsOnPage() {
|
|
7875
|
+
if (this.pageCount === 0) {
|
|
7876
|
+
return 0;
|
|
7877
|
+
}
|
|
7878
|
+
const remaining = this.total - (this.page - 1) * this.pageSize;
|
|
7879
|
+
return Math.max(0, Math.min(this.pageSize, remaining));
|
|
7880
|
+
}
|
|
7881
|
+
get firstRow() {
|
|
7882
|
+
return this.rowsOnPage === 0 ? 0 : (this.page - 1) * this.pageSize + 1;
|
|
7883
|
+
}
|
|
7884
|
+
get lastRow() {
|
|
7885
|
+
return this.rowsOnPage === 0 ? 0 : this.firstRow + this.rowsOnPage - 1;
|
|
7886
|
+
}
|
|
7887
|
+
go(next) {
|
|
7888
|
+
if (this.disabled || next < 1 || next > this.pageCount || next === this.page) {
|
|
7889
|
+
return;
|
|
7890
|
+
}
|
|
7891
|
+
this.chPageChange.emit({ page: next, pageSize: this.pageSize });
|
|
7892
|
+
}
|
|
7893
|
+
render() {
|
|
7894
|
+
const count = this.pageCount;
|
|
7895
|
+
const atStart = this.page <= 1;
|
|
7896
|
+
const atEnd = count === 0 || this.page >= count;
|
|
7897
|
+
const blocked = this.disabled || count === 0;
|
|
7898
|
+
return (hAsync(Host, { key: '82d5cbf478d149a09f17d43113374f0a9fdb626c' }, hAsync("nav", { key: 'd6b712c900e61d03864e3b2f799a881f340b01a9', class: { pager: true, [`pager--${this.size}`]: true }, "aria-label": this.label }, hAsync("button", { key: 'f3a2d877c6af803d8bde467efbc437c36502e7c3', class: "pager__button", type: "button", disabled: blocked || atStart, onClick: () => this.go(this.page - 1), "aria-label": "Previous page" }, hAsync("span", { key: '8d2c3e7d96bc0761fb56318b34a70924c7250939', "aria-hidden": "true" }, "\u2039")), hAsync("p", { key: 'c4eb6fb365ab8f06dadee383be08f0d8fe39f882', class: "pager__summary", id: this.labelId, "aria-live": "polite" }, count === 0 ? 'No results' : `${this.firstRow}–${this.lastRow} of ${this.total}`), hAsync("button", { key: '1ee7a5084c6d937bb1d1b2260b09dd5d190aaf09', class: "pager__button", type: "button", disabled: blocked || atEnd, onClick: () => this.go(this.page + 1), "aria-label": "Next page" }, hAsync("span", { key: '8fbf8209157fe9833a25ed22270580a980d66a1d', "aria-hidden": "true" }, "\u203A")))));
|
|
7899
|
+
}
|
|
7900
|
+
static get style() { return chPaginationCss(); }
|
|
7901
|
+
static get cmpMeta() { return {
|
|
7902
|
+
"$flags$": 521,
|
|
7903
|
+
"$tagName$": "ch-pagination",
|
|
7904
|
+
"$members$": {
|
|
7905
|
+
"page": [2],
|
|
7906
|
+
"pageSize": [2, "page-size"],
|
|
7907
|
+
"total": [2],
|
|
7908
|
+
"label": [1],
|
|
7909
|
+
"size": [1],
|
|
7910
|
+
"disabled": [516]
|
|
7911
|
+
},
|
|
7912
|
+
"$listeners$": undefined,
|
|
7913
|
+
"$lazyBundleId$": "-",
|
|
7914
|
+
"$attrsToReflect$": [["disabled", "disabled"]]
|
|
7915
|
+
}; }
|
|
7916
|
+
}
|
|
7917
|
+
|
|
7438
7918
|
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)}`;
|
|
7439
7919
|
|
|
7440
7920
|
let radioIds = 0;
|
|
@@ -7546,7 +8026,7 @@ class ChRadio {
|
|
|
7546
8026
|
}
|
|
7547
8027
|
render() {
|
|
7548
8028
|
const groupName = this.name || `${this.groupId}-group`;
|
|
7549
|
-
return (hAsync(Host, { key: '
|
|
8029
|
+
return (hAsync(Host, { key: 'bf7c403e1c7c172b5427d6e41d6740909e7f42f8' }, this.label && (hAsync("span", { key: '4a5391dca354ab46c80238f0f5d8ac43f1024b28', class: "group-label", id: this.labelId }, this.label)), hAsync("div", { key: '75854ae56cf848cbfcbb6a3a36fd831975e41071', 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: '270d6cdf03427427e88d5c6445f6607779c3ee14', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (hAsync("p", { key: '6091a667601e9ff02f4b245d5a2cebf1e63d4ce0', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
7550
8030
|
}
|
|
7551
8031
|
static get formAssociated() { return true; }
|
|
7552
8032
|
static get watchers() { return {
|
|
@@ -7690,7 +8170,7 @@ class ChSegmentedControl {
|
|
|
7690
8170
|
}
|
|
7691
8171
|
render() {
|
|
7692
8172
|
const groupName = this.name || `${this.groupId}-group`;
|
|
7693
|
-
return (hAsync(Host, { key: '
|
|
8173
|
+
return (hAsync(Host, { key: '521878f5cc2c183a1ac2c89d2fa4d1b26e58dcce' }, this.label && (hAsync("span", { key: 'd87b35d855bd1185ddff983b7af098dcd867ed3a', class: "group-label", id: this.labelId }, this.label)), hAsync("div", { key: '008d37b8f9c50b007d7975b8cf0ce7ba52c283a1', class: { segmented: true, [`segmented--${this.size}`]: true }, 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", type: "radio", name: groupName, value: option.value, checked: option.value === this.value, disabled: this.disabled || this.formDisabled || option.disabled, onChange: this.handleChange }), hAsync("span", { class: "label-text" }, option.label)))))));
|
|
7694
8174
|
}
|
|
7695
8175
|
static get formAssociated() { return true; }
|
|
7696
8176
|
static get watchers() { return {
|
|
@@ -7833,7 +8313,7 @@ class ChSelect {
|
|
|
7833
8313
|
return undefined;
|
|
7834
8314
|
}
|
|
7835
8315
|
render() {
|
|
7836
|
-
return (hAsync(Host, { key: '
|
|
8316
|
+
return (hAsync(Host, { key: '21825ec1b83a93617413179ec79ba42ef2e980fe' }, this.label && (hAsync("label", { key: 'e41e1268d92384f93bf492f90c6a727ddd5a05e0', class: "label", htmlFor: this.selectId }, this.label)), hAsync("select", { key: '25160df5f7628bf89d6d7bb1f2736b44d02455d9', 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: '6e6977e6c5d120a2bf28b1b05892ff90ca32e1ff', 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: '92cb97df6b5ff80857fa6463d189e366697d6fd5', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (hAsync("p", { key: '08d3f5deefd5d155c0fd54f06a0f6f5c60db8873', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
7837
8317
|
}
|
|
7838
8318
|
static get formAssociated() { return true; }
|
|
7839
8319
|
static get watchers() { return {
|
|
@@ -7926,7 +8406,7 @@ class ChSkeleton {
|
|
|
7926
8406
|
return { width: this.width, height: this.height };
|
|
7927
8407
|
}
|
|
7928
8408
|
render() {
|
|
7929
|
-
return (hAsync(Host, { key: '
|
|
8409
|
+
return (hAsync(Host, { key: '4bf9bb4d0fdfb1ecff7f0a9606da0c3eaa47aca3', "aria-hidden": "true", class: { 'skeleton': true, [`skeleton--${this.shape}`]: true, 'skeleton--animated': this.animated } }, Array.from({ length: this.items }).map((value, index) => (hAsync("span", { class: "skeleton__item", style: this.sizeStyle, key: index, "data-index": String(value) })))));
|
|
7930
8410
|
}
|
|
7931
8411
|
static get style() { return chSkeletonCss(); }
|
|
7932
8412
|
static get cmpMeta() { return {
|
|
@@ -7974,7 +8454,7 @@ class ChSpinner {
|
|
|
7974
8454
|
label;
|
|
7975
8455
|
render() {
|
|
7976
8456
|
const labelled = Boolean(this.label);
|
|
7977
|
-
return (hAsync(Host, { key: '
|
|
8457
|
+
return (hAsync(Host, { key: 'ed67d11ad7efe04c34372852f5c4b81c71bf2327' }, hAsync("span", { key: 'fff47dcd59f6e8881ea6295f5d062f888328a081', class: { spinner: true, [`spinner--${this.size}`]: true }, role: labelled ? 'status' : undefined, "aria-label": labelled ? this.label : undefined, "aria-hidden": labelled ? undefined : 'true' })));
|
|
7978
8458
|
}
|
|
7979
8459
|
static get style() { return chSpinnerCss(); }
|
|
7980
8460
|
static get cmpMeta() { return {
|
|
@@ -8020,7 +8500,7 @@ class ChStack {
|
|
|
8020
8500
|
return GAPS.has(this.gap) ? this.gap : 'md';
|
|
8021
8501
|
}
|
|
8022
8502
|
render() {
|
|
8023
|
-
return (hAsync(Host, { key: '
|
|
8503
|
+
return (hAsync(Host, { key: '9c781e2f2c953d67442838300c7cd83fb47c19c6', class: { stack: true, [`stack--gap-${this.gapStep}`]: true, [`stack--align-${this.align}`]: true, [`stack--justify-${this.justify}`]: true } }, hAsync("slot", { key: '3907d79b2c5f58a9dccf9b68e34d3fb0878c16a5' })));
|
|
8024
8504
|
}
|
|
8025
8505
|
static get style() { return chStackCss(); }
|
|
8026
8506
|
static get cmpMeta() { return {
|
|
@@ -8086,10 +8566,10 @@ class ChStat {
|
|
|
8086
8566
|
}
|
|
8087
8567
|
render() {
|
|
8088
8568
|
const cue = this.toneClass === 'positive' ? '+' : this.toneClass === 'negative' ? '−' : null;
|
|
8089
|
-
return (hAsync(Host, { key: '
|
|
8569
|
+
return (hAsync(Host, { key: '79553724e7efce617f793913fc4b65301d8e4214', class: "stat" }, hAsync("div", { key: '1d24c5b7fce578242c2464914beddd7c0bc0ac1b', class: "stat__inner" }, hAsync("span", { key: '37bbb5ebf996a2f460d817ffc546bf37100a4c7f', class: "stat__label" }, this.label), hAsync("span", { key: 'a1e5ff57b56f04fcc31b31d04ad6e8fae4ab75e3', class: {
|
|
8090
8570
|
stat__value: true,
|
|
8091
8571
|
[`stat__value--${this.toneClass}`]: this.toneClass !== 'default',
|
|
8092
|
-
} }, cue && (hAsync("span", { key: '
|
|
8572
|
+
} }, cue && (hAsync("span", { key: '9a35c34c366d66f3712f9c22cacefe48e550a08f', class: "stat__cue", "aria-hidden": "true" }, cue)), hAsync("slot", { key: 'cbf547c8ec13a675cd694e39016b7a702fac41a5', name: "value" }, this.value)), this.hint && hAsync("span", { key: 'ceaa61ab32fd4b607fe40f96a4ded7588098c98b', class: "stat__hint" }, this.hint), hAsync("div", { key: '67352638ded6243693a9698105b9d330466ccc3b', class: "stat__footer" }, hAsync("slot", { key: '8d8e59eae68d8d7153a57ec33a8185483e79b8f3', name: "footer" })))));
|
|
8093
8573
|
}
|
|
8094
8574
|
static get style() { return chStatCss(); }
|
|
8095
8575
|
static get cmpMeta() { return {
|
|
@@ -8215,7 +8695,7 @@ class ChSwitch {
|
|
|
8215
8695
|
return undefined;
|
|
8216
8696
|
}
|
|
8217
8697
|
render() {
|
|
8218
|
-
return (hAsync(Host, { key: '
|
|
8698
|
+
return (hAsync(Host, { key: 'f0ad3dab1049febb1e4506c538a938eec237b6ee' }, hAsync("label", { key: '0ec252ff6c58a79c3d1054312f6f92dd03352f69', class: { 'control': true, 'control--disabled': this.disabled || this.formDisabled }, htmlFor: this.switchId }, hAsync("input", { key: 'a2471b09c6e1a026ec6189b3b542edc7147b8759', 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: 'dbcf0512d51e71c0072e4d159e23d822a7676da2', class: "track" }, hAsync("span", { key: 'e7ef5934e2c03ba12e320fe963b4904237bf05d5', class: "thumb" })), this.label && hAsync("span", { key: '90e1fc7560f839ec50014648235cc753c955b82a', class: "label-text" }, this.label)), this.hint && !(this.invalid && this.errorMessage) && (hAsync("p", { key: 'c5150070147fcf40364925a5c164ec80d511b411', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (hAsync("p", { key: 'c9cc633cd70f53aa62425faf92e760cf8cb816fd', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
8219
8699
|
}
|
|
8220
8700
|
static get formAssociated() { return true; }
|
|
8221
8701
|
static get watchers() { return {
|
|
@@ -8412,7 +8892,7 @@ class ChTable {
|
|
|
8412
8892
|
const empty = this.emptyState;
|
|
8413
8893
|
// Before the first measurement the table is rendered as non-empty, so a
|
|
8414
8894
|
// consumer never sees the empty message flash over real rows.
|
|
8415
|
-
return (hAsync(Host, { key: '
|
|
8895
|
+
return (hAsync(Host, { key: 'e7957ed09b624ec1fdc599f300d7b1a49668ec41', class: { 'table': true, 'table--empty': empty === 'true' || empty === 'filtered' } }, hAsync("div", { key: 'c2fe932de59ee1c557c7a10bdd5f8704b5ee1dd2', class: "table__scroll", tabIndex: 0, role: "group", "aria-labelledby": this.captionId }, hAsync("table", { key: '9e76c06676ef07c3c7fc46e80e78a7baba6f0c33' }, hAsync("caption", { key: '3842f79c25b143fdb6d410d985e1d456cbdde190', id: this.captionId, class: "caption" }, this.label), hAsync("thead", { key: '1116cf7fed60c9757fac4097332aa2308609cb6b' }, hAsync("tr", { key: 'f8ea8e04ca4bd02a63768c93c6ce1c5b4e307792' }, this.columns.map(column => this.renderHeaderCell(column)))), hAsync("tbody", { key: '2a2c7b18fad74c854cad9164978753ffe168219f' }, hAsync("slot", { key: '514e8c0b56e8beb8c0503723823ce8be7a588af6' })))), (empty === 'true' || empty === 'filtered') && (hAsync("div", { key: 'a64841b511490e24462b89b8007f79c662de6120', class: "table__empty", id: this.emptyId }, hAsync("slot", { key: '32bcbe36421d083883223dadaec7dbd194deab8c', name: "empty" }, hAsync("p", { key: '36a9af8b0e9cbb0dfb96d52d057c910a92fe918e', class: "table__empty-message" }, this.emptyMessage(empty)))))));
|
|
8416
8896
|
}
|
|
8417
8897
|
static get watchers() { return {
|
|
8418
8898
|
"filtered": [{
|
|
@@ -8532,7 +9012,7 @@ class ChTabs {
|
|
|
8532
9012
|
}
|
|
8533
9013
|
render() {
|
|
8534
9014
|
const active = this.activeValue;
|
|
8535
|
-
return (hAsync(Host, { key: '
|
|
9015
|
+
return (hAsync(Host, { key: '596a51404c0d7d87f9988534f65e98135ecfcb75' }, hAsync("div", { key: '6eb8cf1c1a986ce1ebd211806d130c0156bad2f1', class: "tablist", role: "tablist", "aria-label": this.label, onKeyDown: this.handleKeyDown, ref: el => (this.tablistEl = el) }, this.tabs.map(tab => {
|
|
8536
9016
|
const selected = tab.value === active;
|
|
8537
9017
|
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));
|
|
8538
9018
|
})), 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}` }))))));
|
|
@@ -8674,7 +9154,7 @@ class ChTextarea {
|
|
|
8674
9154
|
return undefined;
|
|
8675
9155
|
}
|
|
8676
9156
|
render() {
|
|
8677
|
-
return (hAsync(Host, { key: '
|
|
9157
|
+
return (hAsync(Host, { key: 'd416e809a6e1e3efe416add0008da16a690a611f' }, this.label && (hAsync("label", { key: '777fd65954d8b346dd58ff06fa482e63ebcc3469', class: "label", htmlFor: this.textareaId }, this.label)), hAsync("textarea", { key: '5ec5f626a54f7b94be8064e759553f7324499485', 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: 'dee1dba3eda31566326284fccbdc0f352b14fe8f', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (hAsync("p", { key: '5e1d47eb86b8ddd5284c3bad620bab11e340034c', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
8678
9158
|
}
|
|
8679
9159
|
static get formAssociated() { return true; }
|
|
8680
9160
|
static get watchers() { return {
|
|
@@ -8745,7 +9225,7 @@ class ChTimeline {
|
|
|
8745
9225
|
registerInstance(this, hostRef);
|
|
8746
9226
|
}
|
|
8747
9227
|
render() {
|
|
8748
|
-
return (hAsync(Host, { key: '
|
|
9228
|
+
return (hAsync(Host, { key: 'f8e1398cd3993e0b4fdfa039f2e09d99321745e0', class: "timeline" }, hAsync("ol", { key: '0341a6f18ed91895bc18b01b4a2d327eed48befc', class: "list" }, hAsync("slot", { key: '90c240cb80a37e844f840d062b7b7e5b97a97c1a' }))));
|
|
8749
9229
|
}
|
|
8750
9230
|
static get style() { return chTimelineCss(); }
|
|
8751
9231
|
static get cmpMeta() { return {
|
|
@@ -8859,7 +9339,7 @@ function correction(before, after) {
|
|
|
8859
9339
|
return 0;
|
|
8860
9340
|
}
|
|
8861
9341
|
|
|
8862
|
-
const chTooltipCss = () => `:host{display:inline-block}.anchor{position:relative;display:inline-flex}.bubble{position:absolute;z-index:var(--z-index-dropdown);width:max-content;max-width:min(16rem, calc(100vw - 2 * var(--spacing-2xl)));padding:var(--spacing-md) var(--spacing-2xl);border:var(--border-width) solid var(--border);border-radius:var(--radius-sm);background:var(--color-background-base);color:var(--text);font-family:var(--font-body);font-size:var(--typography-size-sm);line-height:1.4;opacity:0;visibility:hidden;transition:opacity var(--duration-fast) var(--easing-default), visibility var(--duration-fast) var(--easing-default)}.bubble--visible{opacity:1;visibility:visible}.bubble::before{content:'';position:absolute}.bubble--positioned{position:fixed;top:var(--ch-tooltip-offset-top);left:var(--ch-tooltip-offset-left);transform:none;margin:0}.bubble--top{bottom:100%;left:50%;transform:translateX(-50%);margin-bottom:var(--spacing-md)}.bubble.bubble--positioned.bubble--top,.bubble.bubble--positioned.bubble--bottom,.bubble.bubble--positioned.bubble--left,.bubble.bubble--positioned.bubble--right{inset:auto;top:var(--ch-tooltip-offset-top);left:var(--ch-tooltip-offset-left);right:auto;bottom:auto;transform:none;margin:0}.bubble--top::before{top:100%;left:0;right:0;height:var(--spacing-md)}.bubble--bottom{top:100%;left:50%;transform:translateX(-50%);margin-top:var(--spacing-md)}.bubble--bottom::before{bottom:100%;left:0;right:0;height:var(--spacing-md)}.bubble--left{right:100%;top:50%;transform:translateY(-50%);margin-right:var(--spacing-md)}.bubble--left::before{left:100%;top:0;bottom:0;width:var(--spacing-md)}.bubble--right{left:100%;top:50%;transform:translateY(-50%);margin-left:var(--spacing-md)}.bubble--right::before{right:100%;top:0;bottom:0;width:var(--spacing-md)}@media (prefers-reduced-motion: reduce){.bubble{transition:none}}`;
|
|
9342
|
+
const chTooltipCss = () => `:host{display:inline-block}.anchor{position:relative;display:inline-flex}.probe{position:fixed;top:0;left:0;width:1px;height:1px;visibility:hidden;pointer-events:none}.bubble{position:absolute;z-index:var(--z-index-dropdown);width:max-content;max-width:min(16rem, calc(100vw - 2 * var(--spacing-2xl)));padding:var(--spacing-md) var(--spacing-2xl);border:var(--border-width) solid var(--border);border-radius:var(--radius-sm);background:var(--color-background-base);color:var(--text);font-family:var(--font-body);font-size:var(--typography-size-sm);line-height:1.4;opacity:0;visibility:hidden;transition:opacity var(--duration-fast) var(--easing-default), visibility var(--duration-fast) var(--easing-default)}.bubble--visible{opacity:1;visibility:visible}.bubble::before{content:'';position:absolute}.bubble--positioned{position:fixed;top:var(--ch-tooltip-offset-top);left:var(--ch-tooltip-offset-left);transform:none;margin:0}.bubble--top{bottom:100%;left:50%;transform:translateX(-50%);margin-bottom:var(--spacing-md)}.bubble.bubble--positioned.bubble--top,.bubble.bubble--positioned.bubble--bottom,.bubble.bubble--positioned.bubble--left,.bubble.bubble--positioned.bubble--right{inset:auto;top:var(--ch-tooltip-offset-top);left:var(--ch-tooltip-offset-left);right:auto;bottom:auto;transform:none;margin:0}.bubble--top::before{top:100%;left:0;right:0;height:var(--spacing-md)}.bubble--bottom{top:100%;left:50%;transform:translateX(-50%);margin-top:var(--spacing-md)}.bubble--bottom::before{bottom:100%;left:0;right:0;height:var(--spacing-md)}.bubble--left{right:100%;top:50%;transform:translateY(-50%);margin-right:var(--spacing-md)}.bubble--left::before{left:100%;top:0;bottom:0;width:var(--spacing-md)}.bubble--right{left:100%;top:50%;transform:translateY(-50%);margin-left:var(--spacing-md)}.bubble--right::before{right:100%;top:0;bottom:0;width:var(--spacing-md)}@media (prefers-reduced-motion: reduce){.bubble{transition:none}}`;
|
|
8863
9343
|
|
|
8864
9344
|
let tooltipIds = 0;
|
|
8865
9345
|
/** Space between the trigger and the bubble, matching `--spacing-md`. */
|
|
@@ -8894,6 +9374,7 @@ class ChTooltip {
|
|
|
8894
9374
|
get el() { return getElement(this); }
|
|
8895
9375
|
fallbackId = `ch-tooltip-${++tooltipIds}`;
|
|
8896
9376
|
bubbleEl;
|
|
9377
|
+
probeEl;
|
|
8897
9378
|
cleanup;
|
|
8898
9379
|
/**
|
|
8899
9380
|
* The side the bubble is placed on. It is a preference: when that side has no
|
|
@@ -8985,30 +9466,46 @@ class ChTooltip {
|
|
|
8985
9466
|
* Measures the anchor and the bubble and stores the offset that keeps the
|
|
8986
9467
|
* bubble inside the viewport. Nothing is measured before the bubble has a
|
|
8987
9468
|
* box to measure, so the pre-paint render uses plain CSS.
|
|
9469
|
+
*
|
|
9470
|
+
* A fixed bubble is positioned against the nearest ancestor that establishes
|
|
9471
|
+
* a containing block (a `transform`, `filter`, `backdrop-filter`, `contain`
|
|
9472
|
+
* or `will-change`), not necessarily the viewport. The probe is fixed at the
|
|
9473
|
+
* containing block's origin, so both the anchor and the viewport are
|
|
9474
|
+
* converted into that same space before `placeOverlay` does its maths.
|
|
8988
9475
|
*/
|
|
8989
9476
|
position() {
|
|
8990
9477
|
if (typeof window === 'undefined') {
|
|
8991
9478
|
return;
|
|
8992
9479
|
}
|
|
8993
9480
|
const bubble = this.bubbleEl ?? (this.bubbleEl = this.el.shadowRoot?.querySelector('.bubble') ?? undefined);
|
|
8994
|
-
|
|
9481
|
+
const probe = this.probeEl ?? (this.probeEl = this.el.shadowRoot?.querySelector('.probe') ?? undefined);
|
|
9482
|
+
if (!bubble || !probe || bubble.offsetWidth === 0) {
|
|
8995
9483
|
return;
|
|
8996
9484
|
}
|
|
8997
9485
|
const anchorRect = this.slotted('trigger')?.getBoundingClientRect?.();
|
|
8998
9486
|
if (!anchorRect) {
|
|
8999
9487
|
return;
|
|
9000
9488
|
}
|
|
9489
|
+
const probeRect = probe.getBoundingClientRect();
|
|
9490
|
+
const scaleX = probeRect.width || 1;
|
|
9491
|
+
const scaleY = probeRect.height || 1;
|
|
9492
|
+
const inContainingBlock = (rect) => ({
|
|
9493
|
+
top: (rect.top - probeRect.top) / scaleY,
|
|
9494
|
+
left: (rect.left - probeRect.left) / scaleX,
|
|
9495
|
+
width: rect.width / scaleX,
|
|
9496
|
+
height: rect.height / scaleY,
|
|
9497
|
+
});
|
|
9001
9498
|
const surface = {
|
|
9002
9499
|
width: bubble.offsetWidth + horizontalMargin(bubble),
|
|
9003
9500
|
height: bubble.offsetHeight,
|
|
9004
9501
|
};
|
|
9005
9502
|
const viewport = window.visualViewport;
|
|
9006
9503
|
const { placement, top, left } = placeOverlay({
|
|
9007
|
-
anchor:
|
|
9504
|
+
anchor: inContainingBlock(anchorRect),
|
|
9008
9505
|
surface,
|
|
9009
|
-
viewport: viewport
|
|
9506
|
+
viewport: inContainingBlock(viewport
|
|
9010
9507
|
? { top: viewport.offsetTop, left: viewport.offsetLeft, width: viewport.width, height: viewport.height }
|
|
9011
|
-
: { top: 0, left: 0, width: window.innerWidth, height: window.innerHeight },
|
|
9508
|
+
: { top: 0, left: 0, width: window.innerWidth, height: window.innerHeight }),
|
|
9012
9509
|
preferred: this.placement,
|
|
9013
9510
|
gap: GAP,
|
|
9014
9511
|
});
|
|
@@ -9034,7 +9531,7 @@ class ChTooltip {
|
|
|
9034
9531
|
};
|
|
9035
9532
|
render() {
|
|
9036
9533
|
const { offset } = this;
|
|
9037
|
-
return (hAsync(Host, { key: '
|
|
9534
|
+
return (hAsync(Host, { key: 'ccc4855053e0c1661f37ef6d40dffc4d0ff8fef3' }, hAsync("span", { key: 'c71b50bd48142031f60017a01e9abbeaad755f83', class: "anchor" }, hAsync("span", { key: 'aa337facc4dd983a5c2b2cf68ef1b3079e911f0b', class: "probe", "aria-hidden": "true", ref: el => (this.probeEl = el) }), hAsync("slot", { key: 'd4c7db781d9cad1b61d0b17071e41ee9619e5129', name: "trigger", onSlotchange: this.associate }), hAsync("span", { key: '8eda03e816c13ba58721a3f2c058d1e812c5630e', ref: el => (this.bubbleEl = el), style: {
|
|
9038
9535
|
'--ch-tooltip-offset-top': offset ? `${offset.top}px` : null,
|
|
9039
9536
|
'--ch-tooltip-offset-left': offset ? `${offset.left}px` : null,
|
|
9040
9537
|
}, class: {
|
|
@@ -9042,7 +9539,7 @@ class ChTooltip {
|
|
|
9042
9539
|
'bubble--positioned': Boolean(this.offset),
|
|
9043
9540
|
[`bubble--${this.resolvedPlacement ?? this.placement}`]: true,
|
|
9044
9541
|
'bubble--visible': this.visible,
|
|
9045
|
-
} }, hAsync("slot", { key: '
|
|
9542
|
+
} }, hAsync("slot", { key: '402e2c295e88586d78974a2169a75afda1380c96', name: "content", onSlotchange: this.associate })))));
|
|
9046
9543
|
}
|
|
9047
9544
|
static get style() { return chTooltipCss(); }
|
|
9048
9545
|
static get cmpMeta() { return {
|
|
@@ -9073,6 +9570,7 @@ registerComponents([
|
|
|
9073
9570
|
ChCard,
|
|
9074
9571
|
ChCheckbox,
|
|
9075
9572
|
ChCluster,
|
|
9573
|
+
ChConfirmDialog,
|
|
9076
9574
|
ChDescriptionList,
|
|
9077
9575
|
ChDivider,
|
|
9078
9576
|
ChDrawer,
|
|
@@ -9085,7 +9583,9 @@ registerComponents([
|
|
|
9085
9583
|
ChLink,
|
|
9086
9584
|
ChModal,
|
|
9087
9585
|
ChNumberInput,
|
|
9586
|
+
ChOtpInput,
|
|
9088
9587
|
ChPageHeader,
|
|
9588
|
+
ChPagination,
|
|
9089
9589
|
ChRadio,
|
|
9090
9590
|
ChSegmentedControl,
|
|
9091
9591
|
ChSelect,
|