playbook_ui 14.21.2.pre.alpha.PLAY22558410 → 14.22.0.pre.alpha.PLAY2256stickydataidreact8523
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/_playbook.scss +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +14 -2
- data/app/pb_kits/playbook/pb_advanced_table/scss_partials/advanced_table_sticky_mixin.scss +16 -1
- data/app/pb_kits/playbook/pb_contact/contact.test.js +2 -2
- data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.ts +1 -39
- data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.ts +1 -39
- data/app/pb_kits/playbook/pb_filter/filter.test.js +2 -2
- 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_table/styles/_table-card.scss +11 -0
- data/app/pb_kits/playbook/pb_tooltip/_tooltip.tsx +34 -22
- data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_click_open.jsx +25 -0
- data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_click_open.md +1 -0
- data/app/pb_kits/playbook/pb_tooltip/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_tooltip/docs/index.js +1 -0
- data/dist/chunks/_typeahead-B7FRYVtS.js +22 -0
- data/dist/chunks/{_weekday_stacked-D1bqIne1.js → _weekday_stacked-BOIXPXFw.js} +1 -1
- data/dist/chunks/{lib-CTkMyvfQ.js → lib-Carqm8Ip.js} +1 -1
- data/dist/chunks/{pb_form_validation-BVF3TmcL.js → pb_form_validation-DqRmTS8m.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +0 -9
- 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 +2 -2
- metadata +8 -29
- data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.scss +0 -14
- data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.tsx +0 -119
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_description.md +0 -5
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.html.erb +0 -37
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.jsx +0 -48
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.md +0 -2
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_default.html.erb +0 -37
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_default.jsx +0 -47
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_default.md +0 -3
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_drillable.html.erb +0 -79
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_drillable.jsx +0 -90
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_drillable.md +0 -1
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_grouped_data.html.erb +0 -54
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_grouped_data.jsx +0 -65
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_grouped_data.md +0 -3
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.html.erb +0 -37
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.jsx +0 -48
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.md +0 -3
- data/app/pb_kits/playbook/pb_treemap_chart/docs/example.yml +0 -15
- data/app/pb_kits/playbook/pb_treemap_chart/docs/index.js +0 -5
- data/app/pb_kits/playbook/pb_treemap_chart/treemapChart.test.js +0 -63
- data/app/pb_kits/playbook/pb_treemap_chart/treemap_chart.html.erb +0 -1
- data/app/pb_kits/playbook/pb_treemap_chart/treemap_chart.rb +0 -48
- data/dist/chunks/_typeahead-B80UsDrG.js +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d78eb539bff4c09f8f56e54833e4930e9bc85402c1a3a50e2739a3defc103623
|
4
|
+
data.tar.gz: f2e756e717c11b93d51dc929ec90a8ba6b889e2835eff61a0918fc62a92b36b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92c48871d8d522eff9429550e9326503fd89e417b60cfc8c8273c5e44eb87c81500dc9bd8333939ff2dad29ed9ad80dca16255d4b105f24ea5c17da7a07e52d1
|
7
|
+
data.tar.gz: 883f732d8b305027e5ae8a3d952b26bcee861285895d2a974ff724e1be57e9db4c4927b94ffcf6577cd1f1475c4bb11332c3e67b9dcccb3eb1f9669f3db10669
|
@@ -104,7 +104,6 @@
|
|
104
104
|
@import 'pb_title_detail/title_detail';
|
105
105
|
@import 'pb_toggle/toggle';
|
106
106
|
@import 'pb_tooltip/tooltip';
|
107
|
-
@import 'pb_treemap_chart/treemap_chart';
|
108
107
|
@import 'pb_typeahead/typeahead';
|
109
108
|
@import 'pb_user/user';
|
110
109
|
@import 'pb_user_badge/user_badge';
|
@@ -56,7 +56,7 @@
|
|
56
56
|
}
|
57
57
|
|
58
58
|
.bg-row-selection {
|
59
|
-
background-color:
|
59
|
+
background-color: #E5EEFA;
|
60
60
|
}
|
61
61
|
|
62
62
|
.full-width {
|
@@ -227,7 +227,7 @@
|
|
227
227
|
|
228
228
|
&.bg-row-selection {
|
229
229
|
td:first-child {
|
230
|
-
background-color:
|
230
|
+
background-color: #E5EEFA;
|
231
231
|
}
|
232
232
|
}
|
233
233
|
}
|
@@ -892,6 +892,18 @@
|
|
892
892
|
}
|
893
893
|
}
|
894
894
|
}
|
895
|
+
.bg-row-selection {
|
896
|
+
background-color: #202850;
|
897
|
+
}
|
898
|
+
.pb_advanced_table_body {
|
899
|
+
tr.virtualized-table-row {
|
900
|
+
&.bg-row-selection {
|
901
|
+
td:first-child {
|
902
|
+
background-color: #202850;
|
903
|
+
}
|
904
|
+
}
|
905
|
+
}
|
906
|
+
}
|
895
907
|
}
|
896
908
|
}
|
897
909
|
|
@@ -2,7 +2,8 @@
|
|
2
2
|
$border-color,
|
3
3
|
$bg-main,
|
4
4
|
$bg-secondary,
|
5
|
-
$highlight:
|
5
|
+
$highlight: #E5EEFA,
|
6
|
+
$highlight-dark: #202850,
|
6
7
|
) {
|
7
8
|
border-radius: 4px;
|
8
9
|
box-shadow: 1px 0 0 0px $border-color, -1px 0 0 0px $border-color;
|
@@ -95,4 +96,18 @@
|
|
95
96
|
box-shadow: none !important;
|
96
97
|
}
|
97
98
|
}
|
99
|
+
|
100
|
+
&.dark {
|
101
|
+
.bg-row-selection {
|
102
|
+
td:first-child,
|
103
|
+
.sticky-left {
|
104
|
+
background-color: $highlight-dark;
|
105
|
+
}
|
106
|
+
}
|
107
|
+
.virtualized-table-row {
|
108
|
+
&.bg-row-selection td:first-child {
|
109
|
+
background-color: $highlight-dark;
|
110
|
+
}
|
111
|
+
}
|
112
|
+
}
|
98
113
|
}
|
@@ -77,12 +77,12 @@ test('returns correct icon', () => {
|
|
77
77
|
|
78
78
|
expect(screen.getByTestId('test-cell').querySelector('.pb_custom_icon')).toBeInTheDocument()
|
79
79
|
expect(screen.getByTestId('test-home').querySelector('.pb_custom_icon')).toBeInTheDocument()
|
80
|
-
expect(screen.getByTestId('test-work').querySelector('.
|
80
|
+
expect(screen.getByTestId('test-work').querySelector('.pb_custom_icon')).toBeInTheDocument()
|
81
81
|
expect(screen.getByTestId('test-work-cell').querySelector('.pb_custom_icon')).toBeInTheDocument()
|
82
82
|
expect(screen.getByTestId('test-email').querySelector('.pb_custom_icon')).toBeInTheDocument()
|
83
83
|
expect(screen.getByTestId('test-wrong-phone').querySelector('.pb_custom_icon')).toBeInTheDocument()
|
84
84
|
expect(screen.getByTestId('test-wrong-type').querySelector('.pb_custom_icon')).toBeInTheDocument()
|
85
|
-
expect(screen.getByTestId('test-extension').querySelector('.
|
85
|
+
expect(screen.getByTestId('test-extension').querySelector('.pb_custom_icon')).toBeInTheDocument()
|
86
86
|
expect(screen.getByTestId('test-empty').querySelector('.pb_custom_icon')).toBeInTheDocument()
|
87
87
|
})
|
88
88
|
|
@@ -3,8 +3,6 @@ import typography from '../tokens/exports/_typography.module.scss'
|
|
3
3
|
|
4
4
|
import { ThemeProps } from './themeTypes'
|
5
5
|
|
6
|
-
import { PlotTreemapOptions } from "highcharts";
|
7
|
-
|
8
6
|
const highchartsDarkTheme: ThemeProps = {
|
9
7
|
lang: {
|
10
8
|
thousandsSep: ',',
|
@@ -166,43 +164,7 @@ const highchartsDarkTheme: ThemeProps = {
|
|
166
164
|
marker: {
|
167
165
|
lineColor: colors.border_dark,
|
168
166
|
},
|
169
|
-
}
|
170
|
-
|
171
|
-
//TREEMAP CHART STYLES
|
172
|
-
treemap: {
|
173
|
-
layoutAlgorithm: "squarified",
|
174
|
-
allowTraversingTree: false,
|
175
|
-
animationLimit: 1000,
|
176
|
-
colors: [
|
177
|
-
colors.data_1,
|
178
|
-
colors.data_2,
|
179
|
-
colors.data_3,
|
180
|
-
colors.data_4,
|
181
|
-
colors.data_5,
|
182
|
-
colors.data_6,
|
183
|
-
colors.data_7,
|
184
|
-
colors.data_8,
|
185
|
-
],
|
186
|
-
dataLabels: {
|
187
|
-
enabled: true,
|
188
|
-
style: {
|
189
|
-
fontFamily: typography.font_family_base,
|
190
|
-
fontWeight: typography.bold,
|
191
|
-
fontSize: typography.heading_4,
|
192
|
-
},
|
193
|
-
},
|
194
|
-
levels: [
|
195
|
-
{
|
196
|
-
level: 1,
|
197
|
-
dataLabels: {
|
198
|
-
enabled: false,
|
199
|
-
},
|
200
|
-
},
|
201
|
-
],
|
202
|
-
traverseUpButton: {
|
203
|
-
position: { y: -50 },
|
204
|
-
},
|
205
|
-
} as PlotTreemapOptions,
|
167
|
+
}
|
206
168
|
},
|
207
169
|
credits: {
|
208
170
|
enabled: false
|
@@ -3,8 +3,6 @@ import typography from '../tokens/exports/_typography.module.scss'
|
|
3
3
|
|
4
4
|
import { ThemeProps } from './themeTypes'
|
5
5
|
|
6
|
-
import { PlotTreemapOptions } from "highcharts";
|
7
|
-
|
8
6
|
const highchartsTheme: ThemeProps = {
|
9
7
|
lang: {
|
10
8
|
thousandsSep: ',',
|
@@ -165,43 +163,7 @@ const highchartsTheme: ThemeProps = {
|
|
165
163
|
marker: {
|
166
164
|
lineColor: '#333',
|
167
165
|
},
|
168
|
-
}
|
169
|
-
|
170
|
-
//TREEMAP CHART STYLES
|
171
|
-
treemap: {
|
172
|
-
layoutAlgorithm: "squarified",
|
173
|
-
allowTraversingTree: false,
|
174
|
-
animationLimit: 1000,
|
175
|
-
colors: [
|
176
|
-
colors.data_1,
|
177
|
-
colors.data_2,
|
178
|
-
colors.data_3,
|
179
|
-
colors.data_4,
|
180
|
-
colors.data_5,
|
181
|
-
colors.data_6,
|
182
|
-
colors.data_7,
|
183
|
-
colors.data_8,
|
184
|
-
],
|
185
|
-
dataLabels: {
|
186
|
-
enabled: true,
|
187
|
-
style: {
|
188
|
-
fontFamily: typography.font_family_base,
|
189
|
-
fontWeight: typography.bold,
|
190
|
-
fontSize: typography.heading_4,
|
191
|
-
},
|
192
|
-
},
|
193
|
-
levels: [
|
194
|
-
{
|
195
|
-
level: 1,
|
196
|
-
dataLabels: {
|
197
|
-
enabled: false,
|
198
|
-
},
|
199
|
-
},
|
200
|
-
],
|
201
|
-
traverseUpButton: {
|
202
|
-
position: { y: -50 },
|
203
|
-
},
|
204
|
-
} as PlotTreemapOptions,
|
166
|
+
}
|
205
167
|
},
|
206
168
|
credits: {
|
207
169
|
enabled: false
|
@@ -58,12 +58,12 @@ function FilterTest(props) {
|
|
58
58
|
}
|
59
59
|
|
60
60
|
test("triggers popover on filter button click", () => {
|
61
|
-
render(<FilterTest data={{ testid: "render-test" }}/>);
|
61
|
+
const { container } = render(<FilterTest data={{ testid: "render-test" }}/>);
|
62
62
|
|
63
63
|
const btn = screen.getAllByRole("button")[0];
|
64
64
|
|
65
65
|
// checks if the sort menu rendered
|
66
|
-
expect(
|
66
|
+
expect(container.querySelector('.pb_custom_icon')).toBeInTheDocument()
|
67
67
|
expect(screen.getByText('Popularity')).toBeInTheDocument() // check if filter/sort is rendered
|
68
68
|
|
69
69
|
// hits the filter button and triggers popover
|
@@ -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[id="${colId}"]`);
|
108
|
-
const cells = document.querySelectorAll(`td[id="${colId}"]`);
|
107
|
+
const header = document.querySelector(`th[data-sticky-id="${colId}"]`);
|
108
|
+
const cells = document.querySelectorAll(`td[data-sticky-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[id="${colId}"]`);
|
159
|
-
const cells = document.querySelectorAll(`td[id="${colId}"]`);
|
158
|
+
const header = document.querySelector(`th[data-sticky-id="${colId}"]`);
|
159
|
+
const cells = document.querySelectorAll(`td[data-sticky-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 id="a">{'Column 1'}</th>
|
14
|
+
<th data-sticky-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 id="b">{'Column 15'}</th>
|
28
|
+
<th data-sticky-id="b">{'Column 15'}</th>
|
29
29
|
</tr>
|
30
30
|
</thead>
|
31
31
|
<tbody>
|
32
32
|
<tr>
|
33
|
-
<td id="a">{'Value 1'}</td>
|
33
|
+
<td data-sticky-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 id="b">{'Value 15'}</td>
|
47
|
+
<td data-sticky-id="b">{'Value 15'}</td>
|
48
48
|
</tr>
|
49
49
|
<tr>
|
50
|
-
<td id="a">{'Value 1'}</td>
|
50
|
+
<td data-sticky-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 id="b">{'Value 15'}</td>
|
64
|
+
<td data-sticky-id="b">{'Value 15'}</td>
|
65
65
|
</tr>
|
66
66
|
<tr>
|
67
|
-
<td id="a">{'Value 1'}</td>
|
67
|
+
<td data-sticky-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 id="b">{'Value 15'}</td>
|
81
|
+
<td data-sticky-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 `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.
|
@@ -10,9 +10,9 @@ const TableStickyLeftColumns = () => {
|
|
10
10
|
>
|
11
11
|
<thead>
|
12
12
|
<tr>
|
13
|
-
<th id="1">{'Column 1'}</th>
|
14
|
-
<th id="2">{'Column 2'}</th>
|
15
|
-
<th id="3">{'Column 3'}</th>
|
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>
|
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 id="1">{'Value 1'}</td>
|
33
|
-
<td id="2">{'Value 2'}</td>
|
34
|
-
<td id="3">{'Value 3'}</td>
|
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>
|
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 id="1">{'Value 1'}</td>
|
50
|
-
<td id="2">{'Value 2'}</td>
|
51
|
-
<td id="3">{'Value 3'}</td>
|
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>
|
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 id="1">{'Value 1'}</td>
|
67
|
-
<td id="2">{'Value 2'}</td>
|
68
|
-
<td id="3">{'Value 3'}</td>
|
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>
|
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 `data-sticky-id`s you want to be sticky. Make sure to add the corresponding `data-sticky-id` to the `<th>` and `<td>`.
|
2
2
|
|
3
|
-
If you are using the sub-component variant, then you will pass the id to `<Table.Header>` and `<Table.Cell>`
|
3
|
+
If you are using the sub-component variant, then you will pass the `data-sticky-id` to `<Table.Header>` and `<Table.Cell>`
|
4
4
|
|
5
|
-
Please ensure that unique
|
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.
|
@@ -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 id="13">{'Column 13'}</th>
|
26
|
-
<th id="14">{'Column 14'}</th>
|
27
|
-
<th id="15">{'Column 15'}</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>
|
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 id="13">{'Value 13'}</td>
|
45
|
-
<td id="14">{'Value 14'}</td>
|
46
|
-
<td id="15">{'Value 15'}</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>
|
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 id="13">{'Value 13'}</td>
|
62
|
-
<td id="14">{'Value 14'}</td>
|
63
|
-
<td id="15">{'Value 15'}</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>
|
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 id="13">{'Value 13'}</td>
|
79
|
-
<td id="14">{'Value 14'}</td>
|
80
|
-
<td id="15">{'Value 15'}</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>
|
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 `data-sticky-id`s you want to be sticky. Make sure to add the corresponding `data-sticky-id` to the `<th>` and `<td>`.
|
2
2
|
|
3
|
-
If you are using the sub-component variant, then you will pass the id to `<Table.Header>` and `<Table.Cell>`
|
3
|
+
If you are using the sub-component variant, then you will pass the `data-sticky-id` to `<Table.Header>` and `<Table.Cell>`
|
4
4
|
|
5
|
-
Please ensure that unique
|
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.
|
@@ -22,6 +22,10 @@
|
|
22
22
|
border-radius: 0 4px 0 0;
|
23
23
|
border-width: 1px 1px 1px 0;
|
24
24
|
}
|
25
|
+
&:only-child {
|
26
|
+
border-radius: 4px 4px 0 0;
|
27
|
+
border-width: 1px 1px 1px 1px;
|
28
|
+
}
|
25
29
|
}
|
26
30
|
}
|
27
31
|
}
|
@@ -39,6 +43,9 @@
|
|
39
43
|
&:last-child {
|
40
44
|
border-width: 0 1px 1px 0;
|
41
45
|
}
|
46
|
+
&:only-child {
|
47
|
+
border-width: 0 1px 1px 1px;
|
48
|
+
}
|
42
49
|
}
|
43
50
|
|
44
51
|
&:last-child {
|
@@ -53,6 +60,10 @@
|
|
53
60
|
border-radius: 0 0 4px 0;
|
54
61
|
border-width: 0 1px 1px 0;
|
55
62
|
}
|
63
|
+
&:only-child {
|
64
|
+
border-radius: 0 0 4px 4px;
|
65
|
+
border-width: 0 1px 1px 1px;
|
66
|
+
}
|
56
67
|
}
|
57
68
|
}
|
58
69
|
}
|
@@ -9,6 +9,7 @@ import {
|
|
9
9
|
shift,
|
10
10
|
useFloating,
|
11
11
|
useHover,
|
12
|
+
useClick,
|
12
13
|
useInteractions,
|
13
14
|
} from "@floating-ui/react"
|
14
15
|
|
@@ -23,6 +24,7 @@ type TooltipProps = {
|
|
23
24
|
aria?: { [key: string]: string },
|
24
25
|
className?: string | string[],
|
25
26
|
children: JSX.Element,
|
27
|
+
useClickToOpen?: boolean,
|
26
28
|
data?: { [key: string]: string },
|
27
29
|
delay?: number | Partial<{open: number; close: number}>,
|
28
30
|
height?: string,
|
@@ -46,6 +48,7 @@ const Tooltip = forwardRef((props: TooltipProps, ref: ForwardedRef<unknown>): Re
|
|
46
48
|
aria = {},
|
47
49
|
className,
|
48
50
|
children,
|
51
|
+
useClickToOpen = false,
|
49
52
|
data = {},
|
50
53
|
delay = 0,
|
51
54
|
height,
|
@@ -110,14 +113,21 @@ const Tooltip = forwardRef((props: TooltipProps, ref: ForwardedRef<unknown>): Re
|
|
110
113
|
placement: preferredPlacement
|
111
114
|
})
|
112
115
|
|
116
|
+
const hover = useHover(context, {
|
117
|
+
delay,
|
118
|
+
handleClose: interaction ? safePolygon({
|
119
|
+
blockPointerEvents: false
|
120
|
+
}) : null,
|
121
|
+
enabled: !useClickToOpen // Disable hover when useClickToOpen is true
|
122
|
+
})
|
123
|
+
|
124
|
+
const click = useClick(context, {
|
125
|
+
enabled: useClickToOpen // Only enable click when useClickToOpen is true
|
126
|
+
})
|
113
127
|
|
114
|
-
const { getFloatingProps } = useInteractions([
|
115
|
-
|
116
|
-
|
117
|
-
handleClose: interaction ? safePolygon({
|
118
|
-
blockPointerEvents: false
|
119
|
-
}) : null
|
120
|
-
})
|
128
|
+
const { getFloatingProps, getReferenceProps } = useInteractions([
|
129
|
+
hover,
|
130
|
+
click
|
121
131
|
])
|
122
132
|
|
123
133
|
const staticSide = {
|
@@ -142,22 +152,24 @@ const Tooltip = forwardRef((props: TooltipProps, ref: ForwardedRef<unknown>): Re
|
|
142
152
|
return (
|
143
153
|
<>
|
144
154
|
<div
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
if (
|
150
|
-
ref
|
151
|
-
|
152
|
-
ref
|
155
|
+
{...getReferenceProps({
|
156
|
+
className: `pb_tooltip_kit ${css}`,
|
157
|
+
ref: (element) => {
|
158
|
+
refs.setReference(element);
|
159
|
+
if (ref) {
|
160
|
+
if (typeof ref === "function") {
|
161
|
+
ref(element);
|
162
|
+
} else if (typeof ref === "object") {
|
163
|
+
ref.current = element;
|
164
|
+
}
|
153
165
|
}
|
154
|
-
}
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
166
|
+
},
|
167
|
+
role: "tooltip_trigger",
|
168
|
+
style: { display: "inline-block" },
|
169
|
+
...ariaProps,
|
170
|
+
...dataProps,
|
171
|
+
...htmlProps,
|
172
|
+
})}
|
161
173
|
>
|
162
174
|
{children}
|
163
175
|
</div>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import Button from '../../pb_button/_button'
|
3
|
+
import Tooltip from '../_tooltip'
|
4
|
+
import Flex from '../../pb_flex/_flex'
|
5
|
+
|
6
|
+
const TooltipClickOpen = (props) => {
|
7
|
+
return (
|
8
|
+
<Flex flexDirection='row'
|
9
|
+
gap='md'
|
10
|
+
wrap
|
11
|
+
>
|
12
|
+
<Tooltip
|
13
|
+
placement='top'
|
14
|
+
text='Tooltip Opened'
|
15
|
+
useClickToOpen
|
16
|
+
zIndex={10}
|
17
|
+
{...props}
|
18
|
+
>
|
19
|
+
<Button text='Click to Open' />
|
20
|
+
</Tooltip>
|
21
|
+
</Flex>
|
22
|
+
)
|
23
|
+
}
|
24
|
+
|
25
|
+
export default TooltipClickOpen
|
@@ -0,0 +1 @@
|
|
1
|
+
Set the prop `useClickToOpen` so that the tooltip will only appear when an item is clicked rather than hovered over.
|
@@ -5,3 +5,4 @@ export { default as TooltipSizing } from './_tooltip_sizing'
|
|
5
5
|
export { default as TooltipIcon } from './_tooltip_icon'
|
6
6
|
export { default as TooltipDelay } from './_tooltip_delay'
|
7
7
|
export { default as TooltipShowTooltipReact } from './_tooltip_show_tooltip_react'
|
8
|
+
export { default as TooltipClickOpen } from './_tooltip_click_open'
|