playbook_ui 14.11.0.pre.rc.5 → 14.11.0.pre.rc.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.scss +1 -13
- data/app/pb_kits/playbook/pb_section_separator/_section_separator.scss +60 -0
- data/app/pb_kits/playbook/pb_section_separator/_section_separator.tsx +3 -1
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_color.html.erb +10 -0
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_color.jsx +42 -0
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_color.md +3 -0
- data/app/pb_kits/playbook/pb_section_separator/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_section_separator/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_section_separator/section_separator.rb +4 -1
- data/app/pb_kits/playbook/pb_table/_table.tsx +67 -18
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns.jsx +88 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns_react.md +3 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns.jsx +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns_rails.md +2 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns_react.md +4 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns.jsx +87 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns_react.md +5 -0
- data/app/pb_kits/playbook/pb_table/index.ts +17 -17
- data/app/pb_kits/playbook/pb_table/styles/_scroll.scss +18 -2
- data/app/pb_kits/playbook/pb_table/styles/_sticky_columns.scss +17 -3
- data/dist/chunks/{_typeahead-BXXEtXbz.js → _typeahead-gJLWiR0r.js} +2 -2
- data/dist/chunks/_weekday_stacked-7XLAG_Yz.js +45 -0
- data/dist/chunks/{lib-sMFo2JZy.js → lib-B7sgJtGS.js} +1 -1
- data/dist/chunks/{pb_form_validation-CgvjWbOK.js → pb_form_validation-C5Cc0-1v.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/playbook-doc.js +1 -1
- 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 +12 -5
- data/dist/chunks/_weekday_stacked-D0yBvHBb.js +0 -45
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a51bf0c8f5dfdb651880e4544548c9c67a106549d4c4d94a726cbdcbaa41b8a
|
4
|
+
data.tar.gz: 5f403c3864bb357c4e2f93c55fdbcdfe1c4fba6e6be6c7780559798c48d2bc7e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d73014d82ad3ff494e9e482b9d01f6cecd0b8b87bb80d2af581e9b9ab336d9c18a9640aeba052aa2f6a8a011632457efc34fc54d1b7af5110f1b995d71d94594
|
7
|
+
data.tar.gz: 7820f011695d249d5ab5da5b6d29b57002434d10e3c49a2faeb2f2bdcef446244bc70cc392c9f6bbabf9f965c1c7162cdb55d1435ffc850a6c87da74d9ac709b
|
@@ -14,16 +14,6 @@ $pb_icon_circle_sizes: (
|
|
14
14
|
"xl": 100px,
|
15
15
|
);
|
16
16
|
|
17
|
-
@mixin svg_size($name, $match, $adjust) {
|
18
|
-
@if $name == $match {
|
19
|
-
$svg_xy: $adjust;
|
20
|
-
& > svg {
|
21
|
-
width: #{$svg_xy};
|
22
|
-
height: #{$svg_xy};
|
23
|
-
}
|
24
|
-
}
|
25
|
-
}
|
26
|
-
|
27
17
|
[class^=pb_icon_circle_kit] {
|
28
18
|
display: flex;
|
29
19
|
justify-content: center;
|
@@ -57,13 +47,11 @@ $pb_icon_circle_sizes: (
|
|
57
47
|
border-radius: $size/2;
|
58
48
|
background: $silver;
|
59
49
|
color: $text_lt_light;
|
60
|
-
font-size: $size * 0.38;
|
50
|
+
font-size: if($name == "xxs", $size - 6px, $size * 0.38);
|
61
51
|
line-height: $size;
|
62
52
|
flex-shrink: 0;
|
63
53
|
flex-grow: 0;
|
64
54
|
flex-basis: $size;
|
65
|
-
|
66
|
-
@include svg_size($name, "xxs", $size - 6px);
|
67
55
|
}
|
68
56
|
}
|
69
57
|
|
@@ -3,6 +3,11 @@
|
|
3
3
|
@import "../tokens/opacity";
|
4
4
|
@import "./section_separator_mixin";
|
5
5
|
|
6
|
+
$merge_kits1: map-merge($status_colors, $category_colors);
|
7
|
+
$merge_kits2: map-merge($merge_kits1, $product_colors);
|
8
|
+
$merge_kits3: map-merge($merge_kits2, $text_colors);
|
9
|
+
$section_selector_colors: map-merge($merge_kits3, $data_colors);
|
10
|
+
|
6
11
|
$section_colors_light: (
|
7
12
|
background: $bg_light,
|
8
13
|
card: $card_light,
|
@@ -37,12 +42,40 @@ $section_colors_dark: (
|
|
37
42
|
flex: 1;
|
38
43
|
@include section_separator_horizontal;
|
39
44
|
}
|
45
|
+
@each $color_name, $color_value in $section_selector_colors {
|
46
|
+
&[class*="color_#{$color_name}"] {
|
47
|
+
&::before, &::after {
|
48
|
+
background: $color_value;
|
49
|
+
}
|
50
|
+
|
51
|
+
&[class*=_vertical] {
|
52
|
+
&::after {
|
53
|
+
background: $color_value;
|
54
|
+
}
|
55
|
+
}
|
56
|
+
&[class*=_dashed] {
|
57
|
+
&::before, &::after {
|
58
|
+
border: 1px dashed $color_value;
|
59
|
+
}
|
60
|
+
&[class*=_vertical] {
|
61
|
+
&::after {
|
62
|
+
border: 1px dashed $color_value;
|
63
|
+
background: none;
|
64
|
+
}
|
65
|
+
}
|
66
|
+
}
|
67
|
+
}
|
68
|
+
}
|
69
|
+
|
40
70
|
&[class*=_horizontal] {
|
41
71
|
justify-content: center;
|
42
72
|
}
|
43
73
|
&[class*=_vertical] {
|
44
74
|
margin-left: $space_xs;
|
45
75
|
margin-right: $space_xs;
|
76
|
+
&::before {
|
77
|
+
display: none;
|
78
|
+
}
|
46
79
|
&::after {
|
47
80
|
@include section_separator_vertical(false);
|
48
81
|
}
|
@@ -57,6 +90,33 @@ $section_colors_dark: (
|
|
57
90
|
// Dark =========================
|
58
91
|
|
59
92
|
&.dark {
|
93
|
+
@each $color_name, $color_value in $section_selector_colors {
|
94
|
+
&[class*="color_#{$color_name}"] {
|
95
|
+
&::before, &::after {
|
96
|
+
background: $color_value;
|
97
|
+
}
|
98
|
+
|
99
|
+
&[class*=_vertical] {
|
100
|
+
&::after {
|
101
|
+
@include section_separator_vertical(false);
|
102
|
+
background: $color_value;
|
103
|
+
}
|
104
|
+
}
|
105
|
+
|
106
|
+
&[class*=_dashed] {
|
107
|
+
&::before, &::after {
|
108
|
+
border: 1px dashed $color_value;
|
109
|
+
background: none;
|
110
|
+
}
|
111
|
+
&[class*=_vertical] {
|
112
|
+
&::after {
|
113
|
+
border: 1px dashed $color_value;
|
114
|
+
background: none;
|
115
|
+
}
|
116
|
+
}
|
117
|
+
}
|
118
|
+
}
|
119
|
+
}
|
60
120
|
&::before {
|
61
121
|
@include section_separator_horizontal(true);
|
62
122
|
}
|
@@ -10,6 +10,7 @@ type SectionSeparatorProps = {
|
|
10
10
|
aria?: { [key: string]: string; },
|
11
11
|
children?: React.ReactChild[] | React.ReactChild,
|
12
12
|
className?: string,
|
13
|
+
color?: "default" | "primary",
|
13
14
|
dark?: boolean,
|
14
15
|
data?: { [key: string]: string; },
|
15
16
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
@@ -25,6 +26,7 @@ const SectionSeparator = (props: SectionSeparatorProps): React.ReactElement => {
|
|
25
26
|
aria = {},
|
26
27
|
children,
|
27
28
|
className,
|
29
|
+
color ="default",
|
28
30
|
data = {},
|
29
31
|
htmlOptions = {},
|
30
32
|
id,
|
@@ -37,7 +39,7 @@ const SectionSeparator = (props: SectionSeparatorProps): React.ReactElement => {
|
|
37
39
|
const ariaProps = buildAriaProps(aria)
|
38
40
|
const dataProps = buildDataProps(data)
|
39
41
|
const htmlProps = buildHtmlProps(htmlOptions)
|
40
|
-
const classes = classnames(buildCss('pb_section_separator_kit', variant, orientation, lineStyle === "dashed" ? lineStyle : ""), globalProps(props), className)
|
42
|
+
const classes = classnames(buildCss('pb_section_separator_kit', variant, orientation, lineStyle === "dashed" ? lineStyle : "", color !== "default" ? `color_${color}` : ''), globalProps(props), className)
|
41
43
|
const dynamicInlineProps = globalInlineProps(props)
|
42
44
|
|
43
45
|
return (
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<%= pb_rails("section_separator", props: { text: "Default Separator" }) %>
|
2
|
+
<%= pb_rails("section_separator", props: { color: "primary", text: "Primary Separator" }) %>
|
3
|
+
<%= pb_rails("section_separator", props: { color: "primary", line_style: "dashed", text: "Primary Dashed Separator" }) %>
|
4
|
+
<%= pb_rails("section_separator", props: { color: "primary" }) do %>
|
5
|
+
<%= pb_rails("flex", props: { padding: "xs" }) do %>
|
6
|
+
<%= pb_rails("icon", props: { color: "primary", icon: "arrow-down" }) %>
|
7
|
+
<%= pb_rails("detail", props: { text: "Children", size: "sm", color: "link" }) %>
|
8
|
+
<% end %>
|
9
|
+
<% end %>
|
10
|
+
|
@@ -0,0 +1,42 @@
|
|
1
|
+
import React from "react"
|
2
|
+
import { SectionSeparator, Flex, Detail, Icon } from "playbook-ui"
|
3
|
+
|
4
|
+
const children = (
|
5
|
+
<Flex padding="xs">
|
6
|
+
<Icon color="primary"
|
7
|
+
icon="arrow-down"
|
8
|
+
/>
|
9
|
+
<Detail
|
10
|
+
color="link"
|
11
|
+
size="sm"
|
12
|
+
text="Children"
|
13
|
+
/>
|
14
|
+
</Flex>
|
15
|
+
)
|
16
|
+
|
17
|
+
const SectionSeparatorColor = (props) => {
|
18
|
+
return (
|
19
|
+
<div>
|
20
|
+
<SectionSeparator text="Default Separator"
|
21
|
+
{...props}
|
22
|
+
/>
|
23
|
+
<SectionSeparator color="primary"
|
24
|
+
text="Primary Separator"
|
25
|
+
{...props}
|
26
|
+
/>
|
27
|
+
<SectionSeparator
|
28
|
+
color="primary"
|
29
|
+
lineStyle="dashed"
|
30
|
+
text="Primary Dashed Separator"
|
31
|
+
{...props}
|
32
|
+
/>
|
33
|
+
<SectionSeparator color="primary"
|
34
|
+
{...props}
|
35
|
+
>
|
36
|
+
{children}
|
37
|
+
</SectionSeparator>
|
38
|
+
</div>
|
39
|
+
)
|
40
|
+
}
|
41
|
+
|
42
|
+
export default SectionSeparatorColor
|
@@ -0,0 +1,3 @@
|
|
1
|
+
Pass "primary" to the `color` prop to change any section separator color.
|
2
|
+
|
3
|
+
**NOTE:** Passing `children` overrides any content provided via the `text` prop. The `color` prop does not affect the `text` prop's color, and the color of `children` is determined by the children's individual props. For greater control over text color customization, consider using a separator with `children`.
|
@@ -6,6 +6,7 @@ examples:
|
|
6
6
|
- section_separator_text: Text Separator
|
7
7
|
- section_separator_vertical: Vertical
|
8
8
|
- section_separator_children: Children
|
9
|
+
- section_separator_color: Color
|
9
10
|
|
10
11
|
react:
|
11
12
|
- section_separator_line: Line Separator
|
@@ -13,6 +14,7 @@ examples:
|
|
13
14
|
- section_separator_text: Text Separator
|
14
15
|
- section_separator_vertical: Vertical
|
15
16
|
- section_separator_children: Children
|
17
|
+
- section_separator_color: Color
|
16
18
|
|
17
19
|
swift:
|
18
20
|
- section_separator_line_swift: Line Separator
|
@@ -3,3 +3,4 @@ export { default as SectionSeparatorText } from './_section_separator_text.jsx'
|
|
3
3
|
export { default as SectionSeparatorVertical } from './_section_separator_vertical.jsx'
|
4
4
|
export { default as SectionSeparatorDashed } from './_section_separator_dashed.jsx'
|
5
5
|
export { default as SectionSeparatorChildren } from './_section_separator_children.jsx'
|
6
|
+
export { default as SectionSeparatorColor } from './_section_separator_color.jsx'
|
@@ -3,6 +3,9 @@
|
|
3
3
|
module Playbook
|
4
4
|
module PbSectionSeparator
|
5
5
|
class SectionSeparator < Playbook::KitBase
|
6
|
+
prop :color, type: Playbook::Props::Enum,
|
7
|
+
values: %w[default primary],
|
8
|
+
default: "default"
|
6
9
|
prop :text
|
7
10
|
prop :variant, type: Playbook::Props::Enum,
|
8
11
|
values: %w[card background],
|
@@ -17,7 +20,7 @@ module Playbook
|
|
17
20
|
default: "solid"
|
18
21
|
|
19
22
|
def classname
|
20
|
-
generate_classname("pb_section_separator_kit", variant, orientation, line_style == "dashed" ? "dashed" : nil)
|
23
|
+
generate_classname("pb_section_separator_kit", variant, orientation, line_style == "dashed" ? "dashed" : nil, color != "default" ? "color_#{color}" : nil)
|
21
24
|
end
|
22
25
|
|
23
26
|
private
|
@@ -28,7 +28,8 @@ type TableProps = {
|
|
28
28
|
singleLine?: boolean,
|
29
29
|
size?: "sm" | "md" | "lg",
|
30
30
|
sticky?: boolean,
|
31
|
-
|
31
|
+
stickyLeftColumn?: string[],
|
32
|
+
stickyRightColumn?: string[],
|
32
33
|
striped?: boolean,
|
33
34
|
tag?: "table" | "div",
|
34
35
|
verticalBorder?: boolean,
|
@@ -52,7 +53,8 @@ const Table = (props: TableProps): React.ReactElement => {
|
|
52
53
|
singleLine = false,
|
53
54
|
size = 'sm',
|
54
55
|
sticky = false,
|
55
|
-
|
56
|
+
stickyLeftColumn = [],
|
57
|
+
stickyRightColumn= [],
|
56
58
|
striped = false,
|
57
59
|
tag = 'table',
|
58
60
|
verticalBorder = false,
|
@@ -79,7 +81,8 @@ const Table = (props: TableProps): React.ReactElement => {
|
|
79
81
|
'single-line': singleLine,
|
80
82
|
'no-hover': disableHover,
|
81
83
|
'sticky-header': sticky,
|
82
|
-
'sticky-left-column':
|
84
|
+
'sticky-left-column': stickyLeftColumn,
|
85
|
+
'sticky-right-column': stickyRightColumn,
|
83
86
|
'striped': striped,
|
84
87
|
[outerPaddingCss]: outerPadding !== '',
|
85
88
|
},
|
@@ -90,11 +93,12 @@ const Table = (props: TableProps): React.ReactElement => {
|
|
90
93
|
)
|
91
94
|
|
92
95
|
useEffect(() => {
|
93
|
-
const
|
96
|
+
const handleStickyLeftColumns = () => {
|
97
|
+
if (!stickyLeftColumn.length) return;
|
94
98
|
let accumulatedWidth = 0;
|
95
99
|
|
96
|
-
|
97
|
-
const isLastColumn = index ===
|
100
|
+
stickyLeftColumn.forEach((colId, index) => {
|
101
|
+
const isLastColumn = index === stickyLeftColumn.length - 1;
|
98
102
|
const header = document.querySelector(`th[id="${colId}"]`);
|
99
103
|
const cells = document.querySelectorAll(`td[id="${colId}"]`);
|
100
104
|
|
@@ -103,11 +107,11 @@ const Table = (props: TableProps): React.ReactElement => {
|
|
103
107
|
(header as HTMLElement).style.left = `${accumulatedWidth}px`;
|
104
108
|
|
105
109
|
if (!isLastColumn) {
|
106
|
-
header.classList.add('with-border');
|
107
|
-
header.classList.remove('sticky-shadow');
|
110
|
+
header.classList.add('with-border-right');
|
111
|
+
header.classList.remove('sticky-left-shadow');
|
108
112
|
} else {
|
109
|
-
header.classList.remove('with-border');
|
110
|
-
header.classList.add('sticky-shadow');
|
113
|
+
header.classList.remove('with-border-right');
|
114
|
+
header.classList.add('sticky-left-shadow');
|
111
115
|
}
|
112
116
|
|
113
117
|
accumulatedWidth += (header as HTMLElement).offsetWidth;
|
@@ -118,26 +122,71 @@ const Table = (props: TableProps): React.ReactElement => {
|
|
118
122
|
(cell as HTMLElement).style.left = `${accumulatedWidth - (header as HTMLElement).offsetWidth}px`;
|
119
123
|
|
120
124
|
if (!isLastColumn) {
|
121
|
-
cell.classList.add('with-border');
|
122
|
-
cell.classList.remove('sticky-shadow');
|
125
|
+
cell.classList.add('with-border-right');
|
126
|
+
cell.classList.remove('sticky-left-shadow');
|
123
127
|
} else {
|
124
|
-
cell.classList.remove('with-border');
|
125
|
-
cell.classList.add('sticky-shadow');
|
128
|
+
cell.classList.remove('with-border-right');
|
129
|
+
cell.classList.add('sticky-left-shadow');
|
126
130
|
}
|
127
131
|
});
|
128
132
|
});
|
129
133
|
};
|
130
134
|
|
131
135
|
setTimeout(() => {
|
132
|
-
|
136
|
+
handleStickyLeftColumns();
|
133
137
|
}, 10);
|
134
138
|
|
135
|
-
window.addEventListener('resize',
|
139
|
+
window.addEventListener('resize', handleStickyLeftColumns);
|
136
140
|
|
137
141
|
return () => {
|
138
|
-
window.removeEventListener('resize',
|
142
|
+
window.removeEventListener('resize', handleStickyLeftColumns);
|
139
143
|
};
|
140
|
-
}, [
|
144
|
+
}, [stickyLeftColumn]);
|
145
|
+
|
146
|
+
useEffect(() => {
|
147
|
+
const handleStickyRightColumns = () => {
|
148
|
+
if (!stickyRightColumn.length) return;
|
149
|
+
let accumulatedWidth = 0;
|
150
|
+
|
151
|
+
stickyRightColumn.reverse().forEach((colId, index) => {
|
152
|
+
const isLastColumn = index === stickyRightColumn.length - 1;
|
153
|
+
const header = document.querySelector(`th[id="${colId}"]`);
|
154
|
+
const cells = document.querySelectorAll(`td[id="${colId}"]`);
|
155
|
+
|
156
|
+
if (header) {
|
157
|
+
header.classList.add('sticky');
|
158
|
+
(header as HTMLElement).style.right = `${accumulatedWidth}px`;
|
159
|
+
|
160
|
+
if (!isLastColumn) {
|
161
|
+
header.classList.add('with-border-left');
|
162
|
+
header.classList.remove('sticky-right-shadow');
|
163
|
+
} else {
|
164
|
+
header.classList.remove('with-border-left');
|
165
|
+
header.classList.add('sticky-right-shadow');
|
166
|
+
}
|
167
|
+
|
168
|
+
accumulatedWidth += (header as HTMLElement).offsetWidth;
|
169
|
+
}
|
170
|
+
|
171
|
+
cells.forEach((cell) => {
|
172
|
+
cell.classList.add('sticky');
|
173
|
+
(cell as HTMLElement).style.right = `${accumulatedWidth - (header as HTMLElement).offsetWidth}px`;
|
174
|
+
|
175
|
+
if (!isLastColumn) {
|
176
|
+
cell.classList.add('with-border-left');
|
177
|
+
cell.classList.remove('sticky-right-shadow');
|
178
|
+
} else {
|
179
|
+
cell.classList.remove('with-border-left');
|
180
|
+
cell.classList.add('sticky-right-shadow');
|
181
|
+
}
|
182
|
+
});
|
183
|
+
});
|
184
|
+
};
|
185
|
+
|
186
|
+
setTimeout(() => {
|
187
|
+
handleStickyRightColumns();
|
188
|
+
}, 10);
|
189
|
+
}, [stickyRightColumn]);
|
141
190
|
|
142
191
|
useEffect(() => {
|
143
192
|
const instance = new PbTable()
|
@@ -0,0 +1,88 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import Table from '../_table'
|
3
|
+
|
4
|
+
const TableStickyColumns = () => {
|
5
|
+
return (
|
6
|
+
<Table
|
7
|
+
responsive="scroll"
|
8
|
+
size="md"
|
9
|
+
stickyLeftColumn={["a"]}
|
10
|
+
stickyRightColumn={["b"]}
|
11
|
+
>
|
12
|
+
<thead>
|
13
|
+
<tr>
|
14
|
+
<th id="a">{'Column 1'}</th>
|
15
|
+
<th>{'Column 2'}</th>
|
16
|
+
<th>{'Column 3'}</th>
|
17
|
+
<th>{'Column 4'}</th>
|
18
|
+
<th>{'Column 5'}</th>
|
19
|
+
<th>{'Column 6'}</th>
|
20
|
+
<th>{'Column 7'}</th>
|
21
|
+
<th>{'Column 8'}</th>
|
22
|
+
<th>{'Column 9'}</th>
|
23
|
+
<th>{'Column 10'}</th>
|
24
|
+
<th>{'Column 11'}</th>
|
25
|
+
<th>{'Column 12'}</th>
|
26
|
+
<th>{'Column 13'}</th>
|
27
|
+
<th>{'Column 14'}</th>
|
28
|
+
<th id="b">{'Column 15'}</th>
|
29
|
+
</tr>
|
30
|
+
</thead>
|
31
|
+
<tbody>
|
32
|
+
<tr>
|
33
|
+
<td id="a">{'Value 1'}</td>
|
34
|
+
<td>{'Value 2'}</td>
|
35
|
+
<td>{'Value 3'}</td>
|
36
|
+
<td>{'Value 4'}</td>
|
37
|
+
<td>{'Value 5'}</td>
|
38
|
+
<td>{'Value 6'}</td>
|
39
|
+
<td>{'Value 7'}</td>
|
40
|
+
<td>{'Value 8'}</td>
|
41
|
+
<td>{'Value 9'}</td>
|
42
|
+
<td>{'Value 10'}</td>
|
43
|
+
<td>{'Value 11'}</td>
|
44
|
+
<td>{'Value 12'}</td>
|
45
|
+
<td>{'Value 13'}</td>
|
46
|
+
<td>{'Value 14'}</td>
|
47
|
+
<td id="b">{'Value 15'}</td>
|
48
|
+
</tr>
|
49
|
+
<tr>
|
50
|
+
<td id="a">{'Value 1'}</td>
|
51
|
+
<td>{'Value 2'}</td>
|
52
|
+
<td>{'Value 3'}</td>
|
53
|
+
<td>{'Value 4'}</td>
|
54
|
+
<td>{'Value 5'}</td>
|
55
|
+
<td>{'Value 6'}</td>
|
56
|
+
<td>{'Value 7'}</td>
|
57
|
+
<td>{'Value 8'}</td>
|
58
|
+
<td>{'Value 9'}</td>
|
59
|
+
<td>{'Value 10'}</td>
|
60
|
+
<td>{'Value 11'}</td>
|
61
|
+
<td>{'Value 12'}</td>
|
62
|
+
<td>{'Value 13'}</td>
|
63
|
+
<td>{'Value 14'}</td>
|
64
|
+
<td id="b">{'Value 15'}</td>
|
65
|
+
</tr>
|
66
|
+
<tr>
|
67
|
+
<td id="a">{'Value 1'}</td>
|
68
|
+
<td>{'Value 2'}</td>
|
69
|
+
<td>{'Value 3'}</td>
|
70
|
+
<td>{'Value 4'}</td>
|
71
|
+
<td>{'Value 5'}</td>
|
72
|
+
<td>{'Value 6'}</td>
|
73
|
+
<td>{'Value 7'}</td>
|
74
|
+
<td>{'Value 8'}</td>
|
75
|
+
<td>{'Value 9'}</td>
|
76
|
+
<td>{'Value 10'}</td>
|
77
|
+
<td>{'Value 11'}</td>
|
78
|
+
<td>{'Value 12'}</td>
|
79
|
+
<td>{'Value 13'}</td>
|
80
|
+
<td>{'Value 14'}</td>
|
81
|
+
<td id="b">{'Value 15'}</td>
|
82
|
+
</tr>
|
83
|
+
</tbody>
|
84
|
+
</Table>
|
85
|
+
)
|
86
|
+
}
|
87
|
+
|
88
|
+
export default TableStickyColumns
|
@@ -1 +1,3 @@
|
|
1
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
|
+
|
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 the `stickyLeftColumn`.
|
@@ -1,2 +1,5 @@
|
|
1
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 id to `<Table.Header>` and `<Table.Cell>`
|
4
|
+
|
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.
|
@@ -0,0 +1,87 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import Table from '../_table'
|
3
|
+
|
4
|
+
const TableStickyRightColumns = () => {
|
5
|
+
return (
|
6
|
+
<Table
|
7
|
+
responsive="scroll"
|
8
|
+
size="md"
|
9
|
+
stickyRightColumn={["13", "14", "15"]}
|
10
|
+
>
|
11
|
+
<thead>
|
12
|
+
<tr>
|
13
|
+
<th>{'Column 1'}</th>
|
14
|
+
<th>{'Column 2'}</th>
|
15
|
+
<th>{'Column 3'}</th>
|
16
|
+
<th>{'Column 4'}</th>
|
17
|
+
<th>{'Column 5'}</th>
|
18
|
+
<th>{'Column 6'}</th>
|
19
|
+
<th>{'Column 7'}</th>
|
20
|
+
<th>{'Column 8'}</th>
|
21
|
+
<th>{'Column 9'}</th>
|
22
|
+
<th>{'Column 10'}</th>
|
23
|
+
<th>{'Column 11'}</th>
|
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>
|
28
|
+
</tr>
|
29
|
+
</thead>
|
30
|
+
<tbody>
|
31
|
+
<tr>
|
32
|
+
<td>{'Value 1'}</td>
|
33
|
+
<td>{'Value 2'}</td>
|
34
|
+
<td>{'Value 3'}</td>
|
35
|
+
<td>{'Value 4'}</td>
|
36
|
+
<td>{'Value 5'}</td>
|
37
|
+
<td>{'Value 6'}</td>
|
38
|
+
<td>{'Value 7'}</td>
|
39
|
+
<td>{'Value 8'}</td>
|
40
|
+
<td>{'Value 9'}</td>
|
41
|
+
<td>{'Value 10'}</td>
|
42
|
+
<td>{'Value 11'}</td>
|
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>
|
47
|
+
</tr>
|
48
|
+
<tr>
|
49
|
+
<td>{'Value 1'}</td>
|
50
|
+
<td>{'Value 2'}</td>
|
51
|
+
<td>{'Value 3'}</td>
|
52
|
+
<td>{'Value 4'}</td>
|
53
|
+
<td>{'Value 5'}</td>
|
54
|
+
<td>{'Value 6'}</td>
|
55
|
+
<td>{'Value 7'}</td>
|
56
|
+
<td>{'Value 8'}</td>
|
57
|
+
<td>{'Value 9'}</td>
|
58
|
+
<td>{'Value 10'}</td>
|
59
|
+
<td>{'Value 11'}</td>
|
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>
|
64
|
+
</tr>
|
65
|
+
<tr>
|
66
|
+
<td>{'Value 1'}</td>
|
67
|
+
<td>{'Value 2'}</td>
|
68
|
+
<td>{'Value 3'}</td>
|
69
|
+
<td>{'Value 4'}</td>
|
70
|
+
<td>{'Value 5'}</td>
|
71
|
+
<td>{'Value 6'}</td>
|
72
|
+
<td>{'Value 7'}</td>
|
73
|
+
<td>{'Value 8'}</td>
|
74
|
+
<td>{'Value 9'}</td>
|
75
|
+
<td>{'Value 10'}</td>
|
76
|
+
<td>{'Value 11'}</td>
|
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>
|
81
|
+
</tr>
|
82
|
+
</tbody>
|
83
|
+
</Table>
|
84
|
+
)
|
85
|
+
}
|
86
|
+
|
87
|
+
export default TableStickyRightColumns
|
@@ -0,0 +1,5 @@
|
|
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
|
+
|
3
|
+
If you are using the sub-component variant, then you will pass the id to `<Table.Header>` and `<Table.Cell>`
|
4
|
+
|
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.
|