playbook_ui_docs 14.6.0.pre.rc.22 → 14.6.0.pre.rc.23
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_filter/docs/_filter_popover_props.html.erb +41 -0
- data/app/pb_kits/playbook/pb_filter/docs/_filter_popover_props.jsx +71 -0
- data/app/pb_kits/playbook/pb_filter/docs/_filter_popover_props_rails.md +1 -0
- data/app/pb_kits/playbook/pb_filter/docs/_filter_popover_props_react.md +1 -0
- data/app/pb_kits/playbook/pb_filter/docs/example.yml +3 -0
- data/app/pb_kits/playbook/pb_filter/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_popover/docs/_popover_default.html.erb +1 -1
- data/dist/playbook-doc.js +1 -1
- metadata +5 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8da8f83f714fa3d87ddedec77337e2433b1abc7a3a06fcacd09d9a64a1eeeef1
|
4
|
+
data.tar.gz: 724ebff9b18cad7190c8e50e9f5467158ef6621912ec80c283969e6de1065da1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d00dc22eed633ed3b83f24dffc932ec9a6c8059adde389dd2ce89aed1668bf5ae13c442d6803a44590725770493d073a98e329d494e6834e76de2f3dc6bd5e7f
|
7
|
+
data.tar.gz: 5949a4b2d346f6898b57957a8cccf153a662d4216eab89bc62ba1a55fd48c53840f2e95a7d6ab16d9cf72b5ca3056e777ac3a409943cc124c1e34ad5f16091d4
|
@@ -0,0 +1,41 @@
|
|
1
|
+
<%=
|
2
|
+
pb_rails("filter", props: {
|
3
|
+
id: "filter_popover_props",
|
4
|
+
position: "top",
|
5
|
+
filters: [
|
6
|
+
{ name: "name", value: "John Wick" },
|
7
|
+
{ name: "city", value: "San Francisco"}
|
8
|
+
],
|
9
|
+
sort_menu: [
|
10
|
+
{ item: "Popularity", link: "?q[sorts]=managers_popularity+asc", active: true, direction: "desc" },
|
11
|
+
{ item: "Mananger's Title", link: "?q[sorts]=managers_title+asc", active: false },
|
12
|
+
{ item: "Manager's Name", link: "?q[sorts]=managers_name+asc", active: false },
|
13
|
+
],
|
14
|
+
template: "default",
|
15
|
+
results: 1,
|
16
|
+
popover_props: { width: "250px" },
|
17
|
+
}) do
|
18
|
+
%>
|
19
|
+
<%
|
20
|
+
example_collection = [
|
21
|
+
OpenStruct.new(name: "USA", value: 1),
|
22
|
+
OpenStruct.new(name: "Canada", value: 2),
|
23
|
+
OpenStruct.new(name: "Brazil", value: 3),
|
24
|
+
OpenStruct.new(name: "Philippines", value: 4),
|
25
|
+
OpenStruct.new(name: "A galaxy far far away, like really far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far away...", value: 5)
|
26
|
+
]
|
27
|
+
%>
|
28
|
+
<%= pb_rails("form", props: { form_system_options: { scope: :example, method: :get } }) do |form| %>
|
29
|
+
<%= form.text_field :example_text_field, props: { label: true } %>
|
30
|
+
<%= form.collection_select :example_collection_select, example_collection, :value, :name, props: {max_width: "sm", label: true } %>
|
31
|
+
|
32
|
+
<%= form.actions do |action| %>
|
33
|
+
<%= action.submit props: {
|
34
|
+
text: "Apply",
|
35
|
+
data: {
|
36
|
+
disable_with: "pb_rails('icon', props: { icon: 'spinner', spin: true, fixed_width: true })Searching...".html_safe
|
37
|
+
},}%>
|
38
|
+
<%= action.button props: { type: "reset", text: "Clear", variant: "secondary" } %>
|
39
|
+
<% end %>
|
40
|
+
<% end %>
|
41
|
+
<% end %>
|
@@ -0,0 +1,71 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import { Button, Filter, Flex, Select, TextInput } from 'playbook-ui'
|
3
|
+
|
4
|
+
const FilterPopoverProps = (props) => {
|
5
|
+
const options = [
|
6
|
+
{ value: 'USA' },
|
7
|
+
{ value: 'Canada' },
|
8
|
+
{ value: 'Brazil' },
|
9
|
+
{ value: 'Philippines' },
|
10
|
+
{ value: 'A galaxy far far away, like really far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far away...' },
|
11
|
+
]
|
12
|
+
|
13
|
+
const popoverProps = {
|
14
|
+
width: "250px"
|
15
|
+
}
|
16
|
+
|
17
|
+
return (
|
18
|
+
<Filter
|
19
|
+
{...props}
|
20
|
+
double
|
21
|
+
filters={{
|
22
|
+
'Full Name': 'John Wick',
|
23
|
+
'City': 'San Francisco',
|
24
|
+
}}
|
25
|
+
popoverProps={popoverProps}
|
26
|
+
results={1}
|
27
|
+
sortOptions={{
|
28
|
+
popularity: 'Popularity',
|
29
|
+
// eslint-disable-next-line
|
30
|
+
manager_title: 'Manager\'s Title',
|
31
|
+
// eslint-disable-next-line
|
32
|
+
manager_name: 'Manager\'s Name',
|
33
|
+
}}
|
34
|
+
sortValue={[{ name: 'popularity', dir: 'desc' }]}
|
35
|
+
>
|
36
|
+
{({ closePopover }) => (
|
37
|
+
<form>
|
38
|
+
<TextInput
|
39
|
+
label="Example Text Field"
|
40
|
+
placeholder="Enter Text"
|
41
|
+
{...props}
|
42
|
+
/>
|
43
|
+
<Select
|
44
|
+
blankSelection="Select One..."
|
45
|
+
label="Example Collection Select"
|
46
|
+
name="Collection Select"
|
47
|
+
options={options}
|
48
|
+
{...props}
|
49
|
+
/>
|
50
|
+
<Flex
|
51
|
+
spacing="between"
|
52
|
+
{...props}
|
53
|
+
>
|
54
|
+
<Button
|
55
|
+
onClick={closePopover}
|
56
|
+
text="Apply"
|
57
|
+
{...props}
|
58
|
+
/>
|
59
|
+
<Button
|
60
|
+
text="Clear"
|
61
|
+
variant="secondary"
|
62
|
+
{...props}
|
63
|
+
/>
|
64
|
+
</Flex>
|
65
|
+
</form>
|
66
|
+
)}
|
67
|
+
</Filter>
|
68
|
+
)
|
69
|
+
}
|
70
|
+
|
71
|
+
export default FilterPopoverProps
|
@@ -0,0 +1 @@
|
|
1
|
+
This kit uses the [Popover kit](https://playbook.powerapp.cloud/kits/popover) under the hood for the Filter Popover which comes with its own set of props. If you want to apply certain Popover props to that underlying kit, you can do so by using the optional `popover_props` prop. This prop must be an object that contains valid Popover props. For a full list of Popover props, see [here](https://playbook.powerapp.cloud/kits/popover).
|
@@ -0,0 +1 @@
|
|
1
|
+
This kit uses the [Popover kit](https://playbook.powerapp.cloud/kits/popover/react) under the hood for the Filter Popover which comes with its own set of props. If you want to apply certain Popover props to that underlying kit, you can do so by using the optional `popoverProps` prop. This prop must be an object that contains valid Popover props. For a full list of Popover props, see [here](https://playbook.powerapp.cloud/kits/popover/react).
|
@@ -10,6 +10,7 @@ examples:
|
|
10
10
|
- filter_max_width: Max Width for Popover Inside of Filter
|
11
11
|
- filter_max_height: Max Height for Popover Inside of Filter
|
12
12
|
- filter_placement: Filter Placement
|
13
|
+
- filter_popover_props: Popover Props
|
13
14
|
|
14
15
|
react:
|
15
16
|
- filter_default: Default
|
@@ -21,3 +22,5 @@ examples:
|
|
21
22
|
- filter_max_width: Max Width for Popover Inside of Filter
|
22
23
|
- filter_max_height: Max Height for Popover Inside of Filter
|
23
24
|
- filter_placement: Filter Placement
|
25
|
+
- filter_popover_props: Popover Props
|
26
|
+
|
@@ -7,3 +7,4 @@ export { default as SortOnly } from './_sort_only.jsx'
|
|
7
7
|
export { default as FilterMaxWidth } from './_filter_max_width.jsx'
|
8
8
|
export { default as FilterMaxHeight } from './_filter_max_height.jsx'
|
9
9
|
export { default as FilterPlacement } from './_filter_placement.jsx'
|
10
|
+
export { default as FilterPopoverProps } from './_filter_popover_props.jsx'
|