@nutui/nutui-react 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.
- package/CHANGELOG.md +24 -0
- package/dist/esm/Avatar.js +30 -25
- package/dist/esm/AvatarGroup.js +10 -15
- package/dist/esm/Badge.js +4 -66
- package/dist/esm/Checkbox.js +1 -2
- package/dist/esm/CheckboxGroup.js +18 -20
- package/dist/esm/CircleProgress.js +20 -25
- package/dist/esm/Ellipsis.js +13 -12
- package/dist/esm/Empty.js +18 -26
- package/dist/esm/Input.js +87 -193
- package/dist/esm/Skeleton.js +1 -1
- package/dist/esm/Swipe.js +4 -10
- package/dist/esm/Tabbar/style/index.js +1 -1
- package/dist/esm/Tabbar.js +29 -33
- package/dist/esm/TabbarItem.js +5 -75
- package/dist/esm/badge2.js +69 -0
- package/dist/esm/cellgroup2.js +5 -4
- package/dist/esm/checkbox2.js +34 -47
- package/dist/esm/tabbaritem2.js +61 -0
- package/dist/locales/base.js +1 -1
- package/dist/locales/en-US.js +1 -1
- package/dist/locales/id-ID.js +1 -1
- package/dist/locales/zh-CN.js +1 -1
- package/dist/locales/zh-TW.js +1 -1
- package/dist/locales/zh-UG.js +1 -1
- package/dist/nutui.react.mjs +846 -997
- package/dist/nutui.react.umd.js +846 -997
- package/dist/packages/badge/badge.scss +0 -1
- package/dist/packages/cellgroup/cellgroup.scss +20 -16
- package/dist/packages/checkbox/checkbox.scss +8 -11
- package/dist/packages/circleprogress/circleprogress.scss +0 -9
- package/dist/packages/empty/empty.scss +0 -9
- package/dist/packages/input/input.scss +13 -180
- package/dist/packages/tabbar/tabbar.scss +16 -22
- package/dist/packages/tabbaritem/tabbaritem.scss +9 -70
- package/dist/style.css +1 -1
- package/dist/style.mjs +1 -1
- package/dist/styles/themes/default.scss +0 -1
- package/dist/styles/variables-jmapp.scss +12 -16
- package/dist/styles/variables.scss +12 -16
- package/dist/types/index.d.ts +80 -126
- package/package.json +1 -1
- package/dist/esm/Icon.js +0 -83
- package/dist/packages/icon/icon.scss +0 -0
- /package/dist/esm/{AvatarContext.js → context.js} +0 -0
package/dist/style.mjs
CHANGED
|
@@ -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-
|
|
474
|
-
|
|
475
|
-
|
|
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-
|
|
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-
|
|
885
|
-
--nutui-tabbar-
|
|
881
|
+
$tabbar-text-font-size: var(
|
|
882
|
+
--nutui-tabbar-text-font-size,
|
|
886
883
|
$font-size-0
|
|
887
884
|
) !default;
|
|
888
|
-
$tabbar-
|
|
889
|
-
--nutui-tabbar-
|
|
890
|
-
|
|
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-
|
|
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-
|
|
458
|
-
|
|
459
|
-
|
|
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-
|
|
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-
|
|
872
|
-
--nutui-tabbar-
|
|
868
|
+
$tabbar-text-font-size: var(
|
|
869
|
+
--nutui-tabbar-text-font-size,
|
|
873
870
|
$font-size-0
|
|
874
871
|
) !default;
|
|
875
|
-
$tabbar-
|
|
876
|
-
--nutui-tabbar-
|
|
877
|
-
|
|
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-
|
|
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(
|
package/dist/types/index.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ interface CellGroupProps extends BasicComponent {
|
|
|
39
39
|
title: ReactNode;
|
|
40
40
|
description: ReactNode;
|
|
41
41
|
children?: ReactNode;
|
|
42
|
+
divider: boolean;
|
|
42
43
|
}
|
|
43
44
|
declare const CellGroup: FunctionComponent<Partial<CellGroupProps>>;
|
|
44
45
|
|
|
@@ -311,7 +312,7 @@ declare const Elevator: FunctionComponent<Partial<ElevatorProps> & React__defaul
|
|
|
311
312
|
Context: typeof elevatorContext;
|
|
312
313
|
};
|
|
313
314
|
|
|
314
|
-
type Direction$
|
|
315
|
+
type Direction$2 = 'right' | 'left';
|
|
315
316
|
type Position$2 = {
|
|
316
317
|
top?: string;
|
|
317
318
|
bottom?: string;
|
|
@@ -323,7 +324,7 @@ interface FixedNavProps extends BasicComponent {
|
|
|
323
324
|
activeText: string;
|
|
324
325
|
inactiveText: string;
|
|
325
326
|
position: Position$2;
|
|
326
|
-
type: Direction$
|
|
327
|
+
type: Direction$2;
|
|
327
328
|
onChange: (item: any) => void;
|
|
328
329
|
onSelect: (item: any, event: MouseEvent$1) => void;
|
|
329
330
|
content: React__default.ReactNode;
|
|
@@ -381,36 +382,40 @@ type SubSideNavBarProps = {
|
|
|
381
382
|
};
|
|
382
383
|
declare const SubSideNavBar: FunctionComponent<SubSideNavBarProps>;
|
|
383
384
|
|
|
384
|
-
interface
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
safeAreaInsetBottom: boolean;
|
|
392
|
-
className: string;
|
|
393
|
-
style: React__default.CSSProperties;
|
|
394
|
-
onSwitch: (child: React__default.ReactElement<any>, active: number) => void;
|
|
395
|
-
children?: React__default.ReactNode;
|
|
385
|
+
interface BadgeProps extends BasicComponent {
|
|
386
|
+
value: ReactNode;
|
|
387
|
+
dot: boolean;
|
|
388
|
+
max: number;
|
|
389
|
+
top: string;
|
|
390
|
+
right: string;
|
|
391
|
+
color: string;
|
|
396
392
|
}
|
|
397
|
-
declare const
|
|
393
|
+
declare const Badge: FunctionComponent<Partial<BadgeProps>>;
|
|
398
394
|
|
|
399
|
-
interface TabbarItemProps extends
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
tabTitle: string;
|
|
403
|
-
icon: React__default.ReactNode;
|
|
404
|
-
href: string;
|
|
405
|
-
num: string | number;
|
|
395
|
+
interface TabbarItemProps extends BadgeProps {
|
|
396
|
+
title: ReactNode;
|
|
397
|
+
icon: ReactNode;
|
|
406
398
|
active: boolean;
|
|
407
399
|
activeColor: string;
|
|
408
|
-
|
|
400
|
+
inactiveColor: string;
|
|
409
401
|
index: number;
|
|
410
402
|
handleClick: (idx: number) => void;
|
|
411
403
|
}
|
|
412
404
|
declare const TabbarItem: FunctionComponent<Partial<TabbarItemProps>>;
|
|
413
405
|
|
|
406
|
+
interface TabbarProps extends BasicComponent {
|
|
407
|
+
defaultValue: number;
|
|
408
|
+
value?: number;
|
|
409
|
+
fixed: boolean;
|
|
410
|
+
inactiveColor: string;
|
|
411
|
+
activeColor: string;
|
|
412
|
+
safeArea: boolean;
|
|
413
|
+
onSwitch: (value: number) => void;
|
|
414
|
+
}
|
|
415
|
+
declare const Tabbar: FunctionComponent<Partial<TabbarProps>> & {
|
|
416
|
+
Item: typeof TabbarItem;
|
|
417
|
+
};
|
|
418
|
+
|
|
414
419
|
interface TabPanelInnerProps {
|
|
415
420
|
autoHeightClassName: string;
|
|
416
421
|
}
|
|
@@ -626,17 +631,17 @@ interface RadioGroupOptionType {
|
|
|
626
631
|
onChange?: MouseEventHandler<HTMLDivElement>;
|
|
627
632
|
}
|
|
628
633
|
|
|
629
|
-
type
|
|
634
|
+
type CheckboxLabelPosition = 'left' | 'right';
|
|
630
635
|
type CheckboxDirection = 'horizontal' | 'vertical';
|
|
631
636
|
interface CheckboxGroupProps {
|
|
632
|
-
disabled
|
|
637
|
+
disabled?: boolean;
|
|
633
638
|
value?: string[];
|
|
634
639
|
defaultValue?: string[];
|
|
635
640
|
max: number | undefined;
|
|
636
|
-
|
|
641
|
+
labelPosition: CheckboxLabelPosition;
|
|
637
642
|
direction: CheckboxDirection;
|
|
638
|
-
onChange: (value: string[]) => void;
|
|
639
643
|
options: RadioGroupOptionType[];
|
|
644
|
+
onChange: (value: string[]) => void;
|
|
640
645
|
}
|
|
641
646
|
declare const CheckboxGroup: React__default.ForwardRefExoticComponent<Partial<CheckboxGroupProps> & Omit<React__default.HTMLAttributes<HTMLDivElement>, "onChange"> & React__default.RefAttributes<unknown>>;
|
|
642
647
|
|
|
@@ -644,16 +649,14 @@ interface CheckboxProps extends BasicComponent {
|
|
|
644
649
|
checked: boolean;
|
|
645
650
|
disabled: boolean;
|
|
646
651
|
defaultChecked: boolean;
|
|
647
|
-
|
|
648
|
-
iconSize: string | number;
|
|
652
|
+
labelPosition: 'left' | 'right';
|
|
649
653
|
icon: React__default.ReactNode;
|
|
650
|
-
|
|
654
|
+
activeIcon: React__default.ReactNode;
|
|
651
655
|
indeterminateIcon: React__default.ReactNode;
|
|
652
|
-
|
|
653
|
-
iconFontClassName: string;
|
|
656
|
+
value: string | number;
|
|
654
657
|
indeterminate: boolean;
|
|
655
658
|
label: string | number;
|
|
656
|
-
onChange: (
|
|
659
|
+
onChange: (value: boolean) => void;
|
|
657
660
|
}
|
|
658
661
|
declare const Checkbox: FunctionComponent<Partial<CheckboxProps> & Omit<React__default.HTMLAttributes<HTMLDivElement>, 'onChange'>> & {
|
|
659
662
|
Group: typeof CheckboxGroup;
|
|
@@ -811,57 +814,30 @@ declare const Form: FunctionComponent<Partial<FormProps> & React__default.HTMLAt
|
|
|
811
814
|
type InputAlignType = 'left' | 'center' | 'right';
|
|
812
815
|
type InputFormatTrigger = 'onChange' | 'onBlur';
|
|
813
816
|
type InputType = HTMLInputTypeAttribute;
|
|
814
|
-
type
|
|
815
|
-
pattern?: RegExp;
|
|
816
|
-
message?: string;
|
|
817
|
-
required?: boolean;
|
|
818
|
-
};
|
|
817
|
+
type ConfirmTextType = 'send' | 'search' | 'next' | 'go' | 'done';
|
|
819
818
|
interface InputProps extends BasicComponent {
|
|
820
819
|
type: InputType;
|
|
821
820
|
name: string;
|
|
822
|
-
defaultValue
|
|
821
|
+
defaultValue?: string;
|
|
822
|
+
value?: string;
|
|
823
823
|
placeholder: string;
|
|
824
|
-
|
|
825
|
-
labelClass: string;
|
|
826
|
-
labelWidth: string | number;
|
|
827
|
-
labelAlign: InputAlignType;
|
|
828
|
-
colon: boolean;
|
|
829
|
-
inputAlign: InputAlignType;
|
|
830
|
-
center: boolean;
|
|
831
|
-
required: boolean;
|
|
824
|
+
align: InputAlignType;
|
|
832
825
|
disabled: boolean;
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
maxlength: any;
|
|
836
|
-
leftIcon: React__default.ReactNode;
|
|
837
|
-
rightIcon: React__default.ReactNode;
|
|
826
|
+
readOnly: boolean;
|
|
827
|
+
maxLength: number;
|
|
838
828
|
clearable: boolean;
|
|
839
829
|
clearIcon: React__default.ReactNode;
|
|
840
|
-
clearSize: string | number;
|
|
841
|
-
border: boolean;
|
|
842
830
|
formatTrigger: InputFormatTrigger;
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
slotButton?: React__default.ReactNode;
|
|
852
|
-
slotInput?: React__default.ReactNode;
|
|
853
|
-
formatter: (value: string) => void;
|
|
854
|
-
onChange?: (value: any, event: Event) => void;
|
|
855
|
-
onBlur?: (value: any, event: Event) => void;
|
|
856
|
-
onFocus?: (value: any, event: Event) => void;
|
|
857
|
-
onClear?: (value: any, event: Event) => void;
|
|
858
|
-
keypress?: (value: any, event: Event) => void;
|
|
859
|
-
onClickInput?: (value: any) => void;
|
|
860
|
-
onClickLeftIcon?: (value: any) => void;
|
|
861
|
-
onClickRightIcon?: (value: any) => void;
|
|
862
|
-
onClick?: (value: any) => void;
|
|
831
|
+
autoFocus: boolean;
|
|
832
|
+
confirmType: ConfirmTextType;
|
|
833
|
+
formatter?: (value: string) => void;
|
|
834
|
+
onChange?: (value: string) => void;
|
|
835
|
+
onBlur?: (value: string) => void;
|
|
836
|
+
onFocus?: (value: string) => void;
|
|
837
|
+
onClear?: (value: string) => void;
|
|
838
|
+
onClick?: (value: MouseEvent$1<HTMLDivElement>) => void;
|
|
863
839
|
}
|
|
864
|
-
declare const Input:
|
|
840
|
+
declare const Input: React__default.ForwardRefExoticComponent<Partial<InputProps> & Omit<React__default.HTMLAttributes<HTMLDivElement>, "onClick" | "onFocus" | "onBlur" | "onChange"> & React__default.RefAttributes<unknown>>;
|
|
865
841
|
|
|
866
842
|
interface InputNumberProps extends BasicComponent {
|
|
867
843
|
disabled: boolean;
|
|
@@ -874,8 +850,6 @@ interface InputNumberProps extends BasicComponent {
|
|
|
874
850
|
step: string | number;
|
|
875
851
|
digits: string | number;
|
|
876
852
|
async: boolean;
|
|
877
|
-
className: string;
|
|
878
|
-
style: React__default.CSSProperties;
|
|
879
853
|
formatter?: (displayValue: string | number) => string;
|
|
880
854
|
onPlus: (e: MouseEvent) => void;
|
|
881
855
|
onMinus: (e: MouseEvent) => void;
|
|
@@ -957,11 +931,11 @@ interface PickerProps {
|
|
|
957
931
|
declare const Picker: React__default.ForwardRefExoticComponent<Partial<PickerProps> & React__default.RefAttributes<unknown>>;
|
|
958
932
|
|
|
959
933
|
type Position$1 = 'left' | 'right';
|
|
960
|
-
type Direction = 'horizontal' | 'vertical';
|
|
934
|
+
type Direction$1 = 'horizontal' | 'vertical';
|
|
961
935
|
interface RadioGroupProps {
|
|
962
936
|
value: string | number | boolean | null;
|
|
963
937
|
textPosition: Position$1;
|
|
964
|
-
direction: Direction;
|
|
938
|
+
direction: Direction$1;
|
|
965
939
|
onChange: (value: string | number | boolean) => void;
|
|
966
940
|
options: RadioGroupOptionType[];
|
|
967
941
|
}
|
|
@@ -1271,16 +1245,6 @@ interface ActionSheetProps {
|
|
|
1271
1245
|
}
|
|
1272
1246
|
declare const ActionSheet: FunctionComponent<Partial<ActionSheetProps> & React__default.HTMLAttributes<HTMLDivElement>>;
|
|
1273
1247
|
|
|
1274
|
-
interface BadgeProps extends BasicComponent {
|
|
1275
|
-
value: ReactNode;
|
|
1276
|
-
dot: boolean;
|
|
1277
|
-
max: number;
|
|
1278
|
-
top: string;
|
|
1279
|
-
right: string;
|
|
1280
|
-
color: string;
|
|
1281
|
-
}
|
|
1282
|
-
declare const Badge: FunctionComponent<Partial<BadgeProps>>;
|
|
1283
|
-
|
|
1284
1248
|
type DialogConfigType = {
|
|
1285
1249
|
prefixCls?: string;
|
|
1286
1250
|
simple?: boolean;
|
|
@@ -1338,11 +1302,11 @@ interface DragProps extends BasicComponent {
|
|
|
1338
1302
|
}
|
|
1339
1303
|
declare const Drag: FunctionComponent<Partial<DragProps> & React__default.HTMLAttributes<HTMLDivElement>>;
|
|
1340
1304
|
|
|
1341
|
-
interface EmptyProps {
|
|
1342
|
-
image
|
|
1305
|
+
interface EmptyProps extends BasicComponent {
|
|
1306
|
+
image?: ReactNode;
|
|
1343
1307
|
imageSize: number | string;
|
|
1344
1308
|
description: ReactNode;
|
|
1345
|
-
|
|
1309
|
+
status: 'empty' | 'error' | 'network';
|
|
1346
1310
|
}
|
|
1347
1311
|
declare const Empty: FunctionComponent<Partial<EmptyProps> & React__default.HTMLAttributes<HTMLDivElement>>;
|
|
1348
1312
|
|
|
@@ -1471,7 +1435,6 @@ interface SkeletonProps {
|
|
|
1471
1435
|
declare const Skeleton: FunctionComponent<Partial<SkeletonProps>>;
|
|
1472
1436
|
|
|
1473
1437
|
type SwipeSide = 'left' | 'right';
|
|
1474
|
-
type SwipePosition = SwipeSide | 'cell' | 'outside';
|
|
1475
1438
|
interface SwipeInstance {
|
|
1476
1439
|
open: (side: SwipeSide) => void;
|
|
1477
1440
|
close: () => void;
|
|
@@ -1483,10 +1446,6 @@ interface SwipeProps {
|
|
|
1483
1446
|
style: React__default.CSSProperties;
|
|
1484
1447
|
/** 标识符,可以在事件参数中获取到 */
|
|
1485
1448
|
name?: string | number;
|
|
1486
|
-
/** 指定左侧滑动区域宽度,单位为px */
|
|
1487
|
-
leftWidth?: string | number;
|
|
1488
|
-
/** 指定右侧滑动区域宽度,单位为 px */
|
|
1489
|
-
rightWidth?: string | number;
|
|
1490
1449
|
/** 左侧滑动区域的内容 */
|
|
1491
1450
|
leftAction?: React__default.ReactNode;
|
|
1492
1451
|
/** 右侧滑动区域的内容 */
|
|
@@ -1503,10 +1462,10 @@ interface SwipeProps {
|
|
|
1503
1462
|
/** 关闭时触发 */
|
|
1504
1463
|
onClose?: ({ name, position, }: {
|
|
1505
1464
|
name: string | number;
|
|
1506
|
-
position:
|
|
1465
|
+
position: SwipeSide;
|
|
1507
1466
|
}) => void;
|
|
1508
1467
|
/** 点击时触发 */
|
|
1509
|
-
onActionClick?: (event: Event, position:
|
|
1468
|
+
onActionClick?: (event: Event, position: SwipeSide) => void;
|
|
1510
1469
|
onTouchStart?: (event: Event) => void;
|
|
1511
1470
|
onTouchEnd?: (event: Event) => void;
|
|
1512
1471
|
onTouchMove?: (event: Event) => void;
|
|
@@ -1616,46 +1575,40 @@ declare const Audio: FunctionComponent<Partial<AudioProps> & React__default.HTML
|
|
|
1616
1575
|
interface AvatarProps extends BasicComponent {
|
|
1617
1576
|
size: string;
|
|
1618
1577
|
icon: React__default.ReactNode;
|
|
1578
|
+
fit: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down';
|
|
1619
1579
|
shape: AvatarShape;
|
|
1620
|
-
|
|
1580
|
+
background: string;
|
|
1621
1581
|
color: string;
|
|
1622
|
-
|
|
1623
|
-
url: string;
|
|
1624
|
-
className: string;
|
|
1582
|
+
src: string;
|
|
1625
1583
|
alt: string;
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
onActiveAvatar: (e: MouseEvent) => void;
|
|
1629
|
-
onError: (e: any) => void;
|
|
1584
|
+
onClick: (e: MouseEvent) => void;
|
|
1585
|
+
onError: () => void;
|
|
1630
1586
|
}
|
|
1631
1587
|
type AvatarShape = 'round' | 'square';
|
|
1632
|
-
declare const Avatar: FunctionComponent<Partial<AvatarProps> & React__default.HTMLAttributes<HTMLDivElement>>;
|
|
1588
|
+
declare const Avatar: FunctionComponent<Partial<AvatarProps> & Omit<React__default.HTMLAttributes<HTMLDivElement>, 'onClick'>>;
|
|
1633
1589
|
|
|
1634
|
-
interface AvatarGroupProps {
|
|
1590
|
+
interface AvatarGroupProps extends BasicComponent {
|
|
1635
1591
|
maxContent: string;
|
|
1636
|
-
|
|
1637
|
-
|
|
1592
|
+
max: string | number;
|
|
1593
|
+
maxBackground: string;
|
|
1638
1594
|
maxColor: string;
|
|
1639
|
-
size:
|
|
1640
|
-
shape:
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
className: string;
|
|
1644
|
-
style: React__default.CSSProperties;
|
|
1595
|
+
size: 'large' | 'normal' | 'small';
|
|
1596
|
+
shape: 'round' | 'square';
|
|
1597
|
+
gap: string;
|
|
1598
|
+
level: 'left' | 'right';
|
|
1645
1599
|
}
|
|
1646
1600
|
declare const AvatarGroup: FunctionComponent<Partial<AvatarGroupProps> & React__default.HTMLAttributes<HTMLDivElement>>;
|
|
1647
1601
|
|
|
1648
|
-
interface CircleProgressProps {
|
|
1649
|
-
|
|
1602
|
+
interface CircleProgressProps extends BasicComponent {
|
|
1603
|
+
percent: string | number;
|
|
1650
1604
|
strokeWidth?: string | number;
|
|
1651
1605
|
radius?: number | string;
|
|
1652
|
-
strokeLinecap?: 'butt' | 'round' | 'square' | 'inherit'
|
|
1653
|
-
|
|
1654
|
-
|
|
1606
|
+
strokeLinecap?: 'butt' | 'round' | 'square' | 'inherit';
|
|
1607
|
+
color?: object | string;
|
|
1608
|
+
background?: string;
|
|
1655
1609
|
clockwise?: boolean;
|
|
1656
|
-
className?: string;
|
|
1657
1610
|
}
|
|
1658
|
-
declare const CircleProgress: FunctionComponent<CircleProgressProps & React__default.HTMLAttributes<HTMLDivElement>>;
|
|
1611
|
+
declare const CircleProgress: FunctionComponent<CircleProgressProps & Omit<React__default.HTMLAttributes<HTMLDivElement>, 'color'>>;
|
|
1659
1612
|
|
|
1660
1613
|
interface CollapseProps {
|
|
1661
1614
|
className: string;
|
|
@@ -1700,9 +1653,10 @@ interface CountDownProps {
|
|
|
1700
1653
|
}
|
|
1701
1654
|
declare const CountDown: React__default.ForwardRefExoticComponent<Partial<CountDownProps> & React__default.RefAttributes<unknown>>;
|
|
1702
1655
|
|
|
1703
|
-
|
|
1656
|
+
type Direction = 'start' | 'end' | 'middle';
|
|
1657
|
+
interface EllipsisProps extends BasicComponent {
|
|
1704
1658
|
content: string;
|
|
1705
|
-
direction:
|
|
1659
|
+
direction: Direction;
|
|
1706
1660
|
rows: number | string;
|
|
1707
1661
|
expandText: string;
|
|
1708
1662
|
collapseText: string;
|
package/package.json
CHANGED
package/dist/esm/Icon.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["name", "size", "classPrefix", "color", "tag", "children", "className", "fontClassName", "style", "onClick"];
|
|
4
|
-
function ownKeys(object, enumerableOnly) {
|
|
5
|
-
var keys = Object.keys(object);
|
|
6
|
-
if (Object.getOwnPropertySymbols) {
|
|
7
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
8
|
-
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
9
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
10
|
-
})), keys.push.apply(keys, symbols);
|
|
11
|
-
}
|
|
12
|
-
return keys;
|
|
13
|
-
}
|
|
14
|
-
function _objectSpread(target) {
|
|
15
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
16
|
-
var source = null != arguments[i] ? arguments[i] : {};
|
|
17
|
-
i % 2 ? ownKeys(Object(source), true).forEach(function(key) {
|
|
18
|
-
_defineProperty(target, key, source[key]);
|
|
19
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
|
|
20
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
return target;
|
|
24
|
-
}
|
|
25
|
-
import React__default from "react";
|
|
26
|
-
import { c as cn } from "./bem.js";
|
|
27
|
-
import "@bem-react/classname";
|
|
28
|
-
var defaultProps = {
|
|
29
|
-
name: "",
|
|
30
|
-
size: "",
|
|
31
|
-
classPrefix: "nut-icon",
|
|
32
|
-
fontClassName: "nutui-iconfont",
|
|
33
|
-
color: "",
|
|
34
|
-
tag: "i",
|
|
35
|
-
onClick: function onClick(e) {
|
|
36
|
-
},
|
|
37
|
-
className: ""
|
|
38
|
-
};
|
|
39
|
-
function pxCheck(value) {
|
|
40
|
-
if (value === "") {
|
|
41
|
-
return value;
|
|
42
|
-
}
|
|
43
|
-
if (Number.isNaN(Number(value))) {
|
|
44
|
-
return String(value);
|
|
45
|
-
}
|
|
46
|
-
return "".concat(value, "px");
|
|
47
|
-
}
|
|
48
|
-
function Icon(props) {
|
|
49
|
-
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props), name = _defaultProps$props.name, size = _defaultProps$props.size, classPrefix = _defaultProps$props.classPrefix, color = _defaultProps$props.color, tag = _defaultProps$props.tag, children = _defaultProps$props.children, className = _defaultProps$props.className, fontClassName = _defaultProps$props.fontClassName, style = _defaultProps$props.style, onClick2 = _defaultProps$props.onClick, rest = _objectWithoutProperties(_defaultProps$props, _excluded);
|
|
50
|
-
var isImage = name ? name.indexOf("/") !== -1 : false;
|
|
51
|
-
var type = isImage ? "img" : tag;
|
|
52
|
-
var b = cn("icon");
|
|
53
|
-
var handleClick = function handleClick2(e) {
|
|
54
|
-
if (onClick2) {
|
|
55
|
-
onClick2(e);
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
var hasSrc = function hasSrc2() {
|
|
59
|
-
if (isImage)
|
|
60
|
-
return {
|
|
61
|
-
src: name
|
|
62
|
-
};
|
|
63
|
-
return {};
|
|
64
|
-
};
|
|
65
|
-
var styles = {};
|
|
66
|
-
var checkedSize = pxCheck(size);
|
|
67
|
-
if (checkedSize) {
|
|
68
|
-
styles.width = styles.height = styles.fontSize = checkedSize;
|
|
69
|
-
}
|
|
70
|
-
return React__default.createElement(type, _objectSpread(_objectSpread({
|
|
71
|
-
className: isImage ? "".concat(b("img"), " ").concat(className || "", " ") : "".concat(fontClassName, " ").concat(b(null), " ").concat(classPrefix, "-").concat(name, " ").concat(className || ""),
|
|
72
|
-
style: _objectSpread(_objectSpread({
|
|
73
|
-
color
|
|
74
|
-
}, styles), style)
|
|
75
|
-
}, rest), {}, {
|
|
76
|
-
onClick: handleClick
|
|
77
|
-
}, hasSrc()), children);
|
|
78
|
-
}
|
|
79
|
-
Icon.defaultProps = defaultProps;
|
|
80
|
-
Icon.displayName = "NutIcon";
|
|
81
|
-
export {
|
|
82
|
-
Icon as default
|
|
83
|
-
};
|
|
File without changes
|
|
File without changes
|