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.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_advanced_table/Components/CustomCell.tsx +7 -6
- data/app/pb_kits/playbook/pb_advanced_table/Components/SubRowHeaderRow.tsx +11 -32
- data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableState.ts +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +0 -5
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +0 -6
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +2 -4
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +0 -2
- data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +2 -2
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +7 -3
- data/app/pb_kits/playbook/pb_table/_table.tsx +4 -4
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns.jsx +8 -8
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns_react.md +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns.jsx +12 -12
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns_react.md +3 -3
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns.jsx +12 -12
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns_react.md +3 -3
- data/app/pb_kits/playbook/pb_tooltip/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_tooltip/index.js +36 -59
- data/app/pb_kits/playbook/pb_tooltip/tooltip.rb +2 -9
- data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +0 -3
- data/dist/chunks/{_typeahead-CJa1XdQQ.js → _typeahead-d905TAE6.js} +1 -1
- data/dist/chunks/_weekday_stacked-K4_gOktU.js +45 -0
- data/dist/chunks/{lib-LHsP11gB.js → lib-CvfaRxDq.js} +1 -1
- data/dist/chunks/{pb_form_validation-BHrTZlH7.js → pb_form_validation-Ckz-Bv4i.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/playbook-doc.js +2 -2
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +8 -16
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_sort.jsx +0 -65
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_sort.md +0 -5
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header.jsx +0 -69
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header.md +0 -1
- data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_click_open.html.erb +0 -14
- data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_click_open_rails.md +0 -1
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_preserve_input.html.erb +0 -18
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_preserve_input_rails.md +0 -1
- data/dist/chunks/_weekday_stacked-DEFOs-MK.js +0 -45
- /data/app/pb_kits/playbook/pb_tooltip/docs/{_tooltip_click_open_react.md → _tooltip_click_open.md} +0 -0
- /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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6309b59e0af954ca138e0f06a9ebf1d9858a8c6b3ccd424c0b113e928bd90af5
|
4
|
+
data.tar.gz: 1a1145623c0ccb98891e58a510a31757c830ff161452d53a486ec3e0c284752f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
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
|
-
|
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
|
-
|
61
|
-
{
|
62
|
-
|
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
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
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.
|
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.
|
98
|
+
header: column.label || "",
|
99
99
|
}),
|
100
100
|
};
|
101
101
|
|
@@ -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
|
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 (
|
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[
|
108
|
-
const cells = document.querySelectorAll(`td[
|
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[
|
159
|
-
const cells = document.querySelectorAll(`td[
|
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
|
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
|
28
|
+
<th id="b">{'Column 15'}</th>
|
29
29
|
</tr>
|
30
30
|
</thead>
|
31
31
|
<tbody>
|
32
32
|
<tr>
|
33
|
-
<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
|
47
|
+
<td id="b">{'Value 15'}</td>
|
48
48
|
</tr>
|
49
49
|
<tr>
|
50
|
-
<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
|
64
|
+
<td id="b">{'Value 15'}</td>
|
65
65
|
</tr>
|
66
66
|
<tr>
|
67
|
-
<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
|
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
|
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
|
14
|
-
<th
|
15
|
-
<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
|
33
|
-
<td
|
34
|
-
<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
|
50
|
-
<td
|
51
|
-
<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
|
67
|
-
<td
|
68
|
-
<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
|
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
|
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
|
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
|
26
|
-
<th
|
27
|
-
<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
|
45
|
-
<td
|
46
|
-
<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
|
62
|
-
<td
|
63
|
-
<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
|
79
|
-
<td
|
80
|
-
<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
|
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
|
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
|
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.
|
@@ -19,75 +19,60 @@ export default class PbTooltip extends PbEnhancedElement {
|
|
19
19
|
}
|
20
20
|
|
21
21
|
this.triggerElements.forEach((trigger) => {
|
22
|
-
const method = this.
|
22
|
+
const method = this.triggerMethod
|
23
23
|
const interactionEnabled = this.tooltipInteraction
|
24
24
|
|
25
25
|
if (method === 'click') {
|
26
|
-
trigger.addEventListener('click', (
|
27
|
-
|
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
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
this.
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
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
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
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
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
63
|
+
if (interactionEnabled) {
|
64
|
+
this.tooltip.addEventListener('mouseenter', () => {
|
65
|
+
clearSafeZoneListener(this)
|
66
|
+
})
|
77
67
|
|
78
|
-
|
79
|
-
|
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.
|
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
|
}
|