vant 4.0.0-alpha.0 → 4.0.0-alpha.3
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/README.md +141 -0
- package/changelog.generated.md +198 -0
- package/es/address-edit/AddressEdit.d.ts +0 -17
- package/es/address-edit/AddressEdit.js +3 -24
- package/es/address-edit/index.d.ts +0 -12
- package/es/address-edit/types.d.ts +0 -1
- package/es/address-list/AddressListItem.d.ts +3 -2
- package/es/address-list/AddressListItem.js +1 -1
- package/es/badge/Badge.d.ts +4 -3
- package/es/badge/index.d.ts +2 -2
- package/es/calendar/Calendar.d.ts +4 -0
- package/es/calendar/Calendar.js +3 -1
- package/es/calendar/CalendarDay.js +4 -0
- package/es/calendar/index.css +1 -1
- package/es/calendar/index.d.ts +3 -0
- package/es/calendar/index.less +3 -0
- package/es/calendar/types.d.ts +2 -1
- package/es/cascader/types.d.ts +2 -1
- package/es/checkbox/Checker.d.ts +2 -1
- package/es/collapse/Collapse.d.ts +7 -6
- package/es/collapse/index.d.ts +3 -3
- package/es/composables/use-touch.js +1 -1
- package/es/config-provider/ConfigProvider.d.ts +4 -3
- package/es/config-provider/ConfigProvider.js +2 -0
- package/es/config-provider/index.d.ts +2 -2
- package/es/contact-list/ContactList.d.ts +3 -2
- package/es/coupon/Coupon.d.ts +2 -1
- package/es/coupon-list/CouponList.d.ts +3 -13
- package/es/coupon-list/CouponList.js +9 -7
- package/es/coupon-list/index.css +1 -1
- package/es/coupon-list/index.d.ts +2 -9
- package/es/coupon-list/index.less +4 -16
- package/es/coupon-list/style/index.js +1 -0
- package/es/coupon-list/style/less.js +1 -0
- package/es/date-picker/DatePicker.js +1 -1
- package/es/dialog/index.css +1 -1
- package/es/dialog/index.less +2 -0
- package/es/dialog/types.d.ts +2 -2
- package/es/dropdown-item/types.d.ts +2 -1
- package/es/empty/Empty.d.ts +8 -7
- package/es/empty/Empty.js +12 -15
- package/es/empty/Images.d.ts +4 -0
- package/es/empty/Images.js +271 -0
- package/es/empty/index.d.ts +2 -2
- package/es/field/Field.d.ts +4 -0
- package/es/field/Field.js +8 -3
- package/es/field/index.d.ts +2 -0
- package/es/field/types.d.ts +1 -1
- package/es/form/Form.d.ts +13 -13
- package/es/form/Form.js +7 -3
- package/es/form/index.d.ts +9 -9
- package/es/form/types.d.ts +1 -0
- package/es/icon/index.css +1 -1
- package/es/index-bar/IndexBar.d.ts +5 -4
- package/es/index-bar/IndexBar.js +25 -4
- package/es/index-bar/index.d.ts +3 -3
- package/es/index-bar/types.d.ts +2 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/loading/Loading.js +3 -1
- package/es/locale/lang/bn-BD.d.ts +0 -2
- package/es/locale/lang/bn-BD.js +0 -2
- package/es/locale/lang/da-DK.d.ts +64 -0
- package/es/locale/lang/da-DK.js +66 -0
- package/es/locale/lang/de-DE-formal.d.ts +0 -2
- package/es/locale/lang/de-DE-formal.js +0 -2
- package/es/locale/lang/de-DE.d.ts +0 -2
- package/es/locale/lang/de-DE.js +0 -2
- package/es/locale/lang/en-US.d.ts +0 -2
- package/es/locale/lang/en-US.js +0 -2
- package/es/locale/lang/es-ES.d.ts +0 -2
- package/es/locale/lang/es-ES.js +0 -2
- package/es/locale/lang/fr-FR.d.ts +0 -2
- package/es/locale/lang/fr-FR.js +0 -2
- package/es/locale/lang/hi-IN.d.ts +0 -2
- package/es/locale/lang/hi-IN.js +0 -2
- package/es/locale/lang/id-ID.d.ts +0 -2
- package/es/locale/lang/id-ID.js +0 -2
- package/es/locale/lang/is-IS.d.ts +62 -0
- package/es/locale/lang/is-IS.js +72 -0
- package/es/locale/lang/it-IT.d.ts +0 -2
- package/es/locale/lang/it-IT.js +0 -2
- package/es/locale/lang/ja-JP.d.ts +0 -2
- package/es/locale/lang/ja-JP.js +0 -2
- package/es/locale/lang/ko-KR.d.ts +0 -2
- package/es/locale/lang/ko-KR.js +0 -2
- package/es/locale/lang/la-LA.d.ts +62 -0
- package/es/locale/lang/la-LA.js +64 -0
- package/es/locale/lang/nb-NO.d.ts +0 -2
- package/es/locale/lang/nb-NO.js +0 -2
- package/es/locale/lang/pt-BR.d.ts +0 -2
- package/es/locale/lang/pt-BR.js +0 -2
- package/es/locale/lang/ro-RO.d.ts +0 -2
- package/es/locale/lang/ro-RO.js +0 -2
- package/es/locale/lang/ru-RU.d.ts +0 -2
- package/es/locale/lang/ru-RU.js +0 -2
- package/es/locale/lang/sv-SE.d.ts +62 -0
- package/es/locale/lang/sv-SE.js +64 -0
- package/es/locale/lang/th-TH.d.ts +0 -2
- package/es/locale/lang/th-TH.js +0 -2
- package/es/locale/lang/tr-TR.d.ts +0 -2
- package/es/locale/lang/tr-TR.js +0 -2
- package/es/locale/lang/uk-UA.d.ts +0 -2
- package/es/locale/lang/uk-UA.js +0 -2
- package/es/locale/lang/vi-VN.d.ts +0 -2
- package/es/locale/lang/vi-VN.js +0 -2
- package/es/locale/lang/zh-CN.d.ts +0 -2
- package/es/locale/lang/zh-CN.js +0 -2
- package/es/locale/lang/zh-HK.d.ts +0 -2
- package/es/locale/lang/zh-HK.js +0 -2
- package/es/locale/lang/zh-TW.d.ts +0 -2
- package/es/locale/lang/zh-TW.js +0 -2
- package/es/nav-bar/NavBar.d.ts +1 -1
- package/es/nav-bar/NavBar.js +3 -3
- package/es/nav-bar/index.d.ts +1 -1
- package/es/notify/types.d.ts +2 -1
- package/es/number-keyboard/NumberKeyboard.js +10 -1
- package/es/picker/Picker.d.ts +5 -4
- package/es/picker/index.css +1 -1
- package/es/picker/index.d.ts +3 -3
- package/es/picker/index.less +1 -0
- package/es/picker/types.d.ts +4 -3
- package/es/picker/utils.d.ts +4 -3
- package/es/popup/Popup.d.ts +4 -0
- package/es/popup/Popup.js +3 -0
- package/es/popup/index.css +1 -1
- package/es/popup/index.d.ts +3 -0
- package/es/progress/Progress.d.ts +4 -3
- package/es/progress/index.d.ts +2 -2
- package/es/rate/Rate.js +32 -10
- package/es/search/Search.d.ts +3 -0
- package/es/search/index.css +1 -1
- package/es/search/index.d.ts +2 -0
- package/es/search/index.less +1 -1
- package/es/share-sheet/ShareSheet.js +25 -11
- package/es/share-sheet/index.css +1 -1
- package/es/share-sheet/index.less +45 -1
- package/es/skeleton/Skeleton.d.ts +5 -4
- package/es/skeleton/Skeleton.js +6 -4
- package/es/skeleton/index.d.ts +3 -3
- package/es/slider/index.css +1 -1
- package/es/style/animation.css +1 -1
- package/es/style/base.css +1 -1
- package/es/style/base.less +5 -0
- package/es/swipe-cell/SwipeCell.js +1 -1
- package/es/swipe-cell/index.css +1 -1
- package/es/tabbar/Tabbar.d.ts +2 -2
- package/es/tabs/Tabs.d.ts +1 -1
- package/es/tabs/Tabs.js +1 -0
- package/es/tabs/types.d.ts +5 -4
- package/es/toast/Toast.js +1 -0
- package/es/toast/types.d.ts +3 -2
- package/es/tree-select/TreeSelect.d.ts +7 -6
- package/es/tree-select/index.d.ts +3 -3
- package/es/uploader/Uploader.d.ts +4 -4
- package/es/uploader/Uploader.js +3 -3
- package/es/uploader/UploaderPreviewItem.d.ts +3 -3
- package/es/uploader/UploaderPreviewItem.js +9 -6
- package/es/uploader/index.d.ts +2 -2
- package/es/uploader/types.d.ts +5 -5
- package/es/uploader/utils.d.ts +0 -1
- package/es/uploader/utils.js +2 -4
- package/es/utils/basic.d.ts +2 -0
- package/es/utils/basic.js +3 -1
- package/es/utils/format.d.ts +7 -6
- package/es/utils/format.js +6 -0
- package/es/utils/validate.d.ts +2 -1
- package/lib/action-bar/ActionBar.js +8 -13
- package/lib/action-bar/index.js +9 -16
- package/lib/action-bar-button/ActionBarButton.js +8 -13
- package/lib/action-bar-button/index.js +9 -16
- package/lib/action-bar-icon/ActionBarIcon.js +8 -13
- package/lib/action-bar-icon/index.js +9 -16
- package/lib/action-sheet/ActionSheet.js +8 -13
- package/lib/action-sheet/index.js +9 -16
- package/lib/address-edit/AddressEdit.d.ts +0 -17
- package/lib/address-edit/AddressEdit.js +12 -40
- package/lib/address-edit/AddressEditDetail.js +8 -13
- package/lib/address-edit/index.d.ts +0 -12
- package/lib/address-edit/index.js +9 -16
- package/lib/address-edit/types.d.ts +0 -1
- package/lib/address-edit/types.js +7 -12
- package/lib/address-list/AddressList.js +9 -16
- package/lib/address-list/AddressListItem.d.ts +3 -2
- package/lib/address-list/AddressListItem.js +8 -13
- package/lib/address-list/index.js +9 -16
- package/lib/area/Area.js +8 -13
- package/lib/area/index.js +9 -16
- package/lib/area/types.js +7 -12
- package/lib/area/utils.js +8 -13
- package/lib/badge/Badge.d.ts +4 -3
- package/lib/badge/Badge.js +8 -13
- package/lib/badge/index.d.ts +2 -2
- package/lib/badge/index.js +9 -16
- package/lib/button/Button.js +8 -13
- package/lib/button/index.js +9 -16
- package/lib/button/types.js +7 -12
- package/lib/calendar/Calendar.d.ts +4 -0
- package/lib/calendar/Calendar.js +12 -17
- package/lib/calendar/CalendarDay.js +12 -13
- package/lib/calendar/CalendarHeader.js +8 -13
- package/lib/calendar/CalendarMonth.js +9 -16
- package/lib/calendar/index.css +1 -1
- package/lib/calendar/index.d.ts +3 -0
- package/lib/calendar/index.js +9 -16
- package/lib/calendar/index.less +3 -0
- package/lib/calendar/types.d.ts +2 -1
- package/lib/calendar/types.js +7 -12
- package/lib/calendar/utils.js +8 -13
- package/lib/card/Card.js +8 -13
- package/lib/card/index.js +9 -16
- package/lib/cascader/Cascader.js +8 -13
- package/lib/cascader/index.js +9 -16
- package/lib/cascader/types.d.ts +2 -1
- package/lib/cascader/types.js +7 -12
- package/lib/cell/Cell.js +8 -13
- package/lib/cell/index.js +9 -16
- package/lib/cell-group/CellGroup.js +8 -13
- package/lib/cell-group/index.js +9 -16
- package/lib/checkbox/Checkbox.js +9 -16
- package/lib/checkbox/Checker.d.ts +2 -1
- package/lib/checkbox/Checker.js +8 -13
- package/lib/checkbox/index.js +9 -16
- package/lib/checkbox/types.js +7 -12
- package/lib/checkbox-group/CheckboxGroup.js +8 -13
- package/lib/checkbox-group/index.js +9 -16
- package/lib/checkbox-group/types.js +7 -12
- package/lib/circle/Circle.js +8 -13
- package/lib/circle/index.js +9 -16
- package/lib/col/Col.js +8 -13
- package/lib/col/index.js +9 -16
- package/lib/collapse/Collapse.d.ts +7 -6
- package/lib/collapse/Collapse.js +8 -13
- package/lib/collapse/index.d.ts +3 -3
- package/lib/collapse/index.js +9 -16
- package/lib/collapse-item/CollapseItem.js +8 -13
- package/lib/collapse-item/index.js +9 -16
- package/lib/collapse-item/types.js +7 -12
- package/lib/composables/on-popup-reopen.js +8 -13
- package/lib/composables/use-expose.js +8 -13
- package/lib/composables/use-height.js +8 -13
- package/lib/composables/use-id.js +8 -13
- package/lib/composables/use-lazy-render.js +8 -13
- package/lib/composables/use-lock-scroll.js +8 -13
- package/lib/composables/use-placeholder.js +8 -13
- package/lib/composables/use-refs.js +8 -13
- package/lib/composables/use-route.js +8 -13
- package/lib/composables/use-tab-status.js +8 -13
- package/lib/composables/use-touch.js +9 -14
- package/lib/composables/use-visibility-change.js +8 -13
- package/lib/config-provider/ConfigProvider.d.ts +4 -3
- package/lib/config-provider/ConfigProvider.js +10 -13
- package/lib/config-provider/index.d.ts +2 -2
- package/lib/config-provider/index.js +9 -16
- package/lib/contact-card/ContactCard.js +8 -13
- package/lib/contact-card/index.js +9 -16
- package/lib/contact-edit/ContactEdit.js +8 -13
- package/lib/contact-edit/index.js +9 -16
- package/lib/contact-list/ContactList.d.ts +3 -2
- package/lib/contact-list/ContactList.js +8 -13
- package/lib/contact-list/index.js +9 -16
- package/lib/count-down/CountDown.js +8 -13
- package/lib/count-down/index.js +9 -16
- package/lib/count-down/types.js +7 -12
- package/lib/count-down/utils.js +8 -13
- package/lib/coupon/Coupon.d.ts +2 -1
- package/lib/coupon/Coupon.js +8 -13
- package/lib/coupon/index.js +9 -16
- package/lib/coupon/utils.js +8 -13
- package/lib/coupon-cell/CouponCell.js +8 -13
- package/lib/coupon-cell/index.js +9 -16
- package/lib/coupon-list/CouponList.d.ts +3 -13
- package/lib/coupon-list/CouponList.js +17 -20
- package/lib/coupon-list/index.css +1 -1
- package/lib/coupon-list/index.d.ts +2 -9
- package/lib/coupon-list/index.js +9 -16
- package/lib/coupon-list/index.less +4 -16
- package/lib/coupon-list/style/index.js +1 -0
- package/lib/coupon-list/style/less.js +1 -0
- package/lib/date-picker/DatePicker.js +9 -14
- package/lib/date-picker/index.js +9 -16
- package/lib/date-picker/utils.js +8 -13
- package/lib/dialog/Dialog.js +8 -13
- package/lib/dialog/function-call.js +9 -16
- package/lib/dialog/index.css +1 -1
- package/lib/dialog/index.js +8 -13
- package/lib/dialog/index.less +2 -0
- package/lib/dialog/types.d.ts +2 -2
- package/lib/dialog/types.js +7 -12
- package/lib/divider/Divider.js +8 -13
- package/lib/divider/index.js +9 -16
- package/lib/dropdown-item/DropdownItem.js +8 -13
- package/lib/dropdown-item/index.js +9 -16
- package/lib/dropdown-item/types.d.ts +2 -1
- package/lib/dropdown-item/types.js +7 -12
- package/lib/dropdown-menu/DropdownMenu.js +8 -13
- package/lib/dropdown-menu/index.js +9 -16
- package/lib/dropdown-menu/types.js +7 -12
- package/lib/empty/Empty.d.ts +8 -7
- package/lib/empty/Empty.js +19 -27
- package/lib/empty/Images.d.ts +4 -0
- package/lib/empty/Images.js +290 -0
- package/lib/empty/index.d.ts +2 -2
- package/lib/empty/index.js +9 -16
- package/lib/field/Field.d.ts +4 -0
- package/lib/field/Field.js +15 -15
- package/lib/field/index.d.ts +2 -0
- package/lib/field/index.js +9 -16
- package/lib/field/types.d.ts +1 -1
- package/lib/field/types.js +7 -12
- package/lib/field/utils.js +8 -13
- package/lib/form/Form.d.ts +13 -13
- package/lib/form/Form.js +14 -15
- package/lib/form/index.d.ts +9 -9
- package/lib/form/index.js +9 -16
- package/lib/form/types.d.ts +1 -0
- package/lib/form/types.js +7 -12
- package/lib/grid/Grid.js +8 -13
- package/lib/grid/index.js +9 -16
- package/lib/grid-item/GridItem.js +8 -13
- package/lib/grid-item/index.js +9 -16
- package/lib/icon/Icon.js +8 -13
- package/lib/icon/index.css +1 -1
- package/lib/icon/index.js +9 -16
- package/lib/image/Image.js +8 -13
- package/lib/image/index.js +9 -16
- package/lib/image-preview/ImagePreview.js +9 -16
- package/lib/image-preview/ImagePreviewItem.js +8 -13
- package/lib/image-preview/function-call.js +9 -16
- package/lib/image-preview/index.js +8 -13
- package/lib/image-preview/types.js +7 -12
- package/lib/index-anchor/IndexAnchor.js +8 -13
- package/lib/index-anchor/index.js +9 -16
- package/lib/index-bar/IndexBar.d.ts +5 -4
- package/lib/index-bar/IndexBar.js +33 -17
- package/lib/index-bar/index.d.ts +3 -3
- package/lib/index-bar/index.js +9 -16
- package/lib/index-bar/types.d.ts +2 -1
- package/lib/index-bar/types.js +7 -12
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +97 -101
- package/lib/index.less +2 -2
- package/lib/lazyload/index.js +8 -13
- package/lib/lazyload/vue-lazyload/index.js +9 -16
- package/lib/lazyload/vue-lazyload/lazy-component.js +8 -13
- package/lib/lazyload/vue-lazyload/lazy-container.js +8 -13
- package/lib/lazyload/vue-lazyload/lazy-image.js +8 -13
- package/lib/lazyload/vue-lazyload/lazy.js +9 -16
- package/lib/lazyload/vue-lazyload/listener.js +8 -13
- package/lib/lazyload/vue-lazyload/util.js +8 -13
- package/lib/list/List.js +8 -13
- package/lib/list/index.js +9 -16
- package/lib/list/types.js +7 -12
- package/lib/loading/Loading.js +11 -14
- package/lib/loading/index.js +9 -16
- package/lib/locale/index.js +9 -16
- package/lib/locale/lang/bn-BD.d.ts +0 -2
- package/lib/locale/lang/bn-BD.js +8 -15
- package/lib/locale/lang/da-DK.d.ts +64 -0
- package/lib/locale/lang/da-DK.js +85 -0
- package/lib/locale/lang/de-DE-formal.d.ts +0 -2
- package/lib/locale/lang/de-DE-formal.js +8 -15
- package/lib/locale/lang/de-DE.d.ts +0 -2
- package/lib/locale/lang/de-DE.js +8 -15
- package/lib/locale/lang/en-US.d.ts +0 -2
- package/lib/locale/lang/en-US.js +8 -15
- package/lib/locale/lang/es-ES.d.ts +0 -2
- package/lib/locale/lang/es-ES.js +8 -15
- package/lib/locale/lang/fr-FR.d.ts +0 -2
- package/lib/locale/lang/fr-FR.js +8 -15
- package/lib/locale/lang/hi-IN.d.ts +0 -2
- package/lib/locale/lang/hi-IN.js +8 -15
- package/lib/locale/lang/id-ID.d.ts +0 -2
- package/lib/locale/lang/id-ID.js +8 -15
- package/lib/locale/lang/is-IS.d.ts +62 -0
- package/lib/locale/lang/is-IS.js +91 -0
- package/lib/locale/lang/it-IT.d.ts +0 -2
- package/lib/locale/lang/it-IT.js +8 -15
- package/lib/locale/lang/ja-JP.d.ts +0 -2
- package/lib/locale/lang/ja-JP.js +8 -15
- package/lib/locale/lang/ko-KR.d.ts +0 -2
- package/lib/locale/lang/ko-KR.js +8 -15
- package/lib/locale/lang/la-LA.d.ts +62 -0
- package/lib/locale/lang/la-LA.js +83 -0
- package/lib/locale/lang/nb-NO.d.ts +0 -2
- package/lib/locale/lang/nb-NO.js +8 -15
- package/lib/locale/lang/pt-BR.d.ts +0 -2
- package/lib/locale/lang/pt-BR.js +8 -15
- package/lib/locale/lang/ro-RO.d.ts +0 -2
- package/lib/locale/lang/ro-RO.js +8 -15
- package/lib/locale/lang/ru-RU.d.ts +0 -2
- package/lib/locale/lang/ru-RU.js +8 -15
- package/lib/locale/lang/sv-SE.d.ts +62 -0
- package/lib/locale/lang/sv-SE.js +83 -0
- package/lib/locale/lang/th-TH.d.ts +0 -2
- package/lib/locale/lang/th-TH.js +8 -15
- package/lib/locale/lang/tr-TR.d.ts +0 -2
- package/lib/locale/lang/tr-TR.js +8 -15
- package/lib/locale/lang/uk-UA.d.ts +0 -2
- package/lib/locale/lang/uk-UA.js +8 -15
- package/lib/locale/lang/vi-VN.d.ts +0 -2
- package/lib/locale/lang/vi-VN.js +8 -15
- package/lib/locale/lang/zh-CN.d.ts +0 -2
- package/lib/locale/lang/zh-CN.js +8 -15
- package/lib/locale/lang/zh-HK.d.ts +0 -2
- package/lib/locale/lang/zh-HK.js +8 -15
- package/lib/locale/lang/zh-TW.d.ts +0 -2
- package/lib/locale/lang/zh-TW.js +8 -15
- package/lib/nav-bar/NavBar.d.ts +1 -1
- package/lib/nav-bar/NavBar.js +11 -16
- package/lib/nav-bar/index.d.ts +1 -1
- package/lib/nav-bar/index.js +9 -16
- package/lib/notice-bar/NoticeBar.js +8 -13
- package/lib/notice-bar/index.js +9 -16
- package/lib/notice-bar/types.js +7 -12
- package/lib/notify/Notify.js +8 -13
- package/lib/notify/function-call.js +9 -16
- package/lib/notify/index.js +8 -13
- package/lib/notify/types.d.ts +2 -1
- package/lib/notify/types.js +7 -12
- package/lib/number-keyboard/NumberKeyboard.js +19 -17
- package/lib/number-keyboard/NumberKeyboardKey.js +8 -13
- package/lib/number-keyboard/index.js +9 -16
- package/lib/overlay/Overlay.js +8 -13
- package/lib/overlay/index.js +9 -16
- package/lib/pagination/Pagination.js +8 -13
- package/lib/pagination/index.js +9 -16
- package/lib/password-input/PasswordInput.js +8 -13
- package/lib/password-input/index.js +9 -16
- package/lib/picker/Picker.d.ts +5 -4
- package/lib/picker/Picker.js +9 -16
- package/lib/picker/PickerColumn.js +8 -13
- package/lib/picker/index.css +1 -1
- package/lib/picker/index.d.ts +3 -3
- package/lib/picker/index.js +9 -16
- package/lib/picker/index.less +1 -0
- package/lib/picker/types.d.ts +4 -3
- package/lib/picker/types.js +7 -12
- package/lib/picker/utils.d.ts +4 -3
- package/lib/picker/utils.js +8 -13
- package/lib/popover/Popover.js +8 -13
- package/lib/popover/index.js +9 -16
- package/lib/popover/types.js +7 -12
- package/lib/popup/Popup.d.ts +4 -0
- package/lib/popup/Popup.js +11 -13
- package/lib/popup/index.css +1 -1
- package/lib/popup/index.d.ts +3 -0
- package/lib/popup/index.js +9 -16
- package/lib/popup/shared.js +8 -13
- package/lib/popup/types.js +7 -12
- package/lib/progress/Progress.d.ts +4 -3
- package/lib/progress/Progress.js +8 -13
- package/lib/progress/index.d.ts +2 -2
- package/lib/progress/index.js +9 -16
- package/lib/progress/types.js +7 -12
- package/lib/pull-refresh/PullRefresh.js +8 -13
- package/lib/pull-refresh/index.js +9 -16
- package/lib/radio/Radio.js +9 -16
- package/lib/radio/index.js +9 -16
- package/lib/radio-group/RadioGroup.js +8 -13
- package/lib/radio-group/index.js +9 -16
- package/lib/rate/Rate.js +39 -22
- package/lib/rate/index.js +9 -16
- package/lib/row/Row.js +8 -13
- package/lib/row/index.js +9 -16
- package/lib/search/Search.d.ts +3 -0
- package/lib/search/Search.js +8 -13
- package/lib/search/index.css +1 -1
- package/lib/search/index.d.ts +2 -0
- package/lib/search/index.js +9 -16
- package/lib/search/index.less +1 -1
- package/lib/search/types.js +7 -12
- package/lib/share-sheet/ShareSheet.js +33 -24
- package/lib/share-sheet/index.css +1 -1
- package/lib/share-sheet/index.js +9 -16
- package/lib/share-sheet/index.less +45 -1
- package/lib/sidebar/Sidebar.js +8 -13
- package/lib/sidebar/index.js +9 -16
- package/lib/sidebar-item/SidebarItem.js +8 -13
- package/lib/sidebar-item/index.js +9 -16
- package/lib/skeleton/Skeleton.d.ts +5 -4
- package/lib/skeleton/Skeleton.js +13 -16
- package/lib/skeleton/index.d.ts +3 -3
- package/lib/skeleton/index.js +9 -16
- package/lib/slider/Slider.js +8 -13
- package/lib/slider/index.css +1 -1
- package/lib/slider/index.js +9 -16
- package/lib/step/Step.js +8 -13
- package/lib/step/index.js +9 -16
- package/lib/stepper/Stepper.js +8 -13
- package/lib/stepper/index.js +9 -16
- package/lib/steps/Steps.js +8 -13
- package/lib/steps/index.js +9 -16
- package/lib/sticky/Sticky.js +8 -13
- package/lib/sticky/index.js +9 -16
- package/lib/style/animation.css +1 -1
- package/lib/style/base.css +1 -1
- package/lib/style/base.less +5 -0
- package/lib/submit-bar/SubmitBar.js +8 -13
- package/lib/submit-bar/index.js +9 -16
- package/lib/swipe/Swipe.js +8 -13
- package/lib/swipe/index.js +9 -16
- package/lib/swipe/types.js +7 -12
- package/lib/swipe-cell/SwipeCell.js +9 -14
- package/lib/swipe-cell/index.css +1 -1
- package/lib/swipe-cell/index.js +9 -16
- package/lib/swipe-cell/types.js +7 -12
- package/lib/swipe-item/SwipeItem.js +8 -13
- package/lib/swipe-item/index.js +9 -16
- package/lib/switch/Switch.js +8 -13
- package/lib/switch/index.js +9 -16
- package/lib/tab/Tab.js +8 -13
- package/lib/tab/index.js +9 -16
- package/lib/tabbar/Tabbar.d.ts +2 -2
- package/lib/tabbar/Tabbar.js +8 -13
- package/lib/tabbar/index.js +9 -16
- package/lib/tabbar-item/TabbarItem.js +8 -13
- package/lib/tabbar-item/index.js +9 -16
- package/lib/tabs/Tabs.d.ts +1 -1
- package/lib/tabs/Tabs.js +10 -16
- package/lib/tabs/TabsContent.js +8 -13
- package/lib/tabs/TabsTitle.js +8 -13
- package/lib/tabs/index.js +9 -16
- package/lib/tabs/types.d.ts +5 -4
- package/lib/tabs/types.js +7 -12
- package/lib/tabs/utils.js +8 -13
- package/lib/tag/Tag.js +8 -13
- package/lib/tag/index.js +9 -16
- package/lib/time-picker/TimePicker.js +8 -13
- package/lib/time-picker/index.js +9 -16
- package/lib/toast/Toast.js +9 -13
- package/lib/toast/function-call.js +9 -16
- package/lib/toast/index.js +8 -13
- package/lib/toast/lock-click.js +8 -13
- package/lib/toast/types.d.ts +3 -2
- package/lib/toast/types.js +7 -12
- package/lib/tree-select/TreeSelect.d.ts +7 -6
- package/lib/tree-select/TreeSelect.js +8 -13
- package/lib/tree-select/index.d.ts +3 -3
- package/lib/tree-select/index.js +9 -16
- package/lib/uploader/Uploader.d.ts +4 -4
- package/lib/uploader/Uploader.js +11 -18
- package/lib/uploader/UploaderPreviewItem.d.ts +3 -3
- package/lib/uploader/UploaderPreviewItem.js +17 -19
- package/lib/uploader/index.d.ts +2 -2
- package/lib/uploader/index.js +9 -16
- package/lib/uploader/types.d.ts +5 -5
- package/lib/uploader/types.js +7 -12
- package/lib/uploader/utils.d.ts +0 -1
- package/lib/uploader/utils.js +10 -17
- package/lib/utils/basic.d.ts +2 -0
- package/lib/utils/basic.js +11 -14
- package/lib/utils/constant.js +8 -13
- package/lib/utils/create.js +9 -16
- package/lib/utils/deep-assign.js +8 -13
- package/lib/utils/deep-clone.js +8 -13
- package/lib/utils/dom.js +8 -13
- package/lib/utils/format.d.ts +7 -6
- package/lib/utils/format.js +14 -13
- package/lib/utils/index.js +17 -21
- package/lib/utils/interceptor.js +8 -13
- package/lib/utils/mount-component.js +8 -13
- package/lib/utils/props.js +8 -13
- package/lib/utils/validate.d.ts +2 -1
- package/lib/utils/validate.js +8 -13
- package/lib/utils/with-install.js +8 -13
- package/lib/vant.cjs.js +538 -284
- package/lib/vant.cjs.min.js +1 -1
- package/lib/vant.es.js +538 -284
- package/lib/vant.es.min.js +538 -284
- package/lib/vant.js +538 -284
- package/lib/vant.min.js +1 -1
- package/package.json +4 -4
- package/vetur/attributes.json +388 -452
- package/vetur/tags.json +108 -106
- package/vetur/web-types.json +2027 -1172
- package/es/empty/Network.d.ts +0 -1
- package/es/empty/Network.js +0 -89
- package/lib/empty/Network.d.ts +0 -1
- package/lib/empty/Network.js +0 -113
package/es/empty/Empty.js
CHANGED
@@ -1,12 +1,17 @@
|
|
1
1
|
import { createVNode as _createVNode } from "vue";
|
2
2
|
import { defineComponent } from "vue";
|
3
|
-
import {
|
4
|
-
import {
|
3
|
+
import { getSizeStyle, makeStringProp, createNamespace } from "../utils";
|
4
|
+
import { renderError, renderSearch, renderNetwork, renderMaterial } from "./Images";
|
5
5
|
const [name, bem] = createNamespace("empty");
|
6
|
-
const PRESET_IMAGES =
|
6
|
+
const PRESET_IMAGES = {
|
7
|
+
error: renderError,
|
8
|
+
search: renderSearch,
|
9
|
+
network: renderNetwork,
|
10
|
+
default: renderMaterial
|
11
|
+
};
|
7
12
|
const emptyProps = {
|
8
13
|
image: makeStringProp("default"),
|
9
|
-
imageSize:
|
14
|
+
imageSize: [Number, String, Array],
|
10
15
|
description: String
|
11
16
|
};
|
12
17
|
var stdin_default = defineComponent({
|
@@ -16,20 +21,12 @@ var stdin_default = defineComponent({
|
|
16
21
|
slots
|
17
22
|
}) {
|
18
23
|
const renderImage = () => {
|
24
|
+
var _a;
|
19
25
|
if (slots.image) {
|
20
26
|
return slots.image();
|
21
27
|
}
|
22
|
-
|
23
|
-
image
|
24
|
-
} = props;
|
25
|
-
if (image === "network") {
|
26
|
-
return Network;
|
27
|
-
}
|
28
|
-
if (PRESET_IMAGES.includes(image)) {
|
29
|
-
image = `https://img.yzcdn.cn/vant/empty-image-${image}.png`;
|
30
|
-
}
|
31
|
-
return _createVNode("img", {
|
32
|
-
"src": image
|
28
|
+
return ((_a = PRESET_IMAGES[props.image]) == null ? void 0 : _a.call(PRESET_IMAGES)) || _createVNode("img", {
|
29
|
+
"src": props.image
|
33
30
|
}, null);
|
34
31
|
};
|
35
32
|
const renderDescription = () => {
|
@@ -0,0 +1,271 @@
|
|
1
|
+
import { createVNode as _createVNode } from "vue";
|
2
|
+
const getId = (num) => `van-empty-${num}`;
|
3
|
+
const useId = (num) => `url(#${getId(num)})`;
|
4
|
+
const renderStop = (color, offset, opacity) => _createVNode("stop", {
|
5
|
+
"stop-color": color,
|
6
|
+
"offset": `${offset}%`,
|
7
|
+
"stop-opacity": opacity
|
8
|
+
}, null);
|
9
|
+
const renderStops = (fromColor, toColor) => [renderStop(fromColor, 0), renderStop(toColor, 100)];
|
10
|
+
const renderShadow = (id) => [_createVNode("defs", null, [_createVNode("radialGradient", {
|
11
|
+
"id": getId(id),
|
12
|
+
"cx": "50%",
|
13
|
+
"cy": "54%",
|
14
|
+
"fx": "50%",
|
15
|
+
"fy": "54%",
|
16
|
+
"r": "297%",
|
17
|
+
"gradientTransform": "matrix(-.16 0 0 -.33 .58 .72)"
|
18
|
+
}, [renderStop("#EBEDF0", 0), renderStop("#F2F3F5", 100, 0.3)])]), _createVNode("ellipse", {
|
19
|
+
"fill": useId(id),
|
20
|
+
"opacity": ".8",
|
21
|
+
"cx": "80",
|
22
|
+
"cy": "140",
|
23
|
+
"rx": "46",
|
24
|
+
"ry": "8"
|
25
|
+
}, null)];
|
26
|
+
const renderBuilding = () => [_createVNode("defs", null, [_createVNode("linearGradient", {
|
27
|
+
"id": getId("a"),
|
28
|
+
"x1": "64%",
|
29
|
+
"y1": "100%",
|
30
|
+
"x2": "64%"
|
31
|
+
}, [renderStop("#FFF", 0, 0.5), renderStop("#F2F3F5", 100)])]), _createVNode("g", {
|
32
|
+
"opacity": ".8"
|
33
|
+
}, [_createVNode("path", {
|
34
|
+
"d": "M36 131V53H16v20H2v58h34z",
|
35
|
+
"fill": useId("a")
|
36
|
+
}, null), _createVNode("path", {
|
37
|
+
"d": "M123 15h22v14h9v77h-31V15z",
|
38
|
+
"fill": useId("a")
|
39
|
+
}, null)])];
|
40
|
+
const renderCloud = () => [_createVNode("defs", null, [_createVNode("linearGradient", {
|
41
|
+
"id": getId("b"),
|
42
|
+
"x1": "64%",
|
43
|
+
"y1": "97%",
|
44
|
+
"x2": "64%",
|
45
|
+
"y2": "0%"
|
46
|
+
}, [renderStop("#F2F3F5", 0, 0.3), renderStop("#F2F3F5", 100)])]), _createVNode("g", {
|
47
|
+
"opacity": ".8"
|
48
|
+
}, [_createVNode("path", {
|
49
|
+
"d": "M87 6c3 0 7 3 8 6a8 8 0 1 1-1 16H80a7 7 0 0 1-8-6c0-4 3-7 6-7 0-5 4-9 9-9Z",
|
50
|
+
"fill": useId("b")
|
51
|
+
}, null), _createVNode("path", {
|
52
|
+
"d": "M19 23c2 0 3 1 4 3 2 0 4 2 4 4a4 4 0 0 1-4 3v1h-7v-1l-1 1c-2 0-3-2-3-4 0-1 1-3 3-3 0-2 2-4 4-4Z",
|
53
|
+
"fill": useId("b")
|
54
|
+
}, null)])];
|
55
|
+
const renderNetwork = () => _createVNode("svg", {
|
56
|
+
"viewBox": "0 0 160 160"
|
57
|
+
}, [_createVNode("defs", null, [_createVNode("linearGradient", {
|
58
|
+
"id": getId(1),
|
59
|
+
"x1": "64%",
|
60
|
+
"y1": "100%",
|
61
|
+
"x2": "64%"
|
62
|
+
}, [renderStop("#FFF", 0, 0.5), renderStop("#F2F3F5", 100)]), _createVNode("linearGradient", {
|
63
|
+
"id": getId(2),
|
64
|
+
"x1": "50%",
|
65
|
+
"x2": "50%",
|
66
|
+
"y2": "84%"
|
67
|
+
}, [renderStop("#EBEDF0", 0), renderStop("#DCDEE0", 100, 0)]), _createVNode("linearGradient", {
|
68
|
+
"id": getId(3),
|
69
|
+
"x1": "100%",
|
70
|
+
"x2": "100%",
|
71
|
+
"y2": "100%"
|
72
|
+
}, [renderStops("#EAEDF0", "#DCDEE0")]), _createVNode("radialGradient", {
|
73
|
+
"id": getId(4),
|
74
|
+
"cx": "50%",
|
75
|
+
"cy": "0%",
|
76
|
+
"fx": "50%",
|
77
|
+
"fy": "0%",
|
78
|
+
"r": "100%",
|
79
|
+
"gradientTransform": "matrix(0 1 -.54 0 .5 -.5)"
|
80
|
+
}, [renderStop("#EBEDF0", 0), renderStop("#FFF", 100, 0)])]), _createVNode("g", {
|
81
|
+
"fill": "none"
|
82
|
+
}, [renderBuilding(), _createVNode("path", {
|
83
|
+
"fill": useId(4),
|
84
|
+
"d": "M0 139h160v21H0z"
|
85
|
+
}, null), _createVNode("path", {
|
86
|
+
"d": "M80 54a7 7 0 0 1 3 13v27l-2 2h-2a2 2 0 0 1-2-2V67a7 7 0 0 1 3-13z",
|
87
|
+
"fill": useId(2)
|
88
|
+
}, null), _createVNode("g", {
|
89
|
+
"opacity": ".6",
|
90
|
+
"stroke-linecap": "round",
|
91
|
+
"stroke-width": "7"
|
92
|
+
}, [_createVNode("path", {
|
93
|
+
"d": "M64 47a19 19 0 0 0-5 13c0 5 2 10 5 13",
|
94
|
+
"stroke": useId(3)
|
95
|
+
}, null), _createVNode("path", {
|
96
|
+
"d": "M53 36a34 34 0 0 0 0 48",
|
97
|
+
"stroke": useId(3)
|
98
|
+
}, null), _createVNode("path", {
|
99
|
+
"d": "M95 73a19 19 0 0 0 6-13c0-5-2-9-6-13",
|
100
|
+
"stroke": useId(3)
|
101
|
+
}, null), _createVNode("path", {
|
102
|
+
"d": "M106 84a34 34 0 0 0 0-48",
|
103
|
+
"stroke": useId(3)
|
104
|
+
}, null)]), _createVNode("g", {
|
105
|
+
"transform": "translate(31 105)"
|
106
|
+
}, [_createVNode("rect", {
|
107
|
+
"fill": "#EBEDF0",
|
108
|
+
"width": "98",
|
109
|
+
"height": "34",
|
110
|
+
"rx": "2"
|
111
|
+
}, null), _createVNode("rect", {
|
112
|
+
"fill": "#FFF",
|
113
|
+
"x": "9",
|
114
|
+
"y": "8",
|
115
|
+
"width": "80",
|
116
|
+
"height": "18",
|
117
|
+
"rx": "1.1"
|
118
|
+
}, null), _createVNode("rect", {
|
119
|
+
"fill": "#EBEDF0",
|
120
|
+
"x": "15",
|
121
|
+
"y": "12",
|
122
|
+
"width": "18",
|
123
|
+
"height": "6",
|
124
|
+
"rx": "1.1"
|
125
|
+
}, null)])])]);
|
126
|
+
const renderMaterial = () => _createVNode("svg", {
|
127
|
+
"viewBox": "0 0 160 160"
|
128
|
+
}, [_createVNode("defs", null, [_createVNode("linearGradient", {
|
129
|
+
"x1": "50%",
|
130
|
+
"x2": "50%",
|
131
|
+
"y2": "100%",
|
132
|
+
"id": getId(5)
|
133
|
+
}, [renderStops("#F2F3F5", "#DCDEE0")]), _createVNode("linearGradient", {
|
134
|
+
"x1": "95%",
|
135
|
+
"y1": "48%",
|
136
|
+
"x2": "5.5%",
|
137
|
+
"y2": "51%",
|
138
|
+
"id": getId(6)
|
139
|
+
}, [renderStops("#EAEDF1", "#DCDEE0")]), _createVNode("linearGradient", {
|
140
|
+
"y1": "45%",
|
141
|
+
"x2": "100%",
|
142
|
+
"y2": "54%",
|
143
|
+
"id": getId(7)
|
144
|
+
}, [renderStops("#EAEDF1", "#DCDEE0")])]), renderBuilding(), renderCloud(), _createVNode("g", {
|
145
|
+
"transform": "translate(36 50)",
|
146
|
+
"fill": "none"
|
147
|
+
}, [_createVNode("g", {
|
148
|
+
"transform": "translate(8)"
|
149
|
+
}, [_createVNode("rect", {
|
150
|
+
"fill": "#EBEDF0",
|
151
|
+
"opacity": ".6",
|
152
|
+
"x": "38",
|
153
|
+
"y": "13",
|
154
|
+
"width": "36",
|
155
|
+
"height": "53",
|
156
|
+
"rx": "2"
|
157
|
+
}, null), _createVNode("rect", {
|
158
|
+
"fill": useId(5),
|
159
|
+
"width": "64",
|
160
|
+
"height": "66",
|
161
|
+
"rx": "2"
|
162
|
+
}, null), _createVNode("rect", {
|
163
|
+
"fill": "#FFF",
|
164
|
+
"x": "6",
|
165
|
+
"y": "6",
|
166
|
+
"width": "52",
|
167
|
+
"height": "55",
|
168
|
+
"rx": "1"
|
169
|
+
}, null), _createVNode("g", {
|
170
|
+
"transform": "translate(15 17)",
|
171
|
+
"fill": useId(6)
|
172
|
+
}, [_createVNode("rect", {
|
173
|
+
"width": "34",
|
174
|
+
"height": "6",
|
175
|
+
"rx": "1"
|
176
|
+
}, null), _createVNode("path", {
|
177
|
+
"d": "M0 14h34v6H0z"
|
178
|
+
}, null), _createVNode("rect", {
|
179
|
+
"y": "28",
|
180
|
+
"width": "34",
|
181
|
+
"height": "6",
|
182
|
+
"rx": "1"
|
183
|
+
}, null)])]), _createVNode("rect", {
|
184
|
+
"fill": useId(7),
|
185
|
+
"y": "61",
|
186
|
+
"width": "88",
|
187
|
+
"height": "28",
|
188
|
+
"rx": "1"
|
189
|
+
}, null), _createVNode("rect", {
|
190
|
+
"fill": "#F7F8FA",
|
191
|
+
"x": "29",
|
192
|
+
"y": "72",
|
193
|
+
"width": "30",
|
194
|
+
"height": "6",
|
195
|
+
"rx": "1"
|
196
|
+
}, null)])]);
|
197
|
+
const renderError = () => _createVNode("svg", {
|
198
|
+
"viewBox": "0 0 160 160"
|
199
|
+
}, [_createVNode("defs", null, [_createVNode("linearGradient", {
|
200
|
+
"x1": "50%",
|
201
|
+
"x2": "50%",
|
202
|
+
"y2": "100%",
|
203
|
+
"id": getId(8)
|
204
|
+
}, [renderStops("#EAEDF1", "#DCDEE0")])]), renderBuilding(), renderCloud(), renderShadow("c"), _createVNode("path", {
|
205
|
+
"d": "m59 60 21 21 21-21h3l9 9v3L92 93l21 21v3l-9 9h-3l-21-21-21 21h-3l-9-9v-3l21-21-21-21v-3l9-9h3Z",
|
206
|
+
"fill": useId(8)
|
207
|
+
}, null)]);
|
208
|
+
const renderSearch = () => _createVNode("svg", {
|
209
|
+
"viewBox": "0 0 160 160"
|
210
|
+
}, [_createVNode("defs", null, [_createVNode("linearGradient", {
|
211
|
+
"x1": "50%",
|
212
|
+
"y1": "100%",
|
213
|
+
"x2": "50%",
|
214
|
+
"id": getId(9)
|
215
|
+
}, [renderStops("#EEE", "#D8D8D8")]), _createVNode("linearGradient", {
|
216
|
+
"x1": "100%",
|
217
|
+
"y1": "50%",
|
218
|
+
"y2": "50%",
|
219
|
+
"id": getId(10)
|
220
|
+
}, [renderStops("#F2F3F5", "#DCDEE0")]), _createVNode("linearGradient", {
|
221
|
+
"x1": "50%",
|
222
|
+
"x2": "50%",
|
223
|
+
"y2": "100%",
|
224
|
+
"id": getId(11)
|
225
|
+
}, [renderStops("#F2F3F5", "#DCDEE0")]), _createVNode("linearGradient", {
|
226
|
+
"x1": "50%",
|
227
|
+
"x2": "50%",
|
228
|
+
"y2": "100%",
|
229
|
+
"id": getId(12)
|
230
|
+
}, [renderStops("#FFF", "#F7F8FA")])]), renderBuilding(), renderCloud(), renderShadow("d"), _createVNode("g", {
|
231
|
+
"transform": "rotate(-45 113 -4)",
|
232
|
+
"fill": "none"
|
233
|
+
}, [_createVNode("rect", {
|
234
|
+
"fill": useId(9),
|
235
|
+
"x": "24",
|
236
|
+
"y": "52.8",
|
237
|
+
"width": "5.8",
|
238
|
+
"height": "19",
|
239
|
+
"rx": "1"
|
240
|
+
}, null), _createVNode("rect", {
|
241
|
+
"fill": useId(10),
|
242
|
+
"x": "22.1",
|
243
|
+
"y": "67.3",
|
244
|
+
"width": "9.9",
|
245
|
+
"height": "28",
|
246
|
+
"rx": "1"
|
247
|
+
}, null), _createVNode("circle", {
|
248
|
+
"stroke": useId(11),
|
249
|
+
"stroke-width": "8",
|
250
|
+
"cx": "27",
|
251
|
+
"cy": "27",
|
252
|
+
"r": "27"
|
253
|
+
}, null), _createVNode("circle", {
|
254
|
+
"fill": useId(12),
|
255
|
+
"cx": "27",
|
256
|
+
"cy": "27",
|
257
|
+
"r": "16"
|
258
|
+
}, null), _createVNode("path", {
|
259
|
+
"d": "M37 7c-8 0-15 5-16 12",
|
260
|
+
"stroke": useId(11),
|
261
|
+
"stroke-width": "3",
|
262
|
+
"opacity": ".5",
|
263
|
+
"stroke-linecap": "round",
|
264
|
+
"transform": "rotate(45 29 13)"
|
265
|
+
}, null)])]);
|
266
|
+
export {
|
267
|
+
renderError,
|
268
|
+
renderMaterial,
|
269
|
+
renderNetwork,
|
270
|
+
renderSearch
|
271
|
+
};
|
package/es/empty/index.d.ts
CHANGED
@@ -3,14 +3,14 @@ export declare const Empty: import("../utils").WithInstall<import("vue").DefineC
|
|
3
3
|
type: import("vue").PropType<string>;
|
4
4
|
default: string;
|
5
5
|
};
|
6
|
-
imageSize: (
|
6
|
+
imageSize: import("vue").PropType<import("../utils").Numeric | [import("../utils").Numeric, import("../utils").Numeric]>;
|
7
7
|
description: StringConstructor;
|
8
8
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
9
9
|
image: {
|
10
10
|
type: import("vue").PropType<string>;
|
11
11
|
default: string;
|
12
12
|
};
|
13
|
-
imageSize: (
|
13
|
+
imageSize: import("vue").PropType<import("../utils").Numeric | [import("../utils").Numeric, import("../utils").Numeric]>;
|
14
14
|
description: StringConstructor;
|
15
15
|
}>>, {
|
16
16
|
image: string;
|
package/es/field/Field.d.ts
CHANGED
@@ -21,6 +21,7 @@ export declare const fieldSharedProps: {
|
|
21
21
|
placeholder: StringConstructor;
|
22
22
|
autocomplete: StringConstructor;
|
23
23
|
errorMessage: StringConstructor;
|
24
|
+
enterkeyhint: StringConstructor;
|
24
25
|
clearTrigger: {
|
25
26
|
type: PropType<FieldClearTrigger>;
|
26
27
|
default: FieldClearTrigger;
|
@@ -86,6 +87,7 @@ declare const fieldProps: {
|
|
86
87
|
placeholder: StringConstructor;
|
87
88
|
autocomplete: StringConstructor;
|
88
89
|
errorMessage: StringConstructor;
|
90
|
+
enterkeyhint: StringConstructor;
|
89
91
|
clearTrigger: {
|
90
92
|
type: PropType<FieldClearTrigger>;
|
91
93
|
default: FieldClearTrigger;
|
@@ -169,6 +171,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
169
171
|
placeholder: StringConstructor;
|
170
172
|
autocomplete: StringConstructor;
|
171
173
|
errorMessage: StringConstructor;
|
174
|
+
enterkeyhint: StringConstructor;
|
172
175
|
clearTrigger: {
|
173
176
|
type: PropType<FieldClearTrigger>;
|
174
177
|
default: FieldClearTrigger;
|
@@ -250,6 +253,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
250
253
|
placeholder: StringConstructor;
|
251
254
|
autocomplete: StringConstructor;
|
252
255
|
errorMessage: StringConstructor;
|
256
|
+
enterkeyhint: StringConstructor;
|
253
257
|
clearTrigger: {
|
254
258
|
type: PropType<FieldClearTrigger>;
|
255
259
|
default: FieldClearTrigger;
|
package/es/field/Field.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { createTextVNode as _createTextVNode, mergeProps as _mergeProps, createVNode as _createVNode } from "vue";
|
2
2
|
import { ref, watch, provide, computed, nextTick, reactive, onMounted, defineComponent } from "vue";
|
3
|
-
import { isDef, extend, addUnit, FORM_KEY, numericProp, unknownProp, resetScroll, formatNumber, preventDefault, makeStringProp, makeNumericProp, createNamespace } from "../utils";
|
3
|
+
import { isDef, extend, addUnit, toArray, FORM_KEY, numericProp, unknownProp, resetScroll, formatNumber, preventDefault, makeStringProp, makeNumericProp, createNamespace } from "../utils";
|
4
4
|
import { cutString, runSyncRule, endComposing, mapInputType, startComposing, getRuleMessage, resizeTextarea, getStringLength, runRuleValidator } from "./utils";
|
5
5
|
import { cellSharedProps } from "../cell/Cell";
|
6
6
|
import { CUSTOM_FIELD_INJECTION_KEY, useParent } from "@vant/use";
|
@@ -24,6 +24,7 @@ const fieldSharedProps = {
|
|
24
24
|
placeholder: String,
|
25
25
|
autocomplete: String,
|
26
26
|
errorMessage: String,
|
27
|
+
enterkeyhint: String,
|
27
28
|
clearTrigger: makeStringProp("focus"),
|
28
29
|
formatTrigger: makeStringProp("onChange"),
|
29
30
|
error: {
|
@@ -152,10 +153,13 @@ var stdin_default = defineComponent({
|
|
152
153
|
});
|
153
154
|
const validateWithTrigger = (trigger) => {
|
154
155
|
if (form && props.rules) {
|
155
|
-
const
|
156
|
+
const {
|
157
|
+
validateTrigger
|
158
|
+
} = form.props;
|
159
|
+
const defaultTrigger = toArray(validateTrigger).includes(trigger);
|
156
160
|
const rules = props.rules.filter((rule) => {
|
157
161
|
if (rule.trigger) {
|
158
|
-
return rule.trigger
|
162
|
+
return toArray(rule.trigger).includes(trigger);
|
159
163
|
}
|
160
164
|
return defaultTrigger;
|
161
165
|
});
|
@@ -293,6 +297,7 @@ var stdin_default = defineComponent({
|
|
293
297
|
autofocus: props.autofocus,
|
294
298
|
placeholder: props.placeholder,
|
295
299
|
autocomplete: props.autocomplete,
|
300
|
+
enterkeyhint: props.enterkeyhint,
|
296
301
|
"aria-labelledby": props.label ? `${id}-label` : void 0,
|
297
302
|
onBlur,
|
298
303
|
onFocus,
|
package/es/field/index.d.ts
CHANGED
@@ -43,6 +43,7 @@ export declare const Field: import("../utils").WithInstall<import("vue").DefineC
|
|
43
43
|
placeholder: StringConstructor;
|
44
44
|
autocomplete: StringConstructor;
|
45
45
|
errorMessage: StringConstructor;
|
46
|
+
enterkeyhint: StringConstructor;
|
46
47
|
clearTrigger: {
|
47
48
|
type: import("vue").PropType<import("./types").FieldClearTrigger>;
|
48
49
|
default: import("./types").FieldClearTrigger;
|
@@ -124,6 +125,7 @@ export declare const Field: import("../utils").WithInstall<import("vue").DefineC
|
|
124
125
|
placeholder: StringConstructor;
|
125
126
|
autocomplete: StringConstructor;
|
126
127
|
errorMessage: StringConstructor;
|
128
|
+
enterkeyhint: StringConstructor;
|
127
129
|
clearTrigger: {
|
128
130
|
type: import("vue").PropType<import("./types").FieldClearTrigger>;
|
129
131
|
default: import("./types").FieldClearTrigger;
|
package/es/field/types.d.ts
CHANGED
@@ -18,7 +18,7 @@ export declare type FieldRuleValidator = (value: any, rule: FieldRule) => boolea
|
|
18
18
|
export declare type FiledRuleFormatter = (value: any, rule: FieldRule) => string;
|
19
19
|
export declare type FieldRule = {
|
20
20
|
pattern?: RegExp;
|
21
|
-
trigger?: FieldValidateTrigger;
|
21
|
+
trigger?: FieldValidateTrigger | FieldValidateTrigger[];
|
22
22
|
message?: FieldRuleMessage;
|
23
23
|
required?: boolean;
|
24
24
|
validator?: FieldRuleValidator;
|
package/es/form/Form.d.ts
CHANGED
@@ -14,15 +14,15 @@ declare const formProps: {
|
|
14
14
|
type: BooleanConstructor;
|
15
15
|
default: true;
|
16
16
|
};
|
17
|
-
validateTrigger: {
|
18
|
-
type: PropType<FieldValidateTrigger>;
|
19
|
-
default: FieldValidateTrigger;
|
20
|
-
};
|
21
17
|
showErrorMessage: {
|
22
18
|
type: BooleanConstructor;
|
23
19
|
default: true;
|
24
20
|
};
|
25
21
|
errorMessageAlign: PropType<FieldTextAlign>;
|
22
|
+
validateTrigger: {
|
23
|
+
type: PropType<FieldValidateTrigger | FieldValidateTrigger[]>;
|
24
|
+
default: string;
|
25
|
+
};
|
26
26
|
};
|
27
27
|
export declare type FormProps = ExtractPropTypes<typeof formProps>;
|
28
28
|
declare const _default: import("vue").DefineComponent<{
|
@@ -39,15 +39,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
39
39
|
type: BooleanConstructor;
|
40
40
|
default: true;
|
41
41
|
};
|
42
|
-
validateTrigger: {
|
43
|
-
type: PropType<FieldValidateTrigger>;
|
44
|
-
default: FieldValidateTrigger;
|
45
|
-
};
|
46
42
|
showErrorMessage: {
|
47
43
|
type: BooleanConstructor;
|
48
44
|
default: true;
|
49
45
|
};
|
50
46
|
errorMessageAlign: PropType<FieldTextAlign>;
|
47
|
+
validateTrigger: {
|
48
|
+
type: PropType<FieldValidateTrigger | FieldValidateTrigger[]>;
|
49
|
+
default: string;
|
50
|
+
};
|
51
51
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("submit" | "failed")[], "submit" | "failed", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
52
52
|
colon: BooleanConstructor;
|
53
53
|
disabled: BooleanConstructor;
|
@@ -62,15 +62,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
62
62
|
type: BooleanConstructor;
|
63
63
|
default: true;
|
64
64
|
};
|
65
|
-
validateTrigger: {
|
66
|
-
type: PropType<FieldValidateTrigger>;
|
67
|
-
default: FieldValidateTrigger;
|
68
|
-
};
|
69
65
|
showErrorMessage: {
|
70
66
|
type: BooleanConstructor;
|
71
67
|
default: true;
|
72
68
|
};
|
73
69
|
errorMessageAlign: PropType<FieldTextAlign>;
|
70
|
+
validateTrigger: {
|
71
|
+
type: PropType<FieldValidateTrigger | FieldValidateTrigger[]>;
|
72
|
+
default: string;
|
73
|
+
};
|
74
74
|
}>> & {
|
75
75
|
onSubmit?: ((...args: any[]) => any) | undefined;
|
76
76
|
onFailed?: ((...args: any[]) => any) | undefined;
|
@@ -82,7 +82,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
82
82
|
scrollToError: boolean;
|
83
83
|
validateFirst: boolean;
|
84
84
|
submitOnEnter: boolean;
|
85
|
-
validateTrigger: FieldValidateTrigger;
|
86
85
|
showErrorMessage: boolean;
|
86
|
+
validateTrigger: FieldValidateTrigger | FieldValidateTrigger[];
|
87
87
|
}>;
|
88
88
|
export default _default;
|
package/es/form/Form.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { createVNode as _createVNode } from "vue";
|
2
2
|
import { defineComponent } from "vue";
|
3
|
-
import { FORM_KEY, truthProp, numericProp, preventDefault,
|
3
|
+
import { FORM_KEY, truthProp, numericProp, preventDefault, createNamespace } from "../utils";
|
4
4
|
import { useChildren } from "@vant/use";
|
5
5
|
import { useExpose } from "../composables/use-expose";
|
6
6
|
const [name, bem] = createNamespace("form");
|
@@ -15,9 +15,12 @@ const formProps = {
|
|
15
15
|
scrollToError: Boolean,
|
16
16
|
validateFirst: Boolean,
|
17
17
|
submitOnEnter: truthProp,
|
18
|
-
validateTrigger: makeStringProp("onBlur"),
|
19
18
|
showErrorMessage: truthProp,
|
20
|
-
errorMessageAlign: String
|
19
|
+
errorMessageAlign: String,
|
20
|
+
validateTrigger: {
|
21
|
+
type: [String, Array],
|
22
|
+
default: "onBlur"
|
23
|
+
}
|
21
24
|
};
|
22
25
|
var stdin_default = defineComponent({
|
23
26
|
name,
|
@@ -132,6 +135,7 @@ var stdin_default = defineComponent({
|
|
132
135
|
useExpose({
|
133
136
|
submit,
|
134
137
|
validate,
|
138
|
+
getValues,
|
135
139
|
scrollToField,
|
136
140
|
resetValidation
|
137
141
|
});
|
package/es/form/index.d.ts
CHANGED
@@ -13,15 +13,15 @@ export declare const Form: import("../utils").WithInstall<import("vue").DefineCo
|
|
13
13
|
type: BooleanConstructor;
|
14
14
|
default: true;
|
15
15
|
};
|
16
|
-
validateTrigger: {
|
17
|
-
type: import("vue").PropType<import("..").FieldValidateTrigger>;
|
18
|
-
default: import("..").FieldValidateTrigger;
|
19
|
-
};
|
20
16
|
showErrorMessage: {
|
21
17
|
type: BooleanConstructor;
|
22
18
|
default: true;
|
23
19
|
};
|
24
20
|
errorMessageAlign: import("vue").PropType<import("..").FieldTextAlign>;
|
21
|
+
validateTrigger: {
|
22
|
+
type: import("vue").PropType<import("..").FieldValidateTrigger | import("..").FieldValidateTrigger[]>;
|
23
|
+
default: string;
|
24
|
+
};
|
25
25
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("submit" | "failed")[], "submit" | "failed", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
26
26
|
colon: BooleanConstructor;
|
27
27
|
disabled: BooleanConstructor;
|
@@ -36,15 +36,15 @@ export declare const Form: import("../utils").WithInstall<import("vue").DefineCo
|
|
36
36
|
type: BooleanConstructor;
|
37
37
|
default: true;
|
38
38
|
};
|
39
|
-
validateTrigger: {
|
40
|
-
type: import("vue").PropType<import("..").FieldValidateTrigger>;
|
41
|
-
default: import("..").FieldValidateTrigger;
|
42
|
-
};
|
43
39
|
showErrorMessage: {
|
44
40
|
type: BooleanConstructor;
|
45
41
|
default: true;
|
46
42
|
};
|
47
43
|
errorMessageAlign: import("vue").PropType<import("..").FieldTextAlign>;
|
44
|
+
validateTrigger: {
|
45
|
+
type: import("vue").PropType<import("..").FieldValidateTrigger | import("..").FieldValidateTrigger[]>;
|
46
|
+
default: string;
|
47
|
+
};
|
48
48
|
}>> & {
|
49
49
|
onSubmit?: ((...args: any[]) => any) | undefined;
|
50
50
|
onFailed?: ((...args: any[]) => any) | undefined;
|
@@ -56,8 +56,8 @@ export declare const Form: import("../utils").WithInstall<import("vue").DefineCo
|
|
56
56
|
scrollToError: boolean;
|
57
57
|
validateFirst: boolean;
|
58
58
|
submitOnEnter: boolean;
|
59
|
-
validateTrigger: import("..").FieldValidateTrigger;
|
60
59
|
showErrorMessage: boolean;
|
60
|
+
validateTrigger: import("..").FieldValidateTrigger | import("..").FieldValidateTrigger[];
|
61
61
|
}>>;
|
62
62
|
export default Form;
|
63
63
|
export type { FormProps };
|
package/es/form/types.d.ts
CHANGED
@@ -3,6 +3,7 @@ import type { FormProps } from './Form';
|
|
3
3
|
export declare type FormExpose = {
|
4
4
|
submit: () => void;
|
5
5
|
validate: (name?: string | string[] | undefined) => Promise<void>;
|
6
|
+
getValues: () => Record<string, unknown>;
|
6
7
|
scrollToField: (name: string, options?: boolean | ScrollIntoViewOptions | undefined) => void;
|
7
8
|
resetValidation: (name?: string | string[] | undefined) => void;
|
8
9
|
};
|