mdui 1.0.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +49 -70
- package/components/avatar/index.d.ts +49 -0
- package/components/avatar/index.js +55 -0
- package/components/avatar/style.d.ts +1 -0
- package/components/avatar/style.js +2 -0
- package/components/avatar.d.ts +1 -0
- package/components/avatar.js +1 -0
- package/components/badge/index.d.ts +28 -0
- package/components/badge/index.js +41 -0
- package/components/badge/style.d.ts +1 -0
- package/components/badge/style.js +2 -0
- package/components/badge.d.ts +1 -0
- package/components/badge.js +1 -0
- package/components/bottom-app-bar/index.d.ts +60 -0
- package/components/bottom-app-bar/index.js +105 -0
- package/components/bottom-app-bar/style.d.ts +1 -0
- package/components/bottom-app-bar/style.js +2 -0
- package/components/bottom-app-bar.d.ts +1 -0
- package/components/bottom-app-bar.js +1 -0
- package/components/button/button-base-style.d.ts +1 -0
- package/components/button/button-base-style.js +2 -0
- package/components/button/button-base.d.ts +138 -0
- package/components/button/button-base.js +206 -0
- package/components/button/index.d.ts +64 -0
- package/components/button/index.js +110 -0
- package/components/button/style.d.ts +1 -0
- package/components/button/style.js +4 -0
- package/components/button-icon/index.d.ts +66 -0
- package/components/button-icon/index.js +129 -0
- package/components/button-icon/style.d.ts +1 -0
- package/components/button-icon/style.js +4 -0
- package/components/button-icon.d.ts +1 -0
- package/components/button-icon.js +1 -0
- package/components/button.d.ts +1 -0
- package/components/button.js +1 -0
- package/components/card/index.d.ts +49 -0
- package/components/card/index.js +87 -0
- package/components/card/style.d.ts +1 -0
- package/components/card/style.js +2 -0
- package/components/card.d.ts +1 -0
- package/components/card.js +1 -0
- package/components/checkbox/index.d.ts +130 -0
- package/components/checkbox/index.js +257 -0
- package/components/checkbox/style.d.ts +1 -0
- package/components/checkbox/style.js +2 -0
- package/components/checkbox.d.ts +1 -0
- package/components/checkbox.js +1 -0
- package/components/chip/index.d.ts +102 -0
- package/components/chip/index.js +243 -0
- package/components/chip/style.d.ts +1 -0
- package/components/chip/style.js +4 -0
- package/components/chip.d.ts +1 -0
- package/components/chip.js +1 -0
- package/components/circular-progress/index.d.ts +28 -0
- package/components/circular-progress/index.js +61 -0
- package/components/circular-progress/style.d.ts +1 -0
- package/components/circular-progress/style.js +2 -0
- package/components/circular-progress.d.ts +1 -0
- package/components/circular-progress.js +1 -0
- package/components/collapse/collapse-item-style.d.ts +1 -0
- package/components/collapse/collapse-item-style.js +2 -0
- package/components/collapse/collapse-item.d.ts +56 -0
- package/components/collapse/collapse-item.js +126 -0
- package/components/collapse/collapse-style.d.ts +1 -0
- package/components/collapse/collapse-style.js +2 -0
- package/components/collapse/collapse.d.ts +49 -0
- package/components/collapse/collapse.js +175 -0
- package/components/collapse-item.d.ts +1 -0
- package/components/collapse-item.js +1 -0
- package/components/collapse.d.ts +1 -0
- package/components/collapse.js +1 -0
- package/components/dialog/index.d.ts +99 -0
- package/components/dialog/index.js +307 -0
- package/components/dialog/style.d.ts +1 -0
- package/components/dialog/style.js +2 -0
- package/components/dialog.d.ts +1 -0
- package/components/dialog.js +1 -0
- package/components/divider/index.d.ts +30 -0
- package/components/divider/index.js +58 -0
- package/components/divider/style.d.ts +1 -0
- package/components/divider/style.js +2 -0
- package/components/divider.d.ts +1 -0
- package/components/divider.js +1 -0
- package/components/dropdown/index.d.ts +131 -0
- package/components/dropdown/index.js +571 -0
- package/components/dropdown/style.d.ts +1 -0
- package/components/dropdown/style.js +2 -0
- package/components/dropdown.d.ts +1 -0
- package/components/dropdown.js +1 -0
- package/components/fab/index.d.ts +70 -0
- package/components/fab/index.js +144 -0
- package/components/fab/style.d.ts +1 -0
- package/components/fab/style.js +8 -0
- package/components/fab.d.ts +1 -0
- package/components/fab.js +1 -0
- package/components/icon/index.d.ts +29 -0
- package/components/icon/index.js +57 -0
- package/components/icon/style.d.ts +1 -0
- package/components/icon/style.js +2 -0
- package/components/icon.d.ts +1 -0
- package/components/icon.js +1 -0
- package/components/layout/helper.d.ts +67 -0
- package/components/layout/helper.js +212 -0
- package/components/layout/layout-item-base.d.ts +17 -0
- package/components/layout/layout-item-base.js +45 -0
- package/components/layout/layout-item-style.d.ts +1 -0
- package/components/layout/layout-item-style.js +2 -0
- package/components/layout/layout-item.d.ts +37 -0
- package/components/layout/layout-item.js +58 -0
- package/components/layout/layout-main-style.d.ts +1 -0
- package/components/layout/layout-main-style.js +2 -0
- package/components/layout/layout-main.d.ts +27 -0
- package/components/layout/layout-main.js +46 -0
- package/components/layout/layout-style.d.ts +1 -0
- package/components/layout/layout-style.js +2 -0
- package/components/layout/layout.d.ts +28 -0
- package/components/layout/layout.js +43 -0
- package/components/layout-item.d.ts +1 -0
- package/components/layout-item.js +1 -0
- package/components/layout-main.d.ts +1 -0
- package/components/layout-main.js +1 -0
- package/components/layout.d.ts +1 -0
- package/components/layout.js +1 -0
- package/components/linear-progress/index.d.ts +30 -0
- package/components/linear-progress/index.js +48 -0
- package/components/linear-progress/style.d.ts +1 -0
- package/components/linear-progress/style.js +2 -0
- package/components/linear-progress.d.ts +1 -0
- package/components/linear-progress.js +1 -0
- package/components/list/list-item-style.d.ts +1 -0
- package/components/list/list-item-style.js +4 -0
- package/components/list/list-item.d.ts +111 -0
- package/components/list/list-item.js +186 -0
- package/components/list/list-style.d.ts +1 -0
- package/components/list/list-style.js +2 -0
- package/components/list/list-subheader-style.d.ts +1 -0
- package/components/list/list-subheader-style.js +2 -0
- package/components/list/list-subheader.d.ts +24 -0
- package/components/list/list-subheader.js +30 -0
- package/components/list/list.d.ts +24 -0
- package/components/list/list.js +27 -0
- package/components/list-item.d.ts +1 -0
- package/components/list-item.js +1 -0
- package/components/list-subheader.d.ts +1 -0
- package/components/list-subheader.js +1 -0
- package/components/list.d.ts +1 -0
- package/components/list.js +1 -0
- package/components/menu/menu-item-style.d.ts +1 -0
- package/components/menu/menu-item-style.js +2 -0
- package/components/menu/menu-item.d.ts +123 -0
- package/components/menu/menu-item.js +412 -0
- package/components/menu/menu-style.d.ts +1 -0
- package/components/menu/menu-style.js +2 -0
- package/components/menu/menu.d.ts +111 -0
- package/components/menu/menu.js +425 -0
- package/components/menu-item.d.ts +1 -0
- package/components/menu-item.js +1 -0
- package/components/menu.d.ts +1 -0
- package/components/menu.js +1 -0
- package/components/navigation-bar/navigation-bar-item-style.d.ts +1 -0
- package/components/navigation-bar/navigation-bar-item-style.js +2 -0
- package/components/navigation-bar/navigation-bar-item.d.ts +72 -0
- package/components/navigation-bar/navigation-bar-item.js +120 -0
- package/components/navigation-bar/navigation-bar-style.d.ts +1 -0
- package/components/navigation-bar/navigation-bar-style.js +2 -0
- package/components/navigation-bar/navigation-bar.d.ts +78 -0
- package/components/navigation-bar/navigation-bar.js +180 -0
- package/components/navigation-bar-item.d.ts +1 -0
- package/components/navigation-bar-item.js +1 -0
- package/components/navigation-bar.d.ts +1 -0
- package/components/navigation-bar.js +1 -0
- package/components/navigation-drawer/index.d.ts +84 -0
- package/components/navigation-drawer/index.js +365 -0
- package/components/navigation-drawer/style.d.ts +1 -0
- package/components/navigation-drawer/style.js +2 -0
- package/components/navigation-drawer.d.ts +1 -0
- package/components/navigation-drawer.js +1 -0
- package/components/navigation-rail/navigation-rail-item-style.d.ts +1 -0
- package/components/navigation-rail/navigation-rail-item-style.js +2 -0
- package/components/navigation-rail/navigation-rail-item.d.ts +72 -0
- package/components/navigation-rail/navigation-rail-item.js +128 -0
- package/components/navigation-rail/navigation-rail-style.d.ts +1 -0
- package/components/navigation-rail/navigation-rail-style.js +2 -0
- package/components/navigation-rail/navigation-rail.d.ts +87 -0
- package/components/navigation-rail/navigation-rail.js +230 -0
- package/components/navigation-rail-item.d.ts +1 -0
- package/components/navigation-rail-item.js +1 -0
- package/components/navigation-rail.d.ts +1 -0
- package/components/navigation-rail.js +1 -0
- package/components/radio/radio-group-style.d.ts +1 -0
- package/components/radio/radio-group-style.js +2 -0
- package/components/radio/radio-group.d.ts +103 -0
- package/components/radio/radio-group.js +268 -0
- package/components/radio/radio-style.d.ts +1 -0
- package/components/radio/radio-style.js +2 -0
- package/components/radio/radio.d.ts +71 -0
- package/components/radio/radio.js +144 -0
- package/components/radio-group.d.ts +1 -0
- package/components/radio-group.js +1 -0
- package/components/radio.d.ts +1 -0
- package/components/radio.js +1 -0
- package/components/range-slider/index.d.ts +67 -0
- package/components/range-slider/index.js +210 -0
- package/components/range-slider.d.ts +1 -0
- package/components/range-slider.js +1 -0
- package/components/ripple/index.d.ts +44 -0
- package/components/ripple/index.js +173 -0
- package/components/ripple/ripple-mixin.d.ts +28 -0
- package/components/ripple/ripple-mixin.js +258 -0
- package/components/ripple/style.d.ts +1 -0
- package/components/ripple/style.js +2 -0
- package/components/ripple.d.ts +1 -0
- package/components/ripple.js +1 -0
- package/components/segmented-button/segmented-button-group-style.d.ts +1 -0
- package/components/segmented-button/segmented-button-group-style.js +2 -0
- package/components/segmented-button/segmented-button-group.d.ts +125 -0
- package/components/segmented-button/segmented-button-group.js +383 -0
- package/components/segmented-button/segmented-button-style.d.ts +1 -0
- package/components/segmented-button/segmented-button-style.js +4 -0
- package/components/segmented-button/segmented-button.d.ts +73 -0
- package/components/segmented-button/segmented-button.js +160 -0
- package/components/segmented-button-group.d.ts +1 -0
- package/components/segmented-button-group.js +1 -0
- package/components/segmented-button.d.ts +1 -0
- package/components/segmented-button.js +1 -0
- package/components/select/index.d.ts +200 -0
- package/components/select/index.js +390 -0
- package/components/select/style.d.ts +1 -0
- package/components/select/style.js +2 -0
- package/components/select.d.ts +1 -0
- package/components/select.js +1 -0
- package/components/slider/index.d.ts +53 -0
- package/components/slider/index.js +128 -0
- package/components/slider/slider-base-style.d.ts +1 -0
- package/components/slider/slider-base-style.js +2 -0
- package/components/slider/slider-base.d.ts +92 -0
- package/components/slider/slider-base.js +199 -0
- package/components/slider/style.d.ts +1 -0
- package/components/slider/style.js +2 -0
- package/components/slider.d.ts +1 -0
- package/components/slider.js +1 -0
- package/components/snackbar/index.d.ts +98 -0
- package/components/snackbar/index.js +285 -0
- package/components/snackbar/style.d.ts +1 -0
- package/components/snackbar/style.js +2 -0
- package/components/snackbar.d.ts +1 -0
- package/components/snackbar.js +1 -0
- package/components/switch/index.d.ts +123 -0
- package/components/switch/index.js +245 -0
- package/components/switch/style.d.ts +1 -0
- package/components/switch/style.js +2 -0
- package/components/switch.d.ts +1 -0
- package/components/switch.js +1 -0
- package/components/tab-panel.d.ts +1 -0
- package/components/tab-panel.js +1 -0
- package/components/tab.d.ts +1 -0
- package/components/tab.js +1 -0
- package/components/tabs/tab-panel-style.d.ts +1 -0
- package/components/tabs/tab-panel-style.js +2 -0
- package/components/tabs/tab-panel.d.ts +36 -0
- package/components/tabs/tab-panel.js +52 -0
- package/components/tabs/tab-style.d.ts +1 -0
- package/components/tabs/tab-style.js +2 -0
- package/components/tabs/tab.d.ts +69 -0
- package/components/tabs/tab.js +110 -0
- package/components/tabs/tabs-style.d.ts +1 -0
- package/components/tabs/tabs-style.js +2 -0
- package/components/tabs/tabs.d.ts +87 -0
- package/components/tabs/tabs.js +221 -0
- package/components/tabs.d.ts +1 -0
- package/components/tabs.js +1 -0
- package/components/text-field/index.d.ts +400 -0
- package/components/text-field/index.js +752 -0
- package/components/text-field/style.d.ts +1 -0
- package/components/text-field/style.js +2 -0
- package/components/text-field.d.ts +1 -0
- package/components/text-field.js +1 -0
- package/components/tooltip/index.d.ts +140 -0
- package/components/tooltip/index.js +497 -0
- package/components/tooltip/style.d.ts +1 -0
- package/components/tooltip/style.js +2 -0
- package/components/tooltip.d.ts +1 -0
- package/components/tooltip.js +1 -0
- package/components/top-app-bar/top-app-bar-style.d.ts +1 -0
- package/components/top-app-bar/top-app-bar-style.js +2 -0
- package/components/top-app-bar/top-app-bar-title-style.d.ts +1 -0
- package/components/top-app-bar/top-app-bar-title-style.js +2 -0
- package/components/top-app-bar/top-app-bar-title.d.ts +46 -0
- package/components/top-app-bar/top-app-bar-title.js +76 -0
- package/components/top-app-bar/top-app-bar.d.ts +74 -0
- package/components/top-app-bar/top-app-bar.js +178 -0
- package/components/top-app-bar-title.d.ts +1 -0
- package/components/top-app-bar-title.js +1 -0
- package/components/top-app-bar.d.ts +1 -0
- package/components/top-app-bar.js +1 -0
- package/css-data.zh-cn.json +2819 -0
- package/custom-elements.json +28087 -0
- package/functions/alert.d.ts +80 -0
- package/functions/alert.js +59 -0
- package/functions/breakpoint.d.ts +1 -0
- package/functions/breakpoint.js +1 -0
- package/functions/confirm.d.ts +95 -0
- package/functions/confirm.js +68 -0
- package/functions/dialog.d.ts +97 -0
- package/functions/dialog.js +100 -0
- package/functions/getColorFromImage.d.ts +7 -0
- package/functions/getColorFromImage.js +12 -0
- package/functions/getTheme.d.ts +10 -0
- package/functions/getTheme.js +16 -0
- package/functions/observeResize.d.ts +2 -0
- package/functions/observeResize.js +1 -0
- package/functions/prompt.d.ts +110 -0
- package/functions/prompt.js +103 -0
- package/functions/removeColorScheme.d.ts +6 -0
- package/functions/removeColorScheme.js +8 -0
- package/functions/setColorScheme.d.ts +15 -0
- package/functions/setColorScheme.js +15 -0
- package/functions/setTheme.d.ts +10 -0
- package/functions/setTheme.js +16 -0
- package/functions/snackbar.d.ts +91 -0
- package/functions/snackbar.js +84 -0
- package/functions/throttle.d.ts +1 -0
- package/functions/throttle.js +1 -0
- package/functions/utils/colorScheme.d.ts +39 -0
- package/functions/utils/colorScheme.js +133 -0
- package/functions/utils/theme.d.ts +1 -0
- package/html-data.zh-cn.json +6566 -0
- package/jq.d.ts +1 -0
- package/jq.js +1 -0
- package/mdui.css +1 -0
- package/mdui.d.ts +61 -0
- package/mdui.esm.js +22 -0
- package/mdui.global.js +22 -0
- package/mdui.js +61 -0
- package/package.json +39 -68
- package/web-types.zh-cn.json +11728 -0
- package/dist/css/mdui.css +0 -13559
- package/dist/css/mdui.css.map +0 -1
- package/dist/css/mdui.min.css +0 -6
- package/dist/css/mdui.min.css.map +0 -1
- package/dist/fonts/roboto/LICENSE.txt +0 -201
- package/dist/fonts/roboto/Roboto-Black.woff +0 -0
- package/dist/fonts/roboto/Roboto-Black.woff2 +0 -0
- package/dist/fonts/roboto/Roboto-BlackItalic.woff +0 -0
- package/dist/fonts/roboto/Roboto-BlackItalic.woff2 +0 -0
- package/dist/fonts/roboto/Roboto-Bold.woff +0 -0
- package/dist/fonts/roboto/Roboto-Bold.woff2 +0 -0
- package/dist/fonts/roboto/Roboto-BoldItalic.woff +0 -0
- package/dist/fonts/roboto/Roboto-BoldItalic.woff2 +0 -0
- package/dist/fonts/roboto/Roboto-Light.woff +0 -0
- package/dist/fonts/roboto/Roboto-Light.woff2 +0 -0
- package/dist/fonts/roboto/Roboto-LightItalic.woff +0 -0
- package/dist/fonts/roboto/Roboto-LightItalic.woff2 +0 -0
- package/dist/fonts/roboto/Roboto-Medium.woff +0 -0
- package/dist/fonts/roboto/Roboto-Medium.woff2 +0 -0
- package/dist/fonts/roboto/Roboto-MediumItalic.woff +0 -0
- package/dist/fonts/roboto/Roboto-MediumItalic.woff2 +0 -0
- package/dist/fonts/roboto/Roboto-Regular.woff +0 -0
- package/dist/fonts/roboto/Roboto-Regular.woff2 +0 -0
- package/dist/fonts/roboto/Roboto-RegularItalic.woff +0 -0
- package/dist/fonts/roboto/Roboto-RegularItalic.woff2 +0 -0
- package/dist/fonts/roboto/Roboto-Thin.woff +0 -0
- package/dist/fonts/roboto/Roboto-Thin.woff2 +0 -0
- package/dist/fonts/roboto/Roboto-ThinItalic.woff +0 -0
- package/dist/fonts/roboto/Roboto-ThinItalic.woff2 +0 -0
- package/dist/icons/material-icons/LICENSE.txt +0 -393
- package/dist/icons/material-icons/MaterialIcons-Regular.ijmap +0 -1
- package/dist/icons/material-icons/MaterialIcons-Regular.woff +0 -0
- package/dist/icons/material-icons/MaterialIcons-Regular.woff2 +0 -0
- package/dist/js/mdui.esm.js +0 -5976
- package/dist/js/mdui.esm.js.map +0 -1
- package/dist/js/mdui.js +0 -6474
- package/dist/js/mdui.js.map +0 -1
- package/dist/js/mdui.min.js +0 -7
- package/dist/js/mdui.min.js.map +0 -1
- package/es/components/appbar/index.d.ts +0 -2
- package/es/components/appbar/index.js +0 -17
- package/es/components/bottom_nav/index.d.ts +0 -9
- package/es/components/bottom_nav/index.js +0 -38
- package/es/components/collapse/collapseAbstract.d.ts +0 -110
- package/es/components/collapse/collapseAbstract.js +0 -175
- package/es/components/collapse/customAttr.d.ts +0 -2
- package/es/components/collapse/customAttr.js +0 -11
- package/es/components/collapse/index.d.ts +0 -23
- package/es/components/collapse/index.js +0 -8
- package/es/components/dialog/alert.d.ts +0 -44
- package/es/components/dialog/alert.js +0 -42
- package/es/components/dialog/class.d.ts +0 -133
- package/es/components/dialog/class.js +0 -316
- package/es/components/dialog/confirm.d.ts +0 -54
- package/es/components/dialog/confirm.js +0 -55
- package/es/components/dialog/customAttr.d.ts +0 -4
- package/es/components/dialog/customAttr.js +0 -25
- package/es/components/dialog/dialog.d.ts +0 -91
- package/es/components/dialog/dialog.js +0 -101
- package/es/components/dialog/index.d.ts +0 -20
- package/es/components/dialog/index.js +0 -14
- package/es/components/dialog/prompt.d.ts +0 -74
- package/es/components/dialog/prompt.js +0 -109
- package/es/components/drawer/customAttr.d.ts +0 -4
- package/es/components/drawer/customAttr.js +0 -20
- package/es/components/drawer/index.d.ts +0 -111
- package/es/components/drawer/index.js +0 -310
- package/es/components/fab/customAttr.d.ts +0 -1
- package/es/components/fab/customAttr.js +0 -13
- package/es/components/fab/index.d.ts +0 -100
- package/es/components/fab/index.js +0 -144
- package/es/components/headroom/customAttr.d.ts +0 -2
- package/es/components/headroom/customAttr.js +0 -11
- package/es/components/headroom/index.d.ts +0 -120
- package/es/components/headroom/index.js +0 -167
- package/es/components/menu/customAttr.d.ts +0 -3
- package/es/components/menu/customAttr.js +0 -24
- package/es/components/menu/index.d.ts +0 -167
- package/es/components/menu/index.js +0 -512
- package/es/components/panel/customAttr.d.ts +0 -2
- package/es/components/panel/customAttr.js +0 -11
- package/es/components/panel/index.d.ts +0 -23
- package/es/components/panel/index.js +0 -8
- package/es/components/progress/spinner.d.ts +0 -16
- package/es/components/progress/spinner.js +0 -47
- package/es/components/ripple/index.d.ts +0 -25
- package/es/components/ripple/index.js +0 -170
- package/es/components/select/customAttr.d.ts +0 -2
- package/es/components/select/customAttr.js +0 -11
- package/es/components/select/index.d.ts +0 -160
- package/es/components/select/index.js +0 -340
- package/es/components/slider/index.d.ts +0 -28
- package/es/components/slider/index.js +0 -134
- package/es/components/snackbar/index.d.ts +0 -126
- package/es/components/snackbar/index.js +0 -217
- package/es/components/tab/customAttr.d.ts +0 -2
- package/es/components/tab/customAttr.js +0 -11
- package/es/components/tab/index.d.ts +0 -114
- package/es/components/tab/index.js +0 -266
- package/es/components/table/index.d.ts +0 -25
- package/es/components/table/index.js +0 -178
- package/es/components/textfield/index.d.ts +0 -28
- package/es/components/textfield/index.js +0 -147
- package/es/components/tooltip/customAttr.d.ts +0 -3
- package/es/components/tooltip/customAttr.js +0 -20
- package/es/components/tooltip/index.d.ts +0 -123
- package/es/components/tooltip/index.js +0 -251
- package/es/global/mutation.d.ts +0 -23
- package/es/global/mutation.js +0 -14
- package/es/index.d.ts +0 -36
- package/es/index.js +0 -36
- package/es/interfaces/MduiStatic.d.ts +0 -8
- package/es/jq.d.ts +0 -99
- package/es/jq.js +0 -102
- package/es/jq_extends/methods/mutation.d.ts +0 -11
- package/es/jq_extends/methods/mutation.js +0 -19
- package/es/jq_extends/methods/reflow.d.ts +0 -14
- package/es/jq_extends/methods/reflow.js +0 -7
- package/es/jq_extends/methods/transform.d.ts +0 -14
- package/es/jq_extends/methods/transform.js +0 -8
- package/es/jq_extends/methods/transformOrigin.d.ts +0 -14
- package/es/jq_extends/methods/transformOrigin.js +0 -8
- package/es/jq_extends/methods/transition.d.ts +0 -15
- package/es/jq_extends/methods/transition.js +0 -12
- package/es/jq_extends/methods/transitionEnd.d.ts +0 -17
- package/es/jq_extends/methods/transitionEnd.js +0 -23
- package/es/jq_extends/static/guid.d.ts +0 -18
- package/es/jq_extends/static/guid.js +0 -30
- package/es/jq_extends/static/hideOverlay.d.ts +0 -23
- package/es/jq_extends/static/hideOverlay.js +0 -25
- package/es/jq_extends/static/lockScreen.d.ts +0 -15
- package/es/jq_extends/static/lockScreen.js +0 -14
- package/es/jq_extends/static/showOverlay.d.ts +0 -23
- package/es/jq_extends/static/showOverlay.js +0 -27
- package/es/jq_extends/static/throttle.d.ts +0 -17
- package/es/jq_extends/static/throttle.js +0 -13
- package/es/jq_extends/static/unlockScreen.d.ts +0 -22
- package/es/jq_extends/static/unlockScreen.js +0 -13
- package/es/mdui.d.ts +0 -3
- package/es/mdui.js +0 -8
- package/es/utils/componentEvent.d.ts +0 -13
- package/es/utils/componentEvent.js +0 -37
- package/es/utils/dom.d.ts +0 -4
- package/es/utils/dom.js +0 -5
- package/es/utils/mutation.d.ts +0 -15
- package/es/utils/mutation.js +0 -24
- package/es/utils/parseOptions.d.ts +0 -9
- package/es/utils/parseOptions.js +0 -15
- package/es/utils/queue.d.ts +0 -18
- package/es/utils/queue.js +0 -26
- package/es/utils/touchHandler.d.ts +0 -50
- package/es/utils/touchHandler.js +0 -76
- package/src/components/appbar/index.less +0 -110
- package/src/components/appbar/index.ts +0 -19
- package/src/components/bottom_nav/index.less +0 -155
- package/src/components/bottom_nav/index.ts +0 -43
- package/src/components/button/index.less +0 -291
- package/src/components/card/index.less +0 -200
- package/src/components/chip/index.less +0 -97
- package/src/components/collapse/collapseAbstract.ts +0 -270
- package/src/components/collapse/customAttr.ts +0 -13
- package/src/components/collapse/index.less +0 -44
- package/src/components/collapse/index.ts +0 -32
- package/src/components/dialog/alert.less +0 -11
- package/src/components/dialog/alert.ts +0 -111
- package/src/components/dialog/class.ts +0 -432
- package/src/components/dialog/confirm.less +0 -11
- package/src/components/dialog/confirm.ts +0 -140
- package/src/components/dialog/customAttr.ts +0 -41
- package/src/components/dialog/dialog.ts +0 -224
- package/src/components/dialog/index.less +0 -154
- package/src/components/dialog/index.ts +0 -40
- package/src/components/dialog/prompt.less +0 -16
- package/src/components/dialog/prompt.ts +0 -231
- package/src/components/divider/index.less +0 -49
- package/src/components/drawer/customAttr.ts +0 -30
- package/src/components/drawer/index.less +0 -177
- package/src/components/drawer/index.ts +0 -425
- package/src/components/fab/customAttr.ts +0 -23
- package/src/components/fab/index.less +0 -158
- package/src/components/fab/index.ts +0 -232
- package/src/components/grid_list/index.less +0 -126
- package/src/components/headroom/customAttr.ts +0 -13
- package/src/components/headroom/index.less +0 -51
- package/src/components/headroom/index.ts +0 -275
- package/src/components/list/index.less +0 -347
- package/src/components/menu/customAttr.ts +0 -40
- package/src/components/menu/index.less +0 -195
- package/src/components/menu/index.ts +0 -725
- package/src/components/menu/svg/arrow_right_dark.svg +0 -1
- package/src/components/menu/svg/arrow_right_light.svg +0 -1
- package/src/components/panel/customAttr.ts +0 -13
- package/src/components/panel/index.less +0 -191
- package/src/components/panel/index.ts +0 -32
- package/src/components/progress/progress.less +0 -113
- package/src/components/progress/spinner.less +0 -198
- package/src/components/progress/spinner.ts +0 -75
- package/src/components/ripple/index.less +0 -92
- package/src/components/ripple/index.ts +0 -217
- package/src/components/select/customAttr.ts +0 -13
- package/src/components/select/index.less +0 -342
- package/src/components/select/index.ts +0 -478
- package/src/components/select/svg/arrow_down_dark.svg +0 -1
- package/src/components/select/svg/arrow_down_light.svg +0 -1
- package/src/components/select/svg/arrow_up_dark.svg +0 -1
- package/src/components/select/svg/arrow_up_light.svg +0 -1
- package/src/components/selection_control/checkbox.less +0 -226
- package/src/components/selection_control/radio.less +0 -163
- package/src/components/selection_control/switch.less +0 -210
- package/src/components/slider/index.less +0 -340
- package/src/components/slider/index.ts +0 -187
- package/src/components/snackbar/index.less +0 -133
- package/src/components/snackbar/index.ts +0 -367
- package/src/components/subheader/index.less +0 -38
- package/src/components/tab/customAttr.ts +0 -13
- package/src/components/tab/index.less +0 -195
- package/src/components/tab/index.ts +0 -372
- package/src/components/table/index.less +0 -169
- package/src/components/table/index.ts +0 -240
- package/src/components/textfield/index.less +0 -425
- package/src/components/textfield/index.ts +0 -217
- package/src/components/toolbar/index.less +0 -92
- package/src/components/tooltip/customAttr.ts +0 -26
- package/src/components/tooltip/index.less +0 -45
- package/src/components/tooltip/index.ts +0 -361
- package/src/fonts/roboto/LICENSE.txt +0 -201
- package/src/fonts/roboto/Roboto-Black.woff +0 -0
- package/src/fonts/roboto/Roboto-Black.woff2 +0 -0
- package/src/fonts/roboto/Roboto-BlackItalic.woff +0 -0
- package/src/fonts/roboto/Roboto-BlackItalic.woff2 +0 -0
- package/src/fonts/roboto/Roboto-Bold.woff +0 -0
- package/src/fonts/roboto/Roboto-Bold.woff2 +0 -0
- package/src/fonts/roboto/Roboto-BoldItalic.woff +0 -0
- package/src/fonts/roboto/Roboto-BoldItalic.woff2 +0 -0
- package/src/fonts/roboto/Roboto-Light.woff +0 -0
- package/src/fonts/roboto/Roboto-Light.woff2 +0 -0
- package/src/fonts/roboto/Roboto-LightItalic.woff +0 -0
- package/src/fonts/roboto/Roboto-LightItalic.woff2 +0 -0
- package/src/fonts/roboto/Roboto-Medium.woff +0 -0
- package/src/fonts/roboto/Roboto-Medium.woff2 +0 -0
- package/src/fonts/roboto/Roboto-MediumItalic.woff +0 -0
- package/src/fonts/roboto/Roboto-MediumItalic.woff2 +0 -0
- package/src/fonts/roboto/Roboto-Regular.woff +0 -0
- package/src/fonts/roboto/Roboto-Regular.woff2 +0 -0
- package/src/fonts/roboto/Roboto-RegularItalic.woff +0 -0
- package/src/fonts/roboto/Roboto-RegularItalic.woff2 +0 -0
- package/src/fonts/roboto/Roboto-Thin.woff +0 -0
- package/src/fonts/roboto/Roboto-Thin.woff2 +0 -0
- package/src/fonts/roboto/Roboto-ThinItalic.woff +0 -0
- package/src/fonts/roboto/Roboto-ThinItalic.woff2 +0 -0
- package/src/global/mutation.ts +0 -37
- package/src/icons/material-icons/LICENSE.txt +0 -393
- package/src/icons/material-icons/MaterialIcons-Regular.ijmap +0 -1
- package/src/icons/material-icons/MaterialIcons-Regular.woff +0 -0
- package/src/icons/material-icons/MaterialIcons-Regular.woff2 +0 -0
- package/src/index.less +0 -73
- package/src/index.ts +0 -39
- package/src/interfaces/MduiStatic.ts +0 -11
- package/src/jq.ts +0 -104
- package/src/jq_extends/methods/mutation.ts +0 -32
- package/src/jq_extends/methods/reflow.ts +0 -23
- package/src/jq_extends/methods/transform.ts +0 -24
- package/src/jq_extends/methods/transformOrigin.ts +0 -24
- package/src/jq_extends/methods/transition.ts +0 -30
- package/src/jq_extends/methods/transitionEnd.ts +0 -49
- package/src/jq_extends/static/guid.ts +0 -56
- package/src/jq_extends/static/hideOverlay.ts +0 -50
- package/src/jq_extends/static/lockScreen.ts +0 -30
- package/src/jq_extends/static/showOverlay.ts +0 -51
- package/src/jq_extends/static/throttle.ts +0 -32
- package/src/jq_extends/static/unlockScreen.ts +0 -36
- package/src/mdui.ts +0 -12
- package/src/styles/color.less +0 -392
- package/src/styles/global.less +0 -75
- package/src/styles/grid.less +0 -150
- package/src/styles/helper.less +0 -242
- package/src/styles/icon.less +0 -31
- package/src/styles/material-icons.less +0 -36
- package/src/styles/media.less +0 -39
- package/src/styles/mixin/color.less +0 -66
- package/src/styles/mixin/divider.less +0 -30
- package/src/styles/mixin/helper.less +0 -126
- package/src/styles/mixin/icon.less +0 -33
- package/src/styles/mixin/layout-theme.less +0 -14
- package/src/styles/mixin/media.less +0 -11
- package/src/styles/mixin/shadow.less +0 -17
- package/src/styles/mixin/typo.less +0 -149
- package/src/styles/mixin.less +0 -8
- package/src/styles/roboto.less +0 -125
- package/src/styles/shadow.less +0 -20
- package/src/styles/typo-styles.less +0 -91
- package/src/styles/typo.less +0 -338
- package/src/styles/variable/animation.less +0 -5
- package/src/styles/variable/color/amber.less +0 -41
- package/src/styles/variable/color/black.less +0 -16
- package/src/styles/variable/color/blue-grey.less +0 -29
- package/src/styles/variable/color/blue.less +0 -41
- package/src/styles/variable/color/brown.less +0 -29
- package/src/styles/variable/color/cyan.less +0 -41
- package/src/styles/variable/color/deep-orange.less +0 -41
- package/src/styles/variable/color/deep-purple.less +0 -41
- package/src/styles/variable/color/default.less +0 -74
- package/src/styles/variable/color/green.less +0 -41
- package/src/styles/variable/color/grey.less +0 -29
- package/src/styles/variable/color/indigo.less +0 -41
- package/src/styles/variable/color/light-blue.less +0 -41
- package/src/styles/variable/color/light-green.less +0 -41
- package/src/styles/variable/color/lime.less +0 -41
- package/src/styles/variable/color/orange.less +0 -41
- package/src/styles/variable/color/pink.less +0 -41
- package/src/styles/variable/color/purple.less +0 -41
- package/src/styles/variable/color/red.less +0 -41
- package/src/styles/variable/color/teal.less +0 -41
- package/src/styles/variable/color/transparent.less +0 -1
- package/src/styles/variable/color/white.less +0 -16
- package/src/styles/variable/color/yellow.less +0 -41
- package/src/styles/variable/global.less +0 -98
- package/src/styles/variable/shadow.less +0 -103
- package/src/styles/variable.less +0 -26
- package/src/tsconfig.json +0 -12
- package/src/utils/componentEvent.ts +0 -63
- package/src/utils/dom.ts +0 -7
- package/src/utils/mutation.ts +0 -41
- package/src/utils/parseOptions.ts +0 -23
- package/src/utils/queue.ts +0 -51
- package/src/utils/touchHandler.ts +0 -92
- /package/{es/interfaces/MduiStatic.js → functions/utils/theme.js} +0 -0
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html, LitElement } from 'lit';
|
|
3
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
5
|
+
import { live } from 'lit/directives/live.js';
|
|
6
|
+
import { createRef, ref } from 'lit/directives/ref.js';
|
|
7
|
+
import { FormController, formResets } from '@mdui/shared/controllers/form.js';
|
|
8
|
+
import { defaultValue } from '@mdui/shared/decorators/default-value.js';
|
|
9
|
+
import { watch } from '@mdui/shared/decorators/watch.js';
|
|
10
|
+
import { booleanConverter } from '@mdui/shared/helpers/decorator.js';
|
|
11
|
+
import { emit } from '@mdui/shared/helpers/event.js';
|
|
12
|
+
import '@mdui/shared/icons/check-box-outline-blank.js';
|
|
13
|
+
import '@mdui/shared/icons/check-box.js';
|
|
14
|
+
import '@mdui/shared/icons/indeterminate-check-box.js';
|
|
15
|
+
import { componentStyle } from '@mdui/shared/lit-styles/component-style.js';
|
|
16
|
+
import { FocusableMixin } from '@mdui/shared/mixins/focusable.js';
|
|
17
|
+
import '../icon.js';
|
|
18
|
+
import { RippleMixin } from '../ripple/ripple-mixin.js';
|
|
19
|
+
import { style } from './style.js';
|
|
20
|
+
/**
|
|
21
|
+
* @summary 复选框组件
|
|
22
|
+
*
|
|
23
|
+
* ```html
|
|
24
|
+
* <mdui-checkbox>Checkbox</mdui-checkbox>
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @event focus - 获得焦点时触发
|
|
28
|
+
* @event blur - 失去焦点时触发
|
|
29
|
+
* @event change - 选中状态变更时触发
|
|
30
|
+
* @event input - 选中状态变更时触发
|
|
31
|
+
* @event invalid - 表单字段验证未通过时触发
|
|
32
|
+
*
|
|
33
|
+
* @slot - 文本
|
|
34
|
+
* @slot unchecked-icon - 未选中状态图标
|
|
35
|
+
* @slot checked-icon - 选中状态图标
|
|
36
|
+
* @slot indeterminate-icon - 不确定状态图标
|
|
37
|
+
*
|
|
38
|
+
* @csspart control - 左侧图标容器
|
|
39
|
+
* @csspart unchecked-icon - 未选中状态图标
|
|
40
|
+
* @csspart checked-icon - 选中状态图标
|
|
41
|
+
* @csspart indeterminate-icon - 不确定状态图标
|
|
42
|
+
* @csspart label - 文本
|
|
43
|
+
*/
|
|
44
|
+
export let Checkbox = class Checkbox extends RippleMixin(FocusableMixin(LitElement)) {
|
|
45
|
+
constructor() {
|
|
46
|
+
super(...arguments);
|
|
47
|
+
/**
|
|
48
|
+
* 是否为禁用状态
|
|
49
|
+
*/
|
|
50
|
+
this.disabled = false;
|
|
51
|
+
/**
|
|
52
|
+
* 是否为选中状态
|
|
53
|
+
*/
|
|
54
|
+
this.checked = false;
|
|
55
|
+
/**
|
|
56
|
+
* 默认选中状态。在重置表单时,将重置为该默认状态。该属性只能通过 JavaScript 属性设置
|
|
57
|
+
*/
|
|
58
|
+
this.defaultChecked = false;
|
|
59
|
+
/**
|
|
60
|
+
* 是否为不确定状态
|
|
61
|
+
*/
|
|
62
|
+
this.indeterminate = false;
|
|
63
|
+
/**
|
|
64
|
+
* 提交表单时,是否必须选中该复选框
|
|
65
|
+
*/
|
|
66
|
+
this.required = false;
|
|
67
|
+
/**
|
|
68
|
+
* 复选框名称,将与表单数据一起提交
|
|
69
|
+
*/
|
|
70
|
+
this.name = '';
|
|
71
|
+
/**
|
|
72
|
+
* 复选框的值,将于表单数据一起提交
|
|
73
|
+
*/
|
|
74
|
+
this.value = 'on';
|
|
75
|
+
/**
|
|
76
|
+
* 是否验证未通过
|
|
77
|
+
*/
|
|
78
|
+
this.invalid = false;
|
|
79
|
+
this.inputRef = createRef();
|
|
80
|
+
this.rippleRef = createRef();
|
|
81
|
+
this.formController = new FormController(this, {
|
|
82
|
+
value: (control) => (control.checked ? control.value : undefined),
|
|
83
|
+
defaultValue: (control) => control.defaultChecked,
|
|
84
|
+
setValue: (control, checked) => (control.checked = checked),
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* 表单验证状态对象
|
|
89
|
+
*/
|
|
90
|
+
get validity() {
|
|
91
|
+
return this.inputRef.value.validity;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* 表单验证的错误提示信息
|
|
95
|
+
*/
|
|
96
|
+
get validationMessage() {
|
|
97
|
+
return this.inputRef.value.validationMessage;
|
|
98
|
+
}
|
|
99
|
+
get rippleElement() {
|
|
100
|
+
return this.rippleRef.value;
|
|
101
|
+
}
|
|
102
|
+
get rippleDisabled() {
|
|
103
|
+
return this.disabled;
|
|
104
|
+
}
|
|
105
|
+
get focusElement() {
|
|
106
|
+
return this.inputRef.value;
|
|
107
|
+
}
|
|
108
|
+
get focusDisabled() {
|
|
109
|
+
return this.disabled;
|
|
110
|
+
}
|
|
111
|
+
async onDisabledChange() {
|
|
112
|
+
await this.updateComplete;
|
|
113
|
+
this.invalid = !this.inputRef.value.checkValidity();
|
|
114
|
+
}
|
|
115
|
+
async onCheckedChange() {
|
|
116
|
+
var _a;
|
|
117
|
+
await this.updateComplete;
|
|
118
|
+
// reset 引起的值变更,不执行验证;直接修改值引起的变更,需要进行验证
|
|
119
|
+
const form = this.formController.getForm();
|
|
120
|
+
if (form && ((_a = formResets.get(form)) === null || _a === void 0 ? void 0 : _a.has(this))) {
|
|
121
|
+
this.invalid = false;
|
|
122
|
+
formResets.get(form).delete(this);
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
this.invalid = !this.inputRef.value.checkValidity();
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* 检查表单字段是否验证通过。若未通过则返回 `false`,并触发 `invalid` 事件;若验证通过,则返回 `true`
|
|
130
|
+
*/
|
|
131
|
+
checkValidity() {
|
|
132
|
+
const valid = this.inputRef.value.checkValidity();
|
|
133
|
+
if (!valid) {
|
|
134
|
+
emit(this, 'invalid', {
|
|
135
|
+
bubbles: false,
|
|
136
|
+
cancelable: true,
|
|
137
|
+
composed: false,
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
return valid;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* 检查表单字段是否验证通过。若未通过则返回 `false`,并触发 `invalid` 事件;若验证通过,则返回 `true`。
|
|
144
|
+
*
|
|
145
|
+
* 验证未通过时,还将在组件上显示未通过的提示。
|
|
146
|
+
*/
|
|
147
|
+
reportValidity() {
|
|
148
|
+
this.invalid = !this.inputRef.value.reportValidity();
|
|
149
|
+
if (this.invalid) {
|
|
150
|
+
const requestInvalid = emit(this, 'invalid', {
|
|
151
|
+
bubbles: false,
|
|
152
|
+
cancelable: true,
|
|
153
|
+
composed: false,
|
|
154
|
+
});
|
|
155
|
+
// 调用了 preventDefault() 时,隐藏默认的表单错误提示
|
|
156
|
+
if (requestInvalid.defaultPrevented) {
|
|
157
|
+
this.blur();
|
|
158
|
+
this.focus();
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return !this.invalid;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* 设置自定义的错误提示文本。只要文本不为空,则表示字段验证未通过
|
|
165
|
+
*
|
|
166
|
+
* @param message 自定义的提示文本
|
|
167
|
+
*/
|
|
168
|
+
setCustomValidity(message) {
|
|
169
|
+
this.inputRef.value.setCustomValidity(message);
|
|
170
|
+
this.invalid = !this.inputRef.value.checkValidity();
|
|
171
|
+
}
|
|
172
|
+
render() {
|
|
173
|
+
return html `<label><input ${ref(this.inputRef)} type="checkbox" name="${ifDefined(this.name)}" value="${ifDefined(this.value)}" .indeterminate="${live(this.indeterminate)}" .disabled="${this.disabled}" .checked="${live(this.checked)}" .required="${this.required}" @change="${this.onChange}"> <i part="control"><mdui-ripple ${ref(this.rippleRef)} .noRipple="${this.noRipple}"></mdui-ripple><slot name="unchecked-icon" part="unchecked-icon" class="icon unchecked-icon">${this.uncheckedIcon
|
|
174
|
+
? html `<mdui-icon name="${this.uncheckedIcon}" class="i"></mdui-icon>`
|
|
175
|
+
: html `<mdui-icon-check-box-outline-blank class="i"></mdui-icon-check-box-outline-blank>`}</slot><slot name="checked-icon" part="checked-icon" class="icon checked-icon">${this.checkedIcon
|
|
176
|
+
? html `<mdui-icon name="${this.checkedIcon}" class="i"></mdui-icon>`
|
|
177
|
+
: html `<mdui-icon-check-box class="i"></mdui-icon-check-box>`}</slot><slot name="indeterminate-icon" part="indeterminate-icon" class="icon indeterminate-icon">${this.indeterminateIcon
|
|
178
|
+
? html `<mdui-icon name="${this.indeterminateIcon}" class="i"></mdui-icon>`
|
|
179
|
+
: html `<mdui-icon-indeterminate-check-box class="i"></mdui-icon-indeterminate-check-box>`}</slot></i><slot part="label" class="label"></slot></label>`;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* input[type="checkbox"] 的 change 事件无法冒泡越过 shadow dom
|
|
183
|
+
*/
|
|
184
|
+
onChange() {
|
|
185
|
+
this.checked = this.inputRef.value.checked;
|
|
186
|
+
this.indeterminate = false;
|
|
187
|
+
emit(this, 'change');
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
Checkbox.styles = [componentStyle, style];
|
|
191
|
+
__decorate([
|
|
192
|
+
property({
|
|
193
|
+
type: Boolean,
|
|
194
|
+
reflect: true,
|
|
195
|
+
converter: booleanConverter,
|
|
196
|
+
})
|
|
197
|
+
], Checkbox.prototype, "disabled", void 0);
|
|
198
|
+
__decorate([
|
|
199
|
+
property({
|
|
200
|
+
type: Boolean,
|
|
201
|
+
reflect: true,
|
|
202
|
+
converter: booleanConverter,
|
|
203
|
+
})
|
|
204
|
+
], Checkbox.prototype, "checked", void 0);
|
|
205
|
+
__decorate([
|
|
206
|
+
defaultValue('checked')
|
|
207
|
+
], Checkbox.prototype, "defaultChecked", void 0);
|
|
208
|
+
__decorate([
|
|
209
|
+
property({
|
|
210
|
+
type: Boolean,
|
|
211
|
+
reflect: true,
|
|
212
|
+
converter: booleanConverter,
|
|
213
|
+
})
|
|
214
|
+
], Checkbox.prototype, "indeterminate", void 0);
|
|
215
|
+
__decorate([
|
|
216
|
+
property({
|
|
217
|
+
type: Boolean,
|
|
218
|
+
reflect: true,
|
|
219
|
+
converter: booleanConverter,
|
|
220
|
+
})
|
|
221
|
+
], Checkbox.prototype, "required", void 0);
|
|
222
|
+
__decorate([
|
|
223
|
+
property({ reflect: true })
|
|
224
|
+
], Checkbox.prototype, "form", void 0);
|
|
225
|
+
__decorate([
|
|
226
|
+
property({ reflect: true })
|
|
227
|
+
], Checkbox.prototype, "name", void 0);
|
|
228
|
+
__decorate([
|
|
229
|
+
property({ reflect: true })
|
|
230
|
+
], Checkbox.prototype, "value", void 0);
|
|
231
|
+
__decorate([
|
|
232
|
+
property({ reflect: true, attribute: 'unchecked-icon' })
|
|
233
|
+
], Checkbox.prototype, "uncheckedIcon", void 0);
|
|
234
|
+
__decorate([
|
|
235
|
+
property({ reflect: true, attribute: 'checked-icon' })
|
|
236
|
+
], Checkbox.prototype, "checkedIcon", void 0);
|
|
237
|
+
__decorate([
|
|
238
|
+
property({ reflect: true, attribute: 'indeterminate-icon' })
|
|
239
|
+
], Checkbox.prototype, "indeterminateIcon", void 0);
|
|
240
|
+
__decorate([
|
|
241
|
+
property({
|
|
242
|
+
type: Boolean,
|
|
243
|
+
reflect: true,
|
|
244
|
+
converter: booleanConverter,
|
|
245
|
+
})
|
|
246
|
+
], Checkbox.prototype, "invalid", void 0);
|
|
247
|
+
__decorate([
|
|
248
|
+
watch('disabled', true),
|
|
249
|
+
watch('indeterminate', true),
|
|
250
|
+
watch('required', true)
|
|
251
|
+
], Checkbox.prototype, "onDisabledChange", null);
|
|
252
|
+
__decorate([
|
|
253
|
+
watch('checked', true)
|
|
254
|
+
], Checkbox.prototype, "onCheckedChange", null);
|
|
255
|
+
Checkbox = __decorate([
|
|
256
|
+
customElement('mdui-checkbox')
|
|
257
|
+
], Checkbox);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const style: import("lit").CSSResult;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const style = css `:host{position:relative;display:inline-flex;cursor:pointer;-webkit-tap-highlight-color:transparent;border-radius:.125rem;font-size:var(--mdui-typescale-label-large-size);font-weight:var(--mdui-typescale-label-large-weight);letter-spacing:var(--mdui-typescale-label-large-tracking);line-height:var(--mdui-typescale-label-large-line-height)}label{display:inline-flex;align-items:center;width:100%;cursor:inherit;-webkit-user-select:none;user-select:none;touch-action:manipulation;zoom:1;-webkit-user-drag:none}input{position:absolute;padding:0;opacity:0;pointer-events:none;width:1.125rem;height:1.125rem;margin:0 0 0 .6875rem}.icon{display:flex;position:absolute;opacity:1;transform:scale(1);color:rgb(var(--mdui-color-on-surface));font-size:1.5rem;transition:color var(--mdui-motion-duration-short4) var(--mdui-motion-easing-standard)}.checked-icon,.indeterminate-icon{opacity:0;transform:scale(.5);transition-property:color,opacity,transform;transition-duration:var(--mdui-motion-duration-short4);transition-timing-function:var(--mdui-motion-easing-standard)}.icon .i,::slotted([slot=checked-icon]),::slotted([slot=indeterminate-icon]),::slotted([slot=unchecked-icon]){color:inherit;font-size:inherit}i{position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden;border-radius:50%;width:2.5rem;min-width:2.5rem;height:2.5rem;--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface)}.label{display:flex;width:100%;padding-top:.625rem;padding-bottom:.625rem;color:rgb(var(--mdui-color-on-surface));transition:color var(--mdui-motion-duration-short4) var(--mdui-motion-easing-standard)}:host([checked]) i{--mdui-comp-ripple-state-layer-color:var(--mdui-color-primary)}:host([checked]) .icon{color:rgb(var(--mdui-color-primary))}:host([checked]) .indeterminate-icon{opacity:0;transform:scale(.5)}:host([checked]) .checked-icon{opacity:1;transform:scale(1)}:host([indeterminate]) i{--mdui-comp-ripple-state-layer-color:var(--mdui-color-primary)}:host([indeterminate]) .icon{color:rgb(var(--mdui-color-primary))}:host([indeterminate]) .checked-icon{opacity:0;transform:scale(.5)}:host([indeterminate]) .indeterminate-icon{opacity:1;transform:scale(1)}:host([invalid]) i{--mdui-comp-ripple-state-layer-color:var(--mdui-color-error)}:host([invalid]) .icon{color:rgb(var(--mdui-color-error))}:host([invalid]) .label{color:rgb(var(--mdui-color-error))}:host([disabled]){cursor:default;pointer-events:none}:host([disabled]) .icon{color:rgba(var(--mdui-color-on-surface),38%)}:host([disabled]) .label{color:rgba(var(--mdui-color-on-surface),38%)}:host([disabled][checked]) .unchecked-icon,:host([disabled][indeterminate]) .unchecked-icon{opacity:0}`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './checkbox/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './checkbox/index.js';
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import '@mdui/shared/icons/check.js';
|
|
2
|
+
import '@mdui/shared/icons/clear.js';
|
|
3
|
+
import { ButtonBase } from '../button/button-base.js';
|
|
4
|
+
import '../icon.js';
|
|
5
|
+
import type { Ripple } from '../ripple/index.js';
|
|
6
|
+
import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
|
|
7
|
+
/**
|
|
8
|
+
* @summary 纸片组件
|
|
9
|
+
*
|
|
10
|
+
* ```html
|
|
11
|
+
* <mdui-chip>Chip</mdui-chip>
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* @event focus - 获得焦点时触发
|
|
15
|
+
* @event blur - 失去焦点时触发
|
|
16
|
+
* @event invalid - 表单字段验证未通过时触发
|
|
17
|
+
* @event change - 选中状态变更时触发
|
|
18
|
+
* @event delete - 点击删除图标时触发
|
|
19
|
+
*
|
|
20
|
+
* @slot - 文本
|
|
21
|
+
* @slot icon - 左侧元素
|
|
22
|
+
* @slot end-icon - 右侧元素
|
|
23
|
+
* @slot selected-icon - 选中状态的左侧元素
|
|
24
|
+
* @slot delete-icon - 可删除时,右侧的删除元素
|
|
25
|
+
*
|
|
26
|
+
* @csspart button - 内部的 `button` 或 `a` 元素
|
|
27
|
+
* @csspart label - 文本
|
|
28
|
+
* @csspart icon - 左侧图标
|
|
29
|
+
* @csspart end-icon - 右侧图标
|
|
30
|
+
* @csspart selected-icon - 选中状态的左侧图标
|
|
31
|
+
* @csspart delete-icon - 可删除时,右侧的删除图标
|
|
32
|
+
* @csspart loading - 加载中状态的 `<mdui-circular-progress>` 元素
|
|
33
|
+
*
|
|
34
|
+
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐[引用设计令牌](/docs/2/styles/design-tokens#shape-corner)
|
|
35
|
+
*/
|
|
36
|
+
export declare class Chip extends ButtonBase {
|
|
37
|
+
static styles: CSSResultGroup;
|
|
38
|
+
/**
|
|
39
|
+
* 纸片形状。可选值为:
|
|
40
|
+
*
|
|
41
|
+
* * `assist`:用于显示和当前上下文相关的辅助操作。例如在点餐页面,提供分享,收藏等功能
|
|
42
|
+
* * `filter`:用于对内容进行筛选。例如在搜索结果页,对搜索结果进行过滤
|
|
43
|
+
* * `input`:用于表示用户输入的信息片段。例如 Gmail 中“收件人”字段中的联系人
|
|
44
|
+
* * `suggestion`:用于提供动态生成的推荐信息,以简化用户操作。例如在聊天应用中猜测用户可能想发送的信息,供用户选择
|
|
45
|
+
*/
|
|
46
|
+
variant: /*用于显示和当前上下文相关的辅助操作。例如在点餐页面,提供分享,收藏等功能*/ 'assist' | /*用于对内容进行筛选。例如在搜索结果页,对搜索结果进行过滤*/ 'filter' | /*用于表示用户输入的信息片段。例如 Gmail 中“收件人”字段中的联系人*/ 'input' | /*用于提供动态生成的推荐信息,以简化用户操作。例如在聊天应用中猜测用户可能想发送的信息,供用户选择*/ 'suggestion';
|
|
47
|
+
/**
|
|
48
|
+
* 是否包含阴影
|
|
49
|
+
*/
|
|
50
|
+
elevated: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* 是否可选中
|
|
53
|
+
*/
|
|
54
|
+
selectable: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* 是否为选中状态
|
|
57
|
+
*/
|
|
58
|
+
selected: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* 是否可删除。为 `true` 时,在右侧会显示删除图标图标
|
|
61
|
+
*/
|
|
62
|
+
deletable: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* 左侧的 Material Icons 图标名。也可以通过 `slot="icon"` 设置
|
|
65
|
+
*/
|
|
66
|
+
icon?: string;
|
|
67
|
+
/**
|
|
68
|
+
* 选中状态,左侧的 Material Icons 图标名。也可以通过 `slot="selected-icon"` 设置
|
|
69
|
+
*/
|
|
70
|
+
selectedIcon?: string;
|
|
71
|
+
/**
|
|
72
|
+
* 右侧的 Material Icons 图标名。也可以通过 `slot="end-icon"` 设置
|
|
73
|
+
*/
|
|
74
|
+
endIcon?: string;
|
|
75
|
+
/**
|
|
76
|
+
* 右侧的 Material Icons 图标名。也可以通过 `slot="delete-icon"` 设置
|
|
77
|
+
*/
|
|
78
|
+
deleteIcon?: string;
|
|
79
|
+
private readonly rippleRef;
|
|
80
|
+
private readonly hasSlotController;
|
|
81
|
+
constructor();
|
|
82
|
+
protected get rippleElement(): Ripple;
|
|
83
|
+
private onSelectedChange;
|
|
84
|
+
protected firstUpdated(changedProperties: PropertyValues): void;
|
|
85
|
+
protected render(): TemplateResult;
|
|
86
|
+
private onClick;
|
|
87
|
+
private onKeyDown;
|
|
88
|
+
/**
|
|
89
|
+
* 点击删除按钮
|
|
90
|
+
*/
|
|
91
|
+
private onDelete;
|
|
92
|
+
private renderIcon;
|
|
93
|
+
private renderLabel;
|
|
94
|
+
private renderEndIcon;
|
|
95
|
+
private renderDeleteIcon;
|
|
96
|
+
private renderInner;
|
|
97
|
+
}
|
|
98
|
+
declare global {
|
|
99
|
+
interface HTMLElementTagNameMap {
|
|
100
|
+
'mdui-chip': Chip;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html } from 'lit';
|
|
3
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
+
import { createRef, ref } from 'lit/directives/ref.js';
|
|
5
|
+
import cc from 'classcat';
|
|
6
|
+
import { HasSlotController } from '@mdui/shared/controllers/has-slot.js';
|
|
7
|
+
import { watch } from '@mdui/shared/decorators/watch.js';
|
|
8
|
+
import { booleanConverter } from '@mdui/shared/helpers/decorator.js';
|
|
9
|
+
import { emit } from '@mdui/shared/helpers/event.js';
|
|
10
|
+
import { nothingTemplate } from '@mdui/shared/helpers/template.js';
|
|
11
|
+
import '@mdui/shared/icons/check.js';
|
|
12
|
+
import '@mdui/shared/icons/clear.js';
|
|
13
|
+
import { ButtonBase } from '../button/button-base.js';
|
|
14
|
+
import '../icon.js';
|
|
15
|
+
import { style } from './style.js';
|
|
16
|
+
/**
|
|
17
|
+
* @summary 纸片组件
|
|
18
|
+
*
|
|
19
|
+
* ```html
|
|
20
|
+
* <mdui-chip>Chip</mdui-chip>
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @event focus - 获得焦点时触发
|
|
24
|
+
* @event blur - 失去焦点时触发
|
|
25
|
+
* @event invalid - 表单字段验证未通过时触发
|
|
26
|
+
* @event change - 选中状态变更时触发
|
|
27
|
+
* @event delete - 点击删除图标时触发
|
|
28
|
+
*
|
|
29
|
+
* @slot - 文本
|
|
30
|
+
* @slot icon - 左侧元素
|
|
31
|
+
* @slot end-icon - 右侧元素
|
|
32
|
+
* @slot selected-icon - 选中状态的左侧元素
|
|
33
|
+
* @slot delete-icon - 可删除时,右侧的删除元素
|
|
34
|
+
*
|
|
35
|
+
* @csspart button - 内部的 `button` 或 `a` 元素
|
|
36
|
+
* @csspart label - 文本
|
|
37
|
+
* @csspart icon - 左侧图标
|
|
38
|
+
* @csspart end-icon - 右侧图标
|
|
39
|
+
* @csspart selected-icon - 选中状态的左侧图标
|
|
40
|
+
* @csspart delete-icon - 可删除时,右侧的删除图标
|
|
41
|
+
* @csspart loading - 加载中状态的 `<mdui-circular-progress>` 元素
|
|
42
|
+
*
|
|
43
|
+
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐[引用设计令牌](/docs/2/styles/design-tokens#shape-corner)
|
|
44
|
+
*/
|
|
45
|
+
export let Chip = class Chip extends ButtonBase {
|
|
46
|
+
constructor() {
|
|
47
|
+
super();
|
|
48
|
+
/**
|
|
49
|
+
* 纸片形状。可选值为:
|
|
50
|
+
*
|
|
51
|
+
* * `assist`:用于显示和当前上下文相关的辅助操作。例如在点餐页面,提供分享,收藏等功能
|
|
52
|
+
* * `filter`:用于对内容进行筛选。例如在搜索结果页,对搜索结果进行过滤
|
|
53
|
+
* * `input`:用于表示用户输入的信息片段。例如 Gmail 中“收件人”字段中的联系人
|
|
54
|
+
* * `suggestion`:用于提供动态生成的推荐信息,以简化用户操作。例如在聊天应用中猜测用户可能想发送的信息,供用户选择
|
|
55
|
+
*/
|
|
56
|
+
this.variant = 'assist';
|
|
57
|
+
/**
|
|
58
|
+
* 是否包含阴影
|
|
59
|
+
*/
|
|
60
|
+
this.elevated = false;
|
|
61
|
+
/**
|
|
62
|
+
* 是否可选中
|
|
63
|
+
*/
|
|
64
|
+
this.selectable = false;
|
|
65
|
+
/**
|
|
66
|
+
* 是否为选中状态
|
|
67
|
+
*/
|
|
68
|
+
this.selected = false;
|
|
69
|
+
/**
|
|
70
|
+
* 是否可删除。为 `true` 时,在右侧会显示删除图标图标
|
|
71
|
+
*/
|
|
72
|
+
this.deletable = false;
|
|
73
|
+
this.rippleRef = createRef();
|
|
74
|
+
this.hasSlotController = new HasSlotController(this, 'icon', 'selected-icon', 'end-icon');
|
|
75
|
+
this.onClick = this.onClick.bind(this);
|
|
76
|
+
this.onKeyDown = this.onKeyDown.bind(this);
|
|
77
|
+
}
|
|
78
|
+
get rippleElement() {
|
|
79
|
+
return this.rippleRef.value;
|
|
80
|
+
}
|
|
81
|
+
onSelectedChange() {
|
|
82
|
+
emit(this, 'change');
|
|
83
|
+
}
|
|
84
|
+
firstUpdated(changedProperties) {
|
|
85
|
+
super.firstUpdated(changedProperties);
|
|
86
|
+
this.addEventListener('click', this.onClick);
|
|
87
|
+
this.addEventListener('keydown', this.onKeyDown);
|
|
88
|
+
}
|
|
89
|
+
render() {
|
|
90
|
+
const hasIcon = this.icon || this.hasSlotController.test('icon');
|
|
91
|
+
const hasEndIcon = this.endIcon || this.hasSlotController.test('end-icon');
|
|
92
|
+
const hasSelectedIcon = this.selectedIcon ||
|
|
93
|
+
['assist', 'filter'].includes(this.variant) ||
|
|
94
|
+
hasIcon ||
|
|
95
|
+
this.hasSlotController.test('selected-icon');
|
|
96
|
+
const className = cc({
|
|
97
|
+
button: true,
|
|
98
|
+
'has-icon': this.loading ||
|
|
99
|
+
(!this.selected && hasIcon) ||
|
|
100
|
+
(this.selected && hasSelectedIcon),
|
|
101
|
+
'has-end-icon': hasEndIcon,
|
|
102
|
+
});
|
|
103
|
+
return html `<mdui-ripple ${ref(this.rippleRef)} .noRipple="${this.noRipple}"></mdui-ripple>${this.isButton()
|
|
104
|
+
? this.renderButton({
|
|
105
|
+
className,
|
|
106
|
+
part: 'button',
|
|
107
|
+
content: this.renderInner(),
|
|
108
|
+
})
|
|
109
|
+
: this.disabled || this.loading
|
|
110
|
+
? html `<span part="button" class="${className} _a">${this.renderInner()}</span>`
|
|
111
|
+
: this.renderAnchor({
|
|
112
|
+
className,
|
|
113
|
+
part: 'button',
|
|
114
|
+
content: this.renderInner(),
|
|
115
|
+
})}`;
|
|
116
|
+
}
|
|
117
|
+
onClick() {
|
|
118
|
+
if (this.disabled || this.loading) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
// 点击时,切换选中状态
|
|
122
|
+
if (this.selectable) {
|
|
123
|
+
this.selected = !this.selected;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
onKeyDown(event) {
|
|
127
|
+
if (this.disabled || this.loading) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
// 按下空格键时,切换选中状态
|
|
131
|
+
if (this.selectable && event.key === ' ') {
|
|
132
|
+
event.preventDefault();
|
|
133
|
+
this.selected = !this.selected;
|
|
134
|
+
}
|
|
135
|
+
// 按下 Delete 或 BackSpace 键时,触发 delete 事件
|
|
136
|
+
if (this.deletable && ['Delete', 'Backspace'].includes(event.key)) {
|
|
137
|
+
emit(this, 'delete');
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* 点击删除按钮
|
|
142
|
+
*/
|
|
143
|
+
onDelete(event) {
|
|
144
|
+
event.stopPropagation();
|
|
145
|
+
emit(this, 'delete');
|
|
146
|
+
}
|
|
147
|
+
renderIcon() {
|
|
148
|
+
if (this.loading) {
|
|
149
|
+
return this.renderLoading();
|
|
150
|
+
}
|
|
151
|
+
const icon = () => {
|
|
152
|
+
return this.icon
|
|
153
|
+
? html `<mdui-icon name="${this.icon}" class="i"></mdui-icon>`
|
|
154
|
+
: nothingTemplate;
|
|
155
|
+
};
|
|
156
|
+
const selectedIcon = () => {
|
|
157
|
+
if (this.selectedIcon) {
|
|
158
|
+
return html `<mdui-icon name="${this.selectedIcon}" class="i"></mdui-icon>`;
|
|
159
|
+
}
|
|
160
|
+
if (this.variant === 'assist' || this.variant === 'filter') {
|
|
161
|
+
return html `<mdui-icon-check class="i"></mdui-icon-check>`;
|
|
162
|
+
}
|
|
163
|
+
return icon();
|
|
164
|
+
};
|
|
165
|
+
return !this.selected
|
|
166
|
+
? html `<slot name="icon" part="icon" class="icon">${icon()}</slot>`
|
|
167
|
+
: html `<slot name="selected-icon" part="selected-icon" class="selected-icon">${selectedIcon()}</slot>`;
|
|
168
|
+
}
|
|
169
|
+
renderLabel() {
|
|
170
|
+
return html `<slot part="label" class="label"></slot>`;
|
|
171
|
+
}
|
|
172
|
+
renderEndIcon() {
|
|
173
|
+
return html `<slot name="end-icon" part="end-icon" class="end-icon">${this.endIcon
|
|
174
|
+
? html `<mdui-icon name="${this.endIcon}" class="i"></mdui-icon>`
|
|
175
|
+
: nothingTemplate}</slot>`;
|
|
176
|
+
}
|
|
177
|
+
renderDeleteIcon() {
|
|
178
|
+
if (!this.deletable) {
|
|
179
|
+
return nothingTemplate;
|
|
180
|
+
}
|
|
181
|
+
return html `<slot name="delete-icon" part="delete-icon" class="delete-icon" @click="${this.onDelete}">${this.deleteIcon
|
|
182
|
+
? html `<mdui-icon name="${this.deleteIcon}" class="i"></mdui-icon>`
|
|
183
|
+
: html `<mdui-icon-clear class="i"></mdui-icon-clear>`}</slot>`;
|
|
184
|
+
}
|
|
185
|
+
renderInner() {
|
|
186
|
+
return [
|
|
187
|
+
this.renderIcon(),
|
|
188
|
+
this.renderLabel(),
|
|
189
|
+
this.renderEndIcon(),
|
|
190
|
+
this.renderDeleteIcon(),
|
|
191
|
+
];
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
Chip.styles = [ButtonBase.styles, style];
|
|
195
|
+
__decorate([
|
|
196
|
+
property({ reflect: true })
|
|
197
|
+
], Chip.prototype, "variant", void 0);
|
|
198
|
+
__decorate([
|
|
199
|
+
property({
|
|
200
|
+
type: Boolean,
|
|
201
|
+
reflect: true,
|
|
202
|
+
converter: booleanConverter,
|
|
203
|
+
})
|
|
204
|
+
], Chip.prototype, "elevated", void 0);
|
|
205
|
+
__decorate([
|
|
206
|
+
property({
|
|
207
|
+
type: Boolean,
|
|
208
|
+
reflect: true,
|
|
209
|
+
converter: booleanConverter,
|
|
210
|
+
})
|
|
211
|
+
], Chip.prototype, "selectable", void 0);
|
|
212
|
+
__decorate([
|
|
213
|
+
property({
|
|
214
|
+
type: Boolean,
|
|
215
|
+
reflect: true,
|
|
216
|
+
converter: booleanConverter,
|
|
217
|
+
})
|
|
218
|
+
], Chip.prototype, "selected", void 0);
|
|
219
|
+
__decorate([
|
|
220
|
+
property({
|
|
221
|
+
type: Boolean,
|
|
222
|
+
reflect: true,
|
|
223
|
+
converter: booleanConverter,
|
|
224
|
+
})
|
|
225
|
+
], Chip.prototype, "deletable", void 0);
|
|
226
|
+
__decorate([
|
|
227
|
+
property({ reflect: true })
|
|
228
|
+
], Chip.prototype, "icon", void 0);
|
|
229
|
+
__decorate([
|
|
230
|
+
property({ reflect: true, attribute: 'selected-icon' })
|
|
231
|
+
], Chip.prototype, "selectedIcon", void 0);
|
|
232
|
+
__decorate([
|
|
233
|
+
property({ reflect: true, attribute: 'end-icon' })
|
|
234
|
+
], Chip.prototype, "endIcon", void 0);
|
|
235
|
+
__decorate([
|
|
236
|
+
property({ reflect: true, attribute: 'delete-icon' })
|
|
237
|
+
], Chip.prototype, "deleteIcon", void 0);
|
|
238
|
+
__decorate([
|
|
239
|
+
watch('selected', true)
|
|
240
|
+
], Chip.prototype, "onSelectedChange", null);
|
|
241
|
+
Chip = __decorate([
|
|
242
|
+
customElement('mdui-chip')
|
|
243
|
+
], Chip);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const style: import("lit").CSSResult;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const style = css `:host{--shape-corner:var(--mdui-shape-corner-small);position:relative;display:inline-block;overflow:hidden;border-radius:var(--shape-corner);cursor:pointer;-webkit-tap-highlight-color:transparent;transition:box-shadow var(--mdui-motion-duration-short4) var(--mdui-motion-easing-linear);height:2rem;background-color:rgb(var(--mdui-color-surface));border:.0625rem solid rgb(var(--mdui-color-outline));color:rgb(var(--mdui-color-on-surface-variant));font-size:var(--mdui-typescale-label-large-size);font-weight:var(--mdui-typescale-label-large-weight);letter-spacing:var(--mdui-typescale-label-large-tracking);line-height:var(--mdui-typescale-label-large-line-height);--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface-variant)}.button{padding-right:.4375rem;padding-left:.4375rem}:host([variant=input]) .button{padding-right:.1875rem;padding-left:.1875rem}:host([selected]) .button{padding-right:.5rem;padding-left:.5rem}:host([selected][variant=input]) .button{padding-right:.25rem;padding-left:.25rem}:host([elevated]) .button{padding-right:.5rem;padding-left:.5rem}:host([variant=assist]){color:rgb(var(--mdui-color-on-surface));--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface)}:host([elevated]){border-width:0;background-color:rgb(var(--mdui-color-surface-container-low));box-shadow:var(--mdui-elevation-level1)}:host([selected]){color:rgb(var(--mdui-color-on-secondary-container));background-color:rgb(var(--mdui-color-secondary-container));border-width:0;--mdui-comp-ripple-state-layer-color:var(
|
|
3
|
+
--mdui-color-on-secondary-container
|
|
4
|
+
)}:host([disabled]),:host([loading]){cursor:default;pointer-events:none}:host([disabled]){border-color:rgba(var(--mdui-color-on-surface),12%);color:rgba(var(--mdui-color-on-surface),38%);box-shadow:var(--mdui-elevation-level0)}:host([disabled][elevated]),:host([disabled][selected]){background-color:rgba(var(--mdui-color-on-surface),12%)}:host([selected][hover]){box-shadow:var(--mdui-elevation-level1)}:host([elevated][hover]){color:rgb(var(--mdui-color-on-secondary-container));box-shadow:var(--mdui-elevation-level2)}:host([variant=filter][hover]),:host([variant=input][hover]),:host([variant=suggestion][hover]){color:rgb(var(--mdui-color-on-surface-variant))}:host([variant=filter][focus-visible]),:host([variant=input][focus-visible]),:host([variant=suggestion][focus-visible]){border-color:rgb(var(--mdui-color-on-surface-variant))}:host([dragged]),:host([dragged][hover]){box-shadow:var(--mdui-elevation-level4)}.button{overflow:visible}.label{display:inline-flex;padding-right:.5rem;padding-left:.5rem}.end-icon,.icon,.selected-icon{display:inline-flex;font-size:1.28571429em;color:rgb(var(--mdui-color-on-surface-variant))}:host([variant=assist]) .end-icon,:host([variant=assist]) .icon,:host([variant=assist]) .selected-icon{color:rgb(var(--mdui-color-primary))}:host([selected]) .end-icon,:host([selected]) .icon,:host([selected]) .selected-icon{color:rgb(var(--mdui-color-on-secondary-container))}:host([disabled]) .end-icon,:host([disabled]) .icon,:host([disabled]) .selected-icon{opacity:.38;color:rgb(var(--mdui-color-on-surface))}.end-icon .i,.icon .i,.selected-icon .i,::slotted([slot=end-icon]),::slotted([slot=icon]),::slotted([slot=selected-icon]){font-size:inherit}:host([variant=input]) .has-icon .icon,:host([variant=input]) .has-icon .selected-icon,:host([variant=input]) .has-icon mdui-circular-progress{margin-left:.25rem}:host([variant=input]) .has-end-icon .end-icon{margin-right:.25rem}mdui-circular-progress{display:inline-flex;width:1.125rem;height:1.125rem}:host([disabled]) mdui-circular-progress{stroke:rgba(var(--mdui-color-on-surface),38%)}::slotted(mdui-avatar[slot=end-icon]),::slotted(mdui-avatar[slot=icon]),::slotted(mdui-avatar[slot=selected-icon]){width:1.5rem;height:1.5rem}:host([disabled]) ::slotted(mdui-avatar[slot=end-icon]),:host([disabled]) ::slotted(mdui-avatar[slot=icon]),:host([disabled]) ::slotted(mdui-avatar[slot=selected-icon]){opacity:.38}::slotted(mdui-avatar[slot=icon]),::slotted(mdui-avatar[slot=selected-icon]){margin-left:-.25rem;margin-right:-.125rem}::slotted(mdui-avatar[slot=end-icon]){margin-right:-.25rem;margin-left:-.125rem}.delete-icon{display:inline-flex;font-size:1.28571429em;transition:background-color var(--mdui-motion-duration-short4) var(--mdui-motion-easing-linear);border-radius:var(--mdui-shape-corner-full);margin-right:-.25rem;margin-left:-.25rem;padding:.25rem;color:rgb(var(--mdui-color-on-surface-variant))}.delete-icon:hover{background-color:rgba(var(--mdui-color-on-surface-variant),12%)}.has-end-icon .delete-icon{margin-left:.25rem}:host([variant=assiat]) .delete-icon{color:rgb(var(--mdui-color-primary))}:host([variant=input]) .delete-icon{margin-right:.0625rem}:host([disabled]) .delete-icon{color:rgba(var(--mdui-color-on-surface),38%)}.delete-icon .i,::slotted([slot=delete-icon]){font-size:inherit}::slotted(mdui-avatar[slot=delete-icon]){width:1.125rem;height:1.125rem}`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './chip/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './chip/index.js';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import type { CSSResultGroup, TemplateResult } from 'lit';
|
|
3
|
+
/**
|
|
4
|
+
* @summary 圆形进度指示器组件
|
|
5
|
+
*
|
|
6
|
+
* ```html
|
|
7
|
+
* <mdui-circular-progress></mdui-circular-progress>
|
|
8
|
+
* ```
|
|
9
|
+
*/
|
|
10
|
+
export declare class CircularProgress extends LitElement {
|
|
11
|
+
static styles: CSSResultGroup;
|
|
12
|
+
/**
|
|
13
|
+
* 进度指示器的最大值,默认为 1
|
|
14
|
+
*/
|
|
15
|
+
max: number;
|
|
16
|
+
/**
|
|
17
|
+
* 进度指示器的当前值。若未指定该值,则为不确定状态
|
|
18
|
+
*/
|
|
19
|
+
value?: number;
|
|
20
|
+
protected render(): TemplateResult;
|
|
21
|
+
private renderDeterminate;
|
|
22
|
+
private renderInDeterminate;
|
|
23
|
+
}
|
|
24
|
+
declare global {
|
|
25
|
+
interface HTMLElementTagNameMap {
|
|
26
|
+
'mdui-circular-progress': CircularProgress;
|
|
27
|
+
}
|
|
28
|
+
}
|