@devschile/chucao 2.4.0 → 2.6.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/index.esm.js +1 -1
- package/dist/chucao/index.esm.js.map +1 -1
- package/dist/chucao/p-0409c063.entry.js +2 -0
- package/dist/chucao/p-0409c063.entry.js.map +1 -0
- package/dist/chucao/{p-1ebd9dc4.entry.js → p-090d26f1.entry.js} +2 -2
- package/dist/chucao/{p-84d875e9.entry.js → p-207648f9.entry.js} +2 -2
- package/dist/chucao/{p-b5552b50.entry.js → p-20ea1b18.entry.js} +2 -2
- package/dist/chucao/p-21ca2235.entry.js +2 -0
- package/dist/chucao/p-21ca2235.entry.js.map +1 -0
- package/dist/chucao/{p-1778a313.entry.js → p-2c1bc8bd.entry.js} +2 -2
- package/dist/chucao/{p-6e95f31f.entry.js → p-337d7f68.entry.js} +2 -2
- package/dist/chucao/p-370d9629.entry.js +2 -0
- package/dist/chucao/p-370d9629.entry.js.map +1 -0
- package/dist/chucao/{p-d0533af6.entry.js → p-50cbea7f.entry.js} +2 -2
- package/dist/chucao/p-66ae9e2c.entry.js +2 -0
- package/dist/chucao/p-66ae9e2c.entry.js.map +1 -0
- package/dist/chucao/p-79f20bfd.entry.js +2 -0
- package/dist/chucao/p-79f20bfd.entry.js.map +1 -0
- package/dist/chucao/{p-56d64d84.entry.js → p-7d4336bd.entry.js} +2 -2
- package/dist/chucao/p-81b6622f.entry.js +2 -0
- package/dist/chucao/p-81b6622f.entry.js.map +1 -0
- package/dist/chucao/{p-17451d92.entry.js → p-925af6b8.entry.js} +2 -2
- package/dist/chucao/p-95061461.entry.js +2 -0
- package/dist/chucao/{p-34a9d1f4.entry.js → p-9794a3fa.entry.js} +2 -2
- 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-85db779c.entry.js → p-b56f4a29.entry.js} +2 -2
- package/dist/chucao/p-b9b47942.entry.js +2 -0
- package/dist/chucao/p-b9b47942.entry.js.map +1 -0
- package/dist/chucao/{p-449e1ba0.entry.js → p-c1b35f1b.entry.js} +2 -2
- package/dist/chucao/{p-0e3c83a6.entry.js → p-e2f725bd.entry.js} +2 -2
- package/dist/chucao/{p-7c85f5fe.entry.js → p-e6f959f4.entry.js} +2 -2
- package/dist/chucao/{p-907195ff.entry.js → p-f0aea6ed.entry.js} +2 -2
- package/dist/chucao/{p-a07e0e97.entry.js → p-f7305552.entry.js} +2 -2
- package/dist/chucao/p-ffaf1a31.entry.js +2 -0
- package/dist/chucao/p-ffaf1a31.entry.js.map +1 -0
- package/dist/cjs/ch-accordion.cjs.entry.js +2 -2
- package/dist/cjs/ch-alert_8.cjs.entry.js +34 -10
- package/dist/cjs/ch-alert_8.cjs.entry.js.map +1 -1
- package/dist/cjs/ch-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/ch-cluster.cjs.entry.js +3 -3
- package/dist/cjs/ch-description-list.cjs.entry.js +29 -0
- package/dist/cjs/ch-description-list.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-divider.cjs.entry.js +2 -2
- package/dist/cjs/ch-drawer.cjs.entry.js +2 -2
- package/dist/cjs/ch-emoji.cjs.entry.js +2 -2
- package/dist/cjs/ch-empty-state.cjs.entry.js +2 -2
- package/dist/cjs/ch-grid.cjs.entry.js +2 -2
- package/dist/cjs/ch-icon-button.cjs.entry.js +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 +2 -2
- 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 +2 -2
- package/dist/cjs/ch-segmented-control.cjs.entry.js +2 -2
- package/dist/cjs/ch-skeleton.cjs.entry.js +2 -2
- package/dist/cjs/ch-stack.cjs.entry.js +2 -2
- package/dist/cjs/ch-stat.cjs.entry.js +46 -0
- package/dist/cjs/ch-stat.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-tabs.cjs.entry.js +2 -2
- package/dist/cjs/ch-textarea.cjs.entry.js +2 -2
- package/dist/cjs/ch-timeline.cjs.entry.js +20 -0
- package/dist/cjs/ch-timeline.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-tooltip.cjs.entry.js +206 -5
- package/dist/cjs/ch-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/chucao.cjs.js +2 -2
- package/dist/cjs/icons-CNyDgV-q.js +88 -0
- package/dist/cjs/icons-CNyDgV-q.js.map +1 -0
- package/dist/cjs/{index-ysucLiAq.js → index-ByZY6aTj.js} +81 -5
- 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/collection/collection-manifest.json +12 -6
- package/dist/collection/components/ch-accordion/ch-accordion.js +1 -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-card/ch-card.js +1 -1
- package/dist/collection/components/ch-checkbox/ch-checkbox.js +1 -1
- package/dist/collection/components/ch-cluster/ch-cluster.js +2 -2
- package/dist/collection/components/ch-description-list/ch-description-list.css +60 -0
- package/dist/collection/components/ch-description-list/ch-description-list.js +78 -0
- package/dist/collection/components/ch-description-list/ch-description-list.js.map +1 -0
- package/dist/collection/components/ch-divider/ch-divider.js +1 -1
- package/dist/collection/components/ch-drawer/ch-drawer.js +1 -1
- package/dist/collection/components/ch-emoji/ch-emoji.js +1 -1
- package/dist/collection/components/ch-empty-state/ch-empty-state.js +1 -1
- package/dist/collection/components/ch-grid/ch-grid.js +1 -1
- package/dist/collection/components/ch-icon/ch-icon.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 +1 -1
- package/dist/collection/components/ch-modal/ch-modal.js +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 +1 -1
- package/dist/collection/components/ch-segmented-control/ch-segmented-control.js +1 -1
- package/dist/collection/components/ch-select/ch-select.js +1 -1
- package/dist/collection/components/ch-skeleton/ch-skeleton.js +1 -1
- package/dist/collection/components/ch-spinner/ch-spinner.js +1 -1
- package/dist/collection/components/ch-stack/ch-stack.js +1 -1
- package/dist/collection/components/ch-stat/ch-stat.css +68 -0
- package/dist/collection/components/ch-stat/ch-stat.js +151 -0
- package/dist/collection/components/ch-stat/ch-stat.js.map +1 -0
- package/dist/collection/components/ch-switch/ch-switch.js +1 -1
- package/dist/collection/components/ch-tabs/ch-tabs.js +1 -1
- package/dist/collection/components/ch-textarea/ch-textarea.js +1 -1
- package/dist/collection/components/ch-timeline/ch-timeline.css +54 -0
- package/dist/collection/components/ch-timeline/ch-timeline.js +43 -0
- package/dist/collection/components/ch-timeline/ch-timeline.js.map +1 -0
- package/dist/collection/components/ch-tooltip/ch-tooltip.css +29 -1
- package/dist/collection/components/ch-tooltip/ch-tooltip.js +127 -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/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/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-card.js +1 -1
- package/dist/components/ch-card.js.map +1 -1
- package/dist/components/ch-checkbox.js +1 -1
- package/dist/components/ch-cluster.js +1 -1
- package/dist/components/ch-description-list.d.ts +11 -0
- package/dist/components/ch-description-list.js +2 -0
- package/dist/components/ch-description-list.js.map +1 -0
- package/dist/components/ch-divider.js +1 -1
- package/dist/components/ch-drawer.js +1 -1
- package/dist/components/ch-emoji.js +1 -1
- package/dist/components/ch-empty-state.js +1 -1
- package/dist/components/ch-grid.js +1 -1
- package/dist/components/ch-icon-button.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-link.js +1 -1
- package/dist/components/ch-modal.js +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-segmented-control.js +1 -1
- package/dist/components/ch-select.js +1 -1
- package/dist/components/ch-skeleton.js +1 -1
- package/dist/components/ch-spinner.js +1 -1
- package/dist/components/ch-stack.js +1 -1
- package/dist/components/ch-stat.d.ts +11 -0
- package/dist/components/ch-stat.js +2 -0
- package/dist/components/ch-stat.js.map +1 -0
- package/dist/components/ch-switch.js +1 -1
- package/dist/components/ch-tabs.js +1 -1
- package/dist/components/ch-textarea.js +1 -1
- package/dist/components/ch-timeline.d.ts +11 -0
- package/dist/components/ch-timeline.js +2 -0
- package/dist/components/ch-timeline.js.map +1 -0
- 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-CnivhwvG.js +2 -0
- package/dist/components/p-CnivhwvG.js.map +1 -0
- package/dist/components/{p-no2_9Jk-.js → p-Cw0b4OGc.js} +2 -2
- 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 +2 -2
- package/dist/esm/ch-alert_8.entry.js +34 -10
- package/dist/esm/ch-alert_8.entry.js.map +1 -1
- package/dist/esm/ch-checkbox.entry.js +2 -2
- package/dist/esm/ch-cluster.entry.js +3 -3
- package/dist/esm/ch-description-list.entry.js +27 -0
- package/dist/esm/ch-description-list.entry.js.map +1 -0
- package/dist/esm/ch-divider.entry.js +2 -2
- package/dist/esm/ch-drawer.entry.js +2 -2
- package/dist/esm/ch-emoji.entry.js +2 -2
- package/dist/esm/ch-empty-state.entry.js +2 -2
- package/dist/esm/ch-grid.entry.js +2 -2
- package/dist/esm/ch-icon-button.entry.js +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 +2 -2
- 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 +2 -2
- package/dist/esm/ch-segmented-control.entry.js +2 -2
- package/dist/esm/ch-skeleton.entry.js +2 -2
- package/dist/esm/ch-stack.entry.js +2 -2
- package/dist/esm/ch-stat.entry.js +44 -0
- package/dist/esm/ch-stat.entry.js.map +1 -0
- package/dist/esm/ch-tabs.entry.js +2 -2
- package/dist/esm/ch-textarea.entry.js +2 -2
- package/dist/esm/ch-timeline.entry.js +18 -0
- package/dist/esm/ch-timeline.entry.js.map +1 -0
- package/dist/esm/ch-tooltip.entry.js +206 -5
- package/dist/esm/ch-tooltip.entry.js.map +1 -1
- package/dist/esm/chucao.js +3 -3
- package/dist/esm/icons-CnivhwvG.js +86 -0
- package/dist/esm/icons-CnivhwvG.js.map +1 -0
- package/dist/esm/{index-DVKZbUp9.js → index-CIV5Gg1o.js} +81 -6
- 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/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-description-list/ch-description-list.d.ts +30 -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-page-header/ch-page-header.d.ts +39 -0
- package/dist/types/components/ch-stat/ch-stat.d.ts +42 -0
- package/dist/types/components/ch-timeline/ch-timeline.d.ts +27 -0
- package/dist/types/components/ch-tooltip/ch-tooltip.d.ts +34 -2
- package/dist/types/components.d.ts +718 -2
- package/dist/types/tokens/tokens.d.ts +12 -0
- package/dist/types/tokens/types.d.ts +2 -1
- package/dist/types/utils/icons.d.ts +15 -0
- package/dist/types/utils/overlay.d.ts +49 -0
- package/dist-react/components.d.ts +21 -1
- package/dist-react/components.js +54 -0
- package/dist-react/components.ts +73 -1
- package/dist-vue/index.d.ts +6 -0
- package/dist-vue/index.js +42 -1
- package/dist-vue/index.ts +54 -1
- package/hydrate/index.js +772 -35
- package/hydrate/index.mjs +772 -35
- package/package.json +104 -5
- package/dist/chucao/p-82216381.entry.js +0 -2
- package/dist/chucao/p-82216381.entry.js.map +0 -1
- package/dist/chucao/p-DVKZbUp9.js +0 -3
- package/dist/chucao/p-DVKZbUp9.js.map +0 -1
- package/dist/chucao/p-b392021c.entry.js +0 -2
- package/dist/chucao/p-b392021c.entry.js.map +0 -1
- package/dist/chucao/p-d776b092.entry.js +0 -2
- package/dist/cjs/index-ysucLiAq.js.map +0 -1
- package/dist/components/p-DQOKq7af.js +0 -2
- package/dist/components/p-DQOKq7af.js.map +0 -1
- package/dist/esm/index-DVKZbUp9.js.map +0 -1
- /package/dist/chucao/{p-1ebd9dc4.entry.js.map → p-090d26f1.entry.js.map} +0 -0
- /package/dist/chucao/{p-84d875e9.entry.js.map → p-207648f9.entry.js.map} +0 -0
- /package/dist/chucao/{p-b5552b50.entry.js.map → p-20ea1b18.entry.js.map} +0 -0
- /package/dist/chucao/{p-1778a313.entry.js.map → p-2c1bc8bd.entry.js.map} +0 -0
- /package/dist/chucao/{p-6e95f31f.entry.js.map → p-337d7f68.entry.js.map} +0 -0
- /package/dist/chucao/{p-d0533af6.entry.js.map → p-50cbea7f.entry.js.map} +0 -0
- /package/dist/chucao/{p-56d64d84.entry.js.map → p-7d4336bd.entry.js.map} +0 -0
- /package/dist/chucao/{p-17451d92.entry.js.map → p-925af6b8.entry.js.map} +0 -0
- /package/dist/chucao/{p-d776b092.entry.js.map → p-95061461.entry.js.map} +0 -0
- /package/dist/chucao/{p-34a9d1f4.entry.js.map → p-9794a3fa.entry.js.map} +0 -0
- /package/dist/chucao/{p-85db779c.entry.js.map → p-b56f4a29.entry.js.map} +0 -0
- /package/dist/chucao/{p-449e1ba0.entry.js.map → p-c1b35f1b.entry.js.map} +0 -0
- /package/dist/chucao/{p-0e3c83a6.entry.js.map → p-e2f725bd.entry.js.map} +0 -0
- /package/dist/chucao/{p-7c85f5fe.entry.js.map → p-e6f959f4.entry.js.map} +0 -0
- /package/dist/chucao/{p-907195ff.entry.js.map → p-f0aea6ed.entry.js.map} +0 -0
- /package/dist/chucao/{p-a07e0e97.entry.js.map → p-f7305552.entry.js.map} +0 -0
- /package/dist/components/{p-no2_9Jk-.js.map → p-Cw0b4OGc.js.map} +0 -0
package/hydrate/index.mjs
CHANGED
|
@@ -423,6 +423,10 @@ var require_brace_expansion = __commonJS({
|
|
|
423
423
|
}
|
|
424
424
|
}
|
|
425
425
|
});
|
|
426
|
+
|
|
427
|
+
// src/utils/constants.ts
|
|
428
|
+
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
429
|
+
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
426
430
|
var PrimitiveType = /* @__PURE__ */ ((PrimitiveType2) => {
|
|
427
431
|
PrimitiveType2["Undefined"] = "undefined";
|
|
428
432
|
PrimitiveType2["Null"] = "null";
|
|
@@ -839,6 +843,13 @@ var h = (nodeName, vnodeData, ...children) => {
|
|
|
839
843
|
}
|
|
840
844
|
}
|
|
841
845
|
}
|
|
846
|
+
if (typeof nodeName === "function") {
|
|
847
|
+
return nodeName(
|
|
848
|
+
vnodeData === null ? {} : vnodeData,
|
|
849
|
+
vNodeChildren,
|
|
850
|
+
vdomFnUtils
|
|
851
|
+
);
|
|
852
|
+
}
|
|
842
853
|
const vnode = newVNode(nodeName, null);
|
|
843
854
|
vnode.$attrs$ = vnodeData;
|
|
844
855
|
if (vNodeChildren.length > 0) {
|
|
@@ -874,6 +885,36 @@ var newVNode = (tag, text) => {
|
|
|
874
885
|
};
|
|
875
886
|
var Host = {};
|
|
876
887
|
var isHost = (node) => node && node.$tag$ === Host;
|
|
888
|
+
var vdomFnUtils = {
|
|
889
|
+
forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
|
|
890
|
+
map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate)
|
|
891
|
+
};
|
|
892
|
+
var convertToPublic = (node) => ({
|
|
893
|
+
vattrs: node.$attrs$,
|
|
894
|
+
vchildren: node.$children$,
|
|
895
|
+
vkey: node.$key$,
|
|
896
|
+
vname: node.$name$,
|
|
897
|
+
vtag: node.$tag$,
|
|
898
|
+
vtext: node.$text$
|
|
899
|
+
});
|
|
900
|
+
var convertToPrivate = (node) => {
|
|
901
|
+
if (typeof node.vtag === "function") {
|
|
902
|
+
const vnodeData = { ...node.vattrs };
|
|
903
|
+
if (node.vkey) {
|
|
904
|
+
vnodeData.key = node.vkey;
|
|
905
|
+
}
|
|
906
|
+
if (node.vname) {
|
|
907
|
+
vnodeData.name = node.vname;
|
|
908
|
+
}
|
|
909
|
+
return h(node.vtag, vnodeData, ...node.vchildren || []);
|
|
910
|
+
}
|
|
911
|
+
const vnode = newVNode(node.vtag, node.vtext);
|
|
912
|
+
vnode.$attrs$ = node.vattrs;
|
|
913
|
+
vnode.$children$ = node.vchildren;
|
|
914
|
+
vnode.$key$ = node.vkey;
|
|
915
|
+
vnode.$name$ = node.vname;
|
|
916
|
+
return vnode;
|
|
917
|
+
};
|
|
877
918
|
|
|
878
919
|
// src/runtime/client-hydrate.ts
|
|
879
920
|
var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
@@ -2088,12 +2129,19 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
2088
2129
|
updateElement(null, newVNode2, isSvgMode);
|
|
2089
2130
|
}
|
|
2090
2131
|
} else {
|
|
2132
|
+
if (!isSvgMode) {
|
|
2133
|
+
isSvgMode = newVNode2.$tag$ === "svg";
|
|
2134
|
+
}
|
|
2091
2135
|
if (!win.document) {
|
|
2092
2136
|
throw new Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");
|
|
2093
2137
|
}
|
|
2094
|
-
elm = newVNode2.$elm$ = win.document.
|
|
2138
|
+
elm = newVNode2.$elm$ = win.document.createElementNS(
|
|
2139
|
+
isSvgMode ? SVG_NS : HTML_NS,
|
|
2095
2140
|
!useNativeShadowDom && BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
2096
|
-
);
|
|
2141
|
+
) ;
|
|
2142
|
+
if (isSvgMode && newVNode2.$tag$ === "foreignObject") {
|
|
2143
|
+
isSvgMode = false;
|
|
2144
|
+
}
|
|
2097
2145
|
{
|
|
2098
2146
|
updateElement(null, newVNode2, isSvgMode);
|
|
2099
2147
|
}
|
|
@@ -2109,6 +2157,13 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
2109
2157
|
}
|
|
2110
2158
|
}
|
|
2111
2159
|
}
|
|
2160
|
+
{
|
|
2161
|
+
if (newVNode2.$tag$ === "svg") {
|
|
2162
|
+
isSvgMode = false;
|
|
2163
|
+
} else if (elm.tagName === "foreignObject") {
|
|
2164
|
+
isSvgMode = true;
|
|
2165
|
+
}
|
|
2166
|
+
}
|
|
2112
2167
|
}
|
|
2113
2168
|
elm["s-hn"] = hostTagName;
|
|
2114
2169
|
{
|
|
@@ -2333,6 +2388,9 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
2333
2388
|
const text = newVNode2.$text$;
|
|
2334
2389
|
let defaultHolder;
|
|
2335
2390
|
if (text == null) {
|
|
2391
|
+
{
|
|
2392
|
+
isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
|
|
2393
|
+
}
|
|
2336
2394
|
{
|
|
2337
2395
|
if (tag === "slot" && !useNativeShadowDom) {
|
|
2338
2396
|
if (oldVNode.$name$ !== newVNode2.$name$) {
|
|
@@ -2357,6 +2415,9 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
2357
2415
|
} else if (isInitialRender && BUILD.updatable && oldChildren !== null && newChildren === null) {
|
|
2358
2416
|
newVNode2.$children$ = oldChildren;
|
|
2359
2417
|
}
|
|
2418
|
+
if (isSvgMode && tag === "svg") {
|
|
2419
|
+
isSvgMode = false;
|
|
2420
|
+
}
|
|
2360
2421
|
} else if ((defaultHolder = elm["s-cr"])) {
|
|
2361
2422
|
defaultHolder.parentNode.textContent = text;
|
|
2362
2423
|
} else if (oldVNode.$text$ !== text) {
|
|
@@ -3137,6 +3198,9 @@ var getHostListenerTarget = (doc, elm, flags) => {
|
|
|
3137
3198
|
if (flags & 4 /* TargetDocument */) {
|
|
3138
3199
|
return doc;
|
|
3139
3200
|
}
|
|
3201
|
+
if (flags & 8 /* TargetWindow */) {
|
|
3202
|
+
return win;
|
|
3203
|
+
}
|
|
3140
3204
|
return elm;
|
|
3141
3205
|
};
|
|
3142
3206
|
var hostListenerOpts = (flags) => (flags & 2 /* Capture */) !== 0;
|
|
@@ -5434,7 +5498,7 @@ class ChAccordion {
|
|
|
5434
5498
|
this.chChange.emit(this.value);
|
|
5435
5499
|
};
|
|
5436
5500
|
render() {
|
|
5437
|
-
return (hAsync(Host, { key: '
|
|
5501
|
+
return (hAsync(Host, { key: '83cb1bb02baec54767edde0241c9f784b35cf336' }, this.items.map(item => {
|
|
5438
5502
|
const open = this.value === item.value;
|
|
5439
5503
|
return (hAsync("div", { key: item.value, class: { 'item': true, 'item--open': open } }, hAsync("h3", { class: "item-head" }, hAsync("button", { type: "button", class: "item-toggle", id: this.headerId(item.value), "data-value": item.value, "aria-expanded": open ? 'true' : 'false', "aria-controls": this.panelId(item.value), disabled: item.disabled, onClick: () => this.toggle(item.value) }, item.title)), hAsync("div", { class: "item-panel", id: this.panelId(item.value), role: "region", "aria-labelledby": this.headerId(item.value), hidden: !open }, hAsync("slot", { name: `panel-${item.value}` }))));
|
|
5440
5504
|
})));
|
|
@@ -5453,8 +5517,100 @@ class ChAccordion {
|
|
|
5453
5517
|
}; }
|
|
5454
5518
|
}
|
|
5455
5519
|
|
|
5456
|
-
const
|
|
5520
|
+
const chIcons = {
|
|
5521
|
+
alert: [
|
|
5522
|
+
{ 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' } },
|
|
5523
|
+
{ tag: 'path', attrs: { d: 'M12 9v4' } },
|
|
5524
|
+
{ tag: 'path', attrs: { d: 'M12 17h.01' } },
|
|
5525
|
+
],
|
|
5526
|
+
arrowRight: [
|
|
5527
|
+
{ tag: 'path', attrs: { d: 'M5 12h14' } },
|
|
5528
|
+
{ tag: 'path', attrs: { d: 'm12 5 7 7-7 7' } },
|
|
5529
|
+
],
|
|
5530
|
+
check: [{ tag: 'path', attrs: { d: 'M20 6 9 17l-5-5' } }],
|
|
5531
|
+
chevronDown: [{ tag: 'path', attrs: { d: 'm6 9 6 6 6-6' } }],
|
|
5532
|
+
chevronRight: [{ tag: 'path', attrs: { d: 'm9 18 6-6-6-6' } }],
|
|
5533
|
+
close: [
|
|
5534
|
+
{ tag: 'path', attrs: { d: 'M18 6 6 18' } },
|
|
5535
|
+
{ tag: 'path', attrs: { d: 'm6 6 12 12' } },
|
|
5536
|
+
],
|
|
5537
|
+
copy: [
|
|
5538
|
+
{ tag: 'rect', attrs: { width: '14', height: '14', x: '8', y: '8', rx: '2', ry: '2' } },
|
|
5539
|
+
{ 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' } },
|
|
5540
|
+
],
|
|
5541
|
+
delete: [
|
|
5542
|
+
{ tag: 'path', attrs: { d: 'M10 11v6' } },
|
|
5543
|
+
{ tag: 'path', attrs: { d: 'M14 11v6' } },
|
|
5544
|
+
{ tag: 'path', attrs: { d: 'M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6' } },
|
|
5545
|
+
{ tag: 'path', attrs: { d: 'M3 6h18' } },
|
|
5546
|
+
{ tag: 'path', attrs: { d: 'M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2' } },
|
|
5547
|
+
],
|
|
5548
|
+
download: [
|
|
5549
|
+
{ tag: 'path', attrs: { d: 'M12 15V3' } },
|
|
5550
|
+
{ tag: 'path', attrs: { d: 'M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4' } },
|
|
5551
|
+
{ tag: 'path', attrs: { d: 'm7 10 5 5 5-5' } },
|
|
5552
|
+
],
|
|
5553
|
+
error: [
|
|
5554
|
+
{ tag: 'circle', attrs: { cx: '12', cy: '12', r: '10' } },
|
|
5555
|
+
{ tag: 'line', attrs: {} },
|
|
5556
|
+
{ tag: 'line', attrs: {} },
|
|
5557
|
+
],
|
|
5558
|
+
externalLink: [
|
|
5559
|
+
{ tag: 'path', attrs: { d: 'M15 3h6v6' } },
|
|
5560
|
+
{ tag: 'path', attrs: { d: 'M10 14 21 3' } },
|
|
5561
|
+
{ tag: 'path', attrs: { d: 'M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6' } },
|
|
5562
|
+
],
|
|
5563
|
+
info: [
|
|
5564
|
+
{ tag: 'circle', attrs: { cx: '12', cy: '12', r: '10' } },
|
|
5565
|
+
{ tag: 'path', attrs: { d: 'M12 16v-4' } },
|
|
5566
|
+
{ tag: 'path', attrs: { d: 'M12 8h.01' } },
|
|
5567
|
+
],
|
|
5568
|
+
menu: [
|
|
5569
|
+
{ tag: 'path', attrs: { d: 'M4 5h16' } },
|
|
5570
|
+
{ tag: 'path', attrs: { d: 'M4 12h16' } },
|
|
5571
|
+
{ tag: 'path', attrs: { d: 'M4 19h16' } },
|
|
5572
|
+
],
|
|
5573
|
+
plus: [
|
|
5574
|
+
{ tag: 'path', attrs: { d: 'M5 12h14' } },
|
|
5575
|
+
{ tag: 'path', attrs: { d: 'M12 5v14' } },
|
|
5576
|
+
],
|
|
5577
|
+
search: [
|
|
5578
|
+
{ tag: 'path', attrs: { d: 'm21 21-4.34-4.34' } },
|
|
5579
|
+
{ tag: 'circle', attrs: { cx: '11', cy: '11', r: '8' } },
|
|
5580
|
+
],
|
|
5581
|
+
spinner: [
|
|
5582
|
+
{ tag: 'path', attrs: { d: 'M12 2v4' } },
|
|
5583
|
+
{ tag: 'path', attrs: { d: 'm16.2 7.8 2.9-2.9' } },
|
|
5584
|
+
{ tag: 'path', attrs: { d: 'M18 12h4' } },
|
|
5585
|
+
{ tag: 'path', attrs: { d: 'm16.2 16.2 2.9 2.9' } },
|
|
5586
|
+
{ tag: 'path', attrs: { d: 'M12 18v4' } },
|
|
5587
|
+
{ tag: 'path', attrs: { d: 'm4.9 19.1 2.9-2.9' } },
|
|
5588
|
+
{ tag: 'path', attrs: { d: 'M2 12h4' } },
|
|
5589
|
+
{ tag: 'path', attrs: { d: 'm4.9 4.9 2.9 2.9' } },
|
|
5590
|
+
],
|
|
5591
|
+
success: [
|
|
5592
|
+
{ tag: 'circle', attrs: { cx: '12', cy: '12', r: '10' } },
|
|
5593
|
+
{ tag: 'path', attrs: { d: 'm16 9-5.5 5.5L8 12' } },
|
|
5594
|
+
],
|
|
5595
|
+
upload: [
|
|
5596
|
+
{ tag: 'path', attrs: { d: 'M12 3v12' } },
|
|
5597
|
+
{ tag: 'path', attrs: { d: 'm17 8-5-5-5 5' } },
|
|
5598
|
+
{ tag: 'path', attrs: { d: 'M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4' } },
|
|
5599
|
+
],
|
|
5600
|
+
};
|
|
5601
|
+
|
|
5602
|
+
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}}`;
|
|
5457
5603
|
|
|
5604
|
+
/**
|
|
5605
|
+
* The glyph paired with each variant. It is what makes the variants
|
|
5606
|
+
* distinguishable without colour: `default` is informational, `positive`
|
|
5607
|
+
* confirms and `warning` warns, and each reads differently in grayscale.
|
|
5608
|
+
*/
|
|
5609
|
+
const VARIANT_ICON = {
|
|
5610
|
+
default: 'info',
|
|
5611
|
+
positive: 'success',
|
|
5612
|
+
warning: 'alert',
|
|
5613
|
+
};
|
|
5458
5614
|
/**
|
|
5459
5615
|
* Block-level status message.
|
|
5460
5616
|
*
|
|
@@ -5463,6 +5619,11 @@ const chAlertCss = () => `:host{display:block}.alert{display:flex;align-items:fl
|
|
|
5463
5619
|
* interrupt. Both announce reliably when the alert is added to the page in
|
|
5464
5620
|
* response to something — an alert already present at load may not be read out,
|
|
5465
5621
|
* which is how live regions work rather than something this component controls.
|
|
5622
|
+
*
|
|
5623
|
+
* Every variant also carries an icon and a thicker leading edge, so the three
|
|
5624
|
+
* states stay distinguishable without colour vision. The icon is decorative:
|
|
5625
|
+
* the text next to it already says what happened, and announcing "check
|
|
5626
|
+
* circle" before it would only add noise.
|
|
5466
5627
|
*/
|
|
5467
5628
|
class ChAlert {
|
|
5468
5629
|
constructor(hostRef) {
|
|
@@ -5481,6 +5642,12 @@ class ChAlert {
|
|
|
5481
5642
|
* so without a label it would have no accessible name at all.
|
|
5482
5643
|
*/
|
|
5483
5644
|
dismissLabel;
|
|
5645
|
+
/**
|
|
5646
|
+
* Whether to show the variant's icon. On by default so the status is not
|
|
5647
|
+
* colour-only; turn it off when the surrounding copy already carries the cue
|
|
5648
|
+
* and a second marker would be redundant.
|
|
5649
|
+
*/
|
|
5650
|
+
statusCue = true;
|
|
5484
5651
|
/**
|
|
5485
5652
|
* Emitted when the dismiss button is clicked. The alert stays in the DOM —
|
|
5486
5653
|
* whether to remove it is the consumer's decision. If you do remove it, move
|
|
@@ -5493,7 +5660,8 @@ class ChAlert {
|
|
|
5493
5660
|
};
|
|
5494
5661
|
render() {
|
|
5495
5662
|
const role = this.variant === 'warning' ? 'alert' : 'status';
|
|
5496
|
-
|
|
5663
|
+
const shapes = this.statusCue ? chIcons[VARIANT_ICON[this.variant]] : undefined;
|
|
5664
|
+
return (hAsync(Host, { key: 'a3b0af93e0fd59c088575c1a56265698ca2836b0' }, hAsync("div", { key: role, class: { alert: true, [`alert--${this.variant}`]: true }, role: role }, shapes && (hAsync("svg", { key: '7bceb09ba57e6b6d2344cb88476f8327c215941d', 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: '0e936cb51c852ab375b32b4fd5bcf3e275f56d21', class: "alert-content" }, hAsync("slot", { key: 'f29a5e218b900718505908b0c6731403414eacda' })), this.dismissLabel && (hAsync("button", { key: 'fe80820757f3fe2f76d44f6227f9ce6e0774cb30', class: "alert-dismiss", type: "button", "aria-label": this.dismissLabel, onClick: this.handleDismiss }, hAsync("span", { key: 'eb8110f89d6fb3f080f78a8b2e2569f2050bd91d', "aria-hidden": "true" }, "\u00D7"))))));
|
|
5497
5665
|
}
|
|
5498
5666
|
static get style() { return chAlertCss(); }
|
|
5499
5667
|
static get cmpMeta() { return {
|
|
@@ -5501,7 +5669,8 @@ class ChAlert {
|
|
|
5501
5669
|
"$tagName$": "ch-alert",
|
|
5502
5670
|
"$members$": {
|
|
5503
5671
|
"variant": [1],
|
|
5504
|
-
"dismissLabel": [1, "dismiss-label"]
|
|
5672
|
+
"dismissLabel": [1, "dismiss-label"],
|
|
5673
|
+
"statusCue": [4, "status-cue"]
|
|
5505
5674
|
},
|
|
5506
5675
|
"$listeners$": undefined,
|
|
5507
5676
|
"$lazyBundleId$": "-",
|
|
@@ -5509,8 +5678,16 @@ class ChAlert {
|
|
|
5509
5678
|
}; }
|
|
5510
5679
|
}
|
|
5511
5680
|
|
|
5512
|
-
const chBadgeCss = () => `:host{display:inline-block}.badge{display:inline-
|
|
5681
|
+
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}`;
|
|
5513
5682
|
|
|
5683
|
+
/**
|
|
5684
|
+
* Small status label.
|
|
5685
|
+
*
|
|
5686
|
+
* Variants are not colour-only: each one also changes the leading dot's shape
|
|
5687
|
+
* and adds a matching border, so a badge still says which state it is in when
|
|
5688
|
+
* printed in grayscale or seen with colour-vision deficiency. `default` uses a
|
|
5689
|
+
* filled dot, `positive` a ring, and `warning` a filled square.
|
|
5690
|
+
*/
|
|
5514
5691
|
class ChBadge {
|
|
5515
5692
|
constructor(hostRef) {
|
|
5516
5693
|
registerInstance(this, hostRef);
|
|
@@ -5519,15 +5696,22 @@ class ChBadge {
|
|
|
5519
5696
|
* The visual style of the badge. Either `default`, `positive`, or `warning`.
|
|
5520
5697
|
*/
|
|
5521
5698
|
variant = 'default';
|
|
5699
|
+
/**
|
|
5700
|
+
* Whether to show the variant marker. On by default so the state does not
|
|
5701
|
+
* depend on colour; turn it off for a badge that only repeats text already
|
|
5702
|
+
* carrying the meaning.
|
|
5703
|
+
*/
|
|
5704
|
+
statusCue = true;
|
|
5522
5705
|
render() {
|
|
5523
|
-
return (hAsync(Host, { key: '
|
|
5706
|
+
return (hAsync(Host, { key: '4c2874a988c47589bb4b101479e93aba9c1cf05c' }, hAsync("span", { key: '5d78f0c78545ad36f3e8cbfee48b0256545e9964', class: { badge: true, [`badge--${this.variant}`]: true } }, this.statusCue && hAsync("span", { key: '02bebc85a39fca230f09cc4688a05d055396d054', class: "badge-dot", "aria-hidden": "true" }), hAsync("slot", { key: '87d5e53ae4ea195f6f78ce8694048c9cd27af2ac' }))));
|
|
5524
5707
|
}
|
|
5525
5708
|
static get style() { return chBadgeCss(); }
|
|
5526
5709
|
static get cmpMeta() { return {
|
|
5527
5710
|
"$flags$": 777,
|
|
5528
5711
|
"$tagName$": "ch-badge",
|
|
5529
5712
|
"$members$": {
|
|
5530
|
-
"variant": [1]
|
|
5713
|
+
"variant": [1],
|
|
5714
|
+
"statusCue": [4, "status-cue"]
|
|
5531
5715
|
},
|
|
5532
5716
|
"$listeners$": undefined,
|
|
5533
5717
|
"$lazyBundleId$": "-",
|
|
@@ -5650,7 +5834,7 @@ class ChCard {
|
|
|
5650
5834
|
registerInstance(this, hostRef);
|
|
5651
5835
|
}
|
|
5652
5836
|
render() {
|
|
5653
|
-
return (hAsync(Host, { key: '
|
|
5837
|
+
return (hAsync(Host, { key: '3f9cac3b9c506e14a27750e0e501a4f524ef9d8d' }, hAsync("div", { key: 'a35fc3f44e85df166a311317d5409ed96664c4e8', class: "card" }, hAsync("slot", { key: '15efcaa33c3fdf8599c78cfe61ee107fd42115b3' }))));
|
|
5654
5838
|
}
|
|
5655
5839
|
static get style() { return chCardCss(); }
|
|
5656
5840
|
static get cmpMeta() { return {
|
|
@@ -5791,7 +5975,7 @@ class ChCheckbox {
|
|
|
5791
5975
|
return undefined;
|
|
5792
5976
|
}
|
|
5793
5977
|
render() {
|
|
5794
|
-
return (hAsync(Host, { key: '
|
|
5978
|
+
return (hAsync(Host, { key: '09ba208488d214d27ae2d5019a231a17033e5157' }, hAsync("label", { key: '266604e9468f3a12b9593afc0ba25389ae6ab327', class: { 'control': true, 'control--disabled': this.disabled || this.formDisabled }, htmlFor: this.checkboxId }, hAsync("input", { key: 'd068dc3c56fd8c2588821de0f394296305023f1d', 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: '22f1fd5ab55d39da62fee78434794cd488bf1dcd', class: "label-text" }, this.label)), this.hint && !(this.invalid && this.errorMessage) && (hAsync("p", { key: 'ef7de0570aeac42cfedaf7dd90922460e0c822d9', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (hAsync("p", { key: 'f4fea80489574d6673176fc1139c496c202a92bc', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
5795
5979
|
}
|
|
5796
5980
|
static get formAssociated() { return true; }
|
|
5797
5981
|
static get watchers() { return {
|
|
@@ -5862,13 +6046,13 @@ class ChCluster {
|
|
|
5862
6046
|
return GAPS$2.has(this.gap) ? this.gap : 'md';
|
|
5863
6047
|
}
|
|
5864
6048
|
render() {
|
|
5865
|
-
return (hAsync(Host, { key: '
|
|
6049
|
+
return (hAsync(Host, { key: 'e3d17238168f3faaa452740f0aab6a9e0ed5219f', class: {
|
|
5866
6050
|
'cluster': true,
|
|
5867
6051
|
[`cluster--gap-${this.gapStep}`]: true,
|
|
5868
6052
|
[`cluster--align-${this.align}`]: true,
|
|
5869
6053
|
[`cluster--justify-${this.justify}`]: true,
|
|
5870
6054
|
'cluster--nowrap': !this.wrap,
|
|
5871
|
-
} }, hAsync("slot", { key: '
|
|
6055
|
+
} }, hAsync("slot", { key: '638cecec55ed72d53eb5c6e51d1a683833fa5756' })));
|
|
5872
6056
|
}
|
|
5873
6057
|
static get style() { return chClusterCss(); }
|
|
5874
6058
|
static get cmpMeta() { return {
|
|
@@ -5886,6 +6070,57 @@ class ChCluster {
|
|
|
5886
6070
|
}; }
|
|
5887
6071
|
}
|
|
5888
6072
|
|
|
6073
|
+
const chDescriptionListCss = () => `:host{display:block;font-family:var(--typography-body);color:var(--color-text-secondary)}:host([hidden]){display:none}.list{margin:0;display:grid;grid-template-columns:repeat(1, minmax(0, 1fr));gap:var(--spacing-sm) var(--spacing-2xl)}.list--columns-2,.list--columns-3{grid-template-columns:repeat(2, minmax(0, 1fr))}.list--columns-3{grid-template-columns:repeat(3, minmax(0, 1fr))}@media (max-width: 48rem){.list--columns-2,.list--columns-3{grid-template-columns:minmax(0, 1fr)}}::slotted(div){display:grid;grid-template-columns:fit-content(min(12rem, 40%)) minmax(0, 1fr);gap:var(--spacing-sm);align-items:baseline}::slotted(dt){font-family:var(--typography-heading);font-weight:var(--typography-weight-semibold);font-size:var(--typography-size-sm);color:var(--color-text-primary)}::slotted(dd){margin:0;font-size:var(--typography-size-sm);min-width:0;overflow-wrap:break-word}`;
|
|
6074
|
+
|
|
6075
|
+
const COLUMNS = new Set(['1', '2', '3']);
|
|
6076
|
+
/**
|
|
6077
|
+
* Label/value pairs for detail views, on a native `<dl>`.
|
|
6078
|
+
*
|
|
6079
|
+
* The component renders the `<dl>` and the layout; the consumer writes the
|
|
6080
|
+
* terms and descriptions. Group each pair in a `<div>` (valid HTML 5.2
|
|
6081
|
+
* grouping) — the group is the grid item, which is what keeps a pair from
|
|
6082
|
+
* splitting across columns:
|
|
6083
|
+
*
|
|
6084
|
+
* ```html
|
|
6085
|
+
* <ch-description-list columns="2">
|
|
6086
|
+
* <div><dt>Cliente</dt><dd>Aurora SpA</dd></div>
|
|
6087
|
+
* <div><dt>Pedido</dt><dd>#1523</dd></div>
|
|
6088
|
+
* </ch-description-list>
|
|
6089
|
+
* ```
|
|
6090
|
+
*
|
|
6091
|
+
* The markup stays native in the light DOM, so the `term` role reaches the
|
|
6092
|
+
* accessibility tree untouched — the shape decision on #81 measured that a
|
|
6093
|
+
* custom wrapper adds nothing in Chromium while risking other browsers. No
|
|
6094
|
+
* `ch-description-item` element exists for the same reason.
|
|
6095
|
+
*/
|
|
6096
|
+
class ChDescriptionList {
|
|
6097
|
+
constructor(hostRef) {
|
|
6098
|
+
registerInstance(this, hostRef);
|
|
6099
|
+
}
|
|
6100
|
+
/**
|
|
6101
|
+
* How many pairs share a row on a wide viewport. One column is the stacked
|
|
6102
|
+
* layout. An unknown value falls back to one column.
|
|
6103
|
+
*/
|
|
6104
|
+
columns = '1';
|
|
6105
|
+
get columnCount() {
|
|
6106
|
+
return COLUMNS.has(this.columns) ? this.columns : '1';
|
|
6107
|
+
}
|
|
6108
|
+
render() {
|
|
6109
|
+
return (hAsync(Host, { key: 'd4905aeabf16e8c0798601a15e9115128c87f367' }, hAsync("dl", { key: 'f2f85f1cdae61f0d5d8c007509ec75f21a9e69df', class: `list list--columns-${this.columnCount}` }, hAsync("slot", { key: '60883fb5884ad38791c7ef811e4f3a0be6396e61' }))));
|
|
6110
|
+
}
|
|
6111
|
+
static get style() { return chDescriptionListCss(); }
|
|
6112
|
+
static get cmpMeta() { return {
|
|
6113
|
+
"$flags$": 777,
|
|
6114
|
+
"$tagName$": "ch-description-list",
|
|
6115
|
+
"$members$": {
|
|
6116
|
+
"columns": [1]
|
|
6117
|
+
},
|
|
6118
|
+
"$listeners$": undefined,
|
|
6119
|
+
"$lazyBundleId$": "-",
|
|
6120
|
+
"$attrsToReflect$": []
|
|
6121
|
+
}; }
|
|
6122
|
+
}
|
|
6123
|
+
|
|
5889
6124
|
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%}`;
|
|
5890
6125
|
|
|
5891
6126
|
class ChDivider {
|
|
@@ -5897,7 +6132,7 @@ class ChDivider {
|
|
|
5897
6132
|
*/
|
|
5898
6133
|
orientation = 'horizontal';
|
|
5899
6134
|
render() {
|
|
5900
|
-
return (hAsync(Host, { key: '
|
|
6135
|
+
return (hAsync(Host, { key: 'c18cffa051e3fde189ed358a748e58d0af534357', class: { 'divider--vertical': this.orientation === 'vertical' } }, hAsync("hr", { key: '2a6fe2c3a2b61eecd03e0b5d2830695328e77453', class: { divider: true, [`divider--${this.orientation}`]: true }, "aria-orientation": this.orientation })));
|
|
5901
6136
|
}
|
|
5902
6137
|
static get style() { return chDividerCss(); }
|
|
5903
6138
|
static get cmpMeta() { return {
|
|
@@ -6102,7 +6337,7 @@ class ChDrawer {
|
|
|
6102
6337
|
this.chClose.emit();
|
|
6103
6338
|
};
|
|
6104
6339
|
render() {
|
|
6105
|
-
return (hAsync(Host, { key: '
|
|
6340
|
+
return (hAsync(Host, { key: 'a0406608e57614c79a23673f040191e2d94cdd48' }, hAsync("dialog", { key: '84072ff1a87f1033c5b4911089c8c0819fe087ea', class: { drawer: true, [`drawer--${this.side}`]: true }, "aria-label": this.label, ref: el => (this.dialog = el) }, hAsync("div", { key: '57cddba1e04471dc6d0fe6e86311c38bb4329969', class: "drawer-head" }, hAsync("slot", { key: 'b77179dec88ae4d1b9975b7e6b16184a8aa8bb79', name: "header" }), this.closeLabel && (hAsync("button", { key: '88daedc7a80418e3480b577639e80ef31ff02486', class: "drawer-close", type: "button", "aria-label": this.closeLabel, onClick: this.handleCloseClick }, hAsync("span", { key: 'e5bb3e74f1b4365b0e32e2b8e70bdc46ac882c78', "aria-hidden": "true" }, "\u00D7")))), hAsync("div", { key: 'd81831510dd6a0d9e97eddffac99bc0689bf3d31', class: "drawer-body" }, hAsync("slot", { key: 'f3d72a55ad19021369e117ec5bf9693bc6d72c85' })), hAsync("slot", { key: '339e8989a2ea9f580a756ff89e10c40e55904c11', name: "footer" }))));
|
|
6106
6341
|
}
|
|
6107
6342
|
static get watchers() { return {
|
|
6108
6343
|
"open": [{
|
|
@@ -6214,7 +6449,7 @@ class ChEmoji {
|
|
|
6214
6449
|
this.loaded = true;
|
|
6215
6450
|
};
|
|
6216
6451
|
render() {
|
|
6217
|
-
return (hAsync(Host, { key: '
|
|
6452
|
+
return (hAsync(Host, { key: '4a5c5b2a917227ab3fb9aabe560718a84dd17730' }, hAsync("img", { key: 'dbc09e58cd1a6ce899ce82dd1ec13ba15955b4ad', class: {
|
|
6218
6453
|
'emoji': true,
|
|
6219
6454
|
[`emoji--${this.size}`]: true,
|
|
6220
6455
|
'emoji--hidden': !this.loaded,
|
|
@@ -6270,7 +6505,7 @@ class ChEmptyState {
|
|
|
6270
6505
|
*/
|
|
6271
6506
|
size = 'md';
|
|
6272
6507
|
render() {
|
|
6273
|
-
return (hAsync(Host, { key: '
|
|
6508
|
+
return (hAsync(Host, { key: '73a168213e3f62b73d859dd6e1ad35eff6694746', class: { 'empty-state': true, [`empty-state--${this.size}`]: true } }, hAsync("div", { key: '81bbad48af38acd640a67673132773a66d06c35b', class: "empty-state__inner" }, hAsync("div", { key: '1f9f8953beba68951163a5081ada1254ee6de61c', class: "empty-state__icon", "aria-hidden": "true" }, hAsync("slot", { key: '70c2b38f1a780b4c39a676d6b4cf4fe9d80a45c5', name: "icon" })), hAsync("h3", { key: '964501021ac65c7edb96c60b9e6f6dc7aece2ebe', class: "empty-state__title" }, this.title), this.description && hAsync("p", { key: 'a6effa9b7a24875938fc18ee9e6a7acf1c35b0ba', class: "empty-state__description" }, this.description), hAsync("div", { key: '0052d3c169569b96ee73b481f44b669715f90771', class: "empty-state__actions" }, hAsync("slot", { key: '3fa51fed8e5f49e02a9f588a3c0577ce9c2c5797' })))));
|
|
6274
6509
|
}
|
|
6275
6510
|
static get style() { return chEmptyStateCss(); }
|
|
6276
6511
|
static get cmpMeta() { return {
|
|
@@ -6341,7 +6576,7 @@ class ChGrid {
|
|
|
6341
6576
|
this.el.style.setProperty('--ch-grid-columns', template);
|
|
6342
6577
|
}
|
|
6343
6578
|
render() {
|
|
6344
|
-
return (hAsync(Host, { key: '
|
|
6579
|
+
return (hAsync(Host, { key: '09a37640189b353bd109bce97ad684396f91a06d', class: { grid: true, [`grid--gap-${this.gapStep}`]: true } }, hAsync("slot", { key: 'e309fee76ea499e4c3b22082218d12fc94cb8fb8' })));
|
|
6345
6580
|
}
|
|
6346
6581
|
static get style() { return chGridCss(); }
|
|
6347
6582
|
static get cmpMeta() { return {
|
|
@@ -6358,6 +6593,122 @@ class ChGrid {
|
|
|
6358
6593
|
}; }
|
|
6359
6594
|
}
|
|
6360
6595
|
|
|
6596
|
+
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)}`;
|
|
6597
|
+
|
|
6598
|
+
/**
|
|
6599
|
+
* A single Lucide glyph.
|
|
6600
|
+
*
|
|
6601
|
+
* Decorative by default: the icon is hidden from assistive technology unless
|
|
6602
|
+
* you give it a `label`, because most icons sit next to text that already says
|
|
6603
|
+
* what they mean and a second announcement is noise. Set `label` only when the
|
|
6604
|
+
* icon carries meaning on its own; a control whose only content is an icon
|
|
6605
|
+
* should use `ch-icon-button`, which requires the name.
|
|
6606
|
+
*/
|
|
6607
|
+
class ChIcon {
|
|
6608
|
+
constructor(hostRef) {
|
|
6609
|
+
registerInstance(this, hostRef);
|
|
6610
|
+
}
|
|
6611
|
+
/**
|
|
6612
|
+
* Which glyph to draw. Unknown values render nothing rather than throwing,
|
|
6613
|
+
* so a stale name in a data payload cannot break the page.
|
|
6614
|
+
*/
|
|
6615
|
+
name;
|
|
6616
|
+
/**
|
|
6617
|
+
* `sm` is 16px, `md` is 20px and `lg` is 24px — the sizes the scale's line
|
|
6618
|
+
* heights were built around.
|
|
6619
|
+
*/
|
|
6620
|
+
size = 'md';
|
|
6621
|
+
/**
|
|
6622
|
+
* Accessible name. When set, the icon becomes `role="img"` and is announced;
|
|
6623
|
+
* when omitted it is `aria-hidden`.
|
|
6624
|
+
*/
|
|
6625
|
+
label;
|
|
6626
|
+
render() {
|
|
6627
|
+
const shapes = this.name ? chIcons[this.name] : undefined;
|
|
6628
|
+
const decorative = !this.label;
|
|
6629
|
+
return (hAsync(Host, { key: 'c5f0c415136db62b88cfdd17b1535ccabda92060' }, hAsync("svg", { key: '55e4f5604d9a6b3e7727fb8354658928104ea156', 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)))));
|
|
6630
|
+
}
|
|
6631
|
+
static get style() { return chIconCss(); }
|
|
6632
|
+
static get cmpMeta() { return {
|
|
6633
|
+
"$flags$": 521,
|
|
6634
|
+
"$tagName$": "ch-icon",
|
|
6635
|
+
"$members$": {
|
|
6636
|
+
"name": [1],
|
|
6637
|
+
"size": [1],
|
|
6638
|
+
"label": [1]
|
|
6639
|
+
},
|
|
6640
|
+
"$listeners$": undefined,
|
|
6641
|
+
"$lazyBundleId$": "-",
|
|
6642
|
+
"$attrsToReflect$": []
|
|
6643
|
+
}; }
|
|
6644
|
+
}
|
|
6645
|
+
|
|
6646
|
+
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}}`;
|
|
6647
|
+
|
|
6648
|
+
/**
|
|
6649
|
+
* A button whose only content is an icon.
|
|
6650
|
+
*
|
|
6651
|
+
* The label is required rather than optional. An icon-only button without an
|
|
6652
|
+
* accessible name is unusable by voice, screen reader or automation, and there
|
|
6653
|
+
* is no adjacent text to fall back on — the same reasoning as `ch-modal`, and
|
|
6654
|
+
* the reason this component exists instead of letting consumers bolt an icon
|
|
6655
|
+
* slot onto `ch-button` and forget the name.
|
|
6656
|
+
*/
|
|
6657
|
+
class ChIconButton {
|
|
6658
|
+
constructor(hostRef) {
|
|
6659
|
+
registerInstance(this, hostRef);
|
|
6660
|
+
this.chClick = createEvent(this, "chClick");
|
|
6661
|
+
}
|
|
6662
|
+
/** The glyph to draw. */
|
|
6663
|
+
name;
|
|
6664
|
+
/**
|
|
6665
|
+
* Accessible name, set as `aria-label`. Required: say what the button does
|
|
6666
|
+
* ("Eliminar producto"), not what the glyph is ("papelera").
|
|
6667
|
+
*/
|
|
6668
|
+
label;
|
|
6669
|
+
/** Visual size. `md` matches the height of a default `ch-button`. */
|
|
6670
|
+
size = 'md';
|
|
6671
|
+
/** Native button type, defaulting to `button` so it never submits a form by accident. */
|
|
6672
|
+
type = 'button';
|
|
6673
|
+
disabled = false;
|
|
6674
|
+
/**
|
|
6675
|
+
* Blocks pointer and keyboard activation and marks the button `aria-busy`
|
|
6676
|
+
* while keeping it focusable, so focus does not fall to `<body>` when an
|
|
6677
|
+
* action completes.
|
|
6678
|
+
*/
|
|
6679
|
+
loading = false;
|
|
6680
|
+
/** Emitted on click. A click while disabled or loading emits nothing. */
|
|
6681
|
+
chClick;
|
|
6682
|
+
handleClick = (event) => {
|
|
6683
|
+
if (this.disabled || this.loading) {
|
|
6684
|
+
event.preventDefault();
|
|
6685
|
+
event.stopImmediatePropagation();
|
|
6686
|
+
return;
|
|
6687
|
+
}
|
|
6688
|
+
this.chClick.emit(event);
|
|
6689
|
+
};
|
|
6690
|
+
render() {
|
|
6691
|
+
const shapes = this.name ? chIcons[this.name] : undefined;
|
|
6692
|
+
return (hAsync(Host, { key: '201ad628b28588bdf40baf822abc60b2c8b7c6f2' }, hAsync("button", { key: '21fb01a8b6deef9e330ee2e3805834f5f2b8a953', 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: 'c003a3643d5968f08cf9227f768aea7b4817ab7d', 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))))));
|
|
6693
|
+
}
|
|
6694
|
+
static get style() { return chIconButtonCss(); }
|
|
6695
|
+
static get cmpMeta() { return {
|
|
6696
|
+
"$flags$": 521,
|
|
6697
|
+
"$tagName$": "ch-icon-button",
|
|
6698
|
+
"$members$": {
|
|
6699
|
+
"name": [1],
|
|
6700
|
+
"label": [1],
|
|
6701
|
+
"size": [1],
|
|
6702
|
+
"type": [1],
|
|
6703
|
+
"disabled": [4],
|
|
6704
|
+
"loading": [4]
|
|
6705
|
+
},
|
|
6706
|
+
"$listeners$": undefined,
|
|
6707
|
+
"$lazyBundleId$": "-",
|
|
6708
|
+
"$attrsToReflect$": []
|
|
6709
|
+
}; }
|
|
6710
|
+
}
|
|
6711
|
+
|
|
6361
6712
|
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)}`;
|
|
6362
6713
|
|
|
6363
6714
|
let inputIds = 0;
|
|
@@ -6479,7 +6830,7 @@ class ChInput {
|
|
|
6479
6830
|
return undefined;
|
|
6480
6831
|
}
|
|
6481
6832
|
render() {
|
|
6482
|
-
return (hAsync(Host, { key: '
|
|
6833
|
+
return (hAsync(Host, { key: 'd85d2773a340ee1a46f7f76a0d287ff1194d0e0b' }, this.label && (hAsync("label", { key: '9ad19457232c703a59eab1062e12c17e8c2b8327', class: "label", htmlFor: this.inputId }, this.label)), hAsync("input", { key: 'f88fe669d2afa183230b1286dd88ccc894eaee5e', 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: '31bdbb81ba537cc7d84b8cf7fc24055890b9b000', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (hAsync("p", { key: '50a7cb03654f5deaa70af64ee14d774e94f77816', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
6483
6834
|
}
|
|
6484
6835
|
static get formAssociated() { return true; }
|
|
6485
6836
|
static get watchers() { return {
|
|
@@ -6728,7 +7079,7 @@ class ChModal {
|
|
|
6728
7079
|
this.chClose.emit();
|
|
6729
7080
|
};
|
|
6730
7081
|
render() {
|
|
6731
|
-
return (hAsync(Host, { key: '
|
|
7082
|
+
return (hAsync(Host, { key: '01e01a6927352410f85cb7022aa653482e52f010' }, hAsync("dialog", { key: '166798e913c662fad6c517d3c5ac957b3d9a44cf', class: { modal: true, [`modal--${this.size}`]: true }, "aria-label": this.label, ref: el => (this.dialog = el) }, hAsync("div", { key: '3d0766206306e7efe1c613313a99d049aea168ef', class: "modal-head" }, hAsync("slot", { key: '9b50ec72180b64e7eef52dab2f9246eee1cbe788', name: "heading" }), this.closeLabel && (hAsync("button", { key: 'd6c375363d9debb0c3858bb0dc1a67c816b24442', class: "modal-close", type: "button", "aria-label": this.closeLabel, onClick: this.handleCloseClick }, hAsync("span", { key: '128216aa8fca200775cd7ab28b23555bd516d1db', "aria-hidden": "true" }, "\u00D7")))), hAsync("div", { key: 'eebabfd71be502cc99e8337526cd31d4406d5eb8', class: "modal-body" }, hAsync("slot", { key: '1bbc38d606a23c6b499a80a6695a1ee6334c414f' })))));
|
|
6732
7083
|
}
|
|
6733
7084
|
static get watchers() { return {
|
|
6734
7085
|
"open": [{
|
|
@@ -6751,6 +7102,68 @@ class ChModal {
|
|
|
6751
7102
|
}; }
|
|
6752
7103
|
}
|
|
6753
7104
|
|
|
7105
|
+
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}}`;
|
|
7106
|
+
|
|
7107
|
+
/**
|
|
7108
|
+
* The heading block at the top of a page: title, optional eyebrow and
|
|
7109
|
+
* description, and a trailing actions area.
|
|
7110
|
+
*
|
|
7111
|
+
* The title is a `title` prop rather than a slot so the heading level always
|
|
7112
|
+
* matches the page. A slotted heading lets a consumer nest a second `h1`, and
|
|
7113
|
+
* "one top-level heading per page" then depends on every caller remembering it;
|
|
7114
|
+
* here the level is explicit and defaults to `h1`. The actions wrap rather than
|
|
7115
|
+
* push the page sideways at 390px, and the DOM order keeps the heading before
|
|
7116
|
+
* the actions so reading and focus order still start with the title.
|
|
7117
|
+
*/
|
|
7118
|
+
class ChPageHeader {
|
|
7119
|
+
constructor(hostRef) {
|
|
7120
|
+
registerInstance(this, hostRef);
|
|
7121
|
+
}
|
|
7122
|
+
/**
|
|
7123
|
+
* The page title. Rendered as a real heading, so it also works as the
|
|
7124
|
+
* accessible name of the page region.
|
|
7125
|
+
*/
|
|
7126
|
+
title;
|
|
7127
|
+
/**
|
|
7128
|
+
* Heading element to render. Use `h2` (or `h3`) when the page already has a
|
|
7129
|
+
* higher-level heading above this block, so the document outline stays valid.
|
|
7130
|
+
*/
|
|
7131
|
+
headingLevel = 'h1';
|
|
7132
|
+
/**
|
|
7133
|
+
* Optional small label above the title, as slotted content. Use it for a
|
|
7134
|
+
* section or entity kind ("Proyecto", "Factura #1042"), not for the title.
|
|
7135
|
+
*/
|
|
7136
|
+
eyebrow;
|
|
7137
|
+
/**
|
|
7138
|
+
* Optional supporting line under the title.
|
|
7139
|
+
*/
|
|
7140
|
+
description;
|
|
7141
|
+
/**
|
|
7142
|
+
* Puts the actions below the title instead of beside it. Use it when the
|
|
7143
|
+
* actions are too wide to sit on the same row even after wrapping.
|
|
7144
|
+
*/
|
|
7145
|
+
actionsStacked = false;
|
|
7146
|
+
render() {
|
|
7147
|
+
const Heading = this.headingLevel;
|
|
7148
|
+
return (hAsync(Host, { key: '0e2bc8c10790e1f6f36a4c679579ac775f6ec3a4' }, hAsync("div", { key: '8ef9876c61f0ff325fedfb899d2e09c02b8e5e53', class: { 'header': true, 'header--stacked': this.actionsStacked } }, hAsync("div", { key: '3bef4d66f8d69397c4117e9d4a0637e978abbe2e', class: "header-text" }, this.eyebrow && hAsync("p", { key: '1ae504669807c48d95d12ce5b7d488f85e5dc864', class: "header-eyebrow" }, this.eyebrow), hAsync(Heading, { key: '9b6374d6b1d18124e49acf67af08443175f4bbaa', class: "header-title" }, this.title), this.description && hAsync("p", { key: '9c3d2d58f1c2dde2c70fc5f86eb2d580a13f8594', class: "header-description" }, this.description)), hAsync("div", { key: '3b48c89c2a8c4c5d3e42f6b78db80b3e9c2e0c50', class: "header-actions" }, hAsync("slot", { key: '77b2010fec0113af7c8ee7c7bcd884dd11b05138', name: "actions" })))));
|
|
7149
|
+
}
|
|
7150
|
+
static get style() { return chPageHeaderCss(); }
|
|
7151
|
+
static get cmpMeta() { return {
|
|
7152
|
+
"$flags$": 777,
|
|
7153
|
+
"$tagName$": "ch-page-header",
|
|
7154
|
+
"$members$": {
|
|
7155
|
+
"title": [1],
|
|
7156
|
+
"headingLevel": [1, "heading-level"],
|
|
7157
|
+
"eyebrow": [1],
|
|
7158
|
+
"description": [1],
|
|
7159
|
+
"actionsStacked": [4, "actions-stacked"]
|
|
7160
|
+
},
|
|
7161
|
+
"$listeners$": undefined,
|
|
7162
|
+
"$lazyBundleId$": "-",
|
|
7163
|
+
"$attrsToReflect$": []
|
|
7164
|
+
}; }
|
|
7165
|
+
}
|
|
7166
|
+
|
|
6754
7167
|
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)}`;
|
|
6755
7168
|
|
|
6756
7169
|
let radioIds = 0;
|
|
@@ -6862,7 +7275,7 @@ class ChRadio {
|
|
|
6862
7275
|
}
|
|
6863
7276
|
render() {
|
|
6864
7277
|
const groupName = this.name || `${this.groupId}-group`;
|
|
6865
|
-
return (hAsync(Host, { key: '
|
|
7278
|
+
return (hAsync(Host, { key: 'f55466f6bcbe3283d294161c02498419066ca958' }, this.label && (hAsync("span", { key: '789131e7d8812ee930db5e0a0c6dc7f7e353249f', class: "group-label", id: this.labelId }, this.label)), hAsync("div", { key: 'fc0a7adbde7feaaca99d156d45aacb6d18d5588e', 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: '53f3e9d368cfefa9a4d85010b65f002a3b92e0f4', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (hAsync("p", { key: '517b7204ebf91042d293be294d7e936954eb80fb', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
6866
7279
|
}
|
|
6867
7280
|
static get formAssociated() { return true; }
|
|
6868
7281
|
static get watchers() { return {
|
|
@@ -7006,7 +7419,7 @@ class ChSegmentedControl {
|
|
|
7006
7419
|
}
|
|
7007
7420
|
render() {
|
|
7008
7421
|
const groupName = this.name || `${this.groupId}-group`;
|
|
7009
|
-
return (hAsync(Host, { key: '
|
|
7422
|
+
return (hAsync(Host, { key: 'a8782886fd0c20fa96a5a54c9997fe9d91d3e670' }, this.label && (hAsync("span", { key: '99a2727035a62f71d01f07e0cf222becb118d3b2', class: "group-label", id: this.labelId }, this.label)), hAsync("div", { key: '31b293c379a996e06650c1a6c9fe9c46c32097a2', 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)))))));
|
|
7010
7423
|
}
|
|
7011
7424
|
static get formAssociated() { return true; }
|
|
7012
7425
|
static get watchers() { return {
|
|
@@ -7149,7 +7562,7 @@ class ChSelect {
|
|
|
7149
7562
|
return undefined;
|
|
7150
7563
|
}
|
|
7151
7564
|
render() {
|
|
7152
|
-
return (hAsync(Host, { key: '
|
|
7565
|
+
return (hAsync(Host, { key: 'aeba7eff5bf3bd7926922e65376c6508fc1c4dd3' }, this.label && (hAsync("label", { key: '943e5557014e2297368825505513f4ad8b093ee5', class: "label", htmlFor: this.selectId }, this.label)), hAsync("select", { key: 'ccec2dfef1b06b219e7aed536914ebf2b24e370f', 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: 'a0c41592c1a5a90f611917da984374edf5305b96', 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: '28a35ede5d7bb1937d501719244b4b9f7a5d95f2', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (hAsync("p", { key: 'b021c848f75367e2e3329aab423f787205ee0491', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
7153
7566
|
}
|
|
7154
7567
|
static get formAssociated() { return true; }
|
|
7155
7568
|
static get watchers() { return {
|
|
@@ -7242,7 +7655,7 @@ class ChSkeleton {
|
|
|
7242
7655
|
return { width: this.width, height: this.height };
|
|
7243
7656
|
}
|
|
7244
7657
|
render() {
|
|
7245
|
-
return (hAsync(Host, { key: '
|
|
7658
|
+
return (hAsync(Host, { key: '705e4cd6dac9c8c8578cb8133a700c3297d9fffe', "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) })))));
|
|
7246
7659
|
}
|
|
7247
7660
|
static get style() { return chSkeletonCss(); }
|
|
7248
7661
|
static get cmpMeta() { return {
|
|
@@ -7290,7 +7703,7 @@ class ChSpinner {
|
|
|
7290
7703
|
label;
|
|
7291
7704
|
render() {
|
|
7292
7705
|
const labelled = Boolean(this.label);
|
|
7293
|
-
return (hAsync(Host, { key: '
|
|
7706
|
+
return (hAsync(Host, { key: '6d26b2ead7b674058b3d5c56caf9329cf9377ae6' }, hAsync("span", { key: 'a3fa9b56474271154527b9e0f9def3136b158ea4', class: { spinner: true, [`spinner--${this.size}`]: true }, role: labelled ? 'status' : undefined, "aria-label": labelled ? this.label : undefined, "aria-hidden": labelled ? undefined : 'true' })));
|
|
7294
7707
|
}
|
|
7295
7708
|
static get style() { return chSpinnerCss(); }
|
|
7296
7709
|
static get cmpMeta() { return {
|
|
@@ -7336,7 +7749,7 @@ class ChStack {
|
|
|
7336
7749
|
return GAPS.has(this.gap) ? this.gap : 'md';
|
|
7337
7750
|
}
|
|
7338
7751
|
render() {
|
|
7339
|
-
return (hAsync(Host, { key: '
|
|
7752
|
+
return (hAsync(Host, { key: 'd4ee90331cd1ff0d65eb9c80aa684d3b2f5e2876', class: { stack: true, [`stack--gap-${this.gapStep}`]: true, [`stack--align-${this.align}`]: true, [`stack--justify-${this.justify}`]: true } }, hAsync("slot", { key: 'bdfe358adc457ed6ba79ca80b9e96f17597fbcb5' })));
|
|
7340
7753
|
}
|
|
7341
7754
|
static get style() { return chStackCss(); }
|
|
7342
7755
|
static get cmpMeta() { return {
|
|
@@ -7353,6 +7766,76 @@ class ChStack {
|
|
|
7353
7766
|
}; }
|
|
7354
7767
|
}
|
|
7355
7768
|
|
|
7769
|
+
const chStatCss = () => `:host{display:block;font-family:var(--typography-body);color:var(--color-text-primary)}:host([hidden]){display:none}.stat__inner{display:flex;flex-direction:column;gap:var(--spacing-2xs);padding:var(--spacing-md) var(--spacing-lg);border:var(--border-width) solid var(--color-border-default);border-radius:var(--radius-md);background:var(--color-surface-default)}.stat__label{font-size:var(--typography-size-xs);font-weight:var(--typography-weight-semibold);letter-spacing:0.06em;text-transform:uppercase;color:var(--color-text-secondary)}.stat__value{font-family:var(--typography-heading);font-size:var(--typography-size-xl);font-weight:var(--typography-weight-bold);font-variant-numeric:tabular-nums;display:flex;align-items:baseline;gap:var(--spacing-2xs)}.stat__cue{font-size:var(--typography-size-md)}.stat__value--positive{color:var(--color-status-positive)}.stat__value--negative{color:var(--color-status-negative)}.stat__value--unavailable{color:var(--color-text-tertiary);font-style:italic}.stat__hint{font-size:var(--typography-size-sm);color:var(--color-text-secondary)}.stat__footer:empty{display:none}.stat__footer{margin-top:var(--spacing-2xs)}`;
|
|
7770
|
+
|
|
7771
|
+
const TONES = new Set(['default', 'positive', 'negative', 'unavailable']);
|
|
7772
|
+
/**
|
|
7773
|
+
* One dashboard metric: a label, a value and an optional hint.
|
|
7774
|
+
*
|
|
7775
|
+
* The value is a string the consumer has already formatted — the component
|
|
7776
|
+
* never parses numbers, so locale, currency and precision stay where the
|
|
7777
|
+
* data comes from. On a fetch error, pass the em dash and the unavailable
|
|
7778
|
+
* tone rather than a zero that would read as a real measurement:
|
|
7779
|
+
*
|
|
7780
|
+
* ```html
|
|
7781
|
+
* <ch-stat label="Ventas del mes" value="$1.250.000" tone="positive"></ch-stat>
|
|
7782
|
+
* <ch-stat label="Ticket promedio" value="—" tone="unavailable"></ch-stat>
|
|
7783
|
+
* ```
|
|
7784
|
+
*
|
|
7785
|
+
* A tone is never carried by colour alone: positive and negative values get
|
|
7786
|
+
* a visible sign cue, so the three states stay distinguishable in greyscale
|
|
7787
|
+
* and for colour-blind users. The `value` slot replaces the rendered value
|
|
7788
|
+
* for composed content (a link, a spinner), and the `footer` slot sits under
|
|
7789
|
+
* the hint for a comparison line or a sparkline.
|
|
7790
|
+
*/
|
|
7791
|
+
class ChStat {
|
|
7792
|
+
constructor(hostRef) {
|
|
7793
|
+
registerInstance(this, hostRef);
|
|
7794
|
+
}
|
|
7795
|
+
/**
|
|
7796
|
+
* Short label naming the metric, rendered in small caps above the value.
|
|
7797
|
+
*/
|
|
7798
|
+
label;
|
|
7799
|
+
/**
|
|
7800
|
+
* The metric value, already formatted by the consumer. Shown verbatim.
|
|
7801
|
+
*/
|
|
7802
|
+
value;
|
|
7803
|
+
/**
|
|
7804
|
+
* Secondary line under the value — a comparison or a unit note.
|
|
7805
|
+
*/
|
|
7806
|
+
hint;
|
|
7807
|
+
/**
|
|
7808
|
+
* Visual tone of the value. `positive` and `negative` add a sign cue so
|
|
7809
|
+
* the tone survives greyscale; `unavailable` dims the value for the
|
|
7810
|
+
* "could not be measured" case. An unknown value falls back to `default`.
|
|
7811
|
+
*/
|
|
7812
|
+
tone = 'default';
|
|
7813
|
+
get toneClass() {
|
|
7814
|
+
return TONES.has(this.tone) ? this.tone : 'default';
|
|
7815
|
+
}
|
|
7816
|
+
render() {
|
|
7817
|
+
const cue = this.toneClass === 'positive' ? '+' : this.toneClass === 'negative' ? '−' : null;
|
|
7818
|
+
return (hAsync(Host, { key: '5a43c713faab1513866d8f06899bb3fd3184cf09', class: "stat" }, hAsync("div", { key: '9c24e9774cfe0a70b8ba37c06ce7f264b34a9d8c', class: "stat__inner" }, hAsync("span", { key: '1a9330c2b31ec6de29f1b8c77761d7eb16160aae', class: "stat__label" }, this.label), hAsync("span", { key: '3f6c5e76f5c062effcb9793206a949942bcdfb9a', class: {
|
|
7819
|
+
stat__value: true,
|
|
7820
|
+
[`stat__value--${this.toneClass}`]: this.toneClass !== 'default',
|
|
7821
|
+
} }, cue && (hAsync("span", { key: 'b5f79899ec52e7e2b3ec3c00295f755f770a8bca', class: "stat__cue", "aria-hidden": "true" }, cue)), hAsync("slot", { key: 'b64083aa5738b4088cf9029650286b2564649ec9', name: "value" }, this.value)), this.hint && hAsync("span", { key: '9f560c1f1fd23f08ea63eccc9076066a7fd1a0f9', class: "stat__hint" }, this.hint), hAsync("div", { key: '77f3fe1f87e3abc2cce829e06b21f6b2c5f9aa15', class: "stat__footer" }, hAsync("slot", { key: 'd75204702eab0ab1f55df92e9c13c899235f6840', name: "footer" })))));
|
|
7822
|
+
}
|
|
7823
|
+
static get style() { return chStatCss(); }
|
|
7824
|
+
static get cmpMeta() { return {
|
|
7825
|
+
"$flags$": 777,
|
|
7826
|
+
"$tagName$": "ch-stat",
|
|
7827
|
+
"$members$": {
|
|
7828
|
+
"label": [1],
|
|
7829
|
+
"value": [1],
|
|
7830
|
+
"hint": [1],
|
|
7831
|
+
"tone": [1]
|
|
7832
|
+
},
|
|
7833
|
+
"$listeners$": undefined,
|
|
7834
|
+
"$lazyBundleId$": "-",
|
|
7835
|
+
"$attrsToReflect$": []
|
|
7836
|
+
}; }
|
|
7837
|
+
}
|
|
7838
|
+
|
|
7356
7839
|
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)}`;
|
|
7357
7840
|
|
|
7358
7841
|
let switchIds = 0;
|
|
@@ -7461,7 +7944,7 @@ class ChSwitch {
|
|
|
7461
7944
|
return undefined;
|
|
7462
7945
|
}
|
|
7463
7946
|
render() {
|
|
7464
|
-
return (hAsync(Host, { key: '
|
|
7947
|
+
return (hAsync(Host, { key: 'e1493afa72058b44b5051cdc641604d02952b6be' }, hAsync("label", { key: '80f2ca9bdb7fab02556f427f4a1fce56744eaf50', class: { 'control': true, 'control--disabled': this.disabled || this.formDisabled }, htmlFor: this.switchId }, hAsync("input", { key: '22a873c43b7f9c94455373d80ab5b3c28153ff70', 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: 'd995c061f60ad3040048966da17ad8cb2ebdb622', class: "track" }, hAsync("span", { key: 'ba09dcb23640b2925d0c82f5ab46213acc7e8a86', class: "thumb" })), this.label && hAsync("span", { key: '9849238fd3486bc1d869c6df373e30209e46d264', class: "label-text" }, this.label)), this.hint && !(this.invalid && this.errorMessage) && (hAsync("p", { key: '76a5cb6da88dbd7088cf2c0d9c2b5a781a632a7f', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (hAsync("p", { key: '5ebd8ab9b2390fea801bf75eeb4967e95983e041', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
7465
7948
|
}
|
|
7466
7949
|
static get formAssociated() { return true; }
|
|
7467
7950
|
static get watchers() { return {
|
|
@@ -7584,7 +8067,7 @@ class ChTabs {
|
|
|
7584
8067
|
}
|
|
7585
8068
|
render() {
|
|
7586
8069
|
const active = this.activeValue;
|
|
7587
|
-
return (hAsync(Host, { key: '
|
|
8070
|
+
return (hAsync(Host, { key: 'de167280c159345631f84f5eb7a3dc165396f361' }, hAsync("div", { key: '62c008bcf9eafd1c5f5121540b2841e2a6ada541', class: "tablist", role: "tablist", "aria-label": this.label, onKeyDown: this.handleKeyDown, ref: el => (this.tablistEl = el) }, this.tabs.map(tab => {
|
|
7588
8071
|
const selected = tab.value === active;
|
|
7589
8072
|
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));
|
|
7590
8073
|
})), 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}` }))))));
|
|
@@ -7726,7 +8209,7 @@ class ChTextarea {
|
|
|
7726
8209
|
return undefined;
|
|
7727
8210
|
}
|
|
7728
8211
|
render() {
|
|
7729
|
-
return (hAsync(Host, { key: '
|
|
8212
|
+
return (hAsync(Host, { key: 'c4334a23f6ad2394d410498726f3f422a654ffe3' }, this.label && (hAsync("label", { key: 'd935613b40c6c52be41e258aad2a3c17a290a506', class: "label", htmlFor: this.textareaId }, this.label)), hAsync("textarea", { key: 'ab27ae9a6be7d2bcc17638c209ef23eb3757c102', 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: 'eb488704ac6ff76534308aefd0938d848d14608f', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (hAsync("p", { key: '04c084b29d102f06bf15efc4c416b6ba0967ba8d', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
7730
8213
|
}
|
|
7731
8214
|
static get formAssociated() { return true; }
|
|
7732
8215
|
static get watchers() { return {
|
|
@@ -7766,9 +8249,156 @@ class ChTextarea {
|
|
|
7766
8249
|
}; }
|
|
7767
8250
|
}
|
|
7768
8251
|
|
|
7769
|
-
const
|
|
8252
|
+
const chTimelineCss = () => `:host{display:block;font-family:var(--typography-body);color:var(--color-text-secondary)}:host([hidden]){display:none}.list{margin:0;padding:0;display:grid;gap:var(--spacing-md);list-style:none}::slotted(li){position:relative;padding-left:var(--spacing-2xl);min-width:0}::slotted(li)::before{content:'';position:absolute;left:0;top:0.35em;width:var(--spacing-sm);height:var(--spacing-sm);border-radius:50%;background:var(--color-border-default)}::slotted(li:not(:last-of-type))::after{content:'';position:absolute;left:calc(var(--spacing-sm) / 2 - var(--border-width));top:calc(0.35em + var(--spacing-sm));bottom:calc(0px - var(--spacing-md));width:var(--border-width);background:var(--color-border-default)}::slotted(time){font-variant-numeric:tabular-nums}`;
|
|
8253
|
+
|
|
8254
|
+
/**
|
|
8255
|
+
* Chronological history: a native ordered list with a marker dot per item
|
|
8256
|
+
* and a connector line between items — the last item never gets a trailing
|
|
8257
|
+
* connector.
|
|
8258
|
+
*
|
|
8259
|
+
* The component renders the `<ol>` and owns the rail; the consumer writes
|
|
8260
|
+
* plain `<li>` items with whatever content each entry needs — a preformatted
|
|
8261
|
+
* date, a title, a description, and a non-colour state cue from `ch-icon`:
|
|
8262
|
+
*
|
|
8263
|
+
* ```html
|
|
8264
|
+
* <ch-timeline>
|
|
8265
|
+
* <li>
|
|
8266
|
+
* <ch-icon name="check"></ch-icon>
|
|
8267
|
+
* <time datetime="2026-11-02">2 nov 2026</time> — Creado el pedido
|
|
8268
|
+
* </li>
|
|
8269
|
+
* <li><ch-icon name="spinner"></ch-icon> Esperando despacho</li>
|
|
8270
|
+
* </ch-timeline>
|
|
8271
|
+
* ```
|
|
8272
|
+
*
|
|
8273
|
+
* The list semantics survive untouched because the `li` elements stay native
|
|
8274
|
+
* in the light DOM — measured on #83: a wrapped item still counts as a
|
|
8275
|
+
* `listitem`, so nothing is gained by a `ch-timeline-item` element, and
|
|
8276
|
+
* native markup is the safe bet across browsers.
|
|
8277
|
+
*/
|
|
8278
|
+
class ChTimeline {
|
|
8279
|
+
constructor(hostRef) {
|
|
8280
|
+
registerInstance(this, hostRef);
|
|
8281
|
+
}
|
|
8282
|
+
render() {
|
|
8283
|
+
return (hAsync(Host, { key: 'da3288af540acb92113ba83d08fc5e1693e83b3e', class: "timeline" }, hAsync("ol", { key: '1aaee846703dd0a67d6df04945eb4a62e2bbf711', class: "list" }, hAsync("slot", { key: '394cfd03640a2cf78bd620338de9ed9ef7b9d9f5' }))));
|
|
8284
|
+
}
|
|
8285
|
+
static get style() { return chTimelineCss(); }
|
|
8286
|
+
static get cmpMeta() { return {
|
|
8287
|
+
"$flags$": 265,
|
|
8288
|
+
"$tagName$": "ch-timeline",
|
|
8289
|
+
"$members$": undefined,
|
|
8290
|
+
"$listeners$": undefined,
|
|
8291
|
+
"$lazyBundleId$": "-",
|
|
8292
|
+
"$attrsToReflect$": []
|
|
8293
|
+
}; }
|
|
8294
|
+
}
|
|
8295
|
+
|
|
8296
|
+
const OPPOSITE = {
|
|
8297
|
+
top: 'bottom',
|
|
8298
|
+
bottom: 'top',
|
|
8299
|
+
left: 'right',
|
|
8300
|
+
right: 'left',
|
|
8301
|
+
};
|
|
8302
|
+
const AXIS = {
|
|
8303
|
+
top: 'vertical',
|
|
8304
|
+
bottom: 'vertical',
|
|
8305
|
+
left: 'horizontal',
|
|
8306
|
+
right: 'horizontal',
|
|
8307
|
+
};
|
|
8308
|
+
/**
|
|
8309
|
+
* How far a placed surface overflows each viewport edge. Positive values are
|
|
8310
|
+
* overflow. Used both to pick a placement and to shift the surface back in.
|
|
8311
|
+
*/
|
|
8312
|
+
function overflowOf(surface, viewport) {
|
|
8313
|
+
return {
|
|
8314
|
+
top: viewport.top - surface.top,
|
|
8315
|
+
left: viewport.left - surface.left,
|
|
8316
|
+
bottom: surface.top + surface.height - (viewport.top + viewport.height),
|
|
8317
|
+
right: surface.left + surface.width - (viewport.left + viewport.width),
|
|
8318
|
+
};
|
|
8319
|
+
}
|
|
8320
|
+
function offsetFor(placement, anchor, surface, gap) {
|
|
8321
|
+
switch (placement) {
|
|
8322
|
+
case 'top':
|
|
8323
|
+
return {
|
|
8324
|
+
top: anchor.top - surface.height - gap,
|
|
8325
|
+
left: anchor.left + (anchor.width - surface.width) / 2,
|
|
8326
|
+
};
|
|
8327
|
+
case 'bottom':
|
|
8328
|
+
return {
|
|
8329
|
+
top: anchor.top + anchor.height + gap,
|
|
8330
|
+
left: anchor.left + (anchor.width - surface.width) / 2,
|
|
8331
|
+
};
|
|
8332
|
+
case 'left':
|
|
8333
|
+
return {
|
|
8334
|
+
top: anchor.top + (anchor.height - surface.height) / 2,
|
|
8335
|
+
left: anchor.left - surface.width - gap,
|
|
8336
|
+
};
|
|
8337
|
+
case 'right':
|
|
8338
|
+
return {
|
|
8339
|
+
top: anchor.top + (anchor.height - surface.height) / 2,
|
|
8340
|
+
left: anchor.left + anchor.width + gap,
|
|
8341
|
+
};
|
|
8342
|
+
}
|
|
8343
|
+
}
|
|
8344
|
+
/**
|
|
8345
|
+
* Picks the placement that overflows least and then shifts the surface along
|
|
8346
|
+
* the cross axis so it stays inside the viewport.
|
|
8347
|
+
*
|
|
8348
|
+
* The main-axis overflow is not compensated with a translate: a tooltip pinned
|
|
8349
|
+
* to the top edge would cover its own trigger. Flipping to the other side is
|
|
8350
|
+
* what keeps it readable, and the caller decides whether to accept the
|
|
8351
|
+
* remaining overflow.
|
|
8352
|
+
*/
|
|
8353
|
+
function placeOverlay({ anchor, surface, viewport, preferred, gap, }) {
|
|
8354
|
+
const candidates = [preferred, OPPOSITE[preferred]];
|
|
8355
|
+
let placement = preferred;
|
|
8356
|
+
let best = Number.POSITIVE_INFINITY;
|
|
8357
|
+
for (const candidate of candidates) {
|
|
8358
|
+
const { top, left } = offsetFor(candidate, anchor, surface, gap);
|
|
8359
|
+
const rect = { top, left, width: surface.width, height: surface.height };
|
|
8360
|
+
const overflow = overflowOf(rect, viewport);
|
|
8361
|
+
const main = AXIS[candidate] === 'vertical' ? clamp(overflow.top) + clamp(overflow.bottom) : clamp(overflow.left) + clamp(overflow.right);
|
|
8362
|
+
if (main < best) {
|
|
8363
|
+
best = main;
|
|
8364
|
+
placement = candidate;
|
|
8365
|
+
}
|
|
8366
|
+
}
|
|
8367
|
+
const { top, left } = offsetFor(placement, anchor, surface, gap);
|
|
8368
|
+
const rect = { top, left, width: surface.width, height: surface.height };
|
|
8369
|
+
const overflow = overflowOf(rect, viewport);
|
|
8370
|
+
const shifted = AXIS[placement] === 'vertical' ? { top, left: left + correction(overflow.left, overflow.right) } : { top: top + correction(overflow.top, overflow.bottom), left };
|
|
8371
|
+
return { placement, top: shifted.top, left: shifted.left };
|
|
8372
|
+
}
|
|
8373
|
+
/** Only real overflow counts: the side that fits contributes nothing. */
|
|
8374
|
+
function clamp(overflow) {
|
|
8375
|
+
return overflow > 0 ? overflow : 0;
|
|
8376
|
+
}
|
|
8377
|
+
/**
|
|
8378
|
+
* Turns the two overflows on an axis into a shift. `before` is the overflow on
|
|
8379
|
+
* the leading edge (top or left), `after` the one on the trailing edge; both
|
|
8380
|
+
* are positive when the surface spills past that edge.
|
|
8381
|
+
*
|
|
8382
|
+
* Pushing away from the leading edge moves the surface inwards, so the shift is
|
|
8383
|
+
* `+before`. The trailing edge needs the opposite sign. When both overflow the
|
|
8384
|
+
* surface is larger than the viewport: pin it to the leading edge and let
|
|
8385
|
+
* `max-width` stop the spill.
|
|
8386
|
+
*/
|
|
8387
|
+
function correction(before, after) {
|
|
8388
|
+
if (before > 0) {
|
|
8389
|
+
return before;
|
|
8390
|
+
}
|
|
8391
|
+
if (after > 0) {
|
|
8392
|
+
return -after;
|
|
8393
|
+
}
|
|
8394
|
+
return 0;
|
|
8395
|
+
}
|
|
8396
|
+
|
|
8397
|
+
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}}`;
|
|
7770
8398
|
|
|
7771
8399
|
let tooltipIds = 0;
|
|
8400
|
+
/** Space between the trigger and the bubble, matching `--spacing-md`. */
|
|
8401
|
+
const GAP = 8;
|
|
7772
8402
|
/**
|
|
7773
8403
|
* Short help text shown on hover and on focus.
|
|
7774
8404
|
*
|
|
@@ -7784,6 +8414,13 @@ let tooltipIds = 0;
|
|
|
7784
8414
|
* `<input>`). A chucao component such as `ch-button` will not be described,
|
|
7785
8415
|
* because `aria-*` set on a custom element host does not reach the native
|
|
7786
8416
|
* element inside it — see the discussion in issue #47.
|
|
8417
|
+
*
|
|
8418
|
+
* Positioning is measured, not purely CSS: `placement` is the preferred side,
|
|
8419
|
+
* and the bubble flips to the opposite side when the preferred one does not
|
|
8420
|
+
* fit, then shifts along the other axis to stay inside the viewport. It
|
|
8421
|
+
* re-measures on scroll, resize and visual-viewport changes, which is what
|
|
8422
|
+
* keeps it correct inside a scrolling modal or drawer and when a mobile
|
|
8423
|
+
* keyboard shrinks the visible area.
|
|
7787
8424
|
*/
|
|
7788
8425
|
class ChTooltip {
|
|
7789
8426
|
constructor(hostRef) {
|
|
@@ -7791,8 +8428,11 @@ class ChTooltip {
|
|
|
7791
8428
|
}
|
|
7792
8429
|
get el() { return getElement(this); }
|
|
7793
8430
|
fallbackId = `ch-tooltip-${++tooltipIds}`;
|
|
8431
|
+
bubbleEl;
|
|
8432
|
+
cleanup;
|
|
7794
8433
|
/**
|
|
7795
|
-
*
|
|
8434
|
+
* The side the bubble is placed on. It is a preference: when that side has no
|
|
8435
|
+
* room the bubble flips to the opposite one.
|
|
7796
8436
|
*/
|
|
7797
8437
|
placement = 'top';
|
|
7798
8438
|
// Hover and focus are tracked apart so that neither cancels the other: a
|
|
@@ -7801,15 +8441,26 @@ class ChTooltip {
|
|
|
7801
8441
|
hovered = false;
|
|
7802
8442
|
focused = false;
|
|
7803
8443
|
dismissed = false;
|
|
8444
|
+
/** The placement actually used, which may differ from the prop after a flip. */
|
|
8445
|
+
resolvedPlacement;
|
|
8446
|
+
/** Offset applied to the bubble once it has been measured. */
|
|
8447
|
+
offset;
|
|
7804
8448
|
get visible() {
|
|
7805
8449
|
return (this.hovered || this.focused) && !this.dismissed;
|
|
7806
8450
|
}
|
|
7807
8451
|
componentDidLoad() {
|
|
7808
8452
|
this.associate();
|
|
7809
8453
|
}
|
|
8454
|
+
connectedCallback() {
|
|
8455
|
+
this.watchViewport();
|
|
8456
|
+
}
|
|
8457
|
+
disconnectedCallback() {
|
|
8458
|
+
this.cleanup?.();
|
|
8459
|
+
}
|
|
7810
8460
|
handleMouseEnter() {
|
|
7811
8461
|
this.hovered = true;
|
|
7812
8462
|
this.dismissed = false;
|
|
8463
|
+
this.position();
|
|
7813
8464
|
}
|
|
7814
8465
|
handleMouseLeave() {
|
|
7815
8466
|
this.hovered = false;
|
|
@@ -7817,6 +8468,7 @@ class ChTooltip {
|
|
|
7817
8468
|
handleFocusIn() {
|
|
7818
8469
|
this.focused = true;
|
|
7819
8470
|
this.dismissed = false;
|
|
8471
|
+
this.position();
|
|
7820
8472
|
}
|
|
7821
8473
|
handleFocusOut() {
|
|
7822
8474
|
this.focused = false;
|
|
@@ -7824,15 +8476,80 @@ class ChTooltip {
|
|
|
7824
8476
|
/**
|
|
7825
8477
|
* Listens on the document because a tooltip opened by hovering leaves focus
|
|
7826
8478
|
* wherever it was, so a host-scoped handler would never see the key.
|
|
8479
|
+
*
|
|
8480
|
+
* `preventDefault()` dismisses only the innermost surface: the platform's
|
|
8481
|
+
* close request for an open native `<dialog>` is the default action of this
|
|
8482
|
+
* same keydown, so cancelling it keeps an enclosing `ch-modal` open. Proven
|
|
8483
|
+
* against a real `ch-modal` in `tests/browser/ch-tooltip.browser.spec.ts`.
|
|
7827
8484
|
*/
|
|
7828
8485
|
handleKeyDown(event) {
|
|
7829
|
-
if (event.key === 'Escape' && this.visible) {
|
|
8486
|
+
if (event.key === 'Escape' && this.visible && !event.defaultPrevented) {
|
|
8487
|
+
event.preventDefault();
|
|
7830
8488
|
this.dismissed = true;
|
|
7831
8489
|
}
|
|
7832
8490
|
}
|
|
8491
|
+
/** Cheap guard so scroll frames do not measure while nothing is shown. */
|
|
8492
|
+
handleScroll() {
|
|
8493
|
+
if (this.visible && this.offset) {
|
|
8494
|
+
this.position();
|
|
8495
|
+
}
|
|
8496
|
+
}
|
|
8497
|
+
handleResize() {
|
|
8498
|
+
this.position();
|
|
8499
|
+
}
|
|
8500
|
+
watchViewport() {
|
|
8501
|
+
if (typeof window === 'undefined') {
|
|
8502
|
+
return;
|
|
8503
|
+
}
|
|
8504
|
+
const viewport = window.visualViewport;
|
|
8505
|
+
if (!viewport || this.cleanup) {
|
|
8506
|
+
return;
|
|
8507
|
+
}
|
|
8508
|
+
const update = () => this.position();
|
|
8509
|
+
viewport.addEventListener('resize', update);
|
|
8510
|
+
viewport.addEventListener('scroll', update);
|
|
8511
|
+
this.cleanup = () => {
|
|
8512
|
+
viewport.removeEventListener('resize', update);
|
|
8513
|
+
viewport.removeEventListener('scroll', update);
|
|
8514
|
+
};
|
|
8515
|
+
}
|
|
7833
8516
|
slotted(name) {
|
|
7834
8517
|
return Array.from(this.el.children).find(child => child.getAttribute('slot') === name);
|
|
7835
8518
|
}
|
|
8519
|
+
/**
|
|
8520
|
+
* Measures the anchor and the bubble and stores the offset that keeps the
|
|
8521
|
+
* bubble inside the viewport. Nothing is measured before the bubble has a
|
|
8522
|
+
* box to measure, so the pre-paint render uses plain CSS.
|
|
8523
|
+
*/
|
|
8524
|
+
position() {
|
|
8525
|
+
if (typeof window === 'undefined') {
|
|
8526
|
+
return;
|
|
8527
|
+
}
|
|
8528
|
+
const bubble = this.bubbleEl ?? (this.bubbleEl = this.el.shadowRoot?.querySelector('.bubble') ?? undefined);
|
|
8529
|
+
if (!bubble || bubble.offsetWidth === 0) {
|
|
8530
|
+
return;
|
|
8531
|
+
}
|
|
8532
|
+
const anchorRect = this.slotted('trigger')?.getBoundingClientRect?.();
|
|
8533
|
+
if (!anchorRect) {
|
|
8534
|
+
return;
|
|
8535
|
+
}
|
|
8536
|
+
const surface = {
|
|
8537
|
+
width: bubble.offsetWidth + horizontalMargin(bubble),
|
|
8538
|
+
height: bubble.offsetHeight,
|
|
8539
|
+
};
|
|
8540
|
+
const viewport = window.visualViewport;
|
|
8541
|
+
const { placement, top, left } = placeOverlay({
|
|
8542
|
+
anchor: { top: anchorRect.top, left: anchorRect.left, width: anchorRect.width, height: anchorRect.height },
|
|
8543
|
+
surface,
|
|
8544
|
+
viewport: viewport
|
|
8545
|
+
? { top: viewport.offsetTop, left: viewport.offsetLeft, width: viewport.width, height: viewport.height }
|
|
8546
|
+
: { top: 0, left: 0, width: window.innerWidth, height: window.innerHeight },
|
|
8547
|
+
preferred: this.placement,
|
|
8548
|
+
gap: GAP,
|
|
8549
|
+
});
|
|
8550
|
+
this.resolvedPlacement = placement;
|
|
8551
|
+
this.offset = { top, left };
|
|
8552
|
+
}
|
|
7836
8553
|
/**
|
|
7837
8554
|
* Points the trigger at the text with `aria-describedby`. Re-run on
|
|
7838
8555
|
* `slotchange` because a framework re-render can replace the slotted nodes
|
|
@@ -7851,7 +8568,16 @@ class ChTooltip {
|
|
|
7851
8568
|
trigger.setAttribute('aria-describedby', content.id);
|
|
7852
8569
|
};
|
|
7853
8570
|
render() {
|
|
7854
|
-
|
|
8571
|
+
const { offset } = this;
|
|
8572
|
+
return (hAsync(Host, { key: '676e431d0100ecc9ea688b7e37bc87e8295bb24d' }, hAsync("span", { key: '20a388681252e9c4d52e662c014efd9a198efbd7', class: "anchor" }, hAsync("slot", { key: 'a06cbe31dd04cba38ef09788359783d816fc1a5b', name: "trigger", onSlotchange: this.associate }), hAsync("span", { key: '13cb5b782a7029fc82c10b9b6765de62b94b9afa', ref: el => (this.bubbleEl = el), style: {
|
|
8573
|
+
'--ch-tooltip-offset-top': offset ? `${offset.top}px` : null,
|
|
8574
|
+
'--ch-tooltip-offset-left': offset ? `${offset.left}px` : null,
|
|
8575
|
+
}, class: {
|
|
8576
|
+
'bubble': true,
|
|
8577
|
+
'bubble--positioned': Boolean(this.offset),
|
|
8578
|
+
[`bubble--${this.resolvedPlacement ?? this.placement}`]: true,
|
|
8579
|
+
'bubble--visible': this.visible,
|
|
8580
|
+
} }, hAsync("slot", { key: '6610bbf299354bb3be07bb273fab3f8fd91fd254', name: "content", onSlotchange: this.associate })))));
|
|
7855
8581
|
}
|
|
7856
8582
|
static get style() { return chTooltipCss(); }
|
|
7857
8583
|
static get cmpMeta() { return {
|
|
@@ -7861,13 +8587,18 @@ class ChTooltip {
|
|
|
7861
8587
|
"placement": [1],
|
|
7862
8588
|
"hovered": [32],
|
|
7863
8589
|
"focused": [32],
|
|
7864
|
-
"dismissed": [32]
|
|
8590
|
+
"dismissed": [32],
|
|
8591
|
+
"resolvedPlacement": [32]
|
|
7865
8592
|
},
|
|
7866
|
-
"$listeners$": [[1, "mouseenter", "handleMouseEnter"], [1, "mouseleave", "handleMouseLeave"], [0, "focusin", "handleFocusIn"], [0, "focusout", "handleFocusOut"], [4, "keydown", "handleKeyDown"]],
|
|
8593
|
+
"$listeners$": [[1, "mouseenter", "handleMouseEnter"], [1, "mouseleave", "handleMouseLeave"], [0, "focusin", "handleFocusIn"], [0, "focusout", "handleFocusOut"], [4, "keydown", "handleKeyDown"], [11, "scroll", "handleScroll"], [9, "resize", "handleResize"]],
|
|
7867
8594
|
"$lazyBundleId$": "-",
|
|
7868
8595
|
"$attrsToReflect$": []
|
|
7869
8596
|
}; }
|
|
7870
8597
|
}
|
|
8598
|
+
function horizontalMargin(el) {
|
|
8599
|
+
const style = getComputedStyle(el);
|
|
8600
|
+
return (parseFloat(style.marginLeft) || 0) + (parseFloat(style.marginRight) || 0);
|
|
8601
|
+
}
|
|
7871
8602
|
|
|
7872
8603
|
registerComponents([
|
|
7873
8604
|
ChAccordion,
|
|
@@ -7877,23 +8608,29 @@ registerComponents([
|
|
|
7877
8608
|
ChCard,
|
|
7878
8609
|
ChCheckbox,
|
|
7879
8610
|
ChCluster,
|
|
8611
|
+
ChDescriptionList,
|
|
7880
8612
|
ChDivider,
|
|
7881
8613
|
ChDrawer,
|
|
7882
8614
|
ChEmoji,
|
|
7883
8615
|
ChEmptyState,
|
|
7884
8616
|
ChGrid,
|
|
8617
|
+
ChIcon,
|
|
8618
|
+
ChIconButton,
|
|
7885
8619
|
ChInput,
|
|
7886
8620
|
ChLink,
|
|
7887
8621
|
ChModal,
|
|
8622
|
+
ChPageHeader,
|
|
7888
8623
|
ChRadio,
|
|
7889
8624
|
ChSegmentedControl,
|
|
7890
8625
|
ChSelect,
|
|
7891
8626
|
ChSkeleton,
|
|
7892
8627
|
ChSpinner,
|
|
7893
8628
|
ChStack,
|
|
8629
|
+
ChStat,
|
|
7894
8630
|
ChSwitch,
|
|
7895
8631
|
ChTabs,
|
|
7896
8632
|
ChTextarea,
|
|
8633
|
+
ChTimeline,
|
|
7897
8634
|
ChTooltip,
|
|
7898
8635
|
]);
|
|
7899
8636
|
|