@douyinfe/semi-ui 2.19.0-alpha.7 → 2.19.0-beta.0
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/_utils/index.ts +9 -5
- package/avatar/index.tsx +3 -1
- package/checkbox/_story/checkbox.stories.js +2 -0
- package/checkbox/checkbox.tsx +25 -20
- package/checkbox/checkboxGroup.tsx +1 -0
- package/dist/css/semi.css +26 -59
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +301 -276
- package/dist/umd/semi-ui.js.map +1 -1
- package/dist/umd/semi-ui.min.js +1 -1
- package/dist/umd/semi-ui.min.js.map +1 -1
- package/form/interface.ts +1 -1
- package/lib/cjs/_utils/index.js +4 -1
- package/lib/cjs/avatar/index.d.ts +1 -0
- package/lib/cjs/avatar/index.js +2 -1
- package/lib/cjs/carousel/CarouselIndicator.d.ts +1 -1
- package/lib/cjs/carousel/index.d.ts +1 -1
- package/lib/cjs/checkbox/checkbox.d.ts +1 -0
- package/lib/cjs/checkbox/checkbox.js +19 -10
- package/lib/cjs/checkbox/checkboxGroup.js +10 -9
- package/lib/cjs/datePicker/dateInput.d.ts +1 -1
- package/lib/cjs/datePicker/datePicker.d.ts +1 -1
- package/lib/cjs/datePicker/monthsGrid.d.ts +1 -1
- package/lib/cjs/form/interface.d.ts +1 -1
- package/lib/cjs/popconfirm/index.js +6 -6
- package/lib/cjs/radio/radio.d.ts +2 -1
- package/lib/cjs/radio/radio.js +1 -0
- package/lib/cjs/radio/radioGroup.d.ts +1 -1
- package/lib/cjs/tabs/interface.d.ts +3 -2
- package/lib/cjs/tag/group.d.ts +1 -15
- package/lib/cjs/tag/index.d.ts +1 -1
- package/lib/cjs/tag/index.js +1 -1
- package/lib/cjs/tag/interface.d.ts +6 -3
- package/lib/cjs/timePicker/TimePicker.d.ts +2 -2
- package/lib/cjs/timePicker/TimeShape.d.ts +1 -1
- package/lib/cjs/timePicker/index.d.ts +2 -2
- package/lib/cjs/typography/title.d.ts +1 -1
- package/lib/cjs/upload/index.d.ts +1 -1
- package/lib/es/_utils/index.js +4 -1
- package/lib/es/avatar/index.d.ts +1 -0
- package/lib/es/avatar/index.js +2 -1
- package/lib/es/carousel/CarouselIndicator.d.ts +1 -1
- package/lib/es/carousel/index.d.ts +1 -1
- package/lib/es/checkbox/checkbox.d.ts +1 -0
- package/lib/es/checkbox/checkbox.js +19 -10
- package/lib/es/checkbox/checkboxGroup.js +8 -7
- package/lib/es/datePicker/dateInput.d.ts +1 -1
- package/lib/es/datePicker/datePicker.d.ts +1 -1
- package/lib/es/datePicker/monthsGrid.d.ts +1 -1
- package/lib/es/form/interface.d.ts +1 -1
- package/lib/es/popconfirm/index.js +6 -6
- package/lib/es/radio/radio.d.ts +2 -1
- package/lib/es/radio/radio.js +1 -0
- package/lib/es/radio/radioGroup.d.ts +1 -1
- package/lib/es/tabs/interface.d.ts +3 -2
- package/lib/es/tag/group.d.ts +1 -15
- package/lib/es/tag/index.d.ts +1 -1
- package/lib/es/tag/index.js +1 -1
- package/lib/es/tag/interface.d.ts +6 -3
- package/lib/es/timePicker/TimePicker.d.ts +2 -2
- package/lib/es/timePicker/TimeShape.d.ts +1 -1
- package/lib/es/timePicker/index.d.ts +2 -2
- package/lib/es/typography/title.d.ts +1 -1
- package/lib/es/upload/index.d.ts +1 -1
- package/package.json +7 -7
- package/popconfirm/_story/popconfirm.stories.js +1 -1
- package/popconfirm/index.tsx +6 -6
- package/radio/radio.tsx +2 -0
- package/tabs/_story/Demo.tsx +14 -5
- package/tabs/interface.ts +3 -2
- package/tag/group.tsx +2 -16
- package/tag/index.tsx +1 -1
- package/tag/interface.ts +9 -5
- package/transfer/_story/transfer.stories.js +2 -2
- package/treeSelect/_story/treeSelect.stories.js +3 -0
package/form/interface.ts
CHANGED
|
@@ -102,7 +102,7 @@ interface setValuesConfig {
|
|
|
102
102
|
isOverride: boolean;
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
export interface BaseFormProps {
|
|
105
|
+
export interface BaseFormProps extends Omit<React.FormHTMLAttributes<HTMLFormElement>, 'children' | 'onChange'> {
|
|
106
106
|
'aria-label'?: React.AriaAttributes['aria-label'];
|
|
107
107
|
onSubmit?: (values: Record<string, any>) => void;
|
|
108
108
|
onSubmitFail?: (errors: Record<string, FieldError>, values: any) => void;
|
package/lib/cjs/_utils/index.js
CHANGED
|
@@ -93,7 +93,10 @@ function cloneDeep(value, customizer) {
|
|
|
93
93
|
(0, _set2.default)(newArray, key, v[key]);
|
|
94
94
|
}); // internal-issues:887
|
|
95
95
|
|
|
96
|
-
|
|
96
|
+
try {
|
|
97
|
+
(0, _warning.default)((0, _get2.default)(process, 'env.NODE_ENV') !== 'production', "[Semi] You may use an out-of-bounds array. In some cases, your program may not behave as expected.\n The maximum length of an array is 4294967295.\n Please check whether the array subscript in your data exceeds the maximum value of the JS array subscript");
|
|
98
|
+
} catch (e) {}
|
|
99
|
+
|
|
97
100
|
return newArray;
|
|
98
101
|
} else {
|
|
99
102
|
return undefined;
|
|
@@ -20,6 +20,7 @@ export default class Avatar extends BaseComponent<AvatarProps, AvatarState> {
|
|
|
20
20
|
onMouseEnter: typeof noop;
|
|
21
21
|
onMouseLeave: typeof noop;
|
|
22
22
|
};
|
|
23
|
+
static elementType: string;
|
|
23
24
|
static propTypes: {
|
|
24
25
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
25
26
|
color: PropTypes.Requireable<string>;
|
package/lib/cjs/avatar/index.js
CHANGED
|
@@ -8,7 +8,7 @@ declare class CarouselIndicator extends React.PureComponent<CarouselIndicatorPro
|
|
|
8
8
|
position: PropTypes.Requireable<"left" | "right" | "center">;
|
|
9
9
|
size: PropTypes.Requireable<"small" | "medium">;
|
|
10
10
|
style: PropTypes.Requireable<object>;
|
|
11
|
-
theme: PropTypes.Requireable<"
|
|
11
|
+
theme: PropTypes.Requireable<"primary" | "dark" | "light">;
|
|
12
12
|
total: PropTypes.Requireable<number>;
|
|
13
13
|
onIndicatorChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
14
14
|
type: PropTypes.Requireable<"line" | "dot" | "columnar">;
|
|
@@ -22,7 +22,7 @@ declare class Carousel extends BaseComponent<CarouselProps, CarouselState> {
|
|
|
22
22
|
indicatorPosition: PropTypes.Requireable<"left" | "right" | "center">;
|
|
23
23
|
indicatorSize: PropTypes.Requireable<"small" | "medium">;
|
|
24
24
|
indicatorType: PropTypes.Requireable<"line" | "dot" | "columnar">;
|
|
25
|
-
theme: PropTypes.Requireable<"
|
|
25
|
+
theme: PropTypes.Requireable<"primary" | "dark" | "light">;
|
|
26
26
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
27
27
|
arrowType: PropTypes.Requireable<"hover" | "always">;
|
|
28
28
|
showArrow: PropTypes.Requireable<boolean>;
|
|
@@ -67,6 +67,7 @@ declare class Checkbox extends BaseComponent<CheckboxProps, CheckboxState> {
|
|
|
67
67
|
onMouseLeave: (...args: any[]) => void;
|
|
68
68
|
type: string;
|
|
69
69
|
};
|
|
70
|
+
static elementType: string;
|
|
70
71
|
checkboxEntity: CheckboxInner;
|
|
71
72
|
context: CheckboxContextType;
|
|
72
73
|
get adapter(): CheckboxAdapter<CheckboxProps, CheckboxState>;
|
|
@@ -211,15 +211,23 @@ class Checkbox extends _baseComponent.default {
|
|
|
211
211
|
const name = inGroup && this.context.checkboxGroup.name;
|
|
212
212
|
const xSemiPropChildren = this.props['x-semi-children-alias'] || 'children';
|
|
213
213
|
|
|
214
|
-
const renderContent = () =>
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
"
|
|
222
|
-
|
|
214
|
+
const renderContent = () => {
|
|
215
|
+
if (!children && !extra) {
|
|
216
|
+
return null;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
220
|
+
className: "".concat(prefix, "-content")
|
|
221
|
+
}, children ? /*#__PURE__*/_react.default.createElement("span", {
|
|
222
|
+
id: addonId,
|
|
223
|
+
className: "".concat(prefix, "-addon"),
|
|
224
|
+
"x-semi-prop": xSemiPropChildren
|
|
225
|
+
}, children) : null, extra ? /*#__PURE__*/_react.default.createElement("div", {
|
|
226
|
+
id: extraId,
|
|
227
|
+
className: extraCls,
|
|
228
|
+
"x-semi-prop": "extra"
|
|
229
|
+
}, extra) : null);
|
|
230
|
+
};
|
|
223
231
|
|
|
224
232
|
return (
|
|
225
233
|
/*#__PURE__*/
|
|
@@ -245,7 +253,7 @@ class Checkbox extends _baseComponent.default {
|
|
|
245
253
|
focusInner: focusVisible && !focusOuter,
|
|
246
254
|
onInputFocus: this.handleFocusVisible,
|
|
247
255
|
onInputBlur: this.handleBlur
|
|
248
|
-
})),
|
|
256
|
+
})), renderContent())
|
|
249
257
|
);
|
|
250
258
|
}
|
|
251
259
|
|
|
@@ -289,5 +297,6 @@ Checkbox.defaultProps = {
|
|
|
289
297
|
onMouseLeave: _noop2.default,
|
|
290
298
|
type: 'default'
|
|
291
299
|
};
|
|
300
|
+
Checkbox.elementType = 'Checkbox';
|
|
292
301
|
var _default = Checkbox;
|
|
293
302
|
exports.default = _default;
|
|
@@ -34,7 +34,7 @@ var _checkboxGroupFoundation = _interopRequireDefault(require("@douyinfe/semi-fo
|
|
|
34
34
|
|
|
35
35
|
var _baseComponent = _interopRequireDefault(require("../_base/baseComponent"));
|
|
36
36
|
|
|
37
|
-
var
|
|
37
|
+
var _context8 = require("./context");
|
|
38
38
|
|
|
39
39
|
var _checkbox = _interopRequireDefault(require("./checkbox"));
|
|
40
40
|
|
|
@@ -83,7 +83,7 @@ class CheckboxGroup extends _baseComponent.default {
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
render() {
|
|
86
|
-
var _context2, _context3, _context4;
|
|
86
|
+
var _context2, _context3, _context4, _context5;
|
|
87
87
|
|
|
88
88
|
const {
|
|
89
89
|
children,
|
|
@@ -103,15 +103,16 @@ class CheckboxGroup extends _baseComponent.default {
|
|
|
103
103
|
[prefix]: true,
|
|
104
104
|
["".concat(prefix, "-wrapper")]: true,
|
|
105
105
|
[(0, _concat.default)(_context2 = "".concat(prefix, "-")).call(_context2, direction)]: direction,
|
|
106
|
-
[(0, _concat.default)(_context3 = "".concat(prefix, "-")).call(_context3, direction, "-cardType")]: direction && isCardType
|
|
106
|
+
[(0, _concat.default)(_context3 = "".concat(prefix, "-")).call(_context3, direction, "-cardType")]: direction && isCardType,
|
|
107
|
+
[(0, _concat.default)(_context4 = "".concat(prefix, "-")).call(_context4, direction, "-pureCardType")]: direction && isPureCardType
|
|
107
108
|
}, className);
|
|
108
|
-
const realValue = (0, _slice.default)(
|
|
109
|
+
const realValue = (0, _slice.default)(_context5 = this.state.value).call(_context5);
|
|
109
110
|
let inner;
|
|
110
111
|
|
|
111
112
|
if (options) {
|
|
112
|
-
var
|
|
113
|
+
var _context6;
|
|
113
114
|
|
|
114
|
-
inner = (0, _map.default)(
|
|
115
|
+
inner = (0, _map.default)(_context6 = options || []).call(_context6, (option, index) => {
|
|
115
116
|
if (typeof option === 'string') {
|
|
116
117
|
return /*#__PURE__*/_react.default.createElement(_checkbox.default, {
|
|
117
118
|
role: "listitem",
|
|
@@ -135,9 +136,9 @@ class CheckboxGroup extends _baseComponent.default {
|
|
|
135
136
|
}
|
|
136
137
|
});
|
|
137
138
|
} else if (children) {
|
|
138
|
-
var
|
|
139
|
+
var _context7;
|
|
139
140
|
|
|
140
|
-
inner = (0, _map.default)(
|
|
141
|
+
inner = (0, _map.default)(_context7 = _react.default.Children.toArray(children)).call(_context7, (itm, index) => /*#__PURE__*/_react.default.cloneElement(itm, {
|
|
141
142
|
key: index,
|
|
142
143
|
role: 'listitem'
|
|
143
144
|
}));
|
|
@@ -151,7 +152,7 @@ class CheckboxGroup extends _baseComponent.default {
|
|
|
151
152
|
style: style,
|
|
152
153
|
"aria-labelledby": this.props['aria-labelledby'],
|
|
153
154
|
"aria-describedby": this.props['aria-describedby']
|
|
154
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
155
|
+
}, /*#__PURE__*/_react.default.createElement(_context8.Context.Provider, {
|
|
155
156
|
value: {
|
|
156
157
|
checkboxGroup: {
|
|
157
158
|
onChange: this.onChange,
|
|
@@ -26,7 +26,7 @@ export default class DateInput extends BaseComponent<DateInputProps, {}> {
|
|
|
26
26
|
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
27
27
|
value: PropTypes.Requireable<any[]>;
|
|
28
28
|
disabled: PropTypes.Requireable<boolean>;
|
|
29
|
-
type: PropTypes.Requireable<"
|
|
29
|
+
type: PropTypes.Requireable<"dateTime" | "date" | "month" | "dateRange" | "year" | "dateTimeRange">;
|
|
30
30
|
showClear: PropTypes.Requireable<boolean>;
|
|
31
31
|
format: PropTypes.Requireable<string>;
|
|
32
32
|
inputStyle: PropTypes.Requireable<object>;
|
|
@@ -41,7 +41,7 @@ export default class DatePicker extends BaseComponent<DatePickerProps, DatePicke
|
|
|
41
41
|
'aria-invalid': PropTypes.Requireable<boolean>;
|
|
42
42
|
'aria-labelledby': PropTypes.Requireable<string>;
|
|
43
43
|
'aria-required': PropTypes.Requireable<boolean>;
|
|
44
|
-
type: PropTypes.Requireable<"
|
|
44
|
+
type: PropTypes.Requireable<"dateTime" | "date" | "month" | "dateRange" | "year" | "dateTimeRange">;
|
|
45
45
|
size: PropTypes.Requireable<"default" | "small" | "large">;
|
|
46
46
|
density: PropTypes.Requireable<"default" | "compact">;
|
|
47
47
|
defaultValue: PropTypes.Requireable<string | number | object>;
|
|
@@ -17,7 +17,7 @@ export interface MonthsGridProps extends MonthsGridFoundationProps, BaseProps {
|
|
|
17
17
|
export declare type MonthsGridState = MonthsGridFoundationState;
|
|
18
18
|
export default class MonthsGrid extends BaseComponent<MonthsGridProps, MonthsGridState> {
|
|
19
19
|
static propTypes: {
|
|
20
|
-
type: PropTypes.Requireable<"
|
|
20
|
+
type: PropTypes.Requireable<"dateTime" | "date" | "month" | "dateRange" | "year" | "dateTimeRange">;
|
|
21
21
|
defaultValue: PropTypes.Requireable<string | number | object>;
|
|
22
22
|
defaultPickerValue: PropTypes.Requireable<string | number | object>;
|
|
23
23
|
multiple: PropTypes.Requireable<boolean>;
|
|
@@ -81,7 +81,7 @@ export interface FormFCChild<K extends Record<string, any> = any> {
|
|
|
81
81
|
values: K;
|
|
82
82
|
formApi: FormApi<K>;
|
|
83
83
|
}
|
|
84
|
-
export interface BaseFormProps {
|
|
84
|
+
export interface BaseFormProps extends Omit<React.FormHTMLAttributes<HTMLFormElement>, 'children' | 'onChange'> {
|
|
85
85
|
'aria-label'?: React.AriaAttributes['aria-label'];
|
|
86
86
|
onSubmit?: (values: Record<string, any>) => void;
|
|
87
87
|
onSubmitFail?: (errors: Record<string, FieldError>, values: any) => void;
|
|
@@ -154,7 +154,7 @@ class Popconfirm extends _baseComponent.default {
|
|
|
154
154
|
["".concat(prefixCls, "-rtl")]: direction === 'rtl'
|
|
155
155
|
});
|
|
156
156
|
const showTitle = title !== null && typeof title !== 'undefined';
|
|
157
|
-
const showContent = content
|
|
157
|
+
const showContent = !(content === null || typeof content === 'undefined');
|
|
158
158
|
return (
|
|
159
159
|
/*#__PURE__*/
|
|
160
160
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
@@ -174,17 +174,17 @@ class Popconfirm extends _baseComponent.default {
|
|
|
174
174
|
}, showTitle ? /*#__PURE__*/_react.default.createElement("div", {
|
|
175
175
|
className: "".concat(prefixCls, "-header-title"),
|
|
176
176
|
"x-semi-prop": "title"
|
|
177
|
-
}, title) : null,
|
|
178
|
-
className: "".concat(prefixCls, "-header-content"),
|
|
179
|
-
"x-semi-prop": "content"
|
|
180
|
-
}, content) : null), /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
177
|
+
}, title) : null), /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
181
178
|
className: "".concat(prefixCls, "-btn-close"),
|
|
182
179
|
icon: /*#__PURE__*/_react.default.createElement(_semiIcons.IconClose, null),
|
|
183
180
|
size: "small",
|
|
184
181
|
theme: 'borderless',
|
|
185
182
|
type: cancelType,
|
|
186
183
|
onClick: this.handleCancel
|
|
187
|
-
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
184
|
+
})), showContent ? /*#__PURE__*/_react.default.createElement("div", {
|
|
185
|
+
className: "".concat(prefixCls, "-body"),
|
|
186
|
+
"x-semi-prop": "content"
|
|
187
|
+
}, content) : null, /*#__PURE__*/_react.default.createElement("div", {
|
|
188
188
|
className: "".concat(prefixCls, "-footer")
|
|
189
189
|
}, this.renderControls())))
|
|
190
190
|
);
|
package/lib/cjs/radio/radio.d.ts
CHANGED
|
@@ -66,6 +66,7 @@ declare class Radio extends BaseComponent<RadioProps, RadioState> {
|
|
|
66
66
|
preventScroll: PropTypes.Requireable<boolean>;
|
|
67
67
|
};
|
|
68
68
|
static defaultProps: Partial<RadioProps>;
|
|
69
|
+
static elementType: string;
|
|
69
70
|
radioEntity: RadioInner;
|
|
70
71
|
context: RadioContextValue;
|
|
71
72
|
foundation: RadioFoundation;
|
|
@@ -81,7 +82,7 @@ declare class Radio extends BaseComponent<RadioProps, RadioState> {
|
|
|
81
82
|
prefixCls?: string;
|
|
82
83
|
name?: string;
|
|
83
84
|
onChange?: (e: RadioChangeEvent) => void;
|
|
84
|
-
buttonSize?: "small" | "
|
|
85
|
+
buttonSize?: "small" | "middle" | "large";
|
|
85
86
|
isCardRadio?: boolean;
|
|
86
87
|
isPureCardRadio?: boolean;
|
|
87
88
|
};
|
package/lib/cjs/radio/radio.js
CHANGED
|
@@ -48,7 +48,7 @@ declare class RadioGroup extends BaseComponent<RadioGroupProps, RadioGroupState>
|
|
|
48
48
|
disabled: PropTypes.Requireable<boolean>;
|
|
49
49
|
name: PropTypes.Requireable<string>;
|
|
50
50
|
options: PropTypes.Requireable<any[]>;
|
|
51
|
-
buttonSize: PropTypes.Requireable<"small" | "
|
|
51
|
+
buttonSize: PropTypes.Requireable<"small" | "middle" | "large">;
|
|
52
52
|
type: PropTypes.Requireable<"default" | "button" | "card" | "pureCard">;
|
|
53
53
|
value: PropTypes.Requireable<any>;
|
|
54
54
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { CSSProperties, MouseEvent, ReactNode } from 'react';
|
|
2
2
|
import { Motion } from '../_base/base';
|
|
3
|
+
import TabBar from './TabBar';
|
|
3
4
|
export declare type TabType = 'line' | 'card' | 'button';
|
|
4
5
|
export declare type TabSize = 'small' | 'medium' | 'large';
|
|
5
6
|
export declare type TabPosition = 'top' | 'left';
|
|
@@ -21,7 +22,7 @@ export interface TabsProps {
|
|
|
21
22
|
lazyRender?: boolean;
|
|
22
23
|
onChange?: (activeKey: string) => void;
|
|
23
24
|
onTabClick?: (activeKey: string, e: MouseEvent<Element>) => void;
|
|
24
|
-
renderTabBar?: (tabBarProps: TabBarProps, defaultTabBar:
|
|
25
|
+
renderTabBar?: (tabBarProps: TabBarProps, defaultTabBar: typeof TabBar) => ReactNode;
|
|
25
26
|
size?: TabSize;
|
|
26
27
|
style?: CSSProperties;
|
|
27
28
|
tabBarClassName?: string;
|
package/lib/cjs/tag/group.d.ts
CHANGED
|
@@ -1,21 +1,7 @@
|
|
|
1
1
|
import React, { PureComponent } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import Tag from './index';
|
|
4
|
-
import {
|
|
5
|
-
import { AvatarShape, TagProps } from './interface';
|
|
6
|
-
export interface TagGroupProps<T> {
|
|
7
|
-
style?: React.CSSProperties;
|
|
8
|
-
className?: string;
|
|
9
|
-
maxTagCount?: number;
|
|
10
|
-
restCount?: number;
|
|
11
|
-
tagList?: (T extends 'custom' ? React.ReactNode : TagProps)[];
|
|
12
|
-
size?: 'small' | 'large';
|
|
13
|
-
showPopover?: boolean;
|
|
14
|
-
popoverProps?: PopoverProps;
|
|
15
|
-
avatarShape?: AvatarShape;
|
|
16
|
-
mode?: string;
|
|
17
|
-
onTagClose: (tagChildren: React.ReactNode, event: React.MouseEvent<HTMLElement>, tagKey: string | number) => void;
|
|
18
|
-
}
|
|
4
|
+
import { TagGroupProps } from './interface';
|
|
19
5
|
export default class TagGroup<T> extends PureComponent<TagGroupProps<T>> {
|
|
20
6
|
static defaultProps: {
|
|
21
7
|
style: {};
|
package/lib/cjs/tag/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export default class Tag extends Component<TagProps, TagState> {
|
|
|
10
10
|
static defaultProps: TagProps;
|
|
11
11
|
static propTypes: {
|
|
12
12
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
13
|
-
tagKey: PropTypes.Requireable<
|
|
13
|
+
tagKey: PropTypes.Requireable<string | number>;
|
|
14
14
|
size: PropTypes.Requireable<string>;
|
|
15
15
|
color: PropTypes.Requireable<string>;
|
|
16
16
|
type: PropTypes.Requireable<string>;
|
package/lib/cjs/tag/index.js
CHANGED
|
@@ -255,7 +255,7 @@ Tag.defaultProps = {
|
|
|
255
255
|
};
|
|
256
256
|
Tag.propTypes = {
|
|
257
257
|
children: _propTypes.default.node,
|
|
258
|
-
tagKey: _propTypes.default.
|
|
258
|
+
tagKey: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
259
259
|
size: _propTypes.default.oneOf(tagSize),
|
|
260
260
|
color: _propTypes.default.oneOf(tagColors),
|
|
261
261
|
type: _propTypes.default.oneOf(tagType),
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { PopoverProps } from '../popover/index';
|
|
2
3
|
export declare type TagColor = 'amber' | 'blue' | 'cyan' | 'green' | 'grey' | 'indigo' | 'light-blue' | 'light-green' | 'lime' | 'orange' | 'pink' | 'purple' | 'red' | 'teal' | 'violet' | 'yellow' | 'white';
|
|
3
4
|
export declare type TagType = 'ghost' | 'solid' | 'light';
|
|
4
5
|
export declare type TagSize = 'default' | 'small' | 'large';
|
|
@@ -21,14 +22,16 @@ export interface TagProps {
|
|
|
21
22
|
'aria-label'?: React.AriaAttributes['aria-label'];
|
|
22
23
|
tabIndex?: number;
|
|
23
24
|
}
|
|
24
|
-
export interface TagGroupProps {
|
|
25
|
+
export interface TagGroupProps<T> {
|
|
25
26
|
style?: React.CSSProperties;
|
|
26
27
|
className?: string;
|
|
27
28
|
maxTagCount?: number;
|
|
28
|
-
|
|
29
|
+
restCount?: number;
|
|
30
|
+
tagList?: (T extends 'custom' ? React.ReactNode : TagProps)[];
|
|
29
31
|
size?: 'small' | 'large';
|
|
30
32
|
showPopover?: boolean;
|
|
31
|
-
popoverProps?:
|
|
33
|
+
popoverProps?: PopoverProps;
|
|
32
34
|
avatarShape?: AvatarShape;
|
|
33
35
|
mode?: string;
|
|
36
|
+
onTagClose: (tagChildren: React.ReactNode, event: React.MouseEvent<HTMLElement>, tagKey: string | number) => void;
|
|
34
37
|
}
|
|
@@ -99,11 +99,11 @@ export default class TimePicker extends BaseComponent<TimePickerProps, TimePicke
|
|
|
99
99
|
'aria-required': PropTypes.Requireable<boolean>;
|
|
100
100
|
prefixCls: PropTypes.Requireable<string>;
|
|
101
101
|
clearText: PropTypes.Requireable<string>;
|
|
102
|
-
value: PropTypes.Requireable<string | number | string[] |
|
|
102
|
+
value: PropTypes.Requireable<string | number | string[] | number[] | Date | Date[]>;
|
|
103
103
|
inputReadOnly: PropTypes.Requireable<boolean>;
|
|
104
104
|
disabled: PropTypes.Requireable<boolean>;
|
|
105
105
|
showClear: PropTypes.Requireable<boolean>;
|
|
106
|
-
defaultValue: PropTypes.Requireable<string | number | string[] |
|
|
106
|
+
defaultValue: PropTypes.Requireable<string | number | string[] | number[] | Date | Date[]>;
|
|
107
107
|
open: PropTypes.Requireable<boolean>;
|
|
108
108
|
defaultOpen: PropTypes.Requireable<boolean>;
|
|
109
109
|
onOpenChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -6,5 +6,5 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
* - \[12:00:12, 12:21:12]
|
|
7
7
|
* - \[[12:00:12, 12:21:12], [12:11:12, 12:32:12]]
|
|
8
8
|
*/
|
|
9
|
-
declare const TimeShape: PropTypes.Requireable<string | number | string[] |
|
|
9
|
+
declare const TimeShape: PropTypes.Requireable<string | number | string[] | number[] | Date | Date[]>;
|
|
10
10
|
export { TimeShape };
|
|
@@ -19,11 +19,11 @@ export default class LocaleTimePicker extends React.PureComponent<LocalePickerPr
|
|
|
19
19
|
'aria-required': import("prop-types").Requireable<boolean>;
|
|
20
20
|
prefixCls: import("prop-types").Requireable<string>;
|
|
21
21
|
clearText: import("prop-types").Requireable<string>;
|
|
22
|
-
value: import("prop-types").Requireable<string | number | string[] |
|
|
22
|
+
value: import("prop-types").Requireable<string | number | string[] | number[] | Date | Date[]>;
|
|
23
23
|
inputReadOnly: import("prop-types").Requireable<boolean>;
|
|
24
24
|
disabled: import("prop-types").Requireable<boolean>;
|
|
25
25
|
showClear: import("prop-types").Requireable<boolean>;
|
|
26
|
-
defaultValue: import("prop-types").Requireable<string | number | string[] |
|
|
26
|
+
defaultValue: import("prop-types").Requireable<string | number | string[] | number[] | Date | Date[]>;
|
|
27
27
|
open: import("prop-types").Requireable<boolean>;
|
|
28
28
|
defaultOpen: import("prop-types").Requireable<boolean>;
|
|
29
29
|
onOpenChange: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
@@ -37,7 +37,7 @@ export default class Title extends PureComponent<TitleProps> {
|
|
|
37
37
|
underline: PropTypes.Requireable<boolean>;
|
|
38
38
|
strong: PropTypes.Requireable<boolean>;
|
|
39
39
|
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
40
|
-
heading: PropTypes.Requireable<1 | 2 | 3 | 4 |
|
|
40
|
+
heading: PropTypes.Requireable<1 | 2 | 3 | 4 | 5 | 6>;
|
|
41
41
|
style: PropTypes.Requireable<object>;
|
|
42
42
|
className: PropTypes.Requireable<string>;
|
|
43
43
|
component: PropTypes.Requireable<string>;
|
|
@@ -140,7 +140,7 @@ declare class Upload extends BaseComponent<UploadProps, UploadState> {
|
|
|
140
140
|
style: PropTypes.Requireable<object>;
|
|
141
141
|
timeout: PropTypes.Requireable<number>;
|
|
142
142
|
transformFile: PropTypes.Requireable<(...args: any[]) => any>;
|
|
143
|
-
uploadTrigger: PropTypes.Requireable<"
|
|
143
|
+
uploadTrigger: PropTypes.Requireable<"auto" | "custom">;
|
|
144
144
|
validateMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
145
145
|
validateStatus: PropTypes.Requireable<"default" | "error" | "warning" | "success">;
|
|
146
146
|
withCredentials: PropTypes.Requireable<boolean>;
|
package/lib/es/_utils/index.js
CHANGED
|
@@ -64,7 +64,10 @@ export function cloneDeep(value, customizer) {
|
|
|
64
64
|
}); // internal-issues:887
|
|
65
65
|
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
try {
|
|
68
|
+
warning(_get(process, 'env.NODE_ENV') !== 'production', "[Semi] You may use an out-of-bounds array. In some cases, your program may not behave as expected.\n The maximum length of an array is 4294967295.\n Please check whether the array subscript in your data exceeds the maximum value of the JS array subscript");
|
|
69
|
+
} catch (e) {}
|
|
70
|
+
|
|
68
71
|
return newArray;
|
|
69
72
|
} else {
|
|
70
73
|
return undefined;
|
package/lib/es/avatar/index.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export default class Avatar extends BaseComponent<AvatarProps, AvatarState> {
|
|
|
20
20
|
onMouseEnter: typeof noop;
|
|
21
21
|
onMouseLeave: typeof noop;
|
|
22
22
|
};
|
|
23
|
+
static elementType: string;
|
|
23
24
|
static propTypes: {
|
|
24
25
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
25
26
|
color: PropTypes.Requireable<string>;
|
package/lib/es/avatar/index.js
CHANGED
|
@@ -8,7 +8,7 @@ declare class CarouselIndicator extends React.PureComponent<CarouselIndicatorPro
|
|
|
8
8
|
position: PropTypes.Requireable<"left" | "right" | "center">;
|
|
9
9
|
size: PropTypes.Requireable<"small" | "medium">;
|
|
10
10
|
style: PropTypes.Requireable<object>;
|
|
11
|
-
theme: PropTypes.Requireable<"
|
|
11
|
+
theme: PropTypes.Requireable<"primary" | "dark" | "light">;
|
|
12
12
|
total: PropTypes.Requireable<number>;
|
|
13
13
|
onIndicatorChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
14
14
|
type: PropTypes.Requireable<"line" | "dot" | "columnar">;
|
|
@@ -22,7 +22,7 @@ declare class Carousel extends BaseComponent<CarouselProps, CarouselState> {
|
|
|
22
22
|
indicatorPosition: PropTypes.Requireable<"left" | "right" | "center">;
|
|
23
23
|
indicatorSize: PropTypes.Requireable<"small" | "medium">;
|
|
24
24
|
indicatorType: PropTypes.Requireable<"line" | "dot" | "columnar">;
|
|
25
|
-
theme: PropTypes.Requireable<"
|
|
25
|
+
theme: PropTypes.Requireable<"primary" | "dark" | "light">;
|
|
26
26
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
27
27
|
arrowType: PropTypes.Requireable<"hover" | "always">;
|
|
28
28
|
showArrow: PropTypes.Requireable<boolean>;
|
|
@@ -67,6 +67,7 @@ declare class Checkbox extends BaseComponent<CheckboxProps, CheckboxState> {
|
|
|
67
67
|
onMouseLeave: (...args: any[]) => void;
|
|
68
68
|
type: string;
|
|
69
69
|
};
|
|
70
|
+
static elementType: string;
|
|
70
71
|
checkboxEntity: CheckboxInner;
|
|
71
72
|
context: CheckboxContextType;
|
|
72
73
|
get adapter(): CheckboxAdapter<CheckboxProps, CheckboxState>;
|
|
@@ -187,15 +187,23 @@ class Checkbox extends BaseComponent {
|
|
|
187
187
|
const name = inGroup && this.context.checkboxGroup.name;
|
|
188
188
|
const xSemiPropChildren = this.props['x-semi-children-alias'] || 'children';
|
|
189
189
|
|
|
190
|
-
const renderContent = () =>
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
"
|
|
198
|
-
|
|
190
|
+
const renderContent = () => {
|
|
191
|
+
if (!children && !extra) {
|
|
192
|
+
return null;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
196
|
+
className: "".concat(prefix, "-content")
|
|
197
|
+
}, children ? /*#__PURE__*/React.createElement("span", {
|
|
198
|
+
id: addonId,
|
|
199
|
+
className: "".concat(prefix, "-addon"),
|
|
200
|
+
"x-semi-prop": xSemiPropChildren
|
|
201
|
+
}, children) : null, extra ? /*#__PURE__*/React.createElement("div", {
|
|
202
|
+
id: extraId,
|
|
203
|
+
className: extraCls,
|
|
204
|
+
"x-semi-prop": "extra"
|
|
205
|
+
}, extra) : null);
|
|
206
|
+
};
|
|
199
207
|
|
|
200
208
|
return (
|
|
201
209
|
/*#__PURE__*/
|
|
@@ -221,7 +229,7 @@ class Checkbox extends BaseComponent {
|
|
|
221
229
|
focusInner: focusVisible && !focusOuter,
|
|
222
230
|
onInputFocus: this.handleFocusVisible,
|
|
223
231
|
onInputBlur: this.handleBlur
|
|
224
|
-
})),
|
|
232
|
+
})), renderContent())
|
|
225
233
|
);
|
|
226
234
|
}
|
|
227
235
|
|
|
@@ -265,4 +273,5 @@ Checkbox.defaultProps = {
|
|
|
265
273
|
onMouseLeave: _noop,
|
|
266
274
|
type: 'default'
|
|
267
275
|
};
|
|
276
|
+
Checkbox.elementType = 'Checkbox';
|
|
268
277
|
export default Checkbox;
|
|
@@ -59,7 +59,7 @@ class CheckboxGroup extends BaseComponent {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
render() {
|
|
62
|
-
var _context2, _context3, _context4;
|
|
62
|
+
var _context2, _context3, _context4, _context5;
|
|
63
63
|
|
|
64
64
|
const {
|
|
65
65
|
children,
|
|
@@ -79,17 +79,18 @@ class CheckboxGroup extends BaseComponent {
|
|
|
79
79
|
[prefix]: true,
|
|
80
80
|
["".concat(prefix, "-wrapper")]: true,
|
|
81
81
|
[_concatInstanceProperty(_context2 = "".concat(prefix, "-")).call(_context2, direction)]: direction,
|
|
82
|
-
[_concatInstanceProperty(_context3 = "".concat(prefix, "-")).call(_context3, direction, "-cardType")]: direction && isCardType
|
|
82
|
+
[_concatInstanceProperty(_context3 = "".concat(prefix, "-")).call(_context3, direction, "-cardType")]: direction && isCardType,
|
|
83
|
+
[_concatInstanceProperty(_context4 = "".concat(prefix, "-")).call(_context4, direction, "-pureCardType")]: direction && isPureCardType
|
|
83
84
|
}, className);
|
|
84
85
|
|
|
85
|
-
const realValue = _sliceInstanceProperty(
|
|
86
|
+
const realValue = _sliceInstanceProperty(_context5 = this.state.value).call(_context5);
|
|
86
87
|
|
|
87
88
|
let inner;
|
|
88
89
|
|
|
89
90
|
if (options) {
|
|
90
|
-
var
|
|
91
|
+
var _context6;
|
|
91
92
|
|
|
92
|
-
inner = _mapInstanceProperty(
|
|
93
|
+
inner = _mapInstanceProperty(_context6 = options || []).call(_context6, (option, index) => {
|
|
93
94
|
if (typeof option === 'string') {
|
|
94
95
|
return /*#__PURE__*/React.createElement(Checkbox, {
|
|
95
96
|
role: "listitem",
|
|
@@ -113,9 +114,9 @@ class CheckboxGroup extends BaseComponent {
|
|
|
113
114
|
}
|
|
114
115
|
});
|
|
115
116
|
} else if (children) {
|
|
116
|
-
var
|
|
117
|
+
var _context7;
|
|
117
118
|
|
|
118
|
-
inner = _mapInstanceProperty(
|
|
119
|
+
inner = _mapInstanceProperty(_context7 = React.Children.toArray(children)).call(_context7, (itm, index) => /*#__PURE__*/React.cloneElement(itm, {
|
|
119
120
|
key: index,
|
|
120
121
|
role: 'listitem'
|
|
121
122
|
}));
|
|
@@ -26,7 +26,7 @@ export default class DateInput extends BaseComponent<DateInputProps, {}> {
|
|
|
26
26
|
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
27
27
|
value: PropTypes.Requireable<any[]>;
|
|
28
28
|
disabled: PropTypes.Requireable<boolean>;
|
|
29
|
-
type: PropTypes.Requireable<"
|
|
29
|
+
type: PropTypes.Requireable<"dateTime" | "date" | "month" | "dateRange" | "year" | "dateTimeRange">;
|
|
30
30
|
showClear: PropTypes.Requireable<boolean>;
|
|
31
31
|
format: PropTypes.Requireable<string>;
|
|
32
32
|
inputStyle: PropTypes.Requireable<object>;
|
|
@@ -41,7 +41,7 @@ export default class DatePicker extends BaseComponent<DatePickerProps, DatePicke
|
|
|
41
41
|
'aria-invalid': PropTypes.Requireable<boolean>;
|
|
42
42
|
'aria-labelledby': PropTypes.Requireable<string>;
|
|
43
43
|
'aria-required': PropTypes.Requireable<boolean>;
|
|
44
|
-
type: PropTypes.Requireable<"
|
|
44
|
+
type: PropTypes.Requireable<"dateTime" | "date" | "month" | "dateRange" | "year" | "dateTimeRange">;
|
|
45
45
|
size: PropTypes.Requireable<"default" | "small" | "large">;
|
|
46
46
|
density: PropTypes.Requireable<"default" | "compact">;
|
|
47
47
|
defaultValue: PropTypes.Requireable<string | number | object>;
|