playbook_ui_docs 13.21.0.pre.alpha.PBNTR225advancedtablefeedback2438 → 13.21.0.pre.alpha.PLAY12582474
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_advanced_table/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_multi_line.html.erb +51 -1
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_multi_line.jsx +62 -11
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_positions.html.erb +7 -2
- data/app/pb_kits/playbook/pb_flex/docs/_flex_spacing.html.erb +0 -4
- data/dist/playbook-doc.js +6 -6
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 355c5f2e4f6b09a4409aedc6f6c69514390af804c251dc1662232eaa94b2b441
|
4
|
+
data.tar.gz: d2c41204c8551916731e66ebefb124df0e1d711bcf85dd3ffff62f9c5d86da0a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e6eb67e15ab413c5e784b4cee06beb389a58d246550ee3208cf95185df5a3ded7c28278ba56164b6dc404159e89b07296c86dbabe99bec9969eee25eb93c2ba
|
7
|
+
data.tar.gz: 3fc86ff626fd3d298bcd2327a2bf10152eb097b0dfa5646d7d4079b3068696bd4cfc7411c979e5678fef5dd2947f5af16372b629e117426c217ea3c9ade52094
|
@@ -1,5 +1,55 @@
|
|
1
|
+
<%= pb_rails("button", props: { text: "Short Multiline", variant: "secondary", data: { multitoast: "#toast-short" } }) %>
|
2
|
+
|
1
3
|
<%= pb_rails("fixed_confirmation_toast", props: {
|
4
|
+
classname: "multitoast-to-hide",
|
5
|
+
closeable: true,
|
6
|
+
id: "toast-short",
|
2
7
|
multi_line: true,
|
3
|
-
text: "
|
8
|
+
text: "Multi-line is used when the given text will not fit on one line.",
|
4
9
|
status: "tip",
|
10
|
+
vertical: "top",
|
11
|
+
horizontal: "center"
|
5
12
|
}) %>
|
13
|
+
|
14
|
+
<%= pb_rails("button", props: { text: "Long Multiline", variant: "secondary", data: { multitoast: "#toast-long" } }) %>
|
15
|
+
|
16
|
+
<%= pb_rails("fixed_confirmation_toast", props: {
|
17
|
+
classname: "multitoast-to-hide",
|
18
|
+
closeable: true,
|
19
|
+
id: "toast-long",
|
20
|
+
multi_line: true,
|
21
|
+
text: "Multi-line is used when the given text will not fit on one line. Using Multi Line allows the height of the confirmation toast to grow. Simply resize the screen to see the fixed confirmation toast wrap the text.",
|
22
|
+
status: "tip",
|
23
|
+
vertical: "top",
|
24
|
+
horizontal: "center"
|
25
|
+
}) %>
|
26
|
+
|
27
|
+
|
28
|
+
<script type="text/javascript">
|
29
|
+
const multitoasts = document.querySelectorAll(".multitoast-to-hide")
|
30
|
+
const multibuttons = document.querySelectorAll("button[data-multitoast]")
|
31
|
+
|
32
|
+
const hideMultiToasts = () => {
|
33
|
+
multitoasts.forEach((toast) => {
|
34
|
+
toast.style.display = "none"
|
35
|
+
})
|
36
|
+
}
|
37
|
+
|
38
|
+
multibuttons.forEach((button) => {
|
39
|
+
button.onclick = () => {
|
40
|
+
hideMultiToasts()
|
41
|
+
let toast = document.querySelector(button.getAttribute("data-multitoast"))
|
42
|
+
|
43
|
+
if (toast) {
|
44
|
+
toast.style.display = "flex"
|
45
|
+
}
|
46
|
+
}
|
47
|
+
})
|
48
|
+
</script>
|
49
|
+
|
50
|
+
<!-- hiding toast on page load -->
|
51
|
+
<style>
|
52
|
+
#toast-long, #toast-short {
|
53
|
+
display: none;
|
54
|
+
}
|
55
|
+
</style>
|
data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_multi_line.jsx
CHANGED
@@ -1,18 +1,69 @@
|
|
1
|
-
import React from 'react'
|
1
|
+
import React, { useState } from 'react'
|
2
2
|
|
3
|
+
import Button from '../../pb_button/_button'
|
3
4
|
import FixedConfirmationToast from '../_fixed_confirmation_toast'
|
4
5
|
|
5
6
|
const FixedConfirmationToastMultiLine = (props) => {
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
7
|
+
|
8
|
+
const [openShort, setOpenShort] = useState(false)
|
9
|
+
const [openLong, setOpenLong] = useState(false)
|
10
|
+
|
11
|
+
const handleClickShort = () => {
|
12
|
+
setOpenShort(true)
|
13
|
+
}
|
14
|
+
const handleClickLong= () => {
|
15
|
+
setOpenLong(true)
|
16
|
+
}
|
17
|
+
|
18
|
+
const handleCloseShort = () => {
|
19
|
+
setOpenShort(false)
|
20
|
+
}
|
21
|
+
|
22
|
+
const handleCloseLong= () => {
|
23
|
+
setOpenLong(false)
|
24
|
+
}
|
25
|
+
|
26
|
+
return (
|
27
|
+
<>
|
28
|
+
<Button
|
29
|
+
onClick={handleClickShort}
|
30
|
+
text="Short Multiline"
|
31
|
+
variant="secondary"
|
32
|
+
{...props}
|
33
|
+
/>
|
34
|
+
{' '}
|
35
|
+
<Button
|
36
|
+
onClick={handleClickLong}
|
37
|
+
text="Long Multiline"
|
38
|
+
variant="secondary"
|
39
|
+
{...props}
|
40
|
+
/>
|
41
|
+
|
42
|
+
<FixedConfirmationToast
|
43
|
+
closeable
|
44
|
+
horizontal='center'
|
45
|
+
multiLine
|
46
|
+
onClose={handleCloseShort}
|
47
|
+
open={openShort}
|
48
|
+
status='tip'
|
49
|
+
text='Multi-line is used when the given text will not fit on one line.'
|
50
|
+
vertical='top'
|
51
|
+
{...props}
|
52
|
+
/>
|
53
|
+
|
54
|
+
<FixedConfirmationToast
|
55
|
+
closeable
|
56
|
+
horizontal='center'
|
57
|
+
multiLine
|
58
|
+
onClose={handleCloseLong}
|
59
|
+
open={openLong}
|
60
|
+
status='tip'
|
61
|
+
text='Multi-line is used when the given text will not fit on one line. Using Multi Line allows the height of the confirmation toast to grow. Simply resize the screen to see the fixed confirmation toast wrap the text.'
|
62
|
+
vertical='top'
|
63
|
+
{...props}
|
64
|
+
/>
|
65
|
+
</>
|
66
|
+
)
|
16
67
|
}
|
17
68
|
|
18
69
|
export default FixedConfirmationToastMultiLine
|
@@ -75,8 +75,6 @@
|
|
75
75
|
})
|
76
76
|
}
|
77
77
|
|
78
|
-
hideToasts()
|
79
|
-
|
80
78
|
buttons.forEach((button) => {
|
81
79
|
button.onclick = () => {
|
82
80
|
hideToasts()
|
@@ -88,3 +86,10 @@
|
|
88
86
|
}
|
89
87
|
})
|
90
88
|
</script>
|
89
|
+
|
90
|
+
<!-- hiding toast on page load -->
|
91
|
+
<style>
|
92
|
+
#toast-top-center, #toast-top-right, #toast-top-left, #toast-bottom-center, #toast-bottom-right, #toast-bottom-left {
|
93
|
+
display: none;
|
94
|
+
}
|
95
|
+
</style>
|