@nutui/nutui 4.0.9 → 4.0.10
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 +17 -0
- package/dist/nutui.es.js +1 -1
- package/dist/nutui.js +15382 -0
- package/dist/nutui.umd.js +1 -7
- package/dist/packages/_es/ActionSheet.js +78 -111
- package/dist/packages/_es/Address.js +250 -375
- package/dist/packages/_es/AddressList.js +269 -354
- package/dist/packages/_es/Animate.js +41 -58
- package/dist/packages/_es/Audio.js +128 -197
- package/dist/packages/_es/AudioOperate.js +60 -71
- package/dist/packages/_es/Avatar.js +66 -89
- package/dist/packages/_es/AvatarGroup.js +23 -31
- package/dist/packages/_es/Backtop.js +59 -99
- package/dist/packages/_es/Badge.js +36 -47
- package/dist/packages/_es/Barrage.js +68 -147
- package/dist/packages/_es/Button.js +47 -66
- package/dist/packages/_es/Calendar.js +135 -157
- package/dist/packages/_es/CalendarItem.js +6 -6
- package/dist/packages/_es/Card.js +42 -56
- package/dist/packages/_es/Cascader.js +315 -474
- package/dist/packages/_es/Category.js +29 -39
- package/dist/packages/_es/CategoryPane.js +57 -83
- package/dist/packages/_es/Cell.js +56 -71
- package/dist/packages/_es/CellGroup.js +19 -27
- package/dist/packages/_es/Checkbox.js +109 -156
- package/dist/packages/_es/CheckboxGroup.js +38 -59
- package/dist/packages/_es/CircleProgress.js +67 -96
- package/dist/packages/_es/Col.js +23 -31
- package/dist/packages/_es/Collapse.js +33 -58
- package/dist/packages/_es/CollapseItem.js +78 -108
- package/dist/packages/_es/Comment.js +207 -279
- package/dist/packages/_es/ConfigProvider.js +37 -55
- package/dist/packages/_es/Countdown.js +100 -212
- package/dist/packages/_es/Countup.js +232 -445
- package/dist/packages/_es/DatePicker.js +162 -265
- package/dist/packages/_es/Dialog.js +161 -213
- package/dist/packages/_es/Divider.js +42 -57
- package/dist/packages/_es/Drag.js +70 -153
- package/dist/packages/_es/Ecard.js +64 -104
- package/dist/packages/_es/Elevator.js +143 -219
- package/dist/packages/_es/Ellipsis.js +95 -178
- package/dist/packages/_es/Empty.js +23 -39
- package/dist/packages/_es/FixedNav.js +93 -116
- package/dist/packages/_es/Form.js +107 -178
- package/dist/packages/_es/FormItem.js +48 -61
- package/dist/packages/_es/Grid.js +5 -6
- package/dist/packages/_es/GridItem.js +58 -84
- package/dist/packages/_es/Image.js +90 -129
- package/dist/packages/_es/ImagePreview.js +256 -412
- package/dist/packages/_es/Indicator.js +30 -34
- package/dist/packages/_es/InfiniteLoading.js +83 -136
- package/dist/packages/_es/Input.js +160 -264
- package/dist/packages/_es/InputNumber.js +81 -117
- package/dist/packages/_es/Interceptor-6e26b757.js +18 -0
- package/dist/packages/_es/Invoice.js +104 -130
- package/dist/packages/_es/Layout.js +3 -4
- package/dist/packages/_es/List.js +117 -215
- package/dist/packages/_es/Menu.js +96 -152
- package/dist/packages/_es/MenuItem.js +117 -172
- package/dist/packages/_es/Navbar.js +103 -119
- package/dist/packages/_es/Noticebar.js +197 -312
- package/dist/packages/_es/Notify.js +110 -166
- package/dist/packages/_es/NumberKeyboard.js +127 -202
- package/dist/packages/_es/Overlay.js +52 -80
- package/dist/packages/_es/Pagination.js +70 -100
- package/dist/packages/_es/Picker.js +275 -441
- package/dist/packages/_es/Popover.js +122 -225
- package/dist/packages/_es/Popup.js +4 -4
- package/dist/packages/_es/Price.js +44 -82
- package/dist/packages/_es/Progress.js +63 -79
- package/dist/packages/_es/PullRefresh.js +95 -173
- package/dist/packages/_es/Radio.js +4 -4
- package/dist/packages/_es/RadioGroup.js +3 -3
- package/dist/packages/_es/Range.js +204 -347
- package/dist/packages/_es/Rate.js +92 -141
- package/dist/packages/_es/Row.js +21 -27
- package/dist/packages/_es/Searchbar.js +130 -179
- package/dist/packages/_es/ShortPassword.js +69 -93
- package/dist/packages/_es/SideNavbar.js +49 -80
- package/dist/packages/_es/SideNavbarItem.js +22 -32
- package/dist/packages/_es/Signature.js +83 -146
- package/dist/packages/_es/Skeleton.js +110 -130
- package/dist/packages/_es/Sku.js +250 -343
- package/dist/packages/_es/Step.js +59 -86
- package/dist/packages/_es/Steps.js +26 -31
- package/dist/packages/_es/Sticky.js +4 -4
- package/dist/packages/_es/SubSideNavbar.js +52 -74
- package/dist/packages/_es/Swipe.js +83 -155
- package/dist/packages/_es/Swiper.js +174 -311
- package/dist/packages/_es/SwiperItem.js +28 -44
- package/dist/packages/_es/Switch.js +55 -68
- package/dist/packages/_es/TabPane.js +30 -41
- package/dist/packages/_es/Tabbar.js +41 -52
- package/dist/packages/_es/TabbarItem.js +61 -82
- package/dist/packages/_es/Table.js +109 -165
- package/dist/packages/_es/Tabs.js +240 -388
- package/dist/packages/_es/Tag.js +44 -61
- package/dist/packages/_es/Textarea.js +80 -124
- package/dist/packages/_es/TimeDetail.js +49 -76
- package/dist/packages/_es/TimePannel.js +34 -48
- package/dist/packages/_es/TimeSelect.js +47 -68
- package/dist/packages/_es/Toast.js +144 -218
- package/dist/packages/_es/Tour.js +138 -192
- package/dist/packages/_es/TrendArrow.js +57 -77
- package/dist/packages/_es/Uploader.js +234 -359
- package/dist/packages/_es/Video.js +191 -316
- package/dist/packages/_es/Watermark.js +84 -117
- package/dist/packages/_es/_plugin-vue_export-helper-dad06003.js +9 -0
- package/dist/packages/_es/common-d218746f.js +116 -0
- package/dist/packages/_es/component-234624bc.js +89 -0
- package/dist/packages/_es/index-14dfadc4.js +561 -0
- package/dist/packages/_es/index-192a3ef6.js +29 -0
- package/dist/packages/_es/index-360c5092.js +210 -0
- package/dist/packages/_es/index-496e6e05.js +24 -0
- package/dist/packages/_es/index-50eed3d9.js +7 -0
- package/dist/packages/_es/index-53ec2d4d.js +34 -0
- package/dist/packages/_es/index-fadb0974.js +8 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-1139b29a.js +43 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-43b774dd.js +77 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-f44c159d.js +110 -0
- package/dist/packages/_es/mountComponent-6d4ff200.js +23 -0
- package/dist/packages/_es/pxCheck-38173291.js +4 -0
- package/dist/packages/_es/raf-a74f1a06.js +16 -0
- package/dist/packages/_es/renderIcon-47498b32.js +5 -0
- package/dist/packages/col/index.scss +2 -2
- package/dist/packages/menuitem/index.scss +7 -10
- package/dist/packages/searchbar/index.scss +4 -0
- package/dist/smartips/web-types.json +2 -2
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +158 -55
- package/dist/styles/themes/jdb.scss +158 -55
- package/dist/styles/themes/jddkh.scss +158 -55
- package/dist/styles/themes/jdt.scss +158 -55
- package/dist/types/__VUE/address/index.vue.d.ts +1 -1
- package/dist/types/__VUE/collapseitem/index.vue.d.ts +110 -3
- package/dist/types/__VUE/image/index.vue.d.ts +2 -2
- package/dist/types/__VUE/menu/index.vue.d.ts +0 -2
- package/dist/types/__VUE/menuitem/index.vue.d.ts +9 -17
- package/dist/types/__VUE/navbar/index.vue.d.ts +1 -1
- package/dist/types/__VUE/picker/usePicker.d.ts +1 -1
- package/dist/types/__VUE/rate/index.vue.d.ts +110 -3
- package/dist/types/__VUE/row/index.vue.d.ts +1 -1
- package/dist/types/__VUE/searchbar/index.vue.d.ts +121 -5
- package/dist/types/__VUE/skeleton/index.vue.d.ts +2 -2
- package/dist/types/__VUE/swiper/index.vue.d.ts +1 -1
- package/dist/types/__VUE/table/common.d.ts +55 -2
- package/dist/types/__VUE/timeselect/index.vue.d.ts +1 -1
- package/dist/types/__VUE/watermark/index.vue.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -2
- package/dist/packages/_es/Interceptor-956b24fc.js +0 -29
- package/dist/packages/_es/_plugin-vue_export-helper-cc2b3d55.js +0 -10
- package/dist/packages/_es/common-b9a5e726.js +0 -145
- package/dist/packages/_es/component-81a4c1d0.js +0 -145
- package/dist/packages/_es/index-29892cda.js +0 -33
- package/dist/packages/_es/index-43c34ac6.js +0 -30
- package/dist/packages/_es/index-54d03fc1.js +0 -8
- package/dist/packages/_es/index-79c5dc33.js +0 -10
- package/dist/packages/_es/index-7a7385e4.js +0 -67
- package/dist/packages/_es/index-87422be8.js +0 -942
- package/dist/packages/_es/index-da0a7662.js +0 -259
- package/dist/packages/_es/index.vue_vue_type_script_lang-22dfc112.js +0 -46
- package/dist/packages/_es/index.vue_vue_type_script_lang-442e4704.js +0 -98
- package/dist/packages/_es/index.vue_vue_type_script_lang-cc5c4086.js +0 -151
- package/dist/packages/_es/mountComponent-8b24c346.js +0 -39
- package/dist/packages/_es/pxCheck-c6b9f6b7.js +0 -6
- package/dist/packages/_es/raf-729dad54.js +0 -25
- package/dist/packages/_es/renderIcon-3d0fd47c.js +0 -9
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { computed, watch, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot, createVNode, createCommentVNode, Fragment, withDirectives, toDisplayString, vShow } from "vue";
|
|
2
|
-
import { c as
|
|
3
|
-
import { Loading1 } from "@nutui/icons-vue";
|
|
4
|
-
import { _ as
|
|
1
|
+
import { computed as i, watch as y, resolveComponent as C, openBlock as d, createElementBlock as m, normalizeClass as w, normalizeStyle as V, createElementVNode as c, renderSlot as b, createVNode as h, createCommentVNode as v, Fragment as k, withDirectives as f, toDisplayString as g, vShow as p } from "vue";
|
|
2
|
+
import { c as S } from "./component-234624bc.js";
|
|
3
|
+
import { Loading1 as B } from "@nutui/icons-vue";
|
|
4
|
+
import { _ as N } from "./_plugin-vue_export-helper-dad06003.js";
|
|
5
5
|
import "../locale/lang";
|
|
6
|
-
const { componentName
|
|
7
|
-
|
|
8
|
-
components: { Loading1 },
|
|
6
|
+
const { componentName: $, create: T } = S("switch"), A = T({
|
|
7
|
+
components: { Loading1: B },
|
|
9
8
|
props: {
|
|
10
9
|
modelValue: {
|
|
11
10
|
type: [String, Number, Boolean],
|
|
12
|
-
default:
|
|
11
|
+
default: !1
|
|
13
12
|
},
|
|
14
13
|
disable: {
|
|
15
14
|
type: Boolean,
|
|
16
|
-
default:
|
|
15
|
+
default: !1
|
|
17
16
|
},
|
|
18
17
|
activeColor: {
|
|
19
18
|
type: String,
|
|
@@ -33,88 +32,76 @@ const _sfc_main = create({
|
|
|
33
32
|
},
|
|
34
33
|
activeValue: {
|
|
35
34
|
type: [String, Number, Boolean],
|
|
36
|
-
default:
|
|
35
|
+
default: !0
|
|
37
36
|
},
|
|
38
37
|
inactiveValue: {
|
|
39
38
|
type: [String, Number, Boolean],
|
|
40
|
-
default:
|
|
39
|
+
default: !1
|
|
41
40
|
},
|
|
42
41
|
loading: {
|
|
43
42
|
type: Boolean,
|
|
44
|
-
default:
|
|
43
|
+
default: !1
|
|
45
44
|
}
|
|
46
45
|
},
|
|
47
46
|
emits: ["change", "update:modelValue", "update:loading"],
|
|
48
|
-
setup(
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
const prefixCls = componentName;
|
|
47
|
+
setup(e, { emit: a }) {
|
|
48
|
+
const o = i(() => e.modelValue === e.activeValue), s = i(() => {
|
|
49
|
+
const t = $;
|
|
52
50
|
return {
|
|
53
|
-
[
|
|
54
|
-
[
|
|
55
|
-
[`${
|
|
56
|
-
[`${
|
|
51
|
+
[t]: !0,
|
|
52
|
+
[o.value ? "nut-switch-open" : "nut-switch-close"]: !0,
|
|
53
|
+
[`${t}-disable`]: e.disable,
|
|
54
|
+
[`${t}-base`]: !0
|
|
57
55
|
};
|
|
58
|
-
})
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
let updateType = "";
|
|
65
|
-
const onClick = (event) => {
|
|
66
|
-
if (props.disable || props.loading)
|
|
56
|
+
}), r = i(() => ({
|
|
57
|
+
backgroundColor: o.value ? e.activeColor : e.inactiveColor
|
|
58
|
+
}));
|
|
59
|
+
let l = "";
|
|
60
|
+
const n = (t) => {
|
|
61
|
+
if (e.disable || e.loading)
|
|
67
62
|
return;
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
emit("update:modelValue", value);
|
|
71
|
-
emit("change", value, event);
|
|
63
|
+
const u = o.value ? e.inactiveValue : e.activeValue;
|
|
64
|
+
l = "click", a("update:modelValue", u), a("change", u, t);
|
|
72
65
|
};
|
|
73
|
-
|
|
74
|
-
() =>
|
|
75
|
-
(
|
|
76
|
-
|
|
77
|
-
updateType = "";
|
|
78
|
-
} else {
|
|
79
|
-
emit("change", v);
|
|
80
|
-
}
|
|
66
|
+
return y(
|
|
67
|
+
() => e.modelValue,
|
|
68
|
+
(t) => {
|
|
69
|
+
l == "click" ? l = "" : a("change", t);
|
|
81
70
|
}
|
|
82
|
-
)
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
onClick
|
|
71
|
+
), {
|
|
72
|
+
classes: s,
|
|
73
|
+
style: r,
|
|
74
|
+
isActive: o,
|
|
75
|
+
onClick: n
|
|
88
76
|
};
|
|
89
77
|
}
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
style: normalizeStyle(_ctx.style)
|
|
78
|
+
}), L = { class: "nut-switch-button" };
|
|
79
|
+
function z(e, a, o, s, r, l) {
|
|
80
|
+
const n = C("Loading1");
|
|
81
|
+
return d(), m("view", {
|
|
82
|
+
class: w(e.classes),
|
|
83
|
+
onClick: a[0] || (a[0] = (...t) => e.onClick && e.onClick(...t)),
|
|
84
|
+
style: V(e.style)
|
|
98
85
|
}, [
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
86
|
+
c("view", L, [
|
|
87
|
+
e.loading ? b(e.$slots, "icon", { key: 0 }, () => [
|
|
88
|
+
h(n, {
|
|
102
89
|
name: "loading",
|
|
103
|
-
color:
|
|
90
|
+
color: e.activeColor
|
|
104
91
|
}, null, 8, ["color"])
|
|
105
|
-
]) :
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
[
|
|
92
|
+
]) : v("", !0),
|
|
93
|
+
e.activeText ? (d(), m(k, { key: 1 }, [
|
|
94
|
+
f(c("view", { class: "nut-switch-label open" }, g(e.activeText), 513), [
|
|
95
|
+
[p, e.isActive]
|
|
109
96
|
]),
|
|
110
|
-
|
|
111
|
-
[
|
|
97
|
+
f(c("view", { class: "nut-switch-label close" }, g(e.inactiveText), 513), [
|
|
98
|
+
[p, !e.isActive]
|
|
112
99
|
])
|
|
113
|
-
], 64)) :
|
|
100
|
+
], 64)) : v("", !0)
|
|
114
101
|
])
|
|
115
102
|
], 6);
|
|
116
103
|
}
|
|
117
|
-
const
|
|
104
|
+
const G = /* @__PURE__ */ N(A, [["render", z]]);
|
|
118
105
|
export {
|
|
119
|
-
|
|
106
|
+
G as default
|
|
120
107
|
};
|
|
@@ -1,28 +1,20 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import { inject, computed, openBlock, createElementBlock, normalizeClass, normalizeStyle, renderSlot } from "vue";
|
|
21
|
-
import { c as createComponent } from "./component-81a4c1d0.js";
|
|
22
|
-
import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
|
|
1
|
+
var s = Object.defineProperty, l = Object.defineProperties;
|
|
2
|
+
var c = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var o = Object.getOwnPropertySymbols;
|
|
4
|
+
var m = Object.prototype.hasOwnProperty, u = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var r = (e, a, t) => a in e ? s(e, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[a] = t, p = (e, a) => {
|
|
6
|
+
for (var t in a || (a = {}))
|
|
7
|
+
m.call(a, t) && r(e, t, a[t]);
|
|
8
|
+
if (o)
|
|
9
|
+
for (var t of o(a))
|
|
10
|
+
u.call(a, t) && r(e, t, a[t]);
|
|
11
|
+
return e;
|
|
12
|
+
}, i = (e, a) => l(e, c(a));
|
|
13
|
+
import { inject as d, computed as f, openBlock as y, createElementBlock as b, normalizeClass as v, normalizeStyle as S, renderSlot as K } from "vue";
|
|
14
|
+
import { c as $ } from "./component-234624bc.js";
|
|
15
|
+
import { _ } from "./_plugin-vue_export-helper-dad06003.js";
|
|
23
16
|
import "../locale/lang";
|
|
24
|
-
const { create } =
|
|
25
|
-
const _sfc_main = create({
|
|
17
|
+
const { create: g } = $("tab-pane"), k = g({
|
|
26
18
|
props: {
|
|
27
19
|
title: {
|
|
28
20
|
type: [String, Number],
|
|
@@ -34,31 +26,28 @@ const _sfc_main = create({
|
|
|
34
26
|
},
|
|
35
27
|
disabled: {
|
|
36
28
|
type: Boolean,
|
|
37
|
-
default:
|
|
29
|
+
default: !1
|
|
38
30
|
}
|
|
39
31
|
},
|
|
40
32
|
emits: ["click"],
|
|
41
|
-
setup(
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
});
|
|
48
|
-
return __spreadProps(__spreadValues({}, parentOption), {
|
|
49
|
-
paneStyle
|
|
33
|
+
setup(e, { emit: a }) {
|
|
34
|
+
const t = d("tabsOpiton"), n = f(() => ({
|
|
35
|
+
display: t.animatedTime.value == 0 && e.paneKey != t.activeKey.value ? "none" : void 0
|
|
36
|
+
}));
|
|
37
|
+
return i(p({}, t), {
|
|
38
|
+
paneStyle: n
|
|
50
39
|
});
|
|
51
40
|
}
|
|
52
41
|
});
|
|
53
|
-
function
|
|
54
|
-
return
|
|
55
|
-
class:
|
|
56
|
-
style:
|
|
42
|
+
function B(e, a, t, n, h, z) {
|
|
43
|
+
return y(), b("view", {
|
|
44
|
+
class: v(["nut-tab-pane", { inactive: e.paneKey != e.activeKey && e.autoHeight }]),
|
|
45
|
+
style: S(e.paneStyle)
|
|
57
46
|
}, [
|
|
58
|
-
|
|
47
|
+
K(e.$slots, "default")
|
|
59
48
|
], 6);
|
|
60
49
|
}
|
|
61
|
-
const
|
|
50
|
+
const w = /* @__PURE__ */ _(k, [["render", B]]);
|
|
62
51
|
export {
|
|
63
|
-
|
|
52
|
+
w as default
|
|
64
53
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { toRefs, ref, reactive, provide, watch, onMounted, nextTick, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot } from "vue";
|
|
2
|
-
import { c as
|
|
3
|
-
import { _ as
|
|
1
|
+
import { toRefs as h, ref as i, reactive as m, provide as b, watch as v, onMounted as g, nextTick as y, openBlock as V, createElementBlock as C, normalizeClass as f, normalizeStyle as B, createElementVNode as S, renderSlot as _ } from "vue";
|
|
2
|
+
import { c as $ } from "./component-234624bc.js";
|
|
3
|
+
import { _ as w } from "./_plugin-vue_export-helper-dad06003.js";
|
|
4
4
|
import "../locale/lang";
|
|
5
|
-
const { create } =
|
|
6
|
-
const _sfc_main = create({
|
|
5
|
+
const { create: k } = $("tabbar"), I = k({
|
|
7
6
|
props: {
|
|
8
7
|
modelValue: {
|
|
9
8
|
type: [Number, String],
|
|
@@ -11,7 +10,7 @@ const _sfc_main = create({
|
|
|
11
10
|
},
|
|
12
11
|
bottom: {
|
|
13
12
|
type: Boolean,
|
|
14
|
-
default:
|
|
13
|
+
default: !1
|
|
15
14
|
},
|
|
16
15
|
type: {
|
|
17
16
|
type: String,
|
|
@@ -27,70 +26,60 @@ const _sfc_main = create({
|
|
|
27
26
|
},
|
|
28
27
|
safeAreaInsetBottom: {
|
|
29
28
|
type: Boolean,
|
|
30
|
-
default:
|
|
29
|
+
default: !1
|
|
31
30
|
},
|
|
32
31
|
placeholder: {
|
|
33
32
|
type: Boolean,
|
|
34
|
-
default:
|
|
33
|
+
default: !1
|
|
35
34
|
}
|
|
36
35
|
},
|
|
37
36
|
emits: ["tab-switch", "update:modelValue"],
|
|
38
|
-
setup(
|
|
39
|
-
const { bottom, placeholder } =
|
|
40
|
-
|
|
41
|
-
const mdValue = reactive({
|
|
42
|
-
val: props.modelValue,
|
|
37
|
+
setup(e, { emit: l, slots: p }) {
|
|
38
|
+
const { bottom: u, placeholder: d } = h(e), n = i(), s = m({
|
|
39
|
+
val: e.modelValue,
|
|
43
40
|
children: []
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
emit("update:modelValue", active);
|
|
48
|
-
parentData.modelValue = active;
|
|
49
|
-
emit("tab-switch", parentData.children[index2], active);
|
|
41
|
+
}), a = i(null);
|
|
42
|
+
function c(t, r) {
|
|
43
|
+
l("update:modelValue", r), o.modelValue = r, l("tab-switch", o.children[t], r);
|
|
50
44
|
}
|
|
51
|
-
let
|
|
52
|
-
children:
|
|
53
|
-
modelValue:
|
|
54
|
-
unactiveColor:
|
|
55
|
-
activeColor:
|
|
56
|
-
changeIndex
|
|
45
|
+
let o = m({
|
|
46
|
+
children: s.children,
|
|
47
|
+
modelValue: s.val,
|
|
48
|
+
unactiveColor: e.unactiveColor,
|
|
49
|
+
activeColor: e.activeColor,
|
|
50
|
+
changeIndex: c
|
|
57
51
|
});
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
() =>
|
|
61
|
-
|
|
62
|
-
parentData.modelValue = value;
|
|
63
|
-
}
|
|
64
|
-
);
|
|
65
|
-
onMounted(() => {
|
|
66
|
-
if (bottom.value && placeholder.value) {
|
|
67
|
-
nextTick(() => {
|
|
68
|
-
var _a;
|
|
69
|
-
height.value = (_a = nutTabbar == null ? void 0 : nutTabbar.value) == null ? void 0 : _a.getBoundingClientRect().height;
|
|
70
|
-
});
|
|
52
|
+
return b("parent", o), v(
|
|
53
|
+
() => e.modelValue,
|
|
54
|
+
(t) => {
|
|
55
|
+
o.modelValue = t;
|
|
71
56
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
57
|
+
), g(() => {
|
|
58
|
+
u.value && d.value && y(() => {
|
|
59
|
+
var t;
|
|
60
|
+
n.value = (t = a == null ? void 0 : a.value) == null ? void 0 : t.getBoundingClientRect().height;
|
|
61
|
+
});
|
|
62
|
+
}), {
|
|
63
|
+
changeIndex: c,
|
|
64
|
+
nutTabbar: a,
|
|
65
|
+
height: n
|
|
77
66
|
};
|
|
78
67
|
}
|
|
79
68
|
});
|
|
80
|
-
function
|
|
81
|
-
return
|
|
82
|
-
class:
|
|
83
|
-
style:
|
|
69
|
+
function z(e, l, p, u, d, n) {
|
|
70
|
+
return V(), C("div", {
|
|
71
|
+
class: f({ "nut-tabbar__placeholder": e.bottom && e.placeholder }),
|
|
72
|
+
style: B({ height: e.height + "px" })
|
|
84
73
|
}, [
|
|
85
|
-
|
|
74
|
+
S("view", {
|
|
86
75
|
ref: "nutTabbar",
|
|
87
|
-
class:
|
|
76
|
+
class: f(["nut-tabbar", { "nut-tabbar-bottom": e.bottom, "nut-tabbar-safebottom": e.safeAreaInsetBottom }])
|
|
88
77
|
}, [
|
|
89
|
-
|
|
78
|
+
_(e.$slots, "default")
|
|
90
79
|
], 2)
|
|
91
80
|
], 6);
|
|
92
81
|
}
|
|
93
|
-
const
|
|
82
|
+
const x = /* @__PURE__ */ w(I, [["render", z]]);
|
|
94
83
|
export {
|
|
95
|
-
|
|
84
|
+
x as default
|
|
96
85
|
};
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
import { r as
|
|
3
|
-
import { inject, reactive, getCurrentInstance, computed, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createVNode, normalizeProps, guardReactiveProps, withCtx, createElementVNode, renderSlot, createCommentVNode, createBlock, resolveDynamicComponent, toDisplayString } from "vue";
|
|
4
|
-
import { u as
|
|
5
|
-
import
|
|
6
|
-
import { _ as
|
|
1
|
+
import { c as k } from "./component-234624bc.js";
|
|
2
|
+
import { r as $ } from "./renderIcon-47498b32.js";
|
|
3
|
+
import { inject as I, reactive as B, getCurrentInstance as H, computed as j, resolveComponent as z, openBlock as c, createElementBlock as l, normalizeClass as h, normalizeStyle as N, createVNode as O, normalizeProps as T, guardReactiveProps as D, withCtx as E, createElementVNode as g, renderSlot as y, createCommentVNode as d, createBlock as P, resolveDynamicComponent as R, toDisplayString as x } from "vue";
|
|
4
|
+
import { u as V } from "./index-50eed3d9.js";
|
|
5
|
+
import C from "./Badge.js";
|
|
6
|
+
import { _ as q } from "./_plugin-vue_export-helper-dad06003.js";
|
|
7
7
|
import "../locale/lang";
|
|
8
|
-
const { create } =
|
|
9
|
-
|
|
10
|
-
components: { [Badge.name]: Badge },
|
|
8
|
+
const { create: A } = k("tabbar-item"), F = A({
|
|
9
|
+
components: { [C.name]: C },
|
|
11
10
|
props: {
|
|
12
11
|
tabTitle: {
|
|
13
12
|
// 标签页的标题
|
|
@@ -28,95 +27,75 @@ const _sfc_main = create({
|
|
|
28
27
|
},
|
|
29
28
|
to: [Object, String]
|
|
30
29
|
},
|
|
31
|
-
setup(
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
};
|
|
35
|
-
const parent = inject("parent");
|
|
36
|
-
const state = reactive({
|
|
37
|
-
unactiveColor: parent.unactiveColor,
|
|
30
|
+
setup(e, { emit: m, slots: u }) {
|
|
31
|
+
const p = (n) => u[n], t = I("parent"), i = B({
|
|
32
|
+
unactiveColor: t.unactiveColor,
|
|
38
33
|
// 未选中的颜色
|
|
39
|
-
activeColor:
|
|
34
|
+
activeColor: t.activeColor,
|
|
40
35
|
// 选中的颜色
|
|
41
36
|
index: 0
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
state.index = (_a = props.name) != null ? _a : index2;
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
relation(getCurrentInstance());
|
|
53
|
-
const active = computed(() => state.index === parent.modelValue);
|
|
54
|
-
function change() {
|
|
55
|
-
var _a, _b, _c;
|
|
56
|
-
let key = (_a = props.name) != null ? _a : state.index;
|
|
57
|
-
let indexValue = null;
|
|
58
|
-
if (props.name) {
|
|
59
|
-
indexValue = parent.children.findIndex((item) => {
|
|
60
|
-
return item.name == key;
|
|
61
|
-
});
|
|
37
|
+
}), s = V();
|
|
38
|
+
((n) => {
|
|
39
|
+
var o;
|
|
40
|
+
if (n.proxy) {
|
|
41
|
+
t.children.push(n.proxy);
|
|
42
|
+
const r = t.children.indexOf(n.proxy);
|
|
43
|
+
i.index = (o = e.name) != null ? o : r;
|
|
62
44
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
45
|
+
})(H());
|
|
46
|
+
const _ = j(() => i.index === t.modelValue);
|
|
47
|
+
function w() {
|
|
48
|
+
var v, f, b;
|
|
49
|
+
let n = (v = e.name) != null ? v : i.index, o = null;
|
|
50
|
+
e.name && (o = t.children.findIndex((a) => a.name == n)), t.changeIndex(o != null ? o : n, i.index);
|
|
51
|
+
let r = o != null ? o : n;
|
|
52
|
+
if ((f = t.children[r]) != null && f.href) {
|
|
53
|
+
window.location.href = t.children[r].href;
|
|
67
54
|
return;
|
|
68
55
|
}
|
|
69
|
-
if ((
|
|
70
|
-
let
|
|
71
|
-
|
|
72
|
-
router.push(to);
|
|
73
|
-
} else {
|
|
74
|
-
location.replace(to);
|
|
75
|
-
}
|
|
56
|
+
if ((b = t.children[r]) != null && b.to) {
|
|
57
|
+
let a = t.children[r].to;
|
|
58
|
+
a && s ? s.push(a) : location.replace(a);
|
|
76
59
|
}
|
|
77
60
|
}
|
|
78
61
|
return {
|
|
79
|
-
state,
|
|
80
|
-
active,
|
|
81
|
-
renderIcon
|
|
82
|
-
isHaveSlot,
|
|
83
|
-
change
|
|
62
|
+
state: i,
|
|
63
|
+
active: _,
|
|
64
|
+
renderIcon: $,
|
|
65
|
+
isHaveSlot: p,
|
|
66
|
+
change: w
|
|
84
67
|
};
|
|
85
68
|
}
|
|
86
|
-
})
|
|
87
|
-
const _hoisted_1 = { class: "nut-tabbar-item_icon-box" };
|
|
88
|
-
const _hoisted_2 = {
|
|
69
|
+
}), G = { class: "nut-tabbar-item_icon-box" }, J = {
|
|
89
70
|
key: 0,
|
|
90
71
|
class: "nut-tabbar-item_icon-box_icon"
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
style: normalizeStyle({
|
|
99
|
-
color: _ctx.active ? _ctx.state.activeColor : _ctx.state.unactiveColor
|
|
72
|
+
}, K = { key: 1 }, L = { key: 0 };
|
|
73
|
+
function M(e, m, u, p, t, i) {
|
|
74
|
+
const s = z("nut-badge");
|
|
75
|
+
return c(), l("div", {
|
|
76
|
+
class: h(["nut-tabbar-item", { "nut-tabbar-item__icon--unactive": !e.active }]),
|
|
77
|
+
style: N({
|
|
78
|
+
color: e.active ? e.state.activeColor : e.state.unactiveColor
|
|
100
79
|
}),
|
|
101
|
-
onClick:
|
|
80
|
+
onClick: m[0] || (m[0] = (S) => e.change())
|
|
102
81
|
}, [
|
|
103
|
-
|
|
104
|
-
default:
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
])) :
|
|
109
|
-
|
|
110
|
-
(
|
|
111
|
-
])) :
|
|
112
|
-
|
|
113
|
-
class:
|
|
82
|
+
O(s, T(D(e.$attrs)), {
|
|
83
|
+
default: E(() => [
|
|
84
|
+
g("view", G, [
|
|
85
|
+
e.isHaveSlot("icon") ? (c(), l("div", J, [
|
|
86
|
+
y(e.$slots, "icon", { active: e.active })
|
|
87
|
+
])) : d("", !0),
|
|
88
|
+
e.icon && !e.isHaveSlot("icon") ? (c(), l("view", K, [
|
|
89
|
+
(c(), P(R(e.renderIcon(e.icon)), { class: "nut-popover-item-img" }))
|
|
90
|
+
])) : d("", !0),
|
|
91
|
+
g("view", {
|
|
92
|
+
class: h([
|
|
114
93
|
"nut-tabbar-item_icon-box_nav-word",
|
|
115
|
-
{ "nut-tabbar-item_icon-box_big-word": !
|
|
94
|
+
{ "nut-tabbar-item_icon-box_big-word": !e.icon && !e.isHaveSlot("icon") }
|
|
116
95
|
])
|
|
117
96
|
}, [
|
|
118
|
-
|
|
119
|
-
|
|
97
|
+
y(e.$slots, "default", {}, () => [
|
|
98
|
+
e.tabTitle ? (c(), l("view", L, x(e.tabTitle), 1)) : d("", !0)
|
|
120
99
|
])
|
|
121
100
|
], 2)
|
|
122
101
|
])
|
|
@@ -125,7 +104,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
125
104
|
}, 16)
|
|
126
105
|
], 6);
|
|
127
106
|
}
|
|
128
|
-
const
|
|
107
|
+
const te = /* @__PURE__ */ q(F, [["render", M]]);
|
|
129
108
|
export {
|
|
130
|
-
|
|
109
|
+
te as default
|
|
131
110
|
};
|