@nutui/nutui 4.0.2 → 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 (133) hide show
  1. package/dist/nutui.es.js +1 -1
  2. package/dist/nutui.umd.js +2 -2
  3. package/dist/packages/_es/ActionSheet.js +2 -2
  4. package/dist/packages/_es/Address.js +5 -2
  5. package/dist/packages/_es/AddressList.js +1 -1
  6. package/dist/packages/_es/Animate.js +1 -1
  7. package/dist/packages/_es/Audio.js +7 -1
  8. package/dist/packages/_es/AudioOperate.js +2 -1
  9. package/dist/packages/_es/Avatar.js +3 -1
  10. package/dist/packages/_es/AvatarGroup.js +2 -1
  11. package/dist/packages/_es/Backtop.js +1 -1
  12. package/dist/packages/_es/Badge.js +1 -1
  13. package/dist/packages/_es/Barrage.js +1 -1
  14. package/dist/packages/_es/Button.js +1 -1
  15. package/dist/packages/_es/Calendar.js +3 -3
  16. package/dist/packages/_es/CalendarItem.js +2 -2
  17. package/dist/packages/_es/Card.js +1 -1
  18. package/dist/packages/_es/Cascader.js +6 -3
  19. package/dist/packages/_es/Category.js +3 -1
  20. package/dist/packages/_es/CategoryPane.js +4 -1
  21. package/dist/packages/_es/Cell.js +2 -1
  22. package/dist/packages/_es/CellGroup.js +1 -1
  23. package/dist/packages/_es/Checkbox.js +2 -1
  24. package/dist/packages/_es/CheckboxGroup.js +1 -1
  25. package/dist/packages/_es/CircleProgress.js +1 -1
  26. package/dist/packages/_es/Col.js +1 -1
  27. package/dist/packages/_es/Collapse.js +1 -1
  28. package/dist/packages/_es/CollapseItem.js +2 -1
  29. package/dist/packages/_es/Comment.js +6 -1
  30. package/dist/packages/_es/ConfigProvider.js +2 -34
  31. package/dist/packages/_es/Countdown.js +9 -1
  32. package/dist/packages/_es/Countup.js +11 -1
  33. package/dist/packages/_es/DatePicker.js +3 -1
  34. package/dist/packages/_es/Dialog.js +7 -4
  35. package/dist/packages/_es/Divider.js +1 -1
  36. package/dist/packages/_es/Drag.js +1 -1
  37. package/dist/packages/_es/Ecard.js +1 -1
  38. package/dist/packages/_es/Elevator.js +1 -1
  39. package/dist/packages/_es/Ellipsis.js +3 -1
  40. package/dist/packages/_es/Empty.js +4 -1
  41. package/dist/packages/_es/FixedNav.js +1 -1
  42. package/dist/packages/_es/Form.js +1 -1
  43. package/dist/packages/_es/FormItem.js +1 -1
  44. package/dist/packages/_es/Grid.js +2 -2
  45. package/dist/packages/_es/GridItem.js +3 -2
  46. package/dist/packages/_es/Image.js +1 -1
  47. package/dist/packages/_es/ImagePreview.js +5 -4
  48. package/dist/packages/_es/Indicator.js +1 -1
  49. package/dist/packages/_es/InfiniteLoading.js +1 -1
  50. package/dist/packages/_es/Input.js +13 -7
  51. package/dist/packages/_es/InputNumber.js +1 -1
  52. package/dist/packages/_es/Invoice.js +6 -4
  53. package/dist/packages/_es/Layout.js +1 -1
  54. package/dist/packages/_es/List.js +1 -1
  55. package/dist/packages/_es/Menu.js +1 -1
  56. package/dist/packages/_es/MenuItem.js +2 -2
  57. package/dist/packages/_es/Navbar.js +7 -1
  58. package/dist/packages/_es/Noticebar.js +5 -3
  59. package/dist/packages/_es/Notify.js +5 -2
  60. package/dist/packages/_es/NumberKeyboard.js +2 -2
  61. package/dist/packages/_es/Overlay.js +2 -2
  62. package/dist/packages/_es/Pagination.js +1 -1
  63. package/dist/packages/_es/Picker.js +3 -1
  64. package/dist/packages/_es/Popover.js +2 -2
  65. package/dist/packages/_es/Popup.js +2 -2
  66. package/dist/packages/_es/Price.js +7 -2
  67. package/dist/packages/_es/Progress.js +1 -1
  68. package/dist/packages/_es/PullRefresh.js +5 -1
  69. package/dist/packages/_es/Radio.js +2 -2
  70. package/dist/packages/_es/RadioGroup.js +2 -2
  71. package/dist/packages/_es/Range.js +1 -1
  72. package/dist/packages/_es/Rate.js +1 -1
  73. package/dist/packages/_es/Row.js +1 -1
  74. package/dist/packages/_es/Searchbar.js +2 -1
  75. package/dist/packages/_es/ShortPassword.js +3 -2
  76. package/dist/packages/_es/SideNavbar.js +1 -1
  77. package/dist/packages/_es/SideNavbarItem.js +1 -1
  78. package/dist/packages/_es/Signature.js +1 -1
  79. package/dist/packages/_es/Skeleton.js +11 -1
  80. package/dist/packages/_es/Sku.js +16 -2
  81. package/dist/packages/_es/Step.js +1 -1
  82. package/dist/packages/_es/Steps.js +1 -1
  83. package/dist/packages/_es/Sticky.js +2 -2
  84. package/dist/packages/_es/SubSideNavbar.js +1 -1
  85. package/dist/packages/_es/Swipe.js +1 -1
  86. package/dist/packages/_es/Swiper.js +2 -1
  87. package/dist/packages/_es/SwiperItem.js +1 -1
  88. package/dist/packages/_es/Switch.js +1 -1
  89. package/dist/packages/_es/TabPane.js +13 -8
  90. package/dist/packages/_es/Tabbar.js +1 -1
  91. package/dist/packages/_es/TabbarItem.js +6 -1
  92. package/dist/packages/_es/Table.js +1 -1
  93. package/dist/packages/_es/Tabs.js +171 -26
  94. package/dist/packages/_es/Tag.js +1 -1
  95. package/dist/packages/_es/Textarea.js +2 -1
  96. package/dist/packages/_es/TimeDetail.js +1 -1
  97. package/dist/packages/_es/TimePannel.js +1 -1
  98. package/dist/packages/_es/TimeSelect.js +2 -2
  99. package/dist/packages/_es/Toast.js +10 -2
  100. package/dist/packages/_es/Tour.js +3 -2
  101. package/dist/packages/_es/TrendArrow.js +1 -1
  102. package/dist/packages/_es/Uploader.js +4 -2
  103. package/dist/packages/_es/Video.js +19 -1
  104. package/dist/packages/_es/Watermark.js +1 -1
  105. package/dist/packages/_es/{common-05c67d9a.js → common-b9a5e726.js} +9 -1
  106. package/dist/packages/_es/{component-bb5ff48e.js → component-81a4c1d0.js} +6 -6
  107. package/dist/packages/_es/{index-a564e25f.js → index-c55ad69e.js} +2 -2
  108. package/dist/packages/_es/{index-c4bbec14.js → index-cb5fe1dc.js} +38 -1
  109. package/dist/packages/_es/{index.vue_vue_type_script_lang-ee936659.js → index.vue_vue_type_script_lang-22dfc112.js} +2 -1
  110. package/dist/packages/_es/{index.vue_vue_type_script_lang-8b9f3de5.js → index.vue_vue_type_script_lang-442e4704.js} +2 -1
  111. package/dist/packages/_es/{index.vue_vue_type_script_lang-8f90bbd8.js → index.vue_vue_type_script_lang-cc5c4086.js} +1 -1
  112. package/dist/packages/_es/{interceptor-648bf3d0.js → interceptor-956b24fc.js} +1 -1
  113. package/dist/packages/_es/{mountComponent-3865592f.js → mountComponent-1ece4110.js} +1 -1
  114. package/dist/packages/input/index.scss +2 -2
  115. package/dist/packages/menuitem/index.scss +1 -1
  116. package/dist/packages/navbar/index.scss +0 -1
  117. package/dist/packages/price/index.scss +5 -10
  118. package/dist/smartips/web-types.json +20 -20
  119. package/dist/style.css +1 -1
  120. package/dist/styles/themes/default.scss +53 -53
  121. package/dist/styles/themes/jdb.scss +53 -53
  122. package/dist/styles/themes/jddkh.scss +53 -53
  123. package/dist/styles/themes/jdt.scss +53 -53
  124. package/dist/types/__VUE/configprovider/index.vue.d.ts +4 -4
  125. package/dist/types/__VUE/input/index.vue.d.ts +3 -1
  126. package/dist/types/__VUE/noticebar/index.vue.d.ts +4 -2
  127. package/dist/types/__VUE/price/index.vue.d.ts +9 -0
  128. package/dist/types/__VUE/tabpane/index.vue.d.ts +1 -4
  129. package/dist/types/__VUE/tabs/hooks.d.ts +12 -0
  130. package/dist/types/__VUE/tabs/index.vue.d.ts +20 -5
  131. package/dist/types/index.d.ts +1 -1
  132. package/dist/types/utils/useTaroRect/index.d.ts +1 -1
  133. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { ref, computed, reactive, onMounted, toRefs, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, withDirectives, vShow, toDisplayString, createCommentVNode, createVNode, withCtx, createTextVNode } from "vue";
2
- import { c as createComponent } from "./component-bb5ff48e.js";
2
+ import { c as createComponent } from "./component-81a4c1d0.js";
3
3
  import Button from "./Button.js";
4
4
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
5
5
  import "../locale/lang";
@@ -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";
@@ -7,42 +7,52 @@ const component = (components) => {
7
7
  return {
8
8
  components,
9
9
  props: {
10
+ //每行宽度
10
11
  width: {
11
12
  type: String,
12
13
  default: "100px"
13
14
  },
15
+ //每行高度
14
16
  height: {
15
17
  type: String,
16
18
  default: "15px"
17
19
  },
20
+ //是否显示动画
18
21
  animated: {
19
22
  type: Boolean,
20
23
  default: false
21
24
  },
25
+ //头像
22
26
  avatar: {
23
27
  type: Boolean,
24
28
  default: false
25
29
  },
30
+ //头像形状:正方形/圆形
26
31
  avatarShape: {
27
32
  type: String,
28
33
  default: "round"
29
34
  },
35
+ //头像大小
30
36
  avatarSize: {
31
37
  type: String,
32
38
  default: "50px"
33
39
  },
40
+ //是否显示骨架屏
34
41
  loading: {
35
42
  type: Boolean,
36
43
  default: true
37
44
  },
45
+ //标题/段落 圆角风格
38
46
  round: {
39
47
  type: Boolean,
40
48
  default: false
41
49
  },
50
+ //显示段落行数
42
51
  row: {
43
52
  type: String,
44
53
  default: "1"
45
54
  },
55
+ //是否显示段落标题
46
56
  title: {
47
57
  type: Boolean,
48
58
  default: true
@@ -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";
@@ -124,6 +124,7 @@ const SkuSelect = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_rend
124
124
  const { componentName: componentName$2, create: create$2 } = createComponent("sku-stepper");
125
125
  const _sfc_main$2 = create$2({
126
126
  props: {
127
+ // 购买数量最大值
127
128
  stepperMax: {
128
129
  type: [Number, String],
129
130
  default: 99999
@@ -132,10 +133,12 @@ const _sfc_main$2 = create$2({
132
133
  type: [Number, String],
133
134
  default: 1
134
135
  },
136
+ // stepper 前文案提示
135
137
  stepperExtraText: {
136
138
  type: [Function, Boolean],
137
139
  default: false
138
140
  },
141
+ // 数量选择左侧文案
139
142
  stepperTitle: {
140
143
  type: String,
141
144
  default: "购买数量"
@@ -214,6 +217,7 @@ const SkuStepper = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_ren
214
217
  const { componentName: componentName$1, create: create$1 } = createComponent("sku-operate");
215
218
  const _sfc_main$1 = create$1({
216
219
  props: {
220
+ // 底部按钮配置 confirm cart buy
217
221
  btnOptions: {
218
222
  type: Array,
219
223
  default: () => ["confirm"]
@@ -222,10 +226,12 @@ const _sfc_main$1 = create$1({
222
226
  type: String,
223
227
  default: ""
224
228
  },
229
+ // 立即购买文案
225
230
  buyText: {
226
231
  type: String,
227
232
  default: "立即购买"
228
233
  },
234
+ // 加入购物车文案
229
235
  addCartText: {
230
236
  type: String,
231
237
  default: "加入购物车"
@@ -297,22 +303,27 @@ const _sfc_main = create({
297
303
  type: Object,
298
304
  default: {}
299
305
  },
306
+ // stepper 最大值
300
307
  stepperMax: {
301
308
  type: [Number, String],
302
309
  default: 99999
303
310
  },
311
+ // stepper 最小值
304
312
  stepperMin: {
305
313
  type: [Number, String],
306
314
  default: 1
307
315
  },
316
+ // 底部按钮配置 confirm cart buy
308
317
  btnOptions: {
309
318
  type: Array,
310
319
  default: () => ["confirm"]
311
320
  },
321
+ // 数量选择左侧文案
312
322
  stepperTitle: {
313
323
  type: String,
314
324
  default: ""
315
325
  },
326
+ // stepper 前面文案
316
327
  stepperExtraText: {
317
328
  type: [Function, Boolean],
318
329
  default: false
@@ -321,14 +332,17 @@ const _sfc_main = create({
321
332
  type: String,
322
333
  default: ""
323
334
  },
335
+ // 立即购买文案
324
336
  buyText: {
325
337
  type: String,
326
338
  default: ""
327
339
  },
340
+ // 加入购物车文案
328
341
  addCartText: {
329
342
  type: String,
330
343
  default: ""
331
344
  },
345
+ // 确定文案
332
346
  confirmText: {
333
347
  type: String,
334
348
  default: ""
@@ -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";
@@ -19,6 +19,7 @@ const _sfc_main = create({
19
19
  direction: {
20
20
  type: String,
21
21
  default: "horizontal"
22
+ //horizontal and vertical
22
23
  },
23
24
  paginationVisible: {
24
25
  type: Boolean,
@@ -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";
@@ -10,6 +10,7 @@ const _sfc_main = create({
10
10
  components: { [Badge.name]: Badge },
11
11
  props: {
12
12
  tabTitle: {
13
+ // 标签页的标题
13
14
  type: String,
14
15
  default: ""
15
16
  },
@@ -17,9 +18,11 @@ const _sfc_main = create({
17
18
  type: String
18
19
  },
19
20
  icon: {
21
+ // 标签页显示的icon
20
22
  type: Object
21
23
  },
22
24
  href: {
25
+ // 标签页的跳转链接
23
26
  type: String,
24
27
  default: ""
25
28
  },
@@ -32,7 +35,9 @@ const _sfc_main = create({
32
35
  const parent = inject("parent");
33
36
  const state = reactive({
34
37
  unactiveColor: parent.unactiveColor,
38
+ // 未选中的颜色
35
39
  activeColor: parent.activeColor,
40
+ // 选中的颜色
36
41
  index: 0
37
42
  });
38
43
  const router = useRouter();
@@ -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", "");
@@ -36,6 +139,7 @@ const _sfc_main = create({
36
139
  direction: {
37
140
  type: String,
38
141
  default: "horizontal"
142
+ //vertical
39
143
  },
40
144
  size: {
41
145
  type: String,
@@ -44,6 +148,7 @@ const _sfc_main = create({
44
148
  type: {
45
149
  type: String,
46
150
  default: "line"
151
+ //card、line、smile
47
152
  },
48
153
  titleScroll: {
49
154
  type: Boolean,
@@ -53,6 +158,10 @@ const _sfc_main = create({
53
158
  type: Boolean,
54
159
  default: true
55
160
  },
161
+ swipeable: {
162
+ type: Boolean,
163
+ default: false
164
+ },
56
165
  autoHeight: {
57
166
  type: Boolean,
58
167
  default: false
@@ -82,8 +191,11 @@ const _sfc_main = create({
82
191
  setup(props, { emit, slots }) {
83
192
  const container = ref(null);
84
193
  let stickyFixed;
85
- provide("activeKey", { activeKey: computed(() => props.modelValue) });
86
- 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
+ });
87
199
  const titles = ref([]);
88
200
  const renderTitles = (vnodes) => {
89
201
  vnodes.forEach((vnode, index) => {
@@ -114,7 +226,7 @@ const _sfc_main = create({
114
226
  const findTabsIndex = (value) => {
115
227
  let index = titles.value.findIndex((item) => item.paneKey == value);
116
228
  if (titles.value.length == 0) {
117
- console.error("[NutUI] <Tabs> 当前未找到 TabPane 组件元素 , 请检查 .");
229
+ console.warn("[NutUI] <Tabs> 当前未找到 TabPane 组件元素 , 请检查 .");
118
230
  } else if (index == -1)
119
231
  ;
120
232
  else {
@@ -188,11 +300,51 @@ const _sfc_main = create({
188
300
  );
189
301
  onMounted(init);
190
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);
191
335
  const contentStyle = computed(() => {
192
- return {
193
- transform: props.direction == "horizontal" ? `translate3d(-${currentIndex.value * 100}%, 0, 0)` : `translate3d( 0,-${currentIndex.value * 100}%, 0)`,
194
- 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`
195
343
  };
344
+ if (props.animatedTime == 0) {
345
+ style = {};
346
+ }
347
+ return style;
196
348
  });
197
349
  const tabsNavStyle = computed(() => {
198
350
  return {
@@ -211,22 +363,9 @@ const _sfc_main = create({
211
363
  marginRight: pxCheck(props.titleGutter)
212
364
  };
213
365
  });
214
- const methods = {
215
- tabChange: (item, index) => {
216
- emit("click", item);
217
- if (item.disabled || currentIndex.value == index) {
218
- return;
219
- }
220
- currentIndex.value = index;
221
- emit("update:modelValue", item.paneKey);
222
- emit("change", item);
223
- },
224
- setTabItemRef: (el, index) => {
225
- titleRef.value[index] = el;
226
- }
227
- };
228
366
  return {
229
367
  navRef,
368
+ tabsContentRef,
230
369
  titles,
231
370
  contentStyle,
232
371
  tabsNavStyle,
@@ -234,7 +373,8 @@ const _sfc_main = create({
234
373
  tabsActiveStyle,
235
374
  container,
236
375
  onStickyScroll,
237
- ...methods
376
+ ...tabMethods,
377
+ ...touchMethods
238
378
  };
239
379
  }
240
380
  });
@@ -322,10 +462,15 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
322
462
  ], 6)),
323
463
  createElementVNode("view", {
324
464
  class: "nut-tabs__content",
325
- 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))
326
471
  }, [
327
472
  renderSlot(_ctx.$slots, "default")
328
- ], 4)
473
+ ], 36)
329
474
  ], 2);
330
475
  }
331
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");
@@ -67,6 +67,7 @@ const _sfc_main = create({
67
67
  const styles = computed(() => {
68
68
  return {
69
69
  textAlign: props.textAlign
70
+ // resize: props.autosize ? 'vertical' : 'none'
70
71
  };
71
72
  });
72
73
  const getContentHeight = () => {
@@ -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";