playbook_ui 14.22.0.pre.alpha.PLAY2248railstooltipclicktoopen8667 → 14.22.0.pre.alpha.PLAY2254datepickerdefaultdatenullvalueturbo8531

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 (44) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/Components/CustomCell.tsx +7 -6
  3. data/app/pb_kits/playbook/pb_advanced_table/Components/SubRowHeaderRow.tsx +11 -32
  4. data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableState.ts +2 -2
  5. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +0 -5
  6. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +0 -6
  7. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +2 -4
  8. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +0 -2
  9. data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +2 -2
  10. data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +7 -3
  11. data/app/pb_kits/playbook/pb_table/_table.tsx +4 -4
  12. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns.jsx +8 -8
  13. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns_react.md +1 -1
  14. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns.jsx +12 -12
  15. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns_react.md +3 -3
  16. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns.jsx +12 -12
  17. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns_react.md +3 -3
  18. data/app/pb_kits/playbook/pb_tooltip/docs/example.yml +0 -1
  19. data/app/pb_kits/playbook/pb_tooltip/index.js +36 -59
  20. data/app/pb_kits/playbook/pb_tooltip/tooltip.rb +2 -9
  21. data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +0 -1
  22. data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +0 -3
  23. data/dist/chunks/{_typeahead-CJa1XdQQ.js → _typeahead-d905TAE6.js} +1 -1
  24. data/dist/chunks/_weekday_stacked-K4_gOktU.js +45 -0
  25. data/dist/chunks/{lib-LHsP11gB.js → lib-CvfaRxDq.js} +1 -1
  26. data/dist/chunks/{pb_form_validation-BHrTZlH7.js → pb_form_validation-Ckz-Bv4i.js} +1 -1
  27. data/dist/chunks/vendor.js +1 -1
  28. data/dist/playbook-doc.js +2 -2
  29. data/dist/playbook-rails-react-bindings.js +1 -1
  30. data/dist/playbook-rails.js +1 -1
  31. data/dist/playbook.css +1 -1
  32. data/lib/playbook/version.rb +1 -1
  33. metadata +8 -16
  34. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_sort.jsx +0 -65
  35. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_sort.md +0 -5
  36. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header.jsx +0 -69
  37. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header.md +0 -1
  38. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_click_open.html.erb +0 -14
  39. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_click_open_rails.md +0 -1
  40. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_preserve_input.html.erb +0 -18
  41. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_preserve_input_rails.md +0 -1
  42. data/dist/chunks/_weekday_stacked-DEFOs-MK.js +0 -45
  43. /data/app/pb_kits/playbook/pb_tooltip/docs/{_tooltip_click_open_react.md → _tooltip_click_open.md} +0 -0
  44. /data/app/pb_kits/playbook/pb_typeahead/docs/{_typeahead_preserve_input_react.md → _typeahead_preserve_input.md} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c125bb33f1f9c6f0e5936cf252393e2b68d8ce63ada5d88579d50a82f23fecef
4
- data.tar.gz: d0a7c335abf1f9a4b7a9bd957be7127cac499f8d2294cf5edf7c7cef1b563a10
3
+ metadata.gz: 6309b59e0af954ca138e0f06a9ebf1d9858a8c6b3ccd424c0b113e928bd90af5
4
+ data.tar.gz: 1a1145623c0ccb98891e58a510a31757c830ff161452d53a486ec3e0c284752f
5
5
  SHA512:
6
- metadata.gz: c662b162bd4dff9ae51c5540a70297b581e46e91aad4a32479d46fdbb097f1323c0028603dc24f87de2f1d3c5ba1e4722f06e84a1ca9f48dedb2c4d6484609ae
7
- data.tar.gz: 474a7cf2f5e56350eae8d5b1f4751eb8e321299111f1c620221fd336b4aa1e869ccf1740d6dd01ec4513d1463c5e137c57e47a080c4c0c2bdfe83f8af584d82c
6
+ metadata.gz: 566a51db19c7b610cbdf8993aa4b32e187c6864fd99ea64966a4dc743c90971a521a813f41247cf2b4c99d0aac1215a71bbe6bbb1a617bb4ea9dbe593044f875
7
+ data.tar.gz: '06945309f2910c52bf5a451ed759610d4897fced7373603dcfe8817fe2c6dde88c32cdd358dabb2a06e028dc452468464572392e2b892d9c0dbd6868ad09c43d'
@@ -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>
@@ -7,7 +7,6 @@ import { GlobalProps } from "../../utilities/globalProps"
7
7
 
8
8
  import Flex from "../../pb_flex/_flex"
9
9
  import Caption from "../../pb_caption/_caption"
10
- import Icon from "../../pb_icon/_icon"
11
10
 
12
11
  import { ToggleIconButton } from "./ToggleIconButton"
13
12
  import { renderCollapsibleTrail } from "./CollapsibleTrail"
@@ -33,19 +32,17 @@ export const SubRowHeaderRow = ({
33
32
  subRowHeaders,
34
33
  table,
35
34
  }: SubRowHeaderRowProps & GlobalProps) => {
36
- const { inlineRowLoading, customSort, onCustomSortClick } = useContext(AdvancedTableContext)
35
+ const { inlineRowLoading } = useContext(AdvancedTableContext)
37
36
 
38
37
  const numberOfColumns = table.getAllFlatColumns().length
39
38
  const rowHasChildren = row.original.children ? true : false
40
39
  const canExpand = inlineRowLoading ? rowHasChildren : row.getCanExpand()
41
- const hasSubrowsToSort = row.getParentRow()?.subRows
42
-
43
40
 
44
41
  return (
45
42
  <tr className="custom-row bg-silver">
46
43
  <td
47
44
  className={`custom-row-first-column ${
48
- isChrome() ? "chrome-styles" : ""
45
+ isChrome() ? "chrome-styles" : ""
49
46
  }`}
50
47
  colSpan={1}
51
48
  >
@@ -53,39 +50,21 @@ export const SubRowHeaderRow = ({
53
50
  <div style={{ paddingLeft: `${row.depth * 1.25}em` }}>
54
51
  <Flex align="center"
55
52
  columnGap="xs"
56
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
57
- //@ts-ignore
58
- justifyContent={customSort && hasSubrowsToSort && hasSubrowsToSort.length > 1 ? "between" : undefined}
59
53
  >
60
- <Flex columnGap="xs">
61
- {enableToggleExpansion === "all" && canExpand ? (
62
- <ToggleIconButton onClick={onClick}
63
- row={row}
64
- />
65
- ) : null}
66
- <Caption
67
- marginLeft={canExpand ? "none" : "xs"}
68
- text={subRowHeaders[row.depth - 1]}
54
+ {enableToggleExpansion === "all" && canExpand ? (
55
+ <ToggleIconButton onClick={onClick}
56
+ row={row}
69
57
  />
70
- </Flex>
71
- {customSort && hasSubrowsToSort && hasSubrowsToSort.length > 1 && (
72
- <button
73
- aria-label="Sort this group"
74
- className="sort-button-icon gray-icon"
75
- onClick={() => { onCustomSortClick && onCustomSortClick(row.getParentRow()?.subRows)}}
76
- >
77
- <Icon
78
- cursor="pointer"
79
- fixedWidth
80
- icon="sort"
81
- />
82
- </button>
83
- )}
58
+ ) : null}
59
+ <Caption
60
+ marginLeft={canExpand ? "none" : "xs"}
61
+ text={subRowHeaders[row.depth - 1]}
62
+ />
84
63
  </Flex>
85
64
  </div>
86
65
  </td>
87
66
 
88
67
  <td colSpan={numberOfColumns - 1} />
89
68
  </tr>
90
- );
69
+ )
91
70
  }
@@ -87,7 +87,7 @@ export function useTableState({
87
87
  // Handle grouped columns
88
88
  if (column.columns && column.columns.length > 0) {
89
89
  return {
90
- header: column.header || column.label || "",
90
+ header: column.label || "",
91
91
  columns: buildColumns(column.columns, false),
92
92
  };
93
93
  }
@@ -95,7 +95,7 @@ export function useTableState({
95
95
  // Define the base column structure
96
96
  const columnStructure = {
97
97
  ...columnHelper.accessor(column.accessor, {
98
- header: column.header ?? column.label ?? "",
98
+ header: column.label || "",
99
99
  }),
100
100
  };
101
101
 
@@ -189,11 +189,6 @@
189
189
  box-sizing: border-box !important;
190
190
  }
191
191
  }
192
- // Fixes for tooltip picking up th styling from Table kit
193
- .pb_tooltip_kit {
194
- font-weight: unset;
195
- text-transform: unset;
196
- }
197
192
  }
198
193
 
199
194
  .pb_advanced_table_body {
@@ -36,7 +36,6 @@ type AdvancedTableProps = {
36
36
  columnDefinitions: GenericObject[]
37
37
  columnGroupBorderColor?: "text_lt_default" | "text_lt_light" | "text_lt_lighter" | "text_dk_default" | "text_dk_light" | "text_dk_lighter"
38
38
  columnVisibilityControl?: GenericObject
39
- customSort?:boolean;
40
39
  dark?: boolean
41
40
  data?: { [key: string]: string }
42
41
  enableToggleExpansion?: "all" | "header" | "none"
@@ -68,7 +67,6 @@ type AdvancedTableProps = {
68
67
  tableProps?: GenericObject
69
68
  toggleExpansionIcon?: string | string[]
70
69
  onRowSelectionChange?: (arg: RowSelectionState) => void
71
- onCustomSortClick?: (arg: GenericObject[]) => void
72
70
  virtualizedRows?: boolean
73
71
  allowFullScreen?: boolean
74
72
  fullScreenControl?: (controls: FullscreenControls) => void
@@ -83,7 +81,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
83
81
  columnDefinitions,
84
82
  columnGroupBorderColor,
85
83
  columnVisibilityControl,
86
- customSort,
87
84
  dark = false,
88
85
  data = {},
89
86
  enableToggleExpansion = "header",
@@ -98,7 +95,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
98
95
  maxHeight,
99
96
  onRowToggleClick,
100
97
  onToggleExpansionClick,
101
- onCustomSortClick,
102
98
  pagination = false,
103
99
  paginationProps,
104
100
  pinnedRows,
@@ -329,7 +325,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
329
325
  columnDefinitions={columnDefinitions}
330
326
  columnGroupBorderColor={columnGroupBorderColor}
331
327
  columnVisibilityControl={columnVisibilityControl}
332
- customSort={customSort}
333
328
  enableToggleExpansion={enableToggleExpansion}
334
329
  enableVirtualization={virtualizedRows}
335
330
  expandByDepth={expandByDepth}
@@ -341,7 +336,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
341
336
  isActionBarVisible={isActionBarVisible}
342
337
  isFullscreen={isFullscreen}
343
338
  loading={loading}
344
- onCustomSortClick={onCustomSortClick}
345
339
  onExpandByDepthClick={onExpandByDepthClick}
346
340
  pinnedRows={pinnedRows}
347
341
  responsive={responsive}
@@ -19,15 +19,14 @@ examples:
19
19
  - advanced_table_selectable_rows_actions_rails: Selectable Rows (With Actions)
20
20
  - advanced_table_selectable_rows_header_rails: Selectable Rows (No Actions Bar)
21
21
  - advanced_table_scrollbar_none: Advanced Table Scrollbar None
22
- - advanced_table_column_styling_rails: Column Styling
23
- - advanced_table_column_styling_column_headers_rails: Column Styling with Multiple Headers
22
+ # - advanced_table_column_styling_rails: Column Styling
23
+ # - advanced_table_column_styling_column_headers_rails: Column Styling with Multiple Headers
24
24
 
25
25
  react:
26
26
  - advanced_table_default: Default (Required Props)
27
27
  - advanced_table_loading: Loading State
28
28
  - advanced_table_sort: Enable Sorting
29
29
  - advanced_table_sort_control: Sort Control
30
- - advanced_table_custom_sort: Custom Sort
31
30
  - advanced_table_expanded_control: Expanded Control
32
31
  - advanced_table_expand_by_depth: Expand by Depth
33
32
  - advanced_table_subrow_headers: SubRow Headers
@@ -41,7 +40,6 @@ examples:
41
40
  - advanced_table_inline_row_loading: Inline Row Loading
42
41
  - advanced_table_responsive: Responsive Tables
43
42
  - advanced_table_custom_cell: Custom Components for Cells
44
- - advanced_table_with_custom_header: Custom Header Cell
45
43
  - advanced_table_pagination: Pagination
46
44
  - advanced_table_pagination_with_props: Pagination Props
47
45
  - advanced_table_column_headers: Multi-Header Columns
@@ -38,5 +38,3 @@ export { default as AdvancedTableRowStyling } from './_advanced_table_row_stylin
38
38
  export { default as AdvancedTableColumnStyling } from './_advanced_table_column_styling.jsx'
39
39
  export { default as AdvancedTableColumnStylingColumnHeaders } from './_advanced_table_column_styling_column_headers.jsx'
40
40
  export { default as AdvancedTableInfiniteScroll} from './_advanced_table_infinite_scroll.jsx'
41
- export {default as AdvancedTableWithCustomHeader} from './_advanced_table_with_custom_header.jsx'
42
- export { default as AdvancedTableCustomSort } from './_advanced_table_custom_sort.jsx'
@@ -30,11 +30,11 @@
30
30
  class="gray-icon expand-toggle-icon"
31
31
  data-advanced-table="true">
32
32
  <%= pb_rails("icon", props: { id: "advanced-table_open_icon", icon: "circle-play", cursor: "pointer" }) %>
33
- <%= pb_rails("icon", props: { id: "advanced-table_close_icon", icon: "circle-play-down", cursor: "pointer" }) %>
33
+ <%= pb_rails("icon", props: { id: "advanced-table_close_icon", icon: "circle-play", cursor: "pointer", rotation: 90 }) %>
34
34
  </button>
35
35
  <% end %>
36
36
  <% end %>
37
- <%= pb_rails("flex/flex_item") do %>
37
+ <%= pb_rails("flex/flex_item") do %>
38
38
  <% if column[:custom_renderer].present? %>
39
39
  <%= raw(column[:custom_renderer].call(object.row, custom_renderer_value(column, index))) %>
40
40
  <% elsif index.zero? %>
@@ -82,11 +82,15 @@ const datePickerHelper = (config: DatePickerConfig, scrollContainer: string | HT
82
82
  // ===========================================================
83
83
 
84
84
  const defaultDateGetter = () => {
85
- if (defaultDate === '') {
85
+ if (
86
+ defaultDate === '' ||
87
+ defaultDate === null ||
88
+ defaultDate === undefined ||
89
+ (typeof defaultDate === 'string' && defaultDate.trim() === '')
90
+ ) {
86
91
  return null
87
- } else {
88
- return defaultDate
89
92
  }
93
+ return defaultDate
90
94
  }
91
95
 
92
96
  const disabledWeekDays = () => {
@@ -104,8 +104,8 @@ const Table = (props: TableProps): React.ReactElement => {
104
104
 
105
105
  stickyLeftColumn.forEach((colId, index) => {
106
106
  const isLastColumn = index === stickyLeftColumn.length - 1;
107
- const header = document.querySelector(`th[data-sticky-id="${colId}"]`);
108
- const cells = document.querySelectorAll(`td[data-sticky-id="${colId}"]`);
107
+ const header = document.querySelector(`th[id="${colId}"]`);
108
+ const cells = document.querySelectorAll(`td[id="${colId}"]`);
109
109
 
110
110
  if (header) {
111
111
  header.classList.add('sticky');
@@ -155,8 +155,8 @@ const Table = (props: TableProps): React.ReactElement => {
155
155
 
156
156
  stickyRightColumnReversed.forEach((colId, index) => {
157
157
  const isLastColumn = index === stickyRightColumn.length - 1;
158
- const header = document.querySelector(`th[data-sticky-id="${colId}"]`);
159
- const cells = document.querySelectorAll(`td[data-sticky-id="${colId}"]`);
158
+ const header = document.querySelector(`th[id="${colId}"]`);
159
+ const cells = document.querySelectorAll(`td[id="${colId}"]`);
160
160
 
161
161
  if (header) {
162
162
  header.classList.add('sticky');
@@ -11,7 +11,7 @@ const TableStickyColumns = () => {
11
11
  >
12
12
  <thead>
13
13
  <tr>
14
- <th data-sticky-id="a">{'Column 1'}</th>
14
+ <th id="a">{'Column 1'}</th>
15
15
  <th>{'Column 2'}</th>
16
16
  <th>{'Column 3'}</th>
17
17
  <th>{'Column 4'}</th>
@@ -25,12 +25,12 @@ const TableStickyColumns = () => {
25
25
  <th>{'Column 12'}</th>
26
26
  <th>{'Column 13'}</th>
27
27
  <th>{'Column 14'}</th>
28
- <th data-sticky-id="b">{'Column 15'}</th>
28
+ <th id="b">{'Column 15'}</th>
29
29
  </tr>
30
30
  </thead>
31
31
  <tbody>
32
32
  <tr>
33
- <td data-sticky-id="a">{'Value 1'}</td>
33
+ <td id="a">{'Value 1'}</td>
34
34
  <td>{'Value 2'}</td>
35
35
  <td>{'Value 3'}</td>
36
36
  <td>{'Value 4'}</td>
@@ -44,10 +44,10 @@ const TableStickyColumns = () => {
44
44
  <td>{'Value 12'}</td>
45
45
  <td>{'Value 13'}</td>
46
46
  <td>{'Value 14'}</td>
47
- <td data-sticky-id="b">{'Value 15'}</td>
47
+ <td id="b">{'Value 15'}</td>
48
48
  </tr>
49
49
  <tr>
50
- <td data-sticky-id="a">{'Value 1'}</td>
50
+ <td id="a">{'Value 1'}</td>
51
51
  <td>{'Value 2'}</td>
52
52
  <td>{'Value 3'}</td>
53
53
  <td>{'Value 4'}</td>
@@ -61,10 +61,10 @@ const TableStickyColumns = () => {
61
61
  <td>{'Value 12'}</td>
62
62
  <td>{'Value 13'}</td>
63
63
  <td>{'Value 14'}</td>
64
- <td data-sticky-id="b">{'Value 15'}</td>
64
+ <td id="b">{'Value 15'}</td>
65
65
  </tr>
66
66
  <tr>
67
- <td data-sticky-id="a">{'Value 1'}</td>
67
+ <td id="a">{'Value 1'}</td>
68
68
  <td>{'Value 2'}</td>
69
69
  <td>{'Value 3'}</td>
70
70
  <td>{'Value 4'}</td>
@@ -78,7 +78,7 @@ const TableStickyColumns = () => {
78
78
  <td>{'Value 12'}</td>
79
79
  <td>{'Value 13'}</td>
80
80
  <td>{'Value 14'}</td>
81
- <td data-sticky-id="b">{'Value 15'}</td>
81
+ <td id="b">{'Value 15'}</td>
82
82
  </tr>
83
83
  </tbody>
84
84
  </Table>
@@ -1,3 +1,3 @@
1
1
  The `stickyLeftColumn` and `stickyRightColumn` props can be used together on the same table as needed.
2
2
 
3
- Please ensure that unique `data-sticky-id`s are used for all columns across multiple tables. Using the same columns `data-sticky-id`s on multiple tables can lead to issues when using props.
3
+ Please ensure that unique ids are used for all columns across multiple tables. Using the same columns ids on multiple tables can lead to issues when using props.
@@ -10,9 +10,9 @@ const TableStickyLeftColumns = () => {
10
10
  >
11
11
  <thead>
12
12
  <tr>
13
- <th data-sticky-id="1">{'Column 1'}</th>
14
- <th data-sticky-id="2">{'Column 2'}</th>
15
- <th data-sticky-id="3">{'Column 3'}</th>
13
+ <th id="1">{'Column 1'}</th>
14
+ <th id="2">{'Column 2'}</th>
15
+ <th id="3">{'Column 3'}</th>
16
16
  <th>{'Column 4'}</th>
17
17
  <th>{'Column 5'}</th>
18
18
  <th>{'Column 6'}</th>
@@ -29,9 +29,9 @@ const TableStickyLeftColumns = () => {
29
29
  </thead>
30
30
  <tbody>
31
31
  <tr>
32
- <td data-sticky-id="1">{'Value 1'}</td>
33
- <td data-sticky-id="2">{'Value 2'}</td>
34
- <td data-sticky-id="3">{'Value 3'}</td>
32
+ <td id="1">{'Value 1'}</td>
33
+ <td id="2">{'Value 2'}</td>
34
+ <td id="3">{'Value 3'}</td>
35
35
  <td>{'Value 4'}</td>
36
36
  <td>{'Value 5'}</td>
37
37
  <td>{'Value 6'}</td>
@@ -46,9 +46,9 @@ const TableStickyLeftColumns = () => {
46
46
  <td>{'Value 15'}</td>
47
47
  </tr>
48
48
  <tr>
49
- <td data-sticky-id="1">{'Value 1'}</td>
50
- <td data-sticky-id="2">{'Value 2'}</td>
51
- <td data-sticky-id="3">{'Value 3'}</td>
49
+ <td id="1">{'Value 1'}</td>
50
+ <td id="2">{'Value 2'}</td>
51
+ <td id="3">{'Value 3'}</td>
52
52
  <td>{'Value 4'}</td>
53
53
  <td>{'Value 5'}</td>
54
54
  <td>{'Value 6'}</td>
@@ -63,9 +63,9 @@ const TableStickyLeftColumns = () => {
63
63
  <td>{'Value 15'}</td>
64
64
  </tr>
65
65
  <tr>
66
- <td data-sticky-id="1">{'Value 1'}</td>
67
- <td data-sticky-id="2">{'Value 2'}</td>
68
- <td data-sticky-id="3">{'Value 3'}</td>
66
+ <td id="1">{'Value 1'}</td>
67
+ <td id="2">{'Value 2'}</td>
68
+ <td id="3">{'Value 3'}</td>
69
69
  <td>{'Value 4'}</td>
70
70
  <td>{'Value 5'}</td>
71
71
  <td>{'Value 6'}</td>
@@ -1,5 +1,5 @@
1
- The `stickyLeftColumn` prop expects an array of the column `data-sticky-id`s you want to be sticky. Make sure to add the corresponding `data-sticky-id` to the `<th>` and `<td>`.
1
+ The `stickyLeftColumn` prop expects an array of the column ids you want to be sticky. Make sure to add the corresponding id to the `<th>` and `<td>`.
2
2
 
3
- If you are using the sub-component variant, then you will pass the `data-sticky-id` to `<Table.Header>` and `<Table.Cell>`
3
+ If you are using the sub-component variant, then you will pass the id to `<Table.Header>` and `<Table.Cell>`
4
4
 
5
- Please ensure that unique `data-sticky-id`s are used for all columns across multiple tables. Using the same columns `data-sticky-id`s on multiple tables can lead to issues when using `stickyLeftColumn` prop.
5
+ Please ensure that unique ids are used for all columns across multiple tables. Using the same columns ids on multiple tables can lead to issues when using `stickyLeftColumn` prop.
@@ -22,9 +22,9 @@ const TableStickyRightColumns = () => {
22
22
  <th>{'Column 10'}</th>
23
23
  <th>{'Column 11'}</th>
24
24
  <th>{'Column 12'}</th>
25
- <th data-sticky-id="13">{'Column 13'}</th>
26
- <th data-sticky-id="14">{'Column 14'}</th>
27
- <th data-sticky-id="15">{'Column 15'}</th>
25
+ <th id="13">{'Column 13'}</th>
26
+ <th id="14">{'Column 14'}</th>
27
+ <th id="15">{'Column 15'}</th>
28
28
  </tr>
29
29
  </thead>
30
30
  <tbody>
@@ -41,9 +41,9 @@ const TableStickyRightColumns = () => {
41
41
  <td>{'Value 10'}</td>
42
42
  <td>{'Value 11'}</td>
43
43
  <td>{'Value 12'}</td>
44
- <td data-sticky-id="13">{'Value 13'}</td>
45
- <td data-sticky-id="14">{'Value 14'}</td>
46
- <td data-sticky-id="15">{'Value 15'}</td>
44
+ <td id="13">{'Value 13'}</td>
45
+ <td id="14">{'Value 14'}</td>
46
+ <td id="15">{'Value 15'}</td>
47
47
  </tr>
48
48
  <tr>
49
49
  <td>{'Value 1'}</td>
@@ -58,9 +58,9 @@ const TableStickyRightColumns = () => {
58
58
  <td>{'Value 10'}</td>
59
59
  <td>{'Value 11'}</td>
60
60
  <td>{'Value 12'}</td>
61
- <td data-sticky-id="13">{'Value 13'}</td>
62
- <td data-sticky-id="14">{'Value 14'}</td>
63
- <td data-sticky-id="15">{'Value 15'}</td>
61
+ <td id="13">{'Value 13'}</td>
62
+ <td id="14">{'Value 14'}</td>
63
+ <td id="15">{'Value 15'}</td>
64
64
  </tr>
65
65
  <tr>
66
66
  <td>{'Value 1'}</td>
@@ -75,9 +75,9 @@ const TableStickyRightColumns = () => {
75
75
  <td>{'Value 10'}</td>
76
76
  <td>{'Value 11'}</td>
77
77
  <td>{'Value 12'}</td>
78
- <td data-sticky-id="13">{'Value 13'}</td>
79
- <td data-sticky-id="14">{'Value 14'}</td>
80
- <td data-sticky-id="15">{'Value 15'}</td>
78
+ <td id="13">{'Value 13'}</td>
79
+ <td id="14">{'Value 14'}</td>
80
+ <td id="15">{'Value 15'}</td>
81
81
  </tr>
82
82
  </tbody>
83
83
  </Table>
@@ -1,5 +1,5 @@
1
- The `stickyRightColumn` prop works in the same way as the above `stickyLeftColumn` prop. It expects an array of the column `data-sticky-id`s you want to be sticky. Make sure to add the corresponding `data-sticky-id` to the `<th>` and `<td>`.
1
+ The `stickyRightColumn` prop works in the same way as the above `stickyLeftColumn` prop. It expects an array of the column ids you want to be sticky. Make sure to add the corresponding id to the `<th>` and `<td>`.
2
2
 
3
- If you are using the sub-component variant, then you will pass the `data-sticky-id` to `<Table.Header>` and `<Table.Cell>`
3
+ If you are using the sub-component variant, then you will pass the id to `<Table.Header>` and `<Table.Cell>`
4
4
 
5
- Please ensure that unique `data-sticky-id`s are used for all columns across multiple tables. Using the same columns `data-sticky-id`s on multiple tables can lead to issues when using the `stickyRightColumn` prop.
5
+ Please ensure that unique ids are used for all columns across multiple tables. Using the same columns ids on multiple tables can lead to issues when using the `stickyRightColumn` prop.
@@ -9,7 +9,6 @@ examples:
9
9
  - tooltip_with_icon_circle: Icon Circle Tooltip
10
10
  - tooltip_delay_rails: Delay
11
11
  - tooltip_show_tooltip: Show Tooltip
12
- - tooltip_click_open: Click to Open
13
12
 
14
13
  react:
15
14
  - tooltip_default_react: Default
@@ -19,75 +19,60 @@ export default class PbTooltip extends PbEnhancedElement {
19
19
  }
20
20
 
21
21
  this.triggerElements.forEach((trigger) => {
22
- const method = this.effectiveTriggerMethod
22
+ const method = this.triggerMethod
23
23
  const interactionEnabled = this.tooltipInteraction
24
24
 
25
25
  if (method === 'click') {
26
- trigger.addEventListener('click', (e) => {
27
- if (this.useClickToOpen) {
28
- e.preventDefault()
29
- if (this.isTooltipVisible()) {
30
- this.hideTooltip()
31
- } else {
32
- this.showTooltip(trigger)
33
- }
34
- } else {
35
- this.showTooltip(trigger)
36
- }
26
+ trigger.addEventListener('click', () => {
27
+ this.showTooltip(trigger)
37
28
  })
38
29
  } else {
39
- if (!this.useClickToOpen) {
40
- trigger.addEventListener('mouseenter', () => {
41
- clearSafeZoneListener(this)
42
- clearTimeout(this.mouseleaveTimeout)
43
- this.currentTrigger = trigger
44
- const delayOpen = this.delayOpen ? parseInt(this.delayOpen) : TOOLTIP_TIMEOUT
45
- this.mouseenterTimeout = setTimeout(() => {
46
- this.showTooltip(trigger)
47
- if (interactionEnabled) {
48
- this.checkCloseTooltip(trigger)
49
- }
50
- }, delayOpen)
51
- })
30
+ trigger.addEventListener('mouseenter', () => {
31
+ clearSafeZoneListener(this)
32
+ clearTimeout(this.mouseleaveTimeout)
33
+ this.currentTrigger = trigger
34
+ const delayOpen = this.delayOpen ? parseInt(this.delayOpen) : TOOLTIP_TIMEOUT
35
+ this.mouseenterTimeout = setTimeout(() => {
36
+ this.showTooltip(trigger)
37
+ if (interactionEnabled) {
38
+ this.checkCloseTooltip(trigger)
39
+ }
40
+ }, delayOpen)
41
+ })
52
42
 
53
- trigger.addEventListener('mouseleave', () => {
54
- clearTimeout(this.mouseenterTimeout)
55
- if (this.delayClose) {
56
- const delayClose = parseInt(this.delayClose)
57
- this.mouseleaveTimeout = setTimeout(() => {
58
- if (interactionEnabled) {
59
- this.attachSafeZoneListener()
60
- } else {
61
- this.hideTooltip()
62
- }
63
- }, delayClose)
64
- } else {
43
+ trigger.addEventListener('mouseleave', () => {
44
+ clearTimeout(this.mouseenterTimeout)
45
+ if (this.delayClose) {
46
+ const delayClose = parseInt(this.delayClose)
47
+ this.mouseleaveTimeout = setTimeout(() => {
65
48
  if (interactionEnabled) {
66
49
  this.attachSafeZoneListener()
67
50
  } else {
68
51
  this.hideTooltip()
69
52
  }
53
+ }, delayClose)
54
+ } else {
55
+ if (interactionEnabled) {
56
+ this.attachSafeZoneListener()
57
+ } else {
58
+ this.hideTooltip()
70
59
  }
71
- })
60
+ }
61
+ })
72
62
 
73
- if (interactionEnabled) {
74
- this.tooltip.addEventListener('mouseenter', () => {
75
- clearSafeZoneListener(this)
76
- })
63
+ if (interactionEnabled) {
64
+ this.tooltip.addEventListener('mouseenter', () => {
65
+ clearSafeZoneListener(this)
66
+ })
77
67
 
78
- this.tooltip.addEventListener('mouseleave', () => {
79
- this.attachSafeZoneListener()
80
- })
81
- }
68
+ this.tooltip.addEventListener('mouseleave', () => {
69
+ this.attachSafeZoneListener()
70
+ })
82
71
  }
83
72
  }
84
73
  })
85
74
  }
86
75
 
87
- isTooltipVisible() {
88
- return this.tooltip && this.tooltip.classList.contains('show')
89
- }
90
-
91
76
  attachSafeZoneListener() {
92
77
  clearSafeZoneListener(this)
93
78
  this.safeZoneHandler = (e) => {
@@ -160,7 +145,7 @@ export default class PbTooltip extends PbEnhancedElement {
160
145
 
161
146
  this.tooltip.classList.add('show')
162
147
 
163
- if (this.effectiveTriggerMethod === 'click' && !this.useClickToOpen) {
148
+ if (this.triggerMethod === 'click') {
164
149
  clearTimeout(this.autoHideTimeout)
165
150
  this.autoHideTimeout = setTimeout(() => {
166
151
  this.hideTooltip()
@@ -239,14 +224,6 @@ export default class PbTooltip extends PbEnhancedElement {
239
224
  return this.element.dataset.pbTooltipTriggerMethod || 'hover'
240
225
  }
241
226
 
242
- get useClickToOpen() {
243
- return this.element.dataset.pbTooltipUseClickToOpen === 'true'
244
- }
245
-
246
- get effectiveTriggerMethod() {
247
- return this.useClickToOpen ? 'click' : this.triggerMethod
248
- }
249
-
250
227
  get tooltipInteraction() {
251
228
  return this.element.dataset.pbTooltipInteraction === 'true'
252
229
  }