playbook_ui 14.14.0.pre.alpha.PBNTR907reactfilterpopoverpropswidthbug6557 → 14.14.0.pre.alpha.pbntr500currencykithandlingofnullvalues6275

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 (148) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/Context/AdvancedTableContext.tsx +3 -143
  3. data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableBody.tsx +99 -45
  4. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +7 -123
  5. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +299 -153
  6. data/app/pb_kits/playbook/pb_card/_card.tsx +1 -2
  7. data/app/pb_kits/playbook/pb_currency/_currency.tsx +2 -1
  8. data/app/pb_kits/playbook/pb_currency/currency.html.erb +1 -1
  9. data/app/pb_kits/playbook/pb_currency/currency.rb +2 -14
  10. data/app/pb_kits/playbook/pb_currency/docs/_currency_null_display.html.erb +1 -3
  11. data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +1 -4
  12. data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +0 -2
  13. data/app/pb_kits/playbook/pb_drawer/_drawer.scss +3 -43
  14. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_borders.jsx +3 -3
  15. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.jsx +37 -20
  16. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_default.html.erb +1 -20
  17. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.jsx +6 -6
  18. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx +0 -1
  19. data/app/pb_kits/playbook/pb_drawer/docs/example.yml +0 -6
  20. data/app/pb_kits/playbook/pb_drawer/drawer.html.erb +12 -20
  21. data/app/pb_kits/playbook/pb_drawer/drawer.rb +1 -49
  22. data/app/pb_kits/playbook/pb_filter/Filter/CurrentFilters.tsx +4 -5
  23. data/app/pb_kits/playbook/pb_filter/Filter/FilterSingle.tsx +2 -2
  24. data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +2 -2
  25. data/app/pb_kits/playbook/pb_form_pill/_form_pill.scss +2 -9
  26. data/app/pb_kits/playbook/pb_form_pill/_form_pill.tsx +0 -4
  27. data/app/pb_kits/playbook/pb_form_pill/docs/example.yml +0 -2
  28. data/app/pb_kits/playbook/pb_form_pill/docs/index.js +0 -1
  29. data/app/pb_kits/playbook/pb_form_pill/form_pill.rb +1 -7
  30. data/app/pb_kits/playbook/pb_icon_button/docs/example.yml +0 -4
  31. data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.scss +0 -7
  32. data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +3 -13
  33. data/app/pb_kits/playbook/pb_multi_level_select/docs/example.yml +1 -2
  34. data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +0 -1
  35. data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.rb +0 -6
  36. data/app/pb_kits/playbook/pb_overlay/_overlay.scss +0 -13
  37. data/app/pb_kits/playbook/pb_overlay/_overlay.tsx +1 -7
  38. data/app/pb_kits/playbook/pb_overlay/docs/example.yml +0 -3
  39. data/app/pb_kits/playbook/pb_overlay/docs/index.js +0 -1
  40. data/app/pb_kits/playbook/pb_overlay/overlay.html.erb +3 -5
  41. data/app/pb_kits/playbook/pb_overlay/overlay.rb +1 -16
  42. data/app/pb_kits/playbook/pb_overlay/overlay.test.jsx +0 -12
  43. data/app/pb_kits/playbook/pb_popover/_popover.tsx +2 -2
  44. data/app/pb_kits/playbook/pb_popover/popover.test.js +1 -1
  45. data/app/pb_kits/playbook/pb_progress_step/progress_step_item.html.erb +2 -2
  46. data/app/pb_kits/playbook/pb_radio/_radio.tsx +74 -85
  47. data/app/pb_kits/playbook/pb_radio/docs/example.yml +1 -2
  48. data/app/pb_kits/playbook/pb_radio/docs/index.js +0 -1
  49. data/app/pb_kits/playbook/pb_radio/radio.test.js +0 -16
  50. data/app/pb_kits/playbook/pb_select/docs/example.yml +0 -1
  51. data/app/pb_kits/playbook/pb_select/docs/index.js +0 -1
  52. data/app/pb_kits/playbook/pb_select/select.html.erb +5 -3
  53. data/app/pb_kits/playbook/pb_select/select.rb +0 -8
  54. data/app/pb_kits/playbook/pb_selectable_card/selectable_card.html.erb +5 -1
  55. data/app/pb_kits/playbook/pb_selectable_card_icon/selectable_card_icon.html.erb +4 -1
  56. data/app/pb_kits/playbook/pb_selectable_icon/selectable_icon.html.erb +5 -1
  57. data/app/pb_kits/playbook/pb_timeline/_timeline.scss +2 -2
  58. data/app/pb_kits/playbook/pb_title/_title.scss +0 -32
  59. data/app/pb_kits/playbook/pb_title/_title.tsx +1 -10
  60. data/app/pb_kits/playbook/pb_title/docs/_title_default.html.erb +2 -1
  61. data/app/pb_kits/playbook/pb_title/docs/_title_default.jsx +1 -1
  62. data/app/pb_kits/playbook/pb_title/docs/example.yml +0 -2
  63. data/app/pb_kits/playbook/pb_title/docs/index.js +0 -1
  64. data/app/pb_kits/playbook/pb_title/title.rb +1 -10
  65. data/app/pb_kits/playbook/pb_tooltip/_tooltip.scss +3 -0
  66. data/app/pb_kits/playbook/pb_tooltip/_tooltip.tsx +0 -25
  67. data/app/pb_kits/playbook/pb_tooltip/docs/example.yml +1 -3
  68. data/app/pb_kits/playbook/pb_tooltip/docs/index.js +0 -1
  69. data/app/pb_kits/playbook/pb_tooltip/index.js +2 -2
  70. data/app/pb_kits/playbook/pb_tooltip/tooltip.rb +2 -10
  71. data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +2 -36
  72. data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.tsx +1 -5
  73. data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +0 -2
  74. data/app/pb_kits/playbook/pb_typeahead/index.ts +8 -61
  75. data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +2 -17
  76. data/app/pb_kits/playbook/utilities/object.ts +1 -29
  77. data/dist/chunks/_typeahead-PqkcDf1H.js +36 -0
  78. data/dist/chunks/_weekday_stacked-BhC8Xp9l.js +45 -0
  79. data/dist/chunks/{lib-5OzNgeeu.js → lib-D3us1bGD.js} +2 -2
  80. data/dist/chunks/{pb_form_validation-DGhKbZtO.js → pb_form_validation-BpihMSOQ.js} +1 -1
  81. data/dist/chunks/vendor.js +1 -1
  82. data/dist/menu.yml +3 -3
  83. data/dist/playbook-doc.js +1 -1
  84. data/dist/playbook-rails-react-bindings.js +1 -1
  85. data/dist/playbook-rails.js +1 -1
  86. data/dist/playbook.css +1 -1
  87. data/lib/playbook/version.rb +1 -1
  88. metadata +6 -64
  89. data/app/pb_kits/playbook/pb_advanced_table/Components/RegularTableView.tsx +0 -127
  90. data/app/pb_kits/playbook/pb_advanced_table/Components/TableActionBar.tsx +0 -55
  91. data/app/pb_kits/playbook/pb_advanced_table/Components/TablePagination.tsx +0 -33
  92. data/app/pb_kits/playbook/pb_advanced_table/Components/VirtualizedTableView.tsx +0 -275
  93. data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableActions.ts +0 -66
  94. data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableState.ts +0 -195
  95. data/app/pb_kits/playbook/pb_advanced_table/Utilities/CellRendererUtils.tsx +0 -73
  96. data/app/pb_kits/playbook/pb_advanced_table/Utilities/RowUtils.ts +0 -52
  97. data/app/pb_kits/playbook/pb_advanced_table/Utilities/TableContainerStyles.ts +0 -80
  98. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_infinite_scroll.jsx +0 -50
  99. data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_mock_data_infinite_scroll.json +0 -152002
  100. data/app/pb_kits/playbook/pb_currency/docs/_currency_null_display_rails.md +0 -1
  101. data/app/pb_kits/playbook/pb_currency/docs/_currency_null_display_react.md +0 -1
  102. data/app/pb_kits/playbook/pb_date_picker/index.ts +0 -38
  103. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_behavior.html.erb +0 -8
  104. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_borders.html.erb +0 -33
  105. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.html.erb +0 -0
  106. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.html.erb +0 -24
  107. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.html.erb +0 -21
  108. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.md +0 -1
  109. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_sizes.html.erb +0 -49
  110. data/app/pb_kits/playbook/pb_drawer/index.js +0 -257
  111. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_wrapped.html.erb +0 -40
  112. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_wrapped.jsx +0 -50
  113. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_wrapped.md +0 -3
  114. data/app/pb_kits/playbook/pb_icon_button/_icon_button.tsx +0 -71
  115. data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_default.jsx +0 -17
  116. data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_sizes.jsx +0 -61
  117. data/app/pb_kits/playbook/pb_icon_button/docs/index.js +0 -2
  118. data/app/pb_kits/playbook/pb_icon_button/icon_button.test.jsx +0 -39
  119. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_disabled.html.erb +0 -72
  120. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_disabled.jsx +0 -91
  121. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar.html.erb +0 -11
  122. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar.jsx +0 -37
  123. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar_rails.md +0 -1
  124. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar_react.md +0 -1
  125. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional.html.erb +0 -11
  126. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional.md +0 -1
  127. data/app/pb_kits/playbook/pb_overlay/index.js +0 -61
  128. data/app/pb_kits/playbook/pb_radio/docs/_radio_react_hook.jsx +0 -60
  129. data/app/pb_kits/playbook/pb_radio/docs/_radio_react_hook.md +0 -1
  130. data/app/pb_kits/playbook/pb_select/docs/_select_react_hook.jsx +0 -58
  131. data/app/pb_kits/playbook/pb_select/docs/_select_react_hook.md +0 -1
  132. data/app/pb_kits/playbook/pb_select/index.js +0 -38
  133. data/app/pb_kits/playbook/pb_title/docs/_title_display_size.html.erb +0 -7
  134. data/app/pb_kits/playbook/pb_title/docs/_title_display_size.jsx +0 -54
  135. data/app/pb_kits/playbook/pb_title/docs/_title_display_size.md +0 -1
  136. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_delay_rails.html.erb +0 -39
  137. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_delay_rails.md +0 -3
  138. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_interaction.html.erb +0 -26
  139. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_sizing.jsx +0 -69
  140. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_sizing.md +0 -3
  141. data/app/pb_kits/playbook/pb_tooltip/floating_ui.js +0 -282
  142. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options.html.erb +0 -45
  143. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options.md +0 -5
  144. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options_pure_rails.html.erb +0 -33
  145. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options_pure_rails.md +0 -3
  146. data/app/pb_kits/playbook/utilities/object.test.js +0 -99
  147. data/dist/chunks/_typeahead-F4bG5YsC.js +0 -36
  148. data/dist/chunks/_weekday_stacked-CaWVQMMq.js +0 -45
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e71493edb454fa009f102b97bbfc9b3a544a93adae8d21b467aa23a038c6e102
4
- data.tar.gz: a225a1f853ce4f0ecad9dc24f3516bc9b06eca5c6d03d09a8ca4e45d7921d69d
3
+ metadata.gz: 4c6ef102f160200110b47477b34a9a06798b4ef4f1122151a12341775c20c9a5
4
+ data.tar.gz: 14eb41101975901c5f557d1d8b6721fc9301e9b54a30ec0c335b8717dccbe508
5
5
  SHA512:
6
- metadata.gz: fbf1933e62f0f9bebf42d8e49804a04ce5cfb74982fdc0dd85cf611a92638d46b11e96d426538ff330f322a060b25037412f94b6fbde118de8b0ceb1129a07c2
7
- data.tar.gz: 3573fadc3564ef9728135d5f3527014acd33b456cab081698e26da7aefcd7a22b0a4cc48ddba1392d98875622e77e4d4e9eecff7c56fedd73186bdffb193000c
6
+ metadata.gz: 301d0b715331e1e388be9b554865dc59f79b88f5ef11f3a7f038554f215c7b72d6541465d027adcf0c8f9a0fea2dd4e9e1e6f608c6b0d9b9f5360fc52a70ffc8
7
+ data.tar.gz: 6e1bc33d1fbe6b1bebe4b112b42c73107685786fbc7ddd01df4f95fe302d015e1225edcfbe042e2931728dcd655fe97a9d3629417c639392fa3753a7cb533ee6
@@ -1,145 +1,5 @@
1
- import React, { createContext, useRef, useMemo, useEffect } from 'react';
2
- import { useVirtualizer } from '@tanstack/react-virtual';
1
+ import { createContext } from "react"
3
2
 
4
- import { Row } from "@tanstack/react-table";
5
- import { GenericObject } from "../../types";
6
- import { getRowHeightEstimate } from '../Utilities/TableContainerStyles';
3
+ const AdvancedTableContext = createContext<any>({})
7
4
 
8
- const AdvancedTableContext = createContext<any>({});
9
-
10
- interface FlattenedItem {
11
- type: 'header' | 'row' | 'loading';
12
- row: Row<GenericObject>;
13
- id: string;
14
- }
15
-
16
- export const AdvancedTableProvider = ({ children, ...props }: {
17
- children: React.ReactNode,
18
- [key: string]: any
19
- }) => {
20
- // Always initialize refs and state unconditionally, even if not used
21
- const tableContainerRef = useRef(null);
22
- const containerRef = props.tableContainerRef || tableContainerRef;
23
-
24
- const table = props.table;
25
- const isVirtualized = props.virtualizedRows || props.enableVirtualization;
26
-
27
- // Create a flattened data array that includes ALL components for virtualization
28
- const flattenedItems = useMemo(() => {
29
- if (!isVirtualized || !table) {
30
- return [];
31
- }
32
-
33
- const tableRows = table.getRowModel().rows;
34
- const items: FlattenedItem[] = [];
35
- const subRowHeaders = props.subRowHeaders;
36
- const inlineRowLoading = props.inlineRowLoading;
37
- const columnDefinitions = props.columnDefinitions;
38
-
39
- // Process each row and insert special components
40
- tableRows.forEach((row: Row<GenericObject>, index: number) => {
41
- const isFirstChildofSubrow = row.depth > 0 && row.index === 0;
42
-
43
- if (isFirstChildofSubrow && subRowHeaders) {
44
- items.push({
45
- type: 'header',
46
- row: row,
47
- id: `header-${row.id}-${index}`,
48
- });
49
- }
50
-
51
- items.push({
52
- type: 'row',
53
- row: row,
54
- id: `row-${row.id}-${index}`
55
- });
56
-
57
- const isExpandable = row.getIsExpanded();
58
- const rowHasNoChildren = row.original?.children && !row.original.children.length ? true : false;
59
- const isDataLoading = isExpandable && (inlineRowLoading && rowHasNoChildren) &&
60
- (row.depth < (columnDefinitions[0]?.cellAccessors?.length || 0));
61
-
62
- if (isDataLoading) {
63
- items.push({
64
- type: 'loading',
65
- row: row,
66
- id: `loading-${row.id}-${index}`
67
- });
68
- }
69
- });
70
-
71
- return items;
72
- }, [
73
- isVirtualized,
74
- table,
75
- props.subRowHeaders,
76
- props.inlineRowLoading,
77
- props.columnDefinitions,
78
- // Add dependency on row model hash to refresh when data changes
79
- table?.getRowModel().rows.length,
80
- // Important: Add sorting state as a dependency to refresh when sorting changes
81
- JSON.stringify(table?.getState().sorting || []),
82
- // Also add expanded state as a dependency
83
- JSON.stringify(table?.getState().expanded || {}),
84
- ]);
85
-
86
- // Always initialize the virtualizer, even if we don't use it
87
- // This satisfies the React hooks rules by ensuring hooks are called unconditionally
88
- const virtualizer = useVirtualizer({
89
- count: isVirtualized && flattenedItems.length > 0 ? flattenedItems.length : 0,
90
- getScrollElement: () => containerRef.current,
91
- estimateSize: (index) => {
92
- // Skip if virtualization isn't enabled
93
- if (!isVirtualized || flattenedItems.length === 0) return 0;
94
-
95
- // Use consistent row height estimates
96
- const item = flattenedItems[index];
97
- if (!item) return getRowHeightEstimate('row'); // Default
98
-
99
- return getRowHeightEstimate(item.type);
100
- },
101
- overscan: 10, // Load more items for smoother scrolling
102
- getItemKey: (index) => {
103
- if (!isVirtualized || flattenedItems.length === 0 || index >= flattenedItems.length) {
104
- return `item-${index}`;
105
- }
106
- return flattenedItems[index]?.id || `item-${index}`;
107
- },
108
- });
109
-
110
- // Reset virtualizer scroll position when important state changes
111
- useEffect(() => {
112
- if (isVirtualized && virtualizer && table && containerRef.current) {
113
- // Force recalculation of all virtual items
114
- virtualizer.measure();
115
-
116
- // Reset scroll position when sorting changes
117
- containerRef.current.scrollTop = 0;
118
- }
119
- }, [
120
- isVirtualized,
121
- virtualizer,
122
- table,
123
- containerRef,
124
- JSON.stringify(table?.getState().sorting || []),
125
- JSON.stringify(table?.getState().expanded || {})
126
- ]);
127
-
128
- const contextValue = {
129
- ...props,
130
- table,
131
- tableContainerRef: containerRef,
132
- virtualizer: isVirtualized ? virtualizer : null,
133
- flattenedItems,
134
- virtualizedRows: isVirtualized,
135
- enableVirtualization: isVirtualized
136
- };
137
-
138
- return (
139
- <AdvancedTableContext.Provider value={contextValue}>
140
- {children}
141
- </AdvancedTableContext.Provider>
142
- );
143
- };
144
-
145
- export default AdvancedTableContext;
5
+ export default AdvancedTableContext
@@ -1,14 +1,21 @@
1
1
  import React, { useContext } from "react"
2
2
  import classnames from "classnames"
3
+ import { flexRender, Row } from "@tanstack/react-table"
3
4
 
4
5
  import { GenericObject } from "../../types"
5
6
 
6
7
  import { buildCss } from "../../utilities/props"
7
8
  import { globalProps } from "../../utilities/globalProps"
9
+ import { isChrome } from "../Utilities/BrowserCheck"
10
+
11
+ import LoadingInline from "../../pb_loading_inline/_loading_inline"
12
+ import Checkbox from "../../pb_checkbox/_checkbox"
13
+
14
+ import { SubRowHeaderRow } from "../Components/SubRowHeaderRow"
15
+ import { LoadingCell } from "../Components/LoadingCell"
16
+ import { renderCollapsibleTrail } from "../Components/CollapsibleTrail"
8
17
 
9
18
  import AdvancedTableContext from "../Context/AdvancedTableContext"
10
- import { RegularTableView } from "../Components/RegularTableView"
11
- import { VirtualizedTableView } from "../Components/VirtualizedTableView"
12
19
 
13
20
  type TableBodyProps = {
14
21
  className?: string
@@ -28,15 +35,18 @@ export const TableBody = ({
28
35
  }: TableBodyProps) => {
29
36
 
30
37
  const {
31
- responsive,
38
+ columnDefinitions,
39
+ enableToggleExpansion,
40
+ handleExpandOrCollapse,
32
41
  isPinnedLeft = false,
33
- virtualizer,
34
- virtualizedRows,
35
- enableVirtualization
42
+ inlineRowLoading,
43
+ loading,
44
+ responsive,
45
+ table,
46
+ selectableRows,
47
+ hasAnySubRows
36
48
  } = useContext(AdvancedTableContext)
37
49
 
38
- const isVirtualized = virtualizedRows || enableVirtualization;
39
-
40
50
  const classes = classnames(
41
51
  buildCss("pb_advanced_table_body"),
42
52
  { 'pinned-left': responsive === "scroll" && isPinnedLeft },
@@ -44,49 +54,93 @@ export const TableBody = ({
44
54
  className
45
55
  )
46
56
 
47
- // Style for virtualized table container
48
- const style: React.CSSProperties = virtualizer ? {
49
- height: `${virtualizer.getTotalSize()}px`, // tells scrollbar how big the table is
50
- position: 'relative', // needed for absolute positioning of rows
51
- width: '100%',
52
- } : {};
57
+ const columnPinning = table.getState().columnPinning;
53
58
 
54
59
  return (
55
60
  <>
56
- <tbody
57
- className={classes}
58
- data-virtualized={isVirtualized ? 'true' : 'false'}
61
+ <tbody className={classes}
59
62
  id={id}
60
- style={style}
61
63
  >
62
- {isVirtualized && virtualizer ? (
63
- // Virtualized table view
64
- <VirtualizedTableView
65
- collapsibleTrail={collapsibleTrail}
66
- subRowHeaders={subRowHeaders}
67
- />
68
- ) : (
69
- // Regular non-virtualized table view
70
- <RegularTableView
71
- collapsibleTrail={collapsibleTrail}
72
- subRowHeaders={subRowHeaders}
73
- />
74
- )}
75
-
76
- {/* Fallback for when virtualization should be enabled but virtualizer isn't available */}
77
- {isVirtualized && !virtualizer && (
78
- <tr>
79
- <td
80
- colSpan={999}
81
- style={{ padding: '10px', textAlign: 'center' }}
64
+ {table.getRowModel().rows.map((row: Row<GenericObject>) => {
65
+ const isExpandable = row.getIsExpanded()
66
+ const isFirstChildofSubrow = row.depth > 0 && row.index === 0
67
+ const rowHasNoChildren = row.original.children && !row.original.children.length ? true : false
68
+ const numberOfColumns = table.getAllFlatColumns().length
69
+ const isDataLoading = isExpandable && (inlineRowLoading && rowHasNoChildren) && (row.depth < columnDefinitions[0].cellAccessors?.length)
70
+ const rowBackground = isExpandable && ((!inlineRowLoading && row.getCanExpand()) || (inlineRowLoading && rowHasNoChildren))
71
+ const rowColor = row.getIsSelected() ? "bg-row-selection" : rowBackground ? "bg-silver" : "bg-white"
72
+ return (
73
+ <React.Fragment key={`${row.index}-${row.id}-${row.depth}-row`}>
74
+ {isFirstChildofSubrow && subRowHeaders && (
75
+ <SubRowHeaderRow
76
+ collapsibleTrail={collapsibleTrail}
77
+ enableToggleExpansion={enableToggleExpansion}
78
+ onClick={handleExpandOrCollapse}
79
+ row={row}
80
+ subRowHeaders={subRowHeaders}
81
+ table={table}
82
+ />
83
+ )}
84
+ <tr
85
+ className={`${rowColor} ${
86
+ row.depth > 0 ? `depth-sub-row-${row.depth}` : ""
87
+ }`}
88
+ id={`${row.index}-${row.id}-${row.depth}-row`}
82
89
  >
83
- <div>No data to display.</div>
84
- </td>
85
- </tr>
86
- )}
90
+ {/* Render custom checkbox column when we want selectableRows for non-expanding tables */}
91
+ {selectableRows && !hasAnySubRows && (
92
+ <td className="checkbox-cell">
93
+ <Checkbox
94
+ checked={row.getIsSelected()}
95
+ disabled={!row.getCanSelect()}
96
+ indeterminate={row.getIsSomeSelected()}
97
+ name={row.id}
98
+ onChange={row.getToggleSelectedHandler()}
99
+ />
100
+ </td>
101
+ )}
102
+ {row.getVisibleCells().map((cell, i) => {
103
+ const isPinnedLeft = columnPinning.left.includes(cell.column.id)
104
+ const isLastCell = cell.column.parent?.columns.at(-1)?.id === cell.column.id
105
+
106
+ return (
107
+ <td
108
+ align="right"
109
+ className={classnames(
110
+ `${cell.id}-cell position_relative`,
111
+ isChrome() ? "chrome-styles" : "",
112
+ isPinnedLeft && 'pinned-left',
113
+ isLastCell && 'last-cell',
114
+ )}
115
+ key={`${cell.id}-data`}
116
+ >
117
+ {collapsibleTrail && i === 0 && row.depth > 0 && renderCollapsibleTrail(row.depth)}
118
+ <span id={`${cell.id}-span`}>
119
+ {loading ? (
120
+ <LoadingCell />
121
+ ) : (
122
+ flexRender(cell.column.columnDef.cell, cell.getContext())
123
+ )}
124
+ </span>
125
+ </td>
126
+ )
127
+ })}
128
+ </tr>
129
+
130
+ {/* Display LoadingInline if Row Data is querying and there are no children already */}
131
+ {isDataLoading ? (
132
+ <tr key={`${row.id}-row`}>
133
+ <td colSpan={numberOfColumns}
134
+ style={{ paddingLeft: `${row.depth === 0 ? 0.5 : (row.depth * 2)}em` }}
135
+ >
136
+ <LoadingInline />
137
+ </td>
138
+ </tr>
139
+ ) : null}
140
+ </React.Fragment>
141
+ )
142
+ })}
87
143
  </tbody>
88
144
  </>
89
- );
145
+ )
90
146
  }
91
-
92
- export default TableBody;
@@ -31,46 +31,12 @@
31
31
  width: 100%;
32
32
  }
33
33
 
34
- // Virtualized table styles
35
- .virtualized-table-row {
36
- display: table !important;
37
- table-layout: fixed !important;
38
- width: 100% !important;
39
-
40
- td {
41
- display: table-cell !important;
42
- box-sizing: border-box !important;
43
- white-space: nowrap;
44
- overflow: hidden;
45
- text-overflow: ellipsis;
34
+ .row-selection-actions-card {
35
+ border-bottom-right-radius: 0px !important;
36
+ border-bottom-left-radius: 0px !important;
37
+ border-bottom-color: transparent;
38
+ transition: height 300ms ease;
46
39
  }
47
-
48
- // Ensure the first column has proper width
49
- td:first-child {
50
- min-width: 180px;
51
- }
52
-
53
- // First column (typically the checkbox column)
54
- td:first-child.checkbox-cell {
55
- width: 40px !important; // Set a fixed width that matches header
56
- min-width: 40px !important;
57
- box-sizing: border-box !important;
58
- text-align: center;
59
- }
60
-
61
- // Ensure the first data column has proper alignment with header
62
- td:first-of-type:not(.checkbox-cell) {
63
- min-width: 180px;
64
- text-align: left;
65
- }
66
- }
67
-
68
- .row-selection-actions-card {
69
- border-bottom-right-radius: 0px !important;
70
- border-bottom-left-radius: 0px !important;
71
- border-bottom-color: transparent;
72
- transition: height 300ms ease;
73
- }
74
40
  .table-header-cells:first-child {
75
41
  min-width: 180px;
76
42
  }
@@ -101,23 +67,6 @@
101
67
  border-top-left-radius: 0px !important;
102
68
  border-top-right-radius: 0px !important;
103
69
  }
104
-
105
- // Set fixed width for header cells to match table body
106
- th {
107
- box-sizing: border-box !important;
108
- // Apply min-width to ensure consistent sizing
109
- &.table-header-cells:first-child,
110
- &.table-header-cells-custom:first-child {
111
- min-width: 180px;
112
- }
113
-
114
- // Set fixed width for checkbox column
115
- &.table-header-cells-custom {
116
- width: 40px !important;
117
- min-width: 40px !important;
118
- box-sizing: border-box !important;
119
- }
120
- }
121
70
  }
122
71
 
123
72
  .pb_advanced_table_body {
@@ -138,29 +87,6 @@
138
87
  padding-left: 0px;
139
88
  }
140
89
  }
141
-
142
- // Fix virtualized row borders
143
- tr.virtualized-table-row {
144
- border-bottom: 1px solid $border_light;
145
-
146
- &.bg-silver {
147
- td:first-child {
148
- background-color: lighten($silver, $opacity_7);
149
- }
150
- }
151
-
152
- &.bg-white {
153
- td:first-child {
154
- background-color: $white;
155
- }
156
- }
157
-
158
- &.bg-row-selection {
159
- td:first-child {
160
- background-color: $info_subtle;
161
- }
162
- }
163
- }
164
90
  }
165
91
 
166
92
  .table-header-cells-active:first-child {
@@ -203,6 +129,7 @@
203
129
  max-height: 1920px;
204
130
  overflow-y: auto;
205
131
  }
132
+
206
133
  // Icons
207
134
  .button-icon {
208
135
  display: flex;
@@ -324,19 +251,6 @@
324
251
  .bg-white td:first-child {
325
252
  background-color: $white;
326
253
  }
327
-
328
- .virtualized-table-row {
329
- &.bg-silver td:first-child {
330
- background-color: lighten($silver, $opacity_7);
331
- }
332
- &.bg-white td:first-child {
333
- background-color: $white;
334
- }
335
- &.bg-row-selection td:first-child {
336
- background-color: $info_subtle;
337
- }
338
- }
339
-
340
254
  .row-selection-actions-card {
341
255
  border-right-width: 0px;
342
256
  border-left-width: 0px;
@@ -375,25 +289,6 @@
375
289
  background: $bg_dark;
376
290
  }
377
291
 
378
- // Dark mode virtualized rows
379
- .virtualized-table-row {
380
- &.bg-white {
381
- background: $bg_dark_card !important;
382
-
383
- td:first-child {
384
- background: $bg_dark_card !important;
385
- }
386
- }
387
-
388
- &.bg-silver {
389
- background: $bg_dark;
390
-
391
- td:first-child {
392
- background: $bg_dark;
393
- }
394
- }
395
- }
396
-
397
292
  .table-header-cells:first-child, td:first-child, .pb_table_td:first-child {
398
293
  box-shadow: 1px 0px 0px 0px $border_dark !important;
399
294
  }
@@ -464,17 +359,6 @@
464
359
  .bg-white td:first-child {
465
360
  background-color: $bg_dark_card;
466
361
  }
467
-
468
- // Dark mode virtualized rows
469
- .virtualized-table-row {
470
- &.bg-silver td:first-child {
471
- background-color: $bg_dark;
472
- }
473
- &.bg-white td:first-child {
474
- background-color: $bg_dark_card;
475
- }
476
- }
477
-
478
362
  .sticky-header {
479
363
  thead {
480
364
  th:first-child {
@@ -486,4 +370,4 @@
486
370
  }
487
371
  }
488
372
  }
489
- }
373
+ }