@nutui/nutui 3.2.5 → 3.2.6-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 (239) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/nutui.es.js +4214 -4444
  3. package/dist/nutui.umd.js +4213 -4543
  4. package/dist/packages/_es/ActionSheet.js +18 -19
  5. package/dist/packages/_es/Address.js +94 -85
  6. package/dist/packages/_es/AddressList.js +25 -12
  7. package/dist/packages/_es/Animate.js +3 -3
  8. package/dist/packages/_es/Audio.js +9 -2
  9. package/dist/packages/_es/AudioOperate.js +5 -1
  10. package/dist/packages/_es/Avatar.js +10 -10
  11. package/dist/packages/_es/AvatarGroup.js +5 -5
  12. package/dist/packages/_es/BackTop.js +55 -108
  13. package/dist/packages/_es/Badge.js +6 -4
  14. package/dist/packages/_es/Barrage.js +79 -103
  15. package/dist/packages/_es/Button.js +5 -3
  16. package/dist/packages/_es/Calendar.js +36 -23
  17. package/dist/packages/_es/CalendarItem.js +4 -3
  18. package/dist/packages/_es/Card.js +15 -5
  19. package/dist/packages/_es/Cascader.js +12 -11
  20. package/dist/packages/_es/Category.js +13 -12
  21. package/dist/packages/_es/CategoryPane.js +17 -13
  22. package/dist/packages/_es/Cell.js +9 -12
  23. package/dist/packages/_es/CellGroup.js +4 -2
  24. package/dist/packages/_es/Checkbox.js +1 -1
  25. package/dist/packages/_es/CheckboxGroup.js +2 -2
  26. package/dist/packages/_es/CircleProgress.js +98 -82
  27. package/dist/packages/_es/Col.js +1 -1
  28. package/dist/packages/_es/Collapse.js +65 -34
  29. package/dist/packages/_es/CollapseItem.js +93 -60
  30. package/dist/packages/_es/Comment.js +43 -19
  31. package/dist/packages/_es/ConfigProvider.js +1 -1
  32. package/dist/packages/_es/CountDown.js +3 -3
  33. package/dist/packages/_es/CountUp.js +47 -52
  34. package/dist/packages/_es/DatePicker.js +37 -54
  35. package/dist/packages/_es/Dialog.js +9 -88
  36. package/dist/packages/_es/Divider.js +3 -3
  37. package/dist/packages/_es/Drag.js +75 -49
  38. package/dist/packages/_es/Ecard.js +20 -18
  39. package/dist/packages/_es/Elevator.js +101 -76
  40. package/dist/packages/_es/Ellipsis.js +140 -100
  41. package/dist/packages/_es/Empty.js +6 -4
  42. package/dist/packages/_es/FixedNav.js +11 -6
  43. package/dist/packages/_es/Form.js +4 -4
  44. package/dist/packages/_es/FormItem.js +3 -1
  45. package/dist/packages/_es/Grid.js +1 -1
  46. package/dist/packages/_es/GridItem.js +10 -27
  47. package/dist/packages/_es/Icon.js +1 -1
  48. package/dist/packages/_es/Image.js +13 -114
  49. package/dist/packages/_es/ImagePreview.js +154 -400
  50. package/dist/packages/_es/Indicator.js +3 -3
  51. package/dist/packages/_es/InfiniteLoading.js +103 -115
  52. package/dist/packages/_es/Input.js +54 -26
  53. package/dist/packages/_es/InputNumber.js +25 -16
  54. package/dist/packages/_es/Invoice.js +6 -5
  55. package/dist/packages/_es/Layout.js +1 -1
  56. package/dist/packages/_es/List.js +47 -34
  57. package/dist/packages/_es/Menu.js +35 -35
  58. package/dist/packages/_es/MenuItem.js +56 -29
  59. package/dist/packages/_es/Navbar.js +49 -39
  60. package/dist/packages/_es/NoticeBar.js +52 -41
  61. package/dist/packages/_es/Notify.js +37 -166
  62. package/dist/packages/_es/NumberKeyboard.js +15 -20
  63. package/dist/packages/_es/OldPicker.js +130 -116
  64. package/dist/packages/_es/OverLay.js +5 -28
  65. package/dist/packages/_es/Pagination.js +8 -5
  66. package/dist/packages/_es/Picker.js +196 -65
  67. package/dist/packages/_es/Popover.js +201 -881
  68. package/dist/packages/_es/Popup.js +28 -84
  69. package/dist/packages/_es/Price.js +22 -6
  70. package/dist/packages/_es/Progress.js +18 -11
  71. package/dist/packages/_es/PullRefresh.js +4 -2
  72. package/dist/packages/_es/Radio.js +3 -3
  73. package/dist/packages/_es/RadioGroup.js +1 -1
  74. package/dist/packages/_es/Range.js +48 -34
  75. package/dist/packages/_es/Rate.js +15 -14
  76. package/dist/packages/_es/Row.js +1 -1
  77. package/dist/packages/_es/SearchBar.js +39 -36
  78. package/dist/packages/_es/ShortPassword.js +97 -66
  79. package/dist/packages/_es/SideNavBar.js +7 -18
  80. package/dist/packages/_es/SideNavBarItem.js +1 -1
  81. package/dist/packages/_es/Signature.js +113 -80
  82. package/dist/packages/_es/Skeleton.js +12 -11
  83. package/dist/packages/_es/Sku.js +63 -38
  84. package/dist/packages/_es/Step.js +7 -2
  85. package/dist/packages/_es/Steps.js +1 -1
  86. package/dist/packages/_es/Sticky.js +33 -23
  87. package/dist/packages/_es/SubSideNavBar.js +4 -2
  88. package/dist/packages/_es/Swipe.js +41 -26
  89. package/dist/packages/_es/Swiper.js +38 -21
  90. package/dist/packages/_es/SwiperItem.js +2 -2
  91. package/dist/packages/_es/Switch.js +8 -8
  92. package/dist/packages/_es/TabPane.js +1 -1
  93. package/dist/packages/_es/Tabbar.js +40 -9
  94. package/dist/packages/_es/TabbarItem.js +24 -30
  95. package/dist/packages/_es/Table.js +22 -17
  96. package/dist/packages/_es/Tabs.js +49 -16
  97. package/dist/packages/_es/Tag.js +6 -5
  98. package/dist/packages/_es/TextArea.js +114 -49
  99. package/dist/packages/_es/TimeDetail.js +4 -3
  100. package/dist/packages/_es/TimePannel.js +3 -3
  101. package/dist/packages/_es/TimeSelect.js +12 -10
  102. package/dist/packages/_es/Toast.js +53 -164
  103. package/dist/packages/_es/TrendArrow.js +6 -4
  104. package/dist/packages/_es/Uploader.js +141 -140
  105. package/dist/packages/_es/Video.js +72 -5
  106. package/dist/packages/_es/WaterMark.js +22 -14
  107. package/dist/packages/_es/common.js +1 -1
  108. package/dist/packages/_es/component.js +1 -1
  109. package/dist/packages/_es/index.js +44 -6
  110. package/dist/packages/_es/{index5.js → index.taro.js} +167 -154
  111. package/dist/packages/_es/index2.js +8 -31
  112. package/dist/packages/_es/index3.js +64 -7
  113. package/dist/packages/_es/index4.js +424 -62
  114. package/dist/packages/_es/plugin-vue_export-helper.js +1 -1
  115. package/dist/packages/_es/pxCheck.js +1 -1
  116. package/dist/packages/_es/raf.js +1 -1
  117. package/dist/packages/_es/style.css +21 -3
  118. package/dist/packages/_es/use-lock-scroll.js +23 -0
  119. package/dist/packages/locale/lang/baseLang.js +1 -1
  120. package/dist/packages/locale/lang/en-US.js +1 -1
  121. package/dist/packages/locale/lang/id-ID.js +1 -1
  122. package/dist/packages/locale/lang/index.js +1 -1
  123. package/dist/packages/locale/lang/zh-CN.js +1 -1
  124. package/dist/packages/locale/lang/zh-TW.js +1 -1
  125. package/dist/packages/signature/index.scss +4 -1
  126. package/dist/packages/swiperitem/index.scss +1 -1
  127. package/dist/smartips/attributes.json +4 -0
  128. package/dist/smartips/tags.json +2 -1
  129. package/dist/smartips/web-types.json +10 -1
  130. package/dist/style.css +1 -1
  131. package/dist/styles/themes/default.scss +44 -44
  132. package/dist/styles/themes/jdb.scss +44 -44
  133. package/dist/styles/themes/jddkh.scss +44 -44
  134. package/dist/styles/themes/jdt.scss +44 -44
  135. package/dist/types/__VUE/actionsheet/{index.vue.d.ts → index.taro.vue.d.ts} +11 -11
  136. package/dist/types/__VUE/address/{index.vue.d.ts → index.taro.vue.d.ts} +74 -34
  137. package/dist/types/__VUE/addresslist/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  138. package/dist/types/__VUE/animate/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  139. package/dist/types/__VUE/avatar/{index.vue.d.ts → index.taro.vue.d.ts} +5 -5
  140. package/dist/types/__VUE/avatargroup/{index.vue.d.ts → index.taro.vue.d.ts} +1 -1
  141. package/dist/types/__VUE/backtop/{index.vue.d.ts → index.taro.vue.d.ts} +14 -36
  142. package/dist/types/__VUE/badge/{index.vue.d.ts → index.taro.vue.d.ts} +1 -1
  143. package/dist/types/__VUE/barrage/{index.vue.d.ts → index.taro.vue.d.ts} +2 -2
  144. package/dist/types/__VUE/button/index.taro.vue.d.ts +116 -0
  145. package/dist/types/__VUE/calendar/{index.vue.d.ts → index.taro.vue.d.ts} +14 -2
  146. package/dist/types/__VUE/calendaritem/{index.vue.d.ts → index.taro.vue.d.ts} +17 -17
  147. package/dist/types/__VUE/card/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  148. package/dist/types/__VUE/cascader/{index.vue.d.ts → index.taro.vue.d.ts} +2 -2
  149. package/dist/types/__VUE/category/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  150. package/dist/types/__VUE/categorypane/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  151. package/dist/types/__VUE/cell/{index.vue.d.ts → index.taro.vue.d.ts} +12 -5
  152. package/dist/types/__VUE/checkbox/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  153. package/dist/types/__VUE/circleprogress/{index.vue.d.ts → index.taro.vue.d.ts} +14 -15
  154. package/dist/types/__VUE/collapse/{index.vue.d.ts → index.taro.vue.d.ts} +1 -1
  155. package/dist/types/__VUE/collapseitem/{index.vue.d.ts → index.taro.vue.d.ts} +1 -9
  156. package/dist/types/__VUE/comment/{index.vue.d.ts → index.taro.vue.d.ts} +1 -2
  157. package/dist/types/__VUE/configprovider/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  158. package/dist/types/__VUE/countdown/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  159. package/dist/types/__VUE/countup/{index.vue.d.ts → index.taro.vue.d.ts} +5 -7
  160. package/dist/types/__VUE/datepicker/{index.vue.d.ts → index.taro.vue.d.ts} +6 -6
  161. package/dist/types/__VUE/dialog/{index.vue.d.ts → index.taro.vue.d.ts} +10 -13
  162. package/dist/types/__VUE/divider/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  163. package/dist/types/__VUE/drag/{index.vue.d.ts → index.taro.vue.d.ts} +2 -1
  164. package/dist/types/__VUE/ecard/{index.vue.d.ts → index.taro.vue.d.ts} +3 -3
  165. package/dist/types/__VUE/elevator/{index.vue.d.ts → index.taro.vue.d.ts} +11 -2
  166. package/dist/types/__VUE/ellipsis/{index.vue.d.ts → index.taro.vue.d.ts} +4 -0
  167. package/dist/types/__VUE/empty/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  168. package/dist/types/__VUE/fixednav/{index.vue.d.ts → index.taro.vue.d.ts} +1 -1
  169. package/dist/types/__VUE/form/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  170. package/dist/types/__VUE/grid/{index.vue.d.ts → index.taro.vue.d.ts} +1 -1
  171. package/dist/types/__VUE/griditem/{index.vue.d.ts → index.taro.vue.d.ts} +2 -27
  172. package/dist/types/__VUE/icon/index.taro.vue.d.ts +74 -0
  173. package/dist/types/__VUE/image/index.taro.vue.d.ts +33 -0
  174. package/dist/types/__VUE/imagepreview/{index.vue.d.ts → index.taro.vue.d.ts} +41 -43
  175. package/dist/types/__VUE/indicator/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  176. package/dist/types/__VUE/infiniteloading/{index.vue.d.ts → index.taro.vue.d.ts} +15 -8
  177. package/dist/types/__VUE/input/{index.vue.d.ts → index.taro.vue.d.ts} +34 -16
  178. package/dist/types/__VUE/inputnumber/{index.vue.d.ts → index.taro.vue.d.ts} +2 -2
  179. package/dist/types/__VUE/invoice/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  180. package/dist/types/__VUE/layout/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  181. package/dist/types/__VUE/list/{index.vue.d.ts → index.taro.vue.d.ts} +2 -2
  182. package/dist/types/__VUE/menu/{index.vue.d.ts → index.taro.vue.d.ts} +2 -1
  183. package/dist/types/__VUE/menuitem/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  184. package/dist/types/__VUE/navbar/{index.vue.d.ts → index.taro.vue.d.ts} +1 -2
  185. package/dist/types/__VUE/noticebar/{index.vue.d.ts → index.taro.vue.d.ts} +6 -5
  186. package/dist/types/__VUE/notify/{index.vue.d.ts → index.taro.vue.d.ts} +10 -25
  187. package/dist/types/__VUE/numberkeyboard/{index.vue.d.ts → index.taro.vue.d.ts} +6 -30
  188. package/dist/types/__VUE/oldpicker/{Column.vue.d.ts → ColumnTaro.vue.d.ts} +28 -17
  189. package/dist/types/__VUE/oldpicker/{index.vue.d.ts → index.taro.vue.d.ts} +65 -45
  190. package/dist/types/__VUE/overlay/index.taro.vue.d.ts +85 -0
  191. package/dist/types/__VUE/pagination/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  192. package/dist/types/__VUE/picker/{Column.vue.d.ts → ColumnTaro.vue.d.ts} +16 -4
  193. package/dist/types/__VUE/picker/{index.vue.d.ts → index.taro.vue.d.ts} +54 -29
  194. package/dist/types/__VUE/popover/{index.vue.d.ts → index.taro.vue.d.ts} +18 -16
  195. package/dist/types/__VUE/popup/index.taro.vue.d.ts +1728 -0
  196. package/dist/types/__VUE/popup/index.vue.d.ts +4 -4
  197. package/dist/types/__VUE/price/{index.vue.d.ts → index.taro.vue.d.ts} +1 -0
  198. package/dist/types/__VUE/progress/{index.vue.d.ts → index.taro.vue.d.ts} +1 -1
  199. package/dist/types/__VUE/radio/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  200. package/dist/types/__VUE/range/{index.vue.d.ts → index.taro.vue.d.ts} +7 -6
  201. package/dist/types/__VUE/rate/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  202. package/dist/types/__VUE/searchbar/{index.vue.d.ts → index.taro.vue.d.ts} +19 -19
  203. package/dist/types/__VUE/shortpassword/{index.vue.d.ts → index.taro.vue.d.ts} +6 -21
  204. package/dist/types/__VUE/sidenavbar/{index.vue.d.ts → index.taro.vue.d.ts} +0 -5
  205. package/dist/types/__VUE/signature/{index.vue.d.ts → index.taro.vue.d.ts} +8 -5
  206. package/dist/types/__VUE/skeleton/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  207. package/dist/types/__VUE/sku/{index.vue.d.ts → index.taro.vue.d.ts} +55 -183
  208. package/dist/types/__VUE/step/index.vue.d.ts +1 -1
  209. package/dist/types/__VUE/steps/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  210. package/dist/types/__VUE/sticky/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  211. package/dist/types/__VUE/swipe/{index.vue.d.ts → index.taro.vue.d.ts} +4 -3
  212. package/dist/types/__VUE/swiper/{index.vue.d.ts → index.taro.vue.d.ts} +2 -1
  213. package/dist/types/__VUE/swiperitem/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  214. package/dist/types/__VUE/switch/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  215. package/dist/types/__VUE/tabbar/{index.vue.d.ts → index.taro.vue.d.ts} +10 -0
  216. package/dist/types/__VUE/tabbaritem/{index.vue.d.ts → index.taro.vue.d.ts} +8 -8
  217. package/dist/types/__VUE/table/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  218. package/dist/types/__VUE/tabs/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  219. package/dist/types/__VUE/tag/{index.vue.d.ts → index.taro.vue.d.ts} +4 -4
  220. package/dist/types/__VUE/textarea/{index.vue.d.ts → index.taro.vue.d.ts} +5 -3
  221. package/dist/types/__VUE/timedetail/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  222. package/dist/types/__VUE/timepannel/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  223. package/dist/types/__VUE/timeselect/{index.vue.d.ts → index.taro.vue.d.ts} +7 -8
  224. package/dist/types/__VUE/toast/{index.vue.d.ts → index.taro.vue.d.ts} +44 -22
  225. package/dist/types/__VUE/trendarrow/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  226. package/dist/types/__VUE/uploader/{index.vue.d.ts → index.taro.vue.d.ts} +22 -13
  227. package/dist/types/__VUE/video/index.vue.d.ts +4 -2
  228. package/dist/types/__VUE/watermark/{index.vue.d.ts → index.taro.vue.d.ts} +1 -1
  229. package/dist/types/index.d.ts +1 -1
  230. package/dist/types/nutui.d.ts +89 -89
  231. package/package.json +1 -1
  232. package/dist/types/__VUE/dialog/index.d.ts +0 -48
  233. package/dist/types/__VUE/image/index.vue.d.ts +0 -117
  234. package/dist/types/__VUE/image/type.d.ts +0 -6
  235. package/dist/types/__VUE/imagepreview/imagePreviewItem.vue.d.ts +0 -108
  236. package/dist/types/__VUE/imagepreview/index.d.ts +0 -25
  237. package/dist/types/__VUE/notify/index.d.ts +0 -26
  238. package/dist/types/__VUE/tag/type.d.ts +0 -5
  239. package/dist/types/__VUE/toast/index.d.ts +0 -16
@@ -1,10 +1,10 @@
1
1
  /*!
2
- * @nutui/nutui v3.2.5 Tue Oct 25 2022 18:40:57 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.2.6-beta.1 Mon Oct 31 2022 19:38:22 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
- import { useSlots, computed, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, Fragment, renderList, renderSlot, toDisplayString, createCommentVNode } from "vue";
7
- import { a as isObject, c as createComponent } from "./component.js";
6
+ import { useSlots, computed, ref, watch, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, createTextVNode, renderSlot, toDisplayString, createCommentVNode } from "vue";
7
+ import { c as createComponent } from "./component.js";
8
8
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
9
9
  import "../locale/lang";
10
10
  const { componentName, create } = createComponent("circleprogress");
@@ -28,49 +28,35 @@ const _sfc_main = create({
28
28
  },
29
29
  color: {
30
30
  type: [String, Object],
31
- default: ""
31
+ default: "#FF673E"
32
32
  },
33
33
  pathColor: {
34
34
  type: String,
35
- default: ""
35
+ default: "#d9d9d9"
36
36
  },
37
37
  clockwise: {
38
38
  type: Boolean,
39
39
  default: true
40
40
  }
41
41
  },
42
- setup(props) {
42
+ emits: ["update:progress"],
43
+ setup(props, { emit }) {
43
44
  const slotDefault = !!useSlots().default;
44
- const refRandomId = Math.random().toString(36).slice(-8);
45
45
  const classes = computed(() => {
46
46
  const prefixCls = componentName;
47
47
  return {
48
48
  [prefixCls]: true
49
49
  };
50
50
  });
51
- const path = computed(() => {
52
- const isWise = props.clockwise ? 1 : 0;
53
- return `M 50 50 m 0 -45 a 45 45 0 1 ${isWise} 0 90 a 45 45 0 1, ${isWise} 0 -90`;
54
- });
55
- const hoverColor = computed(() => {
56
- return isObject(props.color) ? `url(#${refRandomId})` : props.color;
57
- });
58
- const hoverStyle = computed(() => {
59
- let perimeter = 283;
60
- let offset = perimeter * Number(props.progress) / 100;
61
- return {
62
- stroke: isObject(props.color) ? `url(#${refRandomId})` : props.color,
63
- strokeDasharray: `${offset}px ${perimeter}px`
64
- };
65
- });
66
- const pathStyle = computed(() => {
67
- return {
68
- stroke: props.pathColor
69
- };
70
- });
71
- const stop = computed(() => {
51
+ const currentRate = ref(props.progress);
52
+ const refRandomId = Math.random().toString(36).slice(-8);
53
+ const isObject = (val) => val !== null && typeof val === "object";
54
+ const transColor = (color) => {
55
+ return color && color.replace("#", "%23");
56
+ };
57
+ const stop = () => {
72
58
  if (!isObject(props.color)) {
73
- return;
59
+ return [];
74
60
  }
75
61
  let color = props.color;
76
62
  const colorArr = Object.keys(color).sort((a, b) => parseFloat(a) - parseFloat(b));
@@ -85,71 +71,101 @@ const _sfc_main = create({
85
71
  stopArr.push(obj);
86
72
  });
87
73
  return stopArr;
74
+ };
75
+ const style = computed(() => {
76
+ let { strokeWidth } = props;
77
+ let stopArr = stop();
78
+ let stopDom = [];
79
+ if (stopArr) {
80
+ stopArr.map((item) => {
81
+ let obj = "";
82
+ obj = `%3Cstop offset='${item.key}' stop-color='${transColor(item.value)}'/%3E`;
83
+ stopDom.push(obj);
84
+ });
85
+ }
86
+ let perimeter = 283;
87
+ let progress = +currentRate.value;
88
+ let offset = perimeter * Number(format(parseFloat(progress.toFixed(1)))) / 100;
89
+ const isWise = props.clockwise ? 1 : 0;
90
+ const color = isObject(props.color) ? `url(%23${refRandomId})` : transColor(props.color);
91
+ let d = `M 50 50 m 0 -45 a 45 45 0 1 ${isWise} 0 90 a 45 45 0 1, ${isWise} 0 -90`;
92
+ const pa = `%3Cdefs%3E%3ClinearGradient id='${refRandomId}' x1='100%25' y1='0%25' x2='0%25' y2='0%25'%3E${stopDom}%3C/linearGradient%3E%3C/defs%3E`;
93
+ const path = `%3Cpath d='${d}' stroke-width='${strokeWidth}' stroke='${transColor(
94
+ props.pathColor
95
+ )}' fill='none'/%3E`;
96
+ const path1 = `%3Cpath d='${d}' stroke-width='${strokeWidth}' stroke-dasharray='${offset},${perimeter}' stroke-linecap='round' stroke='${color}' fill='none'/%3E`;
97
+ return {
98
+ background: `url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E${pa}${path}${path1}%3C/svg%3E")`,
99
+ width: "100%",
100
+ height: "100%"
101
+ };
88
102
  });
103
+ const format = (progress) => Math.min(Math.max(+progress, 0), 100);
104
+ var lastTime = 0;
105
+ const requestAnimationFrame = function(callback) {
106
+ var currTime = new Date().getTime();
107
+ var timeToCall = Math.max(0, 16.7 - (currTime - lastTime));
108
+ lastTime = currTime + timeToCall;
109
+ var id = setTimeout(function() {
110
+ callback(currTime + timeToCall, lastTime);
111
+ }, timeToCall);
112
+ lastTime = currTime + timeToCall;
113
+ return id;
114
+ };
115
+ const cancelAnimationFrame = function(id) {
116
+ clearTimeout(id);
117
+ };
118
+ watch(
119
+ () => props.progress,
120
+ (value, oldvalue) => {
121
+ let rafId;
122
+ const startTime = Date.now();
123
+ const startRate = Number(oldvalue);
124
+ const endRate = Number(value);
125
+ const duration = Math.abs((startRate - endRate) * 1e3 / 100);
126
+ const animate = () => {
127
+ const now = Date.now();
128
+ const progress = Math.min((now - startTime) / duration, 1);
129
+ const rate = progress * (endRate - startRate) + startRate;
130
+ currentRate.value = Math.min(Math.max(+rate, 0), 100);
131
+ emit("update:progress", format(parseFloat(rate.toFixed(1))));
132
+ if (endRate > startRate ? rate < endRate : rate > endRate) {
133
+ rafId = requestAnimationFrame(animate);
134
+ }
135
+ };
136
+ if (rafId) {
137
+ cancelAnimationFrame(rafId);
138
+ }
139
+ rafId = requestAnimationFrame(animate);
140
+ }
141
+ );
89
142
  return {
90
- classes,
91
- hoverStyle,
92
- pathStyle,
93
- path,
94
- hoverColor,
95
- stop,
96
143
  slotDefault,
97
- refRandomId
144
+ style,
145
+ currentRate,
146
+ refRandomId,
147
+ classes,
148
+ stop
98
149
  };
99
150
  }
100
151
  });
101
- const _hoisted_1 = { viewBox: "0 0 100 100" };
102
- const _hoisted_2 = ["id"];
103
- const _hoisted_3 = ["offset", "stop-color"];
104
- const _hoisted_4 = ["d", "stroke-width"];
105
- const _hoisted_5 = ["d", "stroke", "stroke-linecap", "stroke-width"];
106
- const _hoisted_6 = { class: "nut-circleprogress-text" };
107
- const _hoisted_7 = { key: 0 };
152
+ const _hoisted_1 = { class: "nut-circleprogress-text" };
153
+ const _hoisted_2 = { key: 0 };
108
154
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
109
155
  return openBlock(), createElementBlock("div", {
110
156
  class: normalizeClass(_ctx.classes),
111
157
  style: normalizeStyle({ height: _ctx.radius * 2 + "px", width: _ctx.radius * 2 + "px" })
112
158
  }, [
113
- (openBlock(), createElementBlock("svg", _hoisted_1, [
114
- createElementVNode("defs", null, [
115
- createElementVNode("linearGradient", {
116
- id: _ctx.refRandomId,
117
- x1: "100%",
118
- y1: "0%",
119
- x2: "0%",
120
- y2: "0%"
121
- }, [
122
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.stop, (item, index2) => {
123
- return openBlock(), createElementBlock("stop", {
124
- key: index2,
125
- offset: item.key,
126
- "stop-color": item.value
127
- }, null, 8, _hoisted_3);
128
- }), 128))
129
- ], 8, _hoisted_2)
130
- ]),
131
- createElementVNode("path", {
132
- class: "nut-circleprogress-path",
133
- style: normalizeStyle(_ctx.pathStyle),
134
- d: _ctx.path,
135
- fill: "none",
136
- "stroke-width": _ctx.strokeWidth
137
- }, " > ", 12, _hoisted_4),
138
- createElementVNode("path", {
139
- class: "nut-circleprogress-hover",
140
- style: normalizeStyle(_ctx.hoverStyle),
141
- d: _ctx.path,
142
- fill: "none",
143
- stroke: _ctx.hoverColor,
144
- "stroke-linecap": _ctx.strokeLinecap,
145
- "stroke-width": _ctx.strokeWidth
146
- }, null, 12, _hoisted_5)
147
- ])),
148
- createElementVNode("div", _hoisted_6, [
159
+ createElementVNode("div", {
160
+ style: normalizeStyle(_ctx.style)
161
+ }, null, 4),
162
+ createTextVNode(),
163
+ createElementVNode("div", _hoisted_1, [
149
164
  renderSlot(_ctx.$slots, "default"),
150
- !_ctx.slotDefault ? (openBlock(), createElementBlock("div", _hoisted_7, toDisplayString(_ctx.progress) + "%", 1)) : createCommentVNode("", true)
165
+ createTextVNode(),
166
+ !_ctx.slotDefault ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(_ctx.progress) + "%", 1)) : createCommentVNode("", true)
151
167
  ])
152
168
  ], 6);
153
169
  }
154
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
155
- export { index as default };
170
+ var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
171
+ export { index_taro as default };
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.2.5 Tue Oct 25 2022 18:40:57 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.2.6-beta.1 Mon Oct 31 2022 19:38:22 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,10 +1,11 @@
1
1
  /*!
2
- * @nutui/nutui v3.2.5 Tue Oct 25 2022 18:40:57 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.2.6-beta.1 Mon Oct 31 2022 19:38:22 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
- import { ref, watch, onMounted, getCurrentInstance, provide, openBlock, createElementBlock, renderSlot } from "vue";
6
+ import { ref, onMounted, getCurrentInstance, watch, provide, openBlock, createElementBlock, renderSlot } from "vue";
7
7
  import { c as createComponent } from "./component.js";
8
+ import { nextTick } from "@tarojs/taro";
8
9
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
9
10
  import "../locale/lang";
10
11
  const { create } = createComponent("collapse");
@@ -52,45 +53,19 @@ const _sfc_main = create({
52
53
  emits: ["update:active", "change"],
53
54
  setup(props, { emit, slots }) {
54
55
  const collapseDom = ref(null);
55
- const collapseChldren = ref([]);
56
- watch(
57
- () => props.active,
58
- (newval, oldval) => {
59
- let doms = collapseChldren.value;
60
- Array.from(doms).forEach((item) => {
61
- if (typeof newval == "number" || typeof newval == "string") {
62
- if (newval == item.name) {
63
- item.changeOpen(true);
64
- } else {
65
- item.changeOpen(false);
66
- }
67
- } else if (Object.values(newval) instanceof Array) {
68
- if (newval.indexOf(Number(item.name)) > -1 || newval.indexOf(String(item.name)) > -1) {
69
- item.changeOpen(true);
70
- } else {
71
- item.changeOpen(false);
72
- }
73
- }
74
- item.animation();
75
- });
76
- }
77
- );
78
- onMounted(() => {
79
- collapseChldren.value = getCurrentInstance().provides.collapseParent.children || [];
80
- });
81
56
  const changeVal = (val) => {
82
57
  emit("update:active", val);
83
58
  emit("change", val);
84
59
  };
85
60
  const changeValAry = (name) => {
86
61
  const activeItem = props.active instanceof Object ? Object.values(props.active) : props.active;
87
- let index2 = -1;
62
+ let index = -1;
88
63
  activeItem.forEach((item, idx) => {
89
64
  if (String(item) == String(name)) {
90
- index2 = idx;
65
+ index = idx;
91
66
  }
92
67
  });
93
- index2 > -1 ? activeItem.splice(index2, 1) : activeItem.push(name);
68
+ index > -1 ? activeItem.splice(index, 1) : activeItem.push(name);
94
69
  changeVal(activeItem);
95
70
  };
96
71
  const isExpanded = (name) => {
@@ -99,12 +74,68 @@ const _sfc_main = create({
99
74
  return typeof active === "number" || typeof active === "string" ? active == name : false;
100
75
  }
101
76
  };
77
+ const activeIndex = () => {
78
+ var _a;
79
+ const activeCollapse = props.active;
80
+ const childrenList = (_a = slots.default) == null ? void 0 : _a.call(slots);
81
+ let act = [];
82
+ childrenList.forEach((item, index) => {
83
+ if (typeof activeCollapse == "number" || typeof activeCollapse == "string") {
84
+ if (item.props.name == activeCollapse) {
85
+ act.push(item.flag);
86
+ return act;
87
+ }
88
+ } else {
89
+ let ary = Array.from(activeCollapse);
90
+ if (ary.includes(String(item.props.name)) || ary.includes(Number(item.props.name))) {
91
+ act.push(item.flag);
92
+ }
93
+ }
94
+ });
95
+ return act;
96
+ };
97
+ const childrenDom = ref(null);
98
+ onMounted(() => {
99
+ childrenDom.value = getCurrentInstance().provides.collapseParent.children;
100
+ });
101
+ watch(
102
+ () => props.active,
103
+ (newval, oldval) => {
104
+ nextTick(() => {
105
+ var _a;
106
+ let domsProps = (_a = slots == null ? void 0 : slots.default) == null ? void 0 : _a.call(slots);
107
+ let doms = childrenDom.value;
108
+ Array.from(doms).forEach((item, index) => {
109
+ if (typeof newval == "number" || typeof newval == "string") {
110
+ if (newval == domsProps[index].props.name) {
111
+ item.changeOpen(true);
112
+ } else {
113
+ item.changeOpen(false);
114
+ }
115
+ } else if (Object.values(newval) instanceof Array) {
116
+ if (newval.indexOf(Number(domsProps[index].props.name)) > -1 || newval.indexOf(String(domsProps[index].props.name)) > -1) {
117
+ item.changeOpen(true);
118
+ } else {
119
+ item.changeOpen(false);
120
+ }
121
+ }
122
+ item.animation();
123
+ });
124
+ });
125
+ }
126
+ );
127
+ const getParentChildren = () => {
128
+ var _a;
129
+ return (_a = slots.default) == null ? void 0 : _a.call(slots);
130
+ };
102
131
  provide("collapseParent", {
103
132
  children: [],
104
133
  props,
105
134
  changeValAry,
106
135
  changeVal,
107
- isExpanded
136
+ isExpanded,
137
+ activeIndex,
138
+ getParentChildren
108
139
  });
109
140
  return { collapseDom };
110
141
  }
@@ -115,5 +146,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
115
146
  renderSlot(_ctx.$slots, "default")
116
147
  ], 512);
117
148
  }
118
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
119
- export { index as default };
149
+ var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
150
+ export { index_taro as default };
@@ -1,9 +1,10 @@
1
1
  /*!
2
- * @nutui/nutui v3.2.5 Tue Oct 25 2022 18:40:57 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.2.6-beta.1 Mon Oct 31 2022 19:38:22 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
- import { inject, reactive, computed, getCurrentInstance, ref, watch, onMounted, toRefs, nextTick, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, createBlock, mergeProps, createCommentVNode, renderSlot } from "vue";
6
+ import { inject, ref, reactive, computed, getCurrentInstance, watch, onMounted, toRefs, nextTick, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, createBlock, mergeProps, createCommentVNode, createTextVNode, renderSlot, normalizeStyle } from "vue";
7
+ import Taro, { eventCenter, getCurrentInstance as getCurrentInstance$1 } from "@tarojs/taro";
7
8
  import { c as createComponent } from "./component.js";
8
9
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
9
10
  import "../locale/lang";
@@ -33,6 +34,7 @@ const _sfc_main = create({
33
34
  },
34
35
  setup(props, ctx) {
35
36
  const collapse = inject("collapseParent");
37
+ const conHeight = ref("auto");
36
38
  const parent = reactive(collapse);
37
39
  const classes = computed(() => {
38
40
  const prefixCls = componentName;
@@ -66,31 +68,33 @@ const _sfc_main = create({
66
68
  const wrapperRef = ref(null);
67
69
  const contentRef = ref(null);
68
70
  const onTransitionEnd = () => {
69
- const wrapperRefEle = document.getElementsByClassName("collapse-wrapper")[0];
70
- if (wrapperRefEle) {
71
- wrapperRefEle.style.willChange = "auto";
72
- }
71
+ nextTick(() => {
72
+ parent.children.forEach((item1, index) => {
73
+ let ary = Array.from(item1.$el.children);
74
+ ary.forEach((item2, index2) => {
75
+ if (item2.className.includes("collapse-wrapper")) {
76
+ item2.style.willChange = "auto";
77
+ }
78
+ });
79
+ });
80
+ });
73
81
  };
74
82
  const animation = () => {
75
- const wrapperRefEle = wrapperRef.value;
76
- const contentRefEle = contentRef.value;
77
- if (!wrapperRefEle || !contentRefEle) {
78
- return;
83
+ if (parent.props.icon && !proxyData.openExpanded) {
84
+ proxyData.iconStyle["transform"] = "rotate(0deg)";
85
+ } else {
86
+ proxyData.iconStyle["transform"] = "rotate(" + parent.props.rotate + "deg)";
79
87
  }
80
- const offsetHeight = contentRefEle.offsetHeight || "auto";
81
- if (offsetHeight) {
82
- const contentHeight = `${offsetHeight}px`;
83
- wrapperRefEle.style.willChange = "height";
84
- wrapperRefEle.style.height = !proxyData.openExpanded ? 0 : contentHeight;
85
- if (parent.props.icon && !proxyData.openExpanded) {
86
- proxyData.iconStyle["transform"] = "rotate(0deg)";
87
- } else {
88
- proxyData.iconStyle["transform"] = "rotate(" + parent.props.rotate + "deg)";
88
+ nextTick(() => {
89
+ const query = Taro.getEnv() === "ALIPAY" ? my.createSelectorQuery() : Taro.createSelectorQuery();
90
+ query.selectAll(".collapse-content").boundingClientRect();
91
+ query.exec((res) => {
92
+ getH(res[0]);
93
+ });
94
+ if (!proxyData.openExpanded) {
95
+ onTransitionEnd();
89
96
  }
90
- }
91
- if (!proxyData.openExpanded) {
92
- onTransitionEnd();
93
- }
97
+ });
94
98
  };
95
99
  const open = () => {
96
100
  proxyData.openExpanded = !proxyData.openExpanded;
@@ -113,7 +117,7 @@ const _sfc_main = create({
113
117
  }
114
118
  });
115
119
  } else {
116
- parent.changeValAry(String(props.name));
120
+ parent.changeValAry(props.name);
117
121
  open();
118
122
  }
119
123
  };
@@ -136,45 +140,68 @@ const _sfc_main = create({
136
140
  var _a, _b;
137
141
  return (_b = (_a = ctx == null ? void 0 : ctx.slots) == null ? void 0 : _a.default) == null ? void 0 : _b.call(_a);
138
142
  },
139
- () => {
143
+ (vnodes) => {
140
144
  setTimeout(() => {
141
- animation();
145
+ getRefHeight();
142
146
  }, 300);
143
147
  }
144
148
  );
145
- const init = () => {
146
- const { name } = props;
147
- const active = parent && parent.props.active;
148
- nextTick(() => {
149
- if (typeof active == "number" || typeof active == "string") {
150
- if (name == active) {
151
- defaultOpen();
152
- }
153
- } else if (Object.values(active) instanceof Array) {
154
- const f = Object.values(active).filter((item) => item == name);
155
- if (f.length > 0) {
156
- defaultOpen();
157
- }
149
+ const getH = (list) => {
150
+ parent.children.forEach((item1, index1) => {
151
+ let ary = Array.from(item1.$el.children);
152
+ let _uid = ary[1].children[0]["uid"];
153
+ let tm = list.filter((item2) => item2.id == _uid);
154
+ if (tm && tm.length > 0) {
155
+ let h = tm[0]["height"];
156
+ item1.conHeight = h;
157
+ }
158
+ });
159
+ };
160
+ const getH5 = () => {
161
+ parent.children.forEach((item1, index1) => {
162
+ let ary = Array.from(item1.$el.children);
163
+ let h = ary[1].children[0]["offsetHeight"];
164
+ item1.conHeight = h;
165
+ });
166
+ };
167
+ const getRefHeight = () => {
168
+ const query = Taro.getEnv() === "ALIPAY" ? my.createSelectorQuery() : Taro.createSelectorQuery();
169
+ query.selectAll(".collapse-content").boundingClientRect();
170
+ query.exec((res) => {
171
+ if (Taro.getEnv() === "WEB") {
172
+ getH5();
173
+ } else {
174
+ getH(res[0]);
158
175
  }
159
176
  });
160
177
  };
161
178
  onMounted(() => {
162
- init();
163
- });
164
- const emptyContent = computed(() => {
165
- let ele = contentRef.value;
166
- let _class = "";
167
- if (!(ele == null ? void 0 : ele.innerText)) {
168
- _class = "empty";
179
+ const { name } = props;
180
+ const active = parent && parent.props.active;
181
+ if (typeof active == "number" || typeof active == "string") {
182
+ if (name == active) {
183
+ defaultOpen();
184
+ }
185
+ } else if (Object.values(active) instanceof Array) {
186
+ const f = Object.values(active).filter((item) => item == name);
187
+ if (f.length > 0) {
188
+ defaultOpen();
189
+ }
190
+ }
191
+ if (Taro.getEnv() === "WEB") {
192
+ getRefHeight();
193
+ } else {
194
+ eventCenter.once(getCurrentInstance$1().router.onReady, () => {
195
+ getRefHeight();
196
+ });
169
197
  }
170
- return _class;
171
198
  });
172
199
  return {
173
200
  classes,
174
- emptyContent,
175
201
  ...toRefs(proxyData),
176
202
  ...toRefs(parent.props),
177
203
  ...toRefs(titleIconStyle),
204
+ conHeight,
178
205
  wrapperRef,
179
206
  contentRef,
180
207
  open,
@@ -198,8 +225,8 @@ const _hoisted_6 = {
198
225
  };
199
226
  const _hoisted_7 = { class: "collapse-extraRender" };
200
227
  const _hoisted_8 = {
201
- class: "collapse-wrapper",
202
- ref: "wrapperRef"
228
+ class: "collapse-content",
229
+ ref: "contentRef"
203
230
  };
204
231
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
205
232
  const _component_nut_icon = resolveComponent("nut-icon");
@@ -219,8 +246,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
219
246
  }, _ctx.$attrs, {
220
247
  size: _ctx.titleIconSize,
221
248
  color: _ctx.titleIconColor,
222
- class: [_ctx.titleIconPosition == "left" ? "titleIconLeft" : "titleIconRight"]
249
+ class: ["collapse-title-icon", _ctx.titleIconPosition == "left" ? "titleIconLeft" : "titleIconRight"]
223
250
  }), null, 16, ["name", "size", "color", "class"])) : createCommentVNode("", true),
251
+ createTextVNode(),
224
252
  _ctx.$slots.mTitle ? renderSlot(_ctx.$slots, "mTitle", { key: 1 }) : (openBlock(), createElementBlock("view", {
225
253
  key: 2,
226
254
  innerHTML: _ctx.title,
@@ -229,6 +257,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
229
257
  ])
230
258
  ])
231
259
  ]),
260
+ createTextVNode(),
232
261
  _ctx.$slots.sTitle ? (openBlock(), createElementBlock("view", _hoisted_4, [
233
262
  renderSlot(_ctx.$slots, "sTitle")
234
263
  ])) : (openBlock(), createElementBlock("view", {
@@ -236,6 +265,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
236
265
  innerHTML: _ctx.subTitle,
237
266
  class: "subTitle"
238
267
  }, null, 8, _hoisted_5)),
268
+ createTextVNode(),
239
269
  _ctx.icon ? (openBlock(), createBlock(_component_nut_icon, mergeProps({
240
270
  key: 2,
241
271
  name: _ctx.icon
@@ -246,20 +276,23 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
246
276
  style: _ctx.iconStyle
247
277
  }), null, 16, ["name", "size", "color", "class", "style"])) : createCommentVNode("", true)
248
278
  ], 2),
279
+ createTextVNode(),
249
280
  _ctx.$slots.extraRender ? (openBlock(), createElementBlock("view", _hoisted_6, [
250
281
  createElementVNode("div", _hoisted_7, [
251
282
  renderSlot(_ctx.$slots, "extraRender")
252
283
  ])
253
284
  ])) : createCommentVNode("", true),
254
- createElementVNode("view", _hoisted_8, [
255
- createElementVNode("view", {
256
- class: normalizeClass(["collapse-content", _ctx.emptyContent]),
257
- ref: "contentRef"
258
- }, [
285
+ createTextVNode(),
286
+ createElementVNode("view", {
287
+ class: normalizeClass(["collapse-wrapper", _ctx.openExpanded ? "open-style" : "close-style"]),
288
+ ref: "wrapperRef",
289
+ style: normalizeStyle({ height: _ctx.openExpanded ? _ctx.conHeight == "auto" ? "auto" : _ctx.conHeight + "px" : 0 })
290
+ }, [
291
+ createElementVNode("view", _hoisted_8, [
259
292
  renderSlot(_ctx.$slots, "default")
260
- ], 2)
261
- ], 512)
293
+ ], 512)
294
+ ], 6)
262
295
  ], 2);
263
296
  }
264
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
265
- export { index as default };
297
+ var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
298
+ export { index_taro as default };