@varlet/ui 2.9.5 → 2.9.6
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/action-sheet/index.mjs +6 -11
- package/es/checkbox/checkbox.css +1 -1
- package/es/date-picker/src/day-picker-panel.mjs +6 -4
- package/es/date-picker/src/month-picker-panel.mjs +4 -3
- package/es/dialog/Dialog.mjs +3 -3
- package/es/dialog/index.mjs +6 -12
- package/es/index.bundle.mjs +1 -1
- package/es/index.mjs +1 -1
- package/es/pagination/Pagination.mjs +58 -38
- package/es/picker/index.mjs +1 -1
- package/es/pull-refresh/PullRefresh.mjs +27 -26
- package/es/radio/radio.css +1 -1
- package/es/snackbar/style/index.mjs +1 -1
- package/es/style.css +1 -1
- package/es/varlet.esm.js +3963 -3954
- package/highlight/web-types.en-US.json +3 -3
- package/highlight/web-types.zh-CN.json +3 -3
- package/lib/style.css +1 -1
- package/lib/varlet.cjs.js +146 -150
- package/package.json +6 -6
- package/umd/varlet.js +5 -5
|
@@ -53,15 +53,15 @@ function ActionSheet(options) {
|
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
function
|
|
56
|
+
ActionSheet.setDefaultOptions = function (options) {
|
|
57
57
|
defaultOptions = options;
|
|
58
|
-
}
|
|
58
|
+
};
|
|
59
59
|
|
|
60
|
-
function
|
|
60
|
+
ActionSheet.resetDefaultOptions = function () {
|
|
61
61
|
defaultOptions = {};
|
|
62
|
-
}
|
|
62
|
+
};
|
|
63
63
|
|
|
64
|
-
function
|
|
64
|
+
ActionSheet.close = function () {
|
|
65
65
|
if (singletonOptions != null) {
|
|
66
66
|
var prevSingletonOptions = singletonOptions;
|
|
67
67
|
singletonOptions = null;
|
|
@@ -69,7 +69,7 @@ function close() {
|
|
|
69
69
|
prevSingletonOptions.show = false;
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
|
-
}
|
|
72
|
+
};
|
|
73
73
|
|
|
74
74
|
ActionSheet.Component = VarActionSheet;
|
|
75
75
|
|
|
@@ -81,11 +81,6 @@ ActionSheet.install = function (app) {
|
|
|
81
81
|
app.component(VarActionSheet.name, VarActionSheet);
|
|
82
82
|
};
|
|
83
83
|
|
|
84
|
-
Object.assign(ActionSheet, {
|
|
85
|
-
setDefaultOptions,
|
|
86
|
-
resetDefaultOptions,
|
|
87
|
-
close
|
|
88
|
-
});
|
|
89
84
|
export { props as actionSheetProps } from './props.mjs';
|
|
90
85
|
export var _ActionSheetComponent = VarActionSheet;
|
|
91
86
|
export default ActionSheet;
|
package/es/checkbox/checkbox.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root { --checkbox-checked-color: var(--color-primary); --checkbox-unchecked-color: #555; --checkbox-disabled-color: var(--color-text-disabled); --checkbox-error-color: var(--color-danger); --checkbox-action-padding: 6px; --checkbox-text-padding: 6px 6px 6px 0; --checkbox-icon-size: 24px;}@keyframes var-vibrate-animation { 0% { opacity: 1; transform: scale(1); } 50% { opacity: 0.8; transform: scale(0.8); } 100% { opacity: 1; transform: scale(1); }}.var-checkbox { display: flex; align-items: center; transform: translateX(calc(-1 * var(--checkbox-action-padding))); cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.var-checkbox__wrap { display: inline-flex; flex-direction: column;}.var-checkbox__action { position: relative; display: flex; justify-content: center; align-items: center; padding: var(--checkbox-action-padding); border-radius: 50%; transition: background-color 0.25s, color 0.25s;}.var-checkbox__icon[var-checkbox-cover] { display: block; font-size: var(--checkbox-icon-size);}.var-checkbox--with-animation { animation: var-vibrate-animation 0.25s;}.var-checkbox--checked { color: var(--checkbox-checked-color);}.var-checkbox--unchecked { color: var(--checkbox-unchecked-color);}.var-checkbox--disabled { color: var(--checkbox-disabled-color); cursor: not-allowed;}.var-checkbox--error { color: var(--checkbox-error-color);}
|
|
1
|
+
:root { --checkbox-checked-color: var(--color-primary); --checkbox-unchecked-color: #555; --checkbox-disabled-color: var(--color-text-disabled); --checkbox-error-color: var(--color-danger); --checkbox-action-padding: 6px; --checkbox-text-padding: 6px 6px 6px 0; --checkbox-icon-size: 24px;}@keyframes var-vibrate-animation { 0% { opacity: 1; transform: scale(1); } 50% { opacity: 0.8; transform: scale(0.8); } 100% { opacity: 1; transform: scale(1); }}.var-checkbox { display: flex; align-items: center; transform: translateX(calc(-1 * var(--checkbox-action-padding))); cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.var-checkbox__wrap { display: inline-flex; flex-direction: column;}.var-checkbox__action { position: relative; display: flex; justify-content: center; align-items: center; flex-shrink: 0; padding: var(--checkbox-action-padding); border-radius: 50%; transition: background-color 0.25s, color 0.25s;}.var-checkbox__icon[var-checkbox-cover] { display: block; font-size: var(--checkbox-icon-size);}.var-checkbox--with-animation { animation: var-vibrate-animation 0.25s;}.var-checkbox--checked { color: var(--checkbox-checked-color);}.var-checkbox--unchecked { color: var(--checkbox-unchecked-color);}.var-checkbox--disabled { color: var(--checkbox-disabled-color); cursor: not-allowed;}.var-checkbox--error { color: var(--checkbox-error-color);}
|
|
@@ -69,7 +69,7 @@ function __render__(_ctx, _cache) {
|
|
|
69
69
|
ripple: false,
|
|
70
70
|
elevation: _ctx.componentProps.buttonElevation
|
|
71
71
|
}, _extends({}, _ctx.buttonProps(day)), {
|
|
72
|
-
onClick: event =>
|
|
72
|
+
onClick: _cache[0] || (_cache[0] = event => chooseDay(day, event))
|
|
73
73
|
}), {
|
|
74
74
|
default: _withCtx(() => [_createTextVNode(_toDisplayString(_ctx.filterDay(day)), 1
|
|
75
75
|
/* TEXT */
|
|
@@ -79,7 +79,7 @@ function __render__(_ctx, _cache) {
|
|
|
79
79
|
|
|
80
80
|
}, 1040
|
|
81
81
|
/* FULL_PROPS, DYNAMIC_SLOTS */
|
|
82
|
-
, ["elevation"
|
|
82
|
+
, ["elevation"])]);
|
|
83
83
|
}), 128
|
|
84
84
|
/* KEYED_FRAGMENT */
|
|
85
85
|
))], 2
|
|
@@ -243,7 +243,8 @@ var __sfc__ = defineComponent({
|
|
|
243
243
|
text: true,
|
|
244
244
|
outline: false,
|
|
245
245
|
textColor: '',
|
|
246
|
-
class: n('button')
|
|
246
|
+
class: n('button'),
|
|
247
|
+
disabled: true
|
|
247
248
|
};
|
|
248
249
|
}
|
|
249
250
|
|
|
@@ -308,7 +309,8 @@ var __sfc__ = defineComponent({
|
|
|
308
309
|
outline: computeOutline(),
|
|
309
310
|
textColor: isCover ? '' : textColorOrCover(),
|
|
310
311
|
[nDate() + "-color-cover"]: isCover,
|
|
311
|
-
class: classes(n('button'), n('button--usable'), [disabled, n('button--disabled')])
|
|
312
|
+
class: classes(n('button'), n('button--usable'), [disabled, n('button--disabled')]),
|
|
313
|
+
disabled
|
|
312
314
|
};
|
|
313
315
|
};
|
|
314
316
|
|
|
@@ -53,7 +53,7 @@ function __render__(_ctx, _cache) {
|
|
|
53
53
|
ripple: false,
|
|
54
54
|
elevation: _ctx.componentProps.buttonElevation
|
|
55
55
|
}, _extends({}, _ctx.buttonProps(month.index)), {
|
|
56
|
-
onClick: event =>
|
|
56
|
+
onClick: _cache[0] || (_cache[0] = event => chooseMonth(month, event))
|
|
57
57
|
}), {
|
|
58
58
|
default: _withCtx(() => [_createTextVNode(_toDisplayString(_ctx.getMonthAbbr(month.index)), 1
|
|
59
59
|
/* TEXT */
|
|
@@ -63,7 +63,7 @@ function __render__(_ctx, _cache) {
|
|
|
63
63
|
|
|
64
64
|
}, 1040
|
|
65
65
|
/* FULL_PROPS, DYNAMIC_SLOTS */
|
|
66
|
-
, ["elevation"
|
|
66
|
+
, ["elevation"])]);
|
|
67
67
|
}), 128
|
|
68
68
|
/* KEYED_FRAGMENT */
|
|
69
69
|
))]))]),
|
|
@@ -234,7 +234,8 @@ var __sfc__ = defineComponent({
|
|
|
234
234
|
color: !computeText() ? color : '',
|
|
235
235
|
textColor: isCover ? '' : textColorOrCover(),
|
|
236
236
|
[nDate() + "-color-cover"]: isCover,
|
|
237
|
-
class: classes(n('button'), [disabled, n('button--disabled')])
|
|
237
|
+
class: classes(n('button'), [disabled, n('button--disabled')]),
|
|
238
|
+
disabled
|
|
238
239
|
};
|
|
239
240
|
};
|
|
240
241
|
|
package/es/dialog/Dialog.mjs
CHANGED
|
@@ -133,7 +133,7 @@ var __sfc__ = defineComponent({
|
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
if (onBeforeClose != null) {
|
|
136
|
-
onBeforeClose
|
|
136
|
+
call(onBeforeClose, 'close', done);
|
|
137
137
|
return;
|
|
138
138
|
}
|
|
139
139
|
|
|
@@ -148,7 +148,7 @@ var __sfc__ = defineComponent({
|
|
|
148
148
|
call(onConfirm);
|
|
149
149
|
|
|
150
150
|
if (onBeforeClose != null) {
|
|
151
|
-
onBeforeClose
|
|
151
|
+
call(onBeforeClose, 'confirm', done);
|
|
152
152
|
return;
|
|
153
153
|
}
|
|
154
154
|
|
|
@@ -163,7 +163,7 @@ var __sfc__ = defineComponent({
|
|
|
163
163
|
call(onCancel);
|
|
164
164
|
|
|
165
165
|
if (onBeforeClose != null) {
|
|
166
|
-
onBeforeClose
|
|
166
|
+
call(onBeforeClose, 'cancel', done);
|
|
167
167
|
return;
|
|
168
168
|
}
|
|
169
169
|
|
package/es/dialog/index.mjs
CHANGED
|
@@ -64,15 +64,15 @@ function Dialog(options) {
|
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
function
|
|
67
|
+
Dialog.setDefaultOptions = function (options) {
|
|
68
68
|
defaultOptions = options;
|
|
69
|
-
}
|
|
69
|
+
};
|
|
70
70
|
|
|
71
|
-
function
|
|
71
|
+
Dialog.resetDefaultOptions = function () {
|
|
72
72
|
defaultOptions = {};
|
|
73
|
-
}
|
|
73
|
+
};
|
|
74
74
|
|
|
75
|
-
function
|
|
75
|
+
Dialog.close = function () {
|
|
76
76
|
if (singletonOptions != null) {
|
|
77
77
|
var prevSingletonOptions = singletonOptions;
|
|
78
78
|
singletonOptions = null;
|
|
@@ -80,13 +80,7 @@ function close() {
|
|
|
80
80
|
prevSingletonOptions.show = false;
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
Object.assign(Dialog, {
|
|
86
|
-
setDefaultOptions,
|
|
87
|
-
resetDefaultOptions,
|
|
88
|
-
close
|
|
89
|
-
});
|
|
83
|
+
};
|
|
90
84
|
|
|
91
85
|
VarDialog.install = function (app) {
|
|
92
86
|
app.component(VarDialog.name, VarDialog);
|
package/es/index.bundle.mjs
CHANGED
|
@@ -241,7 +241,7 @@ import './time-picker/style/index.mjs'
|
|
|
241
241
|
import './tooltip/style/index.mjs'
|
|
242
242
|
import './uploader/style/index.mjs'
|
|
243
243
|
|
|
244
|
-
const version = '2.9.
|
|
244
|
+
const version = '2.9.6'
|
|
245
245
|
|
|
246
246
|
function install(app) {
|
|
247
247
|
ActionSheet.install && app.use(ActionSheet)
|
package/es/index.mjs
CHANGED
|
@@ -160,7 +160,7 @@ export * from './time-picker/index.mjs'
|
|
|
160
160
|
export * from './tooltip/index.mjs'
|
|
161
161
|
export * from './uploader/index.mjs'
|
|
162
162
|
|
|
163
|
-
const version = '2.9.
|
|
163
|
+
const version = '2.9.6'
|
|
164
164
|
|
|
165
165
|
function install(app) {
|
|
166
166
|
ActionSheet.install && app.use(ActionSheet)
|
|
@@ -44,12 +44,12 @@ function __render__(_ctx, _cache) {
|
|
|
44
44
|
key: 0,
|
|
45
45
|
class: _normalizeClass(_ctx.classes(_ctx.n('simple'), [_ctx.disabled, _ctx.n('item--disabled')]))
|
|
46
46
|
}, [_createVNode(_component_var_input, {
|
|
47
|
-
modelValue: _ctx.
|
|
48
|
-
"onUpdate:modelValue": _cache[1] || (_cache[1] = $event => _ctx.
|
|
47
|
+
modelValue: _ctx.simpleCurrentValue,
|
|
48
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = $event => _ctx.simpleCurrentValue = $event),
|
|
49
49
|
disabled: _ctx.disabled,
|
|
50
50
|
"var-pagination-cover": "",
|
|
51
|
-
onBlur: _cache[2] || (_cache[2] = $event => _ctx.setPage('simple', _ctx.
|
|
52
|
-
onKeydown: _cache[3] || (_cache[3] = _withKeys($event => _ctx.setPage('simple', _ctx.
|
|
51
|
+
onBlur: _cache[2] || (_cache[2] = $event => _ctx.setPage('simple', _ctx.simpleCurrentValue, $event)),
|
|
52
|
+
onKeydown: _cache[3] || (_cache[3] = _withKeys($event => _ctx.setPage('simple', _ctx.simpleCurrentValue, $event), ["enter"]))
|
|
53
53
|
}, null, 8
|
|
54
54
|
/* PROPS */
|
|
55
55
|
, ["modelValue", "disabled"]), _createElementVNode("span", null, [_createTextVNode(" / " + _toDisplayString(_ctx.pageCount) + " ", 1
|
|
@@ -142,12 +142,12 @@ function __render__(_ctx, _cache) {
|
|
|
142
142
|
}, [_createTextVNode(_toDisplayString(_ctx.pack.paginationJump) + " ", 1
|
|
143
143
|
/* TEXT */
|
|
144
144
|
), _createVNode(_component_var_input, {
|
|
145
|
-
modelValue: _ctx.
|
|
146
|
-
"onUpdate:modelValue": _cache[7] || (_cache[7] = $event => _ctx.
|
|
145
|
+
modelValue: _ctx.quickJumperValue,
|
|
146
|
+
"onUpdate:modelValue": _cache[7] || (_cache[7] = $event => _ctx.quickJumperValue = $event),
|
|
147
147
|
disabled: _ctx.disabled,
|
|
148
148
|
"var-pagination-cover": "",
|
|
149
|
-
onBlur: _cache[8] || (_cache[8] = $event => _ctx.setPage('quick', _ctx.
|
|
150
|
-
onKeydown: _cache[9] || (_cache[9] = _withKeys($event => _ctx.setPage('quick', _ctx.
|
|
149
|
+
onBlur: _cache[8] || (_cache[8] = $event => _ctx.setPage('quick', _ctx.quickJumperValue, $event)),
|
|
150
|
+
onKeydown: _cache[9] || (_cache[9] = _withKeys($event => _ctx.setPage('quick', _ctx.quickJumperValue, $event), ["enter"]))
|
|
151
151
|
}, null, 8
|
|
152
152
|
/* PROPS */
|
|
153
153
|
, ["modelValue", "disabled"])], 2
|
|
@@ -177,8 +177,8 @@ var __sfc__ = defineComponent({
|
|
|
177
177
|
|
|
178
178
|
setup(props) {
|
|
179
179
|
var menuVisible = ref(false);
|
|
180
|
-
var
|
|
181
|
-
var
|
|
180
|
+
var quickJumperValue = ref('');
|
|
181
|
+
var simpleCurrentValue = ref('1');
|
|
182
182
|
var isHideEllipsisHead = ref(false);
|
|
183
183
|
var isHideEllipsisTail = ref(false);
|
|
184
184
|
var current = ref(toNumber(props.current) || 1);
|
|
@@ -207,48 +207,68 @@ var __sfc__ = defineComponent({
|
|
|
207
207
|
};
|
|
208
208
|
|
|
209
209
|
var clickItem = (item, index) => {
|
|
210
|
-
if (item === current.value || props.disabled)
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
210
|
+
if (item === current.value || props.disabled) {
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
if (item === '...') {
|
|
215
|
+
current.value = index === 1 ? Math.max(current.value - props.maxPagerCount, 1) : Math.min(current.value + props.maxPagerCount, pageCount.value);
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
if (item === 'prev') {
|
|
220
|
+
current.value = ensureCurrentBoundary(current.value - 1);
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
if (item === 'next') {
|
|
225
|
+
current.value = ensureCurrentBoundary(current.value + 1);
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
if (isNumber(item)) {
|
|
230
|
+
current.value = item;
|
|
217
231
|
}
|
|
218
232
|
};
|
|
219
233
|
|
|
220
234
|
var showMenu = () => {
|
|
221
|
-
if (props.disabled)
|
|
235
|
+
if (props.disabled) {
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
|
|
222
239
|
menuVisible.value = true;
|
|
223
240
|
};
|
|
224
241
|
|
|
225
242
|
var clickSize = option => {
|
|
226
243
|
size.value = option;
|
|
227
244
|
menuVisible.value = false;
|
|
245
|
+
var targetCurrent = ensureCurrentBoundary(current.value);
|
|
246
|
+
simpleCurrentValue.value = String(targetCurrent);
|
|
247
|
+
current.value = targetCurrent;
|
|
228
248
|
};
|
|
229
249
|
|
|
230
|
-
var
|
|
231
|
-
|
|
232
|
-
|
|
250
|
+
var ensureCurrentBoundary = targetCurrent => {
|
|
251
|
+
if (targetCurrent > pageCount.value) {
|
|
252
|
+
return pageCount.value;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
if (targetCurrent < 1) {
|
|
256
|
+
return 1;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
return targetCurrent;
|
|
233
260
|
};
|
|
234
261
|
|
|
235
|
-
var setPage = (type,
|
|
262
|
+
var setPage = (type, page, event) => {
|
|
236
263
|
;
|
|
237
264
|
event.target.blur();
|
|
265
|
+
var targetCurrent = ensureCurrentBoundary(toNumber(page));
|
|
266
|
+
simpleCurrentValue.value = String(targetCurrent);
|
|
267
|
+
current.value = targetCurrent;
|
|
238
268
|
|
|
239
|
-
if (
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
if (valueNum > pageCount.value) {
|
|
243
|
-
valueNum = pageCount.value;
|
|
244
|
-
simpleValue.value = "" + valueNum;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
if (valueNum !== current.value) current.value = valueNum;
|
|
269
|
+
if (type === 'quick') {
|
|
270
|
+
quickJumperValue.value = '';
|
|
248
271
|
}
|
|
249
|
-
|
|
250
|
-
if (type === 'quick') inputValue.value = '';
|
|
251
|
-
if (type === 'simple' && !isValidatePage(value)) simpleValue.value = "" + current.value;
|
|
252
272
|
};
|
|
253
273
|
|
|
254
274
|
watch([() => props.current, () => props.size], _ref => {
|
|
@@ -267,7 +287,7 @@ var __sfc__ = defineComponent({
|
|
|
267
287
|
} = props;
|
|
268
288
|
var oldCount = Math.ceil(toNumber(total) / toNumber(oldSize));
|
|
269
289
|
var rEllipseSign = newCount - (maxPagerCount - activePosition.value) - 1;
|
|
270
|
-
|
|
290
|
+
simpleCurrentValue.value = "" + newCurrent;
|
|
271
291
|
|
|
272
292
|
if (newCount - 2 > maxPagerCount) {
|
|
273
293
|
if (oldCurrent === undefined || newCount !== oldCount) {
|
|
@@ -322,7 +342,7 @@ var __sfc__ = defineComponent({
|
|
|
322
342
|
|
|
323
343
|
pageList.value = list;
|
|
324
344
|
|
|
325
|
-
if (oldCurrent
|
|
345
|
+
if (oldCurrent != null && newCount > 0) {
|
|
326
346
|
call(onChange, newCurrent, newSize);
|
|
327
347
|
}
|
|
328
348
|
|
|
@@ -340,8 +360,8 @@ var __sfc__ = defineComponent({
|
|
|
340
360
|
size,
|
|
341
361
|
pageCount,
|
|
342
362
|
pageList,
|
|
343
|
-
|
|
344
|
-
|
|
363
|
+
quickJumperValue,
|
|
364
|
+
simpleCurrentValue,
|
|
345
365
|
totalText,
|
|
346
366
|
getMode,
|
|
347
367
|
isHideEllipsis,
|
package/es/picker/index.mjs
CHANGED
|
@@ -38,7 +38,7 @@ function __render__(_ctx, _cache) {
|
|
|
38
38
|
}, [_createVNode(_component_var_icon, {
|
|
39
39
|
name: _ctx.iconName,
|
|
40
40
|
transition: _ctx.ICON_TRANSITION,
|
|
41
|
-
class: _normalizeClass(_ctx.classes(_ctx.n('icon'), [_ctx.refreshStatus === 'loading'
|
|
41
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('icon'), [_ctx.refreshStatus === 'loading', _ctx.n('animation')])),
|
|
42
42
|
"var-pull-refresh-cover": ""
|
|
43
43
|
}, null, 8
|
|
44
44
|
/* PROPS */
|
|
@@ -67,11 +67,26 @@ var __sfc__ = defineComponent({
|
|
|
67
67
|
var isEnd = ref(false);
|
|
68
68
|
var scroller;
|
|
69
69
|
var eventTargetScroller;
|
|
70
|
-
var changing;
|
|
71
70
|
var startY = 0;
|
|
72
|
-
var deltaY = 0;
|
|
71
|
+
var deltaY = 0;
|
|
72
|
+
|
|
73
|
+
var startIconTransition = /*#__PURE__*/function () {
|
|
74
|
+
var _ref = _asyncToGenerator(function* (name) {
|
|
75
|
+
if (iconName.value === name) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
iconName.value = name;
|
|
80
|
+
return new Promise(resolve => {
|
|
81
|
+
window.setTimeout(resolve, ICON_TRANSITION);
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
return function startIconTransition(_x) {
|
|
86
|
+
return _ref.apply(this, arguments);
|
|
87
|
+
};
|
|
88
|
+
}();
|
|
73
89
|
|
|
74
|
-
var iconHasChanged = ref(true);
|
|
75
90
|
var isTouchable = computed(() => refreshStatus.value !== 'loading' && refreshStatus.value !== 'success' && !props.disabled);
|
|
76
91
|
var controlStyle = computed(() => ({
|
|
77
92
|
transform: "translate3d(0px, " + (isString(distance.value) ? distance.value : distance.value + "px") + ", 0px) translate(-50%, 0)",
|
|
@@ -82,15 +97,6 @@ var __sfc__ = defineComponent({
|
|
|
82
97
|
var maxDistance = computed(() => Math.abs(2 * controlPosition.value));
|
|
83
98
|
var isSuccess = computed(() => refreshStatus.value === 'success');
|
|
84
99
|
|
|
85
|
-
var changeIcon = () => {
|
|
86
|
-
return new Promise(resolve => {
|
|
87
|
-
window.setTimeout(() => {
|
|
88
|
-
iconHasChanged.value = true;
|
|
89
|
-
resolve();
|
|
90
|
-
}, ICON_TRANSITION);
|
|
91
|
-
});
|
|
92
|
-
};
|
|
93
|
-
|
|
94
100
|
var lockEvent = action => {
|
|
95
101
|
var el = 'classList' in scroller ? scroller : document.body;
|
|
96
102
|
el.classList[action](n() + "--lock");
|
|
@@ -143,23 +149,19 @@ var __sfc__ = defineComponent({
|
|
|
143
149
|
|
|
144
150
|
var moveDistance = (event.touches[0].clientY - startPosition.value) / 2 + controlPosition.value;
|
|
145
151
|
distance.value = moveDistance >= maxDistance.value ? maxDistance.value : moveDistance;
|
|
146
|
-
|
|
147
|
-
if (distance.value >= maxDistance.value * 0.2) {
|
|
148
|
-
iconHasChanged.value = false;
|
|
149
|
-
iconName.value = 'refresh';
|
|
150
|
-
changing = changeIcon();
|
|
151
|
-
} else {
|
|
152
|
-
iconName.value = 'arrow-down';
|
|
153
|
-
}
|
|
152
|
+
startIconTransition(distance.value >= maxDistance.value * 0.2 ? 'refresh' : 'arrow-down');
|
|
154
153
|
};
|
|
155
154
|
|
|
156
155
|
var touchEnd = /*#__PURE__*/function () {
|
|
157
|
-
var
|
|
158
|
-
if (!isTouchable.value)
|
|
156
|
+
var _ref2 = _asyncToGenerator(function* () {
|
|
157
|
+
if (!isTouchable.value) {
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
|
|
159
161
|
isEnd.value = true;
|
|
160
162
|
|
|
161
163
|
if (distance.value >= maxDistance.value * 0.2) {
|
|
162
|
-
yield
|
|
164
|
+
yield startIconTransition('refresh');
|
|
163
165
|
refreshStatus.value = 'loading';
|
|
164
166
|
distance.value = maxDistance.value * 0.3;
|
|
165
167
|
call(props['onUpdate:modelValue'], true);
|
|
@@ -181,7 +183,7 @@ var __sfc__ = defineComponent({
|
|
|
181
183
|
});
|
|
182
184
|
|
|
183
185
|
return function touchEnd() {
|
|
184
|
-
return
|
|
186
|
+
return _ref2.apply(this, arguments);
|
|
185
187
|
};
|
|
186
188
|
}();
|
|
187
189
|
|
|
@@ -213,7 +215,6 @@ var __sfc__ = defineComponent({
|
|
|
213
215
|
return {
|
|
214
216
|
n,
|
|
215
217
|
classes,
|
|
216
|
-
iconHasChanged,
|
|
217
218
|
ICON_TRANSITION,
|
|
218
219
|
refreshStatus,
|
|
219
220
|
freshNode,
|
package/es/radio/radio.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root { --radio-checked-color: var(--color-primary); --radio-unchecked-color: #555; --radio-disabled-color: var(--color-text-disabled); --radio-error-color: var(--color-danger); --radio-icon-size: 24px; --radio-action-padding: 6px; --radio-text-padding: 6px 6px 6px 0;}@keyframes var-vibrate-animation { 0% { opacity: 1; transform: scale(1); } 50% { opacity: 0.8; transform: scale(0.8); } 100% { opacity: 1; transform: scale(1); }}.var-radio { display: flex; align-items: center; transform: translateX(calc(-1 * var(--radio-action-padding))); cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.var-radio__wrap { display: inline-flex; flex-direction: column;}.var-radio__action { display: flex; justify-content: center;
|
|
1
|
+
:root { --radio-checked-color: var(--color-primary); --radio-unchecked-color: #555; --radio-disabled-color: var(--color-text-disabled); --radio-error-color: var(--color-danger); --radio-icon-size: 24px; --radio-action-padding: 6px; --radio-text-padding: 6px 6px 6px 0;}@keyframes var-vibrate-animation { 0% { opacity: 1; transform: scale(1); } 50% { opacity: 0.8; transform: scale(0.8); } 100% { opacity: 1; transform: scale(1); }}.var-radio { display: flex; align-items: center; transform: translateX(calc(-1 * var(--radio-action-padding))); cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.var-radio__wrap { display: inline-flex; flex-direction: column;}.var-radio__action { position: relative; display: flex; justify-content: center; align-items: center; flex-shrink: 0; padding: var(--radio-action-padding); border-radius: 50%; transition: background-color 0.25s, color 0.25s;}.var-radio__icon[var-radio-cover] { display: block; font-size: var(--radio-icon-size);}.var-radio--with-animation[var-radio-cover] { animation: var-vibrate-animation 0.25s;}.var-radio--checked { color: var(--radio-checked-color);}.var-radio--unchecked { color: var(--radio-unchecked-color);}.var-radio--disabled { color: var(--radio-disabled-color); cursor: not-allowed;}.var-radio--error { color: var(--radio-error-color);}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import '../../styles/common.css'
|
|
2
|
-
import '../SnackbarSfc.css'
|
|
3
2
|
import '../../styles/elevation.css'
|
|
4
3
|
import '../../loading/loading.css'
|
|
5
4
|
import '../../button/button.css'
|
|
6
5
|
import '../../icon/icon.css'
|
|
7
6
|
import '../snackbar.css'
|
|
8
7
|
import '../coreSfc.css'
|
|
8
|
+
import '../SnackbarSfc.css'
|