@nutui/nutui 4.3.2 → 4.3.4

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 (227) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/dist/nutui.es.js +2 -4
  3. package/dist/nutui.js +7000 -7518
  4. package/dist/nutui.umd.js +1 -1
  5. package/dist/packages/{Interceptor-WYVtGbGC.js → Interceptor-DlY2h6Y7.js} +2 -2
  6. package/dist/packages/actionsheet/ActionSheet.js +3 -3
  7. package/dist/packages/address/Address.js +5 -5
  8. package/dist/packages/addresslist/AddressList.js +6 -6
  9. package/dist/packages/animate/Animate.js +1 -1
  10. package/dist/packages/audio/Audio.js +2 -2
  11. package/dist/packages/audiooperate/AudioOperate.js +3 -3
  12. package/dist/packages/avatar/Avatar.js +2 -2
  13. package/dist/packages/avatarcropper/AvatarCropper.js +5 -5
  14. package/dist/packages/avatargroup/AvatarGroup.js +3 -3
  15. package/dist/packages/backtop/Backtop.js +80 -90
  16. package/dist/packages/badge/Badge.js +2 -2
  17. package/dist/packages/barrage/Barrage.js +2 -2
  18. package/dist/packages/button/Button.js +1 -1
  19. package/dist/packages/calendar/Calendar.js +817 -6
  20. package/dist/packages/calendar/index.scss +0 -1
  21. package/dist/packages/calendarcard/CalendarCard.js +4 -4
  22. package/dist/packages/card/Card.js +4 -4
  23. package/dist/packages/cascader/Cascader.js +4 -4
  24. package/dist/packages/category/Category.js +4 -4
  25. package/dist/packages/categorypane/CategoryPane.js +5 -5
  26. package/dist/packages/cell/Cell.js +4 -4
  27. package/dist/packages/cellgroup/CellGroup.js +2 -2
  28. package/dist/packages/checkbox/Checkbox.js +4 -4
  29. package/dist/packages/checkboxgroup/CheckboxGroup.js +2 -2
  30. package/dist/packages/circleprogress/CircleProgress.js +91 -98
  31. package/dist/packages/col/Col.js +2 -2
  32. package/dist/packages/collapse/Collapse.js +2 -2
  33. package/dist/packages/collapseitem/CollapseItem.js +3 -3
  34. package/dist/packages/comment/Comment.js +6 -6
  35. package/dist/packages/{common-4inKawxR.js → common-Chr7cC9o.js} +2 -2
  36. package/dist/packages/{common-FZL3qC99.js → common-DRG0ue26.js} +1 -1
  37. package/dist/packages/configprovider/ConfigProvider.js +1 -1
  38. package/dist/packages/countdown/Countdown.js +4 -4
  39. package/dist/packages/countup/Countup.js +9 -9
  40. package/dist/packages/{date-djiVNSnJ.js → date-DHXcwF1m.js} +2 -2
  41. package/dist/packages/datepicker/DatePicker.js +3 -3
  42. package/dist/packages/dialog/Dialog.js +8 -8
  43. package/dist/packages/divider/Divider.js +1 -1
  44. package/dist/packages/drag/Drag.js +3 -3
  45. package/dist/packages/ecard/Ecard.js +5 -5
  46. package/dist/packages/elevator/Elevator.js +2 -2
  47. package/dist/packages/ellipsis/Ellipsis.js +4 -4
  48. package/dist/packages/empty/Empty.js +67 -52
  49. package/dist/packages/fixednav/FixedNav.js +3 -3
  50. package/dist/packages/form/Form.js +4 -4
  51. package/dist/packages/formitem/FormItem.js +4 -4
  52. package/dist/packages/grid/Grid.js +2 -2
  53. package/dist/packages/griditem/GridItem.js +5 -5
  54. package/dist/packages/image/Image.js +3 -3
  55. package/dist/packages/imagepreview/ImagePreview.js +8 -8
  56. package/dist/packages/{index-s3RgMhc7.js → index-CFigyH92.js} +1 -1
  57. package/dist/packages/{index--uVlasFu.js → index-Do4_KY74.js} +2 -2
  58. package/dist/packages/{index-BqB5dTeo.js → index-uHBD4dfS.js} +2 -2
  59. package/dist/packages/{index.vue_vue_type_script_lang-n0HbjvfF.js → index.vue_vue_type_script_lang-CTQUvlgN.js} +4 -4
  60. package/dist/packages/{index.vue_vue_type_script_lang-54PRh3YM.js → index.vue_vue_type_script_lang-CaSiRl9x.js} +2 -2
  61. package/dist/packages/indicator/Indicator.js +56 -50
  62. package/dist/packages/infiniteloading/InfiniteLoading.js +6 -6
  63. package/dist/packages/input/Input.js +10 -10
  64. package/dist/packages/inputnumber/InputNumber.js +85 -104
  65. package/dist/packages/invoice/Invoice.js +87 -138
  66. package/dist/packages/layout/Layout.js +2 -2
  67. package/dist/packages/list/List.js +3 -3
  68. package/dist/packages/locale/lang/en-US.js +1 -1
  69. package/dist/packages/locale/lang/id-ID.js +1 -1
  70. package/dist/packages/locale/lang/index.js +2 -2
  71. package/dist/packages/locale/lang/zh-CN.js +1 -1
  72. package/dist/packages/locale/lang/zh-TW.js +1 -1
  73. package/dist/packages/menu/Menu.js +5 -5
  74. package/dist/packages/menuitem/MenuItem.js +5 -5
  75. package/dist/packages/{mountComponent-uInXoTMp.js → mountComponent-DBQ88Fjz.js} +1 -1
  76. package/dist/packages/navbar/Navbar.js +103 -115
  77. package/dist/packages/noticebar/Noticebar.js +3 -3
  78. package/dist/packages/notify/Notify.js +3 -3
  79. package/dist/packages/numberkeyboard/NumberKeyboard.js +4 -4
  80. package/dist/packages/overlay/Overlay.js +3 -3
  81. package/dist/packages/pagination/Pagination.js +3 -3
  82. package/dist/packages/picker/Picker.js +7 -10
  83. package/dist/packages/popover/Popover.js +5 -5
  84. package/dist/packages/popup/Popup.js +2 -2
  85. package/dist/packages/price/Price.js +1 -1
  86. package/dist/packages/progress/Progress.js +96 -115
  87. package/dist/packages/pullrefresh/PullRefresh.js +7 -7
  88. package/dist/packages/radio/Radio.js +1 -1
  89. package/dist/packages/radiogroup/RadioGroup.js +1 -1
  90. package/dist/packages/range/Range.js +6 -6
  91. package/dist/packages/rate/Rate.js +102 -144
  92. package/dist/packages/row/Row.js +2 -2
  93. package/dist/packages/searchbar/Searchbar.js +5 -5
  94. package/dist/packages/shortpassword/ShortPassword.js +5 -5
  95. package/dist/packages/sidenavbar/SideNavbar.js +2 -2
  96. package/dist/packages/sidenavbaritem/SideNavbarItem.js +2 -2
  97. package/dist/packages/signature/Signature.js +3 -3
  98. package/dist/packages/skeleton/Skeleton.js +13 -13
  99. package/dist/packages/sku/Sku.js +6 -6
  100. package/dist/packages/space/Space.js +1 -1
  101. package/dist/packages/step/Step.js +3 -3
  102. package/dist/packages/steps/Steps.js +2 -2
  103. package/dist/packages/sticky/Sticky.js +4 -4
  104. package/dist/packages/subsidenavbar/SubSideNavbar.js +2 -2
  105. package/dist/packages/swipe/Swipe.js +98 -112
  106. package/dist/packages/swipegroup/SwipeGroup.js +42 -24
  107. package/dist/packages/swiper/Swiper.js +7 -7
  108. package/dist/packages/swiperitem/SwiperItem.js +3 -3
  109. package/dist/packages/switch/Switch.js +68 -86
  110. package/dist/packages/tabbar/Tabbar.js +78 -78
  111. package/dist/packages/tabbaritem/TabbarItem.js +89 -113
  112. package/dist/packages/table/Table.js +3 -3
  113. package/dist/packages/tabpane/TabPane.js +2 -2
  114. package/dist/packages/tabs/Tabs.js +9 -9
  115. package/dist/packages/tag/Tag.js +57 -66
  116. package/dist/packages/textarea/Textarea.js +113 -127
  117. package/dist/packages/timedetail/TimeDetail.js +2 -2
  118. package/dist/packages/timepannel/TimePannel.js +2 -2
  119. package/dist/packages/timeselect/TimeSelect.js +4 -4
  120. package/dist/packages/toast/Toast.js +6 -6
  121. package/dist/packages/tour/Tour.js +3 -3
  122. package/dist/packages/trendarrow/TrendArrow.js +51 -83
  123. package/dist/packages/uploader/Uploader.js +9 -9
  124. package/dist/packages/{useChildren-GU_NVfD8.js → useChildren-BZ4-J79J.js} +2 -2
  125. package/dist/packages/useParent-D6DiuxZZ.js +21 -0
  126. package/dist/packages/{util-4Jkyw4BJ.js → util-DnfK0Qan.js} +2 -2
  127. package/dist/packages/video/Video.js +16 -16
  128. package/dist/packages/watermark/Watermark.js +2 -2
  129. package/dist/smartips/web-types.json +2 -2
  130. package/dist/styles/base-jdb.css +1 -1
  131. package/dist/styles/base-jddkh.css +1 -1
  132. package/dist/styles/base-jdt.css +1 -1
  133. package/dist/styles/themes/default.scss +0 -1
  134. package/dist/styles/themes/jdb.scss +0 -1
  135. package/dist/styles/themes/jddkh.scss +0 -1
  136. package/dist/styles/themes/jdt.scss +0 -1
  137. package/dist/styles/variables-jdb.scss +0 -1
  138. package/dist/styles/variables-jddkh.scss +0 -1
  139. package/dist/styles/variables-jdt.scss +0 -1
  140. package/dist/styles/variables.scss +0 -1
  141. package/dist/types/__VUE/backtop/backtop.vue.d.ts +87 -0
  142. package/dist/types/__VUE/backtop/index.d.ts +5 -0
  143. package/dist/types/__VUE/calendaritem/index.vue.d.ts +2 -12
  144. package/dist/types/__VUE/circleprogress/circle-progress.vue.d.ts +88 -0
  145. package/dist/types/__VUE/circleprogress/index.d.ts +6 -0
  146. package/dist/types/__VUE/empty/empty.vue.d.ts +62 -0
  147. package/dist/types/__VUE/empty/index.d.ts +6 -0
  148. package/dist/types/__VUE/indicator/index.d.ts +6 -0
  149. package/dist/types/__VUE/indicator/indicator.vue.d.ts +65 -0
  150. package/dist/types/__VUE/inputnumber/index.d.ts +5 -0
  151. package/dist/types/__VUE/inputnumber/input-number.vue.d.ts +112 -0
  152. package/dist/types/__VUE/invoice/index.d.ts +6 -0
  153. package/dist/types/__VUE/invoice/invoice.vue.d.ts +59 -0
  154. package/dist/types/__VUE/invoice/types.d.ts +12 -0
  155. package/dist/types/__VUE/navbar/index.d.ts +5 -0
  156. package/dist/types/__VUE/navbar/navbar.vue.d.ts +125 -0
  157. package/dist/types/__VUE/progress/index.d.ts +6 -0
  158. package/dist/types/__VUE/progress/progress.vue.d.ts +91 -0
  159. package/dist/types/__VUE/rate/index.d.ts +5 -0
  160. package/dist/types/__VUE/rate/rate.vue.d.ts +208 -0
  161. package/dist/types/__VUE/swipe/index.d.ts +6 -0
  162. package/dist/types/__VUE/swipe/swipe.vue.d.ts +79 -0
  163. package/dist/types/__VUE/swipe/types.d.ts +1 -0
  164. package/dist/types/__VUE/swipegroup/index.d.ts +5 -0
  165. package/dist/types/__VUE/swipegroup/swipe-group.vue.d.ts +47 -0
  166. package/dist/types/__VUE/switch/index.d.ts +5 -0
  167. package/dist/types/__VUE/switch/switch.vue.d.ts +109 -0
  168. package/dist/types/__VUE/tabbar/index.d.ts +5 -0
  169. package/dist/types/__VUE/tabbar/tabbar.vue.d.ts +83 -0
  170. package/dist/types/__VUE/tabbaritem/index.d.ts +5 -0
  171. package/dist/types/__VUE/tabbaritem/tabbar-item.vue.d.ts +65 -0
  172. package/dist/types/__VUE/tabs/index.vue.d.ts +12 -12
  173. package/dist/types/__VUE/tag/index.d.ts +6 -0
  174. package/dist/types/__VUE/tag/tag.vue.d.ts +90 -0
  175. package/dist/types/__VUE/tag/types.d.ts +1 -1
  176. package/dist/types/__VUE/textarea/index.d.ts +5 -0
  177. package/dist/types/__VUE/textarea/textarea.vue.d.ts +104 -0
  178. package/dist/types/__VUE/trendarrow/index.d.ts +5 -0
  179. package/dist/types/__VUE/trendarrow/trend-arrow.vue.d.ts +96 -0
  180. package/dist/types/index.d.ts +36 -20
  181. package/dist/types/utils/throttle.d.ts +1 -1
  182. package/dist/types/utils/useRelation/useParent.d.ts +1 -0
  183. package/package.json +1 -1
  184. package/dist/packages/calendaritem/CalendarItem.js +0 -819
  185. package/dist/packages/calendaritem/index.css +0 -0
  186. package/dist/packages/calendaritem/index.mjs +0 -2
  187. package/dist/packages/calendaritem/index.scss +0 -0
  188. package/dist/packages/calendaritem/style/css.mjs +0 -2
  189. package/dist/packages/calendaritem/style/index.mjs +0 -2
  190. package/dist/packages/useParent-KIxqkovs.js +0 -16
  191. package/dist/types/__VUE/backtop/index.vue.d.ts +0 -98
  192. package/dist/types/__VUE/circleprogress/index.vue.d.ts +0 -95
  193. package/dist/types/__VUE/empty/index.vue.d.ts +0 -53
  194. package/dist/types/__VUE/indicator/index.vue.d.ts +0 -69
  195. package/dist/types/__VUE/inputnumber/index.vue.d.ts +0 -117
  196. package/dist/types/__VUE/invoice/index.vue.d.ts +0 -53
  197. package/dist/types/__VUE/navbar/index.vue.d.ts +0 -129
  198. package/dist/types/__VUE/progress/index.vue.d.ts +0 -120
  199. package/dist/types/__VUE/rate/index.vue.d.ts +0 -240
  200. package/dist/types/__VUE/swipe/index.vue.d.ts +0 -70
  201. package/dist/types/__VUE/swipegroup/index.vue.d.ts +0 -26
  202. package/dist/types/__VUE/switch/index.vue.d.ts +0 -118
  203. package/dist/types/__VUE/tabbar/index.vue.d.ts +0 -85
  204. package/dist/types/__VUE/tabbaritem/index.vue.d.ts +0 -60
  205. package/dist/types/__VUE/tag/index.vue.d.ts +0 -94
  206. package/dist/types/__VUE/textarea/index.vue.d.ts +0 -127
  207. package/dist/types/__VUE/trendarrow/index.vue.d.ts +0 -102
  208. /package/dist/packages/{_plugin-vue_export-helper-yVxbj29m.js → _plugin-vue_export-helper-1tPrXgE0.js} +0 -0
  209. /package/dist/packages/{component-TCzwHGVq.js → component-DQf3CENX.js} +0 -0
  210. /package/dist/packages/{index-cp6Ms_Qe.js → index-B1qsj2XR.js} +0 -0
  211. /package/dist/packages/{index-xDfQLRen.js → index-BvmDLUYP.js} +0 -0
  212. /package/dist/packages/{index-084nl_oE.js → index-I8tfW3Kf.js} +0 -0
  213. /package/dist/packages/{index-Ii9XdkPy.js → index-aiGQ-EiA.js} +0 -0
  214. /package/dist/packages/locale/lang/{baseLang-7uiEiO-2.js → baseLang-Bnfy6fTl.js} +0 -0
  215. /package/dist/packages/{pxCheck-OnXlN1NC.js → pxCheck-DN6FYV6q.js} +0 -0
  216. /package/dist/packages/{raf-MQjoO-Ag.js → raf-c01wDYCo.js} +0 -0
  217. /package/dist/packages/{renderIcon--EgZu5_5.js → renderIcon-BfOvhG7i.js} +0 -0
  218. /package/dist/packages/{types-RCVUm7Nb.js → types-1HzUV14W.js} +0 -0
  219. /package/dist/packages/{types-zeKkNDAq.js → types-48N1bMrT.js} +0 -0
  220. /package/dist/packages/{types-Ww4ErYJT.js → types-BKDaJvHp.js} +0 -0
  221. /package/dist/packages/{types-odSRziQJ.js → types-BODurTjN.js} +0 -0
  222. /package/dist/packages/{types-qOrhXtA_.js → types-BWhKcf4T.js} +0 -0
  223. /package/dist/packages/{types-4IflWeQO.js → types-BomhFk3T.js} +0 -0
  224. /package/dist/packages/{types-j71K23JP.js → types-CkPfROfI.js} +0 -0
  225. /package/dist/packages/{types-9wCQwtH3.js → types-DUkJysbi.js} +0 -0
  226. /package/dist/packages/{types-Cq2YypZn.js → types-MuhxzCWc.js} +0 -0
  227. /package/dist/packages/{with-install-p59gYYU_.js → with-install-Ch3FF0uS.js} +0 -0
@@ -1,96 +1,96 @@
1
- import { toRefs, ref, reactive, provide, watch, onMounted, nextTick, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot } from "vue";
2
- import { c as createComponent } from "../component-TCzwHGVq.js";
3
- import { T as TABBAR_KEY } from "../types-Cq2YypZn.js";
4
- import { _ as _export_sfc } from "../_plugin-vue_export-helper-yVxbj29m.js";
5
- const { create } = createComponent("tabbar");
6
- const _sfc_main = create({
7
- props: {
8
- modelValue: {
9
- type: [Number, String],
10
- default: 0
11
- },
12
- bottom: {
13
- type: Boolean,
14
- default: false
15
- },
16
- type: {
17
- type: String,
18
- default: "base"
19
- },
20
- unactiveColor: {
21
- type: String,
22
- default: ""
23
- },
24
- activeColor: {
25
- type: String,
26
- default: ""
27
- },
28
- safeAreaInsetBottom: {
29
- type: Boolean,
30
- default: false
31
- },
32
- placeholder: {
33
- type: Boolean,
34
- default: false
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]);
35
16
  }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ import { defineComponent, ref, computed, watch, onMounted, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot, nextTick } from "vue";
21
+ import { u as useChildren } from "../useChildren-BZ4-J79J.js";
22
+ import { T as TABBAR_KEY } from "../types-MuhxzCWc.js";
23
+ import { w as withInstall } from "../with-install-Ch3FF0uS.js";
24
+ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
25
+ name: "NutTabbar"
26
+ }), {
27
+ __name: "tabbar",
28
+ props: {
29
+ modelValue: { default: 0 },
30
+ bottom: { type: Boolean, default: false },
31
+ unactiveColor: { default: "" },
32
+ activeColor: { default: "" },
33
+ safeAreaInsetBottom: { type: Boolean, default: false },
34
+ placeholder: { type: Boolean, default: false }
36
35
  },
37
36
  emits: ["tabSwitch", "update:modelValue"],
38
- setup(props, { emit }) {
39
- const { bottom, placeholder } = toRefs(props);
37
+ setup(__props, { emit: __emit }) {
38
+ const props = __props;
39
+ const emit = __emit;
40
40
  const height = ref();
41
- const mdValue = reactive({
42
- val: props.modelValue,
43
- children: []
44
- });
45
41
  const nutTabbar = ref(null);
46
- function changeIndex(index2, active) {
47
- emit("update:modelValue", active);
48
- parentData.modelValue = active;
49
- emit("tabSwitch", parentData.children[index2], active);
50
- }
51
- const parentData = reactive({
52
- children: mdValue.children,
53
- modelValue: mdValue.val,
54
- unactiveColor: props.unactiveColor,
55
- activeColor: props.activeColor,
56
- changeIndex
42
+ const activeIndex = ref(props.modelValue);
43
+ const classes = computed(() => {
44
+ const prefixCls = "nut-tabbar";
45
+ return {
46
+ [prefixCls]: true,
47
+ "nut-tabbar-bottom": props.bottom,
48
+ "nut-tabbar-safebottom": props.safeAreaInsetBottom
49
+ };
57
50
  });
58
- provide(TABBAR_KEY, parentData);
51
+ const { children, linkChildren } = useChildren(TABBAR_KEY);
52
+ const changeIndex = (index, active) => {
53
+ activeIndex.value = active;
54
+ emit("update:modelValue", active);
55
+ emit("tabSwitch", children[index], active);
56
+ };
57
+ linkChildren({ props, activeIndex, changeIndex });
59
58
  watch(
60
59
  () => props.modelValue,
61
- (value) => {
62
- parentData.modelValue = value;
60
+ (val) => {
61
+ activeIndex.value = val;
63
62
  }
64
63
  );
65
- onMounted(() => {
66
- if (bottom.value && placeholder.value) {
64
+ const updateHeight = () => {
65
+ if (props.bottom && props.placeholder) {
67
66
  nextTick(() => {
68
67
  var _a;
69
- height.value = (_a = nutTabbar == null ? void 0 : nutTabbar.value) == null ? void 0 : _a.getBoundingClientRect().height;
68
+ const nutTabbarHeight = (_a = nutTabbar.value) == null ? void 0 : _a.getBoundingClientRect().height;
69
+ if (nutTabbarHeight) {
70
+ height.value = nutTabbarHeight;
71
+ }
70
72
  });
71
73
  }
72
- });
73
- return {
74
- changeIndex,
75
- nutTabbar,
76
- height
74
+ };
75
+ onMounted(updateHeight);
76
+ return (_ctx, _cache) => {
77
+ return openBlock(), createElementBlock("div", {
78
+ class: normalizeClass({ "nut-tabbar__placeholder": _ctx.bottom && _ctx.placeholder }),
79
+ style: normalizeStyle({ height: height.value + "px" })
80
+ }, [
81
+ createElementVNode("view", {
82
+ ref_key: "nutTabbar",
83
+ ref: nutTabbar,
84
+ class: normalizeClass(classes.value)
85
+ }, [
86
+ renderSlot(_ctx.$slots, "default")
87
+ ], 2)
88
+ ], 6);
77
89
  };
78
90
  }
79
- });
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" })
84
- }, [
85
- createElementVNode("view", {
86
- ref: "nutTabbar",
87
- class: normalizeClass(["nut-tabbar", { "nut-tabbar-bottom": _ctx.bottom, "nut-tabbar-safebottom": _ctx.safeAreaInsetBottom }])
88
- }, [
89
- renderSlot(_ctx.$slots, "default")
90
- ], 2)
91
- ], 6);
92
- }
93
- const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
91
+ }));
92
+ withInstall(_sfc_main);
94
93
  export {
95
- index as default
94
+ _sfc_main as Tabbar,
95
+ _sfc_main as default
96
96
  };
@@ -1,131 +1,107 @@
1
- import { c as createComponent } from "../component-TCzwHGVq.js";
2
- import { r as renderIcon } from "../renderIcon--EgZu5_5.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-Ii9XdkPy.js";
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 { defineComponent, computed, openBlock, createElementBlock, normalizeClass, normalizeStyle, createVNode, normalizeProps, guardReactiveProps, withCtx, createElementVNode, renderSlot, createCommentVNode, createBlock, resolveDynamicComponent, unref, toDisplayString } from "vue";
21
+ import { r as renderIcon } from "../renderIcon-BfOvhG7i.js";
22
+ import { u as useRouter } from "../index-aiGQ-EiA.js";
23
+ import { u as useParent } from "../useParent-D6DiuxZZ.js";
24
+ import { T as TABBAR_KEY } from "../types-MuhxzCWc.js";
5
25
  import NutBadge from "../badge/Badge.js";
6
- import { T as TABBAR_KEY } from "../types-Cq2YypZn.js";
7
- import { _ as _export_sfc } from "../_plugin-vue_export-helper-yVxbj29m.js";
8
- const { create } = createComponent("tabbar-item");
9
- const _sfc_main = create({
10
- components: { NutBadge },
26
+ import { w as withInstall } from "../with-install-Ch3FF0uS.js";
27
+ const _hoisted_1 = { class: "nut-tabbar-item_icon-box" };
28
+ const _hoisted_2 = {
29
+ key: 0,
30
+ class: "nut-tabbar-item_icon-box_icon"
31
+ };
32
+ const _hoisted_3 = { key: 1 };
33
+ const _hoisted_4 = { key: 0 };
34
+ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
35
+ name: "NutTabbarItem"
36
+ }), {
37
+ __name: "tabbar-item",
11
38
  props: {
12
- tabTitle: {
13
- // 标签页的标题
14
- type: String,
15
- default: ""
16
- },
17
- name: {
18
- type: String
19
- },
20
- icon: {
21
- // 标签页显示的icon
22
- type: Object
23
- },
24
- href: {
25
- // 标签页的跳转链接
26
- type: String,
27
- default: ""
28
- },
29
- to: [Object, String]
39
+ tabTitle: { default: "" },
40
+ name: {},
41
+ icon: {},
42
+ href: { default: "" },
43
+ to: {}
30
44
  },
31
- setup(props, { slots }) {
32
- const isHaveSlot = (slot) => {
33
- return slots[slot];
34
- };
35
- const parent = inject(TABBAR_KEY);
36
- const state = reactive({
37
- unactiveColor: parent.unactiveColor,
38
- // 未选中的颜色
39
- activeColor: parent.activeColor,
40
- // 选中的颜色
41
- index: 0
42
- });
45
+ setup(__props) {
46
+ const props = __props;
43
47
  const router = useRouter();
44
- const relation = (child) => {
48
+ const { parent, index } = useParent(TABBAR_KEY);
49
+ const active = computed(() => {
45
50
  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() {
51
+ return ((_a = props.name) != null ? _a : index.value) === parent.activeIndex.value;
52
+ });
53
+ const activeColor = computed(() => active.value ? parent.props.activeColor : parent.props.unactiveColor);
54
+ const change = () => {
55
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
- });
62
- }
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;
56
+ const key = (_a = props.name) != null ? _a : index.value;
57
+ parent.changeIndex(index.value, key);
58
+ if ((_b = parent.children[index.value]) == null ? void 0 : _b.href) {
59
+ window.location.href = parent.children[index.value].href;
67
60
  return;
68
61
  }
69
- if ((_c = parent.children[index2]) == null ? void 0 : _c.to) {
70
- let to = parent.children[index2].to;
62
+ if ((_c = parent.children[index.value]) == null ? void 0 : _c.to) {
63
+ const to = parent.children[index.value].to;
71
64
  if (to && router) {
72
65
  router.push(to);
73
66
  } else {
74
67
  location.replace(to);
75
68
  }
76
69
  }
77
- }
78
- return {
79
- state,
80
- active,
81
- renderIcon,
82
- isHaveSlot,
83
- change
84
70
  };
85
- }
86
- });
87
- const _hoisted_1 = { class: "nut-tabbar-item_icon-box" };
88
- const _hoisted_2 = {
89
- key: 0,
90
- 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
100
- }),
101
- onClick: _cache[0] || (_cache[0] = ($event) => _ctx.change())
102
- }, [
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([
114
- "nut-tabbar-item_icon-box_nav-word",
115
- { "nut-tabbar-item_icon-box_big-word": !_ctx.icon && !_ctx.isHaveSlot("icon") }
71
+ return (_ctx, _cache) => {
72
+ return openBlock(), createElementBlock("div", {
73
+ class: normalizeClass(["nut-tabbar-item", { "nut-tabbar-item__icon--unactive": !active.value }]),
74
+ style: normalizeStyle({
75
+ color: activeColor.value
76
+ }),
77
+ onClick: change
78
+ }, [
79
+ createVNode(NutBadge, normalizeProps(guardReactiveProps(_ctx.$attrs)), {
80
+ default: withCtx(() => [
81
+ createElementVNode("view", _hoisted_1, [
82
+ _ctx.$slots.icon ? (openBlock(), createElementBlock("div", _hoisted_2, [
83
+ renderSlot(_ctx.$slots, "icon", { active: active.value })
84
+ ])) : createCommentVNode("", true),
85
+ _ctx.icon && !_ctx.$slots.icon ? (openBlock(), createElementBlock("view", _hoisted_3, [
86
+ (openBlock(), createBlock(resolveDynamicComponent(unref(renderIcon)(_ctx.icon)), { class: "nut-popover-item-img" }))
87
+ ])) : createCommentVNode("", true),
88
+ createElementVNode("view", {
89
+ class: normalizeClass(["nut-tabbar-item_icon-box_nav-word", { "nut-tabbar-item_icon-box_big-word": !_ctx.icon && !_ctx.$slots.icon }])
90
+ }, [
91
+ renderSlot(_ctx.$slots, "default", {}, () => [
92
+ _ctx.tabTitle ? (openBlock(), createElementBlock("view", _hoisted_4, toDisplayString(_ctx.tabTitle), 1)) : createCommentVNode("", true)
93
+ ])
94
+ ], 2)
116
95
  ])
117
- }, [
118
- renderSlot(_ctx.$slots, "default", {}, () => [
119
- _ctx.tabTitle ? (openBlock(), createElementBlock("view", _hoisted_4, toDisplayString(_ctx.tabTitle), 1)) : createCommentVNode("", true)
120
- ])
121
- ], 2)
122
- ])
123
- ]),
124
- _: 3
125
- }, 16)
126
- ], 6);
127
- }
128
- const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
96
+ ]),
97
+ _: 3
98
+ }, 16)
99
+ ], 6);
100
+ };
101
+ }
102
+ }));
103
+ withInstall(_sfc_main);
129
104
  export {
130
- index as default
105
+ _sfc_main as TabbarItem,
106
+ _sfc_main as default
131
107
  };
@@ -18,10 +18,10 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  import { defineComponent, h, reactive, watch, toRefs, resolveComponent, openBlock, createElementBlock, createElementVNode, normalizeClass, Fragment, renderList, normalizeStyle, createTextVNode, toDisplayString, renderSlot, createBlock, createCommentVNode } from "vue";
21
- import { c as createComponent } from "../component-TCzwHGVq.js";
21
+ import { c as createComponent } from "../component-DQf3CENX.js";
22
22
  import { DownArrow } from "@nutui/icons-vue";
23
- import { u as useLocale } from "../index-s3RgMhc7.js";
24
- import { _ as _export_sfc } from "../_plugin-vue_export-helper-yVxbj29m.js";
23
+ import { u as useLocale } from "../index-CFigyH92.js";
24
+ import { _ as _export_sfc } from "../_plugin-vue_export-helper-1tPrXgE0.js";
25
25
  const RenderColumn = defineComponent({
26
26
  props: {
27
27
  slots: {
@@ -18,8 +18,8 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  import { inject, computed, openBlock, createElementBlock, normalizeClass, normalizeStyle, renderSlot } from "vue";
21
- import { c as createComponent } from "../component-TCzwHGVq.js";
22
- import { _ as _export_sfc } from "../_plugin-vue_export-helper-yVxbj29m.js";
21
+ import { c as createComponent } from "../component-DQf3CENX.js";
22
+ import { _ as _export_sfc } from "../_plugin-vue_export-helper-1tPrXgE0.js";
23
23
  const { create } = createComponent("tab-pane");
24
24
  const _sfc_main = create({
25
25
  props: {
@@ -41,13 +41,13 @@ var __async = (__this, __arguments, generator) => {
41
41
  import { ref, onMounted, reactive, provide, computed, watch, onActivated, nextTick, resolveComponent, openBlock, createElementBlock, normalizeClass, createBlock, withCtx, createElementVNode, normalizeStyle, renderSlot, Fragment, renderList, createCommentVNode, createVNode, toDisplayString } from "vue";
42
42
  import NutSticky from "../sticky/Sticky.js";
43
43
  import { JoySmile } from "@nutui/icons-vue";
44
- import { c as createComponent } from "../component-TCzwHGVq.js";
45
- import { T as TypeOfFun } from "../util-4Jkyw4BJ.js";
46
- import { p as pxCheck } from "../pxCheck-OnXlN1NC.js";
47
- import { u as useRect } from "../index-cp6Ms_Qe.js";
48
- import { r as requestAniFrame } from "../raf-MQjoO-Ag.js";
49
- import { u as useTouch } from "../index-084nl_oE.js";
50
- import { _ as _export_sfc } from "../_plugin-vue_export-helper-yVxbj29m.js";
44
+ import { c as createComponent } from "../component-DQf3CENX.js";
45
+ import { T as TypeOfFun } from "../util-DnfK0Qan.js";
46
+ import { p as pxCheck } from "../pxCheck-DN6FYV6q.js";
47
+ import { u as useRect } from "../index-B1qsj2XR.js";
48
+ import { r as requestAniFrame } from "../raf-c01wDYCo.js";
49
+ import { u as useTouch } from "../index-I8tfW3Kf.js";
50
+ import { _ as _export_sfc } from "../_plugin-vue_export-helper-1tPrXgE0.js";
51
51
  const useTabContentTouch = (props, tabMethods, taro, useTaroRect) => {
52
52
  const tabsContentRef = ref();
53
53
  const tabsContentRefRect = ref({ width: 0, height: 0 });
@@ -433,9 +433,9 @@ const _sfc_main = create({
433
433
  return {};
434
434
  const px = pxCheck(props.titleGutter);
435
435
  if (props.direction === "vertical") {
436
- return { marginTop: px, marginBottom: px };
436
+ return { paddingTop: px, paddingBottom: px };
437
437
  }
438
- return { marginLeft: px, marginRight: px };
438
+ return { paddingLeft: px, paddingRight: px };
439
439
  });
440
440
  return __spreadValues(__spreadValues({
441
441
  navRef,
@@ -1,44 +1,42 @@
1
- import { computed, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, renderSlot, createBlock, createCommentVNode } from "vue";
2
- import { c as createComponent } from "../component-TCzwHGVq.js";
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 { defineComponent, computed, openBlock, createElementBlock, normalizeClass, normalizeStyle, renderSlot, createBlock, unref, withModifiers, createCommentVNode } from "vue";
3
21
  import { Close } from "@nutui/icons-vue";
4
- import { _ as _export_sfc } from "../_plugin-vue_export-helper-yVxbj29m.js";
5
- const { create } = createComponent("tag");
6
- const _sfc_main = create({
22
+ import { w as withInstall } from "../with-install-Ch3FF0uS.js";
23
+ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
24
+ name: "NutTag"
25
+ }), {
26
+ __name: "tag",
7
27
  props: {
8
- color: {
9
- type: String,
10
- default: ""
11
- },
12
- textColor: {
13
- type: String,
14
- default: ""
15
- },
16
- type: {
17
- type: String,
18
- default: "default"
19
- },
20
- plain: {
21
- type: Boolean,
22
- default: false
23
- },
24
- round: {
25
- type: Boolean,
26
- default: false
27
- },
28
- mark: {
29
- type: Boolean,
30
- default: false
31
- },
32
- closeable: {
33
- type: Boolean,
34
- default: false
35
- }
36
- },
37
- components: {
38
- Close
28
+ color: { default: "" },
29
+ textColor: { default: "" },
30
+ type: { default: "default" },
31
+ plain: { type: Boolean, default: false },
32
+ round: { type: Boolean, default: false },
33
+ mark: { type: Boolean, default: false },
34
+ closeable: { type: Boolean, default: false }
39
35
  },
40
36
  emits: ["close", "click"],
41
- setup(props, { emit }) {
37
+ setup(__props, { emit: __emit }) {
38
+ const props = __props;
39
+ const emits = __emit;
42
40
  const classes = computed(() => {
43
41
  const prefixCls = "nut-tag";
44
42
  return {
@@ -58,45 +56,38 @@ const _sfc_main = create({
58
56
  }
59
57
  if (props.plain) {
60
58
  style2.background = "#fff";
61
- style2["border-color"] = props.color;
59
+ style2.borderColor = props.color;
62
60
  } else if (props.color) {
63
61
  style2.background = props.color;
64
62
  }
65
63
  return style2;
66
64
  });
67
65
  const onClose = (event) => {
68
- event.stopPropagation();
69
- emit("close", event);
66
+ emits("close", event);
70
67
  };
71
68
  const onClick = (event) => {
72
- emit("click", event);
69
+ emits("click", event);
73
70
  };
74
- return {
75
- classes,
76
- style,
77
- onClose,
78
- onClick
71
+ return (_ctx, _cache) => {
72
+ return openBlock(), createElementBlock("view", {
73
+ class: normalizeClass(classes.value),
74
+ style: normalizeStyle(style.value),
75
+ onClick
76
+ }, [
77
+ renderSlot(_ctx.$slots, "default"),
78
+ _ctx.closeable ? (openBlock(), createBlock(unref(Close), {
79
+ key: 0,
80
+ class: "nut-tag--close",
81
+ width: "12px",
82
+ height: "12px",
83
+ onClick: withModifiers(onClose, ["stop"])
84
+ })) : createCommentVNode("", true)
85
+ ], 6);
79
86
  };
80
87
  }
81
- });
82
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
83
- const _component_Close = resolveComponent("Close");
84
- return openBlock(), createElementBlock("view", {
85
- class: normalizeClass(_ctx.classes),
86
- style: normalizeStyle(_ctx.style),
87
- onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClick && _ctx.onClick(...args))
88
- }, [
89
- renderSlot(_ctx.$slots, "default"),
90
- _ctx.closeable ? (openBlock(), createBlock(_component_Close, {
91
- key: 0,
92
- class: "nut-tag--close",
93
- width: "12px",
94
- height: "12px",
95
- onClick: _ctx.onClose
96
- }, null, 8, ["onClick"])) : createCommentVNode("", true)
97
- ], 6);
98
- }
99
- const NutTag = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
88
+ }));
89
+ withInstall(_sfc_main);
100
90
  export {
101
- NutTag as default
91
+ _sfc_main as Tag,
92
+ _sfc_main as default
102
93
  };