@devschile/chucao 2.7.1 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chucao/chucao.esm.js +1 -1
- package/dist/chucao/{p-deb2571b.entry.js → p-0831c6f2.entry.js} +2 -2
- package/dist/chucao/p-0d7fc720.entry.js +2 -0
- package/dist/chucao/{p-60e1c1df.entry.js.map → p-0d7fc720.entry.js.map} +1 -1
- package/dist/chucao/{p-42028c97.entry.js → p-19d90f87.entry.js} +2 -2
- package/dist/chucao/{p-1b70e3f1.entry.js → p-25f4f815.entry.js} +2 -2
- package/dist/chucao/{p-472ec451.entry.js → p-3e0d7585.entry.js} +2 -2
- package/dist/chucao/{p-f917d34f.entry.js → p-46dae34b.entry.js} +2 -2
- package/dist/chucao/{p-01b6c7bf.entry.js → p-5093c486.entry.js} +2 -2
- package/dist/chucao/{p-337d7f68.entry.js → p-51f6327c.entry.js} +2 -2
- package/dist/chucao/{p-ffecdf25.entry.js → p-5577e0a0.entry.js} +2 -2
- package/dist/chucao/{p-15d27bb7.entry.js → p-56e41372.entry.js} +2 -2
- package/dist/chucao/{p-9ebcc7be.entry.js → p-6c2e5931.entry.js} +2 -2
- package/dist/chucao/{p-f6ab0a11.entry.js → p-6e93c392.entry.js} +2 -2
- package/dist/chucao/{p-9db118d9.entry.js → p-7f99ae48.entry.js} +2 -2
- package/dist/chucao/p-8b09ad3c.entry.js +2 -0
- package/dist/chucao/p-8b09ad3c.entry.js.map +1 -0
- package/dist/chucao/{p-7cdc71cc.entry.js → p-8fcf6d36.entry.js} +2 -2
- package/dist/chucao/{p-CIV5Gg1o.js → p-8l_6qAY9.js} +3 -3
- package/dist/chucao/p-8l_6qAY9.js.map +1 -0
- package/dist/chucao/{p-1e4cd3aa.entry.js → p-920d5727.entry.js} +2 -2
- package/dist/chucao/{p-c90da3c0.entry.js → p-ad41da02.entry.js} +2 -2
- package/dist/chucao/p-af088ffd.entry.js +2 -0
- package/dist/chucao/p-af088ffd.entry.js.map +1 -0
- package/dist/chucao/{p-d8b71751.entry.js → p-b42ec9bf.entry.js} +2 -2
- package/dist/chucao/{p-2e37c61b.entry.js → p-b80c39c3.entry.js} +2 -2
- package/dist/chucao/{p-a7c674b7.entry.js → p-ba589c2f.entry.js} +2 -2
- package/dist/chucao/{p-0c7f6f8d.entry.js → p-c4d68ab7.entry.js} +2 -2
- package/dist/chucao/{p-90284ebe.entry.js → p-c98e2a50.entry.js} +2 -2
- package/dist/chucao/{p-8ae680a4.entry.js → p-ca3179ae.entry.js} +2 -2
- package/dist/chucao/{p-5240f5ac.entry.js → p-d630f662.entry.js} +2 -2
- package/dist/chucao/{p-c4b2bd1f.entry.js → p-d868bdbc.entry.js} +2 -2
- package/dist/chucao/{p-e77d35c3.entry.js → p-e6b7b2da.entry.js} +2 -2
- package/dist/chucao/p-eb39b9c2.entry.js +2 -0
- package/dist/chucao/p-eb39b9c2.entry.js.map +1 -0
- package/dist/chucao/{p-10f6801e.entry.js → p-f0c288db.entry.js} +2 -2
- package/dist/cjs/ch-accordion.cjs.entry.js +2 -2
- package/dist/cjs/ch-alert_8.cjs.entry.js +8 -8
- package/dist/cjs/ch-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/ch-cluster.cjs.entry.js +3 -3
- package/dist/cjs/ch-confirm-dialog.cjs.entry.js +138 -0
- package/dist/cjs/ch-confirm-dialog.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-description-list.cjs.entry.js +2 -2
- package/dist/cjs/ch-divider.cjs.entry.js +2 -2
- package/dist/cjs/ch-drawer.cjs.entry.js +2 -2
- package/dist/cjs/ch-emoji.cjs.entry.js +2 -2
- package/dist/cjs/ch-empty-state.cjs.entry.js +2 -2
- package/dist/cjs/ch-grid.cjs.entry.js +2 -2
- package/dist/cjs/ch-icon-button.cjs.entry.js +2 -2
- package/dist/cjs/ch-icon.cjs.entry.js +2 -2
- package/dist/cjs/ch-link.cjs.entry.js +1 -1
- package/dist/cjs/ch-modal.cjs.entry.js +2 -2
- package/dist/cjs/ch-number-input.cjs.entry.js +3 -3
- package/dist/cjs/ch-otp-input.cjs.entry.js +196 -0
- package/dist/cjs/ch-otp-input.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-page-header.cjs.entry.js +2 -2
- package/dist/cjs/ch-pagination.cjs.entry.js +67 -0
- package/dist/cjs/ch-pagination.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-radio.cjs.entry.js +2 -2
- package/dist/cjs/ch-segmented-control.cjs.entry.js +2 -2
- package/dist/cjs/ch-skeleton.cjs.entry.js +2 -2
- package/dist/cjs/ch-stack.cjs.entry.js +2 -2
- package/dist/cjs/ch-stat.cjs.entry.js +3 -3
- package/dist/cjs/ch-table.cjs.entry.js +2 -2
- package/dist/cjs/ch-tabs.cjs.entry.js +2 -2
- package/dist/cjs/ch-textarea.cjs.entry.js +2 -2
- package/dist/cjs/ch-timeline.cjs.entry.js +2 -2
- package/dist/cjs/ch-tooltip.cjs.entry.js +3 -3
- package/dist/cjs/chucao.cjs.js +2 -2
- package/dist/cjs/{index-ByZY6aTj.js → index-C6khqyw3.js} +19 -2
- package/dist/cjs/index-C6khqyw3.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +3 -0
- package/dist/collection/components/ch-accordion/ch-accordion.js +1 -1
- package/dist/collection/components/ch-alert/ch-alert.js +1 -1
- package/dist/collection/components/ch-badge/ch-badge.js +1 -1
- package/dist/collection/components/ch-card/ch-card.js +1 -1
- package/dist/collection/components/ch-checkbox/ch-checkbox.js +1 -1
- package/dist/collection/components/ch-cluster/ch-cluster.js +2 -2
- package/dist/collection/components/ch-confirm-dialog/ch-confirm-dialog.css +71 -0
- package/dist/collection/components/ch-confirm-dialog/ch-confirm-dialog.js +382 -0
- package/dist/collection/components/ch-confirm-dialog/ch-confirm-dialog.js.map +1 -0
- package/dist/collection/components/ch-description-list/ch-description-list.js +1 -1
- package/dist/collection/components/ch-divider/ch-divider.js +1 -1
- package/dist/collection/components/ch-drawer/ch-drawer.js +1 -1
- package/dist/collection/components/ch-emoji/ch-emoji.js +1 -1
- package/dist/collection/components/ch-empty-state/ch-empty-state.js +1 -1
- package/dist/collection/components/ch-grid/ch-grid.js +1 -1
- package/dist/collection/components/ch-icon/ch-icon.js +1 -1
- package/dist/collection/components/ch-icon-button/ch-icon-button.js +1 -1
- package/dist/collection/components/ch-input/ch-input.js +1 -1
- package/dist/collection/components/ch-modal/ch-modal.js +1 -1
- package/dist/collection/components/ch-number-input/ch-number-input.js +2 -2
- package/dist/collection/components/ch-otp-input/ch-otp-input.css +86 -0
- package/dist/collection/components/ch-otp-input/ch-otp-input.js +478 -0
- package/dist/collection/components/ch-otp-input/ch-otp-input.js.map +1 -0
- package/dist/collection/components/ch-page-header/ch-page-header.js +1 -1
- package/dist/collection/components/ch-pagination/ch-pagination.css +63 -0
- package/dist/collection/components/ch-pagination/ch-pagination.js +228 -0
- package/dist/collection/components/ch-pagination/ch-pagination.js.map +1 -0
- package/dist/collection/components/ch-radio/ch-radio.js +1 -1
- package/dist/collection/components/ch-segmented-control/ch-segmented-control.js +1 -1
- package/dist/collection/components/ch-select/ch-select.js +1 -1
- package/dist/collection/components/ch-skeleton/ch-skeleton.js +1 -1
- package/dist/collection/components/ch-spinner/ch-spinner.js +1 -1
- package/dist/collection/components/ch-stack/ch-stack.js +1 -1
- package/dist/collection/components/ch-stat/ch-stat.js +2 -2
- package/dist/collection/components/ch-switch/ch-switch.js +1 -1
- package/dist/collection/components/ch-table/ch-table.js +1 -1
- package/dist/collection/components/ch-tabs/ch-tabs.js +1 -1
- package/dist/collection/components/ch-textarea/ch-textarea.js +1 -1
- package/dist/collection/components/ch-timeline/ch-timeline.js +1 -1
- package/dist/collection/components/ch-tooltip/ch-tooltip.js +2 -2
- package/dist/components/ch-accordion.js +1 -1
- package/dist/components/ch-alert.js +1 -1
- package/dist/components/ch-badge.js +1 -1
- package/dist/components/ch-button.js +1 -1
- package/dist/components/ch-card.js +1 -1
- package/dist/components/ch-checkbox.js +1 -1
- package/dist/components/ch-cluster.js +1 -1
- package/dist/components/ch-confirm-dialog.d.ts +11 -0
- package/dist/components/ch-confirm-dialog.js +2 -0
- package/dist/components/ch-confirm-dialog.js.map +1 -0
- package/dist/components/ch-description-list.js +1 -1
- package/dist/components/ch-divider.js +1 -1
- package/dist/components/ch-drawer.js +1 -1
- package/dist/components/ch-emoji.js +1 -1
- package/dist/components/ch-empty-state.js +1 -1
- package/dist/components/ch-grid.js +1 -1
- package/dist/components/ch-icon-button.js +1 -1
- package/dist/components/ch-icon.js +1 -1
- package/dist/components/ch-input.js +1 -1
- package/dist/components/ch-modal.js +1 -1
- package/dist/components/ch-modal.js.map +1 -1
- package/dist/components/ch-number-input.js +1 -1
- package/dist/components/ch-otp-input.d.ts +11 -0
- package/dist/components/ch-otp-input.js +2 -0
- package/dist/components/ch-otp-input.js.map +1 -0
- package/dist/components/ch-page-header.js +1 -1
- package/dist/components/ch-pagination.d.ts +11 -0
- package/dist/components/ch-pagination.js +2 -0
- package/dist/components/ch-pagination.js.map +1 -0
- package/dist/components/ch-radio.js +1 -1
- package/dist/components/ch-segmented-control.js +1 -1
- package/dist/components/ch-select.js +1 -1
- package/dist/components/ch-skeleton.js +1 -1
- package/dist/components/ch-spinner.js +1 -1
- package/dist/components/ch-stack.js +1 -1
- package/dist/components/ch-stat.js +1 -1
- package/dist/components/ch-switch.js +1 -1
- package/dist/components/ch-table.js +1 -1
- package/dist/components/ch-tabs.js +1 -1
- package/dist/components/ch-textarea.js +1 -1
- package/dist/components/ch-timeline.js +1 -1
- package/dist/components/ch-tooltip.js +1 -1
- package/dist/components/{p-DiUN1WGc.js → p-CF1yV0aa.js} +2 -2
- package/dist/components/p-CmMN-UuJ.js +2 -0
- package/dist/components/p-CmMN-UuJ.js.map +1 -0
- package/dist/components/p-qP_9qshx.js.map +1 -1
- package/dist/esm/ch-accordion.entry.js +2 -2
- package/dist/esm/ch-alert_8.entry.js +8 -8
- package/dist/esm/ch-checkbox.entry.js +2 -2
- package/dist/esm/ch-cluster.entry.js +3 -3
- package/dist/esm/ch-confirm-dialog.entry.js +136 -0
- package/dist/esm/ch-confirm-dialog.entry.js.map +1 -0
- package/dist/esm/ch-description-list.entry.js +2 -2
- package/dist/esm/ch-divider.entry.js +2 -2
- package/dist/esm/ch-drawer.entry.js +2 -2
- package/dist/esm/ch-emoji.entry.js +2 -2
- package/dist/esm/ch-empty-state.entry.js +2 -2
- package/dist/esm/ch-grid.entry.js +2 -2
- package/dist/esm/ch-icon-button.entry.js +2 -2
- package/dist/esm/ch-icon.entry.js +2 -2
- package/dist/esm/ch-link.entry.js +1 -1
- package/dist/esm/ch-modal.entry.js +2 -2
- package/dist/esm/ch-number-input.entry.js +3 -3
- package/dist/esm/ch-otp-input.entry.js +194 -0
- package/dist/esm/ch-otp-input.entry.js.map +1 -0
- package/dist/esm/ch-page-header.entry.js +2 -2
- package/dist/esm/ch-pagination.entry.js +65 -0
- package/dist/esm/ch-pagination.entry.js.map +1 -0
- package/dist/esm/ch-radio.entry.js +2 -2
- package/dist/esm/ch-segmented-control.entry.js +2 -2
- package/dist/esm/ch-skeleton.entry.js +2 -2
- package/dist/esm/ch-stack.entry.js +2 -2
- package/dist/esm/ch-stat.entry.js +3 -3
- package/dist/esm/ch-table.entry.js +2 -2
- package/dist/esm/ch-tabs.entry.js +2 -2
- package/dist/esm/ch-textarea.entry.js +2 -2
- package/dist/esm/ch-timeline.entry.js +2 -2
- package/dist/esm/ch-tooltip.entry.js +3 -3
- package/dist/esm/chucao.js +3 -3
- package/dist/esm/{index-CIV5Gg1o.js → index-8l_6qAY9.js} +19 -2
- package/dist/esm/index-8l_6qAY9.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/types/components/ch-confirm-dialog/ch-confirm-dialog.d.ts +81 -0
- package/dist/types/components/ch-otp-input/ch-otp-input.d.ts +79 -0
- package/dist/types/components/ch-pagination/ch-pagination.d.ts +44 -0
- package/dist/types/components.d.ts +548 -0
- package/dist-react/components.d.ts +21 -1
- package/dist-react/components.js +33 -0
- package/dist-react/components.ts +49 -1
- package/dist-vue/index.d.ts +3 -0
- package/dist-vue/index.js +48 -0
- package/dist-vue/index.ts +54 -0
- package/hydrate/index.js +518 -35
- package/hydrate/index.mjs +518 -35
- package/package.json +13 -1
- package/dist/chucao/p-60e1c1df.entry.js +0 -2
- package/dist/chucao/p-CIV5Gg1o.js.map +0 -1
- package/dist/cjs/index-ByZY6aTj.js.map +0 -1
- package/dist/esm/index-CIV5Gg1o.js.map +0 -1
- /package/dist/chucao/{p-deb2571b.entry.js.map → p-0831c6f2.entry.js.map} +0 -0
- /package/dist/chucao/{p-42028c97.entry.js.map → p-19d90f87.entry.js.map} +0 -0
- /package/dist/chucao/{p-1b70e3f1.entry.js.map → p-25f4f815.entry.js.map} +0 -0
- /package/dist/chucao/{p-472ec451.entry.js.map → p-3e0d7585.entry.js.map} +0 -0
- /package/dist/chucao/{p-f917d34f.entry.js.map → p-46dae34b.entry.js.map} +0 -0
- /package/dist/chucao/{p-01b6c7bf.entry.js.map → p-5093c486.entry.js.map} +0 -0
- /package/dist/chucao/{p-337d7f68.entry.js.map → p-51f6327c.entry.js.map} +0 -0
- /package/dist/chucao/{p-ffecdf25.entry.js.map → p-5577e0a0.entry.js.map} +0 -0
- /package/dist/chucao/{p-15d27bb7.entry.js.map → p-56e41372.entry.js.map} +0 -0
- /package/dist/chucao/{p-9ebcc7be.entry.js.map → p-6c2e5931.entry.js.map} +0 -0
- /package/dist/chucao/{p-f6ab0a11.entry.js.map → p-6e93c392.entry.js.map} +0 -0
- /package/dist/chucao/{p-9db118d9.entry.js.map → p-7f99ae48.entry.js.map} +0 -0
- /package/dist/chucao/{p-7cdc71cc.entry.js.map → p-8fcf6d36.entry.js.map} +0 -0
- /package/dist/chucao/{p-1e4cd3aa.entry.js.map → p-920d5727.entry.js.map} +0 -0
- /package/dist/chucao/{p-c90da3c0.entry.js.map → p-ad41da02.entry.js.map} +0 -0
- /package/dist/chucao/{p-d8b71751.entry.js.map → p-b42ec9bf.entry.js.map} +0 -0
- /package/dist/chucao/{p-2e37c61b.entry.js.map → p-b80c39c3.entry.js.map} +0 -0
- /package/dist/chucao/{p-a7c674b7.entry.js.map → p-ba589c2f.entry.js.map} +0 -0
- /package/dist/chucao/{p-0c7f6f8d.entry.js.map → p-c4d68ab7.entry.js.map} +0 -0
- /package/dist/chucao/{p-90284ebe.entry.js.map → p-c98e2a50.entry.js.map} +0 -0
- /package/dist/chucao/{p-8ae680a4.entry.js.map → p-ca3179ae.entry.js.map} +0 -0
- /package/dist/chucao/{p-5240f5ac.entry.js.map → p-d630f662.entry.js.map} +0 -0
- /package/dist/chucao/{p-c4b2bd1f.entry.js.map → p-d868bdbc.entry.js.map} +0 -0
- /package/dist/chucao/{p-e77d35c3.entry.js.map → p-e6b7b2da.entry.js.map} +0 -0
- /package/dist/chucao/{p-10f6801e.entry.js.map → p-f0c288db.entry.js.map} +0 -0
- /package/dist/components/{p-DiUN1WGc.js.map → p-CF1yV0aa.js.map} +0 -0
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
let paginationIds = 0;
|
|
3
|
+
/**
|
|
4
|
+
* Controlled pagination for a known total.
|
|
5
|
+
*
|
|
6
|
+
* It holds no page state: `page` and `pageSize` come from the consumer and
|
|
7
|
+
* every action emits `chPageChange` with the page it wants. That matches
|
|
8
|
+
* `ch-table`, so a consumer wiring the two together has one model to reason
|
|
9
|
+
* about — the table shows the rows for `page`, the pagination asks for the
|
|
10
|
+
* next one, and nothing moves until the consumer's data does.
|
|
11
|
+
*
|
|
12
|
+
* No numbered page list. A list of numbers is wrong more often than it is
|
|
13
|
+
* right (it depends on how many pages fit, which depends on the font, the
|
|
14
|
+
* locale and the container), and it is the part consumers most often need to
|
|
15
|
+
* replace with their own. Prev/next plus a position summary covers the
|
|
16
|
+
* default case; the summary is what tells a screen-reader user where they are.
|
|
17
|
+
*/
|
|
18
|
+
export class ChPagination {
|
|
19
|
+
labelId = `ch-pagination-${++paginationIds}`;
|
|
20
|
+
/** The current page, 1-based. Controlled by the consumer. */
|
|
21
|
+
page = 1;
|
|
22
|
+
/** How many rows a page holds. Controlled by the consumer. */
|
|
23
|
+
pageSize = 10;
|
|
24
|
+
/** How many rows exist in total. Zero renders a disabled, empty pager. */
|
|
25
|
+
total = 0;
|
|
26
|
+
/** Accessible name for the navigation landmark. */
|
|
27
|
+
label = 'Pagination';
|
|
28
|
+
/** Size of the controls. */
|
|
29
|
+
size = 'md';
|
|
30
|
+
/** Whether the whole control is disabled. */
|
|
31
|
+
disabled = false;
|
|
32
|
+
/** Emitted when the user asks for another page. The consumer applies it. */
|
|
33
|
+
chPageChange;
|
|
34
|
+
get pageCount() {
|
|
35
|
+
if (this.total <= 0 || this.pageSize <= 0) {
|
|
36
|
+
return 0;
|
|
37
|
+
}
|
|
38
|
+
return Math.ceil(this.total / this.pageSize);
|
|
39
|
+
}
|
|
40
|
+
/** How many rows this page shows, which is short on the last page. */
|
|
41
|
+
get rowsOnPage() {
|
|
42
|
+
if (this.pageCount === 0) {
|
|
43
|
+
return 0;
|
|
44
|
+
}
|
|
45
|
+
const remaining = this.total - (this.page - 1) * this.pageSize;
|
|
46
|
+
return Math.max(0, Math.min(this.pageSize, remaining));
|
|
47
|
+
}
|
|
48
|
+
get firstRow() {
|
|
49
|
+
return this.rowsOnPage === 0 ? 0 : (this.page - 1) * this.pageSize + 1;
|
|
50
|
+
}
|
|
51
|
+
get lastRow() {
|
|
52
|
+
return this.rowsOnPage === 0 ? 0 : this.firstRow + this.rowsOnPage - 1;
|
|
53
|
+
}
|
|
54
|
+
go(next) {
|
|
55
|
+
if (this.disabled || next < 1 || next > this.pageCount || next === this.page) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
this.chPageChange.emit({ page: next, pageSize: this.pageSize });
|
|
59
|
+
}
|
|
60
|
+
render() {
|
|
61
|
+
const count = this.pageCount;
|
|
62
|
+
const atStart = this.page <= 1;
|
|
63
|
+
const atEnd = count === 0 || this.page >= count;
|
|
64
|
+
const blocked = this.disabled || count === 0;
|
|
65
|
+
return (h(Host, { key: '82d5cbf478d149a09f17d43113374f0a9fdb626c' }, h("nav", { key: 'd6b712c900e61d03864e3b2f799a881f340b01a9', class: { pager: true, [`pager--${this.size}`]: true }, "aria-label": this.label }, h("button", { key: 'f3a2d877c6af803d8bde467efbc437c36502e7c3', class: "pager__button", type: "button", disabled: blocked || atStart, onClick: () => this.go(this.page - 1), "aria-label": "Previous page" }, h("span", { key: '8d2c3e7d96bc0761fb56318b34a70924c7250939', "aria-hidden": "true" }, "\u2039")), h("p", { key: 'c4eb6fb365ab8f06dadee383be08f0d8fe39f882', class: "pager__summary", id: this.labelId, "aria-live": "polite" }, count === 0 ? 'No results' : `${this.firstRow}–${this.lastRow} of ${this.total}`), h("button", { key: '1ee7a5084c6d937bb1d1b2260b09dd5d190aaf09', class: "pager__button", type: "button", disabled: blocked || atEnd, onClick: () => this.go(this.page + 1), "aria-label": "Next page" }, h("span", { key: '8fbf8209157fe9833a25ed22270580a980d66a1d', "aria-hidden": "true" }, "\u203A")))));
|
|
66
|
+
}
|
|
67
|
+
static get is() { return "ch-pagination"; }
|
|
68
|
+
static get encapsulation() { return "shadow"; }
|
|
69
|
+
static get originalStyleUrls() {
|
|
70
|
+
return {
|
|
71
|
+
"$": ["ch-pagination.css"]
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
static get styleUrls() {
|
|
75
|
+
return {
|
|
76
|
+
"$": ["ch-pagination.css"]
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
static get properties() {
|
|
80
|
+
return {
|
|
81
|
+
"page": {
|
|
82
|
+
"type": "number",
|
|
83
|
+
"mutable": false,
|
|
84
|
+
"complexType": {
|
|
85
|
+
"original": "number",
|
|
86
|
+
"resolved": "number",
|
|
87
|
+
"references": {}
|
|
88
|
+
},
|
|
89
|
+
"required": false,
|
|
90
|
+
"optional": false,
|
|
91
|
+
"docs": {
|
|
92
|
+
"tags": [],
|
|
93
|
+
"text": "The current page, 1-based. Controlled by the consumer."
|
|
94
|
+
},
|
|
95
|
+
"getter": false,
|
|
96
|
+
"setter": false,
|
|
97
|
+
"reflect": false,
|
|
98
|
+
"attribute": "page",
|
|
99
|
+
"defaultValue": "1"
|
|
100
|
+
},
|
|
101
|
+
"pageSize": {
|
|
102
|
+
"type": "number",
|
|
103
|
+
"mutable": false,
|
|
104
|
+
"complexType": {
|
|
105
|
+
"original": "number",
|
|
106
|
+
"resolved": "number",
|
|
107
|
+
"references": {}
|
|
108
|
+
},
|
|
109
|
+
"required": false,
|
|
110
|
+
"optional": false,
|
|
111
|
+
"docs": {
|
|
112
|
+
"tags": [],
|
|
113
|
+
"text": "How many rows a page holds. Controlled by the consumer."
|
|
114
|
+
},
|
|
115
|
+
"getter": false,
|
|
116
|
+
"setter": false,
|
|
117
|
+
"reflect": false,
|
|
118
|
+
"attribute": "page-size",
|
|
119
|
+
"defaultValue": "10"
|
|
120
|
+
},
|
|
121
|
+
"total": {
|
|
122
|
+
"type": "number",
|
|
123
|
+
"mutable": false,
|
|
124
|
+
"complexType": {
|
|
125
|
+
"original": "number",
|
|
126
|
+
"resolved": "number",
|
|
127
|
+
"references": {}
|
|
128
|
+
},
|
|
129
|
+
"required": false,
|
|
130
|
+
"optional": false,
|
|
131
|
+
"docs": {
|
|
132
|
+
"tags": [],
|
|
133
|
+
"text": "How many rows exist in total. Zero renders a disabled, empty pager."
|
|
134
|
+
},
|
|
135
|
+
"getter": false,
|
|
136
|
+
"setter": false,
|
|
137
|
+
"reflect": false,
|
|
138
|
+
"attribute": "total",
|
|
139
|
+
"defaultValue": "0"
|
|
140
|
+
},
|
|
141
|
+
"label": {
|
|
142
|
+
"type": "string",
|
|
143
|
+
"mutable": false,
|
|
144
|
+
"complexType": {
|
|
145
|
+
"original": "string",
|
|
146
|
+
"resolved": "string",
|
|
147
|
+
"references": {}
|
|
148
|
+
},
|
|
149
|
+
"required": false,
|
|
150
|
+
"optional": false,
|
|
151
|
+
"docs": {
|
|
152
|
+
"tags": [],
|
|
153
|
+
"text": "Accessible name for the navigation landmark."
|
|
154
|
+
},
|
|
155
|
+
"getter": false,
|
|
156
|
+
"setter": false,
|
|
157
|
+
"reflect": false,
|
|
158
|
+
"attribute": "label",
|
|
159
|
+
"defaultValue": "'Pagination'"
|
|
160
|
+
},
|
|
161
|
+
"size": {
|
|
162
|
+
"type": "string",
|
|
163
|
+
"mutable": false,
|
|
164
|
+
"complexType": {
|
|
165
|
+
"original": "ChPaginationSize",
|
|
166
|
+
"resolved": "\"md\" | \"sm\"",
|
|
167
|
+
"references": {
|
|
168
|
+
"ChPaginationSize": {
|
|
169
|
+
"location": "local",
|
|
170
|
+
"path": "/home/runner/work/chucao/chucao/src/components/ch-pagination/ch-pagination.tsx",
|
|
171
|
+
"id": "src/components/ch-pagination/ch-pagination.tsx::ChPaginationSize"
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
"required": false,
|
|
176
|
+
"optional": false,
|
|
177
|
+
"docs": {
|
|
178
|
+
"tags": [],
|
|
179
|
+
"text": "Size of the controls."
|
|
180
|
+
},
|
|
181
|
+
"getter": false,
|
|
182
|
+
"setter": false,
|
|
183
|
+
"reflect": false,
|
|
184
|
+
"attribute": "size",
|
|
185
|
+
"defaultValue": "'md'"
|
|
186
|
+
},
|
|
187
|
+
"disabled": {
|
|
188
|
+
"type": "boolean",
|
|
189
|
+
"mutable": false,
|
|
190
|
+
"complexType": {
|
|
191
|
+
"original": "boolean",
|
|
192
|
+
"resolved": "boolean",
|
|
193
|
+
"references": {}
|
|
194
|
+
},
|
|
195
|
+
"required": false,
|
|
196
|
+
"optional": false,
|
|
197
|
+
"docs": {
|
|
198
|
+
"tags": [],
|
|
199
|
+
"text": "Whether the whole control is disabled."
|
|
200
|
+
},
|
|
201
|
+
"getter": false,
|
|
202
|
+
"setter": false,
|
|
203
|
+
"reflect": true,
|
|
204
|
+
"attribute": "disabled",
|
|
205
|
+
"defaultValue": "false"
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
static get events() {
|
|
210
|
+
return [{
|
|
211
|
+
"method": "chPageChange",
|
|
212
|
+
"name": "chPageChange",
|
|
213
|
+
"bubbles": true,
|
|
214
|
+
"cancelable": true,
|
|
215
|
+
"composed": true,
|
|
216
|
+
"docs": {
|
|
217
|
+
"tags": [],
|
|
218
|
+
"text": "Emitted when the user asks for another page. The consumer applies it."
|
|
219
|
+
},
|
|
220
|
+
"complexType": {
|
|
221
|
+
"original": "{ page: number; pageSize: number }",
|
|
222
|
+
"resolved": "{ page: number; pageSize: number; }",
|
|
223
|
+
"references": {}
|
|
224
|
+
}
|
|
225
|
+
}];
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
//# sourceMappingURL=ch-pagination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ch-pagination.js","sourceRoot":"","sources":["../../../../src/components/ch-pagination/ch-pagination.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAqB,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAInF,IAAI,aAAa,GAAG,CAAC,CAAC;AAEtB;;;;;;;;;;;;;;GAcG;AAMH,MAAM,OAAO,YAAY;IACN,OAAO,GAAG,iBAAiB,EAAE,aAAa,EAAE,CAAC;IAE9D,6DAA6D;IACrD,IAAI,GAAG,CAAC,CAAC;IAEjB,8DAA8D;IACtD,QAAQ,GAAG,EAAE,CAAC;IAEtB,0EAA0E;IAClE,KAAK,GAAG,CAAC,CAAC;IAElB,mDAAmD;IAC3C,KAAK,GAAG,YAAY,CAAC;IAE7B,4BAA4B;IACpB,IAAI,GAAqB,IAAI,CAAC;IAEtC,6CAA6C;IACpB,QAAQ,GAAG,KAAK,CAAC;IAE1C,4EAA4E;IACnE,YAAY,CAAmD;IAExE,IAAY,SAAS;QACnB,IAAI,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,IAAI,CAAC,EAAE,CAAC;YAC1C,OAAO,CAAC,CAAC;QACX,CAAC;QACD,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC/C,CAAC;IAED,sEAAsE;IACtE,IAAY,UAAU;QACpB,IAAI,IAAI,CAAC,SAAS,KAAK,CAAC,EAAE,CAAC;YACzB,OAAO,CAAC,CAAC;QACX,CAAC;QACD,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,GAAG,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC/D,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC;IACzD,CAAC;IAED,IAAY,QAAQ;QAClB,OAAO,IAAI,CAAC,UAAU,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;IACzE,CAAC;IAED,IAAY,OAAO;QACjB,OAAO,IAAI,CAAC,UAAU,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;IACzE,CAAC;IAEO,EAAE,CAAC,IAAY;QACrB,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,GAAG,CAAC,IAAI,IAAI,GAAG,IAAI,CAAC,SAAS,IAAI,IAAI,KAAK,IAAI,CAAC,IAAI,EAAE,CAAC;YAC7E,OAAO;QACT,CAAC;QACD,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,MAAM;QACJ,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC;QAC7B,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC;QAC/B,MAAM,KAAK,GAAG,KAAK,KAAK,CAAC,IAAI,IAAI,CAAC,IAAI,IAAI,KAAK,CAAC;QAChD,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,IAAI,KAAK,KAAK,CAAC,CAAC;QAE7C,OAAO,CACL,EAAC,IAAI;YACH,4DAAK,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,UAAU,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,gBAAc,IAAI,CAAC,KAAK;gBAChF,+DAAQ,KAAK,EAAC,eAAe,EAAC,IAAI,EAAC,QAAQ,EAAC,QAAQ,EAAE,OAAO,IAAI,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,gBAAa,eAAe;oBACzI,4EAAkB,MAAM,aAAS,CAC1B;gBACT,0DAAG,KAAK,EAAC,gBAAgB,EAAC,EAAE,EAAE,IAAI,CAAC,OAAO,eAAY,QAAQ,IAC3D,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,OAAO,OAAO,IAAI,CAAC,KAAK,EAAE,CAC/E;gBACJ,+DAAQ,KAAK,EAAC,eAAe,EAAC,IAAI,EAAC,QAAQ,EAAC,QAAQ,EAAE,OAAO,IAAI,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,gBAAa,WAAW;oBACnI,4EAAkB,MAAM,aAAS,CAC1B,CACL,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, type EventEmitter, Host, Prop, h } from '@stencil/core';\n\nexport type ChPaginationSize = 'sm' | 'md';\n\nlet paginationIds = 0;\n\n/**\n * Controlled pagination for a known total.\n *\n * It holds no page state: `page` and `pageSize` come from the consumer and\n * every action emits `chPageChange` with the page it wants. That matches\n * `ch-table`, so a consumer wiring the two together has one model to reason\n * about — the table shows the rows for `page`, the pagination asks for the\n * next one, and nothing moves until the consumer's data does.\n *\n * No numbered page list. A list of numbers is wrong more often than it is\n * right (it depends on how many pages fit, which depends on the font, the\n * locale and the container), and it is the part consumers most often need to\n * replace with their own. Prev/next plus a position summary covers the\n * default case; the summary is what tells a screen-reader user where they are.\n */\n@Component({\n tag: 'ch-pagination',\n styleUrl: 'ch-pagination.css',\n shadow: true,\n})\nexport class ChPagination {\n private readonly labelId = `ch-pagination-${++paginationIds}`;\n\n /** The current page, 1-based. Controlled by the consumer. */\n @Prop() page = 1;\n\n /** How many rows a page holds. Controlled by the consumer. */\n @Prop() pageSize = 10;\n\n /** How many rows exist in total. Zero renders a disabled, empty pager. */\n @Prop() total = 0;\n\n /** Accessible name for the navigation landmark. */\n @Prop() label = 'Pagination';\n\n /** Size of the controls. */\n @Prop() size: ChPaginationSize = 'md';\n\n /** Whether the whole control is disabled. */\n @Prop({ reflect: true }) disabled = false;\n\n /** Emitted when the user asks for another page. The consumer applies it. */\n @Event() chPageChange: EventEmitter<{ page: number; pageSize: number }>;\n\n private get pageCount(): number {\n if (this.total <= 0 || this.pageSize <= 0) {\n return 0;\n }\n return Math.ceil(this.total / this.pageSize);\n }\n\n /** How many rows this page shows, which is short on the last page. */\n private get rowsOnPage(): number {\n if (this.pageCount === 0) {\n return 0;\n }\n const remaining = this.total - (this.page - 1) * this.pageSize;\n return Math.max(0, Math.min(this.pageSize, remaining));\n }\n\n private get firstRow(): number {\n return this.rowsOnPage === 0 ? 0 : (this.page - 1) * this.pageSize + 1;\n }\n\n private get lastRow(): number {\n return this.rowsOnPage === 0 ? 0 : this.firstRow + this.rowsOnPage - 1;\n }\n\n private go(next: number) {\n if (this.disabled || next < 1 || next > this.pageCount || next === this.page) {\n return;\n }\n this.chPageChange.emit({ page: next, pageSize: this.pageSize });\n }\n\n render() {\n const count = this.pageCount;\n const atStart = this.page <= 1;\n const atEnd = count === 0 || this.page >= count;\n const blocked = this.disabled || count === 0;\n\n return (\n <Host>\n <nav class={{ pager: true, [`pager--${this.size}`]: true }} aria-label={this.label}>\n <button class=\"pager__button\" type=\"button\" disabled={blocked || atStart} onClick={() => this.go(this.page - 1)} aria-label=\"Previous page\">\n <span aria-hidden=\"true\">‹</span>\n </button>\n <p class=\"pager__summary\" id={this.labelId} aria-live=\"polite\">\n {count === 0 ? 'No results' : `${this.firstRow}–${this.lastRow} of ${this.total}`}\n </p>\n <button class=\"pager__button\" type=\"button\" disabled={blocked || atEnd} onClick={() => this.go(this.page + 1)} aria-label=\"Next page\">\n <span aria-hidden=\"true\">›</span>\n </button>\n </nav>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -98,7 +98,7 @@ export class ChRadio {
|
|
|
98
98
|
}
|
|
99
99
|
render() {
|
|
100
100
|
const groupName = this.name || `${this.groupId}-group`;
|
|
101
|
-
return (h(Host, { key: '
|
|
101
|
+
return (h(Host, { key: 'bf7c403e1c7c172b5427d6e41d6740909e7f42f8' }, this.label && (h("span", { key: '4a5391dca354ab46c80238f0f5d8ac43f1024b28', class: "group-label", id: this.labelId }, this.label)), h("div", { key: '75854ae56cf848cbfcbb6a3a36fd831975e41071', class: "radio-group", role: "radiogroup", "aria-labelledby": this.label ? this.labelId : undefined }, this.options.map(option => (h("label", { class: { 'control': true, 'control--disabled': this.disabled || this.formDisabled || option.disabled } }, h("input", { class: { 'input': true, 'input--invalid': this.invalid }, type: "radio", name: groupName, value: option.value, checked: option.value === this.value, disabled: this.disabled || this.formDisabled || option.disabled, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onChange: this.handleChange }), h("span", { class: "mark" }), h("span", { class: "label-text" }, option.label))))), this.hint && !(this.invalid && this.errorMessage) && (h("p", { key: '270d6cdf03427427e88d5c6445f6607779c3ee14', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (h("p", { key: '6091a667601e9ff02f4b245d5a2cebf1e63d4ce0', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
102
102
|
}
|
|
103
103
|
static get is() { return "ch-radio"; }
|
|
104
104
|
static get encapsulation() { return "shadow"; }
|
|
@@ -92,7 +92,7 @@ export class ChSegmentedControl {
|
|
|
92
92
|
}
|
|
93
93
|
render() {
|
|
94
94
|
const groupName = this.name || `${this.groupId}-group`;
|
|
95
|
-
return (h(Host, { key: '
|
|
95
|
+
return (h(Host, { key: '521878f5cc2c183a1ac2c89d2fa4d1b26e58dcce' }, this.label && (h("span", { key: 'd87b35d855bd1185ddff983b7af098dcd867ed3a', class: "group-label", id: this.labelId }, this.label)), h("div", { key: '008d37b8f9c50b007d7975b8cf0ce7ba52c283a1', class: { segmented: true, [`segmented--${this.size}`]: true }, role: "radiogroup", "aria-labelledby": this.label ? this.labelId : undefined }, this.options.map(option => (h("label", { class: { 'control': true, 'control--disabled': this.disabled || this.formDisabled || option.disabled } }, h("input", { class: "input", type: "radio", name: groupName, value: option.value, checked: option.value === this.value, disabled: this.disabled || this.formDisabled || option.disabled, onChange: this.handleChange }), h("span", { class: "label-text" }, option.label)))))));
|
|
96
96
|
}
|
|
97
97
|
static get is() { return "ch-segmented-control"; }
|
|
98
98
|
static get encapsulation() { return "shadow"; }
|
|
@@ -99,7 +99,7 @@ export class ChSelect {
|
|
|
99
99
|
return undefined;
|
|
100
100
|
}
|
|
101
101
|
render() {
|
|
102
|
-
return (h(Host, { key: '
|
|
102
|
+
return (h(Host, { key: '21825ec1b83a93617413179ec79ba42ef2e980fe' }, this.label && (h("label", { key: 'e41e1268d92384f93bf492f90c6a727ddd5a05e0', class: "label", htmlFor: this.selectId }, this.label)), h("select", { key: '25160df5f7628bf89d6d7bb1f2736b44d02455d9', id: this.label ? this.selectId : undefined, class: { 'select': true, 'select--invalid': this.invalid }, name: this.name, disabled: this.disabled || this.formDisabled, required: this.required, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onChange: this.handleChange }, this.placeholder && (h("option", { key: '6e6977e6c5d120a2bf28b1b05892ff90ca32e1ff', value: "", disabled: true, hidden: true, selected: !this.value }, this.placeholder)), this.options.map(option => (h("option", { value: option.value, disabled: option.disabled, selected: option.value === this.value }, option.label)))), this.hint && !(this.invalid && this.errorMessage) && (h("p", { key: '92cb97df6b5ff80857fa6463d189e366697d6fd5', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (h("p", { key: '08d3f5deefd5d155c0fd54f06a0f6f5c60db8873', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
103
103
|
}
|
|
104
104
|
static get is() { return "ch-select"; }
|
|
105
105
|
static get encapsulation() { return "shadow"; }
|
|
@@ -47,7 +47,7 @@ export class ChSkeleton {
|
|
|
47
47
|
return { width: this.width, height: this.height };
|
|
48
48
|
}
|
|
49
49
|
render() {
|
|
50
|
-
return (h(Host, { key: '
|
|
50
|
+
return (h(Host, { key: '4bf9bb4d0fdfb1ecff7f0a9606da0c3eaa47aca3', "aria-hidden": "true", class: { 'skeleton': true, [`skeleton--${this.shape}`]: true, 'skeleton--animated': this.animated } }, Array.from({ length: this.items }).map((value, index) => (h("span", { class: "skeleton__item", style: this.sizeStyle, key: index, "data-index": String(value) })))));
|
|
51
51
|
}
|
|
52
52
|
static get is() { return "ch-skeleton"; }
|
|
53
53
|
static get encapsulation() { return "shadow"; }
|
|
@@ -23,7 +23,7 @@ export class ChSpinner {
|
|
|
23
23
|
label;
|
|
24
24
|
render() {
|
|
25
25
|
const labelled = Boolean(this.label);
|
|
26
|
-
return (h(Host, { key: '
|
|
26
|
+
return (h(Host, { key: 'ed67d11ad7efe04c34372852f5c4b81c71bf2327' }, h("span", { key: 'fff47dcd59f6e8881ea6295f5d062f888328a081', class: { spinner: true, [`spinner--${this.size}`]: true }, role: labelled ? 'status' : undefined, "aria-label": labelled ? this.label : undefined, "aria-hidden": labelled ? undefined : 'true' })));
|
|
27
27
|
}
|
|
28
28
|
static get is() { return "ch-spinner"; }
|
|
29
29
|
static get encapsulation() { return "shadow"; }
|
|
@@ -24,7 +24,7 @@ export class ChStack {
|
|
|
24
24
|
return GAPS.has(this.gap) ? this.gap : 'md';
|
|
25
25
|
}
|
|
26
26
|
render() {
|
|
27
|
-
return (h(Host, { key: '
|
|
27
|
+
return (h(Host, { key: '9c781e2f2c953d67442838300c7cd83fb47c19c6', class: { stack: true, [`stack--gap-${this.gapStep}`]: true, [`stack--align-${this.align}`]: true, [`stack--justify-${this.justify}`]: true } }, h("slot", { key: '3907d79b2c5f58a9dccf9b68e34d3fb0878c16a5' })));
|
|
28
28
|
}
|
|
29
29
|
static get is() { return "ch-stack"; }
|
|
30
30
|
static get encapsulation() { return "shadow"; }
|
|
@@ -43,10 +43,10 @@ export class ChStat {
|
|
|
43
43
|
}
|
|
44
44
|
render() {
|
|
45
45
|
const cue = this.toneClass === 'positive' ? '+' : this.toneClass === 'negative' ? '−' : null;
|
|
46
|
-
return (h(Host, { key: '
|
|
46
|
+
return (h(Host, { key: '79553724e7efce617f793913fc4b65301d8e4214', class: "stat" }, h("div", { key: '1d24c5b7fce578242c2464914beddd7c0bc0ac1b', class: "stat__inner" }, h("span", { key: '37bbb5ebf996a2f460d817ffc546bf37100a4c7f', class: "stat__label" }, this.label), h("span", { key: 'a1e5ff57b56f04fcc31b31d04ad6e8fae4ab75e3', class: {
|
|
47
47
|
stat__value: true,
|
|
48
48
|
[`stat__value--${this.toneClass}`]: this.toneClass !== 'default',
|
|
49
|
-
} }, cue && (h("span", { key: '
|
|
49
|
+
} }, cue && (h("span", { key: '9a35c34c366d66f3712f9c22cacefe48e550a08f', class: "stat__cue", "aria-hidden": "true" }, cue)), h("slot", { key: 'cbf547c8ec13a675cd694e39016b7a702fac41a5', name: "value" }, this.value)), this.hint && h("span", { key: 'ceaa61ab32fd4b607fe40f96a4ded7588098c98b', class: "stat__hint" }, this.hint), h("div", { key: '67352638ded6243693a9698105b9d330466ccc3b', class: "stat__footer" }, h("slot", { key: '8d8e59eae68d8d7153a57ec33a8185483e79b8f3', name: "footer" })))));
|
|
50
50
|
}
|
|
51
51
|
static get is() { return "ch-stat"; }
|
|
52
52
|
static get encapsulation() { return "shadow"; }
|
|
@@ -95,7 +95,7 @@ export class ChSwitch {
|
|
|
95
95
|
return undefined;
|
|
96
96
|
}
|
|
97
97
|
render() {
|
|
98
|
-
return (h(Host, { key: '
|
|
98
|
+
return (h(Host, { key: 'f0ad3dab1049febb1e4506c538a938eec237b6ee' }, h("label", { key: '0ec252ff6c58a79c3d1054312f6f92dd03352f69', class: { 'control': true, 'control--disabled': this.disabled || this.formDisabled }, htmlFor: this.switchId }, h("input", { key: 'a2471b09c6e1a026ec6189b3b542edc7147b8759', id: this.switchId, class: { 'input': true, 'input--invalid': this.invalid }, type: "checkbox", role: "switch", name: this.name, value: this.value, checked: this.checked, disabled: this.disabled || this.formDisabled, required: this.required, "aria-checked": this.checked ? 'true' : 'false', "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onChange: this.handleChange }), h("span", { key: 'dbcf0512d51e71c0072e4d159e23d822a7676da2', class: "track" }, h("span", { key: 'e7ef5934e2c03ba12e320fe963b4904237bf05d5', class: "thumb" })), this.label && h("span", { key: '90e1fc7560f839ec50014648235cc753c955b82a', class: "label-text" }, this.label)), this.hint && !(this.invalid && this.errorMessage) && (h("p", { key: 'c5150070147fcf40364925a5c164ec80d511b411', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (h("p", { key: 'c9cc633cd70f53aa62425faf92e760cf8cb816fd', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
99
99
|
}
|
|
100
100
|
static get is() { return "ch-switch"; }
|
|
101
101
|
static get encapsulation() { return "shadow"; }
|
|
@@ -151,7 +151,7 @@ export class ChTable {
|
|
|
151
151
|
const empty = this.emptyState;
|
|
152
152
|
// Before the first measurement the table is rendered as non-empty, so a
|
|
153
153
|
// consumer never sees the empty message flash over real rows.
|
|
154
|
-
return (h(Host, { key: '
|
|
154
|
+
return (h(Host, { key: 'e7957ed09b624ec1fdc599f300d7b1a49668ec41', class: { 'table': true, 'table--empty': empty === 'true' || empty === 'filtered' } }, h("div", { key: 'c2fe932de59ee1c557c7a10bdd5f8704b5ee1dd2', class: "table__scroll", tabIndex: 0, role: "group", "aria-labelledby": this.captionId }, h("table", { key: '9e76c06676ef07c3c7fc46e80e78a7baba6f0c33' }, h("caption", { key: '3842f79c25b143fdb6d410d985e1d456cbdde190', id: this.captionId, class: "caption" }, this.label), h("thead", { key: '1116cf7fed60c9757fac4097332aa2308609cb6b' }, h("tr", { key: 'f8ea8e04ca4bd02a63768c93c6ce1c5b4e307792' }, this.columns.map(column => this.renderHeaderCell(column)))), h("tbody", { key: '2a2c7b18fad74c854cad9164978753ffe168219f' }, h("slot", { key: '514e8c0b56e8beb8c0503723823ce8be7a588af6' })))), (empty === 'true' || empty === 'filtered') && (h("div", { key: 'a64841b511490e24462b89b8007f79c662de6120', class: "table__empty", id: this.emptyId }, h("slot", { key: '32bcbe36421d083883223dadaec7dbd194deab8c', name: "empty" }, h("p", { key: '36a9af8b0e9cbb0dfb96d52d057c910a92fe918e', class: "table__empty-message" }, this.emptyMessage(empty)))))));
|
|
155
155
|
}
|
|
156
156
|
static get is() { return "ch-table"; }
|
|
157
157
|
static get encapsulation() { return "shadow"; }
|
|
@@ -77,7 +77,7 @@ export class ChTabs {
|
|
|
77
77
|
}
|
|
78
78
|
render() {
|
|
79
79
|
const active = this.activeValue;
|
|
80
|
-
return (h(Host, { key: '
|
|
80
|
+
return (h(Host, { key: '596a51404c0d7d87f9988534f65e98135ecfcb75' }, h("div", { key: '6eb8cf1c1a986ce1ebd211806d130c0156bad2f1', class: "tablist", role: "tablist", "aria-label": this.label, onKeyDown: this.handleKeyDown, ref: el => (this.tablistEl = el) }, this.tabs.map(tab => {
|
|
81
81
|
const selected = tab.value === active;
|
|
82
82
|
return (h("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));
|
|
83
83
|
})), this.tabs.map(tab => (h("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 }, h("slot", { name: `panel-${tab.value}` }))))));
|
|
@@ -108,7 +108,7 @@ export class ChTextarea {
|
|
|
108
108
|
return undefined;
|
|
109
109
|
}
|
|
110
110
|
render() {
|
|
111
|
-
return (h(Host, { key: '
|
|
111
|
+
return (h(Host, { key: 'd416e809a6e1e3efe416add0008da16a690a611f' }, this.label && (h("label", { key: '777fd65954d8b346dd58ff06fa482e63ebcc3469', class: "label", htmlFor: this.textareaId }, this.label)), h("textarea", { key: '5ec5f626a54f7b94be8064e759553f7324499485', id: this.label ? this.textareaId : undefined, class: { 'textarea': true, 'textarea--invalid': this.invalid }, rows: this.rows, name: this.name, placeholder: this.placeholder, disabled: this.disabled || this.formDisabled, required: this.required, value: this.value, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onInput: this.handleInput, onChange: this.handleChange }), this.hint && !(this.invalid && this.errorMessage) && (h("p", { key: 'dee1dba3eda31566326284fccbdc0f352b14fe8f', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (h("p", { key: '5e1d47eb86b8ddd5284c3bad620bab11e340034c', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
112
112
|
}
|
|
113
113
|
static get is() { return "ch-textarea"; }
|
|
114
114
|
static get encapsulation() { return "shadow"; }
|
|
@@ -25,7 +25,7 @@ import { Host, h } from "@stencil/core";
|
|
|
25
25
|
*/
|
|
26
26
|
export class ChTimeline {
|
|
27
27
|
render() {
|
|
28
|
-
return (h(Host, { key: '
|
|
28
|
+
return (h(Host, { key: 'f8e1398cd3993e0b4fdfa039f2e09d99321745e0', class: "timeline" }, h("ol", { key: '0341a6f18ed91895bc18b01b4a2d327eed48befc', class: "list" }, h("slot", { key: '90c240cb80a37e844f840d062b7b7e5b97a97c1a' }))));
|
|
29
29
|
}
|
|
30
30
|
static get is() { return "ch-timeline"; }
|
|
31
31
|
static get encapsulation() { return "shadow"; }
|
|
@@ -192,7 +192,7 @@ export class ChTooltip {
|
|
|
192
192
|
};
|
|
193
193
|
render() {
|
|
194
194
|
const { offset } = this;
|
|
195
|
-
return (h(Host, { key: '
|
|
195
|
+
return (h(Host, { key: 'ccc4855053e0c1661f37ef6d40dffc4d0ff8fef3' }, h("span", { key: 'c71b50bd48142031f60017a01e9abbeaad755f83', class: "anchor" }, h("span", { key: 'aa337facc4dd983a5c2b2cf68ef1b3079e911f0b', class: "probe", "aria-hidden": "true", ref: el => (this.probeEl = el) }), h("slot", { key: 'd4c7db781d9cad1b61d0b17071e41ee9619e5129', name: "trigger", onSlotchange: this.associate }), h("span", { key: '8eda03e816c13ba58721a3f2c058d1e812c5630e', ref: el => (this.bubbleEl = el), style: {
|
|
196
196
|
'--ch-tooltip-offset-top': offset ? `${offset.top}px` : null,
|
|
197
197
|
'--ch-tooltip-offset-left': offset ? `${offset.left}px` : null,
|
|
198
198
|
}, class: {
|
|
@@ -200,7 +200,7 @@ export class ChTooltip {
|
|
|
200
200
|
'bubble--positioned': Boolean(this.offset),
|
|
201
201
|
[`bubble--${this.resolvedPlacement ?? this.placement}`]: true,
|
|
202
202
|
'bubble--visible': this.visible,
|
|
203
|
-
} }, h("slot", { key: '
|
|
203
|
+
} }, h("slot", { key: '402e2c295e88586d78974a2169a75afda1380c96', name: "content", onSlotchange: this.associate })))));
|
|
204
204
|
}
|
|
205
205
|
static get is() { return "ch-tooltip"; }
|
|
206
206
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,t,H as
|
|
1
|
+
import{p as e,t,H as a,c as r,h as i,d as o}from"./p-qP_9qshx.js";const s=()=>`:host{display:block}.item{background:var(--surface);border:var(--border-width) solid var(--border);border-radius:var(--radius);transition:border-color var(--duration-normal) var(--easing-default)}.item+.item{margin-top:var(--spacing-md)}.item--open{border-color:var(--border-hover)}.item-head{margin:0}.item-toggle{display:flex;align-items:center;justify-content:space-between;gap:var(--spacing-lg);width:100%;padding:var(--spacing-2xl) var(--spacing-3xl);background:transparent;border:none;color:var(--text);font-family:inherit;font-size:inherit;font-weight:var(--typography-weight-semibold);cursor:pointer}.item-toggle::after{content:'';width:var(--spacing-md);height:var(--spacing-md);flex-shrink:0;border-right:var(--border-width) solid var(--text-muted);border-bottom:var(--border-width) solid var(--text-muted);transform:rotate(45deg);transition:transform var(--duration-normal) var(--easing-default)}.item--open .item-toggle::after{transform:rotate(-135deg)}.item-toggle:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.item-toggle:disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.item-panel{padding:0 var(--spacing-3xl) var(--spacing-3xl);color:var(--text-muted)}.item-panel[hidden]{display:none}`;let n=0;const d=e(class e extends a{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow();this.chChange=r(this,"chChange")}baseId=`ch-accordion-${++n}`;items=[];value;chChange;headerId(e){return`${this.baseId}-${e}-header`}panelId(e){return`${this.baseId}-${e}-panel`}toggle=e=>{this.value=this.value===e?undefined:e;this.chChange.emit(this.value)};render(){return i(o,{key:"da264a6faa4d8da510d2964bef410d7c733bc507"},this.items.map((e=>{const t=this.value===e.value;return i("div",{key:e.value,class:{item:true,"item--open":t}},i("h3",{class:"item-head"},i("button",{type:"button",class:"item-toggle",id:this.headerId(e.value),"data-value":e.value,"aria-expanded":t?"true":"false","aria-controls":this.panelId(e.value),disabled:e.disabled,onClick:()=>this.toggle(e.value)},e.title)),i("div",{class:"item-panel",id:this.panelId(e.value),role:"region","aria-labelledby":this.headerId(e.value),hidden:!t},i("slot",{name:`panel-${e.value}`})))})))}static get style(){return s()}},[769,"ch-accordion",{items:[16],value:[1025]}]);function l(){if(typeof customElements==="undefined"){return}const e=["ch-accordion"];e.forEach((e=>{switch(e){case"ch-accordion":if(!customElements.get(t(e))){customElements.define(t(e),d)}break}}))}l();const c=d;const h=l;export{c as ChAccordion,h as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-accordion.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as
|
|
1
|
+
import{p as r,H as e,c as a,h as t,d as s,t as o}from"./p-qP_9qshx.js";import{c as i}from"./p-CnivhwvG.js";const n=()=>`: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}}`;const c={default:"info",positive:"success",warning:"alert"};const l=r(class r extends e{constructor(r){super();if(r!==false){this.__registerHost()}this.__attachShadow();this.chDismiss=a(this,"chDismiss")}variant="default";dismissLabel;statusCue=true;chDismiss;handleDismiss=()=>{this.chDismiss.emit()};render(){const r=this.variant==="warning"?"alert":"status";const e=this.statusCue?i[c[this.variant]]:undefined;return t(s,{key:"c7fb041416b2958fcda758a3297a0f9546456ef3"},t("div",{key:r,class:{alert:true,[`alert--${this.variant}`]:true},role:r},e&&t("svg",{key:"1a89cc6797bd6b425920f61f545f407326422e93",class:"alert-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false"},e.map((r=>t(r.tag,r.attrs)))),t("div",{key:"d30f1b3897d3ce681789507aa2677b29a83e8346",class:"alert-content"},t("slot",{key:"a4bc52ace056a573b21ecec083d017b3c5c22245"})),this.dismissLabel&&t("button",{key:"571947bd96a9c2f22b7af7989abd406dff860256",class:"alert-dismiss",type:"button","aria-label":this.dismissLabel,onClick:this.handleDismiss},t("span",{key:"e8d282730aa25aad78f05ce118cb65fce9ea85c5","aria-hidden":"true"},"×"))))}static get style(){return n()}},[769,"ch-alert",{variant:[1],dismissLabel:[1,"dismiss-label"],statusCue:[4,"status-cue"]}]);function d(){if(typeof customElements==="undefined"){return}const r=["ch-alert"];r.forEach((r=>{switch(r){case"ch-alert":if(!customElements.get(o(r))){customElements.define(o(r),l)}break}}))}d();const u=l;const f=d;export{u as ChAlert,f as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-alert.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as
|
|
1
|
+
import{p as r,H as a,h as e,d as t,t as s}from"./p-qP_9qshx.js";const o=()=>`: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}`;const d=r(class r extends a{constructor(r){super();if(r!==false){this.__registerHost()}this.__attachShadow()}variant="default";statusCue=true;render(){return e(t,{key:"712c653d4047845d6afce4655271f2c80e3fe6a8"},e("span",{key:"dd24bf1f555b229bee277b77c175b485f4a10680",class:{badge:true,[`badge--${this.variant}`]:true}},this.statusCue&&e("span",{key:"cef4173e40dac2798c2a26381763bb470cf0bacc",class:"badge-dot","aria-hidden":"true"}),e("slot",{key:"6e8c09dd9260d80c9fda09b402dfc3b1cef53907"})))}static get style(){return o()}},[769,"ch-badge",{variant:[1],statusCue:[4,"status-cue"]}]);function c(){if(typeof customElements==="undefined"){return}const r=["ch-badge"];r.forEach((r=>{switch(r){case"ch-badge":if(!customElements.get(s(r))){customElements.define(s(r),d)}break}}))}c();const i=d;const n=c;export{i as ChBadge,n as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-badge.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as r,H as t,c as a,h as e,d as n,t as s}from"./p-qP_9qshx.js";import{d as i}from"./p-
|
|
1
|
+
import{p as r,H as t,c as a,h as e,d as n,t as s}from"./p-qP_9qshx.js";import{d as i}from"./p-CF1yV0aa.js";function o(r){return Array.from(r.childNodes).some((r=>{if(r.nodeType!==3&&r.nodeType!==1){return false}if(r.nodeType===1&&r.hasAttribute("slot")){return false}return(r.textContent??"").trim()!==""}))}const l=()=>`:host{display:inline-block}.btn{display:inline-flex;align-items:center;justify-content:center;gap:var(--spacing-sm);box-sizing:border-box;border:var(--border-width) solid transparent;border-radius:var(--radius-pill);cursor:pointer;font-family:inherit;font-weight:var(--typography-weight-bold);text-decoration:none;line-height:1.2;transition:background-color var(--duration-normal) var(--easing-default), border-color var(--duration-normal) var(--easing-default), color var(--duration-normal) var(--easing-default), transform var(--duration-fast) var(--easing-default)}.btn--sm{padding:var(--spacing-2xs) var(--spacing-lg);font-size:var(--typography-size-sm)}.btn--md{padding:var(--spacing-xs) var(--spacing-xl);font-size:inherit}.btn--lg{padding:var(--spacing-sm) var(--spacing-2xl);font-size:var(--typography-size-lg)}.btn:disabled,.btn--disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.btn--loading:disabled,.btn--loading.btn--disabled{opacity:1;cursor:progress}.btn:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.btn--primary{background-color:var(--accent);color:var(--color-accent-text)}.btn--primary:hover:not(:disabled){background-color:var(--accent-hover);transform:translateY(calc(-1 * var(--spacing-elevate)))}.btn--secondary{background-color:transparent;color:var(--text);border-color:var(--border)}.btn--secondary:hover:not(:disabled){border-color:var(--border-hover);background-color:var(--surface-hover);transform:translateY(calc(-1 * var(--spacing-elevate)))}.btn--ghost{background-color:transparent;color:var(--text)}.btn--ghost:hover:not(:disabled){background-color:var(--surface-hover)}.btn--danger{background-color:var(--color-status-warning);color:var(--bg)}.btn--danger:hover:not(:disabled){filter:brightness(0.92);transform:translateY(calc(-1 * var(--spacing-elevate)))}`;const c=r(class r extends t{constructor(r){super();if(r!==false){this.__registerHost()}this.__attachShadow();this.chClick=a(this,"chClick")}get el(){return this}variant="primary";size="md";disabled=false;loading=false;href;target;label;chClick;handleClick=r=>{if(this.disabled||this.loading){r.preventDefault();return}this.chClick.emit(r)};get spinnerSize(){return this.size==="lg"?"md":"sm"}renderContent(){return[this.loading?e("ch-spinner",{size:this.spinnerSize}):e("slot",{name:"start"}),e("slot",null),e("slot",{name:"end"})]}render(){if(!this.label&&!o(this.el));const r={btn:true,[`btn--${this.variant}`]:true,[`btn--${this.size}`]:true,"btn--loading":this.loading};if(this.href&&!this.disabled&&!this.loading){return e(n,null,e("a",{class:r,href:this.href,target:this.target,rel:this.target==="_blank"?"noopener noreferrer":undefined,"aria-label":this.label,onClick:this.handleClick},this.renderContent()))}if(this.href){return e(n,null,e("span",{class:{...r,"btn--disabled":true},"aria-label":this.label,"aria-disabled":"true","aria-busy":this.loading?"true":undefined},this.renderContent()))}return e(n,null,e("button",{class:r,type:"button",disabled:this.disabled||this.loading,"aria-label":this.label,"aria-busy":this.loading?"true":undefined,onClick:this.handleClick},this.renderContent()))}static get style(){return l()}},[769,"ch-button",{variant:[1],size:[1],disabled:[4],loading:[4],href:[1],target:[1],label:[1]}]);function d(){if(typeof customElements==="undefined"){return}const r=["ch-button","ch-spinner"];r.forEach((r=>{switch(r){case"ch-button":if(!customElements.get(s(r))){customElements.define(s(r),c)}break;case"ch-spinner":if(!customElements.get(s(r))){i()}break}}))}d();const b=c;const u=d;export{b as ChButton,u as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-button.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as r,H as a,h as o,d as t,t as e}from"./p-qP_9qshx.js";const d=()=>`:host{display:block}::slotted(p){color:var(--text-muted)}.card{color:var(--text);background:var(--surface);border:var(--border-width) solid var(--border);border-radius:var(--radius);padding:var(--spacing-4xl) var(--spacing-5xl);backdrop-filter:blur(var(--effect-blur));position:relative;overflow:hidden;transition:border-color var(--duration-normal) var(--easing-default), transform var(--duration-fast) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.card::before{content:'';position:absolute;left:0;top:0;bottom:0;width:var(--border-accent-bar);background:var(--accent);opacity:0;transition:opacity var(--duration-normal) var(--easing-default)}.card:hover{border-color:var(--border-hover);transform:translateX(var(--spacing-shift));box-shadow:var(--shadow-card-hover)}.card:hover::before{opacity:1}`;const s=r(class r extends a{constructor(r){super();if(r!==false){this.__registerHost()}this.__attachShadow()}render(){return o(t,{key:"
|
|
1
|
+
import{p as r,H as a,h as o,d as t,t as e}from"./p-qP_9qshx.js";const d=()=>`:host{display:block}::slotted(p){color:var(--text-muted)}.card{color:var(--text);background:var(--surface);border:var(--border-width) solid var(--border);border-radius:var(--radius);padding:var(--spacing-4xl) var(--spacing-5xl);backdrop-filter:blur(var(--effect-blur));position:relative;overflow:hidden;transition:border-color var(--duration-normal) var(--easing-default), transform var(--duration-fast) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.card::before{content:'';position:absolute;left:0;top:0;bottom:0;width:var(--border-accent-bar);background:var(--accent);opacity:0;transition:opacity var(--duration-normal) var(--easing-default)}.card:hover{border-color:var(--border-hover);transform:translateX(var(--spacing-shift));box-shadow:var(--shadow-card-hover)}.card:hover::before{opacity:1}`;const s=r(class r extends a{constructor(r){super();if(r!==false){this.__registerHost()}this.__attachShadow()}render(){return o(t,{key:"f237dce6afd9f9c88f52784de63073d3b4dc31fd"},o("div",{key:"2256360ad3b736aaf595cb0440903eb90ffc9968",class:"card"},o("slot",{key:"5ce63027b9e1abd925b4a1d7261752a4b579b336"})))}static get style(){return d()}},[257,"ch-card"]);function c(){if(typeof customElements==="undefined"){return}const r=["ch-card"];r.forEach((r=>{switch(r){case"ch-card":if(!customElements.get(e(r))){customElements.define(e(r),s)}break}}))}c();const n=s;const i=c;export{n as ChCard,i as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-card.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as i,c as t,h as s,d as r,t as a}from"./p-qP_9qshx.js";import{r as o}from"./p-BXzZsX2r.js";const n=()=>`:host{display:inline-block}.control{display:inline-flex;align-items:center;gap:var(--spacing-lg);cursor:pointer}.control--disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.input{appearance:none;-webkit-appearance:none;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--spacing-4xl);height:var(--spacing-4xl);margin:0;flex-shrink:0;border:var(--border-width) solid var(--border);border-radius:var(--radius-sm);background:var(--surface);cursor:pointer;transition:border-color var(--duration-normal) var(--easing-default), background-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.input:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.input:checked{border-color:var(--accent);background:var(--accent)}.input:checked::before{content:'';width:var(--spacing-xs);height:var(--spacing-lg);border:solid var(--color-accent-text);border-width:0 var(--spacing-shift) var(--spacing-shift) 0;transform:rotate(45deg);margin-top:calc(-1 * var(--spacing-2xs))}.input--invalid{border-color:var(--color-status-warning)}.input--invalid:focus-visible{outline-color:var(--color-status-warning)}:host([data-touched]:invalid) .input,:host(:user-invalid) .input{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .input:focus-visible,:host(:user-invalid) .input:focus-visible{outline-color:var(--color-status-warning)}.label-text{color:var(--text)}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;let c=0;const
|
|
1
|
+
import{p as e,H as i,c as t,h as s,d as r,t as a}from"./p-qP_9qshx.js";import{r as o}from"./p-BXzZsX2r.js";const n=()=>`:host{display:inline-block}.control{display:inline-flex;align-items:center;gap:var(--spacing-lg);cursor:pointer}.control--disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.input{appearance:none;-webkit-appearance:none;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--spacing-4xl);height:var(--spacing-4xl);margin:0;flex-shrink:0;border:var(--border-width) solid var(--border);border-radius:var(--radius-sm);background:var(--surface);cursor:pointer;transition:border-color var(--duration-normal) var(--easing-default), background-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.input:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.input:checked{border-color:var(--accent);background:var(--accent)}.input:checked::before{content:'';width:var(--spacing-xs);height:var(--spacing-lg);border:solid var(--color-accent-text);border-width:0 var(--spacing-shift) var(--spacing-shift) 0;transform:rotate(45deg);margin-top:calc(-1 * var(--spacing-2xs))}.input--invalid{border-color:var(--color-status-warning)}.input--invalid:focus-visible{outline-color:var(--color-status-warning)}:host([data-touched]:invalid) .input,:host(:user-invalid) .input{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .input:focus-visible,:host(:user-invalid) .input:focus-visible{outline-color:var(--color-status-warning)}.label-text{color:var(--text)}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;let c=0;const l=e(class e extends i{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow();this.chChange=t(this,"chChange");this.internals=this.attachInternals()}checkboxId=`ch-checkbox-${++c}`;hintId=`${this.checkboxId}-hint`;errorId=`${this.checkboxId}-error`;initialChecked=false;internals;formDisabled=false;get host(){return this}label;name;value="on";checked=false;disabled=false;required=false;hint;errorMessage;invalid=false;chChange;handleChange=e=>{this.checked=e.target.checked;this.chChange.emit(this.checked)};syncForm(){const e=this.internals;if(typeof e?.setFormValue!=="function"){return}e.setFormValue(this.checked?this.value:null);const{flags:i,message:t}=o({required:this.required,empty:!this.checked,invalid:this.invalid,errorMessage:this.errorMessage});e.setValidity(i,t)}componentDidLoad(){this.initialChecked=this.checked;this.syncForm();this.host.addEventListener("change",this.markTouched);this.host.addEventListener("focusout",this.markTouched);this.host.addEventListener("invalid",this.markTouched)}markTouched=()=>{this.host.setAttribute("data-touched","")};formResetCallback(){this.checked=this.initialChecked}formDisabledCallback(e){this.formDisabled=e}get describedBy(){if(this.invalid&&this.errorMessage){return this.errorId}if(this.hint){return this.hintId}return undefined}render(){return s(r,{key:"3e0f2f162d1ec1a4715b44a37211a30c63f830b2"},s("label",{key:"8042cb81ab53a9451a8757dfa63ef8cea8f41954",class:{control:true,"control--disabled":this.disabled||this.formDisabled},htmlFor:this.checkboxId},s("input",{key:"0d55f22c4625f48c8bf2eee15a7710cfb80c4328",id:this.checkboxId,class:{input:true,"input--invalid":this.invalid},type:"checkbox",name:this.name,value:this.value,checked:this.checked,disabled:this.disabled||this.formDisabled,required:this.required,"aria-invalid":this.invalid?"true":undefined,"aria-describedby":this.describedBy,onChange:this.handleChange}),this.label&&s("span",{key:"146e3b4fa88237da4af8f8b0a408909b4d11555e",class:"label-text"},this.label)),this.hint&&!(this.invalid&&this.errorMessage)&&s("p",{key:"d82032ae57e8e818a91fa04cfd5e505dea47c22d",class:"hint",id:this.hintId},this.hint),this.invalid&&this.errorMessage&&s("p",{key:"9f418c648d4929086a77ca868a7c13cdccb328cb",class:"error",id:this.errorId,role:"alert"},this.errorMessage))}static get formAssociated(){return true}static get watchers(){return{checked:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}]}}static get style(){return n()}},[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]},undefined,{checked:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}]}]);function d(){if(typeof customElements==="undefined"){return}const e=["ch-checkbox"];e.forEach((e=>{switch(e){case"ch-checkbox":if(!customElements.get(a(e))){customElements.define(a(e),l)}break}}))}d();const h=l;const u=d;export{h as ChCheckbox,u as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-checkbox.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as t,H as e,h as s,d as a,t as r}from"./p-qP_9qshx.js";const l=()=>`:host{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;box-sizing:border-box}:host([hidden]){display:none}.cluster--nowrap{flex-wrap:nowrap}.cluster--gap-none{gap:0}.cluster--gap-2xs{gap:var(--spacing-2xs)}.cluster--gap-xs{gap:var(--spacing-xs)}.cluster--gap-sm{gap:var(--spacing-sm)}.cluster--gap-md{gap:var(--spacing-md)}.cluster--gap-lg{gap:var(--spacing-lg)}.cluster--gap-xl{gap:var(--spacing-xl)}.cluster--gap-2xl{gap:var(--spacing-2xl)}.cluster--gap-3xl{gap:var(--spacing-3xl)}.cluster--gap-4xl{gap:var(--spacing-4xl)}.cluster--gap-5xl{gap:var(--spacing-5xl)}.cluster--gap-6xl{gap:var(--spacing-6xl)}.cluster--align-stretch{align-items:stretch}.cluster--align-start{align-items:flex-start}.cluster--align-center{align-items:center}.cluster--align-end{align-items:flex-end}.cluster--align-baseline{align-items:baseline}.cluster--justify-start{justify-content:flex-start}.cluster--justify-center{justify-content:center}.cluster--justify-end{justify-content:flex-end}.cluster--justify-between{justify-content:space-between}.cluster--justify-around{justify-content:space-around}`;const
|
|
1
|
+
import{p as t,H as e,h as s,d as a,t as r}from"./p-qP_9qshx.js";const l=()=>`:host{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;box-sizing:border-box}:host([hidden]){display:none}.cluster--nowrap{flex-wrap:nowrap}.cluster--gap-none{gap:0}.cluster--gap-2xs{gap:var(--spacing-2xs)}.cluster--gap-xs{gap:var(--spacing-xs)}.cluster--gap-sm{gap:var(--spacing-sm)}.cluster--gap-md{gap:var(--spacing-md)}.cluster--gap-lg{gap:var(--spacing-lg)}.cluster--gap-xl{gap:var(--spacing-xl)}.cluster--gap-2xl{gap:var(--spacing-2xl)}.cluster--gap-3xl{gap:var(--spacing-3xl)}.cluster--gap-4xl{gap:var(--spacing-4xl)}.cluster--gap-5xl{gap:var(--spacing-5xl)}.cluster--gap-6xl{gap:var(--spacing-6xl)}.cluster--align-stretch{align-items:stretch}.cluster--align-start{align-items:flex-start}.cluster--align-center{align-items:center}.cluster--align-end{align-items:flex-end}.cluster--align-baseline{align-items:baseline}.cluster--justify-start{justify-content:flex-start}.cluster--justify-center{justify-content:center}.cluster--justify-end{justify-content:flex-end}.cluster--justify-between{justify-content:space-between}.cluster--justify-around{justify-content:space-around}`;const n=new Set(["none","2xs","xs","sm","md","lg","xl","2xl","3xl","4xl","5xl","6xl"]);const c=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow()}gap="md";align="center";justify="start";wrap=true;get gapStep(){return n.has(this.gap)?this.gap:"md"}render(){return s(a,{key:"d1852bc490835eb559f31039e14b87d59b151b11",class:{cluster:true,[`cluster--gap-${this.gapStep}`]:true,[`cluster--align-${this.align}`]:true,[`cluster--justify-${this.justify}`]:true,"cluster--nowrap":!this.wrap}},s("slot",{key:"7dc3c83e40d8e0d5dd18052bb9c36898a443ce23"}))}static get style(){return l()}},[769,"ch-cluster",{gap:[1],align:[1],justify:[1],wrap:[4]}]);function i(){if(typeof customElements==="undefined"){return}const t=["ch-cluster"];t.forEach((t=>{switch(t){case"ch-cluster":if(!customElements.get(r(t))){customElements.define(r(t),c)}break}}))}i();const u=c;const g=i;export{u as ChCluster,g as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-cluster.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface ChConfirmDialog extends Components.ChConfirmDialog, HTMLElement {}
|
|
4
|
+
export const ChConfirmDialog: {
|
|
5
|
+
prototype: ChConfirmDialog;
|
|
6
|
+
new (): ChConfirmDialog;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{p as e,H as t,c as n,h as a,d as o,t as r}from"./p-qP_9qshx.js";import{d as i}from"./p-CmMN-UuJ.js";const s=()=>`:host{display:contents;font-family:var(--typography-body)}.confirm__heading{margin:0;font-family:var(--typography-heading);font-size:var(--typography-size-lg);font-weight:var(--typography-weight-semibold);color:var(--color-text-primary)}.confirm__message{margin:0;font-size:var(--typography-size-sm);color:var(--color-text-secondary);overflow-wrap:break-word}.confirm__actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:var(--spacing-md);margin-top:var(--spacing-2xl)}.confirm__button{display:inline-flex;align-items:center;justify-content:center;min-height:2.25rem;padding:0 var(--spacing-lg);border:var(--border-width) solid var(--color-border-default);border-radius:var(--radius-sm);background:var(--color-surface-default);color:var(--color-text-primary);font-family:var(--typography-body);font-size:var(--typography-size-sm);font-weight:var(--typography-weight-semibold);cursor:pointer}.confirm__button:focus-visible{outline:2px solid var(--color-accent-default);outline-offset:2px}.confirm__button:disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.confirm__button--confirm{border-color:var(--color-accent-default);background:var(--color-accent-default);color:var(--color-accent-text)}.confirm__button--danger{border-color:var(--color-status-warning);background:var(--color-status-warning);color:var(--color-text-primary)}.confirm__button--danger::before{content:'⚠';margin-right:var(--spacing-xs)}`;const c=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow();this.chConfirm=n(this,"chConfirm");this.chCancel=n(this,"chCancel")}get el(){return this}open=false;heading;message;confirmLabel="Confirm";cancelLabel="Cancel";tone="default";pending=false;dismissible=true;chConfirm;chCancel;settled=false;cancelButton;confirmButton;componentDidLoad(){if(this.open){this.onOpening()}}handleOpenChange(e){if(e){this.onOpening();return}this.settled=false}onOpening(){this.settled=false;requestAnimationFrame((()=>{const e=this.tone==="danger"?this.cancelButton:this.confirmButton;e?.focus()}))}settle(e){if(this.settled){return}this.settled=true;if(e==="confirm"){this.chConfirm.emit();return}this.chCancel.emit()}handleConfirm=()=>{if(this.pending){return}this.settle("confirm")};handleCancel=()=>{if(this.pending){return}this.open=false;this.settle("cancel")};handleModalClose=()=>{this.open=false;if(this.pending){return}this.settle("cancel")};handleKeyDown=e=>{if(this.dismissible||e.key!=="Escape"){return}e.preventDefault();e.stopPropagation()};async focusCancel(){this.cancelButton?.focus()}render(){return a(o,{key:"7aa8fd72a281369f47ce7f1eb99c52ab60ba4ee0",onKeyDown:this.handleKeyDown},a("ch-modal",{key:"019663f042f5c2ce3dd1f58433faee170c01e8e6",open:this.open,label:this.heading,size:"sm",onChClose:this.handleModalClose,onChOpen:()=>this.onOpening()},a("h2",{key:"9d97f437e535a3a9feb181e9807dc9c532efd872",slot:"heading",class:"confirm__heading"},this.heading),this.message&&a("p",{key:"a0d64b2b915624473162557972eabdf80b445d58",class:"confirm__message"},this.message),a("div",{key:"0b44308d6eb7a4aea2c1166f8a7f6f19c41cdbb7",class:"confirm__actions"},a("button",{key:"7908d0db96e7c59c7b4673220aa62c2170b29d54",class:{confirm__button:true,"confirm__button--cancel":true},type:"button",ref:e=>this.cancelButton=e,disabled:this.pending,onClick:this.handleCancel},this.cancelLabel),a("button",{key:"43657105b474b303160da19e1fa5fda47f63207c",class:{confirm__button:true,"confirm__button--confirm":true,"confirm__button--danger":this.tone==="danger"},type:"button",ref:e=>this.confirmButton=e,disabled:this.pending,"aria-busy":this.pending?"true":undefined,onClick:this.handleConfirm},this.confirmLabel))))}static get watchers(){return{open:[{handleOpenChange:0}]}}static get style(){return s()}},[513,"ch-confirm-dialog",{open:[1028],heading:[1],message:[1],confirmLabel:[1,"confirm-label"],cancelLabel:[1,"cancel-label"],tone:[1],pending:[4],dismissible:[4],settled:[32],focusCancel:[64]},undefined,{open:[{handleOpenChange:0}]}]);function l(){if(typeof customElements==="undefined"){return}const e=["ch-confirm-dialog","ch-modal"];e.forEach((e=>{switch(e){case"ch-confirm-dialog":if(!customElements.get(r(e))){customElements.define(r(e),c)}break;case"ch-modal":if(!customElements.get(r(e))){i()}break}}))}l();const f=c;const d=l;export{f as ChConfirmDialog,d as defineCustomElement};
|
|
2
|
+
//# sourceMappingURL=ch-confirm-dialog.js.map
|