@varlet/ui 1.26.9 → 1.27.0-alpha.1649242923701
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.js +29 -27
- package/es/app-bar/AppBar.js +32 -27
- package/es/back-top/BackTop.js +9 -2
- package/es/badge/Badge.js +22 -14
- package/es/bottom-navigation/BottomNavigation.js +167 -0
- package/es/bottom-navigation/BottomNavigationSfc.css +0 -0
- package/es/bottom-navigation/BottomNavigationSfc.less +0 -0
- package/es/bottom-navigation/bottomNavigation.css +1 -0
- package/es/bottom-navigation/bottomNavigation.less +49 -0
- package/es/bottom-navigation/index.js +8 -0
- package/es/bottom-navigation/props.js +40 -0
- package/es/bottom-navigation/provide.js +17 -0
- package/es/bottom-navigation/style/index.js +4 -0
- package/es/bottom-navigation/style/less.js +4 -0
- package/es/bottom-navigation-item/BottomNavigationItem.js +122 -0
- package/es/bottom-navigation-item/BottomNavigationItemSfc.css +0 -0
- package/es/bottom-navigation-item/BottomNavigationItemSfc.less +0 -0
- package/es/bottom-navigation-item/bottomNavigationItem.css +1 -0
- package/es/bottom-navigation-item/bottomNavigationItem.less +78 -0
- package/es/bottom-navigation-item/index.js +8 -0
- package/es/bottom-navigation-item/props.js +22 -0
- package/es/bottom-navigation-item/provide.js +21 -0
- package/es/bottom-navigation-item/style/index.js +6 -0
- package/es/bottom-navigation-item/style/less.js +6 -0
- package/es/button/Button.js +12 -5
- package/es/card/Card.js +33 -28
- package/es/cell/Cell.js +26 -15
- package/es/checkbox/Checkbox.js +28 -26
- package/es/checkbox-group/CheckboxGroup.js +21 -25
- package/es/chip/Chip.js +16 -7
- package/es/chip/chip.css +1 -1
- package/es/chip/chip.less +11 -11
- package/es/col/Col.js +12 -5
- package/es/collapse/Collapse.js +15 -12
- package/es/collapse-item/CollapseItem.js +31 -30
- package/es/collapse-item/collapseItem.css +1 -1
- package/es/collapse-item/collapseItem.less +16 -16
- package/es/countdown/Countdown.js +14 -11
- package/es/counter/Counter.js +30 -27
- package/es/date-picker/DatePicker.js +28 -23
- package/es/date-picker/date-picker.css +1 -1
- package/es/date-picker/date-picker.less +22 -20
- package/es/date-picker/src/day-picker-panel.js +41 -34
- package/es/date-picker/src/month-picker-panel.js +27 -21
- package/es/date-picker/src/panel-header.js +16 -11
- package/es/date-picker/src/year-picker-panel.js +17 -9
- package/es/dialog/Dialog.js +36 -40
- package/es/divider/Divider.js +16 -12
- package/es/form/Form.js +11 -8
- package/es/form-details/FormDetails.js +27 -22
- package/es/icon/Icon.js +8 -1
- package/es/image/Image.js +19 -12
- package/es/image-preview/ImagePreview.js +35 -34
- package/es/index-anchor/IndexAnchor.js +8 -1
- package/es/index-bar/IndexBar.js +22 -20
- package/es/index.js +10 -0
- package/es/input/Input.js +45 -44
- package/es/lazy/index.js +2 -1
- package/es/less.js +2 -0
- package/es/list/List.js +39 -38
- package/es/loading/Loading.js +31 -23
- package/es/loading/loading.css +1 -1
- package/es/loading/loading.less +32 -32
- package/es/menu/Menu.js +12 -10
- package/es/option/Option.js +16 -11
- package/es/pagination/Pagination.js +34 -44
- package/es/pagination/pagination.css +1 -1
- package/es/pagination/pagination.less +8 -8
- package/es/picker/Picker.js +51 -47
- package/es/popup/Popup.js +9 -5
- package/es/progress/Progress.js +44 -35
- package/es/progress/progress.css +1 -1
- package/es/progress/progress.less +12 -12
- package/es/pull-refresh/PullRefresh.js +13 -10
- package/es/radio/Radio.js +25 -25
- package/es/radio-group/RadioGroup.js +19 -19
- package/es/rate/Rate.js +27 -25
- package/es/ripple/index.js +6 -2
- package/es/row/Row.js +11 -4
- package/es/select/Select.js +53 -54
- package/es/skeleton/Skeleton.js +70 -81
- package/es/slider/Slider.js +44 -40
- package/es/slider/slider.css +1 -1
- package/es/slider/slider.less +5 -5
- package/es/snackbar/Snackbar.js +9 -5
- package/es/snackbar/core.js +20 -26
- package/es/snackbar/snackbar.css +1 -1
- package/es/snackbar/snackbar.less +66 -68
- package/es/space/Space.js +8 -3
- package/es/step/Step.js +25 -23
- package/es/step/step.css +1 -1
- package/es/step/step.less +10 -10
- package/es/steps/Steps.js +12 -5
- package/es/sticky/Sticky.js +14 -7
- package/es/style-provider/StyleProvider.js +6 -2
- package/es/style.css +1 -1
- package/es/style.js +2 -0
- package/es/swipe/Swipe.js +22 -16
- package/es/swipe-item/SwipeItem.js +9 -4
- package/es/switch/Switch.js +25 -23
- package/es/switch/switch.css +1 -1
- package/es/switch/switch.less +2 -2
- package/es/tab/Tab.js +8 -1
- package/es/tab-item/TabItem.js +8 -1
- package/es/table/Table.js +27 -20
- package/es/tabs/Tabs.js +16 -11
- package/es/tabs-items/TabsItems.js +10 -5
- package/es/themes/dark/bottomNavigation.js +4 -0
- package/es/themes/dark/bottomNavigationItem.js +3 -0
- package/es/themes/dark/index.js +3 -1
- package/es/time-picker/TimePicker.js +47 -38
- package/es/time-picker/clock.js +26 -22
- package/es/time-picker/timePicker.css +1 -1
- package/es/time-picker/timePicker.less +11 -11
- package/es/umdIndex.js +10 -0
- package/es/uploader/Uploader.js +62 -57
- package/es/utils/components.js +35 -0
- package/es/varlet.esm.js +2082 -1527
- package/highlight/attributes.json +48 -0
- package/highlight/tags.json +20 -0
- package/highlight/web-types.json +155 -1
- package/lib/action-sheet/ActionSheet.js +30 -26
- package/lib/app-bar/AppBar.js +31 -24
- package/lib/back-top/BackTop.js +11 -2
- package/lib/badge/Badge.js +23 -13
- package/lib/bottom-navigation/BottomNavigation.js +183 -0
- package/lib/bottom-navigation/BottomNavigationSfc.css +0 -0
- package/lib/bottom-navigation/BottomNavigationSfc.less +0 -0
- package/lib/bottom-navigation/bottomNavigation.css +1 -0
- package/lib/bottom-navigation/bottomNavigation.less +49 -0
- package/lib/bottom-navigation/index.js +17 -0
- package/lib/bottom-navigation/props.js +45 -0
- package/lib/bottom-navigation/provide.js +27 -0
- package/lib/bottom-navigation/style/index.js +4 -0
- package/lib/bottom-navigation/style/less.js +4 -0
- package/lib/bottom-navigation-item/BottomNavigationItem.js +140 -0
- package/lib/bottom-navigation-item/BottomNavigationItemSfc.css +0 -0
- package/lib/bottom-navigation-item/BottomNavigationItemSfc.less +0 -0
- package/lib/bottom-navigation-item/bottomNavigationItem.css +1 -0
- package/lib/bottom-navigation-item/bottomNavigationItem.less +78 -0
- package/lib/bottom-navigation-item/index.js +17 -0
- package/lib/bottom-navigation-item/props.js +27 -0
- package/lib/bottom-navigation-item/provide.js +28 -0
- package/lib/bottom-navigation-item/style/index.js +6 -0
- package/lib/bottom-navigation-item/style/less.js +6 -0
- package/lib/button/Button.js +13 -4
- package/lib/card/Card.js +34 -27
- package/lib/cell/Cell.js +26 -13
- package/lib/checkbox/Checkbox.js +26 -23
- package/lib/checkbox-group/CheckboxGroup.js +19 -22
- package/lib/chip/Chip.js +18 -7
- package/lib/chip/chip.css +1 -1
- package/lib/chip/chip.less +11 -11
- package/lib/col/Col.js +14 -5
- package/lib/collapse/Collapse.js +15 -10
- package/lib/collapse-item/CollapseItem.js +31 -28
- package/lib/collapse-item/collapseItem.css +1 -1
- package/lib/collapse-item/collapseItem.less +16 -16
- package/lib/countdown/Countdown.js +14 -10
- package/lib/counter/Counter.js +29 -26
- package/lib/date-picker/DatePicker.js +30 -23
- package/lib/date-picker/date-picker.css +1 -1
- package/lib/date-picker/date-picker.less +22 -20
- package/lib/date-picker/src/day-picker-panel.js +41 -32
- package/lib/date-picker/src/month-picker-panel.js +27 -19
- package/lib/date-picker/src/panel-header.js +16 -9
- package/lib/date-picker/src/year-picker-panel.js +19 -9
- package/lib/dialog/Dialog.js +36 -38
- package/lib/divider/Divider.js +16 -10
- package/lib/form/Form.js +11 -6
- package/lib/form-details/FormDetails.js +27 -20
- package/lib/icon/Icon.js +10 -1
- package/lib/image/Image.js +20 -11
- package/lib/image-preview/ImagePreview.js +35 -33
- package/lib/index-anchor/IndexAnchor.js +10 -1
- package/lib/index-bar/IndexBar.js +24 -20
- package/lib/index.js +6 -0
- package/lib/input/Input.js +45 -43
- package/lib/lazy/index.js +3 -1
- package/lib/less.js +2 -0
- package/lib/list/List.js +39 -36
- package/lib/loading/Loading.js +33 -23
- package/lib/loading/loading.css +1 -1
- package/lib/loading/loading.less +32 -32
- package/lib/menu/Menu.js +12 -9
- package/lib/option/Option.js +16 -9
- package/lib/pagination/Pagination.js +36 -44
- package/lib/pagination/pagination.css +1 -1
- package/lib/pagination/pagination.less +8 -8
- package/lib/picker/Picker.js +51 -46
- package/lib/popup/Popup.js +9 -4
- package/lib/progress/Progress.js +45 -34
- package/lib/progress/progress.css +1 -1
- package/lib/progress/progress.less +12 -12
- package/lib/pull-refresh/PullRefresh.js +14 -10
- package/lib/radio/Radio.js +23 -22
- package/lib/radio-group/RadioGroup.js +17 -16
- package/lib/rate/Rate.js +27 -24
- package/lib/ripple/index.js +7 -2
- package/lib/row/Row.js +12 -3
- package/lib/select/Select.js +53 -53
- package/lib/skeleton/Skeleton.js +69 -78
- package/lib/slider/Slider.js +42 -38
- package/lib/slider/slider.css +1 -1
- package/lib/slider/slider.less +5 -5
- package/lib/snackbar/Snackbar.js +9 -4
- package/lib/snackbar/core.js +20 -25
- package/lib/snackbar/snackbar.css +1 -1
- package/lib/snackbar/snackbar.less +66 -68
- package/lib/space/Space.js +9 -3
- package/lib/step/Step.js +26 -22
- package/lib/step/step.css +1 -1
- package/lib/step/step.less +10 -10
- package/lib/steps/Steps.js +13 -4
- package/lib/sticky/Sticky.js +15 -6
- package/lib/style-provider/StyleProvider.js +8 -2
- package/lib/style.css +1 -1
- package/lib/style.js +2 -0
- package/lib/swipe/Swipe.js +23 -16
- package/lib/swipe-item/SwipeItem.js +10 -3
- package/lib/switch/Switch.js +23 -20
- package/lib/switch/switch.css +1 -1
- package/lib/switch/switch.less +2 -2
- package/lib/tab/Tab.js +10 -1
- package/lib/tab-item/TabItem.js +10 -1
- package/lib/table/Table.js +27 -18
- package/lib/tabs/Tabs.js +18 -11
- package/lib/tabs-items/TabsItems.js +11 -4
- package/lib/themes/dark/bottomNavigation.js +9 -0
- package/lib/themes/dark/bottomNavigationItem.js +8 -0
- package/lib/themes/dark/index.js +5 -1
- package/lib/time-picker/TimePicker.js +49 -38
- package/lib/time-picker/clock.js +26 -20
- package/lib/time-picker/timePicker.css +1 -1
- package/lib/time-picker/timePicker.less +11 -11
- package/lib/uploader/Uploader.js +60 -55
- package/lib/utils/components.js +39 -0
- package/package.json +4 -4
- package/types/bottomNavigation.d.ts +19 -0
- package/types/bottomNavigationItem.d.ts +16 -0
- package/types/global.d.ts +2 -0
- package/types/index.d.ts +2 -0
- package/umd/varlet.js +4 -4
package/es/swipe/Swipe.js
CHANGED
|
@@ -7,20 +7,24 @@ import { useSwipeItems } from './provide';
|
|
|
7
7
|
import { doubleRaf, nextTickFrame } from '../utils/elements';
|
|
8
8
|
import { props } from './props';
|
|
9
9
|
import { isNumber, toNumber } from '../utils/shared';
|
|
10
|
+
import { call, createNamespace } from '../utils/components';
|
|
10
11
|
var SWIPE_DELAY = 250;
|
|
11
12
|
var SWIPE_DISTANCE = 20;
|
|
13
|
+
var {
|
|
14
|
+
n,
|
|
15
|
+
classes
|
|
16
|
+
} = createNamespace('swipe');
|
|
12
17
|
import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
13
18
|
|
|
14
19
|
var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
|
|
15
20
|
|
|
16
|
-
var _hoisted_1 =
|
|
17
|
-
class: "var-swipe",
|
|
18
|
-
ref: "swipeEl"
|
|
19
|
-
};
|
|
20
|
-
var _hoisted_2 = ["onClick"];
|
|
21
|
+
var _hoisted_1 = ["onClick"];
|
|
21
22
|
export function render(_ctx, _cache) {
|
|
22
|
-
return _openBlock(), _createElementBlock("div",
|
|
23
|
-
class: _normalizeClass(
|
|
23
|
+
return _openBlock(), _createElementBlock("div", {
|
|
24
|
+
class: _normalizeClass(_ctx.n()),
|
|
25
|
+
ref: "swipeEl"
|
|
26
|
+
}, [_createElementVNode("div", {
|
|
27
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('track'), [_ctx.vertical, _ctx.n('--vertical')])),
|
|
24
28
|
style: _normalizeStyle({
|
|
25
29
|
width: !_ctx.vertical ? _ctx.trackSize + "px" : undefined,
|
|
26
30
|
height: _ctx.vertical ? _ctx.trackSize + "px" : undefined,
|
|
@@ -43,10 +47,10 @@ export function render(_ctx, _cache) {
|
|
|
43
47
|
length: _ctx.length
|
|
44
48
|
}, () => [_ctx.indicator && _ctx.length ? (_openBlock(), _createElementBlock("div", {
|
|
45
49
|
key: 0,
|
|
46
|
-
class: _normalizeClass(
|
|
50
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('indicators'), [_ctx.vertical, _ctx.n('--indicators-vertical')]))
|
|
47
51
|
}, [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.length, (l, idx) => {
|
|
48
52
|
return _openBlock(), _createElementBlock("div", {
|
|
49
|
-
class: _normalizeClass(
|
|
53
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('indicator'), [_ctx.index === idx, _ctx.n('--indicator-active')], [_ctx.vertical, _ctx.n('--indicator-vertical')])),
|
|
50
54
|
style: _normalizeStyle({
|
|
51
55
|
background: _ctx.indicatorColor
|
|
52
56
|
}),
|
|
@@ -54,13 +58,13 @@ export function render(_ctx, _cache) {
|
|
|
54
58
|
onClick: $event => _ctx.to(idx)
|
|
55
59
|
}, null, 14
|
|
56
60
|
/* CLASS, STYLE, PROPS */
|
|
57
|
-
,
|
|
61
|
+
, _hoisted_1);
|
|
58
62
|
}), 128
|
|
59
63
|
/* KEYED_FRAGMENT */
|
|
60
64
|
))], 2
|
|
61
65
|
/* CLASS */
|
|
62
|
-
)) : _createCommentVNode("v-if", true)])],
|
|
63
|
-
/*
|
|
66
|
+
)) : _createCommentVNode("v-if", true)])], 2
|
|
67
|
+
/* CLASS */
|
|
64
68
|
);
|
|
65
69
|
}
|
|
66
70
|
export default defineComponent({
|
|
@@ -183,7 +187,7 @@ export default defineComponent({
|
|
|
183
187
|
|
|
184
188
|
nextTickFrame(() => {
|
|
185
189
|
lockDuration.value = false;
|
|
186
|
-
fn
|
|
190
|
+
call(fn);
|
|
187
191
|
});
|
|
188
192
|
};
|
|
189
193
|
|
|
@@ -291,7 +295,7 @@ export default defineComponent({
|
|
|
291
295
|
var prevIndex = index.value;
|
|
292
296
|
index.value = swipeIndexToIndex(swipeIndex);
|
|
293
297
|
startAutoplay();
|
|
294
|
-
prevIndex !== index.value && (onChange
|
|
298
|
+
prevIndex !== index.value && call(onChange, index.value);
|
|
295
299
|
}; // expose
|
|
296
300
|
|
|
297
301
|
|
|
@@ -321,7 +325,7 @@ export default defineComponent({
|
|
|
321
325
|
} = props;
|
|
322
326
|
var currentIndex = index.value;
|
|
323
327
|
index.value = boundaryIndex(currentIndex + 1);
|
|
324
|
-
onChange
|
|
328
|
+
call(onChange, index.value);
|
|
325
329
|
fixPosition(() => {
|
|
326
330
|
if (currentIndex === length.value - 1 && loop) {
|
|
327
331
|
findSwipeItem(0).setTranslate(trackSize.value);
|
|
@@ -347,7 +351,7 @@ export default defineComponent({
|
|
|
347
351
|
} = props;
|
|
348
352
|
var currentIndex = index.value;
|
|
349
353
|
index.value = boundaryIndex(currentIndex - 1);
|
|
350
|
-
onChange
|
|
354
|
+
call(onChange, index.value);
|
|
351
355
|
fixPosition(() => {
|
|
352
356
|
if (currentIndex === 0 && loop) {
|
|
353
357
|
findSwipeItem(length.value - 1).setTranslate(-trackSize.value);
|
|
@@ -394,6 +398,8 @@ export default defineComponent({
|
|
|
394
398
|
stopAutoplay();
|
|
395
399
|
});
|
|
396
400
|
return {
|
|
401
|
+
n,
|
|
402
|
+
classes,
|
|
397
403
|
length,
|
|
398
404
|
index,
|
|
399
405
|
swipeEl,
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import { defineComponent, ref } from 'vue';
|
|
2
2
|
import { useSwipe } from './provide';
|
|
3
|
-
import {
|
|
3
|
+
import { createNamespace } from '../utils/components';
|
|
4
|
+
var {
|
|
5
|
+
n
|
|
6
|
+
} = createNamespace('swipe-item');
|
|
7
|
+
import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
4
8
|
export function render(_ctx, _cache) {
|
|
5
9
|
return _openBlock(), _createElementBlock("div", {
|
|
6
|
-
class:
|
|
10
|
+
class: _normalizeClass(_ctx.n()),
|
|
7
11
|
style: _normalizeStyle({
|
|
8
12
|
width: !_ctx.vertical ? _ctx.size + "px" : undefined,
|
|
9
13
|
height: _ctx.vertical ? _ctx.size + "px" : undefined,
|
|
10
14
|
transform: "translate" + (_ctx.vertical ? 'Y' : 'X') + "(" + _ctx.translate + "px)"
|
|
11
15
|
})
|
|
12
|
-
}, [_renderSlot(_ctx.$slots, "default")],
|
|
13
|
-
/* STYLE */
|
|
16
|
+
}, [_renderSlot(_ctx.$slots, "default")], 6
|
|
17
|
+
/* CLASS, STYLE */
|
|
14
18
|
);
|
|
15
19
|
}
|
|
16
20
|
export default defineComponent({
|
|
@@ -39,6 +43,7 @@ export default defineComponent({
|
|
|
39
43
|
};
|
|
40
44
|
bindSwipe(swipeItemProvider);
|
|
41
45
|
return {
|
|
46
|
+
n,
|
|
42
47
|
size,
|
|
43
48
|
vertical,
|
|
44
49
|
translate
|
package/es/switch/Switch.js
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import { defineComponent, computed, nextTick } from 'vue';
|
|
2
|
-
import { useValidation } from '../utils/components';
|
|
2
|
+
import { useValidation, createNamespace, call } from '../utils/components';
|
|
3
3
|
import { toNumber } from '../utils/shared';
|
|
4
4
|
import { useForm } from '../form/provide';
|
|
5
5
|
import { props } from './props';
|
|
6
6
|
import VarFormDetails from '../form-details';
|
|
7
7
|
import VarLoading from '../loading';
|
|
8
8
|
import Ripple from '../ripple';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class: "var-switch"
|
|
15
|
-
};
|
|
9
|
+
var {
|
|
10
|
+
n,
|
|
11
|
+
classes
|
|
12
|
+
} = createNamespace('switch');
|
|
13
|
+
import { normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, resolveDirective as _resolveDirective, createElementBlock as _createElementBlock, withDirectives as _withDirectives, createVNode as _createVNode } from "vue";
|
|
16
14
|
export function render(_ctx, _cache) {
|
|
17
15
|
var _component_var_loading = _resolveComponent("var-loading");
|
|
18
16
|
|
|
@@ -20,23 +18,25 @@ export function render(_ctx, _cache) {
|
|
|
20
18
|
|
|
21
19
|
var _directive_ripple = _resolveDirective("ripple");
|
|
22
20
|
|
|
23
|
-
return _openBlock(), _createElementBlock("div",
|
|
24
|
-
class: _normalizeClass(
|
|
21
|
+
return _openBlock(), _createElementBlock("div", {
|
|
22
|
+
class: _normalizeClass(_ctx.n())
|
|
23
|
+
}, [_createElementVNode("div", {
|
|
24
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('block'), [_ctx.disabled || _ctx.formDisabled, _ctx.n('--disable')])),
|
|
25
25
|
onClick: _cache[0] || (_cache[0] = function () {
|
|
26
26
|
return _ctx.switchActive && _ctx.switchActive(...arguments);
|
|
27
27
|
}),
|
|
28
28
|
style: _normalizeStyle(_ctx.styleComputed.switch)
|
|
29
29
|
}, [_createElementVNode("div", {
|
|
30
30
|
style: _normalizeStyle(_ctx.styleComputed.track),
|
|
31
|
-
class: _normalizeClass(
|
|
31
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('track'), [_ctx.modelValue === _ctx.activeValue, _ctx.n('track-active')], [_ctx.errorMessage, _ctx.n('track-error')]))
|
|
32
32
|
}, null, 6
|
|
33
33
|
/* CLASS, STYLE */
|
|
34
34
|
), _withDirectives((_openBlock(), _createElementBlock("div", {
|
|
35
|
-
class:
|
|
35
|
+
class: _normalizeClass(_ctx.n('ripple')),
|
|
36
36
|
style: _normalizeStyle(_ctx.styleComputed.ripple)
|
|
37
37
|
}, [_createElementVNode("div", {
|
|
38
38
|
style: _normalizeStyle(_ctx.styleComputed.handle),
|
|
39
|
-
class: _normalizeClass(
|
|
39
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('handle'), 'var-elevation--2', [_ctx.modelValue === _ctx.activeValue, _ctx.n('handle-active')], [_ctx.errorMessage, _ctx.n('handle-error')]))
|
|
40
40
|
}, [_ctx.loading ? (_openBlock(), _createBlock(_component_var_loading, {
|
|
41
41
|
key: 0,
|
|
42
42
|
radius: _ctx.toNumber(_ctx.size) / 2 - 2
|
|
@@ -44,8 +44,8 @@ export function render(_ctx, _cache) {
|
|
|
44
44
|
/* PROPS */
|
|
45
45
|
, ["radius"])) : _createCommentVNode("v-if", true)], 6
|
|
46
46
|
/* CLASS, STYLE */
|
|
47
|
-
)],
|
|
48
|
-
/* STYLE */
|
|
47
|
+
)], 6
|
|
48
|
+
/* CLASS, STYLE */
|
|
49
49
|
)), [[_directive_ripple, {
|
|
50
50
|
disabled: !_ctx.ripple || _ctx.disabled || _ctx.loading || _ctx.formDisabled
|
|
51
51
|
}]])], 6
|
|
@@ -54,7 +54,9 @@ export function render(_ctx, _cache) {
|
|
|
54
54
|
"error-message": _ctx.errorMessage
|
|
55
55
|
}, null, 8
|
|
56
56
|
/* PROPS */
|
|
57
|
-
, ["error-message"])]
|
|
57
|
+
, ["error-message"])], 2
|
|
58
|
+
/* CLASS */
|
|
59
|
+
);
|
|
58
60
|
}
|
|
59
61
|
export default defineComponent({
|
|
60
62
|
render,
|
|
@@ -135,18 +137,16 @@ export default defineComponent({
|
|
|
135
137
|
inactiveValue,
|
|
136
138
|
'onUpdate:modelValue': updateModelValue
|
|
137
139
|
} = props;
|
|
138
|
-
onClick
|
|
140
|
+
call(onClick, event);
|
|
139
141
|
if (disabled || loading || readonly || form != null && form.disabled.value || form != null && form.readonly.value) return;
|
|
140
142
|
var newValue = modelValue === activeValue ? inactiveValue : activeValue;
|
|
141
|
-
onChange
|
|
142
|
-
updateModelValue
|
|
143
|
+
call(onChange, newValue);
|
|
144
|
+
call(updateModelValue, newValue);
|
|
143
145
|
validateWithTrigger();
|
|
144
146
|
};
|
|
145
147
|
|
|
146
148
|
var reset = () => {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
(_props$onUpdateModel = props['onUpdate:modelValue']) == null ? void 0 : _props$onUpdateModel.call(props, props.inactiveValue);
|
|
149
|
+
call(props['onUpdate:modelValue'], props.inactiveValue);
|
|
150
150
|
resetValidation();
|
|
151
151
|
};
|
|
152
152
|
|
|
@@ -155,8 +155,10 @@ export default defineComponent({
|
|
|
155
155
|
validate,
|
|
156
156
|
resetValidation
|
|
157
157
|
};
|
|
158
|
-
bindForm
|
|
158
|
+
call(bindForm, switchProvider);
|
|
159
159
|
return {
|
|
160
|
+
n,
|
|
161
|
+
classes,
|
|
160
162
|
switchActive,
|
|
161
163
|
toNumber,
|
|
162
164
|
styleComputed,
|
package/es/switch/switch.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root { --switch-track-background: #fff; --switch-track-active-background: var(--color-primary); --switch-track-error-background: var(--color-danger); --switch-ripple-color: var(--color-primary); --switch-handle-background: #fff; --switch-handle-color: #fff; --switch-handle-active-background: var(--color-primary); --switch-handle-error-background: var(--color-danger);}.var-switch { display: inline-block;}.var-
|
|
1
|
+
:root { --switch-track-background: #fff; --switch-track-active-background: var(--color-primary); --switch-track-error-background: var(--color-danger); --switch-ripple-color: var(--color-primary); --switch-handle-background: #fff; --switch-handle-color: #fff; --switch-handle-active-background: var(--color-primary); --switch-handle-error-background: var(--color-danger);}.var-switch { display: inline-block;}.var-switch__block { position: relative; display: flex; cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); align-items: center; justify-content: center;}.var-switch--disable { filter: opacity(0.6); cursor: not-allowed;}.var-switch__track { background: var(--switch-track-background); transition: background-color 0.25s; filter: opacity(0.6);}.var-switch__track-active { background-color: var(--switch-track-active-background);}.var-switch__track-error { background-color: var(--switch-track-error-background) !important;}.var-switch__ripple { position: absolute; display: flex; align-items: center; justify-content: center; color: var(--switch-ripple-color); border-radius: 50%; overflow: hidden; transition: 0.3s var(--cubic-bezier);}.var-switch__handle { border-radius: 50%; background-color: var(--switch-handle-background); display: flex; align-items: center; justify-content: center; color: var(--switch-handle-color); transition: background-color 0.25s;}.var-switch__handle-active { background-color: var(--switch-handle-active-background);}.var-switch__handle-error { background-color: var(--switch-handle-error-background) !important;}
|
package/es/switch/switch.less
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
.var-switch {
|
|
22
22
|
display: inline-block;
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
&__block {
|
|
25
25
|
position: relative;
|
|
26
26
|
display: flex;
|
|
27
27
|
cursor: pointer;
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
justify-content: center;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
&--disable {
|
|
34
34
|
filter: opacity(0.6);
|
|
35
35
|
cursor: not-allowed;
|
|
36
36
|
}
|
package/es/tab/Tab.js
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import Ripple from '../ripple';
|
|
2
2
|
import { defineComponent, ref, computed, watch } from 'vue';
|
|
3
3
|
import { props } from './props';
|
|
4
|
+
import { createNamespace } from '../utils/components';
|
|
4
5
|
import { useTabs } from './provide';
|
|
6
|
+
var {
|
|
7
|
+
n,
|
|
8
|
+
classes
|
|
9
|
+
} = createNamespace('tab');
|
|
5
10
|
import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, resolveDirective as _resolveDirective, openBlock as _openBlock, createElementBlock as _createElementBlock, withDirectives as _withDirectives } from "vue";
|
|
6
11
|
export function render(_ctx, _cache) {
|
|
7
12
|
var _directive_ripple = _resolveDirective("ripple");
|
|
8
13
|
|
|
9
14
|
return _withDirectives((_openBlock(), _createElementBlock("div", {
|
|
10
|
-
class: _normalizeClass(
|
|
15
|
+
class: _normalizeClass(_ctx.classes(_ctx.n(), 'var--box', _ctx.computeColorClass(), _ctx.n("--" + _ctx.itemDirection))),
|
|
11
16
|
ref: "tabEl",
|
|
12
17
|
style: _normalizeStyle({
|
|
13
18
|
color: _ctx.computeColorStyle()
|
|
@@ -90,6 +95,8 @@ export default defineComponent({
|
|
|
90
95
|
watch(() => props.name, resize);
|
|
91
96
|
watch(() => props.disabled, resize);
|
|
92
97
|
return {
|
|
98
|
+
n,
|
|
99
|
+
classes,
|
|
93
100
|
tabEl,
|
|
94
101
|
active,
|
|
95
102
|
activeColor,
|
package/es/tab-item/TabItem.js
CHANGED
|
@@ -2,12 +2,17 @@ import VarSwipeItem from '../swipe-item';
|
|
|
2
2
|
import { defineComponent, ref, computed } from 'vue';
|
|
3
3
|
import { useTabsItems } from './provide';
|
|
4
4
|
import { props } from './props';
|
|
5
|
+
import { createNamespace } from '../utils/components';
|
|
6
|
+
var {
|
|
7
|
+
n,
|
|
8
|
+
classes
|
|
9
|
+
} = createNamespace('tab-item');
|
|
5
10
|
import { renderSlot as _renderSlot, createCommentVNode as _createCommentVNode, resolveComponent as _resolveComponent, normalizeClass as _normalizeClass, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from "vue";
|
|
6
11
|
export function render(_ctx, _cache) {
|
|
7
12
|
var _component_var_swipe_item = _resolveComponent("var-swipe-item");
|
|
8
13
|
|
|
9
14
|
return _openBlock(), _createBlock(_component_var_swipe_item, {
|
|
10
|
-
class: _normalizeClass(
|
|
15
|
+
class: _normalizeClass(_ctx.classes(_ctx.n(), [!_ctx.current, _ctx.n('--inactive')])),
|
|
11
16
|
"var-tab-item-cover": ""
|
|
12
17
|
}, {
|
|
13
18
|
default: _withCtx(() => [_ctx.initSlot ? _renderSlot(_ctx.$slots, "default", {
|
|
@@ -52,6 +57,8 @@ export default defineComponent({
|
|
|
52
57
|
};
|
|
53
58
|
bindTabsItems(tabItemProvider);
|
|
54
59
|
return {
|
|
60
|
+
n,
|
|
61
|
+
classes,
|
|
55
62
|
current,
|
|
56
63
|
initSlot
|
|
57
64
|
};
|
package/es/table/Table.js
CHANGED
|
@@ -1,28 +1,33 @@
|
|
|
1
1
|
import { defineComponent } from 'vue';
|
|
2
2
|
import { toSizeUnit } from '../utils/elements';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
var _hoisted_2 = {
|
|
11
|
-
class: "var-table__main"
|
|
12
|
-
};
|
|
13
|
-
var _hoisted_3 = {
|
|
14
|
-
key: 0,
|
|
15
|
-
class: "var-table__footer"
|
|
16
|
-
};
|
|
3
|
+
import { createNamespace } from '../utils/components';
|
|
4
|
+
var {
|
|
5
|
+
n,
|
|
6
|
+
classes
|
|
7
|
+
} = createNamespace('table');
|
|
8
|
+
import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode } from "vue";
|
|
17
9
|
export function render(_ctx, _cache) {
|
|
18
|
-
return _openBlock(), _createElementBlock("div",
|
|
19
|
-
class:
|
|
10
|
+
return _openBlock(), _createElementBlock("div", {
|
|
11
|
+
class: _normalizeClass(_ctx.classes(_ctx.n(), 'var-elevation--1 var--box'))
|
|
12
|
+
}, [_createElementVNode("div", {
|
|
13
|
+
class: _normalizeClass(_ctx.n('main'))
|
|
14
|
+
}, [_createElementVNode("table", {
|
|
15
|
+
class: _normalizeClass(_ctx.n('table')),
|
|
20
16
|
style: _normalizeStyle({
|
|
21
17
|
width: _ctx.toSizeUnit(_ctx.fullWidth)
|
|
22
18
|
})
|
|
23
|
-
}, [_renderSlot(_ctx.$slots, "default")],
|
|
24
|
-
/* STYLE */
|
|
25
|
-
)]
|
|
19
|
+
}, [_renderSlot(_ctx.$slots, "default")], 6
|
|
20
|
+
/* CLASS, STYLE */
|
|
21
|
+
)], 2
|
|
22
|
+
/* CLASS */
|
|
23
|
+
), _ctx.$slots.footer ? (_openBlock(), _createElementBlock("div", {
|
|
24
|
+
key: 0,
|
|
25
|
+
class: _normalizeClass(_ctx.n('footer'))
|
|
26
|
+
}, [_renderSlot(_ctx.$slots, "footer")], 2
|
|
27
|
+
/* CLASS */
|
|
28
|
+
)) : _createCommentVNode("v-if", true)], 2
|
|
29
|
+
/* CLASS */
|
|
30
|
+
);
|
|
26
31
|
}
|
|
27
32
|
export default defineComponent({
|
|
28
33
|
render,
|
|
@@ -36,7 +41,9 @@ export default defineComponent({
|
|
|
36
41
|
|
|
37
42
|
setup() {
|
|
38
43
|
return {
|
|
39
|
-
toSizeUnit
|
|
44
|
+
toSizeUnit,
|
|
45
|
+
n,
|
|
46
|
+
classes
|
|
40
47
|
};
|
|
41
48
|
}
|
|
42
49
|
|
package/es/tabs/Tabs.js
CHANGED
|
@@ -8,21 +8,26 @@ import { props } from './props';
|
|
|
8
8
|
import { useTabList } from './provide';
|
|
9
9
|
import { isNumber, linear } from '../utils/shared';
|
|
10
10
|
import { toSizeUnit, scrollTo, doubleRaf } from '../utils/elements';
|
|
11
|
+
import { createNamespace, call } from '../utils/components';
|
|
12
|
+
var {
|
|
13
|
+
n,
|
|
14
|
+
classes
|
|
15
|
+
} = createNamespace('tabs');
|
|
11
16
|
import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, mergeProps as _mergeProps, resolveDynamicComponent as _resolveDynamicComponent, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from "vue";
|
|
12
17
|
export function render(_ctx, _cache) {
|
|
13
18
|
return _openBlock(), _createBlock(_resolveDynamicComponent(_ctx.sticky ? 'var-sticky' : _ctx.Transition), {
|
|
14
19
|
"offset-top": _ctx.sticky ? _ctx.offsetTop : null
|
|
15
20
|
}, {
|
|
16
21
|
default: _withCtx(() => [_createElementVNode("div", _mergeProps({
|
|
17
|
-
class:
|
|
22
|
+
class: _ctx.classes(_ctx.n(), 'var--box', _ctx.n("--item-" + _ctx.itemDirection), _ctx.n("--layout-" + _ctx.layoutDirection + "-padding"), [_ctx.elevation, 'var-elevation--4'], [_ctx.fixedBottom, _ctx.n('--fixed-bottom')]),
|
|
18
23
|
style: {
|
|
19
24
|
background: _ctx.color
|
|
20
25
|
}
|
|
21
26
|
}, _ctx.$attrs), [_createElementVNode("div", {
|
|
22
|
-
|
|
23
|
-
|
|
27
|
+
ref: "scrollerEl",
|
|
28
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('tab-wrap'), [_ctx.scrollable, _ctx.n("--layout-" + _ctx.layoutDirection + "-scrollable")], _ctx.n("--layout-" + _ctx.layoutDirection)))
|
|
24
29
|
}, [_renderSlot(_ctx.$slots, "default"), _createElementVNode("div", {
|
|
25
|
-
class: _normalizeClass(
|
|
30
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('indicator'), _ctx.n("--layout-" + _ctx.layoutDirection + "-indicator"))),
|
|
26
31
|
style: _normalizeStyle({
|
|
27
32
|
width: _ctx.layoutDirection === 'horizontal' ? _ctx.indicatorWidth : _ctx.toSizeUnit(_ctx.indicatorSize),
|
|
28
33
|
height: _ctx.layoutDirection === 'horizontal' ? _ctx.toSizeUnit(_ctx.indicatorSize) : _ctx.indicatorHeight,
|
|
@@ -71,7 +76,7 @@ export default defineComponent({
|
|
|
71
76
|
} = useTabList();
|
|
72
77
|
|
|
73
78
|
var onTabClick = tab => {
|
|
74
|
-
var _tab$name$value
|
|
79
|
+
var _tab$name$value;
|
|
75
80
|
|
|
76
81
|
var currentActive = (_tab$name$value = tab.name.value) != null ? _tab$name$value : tab.index.value;
|
|
77
82
|
var {
|
|
@@ -79,9 +84,9 @@ export default defineComponent({
|
|
|
79
84
|
onChange,
|
|
80
85
|
onClick
|
|
81
86
|
} = props;
|
|
82
|
-
(
|
|
83
|
-
onClick
|
|
84
|
-
currentActive !== active && (onChange
|
|
87
|
+
call(props['onUpdate:active'], currentActive);
|
|
88
|
+
call(onClick, currentActive);
|
|
89
|
+
currentActive !== active && call(onChange, currentActive);
|
|
85
90
|
};
|
|
86
91
|
|
|
87
92
|
var matchName = () => {
|
|
@@ -103,8 +108,6 @@ export default defineComponent({
|
|
|
103
108
|
};
|
|
104
109
|
|
|
105
110
|
var matchBoundary = () => {
|
|
106
|
-
var _props$onUpdateActiv2, _props$onUpdateActiv3;
|
|
107
|
-
|
|
108
111
|
if (length.value === 0) {
|
|
109
112
|
return;
|
|
110
113
|
}
|
|
@@ -112,7 +115,7 @@ export default defineComponent({
|
|
|
112
115
|
var {
|
|
113
116
|
active
|
|
114
117
|
} = props;
|
|
115
|
-
isNumber(active) ? active > length.value - 1 ? (
|
|
118
|
+
isNumber(active) ? active > length.value - 1 ? call(props['onUpdate:active'], length.value - 1) : call(props['onUpdate:active'], 0) : null;
|
|
116
119
|
return matchIndex();
|
|
117
120
|
};
|
|
118
121
|
|
|
@@ -201,6 +204,8 @@ export default defineComponent({
|
|
|
201
204
|
scrollerEl,
|
|
202
205
|
Transition,
|
|
203
206
|
toSizeUnit,
|
|
207
|
+
n,
|
|
208
|
+
classes,
|
|
204
209
|
resize
|
|
205
210
|
};
|
|
206
211
|
}
|
|
@@ -2,12 +2,16 @@ import VarSwipe from '../swipe';
|
|
|
2
2
|
import { defineComponent, watch, ref } from 'vue';
|
|
3
3
|
import { useTabItem } from './provide';
|
|
4
4
|
import { props } from './props';
|
|
5
|
-
import {
|
|
5
|
+
import { call, createNamespace } from '../utils/components';
|
|
6
|
+
var {
|
|
7
|
+
n
|
|
8
|
+
} = createNamespace('tabs-items');
|
|
9
|
+
import { renderSlot as _renderSlot, resolveComponent as _resolveComponent, normalizeClass as _normalizeClass, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from "vue";
|
|
6
10
|
export function render(_ctx, _cache) {
|
|
7
11
|
var _component_var_swipe = _resolveComponent("var-swipe");
|
|
8
12
|
|
|
9
13
|
return _openBlock(), _createBlock(_component_var_swipe, {
|
|
10
|
-
class:
|
|
14
|
+
class: _normalizeClass(_ctx.n()),
|
|
11
15
|
ref: "swipe",
|
|
12
16
|
loop: _ctx.loop,
|
|
13
17
|
touchable: _ctx.canSwipe,
|
|
@@ -20,7 +24,7 @@ export function render(_ctx, _cache) {
|
|
|
20
24
|
|
|
21
25
|
}, 8
|
|
22
26
|
/* PROPS */
|
|
23
|
-
, ["loop", "touchable", "onChange"]);
|
|
27
|
+
, ["class", "loop", "touchable", "onChange"]);
|
|
24
28
|
}
|
|
25
29
|
export default defineComponent({
|
|
26
30
|
render,
|
|
@@ -80,7 +84,7 @@ export default defineComponent({
|
|
|
80
84
|
};
|
|
81
85
|
|
|
82
86
|
var handleSwipeChange = currentIndex => {
|
|
83
|
-
var _tabItem$name$value
|
|
87
|
+
var _tabItem$name$value;
|
|
84
88
|
|
|
85
89
|
var tabItem = tabItemList.find(_ref4 => {
|
|
86
90
|
var {
|
|
@@ -89,7 +93,7 @@ export default defineComponent({
|
|
|
89
93
|
return index.value === currentIndex;
|
|
90
94
|
});
|
|
91
95
|
var active = (_tabItem$name$value = tabItem.name.value) != null ? _tabItem$name$value : tabItem.index.value;
|
|
92
|
-
(
|
|
96
|
+
call(props['onUpdate:active'], active);
|
|
93
97
|
};
|
|
94
98
|
|
|
95
99
|
var tabsItemsProvider = {};
|
|
@@ -98,6 +102,7 @@ export default defineComponent({
|
|
|
98
102
|
watch(() => length.value, () => handleActiveChange(props.active));
|
|
99
103
|
return {
|
|
100
104
|
swipe,
|
|
105
|
+
n,
|
|
101
106
|
handleSwipeChange
|
|
102
107
|
};
|
|
103
108
|
}
|
package/es/themes/dark/index.js
CHANGED
|
@@ -27,6 +27,8 @@ import timePicker from './timePicker';
|
|
|
27
27
|
import uploader from './uploader';
|
|
28
28
|
import tabs from './tabs';
|
|
29
29
|
import appBar from './appBar';
|
|
30
|
+
import bottomNavigation from './bottomNavigation';
|
|
31
|
+
import bottomNavigationItem from './bottomNavigationItem';
|
|
30
32
|
export default _extends({
|
|
31
33
|
// common
|
|
32
34
|
'--color-body': '#1e1e1e',
|
|
@@ -38,4 +40,4 @@ export default _extends({
|
|
|
38
40
|
'--color-danger': '#ef5350',
|
|
39
41
|
'--color-disabled': '#404040',
|
|
40
42
|
'--color-text-disabled': '#757575'
|
|
41
|
-
}, button, cell, card, timePicker, datePicker, skeleton, tabs, tab, popup, dialog, actionSheet, chip, badge, uploader, collapse, pullRefresh, switchThemes, steps, pagination, table, input, select, radio, checkbox, divider, picker, appBar);
|
|
43
|
+
}, button, cell, card, timePicker, datePicker, skeleton, tabs, tab, popup, dialog, actionSheet, chip, badge, uploader, collapse, pullRefresh, switchThemes, steps, pagination, table, input, select, radio, checkbox, divider, picker, appBar, bottomNavigation, bottomNavigationItem);
|