playbook_ui 14.23.0.pre.rc.3 → 14.24.0.pre.alpha.PLAY1972validatemissingareacodeandrepeatcountrycode9457

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 (152) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +0 -1
  3. data/app/pb_kits/playbook/pb_advanced_table/Components/CustomCell.tsx +7 -6
  4. data/app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx +24 -25
  5. data/app/pb_kits/playbook/pb_advanced_table/Components/TableActionBar.tsx +10 -10
  6. data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +11 -12
  7. data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableState.ts +7 -4
  8. data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableHeader.tsx +1 -1
  9. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +112 -2
  10. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +13 -7
  11. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.html.erb +2 -2
  12. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.rb +14 -2
  13. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +34 -0
  14. data/app/pb_kits/playbook/pb_advanced_table/advanced_table_action_bar.js +16 -0
  15. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_vertical_border.html.erb +43 -0
  16. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_vertical_border.jsx +64 -0
  17. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_row_styling.html.erb +46 -0
  18. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_row_styling_rails.md +7 -0
  19. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_header_rails.html.erb +1 -1
  20. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_rails.html.erb +1 -1
  21. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_per_column.jsx +55 -0
  22. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_per_column.md +6 -0
  23. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_per_column_for_multi_column.jsx +80 -0
  24. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_per_column_for_multi_column.md +1 -0
  25. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header.md +1 -1
  26. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header_multi_header.jsx +107 -0
  27. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header_multi_header.md +1 -0
  28. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header_rails.html.erb +51 -0
  29. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header_rails.md +1 -0
  30. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +7 -0
  31. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +4 -0
  32. data/app/pb_kits/playbook/pb_advanced_table/flat_advanced_table.js +4 -11
  33. data/app/pb_kits/playbook/pb_advanced_table/index.js +108 -125
  34. data/app/pb_kits/playbook/pb_advanced_table/scss_partials/advanced_table_sticky_mixin.scss +7 -1
  35. data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +7 -4
  36. data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +5 -1
  37. data/app/pb_kits/playbook/pb_advanced_table/table_header.rb +46 -4
  38. data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +13 -4
  39. data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +24 -5
  40. data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb +1 -1
  41. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_position.md +1 -1
  42. data/app/pb_kits/playbook/pb_checkbox/checkbox.rb +12 -1
  43. data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_indeterminate.html.erb +1 -1
  44. data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_indeterminate_rails.md +2 -1
  45. data/app/pb_kits/playbook/pb_checkbox/index.js +218 -26
  46. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.md +1 -1
  47. data/app/pb_kits/playbook/pb_date/_date.tsx +5 -3
  48. data/app/pb_kits/playbook/pb_date/date.html.erb +6 -6
  49. data/app/pb_kits/playbook/pb_date/date.rb +2 -0
  50. data/app/pb_kits/playbook/pb_date/docs/_date_with_show_current_year.html.erb +4 -0
  51. data/app/pb_kits/playbook/pb_date/docs/_date_with_show_current_year.jsx +17 -0
  52. data/app/pb_kits/playbook/pb_date/docs/_date_with_show_current_year.md +1 -0
  53. data/app/pb_kits/playbook/pb_date/docs/example.yml +2 -0
  54. data/app/pb_kits/playbook/pb_date/docs/index.js +1 -0
  55. data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +17 -1
  56. data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +6 -0
  57. data/app/pb_kits/playbook/pb_dropdown/_dropdown_mixin.scss +36 -0
  58. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_active_style_options.jsx +90 -0
  59. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_active_style_options_react.md +4 -0
  60. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_radio_options.jsx +1 -0
  61. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_radio_options_react.md +1 -1
  62. data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +3 -2
  63. data/app/pb_kits/playbook/pb_dropdown/docs/index.js +2 -1
  64. data/app/pb_kits/playbook/pb_dropdown/dropdown.test.jsx +24 -0
  65. data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownOption.tsx +11 -1
  66. data/app/pb_kits/playbook/pb_gauge/docs/_description.md +1 -0
  67. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_colors.jsx +32 -15
  68. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_colors_react.md +2 -0
  69. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_complex.jsx +35 -9
  70. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_complex_react.md +1 -0
  71. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_default.jsx +26 -14
  72. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_disable_animation.jsx +32 -15
  73. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_full_circle.jsx +45 -17
  74. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_height.jsx +59 -22
  75. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_live_data.jsx +40 -9
  76. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_min_max.jsx +50 -18
  77. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_sizing.jsx +31 -18
  78. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_title.jsx +34 -17
  79. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_units.jsx +64 -23
  80. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_units_react.md +1 -0
  81. data/app/pb_kits/playbook/pb_gauge/docs/example.yml +0 -1
  82. data/app/pb_kits/playbook/pb_gauge/docs/index.js +0 -1
  83. data/app/pb_kits/playbook/pb_gauge/gaugeTheme.ts +7 -1
  84. data/app/pb_kits/playbook/pb_line_graph/docs/_description.md +1 -3
  85. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_colors.jsx +36 -17
  86. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_colors_react.md +3 -0
  87. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_default.jsx +31 -16
  88. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_height.jsx +63 -31
  89. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_height.md +3 -0
  90. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend.jsx +35 -16
  91. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_nonclickable.jsx +41 -16
  92. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_position.jsx +107 -62
  93. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_position.md +4 -7
  94. data/app/pb_kits/playbook/pb_line_graph/docs/example.yml +0 -1
  95. data/app/pb_kits/playbook/pb_line_graph/docs/index.js +0 -1
  96. data/app/pb_kits/playbook/pb_line_graph/lineGraphTheme.ts +16 -1
  97. data/app/pb_kits/playbook/pb_multi_level_select/_helper_functions.tsx +18 -9
  98. data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +3 -1
  99. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_show_checked_children.html.erb +75 -0
  100. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_show_checked_children.jsx +94 -0
  101. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_show_checked_children.md +3 -0
  102. data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +1 -1
  103. data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.rb +3 -0
  104. data/app/pb_kits/playbook/pb_pagination/_pagination.tsx +4 -0
  105. data/app/pb_kits/playbook/pb_pagination/docs/_pagination_default_rails.md +3 -1
  106. data/app/pb_kits/playbook/pb_pagination/docs/_pagination_default_react.md +3 -1
  107. data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +14 -1
  108. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_strict_mode.html.erb +10 -0
  109. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_strict_mode.jsx +26 -0
  110. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_strict_mode.md +3 -0
  111. data/app/pb_kits/playbook/pb_phone_number_input/docs/example.yml +2 -0
  112. data/app/pb_kits/playbook/pb_phone_number_input/docs/index.js +1 -0
  113. data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.rb +3 -0
  114. data/app/pb_kits/playbook/pb_select/select.rb +4 -2
  115. data/app/pb_kits/playbook/pb_table/docs/_table_with_selectable_rows.html.erb +1 -0
  116. data/app/pb_kits/playbook/pb_table/styles/_vertical_border.scss +49 -1
  117. data/dist/chunks/_line_graph-qk_BN_J0.js +1 -0
  118. data/dist/chunks/_typeahead-ZLTFtAoW.js +6 -0
  119. data/dist/chunks/_weekday_stacked-svceGyvR.js +37 -0
  120. data/dist/chunks/lib-CY5ZPzic.js +29 -0
  121. data/dist/chunks/{pb_form_validation-BUOKwfvW.js → pb_form_validation-D3b0JKHH.js} +1 -1
  122. data/dist/chunks/vendor.js +1 -1
  123. data/dist/menu.yml +3 -10
  124. data/dist/playbook-doc.js +2 -2
  125. data/dist/playbook-rails-react-bindings.js +1 -1
  126. data/dist/playbook-rails.js +1 -1
  127. data/dist/playbook.css +1 -1
  128. data/lib/playbook/version.rb +2 -2
  129. metadata +41 -26
  130. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_pb_styles.jsx +0 -30
  131. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_pb_styles.md +0 -1
  132. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_pb_styles.jsx +0 -52
  133. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_pb_styles.md +0 -1
  134. data/app/pb_kits/playbook/pb_walkthrough/_walkthrough.scss +0 -0
  135. data/app/pb_kits/playbook/pb_walkthrough/_walkthrough.tsx +0 -202
  136. data/app/pb_kits/playbook/pb_walkthrough/docs/_walkthrough_continuous.jsx +0 -69
  137. data/app/pb_kits/playbook/pb_walkthrough/docs/_walkthrough_default.jsx +0 -71
  138. data/app/pb_kits/playbook/pb_walkthrough/docs/_walkthrough_multi_beacon.jsx +0 -110
  139. data/app/pb_kits/playbook/pb_walkthrough/docs/_walkthrough_no_beacon.jsx +0 -76
  140. data/app/pb_kits/playbook/pb_walkthrough/docs/_walkthrough_no_overlay.jsx +0 -76
  141. data/app/pb_kits/playbook/pb_walkthrough/docs/_walkthrough_styled.jsx +0 -76
  142. data/app/pb_kits/playbook/pb_walkthrough/docs/example.yml +0 -10
  143. data/app/pb_kits/playbook/pb_walkthrough/docs/index.js +0 -6
  144. data/app/pb_kits/playbook/pb_walkthrough/walkthrough.test.jsx +0 -34
  145. data/dist/chunks/_circle_chart-BZmlhBs2.js +0 -1
  146. data/dist/chunks/_typeahead-B1tu_vWi.js +0 -22
  147. data/dist/chunks/_weekday_stacked-CKk0dR5s.js +0 -45
  148. data/dist/chunks/lib-DYpq0k8j.js +0 -29
  149. /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_row_styling.md → _advanced_table_row_styling_react.md} +0 -0
  150. /data/app/pb_kits/playbook/pb_gauge/docs/{_gauge_colors.md → _gauge_colors_rails.md} +0 -0
  151. /data/app/pb_kits/playbook/pb_gauge/docs/{_gauge_complex.md → _gauge_complex_rails.md} +0 -0
  152. /data/app/pb_kits/playbook/pb_line_graph/docs/{_line_graph_colors.md → _line_graph_colors_rails.md} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 17636f49c533b37605844466854cbd170a390844d455b90b757a6ae48ffe8c1c
4
- data.tar.gz: 72a5846f5a3e42dfb1db8934d1a491293834d678ee7629799e1882fd2ac23468
3
+ metadata.gz: dfe355662ceee50b9d36e1c9d958121f16579b5920c8740e0c6e17e133ea247e
4
+ data.tar.gz: 37e3743a95808414b567574d02b4d0963f999df0e4f076fd1c1d0475c2460468
5
5
  SHA512:
6
- metadata.gz: 2d51bd081da4f939f70d55ac2c8a879554efc0a8f87c09e0d2d1d827808d9851c12c98222d69a38e20800bdb02c6e052c6e291c1c7fc2580556362e7d4faa488
7
- data.tar.gz: 89fc2d2f16f112b23e826b146620648b65bdc4b746659d7a301d22193aee9441bd03602c8185534bcbb9b4853c2a9a31700f8df55cb1a1a9ad6cdc063151a41f
6
+ metadata.gz: eb1eff899d421aa25e19e624ca3f80a0ae1228d847bb74931bfb7d258a28e43c3962d80912345ec749d4b5a13b8ef103179bf0efcf70a425d8b84113fe364a3e
7
+ data.tar.gz: 9eb149ce1435add169b1503d4e7fbdf8b94ff604d96f294256c9ca8cacaee870f391e4abbff79a72b188a77b2520023a3a4063982bcc7a9c5a0425bb90514753
@@ -107,7 +107,6 @@
107
107
  @import 'pb_typeahead/typeahead';
108
108
  @import 'pb_user/user';
109
109
  @import 'pb_user_badge/user_badge';
110
- @import 'pb_walkthrough/walkthrough';
111
110
  @import 'pb_weekday_stacked/weekday_stacked';
112
111
  @import 'pb_empty_state/empty_state';
113
112
  @import 'utilities/mixins';
@@ -20,7 +20,7 @@ interface CustomCellProps {
20
20
  customRenderer?: (row: Row<GenericObject>, value: string | undefined) => React.ReactNode
21
21
  selectableRows?: boolean
22
22
  customStyle?: GenericObject
23
- }
23
+ }
24
24
 
25
25
  export const CustomCell = ({
26
26
  getValue,
@@ -35,7 +35,7 @@ export const CustomCell = ({
35
35
 
36
36
  const handleOnExpand = (row: Row<GenericObject>) => {
37
37
  onRowToggleClick && onRowToggleClick(row);
38
-
38
+
39
39
  if (!expandedControl) {
40
40
  setExpanded({ ...expanded, [row.id]: !row.getIsExpanded() });
41
41
  }
@@ -46,8 +46,8 @@ export const CustomCell = ({
46
46
 
47
47
  return (
48
48
  <div style={{ paddingLeft: `${row.depth * 1.25}em`}}>
49
- <Flex
50
- alignItems="center"
49
+ <Flex
50
+ alignItems="center"
51
51
  columnGap="xs"
52
52
  justify="start"
53
53
  orientation="row"
@@ -71,11 +71,12 @@ export const CustomCell = ({
71
71
  >
72
72
  {row.getIsExpanded() ? (
73
73
  <Icon cursor="pointer"
74
- icon="circle-play-down"
74
+ icon="circle-play"
75
+ rotation={90}
75
76
  />
76
77
  ) : (
77
78
  <Icon cursor="pointer"
78
- icon="circle-play"
79
+ icon="circle-play"
79
80
  />
80
81
  )}
81
82
  </button>
@@ -4,49 +4,48 @@ import { Header } from "@tanstack/react-table"
4
4
  import { GenericObject } from "../../types"
5
5
 
6
6
  import Icon from "../../pb_icon/_icon"
7
- import { getAllIcons } from "../../utilities/icons/allicons"
8
7
 
9
8
  import { displayIcon } from "../Utilities/IconHelpers"
10
9
 
11
10
  type SortIconButtonProps = {
12
11
  header: Header<GenericObject, unknown>
13
12
  sortIcon?: string | string[]
13
+ enableSortingRemoval?: boolean
14
14
  }
15
15
 
16
- export const SortIconButton = ({ header, sortIcon }: SortIconButtonProps) => {
17
-
18
- const firstIcon = displayIcon(sortIcon)[0]
19
- const secondIcon = displayIcon(sortIcon)[1]
20
- const upIcon = getAllIcons()["arrowUpShortWide"].icon as unknown as { [key: string]: SVGElement }
21
- const downIcon = getAllIcons()["arrowDownShortWide"].icon as unknown as { [key: string]: SVGElement }
16
+ export const SortIconButton = ({ header, sortIcon, enableSortingRemoval }: SortIconButtonProps) => {
17
+ const firstIcon = displayIcon(sortIcon)[0]
18
+ const secondIcon = displayIcon(sortIcon)[1]
22
19
 
23
20
  return (
24
21
  <>
25
- {header.column.getIsSorted() === "desc" ? (
26
- <div className="sort-button-icon"
22
+ {header.column.getIsSorted() === "desc" && (
23
+ <div
24
+ className="sort-button-icon"
27
25
  key={firstIcon}
26
+ style={{ paddingLeft: `${header?.index === 0 ? "2px" : "4px"}` }}
28
27
  >
29
- { firstIcon === "arrow-up-short-wide" ? (
30
- <Icon
31
- className="svg-inline--fa"
32
- customIcon={upIcon}
33
- /> ) : (
34
28
  <Icon icon={firstIcon} />
35
- )}
36
29
  </div>
37
- ) : (
38
- <div className="sort-button-icon"
30
+ )}
31
+ {header.column.getIsSorted() === "asc" && (
32
+ <div
33
+ className="sort-button-icon"
39
34
  key={secondIcon}
35
+ style={{ paddingLeft: `${header?.index === 0 ? "2px" : "4px"}` }}
40
36
  >
41
- { secondIcon === "arrow-down-short-wide" ? (
42
- <Icon
43
- className="svg-inline--fa"
44
- customIcon={downIcon}
45
- /> ) : (
46
37
  <Icon icon={secondIcon} />
47
- )}
38
+ </div>
39
+ )}
40
+ {header.column.getIsSorted() === false && (
41
+ <div
42
+ className="sort-button-icon"
43
+ key={enableSortingRemoval ? "arrow-up-arrow-down" : secondIcon}
44
+ style={{ paddingLeft: `${header?.index === 0 ? "2px" : "4px"}` }}
45
+ >
46
+ <Icon icon={enableSortingRemoval ? "arrow-up-arrow-down" : secondIcon} />
48
47
  </div>
49
48
  )}
50
49
  </>
51
- )
52
- }
50
+ );
51
+ };
@@ -112,7 +112,7 @@ const TableActionBar: React.FC<TableActionBarProps> = ({
112
112
  paddingBottom="xs"
113
113
  text={node.label}
114
114
  />
115
- <Flex flexDirection="column"
115
+ <Flex flexDirection="column"
116
116
  paddingLeft="lg"
117
117
  >
118
118
  {node?.children?.map((child) =>
@@ -141,8 +141,8 @@ const TableActionBar: React.FC<TableActionBarProps> = ({
141
141
  setShowPopover(!shouldClose)
142
142
 
143
143
  const popoverReference = (
144
- <Tooltip
145
- placement="top"
144
+ <Tooltip
145
+ placement="top"
146
146
  text="Column Configuration"
147
147
  >
148
148
  <div onClick={togglePopover}>
@@ -170,8 +170,8 @@ const TableActionBar: React.FC<TableActionBarProps> = ({
170
170
  >
171
171
  {type === "row-selection" ? (
172
172
  <>
173
- <Caption color="light"
174
- paddingLeft="xs"
173
+ <Caption color="light"
174
+ paddingLeft="xs"
175
175
  size="xs"
176
176
  >
177
177
  {selectedCount} Selected
@@ -188,15 +188,15 @@ const TableActionBar: React.FC<TableActionBarProps> = ({
188
188
  zIndex={3}
189
189
  >
190
190
  <>
191
- <Caption
192
- paddingY="sm"
191
+ <Caption
192
+ paddingY="sm"
193
193
  text="Columns Config"
194
- textAlign="center"
194
+ textAlign="center"
195
195
  />
196
196
  <SectionSeparator paddingBottom="xs" />
197
197
  {tree.map((node: VisibilityNode) => (
198
- <Flex cursor="pointer"
199
- flexDirection="column"
198
+ <Flex cursor="pointer"
199
+ flexDirection="column"
200
200
  key={node.id}
201
201
  paddingX="xs"
202
202
  >
@@ -50,6 +50,7 @@ export const TableHeaderCell = ({
50
50
  expanded,
51
51
  setExpanded,
52
52
  expandByDepth,
53
+ enableSortingRemoval,
53
54
  onExpandByDepthClick,
54
55
  toggleExpansionIcon,
55
56
  sortControl,
@@ -64,6 +65,7 @@ export const TableHeaderCell = ({
64
65
 
65
66
  type justifyTypes = "none" | "center" | "start" | "end" | "between" | "around" | "evenly"
66
67
 
68
+
67
69
  const toggleSortButton = (event: React.SyntheticEvent) => {
68
70
  if (sortControl) {
69
71
  const sortIsDesc = header?.column.getIsSorted() === "desc"
@@ -101,7 +103,6 @@ export const TableHeaderCell = ({
101
103
  if (!header) return false;
102
104
 
103
105
  if (header.colSpan > 1 && header.column.parent !== undefined) return true;
104
-
105
106
  const parent = header.column.parent;
106
107
 
107
108
  if (!parent) {
@@ -111,7 +112,8 @@ export const TableHeaderCell = ({
111
112
  const visibleSiblings = parent.columns.filter(columnHasVisibleLeaf);
112
113
  return visibleSiblings.at(-1) === header.column;
113
114
  })();
114
-
115
+
116
+
115
117
  const cellClassName = classnames(
116
118
  "table-header-cells",
117
119
  `${showActionsBar && isActionBarVisible && "header-cells-with-actions"}`,
@@ -257,12 +259,9 @@ const isToggleExpansionEnabled =
257
259
  )}
258
260
 
259
261
  <Flex
260
- className={`${header?.index === 0 &&
261
- enableSorting &&
262
- "header-sort-button pb_th_link"}`}
263
- cursor={header?.index === 0 && enableSorting ? "pointer" : "default"}
264
- {...(header?.index === 0 &&
265
- enableSorting && {
262
+ className={`${header?.index === 0 && enableSorting && "header-sort-button pb_th_link"} ${header?.index !== 0 && header?.column.getCanSort() && "header-sort-secondary-columns"}`}
263
+ cursor={((header?.index !== 0 && header?.column.getCanSort()) || (header?.index === 0 && enableSorting) ? "pointer" : "default")}
264
+ {...(((header?.index !== 0 && header?.column.getCanSort()) || (header?.index === 0 && enableSorting)) && {
266
265
  htmlOptions: {
267
266
  onClick: (event: React.MouseEvent) => toggleSortButton(event),
268
267
  onKeyDown: (event: React.KeyboardEvent) => {
@@ -280,13 +279,13 @@ const isToggleExpansionEnabled =
280
279
  {flexRender(header?.column.columnDef.header, header?.getContext())}
281
280
  </div>
282
281
 
283
- {header?.index === 0 &&
284
- header.column.getCanSort() &&
285
- enableSorting &&
282
+ {((header?.index !== 0 && header?.column.getCanSort()) || (header?.index === 0 && enableSorting)) &&
286
283
  (loading ? (
287
284
  <div className="loading-toggle-icon" />
288
285
  ) : (
289
- <SortIconButton header={header}
286
+ <SortIconButton
287
+ enableSortingRemoval={enableSortingRemoval}
288
+ header={header}
290
289
  sortIcon={sortIcon}
291
290
  />
292
291
  ))}
@@ -16,8 +16,10 @@ import { createCellFunction } from "../Utilities/CellRendererUtils";
16
16
  interface UseTableStateProps {
17
17
  tableData: GenericObject[];
18
18
  columnDefinitions: GenericObject[];
19
+ enableSortingRemoval?: boolean;
19
20
  expandedControl?: GenericObject;
20
21
  sortControl?: GenericObject;
22
+ firstColumnSort?: boolean;
21
23
  onRowToggleClick?: (arg: Row<GenericObject>) => void;
22
24
  selectableRows?: boolean;
23
25
  initialLoadingRowsCount?: number;
@@ -38,6 +40,7 @@ interface UseTableStateProps {
38
40
  export function useTableState({
39
41
  tableData,
40
42
  columnDefinitions,
43
+ enableSortingRemoval,
41
44
  expandedControl,
42
45
  sortControl,
43
46
  onRowToggleClick,
@@ -83,19 +86,19 @@ export function useTableState({
83
86
  const buildColumns = useCallback((columnDefinitions: GenericObject[], isRoot = true): any[] => {
84
87
  return columnDefinitions?.map((column, index) => {
85
88
  const isFirstColumn = isRoot && index === 0;
86
-
87
89
  // Handle grouped columns
88
90
  if (column.columns && column.columns.length > 0) {
89
91
  return {
90
- header: column.header || column.label || "",
92
+ header: column.header ?? column.label ?? "",
93
+ id: column.id ?? column.label ?? `group-${index}`,
91
94
  columns: buildColumns(column.columns, false),
92
95
  };
93
96
  }
94
-
95
97
  // Define the base column structure
96
98
  const columnStructure = {
97
99
  ...columnHelper.accessor(column.accessor, {
98
100
  header: column.header ?? column.label ?? "",
101
+ enableSorting: isFirstColumn || column.enableSort === true,
99
102
  }),
100
103
  };
101
104
 
@@ -166,7 +169,7 @@ export function useTableState({
166
169
  getCoreRowModel: getCoreRowModel(),
167
170
  getExpandedRowModel: getExpandedRowModel(),
168
171
  getSortedRowModel: getSortedRowModel(),
169
- enableSortingRemoval: false,
172
+ enableSortingRemoval: enableSortingRemoval,
170
173
  sortDescFirst: true,
171
174
  onRowSelectionChange: setRowSelection,
172
175
  onRowPinningChange,
@@ -28,7 +28,7 @@ export const TableHeader = ({
28
28
  dark = false,
29
29
  enableSorting = false,
30
30
  id,
31
- sortIcon = ["arrow-up-short-wide", "arrow-down-short-wide"],
31
+ sortIcon = ["arrow-up-wide-short", "arrow-down-short-wide"],
32
32
  ...props
33
33
  }: TableHeaderProps) => {
34
34
  const {
@@ -124,13 +124,65 @@
124
124
  -ms-overflow-style: none !important;
125
125
  scrollbar-width: none !important;
126
126
  }
127
-
127
+
128
+ // When action bar is hidden, ensure proper border radius for header corners
129
+ &.hidden-action-bar {
130
+ .pb_advanced_table_header {
131
+ > tr:first-child {
132
+ th:first-child {
133
+ border-top-left-radius: 4px !important;
134
+ }
135
+ th:last-child {
136
+ border-top-right-radius: 4px !important;
137
+ }
138
+ }
139
+ }
140
+
141
+ // Also handle the case when there are multiple header rows
142
+ .pb_advanced_table_header {
143
+ > tr:first-child {
144
+ th:first-child,
145
+ .table-header-cells:first-child,
146
+ .table-header-cells-custom:first-child {
147
+ border-top-left-radius: 4px !important;
148
+ }
149
+ th:last-child,
150
+ .table-header-cells:last-child,
151
+ .table-header-cells-custom:last-child {
152
+ border-top-right-radius: 4px !important;
153
+ }
154
+ }
155
+ }
156
+ }
157
+
158
+ // When action bar is shown, remove border radius from header
159
+ .row-selection-actions-card.is-visible ~ * .pb_advanced_table_header,
160
+ .row-selection-actions-card.show-action-card ~ * .pb_advanced_table_header {
161
+ > tr:first-child {
162
+ th:first-child,
163
+ th:last-child,
164
+ .table-header-cells:first-child,
165
+ .table-header-cells:last-child,
166
+ .table-header-cells-custom:first-child,
167
+ .table-header-cells-custom:last-child {
168
+ border-top-left-radius: 0 !important;
169
+ border-top-right-radius: 0 !important;
170
+ }
171
+ }
172
+ }
173
+
128
174
 
129
175
  .row-selection-actions-card {
130
176
  border-bottom-right-radius: 0px !important;
131
177
  border-bottom-left-radius: 0px !important;
132
178
  border-bottom-color: transparent;
133
179
  transition: height 300ms ease;
180
+
181
+ &.is-visible,
182
+ &.show-action-card {
183
+ border-top-left-radius: 4px !important;
184
+ border-top-right-radius: 4px !important;
185
+ }
134
186
  }
135
187
  .table-header-cells:first-child {
136
188
  min-width: 180px;
@@ -370,6 +422,15 @@
370
422
  padding: 2px;
371
423
  }
372
424
 
425
+ .header-sort-secondary-columns {
426
+ color: $primary !important;
427
+
428
+ &:hover {
429
+ background-color: rgba($primary, 0.03);
430
+ border-radius: $border_radius_md;
431
+ }
432
+ }
433
+
373
434
  .toggle-all-icon {
374
435
  @extend .button-icon;
375
436
  @extend %primary-color-pseudo;
@@ -910,9 +971,58 @@
910
971
  }
911
972
  }
912
973
  }
974
+
975
+ // Firefox-specific fix for last-header-cell and last-cell vertical borders
976
+ @-moz-document url-prefix() {
977
+ .pb_advanced_table_header {
978
+ .last-header-cell {
979
+ border-right: none !important;
980
+ box-shadow: 1px 0 0 0 $border_light !important;
981
+ }
982
+ }
983
+
984
+ .pb_advanced_table_body {
985
+ .last-cell {
986
+ border-right: none !important;
987
+ box-shadow: 1px 0 0 0 $border_light !important;
988
+ }
989
+ }
990
+
991
+ // Dark mode Firefox fixes
992
+ &.dark {
993
+ .pb_advanced_table_header {
994
+ .last-header-cell {
995
+ border-right: none !important;
996
+ box-shadow: 1px 0 0 0 $border_dark !important;
997
+ }
998
+ }
999
+
1000
+ .pb_advanced_table_body {
1001
+ .last-cell {
1002
+ border-right: none !important;
1003
+ box-shadow: 1px 0 0 0 $border_dark !important;
1004
+ }
1005
+ }
1006
+ }
1007
+ }
913
1008
  }
914
1009
 
915
1010
  // Outside of the pb_advanced_table class for popover
916
1011
  .pb-advanced-table-popover-option:hover {
917
1012
  background-color: $bg_light;
918
- }
1013
+ }
1014
+ // Removes borders when Wrapped inside the Card Kit
1015
+ [class^=pb_card_kit] > .pb_advanced_table .pb_advanced_table_body .last-cell,
1016
+ [class^=pb_card_kit] > .pb_advanced_table .pb_advanced_table_header .last-header-cell,
1017
+ [class^=pb_card_kit] > .pb_advanced_table .pb_advanced_table_body tr td:last-child,
1018
+ [class^=pb_card_kit] > .pb_advanced_table .pb_advanced_table_header tr th:last-child {
1019
+ border-right: none !important;
1020
+ }
1021
+
1022
+ // Removes borders when Wrapped inside the Card Kit
1023
+ [class^=pb_card_kit] > .pb_advanced_table tr:last-child,
1024
+ [class^=pb_card_kit] > .pb_advanced_table .last-row-cell {
1025
+ td {
1026
+ border-bottom: none !important;
1027
+ }
1028
+ }
@@ -40,6 +40,7 @@ type AdvancedTableProps = {
40
40
  dark?: boolean
41
41
  data?: { [key: string]: string }
42
42
  enableToggleExpansion?: "all" | "header" | "none"
43
+ enableSortingRemoval?: boolean
43
44
  expandedControl?: GenericObject
44
45
  expandByDepth?: { [key: string]: string | number }
45
46
  onExpandByDepthClick?: (arg: number, arg1: any) => void
@@ -87,6 +88,7 @@ const AdvancedTable = (props: AdvancedTableProps) => {
87
88
  dark = false,
88
89
  data = {},
89
90
  enableToggleExpansion = "header",
91
+ enableSortingRemoval = false,
90
92
  expandedControl,
91
93
  expandByDepth,
92
94
  onExpandByDepthClick,
@@ -122,7 +124,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
122
124
  // Component refs
123
125
  const tableWrapperRef = useRef<HTMLDivElement>(null);
124
126
 
125
- // Initialize table state
126
127
  const {
127
128
  table,
128
129
  expanded,
@@ -137,6 +138,7 @@ const AdvancedTable = (props: AdvancedTableProps) => {
137
138
  } = useTableState({
138
139
  tableData,
139
140
  columnDefinitions,
141
+ enableSortingRemoval,
140
142
  expandedControl,
141
143
  sortControl,
142
144
  onRowToggleClick,
@@ -218,10 +220,10 @@ const AdvancedTable = (props: AdvancedTableProps) => {
218
220
  )
219
221
 
220
222
  return (
221
- <Card
223
+ <Card
222
224
  borderNone
223
225
  borderRadius="none"
224
- className="advanced-table-fullscreen-header"
226
+ className="advanced-table-fullscreen-header"
225
227
  {...props}
226
228
  >
227
229
  <Flex justify="end">
@@ -250,6 +252,10 @@ const AdvancedTable = (props: AdvancedTableProps) => {
250
252
  const ariaProps = buildAriaProps(aria);
251
253
  const dataProps = buildDataProps(data);
252
254
  const htmlProps = buildHtmlProps(htmlOptions);
255
+
256
+ // Visibility flag for action bar
257
+ const isActionBarVisible = (selectableRows && showActionsBar && selectedRowsLength > 0) || columnVisibilityControl;
258
+
253
259
  const classes = classnames(
254
260
  buildCss("pb_advanced_table"),
255
261
  `advanced-table-responsive-${responsive}`,
@@ -257,6 +263,8 @@ const AdvancedTable = (props: AdvancedTableProps) => {
257
263
  {
258
264
  'advanced-table-fullscreen': isFullscreen,
259
265
  'advanced-table-allow-fullscreen': allowFullScreen,
266
+ // Add the hidden-action-bar class when action bar functionality exists but is not visible
267
+ 'hidden-action-bar': (selectableRows || columnVisibilityControl) && !isActionBarVisible,
260
268
  },
261
269
  {'advanced-table-sticky-left-columns': stickyLeftColumn && stickyLeftColumn.length > 0},
262
270
  columnGroupBorderColor ? `column-group-border-${columnGroupBorderColor}` : '',
@@ -270,9 +278,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
270
278
  ? getVirtualizedContainerStyles(maxHeight)
271
279
  : {};
272
280
 
273
- // Visibility flag for action bar
274
- const isActionBarVisible = (selectableRows && showActionsBar && selectedRowsLength > 0) || columnVisibilityControl;
275
-
276
281
  // The actual Main <Table /> element
277
282
  const tableElement = (
278
283
  <Table
@@ -288,7 +293,7 @@ const AdvancedTable = (props: AdvancedTableProps) => {
288
293
  ) : (
289
294
  <>
290
295
  <TableHeader />
291
- <TableBody
296
+ <TableBody
292
297
  isFetching={isFetching}
293
298
  />
294
299
  </>
@@ -330,6 +335,7 @@ const AdvancedTable = (props: AdvancedTableProps) => {
330
335
  columnGroupBorderColor={columnGroupBorderColor}
331
336
  columnVisibilityControl={columnVisibilityControl}
332
337
  customSort={customSort}
338
+ enableSortingRemoval={enableSortingRemoval}
333
339
  enableToggleExpansion={enableToggleExpansion}
334
340
  enableVirtualization={virtualizedRows}
335
341
  expandByDepth={expandByDepth}
@@ -11,8 +11,8 @@
11
11
  <% if content.present? %>
12
12
  <% content.presence %>
13
13
  <% else %>
14
- <%= pb_rails("advanced_table/table_header", props: { column_definitions: object.column_definitions, enable_toggle_expansion: object.enable_toggle_expansion, responsive: object.responsive, loading: object.loading, selectable_rows: object.selectable_rows, show_actions_bar: object.show_actions_bar }) %>
15
- <%= pb_rails("advanced_table/table_body", props: { id: object.id, table_data: object.table_data, column_definitions: object.column_definitions, responsive: object.responsive, loading: object.loading, selectable_rows: object.selectable_rows, enable_toggle_expansion: object.enable_toggle_expansion }) %>
14
+ <%= pb_rails("advanced_table/table_header", props: { id: object.id, column_definitions: object.column_definitions, enable_toggle_expansion: object.enable_toggle_expansion, responsive: object.responsive, loading: object.loading, selectable_rows: object.selectable_rows, show_actions_bar: object.show_actions_bar }) %>
15
+ <%= pb_rails("advanced_table/table_body", props: { id: object.id, table_data: object.table_data, column_definitions: object.column_definitions, responsive: object.responsive, loading: object.loading, selectable_rows: object.selectable_rows, enable_toggle_expansion: object.enable_toggle_expansion, row_styling: object.row_styling }) %>
16
16
  <% end %>
17
17
  <% end %>
18
18
  <% end %>
@@ -31,9 +31,16 @@ module Playbook
31
31
  default: []
32
32
  prop :scroll_bar_none, type: Playbook::Props::Boolean,
33
33
  default: false
34
+ prop :row_styling, type: Playbook::Props::Array,
35
+ default: []
34
36
 
35
37
  def classname
36
- additional_classes = [responsive_classname, max_height_classname, hide_scroll_bar_class]
38
+ additional_classes = [
39
+ responsive_classname,
40
+ max_height_classname,
41
+ hide_scroll_bar_class,
42
+ hidden_action_bar_class,
43
+ ]
37
44
  additional_classes << "column-group-border-#{column_group_border_color}" if column_group_border_color != "none"
38
45
  generate_classname("pb_advanced_table", *additional_classes, separator: " ")
39
46
  end
@@ -47,7 +54,12 @@ module Playbook
47
54
  end
48
55
 
49
56
  def hide_scroll_bar_class
50
- scroll_bar_none ? "advanced-table-hide-scrollbar " : ""
57
+ scroll_bar_none ? "advanced-table-hide-scrollbar" : ""
58
+ end
59
+
60
+ def hidden_action_bar_class
61
+ # Add hidden-action-bar class when action bar functionality is enabled but not currently visible
62
+ selectable_rows && !is_action_bar_visible ? "hidden-action-bar" : ""
51
63
  end
52
64
 
53
65
  def selected_rows
@@ -124,6 +124,23 @@ const columnDefinitions = [
124
124
  },
125
125
  ]
126
126
 
127
+ const columnDefinitionsSort = [
128
+ {
129
+ accessor: "year",
130
+ label: "Year",
131
+ cellAccessors: ["quarter", "month", "day"],
132
+ },
133
+ {
134
+ accessor: "newEnrollments",
135
+ label: "New Enrollments",
136
+ enableSort: true,
137
+ },
138
+ {
139
+ accessor: "scheduledMeetings",
140
+ label: "Scheduled Meetings",
141
+ },
142
+ ];
143
+
127
144
  const columnDefinitionsCustomRenderer = [
128
145
  {
129
146
  accessor: "year",
@@ -676,3 +693,20 @@ test("rowStyling prop works as expected", () => {
676
693
  const row1 = tableBody.querySelector('tr:nth-child(1)')
677
694
  expect(row1).toHaveStyle({backgroundColor: colors.white, color: colors.black})
678
695
  })
696
+
697
+ test("Sort icon renders with enableSort on individual columns", () => {
698
+ render(
699
+ <AdvancedTable
700
+ columnDefinitions={columnDefinitionsSort}
701
+ data={{ testid: testId }}
702
+ tableData={MOCK_DATA}
703
+ />
704
+ );
705
+
706
+ const kit = screen.getByTestId(testId);
707
+ const sortIcon = kit.querySelector(".sort-button-icon");
708
+ expect(sortIcon).toBeInTheDocument();
709
+ const sortButton = kit.querySelector(".header-sort-secondary-columns");
710
+ expect(sortButton).toBeInTheDocument();
711
+ });
712
+
@@ -1,4 +1,7 @@
1
1
  function showActionBar(actionBar, selectedCount) {
2
+ // Get container
3
+ const tableContainer = actionBar.closest('.pb_advanced_table');
4
+
2
5
  // Show action bar directly
3
6
  actionBar.style.height = "auto";
4
7
  actionBar.style.overflow = "visible";
@@ -8,6 +11,11 @@ function showActionBar(actionBar, selectedCount) {
8
11
  actionBar.classList.remove("p_none");
9
12
  actionBar.classList.add("p_xs", "is-visible", "show-action-card");
10
13
 
14
+ // Remove hidden-action-bar class when action bar is shown
15
+ if (tableContainer) {
16
+ tableContainer.classList.remove("hidden-action-bar");
17
+ }
18
+
11
19
  // Update the count
12
20
  const countElement = actionBar.querySelector(".selected-count");
13
21
  if (countElement) {
@@ -16,12 +24,20 @@ function showActionBar(actionBar, selectedCount) {
16
24
  }
17
25
 
18
26
  function hideActionBar(actionBar) {
27
+ // Get container
28
+ const tableContainer = actionBar.closest('.pb_advanced_table');
29
+
19
30
  // Hide action bar directly
20
31
  actionBar.style.height = "0px";
21
32
  actionBar.style.overflow = "hidden";
22
33
  actionBar.style.opacity = "0";
23
34
  actionBar.classList.add("p_none");
24
35
  actionBar.classList.remove("p_xs", "is-visible", "show-action-card");
36
+
37
+ // Add hidden-action-bar class when action bar is hidden
38
+ if (tableContainer) {
39
+ tableContainer.classList.add("hidden-action-bar");
40
+ }
25
41
  }
26
42
 
27
43
  export function updateSelectionActionBar(table, selectedCount) {