@autobest-ui/components 1.5.0 → 2.0.2
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/esm/accordion/Item.d.ts +1 -1
- package/esm/accordion/Item.js +5 -3
- package/esm/accordion/index.d.ts +1 -1
- package/esm/accordion/index.js +5 -3
- package/esm/affix/PortalAffix.js +7 -7
- package/esm/affix/index.js +19 -17
- package/esm/carousel/index.js +16 -14
- package/esm/checkbox/index.js +19 -17
- package/esm/collapse/index.js +13 -11
- package/esm/confirm/index.d.ts +1 -1
- package/esm/confirm/index.js +14 -14
- package/esm/date-picker/calendar/Day.d.ts +1 -1
- package/esm/date-picker/calendar/Day.js +11 -11
- package/esm/date-picker/calendar/MonthYear.js +8 -8
- package/esm/date-picker/calendar/grid/index.js +18 -18
- package/esm/date-picker/calendar/index.js +7 -5
- package/esm/date-picker/calendar/types.js +1 -0
- package/esm/date-picker/index.js +15 -13
- package/esm/drawer/Child.js +6 -6
- package/esm/drawer/index.js +11 -9
- package/esm/ellipsis/index.js +4 -4
- package/esm/guide/index.js +15 -13
- package/esm/input-number/index.d.ts +4 -4
- package/esm/input-number/index.js +27 -25
- package/esm/lazy-image/index.d.ts +3 -3
- package/esm/lazy-image/index.js +6 -4
- package/esm/link-list/index.js +24 -22
- package/esm/link-list/style/index.css +1 -1
- package/esm/loading/index.js +4 -4
- package/esm/loading-bar/index.d.ts +1 -0
- package/esm/loading-bar/index.js +3 -3
- package/esm/loading-container/index.js +6 -6
- package/esm/loading-icon/index.js +12 -12
- package/esm/mask/index.js +4 -4
- package/esm/message/index.js +14 -14
- package/esm/modal/Affix.d.ts +1 -0
- package/esm/modal/Affix.js +1 -1
- package/esm/modal/Title.js +9 -9
- package/esm/modal/getPopupLocation.js +1 -1
- package/esm/modal/index.d.ts +1 -1
- package/esm/modal/index.js +21 -19
- package/esm/modal/style/index.css +1 -1
- package/esm/move/index.d.ts +1 -1
- package/esm/move/index.js +14 -12
- package/esm/popover/index.js +9 -9
- package/esm/portal/index.js +5 -3
- package/esm/script/index.js +8 -6
- package/esm/select/index.d.ts +3 -3
- package/esm/select/index.js +34 -36
- package/esm/show-more/index.js +14 -12
- package/esm/skeleton/Item.js +3 -3
- package/esm/skeleton/index.js +11 -15
- package/esm/style.css +12 -12
- package/esm/table/body/BodyRow.js +9 -8
- package/esm/table/body/CheckIcon.js +7 -7
- package/esm/table/body/index.d.ts +1 -1
- package/esm/table/body/index.js +6 -6
- package/esm/table/header/CheckIcon.js +6 -6
- package/esm/table/header/HeaderCell.d.ts +1 -1
- package/esm/table/header/HeaderCell.js +10 -8
- package/esm/table/header/HeaderRow.d.ts +1 -0
- package/esm/table/header/HeaderRow.js +2 -2
- package/esm/table/index.d.ts +3 -7
- package/esm/table/index.js +20 -18
- package/esm/table/interface.js +1 -0
- package/esm/tabs/index.d.ts +1 -1
- package/esm/tabs/index.js +14 -12
- package/esm/tooltip/index.d.ts +1 -0
- package/esm/tooltip/index.js +1 -1
- package/esm/trigger/bottomAlign.js +2 -2
- package/esm/trigger/getPopupLocation.js +2 -1
- package/esm/trigger/index.d.ts +4 -4
- package/esm/trigger/index.js +24 -22
- package/esm/trigger/leftAlign.js +2 -2
- package/esm/trigger/rightAlign.js +2 -2
- package/esm/trigger/topAlign.js +2 -2
- package/esm/trigger/utils.js +2 -2
- package/lib/accordion/Item.d.ts +1 -1
- package/lib/accordion/Item.js +5 -3
- package/lib/accordion/index.d.ts +1 -1
- package/lib/accordion/index.js +5 -3
- package/lib/affix/PortalAffix.js +7 -7
- package/lib/affix/index.js +19 -17
- package/lib/carousel/index.js +16 -14
- package/lib/checkbox/index.js +19 -17
- package/lib/collapse/index.js +13 -11
- package/lib/confirm/index.d.ts +1 -1
- package/lib/confirm/index.js +14 -14
- package/lib/date-picker/calendar/Day.d.ts +1 -1
- package/lib/date-picker/calendar/Day.js +12 -12
- package/lib/date-picker/calendar/MonthYear.js +9 -9
- package/lib/date-picker/calendar/grid/index.js +18 -18
- package/lib/date-picker/calendar/index.js +8 -6
- package/lib/date-picker/calendar/types.js +5 -1
- package/lib/date-picker/index.js +15 -13
- package/lib/date-picker/utils.js +8 -8
- package/lib/drawer/Child.js +6 -6
- package/lib/drawer/index.js +11 -9
- package/lib/ellipsis/index.js +4 -4
- package/lib/guide/index.js +15 -13
- package/lib/index.js +54 -54
- package/lib/input-number/index.d.ts +4 -4
- package/lib/input-number/index.js +27 -25
- package/lib/lazy-image/index.d.ts +3 -3
- package/lib/lazy-image/index.js +6 -4
- package/lib/link-list/index.js +24 -22
- package/lib/link-list/style/index.css +1 -1
- package/lib/loading/index.js +4 -4
- package/lib/loading-bar/index.d.ts +1 -0
- package/lib/loading-bar/index.js +3 -3
- package/lib/loading-container/index.js +6 -6
- package/lib/loading-icon/index.js +12 -12
- package/lib/mask/index.js +4 -4
- package/lib/message/index.js +14 -14
- package/lib/modal/Affix.d.ts +1 -0
- package/lib/modal/Affix.js +1 -1
- package/lib/modal/Title.js +9 -9
- package/lib/modal/getPopupLocation.js +1 -1
- package/lib/modal/index.d.ts +1 -1
- package/lib/modal/index.js +22 -20
- package/lib/modal/style/index.css +1 -1
- package/lib/move/index.d.ts +1 -1
- package/lib/move/index.js +14 -12
- package/lib/popover/index.js +9 -9
- package/lib/portal/index.js +5 -3
- package/lib/script/index.js +8 -6
- package/lib/select/index.d.ts +3 -3
- package/lib/select/index.js +34 -36
- package/lib/show-more/index.js +14 -12
- package/lib/skeleton/Item.js +3 -3
- package/lib/skeleton/index.js +11 -15
- package/lib/style.css +12 -12
- package/lib/table/body/BodyRow.js +9 -8
- package/lib/table/body/CheckIcon.js +7 -7
- package/lib/table/body/index.d.ts +1 -1
- package/lib/table/body/index.js +6 -6
- package/lib/table/header/CheckIcon.js +6 -6
- package/lib/table/header/HeaderCell.d.ts +1 -1
- package/lib/table/header/HeaderCell.js +10 -8
- package/lib/table/header/HeaderRow.d.ts +1 -0
- package/lib/table/header/HeaderRow.js +2 -2
- package/lib/table/index.d.ts +3 -7
- package/lib/table/index.js +20 -18
- package/lib/table/interface.js +5 -1
- package/lib/tabs/index.d.ts +1 -1
- package/lib/tabs/index.js +14 -12
- package/lib/tooltip/index.d.ts +1 -0
- package/lib/tooltip/index.js +1 -1
- package/lib/trigger/align.js +24 -24
- package/lib/trigger/bottomAlign.js +3 -3
- package/lib/trigger/constants.js +1 -1
- package/lib/trigger/getPopupLocation.js +2 -1
- package/lib/trigger/index.d.ts +4 -4
- package/lib/trigger/index.js +25 -23
- package/lib/trigger/leftAlign.js +3 -3
- package/lib/trigger/ref.js +1 -1
- package/lib/trigger/rightAlign.js +3 -3
- package/lib/trigger/topAlign.js +3 -3
- package/lib/trigger/utils.js +4 -4
- package/package.json +3 -3
package/esm/table/body/index.js
CHANGED
|
@@ -18,7 +18,7 @@ function Body(_a) {
|
|
|
18
18
|
var expandedRowRenderer = expandable ? expandable.expandedRowRender : noop;
|
|
19
19
|
dataSource.forEach(function (row, rowIndex) {
|
|
20
20
|
var rowKey = getRowKey(row);
|
|
21
|
-
var CheckCell = rowSelection ? React.createElement(CheckIcon, {
|
|
21
|
+
var CheckCell = rowSelection ? /*#__PURE__*/React.createElement(CheckIcon, {
|
|
22
22
|
prefixCls: prefixCls,
|
|
23
23
|
rowSelection: rowSelection,
|
|
24
24
|
rowKey: rowKey,
|
|
@@ -26,7 +26,7 @@ function Body(_a) {
|
|
|
26
26
|
rowIndex: rowIndex,
|
|
27
27
|
selectedRowKeys: selectedRowKeys
|
|
28
28
|
}) : null;
|
|
29
|
-
rows.push(React.createElement(BodyRow, {
|
|
29
|
+
rows.push( /*#__PURE__*/React.createElement(BodyRow, {
|
|
30
30
|
key: rowKey,
|
|
31
31
|
prefixCls: prefixCls,
|
|
32
32
|
rowData: row,
|
|
@@ -37,15 +37,15 @@ function Body(_a) {
|
|
|
37
37
|
}));
|
|
38
38
|
|
|
39
39
|
if (expandable) {
|
|
40
|
-
var expandedRowKey = rowKey
|
|
40
|
+
var expandedRowKey = "".concat(rowKey, " expanded");
|
|
41
41
|
var expandedColumns = [{
|
|
42
42
|
title: null,
|
|
43
43
|
key: expandedRowKey,
|
|
44
44
|
onRender: expandedRowRenderer
|
|
45
45
|
}];
|
|
46
|
-
rows.push(React.createElement(BodyRow, {
|
|
46
|
+
rows.push( /*#__PURE__*/React.createElement(BodyRow, {
|
|
47
47
|
key: expandedRowKey,
|
|
48
|
-
className: prefixCls
|
|
48
|
+
className: "".concat(prefixCls, "-expand-row"),
|
|
49
49
|
prefixCls: prefixCls,
|
|
50
50
|
rowData: row,
|
|
51
51
|
index: rowIndex,
|
|
@@ -56,7 +56,7 @@ function Body(_a) {
|
|
|
56
56
|
}));
|
|
57
57
|
}
|
|
58
58
|
});
|
|
59
|
-
return React.createElement(React.Fragment, null, rows);
|
|
59
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, rows);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
export default Body;
|
|
@@ -11,7 +11,7 @@ function HeaderCheckIcon(_a) {
|
|
|
11
11
|
|
|
12
12
|
if (!rowSelection.selectAllVisible) {
|
|
13
13
|
// 有勾选功能,但是没有全选功能,需有占位元素
|
|
14
|
-
return React.createElement("th", null, " ");
|
|
14
|
+
return /*#__PURE__*/React.createElement("th", null, " ");
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
var checkIcon = rowSelection.checkIcon,
|
|
@@ -19,19 +19,19 @@ function HeaderCheckIcon(_a) {
|
|
|
19
19
|
onSelectAll = rowSelection.onSelectAll;
|
|
20
20
|
|
|
21
21
|
if (checkIcon) {
|
|
22
|
-
return React.createElement("th", null, checkIcon(selectAllChecked, null, -1));
|
|
22
|
+
return /*#__PURE__*/React.createElement("th", null, checkIcon(selectAllChecked, null, -1));
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
var onCheckBoxChange = function onCheckBoxChange() {
|
|
26
26
|
onSelectAll(!selectAllChecked);
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
-
return React.createElement("th", {
|
|
30
|
-
className: cls
|
|
31
|
-
}, React.createElement(Checkbox, {
|
|
29
|
+
return /*#__PURE__*/React.createElement("th", {
|
|
30
|
+
className: "".concat(cls, "-checkbox")
|
|
31
|
+
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
32
32
|
checked: selectAllChecked,
|
|
33
33
|
onChange: onCheckBoxChange
|
|
34
34
|
}));
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
export default React.memo(HeaderCheckIcon);
|
|
37
|
+
export default /*#__PURE__*/React.memo(HeaderCheckIcon);
|
|
@@ -13,6 +13,6 @@ export interface HeaderCellProps<T> extends TableColumnInfo<T> {
|
|
|
13
13
|
}
|
|
14
14
|
export default class HeaderCell<RowDataType> extends React.PureComponent<HeaderCellProps<RowDataType>> {
|
|
15
15
|
onClick: () => void;
|
|
16
|
-
renderArrow: () =>
|
|
16
|
+
renderArrow: () => React.ReactNode;
|
|
17
17
|
render(): JSX.Element;
|
|
18
18
|
}
|
|
@@ -6,7 +6,7 @@ var __extends = this && this.__extends || function () {
|
|
|
6
6
|
d.__proto__ = b;
|
|
7
7
|
} || function (d, b) {
|
|
8
8
|
for (var p in b) {
|
|
9
|
-
if (
|
|
9
|
+
if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
12
|
|
|
@@ -14,6 +14,8 @@ var __extends = this && this.__extends || function () {
|
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
return function (d, b) {
|
|
17
|
+
if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
18
|
+
|
|
17
19
|
_extendStatics(d, b);
|
|
18
20
|
|
|
19
21
|
function __() {
|
|
@@ -60,9 +62,9 @@ function (_super) {
|
|
|
60
62
|
return sortIcon(isSortedDescending);
|
|
61
63
|
}
|
|
62
64
|
|
|
63
|
-
return React.createElement("span", {
|
|
64
|
-
className: prefixCls
|
|
65
|
-
}, React.createElement("svg", {
|
|
65
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
66
|
+
className: "".concat(prefixCls, "-arrow")
|
|
67
|
+
}, /*#__PURE__*/React.createElement("svg", {
|
|
66
68
|
style: isSortedDescending ? {
|
|
67
69
|
transform: 'rotate(180deg)'
|
|
68
70
|
} : null,
|
|
@@ -72,7 +74,7 @@ function (_super) {
|
|
|
72
74
|
height: "1em",
|
|
73
75
|
fill: "currentColor",
|
|
74
76
|
xmlns: "http://www.w3.org/2000/svg"
|
|
75
|
-
}, React.createElement("path", {
|
|
77
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
76
78
|
d: "M525.339326 186.172452L801.789086 462.622212c12.496698 12.496698 32.758136 12.496698 45.254834 0 12.497405-12.497405 12.496698-32.758136 0-45.254834l-331.014362-331.014362c-12.496698-12.496698-32.757429-12.497405-45.254834 0l-341.795619 339.143969c-12.496698 12.496698-12.496698 32.758136 0 45.254834 12.496698 12.496698 32.758136 12.496698 45.254834 0l287.10586-284.454209L461.372325 925.726242c0 17.673427 14.32669 32.000117 32.000118 32.000117 17.67272-0.000707 31.99941-14.327398 32.000117-32.000117l-0.032527-739.553083z"
|
|
77
79
|
})));
|
|
78
80
|
};
|
|
@@ -89,11 +91,11 @@ function (_super) {
|
|
|
89
91
|
title = _b.title,
|
|
90
92
|
sortName = _b.sortName,
|
|
91
93
|
colSpan = _b.colSpan;
|
|
92
|
-
return React.createElement("th", {
|
|
94
|
+
return /*#__PURE__*/React.createElement("th", {
|
|
93
95
|
className: className,
|
|
94
96
|
colSpan: colSpan
|
|
95
|
-
}, React.createElement("div", {
|
|
96
|
-
className: classNames(prefixCls
|
|
97
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
98
|
+
className: classNames("".concat(prefixCls, "-title"), (_a = {}, _a["".concat(prefixCls, "-point")] = sortName, _a)),
|
|
97
99
|
onClick: this.onClick
|
|
98
100
|
}, title, this.renderArrow()));
|
|
99
101
|
};
|
|
@@ -57,11 +57,11 @@ function HeaderRow(_a) {
|
|
|
57
57
|
var rows = React.useMemo(function () {
|
|
58
58
|
return parseHeaderRows(columns);
|
|
59
59
|
}, [columns]);
|
|
60
|
-
return React.createElement("tr", null, React.createElement(HeaderCheckIcon, {
|
|
60
|
+
return /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement(HeaderCheckIcon, {
|
|
61
61
|
prefixCls: cls,
|
|
62
62
|
rowSelection: rowSelection
|
|
63
63
|
}), rows.map(function (item) {
|
|
64
|
-
return React.createElement(HeaderCell, __assign({
|
|
64
|
+
return /*#__PURE__*/React.createElement(HeaderCell, __assign({
|
|
65
65
|
key: item.key
|
|
66
66
|
}, item, {
|
|
67
67
|
prefixCls: cls,
|
package/esm/table/index.d.ts
CHANGED
|
@@ -42,10 +42,6 @@ export interface TableProps<T> extends Pick<HeaderRowProps<T>, 'sortName' | 'sor
|
|
|
42
42
|
* 表格行是否可勾选,详见RowSelection
|
|
43
43
|
*/
|
|
44
44
|
rowSelection?: TableRowSelectionInfo<T>;
|
|
45
|
-
/**
|
|
46
|
-
* 默认勾选项数组, 以primaryKey取值
|
|
47
|
-
*/
|
|
48
|
-
defaultSelectedRowKeys?: any[];
|
|
49
45
|
/**
|
|
50
46
|
* 勾选时触发的函数
|
|
51
47
|
*/
|
|
@@ -104,10 +100,10 @@ declare class Table<RowDataType> extends React.Component<TableProps<RowDataType>
|
|
|
104
100
|
onSelect: (visible: boolean, rowData: RowDataType) => void;
|
|
105
101
|
onSelectAll: (checked: any) => void;
|
|
106
102
|
getDisabled: (rowData: any) => boolean;
|
|
107
|
-
defaultSelectedRowKeys?:
|
|
108
|
-
onSelectedRowChange?: (selectedRowKeys:
|
|
103
|
+
defaultSelectedRowKeys?: React.ReactText[];
|
|
104
|
+
onSelectedRowChange?: (selectedRowKeys: React.ReactText[], selectedRows: RowDataType[]) => void;
|
|
109
105
|
selectAllVisible?: boolean;
|
|
110
|
-
checkIcon?: (checked: boolean, rowData: RowDataType, index: number) => React.ReactElement<any, string |
|
|
106
|
+
checkIcon?: (checked: boolean, rowData: RowDataType, index: number) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
111
107
|
selectAllChecked: boolean;
|
|
112
108
|
};
|
|
113
109
|
/**
|
package/esm/table/index.js
CHANGED
|
@@ -6,7 +6,7 @@ var __extends = this && this.__extends || function () {
|
|
|
6
6
|
d.__proto__ = b;
|
|
7
7
|
} || function (d, b) {
|
|
8
8
|
for (var p in b) {
|
|
9
|
-
if (
|
|
9
|
+
if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
12
|
|
|
@@ -14,6 +14,8 @@ var __extends = this && this.__extends || function () {
|
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
return function (d, b) {
|
|
17
|
+
if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
18
|
+
|
|
17
19
|
_extendStatics(d, b);
|
|
18
20
|
|
|
19
21
|
function __() {
|
|
@@ -56,8 +58,8 @@ function (_super) {
|
|
|
56
58
|
var _this = _super.call(this, props) || this;
|
|
57
59
|
|
|
58
60
|
_this.prefixCls = 'ab-table';
|
|
59
|
-
_this.headerRef = React.createRef();
|
|
60
|
-
_this.bodyRef = React.createRef();
|
|
61
|
+
_this.headerRef = /*#__PURE__*/React.createRef();
|
|
62
|
+
_this.bodyRef = /*#__PURE__*/React.createRef();
|
|
61
63
|
_this.defaultRowSelection = {
|
|
62
64
|
selectAllVisible: true,
|
|
63
65
|
selectAllChecked: false,
|
|
@@ -187,8 +189,8 @@ function (_super) {
|
|
|
187
189
|
return previousValue;
|
|
188
190
|
}
|
|
189
191
|
|
|
190
|
-
var data = dataSource.find(function (
|
|
191
|
-
return getRowKey(
|
|
192
|
+
var data = dataSource.find(function (item) {
|
|
193
|
+
return getRowKey(item) === currentValue;
|
|
192
194
|
});
|
|
193
195
|
|
|
194
196
|
if (data) {
|
|
@@ -263,13 +265,13 @@ function (_super) {
|
|
|
263
265
|
var _a = _this.props,
|
|
264
266
|
columns = _a.columns,
|
|
265
267
|
rowSelection = _a.rowSelection;
|
|
266
|
-
return React.createElement("colgroup", null, rowSelection ? React.createElement("col", {
|
|
268
|
+
return /*#__PURE__*/React.createElement("colgroup", null, rowSelection ? /*#__PURE__*/React.createElement("col", {
|
|
267
269
|
width: 32
|
|
268
270
|
}) : null, columns.map(function (item) {
|
|
269
271
|
var width = item.width;
|
|
270
272
|
|
|
271
273
|
if (width) {
|
|
272
|
-
return React.createElement("col", {
|
|
274
|
+
return /*#__PURE__*/React.createElement("col", {
|
|
273
275
|
key: item.key,
|
|
274
276
|
style: {
|
|
275
277
|
width: width,
|
|
@@ -278,7 +280,7 @@ function (_super) {
|
|
|
278
280
|
});
|
|
279
281
|
}
|
|
280
282
|
|
|
281
|
-
return React.createElement("col", {
|
|
283
|
+
return /*#__PURE__*/React.createElement("col", {
|
|
282
284
|
key: item.key
|
|
283
285
|
});
|
|
284
286
|
}));
|
|
@@ -293,7 +295,7 @@ function (_super) {
|
|
|
293
295
|
sortIcon = _a.sortIcon,
|
|
294
296
|
onSortChange = _a.onSortChange;
|
|
295
297
|
var rowSelection = _this.state.rowSelection;
|
|
296
|
-
return React.createElement("thead", null, React.createElement(HeaderRow, {
|
|
298
|
+
return /*#__PURE__*/React.createElement("thead", null, /*#__PURE__*/React.createElement(HeaderRow, {
|
|
297
299
|
prefixCls: cls,
|
|
298
300
|
columns: columns,
|
|
299
301
|
sortName: sortName,
|
|
@@ -314,7 +316,7 @@ function (_super) {
|
|
|
314
316
|
var _b = _this.state,
|
|
315
317
|
rowSelection = _b.rowSelection,
|
|
316
318
|
selectedRowKeys = _b.selectedRowKeys;
|
|
317
|
-
return React.createElement("tbody", null, React.createElement(Body, {
|
|
319
|
+
return /*#__PURE__*/React.createElement("tbody", null, /*#__PURE__*/React.createElement(Body, {
|
|
318
320
|
prefixCls: cls,
|
|
319
321
|
getRowKey: getRowKey,
|
|
320
322
|
columns: columns,
|
|
@@ -359,25 +361,25 @@ function (_super) {
|
|
|
359
361
|
loading = _a.loading;
|
|
360
362
|
|
|
361
363
|
if (fixedHeader) {
|
|
362
|
-
return React.createElement(LoadingContainer, {
|
|
364
|
+
return /*#__PURE__*/React.createElement(LoadingContainer, {
|
|
363
365
|
loading: loading,
|
|
364
366
|
className: classNames(className, cls)
|
|
365
|
-
}, React.createElement("div", {
|
|
366
|
-
className: cls
|
|
367
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
368
|
+
className: "".concat(cls, "-header"),
|
|
367
369
|
ref: this.headerRef
|
|
368
|
-
}, React.createElement("table", null, this.renderColgroup(), this.renderHeader())), React.createElement("div", {
|
|
369
|
-
className: cls
|
|
370
|
+
}, /*#__PURE__*/React.createElement("table", null, this.renderColgroup(), this.renderHeader())), /*#__PURE__*/React.createElement("div", {
|
|
371
|
+
className: "".concat(cls, "-body"),
|
|
370
372
|
style: {
|
|
371
373
|
maxHeight: maxHeight
|
|
372
374
|
},
|
|
373
375
|
ref: this.bodyRef
|
|
374
|
-
}, React.createElement("table", null, this.renderColgroup(), this.renderBody())));
|
|
376
|
+
}, /*#__PURE__*/React.createElement("table", null, this.renderColgroup(), this.renderBody())));
|
|
375
377
|
}
|
|
376
378
|
|
|
377
|
-
return React.createElement(LoadingContainer, {
|
|
379
|
+
return /*#__PURE__*/React.createElement(LoadingContainer, {
|
|
378
380
|
loading: loading,
|
|
379
381
|
className: classNames(className, cls)
|
|
380
|
-
}, React.createElement("table", null, this.renderColgroup(), this.renderHeader(), this.renderBody()));
|
|
382
|
+
}, /*#__PURE__*/React.createElement("table", null, this.renderColgroup(), this.renderHeader(), this.renderBody()));
|
|
381
383
|
};
|
|
382
384
|
|
|
383
385
|
Table.defaultProps = {
|
package/esm/table/interface.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/esm/tabs/index.d.ts
CHANGED
|
@@ -80,7 +80,7 @@ declare class Tabs extends React.Component<TabsProps, TabsStates> {
|
|
|
80
80
|
* 根据placement不同,设置bar的位置
|
|
81
81
|
*/
|
|
82
82
|
setBarStyles: () => void;
|
|
83
|
-
onChange: (ev: React.SyntheticEvent<HTMLDivElement
|
|
83
|
+
onChange: (ev: React.SyntheticEvent<HTMLDivElement>) => Promise<void>;
|
|
84
84
|
render(): JSX.Element;
|
|
85
85
|
}
|
|
86
86
|
export default Tabs;
|
package/esm/tabs/index.js
CHANGED
|
@@ -6,7 +6,7 @@ var __extends = this && this.__extends || function () {
|
|
|
6
6
|
d.__proto__ = b;
|
|
7
7
|
} || function (d, b) {
|
|
8
8
|
for (var p in b) {
|
|
9
|
-
if (
|
|
9
|
+
if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
12
|
|
|
@@ -14,6 +14,8 @@ var __extends = this && this.__extends || function () {
|
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
return function (d, b) {
|
|
17
|
+
if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
18
|
+
|
|
17
19
|
_extendStatics(d, b);
|
|
18
20
|
|
|
19
21
|
function __() {
|
|
@@ -181,7 +183,7 @@ function (_super) {
|
|
|
181
183
|
|
|
182
184
|
_this.prefixCls = 'ab-tabs';
|
|
183
185
|
_this.resizeHandler = null;
|
|
184
|
-
_this.ulRef = React.createRef();
|
|
186
|
+
_this.ulRef = /*#__PURE__*/React.createRef();
|
|
185
187
|
/**
|
|
186
188
|
* 处理value在使用data-value后,将number转成string问题
|
|
187
189
|
* @param value
|
|
@@ -231,13 +233,13 @@ function (_super) {
|
|
|
231
233
|
var barStyles = {};
|
|
232
234
|
|
|
233
235
|
if (placement === 'top' || placement === 'bottom') {
|
|
234
|
-
barStyles.width = offsetAndSize.width
|
|
236
|
+
barStyles.width = "".concat(offsetAndSize.width, "px");
|
|
235
237
|
barStyles.height = barSize;
|
|
236
|
-
barStyles.transform = "translate("
|
|
238
|
+
barStyles.transform = "translate(".concat(offsetAndSize.offsetLeft, "px, 0)");
|
|
237
239
|
} else if (placement === 'left' || placement === 'right') {
|
|
238
|
-
barStyles.height = offsetAndSize.height
|
|
240
|
+
barStyles.height = "".concat(offsetAndSize.height, "px");
|
|
239
241
|
barStyles.width = barSize;
|
|
240
|
-
barStyles.transform = "translate(0, "
|
|
242
|
+
barStyles.transform = "translate(0, ".concat(offsetAndSize.offsetTop, "px)");
|
|
241
243
|
}
|
|
242
244
|
|
|
243
245
|
_this.setState({
|
|
@@ -375,20 +377,20 @@ function (_super) {
|
|
|
375
377
|
var _b = this.state,
|
|
376
378
|
activeValue = _b.activeValue,
|
|
377
379
|
barStyles = _b.barStyles;
|
|
378
|
-
return React.createElement("div", {
|
|
379
|
-
className: classNames(cls, className, cls
|
|
380
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
381
|
+
className: classNames(cls, className, "".concat(cls, "-").concat(placement)),
|
|
380
382
|
ref: this.ulRef
|
|
381
383
|
}, options.map(function (item) {
|
|
382
384
|
var _a;
|
|
383
385
|
|
|
384
|
-
return React.createElement("div", {
|
|
386
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
385
387
|
key: item.value,
|
|
386
|
-
className: classNames(cls
|
|
388
|
+
className: classNames("".concat(cls, "-item"), item.className, (_a = {}, _a["".concat(cls, "-active")] = activeValue === item.value, _a["".concat(cls, "-disabled")] = item.disabled, _a)),
|
|
387
389
|
"data-value": item.value,
|
|
388
390
|
onClick: _this.onChange
|
|
389
391
|
}, item.name);
|
|
390
|
-
}), React.createElement("div", {
|
|
391
|
-
className: cls
|
|
392
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
393
|
+
className: "".concat(cls, "-bar"),
|
|
392
394
|
style: barStyles
|
|
393
395
|
}));
|
|
394
396
|
};
|
package/esm/tooltip/index.d.ts
CHANGED
package/esm/tooltip/index.js
CHANGED
|
@@ -18,7 +18,7 @@ import React from 'react';
|
|
|
18
18
|
import Popover from '../popover';
|
|
19
19
|
var cls = 'ab-tooltip';
|
|
20
20
|
export default function Tooltip(props) {
|
|
21
|
-
return React.createElement(Popover, __assign({}, props, {
|
|
21
|
+
return /*#__PURE__*/React.createElement(Popover, __assign({}, props, {
|
|
22
22
|
prefixCls: cls
|
|
23
23
|
}), props.children);
|
|
24
24
|
}
|
|
@@ -30,11 +30,11 @@ function getBottomCommon(_a) {
|
|
|
30
30
|
height: popInfo.height,
|
|
31
31
|
top: top + rootInfo.height + rootToPopupSpacing,
|
|
32
32
|
arrowStyle: hiddenArrow ? {} : {
|
|
33
|
-
left: arrowLeft
|
|
33
|
+
left: "".concat(arrowLeft, "px"),
|
|
34
34
|
top: '-4px',
|
|
35
35
|
transform: 'translateX(-50%) rotate(-135deg)'
|
|
36
36
|
},
|
|
37
|
-
transformOrigin: isTransformHorizontalDirection ? 'center top' : arrowLeft
|
|
37
|
+
transformOrigin: isTransformHorizontalDirection ? 'center top' : "".concat(arrowLeft, "px top")
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
|
|
@@ -99,9 +99,10 @@ export default function getPopupLocation(placement, rootEl, popupEl, initTransla
|
|
|
99
99
|
}),
|
|
100
100
|
methodStr = _a.methodStr,
|
|
101
101
|
isVertical = _a.isVertical; // 拼装方法名
|
|
102
|
+
// eslint-disable-next-line import/namespace
|
|
102
103
|
|
|
103
104
|
|
|
104
|
-
var currentMethod = alignUtil["get"
|
|
105
|
+
var currentMethod = alignUtil["get".concat(methodStr, "LocationInfo")]; // 执行方法
|
|
105
106
|
|
|
106
107
|
var result = currentMethod(params);
|
|
107
108
|
|
package/esm/trigger/index.d.ts
CHANGED
|
@@ -139,7 +139,7 @@ declare class Trigger extends React.Component<TriggerProps, TriggerStates> {
|
|
|
139
139
|
componentWillUnmount(): void;
|
|
140
140
|
clearPopupTimer: (popupEl?: HTMLElement) => void;
|
|
141
141
|
forceAlign: (popupEl?: HTMLElement) => void;
|
|
142
|
-
getRootDomNode: () => HTMLElement;
|
|
142
|
+
getRootDomNode: () => HTMLElement | null;
|
|
143
143
|
getPopupDomNode(): HTMLDivElement;
|
|
144
144
|
getMaskDomNode(): HTMLDivElement;
|
|
145
145
|
clearOutsideHandler(ignoreDelayTimer?: boolean): void;
|
|
@@ -158,7 +158,7 @@ declare class Trigger extends React.Component<TriggerProps, TriggerStates> {
|
|
|
158
158
|
*/
|
|
159
159
|
triggerPopup: (nextVisible: boolean) => void;
|
|
160
160
|
onPopupMouseDown: () => void;
|
|
161
|
-
onClick: (event: React.
|
|
161
|
+
onClick: (event: React.TouchEvent | React.MouseEvent) => void;
|
|
162
162
|
onMouseEnter: () => void;
|
|
163
163
|
onMouseLeave: () => void;
|
|
164
164
|
onPopupMouseEnter: () => void;
|
|
@@ -166,13 +166,13 @@ declare class Trigger extends React.Component<TriggerProps, TriggerStates> {
|
|
|
166
166
|
onExited: () => void;
|
|
167
167
|
isCurrentTrigger: (eventName: string, trigger: string) => boolean;
|
|
168
168
|
isOutsideControl: () => boolean;
|
|
169
|
-
onPreventThrough: (event: React.TouchEvent
|
|
169
|
+
onPreventThrough: (event: React.TouchEvent) => void;
|
|
170
170
|
renderMask(): JSX.Element;
|
|
171
171
|
renderPopupContent(): JSX.Element;
|
|
172
172
|
/**
|
|
173
173
|
* 扩充children属性,根据trigger绑定不同事件
|
|
174
174
|
*/
|
|
175
|
-
renderChildComponent(): React.ReactElement<any, string |
|
|
175
|
+
renderChildComponent(): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
176
176
|
renderPopupComponent(): JSX.Element;
|
|
177
177
|
render(): JSX.Element;
|
|
178
178
|
}
|
package/esm/trigger/index.js
CHANGED
|
@@ -6,7 +6,7 @@ var __extends = this && this.__extends || function () {
|
|
|
6
6
|
d.__proto__ = b;
|
|
7
7
|
} || function (d, b) {
|
|
8
8
|
for (var p in b) {
|
|
9
|
-
if (
|
|
9
|
+
if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
12
|
|
|
@@ -14,6 +14,8 @@ var __extends = this && this.__extends || function () {
|
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
return function (d, b) {
|
|
17
|
+
if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
18
|
+
|
|
17
19
|
_extendStatics(d, b);
|
|
18
20
|
|
|
19
21
|
function __() {
|
|
@@ -45,8 +47,8 @@ import { findDOMNode } from 'react-dom';
|
|
|
45
47
|
import classNames from 'classnames';
|
|
46
48
|
import { getElementSize, getStyleValue, isTouchScreen, isEmptyObject, throttleWithRAF, contains, addEventListener } from '@autobest-ui/utils';
|
|
47
49
|
import { CSSTransition } from 'react-transition-group';
|
|
48
|
-
import { supportRef, composeRef } from './ref';
|
|
49
50
|
import Portal from '../portal';
|
|
51
|
+
import { supportRef, composeRef } from './ref';
|
|
50
52
|
import getPopupLocation from './getPopupLocation';
|
|
51
53
|
|
|
52
54
|
function noop() {}
|
|
@@ -60,9 +62,9 @@ function (_super) {
|
|
|
60
62
|
var _this = _super.call(this, props) || this;
|
|
61
63
|
|
|
62
64
|
_this.prefixCls = 'ab-trigger';
|
|
63
|
-
_this.popupRef = React.createRef();
|
|
64
|
-
_this.maskRef = React.createRef();
|
|
65
|
-
_this.triggerRef = React.createRef();
|
|
65
|
+
_this.popupRef = /*#__PURE__*/React.createRef();
|
|
66
|
+
_this.maskRef = /*#__PURE__*/React.createRef();
|
|
67
|
+
_this.triggerRef = /*#__PURE__*/React.createRef();
|
|
66
68
|
|
|
67
69
|
_this.isClickToHide = function () {
|
|
68
70
|
return _this.props.trigger.indexOf('click') !== -1;
|
|
@@ -104,7 +106,7 @@ function (_super) {
|
|
|
104
106
|
isInsertNode = _a.isInsertNode;
|
|
105
107
|
|
|
106
108
|
if (maxHeight) {
|
|
107
|
-
popupEl.style.maxHeight = maxHeight
|
|
109
|
+
popupEl.style.maxHeight = "".concat(maxHeight, "px");
|
|
108
110
|
popupEl.style.overflowY = 'auto';
|
|
109
111
|
}
|
|
110
112
|
|
|
@@ -112,11 +114,11 @@ function (_super) {
|
|
|
112
114
|
var rootWidth = getElementSize(rootEl).width;
|
|
113
115
|
|
|
114
116
|
if (isMinRootWidth) {
|
|
115
|
-
popupEl.style.minWidth = rootWidth
|
|
117
|
+
popupEl.style.minWidth = "".concat(rootWidth, "px");
|
|
116
118
|
}
|
|
117
119
|
|
|
118
120
|
if (isMaxRootWidth) {
|
|
119
|
-
popupEl.style.maxWidth = rootWidth
|
|
121
|
+
popupEl.style.maxWidth = "".concat(rootWidth, "px");
|
|
120
122
|
popupEl.style.overflowX = 'auto';
|
|
121
123
|
}
|
|
122
124
|
} // 计算Popup元素应该显示的位置
|
|
@@ -143,15 +145,15 @@ function (_super) {
|
|
|
143
145
|
}
|
|
144
146
|
|
|
145
147
|
popupEl.style.transformOrigin = transformOrigin;
|
|
146
|
-
popupEl.style.left = left
|
|
147
|
-
popupEl.style.top = top
|
|
148
|
+
popupEl.style.left = "".concat(left, "px");
|
|
149
|
+
popupEl.style.top = "".concat(top, "px");
|
|
148
150
|
|
|
149
151
|
if (popupMaxHeightByCalc) {
|
|
150
|
-
popupEl.style.maxHeight = popupMaxWidthByCalc
|
|
152
|
+
popupEl.style.maxHeight = "".concat(popupMaxWidthByCalc, "px");
|
|
151
153
|
}
|
|
152
154
|
|
|
153
155
|
if (popupMaxWidthByCalc) {
|
|
154
|
-
popupEl.style.maxWidth = popupMaxWidthByCalc
|
|
156
|
+
popupEl.style.maxWidth = "".concat(popupMaxWidthByCalc, "px");
|
|
155
157
|
popupEl.style.overflowX = 'auto';
|
|
156
158
|
} else if (!isMaxRootWidth) {
|
|
157
159
|
popupEl.style.maxWidth = '';
|
|
@@ -517,8 +519,8 @@ function (_super) {
|
|
|
517
519
|
|
|
518
520
|
if (showMask) {
|
|
519
521
|
var cls = this.prefixCls;
|
|
520
|
-
return React.createElement("div", {
|
|
521
|
-
className: classNames(cls
|
|
522
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
523
|
+
className: classNames("".concat(cls, "-mask"), (_a = {}, _a["".concat(cls, "-mask-show")] = visible, _a)),
|
|
522
524
|
ref: this.maskRef,
|
|
523
525
|
onTouchEnd: this.onPreventThrough
|
|
524
526
|
});
|
|
@@ -540,7 +542,7 @@ function (_super) {
|
|
|
540
542
|
visible = _c.visible,
|
|
541
543
|
isUserOperated = _c.isUserOperated,
|
|
542
544
|
trigger = _c.trigger;
|
|
543
|
-
var wrapClass = classNames(cls
|
|
545
|
+
var wrapClass = classNames("".concat(cls, "-wrap"), wrapClassName, (_a = {}, _a["".concat(cls, "-hidden")] = isInsertNode && !isUserOperated && !visible, _a)); // hover 下,对popup增加相应的事件,延迟隐藏,可以在弹框中停留
|
|
544
546
|
|
|
545
547
|
var mouseProps = {};
|
|
546
548
|
|
|
@@ -551,14 +553,14 @@ function (_super) {
|
|
|
551
553
|
|
|
552
554
|
mouseProps.onMouseDown = this.onPopupMouseDown;
|
|
553
555
|
mouseProps.onTouchStart = this.onPopupMouseDown;
|
|
554
|
-
return React.createElement(CSSTransition, {
|
|
556
|
+
return /*#__PURE__*/React.createElement(CSSTransition, {
|
|
555
557
|
"in": visible,
|
|
556
558
|
onEnter: this.forceAlign,
|
|
557
559
|
timeout: 200,
|
|
558
|
-
classNames: cls
|
|
560
|
+
classNames: "".concat(cls, "-fade").concat(isTransformHorizontalDirection ? '-hr' : ''),
|
|
559
561
|
onExited: this.onExited,
|
|
560
562
|
appear: true
|
|
561
|
-
}, React.createElement("div", __assign({}, mouseProps, {
|
|
563
|
+
}, /*#__PURE__*/React.createElement("div", __assign({}, mouseProps, {
|
|
562
564
|
className: wrapClass,
|
|
563
565
|
ref: this.popupRef
|
|
564
566
|
}), typeof popup === 'function' ? popup() : popup));
|
|
@@ -600,23 +602,23 @@ function (_super) {
|
|
|
600
602
|
} // 对当前children元素添加额外属性
|
|
601
603
|
|
|
602
604
|
|
|
603
|
-
return React.cloneElement(child, cloneProps);
|
|
605
|
+
return /*#__PURE__*/React.cloneElement(child, cloneProps);
|
|
604
606
|
};
|
|
605
607
|
|
|
606
608
|
Trigger.prototype.renderPopupComponent = function () {
|
|
607
609
|
if (this.props.isInsertNode) {
|
|
608
|
-
return React.createElement(React.Fragment, null, this.renderMask(), this.renderPopupContent());
|
|
610
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, this.renderMask(), this.renderPopupContent());
|
|
609
611
|
}
|
|
610
612
|
|
|
611
613
|
if (this.state.visible || this.popupRef.current) {
|
|
612
|
-
return React.createElement(Portal, null, React.createElement(React.Fragment, null, this.renderMask(), this.renderPopupContent()));
|
|
614
|
+
return /*#__PURE__*/React.createElement(Portal, null, /*#__PURE__*/React.createElement(React.Fragment, null, this.renderMask(), this.renderPopupContent()));
|
|
613
615
|
}
|
|
614
616
|
|
|
615
617
|
return null;
|
|
616
618
|
};
|
|
617
619
|
|
|
618
620
|
Trigger.prototype.render = function () {
|
|
619
|
-
return React.createElement(React.Fragment, null, this.renderChildComponent(), this.renderPopupComponent());
|
|
621
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, this.renderChildComponent(), this.renderPopupComponent());
|
|
620
622
|
};
|
|
621
623
|
|
|
622
624
|
Trigger.defaultProps = {
|
package/esm/trigger/leftAlign.js
CHANGED
|
@@ -30,11 +30,11 @@ function getLeftCommon(_a) {
|
|
|
30
30
|
height: popInfo.height,
|
|
31
31
|
left: left - (rootToPopupSpacing + popInfo.width),
|
|
32
32
|
arrowStyle: hiddenArrow ? {} : {
|
|
33
|
-
top: arrowTop
|
|
33
|
+
top: "".concat(arrowTop, "px"),
|
|
34
34
|
right: '-4px',
|
|
35
35
|
transform: 'translateY(-50%) rotate(-45deg)'
|
|
36
36
|
},
|
|
37
|
-
transformOrigin: isTransformHorizontalDirection ? 'right center' : "right "
|
|
37
|
+
transformOrigin: isTransformHorizontalDirection ? 'right center' : "right ".concat(arrowTop, "px")
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
/* 具体方位 */
|
|
@@ -30,11 +30,11 @@ function getRightCommon(_a) {
|
|
|
30
30
|
height: popInfo.height,
|
|
31
31
|
left: left + rootToPopupSpacing + rootInfo.width,
|
|
32
32
|
arrowStyle: hiddenArrow ? {} : {
|
|
33
|
-
top: arrowTop
|
|
33
|
+
top: "".concat(arrowTop, "px"),
|
|
34
34
|
left: '-4px',
|
|
35
35
|
transform: 'translateY(-50%) rotate(-225deg)'
|
|
36
36
|
},
|
|
37
|
-
transformOrigin: isTransformHorizontalDirection ? 'left center' : "left "
|
|
37
|
+
transformOrigin: isTransformHorizontalDirection ? 'left center' : "left ".concat(arrowTop, "px")
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
|