zartui 2.1.6 → 2.1.8
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.js +15 -26
- package/es/area/index.js +5 -41
- package/es/avatar/index.js +3 -16
- package/es/back-top/index.js +4 -19
- package/es/badge/index.js +4 -12
- package/es/button/index.js +20 -40
- package/es/calendar/components/Header.js +3 -12
- package/es/calendar/components/Month.js +12 -65
- package/es/calendar/index.js +23 -94
- package/es/calendar/types.js +9 -15
- package/es/calendar/utils.js +5 -16
- package/es/cascader/index.js +4 -37
- package/es/cell/index.js +19 -37
- package/es/cell-group/index.js +5 -8
- package/es/checkbox/index.js +4 -11
- package/es/checkbox-group/index.js +4 -9
- package/es/col/index.js +6 -11
- package/es/collapse/index.js +2 -5
- package/es/collapse-item/index.js +19 -35
- package/es/count-down/index.js +2 -15
- package/es/count-down/utils.js +3 -10
- package/es/datetime-picker/DatePicker.js +12 -70
- package/es/datetime-picker/TimePicker.js +10 -23
- package/es/datetime-picker/index.js +2 -26
- package/es/datetime-picker/shared.js +5 -21
- package/es/datetime-picker/utils.js +0 -5
- package/es/dialog/Dialog.js +6 -21
- package/es/dialog/index.js +0 -16
- package/es/divider/index.js +5 -6
- package/es/dropdown-item/index.js +13 -39
- package/es/dropdown-menu/index.js +4 -9
- package/es/empty/images/Developing.js +0 -3
- package/es/empty/images/EmptyInterface.js +0 -3
- package/es/empty/images/EmptyResult.js +0 -3
- package/es/empty/images/FindNull.js +0 -3
- package/es/empty/images/NetworkError.js +0 -3
- package/es/empty/images/NotFound.js +0 -3
- package/es/empty/images/ReportSuccess.js +0 -3
- package/es/empty/images/Restricted.js +0 -3
- package/es/empty/images/ServerError.js +0 -3
- package/es/empty/index.js +3 -11
- package/es/field/index.js +21 -86
- package/es/fold-dialog/index.js +5 -20
- package/es/form/index.js +2 -18
- package/es/grid/index.js +2 -6
- package/es/grid-item/index.js +18 -30
- package/es/hierarchy-select/breadcrumb.js +2 -6
- package/es/hierarchy-select/index.js +4 -14
- package/es/hierarchy-select/markList.js +5 -30
- package/es/hierarchy-select/svg/SubIcon.js +0 -1
- package/es/icon/index.js +9 -13
- package/es/image/index.js +3 -19
- package/es/image-preview/ImagePreview.js +4 -8
- package/es/image-preview/ImagePreviewItem.js +14 -30
- package/es/image-preview/index.js +0 -12
- package/es/image-preview/shared.js +2 -4
- package/es/index-anchor/index.js +2 -6
- package/es/index-bar/IndexIndicate.js +0 -1
- package/es/index-bar/index.js +7 -28
- package/es/index.js +1 -4
- package/es/info/index.js +6 -8
- package/es/list/index.js +11 -27
- package/es/loading/index.js +7 -15
- package/es/locale/index.js +0 -2
- package/es/media-picker/index.js +35 -128
- package/es/media-picker/media-util.js +2 -5
- package/es/media-picker/type.js +9 -14
- package/es/media-picker/wx-util.js +0 -1
- package/es/media-player/index.js +7 -19
- package/es/mixins/bind-event.js +0 -3
- package/es/mixins/checkbox.js +5 -11
- package/es/mixins/click-outside.js +0 -2
- package/es/mixins/close-on-popstate.js +0 -1
- package/es/mixins/field.js +0 -2
- package/es/mixins/popup/index.js +12 -28
- package/es/mixins/popup/overlay.js +1 -11
- package/es/mixins/portal.js +2 -8
- package/es/mixins/relation.js +0 -8
- package/es/mixins/slots.js +1 -4
- package/es/mixins/touch.js +4 -9
- package/es/multiple-picker/MultiplePickerOptions.js +3 -20
- package/es/multiple-picker/index.js +5 -17
- package/es/nav-bar/index.js +4 -12
- package/es/notice-bar/index.js +10 -28
- package/es/number-keyboard/Key.js +2 -10
- package/es/number-keyboard/index.js +4 -19
- package/es/overlay/index.js +5 -8
- package/es/password-input/index.js +10 -16
- package/es/picker/PickerColumn.js +21 -56
- package/es/picker/index.js +12 -45
- package/es/popover/index.js +65 -90
- package/es/popup/index.js +5 -21
- package/es/pull-refresh/index.js +10 -29
- package/es/radio/index.js +2 -4
- package/es/radio-group/index.js +2 -4
- package/es/rate/index.js +12 -26
- package/es/row/index.js +3 -9
- package/es/search/index.js +9 -15
- package/es/signature/bezier.js +13 -20
- package/es/signature/force-landscape.js +0 -5
- package/es/signature/index.js +5 -24
- package/es/signature/point.js +1 -6
- package/es/signature/throttle.js +1 -10
- package/es/skeleton/index.js +5 -15
- package/es/slider/index.js +19 -55
- package/es/step/index.js +5 -12
- package/es/stepper/index.js +11 -39
- package/es/steps/index.js +2 -4
- package/es/sticky/index.js +8 -50
- package/es/swipe/index.js +19 -62
- package/es/swipe-cell/index.js +7 -23
- package/es/swipe-item/index.js +10 -19
- package/es/switch/index.js +8 -10
- package/es/switch/shared.js +1 -0
- package/es/switch-cell/index.js +7 -7
- package/es/tab/index.js +4 -15
- package/es/tabbar/index.js +4 -14
- package/es/tabbar-item/index.js +7 -15
- package/es/table/index.js +5 -28
- package/es/table/type.js +3 -4
- package/es/tabs/Content.js +5 -9
- package/es/tabs/Title.js +11 -20
- package/es/tabs/index.js +16 -51
- package/es/tabs/utils.js +0 -8
- package/es/tag/index.js +13 -17
- package/es/text-ellipsis/index.js +25 -42
- package/es/timeline/index.js +2 -25
- package/es/toast/Toast.js +11 -23
- package/es/toast/index.js +6 -33
- package/es/toast/lock-click.js +0 -2
- package/es/uploader/index.js +11 -62
- package/es/uploader/utils.js +0 -10
- package/es/utils/constant.js +2 -1
- package/es/utils/create/bem.js +1 -5
- package/es/utils/create/component.js +4 -8
- package/es/utils/create/i18n.js +0 -2
- package/es/utils/deep-assign.js +0 -4
- package/es/utils/deep-clone.js +0 -3
- package/es/utils/dom/event.js +2 -5
- package/es/utils/dom/node.js +0 -1
- package/es/utils/dom/raf.js +7 -6
- package/es/utils/dom/reset-scroll.js +2 -1
- package/es/utils/dom/scroll.js +8 -17
- package/es/utils/dom/style.js +3 -2
- package/es/utils/easings.js +2 -4
- package/es/utils/format/date-util.js +54 -122
- package/es/utils/format/number.js +2 -11
- package/es/utils/format/string.js +0 -3
- package/es/utils/format/unit.js +2 -12
- package/es/utils/functional.js +6 -9
- package/es/utils/getScroll.js +0 -5
- package/es/utils/index.js +3 -5
- package/es/utils/interceptor.js +2 -4
- package/es/utils/media/image-util.js +7 -19
- package/es/utils/raf.js +4 -12
- package/es/utils/router.js +7 -6
- package/es/utils/scrollTo.js +10 -15
- package/es/utils/validate/number.js +2 -2
- package/es/utils/vnodes.js +2 -8
- package/lib/action-sheet/index.js +12 -37
- package/lib/area/index.js +7 -48
- package/lib/avatar/index.js +5 -21
- package/lib/back-top/index.js +6 -28
- package/lib/badge/index.js +6 -18
- package/lib/button/index.js +20 -52
- package/lib/calendar/FastForwardImg.js +2 -3
- package/lib/calendar/SlowForwardImg.js +2 -3
- package/lib/calendar/components/Header.js +5 -21
- package/lib/calendar/components/Month.js +14 -74
- package/lib/calendar/index.js +23 -109
- package/lib/calendar/types.js +11 -22
- package/lib/calendar/utils.js +18 -46
- package/lib/cascader/index.js +6 -49
- package/lib/cell/index.js +19 -50
- package/lib/cell/shared.js +2 -3
- package/lib/cell-group/index.js +6 -17
- package/lib/checkbox/index.js +6 -17
- package/lib/checkbox-group/index.js +6 -16
- package/lib/col/index.js +8 -17
- package/lib/collapse/index.js +4 -11
- package/lib/collapse-item/index.js +20 -46
- package/lib/count-down/index.js +4 -22
- package/lib/count-down/utils.js +5 -17
- package/lib/datetime-picker/DatePicker.js +14 -84
- package/lib/datetime-picker/TimePicker.js +12 -33
- package/lib/datetime-picker/index.js +7 -41
- package/lib/datetime-picker/shared.js +9 -35
- package/lib/datetime-picker/utils.js +2 -11
- package/lib/dialog/Dialog.js +8 -31
- package/lib/dialog/index.js +1 -24
- package/lib/divider/index.js +6 -14
- package/lib/dropdown-item/index.js +14 -52
- package/lib/dropdown-menu/index.js +6 -18
- package/lib/empty/context.js +2 -3
- package/lib/empty/images/Developing.js +2 -9
- package/lib/empty/images/EmptyInterface.js +2 -9
- package/lib/empty/images/EmptyResult.js +2 -9
- package/lib/empty/images/FindNull.js +2 -9
- package/lib/empty/images/NetworkError.js +2 -9
- package/lib/empty/images/NotFound.js +2 -9
- package/lib/empty/images/ReportSuccess.js +2 -9
- package/lib/empty/images/Restricted.js +2 -9
- package/lib/empty/images/ServerError.js +2 -9
- package/lib/empty/index.js +5 -26
- package/lib/field/ClearIcon.js +2 -3
- package/lib/field/SearchIcon.js +2 -3
- package/lib/field/index.js +22 -99
- package/lib/fold-dialog/index.js +7 -25
- package/lib/form/index.js +4 -24
- package/lib/grid/index.js +4 -13
- package/lib/grid-item/index.js +19 -40
- package/lib/hierarchy-select/breadcrumb.js +5 -13
- package/lib/hierarchy-select/index.js +7 -25
- package/lib/hierarchy-select/markList.js +8 -39
- package/lib/hierarchy-select/svg/SubIcon.js +2 -4
- package/lib/icon/index.js +9 -21
- package/lib/image/index.js +4 -25
- package/lib/image-preview/ImagePreview.js +2 -19
- package/lib/image-preview/ImagePreviewItem.js +15 -39
- package/lib/image-preview/index.js +1 -18
- package/lib/image-preview/shared.js +3 -8
- package/lib/index-anchor/index.js +4 -14
- package/lib/index-bar/IndexIndicate.js +2 -4
- package/lib/index-bar/index.js +9 -40
- package/lib/index.js +5 -164
- package/lib/info/index.js +7 -16
- package/lib/lazyload/index.js +1 -5
- package/lib/list/index.js +12 -36
- package/lib/loading/index.js +8 -23
- package/lib/locale/index.js +2 -10
- package/lib/locale/lang/de-DE-formal.js +2 -3
- package/lib/locale/lang/de-DE.js +2 -3
- package/lib/locale/lang/en-US.js +2 -3
- package/lib/locale/lang/es-ES.js +2 -3
- package/lib/locale/lang/fr-FR.js +2 -3
- package/lib/locale/lang/ja-JP.js +2 -3
- package/lib/locale/lang/nb-NO.js +2 -3
- package/lib/locale/lang/ro-RO.js +2 -3
- package/lib/locale/lang/th-TH.js +2 -3
- package/lib/locale/lang/tr-TR.js +2 -3
- package/lib/locale/lang/zh-CN.js +2 -3
- package/lib/locale/lang/zh-HK.js +2 -3
- package/lib/locale/lang/zh-TW.js +2 -3
- package/lib/media-picker/image/DefaultAudioIcon.js +2 -3
- package/lib/media-picker/image/DefaultDocIcon.js +2 -3
- package/lib/media-picker/image/DefaultExcelIcon.js +2 -3
- package/lib/media-picker/image/DefaultFileIcon.js +2 -3
- package/lib/media-picker/image/DefaultPdfIcon.js +2 -3
- package/lib/media-picker/image/DefaultPptIcon.js +2 -3
- package/lib/media-picker/image/DefaultTextIcon.js +2 -3
- package/lib/media-picker/image/DefaultVideoIcon.js +2 -3
- package/lib/media-picker/image/DeleteIcon.js +2 -3
- package/lib/media-picker/image/Img64.js +4 -7
- package/lib/media-picker/image/PickFileIcon.js +2 -3
- package/lib/media-picker/image/PickPhotoIcon.js +2 -3
- package/lib/media-picker/image/ReUpload.js +2 -3
- package/lib/media-picker/image/TakeAudioIcon.js +2 -3
- package/lib/media-picker/image/TakePhotoIcon.js +2 -3
- package/lib/media-picker/image/TakeVideoIcon.js +2 -3
- package/lib/media-picker/index.js +33 -172
- package/lib/media-picker/media-util.js +9 -22
- package/lib/media-picker/type.js +10 -18
- package/lib/media-picker/wx-util.js +4 -15
- package/lib/media-player/index.js +8 -27
- package/lib/mixins/bind-event.js +1 -6
- package/lib/mixins/checkbox.js +8 -21
- package/lib/mixins/click-outside.js +3 -8
- package/lib/mixins/close-on-popstate.js +2 -7
- package/lib/mixins/field.js +2 -5
- package/lib/mixins/popup/context.js +2 -3
- package/lib/mixins/popup/index.js +12 -38
- package/lib/mixins/popup/overlay.js +3 -25
- package/lib/mixins/portal.js +2 -9
- package/lib/mixins/relation.js +0 -11
- package/lib/mixins/slots.js +3 -8
- package/lib/mixins/touch.js +6 -14
- package/lib/multiple-picker/MultiplePickerOptions.js +4 -26
- package/lib/multiple-picker/index.js +7 -29
- package/lib/multiple-picker/shared.js +3 -5
- package/lib/nav-bar/index.js +6 -19
- package/lib/notice-bar/CloseIcon.js +2 -3
- package/lib/notice-bar/MenuIcon.js +2 -3
- package/lib/notice-bar/NoticeIcon.js +2 -3
- package/lib/notice-bar/OpenIcon.js +2 -3
- package/lib/notice-bar/TipIcon.js +2 -3
- package/lib/notice-bar/WarningIcon.js +2 -3
- package/lib/notice-bar/index.js +12 -43
- package/lib/number-keyboard/CollapseIcon.js +2 -3
- package/lib/number-keyboard/DeleteIcon.js +2 -3
- package/lib/number-keyboard/Key.js +4 -20
- package/lib/number-keyboard/index.js +6 -29
- package/lib/overlay/index.js +6 -18
- package/lib/password-input/index.js +11 -25
- package/lib/picker/PickerColumn.js +24 -71
- package/lib/picker/index.js +14 -59
- package/lib/picker/shared.js +3 -5
- package/lib/popover/index.js +65 -104
- package/lib/popup/index.js +7 -30
- package/lib/pull-refresh/index.js +11 -38
- package/lib/radio/index.js +4 -10
- package/lib/radio-group/index.js +4 -11
- package/lib/rate/index.js +13 -34
- package/lib/row/index.js +5 -15
- package/lib/search/index.js +8 -23
- package/lib/signature/bezier.js +14 -25
- package/lib/signature/force-landscape.js +5 -19
- package/lib/signature/index.js +8 -34
- package/lib/signature/point.js +2 -11
- package/lib/signature/throttle.js +1 -11
- package/lib/skeleton/index.js +6 -23
- package/lib/slider/index.js +21 -66
- package/lib/step/index.js +7 -21
- package/lib/stepper/index.js +12 -49
- package/lib/steps/index.js +4 -10
- package/lib/sticky/index.js +10 -62
- package/lib/swipe/index.js +21 -73
- package/lib/swipe-cell/index.js +9 -32
- package/lib/swipe-item/index.js +12 -27
- package/lib/switch/index.js +9 -17
- package/lib/switch/shared.js +3 -4
- package/lib/switch-cell/index.js +7 -18
- package/lib/tab/index.js +6 -24
- package/lib/tabbar/index.js +6 -22
- package/lib/tabbar-item/index.js +7 -24
- package/lib/table/index.js +7 -38
- package/lib/table/type.js +3 -5
- package/lib/tabs/Content.js +7 -18
- package/lib/tabs/Title.js +13 -27
- package/lib/tabs/index.js +17 -68
- package/lib/tabs/utils.js +0 -13
- package/lib/tag/index.js +13 -25
- package/lib/text-ellipsis/index.js +27 -49
- package/lib/timeline/index.js +4 -35
- package/lib/timeline/svg/current.js +2 -3
- package/lib/timeline/svg/pass.js +2 -3
- package/lib/toast/Toast.js +12 -33
- package/lib/toast/index.js +7 -40
- package/lib/toast/lock-click.js +0 -3
- package/lib/toast/svg/SuccessIcon.js +2 -3
- package/lib/toast/svg/WarnIcon.js +2 -3
- package/lib/uploader/index.js +12 -75
- package/lib/uploader/utils.js +4 -21
- package/lib/utils/constant.js +12 -21
- package/lib/utils/create/bem.js +1 -6
- package/lib/utils/create/component.js +6 -17
- package/lib/utils/create/i18n.js +0 -8
- package/lib/utils/create/index.js +0 -4
- package/lib/utils/deep-assign.js +0 -6
- package/lib/utils/deep-clone.js +0 -5
- package/lib/utils/device.js +1 -3
- package/lib/utils/dom/event.js +5 -14
- package/lib/utils/dom/node.js +0 -2
- package/lib/utils/dom/raf.js +9 -13
- package/lib/utils/dom/reset-scroll.js +2 -4
- package/lib/utils/dom/scroll.js +16 -37
- package/lib/utils/dom/style.js +3 -3
- package/lib/utils/easings.js +2 -5
- package/lib/utils/format/date-util.js +88 -203
- package/lib/utils/format/number.js +4 -15
- package/lib/utils/format/string.js +0 -5
- package/lib/utils/format/unit.js +2 -16
- package/lib/utils/functional.js +7 -15
- package/lib/utils/getScroll.js +1 -8
- package/lib/utils/index.js +10 -26
- package/lib/utils/interceptor.js +2 -6
- package/lib/utils/media/image-util.js +10 -28
- package/lib/utils/raf.js +4 -13
- package/lib/utils/router.js +10 -13
- package/lib/utils/scrollTo.js +12 -24
- package/lib/utils/validate/date.js +0 -2
- package/lib/utils/validate/email.js +0 -1
- package/lib/utils/validate/mobile.js +0 -1
- package/lib/utils/validate/number.js +3 -5
- package/lib/utils/validate/system.js +0 -3
- package/lib/utils/vnodes.js +2 -9
- package/lib/zart.js +2325 -4752
- package/lib/zart.min.js +7 -1
- package/package.json +1 -1
package/lib/popover/index.js
CHANGED
|
@@ -1,39 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
exports.__esModule = true;
|
|
6
5
|
exports.default = void 0;
|
|
7
|
-
|
|
8
6
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
|
-
|
|
10
7
|
var _babelHelperVueJsxMergeProps = _interopRequireDefault(require("@vue/babel-helper-vue-jsx-merge-props"));
|
|
11
|
-
|
|
12
8
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
13
|
-
|
|
14
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
15
|
-
|
|
16
10
|
var _popperjs = require("@vant/popperjs");
|
|
17
|
-
|
|
18
11
|
var _utils = require("../utils");
|
|
19
|
-
|
|
20
12
|
var _constant = require("../utils/constant");
|
|
21
|
-
|
|
22
13
|
var _clickOutside = require("../mixins/click-outside");
|
|
23
|
-
|
|
24
14
|
var _icon = _interopRequireDefault(require("../icon"));
|
|
25
|
-
|
|
26
15
|
var _popup = _interopRequireDefault(require("../popup"));
|
|
27
|
-
|
|
28
16
|
var _dom = require("@floating-ui/dom");
|
|
29
|
-
|
|
30
17
|
// Mixins
|
|
18
|
+
|
|
31
19
|
// Components
|
|
32
|
-
var _createNamespace = (0, _utils.createNamespace)('popover'),
|
|
33
|
-
createComponent = _createNamespace[0],
|
|
34
|
-
bem = _createNamespace[1];
|
|
35
20
|
|
|
36
|
-
var
|
|
21
|
+
var _createNamespace = (0, _utils.createNamespace)('popover'),
|
|
22
|
+
createComponent = _createNamespace[0],
|
|
23
|
+
bem = _createNamespace[1];
|
|
24
|
+
var _default2 = exports.default = createComponent({
|
|
37
25
|
mixins: [(0, _clickOutside.ClickOutsideMixin)({
|
|
38
26
|
event: 'touchstart',
|
|
39
27
|
method: 'onClickOutside'
|
|
@@ -83,13 +71,11 @@ var _default2 = createComponent({
|
|
|
83
71
|
value: {
|
|
84
72
|
handler: function handler(val) {
|
|
85
73
|
var _this = this;
|
|
86
|
-
|
|
87
74
|
if (val) {
|
|
88
75
|
this.$nextTick(function () {
|
|
89
76
|
_this.autoUpdatePopup();
|
|
90
77
|
});
|
|
91
78
|
}
|
|
92
|
-
|
|
93
79
|
this.updateLocation();
|
|
94
80
|
},
|
|
95
81
|
immediate: true
|
|
@@ -131,90 +117,74 @@ var _default2 = createComponent({
|
|
|
131
117
|
},
|
|
132
118
|
updatePopup: function updatePopup() {
|
|
133
119
|
var _this2 = this;
|
|
134
|
-
|
|
135
|
-
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
120
|
+
return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
136
121
|
var popoverEl, wrapperEl, _yield$computePositio, x, y, realPlacement, middlewareData, popupTop;
|
|
137
|
-
|
|
138
122
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
139
|
-
while (1) {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
123
|
+
while (1) switch (_context.prev = _context.next) {
|
|
124
|
+
case 0:
|
|
125
|
+
if (!(_this2.$refs.wrapper && _this2.$refs.popover.$el && _this2.$refs.arrow)) {
|
|
126
|
+
_context.next = 15;
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
popoverEl = _this2.$refs.popover.$el;
|
|
130
|
+
wrapperEl = _this2.$refs.wrapper;
|
|
131
|
+
_context.next = 5;
|
|
132
|
+
return (0, _dom.computePosition)(wrapperEl, popoverEl, {
|
|
133
|
+
placement: _this2.placement,
|
|
134
|
+
middleware: [(0, _dom.offset)(8), (0, _dom.shift)({
|
|
135
|
+
padding: 4,
|
|
136
|
+
crossAxis: false,
|
|
137
|
+
limiter: (0, _dom.limitShift)()
|
|
138
|
+
}), (0, _dom.flip)(), (0, _dom.hide)(), (0, _dom.arrow)({
|
|
139
|
+
element: _this2.$refs.arrow,
|
|
140
|
+
padding: 6
|
|
141
|
+
})]
|
|
142
|
+
});
|
|
143
|
+
case 5:
|
|
144
|
+
_yield$computePositio = _context.sent;
|
|
145
|
+
x = _yield$computePositio.x;
|
|
146
|
+
y = _yield$computePositio.y;
|
|
147
|
+
realPlacement = _yield$computePositio.placement;
|
|
148
|
+
middlewareData = _yield$computePositio.middlewareData;
|
|
149
|
+
popupTop = y; // 当被包裹元素超出屏幕时,对坐标进行特殊处理,先处理顶部超出,不然再处理底部超出
|
|
150
|
+
if (y < 0) {
|
|
151
|
+
popupTop = 0;
|
|
152
|
+
} else if (y > 0 && y + popoverEl.offsetHeight > document.body.clientHeight) {
|
|
153
|
+
popupTop = document.body.clientHeight - popoverEl.offsetHeight;
|
|
154
|
+
}
|
|
155
|
+
_this2.$refs.popover.$el.setAttribute('data-popper-placement', realPlacement);
|
|
156
|
+
// 这里手动指定popup placement位置,避免滚动时出现popup弹窗位置闪烁
|
|
157
|
+
_this2.popper.setOptions({
|
|
158
|
+
placement: realPlacement
|
|
159
|
+
});
|
|
160
|
+
_this2.$nextTick(function () {
|
|
161
|
+
var _middlewareData$arrow;
|
|
162
|
+
(0, _extends2.default)(_this2.$refs.popover.$el.style, {
|
|
163
|
+
left: x + "px",
|
|
164
|
+
top: popupTop + "px"
|
|
181
165
|
});
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
});
|
|
190
|
-
|
|
191
|
-
var _ref = (_middlewareData$arrow = middlewareData.arrow) != null ? _middlewareData$arrow : {},
|
|
192
|
-
arrowX = _ref.x,
|
|
193
|
-
arrowY = _ref.y;
|
|
194
|
-
|
|
195
|
-
(0, _extends2.default)(_this2.$refs.arrow.style, {
|
|
196
|
-
left: arrowX != null ? arrowX + "px" : '',
|
|
197
|
-
top: arrowY != null ? arrowY + "px" : '',
|
|
198
|
-
margin: 0
|
|
199
|
-
});
|
|
166
|
+
var _ref = (_middlewareData$arrow = middlewareData.arrow) != null ? _middlewareData$arrow : {},
|
|
167
|
+
arrowX = _ref.x,
|
|
168
|
+
arrowY = _ref.y;
|
|
169
|
+
(0, _extends2.default)(_this2.$refs.arrow.style, {
|
|
170
|
+
left: arrowX != null ? arrowX + "px" : '',
|
|
171
|
+
top: arrowY != null ? arrowY + "px" : '',
|
|
172
|
+
margin: 0
|
|
200
173
|
});
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
}
|
|
174
|
+
});
|
|
175
|
+
case 15:
|
|
176
|
+
case "end":
|
|
177
|
+
return _context.stop();
|
|
206
178
|
}
|
|
207
179
|
}, _callee);
|
|
208
180
|
}))();
|
|
209
181
|
},
|
|
210
182
|
updateLocation: function updateLocation() {
|
|
211
183
|
var _this3 = this;
|
|
212
|
-
|
|
213
184
|
this.$nextTick(function () {
|
|
214
185
|
if (!_this3.value) {
|
|
215
186
|
return;
|
|
216
187
|
}
|
|
217
|
-
|
|
218
188
|
if (!_this3.popper) {
|
|
219
189
|
_this3.popper = _this3.createPopper();
|
|
220
190
|
} else if (!_this3.autoAdjustOverflow) {
|
|
@@ -227,12 +197,11 @@ var _default2 = createComponent({
|
|
|
227
197
|
},
|
|
228
198
|
renderAction: function renderAction(action, index) {
|
|
229
199
|
var _this4 = this;
|
|
230
|
-
|
|
231
200
|
var h = this.$createElement;
|
|
232
201
|
var icon = action.icon,
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
202
|
+
text = action.text,
|
|
203
|
+
disabled = action.disabled,
|
|
204
|
+
className = action.className;
|
|
236
205
|
return h("div", {
|
|
237
206
|
"attrs": {
|
|
238
207
|
"role": "menuitem"
|
|
@@ -271,9 +240,7 @@ var _default2 = createComponent({
|
|
|
271
240
|
if (action.disabled) {
|
|
272
241
|
return;
|
|
273
242
|
}
|
|
274
|
-
|
|
275
243
|
this.$emit('select', action, index);
|
|
276
|
-
|
|
277
244
|
if (this.closeOnClickAction) {
|
|
278
245
|
this.$emit('input', false);
|
|
279
246
|
}
|
|
@@ -284,17 +251,13 @@ var _default2 = createComponent({
|
|
|
284
251
|
onOpen: function onOpen() {
|
|
285
252
|
this.$emit('open');
|
|
286
253
|
},
|
|
287
|
-
|
|
288
|
-
/* istanbul ignore next */
|
|
289
|
-
onOpened: function onOpened() {
|
|
254
|
+
/* istanbul ignore next */onOpened: function onOpened() {
|
|
290
255
|
this.$emit('opened');
|
|
291
256
|
},
|
|
292
257
|
onClose: function onClose() {
|
|
293
258
|
this.$emit('close');
|
|
294
259
|
},
|
|
295
|
-
|
|
296
|
-
/* istanbul ignore next */
|
|
297
|
-
onClosed: function onClosed() {
|
|
260
|
+
/* istanbul ignore next */onClosed: function onClosed() {
|
|
298
261
|
this.$emit('closed');
|
|
299
262
|
}
|
|
300
263
|
},
|
|
@@ -339,6 +302,4 @@ var _default2 = createComponent({
|
|
|
339
302
|
}
|
|
340
303
|
}, [this.slots('default') || this.actions.map(this.renderAction)])]), this.slots('reference')]);
|
|
341
304
|
}
|
|
342
|
-
});
|
|
343
|
-
|
|
344
|
-
exports.default = _default2;
|
|
305
|
+
});
|
package/lib/popup/index.js
CHANGED
|
@@ -1,23 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
exports.__esModule = true;
|
|
6
5
|
exports.default = void 0;
|
|
7
|
-
|
|
8
6
|
var _utils = require("../utils");
|
|
9
|
-
|
|
10
7
|
var _popup = require("../mixins/popup");
|
|
11
|
-
|
|
12
8
|
var _icon = _interopRequireDefault(require("../icon"));
|
|
13
|
-
|
|
14
9
|
var _unit = require("../utils/format/unit");
|
|
15
|
-
|
|
16
10
|
var _createNamespace = (0, _utils.createNamespace)('popup'),
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var _default = createComponent({
|
|
11
|
+
createComponent = _createNamespace[0],
|
|
12
|
+
bem = _createNamespace[1];
|
|
13
|
+
var _default = exports.default = createComponent({
|
|
21
14
|
mixins: [(0, _popup.PopupMixin)()],
|
|
22
15
|
props: {
|
|
23
16
|
round: Boolean,
|
|
@@ -69,21 +62,17 @@ var _default = createComponent({
|
|
|
69
62
|
},
|
|
70
63
|
beforeCreate: function beforeCreate() {
|
|
71
64
|
var _this = this;
|
|
72
|
-
|
|
73
65
|
var createEmitter = function createEmitter(eventName) {
|
|
74
66
|
return function (event) {
|
|
75
67
|
return _this.$emit(eventName, event);
|
|
76
68
|
};
|
|
77
69
|
};
|
|
78
|
-
|
|
79
70
|
this.onClick = createEmitter('click');
|
|
80
71
|
this.onOpened = createEmitter('opened');
|
|
81
|
-
|
|
82
72
|
this.onClosed = function () {
|
|
83
73
|
if (_this.sliderShow) {
|
|
84
74
|
_this.contentStyle = "height:" + _this.sliderContentHeight + "px";
|
|
85
75
|
}
|
|
86
|
-
|
|
87
76
|
createEmitter('closed')();
|
|
88
77
|
};
|
|
89
78
|
},
|
|
@@ -109,11 +98,9 @@ var _default = createComponent({
|
|
|
109
98
|
},
|
|
110
99
|
move: function move(event) {
|
|
111
100
|
var _this2 = this;
|
|
112
|
-
|
|
113
101
|
if (this.timerId) {
|
|
114
102
|
event.preventDefault();
|
|
115
103
|
}
|
|
116
|
-
|
|
117
104
|
var h = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
|
|
118
105
|
var touchAreaHeight = (0, _unit.unitToPx)(this.minDragHeight);
|
|
119
106
|
var positionY = event.touches[0].clientY;
|
|
@@ -121,7 +108,6 @@ var _default = createComponent({
|
|
|
121
108
|
if (positionY === 0 || positionY < h - (0, _unit.unitToPx)(_this2.maxDragHeight)) {
|
|
122
109
|
return;
|
|
123
110
|
}
|
|
124
|
-
|
|
125
111
|
_this2.touchHeight = positionY - touchAreaHeight > h - touchAreaHeight ? h - touchAreaHeight + _this2.touchPoint : positionY;
|
|
126
112
|
_this2.contentStyle = "height:" + (h - _this2.touchHeight - touchAreaHeight + _this2.touchPoint) + "px;";
|
|
127
113
|
}, 10);
|
|
@@ -134,22 +120,19 @@ var _default = createComponent({
|
|
|
134
120
|
if (this.timerId) {
|
|
135
121
|
clearInterval(this.timerId);
|
|
136
122
|
}
|
|
137
|
-
|
|
138
123
|
this.touchPoint = event.touches[0].clientY - this.$refs.popupRef.getBoundingClientRect().top;
|
|
139
124
|
},
|
|
140
125
|
allowSliderRender: function allowSliderRender() {
|
|
141
126
|
var h = this.$createElement;
|
|
142
127
|
var position = this.position,
|
|
143
|
-
|
|
128
|
+
duration = this.duration;
|
|
144
129
|
var isCenter = position === 'center';
|
|
145
130
|
var transitionName = this.transition || (isCenter ? 'zt2-fade' : "zt2-popup-slide-" + position);
|
|
146
131
|
var style = {};
|
|
147
|
-
|
|
148
132
|
if ((0, _utils.isDef)(duration)) {
|
|
149
133
|
var key = isCenter ? 'animationDuration' : 'transitionDuration';
|
|
150
134
|
style[key] = duration + "s";
|
|
151
135
|
}
|
|
152
|
-
|
|
153
136
|
return h("transition", {
|
|
154
137
|
"attrs": {
|
|
155
138
|
"appear": this.transitionAppear,
|
|
@@ -183,20 +166,17 @@ var _default = createComponent({
|
|
|
183
166
|
},
|
|
184
167
|
popupRender: function popupRender() {
|
|
185
168
|
var _bem;
|
|
186
|
-
|
|
187
169
|
var h = this.$createElement;
|
|
188
170
|
var round = this.round,
|
|
189
|
-
|
|
190
|
-
|
|
171
|
+
position = this.position,
|
|
172
|
+
duration = this.duration;
|
|
191
173
|
var isCenter = position === 'center';
|
|
192
174
|
var transitionName = this.transition || (isCenter ? 'zt2-fade' : "zt2-popup-slide-" + position);
|
|
193
175
|
var style = {};
|
|
194
|
-
|
|
195
176
|
if ((0, _utils.isDef)(duration)) {
|
|
196
177
|
var key = isCenter ? 'animationDuration' : 'transitionDuration';
|
|
197
178
|
style[key] = duration + "s";
|
|
198
179
|
}
|
|
199
|
-
|
|
200
180
|
return h("transition", {
|
|
201
181
|
"attrs": {
|
|
202
182
|
"appear": this.transitionAppear,
|
|
@@ -235,9 +215,6 @@ var _default = createComponent({
|
|
|
235
215
|
if (!this.shouldRender) {
|
|
236
216
|
return;
|
|
237
217
|
}
|
|
238
|
-
|
|
239
218
|
return this.sliderShow ? this.allowSliderRender() : this.popupRender();
|
|
240
219
|
}
|
|
241
|
-
});
|
|
242
|
-
|
|
243
|
-
exports.default = _default;
|
|
220
|
+
});
|
|
@@ -1,32 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
exports.__esModule = true;
|
|
6
5
|
exports.default = void 0;
|
|
7
|
-
|
|
8
6
|
var _utils = require("../utils");
|
|
9
|
-
|
|
10
7
|
var _event = require("../utils/dom/event");
|
|
11
|
-
|
|
12
8
|
var _scroll = require("../utils/dom/scroll");
|
|
13
|
-
|
|
14
9
|
var _touch = require("../mixins/touch");
|
|
15
|
-
|
|
16
10
|
var _loading = _interopRequireDefault(require("../loading"));
|
|
17
|
-
|
|
18
11
|
// Utils
|
|
12
|
+
|
|
19
13
|
// Mixins
|
|
14
|
+
|
|
20
15
|
// Components
|
|
21
|
-
var _createNamespace = (0, _utils.createNamespace)('pull-refresh'),
|
|
22
|
-
createComponent = _createNamespace[0],
|
|
23
|
-
bem = _createNamespace[1],
|
|
24
|
-
t = _createNamespace[2];
|
|
25
16
|
|
|
17
|
+
var _createNamespace = (0, _utils.createNamespace)('pull-refresh'),
|
|
18
|
+
createComponent = _createNamespace[0],
|
|
19
|
+
bem = _createNamespace[1],
|
|
20
|
+
t = _createNamespace[2];
|
|
26
21
|
var DEFAULT_HEAD_HEIGHT = 50;
|
|
27
22
|
var TEXT_STATUS = ['pulling', 'loosing', 'success'];
|
|
28
|
-
|
|
29
|
-
var _default = createComponent({
|
|
23
|
+
var _default = exports.default = createComponent({
|
|
30
24
|
mixins: [_touch.TouchMixin],
|
|
31
25
|
props: {
|
|
32
26
|
disabled: Boolean,
|
|
@@ -86,21 +80,18 @@ var _default = createComponent({
|
|
|
86
80
|
scrollEl: function scrollEl() {
|
|
87
81
|
if (this.scrollElement) {
|
|
88
82
|
var targetDom = (0, _scroll.getTargetDom)(this.scrollElement);
|
|
89
|
-
|
|
90
83
|
if (targetDom) {
|
|
91
84
|
return targetDom;
|
|
92
85
|
} else {
|
|
93
86
|
console.warn('请检查props scroll-element元素是否存在!');
|
|
94
87
|
}
|
|
95
88
|
}
|
|
96
|
-
|
|
97
89
|
return (0, _scroll.getScroller)(this.$el);
|
|
98
90
|
}
|
|
99
91
|
},
|
|
100
92
|
watch: {
|
|
101
93
|
value: function value(loading) {
|
|
102
94
|
this.duration = this.animationDuration;
|
|
103
|
-
|
|
104
95
|
if (loading) {
|
|
105
96
|
this.setStatus(+this.headHeight, true);
|
|
106
97
|
} else if (this.slots('success') || this.successText) {
|
|
@@ -116,7 +107,6 @@ var _default = createComponent({
|
|
|
116
107
|
methods: {
|
|
117
108
|
checkPullStart: function checkPullStart(event) {
|
|
118
109
|
this.ceiling = (0, _scroll.getScrollTop)(this.scrollEl) === 0;
|
|
119
|
-
|
|
120
110
|
if (this.ceiling) {
|
|
121
111
|
this.duration = 0;
|
|
122
112
|
this.touchStart(event);
|
|
@@ -131,13 +121,10 @@ var _default = createComponent({
|
|
|
131
121
|
if (!this.touchable) {
|
|
132
122
|
return;
|
|
133
123
|
}
|
|
134
|
-
|
|
135
124
|
if (!this.ceiling) {
|
|
136
125
|
this.checkPullStart(event);
|
|
137
126
|
}
|
|
138
|
-
|
|
139
127
|
this.touchMove(event);
|
|
140
|
-
|
|
141
128
|
if (this.ceiling && this.deltaY >= 0 && this.direction === 'vertical') {
|
|
142
129
|
(0, _event.preventDefault)(event);
|
|
143
130
|
this.setStatus(this.ease(this.deltaY));
|
|
@@ -145,14 +132,13 @@ var _default = createComponent({
|
|
|
145
132
|
},
|
|
146
133
|
onTouchEnd: function onTouchEnd() {
|
|
147
134
|
var _this = this;
|
|
148
|
-
|
|
149
135
|
if (this.touchable && this.ceiling && this.deltaY) {
|
|
150
136
|
this.duration = this.animationDuration;
|
|
151
|
-
|
|
152
137
|
if (this.status === 'loosing') {
|
|
153
138
|
this.setStatus(+this.headHeight, true);
|
|
154
|
-
this.$emit('input', true);
|
|
139
|
+
this.$emit('input', true);
|
|
155
140
|
|
|
141
|
+
// ensure value change can be watched
|
|
156
142
|
this.$nextTick(function () {
|
|
157
143
|
_this.$emit('refresh');
|
|
158
144
|
});
|
|
@@ -163,7 +149,6 @@ var _default = createComponent({
|
|
|
163
149
|
},
|
|
164
150
|
ease: function ease(distance) {
|
|
165
151
|
var pullDistance = +(this.pullDistance || this.headHeight);
|
|
166
|
-
|
|
167
152
|
if (distance > pullDistance) {
|
|
168
153
|
if (distance < pullDistance * 2) {
|
|
169
154
|
distance = pullDistance + (distance - pullDistance) / 2;
|
|
@@ -171,12 +156,10 @@ var _default = createComponent({
|
|
|
171
156
|
distance = pullDistance * 1.5 + (distance - pullDistance * 2) / 4;
|
|
172
157
|
}
|
|
173
158
|
}
|
|
174
|
-
|
|
175
159
|
return Math.round(distance);
|
|
176
160
|
},
|
|
177
161
|
setStatus: function setStatus(distance, isLoading) {
|
|
178
162
|
var status;
|
|
179
|
-
|
|
180
163
|
if (isLoading) {
|
|
181
164
|
status = 'loading';
|
|
182
165
|
} else if (distance === 0) {
|
|
@@ -184,9 +167,7 @@ var _default = createComponent({
|
|
|
184
167
|
} else {
|
|
185
168
|
status = distance < (this.pullDistance || this.headHeight) ? 'pulling' : 'loosing';
|
|
186
169
|
}
|
|
187
|
-
|
|
188
170
|
this.distance = distance;
|
|
189
|
-
|
|
190
171
|
if (status !== this.status) {
|
|
191
172
|
this.status = status;
|
|
192
173
|
}
|
|
@@ -194,24 +175,20 @@ var _default = createComponent({
|
|
|
194
175
|
genStatus: function genStatus() {
|
|
195
176
|
var h = this.$createElement;
|
|
196
177
|
var status = this.status,
|
|
197
|
-
|
|
178
|
+
distance = this.distance;
|
|
198
179
|
var slot = this.slots(status, {
|
|
199
180
|
distance: distance
|
|
200
181
|
});
|
|
201
|
-
|
|
202
182
|
if (slot) {
|
|
203
183
|
return slot;
|
|
204
184
|
}
|
|
205
|
-
|
|
206
185
|
var nodes = [];
|
|
207
186
|
var text = this[status + "Text"] || t(status);
|
|
208
|
-
|
|
209
187
|
if (TEXT_STATUS.indexOf(status) !== -1) {
|
|
210
188
|
nodes.push(h("div", {
|
|
211
189
|
"class": bem('text')
|
|
212
190
|
}, [text]));
|
|
213
191
|
}
|
|
214
|
-
|
|
215
192
|
if (status === 'loading') {
|
|
216
193
|
nodes.push(h(_loading.default, {
|
|
217
194
|
"attrs": {
|
|
@@ -219,12 +196,10 @@ var _default = createComponent({
|
|
|
219
196
|
}
|
|
220
197
|
}, [text]));
|
|
221
198
|
}
|
|
222
|
-
|
|
223
199
|
return nodes;
|
|
224
200
|
},
|
|
225
201
|
showSuccessTip: function showSuccessTip() {
|
|
226
202
|
var _this2 = this;
|
|
227
|
-
|
|
228
203
|
this.status = 'success';
|
|
229
204
|
setTimeout(function () {
|
|
230
205
|
_this2.setStatus(0);
|
|
@@ -248,6 +223,4 @@ var _default = createComponent({
|
|
|
248
223
|
"style": this.headStyle
|
|
249
224
|
}, [this.genStatus()]), this.slots()])]);
|
|
250
225
|
}
|
|
251
|
-
});
|
|
252
|
-
|
|
253
|
-
exports.default = _default;
|
|
226
|
+
});
|
package/lib/radio/index.js
CHANGED
|
@@ -2,16 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.default = void 0;
|
|
5
|
-
|
|
6
5
|
var _utils = require("../utils");
|
|
7
|
-
|
|
8
6
|
var _checkbox = require("../mixins/checkbox");
|
|
9
|
-
|
|
10
7
|
var _createNamespace = (0, _utils.createNamespace)('radio'),
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var _default = createComponent({
|
|
8
|
+
createComponent = _createNamespace[0],
|
|
9
|
+
bem = _createNamespace[1];
|
|
10
|
+
var _default = exports.default = createComponent({
|
|
15
11
|
mixins: [(0, _checkbox.CheckboxMixin)({
|
|
16
12
|
bem: bem,
|
|
17
13
|
role: 'radio',
|
|
@@ -35,6 +31,4 @@ var _default = createComponent({
|
|
|
35
31
|
this.currentValue = this.name;
|
|
36
32
|
}
|
|
37
33
|
}
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
exports.default = _default;
|
|
34
|
+
});
|
package/lib/radio-group/index.js
CHANGED
|
@@ -2,18 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.default = void 0;
|
|
5
|
-
|
|
6
5
|
var _utils = require("../utils");
|
|
7
|
-
|
|
8
6
|
var _field = require("../mixins/field");
|
|
9
|
-
|
|
10
7
|
var _relation = require("../mixins/relation");
|
|
11
|
-
|
|
12
8
|
var _createNamespace = (0, _utils.createNamespace)('radio-group'),
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var _default = createComponent({
|
|
9
|
+
createComponent = _createNamespace[0],
|
|
10
|
+
bem = _createNamespace[1];
|
|
11
|
+
var _default = exports.default = createComponent({
|
|
17
12
|
mixins: [(0, _relation.ParentMixin)('ztRadio'), _field.FieldMixin],
|
|
18
13
|
props: {
|
|
19
14
|
value: null,
|
|
@@ -37,6 +32,4 @@ var _default = createComponent({
|
|
|
37
32
|
}
|
|
38
33
|
}, [this.slots()]);
|
|
39
34
|
}
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
exports.default = _default;
|
|
35
|
+
});
|