@nutui/nutui 3.1.22-beta.3 → 3.1.23-beta.0
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/CHANGELOG.md +48 -0
- package/README.md +3 -4
- package/dist/nutui.es.js +20426 -4050
- package/dist/nutui.umd.js +20529 -4049
- package/dist/packages/_es/ActionSheet.js +149 -36
- package/dist/packages/_es/Address.js +535 -129
- package/dist/packages/_es/AddressList.js +615 -113
- package/dist/packages/_es/Animate.js +64 -0
- package/dist/packages/_es/Audio.js +257 -72
- package/dist/packages/_es/AudioOperate.js +100 -32
- package/dist/packages/_es/Avatar.js +162 -54
- package/dist/packages/_es/AvatarGroup.js +73 -14
- package/dist/packages/_es/BackTop.js +156 -43
- package/dist/packages/_es/Badge.js +86 -14
- package/dist/packages/_es/Barrage.js +120 -41
- package/dist/packages/_es/Button.js +128 -23
- package/dist/packages/_es/Calendar.js +246 -24
- package/dist/packages/_es/CalendarItem.js +2 -1
- package/dist/packages/_es/Card.js +107 -10
- package/dist/packages/_es/Cascader.js +496 -179
- package/dist/packages/_es/Category.js +58 -15
- package/dist/packages/_es/CategoryPane.js +111 -11
- package/dist/packages/_es/Cell.js +108 -21
- package/dist/packages/_es/CellGroup.js +44 -9
- package/dist/packages/_es/Checkbox.js +134 -29
- package/dist/packages/_es/CheckboxGroup.js +79 -29
- package/dist/packages/_es/CircleProgress.js +150 -28
- package/dist/packages/_es/Col.js +56 -14
- package/dist/packages/_es/Collapse.js +110 -24
- package/dist/packages/_es/CollapseItem.js +252 -80
- package/dist/packages/_es/Comment.js +434 -64
- package/dist/packages/_es/ConfigProvider.js +25 -0
- package/dist/packages/_es/CountDown.js +238 -75
- package/dist/packages/_es/CountUp.js +539 -159
- package/dist/packages/_es/DatePicker.js +315 -117
- package/dist/packages/_es/Dialog.js +289 -79
- package/dist/packages/_es/Divider.js +65 -32
- package/dist/packages/_es/Drag.js +197 -56
- package/dist/packages/_es/Ecard.js +159 -24
- package/dist/packages/_es/Elevator.js +255 -77
- package/dist/packages/_es/Ellipsis.js +206 -0
- package/dist/packages/_es/Empty.js +71 -12
- package/dist/packages/_es/FixedNav.js +122 -15
- package/dist/packages/_es/Form.js +151 -64
- package/dist/packages/_es/FormItem.js +114 -15
- package/dist/packages/_es/Grid.js +6 -5
- package/dist/packages/_es/GridItem.js +144 -33
- package/dist/packages/_es/Icon.js +40 -15
- package/dist/packages/_es/Image.js +142 -0
- package/dist/packages/_es/ImagePreview.js +547 -84
- package/dist/packages/_es/Indicator.js +62 -15
- package/dist/packages/_es/InfiniteLoading.js +249 -76
- package/dist/packages/_es/Input.js +433 -51
- package/dist/packages/_es/InputNumber.js +160 -41
- package/dist/packages/_es/Layout.js +5 -4
- package/dist/packages/_es/List.js +106 -37
- package/dist/packages/_es/Menu.js +168 -29
- package/dist/packages/_es/MenuItem.js +173 -34
- package/dist/packages/_es/Navbar.js +192 -30
- package/dist/packages/_es/NoticeBar.js +380 -93
- package/dist/packages/_es/Notify.js +227 -91
- package/dist/packages/_es/NumberKeyboard.js +272 -41
- package/dist/packages/_es/OldPicker.js +457 -149
- package/dist/packages/_es/OverLay.js +98 -40
- package/dist/packages/_es/Pagination.js +157 -39
- package/dist/packages/_es/Picker.js +460 -148
- package/dist/packages/_es/Popover.js +957 -337
- package/dist/packages/_es/Popup.js +299 -74
- package/dist/packages/_es/Price.js +118 -16
- package/dist/packages/_es/Progress.js +146 -14
- package/dist/packages/_es/PullRefresh.js +339 -100
- package/dist/packages/_es/Radio.js +90 -22
- package/dist/packages/_es/RadioGroup.js +37 -8
- package/dist/packages/_es/Range.js +408 -102
- package/dist/packages/_es/Rate.js +193 -16
- package/dist/packages/_es/Row.js +64 -22
- package/dist/packages/_es/SearchBar.js +238 -56
- package/dist/packages/_es/ShortPassword.js +225 -35
- package/dist/packages/_es/SideNavBar.js +81 -43
- package/dist/packages/_es/SideNavBarItem.js +46 -11
- package/dist/packages/_es/Signature.js +160 -60
- package/dist/packages/_es/Skeleton.js +136 -20
- package/dist/packages/_es/Sku.js +491 -103
- package/dist/packages/_es/Step.js +115 -39
- package/dist/packages/_es/Steps.js +53 -18
- package/dist/packages/_es/Sticky.js +138 -53
- package/dist/packages/_es/SubSideNavBar.js +82 -36
- package/dist/packages/_es/Swipe.js +178 -60
- package/dist/packages/_es/Swiper.js +433 -121
- package/dist/packages/_es/SwiperItem.js +53 -22
- package/dist/packages/_es/Switch.js +116 -21
- package/dist/packages/_es/TabPane.js +39 -12
- package/dist/packages/_es/Tabbar.js +72 -17
- package/dist/packages/_es/TabbarItem.js +151 -29
- package/dist/packages/_es/Table.js +178 -37
- package/dist/packages/_es/Tabs.js +202 -59
- package/dist/packages/_es/Tag.js +97 -20
- package/dist/packages/_es/TextArea.js +160 -42
- package/dist/packages/_es/TimeDetail.js +79 -37
- package/dist/packages/_es/TimePannel.js +48 -33
- package/dist/packages/_es/TimeSelect.js +112 -15
- package/dist/packages/_es/Toast.js +310 -90
- package/dist/packages/_es/Uploader.js +455 -120
- package/dist/packages/_es/Video.js +332 -93
- package/dist/packages/_es/common.js +128 -38
- package/dist/packages/_es/component.js +76 -35
- package/dist/packages/_es/index.js +6 -5
- package/dist/packages/_es/index2.js +30 -9
- package/dist/packages/_es/index3.js +8 -6
- package/dist/packages/_es/index4.js +64 -13
- package/dist/packages/_es/index5.js +783 -130
- package/dist/packages/_es/plugin-vue_export-helper.js +8 -7
- package/dist/packages/_es/pxCheck.js +5 -3
- package/dist/packages/_es/raf.js +15 -8
- package/dist/packages/animate/index.scss +299 -0
- package/dist/packages/cell/index.scss +7 -1
- package/dist/packages/checkbox/index.scss +10 -0
- package/dist/packages/configprovider/index.scss +2 -0
- package/dist/packages/ellipsis/index.scss +12 -0
- package/dist/packages/formitem/index.scss +12 -0
- package/dist/packages/griditem/index.scss +11 -0
- package/dist/packages/image/index.scss +39 -0
- package/dist/packages/imagepreview/index.scss +26 -2
- package/dist/packages/input/index.scss +13 -0
- package/dist/packages/inputnumber/index.scss +21 -0
- package/dist/packages/locale/lang/baseLang.js +3 -3
- package/dist/packages/locale/lang/en-US.js +105 -5
- package/dist/packages/locale/lang/id-ID.js +105 -5
- package/dist/packages/locale/lang/index.js +38 -16
- package/dist/packages/locale/lang/zh-CN.js +105 -5
- package/dist/packages/locale/lang/zh-TW.js +105 -5
- package/dist/packages/menu/index.scss +45 -36
- package/dist/packages/menuitem/index.scss +4 -0
- package/dist/packages/navbar/index.scss +9 -0
- package/dist/packages/pagination/index.scss +19 -0
- package/dist/packages/radio/index.scss +18 -0
- package/dist/packages/range/index.scss +19 -0
- package/dist/packages/rate/index.scss +1 -1
- package/dist/packages/searchbar/index.scss +21 -0
- package/dist/packages/switch/index.scss +1 -0
- package/dist/packages/tabbar/index.scss +5 -0
- package/dist/packages/tabbaritem/index.scss +7 -0
- package/dist/packages/tabpane/index.scss +5 -0
- package/dist/packages/tabs/index.scss +22 -0
- package/dist/packages/textarea/index.scss +8 -0
- package/dist/smartips/attributes.json +140 -4
- package/dist/smartips/tags.json +55 -6
- package/dist/smartips/web-types.json +6963 -0
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/font/config.json +3 -1
- package/dist/styles/font/demo_index.html +49 -3
- package/dist/styles/font/iconfont.css +11 -3
- package/dist/styles/font/iconfont.js +15 -15
- package/dist/styles/font/iconfont.json +14 -0
- package/dist/styles/font/iconfont.ttf +0 -0
- package/dist/styles/font/iconfont.woff +0 -0
- package/dist/styles/font/iconfont.woff2 +0 -0
- package/dist/styles/themes/default.scss +54 -50
- package/dist/styles/themes/jdb.scss +54 -50
- package/dist/styles/themes/jdt.scss +54 -50
- package/dist/styles/variables-jdb.scss +12 -0
- package/dist/styles/variables-jdt.scss +12 -0
- package/dist/styles/variables.scss +12 -0
- package/dist/types/__VUE/actionsheet/index.vue.d.ts +3 -3
- package/dist/types/__VUE/address/index.vue.d.ts +7 -7
- package/dist/types/__VUE/animate/index.vue.d.ts +48 -0
- package/dist/types/__VUE/animate/type.d.ts +6 -0
- package/dist/types/__VUE/avatar/index.vue.d.ts +3 -3
- package/dist/types/__VUE/calendar/index.vue.d.ts +1 -1
- package/dist/types/__VUE/calendaritem/index.vue.d.ts +10 -2
- package/dist/types/__VUE/cascader/index.vue.d.ts +2 -2
- package/dist/types/__VUE/circleprogress/index.vue.d.ts +2 -2
- package/dist/types/__VUE/collapse/index.vue.d.ts +3 -1
- package/dist/types/__VUE/configprovider/common.d.ts +20 -0
- package/dist/types/__VUE/configprovider/index.vue.d.ts +33 -0
- package/dist/types/__VUE/datepicker/index.vue.d.ts +2 -2
- package/dist/types/__VUE/dialog/index.vue.d.ts +2 -2
- package/dist/types/__VUE/ellipsis/index.vue.d.ts +72 -0
- package/dist/types/__VUE/fixednav/index.vue.d.ts +2 -2
- package/dist/types/__VUE/grid/index.vue.d.ts +2 -2
- package/dist/types/__VUE/image/index.vue.d.ts +105 -0
- package/dist/types/__VUE/image/type.d.ts +6 -0
- package/dist/types/__VUE/imagepreview/imagePreviewItem.vue.d.ts +95 -0
- package/dist/types/__VUE/imagepreview/index.vue.d.ts +56 -24
- package/dist/types/__VUE/menu/index.vue.d.ts +31 -4
- package/dist/types/__VUE/menuitem/index.vue.d.ts +12 -3
- package/dist/types/__VUE/noticebar/index.vue.d.ts +1 -1
- package/dist/types/__VUE/numberkeyboard/index.vue.d.ts +2 -2
- package/dist/types/__VUE/oldpicker/index.vue.d.ts +4 -4
- package/dist/types/__VUE/picker/index.vue.d.ts +4 -4
- package/dist/types/__VUE/popover/index.vue.d.ts +8 -8
- package/dist/types/__VUE/popup/index.vue.d.ts +4 -4
- package/dist/types/__VUE/range/index.vue.d.ts +1 -1
- package/dist/types/__VUE/rate/common.d.ts +149 -0
- package/dist/types/__VUE/rate/index.vue.d.ts +17 -7
- package/dist/types/__VUE/row/index.vue.d.ts +2 -2
- package/dist/types/__VUE/shortpassword/index.vue.d.ts +2 -2
- package/dist/types/__VUE/sku/index.vue.d.ts +3 -3
- package/dist/types/__VUE/swipe/index.vue.d.ts +2 -2
- package/dist/types/__VUE/swiper/index.vue.d.ts +2 -2
- package/dist/types/__VUE/switch/index.vue.d.ts +2 -2
- package/dist/types/__VUE/timeselect/index.vue.d.ts +3 -2
- package/dist/types/__VUE/uploader/uploader.d.ts +1 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/nutui.d.ts +5 -1
- package/package.json +5 -4
|
@@ -1,26 +1,121 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.23-beta.0 Mon Jun 27 2022 17:55:50 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { computed
|
|
7
|
-
import { c as
|
|
8
|
-
import { _ as
|
|
6
|
+
import { computed, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, createBlock, createCommentVNode, Fragment, withDirectives, toDisplayString, vShow } from "vue";
|
|
7
|
+
import { c as createComponent } from "./component.js";
|
|
8
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
9
|
import "../locale/lang";
|
|
10
|
-
const { componentName
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
10
|
+
const { componentName, create } = createComponent("switch");
|
|
11
|
+
const _sfc_main = create({
|
|
12
|
+
props: {
|
|
13
|
+
modelValue: {
|
|
14
|
+
type: [String, Number, Boolean],
|
|
15
|
+
default: false
|
|
16
|
+
},
|
|
17
|
+
disable: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: false
|
|
20
|
+
},
|
|
21
|
+
activeColor: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: ""
|
|
24
|
+
},
|
|
25
|
+
inactiveColor: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: ""
|
|
28
|
+
},
|
|
29
|
+
activeText: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: ""
|
|
32
|
+
},
|
|
33
|
+
inactiveText: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: ""
|
|
36
|
+
},
|
|
37
|
+
activeValue: {
|
|
38
|
+
type: [String, Number, Boolean],
|
|
39
|
+
default: true
|
|
40
|
+
},
|
|
41
|
+
inactiveValue: {
|
|
42
|
+
type: [String, Number, Boolean],
|
|
43
|
+
default: false
|
|
44
|
+
},
|
|
45
|
+
loading: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: false
|
|
48
|
+
},
|
|
49
|
+
name: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: "loading1"
|
|
52
|
+
},
|
|
53
|
+
size: {
|
|
54
|
+
type: [String, Number],
|
|
55
|
+
default: "12px"
|
|
56
|
+
},
|
|
57
|
+
color: {
|
|
58
|
+
type: String,
|
|
59
|
+
default: ""
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
emits: ["change", "update:modelValue", "update:loading"],
|
|
63
|
+
setup(props, { emit }) {
|
|
64
|
+
const isActive = computed(() => props.modelValue === props.activeValue);
|
|
65
|
+
const classes = computed(() => {
|
|
66
|
+
const prefixCls = componentName;
|
|
67
|
+
return {
|
|
68
|
+
[prefixCls]: true,
|
|
69
|
+
[isActive.value ? "switch-open" : "switch-close"]: true,
|
|
70
|
+
[`${prefixCls}-disable`]: props.disable,
|
|
71
|
+
[`${prefixCls}-base`]: true
|
|
72
|
+
};
|
|
73
|
+
});
|
|
74
|
+
const style = computed(() => {
|
|
75
|
+
return {
|
|
76
|
+
backgroundColor: isActive.value ? props.activeColor : props.inactiveColor
|
|
77
|
+
};
|
|
78
|
+
});
|
|
79
|
+
const onClick = (event) => {
|
|
80
|
+
if (props.disable || props.loading)
|
|
81
|
+
return;
|
|
82
|
+
const value = isActive.value ? props.inactiveValue : props.activeValue;
|
|
83
|
+
emit("update:modelValue", value);
|
|
84
|
+
emit("update:loading");
|
|
85
|
+
emit("change", value, event);
|
|
86
|
+
};
|
|
87
|
+
return {
|
|
88
|
+
classes,
|
|
89
|
+
style,
|
|
90
|
+
onClick
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
const _hoisted_1 = { class: "switch-button" };
|
|
95
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
96
|
+
const _component_nut_icon = resolveComponent("nut-icon");
|
|
97
|
+
return openBlock(), createElementBlock("view", {
|
|
98
|
+
class: normalizeClass(_ctx.classes),
|
|
99
|
+
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClick && _ctx.onClick(...args)),
|
|
100
|
+
style: normalizeStyle(_ctx.style)
|
|
101
|
+
}, [
|
|
102
|
+
createElementVNode("view", _hoisted_1, [
|
|
103
|
+
_ctx.loading ? (openBlock(), createBlock(_component_nut_icon, {
|
|
104
|
+
key: 0,
|
|
105
|
+
name: _ctx.name,
|
|
106
|
+
size: _ctx.size,
|
|
107
|
+
color: _ctx.color
|
|
108
|
+
}, null, 8, ["name", "size", "color"])) : createCommentVNode("", true),
|
|
109
|
+
_ctx.activeText ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
110
|
+
withDirectives(createElementVNode("view", { class: "nut-switch-label open" }, toDisplayString(_ctx.activeText), 513), [
|
|
111
|
+
[vShow, _ctx.modelValue]
|
|
112
|
+
]),
|
|
113
|
+
withDirectives(createElementVNode("view", { class: "nut-switch-label close" }, toDisplayString(_ctx.inactiveText), 513), [
|
|
114
|
+
[vShow, !_ctx.modelValue]
|
|
115
|
+
])
|
|
116
|
+
], 64)) : createCommentVNode("", true)
|
|
117
|
+
])
|
|
118
|
+
], 6);
|
|
119
|
+
}
|
|
120
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
121
|
+
export { index as default };
|
|
@@ -1,17 +1,44 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.23-beta.0 Mon Jun 27 2022 17:55:50 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { inject
|
|
7
|
-
import { c as
|
|
8
|
-
import { _ as
|
|
6
|
+
import { inject, openBlock, createElementBlock, normalizeClass, renderSlot } from "vue";
|
|
7
|
+
import { c as createComponent } from "./component.js";
|
|
8
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
9
|
import "../locale/lang";
|
|
10
|
-
const { create
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
10
|
+
const { create } = createComponent("tabpane");
|
|
11
|
+
const _sfc_main = create({
|
|
12
|
+
props: {
|
|
13
|
+
title: {
|
|
14
|
+
type: [String, Number],
|
|
15
|
+
default: ""
|
|
16
|
+
},
|
|
17
|
+
paneKey: {
|
|
18
|
+
type: [String, Number],
|
|
19
|
+
default: ""
|
|
20
|
+
},
|
|
21
|
+
disabled: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: false
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
emits: ["click"],
|
|
27
|
+
setup(props, { emit }) {
|
|
28
|
+
const parent = inject("activeKey");
|
|
29
|
+
const parentOption = inject("autoHeight");
|
|
30
|
+
return {
|
|
31
|
+
activeKey: parent.activeKey,
|
|
32
|
+
autoHeight: parentOption.autoHeight
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
37
|
+
return openBlock(), createElementBlock("view", {
|
|
38
|
+
class: normalizeClass(["nut-tabpane", { inactive: _ctx.paneKey != _ctx.activeKey && _ctx.autoHeight }])
|
|
39
|
+
}, [
|
|
40
|
+
renderSlot(_ctx.$slots, "default")
|
|
41
|
+
], 2);
|
|
42
|
+
}
|
|
43
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
44
|
+
export { index as default };
|
|
@@ -1,23 +1,78 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.23-beta.0 Mon Jun 27 2022 17:55:50 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { reactive
|
|
7
|
-
import { c as
|
|
8
|
-
import { _ as
|
|
6
|
+
import { reactive, provide, watch, openBlock, createElementBlock, normalizeClass, renderSlot } from "vue";
|
|
7
|
+
import { c as createComponent } from "./component.js";
|
|
8
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
9
|
import "../locale/lang";
|
|
10
|
-
const { create
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
const { create } = createComponent("tabbar");
|
|
11
|
+
const _sfc_main = create({
|
|
12
|
+
props: {
|
|
13
|
+
visible: {
|
|
14
|
+
type: [Number, String],
|
|
15
|
+
default: 0
|
|
16
|
+
},
|
|
17
|
+
bottom: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: false
|
|
20
|
+
},
|
|
21
|
+
type: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: "base"
|
|
24
|
+
},
|
|
25
|
+
size: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: "20px"
|
|
28
|
+
},
|
|
29
|
+
unactiveColor: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: ""
|
|
32
|
+
},
|
|
33
|
+
activeColor: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: ""
|
|
36
|
+
},
|
|
37
|
+
safeAreaInsetBottom: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: false
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
emits: ["tab-switch", "update:visible"],
|
|
43
|
+
setup(props, { emit, slots }) {
|
|
44
|
+
const mdValue = reactive({
|
|
45
|
+
val: props.visible,
|
|
46
|
+
children: []
|
|
47
|
+
});
|
|
48
|
+
function changeIndex(active) {
|
|
49
|
+
emit("update:visible", active);
|
|
50
|
+
parentData.modelValue = active;
|
|
51
|
+
emit("tab-switch", parentData.children[active], active);
|
|
52
|
+
}
|
|
53
|
+
let parentData = reactive({
|
|
54
|
+
children: mdValue.children,
|
|
55
|
+
size: props.size,
|
|
56
|
+
modelValue: mdValue.val,
|
|
57
|
+
unactiveColor: props.unactiveColor,
|
|
58
|
+
activeColor: props.activeColor,
|
|
59
|
+
changeIndex
|
|
60
|
+
});
|
|
61
|
+
provide("parent", parentData);
|
|
62
|
+
watch(() => props.visible, (value) => {
|
|
63
|
+
parentData.modelValue = value;
|
|
64
|
+
});
|
|
65
|
+
return {
|
|
66
|
+
changeIndex
|
|
67
|
+
};
|
|
15
68
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
69
|
+
});
|
|
70
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
71
|
+
return openBlock(), createElementBlock("view", {
|
|
72
|
+
class: normalizeClass(["nut-tabbar", { "nut-tabbar-bottom": _ctx.bottom, "nut-tabbar-safebottom": _ctx.safeAreaInsetBottom }])
|
|
73
|
+
}, [
|
|
74
|
+
renderSlot(_ctx.$slots, "default")
|
|
75
|
+
], 2);
|
|
76
|
+
}
|
|
77
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
78
|
+
export { index as default };
|
|
@@ -1,37 +1,159 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.23-beta.0 Mon Jun 27 2022 17:55:50 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { c as
|
|
7
|
-
import { u as
|
|
8
|
-
import { inject
|
|
9
|
-
import { _ as
|
|
6
|
+
import { c as createComponent } from "./component.js";
|
|
7
|
+
import { u as useRouter } from "./index.js";
|
|
8
|
+
import { inject, reactive, getCurrentInstance, computed, watch, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, Fragment, toDisplayString, createCommentVNode, createVNode, renderSlot } from "vue";
|
|
9
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
10
10
|
import "../locale/lang";
|
|
11
|
-
const { create
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
const { create } = createComponent("tabbar-item");
|
|
12
|
+
const _sfc_main = create({
|
|
13
|
+
props: {
|
|
14
|
+
tabTitle: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: ""
|
|
17
|
+
},
|
|
18
|
+
icon: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: ""
|
|
21
|
+
},
|
|
22
|
+
href: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: ""
|
|
25
|
+
},
|
|
26
|
+
num: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: ""
|
|
29
|
+
},
|
|
30
|
+
activeImg: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: ""
|
|
33
|
+
},
|
|
34
|
+
img: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: ""
|
|
37
|
+
},
|
|
38
|
+
classPrefix: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: "nut-icon"
|
|
41
|
+
},
|
|
42
|
+
dot: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: false
|
|
45
|
+
},
|
|
46
|
+
fontClassName: {
|
|
47
|
+
type: String,
|
|
48
|
+
default: "nutui-iconfont"
|
|
49
|
+
},
|
|
50
|
+
to: [Object, String]
|
|
51
|
+
},
|
|
52
|
+
setup(props, ctx) {
|
|
53
|
+
const parent = inject("parent");
|
|
54
|
+
const state = reactive({
|
|
55
|
+
size: parent.size,
|
|
56
|
+
unactiveColor: parent.unactiveColor,
|
|
57
|
+
activeColor: parent.activeColor,
|
|
58
|
+
active: parent.modelValue,
|
|
59
|
+
index: 0
|
|
60
|
+
});
|
|
61
|
+
const router = useRouter();
|
|
62
|
+
const relation = (child) => {
|
|
63
|
+
if (child.proxy) {
|
|
64
|
+
let index2 = parent.children.length;
|
|
65
|
+
state.index = index2;
|
|
66
|
+
parent.children.push(child.proxy);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
relation(getCurrentInstance());
|
|
70
|
+
function change(index2) {
|
|
71
|
+
parent.changeIndex(index2);
|
|
17
72
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
r2.active = t3, setTimeout(() => {
|
|
22
|
-
if (l2.children[t3].href)
|
|
23
|
-
window.location.href = l2.children[t3].href;
|
|
24
|
-
else if (l2.children[t3].to) {
|
|
25
|
-
let e3 = l2.children[t3].to;
|
|
26
|
-
e3 && u2 ? u2.push(e3) : location.replace(e3);
|
|
73
|
+
const choosed = computed(() => {
|
|
74
|
+
if (parent) {
|
|
75
|
+
return parent.modelValue;
|
|
27
76
|
}
|
|
77
|
+
return null;
|
|
78
|
+
});
|
|
79
|
+
watch(choosed, (value, oldValue) => {
|
|
80
|
+
state.active = value;
|
|
81
|
+
setTimeout(() => {
|
|
82
|
+
if (parent.children[value].href) {
|
|
83
|
+
window.location.href = parent.children[value].href;
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if (parent.children[value].to) {
|
|
87
|
+
let to = parent.children[value].to;
|
|
88
|
+
if (to && router) {
|
|
89
|
+
router.push(to);
|
|
90
|
+
} else {
|
|
91
|
+
location.replace(to);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
});
|
|
28
95
|
});
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
96
|
+
return {
|
|
97
|
+
state,
|
|
98
|
+
change
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
const _hoisted_1 = { class: "nut-tabbar-item_icon-box" };
|
|
103
|
+
const _hoisted_2 = {
|
|
104
|
+
key: 0,
|
|
105
|
+
class: "nut-tabbar-item_icon-box_tips nut-tabbar-item_icon-box_num"
|
|
106
|
+
};
|
|
107
|
+
const _hoisted_3 = {
|
|
108
|
+
key: 1,
|
|
109
|
+
class: "nut-tabbar-item_icon-box_tips nut-tabbar-item_icon-box_nums"
|
|
110
|
+
};
|
|
111
|
+
const _hoisted_4 = {
|
|
112
|
+
key: 1,
|
|
113
|
+
class: "nut-tabbar-item_icon-box_dot"
|
|
114
|
+
};
|
|
115
|
+
const _hoisted_5 = { key: 2 };
|
|
116
|
+
const _hoisted_6 = { key: 0 };
|
|
117
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
118
|
+
const _component_nut_icon = resolveComponent("nut-icon");
|
|
119
|
+
return openBlock(), createElementBlock("div", {
|
|
120
|
+
class: normalizeClass(["nut-tabbar-item", { "nut-tabbar-item__icon--unactive": _ctx.state.active != _ctx.state.index }]),
|
|
121
|
+
style: normalizeStyle({
|
|
122
|
+
color: _ctx.state.active == _ctx.state.index ? _ctx.state.activeColor : _ctx.state.unactiveColor
|
|
123
|
+
}),
|
|
124
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.change(_ctx.state.index))
|
|
125
|
+
}, [
|
|
126
|
+
createElementVNode("view", _hoisted_1, [
|
|
127
|
+
!_ctx.dot ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
128
|
+
_ctx.num && _ctx.num <= 99 ? (openBlock(), createElementBlock("view", _hoisted_2, toDisplayString(_ctx.num), 1)) : _ctx.num && _ctx.num > 100 ? (openBlock(), createElementBlock("view", _hoisted_3, toDisplayString("99+"))) : createCommentVNode("", true)
|
|
129
|
+
], 64)) : createCommentVNode("", true),
|
|
130
|
+
_ctx.dot ? (openBlock(), createElementBlock("div", _hoisted_4)) : createCommentVNode("", true),
|
|
131
|
+
_ctx.icon ? (openBlock(), createElementBlock("view", _hoisted_5, [
|
|
132
|
+
createVNode(_component_nut_icon, {
|
|
133
|
+
class: "nut-tabbar-item_icon-box_icon",
|
|
134
|
+
size: _ctx.state.size,
|
|
135
|
+
name: _ctx.icon,
|
|
136
|
+
"font-class-name": _ctx.fontClassName,
|
|
137
|
+
"class-prefix": _ctx.classPrefix
|
|
138
|
+
}, null, 8, ["size", "name", "font-class-name", "class-prefix"])
|
|
139
|
+
])) : createCommentVNode("", true),
|
|
140
|
+
!_ctx.icon && _ctx.activeImg ? (openBlock(), createElementBlock("div", {
|
|
141
|
+
key: 3,
|
|
142
|
+
class: "nut-tabbar-item_icon-box_icon",
|
|
143
|
+
style: normalizeStyle({
|
|
144
|
+
backgroundImage: `url(${_ctx.state.active == _ctx.state.index ? _ctx.activeImg : _ctx.img})`,
|
|
145
|
+
width: _ctx.state.size,
|
|
146
|
+
height: _ctx.state.size
|
|
147
|
+
})
|
|
148
|
+
}, null, 4)) : createCommentVNode("", true),
|
|
149
|
+
createElementVNode("view", {
|
|
150
|
+
class: normalizeClass(["nut-tabbar-item_icon-box_nav-word", { "nut-tabbar-item_icon-box_big-word": !_ctx.icon && !_ctx.activeImg }])
|
|
151
|
+
}, [
|
|
152
|
+
_ctx.tabTitle ? (openBlock(), createElementBlock("view", _hoisted_6, toDisplayString(_ctx.tabTitle), 1)) : createCommentVNode("", true),
|
|
153
|
+
!_ctx.tabTitle ? renderSlot(_ctx.$slots, "default", { key: 1 }) : createCommentVNode("", true)
|
|
154
|
+
], 2)
|
|
155
|
+
])
|
|
156
|
+
], 6);
|
|
157
|
+
}
|
|
158
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
159
|
+
export { index as default };
|