@varlet/ui 2.16.1 → 2.16.3-alpha.1694267513697
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/ActionSheet.mjs +20 -16
- package/es/app-bar/AppBar.mjs +10 -9
- package/es/avatar/Avatar.mjs +16 -15
- package/es/avatar-group/AvatarGroup.mjs +4 -3
- package/es/back-top/BackTop.mjs +20 -19
- package/es/badge/Badge.mjs +4 -3
- package/es/bottom-navigation/BottomNavigation.mjs +70 -63
- package/es/bottom-navigation-item/BottomNavigationItem.mjs +13 -10
- package/es/breadcrumb/Breadcrumb.mjs +5 -4
- package/es/breadcrumbs/Breadcrumbs.mjs +2 -1
- package/es/button/Button.mjs +10 -9
- package/es/button-group/ButtonGroup.mjs +2 -1
- package/es/card/Card.mjs +28 -26
- package/es/cell/Cell.mjs +5 -4
- package/es/checkbox/Checkbox.mjs +32 -29
- package/es/checkbox-group/CheckboxGroup.mjs +45 -40
- package/es/chip/Chip.mjs +6 -5
- package/es/col/Col.mjs +21 -16
- package/es/collapse/Collapse.mjs +30 -29
- package/es/collapse-item/CollapseItem.mjs +52 -47
- package/es/countdown/Countdown.mjs +36 -35
- package/es/counter/Counter.mjs +63 -60
- package/es/date-picker/DatePicker.mjs +67 -63
- package/es/dialog/Dialog.mjs +39 -29
- package/es/divider/Divider.mjs +6 -9
- package/es/drag/Drag.mjs +47 -45
- package/es/ellipsis/Ellipsis.mjs +6 -5
- package/es/fab/Fab.mjs +21 -20
- package/es/field-decorator/FieldDecorator.mjs +14 -13
- package/es/form/Form.mjs +41 -36
- package/es/form-details/FormDetails.mjs +2 -1
- package/es/hover-overlay/HoverOverlay.mjs +6 -7
- package/es/icon/Icon.mjs +14 -12
- package/es/image/Image.mjs +14 -12
- package/es/image-preview/ImagePreview.mjs +51 -50
- package/es/index-anchor/IndexAnchor.mjs +15 -12
- package/es/index-bar/IndexBar.mjs +68 -65
- package/es/index.bundle.mjs +1 -1
- package/es/index.mjs +1 -1
- package/es/input/Input.mjs +63 -56
- package/es/link/Link.mjs +6 -5
- package/es/list/List.mjs +55 -46
- package/es/loading/Loading.mjs +11 -8
- package/es/loading-bar/LoadingBar.mjs +2 -1
- package/es/menu/Menu.mjs +2 -1
- package/es/option/Option.mjs +14 -11
- package/es/overlay/Overlay.mjs +18 -18
- package/es/pagination/Pagination.mjs +67 -64
- package/es/paper/Paper.mjs +4 -3
- package/es/picker/Picker.mjs +95 -85
- package/es/popup/Popup.mjs +26 -23
- package/es/progress/Progress.mjs +9 -8
- package/es/pull-refresh/PullRefresh.mjs +54 -51
- package/es/radio/Radio.mjs +25 -22
- package/es/radio-group/RadioGroup.mjs +30 -25
- package/es/rate/Rate.mjs +35 -28
- package/es/result/Result.mjs +6 -5
- package/es/row/Row.mjs +20 -18
- package/es/row/props.mjs +1 -1
- package/es/select/Select.mjs +57 -54
- package/es/skeleton/Skeleton.mjs +8 -9
- package/es/slider/Slider.mjs +86 -79
- package/es/snackbar/Snackbar.mjs +4 -3
- package/es/snackbar/style/index.mjs +1 -1
- package/es/space/Space.mjs +5 -2
- package/es/step/Step.mjs +7 -4
- package/es/steps/Steps.mjs +5 -4
- package/es/sticky/Sticky.mjs +30 -27
- package/es/style-provider/StyleProvider.mjs +2 -1
- package/es/swipe/Swipe.mjs +99 -90
- package/es/swipe-item/SwipeItem.mjs +5 -4
- package/es/switch/Switch.mjs +22 -17
- package/es/tab/Tab.mjs +16 -12
- package/es/tab-item/TabItem.mjs +7 -6
- package/es/table/Table.mjs +8 -9
- package/es/tabs/Tabs.mjs +57 -52
- package/es/tabs-items/TabsItems.mjs +38 -29
- package/es/time-picker/TimePicker.mjs +63 -60
- package/es/tooltip/Tooltip.mjs +3 -2
- package/es/uploader/Uploader.mjs +100 -85
- package/es/utils/components.mjs +2 -1
- package/es/utils/shared.mjs +0 -1
- package/es/varlet.esm.js +9605 -8923
- package/es/watermark/Watermark.mjs +29 -26
- package/highlight/web-types.en-US.json +3 -3
- package/highlight/web-types.zh-CN.json +3 -3
- package/lib/varlet.cjs.js +2388 -2118
- package/package.json +12 -14
- package/types/row.d.ts +1 -1
- package/types/swipe.d.ts +12 -3
- package/umd/varlet.js +4 -4
package/es/swipe/Swipe.mjs
CHANGED
|
@@ -10,6 +10,7 @@ import { usePopup } from '../popup/provide.mjs';
|
|
|
10
10
|
var SWIPE_DELAY = 250;
|
|
11
11
|
var SWIPE_OFFSET = 20;
|
|
12
12
|
var {
|
|
13
|
+
name,
|
|
13
14
|
n,
|
|
14
15
|
classes
|
|
15
16
|
} = createNamespace('swipe');
|
|
@@ -39,7 +40,10 @@ function __render__(_ctx, _cache) {
|
|
|
39
40
|
})
|
|
40
41
|
}, [_renderSlot(_ctx.$slots, "default")], 38 /* CLASS, STYLE, HYDRATE_EVENTS */), _renderSlot(_ctx.$slots, "indicator", {
|
|
41
42
|
index: _ctx.index,
|
|
42
|
-
length: _ctx.length
|
|
43
|
+
length: _ctx.length,
|
|
44
|
+
prev: _ctx.prev,
|
|
45
|
+
next: _ctx.next,
|
|
46
|
+
to: _ctx.to
|
|
43
47
|
}, () => [_ctx.indicator && _ctx.length ? (_openBlock(), _createElementBlock("div", {
|
|
44
48
|
key: 0,
|
|
45
49
|
class: _normalizeClass(_ctx.classes(_ctx.n('indicators'), [_ctx.vertical, _ctx.n('--indicators-vertical')]))
|
|
@@ -56,7 +60,7 @@ function __render__(_ctx, _cache) {
|
|
|
56
60
|
}
|
|
57
61
|
|
|
58
62
|
var __sfc__ = defineComponent({
|
|
59
|
-
name
|
|
63
|
+
name,
|
|
60
64
|
props,
|
|
61
65
|
setup(props) {
|
|
62
66
|
var swipeEl = ref(null);
|
|
@@ -92,13 +96,46 @@ var __sfc__ = defineComponent({
|
|
|
92
96
|
var isExpectDirection = computed(() => direction.value === (props.vertical ? 'vertical' : 'horizontal'));
|
|
93
97
|
var initializedIndex = false;
|
|
94
98
|
var timer = -1;
|
|
95
|
-
var
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
99
|
+
var swipeProvider = {
|
|
100
|
+
size,
|
|
101
|
+
vertical
|
|
102
|
+
};
|
|
103
|
+
bindSwipeItems(swipeProvider);
|
|
104
|
+
call(bindPopup, null);
|
|
105
|
+
watch(() => length.value, /*#__PURE__*/_asyncToGenerator(function* () {
|
|
106
|
+
// In nuxt, the size of the swipe cannot got when the route is change, need double raf
|
|
107
|
+
yield doubleRaf();
|
|
108
|
+
initialIndex();
|
|
109
|
+
resize();
|
|
110
|
+
}));
|
|
111
|
+
if (popup) {
|
|
112
|
+
// watch popup show again
|
|
113
|
+
watch(() => popup.show.value, /*#__PURE__*/function () {
|
|
114
|
+
var _ref2 = _asyncToGenerator(function* (show) {
|
|
115
|
+
if (show) {
|
|
116
|
+
yield doubleRaf();
|
|
117
|
+
resize();
|
|
118
|
+
} else {
|
|
119
|
+
stopAutoplay();
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
return function (_x) {
|
|
123
|
+
return _ref2.apply(this, arguments);
|
|
124
|
+
};
|
|
125
|
+
}());
|
|
126
|
+
}
|
|
127
|
+
onActivated(resize);
|
|
128
|
+
onSmartUnmounted(stopAutoplay);
|
|
129
|
+
onWindowResize(resize);
|
|
130
|
+
function findSwipeItem(idx) {
|
|
131
|
+
return swipeItems.find(_ref3 => {
|
|
132
|
+
var {
|
|
133
|
+
index
|
|
134
|
+
} = _ref3;
|
|
135
|
+
return index.value === idx;
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
function dispatchSwipeItems() {
|
|
102
139
|
if (!props.loop) {
|
|
103
140
|
return;
|
|
104
141
|
}
|
|
@@ -115,8 +152,8 @@ var __sfc__ = defineComponent({
|
|
|
115
152
|
findSwipeItem(length.value - 1).setTranslate(0);
|
|
116
153
|
findSwipeItem(0).setTranslate(0);
|
|
117
154
|
}
|
|
118
|
-
}
|
|
119
|
-
|
|
155
|
+
}
|
|
156
|
+
function getSwipeIndex(targetSwipeIndex) {
|
|
120
157
|
var swipeIndex = isNumber(targetSwipeIndex) ? targetSwipeIndex : Math.floor((trackTranslate.value - size.value / 2) / -size.value);
|
|
121
158
|
var {
|
|
122
159
|
loop
|
|
@@ -128,8 +165,8 @@ var __sfc__ = defineComponent({
|
|
|
128
165
|
return loop ? length.value : length.value - 1;
|
|
129
166
|
}
|
|
130
167
|
return swipeIndex;
|
|
131
|
-
}
|
|
132
|
-
|
|
168
|
+
}
|
|
169
|
+
function swipeIndexToIndex(swipeIndex) {
|
|
133
170
|
var {
|
|
134
171
|
loop
|
|
135
172
|
} = props;
|
|
@@ -140,8 +177,8 @@ var __sfc__ = defineComponent({
|
|
|
140
177
|
return loop ? 0 : length.value - 1;
|
|
141
178
|
}
|
|
142
179
|
return swipeIndex;
|
|
143
|
-
}
|
|
144
|
-
|
|
180
|
+
}
|
|
181
|
+
function clampIndex(index) {
|
|
145
182
|
if (props.loop) {
|
|
146
183
|
if (index < 0) {
|
|
147
184
|
return length.value + index;
|
|
@@ -152,9 +189,12 @@ var __sfc__ = defineComponent({
|
|
|
152
189
|
return index;
|
|
153
190
|
}
|
|
154
191
|
return clamp(index, 0, length.value - 1);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
|
|
192
|
+
}
|
|
193
|
+
function fixPosition() {
|
|
194
|
+
return _fixPosition.apply(this, arguments);
|
|
195
|
+
}
|
|
196
|
+
function _fixPosition() {
|
|
197
|
+
_fixPosition = _asyncToGenerator(function* () {
|
|
158
198
|
var overLeft = trackTranslate.value >= size.value;
|
|
159
199
|
var overRight = trackTranslate.value <= -trackSize.value;
|
|
160
200
|
var leftTranslate = 0;
|
|
@@ -169,18 +209,16 @@ var __sfc__ = defineComponent({
|
|
|
169
209
|
yield doubleRaf();
|
|
170
210
|
lockDuration.value = false;
|
|
171
211
|
});
|
|
172
|
-
return
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
}();
|
|
176
|
-
var initialIndex = () => {
|
|
212
|
+
return _fixPosition.apply(this, arguments);
|
|
213
|
+
}
|
|
214
|
+
function initialIndex() {
|
|
177
215
|
if (initializedIndex) {
|
|
178
216
|
return;
|
|
179
217
|
}
|
|
180
218
|
index.value = clampIndex(toNumber(props.initialIndex));
|
|
181
219
|
initializedIndex = true;
|
|
182
|
-
}
|
|
183
|
-
|
|
220
|
+
}
|
|
221
|
+
function startAutoplay() {
|
|
184
222
|
var {
|
|
185
223
|
autoplay
|
|
186
224
|
} = props;
|
|
@@ -192,16 +230,19 @@ var __sfc__ = defineComponent({
|
|
|
192
230
|
next();
|
|
193
231
|
startAutoplay();
|
|
194
232
|
}, toNumber(autoplay));
|
|
195
|
-
}
|
|
196
|
-
|
|
233
|
+
}
|
|
234
|
+
function stopAutoplay() {
|
|
197
235
|
timer && clearTimeout(timer);
|
|
198
|
-
}
|
|
199
|
-
|
|
236
|
+
}
|
|
237
|
+
function setTrackTranslate(value) {
|
|
200
238
|
trackTranslate.value = value;
|
|
201
239
|
dispatchSwipeItems();
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
|
|
240
|
+
}
|
|
241
|
+
function handleTouchstart(_x2) {
|
|
242
|
+
return _handleTouchstart.apply(this, arguments);
|
|
243
|
+
}
|
|
244
|
+
function _handleTouchstart() {
|
|
245
|
+
_handleTouchstart = _asyncToGenerator(function* (event) {
|
|
205
246
|
if (length.value <= 1 || !props.touchable) {
|
|
206
247
|
return;
|
|
207
248
|
}
|
|
@@ -210,11 +251,9 @@ var __sfc__ = defineComponent({
|
|
|
210
251
|
yield fixPosition();
|
|
211
252
|
lockDuration.value = true;
|
|
212
253
|
});
|
|
213
|
-
return
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
}();
|
|
217
|
-
var handleTouchmove = event => {
|
|
254
|
+
return _handleTouchstart.apply(this, arguments);
|
|
255
|
+
}
|
|
256
|
+
function handleTouchmove(event) {
|
|
218
257
|
var {
|
|
219
258
|
touchable,
|
|
220
259
|
vertical
|
|
@@ -228,8 +267,8 @@ var __sfc__ = defineComponent({
|
|
|
228
267
|
}
|
|
229
268
|
event.preventDefault();
|
|
230
269
|
setTrackTranslate(trackTranslate.value + (vertical ? moveY.value : moveX.value));
|
|
231
|
-
}
|
|
232
|
-
|
|
270
|
+
}
|
|
271
|
+
function handleTouchend() {
|
|
233
272
|
if (!touching.value) {
|
|
234
273
|
return;
|
|
235
274
|
}
|
|
@@ -253,10 +292,10 @@ var __sfc__ = defineComponent({
|
|
|
253
292
|
if (prevIndex !== index.value) {
|
|
254
293
|
call(onChange, index.value);
|
|
255
294
|
}
|
|
256
|
-
}
|
|
295
|
+
}
|
|
257
296
|
|
|
258
297
|
// expose
|
|
259
|
-
|
|
298
|
+
function resize() {
|
|
260
299
|
if (!swipeEl.value) {
|
|
261
300
|
return;
|
|
262
301
|
}
|
|
@@ -271,10 +310,14 @@ var __sfc__ = defineComponent({
|
|
|
271
310
|
setTimeout(() => {
|
|
272
311
|
lockDuration.value = false;
|
|
273
312
|
});
|
|
274
|
-
}
|
|
313
|
+
}
|
|
314
|
+
|
|
275
315
|
// expose
|
|
276
|
-
|
|
277
|
-
|
|
316
|
+
function next(_x3) {
|
|
317
|
+
return _next2.apply(this, arguments);
|
|
318
|
+
} // expose
|
|
319
|
+
function _next2() {
|
|
320
|
+
_next2 = _asyncToGenerator(function* (options) {
|
|
278
321
|
if (length.value <= 1) {
|
|
279
322
|
return;
|
|
280
323
|
}
|
|
@@ -298,13 +341,13 @@ var __sfc__ = defineComponent({
|
|
|
298
341
|
trackTranslate.value = index.value * -size.value;
|
|
299
342
|
}
|
|
300
343
|
});
|
|
301
|
-
return
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
// expose
|
|
306
|
-
|
|
307
|
-
|
|
344
|
+
return _next2.apply(this, arguments);
|
|
345
|
+
}
|
|
346
|
+
function prev(_x4) {
|
|
347
|
+
return _prev.apply(this, arguments);
|
|
348
|
+
} // expose
|
|
349
|
+
function _prev() {
|
|
350
|
+
_prev = _asyncToGenerator(function* (options) {
|
|
308
351
|
if (length.value <= 1) {
|
|
309
352
|
return;
|
|
310
353
|
}
|
|
@@ -328,12 +371,9 @@ var __sfc__ = defineComponent({
|
|
|
328
371
|
trackTranslate.value = index.value * -size.value;
|
|
329
372
|
}
|
|
330
373
|
});
|
|
331
|
-
return
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
}();
|
|
335
|
-
// expose
|
|
336
|
-
var to = (idx, options) => {
|
|
374
|
+
return _prev.apply(this, arguments);
|
|
375
|
+
}
|
|
376
|
+
function to(idx, options) {
|
|
337
377
|
if (length.value <= 1 || idx === index.value) {
|
|
338
378
|
return;
|
|
339
379
|
}
|
|
@@ -348,47 +388,16 @@ var __sfc__ = defineComponent({
|
|
|
348
388
|
event: index === count - 1 ? options == null ? void 0 : options.event : false
|
|
349
389
|
});
|
|
350
390
|
});
|
|
351
|
-
};
|
|
352
|
-
var swipeProvider = {
|
|
353
|
-
size,
|
|
354
|
-
vertical
|
|
355
|
-
};
|
|
356
|
-
bindSwipeItems(swipeProvider);
|
|
357
|
-
call(bindPopup, null);
|
|
358
|
-
watch(() => length.value, /*#__PURE__*/_asyncToGenerator(function* () {
|
|
359
|
-
// In nuxt, the size of the swipe cannot got when the route is change, need double raf
|
|
360
|
-
yield doubleRaf();
|
|
361
|
-
initialIndex();
|
|
362
|
-
resize();
|
|
363
|
-
}));
|
|
364
|
-
if (popup) {
|
|
365
|
-
// watch popup show again
|
|
366
|
-
watch(() => popup.show.value, /*#__PURE__*/function () {
|
|
367
|
-
var _ref7 = _asyncToGenerator(function* (show) {
|
|
368
|
-
if (show) {
|
|
369
|
-
yield doubleRaf();
|
|
370
|
-
resize();
|
|
371
|
-
} else {
|
|
372
|
-
stopAutoplay();
|
|
373
|
-
}
|
|
374
|
-
});
|
|
375
|
-
return function (_x4) {
|
|
376
|
-
return _ref7.apply(this, arguments);
|
|
377
|
-
};
|
|
378
|
-
}());
|
|
379
391
|
}
|
|
380
|
-
onActivated(resize);
|
|
381
|
-
onSmartUnmounted(stopAutoplay);
|
|
382
|
-
onWindowResize(resize);
|
|
383
392
|
return {
|
|
384
|
-
n,
|
|
385
|
-
classes,
|
|
386
393
|
length,
|
|
387
394
|
index,
|
|
388
395
|
swipeEl,
|
|
389
396
|
trackSize,
|
|
390
397
|
trackTranslate,
|
|
391
398
|
lockDuration,
|
|
399
|
+
n,
|
|
400
|
+
classes,
|
|
392
401
|
handleTouchstart,
|
|
393
402
|
handleTouchmove,
|
|
394
403
|
handleTouchend,
|
|
@@ -2,6 +2,7 @@ import { defineComponent, ref } from 'vue';
|
|
|
2
2
|
import { useSwipe } from './provide.mjs';
|
|
3
3
|
import { createNamespace } from '../utils/components.mjs';
|
|
4
4
|
var {
|
|
5
|
+
name,
|
|
5
6
|
n
|
|
6
7
|
} = createNamespace('swipe-item');
|
|
7
8
|
import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
@@ -17,7 +18,7 @@ function __render__(_ctx, _cache) {
|
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
var __sfc__ = defineComponent({
|
|
20
|
-
name
|
|
21
|
+
name,
|
|
21
22
|
setup() {
|
|
22
23
|
var translate = ref(0);
|
|
23
24
|
var {
|
|
@@ -29,14 +30,14 @@ var __sfc__ = defineComponent({
|
|
|
29
30
|
size,
|
|
30
31
|
vertical
|
|
31
32
|
} = swipe;
|
|
32
|
-
var setTranslate = x => {
|
|
33
|
-
translate.value = x;
|
|
34
|
-
};
|
|
35
33
|
var swipeItemProvider = {
|
|
36
34
|
index,
|
|
37
35
|
setTranslate
|
|
38
36
|
};
|
|
39
37
|
bindSwipe(swipeItemProvider);
|
|
38
|
+
function setTranslate(x) {
|
|
39
|
+
translate.value = x;
|
|
40
|
+
}
|
|
40
41
|
return {
|
|
41
42
|
n,
|
|
42
43
|
size,
|
package/es/switch/Switch.mjs
CHANGED
|
@@ -8,6 +8,7 @@ import { multiplySizeUnit } from '../utils/elements.mjs';
|
|
|
8
8
|
import { useForm } from '../form/provide.mjs';
|
|
9
9
|
import { props } from './props.mjs';
|
|
10
10
|
var {
|
|
11
|
+
name,
|
|
11
12
|
n,
|
|
12
13
|
classes
|
|
13
14
|
} = createNamespace('switch');
|
|
@@ -60,7 +61,7 @@ function __render__(_ctx, _cache) {
|
|
|
60
61
|
}, null, 8 /* PROPS */, ["error-message"])], 2 /* CLASS */)), [[_directive_hover, _ctx.hover, "desktop"]]);
|
|
61
62
|
}
|
|
62
63
|
var __sfc__ = defineComponent({
|
|
63
|
-
name
|
|
64
|
+
name,
|
|
64
65
|
components: {
|
|
65
66
|
VarFormDetails,
|
|
66
67
|
VarHoverOverlay
|
|
@@ -85,8 +86,6 @@ var __sfc__ = defineComponent({
|
|
|
85
86
|
hovering,
|
|
86
87
|
handleHovering
|
|
87
88
|
} = useHoverOverlay();
|
|
88
|
-
var validate = () => v(props.rules, props.modelValue);
|
|
89
|
-
var validateWithTrigger = () => nextTick(() => vt(['onChange'], 'onChange', props.rules, props.modelValue));
|
|
90
89
|
var styleComputed = computed(() => {
|
|
91
90
|
var {
|
|
92
91
|
size,
|
|
@@ -123,7 +122,19 @@ var __sfc__ = defineComponent({
|
|
|
123
122
|
};
|
|
124
123
|
});
|
|
125
124
|
var radius = computed(() => multiplySizeUnit(props.size, 0.8));
|
|
126
|
-
var
|
|
125
|
+
var switchProvider = {
|
|
126
|
+
reset,
|
|
127
|
+
validate,
|
|
128
|
+
resetValidation
|
|
129
|
+
};
|
|
130
|
+
call(bindForm, switchProvider);
|
|
131
|
+
function validate() {
|
|
132
|
+
return v(props.rules, props.modelValue);
|
|
133
|
+
}
|
|
134
|
+
function validateWithTrigger() {
|
|
135
|
+
return nextTick(() => vt(['onChange'], 'onChange', props.rules, props.modelValue));
|
|
136
|
+
}
|
|
137
|
+
function switchActive(event) {
|
|
127
138
|
var {
|
|
128
139
|
onClick,
|
|
129
140
|
onChange,
|
|
@@ -143,32 +154,26 @@ var __sfc__ = defineComponent({
|
|
|
143
154
|
call(onChange, newValue);
|
|
144
155
|
call(updateModelValue, newValue);
|
|
145
156
|
validateWithTrigger();
|
|
146
|
-
}
|
|
147
|
-
|
|
157
|
+
}
|
|
158
|
+
function hover(value) {
|
|
148
159
|
if (props.disabled || form != null && form.disabled.value) {
|
|
149
160
|
return;
|
|
150
161
|
}
|
|
151
162
|
handleHovering(value);
|
|
152
|
-
}
|
|
153
|
-
|
|
163
|
+
}
|
|
164
|
+
function reset() {
|
|
154
165
|
call(props['onUpdate:modelValue'], props.inactiveValue);
|
|
155
166
|
resetValidation();
|
|
156
|
-
}
|
|
157
|
-
var switchProvider = {
|
|
158
|
-
reset,
|
|
159
|
-
validate,
|
|
160
|
-
resetValidation
|
|
161
|
-
};
|
|
162
|
-
call(bindForm, switchProvider);
|
|
167
|
+
}
|
|
163
168
|
return {
|
|
164
|
-
n,
|
|
165
|
-
classes,
|
|
166
169
|
hovering,
|
|
167
170
|
radius,
|
|
168
171
|
styleComputed,
|
|
169
172
|
errorMessage,
|
|
170
173
|
formDisabled: form == null ? void 0 : form.disabled,
|
|
171
174
|
formReadonly: form == null ? void 0 : form.readonly,
|
|
175
|
+
n,
|
|
176
|
+
classes,
|
|
172
177
|
multiplySizeUnit,
|
|
173
178
|
switchActive,
|
|
174
179
|
hover
|
package/es/tab/Tab.mjs
CHANGED
|
@@ -4,6 +4,7 @@ import { props } from './props.mjs';
|
|
|
4
4
|
import { call, createNamespace } from '../utils/components.mjs';
|
|
5
5
|
import { useTabs } from './provide.mjs';
|
|
6
6
|
var {
|
|
7
|
+
name,
|
|
7
8
|
n,
|
|
8
9
|
classes
|
|
9
10
|
} = createNamespace('tab');
|
|
@@ -24,16 +25,16 @@ function __render__(_ctx, _cache) {
|
|
|
24
25
|
}]]);
|
|
25
26
|
}
|
|
26
27
|
var __sfc__ = defineComponent({
|
|
27
|
-
name
|
|
28
|
+
name,
|
|
28
29
|
directives: {
|
|
29
30
|
Ripple
|
|
30
31
|
},
|
|
31
32
|
props,
|
|
32
33
|
setup(props) {
|
|
33
34
|
var tabEl = ref(null);
|
|
35
|
+
var element = computed(() => tabEl.value);
|
|
34
36
|
var name = computed(() => props.name);
|
|
35
37
|
var disabled = computed(() => props.disabled);
|
|
36
|
-
var element = computed(() => tabEl.value);
|
|
37
38
|
var {
|
|
38
39
|
index,
|
|
39
40
|
tabs,
|
|
@@ -55,15 +56,20 @@ var __sfc__ = defineComponent({
|
|
|
55
56
|
element
|
|
56
57
|
};
|
|
57
58
|
bindTabs(tabProvider);
|
|
58
|
-
|
|
59
|
+
watch(() => [props.name, props.disabled], resize);
|
|
60
|
+
function shouldActive() {
|
|
59
61
|
if (props.name != null) {
|
|
60
62
|
return active.value === props.name;
|
|
61
63
|
}
|
|
62
64
|
return active.value === (index == null ? void 0 : index.value);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
}
|
|
66
|
+
function computeColorStyle() {
|
|
67
|
+
return props.disabled ? disabledColor.value : shouldActive() ? activeColor.value : inactiveColor.value;
|
|
68
|
+
}
|
|
69
|
+
function computeColorClass() {
|
|
70
|
+
return props.disabled ? n('$-tab--disabled') : shouldActive() ? n('$-tab--active') : n('$-tab--inactive');
|
|
71
|
+
}
|
|
72
|
+
function handleClick(event) {
|
|
67
73
|
var {
|
|
68
74
|
disabled,
|
|
69
75
|
name,
|
|
@@ -74,17 +80,15 @@ var __sfc__ = defineComponent({
|
|
|
74
80
|
}
|
|
75
81
|
call(onClick, name != null ? name : index.value, event);
|
|
76
82
|
onTabClick(tabProvider);
|
|
77
|
-
}
|
|
78
|
-
watch(() => props.name, resize);
|
|
79
|
-
watch(() => props.disabled, resize);
|
|
83
|
+
}
|
|
80
84
|
return {
|
|
81
|
-
n,
|
|
82
|
-
classes,
|
|
83
85
|
tabEl,
|
|
84
86
|
active,
|
|
85
87
|
activeColor,
|
|
86
88
|
inactiveColor,
|
|
87
89
|
itemDirection,
|
|
90
|
+
n,
|
|
91
|
+
classes,
|
|
88
92
|
computeColorStyle,
|
|
89
93
|
computeColorClass,
|
|
90
94
|
handleClick
|
package/es/tab-item/TabItem.mjs
CHANGED
|
@@ -4,6 +4,7 @@ import { useTabsItems, useLists } from './provide.mjs';
|
|
|
4
4
|
import { props } from './props.mjs';
|
|
5
5
|
import { createNamespace } from '../utils/components.mjs';
|
|
6
6
|
var {
|
|
7
|
+
name,
|
|
7
8
|
n,
|
|
8
9
|
classes
|
|
9
10
|
} = createNamespace('tab-item');
|
|
@@ -19,7 +20,7 @@ function __render__(_ctx, _cache) {
|
|
|
19
20
|
}, 8 /* PROPS */, ["class"]);
|
|
20
21
|
}
|
|
21
22
|
var __sfc__ = defineComponent({
|
|
22
|
-
name
|
|
23
|
+
name,
|
|
23
24
|
components: {
|
|
24
25
|
VarSwipeItem
|
|
25
26
|
},
|
|
@@ -34,9 +35,6 @@ var __sfc__ = defineComponent({
|
|
|
34
35
|
var {
|
|
35
36
|
bindLists
|
|
36
37
|
} = useLists();
|
|
37
|
-
var setCurrent = value => {
|
|
38
|
-
current.value = value;
|
|
39
|
-
};
|
|
40
38
|
var tabItemProvider = {
|
|
41
39
|
index,
|
|
42
40
|
name,
|
|
@@ -45,10 +43,13 @@ var __sfc__ = defineComponent({
|
|
|
45
43
|
};
|
|
46
44
|
bindTabsItems(tabItemProvider);
|
|
47
45
|
bindLists(tabItemProvider);
|
|
46
|
+
function setCurrent(value) {
|
|
47
|
+
current.value = value;
|
|
48
|
+
}
|
|
48
49
|
return {
|
|
50
|
+
current,
|
|
49
51
|
n,
|
|
50
|
-
classes
|
|
51
|
-
current
|
|
52
|
+
classes
|
|
52
53
|
};
|
|
53
54
|
}
|
|
54
55
|
});
|
package/es/table/Table.mjs
CHANGED
|
@@ -3,6 +3,7 @@ import { toSizeUnit } from '../utils/elements.mjs';
|
|
|
3
3
|
import { createNamespace, formatElevation } from '../utils/components.mjs';
|
|
4
4
|
import { props } from './props.mjs';
|
|
5
5
|
var {
|
|
6
|
+
name,
|
|
6
7
|
n,
|
|
7
8
|
classes
|
|
8
9
|
} = createNamespace('table');
|
|
@@ -24,16 +25,14 @@ function __render__(_ctx, _cache) {
|
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
var __sfc__ = defineComponent({
|
|
27
|
-
name
|
|
28
|
+
name,
|
|
28
29
|
props,
|
|
29
|
-
setup() {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
};
|
|
36
|
-
}
|
|
30
|
+
setup: () => ({
|
|
31
|
+
toSizeUnit,
|
|
32
|
+
n,
|
|
33
|
+
classes,
|
|
34
|
+
formatElevation
|
|
35
|
+
})
|
|
37
36
|
});
|
|
38
37
|
__sfc__.render = __render__;
|
|
39
38
|
export default __sfc__;
|