@devschile/chucao 2.0.0 → 2.2.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 +2 -0
- package/dist/chucao/chucao.esm.js +1 -1
- package/dist/chucao/chucao.esm.js.map +1 -1
- package/dist/chucao/{p-a0ec231a.entry.js → p-04dbcfa0.entry.js} +2 -2
- package/dist/chucao/{p-96c852f5.entry.js → p-077dc2a6.entry.js} +2 -2
- package/dist/chucao/{p-19dde4f9.entry.js → p-079c2017.entry.js} +2 -2
- package/dist/chucao/p-37e7f9cc.entry.js +2 -0
- package/dist/chucao/p-37e7f9cc.entry.js.map +1 -0
- package/dist/chucao/{p-f04d2f75.entry.js → p-5ae89a19.entry.js} +2 -2
- package/dist/chucao/p-70285203.entry.js +2 -0
- package/dist/chucao/p-70285203.entry.js.map +1 -0
- package/dist/chucao/{p-2e20c7a1.entry.js → p-9c072600.entry.js} +2 -2
- package/dist/chucao/{p-BaKXvAYc.js → p-DWC12BJ-.js} +2 -2
- package/dist/chucao/p-DWC12BJ-.js.map +1 -0
- package/dist/chucao/p-b678a7e2.entry.js +2 -0
- package/dist/chucao/p-b678a7e2.entry.js.map +1 -0
- package/dist/chucao/p-b8bd0310.entry.js +2 -0
- package/dist/chucao/p-b8bd0310.entry.js.map +1 -0
- package/dist/chucao/p-bb2445d1.entry.js +2 -0
- package/dist/chucao/p-c986036f.entry.js +2 -0
- package/dist/chucao/p-c986036f.entry.js.map +1 -0
- package/dist/chucao/p-d8DfpzMR.js +2 -0
- package/dist/chucao/p-d8DfpzMR.js.map +1 -0
- package/dist/chucao/{p-10658dc9.entry.js → p-e3265e38.entry.js} +2 -2
- package/dist/chucao/{p-f62e1da2.entry.js → p-ff5f5c1f.entry.js} +2 -2
- package/dist/cjs/ch-accordion.cjs.entry.js +1 -1
- package/dist/cjs/ch-alert_8.cjs.entry.js +55 -12
- 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-divider.cjs.entry.js +2 -2
- package/dist/cjs/ch-drawer.cjs.entry.js +153 -0
- package/dist/cjs/ch-drawer.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-emoji.cjs.entry.js +104 -0
- package/dist/cjs/ch-emoji.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-link.cjs.entry.js +1 -1
- package/dist/cjs/ch-modal.cjs.entry.js +5 -24
- package/dist/cjs/ch-modal.cjs.entry.js.map +1 -1
- package/dist/cjs/ch-radio.cjs.entry.js +2 -2
- package/dist/cjs/ch-segmented-control.cjs.entry.js +112 -0
- package/dist/cjs/ch-segmented-control.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-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/chucao.cjs.js +3 -3
- package/dist/cjs/chucao.cjs.js.map +1 -1
- package/dist/cjs/{index-C9Abf0td.js → index-C9cpLteP.js} +15 -8
- package/dist/cjs/index-C9cpLteP.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/scroll-lock-DIRqLP4K.js +49 -0
- package/dist/cjs/scroll-lock-DIRqLP4K.js.map +1 -0
- package/dist/collection/collection-manifest.json +4 -1
- package/dist/collection/components/ch-button/ch-button.css +56 -18
- package/dist/collection/components/ch-button/ch-button.js +135 -8
- package/dist/collection/components/ch-button/ch-button.js.map +1 -1
- package/dist/collection/components/ch-card/ch-card.js +1 -1
- package/dist/collection/components/ch-checkbox/ch-checkbox.js +1 -1
- package/dist/collection/components/ch-divider/ch-divider.js +1 -1
- package/dist/collection/components/ch-drawer/ch-drawer.css +152 -0
- package/dist/collection/components/ch-drawer/ch-drawer.js +285 -0
- package/dist/collection/components/ch-drawer/ch-drawer.js.map +1 -0
- package/dist/collection/components/ch-emoji/ch-emoji.css +33 -0
- package/dist/collection/components/ch-emoji/ch-emoji.js +151 -0
- package/dist/collection/components/ch-emoji/ch-emoji.js.map +1 -0
- package/dist/collection/components/ch-input/ch-input.js +1 -1
- package/dist/collection/components/ch-modal/ch-modal.js +4 -23
- package/dist/collection/components/ch-modal/ch-modal.js.map +1 -1
- package/dist/collection/components/ch-radio/ch-radio.js +1 -1
- package/dist/collection/components/ch-segmented-control/ch-segmented-control.css +88 -0
- package/dist/collection/components/ch-segmented-control/ch-segmented-control.js +295 -0
- package/dist/collection/components/ch-segmented-control/ch-segmented-control.js.map +1 -0
- package/dist/collection/components/ch-select/ch-select.js +1 -1
- package/dist/collection/components/ch-spinner/ch-spinner.js +1 -1
- 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-tooltip/ch-tooltip.js +1 -1
- package/dist/collection/utils/scroll-lock.js +42 -0
- package/dist/collection/utils/scroll-lock.js.map +1 -0
- package/dist/components/ch-accordion.js +1 -1
- package/dist/components/ch-alert.js +1 -1
- package/dist/components/ch-badge.js +1 -1
- package/dist/components/ch-button.js +1 -1
- package/dist/components/ch-button.js.map +1 -1
- package/dist/components/ch-card.js +1 -1
- package/dist/components/ch-checkbox.js +1 -1
- package/dist/components/ch-divider.js +1 -1
- package/dist/components/ch-drawer.d.ts +11 -0
- package/dist/components/ch-drawer.js +2 -0
- package/dist/components/ch-drawer.js.map +1 -0
- package/dist/components/ch-emoji.d.ts +11 -0
- package/dist/components/ch-emoji.js +2 -0
- package/dist/components/ch-emoji.js.map +1 -0
- package/dist/components/ch-input.js +1 -1
- package/dist/components/ch-link.js +1 -1
- package/dist/components/ch-modal.js +1 -1
- package/dist/components/ch-modal.js.map +1 -1
- package/dist/components/ch-radio.js +1 -1
- package/dist/components/ch-segmented-control.d.ts +11 -0
- package/dist/components/ch-segmented-control.js +2 -0
- package/dist/components/ch-segmented-control.js.map +1 -0
- package/dist/components/ch-select.js +1 -1
- package/dist/components/ch-spinner.js +1 -1
- package/dist/components/ch-spinner.js.map +1 -1
- 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-tooltip.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{p-DL-bL54o.js → p-BhAZrOxf.js} +2 -2
- package/dist/components/p-BhAZrOxf.js.map +1 -0
- package/dist/components/p-C4eGmLcE.js +2 -0
- package/dist/components/p-C4eGmLcE.js.map +1 -0
- package/dist/components/p-d8DfpzMR.js +2 -0
- package/dist/components/p-d8DfpzMR.js.map +1 -0
- package/dist/esm/ch-accordion.entry.js +1 -1
- package/dist/esm/ch-alert_8.entry.js +55 -12
- package/dist/esm/ch-alert_8.entry.js.map +1 -1
- package/dist/esm/ch-checkbox.entry.js +2 -2
- package/dist/esm/ch-divider.entry.js +2 -2
- package/dist/esm/ch-drawer.entry.js +151 -0
- package/dist/esm/ch-drawer.entry.js.map +1 -0
- package/dist/esm/ch-emoji.entry.js +102 -0
- package/dist/esm/ch-emoji.entry.js.map +1 -0
- package/dist/esm/ch-link.entry.js +1 -1
- package/dist/esm/ch-modal.entry.js +5 -24
- package/dist/esm/ch-modal.entry.js.map +1 -1
- package/dist/esm/ch-radio.entry.js +2 -2
- package/dist/esm/ch-segmented-control.entry.js +110 -0
- package/dist/esm/ch-segmented-control.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-tooltip.entry.js +2 -2
- package/dist/esm/chucao.js +4 -4
- package/dist/esm/chucao.js.map +1 -1
- package/dist/esm/{index-BaKXvAYc.js → index-DWC12BJ-.js} +15 -8
- package/dist/esm/index-DWC12BJ-.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/scroll-lock-d8DfpzMR.js +46 -0
- package/dist/esm/scroll-lock-d8DfpzMR.js.map +1 -0
- package/dist/types/components/ch-button/ch-button.d.ts +29 -5
- package/dist/types/components/ch-drawer/ch-drawer.d.ts +68 -0
- package/dist/types/components/ch-emoji/ch-emoji.d.ts +32 -0
- package/dist/types/components/ch-segmented-control/ch-segmented-control.d.ts +72 -0
- package/dist/types/components.d.ts +405 -6
- package/dist/types/stencil-public-runtime.d.ts +1 -0
- package/dist/types/utils/scroll-lock.d.ts +17 -0
- package/dist-react/components.d.ts +15 -1
- package/dist-react/components.js +30 -0
- package/dist-react/components.ts +43 -1
- package/dist-vue/index.d.ts +3 -0
- package/dist-vue/index.js +35 -0
- package/dist-vue/index.ts +41 -0
- package/hydrate/index.js +541 -46
- package/hydrate/index.mjs +541 -46
- package/loader/index.d.ts +1 -1
- package/package.json +5 -3
- package/dist/chucao/p-66dce533.entry.js +0 -2
- package/dist/chucao/p-66dce533.entry.js.map +0 -1
- package/dist/chucao/p-75184fe1.entry.js +0 -2
- package/dist/chucao/p-75184fe1.entry.js.map +0 -1
- package/dist/chucao/p-BaKXvAYc.js.map +0 -1
- package/dist/chucao/p-e48912c7.entry.js +0 -2
- package/dist/cjs/index-C9Abf0td.js.map +0 -1
- package/dist/components/p-DL-bL54o.js.map +0 -1
- package/dist/esm/index-BaKXvAYc.js.map +0 -1
- /package/dist/chucao/{p-a0ec231a.entry.js.map → p-04dbcfa0.entry.js.map} +0 -0
- /package/dist/chucao/{p-96c852f5.entry.js.map → p-077dc2a6.entry.js.map} +0 -0
- /package/dist/chucao/{p-19dde4f9.entry.js.map → p-079c2017.entry.js.map} +0 -0
- /package/dist/chucao/{p-f04d2f75.entry.js.map → p-5ae89a19.entry.js.map} +0 -0
- /package/dist/chucao/{p-2e20c7a1.entry.js.map → p-9c072600.entry.js.map} +0 -0
- /package/dist/chucao/{p-e48912c7.entry.js.map → p-bb2445d1.entry.js.map} +0 -0
- /package/dist/chucao/{p-10658dc9.entry.js.map → p-e3265e38.entry.js.map} +0 -0
- /package/dist/chucao/{p-f62e1da2.entry.js.map → p-ff5f5c1f.entry.js.map} +0 -0
package/dist/esm/loader.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { g as globalScripts, b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { g as globalScripts, b as bootstrapLazy } from './index-DWC12BJ-.js';
|
|
2
|
+
export { s as setNonce } from './index-DWC12BJ-.js';
|
|
3
3
|
|
|
4
4
|
const defineCustomElements = async (win, options) => {
|
|
5
5
|
if (typeof window === 'undefined') return undefined;
|
|
6
6
|
await globalScripts();
|
|
7
|
-
return bootstrapLazy([["ch-
|
|
7
|
+
return bootstrapLazy([["ch-accordion",[[769,"ch-accordion",{"items":[16],"value":[1025]}]]],["ch-checkbox",[[577,"ch-checkbox",{"label":[1],"name":[513],"value":[1],"checked":[1028],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"checked":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-divider",[[513,"ch-divider",{"orientation":[1]}]]],["ch-drawer",[[769,"ch-drawer",{"open":[1028],"side":[1],"label":[1],"closeLabel":[1,"close-label"]},null,{"open":[{"handleOpenChange":0}]}]]],["ch-emoji",[[513,"ch-emoji",{"name":[1],"alt":[1],"size":[1],"extIndex":[32],"loaded":[32]},null,{"name":[{"handleNameChange":0}]}]]],["ch-link",[[769,"ch-link",{"href":[1],"target":[1],"variant":[1],"disabled":[4]}]]],["ch-modal",[[769,"ch-modal",{"open":[1028],"label":[1],"closeLabel":[1,"close-label"]},null,{"open":[{"handleOpenChange":0}]}]]],["ch-radio",[[577,"ch-radio",{"label":[1],"options":[16],"value":[1025],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-segmented-control",[[577,"ch-segmented-control",{"label":[1],"options":[16],"value":[1025],"size":[1],"name":[513],"disabled":[516],"required":[516],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}]}]]],["ch-tabs",[[769,"ch-tabs",{"tabs":[16],"value":[1025],"label":[1]}]]],["ch-textarea",[[577,"ch-textarea",{"label":[1],"value":[1025],"placeholder":[1],"rows":[2],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-tooltip",[[769,"ch-tooltip",{"placement":[1],"hovered":[32],"focused":[32],"dismissed":[32]},[[1,"mouseenter","handleMouseEnter"],[1,"mouseleave","handleMouseLeave"],[0,"focusin","handleFocusIn"],[0,"focusout","handleFocusOut"],[4,"keydown","handleKeyDown"]]]]],["ch-alert_8",[[769,"ch-button",{"variant":[1],"size":[1],"disabled":[4],"loading":[4],"href":[1],"target":[1],"label":[1]}],[769,"ch-alert",{"variant":[1],"dismissLabel":[1,"dismiss-label"]}],[769,"ch-badge",{"variant":[1]}],[257,"ch-card"],[577,"ch-input",{"label":[1],"type":[1],"value":[1025],"placeholder":[1],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[577,"ch-select",{"label":[1],"options":[16],"value":[1025],"placeholder":[1],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[577,"ch-switch",{"label":[1],"name":[513],"value":[1],"checked":[1028],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"checked":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[513,"ch-spinner",{"size":[1],"label":[1]}]]]], options);
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
export { defineCustomElements };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
let openOverlays = 0;
|
|
2
|
+
let previousOverflow = '';
|
|
3
|
+
let previousPaddingRight = '';
|
|
4
|
+
/**
|
|
5
|
+
* Prevents the page behind an overlay from scrolling, compensating for the
|
|
6
|
+
* scrollbar it removes so the layout does not shift.
|
|
7
|
+
*
|
|
8
|
+
* Reference-counted on a module-level counter, so concurrent overlays (a modal
|
|
9
|
+
* over a drawer, several stacked dialogs) cannot unlock the page early:
|
|
10
|
+
* whichever overlay closes first only decrements the count, and the last one
|
|
11
|
+
* restores the original styles.
|
|
12
|
+
*
|
|
13
|
+
* Callers must pair every `lockScroll()` with exactly one `unlockScroll()`.
|
|
14
|
+
*/
|
|
15
|
+
function lockScroll() {
|
|
16
|
+
openOverlays += 1;
|
|
17
|
+
if (openOverlays > 1) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const root = document.documentElement;
|
|
21
|
+
const scrollbar = window.innerWidth - root.clientWidth;
|
|
22
|
+
previousOverflow = root.style.overflow;
|
|
23
|
+
previousPaddingRight = root.style.paddingRight;
|
|
24
|
+
root.style.overflow = 'hidden';
|
|
25
|
+
if (scrollbar > 0) {
|
|
26
|
+
root.style.paddingRight = `${scrollbar}px`;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Releases one scroll lock. Only the last lock restores the page; earlier calls
|
|
31
|
+
* are a no-op so the overlay still open keeps the page frozen.
|
|
32
|
+
*/
|
|
33
|
+
function unlockScroll() {
|
|
34
|
+
openOverlays -= 1;
|
|
35
|
+
if (openOverlays > 0) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const root = document.documentElement;
|
|
39
|
+
root.style.overflow = previousOverflow;
|
|
40
|
+
root.style.paddingRight = previousPaddingRight;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export { lockScroll as l, unlockScroll as u };
|
|
44
|
+
//# sourceMappingURL=scroll-lock-d8DfpzMR.js.map
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=scroll-lock-d8DfpzMR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll-lock-d8DfpzMR.js","sources":["src/utils/scroll-lock.ts"],"sourcesContent":["let openOverlays = 0;\nlet previousOverflow = '';\nlet previousPaddingRight = '';\n\n/**\n * Prevents the page behind an overlay from scrolling, compensating for the\n * scrollbar it removes so the layout does not shift.\n *\n * Reference-counted on a module-level counter, so concurrent overlays (a modal\n * over a drawer, several stacked dialogs) cannot unlock the page early:\n * whichever overlay closes first only decrements the count, and the last one\n * restores the original styles.\n *\n * Callers must pair every `lockScroll()` with exactly one `unlockScroll()`.\n */\nexport function lockScroll() {\n openOverlays += 1;\n if (openOverlays > 1) {\n return;\n }\n const root = document.documentElement;\n const scrollbar = window.innerWidth - root.clientWidth;\n previousOverflow = root.style.overflow;\n previousPaddingRight = root.style.paddingRight;\n root.style.overflow = 'hidden';\n if (scrollbar > 0) {\n root.style.paddingRight = `${scrollbar}px`;\n }\n}\n\n/**\n * Releases one scroll lock. Only the last lock restores the page; earlier calls\n * are a no-op so the overlay still open keeps the page frozen.\n */\nexport function unlockScroll() {\n openOverlays -= 1;\n if (openOverlays > 0) {\n return;\n }\n const root = document.documentElement;\n root.style.overflow = previousOverflow;\n root.style.paddingRight = previousPaddingRight;\n}\n"],"names":[],"mappings":"AAAA,IAAI,YAAY,GAAG,CAAC;AACpB,IAAI,gBAAgB,GAAG,EAAE;AACzB,IAAI,oBAAoB,GAAG,EAAE;AAE7B;;;;;;;;;;AAUG;SACa,UAAU,GAAA;IACxB,YAAY,IAAI,CAAC;AACjB,IAAA,IAAI,YAAY,GAAG,CAAC,EAAE;QACpB;;AAEF,IAAA,MAAM,IAAI,GAAG,QAAQ,CAAC,eAAe;IACrC,MAAM,SAAS,GAAG,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC,WAAW;AACtD,IAAA,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ;AACtC,IAAA,oBAAoB,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY;AAC9C,IAAA,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,QAAQ;AAC9B,IAAA,IAAI,SAAS,GAAG,CAAC,EAAE;QACjB,IAAI,CAAC,KAAK,CAAC,YAAY,GAAG,CAAA,EAAG,SAAS,IAAI;;AAE9C;AAEA;;;AAGG;SACa,YAAY,GAAA;IAC1B,YAAY,IAAI,CAAC;AACjB,IAAA,IAAI,YAAY,GAAG,CAAC,EAAE;QACpB;;AAEF,IAAA,MAAM,IAAI,GAAG,QAAQ,CAAC,eAAe;AACrC,IAAA,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,gBAAgB;AACtC,IAAA,IAAI,CAAC,KAAK,CAAC,YAAY,GAAG,oBAAoB;AAChD;;;;"}
|
|
@@ -1,18 +1,40 @@
|
|
|
1
1
|
import { type EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
-
export type ChButtonVariant = 'primary' | 'secondary';
|
|
2
|
+
export type ChButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger';
|
|
3
|
+
export type ChButtonSize = 'sm' | 'md' | 'lg';
|
|
3
4
|
export declare class ChButton {
|
|
4
5
|
/**
|
|
5
|
-
* The visual style of the button.
|
|
6
|
+
* The visual style of the button. One of `primary`, `secondary`, `ghost`,
|
|
7
|
+
* or `danger`.
|
|
6
8
|
*/
|
|
7
9
|
variant: ChButtonVariant;
|
|
10
|
+
/**
|
|
11
|
+
* The size of the button. One of `sm`, `md`, or `lg`.
|
|
12
|
+
*/
|
|
13
|
+
size: ChButtonSize;
|
|
8
14
|
/**
|
|
9
15
|
* Whether the button is disabled.
|
|
10
16
|
*/
|
|
11
17
|
disabled: boolean;
|
|
12
18
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
|
|
19
|
+
* Whether the button is loading. Shows a spinner, disables interaction, and
|
|
20
|
+
* announces the busy state with `aria-busy`.
|
|
21
|
+
*/
|
|
22
|
+
loading: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* When set, the button renders as an `<a>` pointing to this URL while
|
|
25
|
+
* keeping the button styling.
|
|
26
|
+
*/
|
|
27
|
+
href?: string;
|
|
28
|
+
/**
|
|
29
|
+
* The browsing context the link opens in (e.g. `_blank`). Only used when
|
|
30
|
+
* `href` is set. For `_blank`, a `noopener noreferrer` `rel` is added
|
|
31
|
+
* automatically.
|
|
32
|
+
*/
|
|
33
|
+
target?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Accessible label set as `aria-label` on the native element. Use it when
|
|
36
|
+
* the button's content doesn't convey its purpose on its own (e.g. an
|
|
37
|
+
* icon-only button).
|
|
16
38
|
*/
|
|
17
39
|
label?: string;
|
|
18
40
|
/**
|
|
@@ -20,5 +42,7 @@ export declare class ChButton {
|
|
|
20
42
|
*/
|
|
21
43
|
chClick: EventEmitter<MouseEvent>;
|
|
22
44
|
private handleClick;
|
|
45
|
+
private get spinnerSize();
|
|
46
|
+
private renderContent;
|
|
23
47
|
render(): any;
|
|
24
48
|
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { type EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
export type ChDrawerSide = 'start' | 'end' | 'top' | 'bottom';
|
|
3
|
+
/**
|
|
4
|
+
* Sliding side panel for navigation, editing forms and quick detail views.
|
|
5
|
+
*
|
|
6
|
+
* Built on the native `<dialog>` element and opened with `showModal()`, exactly
|
|
7
|
+
* like `ch-modal`, so the browser owns focus management, the inert background,
|
|
8
|
+
* `Escape`, the top layer, `::backdrop`, and the implicit `dialog` role with
|
|
9
|
+
* `aria-modal="true"`. The only differences are placement — anchored to one
|
|
10
|
+
* edge instead of centred — and the longer content it is meant for, which is
|
|
11
|
+
* why it exposes `header` and `footer` slots around a scrollable body.
|
|
12
|
+
*
|
|
13
|
+
* Scroll locking is shared with `ch-modal` through `utils/scroll-lock`, so a
|
|
14
|
+
* drawer and a modal opened together cannot unlock the page early.
|
|
15
|
+
*/
|
|
16
|
+
export declare class ChDrawer {
|
|
17
|
+
/**
|
|
18
|
+
* Whether the drawer is open. Kept in sync when the user closes it with
|
|
19
|
+
* `Escape`, the close button or a click outside.
|
|
20
|
+
*/
|
|
21
|
+
open: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* The edge the panel slides in from. `start`/`end` follow the writing
|
|
24
|
+
* direction, so `start` is the left edge in LTR and the right edge in RTL.
|
|
25
|
+
*/
|
|
26
|
+
side: ChDrawerSide;
|
|
27
|
+
/**
|
|
28
|
+
* Accessible name for the drawer, set as `aria-label`. A slotted heading
|
|
29
|
+
* cannot be referenced with `aria-labelledby` across the shadow boundary, so
|
|
30
|
+
* the name comes through this prop — and a modal dialog needs one, so pass
|
|
31
|
+
* the same text as the heading.
|
|
32
|
+
*/
|
|
33
|
+
label?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Accessible label for the close button, set as `aria-label`. Setting it is
|
|
36
|
+
* what adds the button: its only content is a decorative glyph, so without a
|
|
37
|
+
* label it would have no accessible name.
|
|
38
|
+
*/
|
|
39
|
+
closeLabel?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Emitted after the drawer opens.
|
|
42
|
+
*/
|
|
43
|
+
chOpen: EventEmitter<void>;
|
|
44
|
+
/**
|
|
45
|
+
* Emitted after the drawer closes, however it was closed.
|
|
46
|
+
*/
|
|
47
|
+
chClose: EventEmitter<void>;
|
|
48
|
+
private dialog?;
|
|
49
|
+
private scrollLocked;
|
|
50
|
+
private pointerDownedOutside;
|
|
51
|
+
componentDidLoad(): void;
|
|
52
|
+
disconnectedCallback(): void;
|
|
53
|
+
handleOpenChange(open: boolean): void;
|
|
54
|
+
private showDialog;
|
|
55
|
+
private closeDialog;
|
|
56
|
+
private lockScroll;
|
|
57
|
+
private unlockScroll;
|
|
58
|
+
/**
|
|
59
|
+
* True for a pointer event on the backdrop: the `<dialog>` is the event
|
|
60
|
+
* target for its own box only, and the coordinates fall outside that box.
|
|
61
|
+
*/
|
|
62
|
+
private isOnBackdrop;
|
|
63
|
+
private handlePointerDown;
|
|
64
|
+
private handleClick;
|
|
65
|
+
private handleNativeClose;
|
|
66
|
+
private handleCloseClick;
|
|
67
|
+
render(): any;
|
|
68
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export type ChEmojiSize = 'sm' | 'md' | 'lg' | 'xl';
|
|
2
|
+
/**
|
|
3
|
+
* Inline emoji from the devsChile CDN.
|
|
4
|
+
*
|
|
5
|
+
* Given a name (or alias from the emoji map), the component resolves the
|
|
6
|
+
* asset URL and tries each possible file extension until one loads.
|
|
7
|
+
* Size is controlled via the `size` prop.
|
|
8
|
+
*/
|
|
9
|
+
export declare class ChEmoji {
|
|
10
|
+
private extIndex;
|
|
11
|
+
private loaded;
|
|
12
|
+
/**
|
|
13
|
+
* The emoji name or alias, e.g. `"huemul-love"` or `"heart"`.
|
|
14
|
+
*/
|
|
15
|
+
name: string;
|
|
16
|
+
/**
|
|
17
|
+
* Accessible alt text for the image. Defaults to the `name` prop.
|
|
18
|
+
*/
|
|
19
|
+
alt?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Size of the emoji. Either `sm`, `md`, `lg`, or `xl`.
|
|
22
|
+
*/
|
|
23
|
+
size: ChEmojiSize;
|
|
24
|
+
componentWillLoad(): void;
|
|
25
|
+
handleNameChange(): void;
|
|
26
|
+
private resolveAsset;
|
|
27
|
+
private get assetName();
|
|
28
|
+
private get currentSrc();
|
|
29
|
+
private handleError;
|
|
30
|
+
private handleLoad;
|
|
31
|
+
render(): any;
|
|
32
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { type EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
export interface ChSegmentedControlOption {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export type ChSegmentedControlSize = 'sm' | 'md';
|
|
8
|
+
/**
|
|
9
|
+
* Compact control for switching between a few mutually exclusive options
|
|
10
|
+
* (all/in/out, movement type, and similar filters).
|
|
11
|
+
*
|
|
12
|
+
* Built on native radio inputs sharing a name inside a `role="radiogroup"`,
|
|
13
|
+
* so arrow-key navigation, a single tab stop, `:focus-visible` and native form
|
|
14
|
+
* participation come from the platform instead of hand-rolled key handling.
|
|
15
|
+
* It is form-associated like the other controls: inside a `<form>` the selected
|
|
16
|
+
* value is submitted under `name`, and `required` with an empty value is
|
|
17
|
+
* invalid.
|
|
18
|
+
*
|
|
19
|
+
* It differs from `ch-radio` in presentation only — segments in a joined track
|
|
20
|
+
* instead of a vertical list of radio marks — so it is meant for compact
|
|
21
|
+
* filters, not for long option lists.
|
|
22
|
+
*/
|
|
23
|
+
export declare class ChSegmentedControl {
|
|
24
|
+
private readonly groupId;
|
|
25
|
+
private readonly labelId;
|
|
26
|
+
private initialValue;
|
|
27
|
+
internals: ElementInternals;
|
|
28
|
+
formDisabled: boolean;
|
|
29
|
+
private host;
|
|
30
|
+
/**
|
|
31
|
+
* Visible label describing the group, associated with it via
|
|
32
|
+
* `aria-labelledby`.
|
|
33
|
+
*/
|
|
34
|
+
label?: string;
|
|
35
|
+
/**
|
|
36
|
+
* The list of options rendered as segments.
|
|
37
|
+
*/
|
|
38
|
+
options: ChSegmentedControlOption[];
|
|
39
|
+
/**
|
|
40
|
+
* The value of the selected option.
|
|
41
|
+
*/
|
|
42
|
+
value?: string;
|
|
43
|
+
/**
|
|
44
|
+
* The size of the segments. Either `sm` or `md`.
|
|
45
|
+
*/
|
|
46
|
+
size: ChSegmentedControlSize;
|
|
47
|
+
/**
|
|
48
|
+
* The name shared by all radio inputs in the group, also used to submit the
|
|
49
|
+
* value. Defaults to an auto-generated group name so options are mutually
|
|
50
|
+
* exclusive out of the box.
|
|
51
|
+
*/
|
|
52
|
+
name?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Whether all segments are disabled.
|
|
55
|
+
*/
|
|
56
|
+
disabled: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Whether a value is required.
|
|
59
|
+
*/
|
|
60
|
+
required: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Emitted when a new option is selected, with the selected value.
|
|
63
|
+
*/
|
|
64
|
+
chChange: EventEmitter<string>;
|
|
65
|
+
private handleChange;
|
|
66
|
+
protected syncForm(): void;
|
|
67
|
+
componentDidLoad(): void;
|
|
68
|
+
private markTouched;
|
|
69
|
+
formResetCallback(): void;
|
|
70
|
+
formDisabledCallback(isDisabled: boolean): void;
|
|
71
|
+
render(): any;
|
|
72
|
+
}
|