qbs-react-grid 2.2.6 → 2.2.9
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/index.d.ts +2 -0
- package/es/index.js +2 -1
- package/es/less/qbs-table.less +58 -4
- package/es/qbsTable/CustomTableCell.js +4 -2
- package/es/qbsTable/QbsTable.js +39 -6
- package/es/qbsTable/TableCardList.js +37 -6
- package/es/qbsTable/Toolbar.js +87 -23
- package/es/qbsTable/commontypes.d.ts +18 -0
- package/es/qbsTable/labels.d.ts +25 -0
- package/es/qbsTable/labels.js +32 -0
- package/es/qbsTable/utilities/ColumShowHide.d.ts +3 -0
- package/es/qbsTable/utilities/ColumShowHide.js +112 -33
- package/es/qbsTable/utilities/VerticalDropDownMenu.js +22 -5
- package/es/qbsTable/utilities/columnToggleCoordinator.d.ts +5 -0
- package/es/qbsTable/utilities/columnToggleCoordinator.js +9 -0
- package/es/qbsTable/utilities/icons.d.ts +3 -0
- package/es/qbsTable/utilities/icons.js +67 -3
- package/es/qbsTable/utilities/verticalMenuCoordinator.d.ts +5 -0
- package/es/qbsTable/utilities/verticalMenuCoordinator.js +9 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +6 -2
- package/lib/less/qbs-table.less +58 -4
- package/lib/qbsTable/CustomTableCell.js +4 -2
- package/lib/qbsTable/QbsTable.js +39 -6
- package/lib/qbsTable/TableCardList.js +37 -6
- package/lib/qbsTable/Toolbar.js +85 -21
- package/lib/qbsTable/commontypes.d.ts +18 -0
- package/lib/qbsTable/labels.d.ts +25 -0
- package/lib/qbsTable/labels.js +40 -0
- package/lib/qbsTable/utilities/ColumShowHide.d.ts +3 -0
- package/lib/qbsTable/utilities/ColumShowHide.js +112 -32
- package/lib/qbsTable/utilities/VerticalDropDownMenu.js +21 -4
- package/lib/qbsTable/utilities/columnToggleCoordinator.d.ts +5 -0
- package/lib/qbsTable/utilities/columnToggleCoordinator.js +15 -0
- package/lib/qbsTable/utilities/icons.d.ts +3 -0
- package/lib/qbsTable/utilities/icons.js +72 -5
- package/lib/qbsTable/utilities/verticalMenuCoordinator.d.ts +5 -0
- package/lib/qbsTable/utilities/verticalMenuCoordinator.js +15 -0
- package/package.json +1 -1
- package/src/index.ts +6 -0
- package/src/less/qbs-table.less +58 -4
- package/src/qbsTable/CustomTableCell.tsx +4 -2
- package/src/qbsTable/QbsTable.tsx +30 -4
- package/src/qbsTable/TableCardList.tsx +28 -4
- package/src/qbsTable/Toolbar.tsx +99 -29
- package/src/qbsTable/commontypes.ts +19 -0
- package/src/qbsTable/labels.ts +55 -0
- package/src/qbsTable/utilities/ColumShowHide.tsx +170 -84
- package/src/qbsTable/utilities/VerticalDropDownMenu.tsx +26 -3
- package/src/qbsTable/utilities/columnToggleCoordinator.ts +14 -0
- package/src/qbsTable/utilities/icons.tsx +76 -3
- package/src/qbsTable/utilities/verticalMenuCoordinator.ts +14 -0
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
1
|
+
import React, { useCallback, useEffect, useId, useRef, useState } from 'react';
|
|
2
|
+
import ReactDOM from 'react-dom';
|
|
3
|
+
import { mergeQbsTableLabels } from '../labels';
|
|
4
|
+
import { closeOtherColumnToggles, COLUMN_TOGGLE_CLOSE_OTHERS } from './columnToggleCoordinator';
|
|
2
5
|
import { SettingsIcon } from './icons';
|
|
3
6
|
var ColumnToggle = function ColumnToggle(_ref) {
|
|
7
|
+
var _document$getElementB;
|
|
4
8
|
var columns = _ref.columns,
|
|
5
9
|
onToggle = _ref.onToggle,
|
|
6
10
|
onReorder = _ref.onReorder,
|
|
@@ -9,14 +13,71 @@ var ColumnToggle = function ColumnToggle(_ref) {
|
|
|
9
13
|
handleResetColumns = _ref.handleResetColumns,
|
|
10
14
|
handleColumnToggle = _ref.handleColumnToggle,
|
|
11
15
|
_ref$tableHeight = _ref.tableHeight,
|
|
12
|
-
tableHeight = _ref$tableHeight === void 0 ? 450 : _ref$tableHeight
|
|
16
|
+
tableHeight = _ref$tableHeight === void 0 ? 450 : _ref$tableHeight,
|
|
17
|
+
labelsProp = _ref.labels,
|
|
18
|
+
_ref$rtl = _ref.rtl,
|
|
19
|
+
rtl = _ref$rtl === void 0 ? false : _ref$rtl;
|
|
20
|
+
var labels = mergeQbsTableLabels(labelsProp);
|
|
21
|
+
var toggleId = useId();
|
|
13
22
|
var _useState = useState(null),
|
|
14
23
|
draggedItem = _useState[0],
|
|
15
24
|
setDraggedItem = _useState[1];
|
|
16
25
|
var popupRef = useRef(null);
|
|
26
|
+
var settingsBtnRef = useRef(null);
|
|
17
27
|
var _useState2 = useState(),
|
|
18
28
|
dragOverPosition = _useState2[0],
|
|
19
29
|
setDragOverPosition = _useState2[1];
|
|
30
|
+
var _useState3 = useState({
|
|
31
|
+
top: 0,
|
|
32
|
+
left: 0
|
|
33
|
+
}),
|
|
34
|
+
position = _useState3[0],
|
|
35
|
+
setPosition = _useState3[1];
|
|
36
|
+
var updatePopupPosition = useCallback(function () {
|
|
37
|
+
var _popupRef$current, _popupRef$current2;
|
|
38
|
+
if (!settingsBtnRef.current) return;
|
|
39
|
+
var rect = settingsBtnRef.current.getBoundingClientRect();
|
|
40
|
+
var viewportPadding = 8;
|
|
41
|
+
var popupWidth = ((_popupRef$current = popupRef.current) === null || _popupRef$current === void 0 ? void 0 : _popupRef$current.offsetWidth) || 272;
|
|
42
|
+
var popupHeight = ((_popupRef$current2 = popupRef.current) === null || _popupRef$current2 === void 0 ? void 0 : _popupRef$current2.offsetHeight) || 320;
|
|
43
|
+
var left = rtl ? rect.left : rect.right - popupWidth;
|
|
44
|
+
if (left + popupWidth > window.innerWidth - viewportPadding) {
|
|
45
|
+
left = Math.max(viewportPadding, window.innerWidth - popupWidth - viewportPadding);
|
|
46
|
+
}
|
|
47
|
+
if (left < viewportPadding) {
|
|
48
|
+
left = viewportPadding;
|
|
49
|
+
}
|
|
50
|
+
var top = rect.bottom + 4;
|
|
51
|
+
if (top + popupHeight > window.innerHeight - viewportPadding) {
|
|
52
|
+
top = Math.max(viewportPadding, rect.top - popupHeight - 4);
|
|
53
|
+
}
|
|
54
|
+
setPosition({
|
|
55
|
+
top: top,
|
|
56
|
+
left: left
|
|
57
|
+
});
|
|
58
|
+
}, [rtl]);
|
|
59
|
+
useEffect(function () {
|
|
60
|
+
var handleCloseOthers = function handleCloseOthers(event) {
|
|
61
|
+
var detail = event.detail;
|
|
62
|
+
if ((detail === null || detail === void 0 ? void 0 : detail.exceptId) !== toggleId) {
|
|
63
|
+
setIsOpen(false);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
document.addEventListener(COLUMN_TOGGLE_CLOSE_OTHERS, handleCloseOthers);
|
|
67
|
+
return function () {
|
|
68
|
+
return document.removeEventListener(COLUMN_TOGGLE_CLOSE_OTHERS, handleCloseOthers);
|
|
69
|
+
};
|
|
70
|
+
}, [setIsOpen, toggleId]);
|
|
71
|
+
useEffect(function () {
|
|
72
|
+
if (!isOpen) return;
|
|
73
|
+
updatePopupPosition();
|
|
74
|
+
var frame = requestAnimationFrame(function () {
|
|
75
|
+
return updatePopupPosition();
|
|
76
|
+
});
|
|
77
|
+
return function () {
|
|
78
|
+
return cancelAnimationFrame(frame);
|
|
79
|
+
};
|
|
80
|
+
}, [isOpen, updatePopupPosition]);
|
|
20
81
|
var handleToggle = useCallback(function (columnName) {
|
|
21
82
|
onToggle(columnName);
|
|
22
83
|
}, [onToggle]);
|
|
@@ -39,18 +100,22 @@ var ColumnToggle = function ColumnToggle(_ref) {
|
|
|
39
100
|
setDragOverPosition(null);
|
|
40
101
|
}
|
|
41
102
|
setDraggedItem(null);
|
|
42
|
-
}, [columns, draggedItem]);
|
|
103
|
+
}, [columns, draggedItem, onReorder]);
|
|
43
104
|
var handleClickOutside = useCallback(function (event) {
|
|
44
|
-
|
|
45
|
-
|
|
105
|
+
var _popupRef$current3, _settingsBtnRef$curre;
|
|
106
|
+
var target = event.target;
|
|
107
|
+
if ((_popupRef$current3 = popupRef.current) !== null && _popupRef$current3 !== void 0 && _popupRef$current3.contains(target) || (_settingsBtnRef$curre = settingsBtnRef.current) !== null && _settingsBtnRef$curre !== void 0 && _settingsBtnRef$curre.contains(target)) {
|
|
108
|
+
return;
|
|
46
109
|
}
|
|
110
|
+
setIsOpen(false);
|
|
47
111
|
}, [setIsOpen]);
|
|
48
112
|
useEffect(function () {
|
|
113
|
+
if (!isOpen) return;
|
|
49
114
|
document.addEventListener('mousedown', handleClickOutside);
|
|
50
115
|
return function () {
|
|
51
|
-
document.removeEventListener('mousedown', handleClickOutside);
|
|
116
|
+
return document.removeEventListener('mousedown', handleClickOutside);
|
|
52
117
|
};
|
|
53
|
-
}, [handleClickOutside]);
|
|
118
|
+
}, [handleClickOutside, isOpen]);
|
|
54
119
|
var renderFixedColumn = function renderFixedColumn(column, index) {
|
|
55
120
|
return /*#__PURE__*/React.createElement("div", {
|
|
56
121
|
key: column.title,
|
|
@@ -142,79 +207,93 @@ var ColumnToggle = function ColumnToggle(_ref) {
|
|
|
142
207
|
var _columns$filter;
|
|
143
208
|
return ((_columns$filter = columns.filter(function (item) {
|
|
144
209
|
return !item.isVisible;
|
|
145
|
-
})) === null || _columns$filter === void 0 ? void 0 : _columns$filter.length) > 0
|
|
210
|
+
})) === null || _columns$filter === void 0 ? void 0 : _columns$filter.length) > 0;
|
|
146
211
|
};
|
|
147
212
|
var handleColToggle = function handleColToggle() {
|
|
148
213
|
setIsOpen(false);
|
|
149
214
|
handleColumnToggle === null || handleColumnToggle === void 0 ? void 0 : handleColumnToggle(columns);
|
|
150
215
|
};
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
}
|
|
155
|
-
}, /*#__PURE__*/React.createElement(SettingsIcon, null)), isOpen && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
156
|
-
className: "qbs-table-column-popup",
|
|
216
|
+
var portalTarget = (_document$getElementB = document.getElementById('portal-root')) != null ? _document$getElementB : document.body;
|
|
217
|
+
var popupContent = /*#__PURE__*/React.createElement("div", {
|
|
218
|
+
className: "qbs-table-column-popup" + (rtl ? ' qbs-table-column-popup--rtl' : ''),
|
|
157
219
|
style: {
|
|
158
|
-
|
|
220
|
+
position: 'fixed',
|
|
221
|
+
top: position.top,
|
|
222
|
+
left: position.left,
|
|
223
|
+
maxHeight: tableHeight - 40,
|
|
224
|
+
zIndex: 10060
|
|
159
225
|
},
|
|
160
|
-
ref: popupRef
|
|
226
|
+
ref: popupRef,
|
|
227
|
+
dir: rtl ? 'rtl' : 'ltr'
|
|
161
228
|
}, /*#__PURE__*/React.createElement("div", {
|
|
162
229
|
className: "qbs-table-popup-container"
|
|
163
230
|
}, /*#__PURE__*/React.createElement("div", {
|
|
164
231
|
className: "qbs-table-popup-item"
|
|
165
232
|
}, /*#__PURE__*/React.createElement("div", {
|
|
166
233
|
className: "qbs-table-popup-label"
|
|
167
|
-
},
|
|
234
|
+
}, labels.fixedColumns), /*#__PURE__*/React.createElement("div", {
|
|
168
235
|
className: "qbs-table-columns-container"
|
|
169
236
|
}, /*#__PURE__*/React.createElement("div", {
|
|
170
237
|
className: "qbs-table-column"
|
|
171
238
|
}, columns.map(function (column, index) {
|
|
172
|
-
return column.fixed ? renderFixedColumn(column, index) :
|
|
239
|
+
return column.fixed ? renderFixedColumn(column, index) : null;
|
|
173
240
|
})))), /*#__PURE__*/React.createElement("div", {
|
|
174
241
|
className: "qbs-table-divider"
|
|
175
242
|
}), /*#__PURE__*/React.createElement("div", {
|
|
176
243
|
className: "qbs-table-popup-item"
|
|
177
244
|
}, /*#__PURE__*/React.createElement("div", {
|
|
178
245
|
className: "qbs-table-popup-label"
|
|
179
|
-
},
|
|
246
|
+
}, labels.visibleColumns), /*#__PURE__*/React.createElement("div", {
|
|
180
247
|
className: "qbs-table-columns-container"
|
|
181
248
|
}, /*#__PURE__*/React.createElement("div", {
|
|
182
249
|
className: "qbs-table-column"
|
|
183
250
|
}, columns.map(function (column, index) {
|
|
184
|
-
return column.isVisible && !column.fixed ? renderColumn(column, index) :
|
|
251
|
+
return column.isVisible && !column.fixed ? renderColumn(column, index) : null;
|
|
185
252
|
})))), handleAvailableColumns() && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
186
253
|
className: "qbs-table-divider"
|
|
187
254
|
}), /*#__PURE__*/React.createElement("div", {
|
|
188
255
|
className: "qbs-table-popup-item"
|
|
189
256
|
}, /*#__PURE__*/React.createElement("div", {
|
|
190
257
|
className: "qbs-table-popup-label"
|
|
191
|
-
},
|
|
258
|
+
}, labels.availableColumns), /*#__PURE__*/React.createElement("div", {
|
|
192
259
|
className: "qbs-table-columns-container"
|
|
193
260
|
}, /*#__PURE__*/React.createElement("div", {
|
|
194
261
|
className: "qbs-table-column"
|
|
195
262
|
}, columns.map(function (column, index) {
|
|
196
|
-
return !column.isVisible && !column.fixed ? renderFixedColumn(column, index) :
|
|
263
|
+
return !column.isVisible && !column.fixed ? renderFixedColumn(column, index) : null;
|
|
197
264
|
})))))), handleResetColumns && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
198
265
|
className: "qbs-table-divider"
|
|
199
266
|
}), /*#__PURE__*/React.createElement("div", {
|
|
200
|
-
className: "qbs-table-popup-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
flexDirection: 'row',
|
|
204
|
-
justifyContent: 'space-between'
|
|
205
|
-
}
|
|
206
|
-
}, /*#__PURE__*/React.createElement("a", {
|
|
267
|
+
className: "qbs-table-popup-footer"
|
|
268
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
269
|
+
type: "button",
|
|
207
270
|
className: "qbs-table-reset-link",
|
|
208
|
-
href: "#",
|
|
209
271
|
onClick: function onClick() {
|
|
210
272
|
return handleResetColumns === null || handleResetColumns === void 0 ? void 0 : handleResetColumns();
|
|
211
273
|
}
|
|
212
|
-
},
|
|
274
|
+
}, labels.resetToDefault), /*#__PURE__*/React.createElement("button", {
|
|
275
|
+
type: "button",
|
|
213
276
|
className: "qbs-table-reset-link",
|
|
214
|
-
href: "#",
|
|
215
277
|
onClick: function onClick() {
|
|
216
278
|
return handleColToggle();
|
|
217
279
|
}
|
|
218
|
-
},
|
|
280
|
+
}, labels.save))));
|
|
281
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
282
|
+
className: "qbs-table-settings-wrapper"
|
|
283
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
284
|
+
type: "button",
|
|
285
|
+
className: "qbs-table-settings-btn",
|
|
286
|
+
ref: settingsBtnRef,
|
|
287
|
+
onClick: function onClick(event) {
|
|
288
|
+
event.stopPropagation();
|
|
289
|
+
if (isOpen) {
|
|
290
|
+
setIsOpen(false);
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
closeOtherColumnToggles(toggleId);
|
|
294
|
+
updatePopupPosition();
|
|
295
|
+
setIsOpen(true);
|
|
296
|
+
}
|
|
297
|
+
}, /*#__PURE__*/React.createElement(SettingsIcon, null)), isOpen && portalTarget && /*#__PURE__*/ReactDOM.createPortal(popupContent, portalTarget));
|
|
219
298
|
};
|
|
220
299
|
export default ColumnToggle;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
2
2
|
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); }
|
|
3
3
|
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; }
|
|
4
|
-
import React, { useEffect, useRef, useState } from 'react';
|
|
4
|
+
import React, { useEffect, useId, useRef, useState } from 'react';
|
|
5
5
|
import ReactDOM from 'react-dom';
|
|
6
6
|
import { ThreeDotIcon } from './icons';
|
|
7
7
|
import TooltipComponent from './ToolTip';
|
|
8
|
+
import { closeOtherVerticalMenus, VERTICAL_MENU_CLOSE_OTHERS } from './verticalMenuCoordinator';
|
|
8
9
|
var VerticalMenuDropdown = function VerticalMenuDropdown(_ref) {
|
|
9
10
|
var _actionDropDown$filte2, _document$getElementB;
|
|
10
11
|
var actionDropDown = _ref.actionDropDown,
|
|
@@ -21,8 +22,21 @@ var VerticalMenuDropdown = function VerticalMenuDropdown(_ref) {
|
|
|
21
22
|
}),
|
|
22
23
|
position = _useState2[0],
|
|
23
24
|
setPosition = _useState2[1];
|
|
25
|
+
var menuId = useId();
|
|
24
26
|
var menuButtonRef = useRef(null);
|
|
25
27
|
var menuRef = useRef(null);
|
|
28
|
+
useEffect(function () {
|
|
29
|
+
var handleCloseOthers = function handleCloseOthers(event) {
|
|
30
|
+
var detail = event.detail;
|
|
31
|
+
if ((detail === null || detail === void 0 ? void 0 : detail.exceptId) !== menuId) {
|
|
32
|
+
setOpenMenu(false);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
document.addEventListener(VERTICAL_MENU_CLOSE_OTHERS, handleCloseOthers);
|
|
36
|
+
return function () {
|
|
37
|
+
return document.removeEventListener(VERTICAL_MENU_CLOSE_OTHERS, handleCloseOthers);
|
|
38
|
+
};
|
|
39
|
+
}, [menuId]);
|
|
26
40
|
var updateMenuPosition = function updateMenuPosition() {
|
|
27
41
|
var _actionDropDown$filte;
|
|
28
42
|
if (!menuButtonRef.current) return;
|
|
@@ -154,10 +168,13 @@ var VerticalMenuDropdown = function VerticalMenuDropdown(_ref) {
|
|
|
154
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",
|
|
155
169
|
onClick: function onClick(event) {
|
|
156
170
|
event.stopPropagation();
|
|
157
|
-
if (
|
|
158
|
-
|
|
159
|
-
return
|
|
160
|
-
}
|
|
171
|
+
if (openMenu) {
|
|
172
|
+
setOpenMenu(false);
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
closeOtherVerticalMenus(menuId);
|
|
176
|
+
updateMenuPosition();
|
|
177
|
+
setOpenMenu(true);
|
|
161
178
|
},
|
|
162
179
|
ref: menuButtonRef
|
|
163
180
|
}, /*#__PURE__*/React.createElement(ThreeDotIcon, null))), openMenu && portalTarget && /*#__PURE__*/ReactDOM.createPortal(dropdownContent, portalTarget));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export var COLUMN_TOGGLE_CLOSE_OTHERS = 'qbs-column-toggle-close-others';
|
|
2
|
+
export var closeOtherColumnToggles = function closeOtherColumnToggles(exceptId) {
|
|
3
|
+
if (typeof document === 'undefined') return;
|
|
4
|
+
document.dispatchEvent(new CustomEvent(COLUMN_TOGGLE_CLOSE_OTHERS, {
|
|
5
|
+
detail: {
|
|
6
|
+
exceptId: exceptId
|
|
7
|
+
}
|
|
8
|
+
}));
|
|
9
|
+
};
|
|
@@ -6,3 +6,6 @@ export declare const TableIcon: React.FC<any>;
|
|
|
6
6
|
export declare const CardIcon: React.FC<any>;
|
|
7
7
|
export declare const CardView: React.FC<any>;
|
|
8
8
|
export declare const TableView: React.FC<any>;
|
|
9
|
+
export declare const ExpandIcon: React.FC<any>;
|
|
10
|
+
export declare const ContentView: React.FC<any>;
|
|
11
|
+
export declare const DefaultView: React.FC<any>;
|
|
@@ -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"
|
|
@@ -25,13 +25,13 @@ export var SettingsIcon = function SettingsIcon() {
|
|
|
25
25
|
fillRule: "evenodd",
|
|
26
26
|
clipRule: "evenodd",
|
|
27
27
|
d: "M10 12.5C8.61929 12.5 7.5 11.3807 7.5 10C7.5 8.61929 8.61929 7.5 10 7.5C11.3807 7.5 12.5 8.61929 12.5 10C12.5 11.3807 11.3807 12.5 10 12.5Z",
|
|
28
|
-
stroke: "
|
|
28
|
+
stroke: "currentColor",
|
|
29
29
|
strokeWidth: "1.5",
|
|
30
30
|
strokeLinecap: "round",
|
|
31
31
|
strokeLinejoin: "round"
|
|
32
32
|
}), /*#__PURE__*/React.createElement("path", {
|
|
33
33
|
d: "M1.66797 9.26718C1.66797 8.40052 2.3763 7.68385 3.2513 7.68385C4.75964 7.68385 5.3763 6.61718 4.61797 5.30885C4.18464 4.55885 4.44297 3.58385 5.2013 3.15052L6.64297 2.32552C7.3013 1.93385 8.1513 2.16718 8.54297 2.82552L8.63463 2.98385C9.38463 4.29218 10.618 4.29218 11.3763 2.98385L11.468 2.82552C11.8596 2.16718 12.7096 1.93385 13.368 2.32552L14.8096 3.15052C15.568 3.58385 15.8263 4.55885 15.393 5.30885C14.6346 6.61718 15.2513 7.68385 16.7596 7.68385C17.6263 7.68385 18.343 8.39218 18.343 9.26718V10.7338C18.343 11.6005 17.6346 12.3172 16.7596 12.3172C15.2513 12.3172 14.6346 13.3838 15.393 14.6922C15.8263 15.4505 15.568 16.4172 14.8096 16.8505L13.368 17.6755C12.7096 18.0672 11.8596 17.8339 11.468 17.1755L11.3763 17.0172C10.6263 15.7089 9.39297 15.7089 8.63463 17.0172L8.54297 17.1755C8.1513 17.8339 7.3013 18.0672 6.64297 17.6755L5.2013 16.8505C4.44297 16.4172 4.18464 15.4422 4.61797 14.6922C5.3763 13.3838 4.75964 12.3172 3.2513 12.3172C2.3763 12.3172 1.66797 11.6005 1.66797 10.7338V9.26718Z",
|
|
34
|
-
stroke: "
|
|
34
|
+
stroke: "currentColor",
|
|
35
35
|
strokeWidth: "1.5",
|
|
36
36
|
strokeLinecap: "round",
|
|
37
37
|
strokeLinejoin: "round"
|
|
@@ -125,4 +125,68 @@ export var TableView = function TableView(_ref5) {
|
|
|
125
125
|
stroke: "currentColor",
|
|
126
126
|
strokeWidth: "1.5"
|
|
127
127
|
}));
|
|
128
|
+
};
|
|
129
|
+
export var ExpandIcon = function ExpandIcon(_ref6) {
|
|
130
|
+
var className = _ref6.className;
|
|
131
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
132
|
+
width: "16",
|
|
133
|
+
height: "16",
|
|
134
|
+
className: className,
|
|
135
|
+
viewBox: "0 0 16 16",
|
|
136
|
+
fill: "none",
|
|
137
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
138
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
139
|
+
d: "M2.66797 5.33073V2.66406M2.66797 2.66406H5.33464M2.66797 2.66406L6.0013 5.9974M13.3346 5.33073V2.66406M13.3346 2.66406H10.668M13.3346 2.66406L10.0013 5.9974M2.66797 10.6641V13.3307M2.66797 13.3307H5.33464M2.66797 13.3307L6.0013 9.9974M13.3346 13.3307L10.0013 9.9974M13.3346 13.3307V10.6641M13.3346 13.3307H10.668",
|
|
140
|
+
stroke: "currentColor",
|
|
141
|
+
strokeWidth: "1.5",
|
|
142
|
+
strokeLinecap: "round",
|
|
143
|
+
strokeLinejoin: "round"
|
|
144
|
+
}));
|
|
145
|
+
};
|
|
146
|
+
export var ContentView = function ContentView(_ref7) {
|
|
147
|
+
var className = _ref7.className;
|
|
148
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
149
|
+
width: "16",
|
|
150
|
+
height: "17",
|
|
151
|
+
className: className,
|
|
152
|
+
viewBox: "0 0 16 17",
|
|
153
|
+
fill: "none",
|
|
154
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
155
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
156
|
+
d: "M4.00344 9.48438C3.24485 9.48438 2.94141 9.80804 2.94141 10.6122V12.6553C2.94141 13.4594 3.24485 13.7831 4.00344 13.7831H11.994C12.7526 13.7831 13.056 13.4594 13.056 12.6553V10.6122C13.056 9.80804 12.7526 9.48438 11.994 9.48438H4.00344Z",
|
|
157
|
+
stroke: "currentColor",
|
|
158
|
+
strokeLinecap: "round",
|
|
159
|
+
strokeLinejoin: "round"
|
|
160
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
161
|
+
d: "M4.00344 3.66406C3.24485 3.66406 2.94141 3.98773 2.94141 4.79184V6.835C2.94141 7.63911 3.24485 7.96278 4.00344 7.96278H11.994C12.7526 7.96278 13.056 7.63911 13.056 6.835V4.79184C13.056 3.98773 12.7526 3.66406 11.994 3.66406H4.00344Z",
|
|
162
|
+
stroke: "currentColor",
|
|
163
|
+
strokeLinecap: "round",
|
|
164
|
+
strokeLinejoin: "round"
|
|
165
|
+
}));
|
|
166
|
+
};
|
|
167
|
+
export var DefaultView = function DefaultView(_ref8) {
|
|
168
|
+
var className = _ref8.className;
|
|
169
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
170
|
+
width: "16",
|
|
171
|
+
height: "17",
|
|
172
|
+
className: className,
|
|
173
|
+
viewBox: "0 0 16 17",
|
|
174
|
+
fill: "none",
|
|
175
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
176
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
177
|
+
fillRule: "evenodd",
|
|
178
|
+
clipRule: "evenodd",
|
|
179
|
+
d: "M2.39844 4.72969C2.39844 4.28786 2.75661 3.92969 3.19844 3.92969H12.7984C13.2403 3.92969 13.5984 4.28786 13.5984 4.72969C13.5984 5.17152 13.2403 5.52969 12.7984 5.52969H3.19844C2.75661 5.52969 2.39844 5.17152 2.39844 4.72969Z",
|
|
180
|
+
fill: "currentColor"
|
|
181
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
182
|
+
fillRule: "evenodd",
|
|
183
|
+
clipRule: "evenodd",
|
|
184
|
+
d: "M2.39844 8.72969C2.39844 8.28786 2.75661 7.92969 3.19844 7.92969H12.7984C13.2403 7.92969 13.5984 8.28786 13.5984 8.72969C13.5984 9.17152 13.2403 9.52969 12.7984 9.52969H3.19844C2.75661 9.52969 2.39844 9.17152 2.39844 8.72969Z",
|
|
185
|
+
fill: "currentColor"
|
|
186
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
187
|
+
fillRule: "evenodd",
|
|
188
|
+
clipRule: "evenodd",
|
|
189
|
+
d: "M2.39844 12.7297C2.39844 12.2879 2.75661 11.9297 3.19844 11.9297H12.7984C13.2403 11.9297 13.5984 12.2879 13.5984 12.7297C13.5984 13.1715 13.2403 13.5297 12.7984 13.5297H3.19844C2.75661 13.5297 2.39844 13.1715 2.39844 12.7297Z",
|
|
190
|
+
fill: "currentColor"
|
|
191
|
+
}));
|
|
128
192
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export var VERTICAL_MENU_CLOSE_OTHERS = 'qbs-vertical-menu-close-others';
|
|
2
|
+
export var closeOtherVerticalMenus = function closeOtherVerticalMenus(exceptId) {
|
|
3
|
+
if (typeof document === 'undefined') return;
|
|
4
|
+
document.dispatchEvent(new CustomEvent(VERTICAL_MENU_CLOSE_OTHERS, {
|
|
5
|
+
detail: {
|
|
6
|
+
exceptId: exceptId
|
|
7
|
+
}
|
|
8
|
+
}));
|
|
9
|
+
};
|
package/lib/index.d.ts
CHANGED
|
@@ -12,4 +12,6 @@ export type { CellProps } from './Cell';
|
|
|
12
12
|
export type { HeaderCellProps } from './HeaderCell';
|
|
13
13
|
export type { ColumnGroupProps } from './ColumnGroup';
|
|
14
14
|
export type { QbsTableProps } from './qbsTable/commontypes';
|
|
15
|
+
export type { QbsTableLabels } from './qbsTable/labels';
|
|
16
|
+
export { mergeQbsTableLabels, defaultQbsTableLabels, formatSelectedItems, } from './qbsTable/labels';
|
|
15
17
|
export type { StandardProps, SortType, RowDataType, RowKeyType, TableSizeChangeEventName } from './@types/common';
|
package/lib/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
exports.__esModule = true;
|
|
5
|
-
exports.Table = exports.QbsTable = exports.Pagination = exports.HeaderCell = exports.ColumnGroup = exports.Column = exports.Cell = void 0;
|
|
5
|
+
exports.mergeQbsTableLabels = exports.formatSelectedItems = exports.defaultQbsTableLabels = exports.Table = exports.QbsTable = exports.Pagination = exports.HeaderCell = exports.ColumnGroup = exports.Column = exports.Cell = void 0;
|
|
6
6
|
var _Table = _interopRequireDefault(require("./Table"));
|
|
7
7
|
exports.Table = _Table["default"];
|
|
8
8
|
var _Column = _interopRequireDefault(require("./Column"));
|
|
@@ -16,4 +16,8 @@ exports.HeaderCell = _HeaderCell["default"];
|
|
|
16
16
|
var _ColumnGroup = _interopRequireDefault(require("./ColumnGroup"));
|
|
17
17
|
exports.ColumnGroup = _ColumnGroup["default"];
|
|
18
18
|
var _Pagination = _interopRequireDefault(require("./Pagination"));
|
|
19
|
-
exports.Pagination = _Pagination["default"];
|
|
19
|
+
exports.Pagination = _Pagination["default"];
|
|
20
|
+
var _labels = require("./qbsTable/labels");
|
|
21
|
+
exports.mergeQbsTableLabels = _labels.mergeQbsTableLabels;
|
|
22
|
+
exports.defaultQbsTableLabels = _labels.defaultQbsTableLabels;
|
|
23
|
+
exports.formatSelectedItems = _labels.formatSelectedItems;
|
package/lib/less/qbs-table.less
CHANGED
|
@@ -376,11 +376,17 @@
|
|
|
376
376
|
gap: 10px;
|
|
377
377
|
align-items: center;
|
|
378
378
|
}
|
|
379
|
+
.qbs-table-settings-wrapper {
|
|
380
|
+
position: relative;
|
|
381
|
+
display: inline-flex;
|
|
382
|
+
align-items: center;
|
|
383
|
+
justify-content: center;
|
|
384
|
+
}
|
|
385
|
+
|
|
379
386
|
.qbs-table-column-popup {
|
|
380
387
|
position: fixed;
|
|
381
388
|
padding: 8px;
|
|
382
|
-
z-index:
|
|
383
|
-
right: 10px;
|
|
389
|
+
z-index: 10060;
|
|
384
390
|
border-radius: 8px;
|
|
385
391
|
background: #fff;
|
|
386
392
|
box-shadow: 0px 8px 20px 0px rgba(0, 0, 0, 0.15);
|
|
@@ -389,7 +395,6 @@
|
|
|
389
395
|
display: flex;
|
|
390
396
|
flex-direction: column;
|
|
391
397
|
max-height: 500px;
|
|
392
|
-
// overflow-y: auto;
|
|
393
398
|
}
|
|
394
399
|
.qbs-table-popup-container {
|
|
395
400
|
max-width: 400px;
|
|
@@ -408,9 +413,37 @@
|
|
|
408
413
|
|
|
409
414
|
.qbs-table-columns-container {
|
|
410
415
|
display: flex;
|
|
416
|
+
flex-direction: row;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
.qbs-table-column-popup--rtl .qbs-table-columns-container {
|
|
411
420
|
flex-direction: row-reverse;
|
|
412
421
|
}
|
|
413
422
|
|
|
423
|
+
.qbs-table-popup-footer {
|
|
424
|
+
display: flex;
|
|
425
|
+
flex-direction: row;
|
|
426
|
+
justify-content: space-between;
|
|
427
|
+
align-items: center;
|
|
428
|
+
gap: 8px;
|
|
429
|
+
padding: 4px 0 0;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
.qbs-table-column-popup--rtl .qbs-table-popup-footer {
|
|
433
|
+
flex-direction: row-reverse;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
.qbs-table-reset-link {
|
|
437
|
+
background: none;
|
|
438
|
+
border: none;
|
|
439
|
+
padding: 0;
|
|
440
|
+
cursor: pointer;
|
|
441
|
+
font-size: 13px;
|
|
442
|
+
font-weight: 500;
|
|
443
|
+
color: inherit;
|
|
444
|
+
text-decoration: none;
|
|
445
|
+
}
|
|
446
|
+
|
|
414
447
|
.qbs-table-columns-label {
|
|
415
448
|
display: flex;
|
|
416
449
|
gap: 10px;
|
|
@@ -746,11 +779,32 @@
|
|
|
746
779
|
|
|
747
780
|
.qbs-table-top-icons {
|
|
748
781
|
color: #999696;
|
|
782
|
+
display: inline-flex;
|
|
783
|
+
align-items: center;
|
|
784
|
+
gap: 8px;
|
|
749
785
|
|
|
750
|
-
.active{
|
|
786
|
+
.active {
|
|
751
787
|
color: #EC6A17;
|
|
752
788
|
}
|
|
753
789
|
}
|
|
790
|
+
|
|
791
|
+
.qbs-row-switch-container {
|
|
792
|
+
display: inline-flex;
|
|
793
|
+
align-items: center;
|
|
794
|
+
gap: 8px;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
.qbs-table-view-btn {
|
|
798
|
+
display: inline-flex;
|
|
799
|
+
align-items: center;
|
|
800
|
+
justify-content: center;
|
|
801
|
+
padding: 0;
|
|
802
|
+
margin: 0;
|
|
803
|
+
border: none;
|
|
804
|
+
background: transparent;
|
|
805
|
+
cursor: pointer;
|
|
806
|
+
color: inherit;
|
|
807
|
+
}
|
|
754
808
|
.qbs-card-empty-wrapper {
|
|
755
809
|
display: flex;
|
|
756
810
|
justify-content: center;
|
|
@@ -94,6 +94,8 @@ var ExpandCell = /*#__PURE__*/_react["default"].memo(function (_ref3) {
|
|
|
94
94
|
onChange = _ref3.onChange,
|
|
95
95
|
props = (0, _objectWithoutPropertiesLoose2["default"])(_ref3, _excluded3);
|
|
96
96
|
return /*#__PURE__*/_react["default"].createElement(_Cell["default"], props, /*#__PURE__*/_react["default"].createElement("button", {
|
|
97
|
+
type: "button",
|
|
98
|
+
className: "qbs-table-expand-btn",
|
|
97
99
|
onClick: function onClick() {
|
|
98
100
|
onChange(rowData);
|
|
99
101
|
}
|
|
@@ -109,7 +111,7 @@ var ExpandCell = /*#__PURE__*/_react["default"].memo(function (_ref3) {
|
|
|
109
111
|
fillRule: "evenodd",
|
|
110
112
|
clipRule: "evenodd",
|
|
111
113
|
d: "M0.792893 0.292893C1.18342 -0.097631 1.81658 -0.097631 2.20711 0.292893L5.5 3.58579L8.79289 0.292893C9.18342 -0.0976311 9.81658 -0.0976311 10.2071 0.292893C10.5976 0.683417 10.5976 1.31658 10.2071 1.70711L6.20711 5.70711C5.81658 6.09763 5.18342 6.09763 4.79289 5.70711L0.792893 1.70711C0.402369 1.31658 0.402369 0.683417 0.792893 0.292893Z",
|
|
112
|
-
fill: "
|
|
114
|
+
fill: "currentColor"
|
|
113
115
|
})) : /*#__PURE__*/_react["default"].createElement("svg", {
|
|
114
116
|
width: "7",
|
|
115
117
|
height: "10",
|
|
@@ -120,7 +122,7 @@ var ExpandCell = /*#__PURE__*/_react["default"].memo(function (_ref3) {
|
|
|
120
122
|
fillRule: "evenodd",
|
|
121
123
|
clipRule: "evenodd",
|
|
122
124
|
d: "M0.792894 9.70711C0.402369 9.31658 0.402369 8.68342 0.792894 8.29289L4.08579 5L0.792893 1.70711C0.402369 1.31658 0.402369 0.683418 0.792893 0.292894C1.18342 -0.0976312 1.81658 -0.0976312 2.20711 0.292894L6.20711 4.29289C6.59763 4.68342 6.59763 5.31658 6.20711 5.70711L2.20711 9.70711C1.81658 10.0976 1.18342 10.0976 0.792894 9.70711Z",
|
|
123
|
-
fill: "
|
|
125
|
+
fill: "currentColor"
|
|
124
126
|
}))));
|
|
125
127
|
});
|
|
126
128
|
exports.ExpandCell = ExpandCell;
|