qbs-react-grid 2.2.0 → 2.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/qbs-react-grid.css +1 -1
- package/dist/css/qbs-react-grid.min.css +1 -1
- package/dist/css/qbs-react-grid.min.css.map +1 -1
- package/es/Cell.js +2 -1
- package/es/less/pagination.less +9 -9
- package/es/less/qbs-table.less +117 -37
- package/es/qbsTable/QbsTable.js +6 -1
- package/es/qbsTable/commontypes.d.ts +1 -0
- package/es/qbsTable/utilities/CardMenuDropdown.js +1 -2
- package/es/qbsTable/utilities/ToolTip.d.ts +8 -1
- package/es/qbsTable/utilities/ToolTip.js +106 -76
- package/es/qbsTable/utilities/VerticalDropDownMenu.js +3 -3
- package/es/qbsTable/utilities/icons.js +1 -1
- package/lib/Cell.js +2 -1
- package/lib/less/pagination.less +9 -9
- package/lib/less/qbs-table.less +117 -37
- package/lib/qbsTable/QbsTable.js +6 -1
- package/lib/qbsTable/commontypes.d.ts +1 -0
- package/lib/qbsTable/utilities/CardMenuDropdown.js +1 -2
- package/lib/qbsTable/utilities/ToolTip.d.ts +8 -1
- package/lib/qbsTable/utilities/ToolTip.js +106 -76
- package/lib/qbsTable/utilities/VerticalDropDownMenu.js +3 -3
- package/lib/qbsTable/utilities/icons.js +1 -1
- package/package.json +1 -1
- package/src/Cell.tsx +3 -1
- package/src/less/pagination.less +9 -9
- package/src/less/qbs-table.less +117 -37
- package/src/qbsTable/QbsTable.tsx +9 -1
- package/src/qbsTable/commontypes.ts +1 -0
- package/src/qbsTable/utilities/CardMenuDropdown.tsx +1 -1
- package/src/qbsTable/utilities/ToolTip.tsx +138 -77
- package/src/qbsTable/utilities/VerticalDropDownMenu.tsx +3 -3
- package/src/qbsTable/utilities/icons.tsx +1 -1
package/es/less/pagination.less
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
min-height: 40px;
|
|
6
6
|
align-items: center;
|
|
7
7
|
border-radius: 0 0 4px 4px;
|
|
8
|
-
border-top: 1px solid #d6d8dc;
|
|
9
|
-
background: #fff;
|
|
8
|
+
border-top: 1px solid var(--base-gray-border, #d6d8dc);
|
|
9
|
+
background: var(--table-bg, #fff);
|
|
10
10
|
&-header {
|
|
11
11
|
border-bottom: 1px solid #eee;
|
|
12
12
|
position: absolute;
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
font-weight: 500;
|
|
28
28
|
line-height: 20px;
|
|
29
29
|
border-radius: 6px;
|
|
30
|
-
border: 1px solid #d6d8dc;
|
|
31
|
-
background: #fff;
|
|
30
|
+
border: 1px solid var(--base-gray-border, #d6d8dc);
|
|
31
|
+
background: var(--gray-light-1, #fff);
|
|
32
32
|
}
|
|
33
33
|
.qbs-table-icon-container {
|
|
34
34
|
padding: 0;
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
font-style: normal;
|
|
110
110
|
font-weight: 500;
|
|
111
111
|
line-height: 20px;
|
|
112
|
-
color: #313131;
|
|
112
|
+
color: var(--gray-dark-3, #313131);
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
.custom-select-trigger {
|
|
126
126
|
padding: 2px 8px;
|
|
127
127
|
cursor: pointer;
|
|
128
|
-
border: 1px solid #d6d8dc;
|
|
128
|
+
border: 1px solid var(--base-gray-border, #d6d8dc);
|
|
129
129
|
border-radius: 4px;
|
|
130
130
|
min-width: 65px;
|
|
131
131
|
position: relative;
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
list-style: none;
|
|
141
141
|
margin: 2px 0 0;
|
|
142
142
|
padding: 0;
|
|
143
|
-
background: #fff;
|
|
143
|
+
background: var(--gray-light-1, #fff);
|
|
144
144
|
border-radius: 8px;
|
|
145
145
|
box-shadow: 0 8px 20px 0 #00000026;
|
|
146
146
|
}
|
|
@@ -158,7 +158,7 @@ ul.custom-select-options.top {
|
|
|
158
158
|
|
|
159
159
|
.custom-select-option:hover,
|
|
160
160
|
.custom-select-option.selected {
|
|
161
|
-
background-color: #f0f0f0;
|
|
161
|
+
background-color: var(--table-row-hover-bg, #f0f0f0);
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
.custom-select-trigger:before {
|
|
@@ -167,7 +167,7 @@ ul.custom-select-options.top {
|
|
|
167
167
|
right: 10px;
|
|
168
168
|
top: 6px;
|
|
169
169
|
font-weight: bold;
|
|
170
|
-
border: solid black;
|
|
170
|
+
border: solid var(--gray-dark-3, black);
|
|
171
171
|
border-width: 0 1px 1px 0;
|
|
172
172
|
display: inline-block;
|
|
173
173
|
padding: 3px;
|
package/es/less/qbs-table.less
CHANGED
|
@@ -202,6 +202,59 @@
|
|
|
202
202
|
background-color: #262626;
|
|
203
203
|
color: #f5f5f5;
|
|
204
204
|
}
|
|
205
|
+
|
|
206
|
+
.qbs-table[data-theme='dark'] {
|
|
207
|
+
.rs-table,
|
|
208
|
+
.rs-table-body-row-wrapper,
|
|
209
|
+
.rs-table-row,
|
|
210
|
+
.rs-table-cell,
|
|
211
|
+
.rs-table-cell-group,
|
|
212
|
+
.rs-table-row-header,
|
|
213
|
+
.rs-table-row-header .rs-table-cell {
|
|
214
|
+
background-color: #262626;
|
|
215
|
+
color: #f5f5f5;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.rs-table-cell-content {
|
|
219
|
+
background-color: #262626;
|
|
220
|
+
color: #f5f5f5;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.rs-table-row-header .rs-table-cell-content,
|
|
224
|
+
.rs-table-cell-header .rs-table-cell-content {
|
|
225
|
+
background-color: #1b2028;
|
|
226
|
+
color: #f5f5f5;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.rs-table-hover .rs-table-body-row-wrapper .rs-table-row:hover,
|
|
230
|
+
.rs-table-hover .rs-table-body-row-wrapper .rs-table-row:hover .rs-table-cell,
|
|
231
|
+
.rs-table-hover .rs-table-body-row-wrapper .rs-table-row:hover .rs-table-cell-content {
|
|
232
|
+
background-color: #1d2633;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.rs-table-cell {
|
|
236
|
+
border-color: #3d3d3d;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.rs-table-scrollbar {
|
|
240
|
+
background-color: #2d2d2d;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.rs-table-scrollbar-handle {
|
|
244
|
+
background-color: #5a5a5a;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.qbs-table[dir='rtl'] {
|
|
249
|
+
.rs-table-cell-header .rs-table-cell-content {
|
|
250
|
+
text-align: right;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.rs-table-cell-wrap {
|
|
254
|
+
justify-content: flex-start;
|
|
255
|
+
width: 100%;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
205
258
|
/* Dropdown container */
|
|
206
259
|
.qbs-table-menu-dropdown {
|
|
207
260
|
position: relative;
|
|
@@ -334,71 +387,98 @@
|
|
|
334
387
|
.qbs-table-tooltip {
|
|
335
388
|
cursor: pointer;
|
|
336
389
|
position: relative;
|
|
337
|
-
|
|
338
|
-
display: flex;
|
|
390
|
+
display: inline-flex;
|
|
339
391
|
}
|
|
340
392
|
|
|
341
393
|
.qbs-table-tooltip .tooltiptext {
|
|
342
394
|
visibility: hidden;
|
|
343
|
-
background-color:
|
|
344
|
-
color:
|
|
395
|
+
background-color: var(--tooltip-bg, #222);
|
|
396
|
+
color: var(--tooltip-text, #fff);
|
|
345
397
|
text-align: center;
|
|
346
|
-
padding: 6px;
|
|
347
|
-
border-radius:
|
|
398
|
+
padding: 6px 10px;
|
|
399
|
+
border-radius: 6px;
|
|
348
400
|
position: absolute;
|
|
349
|
-
z-index:
|
|
401
|
+
z-index: 10050;
|
|
350
402
|
opacity: 0;
|
|
351
|
-
transition: opacity 0.
|
|
403
|
+
transition: opacity 0.15s ease;
|
|
352
404
|
font-size: 12px;
|
|
353
|
-
font-
|
|
354
|
-
font-weight: 400;
|
|
405
|
+
font-weight: 500;
|
|
355
406
|
line-height: 16px;
|
|
356
|
-
|
|
357
|
-
max-width:
|
|
407
|
+
white-space: nowrap;
|
|
408
|
+
max-width: min(280px, 90vw);
|
|
409
|
+
pointer-events: none;
|
|
410
|
+
inset-inline-start: 50%;
|
|
411
|
+
translate: -50% 0;
|
|
358
412
|
}
|
|
359
413
|
|
|
360
414
|
.qbs-table-tooltip.up .tooltiptext {
|
|
361
|
-
bottom: calc(100% +
|
|
362
|
-
|
|
363
|
-
left: unset;
|
|
415
|
+
bottom: calc(100% + 8px);
|
|
416
|
+
top: auto;
|
|
364
417
|
}
|
|
365
418
|
|
|
366
419
|
.qbs-table-tooltip.down .tooltiptext {
|
|
367
|
-
right: -10px;
|
|
368
420
|
top: calc(100% + 8px);
|
|
421
|
+
bottom: auto;
|
|
369
422
|
}
|
|
370
423
|
|
|
371
|
-
// .qbs-table-tooltip:hover .tooltiptext {
|
|
372
|
-
// visibility: visible;
|
|
373
|
-
// opacity: 1;
|
|
374
|
-
// }
|
|
375
|
-
|
|
376
424
|
.qbs-table-tooltip .tooltiptext::after {
|
|
377
425
|
content: '';
|
|
378
426
|
position: absolute;
|
|
379
|
-
|
|
380
|
-
|
|
427
|
+
inset-inline-start: 50%;
|
|
428
|
+
translate: -50% 0;
|
|
429
|
+
border: 5px solid transparent;
|
|
381
430
|
}
|
|
382
431
|
|
|
383
432
|
.qbs-table-tooltip.up .tooltiptext::after {
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
margin-left: -5px !important;
|
|
387
|
-
top: 100% !important;
|
|
388
|
-
left: unset !important;
|
|
433
|
+
top: 100%;
|
|
434
|
+
border-top-color: var(--tooltip-bg, #222);
|
|
389
435
|
}
|
|
390
436
|
|
|
391
437
|
.qbs-table-tooltip.down .tooltiptext::after {
|
|
392
|
-
|
|
393
|
-
bottom:
|
|
394
|
-
right: 12px !important;
|
|
395
|
-
margin-left: -5px !important;
|
|
396
|
-
left: unset !important;
|
|
438
|
+
bottom: 100%;
|
|
439
|
+
border-bottom-color: var(--tooltip-bg, #222);
|
|
397
440
|
}
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
441
|
+
|
|
442
|
+
.qbs-table-tooltip-floating.tooltiptext {
|
|
443
|
+
position: fixed;
|
|
444
|
+
z-index: 10050;
|
|
445
|
+
visibility: hidden;
|
|
446
|
+
opacity: 0;
|
|
447
|
+
pointer-events: none;
|
|
448
|
+
background-color: var(--tooltip-bg, #222);
|
|
449
|
+
color: var(--tooltip-text, #fff);
|
|
450
|
+
text-align: center;
|
|
451
|
+
padding: 6px 10px;
|
|
452
|
+
border-radius: 6px;
|
|
453
|
+
font-size: 12px;
|
|
454
|
+
font-weight: 500;
|
|
455
|
+
line-height: 16px;
|
|
456
|
+
white-space: nowrap;
|
|
457
|
+
max-width: min(280px, 90vw);
|
|
458
|
+
transition: opacity 0.15s ease;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
.qbs-table-tooltip-floating.tooltiptext.is-positioned {
|
|
462
|
+
visibility: visible;
|
|
463
|
+
opacity: 1;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
.qbs-table-tooltip-floating.tooltiptext::after {
|
|
467
|
+
content: '';
|
|
468
|
+
position: absolute;
|
|
469
|
+
left: var(--tooltip-arrow-offset, 50%);
|
|
470
|
+
translate: -50% 0;
|
|
471
|
+
border: 5px solid transparent;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
.qbs-table-tooltip-floating--down.tooltiptext::after {
|
|
475
|
+
bottom: 100%;
|
|
476
|
+
border-bottom-color: var(--tooltip-bg, #222);
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
.qbs-table-tooltip-floating--up.tooltiptext::after {
|
|
480
|
+
top: 100%;
|
|
481
|
+
border-top-color: var(--tooltip-bg, #222);
|
|
402
482
|
}
|
|
403
483
|
.rs-table-row {
|
|
404
484
|
overflow: visible !important;
|
package/es/qbsTable/QbsTable.js
CHANGED
|
@@ -6,6 +6,7 @@ import ColumnGroup from '../ColumnGroup';
|
|
|
6
6
|
import HeaderCell from '../HeaderCell';
|
|
7
7
|
import Pagination from '../Pagination';
|
|
8
8
|
import Table from '../Table';
|
|
9
|
+
import isRTL from '../utils/isRTL';
|
|
9
10
|
import useResponsiveStore from '../utils/useResponsiveStore';
|
|
10
11
|
import { mergeLabels } from './labels';
|
|
11
12
|
import { ActionCell, CheckCell, CustomRowStatus, CustomTableCell, ExpandCell } from './CustomTableCell';
|
|
@@ -66,6 +67,7 @@ var QbsTable = function QbsTable(_ref) {
|
|
|
66
67
|
_ref$actionProps = _ref.actionProps,
|
|
67
68
|
actionProps = _ref$actionProps === void 0 ? [] : _ref$actionProps,
|
|
68
69
|
theme = _ref.theme,
|
|
70
|
+
rtlProp = _ref.rtl,
|
|
69
71
|
handleMenuActions = _ref.handleMenuActions,
|
|
70
72
|
onRowClick = _ref.onRowClick,
|
|
71
73
|
expandedRowKeys = _ref.expandedRowKeys,
|
|
@@ -146,6 +148,7 @@ var QbsTable = function QbsTable(_ref) {
|
|
|
146
148
|
var _ref2;
|
|
147
149
|
return (_ref2 = theme != null ? theme : typeof localStorage !== 'undefined' ? localStorage.getItem('theme') : null) != null ? _ref2 : 'light';
|
|
148
150
|
}, [theme]);
|
|
151
|
+
var rtl = rtlProp != null ? rtlProp : isRTL();
|
|
149
152
|
var _useState4 = useState(false),
|
|
150
153
|
isOpen = _useState4[0],
|
|
151
154
|
setIsOpen = _useState4[1];
|
|
@@ -611,7 +614,8 @@ var QbsTable = function QbsTable(_ref) {
|
|
|
611
614
|
};
|
|
612
615
|
return /*#__PURE__*/React.createElement("div", {
|
|
613
616
|
className: "qbs-table " + classes.tableContainerClass,
|
|
614
|
-
"data-theme": dataTheme
|
|
617
|
+
"data-theme": dataTheme,
|
|
618
|
+
dir: rtl ? 'rtl' : 'ltr'
|
|
615
619
|
}, toolbar && /*#__PURE__*/React.createElement(ToolBar, toolbarProps), /*#__PURE__*/React.createElement("div", {
|
|
616
620
|
className: "qbs-table-border-wrap"
|
|
617
621
|
}, tableViewToggle ? /*#__PURE__*/React.createElement(Table, {
|
|
@@ -619,6 +623,7 @@ var QbsTable = function QbsTable(_ref) {
|
|
|
619
623
|
key: tableKey + REFRESH_KEY,
|
|
620
624
|
tableKey: tableKey,
|
|
621
625
|
data: data,
|
|
626
|
+
rtl: rtl,
|
|
622
627
|
tableBodyRef: tableBodyRef,
|
|
623
628
|
dataTheme: dataTheme,
|
|
624
629
|
wordWrap: wordWrap,
|
|
@@ -67,8 +67,7 @@ var CardMenuDropdown = function CardMenuDropdown(_ref) {
|
|
|
67
67
|
ref: menuButtonRef
|
|
68
68
|
}, /*#__PURE__*/React.createElement(TooltipComponent, {
|
|
69
69
|
title: labels.actions,
|
|
70
|
-
enabled: false
|
|
71
|
-
ref: menuButtonRef
|
|
70
|
+
enabled: false
|
|
72
71
|
}, /*#__PURE__*/React.createElement(ThreeDotIcon, null))), openMenu && /*#__PURE__*/React.createElement("div", {
|
|
73
72
|
className: " qbs-card-dropdown rounded absolute right-0 mt-2 w-auto min-w-11 z-10 shadow-modalShadow bg-white dark:bg-[#424242] dark:text-white",
|
|
74
73
|
style: menuPositionStyles
|
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
type TooltipComponentProps = {
|
|
3
|
+
title?: React.ReactNode;
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
tableBodyRef?: React.RefObject<HTMLDivElement | null>;
|
|
6
|
+
/** When false, renders children only (no tooltip). */
|
|
7
|
+
enabled?: boolean;
|
|
8
|
+
};
|
|
9
|
+
declare const TooltipComponent: React.FC<TooltipComponentProps>;
|
|
3
10
|
export default TooltipComponent;
|
|
@@ -1,87 +1,117 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
// const dropRef = useRef(null);
|
|
6
|
-
// const menuButtonRef = useRef<HTMLElement>(null);
|
|
7
|
-
// const adjustDropdownPosition = () => {
|
|
8
|
-
// if (menuButtonRef.current && tableBodyRef?.current) {
|
|
9
|
-
// const inputBoxRect = menuButtonRef.current?.getBoundingClientRect();
|
|
10
|
-
// const tableRect = tableBodyRef.current.getBoundingClientRect();
|
|
11
|
-
// // Calculate positions relative to the table
|
|
12
|
-
// const spaceAbove = inputBoxRect.top - tableRect.top;
|
|
13
|
-
// const spaceBelow = tableRect.bottom - inputBoxRect.bottom;
|
|
14
|
-
|
|
15
|
-
// if (spaceAbove > spaceBelow) {
|
|
16
|
-
// setDropdownPosition('top-position');
|
|
17
|
-
// } else {
|
|
18
|
-
// setDropdownPosition('bottom-position');
|
|
19
|
-
// }
|
|
20
|
-
// }
|
|
21
|
-
// };
|
|
22
|
-
|
|
23
|
-
// return (
|
|
24
|
-
// <div className={`qbs-table-tooltip ${dropdownPosition == 'bottom-position' ? 'down' : 'up'} `}>
|
|
25
|
-
// <span
|
|
26
|
-
// ref={menuButtonRef}
|
|
27
|
-
// style={{ display: 'flex' }}
|
|
28
|
-
// onMouseEnter={() => adjustDropdownPosition()}
|
|
29
|
-
// >
|
|
30
|
-
// {children}
|
|
31
|
-
// </span>
|
|
32
|
-
// <span ref={dropRef} className={'tooltiptext'}>
|
|
33
|
-
// {title}
|
|
34
|
-
// </span>
|
|
35
|
-
// </div>
|
|
36
|
-
// );
|
|
37
|
-
// };
|
|
38
|
-
|
|
39
|
-
// export default TooltipComponent;
|
|
40
|
-
import React, { useRef, useState } from 'react';
|
|
1
|
+
import React, { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
2
|
+
import ReactDOM from 'react-dom';
|
|
3
|
+
var VIEWPORT_PADDING = 8;
|
|
4
|
+
var TOOLTIP_GAP = 8;
|
|
41
5
|
var TooltipComponent = function TooltipComponent(_ref) {
|
|
42
6
|
var title = _ref.title,
|
|
43
7
|
children = _ref.children,
|
|
44
|
-
tableBodyRef = _ref.tableBodyRef
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
8
|
+
tableBodyRef = _ref.tableBodyRef,
|
|
9
|
+
_ref$enabled = _ref.enabled,
|
|
10
|
+
enabled = _ref$enabled === void 0 ? true : _ref$enabled;
|
|
11
|
+
var _useState = useState(false),
|
|
12
|
+
visible = _useState[0],
|
|
13
|
+
setVisible = _useState[1];
|
|
14
|
+
var _useState2 = useState(false),
|
|
15
|
+
positioned = _useState2[0],
|
|
16
|
+
setPositioned = _useState2[1];
|
|
17
|
+
var _useState3 = useState('down'),
|
|
18
|
+
placement = _useState3[0],
|
|
19
|
+
setPlacement = _useState3[1];
|
|
20
|
+
var _useState4 = useState({
|
|
21
|
+
top: 0,
|
|
22
|
+
left: 0
|
|
23
|
+
}),
|
|
24
|
+
coords = _useState4[0],
|
|
25
|
+
setCoords = _useState4[1];
|
|
26
|
+
var _useState5 = useState(0),
|
|
27
|
+
arrowOffset = _useState5[0],
|
|
28
|
+
setArrowOffset = _useState5[1];
|
|
29
|
+
var triggerRef = useRef(null);
|
|
30
|
+
var tooltipRef = useRef(null);
|
|
31
|
+
var updatePosition = useCallback(function () {
|
|
32
|
+
var _tableBodyRef$current, _tableBodyRef$current2, _trigger$closest;
|
|
33
|
+
var trigger = triggerRef.current;
|
|
34
|
+
var tooltip = tooltipRef.current;
|
|
35
|
+
if (!trigger || !tooltip) {
|
|
36
|
+
return;
|
|
56
37
|
}
|
|
38
|
+
var triggerRect = trigger.getBoundingClientRect();
|
|
39
|
+
var tooltipRect = tooltip.getBoundingClientRect();
|
|
40
|
+
var boundaryRect = (_tableBodyRef$current = tableBodyRef === null || tableBodyRef === void 0 ? void 0 : (_tableBodyRef$current2 = tableBodyRef.current) === null || _tableBodyRef$current2 === void 0 ? void 0 : _tableBodyRef$current2.getBoundingClientRect()) != null ? _tableBodyRef$current : (_trigger$closest = trigger.closest('.qbs-table')) === null || _trigger$closest === void 0 ? void 0 : _trigger$closest.getBoundingClientRect();
|
|
41
|
+
var spaceAbove = boundaryRect ? triggerRect.top - boundaryRect.top : triggerRect.top;
|
|
42
|
+
var spaceBelow = boundaryRect ? boundaryRect.bottom - triggerRect.bottom : window.innerHeight - triggerRect.bottom;
|
|
43
|
+
var nextPlacement = spaceBelow >= tooltipRect.height + TOOLTIP_GAP || spaceBelow >= spaceAbove ? 'down' : 'up';
|
|
44
|
+
var triggerCenter = triggerRect.left + triggerRect.width / 2;
|
|
45
|
+
var left = triggerCenter - tooltipRect.width / 2;
|
|
46
|
+
if (left < VIEWPORT_PADDING) {
|
|
47
|
+
left = VIEWPORT_PADDING;
|
|
48
|
+
} else if (left + tooltipRect.width > window.innerWidth - VIEWPORT_PADDING) {
|
|
49
|
+
left = window.innerWidth - VIEWPORT_PADDING - tooltipRect.width;
|
|
50
|
+
}
|
|
51
|
+
var top = nextPlacement === 'down' ? triggerRect.bottom + TOOLTIP_GAP : triggerRect.top - tooltipRect.height - TOOLTIP_GAP;
|
|
52
|
+
setPlacement(nextPlacement);
|
|
53
|
+
setCoords({
|
|
54
|
+
top: top,
|
|
55
|
+
left: left
|
|
56
|
+
});
|
|
57
|
+
setArrowOffset(triggerCenter - left);
|
|
58
|
+
setPositioned(true);
|
|
59
|
+
}, [tableBodyRef]);
|
|
60
|
+
var showTooltip = function showTooltip() {
|
|
61
|
+
setPositioned(false);
|
|
62
|
+
setVisible(true);
|
|
63
|
+
};
|
|
64
|
+
var hideTooltip = function hideTooltip() {
|
|
65
|
+
setVisible(false);
|
|
66
|
+
setPositioned(false);
|
|
57
67
|
};
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
onMouseLeave: function onMouseLeave() {
|
|
62
|
-
var _menuButtonRef$curren;
|
|
63
|
-
var tooltip = menuButtonRef === null || menuButtonRef === void 0 ? void 0 : (_menuButtonRef$curren = menuButtonRef.current) === null || _menuButtonRef$curren === void 0 ? void 0 : _menuButtonRef$curren.querySelector('.tooltiptext');
|
|
64
|
-
if (tooltip) {
|
|
65
|
-
tooltip.style.visibility = 'hidden';
|
|
66
|
-
tooltip.style.opacity = '0';
|
|
67
|
-
}
|
|
68
|
+
useLayoutEffect(function () {
|
|
69
|
+
if (!visible) {
|
|
70
|
+
return;
|
|
68
71
|
}
|
|
69
|
-
|
|
70
|
-
|
|
72
|
+
updatePosition();
|
|
73
|
+
var frame = window.requestAnimationFrame(updatePosition);
|
|
74
|
+
return function () {
|
|
75
|
+
return window.cancelAnimationFrame(frame);
|
|
76
|
+
};
|
|
77
|
+
}, [visible, title, updatePosition]);
|
|
78
|
+
useEffect(function () {
|
|
79
|
+
if (!visible) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
var handleReposition = function handleReposition() {
|
|
83
|
+
return updatePosition();
|
|
84
|
+
};
|
|
85
|
+
window.addEventListener('resize', handleReposition);
|
|
86
|
+
window.addEventListener('scroll', handleReposition, true);
|
|
87
|
+
return function () {
|
|
88
|
+
window.removeEventListener('resize', handleReposition);
|
|
89
|
+
window.removeEventListener('scroll', handleReposition, true);
|
|
90
|
+
};
|
|
91
|
+
}, [visible, updatePosition]);
|
|
92
|
+
if (!title || enabled === false) {
|
|
93
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
94
|
+
}
|
|
95
|
+
var portalRoot = typeof document !== 'undefined' ? document.body : null;
|
|
96
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
97
|
+
ref: triggerRef,
|
|
98
|
+
className: "qbs-table-tooltip-trigger",
|
|
71
99
|
style: {
|
|
72
|
-
display: 'flex'
|
|
100
|
+
display: 'inline-flex'
|
|
73
101
|
},
|
|
74
|
-
onMouseEnter:
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
102
|
+
onMouseEnter: showTooltip,
|
|
103
|
+
onMouseLeave: hideTooltip,
|
|
104
|
+
onFocus: showTooltip,
|
|
105
|
+
onBlur: hideTooltip
|
|
106
|
+
}, children), visible && portalRoot && /*#__PURE__*/ReactDOM.createPortal(/*#__PURE__*/React.createElement("span", {
|
|
107
|
+
ref: tooltipRef,
|
|
108
|
+
role: "tooltip",
|
|
109
|
+
className: "qbs-table-tooltip-floating tooltiptext qbs-table-tooltip-floating--" + placement + " " + (positioned ? 'is-positioned' : ''),
|
|
110
|
+
style: {
|
|
111
|
+
top: coords.top,
|
|
112
|
+
left: coords.left,
|
|
113
|
+
'--tooltip-arrow-offset': arrowOffset + "px"
|
|
82
114
|
}
|
|
83
|
-
},
|
|
84
|
-
className: "tooltiptext"
|
|
85
|
-
}, title)));
|
|
115
|
+
}, title), portalRoot));
|
|
86
116
|
};
|
|
87
117
|
export default TooltipComponent;
|
|
@@ -123,7 +123,7 @@ var VerticalMenuDropdown = function VerticalMenuDropdown(_ref) {
|
|
|
123
123
|
};
|
|
124
124
|
var portalTarget = document.getElementById('portal-root');
|
|
125
125
|
var dropdownContent = /*#__PURE__*/React.createElement("div", {
|
|
126
|
-
className: "absolute z-
|
|
126
|
+
className: "absolute z-[60] min-w-48 rounded-md vertical-menu-dropdown-content",
|
|
127
127
|
ref: menuRef,
|
|
128
128
|
style: {
|
|
129
129
|
width: 200,
|
|
@@ -137,7 +137,7 @@ var VerticalMenuDropdown = function VerticalMenuDropdown(_ref) {
|
|
|
137
137
|
var _item$hide3;
|
|
138
138
|
return !(item !== null && item !== void 0 && item.hidden) && !(item !== null && item !== void 0 && (_item$hide3 = item.hide) !== null && _item$hide3 !== void 0 && _item$hide3.call(item, rowData, rowIndex)) ? /*#__PURE__*/React.createElement("div", {
|
|
139
139
|
key: item.title,
|
|
140
|
-
className: "vertical-menu-item px-4 py-2 text-sm text-
|
|
140
|
+
className: "vertical-menu-item px-4 py-2 text-sm text-base-black hover:bg-gray-light-1 cursor-pointer flex items-center gap-2 transition-colors",
|
|
141
141
|
onClick: function onClick(e) {
|
|
142
142
|
var _item$action;
|
|
143
143
|
e.preventDefault();
|
|
@@ -158,7 +158,7 @@ var VerticalMenuDropdown = function VerticalMenuDropdown(_ref) {
|
|
|
158
158
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
159
159
|
className: "inline-block vertical-menu-dropdown-wrapper"
|
|
160
160
|
}, handleShowHideMenu() > 0 && /*#__PURE__*/React.createElement("button", {
|
|
161
|
-
className: "vertical-menu-trigger-button p-2 rounded hover:bg-gray-
|
|
161
|
+
className: "vertical-menu-trigger-button p-2 rounded text-base-gray hover:bg-gray-light-1 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary",
|
|
162
162
|
onClick: toggleMenu,
|
|
163
163
|
ref: menuButtonRef
|
|
164
164
|
}, /*#__PURE__*/React.createElement(ThreeDotIcon, null))), openMenu && portalTarget && /*#__PURE__*/ReactDOM.createPortal(dropdownContent, portalTarget));
|
|
@@ -8,7 +8,7 @@ export var ThreeDotIcon = function ThreeDotIcon() {
|
|
|
8
8
|
xmlns: "http://www.w3.org/2000/svg"
|
|
9
9
|
}, /*#__PURE__*/React.createElement("path", {
|
|
10
10
|
d: "M2 2.16665L2 2.17498M2 7.99998L2 8.00831M2 13.8333L2 13.8416M2 2.99998C1.53976 2.99998 1.16667 2.62688 1.16667 2.16665C1.16667 1.70641 1.53976 1.33331 2 1.33331C2.46024 1.33331 2.83333 1.70641 2.83333 2.16665C2.83333 2.62688 2.46024 2.99998 2 2.99998ZM2 8.83331C1.53976 8.83331 1.16667 8.46022 1.16667 7.99998C1.16667 7.53974 1.53976 7.16665 2 7.16665C2.46024 7.16665 2.83333 7.53974 2.83333 7.99998C2.83333 8.46022 2.46024 8.83331 2 8.83331ZM2 14.6666C1.53976 14.6666 1.16666 14.2935 1.16666 13.8333C1.16666 13.3731 1.53976 13 2 13C2.46024 13 2.83333 13.3731 2.83333 13.8333C2.83333 14.2935 2.46024 14.6666 2 14.6666Z",
|
|
11
|
-
stroke: "
|
|
11
|
+
stroke: "currentColor",
|
|
12
12
|
strokeWidth: "1.5",
|
|
13
13
|
strokeLinecap: "round",
|
|
14
14
|
strokeLinejoin: "round"
|
package/lib/Cell.js
CHANGED
|
@@ -86,10 +86,11 @@ var Cell = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
|
86
86
|
var nextHeight = isHeaderCell ? headerHeight : cellHeight;
|
|
87
87
|
var styles = (0, _extends4["default"])({}, predefinedStyle, (_extends2 = {}, _extends2[fullText ? 'minWidth' : 'width'] = width, _extends2.height = nextHeight, _extends2.zIndex = depth, _extends2[rtl ? 'right' : 'left'] = left, _extends2));
|
|
88
88
|
var paddingKey = rtl ? 'paddingRight' : 'paddingLeft';
|
|
89
|
+
var resolvedAlign = rtl && align === 'left' ? 'right' : rtl && align === 'right' ? 'left' : align;
|
|
89
90
|
var contentStyles = (0, _extends4["default"])({}, style, (_extends3 = {
|
|
90
91
|
width: fullText ? width - 1 : width,
|
|
91
92
|
height: nextHeight,
|
|
92
|
-
textAlign:
|
|
93
|
+
textAlign: resolvedAlign
|
|
93
94
|
}, _extends3[paddingKey] = isTreeCol ? depth * _constants.LAYER_WIDTH + 10 : (style === null || style === void 0 ? void 0 : style[paddingKey]) || (style === null || style === void 0 ? void 0 : style.padding), _extends3));
|
|
94
95
|
if (verticalAlign) {
|
|
95
96
|
contentStyles.display = 'table-cell';
|
package/lib/less/pagination.less
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
min-height: 40px;
|
|
6
6
|
align-items: center;
|
|
7
7
|
border-radius: 0 0 4px 4px;
|
|
8
|
-
border-top: 1px solid #d6d8dc;
|
|
9
|
-
background: #fff;
|
|
8
|
+
border-top: 1px solid var(--base-gray-border, #d6d8dc);
|
|
9
|
+
background: var(--table-bg, #fff);
|
|
10
10
|
&-header {
|
|
11
11
|
border-bottom: 1px solid #eee;
|
|
12
12
|
position: absolute;
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
font-weight: 500;
|
|
28
28
|
line-height: 20px;
|
|
29
29
|
border-radius: 6px;
|
|
30
|
-
border: 1px solid #d6d8dc;
|
|
31
|
-
background: #fff;
|
|
30
|
+
border: 1px solid var(--base-gray-border, #d6d8dc);
|
|
31
|
+
background: var(--gray-light-1, #fff);
|
|
32
32
|
}
|
|
33
33
|
.qbs-table-icon-container {
|
|
34
34
|
padding: 0;
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
font-style: normal;
|
|
110
110
|
font-weight: 500;
|
|
111
111
|
line-height: 20px;
|
|
112
|
-
color: #313131;
|
|
112
|
+
color: var(--gray-dark-3, #313131);
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
.custom-select-trigger {
|
|
126
126
|
padding: 2px 8px;
|
|
127
127
|
cursor: pointer;
|
|
128
|
-
border: 1px solid #d6d8dc;
|
|
128
|
+
border: 1px solid var(--base-gray-border, #d6d8dc);
|
|
129
129
|
border-radius: 4px;
|
|
130
130
|
min-width: 65px;
|
|
131
131
|
position: relative;
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
list-style: none;
|
|
141
141
|
margin: 2px 0 0;
|
|
142
142
|
padding: 0;
|
|
143
|
-
background: #fff;
|
|
143
|
+
background: var(--gray-light-1, #fff);
|
|
144
144
|
border-radius: 8px;
|
|
145
145
|
box-shadow: 0 8px 20px 0 #00000026;
|
|
146
146
|
}
|
|
@@ -158,7 +158,7 @@ ul.custom-select-options.top {
|
|
|
158
158
|
|
|
159
159
|
.custom-select-option:hover,
|
|
160
160
|
.custom-select-option.selected {
|
|
161
|
-
background-color: #f0f0f0;
|
|
161
|
+
background-color: var(--table-row-hover-bg, #f0f0f0);
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
.custom-select-trigger:before {
|
|
@@ -167,7 +167,7 @@ ul.custom-select-options.top {
|
|
|
167
167
|
right: 10px;
|
|
168
168
|
top: 6px;
|
|
169
169
|
font-weight: bold;
|
|
170
|
-
border: solid black;
|
|
170
|
+
border: solid var(--gray-dark-3, black);
|
|
171
171
|
border-width: 0 1px 1px 0;
|
|
172
172
|
display: inline-block;
|
|
173
173
|
padding: 3px;
|