@nutui/nutui-react 2.3.8-beta.0 → 2.3.8

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 +23 -0
  2. package/dist/esm/NavBar/style/style.css +1 -1
  3. package/dist/esm/NavBar.js +49 -5
  4. package/dist/esm/Picker.js +1 -13
  5. package/dist/esm/RadioGroup.js +3 -2
  6. package/dist/esm/Rate/style/style.css +1 -1
  7. package/dist/esm/Rate.js +90 -4
  8. package/dist/esm/Step/style/style.css +1 -1
  9. package/dist/esm/Step.js +1 -1
  10. package/dist/esm/Steps/style/style.css +1 -1
  11. package/dist/esm/radio2.js +4 -4
  12. package/dist/esm/types/src/packages/navbar/navbar.taro.d.ts +2 -1
  13. package/dist/esm/types/src/packages/radio/index.d.ts +2 -1
  14. package/dist/esm/types/src/packages/radio/index.taro.d.ts +2 -1
  15. package/dist/esm/types/src/packages/radio/radio.d.ts +1 -2
  16. package/dist/esm/types/src/packages/radio/radio.taro.d.ts +1 -2
  17. package/dist/esm/types/src/packages/radio/types.d.ts +2 -0
  18. package/dist/esm/types/src/packages/radiogroup/context.d.ts +2 -0
  19. package/dist/esm/types/src/packages/radiogroup/index.d.ts +1 -0
  20. package/dist/esm/types/src/packages/radiogroup/index.taro.d.ts +1 -0
  21. package/dist/esm/types/src/packages/radiogroup/radiogroup.d.ts +4 -6
  22. package/dist/esm/types/src/packages/radiogroup/radiogroup.taro.d.ts +4 -6
  23. package/dist/esm/types/src/packages/radiogroup/types.d.ts +4 -0
  24. package/dist/esm/types/src/packages/rate/rate.d.ts +2 -0
  25. package/dist/esm/types/src/packages/rate/rate.taro.d.ts +2 -0
  26. package/dist/esm/types/src/packages/video/video.taro.d.ts +4 -5
  27. package/dist/esm/use-refs.js +17 -0
  28. package/dist/locales/base.js +1 -1
  29. package/dist/locales/en-US.js +1 -1
  30. package/dist/locales/id-ID.js +1 -1
  31. package/dist/locales/tr-TR.js +1 -1
  32. package/dist/locales/zh-CN.js +1 -1
  33. package/dist/locales/zh-TW.js +1 -1
  34. package/dist/locales/zh-UG.js +1 -1
  35. package/dist/nutui.react.es.js +136 -21
  36. package/dist/nutui.react.umd.js +136 -21
  37. package/dist/packages/navbar/navbar.scss +7 -0
  38. package/dist/packages/rate/rate.scss +1 -0
  39. package/dist/packages/step/step.scss +5 -4
  40. package/dist/style.css +1 -1
  41. package/dist/style.mjs +1 -1
  42. package/dist/types/packages/navbar/navbar.taro.d.ts +2 -1
  43. package/dist/types/packages/overlay/overlay.d.ts +5 -1
  44. package/dist/types/packages/radio/index.d.ts +2 -1
  45. package/dist/types/packages/radio/index.taro.d.ts +2 -1
  46. package/dist/types/packages/radio/radio.d.ts +1 -2
  47. package/dist/types/packages/radio/radio.taro.d.ts +1 -2
  48. package/dist/types/packages/radio/types.d.ts +2 -0
  49. package/dist/types/packages/radiogroup/context.d.ts +2 -0
  50. package/dist/types/packages/radiogroup/index.d.ts +1 -0
  51. package/dist/types/packages/radiogroup/index.taro.d.ts +1 -0
  52. package/dist/types/packages/radiogroup/radiogroup.d.ts +8 -6
  53. package/dist/types/packages/radiogroup/radiogroup.taro.d.ts +4 -6
  54. package/dist/types/packages/radiogroup/types.d.ts +4 -0
  55. package/dist/types/packages/rate/rate.d.ts +10 -0
  56. package/dist/types/packages/rate/rate.taro.d.ts +2 -0
  57. package/dist/types/packages/video/video.taro.d.ts +4 -5
  58. package/package.json +1 -1
package/dist/style.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v2.3.8-beta.0 Tue Jan 23 2024 11:21:29 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.3.8 Fri Jan 26 2024 15:14:26 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,4 +1,5 @@
1
1
  import React, { FunctionComponent } from 'react';
2
+ import { ITouchEvent } from '@tarojs/components';
2
3
  import { BasicComponent } from '../../utils/typings';
3
4
  export interface NavBarProps extends BasicComponent {
4
5
  left: React.ReactNode;
@@ -9,7 +10,7 @@ export interface NavBarProps extends BasicComponent {
9
10
  safeAreaInsetTop: boolean;
10
11
  placeholder: boolean;
11
12
  zIndex: number | string;
12
- onBackClick: (e: React.MouseEvent<HTMLElement>) => void;
13
+ onBackClick: (e: ITouchEvent) => void;
13
14
  children?: React.ReactNode;
14
15
  }
15
16
  export declare const NavBar: FunctionComponent<Partial<NavBarProps>>;
@@ -1,7 +1,11 @@
1
1
  import React, { FunctionComponent, MouseEvent } from 'react';
2
2
  import { BasicComponent } from '../../utils/typings';
3
3
  export interface OverlayProps extends BasicComponent {
4
- zIndex: number;
4
+ /**
5
+ * 设置组件页面层级
6
+ * @default 1000
7
+ */
8
+ zIndex: number
5
9
  /**
6
10
  * 动画时长,单位毫秒
7
11
  * @default 300
@@ -1,3 +1,4 @@
1
1
  import { Radio } from './radio';
2
- export type { RadioProps, RadioShape, RadioPosition } from './radio';
2
+ export type { RadioProps } from './radio';
3
+ export type { RadioShape, RadioPosition } from './types';
3
4
  export default Radio;
@@ -1,3 +1,4 @@
1
1
  import { Radio } from './radio.taro';
2
- export type { RadioProps, RadioPosition, RadioShape } from './radio';
2
+ export type { RadioProps } from './radio.taro';
3
+ export type { RadioShape, RadioPosition } from './types';
3
4
  export default Radio;
@@ -1,8 +1,7 @@
1
1
  import React, { FunctionComponent } from 'react';
2
2
  import RadioGroup from '../../packages/radiogroup';
3
3
  import { BasicComponent } from '../../utils/typings';
4
- export type RadioShape = 'button' | 'round';
5
- export type RadioPosition = 'right' | 'left';
4
+ import { RadioPosition, RadioShape } from '../../packages/radio/types';
6
5
  export interface RadioProps extends BasicComponent {
7
6
  /**
8
7
  * 是否禁用选择
@@ -1,8 +1,7 @@
1
1
  import React, { FunctionComponent } from 'react';
2
2
  import RadioGroup from '../../packages/radiogroup/index.taro';
3
3
  import { BasicComponent } from '../../utils/typings';
4
- export type RadioShape = 'button' | 'round';
5
- export type RadioPosition = 'right' | 'left';
4
+ import { RadioPosition, RadioShape } from '../../packages/radio/types';
6
5
  export interface RadioProps extends BasicComponent {
7
6
  disabled: boolean;
8
7
  checked: boolean;
@@ -0,0 +1,2 @@
1
+ export type RadioShape = 'button' | 'round';
2
+ export type RadioPosition = 'right' | 'left';
@@ -1,8 +1,10 @@
1
1
  import React from 'react';
2
+ import { RadioGroupShape } from './types';
2
3
  declare const _default: React.Context<{
3
4
  labelPosition: 'left' | 'right';
4
5
  disabled: boolean | undefined;
5
6
  value: string | number;
7
+ shape: RadioGroupShape | undefined;
6
8
  check: (value: string | number) => void;
7
9
  uncheck: () => void;
8
10
  } | null>;
@@ -1,2 +1,3 @@
1
1
  import { RadioGroup } from './radiogroup';
2
+ export type { RadioGroupOptionType, RadioGroupPosition, RadioGroupDirection, RadioGroupShape, } from './types';
2
3
  export default RadioGroup;
@@ -1,2 +1,3 @@
1
1
  import { RadioGroup } from './radiogroup.taro';
2
+ export type { RadioGroupOptionType, RadioGroupPosition, RadioGroupDirection, RadioGroupShape, } from './types';
2
3
  export default RadioGroup;
@@ -1,7 +1,5 @@
1
1
  import React from 'react';
2
- import { RadioGroupOptionType } from './types';
3
- type Position = 'left' | 'right';
4
- type Direction = 'horizontal' | 'vertical';
2
+ import { RadioGroupDirection, RadioGroupOptionType, RadioGroupPosition, RadioGroupShape } from './types';
5
3
  export interface RadioGroupProps {
6
4
  /**
7
5
  * 当前选中项的标识符
@@ -13,12 +11,17 @@ export interface RadioGroupProps {
13
11
  * 文本所在的位置
14
12
  * @default right
15
13
  */
16
- labelPosition: Position
14
+ labelPosition: RadioGroupPosition
17
15
  /**
18
16
  * 使用横纵方向
19
17
  * @default vertical
20
18
  */
21
- direction: Direction
19
+ direction: RadioGroupDirection
20
+ /**
21
+ * 形状
22
+ * @default -
23
+ */
24
+ shape?: RadioGroupShape
22
25
  /**
23
26
  * 是否禁用
24
27
  * @default false
@@ -36,4 +39,3 @@ export interface RadioGroupProps {
36
39
  onChange: (value: string | number) => void
37
40
  }
38
41
  export declare const RadioGroup: React.ForwardRefExoticComponent<Partial<RadioGroupProps> & Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> & React.RefAttributes<unknown>>;
39
- export {};
@@ -1,15 +1,13 @@
1
1
  import React from 'react';
2
- import { RadioGroupOptionType } from './types';
3
- type Position = 'left' | 'right';
4
- type Direction = 'horizontal' | 'vertical';
2
+ import { RadioGroupDirection, RadioGroupOptionType, RadioGroupPosition, RadioGroupShape } from './types';
5
3
  export interface RadioGroupProps {
6
4
  value?: string | number;
7
5
  defaultValue?: string | number;
8
- labelPosition: Position;
9
- direction: Direction;
6
+ labelPosition: RadioGroupPosition;
7
+ direction: RadioGroupDirection;
8
+ shape?: RadioGroupShape;
10
9
  disabled?: boolean;
11
10
  options: RadioGroupOptionType[];
12
11
  onChange: (value: string | number) => void;
13
12
  }
14
13
  export declare const RadioGroup: React.ForwardRefExoticComponent<Partial<RadioGroupProps> & Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> & React.RefAttributes<unknown>>;
15
- export {};
@@ -2,5 +2,9 @@ export interface RadioGroupOptionType {
2
2
  label: string;
3
3
  value: string;
4
4
  disabled?: boolean;
5
+ shape?: RadioGroupShape;
5
6
  onChange?: (checked: boolean) => void;
6
7
  }
8
+ export type RadioGroupPosition = 'left' | 'right';
9
+ export type RadioGroupDirection = 'horizontal' | 'vertical';
10
+ export type RadioGroupShape = 'button' | 'round';
@@ -47,9 +47,19 @@ export interface RateProps extends BasicComponent {
47
47
  */
48
48
  allowHalf: boolean
49
49
  /**
50
+ * 是否允许滑动选择 | boolean
51
+ * @default
52
+ */
53
+ touchable: boolean
54
+ /**
50
55
  * 当前 star 数修改时触发
51
56
  * @default -
52
57
  */
53
58
  onChange: (value: number) => void
59
+ /**
60
+ * TouchEnd 事件
61
+ * @default -
62
+ */
63
+ onTouchEnd: (e: TouchEvent, value: number) => void
54
64
  }
55
65
  export declare const Rate: FunctionComponent<Partial<RateProps>>;
@@ -10,6 +10,8 @@ export interface RateProps extends BasicComponent {
10
10
  disabled: boolean;
11
11
  readOnly: boolean;
12
12
  allowHalf: boolean;
13
+ touchable: boolean;
13
14
  onChange: (value: number) => void;
15
+ onTouchEnd: (e: TouchEvent, value: number) => void;
14
16
  }
15
17
  export declare const Rate: FunctionComponent<Partial<RateProps>>;
@@ -1,7 +1,6 @@
1
- import React, { FunctionComponent } from 'react';
2
- import { BaseEventOrig } from '@tarojs/components';
3
- import { BasicComponent } from '../../utils/typings';
4
- export interface VideoProps extends BasicComponent {
1
+ import { FunctionComponent } from 'react';
2
+ import { VideoProps as VideoPropsTaro, BaseEventOrig } from '@tarojs/components';
3
+ export interface VideoProps extends Omit<VideoPropsTaro, 'src'> {
5
4
  source: {
6
5
  type: string;
7
6
  src: string;
@@ -18,4 +17,4 @@ export interface VideoProps extends BasicComponent {
18
17
  onPause: (event: BaseEventOrig<any>) => void;
19
18
  onPlayEnd: (event: BaseEventOrig<any>) => void;
20
19
  }
21
- export declare const Video: FunctionComponent<Partial<VideoProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onPause' | 'onPlay'>>;
20
+ export declare const Video: FunctionComponent<Partial<VideoProps>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nutui/nutui-react",
3
- "version": "2.3.8-beta.0",
3
+ "version": "2.3.8",
4
4
  "style": "dist/style.css",
5
5
  "main": "dist/nutui.react.umd.js",
6
6
  "module": "dist/esm/nutui-react.es.js",