playbook_ui 13.18.0.pre.alpha.PLAY12062203 → 13.18.0.pre.alpha.dependabotnpmandyarnpowerhomeplaybookicons001alpha52174
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/Filter/FilterDouble.tsx +1 -3
- data/app/pb_kits/playbook/pb_filter/Filter/FilterSingle.tsx +1 -3
- data/app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.tsx +2 -4
- data/app/pb_kits/playbook/pb_filter/Filter/index.tsx +1 -1
- data/app/pb_kits/playbook/pb_filter/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_filter/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_filter/filter.html.erb +2 -2
- data/app/pb_kits/playbook/pb_filter/filter.rb +1 -2
- data/lib/playbook/version.rb +1 -1
- metadata +2 -4
- data/app/pb_kits/playbook/pb_filter/docs/_filter_max_height.html.erb +0 -42
- data/app/pb_kits/playbook/pb_filter/docs/_filter_max_height.jsx +0 -83
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07df5a51ff6cc545fc766152e6b29c93c3dbb93490e376860bce3b7cd5ed29ac
|
4
|
+
data.tar.gz: 50b2552c1b512542cf7aa2731ac8a8da39fd3c80a429fb9dee7553ad80edd8e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf46489def90ccc21c247e68e54e9864fb3d4bd2a53cd6fa7cf0be8a04019e46dcf7184677e1499b4ad16b9d415efde26784320e7ecb077d0f697480ae8a0877
|
7
|
+
data.tar.gz: bb93a071c1a739c0e47776b3ba4dcba3a53b3e9ba46e9c8bf8c090420429c2a7d9dfcfa5809392dbac7eae92c6025f263bb2685240ce9d305b2fec8f676bf843
|
@@ -15,7 +15,7 @@ import Flex from '../../pb_flex/_flex'
|
|
15
15
|
import SectionSeparator from '../../pb_section_separator/_section_separator'
|
16
16
|
|
17
17
|
export type FilterDoubleProps = {
|
18
|
-
children?: React.ReactChild[] | React.ReactChild,
|
18
|
+
children?: React.ReactChild[] | React.ReactChild,
|
19
19
|
filters?: FilterDescription,
|
20
20
|
onSortChange?: SortingChangeCallback,
|
21
21
|
results?: number,
|
@@ -31,7 +31,6 @@ const FilterDouble = ({
|
|
31
31
|
results,
|
32
32
|
children,
|
33
33
|
dark,
|
34
|
-
maxHeight,
|
35
34
|
minWidth,
|
36
35
|
placement,
|
37
36
|
...bgProps
|
@@ -46,7 +45,6 @@ const FilterDouble = ({
|
|
46
45
|
>
|
47
46
|
<FiltersPopover
|
48
47
|
dark={dark}
|
49
|
-
maxHeight={maxHeight}
|
50
48
|
minWidth={minWidth}
|
51
49
|
placement={placement}
|
52
50
|
>
|
@@ -14,7 +14,7 @@ import SortMenu, {
|
|
14
14
|
} from './SortMenu'
|
15
15
|
|
16
16
|
export type FilterSingleProps = {
|
17
|
-
children?: React.ReactChild[] | React.ReactChild,
|
17
|
+
children?: React.ReactChild[] | React.ReactChild,
|
18
18
|
filters?: FilterDescription,
|
19
19
|
onSortChange?: SortingChangeCallback,
|
20
20
|
results?: number,
|
@@ -30,7 +30,6 @@ const FilterSingle = ({
|
|
30
30
|
results,
|
31
31
|
children,
|
32
32
|
dark,
|
33
|
-
maxHeight,
|
34
33
|
minWidth,
|
35
34
|
placement,
|
36
35
|
...bgProps
|
@@ -49,7 +48,6 @@ const FilterSingle = ({
|
|
49
48
|
<>
|
50
49
|
<FiltersPopover
|
51
50
|
dark={dark}
|
52
|
-
maxHeight={maxHeight}
|
53
51
|
minWidth={minWidth}
|
54
52
|
placement={placement}
|
55
53
|
>
|
@@ -3,14 +3,13 @@ import React, { ReactNode, useState } from 'react'
|
|
3
3
|
import CircleIconButton from '../../pb_circle_icon_button/_circle_icon_button'
|
4
4
|
import PbReactPopover from '../../pb_popover/_popover'
|
5
5
|
|
6
|
-
type FiltersPopoverProps = {
|
6
|
+
type FiltersPopoverProps = {
|
7
7
|
children?: React.ReactChild[] | React.ReactChild | (({closePopover}: {closePopover: () => void}) => ReactNode),
|
8
8
|
dark?: boolean,
|
9
|
-
maxHeight?: string,
|
10
9
|
minWidth?: string,
|
11
10
|
placement?: "top" | "right" | "bottom" | "left" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end",
|
12
11
|
}
|
13
|
-
const FiltersPopover = ({ children, dark,
|
12
|
+
const FiltersPopover = ({ children, dark, minWidth, placement = "bottom-start" }: FiltersPopoverProps): React.ReactElement => {
|
14
13
|
const [hide, updateHide] = useState(true)
|
15
14
|
const toggle = () => updateHide(!hide)
|
16
15
|
|
@@ -27,7 +26,6 @@ const FiltersPopover = ({ children, dark, maxHeight, minWidth, placement = "bott
|
|
27
26
|
return (
|
28
27
|
<PbReactPopover
|
29
28
|
closeOnClick="outside"
|
30
|
-
maxHeight={maxHeight}
|
31
29
|
minWidth={minWidth}
|
32
30
|
placement={placement}
|
33
31
|
reference={filterButton}
|
@@ -8,7 +8,6 @@ examples:
|
|
8
8
|
- filter_only: Filter Only
|
9
9
|
- sort_only: Sort Only
|
10
10
|
- filter_max_width: Max Width for Popover Inside of Filter
|
11
|
-
- filter_max_height: Max Height for Popover Inside of Filter
|
12
11
|
- filter_placement: Filter Placement
|
13
12
|
|
14
13
|
react:
|
@@ -19,5 +18,4 @@ examples:
|
|
19
18
|
- filter_only: Filter Only
|
20
19
|
- sort_only: Sort Only
|
21
20
|
- filter_max_width: Max Width for Popover Inside of Filter
|
22
|
-
- filter_max_height: Max Height for Popover Inside of Filter
|
23
21
|
- filter_placement: Filter Placement
|
@@ -5,5 +5,4 @@ export { default as FilterNoBackground } from './_filter_no_background.jsx'
|
|
5
5
|
export { default as FilterOnly } from './_filter_only.jsx'
|
6
6
|
export { default as SortOnly } from './_sort_only.jsx'
|
7
7
|
export { default as FilterMaxWidth } from './_filter_max_width.jsx'
|
8
|
-
export { default as FilterMaxHeight } from './_filter_max_height.jsx'
|
9
8
|
export { default as FilterPlacement } from './_filter_placement.jsx'
|
@@ -70,13 +70,13 @@
|
|
70
70
|
<% end %>
|
71
71
|
|
72
72
|
<% if object.template != "sort_only"%>
|
73
|
-
<%= pb_rails("popover", props: {
|
73
|
+
<%= pb_rails("popover", props: {min_width: object.min_width, close_on_click: "outside", trigger_element_id: "filter#{object.id}", tooltip_id: "filter-form#{object.id}", position: object.placement }) do %>
|
74
74
|
<%= content %>
|
75
75
|
<% end %>
|
76
76
|
<%end%>
|
77
77
|
|
78
78
|
<% if object.template != "filter_only"%>
|
79
|
-
<%= pb_rails("popover", props: {
|
79
|
+
<%= pb_rails("popover", props: {classname: "pb_filter_sort_menu", close_on_click: "outside", trigger_element_id: "sort-button#{object.id}", tooltip_id: "sort-filter-btn-tooltip#{object.id}", position: object.placement , padding: 'none'}) do %>
|
80
80
|
<%= pb_rails("list") do %>
|
81
81
|
<% object.sort_menu.each do |item| %>
|
82
82
|
<%= pb_rails("list/item") do%> <%= pb_rails("button", props: {variant: "link" ,classname: "p-0", text: item[:item], link: item[:link]}) %><% end %>
|
@@ -10,7 +10,6 @@ module Playbook
|
|
10
10
|
values: %w[default single filter_only sort_only],
|
11
11
|
default: "default"
|
12
12
|
prop :background, type: Playbook::Props::Boolean, default: true
|
13
|
-
prop :max_height
|
14
13
|
prop :min_width, default: "auto"
|
15
14
|
prop :placement, type: Playbook::Props::Enum,
|
16
15
|
values: %w[top bottom left right top-start top-end bottom-start bottom-end right-start right-end left-start left-end],
|
@@ -32,7 +31,7 @@ module Playbook
|
|
32
31
|
end
|
33
32
|
|
34
33
|
def wrapper(&block)
|
35
|
-
if background
|
34
|
+
if object.background
|
36
35
|
pb_rails("card", props: { padding: "none" }, &block)
|
37
36
|
else
|
38
37
|
capture(&block)
|
data/lib/playbook/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: playbook_ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 13.18.0.pre.alpha.
|
4
|
+
version: 13.18.0.pre.alpha.dependabotnpmandyarnpowerhomeplaybookicons001alpha52174
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Power UX
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-02-
|
12
|
+
date: 2024-02-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|
@@ -1064,8 +1064,6 @@ files:
|
|
1064
1064
|
- app/pb_kits/playbook/pb_filter/docs/_filter_default.html.erb
|
1065
1065
|
- app/pb_kits/playbook/pb_filter/docs/_filter_default.jsx
|
1066
1066
|
- app/pb_kits/playbook/pb_filter/docs/_filter_default.md
|
1067
|
-
- app/pb_kits/playbook/pb_filter/docs/_filter_max_height.html.erb
|
1068
|
-
- app/pb_kits/playbook/pb_filter/docs/_filter_max_height.jsx
|
1069
1067
|
- app/pb_kits/playbook/pb_filter/docs/_filter_max_width.html.erb
|
1070
1068
|
- app/pb_kits/playbook/pb_filter/docs/_filter_max_width.jsx
|
1071
1069
|
- app/pb_kits/playbook/pb_filter/docs/_filter_max_width.md
|
@@ -1,42 +0,0 @@
|
|
1
|
-
<%=
|
2
|
-
pb_rails("filter", props: {
|
3
|
-
max_height: "360px",
|
4
|
-
id: "filter_max_height_rails",
|
5
|
-
position: "top",
|
6
|
-
filters: [
|
7
|
-
{ name: "name", value: "John Wick" },
|
8
|
-
{ name: "city", value: "San Francisco"}
|
9
|
-
],
|
10
|
-
sort_menu: [
|
11
|
-
{ item: "Popularity", link: "?q[sorts]=managers_popularity+asc", active: true, direction: "desc" },
|
12
|
-
{ item: "Mananger's Title", link: "?q[sorts]=managers_title+asc", active: false },
|
13
|
-
{ item: "Manager's Name", link: "?q[sorts]=managers_name+asc", active: false },
|
14
|
-
],
|
15
|
-
template: "default",
|
16
|
-
results: 1,
|
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.text_field :example_text_field, props: { label: true } %>
|
31
|
-
<%= form.text_field :example_text_field, props: { label: true } %>
|
32
|
-
<%= form.text_field :example_text_field, props: { label: true } %>
|
33
|
-
<%= form.text_field :example_text_field, props: { label: true } %>
|
34
|
-
<%= form.text_field :example_text_field, props: { label: true } %>
|
35
|
-
<%= form.collection_select :example_collection_select, example_collection, :value, :name, props: {max_width: "sm", label: true } %>
|
36
|
-
|
37
|
-
<%= form.actions do |action| %>
|
38
|
-
<%= action.submit props: { text: "Apply", data: { disable_with: "<i class='far fa-spinner fa-spin mr-3'></i>Searching...".html_safe },}%>
|
39
|
-
<%= action.button props: { type: "reset", text: "Clear", variant: "secondary" } %>
|
40
|
-
<% end %>
|
41
|
-
<% end %>
|
42
|
-
<% end %>
|
@@ -1,83 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
import { Button, Filter, Flex, Select, TextInput } from '../..'
|
3
|
-
|
4
|
-
const FilterMaxHeight = (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
|
-
return (
|
13
|
-
<Filter
|
14
|
-
{...props}
|
15
|
-
double
|
16
|
-
filters={{
|
17
|
-
'Full Name': 'John Wick',
|
18
|
-
'City': 'San Francisco',
|
19
|
-
}}
|
20
|
-
maxHeight="360px"
|
21
|
-
minWidth="360px"
|
22
|
-
results={1}
|
23
|
-
sortOptions={{
|
24
|
-
popularity: 'Popularity',
|
25
|
-
// eslint-disable-next-line
|
26
|
-
manager_title: 'Manager\'s Title',
|
27
|
-
// eslint-disable-next-line
|
28
|
-
manager_name: 'Manager\'s Name',
|
29
|
-
}}
|
30
|
-
sortValue={[{ name: 'popularity', dir: 'desc' }]}
|
31
|
-
>
|
32
|
-
{({ closePopover }) => (
|
33
|
-
<form>
|
34
|
-
<Select
|
35
|
-
blankSelection="Select One..."
|
36
|
-
label="Territory"
|
37
|
-
name="location"
|
38
|
-
options={options}
|
39
|
-
/>
|
40
|
-
<TextInput
|
41
|
-
label="First Name"
|
42
|
-
placeholder="Enter name"
|
43
|
-
{...props}
|
44
|
-
/>
|
45
|
-
<TextInput
|
46
|
-
label="Middle Name"
|
47
|
-
placeholder="Enter name"
|
48
|
-
{...props}
|
49
|
-
/>
|
50
|
-
<TextInput
|
51
|
-
label="Last Name"
|
52
|
-
placeholder="Enter name"
|
53
|
-
{...props}
|
54
|
-
/>
|
55
|
-
<TextInput
|
56
|
-
label="Email"
|
57
|
-
placeholder="Enter email"
|
58
|
-
{...props}
|
59
|
-
/>
|
60
|
-
<TextInput
|
61
|
-
label="Address"
|
62
|
-
placeholder="Enter address"
|
63
|
-
{...props}
|
64
|
-
/>
|
65
|
-
<Flex
|
66
|
-
spacing="between"
|
67
|
-
>
|
68
|
-
<Button
|
69
|
-
onClick={closePopover}
|
70
|
-
text="Apply"
|
71
|
-
/>
|
72
|
-
<Button
|
73
|
-
text="Clear"
|
74
|
-
variant="secondary"
|
75
|
-
/>
|
76
|
-
</Flex>
|
77
|
-
</form>
|
78
|
-
)}
|
79
|
-
</Filter>
|
80
|
-
)
|
81
|
-
}
|
82
|
-
|
83
|
-
export default FilterMaxHeight
|