qbs-react-grid 2.2.17 → 2.2.19
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/Pagination.d.ts +3 -0
- package/es/Pagination.js +8 -3
- package/es/Table.d.ts +3 -0
- package/es/Table.js +18 -12
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/less/pagination.less +9 -9
- package/es/qbsTable/QbsTable.js +110 -73
- package/es/qbsTable/TableCardList.js +2 -0
- package/es/qbsTable/Toolbar.js +6 -3
- package/es/qbsTable/commontypes.d.ts +21 -12
- package/es/qbsTable/labels.d.ts +6 -2
- package/es/qbsTable/labels.js +10 -1
- package/es/qbsTable/utilities/CardComponent.d.ts +2 -0
- package/es/qbsTable/utilities/CardComponent.js +7 -3
- package/es/qbsTable/utilities/CardMenuDropdown.d.ts +2 -0
- package/es/qbsTable/utilities/CardMenuDropdown.js +7 -7
- package/es/qbsTable/utilities/SearchInput.d.ts +1 -0
- package/es/qbsTable/utilities/SearchInput.js +3 -1
- package/es/qbsTable/utilities/VerticalDropDownMenu.js +36 -23
- package/es/qbsTable/utilities/empty.js +1 -1
- package/es/qbsTable/utilities/tablecalc.d.ts +1 -1
- package/es/qbsTable/utilities/tablecalc.js +7 -2
- package/es/utils/useCellDescriptor.js +0 -1
- package/es/utils/useScrollListener.d.ts +1 -0
- package/es/utils/useScrollListener.js +5 -3
- package/lib/Cell.js +2 -1
- package/lib/Pagination.d.ts +3 -0
- package/lib/Pagination.js +8 -3
- package/lib/Table.d.ts +3 -0
- package/lib/Table.js +18 -12
- package/lib/index.d.ts +1 -1
- package/lib/index.js +3 -1
- package/lib/less/pagination.less +9 -9
- package/lib/qbsTable/QbsTable.js +110 -73
- package/lib/qbsTable/TableCardList.js +2 -0
- package/lib/qbsTable/Toolbar.js +6 -3
- package/lib/qbsTable/commontypes.d.ts +21 -12
- package/lib/qbsTable/labels.d.ts +6 -2
- package/lib/qbsTable/labels.js +13 -2
- package/lib/qbsTable/utilities/CardComponent.d.ts +2 -0
- package/lib/qbsTable/utilities/CardComponent.js +7 -3
- package/lib/qbsTable/utilities/CardMenuDropdown.d.ts +2 -0
- package/lib/qbsTable/utilities/CardMenuDropdown.js +6 -5
- package/lib/qbsTable/utilities/SearchInput.d.ts +1 -0
- package/lib/qbsTable/utilities/SearchInput.js +3 -1
- package/lib/qbsTable/utilities/VerticalDropDownMenu.js +36 -23
- package/lib/qbsTable/utilities/empty.js +1 -1
- package/lib/qbsTable/utilities/tablecalc.d.ts +1 -1
- package/lib/qbsTable/utilities/tablecalc.js +7 -2
- package/lib/utils/useCellDescriptor.js +0 -1
- package/lib/utils/useScrollListener.d.ts +1 -0
- package/lib/utils/useScrollListener.js +5 -3
- package/package.json +2 -2
- package/src/Cell.tsx +3 -1
- package/src/HeaderCell.tsx +0 -1
- package/src/Pagination.tsx +10 -3
- package/src/Table.tsx +23 -10
- package/src/customSelect.tsx +88 -88
- package/src/index.ts +2 -0
- package/src/less/pagination.less +9 -9
- package/src/qbsTable/QbsTable.tsx +84 -39
- package/src/qbsTable/TableCardList.tsx +2 -0
- package/src/qbsTable/Toolbar.tsx +4 -2
- package/src/qbsTable/commontypes.ts +21 -12
- package/src/qbsTable/labels.ts +9 -2
- package/src/qbsTable/utilities/CardComponent.tsx +7 -2
- package/src/qbsTable/utilities/CardMenuDropdown.tsx +11 -6
- package/src/qbsTable/utilities/SearchInput.tsx +3 -1
- package/src/qbsTable/utilities/VerticalDropDownMenu.tsx +42 -30
- package/src/qbsTable/utilities/empty.tsx +2 -2
- package/src/qbsTable/utilities/tablecalc.ts +8 -2
- package/src/utils/useCellDescriptor.ts +0 -1
- package/src/utils/useScrollListener.ts +13 -3
- package/src/utils/useTableRows.ts +1 -1
|
@@ -40,7 +40,7 @@ export interface PaginationProps {
|
|
|
40
40
|
export interface ActionProps {
|
|
41
41
|
title?: string;
|
|
42
42
|
action?: (row: any) => void;
|
|
43
|
-
icon
|
|
43
|
+
icon?: React.ReactNode;
|
|
44
44
|
toolTip?: string;
|
|
45
45
|
hidden?: boolean;
|
|
46
46
|
hide?: (data: any, index?: number) => boolean;
|
|
@@ -70,6 +70,7 @@ export interface QbsTableProps {
|
|
|
70
70
|
searchValue?: string;
|
|
71
71
|
handleSearchValue?: (value?: string) => void;
|
|
72
72
|
theme?: string;
|
|
73
|
+
rtl?: boolean;
|
|
73
74
|
onRowClick?: (data: any) => void;
|
|
74
75
|
cellBordered?: boolean;
|
|
75
76
|
bordered?: boolean;
|
|
@@ -83,9 +84,8 @@ export interface QbsTableProps {
|
|
|
83
84
|
expandedRowKeys?: readonly number[];
|
|
84
85
|
setExpandedRowKeys?: (value: readonly number[]) => void;
|
|
85
86
|
handleMenuActions?: (actions: ActionProps, rowData: any) => void;
|
|
86
|
-
dropType?: 'vertical' | string;
|
|
87
|
+
dropType?: 'horizondal' | 'vertical' | string;
|
|
87
88
|
labels?: QbsTableLabels;
|
|
88
|
-
rtl?: boolean;
|
|
89
89
|
handleRowExpanded?: (rowData: any) => React.ReactNode;
|
|
90
90
|
shouldUpdateScroll?: boolean;
|
|
91
91
|
rowExpand?: boolean;
|
|
@@ -99,6 +99,8 @@ export interface QbsTableProps {
|
|
|
99
99
|
disabled?: boolean;
|
|
100
100
|
hidden?: boolean;
|
|
101
101
|
customHide?: string;
|
|
102
|
+
buttonClassName?: string;
|
|
103
|
+
icon?: ReactElement | ReactNode;
|
|
102
104
|
}[];
|
|
103
105
|
selectedRows?: (number | string)[];
|
|
104
106
|
classes?: {
|
|
@@ -131,13 +133,18 @@ export interface QbsTableProps {
|
|
|
131
133
|
handleTableCardView?: (data: any) => React.ReactNode;
|
|
132
134
|
isCustomTableCardView?: boolean;
|
|
133
135
|
handleCustomCardLoader?: () => React.ReactNode;
|
|
136
|
+
hasMoreData?: boolean;
|
|
137
|
+
loadMoreData?: () => void;
|
|
138
|
+
infiniteScroll?: boolean;
|
|
139
|
+
infiniteLoading?: boolean;
|
|
140
|
+
viewMode?: string;
|
|
134
141
|
rowViewToggle?: boolean;
|
|
135
142
|
defaultRowView?: boolean;
|
|
136
143
|
fullWidthView?: boolean;
|
|
137
144
|
setTableFullView?: (value: boolean) => void;
|
|
138
145
|
setRowViewToggle?: (value: boolean) => void;
|
|
139
|
-
isFullScreen?: boolean;
|
|
140
146
|
rowHeight?: number;
|
|
147
|
+
isFullScreen?: boolean;
|
|
141
148
|
showHeader?: boolean;
|
|
142
149
|
}
|
|
143
150
|
export interface QbsTableToolbarProps {
|
|
@@ -163,24 +170,26 @@ export interface QbsTableToolbarProps {
|
|
|
163
170
|
dataLength: number;
|
|
164
171
|
headerHeight?: number;
|
|
165
172
|
searchPlaceholder?: string;
|
|
173
|
+
labels?: QbsTableLabels;
|
|
174
|
+
rtl?: boolean;
|
|
166
175
|
tableView?: boolean;
|
|
167
176
|
enableTableToggle?: boolean;
|
|
168
177
|
tableViewToggle?: boolean;
|
|
169
178
|
setTableViewToggle?: (value: boolean) => void;
|
|
170
|
-
rowViewToggle?: boolean;
|
|
171
|
-
defaultRowView?: boolean;
|
|
172
|
-
fullWidthView?: boolean;
|
|
173
|
-
setTableFullView?: (value: boolean) => void;
|
|
174
|
-
setRowViewToggle?: (value: boolean) => void;
|
|
175
|
-
isFullScreen?: boolean;
|
|
176
|
-
labels?: QbsTableLabels;
|
|
177
|
-
rtl?: boolean;
|
|
178
179
|
selectedRowActions?: {
|
|
179
180
|
actionTitle?: string;
|
|
180
181
|
action: (checked: (number | string)[]) => void;
|
|
181
182
|
disabled?: boolean;
|
|
182
183
|
hidden?: boolean;
|
|
183
184
|
customHide?: string;
|
|
185
|
+
buttonClassName?: string;
|
|
186
|
+
icon?: ReactElement | ReactNode;
|
|
184
187
|
}[];
|
|
188
|
+
rowViewToggle?: boolean;
|
|
189
|
+
defaultRowView?: boolean;
|
|
190
|
+
fullWidthView?: boolean;
|
|
191
|
+
setTableFullView?: (value: boolean) => void;
|
|
192
|
+
setRowViewToggle?: (value: boolean) => void;
|
|
193
|
+
isFullScreen?: boolean;
|
|
185
194
|
}
|
|
186
195
|
export {};
|
package/lib/qbsTable/labels.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export interface QbsTableLabels {
|
|
2
2
|
search?: string;
|
|
3
3
|
searchAriaLabel?: string;
|
|
4
4
|
clear?: string;
|
|
@@ -19,7 +19,11 @@ export type QbsTableLabels = {
|
|
|
19
19
|
viewMore?: string;
|
|
20
20
|
viewLess?: string;
|
|
21
21
|
actions?: string;
|
|
22
|
-
}
|
|
22
|
+
}
|
|
23
23
|
export declare const defaultQbsTableLabels: QbsTableLabels;
|
|
24
|
+
/** @deprecated Use defaultQbsTableLabels */
|
|
25
|
+
export declare const DEFAULT_QBS_TABLE_LABELS: QbsTableLabels;
|
|
24
26
|
export declare const mergeQbsTableLabels: (overrides?: QbsTableLabels) => QbsTableLabels;
|
|
27
|
+
/** @deprecated Use mergeQbsTableLabels */
|
|
28
|
+
export declare const mergeLabels: (overrides?: QbsTableLabels) => QbsTableLabels;
|
|
25
29
|
export declare const formatSelectedItems: (count: number, labels?: QbsTableLabels) => string;
|
package/lib/qbsTable/labels.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
exports.__esModule = true;
|
|
5
|
-
exports.mergeQbsTableLabels = exports.formatSelectedItems = exports.defaultQbsTableLabels = void 0;
|
|
5
|
+
exports.mergeQbsTableLabels = exports.mergeLabels = exports.formatSelectedItems = exports.defaultQbsTableLabels = exports.DEFAULT_QBS_TABLE_LABELS = void 0;
|
|
6
6
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
7
7
|
var defaultQbsTableLabels = {
|
|
8
8
|
search: 'Search',
|
|
@@ -28,11 +28,22 @@ var defaultQbsTableLabels = {
|
|
|
28
28
|
viewLess: 'View Less',
|
|
29
29
|
actions: 'Actions'
|
|
30
30
|
};
|
|
31
|
+
|
|
32
|
+
/** @deprecated Use defaultQbsTableLabels */
|
|
31
33
|
exports.defaultQbsTableLabels = defaultQbsTableLabels;
|
|
34
|
+
var DEFAULT_QBS_TABLE_LABELS = defaultQbsTableLabels;
|
|
35
|
+
exports.DEFAULT_QBS_TABLE_LABELS = DEFAULT_QBS_TABLE_LABELS;
|
|
32
36
|
var mergeQbsTableLabels = function mergeQbsTableLabels(overrides) {
|
|
33
|
-
|
|
37
|
+
var _overrides$showingRan;
|
|
38
|
+
return (0, _extends2["default"])({}, defaultQbsTableLabels, overrides, {
|
|
39
|
+
showingRange: (_overrides$showingRan = overrides === null || overrides === void 0 ? void 0 : overrides.showingRange) != null ? _overrides$showingRan : defaultQbsTableLabels.showingRange
|
|
40
|
+
});
|
|
34
41
|
};
|
|
42
|
+
|
|
43
|
+
/** @deprecated Use mergeQbsTableLabels */
|
|
35
44
|
exports.mergeQbsTableLabels = mergeQbsTableLabels;
|
|
45
|
+
var mergeLabels = mergeQbsTableLabels;
|
|
46
|
+
exports.mergeLabels = mergeLabels;
|
|
36
47
|
var formatSelectedItems = function formatSelectedItems(count, labels) {
|
|
37
48
|
var merged = mergeQbsTableLabels(labels);
|
|
38
49
|
return merged.selectedItems + " (" + count + ")";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { QbsColumnProps } from '../commontypes';
|
|
3
|
+
import { type QbsTableLabels } from '../labels';
|
|
3
4
|
type Props = {
|
|
4
5
|
columns: QbsColumnProps[];
|
|
5
6
|
data: any;
|
|
@@ -9,6 +10,7 @@ type Props = {
|
|
|
9
10
|
handleMenuActions?: () => void;
|
|
10
11
|
cardColumLimit?: number;
|
|
11
12
|
childDetailHeading?: string;
|
|
13
|
+
labels?: QbsTableLabels;
|
|
12
14
|
};
|
|
13
15
|
declare const CardComponent: React.FC<Props>;
|
|
14
16
|
export default CardComponent;
|
|
@@ -4,6 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
exports.__esModule = true;
|
|
5
5
|
exports["default"] = void 0;
|
|
6
6
|
var _react = _interopRequireWildcard(require("react"));
|
|
7
|
+
var _labels = require("../labels");
|
|
7
8
|
var _CardMenuDropdown = _interopRequireDefault(require("./CardMenuDropdown"));
|
|
8
9
|
var _handleFormatCell = require("./handleFormatCell");
|
|
9
10
|
var _icons = require("./icons");
|
|
@@ -22,7 +23,9 @@ var CardComponent = function CardComponent(_ref) {
|
|
|
22
23
|
cardColumLimit = _ref$cardColumLimit === void 0 ? 5 : _ref$cardColumLimit,
|
|
23
24
|
handleMenuActions = _ref.handleMenuActions,
|
|
24
25
|
_ref$childDetailHeadi = _ref.childDetailHeading,
|
|
25
|
-
childDetailHeading = _ref$childDetailHeadi === void 0 ? '' : _ref$childDetailHeadi
|
|
26
|
+
childDetailHeading = _ref$childDetailHeadi === void 0 ? '' : _ref$childDetailHeadi,
|
|
27
|
+
labelsProp = _ref.labels;
|
|
28
|
+
var labels = (0, _labels.mergeLabels)(labelsProp);
|
|
26
29
|
var _useState = (0, _react.useState)(false),
|
|
27
30
|
viewMore = _useState[0],
|
|
28
31
|
setViewMore = _useState[1];
|
|
@@ -71,10 +74,11 @@ var CardComponent = function CardComponent(_ref) {
|
|
|
71
74
|
rowData: data,
|
|
72
75
|
iconName: "more",
|
|
73
76
|
rowIndex: index,
|
|
74
|
-
handleMenuActions: handleMenuActions
|
|
77
|
+
handleMenuActions: handleMenuActions,
|
|
78
|
+
labels: labels
|
|
75
79
|
})), columns.length > initialDisplayCount && /*#__PURE__*/_react["default"].createElement(_ToolTip["default"], {
|
|
76
80
|
tableBodyRef: useCardRef,
|
|
77
|
-
title: viewMore ?
|
|
81
|
+
title: viewMore ? labels.viewLess : labels.viewMore,
|
|
78
82
|
enabled: false
|
|
79
83
|
}, /*#__PURE__*/_react["default"].createElement("button", {
|
|
80
84
|
onClick: toggleViewMore,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ActionProps } from '../commontypes';
|
|
3
|
+
import { type QbsTableLabels } from '../labels';
|
|
3
4
|
type Props = {
|
|
4
5
|
iconName: string;
|
|
5
6
|
actionDropDown: ActionProps[];
|
|
@@ -8,6 +9,7 @@ type Props = {
|
|
|
8
9
|
dataTheme?: string;
|
|
9
10
|
tableBodyRef: React.RefObject<HTMLDivElement>;
|
|
10
11
|
rowIndex?: number;
|
|
12
|
+
labels?: QbsTableLabels;
|
|
11
13
|
};
|
|
12
14
|
declare const CardMenuDropdown: React.FC<Props>;
|
|
13
15
|
export default CardMenuDropdown;
|
|
@@ -4,6 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
exports.__esModule = true;
|
|
5
5
|
exports["default"] = void 0;
|
|
6
6
|
var _react = _interopRequireWildcard(require("react"));
|
|
7
|
+
var _labels = require("../labels");
|
|
7
8
|
var _icons = require("./icons");
|
|
8
9
|
var _ToolTip = _interopRequireDefault(require("./ToolTip"));
|
|
9
10
|
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); }
|
|
@@ -11,7 +12,9 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
11
12
|
var CardMenuDropdown = function CardMenuDropdown(_ref) {
|
|
12
13
|
var actionDropDown = _ref.actionDropDown,
|
|
13
14
|
handleMenuActions = _ref.handleMenuActions,
|
|
14
|
-
rowData = _ref.rowData
|
|
15
|
+
rowData = _ref.rowData,
|
|
16
|
+
labelsProp = _ref.labels;
|
|
17
|
+
var labels = (0, _labels.mergeLabels)(labelsProp);
|
|
15
18
|
var _useState = (0, _react.useState)(false),
|
|
16
19
|
openMenu = _useState[0],
|
|
17
20
|
setOpenMenu = _useState[1];
|
|
@@ -38,7 +41,6 @@ var CardMenuDropdown = function CardMenuDropdown(_ref) {
|
|
|
38
41
|
var dropdownHeight = 200; // Adjust this if your dropdown height varies
|
|
39
42
|
var spaceBelow = window.innerHeight - buttonRect.bottom;
|
|
40
43
|
var spaceAbove = buttonRect.top;
|
|
41
|
-
console.log(spaceAbove, spaceBelow, dropdownHeight);
|
|
42
44
|
if (spaceBelow < dropdownHeight && spaceAbove > spaceBelow) {
|
|
43
45
|
setMenuPositionStyles({
|
|
44
46
|
bottom: '30px',
|
|
@@ -71,9 +73,8 @@ var CardMenuDropdown = function CardMenuDropdown(_ref) {
|
|
|
71
73
|
onClick: toggleMenu,
|
|
72
74
|
ref: menuButtonRef
|
|
73
75
|
}, /*#__PURE__*/_react["default"].createElement(_ToolTip["default"], {
|
|
74
|
-
title:
|
|
75
|
-
enabled: false
|
|
76
|
-
ref: menuButtonRef
|
|
76
|
+
title: labels.actions,
|
|
77
|
+
enabled: false
|
|
77
78
|
}, /*#__PURE__*/_react["default"].createElement(_icons.ThreeDotIcon, null))), openMenu && /*#__PURE__*/_react["default"].createElement("div", {
|
|
78
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",
|
|
79
80
|
style: menuPositionStyles
|
|
@@ -7,6 +7,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
7
7
|
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
8
|
var SearchInput = function SearchInput(_ref) {
|
|
9
9
|
var placeholder = _ref.placeholder,
|
|
10
|
+
_ref$searchAriaLabel = _ref.searchAriaLabel,
|
|
11
|
+
searchAriaLabel = _ref$searchAriaLabel === void 0 ? 'Search' : _ref$searchAriaLabel,
|
|
10
12
|
handleChange = _ref.handleChange,
|
|
11
13
|
searchValue = _ref.searchValue,
|
|
12
14
|
handleSearch = _ref.handleSearch;
|
|
@@ -30,7 +32,7 @@ var SearchInput = function SearchInput(_ref) {
|
|
|
30
32
|
placeholder: placeholder,
|
|
31
33
|
value: searchValue != null ? searchValue : '',
|
|
32
34
|
onChange: handleInputChange,
|
|
33
|
-
"aria-label":
|
|
35
|
+
"aria-label": searchAriaLabel
|
|
34
36
|
}), /*#__PURE__*/_react["default"].createElement("button", {
|
|
35
37
|
className: "search-button absolute left-1 bottom-1.5 bg-white text-grey-dark",
|
|
36
38
|
onClick: function onClick() {
|
|
@@ -13,8 +13,12 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
13
13
|
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."); }
|
|
14
14
|
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); }
|
|
15
15
|
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; }
|
|
16
|
+
var isActionVisible = function isActionVisible(item, rowData, rowIndex) {
|
|
17
|
+
var _item$hide, _item$hide2;
|
|
18
|
+
return !item.hidden && !((_item$hide = (_item$hide2 = item.hide) === null || _item$hide2 === void 0 ? void 0 : _item$hide2.call(item, rowData, rowIndex)) != null ? _item$hide : false);
|
|
19
|
+
};
|
|
16
20
|
var VerticalMenuDropdown = function VerticalMenuDropdown(_ref) {
|
|
17
|
-
var _actionDropDown$filte2
|
|
21
|
+
var _actionDropDown$filte2;
|
|
18
22
|
var actionDropDown = _ref.actionDropDown,
|
|
19
23
|
handleMenuActions = _ref.handleMenuActions,
|
|
20
24
|
rowData = _ref.rowData,
|
|
@@ -51,11 +55,10 @@ var VerticalMenuDropdown = function VerticalMenuDropdown(_ref) {
|
|
|
51
55
|
var viewportPadding = 8;
|
|
52
56
|
var menuGap = 4;
|
|
53
57
|
var visibleItems = (_actionDropDown$filte = actionDropDown === null || actionDropDown === void 0 ? void 0 : actionDropDown.filter(function (item) {
|
|
54
|
-
|
|
55
|
-
return !item.hidden && !((_item$hide$call = (_item$hide = item.hide) === null || _item$hide === void 0 ? void 0 : _item$hide.call(item, rowData, rowIndex)) != null ? _item$hide$call : false);
|
|
58
|
+
return isActionVisible(item, rowData, rowIndex);
|
|
56
59
|
})) != null ? _actionDropDown$filte : [];
|
|
57
60
|
var menuWidth = menuRef.current && menuRef.current.offsetWidth > 0 ? menuRef.current.offsetWidth : Math.max(120, visibleItems.length * 48);
|
|
58
|
-
var menuHeight = visibleItems.length * 40;
|
|
61
|
+
var menuHeight = Math.max(visibleItems.length, 1) * 40;
|
|
59
62
|
var spaceBelow = window.innerHeight - rect.bottom;
|
|
60
63
|
var openBelow = spaceBelow >= menuHeight + menuGap;
|
|
61
64
|
var isRtl = (document.documentElement.getAttribute('dir') || document.body.getAttribute('dir') || getComputedStyle(document.documentElement).direction) === 'rtl';
|
|
@@ -87,10 +90,10 @@ var VerticalMenuDropdown = function VerticalMenuDropdown(_ref) {
|
|
|
87
90
|
cancelAnimationFrame(frame);
|
|
88
91
|
resizeObserver === null || resizeObserver === void 0 ? void 0 : resizeObserver.disconnect();
|
|
89
92
|
};
|
|
90
|
-
}, [openMenu]);
|
|
93
|
+
}, [openMenu, actionDropDown, rowData, rowIndex]);
|
|
91
94
|
(0, _react.useEffect)(function () {
|
|
92
95
|
if (!openMenu) return;
|
|
93
|
-
var
|
|
96
|
+
var handlePointerDown = function handlePointerDown(event) {
|
|
94
97
|
var _menuRef$current, _menuButtonRef$curren;
|
|
95
98
|
var target = event.target;
|
|
96
99
|
if ((_menuRef$current = menuRef.current) !== null && _menuRef$current !== void 0 && _menuRef$current.contains(target) || (_menuButtonRef$curren = menuButtonRef.current) !== null && _menuButtonRef$curren !== void 0 && _menuButtonRef$curren.contains(target)) {
|
|
@@ -101,14 +104,20 @@ var VerticalMenuDropdown = function VerticalMenuDropdown(_ref) {
|
|
|
101
104
|
var handleScroll = function handleScroll() {
|
|
102
105
|
return setOpenMenu(false);
|
|
103
106
|
};
|
|
104
|
-
|
|
107
|
+
|
|
108
|
+
// Defer so the opening click does not immediately close the menu.
|
|
109
|
+
var timeoutId = window.setTimeout(function () {
|
|
110
|
+
document.addEventListener('mousedown', handlePointerDown);
|
|
111
|
+
}, 0);
|
|
105
112
|
window.addEventListener('scroll', handleScroll, true);
|
|
106
113
|
return function () {
|
|
107
|
-
|
|
114
|
+
window.clearTimeout(timeoutId);
|
|
115
|
+
document.removeEventListener('mousedown', handlePointerDown);
|
|
108
116
|
window.removeEventListener('scroll', handleScroll, true);
|
|
109
117
|
};
|
|
110
118
|
}, [openMenu]);
|
|
111
119
|
(0, _react.useEffect)(function () {
|
|
120
|
+
if (!openMenu) return;
|
|
112
121
|
var scrollbarHandle = document.querySelector('.rs-table-scrollbar-handle');
|
|
113
122
|
if (!scrollbarHandle) return;
|
|
114
123
|
var observer = new MutationObserver(function (mutations) {
|
|
@@ -134,10 +143,21 @@ var VerticalMenuDropdown = function VerticalMenuDropdown(_ref) {
|
|
|
134
143
|
setOpenMenu(false);
|
|
135
144
|
};
|
|
136
145
|
var visibleCount = (_actionDropDown$filte2 = actionDropDown === null || actionDropDown === void 0 ? void 0 : actionDropDown.filter(function (item) {
|
|
137
|
-
|
|
138
|
-
return !item.hidden && !((_item$hide$call2 = (_item$hide2 = item.hide) === null || _item$hide2 === void 0 ? void 0 : _item$hide2.call(item, rowData, rowIndex)) != null ? _item$hide$call2 : false);
|
|
146
|
+
return isActionVisible(item, rowData, rowIndex);
|
|
139
147
|
}).length) != null ? _actionDropDown$filte2 : 0;
|
|
140
|
-
var portalTarget =
|
|
148
|
+
var portalTarget = document.getElementById('portal-root');
|
|
149
|
+
var toggleMenu = function toggleMenu() {
|
|
150
|
+
if (openMenu) {
|
|
151
|
+
setOpenMenu(false);
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
(0, _verticalMenuCoordinator.closeOtherVerticalMenus)(menuId);
|
|
155
|
+
updateMenuPosition();
|
|
156
|
+
// Delay open so table/document click handlers do not close it immediately.
|
|
157
|
+
window.setTimeout(function () {
|
|
158
|
+
setOpenMenu(true);
|
|
159
|
+
}, 0);
|
|
160
|
+
};
|
|
141
161
|
var dropdownContent = /*#__PURE__*/_react["default"].createElement("div", {
|
|
142
162
|
className: "absolute z-[60] min-w-48 rounded-md vertical-menu-dropdown-content",
|
|
143
163
|
ref: menuRef,
|
|
@@ -151,14 +171,12 @@ var VerticalMenuDropdown = function VerticalMenuDropdown(_ref) {
|
|
|
151
171
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
152
172
|
className: "py-1"
|
|
153
173
|
}, actionDropDown === null || actionDropDown === void 0 ? void 0 : actionDropDown.map(function (item) {
|
|
154
|
-
|
|
155
|
-
return !item.hidden && !((_item$hide$call3 = (_item$hide3 = item.hide) === null || _item$hide3 === void 0 ? void 0 : _item$hide3.call(item, rowData, rowIndex)) != null ? _item$hide$call3 : false) ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
174
|
+
return isActionVisible(item, rowData, rowIndex) ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
156
175
|
key: item.title,
|
|
157
176
|
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",
|
|
158
177
|
onClick: function onClick(e) {
|
|
159
|
-
var _item$action;
|
|
160
178
|
e.preventDefault();
|
|
161
|
-
|
|
179
|
+
e.stopPropagation();
|
|
162
180
|
handleMenuItemClick(item);
|
|
163
181
|
}
|
|
164
182
|
}, /*#__PURE__*/_react["default"].createElement(_ToolTip["default"], {
|
|
@@ -176,16 +194,11 @@ var VerticalMenuDropdown = function VerticalMenuDropdown(_ref) {
|
|
|
176
194
|
className: "inline-block vertical-menu-dropdown-wrapper"
|
|
177
195
|
}, visibleCount > 0 && /*#__PURE__*/_react["default"].createElement("button", {
|
|
178
196
|
type: "button",
|
|
179
|
-
className: "vertical-menu-trigger-button",
|
|
197
|
+
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",
|
|
180
198
|
onClick: function onClick(event) {
|
|
181
199
|
event.stopPropagation();
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
return;
|
|
185
|
-
}
|
|
186
|
-
(0, _verticalMenuCoordinator.closeOtherVerticalMenus)(menuId);
|
|
187
|
-
updateMenuPosition();
|
|
188
|
-
setOpenMenu(true);
|
|
200
|
+
event.preventDefault();
|
|
201
|
+
toggleMenu();
|
|
189
202
|
},
|
|
190
203
|
ref: menuButtonRef
|
|
191
204
|
}, /*#__PURE__*/_react["default"].createElement(_icons.ThreeDotIcon, null))), openMenu && portalTarget && /*#__PURE__*/_reactDom["default"].createPortal(dropdownContent, portalTarget));
|
|
@@ -75,7 +75,7 @@ var NoData = function NoData(_ref) {
|
|
|
75
75
|
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
76
76
|
fill: "#797979",
|
|
77
77
|
d: "M47.365 57.417a.926.926 0 00.926-.927v-1.777a.926.926 0 10-1.852 0v1.777c0 .512.415.927.926.927zM104.183 57.417a.926.926 0 00.926-.927v-1.777a.926.926 0 00-1.852 0v1.777c0 .512.414.927.926.927zM47.365 52.974a.926.926 0 00.926-.927V50.27a.926.926 0 00-1.852 0v1.777c0 .512.415.927.926.927zM104.183 52.974a.926.926 0 00.926-.927V50.27a.926.926 0 00-1.852 0v1.777c0 .512.414.927.926.927zM47.365 44.088a.926.926 0 00.926-.927v-1.777a.926.926 0 10-1.852 0v1.777c0 .512.415.927.926.927zM104.183 44.088a.926.926 0 00.926-.927v-1.777a.926.926 0 00-1.852 0v1.777c0 .512.414.927.926.927zM47.365 39.645a.926.926 0 00.926-.927v-1.777a.926.926 0 10-1.852 0v1.777c0 .512.415.927.926.927zM104.183 39.645a.926.926 0 00.926-.927v-1.777a.926.926 0 00-1.852 0v1.777c0 .512.414.927.926.927zM47.365 35.202a.926.926 0 00.926-.927v-1.777a.926.926 0 10-1.852 0v1.777c0 .512.415.927.926.927zM104.183 35.202a.926.926 0 00.926-.927v-1.777a.926.926 0 00-1.852 0v1.777c0 .512.414.927.926.927zM47.365 30.758a.926.926 0 00.926-.926v-.888c0-.248.02-.49.057-.726a.926.926 0 00-1.83-.288c-.052.33-.08.67-.08 1.014v.888c0 .512.416.926.927.926zM104.183 30.758a.926.926 0 00.926-.926v-.888c0-.345-.027-.683-.079-1.014a.926.926 0 10-1.83.288c.037.236.057.478.057.726v.888c0 .512.414.926.926.926zM47.881 26.426a.926.926 0 001.294-.204c.286-.394.633-.74 1.026-1.026a.926.926 0 00-1.09-1.498c-.55.4-1.034.884-1.434 1.434a.926.926 0 00.204 1.294zM103.667 26.426a.926.926 0 00.204-1.294 6.509 6.509 0 00-1.434-1.434.926.926 0 00-1.09 1.498c.393.286.74.632 1.026 1.026a.926.926 0 001.294.204zM51.138 23.597c.08.506.554.851 1.059.772a4.67 4.67 0 01.726-.057h.914a.926.926 0 000-1.852h-.914c-.344 0-.683.026-1.014.078a.926.926 0 00-.77 1.06zM100.41 23.597a.927.927 0 00-.771-1.059 6.522 6.522 0 00-1.014-.078h-.914a.926.926 0 100 1.852h.914c.248 0 .49.02.726.057a.926.926 0 001.059-.772zM55.653 23.386c0 .511.415.926.926.926h1.828a.926.926 0 000-1.852H56.58a.926.926 0 00-.926.926zM60.223 23.386c0 .511.415.926.926.926h1.828a.926.926 0 000-1.852H61.15a.926.926 0 00-.926.926zM64.793 23.386c0 .511.415.926.926.926h1.829a.926.926 0 000-1.852h-1.829a.926.926 0 00-.926.926zM69.364 23.386c0 .511.414.926.926.926h1.828a.926.926 0 000-1.852H70.29a.926.926 0 00-.927.926zM73.934 23.386c0 .511.414.926.926.926h1.828a.926.926 0 000-1.852H74.86a.926.926 0 00-.926.926zM78.504 23.386c0 .511.415.926.926.926h1.828a.926.926 0 000-1.852H79.43a.926.926 0 00-.926.926zM83.074 23.386c0 .511.415.926.927.926h1.828a.926.926 0 000-1.852H84a.926.926 0 00-.927.926zM87.644 23.386c0 .511.415.926.927.926h1.828a.926.926 0 000-1.852H88.57a.926.926 0 00-.927.926zM92.215 23.386c0 .511.414.926.926.926h1.828a.926.926 0 000-1.852h-1.828a.926.926 0 00-.926.926zM72.178 36.453a1.39 1.39 0 10-1.965 1.965l3.797 3.797-3.797 3.798a1.39 1.39 0 001.965 1.965l3.797-3.798 3.798 3.798a1.39 1.39 0 001.965-1.965l-3.798-3.798 3.798-3.797a1.39 1.39 0 10-1.965-1.965l-3.798 3.797-3.797-3.797z"
|
|
78
|
-
})),
|
|
78
|
+
})), ' '), /*#__PURE__*/_react["default"].createElement("p", {
|
|
79
79
|
className: "text-center text-common font-bold text-blackAlt nodata-title"
|
|
80
80
|
}, title), /*#__PURE__*/_react["default"].createElement("span", {
|
|
81
81
|
className: "text-xxs font-medium text-grey-medium nodata-sub-title"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getRowDisplayRange(totalRows: number, rowsPerPage: number, pageNumber: number): string;
|
|
1
|
+
export declare function getRowDisplayRange(totalRows: number, rowsPerPage: number, pageNumber: number, formatRange?: (start: number, end: number, total: number) => string): string;
|
|
@@ -2,8 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.getRowDisplayRange = getRowDisplayRange;
|
|
5
|
-
function getRowDisplayRange(totalRows, rowsPerPage, pageNumber) {
|
|
5
|
+
function getRowDisplayRange(totalRows, rowsPerPage, pageNumber, formatRange) {
|
|
6
|
+
if (formatRange === void 0) {
|
|
7
|
+
formatRange = function formatRange(start, end, total) {
|
|
8
|
+
return "Showing " + start + " to " + end + " of " + total;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
6
11
|
var start = (pageNumber - 1) * rowsPerPage + 1;
|
|
7
12
|
var end = Math.min(pageNumber * rowsPerPage, totalRows);
|
|
8
|
-
return
|
|
13
|
+
return formatRange(start != null ? start : 0, end != null ? end : 0, totalRows != null ? totalRows : 0);
|
|
9
14
|
}
|
|
@@ -158,7 +158,6 @@ var useCellDescriptor = function useCellDescriptor(props) {
|
|
|
158
158
|
if (treeCol) {
|
|
159
159
|
hasCustomTreeCol = true;
|
|
160
160
|
}
|
|
161
|
-
console.log(columns);
|
|
162
161
|
if ((columnChildren === null || columnChildren === void 0 ? void 0 : columnChildren.length) !== 2) {
|
|
163
162
|
throw new Error("Component <HeaderCell> and <Cell> is required, column index: " + index + " ");
|
|
164
163
|
}
|
|
@@ -31,6 +31,7 @@ interface ScrollListenerProps {
|
|
|
31
31
|
onTouchStart?: (event: React.TouchEvent) => void;
|
|
32
32
|
onTouchMove?: (event: React.TouchEvent) => void;
|
|
33
33
|
onTouchEnd?: (event: React.TouchEvent) => void;
|
|
34
|
+
handleInfiniteScroll?: (value: number) => void;
|
|
34
35
|
}
|
|
35
36
|
/**
|
|
36
37
|
* Add scroll, touch, and wheel monitoring events to the table,
|
|
@@ -72,7 +72,8 @@ var useScrollListener = function useScrollListener(props) {
|
|
|
72
72
|
contentHeight = props.contentHeight,
|
|
73
73
|
headerHeight = props.headerHeight,
|
|
74
74
|
rtl = props.rtl,
|
|
75
|
-
tableKey = props.tableKey
|
|
75
|
+
tableKey = props.tableKey,
|
|
76
|
+
handleInfiniteScroll = props.handleInfiniteScroll;
|
|
76
77
|
var wheelListener = (0, _react.useRef)(null);
|
|
77
78
|
var touchStartListener = (0, _react.useRef)(null);
|
|
78
79
|
var touchMoveListener = (0, _react.useRef)(null);
|
|
@@ -134,6 +135,9 @@ var useScrollListener = function useScrollListener(props) {
|
|
|
134
135
|
var x = Math.min(0, nextScrollX < minScrollX.current ? minScrollX.current : nextScrollX);
|
|
135
136
|
setScrollX(x);
|
|
136
137
|
setScrollY(y);
|
|
138
|
+
if (typeof handleInfiniteScroll === 'function' && deltaY !== 0 && !loading && Math.abs(y) + getTableHeight() >= contentHeight.current - 12) {
|
|
139
|
+
handleInfiniteScroll(scrollY.current);
|
|
140
|
+
}
|
|
137
141
|
onScroll === null || onScroll === void 0 ? void 0 : onScroll(Math.abs(x), Math.abs(y));
|
|
138
142
|
if (virtualized) {
|
|
139
143
|
// Add a state to the table during virtualized scrolling.
|
|
@@ -211,7 +215,6 @@ var useScrollListener = function useScrollListener(props) {
|
|
|
211
215
|
if (!isTouching.current) {
|
|
212
216
|
return;
|
|
213
217
|
}
|
|
214
|
-
console.log('handleTouchMove');
|
|
215
218
|
var _event$touches$2 = event.touches[0],
|
|
216
219
|
pageX = _event$touches$2.pageX,
|
|
217
220
|
pageY = _event$touches$2.pageY;
|
|
@@ -245,7 +248,6 @@ var useScrollListener = function useScrollListener(props) {
|
|
|
245
248
|
if (!isTouching.current) {
|
|
246
249
|
return;
|
|
247
250
|
}
|
|
248
|
-
console.log('handleTouchEnd');
|
|
249
251
|
isTouching.current = false;
|
|
250
252
|
var touchDuration = new Date().getTime() - momentumStartTime.current;
|
|
251
253
|
var absDeltaY = Math.abs(scrollY.current - momentumStartY.current);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qbs-react-grid",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.19",
|
|
4
4
|
"description": "A React table component",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"@commitlint/cli": "^13.1.0",
|
|
81
81
|
"@commitlint/config-conventional": "^13.1.0",
|
|
82
82
|
"@faker-js/faker": "^7.6.0",
|
|
83
|
-
"@testing-library/react": "^
|
|
83
|
+
"@testing-library/react": "^16.2.0",
|
|
84
84
|
"@types/lodash": "^4.14.165",
|
|
85
85
|
"@types/prop-types": "^15.7.1",
|
|
86
86
|
"@types/react": "^19.0.11",
|
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/HeaderCell.tsx
CHANGED
|
@@ -97,7 +97,6 @@ const HeaderCell = React.forwardRef((props: HeaderCellProps, ref: React.Ref<HTML
|
|
|
97
97
|
onSortColumn?.(sortKey ?? dataKey);
|
|
98
98
|
}
|
|
99
99
|
}, [dataKey, onSortColumn, sortable, sortKey]);
|
|
100
|
-
|
|
101
100
|
const handleColumnResizeStart = useCallback(() => {
|
|
102
101
|
onColumnResizeStart?.(columnWidth, left, !!fixed);
|
|
103
102
|
}, [columnWidth, fixed, left, onColumnResizeStart]);
|
package/src/Pagination.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { FC, useEffect, useState } from 'react';
|
|
2
2
|
|
|
3
3
|
import CustomSelect from './customSelect';
|
|
4
|
+
import { mergeLabels, type QbsTableLabels } from './qbsTable/labels';
|
|
4
5
|
import { getRowDisplayRange } from './qbsTable/utilities/tablecalc';
|
|
5
6
|
|
|
6
7
|
// Import the custom select component
|
|
@@ -15,6 +16,8 @@ type PageProps = {
|
|
|
15
16
|
onRowsPerPage?: (row: number, page: number) => void;
|
|
16
17
|
onPagination?: (row: number, page: number) => void;
|
|
17
18
|
};
|
|
19
|
+
labels?: QbsTableLabels;
|
|
20
|
+
dataTheme?: string;
|
|
18
21
|
};
|
|
19
22
|
|
|
20
23
|
const PageIndex = ({ currentPage, handleFirst, pageCount }) => {
|
|
@@ -52,7 +55,8 @@ const PageIndex = ({ currentPage, handleFirst, pageCount }) => {
|
|
|
52
55
|
return <>{renderPageNumbers()}</>;
|
|
53
56
|
};
|
|
54
57
|
|
|
55
|
-
const Pagination: FC<PageProps> = ({ paginationProps }) => {
|
|
58
|
+
const Pagination: FC<PageProps> = ({ paginationProps, labels: labelsProp, dataTheme }) => {
|
|
59
|
+
const labels = mergeLabels(labelsProp);
|
|
56
60
|
const {
|
|
57
61
|
dropOptions = [10, 20, 50, 100, 200],
|
|
58
62
|
currentPage = 1,
|
|
@@ -96,9 +100,12 @@ const Pagination: FC<PageProps> = ({ paginationProps }) => {
|
|
|
96
100
|
return (
|
|
97
101
|
<div
|
|
98
102
|
className="qbs-table-custom-pagination"
|
|
103
|
+
data-theme={dataTheme}
|
|
99
104
|
style={{ display: 'flex', justifyContent: 'space-between' }}
|
|
100
105
|
>
|
|
101
|
-
<div className="rows-count">
|
|
106
|
+
<div className="rows-count">
|
|
107
|
+
{getRowDisplayRange(total, rowsPerPageState, currentPage, labels.showingRange)}
|
|
108
|
+
</div>
|
|
102
109
|
<div className="qbs-table-pagination-right-block">
|
|
103
110
|
<button
|
|
104
111
|
className="qbs-table-icon-container"
|
|
@@ -194,7 +201,7 @@ const Pagination: FC<PageProps> = ({ paginationProps }) => {
|
|
|
194
201
|
</button>
|
|
195
202
|
</div>
|
|
196
203
|
<div className="qbs-table-pagination-flexBox">
|
|
197
|
-
<span className="qbs-table-pagination-text">
|
|
204
|
+
<span className="qbs-table-pagination-text">{labels.itemsPerPage}</span>
|
|
198
205
|
<CustomSelect
|
|
199
206
|
options={dropData}
|
|
200
207
|
selectedValue={rowsPerPageState}
|