zartui 2.0.79 → 2.0.80-beta.1
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 +0 -6
- 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 -4
- package/es/datetime-picker/shared.js +5 -19
- 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 +22 -35
- package/es/dropdown-menu/index.js +4 -9
- package/es/empty/index.js +3 -11
- package/es/field/index.js +20 -83
- 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 +17 -30
- package/es/hierarchy-select/breadcrumb.js +2 -6
- package/es/hierarchy-select/index.js +3 -12
- package/es/hierarchy-select/markList.js +2 -25
- package/es/hierarchy-select/svg/SubIcon.js +0 -1
- package/es/icon/index.js +9 -13
- package/es/image/index.js +2 -17
- 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 +33 -117
- package/es/media-picker/media-util.js +2 -5
- package/es/media-picker/type.js +0 -5
- package/es/media-player/index.js +7 -17
- 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 +2 -18
- 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 +20 -54
- package/es/picker/index.js +13 -42
- package/es/popover/index.js +11 -20
- package/es/popup/index.js +5 -21
- package/es/pull-refresh/index.js +15 -32
- 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 +8 -13
- package/es/signature/bezier.js +5 -12
- 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 +10 -37
- 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 +9 -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 +10 -35
- package/es/tabs/Content.js +5 -9
- package/es/tabs/Title.js +11 -19
- package/es/tabs/index.js +16 -51
- package/es/tabs/utils.js +0 -8
- package/es/tag/index.js +13 -17
- 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 -7
- 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 +7 -12
- package/es/utils/validate/number.js +2 -2
- package/es/utils/vnodes.js +2 -8
- package/lib/action-sheet/index.js +11 -35
- package/lib/area/index.js +5 -45
- package/lib/avatar/index.js +3 -18
- package/lib/back-top/index.js +4 -25
- package/lib/badge/index.js +4 -15
- package/lib/button/index.js +19 -50
- package/lib/calendar/components/Header.js +3 -18
- package/lib/calendar/components/Month.js +12 -71
- package/lib/calendar/index.js +21 -106
- package/lib/calendar/types.js +0 -7
- package/lib/calendar/utils.js +5 -32
- package/lib/cascader/index.js +4 -46
- package/lib/cell/index.js +18 -48
- package/lib/cell-group/index.js +5 -15
- package/lib/checkbox/index.js +4 -14
- package/lib/checkbox-group/index.js +4 -13
- package/lib/col/index.js +6 -14
- package/lib/collapse/index.js +2 -8
- package/lib/collapse-item/index.js +18 -43
- package/lib/count-down/index.js +2 -19
- package/lib/count-down/utils.js +3 -15
- package/lib/datetime-picker/DatePicker.js +12 -81
- package/lib/datetime-picker/TimePicker.js +10 -30
- package/lib/datetime-picker/index.js +2 -10
- package/lib/datetime-picker/shared.js +5 -27
- package/lib/datetime-picker/utils.js +0 -9
- package/lib/dialog/Dialog.js +6 -28
- package/lib/dialog/index.js +0 -22
- package/lib/divider/index.js +5 -12
- package/lib/dropdown-item/index.js +21 -44
- package/lib/dropdown-menu/index.js +4 -15
- package/lib/empty/index.js +3 -23
- package/lib/field/index.js +20 -96
- package/lib/fold-dialog/index.js +5 -22
- package/lib/form/index.js +2 -21
- package/lib/grid/index.js +2 -10
- package/lib/grid-item/index.js +16 -37
- package/lib/hierarchy-select/breadcrumb.js +3 -10
- package/lib/hierarchy-select/index.js +4 -20
- package/lib/hierarchy-select/markList.js +3 -31
- package/lib/hierarchy-select/svg/SubIcon.js +0 -1
- package/lib/icon/index.js +8 -19
- package/lib/image/index.js +2 -22
- package/lib/image-preview/ImagePreview.js +0 -16
- package/lib/image-preview/ImagePreviewItem.js +13 -36
- package/lib/image-preview/index.js +0 -16
- package/lib/image-preview/shared.js +2 -5
- package/lib/index-anchor/index.js +2 -11
- package/lib/index-bar/IndexIndicate.js +0 -1
- package/lib/index-bar/index.js +7 -37
- package/lib/index.js +1 -157
- package/lib/info/index.js +6 -14
- package/lib/lazyload/index.js +0 -3
- package/lib/list/index.js +10 -33
- package/lib/loading/index.js +7 -21
- package/lib/locale/index.js +0 -7
- package/lib/media-picker/index.js +27 -153
- package/lib/media-picker/media-util.js +2 -15
- package/lib/media-picker/type.js +0 -5
- package/lib/media-player/index.js +6 -22
- package/lib/mixins/bind-event.js +1 -6
- package/lib/mixins/checkbox.js +6 -18
- package/lib/mixins/click-outside.js +1 -5
- package/lib/mixins/close-on-popstate.js +0 -4
- package/lib/mixins/field.js +0 -2
- package/lib/mixins/popup/index.js +11 -36
- package/lib/mixins/popup/overlay.js +1 -23
- package/lib/mixins/portal.js +2 -9
- package/lib/mixins/relation.js +0 -11
- package/lib/mixins/slots.js +1 -5
- package/lib/mixins/touch.js +4 -11
- package/lib/multiple-picker/MultiplePickerOptions.js +2 -23
- package/lib/multiple-picker/index.js +5 -26
- package/lib/nav-bar/index.js +4 -16
- package/lib/notice-bar/index.js +10 -40
- package/lib/number-keyboard/Key.js +2 -17
- package/lib/number-keyboard/index.js +4 -26
- package/lib/overlay/index.js +5 -16
- package/lib/password-input/index.js +10 -23
- package/lib/picker/PickerColumn.js +19 -63
- package/lib/picker/index.js +13 -53
- package/lib/popover/index.js +9 -27
- package/lib/popup/index.js +5 -27
- package/lib/pull-refresh/index.js +14 -38
- package/lib/radio/index.js +2 -7
- package/lib/radio-group/index.js +2 -8
- package/lib/rate/index.js +11 -31
- package/lib/row/index.js +3 -12
- package/lib/search/index.js +7 -21
- package/lib/signature/bezier.js +5 -15
- package/lib/signature/force-landscape.js +0 -11
- package/lib/signature/index.js +6 -31
- package/lib/signature/point.js +0 -8
- package/lib/signature/throttle.js +1 -11
- package/lib/skeleton/index.js +5 -21
- package/lib/slider/index.js +19 -63
- package/lib/step/index.js +5 -18
- package/lib/stepper/index.js +10 -46
- package/lib/steps/index.js +2 -7
- package/lib/sticky/index.js +8 -59
- package/lib/swipe/index.js +19 -70
- package/lib/swipe-cell/index.js +7 -29
- package/lib/swipe-item/index.js +9 -24
- package/lib/switch/index.js +7 -14
- package/lib/switch/shared.js +1 -1
- package/lib/switch-cell/index.js +6 -16
- package/lib/tab/index.js +4 -21
- package/lib/tabbar/index.js +4 -19
- package/lib/tabbar-item/index.js +5 -21
- package/lib/table/index.js +10 -38
- package/lib/tabs/Content.js +5 -15
- package/lib/tabs/Title.js +11 -23
- package/lib/tabs/index.js +15 -65
- package/lib/tabs/utils.js +0 -13
- package/lib/tag/index.js +12 -23
- package/lib/timeline/index.js +2 -32
- package/lib/toast/Toast.js +10 -30
- package/lib/toast/index.js +6 -38
- package/lib/toast/lock-click.js +0 -3
- package/lib/uploader/index.js +10 -72
- package/lib/uploader/utils.js +0 -17
- package/lib/utils/constant.js +2 -1
- package/lib/utils/create/bem.js +1 -6
- package/lib/utils/create/component.js +5 -14
- 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 +0 -2
- package/lib/utils/dom/event.js +2 -10
- package/lib/utils/dom/node.js +0 -2
- package/lib/utils/dom/raf.js +7 -11
- package/lib/utils/dom/reset-scroll.js +2 -4
- package/lib/utils/dom/scroll.js +8 -28
- package/lib/utils/dom/style.js +3 -3
- package/lib/utils/easings.js +2 -5
- package/lib/utils/format/date-util.js +54 -168
- package/lib/utils/format/number.js +2 -13
- package/lib/utils/format/string.js +0 -5
- package/lib/utils/format/unit.js +2 -16
- package/lib/utils/functional.js +6 -14
- package/lib/utils/getScroll.js +0 -7
- package/lib/utils/index.js +3 -19
- package/lib/utils/interceptor.js +2 -6
- package/lib/utils/media/image-util.js +7 -25
- package/lib/utils/raf.js +4 -13
- package/lib/utils/router.js +7 -9
- package/lib/utils/scrollTo.js +9 -21
- 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 +2 -4
- package/lib/utils/validate/system.js +0 -3
- package/lib/utils/vnodes.js +2 -9
- package/lib/zart.js +57 -18
- package/lib/zart.min.js +1 -1
- package/package.json +17 -18
package/lib/tag/index.js
CHANGED
|
@@ -1,37 +1,32 @@
|
|
|
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 _babelHelperVueJsxMergeProps = _interopRequireDefault(require("@vue/babel-helper-vue-jsx-merge-props"));
|
|
9
|
-
|
|
10
7
|
var _utils = require("../utils");
|
|
11
|
-
|
|
12
8
|
var _functional = require("../utils/functional");
|
|
13
|
-
|
|
14
9
|
var _icon = _interopRequireDefault(require("../icon"));
|
|
15
|
-
|
|
16
10
|
// Utils
|
|
11
|
+
|
|
17
12
|
// Components
|
|
18
|
-
var _createNamespace = (0, _utils.createNamespace)('tag'),
|
|
19
|
-
createComponent = _createNamespace[0],
|
|
20
|
-
bem = _createNamespace[1];
|
|
21
13
|
|
|
14
|
+
// Types
|
|
15
|
+
|
|
16
|
+
var _createNamespace = (0, _utils.createNamespace)('tag'),
|
|
17
|
+
createComponent = _createNamespace[0],
|
|
18
|
+
bem = _createNamespace[1];
|
|
22
19
|
function Tag(h, props, slots, ctx) {
|
|
23
20
|
var _style;
|
|
24
|
-
|
|
25
21
|
var type = props.type,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
mark = props.mark,
|
|
23
|
+
plain = props.plain,
|
|
24
|
+
color = props.color,
|
|
25
|
+
round = props.round,
|
|
26
|
+
size = props.size,
|
|
27
|
+
textColor = props.textColor;
|
|
32
28
|
var key = plain ? 'color' : 'backgroundColor';
|
|
33
29
|
var style = (_style = {}, _style[key] = color, _style);
|
|
34
|
-
|
|
35
30
|
if (plain) {
|
|
36
31
|
style.color = textColor || color;
|
|
37
32
|
style.borderColor = color;
|
|
@@ -39,17 +34,14 @@ function Tag(h, props, slots, ctx) {
|
|
|
39
34
|
style.color = textColor;
|
|
40
35
|
style.background = color;
|
|
41
36
|
}
|
|
42
|
-
|
|
43
37
|
var classes = {
|
|
44
38
|
mark: mark,
|
|
45
39
|
plain: plain,
|
|
46
40
|
round: round
|
|
47
41
|
};
|
|
48
|
-
|
|
49
42
|
if (size) {
|
|
50
43
|
classes[size] = size;
|
|
51
44
|
}
|
|
52
|
-
|
|
53
45
|
var CloseIcon = props.closeable && h(_icon.default, {
|
|
54
46
|
"attrs": {
|
|
55
47
|
"name": "cross"
|
|
@@ -72,7 +64,6 @@ function Tag(h, props, slots, ctx) {
|
|
|
72
64
|
"class": bem([classes, type])
|
|
73
65
|
}, (0, _functional.inherit)(ctx, true)]), [slots.default == null ? void 0 : slots.default(), CloseIcon])]);
|
|
74
66
|
}
|
|
75
|
-
|
|
76
67
|
Tag.props = {
|
|
77
68
|
size: String,
|
|
78
69
|
mark: Boolean,
|
|
@@ -86,7 +77,5 @@ Tag.props = {
|
|
|
86
77
|
default: 'default'
|
|
87
78
|
}
|
|
88
79
|
};
|
|
89
|
-
|
|
90
80
|
var _default = createComponent(Tag);
|
|
91
|
-
|
|
92
81
|
exports.default = _default;
|
package/lib/timeline/index.js
CHANGED
|
@@ -1,31 +1,22 @@
|
|
|
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 _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
-
|
|
10
7
|
var _utils = require("../utils");
|
|
11
|
-
|
|
12
8
|
var _constant = require("../utils/constant");
|
|
13
|
-
|
|
14
9
|
var _switch = _interopRequireDefault(require("../switch"));
|
|
15
|
-
|
|
16
10
|
var _mediaPicker = _interopRequireDefault(require("../media-picker"));
|
|
17
|
-
|
|
18
11
|
var _createNamespace = (0, _utils.createNamespace)('timeline'),
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
createComponent = _createNamespace[0],
|
|
13
|
+
bem = _createNamespace[1];
|
|
22
14
|
var defaultData = function defaultData() {
|
|
23
15
|
return {
|
|
24
16
|
isFold: false,
|
|
25
17
|
computedProcesses: []
|
|
26
18
|
};
|
|
27
19
|
};
|
|
28
|
-
|
|
29
20
|
var _default2 = createComponent({
|
|
30
21
|
props: {
|
|
31
22
|
title: {
|
|
@@ -93,33 +84,28 @@ var _default2 = createComponent({
|
|
|
93
84
|
},
|
|
94
85
|
genProcesses: function genProcesses() {
|
|
95
86
|
var _this = this;
|
|
96
|
-
|
|
97
87
|
if (this.isFold) {
|
|
98
88
|
var showProcesses = this.computedProcesses.slice(0, this.collapseCount);
|
|
99
89
|
return showProcesses.map(function (item, index) {
|
|
100
90
|
return _this.genProcessItem(item, index === showProcesses.length - 1);
|
|
101
91
|
});
|
|
102
92
|
}
|
|
103
|
-
|
|
104
93
|
return this.computedProcesses.map(function (item, index) {
|
|
105
94
|
return _this.genProcessItem(item, index === _this.computedProcesses.length - 1);
|
|
106
95
|
});
|
|
107
96
|
},
|
|
108
97
|
genAvatar: function genAvatar(item, avatarSlot) {
|
|
109
98
|
var h = this.$createElement;
|
|
110
|
-
|
|
111
99
|
if (avatarSlot) {
|
|
112
100
|
return h("div", {
|
|
113
101
|
"class": bem("avatar-box") + " half-border"
|
|
114
102
|
}, [avatarSlot]);
|
|
115
103
|
}
|
|
116
|
-
|
|
117
104
|
if (this.dot) {
|
|
118
105
|
return h("div", {
|
|
119
106
|
"class": bem('dot')
|
|
120
107
|
});
|
|
121
108
|
}
|
|
122
|
-
|
|
123
109
|
return h("div", {
|
|
124
110
|
"class": bem("avatar-box" + " half-border")
|
|
125
111
|
}, [item.avatar ? h("img", {
|
|
@@ -140,13 +126,11 @@ var _default2 = createComponent({
|
|
|
140
126
|
},
|
|
141
127
|
genTitle: function genTitle(item, titleSlot) {
|
|
142
128
|
var h = this.$createElement;
|
|
143
|
-
|
|
144
129
|
if (titleSlot) {
|
|
145
130
|
return h("div", {
|
|
146
131
|
"class": bem("title-box")
|
|
147
132
|
}, [titleSlot]);
|
|
148
133
|
}
|
|
149
|
-
|
|
150
134
|
return h("div", {
|
|
151
135
|
"class": bem("title-box")
|
|
152
136
|
}, [h("span", {
|
|
@@ -157,13 +141,11 @@ var _default2 = createComponent({
|
|
|
157
141
|
},
|
|
158
142
|
genHuman: function genHuman(item, humanSlot) {
|
|
159
143
|
var h = this.$createElement;
|
|
160
|
-
|
|
161
144
|
if (humanSlot) {
|
|
162
145
|
return h("div", {
|
|
163
146
|
"class": bem("human-box") + " half-border-bottom"
|
|
164
147
|
}, [humanSlot]);
|
|
165
148
|
}
|
|
166
|
-
|
|
167
149
|
return h("div", {
|
|
168
150
|
"directives": [{
|
|
169
151
|
name: "show",
|
|
@@ -186,13 +168,11 @@ var _default2 = createComponent({
|
|
|
186
168
|
},
|
|
187
169
|
genContent: function genContent(item, contentSlot) {
|
|
188
170
|
var h = this.$createElement;
|
|
189
|
-
|
|
190
171
|
if (contentSlot) {
|
|
191
172
|
return h("div", {
|
|
192
173
|
"class": bem("content-box") + " half-border-bottom"
|
|
193
174
|
}, [contentSlot]);
|
|
194
175
|
}
|
|
195
|
-
|
|
196
176
|
return h("div", {
|
|
197
177
|
"class": bem("content-box" + " half-border-bottom")
|
|
198
178
|
}, [h("div", {
|
|
@@ -221,13 +201,11 @@ var _default2 = createComponent({
|
|
|
221
201
|
},
|
|
222
202
|
genOpinion: function genOpinion(item, opinionSlot) {
|
|
223
203
|
var h = this.$createElement;
|
|
224
|
-
|
|
225
204
|
if (opinionSlot) {
|
|
226
205
|
return h("div", {
|
|
227
206
|
"class": bem("opinion-box")
|
|
228
207
|
}, [opinionSlot]);
|
|
229
208
|
}
|
|
230
|
-
|
|
231
209
|
return h("div", {
|
|
232
210
|
"class": bem("opinion-box")
|
|
233
211
|
}, [h("div", {
|
|
@@ -252,7 +230,6 @@ var _default2 = createComponent({
|
|
|
252
230
|
},
|
|
253
231
|
genProcessItem: function genProcessItem(item, isLast) {
|
|
254
232
|
var _item$fileList;
|
|
255
|
-
|
|
256
233
|
var h = this.$createElement;
|
|
257
234
|
var avatarSlot = this.slots("avatar", item);
|
|
258
235
|
var titleSlot = this.slots("title", item);
|
|
@@ -260,15 +237,12 @@ var _default2 = createComponent({
|
|
|
260
237
|
var opinionSlot = this.slots("opinion", item);
|
|
261
238
|
var humanSlot = this.slots("human", item);
|
|
262
239
|
var that = this;
|
|
263
|
-
|
|
264
240
|
function itemClicked() {
|
|
265
241
|
if (!that.enableSingleFold) {
|
|
266
242
|
return;
|
|
267
243
|
}
|
|
268
|
-
|
|
269
244
|
item.folded = !item.folded;
|
|
270
245
|
}
|
|
271
|
-
|
|
272
246
|
return h("div", {
|
|
273
247
|
"class": bem("item") + (" " + (isLast ? "last-item" : "")),
|
|
274
248
|
"on": {
|
|
@@ -286,16 +260,13 @@ var _default2 = createComponent({
|
|
|
286
260
|
},
|
|
287
261
|
genTopBar: function genTopBar() {
|
|
288
262
|
var _this2 = this;
|
|
289
|
-
|
|
290
263
|
var h = this.$createElement;
|
|
291
264
|
var topBarSlot = this.slots("top-bar");
|
|
292
|
-
|
|
293
265
|
if (topBarSlot) {
|
|
294
266
|
return h("div", {
|
|
295
267
|
"class": [bem('top-bar'), _constant.BORDER_BOTTOM]
|
|
296
268
|
}, [topBarSlot]);
|
|
297
269
|
}
|
|
298
|
-
|
|
299
270
|
return h("div", {
|
|
300
271
|
"directives": [{
|
|
301
272
|
name: "show",
|
|
@@ -339,5 +310,4 @@ var _default2 = createComponent({
|
|
|
339
310
|
}, [processes]) : h()]);
|
|
340
311
|
}
|
|
341
312
|
});
|
|
342
|
-
|
|
343
313
|
exports.default = _default2;
|
package/lib/toast/Toast.js
CHANGED
|
@@ -1,31 +1,24 @@
|
|
|
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 _lockClick = require("./lock-click");
|
|
11
|
-
|
|
12
8
|
var _popup = require("../mixins/popup");
|
|
13
|
-
|
|
14
9
|
var _icon = _interopRequireDefault(require("../icon"));
|
|
15
|
-
|
|
16
10
|
var _loading = _interopRequireDefault(require("../loading"));
|
|
17
|
-
|
|
18
11
|
var _SuccessIcon = _interopRequireDefault(require("./svg/SuccessIcon"));
|
|
19
|
-
|
|
20
12
|
var _WarnIcon = _interopRequireDefault(require("./svg/WarnIcon"));
|
|
21
|
-
|
|
22
13
|
// Utils
|
|
14
|
+
|
|
23
15
|
// Mixins
|
|
16
|
+
|
|
24
17
|
// Components
|
|
25
|
-
var _createNamespace = (0, _utils.createNamespace)('toast'),
|
|
26
|
-
createComponent = _createNamespace[0],
|
|
27
|
-
bem = _createNamespace[1];
|
|
28
18
|
|
|
19
|
+
var _createNamespace = (0, _utils.createNamespace)('toast'),
|
|
20
|
+
createComponent = _createNamespace[0],
|
|
21
|
+
bem = _createNamespace[1];
|
|
29
22
|
var _default = createComponent({
|
|
30
23
|
mixins: [(0, _popup.PopupMixin)()],
|
|
31
24
|
props: {
|
|
@@ -76,17 +69,13 @@ var _default = createComponent({
|
|
|
76
69
|
},
|
|
77
70
|
toggleClickable: function toggleClickable() {
|
|
78
71
|
var clickable = this.value && this.forbidClick;
|
|
79
|
-
|
|
80
72
|
if (this.clickable !== clickable) {
|
|
81
73
|
this.clickable = clickable;
|
|
82
74
|
(0, _lockClick.lockClick)(clickable);
|
|
83
75
|
}
|
|
84
76
|
},
|
|
85
|
-
|
|
86
|
-
/* istanbul ignore next */
|
|
87
|
-
onAfterEnter: function onAfterEnter() {
|
|
77
|
+
/* istanbul ignore next */onAfterEnter: function onAfterEnter() {
|
|
88
78
|
this.$emit('opened');
|
|
89
|
-
|
|
90
79
|
if (this.onOpened) {
|
|
91
80
|
this.onOpened();
|
|
92
81
|
}
|
|
@@ -97,10 +86,9 @@ var _default = createComponent({
|
|
|
97
86
|
genIcon: function genIcon() {
|
|
98
87
|
var h = this.$createElement;
|
|
99
88
|
var icon = this.icon,
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
89
|
+
type = this.type,
|
|
90
|
+
iconPrefix = this.iconPrefix,
|
|
91
|
+
loadingType = this.loadingType;
|
|
104
92
|
if (icon) {
|
|
105
93
|
return h(_icon.default, {
|
|
106
94
|
"class": bem('icon'),
|
|
@@ -110,19 +98,16 @@ var _default = createComponent({
|
|
|
110
98
|
}
|
|
111
99
|
});
|
|
112
100
|
}
|
|
113
|
-
|
|
114
101
|
if (type === 'success') {
|
|
115
102
|
return h(_SuccessIcon.default, {
|
|
116
103
|
"class": bem('success')
|
|
117
104
|
});
|
|
118
105
|
}
|
|
119
|
-
|
|
120
106
|
if (type === 'fail') {
|
|
121
107
|
return h(_WarnIcon.default, {
|
|
122
108
|
"class": bem('fail')
|
|
123
109
|
});
|
|
124
110
|
}
|
|
125
|
-
|
|
126
111
|
if (type === 'loading') {
|
|
127
112
|
return h(_loading.default, {
|
|
128
113
|
"class": bem('loading'),
|
|
@@ -135,12 +120,10 @@ var _default = createComponent({
|
|
|
135
120
|
genMessage: function genMessage() {
|
|
136
121
|
var h = this.$createElement;
|
|
137
122
|
var type = this.type,
|
|
138
|
-
|
|
139
|
-
|
|
123
|
+
message = this.message;
|
|
140
124
|
if (!(0, _utils.isDef)(message) || message === '') {
|
|
141
125
|
return;
|
|
142
126
|
}
|
|
143
|
-
|
|
144
127
|
if (type === 'html') {
|
|
145
128
|
return h("div", {
|
|
146
129
|
"class": bem('text'),
|
|
@@ -149,7 +132,6 @@ var _default = createComponent({
|
|
|
149
132
|
}
|
|
150
133
|
});
|
|
151
134
|
}
|
|
152
|
-
|
|
153
135
|
return h("div", {
|
|
154
136
|
"class": bem('text')
|
|
155
137
|
}, [message]);
|
|
@@ -157,7 +139,6 @@ var _default = createComponent({
|
|
|
157
139
|
},
|
|
158
140
|
render: function render() {
|
|
159
141
|
var _ref;
|
|
160
|
-
|
|
161
142
|
var h = arguments[0];
|
|
162
143
|
return h("transition", {
|
|
163
144
|
"attrs": {
|
|
@@ -179,5 +160,4 @@ var _default = createComponent({
|
|
|
179
160
|
}, [this.genIcon(), this.genMessage()])]);
|
|
180
161
|
}
|
|
181
162
|
});
|
|
182
|
-
|
|
183
163
|
exports.default = _default;
|
package/lib/toast/index.js
CHANGED
|
@@ -1,20 +1,13 @@
|
|
|
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 _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
-
|
|
10
7
|
var _vue = _interopRequireDefault(require("vue"));
|
|
11
|
-
|
|
12
8
|
var _Toast = _interopRequireDefault(require("./Toast"));
|
|
13
|
-
|
|
14
9
|
var _utils = require("../utils");
|
|
15
|
-
|
|
16
10
|
var _node = require("../utils/dom/node");
|
|
17
|
-
|
|
18
11
|
var defaultOptions = {
|
|
19
12
|
icon: '',
|
|
20
13
|
type: 'text',
|
|
@@ -36,37 +29,32 @@ var defaultOptions = {
|
|
|
36
29
|
overlayStyle: null,
|
|
37
30
|
closeOnClick: false,
|
|
38
31
|
closeOnClickOverlay: false
|
|
39
|
-
};
|
|
32
|
+
};
|
|
40
33
|
|
|
34
|
+
// default options of specific type
|
|
41
35
|
var defaultOptionsMap = {};
|
|
42
36
|
var queue = [];
|
|
43
37
|
var multiple = false;
|
|
44
38
|
var currentOptions = (0, _extends2.default)({}, defaultOptions);
|
|
45
|
-
|
|
46
39
|
function parseOptions(message) {
|
|
47
40
|
if ((0, _utils.isObject)(message)) {
|
|
48
41
|
return message;
|
|
49
42
|
}
|
|
50
|
-
|
|
51
43
|
return {
|
|
52
44
|
message: message
|
|
53
45
|
};
|
|
54
46
|
}
|
|
55
|
-
|
|
56
47
|
function isInDocument(element) {
|
|
57
48
|
return document.body.contains(element);
|
|
58
49
|
}
|
|
59
|
-
|
|
60
50
|
function createInstance() {
|
|
61
51
|
/* istanbul ignore if */
|
|
62
52
|
if (_utils.isServer) {
|
|
63
53
|
return {};
|
|
64
54
|
}
|
|
65
|
-
|
|
66
55
|
queue = queue.filter(function (item) {
|
|
67
56
|
return !item.$el.parentNode || isInDocument(item.$el);
|
|
68
57
|
});
|
|
69
|
-
|
|
70
58
|
if (!queue.length || multiple) {
|
|
71
59
|
var toast = new (_vue.default.extend(_Toast.default))({
|
|
72
60
|
el: document.createElement('div')
|
|
@@ -76,11 +64,10 @@ function createInstance() {
|
|
|
76
64
|
});
|
|
77
65
|
queue.push(toast);
|
|
78
66
|
}
|
|
79
|
-
|
|
80
67
|
return queue[queue.length - 1];
|
|
81
|
-
}
|
|
82
|
-
|
|
68
|
+
}
|
|
83
69
|
|
|
70
|
+
// transform toast options to popup props
|
|
84
71
|
function transformOptions(options) {
|
|
85
72
|
return (0, _extends2.default)({}, options, {
|
|
86
73
|
overlay: options.mask || options.overlay,
|
|
@@ -88,33 +75,27 @@ function transformOptions(options) {
|
|
|
88
75
|
duration: undefined
|
|
89
76
|
});
|
|
90
77
|
}
|
|
91
|
-
|
|
92
78
|
function Toast(options) {
|
|
93
79
|
if (options === void 0) {
|
|
94
80
|
options = {};
|
|
95
81
|
}
|
|
82
|
+
var toast = createInstance();
|
|
96
83
|
|
|
97
|
-
|
|
98
|
-
|
|
84
|
+
// should add z-index if previous toast has not disappeared
|
|
99
85
|
if (toast.value) {
|
|
100
86
|
toast.updateZIndex();
|
|
101
87
|
}
|
|
102
|
-
|
|
103
88
|
options = parseOptions(options);
|
|
104
89
|
options = (0, _extends2.default)({}, currentOptions, defaultOptionsMap[options.type || currentOptions.type], options);
|
|
105
|
-
|
|
106
90
|
if (process.env.NODE_ENV === 'development' && options.mask) {
|
|
107
91
|
console.warn('[Zart] Toast: "mask" option is deprecated, use "overlay" option instead.');
|
|
108
92
|
}
|
|
109
|
-
|
|
110
93
|
options.clear = function () {
|
|
111
94
|
toast.value = false;
|
|
112
|
-
|
|
113
95
|
if (options.onClose) {
|
|
114
96
|
options.onClose();
|
|
115
97
|
options.onClose = null;
|
|
116
98
|
}
|
|
117
|
-
|
|
118
99
|
if (multiple && !_utils.isServer) {
|
|
119
100
|
toast.$on('closed', function () {
|
|
120
101
|
clearTimeout(toast.timer);
|
|
@@ -126,19 +107,15 @@ function Toast(options) {
|
|
|
126
107
|
});
|
|
127
108
|
}
|
|
128
109
|
};
|
|
129
|
-
|
|
130
110
|
(0, _extends2.default)(toast, transformOptions(options));
|
|
131
111
|
clearTimeout(toast.timer);
|
|
132
|
-
|
|
133
112
|
if (options.duration > 0) {
|
|
134
113
|
toast.timer = setTimeout(function () {
|
|
135
114
|
toast.clear();
|
|
136
115
|
}, options.duration);
|
|
137
116
|
}
|
|
138
|
-
|
|
139
117
|
return toast;
|
|
140
118
|
}
|
|
141
|
-
|
|
142
119
|
var createMethod = function createMethod(type) {
|
|
143
120
|
return function (options) {
|
|
144
121
|
return Toast((0, _extends2.default)({
|
|
@@ -146,11 +123,9 @@ var createMethod = function createMethod(type) {
|
|
|
146
123
|
}, parseOptions(options)));
|
|
147
124
|
};
|
|
148
125
|
};
|
|
149
|
-
|
|
150
126
|
['loading', 'success', 'fail'].forEach(function (method) {
|
|
151
127
|
Toast[method] = createMethod(method);
|
|
152
128
|
});
|
|
153
|
-
|
|
154
129
|
Toast.clear = function (all) {
|
|
155
130
|
if (queue.length) {
|
|
156
131
|
if (all) {
|
|
@@ -165,7 +140,6 @@ Toast.clear = function (all) {
|
|
|
165
140
|
}
|
|
166
141
|
}
|
|
167
142
|
};
|
|
168
|
-
|
|
169
143
|
Toast.setDefaultOptions = function (type, options) {
|
|
170
144
|
if (typeof type === 'string') {
|
|
171
145
|
defaultOptionsMap[type] = options;
|
|
@@ -173,7 +147,6 @@ Toast.setDefaultOptions = function (type, options) {
|
|
|
173
147
|
(0, _extends2.default)(currentOptions, type);
|
|
174
148
|
}
|
|
175
149
|
};
|
|
176
|
-
|
|
177
150
|
Toast.resetDefaultOptions = function (type) {
|
|
178
151
|
if (typeof type === 'string') {
|
|
179
152
|
defaultOptionsMap[type] = null;
|
|
@@ -182,23 +155,18 @@ Toast.resetDefaultOptions = function (type) {
|
|
|
182
155
|
defaultOptionsMap = {};
|
|
183
156
|
}
|
|
184
157
|
};
|
|
185
|
-
|
|
186
158
|
Toast.allowMultiple = function (value) {
|
|
187
159
|
if (value === void 0) {
|
|
188
160
|
value = true;
|
|
189
161
|
}
|
|
190
|
-
|
|
191
162
|
multiple = value;
|
|
192
163
|
};
|
|
193
|
-
|
|
194
164
|
Toast.install = function () {
|
|
195
165
|
_vue.default.use(_Toast.default);
|
|
196
166
|
};
|
|
197
|
-
|
|
198
167
|
if (typeof _vue.default.prototype.$toast === "undefined") {
|
|
199
168
|
_vue.default.prototype.$toast = Toast;
|
|
200
169
|
}
|
|
201
|
-
|
|
202
170
|
_vue.default.prototype.$ztToast = Toast;
|
|
203
171
|
var _default = Toast;
|
|
204
172
|
exports.default = _default;
|
package/lib/toast/lock-click.js
CHANGED
|
@@ -3,17 +3,14 @@
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.lockClick = lockClick;
|
|
5
5
|
var lockCount = 0;
|
|
6
|
-
|
|
7
6
|
function lockClick(lock) {
|
|
8
7
|
if (lock) {
|
|
9
8
|
if (!lockCount) {
|
|
10
9
|
document.body.classList.add('zt2-toast--unclickable');
|
|
11
10
|
}
|
|
12
|
-
|
|
13
11
|
lockCount++;
|
|
14
12
|
} else {
|
|
15
13
|
lockCount--;
|
|
16
|
-
|
|
17
14
|
if (!lockCount) {
|
|
18
15
|
document.body.classList.remove('zt2-toast--unclickable');
|
|
19
16
|
}
|