@nutui/nutui 3.1.18-beta.0 → 3.1.19-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 (149) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/LICENSE +1 -1
  3. package/README.md +6 -0
  4. package/dist/nutui.d.ts +39 -36
  5. package/dist/nutui.es.js +13149 -11288
  6. package/dist/nutui.umd.js +13156 -11381
  7. package/dist/packages/_es/ActionSheet.js +13 -19
  8. package/dist/packages/_es/Address.js +70 -55
  9. package/dist/packages/_es/Audio.js +13 -13
  10. package/dist/packages/_es/AudioOperate.js +125 -0
  11. package/dist/packages/_es/Avatar.js +4 -4
  12. package/dist/packages/_es/BackTop.js +69 -108
  13. package/dist/packages/_es/Badge.js +4 -4
  14. package/dist/packages/_es/Barrage.js +63 -56
  15. package/dist/packages/_es/Button.js +3 -3
  16. package/dist/packages/_es/Calendar.js +30 -702
  17. package/dist/packages/_es/CalendarItem.js +10 -0
  18. package/dist/packages/_es/Card.js +7 -6
  19. package/dist/packages/_es/Cascader.js +8 -8
  20. package/dist/packages/_es/Cell.js +27 -27
  21. package/dist/packages/_es/CellGroup.js +2 -2
  22. package/dist/packages/_es/Checkbox.js +4 -4
  23. package/dist/packages/_es/CheckboxGroup.js +3 -3
  24. package/dist/packages/_es/CircleProgress.js +150 -41
  25. package/dist/packages/_es/Col.js +2 -2
  26. package/dist/packages/_es/Collapse.js +35 -9
  27. package/dist/packages/_es/CollapseItem.js +79 -38
  28. package/dist/packages/_es/CountDown.js +8 -6
  29. package/dist/packages/_es/CountUp.js +31 -30
  30. package/dist/packages/_es/DatePicker.js +81 -44
  31. package/dist/packages/_es/Dialog.js +7 -83
  32. package/dist/packages/_es/Divider.js +5 -5
  33. package/dist/packages/_es/Drag.js +93 -55
  34. package/dist/packages/_es/Elevator.js +75 -50
  35. package/dist/packages/_es/Empty.js +4 -4
  36. package/dist/packages/_es/FixedNav.js +6 -6
  37. package/dist/packages/_es/Form.js +11 -9
  38. package/dist/packages/_es/FormItem.js +9 -6
  39. package/dist/packages/_es/Grid.js +2 -2
  40. package/dist/packages/_es/GridItem.js +9 -27
  41. package/dist/packages/_es/Icon.js +2 -2
  42. package/dist/packages/_es/ImagePreview.js +14 -83
  43. package/dist/packages/_es/Indicator.js +4 -4
  44. package/dist/packages/_es/InfiniteLoading.js +94 -108
  45. package/dist/packages/_es/Input.js +297 -73
  46. package/dist/packages/_es/InputNumber.js +24 -17
  47. package/dist/packages/_es/Layout.js +2 -2
  48. package/dist/packages/_es/List.js +131 -0
  49. package/dist/packages/_es/Menu.js +16 -13
  50. package/dist/packages/_es/MenuItem.js +8 -8
  51. package/dist/packages/_es/Navbar.js +17 -12
  52. package/dist/packages/_es/NoticeBar.js +47 -39
  53. package/dist/packages/_es/Notify.js +28 -163
  54. package/dist/packages/_es/NumberKeyboard.js +4 -4
  55. package/dist/packages/_es/OldPicker.js +486 -0
  56. package/dist/packages/_es/OverLay.js +6 -26
  57. package/dist/packages/_es/Pagination.js +8 -8
  58. package/dist/packages/_es/Picker.js +192 -163
  59. package/dist/packages/_es/Popover.js +155 -30
  60. package/dist/packages/_es/Popup.js +7 -70
  61. package/dist/packages/_es/Price.js +18 -6
  62. package/dist/packages/_es/Progress.js +29 -27
  63. package/dist/packages/_es/PullRefresh.js +363 -0
  64. package/dist/packages/_es/Radio.js +4 -4
  65. package/dist/packages/_es/RadioGroup.js +2 -2
  66. package/dist/packages/_es/Range.js +169 -46
  67. package/dist/packages/_es/Rate.js +17 -20
  68. package/dist/packages/_es/Row.js +2 -2
  69. package/dist/packages/_es/SearchBar.js +9 -7
  70. package/dist/packages/_es/ShortPassword.js +90 -68
  71. package/dist/packages/_es/SideNavBar.js +6 -17
  72. package/dist/packages/_es/SideNavBarItem.js +2 -2
  73. package/dist/packages/_es/Signature.js +70 -70
  74. package/dist/packages/_es/Skeleton.js +9 -12
  75. package/dist/packages/_es/Sku.js +40 -31
  76. package/dist/packages/_es/Step.js +28 -12
  77. package/dist/packages/_es/Steps.js +8 -3
  78. package/dist/packages/_es/Sticky.js +29 -24
  79. package/dist/packages/_es/SubSideNavBar.js +2 -2
  80. package/dist/packages/_es/Swipe.js +40 -27
  81. package/dist/packages/_es/Swiper.js +32 -14
  82. package/dist/packages/_es/SwiperItem.js +2 -2
  83. package/dist/packages/_es/Switch.js +4 -4
  84. package/dist/packages/_es/TabPane.js +2 -2
  85. package/dist/packages/_es/Tabbar.js +4 -4
  86. package/dist/packages/_es/TabbarItem.js +28 -23
  87. package/dist/packages/_es/Table.js +14 -14
  88. package/dist/packages/_es/Tabs.js +19 -15
  89. package/dist/packages/_es/Tag.js +14 -8
  90. package/dist/packages/_es/TextArea.js +49 -15
  91. package/dist/packages/_es/TimeDetail.js +5 -4
  92. package/dist/packages/_es/TimePannel.js +4 -4
  93. package/dist/packages/_es/TimeSelect.js +9 -8
  94. package/dist/packages/_es/Toast.js +42 -171
  95. package/dist/packages/_es/Uploader.js +108 -139
  96. package/dist/packages/_es/Video.js +14 -10
  97. package/dist/packages/_es/common.js +2 -2
  98. package/dist/packages/_es/component.js +2 -2
  99. package/dist/packages/_es/index.js +45 -7
  100. package/dist/packages/_es/index.taro.js +719 -0
  101. package/dist/packages/_es/index2.js +2 -2
  102. package/dist/packages/_es/index3.js +57 -29
  103. package/dist/packages/_es/index4.js +414 -57
  104. package/dist/packages/_es/plugin-vue_export-helper.js +2 -2
  105. package/dist/packages/_es/pxCheck.js +2 -2
  106. package/dist/packages/_es/use-lock-scroll.js +23 -0
  107. package/dist/packages/_es/util.js +2 -2
  108. package/dist/packages/badge/index.scss +11 -13
  109. package/dist/packages/button/index.scss +1 -0
  110. package/dist/packages/calendar/index.scss +9 -4
  111. package/dist/packages/calendaritem/index.scss +0 -207
  112. package/dist/packages/cell/index.scss +6 -6
  113. package/dist/packages/checkbox/index.scss +4 -3
  114. package/dist/packages/collapseitem/index.scss +21 -11
  115. package/dist/packages/countdown/index.scss +3 -1
  116. package/dist/packages/divider/index.scss +8 -8
  117. package/dist/packages/elevator/index.scss +36 -36
  118. package/dist/packages/formitem/index.scss +15 -8
  119. package/dist/packages/indicator/index.scss +1 -1
  120. package/dist/packages/input/index.scss +70 -24
  121. package/dist/packages/inputnumber/index.scss +4 -2
  122. package/dist/packages/list/index.scss +24 -0
  123. package/dist/packages/menu/index.scss +3 -3
  124. package/dist/packages/navbar/index.scss +28 -8
  125. package/dist/packages/noticebar/index.scss +7 -8
  126. package/dist/packages/notify/index.scss +9 -0
  127. package/dist/packages/numberkeyboard/index.scss +22 -21
  128. package/dist/packages/oldpicker/index.scss +131 -0
  129. package/dist/packages/picker/index.scss +38 -32
  130. package/dist/packages/progress/index.scss +6 -5
  131. package/dist/packages/radio/index.scss +7 -6
  132. package/dist/packages/range/index.scss +109 -2
  133. package/dist/packages/searchbar/index.scss +7 -7
  134. package/dist/packages/sidenavbaritem/index.scss +5 -5
  135. package/dist/packages/step/index.scss +29 -29
  136. package/dist/packages/subsidenavbar/index.scss +10 -8
  137. package/dist/packages/tabbaritem/index.scss +15 -0
  138. package/dist/packages/timedetail/index.scss +13 -13
  139. package/dist/packages/timepannel/index.scss +7 -7
  140. package/dist/packages/timeselect/index.scss +3 -3
  141. package/dist/packages/uploader/index.scss +6 -6
  142. package/dist/style.css +1 -1
  143. package/dist/styles/themes/default.scss +64 -62
  144. package/dist/styles/themes/jdt.scss +91 -0
  145. package/dist/styles/variables-jdt.scss +728 -0
  146. package/dist/styles/variables.scss +250 -44
  147. package/package.json +2 -1
  148. package/dist/packages/_es/raf.js +0 -19
  149. package/dist/styles/themes/jdd.scss +0 -2
@@ -18,14 +18,15 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  /*!
21
- * @nutui/nutui v3.1.18-beta.0 Tue Mar 08 2022 10:41:31 GMT+0800 (中国标准时间)
22
- * (c) 2021 @jdf2e.
21
+ * @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
22
+ * (c) 2022 @jdf2e.
23
23
  * Released under the MIT License.
24
24
  */
25
- import { ref, computed, toRefs, openBlock, createElementBlock, toDisplayString, createCommentVNode, createElementVNode, normalizeStyle, normalizeClass, withModifiers, Fragment, renderList, renderSlot } from "vue";
25
+ import Taro from "@tarojs/taro";
26
+ import { ref, computed, toRefs, openBlock, createElementBlock, normalizeClass, toDisplayString, createCommentVNode, createElementVNode, normalizeStyle, withModifiers, Fragment, renderList, createTextVNode, renderSlot } from "vue";
26
27
  import { c as createComponent } from "./component.js";
27
- import { u as useTouch } from "./index4.js";
28
- import { u as useRect } from "./index3.js";
28
+ import { u as useTouch } from "./index3.js";
29
+ import { u as useTaroRect } from "./index.js";
29
30
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
30
31
  const { componentName, create } = createComponent("range");
31
32
  const _sfc_main = create({
@@ -38,6 +39,14 @@ const _sfc_main = create({
38
39
  activeColor: String,
39
40
  inactiveColor: String,
40
41
  buttonColor: String,
42
+ vertical: {
43
+ type: Boolean,
44
+ default: false
45
+ },
46
+ marks: {
47
+ type: Object,
48
+ default: {}
49
+ },
41
50
  hiddenRange: {
42
51
  type: Boolean,
43
52
  default: false
@@ -71,15 +80,29 @@ const _sfc_main = create({
71
80
  const root = ref();
72
81
  const dragStatus = ref();
73
82
  const touch = useTouch();
83
+ const marksList = computed(() => {
84
+ const { marks, max, min } = props;
85
+ const marksKeys = Object.keys(marks);
86
+ const list = marksKeys.map(parseFloat).sort((a, b) => a - b).filter((point) => point >= min && point <= max);
87
+ return list;
88
+ });
74
89
  const scope = computed(() => Number(props.max) - Number(props.min));
75
90
  const classes = computed(() => {
76
91
  const prefixCls = componentName;
77
92
  return {
78
93
  [prefixCls]: true,
79
94
  [`${prefixCls}-disabled`]: props.disabled,
95
+ [`${prefixCls}-vertical`]: props.vertical,
80
96
  [`${prefixCls}-show-number`]: !props.hiddenRange
81
97
  };
82
98
  });
99
+ const containerClasses = computed(() => {
100
+ const prefixCls = "nut-range-container";
101
+ return {
102
+ [prefixCls]: true,
103
+ [`${prefixCls}-vertical`]: props.vertical
104
+ };
105
+ });
83
106
  const wrapperStyle = computed(() => {
84
107
  return {
85
108
  background: props.inactiveColor
@@ -106,13 +129,67 @@ const _sfc_main = create({
106
129
  return `0%`;
107
130
  };
108
131
  const barStyle = computed(() => {
132
+ if (props.vertical) {
133
+ return {
134
+ height: calcMainAxis(),
135
+ top: calcOffset(),
136
+ background: props.activeColor,
137
+ transition: dragStatus.value ? "none" : void 0
138
+ };
139
+ } else {
140
+ return {
141
+ width: calcMainAxis(),
142
+ left: calcOffset(),
143
+ background: props.activeColor,
144
+ transition: dragStatus.value ? "none" : void 0
145
+ };
146
+ }
147
+ });
148
+ const markClassName = (mark) => {
149
+ const classPrefix = "nut-range-mark";
150
+ const { modelValue, max, min } = props;
151
+ let lowerBound = Number(min);
152
+ let upperBound = Number(max);
153
+ if (props.range) {
154
+ const [left, right] = modelValue;
155
+ lowerBound = left;
156
+ upperBound = right;
157
+ } else {
158
+ upperBound = modelValue;
159
+ }
160
+ let isActive = mark <= upperBound && mark >= lowerBound;
109
161
  return {
110
- width: calcMainAxis(),
111
- left: calcOffset(),
112
- background: props.activeColor,
113
- transition: dragStatus.value ? "none" : void 0
162
+ [`${classPrefix}-text`]: true,
163
+ [`${classPrefix}-text-active`]: isActive
114
164
  };
115
- });
165
+ };
166
+ const marksStyle = (mark) => {
167
+ const { max, min, vertical } = props;
168
+ let style = {
169
+ left: `${(mark - Number(min)) / scope.value * 100}%`
170
+ };
171
+ if (vertical) {
172
+ style = {
173
+ top: `${(mark - Number(min)) / scope.value * 100}%`
174
+ };
175
+ }
176
+ return style;
177
+ };
178
+ const tickStyle = (mark) => {
179
+ const { modelValue, max, min } = props;
180
+ let lowerBound = Number(min);
181
+ let upperBound = Number(max);
182
+ if (props.range) {
183
+ const [left, right] = modelValue;
184
+ lowerBound = left;
185
+ upperBound = right;
186
+ }
187
+ let isActive = mark <= upperBound && mark >= lowerBound;
188
+ let style = {
189
+ background: !isActive ? props.inactiveColor : props.activeColor
190
+ };
191
+ return style;
192
+ };
116
193
  const format = (value) => {
117
194
  const { min, max, step } = props;
118
195
  value = Math.max(+min, Math.min(value, +max));
@@ -138,14 +215,20 @@ const _sfc_main = create({
138
215
  emit("change", value);
139
216
  }
140
217
  };
141
- const onClick = (event) => {
218
+ const onClick = async (event) => {
142
219
  if (props.disabled) {
143
220
  return;
144
221
  }
145
222
  const { min, modelValue } = props;
146
- const rect = useRect(root);
147
- const delta = event.clientX - rect.left;
148
- const total = rect.width;
223
+ const rect = await useTaroRect(root, Taro);
224
+ let delta = event.touches[0].clientX - rect.left;
225
+ let total = rect.width;
226
+ console.log(delta);
227
+ console.log(total);
228
+ if (props.vertical) {
229
+ delta = event.touches[0].clientY - rect.top;
230
+ total = rect.height;
231
+ }
149
232
  const value = Number(min) + delta / total * scope.value;
150
233
  if (isRange(modelValue)) {
151
234
  const [left, right] = modelValue;
@@ -171,8 +254,10 @@ const _sfc_main = create({
171
254
  startValue = format(currentValue);
172
255
  }
173
256
  dragStatus.value = "start";
257
+ event.stopPropagation();
258
+ event.preventDefault();
174
259
  };
175
- const onTouchMove = (event) => {
260
+ const onTouchMove = async (event) => {
176
261
  if (props.disabled) {
177
262
  return;
178
263
  }
@@ -181,10 +266,15 @@ const _sfc_main = create({
181
266
  }
182
267
  touch.move(event);
183
268
  dragStatus.value = "draging";
184
- const rect = useRect(root);
185
- const delta = touch.deltaX.value;
186
- const total = rect.width;
187
- const diff = delta / total * scope.value;
269
+ const rect = await useTaroRect(root, Taro);
270
+ let delta = touch.deltaX.value;
271
+ let total = rect.width;
272
+ let diff = delta / total * scope.value;
273
+ if (props.vertical) {
274
+ delta = touch.deltaY.value;
275
+ total = rect.height;
276
+ diff = delta / total * scope.value;
277
+ }
188
278
  if (isRange(startValue)) {
189
279
  currentValue[buttonIndex.value] = startValue[buttonIndex.value] + diff;
190
280
  } else {
@@ -194,7 +284,7 @@ const _sfc_main = create({
194
284
  event.stopPropagation();
195
285
  event.preventDefault();
196
286
  };
197
- const onTouchEnd = () => {
287
+ const onTouchEnd = (event) => {
198
288
  if (props.disabled) {
199
289
  return;
200
290
  }
@@ -203,11 +293,14 @@ const _sfc_main = create({
203
293
  emit("drag-end");
204
294
  }
205
295
  dragStatus.value = "";
296
+ event.stopPropagation();
297
+ event.preventDefault();
206
298
  };
207
299
  const curValue = (idx) => {
208
300
  const value = typeof idx === "number" ? props.modelValue[idx] : props.modelValue;
209
301
  return value;
210
302
  };
303
+ const refRandomId = Math.random().toString(36).slice(-8);
211
304
  return __spreadProps(__spreadValues({
212
305
  root,
213
306
  classes,
@@ -220,58 +313,87 @@ const _sfc_main = create({
220
313
  }, toRefs(props)), {
221
314
  barStyle,
222
315
  curValue,
223
- buttonIndex
316
+ buttonIndex,
317
+ containerClasses,
318
+ markClassName,
319
+ marksStyle,
320
+ marksList,
321
+ tickStyle,
322
+ refRandomId
224
323
  });
225
324
  }
226
325
  });
227
- const _hoisted_1 = { class: "nut-range-container" };
228
- const _hoisted_2 = {
326
+ const _hoisted_1 = {
229
327
  key: 0,
230
328
  class: "min"
231
329
  };
232
- const _hoisted_3 = ["tabindex", "aria-valuemin", "aria-valuenow", "aria-valuemax", "onTouchstart"];
233
- const _hoisted_4 = {
330
+ const _hoisted_2 = ["id"];
331
+ const _hoisted_3 = {
234
332
  key: 0,
235
- class: "number"
333
+ class: "nut-range-mark"
236
334
  };
237
- const _hoisted_5 = ["tabindex", "aria-valuemin", "aria-valuenow", "aria-valuemax"];
238
- const _hoisted_6 = {
335
+ const _hoisted_4 = ["tabindex", "aria-valuemin", "aria-valuenow", "aria-valuemax", "onTouchstart"];
336
+ const _hoisted_5 = {
239
337
  key: 0,
240
338
  class: "number"
241
339
  };
340
+ const _hoisted_6 = ["tabindex", "aria-valuemin", "aria-valuenow", "aria-valuemax"];
242
341
  const _hoisted_7 = {
342
+ key: 0,
343
+ class: "number"
344
+ };
345
+ const _hoisted_8 = {
243
346
  key: 1,
244
347
  class: "max"
245
348
  };
246
349
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
247
- return openBlock(), createElementBlock("view", _hoisted_1, [
248
- !_ctx.hiddenRange ? (openBlock(), createElementBlock("view", _hoisted_2, toDisplayString(+_ctx.min), 1)) : createCommentVNode("", true),
350
+ return openBlock(), createElementBlock("view", {
351
+ class: normalizeClass(_ctx.containerClasses)
352
+ }, [
353
+ !_ctx.hiddenRange ? (openBlock(), createElementBlock("view", _hoisted_1, toDisplayString(+_ctx.min), 1)) : createCommentVNode("", true),
249
354
  createElementVNode("view", {
250
355
  ref: "root",
356
+ id: "root-" + _ctx.refRandomId,
251
357
  style: normalizeStyle(_ctx.wrapperStyle),
252
358
  class: normalizeClass(_ctx.classes),
253
359
  onClick: _cache[9] || (_cache[9] = withModifiers((...args) => _ctx.onClick && _ctx.onClick(...args), ["stop"]))
254
360
  }, [
361
+ _ctx.marksList.length > 0 ? (openBlock(), createElementBlock("view", _hoisted_3, [
362
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.marksList, (marks) => {
363
+ return openBlock(), createElementBlock("span", {
364
+ key: marks,
365
+ class: normalizeClass(_ctx.markClassName(marks)),
366
+ style: normalizeStyle(_ctx.marksStyle(marks))
367
+ }, [
368
+ createTextVNode(toDisplayString(marks) + " ", 1),
369
+ createElementVNode("span", {
370
+ class: "nut-range-tick",
371
+ style: normalizeStyle(_ctx.tickStyle(marks))
372
+ }, null, 4)
373
+ ], 6);
374
+ }), 128))
375
+ ])) : createCommentVNode("", true),
255
376
  createElementVNode("view", {
256
377
  class: "nut-range-bar",
257
378
  style: normalizeStyle(_ctx.barStyle)
258
379
  }, [
259
- _ctx.range ? (openBlock(), createElementBlock(Fragment, { key: 0 }, renderList([0, 1], (index2) => {
380
+ _ctx.range ? (openBlock(), createElementBlock(Fragment, { key: 0 }, renderList([0, 1], (index) => {
260
381
  return createElementVNode("view", {
261
- key: index2,
382
+ key: index,
262
383
  role: "slider",
263
384
  class: normalizeClass({
264
- "nut-range-button-wrapper-left": index2 == 0,
265
- "nut-range-button-wrapper-right": index2 == 1
385
+ "nut-range-button-wrapper-left": index == 0,
386
+ "nut-range-button-wrapper-right": index == 1
266
387
  }),
388
+ "catch-move": true,
267
389
  tabindex: _ctx.disabled ? -1 : 0,
268
390
  "aria-valuemin": +_ctx.min,
269
- "aria-valuenow": _ctx.curValue(index2),
391
+ "aria-valuenow": _ctx.curValue(index),
270
392
  "aria-valuemax": +_ctx.max,
271
393
  "aria-orientation": "horizontal",
272
394
  onTouchstart: withModifiers((e) => {
273
- if (typeof index2 === "number") {
274
- _ctx.buttonIndex = index2;
395
+ if (typeof index === "number") {
396
+ _ctx.buttonIndex = index;
275
397
  }
276
398
  _ctx.onTouchStart(e);
277
399
  }, ["stop", "prevent"]),
@@ -285,9 +407,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
285
407
  class: "nut-range-button",
286
408
  style: normalizeStyle(_ctx.buttonStyle)
287
409
  }, [
288
- !_ctx.hiddenTag ? (openBlock(), createElementBlock("view", _hoisted_4, toDisplayString(_ctx.curValue(index2)), 1)) : createCommentVNode("", true)
410
+ !_ctx.hiddenTag ? (openBlock(), createElementBlock("view", _hoisted_5, toDisplayString(_ctx.curValue(index)), 1)) : createCommentVNode("", true)
289
411
  ], 4))
290
- ], 42, _hoisted_3);
412
+ ], 42, _hoisted_4);
291
413
  }), 64)) : (openBlock(), createElementBlock("view", {
292
414
  key: 1,
293
415
  role: "slider",
@@ -297,6 +419,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
297
419
  "aria-valuenow": _ctx.curValue(),
298
420
  "aria-valuemax": +_ctx.max,
299
421
  "aria-orientation": "horizontal",
422
+ "catch-move": true,
300
423
  onTouchstart: _cache[4] || (_cache[4] = withModifiers((e) => {
301
424
  _ctx.onTouchStart(e);
302
425
  }, ["stop", "prevent"])),
@@ -310,13 +433,13 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
310
433
  class: "nut-range-button",
311
434
  style: normalizeStyle(_ctx.buttonStyle)
312
435
  }, [
313
- !_ctx.hiddenTag ? (openBlock(), createElementBlock("view", _hoisted_6, toDisplayString(_ctx.curValue()), 1)) : createCommentVNode("", true)
436
+ !_ctx.hiddenTag ? (openBlock(), createElementBlock("view", _hoisted_7, toDisplayString(_ctx.curValue()), 1)) : createCommentVNode("", true)
314
437
  ], 4))
315
- ], 40, _hoisted_5))
438
+ ], 40, _hoisted_6))
316
439
  ], 4)
317
- ], 6),
318
- !_ctx.hiddenRange ? (openBlock(), createElementBlock("view", _hoisted_7, toDisplayString(+_ctx.max), 1)) : createCommentVNode("", true)
319
- ]);
440
+ ], 14, _hoisted_2),
441
+ !_ctx.hiddenRange ? (openBlock(), createElementBlock("view", _hoisted_8, toDisplayString(+_ctx.max), 1)) : createCommentVNode("", true)
442
+ ], 2);
320
443
  }
321
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
322
- export { index as default };
444
+ var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
445
+ export { index_taro as default };
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.18-beta.0 Tue Mar 08 2022 10:41:31 GMT+0800 (中国标准时间)
3
- * (c) 2021 @jdf2e.
2
+ * @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
3
+ * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
6
  import { computed, resolveComponent, openBlock, createElementBlock, normalizeClass, Fragment, renderList, normalizeStyle, createVNode, createBlock, createCommentVNode } from "vue";
@@ -71,20 +71,16 @@ const _sfc_main = create({
71
71
  [prefixCls]: true
72
72
  };
73
73
  });
74
- const onClick = (e, index2) => {
75
- e.preventDefault();
76
- e.stopPropagation();
74
+ const onClick = (e, index) => {
77
75
  if (props.disabled || props.readonly)
78
76
  return;
79
77
  let value = 0;
80
- if (index2 === 1 && props.modelValue === index2)
78
+ if (index === 1 && props.modelValue === index)
81
79
  ;
82
80
  else {
83
- value = index2;
84
- if (props.allowHalf) {
85
- if ((e == null ? void 0 : e.target).className.includes("__icon--half")) {
86
- value -= 0.5;
87
- }
81
+ value = index;
82
+ if (props.allowHalf && e == 2) {
83
+ value -= 0.5;
88
84
  }
89
85
  }
90
86
  emit("update:modelValue", value);
@@ -97,7 +93,6 @@ const _sfc_main = create({
97
93
  };
98
94
  }
99
95
  });
100
- const _hoisted_1 = ["onClick"];
101
96
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
102
97
  const _component_nut_icon = resolveComponent("nut-icon");
103
98
  return openBlock(), createElementBlock("view", {
@@ -107,37 +102,39 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
107
102
  return openBlock(), createElementBlock("view", {
108
103
  class: "nut-rate-item",
109
104
  key: n,
110
- onClick: ($event) => _ctx.onClick($event, n),
111
105
  style: normalizeStyle({ marginRight: _ctx.pxCheck(_ctx.spacing) })
112
106
  }, [
113
107
  createVNode(_component_nut_icon, {
114
108
  size: _ctx.iconSize,
115
109
  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,
116
112
  "font-class-name": _ctx.fontClassName,
117
113
  "class-prefix": _ctx.classPrefix,
118
- color: n <= _ctx.modelValue ? _ctx.activeColor : _ctx.voidColor,
119
114
  name: n <= _ctx.modelValue ? _ctx.checkedIcon : _ctx.uncheckedIcon
120
- }, null, 8, ["size", "class", "font-class-name", "class-prefix", "color", "name"]),
115
+ }, null, 8, ["size", "onClick", "class", "color", "font-class-name", "class-prefix", "name"]),
121
116
  _ctx.allowHalf && _ctx.modelValue + 1 > n ? (openBlock(), createBlock(_component_nut_icon, {
122
117
  key: 0,
123
118
  class: "nut-rate-item__icon nut-rate-item__icon--half",
119
+ onClick: ($event) => _ctx.onClick(2, n),
124
120
  "font-class-name": _ctx.fontClassName,
125
121
  "class-prefix": _ctx.classPrefix,
126
122
  color: n <= _ctx.modelValue + 1 ? _ctx.activeColor : _ctx.voidColor,
127
123
  size: _ctx.iconSize,
128
124
  name: _ctx.checkedIcon
129
- }, null, 8, ["font-class-name", "class-prefix", "color", "size", "name"])) : _ctx.allowHalf && _ctx.modelValue + 1 < n ? (openBlock(), createBlock(_component_nut_icon, {
125
+ }, null, 8, ["onClick", "font-class-name", "class-prefix", "color", "size", "name"])) : _ctx.allowHalf && _ctx.modelValue + 1 < n ? (openBlock(), createBlock(_component_nut_icon, {
130
126
  key: 1,
131
127
  class: "nut-rate-item__icon nut-rate-item__icon--disabled nut-rate-item__icon--half",
128
+ onClick: ($event) => _ctx.onClick(2, n),
132
129
  "font-class-name": _ctx.fontClassName,
133
130
  "class-prefix": _ctx.classPrefix,
134
131
  color: _ctx.voidColor,
135
132
  size: _ctx.iconSize,
136
133
  name: _ctx.uncheckedIcon
137
- }, null, 8, ["font-class-name", "class-prefix", "color", "size", "name"])) : createCommentVNode("", true)
138
- ], 12, _hoisted_1);
134
+ }, null, 8, ["onClick", "font-class-name", "class-prefix", "color", "size", "name"])) : createCommentVNode("", true)
135
+ ], 4);
139
136
  }), 128))
140
137
  ], 2);
141
138
  }
142
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
143
- export { index as default };
139
+ var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
140
+ export { index_taro as default };
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.18-beta.0 Tue Mar 08 2022 10:41:31 GMT+0800 (中国标准时间)
3
- * (c) 2021 @jdf2e.
2
+ * @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
3
+ * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
6
  import { provide, openBlock, createElementBlock, normalizeClass, renderSlot } from "vue";
@@ -18,8 +18,8 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  /*!
21
- * @nutui/nutui v3.1.18-beta.0 Tue Mar 08 2022 10:41:31 GMT+0800 (中国标准时间)
22
- * (c) 2021 @jdf2e.
21
+ * @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
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";
@@ -154,7 +154,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
154
154
  createElementVNode("view", _hoisted_3, [
155
155
  createElementVNode("form", {
156
156
  action: "#",
157
- onSubmit: _cache[3] || (_cache[3] = withModifiers((...args) => _ctx.handleSubmit && _ctx.handleSubmit(...args), ["prevent"]))
157
+ onsubmit: "return false",
158
+ onSubmit: _cache[4] || (_cache[4] = withModifiers((...args) => _ctx.handleSubmit && _ctx.handleSubmit(...args), ["prevent"]))
158
159
  }, [
159
160
  createElementVNode("input", {
160
161
  class: "nut-searchbar__input-bar",
@@ -164,12 +165,13 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
164
165
  value: _ctx.modelValue,
165
166
  onInput: _cache[0] || (_cache[0] = (...args) => _ctx.valueChange && _ctx.valueChange(...args)),
166
167
  onFocus: _cache[1] || (_cache[1] = (...args) => _ctx.valueFocus && _ctx.valueFocus(...args)),
167
- onBlur: _cache[2] || (_cache[2] = (...args) => _ctx.valueBlur && _ctx.valueBlur(...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
170
  }, null, 40, _hoisted_4)
169
171
  ], 32),
170
172
  _ctx.clearable ? withDirectives((openBlock(), createElementBlock("view", {
171
173
  key: 0,
172
- onClick: _cache[4] || (_cache[4] = (...args) => _ctx.handleClear && _ctx.handleClear(...args)),
174
+ onClick: _cache[5] || (_cache[5] = (...args) => _ctx.handleClear && _ctx.handleClear(...args)),
173
175
  class: "nut-searchbar__input-clear"
174
176
  }, [
175
177
  createVNode(_component_nut_icon, {
@@ -190,5 +192,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
190
192
  ])) : createCommentVNode("", true)
191
193
  ], 4);
192
194
  }
193
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
194
- export { index as default };
195
+ var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
196
+ export { index_taro as default };