@douyinfe/semi-ui 2.27.0-alpha.2 → 2.27.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 +19 -196
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +295 -330
- 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/button/Button.d.ts +1 -1
- package/lib/cjs/button/index.d.ts +1 -1
- package/lib/cjs/carousel/index.d.ts +1 -1
- package/lib/cjs/datePicker/dateInput.d.ts +1 -1
- package/lib/cjs/datePicker/datePicker.d.ts +1 -1
- package/lib/cjs/datePicker/monthsGrid.d.ts +1 -1
- package/lib/cjs/form/baseForm.d.ts +1 -1
- package/lib/cjs/form/field.d.ts +1 -1
- package/lib/cjs/select/index.js +14 -2
- package/lib/cjs/tabs/TabBar.d.ts +2 -1
- package/lib/cjs/tabs/TabBar.js +51 -23
- package/lib/cjs/tabs/index.d.ts +1 -2
- package/lib/cjs/tabs/index.js +0 -3
- package/lib/cjs/tooltip/index.js +1 -1
- package/lib/cjs/transfer/index.js +29 -29
- package/lib/cjs/typography/base.d.ts +1 -1
- package/lib/cjs/typography/numeral.d.ts +1 -1
- package/lib/cjs/typography/paragraph.d.ts +1 -1
- package/lib/cjs/typography/text.d.ts +1 -1
- package/lib/cjs/typography/title.d.ts +1 -1
- package/lib/es/button/Button.d.ts +1 -1
- package/lib/es/button/index.d.ts +1 -1
- package/lib/es/carousel/index.d.ts +1 -1
- package/lib/es/datePicker/dateInput.d.ts +1 -1
- package/lib/es/datePicker/datePicker.d.ts +1 -1
- package/lib/es/datePicker/monthsGrid.d.ts +1 -1
- package/lib/es/form/baseForm.d.ts +1 -1
- package/lib/es/form/field.d.ts +1 -1
- package/lib/es/select/index.js +14 -2
- package/lib/es/tabs/TabBar.d.ts +2 -1
- package/lib/es/tabs/TabBar.js +52 -23
- package/lib/es/tabs/index.d.ts +1 -2
- package/lib/es/tabs/index.js +0 -2
- package/lib/es/tooltip/index.js +1 -1
- package/lib/es/transfer/index.js +29 -29
- package/lib/es/typography/base.d.ts +1 -1
- package/lib/es/typography/numeral.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/package.json +8 -8
- package/lib/cjs/tabs/TabItem.d.ts +0 -18
- package/lib/cjs/tabs/TabItem.js +0 -95
- package/lib/es/tabs/TabItem.d.ts +0 -18
- package/lib/es/tabs/TabItem.js +0 -78
|
@@ -48,7 +48,7 @@ export default class Button extends PureComponent<ButtonProps> {
|
|
|
48
48
|
prefixCls: PropTypes.Requireable<string>;
|
|
49
49
|
style: PropTypes.Requireable<object>;
|
|
50
50
|
size: PropTypes.Requireable<"default" | "small" | "large">;
|
|
51
|
-
type: PropTypes.Requireable<"warning" | "primary" | "
|
|
51
|
+
type: PropTypes.Requireable<"warning" | "primary" | "tertiary" | "secondary" | "danger">;
|
|
52
52
|
block: PropTypes.Requireable<boolean>;
|
|
53
53
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
54
54
|
onMouseDown: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -23,7 +23,7 @@ declare class Button extends React.PureComponent<ButtonProps> {
|
|
|
23
23
|
onMouseLeave: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
24
24
|
disabled: import("prop-types").Requireable<boolean>;
|
|
25
25
|
size: import("prop-types").Requireable<"default" | "small" | "large">;
|
|
26
|
-
type: import("prop-types").Requireable<"warning" | "primary" | "
|
|
26
|
+
type: import("prop-types").Requireable<"warning" | "primary" | "tertiary" | "secondary" | "danger">;
|
|
27
27
|
block: import("prop-types").Requireable<boolean>;
|
|
28
28
|
onClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
29
29
|
onMouseDown: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
@@ -14,7 +14,7 @@ export interface CarouselState {
|
|
|
14
14
|
declare class Carousel extends BaseComponent<CarouselProps, CarouselState> {
|
|
15
15
|
static propTypes: {
|
|
16
16
|
activeIndex: PropTypes.Requireable<number>;
|
|
17
|
-
animation: PropTypes.Requireable<"
|
|
17
|
+
animation: PropTypes.Requireable<"slide" | "fade">;
|
|
18
18
|
arrowProps: PropTypes.Requireable<object>;
|
|
19
19
|
autoPlay: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
20
20
|
className: PropTypes.Requireable<string>;
|
|
@@ -26,7 +26,7 @@ export default class DateInput extends BaseComponent<DateInputProps, {}> {
|
|
|
26
26
|
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
27
27
|
value: PropTypes.Requireable<any[]>;
|
|
28
28
|
disabled: PropTypes.Requireable<boolean>;
|
|
29
|
-
type: PropTypes.Requireable<"
|
|
29
|
+
type: PropTypes.Requireable<"dateTime" | "date" | "month" | "dateRange" | "year" | "dateTimeRange">;
|
|
30
30
|
showClear: PropTypes.Requireable<boolean>;
|
|
31
31
|
format: PropTypes.Requireable<string>;
|
|
32
32
|
inputStyle: PropTypes.Requireable<object>;
|
|
@@ -46,7 +46,7 @@ export default class DatePicker extends BaseComponent<DatePickerProps, DatePicke
|
|
|
46
46
|
'aria-invalid': PropTypes.Requireable<boolean>;
|
|
47
47
|
'aria-labelledby': PropTypes.Requireable<string>;
|
|
48
48
|
'aria-required': PropTypes.Requireable<boolean>;
|
|
49
|
-
type: PropTypes.Requireable<"
|
|
49
|
+
type: PropTypes.Requireable<"dateTime" | "date" | "month" | "dateRange" | "year" | "dateTimeRange">;
|
|
50
50
|
size: PropTypes.Requireable<"default" | "small" | "large">;
|
|
51
51
|
clearIcon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
52
52
|
density: PropTypes.Requireable<"default" | "compact">;
|
|
@@ -19,7 +19,7 @@ export interface MonthsGridProps extends MonthsGridFoundationProps, BaseProps {
|
|
|
19
19
|
export declare type MonthsGridState = MonthsGridFoundationState;
|
|
20
20
|
export default class MonthsGrid extends BaseComponent<MonthsGridProps, MonthsGridState> {
|
|
21
21
|
static propTypes: {
|
|
22
|
-
type: PropTypes.Requireable<"
|
|
22
|
+
type: PropTypes.Requireable<"dateTime" | "date" | "month" | "dateRange" | "year" | "dateTimeRange">;
|
|
23
23
|
defaultValue: PropTypes.Requireable<NonNullable<string | number | object>>;
|
|
24
24
|
defaultPickerValue: PropTypes.Requireable<NonNullable<string | number | object>>;
|
|
25
25
|
multiple: PropTypes.Requireable<boolean>;
|
|
@@ -135,7 +135,7 @@ declare class Form<Values extends Record<string, any> = any> extends BaseCompone
|
|
|
135
135
|
preventScroll?: boolean;
|
|
136
136
|
showRestTagsPopover?: boolean;
|
|
137
137
|
restTagsPopoverProps?: import("../popover").PopoverProps;
|
|
138
|
-
} & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "
|
|
138
|
+
} & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "motion" | "getPopupContainer" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay"> & React.RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
|
|
139
139
|
static Checkbox: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox").CheckboxProps & import("./interface").RCIncludeType>;
|
|
140
140
|
static CheckboxGroup: React.ComponentType<import("utility-types").Subtract<import("../checkbox").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & React.RefAttributes<any>>;
|
|
141
141
|
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
|
@@ -83,7 +83,7 @@ declare const FormSelect: import("react").ComponentType<import("utility-types").
|
|
|
83
83
|
preventScroll?: boolean;
|
|
84
84
|
showRestTagsPopover?: boolean;
|
|
85
85
|
restTagsPopoverProps?: import("../popover").PopoverProps;
|
|
86
|
-
} & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "
|
|
86
|
+
} & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "motion" | "getPopupContainer" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay"> & import("react").RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
|
|
87
87
|
declare const FormCheckboxGroup: import("react").ComponentType<import("utility-types").Subtract<import("../checkbox/checkboxGroup").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & import("react").RefAttributes<any>>;
|
|
88
88
|
declare const FormCheckbox: import("react").ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox/checkbox").CheckboxProps & import("./interface").RCIncludeType>;
|
|
89
89
|
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/select/index.js
CHANGED
|
@@ -746,7 +746,10 @@ class Select extends _baseComponent.default {
|
|
|
746
746
|
style: style,
|
|
747
747
|
ref: this.setOptionContainerEl,
|
|
748
748
|
onKeyDown: e => this.foundation.handleContainerKeyDown(e)
|
|
749
|
-
}, outerTopSlot
|
|
749
|
+
}, outerTopSlot ? /*#__PURE__*/_react.default.createElement("div", {
|
|
750
|
+
className: "".concat(prefixcls, "-option-list-outer-top-slot"),
|
|
751
|
+
onMouseEnter: () => this.foundation.handleSlotMouseEnter()
|
|
752
|
+
}, outerTopSlot) : null, /*#__PURE__*/_react.default.createElement("div", {
|
|
750
753
|
style: {
|
|
751
754
|
maxHeight: "".concat(maxHeight, "px")
|
|
752
755
|
},
|
|
@@ -754,7 +757,16 @@ class Select extends _baseComponent.default {
|
|
|
754
757
|
role: "listbox",
|
|
755
758
|
"aria-multiselectable": multiple,
|
|
756
759
|
onScroll: e => this.foundation.handleListScroll(e)
|
|
757
|
-
}, innerTopSlot
|
|
760
|
+
}, innerTopSlot ? /*#__PURE__*/_react.default.createElement("div", {
|
|
761
|
+
className: "".concat(prefixcls, "-option-list-inner-top-slot"),
|
|
762
|
+
onMouseEnter: () => this.foundation.handleSlotMouseEnter()
|
|
763
|
+
}, innerTopSlot) : null, loading ? this.renderLoading() : isEmpty ? this.renderEmpty() : listContent, innerBottomSlot ? /*#__PURE__*/_react.default.createElement("div", {
|
|
764
|
+
className: "".concat(prefixcls, "-option-list-inner-bottom-slot"),
|
|
765
|
+
onMouseEnter: () => this.foundation.handleSlotMouseEnter()
|
|
766
|
+
}, innerBottomSlot) : null), outerBottomSlot ? /*#__PURE__*/_react.default.createElement("div", {
|
|
767
|
+
className: "".concat(prefixcls, "-option-list-outer-bottom-slot"),
|
|
768
|
+
onMouseEnter: () => this.foundation.handleSlotMouseEnter()
|
|
769
|
+
}, outerBottomSlot) : null)
|
|
758
770
|
);
|
|
759
771
|
}
|
|
760
772
|
|
package/lib/cjs/tabs/TabBar.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export interface TabBarState {
|
|
|
5
5
|
endInd: number;
|
|
6
6
|
rePosKey: number;
|
|
7
7
|
startInd: number;
|
|
8
|
+
uuid: string;
|
|
8
9
|
}
|
|
9
10
|
export interface OverflowItem extends PlainTab {
|
|
10
11
|
key: string;
|
|
@@ -25,8 +26,8 @@ declare class TabBar extends React.Component<TabBarProps, TabBarState> {
|
|
|
25
26
|
closable: PropTypes.Requireable<boolean>;
|
|
26
27
|
deleteTabItem: PropTypes.Requireable<(...args: any[]) => any>;
|
|
27
28
|
};
|
|
28
|
-
uuid: string;
|
|
29
29
|
constructor(props: TabBarProps);
|
|
30
|
+
componentDidMount(): void;
|
|
30
31
|
renderIcon(icon: ReactNode): ReactNode;
|
|
31
32
|
renderExtra(): ReactNode;
|
|
32
33
|
handleItemClick: (itemKey: string, e: MouseEvent<Element>) => void;
|
package/lib/cjs/tabs/TabBar.js
CHANGED
|
@@ -27,8 +27,6 @@ var _semiIcons = require("@douyinfe/semi-icons");
|
|
|
27
27
|
|
|
28
28
|
var _uuid = require("@douyinfe/semi-foundation/lib/cjs/utils/uuid");
|
|
29
29
|
|
|
30
|
-
var _TabItem = _interopRequireDefault(require("./TabItem"));
|
|
31
|
-
|
|
32
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
31
|
|
|
34
32
|
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
@@ -53,7 +51,7 @@ class TabBar extends _react.default.Component {
|
|
|
53
51
|
const key = this._getItemKey(itemKey); // eslint-disable-next-line max-len
|
|
54
52
|
|
|
55
53
|
|
|
56
|
-
const tabItem = document.querySelector("[data-uuid=\"".concat(this.uuid, "\"] .").concat(_constants.cssClasses.TABS_TAB, "[data-scrollkey=\"").concat(key, "\"]"));
|
|
54
|
+
const tabItem = document.querySelector("[data-uuid=\"".concat(this.state.uuid, "\"] .").concat(_constants.cssClasses.TABS_TAB, "[data-scrollkey=\"").concat(key, "\"]"));
|
|
57
55
|
tabItem.scrollIntoView({
|
|
58
56
|
behavior: 'smooth',
|
|
59
57
|
block: 'nearest',
|
|
@@ -70,23 +68,45 @@ class TabBar extends _react.default.Component {
|
|
|
70
68
|
const {
|
|
71
69
|
size,
|
|
72
70
|
type,
|
|
73
|
-
deleteTabItem
|
|
74
|
-
handleKeyDown,
|
|
75
|
-
tabPosition
|
|
71
|
+
deleteTabItem
|
|
76
72
|
} = this.props;
|
|
73
|
+
const panelIcon = panel.icon ? this.renderIcon(panel.icon) : null;
|
|
74
|
+
const closableIcon = type === 'card' && panel.closable ? /*#__PURE__*/_react.default.createElement(_semiIcons.IconClose, {
|
|
75
|
+
"aria-label": "Close",
|
|
76
|
+
role: "button",
|
|
77
|
+
className: "".concat(_constants.cssClasses.TABS_TAB, "-icon-close"),
|
|
78
|
+
onClick: e => deleteTabItem(panel.itemKey, e)
|
|
79
|
+
}) : null;
|
|
80
|
+
let events = {};
|
|
81
|
+
const key = panel.itemKey;
|
|
82
|
+
|
|
83
|
+
if (!panel.disabled) {
|
|
84
|
+
events = {
|
|
85
|
+
onClick: e => this.handleItemClick(key, e)
|
|
86
|
+
};
|
|
87
|
+
}
|
|
77
88
|
|
|
78
|
-
const isSelected = this._isActive(
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
89
|
+
const isSelected = this._isActive(key);
|
|
90
|
+
|
|
91
|
+
const className = (0, _classnames.default)(_constants.cssClasses.TABS_TAB, {
|
|
92
|
+
[_constants.cssClasses.TABS_TAB_ACTIVE]: isSelected,
|
|
93
|
+
[_constants.cssClasses.TABS_TAB_DISABLED]: panel.disabled,
|
|
94
|
+
["".concat(_constants.cssClasses.TABS_TAB, "-small")]: size === 'small',
|
|
95
|
+
["".concat(_constants.cssClasses.TABS_TAB, "-medium")]: size === 'medium'
|
|
96
|
+
});
|
|
97
|
+
return /*#__PURE__*/_react.default.createElement("div", Object.assign({
|
|
98
|
+
role: "tab",
|
|
99
|
+
id: "semiTab".concat(key),
|
|
100
|
+
"data-tabkey": "semiTab".concat(key),
|
|
101
|
+
"aria-controls": "semiTabPanel".concat(key),
|
|
102
|
+
"aria-disabled": panel.disabled ? 'true' : 'false',
|
|
103
|
+
"aria-selected": isSelected ? 'true' : 'false',
|
|
104
|
+
tabIndex: isSelected ? 0 : -1,
|
|
105
|
+
onKeyDown: e => this.handleKeyDown(e, key, panel.closable)
|
|
106
|
+
}, events, {
|
|
107
|
+
className: className,
|
|
108
|
+
key: this._getItemKey(key)
|
|
109
|
+
}), panelIcon, panel.tab, closableIcon);
|
|
90
110
|
};
|
|
91
111
|
|
|
92
112
|
this.renderTabComponents = list => list.map(panel => this.renderTabItem(panel));
|
|
@@ -101,7 +121,7 @@ class TabBar extends _react.default.Component {
|
|
|
101
121
|
const key = this._getItemKey(lastItem.itemKey); // eslint-disable-next-line max-len
|
|
102
122
|
|
|
103
123
|
|
|
104
|
-
const tabItem = document.querySelector("[data-uuid=\"".concat(this.uuid, "\"] .").concat(_constants.cssClasses.TABS_TAB, "[data-scrollkey=\"").concat(key, "\"]"));
|
|
124
|
+
const tabItem = document.querySelector("[data-uuid=\"".concat(this.state.uuid, "\"] .").concat(_constants.cssClasses.TABS_TAB, "[data-scrollkey=\"").concat(key, "\"]"));
|
|
105
125
|
tabItem.scrollIntoView({
|
|
106
126
|
behavior: 'smooth',
|
|
107
127
|
block: 'nearest',
|
|
@@ -157,7 +177,9 @@ class TabBar extends _react.default.Component {
|
|
|
157
177
|
render: disabled ? null : menu,
|
|
158
178
|
showTick: true,
|
|
159
179
|
style: dropdownStyle,
|
|
160
|
-
trigger: 'hover'
|
|
180
|
+
trigger: 'hover',
|
|
181
|
+
disableFocusListener // prevent the panel from popping up again after clicking
|
|
182
|
+
: true
|
|
161
183
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
162
184
|
role: "presentation",
|
|
163
185
|
className: arrowCls,
|
|
@@ -205,9 +227,15 @@ class TabBar extends _react.default.Component {
|
|
|
205
227
|
this.state = {
|
|
206
228
|
endInd: props.list.length,
|
|
207
229
|
rePosKey: 0,
|
|
208
|
-
startInd: 0
|
|
230
|
+
startInd: 0,
|
|
231
|
+
uuid: ''
|
|
209
232
|
};
|
|
210
|
-
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
componentDidMount() {
|
|
236
|
+
this.setState({
|
|
237
|
+
uuid: (0, _uuid.getUuidv4)()
|
|
238
|
+
});
|
|
211
239
|
}
|
|
212
240
|
|
|
213
241
|
renderIcon(icon) {
|
|
@@ -269,7 +297,7 @@ class TabBar extends _react.default.Component {
|
|
|
269
297
|
className: classNames,
|
|
270
298
|
style: style
|
|
271
299
|
}, (0, _getDataAttr.default)(restProps), {
|
|
272
|
-
"data-uuid": this.uuid
|
|
300
|
+
"data-uuid": this.state.uuid
|
|
273
301
|
}), contents, extra);
|
|
274
302
|
}
|
|
275
303
|
|
package/lib/cjs/tabs/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { MouseEvent, ReactElement, ReactNode, RefCallback, RefObject } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import TabsFoundation, { TabsAdapter } from '@douyinfe/semi-foundation/lib/cjs/tabs/foundation';
|
|
4
4
|
import BaseComponent from '../_base/baseComponent';
|
|
@@ -14,7 +14,6 @@ export interface TabsState {
|
|
|
14
14
|
}
|
|
15
15
|
declare class Tabs extends BaseComponent<TabsProps, TabsState> {
|
|
16
16
|
static TabPane: typeof TabPane;
|
|
17
|
-
static TabItem: React.ForwardRefExoticComponent<import("./TabItem").TabItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
18
17
|
static propTypes: {
|
|
19
18
|
activeKey: PropTypes.Requireable<string>;
|
|
20
19
|
className: PropTypes.Requireable<string>;
|
package/lib/cjs/tabs/index.js
CHANGED
|
@@ -32,8 +32,6 @@ var _TabBar = _interopRequireDefault(require("./TabBar"));
|
|
|
32
32
|
|
|
33
33
|
var _TabPane = _interopRequireDefault(require("./TabPane"));
|
|
34
34
|
|
|
35
|
-
var _TabItem = _interopRequireDefault(require("./TabItem"));
|
|
36
|
-
|
|
37
35
|
var _tabsContext = _interopRequireDefault(require("./tabs-context"));
|
|
38
36
|
|
|
39
37
|
var _interface = require("./interface");
|
|
@@ -381,7 +379,6 @@ class Tabs extends _baseComponent.default {
|
|
|
381
379
|
}
|
|
382
380
|
|
|
383
381
|
Tabs.TabPane = _TabPane.default;
|
|
384
|
-
Tabs.TabItem = _TabItem.default;
|
|
385
382
|
Tabs.propTypes = {
|
|
386
383
|
activeKey: _propTypes.default.string,
|
|
387
384
|
className: _propTypes.default.string,
|
package/lib/cjs/tooltip/index.js
CHANGED
|
@@ -481,7 +481,7 @@ class Tooltip extends _baseComponent.default {
|
|
|
481
481
|
el = _reactDom.default.findDOMNode(el);
|
|
482
482
|
popupEl = _reactDom.default.findDOMNode(popupEl);
|
|
483
483
|
|
|
484
|
-
if (el && !el.contains(e.target) && popupEl && !popupEl.contains(e.target) || this.props.clickTriggerToHide) {
|
|
484
|
+
if (el && !el.contains(e.target) && popupEl && !popupEl.contains(e.target) || this.props.clickTriggerToHide && el && el.contains(e.target)) {
|
|
485
485
|
this.props.onClickOutSide(e);
|
|
486
486
|
cb();
|
|
487
487
|
}
|
|
@@ -49,7 +49,7 @@ var _semiIcons = require("@douyinfe/semi-icons");
|
|
|
49
49
|
|
|
50
50
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
51
51
|
|
|
52
|
-
const
|
|
52
|
+
const prefixCls = _constants.cssClasses.PREFIX; // SortableItem & SortableList should not be assigned inside of the render function
|
|
53
53
|
|
|
54
54
|
const SortableItem = (0, _reactSortableHoc.SortableElement)(props => props.item.node);
|
|
55
55
|
const SortableList = (0, _reactSortableHoc.SortableContainer)(_ref => {
|
|
@@ -57,7 +57,7 @@ const SortableList = (0, _reactSortableHoc.SortableContainer)(_ref => {
|
|
|
57
57
|
items
|
|
58
58
|
} = _ref;
|
|
59
59
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
60
|
-
className: "".concat(
|
|
60
|
+
className: "".concat(prefixCls, "-right-list"),
|
|
61
61
|
role: "list",
|
|
62
62
|
"aria-label": "Selected list"
|
|
63
63
|
}, items.map((item, index) =>
|
|
@@ -209,7 +209,7 @@ class Transfer extends _baseComponent.default {
|
|
|
209
209
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
210
210
|
role: "search",
|
|
211
211
|
"aria-label": "Transfer filter",
|
|
212
|
-
className: "".concat(
|
|
212
|
+
className: "".concat(prefixCls, "-filter")
|
|
213
213
|
}, /*#__PURE__*/_react.default.createElement(_index2.default, Object.assign({
|
|
214
214
|
prefix: /*#__PURE__*/_react.default.createElement(_semiIcons.IconSearch, null),
|
|
215
215
|
placeholder: locale.placeholder,
|
|
@@ -232,20 +232,20 @@ class Transfer extends _baseComponent.default {
|
|
|
232
232
|
showButton
|
|
233
233
|
} = headerConfig;
|
|
234
234
|
const headerCls = (0, _classnames.default)({
|
|
235
|
-
["".concat(
|
|
236
|
-
["".concat(
|
|
237
|
-
["".concat(
|
|
235
|
+
["".concat(prefixCls, "-header")]: true,
|
|
236
|
+
["".concat(prefixCls, "-right-header")]: type === 'right',
|
|
237
|
+
["".concat(prefixCls, "-left-header")]: type === 'left'
|
|
238
238
|
});
|
|
239
239
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
240
240
|
className: headerCls
|
|
241
241
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
242
|
-
className: "".concat(
|
|
242
|
+
className: "".concat(prefixCls, "-header-total")
|
|
243
243
|
}, totalContent), showButton ? /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
244
244
|
theme: "borderless",
|
|
245
245
|
disabled: disabled,
|
|
246
246
|
type: "tertiary",
|
|
247
247
|
size: "small",
|
|
248
|
-
className: "".concat(
|
|
248
|
+
className: "".concat(prefixCls, "-header-all"),
|
|
249
249
|
onClick: onAllClick
|
|
250
250
|
}, allContent) : null);
|
|
251
251
|
}
|
|
@@ -268,8 +268,8 @@ class Transfer extends _baseComponent.default {
|
|
|
268
268
|
}
|
|
269
269
|
|
|
270
270
|
const leftItemCls = (0, _classnames.default)({
|
|
271
|
-
["".concat(
|
|
272
|
-
["".concat(
|
|
271
|
+
["".concat(prefixCls, "-item")]: true,
|
|
272
|
+
["".concat(prefixCls, "-item-disabled")]: item.disabled
|
|
273
273
|
});
|
|
274
274
|
return /*#__PURE__*/_react.default.createElement(_index.Checkbox, {
|
|
275
275
|
key: index,
|
|
@@ -376,12 +376,12 @@ class Transfer extends _baseComponent.default {
|
|
|
376
376
|
}
|
|
377
377
|
|
|
378
378
|
return /*#__PURE__*/_react.default.createElement("section", {
|
|
379
|
-
className: "".concat(
|
|
379
|
+
className: "".concat(prefixCls, "-left")
|
|
380
380
|
}, inputCom, content);
|
|
381
381
|
}
|
|
382
382
|
|
|
383
383
|
renderGroupTitle(group, index) {
|
|
384
|
-
const groupCls = (0, _classnames.default)("".concat(
|
|
384
|
+
const groupCls = (0, _classnames.default)("".concat(prefixCls, "-group-title"));
|
|
385
385
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
386
386
|
className: groupCls,
|
|
387
387
|
key: "title-".concat(index)
|
|
@@ -448,7 +448,7 @@ class Transfer extends _baseComponent.default {
|
|
|
448
448
|
}
|
|
449
449
|
});
|
|
450
450
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
451
|
-
className: "".concat(
|
|
451
|
+
className: "".concat(prefixCls, "-left-list"),
|
|
452
452
|
role: "list",
|
|
453
453
|
"aria-label": "Option list"
|
|
454
454
|
}, content);
|
|
@@ -465,9 +465,9 @@ class Transfer extends _baseComponent.default {
|
|
|
465
465
|
const onRemove = () => this.foundation.handleSelectOrRemove(item);
|
|
466
466
|
|
|
467
467
|
const rightItemCls = (0, _classnames.default)({
|
|
468
|
-
["".concat(
|
|
469
|
-
["".concat(
|
|
470
|
-
["".concat(
|
|
468
|
+
["".concat(prefixCls, "-item")]: true,
|
|
469
|
+
["".concat(prefixCls, "-right-item")]: true,
|
|
470
|
+
["".concat(prefixCls, "-right-item-draggable")]: draggable
|
|
471
471
|
});
|
|
472
472
|
const shouldShowPath = type === _constants.strings.TYPE_TREE_TO_LIST && showPath === true;
|
|
473
473
|
const label = shouldShowPath ? this.foundation._generatePath(item) : item.label;
|
|
@@ -482,7 +482,7 @@ class Transfer extends _baseComponent.default {
|
|
|
482
482
|
const DragHandle = (0, _reactSortableHoc.SortableHandle)(() => /*#__PURE__*/_react.default.createElement(_semiIcons.IconHandle, {
|
|
483
483
|
role: "button",
|
|
484
484
|
"aria-label": "Drag and sort",
|
|
485
|
-
className: "".concat(
|
|
485
|
+
className: "".concat(prefixCls, "-right-item-drag-handler")
|
|
486
486
|
}));
|
|
487
487
|
return (
|
|
488
488
|
/*#__PURE__*/
|
|
@@ -492,12 +492,12 @@ class Transfer extends _baseComponent.default {
|
|
|
492
492
|
className: rightItemCls,
|
|
493
493
|
key: item.key
|
|
494
494
|
}, draggable ? /*#__PURE__*/_react.default.createElement(DragHandle, null) : null, /*#__PURE__*/_react.default.createElement("div", {
|
|
495
|
-
className: "".concat(
|
|
495
|
+
className: "".concat(prefixCls, "-right-item-text")
|
|
496
496
|
}, label), /*#__PURE__*/_react.default.createElement(_semiIcons.IconClose, {
|
|
497
497
|
onClick: onRemove,
|
|
498
498
|
"aria-disabled": item.disabled,
|
|
499
|
-
className: (0, _classnames.default)("".concat(
|
|
500
|
-
["".concat(
|
|
499
|
+
className: (0, _classnames.default)("".concat(prefixCls, "-item-close-icon"), {
|
|
500
|
+
["".concat(prefixCls, "-item-close-icon-disabled")]: item.disabled
|
|
501
501
|
})
|
|
502
502
|
}))
|
|
503
503
|
);
|
|
@@ -505,9 +505,9 @@ class Transfer extends _baseComponent.default {
|
|
|
505
505
|
|
|
506
506
|
renderEmpty(type, emptyText) {
|
|
507
507
|
const emptyCls = (0, _classnames.default)({
|
|
508
|
-
["".concat(
|
|
509
|
-
["".concat(
|
|
510
|
-
["".concat(
|
|
508
|
+
["".concat(prefixCls, "-empty")]: true,
|
|
509
|
+
["".concat(prefixCls, "-right-empty")]: type === 'right',
|
|
510
|
+
["".concat(prefixCls, "-left-empty")]: type === 'left'
|
|
511
511
|
});
|
|
512
512
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
513
513
|
"aria-label": "empty",
|
|
@@ -523,7 +523,7 @@ class Transfer extends _baseComponent.default {
|
|
|
523
523
|
|
|
524
524
|
const sortList = /*#__PURE__*/_react.default.createElement(SortableList, {
|
|
525
525
|
useDragHandle: true,
|
|
526
|
-
helperClass: "".concat(
|
|
526
|
+
helperClass: "".concat(prefixCls, "-right-item-drag-item-move"),
|
|
527
527
|
onSortEnd: this.onSortEnd,
|
|
528
528
|
items: sortableListItems
|
|
529
529
|
});
|
|
@@ -565,7 +565,7 @@ class Transfer extends _baseComponent.default {
|
|
|
565
565
|
};
|
|
566
566
|
const headerCom = this.renderHeader(headerConfig);
|
|
567
567
|
const emptyCom = this.renderEmpty('right', emptyContent.right ? emptyContent.right : locale.emptyRight);
|
|
568
|
-
const panelCls = "".concat(
|
|
568
|
+
const panelCls = "".concat(prefixCls, "-right");
|
|
569
569
|
let content = null;
|
|
570
570
|
|
|
571
571
|
switch (true) {
|
|
@@ -576,7 +576,7 @@ class Transfer extends _baseComponent.default {
|
|
|
576
576
|
|
|
577
577
|
case selectedData.length && !draggable:
|
|
578
578
|
const list = /*#__PURE__*/_react.default.createElement("div", {
|
|
579
|
-
className: "".concat(
|
|
579
|
+
className: "".concat(prefixCls, "-right-list"),
|
|
580
580
|
role: "list",
|
|
581
581
|
"aria-label": "Selected list"
|
|
582
582
|
}, selectedData.map(item => this.renderRightItem(Object.assign({}, item))));
|
|
@@ -605,9 +605,9 @@ class Transfer extends _baseComponent.default {
|
|
|
605
605
|
renderSelectedPanel,
|
|
606
606
|
renderSourcePanel
|
|
607
607
|
} = this.props;
|
|
608
|
-
const transferCls = (0, _classnames.default)(
|
|
609
|
-
["".concat(
|
|
610
|
-
["".concat(
|
|
608
|
+
const transferCls = (0, _classnames.default)(prefixCls, className, {
|
|
609
|
+
["".concat(prefixCls, "-disabled")]: disabled,
|
|
610
|
+
["".concat(prefixCls, "-custom-panel")]: renderSelectedPanel && renderSourcePanel
|
|
611
611
|
});
|
|
612
612
|
return /*#__PURE__*/_react.default.createElement(_localeConsumer.default, {
|
|
613
613
|
componentName: "Transfer"
|
|
@@ -64,7 +64,7 @@ export default class Base extends Component<BaseTypographyProps, BaseTypographyS
|
|
|
64
64
|
spacing: PropTypes.Requireable<"normal" | "extended">;
|
|
65
65
|
strong: PropTypes.Requireable<boolean>;
|
|
66
66
|
size: PropTypes.Requireable<"small" | "normal">;
|
|
67
|
-
type: PropTypes.Requireable<"warning" | "success" | "primary" | "
|
|
67
|
+
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
68
68
|
style: PropTypes.Requireable<object>;
|
|
69
69
|
className: PropTypes.Requireable<string>;
|
|
70
70
|
icon: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
|
@@ -38,7 +38,7 @@ export default class Numeral extends PureComponent<NumeralProps> {
|
|
|
38
38
|
underline: PropTypes.Requireable<boolean>;
|
|
39
39
|
link: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
40
40
|
strong: PropTypes.Requireable<boolean>;
|
|
41
|
-
type: PropTypes.Requireable<"warning" | "success" | "primary" | "
|
|
41
|
+
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
42
42
|
size: PropTypes.Requireable<"small" | "normal">;
|
|
43
43
|
style: PropTypes.Requireable<object>;
|
|
44
44
|
className: PropTypes.Requireable<string>;
|
|
@@ -29,7 +29,7 @@ export default class Paragraph extends PureComponent<ParagraphProps> {
|
|
|
29
29
|
link: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
30
30
|
underline: PropTypes.Requireable<boolean>;
|
|
31
31
|
strong: PropTypes.Requireable<boolean>;
|
|
32
|
-
type: PropTypes.Requireable<"warning" | "success" | "primary" | "
|
|
32
|
+
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
33
33
|
size: PropTypes.Requireable<"small" | "normal">;
|
|
34
34
|
spacing: PropTypes.Requireable<"normal" | "extended">;
|
|
35
35
|
style: PropTypes.Requireable<object>;
|
|
@@ -32,7 +32,7 @@ export default class Text extends PureComponent<TextProps> {
|
|
|
32
32
|
underline: PropTypes.Requireable<boolean>;
|
|
33
33
|
link: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
34
34
|
strong: PropTypes.Requireable<boolean>;
|
|
35
|
-
type: PropTypes.Requireable<"warning" | "success" | "primary" | "
|
|
35
|
+
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
36
36
|
size: PropTypes.Requireable<"small" | "normal">;
|
|
37
37
|
style: PropTypes.Requireable<object>;
|
|
38
38
|
className: PropTypes.Requireable<string>;
|
|
@@ -36,7 +36,7 @@ export default class Title extends PureComponent<TitleProps> {
|
|
|
36
36
|
link: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
37
37
|
underline: PropTypes.Requireable<boolean>;
|
|
38
38
|
strong: PropTypes.Requireable<boolean>;
|
|
39
|
-
type: PropTypes.Requireable<"warning" | "success" | "primary" | "
|
|
39
|
+
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
40
40
|
heading: PropTypes.Requireable<1 | 2 | 3 | 4 | 6 | 5>;
|
|
41
41
|
style: PropTypes.Requireable<object>;
|
|
42
42
|
className: PropTypes.Requireable<string>;
|
|
@@ -48,7 +48,7 @@ export default class Button extends PureComponent<ButtonProps> {
|
|
|
48
48
|
prefixCls: PropTypes.Requireable<string>;
|
|
49
49
|
style: PropTypes.Requireable<object>;
|
|
50
50
|
size: PropTypes.Requireable<"default" | "small" | "large">;
|
|
51
|
-
type: PropTypes.Requireable<"warning" | "primary" | "
|
|
51
|
+
type: PropTypes.Requireable<"warning" | "primary" | "tertiary" | "secondary" | "danger">;
|
|
52
52
|
block: PropTypes.Requireable<boolean>;
|
|
53
53
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
54
54
|
onMouseDown: PropTypes.Requireable<(...args: any[]) => any>;
|
package/lib/es/button/index.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ declare class Button extends React.PureComponent<ButtonProps> {
|
|
|
23
23
|
onMouseLeave: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
24
24
|
disabled: import("prop-types").Requireable<boolean>;
|
|
25
25
|
size: import("prop-types").Requireable<"default" | "small" | "large">;
|
|
26
|
-
type: import("prop-types").Requireable<"warning" | "primary" | "
|
|
26
|
+
type: import("prop-types").Requireable<"warning" | "primary" | "tertiary" | "secondary" | "danger">;
|
|
27
27
|
block: import("prop-types").Requireable<boolean>;
|
|
28
28
|
onClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
29
29
|
onMouseDown: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
@@ -14,7 +14,7 @@ export interface CarouselState {
|
|
|
14
14
|
declare class Carousel extends BaseComponent<CarouselProps, CarouselState> {
|
|
15
15
|
static propTypes: {
|
|
16
16
|
activeIndex: PropTypes.Requireable<number>;
|
|
17
|
-
animation: PropTypes.Requireable<"
|
|
17
|
+
animation: PropTypes.Requireable<"slide" | "fade">;
|
|
18
18
|
arrowProps: PropTypes.Requireable<object>;
|
|
19
19
|
autoPlay: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
20
20
|
className: PropTypes.Requireable<string>;
|
|
@@ -26,7 +26,7 @@ export default class DateInput extends BaseComponent<DateInputProps, {}> {
|
|
|
26
26
|
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
27
27
|
value: PropTypes.Requireable<any[]>;
|
|
28
28
|
disabled: PropTypes.Requireable<boolean>;
|
|
29
|
-
type: PropTypes.Requireable<"
|
|
29
|
+
type: PropTypes.Requireable<"dateTime" | "date" | "month" | "dateRange" | "year" | "dateTimeRange">;
|
|
30
30
|
showClear: PropTypes.Requireable<boolean>;
|
|
31
31
|
format: PropTypes.Requireable<string>;
|
|
32
32
|
inputStyle: PropTypes.Requireable<object>;
|
|
@@ -46,7 +46,7 @@ export default class DatePicker extends BaseComponent<DatePickerProps, DatePicke
|
|
|
46
46
|
'aria-invalid': PropTypes.Requireable<boolean>;
|
|
47
47
|
'aria-labelledby': PropTypes.Requireable<string>;
|
|
48
48
|
'aria-required': PropTypes.Requireable<boolean>;
|
|
49
|
-
type: PropTypes.Requireable<"
|
|
49
|
+
type: PropTypes.Requireable<"dateTime" | "date" | "month" | "dateRange" | "year" | "dateTimeRange">;
|
|
50
50
|
size: PropTypes.Requireable<"default" | "small" | "large">;
|
|
51
51
|
clearIcon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
52
52
|
density: PropTypes.Requireable<"default" | "compact">;
|
|
@@ -19,7 +19,7 @@ export interface MonthsGridProps extends MonthsGridFoundationProps, BaseProps {
|
|
|
19
19
|
export declare type MonthsGridState = MonthsGridFoundationState;
|
|
20
20
|
export default class MonthsGrid extends BaseComponent<MonthsGridProps, MonthsGridState> {
|
|
21
21
|
static propTypes: {
|
|
22
|
-
type: PropTypes.Requireable<"
|
|
22
|
+
type: PropTypes.Requireable<"dateTime" | "date" | "month" | "dateRange" | "year" | "dateTimeRange">;
|
|
23
23
|
defaultValue: PropTypes.Requireable<NonNullable<string | number | object>>;
|
|
24
24
|
defaultPickerValue: PropTypes.Requireable<NonNullable<string | number | object>>;
|
|
25
25
|
multiple: PropTypes.Requireable<boolean>;
|
|
@@ -135,7 +135,7 @@ declare class Form<Values extends Record<string, any> = any> extends BaseCompone
|
|
|
135
135
|
preventScroll?: boolean;
|
|
136
136
|
showRestTagsPopover?: boolean;
|
|
137
137
|
restTagsPopoverProps?: import("../popover").PopoverProps;
|
|
138
|
-
} & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "
|
|
138
|
+
} & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "motion" | "getPopupContainer" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay"> & React.RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
|
|
139
139
|
static Checkbox: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox").CheckboxProps & import("./interface").RCIncludeType>;
|
|
140
140
|
static CheckboxGroup: React.ComponentType<import("utility-types").Subtract<import("../checkbox").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & React.RefAttributes<any>>;
|
|
141
141
|
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
|
@@ -83,7 +83,7 @@ declare const FormSelect: import("react").ComponentType<import("utility-types").
|
|
|
83
83
|
preventScroll?: boolean;
|
|
84
84
|
showRestTagsPopover?: boolean;
|
|
85
85
|
restTagsPopoverProps?: import("../popover").PopoverProps;
|
|
86
|
-
} & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "
|
|
86
|
+
} & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "motion" | "getPopupContainer" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay"> & import("react").RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
|
|
87
87
|
declare const FormCheckboxGroup: import("react").ComponentType<import("utility-types").Subtract<import("../checkbox/checkboxGroup").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & import("react").RefAttributes<any>>;
|
|
88
88
|
declare const FormCheckbox: import("react").ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox/checkbox").CheckboxProps & import("./interface").RCIncludeType>;
|
|
89
89
|
declare const FormRadioGroup: import("react").ComponentType<import("utility-types").Subtract<import("../radio/radioGroup").RadioGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & import("react").RefAttributes<any>>;
|