material 3.9.0 → 3.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/components/badge/index.d.ts +167 -3
- package/dist/components/bottom-app-bar/index.d.ts +141 -4
- package/dist/components/bottom-sheet/index.d.ts +114 -2
- package/dist/components/button/index.d.ts +10 -5
- package/dist/components/button-group/button-group.js +1 -0
- package/dist/components/button-group/config.js +9 -6
- package/dist/components/button-group/index.d.ts +250 -6
- package/dist/components/card/api.js +19 -0
- package/dist/components/card/index.d.ts +326 -5
- package/dist/components/carousel/features/slides.js +17 -7
- package/dist/components/carousel/index.d.ts +102 -3
- package/dist/components/checkbox/index.d.ts +217 -5
- package/dist/components/chips/chip/chip.js +4 -3
- package/dist/components/chips/index.d.ts +343 -3
- package/dist/components/datepicker/datepicker.js +62 -84
- package/dist/components/datepicker/index.d.ts +313 -2
- package/dist/components/datepicker/render.js +22 -18
- package/dist/components/datepicker/utils.js +66 -111
- package/dist/components/dialog/features.js +1 -1
- package/dist/components/dialog/index.d.ts +333 -3
- package/dist/components/divider/index.d.ts +99 -3
- package/dist/components/drawer/features/items.js +10 -2
- package/dist/components/drawer/index.d.ts +196 -3
- package/dist/components/extended-fab/index.d.ts +224 -2
- package/dist/components/fab/index.d.ts +183 -2
- package/dist/components/fab-menu/index.d.ts +106 -6
- package/dist/components/icon-button/index.d.ts +11 -4
- package/dist/components/list/features/anatomy.js +25 -6
- package/dist/components/list/features/selection.js +30 -2
- package/dist/components/list/index.d.ts +299 -6
- package/dist/components/loading-indicator/index.d.ts +94 -3
- package/dist/components/menu/features/controller.js +2 -0
- package/dist/components/menu/index.d.ts +10 -6
- package/dist/components/menu/types.d.ts +5 -0
- package/dist/components/navigation-bar/index.d.ts +70 -2
- package/dist/components/navigation-rail/index.d.ts +98 -2
- package/dist/components/progress/index.d.ts +9 -2
- package/dist/components/radios/index.d.ts +158 -3
- package/dist/components/search/features/states.js +3 -3
- package/dist/components/search/features/structure.js +24 -4
- package/dist/components/search/features/suggestions.js +4 -0
- package/dist/components/search/index.d.ts +255 -2
- package/dist/components/select/index.d.ts +252 -6
- package/dist/components/side-sheet/index.d.ts +104 -2
- package/dist/components/slider/index.d.ts +236 -2
- package/dist/components/snackbar/api.js +26 -0
- package/dist/components/snackbar/constants.d.ts +4 -0
- package/dist/components/snackbar/constants.js +3 -1
- package/dist/components/snackbar/index.d.ts +215 -4
- package/dist/components/split-button/index.d.ts +10 -3
- package/dist/components/switch/index.d.ts +190 -3
- package/dist/components/tabs/index.d.ts +476 -12
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/tabs/responsive-legacy.js +65 -0
- package/dist/components/tabs/responsive.d.ts +7 -32
- package/dist/components/tabs/responsive.js +4 -63
- package/dist/components/tabs/tabs.js +1 -0
- package/dist/components/text-field/config.js +3 -4
- package/dist/components/text-field/features/field.js +61 -0
- package/dist/components/text-field/features/leading-icon.js +12 -45
- package/dist/components/text-field/features/prefix-text.js +6 -40
- package/dist/components/text-field/features/suffix-text.js +6 -40
- package/dist/components/text-field/index.d.ts +345 -3
- package/dist/components/timepicker/constants.d.ts +4 -4
- package/dist/components/timepicker/constants.js +2 -2
- package/dist/components/timepicker/index.d.ts +279 -5
- package/dist/components/timepicker/render.js +4 -1
- package/dist/components/toolbar/index.d.ts +145 -6
- package/dist/components/tooltip/index.d.ts +155 -3
- package/dist/components/top-app-bar/index.d.ts +92 -5
- package/dist/core/canvas/index.d.ts +172 -5
- package/dist/core/compose/features/icon-opt-in.js +5 -0
- package/dist/core/compose/features/icon-slot.js +100 -0
- package/dist/core/compose/features/textinput.js +2 -0
- package/dist/core/compose/features/track.js +4 -0
- package/dist/core/compose/index.d.ts +744 -8
- package/dist/core/dom/index.d.ts +245 -12
- package/dist/core/index.d.ts +93 -14
- package/dist/core/shapes/index.d.ts +286 -6
- package/dist/core/state/index.d.ts +98 -5
- package/dist/core/theme/index.d.ts +80 -4
- package/dist/core/utils/index.d.ts +98 -9
- package/dist/elements/css/bottom-sheet.css +1 -1
- package/dist/elements/css/button-group.css +1 -1
- package/dist/elements/css/button.css +1 -1
- package/dist/elements/css/datepicker.css +1 -1
- package/dist/elements/css/dialog.css +1 -1
- package/dist/elements/css/drawer.css +1 -1
- package/dist/elements/css/icon-button.css +1 -1
- package/dist/elements/css/list.css +1 -1
- package/dist/elements/css/menu.css +1 -1
- package/dist/elements/css/side-sheet.css +1 -1
- package/dist/elements/css/snackbar.css +1 -1
- package/dist/elements/css/text-field.css +1 -1
- package/dist/elements/css/timepicker.css +1 -1
- package/dist/elements/css/toolbar.css +1 -1
- package/dist/elements/datepicker.js +1 -0
- package/dist/elements/define.js +12 -1
- package/dist/elements/drawer.js +2 -0
- package/dist/elements/index.d.ts +3974 -107
- package/dist/elements/preupgrade/badge.css +1 -1
- package/dist/elements/preupgrade/bottom-app-bar.css +1 -1
- package/dist/elements/preupgrade/bottom-sheet.css +1 -1
- package/dist/elements/preupgrade/button-group.css +2 -2
- package/dist/elements/preupgrade/button.css +2 -2
- package/dist/elements/preupgrade/card.css +1 -1
- package/dist/elements/preupgrade/carousel.css +1 -1
- package/dist/elements/preupgrade/checkbox.css +1 -1
- package/dist/elements/preupgrade/chips.css +1 -1
- package/dist/elements/preupgrade/datepicker.css +1 -1
- package/dist/elements/preupgrade/dialog.css +1 -1
- package/dist/elements/preupgrade/divider.css +1 -1
- package/dist/elements/preupgrade/drawer.css +2 -2
- package/dist/elements/preupgrade/extended-fab.css +1 -1
- package/dist/elements/preupgrade/fab-menu.css +1 -1
- package/dist/elements/preupgrade/fab.css +1 -1
- package/dist/elements/preupgrade/icon-button.css +2 -2
- package/dist/elements/preupgrade/list.css +2 -2
- package/dist/elements/preupgrade/loading-indicator.css +1 -1
- package/dist/elements/preupgrade/menu.css +1 -1
- package/dist/elements/preupgrade/navigation-bar.css +1 -1
- package/dist/elements/preupgrade/navigation-rail.css +1 -1
- package/dist/elements/preupgrade/progress.css +1 -1
- package/dist/elements/preupgrade/radios.css +1 -1
- package/dist/elements/preupgrade/search.css +1 -1
- package/dist/elements/preupgrade/select.css +2 -2
- package/dist/elements/preupgrade/side-sheet.css +1 -1
- package/dist/elements/preupgrade/slider.css +1 -1
- package/dist/elements/preupgrade/snackbar.css +1 -1
- package/dist/elements/preupgrade/split-button.css +1 -1
- package/dist/elements/preupgrade/switch.css +1 -1
- package/dist/elements/preupgrade/tabs.css +1 -1
- package/dist/elements/preupgrade/text-field.css +2 -2
- package/dist/elements/preupgrade/timepicker.css +1 -1
- package/dist/elements/preupgrade/toolbar.css +1 -1
- package/dist/elements/preupgrade/tooltip.css +1 -1
- package/dist/elements/preupgrade/top-app-bar.css +1 -1
- package/dist/elements/preupgrade.css +2 -2
- package/dist/elements/snackbar.js +2 -0
- package/dist/elements/styles.js +15 -15
- package/dist/elements/text-field.js +2 -0
- package/dist/index.d.ts +78 -4
- package/dist/react/index.d.ts +106 -52
- package/dist/react/jsx.d.ts +49 -49
- package/dist/solid/index.d.ts +106 -52
- package/dist/solid/jsx.d.ts +51 -50
- package/dist/styles/badge.css +1 -1
- package/dist/styles/base-lite.css +2 -2
- package/dist/styles/base.css +2 -2
- package/dist/styles/bottom-app-bar.css +1 -1
- package/dist/styles/bottom-sheet.css +2 -2
- package/dist/styles/button-group.css +2 -2
- package/dist/styles/button.css +2 -2
- package/dist/styles/card.css +1 -1
- package/dist/styles/carousel.css +1 -1
- package/dist/styles/checkbox.css +1 -1
- package/dist/styles/chips.css +1 -1
- package/dist/styles/contrast.css +1 -1
- package/dist/styles/datepicker.css +2 -2
- package/dist/styles/dialog.css +2 -2
- package/dist/styles/divider.css +1 -1
- package/dist/styles/drawer.css +2 -2
- package/dist/styles/extended-fab.css +1 -1
- package/dist/styles/fab-menu.css +1 -1
- package/dist/styles/fab.css +1 -1
- package/dist/styles/icon-button.css +2 -2
- package/dist/styles/list.css +2 -2
- package/dist/styles/loading-indicator.css +1 -1
- package/dist/styles/menu.css +2 -2
- package/dist/styles/navigation-bar.css +1 -1
- package/dist/styles/navigation-rail.css +1 -1
- package/dist/styles/progress.css +1 -1
- package/dist/styles/radios.css +1 -1
- package/dist/styles/search.css +1 -1
- package/dist/styles/select.css +1 -1
- package/dist/styles/side-sheet.css +2 -2
- package/dist/styles/slider.css +1 -1
- package/dist/styles/snackbar.css +2 -2
- package/dist/styles/split-button.css +1 -1
- package/dist/styles/switch.css +1 -1
- package/dist/styles/tabs.css +1 -1
- package/dist/styles/text-field.css +2 -2
- package/dist/styles/timepicker.css +2 -2
- package/dist/styles/toolbar.css +2 -2
- package/dist/styles/tooltip.css +1 -1
- package/dist/styles/top-app-bar.css +1 -1
- package/dist/styles/typography.css +1 -1
- package/dist/styles/utilities.css +1 -1
- package/dist/styles.css +2 -2
- package/dist/themes/autumn-contrast.css +1 -1
- package/dist/themes/autumn.css +1 -1
- package/dist/themes/baseline-contrast.css +1 -1
- package/dist/themes/baseline.css +1 -1
- package/dist/themes/brownbeige-contrast.css +1 -1
- package/dist/themes/brownbeige.css +1 -1
- package/dist/themes/content-contrast.css +1 -1
- package/dist/themes/content.css +1 -1
- package/dist/themes/desert-contrast.css +1 -1
- package/dist/themes/desert.css +1 -1
- package/dist/themes/expressive-contrast.css +1 -1
- package/dist/themes/expressive.css +1 -1
- package/dist/themes/fidelity-contrast.css +1 -1
- package/dist/themes/fidelity.css +1 -1
- package/dist/themes/forest-contrast.css +1 -1
- package/dist/themes/forest.css +1 -1
- package/dist/themes/fruit-salad-contrast.css +1 -1
- package/dist/themes/fruit-salad.css +1 -1
- package/dist/themes/highcontrast-contrast.css +1 -1
- package/dist/themes/highcontrast.css +1 -1
- package/dist/themes/monochrome-contrast.css +1 -1
- package/dist/themes/monochrome.css +1 -1
- package/dist/themes/neutral-contrast.css +1 -1
- package/dist/themes/neutral.css +1 -1
- package/dist/themes/ocean-contrast.css +1 -1
- package/dist/themes/ocean.css +1 -1
- package/dist/themes/rainbow-contrast.css +1 -1
- package/dist/themes/rainbow.css +1 -1
- package/dist/themes/sageivory-contrast.css +1 -1
- package/dist/themes/sageivory.css +1 -1
- package/dist/themes/spring-contrast.css +1 -1
- package/dist/themes/spring.css +1 -1
- package/dist/themes/summer-contrast.css +1 -1
- package/dist/themes/summer.css +1 -1
- package/dist/themes/sunset-contrast.css +1 -1
- package/dist/themes/sunset.css +1 -1
- package/dist/themes/tealcaramel-contrast.css +1 -1
- package/dist/themes/tealcaramel.css +1 -1
- package/dist/themes/vibrant-contrast.css +1 -1
- package/dist/themes/vibrant.css +1 -1
- package/dist/vue/index.d.ts +192 -53
- package/package.json +5 -1
- package/src/styles/abstract/_functions.scss +22 -1
- package/src/styles/abstract/_variables.scss +0 -2
- package/src/styles/base/_tokens.scss +12 -0
- package/src/styles/components/_bottom-sheet.scss +1 -0
- package/src/styles/components/_button-group.scss +9 -5
- package/src/styles/components/_button.scss +9 -12
- package/src/styles/components/_datepicker.scss +1 -0
- package/src/styles/components/_dialog.scss +1 -0
- package/src/styles/components/_drawer.scss +33 -65
- package/src/styles/components/_icon-button.scss +32 -33
- package/src/styles/components/_list.scss +19 -5
- package/src/styles/components/_menu.scss +1 -0
- package/src/styles/components/_side-sheet.scss +1 -0
- package/src/styles/components/_snackbar.scss +1 -0
- package/src/styles/components/_text-field.scss +17 -109
- package/src/styles/components/_timepicker.scss +2 -1
- package/src/styles/components/_toolbar.scss +4 -4
- package/src/styles/elements/_button-group.scss +17 -4
- package/src/styles/elements/_button.scss +3 -2
- package/src/styles/elements/_drawer.scss +2 -1
- package/src/styles/elements/_field.scss +25 -14
- package/src/styles/elements/_icon-button.scss +8 -3
- package/src/styles/elements/_list.scss +3 -2
- package/src/styles/elements/_text-field.scss +71 -47
- package/dist/components/badge/badge.d.ts +0 -7
- package/dist/components/badge/types.d.ts +0 -152
- package/dist/components/bottom-app-bar/bottom-app-bar.d.ts +0 -12
- package/dist/components/bottom-app-bar/types.d.ts +0 -124
- package/dist/components/bottom-sheet/bottom-sheet.d.ts +0 -7
- package/dist/components/bottom-sheet/types.d.ts +0 -100
- package/dist/components/button/button.d.ts +0 -7
- package/dist/components/button-group/button-group.d.ts +0 -7
- package/dist/components/button-group/types.d.ts +0 -227
- package/dist/components/card/card.d.ts +0 -7
- package/dist/components/card/content.d.ts +0 -22
- package/dist/components/card/types.d.ts +0 -272
- package/dist/components/carousel/carousel.d.ts +0 -4
- package/dist/components/carousel/types.d.ts +0 -81
- package/dist/components/checkbox/checkbox.d.ts +0 -8
- package/dist/components/checkbox/types.d.ts +0 -199
- package/dist/components/chips/chips.d.ts +0 -7
- package/dist/components/chips/factories.d.ts +0 -9
- package/dist/components/chips/types.d.ts +0 -304
- package/dist/components/datepicker/datepicker.d.ts +0 -7
- package/dist/components/datepicker/types.d.ts +0 -300
- package/dist/components/datepicker/types.js +0 -17
- package/dist/components/dialog/dialog.d.ts +0 -8
- package/dist/components/dialog/types.d.ts +0 -311
- package/dist/components/divider/config.d.ts +0 -43
- package/dist/components/divider/divider.d.ts +0 -7
- package/dist/components/divider/types.d.ts +0 -43
- package/dist/components/drawer/drawer.d.ts +0 -7
- package/dist/components/drawer/types.d.ts +0 -179
- package/dist/components/extended-fab/extended-fab.d.ts +0 -7
- package/dist/components/extended-fab/types.d.ts +0 -208
- package/dist/components/fab/fab.d.ts +0 -7
- package/dist/components/fab/types.d.ts +0 -168
- package/dist/components/fab-menu/fab-menu.d.ts +0 -8
- package/dist/components/fab-menu/types.d.ts +0 -91
- package/dist/components/icon-button/icon-button.d.ts +0 -7
- package/dist/components/index.d.ts +0 -82
- package/dist/components/list/features/listbox.d.ts +0 -16
- package/dist/components/list/list.d.ts +0 -7
- package/dist/components/list/types.d.ts +0 -257
- package/dist/components/loading-indicator/features/renderer.d.ts +0 -28
- package/dist/components/loading-indicator/loading-indicator.d.ts +0 -7
- package/dist/components/loading-indicator/types.d.ts +0 -53
- package/dist/components/menu/menu.d.ts +0 -7
- package/dist/components/navigation-bar/navigation-bar.d.ts +0 -3
- package/dist/components/navigation-bar/types.d.ts +0 -59
- package/dist/components/navigation-rail/navigation-rail.d.ts +0 -3
- package/dist/components/navigation-rail/types.d.ts +0 -87
- package/dist/components/progress/progress.d.ts +0 -7
- package/dist/components/radios/radios.d.ts +0 -7
- package/dist/components/radios/types.d.ts +0 -144
- package/dist/components/search/search.d.ts +0 -7
- package/dist/components/search/types.d.ts +0 -235
- package/dist/components/select/select.d.ts +0 -7
- package/dist/components/select/types.d.ts +0 -232
- package/dist/components/side-sheet/side-sheet.d.ts +0 -7
- package/dist/components/side-sheet/types.d.ts +0 -91
- package/dist/components/slider/slider.d.ts +0 -7
- package/dist/components/slider/types.d.ts +0 -218
- package/dist/components/snackbar/snackbar.d.ts +0 -9
- package/dist/components/snackbar/types.d.ts +0 -180
- package/dist/components/split-button/split-button.d.ts +0 -7
- package/dist/components/switch/switch.d.ts +0 -7
- package/dist/components/switch/types.d.ts +0 -171
- package/dist/components/tabs/indicator.d.ts +0 -44
- package/dist/components/tabs/tab.d.ts +0 -7
- package/dist/components/tabs/tabs.d.ts +0 -7
- package/dist/components/tabs/types.d.ts +0 -304
- package/dist/components/tabs/utils.d.ts +0 -46
- package/dist/components/text-field/features/trailing-icon.d.ts +0 -54
- package/dist/components/text-field/text-field.d.ts +0 -7
- package/dist/components/text-field/types.d.ts +0 -261
- package/dist/components/timepicker/timepicker.d.ts +0 -3
- package/dist/components/timepicker/types.d.ts +0 -258
- package/dist/components/toolbar/toolbar.d.ts +0 -8
- package/dist/components/toolbar/types.d.ts +0 -129
- package/dist/components/tooltip/tooltip.d.ts +0 -7
- package/dist/components/tooltip/types.d.ts +0 -137
- package/dist/components/top-app-bar/top-app-bar.d.ts +0 -7
- package/dist/components/top-app-bar/types.d.ts +0 -80
- package/dist/core/canvas/animation.d.ts +0 -20
- package/dist/core/canvas/drawing.d.ts +0 -67
- package/dist/core/canvas/resize.d.ts +0 -8
- package/dist/core/canvas/utils.d.ts +0 -62
- package/dist/core/compose/base.d.ts +0 -18
- package/dist/core/compose/features/badge.d.ts +0 -27
- package/dist/core/compose/features/checkable.d.ts +0 -33
- package/dist/core/compose/features/debounce.d.ts +0 -45
- package/dist/core/compose/features/disabled.d.ts +0 -26
- package/dist/core/compose/features/events.d.ts +0 -31
- package/dist/core/compose/features/index.d.ts +0 -34
- package/dist/core/compose/features/input.d.ts +0 -54
- package/dist/core/compose/features/lifecycle.d.ts +0 -41
- package/dist/core/compose/features/position.d.ts +0 -36
- package/dist/core/compose/features/ripple.d.ts +0 -35
- package/dist/core/compose/features/size.d.ts +0 -12
- package/dist/core/compose/features/style.d.ts +0 -11
- package/dist/core/compose/features/textinput.d.ts +0 -66
- package/dist/core/compose/features/textlabel.d.ts +0 -34
- package/dist/core/compose/features/throttle.d.ts +0 -38
- package/dist/core/compose/features/track.d.ts +0 -24
- package/dist/core/compose/features/variant.d.ts +0 -12
- package/dist/core/compose/features/withEvents.d.ts +0 -27
- package/dist/core/compose/pipe.d.ts +0 -55
- package/dist/core/compose/utils/type-guards.d.ts +0 -17
- package/dist/core/config.d.ts +0 -72
- package/dist/core/dom/attributes.d.ts +0 -34
- package/dist/core/dom/classes.d.ts +0 -29
- package/dist/core/dom/events.d.ts +0 -43
- package/dist/core/dom/focus.d.ts +0 -15
- package/dist/core/dom/html.d.ts +0 -16
- package/dist/core/dom/layer.d.ts +0 -57
- package/dist/core/dom/roving.d.ts +0 -18
- package/dist/core/shapes/cubic.d.ts +0 -45
- package/dist/core/shapes/material.d.ts +0 -131
- package/dist/core/shapes/polygon.d.ts +0 -38
- package/dist/core/state/events.d.ts +0 -25
- package/dist/core/state/store.d.ts +0 -60
- package/dist/core/theme/shape.d.ts +0 -5
- package/dist/core/theme/tokens.d.ts +0 -67
- package/dist/core/utils/background.d.ts +0 -13
- package/dist/core/utils/color.d.ts +0 -6
- package/dist/core/utils/object.d.ts +0 -11
- package/dist/core/utils/performance.d.ts +0 -32
- package/dist/core/utils/theme.d.ts +0 -17
- package/dist/core/utils/url.d.ts +0 -6
- package/dist/elements/badge.d.ts +0 -57
- package/dist/elements/bottom-app-bar.d.ts +0 -66
- package/dist/elements/bottom-sheet.d.ts +0 -107
- package/dist/elements/button-group.d.ts +0 -142
- package/dist/elements/button.d.ts +0 -101
- package/dist/elements/card.d.ts +0 -69
- package/dist/elements/carousel.d.ts +0 -119
- package/dist/elements/checkbox.d.ts +0 -97
- package/dist/elements/chips.d.ts +0 -126
- package/dist/elements/datepicker.d.ts +0 -131
- package/dist/elements/dialog.d.ts +0 -101
- package/dist/elements/divider.d.ts +0 -52
- package/dist/elements/drawer.d.ts +0 -119
- package/dist/elements/extended-fab.d.ts +0 -97
- package/dist/elements/fab-menu.d.ts +0 -102
- package/dist/elements/fab.d.ts +0 -71
- package/dist/elements/list.d.ts +0 -127
- package/dist/elements/loading-indicator.d.ts +0 -47
- package/dist/elements/menu.d.ts +0 -144
- package/dist/elements/navigation-bar.d.ts +0 -104
- package/dist/elements/navigation-rail.d.ts +0 -145
- package/dist/elements/progress.d.ts +0 -87
- package/dist/elements/radios.d.ts +0 -92
- package/dist/elements/search.d.ts +0 -202
- package/dist/elements/select.d.ts +0 -119
- package/dist/elements/side-sheet.d.ts +0 -86
- package/dist/elements/slider.d.ts +0 -160
- package/dist/elements/snackbar.d.ts +0 -87
- package/dist/elements/split-button.d.ts +0 -87
- package/dist/elements/switch.d.ts +0 -98
- package/dist/elements/tabs.d.ts +0 -76
- package/dist/elements/text-field.d.ts +0 -170
- package/dist/elements/timepicker.d.ts +0 -148
- package/dist/elements/toolbar.d.ts +0 -98
- package/dist/elements/tooltip.d.ts +0 -75
- package/dist/elements/top-app-bar.d.ts +0 -60
- package/dist/react/badge.d.ts +0 -4
- package/dist/react/bottom-app-bar.d.ts +0 -5
- package/dist/react/bottom-sheet.d.ts +0 -4
- package/dist/react/button-group-item.d.ts +0 -3
- package/dist/react/button-group.d.ts +0 -7
- package/dist/react/button.d.ts +0 -5
- package/dist/react/card.d.ts +0 -4
- package/dist/react/carousel-item.d.ts +0 -3
- package/dist/react/carousel.d.ts +0 -4
- package/dist/react/checkbox.d.ts +0 -4
- package/dist/react/chip.d.ts +0 -3
- package/dist/react/chips.d.ts +0 -4
- package/dist/react/datepicker.d.ts +0 -4
- package/dist/react/dialog.d.ts +0 -7
- package/dist/react/divider.d.ts +0 -4
- package/dist/react/drawer-item.d.ts +0 -3
- package/dist/react/drawer.d.ts +0 -4
- package/dist/react/extended-fab.d.ts +0 -4
- package/dist/react/fab-menu-item.d.ts +0 -3
- package/dist/react/fab-menu.d.ts +0 -6
- package/dist/react/fab.d.ts +0 -4
- package/dist/react/icon-button.d.ts +0 -4
- package/dist/react/list-item.d.ts +0 -3
- package/dist/react/list.d.ts +0 -4
- package/dist/react/loading-indicator.d.ts +0 -4
- package/dist/react/menu-item.d.ts +0 -3
- package/dist/react/menu.d.ts +0 -4
- package/dist/react/navigation-bar-item.d.ts +0 -3
- package/dist/react/navigation-bar.d.ts +0 -4
- package/dist/react/navigation-rail-item.d.ts +0 -3
- package/dist/react/navigation-rail.d.ts +0 -4
- package/dist/react/progress.d.ts +0 -4
- package/dist/react/radio.d.ts +0 -3
- package/dist/react/radios.d.ts +0 -4
- package/dist/react/search-suggestion.d.ts +0 -3
- package/dist/react/search.d.ts +0 -4
- package/dist/react/select-option.d.ts +0 -3
- package/dist/react/select.d.ts +0 -6
- package/dist/react/side-sheet.d.ts +0 -4
- package/dist/react/slider.d.ts +0 -4
- package/dist/react/snackbar.d.ts +0 -7
- package/dist/react/split-button.d.ts +0 -7
- package/dist/react/switch.d.ts +0 -4
- package/dist/react/tab.d.ts +0 -3
- package/dist/react/tabs.d.ts +0 -7
- package/dist/react/text-field.d.ts +0 -4
- package/dist/react/timepicker.d.ts +0 -4
- package/dist/react/toolbar.d.ts +0 -5
- package/dist/react/tooltip.d.ts +0 -4
- package/dist/react/top-app-bar.d.ts +0 -4
- package/dist/solid/badge.d.ts +0 -4
- package/dist/solid/bottom-app-bar.d.ts +0 -5
- package/dist/solid/bottom-sheet.d.ts +0 -4
- package/dist/solid/button-group-item.d.ts +0 -3
- package/dist/solid/button-group.d.ts +0 -7
- package/dist/solid/button.d.ts +0 -5
- package/dist/solid/card.d.ts +0 -4
- package/dist/solid/carousel-item.d.ts +0 -3
- package/dist/solid/carousel.d.ts +0 -4
- package/dist/solid/checkbox.d.ts +0 -4
- package/dist/solid/chip.d.ts +0 -3
- package/dist/solid/chips.d.ts +0 -4
- package/dist/solid/datepicker.d.ts +0 -4
- package/dist/solid/dialog.d.ts +0 -7
- package/dist/solid/divider.d.ts +0 -4
- package/dist/solid/drawer-item.d.ts +0 -3
- package/dist/solid/drawer.d.ts +0 -4
- package/dist/solid/extended-fab.d.ts +0 -4
- package/dist/solid/fab-menu-item.d.ts +0 -3
- package/dist/solid/fab-menu.d.ts +0 -6
- package/dist/solid/fab.d.ts +0 -4
- package/dist/solid/icon-button.d.ts +0 -4
- package/dist/solid/list-item.d.ts +0 -3
- package/dist/solid/list.d.ts +0 -4
- package/dist/solid/loading-indicator.d.ts +0 -4
- package/dist/solid/menu-item.d.ts +0 -3
- package/dist/solid/menu.d.ts +0 -4
- package/dist/solid/navigation-bar-item.d.ts +0 -3
- package/dist/solid/navigation-bar.d.ts +0 -4
- package/dist/solid/navigation-rail-item.d.ts +0 -3
- package/dist/solid/navigation-rail.d.ts +0 -4
- package/dist/solid/progress.d.ts +0 -4
- package/dist/solid/radio.d.ts +0 -3
- package/dist/solid/radios.d.ts +0 -4
- package/dist/solid/search-suggestion.d.ts +0 -3
- package/dist/solid/search.d.ts +0 -4
- package/dist/solid/select-option.d.ts +0 -3
- package/dist/solid/select.d.ts +0 -6
- package/dist/solid/side-sheet.d.ts +0 -4
- package/dist/solid/slider.d.ts +0 -4
- package/dist/solid/snackbar.d.ts +0 -7
- package/dist/solid/split-button.d.ts +0 -7
- package/dist/solid/switch.d.ts +0 -4
- package/dist/solid/tab.d.ts +0 -3
- package/dist/solid/tabs.d.ts +0 -7
- package/dist/solid/text-field.d.ts +0 -4
- package/dist/solid/timepicker.d.ts +0 -4
- package/dist/solid/toolbar.d.ts +0 -5
- package/dist/solid/tooltip.d.ts +0 -4
- package/dist/solid/top-app-bar.d.ts +0 -4
- package/dist/vue/badge.d.ts +0 -4
- package/dist/vue/bottom-app-bar.d.ts +0 -5
- package/dist/vue/bottom-sheet.d.ts +0 -4
- package/dist/vue/button-group-item.d.ts +0 -3
- package/dist/vue/button-group.d.ts +0 -7
- package/dist/vue/button.d.ts +0 -5
- package/dist/vue/card.d.ts +0 -4
- package/dist/vue/carousel-item.d.ts +0 -3
- package/dist/vue/carousel.d.ts +0 -4
- package/dist/vue/checkbox.d.ts +0 -4
- package/dist/vue/chip.d.ts +0 -3
- package/dist/vue/chips.d.ts +0 -4
- package/dist/vue/create.d.ts +0 -73
- package/dist/vue/datepicker.d.ts +0 -4
- package/dist/vue/dialog.d.ts +0 -7
- package/dist/vue/divider.d.ts +0 -4
- package/dist/vue/drawer-item.d.ts +0 -3
- package/dist/vue/drawer.d.ts +0 -4
- package/dist/vue/extended-fab.d.ts +0 -4
- package/dist/vue/fab-menu-item.d.ts +0 -3
- package/dist/vue/fab-menu.d.ts +0 -6
- package/dist/vue/fab.d.ts +0 -4
- package/dist/vue/icon-button.d.ts +0 -4
- package/dist/vue/list-item.d.ts +0 -3
- package/dist/vue/list.d.ts +0 -4
- package/dist/vue/loading-indicator.d.ts +0 -4
- package/dist/vue/menu-item.d.ts +0 -3
- package/dist/vue/menu.d.ts +0 -4
- package/dist/vue/navigation-bar-item.d.ts +0 -3
- package/dist/vue/navigation-bar.d.ts +0 -4
- package/dist/vue/navigation-rail-item.d.ts +0 -3
- package/dist/vue/navigation-rail.d.ts +0 -4
- package/dist/vue/progress.d.ts +0 -4
- package/dist/vue/radio.d.ts +0 -3
- package/dist/vue/radios.d.ts +0 -4
- package/dist/vue/search-suggestion.d.ts +0 -3
- package/dist/vue/search.d.ts +0 -4
- package/dist/vue/select-option.d.ts +0 -3
- package/dist/vue/select.d.ts +0 -6
- package/dist/vue/side-sheet.d.ts +0 -4
- package/dist/vue/slider.d.ts +0 -4
- package/dist/vue/snackbar.d.ts +0 -7
- package/dist/vue/split-button.d.ts +0 -7
- package/dist/vue/switch.d.ts +0 -4
- package/dist/vue/tab.d.ts +0 -3
- package/dist/vue/tabs.d.ts +0 -7
- package/dist/vue/text-field.d.ts +0 -4
- package/dist/vue/timepicker.d.ts +0 -4
- package/dist/vue/toolbar.d.ts +0 -5
- package/dist/vue/tooltip.d.ts +0 -4
- package/dist/vue/top-app-bar.d.ts +0 -4
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
import type { TouchEvents } from "../../core/utils/mobile.js";
|
|
2
|
-
import type { EventCallback } from "../../core/state/emitter.js";
|
|
3
|
-
/** Checkbox label position types - controls where the label appears */
|
|
4
|
-
export type CheckboxLabelPosition = "start" | "end";
|
|
5
|
-
/** Configuration interface for the Checkbox component */
|
|
6
|
-
export interface CheckboxConfig {
|
|
7
|
-
/** Input name attribute, used for form submission */
|
|
8
|
-
name?: string;
|
|
9
|
-
/**
|
|
10
|
-
* Initial checked state
|
|
11
|
-
* @default false
|
|
12
|
-
*/
|
|
13
|
-
checked?: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* Initial indeterminate state (partially checked)
|
|
16
|
-
* @default false
|
|
17
|
-
*/
|
|
18
|
-
indeterminate?: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Whether input is required for form validation
|
|
21
|
-
* @default false
|
|
22
|
-
*/
|
|
23
|
-
required?: boolean;
|
|
24
|
-
/**
|
|
25
|
-
* Whether checkbox is disabled (non-interactive)
|
|
26
|
-
* @default false
|
|
27
|
-
*/
|
|
28
|
-
disabled?: boolean;
|
|
29
|
-
/** Input value attribute, used for form submission */
|
|
30
|
-
value?: string;
|
|
31
|
-
/** Label text displayed next to the checkbox */
|
|
32
|
-
label?: string;
|
|
33
|
-
/**
|
|
34
|
-
* Label position (start/end)
|
|
35
|
-
* @default "end"
|
|
36
|
-
*/
|
|
37
|
-
labelPosition?: CheckboxLabelPosition | string;
|
|
38
|
-
/**
|
|
39
|
-
* Error state: the outline, the selected container and the state layers take the error role, and the input is marked `aria-invalid`.
|
|
40
|
-
* @default false
|
|
41
|
-
*/
|
|
42
|
-
error?: boolean;
|
|
43
|
-
/** Accessible name when there is no visible label */
|
|
44
|
-
ariaLabel?: string;
|
|
45
|
-
/**
|
|
46
|
-
* Put ariaLabel only on the input/handle, omitting the generated wrapper label.
|
|
47
|
-
* @default false
|
|
48
|
-
*/
|
|
49
|
-
controlLabelOnly?: boolean;
|
|
50
|
-
/** Whether Enter toggles as Space does. */
|
|
51
|
-
enterToggles?: boolean;
|
|
52
|
-
/** Additional CSS classes to apply to the checkbox */
|
|
53
|
-
class?: string;
|
|
54
|
-
/**
|
|
55
|
-
* CSS class prefix for all checkbox classes
|
|
56
|
-
* @default "mtrl"
|
|
57
|
-
*/
|
|
58
|
-
prefix?: string;
|
|
59
|
-
/**
|
|
60
|
-
* Component name used in CSS class generation
|
|
61
|
-
* @default "checkbox"
|
|
62
|
-
*/
|
|
63
|
-
componentName?: string;
|
|
64
|
-
}
|
|
65
|
-
/** A checked-state change from native input activation. */
|
|
66
|
-
export interface CheckboxChangePayload {
|
|
67
|
-
/** The new checked state. */
|
|
68
|
-
checked: boolean;
|
|
69
|
-
/** The checked model value, matching getValue() at dispatch. */
|
|
70
|
-
value: boolean;
|
|
71
|
-
/** The input's HTML value attribute, used for native form submission. */
|
|
72
|
-
valueAttribute: string;
|
|
73
|
-
/** The original native change event, when supplied by the emitter. */
|
|
74
|
-
nativeEvent?: Event;
|
|
75
|
-
}
|
|
76
|
-
/** Events emitted by the checkbox API. */
|
|
77
|
-
export interface CheckboxEvents extends TouchEvents {
|
|
78
|
-
change: (payload: CheckboxChangePayload) => void;
|
|
79
|
-
}
|
|
80
|
-
/** Checkbox component interface */
|
|
81
|
-
export interface CheckboxComponent {
|
|
82
|
-
/** The checkbox's root DOM element (container) */
|
|
83
|
-
element: HTMLElement;
|
|
84
|
-
/** The actual input element (native checkbox) */
|
|
85
|
-
input: HTMLInputElement;
|
|
86
|
-
/** Gets the checkbox's checked state (boolean) for form compatibility */
|
|
87
|
-
getValue: () => boolean;
|
|
88
|
-
/**
|
|
89
|
-
* Sets the checkbox's checked state.
|
|
90
|
-
* @param value
|
|
91
|
-
*/
|
|
92
|
-
setValue: (value: boolean | string) => CheckboxComponent;
|
|
93
|
-
/** Gets the HTML value attribute (rarely needed) */
|
|
94
|
-
getValueAttribute: () => string;
|
|
95
|
-
/**
|
|
96
|
-
* Sets the HTML value attribute (rarely needed)
|
|
97
|
-
* @param value
|
|
98
|
-
*/
|
|
99
|
-
setValueAttribute: (value: string) => CheckboxComponent;
|
|
100
|
-
/** Checks the checkbox (sets checked=true). */
|
|
101
|
-
check: () => CheckboxComponent;
|
|
102
|
-
/** Unchecks the checkbox (sets checked=false). */
|
|
103
|
-
uncheck: () => CheckboxComponent;
|
|
104
|
-
/** Toggles the checkbox's checked state. */
|
|
105
|
-
toggle: () => CheckboxComponent;
|
|
106
|
-
/** Checks if the checkbox is currently checked */
|
|
107
|
-
isChecked: () => boolean;
|
|
108
|
-
/**
|
|
109
|
-
* Sets the checkbox's indeterminate state
|
|
110
|
-
* @param state
|
|
111
|
-
*/
|
|
112
|
-
setIndeterminate: (state: boolean) => CheckboxComponent;
|
|
113
|
-
/**
|
|
114
|
-
* Sets or clears the error state
|
|
115
|
-
* @param error
|
|
116
|
-
*/
|
|
117
|
-
setError: (error: boolean) => CheckboxComponent;
|
|
118
|
-
/**
|
|
119
|
-
* Sets the checkbox's label text
|
|
120
|
-
* @param text
|
|
121
|
-
*/
|
|
122
|
-
setLabel: (text: string) => CheckboxComponent;
|
|
123
|
-
/** Gets the checkbox's current label text */
|
|
124
|
-
getLabel: () => string;
|
|
125
|
-
/**
|
|
126
|
-
* Adds an event listener to the checkbox
|
|
127
|
-
* @param event
|
|
128
|
-
* @param handler
|
|
129
|
-
*/
|
|
130
|
-
on: <K extends keyof CheckboxEvents>(event: K, handler: CheckboxEvents[K]) => CheckboxComponent;
|
|
131
|
-
/**
|
|
132
|
-
* Removes an event listener from the checkbox
|
|
133
|
-
* @param event
|
|
134
|
-
* @param handler
|
|
135
|
-
*/
|
|
136
|
-
off: <K extends keyof CheckboxEvents>(event: K, handler: CheckboxEvents[K]) => CheckboxComponent;
|
|
137
|
-
/** Enables the checkbox, making it interactive */
|
|
138
|
-
enable: () => CheckboxComponent;
|
|
139
|
-
/** Disables the checkbox, making it non-interactive */
|
|
140
|
-
disable: () => CheckboxComponent;
|
|
141
|
-
/** Whether the checkbox is disabled */
|
|
142
|
-
isDisabled: () => boolean;
|
|
143
|
-
/** Destroys the checkbox component and cleans up resources */
|
|
144
|
-
destroy: () => void;
|
|
145
|
-
}
|
|
146
|
-
/** API options interface for internal use */
|
|
147
|
-
export interface ApiOptions {
|
|
148
|
-
disabled: {
|
|
149
|
-
enable: () => void;
|
|
150
|
-
disable: () => void;
|
|
151
|
-
isDisabled: () => boolean;
|
|
152
|
-
};
|
|
153
|
-
lifecycle: {
|
|
154
|
-
destroy: () => void;
|
|
155
|
-
};
|
|
156
|
-
checkable: {
|
|
157
|
-
check: () => void;
|
|
158
|
-
uncheck: () => void;
|
|
159
|
-
toggle: () => void;
|
|
160
|
-
isChecked: () => boolean;
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
/** Base component interface for internal composition */
|
|
164
|
-
export interface BaseComponent {
|
|
165
|
-
element: HTMLElement;
|
|
166
|
-
input?: HTMLInputElement;
|
|
167
|
-
getValue?: () => boolean;
|
|
168
|
-
setValue?: (value: boolean) => void;
|
|
169
|
-
setIndeterminate?: (state: boolean) => void;
|
|
170
|
-
setError?: (error: boolean) => void;
|
|
171
|
-
label?: {
|
|
172
|
-
setText: (content: string) => void;
|
|
173
|
-
getText: () => string;
|
|
174
|
-
};
|
|
175
|
-
on?: (event: string, handler: EventCallback) => this;
|
|
176
|
-
off?: (event: string, handler: EventCallback) => this;
|
|
177
|
-
disabled?: {
|
|
178
|
-
enable: () => void;
|
|
179
|
-
disable: () => void;
|
|
180
|
-
isDisabled: () => boolean;
|
|
181
|
-
};
|
|
182
|
-
lifecycle?: {
|
|
183
|
-
destroy: () => void;
|
|
184
|
-
};
|
|
185
|
-
checkable?: {
|
|
186
|
-
check: () => void;
|
|
187
|
-
uncheck: () => void;
|
|
188
|
-
toggle: () => void;
|
|
189
|
-
isChecked: () => boolean;
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
/** Component as it reaches the API step of the pipeline. */
|
|
193
|
-
export type ApiComponent = BaseComponent & Required<Pick<BaseComponent, "checkable" | "disabled" | "lifecycle">>;
|
|
194
|
-
/** Registers CheckboxConfig with the global defaults map, so `setComponentDefaults("checkbox", ...)` is typed without core importing anything from this component. */
|
|
195
|
-
declare module "../../core/config/global" {
|
|
196
|
-
interface ComponentConfigMap {
|
|
197
|
-
checkbox?: Partial<CheckboxConfig>;
|
|
198
|
-
}
|
|
199
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ChipsConfig, ChipsComponent } from "./types.js";
|
|
2
|
-
/**
|
|
3
|
-
* Creates a chips container for grouping related chips Chips follows a clear architectural pattern: 1.
|
|
4
|
-
* @param config
|
|
5
|
-
*/
|
|
6
|
-
declare const createChips: (config?: ChipsConfig) => ChipsComponent;
|
|
7
|
-
export default createChips;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { AssistChipConfig, FilterChipConfig, InputChipConfig, SuggestionChipConfig, ChipComponent } from "./types.js";
|
|
2
|
-
/** Action chip; flat and outlined by default. */
|
|
3
|
-
export declare const createAssistChip: (config: AssistChipConfig) => ChipComponent;
|
|
4
|
-
/** Toggleable filter; selected chips show a checkmark. */
|
|
5
|
-
export declare const createFilterChip: (config: FilterChipConfig) => ChipComponent;
|
|
6
|
-
/** Selectable input token with an optional independent removal action. */
|
|
7
|
-
export declare const createInputChip: (config: InputChipConfig) => ChipComponent;
|
|
8
|
-
/** Suggested action; flat and outlined by default. */
|
|
9
|
-
export declare const createSuggestionChip: (config: SuggestionChipConfig) => ChipComponent;
|
|
@@ -1,304 +0,0 @@
|
|
|
1
|
-
import type { EventCallback } from "../../core/state/emitter.js";
|
|
2
|
-
import type { ForwardedEventPayload } from "../../core/dom/index.js";
|
|
3
|
-
export type ChipType = "assist" | "filter" | "input" | "suggestion";
|
|
4
|
-
/** Shared chip options. */
|
|
5
|
-
export interface ChipConfig {
|
|
6
|
-
type?: ChipType;
|
|
7
|
-
label?: string;
|
|
8
|
-
/** Accessible name for the primary focus target. */
|
|
9
|
-
ariaLabel?: string;
|
|
10
|
-
value?: string;
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
/** In a single-select set, selecting this chip replaces the previous selection; the last selected config wins. */
|
|
13
|
-
selected?: boolean;
|
|
14
|
-
/** Elevated styling is supported by assist, filter and suggestion chips. */
|
|
15
|
-
elevated?: boolean;
|
|
16
|
-
/** Markup (HTML). */
|
|
17
|
-
leadingIcon?: string;
|
|
18
|
-
/** Markup (HTML). */
|
|
19
|
-
icon?: string;
|
|
20
|
-
/** Markup (HTML). */
|
|
21
|
-
trailingIcon?: string;
|
|
22
|
-
/** Decorative avatar for an input chip; takes precedence over leadingIcon. */
|
|
23
|
-
avatar?: string;
|
|
24
|
-
/** Called when an input chip is removed, from its remove button or with Backspace or Delete. */
|
|
25
|
-
onRemove?: ChipEvents["remove"];
|
|
26
|
-
removeLabel?: string;
|
|
27
|
-
/** Filter chips: gives the trailing icon its own button, which calls this (the m3.material.io chips' trailing icon that "can be used to open a menu or remove the chip"). */
|
|
28
|
-
onTrailingClick?: ChipEvents["trailing"];
|
|
29
|
-
/** The trailing button's accessible name; "{label} options" for a menu, "Remove {label}" otherwise. */
|
|
30
|
-
trailingLabel?: string;
|
|
31
|
-
/** The trailing button opens a menu: aria-haspopup="menu", and a drop-down arrow unless trailingIcon is set. */
|
|
32
|
-
trailingMenu?: boolean;
|
|
33
|
-
/** Same payload as a `click` listener. */
|
|
34
|
-
onClick?: ChipEvents["click"];
|
|
35
|
-
/** Same payload as a `change` listener: `{ selected, chip, value }`. */
|
|
36
|
-
onChange?: ChipEvents["change"];
|
|
37
|
-
/** Called with the chip when the user toggles a selectable chip, not when a `selectionRequired` set refuses the click. */
|
|
38
|
-
onSelect?: (chip: ChipComponent) => void;
|
|
39
|
-
class?: string;
|
|
40
|
-
prefix?: string;
|
|
41
|
-
componentName?: string;
|
|
42
|
-
ripple?: boolean;
|
|
43
|
-
}
|
|
44
|
-
export interface ChipOptions extends ChipConfig {
|
|
45
|
-
/** Selection belongs to the chips container. */
|
|
46
|
-
managedSelection?: boolean;
|
|
47
|
-
/** Notify the owning set when a chip becomes selected. */
|
|
48
|
-
onSelected?: (chip: ChipComponent) => void;
|
|
49
|
-
/** The owning set removes the chip, once its `remove` listeners have run. */
|
|
50
|
-
onRemoved?: (chip: ChipComponent) => void;
|
|
51
|
-
/** The chip is a cell of a chip set's grid: the root is a `gridcell`, and a one-action chip's cell is its focus target. */
|
|
52
|
-
cell?: boolean;
|
|
53
|
-
}
|
|
54
|
-
type NamedChipConfig = Omit<ChipConfig, "type" | "text" | "selected" | "avatar" | "onRemove" | "removeLabel" | "onChange" | "onSelect" | "onTrailingClick" | "trailingLabel" | "trailingMenu"> & {
|
|
55
|
-
label: string;
|
|
56
|
-
};
|
|
57
|
-
export type AssistChipConfig = NamedChipConfig;
|
|
58
|
-
export type SuggestionChipConfig = Omit<NamedChipConfig, "trailingIcon">;
|
|
59
|
-
export type FilterChipConfig = NamedChipConfig & Pick<ChipConfig, "selected" | "onChange" | "onSelect" | "onTrailingClick" | "trailingLabel" | "trailingMenu">;
|
|
60
|
-
export type InputChipConfig = Omit<FilterChipConfig, "elevated" | "onTrailingClick" | "trailingLabel" | "trailingMenu"> & Pick<ChipConfig, "avatar" | "onRemove" | "removeLabel">;
|
|
61
|
-
export interface ChipChangePayload {
|
|
62
|
-
selected: boolean;
|
|
63
|
-
chip: ChipComponent;
|
|
64
|
-
/** The chip's value, as `getValue()` returns it; every model event carries it */
|
|
65
|
-
value: string | null;
|
|
66
|
-
}
|
|
67
|
-
export interface ChipEvents {
|
|
68
|
-
click: (payload: ForwardedEventPayload<MouseEvent, HTMLElement>) => void;
|
|
69
|
-
keydown: (payload: ForwardedEventPayload<KeyboardEvent, HTMLElement>) => void;
|
|
70
|
-
focus: (payload: ForwardedEventPayload<FocusEvent, HTMLElement>) => void;
|
|
71
|
-
blur: (payload: ForwardedEventPayload<FocusEvent, HTMLElement>) => void;
|
|
72
|
-
change: (payload: ChipChangePayload) => void;
|
|
73
|
-
remove: (chip: ChipComponent) => void;
|
|
74
|
-
/** A filter chip's trailing button was activated. */
|
|
75
|
-
trailing: (chip: ChipComponent) => void;
|
|
76
|
-
}
|
|
77
|
-
/** Shared API. */
|
|
78
|
-
export interface ChipComponent {
|
|
79
|
-
element: HTMLElement;
|
|
80
|
-
/** Native primary action. */
|
|
81
|
-
action: HTMLButtonElement;
|
|
82
|
-
/** A filter chip's trailing button, when it has one (`onTrailingClick`): anchor a menu to it and keep its aria-expanded in step. */
|
|
83
|
-
trailingAction?: HTMLButtonElement;
|
|
84
|
-
getType: () => ChipType;
|
|
85
|
-
getValue: () => string | null;
|
|
86
|
-
setValue: (value: string) => ChipComponent;
|
|
87
|
-
enable: () => ChipComponent;
|
|
88
|
-
disable: () => ChipComponent;
|
|
89
|
-
isDisabled: () => boolean;
|
|
90
|
-
setLabel: (label: string) => ChipComponent;
|
|
91
|
-
getLabel: () => string;
|
|
92
|
-
/** Alias of setLabel for chips-container consumers. */
|
|
93
|
-
setText: (text: string) => ChipComponent;
|
|
94
|
-
getText: () => string;
|
|
95
|
-
setIcon: (icon: string) => ChipComponent;
|
|
96
|
-
getIcon: () => string;
|
|
97
|
-
setLeadingIcon: (icon: string) => ChipComponent;
|
|
98
|
-
setTrailingIcon: (icon: string) => ChipComponent;
|
|
99
|
-
isSelected: () => boolean;
|
|
100
|
-
/** Selects or deselects this chip silently. */
|
|
101
|
-
setSelected: (selected: boolean) => ChipComponent;
|
|
102
|
-
toggleSelected: () => ChipComponent;
|
|
103
|
-
focus: () => ChipComponent;
|
|
104
|
-
destroy: () => void;
|
|
105
|
-
on: <K extends keyof ChipEvents>(event: K, handler: ChipEvents[K]) => ChipComponent;
|
|
106
|
-
off: <K extends keyof ChipEvents>(event: K, handler: ChipEvents[K]) => ChipComponent;
|
|
107
|
-
addClass: (...classes: string[]) => ChipComponent;
|
|
108
|
-
}
|
|
109
|
-
/** Configuration interface for the Chips component */
|
|
110
|
-
export interface ChipsConfig {
|
|
111
|
-
/**
|
|
112
|
-
* Array of chip configurations to initialize
|
|
113
|
-
* @default []
|
|
114
|
-
*/
|
|
115
|
-
chips?: ChipConfig[];
|
|
116
|
-
/**
|
|
117
|
-
* Whether the chip set is horizontally scrollable
|
|
118
|
-
* @default false
|
|
119
|
-
*/
|
|
120
|
-
scrollable?: boolean;
|
|
121
|
-
/**
|
|
122
|
-
* Whether the chip set is vertically stacked
|
|
123
|
-
* @default false
|
|
124
|
-
*/
|
|
125
|
-
vertical?: boolean;
|
|
126
|
-
/** Additional CSS classes */
|
|
127
|
-
class?: string;
|
|
128
|
-
/** CSS selector for filtering behavior */
|
|
129
|
-
selector?: string | null;
|
|
130
|
-
/**
|
|
131
|
-
* Whether several chips can be selected at once.
|
|
132
|
-
* @default true
|
|
133
|
-
*/
|
|
134
|
-
multiSelect?: boolean;
|
|
135
|
-
/**
|
|
136
|
-
* Whether the set keeps at least one chip selected: deselecting the last selected chip is refused, and a refused click emits no `change`, on the chip or on the set.
|
|
137
|
-
* @default false
|
|
138
|
-
*/
|
|
139
|
-
selectionRequired?: boolean;
|
|
140
|
-
/** Same payload as an `on("change")` listener. */
|
|
141
|
-
onChange?: ChipsEvents["change"];
|
|
142
|
-
/**
|
|
143
|
-
* Component prefix for class names
|
|
144
|
-
* @default 'mtrl'
|
|
145
|
-
*/
|
|
146
|
-
prefix?: string;
|
|
147
|
-
/** Label text for the chips container */
|
|
148
|
-
label?: string;
|
|
149
|
-
/**
|
|
150
|
-
* Position of the label (start or end)
|
|
151
|
-
* @default 'start'
|
|
152
|
-
*/
|
|
153
|
-
labelPosition?: "start" | "end";
|
|
154
|
-
/** Schema definition for the component structure */
|
|
155
|
-
schema?: unknown;
|
|
156
|
-
/** Event handlers for component events */
|
|
157
|
-
on?: Partial<ChipsEvents>;
|
|
158
|
-
}
|
|
159
|
-
/** Chips component interface */
|
|
160
|
-
/** What a chips feature needs from the component it is handed. */
|
|
161
|
-
export interface ChipsFeatureComponent {
|
|
162
|
-
element: HTMLElement;
|
|
163
|
-
getClass: (name: string) => string;
|
|
164
|
-
emit?: (event: string, data: unknown) => unknown;
|
|
165
|
-
/** withDom builds this; the controller appends chips to it */
|
|
166
|
-
chipContainer?: HTMLElement;
|
|
167
|
-
/** withChipItems keeps the live chips here. */
|
|
168
|
-
chipInstances: ChipComponent[];
|
|
169
|
-
/** withContainer installs this whole, so the members are not optional in it */
|
|
170
|
-
layout?: {
|
|
171
|
-
isVertical: () => boolean;
|
|
172
|
-
isScrollable: () => boolean;
|
|
173
|
-
};
|
|
174
|
-
resources?: import("../../core/compose/cleanup.js").CleanupScope;
|
|
175
|
-
lifecycle?: {
|
|
176
|
-
destroy: () => void;
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
/** The handlers the chips controller keeps per event name. */
|
|
180
|
-
export type ChipsEventListeners = Record<string, EventCallback[]>;
|
|
181
|
-
/** The payload of the chips set's `change`. */
|
|
182
|
-
export interface ChipsChangeEvent {
|
|
183
|
-
/** The selection in the `value` property's shape: a string or null for a single-select set, an array for a multi-select one. */
|
|
184
|
-
value: string | string[] | null;
|
|
185
|
-
/** The values of the selected chips, in chip order (a chip without a value gives null) */
|
|
186
|
-
selected: (string | null)[];
|
|
187
|
-
/** The value of the chip the user toggled; null for a change made by a method */
|
|
188
|
-
changed: string | null;
|
|
189
|
-
}
|
|
190
|
-
/** A chip joined the set; `value` is the selection after insertion. */
|
|
191
|
-
export interface ChipsAddEvent {
|
|
192
|
-
value: string | string[] | null;
|
|
193
|
-
chip: ChipComponent;
|
|
194
|
-
}
|
|
195
|
-
/** A chip left the set; `value` is the remaining selection. */
|
|
196
|
-
export interface ChipsRemoveEvent extends ChipsAddEvent {
|
|
197
|
-
/** The selection after removal, in the same shape as the set's `getValue()`. */
|
|
198
|
-
value: string | string[] | null;
|
|
199
|
-
/** The removed chip's value, captured before destruction. */
|
|
200
|
-
chipValue: string | null;
|
|
201
|
-
}
|
|
202
|
-
/** Events emitted by the chips container's controller. */
|
|
203
|
-
export interface ChipsEvents {
|
|
204
|
-
/** The selection after the change. */
|
|
205
|
-
change: (event: ChipsChangeEvent) => void;
|
|
206
|
-
/** The newly created chip and the selection after insertion. */
|
|
207
|
-
add: (event: ChipsAddEvent) => void;
|
|
208
|
-
/** The removed chip and the selection after removal. */
|
|
209
|
-
remove: (event: ChipsRemoveEvent) => void;
|
|
210
|
-
}
|
|
211
|
-
export interface ChipsComponent {
|
|
212
|
-
/** The chips container's DOM element */
|
|
213
|
-
element: HTMLElement;
|
|
214
|
-
/**
|
|
215
|
-
* Adds a new chip to the chips container.
|
|
216
|
-
* @param chipConfig
|
|
217
|
-
*/
|
|
218
|
-
addChip: (chipConfig: ChipConfig) => ChipsComponent;
|
|
219
|
-
/**
|
|
220
|
-
* Removes a chip from the chips container
|
|
221
|
-
* @param chipOrIndex
|
|
222
|
-
*/
|
|
223
|
-
removeChip: (chipOrIndex: ChipComponent | number) => ChipsComponent;
|
|
224
|
-
/** Gets all chip instances in the set */
|
|
225
|
-
getChips: () => ChipComponent[];
|
|
226
|
-
/** Gets currently selected chips */
|
|
227
|
-
getSelectedChips: () => ChipComponent[];
|
|
228
|
-
/** Gets the values of selected chips */
|
|
229
|
-
getSelectedValues: () => (string | null)[];
|
|
230
|
-
/** Gets the current value - form field compatibility */
|
|
231
|
-
getValue: () => string | string[] | null;
|
|
232
|
-
/**
|
|
233
|
-
* Sets the value by selecting chips by value, without a change event - form field compatibility
|
|
234
|
-
* @param values
|
|
235
|
-
*/
|
|
236
|
-
setValue: (values: string | string[] | null | undefined) => ChipsComponent;
|
|
237
|
-
/**
|
|
238
|
-
* Selects chips by their values
|
|
239
|
-
* @param values
|
|
240
|
-
* @param triggerEvent
|
|
241
|
-
*/
|
|
242
|
-
selectByValue: (values: string | string[], triggerEvent?: boolean) => ChipsComponent;
|
|
243
|
-
/** Clears all selections. */
|
|
244
|
-
clearSelection: () => ChipsComponent;
|
|
245
|
-
/**
|
|
246
|
-
* Sets the scrollable state of the chips container
|
|
247
|
-
* @param isScrollable
|
|
248
|
-
*/
|
|
249
|
-
setScrollable: (isScrollable: boolean) => ChipsComponent;
|
|
250
|
-
/**
|
|
251
|
-
* Sets the vertical layout state
|
|
252
|
-
* @param isVertical
|
|
253
|
-
*/
|
|
254
|
-
setVertical: (isVertical: boolean) => ChipsComponent;
|
|
255
|
-
/**
|
|
256
|
-
* Sets the label text
|
|
257
|
-
* @param text
|
|
258
|
-
*/
|
|
259
|
-
setLabel: (text: string) => ChipsComponent;
|
|
260
|
-
/** Gets the label text */
|
|
261
|
-
getLabel: () => string;
|
|
262
|
-
/**
|
|
263
|
-
* Sets the label position
|
|
264
|
-
* @param position
|
|
265
|
-
*/
|
|
266
|
-
setLabelPosition: (position: "start" | "end") => ChipsComponent;
|
|
267
|
-
/** Gets the label position */
|
|
268
|
-
getLabelPosition: () => string;
|
|
269
|
-
/**
|
|
270
|
-
* Scrolls to a specific chip.
|
|
271
|
-
* @param chipOrIndex
|
|
272
|
-
*/
|
|
273
|
-
scrollToChip: (chipOrIndex: ChipComponent | number) => ChipsComponent;
|
|
274
|
-
/** Enables keyboard navigation between chips in the set */
|
|
275
|
-
enableKeyboardNavigation: () => ChipsComponent;
|
|
276
|
-
/** Turns keyboard navigation between the chips on and off: while disabled, */
|
|
277
|
-
keyboard: {
|
|
278
|
-
/** Moves focus with the arrows, Home and End again */
|
|
279
|
-
enable: () => void;
|
|
280
|
-
/** Stops moving focus with the arrows, Home and End */
|
|
281
|
-
disable: () => void;
|
|
282
|
-
};
|
|
283
|
-
/** Destroys the chips container and all contained chips */
|
|
284
|
-
destroy: () => void;
|
|
285
|
-
/**
|
|
286
|
-
* Adds an event listener to the chips container
|
|
287
|
-
* @param event
|
|
288
|
-
* @param handler
|
|
289
|
-
*/
|
|
290
|
-
on: <K extends keyof ChipsEvents>(event: K, handler: ChipsEvents[K]) => ChipsComponent;
|
|
291
|
-
/**
|
|
292
|
-
* Removes an event listener from the chips container
|
|
293
|
-
* @param event
|
|
294
|
-
* @param handler
|
|
295
|
-
*/
|
|
296
|
-
off: <K extends keyof ChipsEvents>(event: K, handler: ChipsEvents[K]) => ChipsComponent;
|
|
297
|
-
}
|
|
298
|
-
/** Registers ChipConfig with the global defaults map, so `setComponentDefaults("chip", ...)` is typed without core importing anything from this component. */
|
|
299
|
-
declare module "../../core/config/global" {
|
|
300
|
-
interface ComponentConfigMap {
|
|
301
|
-
chip?: Partial<ChipConfig>;
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { DatePickerComponent, DatePickerConfig, DatePickerValueOf } from "./types.js";
|
|
2
|
-
/** M3 calendar/input modes share a draft; modal acceptance is the commit boundary. */
|
|
3
|
-
/** The value's type follows a literal selectionMode: `'range'` makes it a pair, the default a date. */
|
|
4
|
-
declare const createDatePicker: <M extends string = "single">(config?: DatePickerConfig & {
|
|
5
|
-
selectionMode?: M;
|
|
6
|
-
}) => DatePickerComponent<DatePickerValueOf<M>>;
|
|
7
|
-
export default createDatePicker;
|