@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
|
@@ -1283,6 +1283,10 @@
|
|
|
1283
1283
|
"type": "boolean",
|
|
1284
1284
|
"description": "是否禁用下拉刷新 默认值:false"
|
|
1285
1285
|
},
|
|
1286
|
+
"var-pull-refresh/target": {
|
|
1287
|
+
"type": "string | HTMLElement",
|
|
1288
|
+
"description": "触发滚动的对象,如果为 undefined 会监听距离最近的一个可滚动的祖先节点 默认值:-"
|
|
1289
|
+
},
|
|
1286
1290
|
"var-pull-refresh/animation-duration": {
|
|
1287
1291
|
"type": "string | number",
|
|
1288
1292
|
"description": "加载结束后回到初始位置的动画时长(ms) 默认值:300"
|
package/highlight/tags.json
CHANGED
package/highlight/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3
3
|
"framework": "vue",
|
|
4
|
-
"version": "2.5.
|
|
4
|
+
"version": "2.5.3",
|
|
5
5
|
"name": "VARLET",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -3836,6 +3836,15 @@
|
|
|
3836
3836
|
"kind": "expression"
|
|
3837
3837
|
}
|
|
3838
3838
|
},
|
|
3839
|
+
{
|
|
3840
|
+
"name": "target",
|
|
3841
|
+
"description": "触发滚动的对象,如果为 undefined 会监听距离最近的一个可滚动的祖先节点",
|
|
3842
|
+
"default": "-",
|
|
3843
|
+
"value": {
|
|
3844
|
+
"type": "string | HTMLElement",
|
|
3845
|
+
"kind": "expression"
|
|
3846
|
+
}
|
|
3847
|
+
},
|
|
3839
3848
|
{
|
|
3840
3849
|
"name": "animation-duration",
|
|
3841
3850
|
"description": "加载结束后回到初始位置的动画时长(ms)",
|
package/lib/back-top/BackTop.js
CHANGED
|
@@ -95,28 +95,8 @@ var _default = (0, _vue.defineComponent)({
|
|
|
95
95
|
};
|
|
96
96
|
|
|
97
97
|
var throttleScroll = (0, _shared.throttle)(scroll, 200);
|
|
98
|
-
|
|
99
|
-
var getTarget = () => {
|
|
100
|
-
var {
|
|
101
|
-
target
|
|
102
|
-
} = props;
|
|
103
|
-
|
|
104
|
-
if ((0, _shared.isString)(target)) {
|
|
105
|
-
var el = document.querySelector(props.target);
|
|
106
|
-
|
|
107
|
-
if (!el) {
|
|
108
|
-
throw Error('[Varlet] BackTop: target element cannot found');
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
return el;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
if ((0, _shared.isObject)(target)) return target;
|
|
115
|
-
throw Error('[Varlet] BackTop: type of prop "target" should be a selector or an element object');
|
|
116
|
-
};
|
|
117
|
-
|
|
118
98
|
(0, _vue.onMounted)(() => {
|
|
119
|
-
target = props.target ? getTarget() : (0, _elements.getParentScroller)(backTopEl.value);
|
|
99
|
+
target = props.target ? (0, _elements.getTarget)(props.target, 'BackTop') : (0, _elements.getParentScroller)(backTopEl.value);
|
|
120
100
|
target.addEventListener('scroll', throttleScroll);
|
|
121
101
|
disabled.value = false;
|
|
122
102
|
});
|
package/lib/menu/menu.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root { --menu-background-color: #fff;}.var-menu-enter-from,.var-menu-leave-to { opacity: 0;}.var-menu-enter-active,.var-menu-leave-active { transition-property: opacity; transition-duration: 0.25s;}.var-menu { display: inline-block;}.var-
|
|
1
|
+
:root { --menu-background-color: #fff;}.var-menu-enter-from,.var-menu-leave-to { opacity: 0;}.var-menu-enter-active,.var-menu-leave-active { transition-property: opacity; transition-duration: 0.25s;}.var-menu { display: inline-block;}.var-menu--menu-background-color { background: var(--menu-background-color); transition: opacity 0.25s, background-color 0.25s;}
|
|
@@ -180,7 +180,7 @@ var _default = (0, _vue.defineComponent)({
|
|
|
180
180
|
}
|
|
181
181
|
});
|
|
182
182
|
(0, _vue.onMounted)(() => {
|
|
183
|
-
scroller = (0, _elements.getParentScroller)(freshNode.value);
|
|
183
|
+
scroller = props.target ? (0, _elements.getTarget)(props.target, 'PullRefresh') : (0, _elements.getParentScroller)(freshNode.value);
|
|
184
184
|
setPosition();
|
|
185
185
|
});
|
|
186
186
|
return {
|