@douyinfe/semi-ui 2.33.0 → 2.33.2-alpha.1
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 +1 -3
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +155 -126
- 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/cjs/_utils/index.d.ts +1 -1
- package/lib/cjs/button/index.d.ts +1 -1
- package/lib/cjs/calendar/interface.d.ts +2 -2
- package/lib/cjs/form/baseForm.d.ts +1 -1
- package/lib/cjs/form/field.d.ts +1 -1
- package/lib/cjs/input/index.d.ts +1 -1
- package/lib/cjs/input/index.js +1 -1
- package/lib/cjs/modal/confirm.d.ts +3 -3
- package/lib/cjs/table/Body/BaseRow.js +1 -1
- package/lib/cjs/table/Table.js +9 -10
- package/lib/cjs/tooltip/index.d.ts +2 -0
- package/lib/cjs/tooltip/index.js +14 -0
- package/lib/es/_utils/index.d.ts +1 -1
- package/lib/es/button/index.d.ts +1 -1
- package/lib/es/calendar/interface.d.ts +2 -2
- package/lib/es/form/baseForm.d.ts +1 -1
- package/lib/es/form/field.d.ts +1 -1
- package/lib/es/input/index.d.ts +1 -1
- package/lib/es/input/index.js +1 -1
- package/lib/es/modal/confirm.d.ts +3 -3
- package/lib/es/table/Body/BaseRow.js +1 -1
- package/lib/es/table/Table.js +9 -9
- package/lib/es/tooltip/index.d.ts +2 -0
- package/lib/es/tooltip/index.js +14 -0
- package/package.json +8 -8
|
@@ -5,7 +5,7 @@ import React from 'react';
|
|
|
5
5
|
* @param {React.MouseEvent<HTMLElement>} e React mouse event object
|
|
6
6
|
* @param {boolean} noImmediate Skip stopping immediate propagation
|
|
7
7
|
*/
|
|
8
|
-
export declare function stopPropagation(e: React.MouseEvent
|
|
8
|
+
export declare function stopPropagation(e: React.MouseEvent | React.FocusEvent<HTMLElement>, noImmediate?: boolean): void;
|
|
9
9
|
/**
|
|
10
10
|
* use in Table, Form, Navigation
|
|
11
11
|
*
|
|
@@ -32,7 +32,7 @@ declare class Button extends React.PureComponent<ButtonProps> {
|
|
|
32
32
|
'aria-label': import("prop-types").Requireable<string>;
|
|
33
33
|
};
|
|
34
34
|
static elementType: string;
|
|
35
|
-
constructor(props?:
|
|
35
|
+
constructor(props?: ButtonProps);
|
|
36
36
|
render(): JSX.Element;
|
|
37
37
|
}
|
|
38
38
|
export default Button;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { strings } from '@douyinfe/semi-foundation/lib/cjs/calendar/constants';
|
|
3
3
|
import type { ArrayElement } from '../_base/base';
|
|
4
4
|
import type { BaseProps } from '../_base/baseComponent';
|
|
5
|
-
import type { EventObject,
|
|
5
|
+
import type { EventObject, weekStartsOnEnum } from '@douyinfe/semi-foundation/lib/cjs/calendar/foundation';
|
|
6
6
|
export interface CalendarProps extends BaseProps {
|
|
7
7
|
displayValue?: Date;
|
|
8
8
|
range?: Date[];
|
|
@@ -10,7 +10,7 @@ export interface CalendarProps extends BaseProps {
|
|
|
10
10
|
events?: EventObject[];
|
|
11
11
|
mode?: ArrayElement<typeof strings.MODE>;
|
|
12
12
|
showCurrTime?: boolean;
|
|
13
|
-
weekStartsOn?:
|
|
13
|
+
weekStartsOn?: weekStartsOnEnum;
|
|
14
14
|
scrollTop?: number;
|
|
15
15
|
onClick?: (e: React.MouseEvent, value: Date) => void;
|
|
16
16
|
onClose?: (e: React.MouseEvent) => void;
|
|
@@ -138,7 +138,7 @@ declare class Form<Values extends Record<string, any> = any> extends BaseCompone
|
|
|
138
138
|
preventScroll?: boolean;
|
|
139
139
|
showRestTagsPopover?: boolean;
|
|
140
140
|
restTagsPopoverProps?: import("../popover").PopoverProps;
|
|
141
|
-
} & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "
|
|
141
|
+
} & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "getPopupContainer" | "motion" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay"> & React.RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
|
|
142
142
|
static Checkbox: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox").CheckboxProps & import("./interface").RCIncludeType>;
|
|
143
143
|
static CheckboxGroup: React.ComponentType<import("utility-types").Subtract<import("../checkbox").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & React.RefAttributes<any>>;
|
|
144
144
|
static Radio: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../radio").RadioProps & import("./interface").RCIncludeType>;
|
package/lib/cjs/form/field.d.ts
CHANGED
|
@@ -86,7 +86,7 @@ declare const FormSelect: import("react").ComponentType<import("utility-types").
|
|
|
86
86
|
preventScroll?: boolean;
|
|
87
87
|
showRestTagsPopover?: boolean;
|
|
88
88
|
restTagsPopoverProps?: import("../popover").PopoverProps;
|
|
89
|
-
} & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "
|
|
89
|
+
} & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "getPopupContainer" | "motion" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay"> & import("react").RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
|
|
90
90
|
declare const FormCheckboxGroup: import("react").ComponentType<import("utility-types").Subtract<import("../checkbox/checkboxGroup").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & import("react").RefAttributes<any>>;
|
|
91
91
|
declare const FormCheckbox: import("react").ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox/checkbox").CheckboxProps & import("./interface").RCIncludeType>;
|
|
92
92
|
declare const FormRadioGroup: import("react").ComponentType<import("utility-types").Subtract<import("../radio/radioGroup").RadioGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & import("react").RefAttributes<any>>;
|
package/lib/cjs/input/index.d.ts
CHANGED
|
@@ -126,7 +126,7 @@ declare class Input extends BaseComponent<InputProps, InputState> {
|
|
|
126
126
|
onKeyPress: (...args: any[]) => void;
|
|
127
127
|
onEnterPress: (...args: any[]) => void;
|
|
128
128
|
validateStatus: string;
|
|
129
|
-
|
|
129
|
+
borderless: boolean;
|
|
130
130
|
};
|
|
131
131
|
inputRef: React.RefObject<HTMLInputElement>;
|
|
132
132
|
prefixRef: React.RefObject<React.ReactNode>;
|
package/lib/cjs/input/index.js
CHANGED
|
@@ -549,7 +549,7 @@ Input.defaultProps = {
|
|
|
549
549
|
onKeyPress: _noop2.default,
|
|
550
550
|
onEnterPress: _noop2.default,
|
|
551
551
|
validateStatus: 'default',
|
|
552
|
-
|
|
552
|
+
borderless: false
|
|
553
553
|
};
|
|
554
554
|
|
|
555
555
|
const ForwardInput = /*#__PURE__*/_react.default.forwardRef((props, ref) => /*#__PURE__*/_react.default.createElement(Input, Object.assign({}, props, {
|
|
@@ -145,11 +145,11 @@ export declare function withError(props: ModalReactProps): {
|
|
|
145
145
|
size?: import("@douyinfe/semi-foundation/lib/cjs/modal/modalFoundation").Size;
|
|
146
146
|
style?: React.CSSProperties;
|
|
147
147
|
className?: string;
|
|
148
|
-
motion?: boolean;
|
|
149
148
|
getPopupContainer?: () => HTMLElement;
|
|
150
149
|
footer?: React.ReactNode;
|
|
151
150
|
header?: React.ReactNode;
|
|
152
151
|
direction?: any;
|
|
152
|
+
motion?: boolean;
|
|
153
153
|
width?: string | number;
|
|
154
154
|
height?: string | number;
|
|
155
155
|
mask?: boolean;
|
|
@@ -204,10 +204,10 @@ export declare function withError(props: ModalReactProps): {
|
|
|
204
204
|
title?: string;
|
|
205
205
|
name?: string;
|
|
206
206
|
value?: string | number | readonly string[];
|
|
207
|
-
onAnimationStart?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
208
|
-
onAnimationEnd?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
209
207
|
form?: string;
|
|
210
208
|
slot?: string;
|
|
209
|
+
onAnimationStart?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
210
|
+
onAnimationEnd?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
211
211
|
hidden?: boolean;
|
|
212
212
|
color?: string;
|
|
213
213
|
onChange?: React.FormEventHandler<HTMLButtonElement>;
|
|
@@ -217,7 +217,7 @@ class TableRow extends _baseComponent.default {
|
|
|
217
217
|
if (level != null && columnIndex === firstIndex) {
|
|
218
218
|
expandableProps.indent = level;
|
|
219
219
|
|
|
220
|
-
if (!expandableRow) {
|
|
220
|
+
if (!expandableRow && hideExpandedColumn) {
|
|
221
221
|
expandableProps.indent = level + 1;
|
|
222
222
|
}
|
|
223
223
|
}
|
package/lib/cjs/table/Table.js
CHANGED
|
@@ -11,8 +11,6 @@ var _isFunction2 = _interopRequireDefault(require("lodash/isFunction"));
|
|
|
11
11
|
|
|
12
12
|
var _difference2 = _interopRequireDefault(require("lodash/difference"));
|
|
13
13
|
|
|
14
|
-
var _isNull2 = _interopRequireDefault(require("lodash/isNull"));
|
|
15
|
-
|
|
16
14
|
var _omit2 = _interopRequireDefault(require("lodash/omit"));
|
|
17
15
|
|
|
18
16
|
var _each2 = _interopRequireDefault(require("lodash/each"));
|
|
@@ -868,6 +866,8 @@ class Table extends _baseComponent.default {
|
|
|
868
866
|
|
|
869
867
|
const queries = _foundation.default.initColumnsFilteredValueAndSorterOrder((0, _utils2.cloneDeep)(cachedflattenColumns));
|
|
870
868
|
|
|
869
|
+
const filteredSortedDataSource = this.foundation.getFilteredSortedDataSource(this.props.dataSource, queries);
|
|
870
|
+
const pageData = this.foundation.getCurrentPageData(filteredSortedDataSource, this.props.pagination, queries);
|
|
871
871
|
this.state = {
|
|
872
872
|
/**
|
|
873
873
|
* Cached props
|
|
@@ -881,11 +881,11 @@ class Table extends _baseComponent.default {
|
|
|
881
881
|
* State calculated based on prop
|
|
882
882
|
*/
|
|
883
883
|
queries,
|
|
884
|
-
dataSource:
|
|
884
|
+
dataSource: pageData.dataSource,
|
|
885
885
|
flattenData: [],
|
|
886
886
|
expandedRowKeys: [...(props.expandedRowKeys || []), ...(props.defaultExpandedRowKeys || [])],
|
|
887
887
|
rowSelection: props.rowSelection ? (0, _isObject2.default)(props.rowSelection) ? Object.assign({}, props.rowSelection) : {} : null,
|
|
888
|
-
pagination:
|
|
888
|
+
pagination: pageData.pagination,
|
|
889
889
|
|
|
890
890
|
/**
|
|
891
891
|
* Internal state
|
|
@@ -1454,12 +1454,11 @@ class Table extends _baseComponent.default {
|
|
|
1454
1454
|
* TODO: After merging issue 1007, you can place it in the constructor to complete
|
|
1455
1455
|
* The reason is that #1007 exposes the parameters required by getCurrentPageData in the constructor
|
|
1456
1456
|
*/
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
}
|
|
1457
|
+
// if (isNull(dataSource)) {
|
|
1458
|
+
// const pageData: BasePageData<RecordType> = this.foundation.getCurrentPageData(this.props.dataSource);
|
|
1459
|
+
// dataSource = pageData.dataSource;
|
|
1460
|
+
// pagination = pageData.pagination;
|
|
1461
|
+
// }
|
|
1463
1462
|
|
|
1464
1463
|
const props = Object.assign(Object.assign(Object.assign({}, rest), this.state), {
|
|
1465
1464
|
// props not in rest
|
|
@@ -188,6 +188,8 @@ export default class Tooltip extends BaseComponent<TooltipProps, TooltipState> {
|
|
|
188
188
|
renderIcon: () => any;
|
|
189
189
|
handlePortalInnerClick: (e: React.MouseEvent) => void;
|
|
190
190
|
handlePortalMouseDown: (e: React.MouseEvent) => void;
|
|
191
|
+
handlePortalFocus: (e: React.FocusEvent<HTMLElement>) => void;
|
|
192
|
+
handlePortalBlur: (e: React.FocusEvent<HTMLElement>) => void;
|
|
191
193
|
handlePortalInnerKeyDown: (e: React.KeyboardEvent) => void;
|
|
192
194
|
renderContentNode: (content: TooltipProps['content']) => React.ReactNode;
|
|
193
195
|
renderPortal: () => JSX.Element;
|
package/lib/cjs/tooltip/index.js
CHANGED
|
@@ -181,6 +181,18 @@ class Tooltip extends _baseComponent.default {
|
|
|
181
181
|
}
|
|
182
182
|
};
|
|
183
183
|
|
|
184
|
+
this.handlePortalFocus = e => {
|
|
185
|
+
if (this.props.stopPropagation) {
|
|
186
|
+
(0, _utils.stopPropagation)(e);
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
this.handlePortalBlur = e => {
|
|
191
|
+
if (this.props.stopPropagation) {
|
|
192
|
+
(0, _utils.stopPropagation)(e);
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
|
|
184
196
|
this.handlePortalInnerKeyDown = e => {
|
|
185
197
|
this.foundation.handleContainerKeydown(e);
|
|
186
198
|
};
|
|
@@ -276,6 +288,8 @@ class Tooltip extends _baseComponent.default {
|
|
|
276
288
|
style: portalInnerStyle,
|
|
277
289
|
ref: this.setContainerEl,
|
|
278
290
|
onClick: this.handlePortalInnerClick,
|
|
291
|
+
onFocus: this.handlePortalFocus,
|
|
292
|
+
onBlur: this.handlePortalBlur,
|
|
279
293
|
onMouseDown: this.handlePortalMouseDown,
|
|
280
294
|
onKeyDown: this.handlePortalInnerKeyDown
|
|
281
295
|
}, inner));
|
package/lib/es/_utils/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import React from 'react';
|
|
|
5
5
|
* @param {React.MouseEvent<HTMLElement>} e React mouse event object
|
|
6
6
|
* @param {boolean} noImmediate Skip stopping immediate propagation
|
|
7
7
|
*/
|
|
8
|
-
export declare function stopPropagation(e: React.MouseEvent
|
|
8
|
+
export declare function stopPropagation(e: React.MouseEvent | React.FocusEvent<HTMLElement>, noImmediate?: boolean): void;
|
|
9
9
|
/**
|
|
10
10
|
* use in Table, Form, Navigation
|
|
11
11
|
*
|
package/lib/es/button/index.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ declare class Button extends React.PureComponent<ButtonProps> {
|
|
|
32
32
|
'aria-label': import("prop-types").Requireable<string>;
|
|
33
33
|
};
|
|
34
34
|
static elementType: string;
|
|
35
|
-
constructor(props?:
|
|
35
|
+
constructor(props?: ButtonProps);
|
|
36
36
|
render(): JSX.Element;
|
|
37
37
|
}
|
|
38
38
|
export default Button;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { strings } from '@douyinfe/semi-foundation/lib/es/calendar/constants';
|
|
3
3
|
import type { ArrayElement } from '../_base/base';
|
|
4
4
|
import type { BaseProps } from '../_base/baseComponent';
|
|
5
|
-
import type { EventObject,
|
|
5
|
+
import type { EventObject, weekStartsOnEnum } from '@douyinfe/semi-foundation/lib/es/calendar/foundation';
|
|
6
6
|
export interface CalendarProps extends BaseProps {
|
|
7
7
|
displayValue?: Date;
|
|
8
8
|
range?: Date[];
|
|
@@ -10,7 +10,7 @@ export interface CalendarProps extends BaseProps {
|
|
|
10
10
|
events?: EventObject[];
|
|
11
11
|
mode?: ArrayElement<typeof strings.MODE>;
|
|
12
12
|
showCurrTime?: boolean;
|
|
13
|
-
weekStartsOn?:
|
|
13
|
+
weekStartsOn?: weekStartsOnEnum;
|
|
14
14
|
scrollTop?: number;
|
|
15
15
|
onClick?: (e: React.MouseEvent, value: Date) => void;
|
|
16
16
|
onClose?: (e: React.MouseEvent) => void;
|
|
@@ -138,7 +138,7 @@ declare class Form<Values extends Record<string, any> = any> extends BaseCompone
|
|
|
138
138
|
preventScroll?: boolean;
|
|
139
139
|
showRestTagsPopover?: boolean;
|
|
140
140
|
restTagsPopoverProps?: import("../popover").PopoverProps;
|
|
141
|
-
} & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "
|
|
141
|
+
} & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "getPopupContainer" | "motion" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay"> & React.RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
|
|
142
142
|
static Checkbox: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox").CheckboxProps & import("./interface").RCIncludeType>;
|
|
143
143
|
static CheckboxGroup: React.ComponentType<import("utility-types").Subtract<import("../checkbox").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & React.RefAttributes<any>>;
|
|
144
144
|
static Radio: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../radio").RadioProps & import("./interface").RCIncludeType>;
|
package/lib/es/form/field.d.ts
CHANGED
|
@@ -86,7 +86,7 @@ declare const FormSelect: import("react").ComponentType<import("utility-types").
|
|
|
86
86
|
preventScroll?: boolean;
|
|
87
87
|
showRestTagsPopover?: boolean;
|
|
88
88
|
restTagsPopoverProps?: import("../popover").PopoverProps;
|
|
89
|
-
} & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "
|
|
89
|
+
} & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "getPopupContainer" | "motion" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay"> & import("react").RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
|
|
90
90
|
declare const FormCheckboxGroup: import("react").ComponentType<import("utility-types").Subtract<import("../checkbox/checkboxGroup").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & import("react").RefAttributes<any>>;
|
|
91
91
|
declare const FormCheckbox: import("react").ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox/checkbox").CheckboxProps & import("./interface").RCIncludeType>;
|
|
92
92
|
declare const FormRadioGroup: import("react").ComponentType<import("utility-types").Subtract<import("../radio/radioGroup").RadioGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & import("react").RefAttributes<any>>;
|
package/lib/es/input/index.d.ts
CHANGED
|
@@ -126,7 +126,7 @@ declare class Input extends BaseComponent<InputProps, InputState> {
|
|
|
126
126
|
onKeyPress: (...args: any[]) => void;
|
|
127
127
|
onEnterPress: (...args: any[]) => void;
|
|
128
128
|
validateStatus: string;
|
|
129
|
-
|
|
129
|
+
borderless: boolean;
|
|
130
130
|
};
|
|
131
131
|
inputRef: React.RefObject<HTMLInputElement>;
|
|
132
132
|
prefixRef: React.RefObject<React.ReactNode>;
|
package/lib/es/input/index.js
CHANGED
|
@@ -527,7 +527,7 @@ Input.defaultProps = {
|
|
|
527
527
|
onKeyPress: _noop,
|
|
528
528
|
onEnterPress: _noop,
|
|
529
529
|
validateStatus: 'default',
|
|
530
|
-
|
|
530
|
+
borderless: false
|
|
531
531
|
};
|
|
532
532
|
const ForwardInput = /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/React.createElement(Input, Object.assign({}, props, {
|
|
533
533
|
forwardRef: ref
|
|
@@ -145,11 +145,11 @@ export declare function withError(props: ModalReactProps): {
|
|
|
145
145
|
size?: import("@douyinfe/semi-foundation/lib/es/modal/modalFoundation").Size;
|
|
146
146
|
style?: React.CSSProperties;
|
|
147
147
|
className?: string;
|
|
148
|
-
motion?: boolean;
|
|
149
148
|
getPopupContainer?: () => HTMLElement;
|
|
150
149
|
footer?: React.ReactNode;
|
|
151
150
|
header?: React.ReactNode;
|
|
152
151
|
direction?: any;
|
|
152
|
+
motion?: boolean;
|
|
153
153
|
width?: string | number;
|
|
154
154
|
height?: string | number;
|
|
155
155
|
mask?: boolean;
|
|
@@ -204,10 +204,10 @@ export declare function withError(props: ModalReactProps): {
|
|
|
204
204
|
title?: string;
|
|
205
205
|
name?: string;
|
|
206
206
|
value?: string | number | readonly string[];
|
|
207
|
-
onAnimationStart?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
208
|
-
onAnimationEnd?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
209
207
|
form?: string;
|
|
210
208
|
slot?: string;
|
|
209
|
+
onAnimationStart?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
210
|
+
onAnimationEnd?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
211
211
|
hidden?: boolean;
|
|
212
212
|
color?: string;
|
|
213
213
|
onChange?: React.FormEventHandler<HTMLButtonElement>;
|
|
@@ -192,7 +192,7 @@ export default class TableRow extends BaseComponent {
|
|
|
192
192
|
if (level != null && columnIndex === firstIndex) {
|
|
193
193
|
expandableProps.indent = level;
|
|
194
194
|
|
|
195
|
-
if (!expandableRow) {
|
|
195
|
+
if (!expandableRow && hideExpandedColumn) {
|
|
196
196
|
expandableProps.indent = level + 1;
|
|
197
197
|
}
|
|
198
198
|
}
|
package/lib/es/table/Table.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _isObject from "lodash/isObject";
|
|
2
2
|
import _isFunction from "lodash/isFunction";
|
|
3
3
|
import _difference from "lodash/difference";
|
|
4
|
-
import _isNull from "lodash/isNull";
|
|
5
4
|
import _omit from "lodash/omit";
|
|
6
5
|
import _each from "lodash/each";
|
|
7
6
|
import _flattenDeep from "lodash/flattenDeep";
|
|
@@ -822,6 +821,8 @@ class Table extends BaseComponent {
|
|
|
822
821
|
const columns = this.getColumns(props.columns, props.children);
|
|
823
822
|
const cachedflattenColumns = flattenColumns(columns);
|
|
824
823
|
const queries = TableFoundation.initColumnsFilteredValueAndSorterOrder(cloneDeep(cachedflattenColumns));
|
|
824
|
+
const filteredSortedDataSource = this.foundation.getFilteredSortedDataSource(this.props.dataSource, queries);
|
|
825
|
+
const pageData = this.foundation.getCurrentPageData(filteredSortedDataSource, this.props.pagination, queries);
|
|
825
826
|
this.state = {
|
|
826
827
|
/**
|
|
827
828
|
* Cached props
|
|
@@ -835,11 +836,11 @@ class Table extends BaseComponent {
|
|
|
835
836
|
* State calculated based on prop
|
|
836
837
|
*/
|
|
837
838
|
queries,
|
|
838
|
-
dataSource:
|
|
839
|
+
dataSource: pageData.dataSource,
|
|
839
840
|
flattenData: [],
|
|
840
841
|
expandedRowKeys: [...(props.expandedRowKeys || []), ...(props.defaultExpandedRowKeys || [])],
|
|
841
842
|
rowSelection: props.rowSelection ? _isObject(props.rowSelection) ? Object.assign({}, props.rowSelection) : {} : null,
|
|
842
|
-
pagination:
|
|
843
|
+
pagination: pageData.pagination,
|
|
843
844
|
|
|
844
845
|
/**
|
|
845
846
|
* Internal state
|
|
@@ -1411,12 +1412,11 @@ class Table extends BaseComponent {
|
|
|
1411
1412
|
* TODO: After merging issue 1007, you can place it in the constructor to complete
|
|
1412
1413
|
* The reason is that #1007 exposes the parameters required by getCurrentPageData in the constructor
|
|
1413
1414
|
*/
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
}
|
|
1415
|
+
// if (isNull(dataSource)) {
|
|
1416
|
+
// const pageData: BasePageData<RecordType> = this.foundation.getCurrentPageData(this.props.dataSource);
|
|
1417
|
+
// dataSource = pageData.dataSource;
|
|
1418
|
+
// pagination = pageData.pagination;
|
|
1419
|
+
// }
|
|
1420
1420
|
|
|
1421
1421
|
const props = Object.assign(Object.assign(Object.assign({}, rest), this.state), {
|
|
1422
1422
|
// props not in rest
|
|
@@ -188,6 +188,8 @@ export default class Tooltip extends BaseComponent<TooltipProps, TooltipState> {
|
|
|
188
188
|
renderIcon: () => any;
|
|
189
189
|
handlePortalInnerClick: (e: React.MouseEvent) => void;
|
|
190
190
|
handlePortalMouseDown: (e: React.MouseEvent) => void;
|
|
191
|
+
handlePortalFocus: (e: React.FocusEvent<HTMLElement>) => void;
|
|
192
|
+
handlePortalBlur: (e: React.FocusEvent<HTMLElement>) => void;
|
|
191
193
|
handlePortalInnerKeyDown: (e: React.KeyboardEvent) => void;
|
|
192
194
|
renderContentNode: (content: TooltipProps['content']) => React.ReactNode;
|
|
193
195
|
renderPortal: () => JSX.Element;
|
package/lib/es/tooltip/index.js
CHANGED
|
@@ -143,6 +143,18 @@ export default class Tooltip extends BaseComponent {
|
|
|
143
143
|
}
|
|
144
144
|
};
|
|
145
145
|
|
|
146
|
+
this.handlePortalFocus = e => {
|
|
147
|
+
if (this.props.stopPropagation) {
|
|
148
|
+
stopPropagation(e);
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
this.handlePortalBlur = e => {
|
|
153
|
+
if (this.props.stopPropagation) {
|
|
154
|
+
stopPropagation(e);
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
|
|
146
158
|
this.handlePortalInnerKeyDown = e => {
|
|
147
159
|
this.foundation.handleContainerKeydown(e);
|
|
148
160
|
};
|
|
@@ -240,6 +252,8 @@ export default class Tooltip extends BaseComponent {
|
|
|
240
252
|
style: portalInnerStyle,
|
|
241
253
|
ref: this.setContainerEl,
|
|
242
254
|
onClick: this.handlePortalInnerClick,
|
|
255
|
+
onFocus: this.handlePortalFocus,
|
|
256
|
+
onBlur: this.handlePortalBlur,
|
|
243
257
|
onMouseDown: this.handlePortalMouseDown,
|
|
244
258
|
onKeyDown: this.handlePortalInnerKeyDown
|
|
245
259
|
}, inner));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-ui",
|
|
3
|
-
"version": "2.33.
|
|
3
|
+
"version": "2.33.2-alpha.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es/index.js",
|
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
"lib/*"
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@douyinfe/semi-animation": "2.33.
|
|
21
|
-
"@douyinfe/semi-animation-react": "2.33.
|
|
22
|
-
"@douyinfe/semi-foundation": "2.33.
|
|
23
|
-
"@douyinfe/semi-icons": "2.33.
|
|
24
|
-
"@douyinfe/semi-illustrations": "2.33.
|
|
25
|
-
"@douyinfe/semi-theme-default": "2.33.
|
|
20
|
+
"@douyinfe/semi-animation": "2.33.2-alpha.1",
|
|
21
|
+
"@douyinfe/semi-animation-react": "2.33.2-alpha.1",
|
|
22
|
+
"@douyinfe/semi-foundation": "2.33.2-alpha.1",
|
|
23
|
+
"@douyinfe/semi-icons": "2.33.2-alpha.1",
|
|
24
|
+
"@douyinfe/semi-illustrations": "2.33.2-alpha.1",
|
|
25
|
+
"@douyinfe/semi-theme-default": "2.33.2-alpha.1",
|
|
26
26
|
"async-validator": "^3.5.0",
|
|
27
27
|
"classnames": "^2.2.6",
|
|
28
28
|
"copy-text-to-clipboard": "^2.1.1",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
],
|
|
70
70
|
"author": "",
|
|
71
71
|
"license": "MIT",
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "2deb728849055607d3d4019fecd2eee522b74f52",
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@babel/plugin-proposal-decorators": "^7.15.8",
|
|
75
75
|
"@babel/plugin-transform-runtime": "^7.15.8",
|