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