@nutui/nutui-react 2.0.0-alpha.7 → 2.0.0-alpha.9

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 (43) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/esm/Audio.js +12 -8
  3. package/dist/esm/Cascader.js +20 -12
  4. package/dist/esm/Elevator.js +6 -5
  5. package/dist/esm/Image.js +2 -5
  6. package/dist/esm/ImagePreview.js +9 -9
  7. package/dist/esm/Indicator.js +4 -4
  8. package/dist/esm/Notify.js +35 -46
  9. package/dist/esm/NumberKeyboard.js +137 -195
  10. package/dist/esm/Price.js +22 -23
  11. package/dist/esm/PullToRefresh.js +8 -8
  12. package/dist/esm/Radio.js +2 -0
  13. package/dist/esm/RadioGroup.js +31 -51
  14. package/dist/esm/Range/style/index.js +1 -1
  15. package/dist/esm/Range.js +119 -174
  16. package/dist/esm/Swiper.js +100 -111
  17. package/dist/esm/SwiperItem.js +1 -1
  18. package/dist/esm/radio2.js +52 -54
  19. package/dist/esm/tabs2.js +19 -8
  20. package/dist/locales/base.js +1 -1
  21. package/dist/locales/en-US.js +1 -1
  22. package/dist/locales/id-ID.js +1 -1
  23. package/dist/locales/zh-CN.js +1 -1
  24. package/dist/locales/zh-TW.js +1 -1
  25. package/dist/locales/zh-UG.js +1 -1
  26. package/dist/nutui.react.mjs +1306 -1386
  27. package/dist/nutui.react.umd.js +1305 -1385
  28. package/dist/packages/imagepreview/imagepreview.scss +5 -0
  29. package/dist/packages/notify/notify.scss +1 -1
  30. package/dist/packages/numberkeyboard/numberkeyboard.scss +29 -77
  31. package/dist/packages/price/price.scss +8 -0
  32. package/dist/packages/pulltorefresh/pulltorefresh.scss +0 -8
  33. package/dist/packages/radio/radio.scss +13 -32
  34. package/dist/packages/radiogroup/radiogroup.scss +17 -51
  35. package/dist/packages/range/range.scss +24 -49
  36. package/dist/packages/swiper/swiper.scss +0 -15
  37. package/dist/style.css +1 -1
  38. package/dist/style.mjs +1 -1
  39. package/dist/styles/variables-jmapp.scss +61 -61
  40. package/dist/styles/variables.scss +61 -60
  41. package/dist/types/index.d.ts +84 -106
  42. package/package.json +1 -1
  43. /package/dist/esm/{UserContext3.js → context2.js} +0 -0
@@ -1,5 +1,5 @@
1
1
  import * as React$1 from 'react';
2
- import React__default, { CSSProperties, ReactNode, FunctionComponent, MouseEvent as MouseEvent$1, MouseEventHandler, HTMLInputTypeAttribute, ChangeEvent, FocusEvent, RefObject, ForwardRefExoticComponent, PropsWithChildren, Component, ReactEventHandler } from 'react';
2
+ import React__default, { CSSProperties, ReactNode, FunctionComponent, MouseEvent as MouseEvent$1, HTMLInputTypeAttribute, ChangeEvent, FocusEvent, RefObject, ForwardRefExoticComponent, PropsWithChildren, Component, ReactEventHandler } from 'react';
3
3
 
4
4
  interface BasicComponent {
5
5
  className?: string;
@@ -299,6 +299,7 @@ interface ElevatorProps extends BasicComponent {
299
299
  sticky: boolean;
300
300
  spaceHeight: number;
301
301
  titleHeight: number;
302
+ showKeys: boolean;
302
303
  children: React__default.ReactNode;
303
304
  onClickItem: (key: string, item: ElevatorData) => void;
304
305
  onClickIndex: (key: string) => void;
@@ -595,6 +596,7 @@ interface CascaderOption {
595
596
  loading?: boolean;
596
597
  root?: boolean;
597
598
  }
599
+ type CascaderValue = Exclude<CascaderOption['value'], undefined>[];
598
600
  interface optionKey {
599
601
  textKey: string;
600
602
  valueKey: string;
@@ -607,7 +609,8 @@ interface CascaderProps extends BasicComponent {
607
609
  activeColor: string;
608
610
  activeIcon: string;
609
611
  options: CascaderOption[];
610
- value: string[];
612
+ value?: CascaderValue;
613
+ defaultValue?: CascaderValue;
611
614
  title: string;
612
615
  optionKey: optionKey;
613
616
  format: Record<string, string | number | null>;
@@ -617,8 +620,8 @@ interface CascaderProps extends BasicComponent {
617
620
  lazy: boolean;
618
621
  onLoad: (node: any, resolve: any) => void;
619
622
  onClose?: () => void;
620
- onChange: (value: any, params: any) => void;
621
- onPathChange: (value: any, params: any) => void;
623
+ onChange: (value: CascaderValue, params?: any) => void;
624
+ onPathChange: (value: CascaderValue, params: any) => void;
622
625
  }
623
626
  declare const Cascader: React__default.ForwardRefExoticComponent<Partial<CascaderProps> & {
624
627
  children?: React__default.ReactNode;
@@ -628,7 +631,7 @@ interface RadioGroupOptionType {
628
631
  label: string;
629
632
  value: string;
630
633
  disabled?: boolean;
631
- onChange?: MouseEventHandler<HTMLDivElement>;
634
+ onChange?: (checked: boolean) => void;
632
635
  }
633
636
 
634
637
  type CheckboxLabelPosition = 'left' | 'right';
@@ -890,22 +893,39 @@ interface MenuItemProps extends BasicComponent {
890
893
  }
891
894
  declare const MenuItem: React__default.ForwardRefExoticComponent<Partial<MenuItemProps> & React__default.RefAttributes<unknown>>;
892
895
 
893
- interface NumberKeyboardProps {
894
- confirmText: string;
895
- title: string;
896
- visible: boolean;
896
+ type Teleport = HTMLElement | (() => HTMLElement) | null;
897
+ interface PopupProps extends OverlayProps {
898
+ position: string;
899
+ transition: string;
900
+ overlayStyle: React__default.CSSProperties;
901
+ overlayClassName: string;
902
+ closeable: boolean;
903
+ closeIconPosition: string;
904
+ closeIcon: React__default.ReactNode;
905
+ destroyOnClose: boolean;
906
+ portal: Teleport;
897
907
  overlay: boolean;
898
- type: string;
899
- customKey: Array<string>;
900
- randomKeys: boolean;
901
- popClass: string;
902
- className: string;
903
- style?: CSSProperties;
908
+ round: boolean;
909
+ onOpen: () => void;
910
+ onClose: () => void;
911
+ onClickOverlay: (e: MouseEvent$1) => boolean | void;
912
+ onClickCloseIcon: (e: MouseEvent$1) => boolean | void;
913
+ }
914
+ declare const Popup: FunctionComponent<Partial<PopupProps> & React__default.HTMLAttributes<HTMLDivElement>>;
915
+
916
+ interface NumberKeyboardProps extends PopupProps {
917
+ visible: boolean;
918
+ title?: ReactNode;
919
+ confirmText?: string;
920
+ type: 'default' | 'rightColumn';
921
+ custom: Array<string>;
922
+ random: boolean;
904
923
  onChange?: (value: string) => void;
905
924
  onDelete?: () => void;
906
925
  onClose: () => void;
926
+ onConfirm?: () => void;
907
927
  }
908
- declare const NumberKeyboard: FunctionComponent<Partial<NumberKeyboardProps> & Omit<React__default.HTMLAttributes<HTMLDivElement>, 'onChange'>>;
928
+ declare const NumberKeyboard: FunctionComponent<Partial<NumberKeyboardProps> & Omit<React__default.HTMLAttributes<HTMLDivElement>, 'onChange' | 'onClick' | 'title'>>;
909
929
 
910
930
  interface PickerOption {
911
931
  text: string | number;
@@ -933,61 +953,53 @@ declare const Picker: React__default.ForwardRefExoticComponent<Partial<PickerPro
933
953
  type Position$1 = 'left' | 'right';
934
954
  type Direction$1 = 'horizontal' | 'vertical';
935
955
  interface RadioGroupProps {
936
- value: string | number | boolean | null;
937
- textPosition: Position$1;
956
+ value?: string | number;
957
+ defaultValue?: string | number;
958
+ labelPosition: Position$1;
938
959
  direction: Direction$1;
939
- onChange: (value: string | number | boolean) => void;
960
+ disabled?: boolean;
940
961
  options: RadioGroupOptionType[];
962
+ onChange: (value: string | number) => void;
941
963
  }
942
964
  declare const RadioGroup: React__default.ForwardRefExoticComponent<Partial<RadioGroupProps> & Omit<React__default.HTMLAttributes<HTMLDivElement>, "onChange"> & React__default.RefAttributes<unknown>>;
943
965
 
944
966
  type Shape = 'button' | 'round';
945
967
  type Position = 'right' | 'left';
946
968
  interface RadioProps extends BasicComponent {
947
- className: string;
948
- style: React__default.CSSProperties;
949
969
  disabled: boolean;
950
970
  checked: boolean;
971
+ defaultChecked: boolean;
951
972
  shape: Shape;
952
- textPosition: Position;
953
- value: string | number | boolean;
973
+ labelPosition: Position;
954
974
  icon: React__default.ReactNode;
955
- checkedIcon: React__default.ReactNode;
956
- iconSize: string | number;
957
- onChange: MouseEventHandler<HTMLDivElement>;
975
+ activeIcon: React__default.ReactNode;
976
+ value: string | number;
977
+ onChange: (checked: boolean) => void;
958
978
  }
959
- declare const Radio: FunctionComponent<Partial<RadioProps> & React__default.HTMLAttributes<HTMLDivElement>> & {
960
- RadioGroup: typeof RadioGroup;
979
+ declare const Radio: FunctionComponent<Partial<RadioProps> & Omit<React__default.HTMLAttributes<HTMLDivElement>, 'onChange'>> & {
980
+ Group: typeof RadioGroup;
961
981
  };
962
982
 
963
- type SliderValue = number | number[];
964
- interface RangeProps {
965
- className: string;
966
- style: CSSProperties;
983
+ type RangeValue = number | number[];
984
+ interface RangeProps extends BasicComponent {
985
+ value: RangeValue;
986
+ defaultValue: RangeValue;
967
987
  range: boolean;
968
988
  disabled: boolean;
969
- activeColor: string;
970
- inactiveColor: string;
971
- buttonColor: string;
972
- hiddenRange: boolean;
973
- hiddenTag: boolean;
974
- min: number | string;
975
- max: number | string;
976
- minDesc: number | string;
977
- maxDesc: number | string;
978
- curValueDesc: number | string;
979
- step: number | string;
980
- modelValue: SliderValue;
981
- button: React__default.ReactNode;
989
+ min: number;
990
+ max: number;
991
+ step: number;
992
+ minDescription: ReactNode;
993
+ maxDescription: ReactNode;
994
+ button: ReactNode;
982
995
  vertical: boolean;
983
996
  marks: Record<string, unknown>;
984
- dragStart?: () => void;
985
- dragEnd?: () => void;
986
- onChange?: (value: number) => void;
987
- onDragStart?: () => void;
988
- onDragEnd?: () => void;
997
+ currentDescription: ((value: RangeValue) => ReactNode) | null;
998
+ onChange: (value: RangeValue) => void;
999
+ onStart: () => void;
1000
+ onEnd: (value: RangeValue) => void;
989
1001
  }
990
- declare const Range: FunctionComponent<Partial<RangeProps> & Omit<React__default.HTMLAttributes<HTMLDivElement>, 'onClick' | 'onChange'>>;
1002
+ declare const Range: FunctionComponent<Partial<RangeProps> & Omit<React__default.HTMLAttributes<HTMLDivElement>, 'onClick' | 'onChange' | 'defaultValue'>>;
991
1003
 
992
1004
  interface RateProps extends BasicComponent {
993
1005
  count: number;
@@ -1354,24 +1366,20 @@ interface NoticeBarProps extends BasicComponent {
1354
1366
  }
1355
1367
  declare const NoticeBar: FunctionComponent<Partial<NoticeBarProps> & Omit<React__default.HTMLAttributes<HTMLDivElement>, 'onClick'>>;
1356
1368
 
1357
- interface NotifyProps {
1369
+ interface NotifyProps extends BasicComponent {
1358
1370
  id: string;
1359
- color?: string;
1360
- msg: string;
1361
1371
  duration: number;
1362
- className?: string;
1363
- background?: string;
1364
1372
  type: string;
1365
1373
  position: string;
1366
1374
  onClick: () => void;
1367
- onClosed: () => void;
1375
+ onClose: () => void;
1368
1376
  }
1369
1377
  declare const _default$1: {
1370
- text(msg: string | React$1.ReactNode, option?: {}): void;
1371
- success(msg: string | React$1.ReactNode, option?: {}): void;
1372
- primary(msg: string | React$1.ReactNode, option?: {}): void;
1373
- danger(msg: string | React$1.ReactNode, option?: {}): void;
1374
- warn(msg: string | React$1.ReactNode, option?: {}): void;
1378
+ text(message: string | React$1.ReactNode, option?: {}): void;
1379
+ success(message: string | React$1.ReactNode, option?: {}): void;
1380
+ primary(message: string | React$1.ReactNode, option?: {}): void;
1381
+ danger(message: string | React$1.ReactNode, option?: {}): void;
1382
+ warn(message: string | React$1.ReactNode, option?: {}): void;
1375
1383
  hide(): void;
1376
1384
  };
1377
1385
 
@@ -1397,9 +1405,7 @@ interface PopoverProps extends BasicComponent {
1397
1405
  declare const Popover: FunctionComponent<Partial<PopoverProps> & React__default.HTMLAttributes<HTMLDivElement>>;
1398
1406
 
1399
1407
  type PullStatus = 'pulling' | 'canRelease' | 'refreshing' | 'complete';
1400
- interface PullToRefreshProps {
1401
- className: string;
1402
- style: React__default.CSSProperties;
1408
+ interface PullToRefreshProps extends BasicComponent {
1403
1409
  onRefresh: () => Promise<any>;
1404
1410
  pullingText: ReactNode;
1405
1411
  canReleaseText: ReactNode;
@@ -1410,7 +1416,6 @@ interface PullToRefreshProps {
1410
1416
  threshold: number;
1411
1417
  disabled: boolean;
1412
1418
  renderText: (status: PullStatus) => ReactNode;
1413
- children: React__default.ReactNode;
1414
1419
  }
1415
1420
  declare const PullToRefresh: FunctionComponent<Partial<PullToRefreshProps>>;
1416
1421
 
@@ -1471,26 +1476,6 @@ interface SwipeProps {
1471
1476
  }
1472
1477
  declare const Swipe: React__default.ForwardRefExoticComponent<Partial<SwipeProps> & Omit<React__default.HTMLAttributes<HTMLDivElement>, "onTouchEnd" | "onTouchMove" | "onTouchStart"> & React__default.RefAttributes<SwipeInstance>>;
1473
1478
 
1474
- type Teleport = HTMLElement | (() => HTMLElement) | null;
1475
- interface PopupProps extends OverlayProps {
1476
- position: string;
1477
- transition: string;
1478
- overlayStyle: React__default.CSSProperties;
1479
- overlayClassName: string;
1480
- closeable: boolean;
1481
- closeIconPosition: string;
1482
- closeIcon: React__default.ReactNode;
1483
- destroyOnClose: boolean;
1484
- portal: Teleport;
1485
- overlay: boolean;
1486
- round: boolean;
1487
- onOpen: () => void;
1488
- onClose: () => void;
1489
- onClickOverlay: (e: MouseEvent$1) => boolean | void;
1490
- onClickCloseIcon: (e: MouseEvent$1) => boolean | void;
1491
- }
1492
- declare const Popup: FunctionComponent<Partial<PopupProps> & React__default.HTMLAttributes<HTMLDivElement>>;
1493
-
1494
1479
  interface ToastProps {
1495
1480
  id?: string;
1496
1481
  msg: string;
@@ -1557,7 +1542,7 @@ declare class AnimatingNumbers extends Component<AnimatingNumbersProps, Animatin
1557
1542
  interface AudioProps extends BasicComponent {
1558
1543
  src: string;
1559
1544
  muted: boolean;
1560
- autoplay: boolean;
1545
+ autoPlay: boolean;
1561
1546
  loop: boolean;
1562
1547
  preload: string;
1563
1548
  type: string;
@@ -1681,10 +1666,10 @@ interface ImagePreviewProps {
1681
1666
  };
1682
1667
  }>;
1683
1668
  show: boolean;
1684
- autoplay: number | string;
1669
+ autoPlay: number | string;
1685
1670
  initNo: number;
1686
1671
  contentClose: boolean;
1687
- paginationVisible: boolean;
1672
+ indicator: boolean;
1688
1673
  style?: CSSProperties;
1689
1674
  paginationColor: string;
1690
1675
  onClose: () => void;
@@ -1735,16 +1720,14 @@ interface PaginationProps extends BasicComponent {
1735
1720
  }
1736
1721
  declare const Pagination: FunctionComponent<Partial<PaginationProps> & Omit<React__default.HTMLAttributes<HTMLDivElement>, 'onChange'>>;
1737
1722
 
1738
- interface PriceProps {
1723
+ interface PriceProps extends BasicComponent {
1739
1724
  price: number | string;
1740
- needSymbol: boolean;
1741
1725
  symbol: string;
1742
- decimalDigits: number;
1726
+ digits: number;
1743
1727
  thousands: boolean;
1744
1728
  position: string;
1745
1729
  size: string;
1746
- className: string;
1747
- style: React__default.CSSProperties;
1730
+ line: boolean;
1748
1731
  }
1749
1732
  declare const Price: FunctionComponent<Partial<PriceProps>>;
1750
1733
 
@@ -1786,25 +1769,20 @@ type SwiperRef = {
1786
1769
  next: () => void;
1787
1770
  prev: () => void;
1788
1771
  };
1789
- interface SwiperProps {
1772
+ interface SwiperProps extends BasicComponent {
1790
1773
  width: number | string;
1791
1774
  height: number | string;
1792
1775
  duration: number | string;
1793
- initPage: number | string;
1776
+ defaultValue: number | string;
1794
1777
  autoPlay: number | string;
1795
1778
  direction: 'horizontal' | 'vertical';
1796
- paginationColor: string;
1797
- paginationBgColor: string;
1798
- paginationVisible: boolean;
1779
+ indicator: ReactNode;
1799
1780
  loop: boolean;
1800
1781
  touchable: boolean;
1801
- isPreventDefault: boolean;
1802
- isStopPropagation: boolean;
1803
- isCenter: boolean;
1804
- className?: string;
1805
- style?: React__default.CSSProperties;
1806
- pageContent?: React__default.ReactNode;
1807
- onChange?: (currPage: number) => void;
1782
+ preventDefault: boolean;
1783
+ stopPropagation: boolean;
1784
+ center: boolean;
1785
+ onChange?: (current: number) => void;
1808
1786
  }
1809
1787
  declare const Swiper: React__default.ForwardRefExoticComponent<Partial<SwiperProps> & Omit<React__default.HTMLAttributes<HTMLDivElement>, "onChange"> & React__default.RefAttributes<SwiperRef>>;
1810
1788
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nutui/nutui-react",
3
- "version": "2.0.0-alpha.7",
3
+ "version": "2.0.0-alpha.9",
4
4
  "style": "dist/style.css",
5
5
  "main": "dist/nutui.react.umd.js",
6
6
  "module": "dist/esm/nutui-react.es.js",
File without changes