playbook_ui_docs 14.9.0.pre.alpha.play17004992 → 14.9.0.pre.rc.0
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/_advanced_table_beta.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_sort.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +0 -2
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom.jsx +49 -53
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom_rails.html.erb +36 -29
- data/app/pb_kits/playbook/pb_bread_crumbs/docs/_bread_crumbs_default.jsx +0 -6
- data/app/pb_kits/playbook/pb_button/docs/_button_default.html.erb +0 -1
- data/app/pb_kits/playbook/pb_button/docs/_button_default.jsx +0 -8
- data/app/pb_kits/playbook/pb_button/docs/_button_default.md +1 -1
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_indeterminate.html.erb +7 -84
- data/app/pb_kits/playbook/pb_currency/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_currency/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_drawer/docs/example.yml +1 -1
- data/app/pb_kits/playbook/pb_drawer/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +2 -2
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with_loading.html.erb +1 -1
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +12 -63
- data/app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_default.html.erb +1 -2
- data/app/pb_kits/playbook/pb_table/docs/example.yml +0 -5
- data/app/pb_kits/playbook/pb_table/docs/index.js +0 -6
- data/app/pb_kits/playbook/pb_text_input/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_text_input/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_children.html.erb +0 -47
- data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_children.jsx +0 -59
- data/dist/playbook-doc.js +1 -1
- metadata +2 -27
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell_rails.html.erb +0 -53
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell_rails.md +0 -5
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination.jsx +0 -50
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination.md +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.jsx +0 -57
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.md +0 -5
- data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_pagination_mock_data.json +0 -5600
- data/app/pb_kits/playbook/pb_currency/docs/_currency_negative.html.erb +0 -4
- data/app/pb_kits/playbook/pb_currency/docs/_currency_negative.jsx +0 -16
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.jsx +0 -31
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.md +0 -6
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns.html.erb +0 -95
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns.jsx +0 -87
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns_react.md +0 -2
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible.jsx +0 -75
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible.md +0 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_click.jsx +0 -108
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_click.md +0 -2
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_content.jsx +0 -94
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_content.md +0 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows.jsx +0 -83
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows.md +0 -3
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table.jsx +0 -120
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table.md +0 -1
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask.jsx +0 -88
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ec6b71c8b72db38cfd5c2b1f4be0ae66ede6c96808380c1cb83696bede9e001
|
4
|
+
data.tar.gz: eeb92ac0fb38362716ea018c6554be6b7cad88d386db2db0f9954cef945f806b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90f4af1e325b1acbf21484b7f4b3324c475b3559c7eecffc20239e0ddae43cc89a64a6837bea8a7acd8b08c8ab3826e47bcceea43443eb68fc39e47c59937f85
|
7
|
+
data.tar.gz: c84d09b163dcf2946d2f6993ce43c775d08528672acb9bb52211a709c203a57dce71c928a3b420e570b0fd0b79195481af7bee423e23b0286635c4b0db7bec2a
|
@@ -55,5 +55,5 @@
|
|
55
55
|
|
56
56
|
<%= pb_rails("advanced_table", props: { table_data: @table_data, column_definitions: column_definitions }) do %>
|
57
57
|
<%= pb_rails("advanced_table/table_header", props: { column_definitions: column_definitions }) %>
|
58
|
-
<%= pb_rails("advanced_table/table_body", props: { id: "
|
58
|
+
<%= pb_rails("advanced_table/table_body", props: { id: "subrow_headers", table_data: @table_data, column_definitions: column_definitions, subrow_headers: subrow_headers, enable_toggle_expansion: "all" }) %>
|
59
59
|
<% end %>
|
@@ -3,7 +3,6 @@ examples:
|
|
3
3
|
- advanced_table_beta: Default (Required Props)
|
4
4
|
- advanced_table_beta_subrow_headers: SubRow Headers
|
5
5
|
- advanced_table_beta_sort: Enable Sorting
|
6
|
-
- advanced_table_custom_cell_rails: Custom Components for Cells
|
7
6
|
|
8
7
|
react:
|
9
8
|
- advanced_table_default: Default (Required Props)
|
@@ -18,5 +17,3 @@ examples:
|
|
18
17
|
- advanced_table_inline_row_loading: Inline Row Loading
|
19
18
|
- advanced_table_responsive: Responsive Tables
|
20
19
|
- advanced_table_custom_cell: Custom Components for Cells
|
21
|
-
- advanced_table_pagination: Pagination
|
22
|
-
- advanced_table_pagination_with_props: Pagination Props
|
@@ -10,5 +10,3 @@ export { default as AdvancedTableTableProps } from './_advanced_table_table_prop
|
|
10
10
|
export { default as AdvancedTableInlineRowLoading } from './_advanced_table_inline_row_loading.jsx'
|
11
11
|
export { default as AdvancedTableResponsive } from './_advanced_table_responsive.jsx'
|
12
12
|
export { default as AdvancedTableCustomCell } from './_advanced_table_custom_cell.jsx'
|
13
|
-
export { default as AdvancedTablePagination } from './_advanced_table_pagination.jsx'
|
14
|
-
export { default as AdvancedTablePaginationWithProps } from './_advanced_table_pagination_with_props.jsx'
|
@@ -1,70 +1,66 @@
|
|
1
1
|
import React from 'react'
|
2
|
-
import ReactDOMServer from 'react-dom/server'
|
3
|
-
import BarGraph from '../_bar_graph'
|
4
|
-
import Icon from '../../pb_icon/_icon'
|
5
2
|
|
6
|
-
|
7
|
-
{
|
8
|
-
name: 'Role',
|
9
|
-
data: [0, 200, 300, 654, 656],
|
10
|
-
},
|
11
|
-
{
|
12
|
-
name: 'Company',
|
13
|
-
data: [150, 524, 320, 440, 500],
|
14
|
-
},
|
15
|
-
]
|
3
|
+
import BarGraph from '../_bar_graph'
|
16
4
|
|
17
|
-
const
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
}
|
5
|
+
const chartData = [{
|
6
|
+
name: 'Installation',
|
7
|
+
data: [1475, 200, 3000, 654, 656],
|
8
|
+
}, {
|
9
|
+
name: 'Manufacturing',
|
10
|
+
data: [4434, 524, 2320, 440, 500],
|
11
|
+
}, {
|
12
|
+
name: 'Sales & Distribution',
|
13
|
+
data: [3387, 743, 1344, 434, 440],
|
14
|
+
}, {
|
15
|
+
name: 'Project Development',
|
16
|
+
data: [3227, 878, 999, 780, 1000],
|
17
|
+
}, {
|
18
|
+
name: 'Other',
|
19
|
+
data: [1111, 677, 3245, 500, 200],
|
20
|
+
}]
|
24
21
|
|
25
22
|
const barGraphOptions = {
|
26
|
-
|
27
|
-
|
23
|
+
subtitle: {
|
24
|
+
text: "Overwritten subtitle",
|
25
|
+
style: {
|
26
|
+
color: "red"
|
27
|
+
}
|
28
28
|
},
|
29
29
|
xAxis: {
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
}
|
49
|
-
|
50
|
-
fontSize: '1.4em',
|
51
|
-
},
|
52
|
-
y: 42,
|
53
|
-
},
|
54
|
-
},
|
55
|
-
legend: {
|
56
|
-
itemMarginTop: 62,
|
57
|
-
},
|
30
|
+
labels: {
|
31
|
+
useHTML: true,
|
32
|
+
formatter: function() {
|
33
|
+
switch (this.value) {
|
34
|
+
case 'Jan':
|
35
|
+
return `<i class="far fa-apple-whole"></i> ${this.value}`
|
36
|
+
case 'Feb':
|
37
|
+
return `<i class="far fa-strawberry"></i> ${this.value}`
|
38
|
+
case 'Mar':
|
39
|
+
return `<i class="far fa-lemon"></i> ${this.value}`
|
40
|
+
case 'Apr':
|
41
|
+
return `<i class="far fa-pear"></i> ${this.value}`
|
42
|
+
case 'May':
|
43
|
+
return `<i class="far fa-peach"></i> ${this.value}`
|
44
|
+
default:
|
45
|
+
return ''
|
46
|
+
}
|
47
|
+
}
|
48
|
+
}
|
49
|
+
}
|
58
50
|
}
|
59
51
|
|
60
|
-
const BarGraphCustom = () => (
|
52
|
+
const BarGraphCustom = (props) => (
|
61
53
|
<div>
|
62
54
|
<BarGraph
|
55
|
+
axisTitle="Number of Employees"
|
63
56
|
chartData={chartData}
|
64
57
|
customOptions={barGraphOptions}
|
65
|
-
id="
|
66
|
-
|
58
|
+
id="bar-custom"
|
59
|
+
subTitle="Subtitle to replace"
|
67
60
|
title="Bar Graph with Custom Overrides"
|
61
|
+
xAxisCategories={['Jan', 'Feb', 'Mar', 'Apr', 'May']}
|
62
|
+
yAxisMin={0}
|
63
|
+
{...props}
|
68
64
|
/>
|
69
65
|
</div>
|
70
66
|
)
|
@@ -1,42 +1,49 @@
|
|
1
1
|
<% data = [{
|
2
|
-
|
3
|
-
|
2
|
+
name: 'Installation',
|
3
|
+
data: [1475,200,3000,654,656]
|
4
4
|
}, {
|
5
|
-
|
6
|
-
|
5
|
+
name: 'Manufacturing',
|
6
|
+
data: [4434,524,2320,440,500]
|
7
|
+
}, {
|
8
|
+
name: 'Sales & Distribution',
|
9
|
+
data: [3387,743,1344,434,440,]
|
10
|
+
}, {
|
11
|
+
name: 'Project Development',
|
12
|
+
data: [3227,878,999,780,1000]
|
13
|
+
}, {
|
14
|
+
name: 'Other',
|
15
|
+
data: [1111,677,3245,500,200]
|
7
16
|
}] %>
|
8
17
|
|
9
18
|
<% bar_graph_options = {
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
raw(pb_rails("icon", props: { icon: "frown", color: "error", size: "2x" })),
|
17
|
-
raw(pb_rails("icon", props: { icon: "frown", color: "warning", size: "2x" })),
|
18
|
-
raw(pb_rails("icon", props: { icon: "frown-open", color: "neutral", size: "2x" })),
|
19
|
-
raw(pb_rails("icon", props: { icon: "smile", color: "category_7", size: "2x" })),
|
20
|
-
raw(pb_rails("icon", props: { icon: "smile-beam", color: "success", size: "2x" }))
|
21
|
-
],
|
22
|
-
labels: {
|
23
|
-
useHTML: true,
|
24
|
-
sytle: {
|
25
|
-
fontSize: '1.4em',
|
19
|
+
customOptions: {
|
20
|
+
subtitle: {
|
21
|
+
text: "Overwritten subtitle",
|
22
|
+
style: {
|
23
|
+
color: "red"
|
24
|
+
}
|
26
25
|
},
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
26
|
+
xAxis: {
|
27
|
+
categories: [
|
28
|
+
'<i class="far fa-apple-whole"></i> Jan',
|
29
|
+
'<i class="far fa-strawberry"></i> Feb',
|
30
|
+
'<i class="far fa-lemon"></i> Mar',
|
31
|
+
'<i class="far fa-pear"></i> Apr',
|
32
|
+
'<i class="far fa-peach"></i> May'
|
33
|
+
],
|
34
|
+
labels: {
|
35
|
+
useHTML: true,
|
36
|
+
}
|
37
|
+
}
|
38
|
+
}
|
34
39
|
} %>
|
35
40
|
|
36
41
|
<%= pb_rails("bar_graph", props: {
|
42
|
+
axis_title: 'Number of Employees',
|
37
43
|
chart_data: data,
|
38
44
|
id: "bar-default",
|
39
|
-
|
45
|
+
y_axis_min: 0,
|
46
|
+
subtitle: 'Subtitle to replace',
|
40
47
|
title: 'Bar Graph with Custom Overrides',
|
41
48
|
custom_options: bar_graph_options
|
42
|
-
}) %>
|
49
|
+
}) %>
|
@@ -13,7 +13,6 @@ const BreadCrumbsDefault = (props) => {
|
|
13
13
|
<Icon
|
14
14
|
icon="home"
|
15
15
|
size="1x"
|
16
|
-
{...props}
|
17
16
|
/>
|
18
17
|
<BreadCrumbItem
|
19
18
|
{...props}
|
@@ -23,13 +22,11 @@ const BreadCrumbsDefault = (props) => {
|
|
23
22
|
size="4"
|
24
23
|
tag="span"
|
25
24
|
text="Home"
|
26
|
-
{...props}
|
27
25
|
/>
|
28
26
|
</BreadCrumbItem>
|
29
27
|
<Icon
|
30
28
|
icon="users"
|
31
29
|
size="1x"
|
32
|
-
{...props}
|
33
30
|
/>
|
34
31
|
<Link
|
35
32
|
{...props}
|
@@ -39,20 +36,17 @@ const BreadCrumbsDefault = (props) => {
|
|
39
36
|
size="4"
|
40
37
|
tag="span"
|
41
38
|
text="Users"
|
42
|
-
{...props}
|
43
39
|
/>
|
44
40
|
</Link>
|
45
41
|
<Icon
|
46
42
|
icon="user"
|
47
43
|
size="1x"
|
48
|
-
{...props}
|
49
44
|
/>
|
50
45
|
<Link {...props}>
|
51
46
|
<Title
|
52
47
|
size="4"
|
53
48
|
tag="span"
|
54
49
|
text="User"
|
55
|
-
{...props}
|
56
50
|
/>
|
57
51
|
</Link>
|
58
52
|
</BreadCrumbs>
|
@@ -2,5 +2,4 @@
|
|
2
2
|
<%= pb_rails("button", props: { text: "Button Secondary", variant: "secondary", margin_right: "lg" }) %>
|
3
3
|
<%= pb_rails("button", props: { text: "Button Link", variant: "link", margin_right: "lg" }) %>
|
4
4
|
<%= pb_rails("button", props: { text: "Button Disabled", disabled: true, margin_right: "lg" }) %>
|
5
|
-
<%= pb_rails("button", props: { text: "Button Danger", variant: "danger", margin_right: "lg" }) %>
|
6
5
|
|
@@ -34,14 +34,6 @@ const ButtonDefault = (props) => (
|
|
34
34
|
text='Button Disabled'
|
35
35
|
{...props}
|
36
36
|
/>
|
37
|
-
<Button
|
38
|
-
marginRight='lg'
|
39
|
-
onClick={() => alert("button clicked!")}
|
40
|
-
tabIndex={0}
|
41
|
-
text='Button Danger'
|
42
|
-
variant='danger'
|
43
|
-
{...props}
|
44
|
-
/>
|
45
37
|
</div>
|
46
38
|
)
|
47
39
|
|
@@ -1 +1 @@
|
|
1
|
-
The primary button is used for the most important button on the page. Secondary buttons can be used for actions that are less important. Button links can be helpful for buttons that do not need a lot of attention drawn to them. Disabled buttons are used when you don't want the user to click the button.
|
1
|
+
The primary button is used for the most important button on the page. Secondary buttons can be used for actions that are less important. Button links can be helpful for buttons that do not need a lot of attention drawn to them. Disabled buttons are used when you don't want the user to click the button.
|
@@ -1,84 +1,7 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
<thead>
|
9
|
-
<tr>
|
10
|
-
<th>
|
11
|
-
<%= pb_rails("checkbox", props: {
|
12
|
-
checked: true,
|
13
|
-
text: "Uncheck All",
|
14
|
-
value: "checkbox-value",
|
15
|
-
name: "main-checkbox",
|
16
|
-
indeterminate: true,
|
17
|
-
id: "indeterminate-checkbox"
|
18
|
-
}) %>
|
19
|
-
</th>
|
20
|
-
</tr>
|
21
|
-
</thead>
|
22
|
-
|
23
|
-
<tbody>
|
24
|
-
<% checkboxes.each do |checkbox| %>
|
25
|
-
<tr>
|
26
|
-
<td>
|
27
|
-
<%= pb_rails("checkbox", props: {
|
28
|
-
checked: checkbox[:checked],
|
29
|
-
text: checkbox[:name],
|
30
|
-
value: checkbox[:id],
|
31
|
-
name: "#{checkbox[:id]}-indeterminate-checkbox",
|
32
|
-
id: "#{checkbox[:id]}-indeterminate-checkbox",
|
33
|
-
}) %>
|
34
|
-
</td>
|
35
|
-
</tr>
|
36
|
-
<% end %>
|
37
|
-
</tbody>
|
38
|
-
<% end %>
|
39
|
-
|
40
|
-
<script>
|
41
|
-
document.addEventListener('DOMContentLoaded', function() {
|
42
|
-
const mainCheckboxWrapper = document.getElementById('indeterminate-checkbox');
|
43
|
-
const mainCheckbox = document.getElementsByName("main-checkbox")[0];
|
44
|
-
const childCheckboxes = document.querySelectorAll('input[type="checkbox"][id$="indeterminate-checkbox"]');
|
45
|
-
|
46
|
-
const updateMainCheckbox = () => {
|
47
|
-
// Count the number of checked child checkboxes
|
48
|
-
const checkedCount = Array.from(childCheckboxes).filter(cb => cb.checked).length;
|
49
|
-
// Determine if the main checkbox should be in an indeterminate state
|
50
|
-
const indeterminate = checkedCount > 0 && checkedCount < childCheckboxes.length;
|
51
|
-
|
52
|
-
// Set the main checkbox states
|
53
|
-
mainCheckbox.indeterminate = indeterminate;
|
54
|
-
mainCheckbox.checked = checkedCount > 0;
|
55
|
-
|
56
|
-
// Determine the main checkbox label based on the number of checked checkboxes
|
57
|
-
const text = checkedCount === 0 ? 'Check All' : 'Uncheck All';
|
58
|
-
|
59
|
-
// Determine the icon class to add and remove based on the number of checked checkboxes
|
60
|
-
const iconClassToAdd = checkedCount === 0 ? 'pb_checkbox_checkmark' : 'pb_checkbox_indeterminate';
|
61
|
-
const iconClassToRemove = checkedCount === 0 ? 'pb_checkbox_indeterminate' : 'pb_checkbox_checkmark';
|
62
|
-
|
63
|
-
// Update main checkbox label
|
64
|
-
mainCheckboxWrapper.getElementsByClassName('pb_body_kit')[0].textContent = text;
|
65
|
-
|
66
|
-
// Add and remove the icon class to the main checkbox wrapper
|
67
|
-
mainCheckboxWrapper.querySelector('[data-pb-checkbox-icon-span]').classList.add(iconClassToAdd);
|
68
|
-
mainCheckboxWrapper.querySelector('[data-pb-checkbox-icon-span]').classList.remove(iconClassToRemove);
|
69
|
-
|
70
|
-
// Toggle the visibility of the checkbox icon based on the indeterminate state
|
71
|
-
mainCheckboxWrapper.getElementsByClassName("indeterminate_icon")[0].classList.toggle('hidden', !indeterminate);
|
72
|
-
mainCheckboxWrapper.getElementsByClassName("check_icon")[0].classList.toggle('hidden', indeterminate);
|
73
|
-
};
|
74
|
-
|
75
|
-
mainCheckbox.addEventListener('change', function() {
|
76
|
-
childCheckboxes.forEach(cb => cb.checked = this.checked);
|
77
|
-
updateMainCheckbox();
|
78
|
-
});
|
79
|
-
|
80
|
-
childCheckboxes.forEach(cb => {
|
81
|
-
cb.addEventListener('change', updateMainCheckbox);
|
82
|
-
});
|
83
|
-
});
|
84
|
-
</script>
|
1
|
+
<%= pb_rails("checkbox" , props: {
|
2
|
+
text: "Select ",
|
3
|
+
value: "checkbox-value",
|
4
|
+
name: "main",
|
5
|
+
indeterminate: true,
|
6
|
+
id: "test-indeterminate-js"
|
7
|
+
}) %>
|
@@ -9,7 +9,6 @@ examples:
|
|
9
9
|
- currency_matching_decimals: Matching Decimals
|
10
10
|
- currency_unstyled: Unstyled
|
11
11
|
- currency_comma_separator: Comma Separator
|
12
|
-
- currency_negative: Negative
|
13
12
|
|
14
13
|
react:
|
15
14
|
- currency_variants: Variants
|
@@ -20,7 +19,6 @@ examples:
|
|
20
19
|
- currency_matching_decimals: Matching Decimals
|
21
20
|
- currency_unstyled: Unstyled
|
22
21
|
- currency_comma_separator: Comma Separator
|
23
|
-
- currency_negative: Negative
|
24
22
|
|
25
23
|
swift:
|
26
24
|
- currency_size_swift: Size
|
@@ -6,4 +6,3 @@ export { default as CurrencyAbbreviated } from './_currency_abbreviated.jsx'
|
|
6
6
|
export { default as CurrencyMatchingDecimals } from './_currency_matching_decimals.jsx'
|
7
7
|
export { default as CurrencyUnstyled } from './_currency_unstyled.jsx'
|
8
8
|
export { default as CurrencyCommaSeparator } from './_currency_comma_separator.jsx'
|
9
|
-
export { default as CurrencyNegative } from './_currency_negative.jsx'
|
@@ -3,4 +3,3 @@ export { default as DrawerSizes } from './_drawer_sizes.jsx'
|
|
3
3
|
export { default as DrawerOverlay } from './_drawer_overlay.jsx'
|
4
4
|
export { default as DrawerBorders } from './_drawer_borders.jsx'
|
5
5
|
export { default as DrawerBreakpoints } from './_drawer_breakpoints.jsx'
|
6
|
-
export { default as DrawerMenu } from './_drawer_menu.jsx'
|
@@ -23,7 +23,7 @@
|
|
23
23
|
%>
|
24
24
|
|
25
25
|
<%= pb_form_with(scope: :example, url: "", method: :get) do |form| %>
|
26
|
-
<%= form.typeahead :
|
26
|
+
<%= form.typeahead :example_user, props: { data: { typeahead_example1: true, user: {} }, placeholder: "Search for a user" } %>
|
27
27
|
<%= form.text_field :example_text_field, props: { label: true } %>
|
28
28
|
<%= form.phone_number_field :example_phone_number_field, props: { label: "Example phone field" } %>
|
29
29
|
<%= form.email_field :example_email_field, props: { label: true } %>
|
@@ -92,7 +92,7 @@
|
|
92
92
|
const selectedUserData = JSON.parse(selectedUserJSON)
|
93
93
|
|
94
94
|
// set the input field's value
|
95
|
-
event.target.querySelector('input[name=
|
95
|
+
event.target.querySelector('input[name=example_user]').value = selectedUserData.login
|
96
96
|
|
97
97
|
// log the selected option's dataset
|
98
98
|
console.log('The selected user data:')
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<%= pb_form_with(scope: :example, url: "", method: :get, loading: true) do |form| %>
|
2
|
-
<%= form.text_field :
|
2
|
+
<%= form.text_field :example_text_field, props: { label: true } %>
|
3
3
|
|
4
4
|
<%= form.actions do |action| %>
|
5
5
|
<%= action.submit %>
|
@@ -22,74 +22,23 @@
|
|
22
22
|
%>
|
23
23
|
|
24
24
|
<%= pb_form_with(scope: :example, method: :get, url: "", validate: true) do |form| %>
|
25
|
-
<%= form.
|
26
|
-
<%= form.
|
27
|
-
<%= form.
|
28
|
-
<%= form.
|
29
|
-
<%= form.
|
30
|
-
<%= form.
|
31
|
-
<%= form.
|
32
|
-
<%= form.
|
33
|
-
<%= form.
|
34
|
-
<%= form.
|
35
|
-
<%= form.
|
36
|
-
<%= form.collection_select :example_collection_select_validation, example_collection, :value, :name, props: { label: true, blank_selection: "Select One...", required: true } %>
|
25
|
+
<%= form.text_field :example_text_field, props: { label: true, required: true } %>
|
26
|
+
<%= form.phone_number_field :example_phone_number_field, props: { label: "Example phone field" } %>
|
27
|
+
<%= form.email_field :example_email_field, props: { label: true, required: true } %>
|
28
|
+
<%= form.number_field :example_number_field, props: { label: true, required: true } %>
|
29
|
+
<%= form.search_field :example_project_number, props: { label: true, required: true, validation: { pattern: "[0-9]{2}-[0-9]{5}", message: "Please enter a valid project number (example: 33-12345)." } } %>
|
30
|
+
<%= form.password_field :example_password_field, props: { label: true, required: true } %>
|
31
|
+
<%= form.url_field :example_url_field, props: { label: true, required: true } %>
|
32
|
+
<%= form.text_area :example_text_area, props: { label: true, required: true } %>
|
33
|
+
<%= form.dropdown_field :example_dropdown, props: { label: true, options: example_dropdown_options, required: true } %>
|
34
|
+
<%= form.select :example_select, [ ["Yes", 1], ["No", 2] ], props: { label: true, blank_selection: "Select One...", required: true } %>
|
35
|
+
<%= form.collection_select :example_collection_select, example_collection, :value, :name, props: { label: true, blank_selection: "Select One...", required: true } %>
|
37
36
|
<%= form.check_box :example_checkbox, props: { text: "Example Checkbox", label: true, required: true } %>
|
38
37
|
<%= form.date_picker :example_date_picker_2, props: { label: true, required: true } %>
|
39
|
-
<%= form.star_rating_field :
|
38
|
+
<%= form.star_rating_field :example_star_rating, props: { variant: "interactive", label: true, required: true } %>
|
40
39
|
|
41
40
|
<%= form.actions do |action| %>
|
42
41
|
<%= action.submit %>
|
43
42
|
<%= action.button props: { type: "reset", text: "Cancel", variant: "secondary" } %>
|
44
43
|
<% end %>
|
45
44
|
<% end %>
|
46
|
-
|
47
|
-
<!-- form.typeahead user results example template -->
|
48
|
-
<template data-typeahead-example-result-option>
|
49
|
-
<%= pb_rails("user", props: {
|
50
|
-
name: tag(:slot, name: "name"),
|
51
|
-
orientation: "horizontal",
|
52
|
-
align: "left",
|
53
|
-
avatar_url: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGP6zwAAAgcBApocMXEAAAAASUVORK5CYII=",
|
54
|
-
avatar: true
|
55
|
-
}) %>
|
56
|
-
</template>
|
57
|
-
|
58
|
-
<!-- form.typeahead JS example implementation -->
|
59
|
-
<%= javascript_tag defer: "defer" do %>
|
60
|
-
document.addEventListener("pb-typeahead-kit-search", function(event) {
|
61
|
-
if (!event.target.dataset || !event.target.dataset.typeaheadExample2) return
|
62
|
-
|
63
|
-
fetch(`https://api.github.com/search/users?q=${encodeURIComponent(event.detail.searchingFor)}`)
|
64
|
-
.then(response => response.json())
|
65
|
-
.then((result) => {
|
66
|
-
const resultOptionTemplate = document.querySelector("[data-typeahead-example-result-option]")
|
67
|
-
|
68
|
-
event.detail.setResults((result.items || []).map((user) => {
|
69
|
-
const wrapper = resultOptionTemplate.content.cloneNode(true)
|
70
|
-
wrapper.children[0].dataset.user = JSON.stringify(user)
|
71
|
-
wrapper.querySelector('slot[name="name"]').replaceWith(user.login)
|
72
|
-
wrapper.querySelector('img').dataset.src = user.avatar_url
|
73
|
-
return wrapper
|
74
|
-
}))
|
75
|
-
})
|
76
|
-
})
|
77
|
-
|
78
|
-
|
79
|
-
document.addEventListener("pb-typeahead-kit-result-option-selected", function(event) {
|
80
|
-
if (!event.target.dataset.typeaheadExample2) return
|
81
|
-
|
82
|
-
const selectedUserJSON = event.detail.selected.firstElementChild.dataset.user
|
83
|
-
const selectedUserData = JSON.parse(selectedUserJSON)
|
84
|
-
|
85
|
-
// set the input field's value
|
86
|
-
event.target.querySelector('input[name=example_typeahead_validation]').value = selectedUserData.login
|
87
|
-
|
88
|
-
// log the selected option's dataset
|
89
|
-
console.log('The selected user data:')
|
90
|
-
console.dir(selectedUserData)
|
91
|
-
|
92
|
-
// do even more with the data later - TBD
|
93
|
-
event.target.dataset.user = selectedUserJSON
|
94
|
-
})
|
95
|
-
<% end %>
|
@@ -55,8 +55,3 @@ examples:
|
|
55
55
|
- table_with_subcomponents: Table with Sub Components (Table Elements)
|
56
56
|
- table_with_subcomponents_as_divs: Table with Sub Components (Divs)
|
57
57
|
- table_outer_padding: Outer Padding
|
58
|
-
- table_with_collapsible: Table with Collapsible
|
59
|
-
- table_with_collapsible_with_custom_click: Table with Collapsible with Custom Click
|
60
|
-
- table_with_collapsible_with_custom_content: Table with Collapsible with Custom Content
|
61
|
-
- table_with_collapsible_with_nested_rows: Table with Collapsible with Nested Rows
|
62
|
-
- table_with_collapsible_with_nested_table: Table with Collapsible with Nested Table
|
@@ -25,9 +25,3 @@ export { default as TableDiv } from './_table_div.jsx'
|
|
25
25
|
export { default as TableWithSubcomponents } from './_table_with_subcomponents.jsx'
|
26
26
|
export { default as TableWithSubcomponentsAsDivs } from './_table_with_subcomponents_as_divs.jsx'
|
27
27
|
export { default as TableOuterPadding } from './_table_outer_padding.jsx'
|
28
|
-
export { default as TableStickyLeftColumns } from './_table_sticky_left_columns.jsx'
|
29
|
-
export { default as TableWithCollapsible } from './_table_with_collapsible.jsx'
|
30
|
-
export { default as TableWithCollapsibleWithCustomContent } from './_table_with_collapsible_with_custom_content.jsx'
|
31
|
-
export { default as TableWithCollapsibleWithNestedTable } from './_table_with_collapsible_with_nested_table.jsx'
|
32
|
-
export { default as TableWithCollapsibleWithNestedRows } from './_table_with_collapsible_with_nested_rows.jsx'
|
33
|
-
export { default as TableWithCollapsibleWithCustomClick } from './_table_with_collapsible_with_custom_click.jsx'
|
@@ -5,4 +5,3 @@ export { default as TextInputDisabled } from './_text_input_disabled.jsx'
|
|
5
5
|
export { default as TextInputAddOn } from './_text_input_add_on.jsx'
|
6
6
|
export { default as TextInputInline } from './_text_input_inline.jsx'
|
7
7
|
export { default as TextInputNoLabel } from './_text_input_no_label.jsx'
|
8
|
-
export { default as TextInputMask } from './_text_input_mask.jsx'
|