@varlet/ui 2.11.0-alpha.1683829480300 → 2.11.0
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/index-bar/IndexBar.mjs +5 -8
- package/es/index.bundle.mjs +1 -1
- package/es/index.mjs +1 -1
- package/es/slider/Slider.mjs +1 -1
- package/es/slider/slider.css +1 -1
- package/es/snackbar/style/index.mjs +1 -1
- package/es/style.css +1 -1
- package/es/utils/elements.mjs +1 -1
- package/es/utils/jest.mjs +7 -6
- package/es/varlet.esm.js +432 -432
- package/highlight/web-types.en-US.json +2 -2
- package/highlight/web-types.zh-CN.json +2 -2
- package/lib/style.css +1 -1
- package/lib/varlet.cjs.js +6 -7
- package/package.json +7 -7
- package/umd/varlet.js +5 -5
package/es/utils/elements.mjs
CHANGED
|
@@ -2,7 +2,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
2
2
|
|
|
3
3
|
import { isNumber, isObject, isString, kebabCase, toNumber, isWindow } from '@varlet/shared';
|
|
4
4
|
import { getGlobalThis } from './shared.mjs';
|
|
5
|
-
import { error } from '
|
|
5
|
+
import { error } from './logger.mjs';
|
|
6
6
|
// shorthand only
|
|
7
7
|
export function getStyle(element) {
|
|
8
8
|
return window.getComputedStyle(element);
|
package/es/utils/jest.mjs
CHANGED
|
@@ -5,6 +5,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
|
5
5
|
import { nextTick } from 'vue';
|
|
6
6
|
import { config } from '@vue/test-utils';
|
|
7
7
|
import { isPlainObject } from '@varlet/shared';
|
|
8
|
+
import { getStyle } from './elements.mjs';
|
|
8
9
|
export var delay = time => new Promise(resolve => setTimeout(resolve, time));
|
|
9
10
|
export function getTouch(el, x, y) {
|
|
10
11
|
return {
|
|
@@ -83,37 +84,37 @@ export function mockOffset(_temp) {
|
|
|
83
84
|
Object.defineProperties(HTMLElement.prototype, {
|
|
84
85
|
offsetWidth: {
|
|
85
86
|
get() {
|
|
86
|
-
return offsetWidth != null ? offsetWidth : parseFloat(
|
|
87
|
+
return offsetWidth != null ? offsetWidth : parseFloat(getStyle(this).width) || 0;
|
|
87
88
|
}
|
|
88
89
|
|
|
89
90
|
},
|
|
90
91
|
offsetHeight: {
|
|
91
92
|
get() {
|
|
92
|
-
return offsetHeight != null ? offsetHeight : parseFloat(
|
|
93
|
+
return offsetHeight != null ? offsetHeight : parseFloat(getStyle(this).height) || 0;
|
|
93
94
|
}
|
|
94
95
|
|
|
95
96
|
},
|
|
96
97
|
clientWidth: {
|
|
97
98
|
get() {
|
|
98
|
-
return clientWidth != null ? clientWidth : parseFloat(
|
|
99
|
+
return clientWidth != null ? clientWidth : parseFloat(getStyle(this).width) || 0;
|
|
99
100
|
}
|
|
100
101
|
|
|
101
102
|
},
|
|
102
103
|
clientHeight: {
|
|
103
104
|
get() {
|
|
104
|
-
return clientHeight != null ? clientHeight : parseFloat(
|
|
105
|
+
return clientHeight != null ? clientHeight : parseFloat(getStyle(this).height) || 0;
|
|
105
106
|
}
|
|
106
107
|
|
|
107
108
|
},
|
|
108
109
|
offsetLeft: {
|
|
109
110
|
get() {
|
|
110
|
-
return offsetLeft != null ? offsetLeft : parseFloat(
|
|
111
|
+
return offsetLeft != null ? offsetLeft : parseFloat(getStyle(this).marginLeft) || 0;
|
|
111
112
|
}
|
|
112
113
|
|
|
113
114
|
},
|
|
114
115
|
offsetTop: {
|
|
115
116
|
get() {
|
|
116
|
-
return offsetTop != null ? offsetTop : parseFloat(
|
|
117
|
+
return offsetTop != null ? offsetTop : parseFloat(getStyle(this).marginTop) || 0;
|
|
117
118
|
}
|
|
118
119
|
|
|
119
120
|
},
|