@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
|
@@ -19,7 +19,7 @@ var __extends = void 0 && (void 0).__extends || function () {
|
|
|
19
19
|
d.__proto__ = b;
|
|
20
20
|
} || function (d, b) {
|
|
21
21
|
for (var p in b) {
|
|
22
|
-
if (
|
|
22
|
+
if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
25
|
|
|
@@ -27,6 +27,8 @@ var __extends = void 0 && (void 0).__extends || function () {
|
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
return function (d, b) {
|
|
30
|
+
if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
31
|
+
|
|
30
32
|
_extendStatics(d, b);
|
|
31
33
|
|
|
32
34
|
function __() {
|
|
@@ -70,9 +72,9 @@ function (_super) {
|
|
|
70
72
|
return sortIcon(isSortedDescending);
|
|
71
73
|
}
|
|
72
74
|
|
|
73
|
-
return _react.default.createElement("span", {
|
|
74
|
-
className: prefixCls
|
|
75
|
-
}, _react.default.createElement("svg", {
|
|
75
|
+
return /*#__PURE__*/_react.default.createElement("span", {
|
|
76
|
+
className: "".concat(prefixCls, "-arrow")
|
|
77
|
+
}, /*#__PURE__*/_react.default.createElement("svg", {
|
|
76
78
|
style: isSortedDescending ? {
|
|
77
79
|
transform: 'rotate(180deg)'
|
|
78
80
|
} : null,
|
|
@@ -82,7 +84,7 @@ function (_super) {
|
|
|
82
84
|
height: "1em",
|
|
83
85
|
fill: "currentColor",
|
|
84
86
|
xmlns: "http://www.w3.org/2000/svg"
|
|
85
|
-
}, _react.default.createElement("path", {
|
|
87
|
+
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
86
88
|
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"
|
|
87
89
|
})));
|
|
88
90
|
};
|
|
@@ -99,11 +101,11 @@ function (_super) {
|
|
|
99
101
|
title = _b.title,
|
|
100
102
|
sortName = _b.sortName,
|
|
101
103
|
colSpan = _b.colSpan;
|
|
102
|
-
return _react.default.createElement("th", {
|
|
104
|
+
return /*#__PURE__*/_react.default.createElement("th", {
|
|
103
105
|
className: className,
|
|
104
106
|
colSpan: colSpan
|
|
105
|
-
}, _react.default.createElement("div", {
|
|
106
|
-
className: (0, _classnames.default)(prefixCls
|
|
107
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
108
|
+
className: (0, _classnames.default)("".concat(prefixCls, "-title"), (_a = {}, _a["".concat(prefixCls, "-point")] = sortName, _a)),
|
|
107
109
|
onClick: this.onClick
|
|
108
110
|
}, title, this.renderArrow()));
|
|
109
111
|
};
|
|
@@ -69,11 +69,11 @@ function HeaderRow(_a) {
|
|
|
69
69
|
return parseHeaderRows(columns);
|
|
70
70
|
}, [columns]);
|
|
71
71
|
|
|
72
|
-
return _react.default.createElement("tr", null, _react.default.createElement(_CheckIcon.default, {
|
|
72
|
+
return /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement(_CheckIcon.default, {
|
|
73
73
|
prefixCls: cls,
|
|
74
74
|
rowSelection: rowSelection
|
|
75
75
|
}), rows.map(function (item) {
|
|
76
|
-
return _react.default.createElement(_HeaderCell.default, __assign({
|
|
76
|
+
return /*#__PURE__*/_react.default.createElement(_HeaderCell.default, __assign({
|
|
77
77
|
key: item.key
|
|
78
78
|
}, item, {
|
|
79
79
|
prefixCls: cls,
|
package/lib/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/lib/table/index.js
CHANGED
|
@@ -27,7 +27,7 @@ var __extends = void 0 && (void 0).__extends || function () {
|
|
|
27
27
|
d.__proto__ = b;
|
|
28
28
|
} || function (d, b) {
|
|
29
29
|
for (var p in b) {
|
|
30
|
-
if (
|
|
30
|
+
if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
|
|
@@ -35,6 +35,8 @@ var __extends = void 0 && (void 0).__extends || function () {
|
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
return function (d, b) {
|
|
38
|
+
if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
39
|
+
|
|
38
40
|
_extendStatics(d, b);
|
|
39
41
|
|
|
40
42
|
function __() {
|
|
@@ -70,8 +72,8 @@ function (_super) {
|
|
|
70
72
|
var _this = _super.call(this, props) || this;
|
|
71
73
|
|
|
72
74
|
_this.prefixCls = 'ab-table';
|
|
73
|
-
_this.headerRef = _react.default.createRef();
|
|
74
|
-
_this.bodyRef = _react.default.createRef();
|
|
75
|
+
_this.headerRef = /*#__PURE__*/_react.default.createRef();
|
|
76
|
+
_this.bodyRef = /*#__PURE__*/_react.default.createRef();
|
|
75
77
|
_this.defaultRowSelection = {
|
|
76
78
|
selectAllVisible: true,
|
|
77
79
|
selectAllChecked: false,
|
|
@@ -201,8 +203,8 @@ function (_super) {
|
|
|
201
203
|
return previousValue;
|
|
202
204
|
}
|
|
203
205
|
|
|
204
|
-
var data = dataSource.find(function (
|
|
205
|
-
return getRowKey(
|
|
206
|
+
var data = dataSource.find(function (item) {
|
|
207
|
+
return getRowKey(item) === currentValue;
|
|
206
208
|
});
|
|
207
209
|
|
|
208
210
|
if (data) {
|
|
@@ -277,13 +279,13 @@ function (_super) {
|
|
|
277
279
|
var _a = _this.props,
|
|
278
280
|
columns = _a.columns,
|
|
279
281
|
rowSelection = _a.rowSelection;
|
|
280
|
-
return _react.default.createElement("colgroup", null, rowSelection ? _react.default.createElement("col", {
|
|
282
|
+
return /*#__PURE__*/_react.default.createElement("colgroup", null, rowSelection ? /*#__PURE__*/_react.default.createElement("col", {
|
|
281
283
|
width: 32
|
|
282
284
|
}) : null, columns.map(function (item) {
|
|
283
285
|
var width = item.width;
|
|
284
286
|
|
|
285
287
|
if (width) {
|
|
286
|
-
return _react.default.createElement("col", {
|
|
288
|
+
return /*#__PURE__*/_react.default.createElement("col", {
|
|
287
289
|
key: item.key,
|
|
288
290
|
style: {
|
|
289
291
|
width: width,
|
|
@@ -292,7 +294,7 @@ function (_super) {
|
|
|
292
294
|
});
|
|
293
295
|
}
|
|
294
296
|
|
|
295
|
-
return _react.default.createElement("col", {
|
|
297
|
+
return /*#__PURE__*/_react.default.createElement("col", {
|
|
296
298
|
key: item.key
|
|
297
299
|
});
|
|
298
300
|
}));
|
|
@@ -307,7 +309,7 @@ function (_super) {
|
|
|
307
309
|
sortIcon = _a.sortIcon,
|
|
308
310
|
onSortChange = _a.onSortChange;
|
|
309
311
|
var rowSelection = _this.state.rowSelection;
|
|
310
|
-
return _react.default.createElement("thead", null, _react.default.createElement(_HeaderRow.default, {
|
|
312
|
+
return /*#__PURE__*/_react.default.createElement("thead", null, /*#__PURE__*/_react.default.createElement(_HeaderRow.default, {
|
|
311
313
|
prefixCls: cls,
|
|
312
314
|
columns: columns,
|
|
313
315
|
sortName: sortName,
|
|
@@ -328,7 +330,7 @@ function (_super) {
|
|
|
328
330
|
var _b = _this.state,
|
|
329
331
|
rowSelection = _b.rowSelection,
|
|
330
332
|
selectedRowKeys = _b.selectedRowKeys;
|
|
331
|
-
return _react.default.createElement("tbody", null, _react.default.createElement(_body.default, {
|
|
333
|
+
return /*#__PURE__*/_react.default.createElement("tbody", null, /*#__PURE__*/_react.default.createElement(_body.default, {
|
|
332
334
|
prefixCls: cls,
|
|
333
335
|
getRowKey: getRowKey,
|
|
334
336
|
columns: columns,
|
|
@@ -373,25 +375,25 @@ function (_super) {
|
|
|
373
375
|
loading = _a.loading;
|
|
374
376
|
|
|
375
377
|
if (fixedHeader) {
|
|
376
|
-
return _react.default.createElement(_loadingContainer.default, {
|
|
378
|
+
return /*#__PURE__*/_react.default.createElement(_loadingContainer.default, {
|
|
377
379
|
loading: loading,
|
|
378
380
|
className: (0, _classnames.default)(className, cls)
|
|
379
|
-
}, _react.default.createElement("div", {
|
|
380
|
-
className: cls
|
|
381
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
382
|
+
className: "".concat(cls, "-header"),
|
|
381
383
|
ref: this.headerRef
|
|
382
|
-
}, _react.default.createElement("table", null, this.renderColgroup(), this.renderHeader())), _react.default.createElement("div", {
|
|
383
|
-
className: cls
|
|
384
|
+
}, /*#__PURE__*/_react.default.createElement("table", null, this.renderColgroup(), this.renderHeader())), /*#__PURE__*/_react.default.createElement("div", {
|
|
385
|
+
className: "".concat(cls, "-body"),
|
|
384
386
|
style: {
|
|
385
387
|
maxHeight: maxHeight
|
|
386
388
|
},
|
|
387
389
|
ref: this.bodyRef
|
|
388
|
-
}, _react.default.createElement("table", null, this.renderColgroup(), this.renderBody())));
|
|
390
|
+
}, /*#__PURE__*/_react.default.createElement("table", null, this.renderColgroup(), this.renderBody())));
|
|
389
391
|
}
|
|
390
392
|
|
|
391
|
-
return _react.default.createElement(_loadingContainer.default, {
|
|
393
|
+
return /*#__PURE__*/_react.default.createElement(_loadingContainer.default, {
|
|
392
394
|
loading: loading,
|
|
393
395
|
className: (0, _classnames.default)(className, cls)
|
|
394
|
-
}, _react.default.createElement("table", null, this.renderColgroup(), this.renderHeader(), this.renderBody()));
|
|
396
|
+
}, /*#__PURE__*/_react.default.createElement("table", null, this.renderColgroup(), this.renderHeader(), this.renderBody()));
|
|
395
397
|
};
|
|
396
398
|
|
|
397
399
|
Table.defaultProps = {
|
package/lib/table/interface.js
CHANGED
package/lib/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/lib/tabs/index.js
CHANGED
|
@@ -21,7 +21,7 @@ var __extends = void 0 && (void 0).__extends || function () {
|
|
|
21
21
|
d.__proto__ = b;
|
|
22
22
|
} || function (d, b) {
|
|
23
23
|
for (var p in b) {
|
|
24
|
-
if (
|
|
24
|
+
if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
27
|
|
|
@@ -29,6 +29,8 @@ var __extends = void 0 && (void 0).__extends || function () {
|
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
return function (d, b) {
|
|
32
|
+
if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
33
|
+
|
|
32
34
|
_extendStatics(d, b);
|
|
33
35
|
|
|
34
36
|
function __() {
|
|
@@ -192,7 +194,7 @@ function (_super) {
|
|
|
192
194
|
|
|
193
195
|
_this.prefixCls = 'ab-tabs';
|
|
194
196
|
_this.resizeHandler = null;
|
|
195
|
-
_this.ulRef = _react.default.createRef();
|
|
197
|
+
_this.ulRef = /*#__PURE__*/_react.default.createRef();
|
|
196
198
|
/**
|
|
197
199
|
* 处理value在使用data-value后,将number转成string问题
|
|
198
200
|
* @param value
|
|
@@ -242,13 +244,13 @@ function (_super) {
|
|
|
242
244
|
var barStyles = {};
|
|
243
245
|
|
|
244
246
|
if (placement === 'top' || placement === 'bottom') {
|
|
245
|
-
barStyles.width = offsetAndSize.width
|
|
247
|
+
barStyles.width = "".concat(offsetAndSize.width, "px");
|
|
246
248
|
barStyles.height = barSize;
|
|
247
|
-
barStyles.transform = "translate("
|
|
249
|
+
barStyles.transform = "translate(".concat(offsetAndSize.offsetLeft, "px, 0)");
|
|
248
250
|
} else if (placement === 'left' || placement === 'right') {
|
|
249
|
-
barStyles.height = offsetAndSize.height
|
|
251
|
+
barStyles.height = "".concat(offsetAndSize.height, "px");
|
|
250
252
|
barStyles.width = barSize;
|
|
251
|
-
barStyles.transform = "translate(0, "
|
|
253
|
+
barStyles.transform = "translate(0, ".concat(offsetAndSize.offsetTop, "px)");
|
|
252
254
|
}
|
|
253
255
|
|
|
254
256
|
_this.setState({
|
|
@@ -386,20 +388,20 @@ function (_super) {
|
|
|
386
388
|
var _b = this.state,
|
|
387
389
|
activeValue = _b.activeValue,
|
|
388
390
|
barStyles = _b.barStyles;
|
|
389
|
-
return _react.default.createElement("div", {
|
|
390
|
-
className: (0, _classnames.default)(cls, className, cls
|
|
391
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
392
|
+
className: (0, _classnames.default)(cls, className, "".concat(cls, "-").concat(placement)),
|
|
391
393
|
ref: this.ulRef
|
|
392
394
|
}, options.map(function (item) {
|
|
393
395
|
var _a;
|
|
394
396
|
|
|
395
|
-
return _react.default.createElement("div", {
|
|
397
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
396
398
|
key: item.value,
|
|
397
|
-
className: (0, _classnames.default)(cls
|
|
399
|
+
className: (0, _classnames.default)("".concat(cls, "-item"), item.className, (_a = {}, _a["".concat(cls, "-active")] = activeValue === item.value, _a["".concat(cls, "-disabled")] = item.disabled, _a)),
|
|
398
400
|
"data-value": item.value,
|
|
399
401
|
onClick: _this.onChange
|
|
400
402
|
}, item.name);
|
|
401
|
-
}), _react.default.createElement("div", {
|
|
402
|
-
className: cls
|
|
403
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
404
|
+
className: "".concat(cls, "-bar"),
|
|
403
405
|
style: barStyles
|
|
404
406
|
}));
|
|
405
407
|
};
|
package/lib/tooltip/index.d.ts
CHANGED
package/lib/tooltip/index.js
CHANGED
|
@@ -30,7 +30,7 @@ var __assign = void 0 && (void 0).__assign || function () {
|
|
|
30
30
|
var cls = 'ab-tooltip';
|
|
31
31
|
|
|
32
32
|
function Tooltip(props) {
|
|
33
|
-
return _react.default.createElement(_popover.default, __assign({}, props, {
|
|
33
|
+
return /*#__PURE__*/_react.default.createElement(_popover.default, __assign({}, props, {
|
|
34
34
|
prefixCls: cls
|
|
35
35
|
}), props.children);
|
|
36
36
|
}
|
package/lib/trigger/align.js
CHANGED
|
@@ -3,76 +3,76 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
Object.defineProperty(exports, "
|
|
6
|
+
Object.defineProperty(exports, "getBottomLeftLocationInfo", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function get() {
|
|
9
|
-
return
|
|
9
|
+
return _bottomAlign.getBottomLeftLocationInfo;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
Object.defineProperty(exports, "
|
|
12
|
+
Object.defineProperty(exports, "getBottomLocationInfo", {
|
|
13
13
|
enumerable: true,
|
|
14
14
|
get: function get() {
|
|
15
|
-
return
|
|
15
|
+
return _bottomAlign.getBottomLocationInfo;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
Object.defineProperty(exports, "
|
|
18
|
+
Object.defineProperty(exports, "getBottomRightLocationInfo", {
|
|
19
19
|
enumerable: true,
|
|
20
20
|
get: function get() {
|
|
21
|
-
return
|
|
21
|
+
return _bottomAlign.getBottomRightLocationInfo;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
Object.defineProperty(exports, "
|
|
24
|
+
Object.defineProperty(exports, "getLeftBottomLocationInfo", {
|
|
25
25
|
enumerable: true,
|
|
26
26
|
get: function get() {
|
|
27
|
-
return
|
|
27
|
+
return _leftAlign.getLeftBottomLocationInfo;
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
-
Object.defineProperty(exports, "
|
|
30
|
+
Object.defineProperty(exports, "getLeftLocationInfo", {
|
|
31
31
|
enumerable: true,
|
|
32
32
|
get: function get() {
|
|
33
|
-
return
|
|
33
|
+
return _leftAlign.getLeftLocationInfo;
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
|
-
Object.defineProperty(exports, "
|
|
36
|
+
Object.defineProperty(exports, "getLeftTopLocationInfo", {
|
|
37
37
|
enumerable: true,
|
|
38
38
|
get: function get() {
|
|
39
|
-
return
|
|
39
|
+
return _leftAlign.getLeftTopLocationInfo;
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
|
-
Object.defineProperty(exports, "
|
|
42
|
+
Object.defineProperty(exports, "getRightBottomLocationInfo", {
|
|
43
43
|
enumerable: true,
|
|
44
44
|
get: function get() {
|
|
45
|
-
return
|
|
45
|
+
return _rightAlign.getRightBottomLocationInfo;
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
|
-
Object.defineProperty(exports, "
|
|
48
|
+
Object.defineProperty(exports, "getRightLocationInfo", {
|
|
49
49
|
enumerable: true,
|
|
50
50
|
get: function get() {
|
|
51
|
-
return
|
|
51
|
+
return _rightAlign.getRightLocationInfo;
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
|
-
Object.defineProperty(exports, "
|
|
54
|
+
Object.defineProperty(exports, "getRightTopLocationInfo", {
|
|
55
55
|
enumerable: true,
|
|
56
56
|
get: function get() {
|
|
57
|
-
return
|
|
57
|
+
return _rightAlign.getRightTopLocationInfo;
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
|
-
Object.defineProperty(exports, "
|
|
60
|
+
Object.defineProperty(exports, "getTopLeftLocationInfo", {
|
|
61
61
|
enumerable: true,
|
|
62
62
|
get: function get() {
|
|
63
|
-
return
|
|
63
|
+
return _topAlign.getTopLeftLocationInfo;
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
|
-
Object.defineProperty(exports, "
|
|
66
|
+
Object.defineProperty(exports, "getTopLocationInfo", {
|
|
67
67
|
enumerable: true,
|
|
68
68
|
get: function get() {
|
|
69
|
-
return
|
|
69
|
+
return _topAlign.getTopLocationInfo;
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
|
-
Object.defineProperty(exports, "
|
|
72
|
+
Object.defineProperty(exports, "getTopRightLocationInfo", {
|
|
73
73
|
enumerable: true,
|
|
74
74
|
get: function get() {
|
|
75
|
-
return
|
|
75
|
+
return _topAlign.getTopRightLocationInfo;
|
|
76
76
|
}
|
|
77
77
|
});
|
|
78
78
|
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.getBottomLocationInfo = getBottomLocationInfo;
|
|
7
6
|
exports.getBottomLeftLocationInfo = getBottomLeftLocationInfo;
|
|
7
|
+
exports.getBottomLocationInfo = getBottomLocationInfo;
|
|
8
8
|
exports.getBottomRightLocationInfo = getBottomRightLocationInfo;
|
|
9
9
|
|
|
10
10
|
var _utils = require("./utils");
|
|
@@ -39,11 +39,11 @@ function getBottomCommon(_a) {
|
|
|
39
39
|
height: popInfo.height,
|
|
40
40
|
top: top + rootInfo.height + rootToPopupSpacing,
|
|
41
41
|
arrowStyle: hiddenArrow ? {} : {
|
|
42
|
-
left: arrowLeft
|
|
42
|
+
left: "".concat(arrowLeft, "px"),
|
|
43
43
|
top: '-4px',
|
|
44
44
|
transform: 'translateX(-50%) rotate(-135deg)'
|
|
45
45
|
},
|
|
46
|
-
transformOrigin: isTransformHorizontalDirection ? 'center top' : arrowLeft
|
|
46
|
+
transformOrigin: isTransformHorizontalDirection ? 'center top' : "".concat(arrowLeft, "px top")
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
49
|
|
package/lib/trigger/constants.js
CHANGED
|
@@ -114,9 +114,10 @@ function getPopupLocation(placement, rootEl, popupEl, initTranslateX, initTransl
|
|
|
114
114
|
}),
|
|
115
115
|
methodStr = _a.methodStr,
|
|
116
116
|
isVertical = _a.isVertical; // 拼装方法名
|
|
117
|
+
// eslint-disable-next-line import/namespace
|
|
117
118
|
|
|
118
119
|
|
|
119
|
-
var currentMethod = alignUtil["get"
|
|
120
|
+
var currentMethod = alignUtil["get".concat(methodStr, "LocationInfo")]; // 执行方法
|
|
120
121
|
|
|
121
122
|
var result = currentMethod(params);
|
|
122
123
|
|
package/lib/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/lib/trigger/index.js
CHANGED
|
@@ -17,10 +17,10 @@ var _utils = require("@autobest-ui/utils");
|
|
|
17
17
|
|
|
18
18
|
var _reactTransitionGroup = require("react-transition-group");
|
|
19
19
|
|
|
20
|
-
var _ref = require("./ref");
|
|
21
|
-
|
|
22
20
|
var _portal = _interopRequireDefault(require("../portal"));
|
|
23
21
|
|
|
22
|
+
var _ref = require("./ref");
|
|
23
|
+
|
|
24
24
|
var _getPopupLocation = _interopRequireDefault(require("./getPopupLocation"));
|
|
25
25
|
|
|
26
26
|
var __extends = void 0 && (void 0).__extends || function () {
|
|
@@ -31,7 +31,7 @@ var __extends = void 0 && (void 0).__extends || function () {
|
|
|
31
31
|
d.__proto__ = b;
|
|
32
32
|
} || function (d, b) {
|
|
33
33
|
for (var p in b) {
|
|
34
|
-
if (
|
|
34
|
+
if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
|
|
@@ -39,6 +39,8 @@ var __extends = void 0 && (void 0).__extends || function () {
|
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
return function (d, b) {
|
|
42
|
+
if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
43
|
+
|
|
42
44
|
_extendStatics(d, b);
|
|
43
45
|
|
|
44
46
|
function __() {
|
|
@@ -76,9 +78,9 @@ function (_super) {
|
|
|
76
78
|
var _this = _super.call(this, props) || this;
|
|
77
79
|
|
|
78
80
|
_this.prefixCls = 'ab-trigger';
|
|
79
|
-
_this.popupRef = _react.default.createRef();
|
|
80
|
-
_this.maskRef = _react.default.createRef();
|
|
81
|
-
_this.triggerRef = _react.default.createRef();
|
|
81
|
+
_this.popupRef = /*#__PURE__*/_react.default.createRef();
|
|
82
|
+
_this.maskRef = /*#__PURE__*/_react.default.createRef();
|
|
83
|
+
_this.triggerRef = /*#__PURE__*/_react.default.createRef();
|
|
82
84
|
|
|
83
85
|
_this.isClickToHide = function () {
|
|
84
86
|
return _this.props.trigger.indexOf('click') !== -1;
|
|
@@ -120,7 +122,7 @@ function (_super) {
|
|
|
120
122
|
isInsertNode = _a.isInsertNode;
|
|
121
123
|
|
|
122
124
|
if (maxHeight) {
|
|
123
|
-
popupEl.style.maxHeight = maxHeight
|
|
125
|
+
popupEl.style.maxHeight = "".concat(maxHeight, "px");
|
|
124
126
|
popupEl.style.overflowY = 'auto';
|
|
125
127
|
}
|
|
126
128
|
|
|
@@ -128,11 +130,11 @@ function (_super) {
|
|
|
128
130
|
var rootWidth = (0, _utils.getElementSize)(rootEl).width;
|
|
129
131
|
|
|
130
132
|
if (isMinRootWidth) {
|
|
131
|
-
popupEl.style.minWidth = rootWidth
|
|
133
|
+
popupEl.style.minWidth = "".concat(rootWidth, "px");
|
|
132
134
|
}
|
|
133
135
|
|
|
134
136
|
if (isMaxRootWidth) {
|
|
135
|
-
popupEl.style.maxWidth = rootWidth
|
|
137
|
+
popupEl.style.maxWidth = "".concat(rootWidth, "px");
|
|
136
138
|
popupEl.style.overflowX = 'auto';
|
|
137
139
|
}
|
|
138
140
|
} // 计算Popup元素应该显示的位置
|
|
@@ -159,15 +161,15 @@ function (_super) {
|
|
|
159
161
|
}
|
|
160
162
|
|
|
161
163
|
popupEl.style.transformOrigin = transformOrigin;
|
|
162
|
-
popupEl.style.left = left
|
|
163
|
-
popupEl.style.top = top
|
|
164
|
+
popupEl.style.left = "".concat(left, "px");
|
|
165
|
+
popupEl.style.top = "".concat(top, "px");
|
|
164
166
|
|
|
165
167
|
if (popupMaxHeightByCalc) {
|
|
166
|
-
popupEl.style.maxHeight = popupMaxWidthByCalc
|
|
168
|
+
popupEl.style.maxHeight = "".concat(popupMaxWidthByCalc, "px");
|
|
167
169
|
}
|
|
168
170
|
|
|
169
171
|
if (popupMaxWidthByCalc) {
|
|
170
|
-
popupEl.style.maxWidth = popupMaxWidthByCalc
|
|
172
|
+
popupEl.style.maxWidth = "".concat(popupMaxWidthByCalc, "px");
|
|
171
173
|
popupEl.style.overflowX = 'auto';
|
|
172
174
|
} else if (!isMaxRootWidth) {
|
|
173
175
|
popupEl.style.maxWidth = '';
|
|
@@ -533,8 +535,8 @@ function (_super) {
|
|
|
533
535
|
|
|
534
536
|
if (showMask) {
|
|
535
537
|
var cls = this.prefixCls;
|
|
536
|
-
return _react.default.createElement("div", {
|
|
537
|
-
className: (0, _classnames.default)(cls
|
|
538
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
539
|
+
className: (0, _classnames.default)("".concat(cls, "-mask"), (_a = {}, _a["".concat(cls, "-mask-show")] = visible, _a)),
|
|
538
540
|
ref: this.maskRef,
|
|
539
541
|
onTouchEnd: this.onPreventThrough
|
|
540
542
|
});
|
|
@@ -556,7 +558,7 @@ function (_super) {
|
|
|
556
558
|
visible = _c.visible,
|
|
557
559
|
isUserOperated = _c.isUserOperated,
|
|
558
560
|
trigger = _c.trigger;
|
|
559
|
-
var wrapClass = (0, _classnames.default)(cls
|
|
561
|
+
var wrapClass = (0, _classnames.default)("".concat(cls, "-wrap"), wrapClassName, (_a = {}, _a["".concat(cls, "-hidden")] = isInsertNode && !isUserOperated && !visible, _a)); // hover 下,对popup增加相应的事件,延迟隐藏,可以在弹框中停留
|
|
560
562
|
|
|
561
563
|
var mouseProps = {};
|
|
562
564
|
|
|
@@ -567,14 +569,14 @@ function (_super) {
|
|
|
567
569
|
|
|
568
570
|
mouseProps.onMouseDown = this.onPopupMouseDown;
|
|
569
571
|
mouseProps.onTouchStart = this.onPopupMouseDown;
|
|
570
|
-
return _react.default.createElement(_reactTransitionGroup.CSSTransition, {
|
|
572
|
+
return /*#__PURE__*/_react.default.createElement(_reactTransitionGroup.CSSTransition, {
|
|
571
573
|
in: visible,
|
|
572
574
|
onEnter: this.forceAlign,
|
|
573
575
|
timeout: 200,
|
|
574
|
-
classNames: cls
|
|
576
|
+
classNames: "".concat(cls, "-fade").concat(isTransformHorizontalDirection ? '-hr' : ''),
|
|
575
577
|
onExited: this.onExited,
|
|
576
578
|
appear: true
|
|
577
|
-
}, _react.default.createElement("div", __assign({}, mouseProps, {
|
|
579
|
+
}, /*#__PURE__*/_react.default.createElement("div", __assign({}, mouseProps, {
|
|
578
580
|
className: wrapClass,
|
|
579
581
|
ref: this.popupRef
|
|
580
582
|
}), typeof popup === 'function' ? popup() : popup));
|
|
@@ -618,23 +620,23 @@ function (_super) {
|
|
|
618
620
|
} // 对当前children元素添加额外属性
|
|
619
621
|
|
|
620
622
|
|
|
621
|
-
return _react.default.cloneElement(child, cloneProps);
|
|
623
|
+
return /*#__PURE__*/_react.default.cloneElement(child, cloneProps);
|
|
622
624
|
};
|
|
623
625
|
|
|
624
626
|
Trigger.prototype.renderPopupComponent = function () {
|
|
625
627
|
if (this.props.isInsertNode) {
|
|
626
|
-
return _react.default.createElement(_react.default.Fragment, null, this.renderMask(), this.renderPopupContent());
|
|
628
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, this.renderMask(), this.renderPopupContent());
|
|
627
629
|
}
|
|
628
630
|
|
|
629
631
|
if (this.state.visible || this.popupRef.current) {
|
|
630
|
-
return _react.default.createElement(_portal.default, null, _react.default.createElement(_react.default.Fragment, null, this.renderMask(), this.renderPopupContent()));
|
|
632
|
+
return /*#__PURE__*/_react.default.createElement(_portal.default, null, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, this.renderMask(), this.renderPopupContent()));
|
|
631
633
|
}
|
|
632
634
|
|
|
633
635
|
return null;
|
|
634
636
|
};
|
|
635
637
|
|
|
636
638
|
Trigger.prototype.render = function () {
|
|
637
|
-
return _react.default.createElement(_react.default.Fragment, null, this.renderChildComponent(), this.renderPopupComponent());
|
|
639
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, this.renderChildComponent(), this.renderPopupComponent());
|
|
638
640
|
};
|
|
639
641
|
|
|
640
642
|
Trigger.defaultProps = {
|