playbook_ui 4.14.0 → 4.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +2 -0
  3. data/app/pb_kits/playbook/data/menu.yml +2 -0
  4. data/app/pb_kits/playbook/index.js +4 -1
  5. data/app/pb_kits/playbook/packs/examples.js +2 -0
  6. data/app/pb_kits/playbook/packs/kits/pb_progress_step.js +2 -0
  7. data/app/pb_kits/playbook/pb_button/_button.jsx +9 -1
  8. data/app/pb_kits/playbook/pb_contact/_contact.jsx +1 -0
  9. data/app/pb_kits/playbook/pb_contact/contact.rb +2 -0
  10. data/app/pb_kits/playbook/pb_contact/docs/_contact_default.html.erb +5 -0
  11. data/app/pb_kits/playbook/pb_contact/docs/_contact_default.jsx +4 -0
  12. data/app/pb_kits/playbook/pb_contact/docs/_contact_with_detail.html.erb +6 -0
  13. data/app/pb_kits/playbook/pb_contact/docs/_contact_with_detail.jsx +5 -0
  14. data/app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.jsx +2 -2
  15. data/app/pb_kits/playbook/pb_filter/Filter/CurrentFilters.jsx +56 -0
  16. data/app/pb_kits/playbook/pb_filter/Filter/FilterBackground.jsx +26 -0
  17. data/app/pb_kits/playbook/pb_filter/Filter/FilterDouble.jsx +58 -0
  18. data/app/pb_kits/playbook/pb_filter/Filter/FilterSingle.jsx +46 -0
  19. data/app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx +37 -0
  20. data/app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx +34 -0
  21. data/app/pb_kits/playbook/pb_filter/Filter/SortMenu.jsx +85 -0
  22. data/app/pb_kits/playbook/pb_filter/Filter/index.jsx +26 -0
  23. data/app/pb_kits/playbook/pb_filter/_filter.jsx +1 -222
  24. data/app/pb_kits/playbook/pb_filter/_filter.scss +16 -13
  25. data/app/pb_kits/playbook/pb_filter/docs/_filter_default.html.erb +34 -41
  26. data/app/pb_kits/playbook/pb_filter/docs/_filter_default.jsx +13 -9
  27. data/app/pb_kits/playbook/pb_filter/docs/_filter_no_background.html.erb +69 -74
  28. data/app/pb_kits/playbook/pb_filter/docs/_filter_no_background.jsx +12 -9
  29. data/app/pb_kits/playbook/pb_filter/docs/_filter_only.html.erb +28 -35
  30. data/app/pb_kits/playbook/pb_filter/docs/_filter_only.jsx +5 -6
  31. data/app/pb_kits/playbook/pb_filter/docs/_filter_single.html.erb +35 -41
  32. data/app/pb_kits/playbook/pb_filter/docs/_filter_single.jsx +12 -10
  33. data/app/pb_kits/playbook/pb_filter/docs/_sort_only.html.erb +12 -18
  34. data/app/pb_kits/playbook/pb_filter/docs/_sort_only.jsx +14 -44
  35. data/app/pb_kits/playbook/pb_filter/templates/_default.html.erb +1 -1
  36. data/app/pb_kits/playbook/pb_layout/_layout.jsx +66 -14
  37. data/app/pb_kits/playbook/pb_layout/docs/_layout_colors.jsx +63 -0
  38. data/app/pb_kits/playbook/pb_layout/docs/_layout_sizes.jsx +87 -0
  39. data/app/pb_kits/playbook/pb_layout/docs/_layout_sizes_dark.jsx +92 -0
  40. data/app/pb_kits/playbook/pb_layout/docs/_layout_transparent.jsx +24 -0
  41. data/app/pb_kits/playbook/pb_layout/docs/example.yml +4 -1
  42. data/app/pb_kits/playbook/pb_layout/docs/index.js +4 -1
  43. data/app/pb_kits/playbook/pb_online_status/_online_status.jsx +31 -14
  44. data/app/pb_kits/playbook/pb_online_status/docs/_online_status_default.jsx +19 -0
  45. data/app/pb_kits/playbook/pb_online_status/docs/example.yml +3 -3
  46. data/app/pb_kits/playbook/pb_online_status/docs/index.js +1 -0
  47. data/app/pb_kits/playbook/pb_popover/_popover.jsx +2 -2
  48. data/app/pb_kits/playbook/pb_popover/docs/example.yml +0 -2
  49. data/app/pb_kits/playbook/pb_popover/docs/index.js +0 -1
  50. data/app/pb_kits/playbook/pb_progress_step/_progress_step.html.erb +6 -0
  51. data/app/pb_kits/playbook/pb_progress_step/_progress_step.jsx +35 -0
  52. data/app/pb_kits/playbook/pb_progress_step/_progress_step.scss +388 -0
  53. data/app/pb_kits/playbook/pb_progress_step/_progress_step_item.html.erb +23 -0
  54. data/app/pb_kits/playbook/pb_progress_step/_progress_step_item.jsx +44 -0
  55. data/app/pb_kits/playbook/pb_progress_step/docs/_description.md +1 -0
  56. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_dark.html.erb +8 -0
  57. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_dark.jsx +18 -0
  58. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_default.html.erb +33 -0
  59. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_default.jsx +39 -0
  60. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_vertical.html.erb +33 -0
  61. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_vertical.jsx +40 -0
  62. data/app/pb_kits/playbook/pb_progress_step/docs/example.yml +12 -0
  63. data/app/pb_kits/playbook/pb_progress_step/docs/index.js +3 -0
  64. data/app/pb_kits/playbook/pb_progress_step/progress_step.rb +33 -0
  65. data/app/pb_kits/playbook/pb_progress_step/progress_step_item.rb +19 -0
  66. data/app/pb_kits/playbook/pb_stat_change/docs/_stat_change_default.html.erb +1 -1
  67. data/app/pb_kits/playbook/pb_stat_change/docs/_stat_change_default.jsx +1 -1
  68. data/app/pb_kits/playbook/pb_stat_change/stat_change.rb +1 -1
  69. data/app/pb_kits/playbook/pb_timestamp/_timestamp.jsx +39 -14
  70. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_default.jsx +8 -0
  71. data/app/pb_kits/playbook/pb_timestamp/docs/example.yml +3 -3
  72. data/app/pb_kits/playbook/pb_timestamp/docs/index.js +1 -0
  73. data/app/pb_kits/playbook/pb_title_detail/_title_detail.jsx +47 -14
  74. data/app/pb_kits/playbook/pb_title_detail/docs/_title_detail_default.jsx +26 -0
  75. data/app/pb_kits/playbook/pb_title_detail/docs/example.yml +3 -3
  76. data/app/pb_kits/playbook/pb_title_detail/docs/index.js +1 -0
  77. data/app/pb_kits/playbook/pb_tooltip/_tooltip.html.erb +10 -0
  78. data/app/pb_kits/playbook/pb_tooltip/_tooltip.scss +105 -0
  79. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_default.html.erb +10 -0
  80. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_white.html.erb +9 -0
  81. data/app/pb_kits/playbook/pb_tooltip/docs/example.yml +5 -0
  82. data/app/pb_kits/playbook/pb_tooltip/index.js +80 -0
  83. data/app/pb_kits/playbook/pb_tooltip/tooltip.rb +34 -0
  84. data/app/pb_kits/playbook/tokens/_colors.scss +4 -0
  85. data/app/pb_kits/playbook/vendor.js +3 -0
  86. data/lib/playbook/version.rb +1 -1
  87. metadata +41 -6
  88. data/app/pb_kits/playbook/pb_layout/_body.jsx +0 -26
  89. data/app/pb_kits/playbook/pb_layout/_sidebar.jsx +0 -26
  90. data/app/pb_kits/playbook/pb_layout/docs/_layout_default.jsx +0 -14
  91. data/app/pb_kits/playbook/pb_popover/docs/_popover_with_button.html.erb +0 -4
@@ -1,224 +1,3 @@
1
1
  /* @flow */
2
2
 
3
- import React, { useState } from 'react'
4
- import {
5
- Button,
6
- Caption,
7
- Card,
8
- CircleIconButton,
9
- Flex,
10
- Icon,
11
- List,
12
- ListItem,
13
- PbReactPopover,
14
- SectionSeparator,
15
- Title,
16
- TitleCount,
17
- } from '../'
18
-
19
- type FilterProps = {
20
- background?: Boolean,
21
- className?: String,
22
- data?: String,
23
- id?: String,
24
- children?: React.Node,
25
- filters?: Array<Hash>,
26
- results?: Number,
27
- sortMenu?: Array<Hash>,
28
- template?: 'default' | 'filter_only' | 'sort_only' | 'single'
29
- }
30
-
31
- const Filter = ({
32
- background = true,
33
- className = 'pb_filter_kit',
34
- data,
35
- filters = [{}],
36
- id,
37
- children,
38
- results,
39
- sortMenu = null,
40
- template = 'default',
41
- }: FilterProps) => {
42
- const [showFilterOptions, setShowFilterOptions] = useState(false)
43
- const [showSortOptions, setShowSortOptions] = useState(false)
44
- const handleToggleFilters = () => {
45
- setShowFilterOptions(!showFilterOptions)
46
- }
47
- const handleToggleSort = () => {
48
- setShowSortOptions(!showSortOptions)
49
- }
50
-
51
- const filterButton = (
52
- <CircleIconButton
53
- icon="filter"
54
- id="filter"
55
- onClick={handleToggleFilters}
56
- text="filter"
57
- variant="secondary"
58
- />
59
- )
60
-
61
- const Filters = () => (
62
- <If condition={template != 'sort_only' && filters != null}>
63
- <PbReactPopover
64
- closeOnClick="outside"
65
- offset
66
- placement="bottom"
67
- reference={filterButton}
68
- show={showFilterOptions}
69
- >
70
- <div className="pb-form">
71
- {children}
72
- </div>
73
-
74
- </PbReactPopover>
75
- <div className="maskContainer">
76
- <div className="filters">
77
- <div className="left_gradient" />
78
- { filters.map((item, index) => (
79
- <div
80
- className="filter"
81
- key={index}
82
- >
83
- <Caption text={item.name} />
84
- <Title
85
- size={4}
86
- tag="h4"
87
- text={item.value}
88
- />
89
- </div>
90
- ))}
91
- <div className="right_gradient" />
92
- </div>
93
- </div>
94
- </If>
95
- )
96
-
97
- const activeSort = () => {
98
- return (
99
- sortMenu.map((item) => (
100
- item.active ? item.item : null
101
- ))
102
- )
103
- }
104
-
105
- const activeDirection = () => {
106
- let direction
107
- sortMenu.map((item) => {
108
- item.active ? direction = item.direction : null
109
- })
110
- const icon = direction == 'asc' ? 'sort-amount-up' : 'sort-amount-down'
111
- return icon
112
- }
113
-
114
- const sortButton = (
115
- <If condition={sortMenu != null}>
116
- <Button
117
- id="sort-button"
118
- onClick={handleToggleSort}
119
- variant="link"
120
- >
121
- {activeSort()}
122
- <Icon
123
- fixedWidth
124
- icon={`${activeDirection()}`}
125
- />
126
- </Button>
127
- </If>
128
- )
129
- const Results = () => {
130
- const resultsText = results > 1 ? 'Results' : 'Result'
131
- return (
132
- <If condition={results != undefined}>
133
- <If condition={template != 'default'}>
134
- <Caption
135
- className="filter-results"
136
- size="xs"
137
- text={`${results} ${resultsText}`}
138
- />
139
- <Else />
140
- <TitleCount
141
- align="center"
142
- count={results}
143
- title={`${resultsText}:`}
144
- />
145
- </If>
146
- </If>
147
- )
148
- }
149
- const Sort = () => (
150
- <If condition={template != 'filter_only'}>
151
- <Flex
152
- orientation="row"
153
- vertical="center"
154
- >
155
- <If condition={template == 'default'}>
156
- <Caption text="sort by:" />
157
- </If>
158
- <PbReactPopover
159
- closeOnClick="outside"
160
- offset
161
- placement="bottom"
162
- reference={sortButton}
163
- show={showSortOptions}
164
- >
165
- <List>
166
- {sortMenu ? sortMenu.map((item) => (
167
- <ListItem key={item.item}>
168
- <Button
169
- link={item.link}
170
- text={item.item}
171
- variant="link"
172
- />
173
- </ListItem>
174
- )) : null}
175
-
176
- </List>
177
- </PbReactPopover>
178
- </Flex>
179
- </If>
180
- )
181
- const Core = () => (
182
- <>
183
- <Flex
184
- orientation="row"
185
- vertical="center"
186
- >
187
- <Filters />
188
- <If condition={template != 'default'}>
189
- <Results />
190
- <Sort />
191
- </If>
192
- </Flex>
193
- <If condition={template == 'default'}>
194
- <SectionSeparator />
195
- <Flex
196
- className="filter-bottom"
197
- orientation="row"
198
- spacing="between"
199
- vertical="center"
200
- >
201
- <Results />
202
- <Sort />
203
- </Flex>
204
- </If>
205
- </>
206
- )
207
- return (
208
- <div
209
- className={className}
210
- data={data}
211
- id={id}
212
- >
213
- <If condition={background}>
214
- <Card padding="none">
215
- <Core />
216
- </Card>
217
- <Else />
218
- <Core />
219
- </If>
220
- </div>
221
- )
222
- }
223
-
224
- export default Filter
3
+ export { default } from './Filter'
@@ -1,27 +1,30 @@
1
1
  @import "../tokens/spacing";
2
2
  @import "../tokens/colors";
3
3
 
4
- [class^=pb_filter_kit] {
5
- [class^=pb_circle_icon_button_kit]{
6
- padding-left: $space_sm !important;
7
- padding-top: $space_sm !important;
8
- padding-bottom: $space_sm !important;
9
- }
10
- [class^=pb_card_body_kit][class*=_md]{
11
- padding: 0 !important;
12
- }
13
- [class^=pb_list_kit] li{
4
+ .pb_filter_sort_menu {
5
+ li {
14
6
  padding: 0 $space_sm !important;
15
7
  }
16
- [class^=pb-form]{
17
- padding: $space_sm ;
18
- }
19
8
  [class^=pb_button_kit][class*=_link]{
20
9
  flex-shrink:0;
21
10
  padding: 0 $space_xs !important;
22
11
  [id^="sort"]{
23
12
  margin-left: $space_xs !important;
24
13
  }
14
+ }
15
+ [class^=pb_card_body_kit][class*=_md]{
16
+ padding: 0 !important;
17
+ }
18
+ }
19
+
20
+ [class^=pb_filter_kit] {
21
+ [class^=pb_circle_icon_button_kit]{
22
+ padding-left: $space_sm !important;
23
+ padding-top: $space_sm !important;
24
+ padding-bottom: $space_sm !important;
25
+ }
26
+ [class^=pb-form]{
27
+ padding: $space_sm ;
25
28
  }
26
29
  .sort-by{
27
30
  flex-shrink:0;
@@ -1,46 +1,39 @@
1
- <% 5.times do%>
2
- <br>
3
- <%end%>
4
-
5
- <%= pb_rails("filter", props: {
6
- id: "1",
7
- filters: [
8
- {name: "name", value: "John Wick"}
1
+ <%=
2
+ pb_rails("filter", props: {
3
+ id: "1",
4
+ filters: [
5
+ { name: "name", value: "John Wick" }
6
+ ],
7
+ sort_menu: [
8
+ { item: "Popularity", link: "?q[sorts]=managers_popularity+asc", active: true, direction: "desc" },
9
+ { item: "Mananger's Title", link: "?q[sorts]=managers_title+asc", active: false },
10
+ { item: "Manager's Name", link: "?q[sorts]=managers_name+asc", active: false },
9
11
  ],
10
- sort_menu: [
11
- {item:"Popularity", link:"#", active: true, direction:"desc"},
12
- {item:"Title", link:"#", active: false},
13
- {item:"Name", link:"#", active: false},
14
- ],
15
- template:"default",
16
- results: 546,
17
- }) do%>
18
- <%
19
- example_collection = [
20
- OpenStruct.new(name: "Alabama", value: 1),
21
- OpenStruct.new(name: "Alaska", value: 2),
22
- OpenStruct.new(name: "Arizona", value: 3),
23
- OpenStruct.new(name: "Arkansas", value: 4),
24
- OpenStruct.new(name: "California", value: 5),
25
- OpenStruct.new(name: "Colorado", value: 6),
26
- OpenStruct.new(name: "Connecticut", value: 7),
27
- OpenStruct.new(name: "Delaware", value: 8),
28
- OpenStruct.new(name: "Florida", value: 9),
29
- OpenStruct.new(name: "Georgia", value: 10),
30
- ]
12
+ template: "default",
13
+ results: 546,
14
+ }) do
31
15
  %>
16
+ <%
17
+ example_collection = [
18
+ OpenStruct.new(name: "Alabama", value: 1),
19
+ OpenStruct.new(name: "Alaska", value: 2),
20
+ OpenStruct.new(name: "Arizona", value: 3),
21
+ OpenStruct.new(name: "Arkansas", value: 4),
22
+ OpenStruct.new(name: "California", value: 5),
23
+ OpenStruct.new(name: "Colorado", value: 6),
24
+ OpenStruct.new(name: "Connecticut", value: 7),
25
+ OpenStruct.new(name: "Delaware", value: 8),
26
+ OpenStruct.new(name: "Florida", value: 9),
27
+ OpenStruct.new(name: "Georgia", value: 10),
28
+ ]
29
+ %>
30
+ <%= pb_rails("form", props: { form_system_options: { scope: :example, method: :get } }) do |form| %>
31
+ <%= form.text_field :example_text_field, props: { label: true } %>
32
+ <%= form.collection_select :example_collection_select, example_collection, :value, :name, props: { label: true } %>
32
33
 
33
- <%= pb_rails("form", props: { form_system_options: { scope: :example, method: :get } }) do |form| %>
34
- <%= form.text_field :example_text_field, props: { label: true } %>
35
- <%= form.collection_select :example_collection_select, example_collection, :value, :name, props: { 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" } %>
34
+ <%= form.actions do |action| %>
35
+ <%= action.submit props: { text: "Apply", data: { disable_with: "<i class='far fa-spinner fa-spin mr-3'></i>Searching...".html_safe },}%>
36
+ <%= action.button props: { type: "reset", text: "Clear", variant: "secondary" } %>
37
+ <% end %>
40
38
  <% end %>
41
39
  <% end %>
42
-
43
- <% end %>
44
- <% 5.times do%>
45
- <br>
46
- <%end%>
@@ -11,16 +11,20 @@ const FilterDefault = () => {
11
11
  ]
12
12
  return (
13
13
  <Filter
14
- filters={[
15
- { name: 'Full Name', value: 'John Wick' },
16
- { name: 'Territory', value: 'San Francisco' },
17
- ]}
14
+ double
15
+ filters={{
16
+ 'Full Name': 'John Wick',
17
+ 'Territory': 'San Francisco',
18
+ }}
18
19
  results={256}
19
- sortMenu={[
20
- { item: 'Popularity', link: '#', active: true, direction: 'desc' },
21
- { item: 'Title', link: '#', active: false },
22
- { item: 'Name', link: '#', active: false },
23
- ]}
20
+ sortOptions={{
21
+ popularity: 'Popularity',
22
+ // eslint-disable-next-line
23
+ manager_title: 'Manager\'s Title',
24
+ // eslint-disable-next-line
25
+ manager_name: 'Manager\'s Name',
26
+ }}
27
+ sortValue={[{ name: 'popularity', dir: 'asc' }]}
24
28
  >
25
29
  <TextInput
26
30
  label="Full Name"
@@ -1,88 +1,83 @@
1
-
2
- <%= pb_rails("filter", props: {
3
- id:"3",
4
- background: false,
5
- filters: [
6
- {name: "name", value: "John Wick"}
1
+ <%=
2
+ pb_rails("filter", props: {
3
+ id: "3",
4
+ background: false,
5
+ filters: [
6
+ { name: "name", value: "John Wick" }
7
7
  ],
8
- sort_menu: [
9
- {item:"Popularity", link:"#", active: true, direction:"desc"},
10
- {item:"Title", link:"#", active: false},
11
- {item:"Name", link:"#", active: false},
12
- ],
13
- results: 1,
14
- template: "single"
15
- }) do%>
16
- <%
17
- example_collection = [
18
- OpenStruct.new(name: "Alabama", value: 1),
19
- OpenStruct.new(name: "Alaska", value: 2),
20
- OpenStruct.new(name: "Arizona", value: 3),
21
- OpenStruct.new(name: "Arkansas", value: 4),
22
- OpenStruct.new(name: "California", value: 5),
23
- OpenStruct.new(name: "Colorado", value: 6),
24
- OpenStruct.new(name: "Connecticut", value: 7),
25
- OpenStruct.new(name: "Delaware", value: 8),
26
- OpenStruct.new(name: "Florida", value: 9),
27
- OpenStruct.new(name: "Georgia", value: 10),
28
- ]
8
+ sort_menu: [
9
+ { item: "Popularity", link: "?q[sorts]=managers_popularity+asc", active: true, direction: "desc" },
10
+ { item: "Mananger's Title", link: "?q[sorts]=managers_title+asc", active: false },
11
+ { item: "Manager's Name", link: "?q[sorts]=managers_name+asc", active: false },
12
+ ],
13
+ results: 1,
14
+ template: "single"
15
+ }) do
29
16
  %>
17
+ <%
18
+ example_collection = [
19
+ OpenStruct.new(name: "Alabama", value: 1),
20
+ OpenStruct.new(name: "Alaska", value: 2),
21
+ OpenStruct.new(name: "Arizona", value: 3),
22
+ OpenStruct.new(name: "Arkansas", value: 4),
23
+ OpenStruct.new(name: "California", value: 5),
24
+ OpenStruct.new(name: "Colorado", value: 6),
25
+ OpenStruct.new(name: "Connecticut", value: 7),
26
+ OpenStruct.new(name: "Delaware", value: 8),
27
+ OpenStruct.new(name: "Florida", value: 9),
28
+ OpenStruct.new(name: "Georgia", value: 10),
29
+ ]
30
+ %>
30
31
 
31
- <%= pb_rails("form", props: { form_system_options: { scope: :example, method: :get } }) do |form| %>
32
- <%= form.text_field :example_text_field, props: { label: true } %>
33
- <%= form.collection_select :example_collection_select, example_collection, :value, :name, props: { label: true } %>
32
+ <%= pb_rails("form", props: { form_system_options: { scope: :example, method: :get } }) do |form| %>
33
+ <%= form.text_field :example_text_field, props: { label: true } %>
34
+ <%= form.collection_select :example_collection_select, example_collection, :value, :name, props: { label: true } %>
34
35
 
35
- <%= form.actions do |action| %>
36
- <%= action.submit props: { text: "Apply", data: { disable_with: "<i class='far fa-spinner fa-spin mr-3'></i>Searching...".html_safe },}%>
37
- <%= action.button props: { type: "reset", text: "Clear", variant: "secondary" } %>
36
+ <%= form.actions do |action| %>
37
+ <%= action.submit props: { text: "Apply", data: { disable_with: "<i class='far fa-spinner fa-spin mr-3'></i>Searching...".html_safe },}%>
38
+ <%= action.button props: { type: "reset", text: "Clear", variant: "secondary" } %>
39
+ <% end %>
38
40
  <% end %>
39
41
  <% end %>
40
42
 
41
- <% end %>
42
-
43
- <% 2.times do%>
44
43
  <br>
45
- <%end%>
46
44
 
47
-
48
- <%= pb_rails("filter", props: {
49
- id:"4",
50
- background: false,
51
- filters: [
52
- {name: "name", value: "John Wick"}
45
+ <%=
46
+ pb_rails("filter", props: {
47
+ id: "4",
48
+ background: false,
49
+ filters: [
50
+ { name: "name", value: "John Wick" }
53
51
  ],
54
- sort_menu: [
55
- {item:"Popularity", link:"#", active: true, direction:"desc"},
56
- {item:"Title", link:"#", active: false},
57
- {item:"Name", link:"#", active: false},
58
- ],
59
- results: 546,
60
-
61
- }) do%>
62
- <%
63
- example_collection = [
64
- OpenStruct.new(name: "Alabama", value: 1),
65
- OpenStruct.new(name: "Alaska", value: 2),
66
- OpenStruct.new(name: "Arizona", value: 3),
67
- OpenStruct.new(name: "Arkansas", value: 4),
68
- OpenStruct.new(name: "California", value: 5),
69
- OpenStruct.new(name: "Colorado", value: 6),
70
- OpenStruct.new(name: "Connecticut", value: 7),
71
- OpenStruct.new(name: "Delaware", value: 8),
72
- OpenStruct.new(name: "Florida", value: 9),
73
- OpenStruct.new(name: "Georgia", value: 10),
74
- ]
52
+ sort_menu: [
53
+ { item: "Popularity", link: "?q[sorts]=managers_popularity+asc", active: true, direction: "desc" },
54
+ { item: "Mananger's Title", link: "?q[sorts]=managers_title+asc", active: false },
55
+ { item: "Manager's Name", link: "?q[sorts]=managers_name+asc", active: false },
56
+ ],
57
+ results: 546,
58
+ }) do
75
59
  %>
60
+ <%
61
+ example_collection = [
62
+ OpenStruct.new(name: "Alabama", value: 1),
63
+ OpenStruct.new(name: "Alaska", value: 2),
64
+ OpenStruct.new(name: "Arizona", value: 3),
65
+ OpenStruct.new(name: "Arkansas", value: 4),
66
+ OpenStruct.new(name: "California", value: 5),
67
+ OpenStruct.new(name: "Colorado", value: 6),
68
+ OpenStruct.new(name: "Connecticut", value: 7),
69
+ OpenStruct.new(name: "Delaware", value: 8),
70
+ OpenStruct.new(name: "Florida", value: 9),
71
+ OpenStruct.new(name: "Georgia", value: 10),
72
+ ]
73
+ %>
74
+ <%= pb_rails("form", props: { form_system_options: { scope: :example, method: :get } }) do |form| %>
75
+ <%= form.text_field :example_text_field, props: { label: true } %>
76
+ <%= form.collection_select :example_collection_select, example_collection, :value, :name, props: { label: true } %>
76
77
 
77
- <%= pb_rails("form", props: { form_system_options: { scope: :example, method: :get } }) do |form| %>
78
- <%= form.text_field :example_text_field, props: { label: true } %>
79
- <%= form.collection_select :example_collection_select, example_collection, :value, :name, props: { label: true } %>
80
-
81
- <%= form.actions do |action| %>
82
- <%= action.submit props: { text: "Apply", data: { disable_with: "<i class='far fa-spinner fa-spin mr-3'></i>Searching...".html_safe },}%>
83
- <%= action.button props: { type: "reset", text: "Clear", variant: "secondary" } %>
78
+ <%= form.actions do |action| %>
79
+ <%= action.submit props: { text: "Apply", data: { disable_with: "<i class='far fa-spinner fa-spin mr-3'></i>Searching...".html_safe },}%>
80
+ <%= action.button props: { type: "reset", text: "Clear", variant: "secondary" } %>
81
+ <% end %>
84
82
  <% end %>
85
83
  <% end %>
86
-
87
- <% end %>
88
-
@@ -12,16 +12,19 @@ const FilterNoBackground = () => {
12
12
  return (
13
13
  <Filter
14
14
  background={false}
15
- filters={[
16
- { name: 'Full Name', value: 'John Wick' },
17
- { name: 'Territory', value: 'San Francisco' },
18
- ]}
15
+ filters={{
16
+ 'Full Name': 'John Wick',
17
+ 'Territory': 'San Francisco',
18
+ }}
19
19
  results={256}
20
- sortMenu={[
21
- { item: 'Popularity', link: '#', active: true, direction: 'desc' },
22
- { item: 'Title', link: '#', active: false },
23
- { item: 'Name', link: '#', active: false },
24
- ]}
20
+ sortOptions={{
21
+ popularity: 'Popularity',
22
+ // eslint-disable-next-line
23
+ manager_title: 'Manager\'s Title',
24
+ // eslint-disable-next-line
25
+ manager_name: 'Manager\'s Name',
26
+ }}
27
+ sortValue={[{ name: 'popularity', dir: 'asc' }]}
25
28
  >
26
29
  <TextInput
27
30
  label="Full Name"
@@ -1,40 +1,33 @@
1
- <% 5.times do%>
2
- <br>
3
- <%end%>
4
-
5
- <%= pb_rails("filter", props: {
6
- id: "fo",
7
- filters: [
8
- {name: "name", value: "John Wick"}
1
+ <%=
2
+ pb_rails("filter", props: {
3
+ id: "fo",
4
+ filters: [
5
+ { name: "name", value: "John Wick" }
9
6
  ],
10
- template:"filter_only"
11
- }) do%>
12
- <%
13
- example_collection = [
14
- OpenStruct.new(name: "Alabama", value: 1),
15
- OpenStruct.new(name: "Alaska", value: 2),
16
- OpenStruct.new(name: "Arizona", value: 3),
17
- OpenStruct.new(name: "Arkansas", value: 4),
18
- OpenStruct.new(name: "California", value: 5),
19
- OpenStruct.new(name: "Colorado", value: 6),
20
- OpenStruct.new(name: "Connecticut", value: 7),
21
- OpenStruct.new(name: "Delaware", value: 8),
22
- OpenStruct.new(name: "Florida", value: 9),
23
- OpenStruct.new(name: "Georgia", value: 10),
24
- ]
7
+ template:"filter_only"
8
+ }) do
25
9
  %>
10
+ <%
11
+ example_collection = [
12
+ OpenStruct.new(name: "Alabama", value: 1),
13
+ OpenStruct.new(name: "Alaska", value: 2),
14
+ OpenStruct.new(name: "Arizona", value: 3),
15
+ OpenStruct.new(name: "Arkansas", value: 4),
16
+ OpenStruct.new(name: "California", value: 5),
17
+ OpenStruct.new(name: "Colorado", value: 6),
18
+ OpenStruct.new(name: "Connecticut", value: 7),
19
+ OpenStruct.new(name: "Delaware", value: 8),
20
+ OpenStruct.new(name: "Florida", value: 9),
21
+ OpenStruct.new(name: "Georgia", value: 10),
22
+ ]
23
+ %>
24
+ <%= pb_rails("form", props: { form_system_options: { scope: :example, method: :get } }) do |form| %>
25
+ <%= form.text_field :example_text_field, props: { label: true } %>
26
+ <%= form.collection_select :example_collection_select, example_collection, :value, :name, props: { label: true } %>
26
27
 
27
- <%= pb_rails("form", props: { form_system_options: { scope: :example, method: :get } }) do |form| %>
28
- <%= form.text_field :example_text_field, props: { label: true } %>
29
- <%= form.collection_select :example_collection_select, example_collection, :value, :name, props: { label: true } %>
30
-
31
- <%= form.actions do |action| %>
32
- <%= action.submit props: { text: "Apply", data: { disable_with: "<i class='far fa-spinner fa-spin mr-3'></i>Searching...".html_safe },}%>
33
- <%= action.button props: { type: "reset", text: "Clear", variant: "secondary" } %>
28
+ <%= form.actions do |action| %>
29
+ <%= action.submit props: { text: "Apply", data: { disable_with: "<i class='far fa-spinner fa-spin mr-3'></i>Searching...".html_safe },}%>
30
+ <%= action.button props: { type: "reset", text: "Clear", variant: "secondary" } %>
31
+ <% end %>
34
32
  <% end %>
35
33
  <% end %>
36
-
37
- <% end %>
38
- <% 5.times do%>
39
- <br>
40
- <%end%>
@@ -12,12 +12,11 @@ const FilterOnly = () => {
12
12
  return (
13
13
  <Filter
14
14
  background={false}
15
- filters={[
16
- { name: 'Full Name', value: 'John Wick' },
17
- { name: 'Territory', value: 'San Francisco' },
18
- ]}
19
- results={1}
20
- template="filter_only"
15
+ filters={{
16
+ 'Full Name': 'John Wick',
17
+ 'Territory': 'San Francisco',
18
+ }}
19
+ results={256}
21
20
  >
22
21
  <TextInput
23
22
  label="Full Name"