@nutui/nutui 4.0.1 → 4.0.3-beta.1

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 (143) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/nutui.es.js +1 -1
  3. package/dist/nutui.umd.js +2 -2
  4. package/dist/packages/_es/ActionSheet.js +2 -2
  5. package/dist/packages/_es/Address.js +27 -5
  6. package/dist/packages/_es/AddressList.js +1 -1
  7. package/dist/packages/_es/Animate.js +1 -1
  8. package/dist/packages/_es/Audio.js +1 -1
  9. package/dist/packages/_es/AudioOperate.js +1 -1
  10. package/dist/packages/_es/Avatar.js +1 -1
  11. package/dist/packages/_es/AvatarGroup.js +1 -1
  12. package/dist/packages/_es/Backtop.js +1 -1
  13. package/dist/packages/_es/Badge.js +1 -1
  14. package/dist/packages/_es/Barrage.js +4 -4
  15. package/dist/packages/_es/Button.js +1 -1
  16. package/dist/packages/_es/Calendar.js +3 -3
  17. package/dist/packages/_es/CalendarItem.js +2 -2
  18. package/dist/packages/_es/Card.js +1 -1
  19. package/dist/packages/_es/Cascader.js +4 -3
  20. package/dist/packages/_es/Category.js +1 -1
  21. package/dist/packages/_es/CategoryPane.js +1 -1
  22. package/dist/packages/_es/Cell.js +1 -1
  23. package/dist/packages/_es/CellGroup.js +1 -1
  24. package/dist/packages/_es/Checkbox.js +1 -1
  25. package/dist/packages/_es/CheckboxGroup.js +1 -1
  26. package/dist/packages/_es/CircleProgress.js +1 -1
  27. package/dist/packages/_es/Col.js +1 -1
  28. package/dist/packages/_es/Collapse.js +1 -1
  29. package/dist/packages/_es/CollapseItem.js +1 -1
  30. package/dist/packages/_es/Comment.js +1 -1
  31. package/dist/packages/_es/ConfigProvider.js +2 -34
  32. package/dist/packages/_es/Countdown.js +1 -1
  33. package/dist/packages/_es/Countup.js +1 -1
  34. package/dist/packages/_es/DatePicker.js +1 -1
  35. package/dist/packages/_es/Dialog.js +4 -4
  36. package/dist/packages/_es/Divider.js +1 -1
  37. package/dist/packages/_es/Drag.js +1 -1
  38. package/dist/packages/_es/Ecard.js +1 -1
  39. package/dist/packages/_es/Elevator.js +1 -1
  40. package/dist/packages/_es/Ellipsis.js +1 -1
  41. package/dist/packages/_es/Empty.js +1 -1
  42. package/dist/packages/_es/FixedNav.js +1 -1
  43. package/dist/packages/_es/Form.js +2 -2
  44. package/dist/packages/_es/FormItem.js +1 -1
  45. package/dist/packages/_es/Grid.js +2 -2
  46. package/dist/packages/_es/GridItem.js +2 -2
  47. package/dist/packages/_es/Image.js +1 -1
  48. package/dist/packages/_es/ImagePreview.js +4 -5
  49. package/dist/packages/_es/Indicator.js +1 -1
  50. package/dist/packages/_es/InfiniteLoading.js +1 -1
  51. package/dist/packages/_es/Input.js +16 -8
  52. package/dist/packages/_es/InputNumber.js +1 -1
  53. package/dist/packages/_es/Invoice.js +3 -3
  54. package/dist/packages/_es/Layout.js +1 -1
  55. package/dist/packages/_es/List.js +165 -27
  56. package/dist/packages/_es/Menu.js +1 -1
  57. package/dist/packages/_es/MenuItem.js +2 -2
  58. package/dist/packages/_es/Navbar.js +1 -1
  59. package/dist/packages/_es/Noticebar.js +5 -4
  60. package/dist/packages/_es/Notify.js +2 -2
  61. package/dist/packages/_es/NumberKeyboard.js +2 -2
  62. package/dist/packages/_es/Overlay.js +2 -2
  63. package/dist/packages/_es/Pagination.js +1 -1
  64. package/dist/packages/_es/Picker.js +1 -1
  65. package/dist/packages/_es/Popover.js +2 -2
  66. package/dist/packages/_es/Popup.js +2 -2
  67. package/dist/packages/_es/Price.js +7 -2
  68. package/dist/packages/_es/Progress.js +1 -1
  69. package/dist/packages/_es/PullRefresh.js +1 -2
  70. package/dist/packages/_es/Radio.js +2 -2
  71. package/dist/packages/_es/RadioGroup.js +2 -2
  72. package/dist/packages/_es/Range.js +1 -1
  73. package/dist/packages/_es/Rate.js +1 -1
  74. package/dist/packages/_es/Row.js +1 -1
  75. package/dist/packages/_es/Searchbar.js +1 -1
  76. package/dist/packages/_es/ShortPassword.js +2 -2
  77. package/dist/packages/_es/SideNavbar.js +1 -1
  78. package/dist/packages/_es/SideNavbarItem.js +1 -1
  79. package/dist/packages/_es/Signature.js +1 -2
  80. package/dist/packages/_es/Skeleton.js +1 -1
  81. package/dist/packages/_es/Sku.js +2 -2
  82. package/dist/packages/_es/Step.js +1 -1
  83. package/dist/packages/_es/Steps.js +1 -1
  84. package/dist/packages/_es/Sticky.js +2 -2
  85. package/dist/packages/_es/SubSideNavbar.js +1 -1
  86. package/dist/packages/_es/Swipe.js +1 -1
  87. package/dist/packages/_es/Swiper.js +1 -1
  88. package/dist/packages/_es/SwiperItem.js +1 -1
  89. package/dist/packages/_es/Switch.js +1 -1
  90. package/dist/packages/_es/TabPane.js +13 -8
  91. package/dist/packages/_es/Tabbar.js +1 -1
  92. package/dist/packages/_es/TabbarItem.js +1 -1
  93. package/dist/packages/_es/Table.js +1 -1
  94. package/dist/packages/_es/Tabs.js +169 -26
  95. package/dist/packages/_es/Tag.js +1 -1
  96. package/dist/packages/_es/Textarea.js +1 -1
  97. package/dist/packages/_es/TimeDetail.js +1 -1
  98. package/dist/packages/_es/TimePannel.js +1 -1
  99. package/dist/packages/_es/TimeSelect.js +2 -2
  100. package/dist/packages/_es/Toast.js +2 -2
  101. package/dist/packages/_es/Tour.js +2 -2
  102. package/dist/packages/_es/TrendArrow.js +1 -1
  103. package/dist/packages/_es/Uploader.js +2 -2
  104. package/dist/packages/_es/Video.js +1 -1
  105. package/dist/packages/_es/Watermark.js +1 -1
  106. package/dist/packages/_es/{common-0c815463.js → common-b9a5e726.js} +1 -1
  107. package/dist/packages/_es/{component-bb5ff48e.js → component-81a4c1d0.js} +6 -6
  108. package/dist/packages/_es/{index-a564e25f.js → index-c55ad69e.js} +2 -2
  109. package/dist/packages/_es/{index-0432a798.js → index-cb5fe1dc.js} +1 -1
  110. package/dist/packages/_es/{index.vue_vue_type_script_lang-0725f0ae.js → index.vue_vue_type_script_lang-22dfc112.js} +1 -1
  111. package/dist/packages/_es/{index.vue_vue_type_script_lang-9c679f64.js → index.vue_vue_type_script_lang-442e4704.js} +1 -1
  112. package/dist/packages/_es/{index.vue_vue_type_script_lang-8f90bbd8.js → index.vue_vue_type_script_lang-cc5c4086.js} +1 -1
  113. package/dist/packages/_es/{interceptor-648bf3d0.js → interceptor-956b24fc.js} +1 -1
  114. package/dist/packages/_es/{mountComponent-3865592f.js → mountComponent-1ece4110.js} +1 -1
  115. package/dist/packages/address/index.scss +1 -1
  116. package/dist/packages/input/index.scss +7 -5
  117. package/dist/packages/list/index.scss +8 -8
  118. package/dist/packages/menuitem/index.scss +1 -1
  119. package/dist/packages/navbar/index.scss +0 -1
  120. package/dist/packages/noticebar/index.scss +8 -2
  121. package/dist/packages/price/index.scss +5 -10
  122. package/dist/packages/shortpassword/index.scss +16 -0
  123. package/dist/smartips/web-types.json +62 -26
  124. package/dist/style.css +1 -1
  125. package/dist/styles/themes/default.scss +46 -46
  126. package/dist/styles/themes/jdb.scss +46 -46
  127. package/dist/styles/themes/jddkh.scss +46 -46
  128. package/dist/styles/themes/jdt.scss +46 -46
  129. package/dist/types/__VUE/address/index.vue.d.ts +1 -0
  130. package/dist/types/__VUE/configprovider/index.vue.d.ts +4 -4
  131. package/dist/types/__VUE/grid/index.vue.d.ts +1 -1
  132. package/dist/types/__VUE/input/index.vue.d.ts +12 -1
  133. package/dist/types/__VUE/list/index.vue.d.ts +42 -13
  134. package/dist/types/__VUE/list/type.d.ts +13 -0
  135. package/dist/types/__VUE/noticebar/index.vue.d.ts +4 -2
  136. package/dist/types/__VUE/price/index.vue.d.ts +9 -0
  137. package/dist/types/__VUE/tabpane/index.vue.d.ts +1 -4
  138. package/dist/types/__VUE/tabs/hooks.d.ts +12 -0
  139. package/dist/types/__VUE/tabs/index.vue.d.ts +20 -5
  140. package/dist/types/__VUE/uploader/type.d.ts +2 -1
  141. package/dist/types/index.d.ts +1 -1
  142. package/dist/types/utils/useTaroRect/index.d.ts +1 -1
  143. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { c as createComponent } from "./component-bb5ff48e.js";
1
+ import { c as createComponent } from "./component-81a4c1d0.js";
2
2
  import { toRefs, computed, resolveComponent, openBlock, createElementBlock, renderSlot, createCommentVNode, createElementVNode, createBlock, normalizeClass, normalizeStyle, Fragment, renderList } from "vue";
3
3
  import Avatar from "./Avatar.js";
4
4
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
@@ -1,9 +1,9 @@
1
1
  import { resolveComponent, openBlock, createElementBlock, createElementVNode, renderSlot, createBlock, createCommentVNode, toDisplayString, ref, watch, onMounted, Fragment, renderList, normalizeClass, createVNode, withCtx, createSlots } from "vue";
2
2
  import Price from "./Price.js";
3
- import { c as createComponent, T as TypeOfFun } from "./component-bb5ff48e.js";
3
+ import { c as createComponent, T as TypeOfFun } from "./component-81a4c1d0.js";
4
4
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
5
5
  import InputNumber from "./InputNumber.js";
6
- import { p as popupProps, P as Popup } from "./index-a564e25f.js";
6
+ import { p as popupProps, P as Popup } from "./index-c55ad69e.js";
7
7
  import "../locale/lang";
8
8
  import "./pxCheck-c6b9f6b7.js";
9
9
  import "@nutui/icons-vue";
@@ -1,5 +1,5 @@
1
1
  import { getCurrentInstance, inject, reactive, computed, toRefs, openBlock, createElementBlock, normalizeClass, createElementVNode, renderSlot, Fragment, toDisplayString, createCommentVNode } from "vue";
2
- import { c as createComponent } from "./component-bb5ff48e.js";
2
+ import { c as createComponent } from "./component-81a4c1d0.js";
3
3
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
4
4
  import "../locale/lang";
5
5
  const { create, componentName } = createComponent("step");
@@ -1,5 +1,5 @@
1
1
  import { reactive, computed, provide, h } from "vue";
2
- import { c as createComponent } from "./component-bb5ff48e.js";
2
+ import { c as createComponent } from "./component-81a4c1d0.js";
3
3
  import "../locale/lang";
4
4
  const { create, componentName } = createComponent("steps");
5
5
  const _sfc_main = create({
@@ -1,6 +1,6 @@
1
- import { _ as _sfc_main } from "./index.vue_vue_type_script_lang-8f90bbd8.js";
1
+ import { _ as _sfc_main } from "./index.vue_vue_type_script_lang-cc5c4086.js";
2
2
  import "vue";
3
- import "./component-bb5ff48e.js";
3
+ import "./component-81a4c1d0.js";
4
4
  import "../locale/lang";
5
5
  import "./index-29892cda.js";
6
6
  export {
@@ -1,5 +1,5 @@
1
1
  import { reactive, computed, onMounted, toRefs, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, withModifiers, toDisplayString, createBlock, withDirectives, normalizeStyle, renderSlot, vShow } from "vue";
2
- import { c as createComponent } from "./component-bb5ff48e.js";
2
+ import { c as createComponent } from "./component-81a4c1d0.js";
3
3
  import { ArrowDown2, ArrowUp2 } from "@nutui/icons-vue";
4
4
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
5
5
  import "../locale/lang";
@@ -1,6 +1,6 @@
1
1
  import { u as useTouch } from "./index-7a7385e4.js";
2
2
  import { computed, ref, reactive, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot } from "vue";
3
- import { c as createComponent } from "./component-bb5ff48e.js";
3
+ import { c as createComponent } from "./component-81a4c1d0.js";
4
4
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
5
5
  import "../locale/lang";
6
6
  const { componentName, create } = createComponent("swipe");
@@ -1,5 +1,5 @@
1
1
  import { ref, reactive, computed, provide, onDeactivated, onBeforeUnmount, watch, nextTick, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, renderSlot, Fragment, renderList, createCommentVNode } from "vue";
2
- import { c as createComponent, f as clamp } from "./component-bb5ff48e.js";
2
+ import { c as createComponent, e as clamp } from "./component-81a4c1d0.js";
3
3
  import { u as useTouch } from "./index-7a7385e4.js";
4
4
  import { u as useExpose } from "./index-79c5dc33.js";
5
5
  import { r as requestAniFrame } from "./raf-729dad54.js";
@@ -1,5 +1,5 @@
1
1
  import { inject, getCurrentInstance, reactive, computed, onUnmounted, openBlock, createElementBlock, normalizeClass, normalizeStyle, renderSlot } from "vue";
2
- import { c as createComponent } from "./component-bb5ff48e.js";
2
+ import { c as createComponent } from "./component-81a4c1d0.js";
3
3
  import { u as useExpose } from "./index-79c5dc33.js";
4
4
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
5
5
  import "../locale/lang";
@@ -1,5 +1,5 @@
1
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-bb5ff48e.js";
2
+ import { c as createComponent } from "./component-81a4c1d0.js";
3
3
  import { Loading1 } from "@nutui/icons-vue";
4
4
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
5
5
  import "../locale/lang";
@@ -1,5 +1,5 @@
1
- import { inject, openBlock, createElementBlock, normalizeClass, renderSlot } from "vue";
2
- import { c as createComponent } from "./component-bb5ff48e.js";
1
+ import { inject, computed, openBlock, createElementBlock, normalizeClass, normalizeStyle, renderSlot } from "vue";
2
+ import { c as createComponent } from "./component-81a4c1d0.js";
3
3
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
4
4
  import "../locale/lang";
5
5
  const { create } = createComponent("tab-pane");
@@ -20,20 +20,25 @@ const _sfc_main = create({
20
20
  },
21
21
  emits: ["click"],
22
22
  setup(props, { emit }) {
23
- const parent = inject("activeKey");
24
- const parentOption = inject("autoHeight");
23
+ const parentOption = inject("tabsOpiton");
24
+ const paneStyle = computed(() => {
25
+ return {
26
+ display: parentOption.animatedTime.value == 0 && props.paneKey != parentOption.activeKey.value ? "none" : void 0
27
+ };
28
+ });
25
29
  return {
26
- activeKey: parent.activeKey,
27
- autoHeight: parentOption.autoHeight
30
+ ...parentOption,
31
+ paneStyle
28
32
  };
29
33
  }
30
34
  });
31
35
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
32
36
  return openBlock(), createElementBlock("view", {
33
- class: normalizeClass(["nut-tab-pane", { inactive: _ctx.paneKey != _ctx.activeKey && _ctx.autoHeight }])
37
+ class: normalizeClass(["nut-tab-pane", { inactive: _ctx.paneKey != _ctx.activeKey && _ctx.autoHeight }]),
38
+ style: normalizeStyle(_ctx.paneStyle)
34
39
  }, [
35
40
  renderSlot(_ctx.$slots, "default")
36
- ], 2);
41
+ ], 6);
37
42
  }
38
43
  const TabPane = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
39
44
  export {
@@ -1,5 +1,5 @@
1
1
  import { toRefs, ref, reactive, provide, watch, onMounted, nextTick, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot } from "vue";
2
- import { c as createComponent } from "./component-bb5ff48e.js";
2
+ import { c as createComponent } from "./component-81a4c1d0.js";
3
3
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
4
4
  import "../locale/lang";
5
5
  const { create } = createComponent("tabbar");
@@ -1,4 +1,4 @@
1
- import { c as createComponent } from "./component-bb5ff48e.js";
1
+ import { c as createComponent } from "./component-81a4c1d0.js";
2
2
  import { r as renderIcon } from "./renderIcon-3d0fd47c.js";
3
3
  import { inject, reactive, getCurrentInstance, computed, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createVNode, normalizeProps, guardReactiveProps, withCtx, createElementVNode, renderSlot, createCommentVNode, createBlock, resolveDynamicComponent, toDisplayString } from "vue";
4
4
  import { u as useRouter } from "./index-54d03fc1.js";
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, h, reactive, computed, watch, toRefs, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, Fragment, renderList, normalizeStyle, createTextVNode, toDisplayString, renderSlot, createBlock, createCommentVNode } from "vue";
2
- import { c as createComponent } from "./component-bb5ff48e.js";
2
+ import { c as createComponent } from "./component-81a4c1d0.js";
3
3
  import { DownArrow } from "@nutui/icons-vue";
4
4
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
5
5
  import "../locale/lang";
@@ -4,15 +4,118 @@ var __publicField = (obj, key, value) => {
4
4
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
5
  return value;
6
6
  };
7
- import { c as createComponent, T as TypeOfFun } from "./component-bb5ff48e.js";
8
- import { ref, provide, computed, watch, onMounted, onActivated, nextTick, resolveComponent, openBlock, createElementBlock, normalizeClass, createBlock, withCtx, createElementVNode, normalizeStyle, renderSlot, Fragment, renderList, createCommentVNode, createVNode, toDisplayString } from "vue";
7
+ import { c as createComponent, T as TypeOfFun } from "./component-81a4c1d0.js";
8
+ 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";
9
9
  import { p as pxCheck } from "./pxCheck-c6b9f6b7.js";
10
10
  import { u as useRect } from "./index-29892cda.js";
11
11
  import { r as requestAniFrame } from "./raf-729dad54.js";
12
- import { _ as _sfc_main$1 } from "./index.vue_vue_type_script_lang-8f90bbd8.js";
12
+ import { _ as _sfc_main$1 } from "./index.vue_vue_type_script_lang-cc5c4086.js";
13
13
  import { JoySmile } from "@nutui/icons-vue";
14
+ import { u as useTouch } from "./index-7a7385e4.js";
14
15
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
15
16
  import "../locale/lang";
17
+ const useTabContentTouch = (props, tabMethods, taro, useTaroRect) => {
18
+ const tabsContentRef = ref();
19
+ const tabsContentRefRect = ref({ width: 0, height: 0 });
20
+ const initTaroWidth = async () => {
21
+ var _a, _b;
22
+ if (taro && taro.getEnv() !== taro.ENV_TYPE.WEB) {
23
+ let rect = await useTaroRect(tabsContentRef, taro);
24
+ tabsContentRefRect.value.width = rect.width || 0;
25
+ tabsContentRefRect.value.height = rect.height || 0;
26
+ } else {
27
+ tabsContentRefRect.value.width = ((_a = tabsContentRef.value) == null ? void 0 : _a.clientWidth) || 0;
28
+ tabsContentRefRect.value.height = ((_b = tabsContentRef.value) == null ? void 0 : _b.clientHeight) || 0;
29
+ }
30
+ };
31
+ onMounted(() => {
32
+ setTimeout(() => {
33
+ initTaroWidth();
34
+ }, 100);
35
+ });
36
+ const touchState = reactive({
37
+ offset: 0,
38
+ moving: false
39
+ });
40
+ const touch = useTouch();
41
+ let position = "";
42
+ const setoffset = (deltaX, deltaY) => {
43
+ var _a;
44
+ let offset = deltaX;
45
+ console.log(tabsContentRefRect.value.width);
46
+ if (props.direction == "horizontal") {
47
+ position = deltaX > 0 ? "right" : "left";
48
+ offset = Math.abs(offset) / tabsContentRefRect.value.width * 100;
49
+ } else {
50
+ position = deltaY > 0 ? "bottom" : "top";
51
+ offset = deltaY;
52
+ offset = Math.abs(offset) / ((_a = tabsContentRefRect.value) == null ? void 0 : _a.height) * 100;
53
+ }
54
+ if (offset > 85) {
55
+ offset = 85;
56
+ }
57
+ switch (position) {
58
+ case "left":
59
+ case "top":
60
+ if (tabMethods.isEnd()) {
61
+ offset = 0;
62
+ touchState.moving = false;
63
+ }
64
+ break;
65
+ case "right":
66
+ case "bottom":
67
+ offset = -offset;
68
+ if (tabMethods.isBegin()) {
69
+ offset = 0;
70
+ touchState.moving = false;
71
+ }
72
+ break;
73
+ }
74
+ touchState.offset = offset;
75
+ };
76
+ const touchMethods = {
77
+ onTouchStart(event) {
78
+ if (!props.swipeable)
79
+ return;
80
+ touch.start(event);
81
+ },
82
+ onTouchMove(event) {
83
+ if (!props.swipeable)
84
+ return;
85
+ touch.move(event);
86
+ touchState.moving = true;
87
+ setoffset(touch.deltaX.value, touch.deltaY.value);
88
+ if (props.direction == "horizontal" && touch.isHorizontal()) {
89
+ event.preventDefault();
90
+ event.stopPropagation();
91
+ }
92
+ if (props.direction == "vertical" && touch.isVertical()) {
93
+ event.preventDefault();
94
+ event.stopPropagation();
95
+ }
96
+ },
97
+ onTouchEnd() {
98
+ if (touchState.moving) {
99
+ touchState.moving = false;
100
+ switch (position) {
101
+ case "left":
102
+ case "top":
103
+ if (touchState.offset > 35) {
104
+ tabMethods.next();
105
+ }
106
+ break;
107
+ case "right":
108
+ case "bottom":
109
+ if (touchState.offset < -35) {
110
+ tabMethods.prev();
111
+ }
112
+ break;
113
+ }
114
+ }
115
+ }
116
+ };
117
+ return { touchMethods, touchState, tabsContentRef };
118
+ };
16
119
  class Title {
17
120
  constructor() {
18
121
  __publicField(this, "title", "");
@@ -55,6 +158,10 @@ const _sfc_main = create({
55
158
  type: Boolean,
56
159
  default: true
57
160
  },
161
+ swipeable: {
162
+ type: Boolean,
163
+ default: false
164
+ },
58
165
  autoHeight: {
59
166
  type: Boolean,
60
167
  default: false
@@ -84,8 +191,11 @@ const _sfc_main = create({
84
191
  setup(props, { emit, slots }) {
85
192
  const container = ref(null);
86
193
  let stickyFixed;
87
- provide("activeKey", { activeKey: computed(() => props.modelValue) });
88
- provide("autoHeight", { autoHeight: computed(() => props.autoHeight) });
194
+ provide("tabsOpiton", {
195
+ activeKey: computed(() => props.modelValue || "0"),
196
+ autoHeight: computed(() => props.autoHeight),
197
+ animatedTime: computed(() => props.animatedTime)
198
+ });
89
199
  const titles = ref([]);
90
200
  const renderTitles = (vnodes) => {
91
201
  vnodes.forEach((vnode, index) => {
@@ -116,7 +226,7 @@ const _sfc_main = create({
116
226
  const findTabsIndex = (value) => {
117
227
  let index = titles.value.findIndex((item) => item.paneKey == value);
118
228
  if (titles.value.length == 0) {
119
- console.error("[NutUI] <Tabs> 当前未找到 TabPane 组件元素 , 请检查 .");
229
+ console.warn("[NutUI] <Tabs> 当前未找到 TabPane 组件元素 , 请检查 .");
120
230
  } else if (index == -1)
121
231
  ;
122
232
  else {
@@ -190,11 +300,51 @@ const _sfc_main = create({
190
300
  );
191
301
  onMounted(init);
192
302
  onActivated(init);
303
+ const tabMethods = {
304
+ isBegin: () => {
305
+ return currentIndex.value == 0;
306
+ },
307
+ isEnd: () => {
308
+ return currentIndex.value == titles.value.length - 1;
309
+ },
310
+ next: () => {
311
+ currentIndex.value += 1;
312
+ tabMethods.updateValue(titles.value[currentIndex.value]);
313
+ },
314
+ prev: () => {
315
+ currentIndex.value -= 1;
316
+ tabMethods.updateValue(titles.value[currentIndex.value]);
317
+ },
318
+ updateValue: (item) => {
319
+ emit("update:modelValue", item.paneKey);
320
+ emit("change", item);
321
+ },
322
+ tabChange: (item, index) => {
323
+ emit("click", item);
324
+ if (item.disabled || currentIndex.value == index) {
325
+ return;
326
+ }
327
+ currentIndex.value = index;
328
+ tabMethods.updateValue(item);
329
+ },
330
+ setTabItemRef: (el, index) => {
331
+ titleRef.value[index] = el;
332
+ }
333
+ };
334
+ const { tabsContentRef, touchState, touchMethods } = useTabContentTouch(props, tabMethods);
193
335
  const contentStyle = computed(() => {
194
- return {
195
- transform: props.direction == "horizontal" ? `translate3d(-${currentIndex.value * 100}%, 0, 0)` : `translate3d( 0,-${currentIndex.value * 100}%, 0)`,
196
- transitionDuration: `${props.animatedTime}ms`
336
+ let offsetPercent = currentIndex.value * 100;
337
+ if (touchState.moving) {
338
+ offsetPercent += touchState.offset;
339
+ }
340
+ let style = {
341
+ transform: props.direction == "horizontal" ? `translate3d(-${offsetPercent}%, 0, 0)` : `translate3d( 0,-${offsetPercent}%, 0)`,
342
+ transitionDuration: touchState.moving ? void 0 : `${props.animatedTime}ms`
197
343
  };
344
+ if (props.animatedTime == 0) {
345
+ style = {};
346
+ }
347
+ return style;
198
348
  });
199
349
  const tabsNavStyle = computed(() => {
200
350
  return {
@@ -213,22 +363,9 @@ const _sfc_main = create({
213
363
  marginRight: pxCheck(props.titleGutter)
214
364
  };
215
365
  });
216
- const methods = {
217
- tabChange: (item, index) => {
218
- emit("click", item);
219
- if (item.disabled) {
220
- return;
221
- }
222
- currentIndex.value = index;
223
- emit("update:modelValue", item.paneKey);
224
- emit("change", item);
225
- },
226
- setTabItemRef: (el, index) => {
227
- titleRef.value[index] = el;
228
- }
229
- };
230
366
  return {
231
367
  navRef,
368
+ tabsContentRef,
232
369
  titles,
233
370
  contentStyle,
234
371
  tabsNavStyle,
@@ -236,7 +373,8 @@ const _sfc_main = create({
236
373
  tabsActiveStyle,
237
374
  container,
238
375
  onStickyScroll,
239
- ...methods
376
+ ...tabMethods,
377
+ ...touchMethods
240
378
  };
241
379
  }
242
380
  });
@@ -324,10 +462,15 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
324
462
  ], 6)),
325
463
  createElementVNode("view", {
326
464
  class: "nut-tabs__content",
327
- style: normalizeStyle(_ctx.contentStyle)
465
+ ref: "tabsContentRef",
466
+ style: normalizeStyle(_ctx.contentStyle),
467
+ onTouchstart: _cache[0] || (_cache[0] = (...args) => _ctx.onTouchStart && _ctx.onTouchStart(...args)),
468
+ onTouchmove: _cache[1] || (_cache[1] = (...args) => _ctx.onTouchMove && _ctx.onTouchMove(...args)),
469
+ onTouchend: _cache[2] || (_cache[2] = (...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args)),
470
+ onTouchcancel: _cache[3] || (_cache[3] = (...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args))
328
471
  }, [
329
472
  renderSlot(_ctx.$slots, "default")
330
- ], 4)
473
+ ], 36)
331
474
  ], 2);
332
475
  }
333
476
  const Tabs = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
@@ -1,5 +1,5 @@
1
1
  import { toRefs, computed, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, renderSlot, createBlock, createCommentVNode } from "vue";
2
- import { c as createComponent } from "./component-bb5ff48e.js";
2
+ import { c as createComponent } from "./component-81a4c1d0.js";
3
3
  import { Close } from "@nutui/icons-vue";
4
4
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
5
5
  import "../locale/lang";
@@ -1,5 +1,5 @@
1
1
  import { ref, computed, onMounted, nextTick, watch, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, toDisplayString, createCommentVNode } from "vue";
2
- import { c as createComponent } from "./component-bb5ff48e.js";
2
+ import { c as createComponent } from "./component-81a4c1d0.js";
3
3
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
4
4
  import "../locale/lang";
5
5
  const { componentName, create, translate } = createComponent("textarea");
@@ -1,5 +1,5 @@
1
1
  import { inject, reactive, computed, toRefs, openBlock, createElementBlock, normalizeClass, createElementVNode, Fragment, renderList, toDisplayString } from "vue";
2
- import { c as createComponent } from "./component-bb5ff48e.js";
2
+ import { c as createComponent } from "./component-81a4c1d0.js";
3
3
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
4
4
  import "../locale/lang";
5
5
  const { componentName, create } = createComponent("time-detail");
@@ -1,5 +1,5 @@
1
1
  import { inject, reactive, computed, toRefs, openBlock, createElementBlock, normalizeClass, toDisplayString } from "vue";
2
- import { c as createComponent } from "./component-bb5ff48e.js";
2
+ import { c as createComponent } from "./component-81a4c1d0.js";
3
3
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
4
4
  import "../locale/lang";
5
5
  const { componentName, create } = createComponent("time-pannel");
@@ -1,6 +1,6 @@
1
1
  import { computed, provide, resolveComponent, openBlock, createBlock, normalizeStyle, withCtx, createElementVNode, normalizeClass, createElementBlock, toDisplayString, renderSlot } from "vue";
2
- import { c as createComponent } from "./component-bb5ff48e.js";
3
- import { P as Popup } from "./index-a564e25f.js";
2
+ import { c as createComponent } from "./component-81a4c1d0.js";
3
+ import { P as Popup } from "./index-c55ad69e.js";
4
4
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
5
5
  import "../locale/lang";
6
6
  import "./Overlay.js";
@@ -1,9 +1,9 @@
1
1
  import { reactive, onMounted, watch, computed, openBlock, createBlock, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, normalizeStyle, createElementBlock, resolveDynamicComponent, createCommentVNode, toDisplayString, vShow, createVNode, render } from "vue";
2
- import { c as createComponent } from "./component-bb5ff48e.js";
2
+ import { c as createComponent } from "./component-81a4c1d0.js";
3
3
  import { r as renderIcon } from "./renderIcon-3d0fd47c.js";
4
4
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
5
5
  import "../locale/lang";
6
- import { C as CreateComponent } from "./mountComponent-3865592f.js";
6
+ import { C as CreateComponent } from "./mountComponent-1ece4110.js";
7
7
  import { Success, Failure, Tips, Loading } from "@nutui/icons-vue";
8
8
  const { create } = createComponent("toast");
9
9
  const _sfc_main = create({
@@ -1,12 +1,12 @@
1
1
  import { reactive, ref, computed, onMounted, watch, toRefs, nextTick, resolveComponent, openBlock, createElementBlock, normalizeClass, withDirectives, createElementVNode, vShow, Fragment, renderList, normalizeStyle, createCommentVNode, createVNode, withCtx, renderSlot, toDisplayString } from "vue";
2
- import { c as createComponent } from "./component-bb5ff48e.js";
2
+ import { c as createComponent } from "./component-81a4c1d0.js";
3
3
  import { u as useRect } from "./index-29892cda.js";
4
4
  import { Close } from "@nutui/icons-vue";
5
5
  import Popover from "./Popover.js";
6
6
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
7
7
  import "../locale/lang";
8
8
  import "./renderIcon-3d0fd47c.js";
9
- import "./index-a564e25f.js";
9
+ import "./index-c55ad69e.js";
10
10
  import "./Overlay.js";
11
11
  const { create } = createComponent("tour");
12
12
  const _sfc_main = create({
@@ -1,5 +1,5 @@
1
1
  import { reactive, computed, toRefs, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, toDisplayString, createCommentVNode, renderSlot, createVNode } from "vue";
2
- import { m as myFixed, c as createComponent } from "./component-bb5ff48e.js";
2
+ import { m as myFixed, c as createComponent } from "./component-81a4c1d0.js";
3
3
  import { TriangleUp, TriangleDown } from "@nutui/icons-vue";
4
4
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
5
5
  import "../locale/lang";
@@ -5,8 +5,8 @@ var __publicField = (obj, key, value) => {
5
5
  return value;
6
6
  };
7
7
  import { reactive, computed, h, resolveComponent, openBlock, createElementBlock, normalizeClass, renderSlot, createBlock, resolveDynamicComponent, createCommentVNode, Fragment, renderList, createElementVNode, toDisplayString, createVNode } from "vue";
8
- import { c as createComponent } from "./component-bb5ff48e.js";
9
- import { f as funInterceptor } from "./interceptor-648bf3d0.js";
8
+ import { c as createComponent } from "./component-81a4c1d0.js";
9
+ import { f as funInterceptor } from "./interceptor-956b24fc.js";
10
10
  import Progress from "./Progress.js";
11
11
  import { Photograph, Failure, Loading, Del, Link } from "@nutui/icons-vue";
12
12
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
@@ -1,5 +1,5 @@
1
1
  import { reactive, ref, computed, watch, nextTick, onMounted, toRefs, openBlock, createElementBlock, createElementVNode, createCommentVNode, withDirectives, vShow, normalizeClass, toDisplayString, normalizeStyle, withModifiers } from "vue";
2
- import { c as createComponent } from "./component-bb5ff48e.js";
2
+ import { c as createComponent } from "./component-81a4c1d0.js";
3
3
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
4
4
  import "../locale/lang";
5
5
  function throttle(fn, delay) {
@@ -1,5 +1,5 @@
1
1
  import { reactive, watch, computed, toRefs, openBlock, createElementBlock, normalizeClass, normalizeStyle } from "vue";
2
- import { c as createComponent } from "./component-bb5ff48e.js";
2
+ import { c as createComponent } from "./component-81a4c1d0.js";
3
3
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
4
4
  import "../locale/lang";
5
5
  const { componentName, create } = createComponent("watermark");
@@ -1,5 +1,5 @@
1
1
  import { shallowReactive, getCurrentInstance, provide, markRaw, isVNode, computed, h } from "vue";
2
- import { c as createComponent } from "./component-bb5ff48e.js";
2
+ import { c as createComponent } from "./component-81a4c1d0.js";
3
3
  import { p as pxCheck } from "./pxCheck-c6b9f6b7.js";
4
4
  function flattenVNodes(children, childName) {
5
5
  const result = [];
@@ -127,15 +127,15 @@ function createComponent(name) {
127
127
  }
128
128
  export {
129
129
  TypeOfFun as T,
130
- isArray as a,
130
+ isDate as a,
131
131
  body as b,
132
132
  createComponent as c,
133
- isDate as d,
134
- preventDefault as e,
135
- clamp as f,
136
- isPromise as g,
133
+ preventDefault as d,
134
+ clamp as e,
135
+ isPromise as f,
136
+ isObject as g,
137
137
  getPropByPath as h,
138
- isObject as i,
138
+ isArray as i,
139
139
  isString as j,
140
140
  isFunction as k,
141
141
  getScrollTopRoot as l,
@@ -1,4 +1,4 @@
1
- import { c as createComponent } from "./component-bb5ff48e.js";
1
+ import { c as createComponent } from "./component-81a4c1d0.js";
2
2
  import { reactive, computed, watch, watchEffect, toRefs, resolveComponent, openBlock, createBlock, Teleport, mergeProps, createCommentVNode, createVNode, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, normalizeStyle, renderSlot, createElementBlock, vShow } from "vue";
3
3
  import Overlay from "./Overlay.js";
4
4
  import { Close } from "@nutui/icons-vue";
@@ -149,8 +149,8 @@ const component = (componentName2, components) => {
149
149
  emit("update:visible", false);
150
150
  };
151
151
  const onClickOverlay = (e) => {
152
+ emit("click-overlay", e);
152
153
  if (props.closeOnClickOverlay) {
153
- emit("click-overlay", e);
154
154
  emit("update:visible", false);
155
155
  }
156
156
  };
@@ -1,5 +1,5 @@
1
1
  import { ref, computed, reactive, watch, toRefs, openBlock, createElementBlock, normalizeClass, createElementVNode, toDisplayString, createCommentVNode, renderSlot, Fragment, renderList, normalizeStyle, createTextVNode } from "vue";
2
- import { c as createComponent } from "./component-bb5ff48e.js";
2
+ import { c as createComponent } from "./component-81a4c1d0.js";
3
3
  import { r as requestAniFrame } from "./raf-729dad54.js";
4
4
  import { u as useExpose } from "./index-79c5dc33.js";
5
5
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
@@ -1,5 +1,5 @@
1
1
  import { provide, readonly, computed, watch, h } from "vue";
2
- import { c as createComponent } from "./component-bb5ff48e.js";
2
+ import { c as createComponent } from "./component-81a4c1d0.js";
3
3
  const { componentName, create } = createComponent("radio-group");
4
4
  const _sfc_main = create({
5
5
  props: {
@@ -1,5 +1,5 @@
1
1
  import { inject, computed, h } from "vue";
2
- import { c as createComponent } from "./component-bb5ff48e.js";
2
+ import { c as createComponent } from "./component-81a4c1d0.js";
3
3
  import { CheckNormal, CheckChecked } from "@nutui/icons-vue";
4
4
  import { p as pxCheck } from "./pxCheck-c6b9f6b7.js";
5
5
  const { componentName, create } = createComponent("radio");
@@ -1,5 +1,5 @@
1
1
  import { ref, reactive, computed, watch, onMounted, onUnmounted, h, unref } from "vue";
2
- import { c as createComponent } from "./component-bb5ff48e.js";
2
+ import { c as createComponent } from "./component-81a4c1d0.js";
3
3
  import { u as useRect } from "./index-29892cda.js";
4
4
  const { componentName, create } = createComponent("sticky");
5
5
  const _sfc_main = create({
@@ -1,4 +1,4 @@
1
- import { g as isPromise } from "./component-bb5ff48e.js";
1
+ import { f as isPromise } from "./component-81a4c1d0.js";
2
2
  const funInterceptor = (interceptor, {
3
3
  args = [],
4
4
  done,
@@ -1,5 +1,5 @@
1
1
  import { createApp } from "vue";
2
- import { j as isString, k as isFunction } from "./component-bb5ff48e.js";
2
+ import { j as isString, k as isFunction } from "./component-81a4c1d0.js";
3
3
  const CreateComponent = (options, component) => {
4
4
  let elWarp = document.body;
5
5
  const teleport = options.teleport || "body";
@@ -132,7 +132,7 @@
132
132
  .nut-address__detail-list {
133
133
  padding-top: 15px;
134
134
  height: 270px;
135
- overflow-y: auto;
135
+ // overflow-y: auto;
136
136
  box-sizing: border-box;
137
137
  padding: 0;
138
138
  .nut-address__detail-item {