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,752 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html, LitElement } from 'lit';
|
|
3
|
+
import { customElement, property, state } from 'lit/decorators.js';
|
|
4
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
5
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
6
|
+
import { live } from 'lit/directives/live.js';
|
|
7
|
+
import { createRef, ref } from 'lit/directives/ref.js';
|
|
8
|
+
import { when } from 'lit/directives/when.js';
|
|
9
|
+
import { animate } from '@lit-labs/motion';
|
|
10
|
+
import { $ } from '@mdui/jq/$.js';
|
|
11
|
+
import '@mdui/jq/methods/css.js';
|
|
12
|
+
import { FormController, formResets } from '@mdui/shared/controllers/form.js';
|
|
13
|
+
import { HasSlotController } from '@mdui/shared/controllers/has-slot.js';
|
|
14
|
+
import { defaultValue } from '@mdui/shared/decorators/default-value.js';
|
|
15
|
+
import { watch } from '@mdui/shared/decorators/watch.js';
|
|
16
|
+
import { booleanConverter } from '@mdui/shared/helpers/decorator.js';
|
|
17
|
+
import { emit } from '@mdui/shared/helpers/event.js';
|
|
18
|
+
import { getDuration, getEasing } from '@mdui/shared/helpers/motion.js';
|
|
19
|
+
import { observeResize } from '@mdui/shared/helpers/observeResize.js';
|
|
20
|
+
import { nothingTemplate } from '@mdui/shared/helpers/template.js';
|
|
21
|
+
import '@mdui/shared/icons/cancel--outlined.js';
|
|
22
|
+
import '@mdui/shared/icons/error.js';
|
|
23
|
+
import '@mdui/shared/icons/visibility-off.js';
|
|
24
|
+
import '@mdui/shared/icons/visibility.js';
|
|
25
|
+
import { componentStyle } from '@mdui/shared/lit-styles/component-style.js';
|
|
26
|
+
import { FocusableMixin } from '@mdui/shared/mixins/focusable.js';
|
|
27
|
+
import '../button-icon.js';
|
|
28
|
+
import '../icon.js';
|
|
29
|
+
import { style } from './style.js';
|
|
30
|
+
/**
|
|
31
|
+
* @summary 文本框组件
|
|
32
|
+
*
|
|
33
|
+
* ```html
|
|
34
|
+
* <mdui-text-field label="Text Field"></mdui-text-field>
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* @event focus - 获得焦点时触发
|
|
38
|
+
* @event blur - 失去焦点时触发
|
|
39
|
+
* @event change - 在文本框的值变更,且失去焦点时触发
|
|
40
|
+
* @event input - 在文本框的值变更时触发
|
|
41
|
+
* @event invalid - 表单字段验证不通过时触发
|
|
42
|
+
* @event clear - 在点击由 `clearable` 属性生成的清空按钮时触发。可以通过调用 `event.preventDefault()` 阻止清空文本框
|
|
43
|
+
*
|
|
44
|
+
* @slot icon - 左侧图标
|
|
45
|
+
* @slot end-icon - 右侧图标
|
|
46
|
+
* @slot error-icon - 验证失败状态的右侧图标
|
|
47
|
+
* @slot prefix - 左侧文本
|
|
48
|
+
* @slot suffix - 右侧文本
|
|
49
|
+
* @slot clear-button - 清空按钮
|
|
50
|
+
* @slot clear-icon - 清空按钮中的图标
|
|
51
|
+
* @slot toggle-password-button - 显示密码状态下,密码显示切换按钮中的图标
|
|
52
|
+
* @slot show-password-icon - 显示密码状态下,密码显示切换按钮中的图标
|
|
53
|
+
* @slot hide-password-icon - 隐藏密码状态下,密码显示切换按钮中的图标
|
|
54
|
+
* @slot helper - 底部的帮助文本
|
|
55
|
+
*
|
|
56
|
+
* @csspart container - 文本框容器
|
|
57
|
+
* @csspart icon - 左侧图标
|
|
58
|
+
* @csspart end-icon - 右侧图标
|
|
59
|
+
* @csspart error-icon - 验证失败状态的右侧图标
|
|
60
|
+
* @csspart prefix - 左侧文本
|
|
61
|
+
* @csspart suffix - 右侧文本
|
|
62
|
+
* @csspart label - 上方的标签文本
|
|
63
|
+
* @csspart input - 内部的 `<input>` 或 `<textarea>` 元素
|
|
64
|
+
* @csspart clear-button - 清空按钮
|
|
65
|
+
* @csspart clear-icon - 清空按钮中的图标
|
|
66
|
+
* @csspart toggle-password-button - 密码显示切换按钮
|
|
67
|
+
* @csspart show-password-icon - 显示密码状态下,密码显示切换按钮中的图标
|
|
68
|
+
* @csspart hide-password-icon - 隐藏密码状态下,密码显示切换按钮中的图标
|
|
69
|
+
* @csspart supporting - 底部辅助信息容器,包括 helper、error、counter
|
|
70
|
+
* @csspart helper - 底部的帮助文本
|
|
71
|
+
* @csspart error - 底部的错误描述文本
|
|
72
|
+
* @csspart counter - 底部右侧的字数统计
|
|
73
|
+
*/
|
|
74
|
+
export let TextField = class TextField extends FocusableMixin(LitElement) {
|
|
75
|
+
constructor() {
|
|
76
|
+
super(...arguments);
|
|
77
|
+
/**
|
|
78
|
+
* 文本框形状。默认为 `filled`。可选值为:
|
|
79
|
+
*
|
|
80
|
+
* * `filled`:带背景色的文本框,视觉效果较强
|
|
81
|
+
* * `outlined`:带边框的文本框,视觉效果较弱
|
|
82
|
+
*/
|
|
83
|
+
this.variant = 'filled';
|
|
84
|
+
/**
|
|
85
|
+
* 文本框输入类型。默认为 `text`。可选值为:
|
|
86
|
+
*
|
|
87
|
+
* * `text`:默认值。文本字段
|
|
88
|
+
* * `number`:只能输入数字。拥有动态键盘的设备上会显示数字键盘
|
|
89
|
+
* * `password`:用于输入密码,其值会被遮盖
|
|
90
|
+
* * `url`:用于输入 URL,会验证 URL 格式。在支持动态键盘的设备上有相应的键盘
|
|
91
|
+
* * `email`:用于输入邮箱地址,会验证邮箱格式。在支持动态键盘的设备上有相应的键盘
|
|
92
|
+
* * `search`:用于搜索框。拥有动态键盘的设备上的回车图标会变成搜索图标
|
|
93
|
+
* * `tel`:用于输入电话号码。拥有动态键盘的设备上会显示电话数字键盘
|
|
94
|
+
* * `hidden`:隐藏该控件,但其值仍会提交到服务器
|
|
95
|
+
* * `date`:输入日期的控件(年、月、日,不包括时间)。在支持的浏览器激活时打开日期选择器或年月日的数字滚轮
|
|
96
|
+
* * `datetime-local`:输入日期和时间的控件,不包括时区。在支持的浏览器激活时打开日期选择器或年月日的数字滚轮
|
|
97
|
+
* * `month`:输入年和月的控件,没有时区
|
|
98
|
+
* * `time`:用于输入时间的控件,不包括时区
|
|
99
|
+
* * `week`:用于输入以年和周数组成的日期,不带时区
|
|
100
|
+
*/
|
|
101
|
+
this.type = 'text';
|
|
102
|
+
/**
|
|
103
|
+
* 文本框名称,将与表单数据一起提交
|
|
104
|
+
*/
|
|
105
|
+
this.name = '';
|
|
106
|
+
/**
|
|
107
|
+
* 文本框的值,将与表单数据一起提交
|
|
108
|
+
*/
|
|
109
|
+
this.value = '';
|
|
110
|
+
/**
|
|
111
|
+
* 默认值。在重置表单时,将重置为该默认值。该属性只能通过 JavaScript 属性设置
|
|
112
|
+
*/
|
|
113
|
+
this.defaultValue = '';
|
|
114
|
+
/**
|
|
115
|
+
* 是否仅在获得焦点时,显示底部帮助文本
|
|
116
|
+
*/
|
|
117
|
+
this.helperOnFocus = false;
|
|
118
|
+
/**
|
|
119
|
+
* 是否可清空文本框
|
|
120
|
+
*/
|
|
121
|
+
this.clearable = false;
|
|
122
|
+
/**
|
|
123
|
+
* 文本是否右对齐
|
|
124
|
+
*/
|
|
125
|
+
this.endAligned = false;
|
|
126
|
+
/**
|
|
127
|
+
* 是否为只读
|
|
128
|
+
*/
|
|
129
|
+
this.readonly = false;
|
|
130
|
+
/**
|
|
131
|
+
* 是否为禁用状态
|
|
132
|
+
*/
|
|
133
|
+
this.disabled = false;
|
|
134
|
+
/**
|
|
135
|
+
* 提交表单时,是否必须填写该字段
|
|
136
|
+
*/
|
|
137
|
+
this.required = false;
|
|
138
|
+
/**
|
|
139
|
+
* 是否根据输入的内容自动调整文本框高度
|
|
140
|
+
*/
|
|
141
|
+
this.autosize = false;
|
|
142
|
+
/**
|
|
143
|
+
* 是否显示字数统计。必须指定了 `maxlength` 时,该参数才有效
|
|
144
|
+
*/
|
|
145
|
+
this.counter = false;
|
|
146
|
+
/**
|
|
147
|
+
* `type` 为 `password` 时,设置该属性会添加一个切换按钮,点击时可在密文和明文之间切换
|
|
148
|
+
*/
|
|
149
|
+
this.togglePassword = false;
|
|
150
|
+
/**
|
|
151
|
+
* 启用拼写检查
|
|
152
|
+
*/
|
|
153
|
+
this.spellcheck = false;
|
|
154
|
+
/**
|
|
155
|
+
* 是否验证未通过
|
|
156
|
+
*
|
|
157
|
+
* 该验证为浏览器原生验证 API,基于 `type`、`required`、`minlength`、`maxlength` 及 `pattern` 等属性的验证结果
|
|
158
|
+
*/
|
|
159
|
+
this.invalid = false;
|
|
160
|
+
/**
|
|
161
|
+
* 该属性设置为 true 时,则在样式上为 text-field 赋予 invalid 的状态。实际是否验证通过仍需根据 invalid 属性判断
|
|
162
|
+
* 该属性仅供 mdui 内部使用,当前 select 组件使用了该属性
|
|
163
|
+
*/
|
|
164
|
+
this.invalidStyle = false;
|
|
165
|
+
/**
|
|
166
|
+
* 该属性设置为 true 时,则在样式上为 text-field 赋予聚焦状态。实际是否聚焦仍然由 focusableMixin 控制
|
|
167
|
+
* 该属性仅供 mdui 内部使用,当前 select 组件使用了该属性
|
|
168
|
+
*/
|
|
169
|
+
this.focusedStyle = false;
|
|
170
|
+
this.isPasswordVisible = false;
|
|
171
|
+
this.hasValue = false;
|
|
172
|
+
/**
|
|
173
|
+
* 通过该属性传入了错误文案时,会优先显示该文案。需要配合 invalid=true 或 invalidStyle=true 使用
|
|
174
|
+
* 当前仅供 select 组件使用
|
|
175
|
+
*/
|
|
176
|
+
this.error = '';
|
|
177
|
+
this.inputRef = createRef();
|
|
178
|
+
this.formController = new FormController(this);
|
|
179
|
+
this.hasSlotController = new HasSlotController(this, 'icon', 'end-icon', 'helper', 'input');
|
|
180
|
+
/**
|
|
181
|
+
* 该属性设为 true 时,即使设置了 readonly,仍可以显示 clearable
|
|
182
|
+
* 当前仅供 select 组件使用
|
|
183
|
+
*/
|
|
184
|
+
this.readonlyButClearable = false;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* 表单验证状态对象
|
|
188
|
+
*/
|
|
189
|
+
get validity() {
|
|
190
|
+
return this.inputRef.value.validity;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* 表单验证的错误提示信息
|
|
194
|
+
*/
|
|
195
|
+
get validationMessage() {
|
|
196
|
+
return this.inputRef.value.validationMessage;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* 获取当前值,并转换为 `number` 类型;或设置一个 `number` 类型的值。
|
|
200
|
+
* 如果值无法被转换为 `number` 类型,则会返回 `NaN`。
|
|
201
|
+
*/
|
|
202
|
+
get valueAsNumber() {
|
|
203
|
+
var _a, _b;
|
|
204
|
+
return ((_b = (_a = this.inputRef.value) === null || _a === void 0 ? void 0 : _a.valueAsNumber) !== null && _b !== void 0 ? _b : parseFloat(this.value));
|
|
205
|
+
}
|
|
206
|
+
set valueAsNumber(newValue) {
|
|
207
|
+
const input = document.createElement('input');
|
|
208
|
+
input.type = 'number';
|
|
209
|
+
input.valueAsNumber = newValue;
|
|
210
|
+
this.value = input.value;
|
|
211
|
+
}
|
|
212
|
+
get focusElement() {
|
|
213
|
+
return this.inputRef.value;
|
|
214
|
+
}
|
|
215
|
+
get focusDisabled() {
|
|
216
|
+
return this.disabled;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* 是否显示聚焦状态样式
|
|
220
|
+
*/
|
|
221
|
+
get isFocusedStyle() {
|
|
222
|
+
// @ts-ignore
|
|
223
|
+
return this.focused || this.focusedStyle;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* 是否渲染为 textarea。为 false 时渲染为 input
|
|
227
|
+
*/
|
|
228
|
+
get isTextarea() {
|
|
229
|
+
return (this.rows && this.rows > 1) || this.autosize;
|
|
230
|
+
}
|
|
231
|
+
onDisabledChange() {
|
|
232
|
+
// 禁用状态始终为验证通过,所以 disabled 变更时需要重新校验
|
|
233
|
+
this.inputRef.value.disabled = this.disabled;
|
|
234
|
+
this.invalid = !this.inputRef.value.checkValidity();
|
|
235
|
+
}
|
|
236
|
+
async onValueChange() {
|
|
237
|
+
var _a;
|
|
238
|
+
this.hasValue = !!this.value;
|
|
239
|
+
if (this.hasUpdated) {
|
|
240
|
+
await this.updateComplete;
|
|
241
|
+
// reset 引起的值变更,不执行验证;直接修改值引起的变更,需要进行验证
|
|
242
|
+
const form = this.formController.getForm();
|
|
243
|
+
if (form && ((_a = formResets.get(form)) === null || _a === void 0 ? void 0 : _a.has(this))) {
|
|
244
|
+
this.invalid = false;
|
|
245
|
+
formResets.get(form).delete(this);
|
|
246
|
+
}
|
|
247
|
+
else {
|
|
248
|
+
this.invalid = !this.inputRef.value.checkValidity();
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
onRowsChange() {
|
|
253
|
+
this.setTextareaHeight();
|
|
254
|
+
}
|
|
255
|
+
async onMaxRowsChange() {
|
|
256
|
+
if (!this.autosize) {
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
// 设置最大高度,为 line-height * maxRows + padding-top + padding-bottom
|
|
260
|
+
const setMaxHeight = () => {
|
|
261
|
+
var _a;
|
|
262
|
+
const $input = $(this.inputRef.value);
|
|
263
|
+
$input.css('max-height', parseFloat($input.css('line-height')) * ((_a = this.maxRows) !== null && _a !== void 0 ? _a : 1) +
|
|
264
|
+
parseFloat($input.css('padding-top')) +
|
|
265
|
+
parseFloat($input.css('padding-bottom')));
|
|
266
|
+
};
|
|
267
|
+
if (this.hasUpdated) {
|
|
268
|
+
setMaxHeight();
|
|
269
|
+
}
|
|
270
|
+
else {
|
|
271
|
+
await this.updateComplete;
|
|
272
|
+
setMaxHeight();
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
async onMinRowsChange() {
|
|
276
|
+
if (!this.autosize) {
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
// 设置最小高度,为 line-height * minRows + padding-top + padding-bottom
|
|
280
|
+
const setMinHeight = () => {
|
|
281
|
+
var _a;
|
|
282
|
+
const $input = $(this.inputRef.value);
|
|
283
|
+
$input.css('min-height', parseFloat($input.css('line-height')) * ((_a = this.minRows) !== null && _a !== void 0 ? _a : 1) +
|
|
284
|
+
parseFloat($input.css('padding-top')) +
|
|
285
|
+
parseFloat($input.css('padding-bottom')));
|
|
286
|
+
};
|
|
287
|
+
if (this.hasUpdated) {
|
|
288
|
+
setMinHeight();
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
await this.updateComplete;
|
|
292
|
+
setMinHeight();
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
connectedCallback() {
|
|
296
|
+
super.connectedCallback();
|
|
297
|
+
this.updateComplete.then(() => {
|
|
298
|
+
this.setTextareaHeight();
|
|
299
|
+
this.observeResize = observeResize(this.inputRef.value, () => this.setTextareaHeight());
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
disconnectedCallback() {
|
|
303
|
+
var _a;
|
|
304
|
+
super.disconnectedCallback();
|
|
305
|
+
(_a = this.observeResize) === null || _a === void 0 ? void 0 : _a.unobserve();
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* 选中文本框中的文本
|
|
309
|
+
*/
|
|
310
|
+
select() {
|
|
311
|
+
this.inputRef.value.select();
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* 选中文本框中特定范围的内容
|
|
315
|
+
*
|
|
316
|
+
* @param start 被选中的第一个字符的位置索引,从 `0` 开始。如果这个值比元素的 `value` 长度还大,则会被看作 `value` 最后一个位置的索引
|
|
317
|
+
* @param end 被选中的最后一个字符的*下一个*位置索引。如果这个值比元素的 `value` 长度还大,则会被看作 `value` 最后一个位置的索引
|
|
318
|
+
* @param direction 一个表示选择方向的字符串,可能的值有:`forward`、`backward`、`none`
|
|
319
|
+
*/
|
|
320
|
+
setSelectionRange(start, end, direction = 'none') {
|
|
321
|
+
this.inputRef.value.setSelectionRange(start, end, direction);
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* 把文本框中特定范围的文本替换成一个新的文本
|
|
325
|
+
* @param replacement 要插入的字符串
|
|
326
|
+
* @param start 要替换的字符的起止位置的索引。默认为当前用户选中的字符的起始位置的索引
|
|
327
|
+
* @param end 要替换的字符的结束位置的索引。默认为当前用户选中的字符的结束位置的索引
|
|
328
|
+
* @param selectMode 文本被替换后,选取的状态。可选值为:
|
|
329
|
+
* * `select`:选择新插入的文本
|
|
330
|
+
* * `start`:将光标移动到新插入的文本的起始位置
|
|
331
|
+
* * `end`:将光标移动到新插入的文本的结束位置
|
|
332
|
+
* * `preserve`:默认值。尝试保留选取
|
|
333
|
+
*/
|
|
334
|
+
setRangeText(replacement, start, end, selectMode = 'preserve') {
|
|
335
|
+
this.inputRef.value.setRangeText(replacement, start, end, selectMode);
|
|
336
|
+
if (this.value !== this.inputRef.value.value) {
|
|
337
|
+
this.value = this.inputRef.value.value;
|
|
338
|
+
this.setTextareaHeight();
|
|
339
|
+
emit(this, 'input');
|
|
340
|
+
emit(this, 'change');
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* 检查表单字段是否验证通过。若未通过则返回 `false`,并触发 `invalid` 事件;若验证通过,则返回 `true`
|
|
345
|
+
*/
|
|
346
|
+
checkValidity() {
|
|
347
|
+
const valid = this.inputRef.value.checkValidity();
|
|
348
|
+
if (!valid) {
|
|
349
|
+
emit(this, 'invalid', {
|
|
350
|
+
bubbles: false,
|
|
351
|
+
cancelable: true,
|
|
352
|
+
composed: false,
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
return valid;
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* 检查表单字段是否验证通过。若未通过则返回 `false`,并触发 `invalid` 事件;若验证通过,则返回 `true`。
|
|
359
|
+
*
|
|
360
|
+
* 验证未通过时,还将在组件上显示未通过的提示。
|
|
361
|
+
*/
|
|
362
|
+
reportValidity() {
|
|
363
|
+
this.invalid = !this.inputRef.value.reportValidity();
|
|
364
|
+
if (this.invalid) {
|
|
365
|
+
emit(this, 'invalid', {
|
|
366
|
+
bubbles: false,
|
|
367
|
+
cancelable: true,
|
|
368
|
+
composed: false,
|
|
369
|
+
});
|
|
370
|
+
this.focus();
|
|
371
|
+
}
|
|
372
|
+
return !this.invalid;
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* 设置自定义的错误提示文本。只要文本不为空,则表示字段验证未通过
|
|
376
|
+
*
|
|
377
|
+
* @param message 自定义的提示文本
|
|
378
|
+
*/
|
|
379
|
+
setCustomValidity(message) {
|
|
380
|
+
this.inputRef.value.setCustomValidity(message);
|
|
381
|
+
this.invalid = !this.inputRef.value.checkValidity();
|
|
382
|
+
}
|
|
383
|
+
render() {
|
|
384
|
+
const hasIcon = !!this.icon || this.hasSlotController.test('icon');
|
|
385
|
+
const hasEndIcon = !!this.endIcon || this.hasSlotController.test('end-icon');
|
|
386
|
+
const hasErrorIcon = this.invalid || this.invalidStyle;
|
|
387
|
+
const hasHelper = !!this.helper || this.hasSlotController.test('helper');
|
|
388
|
+
const hasError = hasErrorIcon && !!(this.error || this.inputRef.value.validationMessage);
|
|
389
|
+
const hasCounter = this.counter && !!this.maxlength;
|
|
390
|
+
// 存在 input slot 时,隐藏组件内部的 .input 元素,使用 slot 代替
|
|
391
|
+
const hasInputSlot = this.hasSlotController.test('input');
|
|
392
|
+
const className = classMap({
|
|
393
|
+
container: true,
|
|
394
|
+
'has-value': this.hasValue,
|
|
395
|
+
'has-icon': hasIcon,
|
|
396
|
+
'has-end-icon': hasEndIcon,
|
|
397
|
+
'has-error-icon': hasErrorIcon,
|
|
398
|
+
'is-firefox': navigator.userAgent.includes('Firefox'),
|
|
399
|
+
});
|
|
400
|
+
return html `<div part="container" class="${className}">${this.renderPrefix()}<div class="input-container">${this.renderLabel()} ${this.isTextarea
|
|
401
|
+
? this.renderTextArea(hasInputSlot)
|
|
402
|
+
: this.renderInput(hasInputSlot)} ${when(hasInputSlot, () => html `<slot name="input" class="input"></slot>`)}</div>${this.renderClearButton()}${this.renderTogglePasswordButton()} ${this.renderSuffix(hasErrorIcon)}</div>${when(hasError || hasHelper || hasCounter, () => html `<div part="supporting" class="supporting">${this.renderHelper(hasError, hasHelper)} ${this.renderCounter(hasCounter)}</div>`)}`;
|
|
403
|
+
}
|
|
404
|
+
onChange() {
|
|
405
|
+
this.value = this.inputRef.value.value;
|
|
406
|
+
if (this.isTextarea) {
|
|
407
|
+
this.setTextareaHeight();
|
|
408
|
+
}
|
|
409
|
+
emit(this, 'change');
|
|
410
|
+
}
|
|
411
|
+
onClear(event) {
|
|
412
|
+
this.value = '';
|
|
413
|
+
emit(this, 'clear');
|
|
414
|
+
emit(this, 'input');
|
|
415
|
+
emit(this, 'change');
|
|
416
|
+
this.focus();
|
|
417
|
+
event.stopPropagation();
|
|
418
|
+
}
|
|
419
|
+
onInput() {
|
|
420
|
+
this.value = this.inputRef.value.value;
|
|
421
|
+
if (this.isTextarea) {
|
|
422
|
+
this.setTextareaHeight();
|
|
423
|
+
}
|
|
424
|
+
emit(this, 'input');
|
|
425
|
+
}
|
|
426
|
+
onInvalid(event) {
|
|
427
|
+
event.preventDefault();
|
|
428
|
+
}
|
|
429
|
+
onKeyDown(event) {
|
|
430
|
+
const hasModifier = event.metaKey || event.ctrlKey || event.shiftKey || event.altKey;
|
|
431
|
+
// 聚焦状态按下回车时,提交表单。可以在 keydown 事件中使用 event.preventDefault() 来取消提交表单
|
|
432
|
+
if (event.key === 'Enter' && !hasModifier) {
|
|
433
|
+
setTimeout(() => {
|
|
434
|
+
if (!event.defaultPrevented) {
|
|
435
|
+
this.formController.submit();
|
|
436
|
+
}
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* textarea 不支持 pattern 属性,所以在 keyup 时执行验证
|
|
442
|
+
*/
|
|
443
|
+
onTextAreaKeyUp() {
|
|
444
|
+
if (this.pattern) {
|
|
445
|
+
const patternRegex = new RegExp(this.pattern);
|
|
446
|
+
const hasError = this.value && !this.value.match(patternRegex);
|
|
447
|
+
this.setCustomValidity(hasError ? '请与请求的格式匹配。' : '');
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
onTogglePassword() {
|
|
451
|
+
this.isPasswordVisible = !this.isPasswordVisible;
|
|
452
|
+
}
|
|
453
|
+
setTextareaHeight() {
|
|
454
|
+
if (this.autosize) {
|
|
455
|
+
this.inputRef.value.style.height = 'auto';
|
|
456
|
+
this.inputRef.value.style.height = `${this.inputRef.value.scrollHeight}px`;
|
|
457
|
+
}
|
|
458
|
+
else {
|
|
459
|
+
this.inputRef.value.style.height = undefined;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
renderLabel() {
|
|
463
|
+
return this.label
|
|
464
|
+
? html `<label part="label" class="label" ${animate({
|
|
465
|
+
keyframeOptions: {
|
|
466
|
+
duration: getDuration(this, 'short4'),
|
|
467
|
+
easing: getEasing(this, 'standard'),
|
|
468
|
+
},
|
|
469
|
+
})}>${this.label}</label>`
|
|
470
|
+
: nothingTemplate;
|
|
471
|
+
}
|
|
472
|
+
renderPrefix() {
|
|
473
|
+
return html `<slot name="icon" part="icon" class="icon">${this.icon
|
|
474
|
+
? html `<mdui-icon name="${this.icon}" class="i"></mdui-icon>`
|
|
475
|
+
: nothingTemplate}</slot><slot name="prefix" part="prefix" class="prefix">${this.prefix}</slot>`;
|
|
476
|
+
}
|
|
477
|
+
renderSuffix(hasErrorIcon) {
|
|
478
|
+
return html `<slot name="suffix" part="suffix" class="suffix">${this.suffix}</slot>${hasErrorIcon
|
|
479
|
+
? html `<slot name="error-icon" part="error-icon" class="right-icon">${this.errorIcon
|
|
480
|
+
? html `<mdui-icon name="${this.errorIcon}" class="i"></mdui-icon>`
|
|
481
|
+
: html `<mdui-icon-error class="i"></mdui-icon-error>`}</slot>`
|
|
482
|
+
: html `<slot name="end-icon" part="end-icon" class="end-icon right-icon">${this.endIcon
|
|
483
|
+
? html `<mdui-icon name="${this.endIcon}" class="i"></mdui-icon>`
|
|
484
|
+
: nothingTemplate}</slot>`}`;
|
|
485
|
+
}
|
|
486
|
+
renderClearButton() {
|
|
487
|
+
const hasClearButton = this.clearable &&
|
|
488
|
+
!this.disabled &&
|
|
489
|
+
(!this.readonly || this.readonlyButClearable) &&
|
|
490
|
+
(typeof this.value === 'number' || this.value.length > 0);
|
|
491
|
+
return when(hasClearButton, () => html `<slot name="clear-button" part="clear-button" class="right-icon" @click="${this.onClear}"><mdui-button-icon tabindex="-1"><slot name="clear-icon" part="clear-icon">${this.clearIcon
|
|
492
|
+
? html `<mdui-icon name="${this.clearIcon}" class="i"></mdui-icon>`
|
|
493
|
+
: html `<mdui-icon-cancel--outlined class="i"></mdui-icon-cancel--outlined>`}</slot></mdui-button-icon></slot>`);
|
|
494
|
+
}
|
|
495
|
+
renderTogglePasswordButton() {
|
|
496
|
+
const hasTogglePasswordButton = this.type === 'password' && this.togglePassword && !this.disabled;
|
|
497
|
+
return when(hasTogglePasswordButton, () => html `<slot name="toggle-password-button" part="toggle-password-button" class="right-icon" @click="${this.onTogglePassword}"><mdui-button-icon tabindex="-1">${this.isPasswordVisible
|
|
498
|
+
? html `<slot name="show-password-icon" part="show-password-icon">${this.showPasswordIcon
|
|
499
|
+
? html `<mdui-icon name="${this.showPasswordIcon}" class="i"></mdui-icon>`
|
|
500
|
+
: html `<mdui-icon-visibility-off class="i"></mdui-icon-visibility-off>`}</slot>`
|
|
501
|
+
: html `<slot name="hide-password-icon" part="hide-password-icon">${this.hidePasswordIcon
|
|
502
|
+
? html `<mdui-icon name="${this.hidePasswordIcon}" class="i"></mdui-icon>`
|
|
503
|
+
: html `<mdui-icon-visibility class="i"></mdui-icon-visibility>`}</slot>`}</mdui-button-icon></slot>`);
|
|
504
|
+
}
|
|
505
|
+
renderInput(hasInputSlot) {
|
|
506
|
+
return html `<input ${ref(this.inputRef)} part="input" class="input ${classMap({ 'hide-input': hasInputSlot })}" type="${this.type === 'password' && this.isPasswordVisible
|
|
507
|
+
? 'text'
|
|
508
|
+
: this.type}" name="${ifDefined(this.name)}" .value="${live(this.value)}" placeholder="${ifDefined(
|
|
509
|
+
// @ts-ignore
|
|
510
|
+
!this.label || this.isFocusedStyle || this.hasValue
|
|
511
|
+
? this.placeholder
|
|
512
|
+
: undefined)}" ?readonly="${this.readonly}" ?disabled="${this.disabled}" ?required="${this.required}" minlength="${ifDefined(this.minlength)}" maxlength="${ifDefined(this.maxlength)}" min="${ifDefined(this.min)}" max="${ifDefined(this.max)}" step="${ifDefined(this.step)}" autocapitalize="${ifDefined(this.type === 'password' ? 'off' : this.autocapitalize)}" autocomplete="${ifDefined(this.type === 'password' ? 'off' : this.autocomplete)}" autocorrect="${ifDefined(this.type === 'password' ? 'off' : this.autocorrect)}" spellcheck="${ifDefined(this.spellcheck)}" pattern="${ifDefined(this.pattern)}" enterkeyhint="${ifDefined(this.enterkeyhint)}" inputmode="${ifDefined(this.inputmode)}" @change="${this.onChange}" @input="${this.onInput}" @invalid="${this.onInvalid}" @keydown="${this.onKeyDown}">`;
|
|
513
|
+
}
|
|
514
|
+
renderTextArea(hasInputSlot) {
|
|
515
|
+
var _a;
|
|
516
|
+
return html `<textarea ${ref(this.inputRef)} part="input" class="input ${classMap({ 'hide-input': hasInputSlot })}" name="${ifDefined(this.name)}" .value="${live(this.value)}" placeholder="${ifDefined(
|
|
517
|
+
// @ts-ignore
|
|
518
|
+
!this.label || this.isFocusedStyle || this.hasValue
|
|
519
|
+
? this.placeholder
|
|
520
|
+
: undefined)}" ?readonly="${this.readonly}" ?disabled="${this.disabled}" ?required="${this.required}" minlength="${ifDefined(this.minlength)}" maxlength="${ifDefined(this.maxlength)}" rows="${(_a = this.rows) !== null && _a !== void 0 ? _a : 1}" autocapitalize="${ifDefined(this.autocapitalize)}" autocorrect="${ifDefined(this.autocorrect)}" spellcheck="${ifDefined(this.spellcheck)}" enterkeyhint="${ifDefined(this.enterkeyhint)}" inputmode="${ifDefined(this.inputmode)}" @change="${this.onChange}" @input="${this.onInput}" @invalid="${this.onInvalid}" @keydown="${this.onKeyDown}" @keyup="${this.onTextAreaKeyUp}"></textarea>`;
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* @param hasError 是否包含错误提示
|
|
524
|
+
* @param hasHelper 是否含 helper 属性或 helper slot
|
|
525
|
+
*/
|
|
526
|
+
renderHelper(hasError, hasHelper) {
|
|
527
|
+
return hasError
|
|
528
|
+
? html `<div part="error" class="error">${this.error || this.inputRef.value.validationMessage}</div>`
|
|
529
|
+
: hasHelper
|
|
530
|
+
? html `<slot name="helper" part="helper" class="helper">${this.helper}</slot>`
|
|
531
|
+
: // 右边有 counter,需要占位
|
|
532
|
+
html `<span></span>`;
|
|
533
|
+
}
|
|
534
|
+
renderCounter(hasCounter) {
|
|
535
|
+
return hasCounter
|
|
536
|
+
? html `<div part="counter" class="counter">${this.value.length}/${this.maxlength}</div>`
|
|
537
|
+
: nothingTemplate;
|
|
538
|
+
}
|
|
539
|
+
};
|
|
540
|
+
TextField.styles = [componentStyle, style];
|
|
541
|
+
__decorate([
|
|
542
|
+
property({ reflect: true })
|
|
543
|
+
], TextField.prototype, "variant", void 0);
|
|
544
|
+
__decorate([
|
|
545
|
+
property({ reflect: true })
|
|
546
|
+
], TextField.prototype, "type", void 0);
|
|
547
|
+
__decorate([
|
|
548
|
+
property({ reflect: true })
|
|
549
|
+
], TextField.prototype, "name", void 0);
|
|
550
|
+
__decorate([
|
|
551
|
+
property()
|
|
552
|
+
], TextField.prototype, "value", void 0);
|
|
553
|
+
__decorate([
|
|
554
|
+
defaultValue()
|
|
555
|
+
], TextField.prototype, "defaultValue", void 0);
|
|
556
|
+
__decorate([
|
|
557
|
+
property({ reflect: true })
|
|
558
|
+
], TextField.prototype, "label", void 0);
|
|
559
|
+
__decorate([
|
|
560
|
+
property({ reflect: true })
|
|
561
|
+
], TextField.prototype, "placeholder", void 0);
|
|
562
|
+
__decorate([
|
|
563
|
+
property({ reflect: true })
|
|
564
|
+
], TextField.prototype, "helper", void 0);
|
|
565
|
+
__decorate([
|
|
566
|
+
property({
|
|
567
|
+
type: Boolean,
|
|
568
|
+
reflect: true,
|
|
569
|
+
converter: booleanConverter,
|
|
570
|
+
attribute: 'helper-on-focus',
|
|
571
|
+
})
|
|
572
|
+
], TextField.prototype, "helperOnFocus", void 0);
|
|
573
|
+
__decorate([
|
|
574
|
+
property({
|
|
575
|
+
type: Boolean,
|
|
576
|
+
reflect: true,
|
|
577
|
+
converter: booleanConverter,
|
|
578
|
+
})
|
|
579
|
+
], TextField.prototype, "clearable", void 0);
|
|
580
|
+
__decorate([
|
|
581
|
+
property({ reflect: true, attribute: 'clear-icon' })
|
|
582
|
+
], TextField.prototype, "clearIcon", void 0);
|
|
583
|
+
__decorate([
|
|
584
|
+
property({
|
|
585
|
+
type: Boolean,
|
|
586
|
+
reflect: true,
|
|
587
|
+
converter: booleanConverter,
|
|
588
|
+
attribute: 'end-aligned',
|
|
589
|
+
})
|
|
590
|
+
], TextField.prototype, "endAligned", void 0);
|
|
591
|
+
__decorate([
|
|
592
|
+
property({ reflect: true })
|
|
593
|
+
], TextField.prototype, "prefix", void 0);
|
|
594
|
+
__decorate([
|
|
595
|
+
property({ reflect: true })
|
|
596
|
+
], TextField.prototype, "suffix", void 0);
|
|
597
|
+
__decorate([
|
|
598
|
+
property({ reflect: true })
|
|
599
|
+
], TextField.prototype, "icon", void 0);
|
|
600
|
+
__decorate([
|
|
601
|
+
property({ reflect: true, attribute: 'end-icon' })
|
|
602
|
+
], TextField.prototype, "endIcon", void 0);
|
|
603
|
+
__decorate([
|
|
604
|
+
property({ reflect: true, attribute: 'error-icon' })
|
|
605
|
+
], TextField.prototype, "errorIcon", void 0);
|
|
606
|
+
__decorate([
|
|
607
|
+
property({ reflect: true })
|
|
608
|
+
], TextField.prototype, "form", void 0);
|
|
609
|
+
__decorate([
|
|
610
|
+
property({
|
|
611
|
+
type: Boolean,
|
|
612
|
+
reflect: true,
|
|
613
|
+
converter: booleanConverter,
|
|
614
|
+
})
|
|
615
|
+
], TextField.prototype, "readonly", void 0);
|
|
616
|
+
__decorate([
|
|
617
|
+
property({
|
|
618
|
+
type: Boolean,
|
|
619
|
+
reflect: true,
|
|
620
|
+
converter: booleanConverter,
|
|
621
|
+
})
|
|
622
|
+
], TextField.prototype, "disabled", void 0);
|
|
623
|
+
__decorate([
|
|
624
|
+
property({
|
|
625
|
+
type: Boolean,
|
|
626
|
+
reflect: true,
|
|
627
|
+
converter: booleanConverter,
|
|
628
|
+
})
|
|
629
|
+
], TextField.prototype, "required", void 0);
|
|
630
|
+
__decorate([
|
|
631
|
+
property({ type: Number, reflect: true })
|
|
632
|
+
], TextField.prototype, "rows", void 0);
|
|
633
|
+
__decorate([
|
|
634
|
+
property({
|
|
635
|
+
type: Boolean,
|
|
636
|
+
reflect: true,
|
|
637
|
+
converter: booleanConverter,
|
|
638
|
+
})
|
|
639
|
+
], TextField.prototype, "autosize", void 0);
|
|
640
|
+
__decorate([
|
|
641
|
+
property({ type: Number, reflect: true, attribute: 'min-rows' })
|
|
642
|
+
], TextField.prototype, "minRows", void 0);
|
|
643
|
+
__decorate([
|
|
644
|
+
property({ type: Number, reflect: true, attribute: 'max-rows' })
|
|
645
|
+
], TextField.prototype, "maxRows", void 0);
|
|
646
|
+
__decorate([
|
|
647
|
+
property({ type: Number, reflect: true })
|
|
648
|
+
], TextField.prototype, "minlength", void 0);
|
|
649
|
+
__decorate([
|
|
650
|
+
property({ type: Number, reflect: true })
|
|
651
|
+
], TextField.prototype, "maxlength", void 0);
|
|
652
|
+
__decorate([
|
|
653
|
+
property({
|
|
654
|
+
type: Boolean,
|
|
655
|
+
reflect: true,
|
|
656
|
+
converter: booleanConverter,
|
|
657
|
+
})
|
|
658
|
+
], TextField.prototype, "counter", void 0);
|
|
659
|
+
__decorate([
|
|
660
|
+
property({ type: Number, reflect: true })
|
|
661
|
+
], TextField.prototype, "min", void 0);
|
|
662
|
+
__decorate([
|
|
663
|
+
property({ type: Number, reflect: true })
|
|
664
|
+
], TextField.prototype, "max", void 0);
|
|
665
|
+
__decorate([
|
|
666
|
+
property({ type: Number, reflect: true })
|
|
667
|
+
], TextField.prototype, "step", void 0);
|
|
668
|
+
__decorate([
|
|
669
|
+
property({ reflect: true })
|
|
670
|
+
], TextField.prototype, "pattern", void 0);
|
|
671
|
+
__decorate([
|
|
672
|
+
property({
|
|
673
|
+
type: Boolean,
|
|
674
|
+
reflect: true,
|
|
675
|
+
converter: booleanConverter,
|
|
676
|
+
attribute: 'toggle-password',
|
|
677
|
+
})
|
|
678
|
+
], TextField.prototype, "togglePassword", void 0);
|
|
679
|
+
__decorate([
|
|
680
|
+
property({ reflect: true, attribute: 'show-password-icon' })
|
|
681
|
+
], TextField.prototype, "showPasswordIcon", void 0);
|
|
682
|
+
__decorate([
|
|
683
|
+
property({ reflect: true, attribute: 'hide-password-icon' })
|
|
684
|
+
], TextField.prototype, "hidePasswordIcon", void 0);
|
|
685
|
+
__decorate([
|
|
686
|
+
property({ reflect: true })
|
|
687
|
+
], TextField.prototype, "autocapitalize", void 0);
|
|
688
|
+
__decorate([
|
|
689
|
+
property({ reflect: true })
|
|
690
|
+
], TextField.prototype, "autocorrect", void 0);
|
|
691
|
+
__decorate([
|
|
692
|
+
property({ reflect: true })
|
|
693
|
+
], TextField.prototype, "autocomplete", void 0);
|
|
694
|
+
__decorate([
|
|
695
|
+
property({ reflect: true })
|
|
696
|
+
], TextField.prototype, "enterkeyhint", void 0);
|
|
697
|
+
__decorate([
|
|
698
|
+
property({ type: Boolean, reflect: true, converter: booleanConverter })
|
|
699
|
+
], TextField.prototype, "spellcheck", void 0);
|
|
700
|
+
__decorate([
|
|
701
|
+
property({ reflect: true })
|
|
702
|
+
], TextField.prototype, "inputmode", void 0);
|
|
703
|
+
__decorate([
|
|
704
|
+
property({
|
|
705
|
+
type: Boolean,
|
|
706
|
+
reflect: true,
|
|
707
|
+
converter: booleanConverter,
|
|
708
|
+
})
|
|
709
|
+
], TextField.prototype, "invalid", void 0);
|
|
710
|
+
__decorate([
|
|
711
|
+
property({
|
|
712
|
+
type: Boolean,
|
|
713
|
+
reflect: true,
|
|
714
|
+
converter: booleanConverter,
|
|
715
|
+
attribute: 'invalid-style',
|
|
716
|
+
})
|
|
717
|
+
], TextField.prototype, "invalidStyle", void 0);
|
|
718
|
+
__decorate([
|
|
719
|
+
property({
|
|
720
|
+
type: Boolean,
|
|
721
|
+
reflect: true,
|
|
722
|
+
converter: booleanConverter,
|
|
723
|
+
attribute: 'focused-style',
|
|
724
|
+
})
|
|
725
|
+
], TextField.prototype, "focusedStyle", void 0);
|
|
726
|
+
__decorate([
|
|
727
|
+
state()
|
|
728
|
+
], TextField.prototype, "isPasswordVisible", void 0);
|
|
729
|
+
__decorate([
|
|
730
|
+
state()
|
|
731
|
+
], TextField.prototype, "hasValue", void 0);
|
|
732
|
+
__decorate([
|
|
733
|
+
state()
|
|
734
|
+
], TextField.prototype, "error", void 0);
|
|
735
|
+
__decorate([
|
|
736
|
+
watch('disabled', true)
|
|
737
|
+
], TextField.prototype, "onDisabledChange", null);
|
|
738
|
+
__decorate([
|
|
739
|
+
watch('value')
|
|
740
|
+
], TextField.prototype, "onValueChange", null);
|
|
741
|
+
__decorate([
|
|
742
|
+
watch('rows', true)
|
|
743
|
+
], TextField.prototype, "onRowsChange", null);
|
|
744
|
+
__decorate([
|
|
745
|
+
watch('maxRows')
|
|
746
|
+
], TextField.prototype, "onMaxRowsChange", null);
|
|
747
|
+
__decorate([
|
|
748
|
+
watch('minRows')
|
|
749
|
+
], TextField.prototype, "onMinRowsChange", null);
|
|
750
|
+
TextField = __decorate([
|
|
751
|
+
customElement('mdui-text-field')
|
|
752
|
+
], TextField);
|