@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.
@@ -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/lib/form/Form.js CHANGED
@@ -71,7 +71,7 @@ var _default = (0, _vue.defineComponent)({
71
71
  }));
72
72
 
73
73
  if (props.scrollToError) {
74
- var [_, errorIndex] = (0, _shared.find)(res, r => r === false, props.scrollToError);
74
+ var [, errorIndex] = (0, _shared.find)(res, r => r === false, props.scrollToError);
75
75
  var hasError = errorIndex > -1;
76
76
 
77
77
  if (hasError) {
@@ -34,16 +34,13 @@ function render(_ctx, _cache) {
34
34
  return (0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", {
35
35
  ref: "freshNode",
36
36
  class: (0, _vue.normalizeClass)(_ctx.n()),
37
- onTouchstart: _cache[0] || (_cache[0] = function () {
38
- return _ctx.touchStart && _ctx.touchStart(...arguments);
39
- }),
40
- onTouchmove: _cache[1] || (_cache[1] = function () {
37
+ onTouchmove: _cache[0] || (_cache[0] = function () {
41
38
  return _ctx.touchMove && _ctx.touchMove(...arguments);
42
39
  }),
43
- onTouchend: _cache[2] || (_cache[2] = function () {
40
+ onTouchend: _cache[1] || (_cache[1] = function () {
44
41
  return _ctx.touchEnd && _ctx.touchEnd(...arguments);
45
42
  }),
46
- onTouchcancel: _cache[3] || (_cache[3] = function () {
43
+ onTouchcancel: _cache[2] || (_cache[2] = function () {
47
44
  return _ctx.touchEnd && _ctx.touchEnd(...arguments);
48
45
  })
49
46
  }, [(0, _vue.createElementVNode)("div", {
@@ -104,16 +101,21 @@ var _default = (0, _vue.defineComponent)({
104
101
  });
105
102
  };
106
103
 
107
- var touchStart = event => {
108
- if (!isTouchable.value) return;
109
- refreshStatus.value = 'pulling';
110
- startPosition.value = event.touches[0].clientY;
104
+ var lockEvent = action => {
105
+ var el = 'classList' in scroller ? scroller : document.body;
106
+ el.classList[action](n() + "--lock");
111
107
  };
112
108
 
113
109
  var touchMove = event => {
114
110
  var scrollTop = (0, _elements.getScrollTop)(scroller);
115
111
  if (scrollTop > 0 || !isTouchable.value) return;
116
- if (scrollTop === 0 && distance.value > controlPosition.value) event.cancelable && event.preventDefault();
112
+
113
+ if (refreshStatus.value !== 'pulling') {
114
+ refreshStatus.value = 'pulling';
115
+ startPosition.value = event.touches[0].clientY;
116
+ }
117
+
118
+ if (scrollTop === 0 && distance.value > controlPosition.value) lockEvent('add');
117
119
  var moveDistance = (event.touches[0].clientY - startPosition.value) / 2 + controlPosition.value;
118
120
  distance.value = moveDistance >= maxDistance.value ? maxDistance.value : moveDistance;
119
121
 
@@ -137,12 +139,14 @@ var _default = (0, _vue.defineComponent)({
137
139
  distance.value = maxDistance.value * 0.3;
138
140
  (0, _components.call)(props['onUpdate:modelValue'], true);
139
141
  (0, _components.call)(props.onRefresh);
142
+ lockEvent('remove');
140
143
  } else {
141
144
  refreshStatus.value = 'loosing';
142
145
  iconName.value = 'arrow-down';
143
146
  distance.value = controlPosition.value;
144
147
  setTimeout(() => {
145
148
  isEnd.value = false;
149
+ lockEvent('remove');
146
150
  }, (0, _shared.toNumber)(props.animationDuration));
147
151
  }
148
152
  });
@@ -191,7 +195,6 @@ var _default = (0, _vue.defineComponent)({
191
195
  refreshStatus,
192
196
  freshNode,
193
197
  controlNode,
194
- touchStart,
195
198
  touchMove,
196
199
  touchEnd,
197
200
  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); }}