playbook_ui 14.11.1.pre.alpha.PBNTR440enableglobalpropspbformwith5624 → 14.11.1.pre.alpha.PBNTR573datepickerinvestigation5355

Sign up to get free protection for your applications and to get access to all the features.
Files changed (140) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +0 -2
  3. data/app/pb_kits/playbook/pb_advanced_table/Components/CustomCell.tsx +2 -18
  4. data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +5 -27
  5. data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableBody.tsx +2 -17
  6. data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableHeader.tsx +1 -23
  7. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +0 -29
  8. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +4 -61
  9. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination.jsx +0 -1
  10. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.jsx +0 -1
  11. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_control.md +2 -2
  12. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -5
  13. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +1 -6
  14. data/app/pb_kits/playbook/pb_button/button.html.erb +3 -2
  15. data/app/pb_kits/playbook/pb_checkbox/checkbox.html.erb +6 -1
  16. data/app/pb_kits/playbook/pb_collapsible/collapsible.html.erb +1 -3
  17. data/app/pb_kits/playbook/pb_collapsible/collapsible.rb +0 -3
  18. data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +26 -23
  19. data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +2 -2
  20. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default.html.erb +12 -1
  21. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default_date.md +1 -1
  22. data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +0 -1
  23. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_list_rails.html.erb +9 -3
  24. data/app/pb_kits/playbook/pb_draggable/docs/example.yml +0 -1
  25. data/app/pb_kits/playbook/pb_drawer/_drawer.scss +183 -145
  26. data/app/pb_kits/playbook/pb_drawer/_drawer.tsx +268 -158
  27. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_borders.jsx +45 -3
  28. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.jsx +1 -0
  29. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_default.jsx +16 -9
  30. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.jsx +19 -44
  31. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.md +3 -21
  32. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx +21 -16
  33. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_sizes.jsx +19 -2
  34. data/app/pb_kits/playbook/pb_drawer/docs/example.yml +1 -2
  35. data/app/pb_kits/playbook/pb_drawer/docs/index.js +0 -1
  36. data/app/pb_kits/playbook/pb_drawer/drawer.test.jsx +5 -5
  37. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subtle_variant.md +1 -1
  38. data/app/pb_kits/playbook/pb_dropdown/dropdown.html.erb +12 -7
  39. data/app/pb_kits/playbook/pb_dropdown/dropdown_container.html.erb +14 -9
  40. data/app/pb_kits/playbook/pb_dropdown/dropdown_option.html.erb +11 -6
  41. data/app/pb_kits/playbook/pb_dropdown/dropdown_trigger.html.erb +14 -8
  42. data/app/pb_kits/playbook/pb_list/item.html.erb +8 -30
  43. data/app/pb_kits/playbook/pb_list/item.rb +0 -7
  44. data/app/pb_kits/playbook/pb_list/list.html.erb +11 -31
  45. data/app/pb_kits/playbook/pb_list/list.rb +0 -4
  46. data/app/pb_kits/playbook/pb_loading_inline/_loading_inline.tsx +1 -6
  47. data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.scss +0 -4
  48. data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.tsx +0 -1
  49. data/app/pb_kits/playbook/pb_multiple_users/multiple_users.html.erb +1 -1
  50. data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +12 -30
  51. data/app/pb_kits/playbook/pb_phone_number_input/docs/example.yml +1 -3
  52. data/app/pb_kits/playbook/pb_phone_number_input/docs/index.js +0 -1
  53. data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.rb +0 -3
  54. data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.test.js +1 -20
  55. data/app/pb_kits/playbook/pb_radio/_radio.scss +8 -12
  56. data/app/pb_kits/playbook/pb_radio/docs/_radio_custom_children.jsx +3 -8
  57. data/app/pb_kits/playbook/pb_select/_select.scss +5 -3
  58. data/app/pb_kits/playbook/pb_select/_select.tsx +1 -5
  59. data/app/pb_kits/playbook/pb_select/select.html.erb +2 -2
  60. data/app/pb_kits/playbook/pb_selectable_icon/_selectable_icon.tsx +1 -9
  61. data/app/pb_kits/playbook/pb_selectable_icon/docs/_selectable_icon_default.jsx +1 -4
  62. data/app/pb_kits/playbook/pb_selectable_icon/docs/_selectable_icon_single_select.jsx +1 -4
  63. data/app/pb_kits/playbook/pb_selectable_list/selectable_list.html.erb +3 -17
  64. data/app/pb_kits/playbook/pb_selectable_list/selectable_list.rb +0 -3
  65. data/app/pb_kits/playbook/pb_selectable_list/selectable_list_item.html.erb +4 -11
  66. data/app/pb_kits/playbook/pb_selectable_list/selectable_list_item.rb +0 -3
  67. data/app/pb_kits/playbook/pb_table/_table.tsx +3 -2
  68. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns_rails.md +2 -2
  69. data/app/pb_kits/playbook/pb_table/docs/example.yml +0 -3
  70. data/app/pb_kits/playbook/pb_table/index.ts +88 -187
  71. data/app/pb_kits/playbook/pb_table/styles/_collapsible.scss +0 -12
  72. data/app/pb_kits/playbook/pb_table/styles/_scroll.scss +5 -6
  73. data/app/pb_kits/playbook/pb_table/table.html.erb +1 -1
  74. data/app/pb_kits/playbook/pb_table/table.rb +2 -17
  75. data/app/pb_kits/playbook/pb_table/table_row.html.erb +1 -20
  76. data/app/pb_kits/playbook/pb_table/table_row.rb +0 -5
  77. data/app/pb_kits/playbook/pb_text_input/docs/example.yml +1 -2
  78. data/app/pb_kits/playbook/pb_text_input/text_input.html.erb +0 -4
  79. data/app/pb_kits/playbook/pb_text_input/text_input.rb +3 -33
  80. data/app/pb_kits/playbook/pb_timeline/_timeline.scss +30 -30
  81. data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +0 -2
  82. data/app/pb_kits/playbook/pb_typeahead/docs/index.js +0 -1
  83. data/dist/chunks/_typeahead-BNULwihE.js +36 -0
  84. data/dist/chunks/_weekday_stacked-BKWemDAe.js +45 -0
  85. data/dist/chunks/{lib-kMuhBuU7.js → lib-B7sgJtGS.js} +2 -2
  86. data/dist/chunks/{pb_form_validation-DBJ0wZuS.js → pb_form_validation-C5Cc0-1v.js} +1 -1
  87. data/dist/chunks/vendor.js +1 -1
  88. data/dist/menu.yml +0 -6
  89. data/dist/playbook-doc.js +1 -1
  90. data/dist/playbook-rails-react-bindings.js +1 -1
  91. data/dist/playbook-rails.js +1 -1
  92. data/dist/playbook.css +1 -1
  93. data/lib/playbook/pb_forms_helper.rb +4 -13
  94. data/lib/playbook/version.rb +1 -1
  95. metadata +7 -63
  96. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_no_subrows.jsx +0 -50
  97. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows.jsx +0 -60
  98. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows.md +0 -5
  99. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions.jsx +0 -78
  100. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions.md +0 -1
  101. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_header.jsx +0 -53
  102. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_header.md +0 -1
  103. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows.jsx +0 -52
  104. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows.md +0 -1
  105. data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_mock_data_no_subrows.json +0 -42
  106. data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_mock_data_with_id.json +0 -299
  107. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_turbo_frames.html.erb +0 -13
  108. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_turbo_frames_rails.md +0 -3
  109. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_list_rails.md +0 -5
  110. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_selectable_list_rails.html.erb +0 -38
  111. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_selectable_list_rails.md +0 -3
  112. data/app/pb_kits/playbook/pb_drawer/context.ts +0 -11
  113. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_behavior.jsx +0 -38
  114. data/app/pb_kits/playbook/pb_drawer/hooks/useBreakpoint.tsx +0 -60
  115. data/app/pb_kits/playbook/pb_drawer/hooks/useDrawerAnimation.tsx +0 -21
  116. data/app/pb_kits/playbook/pb_icon_button/_icon_button.scss +0 -78
  117. data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_default.html.erb +0 -3
  118. data/app/pb_kits/playbook/pb_icon_button/docs/example.yml +0 -7
  119. data/app/pb_kits/playbook/pb_icon_button/icon_button.html.erb +0 -16
  120. data/app/pb_kits/playbook/pb_icon_button/icon_button.rb +0 -22
  121. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_format.html.erb +0 -15
  122. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_format.jsx +0 -24
  123. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_format.md +0 -1
  124. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns.html.erb +0 -74
  125. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns_rails.md +0 -3
  126. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns.html.erb +0 -74
  127. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns_rails.md +0 -3
  128. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible.html.erb +0 -47
  129. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_rails.md +0 -2
  130. data/app/pb_kits/playbook/pb_table/utilities/addDataTitle.ts +0 -22
  131. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask.html.erb +0 -46
  132. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask_rails.md +0 -3
  133. data/app/pb_kits/playbook/pb_text_input/index.js +0 -103
  134. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.html.erb +0 -19
  135. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.jsx +0 -27
  136. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.md +0 -1
  137. data/dist/chunks/_typeahead-BWwaAo_0.js +0 -36
  138. data/dist/chunks/_weekday_stacked-zyBCd1s8.js +0 -45
  139. data/lib/playbook/pb_forms_global_props_helper.rb +0 -136
  140. /data/app/pb_kits/playbook/pb_table/docs/{_table_with_collapsible_react.md → _table_with_collapsible.md} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f35175e4ed002f1acdb9b596580402ebf1036878d40f7af3b35109eda6f21ae7
4
- data.tar.gz: 006a82eedc5317af6e8e1ea5725238b44020f5107bf98790ada7b1fceb92cb3a
3
+ metadata.gz: 10a0e4cb9340097b9e793ab5a4c3cf062ccb0f33df36fc321495215cbcdf89ce
4
+ data.tar.gz: 63b345af0b4b60033d485c080600f2c57bccc4de2eeb3259f2ce68bf9fe28b79
5
5
  SHA512:
6
- metadata.gz: 60312028c3cb012d7c5371960ad4f3744fb14070ddf5aa90c6c8e9ae92dbd4dfe4729a4999ab000e4ed4c0af55f786a2e12bbac71862df82b1cc5be4fc7fe180
7
- data.tar.gz: 5c30e6228ffa4a1dfbcfb19346d5be9b6e8ef63e01e9ef15466e4124ba11164d092ef0b1872d45590cc9a3c48061a98d4e86232e59bf85e997717f69888ee3f5
6
+ metadata.gz: cafe574e0d494c8a4466dcbf01e2c7502701bf3be1cf19f3419505fa6812b6613eddd2a60d6d092a30c4ca489bf67dc32a75a3c53975d32dbd01375745f634d7
7
+ data.tar.gz: b3a6601c23e7426a97a5c28b9d613c500ce905dc49b381769714419c6ae6478ad78bba36243d489ea666a38b03e7d23c3871cf894b19622cfa4f6b44bffa1224
@@ -1,4 +1,3 @@
1
-
2
1
  @import 'pb_advanced_table/advanced_table';
3
2
  @import 'pb_avatar/avatar';
4
3
  @import 'pb_avatar_action_button/avatar_action_button';
@@ -109,7 +108,6 @@
109
108
  @import 'pb_user_badge/user_badge';
110
109
  @import 'pb_walkthrough/walkthrough';
111
110
  @import 'pb_weekday_stacked/weekday_stacked';
112
- @import 'pb_icon_button/icon_button';
113
111
  @import 'utilities/mixins';
114
112
  @import 'utilities/spacing';
115
113
  @import 'utilities/cursor';
@@ -8,7 +8,6 @@ import { GlobalProps } from "../../utilities/globalProps"
8
8
  import Flex from "../../pb_flex/_flex"
9
9
  import FlexItem from "../../pb_flex/_flex_item"
10
10
  import Icon from "../../pb_icon/_icon"
11
- import Checkbox from "../../pb_checkbox/_checkbox"
12
11
 
13
12
  import AdvancedTableContext from "../Context/AdvancedTableContext"
14
13
 
@@ -18,7 +17,6 @@ interface CustomCellProps {
18
17
  row: Row<GenericObject>
19
18
  value?: string
20
19
  customRenderer?: (row: Row<GenericObject>, value: string | undefined) => React.ReactNode
21
- selectableRows?: boolean
22
20
  }
23
21
 
24
22
  export const CustomCell = ({
@@ -27,9 +25,8 @@ export const CustomCell = ({
27
25
  row,
28
26
  value,
29
27
  customRenderer,
30
- selectableRows,
31
28
  }: CustomCellProps & GlobalProps) => {
32
- const { setExpanded, expanded, expandedControl, inlineRowLoading, hasAnySubRows } = useContext(AdvancedTableContext);
29
+ const { setExpanded, expanded, expandedControl, inlineRowLoading } = useContext(AdvancedTableContext);
33
30
 
34
31
  const handleOnExpand = (row: Row<GenericObject>) => {
35
32
  onRowToggleClick && onRowToggleClick(row);
@@ -44,23 +41,10 @@ export const CustomCell = ({
44
41
 
45
42
  return (
46
43
  <div style={{ paddingLeft: `${row.depth * 1.25}em` }}>
47
- <Flex
48
- alignItems="center"
44
+ <Flex alignItems="center"
49
45
  columnGap="xs"
50
- justify={!hasAnySubRows ? "end" : "start"}
51
46
  orientation="row"
52
47
  >
53
- {
54
- selectableRows && hasAnySubRows && (
55
- <Checkbox
56
- checked={row.getIsSelected()}
57
- disabled={!row.getCanSelect()}
58
- indeterminate={row.getIsSomeSelected()}
59
- name={row.id}
60
- onChange={row.getToggleSelectedHandler()}
61
- />
62
- )
63
- }
64
48
  {renderButton ? (
65
49
  <button
66
50
  className="gray-icon expand-toggle-icon"
@@ -1,13 +1,12 @@
1
1
  import React, { useContext } from "react"
2
2
  import classnames from "classnames"
3
- import { flexRender, Header, Table } from "@tanstack/react-table"
3
+ import { flexRender, Header } from "@tanstack/react-table"
4
4
 
5
5
  import { GenericObject } from "../../types"
6
6
 
7
7
  import { GlobalProps } from "../../utilities/globalProps"
8
8
 
9
9
  import Flex from "../../pb_flex/_flex"
10
- import Checkbox from "../../pb_checkbox/_checkbox"
11
10
 
12
11
  import { SortIconButton } from "./SortIconButton"
13
12
  import { ToggleIconButton } from "./ToggleIconButton"
@@ -25,7 +24,6 @@ type TableHeaderCellProps = {
25
24
  isPinnedLeft?: boolean
26
25
  loading?: boolean
27
26
  sortIcon?: string | string[]
28
- table?: Table<GenericObject>
29
27
  } & GlobalProps
30
28
 
31
29
  export const TableHeaderCell = ({
@@ -37,13 +35,9 @@ export const TableHeaderCell = ({
37
35
  isPinnedLeft = false,
38
36
  loading,
39
37
  sortIcon,
40
- table
41
38
  }: TableHeaderCellProps) => {
42
- const { sortControl, responsive, selectableRows, hasAnySubRows, showActionsBar } =
43
- useContext(AdvancedTableContext);
39
+ const { sortControl, responsive } = useContext(AdvancedTableContext)
44
40
 
45
- type justifyTypes = "none" | "center" | "start" | "end" | "between" | "around" | "evenly"
46
-
47
41
  const toggleSortButton = (event: React.SyntheticEvent) => {
48
42
  if (sortControl) {
49
43
  const sortIsDesc = header?.column.getIsSorted() === "desc"
@@ -65,7 +59,6 @@ export const TableHeaderCell = ({
65
59
 
66
60
  const cellClassName = classnames(
67
61
  "table-header-cells",
68
- `${showActionsBar && "header-cells-with-actions"}`,
69
62
  `${isChrome() ? "chrome-styles" : ""}`,
70
63
  `${enableSorting ? "table-header-cells-active" : ""}`,
71
64
  { "pinned-left": responsive === "scroll" && isPinnedLeft },
@@ -89,14 +82,8 @@ const isToggleExpansionEnabled =
89
82
  (enableToggleExpansion === "all" || "header") &&
90
83
  enableToggleExpansion !== "none"
91
84
 
92
- let justifyHeader:justifyTypes;
85
+ const justifyHeader = isLeafColumn ? "end" : "center"
93
86
 
94
- if (header?.index === 0 && hasAnySubRows) {
95
- justifyHeader = enableSorting ? "between" : "start";
96
- } else {
97
- justifyHeader = isLeafColumn ? "end" : "center";
98
- }
99
-
100
87
  return (
101
88
  <th
102
89
  align="right"
@@ -115,18 +102,9 @@ const isToggleExpansionEnabled =
115
102
  ) : (
116
103
  <Flex
117
104
  alignItems="center"
118
- justify={justifyHeader}
105
+ justify={header?.index === 0 && enableSorting ? "between" : header?.index === 0 && !enableSorting ? "start" : justifyHeader}
119
106
  >
120
- {
121
- selectableRows && header?.index === 0 && hasAnySubRows && (
122
- <Checkbox
123
- checked={table?.getIsAllRowsSelected()}
124
- indeterminate={table?.getIsSomeRowsSelected()}
125
- onChange={table?.getToggleAllRowsSelectedHandler()}
126
- />
127
- )
128
- }
129
- {isToggleExpansionEnabled && hasAnySubRows && (
107
+ {isToggleExpansionEnabled && (
130
108
  <ToggleIconButton onClick={handleExpandOrCollapse} />
131
109
  )}
132
110
 
@@ -9,7 +9,6 @@ import { globalProps } from "../../utilities/globalProps"
9
9
  import { isChrome } from "../Utilities/BrowserCheck"
10
10
 
11
11
  import LoadingInline from "../../pb_loading_inline/_loading_inline"
12
- import Checkbox from "../../pb_checkbox/_checkbox"
13
12
 
14
13
  import { SubRowHeaderRow } from "../Components/SubRowHeaderRow"
15
14
  import { LoadingCell } from "../Components/LoadingCell"
@@ -43,8 +42,6 @@ export const TableBody = ({
43
42
  loading,
44
43
  responsive,
45
44
  table,
46
- selectableRows,
47
- hasAnySubRows
48
45
  } = useContext(AdvancedTableContext)
49
46
 
50
47
  const classes = classnames(
@@ -68,7 +65,7 @@ export const TableBody = ({
68
65
  const numberOfColumns = table.getAllFlatColumns().length
69
66
  const isDataLoading = isExpandable && (inlineRowLoading && rowHasNoChildren) && (row.depth < columnDefinitions[0].cellAccessors?.length)
70
67
  const rowBackground = isExpandable && ((!inlineRowLoading && row.getCanExpand()) || (inlineRowLoading && rowHasNoChildren))
71
- const rowColor = row.getIsSelected() ? "bg-row-selection" : rowBackground ? "bg-silver" : "bg-white"
68
+
72
69
  return (
73
70
  <React.Fragment key={`${row.index}-${row.id}-${row.depth}-row`}>
74
71
  {isFirstChildofSubrow && subRowHeaders && (
@@ -82,23 +79,11 @@ export const TableBody = ({
82
79
  />
83
80
  )}
84
81
  <tr
85
- className={`${rowColor} ${
82
+ className={`${rowBackground ? "bg-silver" : "bg-white"} ${
86
83
  row.depth > 0 ? `depth-sub-row-${row.depth}` : ""
87
84
  }`}
88
85
  id={`${row.index}-${row.id}-${row.depth}-row`}
89
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
87
  {row.getVisibleCells().map((cell, i) => {
103
88
  const isPinnedLeft = columnPinning.left.includes(cell.column.id)
104
89
  const isLastCell = cell.column.parent?.columns.at(-1)?.id === cell.column.id
@@ -7,10 +7,8 @@ import { GenericObject } from "../../types"
7
7
  import { buildCss } from "../../utilities/props"
8
8
  import { globalProps } from "../../utilities/globalProps"
9
9
 
10
- import Checkbox from "../../pb_checkbox/_checkbox"
11
-
12
10
  import { TableHeaderCell } from "../Components/TableHeaderCell"
13
- import { isChrome } from "../Utilities/BrowserCheck"
11
+
14
12
  import AdvancedTableContext from "../Context/AdvancedTableContext"
15
13
 
16
14
  type TableHeaderProps = {
@@ -36,10 +34,6 @@ export const TableHeader = ({
36
34
  handleExpandOrCollapse,
37
35
  loading,
38
36
  table,
39
- hasAnySubRows,
40
- showActionsBar,
41
- selectableRows,
42
- responsive
43
37
  } = useContext(AdvancedTableContext)
44
38
 
45
39
  const classes = classnames(
@@ -50,12 +44,6 @@ export const TableHeader = ({
50
44
 
51
45
  const columnPinning = table.getState().columnPinning;
52
46
 
53
- const customCellClassnames = classnames(
54
- "table-header-cells-custom",
55
- `${showActionsBar && "header-cells-with-actions"}`,
56
- `${isChrome() ? "chrome-styles" : ""}`,
57
- `${responsive === "scroll" && "pinned-left"}`,
58
- );
59
47
  return (
60
48
  <>
61
49
  <thead className={classes}
@@ -64,15 +52,6 @@ export const TableHeader = ({
64
52
  {/* Get the header groups (only one in this example) */}
65
53
  {table.getHeaderGroups().map((headerGroup: HeaderGroup<GenericObject>) => (
66
54
  <tr key={`${headerGroup.id}-headerGroup`}>
67
- {!hasAnySubRows && selectableRows && (
68
- <th className={customCellClassnames}>
69
- <Checkbox
70
- checked={table?.getIsAllRowsSelected()}
71
- indeterminate={table?.getIsSomeRowsSelected()}
72
- onChange={table?.getToggleAllRowsSelectedHandler()}
73
- />
74
- </th>
75
- )}
76
55
  {headerGroup.headers.map(header => {
77
56
  const isPinnedLeft = columnPinning.left.includes(header.id)
78
57
  return (
@@ -86,7 +65,6 @@ export const TableHeader = ({
86
65
  key={`${header.id}-header`}
87
66
  loading={loading}
88
67
  sortIcon={sortIcon}
89
- table={table}
90
68
  />
91
69
  )
92
70
  })}
@@ -23,20 +23,10 @@
23
23
  background-color: $white;
24
24
  }
25
25
 
26
- .bg-row-selection {
27
- background-color: $info_subtle;
28
- }
29
-
30
26
  .full-width {
31
27
  width: 100%;
32
28
  }
33
29
 
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
- }
39
-
40
30
  .table-header-cells:first-child {
41
31
  min-width: 180px;
42
32
  }
@@ -57,16 +47,6 @@
57
47
  th[colspan]:not([colspan="1"]) {
58
48
  border-right: 1px solid $border_light !important;
59
49
  }
60
- .table-header-cells-custom {
61
- text-align:center;
62
- [class^=pb_checkbox_kit] .pb_checkbox_label {
63
- padding-left: 0px;
64
- }
65
- }
66
- .header-cells-with-actions {
67
- border-top-left-radius: 0px !important;
68
- border-top-right-radius: 0px !important;
69
- }
70
50
  }
71
51
 
72
52
  .pb_advanced_table_body {
@@ -79,14 +59,6 @@
79
59
  tr .pb_table_td:last-child {
80
60
  padding-right: 8px !important;
81
61
  }
82
-
83
- .checkbox-cell {
84
- display: flex;
85
- justify-content: center;
86
- [class^=pb_checkbox_kit] .pb_checkbox_label {
87
- padding-left: 0px;
88
- }
89
- }
90
62
  }
91
63
 
92
64
 
@@ -144,7 +116,6 @@
144
116
 
145
117
  // Vertical separator
146
118
  .table-header-cells:first-child,
147
- .table-header-cells-custom:first-child,
148
119
  td:first-child,
149
120
  .pb_table_td:first-child {
150
121
  box-shadow: 1px 0px 0px 0px $border_light !important;
@@ -12,17 +12,12 @@ import {
12
12
  Row,
13
13
  useReactTable,
14
14
  Getter,
15
- RowSelectionState
16
15
  } from "@tanstack/react-table"
17
16
 
18
17
  import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from "../utilities/props"
19
18
  import { globalProps, GlobalProps } from "../utilities/globalProps"
20
19
 
21
20
  import Table from "../pb_table/_table"
22
- import Card from "../pb_card/_card"
23
- import Caption from "../pb_caption/_caption"
24
- import Flex from "../pb_flex/_flex"
25
- import FlexItem from "../pb_flex/_flex_item"
26
21
 
27
22
  import AdvancedTableContext from "./Context/AdvancedTableContext"
28
23
 
@@ -35,7 +30,6 @@ import Pagination from "../pb_pagination/_pagination"
35
30
 
36
31
  type AdvancedTableProps = {
37
32
  aria?: { [key: string]: string }
38
- actions?: React.ReactNode[] | React.ReactNode
39
33
  children?: React.ReactNode | React.ReactNode[]
40
34
  className?: string
41
35
  columnDefinitions: GenericObject[]
@@ -53,20 +47,16 @@ type AdvancedTableProps = {
53
47
  pagination?: boolean,
54
48
  paginationProps?: GenericObject
55
49
  responsive?: "scroll" | "none",
56
- selectableRows?: boolean,
57
- showActionsBar?: boolean,
58
50
  sortControl?: GenericObject
59
51
  tableData: GenericObject[]
60
52
  tableOptions?: GenericObject
61
53
  tableProps?: GenericObject
62
54
  toggleExpansionIcon?: string | string[]
63
- onRowSelectionChange?: (arg: RowSelectionState) => void
64
55
  } & GlobalProps
65
56
 
66
57
  const AdvancedTable = (props: AdvancedTableProps) => {
67
58
  const {
68
59
  aria = {},
69
- actions,
70
60
  children,
71
61
  className,
72
62
  columnDefinitions,
@@ -84,14 +74,11 @@ const AdvancedTable = (props: AdvancedTableProps) => {
84
74
  pagination = false,
85
75
  paginationProps,
86
76
  responsive = "scroll",
87
- showActionsBar = true,
88
- selectableRows,
89
77
  sortControl,
90
78
  tableData,
91
79
  tableOptions,
92
80
  tableProps,
93
81
  toggleExpansionIcon = "arrows-from-line",
94
- onRowSelectionChange,
95
82
  } = props
96
83
 
97
84
  const [loadingStateRowCount, setLoadingStateRowCount] = useState(
@@ -109,9 +96,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
109
96
 
110
97
  const columnHelper = createColumnHelper()
111
98
 
112
- //Row Selection
113
- const [rowSelection, setRowSelection] = useState<RowSelectionState>({})
114
-
115
99
  //Create cells for columns, with customization for first column
116
100
  const createCellFunction = (cellAccessors: string[], customRenderer?: (row: Row<GenericObject>, value: any) => JSX.Element, index?: number) => {
117
101
  const columnCells = ({
@@ -132,7 +116,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
132
116
  getValue={getValue}
133
117
  onRowToggleClick={onRowToggleClick}
134
118
  row={row}
135
- selectableRows={selectableRows}
136
119
  />
137
120
  )
138
121
  }
@@ -145,7 +128,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
145
128
  customRenderer={customRenderer}
146
129
  onRowToggleClick={onRowToggleClick}
147
130
  row={row}
148
- selectableRows={selectableRows}
149
131
  value={accessorValue}
150
132
  />
151
133
  ) : (
@@ -207,13 +189,9 @@ const AdvancedTable = (props: AdvancedTableProps) => {
207
189
  },
208
190
  ]
209
191
 
210
- const customState = () => {
211
- if (sortControl && selectableRows) {
212
- return { state: { expanded, sorting, rowSelection } }
213
- } else if (sortControl) {
192
+ const expandAndSortState = () => {
193
+ if (sortControl) {
214
194
  return { state: { expanded, sorting } }
215
- } else if (selectableRows) {
216
- return { state: { expanded, rowSelection } }
217
195
  } else {
218
196
  return { state: { expanded } }
219
197
  }
@@ -241,24 +219,13 @@ const AdvancedTable = (props: AdvancedTableProps) => {
241
219
  getSortedRowModel: getSortedRowModel(),
242
220
  enableSortingRemoval: false,
243
221
  sortDescFirst: true,
244
- onRowSelectionChange: setRowSelection,
245
- getRowId: selectableRows ? row => row.id : undefined,
246
- ...customState(),
247
- ...paginationInitializer,
222
+ ...expandAndSortState(),
223
+ ... paginationInitializer,
248
224
  ...tableOptions,
249
225
  })
250
226
 
251
227
  const tableRows = table.getRowModel()
252
228
 
253
- const hasAnySubRows = tableRows.rows.some(row => row.subRows && row.subRows.length > 0);
254
- const selectedRowsLength = Object.keys(table.getState().rowSelection).length
255
-
256
- useEffect(() => {
257
- if (onRowSelectionChange) {
258
- onRowSelectionChange(table.getState().rowSelection)
259
- }
260
- } , [table.getState().rowSelection, onRowSelectionChange])
261
-
262
229
  // Set table row count for loading state
263
230
  const updateLoadingStateRowCount = useCallback(() => {
264
231
  const rowsCount = table.getRowModel().rows.length
@@ -317,9 +284,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
317
284
  sortControl,
318
285
  table,
319
286
  toggleExpansionIcon,
320
- showActionsBar,
321
- selectableRows,
322
- hasAnySubRows
323
287
  }}
324
288
  >
325
289
  <>
@@ -333,27 +297,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
333
297
  total={table.getPageCount()}
334
298
  />
335
299
  }
336
- {
337
- selectableRows && showActionsBar && (
338
- <Card className="row-selection-actions-card"
339
- padding="xs"
340
- >
341
- <Flex alignItems="center"
342
- justify="between"
343
- >
344
- <Caption color="light"
345
- paddingLeft="xs"
346
- size="xs"
347
- >
348
- {selectedRowsLength} Selected
349
- </Caption>
350
- <FlexItem>
351
- {actions}
352
- </FlexItem>
353
- </Flex>
354
- </Card>
355
- )
356
- }
357
300
  <Table
358
301
  className={`${loading ? "content-loading" : ""}`}
359
302
  dark={dark}
@@ -40,7 +40,6 @@ const AdvancedTablePagination = (props) => {
40
40
  <AdvancedTable
41
41
  columnDefinitions={columnDefinitions}
42
42
  pagination
43
- responsive="none"
44
43
  tableData={PAGINATION_MOCK_DATA}
45
44
  {...props}
46
45
  />
@@ -47,7 +47,6 @@ const AdvancedTablePaginationWithProps = (props) => {
47
47
  columnDefinitions={columnDefinitions}
48
48
  pagination
49
49
  paginationProps={paginationProps}
50
- responsive="none"
51
50
  tableData={PAGINATION_MOCK_DATA}
52
51
  {...props}
53
52
  />
@@ -1,3 +1,3 @@
1
- `sortControl` is an optional prop that can be used to gain greater control over the sort state of the Advanced Table. Tanstack handles sort itself, however it does provide for a way to handle the state manually if needed. Usecases for this include needing to store the sort state so it persists on page reload, set an initial sort state, etc.
1
+ `sortControl` is an optional prop that can be used to gain greater control over the sort state of the Advanced Table. Tanstack handles sort itself, however it does provide for a way to handle the state manually if needed. Usecases for this include needing to store the sort state so it persists on page reload, set an initial sort state, etc.
2
2
 
3
- The sort state must be an object with a single key/value pair, with the key being "desc" and the value being a boolean. The default for sort direction is `desc: true`.
3
+ The sort state must be an object with a single key/value pair, with the key being "desc" and the value being a boolean. The default for sort directino is `desc: true`.
@@ -27,8 +27,3 @@ examples:
27
27
  - advanced_table_pagination_with_props: Pagination Props
28
28
  - advanced_table_column_headers: Multi-Header Columns
29
29
  - advanced_table_column_headers_multiple: Multi-Header Columns (Multiple Levels)
30
- # - advanced_table_no_subrows: Table with No Subrows
31
- - advanced_table_selectable_rows: Selectable Rows
32
- - advanced_table_selectable_rows_no_subrows: Selectable Rows (No Subrows)
33
- - advanced_table_selectable_rows_actions: Selectable Rows (With Actions)
34
- - advanced_table_selectable_rows_header: Selectable Rows (No Actions Bar)
@@ -13,9 +13,4 @@ export { default as AdvancedTableCustomCell } from './_advanced_table_custom_cel
13
13
  export { default as AdvancedTablePagination } from './_advanced_table_pagination.jsx'
14
14
  export { default as AdvancedTablePaginationWithProps } from './_advanced_table_pagination_with_props.jsx'
15
15
  export { default as AdvancedTableColumnHeaders } from './_advanced_table_column_headers.jsx'
16
- export { default as AdvancedTableColumnHeadersMultiple } from './_advanced_table_column_headers_multiple.jsx'
17
- export { default as AdvancedTableSelectableRows } from './_advanced_table_selectable_rows.jsx'
18
- export { default as AdvancedTableSelectableRowsNoSubrows } from './_advanced_table_selectable_rows_no_subrows.jsx'
19
- export { default as AdvancedTableNoSubrows } from './_advanced_table_no_subrows.jsx'
20
- export { default as AdvancedTableSelectableRowsHeader } from './_advanced_table_selectable_rows_header.jsx'
21
- export { default as AdvancedTableSelectableRowsActions } from './_advanced_table_selectable_rows_actions.jsx'
16
+ export { default as AdvancedTableColumnHeadersMultiple } from './_advanced_table_column_headers_multiple.jsx'
@@ -1,5 +1,6 @@
1
- <%= pb_content_tag(object.tag,
2
- object.tag == "button" ? object.options : object.link_options) do %>
1
+ <%= content_tag(object.tag,
2
+ object.tag == "button" ? object.options : object.link_options,
3
+ **combined_html_options) do %>
3
4
  <% if object.variant === "reaction" %>
4
5
  <% if icon && object.valid_emoji(object.icon) %>
5
6
  <%= pb_rails("flex", props:{ align: "center" }) do %>
@@ -1,4 +1,9 @@
1
- <%= pb_content_tag(:label) do %>
1
+ <%= content_tag(:label, aria: object.aria,
2
+ id: object.id,
3
+ data: object.data,
4
+ class: object.classname,
5
+ **combined_html_options
6
+ ) do %>
2
7
  <%= content.presence || object.input %>
3
8
  <% if object.indeterminate %>
4
9
  <span data-pb-checkbox-icon-span="true" class="pb_checkbox_indeterminate">
@@ -1,5 +1,3 @@
1
- <%= pb_content_tag(
2
- object.tag
3
- ) do %>
1
+ <%= pb_content_tag do %>
4
2
  <%= content.presence %>
5
3
  <% end %>
@@ -3,9 +3,6 @@
3
3
  module Playbook
4
4
  module PbCollapsible
5
5
  class Collapsible < Playbook::KitBase
6
- prop :tag, type: Playbook::Props::Enum,
7
- values: %w[h1 h2 h3 h4 h5 h6 p div span tr th td thead col],
8
- default: "div"
9
6
  def classname
10
7
  generate_classname("pb_collapsible_kit")
11
8
  end
@@ -1,5 +1,9 @@
1
- <%= pb_content_tag(:div,
2
- class: object.classname + object.error_class) do %>
1
+ <%= content_tag(:div,
2
+ aria: object.aria,
3
+ class: object.classname + object.error_class,
4
+ data: object.data,
5
+ id: object.id,
6
+ **combined_html_options) do %>
3
7
  <div class="input_wrapper">
4
8
  <% if content.present? %>
5
9
  <%= content %>
@@ -64,30 +68,29 @@
64
68
  </div>
65
69
 
66
70
  <%= javascript_tag do %>
67
- (function() {
68
- const loadDatePicker = () => {
69
- datePickerHelper(<%= object.date_picker_config %>, "<%= object.scroll_container %>")
71
+ const loadDatePicker = () => {
72
+ datePickerHelper(<%= object.date_picker_config %>, "<%= object.scroll_container %>")
70
73
 
71
- if (<%= object.selection_type == "quickpick" %>) {
72
- document.getElementById("<%= object.picker_id %>").addEventListener("change", ({ target }) => {
73
- const startDate = document.getElementById("<%= object.start_date_id %>")
74
- const endDate = document.getElementById("<%= object.end_date_id %>")
75
- const splittedValue = target.value.split(" to ")
76
- startDate.value = splittedValue[0]
77
- endDate.value = splittedValue[1] ? splittedValue[1] : splittedValue[0]
78
- })
79
- }
74
+ if (<%= object.selection_type == "quickpick" %>) {
75
+ document.getElementById("<%= object.picker_id %>").addEventListener("change", ({ target }) => {
76
+ const startDate = document.getElementById("<%= object.start_date_id %>")
77
+ const endDate = document.getElementById("<%= object.end_date_id %>")
78
+ const splittedValue = target.value.split(" to ")
79
+ startDate.value = splittedValue[0]
80
+ endDate.value = splittedValue[1] ? splittedValue[1] : splittedValue[0]
81
+ })
80
82
  }
83
+ }
81
84
 
82
- window.addEventListener("DOMContentLoaded", () => {
83
- loadDatePicker()
85
+ window.addEventListener("DOMContentLoaded", () => {
86
+ loadDatePicker();
87
+ });
88
+
89
+ if (<%= !object.custom_event_listener.empty? %>) {
90
+ window.addEventListener("<%= object.custom_event_listener %>", () => {
91
+ console.log("Custom Event listener fired");
92
+ loadDatePicker();
84
93
  })
85
-
86
- if (<%= !object.custom_event_type.empty? %>) {
87
- window.addEventListener("<%= object.custom_event_type %>", () => {
88
- loadDatePicker()
89
- })
90
- }
91
- })()
94
+ }
92
95
  <% end %>
93
96
  <% end %>
@@ -73,8 +73,8 @@ module Playbook
73
73
  default: false
74
74
  prop :year_range, type: Playbook::Props::Array,
75
75
  default: [1900, 2100]
76
- prop :custom_event_type, type: Playbook::Props::String,
77
- default: ""
76
+ prop :custom_event_listener, type: Playbook::Props::String,
77
+ default: ""
78
78
 
79
79
  def classname
80
80
  default_margin_bottom = margin_bottom.present? ? "" : " mb_sm"