playbook_ui 14.14.0 → 14.15.0.pre.alpha.PBNTR902multilevelselecthiddeninputbug6580
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_advanced_table/Components/RegularTableView.tsx +127 -0
- data/app/pb_kits/playbook/pb_advanced_table/Components/TableActionBar.tsx +55 -0
- data/app/pb_kits/playbook/pb_advanced_table/Components/TablePagination.tsx +33 -0
- data/app/pb_kits/playbook/pb_advanced_table/Components/VirtualizedTableView.tsx +275 -0
- data/app/pb_kits/playbook/pb_advanced_table/Context/AdvancedTableContext.tsx +143 -3
- data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableActions.ts +66 -0
- data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableState.ts +195 -0
- data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableBody.tsx +45 -99
- data/app/pb_kits/playbook/pb_advanced_table/Utilities/CellRendererUtils.tsx +73 -0
- data/app/pb_kits/playbook/pb_advanced_table/Utilities/RowUtils.ts +52 -0
- data/app/pb_kits/playbook/pb_advanced_table/Utilities/TableContainerStyles.ts +80 -0
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +123 -7
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +153 -299
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_infinite_scroll.jsx +50 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_mock_data_infinite_scroll.json +152002 -0
- data/app/pb_kits/playbook/pb_card/_card.tsx +2 -1
- data/app/pb_kits/playbook/pb_currency/_currency.tsx +46 -31
- data/app/pb_kits/playbook/pb_currency/currency.html.erb +15 -8
- data/app/pb_kits/playbook/pb_currency/currency.rb +17 -2
- data/app/pb_kits/playbook/pb_currency/docs/_currency_null_display.html.erb +22 -0
- data/app/pb_kits/playbook/pb_currency/docs/_currency_null_display.jsx +34 -0
- data/app/pb_kits/playbook/pb_currency/docs/_currency_null_display_rails.md +1 -0
- data/app/pb_kits/playbook/pb_currency/docs/_currency_null_display_react.md +1 -0
- data/app/pb_kits/playbook/pb_currency/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_currency/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +4 -1
- data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +2 -0
- data/app/pb_kits/playbook/pb_date_picker/index.ts +38 -0
- data/app/pb_kits/playbook/pb_dialog/dialog.html.erb +5 -6
- data/app/pb_kits/playbook/pb_dialog/dialogHelper.js +2 -0
- data/app/pb_kits/playbook/pb_dialog/index.js +75 -0
- data/app/pb_kits/playbook/pb_drawer/_drawer.scss +43 -3
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_behavior.html.erb +8 -0
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_borders.html.erb +33 -0
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_borders.jsx +3 -3
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.html.erb +0 -0
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.jsx +20 -37
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_default.html.erb +20 -1
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.html.erb +24 -0
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.jsx +6 -6
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.html.erb +21 -0
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx +1 -0
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.md +1 -0
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_sizes.html.erb +49 -0
- data/app/pb_kits/playbook/pb_drawer/docs/example.yml +6 -0
- data/app/pb_kits/playbook/pb_drawer/drawer.html.erb +20 -12
- data/app/pb_kits/playbook/pb_drawer/drawer.rb +49 -1
- data/app/pb_kits/playbook/pb_drawer/index.js +257 -0
- data/app/pb_kits/playbook/pb_filter/Filter/CurrentFilters.tsx +5 -4
- data/app/pb_kits/playbook/pb_filter/Filter/FilterSingle.tsx +2 -2
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +1 -0
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +3 -2
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.scss +9 -2
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.tsx +4 -0
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_wrapped.html.erb +40 -0
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_wrapped.jsx +50 -0
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_wrapped.md +3 -0
- data/app/pb_kits/playbook/pb_form_pill/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_form_pill/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_form_pill/form_pill.rb +7 -1
- data/app/pb_kits/playbook/pb_icon_button/_icon_button.tsx +71 -0
- data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_default.jsx +17 -0
- data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_sizes.jsx +61 -0
- data/app/pb_kits/playbook/pb_icon_button/docs/example.yml +4 -0
- data/app/pb_kits/playbook/pb_icon_button/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_icon_button/icon_button.test.jsx +39 -0
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.scss +7 -0
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +25 -3
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_disabled.html.erb +72 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_disabled.jsx +91 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/example.yml +2 -1
- data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.rb +7 -1
- data/app/pb_kits/playbook/pb_overlay/_overlay.scss +13 -0
- data/app/pb_kits/playbook/pb_overlay/_overlay.tsx +7 -1
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar.html.erb +11 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar.jsx +37 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar_rails.md +1 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar_react.md +1 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional.html.erb +11 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional.md +1 -0
- data/app/pb_kits/playbook/pb_overlay/docs/example.yml +3 -0
- data/app/pb_kits/playbook/pb_overlay/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_overlay/index.js +61 -0
- data/app/pb_kits/playbook/pb_overlay/overlay.html.erb +5 -3
- data/app/pb_kits/playbook/pb_overlay/overlay.rb +16 -1
- data/app/pb_kits/playbook/pb_overlay/overlay.test.jsx +12 -0
- data/app/pb_kits/playbook/pb_popover/_popover.tsx +1 -1
- data/app/pb_kits/playbook/pb_progress_step/progress_step_item.html.erb +2 -2
- data/app/pb_kits/playbook/pb_radio/_radio.tsx +85 -74
- data/app/pb_kits/playbook/pb_radio/docs/_radio_react_hook.jsx +60 -0
- data/app/pb_kits/playbook/pb_radio/docs/_radio_react_hook.md +1 -0
- data/app/pb_kits/playbook/pb_radio/docs/example.yml +2 -1
- data/app/pb_kits/playbook/pb_radio/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_radio/radio.test.js +16 -0
- data/app/pb_kits/playbook/pb_select/docs/_select_react_hook.jsx +58 -0
- data/app/pb_kits/playbook/pb_select/docs/_select_react_hook.md +1 -0
- data/app/pb_kits/playbook/pb_select/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_select/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_select/index.js +38 -0
- data/app/pb_kits/playbook/pb_select/select.html.erb +3 -5
- data/app/pb_kits/playbook/pb_select/select.rb +8 -0
- data/app/pb_kits/playbook/pb_selectable_card/selectable_card.html.erb +1 -5
- data/app/pb_kits/playbook/pb_selectable_card_icon/selectable_card_icon.html.erb +1 -4
- data/app/pb_kits/playbook/pb_selectable_icon/selectable_icon.html.erb +1 -5
- data/app/pb_kits/playbook/pb_timeline/_timeline.scss +2 -2
- data/app/pb_kits/playbook/pb_title/_title.scss +32 -0
- data/app/pb_kits/playbook/pb_title/_title.tsx +10 -1
- data/app/pb_kits/playbook/pb_title/docs/_title_default.html.erb +1 -2
- data/app/pb_kits/playbook/pb_title/docs/_title_default.jsx +1 -1
- data/app/pb_kits/playbook/pb_title/docs/_title_display_size.html.erb +7 -0
- data/app/pb_kits/playbook/pb_title/docs/_title_display_size.jsx +54 -0
- data/app/pb_kits/playbook/pb_title/docs/_title_display_size.md +1 -0
- data/app/pb_kits/playbook/pb_title/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_title/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_title/title.rb +10 -1
- data/app/pb_kits/playbook/pb_tooltip/_tooltip.scss +0 -3
- data/app/pb_kits/playbook/pb_tooltip/_tooltip.tsx +25 -0
- data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_delay_rails.html.erb +39 -0
- data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_delay_rails.md +3 -0
- data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_interaction.html.erb +26 -0
- data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_sizing.jsx +69 -0
- data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_sizing.md +3 -0
- data/app/pb_kits/playbook/pb_tooltip/docs/example.yml +3 -1
- data/app/pb_kits/playbook/pb_tooltip/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_tooltip/floating_ui.js +282 -0
- data/app/pb_kits/playbook/pb_tooltip/index.js +2 -2
- data/app/pb_kits/playbook/pb_tooltip/tooltip.rb +10 -2
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +36 -2
- data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.tsx +5 -1
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options.html.erb +45 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options.md +5 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options_pure_rails.html.erb +33 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options_pure_rails.md +3 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_typeahead/index.ts +61 -8
- data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +17 -2
- data/app/pb_kits/playbook/utilities/object.test.js +99 -0
- data/app/pb_kits/playbook/utilities/object.ts +29 -1
- data/dist/chunks/_typeahead-CaXmU2Fm.js +36 -0
- data/dist/chunks/_weekday_stacked-C7auj4WH.js +45 -0
- data/dist/chunks/lazysizes-B7xYodB-.js +1 -0
- data/dist/chunks/{lib-D3us1bGD.js → lib-5OzNgeeu.js} +2 -2
- data/dist/chunks/{pb_form_validation-BpihMSOQ.js → pb_form_validation-DGhKbZtO.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +3 -3
- data/dist/playbook-doc.js +1 -1
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/forms/builder/time_zone_select_field.rb +19 -0
- data/lib/playbook/forms/builder.rb +1 -0
- data/lib/playbook/version.rb +2 -2
- metadata +69 -7
- data/dist/chunks/_typeahead-PqkcDf1H.js +0 -36
- data/dist/chunks/_weekday_stacked-B_pw5Znc.js +0 -45
- data/dist/chunks/lazysizes-DHz07jlL.js +0 -1
@@ -0,0 +1,40 @@
|
|
1
|
+
<%
|
2
|
+
names = [
|
3
|
+
{ label: 'Alexander Nathaniel Montgomery', value: 'Alexander Nathaniel Montgomery' },
|
4
|
+
{ label: 'Isabella Anastasia Wellington', value: 'Isabella Anastasia Wellington' },
|
5
|
+
{ label: 'Christopher Maximilian Harrington', value: 'Christopher Maximilian Harrington' },
|
6
|
+
{ label: 'Elizabeth Seraphina Kensington', value: 'Elizabeth Seraphina Kensington' },
|
7
|
+
{ label: 'Theodore Jonathan Abernathy', value: 'Theodore Jonathan Abernathy' },
|
8
|
+
]
|
9
|
+
%>
|
10
|
+
|
11
|
+
<%= pb_rails("typeahead", props: {
|
12
|
+
html_options: { style: { maxWidth: "240px" }},
|
13
|
+
id: "typeahead-form-pill",
|
14
|
+
is_multi: true,
|
15
|
+
options: names,
|
16
|
+
label: "Wrapped Within Typeahead",
|
17
|
+
pills: true,
|
18
|
+
wrapped: true,
|
19
|
+
}) %>
|
20
|
+
|
21
|
+
<%= pb_rails("caption", props: { text: "Form Pill Wrapped Text" }) %>
|
22
|
+
<%= pb_rails("card", props: { max_width: "xs" }) do %>
|
23
|
+
<%= pb_rails("form_pill", props: {
|
24
|
+
name: "Princess Amelia Mignonette Grimaldi Thermopolis Renaldo",
|
25
|
+
avatar_url: "https://randomuser.me/api/portraits/women/44.jpg",
|
26
|
+
tabindex: 0,
|
27
|
+
wrapped: true,
|
28
|
+
}) %>
|
29
|
+
<%= pb_rails("form_pill", props: {
|
30
|
+
icon: "badge-check",
|
31
|
+
text: "icon and a very long tag to show wrapped text",
|
32
|
+
tabindex: 0,
|
33
|
+
wrapped: true,
|
34
|
+
}) %>
|
35
|
+
<%= pb_rails("form_pill", props: {
|
36
|
+
text: "form pill long tag no tooltip show wrapped text",
|
37
|
+
tabindex: 0,
|
38
|
+
wrapped: true,
|
39
|
+
}) %>
|
40
|
+
<% end %>
|
@@ -0,0 +1,50 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import { Card, Caption, FormPill, Typeahead } from 'playbook-ui'
|
3
|
+
|
4
|
+
const names = [
|
5
|
+
{ label: 'Alexander Nathaniel Montgomery', value: 'Alexander Nathaniel Montgomery' },
|
6
|
+
{ label: 'Isabella Anastasia Wellington', value: 'Isabella Anastasia Wellington' },
|
7
|
+
{ label: 'Christopher Maximilian Harrington', value: 'Christopher Maximilian Harrington' },
|
8
|
+
{ label: 'Elizabeth Seraphina Kensington', value: 'Elizabeth Seraphina Kensington' },
|
9
|
+
{ label: 'Theodore Jonathan Abernathy', value: 'Theodore Jonathan Abernathy' },
|
10
|
+
]
|
11
|
+
|
12
|
+
const FormPillWrapped = (props) => {
|
13
|
+
return (
|
14
|
+
<>
|
15
|
+
<Typeahead
|
16
|
+
htmlOptions={{ style: { maxWidth: "240px" } }}
|
17
|
+
isMulti
|
18
|
+
label="Wrapped Within Typeahead"
|
19
|
+
options={names}
|
20
|
+
wrapped
|
21
|
+
{...props}
|
22
|
+
/>
|
23
|
+
<Caption text="Form Pill Wrapped Text"/>
|
24
|
+
<Card maxWidth="xs">
|
25
|
+
<FormPill
|
26
|
+
avatarUrl="https://randomuser.me/api/portraits/women/44.jpg"
|
27
|
+
name="Princess Amelia Mignonette Grimaldi Thermopolis Renaldo"
|
28
|
+
onClick={() => alert('Click!')}
|
29
|
+
tabIndex={0}
|
30
|
+
wrapped
|
31
|
+
/>
|
32
|
+
<FormPill
|
33
|
+
icon="badge-check"
|
34
|
+
onClick={() => {alert('Click!')}}
|
35
|
+
tabIndex={0}
|
36
|
+
text="icon and a very long tag to show wrapped text"
|
37
|
+
wrapped
|
38
|
+
/>
|
39
|
+
<FormPill
|
40
|
+
onClick={() => {alert('Click!')}}
|
41
|
+
tabIndex={0}
|
42
|
+
text="form pill with a very long tag to show wrapped text"
|
43
|
+
wrapped
|
44
|
+
/>
|
45
|
+
</Card>
|
46
|
+
</>
|
47
|
+
)
|
48
|
+
}
|
49
|
+
|
50
|
+
export default FormPillWrapped
|
@@ -4,6 +4,7 @@ examples:
|
|
4
4
|
- form_pill_user: Form Pill User
|
5
5
|
- form_pill_size: Form Pill Size
|
6
6
|
- form_pill_truncated_text: Truncated Text
|
7
|
+
- form_pill_wrapped: Wrapped Text
|
7
8
|
- form_pill_tag: Form Pill Tag
|
8
9
|
- form_pill_example: Example
|
9
10
|
- form_pill_icon: Form Pill Icon
|
@@ -13,6 +14,7 @@ examples:
|
|
13
14
|
- form_pill_user: Form Pill User
|
14
15
|
- form_pill_size: Form Pill Size
|
15
16
|
- form_pill_truncated_text: Truncated Text
|
17
|
+
- form_pill_wrapped: Wrapped Text
|
16
18
|
- form_pill_tag: Form Pill Tag
|
17
19
|
- form_pill_example: Example
|
18
20
|
- form_pill_icon: Form Pill Icon
|
@@ -5,3 +5,4 @@ export { default as FormPillExample } from './_form_pill_example.jsx'
|
|
5
5
|
export { default as FormPillIcon } from './_form_pill_icon.jsx'
|
6
6
|
export { default as FormPillColors } from './_form_pill_colors.jsx'
|
7
7
|
export { default as FormPillTruncatedText } from './_form_pill_truncated_text.jsx'
|
8
|
+
export { default as FormPillWrapped } from './_form_pill_wrapped.jsx'
|
@@ -16,9 +16,11 @@ module Playbook
|
|
16
16
|
default: "primary"
|
17
17
|
prop :tabindex
|
18
18
|
prop :icon
|
19
|
+
prop :wrapped, type: Playbook::Props::Boolean,
|
20
|
+
default: false
|
19
21
|
|
20
22
|
def classname
|
21
|
-
generate_classname("pb_form_pill_kit", color, icon_class, name, text, text_transform)
|
23
|
+
generate_classname("pb_form_pill_kit", color, icon_class, name, text, text_transform, wrapped_class)
|
22
24
|
end
|
23
25
|
|
24
26
|
def display_text
|
@@ -36,6 +38,10 @@ module Playbook
|
|
36
38
|
def close_icon_size
|
37
39
|
size == "small" ? "xs" : "sm"
|
38
40
|
end
|
41
|
+
|
42
|
+
def wrapped_class
|
43
|
+
wrapped ? "wrapped" : nil
|
44
|
+
end
|
39
45
|
end
|
40
46
|
end
|
41
47
|
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
|
2
|
+
import React from 'react'
|
3
|
+
import classnames from 'classnames'
|
4
|
+
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
5
|
+
import { globalProps } from '../utilities/globalProps'
|
6
|
+
|
7
|
+
import Button from '../pb_button/_button'
|
8
|
+
import Icon from '../pb_icon/_icon'
|
9
|
+
import { IconSizes } from "../pb_icon/_icon"
|
10
|
+
|
11
|
+
type IconButtonProps = {
|
12
|
+
aria?: { [key: string]: string },
|
13
|
+
className?: string,
|
14
|
+
data?: { [key: string]: string },
|
15
|
+
htmlType?: 'submit' | 'reset' | 'button' | undefined,
|
16
|
+
icon?: string,
|
17
|
+
id?: string,
|
18
|
+
link?: string,
|
19
|
+
newWindow?: boolean,
|
20
|
+
size?: IconSizes,
|
21
|
+
target?: string,
|
22
|
+
variant?: 'default' | 'link',
|
23
|
+
}
|
24
|
+
|
25
|
+
const IconButton = (props: IconButtonProps) => {
|
26
|
+
const {
|
27
|
+
aria = {},
|
28
|
+
className,
|
29
|
+
data = {},
|
30
|
+
htmlType = 'button',
|
31
|
+
icon = 'bars',
|
32
|
+
id,
|
33
|
+
link,
|
34
|
+
newWindow = false,
|
35
|
+
size = "2x",
|
36
|
+
target,
|
37
|
+
variant = "default",
|
38
|
+
} = props
|
39
|
+
|
40
|
+
const ariaProps = buildAriaProps(aria)
|
41
|
+
const dataProps = buildDataProps(data)
|
42
|
+
const classes = classnames(buildCss('pb_icon_button_kit', variant), globalProps(props), className)
|
43
|
+
|
44
|
+
return (
|
45
|
+
<div
|
46
|
+
{...ariaProps}
|
47
|
+
{...dataProps}
|
48
|
+
className={classes}
|
49
|
+
id={id}
|
50
|
+
>
|
51
|
+
<Button
|
52
|
+
borderRadius="lg"
|
53
|
+
htmlType={htmlType}
|
54
|
+
link={link}
|
55
|
+
newWindow={newWindow}
|
56
|
+
target={target}
|
57
|
+
>
|
58
|
+
<Icon
|
59
|
+
className="icon_button_icon"
|
60
|
+
fixedWidth
|
61
|
+
icon={icon}
|
62
|
+
paddingX="xxs"
|
63
|
+
paddingY="xs"
|
64
|
+
size={size}
|
65
|
+
/>
|
66
|
+
</Button>
|
67
|
+
</div>
|
68
|
+
)
|
69
|
+
}
|
70
|
+
|
71
|
+
export default IconButton
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import { IconButton } from 'playbook-ui'
|
3
|
+
|
4
|
+
const IconButtonDefault = (props) => (
|
5
|
+
<div>
|
6
|
+
<IconButton
|
7
|
+
{...props}
|
8
|
+
/>
|
9
|
+
<IconButton
|
10
|
+
{...props}
|
11
|
+
marginTop="md"
|
12
|
+
variant="link"
|
13
|
+
/>
|
14
|
+
</div>
|
15
|
+
)
|
16
|
+
|
17
|
+
export default IconButtonDefault
|
@@ -0,0 +1,61 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import { IconButton, Flex } from 'playbook-ui'
|
3
|
+
|
4
|
+
const IconButtonSizes = (props) => (
|
5
|
+
<div>
|
6
|
+
<Flex align="center">
|
7
|
+
<IconButton
|
8
|
+
{...props}
|
9
|
+
size="lg"
|
10
|
+
/>
|
11
|
+
<span>Large</span>
|
12
|
+
</Flex>
|
13
|
+
<Flex align="center">
|
14
|
+
<IconButton
|
15
|
+
{...props}
|
16
|
+
size="sm"
|
17
|
+
/>
|
18
|
+
<span>Small</span>
|
19
|
+
</Flex>
|
20
|
+
<Flex align="center">
|
21
|
+
<IconButton
|
22
|
+
{...props}
|
23
|
+
size="xs"
|
24
|
+
/>
|
25
|
+
<span>XSmall</span>
|
26
|
+
</Flex>
|
27
|
+
<Flex
|
28
|
+
align="center"
|
29
|
+
marginTop="md"
|
30
|
+
>
|
31
|
+
<IconButton
|
32
|
+
{...props}
|
33
|
+
size="1x"
|
34
|
+
/>
|
35
|
+
<span>1x</span>
|
36
|
+
</Flex>
|
37
|
+
<Flex align="center">
|
38
|
+
<IconButton
|
39
|
+
{...props}
|
40
|
+
size="2x"
|
41
|
+
/>
|
42
|
+
<span>2x</span>
|
43
|
+
</Flex>
|
44
|
+
<Flex align="center">
|
45
|
+
<IconButton
|
46
|
+
{...props}
|
47
|
+
size="3x"
|
48
|
+
/>
|
49
|
+
<span>3x</span>
|
50
|
+
</Flex>
|
51
|
+
<Flex align="center">
|
52
|
+
<IconButton
|
53
|
+
{...props}
|
54
|
+
size="4x"
|
55
|
+
/>
|
56
|
+
<span>4x</span>
|
57
|
+
</Flex>
|
58
|
+
</div>
|
59
|
+
)
|
60
|
+
|
61
|
+
export default IconButtonSizes
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import { ensureAccessible, renderKit } from '../utilities/test-utils'
|
2
|
+
|
3
|
+
import { IconButton } from 'playbook-ui'
|
4
|
+
|
5
|
+
const props = {
|
6
|
+
data: { testid: 'default', icon: 'plus' }
|
7
|
+
}
|
8
|
+
|
9
|
+
test('default test', () => {
|
10
|
+
const kit = renderKit(IconButton, props)
|
11
|
+
|
12
|
+
expect(kit).toBeInTheDocument()
|
13
|
+
expect(kit).toHaveClass('pb_icon_button_kit_default')
|
14
|
+
|
15
|
+
const iconElement = kit.querySelector('.icon_button_icon')
|
16
|
+
expect(iconElement).toBeInTheDocument()
|
17
|
+
})
|
18
|
+
|
19
|
+
it("should be accessible", async () => {
|
20
|
+
ensureAccessible(IconButton, props)
|
21
|
+
})
|
22
|
+
|
23
|
+
test('passes link variant prop', () => {
|
24
|
+
const kit = renderKit(IconButton, { ...props, variant: "link" })
|
25
|
+
expect(kit).toBeInTheDocument()
|
26
|
+
expect(kit).toHaveClass('pb_icon_button_kit_link')
|
27
|
+
})
|
28
|
+
|
29
|
+
test('should set button type to "submit" when htmlType prop is passed', () => {
|
30
|
+
const kit = renderKit(IconButton, { ...props, htmlType: 'submit' })
|
31
|
+
const buttonElement = kit.querySelector('button')
|
32
|
+
expect(buttonElement).toHaveAttribute('type', 'submit')
|
33
|
+
})
|
34
|
+
|
35
|
+
test('passes custom classname', () => {
|
36
|
+
const kit = renderKit(IconButton, { ...props, className: "extra_class" })
|
37
|
+
expect(kit).toBeInTheDocument()
|
38
|
+
expect(kit).toHaveClass('pb_icon_button_kit_default extra_class')
|
39
|
+
})
|
@@ -27,6 +27,7 @@ type MultiLevelSelectProps = {
|
|
27
27
|
aria?: { [key: string]: string }
|
28
28
|
className?: string
|
29
29
|
data?: { [key: string]: string }
|
30
|
+
disabled?: boolean
|
30
31
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
31
32
|
id?: string
|
32
33
|
inputDisplay?: "pills" | "none"
|
@@ -37,6 +38,7 @@ type MultiLevelSelectProps = {
|
|
37
38
|
onSelect?: (prop: { [key: string]: any }) => void
|
38
39
|
selectedIds?: string[] | any
|
39
40
|
variant?: "multi" | "single"
|
41
|
+
wrapped?: boolean
|
40
42
|
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",
|
41
43
|
} & GlobalProps
|
42
44
|
|
@@ -45,6 +47,7 @@ const MultiLevelSelect = (props: MultiLevelSelectProps) => {
|
|
45
47
|
aria = {},
|
46
48
|
className,
|
47
49
|
data = {},
|
50
|
+
disabled = false,
|
48
51
|
htmlOptions = {},
|
49
52
|
id,
|
50
53
|
inputDisplay = "pills",
|
@@ -56,6 +59,7 @@ const MultiLevelSelect = (props: MultiLevelSelectProps) => {
|
|
56
59
|
selectedIds,
|
57
60
|
variant = "multi",
|
58
61
|
children,
|
62
|
+
wrapped,
|
59
63
|
pillColor = "primary"
|
60
64
|
} = props
|
61
65
|
|
@@ -292,7 +296,8 @@ const MultiLevelSelect = (props: MultiLevelSelectProps) => {
|
|
292
296
|
const handleInputWrapperClick = (e: any) => {
|
293
297
|
if (
|
294
298
|
e.target.id === "multiselect_input" ||
|
295
|
-
e.target.classList.contains("pb_form_pill_tag")
|
299
|
+
e.target.classList.contains("pb_form_pill_tag") ||
|
300
|
+
disabled
|
296
301
|
) {
|
297
302
|
return;
|
298
303
|
}
|
@@ -421,16 +426,17 @@ const MultiLevelSelect = (props: MultiLevelSelectProps) => {
|
|
421
426
|
handledropdownItemClick,
|
422
427
|
filterItem,
|
423
428
|
}}>
|
424
|
-
<div className="wrapper"
|
429
|
+
<div className="wrapper"
|
425
430
|
ref={dropdownRef}
|
426
431
|
>
|
427
|
-
<div className="input_wrapper"
|
432
|
+
<div className="input_wrapper"
|
428
433
|
onClick={handleInputWrapperClick}
|
429
434
|
>
|
430
435
|
<div className="input_inner_container">
|
431
436
|
{variant === "single" && defaultReturn.length !== 0
|
432
437
|
? defaultReturn.map((selectedItem) => (
|
433
438
|
<input
|
439
|
+
disabled={disabled}
|
434
440
|
key={selectedItem.id}
|
435
441
|
name={`${name}[]`}
|
436
442
|
type="hidden"
|
@@ -444,6 +450,7 @@ const MultiLevelSelect = (props: MultiLevelSelectProps) => {
|
|
444
450
|
{returnAllSelected && returnedArray.length !== 0
|
445
451
|
? returnedArray.map((item) => (
|
446
452
|
<input
|
453
|
+
disabled={disabled}
|
447
454
|
key={item.id}
|
448
455
|
name={`${name}[]`}
|
449
456
|
type="hidden"
|
@@ -452,6 +459,18 @@ const MultiLevelSelect = (props: MultiLevelSelectProps) => {
|
|
452
459
|
))
|
453
460
|
: null}
|
454
461
|
|
462
|
+
{!returnAllSelected
|
463
|
+
? defaultReturn.map((item) => (
|
464
|
+
<input
|
465
|
+
disabled={disabled}
|
466
|
+
key={item.id}
|
467
|
+
name={`${name}[]`}
|
468
|
+
type="hidden"
|
469
|
+
value={item.id}
|
470
|
+
/>
|
471
|
+
))
|
472
|
+
: null}
|
473
|
+
|
455
474
|
{returnAllSelected &&
|
456
475
|
returnedArray.length !== 0 &&
|
457
476
|
inputDisplay === "pills"
|
@@ -461,6 +480,7 @@ const MultiLevelSelect = (props: MultiLevelSelectProps) => {
|
|
461
480
|
key={index}
|
462
481
|
onClick={(event: any) => handlePillClose(event, item)}
|
463
482
|
text={item.label}
|
483
|
+
wrapped={wrapped}
|
464
484
|
/>
|
465
485
|
))
|
466
486
|
: null}
|
@@ -474,6 +494,7 @@ const MultiLevelSelect = (props: MultiLevelSelectProps) => {
|
|
474
494
|
key={index}
|
475
495
|
onClick={(event: any) => handlePillClose(event, item)}
|
476
496
|
text={item.label}
|
497
|
+
wrapped={wrapped}
|
477
498
|
/>
|
478
499
|
))
|
479
500
|
: null}
|
@@ -489,6 +510,7 @@ const MultiLevelSelect = (props: MultiLevelSelectProps) => {
|
|
489
510
|
)}
|
490
511
|
|
491
512
|
<input
|
513
|
+
disabled={disabled}
|
492
514
|
id="multiselect_input"
|
493
515
|
onChange={(e) => {
|
494
516
|
variant === "single"
|
@@ -0,0 +1,72 @@
|
|
1
|
+
<% treeData = [{
|
2
|
+
label: "Power Home Remodeling",
|
3
|
+
value: "Power Home Remodeling",
|
4
|
+
id: "100",
|
5
|
+
expanded: true,
|
6
|
+
children: [
|
7
|
+
{
|
8
|
+
label: "People",
|
9
|
+
value: "People",
|
10
|
+
id: "101",
|
11
|
+
expanded: true,
|
12
|
+
children: [
|
13
|
+
{
|
14
|
+
label: "Talent Acquisition",
|
15
|
+
value: "Talent Acquisition",
|
16
|
+
id: "102",
|
17
|
+
},
|
18
|
+
{
|
19
|
+
label: "Business Affairs",
|
20
|
+
value: "Business Affairs",
|
21
|
+
id: "103",
|
22
|
+
children: [
|
23
|
+
{
|
24
|
+
label: "Initiatives",
|
25
|
+
value: "Initiatives",
|
26
|
+
id: "104",
|
27
|
+
},
|
28
|
+
{
|
29
|
+
label: "Learning & Development",
|
30
|
+
value: "Learning & Development",
|
31
|
+
id: "105",
|
32
|
+
},
|
33
|
+
],
|
34
|
+
},
|
35
|
+
{
|
36
|
+
label: "People Experience",
|
37
|
+
value: "People Experience",
|
38
|
+
id: "106",
|
39
|
+
},
|
40
|
+
],
|
41
|
+
},
|
42
|
+
{
|
43
|
+
label: "Contact Center",
|
44
|
+
value: "Contact Center",
|
45
|
+
id: "107",
|
46
|
+
children: [
|
47
|
+
{
|
48
|
+
label: "Appointment Management",
|
49
|
+
value: "Appointment Management",
|
50
|
+
id: "108",
|
51
|
+
},
|
52
|
+
{
|
53
|
+
label: "Customer Service",
|
54
|
+
value: "Customer Service",
|
55
|
+
id: "109",
|
56
|
+
},
|
57
|
+
{
|
58
|
+
label: "Energy",
|
59
|
+
value: "Energy",
|
60
|
+
id: "110",
|
61
|
+
},
|
62
|
+
],
|
63
|
+
},
|
64
|
+
],
|
65
|
+
}] %>
|
66
|
+
|
67
|
+
<%= pb_rails("multi_level_select", props: {
|
68
|
+
disabled: true,
|
69
|
+
id: "multi-level-select-default-rails",
|
70
|
+
name: "my_array",
|
71
|
+
tree_data: treeData
|
72
|
+
}) %>
|
@@ -0,0 +1,91 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import MultiLevelSelect from "../_multi_level_select";
|
3
|
+
|
4
|
+
const treeData = [
|
5
|
+
{
|
6
|
+
label: "Power Home Remodeling",
|
7
|
+
value: "Power Home Remodeling",
|
8
|
+
id: "powerhome1",
|
9
|
+
expanded: true,
|
10
|
+
children: [
|
11
|
+
{
|
12
|
+
label: "People",
|
13
|
+
value: "People",
|
14
|
+
id: "people1",
|
15
|
+
expanded: true,
|
16
|
+
children: [
|
17
|
+
{
|
18
|
+
label: "Talent Acquisition",
|
19
|
+
value: "Talent Acquisition",
|
20
|
+
id: "talent1",
|
21
|
+
},
|
22
|
+
{
|
23
|
+
label: "Business Affairs",
|
24
|
+
value: "Business Affairs",
|
25
|
+
id: "business1",
|
26
|
+
children: [
|
27
|
+
{
|
28
|
+
label: "Initiatives",
|
29
|
+
value: "Initiatives",
|
30
|
+
id: "initiative1",
|
31
|
+
},
|
32
|
+
{
|
33
|
+
label: "Learning & Development",
|
34
|
+
value: "Learning & Development",
|
35
|
+
id: "development1",
|
36
|
+
},
|
37
|
+
],
|
38
|
+
},
|
39
|
+
{
|
40
|
+
label: "People Experience",
|
41
|
+
value: "People Experience",
|
42
|
+
id: "experience1",
|
43
|
+
},
|
44
|
+
],
|
45
|
+
},
|
46
|
+
{
|
47
|
+
label: "Contact Center",
|
48
|
+
value: "Contact Center",
|
49
|
+
id: "contact1",
|
50
|
+
children: [
|
51
|
+
{
|
52
|
+
label: "Appointment Management",
|
53
|
+
value: "Appointment Management",
|
54
|
+
id: "appointment1",
|
55
|
+
},
|
56
|
+
{
|
57
|
+
label: "Customer Service",
|
58
|
+
value: "Customer Service",
|
59
|
+
id: "customer1",
|
60
|
+
},
|
61
|
+
{
|
62
|
+
label: "Energy",
|
63
|
+
value: "Energy",
|
64
|
+
id: "energy1",
|
65
|
+
},
|
66
|
+
],
|
67
|
+
},
|
68
|
+
],
|
69
|
+
},
|
70
|
+
];
|
71
|
+
|
72
|
+
const MultiLevelSelectDisabled = (props) => {
|
73
|
+
return (
|
74
|
+
<>
|
75
|
+
<MultiLevelSelect
|
76
|
+
disabled
|
77
|
+
id='multiselect-default'
|
78
|
+
onSelect={(selectedNodes) =>
|
79
|
+
console.log(
|
80
|
+
"Selected Items",
|
81
|
+
selectedNodes
|
82
|
+
)
|
83
|
+
}
|
84
|
+
treeData={treeData}
|
85
|
+
{...props}
|
86
|
+
/>
|
87
|
+
</>
|
88
|
+
)
|
89
|
+
};
|
90
|
+
|
91
|
+
export default MultiLevelSelectDisabled
|
@@ -8,6 +8,7 @@ examples:
|
|
8
8
|
- multi_level_select_with_form: With Form
|
9
9
|
- multi_level_select_color: With Pills (Custom Color)
|
10
10
|
- multi_level_select_reset: Reset Selection
|
11
|
+
- multi_level_select_disabled: Disabled
|
11
12
|
|
12
13
|
react:
|
13
14
|
- multi_level_select_default: Default
|
@@ -18,4 +19,4 @@ examples:
|
|
18
19
|
- multi_level_select_color: With Pills (Custom Color)
|
19
20
|
- multi_level_select_with_children: Checkboxes With Children
|
20
21
|
- multi_level_select_with_children_with_radios: Single Select With Children
|
21
|
-
|
22
|
+
- multi_level_select_disabled: Disabled
|
@@ -6,3 +6,4 @@ export { default as MultiLevelSelectSelectedIdsReact } from "./_multi_level_sele
|
|
6
6
|
export { default as MultiLevelSelectColor } from './_multi_level_select_color.jsx'
|
7
7
|
export { default as MultiLevelSelectWithChildren } from './_multi_level_select_with_children.jsx'
|
8
8
|
export { default as MultiLevelSelectWithChildrenWithRadios } from './_multi_level_select_with_children_with_radios.jsx'
|
9
|
+
export { default as MultiLevelSelectDisabled } from './_multi_level_select_disabled.jsx'
|