@nutui/nutui-react-taro 2.0.12 → 2.0.14

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 (117) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/esm/Address.js +7 -5
  3. package/dist/esm/Audio.js +6 -4
  4. package/dist/esm/Calendar.js +6 -4
  5. package/dist/esm/CalendarItem.js +5 -3
  6. package/dist/esm/Cascader.js +4 -3
  7. package/dist/esm/Checkbox.js +3 -2
  8. package/dist/esm/CheckboxGroup.js +3 -2
  9. package/dist/esm/Collapse.js +3 -2
  10. package/dist/esm/ConfigProvider.js +3 -2
  11. package/dist/esm/CountDown.js +3 -2
  12. package/dist/esm/DatePicker.js +6 -4
  13. package/dist/esm/Dialog.js +6 -3
  14. package/dist/esm/Empty.js +3 -2
  15. package/dist/esm/FixedNav.js +3 -2
  16. package/dist/esm/Form.js +2 -2
  17. package/dist/esm/FormItem.js +1 -1
  18. package/dist/esm/Grid.js +4 -3
  19. package/dist/esm/GridItem.js +3 -2
  20. package/dist/esm/ImagePreview.js +3 -2
  21. package/dist/esm/InfiniteLoading.js +3 -2
  22. package/dist/esm/Input.js +5 -3
  23. package/dist/esm/InputNumber.js +3 -2
  24. package/dist/esm/Notify.js +4 -1
  25. package/dist/esm/NumberKeyboard.js +3 -2
  26. package/dist/esm/Pagination.js +5 -3
  27. package/dist/esm/Picker.js +5 -3
  28. package/dist/esm/PullToRefresh.js +3 -2
  29. package/dist/esm/Radio.js +3 -2
  30. package/dist/esm/RadioGroup.js +3 -2
  31. package/dist/esm/Range.js +3 -2
  32. package/dist/esm/Rate.js +3 -2
  33. package/dist/esm/SearchBar.js +3 -2
  34. package/dist/esm/ShortPassword.js +5 -3
  35. package/dist/esm/Skeleton/style/style.css +1 -1
  36. package/dist/esm/Switch.js +3 -2
  37. package/dist/esm/Tabbar.js +3 -2
  38. package/dist/esm/Table.js +3 -2
  39. package/dist/esm/Tabs.js +3 -2
  40. package/dist/esm/TextArea.js +5 -3
  41. package/dist/esm/TimeSelect.js +3 -2
  42. package/dist/esm/Toast.js +5 -1
  43. package/dist/esm/Uploader.js +3 -2
  44. package/dist/esm/WaterMark.js +3 -2
  45. package/dist/esm/{address.taro-fe8a0601.js → address.taro-b58603a5.js} +3 -3
  46. package/dist/esm/{audio.taro-e85bb3b8.js → audio.taro-ef39c1d9.js} +2 -2
  47. package/dist/esm/{calendar.taro-29726d55.js → calendar.taro-c8ddf452.js} +2 -2
  48. package/dist/esm/{calendaritem.taro-9b37d00c.js → calendaritem.taro-0bd17638.js} +2 -2
  49. package/dist/esm/{cascader.taro-e05fd966.js → cascader.taro-ec5179d6.js} +2 -2
  50. package/dist/esm/{checkbox.taro-07d5c9d5.js → checkbox.taro-22cd35c4.js} +1 -1
  51. package/dist/esm/{collapse.taro-bd6b2bb3.js → collapse.taro-4a3e417c.js} +1 -1
  52. package/dist/esm/configprovider.taro-c5ff4877.js +483 -0
  53. package/dist/esm/{countdown.taro-80f2110b.js → countdown.taro-7caa9578.js} +1 -1
  54. package/dist/esm/{datepicker.taro-b894c285.js → datepicker.taro-288d64bb.js} +3 -3
  55. package/dist/esm/{dialog.taro-51697911.js → dialog.taro-519e45af.js} +50 -46
  56. package/dist/esm/{empty.taro-cef66b01.js → empty.taro-05f15f93.js} +1 -1
  57. package/dist/esm/{fixednav.taro-04cf5ffb.js → fixednav.taro-0d998d65.js} +1 -1
  58. package/dist/esm/{form.taro-16cb71e2.js → form.taro-6166be06.js} +1 -1
  59. package/dist/esm/{formitem.taro-34af0204.js → formitem.taro-9e2d3898.js} +1 -1
  60. package/dist/esm/{grid.taro-6f1b764c.js → grid.taro-f72acab8.js} +1 -1
  61. package/dist/esm/{griditem.taro-0d03a061.js → griditem.taro-b7abc653.js} +1 -1
  62. package/dist/esm/{imagepreview.taro-167d1380.js → imagepreview.taro-bc96904b.js} +1 -1
  63. package/dist/esm/{configprovider.taro-3a23ea84.js → index-21e61675.js} +26 -504
  64. package/dist/esm/{infiniteloading.taro-590cfd4f.js → infiniteloading.taro-cb3b949e.js} +1 -1
  65. package/dist/esm/{input.taro-abe6d65e.js → input.taro-fbcb7090.js} +2 -2
  66. package/dist/esm/{inputnumber.taro-9c74cc1c.js → inputnumber.taro-2f6f30d7.js} +1 -1
  67. package/dist/esm/{notify.taro-687d6f8c.js → notify.taro-07e9ead7.js} +2 -24
  68. package/dist/esm/{numberkeyboard.taro-42950800.js → numberkeyboard.taro-f19c44a8.js} +1 -1
  69. package/dist/esm/nutui-react.es.js +44 -41
  70. package/dist/esm/{pagination.taro-c2521fdf.js → pagination.taro-47fad28d.js} +2 -2
  71. package/dist/esm/{picker.taro-bd10e4e7.js → picker.taro-0770a67f.js} +2 -2
  72. package/dist/esm/{pulltorefresh.taro-2b4a48be.js → pulltorefresh.taro-f3ab76c2.js} +1 -1
  73. package/dist/esm/{radio.taro-802db0e9.js → radio.taro-d1d370be.js} +1 -1
  74. package/dist/esm/{range.taro-70101605.js → range.taro-fbbf5522.js} +1 -1
  75. package/dist/esm/{rate.taro-f090e140.js → rate.taro-61bbf5a7.js} +1 -1
  76. package/dist/esm/{searchbar.taro-75cf9937.js → searchbar.taro-7daf43fc.js} +1 -1
  77. package/dist/esm/{shortpassword.taro-d400cd45.js → shortpassword.taro-86563915.js} +2 -2
  78. package/dist/esm/{switch.taro-9c344336.js → switch.taro-74b2bd0a.js} +1 -1
  79. package/dist/esm/{tabbar.taro-ac4f72b9.js → tabbar.taro-4397646a.js} +1 -1
  80. package/dist/esm/{table.taro-48e8265e.js → table.taro-072907bf.js} +1 -1
  81. package/dist/esm/{tabs.taro-eceaf324.js → tabs.taro-3ece2221.js} +2 -1
  82. package/dist/esm/{textarea.taro-115dc986.js → textarea.taro-6ebe789c.js} +2 -2
  83. package/dist/esm/{timeselect.taro-e115bfd7.js → timeselect.taro-6e9fc4d4.js} +1 -1
  84. package/dist/esm/{toast.taro-b6ecbca7.js → toast.taro-a907b5f5.js} +28 -9
  85. package/dist/esm/types/src/packages/dialog/config.d.ts +1 -0
  86. package/dist/esm/types/src/packages/dialog/content.taro.d.ts +1 -1
  87. package/dist/esm/types/src/packages/dialog/dialog.taro.d.ts +11 -3
  88. package/dist/esm/types/src/packages/toast/index.taro.d.ts +1 -1
  89. package/dist/esm/types/src/packages/toast/toast.taro.d.ts +12 -1
  90. package/dist/esm/types/src/utils/use-custom-event.d.ts +4 -0
  91. package/dist/esm/{uploader.taro-cdb38c18.js → uploader.taro-c0bcca89.js} +1 -1
  92. package/dist/esm/use-custom-event-e1689884.js +49 -0
  93. package/dist/esm/use-force-update-9cd7c164.js +8 -0
  94. package/dist/esm/{use-props-value-e8331e19.js → use-props-value-c78cbf9b.js} +2 -6
  95. package/dist/esm/{watermark.taro-cea2fceb.js → watermark.taro-311b59d2.js} +1 -1
  96. package/dist/locales/base.js +1 -1
  97. package/dist/locales/en-US.js +1 -1
  98. package/dist/locales/id-ID.js +1 -1
  99. package/dist/locales/tr-TR.js +1 -1
  100. package/dist/locales/zh-CN.js +1 -1
  101. package/dist/locales/zh-TW.js +1 -1
  102. package/dist/locales/zh-UG.js +1 -1
  103. package/dist/nutui.react.es.js +216 -179
  104. package/dist/nutui.react.umd.js +216 -179
  105. package/dist/packages/skeleton/skeleton.scss +3 -4
  106. package/dist/style.css +1 -1
  107. package/dist/style.mjs +1 -1
  108. package/dist/types/packages/dialog/config.d.ts +1 -0
  109. package/dist/types/packages/dialog/content.taro.d.ts +1 -1
  110. package/dist/types/packages/dialog/dialog.taro.d.ts +11 -3
  111. package/dist/types/packages/loading/loading.taro.d.ts +15 -3
  112. package/dist/types/packages/space/space.taro.d.ts +20 -4
  113. package/dist/types/packages/toast/index.taro.d.ts +1 -1
  114. package/dist/types/packages/toast/toast.taro.d.ts +12 -1
  115. package/dist/types/utils/use-custom-event.d.ts +4 -0
  116. package/package.json +5 -4
  117. package/dist/types/packages/dialog/dialogwrap.taro.d.ts +0 -14
package/dist/style.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react-taro v2.0.12 Fri Aug 11 2023 10:39:12 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.0.14 Fri Aug 18 2023 14:59:07 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -24,6 +24,7 @@ export interface BasicDialogProps {
24
24
  onConfirm?: (e?: MouseEvent<HTMLButtonElement>) => Promise<() => void> | void;
25
25
  onCancel?: () => void;
26
26
  onClick?: () => void;
27
+ onOverlayClick?: () => void;
27
28
  }
28
29
  export type DialogReturnProps = {
29
30
  update: (newConfig: ConfirmProps) => void;
@@ -7,5 +7,5 @@ interface ContentProps {
7
7
  footerDirection: string;
8
8
  onClick: (event: ITouchEvent) => void;
9
9
  }
10
- export declare const Content: FunctionComponent<Partial<ContentProps> & Omit<HTMLAttributes<HTMLDivElement>, 'onClick'>>;
10
+ export declare const Content: FunctionComponent<Partial<ContentProps> & Omit<HTMLAttributes<HTMLDivElement>, 'onClick' | 'title'>>;
11
11
  export {};
@@ -1,4 +1,12 @@
1
- import React from 'react';
1
+ import { FunctionComponent } from 'react';
2
2
  import { BasicDialogProps } from './config';
3
- export type DialogProps = BasicDialogProps;
4
- export declare const BaseDialog: React.ForwardRefExoticComponent<Partial<BasicDialogProps> & Omit<React.HTMLAttributes<HTMLDivElement>, "onClick" | "title" | "content"> & React.RefAttributes<unknown>>;
3
+ import { BasicComponent } from '../../utils/typings';
4
+ export type DialogProps = BasicDialogProps & BasicComponent;
5
+ declare const defaultProps: DialogProps;
6
+ export declare const BaseDialog: FunctionComponent<Partial<DialogProps>> & {
7
+ open: typeof open;
8
+ close: typeof close;
9
+ };
10
+ export declare function open(selector: string, options: Partial<typeof defaultProps>): void;
11
+ export declare function close(selector: string): void;
12
+ export {};
@@ -3,8 +3,20 @@ import { BasicComponent } from '../../utils/typings';
3
3
  export type LoadingType = 'spinner' | 'circular';
4
4
  export type DirectionType = 'horizontal' | 'vertical';
5
5
  export interface LoadingProps extends BasicComponent {
6
- type: LoadingType;
7
- direction: DirectionType;
8
- icon?: ReactNode;
6
+ /**
7
+ * loading图标的样式
8
+ * @default circular
9
+ */
10
+ type: LoadingType
11
+ /**
12
+ * loading图标和文字的排列方式
13
+ * @default horizontal
14
+ */
15
+ direction: DirectionType
16
+ /**
17
+ * 自定义loading的图标
18
+ * @default -
19
+ */
20
+ icon?: ReactNode
9
21
  }
10
22
  export declare const Loading: FunctionComponent<Partial<LoadingProps> & React.HTMLAttributes<HTMLDivElement>>;
@@ -1,9 +1,25 @@
1
1
  import React, { FunctionComponent } from 'react';
2
2
  import { BasicComponent } from '../../utils/typings';
3
3
  export interface SpaceProps extends BasicComponent {
4
- direction: 'horizontal' | 'vertical';
5
- align: 'start' | 'end' | 'center' | 'baseline';
6
- justify: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly' | 'stretch';
7
- wrap: boolean;
4
+ /**
5
+ * 间距方向
6
+ * @default 'horizontal'
7
+ */
8
+ direction: 'horizontal' | 'vertical'
9
+ /**
10
+ * 交叉轴对齐方式
11
+ * @default -
12
+ */
13
+ align: 'start' | 'end' | 'center' | 'baseline'
14
+ /**
15
+ * 主轴对齐方式
16
+ * @default -
17
+ */
18
+ justify: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly' | 'stretch'
19
+ /**
20
+ * 是否自动换行,仅在 horizontal 时有效
21
+ * @default -
22
+ */
23
+ wrap: boolean
8
24
  }
9
25
  export declare const Space: FunctionComponent<Partial<SpaceProps> & React.HTMLAttributes<HTMLDivElement>>;
@@ -1,3 +1,3 @@
1
1
  import { Toast } from './toast.taro';
2
- export type { ToastProps, ToastPositionType } from './toast.taro';
2
+ export type { ToastProps, ToastPositionType, ToastOptions } from './toast.taro';
3
3
  export default Toast;
@@ -71,4 +71,15 @@ export interface ToastProps extends BasicComponent {
71
71
  */
72
72
  onClose: () => void
73
73
  }
74
- export declare const Toast: FunctionComponent<Partial<ToastProps> & React.HTMLAttributes<HTMLDivElement>>;
74
+ export declare const Toast: FunctionComponent<Partial<ToastProps> & React.HTMLAttributes<HTMLDivElement>> & {
75
+ show: typeof show;
76
+ hide: typeof hide;
77
+ };
78
+ export interface ToastOptions {
79
+ title: string;
80
+ msg?: string;
81
+ type?: string;
82
+ duration?: number;
83
+ }
84
+ export declare function show(selector: string, options: ToastOptions): void;
85
+ export declare function hide(selector: string): void;
@@ -1,3 +1,7 @@
1
1
  export declare const customEvents: TaroGeneral.Events;
2
2
  export declare function useCustomEventsPath(selector: string): string;
3
3
  export declare function useCustomEvent(selector: string, cb: any): (<T = any>(args: T) => void)[];
4
+ export declare function useParams<T = any>(args: T): {
5
+ params: T;
6
+ setParams: (args: T) => void;
7
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nutui/nutui-react-taro",
3
- "version": "2.0.12",
3
+ "version": "2.0.14",
4
4
  "style": "dist/style.css",
5
5
  "main": "dist/nutui.react.umd.js",
6
6
  "module": "dist/esm/nutui-react.es.js",
@@ -52,14 +52,14 @@
52
52
  },
53
53
  "dependencies": {
54
54
  "@babel/runtime": "^7.21.0",
55
- "@nutui/icons-react-taro": "0.0.1-beta.8",
55
+ "@nutui/icons-react-taro": "0.0.1",
56
56
  "@nutui/touch-emulator": "^1.0.0",
57
57
  "@react-spring/web": "~9.6.1",
58
58
  "@use-gesture/react": "10.2.20",
59
59
  "async-validator": "^4.2.5",
60
60
  "classnames": "^2.3.2",
61
- "lodash.kebabcase": "^4.1.1",
62
61
  "lodash.isequal": "^4.5.0",
62
+ "lodash.kebabcase": "^4.1.1",
63
63
  "react-transition-group": "^4.4.5"
64
64
  },
65
65
  "peerDependencies": {
@@ -67,6 +67,7 @@
67
67
  },
68
68
  "resolutions": {
69
69
  "@types/react": "18",
70
- "@types/react-dom": "18"
70
+ "@types/react-dom": "18",
71
+ "@swc/core": "1.3.42"
71
72
  }
72
73
  }
@@ -1,14 +0,0 @@
1
- import React, { FunctionComponent, HTMLAttributes } from 'react';
2
- import { OverlayProps } from '../../packages/overlay/overlay.taro';
3
- interface DialogWrapProps extends OverlayProps {
4
- visible: boolean;
5
- overlay: boolean;
6
- overlayStyle: React.CSSProperties;
7
- overlayClassName: string;
8
- footer: React.ReactNode;
9
- onCancel: () => void;
10
- onClose: () => void;
11
- onOverlayClick: (e: MouseEvent) => boolean | void;
12
- }
13
- export declare const DialogWrap: FunctionComponent<Partial<DialogWrapProps> & Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'content' | 'onClick'>>;
14
- export {};