material 3.9.0 → 3.10.1
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/NOTICE +3 -1
- 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 +25 -21
- package/dist/components/datepicker/utils.js +65 -110
- package/dist/components/dialog/features.js +1 -1
- package/dist/components/dialog/index.d.ts +333 -3
- package/dist/components/divider/index.d.ts +96 -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 +91 -3
- package/dist/components/menu/features/controller.js +2 -0
- package/dist/components/menu/index.d.ts +10 -6
- package/dist/components/menu/inner.d.ts +2 -2
- package/dist/components/menu/on-demand.d.ts +5 -9
- package/dist/components/menu/types.d.ts +12 -7
- 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/progress/types.d.ts +5 -5
- package/dist/components/radios/index.d.ts +158 -3
- package/dist/components/search/features/states.js +20 -39
- 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/split-button/types.d.ts +3 -3
- package/dist/components/switch/index.d.ts +190 -3
- package/dist/components/tabs/index.d.ts +454 -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 +338 -3
- package/dist/components/timepicker/constants.d.ts +4 -4
- package/dist/components/timepicker/constants.js +2 -2
- package/dist/components/timepicker/dial.js +30 -3
- package/dist/components/timepicker/index.d.ts +279 -5
- package/dist/components/timepicker/render.js +15 -9
- 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/canvas/utils.js +3 -13
- package/dist/core/compose/cleanup.d.ts +1 -1
- 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 +741 -8
- package/dist/core/config/component.d.ts +1 -4
- package/dist/core/dom/create.d.ts +1 -4
- package/dist/core/dom/index.d.ts +233 -12
- package/dist/core/index.d.ts +93 -14
- package/dist/core/navigation/destinations.d.ts +6 -6
- 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 +95 -9
- package/dist/core/utils/mobile.d.ts +2 -2
- package/dist/elements/adapter.d.ts +3 -3
- 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.d.ts +3 -3
- 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.d.ts +7 -7
- 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/create.d.ts +2 -6
- package/dist/react/index.d.ts +106 -52
- package/dist/react/jsx.d.ts +49 -49
- package/dist/solid/create.d.ts +2 -7
- 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/svelte/runtime.d.ts +6 -10
- package/dist/theme/vendor/contrast/contrast.js +1 -16
- package/dist/theme/vendor/dislike/dislike_analyzer.js +1 -16
- package/dist/theme/vendor/dynamiccolor/color_spec_2021.js +1 -16
- package/dist/theme/vendor/dynamiccolor/color_spec_2025.js +1 -16
- package/dist/theme/vendor/dynamiccolor/contrast_curve.js +1 -16
- package/dist/theme/vendor/dynamiccolor/dynamic_color.d.ts +2 -2
- package/dist/theme/vendor/dynamiccolor/dynamic_color.js +1 -16
- package/dist/theme/vendor/dynamiccolor/dynamic_scheme.d.ts +2 -2
- package/dist/theme/vendor/dynamiccolor/dynamic_scheme.js +1 -16
- package/dist/theme/vendor/dynamiccolor/material_dynamic_colors.js +1 -16
- package/dist/theme/vendor/dynamiccolor/spec_2025.js +1 -16
- package/dist/theme/vendor/dynamiccolor/spec_extensions.js +1 -16
- package/dist/theme/vendor/dynamiccolor/tone_delta_pair.js +1 -16
- package/dist/theme/vendor/dynamiccolor/variant.js +1 -16
- package/dist/theme/vendor/hct/cam16.js +1 -16
- package/dist/theme/vendor/hct/hct.js +1 -16
- package/dist/theme/vendor/hct/hct_solver.js +1 -16
- package/dist/theme/vendor/hct/viewing_conditions.js +1 -16
- package/dist/theme/vendor/palettes/tonal_palette.d.ts +6 -9
- package/dist/theme/vendor/palettes/tonal_palette.js +1 -16
- package/dist/theme/vendor/quantize/lab_point_provider.js +1 -16
- package/dist/theme/vendor/quantize/quantizer_celebi.js +1 -16
- package/dist/theme/vendor/quantize/quantizer_map.js +1 -16
- package/dist/theme/vendor/quantize/quantizer_wsmeans.js +1 -16
- package/dist/theme/vendor/quantize/quantizer_wu.js +1 -16
- package/dist/theme/vendor/score/score.js +1 -16
- package/dist/theme/vendor/temperature/temperature_cache.js +1 -16
- package/dist/theme/vendor/utils/color_utils.js +1 -16
- package/dist/theme/vendor/utils/image_utils.js +1 -16
- package/dist/theme/vendor/utils/math_utils.js +1 -16
- package/dist/theme/vendor/utils/string_utils.js +1 -16
- 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 +188 -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 +2 -1
- 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 +19 -5
- 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,2 +1,224 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import type { IconManager } from "../../core/compose/features/icon.js";
|
|
2
|
+
import type { TextManager } from "../../core/compose/features/text.js";
|
|
3
|
+
import type { ForwardedEventPayload } from "../../core/dom/index.js";
|
|
4
|
+
import type { TouchEvents } from "../../core/utils/mobile.js";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Creates a new Extended Floating Action Button (Extended FAB) component Extended FABs are a variant of the standard Floating Action Button that include both an icon and text label.
|
|
8
|
+
* @param config
|
|
9
|
+
*/
|
|
10
|
+
declare const createExtendedFab: (config?: ExtendedFabConfig) => ExtendedFabComponent;
|
|
11
|
+
|
|
12
|
+
/** Extended FAB variants following Material Design 3 guidelines Material Design 3 offers different color variants for the Extended FAB to match visual hierarchy and application color schemes. */
|
|
13
|
+
type ExtendedFabVariant = "primary-container" | "secondary-container" | "tertiary-container" | "primary" | "secondary" | "tertiary";
|
|
14
|
+
|
|
15
|
+
/** Expressive extended FAB size: small 56dp, medium 80dp, large 96dp. */
|
|
16
|
+
type ExtendedFabSize = "small" | "medium" | "large";
|
|
17
|
+
|
|
18
|
+
/** Extended FAB width behavior Controls how the Extended FAB's width is calculated. */
|
|
19
|
+
type ExtendedFabWidth = "fixed" | "fluid";
|
|
20
|
+
|
|
21
|
+
/** Extended FAB position on the screen Predefined positions for the Extended FAB when used as a floating element. */
|
|
22
|
+
type ExtendedFabPosition = "top-right" | "top-left" | "bottom-right" | "bottom-left";
|
|
23
|
+
|
|
24
|
+
/** Logical viewport corners; start/end follow text direction. */
|
|
25
|
+
type ExtendedFabPlacement = "none" | "top-start" | "top-end" | "bottom-start" | "bottom-end";
|
|
26
|
+
|
|
27
|
+
/** Configuration interface for the Extended FAB component Comprehensive options for creating and customizing an Extended Floating Action Button according to Material Design 3 guidelines. */
|
|
28
|
+
interface ExtendedFabConfig {
|
|
29
|
+
/** Expressive container, icon and label size. */
|
|
30
|
+
size?: ExtendedFabSize;
|
|
31
|
+
/**
|
|
32
|
+
* Extended FAB variant that determines visual styling The color variant affects the Extended FAB's background color, text color, and elevation.
|
|
33
|
+
* @default 'primary-container'
|
|
34
|
+
*/
|
|
35
|
+
variant?: ExtendedFabVariant | string;
|
|
36
|
+
/**
|
|
37
|
+
* Whether the Extended FAB is initially disabled When disabled, the Extended FAB will have a visually muted appearance and won't respond to user interactions.
|
|
38
|
+
* @default false
|
|
39
|
+
*/
|
|
40
|
+
disabled?: boolean;
|
|
41
|
+
/** Extended FAB icon HTML content. */
|
|
42
|
+
icon?: string;
|
|
43
|
+
/** Icon size in pixels or other CSS units Allows customizing the icon size beyond the default 24px size. */
|
|
44
|
+
iconSize?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Position of the icon relative to the text Controls whether the icon appears before or after the text label.
|
|
47
|
+
* @default 'start'
|
|
48
|
+
*/
|
|
49
|
+
iconPosition?: "start" | "end";
|
|
50
|
+
/** Text label for the Extended FAB The text should be short, typically one or two words describing the primary action. */
|
|
51
|
+
text?: string;
|
|
52
|
+
/** Additional CSS classes to add to the Extended FAB Custom classes for styling or identifying the Extended FAB. */
|
|
53
|
+
class?: string;
|
|
54
|
+
/** Button value attribute Sets the HTML value attribute of the button element, useful when using the Extended FAB in a form context. */
|
|
55
|
+
value?: string;
|
|
56
|
+
/** Position of the Extended FAB on the screen Configures the Extended FAB for floating positioning on the screen. */
|
|
57
|
+
/** @deprecated Use placement. Physical left/right do not mirror in RTL; removal in 4.0. */
|
|
58
|
+
position?: ExtendedFabPosition | string;
|
|
59
|
+
/** Logical corner, fixed with 16px margins; none stays in flow. */
|
|
60
|
+
placement?: ExtendedFabPlacement;
|
|
61
|
+
/**
|
|
62
|
+
* Button type attribute Sets the HTML type attribute of the button element.
|
|
63
|
+
* @default 'button'
|
|
64
|
+
*/
|
|
65
|
+
type?: "button" | "submit" | "reset";
|
|
66
|
+
/** Accessible label for screen readers Sets the aria-label attribute. */
|
|
67
|
+
ariaLabel?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Whether to enable ripple effect The ripple effect provides visual feedback when the user interacts with the Extended FAB.
|
|
70
|
+
* @default true
|
|
71
|
+
*/
|
|
72
|
+
ripple?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Component prefix for class names The prefix used for BEM-style class names.
|
|
75
|
+
* @default 'mtrl'
|
|
76
|
+
*/
|
|
77
|
+
prefix?: string;
|
|
78
|
+
/** Component name used in class generation */
|
|
79
|
+
componentName?: string;
|
|
80
|
+
/** Ripple effect configuration Fine-grained control over the ripple effect appearance and behavior. */
|
|
81
|
+
rippleConfig?: {
|
|
82
|
+
/** How long, in milliseconds, a released wave lingers before it is removed */
|
|
83
|
+
duration?: number;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Whether to show the Extended FAB with an entrance animation When true, the Extended FAB will animate into view when added to the DOM.
|
|
87
|
+
* @default false
|
|
88
|
+
*/
|
|
89
|
+
animate?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Width behavior of the Extended FAB
|
|
92
|
+
* @default 'fixed'
|
|
93
|
+
*/
|
|
94
|
+
width?: ExtendedFabWidth | string;
|
|
95
|
+
/**
|
|
96
|
+
* Whether the Extended FAB should collapse to a standard FAB on scroll When true, the Extended FAB will automatically shrink to a circular FAB (hiding the text) when the user scrolls down, and expand back to the Extended FAB when scrolling up.
|
|
97
|
+
* @default false
|
|
98
|
+
*/
|
|
99
|
+
collapseOnScroll?: boolean;
|
|
100
|
+
/** Index signature for additional configuration options */
|
|
101
|
+
[key: string]: unknown;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/** Native events forwarded through the Extended FAB's emitter. */
|
|
105
|
+
interface ExtendedFabEvents extends TouchEvents {
|
|
106
|
+
/** Clicks are not forwarded while the button is disabled. */
|
|
107
|
+
click: (payload: ForwardedEventPayload<MouseEvent, HTMLButtonElement>) => void;
|
|
108
|
+
/** The button took focus. */
|
|
109
|
+
focus: (payload: ForwardedEventPayload<FocusEvent, HTMLButtonElement>) => void;
|
|
110
|
+
/** The button lost focus. */
|
|
111
|
+
blur: (payload: ForwardedEventPayload<FocusEvent, HTMLButtonElement>) => void;
|
|
112
|
+
/** `collapse()` ran, by call or on scroll */
|
|
113
|
+
collapse: () => void;
|
|
114
|
+
/** `expand()` ran, by call or on scroll */
|
|
115
|
+
expand: () => void;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** Extended FAB component interface Provides methods for interacting with and manipulating an Extended Floating Action Button. */
|
|
119
|
+
interface ExtendedFabComponent {
|
|
120
|
+
/** The Extended FAB's DOM element Direct access to the underlying button element for DOM manipulation. */
|
|
121
|
+
element: HTMLButtonElement;
|
|
122
|
+
/** API for managing Extended FAB icons Access to low-level icon methods and elements. */
|
|
123
|
+
icon: {
|
|
124
|
+
/** Sets the icon HTML content */
|
|
125
|
+
setIcon: (html: string) => IconManager;
|
|
126
|
+
/** Gets the current icon HTML content */
|
|
127
|
+
getIcon: () => string;
|
|
128
|
+
/** Gets the icon DOM element */
|
|
129
|
+
getElement: () => HTMLElement | null;
|
|
130
|
+
};
|
|
131
|
+
/** API for managing text content Access to low-level text methods and elements. */
|
|
132
|
+
text: {
|
|
133
|
+
/** Sets the text content */
|
|
134
|
+
setText: (text: string) => TextManager;
|
|
135
|
+
/** Gets the current text content */
|
|
136
|
+
getText: () => string;
|
|
137
|
+
/** Gets the text DOM element */
|
|
138
|
+
getElement: () => HTMLElement | null;
|
|
139
|
+
};
|
|
140
|
+
/** API for managing disabled state Access to low-level disabled state methods. */
|
|
141
|
+
disabled: {
|
|
142
|
+
/** Enables the Extended FAB */
|
|
143
|
+
enable: () => void;
|
|
144
|
+
/** Disables the Extended FAB */
|
|
145
|
+
disable: () => void;
|
|
146
|
+
/** Checks if the Extended FAB is disabled */
|
|
147
|
+
isDisabled: () => boolean;
|
|
148
|
+
};
|
|
149
|
+
/** API for managing component lifecycle Access to low-level lifecycle methods. */
|
|
150
|
+
lifecycle: {
|
|
151
|
+
/** Destroys the component and cleans up resources */
|
|
152
|
+
destroy: () => void;
|
|
153
|
+
};
|
|
154
|
+
/**
|
|
155
|
+
* Gets a class name with the component's prefix
|
|
156
|
+
* @param name
|
|
157
|
+
*/
|
|
158
|
+
getClass: (name: string) => string;
|
|
159
|
+
/** Gets the Extended FAB's value attribute */
|
|
160
|
+
getValue: () => string;
|
|
161
|
+
/**
|
|
162
|
+
* Sets the Extended FAB's value attribute
|
|
163
|
+
* @param value
|
|
164
|
+
*/
|
|
165
|
+
setValue: (value: string) => ExtendedFabComponent;
|
|
166
|
+
/** Enables the Extended FAB (removes disabled attribute) Makes the Extended FAB interactive and visually enabled. */
|
|
167
|
+
enable: () => ExtendedFabComponent;
|
|
168
|
+
/** Disables the Extended FAB (adds disabled attribute) Makes the Extended FAB non-interactive and visually disabled. */
|
|
169
|
+
disable: () => ExtendedFabComponent;
|
|
170
|
+
/** Whether the extended FAB is disabled */
|
|
171
|
+
isDisabled: () => boolean;
|
|
172
|
+
/**
|
|
173
|
+
* Sets the Extended FAB's icon
|
|
174
|
+
* @param icon
|
|
175
|
+
*/
|
|
176
|
+
setIcon: (icon: string) => ExtendedFabComponent;
|
|
177
|
+
/** Gets the Extended FAB's icon HTML content */
|
|
178
|
+
getIcon: () => string;
|
|
179
|
+
/**
|
|
180
|
+
* Sets the Extended FAB's text content
|
|
181
|
+
* @param text
|
|
182
|
+
*/
|
|
183
|
+
setText: (text: string) => ExtendedFabComponent;
|
|
184
|
+
/** Gets the Extended FAB's text content */
|
|
185
|
+
getText: () => string;
|
|
186
|
+
/**
|
|
187
|
+
* Sets the Extended FAB's position Positions the Extended FAB in one of the four corners of the viewport.
|
|
188
|
+
* @param position
|
|
189
|
+
*/
|
|
190
|
+
/** @deprecated Physical position alias; use the placement option/attribute. Removal in 4.0. */
|
|
191
|
+
setPosition: (position: string) => ExtendedFabComponent;
|
|
192
|
+
/** Gets the current position of the Extended FAB */
|
|
193
|
+
/** @deprecated Reads only the physical position alias. Removal in 4.0. */
|
|
194
|
+
getPosition: () => string | null;
|
|
195
|
+
/** Lowers the Extended FAB (useful for pressed state) Visually lowers the Extended FAB by reducing its elevation, typically used to indicate a pressed or active state. */
|
|
196
|
+
lower: () => ExtendedFabComponent;
|
|
197
|
+
/** Raises the Extended FAB back to its default elevation Restores the default elevation after it has been lowered. */
|
|
198
|
+
raise: () => ExtendedFabComponent;
|
|
199
|
+
/** Collapses the Extended FAB into a standard FAB Hides the text label, showing only the icon in a circular container. */
|
|
200
|
+
collapse: () => ExtendedFabComponent;
|
|
201
|
+
/** Expands a collapsed Extended FAB back to its full size Shows the text label alongside the icon. */
|
|
202
|
+
expand: () => ExtendedFabComponent;
|
|
203
|
+
/** Destroys the Extended FAB component and cleans up resources Removes event listeners and prepares the component for garbage collection. */
|
|
204
|
+
destroy: () => void;
|
|
205
|
+
/**
|
|
206
|
+
* Adds an event listener to the Extended FAB
|
|
207
|
+
* @param event
|
|
208
|
+
* @param handler
|
|
209
|
+
*/
|
|
210
|
+
on: <K extends keyof ExtendedFabEvents>(event: K, handler: ExtendedFabEvents[K]) => ExtendedFabComponent;
|
|
211
|
+
/**
|
|
212
|
+
* Removes an event listener from the Extended FAB
|
|
213
|
+
* @param event
|
|
214
|
+
* @param handler
|
|
215
|
+
*/
|
|
216
|
+
off: <K extends keyof ExtendedFabEvents>(event: K, handler: ExtendedFabEvents[K]) => ExtendedFabComponent;
|
|
217
|
+
/**
|
|
218
|
+
* Adds CSS classes to the Extended FAB element
|
|
219
|
+
* @param classes
|
|
220
|
+
*/
|
|
221
|
+
addClass: (...classes: string[]) => ExtendedFabComponent;
|
|
222
|
+
}
|
|
223
|
+
export type { ExtendedFabComponent, ExtendedFabConfig, ExtendedFabEvents, ExtendedFabPlacement, ExtendedFabPosition, ExtendedFabSize, ExtendedFabVariant, ExtendedFabWidth };
|
|
224
|
+
export { createExtendedFab, createExtendedFab as default };
|
|
@@ -1,2 +1,183 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import type { IconManager } from "../../core/compose/features/icon.js";
|
|
2
|
+
import type { ForwardedEventPayload } from "../../core/dom/create.js";
|
|
3
|
+
import type { TouchEvents } from "../../core/utils/mobile.js";
|
|
4
|
+
|
|
5
|
+
/** FAB variants following Material Design 3 guidelines Material Design 3 offers different color variants for the FAB to match visual hierarchy and application color schemes. */
|
|
6
|
+
type FabVariant = "primary-container" | "secondary-container" | "tertiary-container" | "primary" | "secondary" | "tertiary";
|
|
7
|
+
|
|
8
|
+
/** FAB size variants Material Design 3 defines multiple size options for FABs to accommodate different use cases and screen sizes. */
|
|
9
|
+
type FabSize = "default" | "medium" | "large";
|
|
10
|
+
|
|
11
|
+
/** FAB position options Predefined positions for the FAB when used as a floating element. */
|
|
12
|
+
type FabPosition = "top-right" | "top-left" | "bottom-right" | "bottom-left";
|
|
13
|
+
|
|
14
|
+
/** Logical viewport corners; start/end follow text direction. */
|
|
15
|
+
type FabPlacement = "none" | "top-start" | "top-end" | "bottom-start" | "bottom-end";
|
|
16
|
+
|
|
17
|
+
/** Configuration interface for the FAB component Comprehensive options for creating and customizing a Floating Action Button according to Material Design 3 guidelines. */
|
|
18
|
+
interface FabConfig {
|
|
19
|
+
/**
|
|
20
|
+
* FAB variant that determines visual styling The color variant affects the FAB's background color, icon color, and elevation.
|
|
21
|
+
* @default 'primary-container'
|
|
22
|
+
*/
|
|
23
|
+
variant?: FabVariant | string;
|
|
24
|
+
/**
|
|
25
|
+
* FAB size variant Controls the diameter of the FAB and the appropriate icon size.
|
|
26
|
+
* @default 'default'
|
|
27
|
+
*/
|
|
28
|
+
size?: FabSize | string;
|
|
29
|
+
/**
|
|
30
|
+
* Whether the FAB is initially disabled When disabled, the FAB will have a visually muted appearance and won't respond to user interactions.
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
/** FAB icon HTML content. */
|
|
35
|
+
icon?: string;
|
|
36
|
+
/** Icon size in pixels or other CSS units Allows customizing the icon size beyond the default size for the selected FAB size. */
|
|
37
|
+
iconSize?: string;
|
|
38
|
+
/** Additional CSS classes to add to the FAB Custom classes for styling or identifying the FAB. */
|
|
39
|
+
class?: string;
|
|
40
|
+
/** Button value attribute Sets the HTML value attribute of the button element, useful when using the FAB in a form context. */
|
|
41
|
+
value?: string;
|
|
42
|
+
/** Position of the FAB on the screen Configures the FAB for floating positioning on the screen. */
|
|
43
|
+
/** @deprecated Use placement. Physical left/right do not mirror in RTL; removal in 4.0. */
|
|
44
|
+
position?: FabPosition | string;
|
|
45
|
+
/** Logical corner, fixed with 16px margins; none stays in flow. */
|
|
46
|
+
placement?: FabPlacement;
|
|
47
|
+
/**
|
|
48
|
+
* Button type attribute Sets the HTML type attribute of the button element.
|
|
49
|
+
* @default 'button'
|
|
50
|
+
*/
|
|
51
|
+
type?: "button" | "submit" | "reset";
|
|
52
|
+
/** Accessible label for screen readers Sets the aria-label attribute for accessibility. */
|
|
53
|
+
/** Accessible name. */
|
|
54
|
+
ariaLabel: string;
|
|
55
|
+
/**
|
|
56
|
+
* Whether to enable ripple effect The ripple effect provides visual feedback when the user interacts with the FAB.
|
|
57
|
+
* @default true
|
|
58
|
+
*/
|
|
59
|
+
ripple?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Component prefix for class names The prefix used for BEM-style class names.
|
|
62
|
+
* @default 'mtrl'
|
|
63
|
+
*/
|
|
64
|
+
prefix?: string;
|
|
65
|
+
/** Component name used in class generation */
|
|
66
|
+
componentName?: string;
|
|
67
|
+
/** Ripple effect configuration Fine-grained control over the ripple effect appearance and behavior. */
|
|
68
|
+
rippleConfig?: {
|
|
69
|
+
/** How long, in milliseconds, a released wave lingers before it is removed */
|
|
70
|
+
duration?: number;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Whether to show the FAB with an entrance animation When true, the FAB will animate into view when added to the DOM.
|
|
74
|
+
* @default false
|
|
75
|
+
*/
|
|
76
|
+
animate?: boolean;
|
|
77
|
+
/** Index signature for additional configuration options */
|
|
78
|
+
[key: string]: unknown;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** FAB component interface Provides methods for interacting with and manipulating a Floating Action Button. */
|
|
82
|
+
/** The events a FAB reports, and what each hands its handler. */
|
|
83
|
+
interface FabEvents extends TouchEvents {
|
|
84
|
+
/** The FAB was clicked. */
|
|
85
|
+
click: (payload: ForwardedEventPayload<MouseEvent, HTMLButtonElement>) => void;
|
|
86
|
+
/** The FAB took focus. */
|
|
87
|
+
focus: (payload: ForwardedEventPayload<FocusEvent, HTMLButtonElement>) => void;
|
|
88
|
+
/** The FAB lost focus. */
|
|
89
|
+
blur: (payload: ForwardedEventPayload<FocusEvent, HTMLButtonElement>) => void;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
interface FabComponent {
|
|
93
|
+
/** The FAB's DOM element Direct access to the underlying button element for DOM manipulation. */
|
|
94
|
+
element: HTMLButtonElement;
|
|
95
|
+
/** API for managing FAB icons Access to low-level icon methods and elements. */
|
|
96
|
+
icon: {
|
|
97
|
+
/** Sets the icon HTML content */
|
|
98
|
+
setIcon: (html: string) => IconManager;
|
|
99
|
+
/** Gets the current icon HTML content */
|
|
100
|
+
getIcon: () => string;
|
|
101
|
+
/** Gets the icon DOM element */
|
|
102
|
+
getElement: () => HTMLElement | null;
|
|
103
|
+
};
|
|
104
|
+
/** API for managing disabled state Access to low-level disabled state methods. */
|
|
105
|
+
disabled: {
|
|
106
|
+
/** Enables the FAB */
|
|
107
|
+
enable: () => void;
|
|
108
|
+
/** Disables the FAB */
|
|
109
|
+
disable: () => void;
|
|
110
|
+
/** Checks if the FAB is disabled */
|
|
111
|
+
isDisabled: () => boolean;
|
|
112
|
+
};
|
|
113
|
+
/** API for managing component lifecycle Access to low-level lifecycle methods. */
|
|
114
|
+
lifecycle: {
|
|
115
|
+
/** Destroys the component and cleans up resources */
|
|
116
|
+
destroy: () => void;
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* Gets a class name with the component's prefix
|
|
120
|
+
* @param name
|
|
121
|
+
*/
|
|
122
|
+
getClass: (name: string) => string;
|
|
123
|
+
/** Gets the FAB's value attribute */
|
|
124
|
+
getValue: () => string;
|
|
125
|
+
/**
|
|
126
|
+
* Sets the FAB's value attribute
|
|
127
|
+
* @param value
|
|
128
|
+
*/
|
|
129
|
+
setValue: (value: string) => FabComponent;
|
|
130
|
+
/** Enables the FAB (removes disabled attribute) Makes the FAB interactive and visually enabled. */
|
|
131
|
+
enable: () => FabComponent;
|
|
132
|
+
/** Disables the FAB (adds disabled attribute) Makes the FAB non-interactive and visually disabled. */
|
|
133
|
+
disable: () => FabComponent;
|
|
134
|
+
/** Whether the FAB is disabled */
|
|
135
|
+
isDisabled: () => boolean;
|
|
136
|
+
/**
|
|
137
|
+
* Sets the FAB's icon
|
|
138
|
+
* @param icon
|
|
139
|
+
*/
|
|
140
|
+
setIcon: (icon: string) => FabComponent;
|
|
141
|
+
/** Gets the FAB's icon HTML content */
|
|
142
|
+
getIcon: () => string;
|
|
143
|
+
/**
|
|
144
|
+
* Sets the FAB's position Positions the FAB in one of the four corners of the viewport.
|
|
145
|
+
* @param position
|
|
146
|
+
*/
|
|
147
|
+
/** @deprecated Physical position alias; use the placement option/attribute. Removal in 4.0. */
|
|
148
|
+
setPosition: (position: string) => FabComponent;
|
|
149
|
+
/** Gets the current position of the FAB */
|
|
150
|
+
/** @deprecated Reads only the physical position alias. Removal in 4.0. */
|
|
151
|
+
getPosition: () => string | null;
|
|
152
|
+
/** Lowers the FAB (useful for pressed state) Visually lowers the FAB by reducing its elevation, typically used to indicate a pressed or active state. */
|
|
153
|
+
lower: () => FabComponent;
|
|
154
|
+
/** Raises the FAB back to its default elevation Restores the default elevation after it has been lowered. */
|
|
155
|
+
raise: () => FabComponent;
|
|
156
|
+
/** Destroys the FAB component and cleans up resources Removes event listeners and prepares the component for garbage collection. */
|
|
157
|
+
destroy: () => void;
|
|
158
|
+
/**
|
|
159
|
+
* Adds an event listener to the FAB
|
|
160
|
+
* @param event
|
|
161
|
+
* @param handler
|
|
162
|
+
*/
|
|
163
|
+
on: <K extends keyof FabEvents>(event: K, handler: FabEvents[K]) => FabComponent;
|
|
164
|
+
/**
|
|
165
|
+
* Removes an event listener from the FAB
|
|
166
|
+
* @param event
|
|
167
|
+
* @param handler
|
|
168
|
+
*/
|
|
169
|
+
off: <K extends keyof FabEvents>(event: K, handler: FabEvents[K]) => FabComponent;
|
|
170
|
+
/**
|
|
171
|
+
* Adds CSS classes to the FAB element
|
|
172
|
+
* @param classes
|
|
173
|
+
*/
|
|
174
|
+
addClass: (...classes: string[]) => FabComponent;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Creates a new Floating Action Button (FAB) component Floating Action Buttons (FABs) represent the primary action in an application.
|
|
179
|
+
* @param config
|
|
180
|
+
*/
|
|
181
|
+
declare const createFab: (config: FabConfig) => FabComponent;
|
|
182
|
+
export type { FabComponent, FabConfig, FabEvents, FabPlacement, FabPosition, FabSize, FabVariant };
|
|
183
|
+
export { createFab, createFab as default };
|
|
@@ -1,6 +1,106 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import type { ElementComponent } from "../../core/compose/index.js";
|
|
2
|
+
import type { BaseComponentConfig } from "../../core/config/component.js";
|
|
3
|
+
import type { FabMenuColor, FabMenuPlacement, FabMenuPresentation, FabMenuSize } from "./constants.js";
|
|
4
|
+
|
|
5
|
+
/** An action of the menu */
|
|
6
|
+
interface FabMenuItem {
|
|
7
|
+
/** Identifies the item in `select` */
|
|
8
|
+
id: string;
|
|
9
|
+
/** The label: always shown (m3.material.io FAB menu guidelines) */
|
|
10
|
+
text: string;
|
|
11
|
+
/** Icon HTML, 24dp. */
|
|
12
|
+
icon?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** What the menu presentation needs from a menu: the baseline menu (createMenu), or one the app brings. */
|
|
16
|
+
interface FabMenuMenu {
|
|
17
|
+
open(event?: Event, interactionType?: "mouse" | "keyboard"): unknown;
|
|
18
|
+
close(event?: Event, restoreFocus?: boolean): unknown;
|
|
19
|
+
isOpen(): boolean;
|
|
20
|
+
on(event: "close" | "select", handler: (event: {
|
|
21
|
+
itemId?: string;
|
|
22
|
+
}) => void): unknown;
|
|
23
|
+
destroy(): void;
|
|
24
|
+
element: HTMLElement;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** Configuration of a FAB menu */
|
|
28
|
+
interface FabMenuConfig extends BaseComponentConfig {
|
|
29
|
+
/** The FAB's icon HTML. */
|
|
30
|
+
icon: string;
|
|
31
|
+
/** The FAB's accessible name: it describes the menu the FAB opens */
|
|
32
|
+
ariaLabel: string;
|
|
33
|
+
/** The actions, 2 to 6 (m3.material.io FAB menu guidelines). */
|
|
34
|
+
items: FabMenuItem[];
|
|
35
|
+
/**
|
|
36
|
+
* Colour set: the FAB is the role's container, the close button the role,
|
|
37
|
+
* @default 'primary'
|
|
38
|
+
*/
|
|
39
|
+
color?: FabMenuColor | string;
|
|
40
|
+
/**
|
|
41
|
+
* The size of the FAB the menu opens from
|
|
42
|
+
* @default 'default'
|
|
43
|
+
*/
|
|
44
|
+
size?: FabMenuSize | string;
|
|
45
|
+
/**
|
|
46
|
+
* The expressive list (compact windows), the baseline menu (the site's rule
|
|
47
|
+
* @default 'auto'
|
|
48
|
+
*/
|
|
49
|
+
presentation?: FabMenuPresentation | string;
|
|
50
|
+
/**
|
|
51
|
+
* Where the FAB sits in its positioned container: 16dp from the window edges, 24dp in large windows.
|
|
52
|
+
* @default 'none'
|
|
53
|
+
*/
|
|
54
|
+
placement?: FabMenuPlacement | string;
|
|
55
|
+
/** The icon of the close button, 20dp. */
|
|
56
|
+
closeIcon?: string;
|
|
57
|
+
/** A menu of the app's own for the menu presentation, in place of the baseline menu the FAB menu loads when it needs one. */
|
|
58
|
+
menu?: (opener: HTMLElement, items: FabMenuItem[]) => FabMenuMenu;
|
|
59
|
+
/** Additional CSS classes */
|
|
60
|
+
class?: string;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** Events of a FAB menu */
|
|
64
|
+
interface FabMenuEvents {
|
|
65
|
+
/** The menu opened */
|
|
66
|
+
open: () => void;
|
|
67
|
+
/** The menu closed */
|
|
68
|
+
close: () => void;
|
|
69
|
+
/** An item was chosen; the menu closes. */
|
|
70
|
+
select: (event: {
|
|
71
|
+
id: string;
|
|
72
|
+
value: string;
|
|
73
|
+
}) => void;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** A FAB menu */
|
|
77
|
+
interface FabMenuComponent extends ElementComponent {
|
|
78
|
+
/** The FAB, which becomes the close button of the list */
|
|
79
|
+
fab: HTMLElement;
|
|
80
|
+
/** The list of the list presentation: `role="menu"` */
|
|
81
|
+
list: HTMLElement;
|
|
82
|
+
/** Opens the menu. */
|
|
83
|
+
open(event?: Event): this;
|
|
84
|
+
/** Closes the menu. */
|
|
85
|
+
close(): this;
|
|
86
|
+
/** Opens or closes the menu */
|
|
87
|
+
toggle(event?: Event): this;
|
|
88
|
+
/** Whether the menu is open */
|
|
89
|
+
isOpen(): boolean;
|
|
90
|
+
/** The presentation in use: 'list' or 'menu' */
|
|
91
|
+
getPresentation(): "list" | "menu";
|
|
92
|
+
on<K extends keyof FabMenuEvents>(event: K, handler: FabMenuEvents[K]): this;
|
|
93
|
+
off<K extends keyof FabMenuEvents>(event: K, handler: FabMenuEvents[K]): this;
|
|
94
|
+
/** Removes the FAB menu, its listeners and its menu */
|
|
95
|
+
destroy(): void;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Creates a FAB menu: M3 Expressive's FAB that opens a list of related actions.
|
|
100
|
+
* @param config
|
|
101
|
+
*/
|
|
102
|
+
declare const createFabMenu: (config: FabMenuConfig) => FabMenuComponent;
|
|
103
|
+
export type { FabMenuComponent, FabMenuConfig, FabMenuEvents, FabMenuItem, FabMenuMenu };
|
|
104
|
+
export { createFabMenu, createFabMenu as default };
|
|
105
|
+
export type { FabMenuColor, FabMenuPlacement, FabMenuPresentation, FabMenuSize } from "./constants.js";
|
|
106
|
+
export { FAB_MENU_COLORS, FAB_MENU_EVENTS, FAB_MENU_PLACEMENTS, FAB_MENU_PRESENTATIONS, FAB_MENU_SIZES } from "./constants.js";
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { IconButtonComponent, IconButtonConfig } from "./types.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Creates a new IconButton component with the specified configuration.
|
|
5
|
+
* @param config
|
|
6
|
+
*/
|
|
7
|
+
declare const createIconButton: (config: IconButtonConfig) => IconButtonComponent;
|
|
8
|
+
export { createIconButton, createIconButton as default };
|
|
9
|
+
export type { IconAPI, IconButtonChangePayload, IconButtonComponent, IconButtonConfig, IconButtonEvents, ToggleManager } from "./types.js";
|
|
10
|
+
export type { IconButtonShape, IconButtonSize, IconButtonVariant, IconButtonWidth } from "./constants.js";
|
|
11
|
+
export { ICON_BUTTON_CLASSES, ICON_BUTTON_CONTAINER_SIZES, ICON_BUTTON_CORNER_RADIUS, ICON_BUTTON_ICON_SIZES, ICON_BUTTON_SHAPES, ICON_BUTTON_SIZES, ICON_BUTTON_VARIANTS, ICON_BUTTON_WIDTHS, ICON_BUTTON_WIDTH_VALUES } from "./constants.js";
|
|
@@ -3,6 +3,15 @@ let nextLabel = 0;
|
|
|
3
3
|
export const itemLabel = (item) => String(item.headline ?? item.text ?? item.title ?? item.name ?? item.id ?? "");
|
|
4
4
|
export const isDataItem = (item) => !item.kind || item.kind === "item";
|
|
5
5
|
export const itemId = (item, index) => String(item.id ?? index);
|
|
6
|
+
export const checkableControl = 'input[type=checkbox],input[type=radio],[role=switch],[role=checkbox],[role=radio]';
|
|
7
|
+
const slotContent = (value) => {
|
|
8
|
+
const content = value.content;
|
|
9
|
+
return typeof content === "string" ? content : "element" in content ? content.element : content;
|
|
10
|
+
};
|
|
11
|
+
export const controlIn = (element) => element.matches(checkableControl) ? element : element.querySelector(checkableControl) ?? undefined;
|
|
12
|
+
const hasName = (control) => control.hasAttribute("aria-label") || control.hasAttribute("aria-labelledby") ||
|
|
13
|
+
control.hasAttribute("title") || !!control.labels?.length ||
|
|
14
|
+
(control.textContent ?? "").trim() !== "";
|
|
6
15
|
export function renderAnatomy(item, getClass) {
|
|
7
16
|
const row = document.createElement("div");
|
|
8
17
|
const lines = item.lines ?? (item.overline && item.supportingText ? 3 : item.overline || item.supportingText ? 2 : 1);
|
|
@@ -22,21 +31,31 @@ if (item.overline)
|
|
|
22
31
|
appendText("overline", item.overline);
|
|
23
32
|
const headline = appendText("headline", itemLabel(item));
|
|
24
33
|
headline.id = `${identifier}-headline`;
|
|
25
|
-
|
|
26
|
-
|
|
34
|
+
const supporting = item.supportingText ? appendText("supporting", item.supportingText) : undefined;
|
|
35
|
+
if (supporting)
|
|
36
|
+
supporting.id = `${identifier}-supporting`;
|
|
27
37
|
const slot = (position, value) => {
|
|
28
38
|
const el = document.createElement("div");
|
|
29
39
|
el.className = `${getClass(`list__${position}`)} ${getClass(`list__${position}--${value.type}`)}`;
|
|
40
|
+
const content = slotContent(value);
|
|
30
41
|
if (value.type === "text")
|
|
31
|
-
el.textContent = typeof
|
|
32
|
-
else if (typeof
|
|
33
|
-
setHTML(el,
|
|
42
|
+
el.textContent = typeof content === "string" ? content : content.textContent;
|
|
43
|
+
else if (typeof content === "string")
|
|
44
|
+
setHTML(el, content);
|
|
34
45
|
else
|
|
35
|
-
el.append(
|
|
46
|
+
el.append(content);
|
|
36
47
|
if (value.type === "control" || value.type === "custom")
|
|
37
48
|
el.dataset.listControl = "";
|
|
38
49
|
else if (value.type === "icon")
|
|
39
50
|
el.setAttribute("aria-hidden", "true");
|
|
51
|
+
if (value.type === "control") {
|
|
52
|
+
const control = controlIn(el.firstElementChild ?? el);
|
|
53
|
+
if (control && !hasName(control)) {
|
|
54
|
+
control.setAttribute("aria-labelledby", headline.id);
|
|
55
|
+
if (supporting && !control.hasAttribute("aria-describedby"))
|
|
56
|
+
control.setAttribute("aria-describedby", supporting.id);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
40
59
|
return el;
|
|
41
60
|
};
|
|
42
61
|
if (item.leading)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LIST_EVENTS } from "../constants.js";
|
|
2
2
|
import { getCleanup } from "../../../core/compose/cleanup.js";
|
|
3
|
+
import { controlIn } from "./anatomy.js";
|
|
3
4
|
export const withSelection = (config) => (component) => {
|
|
4
5
|
const resources = getCleanup(component);
|
|
5
6
|
const selected = new Set();
|
|
@@ -39,6 +40,25 @@ return;
|
|
|
39
40
|
const nearest = event.target.closest(`.${component.getClass("list__item")}`);
|
|
40
41
|
return rows().find(row => row.element === nearest);
|
|
41
42
|
};
|
|
43
|
+
const controlFor = (row) => {
|
|
44
|
+
const slot = row.element.querySelector(`.${component.getClass("list__trailing")}[data-list-control]`);
|
|
45
|
+
return slot ? controlIn(slot) : undefined;
|
|
46
|
+
};
|
|
47
|
+
const follow = (row) => {
|
|
48
|
+
const control = controlFor(row);
|
|
49
|
+
if (!control)
|
|
50
|
+
return;
|
|
51
|
+
const checked = control.matches(":checked") || control.getAttribute("aria-checked") === "true";
|
|
52
|
+
if (checked === selected.has(row.id))
|
|
53
|
+
return;
|
|
54
|
+
if (checked && !config.multiSelect)
|
|
55
|
+
selected.clear();
|
|
56
|
+
if (checked)
|
|
57
|
+
selected.add(row.id);
|
|
58
|
+
else
|
|
59
|
+
selected.delete(row.id);
|
|
60
|
+
apply();
|
|
61
|
+
};
|
|
42
62
|
const activate = (event) => {
|
|
43
63
|
if (!config.trackSelection || resources.destroyed || event.defaultPrevented)
|
|
44
64
|
return;
|
|
@@ -46,10 +66,12 @@ const row = ownedRow(event);
|
|
|
46
66
|
if (!row || row.item.disabled || !(event.target instanceof Element))
|
|
47
67
|
return;
|
|
48
68
|
const control = event.target.closest('button, input, select, textarea, a, [contenteditable="true"], [data-list-control]');
|
|
49
|
-
if (control && control !== row.action)
|
|
69
|
+
if (control && control !== row.action) {
|
|
70
|
+
follow(row);
|
|
50
71
|
return;
|
|
72
|
+
}
|
|
51
73
|
const payload = {
|
|
52
|
-
item: row.item, value: row.id, element: row.element, originalEvent: event,
|
|
74
|
+
item: row.item, value: row.id, element: row.element, action: row.action, originalEvent: event,
|
|
53
75
|
component: component.eventTarget?.current ?? component,
|
|
54
76
|
defaultPrevented: false,
|
|
55
77
|
preventDefault() { this.defaultPrevented = true; },
|
|
@@ -57,6 +79,12 @@ preventDefault() { this.defaultPrevented = true; },
|
|
|
57
79
|
component.emit?.(LIST_EVENTS.SELECT, payload);
|
|
58
80
|
if (payload.defaultPrevented || resources.destroyed)
|
|
59
81
|
return;
|
|
82
|
+
const trailing = controlFor(row);
|
|
83
|
+
if (trailing) {
|
|
84
|
+
trailing.click();
|
|
85
|
+
follow(row);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
60
88
|
const wasSelected = selected.has(row.id);
|
|
61
89
|
if (!config.multiSelect)
|
|
62
90
|
selected.clear();
|