playbook_ui 14.11.0 → 14.11.1.pre.alpha.PBNTR440enableglobalpropspbformwith5624
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/_playbook.scss +2 -0
- data/app/pb_kits/playbook/pb_advanced_table/Components/CustomCell.tsx +18 -2
- data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +27 -5
- data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableBody.tsx +17 -2
- data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableHeader.tsx +23 -1
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +29 -0
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +61 -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_no_subrows.jsx +50 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination.jsx +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.jsx +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows.jsx +60 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows.md +5 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions.jsx +78 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions.md +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_header.jsx +53 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_header.md +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows.jsx +52 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows.md +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_control.md +2 -2
- 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/advanced_table_mock_data_no_subrows.json +42 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_mock_data_with_id.json +299 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +6 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +6 -1
- data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.scss +9 -11
- data/app/pb_kits/playbook/pb_badge/_badge.scss +2 -4
- data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumbs.scss +1 -3
- data/app/pb_kits/playbook/pb_button/_button.scss +1 -3
- 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_circle_icon_button/_circle_icon_button.scss +2 -4
- data/app/pb_kits/playbook/pb_collapsible/collapsible.html.erb +3 -1
- data/app/pb_kits/playbook/pb_collapsible/collapsible.rb +3 -0
- data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +24 -16
- data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +2 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default_date.md +1 -1
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_turbo_frames.html.erb +13 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_turbo_frames_rails.md +3 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_input_styles.scss +1 -3
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_overrides.scss +3 -5
- data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.scss +4 -6
- data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.scss +2 -4
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_list_rails.html.erb +3 -9
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_list_rails.md +5 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_selectable_list_rails.html.erb +38 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_selectable_list_rails.md +3 -0
- data/app/pb_kits/playbook/pb_draggable/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_drawer/_drawer.scss +145 -183
- data/app/pb_kits/playbook/pb_drawer/_drawer.tsx +158 -268
- data/app/pb_kits/playbook/pb_drawer/context.ts +11 -0
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_behavior.jsx +38 -0
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_borders.jsx +3 -45
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.jsx +0 -1
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_default.jsx +9 -16
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.jsx +44 -19
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.md +21 -3
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx +16 -21
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_sizes.jsx +2 -19
- data/app/pb_kits/playbook/pb_drawer/docs/example.yml +2 -1
- data/app/pb_kits/playbook/pb_drawer/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_drawer/drawer.test.jsx +5 -5
- data/app/pb_kits/playbook/pb_drawer/hooks/useBreakpoint.tsx +60 -0
- data/app/pb_kits/playbook/pb_drawer/hooks/useDrawerAnimation.tsx +21 -0
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +8 -10
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subtle_variant.md +1 -1
- 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_form_pill/_form_pill.scss +4 -6
- data/app/pb_kits/playbook/pb_icon_button/_icon_button.scss +78 -0
- data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_default.html.erb +3 -0
- data/app/pb_kits/playbook/pb_icon_button/docs/example.yml +7 -0
- data/app/pb_kits/playbook/pb_icon_button/icon_button.html.erb +16 -0
- data/app/pb_kits/playbook/pb_icon_button/icon_button.rb +22 -0
- data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.scss +1 -3
- data/app/pb_kits/playbook/pb_label_value/_label_value.scss +2 -4
- data/app/pb_kits/playbook/pb_list/item.html.erb +30 -8
- data/app/pb_kits/playbook/pb_list/item.rb +7 -0
- data/app/pb_kits/playbook/pb_list/list.html.erb +31 -11
- data/app/pb_kits/playbook/pb_list/list.rb +4 -0
- data/app/pb_kits/playbook/pb_loading_inline/_loading_inline.tsx +6 -1
- data/app/pb_kits/playbook/pb_message/_message_mixins.scss +1 -3
- data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.scss +5 -3
- data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.tsx +1 -0
- data/app/pb_kits/playbook/pb_multiple_users/multiple_users.html.erb +1 -1
- data/app/pb_kits/playbook/pb_passphrase/_passphrase.scss +3 -5
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.scss +8 -10
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +30 -12
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_format.html.erb +15 -0
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_format.jsx +24 -0
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_format.md +1 -0
- data/app/pb_kits/playbook/pb_phone_number_input/docs/example.yml +3 -1
- data/app/pb_kits/playbook/pb_phone_number_input/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.rb +3 -0
- data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.test.js +20 -1
- data/app/pb_kits/playbook/pb_pill/_pill.scss +2 -4
- data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.scss +2 -4
- data/app/pb_kits/playbook/pb_radio/_radio.scss +12 -8
- data/app/pb_kits/playbook/pb_radio/docs/_radio_custom_children.jsx +8 -3
- data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.scss +2 -4
- data/app/pb_kits/playbook/pb_select/_select.scss +6 -10
- data/app/pb_kits/playbook/pb_select/_select.tsx +5 -1
- data/app/pb_kits/playbook/pb_select/select.html.erb +2 -2
- data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +3 -5
- data/app/pb_kits/playbook/pb_selectable_icon/_selectable_icon.tsx +9 -1
- data/app/pb_kits/playbook/pb_selectable_icon/docs/_selectable_icon_default.jsx +4 -1
- data/app/pb_kits/playbook/pb_selectable_icon/docs/_selectable_icon_single_select.jsx +4 -1
- data/app/pb_kits/playbook/pb_selectable_list/selectable_list.html.erb +17 -3
- data/app/pb_kits/playbook/pb_selectable_list/selectable_list.rb +3 -0
- data/app/pb_kits/playbook/pb_selectable_list/selectable_list_item.html.erb +11 -4
- data/app/pb_kits/playbook/pb_selectable_list/selectable_list_item.rb +3 -0
- data/app/pb_kits/playbook/pb_table/_table.tsx +2 -3
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns.html.erb +74 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns_rails.md +3 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns_rails.md +2 -2
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns.html.erb +74 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns_rails.md +3 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible.html.erb +47 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_rails.md +2 -0
- data/app/pb_kits/playbook/pb_table/docs/example.yml +3 -0
- data/app/pb_kits/playbook/pb_table/index.ts +187 -88
- data/app/pb_kits/playbook/pb_table/styles/_collapsible.scss +12 -0
- data/app/pb_kits/playbook/pb_table/styles/_scroll.scss +6 -5
- data/app/pb_kits/playbook/pb_table/table.html.erb +1 -1
- data/app/pb_kits/playbook/pb_table/table.rb +17 -2
- data/app/pb_kits/playbook/pb_table/table_row.html.erb +20 -1
- data/app/pb_kits/playbook/pb_table/table_row.rb +5 -0
- data/app/pb_kits/playbook/pb_table/utilities/addDataTitle.ts +22 -0
- data/app/pb_kits/playbook/pb_text_input/_text_input.scss +1 -3
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask.html.erb +46 -0
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask_rails.md +3 -0
- data/app/pb_kits/playbook/pb_text_input/docs/example.yml +2 -1
- data/app/pb_kits/playbook/pb_text_input/index.js +103 -0
- data/app/pb_kits/playbook/pb_text_input/text_input.html.erb +4 -0
- data/app/pb_kits/playbook/pb_text_input/text_input.rb +33 -3
- data/app/pb_kits/playbook/pb_textarea/_textarea.scss +1 -3
- data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.scss +4 -5
- data/app/pb_kits/playbook/pb_timeline/_timeline.scss +32 -34
- data/app/pb_kits/playbook/pb_toggle/_toggle.scss +3 -5
- 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_truncated_text.html.erb +19 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.jsx +27 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.md +1 -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/app/pb_kits/playbook/pb_typeahead/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/index.js +1 -0
- data/dist/chunks/_typeahead-BWwaAo_0.js +36 -0
- data/dist/chunks/_weekday_stacked-zyBCd1s8.js +45 -0
- data/dist/chunks/lazysizes-B7xYodB-.js +1 -0
- data/dist/chunks/{lib-B7sgJtGS.js → lib-kMuhBuU7.js} +2 -2
- data/dist/chunks/{pb_form_validation-C5Cc0-1v.js → pb_form_validation-DBJ0wZuS.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +6 -0
- 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/pb_forms_global_props_helper.rb +136 -0
- data/lib/playbook/pb_forms_helper.rb +13 -4
- data/lib/playbook/version.rb +2 -2
- metadata +67 -9
- data/dist/chunks/_typeahead-C2iCBqxQ.js +0 -36
- data/dist/chunks/_weekday_stacked-E-5KcEkc.js +0 -45
- data/dist/chunks/lazysizes-DHz07jlL.js +0 -1
- /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_table_props.md → _advanced_table_table_props_react.md} +0 -0
- /data/app/pb_kits/playbook/pb_table/docs/{_table_with_collapsible.md → _table_with_collapsible_react.md} +0 -0
@@ -1,5 +1,3 @@
|
|
1
|
-
@use "sass:math";
|
2
|
-
|
3
1
|
@import "../tokens/border_radius";
|
4
2
|
@import "../tokens/colors";
|
5
3
|
@import "../tokens/opacity";
|
@@ -13,7 +11,7 @@
|
|
13
11
|
align-items: center;
|
14
12
|
justify-content: center;
|
15
13
|
border-radius: $border_rad_light;
|
16
|
-
padding: 0
|
14
|
+
padding: 0 $space_xs/2;
|
17
15
|
border-width: 1px;
|
18
16
|
border-style: solid;
|
19
17
|
border-color: $card_light;
|
@@ -36,7 +34,7 @@
|
|
36
34
|
height: $pb_badge_height;
|
37
35
|
min-height: $pb_badge_height;
|
38
36
|
min-width: $pb_badge_height;
|
39
|
-
border-radius:
|
37
|
+
border-radius: $pb_badge_height / 2;
|
40
38
|
}
|
41
39
|
|
42
40
|
&[class*=_notification] {
|
@@ -1,5 +1,3 @@
|
|
1
|
-
@use "sass:math";
|
2
|
-
|
3
1
|
@import "../tokens/colors";
|
4
2
|
@import "../tokens/opacity";
|
5
3
|
@import "../tokens/spacing";
|
@@ -11,7 +9,7 @@
|
|
11
9
|
display: inline-flex;
|
12
10
|
align-items: center;
|
13
11
|
justify-content: center;
|
14
|
-
padding: 0
|
12
|
+
padding: 0 $space_xs/2;
|
15
13
|
|
16
14
|
svg {
|
17
15
|
margin-right: 8px;
|
@@ -1,5 +1,3 @@
|
|
1
|
-
@use "sass:math";
|
2
|
-
|
3
1
|
@import "./button_mixins";
|
4
2
|
@import "../tokens/colors";
|
5
3
|
@import "../tokens/border_radius";
|
@@ -19,7 +17,7 @@ $pb_button_sizes: (
|
|
19
17
|
@each $name, $size in $pb_button_sizes {
|
20
18
|
&[class*=size_#{$name}] {
|
21
19
|
font-size: $size;
|
22
|
-
padding:
|
20
|
+
padding: $size / 2 $size * 2.42;
|
23
21
|
@if $name == "sm" {
|
24
22
|
min-height: 0;
|
25
23
|
}
|
@@ -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,5 +1,3 @@
|
|
1
|
-
@use "sass:math";
|
2
|
-
|
3
1
|
@import "../pb_button/button";
|
4
2
|
@import "../pb_button/button_mixins";
|
5
3
|
|
@@ -18,7 +16,7 @@ $pb_button_styles: (
|
|
18
16
|
flex-grow: 0;
|
19
17
|
width: $pb_button_size;
|
20
18
|
height: $pb_button_size;
|
21
|
-
border-radius:
|
19
|
+
border-radius: $pb_button_size / 2;
|
22
20
|
line-height: $pb_button_size;
|
23
21
|
flex-basis: $pb_button_size;
|
24
22
|
min-width: $pb_button_size;
|
@@ -55,4 +53,4 @@ $pb_button_styles: (
|
|
55
53
|
}
|
56
54
|
}
|
57
55
|
}
|
58
|
-
}
|
56
|
+
}
|
@@ -3,6 +3,9 @@
|
|
3
3
|
module Playbook
|
4
4
|
module PbCollapsible
|
5
5
|
class Collapsible < Playbook::KitBase
|
6
|
+
prop :tag, type: Playbook::Props::Enum,
|
7
|
+
values: %w[h1 h2 h3 h4 h5 h6 p div span tr th td thead col],
|
8
|
+
default: "div"
|
6
9
|
def classname
|
7
10
|
generate_classname("pb_collapsible_kit")
|
8
11
|
end
|
@@ -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 %>
|
@@ -68,18 +64,30 @@
|
|
68
64
|
</div>
|
69
65
|
|
70
66
|
<%= javascript_tag do %>
|
71
|
-
|
72
|
-
|
67
|
+
(function() {
|
68
|
+
const loadDatePicker = () => {
|
69
|
+
datePickerHelper(<%= object.date_picker_config %>, "<%= object.scroll_container %>")
|
73
70
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
71
|
+
if (<%= object.selection_type == "quickpick" %>) {
|
72
|
+
document.getElementById("<%= object.picker_id %>").addEventListener("change", ({ target }) => {
|
73
|
+
const startDate = document.getElementById("<%= object.start_date_id %>")
|
74
|
+
const endDate = document.getElementById("<%= object.end_date_id %>")
|
75
|
+
const splittedValue = target.value.split(" to ")
|
76
|
+
startDate.value = splittedValue[0]
|
77
|
+
endDate.value = splittedValue[1] ? splittedValue[1] : splittedValue[0]
|
78
|
+
})
|
79
|
+
}
|
80
|
+
}
|
81
|
+
|
82
|
+
window.addEventListener("DOMContentLoaded", () => {
|
83
|
+
loadDatePicker()
|
84
|
+
})
|
85
|
+
|
86
|
+
if (<%= !object.custom_event_type.empty? %>) {
|
87
|
+
window.addEventListener("<%= object.custom_event_type %>", () => {
|
88
|
+
loadDatePicker()
|
81
89
|
})
|
82
90
|
}
|
83
|
-
})
|
91
|
+
})()
|
84
92
|
<% end %>
|
85
93
|
<% end %>
|
@@ -73,6 +73,8 @@ module Playbook
|
|
73
73
|
default: false
|
74
74
|
prop :year_range, type: Playbook::Props::Array,
|
75
75
|
default: [1900, 2100]
|
76
|
+
prop :custom_event_type, type: Playbook::Props::String,
|
77
|
+
default: ""
|
76
78
|
|
77
79
|
def classname
|
78
80
|
default_margin_bottom = margin_bottom.present? ? "" : " mb_sm"
|
@@ -2,4 +2,4 @@ The `defaultDate`/`default_date` prop has a null or empty string value by defaul
|
|
2
2
|
|
3
3
|
If you use a Date object without UTC time standardization the Date Picker kit may misinterpret that date as yesterdays date (consequence of timezone differentials and the Javascript Date Object constructor). See [this GitHub issue for more information](https://github.com/powerhome/playbook/issues/1167) and the anti-pattern examples below.
|
4
4
|
|
5
|
-
|
5
|
+
You can leverage the `defaultDate`/`default_date` prop with custom logic in your filter or controller files where the determination of the default value changes based on user interaction. The page can load with an initial default date picker value or placeholder text, then after filter submission save the submitted values as the "new default" (via state or params).
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<%= pb_rails("date_picker", props: { picker_id: "date-picker-turbo-frames", custom_event_type: "datePickerLoader" }) %>
|
2
|
+
<%= pb_rails("button", props: { id: "date-picker-loader", text: "Click Event Simulation" }) %>
|
3
|
+
|
4
|
+
<script>
|
5
|
+
document.getElementById("date-picker-loader").addEventListener("click", () => {
|
6
|
+
window.document.dispatchEvent(
|
7
|
+
new CustomEvent("datePickerLoader", {
|
8
|
+
bubbles: true,
|
9
|
+
})
|
10
|
+
)
|
11
|
+
console.log("Event 'datePickerLoader' dispatched - in a real implementation, this event would trigger the date picker's reinitialization through the custom_event_type prop connection")
|
12
|
+
})
|
13
|
+
</script>
|
@@ -0,0 +1,3 @@
|
|
1
|
+
The `custom_event_type` prop allows you to specify a custom event that will trigger the date picker's initialization, in addition to the default initialization on `DOMContentLoaded`. This is particularly useful in dynamic contexts like Turbo Frame updates where you need to reinitialize the date picker after new content loads. For Turbo integration, use `custom_event_type: "turbo:before-render"` to ensure the date picker properly reinitializes after Turbo navigation events.
|
2
|
+
|
3
|
+
In this example, we demonstrate the setup pattern by connecting a button to dispatch a "datePickerLoader" event - while the date picker's event listener is properly configured through the `custom_event_type` prop, this demo only logs the event dispatch to the console to illustrate the connection structure.
|
@@ -1,5 +1,3 @@
|
|
1
|
-
@use "sass:math";
|
2
|
-
|
3
1
|
@import "../../pb_textarea/textarea_mixin";
|
4
2
|
|
5
3
|
[class^=pb_date_picker_kit] {
|
@@ -43,7 +41,7 @@
|
|
43
41
|
&.error {
|
44
42
|
.date_picker_input_wrapper {
|
45
43
|
[class*=pb_body_kit] {
|
46
|
-
margin-top:
|
44
|
+
margin-top: $space_xs / 2;
|
47
45
|
}
|
48
46
|
|
49
47
|
input,
|
@@ -1,5 +1,3 @@
|
|
1
|
-
@use "sass:math";
|
2
|
-
|
3
1
|
@media (min-width: 500px) {
|
4
2
|
.flatpickr-calendar {
|
5
3
|
padding: $space_xs;
|
@@ -8,8 +6,8 @@
|
|
8
6
|
width: 315.88px
|
9
7
|
}
|
10
8
|
.flatpickr-months {
|
11
|
-
margin-left:
|
12
|
-
margin-top:
|
9
|
+
margin-left: $space_xs / 4;
|
10
|
+
margin-top: $space_xs / 3;
|
13
11
|
}
|
14
12
|
}
|
15
13
|
@media (max-width: 499px) {
|
@@ -21,7 +19,7 @@
|
|
21
19
|
}
|
22
20
|
}
|
23
21
|
// Firefox Header Adjustments
|
24
|
-
@supports (-moz-appearance:none) {
|
22
|
+
@supports (-moz-appearance:none) {
|
25
23
|
select.flatpickr-monthDropdown-months {
|
26
24
|
width: 97px !important;
|
27
25
|
margin-left: $space_xs + 3;
|
@@ -1,5 +1,3 @@
|
|
1
|
-
@use "sass:math";
|
2
|
-
|
3
1
|
[class^=pb_date_range_inline_kit] {
|
4
2
|
&[class*=_center] {
|
5
3
|
& > [class^=pb_caption],
|
@@ -23,14 +21,14 @@
|
|
23
21
|
display: flex;
|
24
22
|
align-items: center;
|
25
23
|
[class*=pb_date_range_inline_arrow] {
|
26
|
-
margin-left:
|
27
|
-
margin-right:
|
24
|
+
margin-left: $space_xs/2;
|
25
|
+
margin-right: $space_xs/2;
|
28
26
|
}
|
29
27
|
[class*=pb_date_range_inline_timezone] {
|
30
|
-
margin-left:
|
28
|
+
margin-left: $space_xs/2;
|
31
29
|
}
|
32
30
|
[class*=pb_date_range_inline_icon] {
|
33
|
-
margin-right:
|
31
|
+
margin-right: $space_xs/2;
|
34
32
|
}
|
35
33
|
}
|
36
34
|
}
|
@@ -1,5 +1,3 @@
|
|
1
|
-
@use "sass:math";
|
2
|
-
|
3
1
|
[class^=pb_date_time_stacked] {
|
4
2
|
|
5
3
|
[class^=padding_month] {
|
@@ -21,7 +19,7 @@
|
|
21
19
|
|
22
20
|
}
|
23
21
|
.date-time-padding {
|
24
|
-
padding-right:
|
25
|
-
padding-left:
|
22
|
+
padding-right: $space_xs / 2;
|
23
|
+
padding-left: $space_xs / 2;
|
26
24
|
}
|
27
25
|
|
@@ -6,14 +6,8 @@
|
|
6
6
|
|
7
7
|
] %>
|
8
8
|
|
9
|
-
<%= pb_rails("
|
10
|
-
|
11
|
-
<%= pb_rails("list", props:
|
12
|
-
<% initial_items.each do |item| %>
|
13
|
-
<%= pb_rails("draggable/draggable_item", props:{drag_id: item[:id]}) do %>
|
14
|
-
<%= pb_rails("list/item") do %><%= item[:name] %><% end %>
|
15
|
-
<% end %>
|
16
|
-
<% end %>
|
17
|
-
<% end %>
|
9
|
+
<%= pb_rails("list", props: { enable_drag: true, items: initial_items }) do %>
|
10
|
+
<% initial_items.each do |item| %>
|
11
|
+
<%= pb_rails("list/item", props:{drag_id: item[:id]}) do %><%= item[:name] %><% end %>
|
18
12
|
<% end %>
|
19
13
|
<% end %>
|
@@ -0,0 +1,5 @@
|
|
1
|
+
For a simplified version of the Draggable API for the List kit, you can do the following:
|
2
|
+
|
3
|
+
The List kit is optimized to work with the draggable kit. To enable drag, use the `enable_drag` prop on List kit with an array of the included items AND `drag_id` prop on ListItems. You will also need to include the `items` prop containing your array of listed items for the Draggable API.
|
4
|
+
|
5
|
+
An additional optional boolean prop (set to true by default) of `drag_handle` is also available on ListItem kit to show the drag handle icon.
|
@@ -0,0 +1,38 @@
|
|
1
|
+
<%= pb_rails("selectable_list",
|
2
|
+
props: {
|
3
|
+
enable_drag: true,
|
4
|
+
variant: "radio",
|
5
|
+
items: [
|
6
|
+
{ drag_id: "41",
|
7
|
+
text: "Task 1",
|
8
|
+
input_options: {
|
9
|
+
value: "1",
|
10
|
+
name: "radio-name",
|
11
|
+
}
|
12
|
+
},
|
13
|
+
{ drag_id: "42",
|
14
|
+
text: "Task 2",
|
15
|
+
checked: true,
|
16
|
+
input_options: {
|
17
|
+
value: "2",
|
18
|
+
name: "radio-name",
|
19
|
+
}
|
20
|
+
},
|
21
|
+
{ drag_id: "43",
|
22
|
+
text: "Task 3",
|
23
|
+
input_options: {
|
24
|
+
value: "3",
|
25
|
+
name: "radio-name",
|
26
|
+
}
|
27
|
+
},
|
28
|
+
{ drag_id: "44",
|
29
|
+
text: "Task 4",
|
30
|
+
input_options: {
|
31
|
+
value: "4",
|
32
|
+
name: "radio-name",
|
33
|
+
}
|
34
|
+
}
|
35
|
+
]
|
36
|
+
}
|
37
|
+
)
|
38
|
+
%>
|
@@ -0,0 +1,3 @@
|
|
1
|
+
For a simplified version of the Draggable API for the SelectableList kit, you can do the following:
|
2
|
+
|
3
|
+
The SelectableList kit is optimized to work with the draggable kit. To enable drag, use the `enable_drag` prop on SelectableList kit AND `drag_id` prop within the SelectableList kit prop. An additional optional boolean prop (set to true by default) of `drag_handle` is also available on SelectableList kit to show the drag handle icon.
|