playbook_ui_docs 14.3.0.pre.rc.4 → 14.3.0.pre.rc.5
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_radio/docs/_radio_children.jsx +56 -0
- data/app/pb_kits/playbook/pb_radio/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_radio/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_preview.html.erb +21 -11
- data/dist/playbook-doc.js +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf44a66b8e7898084910ad11f4f8e06fb9109c17845ba6c6e5585d7d7e7ed101
|
4
|
+
data.tar.gz: 952f28d3ccf5eb2962f059c9259f97911b4608a354dc637602c223cee586f365
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aec071c5dc3951beca0d5855f01e98e746c67e2cad04db8801cd9c1c0682751b4ee9142371c05ab5304c5f80b20b4b82913b6a5021cf1bf24f626b0fa5b461bb
|
7
|
+
data.tar.gz: c26441aecfbbf8e2fd32aacef10d6582e467e9653fc304c08dc682f3905f36f16334b69467de750404f82648ffbd5f977b4f70deff54582d0abacd270a76b8c9
|
@@ -0,0 +1,56 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import Radio from '../_radio'
|
3
|
+
import Select from '../../pb_select/_select'
|
4
|
+
import Typeahead from '../../pb_typeahead/_typeahead'
|
5
|
+
import Title from '../../pb_title/_title'
|
6
|
+
|
7
|
+
const RadioChildren = (props) => {
|
8
|
+
|
9
|
+
|
10
|
+
const options = [
|
11
|
+
{ label: 'Orange', value: 'Orange' },
|
12
|
+
{ label: 'Red', value: 'Red' },
|
13
|
+
{ label: 'Green', value: 'Green' },
|
14
|
+
{ label: 'Blue', value: 'Blue' },
|
15
|
+
]
|
16
|
+
|
17
|
+
return (
|
18
|
+
<div>
|
19
|
+
<Radio
|
20
|
+
label="Select"
|
21
|
+
name="Group1"
|
22
|
+
tabIndex={0}
|
23
|
+
value="Select"
|
24
|
+
{...props}
|
25
|
+
>
|
26
|
+
<Select
|
27
|
+
minWidth="xs"
|
28
|
+
options={options}
|
29
|
+
/>
|
30
|
+
</Radio>
|
31
|
+
<Radio
|
32
|
+
label="Typeahead"
|
33
|
+
name="Group1"
|
34
|
+
tabIndex={0}
|
35
|
+
value="Typeahead"
|
36
|
+
{...props}
|
37
|
+
>
|
38
|
+
<Typeahead
|
39
|
+
minWidth="xs"
|
40
|
+
options={options}
|
41
|
+
/>
|
42
|
+
</Radio>
|
43
|
+
<br />
|
44
|
+
<Radio
|
45
|
+
defaultChecked={false}
|
46
|
+
label="Typography"
|
47
|
+
name="Group1"
|
48
|
+
value="Typography"
|
49
|
+
{...props}
|
50
|
+
>
|
51
|
+
<Title text="Custom Typography" />
|
52
|
+
</Radio>
|
53
|
+
</div>
|
54
|
+
)
|
55
|
+
}
|
56
|
+
export default RadioChildren
|
@@ -3,3 +3,4 @@ export { default as RadioCustom } from './_radio_custom.jsx'
|
|
3
3
|
export { default as RadioError } from './_radio_error.jsx'
|
4
4
|
export { default as RadioAlignment } from './_radio_alignment.jsx'
|
5
5
|
export { default as RadioDisabled } from './_radio_disabled.jsx'
|
6
|
+
export { default as RadioChildren } from './_radio_children.jsx'
|
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
<%= pb_rails("rich_text_editor", props: { id: "content-preview-editor" }) %>
|
3
3
|
<div id="card-obfuscation" style="display:none">
|
4
|
-
<%= pb_rails("card", props: { margin_top: "md" }) do %>
|
4
|
+
<%= pb_rails("card", props: { margin_top: "md", max_width: "md", padding: "sm" }) do %>
|
5
5
|
<div id="content-preview" class="trix-content">
|
6
6
|
</div>
|
7
7
|
<% end %>
|
@@ -11,15 +11,25 @@
|
|
11
11
|
<% end %>
|
12
12
|
|
13
13
|
<script>
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
const previewArea = document.getElementById('content-preview');
|
19
|
-
const cardDiv = document.getElementById('card-obfuscation');
|
14
|
+
document.addEventListener('DOMContentLoaded', () => {
|
15
|
+
function handleButtonClick() {
|
16
|
+
const editorContainer = [...document.querySelectorAll('[data-react-props]')]
|
17
|
+
.find(element => element.getAttribute('data-react-props')?.includes('"id":"content-preview-editor"'))
|
20
18
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
19
|
+
const editorElement = editorContainer?.querySelector('trix-editor')
|
20
|
+
const inputId = editorElement?.getAttribute('input')
|
21
|
+
const inputElement = inputId && document.getElementById(inputId)
|
22
|
+
|
23
|
+
const editorContent = inputElement?.value || ''
|
24
|
+
const previewArea = document.getElementById('content-preview')
|
25
|
+
const cardDiv = document.getElementById('card-obfuscation')
|
26
|
+
|
27
|
+
if (previewArea && cardDiv) {
|
28
|
+
previewArea.innerHTML = editorContent
|
29
|
+
cardDiv.style.display = 'block'
|
30
|
+
}
|
31
|
+
}
|
32
|
+
|
33
|
+
document.getElementById('preview-button')?.addEventListener('click', handleButtonClick)
|
34
|
+
})
|
25
35
|
</script>
|