tlvant 0.0.24 → 0.0.25
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 +21 -21
- package/README.en.md +36 -36
- package/README.md +40 -40
- package/package.json +98 -99
- package/es/action-sheet/index.css +0 -1
- package/es/action-sheet/index.js +0 -177
- package/es/action-sheet/index.less +0 -112
- package/es/action-sheet/style/index.js +0 -7
- package/es/action-sheet/style/less.js +0 -7
- package/es/area/index.js +0 -321
- package/es/area/style/index.js +0 -3
- package/es/area/style/less.js +0 -3
- package/es/button/index.css +0 -1
- package/es/button/index.js +0 -171
- package/es/button/index.less +0 -238
- package/es/button/style/index.js +0 -5
- package/es/button/style/less.js +0 -5
- package/es/calendar/components/Header.js +0 -55
- package/es/calendar/components/Month.js +0 -326
- package/es/calendar/index.css +0 -1
- package/es/calendar/index.js +0 -539
- package/es/calendar/index.less +0 -210
- package/es/calendar/style/index.js +0 -9
- package/es/calendar/style/less.js +0 -9
- package/es/calendar/utils.js +0 -66
- package/es/cell/index.css +0 -1
- package/es/cell/index.js +0 -121
- package/es/cell/index.less +0 -103
- package/es/cell/shared.js +0 -24
- package/es/cell/style/index.js +0 -4
- package/es/cell/style/less.js +0 -4
- package/es/cell-group/index.css +0 -1
- package/es/cell-group/index.js +0 -34
- package/es/cell-group/index.less +0 -12
- package/es/cell-group/style/index.js +0 -2
- package/es/cell-group/style/less.js +0 -2
- package/es/checkbox/index.css +0 -1
- package/es/checkbox/index.js +0 -80
- package/es/checkbox/index.less +0 -85
- package/es/checkbox/style/index.js +0 -4
- package/es/checkbox/style/less.js +0 -4
- package/es/checkbox-group/index.css +0 -1
- package/es/checkbox-group/index.js +0 -64
- package/es/checkbox-group/index.less +0 -8
- package/es/checkbox-group/style/index.js +0 -2
- package/es/checkbox-group/style/less.js +0 -2
- package/es/collapse/index.js +0 -39
- package/es/collapse/style/index.js +0 -1
- package/es/collapse/style/less.js +0 -1
- package/es/collapse-item/index.css +0 -1
- package/es/collapse-item/index.js +0 -198
- package/es/collapse-item/index.less +0 -67
- package/es/collapse-item/style/index.js +0 -5
- package/es/collapse-item/style/less.js +0 -5
- package/es/contact-card/index.css +0 -1
- package/es/contact-card/index.js +0 -59
- package/es/contact-card/index.less +0 -42
- package/es/contact-card/style/index.js +0 -5
- package/es/contact-card/style/less.js +0 -5
- package/es/contact-edit/index.css +0 -1
- package/es/contact-edit/index.js +0 -193
- package/es/contact-edit/index.less +0 -30
- package/es/contact-edit/style/index.js +0 -14
- package/es/contact-edit/style/less.js +0 -14
- package/es/contact-list/index.css +0 -1
- package/es/contact-list/index.js +0 -119
- package/es/contact-list/index.less +0 -54
- package/es/contact-list/style/index.js +0 -10
- package/es/contact-list/style/less.js +0 -10
- package/es/datetime-picker/DatePicker.js +0 -246
- package/es/datetime-picker/TimePicker.js +0 -104
- package/es/datetime-picker/index.js +0 -29
- package/es/datetime-picker/shared.js +0 -110
- package/es/datetime-picker/style/index.js +0 -3
- package/es/datetime-picker/style/less.js +0 -3
- package/es/datetime-picker/utils.js +0 -29
- package/es/demo-button/index-sfc.css +0 -1
- package/es/demo-button/index-sfc.less +0 -9
- package/es/demo-button/index.js +0 -27
- package/es/demo-button/style/index.js +0 -1
- package/es/demo-button/style/less.js +0 -1
- package/es/dialog/Dialog.js +0 -246
- package/es/dialog/index.css +0 -1
- package/es/dialog/index.js +0 -104
- package/es/dialog/index.less +0 -153
- package/es/dialog/style/index.js +0 -10
- package/es/dialog/style/less.js +0 -10
- package/es/dropdown-item/index.css +0 -1
- package/es/dropdown-item/index.js +0 -210
- package/es/dropdown-item/index.less +0 -39
- package/es/dropdown-item/style/index.js +0 -7
- package/es/dropdown-item/style/less.js +0 -7
- package/es/dropdown-menu/index.css +0 -1
- package/es/dropdown-menu/index.js +0 -132
- package/es/dropdown-menu/index.less +0 -77
- package/es/dropdown-menu/style/index.js +0 -2
- package/es/dropdown-menu/style/less.js +0 -2
- package/es/empty/Network.js +0 -193
- package/es/empty/index.css +0 -1
- package/es/empty/index.js +0 -81
- package/es/empty/index.less +0 -32
- package/es/empty/style/index.js +0 -2
- package/es/empty/style/less.js +0 -2
- package/es/field/index.css +0 -1
- package/es/field/index.js +0 -623
- package/es/field/index.less +0 -172
- package/es/field/style/index.js +0 -5
- package/es/field/style/less.js +0 -5
- package/es/form/index.js +0 -200
- package/es/form/style/index.js +0 -1
- package/es/form/style/less.js +0 -1
- package/es/goods-action/index.css +0 -1
- package/es/goods-action/index.js +0 -24
- package/es/goods-action/index.less +0 -19
- package/es/goods-action/style/index.js +0 -2
- package/es/goods-action/style/less.js +0 -2
- package/es/goods-action-button/index.css +0 -1
- package/es/goods-action-button/index.js +0 -57
- package/es/goods-action-button/index.less +0 -34
- package/es/goods-action-button/style/index.js +0 -6
- package/es/goods-action-button/style/less.js +0 -6
- package/es/icon/index.css +0 -1
- package/es/icon/index.js +0 -74
- package/es/icon/index.less +0 -11
- package/es/icon/local.css +0 -1
- package/es/icon/local.less +0 -1
- package/es/icon/style/index.js +0 -3
- package/es/icon/style/less.js +0 -3
- package/es/image/index.css +0 -1
- package/es/image/index.js +0 -189
- package/es/image/index.less +0 -47
- package/es/image/style/index.js +0 -4
- package/es/image/style/less.js +0 -4
- package/es/image-preview/ImagePreview.js +0 -234
- package/es/image-preview/ImagePreviewItem.js +0 -242
- package/es/image-preview/index.css +0 -1
- package/es/image-preview/index.js +0 -86
- package/es/image-preview/index.less +0 -103
- package/es/image-preview/shared.js +0 -7
- package/es/image-preview/style/index.js +0 -10
- package/es/image-preview/style/less.js +0 -10
- package/es/index-anchor/index.css +0 -1
- package/es/index-anchor/index.js +0 -83
- package/es/index-anchor/index.less +0 -21
- package/es/index-anchor/style/index.js +0 -2
- package/es/index-anchor/style/less.js +0 -2
- package/es/index-bar/index.css +0 -1
- package/es/index-bar/index.js +0 -222
- package/es/index-bar/index.less +0 -27
- package/es/index-bar/style/index.js +0 -2
- package/es/index-bar/style/less.js +0 -2
- package/es/index.js +0 -80
- package/es/info/index.css +0 -1
- package/es/info/index.js +0 -30
- package/es/info/index.less +0 -29
- package/es/info/style/index.js +0 -2
- package/es/info/style/less.js +0 -2
- package/es/lazyload/index.js +0 -2
- package/es/lazyload/style/index.js +0 -1
- package/es/lazyload/style/less.js +0 -1
- package/es/list/index.css +0 -1
- package/es/list/index.js +0 -178
- package/es/list/index.less +0 -21
- package/es/list/style/index.js +0 -3
- package/es/list/style/less.js +0 -3
- package/es/loading/index.css +0 -1
- package/es/loading/index.js +0 -86
- package/es/loading/index.less +0 -103
- package/es/loading/style/index.js +0 -2
- package/es/loading/style/less.js +0 -2
- package/es/locale/index.js +0 -27
- package/es/locale/lang/de-DE-formal.js +0 -90
- package/es/locale/lang/de-DE.js +0 -90
- package/es/locale/lang/en-US.js +0 -90
- package/es/locale/lang/es-ES.js +0 -90
- package/es/locale/lang/ja-JP.js +0 -91
- package/es/locale/lang/nb-NO.js +0 -90
- package/es/locale/lang/ro-RO.js +0 -90
- package/es/locale/lang/tr-TR.js +0 -90
- package/es/locale/lang/zh-CN.js +0 -91
- package/es/locale/lang/zh-HK.js +0 -91
- package/es/locale/lang/zh-TW.js +0 -91
- package/es/locale/style/index.js +0 -1
- package/es/locale/style/less.js +0 -1
- package/es/mixins/bind-event.js +0 -29
- package/es/mixins/checkbox.js +0 -139
- package/es/mixins/click-outside.js +0 -33
- package/es/mixins/close-on-popstate.js +0 -38
- package/es/mixins/field.js +0 -24
- package/es/mixins/popup/context.js +0 -10
- package/es/mixins/popup/index.js +0 -208
- package/es/mixins/popup/overlay.js +0 -76
- package/es/mixins/popup/type.js +0 -0
- package/es/mixins/portal.js +0 -48
- package/es/mixins/relation.js +0 -76
- package/es/mixins/slots.js +0 -23
- package/es/mixins/touch.js +0 -58
- package/es/nav-bar/index.css +0 -1
- package/es/nav-bar/index.js +0 -124
- package/es/nav-bar/index.less +0 -77
- package/es/nav-bar/style/index.js +0 -4
- package/es/nav-bar/style/less.js +0 -4
- package/es/number-keyboard/CollapseIcon.js +0 -16
- package/es/number-keyboard/DeleteIcon.js +0 -16
- package/es/number-keyboard/Key.js +0 -121
- package/es/number-keyboard/index.css +0 -1
- package/es/number-keyboard/index.js +0 -409
- package/es/number-keyboard/index.less +0 -191
- package/es/number-keyboard/style/index.js +0 -3
- package/es/number-keyboard/style/less.js +0 -3
- package/es/overlay/index.css +0 -1
- package/es/overlay/index.js +0 -53
- package/es/overlay/index.less +0 -11
- package/es/overlay/style/index.js +0 -2
- package/es/overlay/style/less.js +0 -2
- package/es/password-input/index.css +0 -1
- package/es/password-input/index.js +0 -84
- package/es/password-input/index.less +0 -83
- package/es/password-input/style/index.js +0 -2
- package/es/password-input/style/less.js +0 -2
- package/es/picker/PickerColumn.js +0 -300
- package/es/picker/index.css +0 -1
- package/es/picker/index.js +0 -383
- package/es/picker/index.less +0 -118
- package/es/picker/shared.js +0 -22
- package/es/picker/style/index.js +0 -3
- package/es/picker/style/less.js +0 -3
- package/es/popover/index.css +0 -1
- package/es/popover/index.js +0 -211
- package/es/popover/index.less +0 -270
- package/es/popover/style/index.js +0 -6
- package/es/popover/style/less.js +0 -6
- package/es/popup/index.css +0 -1
- package/es/popup/index.js +0 -111
- package/es/popup/index.less +0 -140
- package/es/popup/style/index.js +0 -5
- package/es/popup/style/less.js +0 -5
- package/es/pull-refresh/index.css +0 -1
- package/es/pull-refresh/index.js +0 -213
- package/es/pull-refresh/index.less +0 -25
- package/es/pull-refresh/style/index.js +0 -3
- package/es/pull-refresh/style/less.js +0 -3
- package/es/radio/index.css +0 -1
- package/es/radio/index.js +0 -32
- package/es/radio/index.less +0 -86
- package/es/radio/style/index.js +0 -4
- package/es/radio/style/less.js +0 -4
- package/es/radio-group/index.css +0 -1
- package/es/radio-group/index.js +0 -32
- package/es/radio-group/index.less +0 -8
- package/es/radio-group/style/index.js +0 -2
- package/es/radio-group/style/less.js +0 -2
- package/es/rate/index.css +0 -1
- package/es/rate/index.js +0 -227
- package/es/rate/index.less +0 -46
- package/es/rate/style/index.js +0 -4
- package/es/rate/style/less.js +0 -4
- package/es/search/index.css +0 -1
- package/es/search/index.js +0 -114
- package/es/search/index.less +0 -68
- package/es/search/style/index.js +0 -6
- package/es/search/style/less.js +0 -6
- package/es/slider/index.css +0 -1
- package/es/slider/index.js +0 -289
- package/es/slider/index.less +0 -94
- package/es/slider/style/index.js +0 -2
- package/es/slider/style/less.js +0 -2
- package/es/step/index.css +0 -1
- package/es/step/index.js +0 -115
- package/es/step/index.less +0 -151
- package/es/step/style/index.js +0 -4
- package/es/step/style/less.js +0 -4
- package/es/stepper/index.css +0 -1
- package/es/stepper/index.js +0 -355
- package/es/stepper/index.less +0 -129
- package/es/stepper/style/index.js +0 -2
- package/es/stepper/style/less.js +0 -2
- package/es/steps/index.css +0 -1
- package/es/steps/index.js +0 -35
- package/es/steps/index.less +0 -21
- package/es/steps/style/index.js +0 -2
- package/es/steps/style/less.js +0 -2
- package/es/sticky/index.css +0 -1
- package/es/sticky/index.js +0 -146
- package/es/sticky/index.less +0 -11
- package/es/sticky/style/index.js +0 -2
- package/es/sticky/style/less.js +0 -2
- package/es/style/animation.css +0 -1
- package/es/style/animation.less +0 -139
- package/es/style/base.css +0 -1
- package/es/style/base.less +0 -10
- package/es/style/clearfix.css +0 -1
- package/es/style/clearfix.less +0 -5
- package/es/style/ellipsis.css +0 -1
- package/es/style/ellipsis.less +0 -13
- package/es/style/hairline.css +0 -1
- package/es/style/hairline.less +0 -47
- package/es/style/iconfont.css +0 -1
- package/es/style/iconfont.less +0 -910
- package/es/style/mixins/clearfix.css +0 -0
- package/es/style/mixins/clearfix.less +0 -7
- package/es/style/mixins/ellipsis.css +0 -0
- package/es/style/mixins/ellipsis.less +0 -15
- package/es/style/mixins/hairline.css +0 -0
- package/es/style/mixins/hairline.less +0 -39
- package/es/style/normalize.css +0 -1
- package/es/style/normalize.less +0 -38
- package/es/style/reset.css +0 -1
- package/es/style/reset.less +0 -171
- package/es/style/var.css +0 -0
- package/es/style/var.less +0 -983
- package/es/swipe/index.css +0 -1
- package/es/swipe/index.js +0 -429
- package/es/swipe/index.less +0 -56
- package/es/swipe/style/index.js +0 -2
- package/es/swipe/style/less.js +0 -2
- package/es/swipe-item/index.css +0 -1
- package/es/swipe-item/index.js +0 -78
- package/es/swipe-item/index.less +0 -8
- package/es/swipe-item/style/index.js +0 -2
- package/es/swipe-item/style/less.js +0 -2
- package/es/switch/index.css +0 -1
- package/es/switch/index.js +0 -74
- package/es/switch/index.less +0 -57
- package/es/switch/shared.js +0 -19
- package/es/switch/style/index.js +0 -3
- package/es/switch/style/less.js +0 -3
- package/es/tab/index.css +0 -1
- package/es/tab/index.js +0 -102
- package/es/tab/index.less +0 -24
- package/es/tab/style/index.js +0 -2
- package/es/tab/style/less.js +0 -2
- package/es/tabs/Content.js +0 -78
- package/es/tabs/Title.js +0 -92
- package/es/tabs/index.css +0 -1
- package/es/tabs/index.js +0 -419
- package/es/tabs/index.less +0 -153
- package/es/tabs/style/index.js +0 -4
- package/es/tabs/style/less.js +0 -4
- package/es/tabs/utils.js +0 -43
- package/es/tag/index.css +0 -1
- package/es/tag/index.js +0 -74
- package/es/tag/index.less +0 -97
- package/es/tag/style/index.js +0 -4
- package/es/tag/style/less.js +0 -4
- package/es/toast/Toast.js +0 -155
- package/es/toast/index.css +0 -1
- package/es/toast/index.js +0 -189
- package/es/toast/index.less +0 -76
- package/es/toast/lock-click.js +0 -16
- package/es/toast/style/index.js +0 -7
- package/es/toast/style/less.js +0 -7
- package/es/types/address-edit.d.js +0 -11
- package/es/types/area.d.js +0 -11
- package/es/types/calendar.d.js +0 -11
- package/es/types/checkbox-group.d.js +0 -11
- package/es/types/checkbox.d.js +0 -11
- package/es/types/collapse-item.d.js +0 -11
- package/es/types/component.d.js +0 -11
- package/es/types/count-down.d.js +0 -11
- package/es/types/datetime-picker.d.js +0 -11
- package/es/types/dialog.d.js +0 -1
- package/es/types/dropdown-item.d.js +0 -11
- package/es/types/field.d.js +0 -11
- package/es/types/form.d.js +0 -11
- package/es/types/image-preview.d.js +0 -12
- package/es/types/index-bar.d.js +0 -11
- package/es/types/index.d.js +0 -590
- package/es/types/jsx.d.js +0 -0
- package/es/types/lazyload.d.js +0 -1
- package/es/types/list.d.js +0 -11
- package/es/types/locale.d.js +0 -1
- package/es/types/mixins/popup.d.js +0 -1
- package/es/types/notify.d.js +0 -2
- package/es/types/picker.d.js +0 -11
- package/es/types/progress.d.js +0 -11
- package/es/types/sku.d.js +0 -11
- package/es/types/swipe-cell.d.js +0 -11
- package/es/types/swipe.d.js +0 -11
- package/es/types/tabs.d.js +0 -11
- package/es/types/toast.d.js +0 -2
- package/es/types/uploader.d.js +0 -11
- package/es/uploader/index.css +0 -1
- package/es/uploader/index.js +0 -451
- package/es/uploader/index.less +0 -159
- package/es/uploader/style/index.js +0 -11
- package/es/uploader/style/less.js +0 -11
- package/es/uploader/utils.js +0 -57
- package/es/utils/constant.js +0 -10
- package/es/utils/create/bem.js +0 -39
- package/es/utils/create/component.js +0 -57
- package/es/utils/create/i18n.js +0 -16
- package/es/utils/create/index.js +0 -7
- package/es/utils/deep-assign.js +0 -24
- package/es/utils/deep-clone.js +0 -14
- package/es/utils/dom/event.js +0 -48
- package/es/utils/dom/node.js +0 -7
- package/es/utils/dom/raf.js +0 -36
- package/es/utils/dom/reset-scroll.js +0 -14
- package/es/utils/dom/scroll.js +0 -69
- package/es/utils/dom/style.js +0 -9
- package/es/utils/format/number.js +0 -47
- package/es/utils/format/string.js +0 -19
- package/es/utils/format/unit.js +0 -59
- package/es/utils/functional.js +0 -56
- package/es/utils/index.js +0 -29
- package/es/utils/interceptor.js +0 -22
- package/es/utils/router.js +0 -36
- package/es/utils/types.js +0 -0
- package/es/utils/validate/date.js +0 -4
- package/es/utils/validate/email.js +0 -5
- package/es/utils/validate/mobile.js +0 -4
- package/es/utils/validate/number.js +0 -11
- package/es/utils/validate/system.js +0 -9
- package/es/utils/vnodes.js +0 -36
- package/lib/action-sheet/index.css +0 -1
- package/lib/action-sheet/index.js +0 -194
- package/lib/action-sheet/index.less +0 -112
- package/lib/action-sheet/style/index.js +0 -7
- package/lib/action-sheet/style/less.js +0 -7
- package/lib/area/index.js +0 -331
- package/lib/area/style/index.js +0 -3
- package/lib/area/style/less.js +0 -3
- package/lib/button/index.css +0 -1
- package/lib/button/index.js +0 -188
- package/lib/button/index.less +0 -238
- package/lib/button/style/index.js +0 -5
- package/lib/button/style/less.js +0 -5
- package/lib/calendar/components/Header.js +0 -63
- package/lib/calendar/components/Month.js +0 -336
- package/lib/calendar/index.css +0 -1
- package/lib/calendar/index.js +0 -557
- package/lib/calendar/index.less +0 -210
- package/lib/calendar/style/index.js +0 -9
- package/lib/calendar/style/less.js +0 -9
- package/lib/calendar/utils.js +0 -91
- package/lib/cell/index.css +0 -1
- package/lib/cell/index.js +0 -137
- package/lib/cell/index.less +0 -103
- package/lib/cell/shared.js +0 -29
- package/lib/cell/style/index.js +0 -4
- package/lib/cell/style/less.js +0 -4
- package/lib/cell-group/index.css +0 -1
- package/lib/cell-group/index.js +0 -47
- package/lib/cell-group/index.less +0 -12
- package/lib/cell-group/style/index.js +0 -2
- package/lib/cell-group/style/less.js +0 -2
- package/lib/checkbox/index.css +0 -1
- package/lib/checkbox/index.js +0 -88
- package/lib/checkbox/index.less +0 -85
- package/lib/checkbox/style/index.js +0 -4
- package/lib/checkbox/style/less.js +0 -4
- package/lib/checkbox-group/index.css +0 -1
- package/lib/checkbox-group/index.js +0 -73
- package/lib/checkbox-group/index.less +0 -8
- package/lib/checkbox-group/style/index.js +0 -2
- package/lib/checkbox-group/style/less.js +0 -2
- package/lib/collapse/index.js +0 -48
- package/lib/collapse/style/index.js +0 -1
- package/lib/collapse/style/less.js +0 -1
- package/lib/collapse-item/index.css +0 -1
- package/lib/collapse-item/index.js +0 -213
- package/lib/collapse-item/index.less +0 -67
- package/lib/collapse-item/style/index.js +0 -5
- package/lib/collapse-item/style/less.js +0 -5
- package/lib/contact-card/index.css +0 -1
- package/lib/contact-card/index.js +0 -72
- package/lib/contact-card/index.less +0 -42
- package/lib/contact-card/style/index.js +0 -5
- package/lib/contact-card/style/less.js +0 -5
- package/lib/contact-edit/index.css +0 -1
- package/lib/contact-edit/index.js +0 -210
- package/lib/contact-edit/index.less +0 -30
- package/lib/contact-edit/style/index.js +0 -14
- package/lib/contact-edit/style/less.js +0 -14
- package/lib/contact-list/index.css +0 -1
- package/lib/contact-list/index.js +0 -138
- package/lib/contact-list/index.less +0 -54
- package/lib/contact-list/style/index.js +0 -10
- package/lib/contact-list/style/less.js +0 -10
- package/lib/datetime-picker/DatePicker.js +0 -261
- package/lib/datetime-picker/TimePicker.js +0 -117
- package/lib/datetime-picker/index.js +0 -41
- package/lib/datetime-picker/shared.js +0 -124
- package/lib/datetime-picker/style/index.js +0 -3
- package/lib/datetime-picker/style/less.js +0 -3
- package/lib/datetime-picker/utils.js +0 -39
- package/lib/demo-button/index-sfc.css +0 -1
- package/lib/demo-button/index-sfc.less +0 -9
- package/lib/demo-button/index.js +0 -33
- package/lib/demo-button/style/index.js +0 -1
- package/lib/demo-button/style/less.js +0 -1
- package/lib/dialog/Dialog.js +0 -261
- package/lib/dialog/index.css +0 -1
- package/lib/dialog/index.js +0 -116
- package/lib/dialog/index.less +0 -153
- package/lib/dialog/style/index.js +0 -10
- package/lib/dialog/style/less.js +0 -10
- package/lib/dropdown-item/index.css +0 -1
- package/lib/dropdown-item/index.js +0 -225
- package/lib/dropdown-item/index.less +0 -39
- package/lib/dropdown-item/style/index.js +0 -7
- package/lib/dropdown-item/style/less.js +0 -7
- package/lib/dropdown-menu/index.css +0 -1
- package/lib/dropdown-menu/index.js +0 -142
- package/lib/dropdown-menu/index.less +0 -77
- package/lib/dropdown-menu/style/index.js +0 -2
- package/lib/dropdown-menu/style/less.js +0 -2
- package/lib/empty/Network.js +0 -198
- package/lib/empty/index.css +0 -1
- package/lib/empty/index.js +0 -92
- package/lib/empty/index.less +0 -32
- package/lib/empty/style/index.js +0 -2
- package/lib/empty/style/less.js +0 -2
- package/lib/field/index.css +0 -1
- package/lib/field/index.js +0 -639
- package/lib/field/index.less +0 -172
- package/lib/field/style/index.js +0 -5
- package/lib/field/style/less.js +0 -5
- package/lib/form/index.js +0 -208
- package/lib/form/style/index.js +0 -1
- package/lib/form/style/less.js +0 -1
- package/lib/goods-action/index.css +0 -1
- package/lib/goods-action/index.js +0 -32
- package/lib/goods-action/index.less +0 -19
- package/lib/goods-action/style/index.js +0 -2
- package/lib/goods-action/style/less.js +0 -2
- package/lib/goods-action-button/index.css +0 -1
- package/lib/goods-action-button/index.js +0 -70
- package/lib/goods-action-button/index.less +0 -34
- package/lib/goods-action-button/style/index.js +0 -6
- package/lib/goods-action-button/style/less.js +0 -6
- package/lib/icon/index.css +0 -1
- package/lib/icon/index.js +0 -87
- package/lib/icon/index.less +0 -11
- package/lib/icon/local.css +0 -1
- package/lib/icon/local.less +0 -1
- package/lib/icon/style/index.js +0 -3
- package/lib/icon/style/less.js +0 -3
- package/lib/image/index.css +0 -1
- package/lib/image/index.js +0 -199
- package/lib/image/index.less +0 -47
- package/lib/image/style/index.js +0 -4
- package/lib/image/style/less.js +0 -4
- package/lib/image-preview/ImagePreview.js +0 -250
- package/lib/image-preview/ImagePreviewItem.js +0 -256
- package/lib/image-preview/index.css +0 -1
- package/lib/image-preview/index.js +0 -96
- package/lib/image-preview/index.less +0 -103
- package/lib/image-preview/shared.js +0 -13
- package/lib/image-preview/style/index.js +0 -10
- package/lib/image-preview/style/less.js +0 -10
- package/lib/index-anchor/index.css +0 -1
- package/lib/index-anchor/index.js +0 -93
- package/lib/index-anchor/index.less +0 -21
- package/lib/index-anchor/style/index.js +0 -2
- package/lib/index-anchor/style/less.js +0 -2
- package/lib/index-bar/index.css +0 -1
- package/lib/index-bar/index.js +0 -235
- package/lib/index-bar/index.less +0 -27
- package/lib/index-bar/style/index.js +0 -2
- package/lib/index-bar/style/less.js +0 -2
- package/lib/index.css +0 -1
- package/lib/index.js +0 -262
- package/lib/index.less +0 -52
- package/lib/info/index.css +0 -1
- package/lib/info/index.js +0 -42
- package/lib/info/index.less +0 -29
- package/lib/info/style/index.js +0 -2
- package/lib/info/style/less.js +0 -2
- package/lib/lazyload/index.js +0 -11
- package/lib/lazyload/style/index.js +0 -1
- package/lib/lazyload/style/less.js +0 -1
- package/lib/list/index.css +0 -1
- package/lib/list/index.js +0 -191
- package/lib/list/index.less +0 -21
- package/lib/list/style/index.js +0 -3
- package/lib/list/style/less.js +0 -3
- package/lib/loading/index.css +0 -1
- package/lib/loading/index.js +0 -98
- package/lib/loading/index.less +0 -103
- package/lib/loading/style/index.js +0 -2
- package/lib/loading/style/less.js +0 -2
- package/lib/locale/index.js +0 -38
- package/lib/locale/lang/de-DE-formal.js +0 -95
- package/lib/locale/lang/de-DE.js +0 -95
- package/lib/locale/lang/en-US.js +0 -95
- package/lib/locale/lang/es-ES.js +0 -95
- package/lib/locale/lang/ja-JP.js +0 -96
- package/lib/locale/lang/nb-NO.js +0 -95
- package/lib/locale/lang/ro-RO.js +0 -95
- package/lib/locale/lang/tr-TR.js +0 -95
- package/lib/locale/lang/zh-CN.js +0 -96
- package/lib/locale/lang/zh-HK.js +0 -96
- package/lib/locale/lang/zh-TW.js +0 -96
- package/lib/locale/style/index.js +0 -1
- package/lib/locale/style/less.js +0 -1
- package/lib/mixins/bind-event.js +0 -36
- package/lib/mixins/checkbox.js +0 -152
- package/lib/mixins/click-outside.js +0 -41
- package/lib/mixins/close-on-popstate.js +0 -46
- package/lib/mixins/field.js +0 -29
- package/lib/mixins/popup/context.js +0 -15
- package/lib/mixins/popup/index.js +0 -224
- package/lib/mixins/popup/overlay.js +0 -95
- package/lib/mixins/popup/type.js +0 -1
- package/lib/mixins/portal.js +0 -53
- package/lib/mixins/relation.js +0 -84
- package/lib/mixins/slots.js +0 -29
- package/lib/mixins/touch.js +0 -65
- package/lib/nav-bar/index.css +0 -1
- package/lib/nav-bar/index.js +0 -135
- package/lib/nav-bar/index.less +0 -77
- package/lib/nav-bar/style/index.js +0 -4
- package/lib/nav-bar/style/less.js +0 -4
- package/lib/number-keyboard/CollapseIcon.js +0 -21
- package/lib/number-keyboard/DeleteIcon.js +0 -21
- package/lib/number-keyboard/Key.js +0 -134
- package/lib/number-keyboard/index.css +0 -1
- package/lib/number-keyboard/index.js +0 -423
- package/lib/number-keyboard/index.less +0 -191
- package/lib/number-keyboard/style/index.js +0 -3
- package/lib/number-keyboard/style/less.js +0 -3
- package/lib/overlay/index.css +0 -1
- package/lib/overlay/index.js +0 -67
- package/lib/overlay/index.less +0 -11
- package/lib/overlay/style/index.js +0 -2
- package/lib/overlay/style/less.js +0 -2
- package/lib/password-input/index.css +0 -1
- package/lib/password-input/index.js +0 -97
- package/lib/password-input/index.less +0 -83
- package/lib/password-input/style/index.js +0 -2
- package/lib/password-input/style/less.js +0 -2
- package/lib/picker/PickerColumn.js +0 -314
- package/lib/picker/index.css +0 -1
- package/lib/picker/index.js +0 -399
- package/lib/picker/index.less +0 -118
- package/lib/picker/shared.js +0 -28
- package/lib/picker/style/index.js +0 -3
- package/lib/picker/style/less.js +0 -3
- package/lib/popover/index.css +0 -1
- package/lib/popover/index.js +0 -226
- package/lib/popover/index.less +0 -270
- package/lib/popover/style/index.js +0 -6
- package/lib/popover/style/less.js +0 -6
- package/lib/popup/index.css +0 -1
- package/lib/popup/index.js +0 -122
- package/lib/popup/index.less +0 -140
- package/lib/popup/style/index.js +0 -5
- package/lib/popup/style/less.js +0 -5
- package/lib/pull-refresh/index.css +0 -1
- package/lib/pull-refresh/index.js +0 -227
- package/lib/pull-refresh/index.less +0 -25
- package/lib/pull-refresh/style/index.js +0 -3
- package/lib/pull-refresh/style/less.js +0 -3
- package/lib/radio/index.css +0 -1
- package/lib/radio/index.js +0 -40
- package/lib/radio/index.less +0 -86
- package/lib/radio/style/index.js +0 -4
- package/lib/radio/style/less.js +0 -4
- package/lib/radio-group/index.css +0 -1
- package/lib/radio-group/index.js +0 -41
- package/lib/radio-group/index.less +0 -8
- package/lib/radio-group/style/index.js +0 -2
- package/lib/radio-group/style/less.js +0 -2
- package/lib/rate/index.css +0 -1
- package/lib/rate/index.js +0 -240
- package/lib/rate/index.less +0 -46
- package/lib/rate/style/index.js +0 -4
- package/lib/rate/style/less.js +0 -4
- package/lib/search/index.css +0 -1
- package/lib/search/index.js +0 -128
- package/lib/search/index.less +0 -68
- package/lib/search/style/index.js +0 -6
- package/lib/search/style/less.js +0 -6
- package/lib/slider/index.css +0 -1
- package/lib/slider/index.js +0 -300
- package/lib/slider/index.less +0 -94
- package/lib/slider/style/index.js +0 -2
- package/lib/slider/style/less.js +0 -2
- package/lib/step/index.css +0 -1
- package/lib/step/index.js +0 -127
- package/lib/step/index.less +0 -151
- package/lib/step/style/index.js +0 -4
- package/lib/step/style/less.js +0 -4
- package/lib/stepper/index.css +0 -1
- package/lib/stepper/index.js +0 -369
- package/lib/stepper/index.less +0 -129
- package/lib/stepper/style/index.js +0 -2
- package/lib/stepper/style/less.js +0 -2
- package/lib/steps/index.css +0 -1
- package/lib/steps/index.js +0 -43
- package/lib/steps/index.less +0 -21
- package/lib/steps/style/index.js +0 -2
- package/lib/steps/style/less.js +0 -2
- package/lib/sticky/index.css +0 -1
- package/lib/sticky/index.js +0 -157
- package/lib/sticky/index.less +0 -11
- package/lib/sticky/style/index.js +0 -2
- package/lib/sticky/style/less.js +0 -2
- package/lib/style/animation.css +0 -1
- package/lib/style/animation.less +0 -139
- package/lib/style/base.css +0 -1
- package/lib/style/base.less +0 -10
- package/lib/style/clearfix.css +0 -1
- package/lib/style/clearfix.less +0 -5
- package/lib/style/ellipsis.css +0 -1
- package/lib/style/ellipsis.less +0 -13
- package/lib/style/hairline.css +0 -1
- package/lib/style/hairline.less +0 -47
- package/lib/style/iconfont.css +0 -1
- package/lib/style/iconfont.less +0 -910
- package/lib/style/mixins/clearfix.css +0 -0
- package/lib/style/mixins/clearfix.less +0 -7
- package/lib/style/mixins/ellipsis.css +0 -0
- package/lib/style/mixins/ellipsis.less +0 -15
- package/lib/style/mixins/hairline.css +0 -0
- package/lib/style/mixins/hairline.less +0 -39
- package/lib/style/normalize.css +0 -1
- package/lib/style/normalize.less +0 -38
- package/lib/style/reset.css +0 -1
- package/lib/style/reset.less +0 -171
- package/lib/style/var.css +0 -0
- package/lib/style/var.less +0 -983
- package/lib/swipe/index.css +0 -1
- package/lib/swipe/index.js +0 -443
- package/lib/swipe/index.less +0 -56
- package/lib/swipe/style/index.js +0 -2
- package/lib/swipe/style/less.js +0 -2
- package/lib/swipe-item/index.css +0 -1
- package/lib/swipe-item/index.js +0 -89
- package/lib/swipe-item/index.less +0 -8
- package/lib/swipe-item/style/index.js +0 -2
- package/lib/swipe-item/style/less.js +0 -2
- package/lib/switch/index.css +0 -1
- package/lib/switch/index.js +0 -86
- package/lib/switch/index.less +0 -57
- package/lib/switch/shared.js +0 -25
- package/lib/switch/style/index.js +0 -3
- package/lib/switch/style/less.js +0 -3
- package/lib/tab/index.css +0 -1
- package/lib/tab/index.js +0 -114
- package/lib/tab/index.less +0 -24
- package/lib/tab/style/index.js +0 -2
- package/lib/tab/style/less.js +0 -2
- package/lib/tabs/Content.js +0 -90
- package/lib/tabs/Title.js +0 -102
- package/lib/tabs/index.css +0 -1
- package/lib/tabs/index.js +0 -441
- package/lib/tabs/index.less +0 -153
- package/lib/tabs/style/index.js +0 -4
- package/lib/tabs/style/less.js +0 -4
- package/lib/tabs/utils.js +0 -53
- package/lib/tag/index.css +0 -1
- package/lib/tag/index.js +0 -87
- package/lib/tag/index.less +0 -97
- package/lib/tag/style/index.js +0 -4
- package/lib/tag/style/less.js +0 -4
- package/lib/tlvant.js +0 -16647
- package/lib/tlvant.min.js +0 -7
- package/lib/toast/Toast.js +0 -168
- package/lib/toast/index.css +0 -1
- package/lib/toast/index.js +0 -200
- package/lib/toast/index.less +0 -76
- package/lib/toast/lock-click.js +0 -21
- package/lib/toast/style/index.js +0 -7
- package/lib/toast/style/less.js +0 -7
- package/lib/types/address-edit.d.js +0 -22
- package/lib/types/area.d.js +0 -22
- package/lib/types/calendar.d.js +0 -22
- package/lib/types/checkbox-group.d.js +0 -22
- package/lib/types/checkbox.d.js +0 -22
- package/lib/types/collapse-item.d.js +0 -22
- package/lib/types/component.d.js +0 -22
- package/lib/types/count-down.d.js +0 -22
- package/lib/types/datetime-picker.d.js +0 -22
- package/lib/types/dialog.d.js +0 -6
- package/lib/types/dropdown-item.d.js +0 -22
- package/lib/types/field.d.js +0 -22
- package/lib/types/form.d.js +0 -22
- package/lib/types/image-preview.d.js +0 -24
- package/lib/types/index-bar.d.js +0 -22
- package/lib/types/index.d.js +0 -862
- package/lib/types/jsx.d.js +0 -1
- package/lib/types/lazyload.d.js +0 -6
- package/lib/types/list.d.js +0 -22
- package/lib/types/locale.d.js +0 -6
- package/lib/types/mixins/popup.d.js +0 -8
- package/lib/types/notify.d.js +0 -11
- package/lib/types/picker.d.js +0 -22
- package/lib/types/progress.d.js +0 -22
- package/lib/types/sku.d.js +0 -22
- package/lib/types/swipe-cell.d.js +0 -22
- package/lib/types/swipe.d.js +0 -22
- package/lib/types/tabs.d.js +0 -22
- package/lib/types/toast.d.js +0 -11
- package/lib/types/uploader.d.js +0 -22
- package/lib/uploader/index.css +0 -1
- package/lib/uploader/index.js +0 -467
- package/lib/uploader/index.less +0 -159
- package/lib/uploader/style/index.js +0 -11
- package/lib/uploader/style/less.js +0 -11
- package/lib/uploader/utils.js +0 -71
- package/lib/utils/constant.js +0 -22
- package/lib/utils/create/bem.js +0 -44
- package/lib/utils/create/component.js +0 -70
- package/lib/utils/create/i18n.js +0 -27
- package/lib/utils/create/index.js +0 -15
- package/lib/utils/deep-assign.js +0 -30
- package/lib/utils/deep-clone.js +0 -20
- package/lib/utils/dom/event.js +0 -62
- package/lib/utils/dom/node.js +0 -12
- package/lib/utils/dom/raf.js +0 -47
- package/lib/utils/dom/reset-scroll.js +0 -21
- package/lib/utils/dom/scroll.js +0 -89
- package/lib/utils/dom/style.js +0 -14
- package/lib/utils/format/number.js +0 -53
- package/lib/utils/format/string.js +0 -26
- package/lib/utils/format/unit.js +0 -68
- package/lib/utils/functional.js +0 -68
- package/lib/utils/index.js +0 -56
- package/lib/utils/interceptor.js +0 -28
- package/lib/utils/router.js +0 -46
- package/lib/utils/types.js +0 -1
- package/lib/utils/validate/date.js +0 -10
- package/lib/utils/validate/email.js +0 -10
- package/lib/utils/validate/mobile.js +0 -9
- package/lib/utils/validate/number.js +0 -18
- package/lib/utils/validate/system.js +0 -17
- package/lib/utils/vnodes.js +0 -41
package/es/calendar/index.js
DELETED
|
@@ -1,539 +0,0 @@
|
|
|
1
|
-
// Utils
|
|
2
|
-
import { raf } from '../utils/dom/raf';
|
|
3
|
-
import { isDate } from '../utils/validate/date';
|
|
4
|
-
import { getScrollTop } from '../utils/dom/scroll';
|
|
5
|
-
import { t, bem, copyDate, copyDates, getNextDay, compareDay, calcDateNum, compareMonth, createComponent, getDayByOffset } from './utils'; // Components
|
|
6
|
-
|
|
7
|
-
import Popup from '../popup';
|
|
8
|
-
import Button from '../button';
|
|
9
|
-
import Toast from '../toast';
|
|
10
|
-
import Month from './components/Month';
|
|
11
|
-
import Header from './components/Header';
|
|
12
|
-
export default createComponent({
|
|
13
|
-
props: {
|
|
14
|
-
title: String,
|
|
15
|
-
color: String,
|
|
16
|
-
value: Boolean,
|
|
17
|
-
readonly: Boolean,
|
|
18
|
-
formatter: Function,
|
|
19
|
-
rowHeight: [Number, String],
|
|
20
|
-
confirmText: String,
|
|
21
|
-
rangePrompt: String,
|
|
22
|
-
defaultDate: [Date, Array],
|
|
23
|
-
getContainer: [String, Function],
|
|
24
|
-
allowSameDay: Boolean,
|
|
25
|
-
confirmDisabledText: String,
|
|
26
|
-
type: {
|
|
27
|
-
type: String,
|
|
28
|
-
default: 'single'
|
|
29
|
-
},
|
|
30
|
-
round: {
|
|
31
|
-
type: Boolean,
|
|
32
|
-
default: true
|
|
33
|
-
},
|
|
34
|
-
position: {
|
|
35
|
-
type: String,
|
|
36
|
-
default: 'bottom'
|
|
37
|
-
},
|
|
38
|
-
poppable: {
|
|
39
|
-
type: Boolean,
|
|
40
|
-
default: true
|
|
41
|
-
},
|
|
42
|
-
maxRange: {
|
|
43
|
-
type: [Number, String],
|
|
44
|
-
default: null
|
|
45
|
-
},
|
|
46
|
-
lazyRender: {
|
|
47
|
-
type: Boolean,
|
|
48
|
-
default: true
|
|
49
|
-
},
|
|
50
|
-
showMark: {
|
|
51
|
-
type: Boolean,
|
|
52
|
-
default: true
|
|
53
|
-
},
|
|
54
|
-
showTitle: {
|
|
55
|
-
type: Boolean,
|
|
56
|
-
default: true
|
|
57
|
-
},
|
|
58
|
-
showConfirm: {
|
|
59
|
-
type: Boolean,
|
|
60
|
-
default: true
|
|
61
|
-
},
|
|
62
|
-
showSubtitle: {
|
|
63
|
-
type: Boolean,
|
|
64
|
-
default: true
|
|
65
|
-
},
|
|
66
|
-
closeOnPopstate: {
|
|
67
|
-
type: Boolean,
|
|
68
|
-
default: true
|
|
69
|
-
},
|
|
70
|
-
closeOnClickOverlay: {
|
|
71
|
-
type: Boolean,
|
|
72
|
-
default: true
|
|
73
|
-
},
|
|
74
|
-
safeAreaInsetBottom: {
|
|
75
|
-
type: Boolean,
|
|
76
|
-
default: true
|
|
77
|
-
},
|
|
78
|
-
minDate: {
|
|
79
|
-
type: Date,
|
|
80
|
-
validator: isDate,
|
|
81
|
-
default: function _default() {
|
|
82
|
-
return new Date();
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
maxDate: {
|
|
86
|
-
type: Date,
|
|
87
|
-
validator: isDate,
|
|
88
|
-
default: function _default() {
|
|
89
|
-
var now = new Date();
|
|
90
|
-
return new Date(now.getFullYear(), now.getMonth() + 6, now.getDate());
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
firstDayOfWeek: {
|
|
94
|
-
type: [Number, String],
|
|
95
|
-
default: 0,
|
|
96
|
-
validator: function validator(val) {
|
|
97
|
-
return val >= 0 && val <= 6;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
data: function data() {
|
|
102
|
-
return {
|
|
103
|
-
subtitle: '',
|
|
104
|
-
currentDate: this.getInitialDate(),
|
|
105
|
-
commonday: 2
|
|
106
|
-
};
|
|
107
|
-
},
|
|
108
|
-
computed: {
|
|
109
|
-
months: function months() {
|
|
110
|
-
var months = [];
|
|
111
|
-
var cursor = new Date(this.minDate);
|
|
112
|
-
cursor.setDate(1);
|
|
113
|
-
|
|
114
|
-
do {
|
|
115
|
-
months.push(new Date(cursor));
|
|
116
|
-
cursor.setMonth(cursor.getMonth() + 1);
|
|
117
|
-
} while (compareMonth(cursor, this.maxDate) !== 1);
|
|
118
|
-
|
|
119
|
-
return months;
|
|
120
|
-
},
|
|
121
|
-
buttonDisabled: function buttonDisabled() {
|
|
122
|
-
var type = this.type,
|
|
123
|
-
currentDate = this.currentDate;
|
|
124
|
-
|
|
125
|
-
if (currentDate) {
|
|
126
|
-
if (type === 'range') {
|
|
127
|
-
return !currentDate[0] || !currentDate[1];
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
if (type === 'multiple') {
|
|
131
|
-
return !currentDate.length;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
return !currentDate;
|
|
136
|
-
},
|
|
137
|
-
dayOffset: function dayOffset() {
|
|
138
|
-
return this.firstDayOfWeek ? this.firstDayOfWeek % 7 : 0;
|
|
139
|
-
}
|
|
140
|
-
},
|
|
141
|
-
watch: {
|
|
142
|
-
value: 'init',
|
|
143
|
-
type: function type() {
|
|
144
|
-
this.reset();
|
|
145
|
-
},
|
|
146
|
-
defaultDate: function defaultDate(val) {
|
|
147
|
-
this.currentDate = val;
|
|
148
|
-
this.scrollIntoView();
|
|
149
|
-
}
|
|
150
|
-
},
|
|
151
|
-
mounted: function mounted() {
|
|
152
|
-
this.init();
|
|
153
|
-
},
|
|
154
|
-
|
|
155
|
-
/* istanbul ignore next */
|
|
156
|
-
activated: function activated() {
|
|
157
|
-
this.init();
|
|
158
|
-
},
|
|
159
|
-
methods: {
|
|
160
|
-
// @exposed-api
|
|
161
|
-
reset: function reset(date) {
|
|
162
|
-
if (date === void 0) {
|
|
163
|
-
date = this.getInitialDate();
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
this.currentDate = date;
|
|
167
|
-
this.scrollIntoView();
|
|
168
|
-
},
|
|
169
|
-
init: function init() {
|
|
170
|
-
var _this = this;
|
|
171
|
-
|
|
172
|
-
if (this.poppable && !this.value) {
|
|
173
|
-
return;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
this.$nextTick(function () {
|
|
177
|
-
// add Math.floor to avoid decimal height issues
|
|
178
|
-
// https://github.com/youzan/vant/issues/5640
|
|
179
|
-
_this.bodyHeight = Math.floor(_this.$refs.body.getBoundingClientRect().height);
|
|
180
|
-
|
|
181
|
-
_this.onScroll();
|
|
182
|
-
|
|
183
|
-
_this.scrollIntoView();
|
|
184
|
-
});
|
|
185
|
-
},
|
|
186
|
-
// @exposed-api
|
|
187
|
-
scrollToDate: function scrollToDate(targetDate) {
|
|
188
|
-
var _this2 = this;
|
|
189
|
-
|
|
190
|
-
raf(function () {
|
|
191
|
-
var displayed = _this2.value || !_this2.poppable;
|
|
192
|
-
/* istanbul ignore if */
|
|
193
|
-
|
|
194
|
-
if (!targetDate || !displayed) {
|
|
195
|
-
return;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
_this2.months.some(function (month, index) {
|
|
199
|
-
if (compareMonth(month, targetDate) === 0) {
|
|
200
|
-
var _this2$$refs = _this2.$refs,
|
|
201
|
-
body = _this2$$refs.body,
|
|
202
|
-
months = _this2$$refs.months;
|
|
203
|
-
months[index].scrollIntoView(body);
|
|
204
|
-
return true;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
return false;
|
|
208
|
-
});
|
|
209
|
-
});
|
|
210
|
-
},
|
|
211
|
-
// scroll to current month
|
|
212
|
-
scrollIntoView: function scrollIntoView() {
|
|
213
|
-
var currentDate = this.currentDate;
|
|
214
|
-
|
|
215
|
-
if (currentDate) {
|
|
216
|
-
var targetDate = this.type === 'single' ? currentDate : currentDate[0];
|
|
217
|
-
this.scrollToDate(targetDate);
|
|
218
|
-
}
|
|
219
|
-
},
|
|
220
|
-
getInitialDate: function getInitialDate() {
|
|
221
|
-
var type = this.type,
|
|
222
|
-
minDate = this.minDate,
|
|
223
|
-
maxDate = this.maxDate,
|
|
224
|
-
defaultDate = this.defaultDate;
|
|
225
|
-
|
|
226
|
-
if (defaultDate === null) {
|
|
227
|
-
return defaultDate;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
var defaultVal = new Date();
|
|
231
|
-
|
|
232
|
-
if (compareDay(defaultVal, minDate) === -1) {
|
|
233
|
-
defaultVal = minDate;
|
|
234
|
-
} else if (compareDay(defaultVal, maxDate) === 1) {
|
|
235
|
-
defaultVal = maxDate;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
if (type === 'range') {
|
|
239
|
-
var _ref = defaultDate || [],
|
|
240
|
-
startDay = _ref[0],
|
|
241
|
-
endDay = _ref[1];
|
|
242
|
-
|
|
243
|
-
return [startDay || defaultVal, endDay || getNextDay(defaultVal)];
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
if (type === 'multiple') {
|
|
247
|
-
return defaultDate || [defaultVal];
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
return defaultDate || defaultVal;
|
|
251
|
-
},
|
|
252
|
-
// calculate the position of the elements
|
|
253
|
-
// and find the elements that needs to be rendered
|
|
254
|
-
onScroll: function onScroll() {
|
|
255
|
-
var _this$$refs = this.$refs,
|
|
256
|
-
body = _this$$refs.body,
|
|
257
|
-
months = _this$$refs.months;
|
|
258
|
-
var top = getScrollTop(body);
|
|
259
|
-
var bottom = top + this.bodyHeight;
|
|
260
|
-
var heights = months.map(function (item) {
|
|
261
|
-
return item.getHeight();
|
|
262
|
-
});
|
|
263
|
-
var heightSum = heights.reduce(function (a, b) {
|
|
264
|
-
return a + b;
|
|
265
|
-
}, 0); // iOS scroll bounce may exceed the range
|
|
266
|
-
|
|
267
|
-
if (bottom > heightSum && top > 0) {
|
|
268
|
-
return;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
var height = 0;
|
|
272
|
-
var currentMonth;
|
|
273
|
-
var visibleRange = [-1, -1];
|
|
274
|
-
|
|
275
|
-
for (var i = 0; i < months.length; i++) {
|
|
276
|
-
var visible = height <= bottom && height + heights[i] >= top;
|
|
277
|
-
|
|
278
|
-
if (visible) {
|
|
279
|
-
visibleRange[1] = i;
|
|
280
|
-
|
|
281
|
-
if (!currentMonth) {
|
|
282
|
-
currentMonth = months[i];
|
|
283
|
-
visibleRange[0] = i;
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
if (!months[i].showed) {
|
|
287
|
-
months[i].showed = true;
|
|
288
|
-
this.$emit('month-show', {
|
|
289
|
-
date: months[i].date,
|
|
290
|
-
title: months[i].title
|
|
291
|
-
});
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
height += heights[i];
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
months.forEach(function (month, index) {
|
|
299
|
-
month.visible = index >= visibleRange[0] - 1 && index <= visibleRange[1] + 1;
|
|
300
|
-
});
|
|
301
|
-
/* istanbul ignore else */
|
|
302
|
-
|
|
303
|
-
if (currentMonth) {
|
|
304
|
-
this.subtitle = currentMonth.title;
|
|
305
|
-
}
|
|
306
|
-
},
|
|
307
|
-
onClickDay: function onClickDay(item) {
|
|
308
|
-
if (this.readonly) {
|
|
309
|
-
return;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
var date = item.date;
|
|
313
|
-
var type = this.type,
|
|
314
|
-
currentDate = this.currentDate;
|
|
315
|
-
|
|
316
|
-
if (type === 'range') {
|
|
317
|
-
if (!currentDate) {
|
|
318
|
-
this.select([date, null]);
|
|
319
|
-
return;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
var startDay = currentDate[0],
|
|
323
|
-
endDay = currentDate[1];
|
|
324
|
-
|
|
325
|
-
if (startDay && !endDay) {
|
|
326
|
-
var compareToStart = compareDay(date, startDay);
|
|
327
|
-
|
|
328
|
-
if (compareToStart === 1) {
|
|
329
|
-
this.select([startDay, date], true);
|
|
330
|
-
} else if (compareToStart === -1) {
|
|
331
|
-
this.select([date, null]);
|
|
332
|
-
} else if (this.allowSameDay) {
|
|
333
|
-
this.select([date, date], true);
|
|
334
|
-
}
|
|
335
|
-
} else {
|
|
336
|
-
this.select([date, null]);
|
|
337
|
-
}
|
|
338
|
-
} else if (type === 'multiple') {
|
|
339
|
-
if (!currentDate) {
|
|
340
|
-
this.select([date]);
|
|
341
|
-
return;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
var selectedIndex;
|
|
345
|
-
var selected = this.currentDate.some(function (dateItem, index) {
|
|
346
|
-
var equal = compareDay(dateItem, date) === 0;
|
|
347
|
-
|
|
348
|
-
if (equal) {
|
|
349
|
-
selectedIndex = index;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
return equal;
|
|
353
|
-
});
|
|
354
|
-
|
|
355
|
-
if (selected) {
|
|
356
|
-
var _currentDate$splice = currentDate.splice(selectedIndex, 1),
|
|
357
|
-
unselectedDate = _currentDate$splice[0];
|
|
358
|
-
|
|
359
|
-
this.$emit('unselect', copyDate(unselectedDate));
|
|
360
|
-
} else if (this.maxRange && currentDate.length >= this.maxRange) {
|
|
361
|
-
Toast(this.rangePrompt || t('rangePrompt', this.maxRange));
|
|
362
|
-
} else {
|
|
363
|
-
this.select([].concat(currentDate, [date]));
|
|
364
|
-
}
|
|
365
|
-
} else {
|
|
366
|
-
this.select(date, true);
|
|
367
|
-
}
|
|
368
|
-
},
|
|
369
|
-
togglePopup: function togglePopup(val) {
|
|
370
|
-
this.$emit('input', val);
|
|
371
|
-
},
|
|
372
|
-
select: function select(date, complete) {
|
|
373
|
-
var _this3 = this;
|
|
374
|
-
|
|
375
|
-
var emit = function emit(date) {
|
|
376
|
-
_this3.currentDate = date;
|
|
377
|
-
|
|
378
|
-
_this3.$emit('select', copyDates(_this3.currentDate));
|
|
379
|
-
};
|
|
380
|
-
|
|
381
|
-
if (complete && this.type === 'range') {
|
|
382
|
-
var valid = this.checkRange(date);
|
|
383
|
-
|
|
384
|
-
if (!valid) {
|
|
385
|
-
// auto selected to max range if showConfirm
|
|
386
|
-
if (this.showConfirm) {
|
|
387
|
-
emit([date[0], getDayByOffset(date[0], this.maxRange - 1)]);
|
|
388
|
-
} else {
|
|
389
|
-
emit(date);
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
return;
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
emit(date);
|
|
397
|
-
|
|
398
|
-
if (complete && !this.showConfirm) {
|
|
399
|
-
this.onConfirm();
|
|
400
|
-
}
|
|
401
|
-
},
|
|
402
|
-
checkRange: function checkRange(date) {
|
|
403
|
-
var maxRange = this.maxRange,
|
|
404
|
-
rangePrompt = this.rangePrompt;
|
|
405
|
-
this.commonday = calcDateNum(date);
|
|
406
|
-
|
|
407
|
-
if (maxRange && calcDateNum(date) > maxRange) {
|
|
408
|
-
Toast(rangePrompt || t('rangePrompt', maxRange));
|
|
409
|
-
return false;
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
return true;
|
|
413
|
-
},
|
|
414
|
-
onConfirm: function onConfirm() {
|
|
415
|
-
this.$emit('confirm', copyDates(this.currentDate));
|
|
416
|
-
},
|
|
417
|
-
genMonth: function genMonth(date, index) {
|
|
418
|
-
var h = this.$createElement;
|
|
419
|
-
var showMonthTitle = index !== 0 || !this.showSubtitle;
|
|
420
|
-
return h(Month, {
|
|
421
|
-
"ref": "months",
|
|
422
|
-
"refInFor": true,
|
|
423
|
-
"attrs": {
|
|
424
|
-
"date": date,
|
|
425
|
-
"type": this.type,
|
|
426
|
-
"color": this.color,
|
|
427
|
-
"minDate": this.minDate,
|
|
428
|
-
"maxDate": this.maxDate,
|
|
429
|
-
"showMark": this.showMark,
|
|
430
|
-
"formatter": this.formatter,
|
|
431
|
-
"rowHeight": this.rowHeight,
|
|
432
|
-
"lazyRender": this.lazyRender,
|
|
433
|
-
"currentDate": this.currentDate,
|
|
434
|
-
"showSubtitle": this.showSubtitle,
|
|
435
|
-
"allowSameDay": this.allowSameDay,
|
|
436
|
-
"showMonthTitle": showMonthTitle,
|
|
437
|
-
"firstDayOfWeek": this.dayOffset,
|
|
438
|
-
"commonday": this.commonday
|
|
439
|
-
},
|
|
440
|
-
"on": {
|
|
441
|
-
"click": this.onClickDay
|
|
442
|
-
}
|
|
443
|
-
});
|
|
444
|
-
},
|
|
445
|
-
genFooterContent: function genFooterContent() {
|
|
446
|
-
var h = this.$createElement;
|
|
447
|
-
var slot = this.slots('footer');
|
|
448
|
-
|
|
449
|
-
if (slot) {
|
|
450
|
-
return slot;
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
if (this.showConfirm) {
|
|
454
|
-
var text = this.buttonDisabled ? this.confirmDisabledText : this.confirmText;
|
|
455
|
-
return h(Button, {
|
|
456
|
-
"attrs": {
|
|
457
|
-
"round": true,
|
|
458
|
-
"block": true,
|
|
459
|
-
"type": "danger",
|
|
460
|
-
"color": this.color,
|
|
461
|
-
"disabled": this.buttonDisabled,
|
|
462
|
-
"nativeType": "button"
|
|
463
|
-
},
|
|
464
|
-
"class": bem('confirm'),
|
|
465
|
-
"on": {
|
|
466
|
-
"click": this.onConfirm
|
|
467
|
-
}
|
|
468
|
-
}, [text || t('confirm'), ' ']);
|
|
469
|
-
}
|
|
470
|
-
},
|
|
471
|
-
genFooter: function genFooter() {
|
|
472
|
-
var h = this.$createElement;
|
|
473
|
-
return h("div", {
|
|
474
|
-
"class": bem('footer', {
|
|
475
|
-
unfit: !this.safeAreaInsetBottom
|
|
476
|
-
})
|
|
477
|
-
}, [' ', this.genFooterContent(), ' ']);
|
|
478
|
-
},
|
|
479
|
-
genCalendar: function genCalendar() {
|
|
480
|
-
var _this4 = this;
|
|
481
|
-
|
|
482
|
-
var h = this.$createElement;
|
|
483
|
-
return h("div", {
|
|
484
|
-
"class": bem()
|
|
485
|
-
}, [h(Header, {
|
|
486
|
-
"attrs": {
|
|
487
|
-
"title": this.title,
|
|
488
|
-
"showTitle": this.showTitle,
|
|
489
|
-
"subtitle": this.subtitle,
|
|
490
|
-
"showSubtitle": this.showSubtitle,
|
|
491
|
-
"firstDayOfWeek": this.dayOffset
|
|
492
|
-
},
|
|
493
|
-
"scopedSlots": {
|
|
494
|
-
title: function title() {
|
|
495
|
-
return _this4.slots('title');
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
}), ' ', h("div", {
|
|
499
|
-
"ref": "body",
|
|
500
|
-
"class": bem('body'),
|
|
501
|
-
"on": {
|
|
502
|
-
"scroll": this.onScroll
|
|
503
|
-
}
|
|
504
|
-
}, [' ', this.months.map(this.genMonth), ' ']), ' ', this.genFooter(), ' ']);
|
|
505
|
-
}
|
|
506
|
-
},
|
|
507
|
-
render: function render() {
|
|
508
|
-
var _this5 = this;
|
|
509
|
-
|
|
510
|
-
var h = arguments[0];
|
|
511
|
-
|
|
512
|
-
if (this.poppable) {
|
|
513
|
-
var _attrs;
|
|
514
|
-
|
|
515
|
-
var createListener = function createListener(name) {
|
|
516
|
-
return function () {
|
|
517
|
-
return _this5.$emit(name);
|
|
518
|
-
};
|
|
519
|
-
};
|
|
520
|
-
|
|
521
|
-
return h(Popup, {
|
|
522
|
-
"attrs": (_attrs = {
|
|
523
|
-
"round": true,
|
|
524
|
-
"value": this.value
|
|
525
|
-
}, _attrs["round"] = this.round, _attrs["position"] = this.position, _attrs["closeable"] = this.showTitle || this.showSubtitle, _attrs["getContainer"] = this.getContainer, _attrs["closeOnPopstate"] = this.closeOnPopstate, _attrs["closeOnClickOverlay"] = this.closeOnClickOverlay, _attrs),
|
|
526
|
-
"class": bem('popup'),
|
|
527
|
-
"on": {
|
|
528
|
-
"input": this.togglePopup,
|
|
529
|
-
"open": createListener('open'),
|
|
530
|
-
"opened": createListener('opened'),
|
|
531
|
-
"close": createListener('close'),
|
|
532
|
-
"closed": createListener('closed')
|
|
533
|
-
}
|
|
534
|
-
}, [this.genCalendar(), ' ']);
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
return this.genCalendar();
|
|
538
|
-
}
|
|
539
|
-
});
|