playbook_ui_docs 13.19.0.pre.alpha.PBNTR200addadvancedtablekitdarkmodestyles2346 → 13.19.0.pre.alpha.PBNTR207tabledivsupport2245
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_advanced_table/docs/_advanced_table_collapsible_trail.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_default.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_loading.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_subrow_headers.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_options.md +1 -1
- data/app/pb_kits/playbook/pb_icon/docs/_icon_custom.html.erb +11 -5
- data/app/pb_kits/playbook/pb_icon/docs/_icon_custom.jsx +18 -44
- data/app/pb_kits/playbook/pb_icon/docs/_icon_custom.md +8 -4
- data/app/pb_kits/playbook/pb_table/docs/_table_div.html.erb +26 -26
- data/app/pb_kits/playbook/pb_table/docs/_table_div.jsx +26 -27
- data/app/pb_kits/playbook/pb_table/docs/example.yml +2 -5
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_add_on.jsx +0 -20
- data/app/pb_kits/playbook/pb_user/docs/_user_props_table.md +1 -2
- data/app/pb_kits/playbook/pb_user/docs/example.yml +0 -1
- data/dist/playbook-doc.js +4 -4
- metadata +2 -7
- data/app/pb_kits/playbook/pb_table/docs/_table_with_subcomponents.html.erb +0 -34
- data/app/pb_kits/playbook/pb_table/docs/_table_with_subcomponents.md +0 -7
- data/app/pb_kits/playbook/pb_table/docs/_table_with_subcomponents_as_divs.html.erb +0 -34
- data/app/pb_kits/playbook/pb_table/docs/_table_with_subcomponents_as_divs.md +0 -3
- data/app/pb_kits/playbook/pb_user/docs/_user_presence_indicator_swift.md +0 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f46c37c2eca826cb24861f95445c890d8d4ad23323dae2bf2bc20da61550f18
|
4
|
+
data.tar.gz: a9bb15e4be05af63c48a923bc0ba6f13adbaee4dbc468bc6084f611ad31d0aae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a1d281da841af3a27f74d3bf004052d93cde45aec96f7556b5a5704dae4cefd362e038e3d28ced650f90531cb847a1e0d8982ab06846d497fe0dc819b9df5ee
|
7
|
+
data.tar.gz: 3c4d5adbfe9c56ff0ed82b64d715c3ff771fdb5a256c61ff7c6481d8e8f172c93171d92dc6fe57d5a8e0b63e5543e37768ed389db131345738c97047007e2232
|
@@ -1 +1 @@
|
|
1
|
-
`collapsibleTrail` is an optional prop that is set to 'true' by default. If set to 'false', it will remove the trail on the left of
|
1
|
+
`collapsibleTrail` is an optional prop that is set to 'true' by default. If set to 'false', it will remove the trail on the left of rows when subRows are toggled open.
|
@@ -8,7 +8,7 @@ For a visual of the data structure needed for `tableData`, see [here](https://gi
|
|
8
8
|
|
9
9
|
### columnDefinitions
|
10
10
|
|
11
|
-
`columnDefinitions` maps to the columns prop on the Tanstack table. Column definitions are the single most important part of building a table as they are responsible for building the underlying data model that is used for all sorting, expansion, etc. `ColumnDefinitions` in the AdvancedTable kit is
|
11
|
+
`columnDefinitions` maps to the columns prop on the Tanstack table. Column definitions are the single most important part of building a table as they are responsible for building the underlying data model that is used for all sorting, expansion, etc. `ColumnDefinitions` in the AdvancedTable kit is a array of objects as seen in the code snippet below. Each object within the array has two REQUIRED items:
|
12
12
|
|
13
13
|
- `accessor`: this is the key from your data for the value you want rendered in that column
|
14
14
|
- `label`: this is what will be rendered as the column header label
|
@@ -1,3 +1,3 @@
|
|
1
1
|
the optional `loading` prop takes a boolean value that can be managed using state. If loading is true, the table will display the loading skeleton and once loading is false, the table will render with the data provided.
|
2
2
|
|
3
|
-
By default, the inital row count of the loading skeleton is set to 10. If you want more control over this initial row count, the optional `initialLoadingRowCount` prop can be used to pass in a number. __NOTE__: This is only for the first render of the table, subsequent loading skeleton row count logic is handled within the kit itself.
|
3
|
+
By default, the inital row count of the loading skeleton is set to 10. If you want more control over this initial row count, the optional `initialLoadingRowCount` prop can be used to to pass in a number. __NOTE__: This is only for the first render of the table, subsequent loading skeleton row count logic is handled within the kit itself.
|
@@ -1,3 +1,3 @@
|
|
1
1
|
`subRowHeaders` is an optional prop that if present will add header rows at each level of the nested data. The prop takes an array of strings, each string being the text for each header row. The array of strings must be in the order in which they need to be rendered in the UI according to depth.
|
2
2
|
|
3
|
-
`enableToggleExpansion` is an additional optional prop that can be used in conjunction with the subRowHeaders prop. `enableToggleExpansion` is a string that can be 'all'
|
3
|
+
`enableToggleExpansion` is an additional optional prop that can be used in conjunction with the subRowHeaders prop. `enableToggleExpansion` is a string that can be 'all' or 'header". If set to 'all', the toggle exapansion button will appear in the table header as well as in the subRow headers. If set to 'header' button will only appear in header and NOT in subRow headers. This is set to 'headeer' by default.
|
@@ -1,3 +1,3 @@
|
|
1
1
|
The Tanstack table consumes the useReactTable hook to create the table. This hook takes an object that can contain any of the functions that the Tanstack table provides. The advancedTable's optional `tableOptions` can be used to pass tanstack options to the kit.
|
2
2
|
|
3
|
-
In the above example, we are using the initialState option provided by tanstack that takes sort as one of it's values. Setting it to true for the first column is reversing the sort order on first render of the table. For a complete list of possible options and
|
3
|
+
In the above example, we are using the initialState option provided by tanstack that takes sort as one of it's values. Setting it to true for the first column is reversing the sort order on first render of the table. For a complete list of possible options and hoe to use them, see [here](https://tanstack.com/table/v8/docs/api/core/table#usereacttable--createsolidtable--usevuetable--createsveltetable)
|
@@ -2,9 +2,15 @@
|
|
2
2
|
<div class="icon-wrapper">
|
3
3
|
|
4
4
|
<% svg_url = "https://upload.wikimedia.org/wikipedia/commons/3/3b/Wrench_font_awesome.svg" %>
|
5
|
-
<p><%= pb_rails("icon", props: {
|
6
|
-
<p><%= pb_rails("icon", props: { rotation: 90,
|
7
|
-
<p><%= pb_rails("icon", props: { spin: true,
|
8
|
-
<p><%= pb_rails("icon", props: { size: "5x",
|
9
|
-
<p><%= pb_rails("icon", props: { flip: "horizontal", size: "5x",
|
5
|
+
<p><%= pb_rails("icon", props: { custom_icon: svg_url } ) %></p>
|
6
|
+
<p><%= pb_rails("icon", props: { rotation: 90, custom_icon: svg_url, size: "2x" } ) %></p>
|
7
|
+
<p><%= pb_rails("icon", props: { spin: true, custom_icon: svg_url, size: "3x" } ) %></p>
|
8
|
+
<p><%= pb_rails("icon", props: { size: "5x", custom_icon: svg_url } ) %></p>
|
9
|
+
<p><%= pb_rails("icon", props: { flip: "horizontal", size: "5x", custom_icon: svg_url } ) %></p>
|
10
|
+
|
11
|
+
<%= pb_rails("body", props: {
|
12
|
+
text: "Custom icons are compatible with other icon props (size, rotation,
|
13
|
+
spin, flip, etc). Their SVG fill colors will be inherited from
|
14
|
+
parent element's css color properties."
|
15
|
+
} ) %>
|
10
16
|
</div>
|
@@ -1,59 +1,33 @@
|
|
1
1
|
import React from 'react'
|
2
2
|
import { Icon } from '../../'
|
3
3
|
|
4
|
+
// import Icons as config from 'power-icons'
|
4
5
|
const config = {
|
5
|
-
|
6
|
-
<svg
|
6
|
+
moon: (
|
7
|
+
<svg
|
8
|
+
ariaHidden="true"
|
9
|
+
focusable="false"
|
10
|
+
role="img"
|
11
|
+
viewBox="0 0 512 512"
|
7
12
|
xmlns="http://www.w3.org/2000/svg"
|
8
13
|
>
|
9
|
-
<
|
10
|
-
|
11
|
-
|
14
|
+
<path
|
15
|
+
d="M448 0H64C28.7 0 0 28.7 0 64v288c0 35.3 28.7 64 64 64h96v84c0 7.1 5.8 12 12 12 2.4 0 4.9-.7 7.1-2.4L304 416h144c35.3 0 64-28.7 64-64V64c0-35.3-28.7-64-64-64zm16 352c0 8.8-7.2 16-16 16H288l-12.8 9.6L208 428v-60H64c-8.8 0-16-7.2-16-16V64c0-8.8 7.2-16 16-16h384c8.8 0 16 7.2 16 16v288zM336 184h-56v-56c0-8.8-7.2-16-16-16h-16c-8.8 0-16 7.2-16 16v56h-56c-8.8 0-16 7.2-16 16v16c0 8.8 7.2 16 16 16h56v56c0 8.8 7.2 16 16 16h16c8.8 0 16-7.2 16-16v-56h56c8.8 0 16-7.2 16-16v-16c0-8.8-7.2-16-16-16z"
|
16
|
+
fill="currentColor"
|
17
|
+
/>
|
12
18
|
</svg>
|
13
19
|
),
|
14
20
|
}
|
15
21
|
|
16
22
|
const IconCustom = (props) => {
|
17
23
|
return (
|
18
|
-
<
|
19
|
-
<
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
<p>
|
26
|
-
<Icon
|
27
|
-
icon={config.icon}
|
28
|
-
rotation={90}
|
29
|
-
size="2x"
|
30
|
-
{...props}
|
31
|
-
/>
|
32
|
-
</p>
|
33
|
-
<p>
|
34
|
-
<Icon
|
35
|
-
icon={config.icon}
|
36
|
-
size="3x"
|
37
|
-
spin
|
38
|
-
{...props}
|
39
|
-
/>
|
40
|
-
</p>
|
41
|
-
<p>
|
42
|
-
<Icon
|
43
|
-
icon={config.icon}
|
44
|
-
size="5x"
|
45
|
-
{...props}
|
46
|
-
/>
|
47
|
-
</p>
|
48
|
-
<p>
|
49
|
-
<Icon
|
50
|
-
flip="horizontal"
|
51
|
-
icon={config.icon}
|
52
|
-
size="5x"
|
53
|
-
{...props}
|
54
|
-
/>
|
55
|
-
</p>
|
56
|
-
</React.Fragment>
|
24
|
+
<div>
|
25
|
+
<Icon
|
26
|
+
customIcon={config.moon}
|
27
|
+
size="7x"
|
28
|
+
{...props}
|
29
|
+
/>
|
30
|
+
</div>
|
57
31
|
)
|
58
32
|
}
|
59
33
|
|
@@ -4,12 +4,16 @@ When using custom icons it is important to introduce a "clean" SVG. In order to
|
|
4
4
|
|
5
5
|
Attributes must be React compatible e.g. <code>xmlns:xlink</code> should be <code>xmlnsXlink</code> and so on. <strong>There should be no hyphenated attributes and no semi-colons!.</strong>
|
6
6
|
|
7
|
-
Fill colors with regards to <code>g</code> or <code>path</code> nodes, e.g. <code>fill="black"</code>, should be replaced with
|
7
|
+
Fill colors with regards to <code>g</code> or <code>path</code> nodes, e.g. <code>fill="black"</code>, should be replaced with <code>currentColor</code> ala <code>fill="currentColor"</code>. Your mileage may vary depending on the complexity of your SVG.
|
8
8
|
|
9
|
-
Pay attention to your custom icon's dimensions and `viewBox` attribute. It is best to use a `viewBox="0 0 512 512"` starting point
|
9
|
+
Pay attention to your custom icon's dimensions and `viewBox` attribute. It is best to use a `viewBox="0 0 512 512"` starting point __when designing instead of trying to retrofit the viewbox afterwards__!
|
10
10
|
|
11
|
-
You must source
|
11
|
+
You must source *your own SVG into component/view* you are working on. This can easily be done in programmatic and maintainable ways.
|
12
|
+
|
13
|
+
### React
|
14
|
+
|
15
|
+
So long as you have a valid React `<SVG>` node, you can send it as the `customIcon` prop and the kit will take care of the rest.
|
12
16
|
|
13
17
|
### Rails
|
14
18
|
|
15
|
-
|
19
|
+
Some Rails applications use only webpack(er) which means using `image_url` will be successful over `image_path` in most cases especially development where Webpack Dev Server is serving assets over HTTP. Rails applications still using Asset Pipeline may use `image_path` or `image_url`. Of course, YMMV depending on any custom configurations in your Rails application.
|
@@ -1,34 +1,34 @@
|
|
1
1
|
<%= pb_rails("table", props: { size: "sm", tag: "div" }) do %>
|
2
|
-
<div class="
|
3
|
-
<div class="
|
4
|
-
<div class="
|
5
|
-
<div class="
|
6
|
-
<div class="
|
7
|
-
<div class="
|
8
|
-
<div class="
|
2
|
+
<div class="thead">
|
3
|
+
<div class="tr">
|
4
|
+
<div class="th">Column 1</div>
|
5
|
+
<div class="th">Column 2</div>
|
6
|
+
<div class="th">Column 3</div>
|
7
|
+
<div class="th">Column 4</div>
|
8
|
+
<div class="th">Column 5</div>
|
9
9
|
</div>
|
10
10
|
</div>
|
11
|
-
<div class="
|
12
|
-
<div class="
|
13
|
-
<div class="
|
14
|
-
<div class="
|
15
|
-
<div class="
|
16
|
-
<div class="
|
17
|
-
<div class="
|
11
|
+
<div class="tbody">
|
12
|
+
<div class="tr">
|
13
|
+
<div class="td">Value 1</div>
|
14
|
+
<div class="td">Value 2</div>
|
15
|
+
<div class="td">Value 3</div>
|
16
|
+
<div class="td">Value 4</div>
|
17
|
+
<div class="td">Value 5</div>
|
18
18
|
</div>
|
19
|
-
<div class="
|
20
|
-
<div class="
|
21
|
-
<div class="
|
22
|
-
<div class="
|
23
|
-
<div class="
|
24
|
-
<div class="
|
19
|
+
<div class="tr">
|
20
|
+
<div class="td">Value 1</div>
|
21
|
+
<div class="td">Value 2</div>
|
22
|
+
<div class="td">Value 3</div>
|
23
|
+
<div class="td">Value 4</div>
|
24
|
+
<div class="td">Value 5</div>
|
25
25
|
</div>
|
26
|
-
<div class="
|
27
|
-
<div class="
|
28
|
-
<div class="
|
29
|
-
<div class="
|
30
|
-
<div class="
|
31
|
-
<div class="
|
26
|
+
<div class="tr">
|
27
|
+
<div class="td">Value 1</div>
|
28
|
+
<div class="td">Value 2</div>
|
29
|
+
<div class="td">Value 3</div>
|
30
|
+
<div class="td">Value 4</div>
|
31
|
+
<div class="td">Value 5</div>
|
32
32
|
</div>
|
33
33
|
</div>
|
34
34
|
<% end %>
|
@@ -5,39 +5,38 @@ const TableDiv = (props) => {
|
|
5
5
|
return (
|
6
6
|
<Table
|
7
7
|
size="sm"
|
8
|
-
tag="div"
|
9
8
|
{...props}
|
10
9
|
>
|
11
|
-
<div className="
|
12
|
-
<div className="
|
13
|
-
<div className="
|
14
|
-
<div className="
|
15
|
-
<div className="
|
16
|
-
<div className="
|
17
|
-
<div className="
|
10
|
+
<div className="thead">
|
11
|
+
<div className="tr">
|
12
|
+
<div className="th">{'Column 1'}</div>
|
13
|
+
<div className="th">{'Column 2'}</div>
|
14
|
+
<div className="th">{'Column 3'}</div>
|
15
|
+
<div className="th">{'Column 4'}</div>
|
16
|
+
<div className="th">{'Column 5'}</div>
|
18
17
|
</div>
|
19
18
|
</div>
|
20
|
-
<div className="
|
21
|
-
<div className="
|
22
|
-
<div className="
|
23
|
-
<div className="
|
24
|
-
<div className="
|
25
|
-
<div className="
|
26
|
-
<div className="
|
19
|
+
<div className="tbody">
|
20
|
+
<div className="tr">
|
21
|
+
<div className="td">{'Value 1'}</div>
|
22
|
+
<div className="td">{'Value 2'}</div>
|
23
|
+
<div className="td">{'Value 3'}</div>
|
24
|
+
<div className="td">{'Value 4'}</div>
|
25
|
+
<div className="td">{'Value 5'}</div>
|
27
26
|
</div>
|
28
|
-
<div className="
|
29
|
-
<div className="
|
30
|
-
<div className="
|
31
|
-
<div className="
|
32
|
-
<div className="
|
33
|
-
<div className="
|
27
|
+
<div className="tr">
|
28
|
+
<div className="td">{'Value 1'}</div>
|
29
|
+
<div className="td">{'Value 2'}</div>
|
30
|
+
<div className="td">{'Value 3'}</div>
|
31
|
+
<div className="td">{'Value 4'}</div>
|
32
|
+
<div className="td">{'Value 5'}</div>
|
34
33
|
</div>
|
35
|
-
<div className="
|
36
|
-
<div className="
|
37
|
-
<div className="
|
38
|
-
<div className="
|
39
|
-
<div className="
|
40
|
-
<div className="
|
34
|
+
<div className="tr">
|
35
|
+
<div className="td">{'Value 1'}</div>
|
36
|
+
<div className="td">{'Value 2'}</div>
|
37
|
+
<div className="td">{'Value 3'}</div>
|
38
|
+
<div className="td">{'Value 4'}</div>
|
39
|
+
<div className="td">{'Value 5'}</div>
|
41
40
|
</div>
|
42
41
|
</div>
|
43
42
|
</Table>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
examples:
|
2
2
|
rails:
|
3
|
-
|
3
|
+
- table_div: Div
|
4
4
|
- table_sm: Small
|
5
5
|
- table_md: Medium
|
6
6
|
- table_lg: Large
|
@@ -25,12 +25,9 @@ examples:
|
|
25
25
|
- table_with_background_kit: Table With Background Kit
|
26
26
|
- table_vertical_border: Vertical Borders
|
27
27
|
- table_striped: Striped Table
|
28
|
-
- table_with_subcomponents: Table with Sub Components (Table Elements)
|
29
|
-
- table_with_subcomponents_as_divs: Table with Sub Components (Divs)
|
30
|
-
|
31
28
|
|
32
29
|
react:
|
33
|
-
|
30
|
+
- table_div: Div
|
34
31
|
- table_sm: Small
|
35
32
|
- table_md: Medium
|
36
33
|
- table_lg: Large
|
@@ -58,16 +58,6 @@ const TextInputAddOn = (props) => {
|
|
58
58
|
{...props}
|
59
59
|
/>
|
60
60
|
</div>
|
61
|
-
<div>
|
62
|
-
<TextInput
|
63
|
-
addOn={{ icon: 'frog', alignment: 'right', border: true }}
|
64
|
-
label="Right-Aligned Add On With Child Input"
|
65
|
-
onChange={handleUpdateFourthInput}
|
66
|
-
{...props}
|
67
|
-
>
|
68
|
-
<input />
|
69
|
-
</TextInput>
|
70
|
-
</div>
|
71
61
|
<div>
|
72
62
|
<TextInput
|
73
63
|
addOn={{ icon: 'percent', alignment: 'left', border: false }}
|
@@ -86,16 +76,6 @@ const TextInputAddOn = (props) => {
|
|
86
76
|
{...props}
|
87
77
|
/>
|
88
78
|
</div>
|
89
|
-
<div>
|
90
|
-
<TextInput
|
91
|
-
addOn={{ icon: 'frog', alignment: 'left', border: true }}
|
92
|
-
label="Left-Aligned Add On With Child Input"
|
93
|
-
onChange={handleUpdateFourthInput}
|
94
|
-
{...props}
|
95
|
-
>
|
96
|
-
<input />
|
97
|
-
</TextInput>
|
98
|
-
</div>
|
99
79
|
</>
|
100
80
|
)
|
101
81
|
}
|
@@ -7,5 +7,4 @@
|
|
7
7
|
| **orientation** | `Orientation` | Changes the orientation of the User | `.horizontal` | `.horizontal` `.verticle` |
|
8
8
|
| **size** | `UserAvatarSize` | Changes the size of the User | `.medium` | `.small` `.medium` `.large` |
|
9
9
|
| **territory** | `String` | Adds the User's territory | | |
|
10
|
-
| **title** | `String` | Adds a title | | |
|
11
|
-
| **status** | `PBAvatar.PresenceStatus?` | An idicator for the current status of the user | `.none` | `.online` `.away` `.offline` |
|
10
|
+
| **title** | `String` | Adds a title | | |
|