tlvant 0.0.22 → 0.0.24
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/es/action-sheet/index.css +1 -0
- package/es/action-sheet/index.js +177 -0
- package/es/action-sheet/index.less +112 -0
- package/es/action-sheet/style/index.js +7 -0
- package/es/action-sheet/style/less.js +7 -0
- package/es/area/index.js +321 -0
- package/es/area/style/index.js +3 -0
- package/es/area/style/less.js +3 -0
- package/es/button/index.css +1 -0
- package/es/button/index.js +171 -0
- package/es/button/index.less +238 -0
- package/es/button/style/index.js +5 -0
- package/es/button/style/less.js +5 -0
- package/es/calendar/components/Header.js +55 -0
- package/es/calendar/components/Month.js +326 -0
- package/es/calendar/index.css +1 -0
- package/es/calendar/index.js +539 -0
- package/es/calendar/index.less +210 -0
- package/es/calendar/style/index.js +9 -0
- package/es/calendar/style/less.js +9 -0
- package/es/calendar/utils.js +66 -0
- package/es/cell/index.css +1 -0
- package/es/cell/index.js +121 -0
- package/es/cell/index.less +103 -0
- package/es/cell/shared.js +24 -0
- package/es/cell/style/index.js +4 -0
- package/es/cell/style/less.js +4 -0
- package/es/cell-group/index.css +1 -0
- package/es/cell-group/index.js +34 -0
- package/es/cell-group/index.less +12 -0
- package/es/cell-group/style/index.js +2 -0
- package/es/cell-group/style/less.js +2 -0
- package/es/checkbox/index.css +1 -0
- package/es/checkbox/index.js +80 -0
- package/es/checkbox/index.less +85 -0
- package/es/checkbox/style/index.js +4 -0
- package/es/checkbox/style/less.js +4 -0
- package/es/checkbox-group/index.css +1 -0
- package/es/checkbox-group/index.js +64 -0
- package/es/checkbox-group/index.less +8 -0
- package/es/checkbox-group/style/index.js +2 -0
- package/es/checkbox-group/style/less.js +2 -0
- package/es/collapse/index.js +39 -0
- package/es/collapse/style/index.js +1 -0
- package/es/collapse/style/less.js +1 -0
- package/es/collapse-item/index.css +1 -0
- package/es/collapse-item/index.js +198 -0
- package/es/collapse-item/index.less +67 -0
- package/es/collapse-item/style/index.js +5 -0
- package/es/collapse-item/style/less.js +5 -0
- package/es/contact-card/index.css +1 -0
- package/es/contact-card/index.js +59 -0
- package/es/contact-card/index.less +42 -0
- package/es/contact-card/style/index.js +5 -0
- package/es/contact-card/style/less.js +5 -0
- package/es/contact-edit/index.css +1 -0
- package/es/contact-edit/index.js +193 -0
- package/es/contact-edit/index.less +30 -0
- package/es/contact-edit/style/index.js +14 -0
- package/es/contact-edit/style/less.js +14 -0
- package/es/contact-list/index.css +1 -0
- package/es/contact-list/index.js +119 -0
- package/es/contact-list/index.less +54 -0
- package/es/contact-list/style/index.js +10 -0
- package/es/contact-list/style/less.js +10 -0
- package/es/datetime-picker/DatePicker.js +246 -0
- package/es/datetime-picker/TimePicker.js +104 -0
- package/es/datetime-picker/index.js +29 -0
- package/es/datetime-picker/shared.js +110 -0
- package/es/datetime-picker/style/index.js +3 -0
- package/es/datetime-picker/style/less.js +3 -0
- package/es/datetime-picker/utils.js +29 -0
- package/es/demo-button/index-sfc.css +1 -0
- package/es/demo-button/index-sfc.less +9 -0
- package/es/demo-button/index.js +27 -0
- package/es/demo-button/style/index.js +1 -0
- package/es/demo-button/style/less.js +1 -0
- package/es/dialog/Dialog.js +246 -0
- package/es/dialog/index.css +1 -0
- package/es/dialog/index.js +104 -0
- package/es/dialog/index.less +153 -0
- package/es/dialog/style/index.js +10 -0
- package/es/dialog/style/less.js +10 -0
- package/es/dropdown-item/index.css +1 -0
- package/es/dropdown-item/index.js +210 -0
- package/es/dropdown-item/index.less +39 -0
- package/es/dropdown-item/style/index.js +7 -0
- package/es/dropdown-item/style/less.js +7 -0
- package/es/dropdown-menu/index.css +1 -0
- package/es/dropdown-menu/index.js +132 -0
- package/es/dropdown-menu/index.less +77 -0
- package/es/dropdown-menu/style/index.js +2 -0
- package/es/dropdown-menu/style/less.js +2 -0
- package/es/empty/Network.js +193 -0
- package/es/empty/index.css +1 -0
- package/es/empty/index.js +81 -0
- package/es/empty/index.less +32 -0
- package/es/empty/style/index.js +2 -0
- package/es/empty/style/less.js +2 -0
- package/es/field/index.css +1 -0
- package/es/field/index.js +623 -0
- package/es/field/index.less +172 -0
- package/es/field/style/index.js +5 -0
- package/es/field/style/less.js +5 -0
- package/es/form/index.js +200 -0
- package/es/form/style/index.js +1 -0
- package/es/form/style/less.js +1 -0
- package/es/goods-action/index.css +1 -0
- package/es/goods-action/index.js +24 -0
- package/es/goods-action/index.less +19 -0
- package/es/goods-action/style/index.js +2 -0
- package/es/goods-action/style/less.js +2 -0
- package/es/goods-action-button/index.css +1 -0
- package/es/goods-action-button/index.js +57 -0
- package/es/goods-action-button/index.less +34 -0
- package/es/goods-action-button/style/index.js +6 -0
- package/es/goods-action-button/style/less.js +6 -0
- package/es/icon/index.css +1 -0
- package/es/icon/index.js +74 -0
- package/es/icon/index.less +11 -0
- package/es/icon/local.css +1 -0
- package/es/icon/local.less +1 -0
- package/es/icon/style/index.js +3 -0
- package/es/icon/style/less.js +3 -0
- package/es/image/index.css +1 -0
- package/es/image/index.js +189 -0
- package/es/image/index.less +47 -0
- package/es/image/style/index.js +4 -0
- package/es/image/style/less.js +4 -0
- package/es/image-preview/ImagePreview.js +234 -0
- package/es/image-preview/ImagePreviewItem.js +242 -0
- package/es/image-preview/index.css +1 -0
- package/es/image-preview/index.js +86 -0
- package/es/image-preview/index.less +103 -0
- package/es/image-preview/shared.js +7 -0
- package/es/image-preview/style/index.js +10 -0
- package/es/image-preview/style/less.js +10 -0
- package/es/index-anchor/index.css +1 -0
- package/es/index-anchor/index.js +83 -0
- package/es/index-anchor/index.less +21 -0
- package/es/index-anchor/style/index.js +2 -0
- package/es/index-anchor/style/less.js +2 -0
- package/es/index-bar/index.css +1 -0
- package/es/index-bar/index.js +222 -0
- package/es/index-bar/index.less +27 -0
- package/es/index-bar/style/index.js +2 -0
- package/es/index-bar/style/less.js +2 -0
- package/es/index.js +80 -0
- package/es/info/index.css +1 -0
- package/es/info/index.js +30 -0
- package/es/info/index.less +29 -0
- package/es/info/style/index.js +2 -0
- package/es/info/style/less.js +2 -0
- package/es/lazyload/index.js +2 -0
- package/es/lazyload/style/index.js +1 -0
- package/es/lazyload/style/less.js +1 -0
- package/es/list/index.css +1 -0
- package/es/list/index.js +178 -0
- package/es/list/index.less +21 -0
- package/es/list/style/index.js +3 -0
- package/es/list/style/less.js +3 -0
- package/es/loading/index.css +1 -0
- package/es/loading/index.js +86 -0
- package/es/loading/index.less +103 -0
- package/es/loading/style/index.js +2 -0
- package/es/loading/style/less.js +2 -0
- package/es/locale/index.js +27 -0
- package/es/locale/lang/de-DE-formal.js +90 -0
- package/es/locale/lang/de-DE.js +90 -0
- package/es/locale/lang/en-US.js +90 -0
- package/es/locale/lang/es-ES.js +90 -0
- package/es/locale/lang/ja-JP.js +91 -0
- package/es/locale/lang/nb-NO.js +90 -0
- package/es/locale/lang/ro-RO.js +90 -0
- package/es/locale/lang/tr-TR.js +90 -0
- package/es/locale/lang/zh-CN.js +91 -0
- package/es/locale/lang/zh-HK.js +91 -0
- package/es/locale/lang/zh-TW.js +91 -0
- package/es/locale/style/index.js +1 -0
- package/es/locale/style/less.js +1 -0
- package/es/mixins/bind-event.js +29 -0
- package/es/mixins/checkbox.js +139 -0
- package/es/mixins/click-outside.js +33 -0
- package/es/mixins/close-on-popstate.js +38 -0
- package/es/mixins/field.js +24 -0
- package/es/mixins/popup/context.js +10 -0
- package/es/mixins/popup/index.js +208 -0
- package/es/mixins/popup/overlay.js +76 -0
- package/es/mixins/popup/type.js +0 -0
- package/es/mixins/portal.js +48 -0
- package/es/mixins/relation.js +76 -0
- package/es/mixins/slots.js +23 -0
- package/es/mixins/touch.js +58 -0
- package/es/nav-bar/index.css +1 -0
- package/es/nav-bar/index.js +124 -0
- package/es/nav-bar/index.less +77 -0
- package/es/nav-bar/style/index.js +4 -0
- package/es/nav-bar/style/less.js +4 -0
- package/es/number-keyboard/CollapseIcon.js +16 -0
- package/es/number-keyboard/DeleteIcon.js +16 -0
- package/es/number-keyboard/Key.js +121 -0
- package/es/number-keyboard/index.css +1 -0
- package/es/number-keyboard/index.js +409 -0
- package/es/number-keyboard/index.less +191 -0
- package/es/number-keyboard/style/index.js +3 -0
- package/es/number-keyboard/style/less.js +3 -0
- package/es/overlay/index.css +1 -0
- package/es/overlay/index.js +53 -0
- package/es/overlay/index.less +11 -0
- package/es/overlay/style/index.js +2 -0
- package/es/overlay/style/less.js +2 -0
- package/es/password-input/index.css +1 -0
- package/es/password-input/index.js +84 -0
- package/es/password-input/index.less +83 -0
- package/es/password-input/style/index.js +2 -0
- package/es/password-input/style/less.js +2 -0
- package/es/picker/PickerColumn.js +300 -0
- package/es/picker/index.css +1 -0
- package/es/picker/index.js +383 -0
- package/es/picker/index.less +118 -0
- package/es/picker/shared.js +22 -0
- package/es/picker/style/index.js +3 -0
- package/es/picker/style/less.js +3 -0
- package/es/popover/index.css +1 -0
- package/es/popover/index.js +211 -0
- package/es/popover/index.less +270 -0
- package/es/popover/style/index.js +6 -0
- package/es/popover/style/less.js +6 -0
- package/es/popup/index.css +1 -0
- package/es/popup/index.js +111 -0
- package/es/popup/index.less +140 -0
- package/es/popup/style/index.js +5 -0
- package/es/popup/style/less.js +5 -0
- package/es/pull-refresh/index.css +1 -0
- package/es/pull-refresh/index.js +213 -0
- package/es/pull-refresh/index.less +25 -0
- package/es/pull-refresh/style/index.js +3 -0
- package/es/pull-refresh/style/less.js +3 -0
- package/es/radio/index.css +1 -0
- package/es/radio/index.js +32 -0
- package/es/radio/index.less +86 -0
- package/es/radio/style/index.js +4 -0
- package/es/radio/style/less.js +4 -0
- package/es/radio-group/index.css +1 -0
- package/es/radio-group/index.js +32 -0
- package/es/radio-group/index.less +8 -0
- package/es/radio-group/style/index.js +2 -0
- package/es/radio-group/style/less.js +2 -0
- package/es/rate/index.css +1 -0
- package/es/rate/index.js +227 -0
- package/es/rate/index.less +46 -0
- package/es/rate/style/index.js +4 -0
- package/es/rate/style/less.js +4 -0
- package/es/search/index.css +1 -0
- package/es/search/index.js +114 -0
- package/es/search/index.less +68 -0
- package/es/search/style/index.js +6 -0
- package/es/search/style/less.js +6 -0
- package/es/slider/index.css +1 -0
- package/es/slider/index.js +289 -0
- package/es/slider/index.less +94 -0
- package/es/slider/style/index.js +2 -0
- package/es/slider/style/less.js +2 -0
- package/es/step/index.css +1 -0
- package/es/step/index.js +115 -0
- package/es/step/index.less +151 -0
- package/es/step/style/index.js +4 -0
- package/es/step/style/less.js +4 -0
- package/es/stepper/index.css +1 -0
- package/es/stepper/index.js +355 -0
- package/es/stepper/index.less +129 -0
- package/es/stepper/style/index.js +2 -0
- package/es/stepper/style/less.js +2 -0
- package/es/steps/index.css +1 -0
- package/es/steps/index.js +35 -0
- package/es/steps/index.less +21 -0
- package/es/steps/style/index.js +2 -0
- package/es/steps/style/less.js +2 -0
- package/es/sticky/index.css +1 -0
- package/es/sticky/index.js +146 -0
- package/es/sticky/index.less +11 -0
- package/es/sticky/style/index.js +2 -0
- package/es/sticky/style/less.js +2 -0
- package/es/style/animation.css +1 -0
- package/es/style/animation.less +139 -0
- package/es/style/base.css +1 -0
- package/es/style/base.less +10 -0
- package/es/style/clearfix.css +1 -0
- package/es/style/clearfix.less +5 -0
- package/es/style/ellipsis.css +1 -0
- package/es/style/ellipsis.less +13 -0
- package/es/style/hairline.css +1 -0
- package/es/style/hairline.less +47 -0
- package/es/style/iconfont.css +1 -0
- package/es/style/iconfont.less +910 -0
- package/es/style/mixins/clearfix.css +0 -0
- package/es/style/mixins/clearfix.less +7 -0
- package/es/style/mixins/ellipsis.css +0 -0
- package/es/style/mixins/ellipsis.less +15 -0
- package/es/style/mixins/hairline.css +0 -0
- package/es/style/mixins/hairline.less +39 -0
- package/es/style/normalize.css +1 -0
- package/es/style/normalize.less +38 -0
- package/es/style/reset.css +1 -0
- package/es/style/reset.less +171 -0
- package/es/style/var.css +0 -0
- package/es/style/var.less +983 -0
- package/es/swipe/index.css +1 -0
- package/es/swipe/index.js +429 -0
- package/es/swipe/index.less +56 -0
- package/es/swipe/style/index.js +2 -0
- package/es/swipe/style/less.js +2 -0
- package/es/swipe-item/index.css +1 -0
- package/es/swipe-item/index.js +78 -0
- package/es/swipe-item/index.less +8 -0
- package/es/swipe-item/style/index.js +2 -0
- package/es/swipe-item/style/less.js +2 -0
- package/es/switch/index.css +1 -0
- package/es/switch/index.js +74 -0
- package/es/switch/index.less +57 -0
- package/es/switch/shared.js +19 -0
- package/es/switch/style/index.js +3 -0
- package/es/switch/style/less.js +3 -0
- package/es/tab/index.css +1 -0
- package/es/tab/index.js +102 -0
- package/es/tab/index.less +24 -0
- package/es/tab/style/index.js +2 -0
- package/es/tab/style/less.js +2 -0
- package/es/tabs/Content.js +78 -0
- package/es/tabs/Title.js +92 -0
- package/es/tabs/index.css +1 -0
- package/es/tabs/index.js +419 -0
- package/es/tabs/index.less +153 -0
- package/es/tabs/style/index.js +4 -0
- package/es/tabs/style/less.js +4 -0
- package/es/tabs/utils.js +43 -0
- package/es/tag/index.css +1 -0
- package/es/tag/index.js +74 -0
- package/es/tag/index.less +97 -0
- package/es/tag/style/index.js +4 -0
- package/es/tag/style/less.js +4 -0
- package/es/toast/Toast.js +155 -0
- package/es/toast/index.css +1 -0
- package/es/toast/index.js +189 -0
- package/es/toast/index.less +76 -0
- package/es/toast/lock-click.js +16 -0
- package/es/toast/style/index.js +7 -0
- package/es/toast/style/less.js +7 -0
- package/es/types/address-edit.d.js +11 -0
- package/es/types/area.d.js +11 -0
- package/es/types/calendar.d.js +11 -0
- package/es/types/checkbox-group.d.js +11 -0
- package/es/types/checkbox.d.js +11 -0
- package/es/types/collapse-item.d.js +11 -0
- package/es/types/component.d.js +11 -0
- package/es/types/count-down.d.js +11 -0
- package/es/types/datetime-picker.d.js +11 -0
- package/es/types/dialog.d.js +1 -0
- package/es/types/dropdown-item.d.js +11 -0
- package/es/types/field.d.js +11 -0
- package/es/types/form.d.js +11 -0
- package/es/types/image-preview.d.js +12 -0
- package/es/types/index-bar.d.js +11 -0
- package/es/types/index.d.js +590 -0
- package/es/types/jsx.d.js +0 -0
- package/es/types/lazyload.d.js +1 -0
- package/es/types/list.d.js +11 -0
- package/es/types/locale.d.js +1 -0
- package/es/types/mixins/popup.d.js +1 -0
- package/es/types/notify.d.js +2 -0
- package/es/types/picker.d.js +11 -0
- package/es/types/progress.d.js +11 -0
- package/es/types/sku.d.js +11 -0
- package/es/types/swipe-cell.d.js +11 -0
- package/es/types/swipe.d.js +11 -0
- package/es/types/tabs.d.js +11 -0
- package/es/types/toast.d.js +2 -0
- package/es/types/uploader.d.js +11 -0
- package/es/uploader/index.css +1 -0
- package/es/uploader/index.js +451 -0
- package/es/uploader/index.less +159 -0
- package/es/uploader/style/index.js +11 -0
- package/es/uploader/style/less.js +11 -0
- package/es/uploader/utils.js +57 -0
- package/es/utils/constant.js +10 -0
- package/es/utils/create/bem.js +39 -0
- package/es/utils/create/component.js +57 -0
- package/es/utils/create/i18n.js +16 -0
- package/es/utils/create/index.js +7 -0
- package/es/utils/deep-assign.js +24 -0
- package/es/utils/deep-clone.js +14 -0
- package/es/utils/dom/event.js +48 -0
- package/es/utils/dom/node.js +7 -0
- package/es/utils/dom/raf.js +36 -0
- package/es/utils/dom/reset-scroll.js +14 -0
- package/es/utils/dom/scroll.js +69 -0
- package/es/utils/dom/style.js +9 -0
- package/es/utils/format/number.js +47 -0
- package/es/utils/format/string.js +19 -0
- package/es/utils/format/unit.js +59 -0
- package/es/utils/functional.js +56 -0
- package/es/utils/index.js +29 -0
- package/es/utils/interceptor.js +22 -0
- package/es/utils/router.js +36 -0
- package/es/utils/types.js +0 -0
- package/es/utils/validate/date.js +4 -0
- package/es/utils/validate/email.js +5 -0
- package/es/utils/validate/mobile.js +4 -0
- package/es/utils/validate/number.js +11 -0
- package/es/utils/validate/system.js +9 -0
- package/es/utils/vnodes.js +36 -0
- package/lib/action-sheet/index.css +1 -0
- package/lib/action-sheet/index.js +194 -0
- package/lib/action-sheet/index.less +112 -0
- package/lib/action-sheet/style/index.js +7 -0
- package/lib/action-sheet/style/less.js +7 -0
- package/lib/area/index.js +331 -0
- package/lib/area/style/index.js +3 -0
- package/lib/area/style/less.js +3 -0
- package/lib/button/index.css +1 -0
- package/lib/button/index.js +188 -0
- package/lib/button/index.less +238 -0
- package/lib/button/style/index.js +5 -0
- package/lib/button/style/less.js +5 -0
- package/lib/calendar/components/Header.js +63 -0
- package/lib/calendar/components/Month.js +336 -0
- package/lib/calendar/index.css +1 -0
- package/lib/calendar/index.js +557 -0
- package/lib/calendar/index.less +210 -0
- package/lib/calendar/style/index.js +9 -0
- package/lib/calendar/style/less.js +9 -0
- package/lib/calendar/utils.js +91 -0
- package/lib/cell/index.css +1 -0
- package/lib/cell/index.js +137 -0
- package/lib/cell/index.less +103 -0
- package/lib/cell/shared.js +29 -0
- package/lib/cell/style/index.js +4 -0
- package/lib/cell/style/less.js +4 -0
- package/lib/cell-group/index.css +1 -0
- package/lib/cell-group/index.js +47 -0
- package/lib/cell-group/index.less +12 -0
- package/lib/cell-group/style/index.js +2 -0
- package/lib/cell-group/style/less.js +2 -0
- package/lib/checkbox/index.css +1 -0
- package/lib/checkbox/index.js +88 -0
- package/lib/checkbox/index.less +85 -0
- package/lib/checkbox/style/index.js +4 -0
- package/lib/checkbox/style/less.js +4 -0
- package/lib/checkbox-group/index.css +1 -0
- package/lib/checkbox-group/index.js +73 -0
- package/lib/checkbox-group/index.less +8 -0
- package/lib/checkbox-group/style/index.js +2 -0
- package/lib/checkbox-group/style/less.js +2 -0
- package/lib/collapse/index.js +48 -0
- package/lib/collapse/style/index.js +1 -0
- package/lib/collapse/style/less.js +1 -0
- package/lib/collapse-item/index.css +1 -0
- package/lib/collapse-item/index.js +213 -0
- package/lib/collapse-item/index.less +67 -0
- package/lib/collapse-item/style/index.js +5 -0
- package/lib/collapse-item/style/less.js +5 -0
- package/lib/contact-card/index.css +1 -0
- package/lib/contact-card/index.js +72 -0
- package/lib/contact-card/index.less +42 -0
- package/lib/contact-card/style/index.js +5 -0
- package/lib/contact-card/style/less.js +5 -0
- package/lib/contact-edit/index.css +1 -0
- package/lib/contact-edit/index.js +210 -0
- package/lib/contact-edit/index.less +30 -0
- package/lib/contact-edit/style/index.js +14 -0
- package/lib/contact-edit/style/less.js +14 -0
- package/lib/contact-list/index.css +1 -0
- package/lib/contact-list/index.js +138 -0
- package/lib/contact-list/index.less +54 -0
- package/lib/contact-list/style/index.js +10 -0
- package/lib/contact-list/style/less.js +10 -0
- package/lib/datetime-picker/DatePicker.js +261 -0
- package/lib/datetime-picker/TimePicker.js +117 -0
- package/lib/datetime-picker/index.js +41 -0
- package/lib/datetime-picker/shared.js +124 -0
- package/lib/datetime-picker/style/index.js +3 -0
- package/lib/datetime-picker/style/less.js +3 -0
- package/lib/datetime-picker/utils.js +39 -0
- package/lib/demo-button/index-sfc.css +1 -0
- package/lib/demo-button/index-sfc.less +9 -0
- package/lib/demo-button/index.js +33 -0
- package/lib/demo-button/style/index.js +1 -0
- package/lib/demo-button/style/less.js +1 -0
- package/lib/dialog/Dialog.js +261 -0
- package/lib/dialog/index.css +1 -0
- package/lib/dialog/index.js +116 -0
- package/lib/dialog/index.less +153 -0
- package/lib/dialog/style/index.js +10 -0
- package/lib/dialog/style/less.js +10 -0
- package/lib/dropdown-item/index.css +1 -0
- package/lib/dropdown-item/index.js +225 -0
- package/lib/dropdown-item/index.less +39 -0
- package/lib/dropdown-item/style/index.js +7 -0
- package/lib/dropdown-item/style/less.js +7 -0
- package/lib/dropdown-menu/index.css +1 -0
- package/lib/dropdown-menu/index.js +142 -0
- package/lib/dropdown-menu/index.less +77 -0
- package/lib/dropdown-menu/style/index.js +2 -0
- package/lib/dropdown-menu/style/less.js +2 -0
- package/lib/empty/Network.js +198 -0
- package/lib/empty/index.css +1 -0
- package/lib/empty/index.js +92 -0
- package/lib/empty/index.less +32 -0
- package/lib/empty/style/index.js +2 -0
- package/lib/empty/style/less.js +2 -0
- package/lib/field/index.css +1 -0
- package/lib/field/index.js +639 -0
- package/lib/field/index.less +172 -0
- package/lib/field/style/index.js +5 -0
- package/lib/field/style/less.js +5 -0
- package/lib/form/index.js +208 -0
- package/lib/form/style/index.js +1 -0
- package/lib/form/style/less.js +1 -0
- package/lib/goods-action/index.css +1 -0
- package/lib/goods-action/index.js +32 -0
- package/lib/goods-action/index.less +19 -0
- package/lib/goods-action/style/index.js +2 -0
- package/lib/goods-action/style/less.js +2 -0
- package/lib/goods-action-button/index.css +1 -0
- package/lib/goods-action-button/index.js +70 -0
- package/lib/goods-action-button/index.less +34 -0
- package/lib/goods-action-button/style/index.js +6 -0
- package/lib/goods-action-button/style/less.js +6 -0
- package/lib/icon/index.css +1 -0
- package/lib/icon/index.js +87 -0
- package/lib/icon/index.less +11 -0
- package/lib/icon/local.css +1 -0
- package/lib/icon/local.less +1 -0
- package/lib/icon/style/index.js +3 -0
- package/lib/icon/style/less.js +3 -0
- package/lib/image/index.css +1 -0
- package/lib/image/index.js +199 -0
- package/lib/image/index.less +47 -0
- package/lib/image/style/index.js +4 -0
- package/lib/image/style/less.js +4 -0
- package/lib/image-preview/ImagePreview.js +250 -0
- package/lib/image-preview/ImagePreviewItem.js +256 -0
- package/lib/image-preview/index.css +1 -0
- package/lib/image-preview/index.js +96 -0
- package/lib/image-preview/index.less +103 -0
- package/lib/image-preview/shared.js +13 -0
- package/lib/image-preview/style/index.js +10 -0
- package/lib/image-preview/style/less.js +10 -0
- package/lib/index-anchor/index.css +1 -0
- package/lib/index-anchor/index.js +93 -0
- package/lib/index-anchor/index.less +21 -0
- package/lib/index-anchor/style/index.js +2 -0
- package/lib/index-anchor/style/less.js +2 -0
- package/lib/index-bar/index.css +1 -0
- package/lib/index-bar/index.js +235 -0
- package/lib/index-bar/index.less +27 -0
- package/lib/index-bar/style/index.js +2 -0
- package/lib/index-bar/style/less.js +2 -0
- package/lib/index.css +1 -0
- package/lib/index.js +262 -0
- package/lib/index.less +52 -0
- package/lib/info/index.css +1 -0
- package/lib/info/index.js +42 -0
- package/lib/info/index.less +29 -0
- package/lib/info/style/index.js +2 -0
- package/lib/info/style/less.js +2 -0
- package/lib/lazyload/index.js +11 -0
- package/lib/lazyload/style/index.js +1 -0
- package/lib/lazyload/style/less.js +1 -0
- package/lib/list/index.css +1 -0
- package/lib/list/index.js +191 -0
- package/lib/list/index.less +21 -0
- package/lib/list/style/index.js +3 -0
- package/lib/list/style/less.js +3 -0
- package/lib/loading/index.css +1 -0
- package/lib/loading/index.js +98 -0
- package/lib/loading/index.less +103 -0
- package/lib/loading/style/index.js +2 -0
- package/lib/loading/style/less.js +2 -0
- package/lib/locale/index.js +38 -0
- package/lib/locale/lang/de-DE-formal.js +95 -0
- package/lib/locale/lang/de-DE.js +95 -0
- package/lib/locale/lang/en-US.js +95 -0
- package/lib/locale/lang/es-ES.js +95 -0
- package/lib/locale/lang/ja-JP.js +96 -0
- package/lib/locale/lang/nb-NO.js +95 -0
- package/lib/locale/lang/ro-RO.js +95 -0
- package/lib/locale/lang/tr-TR.js +95 -0
- package/lib/locale/lang/zh-CN.js +96 -0
- package/lib/locale/lang/zh-HK.js +96 -0
- package/lib/locale/lang/zh-TW.js +96 -0
- package/lib/locale/style/index.js +1 -0
- package/lib/locale/style/less.js +1 -0
- package/lib/mixins/bind-event.js +36 -0
- package/lib/mixins/checkbox.js +152 -0
- package/lib/mixins/click-outside.js +41 -0
- package/lib/mixins/close-on-popstate.js +46 -0
- package/lib/mixins/field.js +29 -0
- package/lib/mixins/popup/context.js +15 -0
- package/lib/mixins/popup/index.js +224 -0
- package/lib/mixins/popup/overlay.js +95 -0
- package/lib/mixins/popup/type.js +1 -0
- package/lib/mixins/portal.js +53 -0
- package/lib/mixins/relation.js +84 -0
- package/lib/mixins/slots.js +29 -0
- package/lib/mixins/touch.js +65 -0
- package/lib/nav-bar/index.css +1 -0
- package/lib/nav-bar/index.js +135 -0
- package/lib/nav-bar/index.less +77 -0
- package/lib/nav-bar/style/index.js +4 -0
- package/lib/nav-bar/style/less.js +4 -0
- package/lib/number-keyboard/CollapseIcon.js +21 -0
- package/lib/number-keyboard/DeleteIcon.js +21 -0
- package/lib/number-keyboard/Key.js +134 -0
- package/lib/number-keyboard/index.css +1 -0
- package/lib/number-keyboard/index.js +423 -0
- package/lib/number-keyboard/index.less +191 -0
- package/lib/number-keyboard/style/index.js +3 -0
- package/lib/number-keyboard/style/less.js +3 -0
- package/lib/overlay/index.css +1 -0
- package/lib/overlay/index.js +67 -0
- package/lib/overlay/index.less +11 -0
- package/lib/overlay/style/index.js +2 -0
- package/lib/overlay/style/less.js +2 -0
- package/lib/password-input/index.css +1 -0
- package/lib/password-input/index.js +97 -0
- package/lib/password-input/index.less +83 -0
- package/lib/password-input/style/index.js +2 -0
- package/lib/password-input/style/less.js +2 -0
- package/lib/picker/PickerColumn.js +314 -0
- package/lib/picker/index.css +1 -0
- package/lib/picker/index.js +399 -0
- package/lib/picker/index.less +118 -0
- package/lib/picker/shared.js +28 -0
- package/lib/picker/style/index.js +3 -0
- package/lib/picker/style/less.js +3 -0
- package/lib/popover/index.css +1 -0
- package/lib/popover/index.js +226 -0
- package/lib/popover/index.less +270 -0
- package/lib/popover/style/index.js +6 -0
- package/lib/popover/style/less.js +6 -0
- package/lib/popup/index.css +1 -0
- package/lib/popup/index.js +122 -0
- package/lib/popup/index.less +140 -0
- package/lib/popup/style/index.js +5 -0
- package/lib/popup/style/less.js +5 -0
- package/lib/pull-refresh/index.css +1 -0
- package/lib/pull-refresh/index.js +227 -0
- package/lib/pull-refresh/index.less +25 -0
- package/lib/pull-refresh/style/index.js +3 -0
- package/lib/pull-refresh/style/less.js +3 -0
- package/lib/radio/index.css +1 -0
- package/lib/radio/index.js +40 -0
- package/lib/radio/index.less +86 -0
- package/lib/radio/style/index.js +4 -0
- package/lib/radio/style/less.js +4 -0
- package/lib/radio-group/index.css +1 -0
- package/lib/radio-group/index.js +41 -0
- package/lib/radio-group/index.less +8 -0
- package/lib/radio-group/style/index.js +2 -0
- package/lib/radio-group/style/less.js +2 -0
- package/lib/rate/index.css +1 -0
- package/lib/rate/index.js +240 -0
- package/lib/rate/index.less +46 -0
- package/lib/rate/style/index.js +4 -0
- package/lib/rate/style/less.js +4 -0
- package/lib/search/index.css +1 -0
- package/lib/search/index.js +128 -0
- package/lib/search/index.less +68 -0
- package/lib/search/style/index.js +6 -0
- package/lib/search/style/less.js +6 -0
- package/lib/slider/index.css +1 -0
- package/lib/slider/index.js +300 -0
- package/lib/slider/index.less +94 -0
- package/lib/slider/style/index.js +2 -0
- package/lib/slider/style/less.js +2 -0
- package/lib/step/index.css +1 -0
- package/lib/step/index.js +127 -0
- package/lib/step/index.less +151 -0
- package/lib/step/style/index.js +4 -0
- package/lib/step/style/less.js +4 -0
- package/lib/stepper/index.css +1 -0
- package/lib/stepper/index.js +369 -0
- package/lib/stepper/index.less +129 -0
- package/lib/stepper/style/index.js +2 -0
- package/lib/stepper/style/less.js +2 -0
- package/lib/steps/index.css +1 -0
- package/lib/steps/index.js +43 -0
- package/lib/steps/index.less +21 -0
- package/lib/steps/style/index.js +2 -0
- package/lib/steps/style/less.js +2 -0
- package/lib/sticky/index.css +1 -0
- package/lib/sticky/index.js +157 -0
- package/lib/sticky/index.less +11 -0
- package/lib/sticky/style/index.js +2 -0
- package/lib/sticky/style/less.js +2 -0
- package/lib/style/animation.css +1 -0
- package/lib/style/animation.less +139 -0
- package/lib/style/base.css +1 -0
- package/lib/style/base.less +10 -0
- package/lib/style/clearfix.css +1 -0
- package/lib/style/clearfix.less +5 -0
- package/lib/style/ellipsis.css +1 -0
- package/lib/style/ellipsis.less +13 -0
- package/lib/style/hairline.css +1 -0
- package/lib/style/hairline.less +47 -0
- package/lib/style/iconfont.css +1 -0
- package/lib/style/iconfont.less +910 -0
- package/lib/style/mixins/clearfix.css +0 -0
- package/lib/style/mixins/clearfix.less +7 -0
- package/lib/style/mixins/ellipsis.css +0 -0
- package/lib/style/mixins/ellipsis.less +15 -0
- package/lib/style/mixins/hairline.css +0 -0
- package/lib/style/mixins/hairline.less +39 -0
- package/lib/style/normalize.css +1 -0
- package/lib/style/normalize.less +38 -0
- package/lib/style/reset.css +1 -0
- package/lib/style/reset.less +171 -0
- package/lib/style/var.css +0 -0
- package/lib/style/var.less +983 -0
- package/lib/swipe/index.css +1 -0
- package/lib/swipe/index.js +443 -0
- package/lib/swipe/index.less +56 -0
- package/lib/swipe/style/index.js +2 -0
- package/lib/swipe/style/less.js +2 -0
- package/lib/swipe-item/index.css +1 -0
- package/lib/swipe-item/index.js +89 -0
- package/lib/swipe-item/index.less +8 -0
- package/lib/swipe-item/style/index.js +2 -0
- package/lib/swipe-item/style/less.js +2 -0
- package/lib/switch/index.css +1 -0
- package/lib/switch/index.js +86 -0
- package/lib/switch/index.less +57 -0
- package/lib/switch/shared.js +25 -0
- package/lib/switch/style/index.js +3 -0
- package/lib/switch/style/less.js +3 -0
- package/lib/tab/index.css +1 -0
- package/lib/tab/index.js +114 -0
- package/lib/tab/index.less +24 -0
- package/lib/tab/style/index.js +2 -0
- package/lib/tab/style/less.js +2 -0
- package/lib/tabs/Content.js +90 -0
- package/lib/tabs/Title.js +102 -0
- package/lib/tabs/index.css +1 -0
- package/lib/tabs/index.js +441 -0
- package/lib/tabs/index.less +153 -0
- package/lib/tabs/style/index.js +4 -0
- package/lib/tabs/style/less.js +4 -0
- package/lib/tabs/utils.js +53 -0
- package/lib/tag/index.css +1 -0
- package/lib/tag/index.js +87 -0
- package/lib/tag/index.less +97 -0
- package/lib/tag/style/index.js +4 -0
- package/lib/tag/style/less.js +4 -0
- package/lib/tlvant.js +16647 -0
- package/lib/tlvant.min.js +7 -0
- package/lib/toast/Toast.js +168 -0
- package/lib/toast/index.css +1 -0
- package/lib/toast/index.js +200 -0
- package/lib/toast/index.less +76 -0
- package/lib/toast/lock-click.js +21 -0
- package/lib/toast/style/index.js +7 -0
- package/lib/toast/style/less.js +7 -0
- package/lib/types/address-edit.d.js +22 -0
- package/lib/types/area.d.js +22 -0
- package/lib/types/calendar.d.js +22 -0
- package/lib/types/checkbox-group.d.js +22 -0
- package/lib/types/checkbox.d.js +22 -0
- package/lib/types/collapse-item.d.js +22 -0
- package/lib/types/component.d.js +22 -0
- package/lib/types/count-down.d.js +22 -0
- package/lib/types/datetime-picker.d.js +22 -0
- package/lib/types/dialog.d.js +6 -0
- package/lib/types/dropdown-item.d.js +22 -0
- package/lib/types/field.d.js +22 -0
- package/lib/types/form.d.js +22 -0
- package/lib/types/image-preview.d.js +24 -0
- package/lib/types/index-bar.d.js +22 -0
- package/lib/types/index.d.js +862 -0
- package/lib/types/jsx.d.js +1 -0
- package/lib/types/lazyload.d.js +6 -0
- package/lib/types/list.d.js +22 -0
- package/lib/types/locale.d.js +6 -0
- package/lib/types/mixins/popup.d.js +8 -0
- package/lib/types/notify.d.js +11 -0
- package/lib/types/picker.d.js +22 -0
- package/lib/types/progress.d.js +22 -0
- package/lib/types/sku.d.js +22 -0
- package/lib/types/swipe-cell.d.js +22 -0
- package/lib/types/swipe.d.js +22 -0
- package/lib/types/tabs.d.js +22 -0
- package/lib/types/toast.d.js +11 -0
- package/lib/types/uploader.d.js +22 -0
- package/lib/uploader/index.css +1 -0
- package/lib/uploader/index.js +467 -0
- package/lib/uploader/index.less +159 -0
- package/lib/uploader/style/index.js +11 -0
- package/lib/uploader/style/less.js +11 -0
- package/lib/uploader/utils.js +71 -0
- package/lib/utils/constant.js +22 -0
- package/lib/utils/create/bem.js +44 -0
- package/lib/utils/create/component.js +70 -0
- package/lib/utils/create/i18n.js +27 -0
- package/lib/utils/create/index.js +15 -0
- package/lib/utils/deep-assign.js +30 -0
- package/lib/utils/deep-clone.js +20 -0
- package/lib/utils/dom/event.js +62 -0
- package/lib/utils/dom/node.js +12 -0
- package/lib/utils/dom/raf.js +47 -0
- package/lib/utils/dom/reset-scroll.js +21 -0
- package/lib/utils/dom/scroll.js +89 -0
- package/lib/utils/dom/style.js +14 -0
- package/lib/utils/format/number.js +53 -0
- package/lib/utils/format/string.js +26 -0
- package/lib/utils/format/unit.js +68 -0
- package/lib/utils/functional.js +68 -0
- package/lib/utils/index.js +56 -0
- package/lib/utils/interceptor.js +28 -0
- package/lib/utils/router.js +46 -0
- package/lib/utils/types.js +1 -0
- package/lib/utils/validate/date.js +10 -0
- package/lib/utils/validate/email.js +10 -0
- package/lib/utils/validate/mobile.js +9 -0
- package/lib/utils/validate/number.js +18 -0
- package/lib/utils/validate/system.js +17 -0
- package/lib/utils/vnodes.js +41 -0
- package/package.json +2 -1
package/es/tabs/index.js
ADDED
|
@@ -0,0 +1,419 @@
|
|
|
1
|
+
// Utils
|
|
2
|
+
import { createNamespace, isDef, addUnit } from '../utils';
|
|
3
|
+
import { scrollLeftTo, scrollTopTo } from './utils';
|
|
4
|
+
import { route } from '../utils/router';
|
|
5
|
+
import { isHidden } from '../utils/dom/style';
|
|
6
|
+
import { on, off } from '../utils/dom/event';
|
|
7
|
+
import { unitToPx } from '../utils/format/unit';
|
|
8
|
+
import { BORDER_TOP_BOTTOM } from '../utils/constant';
|
|
9
|
+
import { callInterceptor } from '../utils/interceptor';
|
|
10
|
+
import { getScroller, getVisibleTop, getElementTop, getVisibleHeight, setRootScrollTop } from '../utils/dom/scroll'; // Mixins
|
|
11
|
+
|
|
12
|
+
import { ParentMixin } from '../mixins/relation';
|
|
13
|
+
import { BindEventMixin } from '../mixins/bind-event'; // Components
|
|
14
|
+
|
|
15
|
+
import Title from './Title';
|
|
16
|
+
import Sticky from '../sticky';
|
|
17
|
+
import Content from './Content';
|
|
18
|
+
|
|
19
|
+
var _createNamespace = createNamespace('tabs'),
|
|
20
|
+
createComponent = _createNamespace[0],
|
|
21
|
+
bem = _createNamespace[1];
|
|
22
|
+
|
|
23
|
+
export default createComponent({
|
|
24
|
+
mixins: [ParentMixin('vanTabs'), BindEventMixin(function (bind) {
|
|
25
|
+
if (!this.scroller) {
|
|
26
|
+
this.scroller = getScroller(this.$el);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
bind(window, 'resize', this.resize, true);
|
|
30
|
+
|
|
31
|
+
if (this.scrollspy) {
|
|
32
|
+
bind(this.scroller, 'scroll', this.onScroll, true);
|
|
33
|
+
}
|
|
34
|
+
})],
|
|
35
|
+
model: {
|
|
36
|
+
prop: 'active'
|
|
37
|
+
},
|
|
38
|
+
props: {
|
|
39
|
+
color: String,
|
|
40
|
+
border: Boolean,
|
|
41
|
+
sticky: Boolean,
|
|
42
|
+
animated: Boolean,
|
|
43
|
+
swipeable: Boolean,
|
|
44
|
+
scrollspy: Boolean,
|
|
45
|
+
background: String,
|
|
46
|
+
lineWidth: [Number, String],
|
|
47
|
+
lineHeight: [Number, String],
|
|
48
|
+
beforeChange: Function,
|
|
49
|
+
titleActiveColor: String,
|
|
50
|
+
titleInactiveColor: String,
|
|
51
|
+
type: {
|
|
52
|
+
type: String,
|
|
53
|
+
default: 'line'
|
|
54
|
+
},
|
|
55
|
+
active: {
|
|
56
|
+
type: [Number, String],
|
|
57
|
+
default: 0
|
|
58
|
+
},
|
|
59
|
+
ellipsis: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: true
|
|
62
|
+
},
|
|
63
|
+
duration: {
|
|
64
|
+
type: [Number, String],
|
|
65
|
+
default: 0.3
|
|
66
|
+
},
|
|
67
|
+
offsetTop: {
|
|
68
|
+
type: [Number, String],
|
|
69
|
+
default: 0
|
|
70
|
+
},
|
|
71
|
+
lazyRender: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
default: true
|
|
74
|
+
},
|
|
75
|
+
swipeThreshold: {
|
|
76
|
+
type: [Number, String],
|
|
77
|
+
default: 5
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
data: function data() {
|
|
81
|
+
return {
|
|
82
|
+
position: '',
|
|
83
|
+
currentIndex: null,
|
|
84
|
+
lineStyle: {
|
|
85
|
+
backgroundColor: this.color
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
},
|
|
89
|
+
computed: {
|
|
90
|
+
// whether the nav is scrollable
|
|
91
|
+
scrollable: function scrollable() {
|
|
92
|
+
return this.children.length > this.swipeThreshold || !this.ellipsis;
|
|
93
|
+
},
|
|
94
|
+
navStyle: function navStyle() {
|
|
95
|
+
return {
|
|
96
|
+
borderColor: this.color,
|
|
97
|
+
background: this.background
|
|
98
|
+
};
|
|
99
|
+
},
|
|
100
|
+
currentName: function currentName() {
|
|
101
|
+
var activeTab = this.children[this.currentIndex];
|
|
102
|
+
|
|
103
|
+
if (activeTab) {
|
|
104
|
+
return activeTab.computedName;
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
offsetTopPx: function offsetTopPx() {
|
|
108
|
+
return unitToPx(this.offsetTop);
|
|
109
|
+
},
|
|
110
|
+
scrollOffset: function scrollOffset() {
|
|
111
|
+
if (this.sticky) {
|
|
112
|
+
return this.offsetTopPx + this.tabHeight;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return 0;
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
watch: {
|
|
119
|
+
color: 'setLine',
|
|
120
|
+
active: function active(name) {
|
|
121
|
+
if (name !== this.currentName) {
|
|
122
|
+
this.setCurrentIndexByName(name);
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
children: function children() {
|
|
126
|
+
var _this = this;
|
|
127
|
+
|
|
128
|
+
this.setCurrentIndexByName(this.active || this.currentName);
|
|
129
|
+
this.setLine();
|
|
130
|
+
this.$nextTick(function () {
|
|
131
|
+
_this.scrollIntoView(true);
|
|
132
|
+
});
|
|
133
|
+
},
|
|
134
|
+
currentIndex: function currentIndex() {
|
|
135
|
+
this.scrollIntoView();
|
|
136
|
+
this.setLine(); // scroll to correct position
|
|
137
|
+
|
|
138
|
+
if (this.stickyFixed && !this.scrollspy) {
|
|
139
|
+
setRootScrollTop(Math.ceil(getElementTop(this.$el) - this.offsetTopPx));
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
scrollspy: function scrollspy(val) {
|
|
143
|
+
if (val) {
|
|
144
|
+
on(this.scroller, 'scroll', this.onScroll, true);
|
|
145
|
+
} else {
|
|
146
|
+
off(this.scroller, 'scroll', this.onScroll);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
mounted: function mounted() {
|
|
151
|
+
this.init();
|
|
152
|
+
},
|
|
153
|
+
activated: function activated() {
|
|
154
|
+
this.init();
|
|
155
|
+
this.setLine();
|
|
156
|
+
},
|
|
157
|
+
methods: {
|
|
158
|
+
// @exposed-api
|
|
159
|
+
resize: function resize() {
|
|
160
|
+
this.setLine();
|
|
161
|
+
},
|
|
162
|
+
init: function init() {
|
|
163
|
+
var _this2 = this;
|
|
164
|
+
|
|
165
|
+
this.$nextTick(function () {
|
|
166
|
+
_this2.inited = true;
|
|
167
|
+
_this2.tabHeight = getVisibleHeight(_this2.$refs.wrap);
|
|
168
|
+
|
|
169
|
+
_this2.scrollIntoView(true);
|
|
170
|
+
});
|
|
171
|
+
},
|
|
172
|
+
// update nav bar style
|
|
173
|
+
setLine: function setLine() {
|
|
174
|
+
var _this3 = this;
|
|
175
|
+
|
|
176
|
+
var shouldAnimate = this.inited;
|
|
177
|
+
this.$nextTick(function () {
|
|
178
|
+
var titles = _this3.$refs.titles;
|
|
179
|
+
|
|
180
|
+
if (!titles || !titles[_this3.currentIndex] || _this3.type !== 'line' || isHidden(_this3.$el)) {
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
var title = titles[_this3.currentIndex].$el;
|
|
185
|
+
var lineWidth = _this3.lineWidth,
|
|
186
|
+
lineHeight = _this3.lineHeight;
|
|
187
|
+
var left = title.offsetLeft + title.offsetWidth / 2;
|
|
188
|
+
var lineStyle = {
|
|
189
|
+
width: addUnit(lineWidth),
|
|
190
|
+
backgroundColor: _this3.color,
|
|
191
|
+
transform: "translateX(" + left + "px) translateX(-50%)"
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
if (shouldAnimate) {
|
|
195
|
+
lineStyle.transitionDuration = _this3.duration + "s";
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
if (isDef(lineHeight)) {
|
|
199
|
+
var height = addUnit(lineHeight);
|
|
200
|
+
lineStyle.height = height;
|
|
201
|
+
lineStyle.borderRadius = height;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
_this3.lineStyle = lineStyle;
|
|
205
|
+
});
|
|
206
|
+
},
|
|
207
|
+
// correct the index of active tab
|
|
208
|
+
setCurrentIndexByName: function setCurrentIndexByName(name) {
|
|
209
|
+
var matched = this.children.filter(function (tab) {
|
|
210
|
+
return tab.computedName === name;
|
|
211
|
+
});
|
|
212
|
+
var defaultIndex = (this.children[0] || {}).index || 0;
|
|
213
|
+
this.setCurrentIndex(matched.length ? matched[0].index : defaultIndex);
|
|
214
|
+
},
|
|
215
|
+
setCurrentIndex: function setCurrentIndex(currentIndex) {
|
|
216
|
+
var newIndex = this.findAvailableTab(currentIndex);
|
|
217
|
+
|
|
218
|
+
if (!isDef(newIndex)) {
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
var newTab = this.children[newIndex];
|
|
223
|
+
var newName = newTab.computedName;
|
|
224
|
+
var shouldEmitChange = this.currentIndex !== null;
|
|
225
|
+
this.currentIndex = newIndex;
|
|
226
|
+
|
|
227
|
+
if (newName !== this.active) {
|
|
228
|
+
this.$emit('input', newName);
|
|
229
|
+
|
|
230
|
+
if (shouldEmitChange) {
|
|
231
|
+
this.$emit('change', newName, newTab.title);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
findAvailableTab: function findAvailableTab(index) {
|
|
236
|
+
var diff = index < this.currentIndex ? -1 : 1;
|
|
237
|
+
|
|
238
|
+
while (index >= 0 && index < this.children.length) {
|
|
239
|
+
if (!this.children[index].disabled) {
|
|
240
|
+
return index;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
index += diff;
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
// emit event when clicked
|
|
247
|
+
onClick: function onClick(item, index) {
|
|
248
|
+
var _this4 = this;
|
|
249
|
+
|
|
250
|
+
var _this$children$index = this.children[index],
|
|
251
|
+
title = _this$children$index.title,
|
|
252
|
+
disabled = _this$children$index.disabled,
|
|
253
|
+
computedName = _this$children$index.computedName;
|
|
254
|
+
|
|
255
|
+
if (disabled) {
|
|
256
|
+
this.$emit('disabled', computedName, title);
|
|
257
|
+
} else {
|
|
258
|
+
callInterceptor({
|
|
259
|
+
interceptor: this.beforeChange,
|
|
260
|
+
args: [computedName],
|
|
261
|
+
done: function done() {
|
|
262
|
+
_this4.setCurrentIndex(index);
|
|
263
|
+
|
|
264
|
+
_this4.scrollToCurrentContent();
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
this.$emit('click', computedName, title);
|
|
268
|
+
route(item.$router, item);
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
// scroll active tab into view
|
|
272
|
+
scrollIntoView: function scrollIntoView(immediate) {
|
|
273
|
+
var titles = this.$refs.titles;
|
|
274
|
+
|
|
275
|
+
if (!this.scrollable || !titles || !titles[this.currentIndex]) {
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
var nav = this.$refs.nav;
|
|
280
|
+
var title = titles[this.currentIndex].$el;
|
|
281
|
+
var to = title.offsetLeft - (nav.offsetWidth - title.offsetWidth) / 2;
|
|
282
|
+
scrollLeftTo(nav, to, immediate ? 0 : +this.duration);
|
|
283
|
+
},
|
|
284
|
+
onSticktScroll: function onSticktScroll(params) {
|
|
285
|
+
this.stickyFixed = params.isFixed;
|
|
286
|
+
this.$emit('scroll', params);
|
|
287
|
+
},
|
|
288
|
+
// @exposed-api
|
|
289
|
+
scrollTo: function scrollTo(name) {
|
|
290
|
+
var _this5 = this;
|
|
291
|
+
|
|
292
|
+
this.$nextTick(function () {
|
|
293
|
+
_this5.setCurrentIndexByName(name);
|
|
294
|
+
|
|
295
|
+
_this5.scrollToCurrentContent(true);
|
|
296
|
+
});
|
|
297
|
+
},
|
|
298
|
+
scrollToCurrentContent: function scrollToCurrentContent(immediate) {
|
|
299
|
+
var _this6 = this;
|
|
300
|
+
|
|
301
|
+
if (immediate === void 0) {
|
|
302
|
+
immediate = false;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
if (this.scrollspy) {
|
|
306
|
+
var target = this.children[this.currentIndex];
|
|
307
|
+
var el = target == null ? void 0 : target.$el;
|
|
308
|
+
|
|
309
|
+
if (el) {
|
|
310
|
+
var to = getElementTop(el, this.scroller) - this.scrollOffset;
|
|
311
|
+
this.lockScroll = true;
|
|
312
|
+
scrollTopTo(this.scroller, to, immediate ? 0 : +this.duration, function () {
|
|
313
|
+
_this6.lockScroll = false;
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
onScroll: function onScroll() {
|
|
319
|
+
if (this.scrollspy && !this.lockScroll) {
|
|
320
|
+
var index = this.getCurrentIndexOnScroll();
|
|
321
|
+
this.setCurrentIndex(index);
|
|
322
|
+
}
|
|
323
|
+
},
|
|
324
|
+
getCurrentIndexOnScroll: function getCurrentIndexOnScroll() {
|
|
325
|
+
var children = this.children;
|
|
326
|
+
|
|
327
|
+
for (var index = 0; index < children.length; index++) {
|
|
328
|
+
var top = getVisibleTop(children[index].$el);
|
|
329
|
+
|
|
330
|
+
if (top > this.scrollOffset) {
|
|
331
|
+
return index === 0 ? 0 : index - 1;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
return children.length - 1;
|
|
336
|
+
}
|
|
337
|
+
},
|
|
338
|
+
render: function render() {
|
|
339
|
+
var _this7 = this,
|
|
340
|
+
_ref;
|
|
341
|
+
|
|
342
|
+
var h = arguments[0];
|
|
343
|
+
var type = this.type,
|
|
344
|
+
animated = this.animated,
|
|
345
|
+
scrollable = this.scrollable;
|
|
346
|
+
var Nav = this.children.map(function (item, index) {
|
|
347
|
+
var _item$badge;
|
|
348
|
+
|
|
349
|
+
return h(Title, {
|
|
350
|
+
"ref": "titles",
|
|
351
|
+
"refInFor": true,
|
|
352
|
+
"attrs": {
|
|
353
|
+
"type": type,
|
|
354
|
+
"dot": item.dot,
|
|
355
|
+
"info": (_item$badge = item.badge) != null ? _item$badge : item.info,
|
|
356
|
+
"title": item.title,
|
|
357
|
+
"color": _this7.color,
|
|
358
|
+
"isActive": index === _this7.currentIndex,
|
|
359
|
+
"disabled": item.disabled,
|
|
360
|
+
"scrollable": scrollable,
|
|
361
|
+
"activeColor": _this7.titleActiveColor,
|
|
362
|
+
"inactiveColor": _this7.titleInactiveColor
|
|
363
|
+
},
|
|
364
|
+
"style": item.titleStyle,
|
|
365
|
+
"class": item.titleClass,
|
|
366
|
+
"scopedSlots": {
|
|
367
|
+
default: function _default() {
|
|
368
|
+
return item.slots('title');
|
|
369
|
+
}
|
|
370
|
+
},
|
|
371
|
+
"on": {
|
|
372
|
+
"click": function click() {
|
|
373
|
+
_this7.onClick(item, index);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
});
|
|
377
|
+
});
|
|
378
|
+
var Wrap = h("div", {
|
|
379
|
+
"ref": "wrap",
|
|
380
|
+
"class": [bem('wrap', {
|
|
381
|
+
scrollable: scrollable
|
|
382
|
+
}), (_ref = {}, _ref[BORDER_TOP_BOTTOM] = type === 'line' && this.border, _ref)]
|
|
383
|
+
}, [h("div", {
|
|
384
|
+
"ref": "nav",
|
|
385
|
+
"attrs": {
|
|
386
|
+
"role": "tablist"
|
|
387
|
+
},
|
|
388
|
+
"class": bem('nav', [type, {
|
|
389
|
+
complete: this.scrollable
|
|
390
|
+
}]),
|
|
391
|
+
"style": this.navStyle
|
|
392
|
+
}, [this.slots('nav-left'), Nav, type === 'line' && h("div", {
|
|
393
|
+
"class": bem('line'),
|
|
394
|
+
"style": this.lineStyle
|
|
395
|
+
}), this.slots('nav-right')])]);
|
|
396
|
+
return h("div", {
|
|
397
|
+
"class": bem([type])
|
|
398
|
+
}, [this.sticky ? h(Sticky, {
|
|
399
|
+
"attrs": {
|
|
400
|
+
"container": this.$el,
|
|
401
|
+
"offsetTop": this.offsetTop
|
|
402
|
+
},
|
|
403
|
+
"on": {
|
|
404
|
+
"scroll": this.onSticktScroll
|
|
405
|
+
}
|
|
406
|
+
}, [Wrap]) : Wrap, h(Content, {
|
|
407
|
+
"attrs": {
|
|
408
|
+
"count": this.children.length,
|
|
409
|
+
"animated": animated,
|
|
410
|
+
"duration": this.duration,
|
|
411
|
+
"swipeable": this.swipeable,
|
|
412
|
+
"currentIndex": this.currentIndex
|
|
413
|
+
},
|
|
414
|
+
"on": {
|
|
415
|
+
"change": this.setCurrentIndex
|
|
416
|
+
}
|
|
417
|
+
}, [this.slots()])]);
|
|
418
|
+
}
|
|
419
|
+
});
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
@import '../style/var';
|
|
2
|
+
|
|
3
|
+
.van-tab {
|
|
4
|
+
position: relative;
|
|
5
|
+
display: flex;
|
|
6
|
+
flex: 1;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
padding: 0 @padding-base;
|
|
11
|
+
color: @tab-text-color;
|
|
12
|
+
font-size: @tab-font-size;
|
|
13
|
+
line-height: @tab-line-height;
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
|
|
16
|
+
&--active {
|
|
17
|
+
color: @tab-active-text-color;
|
|
18
|
+
font-weight: @font-weight-bold;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&--disabled {
|
|
22
|
+
color: @tab-disabled-text-color;
|
|
23
|
+
cursor: not-allowed;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&__text {
|
|
27
|
+
&--ellipsis {
|
|
28
|
+
display: -webkit-box;
|
|
29
|
+
overflow: hidden;
|
|
30
|
+
-webkit-line-clamp: 1;
|
|
31
|
+
-webkit-box-orient: vertical;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&__text-wrapper {
|
|
36
|
+
position: relative;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.van-tabs {
|
|
41
|
+
position: relative;
|
|
42
|
+
|
|
43
|
+
&__wrap {
|
|
44
|
+
overflow: hidden;
|
|
45
|
+
|
|
46
|
+
&--page-top {
|
|
47
|
+
position: fixed;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&--content-bottom {
|
|
51
|
+
top: auto;
|
|
52
|
+
bottom: 0;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&--scrollable {
|
|
56
|
+
.van-tab {
|
|
57
|
+
flex: 1 0 auto;
|
|
58
|
+
padding: 0 @padding-sm;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.van-tabs__nav {
|
|
62
|
+
overflow-x: auto;
|
|
63
|
+
overflow-y: hidden;
|
|
64
|
+
-webkit-overflow-scrolling: touch;
|
|
65
|
+
|
|
66
|
+
&::-webkit-scrollbar {
|
|
67
|
+
display: none;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&__nav {
|
|
74
|
+
position: relative;
|
|
75
|
+
display: flex;
|
|
76
|
+
background-color: @tabs-nav-background-color;
|
|
77
|
+
user-select: none;
|
|
78
|
+
|
|
79
|
+
&--line {
|
|
80
|
+
box-sizing: content-box;
|
|
81
|
+
height: 100%;
|
|
82
|
+
padding-bottom: 15px; /* 15px padding to hide scrollbar in mobile safari */
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&--complete {
|
|
86
|
+
padding-right: @padding-xs;
|
|
87
|
+
padding-left: @padding-xs;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&--card {
|
|
91
|
+
box-sizing: border-box;
|
|
92
|
+
height: @tabs-card-height;
|
|
93
|
+
margin: 0 @padding-md;
|
|
94
|
+
border: @border-width-base solid @tabs-default-color;
|
|
95
|
+
border-radius: @border-radius-sm;
|
|
96
|
+
|
|
97
|
+
.van-tab {
|
|
98
|
+
color: @tabs-default-color;
|
|
99
|
+
border-right: @border-width-base solid @tabs-default-color;
|
|
100
|
+
|
|
101
|
+
&:last-child {
|
|
102
|
+
border-right: none;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&.van-tab--active {
|
|
106
|
+
color: @white;
|
|
107
|
+
background-color: @tabs-default-color;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&--disabled {
|
|
111
|
+
color: @tab-disabled-text-color;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&__line {
|
|
118
|
+
position: absolute;
|
|
119
|
+
bottom: 15px;
|
|
120
|
+
left: 0;
|
|
121
|
+
z-index: 1;
|
|
122
|
+
width: @tabs-bottom-bar-width;
|
|
123
|
+
height: @tabs-bottom-bar-height;
|
|
124
|
+
background-color: @tabs-bottom-bar-color;
|
|
125
|
+
border-radius: @tabs-bottom-bar-height;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
&__track {
|
|
129
|
+
position: relative;
|
|
130
|
+
display: flex;
|
|
131
|
+
width: 100%;
|
|
132
|
+
height: 100%;
|
|
133
|
+
will-change: left;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
&__content {
|
|
137
|
+
&--animated {
|
|
138
|
+
overflow: hidden;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
&--line {
|
|
143
|
+
.van-tabs__wrap {
|
|
144
|
+
height: @tabs-line-height;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&--card {
|
|
149
|
+
> .van-tabs__wrap {
|
|
150
|
+
height: @tabs-card-height;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
package/es/tabs/utils.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { raf, cancelRaf } from '../utils/dom/raf';
|
|
2
|
+
import { getScrollTop, setScrollTop } from '../utils/dom/scroll';
|
|
3
|
+
var scrollLeftRafId;
|
|
4
|
+
export function scrollLeftTo(scroller, to, duration) {
|
|
5
|
+
cancelRaf(scrollLeftRafId);
|
|
6
|
+
var count = 0;
|
|
7
|
+
var from = scroller.scrollLeft;
|
|
8
|
+
var frames = duration === 0 ? 1 : Math.round(duration * 1000 / 16);
|
|
9
|
+
|
|
10
|
+
function animate() {
|
|
11
|
+
scroller.scrollLeft += (to - from) / frames;
|
|
12
|
+
|
|
13
|
+
if (++count < frames) {
|
|
14
|
+
scrollLeftRafId = raf(animate);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
animate();
|
|
19
|
+
}
|
|
20
|
+
export function scrollTopTo(scroller, to, duration, callback) {
|
|
21
|
+
var current = getScrollTop(scroller);
|
|
22
|
+
var isDown = current < to;
|
|
23
|
+
var frames = duration === 0 ? 1 : Math.round(duration * 1000 / 16);
|
|
24
|
+
var step = (to - current) / frames;
|
|
25
|
+
|
|
26
|
+
function animate() {
|
|
27
|
+
current += step;
|
|
28
|
+
|
|
29
|
+
if (isDown && current > to || !isDown && current < to) {
|
|
30
|
+
current = to;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
setScrollTop(scroller, current);
|
|
34
|
+
|
|
35
|
+
if (isDown && current < to || !isDown && current > to) {
|
|
36
|
+
raf(animate);
|
|
37
|
+
} else if (callback) {
|
|
38
|
+
raf(callback);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
animate();
|
|
43
|
+
}
|
package/es/tag/index.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.van-tag{position:relative;display:-webkit-inline-box;display:-webkit-inline-flex;display:inline-flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;padding:0 4px;color:#fff;font-size:12px;line-height:16px;border-radius:2px}.van-tag--default{background-color:#969799}.van-tag--default.van-tag--plain{color:#969799}.van-tag--danger{background-color:#ee0a24}.van-tag--danger.van-tag--plain{color:#ee0a24}.van-tag--primary{background-color:#1989fa}.van-tag--primary.van-tag--plain{color:#1989fa}.van-tag--success{background-color:#07c160}.van-tag--success.van-tag--plain{color:#07c160}.van-tag--warning{background-color:#ff976a}.van-tag--warning.van-tag--plain{color:#ff976a}.van-tag--plain{background-color:#fff}.van-tag--plain::before{position:absolute;top:0;right:0;bottom:0;left:0;border:1px solid currentColor;border-radius:inherit;content:'';pointer-events:none}.van-tag--medium{padding:2px 6px}.van-tag--large{padding:4px 8px;font-size:14px;border-radius:4px}.van-tag--mark{border-radius:0 999px 999px 0}.van-tag--mark::after{display:block;width:2px;content:''}.van-tag--round{border-radius:999px}.van-tag__close{margin-left:2px;cursor:pointer}
|
package/es/tag/index.js
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import _mergeJSXProps from "@vue/babel-helper-vue-jsx-merge-props";
|
|
2
|
+
// Utils
|
|
3
|
+
import { createNamespace } from '../utils';
|
|
4
|
+
import { inherit, emit } from '../utils/functional'; // Components
|
|
5
|
+
|
|
6
|
+
import Icon from '../icon'; // Types
|
|
7
|
+
|
|
8
|
+
var _createNamespace = createNamespace('tag'),
|
|
9
|
+
createComponent = _createNamespace[0],
|
|
10
|
+
bem = _createNamespace[1];
|
|
11
|
+
|
|
12
|
+
function Tag(h, props, slots, ctx) {
|
|
13
|
+
var _style;
|
|
14
|
+
|
|
15
|
+
var type = props.type,
|
|
16
|
+
mark = props.mark,
|
|
17
|
+
plain = props.plain,
|
|
18
|
+
color = props.color,
|
|
19
|
+
round = props.round,
|
|
20
|
+
size = props.size;
|
|
21
|
+
var key = plain ? 'color' : 'backgroundColor';
|
|
22
|
+
var style = (_style = {}, _style[key] = color, _style);
|
|
23
|
+
|
|
24
|
+
if (props.textColor) {
|
|
25
|
+
style.color = props.textColor;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
var classes = {
|
|
29
|
+
mark: mark,
|
|
30
|
+
plain: plain,
|
|
31
|
+
round: round
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
if (size) {
|
|
35
|
+
classes[size] = size;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
var CloseIcon = props.closeable && h(Icon, {
|
|
39
|
+
"attrs": {
|
|
40
|
+
"name": "cross"
|
|
41
|
+
},
|
|
42
|
+
"class": bem('close'),
|
|
43
|
+
"on": {
|
|
44
|
+
"click": function click(event) {
|
|
45
|
+
event.stopPropagation();
|
|
46
|
+
emit(ctx, 'close');
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
return h("transition", {
|
|
51
|
+
"attrs": {
|
|
52
|
+
"name": props.closeable ? 'van-fade' : null
|
|
53
|
+
}
|
|
54
|
+
}, [h("span", _mergeJSXProps([{
|
|
55
|
+
"key": "content",
|
|
56
|
+
"style": style,
|
|
57
|
+
"class": bem([classes, type])
|
|
58
|
+
}, inherit(ctx, true)]), [slots.default == null ? void 0 : slots.default(), CloseIcon])]);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
Tag.props = {
|
|
62
|
+
size: String,
|
|
63
|
+
mark: Boolean,
|
|
64
|
+
color: String,
|
|
65
|
+
plain: Boolean,
|
|
66
|
+
round: Boolean,
|
|
67
|
+
textColor: String,
|
|
68
|
+
closeable: Boolean,
|
|
69
|
+
type: {
|
|
70
|
+
type: String,
|
|
71
|
+
default: 'default'
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
export default createComponent(Tag);
|