@douyinfe/semi-ui 2.45.1 → 2.45.3-alpha.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/umd/semi-ui.js +21 -11
- 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/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/inputNumber/index.js +2 -3
- package/lib/cjs/modal/confirm.d.ts +9 -9
- package/lib/cjs/typography/base.d.ts +1 -2
- package/lib/cjs/typography/base.js +16 -5
- package/lib/cjs/typography/interface.d.ts +2 -1
- package/lib/cjs/typography/title.d.ts +1 -1
- 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/inputNumber/index.js +2 -3
- package/lib/es/modal/confirm.d.ts +9 -9
- package/lib/es/typography/base.d.ts +1 -2
- package/lib/es/typography/base.js +16 -5
- package/lib/es/typography/interface.d.ts +2 -1
- package/lib/es/typography/title.d.ts +1 -1
- package/package.json +8 -8
|
@@ -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: () => "none" | "left" | "right" | "both";
|
|
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.MouseEvent<Element, MouseEvent> | React.KeyboardEvent<Element>) => 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, "getPopupContainer" | "stopPropagation" | "motion" | "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").MouseEvent<Element, MouseEvent> | import("react").KeyboardEvent<Element>) => 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, "getPopupContainer" | "stopPropagation" | "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>>;
|
|
@@ -304,7 +304,7 @@ class InputNumber extends _baseComponent.default {
|
|
|
304
304
|
* We need to set the status to false after trigger focus event
|
|
305
305
|
*/
|
|
306
306
|
if (this.clickUpOrDown) {
|
|
307
|
-
obj.value = this.foundation.doFormat(
|
|
307
|
+
obj.value = this.foundation.doFormat(obj.number, true);
|
|
308
308
|
newValue = obj.value;
|
|
309
309
|
}
|
|
310
310
|
this.foundation.updateStates(obj, () => this.adapter.restoreCursor());
|
|
@@ -316,9 +316,8 @@ class InputNumber extends _baseComponent.default {
|
|
|
316
316
|
});
|
|
317
317
|
} else {
|
|
318
318
|
// Update input content when controlled input NaN
|
|
319
|
-
newValue = this.foundation.doFormat(valueStr, false);
|
|
320
319
|
this.foundation.updateStates({
|
|
321
|
-
value:
|
|
320
|
+
value: valueStr
|
|
322
321
|
});
|
|
323
322
|
}
|
|
324
323
|
} else if (this.foundation.isValidNumber(parsedNum)) {
|
|
@@ -140,19 +140,19 @@ export declare function withWarning(props: ModalReactProps): {
|
|
|
140
140
|
type: "warning";
|
|
141
141
|
};
|
|
142
142
|
export declare function withError(props: ModalReactProps): {
|
|
143
|
-
title?: React.ReactNode;
|
|
144
143
|
children?: React.ReactNode;
|
|
145
|
-
size?: import("@douyinfe/semi-foundation/lib/cjs/modal/modalFoundation").Size;
|
|
146
144
|
style?: React.CSSProperties;
|
|
147
145
|
className?: string;
|
|
148
|
-
motion?: boolean;
|
|
149
146
|
getPopupContainer?: () => HTMLElement;
|
|
150
147
|
footer?: React.ReactNode;
|
|
151
148
|
header?: React.ReactNode;
|
|
149
|
+
title?: React.ReactNode;
|
|
152
150
|
direction?: any;
|
|
153
151
|
mask?: boolean;
|
|
154
152
|
visible?: boolean;
|
|
155
153
|
zIndex?: number;
|
|
154
|
+
size?: import("@douyinfe/semi-foundation/lib/cjs/modal/modalFoundation").Size;
|
|
155
|
+
motion?: boolean;
|
|
156
156
|
width?: string | number;
|
|
157
157
|
height?: string | number;
|
|
158
158
|
content?: React.ReactNode;
|
|
@@ -201,13 +201,10 @@ export declare function withError(props: ModalReactProps): {
|
|
|
201
201
|
onMouseEnter?: React.MouseEventHandler<HTMLButtonElement>;
|
|
202
202
|
onMouseLeave?: React.MouseEventHandler<HTMLButtonElement>;
|
|
203
203
|
'aria-label'?: string;
|
|
204
|
-
title?: string;
|
|
205
|
-
name?: string;
|
|
206
204
|
value?: string | number | readonly string[];
|
|
207
|
-
onAnimationStart?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
208
|
-
onAnimationEnd?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
209
205
|
form?: string;
|
|
210
206
|
slot?: string;
|
|
207
|
+
title?: string;
|
|
211
208
|
prefix?: string;
|
|
212
209
|
dangerouslySetInnerHTML?: {
|
|
213
210
|
__html: string | TrustedHTML;
|
|
@@ -362,7 +359,9 @@ export declare function withError(props: ModalReactProps): {
|
|
|
362
359
|
onScrollCapture?: React.UIEventHandler<HTMLButtonElement>;
|
|
363
360
|
onWheel?: React.WheelEventHandler<HTMLButtonElement>;
|
|
364
361
|
onWheelCapture?: React.WheelEventHandler<HTMLButtonElement>;
|
|
362
|
+
onAnimationStart?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
365
363
|
onAnimationStartCapture?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
364
|
+
onAnimationEnd?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
366
365
|
onAnimationEndCapture?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
367
366
|
onAnimationIteration?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
368
367
|
onAnimationIterationCapture?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
@@ -376,6 +375,7 @@ export declare function withError(props: ModalReactProps): {
|
|
|
376
375
|
suppressHydrationWarning?: boolean;
|
|
377
376
|
accessKey?: string;
|
|
378
377
|
autoFocus?: boolean;
|
|
378
|
+
name?: string;
|
|
379
379
|
content?: string;
|
|
380
380
|
formAction?: string;
|
|
381
381
|
formEncType?: string;
|
|
@@ -389,7 +389,7 @@ export declare function withError(props: ModalReactProps): {
|
|
|
389
389
|
translate?: "no" | "yes";
|
|
390
390
|
role?: React.AriaRole;
|
|
391
391
|
contentEditable?: "inherit" | (boolean | "true" | "false");
|
|
392
|
-
inputMode?: "search" | "
|
|
392
|
+
inputMode?: "search" | "text" | "none" | "email" | "tel" | "url" | "numeric" | "decimal";
|
|
393
393
|
nonce?: string;
|
|
394
394
|
tabIndex?: number;
|
|
395
395
|
'aria-expanded'?: boolean | "true" | "false";
|
|
@@ -422,7 +422,7 @@ export declare function withError(props: ModalReactProps): {
|
|
|
422
422
|
is?: string;
|
|
423
423
|
'aria-activedescendant'?: string;
|
|
424
424
|
'aria-atomic'?: boolean | "true" | "false";
|
|
425
|
-
'aria-autocomplete'?: "
|
|
425
|
+
'aria-autocomplete'?: "none" | "list" | "both" | "inline";
|
|
426
426
|
'aria-busy'?: boolean | "true" | "false";
|
|
427
427
|
'aria-checked'?: boolean | "true" | "false" | "mixed";
|
|
428
428
|
'aria-colcount'?: number;
|
|
@@ -132,7 +132,6 @@ export default class Base extends Component<BaseTypographyProps, BaseTypographyS
|
|
|
132
132
|
shouldTruncated: (rows: number) => boolean;
|
|
133
133
|
showTooltip: () => boolean | ShowTooltip | {
|
|
134
134
|
type: string;
|
|
135
|
-
opts: {};
|
|
136
135
|
};
|
|
137
136
|
getEllipsisState(): boolean;
|
|
138
137
|
/**
|
|
@@ -191,7 +190,7 @@ export default class Base extends Component<BaseTypographyProps, BaseTypographyS
|
|
|
191
190
|
renderCopy(): JSX.Element;
|
|
192
191
|
renderIcon(): JSX.Element;
|
|
193
192
|
renderContent(): JSX.Element;
|
|
194
|
-
renderTipWrapper(): JSX.Element;
|
|
193
|
+
renderTipWrapper(): string | number | boolean | React.ReactFragment | JSX.Element;
|
|
195
194
|
render(): JSX.Element;
|
|
196
195
|
}
|
|
197
196
|
export {};
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
var _isFunction2 = _interopRequireDefault(require("lodash/isFunction"));
|
|
7
8
|
var _isNull2 = _interopRequireDefault(require("lodash/isNull"));
|
|
8
9
|
var _isString2 = _interopRequireDefault(require("lodash/isString"));
|
|
9
10
|
var _merge2 = _interopRequireDefault(require("lodash/merge"));
|
|
@@ -102,6 +103,7 @@ class Base extends _react.Component {
|
|
|
102
103
|
return updateOverflow;
|
|
103
104
|
};
|
|
104
105
|
this.showTooltip = () => {
|
|
106
|
+
var _a, _b;
|
|
105
107
|
const {
|
|
106
108
|
isOverflowed,
|
|
107
109
|
isTruncated,
|
|
@@ -119,8 +121,7 @@ class Base extends _react.Component {
|
|
|
119
121
|
return show;
|
|
120
122
|
}
|
|
121
123
|
const defaultOpts = {
|
|
122
|
-
type: 'tooltip'
|
|
123
|
-
opts: {}
|
|
124
|
+
type: 'tooltip'
|
|
124
125
|
};
|
|
125
126
|
if (typeof showTooltip === 'object') {
|
|
126
127
|
if (showTooltip.type && showTooltip.type.toLowerCase() === 'popover') {
|
|
@@ -129,7 +130,14 @@ class Base extends _react.Component {
|
|
|
129
130
|
// style: { width: '240px' },
|
|
130
131
|
showArrow: true
|
|
131
132
|
}
|
|
132
|
-
}, showTooltip
|
|
133
|
+
}, showTooltip, {
|
|
134
|
+
opts: {
|
|
135
|
+
className: (0, _classnames.default)({
|
|
136
|
+
[`${prefixCls}-ellipsis-popover`]: true,
|
|
137
|
+
[(_a = showTooltip === null || showTooltip === void 0 ? void 0 : showTooltip.opts) === null || _a === void 0 ? void 0 : _a.className]: Boolean((_b = showTooltip === null || showTooltip === void 0 ? void 0 : showTooltip.opts) === null || _b === void 0 ? void 0 : _b.className)
|
|
138
|
+
})
|
|
139
|
+
}
|
|
140
|
+
});
|
|
133
141
|
}
|
|
134
142
|
return Object.assign(Object.assign({}, defaultOpts), showTooltip);
|
|
135
143
|
}
|
|
@@ -531,9 +539,12 @@ class Base extends _react.Component {
|
|
|
531
539
|
if (showTooltip) {
|
|
532
540
|
const {
|
|
533
541
|
type,
|
|
534
|
-
opts
|
|
542
|
+
opts,
|
|
543
|
+
renderTooltip
|
|
535
544
|
} = showTooltip;
|
|
536
|
-
if (
|
|
545
|
+
if ((0, _isFunction2.default)(renderTooltip)) {
|
|
546
|
+
return renderTooltip(children, content);
|
|
547
|
+
} else if (type.toLowerCase() === 'popover') {
|
|
537
548
|
return /*#__PURE__*/_react.default.createElement(_index2.default, Object.assign({
|
|
538
549
|
content: children,
|
|
539
550
|
position: "top"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
import { PopoverProps } from '../popover';
|
|
3
3
|
import { TooltipProps } from '../tooltip';
|
|
4
4
|
import { ArrayElement } from '../_base/base';
|
|
@@ -7,6 +7,7 @@ export type EllipsisPos = 'end' | 'middle';
|
|
|
7
7
|
export type ShowTooltip = {
|
|
8
8
|
type?: string;
|
|
9
9
|
opts?: Partial<PopoverProps> & Partial<TooltipProps>;
|
|
10
|
+
renderTooltip?: (content: TooltipProps['content'], children: ReactNode) => ReactNode;
|
|
10
11
|
};
|
|
11
12
|
export type Ellipsis = {
|
|
12
13
|
collapseText?: string;
|
|
@@ -60,7 +60,7 @@ export default class Title extends PureComponent<TitleProps> {
|
|
|
60
60
|
underline: PropTypes.Requireable<boolean>;
|
|
61
61
|
strong: PropTypes.Requireable<boolean>;
|
|
62
62
|
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
63
|
-
heading: PropTypes.Requireable<
|
|
63
|
+
heading: PropTypes.Requireable<4 | 2 | 5 | 1 | 3 | 6>;
|
|
64
64
|
style: PropTypes.Requireable<object>;
|
|
65
65
|
className: PropTypes.Requireable<string>;
|
|
66
66
|
component: PropTypes.Requireable<string>;
|
|
@@ -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: () => "none" | "left" | "right" | "both";
|
|
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.MouseEvent<Element, MouseEvent> | React.KeyboardEvent<Element>) => 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, "getPopupContainer" | "stopPropagation" | "motion" | "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/es/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").MouseEvent<Element, MouseEvent> | import("react").KeyboardEvent<Element>) => 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, "getPopupContainer" | "stopPropagation" | "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>>;
|
|
@@ -296,7 +296,7 @@ class InputNumber extends BaseComponent {
|
|
|
296
296
|
* We need to set the status to false after trigger focus event
|
|
297
297
|
*/
|
|
298
298
|
if (this.clickUpOrDown) {
|
|
299
|
-
obj.value = this.foundation.doFormat(
|
|
299
|
+
obj.value = this.foundation.doFormat(obj.number, true);
|
|
300
300
|
newValue = obj.value;
|
|
301
301
|
}
|
|
302
302
|
this.foundation.updateStates(obj, () => this.adapter.restoreCursor());
|
|
@@ -308,9 +308,8 @@ class InputNumber extends BaseComponent {
|
|
|
308
308
|
});
|
|
309
309
|
} else {
|
|
310
310
|
// Update input content when controlled input NaN
|
|
311
|
-
newValue = this.foundation.doFormat(valueStr, false);
|
|
312
311
|
this.foundation.updateStates({
|
|
313
|
-
value:
|
|
312
|
+
value: valueStr
|
|
314
313
|
});
|
|
315
314
|
}
|
|
316
315
|
} else if (this.foundation.isValidNumber(parsedNum)) {
|
|
@@ -140,19 +140,19 @@ export declare function withWarning(props: ModalReactProps): {
|
|
|
140
140
|
type: "warning";
|
|
141
141
|
};
|
|
142
142
|
export declare function withError(props: ModalReactProps): {
|
|
143
|
-
title?: React.ReactNode;
|
|
144
143
|
children?: React.ReactNode;
|
|
145
|
-
size?: import("@douyinfe/semi-foundation/lib/es/modal/modalFoundation").Size;
|
|
146
144
|
style?: React.CSSProperties;
|
|
147
145
|
className?: string;
|
|
148
|
-
motion?: boolean;
|
|
149
146
|
getPopupContainer?: () => HTMLElement;
|
|
150
147
|
footer?: React.ReactNode;
|
|
151
148
|
header?: React.ReactNode;
|
|
149
|
+
title?: React.ReactNode;
|
|
152
150
|
direction?: any;
|
|
153
151
|
mask?: boolean;
|
|
154
152
|
visible?: boolean;
|
|
155
153
|
zIndex?: number;
|
|
154
|
+
size?: import("@douyinfe/semi-foundation/lib/es/modal/modalFoundation").Size;
|
|
155
|
+
motion?: boolean;
|
|
156
156
|
width?: string | number;
|
|
157
157
|
height?: string | number;
|
|
158
158
|
content?: React.ReactNode;
|
|
@@ -201,13 +201,10 @@ export declare function withError(props: ModalReactProps): {
|
|
|
201
201
|
onMouseEnter?: React.MouseEventHandler<HTMLButtonElement>;
|
|
202
202
|
onMouseLeave?: React.MouseEventHandler<HTMLButtonElement>;
|
|
203
203
|
'aria-label'?: string;
|
|
204
|
-
title?: string;
|
|
205
|
-
name?: string;
|
|
206
204
|
value?: string | number | readonly string[];
|
|
207
|
-
onAnimationStart?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
208
|
-
onAnimationEnd?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
209
205
|
form?: string;
|
|
210
206
|
slot?: string;
|
|
207
|
+
title?: string;
|
|
211
208
|
prefix?: string;
|
|
212
209
|
dangerouslySetInnerHTML?: {
|
|
213
210
|
__html: string | TrustedHTML;
|
|
@@ -362,7 +359,9 @@ export declare function withError(props: ModalReactProps): {
|
|
|
362
359
|
onScrollCapture?: React.UIEventHandler<HTMLButtonElement>;
|
|
363
360
|
onWheel?: React.WheelEventHandler<HTMLButtonElement>;
|
|
364
361
|
onWheelCapture?: React.WheelEventHandler<HTMLButtonElement>;
|
|
362
|
+
onAnimationStart?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
365
363
|
onAnimationStartCapture?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
364
|
+
onAnimationEnd?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
366
365
|
onAnimationEndCapture?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
367
366
|
onAnimationIteration?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
368
367
|
onAnimationIterationCapture?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
@@ -376,6 +375,7 @@ export declare function withError(props: ModalReactProps): {
|
|
|
376
375
|
suppressHydrationWarning?: boolean;
|
|
377
376
|
accessKey?: string;
|
|
378
377
|
autoFocus?: boolean;
|
|
378
|
+
name?: string;
|
|
379
379
|
content?: string;
|
|
380
380
|
formAction?: string;
|
|
381
381
|
formEncType?: string;
|
|
@@ -389,7 +389,7 @@ export declare function withError(props: ModalReactProps): {
|
|
|
389
389
|
translate?: "no" | "yes";
|
|
390
390
|
role?: React.AriaRole;
|
|
391
391
|
contentEditable?: "inherit" | (boolean | "true" | "false");
|
|
392
|
-
inputMode?: "search" | "
|
|
392
|
+
inputMode?: "search" | "text" | "none" | "email" | "tel" | "url" | "numeric" | "decimal";
|
|
393
393
|
nonce?: string;
|
|
394
394
|
tabIndex?: number;
|
|
395
395
|
'aria-expanded'?: boolean | "true" | "false";
|
|
@@ -422,7 +422,7 @@ export declare function withError(props: ModalReactProps): {
|
|
|
422
422
|
is?: string;
|
|
423
423
|
'aria-activedescendant'?: string;
|
|
424
424
|
'aria-atomic'?: boolean | "true" | "false";
|
|
425
|
-
'aria-autocomplete'?: "
|
|
425
|
+
'aria-autocomplete'?: "none" | "list" | "both" | "inline";
|
|
426
426
|
'aria-busy'?: boolean | "true" | "false";
|
|
427
427
|
'aria-checked'?: boolean | "true" | "false" | "mixed";
|
|
428
428
|
'aria-colcount'?: number;
|
|
@@ -132,7 +132,6 @@ export default class Base extends Component<BaseTypographyProps, BaseTypographyS
|
|
|
132
132
|
shouldTruncated: (rows: number) => boolean;
|
|
133
133
|
showTooltip: () => boolean | ShowTooltip | {
|
|
134
134
|
type: string;
|
|
135
|
-
opts: {};
|
|
136
135
|
};
|
|
137
136
|
getEllipsisState(): boolean;
|
|
138
137
|
/**
|
|
@@ -191,7 +190,7 @@ export default class Base extends Component<BaseTypographyProps, BaseTypographyS
|
|
|
191
190
|
renderCopy(): JSX.Element;
|
|
192
191
|
renderIcon(): JSX.Element;
|
|
193
192
|
renderContent(): JSX.Element;
|
|
194
|
-
renderTipWrapper(): JSX.Element;
|
|
193
|
+
renderTipWrapper(): string | number | boolean | React.ReactFragment | JSX.Element;
|
|
195
194
|
render(): JSX.Element;
|
|
196
195
|
}
|
|
197
196
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _isFunction from "lodash/isFunction";
|
|
1
2
|
import _isNull from "lodash/isNull";
|
|
2
3
|
import _isString from "lodash/isString";
|
|
3
4
|
import _merge from "lodash/merge";
|
|
@@ -93,6 +94,7 @@ export default class Base extends Component {
|
|
|
93
94
|
return updateOverflow;
|
|
94
95
|
};
|
|
95
96
|
this.showTooltip = () => {
|
|
97
|
+
var _a, _b;
|
|
96
98
|
const {
|
|
97
99
|
isOverflowed,
|
|
98
100
|
isTruncated,
|
|
@@ -110,8 +112,7 @@ export default class Base extends Component {
|
|
|
110
112
|
return show;
|
|
111
113
|
}
|
|
112
114
|
const defaultOpts = {
|
|
113
|
-
type: 'tooltip'
|
|
114
|
-
opts: {}
|
|
115
|
+
type: 'tooltip'
|
|
115
116
|
};
|
|
116
117
|
if (typeof showTooltip === 'object') {
|
|
117
118
|
if (showTooltip.type && showTooltip.type.toLowerCase() === 'popover') {
|
|
@@ -120,7 +121,14 @@ export default class Base extends Component {
|
|
|
120
121
|
// style: { width: '240px' },
|
|
121
122
|
showArrow: true
|
|
122
123
|
}
|
|
123
|
-
}, showTooltip
|
|
124
|
+
}, showTooltip, {
|
|
125
|
+
opts: {
|
|
126
|
+
className: cls({
|
|
127
|
+
[`${prefixCls}-ellipsis-popover`]: true,
|
|
128
|
+
[(_a = showTooltip === null || showTooltip === void 0 ? void 0 : showTooltip.opts) === null || _a === void 0 ? void 0 : _a.className]: Boolean((_b = showTooltip === null || showTooltip === void 0 ? void 0 : showTooltip.opts) === null || _b === void 0 ? void 0 : _b.className)
|
|
129
|
+
})
|
|
130
|
+
}
|
|
131
|
+
});
|
|
124
132
|
}
|
|
125
133
|
return Object.assign(Object.assign({}, defaultOpts), showTooltip);
|
|
126
134
|
}
|
|
@@ -522,9 +530,12 @@ export default class Base extends Component {
|
|
|
522
530
|
if (showTooltip) {
|
|
523
531
|
const {
|
|
524
532
|
type,
|
|
525
|
-
opts
|
|
533
|
+
opts,
|
|
534
|
+
renderTooltip
|
|
526
535
|
} = showTooltip;
|
|
527
|
-
if (
|
|
536
|
+
if (_isFunction(renderTooltip)) {
|
|
537
|
+
return renderTooltip(children, content);
|
|
538
|
+
} else if (type.toLowerCase() === 'popover') {
|
|
528
539
|
return /*#__PURE__*/React.createElement(Popover, Object.assign({
|
|
529
540
|
content: children,
|
|
530
541
|
position: "top"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
import { PopoverProps } from '../popover';
|
|
3
3
|
import { TooltipProps } from '../tooltip';
|
|
4
4
|
import { ArrayElement } from '../_base/base';
|
|
@@ -7,6 +7,7 @@ export type EllipsisPos = 'end' | 'middle';
|
|
|
7
7
|
export type ShowTooltip = {
|
|
8
8
|
type?: string;
|
|
9
9
|
opts?: Partial<PopoverProps> & Partial<TooltipProps>;
|
|
10
|
+
renderTooltip?: (content: TooltipProps['content'], children: ReactNode) => ReactNode;
|
|
10
11
|
};
|
|
11
12
|
export type Ellipsis = {
|
|
12
13
|
collapseText?: string;
|
|
@@ -60,7 +60,7 @@ export default class Title extends PureComponent<TitleProps> {
|
|
|
60
60
|
underline: PropTypes.Requireable<boolean>;
|
|
61
61
|
strong: PropTypes.Requireable<boolean>;
|
|
62
62
|
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
63
|
-
heading: PropTypes.Requireable<
|
|
63
|
+
heading: PropTypes.Requireable<4 | 2 | 5 | 1 | 3 | 6>;
|
|
64
64
|
style: PropTypes.Requireable<object>;
|
|
65
65
|
className: PropTypes.Requireable<string>;
|
|
66
66
|
component: PropTypes.Requireable<string>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-ui",
|
|
3
|
-
"version": "2.45.
|
|
3
|
+
"version": "2.45.3-alpha.0",
|
|
4
4
|
"description": "A modern, comprehensive, flexible design system and UI library. Connect DesignOps & DevOps. Quickly build beautiful React apps. Maintained by Douyin-fe team.",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es/index.js",
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
"@dnd-kit/core": "^6.0.8",
|
|
21
21
|
"@dnd-kit/sortable": "^7.0.2",
|
|
22
22
|
"@dnd-kit/utilities": "^3.2.1",
|
|
23
|
-
"@douyinfe/semi-animation": "2.45.
|
|
24
|
-
"@douyinfe/semi-animation-react": "2.45.
|
|
25
|
-
"@douyinfe/semi-foundation": "2.45.
|
|
26
|
-
"@douyinfe/semi-icons": "2.45.
|
|
27
|
-
"@douyinfe/semi-illustrations": "2.45.
|
|
28
|
-
"@douyinfe/semi-theme-default": "2.45.
|
|
23
|
+
"@douyinfe/semi-animation": "2.45.3-alpha.0",
|
|
24
|
+
"@douyinfe/semi-animation-react": "2.45.3-alpha.0",
|
|
25
|
+
"@douyinfe/semi-foundation": "2.45.3-alpha.0",
|
|
26
|
+
"@douyinfe/semi-icons": "2.45.3-alpha.0",
|
|
27
|
+
"@douyinfe/semi-illustrations": "2.45.3-alpha.0",
|
|
28
|
+
"@douyinfe/semi-theme-default": "2.45.3-alpha.0",
|
|
29
29
|
"async-validator": "^3.5.0",
|
|
30
30
|
"classnames": "^2.2.6",
|
|
31
31
|
"copy-text-to-clipboard": "^2.1.1",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
],
|
|
76
76
|
"author": "",
|
|
77
77
|
"license": "MIT",
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "c3a4c39758b556f94546b5cb38bf2d842669880a",
|
|
79
79
|
"devDependencies": {
|
|
80
80
|
"@babel/plugin-proposal-decorators": "^7.15.8",
|
|
81
81
|
"@babel/plugin-transform-runtime": "^7.15.8",
|