material 3.5.3 → 3.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/badge/api.js +156 -156
- package/dist/components/badge/badge.js +9 -9
- package/dist/components/badge/config.js +43 -43
- package/dist/components/badge/constants.js +13 -13
- package/dist/components/badge/features.js +75 -75
- package/dist/components/bottom-app-bar/bottom-app-bar.js +98 -98
- package/dist/components/bottom-app-bar/config.js +5 -5
- package/dist/components/bottom-app-bar/constants.js +8 -8
- package/dist/components/bottom-sheet/api.js +52 -52
- package/dist/components/bottom-sheet/bottom-sheet.js +9 -9
- package/dist/components/bottom-sheet/config.js +17 -17
- package/dist/components/bottom-sheet/constants.js +24 -24
- package/dist/components/bottom-sheet/features/drag.js +91 -91
- package/dist/components/bottom-sheet/features/state.js +148 -148
- package/dist/components/bottom-sheet/features/structure.js +85 -85
- package/dist/components/button/api.js +265 -265
- package/dist/components/button/button.js +15 -15
- package/dist/components/button/config.js +39 -39
- package/dist/components/button/constants.js +21 -21
- package/dist/components/button/features/progress.js +167 -167
- package/dist/components/button/features/toggle.js +31 -31
- package/dist/components/button-group/button-group.js +389 -389
- package/dist/components/button-group/config.js +106 -106
- package/dist/components/button-group/constants.js +62 -62
- package/dist/components/card/api.js +88 -88
- package/dist/components/card/card.js +11 -11
- package/dist/components/card/config.js +131 -131
- package/dist/components/card/constants.js +39 -39
- package/dist/components/card/content.js +175 -175
- package/dist/components/carousel/api.js +49 -49
- package/dist/components/carousel/arrangement.js +51 -51
- package/dist/components/carousel/carousel.js +2 -2
- package/dist/components/carousel/config.js +31 -31
- package/dist/components/carousel/constants.js +17 -17
- package/dist/components/carousel/features/scroll.js +469 -469
- package/dist/components/carousel/features/slides.js +125 -125
- package/dist/components/carousel/keylines.js +244 -244
- package/dist/components/carousel/strategy.js +185 -185
- package/dist/components/checkbox/api.js +87 -87
- package/dist/components/checkbox/checkbox.js +55 -55
- package/dist/components/checkbox/config.js +44 -44
- package/dist/components/checkbox/constants.js +10 -10
- package/dist/components/chips/api.js +157 -157
- package/dist/components/chips/chip/chip.js +275 -275
- package/dist/components/chips/chips.js +25 -25
- package/dist/components/chips/config.js +73 -73
- package/dist/components/chips/constants.js +2 -2
- package/dist/components/chips/features/chip-items.js +15 -15
- package/dist/components/chips/features/container.js +39 -39
- package/dist/components/chips/features/controller.js +317 -317
- package/dist/components/chips/features/dom.js +52 -52
- package/dist/components/datepicker/api.js +6 -6
- package/dist/components/datepicker/config.js +3 -3
- package/dist/components/datepicker/constants.js +39 -39
- package/dist/components/datepicker/datepicker.js +675 -675
- package/dist/components/datepicker/render.js +153 -153
- package/dist/components/datepicker/types.js +6 -6
- package/dist/components/datepicker/utils.js +157 -157
- package/dist/components/dialog/api.js +109 -109
- package/dist/components/dialog/config.js +29 -29
- package/dist/components/dialog/constants.js +35 -35
- package/dist/components/dialog/dialog.js +16 -16
- package/dist/components/dialog/features.js +739 -739
- package/dist/components/divider/config.js +4 -4
- package/dist/components/divider/constants.js +10 -10
- package/dist/components/divider/divider.js +6 -6
- package/dist/components/divider/features.js +72 -72
- package/dist/components/drawer/api.js +73 -73
- package/dist/components/drawer/config.js +61 -61
- package/dist/components/drawer/constants.js +32 -32
- package/dist/components/drawer/drawer.js +38 -38
- package/dist/components/drawer/features/headline.js +34 -34
- package/dist/components/drawer/features/items.js +203 -203
- package/dist/components/drawer/features/state.js +206 -206
- package/dist/components/extended-fab/api.js +92 -92
- package/dist/components/extended-fab/config.js +65 -65
- package/dist/components/extended-fab/constants.js +30 -30
- package/dist/components/extended-fab/extended-fab.js +51 -51
- package/dist/components/fab/api.js +65 -65
- package/dist/components/fab/config.js +46 -46
- package/dist/components/fab/constants.js +25 -25
- package/dist/components/fab/fab.js +9 -9
- package/dist/components/fab-menu/config.js +9 -9
- package/dist/components/fab-menu/constants.js +15 -15
- package/dist/components/fab-menu/fab-menu.js +310 -310
- package/dist/components/fab-menu/stagger.js +18 -18
- package/dist/components/icon-button/api.js +195 -195
- package/dist/components/icon-button/config.js +79 -79
- package/dist/components/icon-button/constants.js +43 -43
- package/dist/components/icon-button/features/toggle.js +116 -116
- package/dist/components/icon-button/icon-button.js +15 -15
- package/dist/components/list/api.js +55 -55
- package/dist/components/list/config.js +56 -56
- package/dist/components/list/constants.js +25 -25
- package/dist/components/list/features/anatomy.js +41 -41
- package/dist/components/list/features/renderer.js +136 -136
- package/dist/components/list/features/selection.js +118 -118
- package/dist/components/list/list.js +9 -9
- package/dist/components/loading-indicator/api.js +117 -117
- package/dist/components/loading-indicator/config.js +13 -13
- package/dist/components/loading-indicator/constants.js +23 -23
- package/dist/components/loading-indicator/features/motion.js +33 -33
- package/dist/components/loading-indicator/features/renderer.js +121 -121
- package/dist/components/loading-indicator/loading-indicator.js +8 -8
- package/dist/components/menu/api.js +76 -76
- package/dist/components/menu/config.js +73 -73
- package/dist/components/menu/constants.js +45 -45
- package/dist/components/menu/features/controller.js +507 -507
- package/dist/components/menu/features/keyboard.js +292 -292
- package/dist/components/menu/features/layer.js +13 -13
- package/dist/components/menu/features/loader.js +61 -61
- package/dist/components/menu/features/opener.js +288 -288
- package/dist/components/menu/features/position.js +279 -279
- package/dist/components/menu/features/registry.js +7 -7
- package/dist/components/menu/features/submenu.js +386 -386
- package/dist/components/menu/features/tasks.js +45 -45
- package/dist/components/menu/menu.js +16 -16
- package/dist/components/menu/on-demand.js +138 -138
- package/dist/components/navigation-bar/navigation-bar.js +144 -144
- package/dist/components/navigation-rail/config.js +11 -11
- package/dist/components/navigation-rail/constants.js +8 -8
- package/dist/components/navigation-rail/navigation-rail.js +237 -237
- package/dist/components/progress/api.js +207 -207
- package/dist/components/progress/config.js +137 -137
- package/dist/components/progress/constants.js +88 -88
- package/dist/components/progress/features/canvas.js +291 -291
- package/dist/components/progress/features/circular.js +69 -69
- package/dist/components/progress/features/colors.js +41 -41
- package/dist/components/progress/features/linear.js +96 -96
- package/dist/components/progress/features/motion.js +87 -87
- package/dist/components/progress/features/state.js +35 -35
- package/dist/components/progress/progress.js +11 -11
- package/dist/components/radios/api.js +54 -54
- package/dist/components/radios/config.js +19 -19
- package/dist/components/radios/constants.js +10 -10
- package/dist/components/radios/radio.js +161 -161
- package/dist/components/radios/radios.js +12 -12
- package/dist/components/search/api.js +116 -116
- package/dist/components/search/config.js +66 -66
- package/dist/components/search/constants.js +75 -75
- package/dist/components/search/features/input.js +238 -238
- package/dist/components/search/features/states.js +279 -279
- package/dist/components/search/features/structure.js +212 -212
- package/dist/components/search/features/suggestions.js +234 -234
- package/dist/components/search/search.js +30 -30
- package/dist/components/select/api.js +92 -92
- package/dist/components/select/config.js +46 -46
- package/dist/components/select/constants.js +39 -39
- package/dist/components/select/features.js +485 -485
- package/dist/components/select/select.js +17 -17
- package/dist/components/side-sheet/api.js +46 -46
- package/dist/components/side-sheet/config.js +19 -19
- package/dist/components/side-sheet/constants.js +22 -22
- package/dist/components/side-sheet/features/state.js +132 -132
- package/dist/components/side-sheet/features/structure.js +89 -89
- package/dist/components/side-sheet/side-sheet.js +8 -8
- package/dist/components/slider/config.js +54 -54
- package/dist/components/slider/constants.js +54 -54
- package/dist/components/slider/features/axis.js +14 -14
- package/dist/components/slider/features/controller.js +944 -944
- package/dist/components/slider/features/dom.js +104 -104
- package/dist/components/slider/features/states.js +83 -83
- package/dist/components/slider/slider.js +16 -16
- package/dist/components/snackbar/api.js +199 -199
- package/dist/components/snackbar/config.js +24 -24
- package/dist/components/snackbar/constants.js +41 -41
- package/dist/components/snackbar/features.js +115 -115
- package/dist/components/snackbar/layer.js +72 -72
- package/dist/components/snackbar/position.js +20 -20
- package/dist/components/snackbar/queue.js +89 -89
- package/dist/components/snackbar/snackbar.js +12 -12
- package/dist/components/split-button/api.js +137 -137
- package/dist/components/split-button/config.js +11 -11
- package/dist/components/split-button/constants.js +24 -24
- package/dist/components/split-button/features/buttons.js +35 -35
- package/dist/components/split-button/features/menu.js +12 -12
- package/dist/components/split-button/split-button.js +11 -11
- package/dist/components/switch/api.js +101 -101
- package/dist/components/switch/config.js +20 -20
- package/dist/components/switch/constants.js +29 -29
- package/dist/components/switch/features.js +123 -123
- package/dist/components/switch/switch.js +13 -13
- package/dist/components/tabs/api.js +104 -104
- package/dist/components/tabs/config.js +20 -20
- package/dist/components/tabs/constants.js +40 -40
- package/dist/components/tabs/features.js +159 -159
- package/dist/components/tabs/indicator.js +151 -151
- package/dist/components/tabs/responsive.js +59 -59
- package/dist/components/tabs/tab.js +218 -218
- package/dist/components/tabs/tabs.js +27 -27
- package/dist/components/tabs/utils.js +121 -121
- package/dist/components/text-field/api.js +212 -212
- package/dist/components/text-field/config.js +30 -30
- package/dist/components/text-field/constants.js +54 -54
- package/dist/components/text-field/features/counter.js +51 -51
- package/dist/components/text-field/features/density.js +36 -36
- package/dist/components/text-field/features/error.js +55 -55
- package/dist/components/text-field/features/field.js +30 -30
- package/dist/components/text-field/features/leading-icon.js +52 -52
- package/dist/components/text-field/features/placement.js +146 -146
- package/dist/components/text-field/features/prefix-text.js +48 -48
- package/dist/components/text-field/features/required.js +48 -48
- package/dist/components/text-field/features/suffix-text.js +48 -48
- package/dist/components/text-field/features/supporting-text.js +85 -85
- package/dist/components/text-field/features/trailing-icon.js +88 -88
- package/dist/components/text-field/text-field.js +11 -11
- package/dist/components/timepicker/api.js +275 -275
- package/dist/components/timepicker/config.js +31 -31
- package/dist/components/timepicker/constants.js +52 -52
- package/dist/components/timepicker/dial.js +164 -164
- package/dist/components/timepicker/render.js +400 -400
- package/dist/components/timepicker/timepicker.js +40 -40
- package/dist/components/timepicker/types.js +8 -8
- package/dist/components/timepicker/utils.js +67 -67
- package/dist/components/toolbar/config.js +35 -35
- package/dist/components/toolbar/constants.js +17 -17
- package/dist/components/toolbar/toolbar.js +188 -188
- package/dist/components/tooltip/api.js +309 -309
- package/dist/components/tooltip/config.js +32 -32
- package/dist/components/tooltip/constants.js +38 -38
- package/dist/components/tooltip/tooltip.js +20 -20
- package/dist/components/tooltip/types.js +15 -15
- package/dist/components/top-app-bar/config.js +5 -5
- package/dist/components/top-app-bar/constants.js +25 -25
- package/dist/components/top-app-bar/top-app-bar.js +158 -158
- package/dist/core/canvas/animation.js +30 -30
- package/dist/core/canvas/drawing.js +52 -52
- package/dist/core/canvas/resize.js +47 -47
- package/dist/core/canvas/utils.js +101 -101
- package/dist/core/compose/base.js +5 -5
- package/dist/core/compose/cleanup.js +47 -47
- package/dist/core/compose/component.js +132 -132
- package/dist/core/compose/features/badge.js +56 -56
- package/dist/core/compose/features/checkable.js +37 -37
- package/dist/core/compose/features/constants.js +1 -1
- package/dist/core/compose/features/debounce.js +39 -39
- package/dist/core/compose/features/disabled.js +61 -61
- package/dist/core/compose/features/events.js +19 -19
- package/dist/core/compose/features/icon.js +66 -66
- package/dist/core/compose/features/input.js +63 -63
- package/dist/core/compose/features/lifecycle.js +71 -71
- package/dist/core/compose/features/position.js +31 -31
- package/dist/core/compose/features/ripple.js +76 -76
- package/dist/core/compose/features/size.js +5 -5
- package/dist/core/compose/features/style.js +7 -7
- package/dist/core/compose/features/text.js +49 -49
- package/dist/core/compose/features/textinput.js +164 -164
- package/dist/core/compose/features/textlabel.js +47 -47
- package/dist/core/compose/features/throttle.js +39 -39
- package/dist/core/compose/features/track.js +24 -24
- package/dist/core/compose/features/variant.js +5 -5
- package/dist/core/compose/features/withEvents.js +48 -48
- package/dist/core/compose/pipe.js +4 -4
- package/dist/core/compose/utils/type-guards.js +6 -6
- package/dist/core/config/component.js +54 -54
- package/dist/core/config/global.js +6 -6
- package/dist/core/config.js +9 -9
- package/dist/core/dom/attributes.js +38 -38
- package/dist/core/dom/classes.js +74 -74
- package/dist/core/dom/create.js +133 -133
- package/dist/core/dom/direction.js +28 -28
- package/dist/core/dom/events.js +80 -80
- package/dist/core/dom/focus.js +38 -38
- package/dist/core/dom/form-value.js +10 -10
- package/dist/core/dom/html.js +7 -7
- package/dist/core/dom/layer.js +134 -134
- package/dist/core/dom/roving.js +69 -69
- package/dist/core/dom/utils.js +38 -38
- package/dist/core/navigation/destinations.js +103 -103
- package/dist/core/navigation/ripple.js +39 -39
- package/dist/core/shapes/cubic.js +55 -55
- package/dist/core/shapes/material.js +164 -164
- package/dist/core/shapes/polygon.js +198 -198
- package/dist/core/state/emitter.js +29 -29
- package/dist/core/state/events.js +30 -30
- package/dist/core/state/store.js +55 -55
- package/dist/core/theme/tokens.js +28 -28
- package/dist/core/utils/attributes.js +8 -8
- package/dist/core/utils/background.js +29 -29
- package/dist/core/utils/color.js +21 -21
- package/dist/core/utils/mobile.js +28 -28
- package/dist/core/utils/object.js +17 -17
- package/dist/core/utils/performance.js +111 -111
- package/dist/core/utils/theme.js +49 -49
- package/dist/core/utils/url.js +0 -0
- package/dist/core/utils/warn.js +14 -14
- package/dist/elements/adapter.js +51 -51
- package/dist/elements/badge.js +23 -23
- package/dist/elements/bottom-app-bar.js +32 -32
- package/dist/elements/bottom-sheet.js +81 -81
- package/dist/elements/button-group.js +151 -151
- package/dist/elements/button.js +40 -40
- package/dist/elements/card.js +89 -89
- package/dist/elements/carousel.js +101 -101
- package/dist/elements/checkbox.js +44 -44
- package/dist/elements/chips.js +185 -185
- package/dist/elements/datepicker.js +101 -101
- package/dist/elements/define.js +571 -571
- package/dist/elements/dialog.js +134 -134
- package/dist/elements/divider.js +16 -16
- package/dist/elements/drawer.js +118 -118
- package/dist/elements/extended-fab.js +29 -29
- package/dist/elements/fab-menu.js +58 -58
- package/dist/elements/fab.js +18 -18
- package/dist/elements/form-button.js +14 -14
- package/dist/elements/icon-button.js +42 -42
- package/dist/elements/index.js +87 -87
- package/dist/elements/lifecycle.js +8 -8
- package/dist/elements/list.js +162 -162
- package/dist/elements/loading-indicator.js +19 -19
- package/dist/elements/menu.js +169 -169
- package/dist/elements/navigation-bar.js +58 -58
- package/dist/elements/navigation-rail.js +110 -110
- 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 +1 -1
- package/dist/elements/preupgrade/button.css +1 -1
- 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 +1 -1
- 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 +1 -1
- package/dist/elements/preupgrade/list.css +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- package/dist/elements/preupgrade.js +0 -1
- package/dist/elements/progress.js +32 -32
- package/dist/elements/radios.js +105 -105
- package/dist/elements/search.js +189 -189
- package/dist/elements/select.js +124 -124
- package/dist/elements/sheet.js +49 -49
- package/dist/elements/side-sheet.js +53 -53
- package/dist/elements/slider.js +117 -117
- package/dist/elements/snackbar.js +45 -45
- package/dist/elements/split-button.js +82 -82
- package/dist/elements/styles.js +27 -27
- package/dist/elements/switch.js +43 -43
- package/dist/elements/tabs.js +96 -96
- package/dist/elements/text-field.js +117 -117
- package/dist/elements/timepicker.js +142 -142
- package/dist/elements/toolbar.js +63 -63
- package/dist/elements/tooltip.js +111 -111
- package/dist/elements/top-app-bar.js +75 -75
- package/dist/package.json +1 -1
- package/dist/react/create.js +113 -113
- package/dist/react/shadow.js +8 -8
- package/dist/solid/create.js +122 -122
- package/dist/solid/shadow.js +6 -6
- package/dist/ssr/react.js +2 -310
- package/dist/ssr/solid.js +1 -16
- package/dist/ssr/svelte.js +1 -73
- package/dist/ssr/vue.js +1 -71
- package/dist/styles/badge.css +1 -1
- package/dist/styles/base.css +1 -1
- package/dist/styles/bottom-app-bar.css +1 -1
- package/dist/styles/bottom-sheet.css +1 -1
- package/dist/styles/button-group.css +1 -1
- package/dist/styles/button.css +1 -1
- 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 +1 -1
- package/dist/styles/dialog.css +1 -1
- package/dist/styles/divider.css +1 -1
- package/dist/styles/drawer.css +1 -1
- 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 +1 -1
- package/dist/styles/list.css +1 -1
- package/dist/styles/loading-indicator.css +1 -1
- package/dist/styles/menu.css +1 -1
- 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 +1 -1
- package/dist/styles/slider.css +1 -1
- package/dist/styles/snackbar.css +1 -1
- 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 +1 -1
- package/dist/styles/timepicker.css +1 -1
- package/dist/styles/toolbar.css +1 -1
- 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 +1 -1
- 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/create.js +123 -123
- package/dist/vue/shadow.js +6 -6
- package/package.json +1 -1
package/dist/elements/dialog.js
CHANGED
|
@@ -4,153 +4,153 @@ import { PREFIX } from "../core/config.js";
|
|
|
4
4
|
import { defineElement } from "./define.js";
|
|
5
5
|
const FOOTER_ALIGNMENTS = ["left", "center", "space-between"];
|
|
6
6
|
const setFooterAlignment = (footer, alignment) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
for (const name of FOOTER_ALIGNMENTS) {
|
|
8
|
+
footer.classList.toggle(`${PREFIX}-dialog__footer--${name}`, name === alignment);
|
|
9
|
+
}
|
|
10
10
|
};
|
|
11
11
|
const setSubtitle = (component, value) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
component.setSubtitle(value === null || value === undefined ? "" : String(value));
|
|
13
|
+
const subtitle = component.element.querySelector(`.${PREFIX}-dialog__header-subtitle`);
|
|
14
|
+
if (subtitle && !subtitle.textContent)
|
|
15
|
+
subtitle.remove();
|
|
16
16
|
};
|
|
17
17
|
const slot = (name, fallback) => {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
const element = document.createElement("slot");
|
|
19
|
+
if (name)
|
|
20
|
+
element.name = name;
|
|
21
|
+
if (fallback)
|
|
22
|
+
element.textContent = fallback;
|
|
23
|
+
return element;
|
|
24
24
|
};
|
|
25
25
|
const create = (config) => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
26
|
+
const { headline, fullscreen, noCloseOnScrimClick, noCloseOnEscape, footerAlignment, ...rest } = config;
|
|
27
|
+
const dialog = createDialog({
|
|
28
|
+
...rest,
|
|
29
|
+
title: " ",
|
|
30
|
+
content: " ",
|
|
31
|
+
...(fullscreen ? { size: "fullscreen" } : {}),
|
|
32
|
+
closeOnOverlayClick: !noCloseOnScrimClick,
|
|
33
|
+
closeOnEscape: !noCloseOnEscape,
|
|
34
|
+
open: false,
|
|
35
|
+
layer: "top",
|
|
36
|
+
});
|
|
37
|
+
dialog.element.querySelector(`.${PREFIX}-dialog__header-title`)?.replaceChildren(slot("headline", headline));
|
|
38
|
+
dialog.getContentElement()?.replaceChildren(slot());
|
|
39
|
+
const footer = document.createElement("div");
|
|
40
|
+
footer.className = `${PREFIX}-dialog__footer`;
|
|
41
|
+
footer.append(slot("actions"));
|
|
42
|
+
setFooterAlignment(footer, footerAlignment);
|
|
43
|
+
if (config.divider) {
|
|
44
|
+
dialog.element.append(createDivider({ variant: "full-width", class: `${PREFIX}-dialog__divider ${PREFIX}-dialog__footer-divider` }).element);
|
|
45
|
+
}
|
|
46
|
+
dialog.element.append(footer);
|
|
47
|
+
return Object.assign(dialog, { show: () => dialog.open() });
|
|
48
48
|
};
|
|
49
49
|
const hasContent = (node) => node.nodeType === Node.ELEMENT_NODE || (node.nodeType === Node.TEXT_NODE && (node.textContent ?? "").trim() !== "");
|
|
50
50
|
const syncRegions = (host, component) => {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
51
|
+
const { element } = component;
|
|
52
|
+
const title = element.querySelector(`.${PREFIX}-dialog__header-title`);
|
|
53
|
+
const headline = title?.querySelector("slot");
|
|
54
|
+
const footer = element.querySelector(`.${PREFIX}-dialog__footer`);
|
|
55
|
+
const actions = footer?.querySelector("slot");
|
|
56
|
+
const named = !!headline && (headline.assignedNodes().some(hasContent) || (headline.textContent ?? "") !== "");
|
|
57
|
+
if (title)
|
|
58
|
+
title.style.display = named ? "" : "none";
|
|
59
|
+
const shown = actions?.assignedElements().length ? "" : "none";
|
|
60
|
+
if (footer)
|
|
61
|
+
footer.style.display = shown;
|
|
62
|
+
const divider = element.querySelector(`.${PREFIX}-dialog__footer-divider`);
|
|
63
|
+
if (divider)
|
|
64
|
+
divider.style.display = shown;
|
|
65
|
+
const label = host.getAttribute("aria-label");
|
|
66
|
+
if (label !== null) {
|
|
67
|
+
element.setAttribute("aria-label", label);
|
|
68
|
+
element.removeAttribute("aria-labelledby");
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
element.removeAttribute("aria-label");
|
|
72
|
+
if (named && title)
|
|
73
|
+
element.setAttribute("aria-labelledby", title.id);
|
|
74
|
+
else
|
|
75
|
+
element.removeAttribute("aria-labelledby");
|
|
76
|
+
}
|
|
77
77
|
};
|
|
78
78
|
const setOpen = (component, open) => {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
79
|
+
if (open === component.isOpen())
|
|
80
|
+
return;
|
|
81
|
+
if (open)
|
|
82
|
+
component.open();
|
|
83
|
+
else
|
|
84
|
+
component.close();
|
|
85
85
|
};
|
|
86
86
|
const dialogSpec = {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
87
|
+
name: "dialog",
|
|
88
|
+
slots: ["headline", "actions"],
|
|
89
|
+
create: (config) => create(config),
|
|
90
|
+
styles: ["progress", "button", "divider", "dialog"],
|
|
91
|
+
hostStyles: ":host{display:contents}",
|
|
92
|
+
attributes: {
|
|
93
|
+
open: { type: "boolean", update: (c, v) => setOpen(c, !!v) },
|
|
94
|
+
headline: {
|
|
95
|
+
type: "string",
|
|
96
|
+
config: "headline",
|
|
97
|
+
update: (c, v, host) => {
|
|
98
|
+
const headline = c.element.querySelector('slot[name="headline"]');
|
|
99
|
+
if (headline)
|
|
100
|
+
headline.textContent = v === null ? "" : String(v);
|
|
101
|
+
syncRegions(host, c);
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
subtitle: { type: "string", config: "subtitle", update: (c, v) => setSubtitle(c, v) },
|
|
105
|
+
size: { type: "string", config: "size" },
|
|
106
|
+
animation: { type: "string", config: "animation" },
|
|
107
|
+
fullscreen: { type: "boolean", config: "fullscreen" },
|
|
108
|
+
"close-button": { type: "boolean", config: "closeButton" },
|
|
109
|
+
divider: { type: "boolean", config: "divider" },
|
|
110
|
+
"footer-alignment": {
|
|
111
|
+
type: "string",
|
|
112
|
+
config: "footerAlignment",
|
|
113
|
+
update: (c, v) => {
|
|
114
|
+
const footer = c.element.querySelector(`.${PREFIX}-dialog__footer`);
|
|
115
|
+
if (footer)
|
|
116
|
+
setFooterAlignment(footer, v);
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
"no-close-on-scrim-click": { type: "boolean", config: "noCloseOnScrimClick" },
|
|
120
|
+
"no-close-on-escape": { type: "boolean", config: "noCloseOnEscape" },
|
|
121
|
+
"aria-label": { type: "string", update: (c, _v, host) => syncRegions(host, c) },
|
|
122
|
+
},
|
|
123
|
+
methods: ["show", "close"],
|
|
124
|
+
events: {
|
|
125
|
+
open: { detail: () => null, state: true },
|
|
126
|
+
close: { detail: () => null, state: true },
|
|
127
|
+
cancel: { detail: () => null },
|
|
128
|
+
},
|
|
129
|
+
setup: (host, component) => {
|
|
130
|
+
const { element } = component;
|
|
131
|
+
const sync = () => syncRegions(host, component);
|
|
132
|
+
const slots = Array.from(element.querySelectorAll("slot"));
|
|
133
|
+
slots.forEach((s) => s.addEventListener("slotchange", sync));
|
|
134
|
+
sync();
|
|
135
|
+
const reflect = () => void host.toggleAttribute("open", component.isOpen());
|
|
136
|
+
component.on("open", reflect);
|
|
137
|
+
component.on("close", reflect);
|
|
138
|
+
const onCancel = (event) => {
|
|
139
|
+
if (host.dispatchEvent(new CustomEvent("cancel", { detail: null, cancelable: true, bubbles: true, composed: true })))
|
|
140
|
+
return;
|
|
141
|
+
event.preventDefault();
|
|
142
|
+
event.stopImmediatePropagation();
|
|
143
|
+
};
|
|
144
|
+
element.addEventListener("cancel", onCancel, true);
|
|
145
|
+
if (host.hasAttribute("open"))
|
|
146
|
+
component.open();
|
|
147
|
+
return () => {
|
|
148
|
+
slots.forEach((s) => s.removeEventListener("slotchange", sync));
|
|
149
|
+
component.off("open", reflect);
|
|
150
|
+
component.off("close", reflect);
|
|
151
|
+
element.removeEventListener("cancel", onCancel, true);
|
|
152
|
+
};
|
|
153
|
+
},
|
|
154
154
|
};
|
|
155
155
|
export const dialogElement = defineElement(dialogSpec);
|
|
156
156
|
export const defineDialog = (options) => dialogElement.define(options);
|
package/dist/elements/divider.js
CHANGED
|
@@ -2,22 +2,22 @@ import { createDivider } from "../components/divider/index.js";
|
|
|
2
2
|
import { defineElement } from "./define.js";
|
|
3
3
|
const variant = (value) => (value === "inset" || value === "middle-inset" ? value : "full-width");
|
|
4
4
|
const dividerSpec = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
5
|
+
name: "divider",
|
|
6
|
+
create: (config) => createDivider(config),
|
|
7
|
+
styles: ["divider"],
|
|
8
|
+
hostStyles: ':host{display:block}:host([orientation="vertical"]:not([hidden])){display:inline-block;align-self:stretch}',
|
|
9
|
+
attributes: {
|
|
10
|
+
orientation: {
|
|
11
|
+
type: "string",
|
|
12
|
+
config: "orientation",
|
|
13
|
+
update: (c, v) => void c.setOrientation(v === "vertical" ? "vertical" : "horizontal"),
|
|
14
|
+
},
|
|
15
|
+
variant: { type: "string", config: "variant", update: (c, v) => void c.setVariant(variant(v)) },
|
|
16
|
+
"inset-start": { type: "number", config: "insetStart" },
|
|
17
|
+
"inset-end": { type: "number", config: "insetEnd" },
|
|
18
|
+
thickness: { type: "number", config: "thickness", update: (c, v) => void c.setThickness(Number(v ?? 1)) },
|
|
19
|
+
color: { type: "string", config: "color", update: (c, v) => void c.setColor(String(v ?? "")) },
|
|
20
|
+
},
|
|
21
21
|
};
|
|
22
22
|
export const dividerElement = defineElement(dividerSpec);
|
|
23
23
|
export const defineDivider = (options) => dividerElement.define(options);
|
package/dist/elements/drawer.js
CHANGED
|
@@ -1,136 +1,136 @@
|
|
|
1
1
|
import createDrawer from "../components/drawer/index.js";
|
|
2
2
|
import { createDeclarationClass, defineElement, DEFAULT_PREFIX, } from "./define.js";
|
|
3
3
|
const declaredItems = (host, active) => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
4
|
+
const itemTag = `${host.localName}-item`;
|
|
5
|
+
const items = [];
|
|
6
|
+
for (const child of Array.from(host.children)) {
|
|
7
|
+
if (child.localName !== itemTag)
|
|
8
|
+
continue;
|
|
9
|
+
const type = child.getAttribute("type");
|
|
10
|
+
const label = child.getAttribute("label") ?? (child.textContent ?? "").trim();
|
|
11
|
+
if (type === "divider") {
|
|
12
|
+
items.push({ type: "divider" });
|
|
13
|
+
continue;
|
|
14
|
+
}
|
|
15
|
+
if (type === "section") {
|
|
16
|
+
items.push({ type: "section", label });
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
if (!label)
|
|
20
|
+
continue;
|
|
21
|
+
const id = child.getAttribute("value") ?? label;
|
|
22
|
+
items.push({
|
|
23
|
+
id,
|
|
24
|
+
label,
|
|
25
|
+
icon: child.getAttribute("icon") ?? undefined,
|
|
26
|
+
badge: child.getAttribute("badge") ?? undefined,
|
|
27
|
+
disabled: child.hasAttribute("disabled"),
|
|
28
|
+
active: id === active,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
return items;
|
|
32
32
|
};
|
|
33
33
|
const readDrawer = (host) => ({ items: declaredItems(host, host.getAttribute("value")) });
|
|
34
34
|
const withoutActive = (items) => JSON.stringify(items.map(({ active: _active, ...item }) => item));
|
|
35
35
|
const updateDrawer = (host, component) => {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
36
|
+
const items = declaredItems(host, host.dirty ? component.getActive() : host.getAttribute("value"));
|
|
37
|
+
if (withoutActive(items) === withoutActive(component.getItems()))
|
|
38
|
+
return true;
|
|
39
|
+
const focused = host.shadowRoot?.activeElement?.dataset.id;
|
|
40
|
+
component.setItems(items);
|
|
41
|
+
if (focused !== undefined) {
|
|
42
|
+
const item = Array.from(component.element.querySelectorAll("[data-id]")).find((element) => element.dataset.id === focused && !element.hasAttribute("disabled"));
|
|
43
|
+
item?.focus();
|
|
44
|
+
}
|
|
45
|
+
return true;
|
|
46
46
|
};
|
|
47
47
|
const select = (component, value) => void component.setActive(value === null || value === undefined ? "" : String(value));
|
|
48
48
|
const create = ({ modal, ...config }) => {
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
const width = typeof config.width === "string" && /^\d+(\.\d+)?$/.test(config.width) ? Number(config.width) : config.width;
|
|
50
|
+
return createDrawer({ ...config, width, ...(modal ? { variant: "modal", layer: "top" } : { variant: "standard" }) });
|
|
51
51
|
};
|
|
52
52
|
const drawerSpec = {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
53
|
+
name: "drawer",
|
|
54
|
+
create: (config) => create(config),
|
|
55
|
+
styles: ["drawer"],
|
|
56
|
+
hostStyles: ":host{display:block;flex-shrink:0}",
|
|
57
|
+
attributes: {
|
|
58
|
+
value: { type: "string", update: (c, v) => select(c, v) },
|
|
59
|
+
open: { type: "boolean", config: "open", update: (c, v) => void (v ? c.open() : c.close()) },
|
|
60
|
+
modal: { type: "boolean", config: "modal" },
|
|
61
|
+
headline: { type: "string", config: "headline", update: (c, v) => void c.setHeadline(v === null ? "" : String(v)) },
|
|
62
|
+
position: { type: "string", config: "position" },
|
|
63
|
+
width: { type: "string", config: "width" },
|
|
64
|
+
dense: { type: "boolean", config: "dense" },
|
|
65
|
+
"no-close-on-scrim-click": { type: "boolean", update: () => undefined },
|
|
66
|
+
"no-close-on-escape": { type: "boolean", update: () => undefined },
|
|
67
|
+
"aria-label": {
|
|
68
|
+
type: "string",
|
|
69
|
+
config: "ariaLabel",
|
|
70
|
+
update: (c, v) => c.element.setAttribute("aria-label", v === null ? c.getHeadline() || "Navigation" : String(v)),
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
properties: {
|
|
74
|
+
value: { get: (c) => c.getActive(), set: (c, v) => select(c, v) },
|
|
75
|
+
},
|
|
76
|
+
model: "value",
|
|
77
|
+
events: {
|
|
78
|
+
change: {
|
|
79
|
+
detail: (payload) => ({ value: payload.value }),
|
|
80
|
+
},
|
|
81
|
+
open: { detail: () => null, state: true },
|
|
82
|
+
close: { detail: () => null, state: true },
|
|
83
|
+
},
|
|
84
|
+
config: readDrawer,
|
|
85
|
+
setup: (host, component) => {
|
|
86
|
+
const onSelect = ({ id }) => {
|
|
87
|
+
host.dispatchEvent(new CustomEvent("change", { detail: { value: id }, bubbles: true, composed: true }));
|
|
88
|
+
};
|
|
89
|
+
const reflect = () => {
|
|
90
|
+
if (host.hasAttribute("modal"))
|
|
91
|
+
host.toggleAttribute("open", component.isOpen());
|
|
92
|
+
};
|
|
93
|
+
const root = component.element;
|
|
94
|
+
const onClick = (event) => {
|
|
95
|
+
if (event.target === root && host.hasAttribute("no-close-on-scrim-click"))
|
|
96
|
+
event.stopImmediatePropagation();
|
|
97
|
+
};
|
|
98
|
+
const onCancel = (event) => {
|
|
99
|
+
if (!host.hasAttribute("no-close-on-escape"))
|
|
100
|
+
return;
|
|
101
|
+
event.preventDefault();
|
|
102
|
+
event.stopImmediatePropagation();
|
|
103
|
+
};
|
|
104
|
+
root.addEventListener("click", onClick, true);
|
|
105
|
+
root.addEventListener("cancel", onCancel, true);
|
|
106
|
+
component.on("select", onSelect);
|
|
107
|
+
component.on("open", reflect);
|
|
108
|
+
component.on("close", reflect);
|
|
109
|
+
return () => {
|
|
110
|
+
root.removeEventListener("click", onClick, true);
|
|
111
|
+
root.removeEventListener("cancel", onCancel, true);
|
|
112
|
+
component.off("select", onSelect);
|
|
113
|
+
component.off("open", reflect);
|
|
114
|
+
component.off("close", reflect);
|
|
115
|
+
};
|
|
116
|
+
},
|
|
117
|
+
observeChildren: updateDrawer,
|
|
118
118
|
};
|
|
119
119
|
export const drawerElement = defineElement(drawerSpec);
|
|
120
120
|
export const drawerItemDeclaration = {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
121
|
+
name: "drawer-item",
|
|
122
|
+
attributes: {
|
|
123
|
+
type: { type: "string" },
|
|
124
|
+
value: { type: "string" },
|
|
125
|
+
label: { type: "string" },
|
|
126
|
+
icon: { type: "string" },
|
|
127
|
+
badge: { type: "string" },
|
|
128
|
+
disabled: { type: "boolean" },
|
|
129
|
+
},
|
|
130
130
|
};
|
|
131
131
|
export const defineDrawer = (options) => {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
132
|
+
const itemTag = `${options?.prefix ?? DEFAULT_PREFIX}-${drawerItemDeclaration.name}`;
|
|
133
|
+
if (!customElements.get(itemTag))
|
|
134
|
+
customElements.define(itemTag, createDeclarationClass(drawerItemDeclaration.attributes));
|
|
135
|
+
return drawerElement.define(options);
|
|
136
136
|
};
|
|
@@ -4,35 +4,35 @@ import { buttonForm, submitOnClick, typeAttribute } from "./form-button.js";
|
|
|
4
4
|
import { FLOATING_HOST_STYLES } from "./floating-placement.js";
|
|
5
5
|
const create = (config) => createExtendedFab({ ...config, type: "button" });
|
|
6
6
|
const extendedFabSpec = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
7
|
+
name: "extended-fab",
|
|
8
|
+
create: (config) => create(config),
|
|
9
|
+
styles: ["extended-fab"],
|
|
10
|
+
hostStyles: ":host{vertical-align:middle}" + FLOATING_HOST_STYLES,
|
|
11
|
+
attributes: {
|
|
12
|
+
variant: { type: "string", config: "variant" },
|
|
13
|
+
size: { type: "string", config: "size" },
|
|
14
|
+
width: { type: "string", config: "width" },
|
|
15
|
+
disabled: { type: "boolean", config: "disabled", update: (c, v) => void (v ? c.disable() : c.enable()) },
|
|
16
|
+
icon: { type: "string", config: "icon", update: (c, v) => void c.setIcon(String(v ?? "")) },
|
|
17
|
+
"icon-position": { type: "string", config: "iconPosition" },
|
|
18
|
+
position: { type: "string", config: "position" },
|
|
19
|
+
placement: { type: "string", config: "placement" },
|
|
20
|
+
"collapse-on-scroll": { type: "boolean", config: "collapseOnScroll" },
|
|
21
|
+
value: { type: "string", config: "value", update: (c, v) => void c.setValue(String(v ?? "")) },
|
|
22
|
+
type: typeAttribute,
|
|
23
|
+
"aria-label": { type: "string", config: "ariaLabel" },
|
|
24
|
+
},
|
|
25
|
+
methods: ["lower", "raise", "collapse", "expand"],
|
|
26
|
+
events: {
|
|
27
|
+
collapse: { detail: () => null },
|
|
28
|
+
expand: { detail: () => null },
|
|
29
|
+
},
|
|
30
|
+
slot: {
|
|
31
|
+
attribute: "label",
|
|
32
|
+
config: "text",
|
|
33
|
+
},
|
|
34
|
+
form: buttonForm(),
|
|
35
|
+
setup: submitOnClick,
|
|
36
36
|
};
|
|
37
37
|
export const extendedFabElement = defineElement(extendedFabSpec);
|
|
38
38
|
export const defineExtendedFab = (options) => extendedFabElement.define(options);
|