playbook_ui 14.14.0.pre.alpha.PBNTR866finalizecssendlessscroll6486 → 14.14.0.pre.alpha.PBNTR888selectvaliditymessage6348

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 (73) 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_drawer/_drawer.scss +8 -32
  7. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_default.html.erb +1 -20
  8. data/app/pb_kits/playbook/pb_drawer/docs/example.yml +0 -5
  9. data/app/pb_kits/playbook/pb_drawer/drawer.html.erb +12 -20
  10. data/app/pb_kits/playbook/pb_drawer/drawer.rb +1 -49
  11. data/app/pb_kits/playbook/pb_overlay/_overlay.scss +0 -13
  12. data/app/pb_kits/playbook/pb_overlay/_overlay.tsx +1 -7
  13. data/app/pb_kits/playbook/pb_overlay/docs/example.yml +0 -3
  14. data/app/pb_kits/playbook/pb_overlay/docs/index.js +0 -1
  15. data/app/pb_kits/playbook/pb_overlay/overlay.html.erb +3 -5
  16. data/app/pb_kits/playbook/pb_overlay/overlay.rb +1 -16
  17. data/app/pb_kits/playbook/pb_overlay/overlay.test.jsx +0 -12
  18. data/app/pb_kits/playbook/pb_tooltip/_tooltip.scss +3 -0
  19. data/app/pb_kits/playbook/pb_tooltip/docs/example.yml +0 -2
  20. data/app/pb_kits/playbook/pb_tooltip/index.js +1 -1
  21. data/app/pb_kits/playbook/pb_tooltip/tooltip.rb +2 -10
  22. data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +1 -34
  23. data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +0 -2
  24. data/app/pb_kits/playbook/pb_typeahead/index.ts +8 -61
  25. data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +1 -13
  26. data/dist/chunks/_typeahead-PqkcDf1H.js +36 -0
  27. data/dist/chunks/_weekday_stacked-BrSrpj7J.js +45 -0
  28. data/dist/chunks/{lib-Dmay5Z6U.js → lib-D3us1bGD.js} +1 -1
  29. data/dist/chunks/{pb_form_validation-DdP7BnVX.js → pb_form_validation-BpihMSOQ.js} +1 -1
  30. data/dist/chunks/vendor.js +1 -1
  31. data/dist/menu.yml +2 -2
  32. data/dist/playbook-doc.js +1 -1
  33. data/dist/playbook-rails-react-bindings.js +1 -1
  34. data/dist/playbook-rails.js +1 -1
  35. data/dist/playbook.css +1 -1
  36. data/lib/playbook/version.rb +1 -1
  37. metadata +6 -40
  38. data/app/pb_kits/playbook/pb_advanced_table/Components/RegularTableView.tsx +0 -127
  39. data/app/pb_kits/playbook/pb_advanced_table/Components/TableActionBar.tsx +0 -55
  40. data/app/pb_kits/playbook/pb_advanced_table/Components/TablePagination.tsx +0 -33
  41. data/app/pb_kits/playbook/pb_advanced_table/Components/VirtualizedTableView.tsx +0 -275
  42. data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableActions.ts +0 -66
  43. data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableState.ts +0 -195
  44. data/app/pb_kits/playbook/pb_advanced_table/Utilities/CellRendererUtils.tsx +0 -73
  45. data/app/pb_kits/playbook/pb_advanced_table/Utilities/RowUtils.ts +0 -52
  46. data/app/pb_kits/playbook/pb_advanced_table/Utilities/TableContainerStyles.ts +0 -80
  47. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_infinite_scroll.jsx +0 -50
  48. data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_mock_data_infinite_scroll.json +0 -152002
  49. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_behavior.html.erb +0 -8
  50. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_borders.html.erb +0 -33
  51. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.html.erb +0 -0
  52. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.html.erb +0 -24
  53. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.html.erb +0 -21
  54. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.md +0 -1
  55. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_sizes.html.erb +0 -49
  56. data/app/pb_kits/playbook/pb_drawer/index.js +0 -257
  57. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar.html.erb +0 -11
  58. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar.jsx +0 -37
  59. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar_rails.md +0 -1
  60. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar_react.md +0 -1
  61. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional.html.erb +0 -11
  62. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional.md +0 -1
  63. data/app/pb_kits/playbook/pb_overlay/index.js +0 -61
  64. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_delay_rails.html.erb +0 -39
  65. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_delay_rails.md +0 -3
  66. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_interaction.html.erb +0 -26
  67. data/app/pb_kits/playbook/pb_tooltip/floating_ui.js +0 -282
  68. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options.html.erb +0 -45
  69. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options.md +0 -5
  70. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options_pure_rails.html.erb +0 -33
  71. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options_pure_rails.md +0 -3
  72. data/dist/chunks/_typeahead-BBL6ThPp.js +0 -36
  73. data/dist/chunks/_weekday_stacked-CF_V6Rbs.js +0 -45
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Playbook
4
4
  PREVIOUS_VERSION = "14.14.0"
5
- VERSION = "14.14.0.pre.alpha.PBNTR866finalizecssendlessscroll6486"
5
+ VERSION = "14.14.0.pre.alpha.PBNTR888selectvaliditymessage6348"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playbook_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 14.14.0.pre.alpha.PBNTR866finalizecssendlessscroll6486
4
+ version: 14.14.0.pre.alpha.PBNTR888selectvaliditymessage6348
5
5
  platform: ruby
6
6
  authors:
7
7
  - Power UX
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2025-03-05 00:00:00.000000000 Z
12
+ date: 2025-02-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -257,27 +257,18 @@ files:
257
257
  - app/pb_kits/playbook/pb_advanced_table/Components/CollapsibleTrail.tsx
258
258
  - app/pb_kits/playbook/pb_advanced_table/Components/CustomCell.tsx
259
259
  - app/pb_kits/playbook/pb_advanced_table/Components/LoadingCell.tsx
260
- - app/pb_kits/playbook/pb_advanced_table/Components/RegularTableView.tsx
261
260
  - app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
262
261
  - app/pb_kits/playbook/pb_advanced_table/Components/SubRowHeaderRow.tsx
263
- - app/pb_kits/playbook/pb_advanced_table/Components/TableActionBar.tsx
264
262
  - app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx
265
- - app/pb_kits/playbook/pb_advanced_table/Components/TablePagination.tsx
266
263
  - app/pb_kits/playbook/pb_advanced_table/Components/ToggleIconButton.tsx
267
- - app/pb_kits/playbook/pb_advanced_table/Components/VirtualizedTableView.tsx
268
264
  - app/pb_kits/playbook/pb_advanced_table/Context/AdvancedTableContext.tsx
269
- - app/pb_kits/playbook/pb_advanced_table/Hooks/useTableActions.ts
270
- - app/pb_kits/playbook/pb_advanced_table/Hooks/useTableState.ts
271
265
  - app/pb_kits/playbook/pb_advanced_table/README.md
272
266
  - app/pb_kits/playbook/pb_advanced_table/SubKits/TableBody.tsx
273
267
  - app/pb_kits/playbook/pb_advanced_table/SubKits/TableHeader.tsx
274
268
  - app/pb_kits/playbook/pb_advanced_table/Utilities/ActionBarAnimationHelper.ts
275
269
  - app/pb_kits/playbook/pb_advanced_table/Utilities/BrowserCheck.tsx
276
- - app/pb_kits/playbook/pb_advanced_table/Utilities/CellRendererUtils.tsx
277
270
  - app/pb_kits/playbook/pb_advanced_table/Utilities/ExpansionControlHelpers.tsx
278
271
  - app/pb_kits/playbook/pb_advanced_table/Utilities/IconHelpers.tsx
279
- - app/pb_kits/playbook/pb_advanced_table/Utilities/RowUtils.ts
280
- - app/pb_kits/playbook/pb_advanced_table/Utilities/TableContainerStyles.ts
281
272
  - app/pb_kits/playbook/pb_advanced_table/Utilities/types.ts
282
273
  - app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss
283
274
  - app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx
@@ -309,7 +300,6 @@ files:
309
300
  - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_default.md
310
301
  - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expanded_control.jsx
311
302
  - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expanded_control.md
312
- - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_infinite_scroll.jsx
313
303
  - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_inline_row_loading.jsx
314
304
  - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_inline_row_loading.md
315
305
  - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_loading.html.erb
@@ -350,7 +340,6 @@ files:
350
340
  - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_react.md
351
341
  - app/pb_kits/playbook/pb_advanced_table/docs/_mock_data_inline_loading.js
352
342
  - app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_mock_data.json
353
- - app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_mock_data_infinite_scroll.json
354
343
  - app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_mock_data_no_subrows.json
355
344
  - app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_mock_data_with_id.json
356
345
  - app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_pagination_mock_data.json
@@ -1213,21 +1202,14 @@ files:
1213
1202
  - app/pb_kits/playbook/pb_drawer/_drawer.tsx
1214
1203
  - app/pb_kits/playbook/pb_drawer/_drawer_context.tsx
1215
1204
  - app/pb_kits/playbook/pb_drawer/context.ts
1216
- - app/pb_kits/playbook/pb_drawer/docs/_drawer_behavior.html.erb
1217
1205
  - app/pb_kits/playbook/pb_drawer/docs/_drawer_behavior.jsx
1218
- - app/pb_kits/playbook/pb_drawer/docs/_drawer_borders.html.erb
1219
1206
  - app/pb_kits/playbook/pb_drawer/docs/_drawer_borders.jsx
1220
- - app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.html.erb
1221
1207
  - app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.jsx
1222
1208
  - app/pb_kits/playbook/pb_drawer/docs/_drawer_default.html.erb
1223
1209
  - app/pb_kits/playbook/pb_drawer/docs/_drawer_default.jsx
1224
- - app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.html.erb
1225
1210
  - app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.jsx
1226
1211
  - app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.md
1227
- - app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.html.erb
1228
1212
  - app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx
1229
- - app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.md
1230
- - app/pb_kits/playbook/pb_drawer/docs/_drawer_sizes.html.erb
1231
1213
  - app/pb_kits/playbook/pb_drawer/docs/_drawer_sizes.jsx
1232
1214
  - app/pb_kits/playbook/pb_drawer/docs/example.yml
1233
1215
  - app/pb_kits/playbook/pb_drawer/docs/index.js
@@ -1236,7 +1218,6 @@ files:
1236
1218
  - app/pb_kits/playbook/pb_drawer/drawer.test.jsx
1237
1219
  - app/pb_kits/playbook/pb_drawer/hooks/useBreakpoint.tsx
1238
1220
  - app/pb_kits/playbook/pb_drawer/hooks/useDrawerAnimation.tsx
1239
- - app/pb_kits/playbook/pb_drawer/index.js
1240
1221
  - app/pb_kits/playbook/pb_dropdown/_dropdown.scss
1241
1222
  - app/pb_kits/playbook/pb_dropdown/_dropdown.tsx
1242
1223
  - app/pb_kits/playbook/pb_dropdown/context/index.tsx
@@ -2138,23 +2119,16 @@ files:
2138
2119
  - app/pb_kits/playbook/pb_overlay/docs/_overlay_default.html.erb
2139
2120
  - app/pb_kits/playbook/pb_overlay/docs/_overlay_default.jsx
2140
2121
  - app/pb_kits/playbook/pb_overlay/docs/_overlay_default.md
2141
- - app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar.html.erb
2142
- - app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar.jsx
2143
- - app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar_rails.md
2144
- - app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar_react.md
2145
2122
  - app/pb_kits/playbook/pb_overlay/docs/_overlay_multi_directional.html.erb
2146
2123
  - app/pb_kits/playbook/pb_overlay/docs/_overlay_multi_directional.jsx
2147
2124
  - app/pb_kits/playbook/pb_overlay/docs/_overlay_multi_directional.md
2148
2125
  - app/pb_kits/playbook/pb_overlay/docs/_overlay_toggle.html.erb
2149
2126
  - app/pb_kits/playbook/pb_overlay/docs/_overlay_toggle.jsx
2150
2127
  - app/pb_kits/playbook/pb_overlay/docs/_overlay_toggle.md
2151
- - app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional.html.erb
2152
2128
  - app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional.jsx
2153
- - app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional.md
2154
2129
  - app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional_react.md
2155
2130
  - app/pb_kits/playbook/pb_overlay/docs/example.yml
2156
2131
  - app/pb_kits/playbook/pb_overlay/docs/index.js
2157
- - app/pb_kits/playbook/pb_overlay/index.js
2158
2132
  - app/pb_kits/playbook/pb_overlay/overlay.html.erb
2159
2133
  - app/pb_kits/playbook/pb_overlay/overlay.rb
2160
2134
  - app/pb_kits/playbook/pb_overlay/overlay.test.jsx
@@ -3110,12 +3084,9 @@ files:
3110
3084
  - app/pb_kits/playbook/pb_tooltip/docs/_tooltip_default_react.md
3111
3085
  - app/pb_kits/playbook/pb_tooltip/docs/_tooltip_delay.jsx
3112
3086
  - app/pb_kits/playbook/pb_tooltip/docs/_tooltip_delay.md
3113
- - app/pb_kits/playbook/pb_tooltip/docs/_tooltip_delay_rails.html.erb
3114
- - app/pb_kits/playbook/pb_tooltip/docs/_tooltip_delay_rails.md
3115
3087
  - app/pb_kits/playbook/pb_tooltip/docs/_tooltip_icon.erb
3116
3088
  - app/pb_kits/playbook/pb_tooltip/docs/_tooltip_icon.jsx
3117
3089
  - app/pb_kits/playbook/pb_tooltip/docs/_tooltip_icon.md
3118
- - app/pb_kits/playbook/pb_tooltip/docs/_tooltip_interaction.html.erb
3119
3090
  - app/pb_kits/playbook/pb_tooltip/docs/_tooltip_interaction.jsx
3120
3091
  - app/pb_kits/playbook/pb_tooltip/docs/_tooltip_interaction.md
3121
3092
  - app/pb_kits/playbook/pb_tooltip/docs/_tooltip_margin.jsx
@@ -3129,7 +3100,6 @@ files:
3129
3100
  - app/pb_kits/playbook/pb_tooltip/docs/_tooltip_with_icon_circle.html.erb
3130
3101
  - app/pb_kits/playbook/pb_tooltip/docs/example.yml
3131
3102
  - app/pb_kits/playbook/pb_tooltip/docs/index.js
3132
- - app/pb_kits/playbook/pb_tooltip/floating_ui.js
3133
3103
  - app/pb_kits/playbook/pb_tooltip/index.js
3134
3104
  - app/pb_kits/playbook/pb_tooltip/tooltip.html.erb
3135
3105
  - app/pb_kits/playbook/pb_tooltip/tooltip.rb
@@ -3176,10 +3146,6 @@ files:
3176
3146
  - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_custom_menu_list.jsx
3177
3147
  - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default.html.erb
3178
3148
  - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default.jsx
3179
- - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options.html.erb
3180
- - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options.md
3181
- - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options_pure_rails.html.erb
3182
- - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options_pure_rails.md
3183
3149
  - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_error_state.html.erb
3184
3150
  - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_error_state.jsx
3185
3151
  - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_error_state.md
@@ -3386,11 +3352,11 @@ files:
3386
3352
  - app/pb_kits/playbook/utilities/test/globalProps/truncate.test.js
3387
3353
  - app/pb_kits/playbook/utilities/text.ts
3388
3354
  - app/pb_kits/playbook/utilities/validEmojiChecker.ts
3389
- - dist/chunks/_typeahead-BBL6ThPp.js
3390
- - dist/chunks/_weekday_stacked-CF_V6Rbs.js
3355
+ - dist/chunks/_typeahead-PqkcDf1H.js
3356
+ - dist/chunks/_weekday_stacked-BrSrpj7J.js
3391
3357
  - dist/chunks/lazysizes-B7xYodB-.js
3392
- - dist/chunks/lib-Dmay5Z6U.js
3393
- - dist/chunks/pb_form_validation-DdP7BnVX.js
3358
+ - dist/chunks/lib-D3us1bGD.js
3359
+ - dist/chunks/pb_form_validation-BpihMSOQ.js
3394
3360
  - dist/chunks/vendor.js
3395
3361
  - dist/menu.yml
3396
3362
  - dist/playbook-doc.js
@@ -1,127 +0,0 @@
1
- import React, { useContext } from "react"
2
- import classnames from "classnames"
3
- import { flexRender, Row, Cell } from "@tanstack/react-table"
4
-
5
- import { GenericObject } from "../../types"
6
- import { isChrome } from "../Utilities/BrowserCheck"
7
-
8
- import LoadingInline from "../../pb_loading_inline/_loading_inline"
9
- import Checkbox from "../../pb_checkbox/_checkbox"
10
-
11
- import { SubRowHeaderRow } from "../Components/SubRowHeaderRow"
12
- import { LoadingCell } from "../Components/LoadingCell"
13
- import { renderCollapsibleTrail } from "../Components/CollapsibleTrail"
14
-
15
- import AdvancedTableContext from "../Context/AdvancedTableContext"
16
-
17
- type RegularTableViewProps = {
18
- collapsibleTrail?: boolean
19
- subRowHeaders?: string[]
20
- }
21
-
22
- export const RegularTableView = ({
23
- collapsibleTrail = true,
24
- subRowHeaders,
25
- }: RegularTableViewProps) => {
26
- const {
27
- enableToggleExpansion,
28
- handleExpandOrCollapse,
29
- inlineRowLoading,
30
- loading,
31
- responsive,
32
- table,
33
- selectableRows,
34
- hasAnySubRows,
35
- isPinnedLeft = false,
36
- } = useContext(AdvancedTableContext)
37
-
38
- const columnPinning = table.getState().columnPinning || { left: [] };
39
- const columnDefinitions = table.options.meta?.columnDefinitions || [];
40
-
41
- return (
42
- <>
43
- {table.getRowModel().rows.map((row: Row<GenericObject>) => {
44
- const isExpandable = row.getIsExpanded();
45
- const isFirstChildofSubrow = row.depth > 0 && row.index === 0;
46
- const rowHasNoChildren = row.original?.children && !row.original.children.length ? true : false;
47
- const numberOfColumns = table.getAllFlatColumns().length;
48
- const isDataLoading = isExpandable && (inlineRowLoading && rowHasNoChildren) && (row.depth < columnDefinitions[0]?.cellAccessors?.length);
49
- const rowBackground = isExpandable && ((!inlineRowLoading && row.getCanExpand()) || (inlineRowLoading && rowHasNoChildren));
50
- const rowColor = row.getIsSelected() ? "bg-row-selection" : rowBackground ? "bg-silver" : "bg-white";
51
-
52
- return (
53
- <React.Fragment key={`${row.index}-${row.id}-${row.depth}-row`}>
54
- {isFirstChildofSubrow && subRowHeaders && (
55
- <SubRowHeaderRow
56
- collapsibleTrail={collapsibleTrail}
57
- enableToggleExpansion={enableToggleExpansion}
58
- onClick={handleExpandOrCollapse}
59
- row={row}
60
- subRowHeaders={subRowHeaders}
61
- table={table}
62
- />
63
- )}
64
-
65
- <tr
66
- className={`${rowColor} ${row.depth > 0 ? `depth-sub-row-${row.depth}` : ""}`}
67
- id={`${row.index}-${row.id}-${row.depth}-row`}
68
- >
69
- {/* Render custom checkbox column when we want selectableRows for non-expanding tables */}
70
- {selectableRows && !hasAnySubRows && (
71
- <td className="checkbox-cell">
72
- <Checkbox
73
- checked={row.getIsSelected()}
74
- disabled={!row.getCanSelect()}
75
- indeterminate={row.getIsSomeSelected()}
76
- name={row.id}
77
- onChange={row.getToggleSelectedHandler()}
78
- />
79
- </td>
80
- )}
81
-
82
- {row.getVisibleCells().map((cell: Cell<GenericObject, unknown>, i: number) => {
83
- const isPinnedLeft = columnPinning.left.includes(cell.column.id);
84
- const isLastCell = cell.column.parent?.columns?.at(-1)?.id === cell.column.id;
85
-
86
- return (
87
- <td
88
- align="right"
89
- className={classnames(
90
- `${cell.id}-cell position_relative`,
91
- isChrome() ? "chrome-styles" : "",
92
- isPinnedLeft && 'pinned-left',
93
- isLastCell && 'last-cell',
94
- )}
95
- key={`${cell.id}-data`}
96
- >
97
- {collapsibleTrail && i === 0 && row.depth > 0 && renderCollapsibleTrail(row.depth)}
98
- <span id={`${cell.id}-span`}>
99
- {loading ? (
100
- <LoadingCell />
101
- ) : (
102
- flexRender(cell.column.columnDef.cell, cell.getContext())
103
- )}
104
- </span>
105
- </td>
106
- );
107
- })}
108
- </tr>
109
-
110
- {/* Display LoadingInline if Row Data is querying and there are no children already */}
111
- {isDataLoading && (
112
- <tr key={`${row.id}-row`}>
113
- <td colSpan={numberOfColumns}
114
- style={{ paddingLeft: `${row.depth === 0 ? 0.5 : (row.depth * 2)}em` }}
115
- >
116
- <LoadingInline />
117
- </td>
118
- </tr>
119
- )}
120
- </React.Fragment>
121
- );
122
- })}
123
- </>
124
- );
125
- }
126
-
127
- export default RegularTableView;
@@ -1,55 +0,0 @@
1
- import React, { useEffect, useRef } from "react";
2
- import Card from "../../pb_card/_card";
3
- import Caption from "../../pb_caption/_caption";
4
- import Flex from "../../pb_flex/_flex";
5
- import FlexItem from "../../pb_flex/_flex_item";
6
- import { showActionBar, hideActionBar } from "../Utilities/ActionBarAnimationHelper";
7
-
8
- interface TableActionBarProps {
9
- isVisible: boolean;
10
- selectedCount: number;
11
- actions?: React.ReactNode[] | React.ReactNode;
12
- }
13
-
14
- const TableActionBar: React.FC<TableActionBarProps> = ({
15
- isVisible,
16
- selectedCount,
17
- actions
18
- }) => {
19
- const cardRef = useRef(null);
20
-
21
- useEffect(() => {
22
- if (cardRef.current) {
23
- if (isVisible) {
24
- showActionBar(cardRef.current);
25
- } else {
26
- hideActionBar(cardRef.current);
27
- }
28
- }
29
- }, [isVisible]);
30
-
31
- return (
32
- <Card
33
- borderNone={!isVisible}
34
- className={`${isVisible && "show-action-card row-selection-actions-card"}`}
35
- htmlOptions={{ ref: cardRef as any }}
36
- padding={`${isVisible ? "xs" : "none"}`}
37
- >
38
- <Flex
39
- alignItems="center"
40
- justify="between"
41
- >
42
- <Caption
43
- color="light"
44
- paddingLeft="xs"
45
- size="xs"
46
- >
47
- {selectedCount} Selected
48
- </Caption>
49
- <FlexItem>{actions}</FlexItem>
50
- </Flex>
51
- </Card>
52
- );
53
- };
54
-
55
- export default TableActionBar;
@@ -1,33 +0,0 @@
1
- import React from "react";
2
- import Pagination from "../../pb_pagination/_pagination";
3
-
4
- interface TablePaginationProps {
5
- table: any;
6
- onChange: (page: number) => void;
7
- position: "top" | "bottom";
8
- range?: number;
9
- }
10
-
11
- const TablePagination: React.FC<TablePaginationProps> = ({
12
- table,
13
- onChange,
14
- position,
15
- range = 5
16
- }) => {
17
- const current = table.getState().pagination.pageIndex + 1;
18
- const total = table.getPageCount();
19
-
20
- return (
21
- <Pagination
22
- current={current}
23
- key={`pagination-${position}-${current}`}
24
- marginBottom={position === "top" ? "xs" : undefined}
25
- marginTop={position === "bottom" ? "xs" : undefined}
26
- onChange={onChange}
27
- range={range}
28
- total={total}
29
- />
30
- );
31
- };
32
-
33
- export default TablePagination;
@@ -1,275 +0,0 @@
1
- import React, { useContext, useLayoutEffect, useState, useEffect } from "react"
2
- import classnames from "classnames"
3
- import { flexRender, Cell } from "@tanstack/react-table"
4
- import { VirtualItem } from "@tanstack/react-virtual"
5
-
6
- import { GenericObject } from "../../types"
7
-
8
- import { isChrome } from "../Utilities/BrowserCheck"
9
- import { getVirtualizedRowStyle } from "../Utilities/TableContainerStyles"
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"
17
-
18
- import AdvancedTableContext from "../Context/AdvancedTableContext"
19
-
20
- type VirtualizedTableViewProps = {
21
- collapsibleTrail?: boolean
22
- subRowHeaders?: string[]
23
- }
24
-
25
- export const VirtualizedTableView = ({
26
- collapsibleTrail = true,
27
- subRowHeaders,
28
- }: VirtualizedTableViewProps) => {
29
- const {
30
- enableToggleExpansion,
31
- handleExpandOrCollapse,
32
- inlineRowLoading,
33
- loading,
34
- table,
35
- selectableRows,
36
- hasAnySubRows,
37
- virtualizer,
38
- flattenedItems,
39
- } = useContext(AdvancedTableContext)
40
-
41
- const columnPinning = table.getState().columnPinning || { left: [] };
42
- const sortingState = JSON.stringify(table.getState().sorting || []);
43
-
44
- // Store column widths extracted from header
45
- const [columnWidths, setColumnWidths] = useState<{[key: string]: string}>({});
46
-
47
- // Function to get header cell widths
48
- const getHeaderCellWidths = () => {
49
- const widths: {[key: string]: string} = {};
50
-
51
- // Get all header cells
52
- const headerCells = document.querySelectorAll('.table-header-cells, .table-header-cells-custom');
53
-
54
- // If checkbox is present in header
55
- if (selectableRows && !hasAnySubRows && headerCells.length > 0) {
56
- widths['checkbox'] = `${headerCells[0].getBoundingClientRect().width}px`;
57
- }
58
-
59
- // Process regular header cells
60
- table.getFlatHeaders().forEach((header: any, index: number) => {
61
- // Adjust index if checkbox column exists
62
- const headerIndex = (selectableRows && !hasAnySubRows) ? index + 1 : index;
63
-
64
- if (headerCells[headerIndex]) {
65
- const width = headerCells[headerIndex].getBoundingClientRect().width;
66
- widths[header.id] = `${width}px`;
67
- }
68
- });
69
-
70
- return widths;
71
- };
72
-
73
- // Debounce function to prevent too many updates during resize
74
- const debounce = <T extends (...args: any[]) => any>(func: T, wait: number): ((...args: Parameters<T>) => void) => {
75
- let timeout: ReturnType<typeof setTimeout>;
76
- return function executedFunction(...args: Parameters<T>) {
77
- const later = () => {
78
- clearTimeout(timeout);
79
- func(...args);
80
- };
81
- clearTimeout(timeout);
82
- timeout = setTimeout(later, wait);
83
- };
84
- };
85
-
86
- // Update column widths when component mounts and when sorting changes
87
- useLayoutEffect(() => {
88
- // Apply widths after a small delay to ensure header is rendered
89
- const timer = setTimeout(() => {
90
- setColumnWidths(getHeaderCellWidths());
91
- }, 0);
92
-
93
- return () => clearTimeout(timer);
94
- }, [table, selectableRows, hasAnySubRows, sortingState]);
95
-
96
- // Add window resize listener to update widths on window resize
97
- useEffect(() => {
98
- // Create debounced version of the width measurement function
99
- const handleResize = debounce(() => {
100
- setColumnWidths(getHeaderCellWidths());
101
- }, 0);
102
-
103
- // Add the event listener
104
- window.addEventListener('resize', handleResize);
105
-
106
- // Cleanup
107
- return () => {
108
- window.removeEventListener('resize', handleResize);
109
- };
110
- }, [table, selectableRows, hasAnySubRows]);
111
-
112
- // Safety check
113
- if (!virtualizer || !flattenedItems) {
114
- return (
115
- <tr>
116
- <td colSpan={table.getAllFlatColumns().length || 1}>
117
- No data to display.
118
- </td>
119
- </tr>
120
- );
121
- }
122
-
123
- // Get virtual items
124
- let virtualItems: VirtualItem[] = [];
125
- try {
126
- virtualItems = virtualizer.getVirtualItems();
127
- } catch (err) {
128
- return (
129
- <tr>
130
- <td colSpan={table.getAllFlatColumns().length || 1}>
131
- Error loading virtualized data.
132
- </td>
133
- </tr>
134
- );
135
- }
136
-
137
- if (!virtualItems.length) {
138
- return (
139
- <tr>
140
- <td colSpan={table.getAllFlatColumns().length || 1}>
141
- No items to display.
142
- </td>
143
- </tr>
144
- );
145
- }
146
-
147
- return (
148
- <>
149
- {virtualItems.map((virtualRow: VirtualItem) => {
150
- const item = flattenedItems[virtualRow.index];
151
- if (!item) return null;
152
-
153
- // Use consistent row styling
154
- const virtualItemStyle = getVirtualizedRowStyle(virtualRow.start);
155
-
156
- if (item.type === 'header') {
157
- return (
158
- <tr
159
- className="virtualized-table-row virtualized-header-row"
160
- key={`header-${item.id}-sort-${sortingState}`}
161
- style={virtualItemStyle}
162
- >
163
- <td colSpan={table.getAllFlatColumns().length}>
164
- <SubRowHeaderRow
165
- collapsibleTrail={collapsibleTrail}
166
- enableToggleExpansion={enableToggleExpansion}
167
- onClick={handleExpandOrCollapse}
168
- row={item.row}
169
- subRowHeaders={subRowHeaders}
170
- table={table}
171
- />
172
- </td>
173
- </tr>
174
- );
175
- }
176
-
177
- if (item.type === 'row') {
178
- const row = item.row;
179
- const isExpandable = row.getIsExpanded();
180
- const rowHasNoChildren = row.original?.children && !row.original.children.length ? true : false;
181
- const rowBackground = isExpandable && ((!inlineRowLoading && row.getCanExpand()) || (inlineRowLoading && rowHasNoChildren));
182
- const rowColor = row.getIsSelected() ? "bg-row-selection" : rowBackground ? "bg-silver" : "bg-white";
183
-
184
- return (
185
- <tr
186
- className={`virtualized-table-row ${rowColor} ${row.depth > 0 ? `depth-sub-row-${row.depth}` : ""}`}
187
- data-index={virtualRow.index}
188
- key={`row-${item.id}-sort-${sortingState}`}
189
- ref={(node) => {
190
- if (node) {
191
- try {
192
- virtualizer.measureElement(node);
193
- } catch (err) {
194
- // Silent error handling
195
- }
196
- }
197
- }}
198
- style={virtualItemStyle}
199
- >
200
- {/* Render custom checkbox column when we want selectableRows for non-expanding tables */}
201
- {selectableRows && !hasAnySubRows && (
202
- <td
203
- className="checkbox-cell"
204
- style={{ width: columnWidths['checkbox'] || 'auto' }}
205
- >
206
- <Checkbox
207
- checked={row.getIsSelected()}
208
- disabled={!row.getCanSelect()}
209
- indeterminate={row.getIsSomeSelected()}
210
- name={row.id}
211
- onChange={row.getToggleSelectedHandler()}
212
- />
213
- </td>
214
- )}
215
-
216
- {row.getVisibleCells().map((cell: Cell<GenericObject, unknown>, i: number) => {
217
- const isPinnedLeft = columnPinning.left.includes(cell.column.id);
218
- const isLastCell = cell.column.parent?.columns?.at(-1)?.id === cell.column.id;
219
- const cellWidth = columnWidths[cell.column.id] || 'auto';
220
-
221
- return (
222
- <td
223
- align="right"
224
- className={classnames(
225
- `${cell.id}-cell position_relative`,
226
- isChrome() ? "chrome-styles" : "",
227
- isPinnedLeft && 'pinned-left',
228
- isLastCell && 'last-cell',
229
- )}
230
- key={`${cell.id}-data`}
231
- style={{ width: cellWidth }}
232
- >
233
- {collapsibleTrail && i === 0 && row.depth > 0 && renderCollapsibleTrail(row.depth)}
234
- <span id={`${cell.id}-span`}>
235
- {loading ? (
236
- <LoadingCell />
237
- ) : (
238
- flexRender(cell.column.columnDef.cell, cell.getContext())
239
- )}
240
- </span>
241
- </td>
242
- );
243
- })}
244
- </tr>
245
- );
246
- }
247
-
248
- if (item.type === 'loading') {
249
- // Render loading indicator
250
- const row = item.row;
251
- const numberOfColumns = table.getAllFlatColumns().length;
252
-
253
- return (
254
- <tr
255
- className="virtualized-table-row virtualized-loading-row"
256
- key={`loading-${item.id}-sort-${sortingState}`}
257
- style={virtualItemStyle}
258
- >
259
- <td
260
- colSpan={numberOfColumns}
261
- style={{ paddingLeft: `${row.depth === 0 ? 0.5 : (row.depth * 2)}em` }}
262
- >
263
- <LoadingInline />
264
- </td>
265
- </tr>
266
- );
267
- }
268
-
269
- return null;
270
- })}
271
- </>
272
- );
273
- }
274
-
275
- export default VirtualizedTableView;