@devschile/chucao 2.3.0 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -16
- package/dist/chucao/chucao.css +1 -1
- package/dist/chucao/chucao.esm.js +1 -1
- package/dist/chucao/chucao.esm.js.map +1 -1
- package/dist/chucao/index.esm.js +1 -1
- package/dist/chucao/index.esm.js.map +1 -1
- package/dist/chucao/p-0bc141a2.entry.js +2 -0
- package/dist/chucao/p-0bc141a2.entry.js.map +1 -0
- package/dist/chucao/p-0e044eff.entry.js +2 -0
- package/dist/chucao/p-0e044eff.entry.js.map +1 -0
- package/dist/chucao/{p-ff5f5c1f.entry.js → p-1108062e.entry.js} +2 -2
- package/dist/chucao/p-26e144ff.entry.js +2 -0
- package/dist/chucao/p-26e144ff.entry.js.map +1 -0
- package/dist/chucao/p-2c681cc0.entry.js +2 -0
- package/dist/chucao/p-2c681cc0.entry.js.map +1 -0
- package/dist/chucao/p-2e785177.entry.js +2 -0
- package/dist/chucao/p-2e785177.entry.js.map +1 -0
- package/dist/chucao/{p-04dbcfa0.entry.js → p-337d7f68.entry.js} +2 -2
- package/dist/chucao/p-350f974d.entry.js +2 -0
- package/dist/chucao/p-350f974d.entry.js.map +1 -0
- package/dist/chucao/p-4846cac4.entry.js +2 -0
- package/dist/chucao/p-6345c9e1.entry.js +2 -0
- package/dist/chucao/p-6345c9e1.entry.js.map +1 -0
- package/dist/chucao/p-957acf39.entry.js +2 -0
- package/dist/chucao/p-957acf39.entry.js.map +1 -0
- package/dist/chucao/p-97655c41.entry.js +2 -0
- package/dist/chucao/p-97655c41.entry.js.map +1 -0
- package/dist/chucao/{p-6a4bc80c.entry.js → p-9f73855e.entry.js} +2 -2
- package/dist/chucao/p-BXzZsX2r.js +2 -0
- package/dist/chucao/p-BXzZsX2r.js.map +1 -0
- package/dist/chucao/p-CIV5Gg1o.js +3 -0
- package/dist/chucao/p-CIV5Gg1o.js.map +1 -0
- package/dist/chucao/p-CnivhwvG.js +2 -0
- package/dist/chucao/p-CnivhwvG.js.map +1 -0
- package/dist/chucao/p-b53d954e.entry.js +2 -0
- package/dist/chucao/p-b53d954e.entry.js.map +1 -0
- package/dist/chucao/{p-c986036f.entry.js → p-b6cc08f0.entry.js} +2 -2
- package/dist/chucao/p-be7b5c21.entry.js +2 -0
- package/dist/chucao/p-be7b5c21.entry.js.map +1 -0
- package/dist/chucao/p-c165f839.entry.js +2 -0
- package/dist/chucao/p-c165f839.entry.js.map +1 -0
- package/dist/chucao/p-c251b0d1.entry.js +2 -0
- package/dist/chucao/p-c251b0d1.entry.js.map +1 -0
- package/dist/chucao/p-f5b74bca.entry.js +2 -0
- package/dist/chucao/p-f5b74bca.entry.js.map +1 -0
- package/dist/chucao/p-f9fe752c.entry.js +2 -0
- package/dist/chucao/p-f9fe752c.entry.js.map +1 -0
- package/dist/chucao/p-fdf065e6.entry.js +2 -0
- package/dist/chucao/p-fdf065e6.entry.js.map +1 -0
- package/dist/cjs/ch-accordion.cjs.entry.js +1 -1
- package/dist/cjs/ch-alert_8.cjs.entry.js +69 -38
- package/dist/cjs/ch-alert_8.cjs.entry.js.map +1 -1
- package/dist/cjs/ch-checkbox.cjs.entry.js +9 -11
- package/dist/cjs/ch-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/ch-cluster.cjs.entry.js +47 -0
- package/dist/cjs/ch-cluster.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-divider.cjs.entry.js +2 -2
- package/dist/cjs/ch-drawer.cjs.entry.js +4 -3
- package/dist/cjs/ch-drawer.cjs.entry.js.map +1 -1
- package/dist/cjs/ch-emoji.cjs.entry.js +2 -2
- package/dist/cjs/ch-empty-state.cjs.entry.js +34 -0
- package/dist/cjs/ch-empty-state.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-grid.cjs.entry.js +59 -0
- package/dist/cjs/ch-grid.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-icon-button.cjs.entry.js +51 -0
- package/dist/cjs/ch-icon-button.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-icon.cjs.entry.js +38 -0
- package/dist/cjs/ch-icon.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-link.cjs.entry.js +1 -1
- package/dist/cjs/ch-modal.cjs.entry.js +4 -3
- package/dist/cjs/ch-modal.cjs.entry.js.map +1 -1
- package/dist/cjs/ch-page-header.cjs.entry.js +45 -0
- package/dist/cjs/ch-page-header.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-radio.cjs.entry.js +9 -11
- package/dist/cjs/ch-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/ch-segmented-control.cjs.entry.js +8 -7
- package/dist/cjs/ch-segmented-control.cjs.entry.js.map +1 -1
- package/dist/cjs/ch-skeleton.cjs.entry.js +58 -0
- package/dist/cjs/ch-skeleton.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-stack.cjs.entry.js +37 -0
- package/dist/cjs/ch-stack.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-tabs.cjs.entry.js +2 -2
- package/dist/cjs/ch-textarea.cjs.entry.js +9 -11
- package/dist/cjs/ch-textarea.cjs.entry.js.map +1 -1
- package/dist/cjs/ch-tooltip.cjs.entry.js +204 -5
- package/dist/cjs/ch-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/chucao.cjs.js +3 -3
- package/dist/cjs/chucao.cjs.js.map +1 -1
- package/dist/cjs/icons-CNyDgV-q.js +88 -0
- package/dist/cjs/icons-CNyDgV-q.js.map +1 -0
- package/dist/cjs/{index-C9cpLteP.js → index-ByZY6aTj.js} +119 -16
- package/dist/cjs/index-ByZY6aTj.js.map +1 -0
- package/dist/cjs/index.cjs.js +16 -0
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/validation-message-bbtJ2sa_.js +26 -0
- package/dist/cjs/validation-message-bbtJ2sa_.js.map +1 -0
- package/dist/collection/collection-manifest.json +9 -1
- package/dist/collection/components/ch-alert/ch-alert.css +13 -0
- package/dist/collection/components/ch-alert/ch-alert.js +44 -1
- package/dist/collection/components/ch-alert/ch-alert.js.map +1 -1
- package/dist/collection/components/ch-badge/ch-badge.css +30 -1
- package/dist/collection/components/ch-badge/ch-badge.js +35 -1
- package/dist/collection/components/ch-badge/ch-badge.js.map +1 -1
- package/dist/collection/components/ch-button/ch-button.js +9 -2
- package/dist/collection/components/ch-button/ch-button.js.map +1 -1
- package/dist/collection/components/ch-card/ch-card.js +1 -1
- package/dist/collection/components/ch-checkbox/ch-checkbox.js +8 -10
- package/dist/collection/components/ch-checkbox/ch-checkbox.js.map +1 -1
- package/dist/collection/components/ch-cluster/ch-cluster.css +93 -0
- package/dist/collection/components/ch-cluster/ch-cluster.js +152 -0
- package/dist/collection/components/ch-cluster/ch-cluster.js.map +1 -0
- package/dist/collection/components/ch-divider/ch-divider.js +1 -1
- package/dist/collection/components/ch-drawer/ch-drawer.js +9 -3
- package/dist/collection/components/ch-drawer/ch-drawer.js.map +1 -1
- package/dist/collection/components/ch-emoji/ch-emoji.js +1 -1
- package/dist/collection/components/ch-empty-state/ch-empty-state.css +67 -0
- package/dist/collection/components/ch-empty-state/ch-empty-state.js +108 -0
- package/dist/collection/components/ch-empty-state/ch-empty-state.js.map +1 -0
- package/dist/collection/components/ch-grid/ch-grid.css +47 -0
- package/dist/collection/components/ch-grid/ch-grid.js +137 -0
- package/dist/collection/components/ch-grid/ch-grid.js.map +1 -0
- package/dist/collection/components/ch-icon/ch-icon.css +25 -0
- package/dist/collection/components/ch-icon/ch-icon.js +121 -0
- package/dist/collection/components/ch-icon/ch-icon.js.map +1 -0
- package/dist/collection/components/ch-icon-button/ch-icon-button.css +99 -0
- package/dist/collection/components/ch-icon-button/ch-icon-button.js +216 -0
- package/dist/collection/components/ch-icon-button/ch-icon-button.js.map +1 -0
- package/dist/collection/components/ch-input/ch-input.js +8 -10
- package/dist/collection/components/ch-input/ch-input.js.map +1 -1
- package/dist/collection/components/ch-modal/ch-modal.js +9 -3
- package/dist/collection/components/ch-modal/ch-modal.js.map +1 -1
- package/dist/collection/components/ch-page-header/ch-page-header.css +84 -0
- package/dist/collection/components/ch-page-header/ch-page-header.js +162 -0
- package/dist/collection/components/ch-page-header/ch-page-header.js.map +1 -0
- package/dist/collection/components/ch-radio/ch-radio.js +8 -10
- package/dist/collection/components/ch-radio/ch-radio.js.map +1 -1
- package/dist/collection/components/ch-segmented-control/ch-segmented-control.js +7 -6
- package/dist/collection/components/ch-segmented-control/ch-segmented-control.js.map +1 -1
- package/dist/collection/components/ch-select/ch-select.js +8 -10
- package/dist/collection/components/ch-select/ch-select.js.map +1 -1
- package/dist/collection/components/ch-skeleton/ch-skeleton.css +50 -0
- package/dist/collection/components/ch-skeleton/ch-skeleton.js +175 -0
- package/dist/collection/components/ch-skeleton/ch-skeleton.js.map +1 -0
- package/dist/collection/components/ch-spinner/ch-spinner.js +1 -1
- package/dist/collection/components/ch-stack/ch-stack.css +83 -0
- package/dist/collection/components/ch-stack/ch-stack.js +124 -0
- package/dist/collection/components/ch-stack/ch-stack.js.map +1 -0
- package/dist/collection/components/ch-switch/ch-switch.js +8 -10
- package/dist/collection/components/ch-switch/ch-switch.js.map +1 -1
- package/dist/collection/components/ch-tabs/ch-tabs.js +1 -1
- package/dist/collection/components/ch-textarea/ch-textarea.js +8 -10
- package/dist/collection/components/ch-textarea/ch-textarea.js.map +1 -1
- package/dist/collection/components/ch-tooltip/ch-tooltip.css +29 -1
- package/dist/collection/components/ch-tooltip/ch-tooltip.js +125 -6
- package/dist/collection/components/ch-tooltip/ch-tooltip.js.map +1 -1
- package/dist/collection/tokens/tokens.js +12 -0
- package/dist/collection/tokens/tokens.js.map +1 -1
- package/dist/collection/tokens/types.js.map +1 -1
- package/dist/collection/utils/accessibility.js +24 -0
- package/dist/collection/utils/accessibility.js.map +1 -0
- package/dist/collection/utils/icons.js +82 -0
- package/dist/collection/utils/icons.js.map +1 -0
- package/dist/collection/utils/overlay.js +101 -0
- package/dist/collection/utils/overlay.js.map +1 -0
- package/dist/collection/utils/validation-message.js +20 -0
- package/dist/collection/utils/validation-message.js.map +1 -0
- package/dist/components/ch-accordion.js +1 -1
- package/dist/components/ch-alert.js +1 -1
- package/dist/components/ch-alert.js.map +1 -1
- package/dist/components/ch-badge.js +1 -1
- package/dist/components/ch-badge.js.map +1 -1
- package/dist/components/ch-button.js +1 -1
- package/dist/components/ch-button.js.map +1 -1
- package/dist/components/ch-card.js +1 -1
- package/dist/components/ch-checkbox.js +1 -1
- package/dist/components/ch-checkbox.js.map +1 -1
- package/dist/components/ch-cluster.d.ts +11 -0
- package/dist/components/ch-cluster.js +2 -0
- package/dist/components/ch-cluster.js.map +1 -0
- package/dist/components/ch-divider.js +1 -1
- package/dist/components/ch-drawer.js +1 -1
- package/dist/components/ch-drawer.js.map +1 -1
- package/dist/components/ch-emoji.js +1 -1
- package/dist/components/ch-empty-state.d.ts +11 -0
- package/dist/components/ch-empty-state.js +2 -0
- package/dist/components/ch-empty-state.js.map +1 -0
- package/dist/components/ch-grid.d.ts +11 -0
- package/dist/components/ch-grid.js +2 -0
- package/dist/components/ch-grid.js.map +1 -0
- package/dist/components/ch-icon-button.d.ts +11 -0
- package/dist/components/ch-icon-button.js +2 -0
- package/dist/components/ch-icon-button.js.map +1 -0
- package/dist/components/ch-icon.d.ts +11 -0
- package/dist/components/ch-icon.js +2 -0
- package/dist/components/ch-icon.js.map +1 -0
- package/dist/components/ch-input.js +1 -1
- package/dist/components/ch-input.js.map +1 -1
- package/dist/components/ch-link.js +1 -1
- package/dist/components/ch-modal.js +1 -1
- package/dist/components/ch-modal.js.map +1 -1
- package/dist/components/ch-page-header.d.ts +11 -0
- package/dist/components/ch-page-header.js +2 -0
- package/dist/components/ch-page-header.js.map +1 -0
- package/dist/components/ch-radio.js +1 -1
- package/dist/components/ch-radio.js.map +1 -1
- package/dist/components/ch-segmented-control.js +1 -1
- package/dist/components/ch-segmented-control.js.map +1 -1
- package/dist/components/ch-select.js +1 -1
- package/dist/components/ch-select.js.map +1 -1
- package/dist/components/ch-skeleton.d.ts +11 -0
- package/dist/components/ch-skeleton.js +2 -0
- package/dist/components/ch-skeleton.js.map +1 -0
- package/dist/components/ch-spinner.js +1 -1
- package/dist/components/ch-stack.d.ts +11 -0
- package/dist/components/ch-stack.js +2 -0
- package/dist/components/ch-stack.js.map +1 -0
- package/dist/components/ch-switch.js +1 -1
- package/dist/components/ch-switch.js.map +1 -1
- package/dist/components/ch-tabs.js +1 -1
- package/dist/components/ch-textarea.js +1 -1
- package/dist/components/ch-textarea.js.map +1 -1
- package/dist/components/ch-tooltip.js +1 -1
- package/dist/components/ch-tooltip.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/p-BXzZsX2r.js +2 -0
- package/dist/components/p-BXzZsX2r.js.map +1 -0
- package/dist/components/{p-C1995t1C.js → p-CV0rD-fF.js} +2 -2
- package/dist/components/p-CnivhwvG.js +2 -0
- package/dist/components/p-CnivhwvG.js.map +1 -0
- package/dist/components/p-qP_9qshx.js +2 -0
- package/dist/components/p-qP_9qshx.js.map +1 -0
- package/dist/esm/ch-accordion.entry.js +1 -1
- package/dist/esm/ch-alert_8.entry.js +69 -38
- package/dist/esm/ch-alert_8.entry.js.map +1 -1
- package/dist/esm/ch-checkbox.entry.js +9 -11
- package/dist/esm/ch-checkbox.entry.js.map +1 -1
- package/dist/esm/ch-cluster.entry.js +45 -0
- package/dist/esm/ch-cluster.entry.js.map +1 -0
- package/dist/esm/ch-divider.entry.js +2 -2
- package/dist/esm/ch-drawer.entry.js +4 -3
- package/dist/esm/ch-drawer.entry.js.map +1 -1
- package/dist/esm/ch-emoji.entry.js +2 -2
- package/dist/esm/ch-empty-state.entry.js +32 -0
- package/dist/esm/ch-empty-state.entry.js.map +1 -0
- package/dist/esm/ch-grid.entry.js +57 -0
- package/dist/esm/ch-grid.entry.js.map +1 -0
- package/dist/esm/ch-icon-button.entry.js +49 -0
- package/dist/esm/ch-icon-button.entry.js.map +1 -0
- package/dist/esm/ch-icon.entry.js +36 -0
- package/dist/esm/ch-icon.entry.js.map +1 -0
- package/dist/esm/ch-link.entry.js +1 -1
- package/dist/esm/ch-modal.entry.js +4 -3
- package/dist/esm/ch-modal.entry.js.map +1 -1
- package/dist/esm/ch-page-header.entry.js +43 -0
- package/dist/esm/ch-page-header.entry.js.map +1 -0
- package/dist/esm/ch-radio.entry.js +9 -11
- package/dist/esm/ch-radio.entry.js.map +1 -1
- package/dist/esm/ch-segmented-control.entry.js +8 -7
- package/dist/esm/ch-segmented-control.entry.js.map +1 -1
- package/dist/esm/ch-skeleton.entry.js +56 -0
- package/dist/esm/ch-skeleton.entry.js.map +1 -0
- package/dist/esm/ch-stack.entry.js +35 -0
- package/dist/esm/ch-stack.entry.js.map +1 -0
- package/dist/esm/ch-tabs.entry.js +2 -2
- package/dist/esm/ch-textarea.entry.js +9 -11
- package/dist/esm/ch-textarea.entry.js.map +1 -1
- package/dist/esm/ch-tooltip.entry.js +204 -5
- package/dist/esm/ch-tooltip.entry.js.map +1 -1
- package/dist/esm/chucao.js +4 -4
- package/dist/esm/chucao.js.map +1 -1
- package/dist/esm/icons-CnivhwvG.js +86 -0
- package/dist/esm/icons-CnivhwvG.js.map +1 -0
- package/dist/esm/{index-DWC12BJ-.js → index-CIV5Gg1o.js} +119 -17
- package/dist/esm/index-CIV5Gg1o.js.map +1 -0
- package/dist/esm/index.js +13 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/validation-message-BXzZsX2r.js +24 -0
- package/dist/esm/validation-message-BXzZsX2r.js.map +1 -0
- package/dist/types/components/ch-alert/ch-alert.d.ts +11 -0
- package/dist/types/components/ch-badge/ch-badge.d.ts +14 -0
- package/dist/types/components/ch-button/ch-button.d.ts +3 -1
- package/dist/types/components/ch-cluster/ch-cluster.d.ts +28 -0
- package/dist/types/components/ch-drawer/ch-drawer.d.ts +2 -1
- package/dist/types/components/ch-empty-state/ch-empty-state.d.ts +25 -0
- package/dist/types/components/ch-grid/ch-grid.d.ts +38 -0
- package/dist/types/components/ch-icon/ch-icon.d.ts +29 -0
- package/dist/types/components/ch-icon-button/ch-icon-button.d.ts +36 -0
- package/dist/types/components/ch-modal/ch-modal.d.ts +2 -1
- package/dist/types/components/ch-page-header/ch-page-header.d.ts +39 -0
- package/dist/types/components/ch-skeleton/ch-skeleton.d.ts +39 -0
- package/dist/types/components/ch-stack/ch-stack.d.ts +26 -0
- package/dist/types/components/ch-tooltip/ch-tooltip.d.ts +32 -2
- package/dist/types/components.d.ts +807 -8
- package/dist/types/stencil-public-runtime.d.ts +61 -55
- package/dist/types/tokens/tokens.d.ts +12 -0
- package/dist/types/tokens/types.d.ts +2 -1
- package/dist/types/utils/accessibility.d.ts +2 -0
- package/dist/types/utils/icons.d.ts +15 -0
- package/dist/types/utils/overlay.d.ts +49 -0
- package/dist/types/utils/validation-message.d.ts +20 -0
- package/dist-react/components.d.ts +27 -1
- package/dist-react/components.js +72 -0
- package/dist-react/components.ts +97 -1
- package/dist-vue/index.d.ts +8 -0
- package/dist-vue/index.js +62 -1
- package/dist-vue/index.ts +78 -1
- package/hydrate/index.js +1114 -132
- package/hydrate/index.mjs +1114 -132
- package/package.json +112 -5
- package/dist/chucao/p-37e7f9cc.entry.js +0 -2
- package/dist/chucao/p-37e7f9cc.entry.js.map +0 -1
- package/dist/chucao/p-3db38c49.entry.js +0 -2
- package/dist/chucao/p-3db38c49.entry.js.map +0 -1
- package/dist/chucao/p-60c2fd71.entry.js +0 -2
- package/dist/chucao/p-60c2fd71.entry.js.map +0 -1
- package/dist/chucao/p-6c617158.entry.js +0 -2
- package/dist/chucao/p-6c617158.entry.js.map +0 -1
- package/dist/chucao/p-DWC12BJ-.js +0 -3
- package/dist/chucao/p-DWC12BJ-.js.map +0 -1
- package/dist/chucao/p-aeea9cbe.entry.js +0 -2
- package/dist/chucao/p-aeea9cbe.entry.js.map +0 -1
- package/dist/chucao/p-bb2445d1.entry.js +0 -2
- package/dist/chucao/p-c4806e96.entry.js +0 -2
- package/dist/chucao/p-c4806e96.entry.js.map +0 -1
- package/dist/chucao/p-e3265e38.entry.js +0 -2
- package/dist/chucao/p-e3265e38.entry.js.map +0 -1
- package/dist/chucao/p-f78f0163.entry.js +0 -2
- package/dist/chucao/p-f78f0163.entry.js.map +0 -1
- package/dist/cjs/index-C9cpLteP.js.map +0 -1
- package/dist/components/p-BhAZrOxf.js +0 -2
- package/dist/components/p-BhAZrOxf.js.map +0 -1
- package/dist/esm/index-DWC12BJ-.js.map +0 -1
- /package/dist/chucao/{p-ff5f5c1f.entry.js.map → p-1108062e.entry.js.map} +0 -0
- /package/dist/chucao/{p-04dbcfa0.entry.js.map → p-337d7f68.entry.js.map} +0 -0
- /package/dist/chucao/{p-bb2445d1.entry.js.map → p-4846cac4.entry.js.map} +0 -0
- /package/dist/chucao/{p-6a4bc80c.entry.js.map → p-9f73855e.entry.js.map} +0 -0
- /package/dist/chucao/{p-c986036f.entry.js.map → p-b6cc08f0.entry.js.map} +0 -0
- /package/dist/components/{p-C1995t1C.js.map → p-CV0rD-fF.js.map} +0 -0
package/hydrate/index.js
CHANGED
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
var stream = require('stream');
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const modeResolver = [];
|
|
6
|
+
|
|
7
|
+
// captured here, at true module scope, before hydrateFactory shadows the
|
|
8
|
+
// AbortController identifier for component code below.
|
|
9
|
+
var $stencilNativeAbortController = AbortController;
|
|
6
10
|
|
|
7
11
|
function hydrateFactory($stencilWindow, $stencilHydrateOpts, $stencilHydrateResults, $stencilAfterHydrate, $stencilHydrateResolve) {
|
|
8
12
|
var globalThis = $stencilWindow;
|
|
@@ -95,8 +99,46 @@ function hydrateFactory($stencilWindow, $stencilHydrateOpts, $stencilHydrateResu
|
|
|
95
99
|
|
|
96
100
|
var fetch, FetchError, Headers, Request, Response;
|
|
97
101
|
|
|
102
|
+
// Aborted when the render times out or errors, so in-flight fetch() calls
|
|
103
|
+
// made by component code stop holding the render's window/results alive
|
|
104
|
+
// instead of running to completion against a torn-down window. See #6864.
|
|
105
|
+
var $stencilAbortController = new $stencilNativeAbortController();
|
|
106
|
+
|
|
107
|
+
// Any AbortController a component creates itself is transparently wired to
|
|
108
|
+
// cascade-abort when the render times out too, so component code using the
|
|
109
|
+
// standard AbortController convention for its own cancellable work (axios,
|
|
110
|
+
// aws-sdk v3, the mongodb driver, etc.) gets cancelled automatically.
|
|
111
|
+
var AbortController = function () {
|
|
112
|
+
var controller = new $stencilNativeAbortController();
|
|
113
|
+
$stencilAbortController.signal.addEventListener(
|
|
114
|
+
'abort',
|
|
115
|
+
function () {
|
|
116
|
+
controller.abort();
|
|
117
|
+
},
|
|
118
|
+
{ once: true },
|
|
119
|
+
);
|
|
120
|
+
return controller;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
function $stencilFetchSignal(callerSignal) {
|
|
124
|
+
if (!callerSignal) {
|
|
125
|
+
return $stencilAbortController.signal;
|
|
126
|
+
}
|
|
127
|
+
if (callerSignal.aborted || $stencilAbortController.signal.aborted) {
|
|
128
|
+
return callerSignal.aborted ? callerSignal : $stencilAbortController.signal;
|
|
129
|
+
}
|
|
130
|
+
var merged = new $stencilNativeAbortController();
|
|
131
|
+
var onAbort = function () { merged.abort(); };
|
|
132
|
+
callerSignal.addEventListener('abort', onAbort, { once: true });
|
|
133
|
+
$stencilAbortController.signal.addEventListener('abort', onAbort, { once: true });
|
|
134
|
+
return merged.signal;
|
|
135
|
+
}
|
|
136
|
+
|
|
98
137
|
if (typeof $stencilWindow.fetch === 'function') {
|
|
99
|
-
|
|
138
|
+
var $stencilRawFetch = $stencilWindow.fetch;
|
|
139
|
+
fetch = $stencilWindow.fetch = function(input, init) {
|
|
140
|
+
return $stencilRawFetch(input, Object.assign({}, init, { signal: $stencilFetchSignal(init && init.signal) }));
|
|
141
|
+
};
|
|
100
142
|
} else {
|
|
101
143
|
fetch = $stencilWindow.fetch = function() { throw new Error('fetch() is not implemented'); };
|
|
102
144
|
}
|
|
@@ -135,7 +177,7 @@ const NAMESPACE = 'chucao';
|
|
|
135
177
|
const BUILD = /* chucao */ { hotModuleReplacement: false, slotRelocation: true, state: true, updatable: true};
|
|
136
178
|
|
|
137
179
|
/*
|
|
138
|
-
Stencil Hydrate Platform v4.
|
|
180
|
+
Stencil Hydrate Platform v4.45.1 | MIT Licensed | https://stenciljs.com
|
|
139
181
|
*/
|
|
140
182
|
var __create = Object.create;
|
|
141
183
|
var __defProp = Object.defineProperty;
|
|
@@ -383,6 +425,10 @@ var require_brace_expansion = __commonJS({
|
|
|
383
425
|
}
|
|
384
426
|
}
|
|
385
427
|
});
|
|
428
|
+
|
|
429
|
+
// src/utils/constants.ts
|
|
430
|
+
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
431
|
+
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
386
432
|
var PrimitiveType = /* @__PURE__ */ ((PrimitiveType2) => {
|
|
387
433
|
PrimitiveType2["Undefined"] = "undefined";
|
|
388
434
|
PrimitiveType2["Null"] = "null";
|
|
@@ -799,6 +845,13 @@ var h = (nodeName, vnodeData, ...children) => {
|
|
|
799
845
|
}
|
|
800
846
|
}
|
|
801
847
|
}
|
|
848
|
+
if (typeof nodeName === "function") {
|
|
849
|
+
return nodeName(
|
|
850
|
+
vnodeData === null ? {} : vnodeData,
|
|
851
|
+
vNodeChildren,
|
|
852
|
+
vdomFnUtils
|
|
853
|
+
);
|
|
854
|
+
}
|
|
802
855
|
const vnode = newVNode(nodeName, null);
|
|
803
856
|
vnode.$attrs$ = vnodeData;
|
|
804
857
|
if (vNodeChildren.length > 0) {
|
|
@@ -834,6 +887,36 @@ var newVNode = (tag, text) => {
|
|
|
834
887
|
};
|
|
835
888
|
var Host = {};
|
|
836
889
|
var isHost = (node) => node && node.$tag$ === Host;
|
|
890
|
+
var vdomFnUtils = {
|
|
891
|
+
forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
|
|
892
|
+
map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate)
|
|
893
|
+
};
|
|
894
|
+
var convertToPublic = (node) => ({
|
|
895
|
+
vattrs: node.$attrs$,
|
|
896
|
+
vchildren: node.$children$,
|
|
897
|
+
vkey: node.$key$,
|
|
898
|
+
vname: node.$name$,
|
|
899
|
+
vtag: node.$tag$,
|
|
900
|
+
vtext: node.$text$
|
|
901
|
+
});
|
|
902
|
+
var convertToPrivate = (node) => {
|
|
903
|
+
if (typeof node.vtag === "function") {
|
|
904
|
+
const vnodeData = { ...node.vattrs };
|
|
905
|
+
if (node.vkey) {
|
|
906
|
+
vnodeData.key = node.vkey;
|
|
907
|
+
}
|
|
908
|
+
if (node.vname) {
|
|
909
|
+
vnodeData.name = node.vname;
|
|
910
|
+
}
|
|
911
|
+
return h(node.vtag, vnodeData, ...node.vchildren || []);
|
|
912
|
+
}
|
|
913
|
+
const vnode = newVNode(node.vtag, node.vtext);
|
|
914
|
+
vnode.$attrs$ = node.vattrs;
|
|
915
|
+
vnode.$children$ = node.vchildren;
|
|
916
|
+
vnode.$key$ = node.vkey;
|
|
917
|
+
vnode.$name$ = node.vname;
|
|
918
|
+
return vnode;
|
|
919
|
+
};
|
|
837
920
|
|
|
838
921
|
// src/runtime/client-hydrate.ts
|
|
839
922
|
var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
@@ -1527,13 +1610,14 @@ var scopeSelector = (selector, scopeSelectorText, hostSelector, slotSelector) =>
|
|
|
1527
1610
|
}
|
|
1528
1611
|
}).join(", ");
|
|
1529
1612
|
};
|
|
1613
|
+
var isScopableAtRule = (selector) => selector.startsWith("@media") || selector.startsWith("@supports") || selector.startsWith("@page") || selector.startsWith("@document") || selector.startsWith("@layer");
|
|
1530
1614
|
var scopeSelectors = (cssText, scopeSelectorText, hostSelector, slotSelector, commentOriginalSelector) => {
|
|
1531
1615
|
return processRules(cssText, (rule) => {
|
|
1532
1616
|
let selector = rule.selector;
|
|
1533
1617
|
let content = rule.content;
|
|
1534
1618
|
if (rule.selector[0] !== "@") {
|
|
1535
1619
|
selector = scopeSelector(rule.selector, scopeSelectorText, hostSelector, slotSelector);
|
|
1536
|
-
} else if (
|
|
1620
|
+
} else if (isScopableAtRule(rule.selector)) {
|
|
1537
1621
|
content = scopeSelectors(rule.content, scopeSelectorText, hostSelector, slotSelector);
|
|
1538
1622
|
}
|
|
1539
1623
|
const cssRule = {
|
|
@@ -1612,15 +1696,16 @@ var scopeCss = (cssText, scopeId2, commentOriginalSelector) => {
|
|
|
1612
1696
|
rule.selector = placeholder + rule.selector;
|
|
1613
1697
|
return rule;
|
|
1614
1698
|
};
|
|
1615
|
-
|
|
1699
|
+
const commentSelectors = (input) => processRules(input, (rule) => {
|
|
1616
1700
|
if (rule.selector[0] !== "@") {
|
|
1617
1701
|
return processCommentedSelector(rule);
|
|
1618
|
-
}
|
|
1619
|
-
|
|
1620
|
-
|
|
1702
|
+
}
|
|
1703
|
+
if (isScopableAtRule(rule.selector)) {
|
|
1704
|
+
rule.content = commentSelectors(rule.content);
|
|
1621
1705
|
}
|
|
1622
1706
|
return rule;
|
|
1623
1707
|
});
|
|
1708
|
+
cssText = commentSelectors(cssText);
|
|
1624
1709
|
}
|
|
1625
1710
|
const scoped = scopeCssText(cssText, scopeId2, hostScopeId, slotScopeId);
|
|
1626
1711
|
cssText = [scoped.cssText, ...commentsWithHash].join("\n");
|
|
@@ -1636,6 +1721,8 @@ var scopeCss = (cssText, scopeId2, commentOriginalSelector) => {
|
|
|
1636
1721
|
cssText = expandPartSelectors(cssText);
|
|
1637
1722
|
return cssText;
|
|
1638
1723
|
};
|
|
1724
|
+
var setMode = (handler) => {
|
|
1725
|
+
};
|
|
1639
1726
|
|
|
1640
1727
|
// src/runtime/normalize-watchers.ts
|
|
1641
1728
|
var normalizeWatchers = (raw) => {
|
|
@@ -1843,6 +1930,23 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
|
|
|
1843
1930
|
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
1844
1931
|
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
1845
1932
|
}
|
|
1933
|
+
} else if (memberName === "style") {
|
|
1934
|
+
{
|
|
1935
|
+
for (const prop in oldValue) {
|
|
1936
|
+
if (!newValue || newValue[prop] == null) {
|
|
1937
|
+
{
|
|
1938
|
+
elm.style[prop] = "";
|
|
1939
|
+
}
|
|
1940
|
+
}
|
|
1941
|
+
}
|
|
1942
|
+
}
|
|
1943
|
+
for (const prop in newValue) {
|
|
1944
|
+
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
1945
|
+
{
|
|
1946
|
+
elm.style[prop] = newValue[prop];
|
|
1947
|
+
}
|
|
1948
|
+
}
|
|
1949
|
+
}
|
|
1846
1950
|
} else if (memberName === "key") ; else if (memberName === "ref") {
|
|
1847
1951
|
if (newValue) {
|
|
1848
1952
|
queueRefAttachment(newValue, elm);
|
|
@@ -2027,12 +2131,19 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
2027
2131
|
updateElement(null, newVNode2, isSvgMode);
|
|
2028
2132
|
}
|
|
2029
2133
|
} else {
|
|
2134
|
+
if (!isSvgMode) {
|
|
2135
|
+
isSvgMode = newVNode2.$tag$ === "svg";
|
|
2136
|
+
}
|
|
2030
2137
|
if (!win.document) {
|
|
2031
2138
|
throw new Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");
|
|
2032
2139
|
}
|
|
2033
|
-
elm = newVNode2.$elm$ = win.document.
|
|
2140
|
+
elm = newVNode2.$elm$ = win.document.createElementNS(
|
|
2141
|
+
isSvgMode ? SVG_NS : HTML_NS,
|
|
2034
2142
|
!useNativeShadowDom && BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
2035
|
-
);
|
|
2143
|
+
) ;
|
|
2144
|
+
if (isSvgMode && newVNode2.$tag$ === "foreignObject") {
|
|
2145
|
+
isSvgMode = false;
|
|
2146
|
+
}
|
|
2036
2147
|
{
|
|
2037
2148
|
updateElement(null, newVNode2, isSvgMode);
|
|
2038
2149
|
}
|
|
@@ -2048,6 +2159,13 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
2048
2159
|
}
|
|
2049
2160
|
}
|
|
2050
2161
|
}
|
|
2162
|
+
{
|
|
2163
|
+
if (newVNode2.$tag$ === "svg") {
|
|
2164
|
+
isSvgMode = false;
|
|
2165
|
+
} else if (elm.tagName === "foreignObject") {
|
|
2166
|
+
isSvgMode = true;
|
|
2167
|
+
}
|
|
2168
|
+
}
|
|
2051
2169
|
}
|
|
2052
2170
|
elm["s-hn"] = hostTagName;
|
|
2053
2171
|
{
|
|
@@ -2213,7 +2331,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
2213
2331
|
if (idxInOld >= 0) {
|
|
2214
2332
|
elmToMove = oldCh[idxInOld];
|
|
2215
2333
|
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
|
2216
|
-
node = createElm(oldCh && oldCh[newStartIdx], newVNode2,
|
|
2334
|
+
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);
|
|
2217
2335
|
} else {
|
|
2218
2336
|
patch(elmToMove, newStartVnode, isInitialRender);
|
|
2219
2337
|
oldCh[idxInOld] = void 0;
|
|
@@ -2272,6 +2390,9 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
2272
2390
|
const text = newVNode2.$text$;
|
|
2273
2391
|
let defaultHolder;
|
|
2274
2392
|
if (text == null) {
|
|
2393
|
+
{
|
|
2394
|
+
isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
|
|
2395
|
+
}
|
|
2275
2396
|
{
|
|
2276
2397
|
if (tag === "slot" && !useNativeShadowDom) {
|
|
2277
2398
|
if (oldVNode.$name$ !== newVNode2.$name$) {
|
|
@@ -2296,6 +2417,9 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
2296
2417
|
} else if (isInitialRender && BUILD.updatable && oldChildren !== null && newChildren === null) {
|
|
2297
2418
|
newVNode2.$children$ = oldChildren;
|
|
2298
2419
|
}
|
|
2420
|
+
if (isSvgMode && tag === "svg") {
|
|
2421
|
+
isSvgMode = false;
|
|
2422
|
+
}
|
|
2299
2423
|
} else if ((defaultHolder = elm["s-cr"])) {
|
|
2300
2424
|
defaultHolder.parentNode.textContent = text;
|
|
2301
2425
|
} else if (oldVNode.$text$ !== text) {
|
|
@@ -3076,6 +3200,9 @@ var getHostListenerTarget = (doc, elm, flags) => {
|
|
|
3076
3200
|
if (flags & 4 /* TargetDocument */) {
|
|
3077
3201
|
return doc;
|
|
3078
3202
|
}
|
|
3203
|
+
if (flags & 8 /* TargetWindow */) {
|
|
3204
|
+
return win;
|
|
3205
|
+
}
|
|
3079
3206
|
return elm;
|
|
3080
3207
|
};
|
|
3081
3208
|
var hostListenerOpts = (flags) => (flags & 2 /* Capture */) !== 0;
|
|
@@ -4951,7 +5078,7 @@ function forceUpdate2() {
|
|
|
4951
5078
|
}
|
|
4952
5079
|
|
|
4953
5080
|
// src/hydrate/platform/hydrate-app.ts
|
|
4954
|
-
function hydrateApp(win2, opts, results, afterHydrate, resolve) {
|
|
5081
|
+
function hydrateApp(win2, opts, results, afterHydrate, resolve, abortController) {
|
|
4955
5082
|
const connectedElements = /* @__PURE__ */ new Set();
|
|
4956
5083
|
const createdElements = /* @__PURE__ */ new Set();
|
|
4957
5084
|
const waitingElements = /* @__PURE__ */ new Set();
|
|
@@ -4961,6 +5088,13 @@ function hydrateApp(win2, opts, results, afterHydrate, resolve) {
|
|
|
4961
5088
|
setScopedSSR(opts);
|
|
4962
5089
|
let tmrId;
|
|
4963
5090
|
let ranCompleted = false;
|
|
5091
|
+
const abortedPromise = new Promise((res) => {
|
|
5092
|
+
if (abortController.signal.aborted) {
|
|
5093
|
+
res();
|
|
5094
|
+
} else {
|
|
5095
|
+
abortController.signal.addEventListener("abort", () => res(), { once: true });
|
|
5096
|
+
}
|
|
5097
|
+
});
|
|
4964
5098
|
function hydratedComplete() {
|
|
4965
5099
|
globalThis.clearTimeout(tmrId);
|
|
4966
5100
|
createdElements.clear();
|
|
@@ -4982,6 +5116,7 @@ function hydrateApp(win2, opts, results, afterHydrate, resolve) {
|
|
|
4982
5116
|
}
|
|
4983
5117
|
function hydratedError(err2) {
|
|
4984
5118
|
renderCatchError(opts, results, err2);
|
|
5119
|
+
abortController.abort();
|
|
4985
5120
|
hydratedComplete();
|
|
4986
5121
|
}
|
|
4987
5122
|
function timeoutExceeded() {
|
|
@@ -5027,7 +5162,7 @@ function hydrateApp(win2, opts, results, afterHydrate, resolve) {
|
|
|
5027
5162
|
if (isValidComponent(elm, opts) && results.hydratedCount < opts.maxHydrateCount) {
|
|
5028
5163
|
if (!connectedElements.has(elm) && shouldHydrate(elm)) {
|
|
5029
5164
|
connectedElements.add(elm);
|
|
5030
|
-
return hydrateComponent.call(elm, win2, results, elm.nodeName, elm, waitingElements);
|
|
5165
|
+
return hydrateComponent.call(elm, win2, results, elm.nodeName, elm, waitingElements, abortedPromise);
|
|
5031
5166
|
}
|
|
5032
5167
|
}
|
|
5033
5168
|
return resolved2;
|
|
@@ -5050,13 +5185,16 @@ function hydrateApp(win2, opts, results, afterHydrate, resolve) {
|
|
|
5050
5185
|
};
|
|
5051
5186
|
tmrId = globalThis.setTimeout(timeoutExceeded, opts.timeout);
|
|
5052
5187
|
plt.$resourcesUrl$ = new URL(opts.resourcesUrl || "./", win2.document.baseURI).href;
|
|
5188
|
+
if (Array.isArray(opts.modes)) {
|
|
5189
|
+
opts.modes.forEach((mode) => setMode());
|
|
5190
|
+
}
|
|
5053
5191
|
patchChild2(win2.document.body);
|
|
5054
5192
|
waitLoop2().then(hydratedComplete).catch(hydratedError);
|
|
5055
5193
|
} catch (e) {
|
|
5056
5194
|
hydratedError(e);
|
|
5057
5195
|
}
|
|
5058
5196
|
}
|
|
5059
|
-
async function hydrateComponent(win2, results, tagName, elm, waitingElements) {
|
|
5197
|
+
async function hydrateComponent(win2, results, tagName, elm, waitingElements, aborted) {
|
|
5060
5198
|
tagName = tagName.toLowerCase();
|
|
5061
5199
|
const Cstr = loadModule(
|
|
5062
5200
|
{
|
|
@@ -5072,17 +5210,19 @@ async function hydrateComponent(win2, results, tagName, elm, waitingElements) {
|
|
|
5072
5210
|
addHostEventListeners(this, hostRef, cmpMeta.$listeners$);
|
|
5073
5211
|
try {
|
|
5074
5212
|
connectedCallback(elm);
|
|
5075
|
-
await elm.componentOnReady();
|
|
5076
|
-
|
|
5077
|
-
|
|
5078
|
-
|
|
5079
|
-
|
|
5080
|
-
results.components.
|
|
5081
|
-
|
|
5082
|
-
|
|
5083
|
-
|
|
5084
|
-
|
|
5085
|
-
|
|
5213
|
+
const wasAborted = await Promise.race([elm.componentOnReady().then(() => false), aborted.then(() => true)]);
|
|
5214
|
+
if (!wasAborted) {
|
|
5215
|
+
results.hydratedCount++;
|
|
5216
|
+
const ref = getHostRef(elm);
|
|
5217
|
+
const modeName = !(ref == null ? void 0 : ref.$modeName$) ? "$" : ref == null ? void 0 : ref.$modeName$;
|
|
5218
|
+
if (!results.components.some((c) => c.tag === tagName && c.mode === modeName)) {
|
|
5219
|
+
results.components.push({
|
|
5220
|
+
tag: tagName,
|
|
5221
|
+
mode: modeName,
|
|
5222
|
+
count: 0,
|
|
5223
|
+
depth: -1
|
|
5224
|
+
});
|
|
5225
|
+
}
|
|
5086
5226
|
}
|
|
5087
5227
|
} catch (e) {
|
|
5088
5228
|
win2.console.error(e);
|
|
@@ -5379,8 +5519,100 @@ class ChAccordion {
|
|
|
5379
5519
|
}; }
|
|
5380
5520
|
}
|
|
5381
5521
|
|
|
5382
|
-
const
|
|
5522
|
+
const chIcons = {
|
|
5523
|
+
alert: [
|
|
5524
|
+
{ tag: 'path', attrs: { d: 'm21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3' } },
|
|
5525
|
+
{ tag: 'path', attrs: { d: 'M12 9v4' } },
|
|
5526
|
+
{ tag: 'path', attrs: { d: 'M12 17h.01' } },
|
|
5527
|
+
],
|
|
5528
|
+
arrowRight: [
|
|
5529
|
+
{ tag: 'path', attrs: { d: 'M5 12h14' } },
|
|
5530
|
+
{ tag: 'path', attrs: { d: 'm12 5 7 7-7 7' } },
|
|
5531
|
+
],
|
|
5532
|
+
check: [{ tag: 'path', attrs: { d: 'M20 6 9 17l-5-5' } }],
|
|
5533
|
+
chevronDown: [{ tag: 'path', attrs: { d: 'm6 9 6 6 6-6' } }],
|
|
5534
|
+
chevronRight: [{ tag: 'path', attrs: { d: 'm9 18 6-6-6-6' } }],
|
|
5535
|
+
close: [
|
|
5536
|
+
{ tag: 'path', attrs: { d: 'M18 6 6 18' } },
|
|
5537
|
+
{ tag: 'path', attrs: { d: 'm6 6 12 12' } },
|
|
5538
|
+
],
|
|
5539
|
+
copy: [
|
|
5540
|
+
{ tag: 'rect', attrs: { width: '14', height: '14', x: '8', y: '8', rx: '2', ry: '2' } },
|
|
5541
|
+
{ tag: 'path', attrs: { d: 'M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2' } },
|
|
5542
|
+
],
|
|
5543
|
+
delete: [
|
|
5544
|
+
{ tag: 'path', attrs: { d: 'M10 11v6' } },
|
|
5545
|
+
{ tag: 'path', attrs: { d: 'M14 11v6' } },
|
|
5546
|
+
{ tag: 'path', attrs: { d: 'M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6' } },
|
|
5547
|
+
{ tag: 'path', attrs: { d: 'M3 6h18' } },
|
|
5548
|
+
{ tag: 'path', attrs: { d: 'M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2' } },
|
|
5549
|
+
],
|
|
5550
|
+
download: [
|
|
5551
|
+
{ tag: 'path', attrs: { d: 'M12 15V3' } },
|
|
5552
|
+
{ tag: 'path', attrs: { d: 'M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4' } },
|
|
5553
|
+
{ tag: 'path', attrs: { d: 'm7 10 5 5 5-5' } },
|
|
5554
|
+
],
|
|
5555
|
+
error: [
|
|
5556
|
+
{ tag: 'circle', attrs: { cx: '12', cy: '12', r: '10' } },
|
|
5557
|
+
{ tag: 'line', attrs: {} },
|
|
5558
|
+
{ tag: 'line', attrs: {} },
|
|
5559
|
+
],
|
|
5560
|
+
externalLink: [
|
|
5561
|
+
{ tag: 'path', attrs: { d: 'M15 3h6v6' } },
|
|
5562
|
+
{ tag: 'path', attrs: { d: 'M10 14 21 3' } },
|
|
5563
|
+
{ tag: 'path', attrs: { d: 'M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6' } },
|
|
5564
|
+
],
|
|
5565
|
+
info: [
|
|
5566
|
+
{ tag: 'circle', attrs: { cx: '12', cy: '12', r: '10' } },
|
|
5567
|
+
{ tag: 'path', attrs: { d: 'M12 16v-4' } },
|
|
5568
|
+
{ tag: 'path', attrs: { d: 'M12 8h.01' } },
|
|
5569
|
+
],
|
|
5570
|
+
menu: [
|
|
5571
|
+
{ tag: 'path', attrs: { d: 'M4 5h16' } },
|
|
5572
|
+
{ tag: 'path', attrs: { d: 'M4 12h16' } },
|
|
5573
|
+
{ tag: 'path', attrs: { d: 'M4 19h16' } },
|
|
5574
|
+
],
|
|
5575
|
+
plus: [
|
|
5576
|
+
{ tag: 'path', attrs: { d: 'M5 12h14' } },
|
|
5577
|
+
{ tag: 'path', attrs: { d: 'M12 5v14' } },
|
|
5578
|
+
],
|
|
5579
|
+
search: [
|
|
5580
|
+
{ tag: 'path', attrs: { d: 'm21 21-4.34-4.34' } },
|
|
5581
|
+
{ tag: 'circle', attrs: { cx: '11', cy: '11', r: '8' } },
|
|
5582
|
+
],
|
|
5583
|
+
spinner: [
|
|
5584
|
+
{ tag: 'path', attrs: { d: 'M12 2v4' } },
|
|
5585
|
+
{ tag: 'path', attrs: { d: 'm16.2 7.8 2.9-2.9' } },
|
|
5586
|
+
{ tag: 'path', attrs: { d: 'M18 12h4' } },
|
|
5587
|
+
{ tag: 'path', attrs: { d: 'm16.2 16.2 2.9 2.9' } },
|
|
5588
|
+
{ tag: 'path', attrs: { d: 'M12 18v4' } },
|
|
5589
|
+
{ tag: 'path', attrs: { d: 'm4.9 19.1 2.9-2.9' } },
|
|
5590
|
+
{ tag: 'path', attrs: { d: 'M2 12h4' } },
|
|
5591
|
+
{ tag: 'path', attrs: { d: 'm4.9 4.9 2.9 2.9' } },
|
|
5592
|
+
],
|
|
5593
|
+
success: [
|
|
5594
|
+
{ tag: 'circle', attrs: { cx: '12', cy: '12', r: '10' } },
|
|
5595
|
+
{ tag: 'path', attrs: { d: 'm16 9-5.5 5.5L8 12' } },
|
|
5596
|
+
],
|
|
5597
|
+
upload: [
|
|
5598
|
+
{ tag: 'path', attrs: { d: 'M12 3v12' } },
|
|
5599
|
+
{ tag: 'path', attrs: { d: 'm17 8-5-5-5 5' } },
|
|
5600
|
+
{ tag: 'path', attrs: { d: 'M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4' } },
|
|
5601
|
+
],
|
|
5602
|
+
};
|
|
5603
|
+
|
|
5604
|
+
const chAlertCss = () => `:host{display:block}.alert{display:flex;align-items:flex-start;gap:var(--spacing-2xl);padding:var(--spacing-2xl) var(--spacing-3xl);border:var(--border-width) solid transparent;border-left:var(--border-accent-bar) solid transparent;border-radius:var(--radius);font-size:var(--typography-size-sm);line-height:1.5}.alert-icon{width:var(--icon-size-md);height:var(--icon-size-md);flex:none;margin-top:1px}.alert-content{flex:1;min-width:0;overflow-wrap:anywhere}.alert--default{color:var(--text);background:var(--surface);border-color:var(--border);border-left-color:var(--color-text-secondary)}.alert--positive{color:var(--color-status-positive);background:var(--color-status-positive-background);border-color:var(--color-status-positive);border-left-color:var(--color-status-positive)}.alert--warning{color:var(--color-status-warning);background:var(--color-status-warning-background);border-color:var(--color-status-warning);border-left-color:var(--color-status-warning)}.alert-dismiss{display:inline-flex;align-items:center;justify-content:center;flex:none;padding:var(--spacing-2xs) var(--spacing-md);border:0;border-radius:var(--radius);background:none;color:inherit;cursor:pointer;font-family:var(--font-heading);font-size:var(--typography-size-lg);line-height:1;transition:background-color var(--duration-normal) var(--easing-default)}.alert-dismiss:hover{background:var(--surface-hover)}.alert-dismiss:focus-visible{outline:var(--focus-outline-width) solid currentColor;outline-offset:var(--focus-outline-offset)}@media (pointer: coarse){.alert-dismiss{min-width:44px;min-height:44px}}@media (prefers-reduced-motion: reduce){.alert-dismiss{transition:none}}`;
|
|
5383
5605
|
|
|
5606
|
+
/**
|
|
5607
|
+
* The glyph paired with each variant. It is what makes the variants
|
|
5608
|
+
* distinguishable without colour: `default` is informational, `positive`
|
|
5609
|
+
* confirms and `warning` warns, and each reads differently in grayscale.
|
|
5610
|
+
*/
|
|
5611
|
+
const VARIANT_ICON = {
|
|
5612
|
+
default: 'info',
|
|
5613
|
+
positive: 'success',
|
|
5614
|
+
warning: 'alert',
|
|
5615
|
+
};
|
|
5384
5616
|
/**
|
|
5385
5617
|
* Block-level status message.
|
|
5386
5618
|
*
|
|
@@ -5389,6 +5621,11 @@ const chAlertCss = () => `:host{display:block}.alert{display:flex;align-items:fl
|
|
|
5389
5621
|
* interrupt. Both announce reliably when the alert is added to the page in
|
|
5390
5622
|
* response to something — an alert already present at load may not be read out,
|
|
5391
5623
|
* which is how live regions work rather than something this component controls.
|
|
5624
|
+
*
|
|
5625
|
+
* Every variant also carries an icon and a thicker leading edge, so the three
|
|
5626
|
+
* states stay distinguishable without colour vision. The icon is decorative:
|
|
5627
|
+
* the text next to it already says what happened, and announcing "check
|
|
5628
|
+
* circle" before it would only add noise.
|
|
5392
5629
|
*/
|
|
5393
5630
|
class ChAlert {
|
|
5394
5631
|
constructor(hostRef) {
|
|
@@ -5407,6 +5644,12 @@ class ChAlert {
|
|
|
5407
5644
|
* so without a label it would have no accessible name at all.
|
|
5408
5645
|
*/
|
|
5409
5646
|
dismissLabel;
|
|
5647
|
+
/**
|
|
5648
|
+
* Whether to show the variant's icon. On by default so the status is not
|
|
5649
|
+
* colour-only; turn it off when the surrounding copy already carries the cue
|
|
5650
|
+
* and a second marker would be redundant.
|
|
5651
|
+
*/
|
|
5652
|
+
statusCue = true;
|
|
5410
5653
|
/**
|
|
5411
5654
|
* Emitted when the dismiss button is clicked. The alert stays in the DOM —
|
|
5412
5655
|
* whether to remove it is the consumer's decision. If you do remove it, move
|
|
@@ -5419,7 +5662,8 @@ class ChAlert {
|
|
|
5419
5662
|
};
|
|
5420
5663
|
render() {
|
|
5421
5664
|
const role = this.variant === 'warning' ? 'alert' : 'status';
|
|
5422
|
-
|
|
5665
|
+
const shapes = this.statusCue ? chIcons[VARIANT_ICON[this.variant]] : undefined;
|
|
5666
|
+
return (hAsync(Host, { key: '5a14801af29be0634bd35cf8706446a3a5d33286' }, hAsync("div", { key: role, class: { alert: true, [`alert--${this.variant}`]: true }, role: role }, shapes && (hAsync("svg", { key: 'dbaf65b9d7dc08e2ba51b60b273a16ae42eacb02', 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: 'ad1c508dea9e3f9e718ec8104f8236065f3eb0e8', class: "alert-content" }, hAsync("slot", { key: '6f906d355fa416b674994716a3ca896ae517f492' })), this.dismissLabel && (hAsync("button", { key: '165af98fa093bda95c785e86c078b69aee2c0580', class: "alert-dismiss", type: "button", "aria-label": this.dismissLabel, onClick: this.handleDismiss }, hAsync("span", { key: '0a05eff2d077559dc267bd72898299c5d42eaf8a', "aria-hidden": "true" }, "\u00D7"))))));
|
|
5423
5667
|
}
|
|
5424
5668
|
static get style() { return chAlertCss(); }
|
|
5425
5669
|
static get cmpMeta() { return {
|
|
@@ -5427,7 +5671,8 @@ class ChAlert {
|
|
|
5427
5671
|
"$tagName$": "ch-alert",
|
|
5428
5672
|
"$members$": {
|
|
5429
5673
|
"variant": [1],
|
|
5430
|
-
"dismissLabel": [1, "dismiss-label"]
|
|
5674
|
+
"dismissLabel": [1, "dismiss-label"],
|
|
5675
|
+
"statusCue": [4, "status-cue"]
|
|
5431
5676
|
},
|
|
5432
5677
|
"$listeners$": undefined,
|
|
5433
5678
|
"$lazyBundleId$": "-",
|
|
@@ -5435,8 +5680,16 @@ class ChAlert {
|
|
|
5435
5680
|
}; }
|
|
5436
5681
|
}
|
|
5437
5682
|
|
|
5438
|
-
const chBadgeCss = () => `:host{display:inline-block}.badge{display:inline-
|
|
5683
|
+
const chBadgeCss = () => `:host{display:inline-block}.badge{display:inline-flex;align-items:center;gap:var(--spacing-xs);padding:var(--spacing-2xs) var(--spacing-lg);border:var(--border-width) solid transparent;border-radius:var(--radius-pill);font-size:var(--typography-size-xs);font-weight:var(--typography-weight-semibold);text-transform:uppercase;letter-spacing:var(--typography-tracking-badge)}.badge-dot{display:block;flex:none;width:0.45em;height:0.45em;background:currentColor;border-radius:var(--radius-pill)}.badge--default{background:var(--color-surface-hover);color:var(--accent);border-color:var(--accent)}.badge--positive{background:var(--color-status-positive-background);color:var(--color-status-positive);border-color:var(--color-status-positive)}.badge--positive .badge-dot{background:transparent;border:var(--border-width) solid currentColor;border-radius:var(--radius-pill)}.badge--warning{background:var(--color-status-warning-background);color:var(--color-status-warning);border-color:var(--color-status-warning)}.badge--warning .badge-dot{border-radius:0}`;
|
|
5439
5684
|
|
|
5685
|
+
/**
|
|
5686
|
+
* Small status label.
|
|
5687
|
+
*
|
|
5688
|
+
* Variants are not colour-only: each one also changes the leading dot's shape
|
|
5689
|
+
* and adds a matching border, so a badge still says which state it is in when
|
|
5690
|
+
* printed in grayscale or seen with colour-vision deficiency. `default` uses a
|
|
5691
|
+
* filled dot, `positive` a ring, and `warning` a filled square.
|
|
5692
|
+
*/
|
|
5440
5693
|
class ChBadge {
|
|
5441
5694
|
constructor(hostRef) {
|
|
5442
5695
|
registerInstance(this, hostRef);
|
|
@@ -5445,15 +5698,22 @@ class ChBadge {
|
|
|
5445
5698
|
* The visual style of the badge. Either `default`, `positive`, or `warning`.
|
|
5446
5699
|
*/
|
|
5447
5700
|
variant = 'default';
|
|
5701
|
+
/**
|
|
5702
|
+
* Whether to show the variant marker. On by default so the state does not
|
|
5703
|
+
* depend on colour; turn it off for a badge that only repeats text already
|
|
5704
|
+
* carrying the meaning.
|
|
5705
|
+
*/
|
|
5706
|
+
statusCue = true;
|
|
5448
5707
|
render() {
|
|
5449
|
-
return (hAsync(Host, { key: '
|
|
5708
|
+
return (hAsync(Host, { key: '4690e03d920f9fd89afc7a37cab1e2c57d26f1f2' }, hAsync("span", { key: '73bac91869bb6e37d1434e7318fd716ffedc2120', class: { badge: true, [`badge--${this.variant}`]: true } }, this.statusCue && hAsync("span", { key: '8272f087de323e6d729a1820d971da6c5dc7c5b5', class: "badge-dot", "aria-hidden": "true" }), hAsync("slot", { key: 'bafc32e7a928fa7c458efb12a08fa0bbf18e83e6' }))));
|
|
5450
5709
|
}
|
|
5451
5710
|
static get style() { return chBadgeCss(); }
|
|
5452
5711
|
static get cmpMeta() { return {
|
|
5453
5712
|
"$flags$": 777,
|
|
5454
5713
|
"$tagName$": "ch-badge",
|
|
5455
5714
|
"$members$": {
|
|
5456
|
-
"variant": [1]
|
|
5715
|
+
"variant": [1],
|
|
5716
|
+
"statusCue": [4, "status-cue"]
|
|
5457
5717
|
},
|
|
5458
5718
|
"$listeners$": undefined,
|
|
5459
5719
|
"$lazyBundleId$": "-",
|
|
@@ -5461,6 +5721,18 @@ class ChBadge {
|
|
|
5461
5721
|
}; }
|
|
5462
5722
|
}
|
|
5463
5723
|
|
|
5724
|
+
function hasLightDomText(host) {
|
|
5725
|
+
return Array.from(host.childNodes).some(child => {
|
|
5726
|
+
if (child.nodeType !== 3 && child.nodeType !== 1) {
|
|
5727
|
+
return false;
|
|
5728
|
+
}
|
|
5729
|
+
if (child.nodeType === 1 && child.hasAttribute('slot')) {
|
|
5730
|
+
return false;
|
|
5731
|
+
}
|
|
5732
|
+
return (child.textContent ?? '').trim() !== '';
|
|
5733
|
+
});
|
|
5734
|
+
}
|
|
5735
|
+
|
|
5464
5736
|
const chButtonCss = () => `:host{display:inline-block}.btn{display:inline-flex;align-items:center;justify-content:center;gap:var(--spacing-sm);box-sizing:border-box;border:var(--border-width) solid transparent;border-radius:var(--radius-pill);cursor:pointer;font-family:inherit;font-weight:var(--typography-weight-bold);text-decoration:none;line-height:1.2;transition:background-color var(--duration-normal) var(--easing-default), border-color var(--duration-normal) var(--easing-default), color var(--duration-normal) var(--easing-default), transform var(--duration-fast) var(--easing-default)}.btn--sm{padding:var(--spacing-2xs) var(--spacing-lg);font-size:var(--typography-size-sm)}.btn--md{padding:var(--spacing-xs) var(--spacing-xl);font-size:inherit}.btn--lg{padding:var(--spacing-sm) var(--spacing-2xl);font-size:var(--typography-size-lg)}.btn:disabled,.btn--disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.btn--loading:disabled,.btn--loading.btn--disabled{opacity:1;cursor:progress}.btn:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.btn--primary{background-color:var(--accent);color:var(--color-accent-text)}.btn--primary:hover:not(:disabled){background-color:var(--accent-hover);transform:translateY(calc(-1 * var(--spacing-elevate)))}.btn--secondary{background-color:transparent;color:var(--text);border-color:var(--border)}.btn--secondary:hover:not(:disabled){border-color:var(--border-hover);background-color:var(--surface-hover);transform:translateY(calc(-1 * var(--spacing-elevate)))}.btn--ghost{background-color:transparent;color:var(--text)}.btn--ghost:hover:not(:disabled){background-color:var(--surface-hover)}.btn--danger{background-color:var(--color-status-warning);color:var(--bg)}.btn--danger:hover:not(:disabled){filter:brightness(0.92);transform:translateY(calc(-1 * var(--spacing-elevate)))}`;
|
|
5465
5737
|
|
|
5466
5738
|
class ChButton {
|
|
@@ -5468,6 +5740,7 @@ class ChButton {
|
|
|
5468
5740
|
registerInstance(this, hostRef);
|
|
5469
5741
|
this.chClick = createEvent(this, "chClick");
|
|
5470
5742
|
}
|
|
5743
|
+
get el() { return getElement(this); }
|
|
5471
5744
|
/**
|
|
5472
5745
|
* The visual style of the button. One of `primary`, `secondary`, `ghost`,
|
|
5473
5746
|
* or `danger`.
|
|
@@ -5500,7 +5773,8 @@ class ChButton {
|
|
|
5500
5773
|
/**
|
|
5501
5774
|
* Accessible label set as `aria-label` on the native element. Use it when
|
|
5502
5775
|
* the button's content doesn't convey its purpose on its own (e.g. an
|
|
5503
|
-
* icon-only button).
|
|
5776
|
+
* icon-only button). Omitting it on an icon-only button logs a warning in
|
|
5777
|
+
* development builds.
|
|
5504
5778
|
*/
|
|
5505
5779
|
label;
|
|
5506
5780
|
/**
|
|
@@ -5521,6 +5795,7 @@ class ChButton {
|
|
|
5521
5795
|
return [this.loading ? hAsync("ch-spinner", { size: this.spinnerSize }) : hAsync("slot", { name: "start" }), hAsync("slot", null), hAsync("slot", { name: "end" })];
|
|
5522
5796
|
}
|
|
5523
5797
|
render() {
|
|
5798
|
+
if (!this.label && !hasLightDomText(this.el)) ;
|
|
5524
5799
|
const classes = {
|
|
5525
5800
|
'btn': true,
|
|
5526
5801
|
[`btn--${this.variant}`]: true,
|
|
@@ -5561,7 +5836,7 @@ class ChCard {
|
|
|
5561
5836
|
registerInstance(this, hostRef);
|
|
5562
5837
|
}
|
|
5563
5838
|
render() {
|
|
5564
|
-
return (hAsync(Host, { key: '
|
|
5839
|
+
return (hAsync(Host, { key: 'b3952612583c8f61076164d3795b56d54b023a77' }, hAsync("div", { key: 'd0f58a9f84006c942ef9b27926f8cfa3138ad7d2', class: "card" }, hAsync("slot", { key: '9b1b54af6c5ff58417732764d4fcb8a8114348c4' }))));
|
|
5565
5840
|
}
|
|
5566
5841
|
static get style() { return chCardCss(); }
|
|
5567
5842
|
static get cmpMeta() { return {
|
|
@@ -5574,6 +5849,26 @@ class ChCard {
|
|
|
5574
5849
|
}; }
|
|
5575
5850
|
}
|
|
5576
5851
|
|
|
5852
|
+
const VALUE_MISSING_MESSAGE = 'Please fill out this field.';
|
|
5853
|
+
/**
|
|
5854
|
+
* Turns a form control's state into the flags and message passed to
|
|
5855
|
+
* `ElementInternals.setValidity()`, so the six controls that mirror their
|
|
5856
|
+
* props into constraint validation cannot drift apart.
|
|
5857
|
+
*
|
|
5858
|
+
* A custom error wins over `valueMissing` for the message, matching the native
|
|
5859
|
+
* rule order, while both flags are reported when both apply.
|
|
5860
|
+
*/
|
|
5861
|
+
function resolveValidity({ required, empty, invalid, errorMessage }) {
|
|
5862
|
+
const flags = {};
|
|
5863
|
+
if (required && empty) {
|
|
5864
|
+
flags.valueMissing = true;
|
|
5865
|
+
}
|
|
5866
|
+
if (invalid && errorMessage) {
|
|
5867
|
+
flags.customError = true;
|
|
5868
|
+
}
|
|
5869
|
+
return { flags, message: errorMessage || (flags.valueMissing ? VALUE_MISSING_MESSAGE : undefined) };
|
|
5870
|
+
}
|
|
5871
|
+
|
|
5577
5872
|
const chCheckboxCss = () => `:host{display:inline-block}.control{display:inline-flex;align-items:center;gap:var(--spacing-lg);cursor:pointer}.control--disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.input{appearance:none;-webkit-appearance:none;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--spacing-4xl);height:var(--spacing-4xl);margin:0;flex-shrink:0;border:var(--border-width) solid var(--border);border-radius:var(--radius-sm);background:var(--surface);cursor:pointer;transition:border-color var(--duration-normal) var(--easing-default), background-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.input:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.input:checked{border-color:var(--accent);background:var(--accent)}.input:checked::before{content:'';width:var(--spacing-xs);height:var(--spacing-lg);border:solid var(--color-accent-text);border-width:0 var(--spacing-shift) var(--spacing-shift) 0;transform:rotate(45deg);margin-top:calc(-1 * var(--spacing-2xs))}.input--invalid{border-color:var(--color-status-warning)}.input--invalid:focus-visible{outline-color:var(--color-status-warning)}:host([data-touched]:invalid) .input,:host(:user-invalid) .input{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .input:focus-visible,:host(:user-invalid) .input:focus-visible{outline-color:var(--color-status-warning)}.label-text{color:var(--text)}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;
|
|
5578
5873
|
|
|
5579
5874
|
let checkboxIds = 0;
|
|
@@ -5648,15 +5943,12 @@ class ChCheckbox {
|
|
|
5648
5943
|
return;
|
|
5649
5944
|
}
|
|
5650
5945
|
internals.setFormValue(this.checked ? this.value : null);
|
|
5651
|
-
const flags = {
|
|
5652
|
-
|
|
5653
|
-
|
|
5654
|
-
|
|
5655
|
-
|
|
5656
|
-
|
|
5657
|
-
flags.customError = true;
|
|
5658
|
-
}
|
|
5659
|
-
message = this.errorMessage ?? (flags.valueMissing ? 'Please fill out this field.' : undefined);
|
|
5946
|
+
const { flags, message } = resolveValidity({
|
|
5947
|
+
required: this.required,
|
|
5948
|
+
empty: !this.checked,
|
|
5949
|
+
invalid: this.invalid,
|
|
5950
|
+
errorMessage: this.errorMessage,
|
|
5951
|
+
});
|
|
5660
5952
|
internals.setValidity(flags, message);
|
|
5661
5953
|
}
|
|
5662
5954
|
componentDidLoad() {
|
|
@@ -5685,7 +5977,7 @@ class ChCheckbox {
|
|
|
5685
5977
|
return undefined;
|
|
5686
5978
|
}
|
|
5687
5979
|
render() {
|
|
5688
|
-
return (hAsync(Host, { key: '
|
|
5980
|
+
return (hAsync(Host, { key: '5246c3e6798a4ad0407f3b817ca1b83ab786ca1e' }, hAsync("label", { key: 'c3fda492b9c61c81fd3c7afe62e5c379f783ff28', class: { 'control': true, 'control--disabled': this.disabled || this.formDisabled }, htmlFor: this.checkboxId }, hAsync("input", { key: 'd77cdf632cbe58c74719567a52fbe224fcceca0b', 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: 'b2707475cc9b3f1e70044566e16ce1b90facabc6', class: "label-text" }, this.label)), this.hint && !(this.invalid && this.errorMessage) && (hAsync("p", { key: 'f597fbea344370911f71f2360db4eb0e57d3999d', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (hAsync("p", { key: '75082edd8a5a477c7c95365e6e2da66f6b69d6cc', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
5689
5981
|
}
|
|
5690
5982
|
static get formAssociated() { return true; }
|
|
5691
5983
|
static get watchers() { return {
|
|
@@ -5724,6 +6016,62 @@ class ChCheckbox {
|
|
|
5724
6016
|
}; }
|
|
5725
6017
|
}
|
|
5726
6018
|
|
|
6019
|
+
const chClusterCss = () => `:host{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;box-sizing:border-box}:host([hidden]){display:none}.cluster--nowrap{flex-wrap:nowrap}.cluster--gap-none{gap:0}.cluster--gap-2xs{gap:var(--spacing-2xs)}.cluster--gap-xs{gap:var(--spacing-xs)}.cluster--gap-sm{gap:var(--spacing-sm)}.cluster--gap-md{gap:var(--spacing-md)}.cluster--gap-lg{gap:var(--spacing-lg)}.cluster--gap-xl{gap:var(--spacing-xl)}.cluster--gap-2xl{gap:var(--spacing-2xl)}.cluster--gap-3xl{gap:var(--spacing-3xl)}.cluster--gap-4xl{gap:var(--spacing-4xl)}.cluster--gap-5xl{gap:var(--spacing-5xl)}.cluster--gap-6xl{gap:var(--spacing-6xl)}.cluster--align-stretch{align-items:stretch}.cluster--align-start{align-items:flex-start}.cluster--align-center{align-items:center}.cluster--align-end{align-items:flex-end}.cluster--align-baseline{align-items:baseline}.cluster--justify-start{justify-content:flex-start}.cluster--justify-center{justify-content:center}.cluster--justify-end{justify-content:flex-end}.cluster--justify-between{justify-content:space-between}.cluster--justify-around{justify-content:space-around}`;
|
|
6020
|
+
|
|
6021
|
+
const GAPS$2 = new Set(['none', '2xs', 'xs', 'sm', 'md', 'lg', 'xl', '2xl', '3xl', '4xl', '5xl', '6xl']);
|
|
6022
|
+
/**
|
|
6023
|
+
* Horizontal flow that wraps when it runs out of room, with a token-driven
|
|
6024
|
+
* gap in both axes — the layout a toolbar, a tag list or a button row needs.
|
|
6025
|
+
*/
|
|
6026
|
+
class ChCluster {
|
|
6027
|
+
constructor(hostRef) {
|
|
6028
|
+
registerInstance(this, hostRef);
|
|
6029
|
+
}
|
|
6030
|
+
/**
|
|
6031
|
+
* Space between children in both axes, as a step of the spacing scale
|
|
6032
|
+
* (`2xs` … `6xl`), or `none`. An unknown value falls back to `md`.
|
|
6033
|
+
*/
|
|
6034
|
+
gap = 'md';
|
|
6035
|
+
/**
|
|
6036
|
+
* Cross-axis alignment of the children.
|
|
6037
|
+
*/
|
|
6038
|
+
align = 'center';
|
|
6039
|
+
/**
|
|
6040
|
+
* Main-axis distribution of the children.
|
|
6041
|
+
*/
|
|
6042
|
+
justify = 'start';
|
|
6043
|
+
/**
|
|
6044
|
+
* Whether the children wrap onto a new line when they run out of room.
|
|
6045
|
+
*/
|
|
6046
|
+
wrap = true;
|
|
6047
|
+
get gapStep() {
|
|
6048
|
+
return GAPS$2.has(this.gap) ? this.gap : 'md';
|
|
6049
|
+
}
|
|
6050
|
+
render() {
|
|
6051
|
+
return (hAsync(Host, { key: 'f55b938f1f3e898b63646945af934258bf87b1af', class: {
|
|
6052
|
+
'cluster': true,
|
|
6053
|
+
[`cluster--gap-${this.gapStep}`]: true,
|
|
6054
|
+
[`cluster--align-${this.align}`]: true,
|
|
6055
|
+
[`cluster--justify-${this.justify}`]: true,
|
|
6056
|
+
'cluster--nowrap': !this.wrap,
|
|
6057
|
+
} }, hAsync("slot", { key: 'b4c3adf66aa275eac6f60c512454a9b4391e14d3' })));
|
|
6058
|
+
}
|
|
6059
|
+
static get style() { return chClusterCss(); }
|
|
6060
|
+
static get cmpMeta() { return {
|
|
6061
|
+
"$flags$": 777,
|
|
6062
|
+
"$tagName$": "ch-cluster",
|
|
6063
|
+
"$members$": {
|
|
6064
|
+
"gap": [1],
|
|
6065
|
+
"align": [1],
|
|
6066
|
+
"justify": [1],
|
|
6067
|
+
"wrap": [4]
|
|
6068
|
+
},
|
|
6069
|
+
"$listeners$": undefined,
|
|
6070
|
+
"$lazyBundleId$": "-",
|
|
6071
|
+
"$attrsToReflect$": []
|
|
6072
|
+
}; }
|
|
6073
|
+
}
|
|
6074
|
+
|
|
5727
6075
|
const chDividerCss = () => `:host{display:block}:host(.divider--vertical){display:inline-block;height:100%;align-self:stretch}.divider{margin:0;border:none;background:var(--border)}.divider--horizontal{width:100%;height:var(--border-width)}.divider--vertical{width:var(--border-width);height:100%}`;
|
|
5728
6076
|
|
|
5729
6077
|
class ChDivider {
|
|
@@ -5735,7 +6083,7 @@ class ChDivider {
|
|
|
5735
6083
|
*/
|
|
5736
6084
|
orientation = 'horizontal';
|
|
5737
6085
|
render() {
|
|
5738
|
-
return (hAsync(Host, { key: '
|
|
6086
|
+
return (hAsync(Host, { key: 'bf9e60345f2958ac334df8e8b3cf135363a4cd84', class: { 'divider--vertical': this.orientation === 'vertical' } }, hAsync("hr", { key: '9a6348a2e46fa30c7b58a96f875c438468866b44', class: { divider: true, [`divider--${this.orientation}`]: true }, "aria-orientation": this.orientation })));
|
|
5739
6087
|
}
|
|
5740
6088
|
static get style() { return chDividerCss(); }
|
|
5741
6089
|
static get cmpMeta() { return {
|
|
@@ -5813,6 +6161,7 @@ class ChDrawer {
|
|
|
5813
6161
|
this.chOpen = createEvent(this, "chOpen");
|
|
5814
6162
|
this.chClose = createEvent(this, "chClose");
|
|
5815
6163
|
}
|
|
6164
|
+
get el() { return getElement(this); }
|
|
5816
6165
|
/**
|
|
5817
6166
|
* Whether the drawer is open. Kept in sync when the user closes it with
|
|
5818
6167
|
* `Escape`, the close button or a click outside.
|
|
@@ -5827,7 +6176,7 @@ class ChDrawer {
|
|
|
5827
6176
|
* Accessible name for the drawer, set as `aria-label`. A slotted heading
|
|
5828
6177
|
* cannot be referenced with `aria-labelledby` across the shadow boundary, so
|
|
5829
6178
|
* the name comes through this prop — and a modal dialog needs one, so pass
|
|
5830
|
-
* the same text as the heading.
|
|
6179
|
+
* the same text as the heading. Omitting it logs a warning in development builds.
|
|
5831
6180
|
*/
|
|
5832
6181
|
label;
|
|
5833
6182
|
/**
|
|
@@ -5939,7 +6288,7 @@ class ChDrawer {
|
|
|
5939
6288
|
this.chClose.emit();
|
|
5940
6289
|
};
|
|
5941
6290
|
render() {
|
|
5942
|
-
return (hAsync(Host, { key: '
|
|
6291
|
+
return (hAsync(Host, { key: '38cbc3aa6b3c94202a4809193415b7ace9a4b377' }, hAsync("dialog", { key: '1c130ab25aabe596b87711ff5e61f121281ec98e', class: { drawer: true, [`drawer--${this.side}`]: true }, "aria-label": this.label, ref: el => (this.dialog = el) }, hAsync("div", { key: '7307a0835d140253a7ac6070cdd26eb82deb45e4', class: "drawer-head" }, hAsync("slot", { key: '371e0df2e6152642ae90763387985647fbf45794', name: "header" }), this.closeLabel && (hAsync("button", { key: 'e568aae38a6440e873342c931e0db9f6f933e20f', class: "drawer-close", type: "button", "aria-label": this.closeLabel, onClick: this.handleCloseClick }, hAsync("span", { key: 'cf5e72590342726586bd1d4e10e879531e70aba7', "aria-hidden": "true" }, "\u00D7")))), hAsync("div", { key: 'c832d23ce2be0e3cfd8e07a23a807cf4bc9163db', class: "drawer-body" }, hAsync("slot", { key: '16850f131819ae59d07893f40296cefd2bd4ce70' })), hAsync("slot", { key: '1682090d53ce7df009caa7d3360fc39e7bc5e47c', name: "footer" }))));
|
|
5943
6292
|
}
|
|
5944
6293
|
static get watchers() { return {
|
|
5945
6294
|
"open": [{
|
|
@@ -6051,7 +6400,7 @@ class ChEmoji {
|
|
|
6051
6400
|
this.loaded = true;
|
|
6052
6401
|
};
|
|
6053
6402
|
render() {
|
|
6054
|
-
return (hAsync(Host, { key: '
|
|
6403
|
+
return (hAsync(Host, { key: '403f04792b293ef20f1e01c201bc530e5bd4429c' }, hAsync("img", { key: '00b8c6f0cc5a048d21cca594472f17bcbc9882a5', class: {
|
|
6055
6404
|
'emoji': true,
|
|
6056
6405
|
[`emoji--${this.size}`]: true,
|
|
6057
6406
|
'emoji--hidden': !this.loaded,
|
|
@@ -6079,6 +6428,238 @@ class ChEmoji {
|
|
|
6079
6428
|
}; }
|
|
6080
6429
|
}
|
|
6081
6430
|
|
|
6431
|
+
const chEmptyStateCss = () => `:host{display:block;font-family:var(--typography-body);color:var(--color-text-secondary);text-align:center}:host([hidden]){display:none}.empty-state__inner{display:flex;flex-direction:column;align-items:center;gap:var(--spacing-sm);padding:var(--spacing-6xl) var(--spacing-2xl);border:var(--border-width) dashed var(--color-border-default);border-radius:var(--radius-md);background:var(--color-surface-default)}.empty-state--sm .empty-state__inner{padding:var(--spacing-3xl) var(--spacing-xl);gap:var(--spacing-xs)}.empty-state__icon{display:contents;font-size:var(--typography-size-xl);line-height:1}.empty-state__icon:empty{display:none}.empty-state__title{margin:0;font-family:var(--typography-heading);font-size:var(--typography-size-md);font-weight:var(--typography-weight-semibold);color:var(--color-text-primary)}.empty-state--md .empty-state__title{font-size:var(--typography-size-lg)}.empty-state__description{margin:0;max-width:36ch;font-size:var(--typography-size-sm);line-height:1.5}.empty-state__actions:empty{display:none}.empty-state__actions{display:flex;flex-wrap:wrap;gap:var(--spacing-sm);justify-content:center;margin-top:var(--spacing-xs)}`;
|
|
6432
|
+
|
|
6433
|
+
/**
|
|
6434
|
+
* The standard "there is nothing here" block: an optional visual, a title, a
|
|
6435
|
+
* description and an action, laid out the same way everywhere.
|
|
6436
|
+
*
|
|
6437
|
+
* It works both inside a table cell and as a whole-page view: it fills its
|
|
6438
|
+
* container but never claims a fixed height.
|
|
6439
|
+
*/
|
|
6440
|
+
class ChEmptyState {
|
|
6441
|
+
constructor(hostRef) {
|
|
6442
|
+
registerInstance(this, hostRef);
|
|
6443
|
+
}
|
|
6444
|
+
/**
|
|
6445
|
+
* Short heading stating what is missing, used as the accessible name of the
|
|
6446
|
+
* block.
|
|
6447
|
+
*/
|
|
6448
|
+
title;
|
|
6449
|
+
/**
|
|
6450
|
+
* One or two sentences explaining what the user can do about it.
|
|
6451
|
+
*/
|
|
6452
|
+
description;
|
|
6453
|
+
/**
|
|
6454
|
+
* Visual density. `sm` is for a region inside a page (a card, a table cell),
|
|
6455
|
+
* `md` for a whole view.
|
|
6456
|
+
*/
|
|
6457
|
+
size = 'md';
|
|
6458
|
+
render() {
|
|
6459
|
+
return (hAsync(Host, { key: '7438cc3c538a3d789fb3c4832d5483ce7032fcdb', class: { 'empty-state': true, [`empty-state--${this.size}`]: true } }, hAsync("div", { key: '29d06044057fc95e977fba87ce0965628509e6ef', class: "empty-state__inner" }, hAsync("div", { key: 'c49c5331ab11c03a5a0ea42fd3e622ee0093c5d6', class: "empty-state__icon", "aria-hidden": "true" }, hAsync("slot", { key: 'c5f1e5dd26438b66df8ca46c1ff7830606af2742', name: "icon" })), hAsync("h3", { key: '9604df7541e0a03c99045b93bd771a27251dbea2', class: "empty-state__title" }, this.title), this.description && hAsync("p", { key: '10800f7b89bb93c979566b657a17fb36dbb9bce8', class: "empty-state__description" }, this.description), hAsync("div", { key: '38ecef67b8c7e264acf460f715299fa21c4d7dea', class: "empty-state__actions" }, hAsync("slot", { key: '1d266f2914232f16b9e212c7cf3b2eb13d4a0fe2' })))));
|
|
6460
|
+
}
|
|
6461
|
+
static get style() { return chEmptyStateCss(); }
|
|
6462
|
+
static get cmpMeta() { return {
|
|
6463
|
+
"$flags$": 777,
|
|
6464
|
+
"$tagName$": "ch-empty-state",
|
|
6465
|
+
"$members$": {
|
|
6466
|
+
"title": [1],
|
|
6467
|
+
"description": [1],
|
|
6468
|
+
"size": [1]
|
|
6469
|
+
},
|
|
6470
|
+
"$listeners$": undefined,
|
|
6471
|
+
"$lazyBundleId$": "-",
|
|
6472
|
+
"$attrsToReflect$": []
|
|
6473
|
+
}; }
|
|
6474
|
+
}
|
|
6475
|
+
|
|
6476
|
+
const chGridCss = () => `:host{display:grid;grid-template-columns:var(--ch-grid-columns, repeat(auto-fit, minmax(min(16rem, 100%), 1fr)));box-sizing:border-box}:host([hidden]){display:none}.grid--gap-none{gap:0}.grid--gap-2xs{gap:var(--spacing-2xs)}.grid--gap-xs{gap:var(--spacing-xs)}.grid--gap-sm{gap:var(--spacing-sm)}.grid--gap-md{gap:var(--spacing-md)}.grid--gap-lg{gap:var(--spacing-lg)}.grid--gap-xl{gap:var(--spacing-xl)}.grid--gap-2xl{gap:var(--spacing-2xl)}.grid--gap-3xl{gap:var(--spacing-3xl)}.grid--gap-4xl{gap:var(--spacing-4xl)}.grid--gap-5xl{gap:var(--spacing-5xl)}.grid--gap-6xl{gap:var(--spacing-6xl)}`;
|
|
6477
|
+
|
|
6478
|
+
const GAPS$1 = new Set(['none', '2xs', 'xs', 'sm', 'md', 'lg', 'xl', '2xl', '3xl', '4xl', '5xl', '6xl']);
|
|
6479
|
+
/**
|
|
6480
|
+
* Responsive grid of equal cells.
|
|
6481
|
+
*
|
|
6482
|
+
* `columns` takes a fixed count (`1`…`12`) or `auto-fit`, which fits as many
|
|
6483
|
+
* columns as `min-item-width` allows into the available width. That second mode
|
|
6484
|
+
* is the one a card list almost always wants: it needs no breakpoints and no
|
|
6485
|
+
* media queries of its own.
|
|
6486
|
+
*/
|
|
6487
|
+
class ChGrid {
|
|
6488
|
+
constructor(hostRef) {
|
|
6489
|
+
registerInstance(this, hostRef);
|
|
6490
|
+
}
|
|
6491
|
+
get el() { return getElement(this); }
|
|
6492
|
+
/**
|
|
6493
|
+
* Number of equal columns (`1`…`12`), or `auto-fit` to fit as many as
|
|
6494
|
+
* `min-item-width` allows. An unknown value falls back to `auto-fit`.
|
|
6495
|
+
*/
|
|
6496
|
+
columns = 'auto-fit';
|
|
6497
|
+
/**
|
|
6498
|
+
* Space between cells in both axes, as a step of the spacing scale
|
|
6499
|
+
* (`2xs` … `6xl`), or `none`. An unknown value falls back to `md`.
|
|
6500
|
+
*/
|
|
6501
|
+
gap = 'md';
|
|
6502
|
+
/**
|
|
6503
|
+
* Smallest width a cell may take in `auto-fit` mode, as a CSS length. It also
|
|
6504
|
+
* caps the column count in fixed mode, so a cell never gets narrower than it.
|
|
6505
|
+
*/
|
|
6506
|
+
minItemWidth = '16rem';
|
|
6507
|
+
get gapStep() {
|
|
6508
|
+
return GAPS$1.has(this.gap) ? this.gap : 'md';
|
|
6509
|
+
}
|
|
6510
|
+
get fixedColumns() {
|
|
6511
|
+
const count = Number(this.columns);
|
|
6512
|
+
return Number.isInteger(count) && count >= 1 && count <= 12 ? count : null;
|
|
6513
|
+
}
|
|
6514
|
+
componentWillLoad() {
|
|
6515
|
+
this.applyColumns();
|
|
6516
|
+
}
|
|
6517
|
+
componentDidUpdate() {
|
|
6518
|
+
this.applyColumns();
|
|
6519
|
+
}
|
|
6520
|
+
/**
|
|
6521
|
+
* The column template is written as a CSS custom property rather than an
|
|
6522
|
+
* inline style: the template carries a comma and an internal `1fr`, and a
|
|
6523
|
+
* custom property keeps it out of the style string Stencil parses.
|
|
6524
|
+
*/
|
|
6525
|
+
applyColumns() {
|
|
6526
|
+
const template = this.fixedColumns === null ? `repeat(auto-fit, minmax(min(${this.minItemWidth}, 100%), 1fr))` : `repeat(${this.fixedColumns}, minmax(0, 1fr))`;
|
|
6527
|
+
this.el.style.setProperty('--ch-grid-columns', template);
|
|
6528
|
+
}
|
|
6529
|
+
render() {
|
|
6530
|
+
return (hAsync(Host, { key: 'a453ec09920d782d4ad324a773b1e67634e2012f', class: { grid: true, [`grid--gap-${this.gapStep}`]: true } }, hAsync("slot", { key: 'b0efb94df64941d5a94c06ae04d299e1b04f6109' })));
|
|
6531
|
+
}
|
|
6532
|
+
static get style() { return chGridCss(); }
|
|
6533
|
+
static get cmpMeta() { return {
|
|
6534
|
+
"$flags$": 777,
|
|
6535
|
+
"$tagName$": "ch-grid",
|
|
6536
|
+
"$members$": {
|
|
6537
|
+
"columns": [1],
|
|
6538
|
+
"gap": [1],
|
|
6539
|
+
"minItemWidth": [1, "min-item-width"]
|
|
6540
|
+
},
|
|
6541
|
+
"$listeners$": undefined,
|
|
6542
|
+
"$lazyBundleId$": "-",
|
|
6543
|
+
"$attrsToReflect$": []
|
|
6544
|
+
}; }
|
|
6545
|
+
}
|
|
6546
|
+
|
|
6547
|
+
const chIconCss = () => `:host{display:inline-flex;line-height:0}.icon{display:block;flex:none;color:inherit}.icon--sm{width:var(--icon-size-sm);height:var(--icon-size-sm)}.icon--md{width:var(--icon-size-md);height:var(--icon-size-md)}.icon--lg{width:var(--icon-size-lg);height:var(--icon-size-lg)}`;
|
|
6548
|
+
|
|
6549
|
+
/**
|
|
6550
|
+
* A single Lucide glyph.
|
|
6551
|
+
*
|
|
6552
|
+
* Decorative by default: the icon is hidden from assistive technology unless
|
|
6553
|
+
* you give it a `label`, because most icons sit next to text that already says
|
|
6554
|
+
* what they mean and a second announcement is noise. Set `label` only when the
|
|
6555
|
+
* icon carries meaning on its own; a control whose only content is an icon
|
|
6556
|
+
* should use `ch-icon-button`, which requires the name.
|
|
6557
|
+
*/
|
|
6558
|
+
class ChIcon {
|
|
6559
|
+
constructor(hostRef) {
|
|
6560
|
+
registerInstance(this, hostRef);
|
|
6561
|
+
}
|
|
6562
|
+
/**
|
|
6563
|
+
* Which glyph to draw. Unknown values render nothing rather than throwing,
|
|
6564
|
+
* so a stale name in a data payload cannot break the page.
|
|
6565
|
+
*/
|
|
6566
|
+
name;
|
|
6567
|
+
/**
|
|
6568
|
+
* `sm` is 16px, `md` is 20px and `lg` is 24px — the sizes the scale's line
|
|
6569
|
+
* heights were built around.
|
|
6570
|
+
*/
|
|
6571
|
+
size = 'md';
|
|
6572
|
+
/**
|
|
6573
|
+
* Accessible name. When set, the icon becomes `role="img"` and is announced;
|
|
6574
|
+
* when omitted it is `aria-hidden`.
|
|
6575
|
+
*/
|
|
6576
|
+
label;
|
|
6577
|
+
render() {
|
|
6578
|
+
const shapes = this.name ? chIcons[this.name] : undefined;
|
|
6579
|
+
const decorative = !this.label;
|
|
6580
|
+
return (hAsync(Host, { key: '46040274042301b799f103c483281a0c8088c23d' }, hAsync("svg", { key: '9e116b6983020700ceababc691216b1f05d1c460', 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)))));
|
|
6581
|
+
}
|
|
6582
|
+
static get style() { return chIconCss(); }
|
|
6583
|
+
static get cmpMeta() { return {
|
|
6584
|
+
"$flags$": 521,
|
|
6585
|
+
"$tagName$": "ch-icon",
|
|
6586
|
+
"$members$": {
|
|
6587
|
+
"name": [1],
|
|
6588
|
+
"size": [1],
|
|
6589
|
+
"label": [1]
|
|
6590
|
+
},
|
|
6591
|
+
"$listeners$": undefined,
|
|
6592
|
+
"$lazyBundleId$": "-",
|
|
6593
|
+
"$attrsToReflect$": []
|
|
6594
|
+
}; }
|
|
6595
|
+
}
|
|
6596
|
+
|
|
6597
|
+
const chIconButtonCss = () => `:host{display:inline-block}.button{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;border:var(--border-width) solid var(--border);border-radius:var(--radius-pill);background:transparent;color:var(--text);cursor:pointer;transition:background-color var(--duration-normal) var(--easing-default), border-color var(--duration-normal) var(--easing-default), color var(--duration-normal) var(--easing-default)}.button--sm{width:calc(var(--icon-size-sm) + 2 * var(--spacing-md));height:calc(var(--icon-size-sm) + 2 * var(--spacing-md))}.button--md{width:calc(var(--icon-size-md) + 2 * var(--spacing-xl));height:calc(var(--icon-size-md) + 2 * var(--spacing-xl))}.button--lg{width:calc(var(--icon-size-lg) + 2 * var(--spacing-2xl));height:calc(var(--icon-size-lg) + 2 * var(--spacing-2xl))}.button--sm .icon{width:var(--icon-size-sm);height:var(--icon-size-sm)}.button--md .icon{width:var(--icon-size-md);height:var(--icon-size-md)}.button--lg .icon{width:var(--icon-size-lg);height:var(--icon-size-lg)}.button:hover:not([aria-disabled='true']){border-color:var(--border-hover);background:var(--surface-hover)}.button:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.button[aria-disabled='true']{opacity:var(--opacity-disabled);cursor:not-allowed}.button[aria-busy='true']{cursor:progress}.button[aria-busy='true'] .icon{animation:ch-icon-button-spin var(--duration-spin) linear infinite}@keyframes ch-icon-button-spin{to{transform:rotate(360deg)}}@media (pointer: coarse){.button--sm{min-width:44px;min-height:44px}}@media (prefers-reduced-motion: reduce){.button{transition:none}.button[aria-busy='true'] .icon{animation:none}}`;
|
|
6598
|
+
|
|
6599
|
+
/**
|
|
6600
|
+
* A button whose only content is an icon.
|
|
6601
|
+
*
|
|
6602
|
+
* The label is required rather than optional. An icon-only button without an
|
|
6603
|
+
* accessible name is unusable by voice, screen reader or automation, and there
|
|
6604
|
+
* is no adjacent text to fall back on — the same reasoning as `ch-modal`, and
|
|
6605
|
+
* the reason this component exists instead of letting consumers bolt an icon
|
|
6606
|
+
* slot onto `ch-button` and forget the name.
|
|
6607
|
+
*/
|
|
6608
|
+
class ChIconButton {
|
|
6609
|
+
constructor(hostRef) {
|
|
6610
|
+
registerInstance(this, hostRef);
|
|
6611
|
+
this.chClick = createEvent(this, "chClick");
|
|
6612
|
+
}
|
|
6613
|
+
/** The glyph to draw. */
|
|
6614
|
+
name;
|
|
6615
|
+
/**
|
|
6616
|
+
* Accessible name, set as `aria-label`. Required: say what the button does
|
|
6617
|
+
* ("Eliminar producto"), not what the glyph is ("papelera").
|
|
6618
|
+
*/
|
|
6619
|
+
label;
|
|
6620
|
+
/** Visual size. `md` matches the height of a default `ch-button`. */
|
|
6621
|
+
size = 'md';
|
|
6622
|
+
/** Native button type, defaulting to `button` so it never submits a form by accident. */
|
|
6623
|
+
type = 'button';
|
|
6624
|
+
disabled = false;
|
|
6625
|
+
/**
|
|
6626
|
+
* Blocks pointer and keyboard activation and marks the button `aria-busy`
|
|
6627
|
+
* while keeping it focusable, so focus does not fall to `<body>` when an
|
|
6628
|
+
* action completes.
|
|
6629
|
+
*/
|
|
6630
|
+
loading = false;
|
|
6631
|
+
/** Emitted on click. A click while disabled or loading emits nothing. */
|
|
6632
|
+
chClick;
|
|
6633
|
+
handleClick = (event) => {
|
|
6634
|
+
if (this.disabled || this.loading) {
|
|
6635
|
+
event.preventDefault();
|
|
6636
|
+
event.stopImmediatePropagation();
|
|
6637
|
+
return;
|
|
6638
|
+
}
|
|
6639
|
+
this.chClick.emit(event);
|
|
6640
|
+
};
|
|
6641
|
+
render() {
|
|
6642
|
+
const shapes = this.name ? chIcons[this.name] : undefined;
|
|
6643
|
+
return (hAsync(Host, { key: '235a3813a30b5e98cc0b37774e0fe9cce680ac4c' }, hAsync("button", { key: 'e2d76ea663bb4746f1431affde538c2429033615', 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: '3cbc2fc57cf274920dbb12fb7f0a6eed189e7b23', 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))))));
|
|
6644
|
+
}
|
|
6645
|
+
static get style() { return chIconButtonCss(); }
|
|
6646
|
+
static get cmpMeta() { return {
|
|
6647
|
+
"$flags$": 521,
|
|
6648
|
+
"$tagName$": "ch-icon-button",
|
|
6649
|
+
"$members$": {
|
|
6650
|
+
"name": [1],
|
|
6651
|
+
"label": [1],
|
|
6652
|
+
"size": [1],
|
|
6653
|
+
"type": [1],
|
|
6654
|
+
"disabled": [4],
|
|
6655
|
+
"loading": [4]
|
|
6656
|
+
},
|
|
6657
|
+
"$listeners$": undefined,
|
|
6658
|
+
"$lazyBundleId$": "-",
|
|
6659
|
+
"$attrsToReflect$": []
|
|
6660
|
+
}; }
|
|
6661
|
+
}
|
|
6662
|
+
|
|
6082
6663
|
const chInputCss = () => `:host{display:inline-block;width:100%}.label{display:block;margin-bottom:var(--spacing-sm);font-size:var(--typography-size-sm);font-weight:var(--typography-weight-semibold);color:var(--text)}.input{box-sizing:border-box;width:100%;padding:var(--spacing-xl) var(--spacing-3xl);border-radius:var(--radius);border:var(--border-width) solid var(--border);background:var(--surface);color:var(--text);backdrop-filter:blur(var(--effect-blur));font-family:inherit;font-size:inherit;transition:border-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.input::placeholder{color:var(--text-muted)}.input:focus{border-color:var(--accent);box-shadow:var(--shadow-focus-ring);outline:none}.input--invalid{border-color:var(--color-status-warning)}.input--invalid:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}:host([data-touched]:invalid) .input,:host(:user-invalid) .input{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .input:focus,:host(:user-invalid) .input:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}.input:disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;
|
|
6083
6664
|
|
|
6084
6665
|
let inputIds = 0;
|
|
@@ -6166,15 +6747,12 @@ class ChInput {
|
|
|
6166
6747
|
return;
|
|
6167
6748
|
}
|
|
6168
6749
|
internals.setFormValue(this.value);
|
|
6169
|
-
const flags = {
|
|
6170
|
-
|
|
6171
|
-
|
|
6172
|
-
|
|
6173
|
-
|
|
6174
|
-
|
|
6175
|
-
flags.customError = true;
|
|
6176
|
-
}
|
|
6177
|
-
message = this.errorMessage ?? (flags.valueMissing ? 'Please fill out this field.' : undefined);
|
|
6750
|
+
const { flags, message } = resolveValidity({
|
|
6751
|
+
required: this.required,
|
|
6752
|
+
empty: this.value === '',
|
|
6753
|
+
invalid: this.invalid,
|
|
6754
|
+
errorMessage: this.errorMessage,
|
|
6755
|
+
});
|
|
6178
6756
|
internals.setValidity(flags, message);
|
|
6179
6757
|
}
|
|
6180
6758
|
componentDidLoad() {
|
|
@@ -6203,7 +6781,7 @@ class ChInput {
|
|
|
6203
6781
|
return undefined;
|
|
6204
6782
|
}
|
|
6205
6783
|
render() {
|
|
6206
|
-
return (hAsync(Host, { key: '
|
|
6784
|
+
return (hAsync(Host, { key: 'e0bbbb592d8c90897f48060f570606453c125ce5' }, this.label && (hAsync("label", { key: '2748fad40236a1ebe4acba6405c73f26e1284dd1', class: "label", htmlFor: this.inputId }, this.label)), hAsync("input", { key: 'b7c6ed3c9135ecaddde161a88077bd415900b465', 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: 'f87c7300a6cfca70770cd9eb05e5ba242698b3cf', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (hAsync("p", { key: 'e8ed5e8059e06d23c0e742de33c0a9b651e1ced4', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
6207
6785
|
}
|
|
6208
6786
|
static get formAssociated() { return true; }
|
|
6209
6787
|
static get watchers() { return {
|
|
@@ -6323,6 +6901,7 @@ class ChModal {
|
|
|
6323
6901
|
this.chOpen = createEvent(this, "chOpen");
|
|
6324
6902
|
this.chClose = createEvent(this, "chClose");
|
|
6325
6903
|
}
|
|
6904
|
+
get el() { return getElement(this); }
|
|
6326
6905
|
/**
|
|
6327
6906
|
* Whether the dialog is open. Kept in sync when the user closes it with
|
|
6328
6907
|
* `Escape`, the close button or a click outside.
|
|
@@ -6332,7 +6911,7 @@ class ChModal {
|
|
|
6332
6911
|
* Accessible name for the dialog, set as `aria-label`. A slotted heading
|
|
6333
6912
|
* cannot be referenced with `aria-labelledby` across the shadow boundary, so
|
|
6334
6913
|
* the name comes through this prop — and a modal dialog needs one, so pass
|
|
6335
|
-
* the same text as the heading.
|
|
6914
|
+
* the same text as the heading. Omitting it logs a warning in development builds.
|
|
6336
6915
|
*/
|
|
6337
6916
|
label;
|
|
6338
6917
|
/**
|
|
@@ -6451,7 +7030,7 @@ class ChModal {
|
|
|
6451
7030
|
this.chClose.emit();
|
|
6452
7031
|
};
|
|
6453
7032
|
render() {
|
|
6454
|
-
return (hAsync(Host, { key: '
|
|
7033
|
+
return (hAsync(Host, { key: 'c50dad31f2b1897549837aed1d8e6df2df8cd491' }, hAsync("dialog", { key: '327f6ef27b447386c180248bbeab4cc3ee0160eb', class: { modal: true, [`modal--${this.size}`]: true }, "aria-label": this.label, ref: el => (this.dialog = el) }, hAsync("div", { key: 'c8c2f8eacf26c817073920bc2ef1c7ac89fe8208', class: "modal-head" }, hAsync("slot", { key: '73d0e3ae45c7936d345ce6f3262d9ce08058b9e7', name: "heading" }), this.closeLabel && (hAsync("button", { key: 'a72d04701cd9d60e6c1486f5c38f46f7f3ff1da5', class: "modal-close", type: "button", "aria-label": this.closeLabel, onClick: this.handleCloseClick }, hAsync("span", { key: '10d1b697611309e79f28dcad9385fa7e4300c916', "aria-hidden": "true" }, "\u00D7")))), hAsync("div", { key: '040029fdc7dc7544a15b51f3c0b7d855902b7028', class: "modal-body" }, hAsync("slot", { key: '00291b7d78f49dcf366c1780562893260be3dc74' })))));
|
|
6455
7034
|
}
|
|
6456
7035
|
static get watchers() { return {
|
|
6457
7036
|
"open": [{
|
|
@@ -6474,6 +7053,68 @@ class ChModal {
|
|
|
6474
7053
|
}; }
|
|
6475
7054
|
}
|
|
6476
7055
|
|
|
7056
|
+
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}}`;
|
|
7057
|
+
|
|
7058
|
+
/**
|
|
7059
|
+
* The heading block at the top of a page: title, optional eyebrow and
|
|
7060
|
+
* description, and a trailing actions area.
|
|
7061
|
+
*
|
|
7062
|
+
* The title is a `title` prop rather than a slot so the heading level always
|
|
7063
|
+
* matches the page. A slotted heading lets a consumer nest a second `h1`, and
|
|
7064
|
+
* "one top-level heading per page" then depends on every caller remembering it;
|
|
7065
|
+
* here the level is explicit and defaults to `h1`. The actions wrap rather than
|
|
7066
|
+
* push the page sideways at 390px, and the DOM order keeps the heading before
|
|
7067
|
+
* the actions so reading and focus order still start with the title.
|
|
7068
|
+
*/
|
|
7069
|
+
class ChPageHeader {
|
|
7070
|
+
constructor(hostRef) {
|
|
7071
|
+
registerInstance(this, hostRef);
|
|
7072
|
+
}
|
|
7073
|
+
/**
|
|
7074
|
+
* The page title. Rendered as a real heading, so it also works as the
|
|
7075
|
+
* accessible name of the page region.
|
|
7076
|
+
*/
|
|
7077
|
+
title;
|
|
7078
|
+
/**
|
|
7079
|
+
* Heading element to render. Use `h2` (or `h3`) when the page already has a
|
|
7080
|
+
* higher-level heading above this block, so the document outline stays valid.
|
|
7081
|
+
*/
|
|
7082
|
+
headingLevel = 'h1';
|
|
7083
|
+
/**
|
|
7084
|
+
* Optional small label above the title, as slotted content. Use it for a
|
|
7085
|
+
* section or entity kind ("Proyecto", "Factura #1042"), not for the title.
|
|
7086
|
+
*/
|
|
7087
|
+
eyebrow;
|
|
7088
|
+
/**
|
|
7089
|
+
* Optional supporting line under the title.
|
|
7090
|
+
*/
|
|
7091
|
+
description;
|
|
7092
|
+
/**
|
|
7093
|
+
* Puts the actions below the title instead of beside it. Use it when the
|
|
7094
|
+
* actions are too wide to sit on the same row even after wrapping.
|
|
7095
|
+
*/
|
|
7096
|
+
actionsStacked = false;
|
|
7097
|
+
render() {
|
|
7098
|
+
const Heading = this.headingLevel;
|
|
7099
|
+
return (hAsync(Host, { key: '02317c9b8a8164400ac269cbfd872e066e3269e3' }, hAsync("div", { key: 'c1ab176079e95f4854826588405cd49c1bc42b58', class: { 'header': true, 'header--stacked': this.actionsStacked } }, hAsync("div", { key: '57553e0d8ac563dfd55bedb23fb6896f922c187c', class: "header-text" }, this.eyebrow && hAsync("p", { key: 'b38cbdfbc5a08cfddf60e9f82481df3ed8ad48e6', class: "header-eyebrow" }, this.eyebrow), hAsync(Heading, { key: '521003f555a4adaae81bac11a6410638db923399', class: "header-title" }, this.title), this.description && hAsync("p", { key: '0625bcd1903f52dfe16963bfc6d3ccf7e404d13a', class: "header-description" }, this.description)), hAsync("div", { key: '23b65e1729bfa24324c24958b946435ff247cb4d', class: "header-actions" }, hAsync("slot", { key: '45b4c24e4ce2bb4edc2929a2f17563260efb410f', name: "actions" })))));
|
|
7100
|
+
}
|
|
7101
|
+
static get style() { return chPageHeaderCss(); }
|
|
7102
|
+
static get cmpMeta() { return {
|
|
7103
|
+
"$flags$": 777,
|
|
7104
|
+
"$tagName$": "ch-page-header",
|
|
7105
|
+
"$members$": {
|
|
7106
|
+
"title": [1],
|
|
7107
|
+
"headingLevel": [1, "heading-level"],
|
|
7108
|
+
"eyebrow": [1],
|
|
7109
|
+
"description": [1],
|
|
7110
|
+
"actionsStacked": [4, "actions-stacked"]
|
|
7111
|
+
},
|
|
7112
|
+
"$listeners$": undefined,
|
|
7113
|
+
"$lazyBundleId$": "-",
|
|
7114
|
+
"$attrsToReflect$": []
|
|
7115
|
+
}; }
|
|
7116
|
+
}
|
|
7117
|
+
|
|
6477
7118
|
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)}`;
|
|
6478
7119
|
|
|
6479
7120
|
let radioIds = 0;
|
|
@@ -6550,15 +7191,12 @@ class ChRadio {
|
|
|
6550
7191
|
return;
|
|
6551
7192
|
}
|
|
6552
7193
|
internals.setFormValue(this.value ?? null);
|
|
6553
|
-
const flags = {
|
|
6554
|
-
|
|
6555
|
-
|
|
6556
|
-
|
|
6557
|
-
|
|
6558
|
-
|
|
6559
|
-
flags.customError = true;
|
|
6560
|
-
}
|
|
6561
|
-
message = this.errorMessage ?? (flags.valueMissing ? 'Please fill out this field.' : undefined);
|
|
7194
|
+
const { flags, message } = resolveValidity({
|
|
7195
|
+
required: this.required,
|
|
7196
|
+
empty: !this.value,
|
|
7197
|
+
invalid: this.invalid,
|
|
7198
|
+
errorMessage: this.errorMessage,
|
|
7199
|
+
});
|
|
6562
7200
|
internals.setValidity(flags, message);
|
|
6563
7201
|
}
|
|
6564
7202
|
componentDidLoad() {
|
|
@@ -6588,7 +7226,7 @@ class ChRadio {
|
|
|
6588
7226
|
}
|
|
6589
7227
|
render() {
|
|
6590
7228
|
const groupName = this.name || `${this.groupId}-group`;
|
|
6591
|
-
return (hAsync(Host, { key: '
|
|
7229
|
+
return (hAsync(Host, { key: '9803d5b41d3985503d1b304d53504239d2a2de1d' }, this.label && (hAsync("span", { key: 'f75cf217d50a300e5c6ddcdcfb9c5832e1f6b964', class: "group-label", id: this.labelId }, this.label)), hAsync("div", { key: 'd8e9e24e82dfb77f728e8d9c994102202a9ce85b', 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: '91bed0d5cd70a032de7b8ba6e298903b387e1a4a', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (hAsync("p", { key: 'a2e6d6c87d60e98ac3d396f7dde907ce1e46946a', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
6592
7230
|
}
|
|
6593
7231
|
static get formAssociated() { return true; }
|
|
6594
7232
|
static get watchers() { return {
|
|
@@ -6708,11 +7346,11 @@ class ChSegmentedControl {
|
|
|
6708
7346
|
return;
|
|
6709
7347
|
}
|
|
6710
7348
|
internals.setFormValue(this.value ?? null);
|
|
6711
|
-
const flags = {
|
|
6712
|
-
|
|
6713
|
-
|
|
6714
|
-
}
|
|
6715
|
-
internals.setValidity(flags,
|
|
7349
|
+
const { flags, message } = resolveValidity({
|
|
7350
|
+
required: this.required,
|
|
7351
|
+
empty: !this.value,
|
|
7352
|
+
});
|
|
7353
|
+
internals.setValidity(flags, message);
|
|
6716
7354
|
}
|
|
6717
7355
|
componentDidLoad() {
|
|
6718
7356
|
this.initialValue = this.value;
|
|
@@ -6732,7 +7370,7 @@ class ChSegmentedControl {
|
|
|
6732
7370
|
}
|
|
6733
7371
|
render() {
|
|
6734
7372
|
const groupName = this.name || `${this.groupId}-group`;
|
|
6735
|
-
return (hAsync(Host, { key: '
|
|
7373
|
+
return (hAsync(Host, { key: 'd6a9a720a1a210c73711cff1f7cd6c1ffa0c89b2' }, this.label && (hAsync("span", { key: 'af5fb9ab87e918ac6047ebd6e65e540044c6a2d0', class: "group-label", id: this.labelId }, this.label)), hAsync("div", { key: '8dd76ea8d792d918ac5e413946e8a08cb89480c7', 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)))))));
|
|
6736
7374
|
}
|
|
6737
7375
|
static get formAssociated() { return true; }
|
|
6738
7376
|
static get watchers() { return {
|
|
@@ -6841,15 +7479,12 @@ class ChSelect {
|
|
|
6841
7479
|
return;
|
|
6842
7480
|
}
|
|
6843
7481
|
internals.setFormValue(this.value ?? '');
|
|
6844
|
-
const flags = {
|
|
6845
|
-
|
|
6846
|
-
|
|
6847
|
-
|
|
6848
|
-
|
|
6849
|
-
|
|
6850
|
-
flags.customError = true;
|
|
6851
|
-
}
|
|
6852
|
-
message = this.errorMessage ?? (flags.valueMissing ? 'Please fill out this field.' : undefined);
|
|
7482
|
+
const { flags, message } = resolveValidity({
|
|
7483
|
+
required: this.required,
|
|
7484
|
+
empty: !this.value,
|
|
7485
|
+
invalid: this.invalid,
|
|
7486
|
+
errorMessage: this.errorMessage,
|
|
7487
|
+
});
|
|
6853
7488
|
internals.setValidity(flags, message);
|
|
6854
7489
|
}
|
|
6855
7490
|
componentDidLoad() {
|
|
@@ -6878,7 +7513,7 @@ class ChSelect {
|
|
|
6878
7513
|
return undefined;
|
|
6879
7514
|
}
|
|
6880
7515
|
render() {
|
|
6881
|
-
return (hAsync(Host, { key: '
|
|
7516
|
+
return (hAsync(Host, { key: 'b01c1dca70dbf88556521faa1be7430dc3d2355c' }, this.label && (hAsync("label", { key: '265a09b70dafca0c9330ceaec2477b6b203a71eb', class: "label", htmlFor: this.selectId }, this.label)), hAsync("select", { key: '43b387edff4fd326beac608fa16e50f3407e8cac', 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: '456e5220d2fd6fdb2a2171d10bcd11c6d2c58956', 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: '7f4609f6441f9ce6c5f13b4a12875d85c110ccd8', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (hAsync("p", { key: 'e05a04a3f43ad055cd7cc57deb48f8b19d1a7084', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
6882
7517
|
}
|
|
6883
7518
|
static get formAssociated() { return true; }
|
|
6884
7519
|
static get watchers() { return {
|
|
@@ -6918,6 +7553,78 @@ class ChSelect {
|
|
|
6918
7553
|
}; }
|
|
6919
7554
|
}
|
|
6920
7555
|
|
|
7556
|
+
const chSkeletonCss = () => `:host{display:block;width:100%}:host([hidden]){display:none}:host(.skeleton--circle){width:auto;display:inline-flex}.skeleton__item{display:block;background:var(--color-surface-default);border-radius:var(--radius-sm)}.skeleton--circle .skeleton__item{border-radius:50%}.skeleton--rect .skeleton__item{border-radius:var(--radius-md)}.skeleton--animated .skeleton__item{background-image:linear-gradient(90deg, transparent 0%, var(--color-surface-hover) 50%, transparent 100%);background-size:200% 100%;background-repeat:no-repeat;animation:ch-skeleton-shimmer 1.4s ease-in-out infinite}@keyframes ch-skeleton-shimmer{from{background-position:100% 0}to{background-position:-100% 0}}@media (prefers-reduced-motion: reduce){.skeleton--animated .skeleton__item{animation:none;background-image:none}}`;
|
|
7557
|
+
|
|
7558
|
+
/**
|
|
7559
|
+
* Decorative loading placeholder that reserves the space real content will
|
|
7560
|
+
* take, so the page does not jump when the data arrives.
|
|
7561
|
+
*
|
|
7562
|
+
* It stays out of the accessibility tree on purpose: a screen reader should
|
|
7563
|
+
* hear nothing about a placeholder. Mark the region that is actually loading
|
|
7564
|
+
* with `aria-busy="true"` yourself, and announce the result when it lands.
|
|
7565
|
+
*/
|
|
7566
|
+
class ChSkeleton {
|
|
7567
|
+
constructor(hostRef) {
|
|
7568
|
+
registerInstance(this, hostRef);
|
|
7569
|
+
}
|
|
7570
|
+
/**
|
|
7571
|
+
* Width of a placeholder. For `line` and `rect` it is a CSS length or a
|
|
7572
|
+
* percentage; `circle` is square, so this sets its diameter too.
|
|
7573
|
+
*/
|
|
7574
|
+
width = '100%';
|
|
7575
|
+
/**
|
|
7576
|
+
* Height of a placeholder, as a CSS length. Ignored by `circle`, which is
|
|
7577
|
+
* square.
|
|
7578
|
+
*/
|
|
7579
|
+
height = '1rem';
|
|
7580
|
+
/**
|
|
7581
|
+
* Shape of the placeholder: `line` for text, `circle` for avatars and
|
|
7582
|
+
* icons, `rect` for images and cards.
|
|
7583
|
+
*/
|
|
7584
|
+
shape = 'line';
|
|
7585
|
+
/**
|
|
7586
|
+
* How many placeholders to render in a row, for multi-line text blocks. A
|
|
7587
|
+
* value below 1 renders one.
|
|
7588
|
+
*/
|
|
7589
|
+
count = 1;
|
|
7590
|
+
/**
|
|
7591
|
+
* Whether the shimmer runs. It is also disabled automatically for people who
|
|
7592
|
+
* asked for reduced motion.
|
|
7593
|
+
*/
|
|
7594
|
+
animated = true;
|
|
7595
|
+
get items() {
|
|
7596
|
+
const count = Number(this.count);
|
|
7597
|
+
return Number.isInteger(count) && count >= 1 ? count : 1;
|
|
7598
|
+
}
|
|
7599
|
+
get sizeStyle() {
|
|
7600
|
+
if (this.shape === 'circle') {
|
|
7601
|
+
return { width: this.width, height: this.width };
|
|
7602
|
+
}
|
|
7603
|
+
if (this.shape === 'line') {
|
|
7604
|
+
return { width: this.width, height: this.height };
|
|
7605
|
+
}
|
|
7606
|
+
return { width: this.width, height: this.height };
|
|
7607
|
+
}
|
|
7608
|
+
render() {
|
|
7609
|
+
return (hAsync(Host, { key: 'bbcafacc79f0288204028378f2cf460f793ca702', "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) })))));
|
|
7610
|
+
}
|
|
7611
|
+
static get style() { return chSkeletonCss(); }
|
|
7612
|
+
static get cmpMeta() { return {
|
|
7613
|
+
"$flags$": 521,
|
|
7614
|
+
"$tagName$": "ch-skeleton",
|
|
7615
|
+
"$members$": {
|
|
7616
|
+
"width": [1],
|
|
7617
|
+
"height": [1],
|
|
7618
|
+
"shape": [1],
|
|
7619
|
+
"count": [2],
|
|
7620
|
+
"animated": [4]
|
|
7621
|
+
},
|
|
7622
|
+
"$listeners$": undefined,
|
|
7623
|
+
"$lazyBundleId$": "-",
|
|
7624
|
+
"$attrsToReflect$": []
|
|
7625
|
+
}; }
|
|
7626
|
+
}
|
|
7627
|
+
|
|
6921
7628
|
const chSpinnerCss = () => `:host{display:inline-block;vertical-align:middle}.spinner{display:block;box-sizing:border-box;width:1em;height:1em;border:0.125em solid currentColor;border-top-color:transparent;border-radius:50%;animation:ch-spinner-rotate var(--duration-spin) var(--easing-linear) infinite}.spinner--sm{font-size:var(--typography-size-sm)}.spinner--md{font-size:var(--typography-size-lg)}.spinner--lg{font-size:var(--typography-size-xl)}@keyframes ch-spinner-rotate{to{transform:rotate(360deg)}}@media (prefers-reduced-motion: reduce){.spinner{animation-duration:calc(var(--duration-spin) * 4)}}`;
|
|
6922
7629
|
|
|
6923
7630
|
/**
|
|
@@ -6947,7 +7654,7 @@ class ChSpinner {
|
|
|
6947
7654
|
label;
|
|
6948
7655
|
render() {
|
|
6949
7656
|
const labelled = Boolean(this.label);
|
|
6950
|
-
return (hAsync(Host, { key: '
|
|
7657
|
+
return (hAsync(Host, { key: '9e1cc36781db28cded8318f67158332168b0bbfc' }, hAsync("span", { key: '9c923d38545c0fceab0f244b4374708e2b7e2043', class: { spinner: true, [`spinner--${this.size}`]: true }, role: labelled ? 'status' : undefined, "aria-label": labelled ? this.label : undefined, "aria-hidden": labelled ? undefined : 'true' })));
|
|
6951
7658
|
}
|
|
6952
7659
|
static get style() { return chSpinnerCss(); }
|
|
6953
7660
|
static get cmpMeta() { return {
|
|
@@ -6963,6 +7670,53 @@ class ChSpinner {
|
|
|
6963
7670
|
}; }
|
|
6964
7671
|
}
|
|
6965
7672
|
|
|
7673
|
+
const chStackCss = () => `:host{display:flex;flex-direction:column;box-sizing:border-box}:host([hidden]){display:none}.stack--gap-none{gap:0}.stack--gap-2xs{gap:var(--spacing-2xs)}.stack--gap-xs{gap:var(--spacing-xs)}.stack--gap-sm{gap:var(--spacing-sm)}.stack--gap-md{gap:var(--spacing-md)}.stack--gap-lg{gap:var(--spacing-lg)}.stack--gap-xl{gap:var(--spacing-xl)}.stack--gap-2xl{gap:var(--spacing-2xl)}.stack--gap-3xl{gap:var(--spacing-3xl)}.stack--gap-4xl{gap:var(--spacing-4xl)}.stack--gap-5xl{gap:var(--spacing-5xl)}.stack--gap-6xl{gap:var(--spacing-6xl)}.stack--align-stretch{align-items:stretch}.stack--align-start{align-items:flex-start}.stack--align-center{align-items:center}.stack--align-end{align-items:flex-end}.stack--justify-start{justify-content:flex-start}.stack--justify-center{justify-content:center}.stack--justify-end{justify-content:flex-end}.stack--justify-between{justify-content:space-between}.stack--justify-around{justify-content:space-around}`;
|
|
7674
|
+
|
|
7675
|
+
const GAPS = new Set(['none', '2xs', 'xs', 'sm', 'md', 'lg', 'xl', '2xl', '3xl', '4xl', '5xl', '6xl']);
|
|
7676
|
+
/**
|
|
7677
|
+
* Vertical flow: children stack top to bottom with a token-driven gap.
|
|
7678
|
+
*
|
|
7679
|
+
* It is a real host with `display: flex`, not `display: contents`, so a
|
|
7680
|
+
* consumer's own classes and attributes on `<ch-stack>` keep working.
|
|
7681
|
+
*/
|
|
7682
|
+
class ChStack {
|
|
7683
|
+
constructor(hostRef) {
|
|
7684
|
+
registerInstance(this, hostRef);
|
|
7685
|
+
}
|
|
7686
|
+
/**
|
|
7687
|
+
* Space between children, as a step of the spacing scale (`2xs` … `6xl`),
|
|
7688
|
+
* or `none` for no gap. An unknown value falls back to `md`.
|
|
7689
|
+
*/
|
|
7690
|
+
gap = 'md';
|
|
7691
|
+
/**
|
|
7692
|
+
* Cross-axis alignment of the children.
|
|
7693
|
+
*/
|
|
7694
|
+
align = 'stretch';
|
|
7695
|
+
/**
|
|
7696
|
+
* Main-axis distribution of the children.
|
|
7697
|
+
*/
|
|
7698
|
+
justify = 'start';
|
|
7699
|
+
get gapStep() {
|
|
7700
|
+
return GAPS.has(this.gap) ? this.gap : 'md';
|
|
7701
|
+
}
|
|
7702
|
+
render() {
|
|
7703
|
+
return (hAsync(Host, { key: '646286c45adc0d816b0fdbcdfe9e70f809fedb95', class: { stack: true, [`stack--gap-${this.gapStep}`]: true, [`stack--align-${this.align}`]: true, [`stack--justify-${this.justify}`]: true } }, hAsync("slot", { key: '1c18713eb95fc568a08bcbd6e018add9336a0fd0' })));
|
|
7704
|
+
}
|
|
7705
|
+
static get style() { return chStackCss(); }
|
|
7706
|
+
static get cmpMeta() { return {
|
|
7707
|
+
"$flags$": 777,
|
|
7708
|
+
"$tagName$": "ch-stack",
|
|
7709
|
+
"$members$": {
|
|
7710
|
+
"gap": [1],
|
|
7711
|
+
"align": [1],
|
|
7712
|
+
"justify": [1]
|
|
7713
|
+
},
|
|
7714
|
+
"$listeners$": undefined,
|
|
7715
|
+
"$lazyBundleId$": "-",
|
|
7716
|
+
"$attrsToReflect$": []
|
|
7717
|
+
}; }
|
|
7718
|
+
}
|
|
7719
|
+
|
|
6966
7720
|
const chSwitchCss = () => `:host{display:inline-block}.control{position:relative;display:inline-flex;align-items:center;gap:var(--spacing-lg);cursor:pointer}.control--disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}.input:focus-visible~.track{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.track{position:relative;box-sizing:border-box;width:var(--spacing-6xl);height:var(--spacing-5xl);flex-shrink:0;border:var(--border-width) solid var(--border);border-radius:var(--radius-pill);background:var(--surface);transition:border-color var(--duration-normal) var(--easing-default), background-color var(--duration-normal) var(--easing-default)}.thumb{position:absolute;top:50%;left:var(--spacing-2xs);width:var(--spacing-2xl);height:var(--spacing-2xl);border-radius:50%;background:var(--text-muted);transform:translateY(-50%);transition:left var(--duration-normal) var(--easing-default), background-color var(--duration-normal) var(--easing-default)}.input:checked~.track{border-color:var(--accent);background:var(--accent)}.input:checked~.track .thumb{left:calc(100% - var(--spacing-2xl) - var(--spacing-2xs));background:var(--color-accent-text)}.input--invalid~.track{border-color:var(--color-status-warning)}.input--invalid:focus-visible~.track{outline-color:var(--color-status-warning)}:host([data-touched]:invalid) .track,:host(:user-invalid) .track{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .input:focus-visible~.track,:host(:user-invalid) .input:focus-visible~.track{outline-color:var(--color-status-warning)}.label-text{color:var(--text)}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;
|
|
6967
7721
|
|
|
6968
7722
|
let switchIds = 0;
|
|
@@ -7037,15 +7791,12 @@ class ChSwitch {
|
|
|
7037
7791
|
return;
|
|
7038
7792
|
}
|
|
7039
7793
|
internals.setFormValue(this.checked ? this.value : null);
|
|
7040
|
-
const flags = {
|
|
7041
|
-
|
|
7042
|
-
|
|
7043
|
-
|
|
7044
|
-
|
|
7045
|
-
|
|
7046
|
-
flags.customError = true;
|
|
7047
|
-
}
|
|
7048
|
-
message = this.errorMessage ?? (flags.valueMissing ? 'Please fill out this field.' : undefined);
|
|
7794
|
+
const { flags, message } = resolveValidity({
|
|
7795
|
+
required: this.required,
|
|
7796
|
+
empty: !this.checked,
|
|
7797
|
+
invalid: this.invalid,
|
|
7798
|
+
errorMessage: this.errorMessage,
|
|
7799
|
+
});
|
|
7049
7800
|
internals.setValidity(flags, message);
|
|
7050
7801
|
}
|
|
7051
7802
|
componentDidLoad() {
|
|
@@ -7074,7 +7825,7 @@ class ChSwitch {
|
|
|
7074
7825
|
return undefined;
|
|
7075
7826
|
}
|
|
7076
7827
|
render() {
|
|
7077
|
-
return (hAsync(Host, { key: '
|
|
7828
|
+
return (hAsync(Host, { key: '7c862590fa8ce9c53d168cb670361259405c72bb' }, hAsync("label", { key: 'e5602d4daa8ebf1a9832282fffb9e538fc1592a8', class: { 'control': true, 'control--disabled': this.disabled || this.formDisabled }, htmlFor: this.switchId }, hAsync("input", { key: 'd29c00496c4a05ccbe66ffdbebf3a496c5ae6995', 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: '5739a0b689ac7ed9ebc917e6102b3951e80ac06d', class: "track" }, hAsync("span", { key: 'e10c21f740092750dd9bb00cde84fa1c26746eb9', class: "thumb" })), this.label && hAsync("span", { key: 'bec86897b1ef0023d3eb8c8438bf6740f32a5921', class: "label-text" }, this.label)), this.hint && !(this.invalid && this.errorMessage) && (hAsync("p", { key: '2568bcf74334e5f081df8efa9a1196c69cb3093d', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (hAsync("p", { key: '319d5583cf10e329f05430a577d2f1f956ac8dd5', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
7078
7829
|
}
|
|
7079
7830
|
static get formAssociated() { return true; }
|
|
7080
7831
|
static get watchers() { return {
|
|
@@ -7197,7 +7948,7 @@ class ChTabs {
|
|
|
7197
7948
|
}
|
|
7198
7949
|
render() {
|
|
7199
7950
|
const active = this.activeValue;
|
|
7200
|
-
return (hAsync(Host, { key: '
|
|
7951
|
+
return (hAsync(Host, { key: '915c7a584397bbe10a72642a1ce5ed68f2264ed2' }, hAsync("div", { key: 'b37a294722442c73d224410793cd0c098734993f', class: "tablist", role: "tablist", "aria-label": this.label, onKeyDown: this.handleKeyDown, ref: el => (this.tablistEl = el) }, this.tabs.map(tab => {
|
|
7201
7952
|
const selected = tab.value === active;
|
|
7202
7953
|
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));
|
|
7203
7954
|
})), 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}` }))))));
|
|
@@ -7305,15 +8056,12 @@ class ChTextarea {
|
|
|
7305
8056
|
return;
|
|
7306
8057
|
}
|
|
7307
8058
|
internals.setFormValue(this.value);
|
|
7308
|
-
const flags = {
|
|
7309
|
-
|
|
7310
|
-
|
|
7311
|
-
|
|
7312
|
-
|
|
7313
|
-
|
|
7314
|
-
flags.customError = true;
|
|
7315
|
-
}
|
|
7316
|
-
message = this.errorMessage ?? (flags.valueMissing ? 'Please fill out this field.' : undefined);
|
|
8059
|
+
const { flags, message } = resolveValidity({
|
|
8060
|
+
required: this.required,
|
|
8061
|
+
empty: this.value === '',
|
|
8062
|
+
invalid: this.invalid,
|
|
8063
|
+
errorMessage: this.errorMessage,
|
|
8064
|
+
});
|
|
7317
8065
|
internals.setValidity(flags, message);
|
|
7318
8066
|
}
|
|
7319
8067
|
componentDidLoad() {
|
|
@@ -7342,7 +8090,7 @@ class ChTextarea {
|
|
|
7342
8090
|
return undefined;
|
|
7343
8091
|
}
|
|
7344
8092
|
render() {
|
|
7345
|
-
return (hAsync(Host, { key: '
|
|
8093
|
+
return (hAsync(Host, { key: '5e7f4e6c779b677f259b56ebf6cb2e829511275e' }, this.label && (hAsync("label", { key: '73a3a3d44b4926aaf0681aa68f878932c7932dae', class: "label", htmlFor: this.textareaId }, this.label)), hAsync("textarea", { key: '10edc56d4846b578bd11c7bd001e7ca47aa1838d', 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: '393ea00da6e7def75d4305c242a9cf957013359b', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (hAsync("p", { key: 'ba405aec9d92b410e063cec29235240a4a4ec715', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
7346
8094
|
}
|
|
7347
8095
|
static get formAssociated() { return true; }
|
|
7348
8096
|
static get watchers() { return {
|
|
@@ -7382,9 +8130,112 @@ class ChTextarea {
|
|
|
7382
8130
|
}; }
|
|
7383
8131
|
}
|
|
7384
8132
|
|
|
7385
|
-
const
|
|
8133
|
+
const OPPOSITE = {
|
|
8134
|
+
top: 'bottom',
|
|
8135
|
+
bottom: 'top',
|
|
8136
|
+
left: 'right',
|
|
8137
|
+
right: 'left',
|
|
8138
|
+
};
|
|
8139
|
+
const AXIS = {
|
|
8140
|
+
top: 'vertical',
|
|
8141
|
+
bottom: 'vertical',
|
|
8142
|
+
left: 'horizontal',
|
|
8143
|
+
right: 'horizontal',
|
|
8144
|
+
};
|
|
8145
|
+
/**
|
|
8146
|
+
* How far a placed surface overflows each viewport edge. Positive values are
|
|
8147
|
+
* overflow. Used both to pick a placement and to shift the surface back in.
|
|
8148
|
+
*/
|
|
8149
|
+
function overflowOf(surface, viewport) {
|
|
8150
|
+
return {
|
|
8151
|
+
top: viewport.top - surface.top,
|
|
8152
|
+
left: viewport.left - surface.left,
|
|
8153
|
+
bottom: surface.top + surface.height - (viewport.top + viewport.height),
|
|
8154
|
+
right: surface.left + surface.width - (viewport.left + viewport.width),
|
|
8155
|
+
};
|
|
8156
|
+
}
|
|
8157
|
+
function offsetFor(placement, anchor, surface, gap) {
|
|
8158
|
+
switch (placement) {
|
|
8159
|
+
case 'top':
|
|
8160
|
+
return {
|
|
8161
|
+
top: anchor.top - surface.height - gap,
|
|
8162
|
+
left: anchor.left + (anchor.width - surface.width) / 2,
|
|
8163
|
+
};
|
|
8164
|
+
case 'bottom':
|
|
8165
|
+
return {
|
|
8166
|
+
top: anchor.top + anchor.height + gap,
|
|
8167
|
+
left: anchor.left + (anchor.width - surface.width) / 2,
|
|
8168
|
+
};
|
|
8169
|
+
case 'left':
|
|
8170
|
+
return {
|
|
8171
|
+
top: anchor.top + (anchor.height - surface.height) / 2,
|
|
8172
|
+
left: anchor.left - surface.width - gap,
|
|
8173
|
+
};
|
|
8174
|
+
case 'right':
|
|
8175
|
+
return {
|
|
8176
|
+
top: anchor.top + (anchor.height - surface.height) / 2,
|
|
8177
|
+
left: anchor.left + anchor.width + gap,
|
|
8178
|
+
};
|
|
8179
|
+
}
|
|
8180
|
+
}
|
|
8181
|
+
/**
|
|
8182
|
+
* Picks the placement that overflows least and then shifts the surface along
|
|
8183
|
+
* the cross axis so it stays inside the viewport.
|
|
8184
|
+
*
|
|
8185
|
+
* The main-axis overflow is not compensated with a translate: a tooltip pinned
|
|
8186
|
+
* to the top edge would cover its own trigger. Flipping to the other side is
|
|
8187
|
+
* what keeps it readable, and the caller decides whether to accept the
|
|
8188
|
+
* remaining overflow.
|
|
8189
|
+
*/
|
|
8190
|
+
function placeOverlay({ anchor, surface, viewport, preferred, gap, }) {
|
|
8191
|
+
const candidates = [preferred, OPPOSITE[preferred]];
|
|
8192
|
+
let placement = preferred;
|
|
8193
|
+
let best = Number.POSITIVE_INFINITY;
|
|
8194
|
+
for (const candidate of candidates) {
|
|
8195
|
+
const { top, left } = offsetFor(candidate, anchor, surface, gap);
|
|
8196
|
+
const rect = { top, left, width: surface.width, height: surface.height };
|
|
8197
|
+
const overflow = overflowOf(rect, viewport);
|
|
8198
|
+
const main = AXIS[candidate] === 'vertical' ? clamp(overflow.top) + clamp(overflow.bottom) : clamp(overflow.left) + clamp(overflow.right);
|
|
8199
|
+
if (main < best) {
|
|
8200
|
+
best = main;
|
|
8201
|
+
placement = candidate;
|
|
8202
|
+
}
|
|
8203
|
+
}
|
|
8204
|
+
const { top, left } = offsetFor(placement, anchor, surface, gap);
|
|
8205
|
+
const rect = { top, left, width: surface.width, height: surface.height };
|
|
8206
|
+
const overflow = overflowOf(rect, viewport);
|
|
8207
|
+
const shifted = AXIS[placement] === 'vertical' ? { top, left: left + correction(overflow.left, overflow.right) } : { top: top + correction(overflow.top, overflow.bottom), left };
|
|
8208
|
+
return { placement, top: shifted.top, left: shifted.left };
|
|
8209
|
+
}
|
|
8210
|
+
/** Only real overflow counts: the side that fits contributes nothing. */
|
|
8211
|
+
function clamp(overflow) {
|
|
8212
|
+
return overflow > 0 ? overflow : 0;
|
|
8213
|
+
}
|
|
8214
|
+
/**
|
|
8215
|
+
* Turns the two overflows on an axis into a shift. `before` is the overflow on
|
|
8216
|
+
* the leading edge (top or left), `after` the one on the trailing edge; both
|
|
8217
|
+
* are positive when the surface spills past that edge.
|
|
8218
|
+
*
|
|
8219
|
+
* Pushing away from the leading edge moves the surface inwards, so the shift is
|
|
8220
|
+
* `+before`. The trailing edge needs the opposite sign. When both overflow the
|
|
8221
|
+
* surface is larger than the viewport: pin it to the leading edge and let
|
|
8222
|
+
* `max-width` stop the spill.
|
|
8223
|
+
*/
|
|
8224
|
+
function correction(before, after) {
|
|
8225
|
+
if (before > 0) {
|
|
8226
|
+
return before;
|
|
8227
|
+
}
|
|
8228
|
+
if (after > 0) {
|
|
8229
|
+
return -after;
|
|
8230
|
+
}
|
|
8231
|
+
return 0;
|
|
8232
|
+
}
|
|
8233
|
+
|
|
8234
|
+
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}}`;
|
|
7386
8235
|
|
|
7387
8236
|
let tooltipIds = 0;
|
|
8237
|
+
/** Space between the trigger and the bubble, matching `--spacing-md`. */
|
|
8238
|
+
const GAP = 8;
|
|
7388
8239
|
/**
|
|
7389
8240
|
* Short help text shown on hover and on focus.
|
|
7390
8241
|
*
|
|
@@ -7400,6 +8251,13 @@ let tooltipIds = 0;
|
|
|
7400
8251
|
* `<input>`). A chucao component such as `ch-button` will not be described,
|
|
7401
8252
|
* because `aria-*` set on a custom element host does not reach the native
|
|
7402
8253
|
* element inside it — see the discussion in issue #47.
|
|
8254
|
+
*
|
|
8255
|
+
* Positioning is measured, not purely CSS: `placement` is the preferred side,
|
|
8256
|
+
* and the bubble flips to the opposite side when the preferred one does not
|
|
8257
|
+
* fit, then shifts along the other axis to stay inside the viewport. It
|
|
8258
|
+
* re-measures on scroll, resize and visual-viewport changes, which is what
|
|
8259
|
+
* keeps it correct inside a scrolling modal or drawer and when a mobile
|
|
8260
|
+
* keyboard shrinks the visible area.
|
|
7403
8261
|
*/
|
|
7404
8262
|
class ChTooltip {
|
|
7405
8263
|
constructor(hostRef) {
|
|
@@ -7407,8 +8265,11 @@ class ChTooltip {
|
|
|
7407
8265
|
}
|
|
7408
8266
|
get el() { return getElement(this); }
|
|
7409
8267
|
fallbackId = `ch-tooltip-${++tooltipIds}`;
|
|
8268
|
+
bubbleEl;
|
|
8269
|
+
cleanup;
|
|
7410
8270
|
/**
|
|
7411
|
-
*
|
|
8271
|
+
* The side the bubble is placed on. It is a preference: when that side has no
|
|
8272
|
+
* room the bubble flips to the opposite one.
|
|
7412
8273
|
*/
|
|
7413
8274
|
placement = 'top';
|
|
7414
8275
|
// Hover and focus are tracked apart so that neither cancels the other: a
|
|
@@ -7417,15 +8278,26 @@ class ChTooltip {
|
|
|
7417
8278
|
hovered = false;
|
|
7418
8279
|
focused = false;
|
|
7419
8280
|
dismissed = false;
|
|
8281
|
+
/** The placement actually used, which may differ from the prop after a flip. */
|
|
8282
|
+
resolvedPlacement;
|
|
8283
|
+
/** Offset applied to the bubble once it has been measured. */
|
|
8284
|
+
offset;
|
|
7420
8285
|
get visible() {
|
|
7421
8286
|
return (this.hovered || this.focused) && !this.dismissed;
|
|
7422
8287
|
}
|
|
7423
8288
|
componentDidLoad() {
|
|
7424
8289
|
this.associate();
|
|
7425
8290
|
}
|
|
8291
|
+
connectedCallback() {
|
|
8292
|
+
this.watchViewport();
|
|
8293
|
+
}
|
|
8294
|
+
disconnectedCallback() {
|
|
8295
|
+
this.cleanup?.();
|
|
8296
|
+
}
|
|
7426
8297
|
handleMouseEnter() {
|
|
7427
8298
|
this.hovered = true;
|
|
7428
8299
|
this.dismissed = false;
|
|
8300
|
+
this.position();
|
|
7429
8301
|
}
|
|
7430
8302
|
handleMouseLeave() {
|
|
7431
8303
|
this.hovered = false;
|
|
@@ -7433,6 +8305,7 @@ class ChTooltip {
|
|
|
7433
8305
|
handleFocusIn() {
|
|
7434
8306
|
this.focused = true;
|
|
7435
8307
|
this.dismissed = false;
|
|
8308
|
+
this.position();
|
|
7436
8309
|
}
|
|
7437
8310
|
handleFocusOut() {
|
|
7438
8311
|
this.focused = false;
|
|
@@ -7440,15 +8313,78 @@ class ChTooltip {
|
|
|
7440
8313
|
/**
|
|
7441
8314
|
* Listens on the document because a tooltip opened by hovering leaves focus
|
|
7442
8315
|
* wherever it was, so a host-scoped handler would never see the key.
|
|
8316
|
+
*
|
|
8317
|
+
* Only the outermost Escape handler is stopped from propagating, so a
|
|
8318
|
+
* tooltip inside an open modal closes itself and leaves the modal open.
|
|
7443
8319
|
*/
|
|
7444
8320
|
handleKeyDown(event) {
|
|
7445
|
-
if (event.key === 'Escape' && this.visible) {
|
|
8321
|
+
if (event.key === 'Escape' && this.visible && !event.defaultPrevented) {
|
|
8322
|
+
event.preventDefault();
|
|
7446
8323
|
this.dismissed = true;
|
|
7447
8324
|
}
|
|
7448
8325
|
}
|
|
8326
|
+
/** Cheap guard so scroll frames do not measure while nothing is shown. */
|
|
8327
|
+
handleScroll() {
|
|
8328
|
+
if (this.visible && this.offset) {
|
|
8329
|
+
this.position();
|
|
8330
|
+
}
|
|
8331
|
+
}
|
|
8332
|
+
handleResize() {
|
|
8333
|
+
this.position();
|
|
8334
|
+
}
|
|
8335
|
+
watchViewport() {
|
|
8336
|
+
if (typeof window === 'undefined') {
|
|
8337
|
+
return;
|
|
8338
|
+
}
|
|
8339
|
+
const viewport = window.visualViewport;
|
|
8340
|
+
if (!viewport || this.cleanup) {
|
|
8341
|
+
return;
|
|
8342
|
+
}
|
|
8343
|
+
const update = () => this.position();
|
|
8344
|
+
viewport.addEventListener('resize', update);
|
|
8345
|
+
viewport.addEventListener('scroll', update);
|
|
8346
|
+
this.cleanup = () => {
|
|
8347
|
+
viewport.removeEventListener('resize', update);
|
|
8348
|
+
viewport.removeEventListener('scroll', update);
|
|
8349
|
+
};
|
|
8350
|
+
}
|
|
7449
8351
|
slotted(name) {
|
|
7450
8352
|
return Array.from(this.el.children).find(child => child.getAttribute('slot') === name);
|
|
7451
8353
|
}
|
|
8354
|
+
/**
|
|
8355
|
+
* Measures the anchor and the bubble and stores the offset that keeps the
|
|
8356
|
+
* bubble inside the viewport. Nothing is measured before the bubble has a
|
|
8357
|
+
* box to measure, so the pre-paint render uses plain CSS.
|
|
8358
|
+
*/
|
|
8359
|
+
position() {
|
|
8360
|
+
if (typeof window === 'undefined') {
|
|
8361
|
+
return;
|
|
8362
|
+
}
|
|
8363
|
+
const bubble = this.bubbleEl ?? (this.bubbleEl = this.el.shadowRoot?.querySelector('.bubble') ?? undefined);
|
|
8364
|
+
if (!bubble || bubble.offsetWidth === 0) {
|
|
8365
|
+
return;
|
|
8366
|
+
}
|
|
8367
|
+
const anchorRect = this.slotted('trigger')?.getBoundingClientRect?.();
|
|
8368
|
+
if (!anchorRect) {
|
|
8369
|
+
return;
|
|
8370
|
+
}
|
|
8371
|
+
const surface = {
|
|
8372
|
+
width: bubble.offsetWidth + horizontalMargin(bubble),
|
|
8373
|
+
height: bubble.offsetHeight,
|
|
8374
|
+
};
|
|
8375
|
+
const viewport = window.visualViewport;
|
|
8376
|
+
const { placement, top, left } = placeOverlay({
|
|
8377
|
+
anchor: { top: anchorRect.top, left: anchorRect.left, width: anchorRect.width, height: anchorRect.height },
|
|
8378
|
+
surface,
|
|
8379
|
+
viewport: viewport
|
|
8380
|
+
? { top: viewport.offsetTop, left: viewport.offsetLeft, width: viewport.width, height: viewport.height }
|
|
8381
|
+
: { top: 0, left: 0, width: window.innerWidth, height: window.innerHeight },
|
|
8382
|
+
preferred: this.placement,
|
|
8383
|
+
gap: GAP,
|
|
8384
|
+
});
|
|
8385
|
+
this.resolvedPlacement = placement;
|
|
8386
|
+
this.offset = { top, left };
|
|
8387
|
+
}
|
|
7452
8388
|
/**
|
|
7453
8389
|
* Points the trigger at the text with `aria-describedby`. Re-run on
|
|
7454
8390
|
* `slotchange` because a framework re-render can replace the slotted nodes
|
|
@@ -7467,7 +8403,16 @@ class ChTooltip {
|
|
|
7467
8403
|
trigger.setAttribute('aria-describedby', content.id);
|
|
7468
8404
|
};
|
|
7469
8405
|
render() {
|
|
7470
|
-
|
|
8406
|
+
const { offset } = this;
|
|
8407
|
+
return (hAsync(Host, { key: 'fb651dc0bf007fb86c9f69b2c714106520df4d4a' }, hAsync("span", { key: '74324b8e4c0b7c552255605c6aa4ae739e16d832', class: "anchor" }, hAsync("slot", { key: 'd4c2025af2d96b2ea4e7d8d601ce803be82a4a3e', name: "trigger", onSlotchange: this.associate }), hAsync("span", { key: 'f6561dce022d8d9d2d0fb2b6984591301483b1f3', ref: el => (this.bubbleEl = el), style: {
|
|
8408
|
+
'--ch-tooltip-offset-top': offset ? `${offset.top}px` : null,
|
|
8409
|
+
'--ch-tooltip-offset-left': offset ? `${offset.left}px` : null,
|
|
8410
|
+
}, class: {
|
|
8411
|
+
'bubble': true,
|
|
8412
|
+
'bubble--positioned': Boolean(this.offset),
|
|
8413
|
+
[`bubble--${this.resolvedPlacement ?? this.placement}`]: true,
|
|
8414
|
+
'bubble--visible': this.visible,
|
|
8415
|
+
} }, hAsync("slot", { key: 'a099d15660ea17211b4c50912842b3152e5f652c', name: "content", onSlotchange: this.associate })))));
|
|
7471
8416
|
}
|
|
7472
8417
|
static get style() { return chTooltipCss(); }
|
|
7473
8418
|
static get cmpMeta() { return {
|
|
@@ -7477,13 +8422,18 @@ class ChTooltip {
|
|
|
7477
8422
|
"placement": [1],
|
|
7478
8423
|
"hovered": [32],
|
|
7479
8424
|
"focused": [32],
|
|
7480
|
-
"dismissed": [32]
|
|
8425
|
+
"dismissed": [32],
|
|
8426
|
+
"resolvedPlacement": [32]
|
|
7481
8427
|
},
|
|
7482
|
-
"$listeners$": [[1, "mouseenter", "handleMouseEnter"], [1, "mouseleave", "handleMouseLeave"], [0, "focusin", "handleFocusIn"], [0, "focusout", "handleFocusOut"], [4, "keydown", "handleKeyDown"]],
|
|
8428
|
+
"$listeners$": [[1, "mouseenter", "handleMouseEnter"], [1, "mouseleave", "handleMouseLeave"], [0, "focusin", "handleFocusIn"], [0, "focusout", "handleFocusOut"], [4, "keydown", "handleKeyDown"], [11, "scroll", "handleScroll"], [9, "resize", "handleResize"]],
|
|
7483
8429
|
"$lazyBundleId$": "-",
|
|
7484
8430
|
"$attrsToReflect$": []
|
|
7485
8431
|
}; }
|
|
7486
8432
|
}
|
|
8433
|
+
function horizontalMargin(el) {
|
|
8434
|
+
const style = getComputedStyle(el);
|
|
8435
|
+
return (parseFloat(style.marginLeft) || 0) + (parseFloat(style.marginRight) || 0);
|
|
8436
|
+
}
|
|
7487
8437
|
|
|
7488
8438
|
registerComponents([
|
|
7489
8439
|
ChAccordion,
|
|
@@ -7492,16 +8442,24 @@ registerComponents([
|
|
|
7492
8442
|
ChButton,
|
|
7493
8443
|
ChCard,
|
|
7494
8444
|
ChCheckbox,
|
|
8445
|
+
ChCluster,
|
|
7495
8446
|
ChDivider,
|
|
7496
8447
|
ChDrawer,
|
|
7497
8448
|
ChEmoji,
|
|
8449
|
+
ChEmptyState,
|
|
8450
|
+
ChGrid,
|
|
8451
|
+
ChIcon,
|
|
8452
|
+
ChIconButton,
|
|
7498
8453
|
ChInput,
|
|
7499
8454
|
ChLink,
|
|
7500
8455
|
ChModal,
|
|
8456
|
+
ChPageHeader,
|
|
7501
8457
|
ChRadio,
|
|
7502
8458
|
ChSegmentedControl,
|
|
7503
8459
|
ChSelect,
|
|
8460
|
+
ChSkeleton,
|
|
7504
8461
|
ChSpinner,
|
|
8462
|
+
ChStack,
|
|
7505
8463
|
ChSwitch,
|
|
7506
8464
|
ChTabs,
|
|
7507
8465
|
ChTextarea,
|
|
@@ -7512,7 +8470,7 @@ exports.hydrateApp = hydrateApp;
|
|
|
7512
8470
|
|
|
7513
8471
|
|
|
7514
8472
|
/*hydrateAppClosure end*/
|
|
7515
|
-
hydrateApp(window, $stencilHydrateOpts, $stencilHydrateResults, $stencilAfterHydrate, $stencilHydrateResolve);
|
|
8473
|
+
hydrateApp(window, $stencilHydrateOpts, $stencilHydrateResults, $stencilAfterHydrate, $stencilHydrateResolve, $stencilAbortController);
|
|
7516
8474
|
}
|
|
7517
8475
|
|
|
7518
8476
|
hydrateAppClosure($stencilWindow);
|
|
@@ -7607,7 +8565,7 @@ var NAMESPACE = (
|
|
|
7607
8565
|
);
|
|
7608
8566
|
|
|
7609
8567
|
/*
|
|
7610
|
-
Stencil Hydrate Runner v4.
|
|
8568
|
+
Stencil Hydrate Runner v4.45.1 | MIT Licensed | https://stenciljs.com
|
|
7611
8569
|
*/
|
|
7612
8570
|
var __create = Object.create;
|
|
7613
8571
|
var __defProp = Object.defineProperty;
|
|
@@ -21754,11 +22712,14 @@ function resetWindow(win2) {
|
|
|
21754
22712
|
} catch (e) {
|
|
21755
22713
|
}
|
|
21756
22714
|
}
|
|
21757
|
-
|
|
21758
|
-
|
|
21759
|
-
|
|
21760
|
-
win2.
|
|
21761
|
-
win2.
|
|
22715
|
+
const windowDestroyed = () => {
|
|
22716
|
+
throw new Error("MockWindow was already destroyed");
|
|
22717
|
+
};
|
|
22718
|
+
win2.fetch = windowDestroyed;
|
|
22719
|
+
win2.Headers = windowDestroyed;
|
|
22720
|
+
win2.Request = windowDestroyed;
|
|
22721
|
+
win2.Response = windowDestroyed;
|
|
22722
|
+
win2.FetchError = windowDestroyed;
|
|
21762
22723
|
}
|
|
21763
22724
|
}
|
|
21764
22725
|
function resetWindowDimensions(win2) {
|
|
@@ -22158,9 +23119,6 @@ var _cssColonHostContextRe = new RegExp("(" + _polyfillHostContext + _parenSuffi
|
|
|
22158
23119
|
var _cssColonSlottedRe = new RegExp("(" + _polyfillSlotted + _parenSuffix, "gim");
|
|
22159
23120
|
var _polyfillHostNoCombinator = _polyfillHost + "-no-combinator";
|
|
22160
23121
|
|
|
22161
|
-
// src/runtime/mode.ts
|
|
22162
|
-
var setMode = (handler) => modeResolutionChain.push(handler);
|
|
22163
|
-
|
|
22164
23122
|
// src/utils/local-value.ts
|
|
22165
23123
|
var LocalValue = class _LocalValue {
|
|
22166
23124
|
type;
|
|
@@ -24237,6 +25195,37 @@ var relocateMetaCharset = (doc) => {
|
|
|
24237
25195
|
};
|
|
24238
25196
|
|
|
24239
25197
|
// src/compiler/style/css-parser/parse-css.ts
|
|
25198
|
+
var splitSelectorList = (selectors) => {
|
|
25199
|
+
const parts = [];
|
|
25200
|
+
let depth = 0;
|
|
25201
|
+
let quote = null;
|
|
25202
|
+
let start = 0;
|
|
25203
|
+
for (let i = 0; i < selectors.length; i++) {
|
|
25204
|
+
const ch = selectors[i];
|
|
25205
|
+
if (quote) {
|
|
25206
|
+
if (ch === "\\") {
|
|
25207
|
+
i++;
|
|
25208
|
+
} else if (ch === quote) {
|
|
25209
|
+
quote = null;
|
|
25210
|
+
}
|
|
25211
|
+
continue;
|
|
25212
|
+
}
|
|
25213
|
+
if (ch === '"' || ch === "'") {
|
|
25214
|
+
quote = ch;
|
|
25215
|
+
} else if (ch === "\\") {
|
|
25216
|
+
i++;
|
|
25217
|
+
} else if (ch === "(") {
|
|
25218
|
+
depth++;
|
|
25219
|
+
} else if (ch === ")") {
|
|
25220
|
+
depth = Math.max(0, depth - 1);
|
|
25221
|
+
} else if (ch === "," && depth === 0) {
|
|
25222
|
+
parts.push(selectors.slice(start, i));
|
|
25223
|
+
start = i + 1;
|
|
25224
|
+
}
|
|
25225
|
+
}
|
|
25226
|
+
parts.push(selectors.slice(start));
|
|
25227
|
+
return parts.map((s) => s.trim());
|
|
25228
|
+
};
|
|
24240
25229
|
var parseCss = (css, filePath) => {
|
|
24241
25230
|
let lineno = 1;
|
|
24242
25231
|
let column = 1;
|
|
@@ -24358,11 +25347,8 @@ var parseCss = (css, filePath) => {
|
|
|
24358
25347
|
const selector = () => {
|
|
24359
25348
|
const m = match2(/^([^{]+)/);
|
|
24360
25349
|
if (!m) return null;
|
|
24361
|
-
|
|
24362
|
-
|
|
24363
|
-
}).split(/\s*(?![^(]*\)),\s*/).map(function(s) {
|
|
24364
|
-
return s.replace(/\u200C/g, ",");
|
|
24365
|
-
});
|
|
25350
|
+
const cleaned = trim(m[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g, "");
|
|
25351
|
+
return splitSelectorList(cleaned);
|
|
24366
25352
|
};
|
|
24367
25353
|
const declaration = () => {
|
|
24368
25354
|
const pos = position();
|
|
@@ -25536,10 +26522,6 @@ async function render2(win2, opts, results) {
|
|
|
25536
26522
|
try {
|
|
25537
26523
|
await Promise.resolve(beforeHydrateFn(win2.document));
|
|
25538
26524
|
return new Promise((resolve) => {
|
|
25539
|
-
if (Array.isArray(opts.modes)) {
|
|
25540
|
-
modeResolutionChain.length = 0;
|
|
25541
|
-
opts.modes.forEach((mode) => setMode(mode));
|
|
25542
|
-
}
|
|
25543
26525
|
return hydrateFactory(win2, opts, results, afterHydrate, resolve);
|
|
25544
26526
|
});
|
|
25545
26527
|
} catch (e) {
|