@nutui/nutui-react 2.0.0-alpha.15 → 2.0.0-alpha.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 (40) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/esm/DatePicker.js +54 -58
  3. package/dist/esm/Dialog/style/index.js +1 -0
  4. package/dist/esm/Dialog/style/style.css +1 -1
  5. package/dist/esm/Menu/style/style.css +1 -1
  6. package/dist/esm/Menu.js +5 -3
  7. package/dist/esm/MenuItem/style/style.css +1 -1
  8. package/dist/esm/MenuItem.js +31 -44
  9. package/dist/esm/NoticeBar.js +2 -2
  10. package/dist/esm/Picker.js +1 -1
  11. package/dist/esm/Popover.js +3 -40
  12. package/dist/esm/Popup.js +1 -1
  13. package/dist/esm/Toast.js +16 -7
  14. package/dist/esm/Uploader.js +1 -1
  15. package/dist/esm/index.js +2 -2
  16. package/dist/esm/types/src/packages/datepicker/datepicker.d.ts +11 -17
  17. package/dist/esm/types/src/packages/datepicker/datepicker.taro.d.ts +11 -17
  18. package/dist/esm/types/src/packages/datepicker/index.d.ts +1 -0
  19. package/dist/esm/types/src/packages/datepicker/index.taro.d.ts +1 -0
  20. package/dist/esm/types/src/packages/nutui.react.taro.d.ts +2 -2
  21. package/dist/esm/types/src/packages/nutui.taro.react.build.d.ts +2 -2
  22. package/dist/esm/types/src/packages/toast/Notification.d.ts +4 -1
  23. package/dist/esm/use-click-away.js +43 -0
  24. package/dist/locales/base.js +1 -1
  25. package/dist/locales/en-US.js +1 -1
  26. package/dist/locales/id-ID.js +1 -1
  27. package/dist/locales/tr-TR.js +1 -1
  28. package/dist/locales/zh-CN.js +1 -1
  29. package/dist/locales/zh-TW.js +1 -1
  30. package/dist/locales/zh-UG.js +1 -1
  31. package/dist/nutui.react.es.js +210 -224
  32. package/dist/nutui.react.umd.js +210 -224
  33. package/dist/packages/menuitem/menuitem.scss +1 -1
  34. package/dist/packages/noticebar/noticebar.scss +0 -3
  35. package/dist/style.css +1 -1
  36. package/dist/style.mjs +1 -1
  37. package/dist/types/packages/datepicker/datepicker.d.ts +79 -25
  38. package/dist/types/packages/datepicker/index.d.ts +1 -0
  39. package/dist/types/packages/toast/Notification.d.ts +4 -1
  40. package/package.json +1 -1
package/dist/style.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v2.0.0-alpha.15 Wed Jun 07 2023 16:12:22 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.0.0-alpha.16 Fri Jun 09 2023 18:29:59 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,27 +1,81 @@
1
1
  import React, { FunctionComponent } from 'react';
2
- export interface PickerOption {
3
- text: string | number;
4
- value: string | number;
5
- disabled?: boolean;
6
- children?: PickerOption[];
7
- className?: string | number;
2
+ import { PickerOption } from '../../packages/picker/index';
3
+ import { BasicComponent } from '../../utils/typings';
4
+ export interface DatePickerProps extends BasicComponent {
5
+ /**
6
+ * 受控
7
+ * @default null
8
+ */
9
+ value?: Date | null
10
+ /**
11
+ * 初始值
12
+ * @default null
13
+ */
14
+ defaultValue?: Date | null
15
+ /**
16
+ * 是否可见
17
+ * @default false
18
+ */
19
+ visible: boolean
20
+ /**
21
+ * 设置标题
22
+ * @default null
23
+ */
24
+ title: string
25
+ /**
26
+ * 类时间类型,可选值 date time year-month month-day datehour datetime hour-minutes
27
+ * @default date
28
+ */
29
+ type: 'date' | 'time' | 'year-month' | 'month-day' | 'datehour' | 'datetime' | 'hour-minutes'
30
+ /**
31
+ * 每列是否展示中文
32
+ * @default false
33
+ */
34
+ showChinese: boolean
35
+ /**
36
+ * 分钟步进值
37
+ * @default 1
38
+ */
39
+ minuteStep: number
40
+ /**
41
+ * 开始日期
42
+ * @default 十年前
43
+ */
44
+ startDate: Date
45
+ /**
46
+ * 结束日期
47
+ * @default 十年后
48
+ */
49
+ endDate: Date
50
+ /**
51
+ * 是否开启3D效果
52
+ * @default true
53
+ */
54
+ threeDimensional: boolean
55
+ /**
56
+ * 选项格式化函数
57
+ * @default -
58
+ */
59
+ formatter: (type: string, option: PickerOption) => PickerOption
60
+ /**
61
+ * 选项过滤函数
62
+ * @default -
63
+ */
64
+ filter: (type: string, option: PickerOption[]) => PickerOption[]
65
+ /**
66
+ * 关闭时触发
67
+ * @default -
68
+ */
69
+ onClose: () => void
70
+ /**
71
+ * 点击确定按钮时触发
72
+ * @default -
73
+ */
74
+ onConfirm: (selectedOptions: PickerOption[], selectedValue: (string | number)[]) => void
75
+ /**
76
+ * 选项改变时触发
77
+ * @default -
78
+ */
79
+ onChange?: (selectedOptions: PickerOption[], selectedValue: (string | number)[], columnIndex: number) => void
8
80
  }
9
- export interface DatePickerProps {
10
- modelValue: Date | null;
11
- visible: boolean;
12
- title: string;
13
- type: 'date' | 'time' | 'year-month' | 'month-day' | 'datehour' | 'datetime' | 'hour-minutes';
14
- isShowChinese: boolean;
15
- minuteStep: number;
16
- minDate: Date;
17
- maxDate: Date;
18
- threeDimensional: boolean;
19
- className?: string;
20
- style?: React.CSSProperties;
21
- formatter: (type: string, option: PickerOption) => PickerOption;
22
- filter: (type: string, option: PickerOption[]) => PickerOption[];
23
- onCloseDatePicker: () => void;
24
- onConfirmDatePicker: (selectedOptions: PickerOption[], selectedValue: (string | number)[]) => void;
25
- onChange?: (selectedOptions: PickerOption[], selectedValue: (string | number)[], columnIndex: number) => void;
26
- }
27
- export declare const DatePicker: FunctionComponent<Partial<DatePickerProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'>>;
81
+ export declare const DatePicker: FunctionComponent<Partial<DatePickerProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'>>;
@@ -1,2 +1,3 @@
1
1
  import { DatePicker } from './datepicker';
2
+ export type { DatePickerProps } from './datepicker';
2
3
  export default DatePicker;
@@ -13,7 +13,10 @@ export interface NotificationProps extends BasicComponent {
13
13
  contentStyle?: React.CSSProperties;
14
14
  onClose: () => void;
15
15
  }
16
- export default class Notification extends React.PureComponent<NotificationProps> {
16
+ export interface NotificationState {
17
+ show: boolean;
18
+ }
19
+ export default class Notification extends React.PureComponent<NotificationProps, NotificationState> {
17
20
  static newInstance: (properties: NotificationProps, callback: any) => void;
18
21
  private closeTimer;
19
22
  constructor(props: NotificationProps);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nutui/nutui-react",
3
- "version": "2.0.0-alpha.15",
3
+ "version": "2.0.0-alpha.16",
4
4
  "style": "dist/style.css",
5
5
  "main": "dist/nutui.react.umd.js",
6
6
  "module": "dist/esm/nutui-react.es.js",