@nutui/nutui 3.1.19-beta.1 → 3.1.19-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (236) hide show
  1. package/README.md +9 -8
  2. package/dist/nutui.es.js +3044 -3533
  3. package/dist/nutui.umd.js +3135 -3536
  4. package/dist/packages/_es/ActionSheet.js +64 -42
  5. package/dist/packages/_es/Address.js +69 -78
  6. package/dist/packages/_es/Audio.js +12 -12
  7. package/dist/packages/_es/AudioOperate.js +1 -1
  8. package/dist/packages/_es/Avatar.js +3 -3
  9. package/dist/packages/_es/BackTop.js +110 -68
  10. package/dist/packages/_es/Badge.js +3 -3
  11. package/dist/packages/_es/Barrage.js +55 -62
  12. package/dist/packages/_es/Button.js +2 -2
  13. package/dist/packages/_es/Calendar.js +27 -32
  14. package/dist/packages/_es/CalendarItem.js +3 -3
  15. package/dist/packages/_es/Card.js +5 -6
  16. package/dist/packages/_es/Cascader.js +9 -9
  17. package/dist/packages/_es/Cell.js +11 -4
  18. package/dist/packages/_es/CellGroup.js +1 -1
  19. package/dist/packages/_es/Checkbox.js +13 -3
  20. package/dist/packages/_es/CheckboxGroup.js +2 -2
  21. package/dist/packages/_es/CircleProgress.js +40 -149
  22. package/dist/packages/_es/Col.js +1 -1
  23. package/dist/packages/_es/Collapse.js +8 -34
  24. package/dist/packages/_es/CollapseItem.js +59 -90
  25. package/dist/packages/_es/CountDown.js +11 -10
  26. package/dist/packages/_es/CountUp.js +51 -43
  27. package/dist/packages/_es/DatePicker.js +22 -23
  28. package/dist/packages/_es/Dialog.js +91 -12
  29. package/dist/packages/_es/Divider.js +4 -4
  30. package/dist/packages/_es/Drag.js +54 -92
  31. package/dist/packages/_es/Ecard.js +153 -0
  32. package/dist/packages/_es/Elevator.js +50 -75
  33. package/dist/packages/_es/Empty.js +8 -7
  34. package/dist/packages/_es/FixedNav.js +10 -11
  35. package/dist/packages/_es/Form.js +5 -9
  36. package/dist/packages/_es/FormItem.js +1 -1
  37. package/dist/packages/_es/Grid.js +1 -1
  38. package/dist/packages/_es/GridItem.js +26 -8
  39. package/dist/packages/_es/Icon.js +1 -1
  40. package/dist/packages/_es/ImagePreview.js +83 -14
  41. package/dist/packages/_es/Indicator.js +3 -3
  42. package/dist/packages/_es/InfiniteLoading.js +107 -93
  43. package/dist/packages/_es/Input.js +21 -20
  44. package/dist/packages/_es/InputNumber.js +16 -23
  45. package/dist/packages/_es/Layout.js +1 -1
  46. package/dist/packages/_es/List.js +34 -41
  47. package/dist/packages/_es/Menu.js +12 -15
  48. package/dist/packages/_es/MenuItem.js +7 -7
  49. package/dist/packages/_es/Navbar.js +5 -4
  50. package/dist/packages/_es/NoticeBar.js +40 -47
  51. package/dist/packages/_es/Notify.js +166 -27
  52. package/dist/packages/_es/NumberKeyboard.js +22 -11
  53. package/dist/packages/_es/OldPicker.js +120 -122
  54. package/dist/packages/_es/OverLay.js +25 -5
  55. package/dist/packages/_es/Pagination.js +14 -13
  56. package/dist/packages/_es/Picker.js +23 -45
  57. package/dist/packages/_es/Popover.js +29 -154
  58. package/dist/packages/_es/Popup.js +69 -6
  59. package/dist/packages/_es/Price.js +5 -17
  60. package/dist/packages/_es/Progress.js +23 -19
  61. package/dist/packages/_es/PullRefresh.js +1 -1
  62. package/dist/packages/_es/Radio.js +14 -4
  63. package/dist/packages/_es/RadioGroup.js +1 -1
  64. package/dist/packages/_es/Range.js +33 -46
  65. package/dist/packages/_es/Rate.js +19 -16
  66. package/dist/packages/_es/Row.js +1 -1
  67. package/dist/packages/_es/SearchBar.js +11 -12
  68. package/dist/packages/_es/ShortPassword.js +75 -96
  69. package/dist/packages/_es/SideNavBar.js +16 -5
  70. package/dist/packages/_es/SideNavBarItem.js +1 -1
  71. package/dist/packages/_es/Signature.js +88 -69
  72. package/dist/packages/_es/Skeleton.js +11 -8
  73. package/dist/packages/_es/Sku.js +57 -49
  74. package/dist/packages/_es/Step.js +1 -1
  75. package/dist/packages/_es/Steps.js +1 -1
  76. package/dist/packages/_es/Sticky.js +23 -28
  77. package/dist/packages/_es/SubSideNavBar.js +1 -1
  78. package/dist/packages/_es/Swipe.js +26 -39
  79. package/dist/packages/_es/Swiper.js +14 -32
  80. package/dist/packages/_es/SwiperItem.js +2 -2
  81. package/dist/packages/_es/Switch.js +3 -3
  82. package/dist/packages/_es/TabPane.js +1 -1
  83. package/dist/packages/_es/Tabbar.js +3 -3
  84. package/dist/packages/_es/TabbarItem.js +21 -11
  85. package/dist/packages/_es/Table.js +18 -17
  86. package/dist/packages/_es/Tabs.js +20 -21
  87. package/dist/packages/_es/Tag.js +4 -4
  88. package/dist/packages/_es/TextArea.js +47 -48
  89. package/dist/packages/_es/TimeDetail.js +3 -4
  90. package/dist/packages/_es/TimePannel.js +3 -3
  91. package/dist/packages/_es/TimeSelect.js +7 -8
  92. package/dist/packages/_es/Toast.js +170 -41
  93. package/dist/packages/_es/Uploader.js +145 -116
  94. package/dist/packages/_es/Video.js +9 -8
  95. package/dist/packages/_es/common.js +1 -1
  96. package/dist/packages/_es/component.js +165 -3
  97. package/dist/packages/_es/index.js +6 -44
  98. package/dist/packages/_es/index2.js +31 -8
  99. package/dist/packages/_es/index3.js +7 -58
  100. package/dist/packages/_es/index4.js +56 -413
  101. package/dist/packages/_es/{index.taro.js → index5.js} +113 -140
  102. package/dist/packages/_es/plugin-vue_export-helper.js +1 -1
  103. package/dist/packages/_es/pxCheck.js +1 -1
  104. package/dist/packages/_es/raf.js +19 -0
  105. package/dist/packages/actionsheet/index.scss +8 -0
  106. package/dist/packages/ecard/index.scss +83 -0
  107. package/dist/style.css +1 -1
  108. package/dist/styles/themes/default.scss +48 -47
  109. package/dist/styles/themes/jdt.scss +48 -47
  110. package/dist/styles/variables-jdt.scss +3 -0
  111. package/dist/styles/variables.scss +3 -0
  112. package/dist/types/__VUE/actionsheet/index.d.ts +280 -0
  113. package/dist/types/__VUE/address/index.d.ts +386 -0
  114. package/dist/types/__VUE/audio/index.d.ts +92 -0
  115. package/dist/types/__VUE/audiooperate/index.d.ts +68 -0
  116. package/dist/types/__VUE/avatar/index.d.ts +66 -0
  117. package/dist/types/__VUE/backtop/index.d.ts +105 -0
  118. package/dist/types/__VUE/badge/index.d.ts +94 -0
  119. package/dist/types/__VUE/barrage/index.d.ts +80 -0
  120. package/dist/types/__VUE/button/index.d.ts +116 -0
  121. package/dist/types/__VUE/calendar/index.d.ts +155 -0
  122. package/dist/types/__VUE/calendaritem/index.d.ts +195 -0
  123. package/dist/types/__VUE/card/index.d.ts +81 -0
  124. package/dist/types/__VUE/cascader/cascader-item.d.ts +76 -0
  125. package/dist/types/__VUE/cascader/helper.d.ts +8 -0
  126. package/dist/types/__VUE/cascader/index.d.ts +76 -0
  127. package/dist/types/__VUE/cascader/tree.d.ts +17 -0
  128. package/dist/types/__VUE/cascader/types.d.ts +30 -0
  129. package/dist/types/__VUE/cell/index.d.ts +109 -0
  130. package/dist/types/__VUE/cellgroup/index.d.ts +38 -0
  131. package/dist/types/__VUE/checkbox/index.d.ts +102 -0
  132. package/dist/types/__VUE/checkboxgroup/index.d.ts +39 -0
  133. package/dist/types/__VUE/circleprogress/index.d.ts +66 -0
  134. package/dist/types/__VUE/col/index.d.ts +42 -0
  135. package/dist/types/__VUE/collapse/index.d.ts +104 -0
  136. package/dist/types/__VUE/collapseitem/index.d.ts +83 -0
  137. package/dist/types/__VUE/countdown/index.d.ts +91 -0
  138. package/dist/types/__VUE/countup/index.d.ts +216 -0
  139. package/dist/types/__VUE/datepicker/index.d.ts +347 -0
  140. package/dist/types/__VUE/datepicker/utils.d.ts +5 -0
  141. package/dist/types/__VUE/dialog/index.d.ts +306 -0
  142. package/dist/types/__VUE/divider/index.d.ts +47 -0
  143. package/dist/types/__VUE/drag/index.d.ts +61 -0
  144. package/dist/types/__VUE/ecard/index.d.ts +123 -0
  145. package/dist/types/__VUE/elevator/index.d.ts +71 -0
  146. package/dist/types/__VUE/empty/index.d.ts +47 -0
  147. package/dist/types/__VUE/fixednav/index.d.ts +96 -0
  148. package/dist/types/__VUE/form/common.d.ts +20 -0
  149. package/dist/types/__VUE/form/index.d.ts +32 -0
  150. package/dist/types/__VUE/form/types.d.ts +13 -0
  151. package/dist/types/__VUE/formitem/index.d.ts +120 -0
  152. package/dist/types/__VUE/formitem/types.d.ts +10 -0
  153. package/dist/types/__VUE/grid/common.d.ts +91 -0
  154. package/dist/types/__VUE/grid/index.d.ts +100 -0
  155. package/dist/types/__VUE/griditem/index.d.ts +80 -0
  156. package/dist/types/__VUE/icon/index.d.ts +74 -0
  157. package/dist/types/__VUE/imagepreview/index.d.ts +125 -0
  158. package/dist/types/__VUE/indicator/index.d.ts +70 -0
  159. package/dist/types/__VUE/infiniteloading/index.d.ts +140 -0
  160. package/dist/types/__VUE/input/index.d.ts +337 -0
  161. package/dist/types/__VUE/input/util.d.ts +5 -0
  162. package/dist/types/__VUE/inputnumber/index.d.ts +117 -0
  163. package/dist/types/__VUE/layout/index.d.ts +13 -0
  164. package/dist/types/__VUE/list/index.d.ts +48 -0
  165. package/dist/types/__VUE/menu/index.d.ts +51 -0
  166. package/dist/types/__VUE/menuitem/index.d.ts +77 -0
  167. package/dist/types/__VUE/navbar/index.d.ts +83 -0
  168. package/dist/types/__VUE/noticebar/index.d.ts +209 -0
  169. package/dist/types/__VUE/notify/index.d.ts +103 -0
  170. package/dist/types/__VUE/numberkeyboard/index.d.ts +124 -0
  171. package/dist/types/__VUE/oldpicker/Column.d.ts +96 -0
  172. package/dist/types/__VUE/oldpicker/commonProps.d.ts +22 -0
  173. package/dist/types/__VUE/oldpicker/index.d.ts +360 -0
  174. package/dist/types/__VUE/oldpicker/types.d.ts +24 -0
  175. package/dist/types/__VUE/overlay/index.d.ts +1614 -0
  176. package/dist/types/__VUE/pagination/index.d.ts +112 -0
  177. package/dist/types/__VUE/picker/Column.d.ts +90 -0
  178. package/dist/types/__VUE/picker/index.d.ts +343 -0
  179. package/dist/types/__VUE/picker/types.d.ts +26 -0
  180. package/dist/types/__VUE/popover/index.d.ts +233 -0
  181. package/dist/types/__VUE/popup/index.d.ts +1734 -0
  182. package/dist/types/__VUE/popup/use-lock-scroll.d.ts +5 -0
  183. package/dist/types/__VUE/price/index.d.ts +87 -0
  184. package/dist/types/__VUE/progress/index.d.ts +138 -0
  185. package/dist/types/__VUE/pullrefresh/index.d.ts +128 -0
  186. package/dist/types/__VUE/pullrefresh/use-touch.d.ts +20 -0
  187. package/dist/types/__VUE/pullrefresh/util.d.ts +6 -0
  188. package/dist/types/__VUE/radio/index.d.ts +90 -0
  189. package/dist/types/__VUE/radiogroup/index.d.ts +48 -0
  190. package/dist/types/__VUE/range/index.d.ts +156 -0
  191. package/dist/types/__VUE/rate/index.d.ts +142 -0
  192. package/dist/types/__VUE/row/index.d.ts +63 -0
  193. package/dist/types/__VUE/searchbar/index.d.ts +100 -0
  194. package/dist/types/__VUE/shortpassword/index.d.ts +137 -0
  195. package/dist/types/__VUE/sidenavbar/index.d.ts +36 -0
  196. package/dist/types/__VUE/sidenavbaritem/index.d.ts +41 -0
  197. package/dist/types/__VUE/signature/index.d.ts +73 -0
  198. package/dist/types/__VUE/skeleton/common.d.ts +63 -0
  199. package/dist/types/__VUE/skeleton/index.d.ts +117 -0
  200. package/dist/types/__VUE/sku/components/SkuHeader.d.ts +27 -0
  201. package/dist/types/__VUE/sku/components/SkuOperate.d.ts +70 -0
  202. package/dist/types/__VUE/sku/components/SkuSelect.d.ts +30 -0
  203. package/dist/types/__VUE/sku/components/SkuStepper.d.ts +67 -0
  204. package/dist/types/__VUE/sku/index.d.ts +300 -0
  205. package/dist/types/__VUE/step/index.d.ts +70 -0
  206. package/dist/types/__VUE/steps/index.d.ts +47 -0
  207. package/dist/types/__VUE/sticky/index.d.ts +63 -0
  208. package/dist/types/__VUE/subsidenavbar/index.d.ts +54 -0
  209. package/dist/types/__VUE/swipe/index.d.ts +69 -0
  210. package/dist/types/__VUE/swiper/index.d.ts +163 -0
  211. package/dist/types/__VUE/swiper/use-touch.d.ts +20 -0
  212. package/dist/types/__VUE/swiperitem/index.d.ts +24 -0
  213. package/dist/types/__VUE/switch/index.d.ts +136 -0
  214. package/dist/types/__VUE/tabbar/index.d.ts +84 -0
  215. package/dist/types/__VUE/tabbaritem/index.d.ts +108 -0
  216. package/dist/types/__VUE/table/common.d.ts +55 -0
  217. package/dist/types/__VUE/table/index.d.ts +76 -0
  218. package/dist/types/__VUE/table/renderColumn.d.ts +20 -0
  219. package/dist/types/__VUE/table/types.d.ts +19 -0
  220. package/dist/types/__VUE/tabpane/index.d.ts +47 -0
  221. package/dist/types/__VUE/tabs/index.d.ts +128 -0
  222. package/dist/types/__VUE/tag/index.d.ts +89 -0
  223. package/dist/types/__VUE/textarea/index.d.ts +121 -0
  224. package/dist/types/__VUE/timedetail/index.d.ts +48 -0
  225. package/dist/types/__VUE/timepannel/index.d.ts +43 -0
  226. package/dist/types/__VUE/timeselect/index.d.ts +82 -0
  227. package/dist/types/__VUE/toast/index.d.ts +149 -0
  228. package/dist/types/__VUE/uploader/index.d.ts +258 -0
  229. package/dist/types/__VUE/uploader/uploader.d.ts +25 -0
  230. package/dist/types/__VUE/video/index.d.ts +123 -0
  231. package/dist/{index.d.ts → types/index.d.ts} +0 -0
  232. package/dist/types/nutui.d.ts +93 -0
  233. package/package.json +14 -5
  234. package/dist/nutui.d.ts +0 -104
  235. package/dist/packages/_es/use-lock-scroll.js +0 -23
  236. package/dist/packages/_es/util.js +0 -47
@@ -1,11 +1,10 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.19-beta.4 Tue Apr 12 2022 17:39:20 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
- import { ref, computed, onMounted, resolveComponent, openBlock, createElementBlock, createElementVNode, normalizeClass, normalizeStyle, toDisplayString, createCommentVNode, createBlock } from "vue";
6
+ import { useSlots, ref, computed, onMounted, resolveComponent, openBlock, createElementBlock, createElementVNode, normalizeClass, normalizeStyle, toDisplayString, createCommentVNode, renderSlot, createBlock } from "vue";
7
7
  import { c as createComponent } from "./component.js";
8
- import { eventCenter, getCurrentInstance } from "@tarojs/taro";
9
8
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
10
9
  const { create } = createComponent("progress");
11
10
  const _sfc_main = create({
@@ -21,7 +20,7 @@ const _sfc_main = create({
21
20
  },
22
21
  status: {
23
22
  type: String,
24
- default: "text"
23
+ default: ""
25
24
  },
26
25
  strokeWidth: {
27
26
  type: [Number, String],
@@ -61,11 +60,10 @@ const _sfc_main = create({
61
60
  }
62
61
  },
63
62
  setup(props, { emit }) {
63
+ const slotDefault = !!useSlots().default;
64
64
  const height = ref(props.strokeWidth + "px");
65
65
  const progressOuter = ref();
66
66
  const insideText = ref();
67
- const refRandomId = Math.random().toString(36).slice(-8);
68
- const randRef = ref(refRandomId);
69
67
  const bgStyle = computed(() => {
70
68
  return {
71
69
  width: props.percentage + "%",
@@ -78,8 +76,6 @@ const _sfc_main = create({
78
76
  };
79
77
  });
80
78
  onMounted(() => {
81
- eventCenter.once(getCurrentInstance().router.onReady, () => {
82
- });
83
79
  });
84
80
  return {
85
81
  height,
@@ -87,19 +83,16 @@ const _sfc_main = create({
87
83
  textStyle,
88
84
  progressOuter,
89
85
  insideText,
90
- randRef
86
+ slotDefault
91
87
  };
92
88
  }
93
89
  });
94
90
  const _hoisted_1 = { class: "nut-progress" };
95
- const _hoisted_2 = ["id"];
96
- const _hoisted_3 = ["id"];
97
91
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
98
92
  const _component_nut_icon = resolveComponent("nut-icon");
99
93
  return openBlock(), createElementBlock("div", _hoisted_1, [
100
94
  createElementVNode("div", {
101
95
  class: normalizeClass(["nut-progress-outer", [_ctx.showText && !_ctx.textInside ? "nut-progress-outer-part" : "", _ctx.size ? "nut-progress-" + _ctx.size : ""]]),
102
- id: "nut-progress-outer-taro-" + _ctx.randRef,
103
96
  ref: "progressOuter",
104
97
  style: normalizeStyle({ height: _ctx.height })
105
98
  }, [
@@ -107,11 +100,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
107
100
  class: normalizeClass(["nut-progress-inner", _ctx.status == "active" ? "nut-active" : ""]),
108
101
  style: normalizeStyle(_ctx.bgStyle)
109
102
  }, [
110
- _ctx.showText && _ctx.textInside ? (openBlock(), createElementBlock("div", {
103
+ _ctx.showText && _ctx.textInside && !_ctx.slotDefault ? (openBlock(), createElementBlock("div", {
111
104
  key: 0,
112
105
  class: "nut-progress-text nut-progress-insidetext",
113
106
  ref: "insideText",
114
- id: "nut-progress-insidetext-taro-" + _ctx.randRef,
115
107
  style: normalizeStyle({
116
108
  lineHeight: _ctx.height,
117
109
  left: `${_ctx.percentage}%`,
@@ -122,15 +114,27 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
122
114
  createElementVNode("span", {
123
115
  style: normalizeStyle(_ctx.textStyle)
124
116
  }, toDisplayString(_ctx.percentage) + toDisplayString(_ctx.isShowPercentage ? "%" : ""), 5)
125
- ], 12, _hoisted_3)) : createCommentVNode("", true)
117
+ ], 4)) : createCommentVNode("", true),
118
+ _ctx.showText && _ctx.textInside && _ctx.slotDefault ? (openBlock(), createElementBlock("div", {
119
+ key: 1,
120
+ ref: "insideText",
121
+ style: normalizeStyle({
122
+ position: `absolute`,
123
+ top: `50%`,
124
+ left: `${_ctx.percentage}%`,
125
+ transform: `translate(-${+_ctx.percentage}%,-50%)`
126
+ })
127
+ }, [
128
+ renderSlot(_ctx.$slots, "default")
129
+ ], 4)) : createCommentVNode("", true)
126
130
  ], 6)
127
- ], 14, _hoisted_2),
131
+ ], 6),
128
132
  _ctx.showText && !_ctx.textInside ? (openBlock(), createElementBlock("div", {
129
133
  key: 0,
130
134
  class: "nut-progress-text",
131
135
  style: normalizeStyle({ lineHeight: _ctx.height })
132
136
  }, [
133
- _ctx.status == "text" || _ctx.status == "active" ? (openBlock(), createElementBlock("span", {
137
+ _ctx.status == "active" || _ctx.status == "" ? (openBlock(), createElementBlock("span", {
134
138
  key: 0,
135
139
  style: normalizeStyle(_ctx.textStyle)
136
140
  }, toDisplayString(_ctx.percentage) + toDisplayString(_ctx.isShowPercentage ? "%" : ""), 5)) : _ctx.status == "icon" ? (openBlock(), createBlock(_component_nut_icon, {
@@ -142,5 +146,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
142
146
  ], 4)) : createCommentVNode("", true)
143
147
  ]);
144
148
  }
145
- var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
146
- export { index_taro as default };
149
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
150
+ export { index as default };
@@ -15,7 +15,7 @@ var __spreadValues = (a, b) => {
15
15
  return a;
16
16
  };
17
17
  /*!
18
- * @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
18
+ * @nutui/nutui v3.1.19-beta.4 Tue Apr 12 2022 17:39:20 GMT+0800 (中国标准时间)
19
19
  * (c) 2022 @jdf2e.
20
20
  * Released under the MIT License.
21
21
  */
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.19-beta.4 Tue Apr 12 2022 17:39:20 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
6
  import { inject, computed, h } from "vue";
7
- import _sfc_main$1 from "./Icon.js";
8
7
  import { c as createComponent } from "./component.js";
8
+ import _sfc_main$1 from "./Icon.js";
9
9
  import "./pxCheck.js";
10
10
  const { componentName, create } = createComponent("radio");
11
11
  const _sfc_main = create({
@@ -33,6 +33,14 @@ const _sfc_main = create({
33
33
  iconSize: {
34
34
  type: [String, Number],
35
35
  default: ""
36
+ },
37
+ iconClassPrefix: {
38
+ type: String,
39
+ default: "nut-icon"
40
+ },
41
+ iconFontClassName: {
42
+ type: String,
43
+ default: "nutui-iconfont"
36
44
  }
37
45
  },
38
46
  setup(props, { emit, slots }) {
@@ -47,11 +55,13 @@ const _sfc_main = create({
47
55
  return parent.position;
48
56
  });
49
57
  const renderIcon = () => {
50
- const { iconName, iconSize, iconActiveName } = props;
58
+ const { iconName, iconSize, iconActiveName, iconClassPrefix, iconFontClassName } = props;
51
59
  return h(_sfc_main$1, {
52
60
  name: isCurValue.value ? iconActiveName : iconName,
53
61
  size: iconSize,
54
- class: color.value
62
+ class: color.value,
63
+ classPrefix: iconClassPrefix,
64
+ fontClassName: iconFontClassName
55
65
  });
56
66
  };
57
67
  const renderLabel = () => {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.19-beta.4 Tue Apr 12 2022 17:39:20 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -18,15 +18,14 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  /*!
21
- * @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
21
+ * @nutui/nutui v3.1.19-beta.4 Tue Apr 12 2022 17:39:20 GMT+0800 (中国标准时间)
22
22
  * (c) 2022 @jdf2e.
23
23
  * Released under the MIT License.
24
24
  */
25
- import Taro from "@tarojs/taro";
26
25
  import { ref, computed, toRefs, openBlock, createElementBlock, normalizeClass, toDisplayString, createCommentVNode, createElementVNode, normalizeStyle, withModifiers, Fragment, renderList, createTextVNode, renderSlot } from "vue";
27
26
  import { c as createComponent } from "./component.js";
28
- import { u as useTouch } from "./index3.js";
29
- import { u as useTaroRect } from "./index.js";
27
+ import { u as useTouch } from "./index4.js";
28
+ import { u as useRect } from "./index2.js";
30
29
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
31
30
  const { componentName, create } = createComponent("range");
32
31
  const _sfc_main = create({
@@ -215,18 +214,16 @@ const _sfc_main = create({
215
214
  emit("change", value);
216
215
  }
217
216
  };
218
- const onClick = async (event) => {
217
+ const onClick = (event) => {
219
218
  if (props.disabled) {
220
219
  return;
221
220
  }
222
221
  const { min, modelValue } = props;
223
- const rect = await useTaroRect(root, Taro);
224
- let delta = event.touches[0].clientX - rect.left;
222
+ const rect = useRect(root);
223
+ let delta = event.clientX - rect.left;
225
224
  let total = rect.width;
226
- console.log(delta);
227
- console.log(total);
228
225
  if (props.vertical) {
229
- delta = event.touches[0].clientY - rect.top;
226
+ delta = event.clientY - rect.top;
230
227
  total = rect.height;
231
228
  }
232
229
  const value = Number(min) + delta / total * scope.value;
@@ -254,10 +251,8 @@ const _sfc_main = create({
254
251
  startValue = format(currentValue);
255
252
  }
256
253
  dragStatus.value = "start";
257
- event.stopPropagation();
258
- event.preventDefault();
259
254
  };
260
- const onTouchMove = async (event) => {
255
+ const onTouchMove = (event) => {
261
256
  if (props.disabled) {
262
257
  return;
263
258
  }
@@ -266,7 +261,7 @@ const _sfc_main = create({
266
261
  }
267
262
  touch.move(event);
268
263
  dragStatus.value = "draging";
269
- const rect = await useTaroRect(root, Taro);
264
+ const rect = useRect(root);
270
265
  let delta = touch.deltaX.value;
271
266
  let total = rect.width;
272
267
  let diff = delta / total * scope.value;
@@ -284,7 +279,7 @@ const _sfc_main = create({
284
279
  event.stopPropagation();
285
280
  event.preventDefault();
286
281
  };
287
- const onTouchEnd = (event) => {
282
+ const onTouchEnd = () => {
288
283
  if (props.disabled) {
289
284
  return;
290
285
  }
@@ -293,14 +288,11 @@ const _sfc_main = create({
293
288
  emit("drag-end");
294
289
  }
295
290
  dragStatus.value = "";
296
- event.stopPropagation();
297
- event.preventDefault();
298
291
  };
299
292
  const curValue = (idx) => {
300
293
  const value = typeof idx === "number" ? props.modelValue[idx] : props.modelValue;
301
294
  return value;
302
295
  };
303
- const refRandomId = Math.random().toString(36).slice(-8);
304
296
  return __spreadProps(__spreadValues({
305
297
  root,
306
298
  classes,
@@ -318,8 +310,7 @@ const _sfc_main = create({
318
310
  markClassName,
319
311
  marksStyle,
320
312
  marksList,
321
- tickStyle,
322
- refRandomId
313
+ tickStyle
323
314
  });
324
315
  }
325
316
  });
@@ -327,22 +318,21 @@ const _hoisted_1 = {
327
318
  key: 0,
328
319
  class: "min"
329
320
  };
330
- const _hoisted_2 = ["id"];
331
- const _hoisted_3 = {
321
+ const _hoisted_2 = {
332
322
  key: 0,
333
323
  class: "nut-range-mark"
334
324
  };
335
- const _hoisted_4 = ["tabindex", "aria-valuemin", "aria-valuenow", "aria-valuemax", "onTouchstart"];
336
- const _hoisted_5 = {
325
+ const _hoisted_3 = ["tabindex", "aria-valuemin", "aria-valuenow", "aria-valuemax", "onTouchstart"];
326
+ const _hoisted_4 = {
337
327
  key: 0,
338
328
  class: "number"
339
329
  };
340
- const _hoisted_6 = ["tabindex", "aria-valuemin", "aria-valuenow", "aria-valuemax"];
341
- const _hoisted_7 = {
330
+ const _hoisted_5 = ["tabindex", "aria-valuemin", "aria-valuenow", "aria-valuemax"];
331
+ const _hoisted_6 = {
342
332
  key: 0,
343
333
  class: "number"
344
334
  };
345
- const _hoisted_8 = {
335
+ const _hoisted_7 = {
346
336
  key: 1,
347
337
  class: "max"
348
338
  };
@@ -353,12 +343,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
353
343
  !_ctx.hiddenRange ? (openBlock(), createElementBlock("view", _hoisted_1, toDisplayString(+_ctx.min), 1)) : createCommentVNode("", true),
354
344
  createElementVNode("view", {
355
345
  ref: "root",
356
- id: "root-" + _ctx.refRandomId,
357
346
  style: normalizeStyle(_ctx.wrapperStyle),
358
347
  class: normalizeClass(_ctx.classes),
359
348
  onClick: _cache[9] || (_cache[9] = withModifiers((...args) => _ctx.onClick && _ctx.onClick(...args), ["stop"]))
360
349
  }, [
361
- _ctx.marksList.length > 0 ? (openBlock(), createElementBlock("view", _hoisted_3, [
350
+ _ctx.marksList.length > 0 ? (openBlock(), createElementBlock("view", _hoisted_2, [
362
351
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.marksList, (marks) => {
363
352
  return openBlock(), createElementBlock("span", {
364
353
  key: marks,
@@ -377,23 +366,22 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
377
366
  class: "nut-range-bar",
378
367
  style: normalizeStyle(_ctx.barStyle)
379
368
  }, [
380
- _ctx.range ? (openBlock(), createElementBlock(Fragment, { key: 0 }, renderList([0, 1], (index) => {
369
+ _ctx.range ? (openBlock(), createElementBlock(Fragment, { key: 0 }, renderList([0, 1], (index2) => {
381
370
  return createElementVNode("view", {
382
- key: index,
371
+ key: index2,
383
372
  role: "slider",
384
373
  class: normalizeClass({
385
- "nut-range-button-wrapper-left": index == 0,
386
- "nut-range-button-wrapper-right": index == 1
374
+ "nut-range-button-wrapper-left": index2 == 0,
375
+ "nut-range-button-wrapper-right": index2 == 1
387
376
  }),
388
- "catch-move": true,
389
377
  tabindex: _ctx.disabled ? -1 : 0,
390
378
  "aria-valuemin": +_ctx.min,
391
- "aria-valuenow": _ctx.curValue(index),
379
+ "aria-valuenow": _ctx.curValue(index2),
392
380
  "aria-valuemax": +_ctx.max,
393
381
  "aria-orientation": "horizontal",
394
382
  onTouchstart: withModifiers((e) => {
395
- if (typeof index === "number") {
396
- _ctx.buttonIndex = index;
383
+ if (typeof index2 === "number") {
384
+ _ctx.buttonIndex = index2;
397
385
  }
398
386
  _ctx.onTouchStart(e);
399
387
  }, ["stop", "prevent"]),
@@ -407,9 +395,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
407
395
  class: "nut-range-button",
408
396
  style: normalizeStyle(_ctx.buttonStyle)
409
397
  }, [
410
- !_ctx.hiddenTag ? (openBlock(), createElementBlock("view", _hoisted_5, toDisplayString(_ctx.curValue(index)), 1)) : createCommentVNode("", true)
398
+ !_ctx.hiddenTag ? (openBlock(), createElementBlock("view", _hoisted_4, toDisplayString(_ctx.curValue(index2)), 1)) : createCommentVNode("", true)
411
399
  ], 4))
412
- ], 42, _hoisted_4);
400
+ ], 42, _hoisted_3);
413
401
  }), 64)) : (openBlock(), createElementBlock("view", {
414
402
  key: 1,
415
403
  role: "slider",
@@ -419,7 +407,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
419
407
  "aria-valuenow": _ctx.curValue(),
420
408
  "aria-valuemax": +_ctx.max,
421
409
  "aria-orientation": "horizontal",
422
- "catch-move": true,
423
410
  onTouchstart: _cache[4] || (_cache[4] = withModifiers((e) => {
424
411
  _ctx.onTouchStart(e);
425
412
  }, ["stop", "prevent"])),
@@ -433,13 +420,13 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
433
420
  class: "nut-range-button",
434
421
  style: normalizeStyle(_ctx.buttonStyle)
435
422
  }, [
436
- !_ctx.hiddenTag ? (openBlock(), createElementBlock("view", _hoisted_7, toDisplayString(_ctx.curValue()), 1)) : createCommentVNode("", true)
423
+ !_ctx.hiddenTag ? (openBlock(), createElementBlock("view", _hoisted_6, toDisplayString(_ctx.curValue()), 1)) : createCommentVNode("", true)
437
424
  ], 4))
438
- ], 40, _hoisted_6))
425
+ ], 40, _hoisted_5))
439
426
  ], 4)
440
- ], 14, _hoisted_2),
441
- !_ctx.hiddenRange ? (openBlock(), createElementBlock("view", _hoisted_8, toDisplayString(+_ctx.max), 1)) : createCommentVNode("", true)
427
+ ], 6),
428
+ !_ctx.hiddenRange ? (openBlock(), createElementBlock("view", _hoisted_7, toDisplayString(+_ctx.max), 1)) : createCommentVNode("", true)
442
429
  ], 2);
443
430
  }
444
- var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
445
- export { index_taro as default };
431
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
432
+ export { index as default };
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.19-beta.4 Tue Apr 12 2022 17:39:20 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -71,16 +71,20 @@ const _sfc_main = create({
71
71
  [prefixCls]: true
72
72
  };
73
73
  });
74
- const onClick = (e, index) => {
74
+ const onClick = (e, index2) => {
75
+ e.preventDefault();
76
+ e.stopPropagation();
75
77
  if (props.disabled || props.readonly)
76
78
  return;
77
79
  let value = 0;
78
- if (index === 1 && props.modelValue === index)
80
+ if (index2 === 1 && props.modelValue === index2)
79
81
  ;
80
82
  else {
81
- value = index;
82
- if (props.allowHalf && e == 2) {
83
- value -= 0.5;
83
+ value = index2;
84
+ if (props.allowHalf) {
85
+ if ((e == null ? void 0 : e.target).className.includes("__icon--half")) {
86
+ value -= 0.5;
87
+ }
84
88
  }
85
89
  }
86
90
  emit("update:modelValue", value);
@@ -93,6 +97,7 @@ const _sfc_main = create({
93
97
  };
94
98
  }
95
99
  });
100
+ const _hoisted_1 = ["onClick"];
96
101
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
97
102
  const _component_nut_icon = resolveComponent("nut-icon");
98
103
  return openBlock(), createElementBlock("view", {
@@ -102,39 +107,37 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
102
107
  return openBlock(), createElementBlock("view", {
103
108
  class: "nut-rate-item",
104
109
  key: n,
110
+ onClick: ($event) => _ctx.onClick($event, n),
105
111
  style: normalizeStyle({ marginRight: _ctx.pxCheck(_ctx.spacing) })
106
112
  }, [
107
113
  createVNode(_component_nut_icon, {
108
114
  size: _ctx.iconSize,
109
115
  class: normalizeClass(["nut-rate-item__icon", { "nut-rate-item__icon--disabled": _ctx.disabled || n > _ctx.modelValue }]),
110
- onClick: ($event) => _ctx.onClick(1, n),
111
- color: n <= _ctx.modelValue ? _ctx.activeColor : _ctx.voidColor,
112
116
  "font-class-name": _ctx.fontClassName,
113
117
  "class-prefix": _ctx.classPrefix,
118
+ color: n <= _ctx.modelValue ? _ctx.activeColor : _ctx.voidColor,
114
119
  name: n <= _ctx.modelValue ? _ctx.checkedIcon : _ctx.uncheckedIcon
115
- }, null, 8, ["size", "onClick", "class", "color", "font-class-name", "class-prefix", "name"]),
120
+ }, null, 8, ["size", "class", "font-class-name", "class-prefix", "color", "name"]),
116
121
  _ctx.allowHalf && _ctx.modelValue + 1 > n ? (openBlock(), createBlock(_component_nut_icon, {
117
122
  key: 0,
118
123
  class: "nut-rate-item__icon nut-rate-item__icon--half",
119
- onClick: ($event) => _ctx.onClick(2, n),
120
124
  "font-class-name": _ctx.fontClassName,
121
125
  "class-prefix": _ctx.classPrefix,
122
126
  color: n <= _ctx.modelValue + 1 ? _ctx.activeColor : _ctx.voidColor,
123
127
  size: _ctx.iconSize,
124
128
  name: _ctx.checkedIcon
125
- }, null, 8, ["onClick", "font-class-name", "class-prefix", "color", "size", "name"])) : _ctx.allowHalf && _ctx.modelValue + 1 < n ? (openBlock(), createBlock(_component_nut_icon, {
129
+ }, null, 8, ["font-class-name", "class-prefix", "color", "size", "name"])) : _ctx.allowHalf && _ctx.modelValue + 1 < n ? (openBlock(), createBlock(_component_nut_icon, {
126
130
  key: 1,
127
131
  class: "nut-rate-item__icon nut-rate-item__icon--disabled nut-rate-item__icon--half",
128
- onClick: ($event) => _ctx.onClick(2, n),
129
132
  "font-class-name": _ctx.fontClassName,
130
133
  "class-prefix": _ctx.classPrefix,
131
134
  color: _ctx.voidColor,
132
135
  size: _ctx.iconSize,
133
136
  name: _ctx.uncheckedIcon
134
- }, null, 8, ["onClick", "font-class-name", "class-prefix", "color", "size", "name"])) : createCommentVNode("", true)
135
- ], 4);
137
+ }, null, 8, ["font-class-name", "class-prefix", "color", "size", "name"])) : createCommentVNode("", true)
138
+ ], 12, _hoisted_1);
136
139
  }), 128))
137
140
  ], 2);
138
141
  }
139
- var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
140
- export { index_taro as default };
142
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
143
+ export { index as default };
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.19-beta.4 Tue Apr 12 2022 17:39:20 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -18,14 +18,14 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  /*!
21
- * @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
21
+ * @nutui/nutui v3.1.19-beta.4 Tue Apr 12 2022 17:39:20 GMT+0800 (中国标准时间)
22
22
  * (c) 2022 @jdf2e.
23
23
  * Released under the MIT License.
24
24
  */
25
25
  import { reactive, computed, toRefs, resolveComponent, openBlock, createElementBlock, normalizeStyle, renderSlot, createCommentVNode, createElementVNode, withModifiers, withDirectives, createVNode, vShow } from "vue";
26
26
  import { c as createComponent } from "./component.js";
27
27
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
28
- const { create } = createComponent("searchbar");
28
+ const { create, translate } = createComponent("searchbar");
29
29
  const _sfc_main = create({
30
30
  props: {
31
31
  modelValue: {
@@ -42,7 +42,7 @@ const _sfc_main = create({
42
42
  },
43
43
  placeholder: {
44
44
  type: String,
45
- default: "\u8BF7\u8F93\u5165"
45
+ default: ""
46
46
  },
47
47
  clearable: {
48
48
  type: Boolean,
@@ -113,7 +113,8 @@ const _sfc_main = create({
113
113
  handleClear,
114
114
  handleSubmit,
115
115
  searchbarStyle,
116
- inputSearchbarStyle
116
+ inputSearchbarStyle,
117
+ translate
117
118
  });
118
119
  }
119
120
  });
@@ -154,24 +155,22 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
154
155
  createElementVNode("view", _hoisted_3, [
155
156
  createElementVNode("form", {
156
157
  action: "#",
157
- onsubmit: "return false",
158
- onSubmit: _cache[4] || (_cache[4] = withModifiers((...args) => _ctx.handleSubmit && _ctx.handleSubmit(...args), ["prevent"]))
158
+ onSubmit: _cache[3] || (_cache[3] = withModifiers((...args) => _ctx.handleSubmit && _ctx.handleSubmit(...args), ["prevent"]))
159
159
  }, [
160
160
  createElementVNode("input", {
161
161
  class: "nut-searchbar__input-bar",
162
162
  type: _ctx.inputType,
163
163
  maxlength: _ctx.maxLength,
164
- placeholder: _ctx.placeholder,
164
+ placeholder: _ctx.placeholder || _ctx.translate("placeholder"),
165
165
  value: _ctx.modelValue,
166
166
  onInput: _cache[0] || (_cache[0] = (...args) => _ctx.valueChange && _ctx.valueChange(...args)),
167
167
  onFocus: _cache[1] || (_cache[1] = (...args) => _ctx.valueFocus && _ctx.valueFocus(...args)),
168
- onBlur: _cache[2] || (_cache[2] = (...args) => _ctx.valueBlur && _ctx.valueBlur(...args)),
169
- onConfirm: _cache[3] || (_cache[3] = (...args) => _ctx.handleSubmit && _ctx.handleSubmit(...args))
168
+ onBlur: _cache[2] || (_cache[2] = (...args) => _ctx.valueBlur && _ctx.valueBlur(...args))
170
169
  }, null, 40, _hoisted_4)
171
170
  ], 32),
172
171
  _ctx.clearable ? withDirectives((openBlock(), createElementBlock("view", {
173
172
  key: 0,
174
- onClick: _cache[5] || (_cache[5] = (...args) => _ctx.handleClear && _ctx.handleClear(...args)),
173
+ onClick: _cache[4] || (_cache[4] = (...args) => _ctx.handleClear && _ctx.handleClear(...args)),
175
174
  class: "nut-searchbar__input-clear"
176
175
  }, [
177
176
  createVNode(_component_nut_icon, {
@@ -192,5 +191,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
192
191
  ])) : createCommentVNode("", true)
193
192
  ], 4);
194
193
  }
195
- var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
196
- export { index_taro as default };
194
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
195
+ export { index as default };