playbook_ui_docs 14.16.0.pre.rc.5 → 14.17.0.pre.alpha.play1499backgroundkitoverlay7105
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_fullscreen.jsx +90 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_fullscreen.md +3 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination.jsx +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows.html.erb +39 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows.html.erb +33 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows_rails.md +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_rails.md +6 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +4 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_background/docs/_background_overlay.jsx +36 -0
- data/app/pb_kits/playbook/pb_background/docs/_background_overlay.md +1 -0
- data/app/pb_kits/playbook/pb_background/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_background/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_inline.html.erb +0 -11
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_inline.jsx +0 -7
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_default.jsx +1 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones.jsx +184 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones.md +5 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors.jsx +97 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors.md +1 -0
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.html.erb +3 -0
- data/app/pb_kits/playbook/pb_drawer/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete.jsx +6 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_and_custom_display.jsx +6 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display.jsx +6 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display_rails.html.erb +8 -8
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +67 -0
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +67 -0
- data/app/pb_kits/playbook/pb_icon/docs/_icon_color.html.erb +10 -4
- data/app/pb_kits/playbook/pb_icon/docs/_icon_color.jsx +49 -24
- data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_click.jsx +13 -0
- data/app/pb_kits/playbook/pb_icon_button/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_icon_button/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_layout/docs/_layout_bracket.jsx +190 -0
- data/app/pb_kits/playbook/pb_layout/docs/_layout_bracket.md +5 -0
- data/app/pb_kits/playbook/pb_layout/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_layout/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_disabled.html.erb +1 -1
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_disabled_options.html.erb +76 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_disabled_options.jsx +94 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_disabled_options.md +1 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_disabled_options_default.html.erb +75 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_disabled_options_default.jsx +93 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_disabled_options_default.md +3 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_disabled_options_parent.html.erb +75 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_disabled_options_parent.jsx +93 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_disabled_options_parent.md +3 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_disabled_options_parent_default.html.erb +74 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_disabled_options_parent_default.jsx +92 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_disabled_options_parent_default.md +3 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_error.html.erb +72 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_error.jsx +97 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_label.html.erb +71 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_label.jsx +91 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/example.yml +14 -2
- data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +6 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_default.html.erb +1 -1
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_vertical.md +1 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_borderless.jsx +50 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_borderless_react.md +1 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_floating.jsx +59 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_floating_react.md +1 -0
- data/app/pb_kits/playbook/pb_table/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_table/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_disabled.html.erb +19 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_disabled.jsx +23 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_highlight.jsx +4 -4
- data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_font_options.html.erb +22 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_font_options.jsx +40 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_font_options_rails.md +5 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_font_options_react.md +5 -0
- data/app/pb_kits/playbook/pb_user/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_user/docs/index.js +1 -0
- data/dist/playbook-doc.js +1 -1
- metadata +46 -4
- /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_selectable_rows_no_subrows.md → _advanced_table_selectable_rows_no_subrows_react.md} +0 -0
- /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_selectable_rows.md → _advanced_table_selectable_rows_react.md} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af5e37118bfaa250a35fdaeef4817a90fb42db96d8debc605b8364a1e41ab4ca
|
4
|
+
data.tar.gz: 3eecd1e3420428880fa7bf6b3e11dc0586f4f2ac4927cb48a9e6d2de40928572
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a04137b86fecb5b9bbcd11631b75169f0e9504c898fc6fa2d40826f585fcbe097203bb7adb882173991e63db1f40e6fb569ad5692220d11c522bceed46b977f
|
7
|
+
data.tar.gz: fb11a5ffe5893efa559fea19d526e96f175525e130f06fec55c3216359faa8f7add8701f07f776d0869364e330004b412c1742da50157143bc58c451040491c7
|
@@ -0,0 +1,90 @@
|
|
1
|
+
import React, { useState } from "react"
|
2
|
+
import { AdvancedTable, Button, Flex } from "playbook-ui"
|
3
|
+
import MOCK_DATA from "./advanced_table_mock_data.json"
|
4
|
+
import PAGINATION_MOCK_DATA from "./advanced_table_pagination_mock_data.json"
|
5
|
+
|
6
|
+
const AdvancedTableFullscreen = (props) => {
|
7
|
+
const [fullscreenToggleSmall, setFullscreenToggleSmall] = useState(null)
|
8
|
+
const [fullscreenToggleLarge, setFullscreenToggleLarge] = useState(null)
|
9
|
+
|
10
|
+
const columnDefinitions = [
|
11
|
+
{
|
12
|
+
accessor: "year",
|
13
|
+
label: "Year",
|
14
|
+
cellAccessors: ["quarter", "month", "day"],
|
15
|
+
},
|
16
|
+
{
|
17
|
+
accessor: "newEnrollments",
|
18
|
+
label: "New Enrollments",
|
19
|
+
},
|
20
|
+
{
|
21
|
+
accessor: "scheduledMeetings",
|
22
|
+
label: "Scheduled Meetings",
|
23
|
+
},
|
24
|
+
{
|
25
|
+
accessor: "attendanceRate",
|
26
|
+
label: "Attendance Rate",
|
27
|
+
},
|
28
|
+
{
|
29
|
+
accessor: "completedClasses",
|
30
|
+
label: "Completed Classes",
|
31
|
+
},
|
32
|
+
{
|
33
|
+
accessor: "classCompletionRate",
|
34
|
+
label: "Class Completion Rate",
|
35
|
+
},
|
36
|
+
{
|
37
|
+
accessor: "graduatedStudents",
|
38
|
+
label: "Graduated Students",
|
39
|
+
},
|
40
|
+
]
|
41
|
+
|
42
|
+
const tableProps = {
|
43
|
+
sticky: true
|
44
|
+
}
|
45
|
+
|
46
|
+
return (
|
47
|
+
<div>
|
48
|
+
<Flex justify="end">
|
49
|
+
<Button
|
50
|
+
marginBottom="sm"
|
51
|
+
onClick={() => fullscreenToggleSmall?.()}
|
52
|
+
text="Fullscreen Small Table"
|
53
|
+
variant="secondary"
|
54
|
+
/>
|
55
|
+
</Flex>
|
56
|
+
<AdvancedTable
|
57
|
+
allowFullScreen
|
58
|
+
columnDefinitions={columnDefinitions}
|
59
|
+
fullScreenControl={({ toggleFullscreen }) => setFullscreenToggleSmall(() => toggleFullscreen)}
|
60
|
+
tableData={MOCK_DATA}
|
61
|
+
{...props}
|
62
|
+
>
|
63
|
+
<AdvancedTable.Header enableSorting />
|
64
|
+
<AdvancedTable.Body />
|
65
|
+
</AdvancedTable>
|
66
|
+
<Flex justify="end">
|
67
|
+
<Button
|
68
|
+
marginY="sm"
|
69
|
+
onClick={() => fullscreenToggleLarge?.()}
|
70
|
+
text="Fullscreen Large Table"
|
71
|
+
variant="secondary"
|
72
|
+
/>
|
73
|
+
</Flex>
|
74
|
+
<AdvancedTable
|
75
|
+
allowFullScreen
|
76
|
+
columnDefinitions={columnDefinitions}
|
77
|
+
fullScreenControl={({ toggleFullscreen }) => setFullscreenToggleLarge(() => toggleFullscreen)}
|
78
|
+
responsive="none"
|
79
|
+
tableData={PAGINATION_MOCK_DATA}
|
80
|
+
tableProps={tableProps}
|
81
|
+
{...props}
|
82
|
+
>
|
83
|
+
<AdvancedTable.Header enableSorting />
|
84
|
+
<AdvancedTable.Body />
|
85
|
+
</AdvancedTable>
|
86
|
+
</div>
|
87
|
+
)
|
88
|
+
}
|
89
|
+
|
90
|
+
export default AdvancedTableFullscreen
|
@@ -0,0 +1,3 @@
|
|
1
|
+
Trigger Fullscreen mode with the `allowFullScreen`and `fullScreenControl` props. `allowFullScreen` is a boolean that enables Fullscreen functionality for an Advanced Table. `fullScreenControl` is a callback function that receives an object containing the table's internal `toggleFullscreen` function, allowing you to store and trigger Fullscreen from the parent component. An external trigger (like a button) must be used to activate Fullscreen mode.
|
2
|
+
|
3
|
+
Exit Fullscreen mode by clicking the minimize top-right-corner icon or by pressing the "Escape" keyboard key.
|
@@ -0,0 +1,39 @@
|
|
1
|
+
<% column_definitions = [
|
2
|
+
{
|
3
|
+
accessor: "year",
|
4
|
+
label: "Year",
|
5
|
+
cellAccessors: ["quarter", "month", "day"],
|
6
|
+
},
|
7
|
+
{
|
8
|
+
accessor: "newEnrollments",
|
9
|
+
label: "New Enrollments",
|
10
|
+
},
|
11
|
+
{
|
12
|
+
accessor: "scheduledMeetings",
|
13
|
+
label: "Scheduled Meetings",
|
14
|
+
},
|
15
|
+
{
|
16
|
+
accessor: "attendanceRate",
|
17
|
+
label: "Attendance Rate",
|
18
|
+
},
|
19
|
+
{
|
20
|
+
accessor: "completedClasses",
|
21
|
+
label: "Completed Classes",
|
22
|
+
},
|
23
|
+
{
|
24
|
+
accessor: "classCompletionRate",
|
25
|
+
label: "Class Completion Rate",
|
26
|
+
},
|
27
|
+
{
|
28
|
+
accessor: "graduatedStudents",
|
29
|
+
label: "Graduated Students",
|
30
|
+
}
|
31
|
+
]
|
32
|
+
|
33
|
+
subrow_headers = ["Quarter", "Month", "Day"]
|
34
|
+
%>
|
35
|
+
|
36
|
+
<%= pb_rails("advanced_table", props: { id: "selectable_rows", table_data: @table_data_with_id, column_definitions: column_definitions, selectable_rows: true }) do %>
|
37
|
+
<%= pb_rails("advanced_table/table_header", props: { column_definitions: column_definitions, selectable_rows: true }) %>
|
38
|
+
<%= pb_rails("advanced_table/table_body", props: { id: "selectable_rows", table_data: @table_data_with_id, column_definitions: column_definitions, subrow_headers: subrow_headers, enable_toggle_expansion: "all", selectable_rows: true }) %>
|
39
|
+
<% end %>
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows.html.erb
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
<% column_definitions = [
|
2
|
+
{
|
3
|
+
accessor: "year",
|
4
|
+
label: "Year",
|
5
|
+
cellAccessors: ["quarter", "month", "day"],
|
6
|
+
},
|
7
|
+
{
|
8
|
+
accessor: "newEnrollments",
|
9
|
+
label: "New Enrollments",
|
10
|
+
},
|
11
|
+
{
|
12
|
+
accessor: "scheduledMeetings",
|
13
|
+
label: "Scheduled Meetings",
|
14
|
+
},
|
15
|
+
{
|
16
|
+
accessor: "attendanceRate",
|
17
|
+
label: "Attendance Rate",
|
18
|
+
},
|
19
|
+
{
|
20
|
+
accessor: "completedClasses",
|
21
|
+
label: "Completed Classes",
|
22
|
+
},
|
23
|
+
{
|
24
|
+
accessor: "classCompletionRate",
|
25
|
+
label: "Class Completion Rate",
|
26
|
+
},
|
27
|
+
{
|
28
|
+
accessor: "graduatedStudents",
|
29
|
+
label: "Graduated Students",
|
30
|
+
}
|
31
|
+
] %>
|
32
|
+
|
33
|
+
<%= pb_rails("advanced_table", props: { id: "selectable_rows_no_subrows", table_data: @table_data_no_subrows, column_definitions: column_definitions, selectable_rows: true, enable_toggle_expansion: "none", }) %>
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows_rails.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
`selectable_rows` can also be used with tables without nested row data. Set `enable_toggle_expansion: none` to adjust the Advanced Table styling to fit a table without subrows.
|
@@ -0,0 +1,6 @@
|
|
1
|
+
`selectable_rows` is a boolean prop that if present will add checkboxes to all rows that will allow for selecting rows.
|
2
|
+
|
3
|
+
When a parent row is clicked, it will check all nested children rows, Children rows can be manually checked or unchecked as well.
|
4
|
+
|
5
|
+
__ALERT TO DEVS__: UPDATE THIS PARAGRAPH IN THE FOLLOW UP STORY WHEN CHECKBOX FUNCTIONALITY IS SET PLEASE
|
6
|
+
The `onRowSelectionChange` prop returns an array of ids of all Rows that have been selected. Open the console on this example and check and uncheck checkboxes to see this is action! __NOTE__: Each object within the `tableData`Array must contain a unique id in order to attach an id to all Rows for this to function.
|
@@ -11,6 +11,8 @@ examples:
|
|
11
11
|
- advanced_table_custom_cell_rails: Custom Components for Cells
|
12
12
|
- advanced_table_column_headers: Multi-Header Columns
|
13
13
|
- advanced_table_column_headers_multiple: Multi-Header Columns (Multiple Levels)
|
14
|
+
# - advanced_table_selectable_rows: Selectable Rows
|
15
|
+
# - advanced_table_selectable_rows_no_subrows: Selectable Rows (No Subrows)
|
14
16
|
|
15
17
|
|
16
18
|
react:
|
@@ -37,4 +39,5 @@ examples:
|
|
37
39
|
- advanced_table_selectable_rows_no_subrows: Selectable Rows (No Subrows)
|
38
40
|
- advanced_table_selectable_rows_actions: Selectable Rows (With Actions)
|
39
41
|
- advanced_table_selectable_rows_header: Selectable Rows (No Actions Bar)
|
40
|
-
- advanced_table_inline_editing: Inline Cell Editing
|
42
|
+
- advanced_table_inline_editing: Inline Cell Editing
|
43
|
+
- advanced_table_fullscreen: Fullscreen
|
@@ -21,4 +21,5 @@ export { default as AdvancedTableSelectableRowsHeader } from './_advanced_table_
|
|
21
21
|
export { default as AdvancedTableSelectableRowsActions } from './_advanced_table_selectable_rows_actions.jsx'
|
22
22
|
export { default as AdvancedTableTablePropsStickyHeader } from './_advanced_table_table_props_sticky_header.jsx'
|
23
23
|
export { default as AdvancedTableColumnHeadersCustomCell } from './_advanced_table_column_headers_custom_cell.jsx'
|
24
|
-
export { default as AdvancedTableInlineEditing } from './_advanced_table_inline_editing.jsx'
|
24
|
+
export { default as AdvancedTableInlineEditing } from './_advanced_table_inline_editing.jsx'
|
25
|
+
export { default as AdvancedTableFullscreen } from './_advanced_table_fullscreen.jsx'
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import Background from "../../pb_background/_background"
|
3
|
+
import Flex from "../../pb_flex/_flex"
|
4
|
+
import FlexItem from "../../pb_flex/_flex_item"
|
5
|
+
import Title from "../../pb_title/_title"
|
6
|
+
|
7
|
+
const BackgroundOverlay = (props) => {
|
8
|
+
return (
|
9
|
+
<Background
|
10
|
+
alt="colorful background"
|
11
|
+
className="background lazyload"
|
12
|
+
imageOverlay="opacity_6"
|
13
|
+
imageUrl="https://images.unsplash.com/photo-1528459801416-a9e53bbf4e17?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1000&q=80"
|
14
|
+
{...props}
|
15
|
+
backgroundColor="light"
|
16
|
+
>
|
17
|
+
<Flex
|
18
|
+
orientation="column"
|
19
|
+
vertical="center"
|
20
|
+
{...props}
|
21
|
+
>
|
22
|
+
<FlexItem>
|
23
|
+
<Title
|
24
|
+
dark
|
25
|
+
padding="lg"
|
26
|
+
size={1}
|
27
|
+
text="Background Kit Image"
|
28
|
+
{...props}
|
29
|
+
/>
|
30
|
+
</FlexItem>
|
31
|
+
</Flex>
|
32
|
+
</Background>
|
33
|
+
)
|
34
|
+
}
|
35
|
+
|
36
|
+
export default BackgroundOverlay
|
@@ -0,0 +1 @@
|
|
1
|
+
An overlay can be added to the background image by setting the `imageOverlay` prop and adding a `backgroundColor`. The `imageOverlay` prop can be set to any opacity ranging from `opacity_1` to `opacity_10`.
|
@@ -6,3 +6,4 @@ export { default as BackgroundStatus } from './_background_status.jsx'
|
|
6
6
|
export { default as BackgroundStatusSubtle } from './_background_status_subtle.jsx'
|
7
7
|
export { default as BackgroundCategory } from './_background_category.jsx'
|
8
8
|
export { default as BackgroundSize } from './_background_size.jsx'
|
9
|
+
export { default as BackgroundOverlay } from './_background_overlay.jsx'
|
@@ -4,14 +4,3 @@
|
|
4
4
|
inline: true,
|
5
5
|
picker_id: "date-picker-inline"
|
6
6
|
}) %>
|
7
|
-
|
8
|
-
<%= javascript_tag do %>
|
9
|
-
window.addEventListener("DOMContentLoaded", (event) => {
|
10
|
-
const fpInline = document.querySelector("#date-picker-inline")._flatpickr
|
11
|
-
<!-- Display the angle-down icon when a date has been selected -->
|
12
|
-
const showAngleDownHandler = () => {
|
13
|
-
document.querySelector('.inline-date-picker').classList.add('show-angle-down-icon')
|
14
|
-
}
|
15
|
-
fpInline.config.onChange.push(showAngleDownHandler)
|
16
|
-
})
|
17
|
-
<% end %>
|
@@ -3,19 +3,12 @@ import React from 'react'
|
|
3
3
|
import DatePicker from '../_date_picker'
|
4
4
|
|
5
5
|
const DatePickerInline = (props) => {
|
6
|
-
const showAngleDownHandler = (dateSelected) => {
|
7
|
-
if (dateSelected) {
|
8
|
-
document.querySelector('.inline-date-picker').classList.add('show-angle-down-icon')
|
9
|
-
}
|
10
|
-
}
|
11
|
-
|
12
6
|
return (
|
13
7
|
<div>
|
14
8
|
<DatePicker
|
15
9
|
className="inline-date-picker"
|
16
10
|
hideIcon
|
17
11
|
inLine
|
18
|
-
onChange={showAngleDownHandler}
|
19
12
|
pickerId="date-picker-inline"
|
20
13
|
{...props}
|
21
14
|
/>
|
@@ -0,0 +1,184 @@
|
|
1
|
+
import React, { useState } from "react";
|
2
|
+
import Body from '../../pb_body/_body'
|
3
|
+
import Flex from '../../pb_flex/_flex'
|
4
|
+
import FlexItem from '../../pb_flex/_flex_item'
|
5
|
+
import Card from '../../pb_card/_card'
|
6
|
+
import Caption from '../../pb_caption/_caption'
|
7
|
+
import Draggable from '../../pb_draggable/_draggable'
|
8
|
+
import { DraggableProvider } from '../../pb_draggable/context'
|
9
|
+
|
10
|
+
// Initial items to be dragged
|
11
|
+
const dataShadow = [
|
12
|
+
{
|
13
|
+
id: "51",
|
14
|
+
text: "Task 1",
|
15
|
+
},
|
16
|
+
{
|
17
|
+
id: "52",
|
18
|
+
text: "Task 2",
|
19
|
+
},
|
20
|
+
{
|
21
|
+
id: "53",
|
22
|
+
text: "Task 3",
|
23
|
+
},
|
24
|
+
];
|
25
|
+
|
26
|
+
const dataOutline = [
|
27
|
+
{
|
28
|
+
id: "61",
|
29
|
+
text: "Task 1",
|
30
|
+
},
|
31
|
+
{
|
32
|
+
id: "62",
|
33
|
+
text: "Task 2",
|
34
|
+
},
|
35
|
+
{
|
36
|
+
id: "63",
|
37
|
+
text: "Task 3",
|
38
|
+
},
|
39
|
+
];
|
40
|
+
|
41
|
+
const dataLine = [
|
42
|
+
{
|
43
|
+
id: "71",
|
44
|
+
text: "Task 1",
|
45
|
+
},
|
46
|
+
{
|
47
|
+
id: "72",
|
48
|
+
text: "Task 2",
|
49
|
+
},
|
50
|
+
{
|
51
|
+
id: "73",
|
52
|
+
text: "Task 3",
|
53
|
+
},
|
54
|
+
];
|
55
|
+
|
56
|
+
const DraggableDropZones = (props) => {
|
57
|
+
const [initialShadowState, setInitialShadowState] = useState(dataShadow);
|
58
|
+
const [initialOutlineState, setInitialOutlineState] = useState(dataOutline);
|
59
|
+
const [initialLineState, setInitialLineState] = useState(dataLine);
|
60
|
+
|
61
|
+
return (
|
62
|
+
<>
|
63
|
+
<Flex justify="between"
|
64
|
+
{...props}
|
65
|
+
>
|
66
|
+
<FlexItem marginRight="xl">
|
67
|
+
<DraggableProvider
|
68
|
+
dropZone={{type: "shadow"}}
|
69
|
+
initialItems={dataShadow}
|
70
|
+
onReorder={(items) => setInitialShadowState(items)}
|
71
|
+
>
|
72
|
+
<Caption
|
73
|
+
marginBottom="xs"
|
74
|
+
textAlign="center"
|
75
|
+
>
|
76
|
+
{"Shadow"}
|
77
|
+
</Caption>
|
78
|
+
<Draggable.Container
|
79
|
+
htmlOptions={{style:{ width: "200px"}}}
|
80
|
+
{...props}
|
81
|
+
>
|
82
|
+
{initialShadowState.map(({ id, text }) => (
|
83
|
+
<Card dragId={id}
|
84
|
+
draggableItem
|
85
|
+
key={id}
|
86
|
+
marginBottom="xs"
|
87
|
+
padding="xs"
|
88
|
+
{...props}
|
89
|
+
>
|
90
|
+
<Flex alignItems="stretch"
|
91
|
+
flexDirection="column"
|
92
|
+
>
|
93
|
+
<Body
|
94
|
+
text={text}
|
95
|
+
{...props}
|
96
|
+
/>
|
97
|
+
</Flex>
|
98
|
+
</Card>
|
99
|
+
))}
|
100
|
+
</Draggable.Container>
|
101
|
+
</DraggableProvider>
|
102
|
+
</FlexItem>
|
103
|
+
<FlexItem marginRight="xl">
|
104
|
+
<DraggableProvider
|
105
|
+
dropZone={{type: "outline"}}
|
106
|
+
initialItems={dataOutline}
|
107
|
+
onReorder={(items) => setInitialOutlineState(items)}
|
108
|
+
>
|
109
|
+
<Caption
|
110
|
+
marginBottom="xs"
|
111
|
+
textAlign="center"
|
112
|
+
>
|
113
|
+
{"Outline"}
|
114
|
+
</Caption>
|
115
|
+
<Draggable.Container
|
116
|
+
htmlOptions={{style:{ width: "200px"}}}
|
117
|
+
{...props}
|
118
|
+
>
|
119
|
+
{initialOutlineState.map(({ id, text }) => (
|
120
|
+
<Card
|
121
|
+
dragId={id}
|
122
|
+
draggableItem
|
123
|
+
key={id}
|
124
|
+
marginBottom="xs"
|
125
|
+
padding="xs"
|
126
|
+
{...props}
|
127
|
+
>
|
128
|
+
<Flex
|
129
|
+
alignItems="stretch"
|
130
|
+
flexDirection="column"
|
131
|
+
>
|
132
|
+
<Body
|
133
|
+
text={text}
|
134
|
+
{...props}
|
135
|
+
/>
|
136
|
+
</Flex>
|
137
|
+
</Card>
|
138
|
+
))}
|
139
|
+
</Draggable.Container>
|
140
|
+
</DraggableProvider>
|
141
|
+
</FlexItem>
|
142
|
+
<FlexItem>
|
143
|
+
<DraggableProvider
|
144
|
+
dropZone={{type: "line"}}
|
145
|
+
initialItems={dataLine}
|
146
|
+
onReorder={(items) => setInitialLineState(items)}
|
147
|
+
>
|
148
|
+
<Caption
|
149
|
+
marginBottom="xs"
|
150
|
+
textAlign="center"
|
151
|
+
>
|
152
|
+
{"Line"}
|
153
|
+
</Caption>
|
154
|
+
<Draggable.Container
|
155
|
+
htmlOptions={{style:{ width: "200px"}}}
|
156
|
+
{...props}
|
157
|
+
>
|
158
|
+
{initialLineState.map(({ id, text }) => (
|
159
|
+
<Card dragId={id}
|
160
|
+
draggableItem
|
161
|
+
key={id}
|
162
|
+
marginBottom="xs"
|
163
|
+
padding="xs"
|
164
|
+
{...props}
|
165
|
+
>
|
166
|
+
<Flex alignItems="stretch"
|
167
|
+
flexDirection="column"
|
168
|
+
>
|
169
|
+
<Body
|
170
|
+
text={text}
|
171
|
+
{...props}
|
172
|
+
/>
|
173
|
+
</Flex>
|
174
|
+
</Card>
|
175
|
+
))}
|
176
|
+
</Draggable.Container>
|
177
|
+
</DraggableProvider>
|
178
|
+
</FlexItem>
|
179
|
+
</Flex>
|
180
|
+
</>
|
181
|
+
);
|
182
|
+
};
|
183
|
+
|
184
|
+
export default DraggableDropZones;
|
@@ -0,0 +1,5 @@
|
|
1
|
+
The Draggable kit allows you to choose the style of drop zones that appear when dragging an item.
|
2
|
+
|
3
|
+
By default, the Draggable kit utilizes the "ghost" style for drop zones, but you can also choose between "shadow", "outline", and "line".
|
4
|
+
|
5
|
+
Additionally, when using the "line" style, be sure to set the proper `direction` attribute within the `dropZone` prop depending on the orentation of your draggable view. By default, this attribute is set to "vertical", but can also be used with a "horizontal" direction. The `direction` attribute only applies to the "line" style and will not affect other drop zone styles.
|
@@ -0,0 +1,97 @@
|
|
1
|
+
import React, { useState } from "react";
|
2
|
+
|
3
|
+
import Flex from '../../pb_flex/_flex'
|
4
|
+
import Image from '../../pb_image/_image'
|
5
|
+
import Caption from '../../pb_caption/_caption'
|
6
|
+
import Draggable from '../../pb_draggable/_draggable'
|
7
|
+
import { DraggableProvider } from '../../pb_draggable/context'
|
8
|
+
|
9
|
+
// Initial items to be dragged
|
10
|
+
const dataPrimary = [
|
11
|
+
{
|
12
|
+
id: "81",
|
13
|
+
url: "https://unsplash.it/500/400/?image=633",
|
14
|
+
},
|
15
|
+
{
|
16
|
+
id: "82",
|
17
|
+
url: "https://unsplash.it/500/400/?image=634",
|
18
|
+
},
|
19
|
+
{
|
20
|
+
id: "83",
|
21
|
+
url: "https://unsplash.it/500/400/?image=637",
|
22
|
+
},
|
23
|
+
];
|
24
|
+
const dataPurple = [
|
25
|
+
{
|
26
|
+
id: "91",
|
27
|
+
url: "https://unsplash.it/500/400/?image=633",
|
28
|
+
},
|
29
|
+
{
|
30
|
+
id: "92",
|
31
|
+
url: "https://unsplash.it/500/400/?image=634",
|
32
|
+
},
|
33
|
+
{
|
34
|
+
id: "93",
|
35
|
+
url: "https://unsplash.it/500/400/?image=637",
|
36
|
+
},
|
37
|
+
];
|
38
|
+
|
39
|
+
const DraggableDropZonesColors = (props) => {
|
40
|
+
const [initialPrimaryState, setInitialPrimaryState] = useState(dataPrimary);
|
41
|
+
const [initialPurpleState, setInitialPurpleState] = useState(dataPurple);
|
42
|
+
|
43
|
+
return (
|
44
|
+
<>
|
45
|
+
<Caption marginBottom="xs">
|
46
|
+
Primary
|
47
|
+
</Caption>
|
48
|
+
<DraggableProvider
|
49
|
+
dropZone={{type: "shadow", color: "primary"}}
|
50
|
+
initialItems={dataPrimary}
|
51
|
+
onReorder={(items) => setInitialPrimaryState(items)}
|
52
|
+
>
|
53
|
+
<Draggable.Container {...props}>
|
54
|
+
<Flex>
|
55
|
+
{initialPrimaryState.map(({ id, url }) => (
|
56
|
+
<Draggable.Item dragId={id}
|
57
|
+
key={id}
|
58
|
+
marginRight="sm"
|
59
|
+
>
|
60
|
+
<Image alt={id}
|
61
|
+
size="md"
|
62
|
+
url={url}
|
63
|
+
/>
|
64
|
+
</Draggable.Item>
|
65
|
+
))}
|
66
|
+
</Flex>
|
67
|
+
</Draggable.Container>
|
68
|
+
</DraggableProvider>
|
69
|
+
<Caption marginBottom="xs">
|
70
|
+
Purple
|
71
|
+
</Caption>
|
72
|
+
<DraggableProvider
|
73
|
+
dropZone={{type: "outline", color: "purple"}}
|
74
|
+
initialItems={dataPurple}
|
75
|
+
onReorder={(items) => setInitialPurpleState(items)}
|
76
|
+
>
|
77
|
+
<Draggable.Container {...props}>
|
78
|
+
<Flex>
|
79
|
+
{initialPurpleState.map(({ id, url }) => (
|
80
|
+
<Draggable.Item dragId={id}
|
81
|
+
key={id}
|
82
|
+
marginRight="sm"
|
83
|
+
>
|
84
|
+
<Image alt={id}
|
85
|
+
size="md"
|
86
|
+
url={url}
|
87
|
+
/>
|
88
|
+
</Draggable.Item>
|
89
|
+
))}
|
90
|
+
</Flex>
|
91
|
+
</Draggable.Container>
|
92
|
+
</DraggableProvider>
|
93
|
+
</>
|
94
|
+
);
|
95
|
+
};
|
96
|
+
|
97
|
+
export default DraggableDropZonesColors;
|
@@ -0,0 +1 @@
|
|
1
|
+
By default, the Draggable kit sets the default color of drop zones to "neutral" (or "primary" if using the "line" style.)
|
@@ -0,0 +1,3 @@
|
|
1
|
+
|
2
|
+
<%= pb_rails("body", props: { text: " The breakpoint prop determines when the Drawer is always visible. Above the specified breakpoint, the Drawer remains open on the page. Below it, only the trigger element is shown, allowing you to toggle the drawer open and closed. To see this in action, click the button below and resize your window.", padding_bottom: "md" }) %>
|
3
|
+
<%= pb_rails("button", props: { text: "Open Doc Example in New Tab", new_window: true, link: "/drawer_page", margin_right: "lg" }) %>
|
@@ -12,7 +12,7 @@ const DropdownWithAutocomplete = (props) => {
|
|
12
12
|
label: "Jasper Furniss",
|
13
13
|
value: "Jasper Furniss",
|
14
14
|
territory: "PHL",
|
15
|
-
title: "
|
15
|
+
title: "Lead UX Engineer",
|
16
16
|
id: "jasper-furniss",
|
17
17
|
status: "Offline"
|
18
18
|
},
|
@@ -25,18 +25,18 @@ const DropdownWithAutocomplete = (props) => {
|
|
25
25
|
status: "Away"
|
26
26
|
},
|
27
27
|
{
|
28
|
-
label: "
|
29
|
-
value: "
|
28
|
+
label: "Carlos Lima",
|
29
|
+
value: "Carlos Lima",
|
30
30
|
territory: "PHL",
|
31
|
-
title: "
|
32
|
-
id: "
|
31
|
+
title: "Nitro Developer",
|
32
|
+
id: "carlos-lima",
|
33
33
|
status: "Online"
|
34
34
|
},
|
35
35
|
{
|
36
36
|
label: "Courtney Long",
|
37
37
|
value: "Courtney Long",
|
38
38
|
territory: "PHL",
|
39
|
-
title: "UX
|
39
|
+
title: "Lead UX Designer",
|
40
40
|
id: "courtney-long",
|
41
41
|
status: "Online"
|
42
42
|
}
|