@nutui/nutui-react-taro 2.0.0-alpha.3 → 2.0.0-alpha.5

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 (122) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/esm/Address.js +3 -5
  3. package/dist/esm/Audio.js +3 -4
  4. package/dist/esm/Avatar.js +6 -5
  5. package/dist/esm/AvatarGroup.js +3 -7
  6. package/dist/esm/Calendar.js +3 -4
  7. package/dist/esm/CalendarItem.js +2 -3
  8. package/dist/esm/CellGroup.js +1 -1
  9. package/dist/esm/Checkbox.js +3 -3
  10. package/dist/esm/CheckboxGroup.js +3 -3
  11. package/dist/esm/CircleProgress.js +2 -3
  12. package/dist/esm/ConfigProvider.js +2 -3
  13. package/dist/esm/CountDown.js +2 -3
  14. package/dist/esm/DatePicker.js +3 -4
  15. package/dist/esm/Dialog.js +2 -3
  16. package/dist/esm/Elevator.js +1 -1
  17. package/dist/esm/Ellipsis.js +3 -4
  18. package/dist/esm/Empty.js +3 -5
  19. package/dist/esm/FixedNav.js +2 -3
  20. package/dist/esm/Form.js +2 -2
  21. package/dist/esm/Grid.js +3 -4
  22. package/dist/esm/GridItem.js +2 -3
  23. package/dist/esm/Image.js +2 -3
  24. package/dist/esm/Infiniteloading.js +2 -3
  25. package/dist/esm/Input.js +5 -3
  26. package/dist/esm/NumberKeyboard.js +2 -3
  27. package/dist/esm/Pagination.js +2 -3
  28. package/dist/esm/Picker.js +2 -3
  29. package/dist/esm/PullToRefresh.js +2 -3
  30. package/dist/esm/Range.js +2 -3
  31. package/dist/esm/SearchBar.js +2 -3
  32. package/dist/esm/ShortPassword.js +2 -3
  33. package/dist/esm/Signature.js +2 -3
  34. package/dist/esm/Skeleton.js +8 -5
  35. package/dist/esm/Swipe.js +1 -1
  36. package/dist/esm/Tabbar/style/index.js +1 -1
  37. package/dist/esm/Tabbar.js +6 -3
  38. package/dist/esm/TabbarItem.js +3 -4
  39. package/dist/esm/Table.js +2 -3
  40. package/dist/esm/TextArea.js +2 -3
  41. package/dist/esm/TimeDetail.js +2 -3
  42. package/dist/esm/TimePannel.js +2 -3
  43. package/dist/esm/TimeSelect.js +4 -5
  44. package/dist/esm/Uploader.js +2 -3
  45. package/dist/esm/VirtualList.js +2 -3
  46. package/dist/esm/WaterMark.js +2 -3
  47. package/dist/esm/{address.taro-67e32c33.js → address.taro-cab0ea22.js} +18 -4
  48. package/dist/esm/{audio.taro-51eafc9d.js → audio.taro-ff280f5e.js} +2 -2
  49. package/dist/esm/{avatar.taro-a840f345.js → avatar.taro-6e8f1f5c.js} +31 -29
  50. package/dist/esm/{avatargroup-0eadb514.js → avatargroup-f4375806.js} +9 -12
  51. package/dist/esm/{calendar.taro-b3ebdc35.js → calendar.taro-2fc9b899.js} +2 -2
  52. package/dist/esm/{calendaritem.taro-ab1ec154.js → calendaritem.taro-2d4a8c34.js} +1 -1
  53. package/dist/esm/{cellgroup.taro-660faffc.js → cellgroup.taro-e05ea802.js} +3 -2
  54. package/dist/esm/checkbox.taro-9d02f86c.js +175 -0
  55. package/dist/esm/{circleprogress.taro-d8973ae9.js → circleprogress.taro-d4943109.js} +21 -27
  56. package/dist/esm/{zh-CN-b4f493ba.js → configprovider.taro-ce34d482.js} +44 -1
  57. package/dist/esm/{countdown.taro-c14b5c1f.js → countdown.taro-3118ba23.js} +1 -1
  58. package/dist/esm/{datepicker.taro-7d522ff8.js → datepicker.taro-2e3e955b.js} +2 -2
  59. package/dist/esm/{dialog.taro-f9ca73a2.js → dialog.taro-eab19eab.js} +1 -1
  60. package/dist/esm/{elevator.taro-360a831f.js → elevator.taro-1a4e3356.js} +16 -8
  61. package/dist/esm/{ellipsis.taro-79044d54.js → ellipsis.taro-e1ac99a1.js} +7 -4
  62. package/dist/esm/{empty.taro-f8585835.js → empty.taro-26363c66.js} +12 -18
  63. package/dist/esm/{fixednav.taro-cca9a6df.js → fixednav.taro-ddb21e87.js} +1 -1
  64. package/dist/esm/{form.taro-7413d868.js → form.taro-423b0f0a.js} +1 -1
  65. package/dist/esm/{grid.taro-10eb7716.js → grid.taro-883a9c35.js} +1 -1
  66. package/dist/esm/{griditem.taro-fb15eeec.js → griditem.taro-16c7055b.js} +1 -1
  67. package/dist/esm/{image.taro-b897a058.js → image.taro-3025e659.js} +1 -1
  68. package/dist/esm/{infiniteloading.taro-cce53c60.js → infiniteloading.taro-721bca1f.js} +1 -1
  69. package/dist/esm/input.taro-06c1e4d5.js +167 -0
  70. package/dist/esm/{numberkeyboard.taro-10ab54d6.js → numberkeyboard.taro-d9b1721b.js} +1 -1
  71. package/dist/esm/nutui-react.es.js +45 -47
  72. package/dist/esm/{pagination.taro-df441058.js → pagination.taro-94f9be5e.js} +1 -1
  73. package/dist/esm/{picker.taro-9f1bb6a4.js → picker.taro-e16b4312.js} +1 -1
  74. package/dist/esm/{pulltorefresh.taro-37dadbc5.js → pulltorefresh.taro-016d0079.js} +1 -1
  75. package/dist/esm/{range.taro-432d20d7.js → range.taro-8953e8c3.js} +1 -1
  76. package/dist/esm/{searchbar.taro-4aa300df.js → searchbar.taro-4467040f.js} +1 -1
  77. package/dist/esm/{shortpassword.taro-99645f99.js → shortpassword.taro-433b86a4.js} +1 -1
  78. package/dist/esm/{signature.taro-e5ede25a.js → signature.taro-a4d9b5c9.js} +1 -1
  79. package/dist/esm/{skeleton.taro-fabd423a.js → skeleton.taro-8ec11af9.js} +2 -2
  80. package/dist/esm/{swipe.taro-b18a73ff.js → swipe.taro-0b8cc872.js} +3 -5
  81. package/dist/esm/tabbar.taro-48413fb8.js +51 -0
  82. package/dist/esm/tabbaritem.taro-5afa3562.js +37 -0
  83. package/dist/esm/{table.taro-eca757f3.js → table.taro-327b4248.js} +1 -1
  84. package/dist/esm/{textarea.taro-e256e741.js → textarea.taro-add72cf3.js} +1 -1
  85. package/dist/esm/{timedetail.taro-cae362b9.js → timedetail.taro-82a2900b.js} +1 -1
  86. package/dist/esm/{timepannel.taro-d6f4cf80.js → timepannel.taro-0573bb65.js} +1 -1
  87. package/dist/esm/{timeselect.taro-804199f9.js → timeselect.taro-29124a34.js} +3 -3
  88. package/dist/esm/{uploader.taro-716f9a50.js → uploader.taro-c70d00de.js} +1 -1
  89. package/dist/esm/{virtuallist.taro-0bd611cb.js → virtuallist.taro-ba8e1f21.js} +1 -1
  90. package/dist/esm/{watermark.taro-8966896a.js → watermark.taro-168cdac5.js} +1 -1
  91. package/dist/locales/base.js +1 -1
  92. package/dist/locales/en-US.js +1 -1
  93. package/dist/locales/id-ID.js +1 -1
  94. package/dist/locales/zh-CN.js +1 -1
  95. package/dist/locales/zh-TW.js +1 -1
  96. package/dist/locales/zh-UG.js +1 -1
  97. package/dist/nutui.react.mjs +975 -1094
  98. package/dist/nutui.react.umd.js +973 -1092
  99. package/dist/packages/badge/badge.scss +0 -1
  100. package/dist/packages/cellgroup/cellgroup.scss +20 -16
  101. package/dist/packages/checkbox/checkbox.scss +8 -11
  102. package/dist/packages/circleprogress/circleprogress.scss +0 -9
  103. package/dist/packages/empty/empty.scss +0 -9
  104. package/dist/packages/input/input.scss +13 -180
  105. package/dist/packages/tabbar/tabbar.scss +16 -22
  106. package/dist/packages/tabbaritem/tabbaritem.scss +9 -70
  107. package/dist/style.css +1 -1
  108. package/dist/style.mjs +1 -1
  109. package/dist/styles/themes/default.scss +0 -1
  110. package/dist/styles/variables-jmapp.scss +12 -16
  111. package/dist/styles/variables.scss +12 -16
  112. package/dist/types/index.d.ts +86 -129
  113. package/package.json +1 -1
  114. package/dist/esm/Icon.js +0 -64
  115. package/dist/esm/checkbox.taro-ae460d3a.js +0 -168
  116. package/dist/esm/configprovider-9960f0fb.js +0 -19
  117. package/dist/esm/configprovider.taro-43a3c646.js +0 -45
  118. package/dist/esm/input.taro-f4e067f7.js +0 -237
  119. package/dist/esm/tabbar.taro-eefd0f8e.js +0 -59
  120. package/dist/esm/tabbaritem.taro-7a97e645.js +0 -55
  121. package/dist/packages/icon/icon.scss +0 -0
  122. /package/dist/esm/{AvatarContext-c96afdcc.js → context-c96afdcc.js} +0 -0
package/dist/style.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react-taro v2.0.0-alpha.3 Fri Apr 28 2023 15:56:31 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.0.0-alpha.5 Wed May 10 2023 15:25:36 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -4,7 +4,6 @@
4
4
  @import '../../packages/cell/cell.scss';
5
5
  @import '../../packages/cellgroup/cellgroup.scss';
6
6
  @import '../../packages/configprovider/configprovider.scss';
7
- @import '../../packages/icon/icon.scss';
8
7
  @import '../../packages/image/image.scss';
9
8
  @import '../../packages/overlay/overlay.scss';
10
9
  @import '../../packages/col/col.scss';
@@ -470,11 +470,11 @@ $picker-mask-bg-img: var(
470
470
  ) !default;
471
471
  //input(✅)
472
472
  $input-border-bottom: var(--nutui-input-border-bottom, #eaf0fb) !default;
473
- $input-disabled-color: var(--nutui-input-disabled-color, #c8c9cc) !default;
474
- $input-required-color: var(
475
- --nutui-input-required-color,
476
- $required-color
473
+ $input-border-bottom-width: var(
474
+ --nutui-input-border-bottom-width,
475
+ 0px
477
476
  ) !default;
477
+ $input-disabled-color: var(--nutui-input-disabled-color, #c8c9cc) !default;
478
478
  $input-font-size: var(--nutui-input-font-size, $font-size-2) !default;
479
479
  $input-padding: var(--nutui-input-padding, 10px 25px) !default;
480
480
 
@@ -871,28 +871,24 @@ $rate-icon-void-color: var(
871
871
  // tabbar(✅)
872
872
  $tabbar-height: var(--nutui-tabbar-height, 50px) !default;
873
873
  $tabbar-active-color: var(--nutui-tabbar-active-color, $primary-color) !default;
874
- $tabbar-unactive-color: var(
875
- --nutui-tabbar-unactive-color,
876
- $primary-color
877
- ) !default;
874
+ $tabbar-inactive-color: var(--nutui-tabbar-inactive-color, $gray1) !default;
878
875
  $tabbar-border-top: var(--nutui-tabbar-border-top, 1px solid #eee) !default;
879
876
  $tabbar-border-bottom: var(
880
877
  --nutui-tabbar-border-bottom,
881
878
  1px solid #eee
882
879
  ) !default;
883
880
  $tabbar-box-shadow: var(--nutui-tabbar-box-shadow, none) !default;
884
- $tabbar-item-text-font-size: var(
885
- --nutui-tabbar-item-text-font-size,
881
+ $tabbar-text-font-size: var(
882
+ --nutui-tabbar-text-font-size,
886
883
  $font-size-0
887
884
  ) !default;
888
- $tabbar-item-text-line-height: var(
889
- --nutui-tabbar-item-text-line-height,
890
- 20px
885
+ $tabbar-text-large-font-size: var(
886
+ --nutui-tabbar-text-large-font-size,
887
+ $font-size-large
891
888
  ) !default;
889
+ $tabbar-text-line-height: var(--nutui-tabbar-text-line-height, 20px) !default;
892
890
  $tabbar-height: var(--nutui-tabbar-height, 50px) !default;
893
- $tabbar-word-margin-top: var(--nutui-tabbar-word-margin-top, 3px) !default;
894
- $tabbar-dot-right: var(--nutui-tabbar-dot-right, 12px) !default;
895
- $tabbar-dot-top: var(--nutui-tabbar-dot-top, 0) !default;
891
+ $tabbar-text-margin-top: var(--nutui-tabbar-text-margin-top, 3px) !default;
896
892
 
897
893
  //infiniteloading(✅)
898
894
  $infiniteloading-bottom-color: var(
@@ -454,11 +454,11 @@ $picker-mask-bg-img: var(
454
454
 
455
455
  //input(✅)
456
456
  $input-border-bottom: var(--nutui-input-border-bottom, #eaf0fb) !default;
457
- $input-disabled-color: var(--nutui-input-disabled-color, #c8c9cc) !default;
458
- $input-required-color: var(
459
- --nutui-input-required-color,
460
- $required-color
457
+ $input-border-bottom-width: var(
458
+ --nutui-input-border-bottom-width,
459
+ 0px
461
460
  ) !default;
461
+ $input-disabled-color: var(--nutui-input-disabled-color, #c8c9cc) !default;
462
462
  $input-font-size: var(--nutui-input-font-size, $font-size-2) !default;
463
463
  $input-padding: var(--nutui-input-padding, 10px 25px) !default;
464
464
 
@@ -858,28 +858,24 @@ $rate-icon-void-color: var(
858
858
  // tabbar(✅)
859
859
  $tabbar-height: var(--nutui-tabbar-height, 50px) !default;
860
860
  $tabbar-active-color: var(--nutui-tabbar-active-color, $primary-color) !default;
861
- $tabbar-unactive-color: var(
862
- --nutui-tabbar-unactive-color,
863
- $primary-color
864
- ) !default;
861
+ $tabbar-inactive-color: var(--nutui-tabbar-inactive-color, $gray1) !default;
865
862
  $tabbar-border-top: var(--nutui-tabbar-border-top, 1px solid #eee) !default;
866
863
  $tabbar-border-bottom: var(
867
864
  --nutui-tabbar-border-bottom,
868
865
  1px solid #eee
869
866
  ) !default;
870
867
  $tabbar-box-shadow: var(--nutui-tabbar-box-shadow, none) !default;
871
- $tabbar-item-text-font-size: var(
872
- --nutui-tabbar-item-text-font-size,
868
+ $tabbar-text-font-size: var(
869
+ --nutui-tabbar-text-font-size,
873
870
  $font-size-0
874
871
  ) !default;
875
- $tabbar-item-text-line-height: var(
876
- --nutui-tabbar-item-text-line-height,
877
- 20px
872
+ $tabbar-text-large-font-size: var(
873
+ --nutui-tabbar-text-large-font-size,
874
+ $font-size-large
878
875
  ) !default;
876
+ $tabbar-text-line-height: var(--nutui-tabbar-text-line-height, 20px) !default;
879
877
  $tabbar-height: var(--nutui-tabbar-height, 50px) !default;
880
- $tabbar-word-margin-top: var(--nutui-tabbar-word-margin-top, 3px) !default;
881
- $tabbar-dot-right: var(--nutui-tabbar-dot-right, 12px) !default;
882
- $tabbar-dot-top: var(--nutui-tabbar-dot-top, 0) !default;
878
+ $tabbar-text-margin-top: var(--nutui-tabbar-text-margin-top, 3px) !default;
883
879
 
884
880
  //infiniteloading(✅)
885
881
  $infiniteloading-bottom-color: var(
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { CSSProperties, ReactNode, FunctionComponent, MouseEvent as MouseEvent$1, MouseEventHandler, HTMLInputTypeAttribute, ChangeEvent, FocusEvent, RefObject, Component } from 'react';
3
- import { ButtonProps as ButtonProps$1, ITouchEvent } from '@tarojs/components';
3
+ import { ButtonProps as ButtonProps$1, ITouchEvent, InputProps as InputProps$1 } from '@tarojs/components';
4
4
  import Taro, { InnerAudioContext } from '@tarojs/taro';
5
5
 
6
6
  interface BasicComponent {
@@ -42,6 +42,7 @@ interface CellGroupProps extends BasicComponent {
42
42
  title: ReactNode;
43
43
  description: ReactNode;
44
44
  children?: ReactNode;
45
+ divider: boolean;
45
46
  }
46
47
  declare const CellGroup: FunctionComponent<Partial<CellGroupProps>>;
47
48
 
@@ -317,7 +318,7 @@ declare const Elevator: FunctionComponent<Partial<ElevatorProps> & React__defaul
317
318
  Context: typeof elevatorContext;
318
319
  };
319
320
 
320
- type Direction$1 = 'right' | 'left';
321
+ type Direction$2 = 'right' | 'left';
321
322
  type Position$2 = {
322
323
  top?: string;
323
324
  bottom?: string;
@@ -329,7 +330,7 @@ interface FixedNavProps extends BasicComponent {
329
330
  activeText: string;
330
331
  inactiveText: string;
331
332
  position: Position$2;
332
- type: Direction$1;
333
+ type: Direction$2;
333
334
  onChange: (item: any) => void;
334
335
  onSelect: (item: any, event: MouseEvent$1) => void;
335
336
  content: React__default.ReactNode;
@@ -387,37 +388,40 @@ type SubSideNavBarProps = {
387
388
  };
388
389
  declare const SubSideNavBar: FunctionComponent<SubSideNavBarProps>;
389
390
 
390
- interface TabbarProps {
391
- visible: number | string;
392
- activeVisible?: number | string;
393
- bottom: boolean;
394
- size: string | number;
395
- unactiveColor: string;
396
- activeColor: string;
397
- safeAreaInsetBottom: boolean;
398
- className: string;
399
- style: React__default.CSSProperties;
400
- onSwitch: (child: React__default.ReactElement<any>, active: number) => void;
401
- children?: React__default.ReactNode;
391
+ interface BadgeProps extends BasicComponent {
392
+ value: ReactNode;
393
+ dot: boolean;
394
+ max: number;
395
+ top: string;
396
+ right: string;
397
+ color: string;
402
398
  }
403
- declare const Tabbar: FunctionComponent<Partial<TabbarProps>>;
399
+ declare const Badge: FunctionComponent<Partial<BadgeProps>>;
404
400
 
405
- interface TabbarItemProps extends BasicComponent {
406
- dot: boolean;
407
- className: string;
408
- tabTitle: string;
409
- icon: React__default.ReactNode;
410
- href: string;
411
- to: any;
412
- num: string | number;
401
+ interface TabbarItemProps extends BadgeProps {
402
+ title: ReactNode;
403
+ icon: ReactNode;
413
404
  active: boolean;
414
405
  activeColor: string;
415
- unactiveColor: string;
406
+ inactiveColor: string;
416
407
  index: number;
417
408
  handleClick: (idx: number) => void;
418
409
  }
419
410
  declare const TabbarItem: FunctionComponent<Partial<TabbarItemProps>>;
420
411
 
412
+ interface TabbarProps extends BasicComponent {
413
+ defaultValue: number;
414
+ value?: number;
415
+ fixed: boolean;
416
+ inactiveColor: string;
417
+ activeColor: string;
418
+ safeArea: boolean;
419
+ onSwitch: (value: number) => void;
420
+ }
421
+ declare const Tabbar: FunctionComponent<Partial<TabbarProps>> & {
422
+ Item: typeof TabbarItem;
423
+ };
424
+
421
425
  interface TabPanelInnerProps {
422
426
  autoHeightClassName: string;
423
427
  }
@@ -633,32 +637,32 @@ interface RadioGroupOptionType {
633
637
  onChange?: MouseEventHandler<HTMLDivElement>;
634
638
  }
635
639
 
636
- type CheckboxTextPosition = 'left' | 'right';
640
+ type CheckboxLabelPosition = 'left' | 'right';
637
641
  type CheckboxDirection = 'horizontal' | 'vertical';
638
642
  interface CheckboxGroupProps {
639
- disabled: boolean;
640
- checkedValue: string[];
643
+ disabled?: boolean;
644
+ value?: string[];
645
+ defaultValue?: string[];
641
646
  max: number | undefined;
642
- textPosition: CheckboxTextPosition;
647
+ labelPosition: CheckboxLabelPosition;
643
648
  direction: CheckboxDirection;
644
- onChange: (value: string[]) => void;
645
649
  options: RadioGroupOptionType[];
650
+ onChange: (value: string[]) => void;
646
651
  }
647
652
  declare const CheckboxGroup: React__default.ForwardRefExoticComponent<Partial<CheckboxGroupProps> & Omit<React__default.HTMLAttributes<HTMLDivElement>, "onChange"> & React__default.RefAttributes<unknown>>;
648
653
 
649
654
  interface CheckboxProps extends BasicComponent {
650
655
  checked: boolean;
651
656
  disabled: boolean;
652
- textPosition: 'left' | 'right';
653
- iconSize: string | number;
657
+ defaultChecked: boolean;
658
+ labelPosition: 'left' | 'right';
654
659
  icon: React__default.ReactNode;
655
- checkedIcon: React__default.ReactNode;
660
+ activeIcon: React__default.ReactNode;
656
661
  indeterminateIcon: React__default.ReactNode;
657
- iconClassPrefix: string;
658
- iconFontClassName: string;
662
+ value: string | number;
659
663
  indeterminate: boolean;
660
664
  label: string | number;
661
- onChange: (state: boolean, label: string) => void;
665
+ onChange: (value: boolean) => void;
662
666
  }
663
667
  declare const Checkbox: FunctionComponent<Partial<CheckboxProps> & Omit<React__default.HTMLAttributes<HTMLDivElement>, 'onChange'>> & {
664
668
  Group: typeof CheckboxGroup;
@@ -783,58 +787,30 @@ declare const Form: FunctionComponent<Partial<FormProps> & React__default.HTMLAt
783
787
 
784
788
  type InputAlignType = 'left' | 'center' | 'right';
785
789
  type InputFormatTrigger = 'onChange' | 'onBlur';
786
- type InputType = HTMLInputTypeAttribute;
787
- type InputRule = {
788
- pattern?: RegExp;
789
- message?: string;
790
- required?: boolean;
791
- };
790
+ type ConfirmTextType = 'send' | 'search' | 'next' | 'go' | 'done';
792
791
  interface InputProps extends BasicComponent {
793
- type: InputType;
792
+ type: keyof InputProps$1.Type | HTMLInputTypeAttribute;
794
793
  name: string;
795
- defaultValue: any;
794
+ defaultValue?: string;
795
+ value?: string;
796
796
  placeholder: string;
797
- label: string;
798
- labelClass: string;
799
- labelWidth: string | number;
800
- labelAlign: InputAlignType;
801
- colon: boolean;
802
- inputAlign: InputAlignType;
803
- center: boolean;
804
- required: boolean;
797
+ align: InputAlignType;
805
798
  disabled: boolean;
806
- readonly: boolean;
807
- error: boolean;
808
- maxlength: any;
809
- leftIcon: React__default.ReactNode;
810
- rightIcon: React__default.ReactNode;
799
+ readOnly: boolean;
800
+ maxLength: number;
811
801
  clearable: boolean;
812
802
  clearIcon: React__default.ReactNode;
813
- clearSize: string | number;
814
- border: boolean;
815
803
  formatTrigger: InputFormatTrigger;
816
- rules: Array<InputRule>;
817
- errorMessage: string;
818
- errorMessageAlign: InputAlignType;
819
- rows: string | number;
820
- showWordLimit: boolean;
821
- autofocus: boolean;
822
- style?: CSSProperties;
823
- className?: string;
824
- slotButton?: React__default.ReactNode;
825
- slotInput?: React__default.ReactNode;
826
- formatter: (value: string) => void;
827
- onChange?: (value: any, event: Event) => void;
828
- onBlur?: (value: any, event: Event) => void;
829
- onFocus?: (value: any, event: Event) => void;
830
- onClear?: (value: any, event: Event) => void;
831
- keypress?: (value: any, event: Event) => void;
832
- onClickInput?: (value: any) => void;
833
- onClickLeftIcon?: (value: any) => void;
834
- onClickRightIcon?: (value: any) => void;
835
- onClick?: (value: any) => void;
804
+ autoFocus: boolean;
805
+ confirmType: ConfirmTextType;
806
+ formatter?: (value: string) => void;
807
+ onChange?: (value: string) => void;
808
+ onBlur?: (value: string) => void;
809
+ onFocus?: (value: string) => void;
810
+ onClear?: (value: string) => void;
811
+ onClick?: (e: ITouchEvent) => void;
836
812
  }
837
- declare const Input: FunctionComponent<Partial<InputProps> & Omit<React__default.HTMLAttributes<HTMLDivElement>, 'onChange' | 'onBlur' | 'onFocus' | 'onClick'>>;
813
+ declare const Input: React__default.ForwardRefExoticComponent<Partial<InputProps> & Partial<Omit<InputProps$1, "type" | "ref" | "onFocus" | "onBlur">> & React__default.RefAttributes<unknown>>;
838
814
 
839
815
  interface InputNumberProps extends BasicComponent {
840
816
  disabled: boolean;
@@ -930,11 +906,11 @@ interface PickerProps {
930
906
  declare const Picker: React__default.ForwardRefExoticComponent<Partial<PickerProps> & React__default.RefAttributes<unknown>>;
931
907
 
932
908
  type Position$1 = 'left' | 'right';
933
- type Direction = 'horizontal' | 'vertical';
909
+ type Direction$1 = 'horizontal' | 'vertical';
934
910
  interface RadioGroupProps {
935
911
  value: string | number | boolean | null;
936
912
  textPosition: Position$1;
937
- direction: Direction;
913
+ direction: Direction$1;
938
914
  onChange: (value: string | number | boolean) => void;
939
915
  options: RadioGroupOptionType[];
940
916
  }
@@ -1272,16 +1248,6 @@ interface ActionSheetProps {
1272
1248
  }
1273
1249
  declare const ActionSheet: FunctionComponent<Partial<ActionSheetProps> & React__default.HTMLAttributes<HTMLDivElement>>;
1274
1250
 
1275
- interface BadgeProps extends BasicComponent {
1276
- value: ReactNode;
1277
- dot: boolean;
1278
- max: number;
1279
- top: string;
1280
- right: string;
1281
- color: string;
1282
- }
1283
- declare const Badge: FunctionComponent<Partial<BadgeProps>>;
1284
-
1285
1251
  interface BasicDialogProps {
1286
1252
  visible?: boolean;
1287
1253
  title?: ReactNode;
@@ -1319,11 +1285,11 @@ interface DragProps extends BasicComponent {
1319
1285
  }
1320
1286
  declare const Drag: FunctionComponent<Partial<DragProps> & React__default.HTMLAttributes<HTMLDivElement>>;
1321
1287
 
1322
- interface EmptyProps {
1323
- image: ReactNode;
1288
+ interface EmptyProps extends BasicComponent {
1289
+ image?: ReactNode;
1324
1290
  imageSize: number | string;
1325
1291
  description: ReactNode;
1326
- className: string;
1292
+ status: 'empty' | 'error' | 'network';
1327
1293
  }
1328
1294
  declare const Empty: FunctionComponent<Partial<EmptyProps> & React__default.HTMLAttributes<HTMLDivElement>>;
1329
1295
 
@@ -1446,7 +1412,6 @@ interface SkeletonProps {
1446
1412
  declare const Skeleton: FunctionComponent<Partial<SkeletonProps>>;
1447
1413
 
1448
1414
  type SwipeSide = 'left' | 'right';
1449
- type SwipePosition = SwipeSide | 'cell' | 'outside';
1450
1415
  interface SwipeInstance {
1451
1416
  open: (side: SwipeSide) => void;
1452
1417
  close: () => void;
@@ -1458,10 +1423,6 @@ interface SwipeProps {
1458
1423
  style: React__default.CSSProperties;
1459
1424
  /** 标识符,可以在事件参数中获取到 */
1460
1425
  name?: string | number;
1461
- /** 指定左侧滑动区域宽度,单位为px */
1462
- leftWidth?: string | number;
1463
- /** 指定右侧滑动区域宽度,单位为 px */
1464
- rightWidth?: string | number;
1465
1426
  /** 左侧滑动区域的内容 */
1466
1427
  leftAction?: React__default.ReactNode;
1467
1428
  /** 右侧滑动区域的内容 */
@@ -1478,10 +1439,10 @@ interface SwipeProps {
1478
1439
  /** 关闭时触发 */
1479
1440
  onClose?: ({ name, position, }: {
1480
1441
  name: string | number;
1481
- position: SwipePosition;
1442
+ position: SwipeSide;
1482
1443
  }) => void;
1483
1444
  /** 点击时触发 */
1484
- onActionClick?: (event: Event, position: SwipePosition) => void;
1445
+ onActionClick?: (event: Event, position: SwipeSide) => void;
1485
1446
  onTouchStart?: (event: Event) => void;
1486
1447
  onTouchEnd?: (event: Event) => void;
1487
1448
  onTouchMove?: (event: Event) => void;
@@ -1584,44 +1545,39 @@ interface AvatarProps extends BasicComponent {
1584
1545
  size: string;
1585
1546
  icon: React__default.ReactNode;
1586
1547
  shape: AvatarShape;
1587
- bgColor: string;
1548
+ background: string;
1588
1549
  color: string;
1589
- prefixCls: string;
1590
- url: string;
1591
- className: string;
1592
- style: React__default.CSSProperties;
1593
- activeAvatar: (e: MouseEvent) => void;
1594
- onActiveAvatar: (e: MouseEvent) => void;
1595
- onError: (e: any) => void;
1550
+ fit: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down';
1551
+ src: string;
1552
+ alt: string;
1553
+ onClick: (e: MouseEvent) => void;
1554
+ onError: () => void;
1596
1555
  }
1597
1556
  type AvatarShape = 'round' | 'square';
1598
- declare const Avatar: FunctionComponent<Partial<AvatarProps> & React__default.HTMLAttributes<HTMLDivElement>>;
1557
+ declare const Avatar: FunctionComponent<Partial<AvatarProps> & Omit<React__default.HTMLAttributes<HTMLDivElement>, 'onClick'>>;
1599
1558
 
1600
- interface AvatarGroupProps {
1559
+ interface AvatarGroupProps extends BasicComponent {
1601
1560
  maxContent: string;
1602
- maxCount: string | number;
1603
- maxBgColor: string;
1561
+ max: string | number;
1562
+ maxBackground: string;
1604
1563
  maxColor: string;
1605
- size: string;
1606
- shape: string;
1607
- span: string;
1608
- zIndex: string;
1609
- className: string;
1610
- style: React__default.CSSProperties;
1564
+ size: 'large' | 'normal' | 'small';
1565
+ shape: 'round' | 'square';
1566
+ gap: string;
1567
+ level: 'left' | 'right';
1611
1568
  }
1612
1569
  declare const AvatarGroup: FunctionComponent<Partial<AvatarGroupProps> & React__default.HTMLAttributes<HTMLDivElement>>;
1613
1570
 
1614
- interface CircleProgressProps {
1615
- progress: string | number;
1571
+ interface CircleProgressProps extends BasicComponent {
1572
+ percent: string | number;
1616
1573
  strokeWidth?: string | number;
1617
1574
  radius?: number | string;
1618
- strokeLinecap?: 'butt' | 'round' | 'square' | 'inherit' | undefined;
1619
- circleColor?: object | string;
1620
- pathColor?: string;
1575
+ strokeLinecap?: 'butt' | 'round' | 'square' | 'inherit';
1576
+ color?: object | string;
1577
+ background?: string;
1621
1578
  clockwise?: boolean;
1622
- className?: string;
1623
1579
  }
1624
- declare const CircleProgress: FunctionComponent<CircleProgressProps & React__default.HTMLAttributes<HTMLDivElement>>;
1580
+ declare const CircleProgress: FunctionComponent<CircleProgressProps & Omit<React__default.HTMLAttributes<HTMLDivElement>, 'color'>>;
1625
1581
 
1626
1582
  interface CollapseProps {
1627
1583
  className: string;
@@ -1666,9 +1622,10 @@ interface CountDownProps {
1666
1622
  }
1667
1623
  declare const CountDown: React__default.ForwardRefExoticComponent<Partial<CountDownProps> & React__default.RefAttributes<unknown>>;
1668
1624
 
1669
- interface EllipsisProps {
1625
+ type Direction = 'start' | 'end' | 'middle';
1626
+ interface EllipsisProps extends BasicComponent {
1670
1627
  content: string;
1671
- direction: string;
1628
+ direction: Direction;
1672
1629
  rows: number | string;
1673
1630
  expandText: string;
1674
1631
  collapseText: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nutui/nutui-react-taro",
3
- "version": "2.0.0-alpha.3",
3
+ "version": "2.0.0-alpha.5",
4
4
  "style": "dist/style.css",
5
5
  "main": "dist/nutui.react.umd.js",
6
6
  "module": "dist/esm/nutui-react.es.js",
package/dist/esm/Icon.js DELETED
@@ -1,64 +0,0 @@
1
- import React from 'react';
2
- import { c as cn } from './bem-350c1702.js';
3
- import '@bem-react/classname';
4
-
5
- const defaultProps = {
6
- name: '',
7
- size: '',
8
- classPrefix: 'nut-icon',
9
- fontClassName: 'nutui-iconfont',
10
- color: '',
11
- tag: 'i',
12
- onClick: (e) => { },
13
- className: '',
14
- };
15
- function pxCheck(value) {
16
- if (value === '') {
17
- return value;
18
- }
19
- if (Number.isNaN(Number(value))) {
20
- return String(value);
21
- }
22
- return `${value}px`;
23
- }
24
- function Icon(props) {
25
- const { name, size, classPrefix, color, tag, children, className, fontClassName, style, onClick, ...rest } = {
26
- ...defaultProps,
27
- ...props,
28
- };
29
- const isImage = name ? name.indexOf('/') !== -1 : false;
30
- const type = isImage ? 'img' : tag;
31
- const b = cn('icon');
32
- const handleClick = (e) => {
33
- if (onClick) {
34
- onClick(e);
35
- }
36
- };
37
- const hasSrc = () => {
38
- if (isImage)
39
- return { src: name };
40
- return {};
41
- };
42
- const styles = {};
43
- const checkedSize = pxCheck(size);
44
- if (checkedSize) {
45
- styles.width = styles.height = styles.fontSize = checkedSize;
46
- }
47
- return React.createElement(type, {
48
- className: isImage
49
- ? `${b('img')} ${className || ''} `
50
- : `${fontClassName} ${b(null)} ${classPrefix}-${name} ${className || ''}`,
51
- style: {
52
- color,
53
- ...styles,
54
- ...style,
55
- },
56
- ...rest,
57
- onClick: handleClick,
58
- ...hasSrc(),
59
- }, children);
60
- }
61
- Icon.defaultProps = defaultProps;
62
- Icon.displayName = 'NutIcon';
63
-
64
- export { Icon as default };