@varlet/ui 2.5.2 → 2.5.4
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/back-top/BackTop.js +3 -23
- package/es/menu/menu.css +1 -1
- package/es/pull-refresh/PullRefresh.js +2 -2
- package/es/pull-refresh/props.js +3 -0
- package/es/style.css +1 -1
- package/es/utils/elements.js +15 -1
- package/es/varlet.esm.js +1269 -1268
- package/highlight/attributes.json +4 -0
- package/highlight/tags.json +1 -0
- package/highlight/web-types.json +10 -1
- package/lib/back-top/BackTop.js +1 -21
- package/lib/menu/menu.css +1 -1
- package/lib/pull-refresh/PullRefresh.js +1 -1
- package/lib/pull-refresh/props.js +3 -0
- package/lib/style.css +1 -1
- package/lib/utils/elements.js +16 -0
- package/package.json +7 -7
- package/types/pullRefresh.d.ts +1 -0
- package/umd/varlet.js +7 -7
package/lib/utils/elements.js
CHANGED
|
@@ -9,6 +9,7 @@ exports.getLeft = getLeft;
|
|
|
9
9
|
exports.getParentScroller = getParentScroller;
|
|
10
10
|
exports.getScrollLeft = getScrollLeft;
|
|
11
11
|
exports.getScrollTop = getScrollTop;
|
|
12
|
+
exports.getTarget = getTarget;
|
|
12
13
|
exports.getTop = getTop;
|
|
13
14
|
exports.getTranslate = getTranslate;
|
|
14
15
|
exports.inViewport = inViewport;
|
|
@@ -122,6 +123,21 @@ function getAllParentScroller(el) {
|
|
|
122
123
|
}
|
|
123
124
|
|
|
124
125
|
return allParentScroller;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function getTarget(target, componentName) {
|
|
129
|
+
if ((0, _shared.isString)(target)) {
|
|
130
|
+
var el = document.querySelector(target);
|
|
131
|
+
|
|
132
|
+
if (!el) {
|
|
133
|
+
throw Error("[Varlet] " + componentName + ": target element cannot found");
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return el;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
if ((0, _shared.isObject)(target)) return target;
|
|
140
|
+
throw Error("[Varlet] " + componentName + ": type of prop \"target\" should be a selector or an element object");
|
|
125
141
|
} // example 1rem
|
|
126
142
|
|
|
127
143
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@varlet/ui",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.4",
|
|
4
4
|
"description": "A material like components library",
|
|
5
5
|
"module": "es/index.js",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -45,15 +45,17 @@
|
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@popperjs/core": "^2.11.6",
|
|
48
|
+
"@varlet/icons": "2.5.4",
|
|
49
|
+
"@varlet/shared": "2.5.4",
|
|
48
50
|
"dayjs": "^1.10.4",
|
|
49
|
-
"decimal.js": "^10.2.1"
|
|
50
|
-
"@varlet/icons": "2.5.2",
|
|
51
|
-
"@varlet/shared": "2.5.2"
|
|
51
|
+
"decimal.js": "^10.2.1"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@types/jest": "^26.0.15",
|
|
55
55
|
"@types/lodash-es": "^4.17.6",
|
|
56
56
|
"@types/node": "^18.7.18",
|
|
57
|
+
"@varlet/cli": "2.5.4",
|
|
58
|
+
"@varlet/touch-emulator": "2.5.4",
|
|
57
59
|
"@vue/runtime-core": "3.2.25",
|
|
58
60
|
"@vue/test-utils": "^2.0.2",
|
|
59
61
|
"clipboard": "^2.0.6",
|
|
@@ -62,9 +64,7 @@
|
|
|
62
64
|
"postcss-px-to-viewport": "^1.1.1",
|
|
63
65
|
"typescript": "^4.4.4",
|
|
64
66
|
"vue": "3.2.25",
|
|
65
|
-
"vue-router": "4.0.12"
|
|
66
|
-
"@varlet/cli": "2.5.2",
|
|
67
|
-
"@varlet/touch-emulator": "2.5.2"
|
|
67
|
+
"vue-router": "4.0.12"
|
|
68
68
|
},
|
|
69
69
|
"browserslist": [
|
|
70
70
|
"Chrome >= 54",
|
package/types/pullRefresh.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export interface PullRefreshProps extends BasicAttributes {
|
|
|
10
10
|
successBgColor?: string
|
|
11
11
|
color?: string
|
|
12
12
|
successColor?: string
|
|
13
|
+
target?: string | HTMLElement
|
|
13
14
|
onRefresh?: ListenerProp<() => void>
|
|
14
15
|
'onUpdate:modelValue'?: ListenerProp<(value: boolean) => void>
|
|
15
16
|
}
|