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,478 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 最终生成的元素结构为:
|
|
3
|
-
* <select class="mdui-select" mdui-select="{position: 'top'}" style="display: none;"> // $native
|
|
4
|
-
* <option value="1">State 1</option>
|
|
5
|
-
* <option value="2">State 2</option>
|
|
6
|
-
* <option value="3" disabled="">State 3</option>
|
|
7
|
-
* </select>
|
|
8
|
-
* <div class="mdui-select mdui-select-position-top" style="" id="88dec0e4-d4a2-c6d0-0e7f-1ba4501e0553"> // $element
|
|
9
|
-
* <span class="mdui-select-selected">State 1</span> // $selected
|
|
10
|
-
* <div class="mdui-select-menu" style="transform-origin: center 100% 0px;"> // $menu
|
|
11
|
-
* <div class="mdui-select-menu-item mdui-ripple" selected="">State 1</div> // $items
|
|
12
|
-
* <div class="mdui-select-menu-item mdui-ripple">State 2</div>
|
|
13
|
-
* <div class="mdui-select-menu-item mdui-ripple" disabled="">State 3</div>
|
|
14
|
-
* </div>
|
|
15
|
-
* </div>
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
import $ from 'mdui.jq/es/$';
|
|
19
|
-
import contains from 'mdui.jq/es/functions/contains';
|
|
20
|
-
import extend from 'mdui.jq/es/functions/extend';
|
|
21
|
-
import { JQ } from 'mdui.jq/es/JQ';
|
|
22
|
-
import 'mdui.jq/es/methods/add';
|
|
23
|
-
import 'mdui.jq/es/methods/addClass';
|
|
24
|
-
import 'mdui.jq/es/methods/after';
|
|
25
|
-
import 'mdui.jq/es/methods/append';
|
|
26
|
-
import 'mdui.jq/es/methods/appendTo';
|
|
27
|
-
import 'mdui.jq/es/methods/attr';
|
|
28
|
-
import 'mdui.jq/es/methods/css';
|
|
29
|
-
import 'mdui.jq/es/methods/each';
|
|
30
|
-
import 'mdui.jq/es/methods/find';
|
|
31
|
-
import 'mdui.jq/es/methods/first';
|
|
32
|
-
import 'mdui.jq/es/methods/height';
|
|
33
|
-
import 'mdui.jq/es/methods/hide';
|
|
34
|
-
import 'mdui.jq/es/methods/index';
|
|
35
|
-
import 'mdui.jq/es/methods/innerWidth';
|
|
36
|
-
import 'mdui.jq/es/methods/is';
|
|
37
|
-
import 'mdui.jq/es/methods/on';
|
|
38
|
-
import 'mdui.jq/es/methods/remove';
|
|
39
|
-
import 'mdui.jq/es/methods/removeAttr';
|
|
40
|
-
import 'mdui.jq/es/methods/removeClass';
|
|
41
|
-
import 'mdui.jq/es/methods/show';
|
|
42
|
-
import 'mdui.jq/es/methods/text';
|
|
43
|
-
import 'mdui.jq/es/methods/trigger';
|
|
44
|
-
import 'mdui.jq/es/methods/val';
|
|
45
|
-
import Selector from 'mdui.jq/es/types/Selector';
|
|
46
|
-
import mdui from '../../mdui';
|
|
47
|
-
import '../../jq_extends/methods/transitionEnd';
|
|
48
|
-
import '../../jq_extends/static/guid';
|
|
49
|
-
import { componentEvent } from '../../utils/componentEvent';
|
|
50
|
-
import { $document, $window } from '../../utils/dom';
|
|
51
|
-
|
|
52
|
-
declare module '../../interfaces/MduiStatic' {
|
|
53
|
-
interface MduiStatic {
|
|
54
|
-
/**
|
|
55
|
-
* 下拉选择组件
|
|
56
|
-
*
|
|
57
|
-
* 请通过 `new mdui.Select()` 调用
|
|
58
|
-
*/
|
|
59
|
-
Select: {
|
|
60
|
-
/**
|
|
61
|
-
* 实例化 Select 组件
|
|
62
|
-
* @param selector CSS 选择器、或 DOM 元素、或 JQ 对象
|
|
63
|
-
* @param options 配置参数
|
|
64
|
-
*/
|
|
65
|
-
new (
|
|
66
|
-
selector: Selector | HTMLElement | ArrayLike<HTMLElement>,
|
|
67
|
-
options?: OPTIONS,
|
|
68
|
-
): Select;
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
type OPTIONS = {
|
|
74
|
-
/**
|
|
75
|
-
* 下拉框位置:`auto`、`top`、`bottom`
|
|
76
|
-
*/
|
|
77
|
-
position?: 'auto' | 'top' | 'bottom';
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* 菜单与窗口上下边框至少保持多少间距
|
|
81
|
-
*/
|
|
82
|
-
gutter?: number;
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
type STATE = 'closing' | 'closed' | 'opening' | 'opened';
|
|
86
|
-
type EVENT = 'open' | 'opened' | 'close' | 'closed';
|
|
87
|
-
|
|
88
|
-
const DEFAULT_OPTIONS: OPTIONS = {
|
|
89
|
-
position: 'auto',
|
|
90
|
-
gutter: 16,
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
class Select {
|
|
94
|
-
/**
|
|
95
|
-
* 原生 `<select>` 元素的 JQ 对象
|
|
96
|
-
*/
|
|
97
|
-
public $native: JQ<HTMLSelectElement>;
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* 生成的 `<div class="mdui-select">` 元素的 JQ 对象
|
|
101
|
-
*/
|
|
102
|
-
public $element: JQ = $();
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* 配置参数
|
|
106
|
-
*/
|
|
107
|
-
public options: OPTIONS = extend({}, DEFAULT_OPTIONS);
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* select 的 size 属性的值,根据该值设置 select 的高度
|
|
111
|
-
*/
|
|
112
|
-
private size = 0;
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* 占位元素,显示已选中菜单项的文本
|
|
116
|
-
*/
|
|
117
|
-
private $selected: JQ = $();
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* 菜单项的外层元素的 JQ 对象
|
|
121
|
-
*/
|
|
122
|
-
private $menu: JQ = $();
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* 菜单项数组的 JQ 对象
|
|
126
|
-
*/
|
|
127
|
-
private $items: JQ = $();
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* 当前选中的菜单项的索引号
|
|
131
|
-
*/
|
|
132
|
-
private selectedIndex = 0;
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* 当前选中菜单项的文本
|
|
136
|
-
*/
|
|
137
|
-
private selectedText = '';
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* 当前选中菜单项的值
|
|
141
|
-
*/
|
|
142
|
-
private selectedValue = '';
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* 唯一 ID
|
|
146
|
-
*/
|
|
147
|
-
private uniqueID: string;
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* 当前 select 的状态
|
|
151
|
-
*/
|
|
152
|
-
private state: STATE = 'closed';
|
|
153
|
-
|
|
154
|
-
public constructor(
|
|
155
|
-
selector: Selector | HTMLElement | ArrayLike<HTMLElement>,
|
|
156
|
-
options: OPTIONS = {},
|
|
157
|
-
) {
|
|
158
|
-
this.$native = $(selector).first() as JQ<HTMLSelectElement>;
|
|
159
|
-
this.$native.hide();
|
|
160
|
-
|
|
161
|
-
extend(this.options, options);
|
|
162
|
-
|
|
163
|
-
// 为当前 select 生成唯一 ID
|
|
164
|
-
this.uniqueID = $.guid();
|
|
165
|
-
|
|
166
|
-
// 生成 select
|
|
167
|
-
this.handleUpdate();
|
|
168
|
-
|
|
169
|
-
// 点击 select 外面区域关闭
|
|
170
|
-
$document.on('click touchstart', (event: Event) => {
|
|
171
|
-
const $target = $(event.target as HTMLElement);
|
|
172
|
-
|
|
173
|
-
if (
|
|
174
|
-
this.isOpen() &&
|
|
175
|
-
!$target.is(this.$element) &&
|
|
176
|
-
!contains(this.$element[0], $target[0])
|
|
177
|
-
) {
|
|
178
|
-
this.close();
|
|
179
|
-
}
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
/**
|
|
184
|
-
* 调整菜单位置
|
|
185
|
-
*/
|
|
186
|
-
private readjustMenu(): void {
|
|
187
|
-
const windowHeight = $window.height();
|
|
188
|
-
|
|
189
|
-
// mdui-select 高度
|
|
190
|
-
const elementHeight = this.$element.height();
|
|
191
|
-
|
|
192
|
-
// 菜单项高度
|
|
193
|
-
const $itemFirst = this.$items.first();
|
|
194
|
-
const itemHeight = $itemFirst.height();
|
|
195
|
-
const itemMargin = parseInt($itemFirst.css('margin-top'));
|
|
196
|
-
|
|
197
|
-
// 菜单高度
|
|
198
|
-
const menuWidth = this.$element.innerWidth() + 0.01; // 必须比真实宽度多一点,不然会出现省略号
|
|
199
|
-
let menuHeight = itemHeight * this.size + itemMargin * 2;
|
|
200
|
-
|
|
201
|
-
// mdui-select 在窗口中的位置
|
|
202
|
-
const elementTop = this.$element[0].getBoundingClientRect().top;
|
|
203
|
-
|
|
204
|
-
let transformOriginY: string;
|
|
205
|
-
let menuMarginTop: number;
|
|
206
|
-
|
|
207
|
-
if (this.options.position === 'bottom') {
|
|
208
|
-
menuMarginTop = elementHeight;
|
|
209
|
-
transformOriginY = '0px';
|
|
210
|
-
} else if (this.options.position === 'top') {
|
|
211
|
-
menuMarginTop = -menuHeight - 1;
|
|
212
|
-
transformOriginY = '100%';
|
|
213
|
-
} else {
|
|
214
|
-
// 菜单高度不能超过窗口高度
|
|
215
|
-
const menuMaxHeight = windowHeight - this.options.gutter! * 2;
|
|
216
|
-
if (menuHeight > menuMaxHeight) {
|
|
217
|
-
menuHeight = menuMaxHeight;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
// 菜单的 margin-top
|
|
221
|
-
menuMarginTop = -(
|
|
222
|
-
itemMargin +
|
|
223
|
-
this.selectedIndex * itemHeight +
|
|
224
|
-
(itemHeight - elementHeight) / 2
|
|
225
|
-
);
|
|
226
|
-
|
|
227
|
-
const menuMaxMarginTop = -(
|
|
228
|
-
itemMargin +
|
|
229
|
-
(this.size - 1) * itemHeight +
|
|
230
|
-
(itemHeight - elementHeight) / 2
|
|
231
|
-
);
|
|
232
|
-
if (menuMarginTop < menuMaxMarginTop) {
|
|
233
|
-
menuMarginTop = menuMaxMarginTop;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
// 菜单不能超出窗口
|
|
237
|
-
const menuTop = elementTop + menuMarginTop;
|
|
238
|
-
if (menuTop < this.options.gutter!) {
|
|
239
|
-
// 不能超出窗口上方
|
|
240
|
-
menuMarginTop = -(elementTop - this.options.gutter!);
|
|
241
|
-
} else if (menuTop + menuHeight + this.options.gutter! > windowHeight) {
|
|
242
|
-
// 不能超出窗口下方
|
|
243
|
-
menuMarginTop = -(
|
|
244
|
-
elementTop +
|
|
245
|
-
menuHeight +
|
|
246
|
-
this.options.gutter! -
|
|
247
|
-
windowHeight
|
|
248
|
-
);
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
// transform 的 Y 轴坐标
|
|
252
|
-
transformOriginY = `${
|
|
253
|
-
this.selectedIndex * itemHeight + itemHeight / 2 + itemMargin
|
|
254
|
-
}px`;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
// 设置样式
|
|
258
|
-
this.$element.innerWidth(menuWidth);
|
|
259
|
-
this.$menu
|
|
260
|
-
.innerWidth(menuWidth)
|
|
261
|
-
.height(menuHeight)
|
|
262
|
-
.css({
|
|
263
|
-
'margin-top': menuMarginTop + 'px',
|
|
264
|
-
'transform-origin': 'center ' + transformOriginY + ' 0',
|
|
265
|
-
});
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
/**
|
|
269
|
-
* select 是否为打开状态
|
|
270
|
-
*/
|
|
271
|
-
private isOpen(): boolean {
|
|
272
|
-
return this.state === 'opening' || this.state === 'opened';
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
/**
|
|
276
|
-
* 对原生 select 组件进行了修改后,需要调用该方法
|
|
277
|
-
*/
|
|
278
|
-
public handleUpdate(): void {
|
|
279
|
-
if (this.isOpen()) {
|
|
280
|
-
this.close();
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
this.selectedValue = this.$native.val() as string;
|
|
284
|
-
|
|
285
|
-
// 保存菜单项数据的数组
|
|
286
|
-
type typeItemsData = {
|
|
287
|
-
value: string;
|
|
288
|
-
text: string;
|
|
289
|
-
disabled: boolean;
|
|
290
|
-
selected: boolean;
|
|
291
|
-
index: number;
|
|
292
|
-
};
|
|
293
|
-
const itemsData: typeItemsData[] = [];
|
|
294
|
-
this.$items = $();
|
|
295
|
-
|
|
296
|
-
// 生成 HTML
|
|
297
|
-
this.$native.find('option').each((index, option) => {
|
|
298
|
-
const text = option.textContent || '';
|
|
299
|
-
const value = option.value;
|
|
300
|
-
const disabled = option.disabled;
|
|
301
|
-
const selected = this.selectedValue === value;
|
|
302
|
-
|
|
303
|
-
itemsData.push({
|
|
304
|
-
value,
|
|
305
|
-
text,
|
|
306
|
-
disabled,
|
|
307
|
-
selected,
|
|
308
|
-
index,
|
|
309
|
-
});
|
|
310
|
-
|
|
311
|
-
if (selected) {
|
|
312
|
-
this.selectedText = text;
|
|
313
|
-
this.selectedIndex = index;
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
this.$items = this.$items.add(
|
|
317
|
-
'<div class="mdui-select-menu-item mdui-ripple"' +
|
|
318
|
-
(disabled ? ' disabled' : '') +
|
|
319
|
-
(selected ? ' selected' : '') +
|
|
320
|
-
`>${text}</div>`,
|
|
321
|
-
);
|
|
322
|
-
});
|
|
323
|
-
|
|
324
|
-
this.$selected = $(
|
|
325
|
-
`<span class="mdui-select-selected">${this.selectedText}</span>`,
|
|
326
|
-
);
|
|
327
|
-
|
|
328
|
-
this.$element = $(
|
|
329
|
-
`<div class="mdui-select mdui-select-position-${this.options.position}" ` +
|
|
330
|
-
`style="${this.$native.attr('style')}" ` +
|
|
331
|
-
`id="${this.uniqueID}"></div>`,
|
|
332
|
-
)
|
|
333
|
-
.show()
|
|
334
|
-
.append(this.$selected);
|
|
335
|
-
|
|
336
|
-
this.$menu = $('<div class="mdui-select-menu"></div>')
|
|
337
|
-
.appendTo(this.$element)
|
|
338
|
-
.append(this.$items);
|
|
339
|
-
|
|
340
|
-
$(`#${this.uniqueID}`).remove();
|
|
341
|
-
this.$native.after(this.$element);
|
|
342
|
-
|
|
343
|
-
// 根据 select 的 size 属性设置高度
|
|
344
|
-
this.size = parseInt(this.$native.attr('size') || '0');
|
|
345
|
-
|
|
346
|
-
if (this.size <= 0) {
|
|
347
|
-
this.size = this.$items.length;
|
|
348
|
-
|
|
349
|
-
if (this.size > 8) {
|
|
350
|
-
this.size = 8;
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
// 点击选项时关闭下拉菜单
|
|
355
|
-
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
356
|
-
const that = this;
|
|
357
|
-
this.$items.on('click', function () {
|
|
358
|
-
if (that.state === 'closing') {
|
|
359
|
-
return;
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
const $item = $(this);
|
|
363
|
-
const index = $item.index();
|
|
364
|
-
const data = itemsData[index];
|
|
365
|
-
|
|
366
|
-
if (data.disabled) {
|
|
367
|
-
return;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
that.$selected.text(data.text);
|
|
371
|
-
that.$native.val(data.value);
|
|
372
|
-
that.$items.removeAttr('selected');
|
|
373
|
-
$item.attr('selected', '');
|
|
374
|
-
that.selectedIndex = data.index;
|
|
375
|
-
that.selectedValue = data.value;
|
|
376
|
-
that.selectedText = data.text;
|
|
377
|
-
that.$native.trigger('change');
|
|
378
|
-
that.close();
|
|
379
|
-
});
|
|
380
|
-
|
|
381
|
-
// 点击 $element 时打开下拉菜单
|
|
382
|
-
this.$element.on('click', (event: Event) => {
|
|
383
|
-
const $target = $(event.target as HTMLElement);
|
|
384
|
-
|
|
385
|
-
// 在菜单上点击时不打开
|
|
386
|
-
if (
|
|
387
|
-
$target.is('.mdui-select-menu') ||
|
|
388
|
-
$target.is('.mdui-select-menu-item')
|
|
389
|
-
) {
|
|
390
|
-
return;
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
this.toggle();
|
|
394
|
-
});
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
/**
|
|
398
|
-
* 动画结束的回调
|
|
399
|
-
*/
|
|
400
|
-
private transitionEnd(): void {
|
|
401
|
-
this.$element.removeClass('mdui-select-closing');
|
|
402
|
-
|
|
403
|
-
if (this.state === 'opening') {
|
|
404
|
-
this.state = 'opened';
|
|
405
|
-
this.triggerEvent('opened');
|
|
406
|
-
this.$menu.css('overflow-y', 'auto');
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
if (this.state === 'closing') {
|
|
410
|
-
this.state = 'closed';
|
|
411
|
-
this.triggerEvent('closed');
|
|
412
|
-
|
|
413
|
-
// 恢复样式
|
|
414
|
-
this.$element.innerWidth('');
|
|
415
|
-
this.$menu.css({
|
|
416
|
-
'margin-top': '',
|
|
417
|
-
height: '',
|
|
418
|
-
width: '',
|
|
419
|
-
});
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
/**
|
|
424
|
-
* 触发组件事件
|
|
425
|
-
* @param name
|
|
426
|
-
*/
|
|
427
|
-
private triggerEvent(name: EVENT): void {
|
|
428
|
-
componentEvent(name, 'select', this.$native, this);
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
/**
|
|
432
|
-
* 切换下拉菜单的打开状态
|
|
433
|
-
*/
|
|
434
|
-
public toggle(): void {
|
|
435
|
-
this.isOpen() ? this.close() : this.open();
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
/**
|
|
439
|
-
* 打开下拉菜单
|
|
440
|
-
*/
|
|
441
|
-
public open(): void {
|
|
442
|
-
if (this.isOpen()) {
|
|
443
|
-
return;
|
|
444
|
-
}
|
|
445
|
-
|
|
446
|
-
this.state = 'opening';
|
|
447
|
-
this.triggerEvent('open');
|
|
448
|
-
this.readjustMenu();
|
|
449
|
-
this.$element.addClass('mdui-select-open');
|
|
450
|
-
this.$menu.transitionEnd(() => this.transitionEnd());
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
/**
|
|
454
|
-
* 关闭下拉菜单
|
|
455
|
-
*/
|
|
456
|
-
public close(): void {
|
|
457
|
-
if (!this.isOpen()) {
|
|
458
|
-
return;
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
this.state = 'closing';
|
|
462
|
-
this.triggerEvent('close');
|
|
463
|
-
this.$menu.css('overflow-y', '');
|
|
464
|
-
this.$element
|
|
465
|
-
.removeClass('mdui-select-open')
|
|
466
|
-
.addClass('mdui-select-closing');
|
|
467
|
-
this.$menu.transitionEnd(() => this.transitionEnd());
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
/**
|
|
471
|
-
* 获取当前菜单的状态。共包含四种状态:`opening`、`opened`、`closing`、`closed`
|
|
472
|
-
*/
|
|
473
|
-
public getState(): STATE {
|
|
474
|
-
return this.state;
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
mdui.Select = Select;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 10 10"><path d="m-0.00254,2.5l5,5l5,-5l-10,0z" fill="#000000" opacity="0.54"/></svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 10 10"><path d="m-0.00254,2.5l5,5l5,-5l-10,0z" fill="#FFFFFF"/></svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 10 10"><path d="m-0.00254,2.5l5,5l5,-5l-10,0z" fill="#000000" opacity="0.54" transform="rotate(-180 5,5)"/></svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 10 10"><path d="m-0.00254,2.5l5,5l5,-5l-10,0z" fill="#FFFFFF" transform="rotate(-180 5,5)"/></svg>
|
|
@@ -1,226 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* =============================================================================
|
|
3
|
-
* ************ Checkbox 复选框 ************
|
|
4
|
-
* =============================================================================
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
.mdui-checkbox {
|
|
8
|
-
position: relative;
|
|
9
|
-
display: inline-block;
|
|
10
|
-
height: 36px;
|
|
11
|
-
padding-left: 36px;
|
|
12
|
-
line-height: 36px;
|
|
13
|
-
cursor: pointer;
|
|
14
|
-
user-select: none;
|
|
15
|
-
|
|
16
|
-
// 隐藏系统 input 标签,用自定义的图标代替
|
|
17
|
-
input[type="checkbox"] {
|
|
18
|
-
position: absolute;
|
|
19
|
-
width: 0;
|
|
20
|
-
height: 0;
|
|
21
|
-
overflow: hidden;
|
|
22
|
-
opacity: 0;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/* 透明的圆形,用于生成圆形阴影 */
|
|
27
|
-
.mdui-checkbox-icon {
|
|
28
|
-
position: absolute;
|
|
29
|
-
top: 9px;
|
|
30
|
-
left: 0;
|
|
31
|
-
display: inline-block;
|
|
32
|
-
width: 18px;
|
|
33
|
-
height: 18px;
|
|
34
|
-
vertical-align: middle;
|
|
35
|
-
background-color: transparent;
|
|
36
|
-
border: none;
|
|
37
|
-
border-radius: 18px;
|
|
38
|
-
transition: box-shadow .14s @animation-curve-default;
|
|
39
|
-
|
|
40
|
-
// 图标的边框和背景
|
|
41
|
-
&::after {
|
|
42
|
-
position: absolute;
|
|
43
|
-
top: 0;
|
|
44
|
-
left: 0;
|
|
45
|
-
z-index: 0;
|
|
46
|
-
box-sizing: border-box;
|
|
47
|
-
width: 18px;
|
|
48
|
-
height: 18px;
|
|
49
|
-
border: 2px solid @color-black-icon;
|
|
50
|
-
border-radius: 2px;
|
|
51
|
-
transition: all .3s @animation-curve-default;
|
|
52
|
-
content: ' ';
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// 选中状态图标内部的勾
|
|
56
|
-
&::before {
|
|
57
|
-
position: absolute;
|
|
58
|
-
top: 2px;
|
|
59
|
-
left: 0;
|
|
60
|
-
z-index: 1;
|
|
61
|
-
box-sizing: border-box;
|
|
62
|
-
width: 8px;
|
|
63
|
-
height: 13px;
|
|
64
|
-
border-right: 2px solid #fff;
|
|
65
|
-
border-bottom: 2px solid #fff;
|
|
66
|
-
transform: rotateZ(37deg) scale(0);
|
|
67
|
-
transform-origin: 100% 100%;
|
|
68
|
-
opacity: 0;
|
|
69
|
-
transition: all .3s @animation-curve-default;
|
|
70
|
-
content: ' ';
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/* 各种状态的图标 */
|
|
75
|
-
.mdui-checkbox input[type="checkbox"] {
|
|
76
|
-
|
|
77
|
-
// 选中状态的图标
|
|
78
|
-
&:checked + .mdui-checkbox-icon {
|
|
79
|
-
&::after {
|
|
80
|
-
background-color: @color-default-a200;
|
|
81
|
-
border-color: @color-default-a200;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
&::before {
|
|
85
|
-
transform: rotateZ(37deg) scale(1);
|
|
86
|
-
opacity: 1;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// 不确定状态的图标
|
|
91
|
-
&:indeterminate + .mdui-checkbox-icon {
|
|
92
|
-
&::after {
|
|
93
|
-
background-color: @color-default-a200;
|
|
94
|
-
border-color: @color-default-a200;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
&::before {
|
|
98
|
-
top: 8px;
|
|
99
|
-
left: 3px;
|
|
100
|
-
width: 12px;
|
|
101
|
-
height: 0;
|
|
102
|
-
border-right: none;
|
|
103
|
-
border-bottom: 2px solid #fff;
|
|
104
|
-
border-radius: 1px;
|
|
105
|
-
transform: rotateZ(0) scale(1);
|
|
106
|
-
opacity: 1;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
// 禁用状态的图标
|
|
111
|
-
&:disabled + .mdui-checkbox-icon {
|
|
112
|
-
&::after {
|
|
113
|
-
border-color: @color-black-icon-disabled;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
// 禁用且选中状态
|
|
118
|
-
&:disabled:checked + .mdui-checkbox-icon,
|
|
119
|
-
&:disabled:indeterminate + .mdui-checkbox-icon {
|
|
120
|
-
&::after {
|
|
121
|
-
background-color: @color-black-icon-disabled !important;
|
|
122
|
-
border-color: transparent !important;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
/* 阴影 */
|
|
128
|
-
.mdui-checkbox:active input[type="checkbox"],
|
|
129
|
-
.mdui-checkbox input[type="checkbox"]:focus {
|
|
130
|
-
// 未选中、禁用时 按下的阴影
|
|
131
|
-
& + .mdui-checkbox-icon {
|
|
132
|
-
box-shadow: 0 0 0 15px rgba(0, 0, 0, 0.1);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
// 已选中时按下的阴影
|
|
136
|
-
&:not(:disabled):checked,
|
|
137
|
-
&:not(:disabled):indeterminate {
|
|
138
|
-
& + .mdui-checkbox-icon {
|
|
139
|
-
box-shadow: 0 0 0 15px rgba(red(@color-default-a200), green(@color-default-a200), blue(@color-default-a200), 0.16);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* =============================================================================
|
|
147
|
-
* ************ Checkbox 强调色 ************
|
|
148
|
-
* =============================================================================
|
|
149
|
-
*/
|
|
150
|
-
|
|
151
|
-
& {
|
|
152
|
-
.loop-accent-theme(@counter-color) when (@counter-color > 0) {
|
|
153
|
-
.loop-accent-theme((@counter-color - 1));
|
|
154
|
-
@colorName: extract(@globalAccentColors, @counter-color);
|
|
155
|
-
|
|
156
|
-
@color: 'color-@{colorName}-a200';
|
|
157
|
-
|
|
158
|
-
.mdui-theme-accent-@{colorName} when not (@colorName = null) {
|
|
159
|
-
|
|
160
|
-
// 选中状态的图标
|
|
161
|
-
.mdui-checkbox input[type="checkbox"]:checked,
|
|
162
|
-
.mdui-checkbox input[type="checkbox"]:indeterminate {
|
|
163
|
-
& + .mdui-checkbox-icon::after {
|
|
164
|
-
background-color: @@color;
|
|
165
|
-
border-color: @@color;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
// 已选中时按下的阴影
|
|
170
|
-
.mdui-checkbox:active input[type="checkbox"],
|
|
171
|
-
.mdui-checkbox input[type="checkbox"]:focus {
|
|
172
|
-
&:not(:disabled):checked + .mdui-checkbox-icon,
|
|
173
|
-
&:not(:disabled):indeterminate + .mdui-checkbox-icon {
|
|
174
|
-
box-shadow: 0 0 0 15px rgba(red(@@color), green(@@color), blue(@@color), 0.16);
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
.loop-accent-theme(length(@globalAccentColors));
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
/**
|
|
184
|
-
* =============================================================================
|
|
185
|
-
* ************ Checkbox dark ************
|
|
186
|
-
* =============================================================================
|
|
187
|
-
*/
|
|
188
|
-
.layout-theme({
|
|
189
|
-
// 未选中的图标
|
|
190
|
-
.mdui-checkbox-icon {
|
|
191
|
-
&::after {
|
|
192
|
-
border-color: rgba(255, 255, 255, 0.7);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
&::before {
|
|
196
|
-
border-right-color: @layout-dark-color-3 !important;
|
|
197
|
-
border-bottom-color: @layout-dark-color-3 !important;
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
// 禁用状态
|
|
202
|
-
.mdui-checkbox input[type="checkbox"]:disabled + .mdui-checkbox-icon {
|
|
203
|
-
&::after {
|
|
204
|
-
border-color: @color-white-icon-disabled;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
// 禁用且选中状态
|
|
209
|
-
.mdui-checkbox input[type="checkbox"] {
|
|
210
|
-
&:disabled:checked + .mdui-checkbox-icon,
|
|
211
|
-
&:disabled:indeterminate + .mdui-checkbox-icon {
|
|
212
|
-
&::after {
|
|
213
|
-
background-color: @color-white-icon-disabled !important;
|
|
214
|
-
border-color: transparent !important;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
// 未选中或禁用时 按下的阴影
|
|
220
|
-
.mdui-checkbox:active input[type="checkbox"],
|
|
221
|
-
.mdui-checkbox input[type="checkbox"]:focus {
|
|
222
|
-
& + .mdui-checkbox-icon {
|
|
223
|
-
box-shadow: 0 0 0 15px rgba(255, 255, 255, 0.1);
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
});
|