zartui 2.1.5 → 2.1.7
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 +13 -15
- package/es/hierarchy-select/markList.js +11 -32
- 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 +34 -120
- 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 +16 -26
- package/lib/hierarchy-select/markList.js +14 -41
- 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 +32 -164
- 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 +3524 -7066
- package/lib/zart.min.js +7 -1
- package/package.json +1 -1
|
@@ -1,74 +1,61 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.
|
|
4
|
+
exports.getFileUniqueCode = getFileUniqueCode;
|
|
5
|
+
exports.getUniqueFileName = getUniqueFileName;
|
|
5
6
|
exports.isAudioType = isAudioType;
|
|
6
|
-
exports.isVideoType = isVideoType;
|
|
7
|
-
exports.isPdfType = isPdfType;
|
|
8
7
|
exports.isDocType = isDocType;
|
|
9
|
-
exports.isTextType = isTextType;
|
|
10
|
-
exports.isPptType = isPptType;
|
|
11
8
|
exports.isExcelType = isExcelType;
|
|
12
|
-
exports.
|
|
13
|
-
exports.
|
|
14
|
-
|
|
9
|
+
exports.isImageType = isImageType;
|
|
10
|
+
exports.isPdfType = isPdfType;
|
|
11
|
+
exports.isPptType = isPptType;
|
|
12
|
+
exports.isTextType = isTextType;
|
|
13
|
+
exports.isVideoType = isVideoType;
|
|
15
14
|
function isImageType(file) {
|
|
16
15
|
return file.type.indexOf('image/') >= 0;
|
|
17
16
|
}
|
|
18
|
-
|
|
19
17
|
function isAudioType(file) {
|
|
20
18
|
return file.type.indexOf('audio/') >= 0;
|
|
21
19
|
}
|
|
22
|
-
|
|
23
20
|
function isVideoType(file) {
|
|
24
21
|
return file.type.indexOf('video/') >= 0;
|
|
25
22
|
}
|
|
26
|
-
|
|
27
23
|
function isPdfType(file) {
|
|
28
24
|
return file.type.indexOf('/pdf') >= 0;
|
|
29
25
|
}
|
|
30
|
-
|
|
31
26
|
function isDocType(file) {
|
|
32
27
|
return file.type.indexOf('.document') >= 0;
|
|
33
28
|
}
|
|
34
|
-
|
|
35
29
|
function isTextType(file) {
|
|
36
30
|
return file.type.indexOf('text/') >= 0;
|
|
37
31
|
}
|
|
38
|
-
|
|
39
32
|
function isPptType(file) {
|
|
40
33
|
return file.type.indexOf('.presentation') >= 0;
|
|
41
34
|
}
|
|
42
|
-
|
|
43
35
|
function isExcelType(file) {
|
|
44
36
|
return file.type.indexOf('.sheet') >= 0;
|
|
45
37
|
}
|
|
38
|
+
|
|
46
39
|
/**
|
|
47
40
|
* 文件唯一标识
|
|
48
41
|
*/
|
|
49
|
-
|
|
50
|
-
|
|
51
42
|
function getFileUniqueCode(file) {
|
|
52
43
|
return file.name + "_" + file.type + "_" + file.size + "_" + file.lastModified;
|
|
53
44
|
}
|
|
45
|
+
|
|
54
46
|
/**
|
|
55
47
|
* 生成不重复的文件名
|
|
56
48
|
* @param {File} file 原始文件
|
|
57
49
|
* @param {string} suffix 指定文件名后缀
|
|
58
50
|
*/
|
|
59
|
-
|
|
60
|
-
|
|
61
51
|
function getUniqueFileName(file, suffix) {
|
|
62
52
|
if (suffix === void 0) {
|
|
63
53
|
suffix = '';
|
|
64
54
|
}
|
|
65
|
-
|
|
66
55
|
var dotIndex = file.name.lastIndexOf('.');
|
|
67
|
-
|
|
68
56
|
if (dotIndex > 0) {
|
|
69
57
|
suffix = file.name.substring(dotIndex + 1);
|
|
70
58
|
}
|
|
71
|
-
|
|
72
59
|
var now = new Date();
|
|
73
60
|
var name = "" + now.getFullYear() + now.getMonth() + now.getDay() + now.getHours() + now.getMinutes() + now.getSeconds() + now.getMilliseconds() + "_" + Math.ceil(Math.random() * 10000);
|
|
74
61
|
return suffix ? name + '.' + suffix : name;
|
package/lib/media-picker/type.js
CHANGED
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.
|
|
5
|
-
var MediaUploadStatus
|
|
6
|
-
exports.MediaUploadStatus = MediaUploadStatus;
|
|
7
|
-
|
|
8
|
-
(function (MediaUploadStatus) {
|
|
4
|
+
exports.MediaUploadStatus = exports.MediaType = exports.MediaAddType = void 0;
|
|
5
|
+
var MediaUploadStatus = exports.MediaUploadStatus = /*#__PURE__*/function (MediaUploadStatus) {
|
|
9
6
|
MediaUploadStatus["UPLOADING"] = "uploading";
|
|
10
7
|
MediaUploadStatus["DONE"] = "done";
|
|
11
8
|
MediaUploadStatus["FAILED"] = "failed";
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var MediaType
|
|
15
|
-
exports.MediaType = MediaType;
|
|
16
|
-
|
|
17
|
-
(function (MediaType) {
|
|
9
|
+
return MediaUploadStatus;
|
|
10
|
+
}({});
|
|
11
|
+
var MediaType = exports.MediaType = /*#__PURE__*/function (MediaType) {
|
|
18
12
|
MediaType["PHOTO"] = "photo";
|
|
19
13
|
MediaType["AUDIO"] = "audio";
|
|
20
14
|
MediaType["VIDEO"] = "video";
|
|
@@ -24,13 +18,11 @@ exports.MediaType = MediaType;
|
|
|
24
18
|
MediaType["TEXT"] = "text";
|
|
25
19
|
MediaType["PPT"] = "ppt";
|
|
26
20
|
MediaType["EXCEL"] = "excel";
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
var MediaAddType
|
|
30
|
-
exports.MediaAddType = MediaAddType;
|
|
31
|
-
|
|
32
|
-
(function (MediaAddType) {
|
|
21
|
+
return MediaType;
|
|
22
|
+
}({});
|
|
23
|
+
var MediaAddType = exports.MediaAddType = /*#__PURE__*/function (MediaAddType) {
|
|
33
24
|
MediaAddType["TAKE"] = "take";
|
|
34
25
|
MediaAddType["PICK"] = "pick";
|
|
35
26
|
MediaAddType["TAKE_AND_PICK"] = "take_and_pick";
|
|
36
|
-
|
|
27
|
+
return MediaAddType;
|
|
28
|
+
}({});
|
|
@@ -2,10 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.wxUploadImage = exports.uploadImage = exports.chooseImage = void 0;
|
|
5
|
-
|
|
6
5
|
var _type = require("./type");
|
|
7
|
-
|
|
8
|
-
var chooseImage = function chooseImage(type) {
|
|
6
|
+
var chooseImage = exports.chooseImage = function chooseImage(type) {
|
|
9
7
|
return new Promise(function (resolve, reject) {
|
|
10
8
|
window.wx.chooseImage({
|
|
11
9
|
count: 1,
|
|
@@ -23,10 +21,7 @@ var chooseImage = function chooseImage(type) {
|
|
|
23
21
|
});
|
|
24
22
|
});
|
|
25
23
|
};
|
|
26
|
-
|
|
27
|
-
exports.chooseImage = chooseImage;
|
|
28
|
-
|
|
29
|
-
var uploadImage = function uploadImage(localId) {
|
|
24
|
+
var uploadImage = exports.uploadImage = function uploadImage(localId) {
|
|
30
25
|
return new Promise(function (resolve, reject) {
|
|
31
26
|
window.wx.uploadImage({
|
|
32
27
|
localId: localId,
|
|
@@ -43,10 +38,7 @@ var uploadImage = function uploadImage(localId) {
|
|
|
43
38
|
});
|
|
44
39
|
});
|
|
45
40
|
};
|
|
46
|
-
|
|
47
|
-
exports.uploadImage = uploadImage;
|
|
48
|
-
|
|
49
|
-
var wxUploadImage = function wxUploadImage(type) {
|
|
41
|
+
var wxUploadImage = exports.wxUploadImage = function wxUploadImage(type) {
|
|
50
42
|
return new Promise(function (resolve) {
|
|
51
43
|
var newMedias = [];
|
|
52
44
|
chooseImage(type).then(function (localIds) {
|
|
@@ -65,7 +57,6 @@ var wxUploadImage = function wxUploadImage(type) {
|
|
|
65
57
|
uploadImage(localId).then(function (serverId) {
|
|
66
58
|
media.wxServerId = serverId;
|
|
67
59
|
newMedias.push(media);
|
|
68
|
-
|
|
69
60
|
if (newMedias.length === localIds.length) {
|
|
70
61
|
resolve(newMedias);
|
|
71
62
|
}
|
|
@@ -73,6 +64,4 @@ var wxUploadImage = function wxUploadImage(type) {
|
|
|
73
64
|
});
|
|
74
65
|
});
|
|
75
66
|
});
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
exports.wxUploadImage = wxUploadImage;
|
|
67
|
+
};
|
|
@@ -1,26 +1,19 @@
|
|
|
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 _type = require("../media-picker/type");
|
|
11
|
-
|
|
12
8
|
var _popup = _interopRequireDefault(require("../popup"));
|
|
13
|
-
|
|
14
9
|
var _button = _interopRequireDefault(require("../button"));
|
|
15
|
-
|
|
16
10
|
var _device = require("../utils/device");
|
|
17
|
-
|
|
18
11
|
// import Toast from '../toast';
|
|
19
|
-
var _createNamespace = (0, _utils.createNamespace)('media-player'),
|
|
20
|
-
createComponent = _createNamespace[0],
|
|
21
|
-
bem = _createNamespace[1];
|
|
22
12
|
|
|
23
|
-
var
|
|
13
|
+
var _createNamespace = (0, _utils.createNamespace)('media-player'),
|
|
14
|
+
createComponent = _createNamespace[0],
|
|
15
|
+
bem = _createNamespace[1];
|
|
16
|
+
var _default2 = exports.default = createComponent({
|
|
24
17
|
props: {
|
|
25
18
|
value: {
|
|
26
19
|
type: Boolean,
|
|
@@ -55,7 +48,6 @@ var _default2 = createComponent({
|
|
|
55
48
|
methods: {
|
|
56
49
|
getMediaElement: function getMediaElement() {
|
|
57
50
|
var player;
|
|
58
|
-
|
|
59
51
|
if (this.mediaType === _type.MediaType.AUDIO) {
|
|
60
52
|
// player = document.getElementById("audio")
|
|
61
53
|
player = this.$refs.audio;
|
|
@@ -63,25 +55,22 @@ var _default2 = createComponent({
|
|
|
63
55
|
// player = document.getElementById("video")
|
|
64
56
|
player = this.$refs.video;
|
|
65
57
|
}
|
|
66
|
-
|
|
67
58
|
return player;
|
|
68
59
|
},
|
|
69
60
|
onOpen: function onOpen() {
|
|
70
61
|
var _this = this;
|
|
71
|
-
|
|
72
62
|
this.$nextTick(function () {
|
|
73
63
|
var player = _this.getMediaElement();
|
|
74
|
-
|
|
75
64
|
if (!player) {
|
|
76
65
|
return;
|
|
77
|
-
}
|
|
66
|
+
}
|
|
67
|
+
// player.addEventListener('error', (event) => {
|
|
78
68
|
// console.log(event)
|
|
79
69
|
// Toast.fail('播放失败')
|
|
80
70
|
// this.onClose()
|
|
81
71
|
// }, true)
|
|
82
|
-
//iOS中无法自动播放,必须有点击事件触发。但是微信中有办法实现
|
|
83
|
-
|
|
84
72
|
|
|
73
|
+
//iOS中无法自动播放,必须有点击事件触发。但是微信中有办法实现
|
|
85
74
|
if ((0, _device.isWeixin)()) {
|
|
86
75
|
if (typeof WeixinJSBridge == "object" && typeof WeixinJSBridge.invoke == "function") {
|
|
87
76
|
WeixinJSBridge.invoke('getNetworkType', {}, function (res) {
|
|
@@ -96,21 +85,17 @@ var _default2 = createComponent({
|
|
|
96
85
|
onClose: function onClose() {
|
|
97
86
|
this.$emit('input', false);
|
|
98
87
|
var player = this.getMediaElement();
|
|
99
|
-
|
|
100
88
|
if (!player) {
|
|
101
89
|
return;
|
|
102
90
|
}
|
|
103
|
-
|
|
104
91
|
player.pause();
|
|
105
92
|
player.currentTime = 0;
|
|
106
|
-
|
|
107
93
|
if (this.mediaUrl && !this.mediaUrl.startsWith('http')) {
|
|
108
94
|
(URL || webkitURL).revokeObjectURL(this.mediaUrl);
|
|
109
95
|
}
|
|
110
96
|
},
|
|
111
97
|
renderTag: function renderTag() {
|
|
112
98
|
var h = this.$createElement;
|
|
113
|
-
|
|
114
99
|
if (this.mediaUrl) {
|
|
115
100
|
if (this.mediaType === _type.MediaType.VIDEO) {
|
|
116
101
|
return h("video", {
|
|
@@ -144,7 +129,6 @@ var _default2 = createComponent({
|
|
|
144
129
|
},
|
|
145
130
|
render: function render(h) {
|
|
146
131
|
var _this2 = this;
|
|
147
|
-
|
|
148
132
|
return h(_popup.default, {
|
|
149
133
|
"class": bem(),
|
|
150
134
|
"attrs": {
|
|
@@ -168,12 +152,9 @@ var _default2 = createComponent({
|
|
|
168
152
|
"on": {
|
|
169
153
|
"click": function click(event) {
|
|
170
154
|
event.stopPropagation();
|
|
171
|
-
|
|
172
155
|
_this2.onClose();
|
|
173
156
|
}
|
|
174
157
|
}
|
|
175
158
|
}, ["\u5173\u95ED"])]);
|
|
176
159
|
}
|
|
177
|
-
});
|
|
178
|
-
|
|
179
|
-
exports.default = _default2;
|
|
160
|
+
});
|
package/lib/mixins/bind-event.js
CHANGED
|
@@ -2,31 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.BindEventMixin = BindEventMixin;
|
|
5
|
-
|
|
6
5
|
var _event = require("../utils/dom/event");
|
|
7
|
-
|
|
8
6
|
/**
|
|
9
7
|
* Bind event when mounted or activated
|
|
10
8
|
*/
|
|
11
|
-
var uid = 0;
|
|
12
9
|
|
|
10
|
+
var uid = 0;
|
|
13
11
|
function BindEventMixin(handler) {
|
|
14
12
|
var key = "binded_" + uid++;
|
|
15
|
-
|
|
16
13
|
function bind() {
|
|
17
14
|
if (!this[key]) {
|
|
18
15
|
handler.call(this, _event.on, true);
|
|
19
16
|
this[key] = true;
|
|
20
17
|
}
|
|
21
18
|
}
|
|
22
|
-
|
|
23
19
|
function unbind() {
|
|
24
20
|
if (this[key]) {
|
|
25
21
|
handler.call(this, _event.off, false);
|
|
26
22
|
this[key] = false;
|
|
27
23
|
}
|
|
28
24
|
}
|
|
29
|
-
|
|
30
25
|
return {
|
|
31
26
|
mounted: bind,
|
|
32
27
|
activated: bind,
|
package/lib/mixins/checkbox.js
CHANGED
|
@@ -1,25 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
exports.__esModule = true;
|
|
6
5
|
exports.CheckboxMixin = void 0;
|
|
7
|
-
|
|
8
6
|
var _icon = _interopRequireDefault(require("../icon"));
|
|
9
|
-
|
|
10
7
|
var _field = require("./field");
|
|
11
|
-
|
|
12
8
|
var _relation = require("./relation");
|
|
13
|
-
|
|
14
9
|
var _utils = require("../utils");
|
|
15
|
-
|
|
16
10
|
/**
|
|
17
11
|
* Common part of Checkbox & Radio
|
|
18
12
|
*/
|
|
19
|
-
|
|
13
|
+
|
|
14
|
+
var CheckboxMixin = exports.CheckboxMixin = function CheckboxMixin(_ref) {
|
|
20
15
|
var parent = _ref.parent,
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
bem = _ref.bem,
|
|
17
|
+
role = _ref.role;
|
|
23
18
|
return {
|
|
24
19
|
mixins: [(0, _relation.ChildrenMixin)(parent), _field.FieldMixin],
|
|
25
20
|
props: {
|
|
@@ -57,7 +52,6 @@ var CheckboxMixin = function CheckboxMixin(_ref) {
|
|
|
57
52
|
var boxShadow = this.boxShadow || this.parent && this.parent.boxShadow;
|
|
58
53
|
var border = this.border || this.parent && this.parent.border;
|
|
59
54
|
var iconColor = this.iconColor || this.parent && this.parent.iconColor;
|
|
60
|
-
|
|
61
55
|
if ((boxShadow || checkedColor) && this.checked && !this.isDisabled) {
|
|
62
56
|
return {
|
|
63
57
|
color: iconColor,
|
|
@@ -71,22 +65,20 @@ var CheckboxMixin = function CheckboxMixin(_ref) {
|
|
|
71
65
|
if (this.isDisabled || role === 'radio' && !this.checked) {
|
|
72
66
|
return -1;
|
|
73
67
|
}
|
|
74
|
-
|
|
75
68
|
return 0;
|
|
76
69
|
}
|
|
77
70
|
},
|
|
78
71
|
methods: {
|
|
79
72
|
onClick: function onClick(event) {
|
|
80
73
|
var _this = this;
|
|
81
|
-
|
|
82
74
|
var target = event.target;
|
|
83
75
|
var icon = this.$refs.icon;
|
|
84
76
|
var iconClicked = icon === target || icon.contains(target);
|
|
85
|
-
|
|
86
77
|
if (!this.isDisabled && (iconClicked || !this.labelDisabled)) {
|
|
87
|
-
this.toggle();
|
|
88
|
-
// so we can get the changed value in the click event listener
|
|
78
|
+
this.toggle();
|
|
89
79
|
|
|
80
|
+
// wait for toggle method to complete
|
|
81
|
+
// so we can get the changed value in the click event listener
|
|
90
82
|
setTimeout(function () {
|
|
91
83
|
_this.$emit('click', event);
|
|
92
84
|
});
|
|
@@ -123,7 +115,6 @@ var CheckboxMixin = function CheckboxMixin(_ref) {
|
|
|
123
115
|
genLabel: function genLabel() {
|
|
124
116
|
var h = this.$createElement;
|
|
125
117
|
var slot = this.slots();
|
|
126
|
-
|
|
127
118
|
if (slot) {
|
|
128
119
|
return h("span", {
|
|
129
120
|
"class": bem('label', [this.labelPosition, {
|
|
@@ -136,13 +127,11 @@ var CheckboxMixin = function CheckboxMixin(_ref) {
|
|
|
136
127
|
render: function render() {
|
|
137
128
|
var h = arguments[0];
|
|
138
129
|
var Children = [this.genIcon()];
|
|
139
|
-
|
|
140
130
|
if (this.labelPosition === 'left') {
|
|
141
131
|
Children.unshift(this.genLabel());
|
|
142
132
|
} else {
|
|
143
133
|
Children.push(this.genLabel());
|
|
144
134
|
}
|
|
145
|
-
|
|
146
135
|
var checked = this.checked;
|
|
147
136
|
return h("div", {
|
|
148
137
|
"attrs": {
|
|
@@ -160,6 +149,4 @@ var CheckboxMixin = function CheckboxMixin(_ref) {
|
|
|
160
149
|
}, [Children]);
|
|
161
150
|
}
|
|
162
151
|
};
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
exports.CheckboxMixin = CheckboxMixin;
|
|
152
|
+
};
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.ClickOutsideMixin = void 0;
|
|
5
|
-
|
|
6
5
|
var _event = require("../utils/dom/event");
|
|
7
|
-
|
|
8
6
|
/**
|
|
9
7
|
* Listen to click outside event
|
|
10
8
|
*/
|
|
11
|
-
|
|
9
|
+
|
|
10
|
+
var ClickOutsideMixin = exports.ClickOutsideMixin = function ClickOutsideMixin(config) {
|
|
12
11
|
return {
|
|
13
12
|
props: {
|
|
14
13
|
closeOnClickOutside: {
|
|
@@ -18,13 +17,11 @@ var ClickOutsideMixin = function ClickOutsideMixin(config) {
|
|
|
18
17
|
},
|
|
19
18
|
data: function data() {
|
|
20
19
|
var _this = this;
|
|
21
|
-
|
|
22
20
|
var clickOutsideHandler = function clickOutsideHandler(event) {
|
|
23
21
|
if (_this.closeOnClickOutside && !_this.$el.contains(event.target)) {
|
|
24
22
|
_this[config.method]();
|
|
25
23
|
}
|
|
26
24
|
};
|
|
27
|
-
|
|
28
25
|
return {
|
|
29
26
|
clickOutsideHandler: clickOutsideHandler
|
|
30
27
|
};
|
|
@@ -36,6 +33,4 @@ var ClickOutsideMixin = function ClickOutsideMixin(config) {
|
|
|
36
33
|
(0, _event.off)(document, config.event, this.clickOutsideHandler);
|
|
37
34
|
}
|
|
38
35
|
};
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
exports.ClickOutsideMixin = ClickOutsideMixin;
|
|
36
|
+
};
|
|
@@ -2,12 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.CloseOnPopstateMixin = void 0;
|
|
5
|
-
|
|
6
5
|
var _event = require("../utils/dom/event");
|
|
7
|
-
|
|
8
6
|
var _bindEvent = require("./bind-event");
|
|
9
|
-
|
|
10
|
-
var CloseOnPopstateMixin = {
|
|
7
|
+
var CloseOnPopstateMixin = exports.CloseOnPopstateMixin = {
|
|
11
8
|
mixins: [(0, _bindEvent.BindEventMixin)(function (bind, isBind) {
|
|
12
9
|
this.handlePopstate(isBind && this.closeOnPopstate);
|
|
13
10
|
})],
|
|
@@ -34,7 +31,6 @@ var CloseOnPopstateMixin = {
|
|
|
34
31
|
if (this.$isServer) {
|
|
35
32
|
return;
|
|
36
33
|
}
|
|
37
|
-
|
|
38
34
|
if (this.bindStatus !== bind) {
|
|
39
35
|
this.bindStatus = bind;
|
|
40
36
|
var action = bind ? _event.on : _event.off;
|
|
@@ -42,5 +38,4 @@ var CloseOnPopstateMixin = {
|
|
|
42
38
|
}
|
|
43
39
|
}
|
|
44
40
|
}
|
|
45
|
-
};
|
|
46
|
-
exports.CloseOnPopstateMixin = CloseOnPopstateMixin;
|
|
41
|
+
};
|
package/lib/mixins/field.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.FieldMixin = void 0;
|
|
5
|
-
var FieldMixin = {
|
|
5
|
+
var FieldMixin = exports.FieldMixin = {
|
|
6
6
|
inject: {
|
|
7
7
|
ztField: {
|
|
8
8
|
default: null
|
|
@@ -11,7 +11,6 @@ var FieldMixin = {
|
|
|
11
11
|
watch: {
|
|
12
12
|
value: function value() {
|
|
13
13
|
var field = this.ztField;
|
|
14
|
-
|
|
15
14
|
if (field) {
|
|
16
15
|
field.resetValidation();
|
|
17
16
|
field.validateWithTrigger('onChange');
|
|
@@ -20,10 +19,8 @@ var FieldMixin = {
|
|
|
20
19
|
},
|
|
21
20
|
created: function created() {
|
|
22
21
|
var field = this.ztField;
|
|
23
|
-
|
|
24
22
|
if (field && !field.children) {
|
|
25
23
|
field.children = this;
|
|
26
24
|
}
|
|
27
25
|
}
|
|
28
|
-
};
|
|
29
|
-
exports.FieldMixin = FieldMixin;
|
|
26
|
+
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.context = void 0;
|
|
5
|
-
var context = {
|
|
5
|
+
var context = exports.context = {
|
|
6
6
|
zIndex: 2000,
|
|
7
7
|
lockCount: 0,
|
|
8
8
|
stack: [],
|
|
@@ -19,5 +19,4 @@ var context = {
|
|
|
19
19
|
var index = this.stack.indexOf(item);
|
|
20
20
|
this.stack.splice(index, 1);
|
|
21
21
|
}
|
|
22
|
-
};
|
|
23
|
-
exports.context = context;
|
|
22
|
+
};
|
|
@@ -3,27 +3,21 @@
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.PopupMixin = PopupMixin;
|
|
5
5
|
exports.popupMixinProps = void 0;
|
|
6
|
-
|
|
7
6
|
var _context = require("./context");
|
|
8
|
-
|
|
9
7
|
var _overlay = require("./overlay");
|
|
10
|
-
|
|
11
8
|
var _event = require("../../utils/dom/event");
|
|
12
|
-
|
|
13
9
|
var _node = require("../../utils/dom/node");
|
|
14
|
-
|
|
15
10
|
var _scroll = require("../../utils/dom/scroll");
|
|
16
|
-
|
|
17
11
|
var _touch = require("../touch");
|
|
18
|
-
|
|
19
12
|
var _portal = require("../portal");
|
|
20
|
-
|
|
21
13
|
var _closeOnPopstate = require("../close-on-popstate");
|
|
22
|
-
|
|
23
14
|
// Context
|
|
15
|
+
|
|
24
16
|
// Utils
|
|
17
|
+
|
|
25
18
|
// Mixins
|
|
26
|
-
|
|
19
|
+
|
|
20
|
+
var popupMixinProps = exports.popupMixinProps = {
|
|
27
21
|
// Initial rendering animation
|
|
28
22
|
transitionAppear: Boolean,
|
|
29
23
|
// whether to show popup
|
|
@@ -49,13 +43,10 @@ var popupMixinProps = {
|
|
|
49
43
|
default: true
|
|
50
44
|
}
|
|
51
45
|
};
|
|
52
|
-
exports.popupMixinProps = popupMixinProps;
|
|
53
|
-
|
|
54
46
|
function PopupMixin(options) {
|
|
55
47
|
if (options === void 0) {
|
|
56
48
|
options = {};
|
|
57
49
|
}
|
|
58
|
-
|
|
59
50
|
return {
|
|
60
51
|
mixins: [_touch.TouchMixin, _closeOnPopstate.CloseOnPopstateMixin, (0, _portal.PortalMixin)({
|
|
61
52
|
afterPortal: function afterPortal() {
|
|
@@ -86,7 +77,6 @@ function PopupMixin(options) {
|
|
|
86
77
|
var type = val ? 'open' : 'close';
|
|
87
78
|
this.inited = this.inited || this.value;
|
|
88
79
|
this[type]();
|
|
89
|
-
|
|
90
80
|
if (!options.skipToggleEvent) {
|
|
91
81
|
this.$emit(type);
|
|
92
82
|
}
|
|
@@ -98,9 +88,7 @@ function PopupMixin(options) {
|
|
|
98
88
|
this.open();
|
|
99
89
|
}
|
|
100
90
|
},
|
|
101
|
-
|
|
102
|
-
/* istanbul ignore next */
|
|
103
|
-
activated: function activated() {
|
|
91
|
+
/* istanbul ignore next */activated: function activated() {
|
|
104
92
|
if (this.shouldReopen) {
|
|
105
93
|
this.$emit('input', true);
|
|
106
94
|
this.shouldReopen = false;
|
|
@@ -108,18 +96,14 @@ function PopupMixin(options) {
|
|
|
108
96
|
},
|
|
109
97
|
beforeDestroy: function beforeDestroy() {
|
|
110
98
|
(0, _overlay.removeOverlay)(this);
|
|
111
|
-
|
|
112
99
|
if (this.opened) {
|
|
113
100
|
this.removeLock();
|
|
114
101
|
}
|
|
115
|
-
|
|
116
102
|
if (this.getContainer) {
|
|
117
103
|
(0, _node.removeNode)(this.$el);
|
|
118
104
|
}
|
|
119
105
|
},
|
|
120
|
-
|
|
121
|
-
/* istanbul ignore next */
|
|
122
|
-
deactivated: function deactivated() {
|
|
106
|
+
/* istanbul ignore next */deactivated: function deactivated() {
|
|
123
107
|
if (this.value) {
|
|
124
108
|
this.close();
|
|
125
109
|
this.shouldReopen = true;
|
|
@@ -130,13 +114,12 @@ function PopupMixin(options) {
|
|
|
130
114
|
/* istanbul ignore next */
|
|
131
115
|
if (this.$isServer || this.opened) {
|
|
132
116
|
return;
|
|
133
|
-
}
|
|
134
|
-
|
|
117
|
+
}
|
|
135
118
|
|
|
119
|
+
// cover default zIndex
|
|
136
120
|
if (this.zIndex !== undefined) {
|
|
137
121
|
_context.context.zIndex = this.zIndex;
|
|
138
122
|
}
|
|
139
|
-
|
|
140
123
|
this.opened = true;
|
|
141
124
|
this.renderOverlay();
|
|
142
125
|
this.addLock();
|
|
@@ -148,11 +131,9 @@ function PopupMixin(options) {
|
|
|
148
131
|
if (this.lockScroll) {
|
|
149
132
|
(0, _event.on)(document, 'touchstart', this.touchStart);
|
|
150
133
|
(0, _event.on)(document, 'touchmove', this.onTouchMove);
|
|
151
|
-
|
|
152
134
|
if (!_context.context.lockCount) {
|
|
153
135
|
document.body.classList.add('zt2-overflow-hidden');
|
|
154
136
|
}
|
|
155
|
-
|
|
156
137
|
_context.context.lockCount++;
|
|
157
138
|
}
|
|
158
139
|
},
|
|
@@ -161,7 +142,6 @@ function PopupMixin(options) {
|
|
|
161
142
|
_context.context.lockCount--;
|
|
162
143
|
(0, _event.off)(document, 'touchstart', this.touchStart);
|
|
163
144
|
(0, _event.off)(document, 'touchmove', this.onTouchMove);
|
|
164
|
-
|
|
165
145
|
if (!_context.context.lockCount) {
|
|
166
146
|
document.body.classList.remove('zt2-overflow-hidden');
|
|
167
147
|
}
|
|
@@ -171,7 +151,6 @@ function PopupMixin(options) {
|
|
|
171
151
|
if (!this.opened) {
|
|
172
152
|
return;
|
|
173
153
|
}
|
|
174
|
-
|
|
175
154
|
(0, _overlay.closeOverlay)(this);
|
|
176
155
|
this.opened = false;
|
|
177
156
|
this.removeLock();
|
|
@@ -182,33 +161,29 @@ function PopupMixin(options) {
|
|
|
182
161
|
var direction = this.deltaY > 0 ? '10' : '01';
|
|
183
162
|
var el = (0, _scroll.getScroller)(event.target, this.$el);
|
|
184
163
|
var scrollHeight = el.scrollHeight,
|
|
185
|
-
|
|
186
|
-
|
|
164
|
+
offsetHeight = el.offsetHeight,
|
|
165
|
+
scrollTop = el.scrollTop;
|
|
187
166
|
var status = '11';
|
|
188
|
-
/* istanbul ignore next */
|
|
189
167
|
|
|
168
|
+
/* istanbul ignore next */
|
|
190
169
|
if (scrollTop === 0) {
|
|
191
170
|
status = offsetHeight >= scrollHeight ? '00' : '01';
|
|
192
171
|
} else if (scrollTop + offsetHeight >= scrollHeight) {
|
|
193
172
|
status = '10';
|
|
194
173
|
}
|
|
195
|
-
/* istanbul ignore next */
|
|
196
|
-
|
|
197
174
|
|
|
175
|
+
/* istanbul ignore next */
|
|
198
176
|
if (status !== '11' && this.direction === 'vertical' && !(parseInt(status, 2) & parseInt(direction, 2))) {
|
|
199
177
|
(0, _event.preventDefault)(event, true);
|
|
200
178
|
}
|
|
201
179
|
},
|
|
202
180
|
renderOverlay: function renderOverlay() {
|
|
203
181
|
var _this = this;
|
|
204
|
-
|
|
205
182
|
if (this.$isServer || !this.value) {
|
|
206
183
|
return;
|
|
207
184
|
}
|
|
208
|
-
|
|
209
185
|
this.$nextTick(function () {
|
|
210
186
|
_this.updateZIndex(_this.overlay ? 1 : 0);
|
|
211
|
-
|
|
212
187
|
if (_this.overlay) {
|
|
213
188
|
(0, _overlay.openOverlay)(_this, {
|
|
214
189
|
zIndex: _context.context.zIndex++,
|
|
@@ -225,7 +200,6 @@ function PopupMixin(options) {
|
|
|
225
200
|
if (value === void 0) {
|
|
226
201
|
value = 0;
|
|
227
202
|
}
|
|
228
|
-
|
|
229
203
|
this.$el.style.zIndex = ++_context.context.zIndex + value;
|
|
230
204
|
},
|
|
231
205
|
onReopen: function onReopen(callback) {
|