@varlet/ui 1.26.9 → 1.27.0-alpha.1649265140569
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/README.en-US.md +1 -1
- package/README.md +1 -1
- 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 +204 -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 +51 -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/snackbar/style/index.js +1 -1
- package/es/snackbar/style/less.js +1 -1
- 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 +23 -14
- 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 +2093 -1504
- 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 +221 -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 +51 -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 +25 -14
- 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 +5 -5
- 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
|
@@ -1,35 +1,40 @@
|
|
|
1
1
|
import { defineComponent } from 'vue';
|
|
2
|
+
import { createNamespace } from '../utils/components';
|
|
2
3
|
import { props } from './props';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var _hoisted_1 = {
|
|
8
|
-
key: 0,
|
|
9
|
-
class: "var-form-details"
|
|
10
|
-
};
|
|
11
|
-
var _hoisted_2 = {
|
|
12
|
-
class: "var-form-details__message"
|
|
13
|
-
};
|
|
14
|
-
var _hoisted_3 = {
|
|
15
|
-
class: "var-form-details__length"
|
|
16
|
-
};
|
|
4
|
+
var {
|
|
5
|
+
n
|
|
6
|
+
} = createNamespace('form-details');
|
|
7
|
+
import { toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, Transition as _Transition, withCtx as _withCtx, createBlock as _createBlock } from "vue";
|
|
17
8
|
export function render(_ctx, _cache) {
|
|
18
9
|
return _openBlock(), _createBlock(_Transition, {
|
|
19
|
-
name:
|
|
10
|
+
name: _ctx.n()
|
|
20
11
|
}, {
|
|
21
|
-
default: _withCtx(() => [_ctx.errorMessage || _ctx.maxlengthText ? (_openBlock(), _createElementBlock("div",
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
12
|
+
default: _withCtx(() => [_ctx.errorMessage || _ctx.maxlengthText ? (_openBlock(), _createElementBlock("div", {
|
|
13
|
+
key: 0,
|
|
14
|
+
class: _normalizeClass(_ctx.n())
|
|
15
|
+
}, [_createElementVNode("div", {
|
|
16
|
+
class: _normalizeClass(_ctx.n('message'))
|
|
17
|
+
}, _toDisplayString(_ctx.errorMessage), 3
|
|
18
|
+
/* TEXT, CLASS */
|
|
19
|
+
), _createElementVNode("div", {
|
|
20
|
+
class: _normalizeClass(_ctx.n('length'))
|
|
21
|
+
}, _toDisplayString(_ctx.maxlengthText), 3
|
|
22
|
+
/* TEXT, CLASS */
|
|
23
|
+
)], 2
|
|
24
|
+
/* CLASS */
|
|
25
|
+
)) : _createCommentVNode("v-if", true)]),
|
|
26
26
|
_: 1
|
|
27
27
|
/* STABLE */
|
|
28
28
|
|
|
29
|
-
}
|
|
29
|
+
}, 8
|
|
30
|
+
/* PROPS */
|
|
31
|
+
, ["name"]);
|
|
30
32
|
}
|
|
31
33
|
export default defineComponent({
|
|
32
34
|
render,
|
|
33
35
|
name: 'VarFormDetails',
|
|
34
|
-
props
|
|
36
|
+
props,
|
|
37
|
+
setup: () => ({
|
|
38
|
+
n
|
|
39
|
+
})
|
|
35
40
|
});
|
package/es/icon/Icon.js
CHANGED
|
@@ -6,10 +6,15 @@ import { defineComponent, watch, ref, nextTick } from 'vue';
|
|
|
6
6
|
import { isURL, toNumber } from '../utils/shared';
|
|
7
7
|
import { props } from './props';
|
|
8
8
|
import { toSizeUnit } from '../utils/elements';
|
|
9
|
+
import { createNamespace } from '../utils/components';
|
|
10
|
+
var {
|
|
11
|
+
n,
|
|
12
|
+
classes
|
|
13
|
+
} = createNamespace('icon');
|
|
9
14
|
import { resolveDynamicComponent as _resolveDynamicComponent, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createBlock as _createBlock } from "vue";
|
|
10
15
|
export function render(_ctx, _cache) {
|
|
11
16
|
return _openBlock(), _createBlock(_resolveDynamicComponent(_ctx.isURL(_ctx.name) ? 'img' : 'i'), {
|
|
12
|
-
class: _normalizeClass(
|
|
17
|
+
class: _normalizeClass(_ctx.classes(_ctx.n(), _ctx.namespace + "--set", [_ctx.isURL(_ctx.name), _ctx.n('image'), _ctx.namespace + "-" + _ctx.nextName], [_ctx.shrinking, _ctx.n('--shrinking')])),
|
|
13
18
|
style: _normalizeStyle({
|
|
14
19
|
color: _ctx.color,
|
|
15
20
|
transition: "transform " + _ctx.toNumber(_ctx.transition) + "ms",
|
|
@@ -60,6 +65,8 @@ export default defineComponent({
|
|
|
60
65
|
immediate: true
|
|
61
66
|
});
|
|
62
67
|
return {
|
|
68
|
+
n,
|
|
69
|
+
classes,
|
|
63
70
|
nextName,
|
|
64
71
|
shrinking,
|
|
65
72
|
isURL,
|
package/es/image/Image.js
CHANGED
|
@@ -3,7 +3,12 @@ import Lazy from '../lazy';
|
|
|
3
3
|
import { defineComponent } from 'vue';
|
|
4
4
|
import { props } from './props';
|
|
5
5
|
import { toSizeUnit } from '../utils/elements';
|
|
6
|
-
import {
|
|
6
|
+
import { createNamespace, call } from '../utils/components';
|
|
7
|
+
var {
|
|
8
|
+
n,
|
|
9
|
+
classes
|
|
10
|
+
} = createNamespace('image');
|
|
11
|
+
import { normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, resolveDirective as _resolveDirective, withDirectives as _withDirectives, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
7
12
|
|
|
8
13
|
var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
|
|
9
14
|
|
|
@@ -15,7 +20,7 @@ export function render(_ctx, _cache) {
|
|
|
15
20
|
var _directive_ripple = _resolveDirective("ripple");
|
|
16
21
|
|
|
17
22
|
return _withDirectives((_openBlock(), _createElementBlock("div", {
|
|
18
|
-
class: _normalizeClass(
|
|
23
|
+
class: _normalizeClass(_ctx.classes(_ctx.n(), 'var--box', [!_ctx.block, 'var--inline-block'])),
|
|
19
24
|
style: _normalizeStyle({
|
|
20
25
|
width: _ctx.toSizeUnit(_ctx.width),
|
|
21
26
|
height: _ctx.toSizeUnit(_ctx.height),
|
|
@@ -23,7 +28,7 @@ export function render(_ctx, _cache) {
|
|
|
23
28
|
})
|
|
24
29
|
}, [_ctx.lazy ? _withDirectives((_openBlock(), _createElementBlock("img", {
|
|
25
30
|
key: 0,
|
|
26
|
-
class:
|
|
31
|
+
class: _normalizeClass(_ctx.n('image')),
|
|
27
32
|
alt: _ctx.alt,
|
|
28
33
|
"lazy-error": _ctx.error,
|
|
29
34
|
"lazy-loading": _ctx.loading,
|
|
@@ -39,11 +44,11 @@ export function render(_ctx, _cache) {
|
|
|
39
44
|
onClick: _cache[2] || (_cache[2] = function () {
|
|
40
45
|
return _ctx.onClick && _ctx.onClick(...arguments);
|
|
41
46
|
})
|
|
42
|
-
}, null,
|
|
43
|
-
/* STYLE, PROPS, HYDRATE_EVENTS */
|
|
47
|
+
}, null, 46
|
|
48
|
+
/* CLASS, STYLE, PROPS, HYDRATE_EVENTS */
|
|
44
49
|
, _hoisted_1)), [[_directive_lazy, _ctx.src]]) : (_openBlock(), _createElementBlock("img", {
|
|
45
50
|
key: 1,
|
|
46
|
-
class:
|
|
51
|
+
class: _normalizeClass(_ctx.n('image')),
|
|
47
52
|
alt: _ctx.alt,
|
|
48
53
|
style: _normalizeStyle({
|
|
49
54
|
objectFit: _ctx.fit
|
|
@@ -58,8 +63,8 @@ export function render(_ctx, _cache) {
|
|
|
58
63
|
onClick: _cache[5] || (_cache[5] = function () {
|
|
59
64
|
return _ctx.onClick && _ctx.onClick(...arguments);
|
|
60
65
|
})
|
|
61
|
-
}, null,
|
|
62
|
-
/* STYLE, PROPS, HYDRATE_EVENTS */
|
|
66
|
+
}, null, 46
|
|
67
|
+
/* CLASS, STYLE, PROPS, HYDRATE_EVENTS */
|
|
63
68
|
, _hoisted_2))], 6
|
|
64
69
|
/* CLASS, STYLE */
|
|
65
70
|
)), [[_directive_ripple, {
|
|
@@ -85,10 +90,10 @@ export default defineComponent({
|
|
|
85
90
|
} = props;
|
|
86
91
|
|
|
87
92
|
if (lazy) {
|
|
88
|
-
el._lazy.state === 'success' && (onLoad
|
|
89
|
-
el._lazy.state === 'error' && (onError
|
|
93
|
+
el._lazy.state === 'success' && call(onLoad, e);
|
|
94
|
+
el._lazy.state === 'error' && call(onError, e);
|
|
90
95
|
} else {
|
|
91
|
-
onLoad
|
|
96
|
+
call(onLoad, e);
|
|
92
97
|
}
|
|
93
98
|
};
|
|
94
99
|
|
|
@@ -97,10 +102,12 @@ export default defineComponent({
|
|
|
97
102
|
lazy,
|
|
98
103
|
onError
|
|
99
104
|
} = props;
|
|
100
|
-
!lazy && (onError
|
|
105
|
+
!lazy && call(onError, e);
|
|
101
106
|
};
|
|
102
107
|
|
|
103
108
|
return {
|
|
109
|
+
n,
|
|
110
|
+
classes,
|
|
104
111
|
toSizeUnit,
|
|
105
112
|
handleLoad,
|
|
106
113
|
handleError
|
|
@@ -5,22 +5,20 @@ import VarPopup from '../popup';
|
|
|
5
5
|
import { defineComponent, ref, computed, watch } from 'vue';
|
|
6
6
|
import { props } from './props';
|
|
7
7
|
import { toNumber } from '../utils/shared';
|
|
8
|
+
import { call, createNamespace } from '../utils/components';
|
|
9
|
+
var {
|
|
10
|
+
n,
|
|
11
|
+
classes
|
|
12
|
+
} = createNamespace('image-preview');
|
|
8
13
|
var DISTANCE_OFFSET = 12;
|
|
9
14
|
var EVENT_DELAY = 200;
|
|
10
15
|
var TAP_DELAY = 350;
|
|
11
16
|
var ANIMATION_DURATION = 200;
|
|
12
|
-
import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createElementVNode as _createElementVNode, normalizeStyle as _normalizeStyle, resolveComponent as _resolveComponent, withCtx as _withCtx, createBlock as _createBlock, renderSlot as _renderSlot, toDisplayString as _toDisplayString, createCommentVNode as _createCommentVNode, mergeProps as _mergeProps, createVNode as _createVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
17
|
+
import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, normalizeStyle as _normalizeStyle, resolveComponent as _resolveComponent, withCtx as _withCtx, createBlock as _createBlock, renderSlot as _renderSlot, toDisplayString as _toDisplayString, createCommentVNode as _createCommentVNode, mergeProps as _mergeProps, createVNode as _createVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
13
18
|
|
|
14
19
|
var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
|
|
15
20
|
|
|
16
21
|
var _hoisted_1 = ["src", "alt"];
|
|
17
|
-
var _hoisted_2 = {
|
|
18
|
-
key: 0,
|
|
19
|
-
class: "var-image-preview__indicators"
|
|
20
|
-
};
|
|
21
|
-
var _hoisted_3 = {
|
|
22
|
-
class: "var-image-preview__extra"
|
|
23
|
-
};
|
|
24
22
|
export function render(_ctx, _cache) {
|
|
25
23
|
var _component_var_swipe_item = _resolveComponent("var-swipe-item");
|
|
26
24
|
|
|
@@ -31,7 +29,7 @@ export function render(_ctx, _cache) {
|
|
|
31
29
|
var _component_var_popup = _resolveComponent("var-popup");
|
|
32
30
|
|
|
33
31
|
return _openBlock(), _createBlock(_component_var_popup, {
|
|
34
|
-
class:
|
|
32
|
+
class: _normalizeClass(_ctx.n('popup')),
|
|
35
33
|
"var-image-preview-cover": "",
|
|
36
34
|
transition: "var-fade",
|
|
37
35
|
show: _ctx.popupShow,
|
|
@@ -46,7 +44,7 @@ export function render(_ctx, _cache) {
|
|
|
46
44
|
onRouteChange: _ctx.onRouteChange
|
|
47
45
|
}, {
|
|
48
46
|
default: _withCtx(() => [_createVNode(_component_var_swipe, _mergeProps({
|
|
49
|
-
class:
|
|
47
|
+
class: _ctx.n('swipe'),
|
|
50
48
|
"var-image-preview-cover": "",
|
|
51
49
|
touchable: _ctx.canSwipe,
|
|
52
50
|
indicator: _ctx.indicator && _ctx.images.length > 1,
|
|
@@ -56,12 +54,12 @@ export function render(_ctx, _cache) {
|
|
|
56
54
|
}, _ctx.$attrs), {
|
|
57
55
|
default: _withCtx(() => [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.images, image => {
|
|
58
56
|
return _openBlock(), _createBlock(_component_var_swipe_item, {
|
|
59
|
-
class:
|
|
57
|
+
class: _normalizeClass(_ctx.n('swipe-item')),
|
|
60
58
|
"var-image-preview-cover": "",
|
|
61
59
|
key: image
|
|
62
60
|
}, {
|
|
63
61
|
default: _withCtx(() => [_createElementVNode("div", {
|
|
64
|
-
class:
|
|
62
|
+
class: _normalizeClass(_ctx.n('zoom-container')),
|
|
65
63
|
style: _normalizeStyle({
|
|
66
64
|
transform: "scale(" + _ctx.scale + ") translate(" + _ctx.translateX + "px, " + _ctx.translateY + "px)",
|
|
67
65
|
transitionTimingFunction: _ctx.transitionTimingFunction,
|
|
@@ -77,20 +75,20 @@ export function render(_ctx, _cache) {
|
|
|
77
75
|
return _ctx.handleTouchend && _ctx.handleTouchend(...arguments);
|
|
78
76
|
})
|
|
79
77
|
}, [_createElementVNode("img", {
|
|
80
|
-
class:
|
|
78
|
+
class: _normalizeClass(_ctx.n('image')),
|
|
81
79
|
src: image,
|
|
82
80
|
alt: image
|
|
83
|
-
}, null,
|
|
84
|
-
/* PROPS */
|
|
85
|
-
, _hoisted_1)],
|
|
86
|
-
/* STYLE, HYDRATE_EVENTS */
|
|
81
|
+
}, null, 10
|
|
82
|
+
/* CLASS, PROPS */
|
|
83
|
+
, _hoisted_1)], 38
|
|
84
|
+
/* CLASS, STYLE, HYDRATE_EVENTS */
|
|
87
85
|
)]),
|
|
88
86
|
_: 2
|
|
89
87
|
/* DYNAMIC */
|
|
90
88
|
|
|
91
|
-
},
|
|
92
|
-
/* DYNAMIC_SLOTS */
|
|
93
|
-
);
|
|
89
|
+
}, 1032
|
|
90
|
+
/* PROPS, DYNAMIC_SLOTS */
|
|
91
|
+
, ["class"]);
|
|
94
92
|
}), 128
|
|
95
93
|
/* KEYED_FRAGMENT */
|
|
96
94
|
))]),
|
|
@@ -102,8 +100,11 @@ export function render(_ctx, _cache) {
|
|
|
102
100
|
return [_renderSlot(_ctx.$slots, "indicator", {
|
|
103
101
|
index: index,
|
|
104
102
|
length: length
|
|
105
|
-
}, () => [_ctx.indicator && _ctx.images.length > 1 ? (_openBlock(), _createElementBlock("div",
|
|
106
|
-
|
|
103
|
+
}, () => [_ctx.indicator && _ctx.images.length > 1 ? (_openBlock(), _createElementBlock("div", {
|
|
104
|
+
key: 0,
|
|
105
|
+
class: _normalizeClass(_ctx.n('indicators'))
|
|
106
|
+
}, _toDisplayString(index + 1) + " / " + _toDisplayString(length), 3
|
|
107
|
+
/* TEXT, CLASS */
|
|
107
108
|
)) : _createCommentVNode("v-if", true)])];
|
|
108
109
|
}),
|
|
109
110
|
_: 3
|
|
@@ -111,21 +112,25 @@ export function render(_ctx, _cache) {
|
|
|
111
112
|
|
|
112
113
|
}, 16
|
|
113
114
|
/* FULL_PROPS */
|
|
114
|
-
, ["touchable", "indicator", "initial-index", "loop", "onChange"]), _renderSlot(_ctx.$slots, "close-icon", {}, () => [_ctx.closeable ? (_openBlock(), _createBlock(_component_var_icon, {
|
|
115
|
+
, ["class", "touchable", "indicator", "initial-index", "loop", "onChange"]), _renderSlot(_ctx.$slots, "close-icon", {}, () => [_ctx.closeable ? (_openBlock(), _createBlock(_component_var_icon, {
|
|
115
116
|
key: 0,
|
|
116
|
-
class:
|
|
117
|
+
class: _normalizeClass(_ctx.n('close-icon')),
|
|
117
118
|
name: "close-circle",
|
|
118
119
|
"var-image-preview-cover": "",
|
|
119
120
|
onClick: _ctx.close
|
|
120
121
|
}, null, 8
|
|
121
122
|
/* PROPS */
|
|
122
|
-
, ["onClick"])) : _createCommentVNode("v-if", true)]), _createElementVNode("div",
|
|
123
|
+
, ["class", "onClick"])) : _createCommentVNode("v-if", true)]), _createElementVNode("div", {
|
|
124
|
+
class: _normalizeClass(_ctx.n('extra'))
|
|
125
|
+
}, [_renderSlot(_ctx.$slots, "extra")], 2
|
|
126
|
+
/* CLASS */
|
|
127
|
+
)]),
|
|
123
128
|
_: 3
|
|
124
129
|
/* FORWARDED */
|
|
125
130
|
|
|
126
131
|
}, 8
|
|
127
132
|
/* PROPS */
|
|
128
|
-
, ["show", "lock-scroll", "teleport", "onOpen", "onClose", "onClosed", "onOpened", "onRouteChange"]);
|
|
133
|
+
, ["class", "show", "lock-scroll", "teleport", "onOpen", "onClose", "onClosed", "onOpened", "onRouteChange"]);
|
|
129
134
|
}
|
|
130
135
|
export default defineComponent({
|
|
131
136
|
render,
|
|
@@ -325,19 +330,13 @@ export default defineComponent({
|
|
|
325
330
|
};
|
|
326
331
|
|
|
327
332
|
var close = () => {
|
|
328
|
-
var _props$onUpdateShow2;
|
|
329
|
-
|
|
330
333
|
if (scale.value > 1) {
|
|
331
334
|
zoomOut();
|
|
332
|
-
setTimeout(() =>
|
|
333
|
-
var _props$onUpdateShow;
|
|
334
|
-
|
|
335
|
-
return (_props$onUpdateShow = props['onUpdate:show']) == null ? void 0 : _props$onUpdateShow.call(props, false);
|
|
336
|
-
}, ANIMATION_DURATION);
|
|
335
|
+
setTimeout(() => call(props['onUpdate:show'], false), ANIMATION_DURATION);
|
|
337
336
|
return;
|
|
338
337
|
}
|
|
339
338
|
|
|
340
|
-
(
|
|
339
|
+
call(props['onUpdate:show'], false);
|
|
341
340
|
};
|
|
342
341
|
|
|
343
342
|
watch(() => props.show, newValue => {
|
|
@@ -346,6 +345,8 @@ export default defineComponent({
|
|
|
346
345
|
immediate: true
|
|
347
346
|
});
|
|
348
347
|
return {
|
|
348
|
+
n,
|
|
349
|
+
classes,
|
|
349
350
|
initialIndex,
|
|
350
351
|
popupShow,
|
|
351
352
|
scale,
|
|
@@ -2,6 +2,11 @@ import VarSticky from '../sticky';
|
|
|
2
2
|
import { computed, defineComponent, ref, Transition } from 'vue';
|
|
3
3
|
import { useIndexBar } from './provide';
|
|
4
4
|
import { props } from './props';
|
|
5
|
+
import { createNamespace } from '../utils/components';
|
|
6
|
+
var {
|
|
7
|
+
n,
|
|
8
|
+
classes
|
|
9
|
+
} = createNamespace('index-anchor');
|
|
5
10
|
import { renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, mergeProps as _mergeProps, createElementVNode as _createElementVNode, resolveDynamicComponent as _resolveDynamicComponent, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from "vue";
|
|
6
11
|
export function render(_ctx, _cache) {
|
|
7
12
|
return _openBlock(), _createBlock(_resolveDynamicComponent(_ctx.sticky ? 'var-sticky' : _ctx.Transition), {
|
|
@@ -12,7 +17,7 @@ export function render(_ctx, _cache) {
|
|
|
12
17
|
ref: "anchorEl"
|
|
13
18
|
}, {
|
|
14
19
|
default: _withCtx(() => [_createElementVNode("div", _mergeProps({
|
|
15
|
-
class:
|
|
20
|
+
class: _ctx.n()
|
|
16
21
|
}, _ctx.$attrs), [_renderSlot(_ctx.$slots, "default", {}, () => [_createTextVNode(_toDisplayString(_ctx.name), 1
|
|
17
22
|
/* TEXT */
|
|
18
23
|
)])], 16
|
|
@@ -70,6 +75,8 @@ export default defineComponent({
|
|
|
70
75
|
};
|
|
71
76
|
bindIndexBar(indexAnchorProvider);
|
|
72
77
|
return {
|
|
78
|
+
n,
|
|
79
|
+
classes,
|
|
73
80
|
name,
|
|
74
81
|
anchorEl,
|
|
75
82
|
active,
|
package/es/index-bar/IndexBar.js
CHANGED
|
@@ -7,18 +7,22 @@ import { easeInOutCubic, isPlainObject, toNumber } from '../utils/shared';
|
|
|
7
7
|
import { doubleRaf, getParentScroller, getScrollLeft, getScrollTop, nextTickFrame, requestAnimationFrame, scrollTo as varScrollTo } from '../utils/elements';
|
|
8
8
|
import { useIndexAnchors } from './provide';
|
|
9
9
|
import { props } from './props';
|
|
10
|
+
import { createNamespace, call } from '../utils/components';
|
|
11
|
+
var {
|
|
12
|
+
n,
|
|
13
|
+
classes
|
|
14
|
+
} = createNamespace('index-bar');
|
|
10
15
|
import { renderSlot as _renderSlot, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
11
16
|
|
|
12
17
|
var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
|
|
13
18
|
|
|
14
|
-
var _hoisted_1 =
|
|
15
|
-
class: "var-index-bar",
|
|
16
|
-
ref: "barEl"
|
|
17
|
-
};
|
|
18
|
-
var _hoisted_2 = ["onClick"];
|
|
19
|
+
var _hoisted_1 = ["onClick"];
|
|
19
20
|
export function render(_ctx, _cache) {
|
|
20
|
-
return _openBlock(), _createElementBlock("div",
|
|
21
|
-
class:
|
|
21
|
+
return _openBlock(), _createElementBlock("div", {
|
|
22
|
+
class: _normalizeClass(_ctx.n()),
|
|
23
|
+
ref: "barEl"
|
|
24
|
+
}, [_renderSlot(_ctx.$slots, "default"), _createElementVNode("ul", {
|
|
25
|
+
class: _normalizeClass(_ctx.n('anchor-list')),
|
|
22
26
|
style: _normalizeStyle({
|
|
23
27
|
zIndex: _ctx.toNumber(_ctx.zIndex) + 2,
|
|
24
28
|
display: _ctx.hideList ? 'none' : 'block'
|
|
@@ -26,22 +30,20 @@ export function render(_ctx, _cache) {
|
|
|
26
30
|
}, [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.anchorNameList, anchorName => {
|
|
27
31
|
return _openBlock(), _createElementBlock("li", {
|
|
28
32
|
key: anchorName,
|
|
29
|
-
class: _normalizeClass([
|
|
30
|
-
'var-index-bar__anchor-item--active': _ctx.active === anchorName
|
|
31
|
-
}]),
|
|
33
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('anchor-item'), [_ctx.active === anchorName, _ctx.n('anchor-item--active')])),
|
|
32
34
|
style: _normalizeStyle({
|
|
33
35
|
color: _ctx.active === anchorName && _ctx.highlightColor ? _ctx.highlightColor : ''
|
|
34
36
|
}),
|
|
35
37
|
onClick: $event => _ctx.anchorClick(anchorName)
|
|
36
38
|
}, _toDisplayString(anchorName), 15
|
|
37
39
|
/* TEXT, CLASS, STYLE, PROPS */
|
|
38
|
-
,
|
|
40
|
+
, _hoisted_1);
|
|
39
41
|
}), 128
|
|
40
42
|
/* KEYED_FRAGMENT */
|
|
41
|
-
))],
|
|
42
|
-
/* STYLE */
|
|
43
|
-
)],
|
|
44
|
-
/*
|
|
43
|
+
))], 6
|
|
44
|
+
/* CLASS, STYLE */
|
|
45
|
+
)], 2
|
|
46
|
+
/* CLASS */
|
|
45
47
|
);
|
|
46
48
|
}
|
|
47
49
|
export default defineComponent({
|
|
@@ -77,7 +79,7 @@ export default defineComponent({
|
|
|
77
79
|
var anchorName = isPlainObject(anchor) ? anchor.name.value : anchor;
|
|
78
80
|
if (anchorName === active.value || anchorName === undefined) return;
|
|
79
81
|
active.value = anchorName;
|
|
80
|
-
props.onChange
|
|
82
|
+
call(props.onChange, anchorName);
|
|
81
83
|
};
|
|
82
84
|
|
|
83
85
|
var handleScroll = () => {
|
|
@@ -107,7 +109,7 @@ export default defineComponent({
|
|
|
107
109
|
var {
|
|
108
110
|
offsetTop
|
|
109
111
|
} = barEl.value;
|
|
110
|
-
if (manualCall) props.onClick
|
|
112
|
+
if (manualCall) call(props.onClick, anchorName);
|
|
111
113
|
if (anchorName === active.value) return;
|
|
112
114
|
var indexAnchor = indexAnchors.find(_ref2 => {
|
|
113
115
|
var {
|
|
@@ -158,11 +160,11 @@ export default defineComponent({
|
|
|
158
160
|
scroller.value.addEventListener('scroll', handleScroll);
|
|
159
161
|
}));
|
|
160
162
|
onBeforeUnmount(() => {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
(_scroller$value = scroller.value) == null ? void 0 : _scroller$value.removeEventListener('scroll', handleScroll);
|
|
163
|
+
call(scroller.value.removeEventListener, 'scroll', handleScroll);
|
|
164
164
|
});
|
|
165
165
|
return {
|
|
166
|
+
n,
|
|
167
|
+
classes,
|
|
166
168
|
barEl,
|
|
167
169
|
active,
|
|
168
170
|
zIndex,
|
package/es/index.js
CHANGED
|
@@ -2,6 +2,8 @@ import ActionSheet, * as ActionSheetModule from './action-sheet'
|
|
|
2
2
|
import AppBar, * as AppBarModule from './app-bar'
|
|
3
3
|
import BackTop, * as BackTopModule from './back-top'
|
|
4
4
|
import Badge, * as BadgeModule from './badge'
|
|
5
|
+
import BottomNavigation, * as BottomNavigationModule from './bottom-navigation'
|
|
6
|
+
import BottomNavigationItem, * as BottomNavigationItemModule from './bottom-navigation-item'
|
|
5
7
|
import Button, * as ButtonModule from './button'
|
|
6
8
|
import Card, * as CardModule from './card'
|
|
7
9
|
import Cell, * as CellModule from './cell'
|
|
@@ -65,6 +67,8 @@ export const _ActionSheetComponent = ActionSheetModule._ActionSheetComponent ||
|
|
|
65
67
|
export const _AppBarComponent = AppBarModule._AppBarComponent || {}
|
|
66
68
|
export const _BackTopComponent = BackTopModule._BackTopComponent || {}
|
|
67
69
|
export const _BadgeComponent = BadgeModule._BadgeComponent || {}
|
|
70
|
+
export const _BottomNavigationComponent = BottomNavigationModule._BottomNavigationComponent || {}
|
|
71
|
+
export const _BottomNavigationItemComponent = BottomNavigationItemModule._BottomNavigationItemComponent || {}
|
|
68
72
|
export const _ButtonComponent = ButtonModule._ButtonComponent || {}
|
|
69
73
|
export const _CardComponent = CardModule._CardComponent || {}
|
|
70
74
|
export const _CellComponent = CellModule._CellComponent || {}
|
|
@@ -130,6 +134,8 @@ function install(app) {
|
|
|
130
134
|
AppBar.install && app.use(AppBar)
|
|
131
135
|
BackTop.install && app.use(BackTop)
|
|
132
136
|
Badge.install && app.use(Badge)
|
|
137
|
+
BottomNavigation.install && app.use(BottomNavigation)
|
|
138
|
+
BottomNavigationItem.install && app.use(BottomNavigationItem)
|
|
133
139
|
Button.install && app.use(Button)
|
|
134
140
|
Card.install && app.use(Card)
|
|
135
141
|
Cell.install && app.use(Cell)
|
|
@@ -196,6 +202,8 @@ export {
|
|
|
196
202
|
AppBar,
|
|
197
203
|
BackTop,
|
|
198
204
|
Badge,
|
|
205
|
+
BottomNavigation,
|
|
206
|
+
BottomNavigationItem,
|
|
199
207
|
Button,
|
|
200
208
|
Card,
|
|
201
209
|
Cell,
|
|
@@ -262,6 +270,8 @@ export default {
|
|
|
262
270
|
AppBar,
|
|
263
271
|
BackTop,
|
|
264
272
|
Badge,
|
|
273
|
+
BottomNavigation,
|
|
274
|
+
BottomNavigationItem,
|
|
265
275
|
Button,
|
|
266
276
|
Card,
|
|
267
277
|
Cell,
|