@douyinfe/semi-ui 2.0.7 → 2.0.9-alpha.3
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/dist/css/semi.css +153 -5
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +776 -672
- 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/lib/es/autoComplete/index.d.ts +36 -12
- package/lib/es/autoComplete/index.js +0 -1
- package/lib/es/calendar/dayCalendar.js +1 -1
- package/lib/es/calendar/monthCalendar.js +1 -1
- package/lib/es/calendar/rangeCalendar.js +1 -1
- package/lib/es/calendar/weekCalendar.js +1 -1
- package/lib/es/collapse/index.js +1 -5
- package/lib/es/datePicker/dateInput.d.ts +1 -1
- package/lib/es/datePicker/datePicker.d.ts +1 -1
- package/lib/es/datePicker/index.d.ts +1 -1
- package/lib/es/datePicker/monthsGrid.d.ts +1 -1
- package/lib/es/datePicker/yearAndMonth.d.ts +2 -2
- package/lib/es/form/baseForm.d.ts +1 -1
- package/lib/es/form/baseForm.js +1 -2
- package/lib/es/form/field.d.ts +1 -1
- package/lib/es/form/hoc/withField.d.ts +2 -2
- package/lib/es/form/hoc/withField.js +5 -1
- package/lib/es/form/interface.d.ts +2 -2
- package/lib/es/locale/localeConsumer.d.ts +5 -5
- package/lib/es/modal/Modal.d.ts +1 -0
- package/lib/es/modal/Modal.js +23 -26
- package/lib/es/modal/useModal/HookModal.d.ts +3 -2
- package/lib/es/modal/useModal/index.js +1 -1
- package/lib/es/navigation/index.d.ts +1 -1
- package/lib/es/notification/index.d.ts +2 -2
- package/lib/es/notification/index.js +1 -1
- package/lib/es/radio/radio.d.ts +1 -1
- package/lib/es/radio/radioGroup.d.ts +1 -1
- package/lib/es/rating/index.d.ts +1 -1
- package/lib/es/resizeObserver/index.js +1 -0
- package/lib/es/scrollList/scrollItem.d.ts +8 -8
- package/lib/es/select/index.d.ts +0 -1
- package/lib/es/select/index.js +2 -3
- package/lib/es/select/option.js +2 -2
- package/lib/es/select/utils.js +2 -4
- package/lib/es/sideSheet/SideSheetContent.d.ts +1 -1
- package/lib/es/sideSheet/index.d.ts +3 -3
- package/lib/es/slider/index.js +3 -1
- package/lib/es/spin/index.d.ts +2 -2
- package/lib/es/spin/index.js +1 -1
- package/lib/es/steps/basicSteps.js +2 -2
- package/lib/es/steps/fillSteps.js +3 -3
- package/lib/es/steps/navSteps.js +2 -2
- package/lib/es/table/Table.d.ts +1 -1
- package/lib/es/table/interface.d.ts +2 -1
- package/lib/es/tabs/index.js +5 -5
- package/lib/es/timePicker/Combobox.d.ts +10 -4
- package/lib/es/timePicker/Combobox.js +2 -1
- package/lib/es/timePicker/TimePicker.d.ts +1 -1
- package/lib/es/toast/index.d.ts +2 -2
- package/lib/es/treeSelect/index.js +2 -1
- package/lib/es/typography/base.d.ts +1 -1
- package/lib/es/typography/paragraph.d.ts +1 -1
- package/lib/es/typography/text.d.ts +1 -1
- package/lib/es/typography/title.d.ts +1 -1
- package/lib/es/upload/fileCard.d.ts +3 -18
- package/lib/es/upload/index.d.ts +4 -56
- package/lib/es/upload/interface.d.ts +56 -0
- package/lib/es/upload/interface.js +1 -0
- package/package.json +9 -8
package/lib/es/select/option.js
CHANGED
|
@@ -20,7 +20,7 @@ import classNames from 'classnames';
|
|
|
20
20
|
import PropTypes from 'prop-types';
|
|
21
21
|
import { isString } from 'lodash-es';
|
|
22
22
|
import { cssClasses } from '@douyinfe/semi-foundation/lib/es/select/constants';
|
|
23
|
-
import
|
|
23
|
+
import LocaleConsumer from '../locale/localeConsumer';
|
|
24
24
|
import { IconTick } from '@douyinfe/semi-icons';
|
|
25
25
|
import { getHighLightTextHTML } from '../_utils/index';
|
|
26
26
|
|
|
@@ -97,7 +97,7 @@ class Option extends PureComponent {
|
|
|
97
97
|
return null;
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
return /*#__PURE__*/React.createElement(
|
|
100
|
+
return /*#__PURE__*/React.createElement(LocaleConsumer, {
|
|
101
101
|
componentName: "Select"
|
|
102
102
|
}, locale => /*#__PURE__*/React.createElement("div", {
|
|
103
103
|
className: optionClassName
|
package/lib/es/select/utils.js
CHANGED
|
@@ -41,8 +41,6 @@ const generateOption = (child, parent) => {
|
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
const getOptionsFromGroup = selectChildren => {
|
|
44
|
-
var _context;
|
|
45
|
-
|
|
46
44
|
let optionGroups = [];
|
|
47
45
|
let options = [];
|
|
48
46
|
const emptyGroup = {
|
|
@@ -52,8 +50,8 @@ const getOptionsFromGroup = selectChildren => {
|
|
|
52
50
|
}; // avoid null
|
|
53
51
|
// eslint-disable-next-line max-len
|
|
54
52
|
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
let childNodes = React.Children.toArray(selectChildren);
|
|
54
|
+
childNodes = _filterInstanceProperty(childNodes).call(childNodes, childNode => childNode && childNode.props);
|
|
57
55
|
let type = '';
|
|
58
56
|
|
|
59
57
|
_forEachInstanceProperty(childNodes).call(childNodes, child => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { CSSProperties } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
export interface SideSheetContentProps {
|
|
4
|
-
onClose?: (e: React.MouseEvent
|
|
4
|
+
onClose?: (e: React.MouseEvent) => void;
|
|
5
5
|
mask?: boolean;
|
|
6
6
|
maskStyle?: CSSProperties;
|
|
7
7
|
maskClosable?: boolean;
|
|
@@ -13,7 +13,7 @@ export interface SideSheetReactProps extends SideSheetProps {
|
|
|
13
13
|
title?: React.ReactNode;
|
|
14
14
|
footer?: React.ReactNode;
|
|
15
15
|
children?: React.ReactNode;
|
|
16
|
-
onCancel?: (e: React.MouseEvent) => void;
|
|
16
|
+
onCancel?: (e: React.MouseEvent | React.KeyboardEvent) => void;
|
|
17
17
|
}
|
|
18
18
|
export { SideSheetState };
|
|
19
19
|
export default class SideSheet extends BaseComponent<SideSheetReactProps, SideSheetState> {
|
|
@@ -52,8 +52,8 @@ export default class SideSheet extends BaseComponent<SideSheetReactProps, SideSh
|
|
|
52
52
|
componentDidMount(): void;
|
|
53
53
|
componentDidUpdate(prevProps: SideSheetReactProps, prevState: SideSheetState, snapshot: any): void;
|
|
54
54
|
componentWillUnmount(): void;
|
|
55
|
-
handleCancel: (e: MouseEvent) => void;
|
|
56
|
-
handleKeyDown: (e:
|
|
55
|
+
handleCancel: (e: React.MouseEvent) => void;
|
|
56
|
+
handleKeyDown: (e: KeyboardEvent) => void;
|
|
57
57
|
renderContent(): JSX.Element;
|
|
58
58
|
render(): JSX.Element;
|
|
59
59
|
}
|
package/lib/es/slider/index.js
CHANGED
|
@@ -399,6 +399,7 @@ export default class Slider extends BaseComponent {
|
|
|
399
399
|
},
|
|
400
400
|
onHandleMove: function (mousePos, isMin) {
|
|
401
401
|
let stateChangeCallback = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : noop;
|
|
402
|
+
let clickTrack = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
402
403
|
|
|
403
404
|
const sliderDOMIsInRenderTree = _this.foundation.checkAndUpdateIsInRenderTreeState();
|
|
404
405
|
|
|
@@ -426,7 +427,8 @@ export default class Slider extends BaseComponent {
|
|
|
426
427
|
if (!isEqual(_this.foundation.outPutValue(currentValue), outPutValue)) {
|
|
427
428
|
onChange(outPutValue);
|
|
428
429
|
|
|
429
|
-
if (_this.foundation.valueFormatIsCorrect(value)) {
|
|
430
|
+
if (!clickTrack && _this.foundation.valueFormatIsCorrect(value)) {
|
|
431
|
+
// still require afterChangeCallback when click on the track directly, need skip here
|
|
430
432
|
return false;
|
|
431
433
|
}
|
|
432
434
|
|
package/lib/es/spin/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export interface SpinProps {
|
|
|
8
8
|
spinning?: boolean;
|
|
9
9
|
indicator?: React.ReactNode;
|
|
10
10
|
delay?: number;
|
|
11
|
-
tip?:
|
|
11
|
+
tip?: React.ReactNode;
|
|
12
12
|
wrapperClassName?: string;
|
|
13
13
|
style?: React.CSSProperties;
|
|
14
14
|
childStyle?: React.CSSProperties;
|
|
@@ -25,7 +25,7 @@ declare class Spin extends BaseComponent<SpinProps, SpinState> {
|
|
|
25
25
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
26
26
|
indicator: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
27
27
|
delay: PropTypes.Requireable<number>;
|
|
28
|
-
tip: PropTypes.Requireable<
|
|
28
|
+
tip: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
29
29
|
wrapperClassName: PropTypes.Requireable<string>;
|
|
30
30
|
childStyle: PropTypes.Requireable<object>;
|
|
31
31
|
style: PropTypes.Requireable<object>;
|
package/lib/es/spin/index.js
CHANGED
|
@@ -107,7 +107,7 @@ Spin.propTypes = {
|
|
|
107
107
|
children: PropTypes.node,
|
|
108
108
|
indicator: PropTypes.node,
|
|
109
109
|
delay: PropTypes.number,
|
|
110
|
-
tip: PropTypes.
|
|
110
|
+
tip: PropTypes.node,
|
|
111
111
|
wrapperClassName: PropTypes.string,
|
|
112
112
|
childStyle: PropTypes.object,
|
|
113
113
|
style: PropTypes.object
|
|
@@ -2,7 +2,7 @@ import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/insta
|
|
|
2
2
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
3
3
|
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
4
4
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
5
|
-
import React, { cloneElement, Children, useMemo } from 'react';
|
|
5
|
+
import React, { cloneElement, Children, useMemo, isValidElement } from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import cls from 'classnames';
|
|
8
8
|
import { stepsClasses as css } from '@douyinfe/semi-foundation/lib/es/steps/constants';
|
|
@@ -26,7 +26,7 @@ const Steps = props => {
|
|
|
26
26
|
const inner = useMemo(() => {
|
|
27
27
|
var _context;
|
|
28
28
|
|
|
29
|
-
const filteredChildren = _filterInstanceProperty(_context = Children.toArray(children)).call(_context, c =>
|
|
29
|
+
const filteredChildren = _filterInstanceProperty(_context = Children.toArray(children)).call(_context, c => /*#__PURE__*/isValidElement(c));
|
|
30
30
|
|
|
31
31
|
const content = _mapInstanceProperty(Children).call(Children, filteredChildren, (child, index) => {
|
|
32
32
|
if (!child) {
|
|
@@ -2,7 +2,7 @@ import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/insta
|
|
|
2
2
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
3
3
|
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
4
4
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
5
|
-
import React, { cloneElement, Children, useMemo } from 'react';
|
|
5
|
+
import React, { cloneElement, Children, useMemo, isValidElement } from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import cls from 'classnames';
|
|
8
8
|
import { stepsClasses as css } from '@douyinfe/semi-foundation/lib/es/steps/constants';
|
|
@@ -25,7 +25,7 @@ const Steps = props => {
|
|
|
25
25
|
const inner = useMemo(() => {
|
|
26
26
|
var _context;
|
|
27
27
|
|
|
28
|
-
const filteredChildren = _filterInstanceProperty(_context = Children.toArray(children)).call(_context, c =>
|
|
28
|
+
const filteredChildren = _filterInstanceProperty(_context = Children.toArray(children)).call(_context, c => /*#__PURE__*/isValidElement(c));
|
|
29
29
|
|
|
30
30
|
const colStyle = direction === 'vertical' ? null : {
|
|
31
31
|
width: "".concat(100 / filteredChildren.length, "%")
|
|
@@ -69,7 +69,7 @@ const Steps = props => {
|
|
|
69
69
|
});
|
|
70
70
|
|
|
71
71
|
return content;
|
|
72
|
-
}, [children, initial, prefixCls, direction, status, current]);
|
|
72
|
+
}, [children, initial, prefixCls, direction, status, current, onChange]);
|
|
73
73
|
const wrapperCls = cls(className, {
|
|
74
74
|
[prefixCls]: true,
|
|
75
75
|
[_concatInstanceProperty(_context2 = "".concat(prefixCls, "-")).call(_context2, direction)]: true
|
package/lib/es/steps/navSteps.js
CHANGED
|
@@ -2,7 +2,7 @@ import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/insta
|
|
|
2
2
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
3
3
|
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
4
4
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
5
|
-
import React, { cloneElement, Children, useMemo } from 'react';
|
|
5
|
+
import React, { cloneElement, Children, useMemo, isValidElement } from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import cls from 'classnames';
|
|
8
8
|
import { stepsClasses as css } from '@douyinfe/semi-foundation/lib/es/steps/constants';
|
|
@@ -23,7 +23,7 @@ const Steps = props => {
|
|
|
23
23
|
const inner = useMemo(() => {
|
|
24
24
|
var _context;
|
|
25
25
|
|
|
26
|
-
const filteredChildren = _filterInstanceProperty(_context = Children.toArray(children)).call(_context, c =>
|
|
26
|
+
const filteredChildren = _filterInstanceProperty(_context = Children.toArray(children)).call(_context, c => /*#__PURE__*/isValidElement(c));
|
|
27
27
|
|
|
28
28
|
const total = filteredChildren.length;
|
|
29
29
|
|
package/lib/es/table/Table.d.ts
CHANGED
|
@@ -277,7 +277,7 @@ declare class Table<RecordType extends Record<string, any>> extends BaseComponen
|
|
|
277
277
|
* Combine pagination and table paging processing functions
|
|
278
278
|
*/
|
|
279
279
|
mergePagination: (pagination: TablePaginationProps) => {
|
|
280
|
-
position?: "
|
|
280
|
+
position?: "both" | "top" | "bottom";
|
|
281
281
|
formatPageText?: import("./interface").FormatPageText;
|
|
282
282
|
style?: React.CSSProperties;
|
|
283
283
|
className?: string;
|
|
@@ -35,7 +35,7 @@ export interface TableProps<RecordType extends Record<string, any> = any> extend
|
|
|
35
35
|
id?: string;
|
|
36
36
|
indentSize?: number;
|
|
37
37
|
loading?: boolean;
|
|
38
|
-
pagination?:
|
|
38
|
+
pagination?: TablePagination;
|
|
39
39
|
prefixCls?: string;
|
|
40
40
|
renderGroupSection?: RenderGroupSection;
|
|
41
41
|
renderPagination?: RenderPagination;
|
|
@@ -225,6 +225,7 @@ export declare type Size = ArrayElement<typeof strings.SIZES>;
|
|
|
225
225
|
export declare type Title<RecordType> = React.ReactNode | ((pageData?: RecordType[]) => React.ReactNode);
|
|
226
226
|
export declare type PaginationPosition = ArrayElement<typeof strings.PAGINATION_POSITIONS>;
|
|
227
227
|
export declare type Pagination = TablePaginationProps | boolean;
|
|
228
|
+
export declare type TablePagination = Pagination;
|
|
228
229
|
export interface ChangeInfoFilter<RecordType> extends BaseChangeInfoFilter<RecordType> {
|
|
229
230
|
filters?: Filter[];
|
|
230
231
|
onFilter?: OnFilter<RecordType>;
|
package/lib/es/tabs/index.js
CHANGED
|
@@ -19,7 +19,7 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
19
19
|
return t;
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
import React, { createRef } from 'react';
|
|
22
|
+
import React, { createRef, isValidElement } from 'react';
|
|
23
23
|
import cls from 'classnames';
|
|
24
24
|
import PropTypes from 'prop-types';
|
|
25
25
|
import { cssClasses, strings } from '@douyinfe/semi-foundation/lib/es/tabs/constants';
|
|
@@ -79,7 +79,7 @@ class Tabs extends BaseComponent {
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
return _filterInstanceProperty(_context = React.Children.toArray(children)).call(_context, pane => {
|
|
82
|
-
if (pane && pane.type && pane.type.isTabPane) {
|
|
82
|
+
if ( /*#__PURE__*/isValidElement(pane) && pane.type && pane.type.isTabPane) {
|
|
83
83
|
return pane.props.itemKey === activeKey;
|
|
84
84
|
}
|
|
85
85
|
|
|
@@ -155,7 +155,7 @@ class Tabs extends BaseComponent {
|
|
|
155
155
|
children
|
|
156
156
|
} = this.props;
|
|
157
157
|
let activeKey = '';
|
|
158
|
-
const list = tabList ? tabList : _mapInstanceProperty(_context3 = React.Children.toArray(children)).call(_context3, child => child.props);
|
|
158
|
+
const list = tabList ? tabList : _mapInstanceProperty(_context3 = React.Children.toArray(children)).call(_context3, child => /*#__PURE__*/isValidElement(child) ? child.props : null);
|
|
159
159
|
|
|
160
160
|
_forEachInstanceProperty(list).call(list, item => {
|
|
161
161
|
if (item && !activeKey && !item.disabled) {
|
|
@@ -182,9 +182,9 @@ class Tabs extends BaseComponent {
|
|
|
182
182
|
var _context4, _context5;
|
|
183
183
|
|
|
184
184
|
// Panes state acts on tab bar, no need to compare TabPane children
|
|
185
|
-
const prevChildrenProps = _mapInstanceProperty(_context4 = React.Children.toArray(prevProps.children)).call(_context4, child => pick(child.props, panePickKeys));
|
|
185
|
+
const prevChildrenProps = _mapInstanceProperty(_context4 = React.Children.toArray(prevProps.children)).call(_context4, child => pick( /*#__PURE__*/isValidElement(child) ? child.props : null, panePickKeys));
|
|
186
186
|
|
|
187
|
-
const nowChildrenProps = _mapInstanceProperty(_context5 = React.Children.toArray(this.props.children)).call(_context5, child => pick(child.props, panePickKeys));
|
|
187
|
+
const nowChildrenProps = _mapInstanceProperty(_context5 = React.Children.toArray(this.props.children)).call(_context5, child => pick( /*#__PURE__*/isValidElement(child) ? child.props : null, panePickKeys));
|
|
188
188
|
|
|
189
189
|
const isTabListType = this.props.tabList || prevProps.tabList;
|
|
190
190
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
import BaseComponent, { BaseProps } from '../_base/baseComponent';
|
|
3
3
|
import ScrollItem from '../scrollList/scrollItem';
|
|
4
|
-
import ComboboxFoundation from '@douyinfe/semi-foundation/lib/es/timePicker/ComboxFoundation';
|
|
4
|
+
import ComboboxFoundation, { formatOption } from '@douyinfe/semi-foundation/lib/es/timePicker/ComboxFoundation';
|
|
5
5
|
import { TimePickerProps } from './TimePicker';
|
|
6
6
|
import { Locale } from '../locale/interface';
|
|
7
7
|
export declare type ComboboxProps = Pick<TimePickerProps, 'format' | 'prefixCls' | 'disabledHours' | 'disabledMinutes' | 'disabledSeconds' | 'hideDisabledOptions' | 'use12Hours' | 'scrollItemProps' | 'panelFooter' | 'panelHeader'> & BaseProps & {
|
|
@@ -26,6 +26,11 @@ export interface ComboboxState {
|
|
|
26
26
|
minuteOptions: number[];
|
|
27
27
|
secondOptions: number[];
|
|
28
28
|
}
|
|
29
|
+
export declare type FormatOptionReturn = ReturnType<typeof formatOption>;
|
|
30
|
+
export interface AMPMOptionItem {
|
|
31
|
+
value: string;
|
|
32
|
+
text: string;
|
|
33
|
+
}
|
|
29
34
|
declare class Combobox extends BaseComponent<ComboboxProps, ComboboxState> {
|
|
30
35
|
static propTypes: {
|
|
31
36
|
format: PropTypes.Requireable<string>;
|
|
@@ -56,11 +61,12 @@ declare class Combobox extends BaseComponent<ComboboxProps, ComboboxState> {
|
|
|
56
61
|
componentDidUpdate(prevProps: ComboboxProps, prevState: ComboboxState): void;
|
|
57
62
|
componentWillUnmount(): void;
|
|
58
63
|
componentDidMount(): void;
|
|
59
|
-
cacheRefCurrent: (key: string, current: ScrollItem) => void;
|
|
64
|
+
cacheRefCurrent: (key: string, current: ScrollItem<FormatOptionReturn> | ScrollItem<AMPMOptionItem>) => void;
|
|
60
65
|
reselect: () => void;
|
|
61
|
-
onItemChange: ({ type, value }: {
|
|
62
|
-
type
|
|
66
|
+
onItemChange: ({ type, value, disabled }: {
|
|
67
|
+
type?: string;
|
|
63
68
|
value: string;
|
|
69
|
+
disabled?: boolean;
|
|
64
70
|
}) => void;
|
|
65
71
|
onEnterSelectPanel: (range: string) => void;
|
|
66
72
|
renderHourSelect(hour: number, locale: Locale['TimePicker']): JSX.Element;
|
|
@@ -49,7 +49,7 @@ export declare type TimePickerProps = {
|
|
|
49
49
|
position?: Position;
|
|
50
50
|
prefixCls?: string;
|
|
51
51
|
rangeSeparator?: string;
|
|
52
|
-
scrollItemProps?: ScrollItemProps
|
|
52
|
+
scrollItemProps?: ScrollItemProps<any>;
|
|
53
53
|
secondStep?: number;
|
|
54
54
|
showClear?: boolean;
|
|
55
55
|
size?: InputSize;
|
package/lib/es/toast/index.d.ts
CHANGED
|
@@ -4,14 +4,14 @@ import { ToastListAdapter, ToastListProps, ToastListState } from '@douyinfe/semi
|
|
|
4
4
|
import '@douyinfe/semi-foundation/lib/es/toast/toast.css';
|
|
5
5
|
import useToast from './useToast';
|
|
6
6
|
import { ConfigProps, ToastInstance, ToastProps, ToastState } from '@douyinfe/semi-foundation/lib/es/toast/toastFoundation';
|
|
7
|
-
import { Motion } from '_base/base';
|
|
7
|
+
import { Motion } from '../_base/base';
|
|
8
8
|
export { ToastTransitionProps } from './ToastTransition';
|
|
9
9
|
export interface ToastReactProps extends ToastProps {
|
|
10
10
|
style?: CSSProperties;
|
|
11
11
|
icon?: React.ReactNode;
|
|
12
12
|
content: React.ReactNode;
|
|
13
13
|
}
|
|
14
|
-
export { ToastListProps, ToastListState, ToastState };
|
|
14
|
+
export { ConfigProps, ToastListProps, ToastListState, ToastState };
|
|
15
15
|
declare const createBaseToast: () => {
|
|
16
16
|
new (props: ToastListProps): {
|
|
17
17
|
readonly adapter: ToastListAdapter;
|
|
@@ -952,7 +952,8 @@ class TreeSelect extends BaseComponent {
|
|
|
952
952
|
registerClickOutsideHandler: cb => {
|
|
953
953
|
const clickOutsideHandler = e => {
|
|
954
954
|
const optionInstance = this.optionsRef && this.optionsRef.current;
|
|
955
|
-
const triggerDom = this.triggerRef && this.triggerRef.current;
|
|
955
|
+
const triggerDom = this.triggerRef && this.triggerRef.current; // eslint-disable-next-line
|
|
956
|
+
|
|
956
957
|
const optionsDom = ReactDOM.findDOMNode(optionInstance);
|
|
957
958
|
const target = e.target;
|
|
958
959
|
|
|
@@ -63,7 +63,7 @@ export default class Base extends Component<BaseTypographyProps, BaseTypographyS
|
|
|
63
63
|
link: PropTypes.Requireable<boolean | object>;
|
|
64
64
|
spacing: PropTypes.Requireable<"normal" | "extended">;
|
|
65
65
|
strong: PropTypes.Requireable<boolean>;
|
|
66
|
-
size: PropTypes.Requireable<"
|
|
66
|
+
size: PropTypes.Requireable<"small" | "normal">;
|
|
67
67
|
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
68
68
|
style: PropTypes.Requireable<object>;
|
|
69
69
|
className: PropTypes.Requireable<string>;
|
|
@@ -30,7 +30,7 @@ export default class Paragraph extends PureComponent<ParagraphProps> {
|
|
|
30
30
|
underline: PropTypes.Requireable<boolean>;
|
|
31
31
|
strong: PropTypes.Requireable<boolean>;
|
|
32
32
|
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
33
|
-
size: PropTypes.Requireable<"
|
|
33
|
+
size: PropTypes.Requireable<"small" | "normal">;
|
|
34
34
|
spacing: PropTypes.Requireable<"normal" | "extended">;
|
|
35
35
|
style: PropTypes.Requireable<object>;
|
|
36
36
|
className: PropTypes.Requireable<string>;
|
|
@@ -33,7 +33,7 @@ export default class Text extends PureComponent<TextProps> {
|
|
|
33
33
|
link: PropTypes.Requireable<boolean | object>;
|
|
34
34
|
strong: PropTypes.Requireable<boolean>;
|
|
35
35
|
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
36
|
-
size: PropTypes.Requireable<"
|
|
36
|
+
size: PropTypes.Requireable<"small" | "normal">;
|
|
37
37
|
style: PropTypes.Requireable<object>;
|
|
38
38
|
className: PropTypes.Requireable<string>;
|
|
39
39
|
code: PropTypes.Requireable<boolean>;
|
|
@@ -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<
|
|
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>;
|
|
@@ -1,25 +1,10 @@
|
|
|
1
|
-
import { PureComponent, ReactNode,
|
|
1
|
+
import { PureComponent, ReactNode, MouseEvent, CSSProperties } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { Locale } from '../locale/interface';
|
|
4
|
-
|
|
4
|
+
import { RenderFileItemProps } from './interface';
|
|
5
|
+
export interface FileCardProps extends RenderFileItemProps {
|
|
5
6
|
className?: string;
|
|
6
|
-
disabled?: boolean;
|
|
7
|
-
listType?: 'picture' | 'list';
|
|
8
|
-
name?: string;
|
|
9
|
-
onPreviewClick?: MouseEventHandler<HTMLDivElement>;
|
|
10
|
-
onRemove?: (props: FileCardProps, e: MouseEvent) => void;
|
|
11
|
-
onReplace?: (props: FileCardProps, e: MouseEvent) => void;
|
|
12
|
-
onRetry?: (props: FileCardProps, e: MouseEvent) => void;
|
|
13
|
-
percent?: number;
|
|
14
|
-
preview?: boolean;
|
|
15
|
-
previewFile?: (props: FileCardProps) => ReactNode;
|
|
16
|
-
showReplace?: boolean;
|
|
17
|
-
showRetry?: boolean;
|
|
18
|
-
size?: string;
|
|
19
|
-
status?: string;
|
|
20
7
|
style?: CSSProperties;
|
|
21
|
-
url?: string;
|
|
22
|
-
validateMessage?: ReactNode;
|
|
23
8
|
}
|
|
24
9
|
declare class FileCard extends PureComponent<FileCardProps> {
|
|
25
10
|
static propTypes: {
|
package/lib/es/upload/index.d.ts
CHANGED
|
@@ -1,64 +1,12 @@
|
|
|
1
1
|
import { ReactNode, CSSProperties, RefObject, ChangeEvent, DragEvent } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import UploadFoundation, {
|
|
4
|
-
import { strings } from '@douyinfe/semi-foundation/lib/es/upload/constants';
|
|
3
|
+
import UploadFoundation, { UploadAdapter, BeforeUploadObjectResult, AfterUploadResult } from '@douyinfe/semi-foundation/lib/es/upload/foundation';
|
|
5
4
|
import FileCard from './fileCard';
|
|
6
5
|
import BaseComponent, { ValidateStatus } from '../_base/baseComponent';
|
|
7
|
-
import {
|
|
6
|
+
import { FileItem, RenderFileItemProps, UploadListType, PromptPositionType, BeforeUploadProps, AfterUploadProps, OnChangeProps, customRequestArgs, CustomError } from './interface';
|
|
8
7
|
import { Locale } from '../locale/interface';
|
|
9
8
|
import '@douyinfe/semi-foundation/lib/es/upload/upload.css';
|
|
10
|
-
export
|
|
11
|
-
validateMessage?: ReactNode;
|
|
12
|
-
}
|
|
13
|
-
export declare type UploadListType = ArrayElement<typeof strings.LIST_TYPE>;
|
|
14
|
-
export declare type PromptPositionType = ArrayElement<typeof strings.PROMPT_POSITION>;
|
|
15
|
-
export interface RenderFileItemProps extends FileItem {
|
|
16
|
-
previewFile: (fileItem: FileItem) => ReactNode;
|
|
17
|
-
listType: UploadListType;
|
|
18
|
-
onRemove: () => void;
|
|
19
|
-
onRetry: () => void;
|
|
20
|
-
onReplace: () => void;
|
|
21
|
-
key: string;
|
|
22
|
-
showRetry: boolean;
|
|
23
|
-
showReplace: boolean;
|
|
24
|
-
style: CSSProperties;
|
|
25
|
-
disabled: boolean;
|
|
26
|
-
onPreviewClick: () => void;
|
|
27
|
-
}
|
|
28
|
-
export interface BeforeUploadProps {
|
|
29
|
-
file: FileItem;
|
|
30
|
-
fileList: Array<FileItem>;
|
|
31
|
-
}
|
|
32
|
-
export interface AfterUploadProps {
|
|
33
|
-
file: FileItem;
|
|
34
|
-
fileList: Array<FileItem>;
|
|
35
|
-
response: any;
|
|
36
|
-
}
|
|
37
|
-
export interface OnChangeProps {
|
|
38
|
-
fileList: Array<FileItem>;
|
|
39
|
-
currentFile: FileItem;
|
|
40
|
-
}
|
|
41
|
-
export interface customRequestArgs {
|
|
42
|
-
fileName: string;
|
|
43
|
-
data: Record<string, any>;
|
|
44
|
-
file: FileItem;
|
|
45
|
-
fileInstance: File;
|
|
46
|
-
onProgress: (event: {
|
|
47
|
-
total: number;
|
|
48
|
-
loaded: number;
|
|
49
|
-
}) => any;
|
|
50
|
-
onError: (userXhr: {
|
|
51
|
-
status?: number;
|
|
52
|
-
}, e: Event) => any;
|
|
53
|
-
onSuccess: (response: any, e: Event) => any;
|
|
54
|
-
withCredentials: boolean;
|
|
55
|
-
action: string;
|
|
56
|
-
}
|
|
57
|
-
export interface CustomError extends Error {
|
|
58
|
-
status: number;
|
|
59
|
-
method: string;
|
|
60
|
-
url: string;
|
|
61
|
-
}
|
|
9
|
+
export { FileItem, RenderFileItemProps, UploadListType, PromptPositionType, BeforeUploadProps, AfterUploadProps, OnChangeProps, customRequestArgs, CustomError };
|
|
62
10
|
export interface UploadProps {
|
|
63
11
|
accept?: string;
|
|
64
12
|
action: string;
|
|
@@ -102,7 +50,7 @@ export interface UploadProps {
|
|
|
102
50
|
onRetry?: (fileItem: FileItem) => void;
|
|
103
51
|
onSizeError?: (file: File, fileList: Array<FileItem>) => void;
|
|
104
52
|
onSuccess?: (responseBody: any, file: File, fileList: Array<FileItem>) => void;
|
|
105
|
-
previewFile?: (
|
|
53
|
+
previewFile?: (renderFileItemProps: RenderFileItemProps) => ReactNode;
|
|
106
54
|
prompt?: ReactNode;
|
|
107
55
|
promptPosition?: PromptPositionType;
|
|
108
56
|
renderFileItem?: (renderFileItemProps: RenderFileItemProps) => ReactNode;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ReactNode, CSSProperties, MouseEvent } from 'react';
|
|
2
|
+
import { BaseFileItem } from '@douyinfe/semi-foundation/lib/es/upload/foundation';
|
|
3
|
+
import { strings } from '@douyinfe/semi-foundation/lib/es/upload/constants';
|
|
4
|
+
import { ArrayElement } from '../_base/base';
|
|
5
|
+
export declare type PromptPositionType = ArrayElement<typeof strings.PROMPT_POSITION>;
|
|
6
|
+
export declare type UploadListType = ArrayElement<typeof strings.LIST_TYPE>;
|
|
7
|
+
export interface BeforeUploadProps {
|
|
8
|
+
file: FileItem;
|
|
9
|
+
fileList: Array<FileItem>;
|
|
10
|
+
}
|
|
11
|
+
export interface AfterUploadProps {
|
|
12
|
+
file: FileItem;
|
|
13
|
+
fileList: Array<FileItem>;
|
|
14
|
+
response: any;
|
|
15
|
+
}
|
|
16
|
+
export interface OnChangeProps {
|
|
17
|
+
fileList: Array<FileItem>;
|
|
18
|
+
currentFile: FileItem;
|
|
19
|
+
}
|
|
20
|
+
export interface customRequestArgs {
|
|
21
|
+
fileName: string;
|
|
22
|
+
data: Record<string, any>;
|
|
23
|
+
file: FileItem;
|
|
24
|
+
fileInstance: File;
|
|
25
|
+
onProgress: (event: {
|
|
26
|
+
total: number;
|
|
27
|
+
loaded: number;
|
|
28
|
+
}) => any;
|
|
29
|
+
onError: (userXhr: {
|
|
30
|
+
status?: number;
|
|
31
|
+
}, e: Event) => any;
|
|
32
|
+
onSuccess: (response: any, e: Event) => any;
|
|
33
|
+
withCredentials: boolean;
|
|
34
|
+
action: string;
|
|
35
|
+
}
|
|
36
|
+
export interface CustomError extends Error {
|
|
37
|
+
status: number;
|
|
38
|
+
method: string;
|
|
39
|
+
url: string;
|
|
40
|
+
}
|
|
41
|
+
export interface FileItem extends BaseFileItem {
|
|
42
|
+
validateMessage?: ReactNode;
|
|
43
|
+
}
|
|
44
|
+
export interface RenderFileItemProps extends FileItem {
|
|
45
|
+
previewFile?: (fileItem: RenderFileItemProps) => ReactNode;
|
|
46
|
+
listType: UploadListType;
|
|
47
|
+
onRemove: (props: RenderFileItemProps, e: MouseEvent) => void;
|
|
48
|
+
onRetry: (props: RenderFileItemProps, e: MouseEvent) => void;
|
|
49
|
+
onReplace: (props: RenderFileItemProps, e: MouseEvent) => void;
|
|
50
|
+
key: string;
|
|
51
|
+
showRetry: boolean;
|
|
52
|
+
showReplace: boolean;
|
|
53
|
+
style?: CSSProperties;
|
|
54
|
+
disabled: boolean;
|
|
55
|
+
onPreviewClick: () => void;
|
|
56
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-ui",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.9-alpha.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/es/index.js",
|
|
6
6
|
"module": "lib/es/index.js",
|
|
@@ -19,11 +19,12 @@
|
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@babel/runtime-corejs3": "^7.15.4",
|
|
22
|
-
"@douyinfe/semi-animation-react": "2.0.
|
|
23
|
-
"@douyinfe/semi-foundation": "2.0.
|
|
24
|
-
"@douyinfe/semi-icons": "2.0.
|
|
25
|
-
"@douyinfe/semi-illustrations": "2.0.
|
|
26
|
-
"@douyinfe/semi-theme-default": "2.0.
|
|
22
|
+
"@douyinfe/semi-animation-react": "2.0.8",
|
|
23
|
+
"@douyinfe/semi-foundation": "2.0.9-alpha.3",
|
|
24
|
+
"@douyinfe/semi-icons": "2.0.9-alpha.3",
|
|
25
|
+
"@douyinfe/semi-illustrations": "2.0.9-alpha.0",
|
|
26
|
+
"@douyinfe/semi-theme-default": "2.0.8",
|
|
27
|
+
"@types/react-window": "^1.8.2",
|
|
27
28
|
"async-validator": "^3.5.0",
|
|
28
29
|
"classnames": "^2.2.6",
|
|
29
30
|
"copy-text-to-clipboard": "^2.1.1",
|
|
@@ -64,13 +65,13 @@
|
|
|
64
65
|
],
|
|
65
66
|
"author": "",
|
|
66
67
|
"license": "MIT",
|
|
67
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "a2979aeef086df38907d49174e6071c20cab6ae9",
|
|
68
69
|
"devDependencies": {
|
|
69
70
|
"@babel/plugin-proposal-decorators": "^7.15.8",
|
|
70
71
|
"@babel/plugin-transform-runtime": "^7.15.8",
|
|
71
72
|
"@babel/preset-env": "^7.15.8",
|
|
72
73
|
"@babel/preset-react": "^7.14.5",
|
|
73
|
-
"@douyinfe/semi-scss-compile": "2.0.
|
|
74
|
+
"@douyinfe/semi-scss-compile": "2.0.8",
|
|
74
75
|
"@storybook/addon-knobs": "^6.3.1",
|
|
75
76
|
"babel-loader": "^8.2.2",
|
|
76
77
|
"case-sensitive-paths-webpack-plugin": "^2.4.0",
|