@nutui/nutui-react 1.3.6 → 1.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 (64) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/dist/esm/Avatar.js +4 -5
  3. package/dist/esm/Cascader.js +2 -2
  4. package/dist/esm/Cell.js +5 -2
  5. package/dist/esm/Collapse.js +7 -3
  6. package/dist/esm/Input.js +35 -19
  7. package/dist/esm/InputNumber.js +15 -1
  8. package/dist/esm/Menu.js +3 -3
  9. package/dist/esm/MenuItem.js +3 -4
  10. package/dist/esm/NoticeBar.js +6 -0
  11. package/dist/esm/Radio.js +2 -2
  12. package/dist/esm/Range.js +7 -1
  13. package/dist/esm/SideNavBar.js +3 -3
  14. package/dist/esm/SideNavBarItem.js +3 -3
  15. package/dist/esm/Signature.js +14 -8
  16. package/dist/esm/Step.js +3 -5
  17. package/dist/esm/Steps.js +2 -1
  18. package/dist/esm/SubSideNavBar.js +3 -3
  19. package/dist/esm/Switch.js +2 -2
  20. package/dist/esm/TabPane.js +2 -2
  21. package/dist/esm/Tabbar.js +5 -2
  22. package/dist/esm/Tabs.js +2 -2
  23. package/dist/esm/TimeSelect.js +20 -5
  24. package/dist/esm/Uploader.js +1 -1
  25. package/dist/esm/Video.js +7 -1
  26. package/dist/esm/VirtualList.js +11 -6
  27. package/dist/esm/{tabpane-c957ab14.js → tabpane-9b8ca8a8.js} +3 -2
  28. package/dist/esm/{tabs-0896a61b.js → tabs-ee05fd2f.js} +8 -4
  29. package/dist/esm/types/src/packages/avatar/avatar.d.ts +1 -0
  30. package/dist/esm/types/src/packages/cell/cell.d.ts +1 -0
  31. package/dist/esm/types/src/packages/collapse/collapse.d.ts +3 -1
  32. package/dist/esm/types/src/packages/input/input.d.ts +10 -2
  33. package/dist/esm/types/src/packages/inputnumber/inputnumber.d.ts +6 -0
  34. package/dist/esm/types/src/packages/noticebar/noticebar.d.ts +3 -1
  35. package/dist/esm/types/src/packages/range/range.d.ts +4 -1
  36. package/dist/esm/types/src/packages/sidenavbar/sidenavbar.d.ts +1 -1
  37. package/dist/esm/types/src/packages/sidenavbaritem/sidenavbaritem.d.ts +1 -1
  38. package/dist/esm/types/src/packages/signature/signature.d.ts +2 -0
  39. package/dist/esm/types/src/packages/steps/steps.d.ts +1 -0
  40. package/dist/esm/types/src/packages/subsidenavbar/subsidenavbar.d.ts +1 -1
  41. package/dist/esm/types/src/packages/switch/switch.d.ts +1 -1
  42. package/dist/esm/types/src/packages/tabbar/tabbar.d.ts +1 -0
  43. package/dist/esm/types/src/packages/tabpane/tabpane.d.ts +6 -2
  44. package/dist/esm/types/src/packages/tabs/tabs.d.ts +1 -0
  45. package/dist/esm/types/src/packages/timeselect/timeselect.d.ts +5 -1
  46. package/dist/esm/types/src/packages/video/video.d.ts +3 -0
  47. package/dist/esm/types/src/packages/virtuallist/type.d.ts +3 -1
  48. package/dist/esm/types/src/packages/virtuallist/virtuallist.d.ts +2 -2
  49. package/dist/locales/base.js +1 -1
  50. package/dist/locales/en-US.js +1 -1
  51. package/dist/locales/id-ID.js +1 -1
  52. package/dist/locales/zh-CN.js +1 -1
  53. package/dist/locales/zh-TW.js +1 -1
  54. package/dist/nutui.react.es.js +167 -72
  55. package/dist/nutui.react.umd.js +167 -72
  56. package/dist/packages/divider/divider.scss +2 -1
  57. package/dist/packages/menu/menu.scss +4 -0
  58. package/dist/packages/menuitem/menuitem.scss +27 -2
  59. package/dist/packages/noticebar/noticebar.scss +4 -1
  60. package/dist/packages/tabs/tabs.scss +3 -1
  61. package/dist/style.css +1 -1
  62. package/dist/style.es.js +1 -1
  63. package/dist/types/index.d.ts +54 -14
  64. package/package.json +3 -1
package/dist/style.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v1.3.6 Wed Oct 12 2022 18:06:51 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui-react v1.3.8 Wed Oct 26 2022 17:29:36 GMT+0800 (中国标准时间)
3
3
  * (c) 2021 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -46,6 +46,7 @@ interface CellProps extends IComponent {
46
46
  iconSlot: ReactNode;
47
47
  linkSlot: ReactNode;
48
48
  click: (event: React__default.MouseEvent<HTMLDivElement, MouseEvent>) => void;
49
+ onClick: (event: React__default.MouseEvent<HTMLDivElement, MouseEvent>) => void;
49
50
  }
50
51
  declare const Cell: FunctionComponent<Partial<CellProps> & Omit<React__default.HTMLAttributes<HTMLDivElement>, 'title'>>;
51
52
 
@@ -377,6 +378,7 @@ interface TabbarProps {
377
378
  className: string;
378
379
  style: React__default.CSSProperties;
379
380
  tabSwitch: (child: React__default.ReactElement<any>, active: number) => void;
381
+ onSwitch: (child: React__default.ReactElement<any>, active: number) => void;
380
382
  children?: React__default.ReactNode;
381
383
  }
382
384
  declare const Tabbar: FunctionComponent<Partial<TabbarProps>>;
@@ -448,6 +450,7 @@ declare type TabsSize = 'large' | 'normal' | 'small';
448
450
  interface TabsProps extends IComponent {
449
451
  className: string;
450
452
  style: React__default.CSSProperties;
453
+ tabStyle: React__default.CSSProperties;
451
454
  value: string | number;
452
455
  color: string;
453
456
  background: string;
@@ -466,15 +469,18 @@ interface TabsProps extends IComponent {
466
469
  }
467
470
  declare const Tabs: FunctionComponent<Partial<TabsProps>>;
468
471
 
472
+ interface TabPanelInnerProps {
473
+ autoHeightClassName: string;
474
+ }
469
475
  interface TabPaneProps {
470
476
  title: string | number;
471
477
  paneKey: string | number;
472
478
  activeKey: string | number;
473
479
  disabled: boolean;
474
- autoHeightClassName: string;
480
+ className: string;
475
481
  children?: React__default.ReactNode;
476
482
  }
477
- declare const TabPane: FunctionComponent<Partial<TabPaneProps>>;
483
+ declare const TabPane: FunctionComponent<Partial<TabPaneProps & TabPanelInnerProps>>;
478
484
 
479
485
  interface IndicatorProps {
480
486
  size: number;
@@ -495,7 +501,7 @@ interface SideNavBarProps extends React__default.HTMLAttributes<HTMLDivElement>,
495
501
  width?: string;
496
502
  offset?: number;
497
503
  position?: 'left' | 'right';
498
- handleClose: () => void;
504
+ onClose: () => void;
499
505
  children?: React__default.ReactNode;
500
506
  }
501
507
  declare const SideNavBar: FunctionComponent<SideNavBarProps>;
@@ -505,7 +511,7 @@ declare type SubSideNavBarProps = {
505
511
  ikey: string | number;
506
512
  open?: boolean;
507
513
  children?: React__default.ReactNode;
508
- titleClick?: ({ title, ikey, isShow, }: {
514
+ onClick?: ({ title, ikey, isShow, }: {
509
515
  title: string;
510
516
  ikey: string | number;
511
517
  isShow: boolean;
@@ -516,7 +522,7 @@ declare const SubSideNavBar: FunctionComponent<SubSideNavBarProps>;
516
522
  declare type SideNavBarItemProps = {
517
523
  title: string;
518
524
  ikey: string | number;
519
- click?: ({ title, ikey }: {
525
+ onClick?: ({ title, ikey }: {
520
526
  title: string;
521
527
  ikey: string | number;
522
528
  }) => void;
@@ -580,8 +586,11 @@ interface RangeProps {
580
586
  change?: (value: number) => void;
581
587
  dragStart?: () => void;
582
588
  dragEnd?: () => void;
589
+ onChange?: (value: number) => void;
590
+ onDragStart?: () => void;
591
+ onDragEnd?: () => void;
583
592
  }
584
- declare const Range: FunctionComponent<Partial<RangeProps> & Omit<React__default.HTMLAttributes<HTMLDivElement>, 'onClick'>>;
593
+ declare const Range: FunctionComponent<Partial<RangeProps> & Omit<React__default.HTMLAttributes<HTMLDivElement>, 'onClick' | 'onChange'>>;
585
594
 
586
595
  declare type CalendarRef$1 = {
587
596
  scrollToDate: (date: string) => void;
@@ -688,6 +697,12 @@ interface InputNumberProps extends IComponent {
688
697
  blur: (e: ChangeEvent<HTMLInputElement>) => void;
689
698
  focus: (e: FocusEvent<HTMLInputElement>) => void;
690
699
  change: (param: string | number, e: MouseEvent | ChangeEvent<HTMLInputElement>) => void;
700
+ onAdd: (e: MouseEvent) => void;
701
+ onReduce: (e: MouseEvent) => void;
702
+ onOverlimit: (e: MouseEvent) => void;
703
+ onBlurFuc: (e: ChangeEvent<HTMLInputElement>) => void;
704
+ onFocus: (e: FocusEvent<HTMLInputElement>) => void;
705
+ onChangeFuc: (param: string | number, e: MouseEvent | ChangeEvent<HTMLInputElement>) => void;
691
706
  }
692
707
  declare const InputNumber: FunctionComponent<Partial<InputNumberProps> & React__default.HTMLAttributes<HTMLDivElement>>;
693
708
 
@@ -739,13 +754,21 @@ interface InputProps extends IComponent {
739
754
  blur?: (value: any, event: Event) => void;
740
755
  focus?: (value: any, event: Event) => void;
741
756
  clear?: (value: any, event: Event) => void;
742
- keypress?: (value: any, event: Event) => void;
743
757
  clickInput?: (value: any) => void;
744
758
  clickLeftIcon?: (value: any) => void;
745
759
  clickRightIcon?: (value: any) => void;
746
760
  click?: (value: any) => void;
761
+ onChange?: (value: any, event: Event) => void;
762
+ onBlur?: (value: any, event: Event) => void;
763
+ onFocus?: (value: any, event: Event) => void;
764
+ onClear?: (value: any, event: Event) => void;
765
+ keypress?: (value: any, event: Event) => void;
766
+ onClickInput?: (value: any) => void;
767
+ onClickLeftIcon?: (value: any) => void;
768
+ onClickRightIcon?: (value: any) => void;
769
+ onClick?: (value: any) => void;
747
770
  }
748
- declare const Input: FunctionComponent<Partial<InputProps> & React__default.HTMLAttributes<HTMLDivElement>>;
771
+ declare const Input: FunctionComponent<Partial<InputProps> & Omit<React__default.HTMLAttributes<HTMLDivElement>, 'onChange' | 'onBlur' | 'onFocus' | 'onClick'>>;
749
772
 
750
773
  declare type Position$1 = 'left' | 'right';
751
774
  declare type Direction = 'horizontal' | 'vertical';
@@ -1245,7 +1268,7 @@ interface SwitchProps {
1245
1268
  inactiveText: string;
1246
1269
  className: string;
1247
1270
  style: React__default.CSSProperties;
1248
- change: (val: boolean, event: React__default.MouseEvent) => void;
1271
+ onChange: (val: boolean, event: React__default.MouseEvent) => void;
1249
1272
  }
1250
1273
  declare const Switch: FunctionComponent<Partial<SwitchProps>>;
1251
1274
 
@@ -1371,8 +1394,10 @@ interface NoticeBarProps extends IComponent {
1371
1394
  rightIcon?: HTMLElement | any;
1372
1395
  close?: (list?: any) => void;
1373
1396
  click?: (item?: any) => void;
1397
+ onClose?: (list?: any) => void;
1398
+ onClick?: (item?: any) => void;
1374
1399
  }
1375
- declare const NoticeBar: FunctionComponent<Partial<NoticeBarProps> & React__default.HTMLAttributes<HTMLDivElement>>;
1400
+ declare const NoticeBar: FunctionComponent<Partial<NoticeBarProps> & Omit<React__default.HTMLAttributes<HTMLDivElement>, 'onClick'>>;
1376
1401
 
1377
1402
  interface StepsProps {
1378
1403
  current: number;
@@ -1381,6 +1406,7 @@ interface StepsProps {
1381
1406
  className: string;
1382
1407
  style: React__default.CSSProperties;
1383
1408
  clickStep: (index: number) => void;
1409
+ onClickStep: (index: number) => void;
1384
1410
  }
1385
1411
  declare const Steps: FunctionComponent<Partial<StepsProps> & React__default.HTMLAttributes<HTMLDivElement>>;
1386
1412
 
@@ -1441,6 +1467,7 @@ interface AvatarProps extends IComponent {
1441
1467
  alt: string;
1442
1468
  style: React__default.CSSProperties;
1443
1469
  activeAvatar: (e: MouseEvent) => void;
1470
+ onActiveAvatar: (e: MouseEvent) => void;
1444
1471
  onError: (e: any) => void;
1445
1472
  }
1446
1473
  declare type AvatarShape = 'round' | 'square';
@@ -1558,13 +1585,15 @@ interface CountDownProps {
1558
1585
  declare const CountDown: React__default.ForwardRefExoticComponent<Partial<CountDownProps> & React__default.RefAttributes<unknown>>;
1559
1586
 
1560
1587
  interface CollapseProps {
1588
+ className: string;
1589
+ style: React__default.CSSProperties;
1561
1590
  activeName: Array<number | string> | number | string;
1562
1591
  accordion: boolean;
1563
1592
  icon: string;
1564
1593
  iconSize: string;
1565
1594
  iconColor: string;
1566
1595
  rotate: number;
1567
- change: (isOpen: boolean, name: string) => void;
1596
+ onChange: (isOpen: boolean, name: string) => void;
1568
1597
  children?: React__default.ReactNode;
1569
1598
  }
1570
1599
  declare const Collapse: FunctionComponent<Partial<CollapseProps>>;
@@ -1619,6 +1648,8 @@ declare const Empty: FunctionComponent<Partial<EmptyProps> & React__default.HTML
1619
1648
 
1620
1649
  declare type Data = any;
1621
1650
  interface IVirtualListProps {
1651
+ className?: string;
1652
+ style?: React.CSSProperties;
1622
1653
  sourceData: Array<Data>;
1623
1654
  containerSize?: number;
1624
1655
  ItemRender?: React.FC<any>;
@@ -1627,15 +1658,15 @@ interface IVirtualListProps {
1627
1658
  horizontal?: boolean;
1628
1659
  overscan?: number;
1629
1660
  handleScroll?: (...args: any[]) => any;
1661
+ onScroll?: (...args: any[]) => any;
1630
1662
  key?: string;
1631
1663
  locale?: {
1632
1664
  [key in string]: string;
1633
1665
  };
1634
- className?: string;
1635
1666
  }
1636
1667
 
1637
1668
  declare type VirtualListProps = IVirtualListProps;
1638
- declare const VirtualList: FunctionComponent<VirtualListProps & React__default.HTMLAttributes<HTMLDivElement>>;
1669
+ declare const VirtualList: FunctionComponent<VirtualListProps>;
1639
1670
 
1640
1671
  interface ITableProps extends IComponent {
1641
1672
  className: string;
@@ -1677,6 +1708,9 @@ interface VideoProps {
1677
1708
  play: (e: HTMLVideoElement) => void;
1678
1709
  pause: (e: HTMLVideoElement) => void;
1679
1710
  playend: (e: HTMLVideoElement) => void;
1711
+ onPlayFuc: (e: HTMLVideoElement) => void;
1712
+ onPauseFuc: (e: HTMLVideoElement) => void;
1713
+ onPlayend: (e: HTMLVideoElement) => void;
1680
1714
  }
1681
1715
  declare const Video: FunctionComponent<Partial<VideoProps> & React__default.HTMLAttributes<HTMLDivElement>>;
1682
1716
 
@@ -1838,6 +1872,8 @@ interface SignatureProps {
1838
1872
  className: string;
1839
1873
  confirm?: (canvas: HTMLCanvasElement, dataurl: string) => void;
1840
1874
  clear?: () => void;
1875
+ onConfirm?: (canvas: HTMLCanvasElement, dataurl: string) => void;
1876
+ onClear?: () => void;
1841
1877
  }
1842
1878
  declare const Signature: FunctionComponent<Partial<SignatureProps> & React__default.HTMLAttributes<HTMLDivElement>>;
1843
1879
 
@@ -1885,6 +1921,7 @@ interface DateType {
1885
1921
  }
1886
1922
  interface TimeSelectProps {
1887
1923
  className?: string;
1924
+ style: React__default.CSSProperties;
1888
1925
  visible?: boolean;
1889
1926
  height?: string;
1890
1927
  multiple?: boolean;
@@ -1896,7 +1933,10 @@ interface TimeSelectProps {
1896
1933
  select?: (selectTimeData: TimeType[]) => void;
1897
1934
  pannelChange?: (pannelKey: string | number, selectTimeData: TimeType[]) => void;
1898
1935
  timeChange?: (time: string, selectTimeData: TimeType[]) => void;
1936
+ onSelect?: (selectTimeData: TimeType[]) => void;
1937
+ onPannelChange?: (pannelKey: string | number, selectTimeData: TimeType[]) => void;
1938
+ onTimeChange?: (time: string, selectTimeData: TimeType[]) => void;
1899
1939
  }
1900
- declare const TimeSelect: FunctionComponent<Partial<TimeSelectProps> & React__default.HTMLAttributes<HTMLDivElement>>;
1940
+ declare const TimeSelect: FunctionComponent<Partial<TimeSelectProps>>;
1901
1941
 
1902
1942
  export { ActionSheet, ActionSheetProps, Address, AddressProps, AnimatingNumbers, AnimatingNumbersProps, Audio, AudioProps, Avatar, AvatarGroup, AvatarGroupProps, AvatarProps, BackTop, BackTopProps, Badge, BadgeProps, Barrage, BarrageProps, Button, ButtonProps, Calendar, CalendarItem, CalendarItemProps, CalendarProps, Card, CardProps, Cascader, CascaderProps, Cell, CellGroup, CellGroupProps, CellProps, Checkbox, CheckboxGroup, CheckboxGroupProps, CheckboxProps, CircleProgress, CircleProgressProps, Col, ColProps, Collapse, CollapseItem, CollapseItemProps, CollapseProps, ConfigProvider, ConfigProviderProps, CountDown, CountDownProps, DatePicker, DatePickerProps, Dialog, DialogProps, Divider, DividerProps, Drag, DragProps, Elevator, ElevatorProps, Empty, EmptyProps, FixedNav, FixedNavProps, Grid, GridItem, GridItemProps, GridProps, Icon, IconProps, ImagePreview, ImagePreviewProps, Indicator, IndicatorProps, Infiniteloading, InfiniteloadingProps, Input, InputNumber, InputNumberProps, InputProps, Layout, LayoutProps, Menu, MenuItem, MenuItemProps, MenuProps, NavBar, NavBarProps$1 as NavBarProps, NoticeBar, NoticeBarProps, _default$1 as Notify, NotifyProps, NumberKeyboard, NumberKeyboardProps, Overlay, OverlayProps, Pagination, PaginationProps, Picker, PickerProps, Popover, PopoverProps, Popup, PopupProps, Price, PriceProps, Progress, ProgressProps, PullToRefresh, PullToRefreshProps, Radio, RadioGroup, RadioGroupProps, RadioProps, Range, RangeProps, Rate, RateProps, Row, RowProps, SearchBar, SearchBarProps, ShortPassword, ShortPasswordProps, SideNavBar, SideNavBarItem, SideNavBarItemProps, SideNavBarProps, Signature, SignatureProps, Skeleton, SkeletonProps, Step, StepProps, Steps, StepsProps, Sticky, StickyProps, SubSideNavBar, SubSideNavBarProps, Swipe, SwipeProps, Swiper, SwiperItem, SwiperItemProps, SwiperProps, Switch, SwitchProps, TabPane, TabPaneProps, Tabbar, TabbarItem, TabbarItemProps, TabbarProps, Table, TableProps, Tabs, TabsProps, Tag, TagProps, TextArea, TextAreaProps, TimeDetail, TimeDetailProps, TimePannel, TimePannelProps, TimeSelect, TimeSelectProps, _default as Toast, ToastProps, Uploader, UploaderProps, Video, VideoProps, VirtualList, VirtualListProps };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nutui/nutui-react",
3
- "version": "1.3.6",
3
+ "version": "1.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",
@@ -103,6 +103,8 @@
103
103
  "@rollup/plugin-typescript": "^8.3.0",
104
104
  "@tarojs/components": "^3.5.5",
105
105
  "@tarojs/taro": "^3.5.5",
106
+ "@tarojs/plugin-platform-weapp": "^3.5.7",
107
+ "@tarojs/taro-loader": "^3.5.7",
106
108
  "@testing-library/jest-dom": "^5.16.3",
107
109
  "@testing-library/react": "^13.3.0",
108
110
  "@types/jest": "^27.4.1",