@nutui/nutui-react-taro 2.3.7 → 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 (94) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/esm/Address/style/style.css +1 -1
  3. package/dist/esm/Address.js +3 -3
  4. package/dist/esm/AvatarCropper.js +1 -1
  5. package/dist/esm/Cascader/style/style.css +1 -1
  6. package/dist/esm/Cascader.js +2 -2
  7. package/dist/esm/Collapse.js +2 -2
  8. package/dist/esm/CollapseItem.js +1 -1
  9. package/dist/esm/DatePicker.js +3 -2
  10. package/dist/esm/Ellipsis.js +2 -1
  11. package/dist/esm/NavBar/style/style.css +1 -1
  12. package/dist/esm/NavBar.js +4 -1
  13. package/dist/esm/Picker.js +2 -1
  14. package/dist/esm/Popover.js +1 -1
  15. package/dist/esm/Radio.js +1 -1
  16. package/dist/esm/RadioGroup.js +1 -1
  17. package/dist/esm/Rate/style/style.css +1 -1
  18. package/dist/esm/Rate.js +5 -1
  19. package/dist/esm/Step/style/style.css +1 -1
  20. package/dist/esm/Step.js +2 -1
  21. package/dist/esm/Steps/style/style.css +1 -1
  22. package/dist/esm/Steps.js +1 -1
  23. package/dist/esm/Tabs/style/style.css +1 -1
  24. package/dist/esm/Tabs.js +1 -1
  25. package/dist/esm/Tour.js +2 -2
  26. package/dist/esm/Video.js +1 -2
  27. package/dist/esm/{address.taro-TWHlPzXv.js → address.taro-LCSSqsR-.js} +1 -1
  28. package/dist/esm/{avatarcropper.taro-_IENn5QL.js → avatarcropper.taro-GIZxzMJ_.js} +2 -2
  29. package/dist/esm/{cascader.taro-QW13vwKb.js → cascader.taro-x_X9F_pH.js} +1 -1
  30. package/dist/esm/{collapse.taro-l21-Cvji.js → collapse.taro-sZibDygv.js} +1 -1
  31. package/dist/esm/{collapseitem.taro-9w-h_UP6.js → collapseitem.taro-AaQ_msgd.js} +2 -2
  32. package/dist/esm/{datepicker.taro-OrqtwJFM.js → datepicker.taro-S111IvJO.js} +1 -1
  33. package/dist/esm/{ellipsis.taro-ov_C4kbs.js → ellipsis.taro-VApVqS_j.js} +39 -45
  34. package/dist/esm/navbar.taro-AuKPDCaW.js +105 -0
  35. package/dist/esm/nutui-react.es.js +18 -17
  36. package/dist/esm/{picker.taro-_bT5c-BS.js → picker.taro-RAYmFSC0.js} +1 -11
  37. package/dist/esm/{popover.taro-ScQymuJC.js → popover.taro-MUrnn7xY.js} +1 -1
  38. package/dist/esm/{radio.taro-mZvB2wwi.js → radio.taro-EKJXMjnX.js} +7 -6
  39. package/dist/esm/rate.taro-_5Mjd_EO.js +146 -0
  40. package/dist/esm/{step.taro-kCAQ4Q3-.js → step.taro-_DEZqFGb.js} +6 -5
  41. package/dist/esm/{steps.taro-n6BT6nWE.js → steps.taro-PH0qWPla.js} +5 -4
  42. package/dist/esm/{tabs.taro-aR3XROu9.js → tabs.taro-w8ra49Qb.js} +3 -3
  43. package/dist/esm/{tour.taro-GabSljal.js → tour.taro-HLsDVf9g.js} +3 -3
  44. package/dist/esm/types/src/packages/navbar/navbar.taro.d.ts +2 -1
  45. package/dist/esm/types/src/packages/radio/index.d.ts +2 -1
  46. package/dist/esm/types/src/packages/radio/index.taro.d.ts +2 -1
  47. package/dist/esm/types/src/packages/radio/radio.d.ts +1 -2
  48. package/dist/esm/types/src/packages/radio/radio.taro.d.ts +1 -2
  49. package/dist/esm/types/src/packages/radio/types.d.ts +2 -0
  50. package/dist/esm/types/src/packages/radiogroup/context.d.ts +2 -0
  51. package/dist/esm/types/src/packages/radiogroup/index.d.ts +1 -0
  52. package/dist/esm/types/src/packages/radiogroup/index.taro.d.ts +1 -0
  53. package/dist/esm/types/src/packages/radiogroup/radiogroup.d.ts +4 -6
  54. package/dist/esm/types/src/packages/radiogroup/radiogroup.taro.d.ts +4 -6
  55. package/dist/esm/types/src/packages/radiogroup/types.d.ts +4 -0
  56. package/dist/esm/types/src/packages/rate/rate.d.ts +2 -0
  57. package/dist/esm/types/src/packages/rate/rate.taro.d.ts +2 -0
  58. package/dist/esm/types/src/packages/video/video.taro.d.ts +4 -5
  59. package/dist/esm/use-refs-IdrY0ww3.js +15 -0
  60. package/dist/esm/{video.taro-MDBF77xf.js → video.taro-csvHwS2v.js} +5 -7
  61. package/dist/locales/base.js +1 -1
  62. package/dist/locales/en-US.js +1 -1
  63. package/dist/locales/id-ID.js +1 -1
  64. package/dist/locales/tr-TR.js +1 -1
  65. package/dist/locales/zh-CN.js +1 -1
  66. package/dist/locales/zh-TW.js +1 -1
  67. package/dist/locales/zh-UG.js +1 -1
  68. package/dist/nutui.react.es.js +174 -71
  69. package/dist/nutui.react.umd.js +167 -64
  70. package/dist/packages/navbar/navbar.scss +7 -0
  71. package/dist/packages/rate/rate.scss +6 -0
  72. package/dist/packages/step/step.scss +5 -4
  73. package/dist/packages/tabs/tabs.scss +1 -0
  74. package/dist/style.css +1 -1
  75. package/dist/style.mjs +1 -1
  76. package/dist/types/packages/navbar/navbar.taro.d.ts +2 -1
  77. package/dist/types/packages/overlay/overlay.taro.d.ts +5 -1
  78. package/dist/types/packages/radio/index.d.ts +2 -1
  79. package/dist/types/packages/radio/index.taro.d.ts +2 -1
  80. package/dist/types/packages/radio/radio.d.ts +1 -2
  81. package/dist/types/packages/radio/radio.taro.d.ts +1 -2
  82. package/dist/types/packages/radio/types.d.ts +2 -0
  83. package/dist/types/packages/radiogroup/context.d.ts +2 -0
  84. package/dist/types/packages/radiogroup/index.d.ts +1 -0
  85. package/dist/types/packages/radiogroup/index.taro.d.ts +1 -0
  86. package/dist/types/packages/radiogroup/radiogroup.d.ts +4 -6
  87. package/dist/types/packages/radiogroup/radiogroup.taro.d.ts +8 -6
  88. package/dist/types/packages/radiogroup/types.d.ts +4 -0
  89. package/dist/types/packages/rate/rate.d.ts +2 -0
  90. package/dist/types/packages/rate/rate.taro.d.ts +2 -0
  91. package/dist/types/packages/video/video.taro.d.ts +4 -5
  92. package/package.json +1 -1
  93. package/dist/esm/navbar.taro-v0VHQWR4.js +0 -63
  94. package/dist/esm/rate.taro-ZkOVGSDs.js +0 -77
@@ -1,8 +1,8 @@
1
1
  import React__default, { useState, useEffect } from "react";
2
2
  import { Close } from "@nutui/icons-react-taro";
3
3
  import classNames from "classnames";
4
- import { P as Popover } from "./popover.taro-ScQymuJC.js";
5
- import Taro from "@tarojs/taro";
4
+ import { P as Popover } from "./popover.taro-MUrnn7xY.js";
5
+ import Taro, { createSelectorQuery } from "@tarojs/taro";
6
6
  import { C as ComponentDefaults } from "./typings-buMpDfSR.js";
7
7
  import { useConfig } from "./ConfigProvider.js";
8
8
  const getTaroRectById = (id) => {
@@ -14,7 +14,7 @@ const getTaroRectById = (id) => {
14
14
  }
15
15
  reject();
16
16
  } else {
17
- const query = Taro.createSelectorQuery();
17
+ const query = createSelectorQuery();
18
18
  query.select(`#${id}`).boundingClientRect().exec(function(rect) {
19
19
  if (rect[0]) {
20
20
  resolve(rect[0]);
@@ -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,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
  disabled: boolean;
8
7
  checked: boolean;
@@ -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,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 {};
@@ -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';
@@ -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>>;
@@ -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>>;
@@ -0,0 +1,15 @@
1
+ import React__default from "react";
2
+ function useRefs() {
3
+ const refs = React__default.useRef([]);
4
+ const setRefs = React__default.useCallback((index) => (el) => {
5
+ if (el)
6
+ refs.current[index] = el;
7
+ }, []);
8
+ const reset = React__default.useCallback(() => {
9
+ refs.current = [];
10
+ }, []);
11
+ return [refs.current, setRefs, reset];
12
+ }
13
+ export {
14
+ useRefs as u
15
+ };
@@ -1,9 +1,7 @@
1
1
  import React__default from "react";
2
2
  import classNames from "classnames";
3
- import { Video as Video$1 } from "@tarojs/components";
4
- import { C as ComponentDefaults } from "./typings-buMpDfSR.js";
3
+ import { View, Video as Video$1 } from "@tarojs/components";
5
4
  const defaultProps = {
6
- ...ComponentDefaults,
7
5
  source: {
8
6
  type: {},
9
7
  src: ""
@@ -19,15 +17,15 @@ const defaultProps = {
19
17
  };
20
18
  const classPrefix = `nut-video`;
21
19
  const Video = (props) => {
22
- const { children, source, options, className, onPlay, onPause, onPlayEnd, ...restProps } = {
20
+ const { children, source, options, className, style, onPlay, onPause, onPlayEnd, ...restProps } = {
23
21
  ...defaultProps,
24
22
  ...props
25
23
  };
26
24
  const classes = classNames(classPrefix, className);
27
25
  return React__default.createElement(
28
- "div",
29
- { className: classes, ...restProps },
30
- React__default.createElement(Video$1, { className: "nut-video-player", muted: options.muted, autoplay: options.autoplay, loop: options.loop, poster: options.poster, controls: options.controls, src: source.src, onPlay, onPause, onEnded: onPlayEnd })
26
+ View,
27
+ { className: classes, style },
28
+ React__default.createElement(Video$1, { className: "nut-video-player", muted: options.muted, autoplay: options.autoplay, loop: options.loop, poster: options.poster, controls: options.controls, src: source.src, onPlay, onPause, onEnded: onPlayEnd, ...restProps })
31
29
  );
32
30
  };
33
31
  Video.defaultProps = defaultProps;
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react-taro v2.3.7 Fri Jan 19 2024 16:36:23 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.3.8 Fri Jan 26 2024 15:12:34 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react-taro v2.3.7 Fri Jan 19 2024 16:36:23 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.3.8 Fri Jan 26 2024 15:12:34 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react-taro v2.3.7 Fri Jan 19 2024 16:36:23 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.3.8 Fri Jan 26 2024 15:12:34 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react-taro v2.3.7 Fri Jan 19 2024 16:36:23 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.3.8 Fri Jan 26 2024 15:12:34 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react-taro v2.3.7 Fri Jan 19 2024 16:36:23 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.3.8 Fri Jan 26 2024 15:12:34 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react-taro v2.3.7 Fri Jan 19 2024 16:36:23 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.3.8 Fri Jan 26 2024 15:12:34 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react-taro v2.3.7 Fri Jan 19 2024 16:36:23 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.3.8 Fri Jan 26 2024 15:12:34 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */