@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,65 @@
|
|
|
1
|
+
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
+
type Host = ReactiveControllerHost & HTMLElement;
|
|
3
|
+
type Maybe = Element | null | undefined;
|
|
4
|
+
export interface FollowOptions {
|
|
5
|
+
/** The elements whose place decides the placement (the anchor; a submenu's item), read again after every check. */
|
|
6
|
+
followed: () => Iterable<Maybe>;
|
|
7
|
+
/** The elements whose size alone decides it (the overlay's surface, what scrolls in it). */
|
|
8
|
+
sized?: () => Iterable<Maybe>;
|
|
9
|
+
/** Places again if what the placement depends on changed; returns whether it did. */
|
|
10
|
+
check: () => boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Follows what an overlay is placed against by events, frame by frame only while it moves (TIP-9, MNU-2, MNU-46,
|
|
14
|
+
* FBM-13, SRC-7, DTM-2). `start()` when the overlay is shown and placed, `stop()` when it is hidden.
|
|
15
|
+
*/
|
|
16
|
+
export declare class FollowController implements ReactiveController {
|
|
17
|
+
private readonly host;
|
|
18
|
+
private readonly options;
|
|
19
|
+
private active;
|
|
20
|
+
private frame;
|
|
21
|
+
private quiet;
|
|
22
|
+
private reobserve;
|
|
23
|
+
private followed;
|
|
24
|
+
private sized;
|
|
25
|
+
/** Every flat-tree ancestor of what is watched, and the watched elements themselves. */
|
|
26
|
+
private readonly chain;
|
|
27
|
+
private readonly roots;
|
|
28
|
+
private readonly sizes;
|
|
29
|
+
private resizes;
|
|
30
|
+
private attributes;
|
|
31
|
+
private readonly places;
|
|
32
|
+
private scheme;
|
|
33
|
+
constructor(host: Host, options: FollowOptions);
|
|
34
|
+
/** Whether the overlay is being followed now. */
|
|
35
|
+
get following(): boolean;
|
|
36
|
+
hostUpdated(): void;
|
|
37
|
+
hostDisconnected(): void;
|
|
38
|
+
start(): void;
|
|
39
|
+
stop(): void;
|
|
40
|
+
/** Something this cannot see may have changed the placement: checked in the next frame, and for as long as it changes. */
|
|
41
|
+
readonly request: () => void;
|
|
42
|
+
private readonly step;
|
|
43
|
+
/** One check; what is watched is read again after it, and each followed element's box is taken as its place. */
|
|
44
|
+
private run;
|
|
45
|
+
/** A check outside a frame (an observer's callback): a change starts the frames that follow a motion. */
|
|
46
|
+
private now;
|
|
47
|
+
private watch;
|
|
48
|
+
private unwatch;
|
|
49
|
+
/** A transition or an animation beginning on what is watched or on an ancestor of it: it may move it. */
|
|
50
|
+
private readonly onMotion;
|
|
51
|
+
/**
|
|
52
|
+
* A size changed. Checked at once, in the same frame — with the sized elements (which the placement itself resizes: a
|
|
53
|
+
* capped height) out of the observer until the next frame, so that placing inside the callback is not a resize loop.
|
|
54
|
+
* Observing again reports each once more; a report of the size already seen is not a change.
|
|
55
|
+
*/
|
|
56
|
+
private readonly onResize;
|
|
57
|
+
/**
|
|
58
|
+
* Watches one followed element's place: an IntersectionObserver whose root is the viewport cut down to the element's
|
|
59
|
+
* box reports when the element is no longer where it was. Its first report is where it is (and the ratio a clipped
|
|
60
|
+
* element is seen at, which the observer is then set to — once: a ratio the browser reports differently a second time
|
|
61
|
+
* is watched as it is, not chased); the next one is a move.
|
|
62
|
+
*/
|
|
63
|
+
private arm;
|
|
64
|
+
}
|
|
65
|
+
export {};
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
// An overlay in the top layer is placed by script against its anchor (a tooltip, a menu and its submenus, a FAB menu's
|
|
2
|
+
// items, a search view, a docked picker), so it has to be placed again whenever the anchor moves — and nothing tells a
|
|
3
|
+
// script that an element moved. Asking in every frame does (it is what these five did, each with its own copy of the
|
|
4
|
+
// loop), and costs a page a share of a core for as long as an overlay is open, moving or not.
|
|
5
|
+
//
|
|
6
|
+
// FollowController asks only when something can have moved, and asks in every frame only while something is moving:
|
|
7
|
+
//
|
|
8
|
+
// scroll — any scroll in the window, or in a shadow root an anchor is inside (captured, passive)
|
|
9
|
+
// resize — the window and the visual viewport (and its scroll: a pinch-zoomed page panned, the keyboard)
|
|
10
|
+
// a size — a ResizeObserver on what is followed, on what is sized and on the root element
|
|
11
|
+
// a place, with no event — an IntersectionObserver per followed element whose root is cut down to the element's own
|
|
12
|
+
// box: it reports the moment the element is no longer exactly there (a sibling's layout, a
|
|
13
|
+
// transform, a script), and is set again at the new box
|
|
14
|
+
// a motion beginning — `transitionrun` / `transitionstart` / `animationstart` / `animationiteration` on an
|
|
15
|
+
// ancestor of what is followed or sized (or on it)
|
|
16
|
+
// the cascade — an attribute changed on an ancestor (`dir`, a theme, a style), the colour scheme, and the
|
|
17
|
+
// host rendered again
|
|
18
|
+
//
|
|
19
|
+
// Any of them starts a run of frames that lasts for as long as `check` keeps finding a change, and for QUIET frames
|
|
20
|
+
// after the last one. At rest no frame is asked for.
|
|
21
|
+
//
|
|
22
|
+
// The component keeps what it compares and how it places: `check()` reads what the placement depends on, places again
|
|
23
|
+
// if that differs from what it placed for, and says whether it did.
|
|
24
|
+
//
|
|
25
|
+
// What this cannot see (the frame loop could): an element followed that moves by less than a pixel with no event, one
|
|
26
|
+
// that moves while it is wholly outside the viewport or has no area, a style sheet replaced so that an inherited value
|
|
27
|
+
// changes with no attribute changed on an ancestor, and an anchor moved to another parent while the overlay is open.
|
|
28
|
+
// Each is seen at the next thing that is.
|
|
29
|
+
/** Frames without a change that end a run: a transition's first frames may not have moved anything yet. */
|
|
30
|
+
const QUIET = 3;
|
|
31
|
+
const MOTION_EVENTS = ['transitionrun', 'transitionstart', 'animationstart', 'animationiteration'];
|
|
32
|
+
/** The size a ResizeObserver last reported, as one comparable string. */
|
|
33
|
+
const sizeOf = (entry) => {
|
|
34
|
+
const box = entry.borderBoxSize?.[0];
|
|
35
|
+
return box ? `${box.inlineSize},${box.blockSize}` : `${entry.contentRect.width},${entry.contentRect.height}`;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Follows what an overlay is placed against by events, frame by frame only while it moves (TIP-9, MNU-2, MNU-46,
|
|
39
|
+
* FBM-13, SRC-7, DTM-2). `start()` when the overlay is shown and placed, `stop()` when it is hidden.
|
|
40
|
+
*/
|
|
41
|
+
export class FollowController {
|
|
42
|
+
constructor(host, options) {
|
|
43
|
+
this.host = host;
|
|
44
|
+
this.options = options;
|
|
45
|
+
this.active = false;
|
|
46
|
+
this.frame = 0;
|
|
47
|
+
this.quiet = 0;
|
|
48
|
+
this.reobserve = 0;
|
|
49
|
+
this.followed = [];
|
|
50
|
+
this.sized = [];
|
|
51
|
+
/** Every flat-tree ancestor of what is watched, and the watched elements themselves. */
|
|
52
|
+
this.chain = new Set();
|
|
53
|
+
this.roots = new Set();
|
|
54
|
+
this.sizes = new WeakMap();
|
|
55
|
+
this.resizes = null;
|
|
56
|
+
this.attributes = null;
|
|
57
|
+
this.places = new Map();
|
|
58
|
+
this.scheme = null;
|
|
59
|
+
/** Something this cannot see may have changed the placement: checked in the next frame, and for as long as it changes. */
|
|
60
|
+
this.request = () => {
|
|
61
|
+
if (!this.active)
|
|
62
|
+
return;
|
|
63
|
+
this.quiet = 0;
|
|
64
|
+
if (!this.frame)
|
|
65
|
+
this.frame = requestAnimationFrame(this.step);
|
|
66
|
+
};
|
|
67
|
+
this.step = () => {
|
|
68
|
+
this.frame = 0;
|
|
69
|
+
if (!this.active)
|
|
70
|
+
return;
|
|
71
|
+
if (this.run())
|
|
72
|
+
this.quiet = 0;
|
|
73
|
+
else
|
|
74
|
+
this.quiet++;
|
|
75
|
+
if (this.active && this.quiet < QUIET)
|
|
76
|
+
this.frame = requestAnimationFrame(this.step);
|
|
77
|
+
};
|
|
78
|
+
/** A transition or an animation beginning on what is watched or on an ancestor of it: it may move it. */
|
|
79
|
+
this.onMotion = (event) => {
|
|
80
|
+
const target = event.composedPath()[0];
|
|
81
|
+
if (target instanceof Element && this.chain.has(target))
|
|
82
|
+
this.request();
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* A size changed. Checked at once, in the same frame — with the sized elements (which the placement itself resizes: a
|
|
86
|
+
* capped height) out of the observer until the next frame, so that placing inside the callback is not a resize loop.
|
|
87
|
+
* Observing again reports each once more; a report of the size already seen is not a change.
|
|
88
|
+
*/
|
|
89
|
+
this.onResize = (entries) => {
|
|
90
|
+
let changed = false;
|
|
91
|
+
for (const entry of entries) {
|
|
92
|
+
const size = sizeOf(entry);
|
|
93
|
+
if (this.sizes.get(entry.target) !== size)
|
|
94
|
+
changed = true;
|
|
95
|
+
this.sizes.set(entry.target, size);
|
|
96
|
+
}
|
|
97
|
+
if (!changed || !this.active)
|
|
98
|
+
return;
|
|
99
|
+
for (const element of this.sized)
|
|
100
|
+
this.resizes?.unobserve(element);
|
|
101
|
+
this.now();
|
|
102
|
+
if (!this.active || this.reobserve)
|
|
103
|
+
return;
|
|
104
|
+
this.reobserve = requestAnimationFrame(() => {
|
|
105
|
+
this.reobserve = 0;
|
|
106
|
+
if (!this.active)
|
|
107
|
+
return;
|
|
108
|
+
for (const element of this.sized) {
|
|
109
|
+
// The size it has now is the one placed for, unless something else changed it since: the report says which.
|
|
110
|
+
const box = element.getBoundingClientRect();
|
|
111
|
+
this.sizes.set(element, `${box.width},${box.height}`);
|
|
112
|
+
this.resizes?.observe(element);
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
host.addController(this);
|
|
117
|
+
}
|
|
118
|
+
/** Whether the overlay is being followed now. */
|
|
119
|
+
get following() {
|
|
120
|
+
return this.active;
|
|
121
|
+
}
|
|
122
|
+
hostUpdated() {
|
|
123
|
+
// What the host drew may be what the placement depends on (its content, a prop, the choices of the design system).
|
|
124
|
+
if (this.active)
|
|
125
|
+
this.request();
|
|
126
|
+
}
|
|
127
|
+
hostDisconnected() {
|
|
128
|
+
this.stop();
|
|
129
|
+
}
|
|
130
|
+
start() {
|
|
131
|
+
if (this.active || typeof window === 'undefined')
|
|
132
|
+
return;
|
|
133
|
+
this.active = true;
|
|
134
|
+
window.addEventListener('scroll', this.request, { capture: true, passive: true });
|
|
135
|
+
window.addEventListener('resize', this.request, { passive: true });
|
|
136
|
+
window.visualViewport?.addEventListener('resize', this.request, { passive: true });
|
|
137
|
+
window.visualViewport?.addEventListener('scroll', this.request, { passive: true });
|
|
138
|
+
for (const type of MOTION_EVENTS)
|
|
139
|
+
window.addEventListener(type, this.onMotion, { capture: true, passive: true });
|
|
140
|
+
this.scheme = window.matchMedia?.('(prefers-color-scheme: dark)') ?? null;
|
|
141
|
+
this.scheme?.addEventListener('change', this.request);
|
|
142
|
+
if (typeof ResizeObserver !== 'undefined')
|
|
143
|
+
this.resizes = new ResizeObserver(this.onResize);
|
|
144
|
+
if (typeof MutationObserver !== 'undefined')
|
|
145
|
+
this.attributes = new MutationObserver(this.request);
|
|
146
|
+
this.watch();
|
|
147
|
+
this.request();
|
|
148
|
+
}
|
|
149
|
+
stop() {
|
|
150
|
+
if (!this.active)
|
|
151
|
+
return;
|
|
152
|
+
this.active = false;
|
|
153
|
+
cancelAnimationFrame(this.frame);
|
|
154
|
+
cancelAnimationFrame(this.reobserve);
|
|
155
|
+
this.frame = this.reobserve = 0;
|
|
156
|
+
window.removeEventListener('scroll', this.request, { capture: true });
|
|
157
|
+
window.removeEventListener('resize', this.request);
|
|
158
|
+
window.visualViewport?.removeEventListener('resize', this.request);
|
|
159
|
+
window.visualViewport?.removeEventListener('scroll', this.request);
|
|
160
|
+
for (const type of MOTION_EVENTS)
|
|
161
|
+
window.removeEventListener(type, this.onMotion, { capture: true });
|
|
162
|
+
this.scheme?.removeEventListener('change', this.request);
|
|
163
|
+
this.scheme = null;
|
|
164
|
+
this.unwatch();
|
|
165
|
+
this.resizes = this.attributes = null;
|
|
166
|
+
this.followed = [];
|
|
167
|
+
this.sized = [];
|
|
168
|
+
}
|
|
169
|
+
/** One check; what is watched is read again after it, and each followed element's box is taken as its place. */
|
|
170
|
+
run() {
|
|
171
|
+
const changed = this.options.check();
|
|
172
|
+
if (!this.active)
|
|
173
|
+
return changed;
|
|
174
|
+
const followed = [...this.options.followed()].filter((element) => !!element);
|
|
175
|
+
const sized = [...(this.options.sized?.() ?? [])].filter((element) => !!element);
|
|
176
|
+
const same = (a, b) => a.length === b.length && a.every((element, index) => element === b[index]);
|
|
177
|
+
if (!same(followed, this.followed) || !same(sized, this.sized)) {
|
|
178
|
+
this.unwatch();
|
|
179
|
+
this.watch(followed, sized);
|
|
180
|
+
}
|
|
181
|
+
else if (changed)
|
|
182
|
+
for (const element of this.followed)
|
|
183
|
+
this.arm(element);
|
|
184
|
+
return changed;
|
|
185
|
+
}
|
|
186
|
+
/** A check outside a frame (an observer's callback): a change starts the frames that follow a motion. */
|
|
187
|
+
now() {
|
|
188
|
+
if (!this.active)
|
|
189
|
+
return;
|
|
190
|
+
if (this.run())
|
|
191
|
+
this.request();
|
|
192
|
+
}
|
|
193
|
+
watch(followed = [...this.options.followed()].filter((element) => !!element), sized = [...(this.options.sized?.() ?? [])].filter((element) => !!element)) {
|
|
194
|
+
this.followed = followed;
|
|
195
|
+
this.sized = sized;
|
|
196
|
+
const hostRoot = this.host.shadowRoot;
|
|
197
|
+
if (hostRoot)
|
|
198
|
+
this.roots.add(hostRoot);
|
|
199
|
+
for (const element of [...followed, ...sized]) {
|
|
200
|
+
let node = element;
|
|
201
|
+
while (node && !this.chain.has(node)) {
|
|
202
|
+
this.chain.add(node);
|
|
203
|
+
const parent = node.assignedSlot ?? node.parentNode;
|
|
204
|
+
if (parent instanceof ShadowRoot) {
|
|
205
|
+
this.roots.add(parent);
|
|
206
|
+
node = parent.host;
|
|
207
|
+
}
|
|
208
|
+
else
|
|
209
|
+
node = parent instanceof Element ? parent : null;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
for (const root of this.roots) {
|
|
213
|
+
root.addEventListener('scroll', this.request, { capture: true, passive: true });
|
|
214
|
+
for (const type of MOTION_EVENTS)
|
|
215
|
+
root.addEventListener(type, this.onMotion, { capture: true, passive: true });
|
|
216
|
+
}
|
|
217
|
+
for (const element of this.chain)
|
|
218
|
+
this.attributes?.observe(element, { attributes: true });
|
|
219
|
+
this.resizes?.observe(document.documentElement);
|
|
220
|
+
for (const element of [...followed, ...sized])
|
|
221
|
+
this.resizes?.observe(element);
|
|
222
|
+
for (const element of followed)
|
|
223
|
+
this.arm(element);
|
|
224
|
+
}
|
|
225
|
+
unwatch() {
|
|
226
|
+
for (const root of this.roots) {
|
|
227
|
+
root.removeEventListener('scroll', this.request, { capture: true });
|
|
228
|
+
for (const type of MOTION_EVENTS)
|
|
229
|
+
root.removeEventListener(type, this.onMotion, { capture: true });
|
|
230
|
+
}
|
|
231
|
+
this.roots.clear();
|
|
232
|
+
this.chain.clear();
|
|
233
|
+
this.attributes?.disconnect();
|
|
234
|
+
this.resizes?.disconnect();
|
|
235
|
+
for (const observer of this.places.values())
|
|
236
|
+
observer.disconnect();
|
|
237
|
+
this.places.clear();
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Watches one followed element's place: an IntersectionObserver whose root is the viewport cut down to the element's
|
|
241
|
+
* box reports when the element is no longer where it was. Its first report is where it is (and the ratio a clipped
|
|
242
|
+
* element is seen at, which the observer is then set to — once: a ratio the browser reports differently a second time
|
|
243
|
+
* is watched as it is, not chased); the next one is a move.
|
|
244
|
+
*/
|
|
245
|
+
arm(element, threshold = 1, adjusted = false) {
|
|
246
|
+
this.places.get(element)?.disconnect();
|
|
247
|
+
this.places.delete(element);
|
|
248
|
+
if (typeof IntersectionObserver === 'undefined' || !element.isConnected)
|
|
249
|
+
return;
|
|
250
|
+
const box = element.getBoundingClientRect();
|
|
251
|
+
if (!box.width || !box.height)
|
|
252
|
+
return;
|
|
253
|
+
const root = element.ownerDocument.documentElement;
|
|
254
|
+
const inset = (value) => `${-Math.floor(value)}px`;
|
|
255
|
+
const rootMargin = `${inset(box.top)} ${inset(root.clientWidth - box.right)} ${inset(root.clientHeight - box.bottom)} ${inset(box.left)}`;
|
|
256
|
+
let first = true;
|
|
257
|
+
const report = (entries) => {
|
|
258
|
+
const ratio = entries[entries.length - 1].intersectionRatio;
|
|
259
|
+
if (first) {
|
|
260
|
+
first = false;
|
|
261
|
+
// Clipped (by the viewport, by a scroll container): watched at the ratio it is seen at; out of sight, for coming in.
|
|
262
|
+
if (ratio !== threshold && !adjusted)
|
|
263
|
+
this.arm(element, ratio === 0 ? Number.MIN_VALUE : ratio, true);
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
if (!this.active)
|
|
267
|
+
return;
|
|
268
|
+
this.arm(element);
|
|
269
|
+
this.now();
|
|
270
|
+
};
|
|
271
|
+
let observer;
|
|
272
|
+
try {
|
|
273
|
+
observer = new IntersectionObserver(report, { root: element.ownerDocument, rootMargin, threshold: Math.min(1, Math.max(0, threshold)) });
|
|
274
|
+
}
|
|
275
|
+
catch {
|
|
276
|
+
// A document as the root is not everywhere: the top-level viewport then (right for a page that is not framed).
|
|
277
|
+
observer = new IntersectionObserver(report, { rootMargin, threshold: Math.min(1, Math.max(0, threshold)) });
|
|
278
|
+
}
|
|
279
|
+
observer.observe(element);
|
|
280
|
+
this.places.set(element, observer);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
//# sourceMappingURL=follow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"follow.js","sourceRoot":"","sources":["../../src/primitives/follow.ts"],"names":[],"mappings":"AAEA,uHAAuH;AACvH,uHAAuH;AACvH,qHAAqH;AACrH,8FAA8F;AAC9F,EAAE;AACF,oHAAoH;AACpH,EAAE;AACF,oHAAoH;AACpH,4HAA4H;AAC5H,6GAA6G;AAC7G,uHAAuH;AACvH,uHAAuH;AACvH,oFAAoF;AACpF,kHAAkH;AAClH,+EAA+E;A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
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** What is asked of the element: Lit's own flag. */
|
|
2
|
+
export interface UpdatingHost {
|
|
3
|
+
readonly isUpdatePending: boolean;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* The element's `formDisabledCallback` calls this with what it was given. `take` sets the element's own state from the
|
|
7
|
+
* platform's word (a reactive state, or a field and `requestUpdate()`): at once, or right after the update under way —
|
|
8
|
+
* then with the last word that arrived during it.
|
|
9
|
+
*/
|
|
10
|
+
export declare function takeFormDisabled(host: UpdatingHost, disabled: boolean, take: (disabled: boolean) => void): void;
|
|
11
|
+
/**
|
|
12
|
+
* Whether a control a container walks is disabled now: by its own `disabled` — the property, which a Tanrei element
|
|
13
|
+
* has before its attribute (src/primitives/disabled-while-focused.ts), or the attribute of an element that has no such
|
|
14
|
+
* property — or by a disabled fieldset around a form-associated element (a Button, BTN-32; a field), which changes
|
|
15
|
+
* neither. A Button answers for itself: as a link it is disabled by no fieldset, though the platform says so of its
|
|
16
|
+
* element. A container that reads only an item's own `disabled` counts an item no key can reach.
|
|
17
|
+
*/
|
|
18
|
+
export declare function isDisabledControl(control: Element & {
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
}): boolean;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// The platform's word that a form-associated element is disabled — by an ancestor `<fieldset disabled>`, or by the
|
|
2
|
+
// element's own `disabled` attribute — taken where it is not lost.
|
|
3
|
+
//
|
|
4
|
+
// `formDisabledCallback` is called for the element's own attribute too. A reflected `disabled` property set to false
|
|
5
|
+
// has its attribute removed in the middle of the update the property change started, after `render()` has read the old
|
|
6
|
+
// state; the callback arrives there, and a reactive state set during an update schedules no new one and is cleared
|
|
7
|
+
// with it: the element stays drawn and behaving as disabled until something else renders it. So a word that arrives
|
|
8
|
+
// while an update is pending is taken right after it, and starts an update of its own.
|
|
9
|
+
import { SUBMIT_BUTTON } from './default-button.js';
|
|
10
|
+
/** The platform's last word for an element whose word is waiting for its update to end. */
|
|
11
|
+
const waiting = new WeakMap();
|
|
12
|
+
/**
|
|
13
|
+
* The element's `formDisabledCallback` calls this with what it was given. `take` sets the element's own state from the
|
|
14
|
+
* platform's word (a reactive state, or a field and `requestUpdate()`): at once, or right after the update under way —
|
|
15
|
+
* then with the last word that arrived during it.
|
|
16
|
+
*/
|
|
17
|
+
export function takeFormDisabled(host, disabled, take) {
|
|
18
|
+
if (waiting.has(host)) {
|
|
19
|
+
waiting.set(host, disabled);
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
if (!host.isUpdatePending) {
|
|
23
|
+
take(disabled);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
waiting.set(host, disabled);
|
|
27
|
+
// The update that is running (or queued) is a microtask's work: this one runs after it.
|
|
28
|
+
queueMicrotask(() => {
|
|
29
|
+
const last = waiting.get(host) ?? disabled;
|
|
30
|
+
waiting.delete(host);
|
|
31
|
+
take(last);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Whether a control a container walks is disabled now: by its own `disabled` — the property, which a Tanrei element
|
|
36
|
+
* has before its attribute (src/primitives/disabled-while-focused.ts), or the attribute of an element that has no such
|
|
37
|
+
* property — or by a disabled fieldset around a form-associated element (a Button, BTN-32; a field), which changes
|
|
38
|
+
* neither. A Button answers for itself: as a link it is disabled by no fieldset, though the platform says so of its
|
|
39
|
+
* element. A container that reads only an item's own `disabled` counts an item no key can reach.
|
|
40
|
+
*/
|
|
41
|
+
export function isDisabledControl(control) {
|
|
42
|
+
if (SUBMIT_BUTTON in control)
|
|
43
|
+
return control[SUBMIT_BUTTON].disabled;
|
|
44
|
+
return !!(control.disabled ?? control.hasAttribute('disabled')) || control.matches(':disabled');
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=form-disabled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-disabled.js","sourceRoot":"","sources":["../../src/primitives/form-disabled.ts"],"names":[],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ormValue()` takes: one entry, several under names of their own, a file, or none. */
|
|
2
|
+
export type FormEntry = File | string | FormData | null;
|
|
3
|
+
/** The last thing a control told its form. */
|
|
4
|
+
export interface FormWord {
|
|
5
|
+
/** What it submits (`null`: nothing). */
|
|
6
|
+
value: FormEntry;
|
|
7
|
+
/** What it is restored from; `undefined` where the control gave none (the platform then keeps the value). */
|
|
8
|
+
state: FormEntry | undefined;
|
|
9
|
+
/** Its validity flags; none set while it is valid. */
|
|
10
|
+
flags: ValidityStateFlags;
|
|
11
|
+
/** The message of an invalid control. */
|
|
12
|
+
message: string;
|
|
13
|
+
/** Where the browser's message points and what it focuses: the control's own native element. */
|
|
14
|
+
anchor: HTMLElement | undefined;
|
|
15
|
+
}
|
|
16
|
+
/** Where a control keeps its `FormSays`, so that the element composed around it can hear it. */
|
|
17
|
+
export declare const FORM_SAYS: unique symbol;
|
|
18
|
+
export declare class FormSays {
|
|
19
|
+
private readonly internals;
|
|
20
|
+
/** The last word. A control that has said nothing submits nothing and is valid, as the platform has it. */
|
|
21
|
+
last: FormWord;
|
|
22
|
+
private readonly hearers;
|
|
23
|
+
constructor(host: HTMLElement, internals: ElementInternals);
|
|
24
|
+
/** In place of `internals.setFormValue(value, state)`. */
|
|
25
|
+
value(value: FormEntry, state?: FormEntry): void;
|
|
26
|
+
/** In place of `internals.setValidity(flags, message, anchor)`; no argument says the control is valid. */
|
|
27
|
+
validity(flags?: ValidityStateFlags, message?: string, anchor?: HTMLElement): void;
|
|
28
|
+
/** Tells `hearer` the last word at once and every later one; the function returned stops it. */
|
|
29
|
+
hear(hearer: (word: FormWord) => void): () => void;
|
|
30
|
+
private tell;
|
|
31
|
+
}
|
|
32
|
+
/** The `FormSays` of `element`, where it is a control that speaks through one. */
|
|
33
|
+
export declare const formSaysOf: (element: Element | null | undefined) => FormSays | undefined;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// What a form-associated control tells its form, said where a composed element can hear it (W6, items 2
|
|
2
|
+
// and 3).
|
|
3
|
+
//
|
|
4
|
+
// A form finds its controls in its own tree. A control that is a member of a composed element stands in that element's
|
|
5
|
+
// shadow root, outside every form: what it tells its own `ElementInternals` reaches no form. The composed element is
|
|
6
|
+
// the form's element, and repeats on its own internals what its value member tells its own — so the member must say it
|
|
7
|
+
// where it can be heard. `FormSays` is that place: a control calls `value()` and `validity()` where it would call
|
|
8
|
+
// `internals.setFormValue()` and `internals.setValidity()`. Each does exactly that call, keeps the last word, and tells
|
|
9
|
+
// whoever listens. Outside a composed element nobody listens, and the control behaves as it did.
|
|
10
|
+
/** Where a control keeps its `FormSays`, so that the element composed around it can hear it. */
|
|
11
|
+
export const FORM_SAYS = Symbol.for('tanrei.form-says');
|
|
12
|
+
export class FormSays {
|
|
13
|
+
constructor(host, internals) {
|
|
14
|
+
this.internals = internals;
|
|
15
|
+
/** The last word. A control that has said nothing submits nothing and is valid, as the platform has it. */
|
|
16
|
+
this.last = { value: null, state: undefined, flags: {}, message: '', anchor: undefined };
|
|
17
|
+
this.hearers = new Set();
|
|
18
|
+
host[FORM_SAYS] = this;
|
|
19
|
+
}
|
|
20
|
+
/** In place of `internals.setFormValue(value, state)`. */
|
|
21
|
+
value(value, state) {
|
|
22
|
+
this.internals.setFormValue(value, state);
|
|
23
|
+
this.last = { ...this.last, value, state };
|
|
24
|
+
this.tell();
|
|
25
|
+
}
|
|
26
|
+
/** In place of `internals.setValidity(flags, message, anchor)`; no argument says the control is valid. */
|
|
27
|
+
validity(flags = {}, message = '', anchor) {
|
|
28
|
+
this.internals.setValidity(flags, message, anchor);
|
|
29
|
+
this.last = { ...this.last, flags, message, anchor };
|
|
30
|
+
this.tell();
|
|
31
|
+
}
|
|
32
|
+
/** Tells `hearer` the last word at once and every later one; the function returned stops it. */
|
|
33
|
+
hear(hearer) {
|
|
34
|
+
this.hearers.add(hearer);
|
|
35
|
+
hearer(this.last);
|
|
36
|
+
return () => this.hearers.delete(hearer);
|
|
37
|
+
}
|
|
38
|
+
tell() {
|
|
39
|
+
for (const hearer of this.hearers)
|
|
40
|
+
hearer(this.last);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/** The `FormSays` of `element`, where it is a control that speaks through one. */
|
|
44
|
+
export const formSaysOf = (element) => element?.[FORM_SAYS];
|
|
45
|
+
//# sourceMappingURL=form-says.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-says.js","sourceRoot":"","sources":["../../src/primitives/form-says.ts"],"names":[],"mappings":"AAAA,wGAAwG;AACxG,UAAU;AACV,EAAE;AACF,uHAAuH;AACvH,qHAAqH;AACrH,uHAAuH;AACvH,kHAAkH;AAClH,wHAAwH;AACxH,iGAAiG;AAmBjG,gGAAgG;AAChG,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;AAExD,MAAM,OAAO,QAAQ;IAKnB,YACE,IAAiB,EACA,SAA2B;QAA3B,cAAS,GAAT,SAAS,CAAkB;QAN9C,2GAA2G;QAC3G,SAAI,GAAa,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;QAC7E,YAAO,GAAG,IAAI,GAAG,EAA4B,CAAC;QAM5D,IAA2C,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;IACjE,CAAC;IAED,0DAA0D;IAC1D,KAAK,CAAC,KAAgB,EAAE,KAAiB;QACvC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAC1C,IAAI,CAAC,IAAI,GAAG,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;QAC3C,IAAI,CAAC,IAAI,EAAE,CAAC;IACd,CAAC;IAED,0GAA0G;IAC1G,QAAQ,CAAC,KAAK,GAAuB,EAAE,EAAE,OAAO,GAAG,EAAE,EAAE,MAAoB;QACzE,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QACnD,IAAI,CAAC,IAAI,GAAG,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;QACrD,IAAI,CAAC,IAAI,EAAE,CAAC;IACd,CAAC;IAED,gGAAgG;IAChG,IAAI,CAAC,MAAgC;QACnC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACzB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClB,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC3C,CAAC;IAEO,IAAI;QACV,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,OAAO;YAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvD,CAAC;CACF;AAED,kFAAkF;AAClF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,OAAmC,EAAwB,EAAE,CAAE,OAA8E,EAAE,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Directive, type ElementPart, type PartInfo } from 'lit/directive.js';
|
|
2
|
+
declare class Forward extends Directive {
|
|
3
|
+
constructor(part: PartInfo);
|
|
4
|
+
render(_from: object, _names: readonly string[]): symbol;
|
|
5
|
+
update(part: ElementPart, [from, names]: [object, readonly string[]]): symbol;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* W2: on a member's tag, sets each named property of `from` — the composed element — on that member as a property, on
|
|
9
|
+
* every render: `<tanrei-field ${forward(this, FIELD)}>`. Nothing is read, changed, validated or given another
|
|
10
|
+
* default on the way; a value the member does not know reaches it as given, and the member answers it.
|
|
11
|
+
*/
|
|
12
|
+
export declare const forward: (_from: object, _names: readonly string[]) => import("lit/directive.js").DirectiveResult<typeof Forward>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// W2 of the web's way of composing (src/primitives/composed.ts): a forwarded prop is
|
|
2
|
+
// set on the member it is from, as a property, on every render. Kept apart from the base classes so that the analyzer
|
|
3
|
+
// of the manifest, which reads that module for what composed elements inherit, meets no class that is not an element's.
|
|
4
|
+
import { noChange } from 'lit';
|
|
5
|
+
import { Directive, PartType, directive } from 'lit/directive.js';
|
|
6
|
+
class Forward extends Directive {
|
|
7
|
+
constructor(part) {
|
|
8
|
+
super(part);
|
|
9
|
+
if (part.type !== PartType.ELEMENT)
|
|
10
|
+
throw new Error('forward() stands on a member\'s tag: <tanrei-field ${forward(this, NAMES)}>');
|
|
11
|
+
}
|
|
12
|
+
render(_from, _names) {
|
|
13
|
+
return noChange;
|
|
14
|
+
}
|
|
15
|
+
update(part, [from, names]) {
|
|
16
|
+
const member = part.element;
|
|
17
|
+
for (const name of names)
|
|
18
|
+
member[name] = from[name];
|
|
19
|
+
return noChange;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* W2: on a member's tag, sets each named property of `from` — the composed element — on that member as a property, on
|
|
24
|
+
* every render: `<tanrei-field ${forward(this, FIELD)}>`. Nothing is read, changed, validated or given another
|
|
25
|
+
* default on the way; a value the member does not know reaches it as given, and the member answers it.
|
|
26
|
+
*/
|
|
27
|
+
export const forward = directive(Forward);
|
|
28
|
+
//# sourceMappingURL=forward.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forward.js","sourceRoot":"","sources":["../../src/primitives/forward.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,sHAAsH;AACtH,wHAAwH;AACxH,OAAO,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAmC,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAEnG,MAAM,OAAQ,SAAQ,SAAS;IAC7B,YAAY,IAAc;QACxB,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC,OAAO;YAAE,MAAM,IAAI,KAAK,CAAC,6EAA6E,CAAC,CAAC;IACrI,CAAC;IAED,MAAM,CAAC,KAAa,EAAE,MAAyB;QAC7C,OAAO,QAAQ,CAAC;IAClB,CAAC;IAEQ,MAAM,CAAC,IAAiB,EAAE,CAAC,IAAI,EAAE,KAAK,CAA8B;QAC3E,MAAM,MAAM,GAAG,IAAI,CAAC,OAA6C,CAAC;QAClE,KAAK,MAAM,IAAI,IAAI,KAAK;YAAE,MAAM,CAAC,IAAI,CAAC,GAAI,IAAgC,CAAC,IAAI,CAAC,CAAC;QACjF,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC"}
|