@varlet/ui 1.26.8 → 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/icon/icon.css +1 -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/icon/icon.css +1 -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
|
@@ -5,17 +5,16 @@ import { defineComponent, ref, watch } from 'vue';
|
|
|
5
5
|
import { props } from './props';
|
|
6
6
|
import { dt } from '../utils/shared';
|
|
7
7
|
import { pack } from '../locale';
|
|
8
|
-
import {
|
|
8
|
+
import { createNamespace, call } from '../utils/components';
|
|
9
|
+
var {
|
|
10
|
+
n,
|
|
11
|
+
classes
|
|
12
|
+
} = createNamespace('action-sheet');
|
|
13
|
+
import { renderSlot as _renderSlot, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, resolveComponent as _resolveComponent, createBlock as _createBlock, createCommentVNode as _createCommentVNode, normalizeStyle as _normalizeStyle, resolveDirective as _resolveDirective, withDirectives as _withDirectives, mergeProps as _mergeProps, withCtx as _withCtx, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
9
14
|
|
|
10
15
|
var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
|
|
11
16
|
|
|
12
|
-
var _hoisted_1 =
|
|
13
|
-
class: "var-action-sheet__title"
|
|
14
|
-
};
|
|
15
|
-
var _hoisted_2 = ["onClick"];
|
|
16
|
-
var _hoisted_3 = {
|
|
17
|
-
class: "var-action-sheet__action-name"
|
|
18
|
-
};
|
|
17
|
+
var _hoisted_1 = ["onClick"];
|
|
19
18
|
export function render(_ctx, _cache) {
|
|
20
19
|
var _component_var_icon = _resolveComponent("var-icon");
|
|
21
20
|
|
|
@@ -24,7 +23,7 @@ export function render(_ctx, _cache) {
|
|
|
24
23
|
var _directive_ripple = _resolveDirective("ripple");
|
|
25
24
|
|
|
26
25
|
return _openBlock(), _createBlock(_component_var_popup, _mergeProps({
|
|
27
|
-
class:
|
|
26
|
+
class: _ctx.n('popup-radius'),
|
|
28
27
|
position: "bottom",
|
|
29
28
|
overlay: _ctx.overlay,
|
|
30
29
|
"overlay-class": _ctx.overlayClass,
|
|
@@ -34,11 +33,7 @@ export function render(_ctx, _cache) {
|
|
|
34
33
|
teleport: _ctx.teleport,
|
|
35
34
|
show: _ctx.popupShow
|
|
36
35
|
}, {
|
|
37
|
-
'onUpdate:show':
|
|
38
|
-
var _ctx$$props$onUpdate, _ctx$$props;
|
|
39
|
-
|
|
40
|
-
return (_ctx$$props$onUpdate = (_ctx$$props = _ctx.$props)['onUpdate:show']) == null ? void 0 : _ctx$$props$onUpdate.call(_ctx$$props, value);
|
|
41
|
-
}
|
|
36
|
+
'onUpdate:show': _ctx.handlePopupUpdateShow
|
|
42
37
|
}, {
|
|
43
38
|
onOpen: _ctx.onOpen,
|
|
44
39
|
onClose: _ctx.onClose,
|
|
@@ -47,12 +42,14 @@ export function render(_ctx, _cache) {
|
|
|
47
42
|
onRouteChange: _ctx.onRouteChange
|
|
48
43
|
}), {
|
|
49
44
|
default: _withCtx(() => [_createElementVNode("div", _mergeProps({
|
|
50
|
-
class:
|
|
51
|
-
}, _ctx.$attrs), [_renderSlot(_ctx.$slots, "title", {}, () => [_createElementVNode("div",
|
|
52
|
-
|
|
45
|
+
class: _ctx.classes(_ctx.n(), 'var--box')
|
|
46
|
+
}, _ctx.$attrs), [_renderSlot(_ctx.$slots, "title", {}, () => [_createElementVNode("div", {
|
|
47
|
+
class: _normalizeClass(_ctx.n('title'))
|
|
48
|
+
}, _toDisplayString(_ctx.dt(_ctx.title, _ctx.pack.actionSheetTitle)), 3
|
|
49
|
+
/* TEXT, CLASS */
|
|
53
50
|
)]), _renderSlot(_ctx.$slots, "actions", {}, () => [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.actions, action => {
|
|
54
51
|
return _withDirectives((_openBlock(), _createElementBlock("div", {
|
|
55
|
-
class: _normalizeClass(
|
|
52
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('action-item'), action.className, [action.disabled, _ctx.n('--disabled')])),
|
|
56
53
|
key: action.name,
|
|
57
54
|
style: _normalizeStyle({
|
|
58
55
|
color: action.color
|
|
@@ -60,17 +57,19 @@ export function render(_ctx, _cache) {
|
|
|
60
57
|
onClick: $event => _ctx.handleSelect(action)
|
|
61
58
|
}, [action.icon ? (_openBlock(), _createBlock(_component_var_icon, {
|
|
62
59
|
key: 0,
|
|
63
|
-
class:
|
|
60
|
+
class: _normalizeClass(_ctx.n('action-icon')),
|
|
64
61
|
"var-action-sheet-cover": "",
|
|
65
62
|
name: action.icon,
|
|
66
63
|
size: action.iconSize
|
|
67
64
|
}, null, 8
|
|
68
65
|
/* PROPS */
|
|
69
|
-
, ["name", "size"])) : _createCommentVNode("v-if", true), _createElementVNode("div",
|
|
70
|
-
|
|
66
|
+
, ["class", "name", "size"])) : _createCommentVNode("v-if", true), _createElementVNode("div", {
|
|
67
|
+
class: _normalizeClass(_ctx.n('action-name'))
|
|
68
|
+
}, _toDisplayString(action.name), 3
|
|
69
|
+
/* TEXT, CLASS */
|
|
71
70
|
)], 14
|
|
72
71
|
/* CLASS, STYLE, PROPS */
|
|
73
|
-
,
|
|
72
|
+
, _hoisted_1)), [[_directive_ripple, {
|
|
74
73
|
disabled: action.disabled
|
|
75
74
|
}]]);
|
|
76
75
|
}), 128
|
|
@@ -83,7 +82,7 @@ export function render(_ctx, _cache) {
|
|
|
83
82
|
|
|
84
83
|
}, 16
|
|
85
84
|
/* FULL_PROPS */
|
|
86
|
-
, ["overlay", "overlay-class", "overlay-style", "lock-scroll", "close-on-click-overlay", "teleport", "show", "onOpen", "onClose", "onClosed", "onOpened", "onRouteChange"]);
|
|
85
|
+
, ["class", "overlay", "overlay-class", "overlay-style", "lock-scroll", "close-on-click-overlay", "teleport", "show", "onOpen", "onClose", "onClosed", "onOpened", "onRouteChange"]);
|
|
87
86
|
}
|
|
88
87
|
export default defineComponent({
|
|
89
88
|
render,
|
|
@@ -102,8 +101,6 @@ export default defineComponent({
|
|
|
102
101
|
var popupShow = ref(false);
|
|
103
102
|
|
|
104
103
|
var handleSelect = action => {
|
|
105
|
-
var _props$onUpdateShow;
|
|
106
|
-
|
|
107
104
|
if (action.disabled) {
|
|
108
105
|
return;
|
|
109
106
|
}
|
|
@@ -112,16 +109,21 @@ export default defineComponent({
|
|
|
112
109
|
closeOnClickAction,
|
|
113
110
|
onSelect
|
|
114
111
|
} = props;
|
|
115
|
-
onSelect
|
|
116
|
-
closeOnClickAction && (
|
|
112
|
+
call(onSelect, action);
|
|
113
|
+
closeOnClickAction && call(props['onUpdate:show'], false);
|
|
117
114
|
};
|
|
118
115
|
|
|
116
|
+
var handlePopupUpdateShow = value => call(props['onUpdate:show'], value);
|
|
117
|
+
|
|
119
118
|
watch(() => props.show, newValue => {
|
|
120
119
|
popupShow.value = newValue;
|
|
121
120
|
}, {
|
|
122
121
|
immediate: true
|
|
123
122
|
});
|
|
124
123
|
return {
|
|
124
|
+
n,
|
|
125
|
+
classes,
|
|
126
|
+
handlePopupUpdateShow,
|
|
125
127
|
popupShow,
|
|
126
128
|
pack,
|
|
127
129
|
dt,
|
package/es/app-bar/AppBar.js
CHANGED
|
@@ -1,51 +1,54 @@
|
|
|
1
1
|
import { defineComponent, ref, onMounted, onUpdated } from 'vue';
|
|
2
2
|
import { props } from './props';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
var _hoisted_2 = {
|
|
11
|
-
key: 0,
|
|
12
|
-
class: "var-app-bar__title"
|
|
13
|
-
};
|
|
14
|
-
var _hoisted_3 = {
|
|
15
|
-
class: "var-app-bar__right"
|
|
16
|
-
};
|
|
3
|
+
import { createNamespace } from '../utils/components';
|
|
4
|
+
var {
|
|
5
|
+
n,
|
|
6
|
+
classes
|
|
7
|
+
} = createNamespace('app-bar');
|
|
8
|
+
import { renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode } from "vue";
|
|
17
9
|
export function render(_ctx, _cache) {
|
|
18
10
|
return _openBlock(), _createElementBlock("div", {
|
|
19
|
-
class: _normalizeClass([
|
|
20
|
-
'var-elevation--3': _ctx.elevation
|
|
21
|
-
}]),
|
|
11
|
+
class: _normalizeClass(_ctx.classes(_ctx.n(), [_ctx.elevation, 'var-elevation--3'])),
|
|
22
12
|
style: _normalizeStyle({
|
|
23
13
|
background: _ctx.color,
|
|
24
14
|
color: _ctx.textColor
|
|
25
15
|
})
|
|
26
|
-
}, [_createElementVNode("div",
|
|
16
|
+
}, [_createElementVNode("div", {
|
|
17
|
+
class: _normalizeClass(_ctx.n('left'))
|
|
18
|
+
}, [_renderSlot(_ctx.$slots, "left"), _ctx.titlePosition === 'left' ? (_openBlock(), _createElementBlock("div", {
|
|
27
19
|
key: 0,
|
|
28
|
-
class:
|
|
20
|
+
class: _normalizeClass(_ctx.n('title')),
|
|
29
21
|
style: _normalizeStyle({
|
|
30
22
|
paddingLeft: _ctx.paddingLeft
|
|
31
23
|
})
|
|
32
24
|
}, [_renderSlot(_ctx.$slots, "default", {}, () => [_createTextVNode(_toDisplayString(_ctx.title), 1
|
|
33
25
|
/* TEXT */
|
|
34
|
-
)])],
|
|
35
|
-
/* STYLE */
|
|
36
|
-
)) : _createCommentVNode("v-if", true)]
|
|
26
|
+
)])], 6
|
|
27
|
+
/* CLASS, STYLE */
|
|
28
|
+
)) : _createCommentVNode("v-if", true)], 2
|
|
29
|
+
/* CLASS */
|
|
30
|
+
), _ctx.titlePosition === 'center' ? (_openBlock(), _createElementBlock("div", {
|
|
31
|
+
key: 0,
|
|
32
|
+
class: _normalizeClass(_ctx.n('title'))
|
|
33
|
+
}, [_renderSlot(_ctx.$slots, "default", {}, () => [_createTextVNode(_toDisplayString(_ctx.title), 1
|
|
37
34
|
/* TEXT */
|
|
38
|
-
)])]
|
|
35
|
+
)])], 2
|
|
36
|
+
/* CLASS */
|
|
37
|
+
)) : _createCommentVNode("v-if", true), _createElementVNode("div", {
|
|
38
|
+
class: _normalizeClass(_ctx.n('right'))
|
|
39
|
+
}, [_ctx.titlePosition === 'right' ? (_openBlock(), _createElementBlock("div", {
|
|
39
40
|
key: 0,
|
|
40
|
-
class:
|
|
41
|
+
class: _normalizeClass(_ctx.n('title')),
|
|
41
42
|
style: _normalizeStyle({
|
|
42
43
|
paddingRight: _ctx.paddingRight
|
|
43
44
|
})
|
|
44
45
|
}, [_renderSlot(_ctx.$slots, "default", {}, () => [_createTextVNode(_toDisplayString(_ctx.title), 1
|
|
45
46
|
/* TEXT */
|
|
46
|
-
)])],
|
|
47
|
-
/* STYLE */
|
|
48
|
-
)) : _createCommentVNode("v-if", true), _renderSlot(_ctx.$slots, "right")]
|
|
47
|
+
)])], 6
|
|
48
|
+
/* CLASS, STYLE */
|
|
49
|
+
)) : _createCommentVNode("v-if", true), _renderSlot(_ctx.$slots, "right")], 2
|
|
50
|
+
/* CLASS */
|
|
51
|
+
)], 6
|
|
49
52
|
/* CLASS, STYLE */
|
|
50
53
|
);
|
|
51
54
|
}
|
|
@@ -69,6 +72,8 @@ export default defineComponent({
|
|
|
69
72
|
onMounted(computePadding);
|
|
70
73
|
onUpdated(computePadding);
|
|
71
74
|
return {
|
|
75
|
+
n,
|
|
76
|
+
classes,
|
|
72
77
|
paddingLeft,
|
|
73
78
|
paddingRight
|
|
74
79
|
};
|
package/es/back-top/BackTop.js
CHANGED
|
@@ -4,6 +4,11 @@ import VarIcon from '../icon';
|
|
|
4
4
|
import { props } from './props';
|
|
5
5
|
import { isString, easeInOutCubic, throttle, isObject } from '../utils/shared';
|
|
6
6
|
import { getScrollTop, getScrollLeft, scrollTo, getParentScroller, toPxNum, toSizeUnit } from '../utils/elements';
|
|
7
|
+
import { call, createNamespace } from '../utils/components';
|
|
8
|
+
var {
|
|
9
|
+
n,
|
|
10
|
+
classes
|
|
11
|
+
} = createNamespace('back-top');
|
|
7
12
|
import { renderSlot as _renderSlot, resolveComponent as _resolveComponent, createVNode as _createVNode, withCtx as _withCtx, withModifiers as _withModifiers, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, Teleport as _Teleport, openBlock as _openBlock, createBlock as _createBlock } from "vue";
|
|
8
13
|
export function render(_ctx, _cache) {
|
|
9
14
|
var _component_var_icon = _resolveComponent("var-icon");
|
|
@@ -14,7 +19,7 @@ export function render(_ctx, _cache) {
|
|
|
14
19
|
to: "body",
|
|
15
20
|
disabled: _ctx.disabled
|
|
16
21
|
}, [_createElementVNode("div", {
|
|
17
|
-
class: _normalizeClass(
|
|
22
|
+
class: _normalizeClass(_ctx.classes(_ctx.n(), [_ctx.show, _ctx.n('--active')])),
|
|
18
23
|
ref: "backTopEl",
|
|
19
24
|
style: _normalizeStyle({
|
|
20
25
|
right: _ctx.toSizeUnit(_ctx.right),
|
|
@@ -56,7 +61,7 @@ export default defineComponent({
|
|
|
56
61
|
var target;
|
|
57
62
|
|
|
58
63
|
var click = event => {
|
|
59
|
-
props.onClick
|
|
64
|
+
call(props.onClick, event);
|
|
60
65
|
var left = getScrollLeft(target);
|
|
61
66
|
scrollTo(target, {
|
|
62
67
|
left,
|
|
@@ -103,6 +108,8 @@ export default defineComponent({
|
|
|
103
108
|
show,
|
|
104
109
|
backTopEl,
|
|
105
110
|
toSizeUnit,
|
|
111
|
+
n,
|
|
112
|
+
classes,
|
|
106
113
|
click
|
|
107
114
|
};
|
|
108
115
|
}
|
package/es/badge/Badge.js
CHANGED
|
@@ -2,24 +2,28 @@ import VarIcon from '../icon';
|
|
|
2
2
|
import { computed, defineComponent } from 'vue';
|
|
3
3
|
import { props } from './props';
|
|
4
4
|
import { toNumber } from '../utils/shared';
|
|
5
|
-
import {
|
|
5
|
+
import { createNamespace } from '../utils/components';
|
|
6
|
+
var {
|
|
7
|
+
n,
|
|
8
|
+
classes
|
|
9
|
+
} = createNamespace('badge');
|
|
10
|
+
import { resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock, toDisplayString as _toDisplayString, createElementBlock as _createElementBlock, vShow as _vShow, mergeProps as _mergeProps, createElementVNode as _createElementVNode, withDirectives as _withDirectives, Transition as _Transition, withCtx as _withCtx, createVNode as _createVNode, renderSlot as _renderSlot, normalizeClass as _normalizeClass, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
6
11
|
|
|
7
12
|
var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
|
|
8
13
|
|
|
9
14
|
var _hoisted_1 = {
|
|
10
|
-
class: "var-badge var--box"
|
|
11
|
-
};
|
|
12
|
-
var _hoisted_2 = {
|
|
13
15
|
key: 1
|
|
14
16
|
};
|
|
15
17
|
export function render(_ctx, _cache) {
|
|
16
18
|
var _component_var_icon = _resolveComponent("var-icon");
|
|
17
19
|
|
|
18
|
-
return _openBlock(), _createElementBlock("div",
|
|
20
|
+
return _openBlock(), _createElementBlock("div", {
|
|
21
|
+
class: _normalizeClass(_ctx.classes(_ctx.n(), 'var--box'))
|
|
22
|
+
}, [_createVNode(_Transition, {
|
|
19
23
|
name: "var-badge-fade"
|
|
20
24
|
}, {
|
|
21
25
|
default: _withCtx(() => [_withDirectives(_createElementVNode("span", _mergeProps(_ctx.$attrs, {
|
|
22
|
-
class:
|
|
26
|
+
class: _ctx.classes(_ctx.n('content'), ..._ctx.contentClass),
|
|
23
27
|
style: {
|
|
24
28
|
background: _ctx.color
|
|
25
29
|
}
|
|
@@ -29,7 +33,7 @@ export function render(_ctx, _cache) {
|
|
|
29
33
|
size: "10px"
|
|
30
34
|
}, null, 8
|
|
31
35
|
/* PROPS */
|
|
32
|
-
, ["name"])) : (_openBlock(), _createElementBlock("span",
|
|
36
|
+
, ["name"])) : (_openBlock(), _createElementBlock("span", _hoisted_1, _toDisplayString(_ctx.values), 1
|
|
33
37
|
/* TEXT */
|
|
34
38
|
))], 16
|
|
35
39
|
/* FULL_PROPS */
|
|
@@ -37,7 +41,9 @@ export function render(_ctx, _cache) {
|
|
|
37
41
|
_: 1
|
|
38
42
|
/* STABLE */
|
|
39
43
|
|
|
40
|
-
}), _renderSlot(_ctx.$slots, "default")]
|
|
44
|
+
}), _renderSlot(_ctx.$slots, "default")], 2
|
|
45
|
+
/* CLASS */
|
|
46
|
+
);
|
|
41
47
|
}
|
|
42
48
|
export default defineComponent({
|
|
43
49
|
render,
|
|
@@ -59,11 +65,11 @@ export default defineComponent({
|
|
|
59
65
|
dot,
|
|
60
66
|
icon
|
|
61
67
|
} = props;
|
|
62
|
-
var positionBasic = slots.default && "
|
|
63
|
-
var dotClass = dot && '
|
|
68
|
+
var positionBasic = slots.default && n('position') + " " + n("--" + position);
|
|
69
|
+
var dotClass = dot && n('dot');
|
|
64
70
|
var positionClass = getPositionClass();
|
|
65
|
-
var iconClass = icon
|
|
66
|
-
return ["
|
|
71
|
+
var iconClass = icon ? n('icon') : null;
|
|
72
|
+
return [n("--" + type), positionBasic, dotClass, positionClass, iconClass];
|
|
67
73
|
});
|
|
68
74
|
var values = computed(() => {
|
|
69
75
|
var {
|
|
@@ -81,11 +87,13 @@ export default defineComponent({
|
|
|
81
87
|
position,
|
|
82
88
|
dot
|
|
83
89
|
} = props;
|
|
84
|
-
if (dot && position.includes('right')) return '
|
|
85
|
-
if (dot && position.includes('left')) return '
|
|
90
|
+
if (dot && position.includes('right')) return n('dot--right');
|
|
91
|
+
if (dot && position.includes('left')) return n('dot--left');
|
|
86
92
|
};
|
|
87
93
|
|
|
88
94
|
return {
|
|
95
|
+
n,
|
|
96
|
+
classes,
|
|
89
97
|
values,
|
|
90
98
|
contentClass
|
|
91
99
|
};
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
import { defineComponent, ref, computed, onMounted, onUpdated } from 'vue';
|
|
4
|
+
import { props } from './props';
|
|
5
|
+
import VarButton from '../button';
|
|
6
|
+
import { useBottomNavigationItems } from './provide';
|
|
7
|
+
import { createNamespace, call } from '../utils/components';
|
|
8
|
+
var {
|
|
9
|
+
n,
|
|
10
|
+
classes
|
|
11
|
+
} = createNamespace('bottom-navigation');
|
|
12
|
+
var {
|
|
13
|
+
n: nItem
|
|
14
|
+
} = createNamespace('bottom-navigation-item');
|
|
15
|
+
var RIGHT_HALF_SPACE_CLASS = nItem('--right-half-space');
|
|
16
|
+
var LEFT_HALF_SPACE_CLASS = nItem('--left-half-space');
|
|
17
|
+
var RIGHT_SPACE_CLASS = nItem('--right-space');
|
|
18
|
+
var defaultFabProps = {
|
|
19
|
+
type: 'primary'
|
|
20
|
+
};
|
|
21
|
+
import { renderSlot as _renderSlot, resolveComponent as _resolveComponent, mergeProps as _mergeProps, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementBlock as _createElementBlock } from "vue";
|
|
22
|
+
export function render(_ctx, _cache) {
|
|
23
|
+
var _component_var_button = _resolveComponent("var-button");
|
|
24
|
+
|
|
25
|
+
return _openBlock(), _createElementBlock("div", {
|
|
26
|
+
class: _normalizeClass(_ctx.classes(_ctx.n(), [_ctx.fixed, _ctx.n('--fixed')], [_ctx.border, _ctx.n('--border')])),
|
|
27
|
+
ref: "bottomNavigationDom",
|
|
28
|
+
style: _normalizeStyle("z-index:" + _ctx.zIndex)
|
|
29
|
+
}, [_renderSlot(_ctx.$slots, "default"), _ctx.$slots.fab ? (_openBlock(), _createBlock(_component_var_button, _mergeProps({
|
|
30
|
+
key: 0,
|
|
31
|
+
class: _ctx.classes(_ctx.n('fab'), [_ctx.length % 2, _ctx.n('--fab-right'), _ctx.n('--fab-center')]),
|
|
32
|
+
"var-bottom-navigation__fab": "",
|
|
33
|
+
onClick: _ctx.handleFabClick
|
|
34
|
+
}, _ctx.fabProps, {
|
|
35
|
+
round: ""
|
|
36
|
+
}), {
|
|
37
|
+
default: _withCtx(() => [_renderSlot(_ctx.$slots, "fab")]),
|
|
38
|
+
_: 3
|
|
39
|
+
/* FORWARDED */
|
|
40
|
+
|
|
41
|
+
}, 16
|
|
42
|
+
/* FULL_PROPS */
|
|
43
|
+
, ["class", "onClick"])) : _createCommentVNode("v-if", true)], 6
|
|
44
|
+
/* CLASS, STYLE */
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
export default defineComponent({
|
|
48
|
+
render,
|
|
49
|
+
name: 'VarBottomNavigation',
|
|
50
|
+
components: {
|
|
51
|
+
VarButton
|
|
52
|
+
},
|
|
53
|
+
props,
|
|
54
|
+
|
|
55
|
+
setup(props, _ref) {
|
|
56
|
+
var {
|
|
57
|
+
slots
|
|
58
|
+
} = _ref;
|
|
59
|
+
var bottomNavigationDom = ref(null);
|
|
60
|
+
var active = computed(() => props.modelValue);
|
|
61
|
+
var activeColor = computed(() => props.activeColor);
|
|
62
|
+
var inactiveColor = computed(() => props.inactiveColor);
|
|
63
|
+
var fabProps = ref({});
|
|
64
|
+
|
|
65
|
+
var onToggle = changedValue => {
|
|
66
|
+
if (props.onBeforeChange) {
|
|
67
|
+
handleBeforeChange(changedValue);
|
|
68
|
+
} else {
|
|
69
|
+
handleChange(changedValue);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
var handleBeforeChange = changedValue => {
|
|
74
|
+
Promise.resolve(call(props.onBeforeChange, changedValue)).then(res => {
|
|
75
|
+
if (res) {
|
|
76
|
+
handleChange(changedValue);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
var handleChange = changedValue => {
|
|
82
|
+
call(props['onUpdate:modelValue'], changedValue);
|
|
83
|
+
call(props.onChange, changedValue);
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
var {
|
|
87
|
+
length,
|
|
88
|
+
bindBottomNavigationItem
|
|
89
|
+
} = useBottomNavigationItems();
|
|
90
|
+
|
|
91
|
+
var removeMarginClass = () => {
|
|
92
|
+
var bottomNavigationItems = getBottomNavigationItems();
|
|
93
|
+
bottomNavigationItems.forEach(dom => {
|
|
94
|
+
dom.classList.remove(RIGHT_HALF_SPACE_CLASS, LEFT_HALF_SPACE_CLASS, RIGHT_SPACE_CLASS);
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
var addMarginClass = length => {
|
|
99
|
+
var bottomNavigationItems = getBottomNavigationItems();
|
|
100
|
+
var itemsNum = bottomNavigationItems.length;
|
|
101
|
+
var isEven = length % 2 === 0;
|
|
102
|
+
bottomNavigationItems.forEach((bottomNavigationItem, i) => {
|
|
103
|
+
handleMarginClass(isEven, bottomNavigationItem, i, itemsNum);
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
var handleMarginClass = (isEven, dom, i, length) => {
|
|
108
|
+
var isLast = i === length - 1;
|
|
109
|
+
|
|
110
|
+
if (!isEven && isLast) {
|
|
111
|
+
dom.classList.add(RIGHT_SPACE_CLASS);
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
var isFabLeft = i === length / 2 - 1;
|
|
116
|
+
var isFabRight = i === length / 2;
|
|
117
|
+
|
|
118
|
+
if (isFabLeft) {
|
|
119
|
+
dom.classList.add(RIGHT_HALF_SPACE_CLASS);
|
|
120
|
+
} else if (isFabRight) {
|
|
121
|
+
dom.classList.add(LEFT_HALF_SPACE_CLASS);
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
var getBottomNavigationItems = () => {
|
|
126
|
+
return Array.from(bottomNavigationDom.value.querySelectorAll("." + nItem()));
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
var handleFabClick = () => {
|
|
130
|
+
call(props.onFabClick);
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
fabProps.value = _extends({}, defaultFabProps, props.fabProps);
|
|
134
|
+
var bottomNavigationProvider = {
|
|
135
|
+
active,
|
|
136
|
+
activeColor,
|
|
137
|
+
inactiveColor,
|
|
138
|
+
onToggle
|
|
139
|
+
};
|
|
140
|
+
bindBottomNavigationItem(bottomNavigationProvider);
|
|
141
|
+
onMounted(() => {
|
|
142
|
+
if (!slots.fab) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
addMarginClass(length.value);
|
|
147
|
+
});
|
|
148
|
+
onUpdated(() => {
|
|
149
|
+
removeMarginClass();
|
|
150
|
+
|
|
151
|
+
if (!slots.fab) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
addMarginClass(length.value);
|
|
156
|
+
});
|
|
157
|
+
return {
|
|
158
|
+
n,
|
|
159
|
+
classes,
|
|
160
|
+
length,
|
|
161
|
+
bottomNavigationDom,
|
|
162
|
+
handleFabClick,
|
|
163
|
+
fabProps
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
});
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root { --bottom-navigation-height: 50px; --bottom-navigation-z-index: 1; --bottom-navigation-background-color: #fff; --bottom-navigation-border-color: #e3e3e3;}.var-bottom-navigation { width: 100%; height: var(--bottom-navigation-height); display: flex; position: relative; background-color: var(--bottom-navigation-background-color); transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, border-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;}.var-bottom-navigation--fixed { position: fixed; left: 0; bottom: 0;}.var-bottom-navigation--border { border-top: 1px solid var(--bottom-navigation-border-color);}.var-bottom-navigation__fab[var-bottom-navigation__fab] { width: var(--bottom-navigation-height); height: var(--bottom-navigation-height); position: absolute; z-index: 2; transform: translateY(-50%); overflow: hidden; transition: right 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;}.var-bottom-navigation--fab-center { right: calc(50% - var(--bottom-navigation-height) / 2);}.var-bottom-navigation--fab-right { right: 0;}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
@bottom-navigation-height: 50px;
|
|
2
|
+
@bottom-navigation-z-index: 1;
|
|
3
|
+
@bottom-navigation-background-color: #fff;
|
|
4
|
+
@bottom-navigation-border-color: #e3e3e3;
|
|
5
|
+
|
|
6
|
+
:root {
|
|
7
|
+
--bottom-navigation-height: @bottom-navigation-height;
|
|
8
|
+
--bottom-navigation-z-index: @bottom-navigation-z-index;
|
|
9
|
+
--bottom-navigation-background-color: @bottom-navigation-background-color;
|
|
10
|
+
--bottom-navigation-border-color: @bottom-navigation-border-color;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.var-bottom-navigation {
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: var(--bottom-navigation-height);
|
|
16
|
+
display: flex;
|
|
17
|
+
position: relative;
|
|
18
|
+
background-color: var(--bottom-navigation-background-color);
|
|
19
|
+
transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,
|
|
20
|
+
border-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
|
|
21
|
+
|
|
22
|
+
&--fixed {
|
|
23
|
+
position: fixed;
|
|
24
|
+
left: 0;
|
|
25
|
+
bottom: 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&--border {
|
|
29
|
+
border-top: 1px solid var(--bottom-navigation-border-color);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&__fab[var-bottom-navigation__fab] {
|
|
33
|
+
width: var(--bottom-navigation-height);
|
|
34
|
+
height: var(--bottom-navigation-height);
|
|
35
|
+
position: absolute;
|
|
36
|
+
z-index: 2;
|
|
37
|
+
transform: translateY(-50%);
|
|
38
|
+
overflow: hidden;
|
|
39
|
+
transition: right 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&--fab-center {
|
|
43
|
+
right: calc(50% - var(--bottom-navigation-height) / 2);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&--fab-right {
|
|
47
|
+
right: 0;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export var props = {
|
|
2
|
+
modelValue: {
|
|
3
|
+
type: [Number, String],
|
|
4
|
+
default: 0
|
|
5
|
+
},
|
|
6
|
+
fixed: {
|
|
7
|
+
type: Boolean,
|
|
8
|
+
default: false
|
|
9
|
+
},
|
|
10
|
+
border: {
|
|
11
|
+
type: Boolean,
|
|
12
|
+
default: false
|
|
13
|
+
},
|
|
14
|
+
zIndex: {
|
|
15
|
+
type: [Number, String],
|
|
16
|
+
default: 1
|
|
17
|
+
},
|
|
18
|
+
activeColor: {
|
|
19
|
+
type: String
|
|
20
|
+
},
|
|
21
|
+
inactiveColor: {
|
|
22
|
+
type: String
|
|
23
|
+
},
|
|
24
|
+
onChange: {
|
|
25
|
+
type: Function
|
|
26
|
+
},
|
|
27
|
+
'onUpdate:modelValue': {
|
|
28
|
+
type: Function
|
|
29
|
+
},
|
|
30
|
+
onBeforeChange: {
|
|
31
|
+
type: Function
|
|
32
|
+
},
|
|
33
|
+
onFabClick: {
|
|
34
|
+
type: Function
|
|
35
|
+
},
|
|
36
|
+
fabProps: {
|
|
37
|
+
type: [Object],
|
|
38
|
+
default: {}
|
|
39
|
+
}
|
|
40
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useAtChildrenCounter, useChildren } from '../utils/components';
|
|
2
|
+
export var BOTTOM_NAVIGATION_BIND_BOTTOM_NAVIGATION_ITEM_KEY = Symbol('BOTTOM_NAVIGATION_BIND_BOTTOM_NAVIGATION_ITEM_KEY');
|
|
3
|
+
export var BOTTOM_NAVIGATION_COUNT_BOTTOM_NAVIGATION_ITEM_KEY = Symbol('BOTTOM_NAVIGATION_COUNT_BOTTOM_NAVIGATION_ITEM_KEY');
|
|
4
|
+
export function useBottomNavigationItems() {
|
|
5
|
+
var {
|
|
6
|
+
childProviders,
|
|
7
|
+
bindChildren
|
|
8
|
+
} = useChildren(BOTTOM_NAVIGATION_BIND_BOTTOM_NAVIGATION_ITEM_KEY);
|
|
9
|
+
var {
|
|
10
|
+
length
|
|
11
|
+
} = useAtChildrenCounter(BOTTOM_NAVIGATION_COUNT_BOTTOM_NAVIGATION_ITEM_KEY);
|
|
12
|
+
return {
|
|
13
|
+
length,
|
|
14
|
+
bottomNavigationItems: childProviders,
|
|
15
|
+
bindBottomNavigationItem: bindChildren
|
|
16
|
+
};
|
|
17
|
+
}
|