@aloudata/aloudata-design 1.5.4 → 1.6.1
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/Button/index.js +17 -6
- package/dist/Button/style/index.less +60 -114
- package/dist/Button/style/variables.less +0 -1
- package/dist/ColorPicker/style/index.less +2 -2
- package/dist/ConfigProvider/index.d.ts +2 -1
- package/dist/ConfigProvider/index.js +1 -0
- package/dist/DataPreviewTable/components/Body/SkeletonBody.js +2 -2
- package/dist/DataPreviewTable/components/Body/index.js +2 -1
- package/dist/DataPreviewTable/components/Header/index.d.ts +2 -2
- package/dist/DataPreviewTable/components/Header/index.js +11 -19
- package/dist/DataPreviewTable/hooks/useDirection.d.ts +4 -21
- package/dist/DataPreviewTable/hooks/useDirection.js +109 -146
- package/dist/DataPreviewTable/index.js +25 -16
- package/dist/DataPreviewTable/interface.d.ts +18 -0
- package/dist/DataPreviewTable/interface.js +13 -1
- package/dist/DataPreviewTable/utils/getColumnOffsetsFromWidths.d.ts +1 -0
- package/dist/DataPreviewTable/utils/getColumnOffsetsFromWidths.js +8 -0
- package/dist/DataPreviewTable/utils/getColumnRange.d.ts +8 -0
- package/dist/DataPreviewTable/utils/getColumnRange.js +25 -0
- package/dist/DataPreviewTable/utils/getRowRange.d.ts +7 -0
- package/dist/DataPreviewTable/utils/getRowRange.js +28 -0
- package/dist/DataPreviewTable/utils/getTableLayout.d.ts +3 -0
- package/dist/DataPreviewTable/utils/getTableLayout.js +18 -0
- package/dist/DatePicker/index.d.ts +20 -11
- package/dist/DatePicker/index.js +216 -13
- package/dist/DatePicker/style/index.less +13 -0
- package/dist/Dropdown/style/index.less +3 -0
- package/dist/Empty/style/index.less +11 -13
- package/dist/Input/components/Input/index.js +16 -3
- package/dist/Input/style/index.less +11 -10
- package/dist/MemberPicker/components/MultipleOption.js +5 -1
- package/dist/MemberPicker/components/NickLabel.js +1 -2
- package/dist/MemberPicker/components/SelectedMemberTags.js +5 -1
- package/dist/MemberPicker/components/SingleOption.js +5 -1
- package/dist/MemberPicker/index.js +9 -3
- package/dist/MemberPicker/interface.d.ts +3 -3
- package/dist/MemberPicker/style/index.less +11 -3
- package/dist/Modal/style/index.less +2 -5
- package/dist/Select/components/SingleOption.js +3 -9
- package/dist/Select/index.js +34 -15
- package/dist/Select/style/single.less +11 -7
- package/dist/Select/style/size.less +19 -0
- package/dist/Select/style/status.less +2 -1
- package/dist/Table/style/index.less +2 -2
- package/dist/Table/style/variable.less +0 -1
- package/dist/Tabs/index.d.ts +5 -0
- package/dist/Tabs/index.js +4 -2
- package/dist/Tabs/style/index.less +6 -0
- package/dist/message/style/index.less +8 -7
- package/dist/style/mixins/index.less +4 -3
- package/dist/style/themes/default/scrollBar.less +3 -2
- package/package.json +10 -3
package/dist/Button/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["type", "size", "shape", "loading", "disabled", "icon", "className"];
|
|
1
|
+
var _excluded = ["type", "size", "shape", "loading", "disabled", "icon", "className", "prefixCls"];
|
|
2
2
|
|
|
3
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
@@ -14,10 +14,11 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
14
14
|
|
|
15
15
|
import { LoadingLine } from '@aloudata/icons-react';
|
|
16
16
|
import { Button as AntdButton } from 'antd';
|
|
17
|
+
import { useCompactItemContext } from 'antd/lib/space/Compact';
|
|
17
18
|
import classNames from 'classnames';
|
|
18
19
|
import React, { useContext } from 'react';
|
|
20
|
+
import { ConfigContext } from "../ConfigProvider";
|
|
19
21
|
import SizeContext from "../ConfigProvider/sizeContext";
|
|
20
|
-
var iconPrefixCls = 'aldicon';
|
|
21
22
|
var ICON_LARGE = 20;
|
|
22
23
|
var ICON_MIDDLE = 16;
|
|
23
24
|
var ICON_SMALL = 14;
|
|
@@ -73,7 +74,6 @@ export var setIcon = function setIcon(iconNode, size, loading) {
|
|
|
73
74
|
fill: 'currentColor'
|
|
74
75
|
}, iconNode.props);
|
|
75
76
|
|
|
76
|
-
p.className = classNames("".concat(iconPrefixCls, "-icon-left"), p.className, iconPrefixCls);
|
|
77
77
|
p.size = getIconSize(size);
|
|
78
78
|
return /*#__PURE__*/React.cloneElement(iconNode, p);
|
|
79
79
|
}
|
|
@@ -82,7 +82,6 @@ export var setIcon = function setIcon(iconNode, size, loading) {
|
|
|
82
82
|
return /*#__PURE__*/React.createElement(LoadingLine, {
|
|
83
83
|
spin: true,
|
|
84
84
|
size: getIconSize(size),
|
|
85
|
-
className: classNames("".concat(iconPrefixCls, "-icon-left"), iconPrefixCls),
|
|
86
85
|
fill: "currentColor"
|
|
87
86
|
});
|
|
88
87
|
}
|
|
@@ -101,15 +100,27 @@ function Button(props) {
|
|
|
101
100
|
disabled = props.disabled,
|
|
102
101
|
icon = props.icon,
|
|
103
102
|
className = props.className,
|
|
103
|
+
customizePrefixCls = props.prefixCls,
|
|
104
104
|
rest = _objectWithoutProperties(props, _excluded);
|
|
105
105
|
|
|
106
106
|
var contentSize = useContext(SizeContext);
|
|
107
|
-
|
|
107
|
+
|
|
108
|
+
var _React$useContext = React.useContext(ConfigContext),
|
|
109
|
+
getPrefixCls = _React$useContext.getPrefixCls,
|
|
110
|
+
direction = _React$useContext.direction;
|
|
111
|
+
|
|
112
|
+
var prefixCls = getPrefixCls('btn', customizePrefixCls); // ===================== Compact Item =====================
|
|
113
|
+
|
|
114
|
+
var _useCompactItemContex = useCompactItemContext(prefixCls, direction),
|
|
115
|
+
compactSize = _useCompactItemContex.compactSize,
|
|
116
|
+
compactItemClassnames = _useCompactItemContex.compactItemClassnames;
|
|
117
|
+
|
|
118
|
+
var size = compactSize || customSize || contentSize || 'middle';
|
|
108
119
|
return /*#__PURE__*/React.createElement(AntdButton, _extends({}, rest, {
|
|
109
120
|
disabled: loading ? true : disabled,
|
|
110
121
|
icon: setIcon(icon, size, loading),
|
|
111
122
|
type: getButtonType(type),
|
|
112
|
-
className: classNames(btnPrefix, "".concat(btnPrefix, "-").concat(type), className, getButtonSizeClass(size)),
|
|
123
|
+
className: classNames(btnPrefix, "".concat(btnPrefix, "-").concat(type), className, getButtonSizeClass(size), compactItemClassnames),
|
|
113
124
|
danger: getDangerStatus(type),
|
|
114
125
|
shape: getShape(shape)
|
|
115
126
|
}), props.children);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
@import '../../style/index.less';
|
|
2
2
|
@import './variables.less';
|
|
3
3
|
|
|
4
|
-
.
|
|
4
|
+
.ant-btn.ald-btn {
|
|
5
5
|
&.ald-btn {
|
|
6
6
|
// &-loading::before{
|
|
7
7
|
// // display: none !important;
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
text-shadow: none;
|
|
21
21
|
text-decoration: none;
|
|
22
22
|
|
|
23
|
+
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
23
24
|
&:focus-visible {
|
|
24
25
|
outline: none;
|
|
25
26
|
}
|
|
@@ -236,139 +237,84 @@
|
|
|
236
237
|
padding: 0;
|
|
237
238
|
vertical-align: baseline;
|
|
238
239
|
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
&-large {
|
|
243
|
+
min-width: auto;
|
|
244
|
+
height: @button-height-large;
|
|
245
|
+
padding: @button-border-padding-large;
|
|
246
|
+
font-size: @button-text-size-large;
|
|
247
|
+
line-height: 24px;
|
|
248
|
+
border-radius: @button-border-radius-large;
|
|
239
249
|
|
|
240
|
-
|
|
241
|
-
min-width:
|
|
250
|
+
&.ant-btn-icon-only {
|
|
251
|
+
min-width: @button-height-large;
|
|
242
252
|
height: @button-height-large;
|
|
243
|
-
padding: @button-border-padding-large;
|
|
244
|
-
font-size: @button-text-size-large;
|
|
245
|
-
line-height: 24px;
|
|
246
253
|
border-radius: @button-border-radius-large;
|
|
254
|
+
}
|
|
247
255
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
256
|
+
&.ant-btn-circle {
|
|
257
|
+
min-width: @button-height-large;
|
|
258
|
+
height: @button-height-large;
|
|
259
|
+
border-radius: 50%;
|
|
260
|
+
}
|
|
253
261
|
|
|
254
|
-
|
|
255
|
-
min-width: @button-height-large;
|
|
256
|
-
height: @button-height-large;
|
|
257
|
-
border-radius: 50%;
|
|
258
|
-
}
|
|
262
|
+
gap: @button-left-icon-margin-right-large;
|
|
259
263
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
// vertical-align: -4px;
|
|
263
|
-
// }
|
|
264
|
-
// }
|
|
265
|
-
|
|
266
|
-
gap: @button-left-icon-margin-right-large;
|
|
267
|
-
// .aldicon-icon-left + span {
|
|
268
|
-
// margin-left: @button-left-icon-margin-right-large;
|
|
269
|
-
// }
|
|
270
|
-
&:not(.ant-btn-circle):not(.ant-btn-icon-only):not(.ald-btn-link) {
|
|
271
|
-
min-width: @button-text-min-width-large;
|
|
272
|
-
}
|
|
264
|
+
&:not(.ant-btn-circle):not(.ant-btn-icon-only):not(.ald-btn-link) {
|
|
265
|
+
min-width: @button-text-min-width-large;
|
|
273
266
|
}
|
|
267
|
+
}
|
|
274
268
|
|
|
275
|
-
|
|
276
|
-
|
|
269
|
+
&-middle {
|
|
270
|
+
min-width: auto;
|
|
271
|
+
height: @button-height-middle;
|
|
272
|
+
padding: @button-border-padding-middle;
|
|
273
|
+
font-size: @button-text-size-middle;
|
|
274
|
+
border-radius: @button-border-radius-middle;
|
|
275
|
+
|
|
276
|
+
&.ant-btn-icon-only {
|
|
277
|
+
min-width: @button-height-middle;
|
|
277
278
|
height: @button-height-middle;
|
|
278
|
-
padding: @button-border-padding-middle;
|
|
279
|
-
font-size: @button-text-size-middle;
|
|
280
279
|
border-radius: @button-border-radius-middle;
|
|
280
|
+
}
|
|
281
281
|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
282
|
+
&.ant-btn-circle {
|
|
283
|
+
min-width: @button-height-middle;
|
|
284
|
+
height: @button-height-middle;
|
|
285
|
+
border-radius: 50%;
|
|
286
|
+
}
|
|
287
287
|
|
|
288
|
-
|
|
289
|
-
min-width: @button-height-middle;
|
|
290
|
-
height: @button-height-middle;
|
|
291
|
-
border-radius: 50%;
|
|
292
|
-
}
|
|
288
|
+
gap: @button-left-icon-margin-right-middle;
|
|
293
289
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
// vertical-align: -3px;
|
|
297
|
-
// }
|
|
298
|
-
// }
|
|
299
|
-
|
|
300
|
-
gap: @button-left-icon-margin-right-middle;
|
|
301
|
-
// .aldicon-icon-left + span {
|
|
302
|
-
// margin-left: @button-left-icon-margin-right-middle;
|
|
303
|
-
// }
|
|
304
|
-
&:not(.ant-btn-circle):not(.ant-btn-icon-only):not(.ald-btn-link) {
|
|
305
|
-
min-width: @button-text-min-width-middle;
|
|
306
|
-
}
|
|
290
|
+
&:not(.ant-btn-circle):not(.ant-btn-icon-only):not(.ald-btn-link) {
|
|
291
|
+
min-width: @button-text-min-width-middle;
|
|
307
292
|
}
|
|
293
|
+
}
|
|
308
294
|
|
|
309
|
-
|
|
295
|
+
&-small {
|
|
296
|
+
height: @button-height-small;
|
|
297
|
+
padding: @button-border-padding-small;
|
|
298
|
+
font-size: @button-text-size-small;
|
|
299
|
+
line-height: 22px;
|
|
300
|
+
border-radius: @button-border-radius-small;
|
|
301
|
+
|
|
302
|
+
&.ant-btn-icon-only {
|
|
303
|
+
min-width: @button-height-small;
|
|
310
304
|
height: @button-height-small;
|
|
311
|
-
padding: @button-border-padding-small;
|
|
312
|
-
font-size: @button-text-size-small;
|
|
313
|
-
line-height: 22px;
|
|
314
305
|
border-radius: @button-border-radius-small;
|
|
306
|
+
}
|
|
315
307
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
308
|
+
&.ant-btn-circle {
|
|
309
|
+
min-width: @button-height-small;
|
|
310
|
+
height: @button-height-small;
|
|
311
|
+
border-radius: 50%;
|
|
312
|
+
}
|
|
321
313
|
|
|
322
|
-
|
|
323
|
-
min-width: @button-height-small;
|
|
324
|
-
height: @button-height-small;
|
|
325
|
-
border-radius: 50%;
|
|
326
|
-
}
|
|
314
|
+
gap: @button-left-icon-margin-right-small;
|
|
327
315
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
// vertical-align: -2px;
|
|
331
|
-
// }
|
|
332
|
-
// }
|
|
333
|
-
|
|
334
|
-
gap: @button-left-icon-margin-right-small;
|
|
335
|
-
// .aldicon-icon-left + span {
|
|
336
|
-
// margin-left: @button-left-icon-margin-right-small;
|
|
337
|
-
// }
|
|
338
|
-
&:not(.ant-btn-circle):not(.ant-btn-icon-only):not(.ald-btn-link) {
|
|
339
|
-
min-width: @button-text-min-width-small;
|
|
340
|
-
}
|
|
316
|
+
&:not(.ant-btn-circle):not(.ant-btn-icon-only):not(.ald-btn-link) {
|
|
317
|
+
min-width: @button-text-min-width-small;
|
|
341
318
|
}
|
|
342
|
-
|
|
343
|
-
// &-mini {
|
|
344
|
-
// height: @button-height-mini;
|
|
345
|
-
// padding: @button-border-padding-mini;
|
|
346
|
-
// font-size: @button-text-size-mini;
|
|
347
|
-
// line-height: 22px;
|
|
348
|
-
// border-radius: @button-border-radius-mini;
|
|
349
|
-
|
|
350
|
-
// &.ant-btn-icon-only {
|
|
351
|
-
// min-width: @button-height-mini;
|
|
352
|
-
// height: @button-height-mini;
|
|
353
|
-
// border-radius: @button-border-radius-mini;
|
|
354
|
-
// }
|
|
355
|
-
|
|
356
|
-
// &.ant-btn-circle {
|
|
357
|
-
// min-width: @button-height-mini;
|
|
358
|
-
// height: @button-height-mini;
|
|
359
|
-
// border-radius: 50%;
|
|
360
|
-
// }
|
|
361
|
-
|
|
362
|
-
// .aldicon-icon-left {
|
|
363
|
-
// svg {
|
|
364
|
-
// vertical-align: -2px;
|
|
365
|
-
// }
|
|
366
|
-
// }
|
|
367
|
-
|
|
368
|
-
// gap:@button-left-icon-margin-right-mini;
|
|
369
|
-
// // .aldicon-icon-left + span {
|
|
370
|
-
// // margin-left: @button-left-icon-margin-right-mini;
|
|
371
|
-
// // }
|
|
372
|
-
// }
|
|
373
319
|
}
|
|
374
320
|
}
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
background: #fff;
|
|
51
51
|
border: 1px solid #dbdbdb;
|
|
52
52
|
box-sizing: border-box;
|
|
53
|
-
box-shadow: 0 4px 6px -2px rgb(16 24 40 /
|
|
54
|
-
0 12px 16px -4px rgb(16 24 40 /
|
|
53
|
+
box-shadow: 0 4px 6px -2px rgb(16 24 40 / 0.03),
|
|
54
|
+
0 12px 16px -4px rgb(16 24 40 / 0.08);
|
|
55
55
|
border-radius: 2px;
|
|
56
56
|
padding: 8px 7px;
|
|
57
57
|
|
|
@@ -4,7 +4,8 @@ import React from 'react';
|
|
|
4
4
|
import { getUsersByIdsType, getUsersByKeywordsType } from './getUserList';
|
|
5
5
|
import useGetUserList from './hooks/useGetUserList';
|
|
6
6
|
import SizeContext from './sizeContext';
|
|
7
|
-
export
|
|
7
|
+
export { ConfigContext } from 'antd/lib/config-provider';
|
|
8
|
+
export type { ConfigConsumer, ConfigConsumerProps, configConsumerProps, CSPConfig, DirectionType, globalConfig, RenderEmptyHandler, } from 'antd/lib/config-provider/';
|
|
8
9
|
interface AldCustomConfigProviderProps extends ConfigProviderProps {
|
|
9
10
|
children?: React.ReactNode;
|
|
10
11
|
getUsersByIds?: getUsersByIdsType;
|
|
@@ -3,6 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import getUserListContext from "./getUserList";
|
|
4
4
|
import useGetUserList from "./hooks/useGetUserList";
|
|
5
5
|
import SizeContext from "./sizeContext";
|
|
6
|
+
export { ConfigContext } from 'antd/lib/config-provider';
|
|
6
7
|
|
|
7
8
|
var AldCustomConfigProvider = function AldCustomConfigProvider(props) {
|
|
8
9
|
var children = props.children,
|
|
@@ -35,10 +35,10 @@ function SkeletonBody(props) {
|
|
|
35
35
|
}, [rows, row]);
|
|
36
36
|
return /*#__PURE__*/React.createElement("div", {
|
|
37
37
|
className: "ald-data-preview-table-body"
|
|
38
|
-
}, datasource.slice(startRowIndex, endRowIndex).map(function (x, rowIndex) {
|
|
38
|
+
}, datasource.slice(startRowIndex, endRowIndex + 1).map(function (x, rowIndex) {
|
|
39
39
|
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
40
40
|
key: rowIndex
|
|
41
|
-
}, row.slice(startIndex, endIndex).map(function (cell, index) {
|
|
41
|
+
}, row.slice(startIndex, endIndex + 1).map(function (cell, index) {
|
|
42
42
|
var columnIndex = startIndex + index;
|
|
43
43
|
var style = {
|
|
44
44
|
height: CELL_HEIGHT,
|
|
@@ -24,13 +24,14 @@ function Body(props) {
|
|
|
24
24
|
startRowIndex = _props$rowRange[0],
|
|
25
25
|
endRowIndex = _props$rowRange[1];
|
|
26
26
|
|
|
27
|
+
console.log(columnLayout, columns, 'columnLayout---body');
|
|
27
28
|
return /*#__PURE__*/React.createElement("div", {
|
|
28
29
|
className: "ald-data-preview-table-body"
|
|
29
30
|
}, datasource.slice(startRowIndex, endRowIndex).map(function (row, rowIndex) {
|
|
30
31
|
var currentRowIndex = startRowIndex + rowIndex;
|
|
31
32
|
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
32
33
|
key: currentRowIndex
|
|
33
|
-
}, row.slice(startIndex, endIndex).map(function (cell, index) {
|
|
34
|
+
}, row.slice(startIndex, endIndex + 1).map(function (cell, index) {
|
|
34
35
|
var columnIndex = startIndex + index;
|
|
35
36
|
var style = {
|
|
36
37
|
height: CELL_HEIGHT,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { IColumnLayout, PreviewColumn } from '../../interface';
|
|
3
3
|
interface IHeader {
|
|
4
4
|
columns: PreviewColumn[];
|
|
5
5
|
columnLayout: IColumnLayout;
|
|
6
|
-
setWidth:
|
|
6
|
+
setWidth: (columnId: string, width: number) => void;
|
|
7
7
|
columnRange: [number, number];
|
|
8
8
|
}
|
|
9
9
|
export default function Header(props: IHeader): JSX.Element;
|
|
@@ -1,34 +1,26 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
2
|
|
|
3
|
-
function
|
|
3
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
4
|
|
|
5
5
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
6
|
|
|
7
|
-
function
|
|
7
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
8
8
|
|
|
9
|
-
function
|
|
9
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
10
10
|
|
|
11
|
-
function
|
|
11
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
12
|
|
|
13
|
-
import React
|
|
13
|
+
import React from 'react';
|
|
14
14
|
import { HEADER_HEIGHT } from "../../constant";
|
|
15
15
|
import DragBar from "../DragBar";
|
|
16
16
|
export default function Header(props) {
|
|
17
17
|
var columns = props.columns,
|
|
18
18
|
columnLayout = props.columnLayout,
|
|
19
19
|
setWidth = props.setWidth,
|
|
20
|
-
columnRange = props.columnRange
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return item.id === columnId;
|
|
24
|
-
});
|
|
25
|
-
setWidth(function (prev) {
|
|
26
|
-
var next = _toConsumableArray(prev);
|
|
20
|
+
_props$columnRange = _slicedToArray(props.columnRange, 2),
|
|
21
|
+
startIndex = _props$columnRange[0],
|
|
22
|
+
endIndex = _props$columnRange[1];
|
|
27
23
|
|
|
28
|
-
next[index] = width;
|
|
29
|
-
return next;
|
|
30
|
-
});
|
|
31
|
-
}, [columns, setWidth]);
|
|
32
24
|
return /*#__PURE__*/React.createElement("div", {
|
|
33
25
|
className: "ald-data-preview-header",
|
|
34
26
|
style: {
|
|
@@ -36,7 +28,7 @@ export default function Header(props) {
|
|
|
36
28
|
top: 0,
|
|
37
29
|
left: 0
|
|
38
30
|
}
|
|
39
|
-
}, columns.slice(
|
|
31
|
+
}, columns.slice(startIndex, endIndex + 1).map(function (column) {
|
|
40
32
|
var _column$renderHeader;
|
|
41
33
|
|
|
42
34
|
var innerCell = (_column$renderHeader = column.renderHeader) === null || _column$renderHeader === void 0 ? void 0 : _column$renderHeader.call(column, column);
|
|
@@ -62,7 +54,7 @@ export default function Header(props) {
|
|
|
62
54
|
})), /*#__PURE__*/React.createElement(DragBar, {
|
|
63
55
|
columnId: column.id,
|
|
64
56
|
wrapWidth: columnLayout[column.id].width,
|
|
65
|
-
onChange:
|
|
57
|
+
onChange: setWidth
|
|
66
58
|
}));
|
|
67
59
|
}));
|
|
68
60
|
}
|
|
@@ -1,28 +1,11 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
2
|
import { IColumnLayout, PreviewColumn } from '../interface';
|
|
3
|
-
export interface IScrollData {
|
|
4
|
-
scrollLeft: number;
|
|
5
|
-
scrollTop: number;
|
|
6
|
-
direction: IScrollDirection;
|
|
7
|
-
}
|
|
8
|
-
export interface IScrollDirection {
|
|
9
|
-
horizontal: EScrollHorizontalDirection;
|
|
10
|
-
vertical: EScrollVerticalDirection;
|
|
11
|
-
current: EScrollHorizontalDirection | EScrollVerticalDirection | 'init';
|
|
12
|
-
}
|
|
13
|
-
export declare enum EScrollHorizontalDirection {
|
|
14
|
-
SCROLL_TO_LEFT = "toLeft",
|
|
15
|
-
SCROLL_TO_RIGHT = "toRight"
|
|
16
|
-
}
|
|
17
|
-
export declare enum EScrollVerticalDirection {
|
|
18
|
-
SCROLL_TO_TOP = "toTop",
|
|
19
|
-
SCROLL_TO_BOTTOM = "toBottom"
|
|
20
|
-
}
|
|
21
3
|
export default function useDirection(columns: PreviewColumn[], wrapRef: RefObject<HTMLDivElement>): {
|
|
22
|
-
setRange: (scrollTop: number, scrollLeft: number) => void;
|
|
23
4
|
columnRange: [number, number];
|
|
24
5
|
rowRange: [number, number];
|
|
25
|
-
setColumnsWidth:
|
|
6
|
+
setColumnsWidth: (columnId: string, width: number) => void;
|
|
26
7
|
columnLayout: IColumnLayout;
|
|
27
|
-
|
|
8
|
+
contentWidth: number;
|
|
9
|
+
tableColumns: PreviewColumn[];
|
|
10
|
+
onScroll: () => void;
|
|
28
11
|
};
|