@varlet/ui 2.5.5-alpha.1672917688708 → 2.5.5
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.css +1 -1
- package/es/form/Form.js +1 -1
- package/es/pull-refresh/PullRefresh.js +15 -12
- package/es/pull-refresh/pullRefresh.css +1 -1
- package/es/style.css +1 -1
- package/es/styles/common.css +1 -1
- package/es/varlet.esm.js +1546 -1549
- package/lib/back-top/backTop.css +1 -1
- package/lib/form/Form.js +1 -1
- package/lib/pull-refresh/PullRefresh.js +15 -12
- package/lib/pull-refresh/pullRefresh.css +1 -1
- package/lib/style.css +1 -1
- package/lib/styles/common.css +1 -1
- package/package.json +5 -5
- package/umd/varlet.js +7 -7
package/es/back-top/backTop.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root { --back-top-right: 40px; --back-top-bottom: 40px; --back-top-button-size: 40px;}.var-back-top { position: fixed; right: var(--back-top-right); bottom: var(--back-top-bottom); transform: scale(0); transition: 0.3s var(--cubic-bezier); -webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.var-back-top .var-button[var-back-top-cover] { width: var(--back-top-button-size); height: var(--back-top-button-size);}.var-back-top--active { transform: scale(1);}
|
|
1
|
+
:root { --back-top-right: 40px; --back-top-bottom: 40px; --back-top-button-size: 40px;}.var-back-top { position: fixed; z-index: 100; right: var(--back-top-right); bottom: var(--back-top-bottom); transform: scale(0); transition: 0.3s var(--cubic-bezier); -webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.var-back-top .var-button[var-back-top-cover] { width: var(--back-top-button-size); height: var(--back-top-button-size);}.var-back-top--active { transform: scale(1);}
|
package/es/form/Form.js
CHANGED
|
@@ -57,7 +57,7 @@ export default defineComponent({
|
|
|
57
57
|
}));
|
|
58
58
|
|
|
59
59
|
if (props.scrollToError) {
|
|
60
|
-
var [
|
|
60
|
+
var [, errorIndex] = find(res, r => r === false, props.scrollToError);
|
|
61
61
|
var hasError = errorIndex > -1;
|
|
62
62
|
|
|
63
63
|
if (hasError) {
|
|
@@ -20,16 +20,13 @@ export function render(_ctx, _cache) {
|
|
|
20
20
|
return _openBlock(), _createElementBlock("div", {
|
|
21
21
|
ref: "freshNode",
|
|
22
22
|
class: _normalizeClass(_ctx.n()),
|
|
23
|
-
|
|
24
|
-
return _ctx.touchStart && _ctx.touchStart(...arguments);
|
|
25
|
-
}),
|
|
26
|
-
onTouchmove: _cache[1] || (_cache[1] = function () {
|
|
23
|
+
onTouchmove: _cache[0] || (_cache[0] = function () {
|
|
27
24
|
return _ctx.touchMove && _ctx.touchMove(...arguments);
|
|
28
25
|
}),
|
|
29
|
-
onTouchend: _cache[
|
|
26
|
+
onTouchend: _cache[1] || (_cache[1] = function () {
|
|
30
27
|
return _ctx.touchEnd && _ctx.touchEnd(...arguments);
|
|
31
28
|
}),
|
|
32
|
-
onTouchcancel: _cache[
|
|
29
|
+
onTouchcancel: _cache[2] || (_cache[2] = function () {
|
|
33
30
|
return _ctx.touchEnd && _ctx.touchEnd(...arguments);
|
|
34
31
|
})
|
|
35
32
|
}, [_createElementVNode("div", {
|
|
@@ -89,16 +86,21 @@ export default defineComponent({
|
|
|
89
86
|
});
|
|
90
87
|
};
|
|
91
88
|
|
|
92
|
-
var
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
startPosition.value = event.touches[0].clientY;
|
|
89
|
+
var lockEvent = action => {
|
|
90
|
+
var el = 'classList' in scroller ? scroller : document.body;
|
|
91
|
+
el.classList[action](n() + "--lock");
|
|
96
92
|
};
|
|
97
93
|
|
|
98
94
|
var touchMove = event => {
|
|
99
95
|
var scrollTop = getScrollTop(scroller);
|
|
100
96
|
if (scrollTop > 0 || !isTouchable.value) return;
|
|
101
|
-
|
|
97
|
+
|
|
98
|
+
if (refreshStatus.value !== 'pulling') {
|
|
99
|
+
refreshStatus.value = 'pulling';
|
|
100
|
+
startPosition.value = event.touches[0].clientY;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if (scrollTop === 0 && distance.value > controlPosition.value) lockEvent('add');
|
|
102
104
|
var moveDistance = (event.touches[0].clientY - startPosition.value) / 2 + controlPosition.value;
|
|
103
105
|
distance.value = moveDistance >= maxDistance.value ? maxDistance.value : moveDistance;
|
|
104
106
|
|
|
@@ -122,12 +124,14 @@ export default defineComponent({
|
|
|
122
124
|
distance.value = maxDistance.value * 0.3;
|
|
123
125
|
call(props['onUpdate:modelValue'], true);
|
|
124
126
|
call(props.onRefresh);
|
|
127
|
+
lockEvent('remove');
|
|
125
128
|
} else {
|
|
126
129
|
refreshStatus.value = 'loosing';
|
|
127
130
|
iconName.value = 'arrow-down';
|
|
128
131
|
distance.value = controlPosition.value;
|
|
129
132
|
setTimeout(() => {
|
|
130
133
|
isEnd.value = false;
|
|
134
|
+
lockEvent('remove');
|
|
131
135
|
}, toNumber(props.animationDuration));
|
|
132
136
|
}
|
|
133
137
|
});
|
|
@@ -176,7 +180,6 @@ export default defineComponent({
|
|
|
176
180
|
refreshStatus,
|
|
177
181
|
freshNode,
|
|
178
182
|
controlNode,
|
|
179
|
-
touchStart,
|
|
180
183
|
touchMove,
|
|
181
184
|
touchEnd,
|
|
182
185
|
iconName,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:root { --pull-refresh-size: 40px; --pull-refresh-background: #fff; --pull-refresh-color: var(--color-primary); --pull-refresh-success-color: var(--color-success); --pull-refresh-icon-size: 25px;}.var-pull-refresh { overflow: hidden; position: relative; user-select: none; width: 100%;}.var-pull-refresh__control { display: flex; width: var(--pull-refresh-size); height: var(--pull-refresh-size); align-items: center; justify-content: center; background-color: var(--pull-refresh-background); border-radius: 50%; position: absolute; left: 50%; z-index: 90; color: var(--pull-refresh-color);}.var-pull-refresh__control-success { color: var(--pull-refresh-success-color);}.var-pull-refresh__icon[var-pull-refresh-cover] { font-size: var(--pull-refresh-icon-size);}.var-pull-refresh__animation { transform: rotate(0deg); animation: iconRotate 0.6s infinite linear;}@keyframes iconRotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); }}
|
|
1
|
+
:root { --pull-refresh-size: 40px; --pull-refresh-background: #fff; --pull-refresh-color: var(--color-primary); --pull-refresh-success-color: var(--color-success); --pull-refresh-icon-size: 25px;}.var-pull-refresh { overflow: hidden; position: relative; user-select: none; width: 100%;}.var-pull-refresh__control { display: flex; width: var(--pull-refresh-size); height: var(--pull-refresh-size); align-items: center; justify-content: center; background-color: var(--pull-refresh-background); border-radius: 50%; position: absolute; left: 50%; z-index: 90; color: var(--pull-refresh-color);}.var-pull-refresh__control-success { color: var(--pull-refresh-success-color);}.var-pull-refresh__icon[var-pull-refresh-cover] { font-size: var(--pull-refresh-icon-size);}.var-pull-refresh__animation { transform: rotate(0deg); animation: iconRotate 0.6s infinite linear;}.var-pull-refresh--lock { overflow: hidden !important;}@keyframes iconRotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); }}
|