mdui 1.0.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +49 -70
- package/components/avatar/index.d.ts +49 -0
- package/components/avatar/index.js +55 -0
- package/components/avatar/style.d.ts +1 -0
- package/components/avatar/style.js +2 -0
- package/components/avatar.d.ts +1 -0
- package/components/avatar.js +1 -0
- package/components/badge/index.d.ts +28 -0
- package/components/badge/index.js +41 -0
- package/components/badge/style.d.ts +1 -0
- package/components/badge/style.js +2 -0
- package/components/badge.d.ts +1 -0
- package/components/badge.js +1 -0
- package/components/bottom-app-bar/index.d.ts +60 -0
- package/components/bottom-app-bar/index.js +105 -0
- package/components/bottom-app-bar/style.d.ts +1 -0
- package/components/bottom-app-bar/style.js +2 -0
- package/components/bottom-app-bar.d.ts +1 -0
- package/components/bottom-app-bar.js +1 -0
- package/components/button/button-base-style.d.ts +1 -0
- package/components/button/button-base-style.js +2 -0
- package/components/button/button-base.d.ts +138 -0
- package/components/button/button-base.js +206 -0
- package/components/button/index.d.ts +64 -0
- package/components/button/index.js +110 -0
- package/components/button/style.d.ts +1 -0
- package/components/button/style.js +4 -0
- package/components/button-icon/index.d.ts +66 -0
- package/components/button-icon/index.js +129 -0
- package/components/button-icon/style.d.ts +1 -0
- package/components/button-icon/style.js +4 -0
- package/components/button-icon.d.ts +1 -0
- package/components/button-icon.js +1 -0
- package/components/button.d.ts +1 -0
- package/components/button.js +1 -0
- package/components/card/index.d.ts +49 -0
- package/components/card/index.js +87 -0
- package/components/card/style.d.ts +1 -0
- package/components/card/style.js +2 -0
- package/components/card.d.ts +1 -0
- package/components/card.js +1 -0
- package/components/checkbox/index.d.ts +130 -0
- package/components/checkbox/index.js +257 -0
- package/components/checkbox/style.d.ts +1 -0
- package/components/checkbox/style.js +2 -0
- package/components/checkbox.d.ts +1 -0
- package/components/checkbox.js +1 -0
- package/components/chip/index.d.ts +102 -0
- package/components/chip/index.js +243 -0
- package/components/chip/style.d.ts +1 -0
- package/components/chip/style.js +4 -0
- package/components/chip.d.ts +1 -0
- package/components/chip.js +1 -0
- package/components/circular-progress/index.d.ts +28 -0
- package/components/circular-progress/index.js +61 -0
- package/components/circular-progress/style.d.ts +1 -0
- package/components/circular-progress/style.js +2 -0
- package/components/circular-progress.d.ts +1 -0
- package/components/circular-progress.js +1 -0
- package/components/collapse/collapse-item-style.d.ts +1 -0
- package/components/collapse/collapse-item-style.js +2 -0
- package/components/collapse/collapse-item.d.ts +56 -0
- package/components/collapse/collapse-item.js +126 -0
- package/components/collapse/collapse-style.d.ts +1 -0
- package/components/collapse/collapse-style.js +2 -0
- package/components/collapse/collapse.d.ts +49 -0
- package/components/collapse/collapse.js +175 -0
- package/components/collapse-item.d.ts +1 -0
- package/components/collapse-item.js +1 -0
- package/components/collapse.d.ts +1 -0
- package/components/collapse.js +1 -0
- package/components/dialog/index.d.ts +99 -0
- package/components/dialog/index.js +307 -0
- package/components/dialog/style.d.ts +1 -0
- package/components/dialog/style.js +2 -0
- package/components/dialog.d.ts +1 -0
- package/components/dialog.js +1 -0
- package/components/divider/index.d.ts +30 -0
- package/components/divider/index.js +58 -0
- package/components/divider/style.d.ts +1 -0
- package/components/divider/style.js +2 -0
- package/components/divider.d.ts +1 -0
- package/components/divider.js +1 -0
- package/components/dropdown/index.d.ts +131 -0
- package/components/dropdown/index.js +571 -0
- package/components/dropdown/style.d.ts +1 -0
- package/components/dropdown/style.js +2 -0
- package/components/dropdown.d.ts +1 -0
- package/components/dropdown.js +1 -0
- package/components/fab/index.d.ts +70 -0
- package/components/fab/index.js +144 -0
- package/components/fab/style.d.ts +1 -0
- package/components/fab/style.js +8 -0
- package/components/fab.d.ts +1 -0
- package/components/fab.js +1 -0
- package/components/icon/index.d.ts +29 -0
- package/components/icon/index.js +57 -0
- package/components/icon/style.d.ts +1 -0
- package/components/icon/style.js +2 -0
- package/components/icon.d.ts +1 -0
- package/components/icon.js +1 -0
- package/components/layout/helper.d.ts +67 -0
- package/components/layout/helper.js +212 -0
- package/components/layout/layout-item-base.d.ts +17 -0
- package/components/layout/layout-item-base.js +45 -0
- package/components/layout/layout-item-style.d.ts +1 -0
- package/components/layout/layout-item-style.js +2 -0
- package/components/layout/layout-item.d.ts +37 -0
- package/components/layout/layout-item.js +58 -0
- package/components/layout/layout-main-style.d.ts +1 -0
- package/components/layout/layout-main-style.js +2 -0
- package/components/layout/layout-main.d.ts +27 -0
- package/components/layout/layout-main.js +46 -0
- package/components/layout/layout-style.d.ts +1 -0
- package/components/layout/layout-style.js +2 -0
- package/components/layout/layout.d.ts +28 -0
- package/components/layout/layout.js +43 -0
- package/components/layout-item.d.ts +1 -0
- package/components/layout-item.js +1 -0
- package/components/layout-main.d.ts +1 -0
- package/components/layout-main.js +1 -0
- package/components/layout.d.ts +1 -0
- package/components/layout.js +1 -0
- package/components/linear-progress/index.d.ts +30 -0
- package/components/linear-progress/index.js +48 -0
- package/components/linear-progress/style.d.ts +1 -0
- package/components/linear-progress/style.js +2 -0
- package/components/linear-progress.d.ts +1 -0
- package/components/linear-progress.js +1 -0
- package/components/list/list-item-style.d.ts +1 -0
- package/components/list/list-item-style.js +4 -0
- package/components/list/list-item.d.ts +111 -0
- package/components/list/list-item.js +186 -0
- package/components/list/list-style.d.ts +1 -0
- package/components/list/list-style.js +2 -0
- package/components/list/list-subheader-style.d.ts +1 -0
- package/components/list/list-subheader-style.js +2 -0
- package/components/list/list-subheader.d.ts +24 -0
- package/components/list/list-subheader.js +30 -0
- package/components/list/list.d.ts +24 -0
- package/components/list/list.js +27 -0
- package/components/list-item.d.ts +1 -0
- package/components/list-item.js +1 -0
- package/components/list-subheader.d.ts +1 -0
- package/components/list-subheader.js +1 -0
- package/components/list.d.ts +1 -0
- package/components/list.js +1 -0
- package/components/menu/menu-item-style.d.ts +1 -0
- package/components/menu/menu-item-style.js +2 -0
- package/components/menu/menu-item.d.ts +123 -0
- package/components/menu/menu-item.js +412 -0
- package/components/menu/menu-style.d.ts +1 -0
- package/components/menu/menu-style.js +2 -0
- package/components/menu/menu.d.ts +111 -0
- package/components/menu/menu.js +425 -0
- package/components/menu-item.d.ts +1 -0
- package/components/menu-item.js +1 -0
- package/components/menu.d.ts +1 -0
- package/components/menu.js +1 -0
- package/components/navigation-bar/navigation-bar-item-style.d.ts +1 -0
- package/components/navigation-bar/navigation-bar-item-style.js +2 -0
- package/components/navigation-bar/navigation-bar-item.d.ts +72 -0
- package/components/navigation-bar/navigation-bar-item.js +120 -0
- package/components/navigation-bar/navigation-bar-style.d.ts +1 -0
- package/components/navigation-bar/navigation-bar-style.js +2 -0
- package/components/navigation-bar/navigation-bar.d.ts +78 -0
- package/components/navigation-bar/navigation-bar.js +180 -0
- package/components/navigation-bar-item.d.ts +1 -0
- package/components/navigation-bar-item.js +1 -0
- package/components/navigation-bar.d.ts +1 -0
- package/components/navigation-bar.js +1 -0
- package/components/navigation-drawer/index.d.ts +84 -0
- package/components/navigation-drawer/index.js +365 -0
- package/components/navigation-drawer/style.d.ts +1 -0
- package/components/navigation-drawer/style.js +2 -0
- package/components/navigation-drawer.d.ts +1 -0
- package/components/navigation-drawer.js +1 -0
- package/components/navigation-rail/navigation-rail-item-style.d.ts +1 -0
- package/components/navigation-rail/navigation-rail-item-style.js +2 -0
- package/components/navigation-rail/navigation-rail-item.d.ts +72 -0
- package/components/navigation-rail/navigation-rail-item.js +128 -0
- package/components/navigation-rail/navigation-rail-style.d.ts +1 -0
- package/components/navigation-rail/navigation-rail-style.js +2 -0
- package/components/navigation-rail/navigation-rail.d.ts +87 -0
- package/components/navigation-rail/navigation-rail.js +230 -0
- package/components/navigation-rail-item.d.ts +1 -0
- package/components/navigation-rail-item.js +1 -0
- package/components/navigation-rail.d.ts +1 -0
- package/components/navigation-rail.js +1 -0
- package/components/radio/radio-group-style.d.ts +1 -0
- package/components/radio/radio-group-style.js +2 -0
- package/components/radio/radio-group.d.ts +103 -0
- package/components/radio/radio-group.js +268 -0
- package/components/radio/radio-style.d.ts +1 -0
- package/components/radio/radio-style.js +2 -0
- package/components/radio/radio.d.ts +71 -0
- package/components/radio/radio.js +144 -0
- package/components/radio-group.d.ts +1 -0
- package/components/radio-group.js +1 -0
- package/components/radio.d.ts +1 -0
- package/components/radio.js +1 -0
- package/components/range-slider/index.d.ts +67 -0
- package/components/range-slider/index.js +210 -0
- package/components/range-slider.d.ts +1 -0
- package/components/range-slider.js +1 -0
- package/components/ripple/index.d.ts +44 -0
- package/components/ripple/index.js +173 -0
- package/components/ripple/ripple-mixin.d.ts +28 -0
- package/components/ripple/ripple-mixin.js +258 -0
- package/components/ripple/style.d.ts +1 -0
- package/components/ripple/style.js +2 -0
- package/components/ripple.d.ts +1 -0
- package/components/ripple.js +1 -0
- package/components/segmented-button/segmented-button-group-style.d.ts +1 -0
- package/components/segmented-button/segmented-button-group-style.js +2 -0
- package/components/segmented-button/segmented-button-group.d.ts +125 -0
- package/components/segmented-button/segmented-button-group.js +383 -0
- package/components/segmented-button/segmented-button-style.d.ts +1 -0
- package/components/segmented-button/segmented-button-style.js +4 -0
- package/components/segmented-button/segmented-button.d.ts +73 -0
- package/components/segmented-button/segmented-button.js +160 -0
- package/components/segmented-button-group.d.ts +1 -0
- package/components/segmented-button-group.js +1 -0
- package/components/segmented-button.d.ts +1 -0
- package/components/segmented-button.js +1 -0
- package/components/select/index.d.ts +200 -0
- package/components/select/index.js +390 -0
- package/components/select/style.d.ts +1 -0
- package/components/select/style.js +2 -0
- package/components/select.d.ts +1 -0
- package/components/select.js +1 -0
- package/components/slider/index.d.ts +53 -0
- package/components/slider/index.js +128 -0
- package/components/slider/slider-base-style.d.ts +1 -0
- package/components/slider/slider-base-style.js +2 -0
- package/components/slider/slider-base.d.ts +92 -0
- package/components/slider/slider-base.js +199 -0
- package/components/slider/style.d.ts +1 -0
- package/components/slider/style.js +2 -0
- package/components/slider.d.ts +1 -0
- package/components/slider.js +1 -0
- package/components/snackbar/index.d.ts +98 -0
- package/components/snackbar/index.js +285 -0
- package/components/snackbar/style.d.ts +1 -0
- package/components/snackbar/style.js +2 -0
- package/components/snackbar.d.ts +1 -0
- package/components/snackbar.js +1 -0
- package/components/switch/index.d.ts +123 -0
- package/components/switch/index.js +245 -0
- package/components/switch/style.d.ts +1 -0
- package/components/switch/style.js +2 -0
- package/components/switch.d.ts +1 -0
- package/components/switch.js +1 -0
- package/components/tab-panel.d.ts +1 -0
- package/components/tab-panel.js +1 -0
- package/components/tab.d.ts +1 -0
- package/components/tab.js +1 -0
- package/components/tabs/tab-panel-style.d.ts +1 -0
- package/components/tabs/tab-panel-style.js +2 -0
- package/components/tabs/tab-panel.d.ts +36 -0
- package/components/tabs/tab-panel.js +52 -0
- package/components/tabs/tab-style.d.ts +1 -0
- package/components/tabs/tab-style.js +2 -0
- package/components/tabs/tab.d.ts +69 -0
- package/components/tabs/tab.js +110 -0
- package/components/tabs/tabs-style.d.ts +1 -0
- package/components/tabs/tabs-style.js +2 -0
- package/components/tabs/tabs.d.ts +87 -0
- package/components/tabs/tabs.js +221 -0
- package/components/tabs.d.ts +1 -0
- package/components/tabs.js +1 -0
- package/components/text-field/index.d.ts +400 -0
- package/components/text-field/index.js +752 -0
- package/components/text-field/style.d.ts +1 -0
- package/components/text-field/style.js +2 -0
- package/components/text-field.d.ts +1 -0
- package/components/text-field.js +1 -0
- package/components/tooltip/index.d.ts +140 -0
- package/components/tooltip/index.js +497 -0
- package/components/tooltip/style.d.ts +1 -0
- package/components/tooltip/style.js +2 -0
- package/components/tooltip.d.ts +1 -0
- package/components/tooltip.js +1 -0
- package/components/top-app-bar/top-app-bar-style.d.ts +1 -0
- package/components/top-app-bar/top-app-bar-style.js +2 -0
- package/components/top-app-bar/top-app-bar-title-style.d.ts +1 -0
- package/components/top-app-bar/top-app-bar-title-style.js +2 -0
- package/components/top-app-bar/top-app-bar-title.d.ts +46 -0
- package/components/top-app-bar/top-app-bar-title.js +76 -0
- package/components/top-app-bar/top-app-bar.d.ts +74 -0
- package/components/top-app-bar/top-app-bar.js +178 -0
- package/components/top-app-bar-title.d.ts +1 -0
- package/components/top-app-bar-title.js +1 -0
- package/components/top-app-bar.d.ts +1 -0
- package/components/top-app-bar.js +1 -0
- package/css-data.zh-cn.json +2819 -0
- package/custom-elements.json +28087 -0
- package/functions/alert.d.ts +80 -0
- package/functions/alert.js +59 -0
- package/functions/breakpoint.d.ts +1 -0
- package/functions/breakpoint.js +1 -0
- package/functions/confirm.d.ts +95 -0
- package/functions/confirm.js +68 -0
- package/functions/dialog.d.ts +97 -0
- package/functions/dialog.js +100 -0
- package/functions/getColorFromImage.d.ts +7 -0
- package/functions/getColorFromImage.js +12 -0
- package/functions/getTheme.d.ts +10 -0
- package/functions/getTheme.js +16 -0
- package/functions/observeResize.d.ts +2 -0
- package/functions/observeResize.js +1 -0
- package/functions/prompt.d.ts +110 -0
- package/functions/prompt.js +103 -0
- package/functions/removeColorScheme.d.ts +6 -0
- package/functions/removeColorScheme.js +8 -0
- package/functions/setColorScheme.d.ts +15 -0
- package/functions/setColorScheme.js +15 -0
- package/functions/setTheme.d.ts +10 -0
- package/functions/setTheme.js +16 -0
- package/functions/snackbar.d.ts +91 -0
- package/functions/snackbar.js +84 -0
- package/functions/throttle.d.ts +1 -0
- package/functions/throttle.js +1 -0
- package/functions/utils/colorScheme.d.ts +39 -0
- package/functions/utils/colorScheme.js +133 -0
- package/functions/utils/theme.d.ts +1 -0
- package/html-data.zh-cn.json +6566 -0
- package/jq.d.ts +1 -0
- package/jq.js +1 -0
- package/mdui.css +1 -0
- package/mdui.d.ts +61 -0
- package/mdui.esm.js +22 -0
- package/mdui.global.js +22 -0
- package/mdui.js +61 -0
- package/package.json +39 -68
- package/web-types.zh-cn.json +11728 -0
- package/dist/css/mdui.css +0 -13559
- package/dist/css/mdui.css.map +0 -1
- package/dist/css/mdui.min.css +0 -6
- package/dist/css/mdui.min.css.map +0 -1
- package/dist/fonts/roboto/LICENSE.txt +0 -201
- package/dist/fonts/roboto/Roboto-Black.woff +0 -0
- package/dist/fonts/roboto/Roboto-Black.woff2 +0 -0
- package/dist/fonts/roboto/Roboto-BlackItalic.woff +0 -0
- package/dist/fonts/roboto/Roboto-BlackItalic.woff2 +0 -0
- package/dist/fonts/roboto/Roboto-Bold.woff +0 -0
- package/dist/fonts/roboto/Roboto-Bold.woff2 +0 -0
- package/dist/fonts/roboto/Roboto-BoldItalic.woff +0 -0
- package/dist/fonts/roboto/Roboto-BoldItalic.woff2 +0 -0
- package/dist/fonts/roboto/Roboto-Light.woff +0 -0
- package/dist/fonts/roboto/Roboto-Light.woff2 +0 -0
- package/dist/fonts/roboto/Roboto-LightItalic.woff +0 -0
- package/dist/fonts/roboto/Roboto-LightItalic.woff2 +0 -0
- package/dist/fonts/roboto/Roboto-Medium.woff +0 -0
- package/dist/fonts/roboto/Roboto-Medium.woff2 +0 -0
- package/dist/fonts/roboto/Roboto-MediumItalic.woff +0 -0
- package/dist/fonts/roboto/Roboto-MediumItalic.woff2 +0 -0
- package/dist/fonts/roboto/Roboto-Regular.woff +0 -0
- package/dist/fonts/roboto/Roboto-Regular.woff2 +0 -0
- package/dist/fonts/roboto/Roboto-RegularItalic.woff +0 -0
- package/dist/fonts/roboto/Roboto-RegularItalic.woff2 +0 -0
- package/dist/fonts/roboto/Roboto-Thin.woff +0 -0
- package/dist/fonts/roboto/Roboto-Thin.woff2 +0 -0
- package/dist/fonts/roboto/Roboto-ThinItalic.woff +0 -0
- package/dist/fonts/roboto/Roboto-ThinItalic.woff2 +0 -0
- package/dist/icons/material-icons/LICENSE.txt +0 -393
- package/dist/icons/material-icons/MaterialIcons-Regular.ijmap +0 -1
- package/dist/icons/material-icons/MaterialIcons-Regular.woff +0 -0
- package/dist/icons/material-icons/MaterialIcons-Regular.woff2 +0 -0
- package/dist/js/mdui.esm.js +0 -5976
- package/dist/js/mdui.esm.js.map +0 -1
- package/dist/js/mdui.js +0 -6474
- package/dist/js/mdui.js.map +0 -1
- package/dist/js/mdui.min.js +0 -7
- package/dist/js/mdui.min.js.map +0 -1
- package/es/components/appbar/index.d.ts +0 -2
- package/es/components/appbar/index.js +0 -17
- package/es/components/bottom_nav/index.d.ts +0 -9
- package/es/components/bottom_nav/index.js +0 -38
- package/es/components/collapse/collapseAbstract.d.ts +0 -110
- package/es/components/collapse/collapseAbstract.js +0 -175
- package/es/components/collapse/customAttr.d.ts +0 -2
- package/es/components/collapse/customAttr.js +0 -11
- package/es/components/collapse/index.d.ts +0 -23
- package/es/components/collapse/index.js +0 -8
- package/es/components/dialog/alert.d.ts +0 -44
- package/es/components/dialog/alert.js +0 -42
- package/es/components/dialog/class.d.ts +0 -133
- package/es/components/dialog/class.js +0 -316
- package/es/components/dialog/confirm.d.ts +0 -54
- package/es/components/dialog/confirm.js +0 -55
- package/es/components/dialog/customAttr.d.ts +0 -4
- package/es/components/dialog/customAttr.js +0 -25
- package/es/components/dialog/dialog.d.ts +0 -91
- package/es/components/dialog/dialog.js +0 -101
- package/es/components/dialog/index.d.ts +0 -20
- package/es/components/dialog/index.js +0 -14
- package/es/components/dialog/prompt.d.ts +0 -74
- package/es/components/dialog/prompt.js +0 -109
- package/es/components/drawer/customAttr.d.ts +0 -4
- package/es/components/drawer/customAttr.js +0 -20
- package/es/components/drawer/index.d.ts +0 -111
- package/es/components/drawer/index.js +0 -310
- package/es/components/fab/customAttr.d.ts +0 -1
- package/es/components/fab/customAttr.js +0 -13
- package/es/components/fab/index.d.ts +0 -100
- package/es/components/fab/index.js +0 -144
- package/es/components/headroom/customAttr.d.ts +0 -2
- package/es/components/headroom/customAttr.js +0 -11
- package/es/components/headroom/index.d.ts +0 -120
- package/es/components/headroom/index.js +0 -167
- package/es/components/menu/customAttr.d.ts +0 -3
- package/es/components/menu/customAttr.js +0 -24
- package/es/components/menu/index.d.ts +0 -167
- package/es/components/menu/index.js +0 -512
- package/es/components/panel/customAttr.d.ts +0 -2
- package/es/components/panel/customAttr.js +0 -11
- package/es/components/panel/index.d.ts +0 -23
- package/es/components/panel/index.js +0 -8
- package/es/components/progress/spinner.d.ts +0 -16
- package/es/components/progress/spinner.js +0 -47
- package/es/components/ripple/index.d.ts +0 -25
- package/es/components/ripple/index.js +0 -170
- package/es/components/select/customAttr.d.ts +0 -2
- package/es/components/select/customAttr.js +0 -11
- package/es/components/select/index.d.ts +0 -160
- package/es/components/select/index.js +0 -340
- package/es/components/slider/index.d.ts +0 -28
- package/es/components/slider/index.js +0 -134
- package/es/components/snackbar/index.d.ts +0 -126
- package/es/components/snackbar/index.js +0 -217
- package/es/components/tab/customAttr.d.ts +0 -2
- package/es/components/tab/customAttr.js +0 -11
- package/es/components/tab/index.d.ts +0 -114
- package/es/components/tab/index.js +0 -266
- package/es/components/table/index.d.ts +0 -25
- package/es/components/table/index.js +0 -178
- package/es/components/textfield/index.d.ts +0 -28
- package/es/components/textfield/index.js +0 -147
- package/es/components/tooltip/customAttr.d.ts +0 -3
- package/es/components/tooltip/customAttr.js +0 -20
- package/es/components/tooltip/index.d.ts +0 -123
- package/es/components/tooltip/index.js +0 -251
- package/es/global/mutation.d.ts +0 -23
- package/es/global/mutation.js +0 -14
- package/es/index.d.ts +0 -36
- package/es/index.js +0 -36
- package/es/interfaces/MduiStatic.d.ts +0 -8
- package/es/jq.d.ts +0 -99
- package/es/jq.js +0 -102
- package/es/jq_extends/methods/mutation.d.ts +0 -11
- package/es/jq_extends/methods/mutation.js +0 -19
- package/es/jq_extends/methods/reflow.d.ts +0 -14
- package/es/jq_extends/methods/reflow.js +0 -7
- package/es/jq_extends/methods/transform.d.ts +0 -14
- package/es/jq_extends/methods/transform.js +0 -8
- package/es/jq_extends/methods/transformOrigin.d.ts +0 -14
- package/es/jq_extends/methods/transformOrigin.js +0 -8
- package/es/jq_extends/methods/transition.d.ts +0 -15
- package/es/jq_extends/methods/transition.js +0 -12
- package/es/jq_extends/methods/transitionEnd.d.ts +0 -17
- package/es/jq_extends/methods/transitionEnd.js +0 -23
- package/es/jq_extends/static/guid.d.ts +0 -18
- package/es/jq_extends/static/guid.js +0 -30
- package/es/jq_extends/static/hideOverlay.d.ts +0 -23
- package/es/jq_extends/static/hideOverlay.js +0 -25
- package/es/jq_extends/static/lockScreen.d.ts +0 -15
- package/es/jq_extends/static/lockScreen.js +0 -14
- package/es/jq_extends/static/showOverlay.d.ts +0 -23
- package/es/jq_extends/static/showOverlay.js +0 -27
- package/es/jq_extends/static/throttle.d.ts +0 -17
- package/es/jq_extends/static/throttle.js +0 -13
- package/es/jq_extends/static/unlockScreen.d.ts +0 -22
- package/es/jq_extends/static/unlockScreen.js +0 -13
- package/es/mdui.d.ts +0 -3
- package/es/mdui.js +0 -8
- package/es/utils/componentEvent.d.ts +0 -13
- package/es/utils/componentEvent.js +0 -37
- package/es/utils/dom.d.ts +0 -4
- package/es/utils/dom.js +0 -5
- package/es/utils/mutation.d.ts +0 -15
- package/es/utils/mutation.js +0 -24
- package/es/utils/parseOptions.d.ts +0 -9
- package/es/utils/parseOptions.js +0 -15
- package/es/utils/queue.d.ts +0 -18
- package/es/utils/queue.js +0 -26
- package/es/utils/touchHandler.d.ts +0 -50
- package/es/utils/touchHandler.js +0 -76
- package/src/components/appbar/index.less +0 -110
- package/src/components/appbar/index.ts +0 -19
- package/src/components/bottom_nav/index.less +0 -155
- package/src/components/bottom_nav/index.ts +0 -43
- package/src/components/button/index.less +0 -291
- package/src/components/card/index.less +0 -200
- package/src/components/chip/index.less +0 -97
- package/src/components/collapse/collapseAbstract.ts +0 -270
- package/src/components/collapse/customAttr.ts +0 -13
- package/src/components/collapse/index.less +0 -44
- package/src/components/collapse/index.ts +0 -32
- package/src/components/dialog/alert.less +0 -11
- package/src/components/dialog/alert.ts +0 -111
- package/src/components/dialog/class.ts +0 -432
- package/src/components/dialog/confirm.less +0 -11
- package/src/components/dialog/confirm.ts +0 -140
- package/src/components/dialog/customAttr.ts +0 -41
- package/src/components/dialog/dialog.ts +0 -224
- package/src/components/dialog/index.less +0 -154
- package/src/components/dialog/index.ts +0 -40
- package/src/components/dialog/prompt.less +0 -16
- package/src/components/dialog/prompt.ts +0 -231
- package/src/components/divider/index.less +0 -49
- package/src/components/drawer/customAttr.ts +0 -30
- package/src/components/drawer/index.less +0 -177
- package/src/components/drawer/index.ts +0 -425
- package/src/components/fab/customAttr.ts +0 -23
- package/src/components/fab/index.less +0 -158
- package/src/components/fab/index.ts +0 -232
- package/src/components/grid_list/index.less +0 -126
- package/src/components/headroom/customAttr.ts +0 -13
- package/src/components/headroom/index.less +0 -51
- package/src/components/headroom/index.ts +0 -275
- package/src/components/list/index.less +0 -347
- package/src/components/menu/customAttr.ts +0 -40
- package/src/components/menu/index.less +0 -195
- package/src/components/menu/index.ts +0 -725
- package/src/components/menu/svg/arrow_right_dark.svg +0 -1
- package/src/components/menu/svg/arrow_right_light.svg +0 -1
- package/src/components/panel/customAttr.ts +0 -13
- package/src/components/panel/index.less +0 -191
- package/src/components/panel/index.ts +0 -32
- package/src/components/progress/progress.less +0 -113
- package/src/components/progress/spinner.less +0 -198
- package/src/components/progress/spinner.ts +0 -75
- package/src/components/ripple/index.less +0 -92
- package/src/components/ripple/index.ts +0 -217
- package/src/components/select/customAttr.ts +0 -13
- package/src/components/select/index.less +0 -342
- package/src/components/select/index.ts +0 -478
- package/src/components/select/svg/arrow_down_dark.svg +0 -1
- package/src/components/select/svg/arrow_down_light.svg +0 -1
- package/src/components/select/svg/arrow_up_dark.svg +0 -1
- package/src/components/select/svg/arrow_up_light.svg +0 -1
- package/src/components/selection_control/checkbox.less +0 -226
- package/src/components/selection_control/radio.less +0 -163
- package/src/components/selection_control/switch.less +0 -210
- package/src/components/slider/index.less +0 -340
- package/src/components/slider/index.ts +0 -187
- package/src/components/snackbar/index.less +0 -133
- package/src/components/snackbar/index.ts +0 -367
- package/src/components/subheader/index.less +0 -38
- package/src/components/tab/customAttr.ts +0 -13
- package/src/components/tab/index.less +0 -195
- package/src/components/tab/index.ts +0 -372
- package/src/components/table/index.less +0 -169
- package/src/components/table/index.ts +0 -240
- package/src/components/textfield/index.less +0 -425
- package/src/components/textfield/index.ts +0 -217
- package/src/components/toolbar/index.less +0 -92
- package/src/components/tooltip/customAttr.ts +0 -26
- package/src/components/tooltip/index.less +0 -45
- package/src/components/tooltip/index.ts +0 -361
- package/src/fonts/roboto/LICENSE.txt +0 -201
- package/src/fonts/roboto/Roboto-Black.woff +0 -0
- package/src/fonts/roboto/Roboto-Black.woff2 +0 -0
- package/src/fonts/roboto/Roboto-BlackItalic.woff +0 -0
- package/src/fonts/roboto/Roboto-BlackItalic.woff2 +0 -0
- package/src/fonts/roboto/Roboto-Bold.woff +0 -0
- package/src/fonts/roboto/Roboto-Bold.woff2 +0 -0
- package/src/fonts/roboto/Roboto-BoldItalic.woff +0 -0
- package/src/fonts/roboto/Roboto-BoldItalic.woff2 +0 -0
- package/src/fonts/roboto/Roboto-Light.woff +0 -0
- package/src/fonts/roboto/Roboto-Light.woff2 +0 -0
- package/src/fonts/roboto/Roboto-LightItalic.woff +0 -0
- package/src/fonts/roboto/Roboto-LightItalic.woff2 +0 -0
- package/src/fonts/roboto/Roboto-Medium.woff +0 -0
- package/src/fonts/roboto/Roboto-Medium.woff2 +0 -0
- package/src/fonts/roboto/Roboto-MediumItalic.woff +0 -0
- package/src/fonts/roboto/Roboto-MediumItalic.woff2 +0 -0
- package/src/fonts/roboto/Roboto-Regular.woff +0 -0
- package/src/fonts/roboto/Roboto-Regular.woff2 +0 -0
- package/src/fonts/roboto/Roboto-RegularItalic.woff +0 -0
- package/src/fonts/roboto/Roboto-RegularItalic.woff2 +0 -0
- package/src/fonts/roboto/Roboto-Thin.woff +0 -0
- package/src/fonts/roboto/Roboto-Thin.woff2 +0 -0
- package/src/fonts/roboto/Roboto-ThinItalic.woff +0 -0
- package/src/fonts/roboto/Roboto-ThinItalic.woff2 +0 -0
- package/src/global/mutation.ts +0 -37
- package/src/icons/material-icons/LICENSE.txt +0 -393
- package/src/icons/material-icons/MaterialIcons-Regular.ijmap +0 -1
- package/src/icons/material-icons/MaterialIcons-Regular.woff +0 -0
- package/src/icons/material-icons/MaterialIcons-Regular.woff2 +0 -0
- package/src/index.less +0 -73
- package/src/index.ts +0 -39
- package/src/interfaces/MduiStatic.ts +0 -11
- package/src/jq.ts +0 -104
- package/src/jq_extends/methods/mutation.ts +0 -32
- package/src/jq_extends/methods/reflow.ts +0 -23
- package/src/jq_extends/methods/transform.ts +0 -24
- package/src/jq_extends/methods/transformOrigin.ts +0 -24
- package/src/jq_extends/methods/transition.ts +0 -30
- package/src/jq_extends/methods/transitionEnd.ts +0 -49
- package/src/jq_extends/static/guid.ts +0 -56
- package/src/jq_extends/static/hideOverlay.ts +0 -50
- package/src/jq_extends/static/lockScreen.ts +0 -30
- package/src/jq_extends/static/showOverlay.ts +0 -51
- package/src/jq_extends/static/throttle.ts +0 -32
- package/src/jq_extends/static/unlockScreen.ts +0 -36
- package/src/mdui.ts +0 -12
- package/src/styles/color.less +0 -392
- package/src/styles/global.less +0 -75
- package/src/styles/grid.less +0 -150
- package/src/styles/helper.less +0 -242
- package/src/styles/icon.less +0 -31
- package/src/styles/material-icons.less +0 -36
- package/src/styles/media.less +0 -39
- package/src/styles/mixin/color.less +0 -66
- package/src/styles/mixin/divider.less +0 -30
- package/src/styles/mixin/helper.less +0 -126
- package/src/styles/mixin/icon.less +0 -33
- package/src/styles/mixin/layout-theme.less +0 -14
- package/src/styles/mixin/media.less +0 -11
- package/src/styles/mixin/shadow.less +0 -17
- package/src/styles/mixin/typo.less +0 -149
- package/src/styles/mixin.less +0 -8
- package/src/styles/roboto.less +0 -125
- package/src/styles/shadow.less +0 -20
- package/src/styles/typo-styles.less +0 -91
- package/src/styles/typo.less +0 -338
- package/src/styles/variable/animation.less +0 -5
- package/src/styles/variable/color/amber.less +0 -41
- package/src/styles/variable/color/black.less +0 -16
- package/src/styles/variable/color/blue-grey.less +0 -29
- package/src/styles/variable/color/blue.less +0 -41
- package/src/styles/variable/color/brown.less +0 -29
- package/src/styles/variable/color/cyan.less +0 -41
- package/src/styles/variable/color/deep-orange.less +0 -41
- package/src/styles/variable/color/deep-purple.less +0 -41
- package/src/styles/variable/color/default.less +0 -74
- package/src/styles/variable/color/green.less +0 -41
- package/src/styles/variable/color/grey.less +0 -29
- package/src/styles/variable/color/indigo.less +0 -41
- package/src/styles/variable/color/light-blue.less +0 -41
- package/src/styles/variable/color/light-green.less +0 -41
- package/src/styles/variable/color/lime.less +0 -41
- package/src/styles/variable/color/orange.less +0 -41
- package/src/styles/variable/color/pink.less +0 -41
- package/src/styles/variable/color/purple.less +0 -41
- package/src/styles/variable/color/red.less +0 -41
- package/src/styles/variable/color/teal.less +0 -41
- package/src/styles/variable/color/transparent.less +0 -1
- package/src/styles/variable/color/white.less +0 -16
- package/src/styles/variable/color/yellow.less +0 -41
- package/src/styles/variable/global.less +0 -98
- package/src/styles/variable/shadow.less +0 -103
- package/src/styles/variable.less +0 -26
- package/src/tsconfig.json +0 -12
- package/src/utils/componentEvent.ts +0 -63
- package/src/utils/dom.ts +0 -7
- package/src/utils/mutation.ts +0 -41
- package/src/utils/parseOptions.ts +0 -23
- package/src/utils/queue.ts +0 -51
- package/src/utils/touchHandler.ts +0 -92
- /package/{es/interfaces/MduiStatic.js → functions/utils/theme.js} +0 -0
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html } from 'lit';
|
|
3
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
+
import { createRef, ref } from 'lit/directives/ref.js';
|
|
5
|
+
import { when } from 'lit/directives/when.js';
|
|
6
|
+
import { $ } from '@mdui/jq/$.js';
|
|
7
|
+
import '@mdui/jq/methods/css.js';
|
|
8
|
+
import '@mdui/jq/methods/innerWidth.js';
|
|
9
|
+
import { isNull } from '@mdui/jq/shared/helper.js';
|
|
10
|
+
import { watch } from '@mdui/shared/decorators/watch.js';
|
|
11
|
+
import { animateTo, stopAnimations } from '@mdui/shared/helpers/animate.js';
|
|
12
|
+
import { breakpoint } from '@mdui/shared/helpers/breakpoint.js';
|
|
13
|
+
import { booleanConverter } from '@mdui/shared/helpers/decorator.js';
|
|
14
|
+
import { emit } from '@mdui/shared/helpers/event.js';
|
|
15
|
+
import { Modal } from '@mdui/shared/helpers/modal.js';
|
|
16
|
+
import { getDuration, getEasing } from '@mdui/shared/helpers/motion.js';
|
|
17
|
+
import { observeResize } from '@mdui/shared/helpers/observeResize.js';
|
|
18
|
+
import { lockScreen, unlockScreen } from '@mdui/shared/helpers/scroll.js';
|
|
19
|
+
import { componentStyle } from '@mdui/shared/lit-styles/component-style.js';
|
|
20
|
+
import { LayoutItemBase } from '../layout/layout-item-base.js';
|
|
21
|
+
import { style } from './style.js';
|
|
22
|
+
/**
|
|
23
|
+
* 在手机端,`modal` 始终为 `true`;大于手机端时,`modal` 属性才开始生效
|
|
24
|
+
*
|
|
25
|
+
* @summary 侧边抽屉栏组件
|
|
26
|
+
*
|
|
27
|
+
* ```html
|
|
28
|
+
* <mdui-navigation-drawer>content</mdui-navigation-drawer>
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @event open - 在抽屉导航打开之前触发。可以通过调用 `event.preventDefault()` 阻止抽屉导航打开
|
|
32
|
+
* @event opened - 在抽屉导航打开之后触发
|
|
33
|
+
* @event close - 在抽屉导航关闭之前触发。可以通过调用 `event.preventDefault()` 阻止抽屉导航关闭
|
|
34
|
+
* @event closed - 在抽屉导航关闭之后触发
|
|
35
|
+
* @event overlay-click - 点击遮罩层时触发
|
|
36
|
+
*
|
|
37
|
+
* @slot - 抽屉导航中的内容
|
|
38
|
+
*
|
|
39
|
+
* @csspart overlay - 遮罩层
|
|
40
|
+
* @csspart panel - 抽屉导航容器
|
|
41
|
+
*
|
|
42
|
+
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐[引用设计令牌](/docs/2/styles/design-tokens#shape-corner)
|
|
43
|
+
* @cssprop --z-index - 组件的 CSS 的 `z-index` 值
|
|
44
|
+
*/
|
|
45
|
+
export let NavigationDrawer = class NavigationDrawer extends LayoutItemBase {
|
|
46
|
+
constructor() {
|
|
47
|
+
super(...arguments);
|
|
48
|
+
/**
|
|
49
|
+
* 是否打开抽屉导航
|
|
50
|
+
*/
|
|
51
|
+
this.open = false;
|
|
52
|
+
/**
|
|
53
|
+
* 打开时,是否显示遮罩层
|
|
54
|
+
*
|
|
55
|
+
* 较窄的设备上(屏幕宽度小于 [`--mdui-breakpoint-md`](/docs/2/styles/design-tokens#breakpoint) 时),会无视该参数,始终显示遮罩层
|
|
56
|
+
*/
|
|
57
|
+
this.modal = false;
|
|
58
|
+
/**
|
|
59
|
+
* 在含遮罩层时,是否在按下 ESC 键时,关闭抽屉导航
|
|
60
|
+
*/
|
|
61
|
+
this.closeOnEsc = false;
|
|
62
|
+
/**
|
|
63
|
+
* 是否在点击遮罩时,关闭抽屉导航
|
|
64
|
+
*/
|
|
65
|
+
this.closeOnOverlayClick = false;
|
|
66
|
+
/**
|
|
67
|
+
* 抽屉导航的显示位置。可选值为:
|
|
68
|
+
*
|
|
69
|
+
* * `left`:显示在左侧
|
|
70
|
+
* * `right`:显示在右侧
|
|
71
|
+
*/
|
|
72
|
+
this.placement = 'left';
|
|
73
|
+
/**
|
|
74
|
+
* 默认抽屉导航相对于 `body` 元素显示,该参数设置为 `true` 时,抽屉导航将相对于它的父元素显示
|
|
75
|
+
*
|
|
76
|
+
* Note:
|
|
77
|
+
* 设置了该属性时,必须手动在父元素上设置样式 `position: relative; overflow: hidden;`
|
|
78
|
+
*/
|
|
79
|
+
this.contained = false;
|
|
80
|
+
// 断点为 mobile 时为 `true` 时,强制使用遮罩层
|
|
81
|
+
this.mobile = false;
|
|
82
|
+
this.overlayRef = createRef();
|
|
83
|
+
this.panelRef = createRef();
|
|
84
|
+
}
|
|
85
|
+
get layoutPlacement() {
|
|
86
|
+
return this.placement;
|
|
87
|
+
}
|
|
88
|
+
get lockTarget() {
|
|
89
|
+
return this.contained || this.isParentLayout
|
|
90
|
+
? this.parentElement
|
|
91
|
+
: document.body;
|
|
92
|
+
}
|
|
93
|
+
get isModal() {
|
|
94
|
+
return this.mobile || this.modal;
|
|
95
|
+
}
|
|
96
|
+
// contained 变更后,修改监听尺寸变化的元素。为 true 时,监听父元素;为 false 时,监听 body
|
|
97
|
+
onContainedChange() {
|
|
98
|
+
var _a;
|
|
99
|
+
if (this.hasUpdated) {
|
|
100
|
+
(_a = this.observeResize) === null || _a === void 0 ? void 0 : _a.unobserve();
|
|
101
|
+
}
|
|
102
|
+
this.observeResize = observeResize(this.contained ? this.parentElement : document.body, () => {
|
|
103
|
+
const target = this.contained ? this.parentElement : undefined;
|
|
104
|
+
this.mobile = breakpoint(target).down('md');
|
|
105
|
+
// 若位于 layout 中,且为模态化,则重新布局时,占据的宽度为 0
|
|
106
|
+
if (this.isParentLayout) {
|
|
107
|
+
this.layoutManager.updateLayout(this, {
|
|
108
|
+
width: this.isModal ? 0 : undefined,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
onPlacementChange() {
|
|
114
|
+
if (this.isParentLayout) {
|
|
115
|
+
this.layoutManager.updateLayout(this);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
async onOpenChange() {
|
|
119
|
+
let panel = this.panelRef.value;
|
|
120
|
+
let overlay = this.overlayRef.value;
|
|
121
|
+
const isRight = this.placement === 'right';
|
|
122
|
+
const paddingPropName = isRight ? 'paddingRight' : 'paddingLeft';
|
|
123
|
+
const easingLinear = getEasing(this, 'linear');
|
|
124
|
+
const easingEmphasized = getEasing(this, 'emphasized');
|
|
125
|
+
// 在当前 drawer 位于 layout 中时,设置所有 layout-item 和 layout-main 元素的 transition 样式
|
|
126
|
+
const setLayoutTransition = (duration, easing) => {
|
|
127
|
+
$(this.layoutManager.getItemsAndMain()).css('transition', isNull(duration) ? null : `all ${duration}ms ${easing}`);
|
|
128
|
+
};
|
|
129
|
+
// 停止原有动画
|
|
130
|
+
const stopOldAnimations = async () => {
|
|
131
|
+
await Promise.all([
|
|
132
|
+
this.isModal
|
|
133
|
+
? stopAnimations(overlay)
|
|
134
|
+
: !this.isParentLayout
|
|
135
|
+
? stopAnimations(this.lockTarget)
|
|
136
|
+
: Promise.resolve(),
|
|
137
|
+
this.isModal ? stopAnimations(panel) : stopAnimations(this),
|
|
138
|
+
]);
|
|
139
|
+
};
|
|
140
|
+
// 打开
|
|
141
|
+
// 要区分是否首次渲染,首次渲染时不触发事件,不执行动画;非首次渲染,触发事件,执行动画
|
|
142
|
+
if (this.open) {
|
|
143
|
+
const hasUpdated = this.hasUpdated;
|
|
144
|
+
if (!hasUpdated) {
|
|
145
|
+
await this.updateComplete;
|
|
146
|
+
panel = this.panelRef.value;
|
|
147
|
+
overlay = this.overlayRef.value;
|
|
148
|
+
}
|
|
149
|
+
if (hasUpdated) {
|
|
150
|
+
const requestOpen = emit(this, 'open', { cancelable: true });
|
|
151
|
+
if (requestOpen.defaultPrevented) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
this.style.display = 'block';
|
|
156
|
+
this.originalTrigger = document.activeElement;
|
|
157
|
+
if (this.isModal) {
|
|
158
|
+
this.modalHelper.activate();
|
|
159
|
+
lockScreen(this, this.lockTarget);
|
|
160
|
+
}
|
|
161
|
+
await stopOldAnimations();
|
|
162
|
+
// 设置聚焦
|
|
163
|
+
requestAnimationFrame(() => {
|
|
164
|
+
const autoFocusTarget = this.querySelector('[autofocus]');
|
|
165
|
+
if (autoFocusTarget) {
|
|
166
|
+
autoFocusTarget.focus({ preventScroll: true });
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
panel.focus({ preventScroll: true });
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
const duration = getDuration(this, 'long2');
|
|
173
|
+
const animations = [];
|
|
174
|
+
// 模态框 drawer,显示 overlay 动画
|
|
175
|
+
if (this.isModal) {
|
|
176
|
+
animations.push(animateTo(overlay, [{ opacity: 0 }, { opacity: 1, offset: 0.3 }, { opacity: 1 }], {
|
|
177
|
+
duration: hasUpdated ? duration : 0,
|
|
178
|
+
easing: easingLinear,
|
|
179
|
+
}));
|
|
180
|
+
}
|
|
181
|
+
// 不位于 layout 中,父元素 padding 变化的动画
|
|
182
|
+
else if (!this.isParentLayout) {
|
|
183
|
+
animations.push(animateTo(this.lockTarget, [
|
|
184
|
+
{ [paddingPropName]: 0 },
|
|
185
|
+
{ [paddingPropName]: $(panel).innerWidth() + 'px' },
|
|
186
|
+
], {
|
|
187
|
+
duration: hasUpdated ? duration : 0,
|
|
188
|
+
easing: easingEmphasized,
|
|
189
|
+
fill: 'forwards',
|
|
190
|
+
}));
|
|
191
|
+
}
|
|
192
|
+
// 若位于 layout 中,则 layout-main 的 padding 变化需要有和 drawer 相同的动画
|
|
193
|
+
// 但首次渲染不执行动画
|
|
194
|
+
if (this.isParentLayout && hasUpdated) {
|
|
195
|
+
setLayoutTransition(duration, easingEmphasized);
|
|
196
|
+
}
|
|
197
|
+
// drawer 显示动画
|
|
198
|
+
animations.push(animateTo(this.isModal ? panel : this, [
|
|
199
|
+
{ transform: `translateX(${isRight ? '' : '-'}100%)` },
|
|
200
|
+
{ transform: 'translateX(0)' },
|
|
201
|
+
], {
|
|
202
|
+
duration: hasUpdated ? duration : 0,
|
|
203
|
+
easing: easingEmphasized,
|
|
204
|
+
}));
|
|
205
|
+
await Promise.all(animations);
|
|
206
|
+
// 若位于 layout 中,则 drawer 动画完成后,移除 layout-main 的动画
|
|
207
|
+
if (this.isParentLayout && hasUpdated) {
|
|
208
|
+
setLayoutTransition(null);
|
|
209
|
+
}
|
|
210
|
+
if (hasUpdated) {
|
|
211
|
+
emit(this, 'opened');
|
|
212
|
+
}
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
// 关闭
|
|
216
|
+
if (!this.open && this.hasUpdated) {
|
|
217
|
+
const requestClose = emit(this, 'close', { cancelable: true });
|
|
218
|
+
if (requestClose.defaultPrevented) {
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
if (this.isModal) {
|
|
222
|
+
this.modalHelper.deactivate();
|
|
223
|
+
}
|
|
224
|
+
await stopOldAnimations();
|
|
225
|
+
const duration = getDuration(this, 'short4');
|
|
226
|
+
const animations = [];
|
|
227
|
+
// 模态框 drawer,显示 overlay 动画
|
|
228
|
+
if (this.isModal) {
|
|
229
|
+
animations.push(animateTo(overlay, [{ opacity: 1 }, { opacity: 0 }], {
|
|
230
|
+
duration,
|
|
231
|
+
easing: easingLinear,
|
|
232
|
+
}));
|
|
233
|
+
}
|
|
234
|
+
// 不位于 layout 中,父元素 padding 变化的动画
|
|
235
|
+
else if (!this.isParentLayout) {
|
|
236
|
+
animations.push(animateTo(this.lockTarget, [
|
|
237
|
+
{ [paddingPropName]: $(panel).innerWidth() + 'px' },
|
|
238
|
+
{ [paddingPropName]: 0 },
|
|
239
|
+
], {
|
|
240
|
+
duration,
|
|
241
|
+
easing: easingEmphasized,
|
|
242
|
+
fill: 'forwards',
|
|
243
|
+
}));
|
|
244
|
+
}
|
|
245
|
+
// 若位于 layout 中,则 layout-main 的 padding 变化需要有和 drawer 相同的动画
|
|
246
|
+
if (this.isParentLayout) {
|
|
247
|
+
setLayoutTransition(duration, easingEmphasized);
|
|
248
|
+
// 关闭动画开始时,drawer 的宽度不变。等到关闭动画结束,drawer 的宽度才变为 0
|
|
249
|
+
// 为了 layout-main 的动画能在关闭动画开始时就执行,强制调用 updateLayout 更新布局
|
|
250
|
+
this.layoutManager.updateLayout(this, { width: 0 });
|
|
251
|
+
}
|
|
252
|
+
// drawer 显示动画
|
|
253
|
+
animations.push(animateTo(this.isModal ? panel : this, [
|
|
254
|
+
{ transform: 'translateX(0)' },
|
|
255
|
+
{ transform: `translateX(${isRight ? '' : '-'}100%)` },
|
|
256
|
+
], { duration, easing: easingEmphasized }));
|
|
257
|
+
await Promise.all(animations);
|
|
258
|
+
// 若位于 layout 中,则 drawer 动画结束后,移除 layout-main 的动画
|
|
259
|
+
if (this.isParentLayout) {
|
|
260
|
+
setLayoutTransition(null);
|
|
261
|
+
}
|
|
262
|
+
this.style.display = 'none';
|
|
263
|
+
if (this.isModal) {
|
|
264
|
+
unlockScreen(this, this.lockTarget);
|
|
265
|
+
}
|
|
266
|
+
// 抽屉导航关闭后,恢复焦点到原有的元素上
|
|
267
|
+
const trigger = this.originalTrigger;
|
|
268
|
+
if (typeof (trigger === null || trigger === void 0 ? void 0 : trigger.focus) === 'function') {
|
|
269
|
+
setTimeout(() => trigger.focus());
|
|
270
|
+
}
|
|
271
|
+
emit(this, 'closed');
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
connectedCallback() {
|
|
276
|
+
super.connectedCallback();
|
|
277
|
+
this.modalHelper = new Modal(this);
|
|
278
|
+
this.addEventListener('keydown', (event) => {
|
|
279
|
+
if (this.open &&
|
|
280
|
+
this.closeOnEsc &&
|
|
281
|
+
event.key === 'Escape' &&
|
|
282
|
+
this.isModal) {
|
|
283
|
+
event.stopPropagation();
|
|
284
|
+
this.open = false;
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
disconnectedCallback() {
|
|
289
|
+
var _a;
|
|
290
|
+
super.disconnectedCallback();
|
|
291
|
+
unlockScreen(this, this.lockTarget);
|
|
292
|
+
(_a = this.observeResize) === null || _a === void 0 ? void 0 : _a.unobserve();
|
|
293
|
+
}
|
|
294
|
+
render() {
|
|
295
|
+
return html `${when(this.isModal, () => html `<div ${ref(this.overlayRef)} part="overlay" class="overlay" @click="${this.onOverlayClick}"></div>`)}<slot ${ref(this.panelRef)} part="panel" class="panel" tabindex="0"></slot>`;
|
|
296
|
+
}
|
|
297
|
+
onOverlayClick() {
|
|
298
|
+
emit(this, 'overlay-click');
|
|
299
|
+
if (!this.closeOnOverlayClick) {
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
302
|
+
this.open = false;
|
|
303
|
+
}
|
|
304
|
+
};
|
|
305
|
+
NavigationDrawer.styles = [componentStyle, style];
|
|
306
|
+
__decorate([
|
|
307
|
+
property({
|
|
308
|
+
type: Boolean,
|
|
309
|
+
reflect: true,
|
|
310
|
+
converter: booleanConverter,
|
|
311
|
+
})
|
|
312
|
+
], NavigationDrawer.prototype, "open", void 0);
|
|
313
|
+
__decorate([
|
|
314
|
+
property({
|
|
315
|
+
type: Boolean,
|
|
316
|
+
reflect: true,
|
|
317
|
+
converter: booleanConverter,
|
|
318
|
+
})
|
|
319
|
+
], NavigationDrawer.prototype, "modal", void 0);
|
|
320
|
+
__decorate([
|
|
321
|
+
property({
|
|
322
|
+
type: Boolean,
|
|
323
|
+
reflect: true,
|
|
324
|
+
converter: booleanConverter,
|
|
325
|
+
attribute: 'close-on-esc',
|
|
326
|
+
})
|
|
327
|
+
], NavigationDrawer.prototype, "closeOnEsc", void 0);
|
|
328
|
+
__decorate([
|
|
329
|
+
property({
|
|
330
|
+
type: Boolean,
|
|
331
|
+
reflect: true,
|
|
332
|
+
converter: booleanConverter,
|
|
333
|
+
attribute: 'close-on-overlay-click',
|
|
334
|
+
})
|
|
335
|
+
], NavigationDrawer.prototype, "closeOnOverlayClick", void 0);
|
|
336
|
+
__decorate([
|
|
337
|
+
property({ reflect: true })
|
|
338
|
+
// eslint-disable-next-line prettier/prettier
|
|
339
|
+
], NavigationDrawer.prototype, "placement", void 0);
|
|
340
|
+
__decorate([
|
|
341
|
+
property({
|
|
342
|
+
type: Boolean,
|
|
343
|
+
reflect: true,
|
|
344
|
+
converter: booleanConverter,
|
|
345
|
+
})
|
|
346
|
+
], NavigationDrawer.prototype, "contained", void 0);
|
|
347
|
+
__decorate([
|
|
348
|
+
property({
|
|
349
|
+
type: Boolean,
|
|
350
|
+
reflect: true,
|
|
351
|
+
converter: booleanConverter,
|
|
352
|
+
})
|
|
353
|
+
], NavigationDrawer.prototype, "mobile", void 0);
|
|
354
|
+
__decorate([
|
|
355
|
+
watch('contained')
|
|
356
|
+
], NavigationDrawer.prototype, "onContainedChange", null);
|
|
357
|
+
__decorate([
|
|
358
|
+
watch('placement')
|
|
359
|
+
], NavigationDrawer.prototype, "onPlacementChange", null);
|
|
360
|
+
__decorate([
|
|
361
|
+
watch('open')
|
|
362
|
+
], NavigationDrawer.prototype, "onOpenChange", null);
|
|
363
|
+
NavigationDrawer = __decorate([
|
|
364
|
+
customElement('mdui-navigation-drawer')
|
|
365
|
+
], NavigationDrawer);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const style: import("lit").CSSResult;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const style = css `:host{--shape-corner:var(--mdui-shape-corner-large);--z-index:2200;display:none;position:fixed;top:0;bottom:0;left:0;z-index:1;width:22.5rem}:host([placement=right]){left:initial;right:0}:host([mobile]),:host([modal]){top:0!important;right:0;bottom:0!important;width:initial;z-index:var(--z-index)}:host([placement=right][mobile]),:host([placement=right][modal]){left:0}:host([contained]){position:absolute}.overlay{position:absolute;inset:0;z-index:inherit;background-color:rgba(var(--mdui-color-scrim),.4)}.panel{display:block;position:absolute;top:0;bottom:0;left:0;width:100%;overflow:auto;z-index:inherit;background-color:rgb(var(--mdui-color-surface));box-shadow:var(--mdui-elevation-level0)}:host([mobile]) .panel,:host([modal]) .panel{border-radius:0 var(--shape-corner) var(--shape-corner) 0;width:22.5rem;background-color:rgb(var(--mdui-color-surface-container-low));box-shadow:var(--mdui-elevation-level1)}:host([placement=right]) .panel{left:initial;right:0}:host([placement=right][mobile]) .panel,:host([placement=right][modal]) .panel{border-radius:var(--shape-corner) 0 0 var(--shape-corner)}`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './navigation-drawer/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './navigation-drawer/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const navigationRailItemStyle: import("lit").CSSResult;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const navigationRailItemStyle = css `:host{--shape-corner-indicator:var(--mdui-shape-corner-full);position:relative;z-index:0;width:100%;--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface-variant)}.container{display:flex;flex-direction:column;align-items:center;justify-content:center;text-decoration:none;cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:padding var(--mdui-motion-duration-short4) var(--mdui-motion-easing-standard);height:3.5rem}mdui-ripple{z-index:1;width:3.5rem;height:2rem;border-radius:var(--mdui-shape-corner-full)}.container:not(.has-label)+mdui-ripple{height:3.5rem}.indicator{position:relative;display:flex;align-items:center;justify-content:center;background-color:transparent;border-radius:var(--shape-corner-indicator);transition:background-color var(--mdui-motion-duration-short1) var(--mdui-motion-easing-standard),width var(--mdui-motion-duration-short4) var(--mdui-motion-easing-standard),height var(--mdui-motion-duration-short4) var(--mdui-motion-easing-standard);height:2rem;width:2rem}::slotted([slot=badge]){position:absolute;transform:translate(50%,-50%)}:host([placement=right]) ::slotted([slot=badge]){transform:translate(-50%,-50%)}::slotted([slot=badge][variant=small]){transform:translate(.5625rem,-.5625rem)}:host([placement=right]) ::slotted([slot=badge][variant=small]){transform:translate(-.5625rem,-.5625rem)}.active-icon,.icon{color:rgb(var(--mdui-color-on-surface-variant));font-size:1.5rem}.active-icon mdui-icon,.icon mdui-icon,::slotted([slot=active-icon]),::slotted([slot=icon]){font-size:inherit}.icon{display:flex}.active-icon{display:none}.label{display:flex;align-items:center;transition:opacity var(--mdui-motion-duration-short4) var(--mdui-motion-easing-linear);height:1rem;color:rgb(var(--mdui-color-on-surface-variant));margin-top:.25rem;margin-bottom:.25rem;font-size:var(--mdui-typescale-label-medium-size);font-weight:var(--mdui-typescale-label-medium-weight);letter-spacing:var(--mdui-typescale-label-medium-tracking);line-height:var(--mdui-typescale-label-medium-line-height)}:host([active]){--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface)}:host([active]) .indicator{width:3.5rem;background-color:rgb(var(--mdui-color-secondary-container))}:host([active]) :not(.has-label) .indicator{height:3.5rem}:host([active]) .active-icon,:host([active]) .icon{color:rgb(var(--mdui-color-on-secondary-container))}:host([active]) .has-active-icon .active-icon{display:flex}:host([active]) .has-active-icon .icon{display:none}:host([active]) .label{color:rgb(var(--mdui-color-on-surface))}`;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import '../icon.js';
|
|
3
|
+
import type { Ripple } from '../ripple/index.js';
|
|
4
|
+
import type { CSSResultGroup, TemplateResult } from 'lit';
|
|
5
|
+
declare const NavigationRailItem_base: import("@open-wc/dedupe-mixin").Constructor<import("@mdui/shared/mixins/anchor.js").AnchorMixinInterface> & import("@open-wc/dedupe-mixin").Constructor<import("../ripple/ripple-mixin.js").RippleMixinInterface> & import("@open-wc/dedupe-mixin").Constructor<import("@mdui/shared/mixins/focusable.js").FocusableMixinInterface> & typeof LitElement;
|
|
6
|
+
/**
|
|
7
|
+
* @summary 侧边导航栏项组件。需与 `<mdui-navigation-rail>` 组件配合使用
|
|
8
|
+
*
|
|
9
|
+
* ```html
|
|
10
|
+
* <mdui-navigation-rail>
|
|
11
|
+
* ..<mdui-navigation-rail-item icon="watch_later">Recent</mdui-navigation-rail-item>
|
|
12
|
+
* ..<mdui-navigation-rail-item icon="image">Images</mdui-navigation-rail-item>
|
|
13
|
+
* ..<mdui-navigation-rail-item icon="library_music">Library</mdui-navigation-rail-item>
|
|
14
|
+
* </mdui-navigation-rail>
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @slot - 文本
|
|
18
|
+
* @slot icon - 图标
|
|
19
|
+
* @slot active-icon - 激活状态的图标
|
|
20
|
+
* @slot badge - 徽标
|
|
21
|
+
*
|
|
22
|
+
* @event focus - 获得焦点时触发
|
|
23
|
+
* @event blur - 失去焦点时触发
|
|
24
|
+
*
|
|
25
|
+
* @csspart container - 导航项容器
|
|
26
|
+
* @csspart indicator - 指示器
|
|
27
|
+
* @csspart badge - 徽标
|
|
28
|
+
* @csspart icon - 图标
|
|
29
|
+
* @csspart active-icon - 激活状态的图标
|
|
30
|
+
* @csspart label - 文本
|
|
31
|
+
*
|
|
32
|
+
* @cssprop --shape-corner-indicator - 指示器的圆角大小。可以指定一个具体的像素值;但更推荐[引用设计令牌](/docs/2/styles/design-tokens#shape-corner)
|
|
33
|
+
*/
|
|
34
|
+
export declare class NavigationRailItem extends NavigationRailItem_base {
|
|
35
|
+
static styles: CSSResultGroup;
|
|
36
|
+
/**
|
|
37
|
+
* 未激活状态的 Material Icons 图标名。也可以通过 `slot="icon"` 设置
|
|
38
|
+
*/
|
|
39
|
+
icon?: string;
|
|
40
|
+
/**
|
|
41
|
+
* 激活状态的 Material Icons 图标名。也可以通过 `slot="active-icon"` 设置
|
|
42
|
+
*/
|
|
43
|
+
activeIcon?: string;
|
|
44
|
+
/**
|
|
45
|
+
* 导航项的值
|
|
46
|
+
*/
|
|
47
|
+
value?: string;
|
|
48
|
+
/**
|
|
49
|
+
* 是否为激活状态,由 `navigation-rail` 组件控制该参数
|
|
50
|
+
*/
|
|
51
|
+
protected active: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* 导航栏的位置,由 `navigation-rail` 组件控制该参数
|
|
54
|
+
*/
|
|
55
|
+
protected placement: 'left' | 'right';
|
|
56
|
+
private disabled;
|
|
57
|
+
protected readonly key: number;
|
|
58
|
+
private readonly rippleRef;
|
|
59
|
+
private readonly hasSlotController;
|
|
60
|
+
protected get rippleElement(): Ripple;
|
|
61
|
+
protected get rippleDisabled(): boolean;
|
|
62
|
+
protected get focusElement(): HTMLElement | null;
|
|
63
|
+
protected get focusDisabled(): boolean;
|
|
64
|
+
protected render(): TemplateResult;
|
|
65
|
+
private renderInner;
|
|
66
|
+
}
|
|
67
|
+
declare global {
|
|
68
|
+
interface HTMLElementTagNameMap {
|
|
69
|
+
'mdui-navigation-rail-item': NavigationRailItem;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
export {};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html, LitElement, nothing } from 'lit';
|
|
3
|
+
import { customElement, property, state } from 'lit/decorators.js';
|
|
4
|
+
import { createRef, ref } from 'lit/directives/ref.js';
|
|
5
|
+
import cc from 'classcat';
|
|
6
|
+
import { HasSlotController } from '@mdui/shared/controllers/has-slot.js';
|
|
7
|
+
import { booleanConverter } from '@mdui/shared/helpers/decorator.js';
|
|
8
|
+
import { nothingTemplate } from '@mdui/shared/helpers/template.js';
|
|
9
|
+
import { uniqueId } from '@mdui/shared/helpers/uniqueId.js';
|
|
10
|
+
import { componentStyle } from '@mdui/shared/lit-styles/component-style.js';
|
|
11
|
+
import { AnchorMixin } from '@mdui/shared/mixins/anchor.js';
|
|
12
|
+
import { FocusableMixin } from '@mdui/shared/mixins/focusable.js';
|
|
13
|
+
import '../icon.js';
|
|
14
|
+
import { RippleMixin } from '../ripple/ripple-mixin.js';
|
|
15
|
+
import { navigationRailItemStyle } from './navigation-rail-item-style.js';
|
|
16
|
+
/**
|
|
17
|
+
* @summary 侧边导航栏项组件。需与 `<mdui-navigation-rail>` 组件配合使用
|
|
18
|
+
*
|
|
19
|
+
* ```html
|
|
20
|
+
* <mdui-navigation-rail>
|
|
21
|
+
* ..<mdui-navigation-rail-item icon="watch_later">Recent</mdui-navigation-rail-item>
|
|
22
|
+
* ..<mdui-navigation-rail-item icon="image">Images</mdui-navigation-rail-item>
|
|
23
|
+
* ..<mdui-navigation-rail-item icon="library_music">Library</mdui-navigation-rail-item>
|
|
24
|
+
* </mdui-navigation-rail>
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @slot - 文本
|
|
28
|
+
* @slot icon - 图标
|
|
29
|
+
* @slot active-icon - 激活状态的图标
|
|
30
|
+
* @slot badge - 徽标
|
|
31
|
+
*
|
|
32
|
+
* @event focus - 获得焦点时触发
|
|
33
|
+
* @event blur - 失去焦点时触发
|
|
34
|
+
*
|
|
35
|
+
* @csspart container - 导航项容器
|
|
36
|
+
* @csspart indicator - 指示器
|
|
37
|
+
* @csspart badge - 徽标
|
|
38
|
+
* @csspart icon - 图标
|
|
39
|
+
* @csspart active-icon - 激活状态的图标
|
|
40
|
+
* @csspart label - 文本
|
|
41
|
+
*
|
|
42
|
+
* @cssprop --shape-corner-indicator - 指示器的圆角大小。可以指定一个具体的像素值;但更推荐[引用设计令牌](/docs/2/styles/design-tokens#shape-corner)
|
|
43
|
+
*/
|
|
44
|
+
export let NavigationRailItem = class NavigationRailItem extends AnchorMixin(RippleMixin(FocusableMixin(LitElement))) {
|
|
45
|
+
constructor() {
|
|
46
|
+
super(...arguments);
|
|
47
|
+
/**
|
|
48
|
+
* 是否为激活状态,由 `navigation-rail` 组件控制该参数
|
|
49
|
+
*/
|
|
50
|
+
this.active = false;
|
|
51
|
+
/**
|
|
52
|
+
* 导航栏的位置,由 `navigation-rail` 组件控制该参数
|
|
53
|
+
*/
|
|
54
|
+
this.placement = 'left';
|
|
55
|
+
// 是否禁用该元素,该组件没有禁用状态
|
|
56
|
+
this.disabled = false;
|
|
57
|
+
// 每一个 `navigation-rail-item` 元素都添加一个唯一的 key
|
|
58
|
+
this.key = uniqueId();
|
|
59
|
+
this.rippleRef = createRef();
|
|
60
|
+
this.hasSlotController = new HasSlotController(this, '[default]', 'active-icon');
|
|
61
|
+
}
|
|
62
|
+
get rippleElement() {
|
|
63
|
+
return this.rippleRef.value;
|
|
64
|
+
}
|
|
65
|
+
get rippleDisabled() {
|
|
66
|
+
return this.disabled;
|
|
67
|
+
}
|
|
68
|
+
get focusElement() {
|
|
69
|
+
var _a;
|
|
70
|
+
return this.href ? (_a = this.renderRoot) === null || _a === void 0 ? void 0 : _a.querySelector('._a') : this;
|
|
71
|
+
}
|
|
72
|
+
get focusDisabled() {
|
|
73
|
+
return this.disabled;
|
|
74
|
+
}
|
|
75
|
+
render() {
|
|
76
|
+
const hasDefaultSlot = this.hasSlotController.test('[default]');
|
|
77
|
+
const className = cc({
|
|
78
|
+
container: true,
|
|
79
|
+
'has-label': hasDefaultSlot,
|
|
80
|
+
'has-active-icon': this.activeIcon || this.hasSlotController.test('active-icon'),
|
|
81
|
+
});
|
|
82
|
+
return html `${this.href
|
|
83
|
+
? this.renderAnchor({
|
|
84
|
+
part: 'container',
|
|
85
|
+
className,
|
|
86
|
+
content: this.renderInner(hasDefaultSlot),
|
|
87
|
+
})
|
|
88
|
+
: html `<div part="container" class="${className}">${this.renderInner(hasDefaultSlot)}</div>`}<mdui-ripple .noRipple="${!this.active || this.noRipple}" ${ref(this.rippleRef)}></mdui-ripple>`;
|
|
89
|
+
}
|
|
90
|
+
renderInner(hasDefaultSlot) {
|
|
91
|
+
return html `<div part="indicator" class="indicator"><slot name="badge" part="badge" class="badge"></slot><slot name="active-icon" part="active-icon" class="active-icon">${this.activeIcon
|
|
92
|
+
? html `<mdui-icon name="${this.activeIcon}"></mdui-icon>`
|
|
93
|
+
: nothingTemplate}</slot><slot name="icon" part="icon" class="icon">${this.icon
|
|
94
|
+
? html `<mdui-icon name="${this.icon}"></mdui-icon>`
|
|
95
|
+
: nothingTemplate}</slot></div>${hasDefaultSlot
|
|
96
|
+
? html `<slot part="label" class="label"></slot>`
|
|
97
|
+
: nothing}`;
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
NavigationRailItem.styles = [
|
|
101
|
+
componentStyle,
|
|
102
|
+
navigationRailItemStyle,
|
|
103
|
+
];
|
|
104
|
+
__decorate([
|
|
105
|
+
property({ reflect: true })
|
|
106
|
+
], NavigationRailItem.prototype, "icon", void 0);
|
|
107
|
+
__decorate([
|
|
108
|
+
property({ reflect: true, attribute: 'active-icon' })
|
|
109
|
+
], NavigationRailItem.prototype, "activeIcon", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
property({ reflect: true })
|
|
112
|
+
], NavigationRailItem.prototype, "value", void 0);
|
|
113
|
+
__decorate([
|
|
114
|
+
property({
|
|
115
|
+
type: Boolean,
|
|
116
|
+
reflect: true,
|
|
117
|
+
converter: booleanConverter,
|
|
118
|
+
})
|
|
119
|
+
], NavigationRailItem.prototype, "active", void 0);
|
|
120
|
+
__decorate([
|
|
121
|
+
property({ reflect: true })
|
|
122
|
+
], NavigationRailItem.prototype, "placement", void 0);
|
|
123
|
+
__decorate([
|
|
124
|
+
state()
|
|
125
|
+
], NavigationRailItem.prototype, "disabled", void 0);
|
|
126
|
+
NavigationRailItem = __decorate([
|
|
127
|
+
customElement('mdui-navigation-rail-item')
|
|
128
|
+
], NavigationRailItem);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const navigationRailStyle: import("lit").CSSResult;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const navigationRailStyle = css `:host{--shape-corner:var(--mdui-shape-corner-none);--z-index:2000;position:fixed;top:0;bottom:0;left:0;display:flex;flex-direction:column;align-items:center;border-radius:0 var(--shape-corner) var(--shape-corner) 0;z-index:var(--z-index);width:5rem;background-color:rgb(var(--mdui-color-surface));padding:.375rem .75rem}:host([contained]){position:absolute}:host([divider]){border-right:.0625rem solid rgb(var(--mdui-color-surface-variant));width:5.0625rem}:host([placement=right]){left:initial;right:0;border-radius:var(--shape-corner) 0 0 var(--shape-corner)}:host([placement=right][divider]){border-right:none;border-left:.0625rem solid rgb(var(--mdui-color-surface-variant))}.bottom,.items,.top{display:flex;flex-direction:column;align-items:center;width:100%}.top{margin-bottom:1.75rem}.bottom{margin-top:1.75rem}::slotted([slot=bottom]),::slotted([slot=top]),::slotted(mdui-navigation-rail-item){margin-top:.375rem;margin-bottom:.375rem}:host([alignment=start]) .top-spacer{flex-grow:0}:host([alignment=start]) .bottom-spacer{flex-grow:1}:host([alignment=end]) .top-spacer{flex-grow:1}:host([alignment=end]) .bottom-spacer{flex-grow:0}:host([alignment=center]){justify-content:center}:host([alignment=center]) .bottom,:host([alignment=center]) .top{position:absolute}:host([alignment=center]) .top{top:.375rem}:host([alignment=center]) .bottom{bottom:.375rem}`;
|