@nutui/nutui-react 2.0.0-alpha.4 → 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 +15 -0
- package/dist/esm/Avatar.js +30 -25
- package/dist/esm/AvatarGroup.js +10 -15
- package/dist/esm/Checkbox.js +1 -2
- package/dist/esm/CheckboxGroup.js +18 -20
- package/dist/esm/Ellipsis.js +13 -12
- package/dist/esm/Empty.js +18 -26
- 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/cellgroup2.js +5 -4
- package/dist/esm/checkbox2.js +34 -47
- 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 +306 -250
- package/dist/nutui.react.umd.js +306 -250
- package/dist/packages/cellgroup/cellgroup.scss +20 -16
- package/dist/packages/checkbox/checkbox.scss +8 -11
- package/dist/packages/empty/empty.scss +0 -9
- package/dist/packages/tabbar/tabbar.scss +1 -0
- package/dist/style.css +1 -1
- package/dist/style.mjs +1 -1
- package/dist/styles/themes/default.scss +0 -1
- package/dist/types/index.d.ts +34 -46
- 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';
|
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;
|
|
@@ -630,17 +631,17 @@ interface RadioGroupOptionType {
|
|
|
630
631
|
onChange?: MouseEventHandler<HTMLDivElement>;
|
|
631
632
|
}
|
|
632
633
|
|
|
633
|
-
type
|
|
634
|
+
type CheckboxLabelPosition = 'left' | 'right';
|
|
634
635
|
type CheckboxDirection = 'horizontal' | 'vertical';
|
|
635
636
|
interface CheckboxGroupProps {
|
|
636
|
-
disabled
|
|
637
|
+
disabled?: boolean;
|
|
637
638
|
value?: string[];
|
|
638
639
|
defaultValue?: string[];
|
|
639
640
|
max: number | undefined;
|
|
640
|
-
|
|
641
|
+
labelPosition: CheckboxLabelPosition;
|
|
641
642
|
direction: CheckboxDirection;
|
|
642
|
-
onChange: (value: string[]) => void;
|
|
643
643
|
options: RadioGroupOptionType[];
|
|
644
|
+
onChange: (value: string[]) => void;
|
|
644
645
|
}
|
|
645
646
|
declare const CheckboxGroup: React__default.ForwardRefExoticComponent<Partial<CheckboxGroupProps> & Omit<React__default.HTMLAttributes<HTMLDivElement>, "onChange"> & React__default.RefAttributes<unknown>>;
|
|
646
647
|
|
|
@@ -648,16 +649,14 @@ interface CheckboxProps extends BasicComponent {
|
|
|
648
649
|
checked: boolean;
|
|
649
650
|
disabled: boolean;
|
|
650
651
|
defaultChecked: boolean;
|
|
651
|
-
|
|
652
|
-
iconSize: string | number;
|
|
652
|
+
labelPosition: 'left' | 'right';
|
|
653
653
|
icon: React__default.ReactNode;
|
|
654
|
-
|
|
654
|
+
activeIcon: React__default.ReactNode;
|
|
655
655
|
indeterminateIcon: React__default.ReactNode;
|
|
656
|
-
|
|
657
|
-
iconFontClassName: string;
|
|
656
|
+
value: string | number;
|
|
658
657
|
indeterminate: boolean;
|
|
659
658
|
label: string | number;
|
|
660
|
-
onChange: (
|
|
659
|
+
onChange: (value: boolean) => void;
|
|
661
660
|
}
|
|
662
661
|
declare const Checkbox: FunctionComponent<Partial<CheckboxProps> & Omit<React__default.HTMLAttributes<HTMLDivElement>, 'onChange'>> & {
|
|
663
662
|
Group: typeof CheckboxGroup;
|
|
@@ -851,8 +850,6 @@ interface InputNumberProps extends BasicComponent {
|
|
|
851
850
|
step: string | number;
|
|
852
851
|
digits: string | number;
|
|
853
852
|
async: boolean;
|
|
854
|
-
className: string;
|
|
855
|
-
style: React__default.CSSProperties;
|
|
856
853
|
formatter?: (displayValue: string | number) => string;
|
|
857
854
|
onPlus: (e: MouseEvent) => void;
|
|
858
855
|
onMinus: (e: MouseEvent) => void;
|
|
@@ -934,11 +931,11 @@ interface PickerProps {
|
|
|
934
931
|
declare const Picker: React__default.ForwardRefExoticComponent<Partial<PickerProps> & React__default.RefAttributes<unknown>>;
|
|
935
932
|
|
|
936
933
|
type Position$1 = 'left' | 'right';
|
|
937
|
-
type Direction = 'horizontal' | 'vertical';
|
|
934
|
+
type Direction$1 = 'horizontal' | 'vertical';
|
|
938
935
|
interface RadioGroupProps {
|
|
939
936
|
value: string | number | boolean | null;
|
|
940
937
|
textPosition: Position$1;
|
|
941
|
-
direction: Direction;
|
|
938
|
+
direction: Direction$1;
|
|
942
939
|
onChange: (value: string | number | boolean) => void;
|
|
943
940
|
options: RadioGroupOptionType[];
|
|
944
941
|
}
|
|
@@ -1305,11 +1302,11 @@ interface DragProps extends BasicComponent {
|
|
|
1305
1302
|
}
|
|
1306
1303
|
declare const Drag: FunctionComponent<Partial<DragProps> & React__default.HTMLAttributes<HTMLDivElement>>;
|
|
1307
1304
|
|
|
1308
|
-
interface EmptyProps {
|
|
1309
|
-
image
|
|
1305
|
+
interface EmptyProps extends BasicComponent {
|
|
1306
|
+
image?: ReactNode;
|
|
1310
1307
|
imageSize: number | string;
|
|
1311
1308
|
description: ReactNode;
|
|
1312
|
-
|
|
1309
|
+
status: 'empty' | 'error' | 'network';
|
|
1313
1310
|
}
|
|
1314
1311
|
declare const Empty: FunctionComponent<Partial<EmptyProps> & React__default.HTMLAttributes<HTMLDivElement>>;
|
|
1315
1312
|
|
|
@@ -1438,7 +1435,6 @@ interface SkeletonProps {
|
|
|
1438
1435
|
declare const Skeleton: FunctionComponent<Partial<SkeletonProps>>;
|
|
1439
1436
|
|
|
1440
1437
|
type SwipeSide = 'left' | 'right';
|
|
1441
|
-
type SwipePosition = SwipeSide | 'cell' | 'outside';
|
|
1442
1438
|
interface SwipeInstance {
|
|
1443
1439
|
open: (side: SwipeSide) => void;
|
|
1444
1440
|
close: () => void;
|
|
@@ -1450,10 +1446,6 @@ interface SwipeProps {
|
|
|
1450
1446
|
style: React__default.CSSProperties;
|
|
1451
1447
|
/** 标识符,可以在事件参数中获取到 */
|
|
1452
1448
|
name?: string | number;
|
|
1453
|
-
/** 指定左侧滑动区域宽度,单位为px */
|
|
1454
|
-
leftWidth?: string | number;
|
|
1455
|
-
/** 指定右侧滑动区域宽度,单位为 px */
|
|
1456
|
-
rightWidth?: string | number;
|
|
1457
1449
|
/** 左侧滑动区域的内容 */
|
|
1458
1450
|
leftAction?: React__default.ReactNode;
|
|
1459
1451
|
/** 右侧滑动区域的内容 */
|
|
@@ -1470,10 +1462,10 @@ interface SwipeProps {
|
|
|
1470
1462
|
/** 关闭时触发 */
|
|
1471
1463
|
onClose?: ({ name, position, }: {
|
|
1472
1464
|
name: string | number;
|
|
1473
|
-
position:
|
|
1465
|
+
position: SwipeSide;
|
|
1474
1466
|
}) => void;
|
|
1475
1467
|
/** 点击时触发 */
|
|
1476
|
-
onActionClick?: (event: Event, position:
|
|
1468
|
+
onActionClick?: (event: Event, position: SwipeSide) => void;
|
|
1477
1469
|
onTouchStart?: (event: Event) => void;
|
|
1478
1470
|
onTouchEnd?: (event: Event) => void;
|
|
1479
1471
|
onTouchMove?: (event: Event) => void;
|
|
@@ -1583,32 +1575,27 @@ declare const Audio: FunctionComponent<Partial<AudioProps> & React__default.HTML
|
|
|
1583
1575
|
interface AvatarProps extends BasicComponent {
|
|
1584
1576
|
size: string;
|
|
1585
1577
|
icon: React__default.ReactNode;
|
|
1578
|
+
fit: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down';
|
|
1586
1579
|
shape: AvatarShape;
|
|
1587
|
-
|
|
1580
|
+
background: string;
|
|
1588
1581
|
color: string;
|
|
1589
|
-
|
|
1590
|
-
url: string;
|
|
1591
|
-
className: string;
|
|
1582
|
+
src: string;
|
|
1592
1583
|
alt: string;
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
onActiveAvatar: (e: MouseEvent) => void;
|
|
1596
|
-
onError: (e: any) => void;
|
|
1584
|
+
onClick: (e: MouseEvent) => void;
|
|
1585
|
+
onError: () => void;
|
|
1597
1586
|
}
|
|
1598
1587
|
type AvatarShape = 'round' | 'square';
|
|
1599
|
-
declare const Avatar: FunctionComponent<Partial<AvatarProps> & React__default.HTMLAttributes<HTMLDivElement>>;
|
|
1588
|
+
declare const Avatar: FunctionComponent<Partial<AvatarProps> & Omit<React__default.HTMLAttributes<HTMLDivElement>, 'onClick'>>;
|
|
1600
1589
|
|
|
1601
|
-
interface AvatarGroupProps {
|
|
1590
|
+
interface AvatarGroupProps extends BasicComponent {
|
|
1602
1591
|
maxContent: string;
|
|
1603
|
-
|
|
1604
|
-
|
|
1592
|
+
max: string | number;
|
|
1593
|
+
maxBackground: string;
|
|
1605
1594
|
maxColor: string;
|
|
1606
|
-
size:
|
|
1607
|
-
shape:
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
className: string;
|
|
1611
|
-
style: React__default.CSSProperties;
|
|
1595
|
+
size: 'large' | 'normal' | 'small';
|
|
1596
|
+
shape: 'round' | 'square';
|
|
1597
|
+
gap: string;
|
|
1598
|
+
level: 'left' | 'right';
|
|
1612
1599
|
}
|
|
1613
1600
|
declare const AvatarGroup: FunctionComponent<Partial<AvatarGroupProps> & React__default.HTMLAttributes<HTMLDivElement>>;
|
|
1614
1601
|
|
|
@@ -1666,9 +1653,10 @@ interface CountDownProps {
|
|
|
1666
1653
|
}
|
|
1667
1654
|
declare const CountDown: React__default.ForwardRefExoticComponent<Partial<CountDownProps> & React__default.RefAttributes<unknown>>;
|
|
1668
1655
|
|
|
1669
|
-
|
|
1656
|
+
type Direction = 'start' | 'end' | 'middle';
|
|
1657
|
+
interface EllipsisProps extends BasicComponent {
|
|
1670
1658
|
content: string;
|
|
1671
|
-
direction:
|
|
1659
|
+
direction: Direction;
|
|
1672
1660
|
rows: number | string;
|
|
1673
1661
|
expandText: string;
|
|
1674
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
|