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
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
// Utils
|
|
2
2
|
import { bem } from './shared';
|
|
3
3
|
import { range } from '../utils/format/number';
|
|
4
|
-
import { preventDefault } from '../utils/dom/event';
|
|
4
|
+
import { preventDefault } from '../utils/dom/event';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// Mixins
|
|
7
|
+
import { TouchMixin } from '../mixins/touch';
|
|
7
8
|
|
|
9
|
+
// Component
|
|
8
10
|
import Image from '../image';
|
|
9
11
|
import Loading from '../loading';
|
|
10
12
|
import SwipeItem from '../swipe-item';
|
|
11
|
-
|
|
12
13
|
function getDistance(touches) {
|
|
13
14
|
return Math.sqrt(Math.pow(touches[0].clientX - touches[1].clientX, 2) + Math.pow(touches[0].clientY - touches[1].clientY, 2));
|
|
14
15
|
}
|
|
15
|
-
|
|
16
16
|
export default {
|
|
17
17
|
mixins: [TouchMixin],
|
|
18
18
|
props: {
|
|
@@ -39,7 +39,7 @@ export default {
|
|
|
39
39
|
computed: {
|
|
40
40
|
vertical: function vertical() {
|
|
41
41
|
var rootWidth = this.rootWidth,
|
|
42
|
-
|
|
42
|
+
rootHeight = this.rootHeight;
|
|
43
43
|
var rootRatio = rootHeight / rootWidth;
|
|
44
44
|
return this.imageRatio > rootRatio;
|
|
45
45
|
},
|
|
@@ -48,13 +48,11 @@ export default {
|
|
|
48
48
|
var style = {
|
|
49
49
|
transitionDuration: this.zooming || this.moving ? '0s' : '.3s'
|
|
50
50
|
};
|
|
51
|
-
|
|
52
51
|
if (scale !== 1) {
|
|
53
52
|
var offsetX = this.moveX / scale;
|
|
54
53
|
var offsetY = this.moveY / scale;
|
|
55
54
|
style.transform = "scale(" + scale + ", " + scale + ") translate(" + offsetX + "px, " + offsetY + "px)";
|
|
56
55
|
}
|
|
57
|
-
|
|
58
56
|
return style;
|
|
59
57
|
},
|
|
60
58
|
maxMoveX: function maxMoveX() {
|
|
@@ -62,7 +60,6 @@ export default {
|
|
|
62
60
|
var displayWidth = this.vertical ? this.rootHeight / this.imageRatio : this.rootWidth;
|
|
63
61
|
return Math.max(0, (this.scale * displayWidth - this.rootWidth) / 2);
|
|
64
62
|
}
|
|
65
|
-
|
|
66
63
|
return 0;
|
|
67
64
|
},
|
|
68
65
|
maxMoveY: function maxMoveY() {
|
|
@@ -70,7 +67,6 @@ export default {
|
|
|
70
67
|
var displayHeight = this.vertical ? this.rootHeight : this.rootWidth * this.imageRatio;
|
|
71
68
|
return Math.max(0, (this.scale * displayHeight - this.rootHeight) / 2);
|
|
72
69
|
}
|
|
73
|
-
|
|
74
70
|
return 0;
|
|
75
71
|
}
|
|
76
72
|
},
|
|
@@ -93,7 +89,6 @@ export default {
|
|
|
93
89
|
},
|
|
94
90
|
setScale: function setScale(scale) {
|
|
95
91
|
scale = range(scale, +this.minZoom, +this.maxZoom);
|
|
96
|
-
|
|
97
92
|
if (scale !== this.scale) {
|
|
98
93
|
this.scale = scale;
|
|
99
94
|
this.$emit('scale', {
|
|
@@ -111,14 +106,13 @@ export default {
|
|
|
111
106
|
onTouchStart: function onTouchStart(event) {
|
|
112
107
|
var touches = event.touches;
|
|
113
108
|
var _this$offsetX = this.offsetX,
|
|
114
|
-
|
|
109
|
+
offsetX = _this$offsetX === void 0 ? 0 : _this$offsetX;
|
|
115
110
|
this.touchStart(event);
|
|
116
111
|
this.touchStartTime = new Date();
|
|
117
112
|
this.startMoveX = this.moveX;
|
|
118
113
|
this.startMoveY = this.moveY;
|
|
119
114
|
this.moving = touches.length === 1 && this.scale !== 1;
|
|
120
115
|
this.zooming = touches.length === 2 && !offsetX;
|
|
121
|
-
|
|
122
116
|
if (this.zooming) {
|
|
123
117
|
this.startScale = this.scale;
|
|
124
118
|
this.startDistance = getDistance(event.touches);
|
|
@@ -127,18 +121,15 @@ export default {
|
|
|
127
121
|
onTouchMove: function onTouchMove(event) {
|
|
128
122
|
var touches = event.touches;
|
|
129
123
|
this.touchMove(event);
|
|
130
|
-
|
|
131
124
|
if (this.moving || this.zooming) {
|
|
132
125
|
preventDefault(event, true);
|
|
133
126
|
}
|
|
134
|
-
|
|
135
127
|
if (this.moving) {
|
|
136
128
|
var moveX = this.deltaX + this.startMoveX;
|
|
137
129
|
var moveY = this.deltaY + this.startMoveY;
|
|
138
130
|
this.moveX = range(moveX, -this.maxMoveX, this.maxMoveX);
|
|
139
131
|
this.moveY = range(moveY, -this.maxMoveY, this.maxMoveY);
|
|
140
132
|
}
|
|
141
|
-
|
|
142
133
|
if (this.zooming && touches.length === 2) {
|
|
143
134
|
var distance = getDistance(touches);
|
|
144
135
|
var scale = this.startScale * distance / this.startDistance;
|
|
@@ -147,49 +138,43 @@ export default {
|
|
|
147
138
|
},
|
|
148
139
|
onTouchEnd: function onTouchEnd(event) {
|
|
149
140
|
var stopPropagation = false;
|
|
150
|
-
/* istanbul ignore else */
|
|
151
141
|
|
|
142
|
+
/* istanbul ignore else */
|
|
152
143
|
if (this.moving || this.zooming) {
|
|
153
144
|
stopPropagation = true;
|
|
154
|
-
|
|
155
145
|
if (this.moving && this.startMoveX === this.moveX && this.startMoveY === this.moveY) {
|
|
156
146
|
stopPropagation = false;
|
|
157
147
|
}
|
|
158
|
-
|
|
159
148
|
if (!event.touches.length) {
|
|
160
149
|
if (this.zooming) {
|
|
161
150
|
this.moveX = range(this.moveX, -this.maxMoveX, this.maxMoveX);
|
|
162
151
|
this.moveY = range(this.moveY, -this.maxMoveY, this.maxMoveY);
|
|
163
152
|
this.zooming = false;
|
|
164
153
|
}
|
|
165
|
-
|
|
166
154
|
this.moving = false;
|
|
167
155
|
this.startMoveX = 0;
|
|
168
156
|
this.startMoveY = 0;
|
|
169
157
|
this.startScale = 1;
|
|
170
|
-
|
|
171
158
|
if (this.scale < 1) {
|
|
172
159
|
this.resetScale();
|
|
173
160
|
}
|
|
174
161
|
}
|
|
175
|
-
}
|
|
176
|
-
|
|
162
|
+
}
|
|
177
163
|
|
|
164
|
+
// eliminate tap delay on safari
|
|
178
165
|
preventDefault(event, stopPropagation);
|
|
179
166
|
this.checkTap();
|
|
180
167
|
this.resetTouchStatus();
|
|
181
168
|
},
|
|
182
169
|
checkTap: function checkTap() {
|
|
183
170
|
var _this = this;
|
|
184
|
-
|
|
185
171
|
var _this$offsetX2 = this.offsetX,
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
172
|
+
offsetX = _this$offsetX2 === void 0 ? 0 : _this$offsetX2,
|
|
173
|
+
_this$offsetY = this.offsetY,
|
|
174
|
+
offsetY = _this$offsetY === void 0 ? 0 : _this$offsetY;
|
|
189
175
|
var deltaTime = new Date() - this.touchStartTime;
|
|
190
176
|
var TAP_TIME = 250;
|
|
191
177
|
var TAP_OFFSET = 10;
|
|
192
|
-
|
|
193
178
|
if (offsetX < TAP_OFFSET && offsetY < TAP_OFFSET && deltaTime < TAP_TIME) {
|
|
194
179
|
if (this.doubleTapTimer) {
|
|
195
180
|
clearTimeout(this.doubleTapTimer);
|
|
@@ -198,7 +183,6 @@ export default {
|
|
|
198
183
|
} else {
|
|
199
184
|
this.doubleTapTimer = setTimeout(function () {
|
|
200
185
|
_this.$emit('close');
|
|
201
|
-
|
|
202
186
|
_this.doubleTapTimer = null;
|
|
203
187
|
}, TAP_TIME);
|
|
204
188
|
}
|
|
@@ -206,8 +190,8 @@ export default {
|
|
|
206
190
|
},
|
|
207
191
|
onLoad: function onLoad(event) {
|
|
208
192
|
var _event$target = event.target,
|
|
209
|
-
|
|
210
|
-
|
|
193
|
+
naturalWidth = _event$target.naturalWidth,
|
|
194
|
+
naturalHeight = _event$target.naturalHeight;
|
|
211
195
|
this.imageRatio = naturalHeight / naturalWidth;
|
|
212
196
|
}
|
|
213
197
|
},
|
|
@@ -24,7 +24,6 @@ var defaultConfig = {
|
|
|
24
24
|
closeOnPopstate: true,
|
|
25
25
|
closeIconPosition: 'top-right'
|
|
26
26
|
};
|
|
27
|
-
|
|
28
27
|
var initInstance = function initInstance() {
|
|
29
28
|
instance = new (Vue.extend(VueImagePreview))({
|
|
30
29
|
el: document.createElement('div')
|
|
@@ -41,47 +40,36 @@ var initInstance = function initInstance() {
|
|
|
41
40
|
}
|
|
42
41
|
});
|
|
43
42
|
};
|
|
44
|
-
|
|
45
43
|
var ImagePreview = function ImagePreview(images, startPosition) {
|
|
46
44
|
if (startPosition === void 0) {
|
|
47
45
|
startPosition = 0;
|
|
48
46
|
}
|
|
49
|
-
|
|
50
47
|
/* istanbul ignore if */
|
|
51
48
|
if (isServer) {
|
|
52
49
|
return;
|
|
53
50
|
}
|
|
54
|
-
|
|
55
51
|
if (!instance) {
|
|
56
52
|
initInstance();
|
|
57
53
|
}
|
|
58
|
-
|
|
59
54
|
var options = Array.isArray(images) ? {
|
|
60
55
|
images: images,
|
|
61
56
|
startPosition: startPosition
|
|
62
57
|
} : images;
|
|
63
|
-
|
|
64
58
|
_extends(instance, defaultConfig, options);
|
|
65
|
-
|
|
66
59
|
instance.$once('input', function (show) {
|
|
67
60
|
instance.value = show;
|
|
68
61
|
});
|
|
69
62
|
instance.$once('closed', function () {
|
|
70
63
|
instance.images = [];
|
|
71
64
|
});
|
|
72
|
-
|
|
73
65
|
if (options.onClose) {
|
|
74
66
|
instance.$off('close');
|
|
75
67
|
instance.$once('close', options.onClose);
|
|
76
68
|
}
|
|
77
|
-
|
|
78
69
|
return instance;
|
|
79
70
|
};
|
|
80
|
-
|
|
81
71
|
ImagePreview.Component = VueImagePreview;
|
|
82
|
-
|
|
83
72
|
ImagePreview.install = function () {
|
|
84
73
|
Vue.use(VueImagePreview);
|
|
85
74
|
};
|
|
86
|
-
|
|
87
75
|
export default ImagePreview;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { createNamespace } from '../utils';
|
|
2
|
-
|
|
3
2
|
var _createNamespace = createNamespace('image-preview'),
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
createComponent = _createNamespace[0],
|
|
4
|
+
bem = _createNamespace[1];
|
|
7
5
|
export { createComponent, bem };
|
package/es/index-anchor/index.js
CHANGED
|
@@ -2,11 +2,9 @@ import { createNamespace } from '../utils';
|
|
|
2
2
|
import { ChildrenMixin } from '../mixins/relation';
|
|
3
3
|
import { BORDER_BOTTOM, BORDER_TOP_BOTTOM, BORDER_UNSET_TOP_BOTTOM } from '../utils/constant';
|
|
4
4
|
import { getScrollTop, getRootScrollTop } from '../utils/dom/scroll';
|
|
5
|
-
|
|
6
5
|
var _createNamespace = createNamespace('index-anchor'),
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
createComponent = _createNamespace[0],
|
|
7
|
+
bem = _createNamespace[1];
|
|
10
8
|
export default createComponent({
|
|
11
9
|
mixins: [ChildrenMixin('ztIndexBar', {
|
|
12
10
|
indexKey: 'childrenIndex'
|
|
@@ -54,13 +52,11 @@ export default createComponent({
|
|
|
54
52
|
var el = this.$el;
|
|
55
53
|
var elRect = el.getBoundingClientRect();
|
|
56
54
|
this.rect.height = elRect.height;
|
|
57
|
-
|
|
58
55
|
if (scroller === window || scroller === document.body) {
|
|
59
56
|
this.rect.top = elRect.top + getRootScrollTop();
|
|
60
57
|
} else {
|
|
61
58
|
this.rect.top = elRect.top + getScrollTop(scroller) - scrollerRect.top;
|
|
62
59
|
}
|
|
63
|
-
|
|
64
60
|
return this.rect;
|
|
65
61
|
}
|
|
66
62
|
},
|
package/es/index-bar/index.js
CHANGED
|
@@ -3,33 +3,28 @@ import { createNamespace, isDef } from '../utils';
|
|
|
3
3
|
import { isHidden } from '../utils/dom/style';
|
|
4
4
|
import { preventDefault } from '../utils/dom/event';
|
|
5
5
|
import { getScroller, getScrollTop, getRootScrollTop, setRootScrollTop } from '../utils/dom/scroll';
|
|
6
|
-
import IndexIndicate from './IndexIndicate';
|
|
6
|
+
import IndexIndicate from './IndexIndicate';
|
|
7
7
|
|
|
8
|
+
// Mixins
|
|
8
9
|
import { TouchMixin } from '../mixins/touch';
|
|
9
10
|
import { ParentMixin } from '../mixins/relation';
|
|
10
11
|
import { BindEventMixin } from '../mixins/bind-event';
|
|
11
|
-
|
|
12
12
|
function genAlphabet() {
|
|
13
13
|
var indexList = [];
|
|
14
14
|
var charCodeOfA = 'A'.charCodeAt(0);
|
|
15
|
-
|
|
16
15
|
for (var i = 0; i < 26; i++) {
|
|
17
16
|
indexList.push(String.fromCharCode(charCodeOfA + i));
|
|
18
17
|
}
|
|
19
|
-
|
|
20
18
|
return indexList;
|
|
21
19
|
}
|
|
22
|
-
|
|
23
20
|
var _createNamespace = createNamespace('index-bar'),
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
createComponent = _createNamespace[0],
|
|
22
|
+
bem = _createNamespace[1];
|
|
27
23
|
export default createComponent({
|
|
28
24
|
mixins: [TouchMixin, ParentMixin('ztIndexBar'), BindEventMixin(function (bind) {
|
|
29
25
|
if (!this.scroller) {
|
|
30
26
|
this.scroller = getScroller(this.$el);
|
|
31
27
|
}
|
|
32
|
-
|
|
33
28
|
bind(this.scroller, 'scroll', this.onScroll);
|
|
34
29
|
})],
|
|
35
30
|
props: {
|
|
@@ -64,7 +59,6 @@ export default createComponent({
|
|
|
64
59
|
},
|
|
65
60
|
highlightStyle: function highlightStyle() {
|
|
66
61
|
var highlightColor = this.highlightColor;
|
|
67
|
-
|
|
68
62
|
if (highlightColor) {
|
|
69
63
|
return {
|
|
70
64
|
color: highlightColor
|
|
@@ -85,11 +79,9 @@ export default createComponent({
|
|
|
85
79
|
methods: {
|
|
86
80
|
onScroll: function onScroll() {
|
|
87
81
|
var _this = this;
|
|
88
|
-
|
|
89
82
|
if (isHidden(this.$el)) {
|
|
90
83
|
return;
|
|
91
84
|
}
|
|
92
|
-
|
|
93
85
|
var scrollTop = getScrollTop(this.scroller);
|
|
94
86
|
var scrollerRect = this.getScrollerRect();
|
|
95
87
|
var rects = this.children.map(function (item) {
|
|
@@ -97,11 +89,9 @@ export default createComponent({
|
|
|
97
89
|
});
|
|
98
90
|
var active = this.getActiveAnchorIndex(scrollTop, rects);
|
|
99
91
|
this.activeAnchorIndex = this.indexList[active];
|
|
100
|
-
|
|
101
92
|
if (this.touchAnchorIndex && this.touchAnchorIndex !== this.activeAnchorIndex) {
|
|
102
93
|
this.touchAnchorIndex = this.activeAnchorIndex;
|
|
103
94
|
}
|
|
104
|
-
|
|
105
95
|
if (this.sticky) {
|
|
106
96
|
this.children.forEach(function (item, index) {
|
|
107
97
|
if (index === active || index === active - 1) {
|
|
@@ -112,7 +102,6 @@ export default createComponent({
|
|
|
112
102
|
item.left = null;
|
|
113
103
|
item.width = null;
|
|
114
104
|
}
|
|
115
|
-
|
|
116
105
|
if (index === active) {
|
|
117
106
|
item.active = true;
|
|
118
107
|
item.top = Math.max(_this.stickyOffsetTop, rects[index].top - scrollTop) + scrollerRect.top;
|
|
@@ -130,7 +119,6 @@ export default createComponent({
|
|
|
130
119
|
if (this.scroller.getBoundingClientRect) {
|
|
131
120
|
return this.scroller.getBoundingClientRect();
|
|
132
121
|
}
|
|
133
|
-
|
|
134
122
|
return {
|
|
135
123
|
top: 0,
|
|
136
124
|
left: 0
|
|
@@ -140,12 +128,10 @@ export default createComponent({
|
|
|
140
128
|
for (var i = this.children.length - 1; i >= 0; i--) {
|
|
141
129
|
var prevHeight = i > 0 ? rects[i - 1].height : 0;
|
|
142
130
|
var reachTop = this.sticky ? prevHeight + this.stickyOffsetTop : 0;
|
|
143
|
-
|
|
144
131
|
if (scrollTop + reachTop >= rects[i].top) {
|
|
145
132
|
return i;
|
|
146
133
|
}
|
|
147
134
|
}
|
|
148
|
-
|
|
149
135
|
return -1;
|
|
150
136
|
},
|
|
151
137
|
onClick: function onClick(event) {
|
|
@@ -153,18 +139,16 @@ export default createComponent({
|
|
|
153
139
|
},
|
|
154
140
|
onTouchMove: function onTouchMove(event) {
|
|
155
141
|
this.touchMove(event);
|
|
156
|
-
|
|
157
142
|
if (this.direction === 'vertical') {
|
|
158
143
|
preventDefault(event);
|
|
159
144
|
var _event$touches$ = event.touches[0],
|
|
160
|
-
|
|
161
|
-
|
|
145
|
+
clientX = _event$touches$.clientX,
|
|
146
|
+
clientY = _event$touches$.clientY;
|
|
162
147
|
var target = document.elementFromPoint(clientX, clientY);
|
|
163
|
-
|
|
164
148
|
if (target) {
|
|
165
149
|
var index = target.dataset.index;
|
|
166
|
-
/* istanbul ignore else */
|
|
167
150
|
|
|
151
|
+
/* istanbul ignore else */
|
|
168
152
|
if (this.touchActiveIndex !== index) {
|
|
169
153
|
this.touchActiveIndex = index;
|
|
170
154
|
this.scrollToElement(target);
|
|
@@ -176,14 +160,11 @@ export default createComponent({
|
|
|
176
160
|
var match = this.children.filter(function (item) {
|
|
177
161
|
return String(item.index) === index;
|
|
178
162
|
});
|
|
179
|
-
|
|
180
163
|
if (match[0]) {
|
|
181
164
|
match[0].scrollIntoView();
|
|
182
|
-
|
|
183
165
|
if (this.sticky && this.stickyOffsetTop) {
|
|
184
166
|
setRootScrollTop(getRootScrollTop() - this.stickyOffsetTop);
|
|
185
167
|
}
|
|
186
|
-
|
|
187
168
|
this.$emit('select', match[0].index);
|
|
188
169
|
}
|
|
189
170
|
},
|
|
@@ -198,7 +179,6 @@ export default createComponent({
|
|
|
198
179
|
},
|
|
199
180
|
onTouchEnd: function onTouchEnd() {
|
|
200
181
|
var _this2 = this;
|
|
201
|
-
|
|
202
182
|
setTimeout(function () {
|
|
203
183
|
_this2.touchAnchorIndex = null;
|
|
204
184
|
}, 300);
|
|
@@ -213,7 +193,6 @@ export default createComponent({
|
|
|
213
193
|
},
|
|
214
194
|
render: function render() {
|
|
215
195
|
var _this3 = this;
|
|
216
|
-
|
|
217
196
|
var h = arguments[0];
|
|
218
197
|
var Indexes = this.indexList.map(function (index) {
|
|
219
198
|
var active = index === _this3.activeAnchorIndex;
|
package/es/index.js
CHANGED
|
@@ -75,8 +75,7 @@ import TextEllipsis from './text-ellipsis';
|
|
|
75
75
|
import Timeline from './timeline';
|
|
76
76
|
import Toast from './toast';
|
|
77
77
|
import Uploader from './uploader';
|
|
78
|
-
var version = '2.1.
|
|
79
|
-
|
|
78
|
+
var version = '2.1.8';
|
|
80
79
|
function install(Vue) {
|
|
81
80
|
var components = [ActionSheet, Area, Avatar, BackTop, Badge, Button, Calendar, Cascader, Cell, CellGroup, Checkbox, CheckboxGroup, Col, Collapse, CollapseItem, CountDown, DatetimePicker, Dialog, Divider, DropdownItem, DropdownMenu, Empty, Field, FoldDialog, Form, Grid, GridItem, HierarchySelect, Icon, Image, ImagePreview, IndexAnchor, IndexBar, Info, Lazyload, List, Loading, Locale, MediaPicker, MediaPlayer, MultiplePicker, NavBar, NoticeBar, NumberKeyboard, Overlay, PasswordInput, Picker, Popover, Popup, PullRefresh, Radio, RadioGroup, Rate, Row, Search, Signature, Skeleton, Slider, Step, Stepper, Steps, Sticky, Swipe, SwipeCell, SwipeItem, Switch, SwitchCell, Tab, Tabbar, TabbarItem, Table, Tabs, Tag, TextEllipsis, Timeline, Toast, Uploader];
|
|
82
81
|
components.forEach(function (item) {
|
|
@@ -87,11 +86,9 @@ function install(Vue) {
|
|
|
87
86
|
}
|
|
88
87
|
});
|
|
89
88
|
}
|
|
90
|
-
|
|
91
89
|
if (typeof window !== 'undefined' && window.Vue) {
|
|
92
90
|
install(window.Vue);
|
|
93
91
|
}
|
|
94
|
-
|
|
95
92
|
export { install, version, ActionSheet, Area, Avatar, BackTop, Badge, Button, Calendar, Cascader, Cell, CellGroup, Checkbox, CheckboxGroup, Col, Collapse, CollapseItem, CountDown, DatetimePicker, Dialog, Divider, DropdownItem, DropdownMenu, Empty, Field, FoldDialog, Form, Grid, GridItem, HierarchySelect, Icon, Image, ImagePreview, IndexAnchor, IndexBar, Info, Lazyload, List, Loading, Locale, MediaPicker, MediaPlayer, MultiplePicker, NavBar, NoticeBar, NumberKeyboard, Overlay, PasswordInput, Picker, Popover, Popup, PullRefresh, Radio, RadioGroup, Rate, Row, Search, Signature, Skeleton, Slider, Step, Stepper, Steps, Sticky, Swipe, SwipeCell, SwipeItem, Switch, SwitchCell, Tab, Tabbar, TabbarItem, Table, Tabs, Tag, TextEllipsis, Timeline, Toast, Uploader };
|
|
96
93
|
export default {
|
|
97
94
|
install: install,
|
package/es/info/index.js
CHANGED
|
@@ -1,28 +1,26 @@
|
|
|
1
1
|
import _mergeJSXProps from "@vue/babel-helper-vue-jsx-merge-props";
|
|
2
2
|
// Utils
|
|
3
3
|
import { createNamespace, isDef } from '../utils';
|
|
4
|
-
import { inherit } from '../utils/functional';
|
|
4
|
+
import { inherit } from '../utils/functional';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
createComponent = _createNamespace[0],
|
|
8
|
-
bem = _createNamespace[1];
|
|
6
|
+
// Types
|
|
9
7
|
|
|
8
|
+
var _createNamespace = createNamespace('info'),
|
|
9
|
+
createComponent = _createNamespace[0],
|
|
10
|
+
bem = _createNamespace[1];
|
|
10
11
|
function Info(h, props, slots, ctx) {
|
|
11
12
|
var dot = props.dot,
|
|
12
|
-
|
|
13
|
+
info = props.info;
|
|
13
14
|
var showInfo = isDef(info) && info !== '';
|
|
14
|
-
|
|
15
15
|
if (!dot && !showInfo) {
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
|
-
|
|
19
18
|
return h("div", _mergeJSXProps([{
|
|
20
19
|
"class": bem({
|
|
21
20
|
dot: dot
|
|
22
21
|
})
|
|
23
22
|
}, inherit(ctx, true)]), [dot ? '' : props.info]);
|
|
24
23
|
}
|
|
25
|
-
|
|
26
24
|
Info.props = {
|
|
27
25
|
dot: Boolean,
|
|
28
26
|
info: [Number, String]
|
package/es/list/index.js
CHANGED
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
// Utils
|
|
2
2
|
import { createNamespace } from '../utils';
|
|
3
3
|
import { isHidden } from '../utils/dom/style';
|
|
4
|
-
import { getScroller } from '../utils/dom/scroll';
|
|
4
|
+
import { getScroller } from '../utils/dom/scroll';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// Mixins
|
|
7
|
+
import { BindEventMixin } from '../mixins/bind-event';
|
|
7
8
|
|
|
9
|
+
// Components
|
|
8
10
|
import Loading from '../loading';
|
|
9
11
|
import Divider from '../divider';
|
|
10
|
-
|
|
11
12
|
var _createNamespace = createNamespace('list'),
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
createComponent = _createNamespace[0],
|
|
14
|
+
bem = _createNamespace[1],
|
|
15
|
+
t = _createNamespace[2];
|
|
16
16
|
export default createComponent({
|
|
17
17
|
mixins: [BindEventMixin(function (bind) {
|
|
18
18
|
if (!this.scroller) {
|
|
19
19
|
this.scroller = getScroller(this.$el);
|
|
20
20
|
}
|
|
21
|
-
|
|
22
21
|
bind(this.scroller, 'scroll', this.check);
|
|
23
22
|
})],
|
|
24
23
|
model: {
|
|
@@ -66,18 +65,15 @@ export default createComponent({
|
|
|
66
65
|
// @exposed-api
|
|
67
66
|
check: function check() {
|
|
68
67
|
var _this = this;
|
|
69
|
-
|
|
70
68
|
this.$nextTick(function () {
|
|
71
69
|
if (_this.innerLoading || _this.finished || _this.error) {
|
|
72
70
|
return;
|
|
73
71
|
}
|
|
74
|
-
|
|
75
72
|
var el = _this.$el,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
73
|
+
scroller = _this.scroller,
|
|
74
|
+
offset = _this.offset,
|
|
75
|
+
direction = _this.direction;
|
|
79
76
|
var scrollerRect;
|
|
80
|
-
|
|
81
77
|
if (scroller.getBoundingClientRect) {
|
|
82
78
|
scrollerRect = scroller.getBoundingClientRect();
|
|
83
79
|
} else {
|
|
@@ -86,29 +82,22 @@ export default createComponent({
|
|
|
86
82
|
bottom: scroller.innerHeight
|
|
87
83
|
};
|
|
88
84
|
}
|
|
89
|
-
|
|
90
85
|
var scrollerHeight = scrollerRect.bottom - scrollerRect.top;
|
|
91
|
-
/* istanbul ignore next */
|
|
92
86
|
|
|
87
|
+
/* istanbul ignore next */
|
|
93
88
|
if (!scrollerHeight || isHidden(el)) {
|
|
94
89
|
return false;
|
|
95
90
|
}
|
|
96
|
-
|
|
97
91
|
var isReachEdge = false;
|
|
98
|
-
|
|
99
92
|
var placeholderRect = _this.$refs.placeholder.getBoundingClientRect();
|
|
100
|
-
|
|
101
93
|
if (direction === 'up') {
|
|
102
94
|
isReachEdge = scrollerRect.top - placeholderRect.top <= offset;
|
|
103
95
|
} else {
|
|
104
96
|
isReachEdge = placeholderRect.bottom - scrollerRect.bottom <= offset;
|
|
105
97
|
}
|
|
106
|
-
|
|
107
98
|
if (isReachEdge) {
|
|
108
99
|
_this.innerLoading = true;
|
|
109
|
-
|
|
110
100
|
_this.$emit('input', true);
|
|
111
|
-
|
|
112
101
|
_this.$emit('load');
|
|
113
102
|
}
|
|
114
103
|
});
|
|
@@ -119,7 +108,6 @@ export default createComponent({
|
|
|
119
108
|
},
|
|
120
109
|
genLoading: function genLoading() {
|
|
121
110
|
var h = this.$createElement;
|
|
122
|
-
|
|
123
111
|
if (this.innerLoading && !this.finished) {
|
|
124
112
|
return h("div", {
|
|
125
113
|
"key": "loading",
|
|
@@ -133,10 +121,8 @@ export default createComponent({
|
|
|
133
121
|
},
|
|
134
122
|
genFinishedText: function genFinishedText() {
|
|
135
123
|
var h = this.$createElement;
|
|
136
|
-
|
|
137
124
|
if (this.finished) {
|
|
138
125
|
var text = this.slots('finished') || this.finishedText;
|
|
139
|
-
|
|
140
126
|
if (text) {
|
|
141
127
|
return h(Divider, {
|
|
142
128
|
"style": {
|
|
@@ -149,10 +135,8 @@ export default createComponent({
|
|
|
149
135
|
},
|
|
150
136
|
genErrorText: function genErrorText() {
|
|
151
137
|
var h = this.$createElement;
|
|
152
|
-
|
|
153
138
|
if (this.error) {
|
|
154
139
|
var text = this.slots('error') || this.errorText;
|
|
155
|
-
|
|
156
140
|
if (text) {
|
|
157
141
|
return h("div", {
|
|
158
142
|
"on": {
|
package/es/loading/index.js
CHANGED
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
import _mergeJSXProps from "@vue/babel-helper-vue-jsx-merge-props";
|
|
2
2
|
// Utils
|
|
3
3
|
import { createNamespace, addUnit } from '../utils';
|
|
4
|
-
import { inherit } from '../utils/functional';
|
|
4
|
+
import { inherit } from '../utils/functional';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
createComponent = _createNamespace[0],
|
|
8
|
-
bem = _createNamespace[1];
|
|
6
|
+
// Types
|
|
9
7
|
|
|
8
|
+
var _createNamespace = createNamespace('loading'),
|
|
9
|
+
createComponent = _createNamespace[0],
|
|
10
|
+
bem = _createNamespace[1];
|
|
10
11
|
var svgElementId = 0;
|
|
11
|
-
|
|
12
12
|
function LoadingIcon(h, props) {
|
|
13
13
|
if (props.type === 'spinner') {
|
|
14
14
|
var Spin = [];
|
|
15
|
-
|
|
16
15
|
for (var i = 0; i < 12; i++) {
|
|
17
16
|
Spin.push(h("i"));
|
|
18
17
|
}
|
|
19
|
-
|
|
20
18
|
return Spin;
|
|
21
19
|
} else if (props.type === 'circular') {
|
|
22
20
|
return h("svg", {
|
|
@@ -99,11 +97,9 @@ function LoadingIcon(h, props) {
|
|
|
99
97
|
})])]);
|
|
100
98
|
}
|
|
101
99
|
}
|
|
102
|
-
|
|
103
100
|
function LoadingText(h, props, slots) {
|
|
104
101
|
if (slots.default) {
|
|
105
102
|
var _props$textColor;
|
|
106
|
-
|
|
107
103
|
var style = {
|
|
108
104
|
fontSize: addUnit(props.textSize),
|
|
109
105
|
color: (_props$textColor = props.textColor) != null ? _props$textColor : props.color
|
|
@@ -114,21 +110,18 @@ function LoadingText(h, props, slots) {
|
|
|
114
110
|
}, [slots.default()]);
|
|
115
111
|
}
|
|
116
112
|
}
|
|
117
|
-
|
|
118
113
|
function Loading(h, props, slots, ctx) {
|
|
119
114
|
var color = props.color,
|
|
120
|
-
|
|
121
|
-
|
|
115
|
+
size = props.size,
|
|
116
|
+
type = props.type;
|
|
122
117
|
var style = {
|
|
123
118
|
color: color
|
|
124
119
|
};
|
|
125
|
-
|
|
126
120
|
if (size) {
|
|
127
121
|
var iconSize = addUnit(size);
|
|
128
122
|
style.width = iconSize;
|
|
129
123
|
style.height = iconSize;
|
|
130
124
|
}
|
|
131
|
-
|
|
132
125
|
return h("div", _mergeJSXProps([{
|
|
133
126
|
"class": bem([type, {
|
|
134
127
|
vertical: props.vertical,
|
|
@@ -139,7 +132,6 @@ function Loading(h, props, slots, ctx) {
|
|
|
139
132
|
"style": style
|
|
140
133
|
}, [LoadingIcon(h, props)]), LoadingText(h, props, slots)]);
|
|
141
134
|
}
|
|
142
|
-
|
|
143
135
|
Loading.props = {
|
|
144
136
|
color: String,
|
|
145
137
|
size: [Number, String],
|
package/es/locale/index.js
CHANGED
|
@@ -13,7 +13,6 @@ export default {
|
|
|
13
13
|
},
|
|
14
14
|
use: function use(lang, messages) {
|
|
15
15
|
var _this$add;
|
|
16
|
-
|
|
17
16
|
proto.$zartLang = lang;
|
|
18
17
|
this.add((_this$add = {}, _this$add[lang] = messages, _this$add));
|
|
19
18
|
},
|
|
@@ -21,7 +20,6 @@ export default {
|
|
|
21
20
|
if (messages === void 0) {
|
|
22
21
|
messages = {};
|
|
23
22
|
}
|
|
24
|
-
|
|
25
23
|
deepAssign(proto.$zartMessages, messages);
|
|
26
24
|
}
|
|
27
25
|
};
|