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
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.BindEventMixin = BindEventMixin;
|
|
5
|
+
|
|
6
|
+
var _event = require("../utils/dom/event");
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Bind event when mounted or activated
|
|
10
|
+
*/
|
|
11
|
+
var uid = 0;
|
|
12
|
+
|
|
13
|
+
function BindEventMixin(handler) {
|
|
14
|
+
var key = "binded_" + uid++;
|
|
15
|
+
|
|
16
|
+
function bind() {
|
|
17
|
+
if (!this[key]) {
|
|
18
|
+
handler.call(this, _event.on, true);
|
|
19
|
+
this[key] = true;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function unbind() {
|
|
24
|
+
if (this[key]) {
|
|
25
|
+
handler.call(this, _event.off, false);
|
|
26
|
+
this[key] = false;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return {
|
|
31
|
+
mounted: bind,
|
|
32
|
+
activated: bind,
|
|
33
|
+
deactivated: unbind,
|
|
34
|
+
beforeDestroy: unbind
|
|
35
|
+
};
|
|
36
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
exports.CheckboxMixin = void 0;
|
|
7
|
+
|
|
8
|
+
var _icon = _interopRequireDefault(require("../icon"));
|
|
9
|
+
|
|
10
|
+
var _field = require("./field");
|
|
11
|
+
|
|
12
|
+
var _relation = require("./relation");
|
|
13
|
+
|
|
14
|
+
var _utils = require("../utils");
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Common part of Checkbox & Radio
|
|
18
|
+
*/
|
|
19
|
+
var CheckboxMixin = function CheckboxMixin(_ref) {
|
|
20
|
+
var parent = _ref.parent,
|
|
21
|
+
bem = _ref.bem,
|
|
22
|
+
role = _ref.role;
|
|
23
|
+
return {
|
|
24
|
+
mixins: [(0, _relation.ChildrenMixin)(parent), _field.FieldMixin],
|
|
25
|
+
props: {
|
|
26
|
+
name: null,
|
|
27
|
+
value: null,
|
|
28
|
+
disabled: Boolean,
|
|
29
|
+
iconSize: [Number, String],
|
|
30
|
+
checkedColor: String,
|
|
31
|
+
labelPosition: String,
|
|
32
|
+
labelDisabled: Boolean,
|
|
33
|
+
shape: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: 'round'
|
|
36
|
+
},
|
|
37
|
+
bindGroup: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: true
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
computed: {
|
|
43
|
+
disableBindRelation: function disableBindRelation() {
|
|
44
|
+
return !this.bindGroup;
|
|
45
|
+
},
|
|
46
|
+
isDisabled: function isDisabled() {
|
|
47
|
+
return this.parent && this.parent.disabled || this.disabled;
|
|
48
|
+
},
|
|
49
|
+
direction: function direction() {
|
|
50
|
+
return this.parent && this.parent.direction || null;
|
|
51
|
+
},
|
|
52
|
+
iconStyle: function iconStyle() {
|
|
53
|
+
var checkedColor = this.checkedColor || this.parent && this.parent.checkedColor;
|
|
54
|
+
|
|
55
|
+
if (checkedColor && this.checked && !this.isDisabled) {
|
|
56
|
+
return {
|
|
57
|
+
borderColor: checkedColor,
|
|
58
|
+
backgroundColor: checkedColor
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
tabindex: function tabindex() {
|
|
63
|
+
if (this.isDisabled || role === 'radio' && !this.checked) {
|
|
64
|
+
return -1;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return 0;
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
methods: {
|
|
71
|
+
onClick: function onClick(event) {
|
|
72
|
+
var _this = this;
|
|
73
|
+
|
|
74
|
+
var target = event.target;
|
|
75
|
+
var icon = this.$refs.icon;
|
|
76
|
+
var iconClicked = icon === target || icon.contains(target);
|
|
77
|
+
|
|
78
|
+
if (!this.isDisabled && (iconClicked || !this.labelDisabled)) {
|
|
79
|
+
this.toggle(); // wait for toggle method to complete
|
|
80
|
+
// so we can get the changed value in the click event listener
|
|
81
|
+
|
|
82
|
+
setTimeout(function () {
|
|
83
|
+
_this.$emit('click', event);
|
|
84
|
+
});
|
|
85
|
+
} else {
|
|
86
|
+
this.$emit('click', event);
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
genIcon: function genIcon() {
|
|
90
|
+
var h = this.$createElement;
|
|
91
|
+
var checked = this.checked;
|
|
92
|
+
var iconSize = this.iconSize || this.parent && this.parent.iconSize;
|
|
93
|
+
return h("div", {
|
|
94
|
+
"ref": "icon",
|
|
95
|
+
"class": bem('icon', [this.shape, {
|
|
96
|
+
disabled: this.isDisabled,
|
|
97
|
+
checked: checked
|
|
98
|
+
}]),
|
|
99
|
+
"style": {
|
|
100
|
+
fontSize: (0, _utils.addUnit)(iconSize)
|
|
101
|
+
}
|
|
102
|
+
}, [this.slots('icon', {
|
|
103
|
+
checked: checked
|
|
104
|
+
}) || h(_icon.default, {
|
|
105
|
+
"attrs": {
|
|
106
|
+
"name": "success"
|
|
107
|
+
},
|
|
108
|
+
"style": this.iconStyle
|
|
109
|
+
})]);
|
|
110
|
+
},
|
|
111
|
+
genLabel: function genLabel() {
|
|
112
|
+
var h = this.$createElement;
|
|
113
|
+
var slot = this.slots();
|
|
114
|
+
|
|
115
|
+
if (slot) {
|
|
116
|
+
return h("span", {
|
|
117
|
+
"class": bem('label', [this.labelPosition, {
|
|
118
|
+
disabled: this.isDisabled
|
|
119
|
+
}])
|
|
120
|
+
}, [slot]);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
render: function render() {
|
|
125
|
+
var h = arguments[0];
|
|
126
|
+
var Children = [this.genIcon()];
|
|
127
|
+
|
|
128
|
+
if (this.labelPosition === 'left') {
|
|
129
|
+
Children.unshift(this.genLabel());
|
|
130
|
+
} else {
|
|
131
|
+
Children.push(this.genLabel());
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
return h("div", {
|
|
135
|
+
"attrs": {
|
|
136
|
+
"role": role,
|
|
137
|
+
"tabindex": this.tabindex,
|
|
138
|
+
"aria-checked": String(this.checked)
|
|
139
|
+
},
|
|
140
|
+
"class": bem([{
|
|
141
|
+
disabled: this.isDisabled,
|
|
142
|
+
'label-disabled': this.labelDisabled
|
|
143
|
+
}, this.direction]),
|
|
144
|
+
"on": {
|
|
145
|
+
"click": this.onClick
|
|
146
|
+
}
|
|
147
|
+
}, [Children]);
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
exports.CheckboxMixin = CheckboxMixin;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.ClickOutsideMixin = void 0;
|
|
5
|
+
|
|
6
|
+
var _event = require("../utils/dom/event");
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Listen to click outside event
|
|
10
|
+
*/
|
|
11
|
+
var ClickOutsideMixin = function ClickOutsideMixin(config) {
|
|
12
|
+
return {
|
|
13
|
+
props: {
|
|
14
|
+
closeOnClickOutside: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: true
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
data: function data() {
|
|
20
|
+
var _this = this;
|
|
21
|
+
|
|
22
|
+
var clickOutsideHandler = function clickOutsideHandler(event) {
|
|
23
|
+
if (_this.closeOnClickOutside && !_this.$el.contains(event.target)) {
|
|
24
|
+
_this[config.method]();
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
return {
|
|
29
|
+
clickOutsideHandler: clickOutsideHandler
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
mounted: function mounted() {
|
|
33
|
+
(0, _event.on)(document, config.event, this.clickOutsideHandler);
|
|
34
|
+
},
|
|
35
|
+
beforeDestroy: function beforeDestroy() {
|
|
36
|
+
(0, _event.off)(document, config.event, this.clickOutsideHandler);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
exports.ClickOutsideMixin = ClickOutsideMixin;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.CloseOnPopstateMixin = void 0;
|
|
5
|
+
|
|
6
|
+
var _event = require("../utils/dom/event");
|
|
7
|
+
|
|
8
|
+
var _bindEvent = require("./bind-event");
|
|
9
|
+
|
|
10
|
+
var CloseOnPopstateMixin = {
|
|
11
|
+
mixins: [(0, _bindEvent.BindEventMixin)(function (bind, isBind) {
|
|
12
|
+
this.handlePopstate(isBind && this.closeOnPopstate);
|
|
13
|
+
})],
|
|
14
|
+
props: {
|
|
15
|
+
closeOnPopstate: Boolean
|
|
16
|
+
},
|
|
17
|
+
data: function data() {
|
|
18
|
+
return {
|
|
19
|
+
bindStatus: false
|
|
20
|
+
};
|
|
21
|
+
},
|
|
22
|
+
watch: {
|
|
23
|
+
closeOnPopstate: function closeOnPopstate(val) {
|
|
24
|
+
this.handlePopstate(val);
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
methods: {
|
|
28
|
+
onPopstate: function onPopstate() {
|
|
29
|
+
this.close();
|
|
30
|
+
this.shouldReopen = false;
|
|
31
|
+
},
|
|
32
|
+
handlePopstate: function handlePopstate(bind) {
|
|
33
|
+
/* istanbul ignore if */
|
|
34
|
+
if (this.$isServer) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (this.bindStatus !== bind) {
|
|
39
|
+
this.bindStatus = bind;
|
|
40
|
+
var action = bind ? _event.on : _event.off;
|
|
41
|
+
action(window, 'popstate', this.onPopstate);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
exports.CloseOnPopstateMixin = CloseOnPopstateMixin;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.FieldMixin = void 0;
|
|
5
|
+
var FieldMixin = {
|
|
6
|
+
inject: {
|
|
7
|
+
vanField: {
|
|
8
|
+
default: null
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
watch: {
|
|
12
|
+
value: function value() {
|
|
13
|
+
var field = this.vanField;
|
|
14
|
+
|
|
15
|
+
if (field) {
|
|
16
|
+
field.resetValidation();
|
|
17
|
+
field.validateWithTrigger('onChange');
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
created: function created() {
|
|
22
|
+
var field = this.vanField;
|
|
23
|
+
|
|
24
|
+
if (field && !field.children) {
|
|
25
|
+
field.children = this;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
exports.FieldMixin = FieldMixin;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.context = void 0;
|
|
5
|
+
var context = {
|
|
6
|
+
zIndex: 2000,
|
|
7
|
+
lockCount: 0,
|
|
8
|
+
stack: [],
|
|
9
|
+
find: function find(vm) {
|
|
10
|
+
return this.stack.filter(function (item) {
|
|
11
|
+
return item.vm === vm;
|
|
12
|
+
})[0];
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
exports.context = context;
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.PopupMixin = PopupMixin;
|
|
5
|
+
exports.popupMixinProps = void 0;
|
|
6
|
+
|
|
7
|
+
var _context = require("./context");
|
|
8
|
+
|
|
9
|
+
var _overlay = require("./overlay");
|
|
10
|
+
|
|
11
|
+
var _event = require("../../utils/dom/event");
|
|
12
|
+
|
|
13
|
+
var _node = require("../../utils/dom/node");
|
|
14
|
+
|
|
15
|
+
var _scroll = require("../../utils/dom/scroll");
|
|
16
|
+
|
|
17
|
+
var _touch = require("../touch");
|
|
18
|
+
|
|
19
|
+
var _portal = require("../portal");
|
|
20
|
+
|
|
21
|
+
var _closeOnPopstate = require("../close-on-popstate");
|
|
22
|
+
|
|
23
|
+
// Context
|
|
24
|
+
// Utils
|
|
25
|
+
// Mixins
|
|
26
|
+
var popupMixinProps = {
|
|
27
|
+
// Initial rendering animation
|
|
28
|
+
transitionAppear: Boolean,
|
|
29
|
+
// whether to show popup
|
|
30
|
+
value: Boolean,
|
|
31
|
+
// whether to show overlay
|
|
32
|
+
overlay: Boolean,
|
|
33
|
+
// overlay custom style
|
|
34
|
+
overlayStyle: Object,
|
|
35
|
+
// overlay custom class name
|
|
36
|
+
overlayClass: String,
|
|
37
|
+
// whether to close popup when overlay is clicked
|
|
38
|
+
closeOnClickOverlay: Boolean,
|
|
39
|
+
// z-index
|
|
40
|
+
zIndex: [Number, String],
|
|
41
|
+
// prevent body scroll
|
|
42
|
+
lockScroll: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: true
|
|
45
|
+
},
|
|
46
|
+
// whether to lazy render
|
|
47
|
+
lazyRender: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
default: true
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
exports.popupMixinProps = popupMixinProps;
|
|
53
|
+
|
|
54
|
+
function PopupMixin(options) {
|
|
55
|
+
if (options === void 0) {
|
|
56
|
+
options = {};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return {
|
|
60
|
+
mixins: [_touch.TouchMixin, _closeOnPopstate.CloseOnPopstateMixin, (0, _portal.PortalMixin)({
|
|
61
|
+
afterPortal: function afterPortal() {
|
|
62
|
+
if (this.overlay) {
|
|
63
|
+
(0, _overlay.updateOverlay)();
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
})],
|
|
67
|
+
props: popupMixinProps,
|
|
68
|
+
data: function data() {
|
|
69
|
+
return {
|
|
70
|
+
inited: this.value
|
|
71
|
+
};
|
|
72
|
+
},
|
|
73
|
+
computed: {
|
|
74
|
+
shouldRender: function shouldRender() {
|
|
75
|
+
return this.inited || !this.lazyRender;
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
watch: {
|
|
79
|
+
value: function value(val) {
|
|
80
|
+
var type = val ? 'open' : 'close';
|
|
81
|
+
this.inited = this.inited || this.value;
|
|
82
|
+
this[type]();
|
|
83
|
+
|
|
84
|
+
if (!options.skipToggleEvent) {
|
|
85
|
+
this.$emit(type);
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
overlay: 'renderOverlay'
|
|
89
|
+
},
|
|
90
|
+
mounted: function mounted() {
|
|
91
|
+
if (this.value) {
|
|
92
|
+
this.open();
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
/* istanbul ignore next */
|
|
97
|
+
activated: function activated() {
|
|
98
|
+
if (this.shouldReopen) {
|
|
99
|
+
this.$emit('input', true);
|
|
100
|
+
this.shouldReopen = false;
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
beforeDestroy: function beforeDestroy() {
|
|
104
|
+
(0, _overlay.removeOverlay)(this);
|
|
105
|
+
|
|
106
|
+
if (this.opened) {
|
|
107
|
+
this.removeLock();
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if (this.getContainer) {
|
|
111
|
+
(0, _node.removeNode)(this.$el);
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
|
|
115
|
+
/* istanbul ignore next */
|
|
116
|
+
deactivated: function deactivated() {
|
|
117
|
+
if (this.value) {
|
|
118
|
+
this.close();
|
|
119
|
+
this.shouldReopen = true;
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
methods: {
|
|
123
|
+
open: function open() {
|
|
124
|
+
/* istanbul ignore next */
|
|
125
|
+
if (this.$isServer || this.opened) {
|
|
126
|
+
return;
|
|
127
|
+
} // cover default zIndex
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
if (this.zIndex !== undefined) {
|
|
131
|
+
_context.context.zIndex = this.zIndex;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
this.opened = true;
|
|
135
|
+
this.renderOverlay();
|
|
136
|
+
this.addLock();
|
|
137
|
+
},
|
|
138
|
+
addLock: function addLock() {
|
|
139
|
+
if (this.lockScroll) {
|
|
140
|
+
(0, _event.on)(document, 'touchstart', this.touchStart);
|
|
141
|
+
(0, _event.on)(document, 'touchmove', this.onTouchMove);
|
|
142
|
+
|
|
143
|
+
if (!_context.context.lockCount) {
|
|
144
|
+
document.body.classList.add('van-overflow-hidden');
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
_context.context.lockCount++;
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
removeLock: function removeLock() {
|
|
151
|
+
if (this.lockScroll && _context.context.lockCount) {
|
|
152
|
+
_context.context.lockCount--;
|
|
153
|
+
(0, _event.off)(document, 'touchstart', this.touchStart);
|
|
154
|
+
(0, _event.off)(document, 'touchmove', this.onTouchMove);
|
|
155
|
+
|
|
156
|
+
if (!_context.context.lockCount) {
|
|
157
|
+
document.body.classList.remove('van-overflow-hidden');
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
close: function close() {
|
|
162
|
+
if (!this.opened) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
(0, _overlay.closeOverlay)(this);
|
|
167
|
+
this.opened = false;
|
|
168
|
+
this.removeLock();
|
|
169
|
+
this.$emit('input', false);
|
|
170
|
+
},
|
|
171
|
+
onTouchMove: function onTouchMove(event) {
|
|
172
|
+
this.touchMove(event);
|
|
173
|
+
var direction = this.deltaY > 0 ? '10' : '01';
|
|
174
|
+
var el = (0, _scroll.getScroller)(event.target, this.$el);
|
|
175
|
+
var scrollHeight = el.scrollHeight,
|
|
176
|
+
offsetHeight = el.offsetHeight,
|
|
177
|
+
scrollTop = el.scrollTop;
|
|
178
|
+
var status = '11';
|
|
179
|
+
/* istanbul ignore next */
|
|
180
|
+
|
|
181
|
+
if (scrollTop === 0) {
|
|
182
|
+
status = offsetHeight >= scrollHeight ? '00' : '01';
|
|
183
|
+
} else if (scrollTop + offsetHeight >= scrollHeight) {
|
|
184
|
+
status = '10';
|
|
185
|
+
}
|
|
186
|
+
/* istanbul ignore next */
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
if (status !== '11' && this.direction === 'vertical' && !(parseInt(status, 2) & parseInt(direction, 2))) {
|
|
190
|
+
(0, _event.preventDefault)(event, true);
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
renderOverlay: function renderOverlay() {
|
|
194
|
+
var _this = this;
|
|
195
|
+
|
|
196
|
+
if (this.$isServer || !this.value) {
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
this.$nextTick(function () {
|
|
201
|
+
_this.updateZIndex(_this.overlay ? 1 : 0);
|
|
202
|
+
|
|
203
|
+
if (_this.overlay) {
|
|
204
|
+
(0, _overlay.openOverlay)(_this, {
|
|
205
|
+
zIndex: _context.context.zIndex++,
|
|
206
|
+
duration: _this.duration,
|
|
207
|
+
className: _this.overlayClass,
|
|
208
|
+
customStyle: _this.overlayStyle
|
|
209
|
+
});
|
|
210
|
+
} else {
|
|
211
|
+
(0, _overlay.closeOverlay)(_this);
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
},
|
|
215
|
+
updateZIndex: function updateZIndex(value) {
|
|
216
|
+
if (value === void 0) {
|
|
217
|
+
value = 0;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
this.$el.style.zIndex = ++_context.context.zIndex + value;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
};
|
|
224
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
exports.updateOverlay = updateOverlay;
|
|
7
|
+
exports.openOverlay = openOverlay;
|
|
8
|
+
exports.closeOverlay = closeOverlay;
|
|
9
|
+
exports.removeOverlay = removeOverlay;
|
|
10
|
+
|
|
11
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
12
|
+
|
|
13
|
+
var _overlay = _interopRequireDefault(require("../../overlay"));
|
|
14
|
+
|
|
15
|
+
var _context = require("./context");
|
|
16
|
+
|
|
17
|
+
var _functional = require("../../utils/functional");
|
|
18
|
+
|
|
19
|
+
var _node = require("../../utils/dom/node");
|
|
20
|
+
|
|
21
|
+
var defaultConfig = {
|
|
22
|
+
className: '',
|
|
23
|
+
customStyle: {}
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
function mountOverlay(vm) {
|
|
27
|
+
return (0, _functional.mount)(_overlay.default, {
|
|
28
|
+
on: {
|
|
29
|
+
// close popup when overlay clicked & closeOnClickOverlay is true
|
|
30
|
+
click: function click() {
|
|
31
|
+
vm.$emit('click-overlay');
|
|
32
|
+
|
|
33
|
+
if (vm.closeOnClickOverlay) {
|
|
34
|
+
if (vm.onClickOverlay) {
|
|
35
|
+
vm.onClickOverlay();
|
|
36
|
+
} else {
|
|
37
|
+
vm.close();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function updateOverlay(vm) {
|
|
46
|
+
var item = _context.context.find(vm);
|
|
47
|
+
|
|
48
|
+
if (item) {
|
|
49
|
+
var el = vm.$el;
|
|
50
|
+
var config = item.config,
|
|
51
|
+
overlay = item.overlay;
|
|
52
|
+
|
|
53
|
+
if (el && el.parentNode) {
|
|
54
|
+
el.parentNode.insertBefore(overlay.$el, el);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
(0, _extends2.default)(overlay, defaultConfig, config, {
|
|
58
|
+
show: true
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function openOverlay(vm, config) {
|
|
64
|
+
var item = _context.context.find(vm);
|
|
65
|
+
|
|
66
|
+
if (item) {
|
|
67
|
+
item.config = config;
|
|
68
|
+
} else {
|
|
69
|
+
var overlay = mountOverlay(vm);
|
|
70
|
+
|
|
71
|
+
_context.context.stack.push({
|
|
72
|
+
vm: vm,
|
|
73
|
+
config: config,
|
|
74
|
+
overlay: overlay
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
updateOverlay(vm);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function closeOverlay(vm) {
|
|
82
|
+
var item = _context.context.find(vm);
|
|
83
|
+
|
|
84
|
+
if (item) {
|
|
85
|
+
item.overlay.show = false;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function removeOverlay(vm) {
|
|
90
|
+
var item = _context.context.find(vm);
|
|
91
|
+
|
|
92
|
+
if (item) {
|
|
93
|
+
(0, _node.removeNode)(item.overlay.$el);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.PortalMixin = PortalMixin;
|
|
5
|
+
|
|
6
|
+
function getElement(selector) {
|
|
7
|
+
if (typeof selector === 'string') {
|
|
8
|
+
return document.querySelector(selector);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
return selector();
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function PortalMixin(_temp) {
|
|
15
|
+
var _ref = _temp === void 0 ? {} : _temp,
|
|
16
|
+
ref = _ref.ref,
|
|
17
|
+
afterPortal = _ref.afterPortal;
|
|
18
|
+
|
|
19
|
+
return {
|
|
20
|
+
props: {
|
|
21
|
+
getContainer: [String, Function]
|
|
22
|
+
},
|
|
23
|
+
watch: {
|
|
24
|
+
getContainer: 'portal'
|
|
25
|
+
},
|
|
26
|
+
mounted: function mounted() {
|
|
27
|
+
if (this.getContainer) {
|
|
28
|
+
this.portal();
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
methods: {
|
|
32
|
+
portal: function portal() {
|
|
33
|
+
var getContainer = this.getContainer;
|
|
34
|
+
var el = ref ? this.$refs[ref] : this.$el;
|
|
35
|
+
var container;
|
|
36
|
+
|
|
37
|
+
if (getContainer) {
|
|
38
|
+
container = getElement(getContainer);
|
|
39
|
+
} else if (this.$parent) {
|
|
40
|
+
container = this.$parent.$el;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (container && container !== el.parentNode) {
|
|
44
|
+
container.appendChild(el);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (afterPortal) {
|
|
48
|
+
afterPortal.call(this);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}
|