iov-design 2.15.82 → 2.15.83
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/lib/image.js +5 -4
- package/lib/index.js +1 -1
- package/lib/iov-design.common.js +41 -18
- package/lib/message.js +26 -4
- package/lib/theme-chalk/image.css +1 -1
- package/lib/theme-chalk/index.css +1 -1
- package/lib/utils/popper.js +6 -1
- package/lib/utils/vue-popper.js +8 -1
- package/package.json +1 -1
- package/packages/image/src/main.vue +3 -2
- package/packages/message/src/main.js +23 -0
- package/packages/message/src/main.vue +2 -1
- package/packages/theme-chalk/src/image.scss +7 -0
- package/src/index.js +1 -1
- package/src/utils/popper.js +5 -1
- package/src/utils/vue-popper.js +8 -1
package/lib/utils/popper.js
CHANGED
|
@@ -48,7 +48,9 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
|
|
|
48
48
|
|
|
49
49
|
'use strict';
|
|
50
50
|
|
|
51
|
-
var root = window;
|
|
51
|
+
// var root = window;
|
|
52
|
+
|
|
53
|
+
var root = window.__POWERED_BY_WUJIE__ ? window.parent : window;
|
|
52
54
|
|
|
53
55
|
// default options
|
|
54
56
|
var DEFAULTS = {
|
|
@@ -1017,6 +1019,9 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
|
|
|
1017
1019
|
*/
|
|
1018
1020
|
function getStyleComputedProperty(element, property) {
|
|
1019
1021
|
// NOTE: 1 DOM access here
|
|
1022
|
+
// var css = root.getComputedStyle(element, null);
|
|
1023
|
+
// return css[property];
|
|
1024
|
+
if (window.__POWERED_BY_WUJIE__ && element.nodeType === 9) return 'static';
|
|
1020
1025
|
var css = root.getComputedStyle(element, null);
|
|
1021
1026
|
return css[property];
|
|
1022
1027
|
}
|
package/lib/utils/vue-popper.js
CHANGED
|
@@ -106,7 +106,14 @@ exports.default = {
|
|
|
106
106
|
|
|
107
107
|
if (!popper || !reference) return;
|
|
108
108
|
if (this.visibleArrow) this.appendArrow(popper);
|
|
109
|
-
if (this.appendToBody) document.body.appendChild(this.popperElm);
|
|
109
|
+
// if (this.appendToBody) document.body.appendChild(this.popperElm);
|
|
110
|
+
if (this.appendToBody) {
|
|
111
|
+
if (window.__POWERED_BY_WUJIE__) {
|
|
112
|
+
window.parent.document.body.appendChild(this.popperElm);
|
|
113
|
+
} else {
|
|
114
|
+
document.body.appendChild(this.popperElm);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
110
117
|
if (this.popperJS && this.popperJS.destroy) {
|
|
111
118
|
this.popperJS.destroy();
|
|
112
119
|
}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="el-image">
|
|
2
|
+
<div class="el-image" :class="{'el-image__border': border}">
|
|
3
3
|
<slot v-if="loading" name="placeholder">
|
|
4
4
|
<div class="el-image__placeholder"></div>
|
|
5
5
|
</slot>
|
|
@@ -63,7 +63,8 @@
|
|
|
63
63
|
type: Number,
|
|
64
64
|
default: 2000
|
|
65
65
|
},
|
|
66
|
-
initialIndex: Number
|
|
66
|
+
initialIndex: Number,
|
|
67
|
+
border: Boolean
|
|
67
68
|
},
|
|
68
69
|
|
|
69
70
|
data() {
|
|
@@ -14,9 +14,30 @@ const Message = function(options) {
|
|
|
14
14
|
options = options || {};
|
|
15
15
|
if (typeof options === 'string') {
|
|
16
16
|
options = {
|
|
17
|
+
grouping: true,
|
|
17
18
|
message: options
|
|
18
19
|
};
|
|
20
|
+
} else {
|
|
21
|
+
options = {
|
|
22
|
+
grouping: true,
|
|
23
|
+
...options
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
// ========== grouping 逻辑 ==========
|
|
27
|
+
if (options.grouping) {
|
|
28
|
+
const last = instances[instances.length - 1];
|
|
29
|
+
|
|
30
|
+
// 字符串形式时
|
|
31
|
+
const messageStr = typeof options === 'string'
|
|
32
|
+
? options
|
|
33
|
+
: options.message;
|
|
34
|
+
|
|
35
|
+
if (last && !last.closed && last.message === messageStr) {
|
|
36
|
+
last.repeatNum++;
|
|
37
|
+
return last; // 直接返回,不创建新 toast
|
|
38
|
+
}
|
|
19
39
|
}
|
|
40
|
+
// =================================================
|
|
20
41
|
let userOnClose = options.onClose;
|
|
21
42
|
let id = 'message_' + seed++;
|
|
22
43
|
|
|
@@ -48,11 +69,13 @@ const Message = function(options) {
|
|
|
48
69
|
Message[type] = (options) => {
|
|
49
70
|
if (isObject(options) && !isVNode(options)) {
|
|
50
71
|
return Message({
|
|
72
|
+
grouping: true,
|
|
51
73
|
...options,
|
|
52
74
|
type
|
|
53
75
|
});
|
|
54
76
|
}
|
|
55
77
|
return Message({
|
|
78
|
+
grouping: true,
|
|
56
79
|
type,
|
|
57
80
|
message: options
|
|
58
81
|
});
|
|
@@ -11,6 +11,13 @@
|
|
|
11
11
|
display: inline-block;
|
|
12
12
|
overflow: hidden;
|
|
13
13
|
|
|
14
|
+
@include e(border) {
|
|
15
|
+
border: 1px solid $--color-line-2;
|
|
16
|
+
border-radius: 4px;
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
box-sizing: border-box;
|
|
19
|
+
}
|
|
20
|
+
|
|
14
21
|
@include e(inner) {
|
|
15
22
|
@extend %size;
|
|
16
23
|
vertical-align: top;
|
package/src/index.js
CHANGED
package/src/utils/popper.js
CHANGED
|
@@ -44,7 +44,8 @@
|
|
|
44
44
|
|
|
45
45
|
'use strict';
|
|
46
46
|
|
|
47
|
-
var root = window;
|
|
47
|
+
// var root = window;
|
|
48
|
+
var root = window.__POWERED_BY_WUJIE__ ? window.parent : window;
|
|
48
49
|
|
|
49
50
|
// default options
|
|
50
51
|
var DEFAULTS = {
|
|
@@ -1026,6 +1027,9 @@
|
|
|
1026
1027
|
*/
|
|
1027
1028
|
function getStyleComputedProperty(element, property) {
|
|
1028
1029
|
// NOTE: 1 DOM access here
|
|
1030
|
+
// var css = root.getComputedStyle(element, null);
|
|
1031
|
+
// return css[property];
|
|
1032
|
+
if (window.__POWERED_BY_WUJIE__ && element.nodeType === 9) return 'static';
|
|
1029
1033
|
var css = root.getComputedStyle(element, null);
|
|
1030
1034
|
return css[property];
|
|
1031
1035
|
}
|
package/src/utils/vue-popper.js
CHANGED
|
@@ -96,7 +96,14 @@ export default {
|
|
|
96
96
|
|
|
97
97
|
if (!popper || !reference) return;
|
|
98
98
|
if (this.visibleArrow) this.appendArrow(popper);
|
|
99
|
-
if (this.appendToBody) document.body.appendChild(this.popperElm);
|
|
99
|
+
// if (this.appendToBody) document.body.appendChild(this.popperElm);
|
|
100
|
+
if (this.appendToBody) {
|
|
101
|
+
if (window.__POWERED_BY_WUJIE__) {
|
|
102
|
+
window.parent.document.body.appendChild(this.popperElm);
|
|
103
|
+
} else {
|
|
104
|
+
document.body.appendChild(this.popperElm);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
100
107
|
if (this.popperJS && this.popperJS.destroy) {
|
|
101
108
|
this.popperJS.destroy();
|
|
102
109
|
}
|