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/lib/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/lib/qbsTable/QbsTable.js
CHANGED
|
@@ -11,6 +11,7 @@ var _ColumnGroup = _interopRequireDefault(require("../ColumnGroup"));
|
|
|
11
11
|
var _HeaderCell = _interopRequireDefault(require("../HeaderCell"));
|
|
12
12
|
var _Pagination = _interopRequireDefault(require("../Pagination"));
|
|
13
13
|
var _Table = _interopRequireDefault(require("../Table"));
|
|
14
|
+
var _isRTL = _interopRequireDefault(require("../utils/isRTL"));
|
|
14
15
|
var _useResponsiveStore = _interopRequireDefault(require("../utils/useResponsiveStore"));
|
|
15
16
|
var _labels = require("./labels");
|
|
16
17
|
var _CustomTableCell = require("./CustomTableCell");
|
|
@@ -72,6 +73,7 @@ var QbsTable = function QbsTable(_ref) {
|
|
|
72
73
|
_ref$actionProps = _ref.actionProps,
|
|
73
74
|
actionProps = _ref$actionProps === void 0 ? [] : _ref$actionProps,
|
|
74
75
|
theme = _ref.theme,
|
|
76
|
+
rtlProp = _ref.rtl,
|
|
75
77
|
handleMenuActions = _ref.handleMenuActions,
|
|
76
78
|
onRowClick = _ref.onRowClick,
|
|
77
79
|
expandedRowKeys = _ref.expandedRowKeys,
|
|
@@ -152,6 +154,7 @@ var QbsTable = function QbsTable(_ref) {
|
|
|
152
154
|
var _ref2;
|
|
153
155
|
return (_ref2 = theme != null ? theme : typeof localStorage !== 'undefined' ? localStorage.getItem('theme') : null) != null ? _ref2 : 'light';
|
|
154
156
|
}, [theme]);
|
|
157
|
+
var rtl = rtlProp != null ? rtlProp : (0, _isRTL["default"])();
|
|
155
158
|
var _useState4 = (0, _react.useState)(false),
|
|
156
159
|
isOpen = _useState4[0],
|
|
157
160
|
setIsOpen = _useState4[1];
|
|
@@ -617,7 +620,8 @@ var QbsTable = function QbsTable(_ref) {
|
|
|
617
620
|
};
|
|
618
621
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
619
622
|
className: "qbs-table " + classes.tableContainerClass,
|
|
620
|
-
"data-theme": dataTheme
|
|
623
|
+
"data-theme": dataTheme,
|
|
624
|
+
dir: rtl ? 'rtl' : 'ltr'
|
|
621
625
|
}, toolbar && /*#__PURE__*/_react["default"].createElement(_Toolbar["default"], toolbarProps), /*#__PURE__*/_react["default"].createElement("div", {
|
|
622
626
|
className: "qbs-table-border-wrap"
|
|
623
627
|
}, tableViewToggle ? /*#__PURE__*/_react["default"].createElement(_Table["default"], {
|
|
@@ -625,6 +629,7 @@ var QbsTable = function QbsTable(_ref) {
|
|
|
625
629
|
key: tableKey + REFRESH_KEY,
|
|
626
630
|
tableKey: tableKey,
|
|
627
631
|
data: data,
|
|
632
|
+
rtl: rtl,
|
|
628
633
|
tableBodyRef: tableBodyRef,
|
|
629
634
|
dataTheme: dataTheme,
|
|
630
635
|
wordWrap: wordWrap,
|
|
@@ -74,8 +74,7 @@ var CardMenuDropdown = function CardMenuDropdown(_ref) {
|
|
|
74
74
|
ref: menuButtonRef
|
|
75
75
|
}, /*#__PURE__*/_react["default"].createElement(_ToolTip["default"], {
|
|
76
76
|
title: labels.actions,
|
|
77
|
-
enabled: false
|
|
78
|
-
ref: menuButtonRef
|
|
77
|
+
enabled: false
|
|
79
78
|
}, /*#__PURE__*/_react["default"].createElement(_icons.ThreeDotIcon, null))), openMenu && /*#__PURE__*/_react["default"].createElement("div", {
|
|
80
79
|
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",
|
|
81
80
|
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,95 +1,125 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
exports.__esModule = true;
|
|
4
5
|
exports["default"] = void 0;
|
|
5
6
|
var _react = _interopRequireWildcard(require("react"));
|
|
7
|
+
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
6
8
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
7
9
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
// const TooltipComponent: React.FC<any> = ({ title, children, tableBodyRef }) => {
|
|
11
|
-
// const [dropdownPosition, setDropdownPosition] = useState('bottom-position');
|
|
12
|
-
// const dropRef = useRef(null);
|
|
13
|
-
// const menuButtonRef = useRef<HTMLElement>(null);
|
|
14
|
-
// const adjustDropdownPosition = () => {
|
|
15
|
-
// if (menuButtonRef.current && tableBodyRef?.current) {
|
|
16
|
-
// const inputBoxRect = menuButtonRef.current?.getBoundingClientRect();
|
|
17
|
-
// const tableRect = tableBodyRef.current.getBoundingClientRect();
|
|
18
|
-
// // Calculate positions relative to the table
|
|
19
|
-
// const spaceAbove = inputBoxRect.top - tableRect.top;
|
|
20
|
-
// const spaceBelow = tableRect.bottom - inputBoxRect.bottom;
|
|
21
|
-
|
|
22
|
-
// if (spaceAbove > spaceBelow) {
|
|
23
|
-
// setDropdownPosition('top-position');
|
|
24
|
-
// } else {
|
|
25
|
-
// setDropdownPosition('bottom-position');
|
|
26
|
-
// }
|
|
27
|
-
// }
|
|
28
|
-
// };
|
|
29
|
-
|
|
30
|
-
// return (
|
|
31
|
-
// <div className={`qbs-table-tooltip ${dropdownPosition == 'bottom-position' ? 'down' : 'up'} `}>
|
|
32
|
-
// <span
|
|
33
|
-
// ref={menuButtonRef}
|
|
34
|
-
// style={{ display: 'flex' }}
|
|
35
|
-
// onMouseEnter={() => adjustDropdownPosition()}
|
|
36
|
-
// >
|
|
37
|
-
// {children}
|
|
38
|
-
// </span>
|
|
39
|
-
// <span ref={dropRef} className={'tooltiptext'}>
|
|
40
|
-
// {title}
|
|
41
|
-
// </span>
|
|
42
|
-
// </div>
|
|
43
|
-
// );
|
|
44
|
-
// };
|
|
45
|
-
|
|
46
|
-
// export default TooltipComponent;
|
|
47
|
-
|
|
10
|
+
var VIEWPORT_PADDING = 8;
|
|
11
|
+
var TOOLTIP_GAP = 8;
|
|
48
12
|
var TooltipComponent = function TooltipComponent(_ref) {
|
|
49
13
|
var title = _ref.title,
|
|
50
14
|
children = _ref.children,
|
|
51
|
-
tableBodyRef = _ref.tableBodyRef
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
15
|
+
tableBodyRef = _ref.tableBodyRef,
|
|
16
|
+
_ref$enabled = _ref.enabled,
|
|
17
|
+
enabled = _ref$enabled === void 0 ? true : _ref$enabled;
|
|
18
|
+
var _useState = (0, _react.useState)(false),
|
|
19
|
+
visible = _useState[0],
|
|
20
|
+
setVisible = _useState[1];
|
|
21
|
+
var _useState2 = (0, _react.useState)(false),
|
|
22
|
+
positioned = _useState2[0],
|
|
23
|
+
setPositioned = _useState2[1];
|
|
24
|
+
var _useState3 = (0, _react.useState)('down'),
|
|
25
|
+
placement = _useState3[0],
|
|
26
|
+
setPlacement = _useState3[1];
|
|
27
|
+
var _useState4 = (0, _react.useState)({
|
|
28
|
+
top: 0,
|
|
29
|
+
left: 0
|
|
30
|
+
}),
|
|
31
|
+
coords = _useState4[0],
|
|
32
|
+
setCoords = _useState4[1];
|
|
33
|
+
var _useState5 = (0, _react.useState)(0),
|
|
34
|
+
arrowOffset = _useState5[0],
|
|
35
|
+
setArrowOffset = _useState5[1];
|
|
36
|
+
var triggerRef = (0, _react.useRef)(null);
|
|
37
|
+
var tooltipRef = (0, _react.useRef)(null);
|
|
38
|
+
var updatePosition = (0, _react.useCallback)(function () {
|
|
39
|
+
var _tableBodyRef$current, _tableBodyRef$current2, _trigger$closest;
|
|
40
|
+
var trigger = triggerRef.current;
|
|
41
|
+
var tooltip = tooltipRef.current;
|
|
42
|
+
if (!trigger || !tooltip) {
|
|
43
|
+
return;
|
|
63
44
|
}
|
|
45
|
+
var triggerRect = trigger.getBoundingClientRect();
|
|
46
|
+
var tooltipRect = tooltip.getBoundingClientRect();
|
|
47
|
+
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();
|
|
48
|
+
var spaceAbove = boundaryRect ? triggerRect.top - boundaryRect.top : triggerRect.top;
|
|
49
|
+
var spaceBelow = boundaryRect ? boundaryRect.bottom - triggerRect.bottom : window.innerHeight - triggerRect.bottom;
|
|
50
|
+
var nextPlacement = spaceBelow >= tooltipRect.height + TOOLTIP_GAP || spaceBelow >= spaceAbove ? 'down' : 'up';
|
|
51
|
+
var triggerCenter = triggerRect.left + triggerRect.width / 2;
|
|
52
|
+
var left = triggerCenter - tooltipRect.width / 2;
|
|
53
|
+
if (left < VIEWPORT_PADDING) {
|
|
54
|
+
left = VIEWPORT_PADDING;
|
|
55
|
+
} else if (left + tooltipRect.width > window.innerWidth - VIEWPORT_PADDING) {
|
|
56
|
+
left = window.innerWidth - VIEWPORT_PADDING - tooltipRect.width;
|
|
57
|
+
}
|
|
58
|
+
var top = nextPlacement === 'down' ? triggerRect.bottom + TOOLTIP_GAP : triggerRect.top - tooltipRect.height - TOOLTIP_GAP;
|
|
59
|
+
setPlacement(nextPlacement);
|
|
60
|
+
setCoords({
|
|
61
|
+
top: top,
|
|
62
|
+
left: left
|
|
63
|
+
});
|
|
64
|
+
setArrowOffset(triggerCenter - left);
|
|
65
|
+
setPositioned(true);
|
|
66
|
+
}, [tableBodyRef]);
|
|
67
|
+
var showTooltip = function showTooltip() {
|
|
68
|
+
setPositioned(false);
|
|
69
|
+
setVisible(true);
|
|
70
|
+
};
|
|
71
|
+
var hideTooltip = function hideTooltip() {
|
|
72
|
+
setVisible(false);
|
|
73
|
+
setPositioned(false);
|
|
64
74
|
};
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
onMouseLeave: function onMouseLeave() {
|
|
69
|
-
var _menuButtonRef$curren;
|
|
70
|
-
var tooltip = menuButtonRef === null || menuButtonRef === void 0 ? void 0 : (_menuButtonRef$curren = menuButtonRef.current) === null || _menuButtonRef$curren === void 0 ? void 0 : _menuButtonRef$curren.querySelector('.tooltiptext');
|
|
71
|
-
if (tooltip) {
|
|
72
|
-
tooltip.style.visibility = 'hidden';
|
|
73
|
-
tooltip.style.opacity = '0';
|
|
74
|
-
}
|
|
75
|
+
(0, _react.useLayoutEffect)(function () {
|
|
76
|
+
if (!visible) {
|
|
77
|
+
return;
|
|
75
78
|
}
|
|
76
|
-
|
|
77
|
-
|
|
79
|
+
updatePosition();
|
|
80
|
+
var frame = window.requestAnimationFrame(updatePosition);
|
|
81
|
+
return function () {
|
|
82
|
+
return window.cancelAnimationFrame(frame);
|
|
83
|
+
};
|
|
84
|
+
}, [visible, title, updatePosition]);
|
|
85
|
+
(0, _react.useEffect)(function () {
|
|
86
|
+
if (!visible) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
var handleReposition = function handleReposition() {
|
|
90
|
+
return updatePosition();
|
|
91
|
+
};
|
|
92
|
+
window.addEventListener('resize', handleReposition);
|
|
93
|
+
window.addEventListener('scroll', handleReposition, true);
|
|
94
|
+
return function () {
|
|
95
|
+
window.removeEventListener('resize', handleReposition);
|
|
96
|
+
window.removeEventListener('scroll', handleReposition, true);
|
|
97
|
+
};
|
|
98
|
+
}, [visible, updatePosition]);
|
|
99
|
+
if (!title || enabled === false) {
|
|
100
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, children);
|
|
101
|
+
}
|
|
102
|
+
var portalRoot = typeof document !== 'undefined' ? document.body : null;
|
|
103
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
104
|
+
ref: triggerRef,
|
|
105
|
+
className: "qbs-table-tooltip-trigger",
|
|
78
106
|
style: {
|
|
79
|
-
display: 'flex'
|
|
107
|
+
display: 'inline-flex'
|
|
80
108
|
},
|
|
81
|
-
onMouseEnter:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
109
|
+
onMouseEnter: showTooltip,
|
|
110
|
+
onMouseLeave: hideTooltip,
|
|
111
|
+
onFocus: showTooltip,
|
|
112
|
+
onBlur: hideTooltip
|
|
113
|
+
}, children), visible && portalRoot && /*#__PURE__*/_reactDom["default"].createPortal(/*#__PURE__*/_react["default"].createElement("span", {
|
|
114
|
+
ref: tooltipRef,
|
|
115
|
+
role: "tooltip",
|
|
116
|
+
className: "qbs-table-tooltip-floating tooltiptext qbs-table-tooltip-floating--" + placement + " " + (positioned ? 'is-positioned' : ''),
|
|
117
|
+
style: {
|
|
118
|
+
top: coords.top,
|
|
119
|
+
left: coords.left,
|
|
120
|
+
'--tooltip-arrow-offset': arrowOffset + "px"
|
|
89
121
|
}
|
|
90
|
-
},
|
|
91
|
-
className: "tooltiptext"
|
|
92
|
-
}, title)));
|
|
122
|
+
}, title), portalRoot));
|
|
93
123
|
};
|
|
94
124
|
var _default = TooltipComponent;
|
|
95
125
|
exports["default"] = _default;
|
|
@@ -130,7 +130,7 @@ var VerticalMenuDropdown = function VerticalMenuDropdown(_ref) {
|
|
|
130
130
|
};
|
|
131
131
|
var portalTarget = document.getElementById('portal-root');
|
|
132
132
|
var dropdownContent = /*#__PURE__*/_react["default"].createElement("div", {
|
|
133
|
-
className: "absolute z-
|
|
133
|
+
className: "absolute z-[60] min-w-48 rounded-md vertical-menu-dropdown-content",
|
|
134
134
|
ref: menuRef,
|
|
135
135
|
style: {
|
|
136
136
|
width: 200,
|
|
@@ -144,7 +144,7 @@ var VerticalMenuDropdown = function VerticalMenuDropdown(_ref) {
|
|
|
144
144
|
var _item$hide3;
|
|
145
145
|
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["default"].createElement("div", {
|
|
146
146
|
key: item.title,
|
|
147
|
-
className: "vertical-menu-item px-4 py-2 text-sm text-
|
|
147
|
+
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",
|
|
148
148
|
onClick: function onClick(e) {
|
|
149
149
|
var _item$action;
|
|
150
150
|
e.preventDefault();
|
|
@@ -165,7 +165,7 @@ var VerticalMenuDropdown = function VerticalMenuDropdown(_ref) {
|
|
|
165
165
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
166
166
|
className: "inline-block vertical-menu-dropdown-wrapper"
|
|
167
167
|
}, handleShowHideMenu() > 0 && /*#__PURE__*/_react["default"].createElement("button", {
|
|
168
|
-
className: "vertical-menu-trigger-button p-2 rounded hover:bg-gray-
|
|
168
|
+
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",
|
|
169
169
|
onClick: toggleMenu,
|
|
170
170
|
ref: menuButtonRef
|
|
171
171
|
}, /*#__PURE__*/_react["default"].createElement(_icons.ThreeDotIcon, null))), openMenu && portalTarget && /*#__PURE__*/_reactDom["default"].createPortal(dropdownContent, portalTarget));
|
|
@@ -13,7 +13,7 @@ var ThreeDotIcon = function ThreeDotIcon() {
|
|
|
13
13
|
xmlns: "http://www.w3.org/2000/svg"
|
|
14
14
|
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
15
15
|
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",
|
|
16
|
-
stroke: "
|
|
16
|
+
stroke: "currentColor",
|
|
17
17
|
strokeWidth: "1.5",
|
|
18
18
|
strokeLinecap: "round",
|
|
19
19
|
strokeLinejoin: "round"
|
package/package.json
CHANGED
package/src/Cell.tsx
CHANGED
|
@@ -144,11 +144,13 @@ const Cell = React.forwardRef((props: InnerCellProps, ref: React.Ref<HTMLDivElem
|
|
|
144
144
|
};
|
|
145
145
|
|
|
146
146
|
const paddingKey = rtl ? 'paddingRight' : 'paddingLeft';
|
|
147
|
+
const resolvedAlign =
|
|
148
|
+
rtl && align === 'left' ? 'right' : rtl && align === 'right' ? 'left' : align;
|
|
147
149
|
const contentStyles: React.CSSProperties = {
|
|
148
150
|
...style,
|
|
149
151
|
width: fullText ? width - 1 : width,
|
|
150
152
|
height: nextHeight,
|
|
151
|
-
textAlign:
|
|
153
|
+
textAlign: resolvedAlign,
|
|
152
154
|
[paddingKey]: isTreeCol ? depth * LAYER_WIDTH + 10 : style?.[paddingKey] || style?.padding
|
|
153
155
|
};
|
|
154
156
|
|
package/src/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;
|