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
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
import $ from 'mdui.jq/es/$';
|
|
2
|
-
import { JQ } from 'mdui.jq/es/JQ';
|
|
3
|
-
import 'mdui.jq/es/methods/addClass';
|
|
4
|
-
import 'mdui.jq/es/methods/append';
|
|
5
|
-
import 'mdui.jq/es/methods/attr';
|
|
6
|
-
import 'mdui.jq/es/methods/css';
|
|
7
|
-
import 'mdui.jq/es/methods/data';
|
|
8
|
-
import 'mdui.jq/es/methods/each';
|
|
9
|
-
import 'mdui.jq/es/methods/empty';
|
|
10
|
-
import 'mdui.jq/es/methods/find';
|
|
11
|
-
import 'mdui.jq/es/methods/hasClass';
|
|
12
|
-
import 'mdui.jq/es/methods/on';
|
|
13
|
-
import 'mdui.jq/es/methods/parent';
|
|
14
|
-
import 'mdui.jq/es/methods/remove';
|
|
15
|
-
import 'mdui.jq/es/methods/removeClass';
|
|
16
|
-
import 'mdui.jq/es/methods/text';
|
|
17
|
-
import 'mdui.jq/es/methods/val';
|
|
18
|
-
import 'mdui.jq/es/methods/width';
|
|
19
|
-
import Selector from 'mdui.jq/es/types/Selector';
|
|
20
|
-
import { isUndefined } from 'mdui.jq/es/utils';
|
|
21
|
-
import mdui from '../../mdui';
|
|
22
|
-
import { $document } from '../../utils/dom';
|
|
23
|
-
import {
|
|
24
|
-
endEvent,
|
|
25
|
-
isAllow,
|
|
26
|
-
register,
|
|
27
|
-
startEvent,
|
|
28
|
-
unlockEvent,
|
|
29
|
-
} from '../../utils/touchHandler';
|
|
30
|
-
|
|
31
|
-
declare module '../../interfaces/MduiStatic' {
|
|
32
|
-
interface MduiStatic {
|
|
33
|
-
/**
|
|
34
|
-
* 动态修改了滑块后,需要调用该方法重新初始化滑块
|
|
35
|
-
*
|
|
36
|
-
* 若传入了参数,则只初始化该参数对应的滑块。若没有传入参数,则重新初始化所有滑块。
|
|
37
|
-
* @param selector CSS 选择器、或 DOM 元素、或 DOM 元素组成的数组、或 JQ 对象
|
|
38
|
-
*/
|
|
39
|
-
updateSliders(
|
|
40
|
-
selector?: Selector | HTMLElement | ArrayLike<HTMLElement>,
|
|
41
|
-
): void;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* 滑块的值改变后修改滑块样式
|
|
47
|
-
* @param $slider
|
|
48
|
-
*/
|
|
49
|
-
function updateValueStyle($slider: JQ): void {
|
|
50
|
-
const data = $slider.data();
|
|
51
|
-
|
|
52
|
-
const $track = data._slider_$track;
|
|
53
|
-
const $fill = data._slider_$fill;
|
|
54
|
-
const $thumb = data._slider_$thumb;
|
|
55
|
-
const $input = data._slider_$input;
|
|
56
|
-
const min = data._slider_min;
|
|
57
|
-
const max = data._slider_max;
|
|
58
|
-
const isDisabled = data._slider_disabled;
|
|
59
|
-
const isDiscrete = data._slider_discrete;
|
|
60
|
-
const $thumbText = data._slider_$thumbText;
|
|
61
|
-
const value = $input.val();
|
|
62
|
-
const percent = ((value - min) / (max - min)) * 100;
|
|
63
|
-
|
|
64
|
-
$fill.width(`${percent}%`);
|
|
65
|
-
$track.width(`${100 - percent}%`);
|
|
66
|
-
|
|
67
|
-
if (isDisabled) {
|
|
68
|
-
$fill.css('padding-right', '6px');
|
|
69
|
-
$track.css('padding-left', '6px');
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
$thumb.css('left', `${percent}%`);
|
|
73
|
-
|
|
74
|
-
if (isDiscrete) {
|
|
75
|
-
$thumbText.text(value);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
percent === 0
|
|
79
|
-
? $slider.addClass('mdui-slider-zero')
|
|
80
|
-
: $slider.removeClass('mdui-slider-zero');
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* 重新初始化滑块
|
|
85
|
-
* @param $slider
|
|
86
|
-
*/
|
|
87
|
-
function reInit($slider: JQ): void {
|
|
88
|
-
const $track = $('<div class="mdui-slider-track"></div>');
|
|
89
|
-
const $fill = $('<div class="mdui-slider-fill"></div>');
|
|
90
|
-
const $thumb = $('<div class="mdui-slider-thumb"></div>');
|
|
91
|
-
const $input = $slider.find('input[type="range"]') as JQ<HTMLInputElement>;
|
|
92
|
-
const isDisabled = $input[0].disabled;
|
|
93
|
-
const isDiscrete = $slider.hasClass('mdui-slider-discrete');
|
|
94
|
-
|
|
95
|
-
// 禁用状态
|
|
96
|
-
isDisabled
|
|
97
|
-
? $slider.addClass('mdui-slider-disabled')
|
|
98
|
-
: $slider.removeClass('mdui-slider-disabled');
|
|
99
|
-
|
|
100
|
-
// 重新填充 HTML
|
|
101
|
-
$slider.find('.mdui-slider-track').remove();
|
|
102
|
-
$slider.find('.mdui-slider-fill').remove();
|
|
103
|
-
$slider.find('.mdui-slider-thumb').remove();
|
|
104
|
-
$slider.append($track).append($fill).append($thumb);
|
|
105
|
-
|
|
106
|
-
// 间续型滑块
|
|
107
|
-
let $thumbText = $();
|
|
108
|
-
if (isDiscrete) {
|
|
109
|
-
$thumbText = $('<span></span>');
|
|
110
|
-
$thumb.empty().append($thumbText);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
$slider.data('_slider_$track', $track);
|
|
114
|
-
$slider.data('_slider_$fill', $fill);
|
|
115
|
-
$slider.data('_slider_$thumb', $thumb);
|
|
116
|
-
$slider.data('_slider_$input', $input);
|
|
117
|
-
$slider.data('_slider_min', $input.attr('min'));
|
|
118
|
-
$slider.data('_slider_max', $input.attr('max'));
|
|
119
|
-
$slider.data('_slider_disabled', isDisabled);
|
|
120
|
-
$slider.data('_slider_discrete', isDiscrete);
|
|
121
|
-
$slider.data('_slider_$thumbText', $thumbText);
|
|
122
|
-
|
|
123
|
-
// 设置默认值
|
|
124
|
-
updateValueStyle($slider);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
const rangeSelector = '.mdui-slider input[type="range"]';
|
|
128
|
-
|
|
129
|
-
$(() => {
|
|
130
|
-
// 滑块滑动事件
|
|
131
|
-
$document.on('input change', rangeSelector, function () {
|
|
132
|
-
const $slider = $(this).parent() as JQ<HTMLElement>;
|
|
133
|
-
|
|
134
|
-
updateValueStyle($slider);
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
// 开始触摸滑块事件
|
|
138
|
-
$document.on(startEvent, rangeSelector, function (event: Event) {
|
|
139
|
-
if (!isAllow(event)) {
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
register(event);
|
|
144
|
-
|
|
145
|
-
if ((this as HTMLInputElement).disabled) {
|
|
146
|
-
return;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
const $slider = $(this).parent() as JQ<HTMLElement>;
|
|
150
|
-
|
|
151
|
-
$slider.addClass('mdui-slider-focus');
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
// 结束触摸滑块事件
|
|
155
|
-
$document.on(endEvent, rangeSelector, function (event: Event) {
|
|
156
|
-
if (!isAllow(event)) {
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
if ((this as HTMLInputElement).disabled) {
|
|
161
|
-
return;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
const $slider = $(this).parent() as JQ<HTMLElement>;
|
|
165
|
-
|
|
166
|
-
$slider.removeClass('mdui-slider-focus');
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
$document.on(unlockEvent, rangeSelector, register);
|
|
170
|
-
|
|
171
|
-
/**
|
|
172
|
-
* 初始化滑块
|
|
173
|
-
*/
|
|
174
|
-
mdui.mutation('.mdui-slider', function () {
|
|
175
|
-
reInit($(this));
|
|
176
|
-
});
|
|
177
|
-
});
|
|
178
|
-
|
|
179
|
-
mdui.updateSliders = function (
|
|
180
|
-
selector?: Selector | HTMLElement | ArrayLike<HTMLElement>,
|
|
181
|
-
): void {
|
|
182
|
-
const $elements = isUndefined(selector) ? $('.mdui-slider') : $(selector);
|
|
183
|
-
|
|
184
|
-
$elements.each((_, element) => {
|
|
185
|
-
reInit($(element));
|
|
186
|
-
});
|
|
187
|
-
};
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* =============================================================================
|
|
3
|
-
* ************ Snackbar ************
|
|
4
|
-
* =============================================================================
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
@import '../button/index';
|
|
8
|
-
|
|
9
|
-
.mdui-snackbar {
|
|
10
|
-
position: fixed;
|
|
11
|
-
z-index: @z-index-snackbar;
|
|
12
|
-
display: flex;
|
|
13
|
-
align-items: center;
|
|
14
|
-
justify-content: space-between;
|
|
15
|
-
box-sizing: border-box;
|
|
16
|
-
|
|
17
|
-
// 手机端的样式
|
|
18
|
-
width: 100%;
|
|
19
|
-
min-height: 48px;
|
|
20
|
-
padding: 0 24px 0 24px;
|
|
21
|
-
color: #fff;
|
|
22
|
-
font-size: 14px;
|
|
23
|
-
line-height: 20px;
|
|
24
|
-
background-color: #323232;
|
|
25
|
-
will-change: transform;
|
|
26
|
-
|
|
27
|
-
// 平板、桌面端样式
|
|
28
|
-
@media (min-width: @screen-sm-min) {
|
|
29
|
-
width: auto;
|
|
30
|
-
min-width: 288px;
|
|
31
|
-
max-width: 568px;
|
|
32
|
-
border-radius: 2px;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.mdui-snackbar-bottom,
|
|
37
|
-
.mdui-snackbar-top,
|
|
38
|
-
.mdui-snackbar-left-top,
|
|
39
|
-
.mdui-snackbar-left-bottom,
|
|
40
|
-
.mdui-snackbar-right-top,
|
|
41
|
-
.mdui-snackbar-right-bottom {
|
|
42
|
-
transition: transform .3s @animation-curve-default;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/* 位置 */
|
|
46
|
-
.mdui-snackbar-bottom,
|
|
47
|
-
.mdui-snackbar-left-bottom,
|
|
48
|
-
.mdui-snackbar-right-bottom {
|
|
49
|
-
bottom: 0;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.mdui-snackbar-top,
|
|
53
|
-
.mdui-snackbar-left-top,
|
|
54
|
-
.mdui-snackbar-right-top {
|
|
55
|
-
top: 0;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.mdui-snackbar-top,
|
|
59
|
-
.mdui-snackbar-bottom {
|
|
60
|
-
left: 50%;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// 平板、桌面端位置
|
|
64
|
-
@media (min-width: @screen-sm-min) {
|
|
65
|
-
.mdui-snackbar-left-top {
|
|
66
|
-
top: 24px;
|
|
67
|
-
left: 24px;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.mdui-snackbar-left-bottom {
|
|
71
|
-
bottom: 24px;
|
|
72
|
-
left: 24px;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.mdui-snackbar-right-top {
|
|
76
|
-
top: 24px;
|
|
77
|
-
right: 24px;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.mdui-snackbar-right-bottom {
|
|
81
|
-
right: 24px;
|
|
82
|
-
bottom: 24px;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/* 文本 */
|
|
87
|
-
.mdui-snackbar-text {
|
|
88
|
-
position: relative;
|
|
89
|
-
max-width: 100%;
|
|
90
|
-
padding: 14px 0 14px 0;
|
|
91
|
-
overflow: hidden;
|
|
92
|
-
text-overflow: ellipsis;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/* 按钮 */
|
|
96
|
-
.mdui-snackbar-action {
|
|
97
|
-
margin-right: -16px;
|
|
98
|
-
white-space: nowrap;
|
|
99
|
-
.mdui-text-color(@color-accent-default-name, a100);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* =============================================================================
|
|
105
|
-
* ************ Snackbar 强调色 ************
|
|
106
|
-
* =============================================================================
|
|
107
|
-
*/
|
|
108
|
-
& {
|
|
109
|
-
.loop-accent-theme(@counter-color) when (@counter-color > 0) {
|
|
110
|
-
.loop-accent-theme((@counter-color - 1));
|
|
111
|
-
@colorName: extract(@globalAccentColors, @counter-color);
|
|
112
|
-
|
|
113
|
-
.mdui-theme-accent-@{colorName} when not (@colorName = null) {
|
|
114
|
-
.mdui-snackbar-action {
|
|
115
|
-
.mdui-text-color(@colorName, a100);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
}
|
|
120
|
-
.loop-accent-theme(length(@globalAccentColors));
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* =============================================================================
|
|
126
|
-
* ************ Snackbar dark ************
|
|
127
|
-
* =============================================================================
|
|
128
|
-
*/
|
|
129
|
-
.layout-theme({
|
|
130
|
-
.mdui-snackbar {
|
|
131
|
-
background-color: #5d5d5d;
|
|
132
|
-
}
|
|
133
|
-
});
|
|
@@ -1,367 +0,0 @@
|
|
|
1
|
-
import $ from 'mdui.jq/es/$';
|
|
2
|
-
import extend from 'mdui.jq/es/functions/extend';
|
|
3
|
-
import { JQ } from 'mdui.jq/es/JQ';
|
|
4
|
-
import 'mdui.jq/es/methods/addClass';
|
|
5
|
-
import 'mdui.jq/es/methods/appendTo';
|
|
6
|
-
import 'mdui.jq/es/methods/find';
|
|
7
|
-
import 'mdui.jq/es/methods/hasClass';
|
|
8
|
-
import 'mdui.jq/es/methods/off';
|
|
9
|
-
import 'mdui.jq/es/methods/on';
|
|
10
|
-
import 'mdui.jq/es/methods/parents';
|
|
11
|
-
import 'mdui.jq/es/methods/remove';
|
|
12
|
-
import { isString } from 'mdui.jq/es/utils';
|
|
13
|
-
import mdui from '../../mdui';
|
|
14
|
-
import '../../jq_extends/methods/reflow';
|
|
15
|
-
import '../../jq_extends/methods/transform';
|
|
16
|
-
import '../../jq_extends/methods/transitionEnd';
|
|
17
|
-
import { $document } from '../../utils/dom';
|
|
18
|
-
import { dequeue, queue } from '../../utils/queue';
|
|
19
|
-
import { startEvent } from '../../utils/touchHandler';
|
|
20
|
-
|
|
21
|
-
declare module '../../interfaces/MduiStatic' {
|
|
22
|
-
interface MduiStatic {
|
|
23
|
-
/**
|
|
24
|
-
* 打开一个 Snackbar
|
|
25
|
-
* @param message Snackbar 的文本
|
|
26
|
-
* @param options 配置参数
|
|
27
|
-
*/
|
|
28
|
-
snackbar(message: string, options?: OPTIONS): Snackbar;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* 打开一个 Snackbar
|
|
32
|
-
* @param options 配置参数
|
|
33
|
-
*/
|
|
34
|
-
snackbar(options: OPTIONS): Snackbar;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
type OPTIONS = {
|
|
39
|
-
/**
|
|
40
|
-
* Snackbar 的文本。通过 `mdui.snackbar(options)` 调用时,该参数不能为空
|
|
41
|
-
*/
|
|
42
|
-
message?: string;
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* 在用户没有操作时多长时间自动隐藏,单位(毫秒)。为 `0` 时表示不自动关闭,默认为 `4000`
|
|
46
|
-
*/
|
|
47
|
-
timeout?: number;
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Snackbar 的位置,默认为 `bottom`。
|
|
51
|
-
* 取值范围包括:
|
|
52
|
-
* `bottom`: 下方
|
|
53
|
-
* `top`: 上方
|
|
54
|
-
* `left-top`: 左上角
|
|
55
|
-
* `left-bottom`: 左下角
|
|
56
|
-
* `right-top`: 右上角
|
|
57
|
-
* `right-bottom`: 右下角
|
|
58
|
-
*/
|
|
59
|
-
position?:
|
|
60
|
-
| 'bottom'
|
|
61
|
-
| 'top'
|
|
62
|
-
| 'left-top'
|
|
63
|
-
| 'left-bottom'
|
|
64
|
-
| 'right-top'
|
|
65
|
-
| 'right-bottom';
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* 按钮的文本
|
|
69
|
-
*/
|
|
70
|
-
buttonText?: string;
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* 按钮的文本颜色,可以是颜色名或颜色值,如 `red`、`#ffffff`、`rgba(255, 255, 255, 0.3)` 等。默认为 `#90CAF9`
|
|
74
|
-
*/
|
|
75
|
-
buttonColor?: string;
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* 点击按钮时是否关闭 Snackbar,默认为 `true`
|
|
79
|
-
*/
|
|
80
|
-
closeOnButtonClick?: boolean;
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* 点击或触摸 Snackbar 以外的区域时是否关闭 Snackbar,默认为 `true`
|
|
84
|
-
*/
|
|
85
|
-
closeOnOutsideClick?: boolean;
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* 在 Snackbar 上点击的回调函数,参数为 Snackbar 的实例
|
|
89
|
-
*/
|
|
90
|
-
onClick?: (snackbar: Snackbar) => void;
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* 点击 Snackbar 上的按钮时的回调函数,参数为 Snackbar 的实例
|
|
94
|
-
*/
|
|
95
|
-
onButtonClick?: (snackbar: Snackbar) => void;
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Snackbar 开始打开时的回调函数,参数为 Snackbar 的实例
|
|
99
|
-
*/
|
|
100
|
-
onOpen?: (snackbar: Snackbar) => void;
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Snackbar 打开后的回调函数,参数为 Snackbar 的实例
|
|
104
|
-
*/
|
|
105
|
-
onOpened?: (snackbar: Snackbar) => void;
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Snackbar 开始关闭时的回调函数,参数为 Snackbar 的实例
|
|
109
|
-
*/
|
|
110
|
-
onClose?: (snackbar: Snackbar) => void;
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Snackbar 关闭后的回调函数,参数为 Snackbar 的实例
|
|
114
|
-
*/
|
|
115
|
-
onClosed?: (snackbar: Snackbar) => void;
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
type STATE = 'opening' | 'opened' | 'closing' | 'closed';
|
|
119
|
-
|
|
120
|
-
const DEFAULT_OPTIONS: OPTIONS = {
|
|
121
|
-
message: '',
|
|
122
|
-
timeout: 4000,
|
|
123
|
-
position: 'bottom',
|
|
124
|
-
buttonText: '',
|
|
125
|
-
buttonColor: '',
|
|
126
|
-
closeOnButtonClick: true,
|
|
127
|
-
closeOnOutsideClick: true,
|
|
128
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
129
|
-
onClick: () => {},
|
|
130
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
131
|
-
onButtonClick: () => {},
|
|
132
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
133
|
-
onOpen: () => {},
|
|
134
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
135
|
-
onOpened: () => {},
|
|
136
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
137
|
-
onClose: () => {},
|
|
138
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
139
|
-
onClosed: () => {},
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* 当前打开着的 Snackbar
|
|
144
|
-
*/
|
|
145
|
-
let currentInst: null | Snackbar = null;
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* 队列名
|
|
149
|
-
*/
|
|
150
|
-
const queueName = '_mdui_snackbar';
|
|
151
|
-
|
|
152
|
-
class Snackbar {
|
|
153
|
-
/**
|
|
154
|
-
* Snackbar 元素
|
|
155
|
-
*/
|
|
156
|
-
public $element: JQ;
|
|
157
|
-
/**
|
|
158
|
-
* 配置参数
|
|
159
|
-
*/
|
|
160
|
-
public options: OPTIONS = extend({}, DEFAULT_OPTIONS);
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* 当前 Snackbar 的状态
|
|
164
|
-
*/
|
|
165
|
-
private state: STATE = 'closed';
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* setTimeout 的 ID
|
|
169
|
-
*/
|
|
170
|
-
private timeoutId: any = null;
|
|
171
|
-
|
|
172
|
-
public constructor(options: OPTIONS) {
|
|
173
|
-
extend(this.options, options);
|
|
174
|
-
|
|
175
|
-
// 按钮颜色
|
|
176
|
-
let buttonColorStyle = '';
|
|
177
|
-
let buttonColorClass = '';
|
|
178
|
-
|
|
179
|
-
if (
|
|
180
|
-
this.options.buttonColor!.indexOf('#') === 0 ||
|
|
181
|
-
this.options.buttonColor!.indexOf('rgb') === 0
|
|
182
|
-
) {
|
|
183
|
-
buttonColorStyle = `style="color:${this.options.buttonColor}"`;
|
|
184
|
-
} else if (this.options.buttonColor !== '') {
|
|
185
|
-
buttonColorClass = `mdui-text-color-${this.options.buttonColor}`;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
// 添加 HTML
|
|
189
|
-
this.$element = $(
|
|
190
|
-
'<div class="mdui-snackbar">' +
|
|
191
|
-
`<div class="mdui-snackbar-text">${this.options.message}</div>` +
|
|
192
|
-
(this.options.buttonText
|
|
193
|
-
? `<a href="javascript:void(0)" class="mdui-snackbar-action mdui-btn mdui-ripple mdui-ripple-white ${buttonColorClass}" ${buttonColorStyle}>${this.options.buttonText}</a>`
|
|
194
|
-
: '') +
|
|
195
|
-
'</div>',
|
|
196
|
-
).appendTo(document.body);
|
|
197
|
-
|
|
198
|
-
// 设置位置
|
|
199
|
-
this.setPosition('close');
|
|
200
|
-
|
|
201
|
-
this.$element.reflow().addClass(`mdui-snackbar-${this.options.position}`);
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* 点击 Snackbar 外面的区域关闭
|
|
206
|
-
* @param event
|
|
207
|
-
*/
|
|
208
|
-
private closeOnOutsideClick(event: Event): void {
|
|
209
|
-
const $target = $(event.target as HTMLElement);
|
|
210
|
-
|
|
211
|
-
if (
|
|
212
|
-
!$target.hasClass('mdui-snackbar') &&
|
|
213
|
-
!$target.parents('.mdui-snackbar').length
|
|
214
|
-
) {
|
|
215
|
-
currentInst!.close();
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
/**
|
|
220
|
-
* 设置 Snackbar 的位置
|
|
221
|
-
* @param state
|
|
222
|
-
*/
|
|
223
|
-
private setPosition(state: 'open' | 'close'): void {
|
|
224
|
-
const snackbarHeight = this.$element[0].clientHeight;
|
|
225
|
-
const position = this.options.position;
|
|
226
|
-
|
|
227
|
-
let translateX;
|
|
228
|
-
let translateY;
|
|
229
|
-
|
|
230
|
-
// translateX
|
|
231
|
-
if (position === 'bottom' || position === 'top') {
|
|
232
|
-
translateX = '-50%';
|
|
233
|
-
} else {
|
|
234
|
-
translateX = '0';
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
// translateY
|
|
238
|
-
if (state === 'open') {
|
|
239
|
-
translateY = '0';
|
|
240
|
-
} else {
|
|
241
|
-
if (position === 'bottom') {
|
|
242
|
-
translateY = snackbarHeight;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
if (position === 'top') {
|
|
246
|
-
translateY = -snackbarHeight;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
if (position === 'left-top' || position === 'right-top') {
|
|
250
|
-
translateY = -snackbarHeight - 24;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
if (position === 'left-bottom' || position === 'right-bottom') {
|
|
254
|
-
translateY = snackbarHeight + 24;
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
this.$element.transform(`translate(${translateX},${translateY}px`);
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* 打开 Snackbar
|
|
263
|
-
*/
|
|
264
|
-
public open(): void {
|
|
265
|
-
if (this.state === 'opening' || this.state === 'opened') {
|
|
266
|
-
return;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
// 如果当前有正在显示的 Snackbar,则先加入队列,等旧 Snackbar 关闭后再打开
|
|
270
|
-
if (currentInst) {
|
|
271
|
-
queue(queueName, () => this.open());
|
|
272
|
-
return;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
currentInst = this;
|
|
276
|
-
|
|
277
|
-
// 开始打开
|
|
278
|
-
this.state = 'opening';
|
|
279
|
-
this.options.onOpen!(this);
|
|
280
|
-
|
|
281
|
-
this.setPosition('open');
|
|
282
|
-
|
|
283
|
-
this.$element.transitionEnd(() => {
|
|
284
|
-
if (this.state !== 'opening') {
|
|
285
|
-
return;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
this.state = 'opened';
|
|
289
|
-
this.options.onOpened!(this);
|
|
290
|
-
|
|
291
|
-
// 有按钮时绑定事件
|
|
292
|
-
if (this.options.buttonText) {
|
|
293
|
-
this.$element.find('.mdui-snackbar-action').on('click', () => {
|
|
294
|
-
this.options.onButtonClick!(this);
|
|
295
|
-
if (this.options.closeOnButtonClick) {
|
|
296
|
-
this.close();
|
|
297
|
-
}
|
|
298
|
-
});
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
// 点击 snackbar 的事件
|
|
302
|
-
this.$element.on('click', (event) => {
|
|
303
|
-
if (!$(event.target as HTMLElement).hasClass('mdui-snackbar-action')) {
|
|
304
|
-
this.options.onClick!(this);
|
|
305
|
-
}
|
|
306
|
-
});
|
|
307
|
-
|
|
308
|
-
// 点击 Snackbar 外面的区域关闭
|
|
309
|
-
if (this.options.closeOnOutsideClick) {
|
|
310
|
-
$document.on(startEvent, this.closeOnOutsideClick);
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
// 超时后自动关闭
|
|
314
|
-
if (this.options.timeout) {
|
|
315
|
-
this.timeoutId = setTimeout(() => this.close(), this.options.timeout);
|
|
316
|
-
}
|
|
317
|
-
});
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
/**
|
|
321
|
-
* 关闭 Snackbar
|
|
322
|
-
*/
|
|
323
|
-
public close(): void {
|
|
324
|
-
if (this.state === 'closing' || this.state === 'closed') {
|
|
325
|
-
return;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
if (this.timeoutId) {
|
|
329
|
-
clearTimeout(this.timeoutId);
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
if (this.options.closeOnOutsideClick) {
|
|
333
|
-
$document.off(startEvent, this.closeOnOutsideClick);
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
this.state = 'closing';
|
|
337
|
-
this.options.onClose!(this);
|
|
338
|
-
|
|
339
|
-
this.setPosition('close');
|
|
340
|
-
|
|
341
|
-
this.$element.transitionEnd(() => {
|
|
342
|
-
if (this.state !== 'closing') {
|
|
343
|
-
return;
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
currentInst = null;
|
|
347
|
-
this.state = 'closed';
|
|
348
|
-
this.options.onClosed!(this);
|
|
349
|
-
this.$element.remove();
|
|
350
|
-
dequeue(queueName);
|
|
351
|
-
});
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
mdui.snackbar = function (message: any, options: any = {}): Snackbar {
|
|
356
|
-
if (isString(message)) {
|
|
357
|
-
options.message = message;
|
|
358
|
-
} else {
|
|
359
|
-
options = message;
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
const instance = new Snackbar(options);
|
|
363
|
-
|
|
364
|
-
instance.open();
|
|
365
|
-
|
|
366
|
-
return instance;
|
|
367
|
-
};
|