playbook_ui 9.3.1.pre.alpha2 → 9.4.0.alpha.user.kit.bug
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_checkbox/_checkbox.jsx +2 -1
- data/app/pb_kits/playbook/pb_checkbox/_checkbox.scss +3 -2
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_indeterminate.jsx +67 -9
- data/app/pb_kits/playbook/pb_nav/_vertical_nav.scss +1 -1
- data/app/pb_kits/playbook/pb_nav/docs/_block_nav.html.erb +41 -5
- data/app/pb_kits/playbook/pb_nav/docs/_block_nav.jsx +44 -6
- data/lib/playbook/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d58bd43051948ed88cd448d6a1af339b38f5b53ec707cd6d49b10cb227cc8d5
|
4
|
+
data.tar.gz: 33d5becc70eebf7f7ed08f452ff2b3422d1891d93829e529ef59e2425dca64a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7731ea2e841c7520aaed03654f9983fff519785df5622292b5a47be9ebfd0de6119c7d47378e3c35a5077ca576b68c26cb4bf5967847f6a89e6dd530a8093bb
|
7
|
+
data.tar.gz: 3c118b92821665486442b8eb870d2807f9bf64ed6cbfd62d017c667e8b6df11b76fb173e70fdc0551fd2bb54f82b5572ae33527748d3ad09dff88c96ee9865c1
|
@@ -53,9 +53,10 @@ const Checkbox = (props: CheckboxProps) => {
|
|
53
53
|
|
54
54
|
useEffect(() => {
|
55
55
|
if (checkRef.current) {
|
56
|
+
checkRef.current.checked = checked
|
56
57
|
checkRef.current.indeterminate = indeterminate
|
57
58
|
}
|
58
|
-
}, [indeterminate])
|
59
|
+
}, [indeterminate, checked])
|
59
60
|
|
60
61
|
return (
|
61
62
|
<label
|
@@ -4,12 +4,13 @@
|
|
4
4
|
$transition: $transition_cubic;
|
5
5
|
|
6
6
|
[class^=pb_checkbox_kit] {
|
7
|
-
display: inline-flex;
|
8
7
|
cursor: pointer;
|
8
|
+
display: inline-flex;
|
9
|
+
vertical-align: middle;
|
9
10
|
.pb_checkbox_label {
|
10
|
-
padding-left: $space_xs;
|
11
11
|
cursor: pointer;
|
12
12
|
font-size: $text_lt_default;
|
13
|
+
padding-left: $space_xs;
|
13
14
|
user-select: none;
|
14
15
|
}
|
15
16
|
|
@@ -1,15 +1,73 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
import { Checkbox } from '../..'
|
1
|
+
import React, { useState } from 'react'
|
2
|
+
import { Checkbox, Table } from '../..'
|
3
3
|
|
4
4
|
const CheckboxIndeterminate = (props) => {
|
5
|
+
const [checkboxes, setCheckboxes] = useState([
|
6
|
+
{ name: 'Coffee', checked: false },
|
7
|
+
{ name: 'Ice Cream', checked: false },
|
8
|
+
{ name: 'Chocolate', checked: true },
|
9
|
+
])
|
10
|
+
|
11
|
+
const isAllChecked = !checkboxes.find((checkbox) => !checkbox.checked)
|
12
|
+
const isNoneChecked = !checkboxes.find((checkbox) => checkbox.checked)
|
13
|
+
|
14
|
+
const processCheckboxes = (checked) =>
|
15
|
+
checkboxes.slice(0).map((checkbox) => {
|
16
|
+
checkbox.checked = checked
|
17
|
+
return checkbox
|
18
|
+
})
|
19
|
+
|
20
|
+
const onToggleAll = () => {
|
21
|
+
setCheckboxes(
|
22
|
+
isNoneChecked ? processCheckboxes(true) : processCheckboxes(false)
|
23
|
+
)
|
24
|
+
}
|
25
|
+
|
26
|
+
const updateCheckboxes = (checkbox, index) => {
|
27
|
+
const newCheckboxes = checkboxes.slice(0)
|
28
|
+
newCheckboxes[index].checked = !checkbox.checked
|
29
|
+
setCheckboxes(newCheckboxes)
|
30
|
+
}
|
31
|
+
|
5
32
|
return (
|
6
|
-
<
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
33
|
+
<Table
|
34
|
+
container={false}
|
35
|
+
size="md"
|
36
|
+
>
|
37
|
+
<thead>
|
38
|
+
<tr>
|
39
|
+
<th>
|
40
|
+
<Checkbox
|
41
|
+
checked={isAllChecked}
|
42
|
+
indeterminate={!isAllChecked && !isNoneChecked}
|
43
|
+
name="checkbox-name"
|
44
|
+
onChange={onToggleAll}
|
45
|
+
text={isNoneChecked ? 'Check All' : 'Uncheck All'}
|
46
|
+
value="check-box value"
|
47
|
+
{...props}
|
48
|
+
/>
|
49
|
+
</th>
|
50
|
+
</tr>
|
51
|
+
</thead>
|
52
|
+
<tbody>
|
53
|
+
{checkboxes.map((checkbox, index) => (
|
54
|
+
<tr key={index}>
|
55
|
+
<td>
|
56
|
+
<Checkbox
|
57
|
+
checked={checkbox.checked}
|
58
|
+
name={checkbox.name}
|
59
|
+
onChange={() => {
|
60
|
+
updateCheckboxes(checkbox, index)
|
61
|
+
}}
|
62
|
+
text={checkbox.name}
|
63
|
+
value="check-box value"
|
64
|
+
{...props}
|
65
|
+
/>
|
66
|
+
</td>
|
67
|
+
</tr>
|
68
|
+
))}
|
69
|
+
</tbody>
|
70
|
+
</Table>
|
13
71
|
)
|
14
72
|
}
|
15
73
|
|
@@ -1,6 +1,42 @@
|
|
1
|
-
<%= pb_rails("nav", props: {title: "
|
2
|
-
<%= pb_rails("nav/item", props: { link: "#", active: true }) do%>
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
<%= pb_rails("nav", props: {title: "Users", link: "#"}) do %>
|
2
|
+
<%= pb_rails("nav/item", props: { link: "#", active: true }) do%>
|
3
|
+
<%= pb_rails("user", props: {
|
4
|
+
name: "Anna Black",
|
5
|
+
territory: "PHL",
|
6
|
+
title: "Remodeling Consultant",
|
7
|
+
orientation: "horizontal",
|
8
|
+
align: "left",
|
9
|
+
avatar_url: "https://randomuser.me/api/portraits/women/44.jpg"
|
10
|
+
}) %>
|
11
|
+
<% end %>
|
12
|
+
<%= pb_rails("nav/item", props: { link: "#" }) do%>
|
13
|
+
<%= pb_rails("user", props: {
|
14
|
+
name: "Julie Hamilton",
|
15
|
+
territory: "PHL",
|
16
|
+
title: "Inside Sales Agent",
|
17
|
+
orientation: "horizontal",
|
18
|
+
align: "left",
|
19
|
+
avatar_url: "https://randomuser.me/api/portraits/women/45.jpg"
|
20
|
+
}) %>
|
21
|
+
<% end %>
|
22
|
+
<%= pb_rails("nav/item", props: { link: "#" }) do%>
|
23
|
+
<%= pb_rails("user", props: {
|
24
|
+
name: "Dennis Wilks",
|
25
|
+
territory: "PHL",
|
26
|
+
title: "Senior Remodeling Consultant",
|
27
|
+
orientation: "horizontal",
|
28
|
+
align: "left",
|
29
|
+
avatar_url: "https://randomuser.me/api/portraits/men/44.jpg"
|
30
|
+
}) %>
|
31
|
+
<% end %>
|
32
|
+
<%= pb_rails("nav/item", props: { link: "#" }) do%>
|
33
|
+
<%= pb_rails("user", props: {
|
34
|
+
name: "Ronnie Martin",
|
35
|
+
territory: "PHL",
|
36
|
+
title: "Customer Development Representative",
|
37
|
+
orientation: "horizontal",
|
38
|
+
align: "left",
|
39
|
+
avatar_url: "https://randomuser.me/api/portraits/men/46.jpg"
|
40
|
+
}) %>
|
41
|
+
<% end %>
|
6
42
|
<% end %>
|
@@ -1,12 +1,12 @@
|
|
1
1
|
import React from 'react'
|
2
|
-
import { Nav } from '../../'
|
2
|
+
import { Nav, User } from '../../'
|
3
3
|
import NavItem from '../_item.jsx'
|
4
4
|
|
5
5
|
const BlockNav = (props) => {
|
6
6
|
return (
|
7
7
|
<Nav
|
8
8
|
link="#"
|
9
|
-
title="
|
9
|
+
title="Users"
|
10
10
|
{...props}
|
11
11
|
>
|
12
12
|
<NavItem
|
@@ -14,11 +14,49 @@ const BlockNav = (props) => {
|
|
14
14
|
link="#"
|
15
15
|
{...props}
|
16
16
|
>
|
17
|
-
|
17
|
+
<User
|
18
|
+
align="left"
|
19
|
+
avatarUrl="https://randomuser.me/api/portraits/women/44.jpg"
|
20
|
+
name="Anna Black"
|
21
|
+
orientation="horizontal"
|
22
|
+
territory="PHL"
|
23
|
+
title="Remodeling Consultant"
|
24
|
+
{...props}
|
25
|
+
/>
|
26
|
+
</NavItem>
|
27
|
+
<NavItem link="#">
|
28
|
+
<User
|
29
|
+
align="left"
|
30
|
+
avatarUrl="https://randomuser.me/api/portraits/women/45.jpg"
|
31
|
+
name="Julie Hamilton"
|
32
|
+
orientation="horizontal"
|
33
|
+
territory="PHL"
|
34
|
+
title="Inside Sales Agent"
|
35
|
+
{...props}
|
36
|
+
/>
|
37
|
+
</NavItem>
|
38
|
+
<NavItem link="#">
|
39
|
+
<User
|
40
|
+
align="left"
|
41
|
+
avatarUrl="https://randomuser.me/api/portraits/men/44.jpg"
|
42
|
+
name="Dennis Wilks"
|
43
|
+
orientation="horizontal"
|
44
|
+
territory="PHL"
|
45
|
+
title="Senior Remodeling Consultant"
|
46
|
+
{...props}
|
47
|
+
/>
|
48
|
+
</NavItem>
|
49
|
+
<NavItem link="#">
|
50
|
+
<User
|
51
|
+
align="left"
|
52
|
+
avatarUrl="https://randomuser.me/api/portraits/men/46.jpg"
|
53
|
+
name="Ronnie Martin"
|
54
|
+
orientation="horizontal"
|
55
|
+
territory="PHL"
|
56
|
+
title="Customer Development Representative"
|
57
|
+
{...props}
|
58
|
+
/>
|
18
59
|
</NavItem>
|
19
|
-
<NavItem link="#">{'Music'}</NavItem>
|
20
|
-
<NavItem link="#">{'Video'}</NavItem>
|
21
|
-
<NavItem link="#">{'Files'}</NavItem>
|
22
60
|
</Nav>
|
23
61
|
)
|
24
62
|
}
|
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: 9.
|
4
|
+
version: 9.4.0.alpha.user.kit.bug
|
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: 2021-04-
|
12
|
+
date: 2021-04-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|
@@ -2107,8 +2107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
2107
2107
|
- !ruby/object:Gem::Version
|
2108
2108
|
version: 1.3.1
|
2109
2109
|
requirements: []
|
2110
|
-
|
2111
|
-
rubygems_version: 2.7.3
|
2110
|
+
rubygems_version: 3.1.4
|
2112
2111
|
signing_key:
|
2113
2112
|
specification_version: 4
|
2114
2113
|
summary: Playbook Design System
|