mdui 1.0.2 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- 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 @@
|
|
|
1
|
+
export * from './switch/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './switch/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './tabs/tab-panel.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './tabs/tab-panel.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './tabs/tab.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './tabs/tab.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const tabPanelStyle: import("lit").CSSResult;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import type { CSSResultGroup, TemplateResult } from 'lit';
|
|
3
|
+
/**
|
|
4
|
+
* @summary 选项卡面板项组件。需与 `<mdui-tabs>` 和 `<mdui-tab>` 组件配合使用
|
|
5
|
+
*
|
|
6
|
+
* ```html
|
|
7
|
+
* <mdui-tabs value="tab-1">
|
|
8
|
+
* ..<mdui-tab value="tab-1">Tab 1</mdui-tab>
|
|
9
|
+
* ..<mdui-tab value="tab-2">Tab 2</mdui-tab>
|
|
10
|
+
* ..<mdui-tab value="tab-3">Tab 3</mdui-tab>
|
|
11
|
+
*
|
|
12
|
+
* ..<mdui-tab-panel slot="panel" value="tab-1">Panel 1</mdui-tab-panel>
|
|
13
|
+
* ..<mdui-tab-panel slot="panel" value="tab-2">Panel 2</mdui-tab-panel>
|
|
14
|
+
* ..<mdui-tab-panel slot="panel" value="tab-3">Panel 3</mdui-tab-panel>
|
|
15
|
+
* </mdui-tabs>
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* @slot - 选项卡面板内容
|
|
19
|
+
*/
|
|
20
|
+
export declare class TabPanel extends LitElement {
|
|
21
|
+
static styles: CSSResultGroup;
|
|
22
|
+
/**
|
|
23
|
+
* 该选项卡面板的值
|
|
24
|
+
*/
|
|
25
|
+
value?: string;
|
|
26
|
+
/**
|
|
27
|
+
* 是否为激活状态,由 `<mdui-tabs>` 组件控制该状态
|
|
28
|
+
*/
|
|
29
|
+
protected active: boolean;
|
|
30
|
+
protected render(): TemplateResult;
|
|
31
|
+
}
|
|
32
|
+
declare global {
|
|
33
|
+
interface HTMLElementTagNameMap {
|
|
34
|
+
'mdui-tab-panel': TabPanel;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html, LitElement } from 'lit';
|
|
3
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
+
import { booleanConverter } from '@mdui/shared/helpers/decorator.js';
|
|
5
|
+
import { componentStyle } from '@mdui/shared/lit-styles/component-style.js';
|
|
6
|
+
import { tabPanelStyle } from './tab-panel-style.js';
|
|
7
|
+
/**
|
|
8
|
+
* @summary 选项卡面板项组件。需与 `<mdui-tabs>` 和 `<mdui-tab>` 组件配合使用
|
|
9
|
+
*
|
|
10
|
+
* ```html
|
|
11
|
+
* <mdui-tabs value="tab-1">
|
|
12
|
+
* ..<mdui-tab value="tab-1">Tab 1</mdui-tab>
|
|
13
|
+
* ..<mdui-tab value="tab-2">Tab 2</mdui-tab>
|
|
14
|
+
* ..<mdui-tab value="tab-3">Tab 3</mdui-tab>
|
|
15
|
+
*
|
|
16
|
+
* ..<mdui-tab-panel slot="panel" value="tab-1">Panel 1</mdui-tab-panel>
|
|
17
|
+
* ..<mdui-tab-panel slot="panel" value="tab-2">Panel 2</mdui-tab-panel>
|
|
18
|
+
* ..<mdui-tab-panel slot="panel" value="tab-3">Panel 3</mdui-tab-panel>
|
|
19
|
+
* </mdui-tabs>
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @slot - 选项卡面板内容
|
|
23
|
+
*/
|
|
24
|
+
export let TabPanel = class TabPanel extends LitElement {
|
|
25
|
+
constructor() {
|
|
26
|
+
super(...arguments);
|
|
27
|
+
/**
|
|
28
|
+
* 是否为激活状态,由 `<mdui-tabs>` 组件控制该状态
|
|
29
|
+
*/
|
|
30
|
+
this.active = false;
|
|
31
|
+
}
|
|
32
|
+
render() {
|
|
33
|
+
return html `<slot></slot>`;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
TabPanel.styles = [
|
|
37
|
+
componentStyle,
|
|
38
|
+
tabPanelStyle,
|
|
39
|
+
];
|
|
40
|
+
__decorate([
|
|
41
|
+
property({ reflect: true })
|
|
42
|
+
], TabPanel.prototype, "value", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
property({
|
|
45
|
+
type: Boolean,
|
|
46
|
+
reflect: true,
|
|
47
|
+
converter: booleanConverter,
|
|
48
|
+
})
|
|
49
|
+
], TabPanel.prototype, "active", void 0);
|
|
50
|
+
TabPanel = __decorate([
|
|
51
|
+
customElement('mdui-tab-panel')
|
|
52
|
+
], TabPanel);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const tabStyle: import("lit").CSSResult;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const tabStyle = css `:host{position:relative;--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface)}:host([active]){--mdui-comp-ripple-state-layer-color:var(--mdui-color-primary)}.container{display:flex;justify-content:center;align-items:center;cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;height:100%}.preset{flex-direction:column;min-height:3rem;padding:.625rem 1rem}:host([inline]) .preset{flex-direction:row}.icon-container,.label-container{position:relative;display:flex;align-items:center;justify-content:center}.icon-container ::slotted([slot=badge]){position:absolute;transform:translate(50%,-50%)}.icon-container ::slotted([slot=badge][variant=small]){transform:translate(.5625rem,-.5625rem)}.label-container ::slotted([slot=badge]){position:absolute;left:100%;bottom:100%;transform:translate(-.75rem,.625rem)}.label-container ::slotted([slot=badge][variant=small]){transform:translate(-.375rem,.375rem)}.icon,.label{display:flex;color:rgb(var(--mdui-color-on-surface-variant))}:host([focused]) .icon,:host([focused]) .label,:host([hover]) .icon,:host([hover]) .label,:host([pressed]) .icon,:host([pressed]) .label{color:rgb(var(--mdui-color-on-surface))}:host([active]) .icon,:host([active]) .label{color:rgb(var(--mdui-color-primary))}:host([active][variant=secondary]) .icon,:host([active][variant=secondary]) .label{color:rgb(var(--mdui-color-on-surface))}.icon{font-size:1.5rem}.label{font-size:var(--mdui-typescale-title-small-size);font-weight:var(--mdui-typescale-title-small-weight);letter-spacing:var(--mdui-typescale-title-small-tracking);line-height:var(--mdui-typescale-title-small-line-height)}.icon mdui-icon,::slotted([slot=icon]){font-size:inherit;color:inherit}`;
|
|
@@ -0,0 +1,69 @@
|
|
|
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 Tab_base: 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-tabs>` 和 `<mdui-tab-panel>` 组件配合使用
|
|
8
|
+
*
|
|
9
|
+
* ```html
|
|
10
|
+
* <mdui-tabs value="tab-1">
|
|
11
|
+
* ..<mdui-tab value="tab-1">Tab 1</mdui-tab>
|
|
12
|
+
* ..<mdui-tab value="tab-2">Tab 2</mdui-tab>
|
|
13
|
+
* ..<mdui-tab value="tab-3">Tab 3</mdui-tab>
|
|
14
|
+
*
|
|
15
|
+
* ..<mdui-tab-panel slot="panel" value="tab-1">Panel 1</mdui-tab-panel>
|
|
16
|
+
* ..<mdui-tab-panel slot="panel" value="tab-2">Panel 2</mdui-tab-panel>
|
|
17
|
+
* ..<mdui-tab-panel slot="panel" value="tab-3">Panel 3</mdui-tab-panel>
|
|
18
|
+
* </mdui-tabs>
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @event focus - 获得焦点时触发
|
|
22
|
+
* @event blur - 失去焦点时触发
|
|
23
|
+
*
|
|
24
|
+
* @slot - 选项卡导航项的文本
|
|
25
|
+
* @slot icon - 选项卡导航项中的图标
|
|
26
|
+
* @slot badge - 徽标
|
|
27
|
+
* @slot custom - 自定义整个选项卡导航项中的内容
|
|
28
|
+
*
|
|
29
|
+
* @csspart container - 导航项容器
|
|
30
|
+
* @csspart icon - 导航项中的图标
|
|
31
|
+
* @csspart label - 导航项的文本
|
|
32
|
+
*/
|
|
33
|
+
export declare class Tab extends Tab_base {
|
|
34
|
+
static styles: CSSResultGroup;
|
|
35
|
+
/**
|
|
36
|
+
* 该选项卡导航项的值
|
|
37
|
+
*/
|
|
38
|
+
value?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Material Icons 图标名。也可以通过 `slot="icon"` 设置
|
|
41
|
+
*/
|
|
42
|
+
icon?: string;
|
|
43
|
+
/**
|
|
44
|
+
* 是否把图标和文本水平排列
|
|
45
|
+
*/
|
|
46
|
+
inline: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* 是否为激活状态,由 `<mdui-tabs>` 组件控制该参数
|
|
49
|
+
*/
|
|
50
|
+
protected active: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* 选项卡形状。由 `<mdui-tabs>` 组件控制该参数
|
|
53
|
+
*/
|
|
54
|
+
protected variant: 'primary' | 'secondary';
|
|
55
|
+
protected readonly key: number;
|
|
56
|
+
private readonly rippleRef;
|
|
57
|
+
private readonly hasSlotController;
|
|
58
|
+
protected get rippleElement(): Ripple;
|
|
59
|
+
protected get rippleDisabled(): boolean;
|
|
60
|
+
protected get focusElement(): HTMLElement;
|
|
61
|
+
protected get focusDisabled(): boolean;
|
|
62
|
+
protected render(): TemplateResult;
|
|
63
|
+
}
|
|
64
|
+
declare global {
|
|
65
|
+
interface HTMLElementTagNameMap {
|
|
66
|
+
'mdui-tab': Tab;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
export {};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html, LitElement } 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 cc from 'classcat';
|
|
7
|
+
import { HasSlotController } from '@mdui/shared/controllers/has-slot.js';
|
|
8
|
+
import { booleanConverter } from '@mdui/shared/helpers/decorator.js';
|
|
9
|
+
import { nothingTemplate } from '@mdui/shared/helpers/template.js';
|
|
10
|
+
import { uniqueId } from '@mdui/shared/helpers/uniqueId.js';
|
|
11
|
+
import { componentStyle } from '@mdui/shared/lit-styles/component-style.js';
|
|
12
|
+
import { FocusableMixin } from '@mdui/shared/mixins/focusable.js';
|
|
13
|
+
import '../icon.js';
|
|
14
|
+
import { RippleMixin } from '../ripple/ripple-mixin.js';
|
|
15
|
+
import { tabStyle } from './tab-style.js';
|
|
16
|
+
/**
|
|
17
|
+
* @summary 选项卡项组件。需与 `<mdui-tabs>` 和 `<mdui-tab-panel>` 组件配合使用
|
|
18
|
+
*
|
|
19
|
+
* ```html
|
|
20
|
+
* <mdui-tabs value="tab-1">
|
|
21
|
+
* ..<mdui-tab value="tab-1">Tab 1</mdui-tab>
|
|
22
|
+
* ..<mdui-tab value="tab-2">Tab 2</mdui-tab>
|
|
23
|
+
* ..<mdui-tab value="tab-3">Tab 3</mdui-tab>
|
|
24
|
+
*
|
|
25
|
+
* ..<mdui-tab-panel slot="panel" value="tab-1">Panel 1</mdui-tab-panel>
|
|
26
|
+
* ..<mdui-tab-panel slot="panel" value="tab-2">Panel 2</mdui-tab-panel>
|
|
27
|
+
* ..<mdui-tab-panel slot="panel" value="tab-3">Panel 3</mdui-tab-panel>
|
|
28
|
+
* </mdui-tabs>
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @event focus - 获得焦点时触发
|
|
32
|
+
* @event blur - 失去焦点时触发
|
|
33
|
+
*
|
|
34
|
+
* @slot - 选项卡导航项的文本
|
|
35
|
+
* @slot icon - 选项卡导航项中的图标
|
|
36
|
+
* @slot badge - 徽标
|
|
37
|
+
* @slot custom - 自定义整个选项卡导航项中的内容
|
|
38
|
+
*
|
|
39
|
+
* @csspart container - 导航项容器
|
|
40
|
+
* @csspart icon - 导航项中的图标
|
|
41
|
+
* @csspart label - 导航项的文本
|
|
42
|
+
*/
|
|
43
|
+
export let Tab = class Tab extends RippleMixin(FocusableMixin(LitElement)) {
|
|
44
|
+
constructor() {
|
|
45
|
+
super(...arguments);
|
|
46
|
+
/**
|
|
47
|
+
* 是否把图标和文本水平排列
|
|
48
|
+
*/
|
|
49
|
+
this.inline = false;
|
|
50
|
+
/**
|
|
51
|
+
* 是否为激活状态,由 `<mdui-tabs>` 组件控制该参数
|
|
52
|
+
*/
|
|
53
|
+
this.active = false;
|
|
54
|
+
/**
|
|
55
|
+
* 选项卡形状。由 `<mdui-tabs>` 组件控制该参数
|
|
56
|
+
*/
|
|
57
|
+
this.variant = 'primary';
|
|
58
|
+
// 每一个 `<mdui-tab>` 元素都添加一个唯一的 key
|
|
59
|
+
this.key = uniqueId();
|
|
60
|
+
this.rippleRef = createRef();
|
|
61
|
+
this.hasSlotController = new HasSlotController(this, 'icon', 'custom');
|
|
62
|
+
}
|
|
63
|
+
get rippleElement() {
|
|
64
|
+
return this.rippleRef.value;
|
|
65
|
+
}
|
|
66
|
+
get rippleDisabled() {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
get focusElement() {
|
|
70
|
+
return this;
|
|
71
|
+
}
|
|
72
|
+
get focusDisabled() {
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
render() {
|
|
76
|
+
const hasIcon = this.icon || this.hasSlotController.test('icon');
|
|
77
|
+
const hasCustomSlot = this.hasSlotController.test('custom');
|
|
78
|
+
const renderBadge = () => html `<slot name="badge"></slot>`;
|
|
79
|
+
return html `<mdui-ripple ${ref(this.rippleRef)} .noRipple="${this.noRipple}"></mdui-ripple><div part="container" class="container ${cc({ preset: !hasCustomSlot })}"><slot name="custom"><div class="icon-container">${when(hasIcon || this.icon, renderBadge)}<slot name="icon" part="icon" class="icon">${this.icon
|
|
80
|
+
? html `<mdui-icon name="${this.icon}"></mdui-icon>`
|
|
81
|
+
: nothingTemplate}</slot></div><div class="label-container">${when(!hasIcon, renderBadge)}<slot part="label" class="label"></slot></div></slot></div>`;
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
Tab.styles = [componentStyle, tabStyle];
|
|
85
|
+
__decorate([
|
|
86
|
+
property({ reflect: true })
|
|
87
|
+
], Tab.prototype, "value", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
property({ reflect: true })
|
|
90
|
+
], Tab.prototype, "icon", void 0);
|
|
91
|
+
__decorate([
|
|
92
|
+
property({
|
|
93
|
+
type: Boolean,
|
|
94
|
+
reflect: true,
|
|
95
|
+
converter: booleanConverter,
|
|
96
|
+
})
|
|
97
|
+
], Tab.prototype, "inline", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
property({
|
|
100
|
+
type: Boolean,
|
|
101
|
+
reflect: true,
|
|
102
|
+
converter: booleanConverter,
|
|
103
|
+
})
|
|
104
|
+
], Tab.prototype, "active", void 0);
|
|
105
|
+
__decorate([
|
|
106
|
+
property({ reflect: true })
|
|
107
|
+
], Tab.prototype, "variant", void 0);
|
|
108
|
+
Tab = __decorate([
|
|
109
|
+
customElement('mdui-tab')
|
|
110
|
+
], Tab);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const tabsStyle: import("lit").CSSResult;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const tabsStyle = css `:host{position:relative;display:flex}:host([placement^=top]){flex-direction:column}:host([placement^=bottom]){flex-direction:column-reverse}:host([placement^=left]){flex-direction:row}:host([placement^=right]){flex-direction:row-reverse}.container{position:relative;display:flex;flex:0 0 auto;overflow-x:auto;background-color:rgb(var(--mdui-color-surface))}:host([placement^=bottom]) .container,:host([placement^=top]) .container{flex-direction:row}:host([placement^=left]) .container,:host([placement^=right]) .container{flex-direction:column}:host([placement$='-start']) .container{justify-content:flex-start}:host([placement=bottom]) .container,:host([placement=left]) .container,:host([placement=right]) .container,:host([placement=top]) .container{justify-content:center}:host([placement$='-end']) .container{justify-content:flex-end}.container::after{content:' ';position:absolute;background-color:rgb(var(--mdui-color-surface-variant))}:host([placement^=bottom]) .container::after,:host([placement^=top]) .container::after{left:0;width:100%;height:.0625rem}:host([placement^=top]) .container::after{bottom:0}:host([placement^=bottom]) .container::after{top:0}:host([placement^=left]) .container::after,:host([placement^=right]) .container::after{top:0;height:100%;width:.0625rem}:host([placement^=left]) .container::after{right:0}:host([placement^=right]) .container::after{left:0}.indicator{position:absolute;z-index:1;transition-duration:var(--mdui-motion-duration-medium2);transition-timing-function:var(--mdui-motion-easing-standard-decelerate);background-color:rgb(var(--mdui-color-primary))}:host([placement^=bottom]) .indicator,:host([placement^=top]) .indicator{transition-property:transform,left,width}:host([placement^=left]) .indicator,:host([placement^=right]) .indicator{transition-property:transform,top,height}:host([placement^=top]) .indicator{bottom:0}:host([placement^=bottom]) .indicator{top:0}:host([placement^=left]) .indicator{right:0}:host([placement^=right]) .indicator{left:0}:host([placement^=bottom][variant=primary]) .indicator,:host([placement^=top][variant=primary]) .indicator{height:.1875rem}:host([placement^=bottom][variant=secondary]) .indicator,:host([placement^=top][variant=secondary]) .indicator{height:.125rem}:host([placement^=left][variant=primary]) .indicator,:host([placement^=right][variant=primary]) .indicator{width:.1875rem}:host([placement^=left][variant=secondary]) .indicator,:host([placement^=right][variant=secondary]) .indicator{width:.125rem}:host([placement^=top][variant=primary]) .indicator{border-top-left-radius:.1875rem;border-top-right-radius:.1875rem}:host([placement^=bottom][variant=primary]) .indicator{border-bottom-right-radius:.1875rem;border-bottom-left-radius:.1875rem}:host([placement^=left][variant=primary]) .indicator{border-top-left-radius:.1875rem;border-bottom-left-radius:.1875rem}:host([placement^=right][variant=primary]) .indicator{border-top-right-radius:.1875rem;border-bottom-right-radius:.1875rem}:host([full-width]) ::slotted(mdui-tab){flex:1}`;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import '@mdui/jq/methods/children.js';
|
|
3
|
+
import '@mdui/jq/methods/css.js';
|
|
4
|
+
import '@mdui/jq/methods/find.js';
|
|
5
|
+
import '@mdui/jq/methods/get.js';
|
|
6
|
+
import type { CSSResultGroup, TemplateResult } from 'lit';
|
|
7
|
+
/**
|
|
8
|
+
* @summary 选项卡组件。需与 `<mdui-tab>` 和 `<mdui-tab-panel>` 组件配合使用
|
|
9
|
+
*
|
|
10
|
+
* ```html
|
|
11
|
+
* <mdui-tabs value="tab-1">
|
|
12
|
+
* ..<mdui-tab value="tab-1">Tab 1</mdui-tab>
|
|
13
|
+
* ..<mdui-tab value="tab-2">Tab 2</mdui-tab>
|
|
14
|
+
* ..<mdui-tab value="tab-3">Tab 3</mdui-tab>
|
|
15
|
+
*
|
|
16
|
+
* ..<mdui-tab-panel slot="panel" value="tab-1">Panel 1</mdui-tab-panel>
|
|
17
|
+
* ..<mdui-tab-panel slot="panel" value="tab-2">Panel 2</mdui-tab-panel>
|
|
18
|
+
* ..<mdui-tab-panel slot="panel" value="tab-3">Panel 3</mdui-tab-panel>
|
|
19
|
+
* </mdui-tabs>
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @event change - 选中的值变化时触发
|
|
23
|
+
*
|
|
24
|
+
* @slot - `<mdui-tab>` 元素
|
|
25
|
+
* @slot panel - `<mdui-tab-panel>` 元素
|
|
26
|
+
*
|
|
27
|
+
* @csspart container - `<mdui-tab>` 元素的容器
|
|
28
|
+
* @csspart indicator - 激活状态指示器
|
|
29
|
+
*/
|
|
30
|
+
export declare class Tabs extends LitElement {
|
|
31
|
+
static styles: CSSResultGroup;
|
|
32
|
+
/**
|
|
33
|
+
* 选项卡形状。可选值为:
|
|
34
|
+
*
|
|
35
|
+
* * `primary`:位于 `<mdui-top-app-bar>` 下方,用于切换应用的主页面时,可使用该形状的选项卡
|
|
36
|
+
* * `secondary`:位于页面中,用于切换一组相关内容时,可使用该形状的选项卡
|
|
37
|
+
*/
|
|
38
|
+
variant: /*位于 `<mdui-top-app-bar>` 下方,用于切换应用的主页面时,可使用该形状的选项卡*/ 'primary' | /*位于页面中,用于切换一组相关内容时,可使用该形状的选项卡*/ 'secondary';
|
|
39
|
+
/**
|
|
40
|
+
* 当前激活的 `<mdui-tab>` 的值
|
|
41
|
+
*/
|
|
42
|
+
value?: string;
|
|
43
|
+
/**
|
|
44
|
+
* 选项卡位置。默认为 `top-start`。可选值为:
|
|
45
|
+
*
|
|
46
|
+
* * `top-start`:位于上方,且左对齐
|
|
47
|
+
* * `top`:位于上方,且居中对齐
|
|
48
|
+
* * `top-end`:位于上方,且右对齐
|
|
49
|
+
* * `bottom-start`:位于下方,且左对齐
|
|
50
|
+
* * `bottom`:位于下方,且居中对齐
|
|
51
|
+
* * `bottom-end`:位于下方,且右对齐
|
|
52
|
+
* * `left-start`:位于左侧,且顶部对齐
|
|
53
|
+
* * `left`:位于左侧,且居中对齐
|
|
54
|
+
* * `left-end`:位于左侧,且底部对齐
|
|
55
|
+
* * `right-start`:位于右侧,且顶部对齐
|
|
56
|
+
* * `right`:位于右侧,且居中对齐
|
|
57
|
+
* * `right-end`:位于右侧,且底部对齐
|
|
58
|
+
*/
|
|
59
|
+
placement: /*位于上方,且左对齐*/ 'top-start' | /*位于上方,且居中对齐*/ 'top' | /*位于上方,且右对齐*/ 'top-end' | /*位于下方,且左对齐*/ 'bottom-start' | /*位于下方,且居中对齐*/ 'bottom' | /*位于下方,且右对齐*/ 'bottom-end' | /*位于左侧,且顶部对齐*/ 'left-start' | /*位于左侧,且居中对齐*/ 'left' | /*位于左侧,且底部对齐*/ 'left-end' | /*位于右侧,且顶部对齐*/ 'right-start' | /*位于右侧,且居中对齐*/ 'right' | /*位于右侧,且底部对齐*/ 'right-end';
|
|
60
|
+
/**
|
|
61
|
+
* 是否填满父元素宽度
|
|
62
|
+
*/
|
|
63
|
+
fullWidth: boolean;
|
|
64
|
+
private activeKey;
|
|
65
|
+
private activeTab?;
|
|
66
|
+
private observeResize?;
|
|
67
|
+
private tabs;
|
|
68
|
+
private panels;
|
|
69
|
+
private readonly containerRef;
|
|
70
|
+
private readonly indicatorRef;
|
|
71
|
+
private onActiveKeyChange;
|
|
72
|
+
private onValueChange;
|
|
73
|
+
private onIndicatorChange;
|
|
74
|
+
connectedCallback(): void;
|
|
75
|
+
disconnectedCallback(): void;
|
|
76
|
+
protected render(): TemplateResult;
|
|
77
|
+
private syncTabsAndPanels;
|
|
78
|
+
private onSlotChange;
|
|
79
|
+
private onClick;
|
|
80
|
+
private updateActive;
|
|
81
|
+
private updateIndicator;
|
|
82
|
+
}
|
|
83
|
+
declare global {
|
|
84
|
+
interface HTMLElementTagNameMap {
|
|
85
|
+
'mdui-tabs': Tabs;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html, LitElement } from 'lit';
|
|
3
|
+
import { customElement, property, state } from 'lit/decorators.js';
|
|
4
|
+
import { createRef, ref } from 'lit/directives/ref.js';
|
|
5
|
+
import { $ } from '@mdui/jq/$.js';
|
|
6
|
+
import '@mdui/jq/methods/children.js';
|
|
7
|
+
import '@mdui/jq/methods/css.js';
|
|
8
|
+
import '@mdui/jq/methods/find.js';
|
|
9
|
+
import '@mdui/jq/methods/get.js';
|
|
10
|
+
import { watch } from '@mdui/shared/decorators/watch.js';
|
|
11
|
+
import { booleanConverter } from '@mdui/shared/helpers/decorator.js';
|
|
12
|
+
import { emit } from '@mdui/shared/helpers/event.js';
|
|
13
|
+
import { observeResize } from '@mdui/shared/helpers/observeResize.js';
|
|
14
|
+
import { componentStyle } from '@mdui/shared/lit-styles/component-style.js';
|
|
15
|
+
import { tabsStyle } from './tabs-style.js';
|
|
16
|
+
/**
|
|
17
|
+
* @summary 选项卡组件。需与 `<mdui-tab>` 和 `<mdui-tab-panel>` 组件配合使用
|
|
18
|
+
*
|
|
19
|
+
* ```html
|
|
20
|
+
* <mdui-tabs value="tab-1">
|
|
21
|
+
* ..<mdui-tab value="tab-1">Tab 1</mdui-tab>
|
|
22
|
+
* ..<mdui-tab value="tab-2">Tab 2</mdui-tab>
|
|
23
|
+
* ..<mdui-tab value="tab-3">Tab 3</mdui-tab>
|
|
24
|
+
*
|
|
25
|
+
* ..<mdui-tab-panel slot="panel" value="tab-1">Panel 1</mdui-tab-panel>
|
|
26
|
+
* ..<mdui-tab-panel slot="panel" value="tab-2">Panel 2</mdui-tab-panel>
|
|
27
|
+
* ..<mdui-tab-panel slot="panel" value="tab-3">Panel 3</mdui-tab-panel>
|
|
28
|
+
* </mdui-tabs>
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @event change - 选中的值变化时触发
|
|
32
|
+
*
|
|
33
|
+
* @slot - `<mdui-tab>` 元素
|
|
34
|
+
* @slot panel - `<mdui-tab-panel>` 元素
|
|
35
|
+
*
|
|
36
|
+
* @csspart container - `<mdui-tab>` 元素的容器
|
|
37
|
+
* @csspart indicator - 激活状态指示器
|
|
38
|
+
*/
|
|
39
|
+
export let Tabs = class Tabs extends LitElement {
|
|
40
|
+
constructor() {
|
|
41
|
+
super(...arguments);
|
|
42
|
+
/**
|
|
43
|
+
* 选项卡形状。可选值为:
|
|
44
|
+
*
|
|
45
|
+
* * `primary`:位于 `<mdui-top-app-bar>` 下方,用于切换应用的主页面时,可使用该形状的选项卡
|
|
46
|
+
* * `secondary`:位于页面中,用于切换一组相关内容时,可使用该形状的选项卡
|
|
47
|
+
*/
|
|
48
|
+
this.variant = 'primary';
|
|
49
|
+
/**
|
|
50
|
+
* 选项卡位置。默认为 `top-start`。可选值为:
|
|
51
|
+
*
|
|
52
|
+
* * `top-start`:位于上方,且左对齐
|
|
53
|
+
* * `top`:位于上方,且居中对齐
|
|
54
|
+
* * `top-end`:位于上方,且右对齐
|
|
55
|
+
* * `bottom-start`:位于下方,且左对齐
|
|
56
|
+
* * `bottom`:位于下方,且居中对齐
|
|
57
|
+
* * `bottom-end`:位于下方,且右对齐
|
|
58
|
+
* * `left-start`:位于左侧,且顶部对齐
|
|
59
|
+
* * `left`:位于左侧,且居中对齐
|
|
60
|
+
* * `left-end`:位于左侧,且底部对齐
|
|
61
|
+
* * `right-start`:位于右侧,且顶部对齐
|
|
62
|
+
* * `right`:位于右侧,且居中对齐
|
|
63
|
+
* * `right-end`:位于右侧,且底部对齐
|
|
64
|
+
*/
|
|
65
|
+
this.placement = 'top-start';
|
|
66
|
+
/**
|
|
67
|
+
* 是否填满父元素宽度
|
|
68
|
+
*/
|
|
69
|
+
this.fullWidth = false;
|
|
70
|
+
// 因为 tab 的 value 可能会重复,所以在每个 tab 元素上都添加了一个唯一的 key,通过 activeKey 来记录激活状态的 key
|
|
71
|
+
this.activeKey = 0;
|
|
72
|
+
this.tabs = [];
|
|
73
|
+
this.panels = [];
|
|
74
|
+
this.containerRef = createRef();
|
|
75
|
+
this.indicatorRef = createRef();
|
|
76
|
+
}
|
|
77
|
+
onActiveKeyChange() {
|
|
78
|
+
var _a;
|
|
79
|
+
// 根据 activeKey 读取对应 tab 的值
|
|
80
|
+
this.value = (_a = this.tabs.find((tab) => tab.key === this.activeKey)) === null || _a === void 0 ? void 0 : _a.value;
|
|
81
|
+
emit(this, 'change');
|
|
82
|
+
}
|
|
83
|
+
onValueChange() {
|
|
84
|
+
var _a;
|
|
85
|
+
const tab = this.tabs.find((tab) => tab.value === this.value);
|
|
86
|
+
this.activeKey = (_a = tab === null || tab === void 0 ? void 0 : tab.key) !== null && _a !== void 0 ? _a : 0;
|
|
87
|
+
this.updateActive();
|
|
88
|
+
}
|
|
89
|
+
onIndicatorChange() {
|
|
90
|
+
this.updateIndicator();
|
|
91
|
+
}
|
|
92
|
+
connectedCallback() {
|
|
93
|
+
super.connectedCallback();
|
|
94
|
+
this.syncTabsAndPanels();
|
|
95
|
+
this.updateComplete.then(() => {
|
|
96
|
+
this.observeResize = observeResize(this.containerRef.value, () => this.updateIndicator());
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
disconnectedCallback() {
|
|
100
|
+
var _a;
|
|
101
|
+
super.disconnectedCallback();
|
|
102
|
+
(_a = this.observeResize) === null || _a === void 0 ? void 0 : _a.unobserve();
|
|
103
|
+
}
|
|
104
|
+
render() {
|
|
105
|
+
return html `<div ${ref(this.containerRef)} part="container" class="container"><slot @slotchange="${this.onSlotChange}" @click="${this.onClick}"></slot><div ${ref(this.indicatorRef)} part="indicator" class="indicator"></div></div><slot name="panel" @slotchange="${this.onSlotChange}"></slot>`;
|
|
106
|
+
}
|
|
107
|
+
syncTabsAndPanels() {
|
|
108
|
+
this.tabs = $(this).find('mdui-tab').get();
|
|
109
|
+
this.panels = $(this)
|
|
110
|
+
.find('mdui-tab-panel[slot="panel"]')
|
|
111
|
+
.get();
|
|
112
|
+
}
|
|
113
|
+
onSlotChange() {
|
|
114
|
+
this.syncTabsAndPanels();
|
|
115
|
+
this.updateActive();
|
|
116
|
+
}
|
|
117
|
+
onClick(event) {
|
|
118
|
+
// event.button 为 0 时,为鼠标左键点击。忽略鼠标中键和右键
|
|
119
|
+
if (event.button) {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
const target = event.target;
|
|
123
|
+
const tab = target.closest('mdui-tab');
|
|
124
|
+
this.activeKey = tab.key;
|
|
125
|
+
this.updateActive();
|
|
126
|
+
}
|
|
127
|
+
updateActive() {
|
|
128
|
+
this.activeTab = this.tabs
|
|
129
|
+
.map((tab) => {
|
|
130
|
+
tab.active = this.activeKey === tab.key;
|
|
131
|
+
return tab;
|
|
132
|
+
})
|
|
133
|
+
.find((tab) => tab.active);
|
|
134
|
+
this.panels.forEach((panel) => { var _a; return (panel.active = panel.value === ((_a = this.activeTab) === null || _a === void 0 ? void 0 : _a.value)); });
|
|
135
|
+
this.updateIndicator();
|
|
136
|
+
}
|
|
137
|
+
async updateIndicator() {
|
|
138
|
+
await this.updateComplete;
|
|
139
|
+
const activeTab = this.activeTab;
|
|
140
|
+
const $indicator = $(this.indicatorRef.value);
|
|
141
|
+
const isVertical = this.placement.startsWith('left') || this.placement.startsWith('right');
|
|
142
|
+
// 没有激活的,不显示指示器
|
|
143
|
+
if (!activeTab) {
|
|
144
|
+
$indicator.css({
|
|
145
|
+
transform: isVertical ? 'scaleY(0)' : 'scaleX(0)',
|
|
146
|
+
});
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
const $activeTab = $(activeTab);
|
|
150
|
+
const offsetTop = activeTab.offsetTop;
|
|
151
|
+
const offsetLeft = activeTab.offsetLeft;
|
|
152
|
+
const commonStyle = isVertical
|
|
153
|
+
? { transform: 'scaleY(1)', width: '', left: '' }
|
|
154
|
+
: { transform: 'scaleX(1)', height: '', top: '' };
|
|
155
|
+
let shownStyle = {};
|
|
156
|
+
if (this.variant === 'primary') {
|
|
157
|
+
const customSlots = $activeTab.find(':scope > [slot="custom"]').get();
|
|
158
|
+
const children = customSlots.length
|
|
159
|
+
? customSlots
|
|
160
|
+
: $(activeTab.renderRoot)
|
|
161
|
+
.find('slot[name="custom"]')
|
|
162
|
+
.children()
|
|
163
|
+
.get();
|
|
164
|
+
if (isVertical) {
|
|
165
|
+
// 最上方的元素的顶部,距离容器顶部距离
|
|
166
|
+
const top = Math.min(...children.map((child) => child.offsetTop)) + offsetTop;
|
|
167
|
+
// 最下方的元素的底部,距离容器顶部的距离
|
|
168
|
+
const bottom = Math.max(...children.map((child) => child.offsetTop + child.offsetHeight)) + offsetTop;
|
|
169
|
+
shownStyle = { top, height: bottom - top };
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
// 最左侧的元素的左侧,距离容器左侧的距离
|
|
173
|
+
const left = Math.min(...children.map((child) => child.offsetLeft)) + offsetLeft;
|
|
174
|
+
// 最右侧的元素的右侧,距离容器左侧的距离
|
|
175
|
+
const right = Math.max(...children.map((child) => child.offsetLeft + child.offsetWidth)) + offsetLeft;
|
|
176
|
+
shownStyle = { left, width: right - left };
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
if (this.variant === 'secondary') {
|
|
180
|
+
shownStyle = isVertical
|
|
181
|
+
? { top: offsetTop, height: activeTab.offsetHeight }
|
|
182
|
+
: { left: offsetLeft, width: activeTab.offsetWidth };
|
|
183
|
+
}
|
|
184
|
+
$indicator.css({ ...commonStyle, ...shownStyle });
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
Tabs.styles = [componentStyle, tabsStyle];
|
|
188
|
+
__decorate([
|
|
189
|
+
property({ reflect: true })
|
|
190
|
+
], Tabs.prototype, "variant", void 0);
|
|
191
|
+
__decorate([
|
|
192
|
+
property({ reflect: true })
|
|
193
|
+
], Tabs.prototype, "value", void 0);
|
|
194
|
+
__decorate([
|
|
195
|
+
property({ reflect: true })
|
|
196
|
+
], Tabs.prototype, "placement", void 0);
|
|
197
|
+
__decorate([
|
|
198
|
+
property({
|
|
199
|
+
type: Boolean,
|
|
200
|
+
reflect: true,
|
|
201
|
+
converter: booleanConverter,
|
|
202
|
+
attribute: 'full-width',
|
|
203
|
+
})
|
|
204
|
+
], Tabs.prototype, "fullWidth", void 0);
|
|
205
|
+
__decorate([
|
|
206
|
+
state()
|
|
207
|
+
], Tabs.prototype, "activeKey", void 0);
|
|
208
|
+
__decorate([
|
|
209
|
+
watch('activeKey', true)
|
|
210
|
+
], Tabs.prototype, "onActiveKeyChange", null);
|
|
211
|
+
__decorate([
|
|
212
|
+
watch('value')
|
|
213
|
+
], Tabs.prototype, "onValueChange", null);
|
|
214
|
+
__decorate([
|
|
215
|
+
watch('variant', true),
|
|
216
|
+
watch('placement', true),
|
|
217
|
+
watch('fullWidth', true)
|
|
218
|
+
], Tabs.prototype, "onIndicatorChange", null);
|
|
219
|
+
Tabs = __decorate([
|
|
220
|
+
customElement('mdui-tabs')
|
|
221
|
+
], Tabs);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './tabs/tabs.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './tabs/tabs.js';
|