@tuya-miniapp/smart-ui 0.0.1-beta-1
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +23 -0
- package/README.md +68 -0
- package/dist/action-sheet/index.css +1 -0
- package/dist/action-sheet/index.d.ts +1 -0
- package/dist/action-sheet/index.js +101 -0
- package/dist/action-sheet/index.json +8 -0
- package/dist/action-sheet/index.wxml +84 -0
- package/dist/action-sheet/index.wxss +1 -0
- package/dist/area/index.css +1 -0
- package/dist/area/index.d.ts +1 -0
- package/dist/area/index.js +220 -0
- package/dist/area/index.json +6 -0
- package/dist/area/index.wxml +20 -0
- package/dist/area/index.wxs +8 -0
- package/dist/area/index.wxss +1 -0
- package/dist/battery/index.d.ts +1 -0
- package/dist/battery/index.js +108 -0
- package/dist/battery/index.json +4 -0
- package/dist/battery/index.wxml +1 -0
- package/dist/button/index.css +1 -0
- package/dist/button/index.d.ts +1 -0
- package/dist/button/index.js +65 -0
- package/dist/button/index.json +7 -0
- package/dist/button/index.wxml +64 -0
- package/dist/button/index.wxs +39 -0
- package/dist/button/index.wxss +1 -0
- package/dist/calendar/calendar.wxml +70 -0
- package/dist/calendar/components/header/index.css +1 -0
- package/dist/calendar/components/header/index.d.ts +1 -0
- package/dist/calendar/components/header/index.js +37 -0
- package/dist/calendar/components/header/index.json +3 -0
- package/dist/calendar/components/header/index.wxml +16 -0
- package/dist/calendar/components/header/index.wxss +1 -0
- package/dist/calendar/components/month/index.css +1 -0
- package/dist/calendar/components/month/index.d.ts +6 -0
- package/dist/calendar/components/month/index.js +154 -0
- package/dist/calendar/components/month/index.json +3 -0
- package/dist/calendar/components/month/index.wxml +39 -0
- package/dist/calendar/components/month/index.wxs +71 -0
- package/dist/calendar/components/month/index.wxss +1 -0
- package/dist/calendar/index.css +1 -0
- package/dist/calendar/index.d.ts +1 -0
- package/dist/calendar/index.js +360 -0
- package/dist/calendar/index.json +10 -0
- package/dist/calendar/index.wxml +27 -0
- package/dist/calendar/index.wxs +37 -0
- package/dist/calendar/index.wxss +1 -0
- package/dist/calendar/utils.d.ts +12 -0
- package/dist/calendar/utils.js +83 -0
- package/dist/calendar/utils.wxs +25 -0
- package/dist/cascader/index.css +1 -0
- package/dist/cascader/index.d.ts +1 -0
- package/dist/cascader/index.js +182 -0
- package/dist/cascader/index.json +8 -0
- package/dist/cascader/index.wxml +54 -0
- package/dist/cascader/index.wxs +21 -0
- package/dist/cascader/index.wxss +1 -0
- package/dist/cell/index.css +1 -0
- package/dist/cell/index.d.ts +1 -0
- package/dist/cell/index.js +49 -0
- package/dist/cell/index.json +6 -0
- package/dist/cell/index.wxml +47 -0
- package/dist/cell/index.wxs +17 -0
- package/dist/cell/index.wxss +1 -0
- package/dist/cell-group/index.css +1 -0
- package/dist/cell-group/index.d.ts +1 -0
- package/dist/cell-group/index.js +11 -0
- package/dist/cell-group/index.json +3 -0
- package/dist/cell-group/index.wxml +11 -0
- package/dist/cell-group/index.wxss +1 -0
- package/dist/checkbox/index.css +1 -0
- package/dist/checkbox/index.d.ts +1 -0
- package/dist/checkbox/index.js +79 -0
- package/dist/checkbox/index.json +6 -0
- package/dist/checkbox/index.wxml +32 -0
- package/dist/checkbox/index.wxs +20 -0
- package/dist/checkbox/index.wxss +1 -0
- package/dist/checkbox-group/index.css +1 -0
- package/dist/checkbox-group/index.d.ts +1 -0
- package/dist/checkbox-group/index.js +36 -0
- package/dist/checkbox-group/index.json +3 -0
- package/dist/checkbox-group/index.wxml +5 -0
- package/dist/checkbox-group/index.wxss +1 -0
- package/dist/circle/index.css +1 -0
- package/dist/circle/index.d.ts +1 -0
- package/dist/circle/index.js +46 -0
- package/dist/circle/index.json +3 -0
- package/dist/circle/index.wxml +13 -0
- package/dist/circle/index.wxss +1 -0
- package/dist/col/index.css +1 -0
- package/dist/col/index.d.ts +1 -0
- package/dist/col/index.js +9 -0
- package/dist/col/index.json +3 -0
- package/dist/col/index.wxml +9 -0
- package/dist/col/index.wxs +18 -0
- package/dist/col/index.wxss +1 -0
- package/dist/collapse/index.css +1 -0
- package/dist/collapse/index.d.ts +1 -0
- package/dist/collapse/index.js +46 -0
- package/dist/collapse/index.json +3 -0
- package/dist/collapse/index.wxml +3 -0
- package/dist/collapse/index.wxss +1 -0
- package/dist/collapse-item/animate.d.ts +2 -0
- package/dist/collapse-item/animate.js +39 -0
- package/dist/collapse-item/index.css +1 -0
- package/dist/collapse-item/index.d.ts +1 -0
- package/dist/collapse-item/index.js +60 -0
- package/dist/collapse-item/index.json +6 -0
- package/dist/collapse-item/index.wxml +45 -0
- package/dist/collapse-item/index.wxss +1 -0
- package/dist/common/color.d.ts +7 -0
- package/dist/common/color.js +7 -0
- package/dist/common/component.d.ts +4 -0
- package/dist/common/component.js +46 -0
- package/dist/common/index.css +1 -0
- package/dist/common/index.wxss +1 -0
- package/dist/common/relation.d.ts +15 -0
- package/dist/common/relation.js +56 -0
- package/dist/common/style/clearfix.css +1 -0
- package/dist/common/style/clearfix.wxss +1 -0
- package/dist/common/style/ellipsis.css +1 -0
- package/dist/common/style/ellipsis.wxss +1 -0
- package/dist/common/style/hairline.css +1 -0
- package/dist/common/style/hairline.wxss +1 -0
- package/dist/common/style/mixins/clearfix.css +0 -0
- package/dist/common/style/mixins/clearfix.wxss +0 -0
- package/dist/common/style/mixins/ellipsis.css +0 -0
- package/dist/common/style/mixins/ellipsis.wxss +0 -0
- package/dist/common/style/mixins/hairline.css +0 -0
- package/dist/common/style/mixins/hairline.wxss +0 -0
- package/dist/common/style/var.css +0 -0
- package/dist/common/style/var.wxss +0 -0
- package/dist/common/utils.d.ts +21 -0
- package/dist/common/utils.js +86 -0
- package/dist/common/validator.d.ts +9 -0
- package/dist/common/validator.js +31 -0
- package/dist/common/version.d.ts +15 -0
- package/dist/common/version.js +59 -0
- package/dist/config-provider/index.d.ts +1 -0
- package/dist/config-provider/index.js +9 -0
- package/dist/config-provider/index.json +3 -0
- package/dist/config-provider/index.wxml +5 -0
- package/dist/config-provider/index.wxs +29 -0
- package/dist/count-down/index.css +1 -0
- package/dist/count-down/index.d.ts +1 -0
- package/dist/count-down/index.js +100 -0
- package/dist/count-down/index.json +3 -0
- package/dist/count-down/index.wxml +4 -0
- package/dist/count-down/index.wxss +1 -0
- package/dist/count-down/utils.d.ts +10 -0
- package/dist/count-down/utils.js +57 -0
- package/dist/custom-keyboard/index.css +1 -0
- package/dist/custom-keyboard/index.d.ts +1 -0
- package/dist/custom-keyboard/index.js +164 -0
- package/dist/custom-keyboard/index.json +9 -0
- package/dist/custom-keyboard/index.wxml +48 -0
- package/dist/custom-keyboard/index.wxss +1 -0
- package/dist/datetime-picker/index.css +1 -0
- package/dist/datetime-picker/index.d.ts +1 -0
- package/dist/datetime-picker/index.js +298 -0
- package/dist/datetime-picker/index.json +6 -0
- package/dist/datetime-picker/index.wxml +16 -0
- package/dist/datetime-picker/index.wxss +1 -0
- package/dist/definitions/index.d.ts +28 -0
- package/dist/definitions/index.js +1 -0
- package/dist/dialog/dialog.d.ts +60 -0
- package/dist/dialog/dialog.js +83 -0
- package/dist/dialog/index.css +1 -0
- package/dist/dialog/index.d.ts +1 -0
- package/dist/dialog/index.js +147 -0
- package/dist/dialog/index.json +10 -0
- package/dist/dialog/index.wxml +135 -0
- package/dist/dialog/index.wxss +1 -0
- package/dist/divider/index.css +1 -0
- package/dist/divider/index.d.ts +1 -0
- package/dist/divider/index.js +12 -0
- package/dist/divider/index.json +4 -0
- package/dist/divider/index.wxml +9 -0
- package/dist/divider/index.wxs +18 -0
- package/dist/divider/index.wxss +1 -0
- package/dist/dropdown-item/index.css +1 -0
- package/dist/dropdown-item/index.d.ts +1 -0
- package/dist/dropdown-item/index.js +130 -0
- package/dist/dropdown-item/index.json +8 -0
- package/dist/dropdown-item/index.wxml +50 -0
- package/dist/dropdown-item/index.wxss +1 -0
- package/dist/dropdown-item/shared.d.ts +5 -0
- package/dist/dropdown-item/shared.js +1 -0
- package/dist/dropdown-menu/index.css +1 -0
- package/dist/dropdown-menu/index.d.ts +1 -0
- package/dist/dropdown-menu/index.js +117 -0
- package/dist/dropdown-menu/index.json +3 -0
- package/dist/dropdown-menu/index.wxml +23 -0
- package/dist/dropdown-menu/index.wxs +16 -0
- package/dist/dropdown-menu/index.wxss +1 -0
- package/dist/empty/index.css +1 -0
- package/dist/empty/index.d.ts +1 -0
- package/dist/empty/index.js +10 -0
- package/dist/empty/index.json +4 -0
- package/dist/empty/index.wxml +22 -0
- package/dist/empty/index.wxs +25 -0
- package/dist/empty/index.wxss +1 -0
- package/dist/field/index.css +1 -0
- package/dist/field/index.d.ts +1 -0
- package/dist/field/index.js +126 -0
- package/dist/field/index.json +7 -0
- package/dist/field/index.wxml +56 -0
- package/dist/field/index.wxs +18 -0
- package/dist/field/index.wxss +1 -0
- package/dist/field/input.wxml +31 -0
- package/dist/field/props.d.ts +4 -0
- package/dist/field/props.js +64 -0
- package/dist/field/textarea.wxml +32 -0
- package/dist/field/types.d.ts +8 -0
- package/dist/field/types.js +1 -0
- package/dist/goods-action/index.css +1 -0
- package/dist/goods-action/index.d.ts +1 -0
- package/dist/goods-action/index.js +15 -0
- package/dist/goods-action/index.json +3 -0
- package/dist/goods-action/index.wxml +5 -0
- package/dist/goods-action/index.wxss +1 -0
- package/dist/goods-action-button/index.css +1 -0
- package/dist/goods-action-button/index.d.ts +1 -0
- package/dist/goods-action-button/index.js +44 -0
- package/dist/goods-action-button/index.json +6 -0
- package/dist/goods-action-button/index.wxml +35 -0
- package/dist/goods-action-button/index.wxss +1 -0
- package/dist/goods-action-icon/index.css +1 -0
- package/dist/goods-action-icon/index.d.ts +1 -0
- package/dist/goods-action-icon/index.js +27 -0
- package/dist/goods-action-icon/index.json +7 -0
- package/dist/goods-action-icon/index.wxml +41 -0
- package/dist/goods-action-icon/index.wxss +1 -0
- package/dist/grid/index.css +1 -0
- package/dist/grid/index.d.ts +1 -0
- package/dist/grid/index.js +55 -0
- package/dist/grid/index.json +3 -0
- package/dist/grid/index.wxml +8 -0
- package/dist/grid/index.wxs +13 -0
- package/dist/grid/index.wxss +1 -0
- package/dist/grid-item/index.css +1 -0
- package/dist/grid-item/index.d.ts +1 -0
- package/dist/grid-item/index.js +52 -0
- package/dist/grid-item/index.json +6 -0
- package/dist/grid-item/index.wxml +27 -0
- package/dist/grid-item/index.wxs +32 -0
- package/dist/grid-item/index.wxss +1 -0
- package/dist/icon/index.css +1 -0
- package/dist/icon/index.d.ts +1 -0
- package/dist/icon/index.js +21 -0
- package/dist/icon/index.json +6 -0
- package/dist/icon/index.wxml +25 -0
- package/dist/icon/index.wxs +75 -0
- package/dist/icon/index.wxss +1 -0
- package/dist/image/index.css +1 -0
- package/dist/image/index.d.ts +1 -0
- package/dist/image/index.js +64 -0
- package/dist/image/index.json +7 -0
- package/dist/image/index.wxml +35 -0
- package/dist/image/index.wxs +32 -0
- package/dist/image/index.wxss +1 -0
- package/dist/index-anchor/index.css +1 -0
- package/dist/index-anchor/index.d.ts +1 -0
- package/dist/index-anchor/index.js +25 -0
- package/dist/index-anchor/index.json +3 -0
- package/dist/index-anchor/index.wxml +14 -0
- package/dist/index-anchor/index.wxss +1 -0
- package/dist/index-bar/index.css +1 -0
- package/dist/index-bar/index.d.ts +1 -0
- package/dist/index-bar/index.js +246 -0
- package/dist/index-bar/index.json +3 -0
- package/dist/index-bar/index.wxml +22 -0
- package/dist/index-bar/index.wxss +1 -0
- package/dist/info/index.css +1 -0
- package/dist/info/index.d.ts +1 -0
- package/dist/info/index.js +8 -0
- package/dist/info/index.json +3 -0
- package/dist/info/index.wxml +7 -0
- package/dist/info/index.wxss +1 -0
- package/dist/loading/index.css +1 -0
- package/dist/loading/index.d.ts +1 -0
- package/dist/loading/index.js +16 -0
- package/dist/loading/index.json +3 -0
- package/dist/loading/index.wxml +19 -0
- package/dist/loading/index.wxs +22 -0
- package/dist/loading/index.wxss +1 -0
- package/dist/mixins/basic.d.ts +1 -0
- package/dist/mixins/basic.js +11 -0
- package/dist/mixins/button.d.ts +1 -0
- package/dist/mixins/button.js +51 -0
- package/dist/mixins/link.d.ts +1 -0
- package/dist/mixins/link.js +23 -0
- package/dist/mixins/page-scroll.d.ts +6 -0
- package/dist/mixins/page-scroll.js +42 -0
- package/dist/mixins/touch.d.ts +1 -0
- package/dist/mixins/touch.js +37 -0
- package/dist/mixins/transition.d.ts +1 -0
- package/dist/mixins/transition.js +129 -0
- package/dist/nav-bar/index.css +1 -0
- package/dist/nav-bar/index.d.ts +1 -0
- package/dist/nav-bar/index.js +67 -0
- package/dist/nav-bar/index.json +6 -0
- package/dist/nav-bar/index.wxml +43 -0
- package/dist/nav-bar/index.wxs +13 -0
- package/dist/nav-bar/index.wxss +1 -0
- package/dist/normal-slider/index.css +1 -0
- package/dist/normal-slider/index.d.ts +1 -0
- package/dist/normal-slider/index.js +158 -0
- package/dist/normal-slider/index.json +6 -0
- package/dist/normal-slider/index.wxml +35 -0
- package/dist/normal-slider/index.wxss +1 -0
- package/dist/notice-bar/index.css +1 -0
- package/dist/notice-bar/index.d.ts +1 -0
- package/dist/notice-bar/index.js +120 -0
- package/dist/notice-bar/index.json +6 -0
- package/dist/notice-bar/index.wxml +38 -0
- package/dist/notice-bar/index.wxs +15 -0
- package/dist/notice-bar/index.wxss +1 -0
- package/dist/notify/index.css +1 -0
- package/dist/notify/index.d.ts +1 -0
- package/dist/notify/index.js +65 -0
- package/dist/notify/index.json +6 -0
- package/dist/notify/index.wxml +21 -0
- package/dist/notify/index.wxs +22 -0
- package/dist/notify/index.wxss +1 -0
- package/dist/notify/notify.d.ts +22 -0
- package/dist/notify/notify.js +53 -0
- package/dist/overlay/index.css +1 -0
- package/dist/overlay/index.d.ts +1 -0
- package/dist/overlay/index.js +30 -0
- package/dist/overlay/index.json +6 -0
- package/dist/overlay/index.wxml +7 -0
- package/dist/overlay/index.wxss +1 -0
- package/dist/overlay/overlay.wxml +10 -0
- package/dist/picker/index.css +1 -0
- package/dist/picker/index.d.ts +1 -0
- package/dist/picker/index.js +142 -0
- package/dist/picker/index.json +7 -0
- package/dist/picker/index.wxml +39 -0
- package/dist/picker/index.wxs +42 -0
- package/dist/picker/index.wxss +1 -0
- package/dist/picker/shared.d.ts +21 -0
- package/dist/picker/shared.js +21 -0
- package/dist/picker/toolbar.wxml +23 -0
- package/dist/picker-column/index.css +1 -0
- package/dist/picker-column/index.d.ts +1 -0
- package/dist/picker-column/index.js +199 -0
- package/dist/picker-column/index.json +3 -0
- package/dist/picker-column/index.wxml +32 -0
- package/dist/picker-column/index.wxs +59 -0
- package/dist/picker-column/index.wxss +1 -0
- package/dist/popup/index.css +1 -0
- package/dist/popup/index.d.ts +1 -0
- package/dist/popup/index.js +103 -0
- package/dist/popup/index.json +7 -0
- package/dist/popup/index.wxml +21 -0
- package/dist/popup/index.wxs +18 -0
- package/dist/popup/index.wxss +1 -0
- package/dist/popup/popup.wxml +17 -0
- package/dist/progress/index.css +1 -0
- package/dist/progress/index.d.ts +1 -0
- package/dist/progress/index.js +51 -0
- package/dist/progress/index.json +3 -0
- package/dist/progress/index.wxml +20 -0
- package/dist/progress/index.wxs +36 -0
- package/dist/progress/index.wxss +1 -0
- package/dist/radio/index.css +1 -0
- package/dist/radio/index.d.ts +1 -0
- package/dist/radio/index.js +66 -0
- package/dist/radio/index.json +6 -0
- package/dist/radio/index.wxml +30 -0
- package/dist/radio/index.wxs +33 -0
- package/dist/radio/index.wxss +1 -0
- package/dist/radio-group/index.css +1 -0
- package/dist/radio-group/index.d.ts +1 -0
- package/dist/radio-group/index.js +22 -0
- package/dist/radio-group/index.json +3 -0
- package/dist/radio-group/index.wxml +5 -0
- package/dist/radio-group/index.wxss +1 -0
- package/dist/rate/index.css +1 -0
- package/dist/rate/index.d.ts +1 -0
- package/dist/rate/index.js +89 -0
- package/dist/rate/index.json +6 -0
- package/dist/rate/index.wxml +35 -0
- package/dist/rate/index.wxss +1 -0
- package/dist/row/index.css +1 -0
- package/dist/row/index.d.ts +1 -0
- package/dist/row/index.js +23 -0
- package/dist/row/index.json +3 -0
- package/dist/row/index.wxml +5 -0
- package/dist/row/index.wxs +18 -0
- package/dist/row/index.wxss +1 -0
- package/dist/search/index.css +1 -0
- package/dist/search/index.d.ts +1 -0
- package/dist/search/index.js +96 -0
- package/dist/search/index.json +6 -0
- package/dist/search/index.wxml +54 -0
- package/dist/search/index.wxss +1 -0
- package/dist/sidebar/index.css +1 -0
- package/dist/sidebar/index.d.ts +1 -0
- package/dist/sidebar/index.js +34 -0
- package/dist/sidebar/index.json +3 -0
- package/dist/sidebar/index.wxml +3 -0
- package/dist/sidebar/index.wxss +1 -0
- package/dist/sidebar-item/index.css +1 -0
- package/dist/sidebar-item/index.d.ts +1 -0
- package/dist/sidebar-item/index.js +29 -0
- package/dist/sidebar-item/index.json +6 -0
- package/dist/sidebar-item/index.wxml +18 -0
- package/dist/sidebar-item/index.wxss +1 -0
- package/dist/skeleton/index.css +1 -0
- package/dist/skeleton/index.d.ts +1 -0
- package/dist/skeleton/index.js +46 -0
- package/dist/skeleton/index.json +4 -0
- package/dist/skeleton/index.wxml +29 -0
- package/dist/skeleton/index.wxss +1 -0
- package/dist/slider/index.css +1 -0
- package/dist/slider/index.d.ts +1 -0
- package/dist/slider/index.js +210 -0
- package/dist/slider/index.json +3 -0
- package/dist/slider/index.wxml +68 -0
- package/dist/slider/index.wxs +14 -0
- package/dist/slider/index.wxss +1 -0
- package/dist/stepper/index.css +1 -0
- package/dist/stepper/index.d.ts +1 -0
- package/dist/stepper/index.js +183 -0
- package/dist/stepper/index.json +3 -0
- package/dist/stepper/index.wxml +43 -0
- package/dist/stepper/index.wxs +22 -0
- package/dist/stepper/index.wxss +1 -0
- package/dist/steps/index.css +1 -0
- package/dist/steps/index.d.ts +1 -0
- package/dist/steps/index.js +34 -0
- package/dist/steps/index.json +6 -0
- package/dist/steps/index.wxml +54 -0
- package/dist/steps/index.wxss +1 -0
- package/dist/sticky/index.css +1 -0
- package/dist/sticky/index.d.ts +1 -0
- package/dist/sticky/index.js +120 -0
- package/dist/sticky/index.json +3 -0
- package/dist/sticky/index.wxml +8 -0
- package/dist/sticky/index.wxs +25 -0
- package/dist/sticky/index.wxss +1 -0
- package/dist/swipe-cell/index.css +1 -0
- package/dist/swipe-cell/index.d.ts +1 -0
- package/dist/swipe-cell/index.js +133 -0
- package/dist/swipe-cell/index.json +3 -0
- package/dist/swipe-cell/index.wxml +21 -0
- package/dist/swipe-cell/index.wxss +1 -0
- package/dist/switch/index.css +1 -0
- package/dist/switch/index.d.ts +1 -0
- package/dist/switch/index.js +36 -0
- package/dist/switch/index.json +6 -0
- package/dist/switch/index.wxml +16 -0
- package/dist/switch/index.wxs +26 -0
- package/dist/switch/index.wxss +1 -0
- package/dist/tab/index.css +1 -0
- package/dist/tab/index.d.ts +1 -0
- package/dist/tab/index.js +56 -0
- package/dist/tab/index.json +3 -0
- package/dist/tab/index.wxml +8 -0
- package/dist/tab/index.wxss +1 -0
- package/dist/tabbar/index.css +1 -0
- package/dist/tabbar/index.d.ts +1 -0
- package/dist/tabbar/index.js +66 -0
- package/dist/tabbar/index.json +3 -0
- package/dist/tabbar/index.wxml +10 -0
- package/dist/tabbar/index.wxss +1 -0
- package/dist/tabbar-item/index.css +1 -0
- package/dist/tabbar-item/index.d.ts +1 -0
- package/dist/tabbar-item/index.js +68 -0
- package/dist/tabbar-item/index.json +7 -0
- package/dist/tabbar-item/index.wxml +29 -0
- package/dist/tabbar-item/index.wxss +1 -0
- package/dist/tabs/index.css +1 -0
- package/dist/tabs/index.d.ts +1 -0
- package/dist/tabs/index.js +302 -0
- package/dist/tabs/index.json +7 -0
- package/dist/tabs/index.wxml +63 -0
- package/dist/tabs/index.wxs +83 -0
- package/dist/tabs/index.wxss +1 -0
- package/dist/tag/index.css +1 -0
- package/dist/tag/index.d.ts +1 -0
- package/dist/tag/index.js +29 -0
- package/dist/tag/index.json +6 -0
- package/dist/tag/index.wxml +17 -0
- package/dist/tag/index.wxs +13 -0
- package/dist/tag/index.wxss +1 -0
- package/dist/toast/index.css +1 -0
- package/dist/toast/index.d.ts +1 -0
- package/dist/toast/index.js +35 -0
- package/dist/toast/index.json +9 -0
- package/dist/toast/index.wxml +36 -0
- package/dist/toast/index.wxss +1 -0
- package/dist/toast/toast.d.ts +28 -0
- package/dist/toast/toast.js +68 -0
- package/dist/transition/index.css +1 -0
- package/dist/transition/index.d.ts +1 -0
- package/dist/transition/index.js +13 -0
- package/dist/transition/index.json +3 -0
- package/dist/transition/index.wxml +10 -0
- package/dist/transition/index.wxs +17 -0
- package/dist/transition/index.wxss +1 -0
- package/dist/tree-select/index.css +1 -0
- package/dist/tree-select/index.d.ts +1 -0
- package/dist/tree-select/index.js +69 -0
- package/dist/tree-select/index.json +8 -0
- package/dist/tree-select/index.wxml +41 -0
- package/dist/tree-select/index.wxs +12 -0
- package/dist/tree-select/index.wxss +1 -0
- package/dist/wxs/add-unit.wxs +12 -0
- package/dist/wxs/array.wxs +5 -0
- package/dist/wxs/bem.wxs +39 -0
- package/dist/wxs/memoize.wxs +55 -0
- package/dist/wxs/object.wxs +13 -0
- package/dist/wxs/style.wxs +42 -0
- package/dist/wxs/utils.wxs +10 -0
- package/lib/action-sheet/index.css +1 -0
- package/lib/action-sheet/index.d.ts +1 -0
- package/lib/action-sheet/index.js +107 -0
- package/lib/action-sheet/index.json +8 -0
- package/lib/action-sheet/index.wxml +84 -0
- package/lib/action-sheet/index.wxss +1 -0
- package/lib/area/index.css +1 -0
- package/lib/area/index.d.ts +1 -0
- package/lib/area/index.js +235 -0
- package/lib/area/index.json +6 -0
- package/lib/area/index.wxml +20 -0
- package/lib/area/index.wxs +8 -0
- package/lib/area/index.wxss +1 -0
- package/lib/battery/index.d.ts +1 -0
- package/lib/battery/index.js +103 -0
- package/lib/battery/index.json +4 -0
- package/lib/battery/index.wxml +1 -0
- package/lib/button/index.css +1 -0
- package/lib/button/index.d.ts +1 -0
- package/lib/button/index.js +68 -0
- package/lib/button/index.json +7 -0
- package/lib/button/index.wxml +64 -0
- package/lib/button/index.wxs +39 -0
- package/lib/button/index.wxss +1 -0
- package/lib/calendar/calendar.wxml +70 -0
- package/lib/calendar/components/header/index.css +1 -0
- package/lib/calendar/components/header/index.d.ts +1 -0
- package/lib/calendar/components/header/index.js +45 -0
- package/lib/calendar/components/header/index.json +3 -0
- package/lib/calendar/components/header/index.wxml +16 -0
- package/lib/calendar/components/header/index.wxss +1 -0
- package/lib/calendar/components/month/index.css +1 -0
- package/lib/calendar/components/month/index.d.ts +6 -0
- package/lib/calendar/components/month/index.js +158 -0
- package/lib/calendar/components/month/index.json +3 -0
- package/lib/calendar/components/month/index.wxml +39 -0
- package/lib/calendar/components/month/index.wxs +71 -0
- package/lib/calendar/components/month/index.wxss +1 -0
- package/lib/calendar/index.css +1 -0
- package/lib/calendar/index.d.ts +1 -0
- package/lib/calendar/index.js +383 -0
- package/lib/calendar/index.json +10 -0
- package/lib/calendar/index.wxml +27 -0
- package/lib/calendar/index.wxs +37 -0
- package/lib/calendar/index.wxss +1 -0
- package/lib/calendar/utils.d.ts +12 -0
- package/lib/calendar/utils.js +97 -0
- package/lib/calendar/utils.wxs +25 -0
- package/lib/cascader/index.css +1 -0
- package/lib/cascader/index.d.ts +1 -0
- package/lib/cascader/index.js +198 -0
- package/lib/cascader/index.json +8 -0
- package/lib/cascader/index.wxml +54 -0
- package/lib/cascader/index.wxs +21 -0
- package/lib/cascader/index.wxss +1 -0
- package/lib/cell/index.css +1 -0
- package/lib/cell/index.d.ts +1 -0
- package/lib/cell/index.js +54 -0
- package/lib/cell/index.json +6 -0
- package/lib/cell/index.wxml +47 -0
- package/lib/cell/index.wxs +17 -0
- package/lib/cell/index.wxss +1 -0
- package/lib/cell-group/index.css +1 -0
- package/lib/cell-group/index.d.ts +1 -0
- package/lib/cell-group/index.js +13 -0
- package/lib/cell-group/index.json +3 -0
- package/lib/cell-group/index.wxml +11 -0
- package/lib/cell-group/index.wxss +1 -0
- package/lib/checkbox/index.css +1 -0
- package/lib/checkbox/index.d.ts +1 -0
- package/lib/checkbox/index.js +84 -0
- package/lib/checkbox/index.json +6 -0
- package/lib/checkbox/index.wxml +32 -0
- package/lib/checkbox/index.wxs +20 -0
- package/lib/checkbox/index.wxss +1 -0
- package/lib/checkbox-group/index.css +1 -0
- package/lib/checkbox-group/index.d.ts +1 -0
- package/lib/checkbox-group/index.js +39 -0
- package/lib/checkbox-group/index.json +3 -0
- package/lib/checkbox-group/index.wxml +5 -0
- package/lib/checkbox-group/index.wxss +1 -0
- package/lib/circle/index.css +1 -0
- package/lib/circle/index.d.ts +1 -0
- package/lib/circle/index.js +48 -0
- package/lib/circle/index.json +3 -0
- package/lib/circle/index.wxml +13 -0
- package/lib/circle/index.wxss +1 -0
- package/lib/col/index.css +1 -0
- package/lib/col/index.d.ts +1 -0
- package/lib/col/index.js +11 -0
- package/lib/col/index.json +3 -0
- package/lib/col/index.wxml +9 -0
- package/lib/col/index.wxs +18 -0
- package/lib/col/index.wxss +1 -0
- package/lib/collapse/index.css +1 -0
- package/lib/collapse/index.d.ts +1 -0
- package/lib/collapse/index.js +48 -0
- package/lib/collapse/index.json +3 -0
- package/lib/collapse/index.wxml +3 -0
- package/lib/collapse/index.wxss +1 -0
- package/lib/collapse-item/animate.d.ts +2 -0
- package/lib/collapse-item/animate.js +43 -0
- package/lib/collapse-item/index.css +1 -0
- package/lib/collapse-item/index.d.ts +1 -0
- package/lib/collapse-item/index.js +62 -0
- package/lib/collapse-item/index.json +6 -0
- package/lib/collapse-item/index.wxml +45 -0
- package/lib/collapse-item/index.wxss +1 -0
- package/lib/common/color.d.ts +7 -0
- package/lib/common/color.js +10 -0
- package/lib/common/component.d.ts +4 -0
- package/lib/common/component.js +49 -0
- package/lib/common/index.css +1 -0
- package/lib/common/index.wxss +1 -0
- package/lib/common/relation.d.ts +15 -0
- package/lib/common/relation.js +65 -0
- package/lib/common/style/clearfix.css +1 -0
- package/lib/common/style/clearfix.wxss +1 -0
- package/lib/common/style/ellipsis.css +1 -0
- package/lib/common/style/ellipsis.wxss +1 -0
- package/lib/common/style/hairline.css +1 -0
- package/lib/common/style/hairline.wxss +1 -0
- package/lib/common/style/mixins/clearfix.css +0 -0
- package/lib/common/style/mixins/clearfix.wxss +0 -0
- package/lib/common/style/mixins/ellipsis.css +0 -0
- package/lib/common/style/mixins/ellipsis.wxss +0 -0
- package/lib/common/style/mixins/hairline.css +0 -0
- package/lib/common/style/mixins/hairline.wxss +0 -0
- package/lib/common/style/var.css +0 -0
- package/lib/common/style/var.wxss +0 -0
- package/lib/common/utils.d.ts +21 -0
- package/lib/common/utils.js +109 -0
- package/lib/common/validator.d.ts +9 -0
- package/lib/common/validator.js +43 -0
- package/lib/common/version.d.ts +15 -0
- package/lib/common/version.js +70 -0
- package/lib/config-provider/index.d.ts +1 -0
- package/lib/config-provider/index.js +11 -0
- package/lib/config-provider/index.json +3 -0
- package/lib/config-provider/index.wxml +5 -0
- package/lib/config-provider/index.wxs +29 -0
- package/lib/count-down/index.css +1 -0
- package/lib/count-down/index.d.ts +1 -0
- package/lib/count-down/index.js +104 -0
- package/lib/count-down/index.json +3 -0
- package/lib/count-down/index.wxml +4 -0
- package/lib/count-down/index.wxss +1 -0
- package/lib/count-down/utils.d.ts +10 -0
- package/lib/count-down/utils.js +64 -0
- package/lib/custom-keyboard/index.css +1 -0
- package/lib/custom-keyboard/index.d.ts +1 -0
- package/lib/custom-keyboard/index.js +158 -0
- package/lib/custom-keyboard/index.json +9 -0
- package/lib/custom-keyboard/index.wxml +48 -0
- package/lib/custom-keyboard/index.wxss +1 -0
- package/lib/datetime-picker/index.css +1 -0
- package/lib/datetime-picker/index.d.ts +1 -0
- package/lib/datetime-picker/index.js +332 -0
- package/lib/datetime-picker/index.json +6 -0
- package/lib/datetime-picker/index.wxml +16 -0
- package/lib/datetime-picker/index.wxss +1 -0
- package/lib/definitions/index.d.ts +28 -0
- package/lib/definitions/index.js +2 -0
- package/lib/dialog/dialog.d.ts +60 -0
- package/lib/dialog/dialog.js +100 -0
- package/lib/dialog/index.css +1 -0
- package/lib/dialog/index.d.ts +1 -0
- package/lib/dialog/index.js +155 -0
- package/lib/dialog/index.json +10 -0
- package/lib/dialog/index.wxml +135 -0
- package/lib/dialog/index.wxss +1 -0
- package/lib/divider/index.css +1 -0
- package/lib/divider/index.d.ts +1 -0
- package/lib/divider/index.js +14 -0
- package/lib/divider/index.json +4 -0
- package/lib/divider/index.wxml +9 -0
- package/lib/divider/index.wxs +18 -0
- package/lib/divider/index.wxss +1 -0
- package/lib/dropdown-item/index.css +1 -0
- package/lib/dropdown-item/index.d.ts +1 -0
- package/lib/dropdown-item/index.js +136 -0
- package/lib/dropdown-item/index.json +8 -0
- package/lib/dropdown-item/index.wxml +50 -0
- package/lib/dropdown-item/index.wxss +1 -0
- package/lib/dropdown-item/shared.d.ts +5 -0
- package/lib/dropdown-item/shared.js +2 -0
- package/lib/dropdown-menu/index.css +1 -0
- package/lib/dropdown-menu/index.d.ts +1 -0
- package/lib/dropdown-menu/index.js +122 -0
- package/lib/dropdown-menu/index.json +3 -0
- package/lib/dropdown-menu/index.wxml +23 -0
- package/lib/dropdown-menu/index.wxs +16 -0
- package/lib/dropdown-menu/index.wxss +1 -0
- package/lib/empty/index.css +1 -0
- package/lib/empty/index.d.ts +1 -0
- package/lib/empty/index.js +12 -0
- package/lib/empty/index.json +4 -0
- package/lib/empty/index.wxml +22 -0
- package/lib/empty/index.wxs +25 -0
- package/lib/empty/index.wxss +1 -0
- package/lib/field/index.css +1 -0
- package/lib/field/index.d.ts +1 -0
- package/lib/field/index.js +140 -0
- package/lib/field/index.json +7 -0
- package/lib/field/index.wxml +56 -0
- package/lib/field/index.wxs +18 -0
- package/lib/field/index.wxss +1 -0
- package/lib/field/input.wxml +31 -0
- package/lib/field/props.d.ts +4 -0
- package/lib/field/props.js +67 -0
- package/lib/field/textarea.wxml +32 -0
- package/lib/field/types.d.ts +8 -0
- package/lib/field/types.js +2 -0
- package/lib/goods-action/index.css +1 -0
- package/lib/goods-action/index.d.ts +1 -0
- package/lib/goods-action/index.js +17 -0
- package/lib/goods-action/index.json +3 -0
- package/lib/goods-action/index.wxml +5 -0
- package/lib/goods-action/index.wxss +1 -0
- package/lib/goods-action-button/index.css +1 -0
- package/lib/goods-action-button/index.d.ts +1 -0
- package/lib/goods-action-button/index.js +46 -0
- package/lib/goods-action-button/index.json +6 -0
- package/lib/goods-action-button/index.wxml +35 -0
- package/lib/goods-action-button/index.wxss +1 -0
- package/lib/goods-action-icon/index.css +1 -0
- package/lib/goods-action-icon/index.d.ts +1 -0
- package/lib/goods-action-icon/index.js +29 -0
- package/lib/goods-action-icon/index.json +7 -0
- package/lib/goods-action-icon/index.wxml +41 -0
- package/lib/goods-action-icon/index.wxss +1 -0
- package/lib/grid/index.css +1 -0
- package/lib/grid/index.d.ts +1 -0
- package/lib/grid/index.js +57 -0
- package/lib/grid/index.json +3 -0
- package/lib/grid/index.wxml +8 -0
- package/lib/grid/index.wxs +13 -0
- package/lib/grid/index.wxss +1 -0
- package/lib/grid-item/index.css +1 -0
- package/lib/grid-item/index.d.ts +1 -0
- package/lib/grid-item/index.js +54 -0
- package/lib/grid-item/index.json +6 -0
- package/lib/grid-item/index.wxml +27 -0
- package/lib/grid-item/index.wxs +32 -0
- package/lib/grid-item/index.wxss +1 -0
- package/lib/icon/index.css +1 -0
- package/lib/icon/index.d.ts +1 -0
- package/lib/icon/index.js +23 -0
- package/lib/icon/index.json +6 -0
- package/lib/icon/index.wxml +25 -0
- package/lib/icon/index.wxs +75 -0
- package/lib/icon/index.wxss +1 -0
- package/lib/image/index.css +1 -0
- package/lib/image/index.d.ts +1 -0
- package/lib/image/index.js +66 -0
- package/lib/image/index.json +7 -0
- package/lib/image/index.wxml +35 -0
- package/lib/image/index.wxs +32 -0
- package/lib/image/index.wxss +1 -0
- package/lib/index-anchor/index.css +1 -0
- package/lib/index-anchor/index.d.ts +1 -0
- package/lib/index-anchor/index.js +28 -0
- package/lib/index-anchor/index.json +3 -0
- package/lib/index-anchor/index.wxml +14 -0
- package/lib/index-anchor/index.wxss +1 -0
- package/lib/index-bar/index.css +1 -0
- package/lib/index-bar/index.d.ts +1 -0
- package/lib/index-bar/index.js +243 -0
- package/lib/index-bar/index.json +3 -0
- package/lib/index-bar/index.wxml +22 -0
- package/lib/index-bar/index.wxss +1 -0
- package/lib/info/index.css +1 -0
- package/lib/info/index.d.ts +1 -0
- package/lib/info/index.js +10 -0
- package/lib/info/index.json +3 -0
- package/lib/info/index.wxml +7 -0
- package/lib/info/index.wxss +1 -0
- package/lib/loading/index.css +1 -0
- package/lib/loading/index.d.ts +1 -0
- package/lib/loading/index.js +18 -0
- package/lib/loading/index.json +3 -0
- package/lib/loading/index.wxml +19 -0
- package/lib/loading/index.wxs +22 -0
- package/lib/loading/index.wxss +1 -0
- package/lib/mixins/basic.d.ts +1 -0
- package/lib/mixins/basic.js +14 -0
- package/lib/mixins/button.d.ts +1 -0
- package/lib/mixins/button.js +54 -0
- package/lib/mixins/link.d.ts +1 -0
- package/lib/mixins/link.js +27 -0
- package/lib/mixins/page-scroll.d.ts +6 -0
- package/lib/mixins/page-scroll.js +47 -0
- package/lib/mixins/touch.d.ts +1 -0
- package/lib/mixins/touch.js +40 -0
- package/lib/mixins/transition.d.ts +1 -0
- package/lib/mixins/transition.js +135 -0
- package/lib/nav-bar/index.css +1 -0
- package/lib/nav-bar/index.d.ts +1 -0
- package/lib/nav-bar/index.js +73 -0
- package/lib/nav-bar/index.json +6 -0
- package/lib/nav-bar/index.wxml +43 -0
- package/lib/nav-bar/index.wxs +13 -0
- package/lib/nav-bar/index.wxss +1 -0
- package/lib/normal-slider/index.css +1 -0
- package/lib/normal-slider/index.d.ts +1 -0
- package/lib/normal-slider/index.js +160 -0
- package/lib/normal-slider/index.json +6 -0
- package/lib/normal-slider/index.wxml +35 -0
- package/lib/normal-slider/index.wxss +1 -0
- package/lib/notice-bar/index.css +1 -0
- package/lib/notice-bar/index.d.ts +1 -0
- package/lib/notice-bar/index.js +125 -0
- package/lib/notice-bar/index.json +6 -0
- package/lib/notice-bar/index.wxml +38 -0
- package/lib/notice-bar/index.wxs +15 -0
- package/lib/notice-bar/index.wxss +1 -0
- package/lib/notify/index.css +1 -0
- package/lib/notify/index.d.ts +1 -0
- package/lib/notify/index.js +68 -0
- package/lib/notify/index.json +6 -0
- package/lib/notify/index.wxml +21 -0
- package/lib/notify/index.wxs +22 -0
- package/lib/notify/index.wxss +1 -0
- package/lib/notify/notify.d.ts +22 -0
- package/lib/notify/notify.js +67 -0
- package/lib/overlay/index.css +1 -0
- package/lib/overlay/index.d.ts +1 -0
- package/lib/overlay/index.js +32 -0
- package/lib/overlay/index.json +6 -0
- package/lib/overlay/index.wxml +7 -0
- package/lib/overlay/index.wxss +1 -0
- package/lib/overlay/overlay.wxml +10 -0
- package/lib/picker/index.css +1 -0
- package/lib/picker/index.d.ts +1 -0
- package/lib/picker/index.js +167 -0
- package/lib/picker/index.json +7 -0
- package/lib/picker/index.wxml +39 -0
- package/lib/picker/index.wxs +42 -0
- package/lib/picker/index.wxss +1 -0
- package/lib/picker/shared.d.ts +21 -0
- package/lib/picker/shared.js +24 -0
- package/lib/picker/toolbar.wxml +23 -0
- package/lib/picker-column/index.css +1 -0
- package/lib/picker-column/index.d.ts +1 -0
- package/lib/picker-column/index.js +202 -0
- package/lib/picker-column/index.json +3 -0
- package/lib/picker-column/index.wxml +32 -0
- package/lib/picker-column/index.wxs +59 -0
- package/lib/picker-column/index.wxss +1 -0
- package/lib/popup/index.css +1 -0
- package/lib/popup/index.d.ts +1 -0
- package/lib/popup/index.js +108 -0
- package/lib/popup/index.json +7 -0
- package/lib/popup/index.wxml +21 -0
- package/lib/popup/index.wxs +18 -0
- package/lib/popup/index.wxss +1 -0
- package/lib/popup/popup.wxml +17 -0
- package/lib/progress/index.css +1 -0
- package/lib/progress/index.d.ts +1 -0
- package/lib/progress/index.js +55 -0
- package/lib/progress/index.json +3 -0
- package/lib/progress/index.wxml +20 -0
- package/lib/progress/index.wxs +36 -0
- package/lib/progress/index.wxss +1 -0
- package/lib/radio/index.css +1 -0
- package/lib/radio/index.d.ts +1 -0
- package/lib/radio/index.js +68 -0
- package/lib/radio/index.json +6 -0
- package/lib/radio/index.wxml +30 -0
- package/lib/radio/index.wxs +33 -0
- package/lib/radio/index.wxss +1 -0
- package/lib/radio-group/index.css +1 -0
- package/lib/radio-group/index.d.ts +1 -0
- package/lib/radio-group/index.js +24 -0
- package/lib/radio-group/index.json +3 -0
- package/lib/radio-group/index.wxml +5 -0
- package/lib/radio-group/index.wxss +1 -0
- package/lib/rate/index.css +1 -0
- package/lib/rate/index.d.ts +1 -0
- package/lib/rate/index.js +107 -0
- package/lib/rate/index.json +6 -0
- package/lib/rate/index.wxml +35 -0
- package/lib/rate/index.wxss +1 -0
- package/lib/row/index.css +1 -0
- package/lib/row/index.d.ts +1 -0
- package/lib/row/index.js +26 -0
- package/lib/row/index.json +3 -0
- package/lib/row/index.wxml +5 -0
- package/lib/row/index.wxs +18 -0
- package/lib/row/index.wxss +1 -0
- package/lib/search/index.css +1 -0
- package/lib/search/index.d.ts +1 -0
- package/lib/search/index.js +99 -0
- package/lib/search/index.json +6 -0
- package/lib/search/index.wxml +54 -0
- package/lib/search/index.wxss +1 -0
- package/lib/sidebar/index.css +1 -0
- package/lib/sidebar/index.d.ts +1 -0
- package/lib/sidebar/index.js +36 -0
- package/lib/sidebar/index.json +3 -0
- package/lib/sidebar/index.wxml +3 -0
- package/lib/sidebar/index.wxss +1 -0
- package/lib/sidebar-item/index.css +1 -0
- package/lib/sidebar-item/index.d.ts +1 -0
- package/lib/sidebar-item/index.js +32 -0
- package/lib/sidebar-item/index.json +6 -0
- package/lib/sidebar-item/index.wxml +18 -0
- package/lib/sidebar-item/index.wxss +1 -0
- package/lib/skeleton/index.css +1 -0
- package/lib/skeleton/index.d.ts +1 -0
- package/lib/skeleton/index.js +48 -0
- package/lib/skeleton/index.json +4 -0
- package/lib/skeleton/index.wxml +29 -0
- package/lib/skeleton/index.wxss +1 -0
- package/lib/slider/index.css +1 -0
- package/lib/slider/index.d.ts +1 -0
- package/lib/slider/index.js +209 -0
- package/lib/slider/index.json +3 -0
- package/lib/slider/index.wxml +68 -0
- package/lib/slider/index.wxs +14 -0
- package/lib/slider/index.wxss +1 -0
- package/lib/stepper/index.css +1 -0
- package/lib/stepper/index.d.ts +1 -0
- package/lib/stepper/index.js +198 -0
- package/lib/stepper/index.json +3 -0
- package/lib/stepper/index.wxml +43 -0
- package/lib/stepper/index.wxs +22 -0
- package/lib/stepper/index.wxss +1 -0
- package/lib/steps/index.css +1 -0
- package/lib/steps/index.d.ts +1 -0
- package/lib/steps/index.js +36 -0
- package/lib/steps/index.json +6 -0
- package/lib/steps/index.wxml +54 -0
- package/lib/steps/index.wxss +1 -0
- package/lib/sticky/index.css +1 -0
- package/lib/sticky/index.d.ts +1 -0
- package/lib/sticky/index.js +126 -0
- package/lib/sticky/index.json +3 -0
- package/lib/sticky/index.wxml +8 -0
- package/lib/sticky/index.wxs +25 -0
- package/lib/sticky/index.wxss +1 -0
- package/lib/swipe-cell/index.css +1 -0
- package/lib/swipe-cell/index.d.ts +1 -0
- package/lib/swipe-cell/index.js +135 -0
- package/lib/swipe-cell/index.json +3 -0
- package/lib/swipe-cell/index.wxml +21 -0
- package/lib/swipe-cell/index.wxss +1 -0
- package/lib/switch/index.css +1 -0
- package/lib/switch/index.d.ts +1 -0
- package/lib/switch/index.js +38 -0
- package/lib/switch/index.json +6 -0
- package/lib/switch/index.wxml +16 -0
- package/lib/switch/index.wxs +26 -0
- package/lib/switch/index.wxss +1 -0
- package/lib/tab/index.css +1 -0
- package/lib/tab/index.d.ts +1 -0
- package/lib/tab/index.js +58 -0
- package/lib/tab/index.json +3 -0
- package/lib/tab/index.wxml +8 -0
- package/lib/tab/index.wxss +1 -0
- package/lib/tabbar/index.css +1 -0
- package/lib/tabbar/index.d.ts +1 -0
- package/lib/tabbar/index.js +69 -0
- package/lib/tabbar/index.json +3 -0
- package/lib/tabbar/index.wxml +10 -0
- package/lib/tabbar/index.wxss +1 -0
- package/lib/tabbar-item/index.css +1 -0
- package/lib/tabbar-item/index.d.ts +1 -0
- package/lib/tabbar-item/index.js +70 -0
- package/lib/tabbar-item/index.json +7 -0
- package/lib/tabbar-item/index.wxml +29 -0
- package/lib/tabbar-item/index.wxss +1 -0
- package/lib/tabs/index.css +1 -0
- package/lib/tabs/index.d.ts +1 -0
- package/lib/tabs/index.js +327 -0
- package/lib/tabs/index.json +7 -0
- package/lib/tabs/index.wxml +63 -0
- package/lib/tabs/index.wxs +83 -0
- package/lib/tabs/index.wxss +1 -0
- package/lib/tag/index.css +1 -0
- package/lib/tag/index.d.ts +1 -0
- package/lib/tag/index.js +34 -0
- package/lib/tag/index.json +6 -0
- package/lib/tag/index.wxml +17 -0
- package/lib/tag/index.wxs +13 -0
- package/lib/tag/index.wxss +1 -0
- package/lib/toast/index.css +1 -0
- package/lib/toast/index.d.ts +1 -0
- package/lib/toast/index.js +40 -0
- package/lib/toast/index.json +9 -0
- package/lib/toast/index.wxml +36 -0
- package/lib/toast/index.wxss +1 -0
- package/lib/toast/toast.d.ts +28 -0
- package/lib/toast/toast.js +83 -0
- package/lib/transition/index.css +1 -0
- package/lib/transition/index.d.ts +1 -0
- package/lib/transition/index.js +15 -0
- package/lib/transition/index.json +3 -0
- package/lib/transition/index.wxml +10 -0
- package/lib/transition/index.wxs +17 -0
- package/lib/transition/index.wxss +1 -0
- package/lib/tree-select/index.css +1 -0
- package/lib/tree-select/index.d.ts +1 -0
- package/lib/tree-select/index.js +74 -0
- package/lib/tree-select/index.json +8 -0
- package/lib/tree-select/index.wxml +41 -0
- package/lib/tree-select/index.wxs +12 -0
- package/lib/tree-select/index.wxss +1 -0
- package/lib/wxs/add-unit.wxs +12 -0
- package/lib/wxs/array.wxs +5 -0
- package/lib/wxs/bem.wxs +39 -0
- package/lib/wxs/memoize.wxs +55 -0
- package/lib/wxs/object.wxs +13 -0
- package/lib/wxs/style.wxs +42 -0
- package/lib/wxs/utils.wxs +10 -0
- package/package.json +77 -0
@@ -0,0 +1,39 @@
|
|
1
|
+
<wxs src="./index.wxs" module="computed"></wxs>
|
2
|
+
<wxs src="../../../wxs/utils.wxs" module="utils" />
|
3
|
+
|
4
|
+
<view class="van-calendar__month" style="{{ computed.getMonthStyle(visible, date, rowHeight) }}">
|
5
|
+
<view wx:if="{{ showMonthTitle }}" class="van-calendar__month-title">
|
6
|
+
{{ computed.formatMonthTitle(date) }}
|
7
|
+
</view>
|
8
|
+
|
9
|
+
<view wx:if="{{ visible }}" class="van-calendar__days">
|
10
|
+
<view wx:if="{{ showMark }}" class="van-calendar__month-mark">
|
11
|
+
{{ computed.getMark(date) }}
|
12
|
+
</view>
|
13
|
+
|
14
|
+
<view
|
15
|
+
wx:for="{{ days }}"
|
16
|
+
wx:key="index"
|
17
|
+
style="{{ computed.getDayStyle(item.type, index, date, rowHeight, color, firstDayOfWeek) }}"
|
18
|
+
class="{{ utils.bem('calendar__day', [item.type]) }} {{ item.className }}"
|
19
|
+
data-index="{{ index }}"
|
20
|
+
bindtap="onClick"
|
21
|
+
>
|
22
|
+
<view wx:if="{{ item.type === 'selected' }}" class="van-calendar__selected-day" style="width: {{ rowHeight }}px; height: {{ rowHeight }}px; background: {{ color }}">
|
23
|
+
<view wx:if="{{ item.topInfo }}" class="van-calendar__top-info">{{ item.topInfo }}</view>
|
24
|
+
{{ item.text }}
|
25
|
+
<view wx:if="{{ item.bottomInfo }}" class="van-calendar__bottom-info">
|
26
|
+
{{ item.bottomInfo }}
|
27
|
+
</view>
|
28
|
+
</view>
|
29
|
+
|
30
|
+
<view wx:else>
|
31
|
+
<view wx:if="{{ item.topInfo }}" class="van-calendar__top-info">{{ item.topInfo }}</view>
|
32
|
+
{{ item.text }}
|
33
|
+
<view wx:if="{{ item.bottomInfo }}" class="van-calendar__bottom-info">
|
34
|
+
{{ item.bottomInfo }}
|
35
|
+
</view>
|
36
|
+
</view>
|
37
|
+
</view>
|
38
|
+
</view>
|
39
|
+
</view>
|
@@ -0,0 +1,71 @@
|
|
1
|
+
/* eslint-disable */
|
2
|
+
var utils = require('../../utils.wxs');
|
3
|
+
|
4
|
+
function getMark(date) {
|
5
|
+
return getDate(date).getMonth() + 1;
|
6
|
+
}
|
7
|
+
|
8
|
+
var ROW_HEIGHT = 64;
|
9
|
+
|
10
|
+
function getDayStyle(type, index, date, rowHeight, color, firstDayOfWeek) {
|
11
|
+
var style = [];
|
12
|
+
var current = getDate(date).getDay() || 7;
|
13
|
+
var offset = current < firstDayOfWeek ? (7 - firstDayOfWeek + current) :
|
14
|
+
current === 7 && firstDayOfWeek === 0 ? 0 :
|
15
|
+
(current - firstDayOfWeek);
|
16
|
+
|
17
|
+
if (index === 0) {
|
18
|
+
style.push(['margin-left', (100 * offset) / 7 + '%']);
|
19
|
+
}
|
20
|
+
|
21
|
+
if (rowHeight !== ROW_HEIGHT) {
|
22
|
+
style.push(['height', rowHeight + 'px']);
|
23
|
+
}
|
24
|
+
|
25
|
+
if (color) {
|
26
|
+
if (
|
27
|
+
type === 'start' ||
|
28
|
+
type === 'end' ||
|
29
|
+
type === 'start-end' ||
|
30
|
+
type === 'multiple-selected' ||
|
31
|
+
type === 'multiple-middle'
|
32
|
+
) {
|
33
|
+
style.push(['background', color]);
|
34
|
+
} else if (type === 'middle') {
|
35
|
+
style.push(['color', color]);
|
36
|
+
}
|
37
|
+
}
|
38
|
+
|
39
|
+
return style
|
40
|
+
.map(function(item) {
|
41
|
+
return item.join(':');
|
42
|
+
})
|
43
|
+
.join(';');
|
44
|
+
}
|
45
|
+
|
46
|
+
function formatMonthTitle(date) {
|
47
|
+
date = getDate(date);
|
48
|
+
return date.getFullYear() + '年' + (date.getMonth() + 1) + '月';
|
49
|
+
}
|
50
|
+
|
51
|
+
function getMonthStyle(visible, date, rowHeight) {
|
52
|
+
if (!visible) {
|
53
|
+
date = getDate(date);
|
54
|
+
|
55
|
+
var totalDay = utils.getMonthEndDay(
|
56
|
+
date.getFullYear(),
|
57
|
+
date.getMonth() + 1
|
58
|
+
);
|
59
|
+
var offset = getDate(date).getDay();
|
60
|
+
var padding = Math.ceil((totalDay + offset) / 7) * rowHeight;
|
61
|
+
|
62
|
+
return 'padding-bottom:' + padding + 'px';
|
63
|
+
}
|
64
|
+
}
|
65
|
+
|
66
|
+
module.exports = {
|
67
|
+
getMark: getMark,
|
68
|
+
getDayStyle: getDayStyle,
|
69
|
+
formatMonthTitle: formatMonthTitle,
|
70
|
+
getMonthStyle: getMonthStyle
|
71
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
@import '../../../common/index.wxss';.van-calendar{background-color:var(--calendar-background-color,var(--app-B6,#fff));display:flex;flex-direction:column;height:100%}.van-calendar__month-title{font-size:var(--calendar-month-title-font-size,14px);font-weight:var(--font-weight-bold,500);height:var(--calendar-header-title-height,44px);line-height:var(--calendar-header-title-height,44px);text-align:center}.van-calendar__days{display:flex;flex-wrap:wrap;position:relative;-webkit-user-select:none;user-select:none}.van-calendar__month-mark{color:var(--calendar-month-mark-color,hsla(210,6%,87%,.6));font-size:var(--calendar-month-mark-font-size,160px);left:50%;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);z-index:0}.van-calendar__day,.van-calendar__selected-day{align-items:center;display:flex;justify-content:center;text-align:center}.van-calendar__day{font-size:var(--calendar-day-font-size,16px);height:var(--calendar-day-height,64px);position:relative;width:14.285%}.van-calendar__day--end,.van-calendar__day--multiple-middle,.van-calendar__day--multiple-selected,.van-calendar__day--start,.van-calendar__day--start-end{background-color:var(--calendar-range-edge-background-color,#ee0a24);color:var(--calendar-range-edge-color,#fff)}.van-calendar__day--start{border-radius:4px 0 0 4px}.van-calendar__day--end{border-radius:0 4px 4px 0}.van-calendar__day--multiple-selected,.van-calendar__day--start-end{border-radius:4px}.van-calendar__day--middle{color:var(--calendar-range-middle-color,#ee0a24)}.van-calendar__day--middle:after{background-color:currentColor;bottom:0;content:"";left:0;opacity:var(--calendar-range-middle-background-opacity,.1);position:absolute;right:0;top:0}.van-calendar__day--disabled{color:var(--calendar-day-disabled-color,#c8c9cc);cursor:default}.van-calendar__bottom-info,.van-calendar__top-info{font-size:var(--calendar-info-font-size,10px);left:0;line-height:var(--calendar-info-line-height,14px);position:absolute;right:0}@media (max-width:350px){.van-calendar__bottom-info,.van-calendar__top-info{font-size:9px}}.van-calendar__top-info{top:6px}.van-calendar__bottom-info{bottom:6px}.van-calendar__selected-day{background-color:var(--calendar-selected-day-background-color,#ee0a24);border-radius:4px;color:var(--calendar-selected-day-color,#fff);height:var(--calendar-selected-day-size,54px);width:var(--calendar-selected-day-size,54px)}
|
@@ -0,0 +1 @@
|
|
1
|
+
@import '../common/index.css';.van-calendar{background-color:var(--calendar-background-color,var(--app-B6,#fff));display:flex;flex-direction:column;height:var(--calendar-height,100%)}.van-calendar__close-icon{top:11px}.van-calendar__popup--bottom,.van-calendar__popup--top{height:var(--calendar-popup-height,90%)}.van-calendar__popup--left,.van-calendar__popup--right{height:100%}.van-calendar__body{-webkit-overflow-scrolling:touch;flex:1;overflow:auto}.van-calendar__footer{flex-shrink:0;padding:0 var(--padding-md,16px)}.van-calendar__footer--safe-area-inset-bottom{padding-bottom:env(safe-area-inset-bottom)}.van-calendar__footer+.van-calendar__footer,.van-calendar__footer:empty{display:none}.van-calendar__footer:empty+.van-calendar__footer{display:block!important}.van-calendar__confirm{height:var(--calendar-confirm-button-height,36px)!important;line-height:var(--calendar-confirm-button-line-height,34px)!important;margin:var(--calendar-confirm-button-margin,7px 0)!important}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,360 @@
|
|
1
|
+
import { VantComponent } from '../common/component';
|
2
|
+
import { ROW_HEIGHT, getPrevDay, getNextDay, getToday, compareDay, copyDates, calcDateNum, formatMonthTitle, compareMonth, getMonths, getDayByOffset, } from './utils';
|
3
|
+
import Toast from '../toast/toast';
|
4
|
+
import { requestAnimationFrame } from '../common/utils';
|
5
|
+
const initialMinDate = getToday().getTime();
|
6
|
+
const initialMaxDate = (() => {
|
7
|
+
const now = getToday();
|
8
|
+
return new Date(now.getFullYear(), now.getMonth() + 6, now.getDate()).getTime();
|
9
|
+
})();
|
10
|
+
const getTime = (date) => date instanceof Date ? date.getTime() : date;
|
11
|
+
VantComponent({
|
12
|
+
props: {
|
13
|
+
title: {
|
14
|
+
type: String,
|
15
|
+
value: '日期选择',
|
16
|
+
},
|
17
|
+
color: String,
|
18
|
+
show: {
|
19
|
+
type: Boolean,
|
20
|
+
observer(val) {
|
21
|
+
if (val) {
|
22
|
+
this.initRect();
|
23
|
+
this.scrollIntoView();
|
24
|
+
}
|
25
|
+
},
|
26
|
+
},
|
27
|
+
formatter: null,
|
28
|
+
confirmText: {
|
29
|
+
type: String,
|
30
|
+
value: '确定',
|
31
|
+
},
|
32
|
+
confirmDisabledText: {
|
33
|
+
type: String,
|
34
|
+
value: '确定',
|
35
|
+
},
|
36
|
+
rangePrompt: String,
|
37
|
+
showRangePrompt: {
|
38
|
+
type: Boolean,
|
39
|
+
value: true,
|
40
|
+
},
|
41
|
+
defaultDate: {
|
42
|
+
type: null,
|
43
|
+
value: getToday().getTime(),
|
44
|
+
observer(val) {
|
45
|
+
this.setData({ currentDate: val });
|
46
|
+
this.scrollIntoView();
|
47
|
+
},
|
48
|
+
},
|
49
|
+
allowSameDay: Boolean,
|
50
|
+
type: {
|
51
|
+
type: String,
|
52
|
+
value: 'single',
|
53
|
+
observer: 'reset',
|
54
|
+
},
|
55
|
+
minDate: {
|
56
|
+
type: Number,
|
57
|
+
value: initialMinDate,
|
58
|
+
},
|
59
|
+
maxDate: {
|
60
|
+
type: Number,
|
61
|
+
value: initialMaxDate,
|
62
|
+
},
|
63
|
+
position: {
|
64
|
+
type: String,
|
65
|
+
value: 'bottom',
|
66
|
+
},
|
67
|
+
rowHeight: {
|
68
|
+
type: null,
|
69
|
+
value: ROW_HEIGHT,
|
70
|
+
},
|
71
|
+
round: {
|
72
|
+
type: Boolean,
|
73
|
+
value: true,
|
74
|
+
},
|
75
|
+
poppable: {
|
76
|
+
type: Boolean,
|
77
|
+
value: true,
|
78
|
+
},
|
79
|
+
showMark: {
|
80
|
+
type: Boolean,
|
81
|
+
value: true,
|
82
|
+
},
|
83
|
+
showTitle: {
|
84
|
+
type: Boolean,
|
85
|
+
value: true,
|
86
|
+
},
|
87
|
+
showConfirm: {
|
88
|
+
type: Boolean,
|
89
|
+
value: true,
|
90
|
+
},
|
91
|
+
showSubtitle: {
|
92
|
+
type: Boolean,
|
93
|
+
value: true,
|
94
|
+
},
|
95
|
+
safeAreaInsetBottom: {
|
96
|
+
type: Boolean,
|
97
|
+
value: true,
|
98
|
+
},
|
99
|
+
closeOnClickOverlay: {
|
100
|
+
type: Boolean,
|
101
|
+
value: true,
|
102
|
+
},
|
103
|
+
maxRange: {
|
104
|
+
type: null,
|
105
|
+
value: null,
|
106
|
+
},
|
107
|
+
minRange: {
|
108
|
+
type: Number,
|
109
|
+
value: 1,
|
110
|
+
},
|
111
|
+
firstDayOfWeek: {
|
112
|
+
type: Number,
|
113
|
+
value: 0,
|
114
|
+
},
|
115
|
+
readonly: Boolean,
|
116
|
+
rootPortal: {
|
117
|
+
type: Boolean,
|
118
|
+
value: false,
|
119
|
+
},
|
120
|
+
},
|
121
|
+
data: {
|
122
|
+
subtitle: '',
|
123
|
+
currentDate: null,
|
124
|
+
scrollIntoView: '',
|
125
|
+
},
|
126
|
+
watch: {
|
127
|
+
minDate() {
|
128
|
+
this.initRect();
|
129
|
+
},
|
130
|
+
maxDate() {
|
131
|
+
this.initRect();
|
132
|
+
},
|
133
|
+
},
|
134
|
+
created() {
|
135
|
+
this.setData({
|
136
|
+
currentDate: this.getInitialDate(this.data.defaultDate),
|
137
|
+
});
|
138
|
+
},
|
139
|
+
mounted() {
|
140
|
+
if (this.data.show || !this.data.poppable) {
|
141
|
+
this.initRect();
|
142
|
+
this.scrollIntoView();
|
143
|
+
}
|
144
|
+
},
|
145
|
+
methods: {
|
146
|
+
reset() {
|
147
|
+
this.setData({ currentDate: this.getInitialDate(this.data.defaultDate) });
|
148
|
+
this.scrollIntoView();
|
149
|
+
},
|
150
|
+
initRect() {
|
151
|
+
if (this.contentObserver != null) {
|
152
|
+
this.contentObserver.disconnect();
|
153
|
+
}
|
154
|
+
const contentObserver = this.createIntersectionObserver({
|
155
|
+
thresholds: [0, 0.1, 0.9, 1],
|
156
|
+
observeAll: true,
|
157
|
+
});
|
158
|
+
this.contentObserver = contentObserver;
|
159
|
+
contentObserver.relativeTo('.van-calendar__body');
|
160
|
+
contentObserver.observe('.month', (res) => {
|
161
|
+
if (res.boundingClientRect.top <= res.relativeRect.top) {
|
162
|
+
// @ts-ignore
|
163
|
+
this.setData({ subtitle: formatMonthTitle(res.dataset.date) });
|
164
|
+
}
|
165
|
+
});
|
166
|
+
},
|
167
|
+
limitDateRange(date, minDate = null, maxDate = null) {
|
168
|
+
minDate = minDate || this.data.minDate;
|
169
|
+
maxDate = maxDate || this.data.maxDate;
|
170
|
+
if (compareDay(date, minDate) === -1) {
|
171
|
+
return minDate;
|
172
|
+
}
|
173
|
+
if (compareDay(date, maxDate) === 1) {
|
174
|
+
return maxDate;
|
175
|
+
}
|
176
|
+
return date;
|
177
|
+
},
|
178
|
+
getInitialDate(defaultDate = null) {
|
179
|
+
const { type, minDate, maxDate, allowSameDay } = this.data;
|
180
|
+
if (!defaultDate)
|
181
|
+
return [];
|
182
|
+
const now = getToday().getTime();
|
183
|
+
if (type === 'range') {
|
184
|
+
if (!Array.isArray(defaultDate)) {
|
185
|
+
defaultDate = [];
|
186
|
+
}
|
187
|
+
const [startDay, endDay] = defaultDate || [];
|
188
|
+
const startDate = getTime(startDay || now);
|
189
|
+
const start = this.limitDateRange(startDate, minDate, allowSameDay ? startDate : getPrevDay(new Date(maxDate)).getTime());
|
190
|
+
const date = getTime(endDay || now);
|
191
|
+
const end = this.limitDateRange(date, allowSameDay ? date : getNextDay(new Date(minDate)).getTime());
|
192
|
+
return [start, end];
|
193
|
+
}
|
194
|
+
if (type === 'multiple') {
|
195
|
+
if (Array.isArray(defaultDate)) {
|
196
|
+
return defaultDate.map((date) => this.limitDateRange(date));
|
197
|
+
}
|
198
|
+
return [this.limitDateRange(now)];
|
199
|
+
}
|
200
|
+
if (!defaultDate || Array.isArray(defaultDate)) {
|
201
|
+
defaultDate = now;
|
202
|
+
}
|
203
|
+
return this.limitDateRange(defaultDate);
|
204
|
+
},
|
205
|
+
scrollIntoView() {
|
206
|
+
requestAnimationFrame(() => {
|
207
|
+
const { currentDate, type, show, poppable, minDate, maxDate } = this.data;
|
208
|
+
if (!currentDate)
|
209
|
+
return;
|
210
|
+
// @ts-ignore
|
211
|
+
const targetDate = type === 'single' ? currentDate : currentDate[0];
|
212
|
+
const displayed = show || !poppable;
|
213
|
+
if (!targetDate || !displayed) {
|
214
|
+
return;
|
215
|
+
}
|
216
|
+
const months = getMonths(minDate, maxDate);
|
217
|
+
months.some((month, index) => {
|
218
|
+
if (compareMonth(month, targetDate) === 0) {
|
219
|
+
this.setData({ scrollIntoView: `month${index}` });
|
220
|
+
return true;
|
221
|
+
}
|
222
|
+
return false;
|
223
|
+
});
|
224
|
+
});
|
225
|
+
},
|
226
|
+
onOpen() {
|
227
|
+
this.$emit('open');
|
228
|
+
},
|
229
|
+
onOpened() {
|
230
|
+
this.$emit('opened');
|
231
|
+
},
|
232
|
+
onClose() {
|
233
|
+
this.$emit('close');
|
234
|
+
},
|
235
|
+
onClosed() {
|
236
|
+
this.$emit('closed');
|
237
|
+
},
|
238
|
+
onClickDay(event) {
|
239
|
+
if (this.data.readonly) {
|
240
|
+
return;
|
241
|
+
}
|
242
|
+
let { date } = event.detail;
|
243
|
+
const { type, currentDate, allowSameDay } = this.data;
|
244
|
+
if (type === 'range') {
|
245
|
+
// @ts-ignore
|
246
|
+
const [startDay, endDay] = currentDate;
|
247
|
+
if (startDay && !endDay) {
|
248
|
+
const compareToStart = compareDay(date, startDay);
|
249
|
+
if (compareToStart === 1) {
|
250
|
+
const { days } = this.selectComponent('.month').data;
|
251
|
+
days.some((day, index) => {
|
252
|
+
const isDisabled = day.type === 'disabled' &&
|
253
|
+
getTime(startDay) < getTime(day.date) &&
|
254
|
+
getTime(day.date) < getTime(date);
|
255
|
+
if (isDisabled) {
|
256
|
+
({ date } = days[index - 1]);
|
257
|
+
}
|
258
|
+
return isDisabled;
|
259
|
+
});
|
260
|
+
this.select([startDay, date], true);
|
261
|
+
}
|
262
|
+
else if (compareToStart === -1) {
|
263
|
+
this.select([date, null]);
|
264
|
+
}
|
265
|
+
else if (allowSameDay) {
|
266
|
+
this.select([date, date], true);
|
267
|
+
}
|
268
|
+
}
|
269
|
+
else {
|
270
|
+
this.select([date, null]);
|
271
|
+
}
|
272
|
+
}
|
273
|
+
else if (type === 'multiple') {
|
274
|
+
let selectedIndex;
|
275
|
+
// @ts-ignore
|
276
|
+
const selected = currentDate.some((dateItem, index) => {
|
277
|
+
const equal = compareDay(dateItem, date) === 0;
|
278
|
+
if (equal) {
|
279
|
+
selectedIndex = index;
|
280
|
+
}
|
281
|
+
return equal;
|
282
|
+
});
|
283
|
+
if (selected) {
|
284
|
+
// @ts-ignore
|
285
|
+
const cancelDate = currentDate.splice(selectedIndex, 1);
|
286
|
+
this.setData({ currentDate });
|
287
|
+
this.unselect(cancelDate);
|
288
|
+
}
|
289
|
+
else {
|
290
|
+
// @ts-ignore
|
291
|
+
this.select([...currentDate, date]);
|
292
|
+
}
|
293
|
+
}
|
294
|
+
else {
|
295
|
+
this.select(date, true);
|
296
|
+
}
|
297
|
+
},
|
298
|
+
unselect(dateArray) {
|
299
|
+
const date = dateArray[0];
|
300
|
+
if (date) {
|
301
|
+
this.$emit('unselect', copyDates(date));
|
302
|
+
}
|
303
|
+
},
|
304
|
+
select(date, complete) {
|
305
|
+
if (complete && this.data.type === 'range') {
|
306
|
+
const valid = this.checkRange(date);
|
307
|
+
if (!valid) {
|
308
|
+
// auto selected to max range if showConfirm
|
309
|
+
if (this.data.showConfirm) {
|
310
|
+
this.emit([
|
311
|
+
date[0],
|
312
|
+
getDayByOffset(date[0], this.data.maxRange - 1),
|
313
|
+
]);
|
314
|
+
}
|
315
|
+
else {
|
316
|
+
this.emit(date);
|
317
|
+
}
|
318
|
+
return;
|
319
|
+
}
|
320
|
+
}
|
321
|
+
this.emit(date);
|
322
|
+
if (complete && !this.data.showConfirm) {
|
323
|
+
this.onConfirm();
|
324
|
+
}
|
325
|
+
},
|
326
|
+
emit(date) {
|
327
|
+
this.setData({
|
328
|
+
currentDate: Array.isArray(date) ? date.map(getTime) : getTime(date),
|
329
|
+
});
|
330
|
+
this.$emit('select', copyDates(date));
|
331
|
+
},
|
332
|
+
checkRange(date) {
|
333
|
+
const { maxRange, rangePrompt, showRangePrompt } = this.data;
|
334
|
+
if (maxRange && calcDateNum(date) > maxRange) {
|
335
|
+
if (showRangePrompt) {
|
336
|
+
Toast({
|
337
|
+
context: this,
|
338
|
+
message: rangePrompt || `选择天数不能超过 ${maxRange} 天`,
|
339
|
+
});
|
340
|
+
}
|
341
|
+
this.$emit('over-range');
|
342
|
+
return false;
|
343
|
+
}
|
344
|
+
return true;
|
345
|
+
},
|
346
|
+
onConfirm() {
|
347
|
+
if (this.data.type === 'range' &&
|
348
|
+
!this.checkRange(this.data.currentDate)) {
|
349
|
+
return;
|
350
|
+
}
|
351
|
+
wx.nextTick(() => {
|
352
|
+
// @ts-ignore
|
353
|
+
this.$emit('confirm', copyDates(this.data.currentDate));
|
354
|
+
});
|
355
|
+
},
|
356
|
+
onClickSubtitle(event) {
|
357
|
+
this.$emit('click-subtitle', event);
|
358
|
+
},
|
359
|
+
},
|
360
|
+
});
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<wxs src="./index.wxs" module="computed" />
|
2
|
+
<wxs src="../wxs/utils.wxs" module="utils" />
|
3
|
+
|
4
|
+
<import src="./calendar.wxml" />
|
5
|
+
|
6
|
+
<van-popup
|
7
|
+
wx:if="{{ poppable }}"
|
8
|
+
custom-class="van-calendar__popup--{{ position }}"
|
9
|
+
close-icon-class="van-calendar__close-icon"
|
10
|
+
show="{{ show }}"
|
11
|
+
round="{{ round }}"
|
12
|
+
position="{{ position }}"
|
13
|
+
closeable="{{ showTitle || showSubtitle }}"
|
14
|
+
close-on-click-overlay="{{ closeOnClickOverlay }}"
|
15
|
+
safe-area-inset-bottom="{{ safeAreaInsetBottom }}"
|
16
|
+
root-portal="{{ rootPortal }}"
|
17
|
+
bind:enter="onOpen"
|
18
|
+
bind:close="onClose"
|
19
|
+
bind:after-enter="onOpened"
|
20
|
+
bind:after-leave="onClosed"
|
21
|
+
>
|
22
|
+
<include src="./calendar.wxml" />
|
23
|
+
</van-popup>
|
24
|
+
|
25
|
+
<include wx:else src="./calendar.wxml" />
|
26
|
+
|
27
|
+
<van-toast id="van-toast" />
|
@@ -0,0 +1,37 @@
|
|
1
|
+
/* eslint-disable */
|
2
|
+
var utils = require('./utils.wxs');
|
3
|
+
|
4
|
+
function getMonths(minDate, maxDate) {
|
5
|
+
var months = [];
|
6
|
+
var cursor = getDate(minDate);
|
7
|
+
|
8
|
+
cursor.setDate(1);
|
9
|
+
|
10
|
+
do {
|
11
|
+
months.push(cursor.getTime());
|
12
|
+
cursor.setMonth(cursor.getMonth() + 1);
|
13
|
+
} while (utils.compareMonth(cursor, getDate(maxDate)) !== 1);
|
14
|
+
|
15
|
+
return months;
|
16
|
+
}
|
17
|
+
|
18
|
+
function getButtonDisabled(type, currentDate, minRange) {
|
19
|
+
if (currentDate == null) {
|
20
|
+
return true;
|
21
|
+
}
|
22
|
+
|
23
|
+
if (type === 'range') {
|
24
|
+
return !currentDate[0] || !currentDate[1];
|
25
|
+
}
|
26
|
+
|
27
|
+
if (type === 'multiple') {
|
28
|
+
return currentDate.length < minRange;
|
29
|
+
}
|
30
|
+
|
31
|
+
return !currentDate;
|
32
|
+
}
|
33
|
+
|
34
|
+
module.exports = {
|
35
|
+
getMonths: getMonths,
|
36
|
+
getButtonDisabled: getButtonDisabled
|
37
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
@import '../common/index.wxss';.van-calendar{background-color:var(--calendar-background-color,var(--app-B6,#fff));display:flex;flex-direction:column;height:var(--calendar-height,100%)}.van-calendar__close-icon{top:11px}.van-calendar__popup--bottom,.van-calendar__popup--top{height:var(--calendar-popup-height,90%)}.van-calendar__popup--left,.van-calendar__popup--right{height:100%}.van-calendar__body{-webkit-overflow-scrolling:touch;flex:1;overflow:auto}.van-calendar__footer{flex-shrink:0;padding:0 var(--padding-md,16px)}.van-calendar__footer--safe-area-inset-bottom{padding-bottom:env(safe-area-inset-bottom)}.van-calendar__footer+.van-calendar__footer,.van-calendar__footer:empty{display:none}.van-calendar__footer:empty+.van-calendar__footer{display:block!important}.van-calendar__confirm{height:var(--calendar-confirm-button-height,36px)!important;line-height:var(--calendar-confirm-button-line-height,34px)!important;margin:var(--calendar-confirm-button-margin,7px 0)!important}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
export declare const ROW_HEIGHT = 64;
|
2
|
+
export declare function formatMonthTitle(date: Date): string;
|
3
|
+
export declare function compareMonth(date1: Date | number, date2: Date | number): 0 | 1 | -1;
|
4
|
+
export declare function compareDay(day1: Date | number, day2: Date | number): 0 | 1 | -1;
|
5
|
+
export declare function getDayByOffset(date: Date, offset: number): Date;
|
6
|
+
export declare function getPrevDay(date: Date): Date;
|
7
|
+
export declare function getNextDay(date: Date): Date;
|
8
|
+
export declare function getToday(): Date;
|
9
|
+
export declare function calcDateNum(date: [Date, Date]): number;
|
10
|
+
export declare function copyDates(dates: Date | Date[]): Date | Date[];
|
11
|
+
export declare function getMonthEndDay(year: number, month: number): number;
|
12
|
+
export declare function getMonths(minDate: number, maxDate: number): number[];
|
@@ -0,0 +1,83 @@
|
|
1
|
+
export const ROW_HEIGHT = 64;
|
2
|
+
export function formatMonthTitle(date) {
|
3
|
+
if (!(date instanceof Date)) {
|
4
|
+
date = new Date(date);
|
5
|
+
}
|
6
|
+
return `${date.getFullYear()}年${date.getMonth() + 1}月`;
|
7
|
+
}
|
8
|
+
export function compareMonth(date1, date2) {
|
9
|
+
if (!(date1 instanceof Date)) {
|
10
|
+
date1 = new Date(date1);
|
11
|
+
}
|
12
|
+
if (!(date2 instanceof Date)) {
|
13
|
+
date2 = new Date(date2);
|
14
|
+
}
|
15
|
+
const year1 = date1.getFullYear();
|
16
|
+
const year2 = date2.getFullYear();
|
17
|
+
const month1 = date1.getMonth();
|
18
|
+
const month2 = date2.getMonth();
|
19
|
+
if (year1 === year2) {
|
20
|
+
return month1 === month2 ? 0 : month1 > month2 ? 1 : -1;
|
21
|
+
}
|
22
|
+
return year1 > year2 ? 1 : -1;
|
23
|
+
}
|
24
|
+
export function compareDay(day1, day2) {
|
25
|
+
if (!(day1 instanceof Date)) {
|
26
|
+
day1 = new Date(day1);
|
27
|
+
}
|
28
|
+
if (!(day2 instanceof Date)) {
|
29
|
+
day2 = new Date(day2);
|
30
|
+
}
|
31
|
+
const compareMonthResult = compareMonth(day1, day2);
|
32
|
+
if (compareMonthResult === 0) {
|
33
|
+
const date1 = day1.getDate();
|
34
|
+
const date2 = day2.getDate();
|
35
|
+
return date1 === date2 ? 0 : date1 > date2 ? 1 : -1;
|
36
|
+
}
|
37
|
+
return compareMonthResult;
|
38
|
+
}
|
39
|
+
export function getDayByOffset(date, offset) {
|
40
|
+
date = new Date(date);
|
41
|
+
date.setDate(date.getDate() + offset);
|
42
|
+
return date;
|
43
|
+
}
|
44
|
+
export function getPrevDay(date) {
|
45
|
+
return getDayByOffset(date, -1);
|
46
|
+
}
|
47
|
+
export function getNextDay(date) {
|
48
|
+
return getDayByOffset(date, 1);
|
49
|
+
}
|
50
|
+
export function getToday() {
|
51
|
+
const today = new Date();
|
52
|
+
today.setHours(0, 0, 0, 0);
|
53
|
+
return today;
|
54
|
+
}
|
55
|
+
export function calcDateNum(date) {
|
56
|
+
const day1 = new Date(date[0]).getTime();
|
57
|
+
const day2 = new Date(date[1]).getTime();
|
58
|
+
return (day2 - day1) / (1000 * 60 * 60 * 24) + 1;
|
59
|
+
}
|
60
|
+
export function copyDates(dates) {
|
61
|
+
if (Array.isArray(dates)) {
|
62
|
+
return dates.map((date) => {
|
63
|
+
if (date === null) {
|
64
|
+
return date;
|
65
|
+
}
|
66
|
+
return new Date(date);
|
67
|
+
});
|
68
|
+
}
|
69
|
+
return new Date(dates);
|
70
|
+
}
|
71
|
+
export function getMonthEndDay(year, month) {
|
72
|
+
return 32 - new Date(year, month - 1, 32).getDate();
|
73
|
+
}
|
74
|
+
export function getMonths(minDate, maxDate) {
|
75
|
+
const months = [];
|
76
|
+
const cursor = new Date(minDate);
|
77
|
+
cursor.setDate(1);
|
78
|
+
do {
|
79
|
+
months.push(cursor.getTime());
|
80
|
+
cursor.setMonth(cursor.getMonth() + 1);
|
81
|
+
} while (compareMonth(cursor, maxDate) !== 1);
|
82
|
+
return months;
|
83
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
/* eslint-disable */
|
2
|
+
function getMonthEndDay(year, month) {
|
3
|
+
return 32 - getDate(year, month - 1, 32).getDate();
|
4
|
+
}
|
5
|
+
|
6
|
+
function compareMonth(date1, date2) {
|
7
|
+
date1 = getDate(date1);
|
8
|
+
date2 = getDate(date2);
|
9
|
+
|
10
|
+
var year1 = date1.getFullYear();
|
11
|
+
var year2 = date2.getFullYear();
|
12
|
+
var month1 = date1.getMonth();
|
13
|
+
var month2 = date2.getMonth();
|
14
|
+
|
15
|
+
if (year1 === year2) {
|
16
|
+
return month1 === month2 ? 0 : month1 > month2 ? 1 : -1;
|
17
|
+
}
|
18
|
+
|
19
|
+
return year1 > year2 ? 1 : -1;
|
20
|
+
}
|
21
|
+
|
22
|
+
module.exports = {
|
23
|
+
getMonthEndDay: getMonthEndDay,
|
24
|
+
compareMonth: compareMonth
|
25
|
+
};
|