@douyinfe/semi-ui 2.1.4-alpha.0 → 2.1.4
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/_base/_story/index.scss +1 -0
- package/button/__test__/button.test.js +15 -0
- package/button/_story/button.stories.js +13 -0
- package/button/buttonGroup.tsx +6 -4
- package/cascader/item.tsx +3 -0
- package/checkbox/__test__/checkboxGroup.test.js +37 -5
- package/checkbox/_story/checkbox.stories.js +78 -6
- package/checkbox/checkbox.tsx +1 -0
- package/dist/css/semi.css +57 -4
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +284 -256
- 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/_story/form.stories.tsx +2 -2
- package/form/hoc/withField.tsx +1 -1
- package/lib/cjs/button/buttonGroup.js +11 -3
- package/lib/cjs/cascader/item.js +5 -0
- package/lib/cjs/checkbox/checkbox.js +1 -0
- 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/modal/Modal.d.ts +6 -6
- package/lib/cjs/modal/Modal.js +2 -2
- package/lib/cjs/radio/radio.d.ts +1 -1
- package/lib/cjs/radio/radio.js +1 -0
- package/lib/cjs/radio/radioGroup.d.ts +1 -1
- package/lib/cjs/rating/item.js +2 -1
- package/lib/cjs/table/Table.d.ts +1 -1
- 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/treeSelect/index.js +1 -0
- package/lib/cjs/typography/title.d.ts +1 -1
- package/lib/cjs/upload/index.d.ts +11 -2
- package/lib/cjs/upload/index.js +8 -0
- package/lib/es/button/buttonGroup.js +3 -3
- package/lib/es/cascader/item.js +5 -0
- package/lib/es/checkbox/checkbox.js +1 -0
- 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/modal/Modal.d.ts +6 -6
- package/lib/es/modal/Modal.js +2 -2
- package/lib/es/radio/radio.d.ts +1 -1
- package/lib/es/radio/radio.js +1 -0
- package/lib/es/radio/radioGroup.d.ts +1 -1
- package/lib/es/rating/item.js +2 -1
- package/lib/es/table/Table.d.ts +1 -1
- 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/treeSelect/index.js +1 -0
- package/lib/es/typography/title.d.ts +1 -1
- package/lib/es/upload/index.d.ts +11 -2
- package/lib/es/upload/index.js +8 -0
- package/modal/Modal.tsx +2 -2
- package/package.json +8 -8
- package/radio/__test__/radioGroup.test.jsx +41 -6
- package/radio/_story/radio.stories.js +10 -10
- package/radio/radio.tsx +1 -0
- package/rating/item.tsx +1 -0
- package/treeSelect/index.tsx +3 -2
- package/tsconfig.json +2 -1
- package/upload/index.tsx +8 -1
|
@@ -112,8 +112,8 @@ const Fields: FunctionComponent<FormFCChild> = ({ formState, values, formApi })
|
|
|
112
112
|
label="是否独占资源(Radio)"
|
|
113
113
|
rules={[{ type: 'boolean' }, { required: true, message: '必须选择是否独占 ' }]}
|
|
114
114
|
>
|
|
115
|
-
<Form.Radio value={
|
|
116
|
-
<Form.Radio value={
|
|
115
|
+
<Form.Radio value={1}>是</Form.Radio>
|
|
116
|
+
<Form.Radio value={0}>否</Form.Radio>
|
|
117
117
|
</Form.RadioGroup>
|
|
118
118
|
<Form.Checkbox field='abc' noLabel>
|
|
119
119
|
我已阅读并清楚相关规定(Checkbox)
|
package/form/hoc/withField.tsx
CHANGED
|
@@ -30,7 +30,7 @@ function withField<
|
|
|
30
30
|
T extends Subtract<React.ComponentProps<C>, CommonexcludeType> & CommonFieldProps,
|
|
31
31
|
R extends React.ComponentType<T>
|
|
32
32
|
>(Component: C, opts?: WithFieldOption): R {
|
|
33
|
-
let SemiField = (props: any, ref: React.MutableRefObject<any>) => {
|
|
33
|
+
let SemiField = (props: any, ref: React.MutableRefObject<any> | ((instance: any) => void)) => {
|
|
34
34
|
let {
|
|
35
35
|
// condition,
|
|
36
36
|
field,
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _WeakMap = require("@babel/runtime-corejs3/core-js-stable/weak-map");
|
|
4
|
+
|
|
3
5
|
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
4
6
|
|
|
7
|
+
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
|
8
|
+
|
|
5
9
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
10
|
|
|
7
11
|
_Object$defineProperty(exports, "__esModule", {
|
|
@@ -20,7 +24,7 @@ var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-st
|
|
|
20
24
|
|
|
21
25
|
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
22
26
|
|
|
23
|
-
var _react =
|
|
27
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
24
28
|
|
|
25
29
|
var _baseComponent = _interopRequireDefault(require("../_base/baseComponent"));
|
|
26
30
|
|
|
@@ -30,6 +34,10 @@ var _constants = require("@douyinfe/semi-foundation/lib/cjs/button/constants");
|
|
|
30
34
|
|
|
31
35
|
require("@douyinfe/semi-foundation/lib/cjs/button/button.css");
|
|
32
36
|
|
|
37
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
38
|
+
|
|
39
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { _Object$defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
40
|
+
|
|
33
41
|
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
34
42
|
var t = {};
|
|
35
43
|
|
|
@@ -60,13 +68,13 @@ class ButtonGroup extends _baseComponent.default {
|
|
|
60
68
|
if (children) {
|
|
61
69
|
var _context;
|
|
62
70
|
|
|
63
|
-
inner = (0, _map.default)(_context = (0, _isArray.default)(children) ? children : [children]).call(_context, (itm, index) => /*#__PURE__*/_react.
|
|
71
|
+
inner = (0, _map.default)(_context = (0, _isArray.default)(children) ? children : [children]).call(_context, (itm, index) => /*#__PURE__*/(0, _react.isValidElement)(itm) ? /*#__PURE__*/(0, _react.cloneElement)(itm, (0, _assign.default)((0, _assign.default)((0, _assign.default)({
|
|
64
72
|
disabled,
|
|
65
73
|
size,
|
|
66
74
|
type
|
|
67
75
|
}, itm.props), rest), {
|
|
68
76
|
key: index
|
|
69
|
-
})));
|
|
77
|
+
})) : itm);
|
|
70
78
|
}
|
|
71
79
|
|
|
72
80
|
return /*#__PURE__*/_react.default.createElement("div", {
|
package/lib/cjs/cascader/item.js
CHANGED
|
@@ -83,6 +83,11 @@ class Item extends _react.PureComponent {
|
|
|
83
83
|
} = this.props; // Prevent Checkbox's click event bubbling to trigger the li click event
|
|
84
84
|
|
|
85
85
|
e.stopPropagation();
|
|
86
|
+
|
|
87
|
+
if (e.nativeEvent && typeof e.nativeEvent.stopImmediatePropagation === 'function') {
|
|
88
|
+
e.nativeEvent.stopImmediatePropagation();
|
|
89
|
+
}
|
|
90
|
+
|
|
86
91
|
onItemCheckboxClick(item);
|
|
87
92
|
};
|
|
88
93
|
|
|
@@ -148,6 +148,7 @@ class Checkbox extends _baseComponent.default {
|
|
|
148
148
|
["".concat(prefix, "-cardType_disabled")]: props.disabled && props.isCardType,
|
|
149
149
|
["".concat(prefix, "-cardType_unDisabled")]: !(props.disabled && props.isCardType),
|
|
150
150
|
["".concat(prefix, "-cardType_checked")]: props.isCardType && props.checked && !props.disabled,
|
|
151
|
+
["".concat(prefix, "-cardType_checked_disabled")]: props.isCardType && props.checked && props.disabled,
|
|
151
152
|
[className]: Boolean(className)
|
|
152
153
|
});
|
|
153
154
|
const extraCls = (0, _classnames.default)("".concat(prefix, "-extra"), {
|
|
@@ -24,7 +24,7 @@ export default class DateInput extends BaseComponent<DateInputProps, {}> {
|
|
|
24
24
|
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
25
25
|
value: PropTypes.Requireable<any[]>;
|
|
26
26
|
disabled: PropTypes.Requireable<boolean>;
|
|
27
|
-
type: PropTypes.Requireable<"
|
|
27
|
+
type: PropTypes.Requireable<"dateTime" | "date" | "month" | "dateRange" | "year" | "dateTimeRange">;
|
|
28
28
|
multiple: PropTypes.Requireable<boolean>;
|
|
29
29
|
showClear: PropTypes.Requireable<boolean>;
|
|
30
30
|
format: PropTypes.Requireable<string>;
|
|
@@ -29,7 +29,7 @@ export declare type DatePickerState = DatePickerFoundationState;
|
|
|
29
29
|
export default class DatePicker extends BaseComponent<DatePickerProps, DatePickerState> {
|
|
30
30
|
static contextType: React.Context<import("../configProvider/context").ContextValue>;
|
|
31
31
|
static propTypes: {
|
|
32
|
-
type: PropTypes.Requireable<"
|
|
32
|
+
type: PropTypes.Requireable<"dateTime" | "date" | "month" | "dateRange" | "year" | "dateTimeRange">;
|
|
33
33
|
size: PropTypes.Requireable<"default" | "small" | "large">;
|
|
34
34
|
density: PropTypes.Requireable<"default" | "compact">;
|
|
35
35
|
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>;
|
package/lib/cjs/modal/Modal.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import ModalFoundation, { ModalAdapter, ModalProps, ModalState } from '@douyinfe
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import '@douyinfe/semi-foundation/lib/cjs/modal/modal.css';
|
|
5
5
|
import BaseComponent from '../_base/baseComponent';
|
|
6
|
-
import useModal from '
|
|
6
|
+
import useModal from './useModal';
|
|
7
7
|
import { ButtonProps } from '../button/Button';
|
|
8
8
|
export declare const destroyFns: any[];
|
|
9
9
|
export declare type ConfirmType = 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom';
|
|
@@ -101,23 +101,23 @@ declare class Modal extends BaseComponent<ModalReactProps, ModalState> {
|
|
|
101
101
|
static getScrollbarWidth(): number;
|
|
102
102
|
static info: (props: ModalReactProps) => {
|
|
103
103
|
destroy: () => void;
|
|
104
|
-
update: (newConfig: import("
|
|
104
|
+
update: (newConfig: import("./confirm").ConfirmProps) => void;
|
|
105
105
|
};
|
|
106
106
|
static success: (props: ModalReactProps) => {
|
|
107
107
|
destroy: () => void;
|
|
108
|
-
update: (newConfig: import("
|
|
108
|
+
update: (newConfig: import("./confirm").ConfirmProps) => void;
|
|
109
109
|
};
|
|
110
110
|
static error: (props: ModalReactProps) => {
|
|
111
111
|
destroy: () => void;
|
|
112
|
-
update: (newConfig: import("
|
|
112
|
+
update: (newConfig: import("./confirm").ConfirmProps) => void;
|
|
113
113
|
};
|
|
114
114
|
static warning: (props: ModalReactProps) => {
|
|
115
115
|
destroy: () => void;
|
|
116
|
-
update: (newConfig: import("
|
|
116
|
+
update: (newConfig: import("./confirm").ConfirmProps) => void;
|
|
117
117
|
};
|
|
118
118
|
static confirm: (props: ModalReactProps) => {
|
|
119
119
|
destroy: () => void;
|
|
120
|
-
update: (newConfig: import("
|
|
120
|
+
update: (newConfig: import("./confirm").ConfirmProps) => void;
|
|
121
121
|
};
|
|
122
122
|
static destroyAll: () => void;
|
|
123
123
|
componentDidMount(): void;
|
package/lib/cjs/modal/Modal.js
CHANGED
|
@@ -48,9 +48,9 @@ require("@douyinfe/semi-foundation/lib/cjs/modal/modal.css");
|
|
|
48
48
|
|
|
49
49
|
var _baseComponent = _interopRequireDefault(require("../_base/baseComponent"));
|
|
50
50
|
|
|
51
|
-
var _confirm = _interopRequireWildcard(require("
|
|
51
|
+
var _confirm = _interopRequireWildcard(require("./confirm"));
|
|
52
52
|
|
|
53
|
-
var _useModal = _interopRequireDefault(require("
|
|
53
|
+
var _useModal = _interopRequireDefault(require("./useModal"));
|
|
54
54
|
|
|
55
55
|
function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
56
56
|
|
package/lib/cjs/radio/radio.d.ts
CHANGED
|
@@ -65,7 +65,7 @@ declare class Radio extends BaseComponent<RadioProps, RadioState> {
|
|
|
65
65
|
prefixCls?: string;
|
|
66
66
|
name?: string;
|
|
67
67
|
onChange?: (e: RadioChangeEvent) => void;
|
|
68
|
-
buttonSize?: "small" | "
|
|
68
|
+
buttonSize?: "small" | "middle" | "large";
|
|
69
69
|
isCardRadio?: boolean;
|
|
70
70
|
isPureCardRadio?: boolean;
|
|
71
71
|
};
|
package/lib/cjs/radio/radio.js
CHANGED
|
@@ -149,6 +149,7 @@ class Radio extends _baseComponent.default {
|
|
|
149
149
|
["".concat(prefix, "-cardRadioGroup")]: isCardRadioGroup,
|
|
150
150
|
["".concat(prefix, "-cardRadioGroup_disabled")]: isDisabled && isCardRadioGroup,
|
|
151
151
|
["".concat(prefix, "-cardRadioGroup_checked")]: isCardRadioGroup && realChecked && !isDisabled,
|
|
152
|
+
["".concat(prefix, "-cardRadioGroup_checked_disabled")]: isCardRadioGroup && realChecked && isDisabled,
|
|
152
153
|
["".concat(prefix, "-cardRadioGroup_hover")]: isCardRadioGroup && !realChecked && isHover && !isDisabled,
|
|
153
154
|
[className]: Boolean(className)
|
|
154
155
|
});
|
|
@@ -40,7 +40,7 @@ declare class RadioGroup extends BaseComponent<RadioGroupProps, RadioGroupState>
|
|
|
40
40
|
disabled: PropTypes.Requireable<boolean>;
|
|
41
41
|
name: PropTypes.Requireable<string>;
|
|
42
42
|
options: PropTypes.Requireable<any[]>;
|
|
43
|
-
buttonSize: PropTypes.Requireable<"small" | "
|
|
43
|
+
buttonSize: PropTypes.Requireable<"small" | "middle" | "large">;
|
|
44
44
|
type: PropTypes.Requireable<"default" | "button" | "card" | "pureCard">;
|
|
45
45
|
value: PropTypes.Requireable<any>;
|
|
46
46
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
package/lib/cjs/rating/item.js
CHANGED
|
@@ -114,7 +114,8 @@ class Item extends _react.PureComponent {
|
|
|
114
114
|
"aria-checked": value > index ? 'true' : 'false',
|
|
115
115
|
"aria-posinset": index + 1,
|
|
116
116
|
"aria-setsize": count,
|
|
117
|
-
tabIndex: 0
|
|
117
|
+
tabIndex: 0,
|
|
118
|
+
className: "".concat(prefixCls, "-wrapper")
|
|
118
119
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
119
120
|
className: "".concat(prefixCls, "-first"),
|
|
120
121
|
style: {
|
package/lib/cjs/table/Table.d.ts
CHANGED
|
@@ -176,7 +176,7 @@ declare class Table<RecordType extends Record<string, any>> extends BaseComponen
|
|
|
176
176
|
_invokeColumnFn: (key: string, funcName: string, ...args: any[]) => void;
|
|
177
177
|
_cacheHeaderRef: (node: HTMLDivElement) => void;
|
|
178
178
|
getCurrentPageData: () => any;
|
|
179
|
-
getColumns: (columns: ColumnProps<RecordType>[], children: ReactNode) => ColumnProps<
|
|
179
|
+
getColumns: (columns: ColumnProps<RecordType>[], children: ReactNode) => ColumnProps<RecordType>[];
|
|
180
180
|
getCellWidths: (...args: any[]) => number[];
|
|
181
181
|
setHeadWidths: (...args: any[]) => void;
|
|
182
182
|
getHeadWidths: (...args: any[]) => number[];
|
|
@@ -85,11 +85,11 @@ export default class TimePicker extends BaseComponent<TimePickerProps, TimePicke
|
|
|
85
85
|
panelFooter: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
86
86
|
prefixCls: PropTypes.Requireable<string>;
|
|
87
87
|
clearText: PropTypes.Requireable<string>;
|
|
88
|
-
value: PropTypes.Requireable<string | number | string[] |
|
|
88
|
+
value: PropTypes.Requireable<string | number | string[] | number[] | Date | Date[]>;
|
|
89
89
|
inputReadOnly: PropTypes.Requireable<boolean>;
|
|
90
90
|
disabled: PropTypes.Requireable<boolean>;
|
|
91
91
|
showClear: PropTypes.Requireable<boolean>;
|
|
92
|
-
defaultValue: PropTypes.Requireable<string | number | string[] |
|
|
92
|
+
defaultValue: PropTypes.Requireable<string | number | string[] | number[] | Date | Date[]>;
|
|
93
93
|
open: PropTypes.Requireable<boolean>;
|
|
94
94
|
defaultOpen: PropTypes.Requireable<boolean>;
|
|
95
95
|
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 };
|
|
@@ -13,11 +13,11 @@ export default class LocaleTimePicker extends React.PureComponent<LocalePickerPr
|
|
|
13
13
|
panelFooter: import("prop-types").Requireable<import("prop-types").ReactNodeLike>;
|
|
14
14
|
prefixCls: import("prop-types").Requireable<string>;
|
|
15
15
|
clearText: import("prop-types").Requireable<string>;
|
|
16
|
-
value: import("prop-types").Requireable<string | number | string[] |
|
|
16
|
+
value: import("prop-types").Requireable<string | number | string[] | number[] | Date | Date[]>;
|
|
17
17
|
inputReadOnly: import("prop-types").Requireable<boolean>;
|
|
18
18
|
disabled: import("prop-types").Requireable<boolean>;
|
|
19
19
|
showClear: import("prop-types").Requireable<boolean>;
|
|
20
|
-
defaultValue: import("prop-types").Requireable<string | number | string[] |
|
|
20
|
+
defaultValue: import("prop-types").Requireable<string | number | string[] | number[] | Date | Date[]>;
|
|
21
21
|
open: import("prop-types").Requireable<boolean>;
|
|
22
22
|
defaultOpen: import("prop-types").Requireable<boolean>;
|
|
23
23
|
onOpenChange: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
@@ -769,6 +769,7 @@ class TreeSelect extends _baseComponent.default {
|
|
|
769
769
|
itemSize: virtualize.itemSize,
|
|
770
770
|
height: height,
|
|
771
771
|
width: width,
|
|
772
|
+
// @ts-ignore avoid strict check of itemKey
|
|
772
773
|
itemKey: this.itemKey,
|
|
773
774
|
itemData: flattenNodes,
|
|
774
775
|
className: "".concat(prefixTree, "-virtual-list"),
|
|
@@ -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>;
|
|
@@ -128,7 +128,7 @@ declare class Upload extends BaseComponent<UploadProps, UploadState> {
|
|
|
128
128
|
style: PropTypes.Requireable<object>;
|
|
129
129
|
timeout: PropTypes.Requireable<number>;
|
|
130
130
|
transformFile: PropTypes.Requireable<(...args: any[]) => any>;
|
|
131
|
-
uploadTrigger: PropTypes.Requireable<"
|
|
131
|
+
uploadTrigger: PropTypes.Requireable<"auto" | "custom">;
|
|
132
132
|
validateMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
133
133
|
validateStatus: PropTypes.Requireable<"default" | "error" | "warning" | "success">;
|
|
134
134
|
withCredentials: PropTypes.Requireable<boolean>;
|
|
@@ -136,7 +136,16 @@ declare class Upload extends BaseComponent<UploadProps, UploadState> {
|
|
|
136
136
|
static defaultProps: Partial<UploadProps>;
|
|
137
137
|
static FileCard: typeof FileCard;
|
|
138
138
|
constructor(props: UploadProps);
|
|
139
|
-
|
|
139
|
+
/**
|
|
140
|
+
* Notes:
|
|
141
|
+
* The input parameter and return value here do not declare the type, otherwise tsc may report an error in form/fields.tsx when wrap after withField
|
|
142
|
+
* `The types of the parameters "props" and "nextProps" are incompatible.
|
|
143
|
+
The attribute "action" is missing in the type "Readonly<any>", but it is required in the type "UploadProps".`
|
|
144
|
+
* which seems to be a bug, remove props type declare here
|
|
145
|
+
*/
|
|
146
|
+
static getDerivedStateFromProps(props: any): {
|
|
147
|
+
fileList: any;
|
|
148
|
+
};
|
|
140
149
|
get adapter(): UploadAdapter<UploadProps, UploadState>;
|
|
141
150
|
foundation: UploadFoundation;
|
|
142
151
|
inputRef: RefObject<HTMLInputElement>;
|
package/lib/cjs/upload/index.js
CHANGED
|
@@ -293,6 +293,14 @@ class Upload extends _baseComponent.default {
|
|
|
293
293
|
this.inputRef = /*#__PURE__*/_react.default.createRef();
|
|
294
294
|
this.replaceInputRef = /*#__PURE__*/_react.default.createRef();
|
|
295
295
|
}
|
|
296
|
+
/**
|
|
297
|
+
* Notes:
|
|
298
|
+
* The input parameter and return value here do not declare the type, otherwise tsc may report an error in form/fields.tsx when wrap after withField
|
|
299
|
+
* `The types of the parameters "props" and "nextProps" are incompatible.
|
|
300
|
+
The attribute "action" is missing in the type "Readonly<any>", but it is required in the type "UploadProps".`
|
|
301
|
+
* which seems to be a bug, remove props type declare here
|
|
302
|
+
*/
|
|
303
|
+
|
|
296
304
|
|
|
297
305
|
static getDerivedStateFromProps(props) {
|
|
298
306
|
const {
|
|
@@ -15,7 +15,7 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
15
15
|
return t;
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
-
import React from 'react';
|
|
18
|
+
import React, { isValidElement, cloneElement } from 'react';
|
|
19
19
|
import BaseComponent from '../_base/baseComponent';
|
|
20
20
|
import PropTypes from 'prop-types';
|
|
21
21
|
import { cssClasses, strings } from '@douyinfe/semi-foundation/lib/es/button/constants';
|
|
@@ -38,13 +38,13 @@ export default class ButtonGroup extends BaseComponent {
|
|
|
38
38
|
if (children) {
|
|
39
39
|
var _context;
|
|
40
40
|
|
|
41
|
-
inner = _mapInstanceProperty(_context = _Array$isArray(children) ? children : [children]).call(_context, (itm, index) => /*#__PURE__*/
|
|
41
|
+
inner = _mapInstanceProperty(_context = _Array$isArray(children) ? children : [children]).call(_context, (itm, index) => /*#__PURE__*/isValidElement(itm) ? /*#__PURE__*/cloneElement(itm, _Object$assign(_Object$assign(_Object$assign({
|
|
42
42
|
disabled,
|
|
43
43
|
size,
|
|
44
44
|
type
|
|
45
45
|
}, itm.props), rest), {
|
|
46
46
|
key: index
|
|
47
|
-
})));
|
|
47
|
+
})) : itm);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
return /*#__PURE__*/React.createElement("div", {
|
package/lib/es/cascader/item.js
CHANGED
|
@@ -49,6 +49,11 @@ export default class Item extends PureComponent {
|
|
|
49
49
|
} = this.props; // Prevent Checkbox's click event bubbling to trigger the li click event
|
|
50
50
|
|
|
51
51
|
e.stopPropagation();
|
|
52
|
+
|
|
53
|
+
if (e.nativeEvent && typeof e.nativeEvent.stopImmediatePropagation === 'function') {
|
|
54
|
+
e.nativeEvent.stopImmediatePropagation();
|
|
55
|
+
}
|
|
56
|
+
|
|
52
57
|
onItemCheckboxClick(item);
|
|
53
58
|
};
|
|
54
59
|
|
|
@@ -125,6 +125,7 @@ class Checkbox extends BaseComponent {
|
|
|
125
125
|
["".concat(prefix, "-cardType_disabled")]: props.disabled && props.isCardType,
|
|
126
126
|
["".concat(prefix, "-cardType_unDisabled")]: !(props.disabled && props.isCardType),
|
|
127
127
|
["".concat(prefix, "-cardType_checked")]: props.isCardType && props.checked && !props.disabled,
|
|
128
|
+
["".concat(prefix, "-cardType_checked_disabled")]: props.isCardType && props.checked && props.disabled,
|
|
128
129
|
[className]: Boolean(className)
|
|
129
130
|
});
|
|
130
131
|
const extraCls = classnames("".concat(prefix, "-extra"), {
|
|
@@ -24,7 +24,7 @@ export default class DateInput extends BaseComponent<DateInputProps, {}> {
|
|
|
24
24
|
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
25
25
|
value: PropTypes.Requireable<any[]>;
|
|
26
26
|
disabled: PropTypes.Requireable<boolean>;
|
|
27
|
-
type: PropTypes.Requireable<"
|
|
27
|
+
type: PropTypes.Requireable<"dateTime" | "date" | "month" | "dateRange" | "year" | "dateTimeRange">;
|
|
28
28
|
multiple: PropTypes.Requireable<boolean>;
|
|
29
29
|
showClear: PropTypes.Requireable<boolean>;
|
|
30
30
|
format: PropTypes.Requireable<string>;
|
|
@@ -29,7 +29,7 @@ export declare type DatePickerState = DatePickerFoundationState;
|
|
|
29
29
|
export default class DatePicker extends BaseComponent<DatePickerProps, DatePickerState> {
|
|
30
30
|
static contextType: React.Context<import("../configProvider/context").ContextValue>;
|
|
31
31
|
static propTypes: {
|
|
32
|
-
type: PropTypes.Requireable<"
|
|
32
|
+
type: PropTypes.Requireable<"dateTime" | "date" | "month" | "dateRange" | "year" | "dateTimeRange">;
|
|
33
33
|
size: PropTypes.Requireable<"default" | "small" | "large">;
|
|
34
34
|
density: PropTypes.Requireable<"default" | "compact">;
|
|
35
35
|
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>;
|
package/lib/es/modal/Modal.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import ModalFoundation, { ModalAdapter, ModalProps, ModalState } from '@douyinfe
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import '@douyinfe/semi-foundation/lib/es/modal/modal.css';
|
|
5
5
|
import BaseComponent from '../_base/baseComponent';
|
|
6
|
-
import useModal from '
|
|
6
|
+
import useModal from './useModal';
|
|
7
7
|
import { ButtonProps } from '../button/Button';
|
|
8
8
|
export declare const destroyFns: any[];
|
|
9
9
|
export declare type ConfirmType = 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom';
|
|
@@ -101,23 +101,23 @@ declare class Modal extends BaseComponent<ModalReactProps, ModalState> {
|
|
|
101
101
|
static getScrollbarWidth(): number;
|
|
102
102
|
static info: (props: ModalReactProps) => {
|
|
103
103
|
destroy: () => void;
|
|
104
|
-
update: (newConfig: import("
|
|
104
|
+
update: (newConfig: import("./confirm").ConfirmProps) => void;
|
|
105
105
|
};
|
|
106
106
|
static success: (props: ModalReactProps) => {
|
|
107
107
|
destroy: () => void;
|
|
108
|
-
update: (newConfig: import("
|
|
108
|
+
update: (newConfig: import("./confirm").ConfirmProps) => void;
|
|
109
109
|
};
|
|
110
110
|
static error: (props: ModalReactProps) => {
|
|
111
111
|
destroy: () => void;
|
|
112
|
-
update: (newConfig: import("
|
|
112
|
+
update: (newConfig: import("./confirm").ConfirmProps) => void;
|
|
113
113
|
};
|
|
114
114
|
static warning: (props: ModalReactProps) => {
|
|
115
115
|
destroy: () => void;
|
|
116
|
-
update: (newConfig: import("
|
|
116
|
+
update: (newConfig: import("./confirm").ConfirmProps) => void;
|
|
117
117
|
};
|
|
118
118
|
static confirm: (props: ModalReactProps) => {
|
|
119
119
|
destroy: () => void;
|
|
120
|
-
update: (newConfig: import("
|
|
120
|
+
update: (newConfig: import("./confirm").ConfirmProps) => void;
|
|
121
121
|
};
|
|
122
122
|
static destroyAll: () => void;
|
|
123
123
|
componentDidMount(): void;
|
package/lib/es/modal/Modal.js
CHANGED
|
@@ -29,8 +29,8 @@ import cls from 'classnames';
|
|
|
29
29
|
import PropTypes from 'prop-types';
|
|
30
30
|
import '@douyinfe/semi-foundation/lib/es/modal/modal.css';
|
|
31
31
|
import BaseComponent from '../_base/baseComponent';
|
|
32
|
-
import confirm, { withConfirm, withError, withInfo, withSuccess, withWarning } from '
|
|
33
|
-
import useModal from '
|
|
32
|
+
import confirm, { withConfirm, withError, withInfo, withSuccess, withWarning } from './confirm';
|
|
33
|
+
import useModal from './useModal';
|
|
34
34
|
export const destroyFns = [];
|
|
35
35
|
|
|
36
36
|
class Modal extends BaseComponent {
|
package/lib/es/radio/radio.d.ts
CHANGED
|
@@ -65,7 +65,7 @@ declare class Radio extends BaseComponent<RadioProps, RadioState> {
|
|
|
65
65
|
prefixCls?: string;
|
|
66
66
|
name?: string;
|
|
67
67
|
onChange?: (e: RadioChangeEvent) => void;
|
|
68
|
-
buttonSize?: "small" | "
|
|
68
|
+
buttonSize?: "small" | "middle" | "large";
|
|
69
69
|
isCardRadio?: boolean;
|
|
70
70
|
isPureCardRadio?: boolean;
|
|
71
71
|
};
|
package/lib/es/radio/radio.js
CHANGED
|
@@ -127,6 +127,7 @@ class Radio extends BaseComponent {
|
|
|
127
127
|
["".concat(prefix, "-cardRadioGroup")]: isCardRadioGroup,
|
|
128
128
|
["".concat(prefix, "-cardRadioGroup_disabled")]: isDisabled && isCardRadioGroup,
|
|
129
129
|
["".concat(prefix, "-cardRadioGroup_checked")]: isCardRadioGroup && realChecked && !isDisabled,
|
|
130
|
+
["".concat(prefix, "-cardRadioGroup_checked_disabled")]: isCardRadioGroup && realChecked && isDisabled,
|
|
130
131
|
["".concat(prefix, "-cardRadioGroup_hover")]: isCardRadioGroup && !realChecked && isHover && !isDisabled,
|
|
131
132
|
[className]: Boolean(className)
|
|
132
133
|
});
|
|
@@ -40,7 +40,7 @@ declare class RadioGroup extends BaseComponent<RadioGroupProps, RadioGroupState>
|
|
|
40
40
|
disabled: PropTypes.Requireable<boolean>;
|
|
41
41
|
name: PropTypes.Requireable<string>;
|
|
42
42
|
options: PropTypes.Requireable<any[]>;
|
|
43
|
-
buttonSize: PropTypes.Requireable<"small" | "
|
|
43
|
+
buttonSize: PropTypes.Requireable<"small" | "middle" | "large">;
|
|
44
44
|
type: PropTypes.Requireable<"default" | "button" | "card" | "pureCard">;
|
|
45
45
|
value: PropTypes.Requireable<any>;
|
|
46
46
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
package/lib/es/rating/item.js
CHANGED
|
@@ -86,7 +86,8 @@ export default class Item extends PureComponent {
|
|
|
86
86
|
"aria-checked": value > index ? 'true' : 'false',
|
|
87
87
|
"aria-posinset": index + 1,
|
|
88
88
|
"aria-setsize": count,
|
|
89
|
-
tabIndex: 0
|
|
89
|
+
tabIndex: 0,
|
|
90
|
+
className: "".concat(prefixCls, "-wrapper")
|
|
90
91
|
}, /*#__PURE__*/React.createElement("div", {
|
|
91
92
|
className: "".concat(prefixCls, "-first"),
|
|
92
93
|
style: {
|
package/lib/es/table/Table.d.ts
CHANGED
|
@@ -176,7 +176,7 @@ declare class Table<RecordType extends Record<string, any>> extends BaseComponen
|
|
|
176
176
|
_invokeColumnFn: (key: string, funcName: string, ...args: any[]) => void;
|
|
177
177
|
_cacheHeaderRef: (node: HTMLDivElement) => void;
|
|
178
178
|
getCurrentPageData: () => any;
|
|
179
|
-
getColumns: (columns: ColumnProps<RecordType>[], children: ReactNode) => ColumnProps<
|
|
179
|
+
getColumns: (columns: ColumnProps<RecordType>[], children: ReactNode) => ColumnProps<RecordType>[];
|
|
180
180
|
getCellWidths: (...args: any[]) => number[];
|
|
181
181
|
setHeadWidths: (...args: any[]) => void;
|
|
182
182
|
getHeadWidths: (...args: any[]) => number[];
|
|
@@ -85,11 +85,11 @@ export default class TimePicker extends BaseComponent<TimePickerProps, TimePicke
|
|
|
85
85
|
panelFooter: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
86
86
|
prefixCls: PropTypes.Requireable<string>;
|
|
87
87
|
clearText: PropTypes.Requireable<string>;
|
|
88
|
-
value: PropTypes.Requireable<string | number | string[] |
|
|
88
|
+
value: PropTypes.Requireable<string | number | string[] | number[] | Date | Date[]>;
|
|
89
89
|
inputReadOnly: PropTypes.Requireable<boolean>;
|
|
90
90
|
disabled: PropTypes.Requireable<boolean>;
|
|
91
91
|
showClear: PropTypes.Requireable<boolean>;
|
|
92
|
-
defaultValue: PropTypes.Requireable<string | number | string[] |
|
|
92
|
+
defaultValue: PropTypes.Requireable<string | number | string[] | number[] | Date | Date[]>;
|
|
93
93
|
open: PropTypes.Requireable<boolean>;
|
|
94
94
|
defaultOpen: PropTypes.Requireable<boolean>;
|
|
95
95
|
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 };
|
|
@@ -13,11 +13,11 @@ export default class LocaleTimePicker extends React.PureComponent<LocalePickerPr
|
|
|
13
13
|
panelFooter: import("prop-types").Requireable<import("prop-types").ReactNodeLike>;
|
|
14
14
|
prefixCls: import("prop-types").Requireable<string>;
|
|
15
15
|
clearText: import("prop-types").Requireable<string>;
|
|
16
|
-
value: import("prop-types").Requireable<string | number | string[] |
|
|
16
|
+
value: import("prop-types").Requireable<string | number | string[] | number[] | Date | Date[]>;
|
|
17
17
|
inputReadOnly: import("prop-types").Requireable<boolean>;
|
|
18
18
|
disabled: import("prop-types").Requireable<boolean>;
|
|
19
19
|
showClear: import("prop-types").Requireable<boolean>;
|
|
20
|
-
defaultValue: import("prop-types").Requireable<string | number | string[] |
|
|
20
|
+
defaultValue: import("prop-types").Requireable<string | number | string[] | number[] | Date | Date[]>;
|
|
21
21
|
open: import("prop-types").Requireable<boolean>;
|
|
22
22
|
defaultOpen: import("prop-types").Requireable<boolean>;
|
|
23
23
|
onOpenChange: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
@@ -716,6 +716,7 @@ class TreeSelect extends BaseComponent {
|
|
|
716
716
|
itemSize: virtualize.itemSize,
|
|
717
717
|
height: height,
|
|
718
718
|
width: width,
|
|
719
|
+
// @ts-ignore avoid strict check of itemKey
|
|
719
720
|
itemKey: this.itemKey,
|
|
720
721
|
itemData: flattenNodes,
|
|
721
722
|
className: "".concat(prefixTree, "-virtual-list"),
|
|
@@ -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>;
|
package/lib/es/upload/index.d.ts
CHANGED
|
@@ -128,7 +128,7 @@ declare class Upload extends BaseComponent<UploadProps, UploadState> {
|
|
|
128
128
|
style: PropTypes.Requireable<object>;
|
|
129
129
|
timeout: PropTypes.Requireable<number>;
|
|
130
130
|
transformFile: PropTypes.Requireable<(...args: any[]) => any>;
|
|
131
|
-
uploadTrigger: PropTypes.Requireable<"
|
|
131
|
+
uploadTrigger: PropTypes.Requireable<"auto" | "custom">;
|
|
132
132
|
validateMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
133
133
|
validateStatus: PropTypes.Requireable<"default" | "error" | "warning" | "success">;
|
|
134
134
|
withCredentials: PropTypes.Requireable<boolean>;
|
|
@@ -136,7 +136,16 @@ declare class Upload extends BaseComponent<UploadProps, UploadState> {
|
|
|
136
136
|
static defaultProps: Partial<UploadProps>;
|
|
137
137
|
static FileCard: typeof FileCard;
|
|
138
138
|
constructor(props: UploadProps);
|
|
139
|
-
|
|
139
|
+
/**
|
|
140
|
+
* Notes:
|
|
141
|
+
* The input parameter and return value here do not declare the type, otherwise tsc may report an error in form/fields.tsx when wrap after withField
|
|
142
|
+
* `The types of the parameters "props" and "nextProps" are incompatible.
|
|
143
|
+
The attribute "action" is missing in the type "Readonly<any>", but it is required in the type "UploadProps".`
|
|
144
|
+
* which seems to be a bug, remove props type declare here
|
|
145
|
+
*/
|
|
146
|
+
static getDerivedStateFromProps(props: any): {
|
|
147
|
+
fileList: any;
|
|
148
|
+
};
|
|
140
149
|
get adapter(): UploadAdapter<UploadProps, UploadState>;
|
|
141
150
|
foundation: UploadFoundation;
|
|
142
151
|
inputRef: RefObject<HTMLInputElement>;
|