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/es/media-player/index.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { createNamespace } from '../utils';
|
|
2
|
-
import { MediaType } from "../media-picker/type";
|
|
3
|
-
|
|
2
|
+
import { MediaType } from "../media-picker/type";
|
|
3
|
+
// import Toast from '../toast';
|
|
4
4
|
import Popup from '../popup';
|
|
5
5
|
import Button from '../button';
|
|
6
6
|
import { isIOS, isWeixin } from "../utils/device";
|
|
7
|
-
|
|
8
7
|
var _createNamespace = createNamespace('media-player'),
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
createComponent = _createNamespace[0],
|
|
9
|
+
bem = _createNamespace[1];
|
|
12
10
|
export default createComponent({
|
|
13
11
|
props: {
|
|
14
12
|
value: {
|
|
@@ -44,7 +42,6 @@ export default createComponent({
|
|
|
44
42
|
methods: {
|
|
45
43
|
getMediaElement: function getMediaElement() {
|
|
46
44
|
var player;
|
|
47
|
-
|
|
48
45
|
if (this.mediaType === MediaType.AUDIO) {
|
|
49
46
|
// player = document.getElementById("audio")
|
|
50
47
|
player = this.$refs.audio;
|
|
@@ -52,25 +49,22 @@ export default createComponent({
|
|
|
52
49
|
// player = document.getElementById("video")
|
|
53
50
|
player = this.$refs.video;
|
|
54
51
|
}
|
|
55
|
-
|
|
56
52
|
return player;
|
|
57
53
|
},
|
|
58
54
|
onOpen: function onOpen() {
|
|
59
55
|
var _this = this;
|
|
60
|
-
|
|
61
56
|
this.$nextTick(function () {
|
|
62
57
|
var player = _this.getMediaElement();
|
|
63
|
-
|
|
64
58
|
if (!player) {
|
|
65
59
|
return;
|
|
66
|
-
}
|
|
60
|
+
}
|
|
61
|
+
// player.addEventListener('error', (event) => {
|
|
67
62
|
// console.log(event)
|
|
68
63
|
// Toast.fail('播放失败')
|
|
69
64
|
// this.onClose()
|
|
70
65
|
// }, true)
|
|
71
|
-
//iOS中无法自动播放,必须有点击事件触发。但是微信中有办法实现
|
|
72
|
-
|
|
73
66
|
|
|
67
|
+
//iOS中无法自动播放,必须有点击事件触发。但是微信中有办法实现
|
|
74
68
|
if (isWeixin()) {
|
|
75
69
|
if (typeof WeixinJSBridge == "object" && typeof WeixinJSBridge.invoke == "function") {
|
|
76
70
|
WeixinJSBridge.invoke('getNetworkType', {}, function (res) {
|
|
@@ -85,21 +79,17 @@ export default createComponent({
|
|
|
85
79
|
onClose: function onClose() {
|
|
86
80
|
this.$emit('input', false);
|
|
87
81
|
var player = this.getMediaElement();
|
|
88
|
-
|
|
89
82
|
if (!player) {
|
|
90
83
|
return;
|
|
91
84
|
}
|
|
92
|
-
|
|
93
85
|
player.pause();
|
|
94
86
|
player.currentTime = 0;
|
|
95
|
-
|
|
96
87
|
if (this.mediaUrl && !this.mediaUrl.startsWith('http')) {
|
|
97
88
|
(URL || webkitURL).revokeObjectURL(this.mediaUrl);
|
|
98
89
|
}
|
|
99
90
|
},
|
|
100
91
|
renderTag: function renderTag() {
|
|
101
92
|
var h = this.$createElement;
|
|
102
|
-
|
|
103
93
|
if (this.mediaUrl) {
|
|
104
94
|
if (this.mediaType === MediaType.VIDEO) {
|
|
105
95
|
return h("video", {
|
|
@@ -133,7 +123,6 @@ export default createComponent({
|
|
|
133
123
|
},
|
|
134
124
|
render: function render(h) {
|
|
135
125
|
var _this2 = this;
|
|
136
|
-
|
|
137
126
|
return h(Popup, {
|
|
138
127
|
"class": bem(),
|
|
139
128
|
"attrs": {
|
|
@@ -157,7 +146,6 @@ export default createComponent({
|
|
|
157
146
|
"on": {
|
|
158
147
|
"click": function click(event) {
|
|
159
148
|
event.stopPropagation();
|
|
160
|
-
|
|
161
149
|
_this2.onClose();
|
|
162
150
|
}
|
|
163
151
|
}
|
package/es/mixins/bind-event.js
CHANGED
|
@@ -5,21 +5,18 @@ import { on, off } from '../utils/dom/event';
|
|
|
5
5
|
var uid = 0;
|
|
6
6
|
export function BindEventMixin(handler) {
|
|
7
7
|
var key = "binded_" + uid++;
|
|
8
|
-
|
|
9
8
|
function bind() {
|
|
10
9
|
if (!this[key]) {
|
|
11
10
|
handler.call(this, on, true);
|
|
12
11
|
this[key] = true;
|
|
13
12
|
}
|
|
14
13
|
}
|
|
15
|
-
|
|
16
14
|
function unbind() {
|
|
17
15
|
if (this[key]) {
|
|
18
16
|
handler.call(this, off, false);
|
|
19
17
|
this[key] = false;
|
|
20
18
|
}
|
|
21
19
|
}
|
|
22
|
-
|
|
23
20
|
return {
|
|
24
21
|
mounted: bind,
|
|
25
22
|
activated: bind,
|
package/es/mixins/checkbox.js
CHANGED
|
@@ -7,8 +7,8 @@ import { ChildrenMixin } from './relation';
|
|
|
7
7
|
import { addUnit } from '../utils';
|
|
8
8
|
export var CheckboxMixin = function CheckboxMixin(_ref) {
|
|
9
9
|
var parent = _ref.parent,
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
bem = _ref.bem,
|
|
11
|
+
role = _ref.role;
|
|
12
12
|
return {
|
|
13
13
|
mixins: [ChildrenMixin(parent), FieldMixin],
|
|
14
14
|
props: {
|
|
@@ -46,7 +46,6 @@ export var CheckboxMixin = function CheckboxMixin(_ref) {
|
|
|
46
46
|
var boxShadow = this.boxShadow || this.parent && this.parent.boxShadow;
|
|
47
47
|
var border = this.border || this.parent && this.parent.border;
|
|
48
48
|
var iconColor = this.iconColor || this.parent && this.parent.iconColor;
|
|
49
|
-
|
|
50
49
|
if ((boxShadow || checkedColor) && this.checked && !this.isDisabled) {
|
|
51
50
|
return {
|
|
52
51
|
color: iconColor,
|
|
@@ -60,22 +59,20 @@ export var CheckboxMixin = function CheckboxMixin(_ref) {
|
|
|
60
59
|
if (this.isDisabled || role === 'radio' && !this.checked) {
|
|
61
60
|
return -1;
|
|
62
61
|
}
|
|
63
|
-
|
|
64
62
|
return 0;
|
|
65
63
|
}
|
|
66
64
|
},
|
|
67
65
|
methods: {
|
|
68
66
|
onClick: function onClick(event) {
|
|
69
67
|
var _this = this;
|
|
70
|
-
|
|
71
68
|
var target = event.target;
|
|
72
69
|
var icon = this.$refs.icon;
|
|
73
70
|
var iconClicked = icon === target || icon.contains(target);
|
|
74
|
-
|
|
75
71
|
if (!this.isDisabled && (iconClicked || !this.labelDisabled)) {
|
|
76
|
-
this.toggle();
|
|
77
|
-
// so we can get the changed value in the click event listener
|
|
72
|
+
this.toggle();
|
|
78
73
|
|
|
74
|
+
// wait for toggle method to complete
|
|
75
|
+
// so we can get the changed value in the click event listener
|
|
79
76
|
setTimeout(function () {
|
|
80
77
|
_this.$emit('click', event);
|
|
81
78
|
});
|
|
@@ -112,7 +109,6 @@ export var CheckboxMixin = function CheckboxMixin(_ref) {
|
|
|
112
109
|
genLabel: function genLabel() {
|
|
113
110
|
var h = this.$createElement;
|
|
114
111
|
var slot = this.slots();
|
|
115
|
-
|
|
116
112
|
if (slot) {
|
|
117
113
|
return h("span", {
|
|
118
114
|
"class": bem('label', [this.labelPosition, {
|
|
@@ -125,13 +121,11 @@ export var CheckboxMixin = function CheckboxMixin(_ref) {
|
|
|
125
121
|
render: function render() {
|
|
126
122
|
var h = arguments[0];
|
|
127
123
|
var Children = [this.genIcon()];
|
|
128
|
-
|
|
129
124
|
if (this.labelPosition === 'left') {
|
|
130
125
|
Children.unshift(this.genLabel());
|
|
131
126
|
} else {
|
|
132
127
|
Children.push(this.genLabel());
|
|
133
128
|
}
|
|
134
|
-
|
|
135
129
|
var checked = this.checked;
|
|
136
130
|
return h("div", {
|
|
137
131
|
"attrs": {
|
|
@@ -12,13 +12,11 @@ export var ClickOutsideMixin = function ClickOutsideMixin(config) {
|
|
|
12
12
|
},
|
|
13
13
|
data: function data() {
|
|
14
14
|
var _this = this;
|
|
15
|
-
|
|
16
15
|
var clickOutsideHandler = function clickOutsideHandler(event) {
|
|
17
16
|
if (_this.closeOnClickOutside && !_this.$el.contains(event.target)) {
|
|
18
17
|
_this[config.method]();
|
|
19
18
|
}
|
|
20
19
|
};
|
|
21
|
-
|
|
22
20
|
return {
|
|
23
21
|
clickOutsideHandler: clickOutsideHandler
|
|
24
22
|
};
|
package/es/mixins/field.js
CHANGED
|
@@ -7,7 +7,6 @@ export var FieldMixin = {
|
|
|
7
7
|
watch: {
|
|
8
8
|
value: function value() {
|
|
9
9
|
var field = this.ztField;
|
|
10
|
-
|
|
11
10
|
if (field) {
|
|
12
11
|
field.resetValidation();
|
|
13
12
|
field.validateWithTrigger('onChange');
|
|
@@ -16,7 +15,6 @@ export var FieldMixin = {
|
|
|
16
15
|
},
|
|
17
16
|
created: function created() {
|
|
18
17
|
var field = this.ztField;
|
|
19
|
-
|
|
20
18
|
if (field && !field.children) {
|
|
21
19
|
field.children = this;
|
|
22
20
|
}
|
package/es/mixins/popup/index.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
// Context
|
|
2
2
|
import { context } from './context';
|
|
3
|
-
import { openOverlay, closeOverlay, updateOverlay, removeOverlay } from './overlay';
|
|
3
|
+
import { openOverlay, closeOverlay, updateOverlay, removeOverlay } from './overlay';
|
|
4
4
|
|
|
5
|
+
// Utils
|
|
5
6
|
import { on, off, preventDefault } from '../../utils/dom/event';
|
|
6
7
|
import { removeNode } from '../../utils/dom/node';
|
|
7
|
-
import { getScroller } from '../../utils/dom/scroll';
|
|
8
|
+
import { getScroller } from '../../utils/dom/scroll';
|
|
8
9
|
|
|
10
|
+
// Mixins
|
|
9
11
|
import { TouchMixin } from '../touch';
|
|
10
12
|
import { PortalMixin } from '../portal';
|
|
11
13
|
import { CloseOnPopstateMixin } from '../close-on-popstate';
|
|
@@ -39,7 +41,6 @@ export function PopupMixin(options) {
|
|
|
39
41
|
if (options === void 0) {
|
|
40
42
|
options = {};
|
|
41
43
|
}
|
|
42
|
-
|
|
43
44
|
return {
|
|
44
45
|
mixins: [TouchMixin, CloseOnPopstateMixin, PortalMixin({
|
|
45
46
|
afterPortal: function afterPortal() {
|
|
@@ -70,7 +71,6 @@ export function PopupMixin(options) {
|
|
|
70
71
|
var type = val ? 'open' : 'close';
|
|
71
72
|
this.inited = this.inited || this.value;
|
|
72
73
|
this[type]();
|
|
73
|
-
|
|
74
74
|
if (!options.skipToggleEvent) {
|
|
75
75
|
this.$emit(type);
|
|
76
76
|
}
|
|
@@ -82,9 +82,7 @@ export function PopupMixin(options) {
|
|
|
82
82
|
this.open();
|
|
83
83
|
}
|
|
84
84
|
},
|
|
85
|
-
|
|
86
|
-
/* istanbul ignore next */
|
|
87
|
-
activated: function activated() {
|
|
85
|
+
/* istanbul ignore next */activated: function activated() {
|
|
88
86
|
if (this.shouldReopen) {
|
|
89
87
|
this.$emit('input', true);
|
|
90
88
|
this.shouldReopen = false;
|
|
@@ -92,18 +90,14 @@ export function PopupMixin(options) {
|
|
|
92
90
|
},
|
|
93
91
|
beforeDestroy: function beforeDestroy() {
|
|
94
92
|
removeOverlay(this);
|
|
95
|
-
|
|
96
93
|
if (this.opened) {
|
|
97
94
|
this.removeLock();
|
|
98
95
|
}
|
|
99
|
-
|
|
100
96
|
if (this.getContainer) {
|
|
101
97
|
removeNode(this.$el);
|
|
102
98
|
}
|
|
103
99
|
},
|
|
104
|
-
|
|
105
|
-
/* istanbul ignore next */
|
|
106
|
-
deactivated: function deactivated() {
|
|
100
|
+
/* istanbul ignore next */deactivated: function deactivated() {
|
|
107
101
|
if (this.value) {
|
|
108
102
|
this.close();
|
|
109
103
|
this.shouldReopen = true;
|
|
@@ -114,13 +108,12 @@ export function PopupMixin(options) {
|
|
|
114
108
|
/* istanbul ignore next */
|
|
115
109
|
if (this.$isServer || this.opened) {
|
|
116
110
|
return;
|
|
117
|
-
}
|
|
118
|
-
|
|
111
|
+
}
|
|
119
112
|
|
|
113
|
+
// cover default zIndex
|
|
120
114
|
if (this.zIndex !== undefined) {
|
|
121
115
|
context.zIndex = this.zIndex;
|
|
122
116
|
}
|
|
123
|
-
|
|
124
117
|
this.opened = true;
|
|
125
118
|
this.renderOverlay();
|
|
126
119
|
this.addLock();
|
|
@@ -132,11 +125,9 @@ export function PopupMixin(options) {
|
|
|
132
125
|
if (this.lockScroll) {
|
|
133
126
|
on(document, 'touchstart', this.touchStart);
|
|
134
127
|
on(document, 'touchmove', this.onTouchMove);
|
|
135
|
-
|
|
136
128
|
if (!context.lockCount) {
|
|
137
129
|
document.body.classList.add('zt2-overflow-hidden');
|
|
138
130
|
}
|
|
139
|
-
|
|
140
131
|
context.lockCount++;
|
|
141
132
|
}
|
|
142
133
|
},
|
|
@@ -145,7 +136,6 @@ export function PopupMixin(options) {
|
|
|
145
136
|
context.lockCount--;
|
|
146
137
|
off(document, 'touchstart', this.touchStart);
|
|
147
138
|
off(document, 'touchmove', this.onTouchMove);
|
|
148
|
-
|
|
149
139
|
if (!context.lockCount) {
|
|
150
140
|
document.body.classList.remove('zt2-overflow-hidden');
|
|
151
141
|
}
|
|
@@ -155,7 +145,6 @@ export function PopupMixin(options) {
|
|
|
155
145
|
if (!this.opened) {
|
|
156
146
|
return;
|
|
157
147
|
}
|
|
158
|
-
|
|
159
148
|
closeOverlay(this);
|
|
160
149
|
this.opened = false;
|
|
161
150
|
this.removeLock();
|
|
@@ -166,33 +155,29 @@ export function PopupMixin(options) {
|
|
|
166
155
|
var direction = this.deltaY > 0 ? '10' : '01';
|
|
167
156
|
var el = getScroller(event.target, this.$el);
|
|
168
157
|
var scrollHeight = el.scrollHeight,
|
|
169
|
-
|
|
170
|
-
|
|
158
|
+
offsetHeight = el.offsetHeight,
|
|
159
|
+
scrollTop = el.scrollTop;
|
|
171
160
|
var status = '11';
|
|
172
|
-
/* istanbul ignore next */
|
|
173
161
|
|
|
162
|
+
/* istanbul ignore next */
|
|
174
163
|
if (scrollTop === 0) {
|
|
175
164
|
status = offsetHeight >= scrollHeight ? '00' : '01';
|
|
176
165
|
} else if (scrollTop + offsetHeight >= scrollHeight) {
|
|
177
166
|
status = '10';
|
|
178
167
|
}
|
|
179
|
-
/* istanbul ignore next */
|
|
180
|
-
|
|
181
168
|
|
|
169
|
+
/* istanbul ignore next */
|
|
182
170
|
if (status !== '11' && this.direction === 'vertical' && !(parseInt(status, 2) & parseInt(direction, 2))) {
|
|
183
171
|
preventDefault(event, true);
|
|
184
172
|
}
|
|
185
173
|
},
|
|
186
174
|
renderOverlay: function renderOverlay() {
|
|
187
175
|
var _this = this;
|
|
188
|
-
|
|
189
176
|
if (this.$isServer || !this.value) {
|
|
190
177
|
return;
|
|
191
178
|
}
|
|
192
|
-
|
|
193
179
|
this.$nextTick(function () {
|
|
194
180
|
_this.updateZIndex(_this.overlay ? 1 : 0);
|
|
195
|
-
|
|
196
181
|
if (_this.overlay) {
|
|
197
182
|
openOverlay(_this, {
|
|
198
183
|
zIndex: context.zIndex++,
|
|
@@ -209,7 +194,6 @@ export function PopupMixin(options) {
|
|
|
209
194
|
if (value === void 0) {
|
|
210
195
|
value = 0;
|
|
211
196
|
}
|
|
212
|
-
|
|
213
197
|
this.$el.style.zIndex = ++context.zIndex + value;
|
|
214
198
|
},
|
|
215
199
|
onReopen: function onReopen(callback) {
|
|
@@ -7,14 +7,12 @@ var defaultConfig = {
|
|
|
7
7
|
className: '',
|
|
8
8
|
customStyle: {}
|
|
9
9
|
};
|
|
10
|
-
|
|
11
10
|
function mountOverlay(vm) {
|
|
12
11
|
return mount(Overlay, {
|
|
13
12
|
on: {
|
|
14
13
|
// close popup when overlay clicked & closeOnClickOverlay is true
|
|
15
14
|
click: function click() {
|
|
16
15
|
vm.$emit('click-overlay');
|
|
17
|
-
|
|
18
16
|
if (vm.closeOnClickOverlay) {
|
|
19
17
|
if (vm.onClickOverlay) {
|
|
20
18
|
vm.onClickOverlay();
|
|
@@ -26,19 +24,15 @@ function mountOverlay(vm) {
|
|
|
26
24
|
}
|
|
27
25
|
});
|
|
28
26
|
}
|
|
29
|
-
|
|
30
27
|
export function updateOverlay(vm) {
|
|
31
28
|
var item = context.find(vm);
|
|
32
|
-
|
|
33
29
|
if (item) {
|
|
34
30
|
var el = vm.$el;
|
|
35
31
|
var config = item.config,
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
overlay = item.overlay;
|
|
38
33
|
if (el && el.parentNode) {
|
|
39
34
|
el.parentNode.insertBefore(overlay.$el, el);
|
|
40
35
|
}
|
|
41
|
-
|
|
42
36
|
_extends(overlay, defaultConfig, config, {
|
|
43
37
|
show: true
|
|
44
38
|
});
|
|
@@ -46,7 +40,6 @@ export function updateOverlay(vm) {
|
|
|
46
40
|
}
|
|
47
41
|
export function openOverlay(vm, config) {
|
|
48
42
|
var item = context.find(vm);
|
|
49
|
-
|
|
50
43
|
if (item) {
|
|
51
44
|
item.config = config;
|
|
52
45
|
} else {
|
|
@@ -57,19 +50,16 @@ export function openOverlay(vm, config) {
|
|
|
57
50
|
overlay: overlay
|
|
58
51
|
});
|
|
59
52
|
}
|
|
60
|
-
|
|
61
53
|
updateOverlay(vm);
|
|
62
54
|
}
|
|
63
55
|
export function closeOverlay(vm) {
|
|
64
56
|
var item = context.find(vm);
|
|
65
|
-
|
|
66
57
|
if (item) {
|
|
67
58
|
item.overlay.show = false;
|
|
68
59
|
}
|
|
69
60
|
}
|
|
70
61
|
export function removeOverlay(vm) {
|
|
71
62
|
var item = context.find(vm);
|
|
72
|
-
|
|
73
63
|
if (item) {
|
|
74
64
|
removeNode(item.overlay.$el);
|
|
75
65
|
context.remove(vm);
|
package/es/mixins/portal.js
CHANGED
|
@@ -2,15 +2,12 @@ function getElement(selector) {
|
|
|
2
2
|
if (typeof selector === 'string') {
|
|
3
3
|
return document.querySelector(selector);
|
|
4
4
|
}
|
|
5
|
-
|
|
6
5
|
return selector();
|
|
7
6
|
}
|
|
8
|
-
|
|
9
7
|
export function PortalMixin(_temp) {
|
|
10
8
|
var _ref = _temp === void 0 ? {} : _temp,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
ref = _ref.ref,
|
|
10
|
+
afterPortal = _ref.afterPortal;
|
|
14
11
|
return {
|
|
15
12
|
props: {
|
|
16
13
|
getContainer: [String, Function]
|
|
@@ -28,17 +25,14 @@ export function PortalMixin(_temp) {
|
|
|
28
25
|
var getContainer = this.getContainer;
|
|
29
26
|
var el = ref ? this.$refs[ref] : this.$el;
|
|
30
27
|
var container;
|
|
31
|
-
|
|
32
28
|
if (getContainer) {
|
|
33
29
|
container = getElement(getContainer);
|
|
34
30
|
} else if (this.$parent) {
|
|
35
31
|
container = this.$parent.$el;
|
|
36
32
|
}
|
|
37
|
-
|
|
38
33
|
if (container && container !== el.parentNode) {
|
|
39
34
|
container.appendChild(el);
|
|
40
35
|
}
|
|
41
|
-
|
|
42
36
|
if (afterPortal) {
|
|
43
37
|
afterPortal.call(this);
|
|
44
38
|
}
|
package/es/mixins/relation.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { sortChildren } from '../utils/vnodes';
|
|
2
2
|
export function ChildrenMixin(_parent, options) {
|
|
3
3
|
var _inject, _computed;
|
|
4
|
-
|
|
5
4
|
if (options === void 0) {
|
|
6
5
|
options = {};
|
|
7
6
|
}
|
|
8
|
-
|
|
9
7
|
var indexKey = options.indexKey || 'index';
|
|
10
8
|
return {
|
|
11
9
|
inject: (_inject = {}, _inject[_parent] = {
|
|
@@ -16,16 +14,13 @@ export function ChildrenMixin(_parent, options) {
|
|
|
16
14
|
if (this.disableBindRelation) {
|
|
17
15
|
return null;
|
|
18
16
|
}
|
|
19
|
-
|
|
20
17
|
return this[_parent];
|
|
21
18
|
}
|
|
22
19
|
}, _computed[indexKey] = function () {
|
|
23
20
|
this.bindRelation();
|
|
24
|
-
|
|
25
21
|
if (this.parent) {
|
|
26
22
|
return this.parent.children.indexOf(this);
|
|
27
23
|
}
|
|
28
|
-
|
|
29
24
|
return null;
|
|
30
25
|
}, _computed),
|
|
31
26
|
watch: {
|
|
@@ -40,7 +35,6 @@ export function ChildrenMixin(_parent, options) {
|
|
|
40
35
|
},
|
|
41
36
|
beforeDestroy: function beforeDestroy() {
|
|
42
37
|
var _this = this;
|
|
43
|
-
|
|
44
38
|
if (this.parent) {
|
|
45
39
|
this.parent.children = this.parent.children.filter(function (item) {
|
|
46
40
|
return item !== _this;
|
|
@@ -52,7 +46,6 @@ export function ChildrenMixin(_parent, options) {
|
|
|
52
46
|
if (!this.parent || this.parent.children.indexOf(this) !== -1) {
|
|
53
47
|
return;
|
|
54
48
|
}
|
|
55
|
-
|
|
56
49
|
var children = [].concat(this.parent.children, [this]);
|
|
57
50
|
sortChildren(children, this.parent);
|
|
58
51
|
this.parent.children = children;
|
|
@@ -64,7 +57,6 @@ export function ParentMixin(parent) {
|
|
|
64
57
|
return {
|
|
65
58
|
provide: function provide() {
|
|
66
59
|
var _ref;
|
|
67
|
-
|
|
68
60
|
return _ref = {}, _ref[parent] = this, _ref;
|
|
69
61
|
},
|
|
70
62
|
data: function data() {
|
package/es/mixins/slots.js
CHANGED
|
@@ -8,15 +8,12 @@ export var SlotsMixin = {
|
|
|
8
8
|
if (name === void 0) {
|
|
9
9
|
name = 'default';
|
|
10
10
|
}
|
|
11
|
-
|
|
12
11
|
var $slots = this.$slots,
|
|
13
|
-
|
|
12
|
+
$scopedSlots = this.$scopedSlots;
|
|
14
13
|
var scopedSlot = $scopedSlots[name];
|
|
15
|
-
|
|
16
14
|
if (scopedSlot) {
|
|
17
15
|
return scopedSlot(props);
|
|
18
16
|
}
|
|
19
|
-
|
|
20
17
|
return $slots[name];
|
|
21
18
|
}
|
|
22
19
|
}
|
package/es/mixins/touch.js
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
import { on } from '../utils/dom/event';
|
|
2
2
|
var MIN_DISTANCE = 10;
|
|
3
|
-
|
|
4
3
|
function getDirection(x, y) {
|
|
5
4
|
if (x > y && x > MIN_DISTANCE) {
|
|
6
5
|
return 'horizontal';
|
|
7
6
|
}
|
|
8
|
-
|
|
9
7
|
if (y > x && y > MIN_DISTANCE) {
|
|
10
8
|
return 'vertical';
|
|
11
9
|
}
|
|
12
|
-
|
|
13
10
|
return '';
|
|
14
11
|
}
|
|
15
|
-
|
|
16
12
|
export var TouchMixin = {
|
|
17
13
|
data: function data() {
|
|
18
14
|
return {
|
|
@@ -26,8 +22,8 @@ export var TouchMixin = {
|
|
|
26
22
|
this.startY = event.touches[0].clientY;
|
|
27
23
|
},
|
|
28
24
|
touchMove: function touchMove(event) {
|
|
29
|
-
var touch = event.touches[0];
|
|
30
|
-
|
|
25
|
+
var touch = event.touches[0];
|
|
26
|
+
// Fix: Safari back will set clientX to negative number
|
|
31
27
|
this.deltaX = touch.clientX < 0 ? 0 : touch.clientX - this.startX;
|
|
32
28
|
this.deltaY = touch.clientY - this.startY;
|
|
33
29
|
this.offsetX = Math.abs(this.deltaX);
|
|
@@ -45,11 +41,10 @@ export var TouchMixin = {
|
|
|
45
41
|
// https://github.com/youzan/vant/issues/3015
|
|
46
42
|
bindTouchEvent: function bindTouchEvent(el) {
|
|
47
43
|
var onTouchStart = this.onTouchStart,
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
onTouchMove = this.onTouchMove,
|
|
45
|
+
onTouchEnd = this.onTouchEnd;
|
|
50
46
|
on(el, 'touchstart', onTouchStart);
|
|
51
47
|
on(el, 'touchmove', onTouchMove);
|
|
52
|
-
|
|
53
48
|
if (onTouchEnd) {
|
|
54
49
|
on(el, 'touchend', onTouchEnd);
|
|
55
50
|
on(el, 'touchcancel', onTouchEnd);
|
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
import _mergeJSXProps2 from "@vue/babel-helper-vue-jsx-merge-props";
|
|
2
|
-
import _mergeJSXProps from "@vue/babel-helper-vue-jsx-merge-props";
|
|
1
|
+
import _mergeJSXProps, { default as _mergeJSXProps2 } from "@vue/babel-helper-vue-jsx-merge-props";
|
|
3
2
|
import { deepClone } from '../utils/deep-clone';
|
|
4
3
|
import { createNamespace, isObject } from '../utils';
|
|
5
|
-
|
|
6
4
|
var _createNamespace = createNamespace('multiple-picker-options'),
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
createComponent = _createNamespace[0],
|
|
6
|
+
bem = _createNamespace[1];
|
|
10
7
|
function isOptionDisabled(option) {
|
|
11
8
|
return isObject(option) && option.disabled;
|
|
12
9
|
}
|
|
13
|
-
|
|
14
10
|
export default createComponent({
|
|
15
11
|
props: {
|
|
16
12
|
valueKey: String,
|
|
@@ -66,29 +62,23 @@ export default createComponent({
|
|
|
66
62
|
if (this.confirmed) {
|
|
67
63
|
return;
|
|
68
64
|
}
|
|
69
|
-
|
|
70
65
|
this.currentIndexs = deepClone(this.defaultIndexs);
|
|
71
66
|
},
|
|
72
67
|
onClickItem: function onClickItem(index) {
|
|
73
68
|
var _this = this;
|
|
74
|
-
|
|
75
69
|
if (this.readonly) {
|
|
76
70
|
return;
|
|
77
71
|
}
|
|
78
|
-
|
|
79
72
|
var exist = false;
|
|
80
73
|
this.currentIndexs.forEach(function (v, i) {
|
|
81
74
|
if (v === index) {
|
|
82
75
|
exist = true;
|
|
83
|
-
|
|
84
76
|
_this.currentIndexs.splice(i, 1);
|
|
85
77
|
}
|
|
86
78
|
});
|
|
87
|
-
|
|
88
79
|
if (!exist) {
|
|
89
80
|
this.currentIndexs.push(index);
|
|
90
81
|
}
|
|
91
|
-
|
|
92
82
|
var currentOptions = [];
|
|
93
83
|
this.currentIndexs.forEach(function (index) {
|
|
94
84
|
currentOptions.push(_this.options[index]);
|
|
@@ -99,32 +89,25 @@ export default createComponent({
|
|
|
99
89
|
if (isObject(option) && this.valueKey in option) {
|
|
100
90
|
return option[this.valueKey];
|
|
101
91
|
}
|
|
102
|
-
|
|
103
92
|
return option;
|
|
104
93
|
},
|
|
105
94
|
genOptions: function genOptions() {
|
|
106
95
|
var _this2 = this;
|
|
107
|
-
|
|
108
96
|
var h = this.$createElement;
|
|
109
97
|
this.columnCounts = Number(this.columnCounts);
|
|
110
|
-
|
|
111
98
|
if (this.columnCounts && this.columnCounts > 3) {
|
|
112
99
|
this.columnCounts = 3;
|
|
113
100
|
}
|
|
114
|
-
|
|
115
101
|
if (this.columnCounts && this.columnCounts < 1) {
|
|
116
102
|
this.columnCounts = 1;
|
|
117
103
|
}
|
|
118
|
-
|
|
119
104
|
var optionStyle = {
|
|
120
105
|
height: this.itemHeight + 8 + "px",
|
|
121
106
|
width: 1 / this.columnCounts * 100 + "%"
|
|
122
107
|
};
|
|
123
108
|
return this.options.map(function (option, index) {
|
|
124
109
|
var _domProps;
|
|
125
|
-
|
|
126
110
|
var text = _this2.getOptionText(option);
|
|
127
|
-
|
|
128
111
|
var disabled = isOptionDisabled(option);
|
|
129
112
|
var data = {
|
|
130
113
|
style: optionStyle,
|