playbook_ui_docs 14.13.0.pre.rc.10 → 14.14.0.pre.alpha.PBNTR866finalizecssendlessscroll6462
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/docs/_advanced_table_column_headers_custom_cell.jsx +75 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_infinite_scroll.jsx +50 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.jsx +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_rails.md +3 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_react.md +3 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header.html.erb +33 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header.jsx +55 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_rails.md +3 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_react.md +3 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_mock_data_infinite_scroll.json +152002 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +5 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +4 -1
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_pb_styles.jsx +64 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_pb_styles.md +1 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_react_hook.jsx +69 -0
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_react_hook.md +1 -0
- data/app/pb_kits/playbook/pb_checkbox/docs/example.yml +2 -1
- data/app/pb_kits/playbook/pb_checkbox/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_currency/docs/_currency_null_display.html.erb +22 -0
- data/app/pb_kits/playbook/pb_currency/docs/_currency_null_display.jsx +34 -0
- data/app/pb_kits/playbook/pb_currency/docs/_currency_null_display_rails.md +1 -0
- data/app/pb_kits/playbook/pb_currency/docs/_currency_null_display_react.md +1 -0
- data/app/pb_kits/playbook/pb_currency/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_currency/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_rails.html.erb +99 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_rails.md +1 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table.html.erb +61 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table.md +4 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table_react.jsx +90 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table_react.md +5 -0
- data/app/pb_kits/playbook/pb_draggable/docs/example.yml +4 -5
- data/app/pb_kits/playbook/pb_draggable/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_behavior.html.erb +8 -0
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_borders.html.erb +33 -0
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.html.erb +0 -0
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_default.html.erb +20 -1
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.html.erb +24 -0
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.html.erb +21 -0
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.md +1 -0
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_sizes.html.erb +49 -0
- data/app/pb_kits/playbook/pb_drawer/docs/example.yml +5 -0
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +1 -0
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +2 -1
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_formatting.html.erb +11 -0
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_formatting.jsx +22 -0
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_formatting_rails.md +1 -0
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_formatting_react.md +1 -0
- data/app/pb_kits/playbook/pb_home_address_street/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_home_address_street/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_default.html.erb +1 -2
- data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_default.jsx +17 -0
- data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_sizes.html.erb +27 -0
- data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_sizes.jsx +61 -0
- data/app/pb_kits/playbook/pb_icon_button/docs/example.yml +5 -3
- data/app/pb_kits/playbook/pb_icon_button/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar.html.erb +11 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar.jsx +37 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar_rails.md +1 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar_react.md +1 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional.html.erb +11 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional.jsx +37 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional.md +1 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional_react.md +1 -0
- data/app/pb_kits/playbook/pb_overlay/docs/example.yml +4 -0
- data/app/pb_kits/playbook/pb_overlay/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_default.html.erb +1 -0
- data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_default.jsx +7 -0
- data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_default.md +1 -0
- data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_full_width.html.erb +1 -0
- data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_full_width.jsx +18 -0
- data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_full_width_rails.md +1 -0
- data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_full_width_react.md +1 -0
- data/app/pb_kits/playbook/pb_progress_pills/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_progress_pills/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_clickable_rows.html.erb +47 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_clickable_rows.jsx +88 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_clickable_rows.md +1 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible.jsx +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_click.html.erb +51 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_click_rails.md +2 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_selectable_rows.html.erb +96 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_selectable_rows.jsx +101 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_selectable_rows.md +1 -0
- data/app/pb_kits/playbook/pb_table/docs/example.yml +5 -0
- data/app/pb_kits/playbook/pb_table/docs/index.js +3 -1
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask.html.erb +15 -1
- data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_delay_rails.html.erb +39 -0
- data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_delay_rails.md +3 -0
- data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_interaction.html.erb +26 -0
- data/app/pb_kits/playbook/pb_tooltip/docs/example.yml +2 -0
- data/dist/playbook-doc.js +1 -1
- metadata +63 -14
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_actions.html.erb +0 -19
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_actions.jsx +0 -26
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_default.html.erb +0 -10
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_default.jsx +0 -17
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_on_click.jsx +0 -19
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_onclick.html.erb +0 -16
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_placement.html.erb +0 -35
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_placement.jsx +0 -42
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_tooltip.html.erb +0 -13
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/example.yml +0 -15
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/index.js +0 -4
- /data/app/pb_kits/playbook/pb_table/docs/{_table_with_collapsible_with_custom_click.md → _table_with_collapsible_with_custom_click_react.md} +0 -0
@@ -5,6 +5,7 @@ examples:
|
|
5
5
|
- advanced_table_beta_subrow_headers: SubRow Headers
|
6
6
|
- advanced_table_collapsible_trail_rails: Collapsible Trail
|
7
7
|
- advanced_table_table_props: Table Props
|
8
|
+
- advanced_table_table_props_sticky_header: Table Props Sticky Header
|
8
9
|
- advanced_table_beta_sort: Enable Sorting
|
9
10
|
- advanced_table_responsive: Responsive Tables
|
10
11
|
- advanced_table_custom_cell_rails: Custom Components for Cells
|
@@ -22,6 +23,7 @@ examples:
|
|
22
23
|
- advanced_table_collapsible_trail: Collapsible Trail
|
23
24
|
- advanced_table_table_options: Table Options
|
24
25
|
- advanced_table_table_props: Table Props
|
26
|
+
- advanced_table_table_props_sticky_header: Table Props Sticky Header
|
25
27
|
- advanced_table_inline_row_loading: Inline Row Loading
|
26
28
|
- advanced_table_responsive: Responsive Tables
|
27
29
|
- advanced_table_custom_cell: Custom Components for Cells
|
@@ -29,8 +31,10 @@ examples:
|
|
29
31
|
- advanced_table_pagination_with_props: Pagination Props
|
30
32
|
- advanced_table_column_headers: Multi-Header Columns
|
31
33
|
- advanced_table_column_headers_multiple: Multi-Header Columns (Multiple Levels)
|
34
|
+
- advanced_table_column_headers_custom_cell: Multi-Header Columns with Custom Cells
|
32
35
|
# - advanced_table_no_subrows: Table with No Subrows
|
33
36
|
- advanced_table_selectable_rows: Selectable Rows
|
34
37
|
- advanced_table_selectable_rows_no_subrows: Selectable Rows (No Subrows)
|
35
38
|
- advanced_table_selectable_rows_actions: Selectable Rows (With Actions)
|
36
|
-
- advanced_table_selectable_rows_header: Selectable Rows (No Actions Bar)
|
39
|
+
- advanced_table_selectable_rows_header: Selectable Rows (No Actions Bar)
|
40
|
+
- advanced_table_infinite_scroll: Infinite Scroll
|
@@ -18,4 +18,7 @@ export { default as AdvancedTableSelectableRows } from './_advanced_table_select
|
|
18
18
|
export { default as AdvancedTableSelectableRowsNoSubrows } from './_advanced_table_selectable_rows_no_subrows.jsx'
|
19
19
|
export { default as AdvancedTableNoSubrows } from './_advanced_table_no_subrows.jsx'
|
20
20
|
export { default as AdvancedTableSelectableRowsHeader } from './_advanced_table_selectable_rows_header.jsx'
|
21
|
-
export { default as AdvancedTableSelectableRowsActions } from './_advanced_table_selectable_rows_actions.jsx'
|
21
|
+
export { default as AdvancedTableSelectableRowsActions } from './_advanced_table_selectable_rows_actions.jsx'
|
22
|
+
export { default as AdvancedTableTablePropsStickyHeader } from './_advanced_table_table_props_sticky_header.jsx'
|
23
|
+
export { default as AdvancedTableColumnHeadersCustomCell } from './_advanced_table_column_headers_custom_cell.jsx'
|
24
|
+
export { default as AdvancedTableInfiniteScroll } from './_advanced_table_infinite_scroll.jsx'
|
@@ -0,0 +1,64 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import Highcharts from "highcharts";
|
3
|
+
import HighchartsReact from "highcharts-react-official";
|
4
|
+
|
5
|
+
import "../BarGraphStyles.scss";
|
6
|
+
// Your path might look more like this
|
7
|
+
//import "playbook-ui/dist/pb_bar_graph/BarGraphStyles.scss";
|
8
|
+
|
9
|
+
const columnChartData = [
|
10
|
+
{
|
11
|
+
name: "Installation",
|
12
|
+
data: [1475, 200, 3000, 654, 656],
|
13
|
+
},
|
14
|
+
{
|
15
|
+
name: "Manufacturing",
|
16
|
+
data: [4434, 524, 2320, 440, 500],
|
17
|
+
},
|
18
|
+
{
|
19
|
+
name: "Sales & Distribution",
|
20
|
+
data: [3387, 743, 1344, 434, 440],
|
21
|
+
},
|
22
|
+
{
|
23
|
+
name: "Project Development",
|
24
|
+
data: [3227, 878, 999, 780, 1000],
|
25
|
+
},
|
26
|
+
{
|
27
|
+
name: "Other",
|
28
|
+
data: [1111, 677, 3245, 500, 200],
|
29
|
+
},
|
30
|
+
];
|
31
|
+
|
32
|
+
const columnOptions = {
|
33
|
+
chart: {
|
34
|
+
type: "column",
|
35
|
+
},
|
36
|
+
series: columnChartData,
|
37
|
+
title: {
|
38
|
+
text: "Solar Employment Growth by Sector, 2010-2016",
|
39
|
+
},
|
40
|
+
subtitle: {
|
41
|
+
text: "Source: thesolarfoundation.com",
|
42
|
+
},
|
43
|
+
xAxis: {
|
44
|
+
categories: ["Jan", "Feb", "Mar", "Apr", "May"],
|
45
|
+
},
|
46
|
+
yAxis: {
|
47
|
+
min: 0,
|
48
|
+
title: {
|
49
|
+
text: "Number of Employees",
|
50
|
+
},
|
51
|
+
},
|
52
|
+
legend: { enabled: false },
|
53
|
+
credits: { enabled: false },
|
54
|
+
};
|
55
|
+
|
56
|
+
const BarGraphPbStyles = () => (
|
57
|
+
<div>
|
58
|
+
<HighchartsReact highcharts={Highcharts}
|
59
|
+
options={columnOptions}
|
60
|
+
/>
|
61
|
+
</div>
|
62
|
+
)
|
63
|
+
|
64
|
+
export default BarGraphPbStyles
|
@@ -0,0 +1 @@
|
|
1
|
+
You don't need to use the bar graph kit to apply the styles to your Highcharts bar graph. Just import the BarGraphStyles.scss to your component and the styles will apply automatically.
|
@@ -10,3 +10,4 @@ export { default as BarGraphStacked } from './_bar_graph_stacked.jsx'
|
|
10
10
|
export { default as BarGraphNegativeNumbers } from './_bar_graph_negative_numbers.jsx'
|
11
11
|
export { default as BarGraphSecondaryYAxis } from './_bar_graph_secondary_y_axis.jsx'
|
12
12
|
export { default as BarGraphHorizontal } from './_bar_graph_horizontal.jsx'
|
13
|
+
export { default as BarGraphPbStyles } from './_bar_graph_pb_styles.jsx'
|
@@ -0,0 +1,69 @@
|
|
1
|
+
import React, { useState } from "react"
|
2
|
+
import { useForm } from "react-hook-form"
|
3
|
+
import { Button, Checkbox, Flex, Body } from "playbook-ui"
|
4
|
+
|
5
|
+
const CheckboxReactHook = () => {
|
6
|
+
const { register, handleSubmit } = useForm({
|
7
|
+
defaultValues: {
|
8
|
+
Small: false,
|
9
|
+
Medium: false,
|
10
|
+
Large: false,
|
11
|
+
},
|
12
|
+
})
|
13
|
+
|
14
|
+
const [submittedData, setSubmittedData] = useState({
|
15
|
+
Small: false,
|
16
|
+
Medium: false,
|
17
|
+
Large: false,
|
18
|
+
})
|
19
|
+
|
20
|
+
const onSubmit = (data) => {
|
21
|
+
setSubmittedData(data)
|
22
|
+
}
|
23
|
+
|
24
|
+
return (
|
25
|
+
<Flex orientation="row">
|
26
|
+
<Flex align="start"
|
27
|
+
orientation="column"
|
28
|
+
paddingRight="lg"
|
29
|
+
>
|
30
|
+
<form onSubmit={handleSubmit(onSubmit)}>
|
31
|
+
<Checkbox padding="xs"
|
32
|
+
text="Small"
|
33
|
+
{...register("Small")}
|
34
|
+
/>
|
35
|
+
<br />
|
36
|
+
<Checkbox padding="xs"
|
37
|
+
text="Medium"
|
38
|
+
{...register("Medium")}
|
39
|
+
/>
|
40
|
+
<br />
|
41
|
+
<Checkbox padding="xs"
|
42
|
+
text="Large"
|
43
|
+
{...register("Large")}
|
44
|
+
/>
|
45
|
+
<br />
|
46
|
+
<Button htmlType="submit"
|
47
|
+
marginTop="sm"
|
48
|
+
text="submit"
|
49
|
+
/>
|
50
|
+
</form>
|
51
|
+
</Flex>
|
52
|
+
<Flex align="start"
|
53
|
+
orientation="column"
|
54
|
+
>
|
55
|
+
<Body padding="xs"
|
56
|
+
text={`Small: ${submittedData.Small ? "true" : "false"}`}
|
57
|
+
/>
|
58
|
+
<Body padding="xs"
|
59
|
+
text={`Medium: ${submittedData.Medium ? "true" : "false"}`}
|
60
|
+
/>
|
61
|
+
<Body padding="xs"
|
62
|
+
text={`Large: ${submittedData.Large ? "true" : "false"}`}
|
63
|
+
/>
|
64
|
+
</Flex>
|
65
|
+
</Flex>
|
66
|
+
)
|
67
|
+
}
|
68
|
+
|
69
|
+
export default CheckboxReactHook
|
@@ -0,0 +1 @@
|
|
1
|
+
You can pass react hook props to the checkbox kit.
|
@@ -11,6 +11,7 @@ examples:
|
|
11
11
|
react:
|
12
12
|
- checkbox_default: Default
|
13
13
|
- checkbox_checked: Load as checked
|
14
|
+
- checkbox_react_hook: React Hook Form
|
14
15
|
- checkbox_custom: Custom Checkbox
|
15
16
|
- checkbox_error: Default w/ Error
|
16
17
|
- checkbox_indeterminate: Indeterminate Checkbox
|
@@ -21,4 +22,4 @@ examples:
|
|
21
22
|
- checkbox_error_swift: Default w/ Error
|
22
23
|
- checkbox_indeterminate_swift: Indeterminate Checkbox
|
23
24
|
- checkbox_props_swift: ""
|
24
|
-
|
25
|
+
|
@@ -1,5 +1,6 @@
|
|
1
1
|
export { default as CheckboxDefault } from './_checkbox_default.jsx'
|
2
2
|
export { default as CheckboxCustom } from './_checkbox_custom.jsx'
|
3
|
+
export { default as CheckboxReactHook } from './_checkbox_react_hook.jsx'
|
3
4
|
export { default as CheckboxError } from './_checkbox_error.jsx'
|
4
5
|
export { default as CheckboxChecked } from './_checkbox_checked.jsx'
|
5
6
|
export { default as CheckboxIndeterminate } from './_checkbox_indeterminate.jsx'
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<%= pb_rails("currency", props: {
|
2
|
+
amount: "",
|
3
|
+
label: "Nil",
|
4
|
+
margin_bottom: "md",
|
5
|
+
null_display: "--",
|
6
|
+
size: "sm"
|
7
|
+
}) %>
|
8
|
+
|
9
|
+
<%= pb_rails("currency", props: {
|
10
|
+
amount: "",
|
11
|
+
label: "Nil",
|
12
|
+
margin_bottom: "md",
|
13
|
+
null_display: "$0.00",
|
14
|
+
size: "sm"
|
15
|
+
}) %>
|
16
|
+
|
17
|
+
<%= pb_rails("currency", props: {
|
18
|
+
amount: "",
|
19
|
+
label: "Nil",
|
20
|
+
null_display: " ",
|
21
|
+
size: "sm"
|
22
|
+
}) %>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import { Currency } from 'playbook-ui'
|
3
|
+
|
4
|
+
const CurrencyNullDisplay = (props) => {
|
5
|
+
return (
|
6
|
+
<>
|
7
|
+
<Currency
|
8
|
+
amount=""
|
9
|
+
label="Null"
|
10
|
+
marginBottom="md"
|
11
|
+
nullDisplay="--"
|
12
|
+
{...props}
|
13
|
+
/>
|
14
|
+
|
15
|
+
<Currency
|
16
|
+
amount=""
|
17
|
+
label="Null"
|
18
|
+
marginBottom="md"
|
19
|
+
nullDisplay="$0.00"
|
20
|
+
{...props}
|
21
|
+
/>
|
22
|
+
|
23
|
+
<Currency
|
24
|
+
amount=""
|
25
|
+
label="Null"
|
26
|
+
marginBottom="md"
|
27
|
+
nullDisplay=" "
|
28
|
+
{...props}
|
29
|
+
/>
|
30
|
+
</>
|
31
|
+
)
|
32
|
+
}
|
33
|
+
|
34
|
+
export default CurrencyNullDisplay
|
@@ -0,0 +1 @@
|
|
1
|
+
To customize how the `amount` field appears when it is empty, use the `null_display` prop and set it to the desired value you want to display.
|
@@ -0,0 +1 @@
|
|
1
|
+
To customize how the `amount` field appears when it is empty, use the `nullDisplay` prop and set it to the desired value you want to display.
|
@@ -10,6 +10,7 @@ examples:
|
|
10
10
|
- currency_unstyled: Unstyled
|
11
11
|
- currency_comma_separator: Comma Separator
|
12
12
|
- currency_negative: Negative
|
13
|
+
- currency_null_display: Null Display
|
13
14
|
|
14
15
|
react:
|
15
16
|
- currency_variants: Variants
|
@@ -21,6 +22,7 @@ examples:
|
|
21
22
|
- currency_unstyled: Unstyled
|
22
23
|
- currency_comma_separator: Comma Separator
|
23
24
|
- currency_negative: Negative
|
25
|
+
- currency_null_display: Null Display
|
24
26
|
|
25
27
|
swift:
|
26
28
|
- currency_size_swift: Size
|
@@ -6,4 +6,5 @@ export { default as CurrencyAbbreviated } from './_currency_abbreviated.jsx'
|
|
6
6
|
export { default as CurrencyMatchingDecimals } from './_currency_matching_decimals.jsx'
|
7
7
|
export { default as CurrencyUnstyled } from './_currency_unstyled.jsx'
|
8
8
|
export { default as CurrencyCommaSeparator } from './_currency_comma_separator.jsx'
|
9
|
-
export { default as CurrencyNegative } from './_currency_negative.jsx'
|
9
|
+
export { default as CurrencyNegative } from './_currency_negative.jsx'
|
10
|
+
export { default as CurrencyNullDisplay } from './_currency_null_display.jsx'
|
@@ -0,0 +1,99 @@
|
|
1
|
+
<% containers = [
|
2
|
+
"To Do",
|
3
|
+
"In Progress",
|
4
|
+
"Done"
|
5
|
+
] %>
|
6
|
+
|
7
|
+
<% items_data = [
|
8
|
+
{
|
9
|
+
id: "11",
|
10
|
+
container: "To Do",
|
11
|
+
title: "Task 1",
|
12
|
+
description: "Bug fixes",
|
13
|
+
assignee_name: "Terry Miles",
|
14
|
+
assignee_img: "https://randomuser.me/api/portraits/men/44.jpg",
|
15
|
+
},
|
16
|
+
{
|
17
|
+
id: "12",
|
18
|
+
container: "To Do",
|
19
|
+
title: "Task 2",
|
20
|
+
description: "Documentation",
|
21
|
+
assignee_name: "Sophia Miles",
|
22
|
+
assignee_img: "https://randomuser.me/api/portraits/women/8.jpg",
|
23
|
+
},
|
24
|
+
{
|
25
|
+
id: "13",
|
26
|
+
container: "In Progress",
|
27
|
+
title: "Task 3",
|
28
|
+
description: "Add a variant",
|
29
|
+
assignee_name: "Alice Jones",
|
30
|
+
assignee_img: "https://randomuser.me/api/portraits/women/10.jpg",
|
31
|
+
},
|
32
|
+
{
|
33
|
+
id: "14",
|
34
|
+
container: "To Do",
|
35
|
+
title: "Task 4",
|
36
|
+
description: "Add jest tests",
|
37
|
+
assignee_name: "Mike James",
|
38
|
+
assignee_img: "https://randomuser.me/api/portraits/men/8.jpg",
|
39
|
+
},
|
40
|
+
{
|
41
|
+
id: "15",
|
42
|
+
container: "Done",
|
43
|
+
title: "Task 5",
|
44
|
+
description: "Alpha testing",
|
45
|
+
assignee_name: "James Guy",
|
46
|
+
assignee_img: "https://randomuser.me/api/portraits/men/18.jpg",
|
47
|
+
},
|
48
|
+
{
|
49
|
+
id: "16",
|
50
|
+
container: "In Progress",
|
51
|
+
title: "Task 6",
|
52
|
+
description: "Release",
|
53
|
+
assignee_name: "Sally Jones",
|
54
|
+
assignee_img: "https://randomuser.me/api/portraits/women/28.jpg",
|
55
|
+
},
|
56
|
+
] %>
|
57
|
+
|
58
|
+
<%= pb_rails("draggable", props: { initial_items: items_data }) do %>
|
59
|
+
<%= pb_rails("flex", props: { justify_content: "center" }) do %>
|
60
|
+
<% containers.each do |container| %>
|
61
|
+
<%= pb_rails("draggable/draggable_container", props: {
|
62
|
+
container: container,
|
63
|
+
width: "xs",
|
64
|
+
padding: "sm",
|
65
|
+
data: { container: container }
|
66
|
+
}) do %>
|
67
|
+
<%= pb_rails("caption", props: { text_align: "center" }) do %><%= container %><% end %>
|
68
|
+
<%= pb_rails("flex", props: {align_items: "stretch", orientation: "column"}) do %>
|
69
|
+
<% items_data.select { |item| item[:container] == container }.each do |item| %>
|
70
|
+
<%= pb_rails("draggable/draggable_item", props: {
|
71
|
+
container: container,
|
72
|
+
drag_id: item[:id]
|
73
|
+
}) do %>
|
74
|
+
<%= pb_rails("card", props: { margin_bottom: "sm", padding: "sm"}) do %>
|
75
|
+
<%= pb_rails("flex", props: { justify: "between" }) do %>
|
76
|
+
<%= pb_rails("flex/flex_item") do %>
|
77
|
+
<%= pb_rails("flex") do %>
|
78
|
+
<%= pb_rails("avatar", props: {
|
79
|
+
image_url: item[:assignee_img],
|
80
|
+
name: item[:assignee_name],
|
81
|
+
size: "xxs"
|
82
|
+
}) %>
|
83
|
+
<%= pb_rails("title", props: {
|
84
|
+
padding_left: "xs",
|
85
|
+
size: 4,
|
86
|
+
text: item[:title]
|
87
|
+
}) %>
|
88
|
+
<% end %>
|
89
|
+
<% end %>
|
90
|
+
<% end %>
|
91
|
+
<%= pb_rails("body", props: { padding_top: "xs", text: item[:description] }) %>
|
92
|
+
<% end %>
|
93
|
+
<% end %>
|
94
|
+
<% end %>
|
95
|
+
<% end %>
|
96
|
+
<% end %>
|
97
|
+
<% end %>
|
98
|
+
<% end %>
|
99
|
+
<% end %>
|
@@ -0,0 +1 @@
|
|
1
|
+
The Draggable kit can also be used to achieve more complex, multiple container functionality as shown here. This complex usage requires the full subcomponent structure.
|
@@ -0,0 +1,61 @@
|
|
1
|
+
<% initial_items = [
|
2
|
+
{
|
3
|
+
id: "1",
|
4
|
+
title: "Task 1",
|
5
|
+
assignee_name: "Terry Miles",
|
6
|
+
assignee_img: "https://randomuser.me/api/portraits/men/44.jpg",
|
7
|
+
},
|
8
|
+
{
|
9
|
+
id: "2",
|
10
|
+
title: "Task 2",
|
11
|
+
assignee_name: "Sophia Miles",
|
12
|
+
assignee_img: "https://randomuser.me/api/portraits/women/8.jpg",
|
13
|
+
},
|
14
|
+
{
|
15
|
+
id: "3",
|
16
|
+
title: "Task 3",
|
17
|
+
assignee_name: "Alice Jones",
|
18
|
+
assignee_img: "https://randomuser.me/api/portraits/women/10.jpg",
|
19
|
+
},
|
20
|
+
{
|
21
|
+
id: "4",
|
22
|
+
title: "Task 4",
|
23
|
+
assignee_name: "Mike James",
|
24
|
+
assignee_img: "https://randomuser.me/api/portraits/men/8.jpg",
|
25
|
+
},
|
26
|
+
{
|
27
|
+
id: "5",
|
28
|
+
title: "Task 5",
|
29
|
+
assignee_name: "James Guy",
|
30
|
+
assignee_img: "https://randomuser.me/api/portraits/men/18.jpg",
|
31
|
+
}
|
32
|
+
] %>
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
<%= pb_rails("draggable", props: {initial_items: initial_items}) do %>
|
37
|
+
<%= pb_rails("table", props: { size: "sm", responsive:"none" }) do %>
|
38
|
+
<%= pb_rails("table/table_head") do %>
|
39
|
+
<%= pb_rails("table/table_row") do %>
|
40
|
+
<%= pb_rails("table/table_header", props: { text: "id"}) %>
|
41
|
+
<%= pb_rails("table/table_header", props: { text: "name"}) %>
|
42
|
+
<%= pb_rails("table/table_header", props: { text: "task number"}) %>
|
43
|
+
<% end %>
|
44
|
+
<% end %>
|
45
|
+
|
46
|
+
<%= pb_rails("table/table_body", props: {draggable_container: true}) do %>
|
47
|
+
<% initial_items.each do |item| %>
|
48
|
+
<%= pb_rails("table/table_row", props:{drag_id: item[:id], draggable_item: true}) do %>
|
49
|
+
<%= pb_rails("table/table_cell", props: { text: item[:id]}) %>
|
50
|
+
<%= pb_rails("table/table_cell") do %>
|
51
|
+
<%= pb_rails("flex", props:{align:"center"}) do %>
|
52
|
+
<%= pb_rails("avatar", props: {size: "xs", image_url: item[:assignee_img]}) %>
|
53
|
+
<%= pb_rails("body", props: {text: item[:assignee_name], padding_left:"sm"}) %>
|
54
|
+
<% end %>
|
55
|
+
<% end %>
|
56
|
+
<%= pb_rails("table/table_cell", props: { text: item[:title]}) %>
|
57
|
+
<% end %>
|
58
|
+
<% end %>
|
59
|
+
<% end %>
|
60
|
+
<% end %>
|
61
|
+
<% end %>
|
@@ -0,0 +1,4 @@
|
|
1
|
+
The draggable kit can also be used in conjunction with the table kit to create draggable table rows. To do this:
|
2
|
+
|
3
|
+
- use the `draggable_container` prop on the table/table_body to designate it as the Draggable Container
|
4
|
+
- use the `draggable_item` prop on the table/table_row to designate it as the Draggable Item. Make sure to also pass id to the `drag_id` prop here.
|
@@ -0,0 +1,90 @@
|
|
1
|
+
import React, { useState } from "react";
|
2
|
+
import { Flex, Table, Body, Avatar, DraggableProvider } from "playbook-ui";
|
3
|
+
|
4
|
+
// Initial items to be dragged
|
5
|
+
const data = [
|
6
|
+
{
|
7
|
+
id: "1",
|
8
|
+
task: "Task 1",
|
9
|
+
assignee_name: "Terry Miles",
|
10
|
+
assignee_img: "https://randomuser.me/api/portraits/men/44.jpg",
|
11
|
+
},
|
12
|
+
{
|
13
|
+
id: "2",
|
14
|
+
task: "Task 2",
|
15
|
+
assignee_name: "Sophia Miles",
|
16
|
+
assignee_img: "https://randomuser.me/api/portraits/women/8.jpg",
|
17
|
+
},
|
18
|
+
{
|
19
|
+
id: "3",
|
20
|
+
task: "Task 3",
|
21
|
+
assignee_name: "Alice Jones",
|
22
|
+
assignee_img: "https://randomuser.me/api/portraits/women/10.jpg",
|
23
|
+
},
|
24
|
+
{
|
25
|
+
id: "4",
|
26
|
+
task: "Task 4",
|
27
|
+
assignee_name: "Mike James",
|
28
|
+
assignee_img: "https://randomuser.me/api/portraits/men/8.jpg",
|
29
|
+
},
|
30
|
+
{
|
31
|
+
id: "5",
|
32
|
+
task: "Task 5",
|
33
|
+
assignee_name: "James Guy",
|
34
|
+
assignee_img: "https://randomuser.me/api/portraits/men/18.jpg",
|
35
|
+
}
|
36
|
+
];
|
37
|
+
|
38
|
+
const DraggableWithTableReact = (props) => {
|
39
|
+
const [initialState, setInitialState] = useState(data);
|
40
|
+
|
41
|
+
return (
|
42
|
+
<>
|
43
|
+
<DraggableProvider initialItems={data}
|
44
|
+
onReorder={(items) => setInitialState(items)}
|
45
|
+
>
|
46
|
+
<Table
|
47
|
+
responsive="none"
|
48
|
+
size="sm"
|
49
|
+
{...props}
|
50
|
+
>
|
51
|
+
<Table.Head>
|
52
|
+
<Table.Row>
|
53
|
+
<Table.Header>{"id"}</Table.Header>
|
54
|
+
<Table.Header>{"name"}</Table.Header>
|
55
|
+
<Table.Header>{"task number"}</Table.Header>
|
56
|
+
</Table.Row>
|
57
|
+
</Table.Head>
|
58
|
+
<Table.Body draggableContainer>
|
59
|
+
{initialState.map(({ id, task, assignee_name, assignee_img }) => (
|
60
|
+
<Table.Row
|
61
|
+
dragId={id}
|
62
|
+
draggableItem
|
63
|
+
key={id}
|
64
|
+
>
|
65
|
+
<Table.Cell>{id}</Table.Cell>
|
66
|
+
<Table.Cell>
|
67
|
+
<Flex align="center">
|
68
|
+
<Avatar
|
69
|
+
imageUrl={assignee_img}
|
70
|
+
size="xs"
|
71
|
+
/>
|
72
|
+
<Body
|
73
|
+
paddingLeft="xxs"
|
74
|
+
text={assignee_name}
|
75
|
+
{...props}
|
76
|
+
/>
|
77
|
+
</Flex>
|
78
|
+
</Table.Cell>
|
79
|
+
<Table.Cell>{task}</Table.Cell>
|
80
|
+
</Table.Row>
|
81
|
+
))}
|
82
|
+
</Table.Body>
|
83
|
+
</Table>
|
84
|
+
</DraggableProvider>
|
85
|
+
</>
|
86
|
+
|
87
|
+
);
|
88
|
+
};
|
89
|
+
|
90
|
+
export default DraggableWithTableReact;
|
@@ -0,0 +1,5 @@
|
|
1
|
+
The draggable kit can also be used in conjunction with the table kit to create draggable table rows. To do this:
|
2
|
+
|
3
|
+
- Wrap the Table with the `DraggableProvider` and manage state as shown.
|
4
|
+
- use the `draggableContainer` prop on the Table.Body to designate it as the Draggable Container
|
5
|
+
- use the `draggableItem` prop on the Table.Row to designate it as the Draggable Item. Make sure to also pass id to the `dragId` prop here.
|
@@ -1,18 +1,17 @@
|
|
1
1
|
examples:
|
2
|
-
|
3
|
-
|
4
2
|
react:
|
5
3
|
- draggable_default: Default
|
6
4
|
- draggable_with_list: Draggable with List Kit
|
7
5
|
- draggable_with_selectable_list: Draggable with SelectableList Kit
|
8
6
|
- draggable_with_cards: Draggable with Cards
|
7
|
+
- draggable_with_table_react: Draggable with Table
|
9
8
|
- draggable_multiple_containers: Dragging Across Multiple Containers
|
10
|
-
|
9
|
+
|
11
10
|
rails:
|
12
11
|
- draggable_default_rails: Default
|
13
12
|
- draggable_with_list_rails: Draggable with List Kit
|
14
13
|
- draggable_with_selectable_list_rails: Draggable with SelectableList Kit
|
15
14
|
- draggable_with_cards_rails: Draggable with Cards
|
15
|
+
- draggable_with_table: Draggable with Table
|
16
|
+
- draggable_multiple_containers_rails: Dragging Across Multiple Containers
|
16
17
|
|
17
|
-
|
18
|
-
|
@@ -2,4 +2,5 @@ export { default as DraggableDefault } from './_draggable_default.jsx'
|
|
2
2
|
export { default as DraggableWithCards } from './_draggable_with_cards.jsx'
|
3
3
|
export { default as DraggableWithList } from './_draggable_with_list.jsx'
|
4
4
|
export { default as DraggableWithSelectableList } from './_draggable_with_selectable_list.jsx'
|
5
|
-
export { default as DraggableMultipleContainers } from './_draggable_multiple_containers.jsx'
|
5
|
+
export { default as DraggableMultipleContainers } from './_draggable_multiple_containers.jsx'
|
6
|
+
export { default as DraggableWithTableReact } from './_draggable_with_table_react.jsx'
|
@@ -0,0 +1,33 @@
|
|
1
|
+
<%= pb_rails("flex") do %>
|
2
|
+
<%= pb_rails("button", props: { text: "Drawer with border right", margin_right: "sm", data: {"open-drawer": "drawer-12"} }) %>
|
3
|
+
|
4
|
+
<%= pb_rails("drawer", props: {
|
5
|
+
id:"drawer-12",
|
6
|
+
overlay: false,
|
7
|
+
border: "right"
|
8
|
+
}) do %>
|
9
|
+
Test me (Border Right)
|
10
|
+
<% end %>
|
11
|
+
|
12
|
+
|
13
|
+
<%= pb_rails("button", props: { text: "Drawer with border left", margin_right: "sm", data: {"open-drawer": "drawer-13"} }) %>
|
14
|
+
|
15
|
+
<%= pb_rails("drawer", props: {
|
16
|
+
id:"drawer-13",
|
17
|
+
overlay: false,
|
18
|
+
border: "left"
|
19
|
+
}) do %>
|
20
|
+
Test me (Border Left)
|
21
|
+
<% end %>
|
22
|
+
|
23
|
+
<%= pb_rails("button", props: { text: "Drawer with border full", data: {"open-drawer": "drawer-14"} }) %>
|
24
|
+
|
25
|
+
<%= pb_rails("drawer", props: {
|
26
|
+
id:"drawer-14",
|
27
|
+
overlay: false,
|
28
|
+
border: "full"
|
29
|
+
}) do %>
|
30
|
+
Test me (Border Full)
|
31
|
+
<% end %>
|
32
|
+
<% end %>
|
33
|
+
|
File without changes
|