qbs-react-grid 2.2.3 → 2.2.5

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 +2 -13
  13. package/es/qbsTable/QbsTable.js +46 -124
  14. package/es/qbsTable/TableCardList.js +39 -52
  15. package/es/qbsTable/Toolbar.js +13 -62
  16. package/es/qbsTable/commontypes.d.ts +2 -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/empty.js +1 -1
  28. package/es/qbsTable/utilities/icons.d.ts +0 -3
  29. package/es/qbsTable/utilities/icons.js +1 -65
  30. package/es/qbsTable/utilities/tablecalc.d.ts +1 -1
  31. package/es/qbsTable/utilities/tablecalc.js +2 -7
  32. package/es/utils/useCellDescriptor.js +1 -0
  33. package/es/utils/useScrollListener.d.ts +0 -1
  34. package/es/utils/useScrollListener.js +3 -5
  35. package/lib/Cell.js +1 -2
  36. package/lib/Pagination.d.ts +0 -3
  37. package/lib/Pagination.js +3 -8
  38. package/lib/Table.d.ts +0 -3
  39. package/lib/Table.js +12 -18
  40. package/lib/index.d.ts +1 -1
  41. package/lib/less/pagination.less +9 -9
  42. package/lib/less/qbs-table.less +73 -205
  43. package/lib/qbsTable/CustomTableCell.js +2 -13
  44. package/lib/qbsTable/QbsTable.js +46 -124
  45. package/lib/qbsTable/TableCardList.js +39 -52
  46. package/lib/qbsTable/Toolbar.js +12 -61
  47. package/lib/qbsTable/commontypes.d.ts +2 -30
  48. package/lib/qbsTable/utilities/CardComponent.d.ts +0 -2
  49. package/lib/qbsTable/utilities/CardComponent.js +3 -7
  50. package/lib/qbsTable/utilities/CardMenuDropdown.d.ts +0 -2
  51. package/lib/qbsTable/utilities/CardMenuDropdown.js +5 -6
  52. package/lib/qbsTable/utilities/ColumShowHide.d.ts +0 -4
  53. package/lib/qbsTable/utilities/ColumShowHide.js +6 -9
  54. package/lib/qbsTable/utilities/SearchInput.d.ts +0 -1
  55. package/lib/qbsTable/utilities/SearchInput.js +1 -3
  56. package/lib/qbsTable/utilities/ToolTip.d.ts +1 -8
  57. package/lib/qbsTable/utilities/ToolTip.js +30 -107
  58. package/lib/qbsTable/utilities/empty.js +1 -1
  59. package/lib/qbsTable/utilities/icons.d.ts +0 -3
  60. package/lib/qbsTable/utilities/icons.js +3 -70
  61. package/lib/qbsTable/utilities/tablecalc.d.ts +1 -1
  62. package/lib/qbsTable/utilities/tablecalc.js +2 -7
  63. package/lib/utils/useCellDescriptor.js +1 -0
  64. package/lib/utils/useScrollListener.d.ts +0 -1
  65. package/lib/utils/useScrollListener.js +3 -5
  66. package/package.json +2 -2
  67. package/src/Cell.tsx +1 -3
  68. package/src/HeaderCell.tsx +1 -0
  69. package/src/Pagination.tsx +3 -10
  70. package/src/Table.tsx +10 -23
  71. package/src/customSelect.tsx +88 -88
  72. package/src/index.ts +1 -1
  73. package/src/less/pagination.less +9 -9
  74. package/src/less/qbs-table.less +73 -205
  75. package/src/qbsTable/CustomTableCell.tsx +9 -31
  76. package/src/qbsTable/QbsTable.tsx +25 -101
  77. package/src/qbsTable/TableCardList.tsx +19 -35
  78. package/src/qbsTable/Toolbar.tsx +11 -53
  79. package/src/qbsTable/commontypes.ts +1 -32
  80. package/src/qbsTable/utilities/CardComponent.tsx +2 -7
  81. package/src/qbsTable/utilities/CardMenuDropdown.tsx +6 -11
  82. package/src/qbsTable/utilities/ColumShowHide.tsx +6 -33
  83. package/src/qbsTable/utilities/SearchInput.tsx +1 -3
  84. package/src/qbsTable/utilities/ToolTip.tsx +27 -138
  85. package/src/qbsTable/utilities/empty.tsx +2 -2
  86. package/src/qbsTable/utilities/icons.tsx +1 -78
  87. package/src/qbsTable/utilities/tablecalc.ts +2 -8
  88. package/src/utils/useCellDescriptor.ts +1 -0
  89. package/src/utils/useScrollListener.ts +3 -13
  90. package/src/utils/useTableRows.ts +1 -1
  91. package/es/qbsTable/labels.d.ts +0 -48
  92. package/es/qbsTable/labels.js +0 -34
  93. package/es/qbsTable/utilities/VerticalDropDownMenu.d.ts +0 -13
  94. package/es/qbsTable/utilities/VerticalDropDownMenu.js +0 -166
  95. package/lib/qbsTable/labels.d.ts +0 -48
  96. package/lib/qbsTable/labels.js +0 -42
  97. package/lib/qbsTable/utilities/VerticalDropDownMenu.d.ts +0 -13
  98. package/lib/qbsTable/utilities/VerticalDropDownMenu.js +0 -174
  99. package/src/qbsTable/labels.ts +0 -58
  100. package/src/qbsTable/utilities/VerticalDropDownMenu.tsx +0 -187
@@ -1,13 +1,12 @@
1
1
  import React, { useCallback, useRef, useState } from 'react';
2
2
  import useResponsiveStore from '../utils/useResponsiveStore';
3
3
  import debounce from './utilities/debounce';
4
- import { CardView, ContentView, DefaultView, ExpandIcon, TableView } from './utilities/icons';
4
+ import { CardView, TableView } from './utilities/icons';
5
5
  import SearchInput from './utilities/SearchInput';
6
- import { formatSelectedItems, mergeLabels } from './labels';
7
6
  import { getRowDisplayRange } from './utilities/tablecalc';
8
7
  import TooltipComponent from './utilities/ToolTip';
9
8
  var ToolBar = function ToolBar(_ref) {
10
- var _checkedKeys$length, _paginationProps$tota, _paginationProps$rows, _paginationProps$curr;
9
+ var _paginationProps$tota, _paginationProps$rows, _paginationProps$curr;
11
10
  var pagination = _ref.pagination,
12
11
  _ref$paginationProps = _ref.paginationProps,
13
12
  paginationProps = _ref$paginationProps === void 0 ? {} : _ref$paginationProps,
@@ -28,19 +27,7 @@ var ToolBar = function ToolBar(_ref) {
28
27
  tableViewToggle = _ref.tableViewToggle,
29
28
  setTableViewToggle = _ref.setTableViewToggle,
30
29
  _ref$enableTableToggl = _ref.enableTableToggle,
31
- enableTableToggle = _ref$enableTableToggl === void 0 ? false : _ref$enableTableToggl,
32
- _ref$rowViewToggle = _ref.rowViewToggle,
33
- rowViewToggle = _ref$rowViewToggle === void 0 ? false : _ref$rowViewToggle,
34
- _ref$defaultRowView = _ref.defaultRowView,
35
- defaultRowView = _ref$defaultRowView === void 0 ? true : _ref$defaultRowView,
36
- _ref$fullWidthView = _ref.fullWidthView,
37
- fullWidthView = _ref$fullWidthView === void 0 ? false : _ref$fullWidthView,
38
- setTableFullView = _ref.setTableFullView,
39
- setRowViewToggle = _ref.setRowViewToggle,
40
- _ref$isFullScreen = _ref.isFullScreen,
41
- isFullScreen = _ref$isFullScreen === void 0 ? false : _ref$isFullScreen,
42
- labelsProp = _ref.labels;
43
- var labels = mergeLabels(labelsProp);
30
+ enableTableToggle = _ref$enableTableToggl === void 0 ? false : _ref$enableTableToggl;
44
31
  var debouncedOnSearch = useCallback(debounce(onSearch != null ? onSearch : function () {}, 1000), [onSearch]);
45
32
  var _useState = useState(searchValue),
46
33
  searchParam = _useState[0],
@@ -89,8 +76,7 @@ var ToolBar = function ToolBar(_ref) {
89
76
  }, /*#__PURE__*/React.createElement("div", {
90
77
  className: "qbs-table-primary-filter"
91
78
  }, search && /*#__PURE__*/React.createElement(SearchInput, {
92
- placeholder: searchPlaceholder != null ? searchPlaceholder : labels.search,
93
- searchAriaLabel: labels.searchAriaLabel,
79
+ placeholder: searchPlaceholder != null ? searchPlaceholder : 'Search',
94
80
  handleChange: handleChange,
95
81
  handleSearch: handleSearch,
96
82
  searchValue: searchParam
@@ -111,45 +97,12 @@ var ToolBar = function ToolBar(_ref) {
111
97
  strokeLinejoin: "round",
112
98
  d: "M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 0 1-.659 1.591l-5.432 5.432a2.25 2.25 0 0 0-.659 1.591v2.927a2.25 2.25 0 0 1-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 0 0-.659-1.591L3.659 7.409A2.25 2.25 0 0 1 3 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0 1 12 3Z"
113
99
  }))), tableHeaderActions, /*#__PURE__*/React.createElement("div", {
114
- className: " pr-1 cursor-pointer relative table_custom_ctions "
115
- }, (rowViewToggle || isFullScreen) && /*#__PURE__*/React.createElement("div", {
116
- className: "flex gap-2 qbs-row-switch-cntainer"
117
- }, rowViewToggle && /*#__PURE__*/React.createElement("div", {
118
- className: "flex gap-2 table_cell_style"
119
- }, /*#__PURE__*/React.createElement(TooltipComponent, {
120
- tableBodyRef: toolbarRef,
121
- title: labels.switchToDefaultView
122
- }, /*#__PURE__*/React.createElement("div", {
123
- onClick: function onClick() {
124
- return setRowViewToggle === null || setRowViewToggle === void 0 ? void 0 : setRowViewToggle(true);
125
- }
126
- }, /*#__PURE__*/React.createElement(DefaultView, {
127
- className: "" + (defaultRowView ? 'active' : '')
128
- }))), /*#__PURE__*/React.createElement(TooltipComponent, {
129
- tableBodyRef: toolbarRef,
130
- title: labels.switchToRelaxedView
131
- }, /*#__PURE__*/React.createElement("div", {
132
- onClick: function onClick() {
133
- return setRowViewToggle === null || setRowViewToggle === void 0 ? void 0 : setRowViewToggle(false);
134
- }
135
- }, /*#__PURE__*/React.createElement(ContentView, {
136
- className: "" + (!defaultRowView ? 'active' : '')
137
- })))), isFullScreen && /*#__PURE__*/React.createElement("div", {
138
- className: " table_full_width"
139
- }, /*#__PURE__*/React.createElement(TooltipComponent, {
140
- tableBodyRef: toolbarRef,
141
- title: labels.switchToFullScreen
142
- }, /*#__PURE__*/React.createElement("div", {
143
- onClick: function onClick() {
144
- return setTableFullView === null || setTableFullView === void 0 ? void 0 : setTableFullView(!fullWidthView);
145
- }
146
- }, /*#__PURE__*/React.createElement(ExpandIcon, {
147
- className: "" + (fullWidthView ? 'active' : '')
148
- }))))), enableTableToggle && !isMobile && /*#__PURE__*/React.createElement("div", {
100
+ className: " pr-1 cursor-pointer relative "
101
+ }, enableTableToggle && !isMobile && /*#__PURE__*/React.createElement("div", {
149
102
  className: "qbs-table-top-icons flex gap-2"
150
103
  }, /*#__PURE__*/React.createElement(TooltipComponent, {
151
104
  tableBodyRef: toolbarRef,
152
- title: labels.switchToTableView
105
+ title: 'Switch to Table View'
153
106
  }, /*#__PURE__*/React.createElement("div", {
154
107
  onClick: function onClick() {
155
108
  return setTableViewToggle === null || setTableViewToggle === void 0 ? void 0 : setTableViewToggle(true);
@@ -164,7 +117,7 @@ var ToolBar = function ToolBar(_ref) {
164
117
  }
165
118
  }, /*#__PURE__*/React.createElement(TooltipComponent, {
166
119
  tableBodyRef: toolbarRef,
167
- title: labels.switchToCardView
120
+ title: 'Switch to Card View'
168
121
  }, /*#__PURE__*/React.createElement(CardView, {
169
122
  className: "" + (!tableViewToggle ? 'active' : '')
170
123
  }))))))), isMobile && isOpen && /*#__PURE__*/React.createElement("div", {
@@ -177,26 +130,24 @@ var ToolBar = function ToolBar(_ref) {
177
130
  className: "qbs-table-toolbar-sub-container-start"
178
131
  }, /*#__PURE__*/React.createElement("div", {
179
132
  className: "selected-row"
180
- }, formatSelectedItems(labels.selectedItems, (_checkedKeys$length = checkedKeys === null || checkedKeys === void 0 ? void 0 : checkedKeys.length) != null ? _checkedKeys$length : 0)), /*#__PURE__*/React.createElement("div", {
133
+ }, "Selected Items(" + (checkedKeys === null || checkedKeys === void 0 ? void 0 : checkedKeys.length) + ") "), /*#__PURE__*/React.createElement("div", {
181
134
  className: "selected-row-action"
182
135
  }, /*#__PURE__*/React.createElement("button", {
183
136
  className: "btn",
184
137
  onClick: function onClick() {
185
138
  return onSelect === null || onSelect === void 0 ? void 0 : onSelect([]);
186
139
  }
187
- }, labels.clear), selectedRowActions === null || selectedRowActions === void 0 ? void 0 : selectedRowActions.map(function (actions, index) {
140
+ }, "Clear"), selectedRowActions === null || selectedRowActions === void 0 ? void 0 : selectedRowActions.map(function (actions, index) {
188
141
  return /*#__PURE__*/React.createElement(React.Fragment, null, handleHide(actions) && /*#__PURE__*/React.createElement("button", {
189
142
  key: index.toString(),
190
- className: "btn " + (actions === null || actions === void 0 ? void 0 : actions.buttonClassName),
143
+ className: "btn",
191
144
  disabled: actions.disabled,
192
145
  onClick: function onClick() {
193
146
  return actions === null || actions === void 0 ? void 0 : actions.action(checkedKeys);
194
147
  }
195
- }, (actions === null || actions === void 0 ? void 0 : actions.icon) && /*#__PURE__*/React.createElement("span", {
196
- className: "mr-2"
197
- }, actions === null || actions === void 0 ? void 0 : actions.icon), /*#__PURE__*/React.createElement("span", null, actions.actionTitle)));
148
+ }, actions.actionTitle));
198
149
  }))) : /*#__PURE__*/React.createElement("div", null, pagination && paginationProps && dataLength > 0 && /*#__PURE__*/React.createElement("div", {
199
150
  className: "rows-count"
200
- }, getRowDisplayRange((_paginationProps$tota = paginationProps.total) != null ? _paginationProps$tota : 0, (_paginationProps$rows = paginationProps.rowsPerPage) != null ? _paginationProps$rows : 0, (_paginationProps$curr = paginationProps.currentPage) != null ? _paginationProps$curr : 0, labels.showingRange)))));
151
+ }, getRowDisplayRange((_paginationProps$tota = paginationProps.total) != null ? _paginationProps$tota : 0, (_paginationProps$rows = paginationProps.rowsPerPage) != null ? _paginationProps$rows : 0, (_paginationProps$curr = paginationProps.currentPage) != null ? _paginationProps$curr : 0)))));
201
152
  };
202
153
  export default ToolBar;
@@ -1,6 +1,4 @@
1
1
  import React, { ReactElement, ReactNode } from 'react';
2
- import type { QbsTableLabels } from './labels';
3
- export type { QbsTableLabels };
4
2
  interface Content {
5
3
  cell: ReactNode | string;
6
4
  toolTip?: string;
@@ -41,7 +39,7 @@ export interface PaginationProps {
41
39
  export interface ActionProps {
42
40
  title?: string;
43
41
  action?: (row: any) => void;
44
- icon?: React.ReactNode;
42
+ icon: React.ReactNode;
45
43
  toolTip?: string;
46
44
  hidden?: boolean;
47
45
  hide?: (data: any, index?: number) => boolean;
@@ -71,7 +69,6 @@ export interface QbsTableProps {
71
69
  searchValue?: string;
72
70
  handleSearchValue?: (value?: string) => void;
73
71
  theme?: string;
74
- rtl?: boolean;
75
72
  onRowClick?: (data: any) => void;
76
73
  cellBordered?: boolean;
77
74
  bordered?: boolean;
@@ -92,15 +89,12 @@ export interface QbsTableProps {
92
89
  advancefilter?: ReactElement | ReactNode;
93
90
  tableHeaderActions?: ReactElement | ReactNode;
94
91
  searchPlaceholder?: string;
95
- labels?: QbsTableLabels;
96
92
  selectedRowActions?: {
97
93
  actionTitle?: string;
98
94
  action: (checked: (number | string)[]) => void;
99
95
  disabled?: boolean;
100
96
  hidden?: boolean;
101
97
  customHide?: string;
102
- buttonClassName?: string;
103
- icon?: ReactElement | ReactNode;
104
98
  }[];
105
99
  selectedRows?: (number | string)[];
106
100
  classes?: {
@@ -133,20 +127,6 @@ export interface QbsTableProps {
133
127
  handleTableCardView?: (data: any) => React.ReactNode;
134
128
  isCustomTableCardView?: boolean;
135
129
  handleCustomCardLoader?: () => React.ReactNode;
136
- hasMoreData?: boolean;
137
- loadMoreData?: () => void;
138
- infiniteScroll?: boolean;
139
- infiniteLoading?: boolean;
140
- viewMode?: string;
141
- rowViewToggle?: boolean;
142
- defaultRowView?: boolean;
143
- fullWidthView?: boolean;
144
- setTableFullView?: (value: boolean) => void;
145
- setRowViewToggle?: (value: boolean) => void;
146
- dropType?: 'horizondal' | 'vertical';
147
- rowHeight?: number;
148
- isFullScreen?: boolean;
149
- showHeader?: boolean;
150
130
  }
151
131
  export interface QbsTableToolbarProps {
152
132
  title?: string;
@@ -171,7 +151,6 @@ export interface QbsTableToolbarProps {
171
151
  dataLength: number;
172
152
  headerHeight?: number;
173
153
  searchPlaceholder?: string;
174
- labels?: QbsTableLabels;
175
154
  tableView?: boolean;
176
155
  enableTableToggle?: boolean;
177
156
  tableViewToggle?: boolean;
@@ -182,13 +161,6 @@ export interface QbsTableToolbarProps {
182
161
  disabled?: boolean;
183
162
  hidden?: boolean;
184
163
  customHide?: string;
185
- buttonClassName?: string;
186
- icon?: ReactElement | ReactNode;
187
164
  }[];
188
- rowViewToggle?: boolean;
189
- defaultRowView?: boolean;
190
- fullWidthView?: boolean;
191
- setTableFullView?: (value: boolean) => void;
192
- setRowViewToggle?: (value: boolean) => void;
193
- isFullScreen?: boolean;
194
165
  }
166
+ export {};
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  import { QbsColumnProps } from '../commontypes';
3
- import { type QbsTableLabels } from '../labels';
4
3
  type Props = {
5
4
  columns: QbsColumnProps[];
6
5
  data: any;
@@ -10,7 +9,6 @@ type Props = {
10
9
  handleMenuActions?: () => void;
11
10
  cardColumLimit?: number;
12
11
  childDetailHeading?: string;
13
- labels?: QbsTableLabels;
14
12
  };
15
13
  declare const CardComponent: React.FC<Props>;
16
14
  export default CardComponent;
@@ -1,5 +1,4 @@
1
1
  import React, { useRef, useState } from 'react';
2
- import { mergeLabels } from '../labels';
3
2
  import CardMenuDropdown from './CardMenuDropdown';
4
3
  import { handleCellFormat } from './handleFormatCell';
5
4
  import { ArrowUpIcon } from './icons';
@@ -16,9 +15,7 @@ var CardComponent = function CardComponent(_ref) {
16
15
  cardColumLimit = _ref$cardColumLimit === void 0 ? 5 : _ref$cardColumLimit,
17
16
  handleMenuActions = _ref.handleMenuActions,
18
17
  _ref$childDetailHeadi = _ref.childDetailHeading,
19
- childDetailHeading = _ref$childDetailHeadi === void 0 ? '' : _ref$childDetailHeadi,
20
- labelsProp = _ref.labels;
21
- var labels = mergeLabels(labelsProp);
18
+ childDetailHeading = _ref$childDetailHeadi === void 0 ? '' : _ref$childDetailHeadi;
22
19
  var _useState = useState(false),
23
20
  viewMore = _useState[0],
24
21
  setViewMore = _useState[1];
@@ -67,11 +64,10 @@ var CardComponent = function CardComponent(_ref) {
67
64
  rowData: data,
68
65
  iconName: "more",
69
66
  rowIndex: index,
70
- handleMenuActions: handleMenuActions,
71
- labels: labels
67
+ handleMenuActions: handleMenuActions
72
68
  })), columns.length > initialDisplayCount && /*#__PURE__*/React.createElement(TooltipComponent, {
73
69
  tableBodyRef: useCardRef,
74
- title: viewMore ? labels.viewLess : labels.viewMore,
70
+ title: viewMore ? ' View Less' : 'View More',
75
71
  enabled: false
76
72
  }, /*#__PURE__*/React.createElement("button", {
77
73
  onClick: toggleViewMore,
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  import { ActionProps } from '../commontypes';
3
- import { type QbsTableLabels } from '../labels';
4
3
  type Props = {
5
4
  iconName: string;
6
5
  actionDropDown: ActionProps[];
@@ -9,7 +8,6 @@ type Props = {
9
8
  dataTheme?: string;
10
9
  tableBodyRef: React.RefObject<HTMLDivElement>;
11
10
  rowIndex?: number;
12
- labels?: QbsTableLabels;
13
11
  };
14
12
  declare const CardMenuDropdown: React.FC<Props>;
15
13
  export default CardMenuDropdown;
@@ -1,13 +1,11 @@
1
- import React, { useEffect, useRef, useState } from 'react';
2
- import { mergeLabels } from '../labels';
1
+ import { useEffect, useRef, useState } from 'react';
2
+ import React from 'react';
3
3
  import { ThreeDotIcon } from './icons';
4
4
  import TooltipComponent from './ToolTip';
5
5
  var CardMenuDropdown = function CardMenuDropdown(_ref) {
6
6
  var actionDropDown = _ref.actionDropDown,
7
7
  handleMenuActions = _ref.handleMenuActions,
8
- rowData = _ref.rowData,
9
- labelsProp = _ref.labels;
10
- var labels = mergeLabels(labelsProp);
8
+ rowData = _ref.rowData;
11
9
  var _useState = useState(false),
12
10
  openMenu = _useState[0],
13
11
  setOpenMenu = _useState[1];
@@ -34,6 +32,7 @@ var CardMenuDropdown = function CardMenuDropdown(_ref) {
34
32
  var dropdownHeight = 200; // Adjust this if your dropdown height varies
35
33
  var spaceBelow = window.innerHeight - buttonRect.bottom;
36
34
  var spaceAbove = buttonRect.top;
35
+ console.log(spaceAbove, spaceBelow, dropdownHeight);
37
36
  if (spaceBelow < dropdownHeight && spaceAbove > spaceBelow) {
38
37
  setMenuPositionStyles({
39
38
  bottom: '30px',
@@ -66,8 +65,9 @@ var CardMenuDropdown = function CardMenuDropdown(_ref) {
66
65
  onClick: toggleMenu,
67
66
  ref: menuButtonRef
68
67
  }, /*#__PURE__*/React.createElement(TooltipComponent, {
69
- title: labels.actions,
70
- enabled: false
68
+ title: "Actions",
69
+ enabled: false,
70
+ ref: menuButtonRef
71
71
  }, /*#__PURE__*/React.createElement(ThreeDotIcon, null))), openMenu && /*#__PURE__*/React.createElement("div", {
72
72
  className: " qbs-card-dropdown rounded absolute right-0 mt-2 w-auto min-w-11 z-10 shadow-modalShadow bg-white dark:bg-[#424242] dark:text-white",
73
73
  style: menuPositionStyles
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  import { QbsColumnProps } from '../commontypes';
3
- import { type QbsTableLabels } from '../labels';
4
3
  interface ColumnToggleProps {
5
4
  columns: QbsColumnProps[];
6
5
  onToggle: (columnName: string) => void;
@@ -10,9 +9,6 @@ interface ColumnToggleProps {
10
9
  handleColumnToggle?: (columns: QbsColumnProps[]) => void;
11
10
  handleResetColumns?: () => void;
12
11
  tableHeight?: number;
13
- viewMode?: string;
14
- setViewMode?: (value: string) => void;
15
- labels?: QbsTableLabels;
16
12
  }
17
13
  declare const ColumnToggle: React.FC<ColumnToggleProps>;
18
14
  export default ColumnToggle;
@@ -1,5 +1,4 @@
1
1
  import React, { useCallback, useEffect, useRef, useState } from 'react';
2
- import { mergeLabels } from '../labels';
3
2
  import { SettingsIcon } from './icons';
4
3
  var ColumnToggle = function ColumnToggle(_ref) {
5
4
  var columns = _ref.columns,
@@ -10,9 +9,7 @@ var ColumnToggle = function ColumnToggle(_ref) {
10
9
  handleResetColumns = _ref.handleResetColumns,
11
10
  handleColumnToggle = _ref.handleColumnToggle,
12
11
  _ref$tableHeight = _ref.tableHeight,
13
- tableHeight = _ref$tableHeight === void 0 ? 450 : _ref$tableHeight,
14
- labelsProp = _ref.labels;
15
- var labels = mergeLabels(labelsProp);
12
+ tableHeight = _ref$tableHeight === void 0 ? 450 : _ref$tableHeight;
16
13
  var _useState = useState(null),
17
14
  draggedItem = _useState[0],
18
15
  setDraggedItem = _useState[1];
@@ -167,7 +164,7 @@ var ColumnToggle = function ColumnToggle(_ref) {
167
164
  className: "qbs-table-popup-item"
168
165
  }, /*#__PURE__*/React.createElement("div", {
169
166
  className: "qbs-table-popup-label"
170
- }, labels.fixedColumns), /*#__PURE__*/React.createElement("div", {
167
+ }, "FIXED COLUMNS"), /*#__PURE__*/React.createElement("div", {
171
168
  className: "qbs-table-columns-container"
172
169
  }, /*#__PURE__*/React.createElement("div", {
173
170
  className: "qbs-table-column"
@@ -179,7 +176,7 @@ var ColumnToggle = function ColumnToggle(_ref) {
179
176
  className: "qbs-table-popup-item"
180
177
  }, /*#__PURE__*/React.createElement("div", {
181
178
  className: "qbs-table-popup-label"
182
- }, labels.visibleColumns), /*#__PURE__*/React.createElement("div", {
179
+ }, "VISIBLE COLUMNS"), /*#__PURE__*/React.createElement("div", {
183
180
  className: "qbs-table-columns-container"
184
181
  }, /*#__PURE__*/React.createElement("div", {
185
182
  className: "qbs-table-column"
@@ -191,7 +188,7 @@ var ColumnToggle = function ColumnToggle(_ref) {
191
188
  className: "qbs-table-popup-item"
192
189
  }, /*#__PURE__*/React.createElement("div", {
193
190
  className: "qbs-table-popup-label"
194
- }, labels.availableColumns), /*#__PURE__*/React.createElement("div", {
191
+ }, "AVAILABLE COLUMNS"), /*#__PURE__*/React.createElement("div", {
195
192
  className: "qbs-table-columns-container"
196
193
  }, /*#__PURE__*/React.createElement("div", {
197
194
  className: "qbs-table-column"
@@ -212,12 +209,12 @@ var ColumnToggle = function ColumnToggle(_ref) {
212
209
  onClick: function onClick() {
213
210
  return handleResetColumns === null || handleResetColumns === void 0 ? void 0 : handleResetColumns();
214
211
  }
215
- }, labels.resetToDefault), /*#__PURE__*/React.createElement("a", {
212
+ }, "Reset to default"), /*#__PURE__*/React.createElement("a", {
216
213
  className: "qbs-table-reset-link",
217
214
  href: "#",
218
215
  onClick: function onClick() {
219
216
  return handleColToggle();
220
217
  }
221
- }, labels.save))))));
218
+ }, "Save"))))));
222
219
  };
223
220
  export default ColumnToggle;
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  export interface SearchProps {
3
3
  placeholder: string;
4
- searchAriaLabel?: string;
5
4
  handleChange: (value: string) => void;
6
5
  searchValue: string | undefined;
7
6
  handleSearch: (value?: string) => void;
@@ -1,8 +1,6 @@
1
1
  import React, { memo, useCallback } from 'react';
2
2
  var SearchInput = function SearchInput(_ref) {
3
3
  var placeholder = _ref.placeholder,
4
- _ref$searchAriaLabel = _ref.searchAriaLabel,
5
- searchAriaLabel = _ref$searchAriaLabel === void 0 ? 'Search' : _ref$searchAriaLabel,
6
4
  handleChange = _ref.handleChange,
7
5
  searchValue = _ref.searchValue,
8
6
  handleSearch = _ref.handleSearch;
@@ -26,7 +24,7 @@ var SearchInput = function SearchInput(_ref) {
26
24
  placeholder: placeholder,
27
25
  value: searchValue != null ? searchValue : '',
28
26
  onChange: handleInputChange,
29
- "aria-label": searchAriaLabel
27
+ "aria-label": "Search"
30
28
  }), /*#__PURE__*/React.createElement("button", {
31
29
  className: "search-button absolute left-1 bottom-1.5 bg-white text-grey-dark",
32
30
  onClick: function onClick() {
@@ -1,10 +1,3 @@
1
1
  import React from 'react';
2
- type TooltipComponentProps = {
3
- title?: React.ReactNode;
4
- children: React.ReactNode;
5
- tableBodyRef?: React.RefObject<HTMLDivElement | null>;
6
- /** When false, renders children only (no tooltip). */
7
- enabled?: boolean;
8
- };
9
- declare const TooltipComponent: React.FC<TooltipComponentProps>;
2
+ declare const TooltipComponent: React.FC<any>;
10
3
  export default TooltipComponent;
@@ -1,117 +1,41 @@
1
- import React, { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';
2
- import ReactDOM from 'react-dom';
3
- var VIEWPORT_PADDING = 8;
4
- var TOOLTIP_GAP = 8;
1
+ import React, { useRef, useState } from 'react';
5
2
  var TooltipComponent = function TooltipComponent(_ref) {
6
3
  var title = _ref.title,
7
4
  children = _ref.children,
8
- tableBodyRef = _ref.tableBodyRef,
9
- _ref$enabled = _ref.enabled,
10
- enabled = _ref$enabled === void 0 ? true : _ref$enabled;
11
- var _useState = useState(false),
12
- visible = _useState[0],
13
- setVisible = _useState[1];
14
- var _useState2 = useState(false),
15
- positioned = _useState2[0],
16
- setPositioned = _useState2[1];
17
- var _useState3 = useState('down'),
18
- placement = _useState3[0],
19
- setPlacement = _useState3[1];
20
- var _useState4 = useState({
21
- top: 0,
22
- left: 0
23
- }),
24
- coords = _useState4[0],
25
- setCoords = _useState4[1];
26
- var _useState5 = useState(0),
27
- arrowOffset = _useState5[0],
28
- setArrowOffset = _useState5[1];
29
- var triggerRef = useRef(null);
30
- var tooltipRef = useRef(null);
31
- var updatePosition = useCallback(function () {
32
- var _tableBodyRef$current, _tableBodyRef$current2, _trigger$closest;
33
- var trigger = triggerRef.current;
34
- var tooltip = tooltipRef.current;
35
- if (!trigger || !tooltip) {
36
- return;
5
+ tableBodyRef = _ref.tableBodyRef;
6
+ var _useState = useState('bottom-position'),
7
+ dropdownPosition = _useState[0],
8
+ setDropdownPosition = _useState[1];
9
+ var dropRef = useRef(null);
10
+ var menuButtonRef = useRef(null);
11
+ var adjustDropdownPosition = function adjustDropdownPosition() {
12
+ if (menuButtonRef.current && tableBodyRef !== null && tableBodyRef !== void 0 && tableBodyRef.current) {
13
+ var _menuButtonRef$curren;
14
+ var inputBoxRect = (_menuButtonRef$curren = menuButtonRef.current) === null || _menuButtonRef$curren === void 0 ? void 0 : _menuButtonRef$curren.getBoundingClientRect();
15
+ var tableRect = tableBodyRef.current.getBoundingClientRect();
16
+ // Calculate positions relative to the table
17
+ var spaceAbove = inputBoxRect.top - tableRect.top;
18
+ var spaceBelow = tableRect.bottom - inputBoxRect.bottom;
19
+ if (spaceAbove > spaceBelow) {
20
+ setDropdownPosition('top-position');
21
+ } else {
22
+ setDropdownPosition('bottom-position');
23
+ }
37
24
  }
38
- var triggerRect = trigger.getBoundingClientRect();
39
- var tooltipRect = tooltip.getBoundingClientRect();
40
- var boundaryRect = (_tableBodyRef$current = tableBodyRef === null || tableBodyRef === void 0 ? void 0 : (_tableBodyRef$current2 = tableBodyRef.current) === null || _tableBodyRef$current2 === void 0 ? void 0 : _tableBodyRef$current2.getBoundingClientRect()) != null ? _tableBodyRef$current : (_trigger$closest = trigger.closest('.qbs-table')) === null || _trigger$closest === void 0 ? void 0 : _trigger$closest.getBoundingClientRect();
41
- var spaceAbove = boundaryRect ? triggerRect.top - boundaryRect.top : triggerRect.top;
42
- var spaceBelow = boundaryRect ? boundaryRect.bottom - triggerRect.bottom : window.innerHeight - triggerRect.bottom;
43
- var nextPlacement = spaceBelow >= tooltipRect.height + TOOLTIP_GAP || spaceBelow >= spaceAbove ? 'down' : 'up';
44
- var triggerCenter = triggerRect.left + triggerRect.width / 2;
45
- var left = triggerCenter - tooltipRect.width / 2;
46
- if (left < VIEWPORT_PADDING) {
47
- left = VIEWPORT_PADDING;
48
- } else if (left + tooltipRect.width > window.innerWidth - VIEWPORT_PADDING) {
49
- left = window.innerWidth - VIEWPORT_PADDING - tooltipRect.width;
50
- }
51
- var top = nextPlacement === 'down' ? triggerRect.bottom + TOOLTIP_GAP : triggerRect.top - tooltipRect.height - TOOLTIP_GAP;
52
- setPlacement(nextPlacement);
53
- setCoords({
54
- top: top,
55
- left: left
56
- });
57
- setArrowOffset(triggerCenter - left);
58
- setPositioned(true);
59
- }, [tableBodyRef]);
60
- var showTooltip = function showTooltip() {
61
- setPositioned(false);
62
- setVisible(true);
63
- };
64
- var hideTooltip = function hideTooltip() {
65
- setVisible(false);
66
- setPositioned(false);
67
25
  };
68
- useLayoutEffect(function () {
69
- if (!visible) {
70
- return;
71
- }
72
- updatePosition();
73
- var frame = window.requestAnimationFrame(updatePosition);
74
- return function () {
75
- return window.cancelAnimationFrame(frame);
76
- };
77
- }, [visible, title, updatePosition]);
78
- useEffect(function () {
79
- if (!visible) {
80
- return;
81
- }
82
- var handleReposition = function handleReposition() {
83
- return updatePosition();
84
- };
85
- window.addEventListener('resize', handleReposition);
86
- window.addEventListener('scroll', handleReposition, true);
87
- return function () {
88
- window.removeEventListener('resize', handleReposition);
89
- window.removeEventListener('scroll', handleReposition, true);
90
- };
91
- }, [visible, updatePosition]);
92
- if (!title || enabled === false) {
93
- return /*#__PURE__*/React.createElement(React.Fragment, null, children);
94
- }
95
- var portalRoot = typeof document !== 'undefined' ? document.body : null;
96
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
97
- ref: triggerRef,
98
- className: "qbs-table-tooltip-trigger",
26
+ return /*#__PURE__*/React.createElement("div", {
27
+ className: "qbs-table-tooltip " + (dropdownPosition == 'bottom-position' ? 'down' : 'up') + " "
28
+ }, /*#__PURE__*/React.createElement("span", {
29
+ ref: menuButtonRef,
99
30
  style: {
100
- display: 'inline-flex'
31
+ display: 'flex'
101
32
  },
102
- onMouseEnter: showTooltip,
103
- onMouseLeave: hideTooltip,
104
- onFocus: showTooltip,
105
- onBlur: hideTooltip
106
- }, children), visible && portalRoot && /*#__PURE__*/ReactDOM.createPortal(/*#__PURE__*/React.createElement("span", {
107
- ref: tooltipRef,
108
- role: "tooltip",
109
- className: "qbs-table-tooltip-floating tooltiptext qbs-table-tooltip-floating--" + placement + " " + (positioned ? 'is-positioned' : ''),
110
- style: {
111
- top: coords.top,
112
- left: coords.left,
113
- '--tooltip-arrow-offset': arrowOffset + "px"
33
+ onMouseEnter: function onMouseEnter() {
34
+ return adjustDropdownPosition();
114
35
  }
115
- }, title), portalRoot));
36
+ }, children), /*#__PURE__*/React.createElement("span", {
37
+ ref: dropRef,
38
+ className: 'tooltiptext'
39
+ }, title));
116
40
  };
117
41
  export default TooltipComponent;
@@ -70,7 +70,7 @@ var NoData = function NoData(_ref) {
70
70
  }), /*#__PURE__*/React.createElement("path", {
71
71
  fill: "#797979",
72
72
  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"
73
- })), ' '), /*#__PURE__*/React.createElement("p", {
73
+ })), " ", ' '), /*#__PURE__*/React.createElement("p", {
74
74
  className: "text-center text-common font-bold text-blackAlt nodata-title"
75
75
  }, title), /*#__PURE__*/React.createElement("span", {
76
76
  className: "text-xxs font-medium text-grey-medium nodata-sub-title"
@@ -6,6 +6,3 @@ 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>;