@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
|
@@ -10,6 +10,7 @@ import { ChAlertVariant } from "./components/ch-alert/ch-alert";
|
|
|
10
10
|
import { ChBadgeVariant } from "./components/ch-badge/ch-badge";
|
|
11
11
|
import { ChButtonSize, ChButtonVariant } from "./components/ch-button/ch-button";
|
|
12
12
|
import { ChClusterAlign, ChClusterGap, ChClusterJustify } from "./components/ch-cluster/ch-cluster";
|
|
13
|
+
import { ChConfirmDialogTone } from "./components/ch-confirm-dialog/ch-confirm-dialog";
|
|
13
14
|
import { ChDescriptionListColumns } from "./components/ch-description-list/ch-description-list";
|
|
14
15
|
import { ChDividerOrientation } from "./components/ch-divider/ch-divider";
|
|
15
16
|
import { ChDrawerSide } from "./components/ch-drawer/ch-drawer";
|
|
@@ -23,6 +24,7 @@ import { ChLinkVariant } from "./components/ch-link/ch-link";
|
|
|
23
24
|
import { ChModalSize } from "./components/ch-modal/ch-modal";
|
|
24
25
|
import { ChNumberInputFormat, ChNumberInputStep } from "./components/ch-number-input/ch-number-input";
|
|
25
26
|
import { ChPageHeaderHeadingLevel } from "./components/ch-page-header/ch-page-header";
|
|
27
|
+
import { ChPaginationSize } from "./components/ch-pagination/ch-pagination";
|
|
26
28
|
import { ChRadioOption } from "./components/ch-radio/ch-radio";
|
|
27
29
|
import { ChSegmentedControlOption, ChSegmentedControlSize } from "./components/ch-segmented-control/ch-segmented-control";
|
|
28
30
|
import { ChSelectOption } from "./components/ch-select/ch-select";
|
|
@@ -38,6 +40,7 @@ export { ChAlertVariant } from "./components/ch-alert/ch-alert";
|
|
|
38
40
|
export { ChBadgeVariant } from "./components/ch-badge/ch-badge";
|
|
39
41
|
export { ChButtonSize, ChButtonVariant } from "./components/ch-button/ch-button";
|
|
40
42
|
export { ChClusterAlign, ChClusterGap, ChClusterJustify } from "./components/ch-cluster/ch-cluster";
|
|
43
|
+
export { ChConfirmDialogTone } from "./components/ch-confirm-dialog/ch-confirm-dialog";
|
|
41
44
|
export { ChDescriptionListColumns } from "./components/ch-description-list/ch-description-list";
|
|
42
45
|
export { ChDividerOrientation } from "./components/ch-divider/ch-divider";
|
|
43
46
|
export { ChDrawerSide } from "./components/ch-drawer/ch-drawer";
|
|
@@ -51,6 +54,7 @@ export { ChLinkVariant } from "./components/ch-link/ch-link";
|
|
|
51
54
|
export { ChModalSize } from "./components/ch-modal/ch-modal";
|
|
52
55
|
export { ChNumberInputFormat, ChNumberInputStep } from "./components/ch-number-input/ch-number-input";
|
|
53
56
|
export { ChPageHeaderHeadingLevel } from "./components/ch-page-header/ch-page-header";
|
|
57
|
+
export { ChPaginationSize } from "./components/ch-pagination/ch-pagination";
|
|
54
58
|
export { ChRadioOption } from "./components/ch-radio/ch-radio";
|
|
55
59
|
export { ChSegmentedControlOption, ChSegmentedControlSize } from "./components/ch-segmented-control/ch-segmented-control";
|
|
56
60
|
export { ChSelectOption } from "./components/ch-select/ch-select";
|
|
@@ -225,6 +229,65 @@ export namespace Components {
|
|
|
225
229
|
*/
|
|
226
230
|
"wrap": boolean;
|
|
227
231
|
}
|
|
232
|
+
/**
|
|
233
|
+
* A confirmation dialog over `ch-modal`.
|
|
234
|
+
* Declarative only: the consumer opens it with `open` and handles the outcome.
|
|
235
|
+
* The imperative `confirm()` helper is a separate concern and a separate issue,
|
|
236
|
+
* because a promise-returning helper has to own mounting, focus and unhandled
|
|
237
|
+
* rejection, none of which a component should decide for its consumer.
|
|
238
|
+
* The guarantees this adds over a plain `ch-modal` are the ones that make a
|
|
239
|
+
* confirmation safe:
|
|
240
|
+
* - exactly one outcome per interaction — a double click on Confirm emits once;
|
|
241
|
+
* - every dismissal path (Cancel, Escape, backdrop, confirm) is reported, so a
|
|
242
|
+
* consumer awaiting an answer cannot hang;
|
|
243
|
+
* - focus lands on Cancel for a destructive action, so the absent-minded Enter
|
|
244
|
+
* does not destroy anything;
|
|
245
|
+
* - `pending` is not a cancellation: a slow request keeps the dialog open.
|
|
246
|
+
*/
|
|
247
|
+
interface ChConfirmDialog {
|
|
248
|
+
/**
|
|
249
|
+
* Label of the dismissing action.
|
|
250
|
+
* @default 'Cancel'
|
|
251
|
+
*/
|
|
252
|
+
"cancelLabel": string;
|
|
253
|
+
/**
|
|
254
|
+
* Label of the confirming action.
|
|
255
|
+
* @default 'Confirm'
|
|
256
|
+
*/
|
|
257
|
+
"confirmLabel": string;
|
|
258
|
+
/**
|
|
259
|
+
* Whether Escape and the backdrop dismiss the dialog. When false, the only way out is one of the two buttons — use it only for a decision that must be answered rather than abandoned.
|
|
260
|
+
* @default true
|
|
261
|
+
*/
|
|
262
|
+
"dismissible": boolean;
|
|
263
|
+
/**
|
|
264
|
+
* Focus the safe action. Exposed so a consumer can return focus deliberately after a request settles.
|
|
265
|
+
*/
|
|
266
|
+
"focusCancel": () => Promise<void>;
|
|
267
|
+
/**
|
|
268
|
+
* The question, set as the dialog's accessible name. Required: a dialog without a name is announced as an unlabelled group.
|
|
269
|
+
*/
|
|
270
|
+
"heading": string;
|
|
271
|
+
/**
|
|
272
|
+
* Supporting text, rendered under the heading.
|
|
273
|
+
*/
|
|
274
|
+
"message"?: string;
|
|
275
|
+
/**
|
|
276
|
+
* Whether the dialog is open. Kept in sync when it is dismissed.
|
|
277
|
+
* @default false
|
|
278
|
+
*/
|
|
279
|
+
"open": boolean;
|
|
280
|
+
/**
|
|
281
|
+
* Whether the confirm action is in flight; both buttons are then disabled.
|
|
282
|
+
* @default false
|
|
283
|
+
*/
|
|
284
|
+
"pending": boolean;
|
|
285
|
+
/**
|
|
286
|
+
* `danger` styles the confirm action as destructive and moves the initial focus to Cancel, so the safe choice is the default one.
|
|
287
|
+
* @default 'default'
|
|
288
|
+
*/
|
|
289
|
+
"tone": ChConfirmDialogTone;
|
|
290
|
+
}
|
|
228
291
|
/**
|
|
229
292
|
* Label/value pairs for detail views, on a native `<dl>`.
|
|
230
293
|
* The component renders the `<dl>` and the layout; the consumer writes the
|
|
@@ -589,6 +652,73 @@ export namespace Components {
|
|
|
589
652
|
*/
|
|
590
653
|
"value": string;
|
|
591
654
|
}
|
|
655
|
+
/**
|
|
656
|
+
* One-time-code input.
|
|
657
|
+
* One native `<input>` holds the whole code, not a box per digit. Per-digit
|
|
658
|
+
* inputs break paste, break SMS autofill (the platform fills a single field
|
|
659
|
+
* carrying `autocomplete="one-time-code"`), and give a keyboard user several
|
|
660
|
+
* tab stops for what is one value. The segmented look is drawn by the shadow
|
|
661
|
+
* CSS over the single field.
|
|
662
|
+
* It never submits on completion: a code entered is not a decision to send it,
|
|
663
|
+
* so the consumer listens to `chComplete` and submits when it decides to.
|
|
664
|
+
*/
|
|
665
|
+
interface ChOtpInput {
|
|
666
|
+
/**
|
|
667
|
+
* Whether the field is disabled.
|
|
668
|
+
* @default false
|
|
669
|
+
*/
|
|
670
|
+
"disabled": boolean;
|
|
671
|
+
/**
|
|
672
|
+
* Custom error message; wins over the built-in incomplete-code message.
|
|
673
|
+
*/
|
|
674
|
+
"errorMessage"?: string;
|
|
675
|
+
/**
|
|
676
|
+
* Helper text, replaced by `errorMessage` when invalid.
|
|
677
|
+
*/
|
|
678
|
+
"hint"?: string;
|
|
679
|
+
/**
|
|
680
|
+
* `numeric` restricts input to digits, which is the shape of nearly every one-time code and lets a phone open the number pad.
|
|
681
|
+
* @default 'numeric'
|
|
682
|
+
*/
|
|
683
|
+
"inputMode": 'numeric' | 'text';
|
|
684
|
+
/**
|
|
685
|
+
* Whether the field is marked invalid by the consumer.
|
|
686
|
+
* @default false
|
|
687
|
+
*/
|
|
688
|
+
"invalid": boolean;
|
|
689
|
+
/**
|
|
690
|
+
* Visible label, associated with the input via `for`/`id`.
|
|
691
|
+
*/
|
|
692
|
+
"label"?: string;
|
|
693
|
+
/**
|
|
694
|
+
* How many characters make a complete code.
|
|
695
|
+
* @default 6
|
|
696
|
+
*/
|
|
697
|
+
"length": number;
|
|
698
|
+
/**
|
|
699
|
+
* Name submitted with the form.
|
|
700
|
+
*/
|
|
701
|
+
"name"?: string;
|
|
702
|
+
/**
|
|
703
|
+
* Placeholder shown when empty.
|
|
704
|
+
*/
|
|
705
|
+
"placeholder"?: string;
|
|
706
|
+
/**
|
|
707
|
+
* Whether a complete code is required for the field to be valid.
|
|
708
|
+
* @default false
|
|
709
|
+
*/
|
|
710
|
+
"required": boolean;
|
|
711
|
+
/**
|
|
712
|
+
* Whether the codes are masked, as for a short-lived secret.
|
|
713
|
+
* @default false
|
|
714
|
+
*/
|
|
715
|
+
"secret": boolean;
|
|
716
|
+
/**
|
|
717
|
+
* The code without separators. Filtered to alphanumerics on every change.
|
|
718
|
+
* @default ''
|
|
719
|
+
*/
|
|
720
|
+
"value": string;
|
|
721
|
+
}
|
|
592
722
|
/**
|
|
593
723
|
* The heading block at the top of a page: title, optional eyebrow and
|
|
594
724
|
* description, and a trailing actions area.
|
|
@@ -623,6 +753,51 @@ export namespace Components {
|
|
|
623
753
|
*/
|
|
624
754
|
"title": string;
|
|
625
755
|
}
|
|
756
|
+
/**
|
|
757
|
+
* Controlled pagination for a known total.
|
|
758
|
+
* It holds no page state: `page` and `pageSize` come from the consumer and
|
|
759
|
+
* every action emits `chPageChange` with the page it wants. That matches
|
|
760
|
+
* `ch-table`, so a consumer wiring the two together has one model to reason
|
|
761
|
+
* about — the table shows the rows for `page`, the pagination asks for the
|
|
762
|
+
* next one, and nothing moves until the consumer's data does.
|
|
763
|
+
* No numbered page list. A list of numbers is wrong more often than it is
|
|
764
|
+
* right (it depends on how many pages fit, which depends on the font, the
|
|
765
|
+
* locale and the container), and it is the part consumers most often need to
|
|
766
|
+
* replace with their own. Prev/next plus a position summary covers the
|
|
767
|
+
* default case; the summary is what tells a screen-reader user where they are.
|
|
768
|
+
*/
|
|
769
|
+
interface ChPagination {
|
|
770
|
+
/**
|
|
771
|
+
* Whether the whole control is disabled.
|
|
772
|
+
* @default false
|
|
773
|
+
*/
|
|
774
|
+
"disabled": boolean;
|
|
775
|
+
/**
|
|
776
|
+
* Accessible name for the navigation landmark.
|
|
777
|
+
* @default 'Pagination'
|
|
778
|
+
*/
|
|
779
|
+
"label": string;
|
|
780
|
+
/**
|
|
781
|
+
* The current page, 1-based. Controlled by the consumer.
|
|
782
|
+
* @default 1
|
|
783
|
+
*/
|
|
784
|
+
"page": number;
|
|
785
|
+
/**
|
|
786
|
+
* How many rows a page holds. Controlled by the consumer.
|
|
787
|
+
* @default 10
|
|
788
|
+
*/
|
|
789
|
+
"pageSize": number;
|
|
790
|
+
/**
|
|
791
|
+
* Size of the controls.
|
|
792
|
+
* @default 'md'
|
|
793
|
+
*/
|
|
794
|
+
"size": ChPaginationSize;
|
|
795
|
+
/**
|
|
796
|
+
* How many rows exist in total. Zero renders a disabled, empty pager.
|
|
797
|
+
* @default 0
|
|
798
|
+
*/
|
|
799
|
+
"total": number;
|
|
800
|
+
}
|
|
626
801
|
interface ChRadio {
|
|
627
802
|
/**
|
|
628
803
|
* Whether all radios in the group are disabled.
|
|
@@ -1103,6 +1278,10 @@ export interface ChCheckboxCustomEvent<T> extends CustomEvent<T> {
|
|
|
1103
1278
|
detail: T;
|
|
1104
1279
|
target: HTMLChCheckboxElement;
|
|
1105
1280
|
}
|
|
1281
|
+
export interface ChConfirmDialogCustomEvent<T> extends CustomEvent<T> {
|
|
1282
|
+
detail: T;
|
|
1283
|
+
target: HTMLChConfirmDialogElement;
|
|
1284
|
+
}
|
|
1106
1285
|
export interface ChDrawerCustomEvent<T> extends CustomEvent<T> {
|
|
1107
1286
|
detail: T;
|
|
1108
1287
|
target: HTMLChDrawerElement;
|
|
@@ -1127,6 +1306,14 @@ export interface ChNumberInputCustomEvent<T> extends CustomEvent<T> {
|
|
|
1127
1306
|
detail: T;
|
|
1128
1307
|
target: HTMLChNumberInputElement;
|
|
1129
1308
|
}
|
|
1309
|
+
export interface ChOtpInputCustomEvent<T> extends CustomEvent<T> {
|
|
1310
|
+
detail: T;
|
|
1311
|
+
target: HTMLChOtpInputElement;
|
|
1312
|
+
}
|
|
1313
|
+
export interface ChPaginationCustomEvent<T> extends CustomEvent<T> {
|
|
1314
|
+
detail: T;
|
|
1315
|
+
target: HTMLChPaginationElement;
|
|
1316
|
+
}
|
|
1130
1317
|
export interface ChRadioCustomEvent<T> extends CustomEvent<T> {
|
|
1131
1318
|
detail: T;
|
|
1132
1319
|
target: HTMLChRadioElement;
|
|
@@ -1265,6 +1452,39 @@ declare global {
|
|
|
1265
1452
|
prototype: HTMLChClusterElement;
|
|
1266
1453
|
new (): HTMLChClusterElement;
|
|
1267
1454
|
};
|
|
1455
|
+
interface HTMLChConfirmDialogElementEventMap {
|
|
1456
|
+
"chConfirm": void;
|
|
1457
|
+
"chCancel": void;
|
|
1458
|
+
}
|
|
1459
|
+
/**
|
|
1460
|
+
* A confirmation dialog over `ch-modal`.
|
|
1461
|
+
* Declarative only: the consumer opens it with `open` and handles the outcome.
|
|
1462
|
+
* The imperative `confirm()` helper is a separate concern and a separate issue,
|
|
1463
|
+
* because a promise-returning helper has to own mounting, focus and unhandled
|
|
1464
|
+
* rejection, none of which a component should decide for its consumer.
|
|
1465
|
+
* The guarantees this adds over a plain `ch-modal` are the ones that make a
|
|
1466
|
+
* confirmation safe:
|
|
1467
|
+
* - exactly one outcome per interaction — a double click on Confirm emits once;
|
|
1468
|
+
* - every dismissal path (Cancel, Escape, backdrop, confirm) is reported, so a
|
|
1469
|
+
* consumer awaiting an answer cannot hang;
|
|
1470
|
+
* - focus lands on Cancel for a destructive action, so the absent-minded Enter
|
|
1471
|
+
* does not destroy anything;
|
|
1472
|
+
* - `pending` is not a cancellation: a slow request keeps the dialog open.
|
|
1473
|
+
*/
|
|
1474
|
+
interface HTMLChConfirmDialogElement extends Components.ChConfirmDialog, HTMLStencilElement {
|
|
1475
|
+
addEventListener<K extends keyof HTMLChConfirmDialogElementEventMap>(type: K, listener: (this: HTMLChConfirmDialogElement, ev: ChConfirmDialogCustomEvent<HTMLChConfirmDialogElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1476
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1477
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1478
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
1479
|
+
removeEventListener<K extends keyof HTMLChConfirmDialogElementEventMap>(type: K, listener: (this: HTMLChConfirmDialogElement, ev: ChConfirmDialogCustomEvent<HTMLChConfirmDialogElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
1480
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
1481
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
1482
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
1483
|
+
}
|
|
1484
|
+
var HTMLChConfirmDialogElement: {
|
|
1485
|
+
prototype: HTMLChConfirmDialogElement;
|
|
1486
|
+
new (): HTMLChConfirmDialogElement;
|
|
1487
|
+
};
|
|
1268
1488
|
/**
|
|
1269
1489
|
* Label/value pairs for detail views, on a native `<dl>`.
|
|
1270
1490
|
* The component renders the `<dl>` and the layout; the consumer writes the
|
|
@@ -1499,6 +1719,34 @@ declare global {
|
|
|
1499
1719
|
prototype: HTMLChNumberInputElement;
|
|
1500
1720
|
new (): HTMLChNumberInputElement;
|
|
1501
1721
|
};
|
|
1722
|
+
interface HTMLChOtpInputElementEventMap {
|
|
1723
|
+
"chInput": string;
|
|
1724
|
+
"chComplete": string;
|
|
1725
|
+
}
|
|
1726
|
+
/**
|
|
1727
|
+
* One-time-code input.
|
|
1728
|
+
* One native `<input>` holds the whole code, not a box per digit. Per-digit
|
|
1729
|
+
* inputs break paste, break SMS autofill (the platform fills a single field
|
|
1730
|
+
* carrying `autocomplete="one-time-code"`), and give a keyboard user several
|
|
1731
|
+
* tab stops for what is one value. The segmented look is drawn by the shadow
|
|
1732
|
+
* CSS over the single field.
|
|
1733
|
+
* It never submits on completion: a code entered is not a decision to send it,
|
|
1734
|
+
* so the consumer listens to `chComplete` and submits when it decides to.
|
|
1735
|
+
*/
|
|
1736
|
+
interface HTMLChOtpInputElement extends Components.ChOtpInput, HTMLStencilElement {
|
|
1737
|
+
addEventListener<K extends keyof HTMLChOtpInputElementEventMap>(type: K, listener: (this: HTMLChOtpInputElement, ev: ChOtpInputCustomEvent<HTMLChOtpInputElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1738
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1739
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1740
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
1741
|
+
removeEventListener<K extends keyof HTMLChOtpInputElementEventMap>(type: K, listener: (this: HTMLChOtpInputElement, ev: ChOtpInputCustomEvent<HTMLChOtpInputElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
1742
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
1743
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
1744
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
1745
|
+
}
|
|
1746
|
+
var HTMLChOtpInputElement: {
|
|
1747
|
+
prototype: HTMLChOtpInputElement;
|
|
1748
|
+
new (): HTMLChOtpInputElement;
|
|
1749
|
+
};
|
|
1502
1750
|
/**
|
|
1503
1751
|
* The heading block at the top of a page: title, optional eyebrow and
|
|
1504
1752
|
* description, and a trailing actions area.
|
|
@@ -1515,6 +1763,36 @@ declare global {
|
|
|
1515
1763
|
prototype: HTMLChPageHeaderElement;
|
|
1516
1764
|
new (): HTMLChPageHeaderElement;
|
|
1517
1765
|
};
|
|
1766
|
+
interface HTMLChPaginationElementEventMap {
|
|
1767
|
+
"chPageChange": { page: number; pageSize: number };
|
|
1768
|
+
}
|
|
1769
|
+
/**
|
|
1770
|
+
* Controlled pagination for a known total.
|
|
1771
|
+
* It holds no page state: `page` and `pageSize` come from the consumer and
|
|
1772
|
+
* every action emits `chPageChange` with the page it wants. That matches
|
|
1773
|
+
* `ch-table`, so a consumer wiring the two together has one model to reason
|
|
1774
|
+
* about — the table shows the rows for `page`, the pagination asks for the
|
|
1775
|
+
* next one, and nothing moves until the consumer's data does.
|
|
1776
|
+
* No numbered page list. A list of numbers is wrong more often than it is
|
|
1777
|
+
* right (it depends on how many pages fit, which depends on the font, the
|
|
1778
|
+
* locale and the container), and it is the part consumers most often need to
|
|
1779
|
+
* replace with their own. Prev/next plus a position summary covers the
|
|
1780
|
+
* default case; the summary is what tells a screen-reader user where they are.
|
|
1781
|
+
*/
|
|
1782
|
+
interface HTMLChPaginationElement extends Components.ChPagination, HTMLStencilElement {
|
|
1783
|
+
addEventListener<K extends keyof HTMLChPaginationElementEventMap>(type: K, listener: (this: HTMLChPaginationElement, ev: ChPaginationCustomEvent<HTMLChPaginationElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1784
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1785
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1786
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
1787
|
+
removeEventListener<K extends keyof HTMLChPaginationElementEventMap>(type: K, listener: (this: HTMLChPaginationElement, ev: ChPaginationCustomEvent<HTMLChPaginationElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
1788
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
1789
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
1790
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
1791
|
+
}
|
|
1792
|
+
var HTMLChPaginationElement: {
|
|
1793
|
+
prototype: HTMLChPaginationElement;
|
|
1794
|
+
new (): HTMLChPaginationElement;
|
|
1795
|
+
};
|
|
1518
1796
|
interface HTMLChRadioElementEventMap {
|
|
1519
1797
|
"chChange": string;
|
|
1520
1798
|
}
|
|
@@ -1802,6 +2080,7 @@ declare global {
|
|
|
1802
2080
|
"ch-card": HTMLChCardElement;
|
|
1803
2081
|
"ch-checkbox": HTMLChCheckboxElement;
|
|
1804
2082
|
"ch-cluster": HTMLChClusterElement;
|
|
2083
|
+
"ch-confirm-dialog": HTMLChConfirmDialogElement;
|
|
1805
2084
|
"ch-description-list": HTMLChDescriptionListElement;
|
|
1806
2085
|
"ch-divider": HTMLChDividerElement;
|
|
1807
2086
|
"ch-drawer": HTMLChDrawerElement;
|
|
@@ -1814,7 +2093,9 @@ declare global {
|
|
|
1814
2093
|
"ch-link": HTMLChLinkElement;
|
|
1815
2094
|
"ch-modal": HTMLChModalElement;
|
|
1816
2095
|
"ch-number-input": HTMLChNumberInputElement;
|
|
2096
|
+
"ch-otp-input": HTMLChOtpInputElement;
|
|
1817
2097
|
"ch-page-header": HTMLChPageHeaderElement;
|
|
2098
|
+
"ch-pagination": HTMLChPaginationElement;
|
|
1818
2099
|
"ch-radio": HTMLChRadioElement;
|
|
1819
2100
|
"ch-segmented-control": HTMLChSegmentedControlElement;
|
|
1820
2101
|
"ch-select": HTMLChSelectElement;
|
|
@@ -2016,6 +2297,69 @@ declare namespace LocalJSX {
|
|
|
2016
2297
|
*/
|
|
2017
2298
|
"wrap"?: boolean;
|
|
2018
2299
|
}
|
|
2300
|
+
/**
|
|
2301
|
+
* A confirmation dialog over `ch-modal`.
|
|
2302
|
+
* Declarative only: the consumer opens it with `open` and handles the outcome.
|
|
2303
|
+
* The imperative `confirm()` helper is a separate concern and a separate issue,
|
|
2304
|
+
* because a promise-returning helper has to own mounting, focus and unhandled
|
|
2305
|
+
* rejection, none of which a component should decide for its consumer.
|
|
2306
|
+
* The guarantees this adds over a plain `ch-modal` are the ones that make a
|
|
2307
|
+
* confirmation safe:
|
|
2308
|
+
* - exactly one outcome per interaction — a double click on Confirm emits once;
|
|
2309
|
+
* - every dismissal path (Cancel, Escape, backdrop, confirm) is reported, so a
|
|
2310
|
+
* consumer awaiting an answer cannot hang;
|
|
2311
|
+
* - focus lands on Cancel for a destructive action, so the absent-minded Enter
|
|
2312
|
+
* does not destroy anything;
|
|
2313
|
+
* - `pending` is not a cancellation: a slow request keeps the dialog open.
|
|
2314
|
+
*/
|
|
2315
|
+
interface ChConfirmDialog {
|
|
2316
|
+
/**
|
|
2317
|
+
* Label of the dismissing action.
|
|
2318
|
+
* @default 'Cancel'
|
|
2319
|
+
*/
|
|
2320
|
+
"cancelLabel"?: string;
|
|
2321
|
+
/**
|
|
2322
|
+
* Label of the confirming action.
|
|
2323
|
+
* @default 'Confirm'
|
|
2324
|
+
*/
|
|
2325
|
+
"confirmLabel"?: string;
|
|
2326
|
+
/**
|
|
2327
|
+
* Whether Escape and the backdrop dismiss the dialog. When false, the only way out is one of the two buttons — use it only for a decision that must be answered rather than abandoned.
|
|
2328
|
+
* @default true
|
|
2329
|
+
*/
|
|
2330
|
+
"dismissible"?: boolean;
|
|
2331
|
+
/**
|
|
2332
|
+
* The question, set as the dialog's accessible name. Required: a dialog without a name is announced as an unlabelled group.
|
|
2333
|
+
*/
|
|
2334
|
+
"heading": string;
|
|
2335
|
+
/**
|
|
2336
|
+
* Supporting text, rendered under the heading.
|
|
2337
|
+
*/
|
|
2338
|
+
"message"?: string;
|
|
2339
|
+
/**
|
|
2340
|
+
* Emitted once when the dialog is dismissed without confirming.
|
|
2341
|
+
*/
|
|
2342
|
+
"onChCancel"?: (event: ChConfirmDialogCustomEvent<void>) => void;
|
|
2343
|
+
/**
|
|
2344
|
+
* Emitted once when the user confirms.
|
|
2345
|
+
*/
|
|
2346
|
+
"onChConfirm"?: (event: ChConfirmDialogCustomEvent<void>) => void;
|
|
2347
|
+
/**
|
|
2348
|
+
* Whether the dialog is open. Kept in sync when it is dismissed.
|
|
2349
|
+
* @default false
|
|
2350
|
+
*/
|
|
2351
|
+
"open"?: boolean;
|
|
2352
|
+
/**
|
|
2353
|
+
* Whether the confirm action is in flight; both buttons are then disabled.
|
|
2354
|
+
* @default false
|
|
2355
|
+
*/
|
|
2356
|
+
"pending"?: boolean;
|
|
2357
|
+
/**
|
|
2358
|
+
* `danger` styles the confirm action as destructive and moves the initial focus to Cancel, so the safe choice is the default one.
|
|
2359
|
+
* @default 'default'
|
|
2360
|
+
*/
|
|
2361
|
+
"tone"?: ChConfirmDialogTone;
|
|
2362
|
+
}
|
|
2019
2363
|
/**
|
|
2020
2364
|
* Label/value pairs for detail views, on a native `<dl>`.
|
|
2021
2365
|
* The component renders the `<dl>` and the layout; the consumer writes the
|
|
@@ -2428,6 +2772,85 @@ declare namespace LocalJSX {
|
|
|
2428
2772
|
*/
|
|
2429
2773
|
"value"?: string;
|
|
2430
2774
|
}
|
|
2775
|
+
/**
|
|
2776
|
+
* One-time-code input.
|
|
2777
|
+
* One native `<input>` holds the whole code, not a box per digit. Per-digit
|
|
2778
|
+
* inputs break paste, break SMS autofill (the platform fills a single field
|
|
2779
|
+
* carrying `autocomplete="one-time-code"`), and give a keyboard user several
|
|
2780
|
+
* tab stops for what is one value. The segmented look is drawn by the shadow
|
|
2781
|
+
* CSS over the single field.
|
|
2782
|
+
* It never submits on completion: a code entered is not a decision to send it,
|
|
2783
|
+
* so the consumer listens to `chComplete` and submits when it decides to.
|
|
2784
|
+
*/
|
|
2785
|
+
interface ChOtpInput {
|
|
2786
|
+
/**
|
|
2787
|
+
* Whether the field is disabled.
|
|
2788
|
+
* @default false
|
|
2789
|
+
*/
|
|
2790
|
+
"disabled"?: boolean;
|
|
2791
|
+
/**
|
|
2792
|
+
* Custom error message; wins over the built-in incomplete-code message.
|
|
2793
|
+
*/
|
|
2794
|
+
"errorMessage"?: string;
|
|
2795
|
+
/**
|
|
2796
|
+
* The `id` of a `<form>` element to associate this element with.
|
|
2797
|
+
*/
|
|
2798
|
+
"form"?: string;
|
|
2799
|
+
/**
|
|
2800
|
+
* Helper text, replaced by `errorMessage` when invalid.
|
|
2801
|
+
*/
|
|
2802
|
+
"hint"?: string;
|
|
2803
|
+
/**
|
|
2804
|
+
* `numeric` restricts input to digits, which is the shape of nearly every one-time code and lets a phone open the number pad.
|
|
2805
|
+
* @default 'numeric'
|
|
2806
|
+
*/
|
|
2807
|
+
"inputMode"?: 'numeric' | 'text';
|
|
2808
|
+
/**
|
|
2809
|
+
* Whether the field is marked invalid by the consumer.
|
|
2810
|
+
* @default false
|
|
2811
|
+
*/
|
|
2812
|
+
"invalid"?: boolean;
|
|
2813
|
+
/**
|
|
2814
|
+
* Visible label, associated with the input via `for`/`id`.
|
|
2815
|
+
*/
|
|
2816
|
+
"label"?: string;
|
|
2817
|
+
/**
|
|
2818
|
+
* How many characters make a complete code.
|
|
2819
|
+
* @default 6
|
|
2820
|
+
*/
|
|
2821
|
+
"length"?: number;
|
|
2822
|
+
/**
|
|
2823
|
+
* Name submitted with the form.
|
|
2824
|
+
*/
|
|
2825
|
+
"name"?: string;
|
|
2826
|
+
/**
|
|
2827
|
+
* Emitted once, when the code becomes complete and valid after not being so. Never fires again while it stays complete, so holding a code cannot resubmit it.
|
|
2828
|
+
*/
|
|
2829
|
+
"onChComplete"?: (event: ChOtpInputCustomEvent<string>) => void;
|
|
2830
|
+
/**
|
|
2831
|
+
* Emitted on every change with the current (possibly partial) code.
|
|
2832
|
+
*/
|
|
2833
|
+
"onChInput"?: (event: ChOtpInputCustomEvent<string>) => void;
|
|
2834
|
+
/**
|
|
2835
|
+
* Placeholder shown when empty.
|
|
2836
|
+
*/
|
|
2837
|
+
"placeholder"?: string;
|
|
2838
|
+
/**
|
|
2839
|
+
* Whether a complete code is required for the field to be valid.
|
|
2840
|
+
* @default false
|
|
2841
|
+
*/
|
|
2842
|
+
"required"?: boolean;
|
|
2843
|
+
/**
|
|
2844
|
+
* Whether the codes are masked, as for a short-lived secret.
|
|
2845
|
+
* @default false
|
|
2846
|
+
*/
|
|
2847
|
+
"secret"?: boolean;
|
|
2848
|
+
/**
|
|
2849
|
+
* The code without separators. Filtered to alphanumerics on every change.
|
|
2850
|
+
* @default ''
|
|
2851
|
+
*/
|
|
2852
|
+
"value"?: string;
|
|
2853
|
+
}
|
|
2431
2854
|
/**
|
|
2432
2855
|
* The heading block at the top of a page: title, optional eyebrow and
|
|
2433
2856
|
* description, and a trailing actions area.
|
|
@@ -2462,6 +2885,55 @@ declare namespace LocalJSX {
|
|
|
2462
2885
|
*/
|
|
2463
2886
|
"title": string;
|
|
2464
2887
|
}
|
|
2888
|
+
/**
|
|
2889
|
+
* Controlled pagination for a known total.
|
|
2890
|
+
* It holds no page state: `page` and `pageSize` come from the consumer and
|
|
2891
|
+
* every action emits `chPageChange` with the page it wants. That matches
|
|
2892
|
+
* `ch-table`, so a consumer wiring the two together has one model to reason
|
|
2893
|
+
* about — the table shows the rows for `page`, the pagination asks for the
|
|
2894
|
+
* next one, and nothing moves until the consumer's data does.
|
|
2895
|
+
* No numbered page list. A list of numbers is wrong more often than it is
|
|
2896
|
+
* right (it depends on how many pages fit, which depends on the font, the
|
|
2897
|
+
* locale and the container), and it is the part consumers most often need to
|
|
2898
|
+
* replace with their own. Prev/next plus a position summary covers the
|
|
2899
|
+
* default case; the summary is what tells a screen-reader user where they are.
|
|
2900
|
+
*/
|
|
2901
|
+
interface ChPagination {
|
|
2902
|
+
/**
|
|
2903
|
+
* Whether the whole control is disabled.
|
|
2904
|
+
* @default false
|
|
2905
|
+
*/
|
|
2906
|
+
"disabled"?: boolean;
|
|
2907
|
+
/**
|
|
2908
|
+
* Accessible name for the navigation landmark.
|
|
2909
|
+
* @default 'Pagination'
|
|
2910
|
+
*/
|
|
2911
|
+
"label"?: string;
|
|
2912
|
+
/**
|
|
2913
|
+
* Emitted when the user asks for another page. The consumer applies it.
|
|
2914
|
+
*/
|
|
2915
|
+
"onChPageChange"?: (event: ChPaginationCustomEvent<{ page: number; pageSize: number }>) => void;
|
|
2916
|
+
/**
|
|
2917
|
+
* The current page, 1-based. Controlled by the consumer.
|
|
2918
|
+
* @default 1
|
|
2919
|
+
*/
|
|
2920
|
+
"page"?: number;
|
|
2921
|
+
/**
|
|
2922
|
+
* How many rows a page holds. Controlled by the consumer.
|
|
2923
|
+
* @default 10
|
|
2924
|
+
*/
|
|
2925
|
+
"pageSize"?: number;
|
|
2926
|
+
/**
|
|
2927
|
+
* Size of the controls.
|
|
2928
|
+
* @default 'md'
|
|
2929
|
+
*/
|
|
2930
|
+
"size"?: ChPaginationSize;
|
|
2931
|
+
/**
|
|
2932
|
+
* How many rows exist in total. Zero renders a disabled, empty pager.
|
|
2933
|
+
* @default 0
|
|
2934
|
+
*/
|
|
2935
|
+
"total"?: number;
|
|
2936
|
+
}
|
|
2465
2937
|
interface ChRadio {
|
|
2466
2938
|
/**
|
|
2467
2939
|
* Whether all radios in the group are disabled.
|
|
@@ -3016,6 +3488,16 @@ declare namespace LocalJSX {
|
|
|
3016
3488
|
"justify": ChClusterJustify;
|
|
3017
3489
|
"wrap": boolean;
|
|
3018
3490
|
}
|
|
3491
|
+
interface ChConfirmDialogAttributes {
|
|
3492
|
+
"open": boolean;
|
|
3493
|
+
"heading": string;
|
|
3494
|
+
"message": string;
|
|
3495
|
+
"confirmLabel": string;
|
|
3496
|
+
"cancelLabel": string;
|
|
3497
|
+
"tone": ChConfirmDialogTone;
|
|
3498
|
+
"pending": boolean;
|
|
3499
|
+
"dismissible": boolean;
|
|
3500
|
+
}
|
|
3019
3501
|
interface ChDescriptionListAttributes {
|
|
3020
3502
|
"columns": ChDescriptionListColumns;
|
|
3021
3503
|
}
|
|
@@ -3095,6 +3577,20 @@ declare namespace LocalJSX {
|
|
|
3095
3577
|
"errorMessage": string;
|
|
3096
3578
|
"invalid": boolean;
|
|
3097
3579
|
}
|
|
3580
|
+
interface ChOtpInputAttributes {
|
|
3581
|
+
"label": string;
|
|
3582
|
+
"value": string;
|
|
3583
|
+
"length": number;
|
|
3584
|
+
"inputMode": 'numeric' | 'text';
|
|
3585
|
+
"secret": boolean;
|
|
3586
|
+
"placeholder": string;
|
|
3587
|
+
"name": string;
|
|
3588
|
+
"disabled": boolean;
|
|
3589
|
+
"required": boolean;
|
|
3590
|
+
"hint": string;
|
|
3591
|
+
"errorMessage": string;
|
|
3592
|
+
"invalid": boolean;
|
|
3593
|
+
}
|
|
3098
3594
|
interface ChPageHeaderAttributes {
|
|
3099
3595
|
"title": string;
|
|
3100
3596
|
"headingLevel": ChPageHeaderHeadingLevel;
|
|
@@ -3102,6 +3598,14 @@ declare namespace LocalJSX {
|
|
|
3102
3598
|
"description": string;
|
|
3103
3599
|
"actionsStacked": boolean;
|
|
3104
3600
|
}
|
|
3601
|
+
interface ChPaginationAttributes {
|
|
3602
|
+
"page": number;
|
|
3603
|
+
"pageSize": number;
|
|
3604
|
+
"total": number;
|
|
3605
|
+
"label": string;
|
|
3606
|
+
"size": ChPaginationSize;
|
|
3607
|
+
"disabled": boolean;
|
|
3608
|
+
}
|
|
3105
3609
|
interface ChRadioAttributes {
|
|
3106
3610
|
"label": string;
|
|
3107
3611
|
"value": string;
|
|
@@ -3199,6 +3703,7 @@ declare namespace LocalJSX {
|
|
|
3199
3703
|
"ch-card": ChCard;
|
|
3200
3704
|
"ch-checkbox": Omit<ChCheckbox, keyof ChCheckboxAttributes> & { [K in keyof ChCheckbox & keyof ChCheckboxAttributes]?: ChCheckbox[K] } & { [K in keyof ChCheckbox & keyof ChCheckboxAttributes as `attr:${K}`]?: ChCheckboxAttributes[K] } & { [K in keyof ChCheckbox & keyof ChCheckboxAttributes as `prop:${K}`]?: ChCheckbox[K] };
|
|
3201
3705
|
"ch-cluster": Omit<ChCluster, keyof ChClusterAttributes> & { [K in keyof ChCluster & keyof ChClusterAttributes]?: ChCluster[K] } & { [K in keyof ChCluster & keyof ChClusterAttributes as `attr:${K}`]?: ChClusterAttributes[K] } & { [K in keyof ChCluster & keyof ChClusterAttributes as `prop:${K}`]?: ChCluster[K] };
|
|
3706
|
+
"ch-confirm-dialog": Omit<ChConfirmDialog, keyof ChConfirmDialogAttributes> & { [K in keyof ChConfirmDialog & keyof ChConfirmDialogAttributes]?: ChConfirmDialog[K] } & { [K in keyof ChConfirmDialog & keyof ChConfirmDialogAttributes as `attr:${K}`]?: ChConfirmDialogAttributes[K] } & { [K in keyof ChConfirmDialog & keyof ChConfirmDialogAttributes as `prop:${K}`]?: ChConfirmDialog[K] } & OneOf<"heading", ChConfirmDialog["heading"], ChConfirmDialogAttributes["heading"]>;
|
|
3202
3707
|
"ch-description-list": Omit<ChDescriptionList, keyof ChDescriptionListAttributes> & { [K in keyof ChDescriptionList & keyof ChDescriptionListAttributes]?: ChDescriptionList[K] } & { [K in keyof ChDescriptionList & keyof ChDescriptionListAttributes as `attr:${K}`]?: ChDescriptionListAttributes[K] } & { [K in keyof ChDescriptionList & keyof ChDescriptionListAttributes as `prop:${K}`]?: ChDescriptionList[K] };
|
|
3203
3708
|
"ch-divider": Omit<ChDivider, keyof ChDividerAttributes> & { [K in keyof ChDivider & keyof ChDividerAttributes]?: ChDivider[K] } & { [K in keyof ChDivider & keyof ChDividerAttributes as `attr:${K}`]?: ChDividerAttributes[K] } & { [K in keyof ChDivider & keyof ChDividerAttributes as `prop:${K}`]?: ChDivider[K] };
|
|
3204
3709
|
"ch-drawer": Omit<ChDrawer, keyof ChDrawerAttributes> & { [K in keyof ChDrawer & keyof ChDrawerAttributes]?: ChDrawer[K] } & { [K in keyof ChDrawer & keyof ChDrawerAttributes as `attr:${K}`]?: ChDrawerAttributes[K] } & { [K in keyof ChDrawer & keyof ChDrawerAttributes as `prop:${K}`]?: ChDrawer[K] };
|
|
@@ -3211,7 +3716,9 @@ declare namespace LocalJSX {
|
|
|
3211
3716
|
"ch-link": Omit<ChLink, keyof ChLinkAttributes> & { [K in keyof ChLink & keyof ChLinkAttributes]?: ChLink[K] } & { [K in keyof ChLink & keyof ChLinkAttributes as `attr:${K}`]?: ChLinkAttributes[K] } & { [K in keyof ChLink & keyof ChLinkAttributes as `prop:${K}`]?: ChLink[K] };
|
|
3212
3717
|
"ch-modal": Omit<ChModal, keyof ChModalAttributes> & { [K in keyof ChModal & keyof ChModalAttributes]?: ChModal[K] } & { [K in keyof ChModal & keyof ChModalAttributes as `attr:${K}`]?: ChModalAttributes[K] } & { [K in keyof ChModal & keyof ChModalAttributes as `prop:${K}`]?: ChModal[K] };
|
|
3213
3718
|
"ch-number-input": Omit<ChNumberInput, keyof ChNumberInputAttributes> & { [K in keyof ChNumberInput & keyof ChNumberInputAttributes]?: ChNumberInput[K] } & { [K in keyof ChNumberInput & keyof ChNumberInputAttributes as `attr:${K}`]?: ChNumberInputAttributes[K] } & { [K in keyof ChNumberInput & keyof ChNumberInputAttributes as `prop:${K}`]?: ChNumberInput[K] };
|
|
3719
|
+
"ch-otp-input": Omit<ChOtpInput, keyof ChOtpInputAttributes> & { [K in keyof ChOtpInput & keyof ChOtpInputAttributes]?: ChOtpInput[K] } & { [K in keyof ChOtpInput & keyof ChOtpInputAttributes as `attr:${K}`]?: ChOtpInputAttributes[K] } & { [K in keyof ChOtpInput & keyof ChOtpInputAttributes as `prop:${K}`]?: ChOtpInput[K] };
|
|
3214
3720
|
"ch-page-header": Omit<ChPageHeader, keyof ChPageHeaderAttributes> & { [K in keyof ChPageHeader & keyof ChPageHeaderAttributes]?: ChPageHeader[K] } & { [K in keyof ChPageHeader & keyof ChPageHeaderAttributes as `attr:${K}`]?: ChPageHeaderAttributes[K] } & { [K in keyof ChPageHeader & keyof ChPageHeaderAttributes as `prop:${K}`]?: ChPageHeader[K] } & OneOf<"title", ChPageHeader["title"], ChPageHeaderAttributes["title"]>;
|
|
3721
|
+
"ch-pagination": Omit<ChPagination, keyof ChPaginationAttributes> & { [K in keyof ChPagination & keyof ChPaginationAttributes]?: ChPagination[K] } & { [K in keyof ChPagination & keyof ChPaginationAttributes as `attr:${K}`]?: ChPaginationAttributes[K] } & { [K in keyof ChPagination & keyof ChPaginationAttributes as `prop:${K}`]?: ChPagination[K] };
|
|
3215
3722
|
"ch-radio": Omit<ChRadio, keyof ChRadioAttributes> & { [K in keyof ChRadio & keyof ChRadioAttributes]?: ChRadio[K] } & { [K in keyof ChRadio & keyof ChRadioAttributes as `attr:${K}`]?: ChRadioAttributes[K] } & { [K in keyof ChRadio & keyof ChRadioAttributes as `prop:${K}`]?: ChRadio[K] };
|
|
3216
3723
|
"ch-segmented-control": Omit<ChSegmentedControl, keyof ChSegmentedControlAttributes> & { [K in keyof ChSegmentedControl & keyof ChSegmentedControlAttributes]?: ChSegmentedControl[K] } & { [K in keyof ChSegmentedControl & keyof ChSegmentedControlAttributes as `attr:${K}`]?: ChSegmentedControlAttributes[K] } & { [K in keyof ChSegmentedControl & keyof ChSegmentedControlAttributes as `prop:${K}`]?: ChSegmentedControl[K] };
|
|
3217
3724
|
"ch-select": Omit<ChSelect, keyof ChSelectAttributes> & { [K in keyof ChSelect & keyof ChSelectAttributes]?: ChSelect[K] } & { [K in keyof ChSelect & keyof ChSelectAttributes as `attr:${K}`]?: ChSelectAttributes[K] } & { [K in keyof ChSelect & keyof ChSelectAttributes as `prop:${K}`]?: ChSelect[K] };
|
|
@@ -3261,6 +3768,22 @@ declare module "@stencil/core" {
|
|
|
3261
3768
|
* gap in both axes — the layout a toolbar, a tag list or a button row needs.
|
|
3262
3769
|
*/
|
|
3263
3770
|
"ch-cluster": LocalJSX.IntrinsicElements["ch-cluster"] & JSXBase.HTMLAttributes<HTMLChClusterElement>;
|
|
3771
|
+
/**
|
|
3772
|
+
* A confirmation dialog over `ch-modal`.
|
|
3773
|
+
* Declarative only: the consumer opens it with `open` and handles the outcome.
|
|
3774
|
+
* The imperative `confirm()` helper is a separate concern and a separate issue,
|
|
3775
|
+
* because a promise-returning helper has to own mounting, focus and unhandled
|
|
3776
|
+
* rejection, none of which a component should decide for its consumer.
|
|
3777
|
+
* The guarantees this adds over a plain `ch-modal` are the ones that make a
|
|
3778
|
+
* confirmation safe:
|
|
3779
|
+
* - exactly one outcome per interaction — a double click on Confirm emits once;
|
|
3780
|
+
* - every dismissal path (Cancel, Escape, backdrop, confirm) is reported, so a
|
|
3781
|
+
* consumer awaiting an answer cannot hang;
|
|
3782
|
+
* - focus lands on Cancel for a destructive action, so the absent-minded Enter
|
|
3783
|
+
* does not destroy anything;
|
|
3784
|
+
* - `pending` is not a cancellation: a slow request keeps the dialog open.
|
|
3785
|
+
*/
|
|
3786
|
+
"ch-confirm-dialog": LocalJSX.IntrinsicElements["ch-confirm-dialog"] & JSXBase.HTMLAttributes<HTMLChConfirmDialogElement>;
|
|
3264
3787
|
/**
|
|
3265
3788
|
* Label/value pairs for detail views, on a native `<dl>`.
|
|
3266
3789
|
* The component renders the `<dl>` and the layout; the consumer writes the
|
|
@@ -3365,6 +3888,17 @@ declare module "@stencil/core" {
|
|
|
3365
3888
|
* boundary for Chilean pesos, the only case with a real consumer.
|
|
3366
3889
|
*/
|
|
3367
3890
|
"ch-number-input": LocalJSX.IntrinsicElements["ch-number-input"] & JSXBase.HTMLAttributes<HTMLChNumberInputElement>;
|
|
3891
|
+
/**
|
|
3892
|
+
* One-time-code input.
|
|
3893
|
+
* One native `<input>` holds the whole code, not a box per digit. Per-digit
|
|
3894
|
+
* inputs break paste, break SMS autofill (the platform fills a single field
|
|
3895
|
+
* carrying `autocomplete="one-time-code"`), and give a keyboard user several
|
|
3896
|
+
* tab stops for what is one value. The segmented look is drawn by the shadow
|
|
3897
|
+
* CSS over the single field.
|
|
3898
|
+
* It never submits on completion: a code entered is not a decision to send it,
|
|
3899
|
+
* so the consumer listens to `chComplete` and submits when it decides to.
|
|
3900
|
+
*/
|
|
3901
|
+
"ch-otp-input": LocalJSX.IntrinsicElements["ch-otp-input"] & JSXBase.HTMLAttributes<HTMLChOtpInputElement>;
|
|
3368
3902
|
/**
|
|
3369
3903
|
* The heading block at the top of a page: title, optional eyebrow and
|
|
3370
3904
|
* description, and a trailing actions area.
|
|
@@ -3376,6 +3910,20 @@ declare module "@stencil/core" {
|
|
|
3376
3910
|
* the actions so reading and focus order still start with the title.
|
|
3377
3911
|
*/
|
|
3378
3912
|
"ch-page-header": LocalJSX.IntrinsicElements["ch-page-header"] & JSXBase.HTMLAttributes<HTMLChPageHeaderElement>;
|
|
3913
|
+
/**
|
|
3914
|
+
* Controlled pagination for a known total.
|
|
3915
|
+
* It holds no page state: `page` and `pageSize` come from the consumer and
|
|
3916
|
+
* every action emits `chPageChange` with the page it wants. That matches
|
|
3917
|
+
* `ch-table`, so a consumer wiring the two together has one model to reason
|
|
3918
|
+
* about — the table shows the rows for `page`, the pagination asks for the
|
|
3919
|
+
* next one, and nothing moves until the consumer's data does.
|
|
3920
|
+
* No numbered page list. A list of numbers is wrong more often than it is
|
|
3921
|
+
* right (it depends on how many pages fit, which depends on the font, the
|
|
3922
|
+
* locale and the container), and it is the part consumers most often need to
|
|
3923
|
+
* replace with their own. Prev/next plus a position summary covers the
|
|
3924
|
+
* default case; the summary is what tells a screen-reader user where they are.
|
|
3925
|
+
*/
|
|
3926
|
+
"ch-pagination": LocalJSX.IntrinsicElements["ch-pagination"] & JSXBase.HTMLAttributes<HTMLChPaginationElement>;
|
|
3379
3927
|
"ch-radio": LocalJSX.IntrinsicElements["ch-radio"] & JSXBase.HTMLAttributes<HTMLChRadioElement>;
|
|
3380
3928
|
/**
|
|
3381
3929
|
* Compact control for switching between a few mutually exclusive options
|