@douyinfe/semi-ui 2.57.1-alpha.0 → 2.58.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/semi.css +85 -9
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +82 -21
- 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/_base/base.css +2 -2
- package/lib/cjs/button/Button.d.ts +1 -1
- package/lib/cjs/button/Button.js +1 -0
- package/lib/cjs/datePicker/monthsGrid.d.ts +1 -1
- package/lib/cjs/form/baseForm.d.ts +2 -2
- package/lib/cjs/form/field.d.ts +2 -2
- package/lib/cjs/locale/interface.d.ts +3 -0
- package/lib/cjs/locale/source/ar.js +3 -0
- package/lib/cjs/locale/source/de.js +3 -0
- package/lib/cjs/locale/source/en_GB.js +3 -0
- package/lib/cjs/locale/source/en_US.js +3 -0
- package/lib/cjs/locale/source/es.js +3 -0
- package/lib/cjs/locale/source/fr.js +3 -0
- package/lib/cjs/locale/source/id_ID.js +3 -0
- package/lib/cjs/locale/source/it.js +3 -0
- package/lib/cjs/locale/source/ja_JP.js +3 -0
- package/lib/cjs/locale/source/ko_KR.js +3 -0
- package/lib/cjs/locale/source/ms_MY.js +3 -0
- package/lib/cjs/locale/source/nl_NL.js +3 -0
- package/lib/cjs/locale/source/pl_PL.js +3 -0
- package/lib/cjs/locale/source/pt_BR.js +3 -0
- package/lib/cjs/locale/source/ro.js +3 -0
- package/lib/cjs/locale/source/ru_RU.js +3 -0
- package/lib/cjs/locale/source/sv_SE.js +3 -0
- package/lib/cjs/locale/source/th_TH.js +3 -0
- package/lib/cjs/locale/source/tr_TR.js +3 -0
- package/lib/cjs/locale/source/vi_VN.js +3 -0
- package/lib/cjs/locale/source/zh_CN.js +3 -0
- package/lib/cjs/locale/source/zh_TW.js +3 -0
- package/lib/cjs/modal/confirm.d.ts +9 -9
- package/lib/cjs/navigation/Item.js +1 -1
- package/lib/cjs/slider/index.js +9 -6
- package/lib/cjs/table/Body/BaseRow.d.ts +0 -2
- package/lib/cjs/table/Body/BaseRow.js +4 -9
- package/lib/cjs/table/ColGroup.d.ts +2 -2
- package/lib/cjs/table/interface.d.ts +16 -15
- package/lib/cjs/tabs/TabBar.d.ts +4 -0
- package/lib/cjs/tabs/TabBar.js +55 -3
- package/lib/cjs/tabs/TabItem.js +3 -1
- package/lib/cjs/tabs/index.d.ts +1 -0
- package/lib/cjs/tabs/index.js +7 -4
- package/lib/cjs/tabs/interface.d.ts +7 -0
- package/lib/cjs/typography/title.d.ts +1 -1
- package/lib/es/_base/base.css +2 -2
- package/lib/es/button/Button.d.ts +1 -1
- package/lib/es/button/Button.js +1 -0
- package/lib/es/datePicker/monthsGrid.d.ts +1 -1
- package/lib/es/form/baseForm.d.ts +2 -2
- package/lib/es/form/field.d.ts +2 -2
- package/lib/es/locale/interface.d.ts +3 -0
- package/lib/es/locale/source/ar.js +3 -0
- package/lib/es/locale/source/de.js +3 -0
- package/lib/es/locale/source/en_GB.js +3 -0
- package/lib/es/locale/source/en_US.js +3 -0
- package/lib/es/locale/source/es.js +3 -0
- package/lib/es/locale/source/fr.js +3 -0
- package/lib/es/locale/source/id_ID.js +3 -0
- package/lib/es/locale/source/it.js +3 -0
- package/lib/es/locale/source/ja_JP.js +3 -0
- package/lib/es/locale/source/ko_KR.js +3 -0
- package/lib/es/locale/source/ms_MY.js +3 -0
- package/lib/es/locale/source/nl_NL.js +3 -0
- package/lib/es/locale/source/pl_PL.js +3 -0
- package/lib/es/locale/source/pt_BR.js +3 -0
- package/lib/es/locale/source/ro.js +3 -0
- package/lib/es/locale/source/ru_RU.js +3 -0
- package/lib/es/locale/source/sv_SE.js +3 -0
- package/lib/es/locale/source/th_TH.js +3 -0
- package/lib/es/locale/source/tr_TR.js +3 -0
- package/lib/es/locale/source/vi_VN.js +3 -0
- package/lib/es/locale/source/zh_CN.js +3 -0
- package/lib/es/locale/source/zh_TW.js +3 -0
- package/lib/es/modal/confirm.d.ts +9 -9
- package/lib/es/navigation/Item.js +1 -1
- package/lib/es/slider/index.js +9 -6
- package/lib/es/table/Body/BaseRow.d.ts +0 -2
- package/lib/es/table/Body/BaseRow.js +4 -7
- package/lib/es/table/ColGroup.d.ts +2 -2
- package/lib/es/table/interface.d.ts +16 -15
- package/lib/es/tabs/TabBar.d.ts +4 -0
- package/lib/es/tabs/TabBar.js +56 -4
- package/lib/es/tabs/TabItem.js +3 -1
- package/lib/es/tabs/index.d.ts +1 -0
- package/lib/es/tabs/index.js +7 -4
- package/lib/es/tabs/interface.d.ts +7 -0
- package/lib/es/typography/title.d.ts +1 -1
- package/package.json +8 -8
package/lib/cjs/_base/base.css
CHANGED
|
@@ -203,7 +203,7 @@ body, body .semi-always-light, :host, :host .semi-always-light {
|
|
|
203
203
|
--semi-yellow-9: 83,72,0;
|
|
204
204
|
}
|
|
205
205
|
|
|
206
|
-
body[theme-mode=dark], body .semi-always-dark, :host
|
|
206
|
+
body[theme-mode=dark], body .semi-always-dark, :host([theme-mode=dark]), :host .semi-always-dark {
|
|
207
207
|
--semi-red-0: 108,9,11;
|
|
208
208
|
--semi-red-1: 144,17,16;
|
|
209
209
|
--semi-red-2: 180,32,25;
|
|
@@ -478,7 +478,7 @@ body, body[theme-mode=dark] .semi-always-light, :host, :host .semi-always-light
|
|
|
478
478
|
--semi-color-data-19: rgba(188, 198, 255, 1);
|
|
479
479
|
}
|
|
480
480
|
|
|
481
|
-
body[theme-mode=dark], body .semi-always-dark, :host
|
|
481
|
+
body[theme-mode=dark], body .semi-always-dark, :host([theme-mode=dark]), :host .semi-always-dark {
|
|
482
482
|
font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
483
483
|
-webkit-font-smoothing: antialiased;
|
|
484
484
|
--semi-color-white: rgba(228, 231, 245, 1);
|
|
@@ -4,7 +4,7 @@ import '@douyinfe/semi-foundation/lib/cjs/button/button.css';
|
|
|
4
4
|
import { noop } from '@douyinfe/semi-foundation/lib/cjs/utils/function';
|
|
5
5
|
export type HtmlType = 'button' | 'reset' | 'submit';
|
|
6
6
|
export type Size = 'default' | 'small' | 'large';
|
|
7
|
-
export type Theme = 'solid' | 'borderless' | 'light';
|
|
7
|
+
export type Theme = 'solid' | 'borderless' | 'light' | 'outline';
|
|
8
8
|
export type Type = 'primary' | 'secondary' | 'tertiary' | 'warning' | 'danger';
|
|
9
9
|
export interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
|
|
10
10
|
id?: string;
|
package/lib/cjs/button/Button.js
CHANGED
|
@@ -60,6 +60,7 @@ class Button extends _react.PureComponent {
|
|
|
60
60
|
[`${prefixCls}-block`]: block,
|
|
61
61
|
[`${prefixCls}-circle`]: circle,
|
|
62
62
|
[`${prefixCls}-borderless`]: theme === 'borderless',
|
|
63
|
+
[`${prefixCls}-outline`]: theme === "outline",
|
|
63
64
|
[`${prefixCls}-${type}-disabled`]: disabled && type
|
|
64
65
|
}, className),
|
|
65
66
|
type: htmlType,
|
|
@@ -86,7 +86,7 @@ export default class MonthsGrid extends BaseComponent<MonthsGridProps, MonthsGri
|
|
|
86
86
|
renderMonth(month: Date, panelType: PanelType): JSX.Element;
|
|
87
87
|
handleWeeksRowNumChange: (weeksRowNum: number, panelType: PanelType) => void;
|
|
88
88
|
reselect: () => void;
|
|
89
|
-
getYAMOpenType: () => "
|
|
89
|
+
getYAMOpenType: () => "both" | "none" | "left" | "right";
|
|
90
90
|
renderTimePicker(panelType: PanelType, panelDetail: MonthInfo): JSX.Element;
|
|
91
91
|
renderYearAndMonth(panelType: PanelType, panelDetail: MonthInfo): JSX.Element;
|
|
92
92
|
renderSwitch(panelType: PanelType): JSX.Element;
|
|
@@ -86,7 +86,7 @@ declare class Form<Values extends Record<string, any> = any> extends BaseCompone
|
|
|
86
86
|
onDropdownVisibleChange?: (visible: boolean) => void;
|
|
87
87
|
zIndex?: number;
|
|
88
88
|
position?: "left" | "right" | "top" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver";
|
|
89
|
-
onSearch?: (value: string, event: React.
|
|
89
|
+
onSearch?: (value: string, event: React.KeyboardEvent<Element> | React.MouseEvent<Element, MouseEvent>) => void;
|
|
90
90
|
dropdownClassName?: string;
|
|
91
91
|
dropdownStyle?: React.CSSProperties;
|
|
92
92
|
dropdownMargin?: number | {
|
|
@@ -140,7 +140,7 @@ declare class Form<Values extends Record<string, any> = any> extends BaseCompone
|
|
|
140
140
|
preventScroll?: boolean;
|
|
141
141
|
showRestTagsPopover?: boolean;
|
|
142
142
|
restTagsPopoverProps?: import("../popover").PopoverProps;
|
|
143
|
-
} & Pick<import("../tooltip").TooltipProps, "
|
|
143
|
+
} & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "motion" | "getPopupContainer" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay"> & React.RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
|
|
144
144
|
static Checkbox: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox").CheckboxProps & import("./interface").RCIncludeType>;
|
|
145
145
|
static CheckboxGroup: React.ComponentType<import("utility-types").Subtract<import("../checkbox").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & React.RefAttributes<any>>;
|
|
146
146
|
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
|
@@ -32,7 +32,7 @@ declare const FormSelect: import("react").ComponentType<import("utility-types").
|
|
|
32
32
|
onDropdownVisibleChange?: (visible: boolean) => void;
|
|
33
33
|
zIndex?: number;
|
|
34
34
|
position?: "left" | "right" | "top" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver";
|
|
35
|
-
onSearch?: (value: string, event: import("react").
|
|
35
|
+
onSearch?: (value: string, event: import("react").KeyboardEvent<Element> | import("react").MouseEvent<Element, MouseEvent>) => void;
|
|
36
36
|
dropdownClassName?: string;
|
|
37
37
|
dropdownStyle?: import("react").CSSProperties;
|
|
38
38
|
dropdownMargin?: number | {
|
|
@@ -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, "
|
|
89
|
+
} & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "motion" | "getPopupContainer" | "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>>;
|
|
@@ -146,19 +146,19 @@ export declare function withWarning(props: ModalReactProps): {
|
|
|
146
146
|
type: "warning";
|
|
147
147
|
};
|
|
148
148
|
export declare function withError(props: ModalReactProps): {
|
|
149
|
+
title?: React.ReactNode;
|
|
149
150
|
children?: React.ReactNode;
|
|
151
|
+
size?: import("@douyinfe/semi-foundation/lib/cjs/modal/modalFoundation").Size;
|
|
150
152
|
style?: React.CSSProperties;
|
|
151
153
|
className?: string;
|
|
154
|
+
motion?: boolean;
|
|
152
155
|
getPopupContainer?: () => HTMLElement;
|
|
153
156
|
footer?: React.ReactNode;
|
|
154
157
|
header?: React.ReactNode;
|
|
155
|
-
title?: React.ReactNode;
|
|
156
158
|
direction?: any;
|
|
157
159
|
mask?: boolean;
|
|
158
160
|
visible?: boolean;
|
|
159
161
|
zIndex?: number;
|
|
160
|
-
size?: import("@douyinfe/semi-foundation/lib/cjs/modal/modalFoundation").Size;
|
|
161
|
-
motion?: boolean;
|
|
162
162
|
width?: string | number;
|
|
163
163
|
height?: string | number;
|
|
164
164
|
content?: React.ReactNode;
|
|
@@ -209,10 +209,13 @@ export declare function withError(props: ModalReactProps): {
|
|
|
209
209
|
onMouseEnter?: React.MouseEventHandler<HTMLButtonElement>;
|
|
210
210
|
onMouseLeave?: React.MouseEventHandler<HTMLButtonElement>;
|
|
211
211
|
'aria-label'?: string;
|
|
212
|
+
title?: string;
|
|
213
|
+
name?: string;
|
|
212
214
|
value?: string | number | readonly string[];
|
|
215
|
+
onAnimationStart?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
216
|
+
onAnimationEnd?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
213
217
|
form?: string;
|
|
214
218
|
slot?: string;
|
|
215
|
-
title?: string;
|
|
216
219
|
prefix?: string;
|
|
217
220
|
dangerouslySetInnerHTML?: {
|
|
218
221
|
__html: string | TrustedHTML;
|
|
@@ -367,9 +370,7 @@ export declare function withError(props: ModalReactProps): {
|
|
|
367
370
|
onScrollCapture?: React.UIEventHandler<HTMLButtonElement>;
|
|
368
371
|
onWheel?: React.WheelEventHandler<HTMLButtonElement>;
|
|
369
372
|
onWheelCapture?: React.WheelEventHandler<HTMLButtonElement>;
|
|
370
|
-
onAnimationStart?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
371
373
|
onAnimationStartCapture?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
372
|
-
onAnimationEnd?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
373
374
|
onAnimationEndCapture?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
374
375
|
onAnimationIteration?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
375
376
|
onAnimationIterationCapture?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
@@ -383,7 +384,6 @@ export declare function withError(props: ModalReactProps): {
|
|
|
383
384
|
suppressHydrationWarning?: boolean;
|
|
384
385
|
accessKey?: string;
|
|
385
386
|
autoFocus?: boolean;
|
|
386
|
-
name?: string;
|
|
387
387
|
contextMenu?: string;
|
|
388
388
|
dir?: string;
|
|
389
389
|
draggable?: boolean | "true" | "false";
|
|
@@ -391,7 +391,7 @@ export declare function withError(props: ModalReactProps): {
|
|
|
391
391
|
translate?: "no" | "yes";
|
|
392
392
|
role?: React.AriaRole;
|
|
393
393
|
contentEditable?: "inherit" | (boolean | "true" | "false");
|
|
394
|
-
inputMode?: "search" | "
|
|
394
|
+
inputMode?: "search" | "none" | "text" | "email" | "tel" | "url" | "numeric" | "decimal";
|
|
395
395
|
nonce?: string;
|
|
396
396
|
tabIndex?: number;
|
|
397
397
|
content?: string;
|
|
@@ -425,7 +425,7 @@ export declare function withError(props: ModalReactProps): {
|
|
|
425
425
|
is?: string;
|
|
426
426
|
'aria-activedescendant'?: string;
|
|
427
427
|
'aria-atomic'?: boolean | "true" | "false";
|
|
428
|
-
'aria-autocomplete'?: "
|
|
428
|
+
'aria-autocomplete'?: "both" | "none" | "list" | "inline";
|
|
429
429
|
'aria-busy'?: boolean | "true" | "false";
|
|
430
430
|
'aria-checked'?: boolean | "true" | "false" | "mixed";
|
|
431
431
|
'aria-colcount'?: number;
|
|
@@ -217,7 +217,7 @@ class NavItem extends _baseComponent.default {
|
|
|
217
217
|
onMouseEnter: onMouseEnter,
|
|
218
218
|
onMouseLeave: onMouseLeave,
|
|
219
219
|
onKeyPress: this.handleKeyPress
|
|
220
|
-
}), itemChildren);
|
|
220
|
+
}, this.getDataAttr(this.props)), itemChildren);
|
|
221
221
|
}
|
|
222
222
|
// Display Tooltip when disabled and SubNav
|
|
223
223
|
if (isCollapsed && !isInSubNav && !isSubNav || isCollapsed && isSubNav && disabled) {
|
package/lib/cjs/slider/index.js
CHANGED
|
@@ -273,11 +273,11 @@ class Slider extends _baseComponent.default {
|
|
|
273
273
|
const minPercent = percentInfo.min;
|
|
274
274
|
const maxPercent = percentInfo.max;
|
|
275
275
|
let trackStyle = !vertical ? {
|
|
276
|
-
width: range ? `${(maxPercent - minPercent) * 100}%` : `${minPercent * 100}%`,
|
|
277
|
-
left: range ? `${minPercent * 100}%` : 0
|
|
276
|
+
width: range ? `${Math.abs(maxPercent - minPercent) * 100}%` : `${minPercent * 100}%`,
|
|
277
|
+
left: range ? `${Math.min(minPercent, maxPercent) * 100}%` : 0
|
|
278
278
|
} : {
|
|
279
|
-
height: range ? `${(maxPercent - minPercent) * 100}%` : `${minPercent * 100}%`,
|
|
280
|
-
top: range ? `${minPercent * 100}%` : 0
|
|
279
|
+
height: range ? `${Math.abs(maxPercent - minPercent) * 100}%` : `${minPercent * 100}%`,
|
|
280
|
+
top: range ? `${Math.min(minPercent, maxPercent) * 100}%` : 0
|
|
281
281
|
};
|
|
282
282
|
trackStyle = included ? trackStyle : {};
|
|
283
283
|
return (
|
|
@@ -455,7 +455,9 @@ class Slider extends _baseComponent.default {
|
|
|
455
455
|
let callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _noop2.default;
|
|
456
456
|
this.setState(stateObj, callback);
|
|
457
457
|
},
|
|
458
|
-
notifyChange: cbValue =>
|
|
458
|
+
notifyChange: cbValue => {
|
|
459
|
+
this.props.onChange(Array.isArray(cbValue) ? [...cbValue].sort() : cbValue);
|
|
460
|
+
},
|
|
459
461
|
setDragging: value => {
|
|
460
462
|
this.dragging = value;
|
|
461
463
|
},
|
|
@@ -608,7 +610,8 @@ class Slider extends _baseComponent.default {
|
|
|
608
610
|
[`${prefixCls}`]: !vertical,
|
|
609
611
|
[_constants.cssClasses.VERTICAL]: vertical
|
|
610
612
|
});
|
|
611
|
-
const
|
|
613
|
+
const fixedCurrentValue = Array.isArray(currentValue) ? [...currentValue].sort() : currentValue;
|
|
614
|
+
const ariaLabel = range ? `Range: ${this._getAriaValueText(fixedCurrentValue[0], 0)} to ${this._getAriaValueText(fixedCurrentValue[1], 1)}` : undefined;
|
|
612
615
|
const slider = /*#__PURE__*/_react.default.createElement("div", Object.assign({
|
|
613
616
|
className: wrapperClass,
|
|
614
617
|
style: style,
|
|
@@ -158,11 +158,9 @@ export default class TableRow extends BaseComponent<BaseRowProps, Record<string,
|
|
|
158
158
|
disabled: boolean;
|
|
159
159
|
};
|
|
160
160
|
get adapter(): TableRowAdapter<BaseRowProps>;
|
|
161
|
-
ref: React.MutableRefObject<any>;
|
|
162
161
|
constructor(props: BaseRowProps);
|
|
163
162
|
componentDidMount(): void;
|
|
164
163
|
shouldComponentUpdate(nextProps: BaseRowProps): boolean;
|
|
165
|
-
_cacheNode: (node: any) => void;
|
|
166
164
|
renderExpandIcon: (record: Record<string, any>) => React.ReactNode;
|
|
167
165
|
renderCells(): React.ReactNode[];
|
|
168
166
|
handleMouseEnter: (e: React.MouseEvent) => void;
|
|
@@ -11,7 +11,7 @@ var _stubTrue2 = _interopRequireDefault(require("lodash/stubTrue"));
|
|
|
11
11
|
var _get2 = _interopRequireDefault(require("lodash/get"));
|
|
12
12
|
var _noop2 = _interopRequireDefault(require("lodash/noop"));
|
|
13
13
|
var _each2 = _interopRequireDefault(require("lodash/each"));
|
|
14
|
-
var _react =
|
|
14
|
+
var _react = _interopRequireDefault(require("react"));
|
|
15
15
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
16
16
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
17
17
|
var _constants = require("@douyinfe/semi-foundation/lib/cjs/table/constants");
|
|
@@ -20,8 +20,6 @@ var _tableRowFoundation = _interopRequireDefault(require("@douyinfe/semi-foundat
|
|
|
20
20
|
var _utils = require("@douyinfe/semi-foundation/lib/cjs/table/utils");
|
|
21
21
|
var _baseComponent = _interopRequireDefault(require("../../_base/baseComponent"));
|
|
22
22
|
var _TableCell = _interopRequireDefault(require("../TableCell"));
|
|
23
|
-
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); }
|
|
24
|
-
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; }
|
|
25
23
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
26
24
|
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
27
25
|
var t = {};
|
|
@@ -98,9 +96,6 @@ class TableRow extends _baseComponent.default {
|
|
|
98
96
|
}
|
|
99
97
|
constructor(props) {
|
|
100
98
|
super(props);
|
|
101
|
-
this._cacheNode = node => {
|
|
102
|
-
this.ref.current = node;
|
|
103
|
-
};
|
|
104
99
|
// Pass true to render the tree-shaped expand button
|
|
105
100
|
this.renderExpandIcon = record => {
|
|
106
101
|
const {
|
|
@@ -129,7 +124,6 @@ class TableRow extends _baseComponent.default {
|
|
|
129
124
|
customRowProps.onClick(e);
|
|
130
125
|
}
|
|
131
126
|
};
|
|
132
|
-
this.ref = /*#__PURE__*/(0, _react.createRef)();
|
|
133
127
|
this.foundation = new _tableRowFoundation.default(this.adapter);
|
|
134
128
|
}
|
|
135
129
|
componentDidMount() {
|
|
@@ -270,7 +264,8 @@ class TableRow extends _baseComponent.default {
|
|
|
270
264
|
expandableRow,
|
|
271
265
|
level,
|
|
272
266
|
expandedRow,
|
|
273
|
-
isSection
|
|
267
|
+
isSection,
|
|
268
|
+
rowKey
|
|
274
269
|
} = this.props;
|
|
275
270
|
const BodyRow = components.body.row;
|
|
276
271
|
const _a = onRow(record, index) || {},
|
|
@@ -309,7 +304,7 @@ class TableRow extends _baseComponent.default {
|
|
|
309
304
|
}, ariaProps, rowProps, {
|
|
310
305
|
style: baseRowStyle,
|
|
311
306
|
className: rowCls,
|
|
312
|
-
|
|
307
|
+
"data-row-key": rowKey,
|
|
313
308
|
onMouseEnter: this.handleMouseEnter,
|
|
314
309
|
onMouseLeave: this.handleMouseLeave,
|
|
315
310
|
onClick: this.handleClick
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { ColumnProps } from './interface';
|
|
3
|
+
import { ColumnProps, TableComponents } from './interface';
|
|
4
4
|
export interface ColGroupProps {
|
|
5
5
|
columns?: ColumnProps[];
|
|
6
6
|
prefixCls?: string;
|
|
7
7
|
className?: string;
|
|
8
8
|
style?: React.CSSProperties;
|
|
9
|
-
components?:
|
|
9
|
+
components?: TableComponents['body'];
|
|
10
10
|
}
|
|
11
11
|
export default class ColGroup extends React.PureComponent<ColGroupProps> {
|
|
12
12
|
static propTypes: {
|
|
@@ -188,29 +188,30 @@ export interface Data {
|
|
|
188
188
|
[x: string]: any;
|
|
189
189
|
key?: string | number;
|
|
190
190
|
}
|
|
191
|
+
export type TableComponent<P> = React.ComponentType<P> | React.ForwardRefExoticComponent<P> | keyof React.ReactHTML;
|
|
191
192
|
export interface TableComponents {
|
|
192
|
-
table?:
|
|
193
|
+
table?: TableComponent<any>;
|
|
193
194
|
header?: {
|
|
194
|
-
outer?:
|
|
195
|
-
wrapper?:
|
|
196
|
-
row?:
|
|
197
|
-
cell?:
|
|
195
|
+
outer?: TableComponent<any>;
|
|
196
|
+
wrapper?: TableComponent<any>;
|
|
197
|
+
row?: TableComponent<any>;
|
|
198
|
+
cell?: TableComponent<any>;
|
|
198
199
|
};
|
|
199
200
|
body?: {
|
|
200
|
-
outer?:
|
|
201
|
-
wrapper?:
|
|
202
|
-
row?:
|
|
203
|
-
cell?:
|
|
201
|
+
outer?: TableComponent<any>;
|
|
202
|
+
wrapper?: TableComponent<any>;
|
|
203
|
+
row?: TableComponent<any>;
|
|
204
|
+
cell?: TableComponent<any>;
|
|
204
205
|
colgroup?: {
|
|
205
|
-
wrapper?:
|
|
206
|
-
col?:
|
|
206
|
+
wrapper?: TableComponent<any>;
|
|
207
|
+
col?: TableComponent<any>;
|
|
207
208
|
};
|
|
208
209
|
};
|
|
209
210
|
footer?: {
|
|
210
|
-
wrapper?:
|
|
211
|
-
row?:
|
|
212
|
-
cell?:
|
|
213
|
-
outer?:
|
|
211
|
+
wrapper?: TableComponent<any>;
|
|
212
|
+
row?: TableComponent<any>;
|
|
213
|
+
cell?: TableComponent<any>;
|
|
214
|
+
outer?: TableComponent<any>;
|
|
214
215
|
};
|
|
215
216
|
}
|
|
216
217
|
export interface RowSelectionProps<RecordType> {
|
package/lib/cjs/tabs/TabBar.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { MouseEvent, ReactNode } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import { DropdownProps } from '../dropdown';
|
|
3
4
|
import { TabBarProps, PlainTab } from './interface';
|
|
4
5
|
export interface TabBarState {
|
|
5
6
|
endInd: number;
|
|
@@ -25,6 +26,7 @@ declare class TabBar extends React.Component<TabBarProps, TabBarState> {
|
|
|
25
26
|
type: PropTypes.Requireable<string>;
|
|
26
27
|
closable: PropTypes.Requireable<boolean>;
|
|
27
28
|
deleteTabItem: PropTypes.Requireable<(...args: any[]) => any>;
|
|
29
|
+
more: PropTypes.Requireable<NonNullable<number | object>>;
|
|
28
30
|
};
|
|
29
31
|
constructor(props: TabBarProps);
|
|
30
32
|
componentDidMount(): void;
|
|
@@ -38,6 +40,8 @@ declare class TabBar extends React.Component<TabBarProps, TabBarState> {
|
|
|
38
40
|
renderCollapse: (items: Array<OverflowItem>, icon: ReactNode, pos: 'start' | 'end') => ReactNode;
|
|
39
41
|
renderOverflow: (items: any[]) => Array<ReactNode>;
|
|
40
42
|
renderCollapsedTab: () => ReactNode;
|
|
43
|
+
renderWithMoreTrigger: () => ReactNode;
|
|
44
|
+
renderMoreDropdown: (panels: PlainTab[], dropDownProps: DropdownProps, trigger: ReactNode) => ReactNode;
|
|
41
45
|
render(): ReactNode;
|
|
42
46
|
private _isActive;
|
|
43
47
|
private _getItemKey;
|