@nutui/nutui-react-taro 2.6.15-beta.0 → 2.6.16

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 (58) hide show
  1. package/CHANGELOG.md +931 -909
  2. package/README.md +21 -28
  3. package/dist/esm/Audio.js +1 -1
  4. package/dist/esm/Checkbox.js +1 -1
  5. package/dist/esm/CheckboxGroup.js +1 -1
  6. package/dist/esm/DatePicker.js +1 -1
  7. package/dist/esm/Form.js +1 -1
  8. package/dist/esm/FormItem.js +1 -1
  9. package/dist/esm/ImagePreview.js +1 -1
  10. package/dist/esm/InputNumber.js +1 -1
  11. package/dist/esm/Menu.js +1 -1
  12. package/dist/esm/MenuItem.js +1 -1
  13. package/dist/esm/NumberKeyboard.js +1 -1
  14. package/dist/esm/PullToRefresh.js +1 -1
  15. package/dist/esm/Radio.js +1 -1
  16. package/dist/esm/RadioGroup.js +1 -1
  17. package/dist/esm/Swipe.js +1 -1
  18. package/dist/esm/Swiper.js +1 -2
  19. package/dist/esm/SwiperItem.js +1 -1
  20. package/dist/esm/Table.js +1 -1
  21. package/dist/esm/Uploader.js +1 -1
  22. package/dist/esm/{audio.taro-DzSc40G9.js → audio.taro-CD-vP_u0.js} +7 -8
  23. package/dist/esm/{checkbox.taro-Dc054oRo.js → checkbox.taro-CgqJyhrh.js} +4 -5
  24. package/dist/esm/{datepicker.taro-DTyJrlhD.js → datepicker.taro-BxaZ3Fjv.js} +3 -4
  25. package/dist/esm/{formitem.taro-Dmt5-wxG.js → formitem.taro-DogVddcs.js} +2 -2
  26. package/dist/esm/{imagepreview.taro-DtgQJEQ_.js → imagepreview.taro-CF-CCJ1Q.js} +1 -1
  27. package/dist/esm/{inputnumber.taro-WN5Drnyz.js → inputnumber.taro-D9mteLSI.js} +26 -9
  28. package/dist/esm/{menu.taro-CrPdDbYM.js → menu.taro-CLbOM_Z4.js} +12 -5
  29. package/dist/esm/{menuitem.taro-DMV3j4DK.js → menuitem.taro-CNaseNcY.js} +1 -1
  30. package/dist/esm/{numberkeyboard.taro-BA0iCeGP.js → numberkeyboard.taro-Cz6rKxk3.js} +38 -27
  31. package/dist/esm/nutui-react.es.js +15 -15
  32. package/dist/esm/{pulltorefresh.taro-CZReoWwU.js → pulltorefresh.taro-BScP6uPx.js} +0 -1
  33. package/dist/esm/{radio.taro-BNSceequ.js → radio.taro-CzOHqD3O.js} +0 -2
  34. package/dist/esm/{swipe.taro-yUhne9XU.js → swipe.taro-Bsk2fnEl.js} +0 -1
  35. package/dist/esm/{swiperitem.taro-DeiNSrJV.js → swiperitem.taro-BleF1EOs.js} +0 -5
  36. package/dist/esm/{table.taro-D2M3D2Vj.js → table.taro-B6WCKTkO.js} +6 -5
  37. package/dist/esm/{uploader.taro-DfO2HWvy.js → uploader.taro-DagHZaNI.js} +4 -2
  38. package/dist/locales/base.js +1 -1
  39. package/dist/locales/en-US.js +1 -1
  40. package/dist/locales/id-ID.js +1 -1
  41. package/dist/locales/tr-TR.js +1 -1
  42. package/dist/locales/zh-CN.js +1 -1
  43. package/dist/locales/zh-TW.js +1 -1
  44. package/dist/locales/zh-UG.js +1 -1
  45. package/dist/nutui.react.es.js +207 -151
  46. package/dist/nutui.react.umd.js +207 -151
  47. package/dist/types/packages/cell/cell.d.ts +1 -1
  48. package/dist/types/packages/cell/cell.taro.d.ts +2 -2
  49. package/dist/types/packages/formitem/formitem.d.ts +1 -0
  50. package/dist/types/packages/formitem/formitem.taro.d.ts +5 -0
  51. package/dist/types/packages/inputnumber/inputnumber.d.ts +1 -1
  52. package/dist/types/packages/inputnumber/inputnumber.taro.d.ts +1 -1
  53. package/dist/types/packages/menuitem/menuitem.d.ts +1 -0
  54. package/dist/types/packages/menuitem/menuitem.taro.d.ts +5 -0
  55. package/dist/types/packages/swiper/swiper.taro.d.ts +2 -1
  56. package/dist/types/packages/swiperitem/swiperitem.d.ts +0 -1
  57. package/package.json +2 -2
  58. package/dist/types/packages/griditem/types.d.ts +0 -13
package/README.md CHANGED
@@ -1,4 +1,3 @@
1
-
2
1
  <p align="center">
3
2
  <img alt="logo" src="https://img11.360buyimg.com/imagetools/jfs/t1/211965/25/7152/22022/61b16785E433119bb/aa41d7a9f7e823f3.png" width="150" style="margin-bottom: 10px;">
4
3
  </p>
@@ -36,27 +35,26 @@
36
35
 
37
36
  ---
38
37
 
39
- > Nut[nʌt]: the one Squirrel Scrat pursues resolutely for a lifetime and will never let go even if it causes a catastrophe from the animated film ***Ice Age***.
38
+ > Nut[nʌt]: the one Squirrel Scrat pursues resolutely for a lifetime and will never let go even if it causes a catastrophe from the animated film **_Ice Age_**.
40
39
 
41
40
  [简体中文](./README_ZH.md) | English
42
41
 
43
42
  ## Features
44
43
 
45
- * 🚀 70+ High Quality Components
46
- * 📖 Based on JD APP 11.0 Visual Specifications
47
- * 🍭 Support Tree Shaking
48
- * 📖 Extensive Documentation and Demos
49
- * 💪 Written in TypeScript
50
- * 💪 Support SSR (Experimental)
51
- * 🍭 Support Custom Themes
52
- * 🍭 90%+ Unit Test Coverage
53
- * 📖 Provide Sketch Design Resources
54
-
55
-
44
+ - 🚀 70+ High Quality Components
45
+ - 📖 Based on JD APP 11.0 Visual Specifications
46
+ - 🍭 Support Tree Shaking
47
+ - 📖 Extensive Documentation and Demos
48
+ - 💪 Written in TypeScript
49
+ - 💪 Support SSR (Experimental)
50
+ - 🍭 Support Custom Themes
51
+ - 🍭 90%+ Unit Test Coverage
52
+ - 📖 Provide Sketch Design Resources
56
53
 
57
54
  ## Running locally
58
55
 
59
56
  ### running with H5
57
+
60
58
  ```sh
61
59
  # Clone repository
62
60
  git clone https://github.com/jdf2e/nutui-react.git
@@ -72,7 +70,9 @@ pnpm run dev
72
70
 
73
71
  # visit in browser: http:http://localhost:3000 (you don't have to open it manually if you've run it in the browser again)
74
72
  ```
73
+
75
74
  ### running with mini-program
75
+
76
76
  ```sh
77
77
  # Clone repository
78
78
  git clone https://github.com/jdf2e/nutui-react.git
@@ -96,12 +96,11 @@ pnpm run dev:taro:jd
96
96
 
97
97
  > If you are using AMD environment or build tools such as Webpack, Vite, etc., we recommend using the `es` version. If it is a non-module environment (such as direct reference through the `<script>` tag), it is recommended to use the `umd` compressed version.
98
98
 
99
- * es **nutui.es.js**
100
-
101
- * umd **nutui.umd.js**
99
+ - es **nutui.es.js**
102
100
 
101
+ - umd **nutui.umd.js**
103
102
 
104
- ## Links
103
+ ## Links
105
104
 
106
105
  <ul>
107
106
  <li>
@@ -126,33 +125,30 @@ pnpm run dev:taro:jd
126
125
  </li>
127
126
  </ul>
128
127
 
129
-
130
128
  ## Communication
131
129
 
132
130
  | Version | WeChat Group | JD Dongdong Group |
133
- | --- | --- |--- |
131
+ | --- | --- | --- |
134
132
  | [NutUI React](https://github.com/jdf2e/nutui-react/issues) | <img src="https://storage.360buyimg.com/imgtools/17c67beff6-4acf07c0-609c-11ed-a6ef-69df15b605e4.png" width="100" /> Reply 「NutUI-React」 after following | 1025679314 |
135
133
  | [NutUI x Taro](https://github.com/jdf2e/nutui/issues) | <img src="https://camo.githubusercontent.com/db4276b4ee4b443158195e943e9e678cb4d2afb7580f70d4d817ef0a90413aec/687474703a2f2f73746f726167652e333630627579696d672e636f6d2f7461726f2d6a642d636f6d2f7374617469632f636f6e746163745f7461726f5f6e757475695f71722e706e67" width="100" />Reply 「NutUI-React」 after following | 1022545110 |
136
134
 
137
-
138
135
  ## Join Us
139
136
 
140
137
  #### NutUI Community
141
138
 
142
- [*Welcome To NutUI-React Community*](https://github.com/jdf2e/nutui-react/discussions/348)
139
+ [_Welcome To NutUI-React Community_](https://github.com/jdf2e/nutui-react/discussions/348)
143
140
 
144
141
  #### Contribute to NutUI
145
142
 
146
143
  There are some choices of contributing to NutUI as follows, solving issues, fixing bugs, adding new components, i18n, UI customization, platform and cross-end adaptation, etc.
147
144
 
148
- You are very welcome to contribute code to NutUI. Before your pull requests, please read [*NutUI Developer Contributing Guide*](https://github.com/jdf2e/nutui-react/discussions/348)。
149
-
145
+ You are very welcome to contribute code to NutUI. Before your pull requests, please read [_NutUI Developer Contributing Guide_](https://github.com/jdf2e/nutui-react/discussions/348)。
150
146
 
151
147
  ## Issue & Discussion
152
148
 
153
149
  [Report issues to NutUI](https://nutui.jd.com/nutui-issue-helper/?repo=jdf2e/nutui-react&lang=zh-cn)
154
150
 
155
- > It is highly recommended to read [*How To Ask Questions The Smart Way*](https://github.com/ryanhanwu/, [*How To Ask Questions Of GitHub Community*](https://github.com/seajs/seajs/issues/545) and [*How to Report Bugs Effectively*](https://www.chiark.greenend.org.uk/~sgtatham/bugs.html), then you can get understanding and help more easily.
151
+ > It is highly recommended to read [*How To Ask Questions The Smart Way*](https://github.com/ryanhanwu/, [_How To Ask Questions Of GitHub Community_](https://github.com/seajs/seajs/issues/545) and [_How to Report Bugs Effectively_](https://www.chiark.greenend.org.uk/~sgtatham/bugs.html), then you can get understanding and help more easily.
156
152
 
157
153
  [NutUI Discussion](https://github.com/jdf2e/nutui-react/discussions)
158
154
 
@@ -162,13 +158,11 @@ If you have any ideas, questions or suggestions, you can share your opinions her
162
158
 
163
159
  Thanks to all the following [developers](https://github.com/jdf2e/nutui-react/graphs/contributors)。 who have contributed code to NutUI.
164
160
 
165
-
166
161
  <a href="https://github.com/jdf2e/nutui-react/graphs/contributors">
167
162
  <img src="https://contrib.rocks/image?repo=jdf2e/nutui-react" alt="contributors"/>
168
163
  </a>
169
164
 
170
-
171
- ## Stargazers
165
+ ## Stargazers
172
166
 
173
167
  [![Stargazers repo roster for @jdf2e/nutui-react](https://reporoster.com/stars/jdf2e/nutui-react)](https://github.com/jdf2e/nutui-react/stargazers)
174
168
 
@@ -184,7 +178,6 @@ Thanks to all the following [developers](https://github.com/jdf2e/nutui-react/gr
184
178
 
185
179
  NutUI follows [Angular Style Commit Message Conventions](https://gist.github.com/stephenparish/9941e89d80e2bc58a153). The up-to-date release notes are available on [Release](https://github.com/jdf2e/nutui-react/releases)
186
180
 
187
-
188
181
  ## Open Source License
189
182
 
190
183
  This project is based on **MIT** protocol
package/dist/esm/Audio.js CHANGED
@@ -1,4 +1,4 @@
1
- import { A as Audio } from "./audio.taro-DzSc40G9.js";
1
+ import { A as Audio } from "./audio.taro-CD-vP_u0.js";
2
2
  export {
3
3
  Audio as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { C as Checkbox } from "./checkbox.taro-Dc054oRo.js";
1
+ import { C as Checkbox } from "./checkbox.taro-CgqJyhrh.js";
2
2
  export {
3
3
  Checkbox as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { a as CheckboxGroup } from "./checkbox.taro-Dc054oRo.js";
1
+ import { a as CheckboxGroup } from "./checkbox.taro-CgqJyhrh.js";
2
2
  export {
3
3
  CheckboxGroup as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { D as DatePicker } from "./datepicker.taro-DTyJrlhD.js";
1
+ import { D as DatePicker } from "./datepicker.taro-BxaZ3Fjv.js";
2
2
  export {
3
3
  DatePicker as default
4
4
  };
package/dist/esm/Form.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import React__default from "react";
2
2
  import classNames from "classnames";
3
- import { u as useForm, S as SECRET, C as Context, F as FormItem } from "./formitem.taro-Dmt5-wxG.js";
3
+ import { u as useForm, S as SECRET, C as Context, F as FormItem } from "./formitem.taro-DogVddcs.js";
4
4
  import { C as ComponentDefaults } from "./typings-DV9RBfhj.js";
5
5
  import { C as Cell } from "./cell.taro-CVFlcls2.js";
6
6
  const defaultProps = Object.assign(Object.assign({}, ComponentDefaults), { labelPosition: "right", starPosition: "left", divider: false, onFinish: (values) => {
@@ -1,4 +1,4 @@
1
- import { F as FormItem } from "./formitem.taro-Dmt5-wxG.js";
1
+ import { F as FormItem } from "./formitem.taro-DogVddcs.js";
2
2
  export {
3
3
  FormItem as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { I as ImagePreview } from "./imagepreview.taro-DtgQJEQ_.js";
1
+ import { I as ImagePreview } from "./imagepreview.taro-CF-CCJ1Q.js";
2
2
  export {
3
3
  ImagePreview as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { I as InputNumber } from "./inputnumber.taro-WN5Drnyz.js";
1
+ import { I as InputNumber } from "./inputnumber.taro-D9mteLSI.js";
2
2
  export {
3
3
  InputNumber as default
4
4
  };
package/dist/esm/Menu.js CHANGED
@@ -1,4 +1,4 @@
1
- import { M as Menu } from "./menu.taro-CrPdDbYM.js";
1
+ import { M as Menu } from "./menu.taro-CLbOM_Z4.js";
2
2
  export {
3
3
  Menu as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { M as MenuItem } from "./menuitem.taro-DMV3j4DK.js";
1
+ import { M as MenuItem } from "./menuitem.taro-CNaseNcY.js";
2
2
  export {
3
3
  MenuItem as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { N as NumberKeyboard } from "./numberkeyboard.taro-BA0iCeGP.js";
1
+ import { N as NumberKeyboard } from "./numberkeyboard.taro-Cz6rKxk3.js";
2
2
  export {
3
3
  NumberKeyboard as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { P as PullToRefresh } from "./pulltorefresh.taro-CZReoWwU.js";
1
+ import { P as PullToRefresh } from "./pulltorefresh.taro-BScP6uPx.js";
2
2
  export {
3
3
  PullToRefresh as default
4
4
  };
package/dist/esm/Radio.js CHANGED
@@ -1,4 +1,4 @@
1
- import { R as Radio } from "./radio.taro-BNSceequ.js";
1
+ import { R as Radio } from "./radio.taro-CzOHqD3O.js";
2
2
  export {
3
3
  Radio as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { a as RadioGroup } from "./radio.taro-BNSceequ.js";
1
+ import { a as RadioGroup } from "./radio.taro-CzOHqD3O.js";
2
2
  export {
3
3
  RadioGroup as default
4
4
  };
package/dist/esm/Swipe.js CHANGED
@@ -1,4 +1,4 @@
1
- import { S as Swipe } from "./swipe.taro-yUhne9XU.js";
1
+ import { S as Swipe } from "./swipe.taro-Bsk2fnEl.js";
2
2
  export {
3
3
  Swipe as default
4
4
  };
@@ -4,7 +4,7 @@ import { View, Swiper as Swiper$1, SwiperItem } from "@tarojs/components";
4
4
  import classNames from "classnames";
5
5
  import { I as Indicator } from "./indicator.taro-k8bxJf86.js";
6
6
  import { p as pxCheck } from "./px-check-D1Xbd9pj.js";
7
- import { S as SwiperItem$1 } from "./swiperitem.taro-DeiNSrJV.js";
7
+ import { S as SwiperItem$1 } from "./swiperitem.taro-BleF1EOs.js";
8
8
  const defaultProps = {
9
9
  direction: "horizontal",
10
10
  indicator: false,
@@ -93,7 +93,6 @@ const Swiper = forwardRef((props, ref) => {
93
93
  renderIndicator()
94
94
  );
95
95
  });
96
- Swiper.defaultProps = defaultProps;
97
96
  Swiper.displayName = "NutSwiper";
98
97
  const InnerSwiper = Swiper;
99
98
  InnerSwiper.Item = SwiperItem$1;
@@ -1,4 +1,4 @@
1
- import { S as SwiperItem } from "./swiperitem.taro-DeiNSrJV.js";
1
+ import { S as SwiperItem } from "./swiperitem.taro-BleF1EOs.js";
2
2
  export {
3
3
  SwiperItem as default
4
4
  };
package/dist/esm/Table.js CHANGED
@@ -1,4 +1,4 @@
1
- import { T as Table } from "./table.taro-D2M3D2Vj.js";
1
+ import { T as Table } from "./table.taro-B6WCKTkO.js";
2
2
  export {
3
3
  Table as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { U as Uploader } from "./uploader.taro-DfO2HWvy.js";
1
+ import { U as Uploader } from "./uploader.taro-DagHZaNI.js";
2
2
  export {
3
3
  Uploader as default
4
4
  };
@@ -33,19 +33,19 @@ const Audio = (props) => {
33
33
  audioCtx.autoplay = autoplay || false;
34
34
  audioCtx.loop = loop || false;
35
35
  audioCtx.onPause(() => {
36
- props.onPause && props.onPause(audioCtx);
36
+ onPause === null || onPause === void 0 ? void 0 : onPause(audioCtx);
37
37
  });
38
38
  audioCtx.onEnded(() => {
39
- if (props.loop) {
39
+ if (loop) {
40
40
  console.warn(locale.audio.tips || "onPlayEnd事件在loop=false时才会触发");
41
41
  } else {
42
- props.onPlayEnd && props.onPlayEnd(audioCtx);
42
+ onPlayEnd === null || onPlayEnd === void 0 ? void 0 : onPlayEnd(audioCtx);
43
43
  }
44
44
  });
45
45
  audioCtx.onPlay(() => {
46
46
  const { duration } = audioCtx;
47
47
  setTotalSeconds(Math.floor(duration));
48
- props.onPlay && props.onPlay(audioCtx);
48
+ onPlay === null || onPlay === void 0 ? void 0 : onPlay(audioCtx);
49
49
  });
50
50
  audioCtx.onCanplay(() => {
51
51
  const intervalID = setInterval(function() {
@@ -55,7 +55,7 @@ const Audio = (props) => {
55
55
  }
56
56
  }, 500);
57
57
  setIsCanPlay(true);
58
- props.onCanPlay && props.onCanPlay(audioCtx);
58
+ onCanPlay === null || onCanPlay === void 0 ? void 0 : onCanPlay(audioCtx);
59
59
  });
60
60
  audioCtx.onTimeUpdate(() => {
61
61
  const time = parseInt(`${audioCtx.currentTime}`);
@@ -87,14 +87,14 @@ const Audio = (props) => {
87
87
  statusRef.current.currentTime = Math.max(currentTime - 1, 0);
88
88
  setCurrentDuration(formatSeconds(statusRef.current.currentTime.toString()));
89
89
  audioCtx.seek(statusRef.current.currentTime);
90
- props.onFastBack && props.onFastBack(audioCtx);
90
+ onFastBack === null || onFastBack === void 0 ? void 0 : onFastBack(audioCtx);
91
91
  };
92
92
  const handleForward = () => {
93
93
  const currentTime = Math.floor(audioCtx.currentTime);
94
94
  statusRef.current.currentTime = Math.min(currentTime + 1, audioCtx.duration);
95
95
  setCurrentDuration(formatSeconds(statusRef.current.currentTime.toString()));
96
96
  audioCtx.seek(statusRef.current.currentTime);
97
- props.onForward && props.onForward(audioCtx);
97
+ onForward === null || onForward === void 0 ? void 0 : onForward(audioCtx);
98
98
  };
99
99
  const handleStatusChange = () => {
100
100
  setPlaying(!playing);
@@ -160,7 +160,6 @@ const Audio = (props) => {
160
160
  };
161
161
  return React__default.createElement("div", Object.assign({ className: `${classPrefix} ${className}`, style }, rest), renderAudio());
162
162
  };
163
- Audio.defaultProps = defaultProps;
164
163
  Audio.displayName = "NutAudio";
165
164
  export {
166
165
  Audio as A
@@ -20,7 +20,7 @@ const defaultProps$1 = {
20
20
  };
21
21
  const classPrefix$1 = "nut-checkboxgroup";
22
22
  const CheckboxGroup = React__default.forwardRef((props, ref) => {
23
- const _a = Object.assign(Object.assign({}, defaultProps$1), props), { children, className, disabled, list, onChange, value, defaultValue, max, min, onLimit, labelPosition, direction, options } = _a, rest = __rest(_a, ["children", "className", "disabled", "list", "onChange", "value", "defaultValue", "max", "min", "onLimit", "labelPosition", "direction", "options"]);
23
+ const _a = Object.assign(Object.assign({}, defaultProps$1), props), { children, className, disabled, list, value, defaultValue, max, min, labelPosition, direction, options, onChange, onLimit } = _a, rest = __rest(_a, ["children", "className", "disabled", "list", "value", "defaultValue", "max", "min", "labelPosition", "direction", "options", "onChange", "onLimit"]);
24
24
  useImperativeHandle(ref, () => ({
25
25
  toggle(state) {
26
26
  if (state === false) {
@@ -45,8 +45,8 @@ const CheckboxGroup = React__default.forwardRef((props, ref) => {
45
45
  }
46
46
  }));
47
47
  const [_value, setValue] = usePropsValue({
48
- value: props.value,
49
- defaultValue: props.defaultValue,
48
+ value,
49
+ defaultValue,
50
50
  finalValue: [],
51
51
  onChange
52
52
  });
@@ -83,12 +83,11 @@ const CheckboxGroup = React__default.forwardRef((props, ref) => {
83
83
  }
84
84
  } },
85
85
  React__default.createElement("div", Object.assign({ className: classNames(classPrefix$1, {
86
- [`nut-checkboxgroup-${props.direction}`]: props.direction,
86
+ [`nut-checkboxgroup-${direction}`]: direction,
87
87
  [`nut-checkboxgroup-list`]: list
88
88
  }, className) }, rest), (options === null || options === void 0 ? void 0 : options.length) ? renderOptions() : children)
89
89
  );
90
90
  });
91
- CheckboxGroup.defaultProps = defaultProps$1;
92
91
  CheckboxGroup.displayName = "NutCheckboxGroup";
93
92
  const defaultProps = Object.assign(Object.assign({}, ComponentDefaults), { disabled: false, shape: "round", labelPosition: "right", icon: null, activeIcon: null, indeterminateIcon: null, onChange: (value) => {
94
93
  } });
@@ -132,7 +132,7 @@ const DatePicker = (props) => {
132
132
  if (!isEqual) {
133
133
  setSelectedDate(formatValue(newDate));
134
134
  }
135
- props.onChange && props.onChange(selectedOptions, [
135
+ onChange === null || onChange === void 0 ? void 0 : onChange(selectedOptions, [
136
136
  String(newDate.getFullYear()),
137
137
  String(newDate.getMonth() + 1),
138
138
  String(newDate.getDate())
@@ -203,8 +203,8 @@ const DatePicker = (props) => {
203
203
  }
204
204
  pickerValue[columnIndex] = (_a2 = arr[index]) === null || _a2 === void 0 ? void 0 : _a2.value;
205
205
  setPickerValue([...pickerValue]);
206
- if (props.filter && props.filter(type2, arr)) {
207
- return props.filter(type2, arr);
206
+ if (filter === null || filter === void 0 ? void 0 : filter(type2, arr)) {
207
+ return filter === null || filter === void 0 ? void 0 : filter(type2, arr);
208
208
  }
209
209
  return arr;
210
210
  };
@@ -243,7 +243,6 @@ const DatePicker = (props) => {
243
243
  }, [selectedDate, startDate, endDate]);
244
244
  return React__default.createElement(View, Object.assign({ className: `nut-datepicker ${className}`, style, catchMove: true }, rest), pickerOptions.length && React__default.createElement(Picker, Object.assign({}, pickerProps, { title, visible, options: pickerOptions, onClose, onCancel, value: pickerValue, onConfirm: (options, value) => onConfirm && onConfirm(options, value), onChange: (options, value, index) => handlePickerChange(options, value, index), threeDimensional })));
245
245
  };
246
- DatePicker.defaultProps = defaultProps;
247
246
  DatePicker.displayName = "NutDatePicker";
248
247
  export {
249
248
  DatePicker as D
@@ -264,7 +264,7 @@ class FormItem extends React__default.Component {
264
264
  };
265
265
  this.renderLayout = (childNode) => {
266
266
  var _a;
267
- const { label, name, required, rules, className, style, errorMessageAlign } = Object.assign(Object.assign({}, defaultProps), this.props);
267
+ const { label, name, required, rules, className, style, align, errorMessageAlign } = Object.assign(Object.assign({}, defaultProps), this.props);
268
268
  const requiredInRules = rules === null || rules === void 0 ? void 0 : rules.some((rule) => rule.required);
269
269
  const item = name ? this.context.errors[name] : [];
270
270
  const { starPosition } = this.context;
@@ -278,7 +278,7 @@ class FormItem extends React__default.Component {
278
278
  );
279
279
  return React__default.createElement(
280
280
  Cell,
281
- { className: `nut-form-item ${className}`, style, onClick: (e) => this.props.onClick && this.props.onClick(e, this.componentRef) },
281
+ { className: `nut-form-item ${className}`, style, align, onClick: (e) => this.props.onClick && this.props.onClick(e, this.componentRef) },
282
282
  label ? React__default.createElement("div", { className: "nut-cell-title nut-form-item-label" }, renderLabel) : null,
283
283
  React__default.createElement(
284
284
  "div",
@@ -5,7 +5,7 @@ import classNames from "classnames";
5
5
  import { Close } from "@nutui/icons-react-taro";
6
6
  import { P as Popup } from "./popup.taro-CR3JyuJV.js";
7
7
  import InnerSwiper from "./Swiper.js";
8
- import { S as SwiperItem } from "./swiperitem.taro-DeiNSrJV.js";
8
+ import { S as SwiperItem } from "./swiperitem.taro-BleF1EOs.js";
9
9
  import { C as ComponentDefaults } from "./typings-DV9RBfhj.js";
10
10
  import { u as usePropsValue } from "./use-props-value-SH9krhkx.js";
11
11
  const defaultProps = Object.assign(Object.assign({}, ComponentDefaults), { images: [], videos: [], visible: false, autoPlay: false, defaultValue: 1, closeOnContentClick: false, pagination: true, indicator: false, indicatorColor: "#fff", closeIcon: false, closeIconPosition: "top-right", showMenuByLongpress: false, onChange: (value) => {
@@ -98,6 +98,18 @@ const InputNumber = (props) => {
98
98
  return null;
99
99
  return text;
100
100
  };
101
+ const clampValue = (valueStr) => {
102
+ if (valueStr === null)
103
+ return defaultValue;
104
+ const val = Number(parseFloat(valueStr || "0").toFixed(digits));
105
+ return Math.max(Number(min), Math.min(Number(max), val));
106
+ };
107
+ const handleValueChange = (valueStr, e) => {
108
+ const val = clampValue(valueStr);
109
+ if (val !== Number(shadowValue)) {
110
+ onChange === null || onChange === void 0 ? void 0 : onChange(val, e);
111
+ }
112
+ };
101
113
  const handleInputChange = (e) => {
102
114
  setInputValue(e.target.value);
103
115
  const valueStr = parseValue(e.target.value);
@@ -108,24 +120,29 @@ const InputNumber = (props) => {
108
120
  setShadowValue(defaultValue);
109
121
  }
110
122
  } else {
111
- setShadowValue(valueStr);
112
- }
113
- if (!async) {
114
- onChange === null || onChange === void 0 ? void 0 : onChange(parseFloat(valueStr || "0").toFixed(digits), e);
123
+ setShadowValue(clampValue(valueStr));
115
124
  }
125
+ !async && handleValueChange(valueStr, e);
116
126
  };
117
127
  const handleFocus = (e) => {
118
128
  setFocused(true);
119
129
  setInputValue(shadowValue !== void 0 && shadowValue !== null ? bound(Number(shadowValue), Number(min), Number(max)).toString() : "");
120
- onFocus && onFocus(e);
130
+ onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
121
131
  };
122
132
  const handleBlur = (e) => {
123
133
  setFocused(false);
124
- onBlur && onBlur(e);
125
- if (async) {
126
- const valueStr = parseValue(e.target.value);
127
- onChange === null || onChange === void 0 ? void 0 : onChange(parseFloat(valueStr || "0").toFixed(digits), e);
134
+ onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
135
+ const valueStr = parseValue(e.target.value);
136
+ if (valueStr === null) {
137
+ if (allowEmpty) {
138
+ setShadowValue(null);
139
+ } else {
140
+ setShadowValue(defaultValue);
141
+ }
142
+ } else {
143
+ setShadowValue(clampValue(valueStr));
128
144
  }
145
+ async && handleValueChange(valueStr, e);
129
146
  };
130
147
  return React__default.createElement(
131
148
  "div",
@@ -2,7 +2,7 @@ import { _ as __rest } from "./tslib.es6-iWu3F_1J.js";
2
2
  import React__default, { useRef, useState, useEffect } from "react";
3
3
  import classNames from "classnames";
4
4
  import { ArrowUp, ArrowDown } from "@nutui/icons-react-taro";
5
- import { M as MenuItem } from "./menuitem.taro-DMV3j4DK.js";
5
+ import { M as MenuItem } from "./menuitem.taro-CNaseNcY.js";
6
6
  import { C as ComponentDefaults } from "./typings-DV9RBfhj.js";
7
7
  const defaultProps = Object.assign(Object.assign({}, ComponentDefaults), { activeColor: "", closeOnOverlayClick: true, scrollFixed: false, lockScroll: true, overlay: true, icon: null, onOpen: (index, from) => {
8
8
  }, onClose: (index, from) => {
@@ -68,7 +68,7 @@ const Menu = (props) => {
68
68
  const menuTitle = () => {
69
69
  return React__default.Children.map(children, (child, index) => {
70
70
  if (React__default.isValidElement(child)) {
71
- const { title, options, value, defaultValue, disabled, direction } = child.props;
71
+ const { title, titleIcon, options, value, defaultValue, disabled, direction } = child.props;
72
72
  const selected = options === null || options === void 0 ? void 0 : options.filter((option) => option.value === (value !== void 0 ? value : defaultValue));
73
73
  const finallyTitle = () => {
74
74
  if (title)
@@ -79,18 +79,25 @@ const Menu = (props) => {
79
79
  return selected[0].text;
80
80
  return "";
81
81
  };
82
+ const finallyIcon = () => {
83
+ if (titleIcon)
84
+ return titleIcon;
85
+ if (icon)
86
+ return icon;
87
+ return direction === "up" ? React__default.createElement(ArrowUp, { className: "nut-menu-title-icon", width: "12px", height: "12px" }) : React__default.createElement(ArrowDown, { className: "nut-menu-title-icon", width: "12px", height: "12px" });
88
+ };
82
89
  return React__default.createElement(
83
90
  "div",
84
- { className: classNames("nut-menu-title ", {
91
+ { className: classNames("nut-menu-title", `nut-menu-title-${index}`, {
85
92
  active: showMenuItem[index],
86
93
  disabled
87
- }, className), style: { color: showMenuItem[index] ? activeColor : "" }, key: index, onClick: () => {
94
+ }), style: { color: showMenuItem[index] ? activeColor : "" }, key: index, onClick: () => {
88
95
  if ((!options || !options.length) && !child.props.children)
89
96
  return;
90
97
  !disabled && toggleMenuItem(index);
91
98
  } },
92
99
  React__default.createElement("div", { className: "nut-menu-title-text" }, finallyTitle()),
93
- icon || (direction === "up" ? React__default.createElement(ArrowUp, { className: "nut-menu-title-icon", size: "12px" }) : React__default.createElement(ArrowDown, { className: "nut-menu-title-icon", size: "12px" }))
100
+ finallyIcon()
94
101
  );
95
102
  }
96
103
  return null;
@@ -9,7 +9,7 @@ import { O as Overlay } from "./overlay.taro-C2t82CZz.js";
9
9
  import { g as getRectByTaro } from "./get-rect-by-taro-THaHH07X.js";
10
10
  import { C as ComponentDefaults } from "./typings-DV9RBfhj.js";
11
11
  import { u as usePropsValue } from "./use-props-value-SH9krhkx.js";
12
- const defaultProps = Object.assign(Object.assign({}, ComponentDefaults), { columns: 1, direction: "down", icon: null, closeOnClickAway: true, activeTitleClass: "", inactiveTitleClass: "", onChange: (value) => void 0 });
12
+ const defaultProps = Object.assign(Object.assign({}, ComponentDefaults), { titleIcon: null, columns: 1, direction: "down", icon: null, closeOnClickAway: true, activeTitleClass: "", inactiveTitleClass: "", onChange: (value) => void 0 });
13
13
  const MenuItem = forwardRef((props, ref) => {
14
14
  const { className, style, options, value, defaultValue, columns, title, icon, direction, onChange, activeTitleClass, inactiveTitleClass, closeOnClickAway, children, activeColor, show, parent, index } = Object.assign(Object.assign({}, defaultProps), props);
15
15
  const [showPopup, setShowPopup] = useState(show);
@@ -6,11 +6,11 @@ import { View } from "@tarojs/components";
6
6
  import { P as Popup } from "./popup.taro-CR3JyuJV.js";
7
7
  import { u as useConfig } from "./configprovider.taro-DA4GDDFu.js";
8
8
  import { C as ComponentDefaults } from "./typings-DV9RBfhj.js";
9
- Object.assign(Object.assign({}, ComponentDefaults), { visible: false, rightActions: "", type: "default", custom: [], random: false, onClose: () => {
9
+ const defaultProps = Object.assign(Object.assign({}, ComponentDefaults), { visible: false, rightActions: "", type: "default", custom: [], random: false, onClose: () => {
10
10
  } });
11
11
  const NumberKeyboard = (props) => {
12
12
  const { locale } = useConfig();
13
- const { title, rightActions, confirmText, visible, type, custom, random, style, className, onChange, onDelete, onClose, onConfirm } = props, rest = __rest(props, ["title", "rightActions", "confirmText", "visible", "type", "custom", "random", "style", "className", "onChange", "onDelete", "onClose", "onConfirm"]);
13
+ const _a = Object.assign(Object.assign({}, defaultProps), props), { title, rightActions, confirmText, visible, type, custom, random, style, className, onChange, onDelete, onClose, onConfirm } = _a, rest = __rest(_a, ["title", "rightActions", "confirmText", "visible", "type", "custom", "random", "style", "className", "onChange", "onDelete", "onClose", "onConfirm"]);
14
14
  const classPrefix = "nut-numberkeyboard";
15
15
  const getBasicKeys = () => {
16
16
  const keys = new Array(9).fill(0).map((_, index) => {
@@ -57,41 +57,52 @@ const NumberKeyboard = (props) => {
57
57
  };
58
58
  const onTouchEnd = (item2) => {
59
59
  setActive(false);
60
- if (item2.type === "num" || item2.type === "custom") {
61
- onChange && onChange(item2.id);
60
+ switch (item2.type) {
61
+ case "num":
62
+ case "custom":
63
+ onChange === null || onChange === void 0 ? void 0 : onChange(item2.id);
64
+ break;
65
+ case "close":
66
+ onClose === null || onClose === void 0 ? void 0 : onClose();
67
+ break;
68
+ case "delete":
69
+ onDelete === null || onDelete === void 0 ? void 0 : onDelete();
70
+ break;
71
+ case "confirm":
72
+ onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm();
73
+ break;
62
74
  }
63
- if (item2.type === "close") {
64
- onClose && onClose();
65
- }
66
- if (item2.type === "delete") {
67
- onDelete && onDelete();
68
- }
69
- if (item2.type === "confirm") {
70
- onConfirm && onConfirm();
75
+ };
76
+ const renderContent = (item2) => {
77
+ switch (item2.type) {
78
+ case "num":
79
+ case "custom":
80
+ return React__default.createElement("div", null, item2.id);
81
+ case "delete":
82
+ return React__default.createElement(DeleteIcon, null);
83
+ case "close":
84
+ return React__default.createElement(ArrowDown, { size: 18 });
85
+ case "confirm":
86
+ return React__default.createElement(React__default.Fragment, null, confirmText || locale.done);
87
+ default:
88
+ return null;
71
89
  }
72
90
  };
73
91
  return React__default.createElement(
74
92
  "div",
75
93
  { key: item.id, className: `${classPrefix}-body-wrapper` },
76
- React__default.createElement(
77
- "div",
78
- { className: classNames({
79
- key: true,
80
- active,
81
- close: item.type === "close",
82
- delete: item.type === "delete",
83
- confirm: item.type === "confirm"
84
- }), onTouchStart: () => onTouchStart(), onTouchEnd: () => onTouchEnd(item), onTouchCancel: () => onTouchEnd(item) },
85
- (item.type === "num" || item.type === "custom") && React__default.createElement("div", null, item.id),
86
- item.type === "delete" && React__default.createElement(DeleteIcon, null),
87
- item.type === "close" && React__default.createElement(ArrowDown, { size: 18 }),
88
- item.type === "confirm" && React__default.createElement(React__default.Fragment, null, confirmText || locale.done)
89
- )
94
+ React__default.createElement("div", { className: classNames({
95
+ key: true,
96
+ active,
97
+ close: item.type === "close",
98
+ delete: item.type === "delete",
99
+ confirm: item.type === "confirm"
100
+ }), onTouchStart: () => onTouchStart(), onTouchEnd: () => onTouchEnd(item), onTouchCancel: () => onTouchEnd(item) }, renderContent(item))
90
101
  );
91
102
  };
92
103
  return React__default.createElement(
93
104
  Popup,
94
- Object.assign({ visible, position: "bottom", onOverlayClick: onClose, onCloseIconClick: onClose, zIndex: 9999, overlayStyle: { backgroundColor: "rgba(0, 0, 0, 0)" } }, rest),
105
+ Object.assign({}, rest, { visible, position: "bottom", onOverlayClick: onClose, onCloseIconClick: onClose, zIndex: 9999, overlayStyle: { backgroundColor: "rgba(0, 0, 0, 0)" } }),
95
106
  React__default.createElement(
96
107
  "div",
97
108
  { className: classNames(classPrefix, className), style },