@oliasoft-open-source/react-ui-library 2.4.3 → 2.4.5
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/package.json +1 -1
- package/src/components/drawer/drawer-resize-wrapper.jsx +4 -1
- package/src/components/drawer/drawer.module.less +11 -4
- package/src/components/table/table-scroll-wrapper.jsx +4 -3
- package/src/components/table/table.module.less +1 -0
- package/src/components/table/table.stories-data.jsx +17 -1
- package/src/components/table/table.stories.jsx +27 -2
package/package.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
+
import { FaGripLinesVertical } from 'react-icons/fa';
|
|
2
3
|
import { Resizable } from 'react-resizable';
|
|
3
4
|
import PropTypes from 'prop-types';
|
|
4
5
|
import styles from './drawer.module.less';
|
|
@@ -10,7 +11,9 @@ const ResizeHandle = React.forwardRef((props, ref) => {
|
|
|
10
11
|
ref={ref}
|
|
11
12
|
className={styles.resizeHandle}
|
|
12
13
|
{...rest} // eslint-disable-line react/jsx-props-no-spreading
|
|
13
|
-
|
|
14
|
+
>
|
|
15
|
+
<FaGripLinesVertical />
|
|
16
|
+
</div>
|
|
14
17
|
);
|
|
15
18
|
});
|
|
16
19
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
@import '../../style/variables.less';
|
|
2
2
|
|
|
3
3
|
:root {
|
|
4
|
-
--color-background-drawer-tabs: var(--color-neutral-
|
|
4
|
+
--color-background-drawer-tabs: var(--color-neutral-50);
|
|
5
5
|
--color-background-drawer-tab: #fff9f4;
|
|
6
6
|
--color-background-drawer-tab-hover: white;
|
|
7
7
|
--color-border-drawer-tab: #e4cbb7;
|
|
@@ -188,16 +188,23 @@ html[data-theme='dark'] {
|
|
|
188
188
|
position: absolute;
|
|
189
189
|
top: 0;
|
|
190
190
|
bottom: 0;
|
|
191
|
-
width:
|
|
191
|
+
width: 10px;
|
|
192
192
|
z-index: @zindex_drawer + 2;
|
|
193
193
|
cursor: ew-resize;
|
|
194
|
+
display: flex;
|
|
195
|
+
align-items: center;
|
|
196
|
+
color: var(--color-text-faint);
|
|
197
|
+
font-size: 12px;
|
|
198
|
+
transition: all 0.2s;
|
|
194
199
|
|
|
195
200
|
&:hover {
|
|
196
|
-
background: rgba(@colorPrimary, 0.
|
|
201
|
+
background: rgba(@colorPrimary, 0.15);
|
|
202
|
+
color: var(--color-text-primary);
|
|
197
203
|
}
|
|
198
204
|
|
|
199
205
|
&:active {
|
|
200
|
-
background:
|
|
206
|
+
background: var(--color-text-primary);
|
|
207
|
+
color: white;
|
|
201
208
|
}
|
|
202
209
|
|
|
203
210
|
.left & {
|
|
@@ -23,20 +23,21 @@ export const TableScrollWrapper = ({ table, children }) => {
|
|
|
23
23
|
|
|
24
24
|
return (
|
|
25
25
|
<div
|
|
26
|
+
id="scrollWrapper"
|
|
26
27
|
className={cx(
|
|
27
28
|
styles.scrollWrapper,
|
|
28
29
|
bordered ? styles.bordered : '',
|
|
29
30
|
maxHeight ? styles.maxHeight : '',
|
|
30
31
|
)}
|
|
31
|
-
style={{ maxHeight
|
|
32
|
+
style={{ maxHeight }}
|
|
32
33
|
>
|
|
33
34
|
{infiniteScroll ? (
|
|
34
35
|
<InfiniteScroll
|
|
35
36
|
dataLength={Math.min(rows.length, visibleRows + pageSize)} // Doesn't work with rows.length for some reason
|
|
36
37
|
next={loadMoreItems}
|
|
37
38
|
hasMore={hasMore}
|
|
38
|
-
|
|
39
|
-
style={{
|
|
39
|
+
scrollableTarget="scrollWrapper"
|
|
40
|
+
style={{ overflow: 'initial' }}
|
|
40
41
|
>
|
|
41
42
|
{children({ visibleRows })}
|
|
42
43
|
</InfiniteScroll>
|
|
@@ -170,6 +170,23 @@ export const tableInfiniteScroll = {
|
|
|
170
170
|
},
|
|
171
171
|
};
|
|
172
172
|
|
|
173
|
+
export const tableInfiniteScrollFullHeight = {
|
|
174
|
+
...tableInfiniteScroll,
|
|
175
|
+
maxHeight: '100%',
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
export const tableInfiniteScrollShort = {
|
|
179
|
+
...tableInfiniteScroll,
|
|
180
|
+
rows: Array.from({ length: 1 }, (_, index) => ({
|
|
181
|
+
cells: [
|
|
182
|
+
{ type: 'Input', value: `Strawberry Letter ${index + 1}` },
|
|
183
|
+
{ type: 'Input', value: 100 },
|
|
184
|
+
{ type: 'Input', value: 361 },
|
|
185
|
+
{ type: 'Input', value: 'Vietnam' },
|
|
186
|
+
],
|
|
187
|
+
})),
|
|
188
|
+
};
|
|
189
|
+
|
|
173
190
|
export const tableInfiniteScrollDnD = {
|
|
174
191
|
...tableInfiniteScroll,
|
|
175
192
|
draggable: true,
|
|
@@ -454,7 +471,6 @@ export const tableStickyHeaders = {
|
|
|
454
471
|
};
|
|
455
472
|
|
|
456
473
|
export const tableSort = {
|
|
457
|
-
fixedWidth: '100%',
|
|
458
474
|
headers: [
|
|
459
475
|
{
|
|
460
476
|
cells: [
|
|
@@ -78,11 +78,36 @@ StickyHeaders.args = {
|
|
|
78
78
|
table: storyData.tableStickyHeaders,
|
|
79
79
|
};
|
|
80
80
|
|
|
81
|
-
export const
|
|
82
|
-
|
|
81
|
+
export const InfiniteScrollFixedHeight = Template.bind({});
|
|
82
|
+
InfiniteScrollFixedHeight.args = {
|
|
83
83
|
table: storyData.tableInfiniteScroll,
|
|
84
84
|
};
|
|
85
85
|
|
|
86
|
+
export const InfiniteScrollFullHeight = Template.bind({});
|
|
87
|
+
InfiniteScrollFullHeight.args = {
|
|
88
|
+
table: storyData.tableInfiniteScrollFullHeight,
|
|
89
|
+
};
|
|
90
|
+
InfiniteScrollFullHeight.decorators = [
|
|
91
|
+
(Story) => (
|
|
92
|
+
<div style={{ height: 800 }}>
|
|
93
|
+
<Story />
|
|
94
|
+
</div>
|
|
95
|
+
),
|
|
96
|
+
];
|
|
97
|
+
|
|
98
|
+
export const InfiniteScrollShort = Template.bind({});
|
|
99
|
+
InfiniteScrollShort.args = {
|
|
100
|
+
table: storyData.tableInfiniteScrollShort,
|
|
101
|
+
};
|
|
102
|
+
InfiniteScrollShort.parameters = {
|
|
103
|
+
docs: {
|
|
104
|
+
description: {
|
|
105
|
+
story:
|
|
106
|
+
'If a `maxHeight` is set, the table should only fill that height if it needs to.',
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
};
|
|
110
|
+
|
|
86
111
|
export const InfiniteScrollWithDragAndDrop = Template.bind({});
|
|
87
112
|
InfiniteScrollWithDragAndDrop.args = {
|
|
88
113
|
table: storyData.tableInfiniteScrollDnD,
|