@tanrei/web 0.0.0-stage → 0.1.0-next.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/LICENSE +202 -0
- package/NOTICE +58 -0
- package/README.md +9743 -2
- package/custom-elements.json +86072 -0
- package/dist/THIRD_PARTY_LICENSES.md +136 -0
- package/dist/accordion.css +812 -0
- package/dist/app-shell.css +493 -0
- package/dist/avatar.css +80 -0
- package/dist/breadcrumbs.css +511 -0
- package/dist/callout.css +65 -0
- package/dist/code.css +595 -0
- package/dist/components/accordion/accordion.d.ts +197 -0
- package/dist/components/accordion/accordion.js +763 -0
- package/dist/components/accordion/accordion.js.map +1 -0
- package/dist/components/app-bar/app-bar.d.ts +107 -0
- package/dist/components/app-bar/app-bar.js +295 -0
- package/dist/components/app-bar/app-bar.js.map +1 -0
- package/dist/components/app-bar/app-bar.styles.d.ts +12 -0
- package/dist/components/app-bar/app-bar.styles.js +223 -0
- package/dist/components/app-bar/app-bar.styles.js.map +1 -0
- package/dist/components/app-shell/app-shell.d.ts +220 -0
- package/dist/components/app-shell/app-shell.js +677 -0
- package/dist/components/app-shell/app-shell.js.map +1 -0
- package/dist/components/avatar/avatar.d.ts +162 -0
- package/dist/components/avatar/avatar.js +390 -0
- package/dist/components/avatar/avatar.js.map +1 -0
- package/dist/components/avatar/avatar.styles.d.ts +9 -0
- package/dist/components/avatar/avatar.styles.js +258 -0
- package/dist/components/avatar/avatar.styles.js.map +1 -0
- package/dist/components/badge/badge.d.ts +59 -0
- package/dist/components/badge/badge.js +176 -0
- package/dist/components/badge/badge.js.map +1 -0
- package/dist/components/badge/badge.styles.d.ts +1 -0
- package/dist/components/badge/badge.styles.js +106 -0
- package/dist/components/badge/badge.styles.js.map +1 -0
- package/dist/components/bottom-sheet/bottom-sheet.d.ts +207 -0
- package/dist/components/bottom-sheet/bottom-sheet.js +724 -0
- package/dist/components/bottom-sheet/bottom-sheet.js.map +1 -0
- package/dist/components/bottom-sheet/bottom-sheet.styles.d.ts +1 -0
- package/dist/components/bottom-sheet/bottom-sheet.styles.js +393 -0
- package/dist/components/bottom-sheet/bottom-sheet.styles.js.map +1 -0
- package/dist/components/breadcrumbs/breadcrumbs.d.ts +176 -0
- package/dist/components/breadcrumbs/breadcrumbs.js +638 -0
- package/dist/components/breadcrumbs/breadcrumbs.js.map +1 -0
- package/dist/components/breadcrumbs/breadcrumbs.styles.d.ts +1 -0
- package/dist/components/breadcrumbs/breadcrumbs.styles.js +225 -0
- package/dist/components/breadcrumbs/breadcrumbs.styles.js.map +1 -0
- package/dist/components/button/button.d.ts +280 -0
- package/dist/components/button/button.js +530 -0
- package/dist/components/button/button.js.map +1 -0
- package/dist/components/button/button.styles.d.ts +20 -0
- package/dist/components/button/button.styles.js +328 -0
- package/dist/components/button/button.styles.js.map +1 -0
- package/dist/components/button-group/button-group.d.ts +124 -0
- package/dist/components/button-group/button-group.js +287 -0
- package/dist/components/button-group/button-group.js.map +1 -0
- package/dist/components/button-group/button-group.styles.d.ts +1 -0
- package/dist/components/button-group/button-group.styles.js +220 -0
- package/dist/components/button-group/button-group.styles.js.map +1 -0
- package/dist/components/button-with-menu/button-with-menu.d.ts +224 -0
- package/dist/components/button-with-menu/button-with-menu.js +635 -0
- package/dist/components/button-with-menu/button-with-menu.js.map +1 -0
- package/dist/components/button-with-menu/button-with-menu.styles.d.ts +15 -0
- package/dist/components/button-with-menu/button-with-menu.styles.js +418 -0
- package/dist/components/button-with-menu/button-with-menu.styles.js.map +1 -0
- package/dist/components/calendar/calendar.d.ts +380 -0
- package/dist/components/calendar/calendar.js +1619 -0
- package/dist/components/calendar/calendar.js.map +1 -0
- package/dist/components/calendar/calendar.styles.d.ts +11 -0
- package/dist/components/calendar/calendar.styles.js +412 -0
- package/dist/components/calendar/calendar.styles.js.map +1 -0
- package/dist/components/callout/callout.d.ts +157 -0
- package/dist/components/callout/callout.js +436 -0
- package/dist/components/callout/callout.js.map +1 -0
- package/dist/components/callout/callout.styles.d.ts +13 -0
- package/dist/components/callout/callout.styles.js +383 -0
- package/dist/components/callout/callout.styles.js.map +1 -0
- package/dist/components/card/card.d.ts +108 -0
- package/dist/components/card/card.js +235 -0
- package/dist/components/card/card.js.map +1 -0
- package/dist/components/card/card.styles.d.ts +9 -0
- package/dist/components/card/card.styles.js +170 -0
- package/dist/components/card/card.styles.js.map +1 -0
- package/dist/components/carousel/carousel-geometry.d.ts +178 -0
- package/dist/components/carousel/carousel-geometry.js +356 -0
- package/dist/components/carousel/carousel-geometry.js.map +1 -0
- package/dist/components/carousel/carousel.d.ts +401 -0
- package/dist/components/carousel/carousel.js +1352 -0
- package/dist/components/carousel/carousel.js.map +1 -0
- package/dist/components/carousel/carousel.styles.d.ts +4 -0
- package/dist/components/carousel/carousel.styles.js +475 -0
- package/dist/components/carousel/carousel.styles.js.map +1 -0
- package/dist/components/chat-composer/chat-composer.d.ts +482 -0
- package/dist/components/chat-composer/chat-composer.js +1374 -0
- package/dist/components/chat-composer/chat-composer.js.map +1 -0
- package/dist/components/chat-composer/chat-composer.styles.d.ts +9 -0
- package/dist/components/chat-composer/chat-composer.styles.js +308 -0
- package/dist/components/chat-composer/chat-composer.styles.js.map +1 -0
- package/dist/components/checkbox/checkbox.d.ts +135 -0
- package/dist/components/checkbox/checkbox.js +296 -0
- package/dist/components/checkbox/checkbox.js.map +1 -0
- package/dist/components/checkbox/checkbox.styles.d.ts +13 -0
- package/dist/components/checkbox/checkbox.styles.js +226 -0
- package/dist/components/checkbox/checkbox.styles.js.map +1 -0
- package/dist/components/checkbox-group/checkbox-group.d.ts +199 -0
- package/dist/components/checkbox-group/checkbox-group.js +500 -0
- package/dist/components/checkbox-group/checkbox-group.js.map +1 -0
- package/dist/components/chip/chip.d.ts +176 -0
- package/dist/components/chip/chip.js +376 -0
- package/dist/components/chip/chip.js.map +1 -0
- package/dist/components/chip/chip.styles.d.ts +10 -0
- package/dist/components/chip/chip.styles.js +465 -0
- package/dist/components/chip/chip.styles.js.map +1 -0
- package/dist/components/chip-field/chip-field.d.ts +315 -0
- package/dist/components/chip-field/chip-field.js +887 -0
- package/dist/components/chip-field/chip-field.js.map +1 -0
- package/dist/components/code-block/code-block.before.d.ts +2 -0
- package/dist/components/code-block/code-block.before.js +193 -0
- package/dist/components/code-block/code-block.before.js.map +1 -0
- package/dist/components/code-block/code-block.d.ts +268 -0
- package/dist/components/code-block/code-block.js +1009 -0
- package/dist/components/code-block/code-block.js.map +1 -0
- package/dist/components/code-block/code-block.light.d.ts +50 -0
- package/dist/components/code-block/code-block.light.js +287 -0
- package/dist/components/code-block/code-block.light.js.map +1 -0
- package/dist/components/code-block/code-block.lines.d.ts +49 -0
- package/dist/components/code-block/code-block.lines.js +75 -0
- package/dist/components/code-block/code-block.lines.js.map +1 -0
- package/dist/components/code-block/code-block.styles.d.ts +8 -0
- package/dist/components/code-block/code-block.styles.js +212 -0
- package/dist/components/code-block/code-block.styles.js.map +1 -0
- package/dist/components/color-field/color-field.d.ts +120 -0
- package/dist/components/color-field/color-field.js +182 -0
- package/dist/components/color-field/color-field.js.map +1 -0
- package/dist/components/color-input/color-input.d.ts +302 -0
- package/dist/components/color-input/color-input.js +748 -0
- package/dist/components/color-input/color-input.js.map +1 -0
- package/dist/components/color-input/color-input.styles.d.ts +22 -0
- package/dist/components/color-input/color-input.styles.js +373 -0
- package/dist/components/color-input/color-input.styles.js.map +1 -0
- package/dist/components/color-input/color-text.d.ts +48 -0
- package/dist/components/color-input/color-text.js +77 -0
- package/dist/components/color-input/color-text.js.map +1 -0
- package/dist/components/combobox/combobox.d.ts +387 -0
- package/dist/components/combobox/combobox.js +1108 -0
- package/dist/components/combobox/combobox.js.map +1 -0
- package/dist/components/combobox/combobox.styles.d.ts +26 -0
- package/dist/components/combobox/combobox.styles.js +497 -0
- package/dist/components/combobox/combobox.styles.js.map +1 -0
- package/dist/components/combobox-field/combobox-field.d.ts +159 -0
- package/dist/components/combobox-field/combobox-field.js +280 -0
- package/dist/components/combobox-field/combobox-field.js.map +1 -0
- package/dist/components/copy-button/copy-button.d.ts +112 -0
- package/dist/components/copy-button/copy-button.js +237 -0
- package/dist/components/copy-button/copy-button.js.map +1 -0
- package/dist/components/copy-button/copy-button.styles.d.ts +1 -0
- package/dist/components/copy-button/copy-button.styles.js +62 -0
- package/dist/components/copy-button/copy-button.styles.js.map +1 -0
- package/dist/components/date-time-picker/date-time-picker.d.ts +603 -0
- package/dist/components/date-time-picker/date-time-picker.js +2537 -0
- package/dist/components/date-time-picker/date-time-picker.js.map +1 -0
- package/dist/components/date-time-picker/date-time-picker.styles.d.ts +1 -0
- package/dist/components/date-time-picker/date-time-picker.styles.js +842 -0
- package/dist/components/date-time-picker/date-time-picker.styles.js.map +1 -0
- package/dist/components/description-list/description-list.d.ts +133 -0
- package/dist/components/description-list/description-list.js +395 -0
- package/dist/components/description-list/description-list.js.map +1 -0
- package/dist/components/dialog/dialog.d.ts +140 -0
- package/dist/components/dialog/dialog.js +440 -0
- package/dist/components/dialog/dialog.js.map +1 -0
- package/dist/components/dialog/dialog.styles.d.ts +1 -0
- package/dist/components/dialog/dialog.styles.js +306 -0
- package/dist/components/dialog/dialog.styles.js.map +1 -0
- package/dist/components/divider/divider.d.ts +112 -0
- package/dist/components/divider/divider.js +331 -0
- package/dist/components/divider/divider.js.map +1 -0
- package/dist/components/divider/divider.styles.d.ts +6 -0
- package/dist/components/divider/divider.styles.js +183 -0
- package/dist/components/divider/divider.styles.js.map +1 -0
- package/dist/components/embedded-text-input/embedded-text-input.d.ts +246 -0
- package/dist/components/embedded-text-input/embedded-text-input.js +673 -0
- package/dist/components/embedded-text-input/embedded-text-input.js.map +1 -0
- package/dist/components/embedded-text-input/embedded-text-input.styles.d.ts +1 -0
- package/dist/components/embedded-text-input/embedded-text-input.styles.js +204 -0
- package/dist/components/embedded-text-input/embedded-text-input.styles.js.map +1 -0
- package/dist/components/empty-state/empty-state.d.ts +132 -0
- package/dist/components/empty-state/empty-state.js +333 -0
- package/dist/components/empty-state/empty-state.js.map +1 -0
- package/dist/components/empty-state/empty-state.styles.d.ts +11 -0
- package/dist/components/empty-state/empty-state.styles.js +218 -0
- package/dist/components/empty-state/empty-state.styles.js.map +1 -0
- package/dist/components/fab-menu/fab-menu.d.ts +240 -0
- package/dist/components/fab-menu/fab-menu.js +605 -0
- package/dist/components/fab-menu/fab-menu.js.map +1 -0
- package/dist/components/fab-menu/fab-menu.styles.d.ts +21 -0
- package/dist/components/fab-menu/fab-menu.styles.js +427 -0
- package/dist/components/fab-menu/fab-menu.styles.js.map +1 -0
- package/dist/components/field/field.d.ts +165 -0
- package/dist/components/field/field.js +399 -0
- package/dist/components/field/field.js.map +1 -0
- package/dist/components/field/field.styles.d.ts +2 -0
- package/dist/components/field/field.styles.js +177 -0
- package/dist/components/field/field.styles.js.map +1 -0
- package/dist/components/field-group/field-group.d.ts +122 -0
- package/dist/components/field-group/field-group.js +246 -0
- package/dist/components/field-group/field-group.js.map +1 -0
- package/dist/components/field-group/field-group.styles.d.ts +7 -0
- package/dist/components/field-group/field-group.styles.js +28 -0
- package/dist/components/field-group/field-group.styles.js.map +1 -0
- package/dist/components/figure/figure.d.ts +152 -0
- package/dist/components/figure/figure.js +435 -0
- package/dist/components/figure/figure.js.map +1 -0
- package/dist/components/file-item/file-item.d.ts +232 -0
- package/dist/components/file-item/file-item.js +665 -0
- package/dist/components/file-item/file-item.js.map +1 -0
- package/dist/components/file-item/file-item.styles.d.ts +2 -0
- package/dist/components/file-item/file-item.styles.js +582 -0
- package/dist/components/file-item/file-item.styles.js.map +1 -0
- package/dist/components/file-picker/file-picker.d.ts +221 -0
- package/dist/components/file-picker/file-picker.js +588 -0
- package/dist/components/file-picker/file-picker.js.map +1 -0
- package/dist/components/file-picker/file-picker.styles.d.ts +2 -0
- package/dist/components/file-picker/file-picker.styles.js +303 -0
- package/dist/components/file-picker/file-picker.styles.js.map +1 -0
- package/dist/components/file-upload/file-upload.d.ts +353 -0
- package/dist/components/file-upload/file-upload.js +939 -0
- package/dist/components/file-upload/file-upload.js.map +1 -0
- package/dist/components/file-upload/file-upload.styles.d.ts +1 -0
- package/dist/components/file-upload/file-upload.styles.js +91 -0
- package/dist/components/file-upload/file-upload.styles.js.map +1 -0
- package/dist/components/image-preview/image-preview.d.ts +336 -0
- package/dist/components/image-preview/image-preview.js +1510 -0
- package/dist/components/image-preview/image-preview.js.map +1 -0
- package/dist/components/image-preview/image-preview.styles.d.ts +1 -0
- package/dist/components/image-preview/image-preview.styles.js +418 -0
- package/dist/components/image-preview/image-preview.styles.js.map +1 -0
- package/dist/components/keyboard-shortcut/keyboard-shortcut.d.ts +94 -0
- package/dist/components/keyboard-shortcut/keyboard-shortcut.js +285 -0
- package/dist/components/keyboard-shortcut/keyboard-shortcut.js.map +1 -0
- package/dist/components/keyboard-shortcut/keyboard-shortcut.styles.d.ts +11 -0
- package/dist/components/keyboard-shortcut/keyboard-shortcut.styles.js +155 -0
- package/dist/components/keyboard-shortcut/keyboard-shortcut.styles.js.map +1 -0
- package/dist/components/link-card/link-card.d.ts +156 -0
- package/dist/components/link-card/link-card.js +713 -0
- package/dist/components/link-card/link-card.js.map +1 -0
- package/dist/components/list/list.d.ts +430 -0
- package/dist/components/list/list.js +1230 -0
- package/dist/components/list/list.js.map +1 -0
- package/dist/components/list/list.styles.d.ts +3 -0
- package/dist/components/list/list.styles.js +334 -0
- package/dist/components/list/list.styles.js.map +1 -0
- package/dist/components/loading-indicator/loading-indicator.d.ts +83 -0
- package/dist/components/loading-indicator/loading-indicator.js +195 -0
- package/dist/components/loading-indicator/loading-indicator.js.map +1 -0
- package/dist/components/loading-indicator/loading-indicator.styles.d.ts +6 -0
- package/dist/components/loading-indicator/loading-indicator.styles.js +124 -0
- package/dist/components/loading-indicator/loading-indicator.styles.js.map +1 -0
- package/dist/components/main-action-button/main-action-button.d.ts +95 -0
- package/dist/components/main-action-button/main-action-button.js +202 -0
- package/dist/components/main-action-button/main-action-button.js.map +1 -0
- package/dist/components/main-action-button/main-action-button.styles.d.ts +10 -0
- package/dist/components/main-action-button/main-action-button.styles.js +285 -0
- package/dist/components/main-action-button/main-action-button.styles.js.map +1 -0
- package/dist/components/menu/menu.d.ts +813 -0
- package/dist/components/menu/menu.js +2061 -0
- package/dist/components/menu/menu.js.map +1 -0
- package/dist/components/menu/menu.styles.d.ts +18 -0
- package/dist/components/menu/menu.styles.js +587 -0
- package/dist/components/menu/menu.styles.js.map +1 -0
- package/dist/components/menubar/menubar.d.ts +477 -0
- package/dist/components/menubar/menubar.js +1677 -0
- package/dist/components/menubar/menubar.js.map +1 -0
- package/dist/components/menubar/menubar.styles.d.ts +43 -0
- package/dist/components/menubar/menubar.styles.js +379 -0
- package/dist/components/menubar/menubar.styles.js.map +1 -0
- package/dist/components/navigation-bar/navigation-bar.d.ts +239 -0
- package/dist/components/navigation-bar/navigation-bar.js +544 -0
- package/dist/components/navigation-bar/navigation-bar.js.map +1 -0
- package/dist/components/navigation-bar/navigation-bar.styles.d.ts +21 -0
- package/dist/components/navigation-bar/navigation-bar.styles.js +320 -0
- package/dist/components/navigation-bar/navigation-bar.styles.js.map +1 -0
- package/dist/components/navigation-drawer/navigation-drawer.d.ts +627 -0
- package/dist/components/navigation-drawer/navigation-drawer.js +1917 -0
- package/dist/components/navigation-drawer/navigation-drawer.js.map +1 -0
- package/dist/components/navigation-drawer/navigation-drawer.styles.d.ts +40 -0
- package/dist/components/navigation-drawer/navigation-drawer.styles.js +934 -0
- package/dist/components/navigation-drawer/navigation-drawer.styles.js.map +1 -0
- package/dist/components/number-field/number-field.d.ts +147 -0
- package/dist/components/number-field/number-field.js +252 -0
- package/dist/components/number-field/number-field.js.map +1 -0
- package/dist/components/number-input/number-input.d.ts +347 -0
- package/dist/components/number-input/number-input.js +929 -0
- package/dist/components/number-input/number-input.js.map +1 -0
- package/dist/components/number-input/number-input.styles.d.ts +22 -0
- package/dist/components/number-input/number-input.styles.js +395 -0
- package/dist/components/number-input/number-input.styles.js.map +1 -0
- package/dist/components/number-input/number-text.d.ts +74 -0
- package/dist/components/number-input/number-text.js +230 -0
- package/dist/components/number-input/number-text.js.map +1 -0
- package/dist/components/one-time-code-field/one-time-code-field.d.ts +94 -0
- package/dist/components/one-time-code-field/one-time-code-field.js +135 -0
- package/dist/components/one-time-code-field/one-time-code-field.js.map +1 -0
- package/dist/components/one-time-code-input/code-text.d.ts +51 -0
- package/dist/components/one-time-code-input/code-text.js +145 -0
- package/dist/components/one-time-code-input/code-text.js.map +1 -0
- package/dist/components/one-time-code-input/one-time-code-input.d.ts +219 -0
- package/dist/components/one-time-code-input/one-time-code-input.js +710 -0
- package/dist/components/one-time-code-input/one-time-code-input.js.map +1 -0
- package/dist/components/one-time-code-input/one-time-code-input.styles.d.ts +8 -0
- package/dist/components/one-time-code-input/one-time-code-input.styles.js +323 -0
- package/dist/components/one-time-code-input/one-time-code-input.styles.js.map +1 -0
- package/dist/components/option/option.d.ts +51 -0
- package/dist/components/option/option.js +75 -0
- package/dist/components/option/option.js.map +1 -0
- package/dist/components/page-header/page-header.d.ts +97 -0
- package/dist/components/page-header/page-header.js +258 -0
- package/dist/components/page-header/page-header.js.map +1 -0
- package/dist/components/popover/popover.d.ts +217 -0
- package/dist/components/popover/popover.js +616 -0
- package/dist/components/popover/popover.js.map +1 -0
- package/dist/components/popover/popover.styles.d.ts +8 -0
- package/dist/components/popover/popover.styles.js +299 -0
- package/dist/components/popover/popover.styles.js.map +1 -0
- package/dist/components/progress-indicator/progress-indicator.d.ts +76 -0
- package/dist/components/progress-indicator/progress-indicator.js +165 -0
- package/dist/components/progress-indicator/progress-indicator.js.map +1 -0
- package/dist/components/progress-indicator/progress-indicator.styles.d.ts +7 -0
- package/dist/components/progress-indicator/progress-indicator.styles.js +271 -0
- package/dist/components/progress-indicator/progress-indicator.styles.js.map +1 -0
- package/dist/components/radio-button/radio-button.d.ts +149 -0
- package/dist/components/radio-button/radio-button.js +370 -0
- package/dist/components/radio-button/radio-button.js.map +1 -0
- package/dist/components/radio-button/radio-button.styles.d.ts +8 -0
- package/dist/components/radio-button/radio-button.styles.js +190 -0
- package/dist/components/radio-button/radio-button.styles.js.map +1 -0
- package/dist/components/radio-group/radio-group.d.ts +188 -0
- package/dist/components/radio-group/radio-group.js +380 -0
- package/dist/components/radio-group/radio-group.js.map +1 -0
- package/dist/components/search/search.d.ts +569 -0
- package/dist/components/search/search.js +1801 -0
- package/dist/components/search/search.js.map +1 -0
- package/dist/components/search/search.styles.d.ts +15 -0
- package/dist/components/search/search.styles.js +967 -0
- package/dist/components/search/search.styles.js.map +1 -0
- package/dist/components/segmented-button/segmented-button.d.ts +183 -0
- package/dist/components/segmented-button/segmented-button.js +483 -0
- package/dist/components/segmented-button/segmented-button.js.map +1 -0
- package/dist/components/segmented-button/segmented-button.styles.d.ts +19 -0
- package/dist/components/segmented-button/segmented-button.styles.js +400 -0
- package/dist/components/segmented-button/segmented-button.styles.js.map +1 -0
- package/dist/components/select/select.d.ts +259 -0
- package/dist/components/select/select.js +702 -0
- package/dist/components/select/select.js.map +1 -0
- package/dist/components/select/select.styles.d.ts +27 -0
- package/dist/components/select/select.styles.js +359 -0
- package/dist/components/select/select.styles.js.map +1 -0
- package/dist/components/select-field/select-field.d.ts +141 -0
- package/dist/components/select-field/select-field.js +234 -0
- package/dist/components/select-field/select-field.js.map +1 -0
- package/dist/components/side-sheet/side-sheet.d.ts +190 -0
- package/dist/components/side-sheet/side-sheet.js +592 -0
- package/dist/components/side-sheet/side-sheet.js.map +1 -0
- package/dist/components/side-sheet/side-sheet.styles.d.ts +9 -0
- package/dist/components/side-sheet/side-sheet.styles.js +352 -0
- package/dist/components/side-sheet/side-sheet.styles.js.map +1 -0
- package/dist/components/skeleton/skeleton.d.ts +157 -0
- package/dist/components/skeleton/skeleton.js +550 -0
- package/dist/components/skeleton/skeleton.js.map +1 -0
- package/dist/components/slider/slider.d.ts +235 -0
- package/dist/components/slider/slider.js +792 -0
- package/dist/components/slider/slider.js.map +1 -0
- package/dist/components/slider/slider.styles.d.ts +6 -0
- package/dist/components/slider/slider.styles.js +492 -0
- package/dist/components/slider/slider.styles.js.map +1 -0
- package/dist/components/slider-field/slider-field.d.ts +150 -0
- package/dist/components/slider-field/slider-field.js +269 -0
- package/dist/components/slider-field/slider-field.js.map +1 -0
- package/dist/components/snackbar/snackbar.d.ts +237 -0
- package/dist/components/snackbar/snackbar.js +607 -0
- package/dist/components/snackbar/snackbar.js.map +1 -0
- package/dist/components/snackbar/snackbar.styles.d.ts +10 -0
- package/dist/components/snackbar/snackbar.styles.js +510 -0
- package/dist/components/snackbar/snackbar.styles.js.map +1 -0
- package/dist/components/switch/switch.d.ts +161 -0
- package/dist/components/switch/switch.js +470 -0
- package/dist/components/switch/switch.js.map +1 -0
- package/dist/components/switch/switch.styles.d.ts +3 -0
- package/dist/components/switch/switch.styles.js +440 -0
- package/dist/components/switch/switch.styles.js.map +1 -0
- package/dist/components/tab-view/tab-view.d.ts +303 -0
- package/dist/components/tab-view/tab-view.js +917 -0
- package/dist/components/tab-view/tab-view.js.map +1 -0
- package/dist/components/tab-view/tab-view.styles.d.ts +19 -0
- package/dist/components/tab-view/tab-view.styles.js +85 -0
- package/dist/components/tab-view/tab-view.styles.js.map +1 -0
- package/dist/components/table/table.d.ts +386 -0
- package/dist/components/table/table.js +1320 -0
- package/dist/components/table/table.js.map +1 -0
- package/dist/components/table-of-contents/table-of-contents.d.ts +227 -0
- package/dist/components/table-of-contents/table-of-contents.js +963 -0
- package/dist/components/table-of-contents/table-of-contents.js.map +1 -0
- package/dist/components/table-of-contents/table-of-contents.styles.d.ts +1 -0
- package/dist/components/table-of-contents/table-of-contents.styles.js +243 -0
- package/dist/components/table-of-contents/table-of-contents.styles.js.map +1 -0
- package/dist/components/tabs/tabs.d.ts +800 -0
- package/dist/components/tabs/tabs.js +2183 -0
- package/dist/components/tabs/tabs.js.map +1 -0
- package/dist/components/tabs/tabs.styles.d.ts +47 -0
- package/dist/components/tabs/tabs.styles.js +595 -0
- package/dist/components/tabs/tabs.styles.js.map +1 -0
- package/dist/components/tag/tag.d.ts +77 -0
- package/dist/components/tag/tag.js +143 -0
- package/dist/components/tag/tag.js.map +1 -0
- package/dist/components/tag/tag.styles.d.ts +13 -0
- package/dist/components/tag/tag.styles.js +215 -0
- package/dist/components/tag/tag.styles.js.map +1 -0
- package/dist/components/tag-group/tag-group.d.ts +110 -0
- package/dist/components/tag-group/tag-group.js +298 -0
- package/dist/components/tag-group/tag-group.js.map +1 -0
- package/dist/components/tag-group/tag-group.styles.d.ts +8 -0
- package/dist/components/tag-group/tag-group.styles.js +66 -0
- package/dist/components/tag-group/tag-group.styles.js.map +1 -0
- package/dist/components/text-field/text-field.d.ts +159 -0
- package/dist/components/text-field/text-field.js +272 -0
- package/dist/components/text-field/text-field.js.map +1 -0
- package/dist/components/text-input/text-input-segments.d.ts +93 -0
- package/dist/components/text-input/text-input-segments.js +233 -0
- package/dist/components/text-input/text-input-segments.js.map +1 -0
- package/dist/components/text-input/text-input.d.ts +683 -0
- package/dist/components/text-input/text-input.js +2120 -0
- package/dist/components/text-input/text-input.js.map +1 -0
- package/dist/components/text-input/text-input.styles.d.ts +27 -0
- package/dist/components/text-input/text-input.styles.js +1071 -0
- package/dist/components/text-input/text-input.styles.js.map +1 -0
- package/dist/components/toolbar/toolbar.d.ts +123 -0
- package/dist/components/toolbar/toolbar.js +336 -0
- package/dist/components/toolbar/toolbar.js.map +1 -0
- package/dist/components/toolbar/toolbar.styles.d.ts +10 -0
- package/dist/components/toolbar/toolbar.styles.js +156 -0
- package/dist/components/toolbar/toolbar.styles.js.map +1 -0
- package/dist/components/tooltip/tooltip-placement.d.ts +22 -0
- package/dist/components/tooltip/tooltip-placement.js +15 -0
- package/dist/components/tooltip/tooltip-placement.js.map +1 -0
- package/dist/components/tooltip/tooltip.d.ts +267 -0
- package/dist/components/tooltip/tooltip.js +902 -0
- package/dist/components/tooltip/tooltip.js.map +1 -0
- package/dist/components/tooltip/tooltip.styles.d.ts +7 -0
- package/dist/components/tooltip/tooltip.styles.js +240 -0
- package/dist/components/tooltip/tooltip.styles.js.map +1 -0
- package/dist/components/tree-view/tree-view.d.ts +264 -0
- package/dist/components/tree-view/tree-view.js +1228 -0
- package/dist/components/tree-view/tree-view.js.map +1 -0
- package/dist/description-list.css +337 -0
- package/dist/empty-state.css +70 -0
- package/dist/figure.css +381 -0
- package/dist/generated/icon-sets.d.ts +9 -0
- package/dist/generated/icon-sets.js +18 -0
- package/dist/generated/icon-sets.js.map +1 -0
- package/dist/generated/words.d.ts +161 -0
- package/dist/generated/words.js +91 -0
- package/dist/generated/words.js.map +1 -0
- package/dist/highlight/grammars/css.d.ts +3 -0
- package/dist/highlight/grammars/css.js +56 -0
- package/dist/highlight/grammars/css.js.map +1 -0
- package/dist/highlight/grammars/dart.d.ts +3 -0
- package/dist/highlight/grammars/dart.js +53 -0
- package/dist/highlight/grammars/dart.js.map +1 -0
- package/dist/highlight/grammars/javascript.d.ts +4 -0
- package/dist/highlight/grammars/javascript.js +119 -0
- package/dist/highlight/grammars/javascript.js.map +1 -0
- package/dist/highlight/grammars/json.d.ts +3 -0
- package/dist/highlight/grammars/json.js +19 -0
- package/dist/highlight/grammars/json.js.map +1 -0
- package/dist/highlight/grammars/kotlin.d.ts +3 -0
- package/dist/highlight/grammars/kotlin.js +46 -0
- package/dist/highlight/grammars/kotlin.js.map +1 -0
- package/dist/highlight/grammars/markup.d.ts +3 -0
- package/dist/highlight/grammars/markup.js +45 -0
- package/dist/highlight/grammars/markup.js.map +1 -0
- package/dist/highlight/grammars/shared.d.ts +25 -0
- package/dist/highlight/grammars/shared.js +37 -0
- package/dist/highlight/grammars/shared.js.map +1 -0
- package/dist/highlight/grammars/shell.d.ts +3 -0
- package/dist/highlight/grammars/shell.js +48 -0
- package/dist/highlight/grammars/shell.js.map +1 -0
- package/dist/highlight/grammars/swift.d.ts +3 -0
- package/dist/highlight/grammars/swift.js +46 -0
- package/dist/highlight/grammars/swift.js.map +1 -0
- package/dist/highlight/grammars/typescript.d.ts +2 -0
- package/dist/highlight/grammars/typescript.js +5 -0
- package/dist/highlight/grammars/typescript.js.map +1 -0
- package/dist/highlight/index.d.ts +104 -0
- package/dist/highlight/index.js +331 -0
- package/dist/highlight/index.js.map +1 -0
- package/dist/icons.css +107 -0
- package/dist/icons.d.ts +2 -0
- package/dist/icons.js +10 -0
- package/dist/icons.js.map +1 -0
- package/dist/index.d.ts +85 -0
- package/dist/index.js +100 -0
- package/dist/index.js.map +1 -0
- package/dist/link-card.css +678 -0
- package/dist/link.css +728 -0
- package/dist/link.d.ts +21 -0
- package/dist/link.js +594 -0
- package/dist/link.js.map +1 -0
- package/dist/links/index.d.ts +136 -0
- package/dist/links/index.js +404 -0
- package/dist/links/index.js.map +1 -0
- package/dist/links/node/address.js +154 -0
- package/dist/links/node/cli.js +102 -0
- package/dist/links/node/fetcher.js +267 -0
- package/dist/links/node/head.js +278 -0
- package/dist/links/node/index.d.ts +164 -0
- package/dist/links/node/index.js +26 -0
- package/dist/links/node/links.js +275 -0
- package/dist/links/node/lock.js +86 -0
- package/dist/links/node/mark.js +71 -0
- package/dist/links/node/options.js +120 -0
- package/dist/links/node/pictures.js +265 -0
- package/dist/links/node/refresh.js +28 -0
- package/dist/menu.css +97 -0
- package/dist/menubar.css +69 -0
- package/dist/page-header.css +324 -0
- package/dist/pagination.css +410 -0
- package/dist/pagination.d.ts +6 -0
- package/dist/pagination.js +256 -0
- package/dist/pagination.js.map +1 -0
- package/dist/primitives/actions.d.ts +75 -0
- package/dist/primitives/actions.js +142 -0
- package/dist/primitives/actions.js.map +1 -0
- package/dist/primitives/after-click.d.ts +8 -0
- package/dist/primitives/after-click.js +21 -0
- package/dist/primitives/after-click.js.map +1 -0
- package/dist/primitives/anchored.d.ts +134 -0
- package/dist/primitives/anchored.js +425 -0
- package/dist/primitives/anchored.js.map +1 -0
- package/dist/primitives/arc.d.ts +13 -0
- package/dist/primitives/arc.js +49 -0
- package/dist/primitives/arc.js.map +1 -0
- package/dist/primitives/arrow.d.ts +47 -0
- package/dist/primitives/arrow.js +159 -0
- package/dist/primitives/arrow.js.map +1 -0
- package/dist/primitives/auto-height.d.ts +56 -0
- package/dist/primitives/auto-height.js +150 -0
- package/dist/primitives/auto-height.js.map +1 -0
- package/dist/primitives/autofocus.d.ts +11 -0
- package/dist/primitives/autofocus.js +26 -0
- package/dist/primitives/autofocus.js.map +1 -0
- package/dist/primitives/availability.d.ts +32 -0
- package/dist/primitives/availability.js +122 -0
- package/dist/primitives/availability.js.map +1 -0
- package/dist/primitives/axes.d.ts +45 -0
- package/dist/primitives/axes.js +72 -0
- package/dist/primitives/axes.js.map +1 -0
- package/dist/primitives/behavior.d.ts +14 -0
- package/dist/primitives/behavior.js +19 -0
- package/dist/primitives/behavior.js.map +1 -0
- package/dist/primitives/calendar-date.d.ts +79 -0
- package/dist/primitives/calendar-date.js +135 -0
- package/dist/primitives/calendar-date.js.map +1 -0
- package/dist/primitives/composed.d.ts +144 -0
- package/dist/primitives/composed.js +303 -0
- package/dist/primitives/composed.js.map +1 -0
- package/dist/primitives/default-button.d.ts +49 -0
- package/dist/primitives/default-button.js +270 -0
- package/dist/primitives/default-button.js.map +1 -0
- package/dist/primitives/description.d.ts +18 -0
- package/dist/primitives/description.js +18 -0
- package/dist/primitives/description.js.map +1 -0
- package/dist/primitives/destination.d.ts +259 -0
- package/dist/primitives/destination.js +651 -0
- package/dist/primitives/destination.js.map +1 -0
- package/dist/primitives/direction.d.ts +23 -0
- package/dist/primitives/direction.js +90 -0
- package/dist/primitives/direction.js.map +1 -0
- package/dist/primitives/disabled-while-focused.d.ts +46 -0
- package/dist/primitives/disabled-while-focused.js +126 -0
- package/dist/primitives/disabled-while-focused.js.map +1 -0
- package/dist/primitives/disclosure.d.ts +9 -0
- package/dist/primitives/disclosure.js +15 -0
- package/dist/primitives/disclosure.js.map +1 -0
- package/dist/primitives/dismiss.d.ts +88 -0
- package/dist/primitives/dismiss.js +232 -0
- package/dist/primitives/dismiss.js.map +1 -0
- package/dist/primitives/field-frame.d.ts +166 -0
- package/dist/primitives/field-frame.js +358 -0
- package/dist/primitives/field-frame.js.map +1 -0
- package/dist/primitives/field-group-frame.d.ts +59 -0
- package/dist/primitives/field-group-frame.js +174 -0
- package/dist/primitives/field-group-frame.js.map +1 -0
- package/dist/primitives/field-trigger.d.ts +117 -0
- package/dist/primitives/field-trigger.js +387 -0
- package/dist/primitives/field-trigger.js.map +1 -0
- package/dist/primitives/field.d.ts +186 -0
- package/dist/primitives/field.js +349 -0
- package/dist/primitives/field.js.map +1 -0
- package/dist/primitives/file-format.d.ts +23 -0
- package/dist/primitives/file-format.js +185 -0
- package/dist/primitives/file-format.js.map +1 -0
- package/dist/primitives/file-item-holder.d.ts +45 -0
- package/dist/primitives/file-item-holder.js +39 -0
- package/dist/primitives/file-item-holder.js.map +1 -0
- package/dist/primitives/focus-order.d.ts +11 -0
- package/dist/primitives/focus-order.js +11 -0
- package/dist/primitives/focus-order.js.map +1 -0
- package/dist/primitives/focus-ring.d.ts +76 -0
- package/dist/primitives/focus-ring.js +230 -0
- package/dist/primitives/focus-ring.js.map +1 -0
- package/dist/primitives/follow.d.ts +65 -0
- package/dist/primitives/follow.js +283 -0
- package/dist/primitives/follow.js.map +1 -0
- package/dist/primitives/form-disabled.d.ts +20 -0
- package/dist/primitives/form-disabled.js +46 -0
- package/dist/primitives/form-disabled.js.map +1 -0
- package/dist/primitives/form-says.d.ts +33 -0
- package/dist/primitives/form-says.js +45 -0
- package/dist/primitives/form-says.js.map +1 -0
- package/dist/primitives/forward.d.ts +13 -0
- package/dist/primitives/forward.js +28 -0
- package/dist/primitives/forward.js.map +1 -0
- package/dist/primitives/glyph-mirror.d.ts +77 -0
- package/dist/primitives/glyph-mirror.js +211 -0
- package/dist/primitives/glyph-mirror.js.map +1 -0
- package/dist/primitives/glyph-pending.d.ts +17 -0
- package/dist/primitives/glyph-pending.js +91 -0
- package/dist/primitives/glyph-pending.js.map +1 -0
- package/dist/primitives/glyph.d.ts +53 -0
- package/dist/primitives/glyph.js +161 -0
- package/dist/primitives/glyph.js.map +1 -0
- package/dist/primitives/group-item.d.ts +128 -0
- package/dist/primitives/group-item.js +334 -0
- package/dist/primitives/group-item.js.map +1 -0
- package/dist/primitives/hidden.d.ts +2 -0
- package/dist/primitives/hidden.js +23 -0
- package/dist/primitives/hidden.js.map +1 -0
- package/dist/primitives/host-aria.d.ts +8 -0
- package/dist/primitives/host-aria.js +18 -0
- package/dist/primitives/host-aria.js.map +1 -0
- package/dist/primitives/index.d.ts +59 -0
- package/dist/primitives/index.js +189 -0
- package/dist/primitives/index.js.map +1 -0
- package/dist/primitives/indicator-drag.d.ts +90 -0
- package/dist/primitives/indicator-drag.js +207 -0
- package/dist/primitives/indicator-drag.js.map +1 -0
- package/dist/primitives/interactive.d.ts +13 -0
- package/dist/primitives/interactive.js +67 -0
- package/dist/primitives/interactive.js.map +1 -0
- package/dist/primitives/item-row.d.ts +34 -0
- package/dist/primitives/item-row.js +76 -0
- package/dist/primitives/item-row.js.map +1 -0
- package/dist/primitives/item-update.d.ts +2 -0
- package/dist/primitives/item-update.js +12 -0
- package/dist/primitives/item-update.js.map +1 -0
- package/dist/primitives/kept-length.d.ts +34 -0
- package/dist/primitives/kept-length.js +154 -0
- package/dist/primitives/kept-length.js.map +1 -0
- package/dist/primitives/keyboard-convention.d.ts +30 -0
- package/dist/primitives/keyboard-convention.js +88 -0
- package/dist/primitives/keyboard-convention.js.map +1 -0
- package/dist/primitives/label-lines.d.ts +12 -0
- package/dist/primitives/label-lines.js +34 -0
- package/dist/primitives/label-lines.js.map +1 -0
- package/dist/primitives/layout-scale.d.ts +18 -0
- package/dist/primitives/layout-scale.js +35 -0
- package/dist/primitives/layout-scale.js.map +1 -0
- package/dist/primitives/link.d.ts +147 -0
- package/dist/primitives/link.js +204 -0
- package/dist/primitives/link.js.map +1 -0
- package/dist/primitives/locale-date.d.ts +132 -0
- package/dist/primitives/locale-date.js +508 -0
- package/dist/primitives/locale-date.js.map +1 -0
- package/dist/primitives/missing-value.d.ts +16 -0
- package/dist/primitives/missing-value.js +31 -0
- package/dist/primitives/missing-value.js.map +1 -0
- package/dist/primitives/modal.d.ts +38 -0
- package/dist/primitives/modal.js +175 -0
- package/dist/primitives/modal.js.map +1 -0
- package/dist/primitives/native-text.d.ts +51 -0
- package/dist/primitives/native-text.js +77 -0
- package/dist/primitives/native-text.js.map +1 -0
- package/dist/primitives/natural-height.d.ts +21 -0
- package/dist/primitives/natural-height.js +36 -0
- package/dist/primitives/natural-height.js.map +1 -0
- package/dist/primitives/option-list.d.ts +314 -0
- package/dist/primitives/option-list.js +1098 -0
- package/dist/primitives/option-list.js.map +1 -0
- package/dist/primitives/overlay-focus.d.ts +48 -0
- package/dist/primitives/overlay-focus.js +152 -0
- package/dist/primitives/overlay-focus.js.map +1 -0
- package/dist/primitives/placement.d.ts +131 -0
- package/dist/primitives/placement.js +144 -0
- package/dist/primitives/placement.js.map +1 -0
- package/dist/primitives/places.d.ts +44 -0
- package/dist/primitives/places.js +98 -0
- package/dist/primitives/places.js.map +1 -0
- package/dist/primitives/press.d.ts +90 -0
- package/dist/primitives/press.js +153 -0
- package/dist/primitives/press.js.map +1 -0
- package/dist/primitives/report.d.ts +17 -0
- package/dist/primitives/report.js +34 -0
- package/dist/primitives/report.js.map +1 -0
- package/dist/primitives/ripple.d.ts +40 -0
- package/dist/primitives/ripple.js +70 -0
- package/dist/primitives/ripple.js.map +1 -0
- package/dist/primitives/roving.d.ts +41 -0
- package/dist/primitives/roving.js +71 -0
- package/dist/primitives/roving.js.map +1 -0
- package/dist/primitives/selection.d.ts +134 -0
- package/dist/primitives/selection.js +287 -0
- package/dist/primitives/selection.js.map +1 -0
- package/dist/primitives/separation.d.ts +28 -0
- package/dist/primitives/separation.js +96 -0
- package/dist/primitives/separation.js.map +1 -0
- package/dist/primitives/shared-choice.d.ts +33 -0
- package/dist/primitives/shared-choice.js +110 -0
- package/dist/primitives/shared-choice.js.map +1 -0
- package/dist/primitives/sheet.d.ts +63 -0
- package/dist/primitives/sheet.js +139 -0
- package/dist/primitives/sheet.js.map +1 -0
- package/dist/primitives/sheets.d.ts +8 -0
- package/dist/primitives/sheets.js +96 -0
- package/dist/primitives/sheets.js.map +1 -0
- package/dist/primitives/states.d.ts +33 -0
- package/dist/primitives/states.js +30 -0
- package/dist/primitives/states.js.map +1 -0
- package/dist/primitives/system-watch.d.ts +9 -0
- package/dist/primitives/system-watch.js +29 -0
- package/dist/primitives/system-watch.js.map +1 -0
- package/dist/primitives/target.d.ts +21 -0
- package/dist/primitives/target.js +79 -0
- package/dist/primitives/target.js.map +1 -0
- package/dist/primitives/values.d.ts +6 -0
- package/dist/primitives/values.js +22 -0
- package/dist/primitives/values.js.map +1 -0
- package/dist/primitives/visibility.d.ts +12 -0
- package/dist/primitives/visibility.js +50 -0
- package/dist/primitives/visibility.js.map +1 -0
- package/dist/primitives/words.d.ts +81 -0
- package/dist/primitives/words.js +236 -0
- package/dist/primitives/words.js.map +1 -0
- package/dist/prose.css +1917 -0
- package/dist/registry.d.ts +182 -0
- package/dist/registry.js +2 -0
- package/dist/registry.js.map +1 -0
- package/dist/shape.css +21 -0
- package/dist/skeleton.css +428 -0
- package/dist/steps.css +231 -0
- package/dist/steps.d.ts +6 -0
- package/dist/steps.js +156 -0
- package/dist/steps.js.map +1 -0
- package/dist/styles/icons.d.ts +62 -0
- package/dist/styles/icons.js +237 -0
- package/dist/styles/icons.js.map +1 -0
- package/dist/styles/product-text.d.ts +66 -0
- package/dist/styles/product-text.js +114 -0
- package/dist/styles/product-text.js.map +1 -0
- package/dist/styles/registered-properties.d.ts +6 -0
- package/dist/styles/registered-properties.js +68 -0
- package/dist/styles/registered-properties.js.map +1 -0
- package/dist/styles/shape.d.ts +59 -0
- package/dist/styles/shape.js +95 -0
- package/dist/styles/shape.js.map +1 -0
- package/dist/systems/cupertino.css +8793 -0
- package/dist/systems/m3-expressive-like.css +8786 -0
- package/dist/systems/m3-like.css +8748 -0
- package/dist/table-of-contents.css +482 -0
- package/dist/table.css +902 -0
- package/dist/tanrei.bundle.js +26644 -0
- package/dist/tanrei.bundle.js.map +7 -0
- package/dist/text.css +104 -0
- package/dist/timeline.css +410 -0
- package/dist/timeline.d.ts +6 -0
- package/dist/timeline.js +176 -0
- package/dist/timeline.js.map +1 -0
- package/dist/tokens.css +8801 -0
- package/dist/tree-view.css +797 -0
- package/dist/words.d.ts +2 -0
- package/dist/words.js +6 -0
- package/dist/words.js.map +1 -0
- package/package.json +132 -3
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
// How a one-time-code input reads text and edits its value (specs/one-time-code-input.spec.json). Nothing here touches
|
|
2
|
+
// an element: the element (one-time-code-input.ts) hears the native input and asks these functions what the value and
|
|
3
|
+
// the active cell become. The value is always ASCII, in upper case, at most `length` characters, without a gap.
|
|
4
|
+
const DECIMAL_DIGIT = /^\p{Nd}$/u;
|
|
5
|
+
/** White space, and the hyphen and dash characters a code is written with ("123 456", "123-456", "123–456"): OTC-11. */
|
|
6
|
+
const SEPARATORS = /[\s\p{Pd}−]/gu;
|
|
7
|
+
/**
|
|
8
|
+
* The value of a decimal digit of any script. Unicode encodes every script's digits as a run of ten in ascending order,
|
|
9
|
+
* and several runs may stand side by side (the mathematical digits), so the digit is its place in its run, modulo ten.
|
|
10
|
+
*/
|
|
11
|
+
function digitValue(char) {
|
|
12
|
+
const point = char.codePointAt(0);
|
|
13
|
+
let start = point;
|
|
14
|
+
while (start > 0 && DECIMAL_DIGIT.test(String.fromCodePoint(start - 1)))
|
|
15
|
+
start--;
|
|
16
|
+
return (point - start) % 10;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* OTC-4: one character as the field reads it — a decimal digit of any script and a full-width digit or letter as its
|
|
20
|
+
* ASCII form, a lower-case letter as its upper-case form — or `null` where the type does not permit it.
|
|
21
|
+
*/
|
|
22
|
+
export function readCharacter(char, type) {
|
|
23
|
+
if (DECIMAL_DIGIT.test(char))
|
|
24
|
+
return String(digitValue(char));
|
|
25
|
+
if (type !== 'alphanumeric')
|
|
26
|
+
return null;
|
|
27
|
+
const point = char.codePointAt(0);
|
|
28
|
+
// Full-width Latin letters (U+FF21 … U+FF3A, U+FF41 … U+FF5A) are read as the ASCII ones.
|
|
29
|
+
const ascii = point >= 0xff21 && point <= 0xff3a ? point - 0xff21 + 0x41 : point >= 0xff41 && point <= 0xff5a ? point - 0xff41 + 0x61 : point;
|
|
30
|
+
if (ascii >= 0x41 && ascii <= 0x5a)
|
|
31
|
+
return String.fromCharCode(ascii);
|
|
32
|
+
if (ascii >= 0x61 && ascii <= 0x7a)
|
|
33
|
+
return String.fromCharCode(ascii - 0x20);
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
/** The permitted characters of `text`, each read by OTC-4, in order; what is not permitted is dropped. */
|
|
37
|
+
export function readPermitted(text, type) {
|
|
38
|
+
let out = '';
|
|
39
|
+
for (const char of text)
|
|
40
|
+
out += readCharacter(char, type) ?? '';
|
|
41
|
+
return out;
|
|
42
|
+
}
|
|
43
|
+
/** OTC-18, OTC-19: a value the product set as the field holds it, and whether anything of it was dropped. */
|
|
44
|
+
export function readValue(text, length, type) {
|
|
45
|
+
const permitted = readPermitted(text, type);
|
|
46
|
+
const value = permitted.slice(0, length);
|
|
47
|
+
return { value, dropped: value !== text };
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* OTC-11: a whole text — pasted, dropped, dictated or given by autofill — read as one code, or `null` where it holds
|
|
51
|
+
* none. White space, hyphens and dashes go; if every remaining character is permitted (and there is one) the code is
|
|
52
|
+
* the first `length` of them. Otherwise, for digits only, the text is searched: exactly one run of exactly `length`
|
|
53
|
+
* digits that no other digit adjoins is the code ("Your code is 123456."). Anything else is no code.
|
|
54
|
+
*/
|
|
55
|
+
export function readCode(text, length, type) {
|
|
56
|
+
const bare = text.replace(SEPARATORS, '');
|
|
57
|
+
let whole = '';
|
|
58
|
+
let every = bare !== '';
|
|
59
|
+
for (const char of bare) {
|
|
60
|
+
const read = readCharacter(char, type);
|
|
61
|
+
if (read === null) {
|
|
62
|
+
every = false;
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
whole += read;
|
|
66
|
+
}
|
|
67
|
+
if (every)
|
|
68
|
+
return whole.slice(0, length);
|
|
69
|
+
if (type !== 'numeric')
|
|
70
|
+
return null;
|
|
71
|
+
const runs = [];
|
|
72
|
+
let run = '';
|
|
73
|
+
for (const char of text) {
|
|
74
|
+
if (DECIMAL_DIGIT.test(char))
|
|
75
|
+
run += digitValue(char);
|
|
76
|
+
else {
|
|
77
|
+
if (run)
|
|
78
|
+
runs.push(run);
|
|
79
|
+
run = '';
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
if (run)
|
|
83
|
+
runs.push(run);
|
|
84
|
+
const exact = runs.filter((digits) => digits.length === length);
|
|
85
|
+
return exact.length === 1 ? exact[0] : null;
|
|
86
|
+
}
|
|
87
|
+
/** OTC-5: the furthest cell that can be active — the first empty cell, or the last cell while all are filled. */
|
|
88
|
+
export const furthest = (value, length) => Math.min(value.length, Math.max(0, length - 1));
|
|
89
|
+
/** The state with its active cell brought inside what the value allows. */
|
|
90
|
+
export const settle = (state, length) => ({
|
|
91
|
+
value: state.value,
|
|
92
|
+
active: Math.max(0, Math.min(state.active, furthest(state.value, length))),
|
|
93
|
+
all: state.all && state.value !== '',
|
|
94
|
+
});
|
|
95
|
+
/**
|
|
96
|
+
* OTC-6, OTC-10: one permitted character typed — it stands in the active cell, in place of what the cell holds, and the
|
|
97
|
+
* active cell moves on (it stays on the last); typed over a selected value it replaces the whole value.
|
|
98
|
+
*/
|
|
99
|
+
export function typeCharacter(state, char, length) {
|
|
100
|
+
if (state.all)
|
|
101
|
+
return { value: char, active: furthest(char, length), all: false };
|
|
102
|
+
const at = Math.min(state.active, state.value.length, length - 1);
|
|
103
|
+
const value = (state.value.slice(0, at) + char + state.value.slice(at + 1)).slice(0, length);
|
|
104
|
+
return { value, active: Math.min(at + 1, furthest(value, length)), all: false };
|
|
105
|
+
}
|
|
106
|
+
/** Characters typed one after another (OTC-6: text an input method commits is read character by character). */
|
|
107
|
+
export function typeText(state, text, length) {
|
|
108
|
+
let next = state;
|
|
109
|
+
for (const char of text)
|
|
110
|
+
next = typeCharacter(next, char, length);
|
|
111
|
+
return next;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* OTC-9, OTC-10: Backspace — a filled active cell loses its character and stays active; an empty one loses the
|
|
115
|
+
* character before it and the active cell moves there; a selected value is emptied. The rest closes the gap.
|
|
116
|
+
*/
|
|
117
|
+
export function removeBackward(state, length) {
|
|
118
|
+
if (state.all)
|
|
119
|
+
return { value: '', active: 0, all: false };
|
|
120
|
+
const { value, active } = settle(state, length);
|
|
121
|
+
if (active < value.length)
|
|
122
|
+
return { value: value.slice(0, active) + value.slice(active + 1), active, all: false };
|
|
123
|
+
if (active === 0)
|
|
124
|
+
return { value, active, all: false };
|
|
125
|
+
return { value: value.slice(0, active - 1), active: active - 1, all: false };
|
|
126
|
+
}
|
|
127
|
+
/** OTC-9, OTC-10: Delete — the active cell loses its character; a selected value is emptied. */
|
|
128
|
+
export function removeForward(state, length) {
|
|
129
|
+
if (state.all)
|
|
130
|
+
return { value: '', active: 0, all: false };
|
|
131
|
+
const { value, active } = settle(state, length);
|
|
132
|
+
return { value: value.slice(0, active) + value.slice(active + 1), active, all: false };
|
|
133
|
+
}
|
|
134
|
+
/** The platform's removal of a word or a line: everything before the active cell, or everything from it on. */
|
|
135
|
+
export function removeRun(state, direction, length) {
|
|
136
|
+
if (state.all)
|
|
137
|
+
return { value: '', active: 0, all: false };
|
|
138
|
+
const { value, active } = settle(state, length);
|
|
139
|
+
// A filled active cell is part of what is removed, as Backspace removes it (OTC-9).
|
|
140
|
+
const value_ = direction === 'backward' ? value.slice(Math.min(active + 1, value.length)) : value.slice(0, active);
|
|
141
|
+
return { value: value_, active: direction === 'backward' ? 0 : furthest(value_, length), all: false };
|
|
142
|
+
}
|
|
143
|
+
/** OTC-11, OTC-18: a whole value taken at once; the active cell is the first empty cell, or the last. */
|
|
144
|
+
export const replaceAll = (value, length) => ({ value, active: furthest(value, length), all: false });
|
|
145
|
+
//# sourceMappingURL=code-text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-text.js","sourceRoot":"","sources":["../../../src/components/one-time-code-input/code-text.ts"],"names":[],"mappings":"AAAA,uHAAuH;AACvH,sHAAsH;AACtH,gHAAgH;AAchH,MAAM,aAAa,GAAG,WAAW,CAAC;AAClC,wHAAwH;AACxH,MAAM,UAAU,GAAG,eAAe,CAAC;AAEnC;;;GAGG;AACH,SAAS,UAAU,CAAC,IAAY;IAC9B,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAE,CAAC;IACnC,IAAI,KAAK,GAAG,KAAK,CAAC;IAClB,OAAO,KAAK,GAAG,CAAC,IAAI,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;QAAE,KAAK,EAAE,CAAC;IACjF,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC;AAC9B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,IAAY,EAAE,IAAc;IACxD,IAAI,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9D,IAAI,IAAI,KAAK,cAAc;QAAE,OAAO,IAAI,CAAC;IACzC,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAE,CAAC;IACnC,0FAA0F;IAC1F,MAAM,KAAK,GAAG,KAAK,IAAI,MAAM,IAAI,KAAK,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,MAAM,IAAI,KAAK,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,MAAM,GAAG,IAAI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AAK,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;AACzF,CAAC;AAED,+GAA+G;AAC/G,MAAM,UAAU,SAAS,CAAC,KAAgB,EAAE,SAAiC,EAAE,MAAc;IAC3F,IAAI,KAAK,CAAC,GAAG;QAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;IAC3D,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAChD,oFAAoF;IACpF,MAAM,MAAM,GAAG,SAAS,KAAK,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACnH,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;AACxG,CAAC;AAED,yGAAyG;AACzG,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAa,EAAE,MAAc,EAAa,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { LitElement, type PropertyDeclarations, type PropertyValues } from 'lit';
|
|
2
|
+
import { type CodeType } from './code-text.js';
|
|
3
|
+
/** What a cell takes: the digits 0 to 9, or those and the letters A to Z, held in upper case. */
|
|
4
|
+
export type TanreiOneTimeCodeInputType = CodeType;
|
|
5
|
+
/** What `input`, `change`, `complete` and `action` carry: the code as it is now. */
|
|
6
|
+
export interface TanreiOneTimeCodeInputDetail {
|
|
7
|
+
value: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Takes a short code sent to the person — a sign-in or verification code — as one text value drawn in separate cells,
|
|
11
|
+
* so that its length and what is still missing can be seen, and the browser can fill it in one step.
|
|
12
|
+
*
|
|
13
|
+
* Contract: specs/one-time-code-input.spec.json. Every visual value is a `--tanrei-comp-one-time-code-input-*` token.
|
|
14
|
+
*
|
|
15
|
+
* One field, not one input per character: in the shadow root there is exactly one native `<input>`, laid over the row,
|
|
16
|
+
* whose own text and caret are not drawn; the cells, the caret and the group marks under it are a drawing of its value
|
|
17
|
+
* and are hidden from assistive technology. So it is one Tab stop and one text box whose value is the whole code, and
|
|
18
|
+
* an input method, the browser's autofill (`autocomplete="one-time-code"`), the clipboard and dictation meet one text
|
|
19
|
+
* input. It has no `maxlength` and no `pattern`: a code pasted as "123 456" would be cut before it could be read.
|
|
20
|
+
*
|
|
21
|
+
* It has no label, help or error text of its own: put it in a `<tanrei-field>`, which names it, describes it, marks it
|
|
22
|
+
* required and puts it in its error condition; where the visible label is elsewhere (a dialog's headline), give
|
|
23
|
+
* `label`, which is never drawn. `<tanrei-field label="Verification code"><tanrei-one-time-code-input name="code"
|
|
24
|
+
* group-size="3"></tanrei-one-time-code-input></tanrei-field>`.
|
|
25
|
+
*
|
|
26
|
+
* A permitted character fills the active cell — replacing what it holds — and moves on; other characters are dropped.
|
|
27
|
+
* Text that is pasted, dropped or filled is read whole as one code ("123 456", "123-456", "Your code is 123456.").
|
|
28
|
+
* `input` fires on every change by the person, `complete` once after the `input` that leaves the value `length` long,
|
|
29
|
+
* `change` when a changed value is committed (focus leaves, or Enter), `action` on Enter. Nothing else happens when the
|
|
30
|
+
* code is complete: checking it is the product's.
|
|
31
|
+
*
|
|
32
|
+
* Form-associated: it submits the code under `name`, resets to its `value` attribute, is restored on navigation,
|
|
33
|
+
* follows a disabled `<fieldset>`, and reports a missing value while its Field says it is required and it is empty.
|
|
34
|
+
*
|
|
35
|
+
* @tag tanrei-one-time-code-input
|
|
36
|
+
* @csspart input - The one native text element, laid over the row. Its text is not drawn.
|
|
37
|
+
* @csspart cell - One box per character of the code.
|
|
38
|
+
* @csspart character - The character a filled cell holds, or the mark in its place while `mask` is set.
|
|
39
|
+
* @csspart caret - The caret of an empty active cell.
|
|
40
|
+
* @csspart separator - The mark between two groups of cells.
|
|
41
|
+
* @attr {string} form - The id of the form the one-time-code input belongs to, where it stands outside it: the platform's own attribute, which then wins over a form around it. The `form` property is read-only and returns the form element.
|
|
42
|
+
* @fires {CustomEvent<TanreiOneTimeCodeInputDetail>} input - The person changed the value; the element's `value` is already the new one.
|
|
43
|
+
* @fires {CustomEvent<TanreiOneTimeCodeInputDetail>} change - The person committed a changed value: focus left the field, or Enter was pressed.
|
|
44
|
+
* @fires {CustomEvent<TanreiOneTimeCodeInputDetail>} complete - A change by the person left the value `length` characters long. After that change's input, once.
|
|
45
|
+
* @fires {CustomEvent<TanreiOneTimeCodeInputDetail>} action - The person pressed Enter. Cancel it to keep the enclosing form from being submitted.
|
|
46
|
+
*/
|
|
47
|
+
export declare class TanreiOneTimeCodeInput extends LitElement {
|
|
48
|
+
private readonly availability;
|
|
49
|
+
static styles: import("lit").CSSResult;
|
|
50
|
+
static formAssociated: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Its documented parts, once: what an element composed around it exports (src/primitives/composed.ts). Held equal to
|
|
53
|
+
* the `@csspart` lines above by src/primitives/composed.test.ts.
|
|
54
|
+
*
|
|
55
|
+
* @internal
|
|
56
|
+
*/
|
|
57
|
+
static readonly parts: readonly string[];
|
|
58
|
+
static shadowRootOptions: ShadowRootInit;
|
|
59
|
+
static properties: PropertyDeclarations;
|
|
60
|
+
/** The code entered so far: at most `length` characters, digits or — for `alphanumeric` — digits and upper-case letters, with no separator. The `value` attribute is what a form reset returns to. */
|
|
61
|
+
value: string;
|
|
62
|
+
/** How many characters the code has, and so how many cells are drawn. A whole number of 1 or more; anything else draws 6. */
|
|
63
|
+
length: number;
|
|
64
|
+
/** What a cell takes: `numeric` (the default; a numeric keypad) or `alphanumeric` (digits and A to Z, held in upper case; a general keyboard). Anything else behaves as numeric. */
|
|
65
|
+
type: TanreiOneTimeCodeInputType;
|
|
66
|
+
/** Draws the cells in groups of this many, with a mark between two groups (`group-size`; 3 for a code written "123 456"). 0 draws one group. The value has no separator. */
|
|
67
|
+
groupSize: number;
|
|
68
|
+
/** Draws the browser's password mark in each filled cell in place of its character, and exposes the field as a password field. Paste and autofill still work. */
|
|
69
|
+
mask: boolean;
|
|
70
|
+
/** Names the field for assistive technology where no Field frames it. Never drawn. Inside a Field leave it empty: the Field names it. */
|
|
71
|
+
label: string;
|
|
72
|
+
/** Draws every cell in the error condition and exposes the field as invalid. A Field sets this from its own error; set it here only where no Field frames the control. */
|
|
73
|
+
error: boolean;
|
|
74
|
+
/** Prevents entry and takes the field out of the focus order. Inside a Field, disable the Field, so that its label follows. */
|
|
75
|
+
disabled: boolean;
|
|
76
|
+
/** Keeps the field focusable and its value readable, and lets nothing change it (`readonly`): for the moment a complete code is being checked. */
|
|
77
|
+
readOnly: boolean;
|
|
78
|
+
/** Web only: the name the code is submitted under. */
|
|
79
|
+
name: string;
|
|
80
|
+
/** OTC-7: the native input has focus, however it was gained. */
|
|
81
|
+
private focused;
|
|
82
|
+
/** OTC-5, OTC-10: the active cell and whether the whole value is selected. Its `value` follows the element's. */
|
|
83
|
+
private state;
|
|
84
|
+
/** OTC-6: the text an input method is composing, as the method gave it; empty while none is. */
|
|
85
|
+
private composingText;
|
|
86
|
+
/** Set by an ancestor `<fieldset disabled>`. */
|
|
87
|
+
private formDisabled;
|
|
88
|
+
private readonly internals;
|
|
89
|
+
/** What it tells its form, said where an element composed around it hears it (src/primitives/form-says.ts). */
|
|
90
|
+
private readonly says;
|
|
91
|
+
/**
|
|
92
|
+
* What a Field around it gives it (src/primitives/field.ts): the name while it has no `label` of its own, the
|
|
93
|
+
* description, the invalid, required and disabled states (OTC-17, OTC-20, OTC-22).
|
|
94
|
+
*/
|
|
95
|
+
private readonly field;
|
|
96
|
+
/** The value the element last held by its own doing: a `value` that differs was set by the product (OTC-18). */
|
|
97
|
+
private held;
|
|
98
|
+
/** OTC-13: the value at the last commit. */
|
|
99
|
+
private committed;
|
|
100
|
+
/** OTC-6: an input method is composing; the native element is its own until it ends. */
|
|
101
|
+
private composing;
|
|
102
|
+
/** A composition has just ended: what the engine still sends for it (an input, the key that committed it) is not the person's edit or the action key. */
|
|
103
|
+
private settling;
|
|
104
|
+
/** OTC-5: focus arrives by a press on a cell, which has chosen the active cell. */
|
|
105
|
+
private pressing;
|
|
106
|
+
/** Focus has arrived and the person has done nothing yet: a selection of the whole text is the browser's own (it selects a text input it tabs into), not the person's select all. */
|
|
107
|
+
private fresh;
|
|
108
|
+
private readonly rows;
|
|
109
|
+
private observed;
|
|
110
|
+
private get input();
|
|
111
|
+
/** The form it belongs to, if any. */
|
|
112
|
+
get form(): HTMLFormElement | null;
|
|
113
|
+
/** The element's validity: a missing value while its Field says it is required and it is empty (OTC-29). */
|
|
114
|
+
get validity(): ValidityState;
|
|
115
|
+
get validationMessage(): string;
|
|
116
|
+
get willValidate(): boolean;
|
|
117
|
+
checkValidity(): boolean;
|
|
118
|
+
reportValidity(): boolean;
|
|
119
|
+
/** OTC-19: the number of cells — `length`, or 6 where it is not a whole number of 1 or more. */
|
|
120
|
+
private get cells();
|
|
121
|
+
/** OTC-19: `type`, or numeric for a value it does not know. */
|
|
122
|
+
private get kind();
|
|
123
|
+
/** OTC-15, OTC-19: the cells of each group — one group unless `groupSize` is a whole number from 1 to length minus 1. */
|
|
124
|
+
private get groups();
|
|
125
|
+
private get isDisabled();
|
|
126
|
+
/** OTC-20, OTC-21: nothing the person does changes the value. */
|
|
127
|
+
private get locked();
|
|
128
|
+
private get isError();
|
|
129
|
+
formResetCallback(): void;
|
|
130
|
+
formStateRestoreCallback(state: string | File | FormData | null): void;
|
|
131
|
+
formDisabledCallback(disabled: boolean): void;
|
|
132
|
+
/** The value a form submits — the code alone, or an empty string — and what its validation is told. */
|
|
133
|
+
private syncForm;
|
|
134
|
+
disconnectedCallback(): void;
|
|
135
|
+
protected willUpdate(changed: PropertyValues<this>): void;
|
|
136
|
+
protected updated(changed: PropertyValues<this>): void;
|
|
137
|
+
/**
|
|
138
|
+
* OTC-23: the mark of a group that begins a row is not drawn. The one thing read from the layout: whether a group
|
|
139
|
+
* stands on the row of the group before it. The mark is positioned, so hiding it moves nothing.
|
|
140
|
+
*/
|
|
141
|
+
private readonly markRows;
|
|
142
|
+
/**
|
|
143
|
+
* OTC-2, OTC-5: the native element holds the value and its insertion point stands at the active cell — before its
|
|
144
|
+
* character while it is filled, at the end of the value while it is empty — or the whole value is selected (OTC-10).
|
|
145
|
+
* Never written into a composition: the text is the input method's until it ends.
|
|
146
|
+
*/
|
|
147
|
+
private show;
|
|
148
|
+
/**
|
|
149
|
+
* Takes a state an edit produced. When it changes the value the element holds it before anyone hears of it, as a
|
|
150
|
+
* native control does: `input`, then `complete` when the value is `length` long — once for the change.
|
|
151
|
+
*/
|
|
152
|
+
private take;
|
|
153
|
+
/** OTC-13: a changed value is committed — `change`, when it differs from the value at the last commit. */
|
|
154
|
+
private commit;
|
|
155
|
+
/**
|
|
156
|
+
* Text that arrives in the field. One character from the keyboard is typed (OTC-4, OTC-6): a permitted one fills the
|
|
157
|
+
* active cell, any other is dropped. A whole text — pasted, dropped, dictated, filled — is read as one code wherever
|
|
158
|
+
* the active cell is (OTC-11), and changes nothing where it holds none.
|
|
159
|
+
*/
|
|
160
|
+
private insert;
|
|
161
|
+
private onBeforeInput;
|
|
162
|
+
/**
|
|
163
|
+
* The native element's own `input`: it is stopped here (the element's `input` is the composed event `take()` fires).
|
|
164
|
+
* What reaches this without having been read in `beforeinput` — autofill, and input a browser does not announce or
|
|
165
|
+
* does not let be stopped — is read from the element: a removal as the browser made it, one character as typed, and
|
|
166
|
+
* anything else as a whole text (OTC-11).
|
|
167
|
+
*/
|
|
168
|
+
private onInput;
|
|
169
|
+
/** The browser's own `change` is not the field's (OTC-13 decides when a value is committed). */
|
|
170
|
+
private onNativeChange;
|
|
171
|
+
private onCompositionStart;
|
|
172
|
+
private onCompositionUpdate;
|
|
173
|
+
/**
|
|
174
|
+
* The composition ended: what it committed is read character by character, as typed text is; a cancelled one leaves
|
|
175
|
+
* nothing. The engines differ in what follows — an `input` that is no longer composing (Firefox), nothing (Chromium),
|
|
176
|
+
* and the `keydown` of the key that committed it, which no longer says that it composes (WebKit) — so for the rest of
|
|
177
|
+
* this turn nothing the native element sends is read as an edit or as the action key.
|
|
178
|
+
*/
|
|
179
|
+
private onCompositionEnd;
|
|
180
|
+
private onKeyDown;
|
|
181
|
+
/** OTC-13: the action key — the commit, then `action`, then the form's submission unless `action` was cancelled. */
|
|
182
|
+
private act;
|
|
183
|
+
private onFocus;
|
|
184
|
+
private onBlur;
|
|
185
|
+
/** The cell at a point of the window, or -1: the native element lies over the cells and takes the press. */
|
|
186
|
+
private cellAt;
|
|
187
|
+
/**
|
|
188
|
+
* OTC-25: a press takes focus and makes the pressed cell active while it is filled, and otherwise the first empty
|
|
189
|
+
* cell. It is not an action and draws no answer. The native element's own answer to a press — its caret where the
|
|
190
|
+
* unseen text is, a selection by dragging or by a second press — is not wanted (OTC-10), so the press is the
|
|
191
|
+
* element's: it focuses the native element itself.
|
|
192
|
+
*/
|
|
193
|
+
private onMouseDown;
|
|
194
|
+
/**
|
|
195
|
+
* OTC-10: a selection of the native text. The whole value selected by the person — the browser's menu, a touch
|
|
196
|
+
* keyboard's "select all" — is select all; any other selection (a part of the text, or the one a browser makes when
|
|
197
|
+
* it focuses an input) is undone: the field has no selection of some cells only.
|
|
198
|
+
*/
|
|
199
|
+
private onSelect;
|
|
200
|
+
/** OTC-10: copy takes the whole value, without group marks, whichever cell is active; nothing while mask is set. */
|
|
201
|
+
private onCopy;
|
|
202
|
+
/** OTC-10: cut takes the whole value and empties the field; while mask is set it gives nothing and changes nothing. */
|
|
203
|
+
private onCut;
|
|
204
|
+
/** OTC-11: pasted text is read whole as one code. Never blocked, masked or not. */
|
|
205
|
+
private onPaste;
|
|
206
|
+
/** OTC-11: dropped text is read whole as one code, and the field takes focus as a native input does. */
|
|
207
|
+
private onDrop;
|
|
208
|
+
/**
|
|
209
|
+
* What the cells draw: the value, or — while an input method composes — the value as it would be if the composing
|
|
210
|
+
* text were committed now, with the cells that text fills marked (OTC-6). The value itself does not change.
|
|
211
|
+
*/
|
|
212
|
+
private get drawn();
|
|
213
|
+
protected render(): import("lit").TemplateResult<1>;
|
|
214
|
+
}
|
|
215
|
+
declare global {
|
|
216
|
+
interface HTMLElementTagNameMap {
|
|
217
|
+
'tanrei-one-time-code-input': TanreiOneTimeCodeInput;
|
|
218
|
+
}
|
|
219
|
+
}
|