playbook_ui 14.11.0.pre.rc.17 → 14.11.1.pre.alpha.PLAY1750pbcontenttagkitbutton5339
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/advanced_table.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.rb +2 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.html.erb +33 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_rails.md +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_button/button.html.erb +2 -3
- data/app/pb_kits/playbook/pb_checkbox/checkbox.html.erb +1 -6
- data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +2 -6
- data/app/pb_kits/playbook/pb_dropdown/dropdown.html.erb +7 -12
- data/app/pb_kits/playbook/pb_dropdown/dropdown_container.html.erb +9 -14
- data/app/pb_kits/playbook/pb_dropdown/dropdown_option.html.erb +6 -11
- data/app/pb_kits/playbook/pb_dropdown/dropdown_trigger.html.erb +8 -14
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +3 -2
- data/app/pb_kits/playbook/pb_typeahead/components/ClearIndicator.tsx +12 -4
- data/app/pb_kits/playbook/pb_typeahead/components/Control.tsx +5 -1
- data/app/pb_kits/playbook/pb_typeahead/components/IndicatorsContainer.tsx +8 -3
- data/app/pb_kits/playbook/pb_typeahead/components/MenuList.tsx +6 -1
- data/app/pb_kits/playbook/pb_typeahead/components/Option.tsx +21 -6
- data/app/pb_kits/playbook/pb_typeahead/components/Placeholder.tsx +13 -6
- data/app/pb_kits/playbook/pb_typeahead/components/ValueContainer.tsx +7 -3
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_custom_menu_list.jsx +2 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async.jsx +4 -2
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async_custom_options.jsx +5 -5
- data/dist/chunks/{_typeahead-C2iCBqxQ.js → _typeahead-BNULwihE.js} +1 -1
- data/dist/chunks/{_weekday_stacked-CWnbnW7m.js → _weekday_stacked-BKWemDAe.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/playbook-doc.js +1 -1
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/lib/playbook/version.rb +2 -2
- metadata +7 -5
- /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_table_props.md → _advanced_table_table_props_react.md} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9dca52c6de9bc88a8b2ce69d53315b7f3159f80097baff34f327cf5598142a80
|
4
|
+
data.tar.gz: e9920a4f8ff2773183bd2ae356900e72d93b346e83e4fac415b419f3bafd2372
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: adaa58f5dbdebc31ed781c93def51a17dce06d8a6134b2d1fdfa72ed046a0beffd9942c9910ad70f39d36c878ba7f532afc6d883fd8578d0bf705589fbfd6654
|
7
|
+
data.tar.gz: '005478448c5c35da3d9eeb0436958a3e58fa4bedacf649526de6331aa495a49429103ed131898681e6f9ac6fc9bd99dbfd8553c692f0512f282334c70226015e'
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<%= pb_content_tag do %>
|
2
|
-
<%= pb_rails("table", props: { size: "sm", data_table: true, number_spacing:"tabular", responsive:"none", dark: dark }) do %>
|
2
|
+
<%= pb_rails("table", props: { size: "sm", data_table: true, number_spacing:"tabular", responsive:"none", dark: dark }.merge(object.table_props)) do %>
|
3
3
|
<% if content.present? %>
|
4
4
|
<% content.presence %>
|
5
5
|
<% else %>
|
@@ -13,6 +13,8 @@ module Playbook
|
|
13
13
|
prop :responsive, type: Playbook::Props::Enum,
|
14
14
|
values: %w[none scroll],
|
15
15
|
default: "none"
|
16
|
+
prop :table_props, type: Playbook::Props::HashProp,
|
17
|
+
default: {}
|
16
18
|
|
17
19
|
def classname
|
18
20
|
generate_classname("pb_advanced_table", responsive_classname, separator: " ")
|
@@ -0,0 +1,33 @@
|
|
1
|
+
<% column_definitions = [
|
2
|
+
{
|
3
|
+
accessor: "year",
|
4
|
+
label: "Year",
|
5
|
+
cellAccessors: ["quarter", "month", "day"],
|
6
|
+
},
|
7
|
+
{
|
8
|
+
accessor: "newEnrollments",
|
9
|
+
label: "New Enrollments",
|
10
|
+
},
|
11
|
+
{
|
12
|
+
accessor: "scheduledMeetings",
|
13
|
+
label: "Scheduled Meetings",
|
14
|
+
},
|
15
|
+
{
|
16
|
+
accessor: "attendanceRate",
|
17
|
+
label: "Attendance Rate",
|
18
|
+
},
|
19
|
+
{
|
20
|
+
accessor: "completedClasses",
|
21
|
+
label: "Completed Classes",
|
22
|
+
},
|
23
|
+
{
|
24
|
+
accessor: "classCompletionRate",
|
25
|
+
label: "Class Completion Rate",
|
26
|
+
},
|
27
|
+
{
|
28
|
+
accessor: "graduatedStudents",
|
29
|
+
label: "Graduated Students",
|
30
|
+
}
|
31
|
+
] %>
|
32
|
+
|
33
|
+
<%= pb_rails("advanced_table", props: { id: "table_props_table", table_data: @table_data, column_definitions: column_definitions, table_props: { container: false, sticky: true }}) %>
|
@@ -0,0 +1 @@
|
|
1
|
+
This kit uses the [Table kit](https://playbook.powerapp.cloud/kits/table) under the hood which comes with it's own set of props. If you want to apply certain Table props to that underlying kit, you can do so by using the optional `table_props` prop. This prop must be an object that contains valid Table props. For a full list of Table props, see [here](https://playbook.powerapp.cloud/kits/table).
|
@@ -3,6 +3,7 @@ examples:
|
|
3
3
|
- advanced_table_beta: Default (Required Props)
|
4
4
|
- advanced_table_beta_subrow_headers: SubRow Headers
|
5
5
|
- advanced_table_collapsible_trail_rails: Collapsible Trail
|
6
|
+
- advanced_table_table_props: Table Props
|
6
7
|
- advanced_table_beta_sort: Enable Sorting
|
7
8
|
- advanced_table_custom_cell_rails: Custom Components for Cells
|
8
9
|
- advanced_table_column_headers: Multi-Header Columns
|
@@ -1,6 +1,5 @@
|
|
1
|
-
<%=
|
2
|
-
object.tag == "button" ? object.options : object.link_options
|
3
|
-
**combined_html_options) do %>
|
1
|
+
<%= pb_content_tag(object.tag,
|
2
|
+
object.tag == "button" ? object.options : object.link_options) do %>
|
4
3
|
<% if object.variant === "reaction" %>
|
5
4
|
<% if icon && object.valid_emoji(object.icon) %>
|
6
5
|
<%= pb_rails("flex", props:{ align: "center" }) do %>
|
@@ -1,9 +1,4 @@
|
|
1
|
-
<%=
|
2
|
-
id: object.id,
|
3
|
-
data: object.data,
|
4
|
-
class: object.classname,
|
5
|
-
**combined_html_options
|
6
|
-
) do %>
|
1
|
+
<%= pb_content_tag(:label) do %>
|
7
2
|
<%= content.presence || object.input %>
|
8
3
|
<% if object.indeterminate %>
|
9
4
|
<span data-pb-checkbox-icon-span="true" class="pb_checkbox_indeterminate">
|
@@ -1,9 +1,5 @@
|
|
1
|
-
<%=
|
2
|
-
|
3
|
-
class: object.classname + object.error_class,
|
4
|
-
data: object.data,
|
5
|
-
id: object.id,
|
6
|
-
**combined_html_options) do %>
|
1
|
+
<%= pb_content_tag(:div,
|
2
|
+
class: object.classname + object.error_class) do %>
|
7
3
|
<div class="input_wrapper">
|
8
4
|
<% if content.present? %>
|
9
5
|
<%= content %>
|
@@ -1,19 +1,14 @@
|
|
1
|
-
<%=
|
2
|
-
aria: object.aria,
|
3
|
-
class: object.classname,
|
4
|
-
data: object.data,
|
5
|
-
id: object.id,
|
6
|
-
**combined_html_options) do %>
|
1
|
+
<%= pb_content_tag do %>
|
7
2
|
<% if object.label.present? %>
|
8
3
|
<%= pb_rails("caption", props: {text: object.label, margin_bottom:"xs"}) %>
|
9
4
|
<% end %>
|
10
5
|
<div class="dropdown_wrapper<%= error_class %>" style="position: relative">
|
11
|
-
<input
|
12
|
-
data-default-value="<%= input_default_value %>"
|
13
|
-
id="dropdown-selected-option"
|
14
|
-
name="<%= object.name %>"
|
15
|
-
style="display: none"
|
16
|
-
<%= object.required ? "required" : ""%>
|
6
|
+
<input
|
7
|
+
data-default-value="<%= input_default_value %>"
|
8
|
+
id="dropdown-selected-option"
|
9
|
+
name="<%= object.name %>"
|
10
|
+
style="display: none"
|
11
|
+
<%= object.required ? "required" : ""%>
|
17
12
|
/>
|
18
13
|
<% if content.present? %>
|
19
14
|
<%= content.presence %>
|
@@ -1,20 +1,15 @@
|
|
1
|
-
<%=
|
2
|
-
aria: object.aria,
|
3
|
-
class: object.classname,
|
4
|
-
data: object.data,
|
5
|
-
id: object.id,
|
6
|
-
**combined_html_options) do %>
|
1
|
+
<%= pb_content_tag do %>
|
7
2
|
<%= pb_rails("list", props: {ordered: false, borderless: false}) do %>
|
8
|
-
<% if content.present? %>
|
3
|
+
<% if content.present? %>
|
9
4
|
<%= content.presence %>
|
10
|
-
<% else %>
|
5
|
+
<% else %>
|
11
6
|
<%= pb_rails("list/item", props: {
|
12
|
-
display: "flex",
|
13
|
-
justify_content: "center",
|
14
|
-
padding:"xs",
|
15
|
-
}) do %>
|
7
|
+
display: "flex",
|
8
|
+
justify_content: "center",
|
9
|
+
padding:"xs",
|
10
|
+
}) do %>
|
16
11
|
<%= pb_rails("body", props: {text: "No option"}) %>
|
17
12
|
<% end %>
|
18
13
|
<% end %>
|
19
|
-
<% end %>
|
20
|
-
<% end %>
|
14
|
+
<% end %>
|
15
|
+
<% end %>
|
@@ -1,15 +1,10 @@
|
|
1
|
-
<%=
|
2
|
-
aria: object.aria,
|
3
|
-
class: object.classname,
|
4
|
-
data: object.data,
|
5
|
-
id: object.option[:id],
|
6
|
-
**combined_html_options) do %>
|
1
|
+
<%= pb_content_tag do %>
|
7
2
|
<%= pb_rails("list/item", props: {
|
8
|
-
display: "flex",
|
9
|
-
justify_content: "center",
|
10
|
-
padding:"none",
|
3
|
+
display: "flex",
|
4
|
+
justify_content: "center",
|
5
|
+
padding:"none",
|
11
6
|
cursor: "pointer"
|
12
|
-
}) do %>
|
7
|
+
}) do %>
|
13
8
|
<div class="dropdown_option_wrapper">
|
14
9
|
<% if content.present? %>
|
15
10
|
<%= content.presence %>
|
@@ -18,4 +13,4 @@
|
|
18
13
|
<% end %>
|
19
14
|
</div>
|
20
15
|
<% end %>
|
21
|
-
<% end %>
|
16
|
+
<% end %>
|
@@ -1,21 +1,16 @@
|
|
1
|
-
<%=
|
2
|
-
aria: object.aria,
|
3
|
-
class: object.classname,
|
4
|
-
data: object.data,
|
5
|
-
id: object.id,
|
6
|
-
**combined_html_options) do %>
|
1
|
+
<%= pb_content_tag do %>
|
7
2
|
<% if content.present? %>
|
8
3
|
<div style="display: inline-block" tabindex="0" data-dropdown-custom-trigger>
|
9
4
|
<%= content.presence %>
|
10
5
|
</div>
|
11
6
|
<% else %>
|
12
7
|
<%= pb_rails("flex", props: {
|
13
|
-
align: "center",
|
14
|
-
border_radius:"lg",
|
15
|
-
classname: object.trigger_wrapper_classes,
|
16
|
-
cursor: "pointer",
|
17
|
-
justify: "between",
|
18
|
-
padding_x:"sm",
|
8
|
+
align: "center",
|
9
|
+
border_radius:"lg",
|
10
|
+
classname: object.trigger_wrapper_classes,
|
11
|
+
cursor: "pointer",
|
12
|
+
justify: "between",
|
13
|
+
padding_x:"sm",
|
19
14
|
padding_y:"xs",
|
20
15
|
html_options: {tabindex:"0"}
|
21
16
|
}) do %>
|
@@ -23,7 +18,7 @@
|
|
23
18
|
<%= pb_rails("flex", props: {align: "center"}) do %>
|
24
19
|
<% if object.custom_display.present? %>
|
25
20
|
<%= pb_rails("flex", props: {align: "center"}) do %>
|
26
|
-
<div id="dropdown_trigger_custom_display" style="display: none;">
|
21
|
+
<div id="dropdown_trigger_custom_display" style="display: none;">
|
27
22
|
<%= object.custom_display %>
|
28
23
|
</div>
|
29
24
|
<%= pb_rails("body", props: {text: object.default_display_placeholder, id: "dropdown_trigger_display"}) %>
|
@@ -40,4 +35,3 @@
|
|
40
35
|
<% end %>
|
41
36
|
<% end %>
|
42
37
|
<% end %>
|
43
|
-
|
@@ -42,8 +42,8 @@ type TypeaheadProps = {
|
|
42
42
|
id?: string,
|
43
43
|
label?: string,
|
44
44
|
loadOptions?: string | Noop,
|
45
|
-
getOptionLabel?: string | (() =>
|
46
|
-
getOptionValue?: string | (() =>
|
45
|
+
getOptionLabel?: string | (() => string),
|
46
|
+
getOptionValue?: string | (() => string),
|
47
47
|
name?: string,
|
48
48
|
marginBottom?: "none" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl",
|
49
49
|
pillColor?: "primary" | "neutral" | "success" | "warning" | "error" | "info" | "data_1" | "data_2" | "data_3" | "data_4" | "data_5" | "data_6" | "data_7" | "data_8" | "windows" | "siding" | "roofing" | "doors" | "gutters" | "solar" | "insulation" | "accessories",
|
@@ -109,6 +109,7 @@ const Typeahead = ({
|
|
109
109
|
multiKit: '',
|
110
110
|
onCreateOption: null as null,
|
111
111
|
plusIcon: false,
|
112
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
112
113
|
onMultiValueClick: (_option: SelectValueType): any => undefined,
|
113
114
|
pillColor: pillColor,
|
114
115
|
...props,
|
@@ -1,16 +1,24 @@
|
|
1
1
|
import React, { useEffect } from 'react'
|
2
2
|
import { components } from 'react-select'
|
3
3
|
|
4
|
-
|
4
|
+
type ClearContainerProps = {
|
5
|
+
children: React.ReactNode,
|
6
|
+
selectProps?: {
|
7
|
+
id: string,
|
8
|
+
},
|
9
|
+
clearValue: () => void,
|
10
|
+
}
|
11
|
+
|
12
|
+
const ClearContainer = (props: ClearContainerProps): React.ReactElement => {
|
5
13
|
const { selectProps, clearValue } = props
|
6
14
|
useEffect(() => {
|
7
15
|
document.addEventListener(`pb-typeahead-kit-${selectProps.id}:clear`, clearValue)
|
8
|
-
}, [
|
16
|
+
}, [clearValue, selectProps.id])
|
9
17
|
|
10
18
|
return (
|
11
19
|
<components.ClearIndicator
|
12
|
-
|
13
|
-
|
20
|
+
className="clear_indicator"
|
21
|
+
{...props}
|
14
22
|
/>
|
15
23
|
)
|
16
24
|
}
|
@@ -5,7 +5,11 @@ import Flex from '../../pb_flex/_flex'
|
|
5
5
|
import TextInput from '../../pb_text_input/_text_input'
|
6
6
|
|
7
7
|
type Props = {
|
8
|
-
|
8
|
+
selectProps: {
|
9
|
+
dark?: boolean,
|
10
|
+
label: string,
|
11
|
+
error?: string,
|
12
|
+
},
|
9
13
|
}
|
10
14
|
|
11
15
|
const TypeaheadControl = (props: Props) => (
|
@@ -1,10 +1,15 @@
|
|
1
1
|
import React from 'react'
|
2
2
|
import { components } from 'react-select'
|
3
3
|
|
4
|
-
|
4
|
+
type IndicatorsContainerProps = {
|
5
|
+
children: React.ReactNode,
|
6
|
+
}
|
7
|
+
|
8
|
+
|
9
|
+
const IndicatorsContainer = (props: IndicatorsContainerProps): React.ReactElement => (
|
5
10
|
<components.IndicatorsContainer
|
6
|
-
|
7
|
-
|
11
|
+
className="text_input_indicators"
|
12
|
+
{...props}
|
8
13
|
/>
|
9
14
|
)
|
10
15
|
|
@@ -1,7 +1,12 @@
|
|
1
1
|
import React from 'react'
|
2
2
|
import { components } from 'react-select'
|
3
3
|
|
4
|
-
|
4
|
+
type MenuListProps = {
|
5
|
+
children: React.ReactNode,
|
6
|
+
footer: React.ReactNode,
|
7
|
+
}
|
8
|
+
|
9
|
+
const MenuList = (props: MenuListProps): React.ReactElement => {
|
5
10
|
return (
|
6
11
|
<components.MenuList {...props}>
|
7
12
|
{props.children}
|
@@ -3,7 +3,22 @@ import { components } from 'react-select'
|
|
3
3
|
|
4
4
|
import User from '../../pb_user/_user'
|
5
5
|
|
6
|
-
|
6
|
+
type OptionProps = {
|
7
|
+
children: React.ReactNode,
|
8
|
+
label?: string,
|
9
|
+
data: {
|
10
|
+
imageUrl?: string,
|
11
|
+
},
|
12
|
+
selectProps: {
|
13
|
+
dark?: boolean,
|
14
|
+
valueComponent?: (data: {
|
15
|
+
imageUrl?: string,
|
16
|
+
}) => React.ReactNode,
|
17
|
+
},
|
18
|
+
}
|
19
|
+
|
20
|
+
|
21
|
+
const Option = (props: OptionProps): React.ReactElement => {
|
7
22
|
const {
|
8
23
|
imageUrl,
|
9
24
|
} = props.data
|
@@ -14,11 +29,11 @@ const Option = (props: any) => {
|
|
14
29
|
<>
|
15
30
|
{!valueComponent && imageUrl &&
|
16
31
|
<User
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
32
|
+
align="left"
|
33
|
+
avatarUrl={imageUrl}
|
34
|
+
dark={props.selectProps.dark}
|
35
|
+
name={props.label}
|
36
|
+
orientation="horizontal"
|
22
37
|
/>
|
23
38
|
}
|
24
39
|
|
@@ -4,19 +4,26 @@ import { components } from 'react-select'
|
|
4
4
|
import Flex from '../../pb_flex/_flex'
|
5
5
|
import Icon from '../../pb_icon/_icon'
|
6
6
|
|
7
|
-
|
7
|
+
type PlaceholderProps = {
|
8
|
+
children: React.ReactNode,
|
9
|
+
selectProps: {
|
10
|
+
plusIcon?: boolean,
|
11
|
+
},
|
12
|
+
}
|
13
|
+
|
14
|
+
const Placeholder = (props: PlaceholderProps): React.ReactElement => (
|
8
15
|
<>
|
9
16
|
<Flex
|
10
|
-
|
11
|
-
|
17
|
+
align="center"
|
18
|
+
className="placeholder"
|
12
19
|
>
|
13
20
|
<components.IndicatorsContainer
|
14
|
-
|
21
|
+
{...props}
|
15
22
|
/>
|
16
23
|
{props.selectProps.plusIcon &&
|
17
24
|
<Icon
|
18
|
-
|
19
|
-
|
25
|
+
className="typeahead-plus-icon"
|
26
|
+
icon="plus"
|
20
27
|
/>
|
21
28
|
}
|
22
29
|
</Flex>
|
@@ -1,10 +1,14 @@
|
|
1
1
|
import React from 'react'
|
2
2
|
import { components } from 'react-select'
|
3
3
|
|
4
|
-
|
4
|
+
type ValueContainerProps = {
|
5
|
+
children: React.ReactNode,
|
6
|
+
}
|
7
|
+
|
8
|
+
const ValueContainer = (props: ValueContainerProps): React.ReactElement => (
|
5
9
|
<components.ValueContainer
|
6
|
-
|
7
|
-
|
10
|
+
className="text_input_value_container"
|
11
|
+
{...props}
|
8
12
|
/>
|
9
13
|
)
|
10
14
|
|
@@ -45,8 +45,7 @@ const promiseOptions = (inputValue) =>
|
|
45
45
|
|
46
46
|
const TypeaheadWithPillsAsync = (props) => {
|
47
47
|
const [users, setUsers] = useState([])
|
48
|
-
|
49
|
-
const formatValue = (users) => formatUsers(users)
|
48
|
+
|
50
49
|
const formatUsers = (users) => {
|
51
50
|
const results = () => (users.map((user) => {
|
52
51
|
if (Object.keys(user)[0] === 'name' || Object.keys(user)[1] === 'id'){
|
@@ -58,6 +57,9 @@ const TypeaheadWithPillsAsync = (props) => {
|
|
58
57
|
return results()
|
59
58
|
}
|
60
59
|
|
60
|
+
const handleOnChange = (value) => setUsers(formatUsers(value))
|
61
|
+
const formatValue = (users) => formatUsers(users)
|
62
|
+
|
61
63
|
return (
|
62
64
|
<>
|
63
65
|
{users && users.length > 0 && (
|
@@ -83,13 +83,13 @@ const TypeaheadWithPillsAsyncCustomOptions = (props) => {
|
|
83
83
|
onChange={handleOnChange}
|
84
84
|
onMultiValueClick={handleOnMultiValueClick}
|
85
85
|
placeholder="type the name of a Github user"
|
86
|
-
valueComponent={(
|
86
|
+
valueComponent={({imageUrl, label, territory, type}) => (
|
87
87
|
<User
|
88
88
|
avatar
|
89
|
-
avatarUrl={
|
90
|
-
name={
|
91
|
-
territory={
|
92
|
-
title={
|
89
|
+
avatarUrl={imageUrl}
|
90
|
+
name={label}
|
91
|
+
territory={territory}
|
92
|
+
title={type}
|
93
93
|
/>
|
94
94
|
)}
|
95
95
|
{...props}
|