qbs-react-grid 2.2.4 → 2.2.6

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.
Files changed (100) hide show
  1. package/dist/css/qbs-react-grid.css +1 -1
  2. package/dist/css/qbs-react-grid.min.css +1 -1
  3. package/dist/css/qbs-react-grid.min.css.map +1 -1
  4. package/es/Cell.js +1 -2
  5. package/es/Pagination.d.ts +0 -3
  6. package/es/Pagination.js +3 -8
  7. package/es/Table.d.ts +0 -3
  8. package/es/Table.js +12 -18
  9. package/es/index.d.ts +1 -1
  10. package/es/less/pagination.less +9 -9
  11. package/es/less/qbs-table.less +73 -205
  12. package/es/qbsTable/CustomTableCell.js +15 -11
  13. package/es/qbsTable/QbsTable.js +48 -124
  14. package/es/qbsTable/TableCardList.js +41 -52
  15. package/es/qbsTable/Toolbar.js +13 -62
  16. package/es/qbsTable/commontypes.d.ts +3 -30
  17. package/es/qbsTable/utilities/CardComponent.d.ts +0 -2
  18. package/es/qbsTable/utilities/CardComponent.js +3 -7
  19. package/es/qbsTable/utilities/CardMenuDropdown.d.ts +0 -2
  20. package/es/qbsTable/utilities/CardMenuDropdown.js +7 -7
  21. package/es/qbsTable/utilities/ColumShowHide.d.ts +0 -4
  22. package/es/qbsTable/utilities/ColumShowHide.js +6 -9
  23. package/es/qbsTable/utilities/SearchInput.d.ts +0 -1
  24. package/es/qbsTable/utilities/SearchInput.js +1 -3
  25. package/es/qbsTable/utilities/ToolTip.d.ts +1 -8
  26. package/es/qbsTable/utilities/ToolTip.js +31 -107
  27. package/es/qbsTable/utilities/VerticalDropDownMenu.d.ts +7 -9
  28. package/es/qbsTable/utilities/VerticalDropDownMenu.js +71 -63
  29. package/es/qbsTable/utilities/empty.js +1 -1
  30. package/es/qbsTable/utilities/icons.d.ts +0 -3
  31. package/es/qbsTable/utilities/icons.js +1 -65
  32. package/es/qbsTable/utilities/tablecalc.d.ts +1 -1
  33. package/es/qbsTable/utilities/tablecalc.js +2 -7
  34. package/es/utils/useCellDescriptor.js +1 -0
  35. package/es/utils/useScrollListener.d.ts +0 -1
  36. package/es/utils/useScrollListener.js +3 -5
  37. package/lib/Cell.js +1 -2
  38. package/lib/Pagination.d.ts +0 -3
  39. package/lib/Pagination.js +3 -8
  40. package/lib/Table.d.ts +0 -3
  41. package/lib/Table.js +12 -18
  42. package/lib/index.d.ts +1 -1
  43. package/lib/less/pagination.less +9 -9
  44. package/lib/less/qbs-table.less +73 -205
  45. package/lib/qbsTable/CustomTableCell.js +15 -11
  46. package/lib/qbsTable/QbsTable.js +48 -124
  47. package/lib/qbsTable/TableCardList.js +41 -52
  48. package/lib/qbsTable/Toolbar.js +12 -61
  49. package/lib/qbsTable/commontypes.d.ts +3 -30
  50. package/lib/qbsTable/utilities/CardComponent.d.ts +0 -2
  51. package/lib/qbsTable/utilities/CardComponent.js +3 -7
  52. package/lib/qbsTable/utilities/CardMenuDropdown.d.ts +0 -2
  53. package/lib/qbsTable/utilities/CardMenuDropdown.js +5 -6
  54. package/lib/qbsTable/utilities/ColumShowHide.d.ts +0 -4
  55. package/lib/qbsTable/utilities/ColumShowHide.js +6 -9
  56. package/lib/qbsTable/utilities/SearchInput.d.ts +0 -1
  57. package/lib/qbsTable/utilities/SearchInput.js +1 -3
  58. package/lib/qbsTable/utilities/ToolTip.d.ts +1 -8
  59. package/lib/qbsTable/utilities/ToolTip.js +30 -107
  60. package/lib/qbsTable/utilities/VerticalDropDownMenu.d.ts +7 -9
  61. package/lib/qbsTable/utilities/VerticalDropDownMenu.js +71 -63
  62. package/lib/qbsTable/utilities/empty.js +1 -1
  63. package/lib/qbsTable/utilities/icons.d.ts +0 -3
  64. package/lib/qbsTable/utilities/icons.js +3 -70
  65. package/lib/qbsTable/utilities/tablecalc.d.ts +1 -1
  66. package/lib/qbsTable/utilities/tablecalc.js +2 -7
  67. package/lib/utils/useCellDescriptor.js +1 -0
  68. package/lib/utils/useScrollListener.d.ts +0 -1
  69. package/lib/utils/useScrollListener.js +3 -5
  70. package/package.json +10 -2
  71. package/src/Cell.tsx +1 -3
  72. package/src/HeaderCell.tsx +1 -0
  73. package/src/Pagination.tsx +3 -10
  74. package/src/Table.tsx +10 -23
  75. package/src/customSelect.tsx +88 -88
  76. package/src/index.ts +1 -1
  77. package/src/less/pagination.less +9 -9
  78. package/src/less/qbs-table.less +73 -205
  79. package/src/qbsTable/CustomTableCell.tsx +23 -27
  80. package/src/qbsTable/QbsTable.tsx +26 -100
  81. package/src/qbsTable/TableCardList.tsx +20 -34
  82. package/src/qbsTable/Toolbar.tsx +11 -53
  83. package/src/qbsTable/commontypes.ts +2 -32
  84. package/src/qbsTable/utilities/CardComponent.tsx +2 -7
  85. package/src/qbsTable/utilities/CardMenuDropdown.tsx +6 -11
  86. package/src/qbsTable/utilities/ColumShowHide.tsx +6 -33
  87. package/src/qbsTable/utilities/SearchInput.tsx +1 -3
  88. package/src/qbsTable/utilities/ToolTip.tsx +27 -138
  89. package/src/qbsTable/utilities/VerticalDropDownMenu.tsx +89 -74
  90. package/src/qbsTable/utilities/empty.tsx +2 -2
  91. package/src/qbsTable/utilities/icons.tsx +1 -78
  92. package/src/qbsTable/utilities/tablecalc.ts +2 -8
  93. package/src/utils/useCellDescriptor.ts +1 -0
  94. package/src/utils/useScrollListener.ts +3 -13
  95. package/src/utils/useTableRows.ts +1 -1
  96. package/es/qbsTable/labels.d.ts +0 -48
  97. package/es/qbsTable/labels.js +0 -34
  98. package/lib/qbsTable/labels.d.ts +0 -48
  99. package/lib/qbsTable/labels.js +0 -42
  100. package/src/qbsTable/labels.ts +0 -58
@@ -5,7 +5,7 @@ export const ThreeDotIcon: React.FC<any> = () => {
5
5
  <svg width="4" height="16" viewBox="0 0 4 16" fill="none" xmlns="http://www.w3.org/2000/svg">
6
6
  <path
7
7
  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"
8
- stroke="currentColor"
8
+ stroke="#313131"
9
9
  strokeWidth="1.5"
10
10
  strokeLinecap="round"
11
11
  strokeLinejoin="round"
@@ -134,80 +134,3 @@ export const TableView: React.FC<any> = ({ className }) => {
134
134
  </svg>
135
135
  );
136
136
  };
137
-
138
- export const ExpandIcon: React.FC<any> = ({ className }) => {
139
- return (
140
- <svg
141
- width="16"
142
- height="16"
143
- className={className}
144
- viewBox="0 0 16 16"
145
- fill="none"
146
- xmlns="http://www.w3.org/2000/svg"
147
- >
148
- <path
149
- 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"
150
- stroke="#585858"
151
- strokeWidth="1.5"
152
- strokeLinecap="round"
153
- strokeLinejoin="round"
154
- />
155
- </svg>
156
- );
157
- };
158
- export const ContentView: React.FC<any> = ({ className }) => {
159
- return (
160
- <svg
161
- width="16"
162
- height="17"
163
- className={className}
164
- viewBox="0 0 16 17"
165
- fill="none"
166
- xmlns="http://www.w3.org/2000/svg"
167
- >
168
- <path
169
- 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"
170
- stroke="#585858"
171
- strokeLinecap="round"
172
- strokeLinejoin="round"
173
- />
174
- <path
175
- 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"
176
- stroke="#585858"
177
- strokeLinecap="round"
178
- strokeLinejoin="round"
179
- />
180
- </svg>
181
- );
182
- };
183
- export const DefaultView: React.FC<any> = ({ className }) => {
184
- return (
185
- <svg
186
- width="16"
187
- height="17"
188
- className={className}
189
- viewBox="0 0 16 17"
190
- fill="none"
191
- xmlns="http://www.w3.org/2000/svg"
192
- >
193
- <path
194
- fillRule="evenodd"
195
- clipRule="evenodd"
196
- 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"
197
- fill="#585858"
198
- />
199
- <path
200
- fillRule="evenodd"
201
- clipRule="evenodd"
202
- 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"
203
- fill="#585858"
204
- />
205
- <path
206
- fillRule="evenodd"
207
- clipRule="evenodd"
208
- 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"
209
- fill="#585858"
210
- />
211
- </svg>
212
- );
213
- };
@@ -1,12 +1,6 @@
1
- export function getRowDisplayRange(
2
- totalRows: number,
3
- rowsPerPage: number,
4
- pageNumber: number,
5
- formatRange: (start: number, end: number, total: number) => string = (start, end, total) =>
6
- `Showing ${start} to ${end} of ${total}`
7
- ) {
1
+ export function getRowDisplayRange(totalRows: number, rowsPerPage: number, pageNumber: number) {
8
2
  const start = (pageNumber - 1) * rowsPerPage + 1;
9
3
  const end = Math.min(pageNumber * rowsPerPage, totalRows);
10
4
 
11
- return formatRange(start ?? 0, end ?? 0, totalRows ?? 0);
5
+ return `Showing ${start ?? 0} to ${end ?? 0} of ${totalRows ?? 0}`;
12
6
  }
@@ -205,6 +205,7 @@ const useCellDescriptor = <Row extends RowDataType>(
205
205
  if (treeCol) {
206
206
  hasCustomTreeCol = true;
207
207
  }
208
+ console.log(columns);
208
209
 
209
210
  if (columnChildren?.length !== 2) {
210
211
  throw new Error(`Component <HeaderCell> and <Cell> is required, column index: ${index} `);
@@ -4,7 +4,6 @@ import scrollLeft from 'dom-lib/scrollLeft';
4
4
  import scrollTop from 'dom-lib/scrollTop';
5
5
  import WheelHandler from 'dom-lib/WheelHandler';
6
6
  import React, { useCallback, useEffect, useRef, useState } from 'react';
7
-
8
7
  import type { ListenerCallback, RowDataType } from '../@types/common';
9
8
  import { BEZIER, SCROLLBAR_WIDTH, TRANSITION_DURATION } from '../constants';
10
9
  import type { ScrollbarInstance } from '../Scrollbar';
@@ -51,7 +50,6 @@ interface ScrollListenerProps {
51
50
  onTouchStart?: (event: React.TouchEvent) => void;
52
51
  onTouchMove?: (event: React.TouchEvent) => void;
53
52
  onTouchEnd?: (event: React.TouchEvent) => void;
54
- handleInfiniteScroll?: (value: number) => void;
55
53
  }
56
54
 
57
55
  /**
@@ -108,8 +106,7 @@ const useScrollListener = (props: ScrollListenerProps) => {
108
106
  contentHeight,
109
107
  headerHeight,
110
108
  rtl,
111
- tableKey,
112
- handleInfiniteScroll
109
+ tableKey
113
110
  } = props;
114
111
 
115
112
  const wheelListener = useRef<ListenerCallback>(null);
@@ -190,15 +187,6 @@ const useScrollListener = (props: ScrollListenerProps) => {
190
187
  setScrollX(x);
191
188
  setScrollY(y);
192
189
 
193
- if (
194
- typeof handleInfiniteScroll === 'function' &&
195
- deltaY !== 0 &&
196
- !loading &&
197
- Math.abs(y) + getTableHeight() >= contentHeight.current - 12
198
- ) {
199
- handleInfiniteScroll(scrollY.current);
200
- }
201
-
202
190
  onScroll?.(Math.abs(x), Math.abs(y));
203
191
 
204
192
  if (virtualized) {
@@ -309,6 +297,7 @@ const useScrollListener = (props: ScrollListenerProps) => {
309
297
  if (!isTouching.current) {
310
298
  return;
311
299
  }
300
+ console.log('handleTouchMove');
312
301
 
313
302
  const { pageX, pageY } = event.touches[0];
314
303
  const deltaX = touchX.current - pageX;
@@ -349,6 +338,7 @@ const useScrollListener = (props: ScrollListenerProps) => {
349
338
  if (!isTouching.current) {
350
339
  return;
351
340
  }
341
+ console.log('handleTouchEnd');
352
342
  isTouching.current = false;
353
343
  const touchDuration = new Date().getTime() - momentumStartTime.current;
354
344
  const absDeltaY = Math.abs(scrollY.current - momentumStartY.current);
@@ -8,7 +8,7 @@ import defer from './defer';
8
8
 
9
9
  interface TableRowsProps<Row, Key> {
10
10
  prefix: (str: string) => string;
11
- wordWrap?: boolean | 'break-all' | 'break-word' | 'keep-all' | 'fit-content';
11
+ wordWrap?: boolean | 'break-all' | 'break-word' | 'keep-all'| 'fit-content';
12
12
  data: readonly Row[];
13
13
  expandedRowKeys: readonly Key[];
14
14
  }
@@ -1,48 +0,0 @@
1
- export interface QbsTableLabels {
2
- search?: string;
3
- searchAriaLabel?: string;
4
- clear?: string;
5
- selectedItems?: string;
6
- switchToDefaultView?: string;
7
- switchToRelaxedView?: string;
8
- switchToFullScreen?: string;
9
- switchToTableView?: string;
10
- switchToCardView?: string;
11
- noDataFound?: string;
12
- showingRange?: (start: number, end: number, total: number) => string;
13
- itemsPerPage?: string;
14
- fixedColumns?: string;
15
- visibleColumns?: string;
16
- availableColumns?: string;
17
- resetToDefault?: string;
18
- save?: string;
19
- viewMore?: string;
20
- viewLess?: string;
21
- actions?: string;
22
- }
23
- export declare const DEFAULT_QBS_TABLE_LABELS: Required<Omit<QbsTableLabels, 'showingRange'>> & {
24
- showingRange: (start: number, end: number, total: number) => string;
25
- };
26
- export declare const mergeLabels: (labels?: QbsTableLabels) => {
27
- showingRange: (start: number, end: number, total: number) => string;
28
- search: string;
29
- searchAriaLabel: string;
30
- clear: string;
31
- selectedItems: string;
32
- switchToDefaultView: string;
33
- switchToRelaxedView: string;
34
- switchToFullScreen: string;
35
- switchToTableView: string;
36
- switchToCardView: string;
37
- noDataFound: string;
38
- itemsPerPage: string;
39
- fixedColumns: string;
40
- visibleColumns: string;
41
- availableColumns: string;
42
- resetToDefault: string;
43
- save: string;
44
- viewMore: string;
45
- viewLess: string;
46
- actions: string;
47
- };
48
- export declare const formatSelectedItems: (selectedItemsLabel: string, count: number) => string;
@@ -1,34 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- export var DEFAULT_QBS_TABLE_LABELS = {
3
- search: 'Search',
4
- searchAriaLabel: 'Search',
5
- clear: 'Clear',
6
- selectedItems: 'Selected Items',
7
- switchToDefaultView: 'Switch to Default View',
8
- switchToRelaxedView: 'Switch to Relaxed View',
9
- switchToFullScreen: 'Switch to Full Screen',
10
- switchToTableView: 'Switch to Table View',
11
- switchToCardView: 'Switch to Card View',
12
- noDataFound: 'No Data Found',
13
- showingRange: function showingRange(start, end, total) {
14
- return "Showing " + start + " to " + end + " of " + total;
15
- },
16
- itemsPerPage: 'Items per page',
17
- fixedColumns: 'FIXED COLUMNS',
18
- visibleColumns: 'VISIBLE COLUMNS',
19
- availableColumns: 'AVAILABLE COLUMNS',
20
- resetToDefault: 'Reset to default',
21
- save: 'Save',
22
- viewMore: 'View More',
23
- viewLess: 'View Less',
24
- actions: 'Actions'
25
- };
26
- export var mergeLabels = function mergeLabels(labels) {
27
- var _labels$showingRange;
28
- return _extends({}, DEFAULT_QBS_TABLE_LABELS, labels, {
29
- showingRange: (_labels$showingRange = labels === null || labels === void 0 ? void 0 : labels.showingRange) != null ? _labels$showingRange : DEFAULT_QBS_TABLE_LABELS.showingRange
30
- });
31
- };
32
- export var formatSelectedItems = function formatSelectedItems(selectedItemsLabel, count) {
33
- return selectedItemsLabel + "(" + count + ") ";
34
- };
@@ -1,48 +0,0 @@
1
- export interface QbsTableLabels {
2
- search?: string;
3
- searchAriaLabel?: string;
4
- clear?: string;
5
- selectedItems?: string;
6
- switchToDefaultView?: string;
7
- switchToRelaxedView?: string;
8
- switchToFullScreen?: string;
9
- switchToTableView?: string;
10
- switchToCardView?: string;
11
- noDataFound?: string;
12
- showingRange?: (start: number, end: number, total: number) => string;
13
- itemsPerPage?: string;
14
- fixedColumns?: string;
15
- visibleColumns?: string;
16
- availableColumns?: string;
17
- resetToDefault?: string;
18
- save?: string;
19
- viewMore?: string;
20
- viewLess?: string;
21
- actions?: string;
22
- }
23
- export declare const DEFAULT_QBS_TABLE_LABELS: Required<Omit<QbsTableLabels, 'showingRange'>> & {
24
- showingRange: (start: number, end: number, total: number) => string;
25
- };
26
- export declare const mergeLabels: (labels?: QbsTableLabels) => {
27
- showingRange: (start: number, end: number, total: number) => string;
28
- search: string;
29
- searchAriaLabel: string;
30
- clear: string;
31
- selectedItems: string;
32
- switchToDefaultView: string;
33
- switchToRelaxedView: string;
34
- switchToFullScreen: string;
35
- switchToTableView: string;
36
- switchToCardView: string;
37
- noDataFound: string;
38
- itemsPerPage: string;
39
- fixedColumns: string;
40
- visibleColumns: string;
41
- availableColumns: string;
42
- resetToDefault: string;
43
- save: string;
44
- viewMore: string;
45
- viewLess: string;
46
- actions: string;
47
- };
48
- export declare const formatSelectedItems: (selectedItemsLabel: string, count: number) => string;
@@ -1,42 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- exports.__esModule = true;
5
- exports.mergeLabels = exports.formatSelectedItems = exports.DEFAULT_QBS_TABLE_LABELS = void 0;
6
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
7
- var DEFAULT_QBS_TABLE_LABELS = {
8
- search: 'Search',
9
- searchAriaLabel: 'Search',
10
- clear: 'Clear',
11
- selectedItems: 'Selected Items',
12
- switchToDefaultView: 'Switch to Default View',
13
- switchToRelaxedView: 'Switch to Relaxed View',
14
- switchToFullScreen: 'Switch to Full Screen',
15
- switchToTableView: 'Switch to Table View',
16
- switchToCardView: 'Switch to Card View',
17
- noDataFound: 'No Data Found',
18
- showingRange: function showingRange(start, end, total) {
19
- return "Showing " + start + " to " + end + " of " + total;
20
- },
21
- itemsPerPage: 'Items per page',
22
- fixedColumns: 'FIXED COLUMNS',
23
- visibleColumns: 'VISIBLE COLUMNS',
24
- availableColumns: 'AVAILABLE COLUMNS',
25
- resetToDefault: 'Reset to default',
26
- save: 'Save',
27
- viewMore: 'View More',
28
- viewLess: 'View Less',
29
- actions: 'Actions'
30
- };
31
- exports.DEFAULT_QBS_TABLE_LABELS = DEFAULT_QBS_TABLE_LABELS;
32
- var mergeLabels = function mergeLabels(labels) {
33
- var _labels$showingRange;
34
- return (0, _extends2["default"])({}, DEFAULT_QBS_TABLE_LABELS, labels, {
35
- showingRange: (_labels$showingRange = labels === null || labels === void 0 ? void 0 : labels.showingRange) != null ? _labels$showingRange : DEFAULT_QBS_TABLE_LABELS.showingRange
36
- });
37
- };
38
- exports.mergeLabels = mergeLabels;
39
- var formatSelectedItems = function formatSelectedItems(selectedItemsLabel, count) {
40
- return selectedItemsLabel + "(" + count + ") ";
41
- };
42
- exports.formatSelectedItems = formatSelectedItems;
@@ -1,58 +0,0 @@
1
- export interface QbsTableLabels {
2
- search?: string;
3
- searchAriaLabel?: string;
4
- clear?: string;
5
- selectedItems?: string;
6
- switchToDefaultView?: string;
7
- switchToRelaxedView?: string;
8
- switchToFullScreen?: string;
9
- switchToTableView?: string;
10
- switchToCardView?: string;
11
- noDataFound?: string;
12
- showingRange?: (start: number, end: number, total: number) => string;
13
- itemsPerPage?: string;
14
- fixedColumns?: string;
15
- visibleColumns?: string;
16
- availableColumns?: string;
17
- resetToDefault?: string;
18
- save?: string;
19
- viewMore?: string;
20
- viewLess?: string;
21
- actions?: string;
22
- }
23
-
24
- export const DEFAULT_QBS_TABLE_LABELS: Required<
25
- Omit<QbsTableLabels, 'showingRange'>
26
- > & {
27
- showingRange: (start: number, end: number, total: number) => string;
28
- } = {
29
- search: 'Search',
30
- searchAriaLabel: 'Search',
31
- clear: 'Clear',
32
- selectedItems: 'Selected Items',
33
- switchToDefaultView: 'Switch to Default View',
34
- switchToRelaxedView: 'Switch to Relaxed View',
35
- switchToFullScreen: 'Switch to Full Screen',
36
- switchToTableView: 'Switch to Table View',
37
- switchToCardView: 'Switch to Card View',
38
- noDataFound: 'No Data Found',
39
- showingRange: (start, end, total) => `Showing ${start} to ${end} of ${total}`,
40
- itemsPerPage: 'Items per page',
41
- fixedColumns: 'FIXED COLUMNS',
42
- visibleColumns: 'VISIBLE COLUMNS',
43
- availableColumns: 'AVAILABLE COLUMNS',
44
- resetToDefault: 'Reset to default',
45
- save: 'Save',
46
- viewMore: 'View More',
47
- viewLess: 'View Less',
48
- actions: 'Actions'
49
- };
50
-
51
- export const mergeLabels = (labels?: QbsTableLabels) => ({
52
- ...DEFAULT_QBS_TABLE_LABELS,
53
- ...labels,
54
- showingRange: labels?.showingRange ?? DEFAULT_QBS_TABLE_LABELS.showingRange
55
- });
56
-
57
- export const formatSelectedItems = (selectedItemsLabel: string, count: number) =>
58
- `${selectedItemsLabel}(${count}) `;