playbook_ui 14.13.0.pre.alpha.rails8compatible6232 → 14.13.0.pre.rc.0
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/_playbook.scss +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/Components/CustomCell.tsx +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +4 -11
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +10 -74
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +26 -43
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.rb +1 -8
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.jsx +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_rails.md +1 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_react.md +1 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +1 -3
- data/app/pb_kits/playbook/pb_advanced_table/index.js +6 -9
- data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +5 -8
- data/app/pb_kits/playbook/pb_avatar/_avatar.scss +0 -9
- data/app/pb_kits/playbook/pb_avatar/_avatar.tsx +7 -11
- data/app/pb_kits/playbook/pb_avatar/avatar.html.erb +7 -6
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_badge_component_overlay.jsx +3 -9
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_circle_icon_component_overlay.jsx +2 -6
- data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.scss +66 -0
- data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.tsx +98 -0
- data/app/pb_kits/playbook/pb_avatar_action_button/avatar_action_button.html.erb +28 -0
- data/app/pb_kits/playbook/pb_avatar_action_button/avatar_action_button.rb +42 -0
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_actions.html.erb +19 -0
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_actions.jsx +26 -0
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_default.html.erb +10 -0
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_default.jsx +17 -0
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_on_click.jsx +19 -0
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_onclick.html.erb +16 -0
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_placement.html.erb +35 -0
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_placement.jsx +42 -0
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_tooltip.html.erb +13 -0
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/example.yml +15 -0
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/index.js +4 -0
- data/app/pb_kits/playbook/pb_avatar_action_button/pb_avatar_action_button.test.js +31 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_bar_graph/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_button/button.rb +1 -1
- data/app/pb_kits/playbook/pb_checkbox/_checkbox.tsx +8 -17
- data/app/pb_kits/playbook/pb_checkbox/checkbox.test.js +0 -16
- data/app/pb_kits/playbook/pb_checkbox/docs/example.yml +1 -2
- data/app/pb_kits/playbook/pb_checkbox/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_date/_date.tsx +4 -14
- data/app/pb_kits/playbook/pb_date/docs/_date_default.jsx +1 -2
- data/app/pb_kits/playbook/pb_date/docs/_date_unstyled.jsx +5 -13
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +1 -3
- data/app/pb_kits/playbook/pb_draggable/docs/example.yml +5 -4
- data/app/pb_kits/playbook/pb_draggable/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_draggable/draggable_container.html.erb +2 -2
- data/app/pb_kits/playbook/pb_draggable/draggable_container.rb +0 -5
- data/app/pb_kits/playbook/pb_draggable/draggable_item.html.erb +1 -1
- data/app/pb_kits/playbook/pb_draggable/draggable_item.rb +0 -4
- data/app/pb_kits/playbook/pb_draggable/index.js +15 -151
- data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableContainer.tsx +4 -7
- data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableItem.tsx +3 -6
- data/app/pb_kits/playbook/pb_file_upload/file_upload.html.erb +6 -1
- data/app/pb_kits/playbook/pb_filter/filter.html.erb +5 -1
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/index.js +5 -7
- data/app/pb_kits/playbook/pb_form_group/form_group.html.erb +6 -1
- data/app/pb_kits/playbook/pb_form_pill/form_pill.html.erb +1 -1
- data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.tsx +7 -11
- data/app/pb_kits/playbook/pb_home_address_street/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_home_address_street/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_home_address_street/home_address_street.rb +2 -13
- data/app/pb_kits/playbook/pb_icon/icon.html.erb +6 -2
- data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_default.html.erb +2 -1
- data/app/pb_kits/playbook/pb_icon_button/docs/example.yml +3 -1
- data/app/pb_kits/playbook/pb_icon_button/icon_button.html.erb +1 -1
- data/app/pb_kits/playbook/pb_icon_button/icon_button.rb +0 -3
- data/app/pb_kits/playbook/pb_layout/body.html.erb +5 -1
- data/app/pb_kits/playbook/pb_layout/footer.html.erb +5 -1
- data/app/pb_kits/playbook/pb_layout/header.html.erb +5 -1
- data/app/pb_kits/playbook/pb_layout/item.html.erb +5 -1
- data/app/pb_kits/playbook/pb_layout/layout.html.erb +5 -1
- data/app/pb_kits/playbook/pb_layout/sidebar.html.erb +5 -1
- data/app/pb_kits/playbook/pb_legend/legend.html.erb +6 -1
- data/app/pb_kits/playbook/pb_lightbox/lightbox.scss +6 -7
- data/app/pb_kits/playbook/pb_link/_link.tsx +0 -18
- data/app/pb_kits/playbook/pb_link/docs/example.yml +3 -5
- data/app/pb_kits/playbook/pb_link/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_link/link.html.erb +1 -1
- data/app/pb_kits/playbook/pb_link/link.rb +0 -6
- data/app/pb_kits/playbook/pb_link/link.test.jsx +0 -30
- data/app/pb_kits/playbook/pb_message/message.html.erb +6 -1
- data/app/pb_kits/playbook/pb_message/message_mention.html.erb +6 -1
- data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.html.erb +6 -1
- data/app/pb_kits/playbook/pb_nav/item.html.erb +19 -7
- data/app/pb_kits/playbook/pb_nav/nav.html.erb +8 -3
- data/app/pb_kits/playbook/pb_online_status/online_status.html.erb +6 -1
- data/app/pb_kits/playbook/pb_overlay/_overlay.tsx +0 -4
- data/app/pb_kits/playbook/pb_overlay/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_overlay/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_overlay/subcomponents/_overlay_token.tsx +10 -48
- data/app/pb_kits/playbook/pb_popover/popover.html.erb +6 -1
- data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.scss +1 -6
- data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.tsx +5 -7
- data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_default.html.erb +0 -1
- data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_default.jsx +0 -7
- data/app/pb_kits/playbook/pb_progress_pills/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_progress_pills/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_progress_pills/progress_pills.html.erb +7 -2
- data/app/pb_kits/playbook/pb_progress_pills/progress_pills.rb +0 -6
- data/app/pb_kits/playbook/pb_progress_pills/progress_pills.test.js +1 -26
- data/app/pb_kits/playbook/pb_progress_simple/progress_simple.html.erb +5 -1
- data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_tooltip.html.erb +6 -6
- data/app/pb_kits/playbook/pb_progress_step/progress_step.html.erb +5 -1
- data/app/pb_kits/playbook/pb_progress_step/progress_step_item.html.erb +5 -1
- data/app/pb_kits/playbook/pb_radio/radio.html.erb +11 -6
- data/app/pb_kits/playbook/pb_table/docs/_table_with_background_kit.html.erb +9 -6
- data/app/pb_kits/playbook/pb_table/docs/_table_with_background_kit.jsx +9 -6
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible.jsx +1 -1
- data/app/pb_kits/playbook/pb_table/docs/example.yml +0 -5
- data/app/pb_kits/playbook/pb_table/docs/index.js +1 -3
- data/app/pb_kits/playbook/pb_table/index.ts +9 -41
- data/app/pb_kits/playbook/pb_table/styles/_collapsible.scss +0 -4
- data/app/pb_kits/playbook/pb_table/styles/_desktop_collapse.scss +0 -26
- data/app/pb_kits/playbook/pb_table/styles/_mobile.scss +1 -0
- data/app/pb_kits/playbook/pb_table/styles/_mobile_collapse.scss +0 -25
- data/app/pb_kits/playbook/pb_table/styles/_tablet_collapse.scss +0 -25
- data/app/pb_kits/playbook/pb_table/subcomponents/_table_body.tsx +2 -29
- data/app/pb_kits/playbook/pb_table/subcomponents/_table_row.tsx +3 -31
- data/app/pb_kits/playbook/pb_table/table_body.html.erb +7 -13
- data/app/pb_kits/playbook/pb_table/table_body.rb +0 -2
- data/app/pb_kits/playbook/pb_table/table_row.html.erb +7 -14
- data/app/pb_kits/playbook/pb_table/table_row.rb +1 -14
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask.html.erb +1 -15
- data/app/pb_kits/playbook/pb_text_input/index.js +82 -60
- data/app/pb_kits/playbook/pb_text_input/text_input.rb +2 -5
- data/app/pb_kits/playbook/pb_tooltip/_tooltip.tsx +1 -3
- data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_default.html.erb +1 -1
- data/app/pb_kits/playbook/pb_tooltip/index.js +27 -45
- data/app/pb_kits/playbook/pb_tooltip/tooltip.rb +1 -5
- data/app/pb_kits/playbook/pb_user/_user.tsx +0 -3
- data/app/pb_kits/playbook/pb_user/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_user/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_user/user.html.erb +1 -1
- data/app/pb_kits/playbook/pb_user/user.rb +0 -1
- data/app/pb_kits/playbook/pb_user/user.test.js +0 -14
- data/dist/chunks/_typeahead-BWwaAo_0.js +36 -0
- data/dist/chunks/_weekday_stacked-zyBCd1s8.js +45 -0
- data/dist/chunks/{lib-D3us1bGD.js → lib-kMuhBuU7.js} +2 -2
- data/dist/chunks/{pb_form_validation-BpihMSOQ.js → pb_form_validation-DBJ0wZuS.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +7 -6
- 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/version.rb +2 -2
- metadata +38 -79
- data/app/pb_kits/playbook/pb_advanced_table/Utilities/ActionBarAnimationHelper.ts +0 -26
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_custom_cell.jsx +0 -75
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header.html.erb +0 -33
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header.jsx +0 -55
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_rails.md +0 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_react.md +0 -3
- data/app/pb_kits/playbook/pb_bar_graph/BarGraphStyles.scss +0 -58
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_pb_styles.jsx +0 -64
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_pb_styles.md +0 -1
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_react_hook.jsx +0 -69
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_react_hook.md +0 -1
- data/app/pb_kits/playbook/pb_copy_button/_copy_button.scss +0 -4
- data/app/pb_kits/playbook/pb_copy_button/_copy_button.tsx +0 -92
- data/app/pb_kits/playbook/pb_copy_button/copy_button.html.erb +0 -15
- data/app/pb_kits/playbook/pb_copy_button/copy_button.rb +0 -28
- data/app/pb_kits/playbook/pb_copy_button/copy_button.test.jsx +0 -64
- data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_default.html.erb +0 -2
- data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_default.jsx +0 -21
- data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.html.erb +0 -5
- data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.jsx +0 -45
- data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.md +0 -1
- data/app/pb_kits/playbook/pb_copy_button/docs/example.yml +0 -8
- data/app/pb_kits/playbook/pb_copy_button/docs/index.js +0 -2
- data/app/pb_kits/playbook/pb_copy_button/index.js +0 -47
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_rails.html.erb +0 -99
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_rails.md +0 -1
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table.html.erb +0 -61
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table.md +0 -4
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table_react.jsx +0 -90
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table_react.md +0 -5
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close.html.erb +0 -58
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close_rails.md +0 -3
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_formatting.html.erb +0 -11
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_formatting.jsx +0 -22
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_formatting_rails.md +0 -1
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_formatting_react.md +0 -1
- data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_sizes.html.erb +0 -27
- data/app/pb_kits/playbook/pb_link/docs/_link_target.html.erb +0 -15
- data/app/pb_kits/playbook/pb_link/docs/_link_target.jsx +0 -29
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional.jsx +0 -37
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional_react.md +0 -1
- data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_default.md +0 -1
- data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_full_width.html.erb +0 -1
- data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_full_width.jsx +0 -18
- data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_full_width_rails.md +0 -1
- data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_full_width_react.md +0 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_with_clickable_rows.html.erb +0 -47
- data/app/pb_kits/playbook/pb_table/docs/_table_with_clickable_rows.jsx +0 -88
- data/app/pb_kits/playbook/pb_table/docs/_table_with_clickable_rows.md +0 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_click.html.erb +0 -51
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_click_rails.md +0 -2
- data/app/pb_kits/playbook/pb_table/docs/_table_with_selectable_rows.html.erb +0 -96
- data/app/pb_kits/playbook/pb_table/docs/_table_with_selectable_rows.jsx +0 -101
- data/app/pb_kits/playbook/pb_table/docs/_table_with_selectable_rows.md +0 -1
- data/app/pb_kits/playbook/pb_user/docs/_user_light_weight.html.erb +0 -42
- data/app/pb_kits/playbook/pb_user/docs/_user_light_weight.jsx +0 -59
- data/app/pb_kits/playbook/pb_user/docs/_user_light_weight.md +0 -2
- data/dist/chunks/_typeahead-PqkcDf1H.js +0 -36
- data/dist/chunks/_weekday_stacked-C7J0S4f7.js +0 -45
- /data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/{_fixed_confirmation_toast_auto_close_react.md → _fixed_confirmation_toast_auto_close.md} +0 -0
- /data/app/pb_kits/playbook/pb_table/docs/{_table_with_collapsible_with_custom_click_react.md → _table_with_collapsible_with_custom_click.md} +0 -0
@@ -106,19 +106,3 @@ test('has disabled attribute', () => {
|
|
106
106
|
const input = kit.querySelector('input')
|
107
107
|
expect(input).toHaveAttribute('disabled')
|
108
108
|
})
|
109
|
-
|
110
|
-
test('has ref in the input element', () => {
|
111
|
-
const ref = React.createRef()
|
112
|
-
render(
|
113
|
-
<Checkbox
|
114
|
-
data={{ testid: testId }}
|
115
|
-
name="checkbox-name"
|
116
|
-
ref={ref}
|
117
|
-
text="Checkbox"
|
118
|
-
value="check-box value"
|
119
|
-
/>
|
120
|
-
)
|
121
|
-
|
122
|
-
expect(ref.current).not.toBeNull()
|
123
|
-
expect(ref.current?.tagName).toBe('INPUT')
|
124
|
-
})
|
@@ -11,7 +11,6 @@ examples:
|
|
11
11
|
react:
|
12
12
|
- checkbox_default: Default
|
13
13
|
- checkbox_checked: Load as checked
|
14
|
-
- checkbox_react_hook: React Hook Form
|
15
14
|
- checkbox_custom: Custom Checkbox
|
16
15
|
- checkbox_error: Default w/ Error
|
17
16
|
- checkbox_indeterminate: Indeterminate Checkbox
|
@@ -22,4 +21,4 @@ examples:
|
|
22
21
|
- checkbox_error_swift: Default w/ Error
|
23
22
|
- checkbox_indeterminate_swift: Indeterminate Checkbox
|
24
23
|
- checkbox_props_swift: ""
|
25
|
-
|
24
|
+
|
@@ -1,6 +1,5 @@
|
|
1
1
|
export { default as CheckboxDefault } from './_checkbox_default.jsx'
|
2
2
|
export { default as CheckboxCustom } from './_checkbox_custom.jsx'
|
3
|
-
export { default as CheckboxReactHook } from './_checkbox_react_hook.jsx'
|
4
3
|
export { default as CheckboxError } from './_checkbox_error.jsx'
|
5
4
|
export { default as CheckboxChecked } from './_checkbox_checked.jsx'
|
6
5
|
export { default as CheckboxIndeterminate } from './_checkbox_indeterminate.jsx'
|
@@ -14,7 +14,6 @@ type PbDateProps = {
|
|
14
14
|
alignment?: "left" | "center" | "right";
|
15
15
|
aria?: { [key: string]: string };
|
16
16
|
className?: string;
|
17
|
-
dark?: boolean;
|
18
17
|
data?: { [key: string]: string };
|
19
18
|
htmlOptions?: { [key: string]: string | number | boolean | (() => void) };
|
20
19
|
id?: string;
|
@@ -30,7 +29,6 @@ const PbDate = (props: PbDateProps): React.ReactElement => {
|
|
30
29
|
aria = {},
|
31
30
|
alignment = "left",
|
32
31
|
className,
|
33
|
-
dark = false,
|
34
32
|
data = {},
|
35
33
|
htmlOptions = {},
|
36
34
|
id,
|
@@ -58,7 +56,7 @@ const PbDate = (props: PbDateProps): React.ReactElement => {
|
|
58
56
|
);
|
59
57
|
|
60
58
|
return (
|
61
|
-
<div
|
59
|
+
<div
|
62
60
|
{...ariaProps}
|
63
61
|
{...dataProps}
|
64
62
|
{...htmlProps}
|
@@ -95,9 +93,7 @@ const PbDate = (props: PbDateProps): React.ReactElement => {
|
|
95
93
|
</>
|
96
94
|
: size == "md" || size == "lg"
|
97
95
|
? (
|
98
|
-
<Title
|
99
|
-
dark={dark}
|
100
|
-
size={4}
|
96
|
+
<Title size={4}
|
101
97
|
tag="h4"
|
102
98
|
>
|
103
99
|
{showIcon && (
|
@@ -131,7 +127,6 @@ const PbDate = (props: PbDateProps): React.ReactElement => {
|
|
131
127
|
<>
|
132
128
|
{showIcon && (
|
133
129
|
<Caption className="pb_icon_kit_container"
|
134
|
-
dark={dark}
|
135
130
|
tag="span"
|
136
131
|
>
|
137
132
|
<Icon fixedWidth
|
@@ -143,20 +138,15 @@ const PbDate = (props: PbDateProps): React.ReactElement => {
|
|
143
138
|
|
144
139
|
{showDayOfWeek && (
|
145
140
|
<>
|
146
|
-
<Caption
|
147
|
-
tag="div">
|
148
|
-
{weekday}
|
149
|
-
</Caption>
|
141
|
+
<Caption tag="div">{weekday}</Caption>
|
150
142
|
<Caption color="light"
|
151
|
-
dark={dark}
|
152
143
|
tag="div"
|
153
144
|
text=" • "
|
154
145
|
/>
|
155
146
|
</>
|
156
147
|
)}
|
157
148
|
|
158
|
-
<Caption
|
159
|
-
tag="span">
|
149
|
+
<Caption tag="span">
|
160
150
|
{month} {day}
|
161
151
|
{currentYear != year && <>{`, ${year}`}</>}
|
162
152
|
</Caption>
|
@@ -18,7 +18,7 @@ const DateDefault = (props) => {
|
|
18
18
|
value={"2012-08-03"}
|
19
19
|
{...props}
|
20
20
|
/>
|
21
|
-
<Caption
|
21
|
+
<Caption>{"(Hyphenated Date)"}</Caption>
|
22
22
|
</div>
|
23
23
|
|
24
24
|
<br />
|
@@ -56,7 +56,6 @@ const DateDefault = (props) => {
|
|
56
56
|
<Title
|
57
57
|
size={4}
|
58
58
|
text={"(Hyphenated Date)"}
|
59
|
-
{...props}
|
60
59
|
/>
|
61
60
|
</div>
|
62
61
|
|
@@ -4,8 +4,7 @@ import { Caption, Date as FormattedDate, Title } from 'playbook-ui'
|
|
4
4
|
const DateUnstyled = (props) => {
|
5
5
|
return (
|
6
6
|
<>
|
7
|
-
<Caption
|
8
|
-
size="xs"
|
7
|
+
<Caption size="xs"
|
9
8
|
text="Basic unstyled example"
|
10
9
|
/>
|
11
10
|
<FormattedDate
|
@@ -16,14 +15,10 @@ const DateUnstyled = (props) => {
|
|
16
15
|
|
17
16
|
<br />
|
18
17
|
|
19
|
-
<Caption
|
20
|
-
|
21
|
-
size="xs"
|
18
|
+
<Caption size="xs"
|
22
19
|
text="Example with wrapping typography kit"
|
23
20
|
/>
|
24
|
-
<Title {
|
25
|
-
size={1}
|
26
|
-
>
|
21
|
+
<Title size={1}>
|
27
22
|
<FormattedDate
|
28
23
|
unstyled
|
29
24
|
value={new Date('25 Dec 1995')}
|
@@ -33,13 +28,10 @@ const DateUnstyled = (props) => {
|
|
33
28
|
|
34
29
|
<br />
|
35
30
|
|
36
|
-
<Caption
|
37
|
-
size="xs"
|
31
|
+
<Caption size="xs"
|
38
32
|
text="Example with icon + subcaption"
|
39
33
|
/>
|
40
|
-
<Caption
|
41
|
-
size="xs"
|
42
|
-
>
|
34
|
+
<Caption size="xs">
|
43
35
|
<FormattedDate
|
44
36
|
showDayOfWeek
|
45
37
|
showIcon
|
@@ -29,7 +29,6 @@ type DatePickerProps = {
|
|
29
29
|
hideLabel?: boolean,
|
30
30
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
31
31
|
id?: string,
|
32
|
-
initializeOnce?: boolean,
|
33
32
|
inLine?: boolean,
|
34
33
|
inputAria?: { [key: string]: string },
|
35
34
|
inputData?: { [key: string]: string },
|
@@ -74,7 +73,6 @@ const DatePicker = (props: DatePickerProps): React.ReactElement => {
|
|
74
73
|
hideLabel = false,
|
75
74
|
htmlOptions = {},
|
76
75
|
id,
|
77
|
-
initializeOnce = false,
|
78
76
|
inLine = false,
|
79
77
|
inputAria = {},
|
80
78
|
inputData = {},
|
@@ -136,7 +134,7 @@ useEffect(() => {
|
|
136
134
|
yearRange,
|
137
135
|
required: false,
|
138
136
|
}, scrollContainer)
|
139
|
-
}
|
137
|
+
})
|
140
138
|
const filteredProps = {...props}
|
141
139
|
if (filteredProps.marginBottom === undefined) {
|
142
140
|
filteredProps.marginBottom = "sm"
|
@@ -1,17 +1,18 @@
|
|
1
1
|
examples:
|
2
|
+
|
3
|
+
|
2
4
|
react:
|
3
5
|
- draggable_default: Default
|
4
6
|
- draggable_with_list: Draggable with List Kit
|
5
7
|
- draggable_with_selectable_list: Draggable with SelectableList Kit
|
6
8
|
- draggable_with_cards: Draggable with Cards
|
7
|
-
- draggable_with_table_react: Draggable with Table
|
8
9
|
- draggable_multiple_containers: Dragging Across Multiple Containers
|
9
|
-
|
10
|
+
|
10
11
|
rails:
|
11
12
|
- draggable_default_rails: Default
|
12
13
|
- draggable_with_list_rails: Draggable with List Kit
|
13
14
|
- draggable_with_selectable_list_rails: Draggable with SelectableList Kit
|
14
15
|
- draggable_with_cards_rails: Draggable with Cards
|
15
|
-
- draggable_with_table: Draggable with Table
|
16
|
-
- draggable_multiple_containers_rails: Dragging Across Multiple Containers
|
17
16
|
|
17
|
+
|
18
|
+
|
@@ -2,5 +2,4 @@ export { default as DraggableDefault } from './_draggable_default.jsx'
|
|
2
2
|
export { default as DraggableWithCards } from './_draggable_with_cards.jsx'
|
3
3
|
export { default as DraggableWithList } from './_draggable_with_list.jsx'
|
4
4
|
export { default as DraggableWithSelectableList } from './_draggable_with_selectable_list.jsx'
|
5
|
-
export { default as DraggableMultipleContainers } from './_draggable_multiple_containers.jsx'
|
6
|
-
export { default as DraggableWithTableReact } from './_draggable_with_table_react.jsx'
|
5
|
+
export { default as DraggableMultipleContainers } from './_draggable_multiple_containers.jsx'
|
@@ -1,3 +1,3 @@
|
|
1
|
-
<%= pb_content_tag
|
1
|
+
<%= pb_content_tag do %>
|
2
2
|
<%= content.presence %>
|
3
|
-
<% end %>
|
3
|
+
<% end %>
|
@@ -3,11 +3,6 @@
|
|
3
3
|
module Playbook
|
4
4
|
module PbDraggable
|
5
5
|
class DraggableContainer < ::Playbook::KitBase
|
6
|
-
prop :tag, type: Playbook::Props::String,
|
7
|
-
default: "div"
|
8
|
-
prop :container, type: Playbook::Props::String,
|
9
|
-
default: ""
|
10
|
-
|
11
6
|
def data
|
12
7
|
Hash(prop(:data)).merge(pb_draggable_container: true)
|
13
8
|
end
|
@@ -5,10 +5,6 @@ module Playbook
|
|
5
5
|
class DraggableItem < ::Playbook::KitBase
|
6
6
|
prop :drag_id, type: Playbook::Props::String,
|
7
7
|
default: ""
|
8
|
-
prop :tag, type: Playbook::Props::String,
|
9
|
-
default: "div"
|
10
|
-
prop :container, type: Playbook::Props::String,
|
11
|
-
default: ""
|
12
8
|
|
13
9
|
def data
|
14
10
|
Hash(prop(:data)).merge(pb_draggable_item: true)
|
@@ -9,38 +9,12 @@ export default class PbDraggable extends PbEnhancedElement {
|
|
9
9
|
}
|
10
10
|
|
11
11
|
connect() {
|
12
|
-
this.state = {
|
13
|
-
items: [],
|
14
|
-
dragData: { id: "", initialGroup: "" },
|
15
|
-
isDragging: "",
|
16
|
-
activeContainer: ""
|
17
|
-
};
|
18
|
-
|
19
12
|
this.draggedItem = null;
|
20
13
|
this.draggedItemId = null;
|
21
|
-
this.hasMultipleContainers = false;
|
22
|
-
|
23
14
|
document.addEventListener("DOMContentLoaded", () => this.bindEventListeners());
|
24
15
|
}
|
25
16
|
|
26
|
-
setState(newState) {
|
27
|
-
this.state = { ...this.state, ...newState };
|
28
|
-
if (newState.items) {
|
29
|
-
const customEvent = new CustomEvent('pb-draggable-reorder', {
|
30
|
-
detail: {
|
31
|
-
reorderedItems: this.state.items,
|
32
|
-
containerId: this.element.querySelector(DRAGGABLE_CONTAINER).id
|
33
|
-
}
|
34
|
-
});
|
35
|
-
this.element.dispatchEvent(customEvent);
|
36
|
-
}
|
37
|
-
}
|
38
|
-
|
39
17
|
bindEventListeners() {
|
40
|
-
// Check for multiple containers
|
41
|
-
const containers = this.element.querySelectorAll(DRAGGABLE_CONTAINER);
|
42
|
-
this.hasMultipleContainers = containers.length > 1;
|
43
|
-
|
44
18
|
// Needed to prevent images within draggable items from being independently draggable
|
45
19
|
// Needed if using Image kit in draggable items
|
46
20
|
this.element.querySelectorAll(".pb_draggable_item img").forEach(img => {
|
@@ -53,10 +27,11 @@ export default class PbDraggable extends PbEnhancedElement {
|
|
53
27
|
item.addEventListener("dragenter", this.handleDragEnter.bind(this));
|
54
28
|
});
|
55
29
|
|
56
|
-
|
30
|
+
const container = this.element.querySelector(DRAGGABLE_CONTAINER);
|
31
|
+
if (container) {
|
57
32
|
container.addEventListener("dragover", this.handleDragOver.bind(this));
|
58
33
|
container.addEventListener("drop", this.handleDrop.bind(this));
|
59
|
-
}
|
34
|
+
}
|
60
35
|
}
|
61
36
|
|
62
37
|
handleDragStart(event) {
|
@@ -66,17 +41,11 @@ export default class PbDraggable extends PbEnhancedElement {
|
|
66
41
|
event.preventDefault();
|
67
42
|
return;
|
68
43
|
}
|
69
|
-
|
70
|
-
const container = event.target.closest(DRAGGABLE_CONTAINER);
|
44
|
+
|
71
45
|
this.draggedItem = event.target;
|
72
46
|
this.draggedItemId = event.target.id;
|
73
|
-
|
74
|
-
this.setState({
|
75
|
-
dragData: { id: this.draggedItemId, initialGroup: container.id },
|
76
|
-
isDragging: this.draggedItemId
|
77
|
-
});
|
78
|
-
|
79
47
|
event.target.classList.add("is_dragging");
|
48
|
+
|
80
49
|
if (event.dataTransfer) {
|
81
50
|
event.dataTransfer.effectAllowed = 'move';
|
82
51
|
event.dataTransfer.setData('text/plain', this.draggedItemId);
|
@@ -90,20 +59,11 @@ export default class PbDraggable extends PbEnhancedElement {
|
|
90
59
|
handleDragEnter(event) {
|
91
60
|
if (!this.draggedItem || event.target === this.draggedItem) return;
|
92
61
|
|
93
|
-
if (this.hasMultipleContainers) {
|
94
|
-
this.handleMultiContainerDragEnter(event);
|
95
|
-
} else {
|
96
|
-
this.handleSingleContainerDragEnter(event);
|
97
|
-
}
|
98
|
-
}
|
99
|
-
|
100
|
-
handleSingleContainerDragEnter(event) {
|
101
62
|
const targetItem = event.target.closest('.pb_draggable_item');
|
102
63
|
if (!targetItem) return;
|
103
64
|
|
104
65
|
const container = targetItem.parentNode;
|
105
66
|
const items = Array.from(container.children);
|
106
|
-
|
107
67
|
const draggedIndex = items.indexOf(this.draggedItem);
|
108
68
|
const targetIndex = items.indexOf(targetItem);
|
109
69
|
|
@@ -114,143 +74,47 @@ export default class PbDraggable extends PbEnhancedElement {
|
|
114
74
|
}
|
115
75
|
}
|
116
76
|
|
117
|
-
handleMultiContainerDragEnter(event) {
|
118
|
-
const targetContainer = event.target.closest(DRAGGABLE_CONTAINER);
|
119
|
-
const targetItem = event.target.closest('.pb_draggable_item');
|
120
|
-
|
121
|
-
if (!targetContainer) return;
|
122
|
-
|
123
|
-
// If we're entering a container directly or there's no target item
|
124
|
-
if (!targetItem) {
|
125
|
-
const lastItem = targetContainer.querySelector('.pb_draggable_item:last-child');
|
126
|
-
if (lastItem) {
|
127
|
-
targetContainer.insertBefore(this.draggedItem, lastItem.nextSibling);
|
128
|
-
} else {
|
129
|
-
targetContainer.appendChild(this.draggedItem);
|
130
|
-
}
|
131
|
-
return;
|
132
|
-
}
|
133
|
-
|
134
|
-
const container = targetItem.parentNode;
|
135
|
-
const items = Array.from(container.children);
|
136
|
-
|
137
|
-
const newItems = [...items].map(item => ({
|
138
|
-
id: item.id,
|
139
|
-
container: container.id
|
140
|
-
}));
|
141
|
-
|
142
|
-
this.setState({ items: newItems });
|
143
|
-
|
144
|
-
const rect = targetItem.getBoundingClientRect();
|
145
|
-
const middleY = rect.top + rect.height / 2;
|
146
|
-
|
147
|
-
if (event.clientY < middleY) {
|
148
|
-
container.insertBefore(this.draggedItem, targetItem);
|
149
|
-
} else {
|
150
|
-
container.insertBefore(this.draggedItem, targetItem.nextSibling);
|
151
|
-
}
|
152
|
-
}
|
153
|
-
|
154
77
|
handleDragOver(event) {
|
155
78
|
event.preventDefault();
|
156
|
-
event.stopPropagation();
|
157
|
-
|
158
|
-
if (this.hasMultipleContainers) {
|
159
|
-
this.handleMultiContainerDragOver(event);
|
160
|
-
} else {
|
161
|
-
this.handleSingleContainerDragOver(event);
|
162
|
-
}
|
163
|
-
}
|
164
|
-
|
165
|
-
handleSingleContainerDragOver(event) {
|
166
79
|
const container = event.target.closest(DRAGGABLE_CONTAINER);
|
167
|
-
if (container) {
|
168
|
-
container.classList.add("active_container");
|
169
|
-
}
|
170
|
-
}
|
171
|
-
|
172
|
-
handleMultiContainerDragOver(event) {
|
173
|
-
let container;
|
174
|
-
if (event.target.matches(DRAGGABLE_CONTAINER)) {
|
175
|
-
container = event.target;
|
176
|
-
} else {
|
177
|
-
container = event.target.closest(DRAGGABLE_CONTAINER);
|
178
|
-
}
|
179
80
|
|
180
81
|
if (container) {
|
181
|
-
this.setState({ activeContainer: container.id });
|
182
82
|
container.classList.add("active_container");
|
183
|
-
|
184
|
-
// If dragging over empty container or below last item
|
185
|
-
const lastItem = container.querySelector('.pb_draggable_item:last-child');
|
186
|
-
if (!lastItem || (lastItem && event.clientY > lastItem.getBoundingClientRect().bottom)) {
|
187
|
-
if (this.draggedItem && this.draggedItem.parentNode !== container) {
|
188
|
-
container.appendChild(this.draggedItem);
|
189
|
-
}
|
190
|
-
}
|
191
83
|
}
|
192
84
|
}
|
193
85
|
|
194
86
|
handleDrop(event) {
|
195
87
|
event.preventDefault();
|
196
|
-
event.
|
197
|
-
|
198
|
-
let container;
|
199
|
-
if (event.target.matches(DRAGGABLE_CONTAINER)) {
|
200
|
-
container = event.target;
|
201
|
-
} else {
|
202
|
-
container = event.target.closest(DRAGGABLE_CONTAINER);
|
203
|
-
}
|
204
|
-
|
88
|
+
const container = event.target.closest(DRAGGABLE_CONTAINER);
|
205
89
|
if (!container || !this.draggedItem) return;
|
206
|
-
|
90
|
+
|
207
91
|
container.classList.remove("active_container");
|
208
92
|
this.draggedItem.style.opacity = '1';
|
209
|
-
|
210
|
-
// Handle empty containers
|
211
|
-
if (this.hasMultipleContainers && !container.querySelector('.pb_draggable_item')) {
|
212
|
-
container.appendChild(this.draggedItem);
|
213
|
-
}
|
214
|
-
|
93
|
+
|
215
94
|
// Updated order of items as an array of item IDs
|
216
|
-
const reorderedItems = Array.from(
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
container: item.closest(DRAGGABLE_CONTAINER).id
|
221
|
-
}));
|
222
|
-
|
95
|
+
const reorderedItems = Array.from(container.children)
|
96
|
+
.filter(item => item.classList.contains("pb_draggable_item"))
|
97
|
+
.map(item => item.id.replace("item_", ""));
|
98
|
+
|
223
99
|
// Store reordered items in a data attribute on the container
|
224
100
|
container.setAttribute("data-reordered-items", JSON.stringify(reorderedItems));
|
225
|
-
|
101
|
+
|
226
102
|
const customEvent = new CustomEvent('pb-draggable-reorder', {
|
227
103
|
detail: {
|
228
104
|
reorderedItems,
|
229
105
|
containerId: container.id,
|
230
106
|
}
|
231
107
|
});
|
232
|
-
|
233
108
|
this.element.dispatchEvent(customEvent);
|
234
|
-
|
235
|
-
this.setState({
|
236
|
-
items: reorderedItems,
|
237
|
-
isDragging: "",
|
238
|
-
activeContainer: ""
|
239
|
-
});
|
240
|
-
|
109
|
+
|
241
110
|
this.draggedItem = null;
|
242
111
|
this.draggedItemId = null;
|
243
112
|
}
|
113
|
+
|
244
114
|
|
245
115
|
handleDragEnd(event) {
|
246
116
|
event.target.classList.remove("is_dragging");
|
247
117
|
event.target.style.opacity = '1';
|
248
|
-
|
249
|
-
this.setState({
|
250
|
-
isDragging: "",
|
251
|
-
activeContainer: ""
|
252
|
-
});
|
253
|
-
|
254
118
|
this.draggedItem = null;
|
255
119
|
this.draggedItemId = null;
|
256
120
|
|
@@ -17,11 +17,10 @@ type DraggableContainerProps = {
|
|
17
17
|
data?: { [key: string]: string };
|
18
18
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
19
19
|
id?: string;
|
20
|
-
tag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'div' | 'tr' | 'th' | 'td' | 'thead' | 'col' | 'tbody',
|
21
20
|
};
|
22
21
|
|
23
22
|
const DraggableContainer = (props: DraggableContainerProps) => {
|
24
|
-
const { aria = {}, children, className, container, data = {}, htmlOptions = {}, id
|
23
|
+
const { aria = {}, children, className, container, data = {}, htmlOptions = {}, id } = props;
|
25
24
|
|
26
25
|
const { handleDragOver, handleDrop, activeContainer } = DraggableContext();
|
27
26
|
|
@@ -29,8 +28,6 @@ const DraggableContainer = (props: DraggableContainerProps) => {
|
|
29
28
|
const dataProps = buildDataProps(data);
|
30
29
|
const htmlProps = buildHtmlProps(htmlOptions);
|
31
30
|
|
32
|
-
const Tag: React.ReactElement | any = `${tag}`;
|
33
|
-
|
34
31
|
const classes = classnames(
|
35
32
|
buildCss("pb_draggable_container"),
|
36
33
|
`${activeContainer === container ? "active" : ""}`,
|
@@ -39,18 +36,18 @@ const DraggableContainer = (props: DraggableContainerProps) => {
|
|
39
36
|
);
|
40
37
|
|
41
38
|
return (
|
42
|
-
<
|
39
|
+
<div
|
43
40
|
{...ariaProps}
|
44
41
|
{...dataProps}
|
45
42
|
{...htmlProps}
|
46
43
|
className={classes}
|
47
44
|
id={id}
|
48
45
|
key={container}
|
49
|
-
onDragOver={(e
|
46
|
+
onDragOver={(e) => handleDragOver(e, container)}
|
50
47
|
onDrop={() => handleDrop(container)}
|
51
48
|
>
|
52
49
|
{children}
|
53
|
-
</
|
50
|
+
</div>
|
54
51
|
);
|
55
52
|
};
|
56
53
|
|
@@ -18,11 +18,10 @@ type DraggableItemProps = {
|
|
18
18
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
19
19
|
id?: string;
|
20
20
|
dragId?: string;
|
21
|
-
tag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'div' | 'tr' | 'th' | 'td' | 'thead' | 'col' | 'tbody',
|
22
21
|
};
|
23
22
|
|
24
23
|
const DraggableItem = (props: DraggableItemProps) => {
|
25
|
-
const { aria = {}, children, className, container, data = {}, htmlOptions = {}, id, dragId
|
24
|
+
const { aria = {}, children, className, container, data = {}, htmlOptions = {}, id, dragId } = props;
|
26
25
|
|
27
26
|
const { isDragging, handleDragStart, handleDragEnter, handleDragEnd } =
|
28
27
|
DraggableContext();
|
@@ -31,8 +30,6 @@ const DraggableItem = (props: DraggableItemProps) => {
|
|
31
30
|
const dataProps = buildDataProps(data);
|
32
31
|
const htmlProps = buildHtmlProps(htmlOptions);
|
33
32
|
|
34
|
-
const Tag: React.ReactElement | any = `${tag}`;
|
35
|
-
|
36
33
|
const classes = classnames(
|
37
34
|
buildCss("pb_draggable_item"),
|
38
35
|
`${isDragging === dragId ? "is_dragging" : ""}`,
|
@@ -41,7 +38,7 @@ const DraggableItem = (props: DraggableItemProps) => {
|
|
41
38
|
);
|
42
39
|
|
43
40
|
return (
|
44
|
-
<
|
41
|
+
<div
|
45
42
|
{...ariaProps}
|
46
43
|
{...dataProps}
|
47
44
|
{...htmlProps}
|
@@ -54,7 +51,7 @@ const DraggableItem = (props: DraggableItemProps) => {
|
|
54
51
|
onDragStart={() => handleDragStart(dragId, container)}
|
55
52
|
>
|
56
53
|
{children}
|
57
|
-
</
|
54
|
+
</div>
|
58
55
|
);
|
59
56
|
};
|
60
57
|
|
@@ -1,4 +1,9 @@
|
|
1
|
-
<%=
|
1
|
+
<%= content_tag("div",
|
2
|
+
aria: object.aria,
|
3
|
+
class: object.classname,
|
4
|
+
data: object.data,
|
5
|
+
id: object.id,
|
6
|
+
**combined_html_options) do %>
|
2
7
|
<%= pb_rails("form_group", props: {cursor: "pointer", full_width: object.full_width}) do %>
|
3
8
|
<label
|
4
9
|
for="upload-<%= object.id %>"
|
@@ -1,4 +1,8 @@
|
|
1
|
-
<%=
|
1
|
+
<%= content_tag(:div,
|
2
|
+
id: object.id,
|
3
|
+
data: object.data,
|
4
|
+
class: object.classname,
|
5
|
+
**combined_html_options) do %>
|
2
6
|
<%= object.wrapper do %>
|
3
7
|
<%= pb_rails("flex", props: { orientation: "row", padding_right: "lg", vertical: "center" }) do %>
|
4
8
|
<% if (object.template != "sort_only") %>
|
@@ -5,7 +5,6 @@ examples:
|
|
5
5
|
- fixed_confirmation_toast_multi_line: Multi Line
|
6
6
|
- fixed_confirmation_toast_close: Click to Close
|
7
7
|
- fixed_confirmation_toast_positions: Click to Show Positions
|
8
|
-
- fixed_confirmation_toast_auto_close: Click to Show Auto Close
|
9
8
|
- fixed_confirmation_toast_children: Children
|
10
9
|
- fixed_confirmation_toast_custom_icon: Custom Icon
|
11
10
|
|
@@ -2,18 +2,16 @@ import PbEnhancedElement from '../pb_enhanced_element'
|
|
2
2
|
|
3
3
|
export default class PbFixedConfirmationToast extends PbEnhancedElement {
|
4
4
|
static get selector() {
|
5
|
-
return '
|
5
|
+
return '.remove_toast'
|
6
6
|
}
|
7
7
|
|
8
8
|
connect() {
|
9
9
|
this.self = this.element
|
10
10
|
this.autoCloseToast(this.self)
|
11
11
|
|
12
|
-
|
13
|
-
this.self
|
14
|
-
|
15
|
-
})
|
16
|
-
}
|
12
|
+
this.self.addEventListener('click', () => {
|
13
|
+
this.removeToast(this.self)
|
14
|
+
})
|
17
15
|
}
|
18
16
|
|
19
17
|
removeToast(elem) {
|
@@ -34,4 +32,4 @@ export default class PbFixedConfirmationToast extends PbEnhancedElement {
|
|
34
32
|
}, autoCloseIntValue)
|
35
33
|
}
|
36
34
|
}
|
37
|
-
}
|
35
|
+
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<%=
|
1
|
+
<%= content_tag(:div, id: object.id, data: object.data, class: object.classname + object.size_class, tabindex: object.tabindex, **combined_html_options) do %>
|
2
2
|
<% if object.name.present? %>
|
3
3
|
<%= pb_rails("avatar", props: { name: object.name, image_url: object.avatar_url, size: "xxs" }) %>
|
4
4
|
<% if object.truncate %>
|