@nutui/nutui-react-taro 2.5.2 → 2.6.0

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 (83) hide show
  1. package/CHANGELOG.md +19 -5
  2. package/dist/esm/ActionSheet.js +1 -1
  3. package/dist/esm/Address.js +1 -1
  4. package/dist/esm/Audio.js +1 -1
  5. package/dist/esm/AvatarCropper.js +1 -1
  6. package/dist/esm/Calendar.js +1 -1
  7. package/dist/esm/Cascader.js +1 -1
  8. package/dist/esm/DatePicker.js +1 -1
  9. package/dist/esm/Dialog.js +1 -1
  10. package/dist/esm/FixedNav.js +1 -1
  11. package/dist/esm/Form/style/style.css +1 -1
  12. package/dist/esm/ImagePreview/style/style.css +1 -1
  13. package/dist/esm/ImagePreview.js +1 -1
  14. package/dist/esm/Input.js +1 -1
  15. package/dist/esm/Menu.js +1 -1
  16. package/dist/esm/MenuItem.js +1 -1
  17. package/dist/esm/NumberKeyboard.js +1 -1
  18. package/dist/esm/Overlay.js +1 -1
  19. package/dist/esm/Picker.js +1 -1
  20. package/dist/esm/Popover.js +1 -1
  21. package/dist/esm/Popup.js +1 -1
  22. package/dist/esm/PullToRefresh.js +1 -1
  23. package/dist/esm/Range.js +1 -1
  24. package/dist/esm/ShortPassword.js +1 -1
  25. package/dist/esm/SideNavBar.js +1 -1
  26. package/dist/esm/Swipe.js +1 -1
  27. package/dist/esm/Swiper/style/index.js +0 -1
  28. package/dist/esm/Swiper/style/style.css +1 -1
  29. package/dist/esm/TimeSelect.js +1 -1
  30. package/dist/esm/Toast.js +1 -1
  31. package/dist/esm/Tour.js +1 -1
  32. package/dist/esm/{actionsheet.taro-C5BqWoML.js → actionsheet.taro-Dpjoa3xo.js} +1 -1
  33. package/dist/esm/{address.taro-CQmN9x1W.js → address.taro-C7tIIp3x.js} +2 -2
  34. package/dist/esm/{audio.taro-BEskw47C.js → audio.taro-2hRKQ2Lk.js} +1 -1
  35. package/dist/esm/{avatarcropper.taro-CsVKBnvS.js → avatarcropper.taro-Dd4pAR3N.js} +1 -1
  36. package/dist/esm/{calendar.taro-DbHJEx4G.js → calendar.taro-DEsLc-lS.js} +1 -1
  37. package/dist/esm/{cascader.taro-7Xhq98L4.js → cascader.taro-CFcAyFL-.js} +1 -1
  38. package/dist/esm/{datepicker.taro-FiLalMAA.js → datepicker.taro-Bgq3ZNDe.js} +1 -1
  39. package/dist/esm/{dialog.taro-B8Usf0kl.js → dialog.taro-x_jRYew5.js} +1 -1
  40. package/dist/esm/{fixednav.taro-WTBxWxOo.js → fixednav.taro-CJUDQcX1.js} +1 -1
  41. package/dist/esm/{imagepreview.taro-Bb1TkBCV.js → imagepreview.taro-BMlwAhT0.js} +1 -1
  42. package/dist/esm/{input.taro-Dh6zXTLQ.js → input.taro-CAZ-rRMH.js} +2 -1
  43. package/dist/esm/{menu.taro-BAiJPGR7.js → menu.taro-J7oZoaGM.js} +1 -1
  44. package/dist/esm/{menuitem.taro-oLv6ZYC5.js → menuitem.taro-CaI5vTha.js} +1 -1
  45. package/dist/esm/{numberkeyboard.taro-B9rMgy7D.js → numberkeyboard.taro-DjxjkImT.js} +1 -1
  46. package/dist/esm/nutui-react.es.js +26 -26
  47. package/dist/esm/{overlay.taro-BaBu-3-F.js → overlay.taro--1Kf1D7C.js} +1 -1
  48. package/dist/esm/{picker.taro-Cmng9GW9.js → picker.taro-DR2HAkv6.js} +3 -3
  49. package/dist/esm/{popover.taro-BG0msyw5.js → popover.taro-MnR5htLt.js} +1 -1
  50. package/dist/esm/{popup.taro-Iy_WQZ-m.js → popup.taro-B7_iPgl4.js} +1 -1
  51. package/dist/esm/{pulltorefresh.taro-DfVmOGuo.js → pulltorefresh.taro-Ck1i2xRr.js} +1 -1
  52. package/dist/esm/{range.taro-GsWDprz5.js → range.taro-CsC41L60.js} +1 -1
  53. package/dist/esm/{shortpassword.taro-BXsxku33.js → shortpassword.taro-GkcE-e__.js} +1 -1
  54. package/dist/esm/{sidenavbar.taro-eK5vaZPR.js → sidenavbar.taro-5d-6iiNq.js} +1 -1
  55. package/dist/esm/{swipe.taro-aEnunftO.js → swipe.taro-CavqgBEb.js} +1 -1
  56. package/dist/esm/{timeselect.taro-BXq4APSJ.js → timeselect.taro-DkdpBJlT.js} +1 -1
  57. package/dist/esm/{toast.taro-BVXqvjNJ.js → toast.taro-B0YEmeDn.js} +1 -1
  58. package/dist/esm/{tour.taro-BqlNfxdD.js → tour.taro-CdX6pugO.js} +1 -1
  59. package/dist/esm/{use-touch-OfEaR5qi.js → use-touch-BeiLHDO9.js} +13 -3
  60. package/dist/locales/base.js +1 -1
  61. package/dist/locales/en-US.js +1 -1
  62. package/dist/locales/id-ID.js +1 -1
  63. package/dist/locales/tr-TR.js +1 -1
  64. package/dist/locales/zh-CN.js +1 -1
  65. package/dist/locales/zh-TW.js +1 -1
  66. package/dist/locales/zh-UG.js +1 -1
  67. package/dist/nutui.react.es.js +18 -20
  68. package/dist/nutui.react.umd.js +18 -20
  69. package/dist/packages/form/form.scss +0 -3
  70. package/dist/packages/swiper/swiper.scss +30 -16
  71. package/dist/style.css +1 -1
  72. package/dist/style.mjs +1 -1
  73. package/dist/types/packages/input/input.taro.d.ts +1 -1
  74. package/dist/types/packages/swiper/effects/default.d.ts +11 -0
  75. package/dist/types/packages/swiper/effects/focus.d.ts +21 -0
  76. package/dist/types/packages/swiper/index.d.ts +4 -2
  77. package/dist/types/packages/swiper/swiper.d.ts +12 -15
  78. package/dist/types/packages/swiper/types.d.ts +6 -0
  79. package/dist/types/packages/swiperitem/swiperitem.d.ts +8 -4
  80. package/dist/types/utils/use-ref-state.d.ts +3 -0
  81. package/dist/types/utils/use-touch.d.ts +3 -1
  82. package/package.json +1 -1
  83. package/dist/types/packages/picker/doc.en.d.ts +0 -145
package/dist/style.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react-taro v2.5.2 Wed Apr 03 2024 18:06:10 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.6.0 Fri Apr 12 2024 16:18:27 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -94,7 +94,7 @@ export interface InputProps extends BasicComponent {
94
94
  * 获得焦点后触发
95
95
  * @default -
96
96
  */
97
- onFocus?: (value: string) => void
97
+ onFocus?: (value: string, height?: number) => void
98
98
  /**
99
99
  * 点击清空按钮时触发
100
100
  * @default -
@@ -0,0 +1,11 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { SpringValue } from '@react-spring/web';
3
+ type DefaultEffect = {
4
+ children: ReactNode;
5
+ getSpringsAxis: () => SpringValue<number>;
6
+ isVertical: boolean;
7
+ loop: boolean;
8
+ count: number;
9
+ };
10
+ export declare const defaultEffect: (args: DefaultEffect) => React.JSX.Element[] | null | undefined;
11
+ export {};
@@ -0,0 +1,21 @@
1
+ import React, { ReactNode } from 'react';
2
+ export interface FocusEffect {
3
+ name: 'focus';
4
+ scale: number;
5
+ }
6
+ type DefaultEffect = {
7
+ children: ReactNode;
8
+ springs: any;
9
+ isVertical: boolean;
10
+ loop: boolean;
11
+ count: number;
12
+ current: React.MutableRefObject<number>;
13
+ swiperDirection: React.MutableRefObject<number>;
14
+ effect: FocusEffect;
15
+ transforms: React.MutableRefObject<number[]>;
16
+ dragging: boolean;
17
+ };
18
+ export declare const focusEffect: (args: DefaultEffect) => React.JSX.Element[] | null | undefined;
19
+ export declare const useList: (effect: FocusEffect | undefined, count: number, current: React.MutableRefObject<number>) => [React.MutableRefObject<number[]>, (p: number[]) => void];
20
+ export declare const updateTransform: (transforms: React.MutableRefObject<number[]>, setTransforms: any, effect: FocusEffect, page: number) => void;
21
+ export {};
@@ -1,7 +1,9 @@
1
1
  import React from 'react';
2
- import { SwiperProps, SwiperRef } from './swiper';
2
+ import { SwiperProps } from './swiper';
3
3
  import SwiperItem from '../../packages/swiperitem';
4
- export type { SwiperProps, SwiperRef } from './swiper';
4
+ import { SwiperRef } from '../../packages/swiper/types';
5
+ export type { SwiperProps } from './swiper';
6
+ export type { SwiperRef } from './types';
5
7
  type CompoundedComponent = React.ForwardRefExoticComponent<Partial<SwiperProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> & React.RefAttributes<SwiperRef>> & {
6
8
  Item: typeof SwiperItem;
7
9
  };
@@ -1,23 +1,20 @@
1
1
  import React, { ReactNode } from 'react';
2
2
  import { BasicComponent } from '../../utils/typings';
3
- export type SwiperRef = {
4
- to: (index: number) => void;
5
- next: () => void;
6
- prev: () => void;
7
- };
3
+ import { SwiperRef } from '../../packages/swiper/types';
4
+ export interface FocusEffect {
5
+ name: 'focus';
6
+ scale: number;
7
+ }
8
8
  export interface SwiperProps extends BasicComponent {
9
- width: number | string;
10
- height: number | string;
11
- duration: number | string;
12
- defaultValue: number | string;
13
- autoPlay: number | string;
14
9
  direction: 'horizontal' | 'vertical';
15
10
  indicator: ReactNode;
16
11
  loop: boolean;
12
+ duration: number | string;
13
+ autoPlay: boolean | number;
14
+ defaultValue: number;
17
15
  touchable: boolean;
18
- preventDefault: boolean;
19
- stopPropagation: boolean;
20
- center: boolean;
21
- onChange?: (current: number) => void;
16
+ effect: FocusEffect | undefined;
17
+ slideSize?: number;
18
+ onChange?: (index: number) => void;
22
19
  }
23
- export declare const Swiper: React.ForwardRefExoticComponent<Partial<SwiperProps> & Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> & React.RefAttributes<SwiperRef>>;
20
+ export declare const Swiper: React.ForwardRefExoticComponent<Partial<SwiperProps> & React.RefAttributes<SwiperRef>>;
@@ -0,0 +1,6 @@
1
+ export type SwiperDirection = 'horizontal' | 'vertical';
2
+ export type SwiperRef = {
3
+ to: (index: number) => void;
4
+ next: () => void;
5
+ prev: () => void;
6
+ };
@@ -1,6 +1,10 @@
1
1
  import React from 'react';
2
- export interface SwiperItemProps {
3
- direction?: string;
4
- size?: 0;
2
+ import { BasicComponent } from '../../utils/typings';
3
+ export interface SwiperItemProps extends BasicComponent {
4
+ onClick?: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
5
5
  }
6
- export declare const SwiperItem: React.ForwardRefExoticComponent<Partial<SwiperItemProps> & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
6
+ export declare const SwiperItem: {
7
+ (props: SwiperItemProps): React.JSX.Element;
8
+ defaultProps: SwiperItemProps;
9
+ displayName: string;
10
+ };
@@ -0,0 +1,3 @@
1
+ import { MutableRefObject } from 'react';
2
+ export declare const getRefValue: <T>(ref: MutableRefObject<T>) => T;
3
+ export declare const useRefState: <T>(param: T) => [MutableRefObject<T>, (p: T) => void];
@@ -1,10 +1,11 @@
1
1
  import React from 'react';
2
2
  type Direction = '' | 'vertical' | 'horizontal';
3
3
  export declare function useTouch(): {
4
+ end: (event: React.TouchEvent<HTMLElement>) => void;
4
5
  move: (event: React.TouchEvent<HTMLElement>) => void;
5
6
  start: (event: React.TouchEvent<HTMLElement>) => void;
6
7
  reset: () => void;
7
- touchTime: React.MutableRefObject<number | null>;
8
+ touchTime: React.MutableRefObject<number>;
8
9
  startX: React.MutableRefObject<number>;
9
10
  startY: React.MutableRefObject<number>;
10
11
  deltaX: React.MutableRefObject<number>;
@@ -15,5 +16,6 @@ export declare function useTouch(): {
15
16
  direction: React.MutableRefObject<Direction>;
16
17
  isVertical: () => boolean;
17
18
  isHorizontal: () => boolean;
19
+ last: React.MutableRefObject<boolean>;
18
20
  };
19
21
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nutui/nutui-react-taro",
3
- "version": "2.5.2",
3
+ "version": "2.6.0",
4
4
  "style": "dist/style.css",
5
5
  "main": "dist/nutui.react.umd.js",
6
6
  "module": "dist/esm/nutui-react.es.js",
@@ -1,145 +0,0 @@
1
- export declare const Internation: {
2
- 'zh-CN': {
3
- basic: string;
4
- chooseCity: string;
5
- defaultSelected: string;
6
- controlled: string;
7
- tileDesc: string;
8
- multipleColumns: string;
9
- chooseTime: string;
10
- cascade: string;
11
- async: string;
12
- theme: string;
13
- validTime: string;
14
- chooseDate: string;
15
- always: string;
16
- monday: string;
17
- tuesday: string;
18
- wednesday: string;
19
- thursday: string;
20
- friday: string;
21
- morning: string;
22
- afternoon: string;
23
- evening: string;
24
- nanJing: string;
25
- wuXi: string;
26
- zangZu: string;
27
- beiJing: string;
28
- lianYunGang: string;
29
- wuhan: string;
30
- yangzhou: string;
31
- daQing: string;
32
- suiHua: string;
33
- weiFang: string;
34
- shijiazhuang: string;
35
- wlmq: string;
36
- hangZhou: string;
37
- chaoYang: string;
38
- haiDian: string;
39
- daXing: string;
40
- dongCheng: string;
41
- xiCheng: string;
42
- fengTai: string;
43
- shangHai: string;
44
- huangPu: string;
45
- changNing: string;
46
- puTuo: string;
47
- yangPu: string;
48
- puDong: string;
49
- };
50
- 'zh-TW': {
51
- basic: string;
52
- chooseCity: string;
53
- defaultSelected: string;
54
- controlled: string;
55
- tileDesc: string;
56
- multipleColumns: string;
57
- chooseTime: string;
58
- cascade: string;
59
- async: string;
60
- theme: string;
61
- chooseDate: string;
62
- always: string;
63
- monday: string;
64
- tuesday: string;
65
- wednesday: string;
66
- thursday: string;
67
- friday: string;
68
- morning: string;
69
- afternoon: string;
70
- evening: string;
71
- nanJing: string;
72
- wuXi: string;
73
- zangZu: string;
74
- beiJing: string;
75
- lianYunGang: string;
76
- wuhan: string;
77
- yangzhou: string;
78
- daQing: string;
79
- suiHua: string;
80
- weiFang: string;
81
- shijiazhuang: string;
82
- wlmq: string;
83
- hangZhou: string;
84
- chaoYang: string;
85
- haiDian: string;
86
- daXing: string;
87
- dongCheng: string;
88
- xiCheng: string;
89
- fengTai: string;
90
- shangHai: string;
91
- huangPu: string;
92
- changNing: string;
93
- puTuo: string;
94
- yangPu: string;
95
- puDong: string;
96
- };
97
- 'en-US': {
98
- basic: string;
99
- chooseCity: string;
100
- defaultSelected: string;
101
- controlled: string;
102
- tileDesc: string;
103
- multipleColumns: string;
104
- chooseTime: string;
105
- cascade: string;
106
- async: string;
107
- theme: string;
108
- validTime: string;
109
- chooseDate: string;
110
- always: string;
111
- monday: string;
112
- tuesday: string;
113
- wednesday: string;
114
- thursday: string;
115
- friday: string;
116
- morning: string;
117
- afternoon: string;
118
- evening: string;
119
- nanJing: string;
120
- wuXi: string;
121
- zangZu: string;
122
- beiJing: string;
123
- lianYunGang: string;
124
- wuhan: string;
125
- yangzhou: string;
126
- daQing: string;
127
- suiHua: string;
128
- weiFang: string;
129
- shijiazhuang: string;
130
- wlmq: string;
131
- hangZhou: string;
132
- chaoYang: string;
133
- haiDian: string;
134
- daXing: string;
135
- dongCheng: string;
136
- xiCheng: string;
137
- fengTai: string;
138
- shangHai: string;
139
- huangPu: string;
140
- changNing: string;
141
- puTuo: string;
142
- yangPu: string;
143
- puDong: string;
144
- };
145
- };