playbook_ui 13.21.0.pre.alpha.PLAY12582474 → 13.21.0.pre.alpha.PLAY12652489
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_advanced_table/Components/CustomCell.tsx +19 -21
- data/app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx +3 -6
- data/app/pb_kits/playbook/pb_advanced_table/Components/SubRowHeaderRow.tsx +8 -12
- data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +9 -14
- data/app/pb_kits/playbook/pb_advanced_table/Components/ToggleIconButton.tsx +5 -9
- data/app/pb_kits/playbook/pb_advanced_table/README.md +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableBody.tsx +11 -15
- data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableHeader.tsx +8 -12
- data/app/pb_kits/playbook/pb_advanced_table/Utilities/ExpansionControlHelpers.tsx +37 -23
- data/app/pb_kits/playbook/pb_advanced_table/Utilities/types.ts +2 -0
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +9 -7
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +80 -83
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +61 -67
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_collapsible_trail.jsx +7 -7
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_default.jsx +7 -7
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expanded_control.jsx +7 -7
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_inline_row_loading.jsx +7 -7
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_inline_row_loading.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_loading.jsx +7 -7
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort.jsx +7 -7
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_control.jsx +7 -7
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_subrow_headers.jsx +7 -7
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_options.jsx +7 -7
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.jsx +7 -7
- data/app/pb_kits/playbook/pb_advanced_table/docs/_mock_data.js +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_mock_data_inline_loading.js +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_avatar/avatar.html.erb +1 -2
- data/app/pb_kits/playbook/pb_avatar_action_button/avatar_action_button.html.erb +1 -2
- data/app/pb_kits/playbook/pb_background/background.html.erb +1 -2
- data/app/pb_kits/playbook/pb_badge/badge.html.erb +1 -2
- data/app/pb_kits/playbook/pb_body/body.html.erb +1 -2
- data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumbs.scss +7 -0
- data/app/pb_kits/playbook/pb_bread_crumbs/bread_crumb_item.html.erb +1 -2
- data/app/pb_kits/playbook/pb_bread_crumbs/bread_crumbs.html.erb +1 -2
- data/app/pb_kits/playbook/pb_button/button.html.erb +1 -2
- data/app/pb_kits/playbook/pb_button/button.rb +3 -2
- data/app/pb_kits/playbook/pb_button_toolbar/button_toolbar.html.erb +1 -2
- data/app/pb_kits/playbook/pb_caption/caption.html.erb +1 -2
- data/app/pb_kits/playbook/pb_card/card.html.erb +1 -2
- data/app/pb_kits/playbook/pb_card/card_body.html.erb +1 -2
- data/app/pb_kits/playbook/pb_card/card_header.html.erb +1 -2
- data/app/pb_kits/playbook/pb_checkbox/checkbox.html.erb +1 -3
- data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.html.erb +1 -2
- data/app/pb_kits/playbook/pb_collapsible/collapsible.html.erb +1 -2
- data/app/pb_kits/playbook/pb_collapsible/collapsible_content.html.erb +1 -2
- data/app/pb_kits/playbook/pb_collapsible/collapsible_main.html.erb +1 -2
- data/app/pb_kits/playbook/pb_contact/contact.html.erb +1 -2
- data/app/pb_kits/playbook/pb_currency/currency.html.erb +1 -2
- data/app/pb_kits/playbook/pb_dashboard_value/dashboard_value.html.erb +1 -2
- data/app/pb_kits/playbook/pb_date/date.html.erb +1 -2
- data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +1 -2
- data/app/pb_kits/playbook/pb_date_range_inline/date_range_inline.html.erb +1 -2
- data/app/pb_kits/playbook/pb_date_range_stacked/date_range_stacked.html.erb +1 -2
- data/app/pb_kits/playbook/pb_date_stacked/date_stacked.html.erb +1 -2
- data/app/pb_kits/playbook/pb_date_time/date_time.html.erb +1 -2
- data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.html.erb +2 -3
- data/app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.html.erb +1 -2
- data/app/pb_kits/playbook/pb_detail/detail.html.erb +1 -2
- data/app/pb_kits/playbook/pb_dialog/dialog.html.erb +1 -2
- data/app/pb_kits/playbook/pb_dialog/dialog_body.html.erb +2 -3
- data/app/pb_kits/playbook/pb_dialog/dialog_footer.html.erb +1 -2
- data/app/pb_kits/playbook/pb_dialog/dialog_header.html.erb +2 -3
- data/app/pb_kits/playbook/pb_file_upload/file_upload.html.erb +1 -2
- data/app/pb_kits/playbook/pb_filter/filter.html.erb +1 -2
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.scss +3 -8
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.tsx +0 -1
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_multi_line.html.erb +1 -51
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_multi_line.jsx +11 -62
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_positions.html.erb +2 -7
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.html.erb +3 -4
- data/app/pb_kits/playbook/pb_flex/docs/_flex_spacing.html.erb +4 -0
- data/app/pb_kits/playbook/pb_flex/flex.html.erb +1 -2
- data/app/pb_kits/playbook/pb_flex/flex_item.html.erb +1 -2
- data/app/pb_kits/playbook/pb_form_group/form_group.html.erb +1 -2
- data/app/pb_kits/playbook/pb_form_pill/form_pill.html.erb +2 -2
- data/app/pb_kits/playbook/pb_hashtag/hashtag.html.erb +1 -2
- data/app/pb_kits/playbook/pb_highlight/highlight.html.erb +1 -2
- data/app/pb_kits/playbook/pb_home_address_street/home_address_street.html.erb +1 -2
- data/app/pb_kits/playbook/pb_icon/icon.html.erb +1 -2
- data/app/pb_kits/playbook/pb_icon_circle/icon_circle.html.erb +1 -2
- data/app/pb_kits/playbook/pb_icon_stat_value/icon_stat_value.html.erb +1 -2
- data/app/pb_kits/playbook/pb_icon_value/icon_value.html.erb +1 -2
- data/app/pb_kits/playbook/pb_image/image.html.erb +1 -2
- data/app/pb_kits/playbook/pb_label_pill/label_pill.html.erb +1 -2
- data/app/pb_kits/playbook/pb_label_value/label_value.html.erb +2 -3
- data/app/pb_kits/playbook/pb_layout/body.html.erb +1 -2
- data/app/pb_kits/playbook/pb_layout/footer.html.erb +1 -2
- data/app/pb_kits/playbook/pb_layout/header.html.erb +1 -2
- data/app/pb_kits/playbook/pb_layout/item.html.erb +1 -2
- data/app/pb_kits/playbook/pb_layout/layout.html.erb +1 -2
- data/app/pb_kits/playbook/pb_layout/sidebar.html.erb +1 -2
- data/app/pb_kits/playbook/pb_legend/legend.html.erb +1 -2
- data/app/pb_kits/playbook/pb_list/item.html.erb +1 -2
- data/app/pb_kits/playbook/pb_list/list.html.erb +1 -2
- data/app/pb_kits/playbook/pb_loading_inline/loading_inline.html.erb +1 -2
- data/app/pb_kits/playbook/pb_message/message.html.erb +1 -2
- data/app/pb_kits/playbook/pb_message/message_mention.html.erb +2 -3
- data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.html.erb +1 -2
- data/app/pb_kits/playbook/pb_multiple_users/multiple_users.html.erb +1 -2
- data/app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.html.erb +1 -2
- data/app/pb_kits/playbook/pb_nav/item.html.erb +2 -4
- data/app/pb_kits/playbook/pb_nav/nav.html.erb +1 -2
- data/app/pb_kits/playbook/pb_online_status/online_status.html.erb +1 -2
- data/app/pb_kits/playbook/pb_pagination/pagination.html.erb +1 -2
- data/app/pb_kits/playbook/pb_passphrase/passphrase.html.erb +1 -1
- data/app/pb_kits/playbook/pb_person/person.html.erb +1 -2
- data/app/pb_kits/playbook/pb_person_contact/person_contact.html.erb +1 -2
- data/app/pb_kits/playbook/pb_pill/pill.html.erb +1 -2
- data/app/pb_kits/playbook/pb_popover/popover.html.erb +1 -2
- data/app/pb_kits/playbook/pb_progress_pills/progress_pills.html.erb +1 -2
- data/app/pb_kits/playbook/pb_progress_simple/progress_simple.html.erb +1 -2
- data/app/pb_kits/playbook/pb_progress_step/progress_step.html.erb +1 -2
- data/app/pb_kits/playbook/pb_progress_step/progress_step_item.html.erb +1 -2
- data/app/pb_kits/playbook/pb_radio/radio.html.erb +1 -2
- data/app/pb_kits/playbook/pb_section_separator/section_separator.html.erb +1 -2
- data/app/pb_kits/playbook/pb_select/select.html.erb +1 -2
- data/app/pb_kits/playbook/pb_selectable_card/selectable_card.html.erb +1 -2
- data/app/pb_kits/playbook/pb_selectable_card_icon/selectable_card_icon.html.erb +1 -2
- data/app/pb_kits/playbook/pb_selectable_icon/selectable_icon.html.erb +1 -2
- data/app/pb_kits/playbook/pb_selectable_list/selectable_list.html.erb +1 -2
- data/app/pb_kits/playbook/pb_selectable_list/selectable_list_item.html.erb +1 -2
- data/app/pb_kits/playbook/pb_source/source.html.erb +1 -2
- data/app/pb_kits/playbook/pb_star_rating/star_rating.html.erb +1 -2
- data/app/pb_kits/playbook/pb_stat_change/stat_change.html.erb +1 -2
- data/app/pb_kits/playbook/pb_stat_value/stat_value.html.erb +1 -2
- data/app/pb_kits/playbook/pb_table/table.html.erb +2 -4
- data/app/pb_kits/playbook/pb_table/table_body.html.erb +3 -5
- data/app/pb_kits/playbook/pb_table/table_cell.html.erb +3 -5
- data/app/pb_kits/playbook/pb_table/table_head.html.erb +3 -5
- data/app/pb_kits/playbook/pb_table/table_header.html.erb +3 -5
- data/app/pb_kits/playbook/pb_table/table_row.html.erb +3 -5
- data/app/pb_kits/playbook/pb_text_input/text_input.html.erb +1 -2
- data/app/pb_kits/playbook/pb_textarea/textarea.html.erb +1 -2
- data/app/pb_kits/playbook/pb_time/time.html.erb +1 -2
- data/app/pb_kits/playbook/pb_time_range_inline/time_range_inline.html.erb +2 -3
- data/app/pb_kits/playbook/pb_time_stacked/time_stacked.html.erb +1 -2
- data/app/pb_kits/playbook/pb_timeline/item.html.erb +1 -2
- data/app/pb_kits/playbook/pb_timeline/timeline.html.erb +1 -2
- data/app/pb_kits/playbook/pb_timestamp/timestamp.html.erb +1 -2
- data/app/pb_kits/playbook/pb_title/title.html.erb +2 -3
- data/app/pb_kits/playbook/pb_title_count/title_count.html.erb +1 -2
- data/app/pb_kits/playbook/pb_title_detail/title_detail.html.erb +1 -2
- data/app/pb_kits/playbook/pb_toggle/toggle.html.erb +1 -2
- data/app/pb_kits/playbook/pb_tooltip/tooltip.html.erb +1 -2
- data/app/pb_kits/playbook/pb_typeahead/typeahead.html.erb +1 -2
- data/app/pb_kits/playbook/pb_user/user.html.erb +1 -2
- data/app/pb_kits/playbook/pb_user_badge/user_badge.html.erb +1 -2
- data/app/pb_kits/playbook/pb_weekday_stacked/weekday_stacked.html.erb +1 -2
- data/dist/playbook-rails.js +3 -3
- data/lib/playbook/kit_base.rb +0 -18
- data/lib/playbook/version.rb +1 -1
- metadata +15 -24
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.html.erb +0 -14
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.rb +0 -19
- data/app/pb_kits/playbook/pb_advanced_table/scss_partials/_chrome_styles.scss +0 -13
- data/app/pb_kits/playbook/pb_advanced_table/table_body.html.erb +0 -9
- data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +0 -30
- data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +0 -20
- data/app/pb_kits/playbook/pb_advanced_table/table_header.rb +0 -21
- data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +0 -37
- data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +0 -32
data/lib/playbook/kit_base.rb
CHANGED
@@ -67,28 +67,10 @@ module Playbook
|
|
67
67
|
prop :id
|
68
68
|
prop :data, type: Playbook::Props::HashProp, default: {}
|
69
69
|
prop :aria, type: Playbook::Props::HashProp, default: {}
|
70
|
-
prop :html_options, type: Playbook::Props::HashProp, default: {}
|
71
70
|
prop :children, type: Playbook::Props::Proc
|
72
71
|
|
73
72
|
def object
|
74
73
|
self
|
75
74
|
end
|
76
|
-
|
77
|
-
def combined_html_options
|
78
|
-
default_html_options.merge(html_options.deep_merge(data_attributes))
|
79
|
-
end
|
80
|
-
|
81
|
-
private
|
82
|
-
|
83
|
-
def default_html_options
|
84
|
-
{}
|
85
|
-
end
|
86
|
-
|
87
|
-
def data_attributes
|
88
|
-
{
|
89
|
-
data: data,
|
90
|
-
aria: aria,
|
91
|
-
}.transform_keys { |key| key.to_s.gsub("_", "-") }
|
92
|
-
end
|
93
75
|
end
|
94
76
|
end
|
data/lib/playbook/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: playbook_ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 13.21.0.pre.alpha.
|
4
|
+
version: 13.21.0.pre.alpha.PLAY12652489
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Power UX
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-03-
|
12
|
+
date: 2024-03-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|
@@ -17,42 +17,42 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version:
|
20
|
+
version: 5.2.4.5
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version:
|
27
|
+
version: 5.2.4.5
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: actionview
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
32
|
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version:
|
34
|
+
version: 5.2.4.5
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version:
|
41
|
+
version: 5.2.4.5
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: activesupport
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
46
|
- - ">="
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version:
|
48
|
+
version: 5.2.4.5
|
49
49
|
type: :runtime
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
53
|
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version:
|
55
|
+
version: 5.2.4.5
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: react-rails
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -101,14 +101,14 @@ dependencies:
|
|
101
101
|
requirements:
|
102
102
|
- - '='
|
103
103
|
- !ruby/object:Gem::Version
|
104
|
-
version: 11.
|
104
|
+
version: 11.0.0
|
105
105
|
type: :development
|
106
106
|
prerelease: false
|
107
107
|
version_requirements: !ruby/object:Gem::Requirement
|
108
108
|
requirements:
|
109
109
|
- - '='
|
110
110
|
- !ruby/object:Gem::Version
|
111
|
-
version: 11.
|
111
|
+
version: 11.0.0
|
112
112
|
- !ruby/object:Gem::Dependency
|
113
113
|
name: github_changelog_generator
|
114
114
|
requirement: !ruby/object:Gem::Requirement
|
@@ -129,14 +129,14 @@ dependencies:
|
|
129
129
|
requirements:
|
130
130
|
- - ">="
|
131
131
|
- !ruby/object:Gem::Version
|
132
|
-
version:
|
132
|
+
version: 5.2.4.5
|
133
133
|
type: :development
|
134
134
|
prerelease: false
|
135
135
|
version_requirements: !ruby/object:Gem::Requirement
|
136
136
|
requirements:
|
137
137
|
- - ">="
|
138
138
|
- !ruby/object:Gem::Version
|
139
|
-
version:
|
139
|
+
version: 5.2.4.5
|
140
140
|
- !ruby/object:Gem::Dependency
|
141
141
|
name: rspec-html-matchers
|
142
142
|
requirement: !ruby/object:Gem::Requirement
|
@@ -286,8 +286,6 @@ files:
|
|
286
286
|
- app/pb_kits/playbook/pb_advanced_table/Utilities/types.ts
|
287
287
|
- app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss
|
288
288
|
- app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx
|
289
|
-
- app/pb_kits/playbook/pb_advanced_table/advanced_table.html.erb
|
290
|
-
- app/pb_kits/playbook/pb_advanced_table/advanced_table.rb
|
291
289
|
- app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx
|
292
290
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_collapsible_trail.jsx
|
293
291
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_collapsible_trail.md
|
@@ -314,15 +312,8 @@ files:
|
|
314
312
|
- app/pb_kits/playbook/pb_advanced_table/docs/_mock_data_inline_loading.js
|
315
313
|
- app/pb_kits/playbook/pb_advanced_table/docs/example.yml
|
316
314
|
- app/pb_kits/playbook/pb_advanced_table/docs/index.js
|
317
|
-
- app/pb_kits/playbook/pb_advanced_table/scss_partials/_chrome_styles.scss
|
318
315
|
- app/pb_kits/playbook/pb_advanced_table/scss_partials/_loading.scss
|
319
316
|
- app/pb_kits/playbook/pb_advanced_table/scss_partials/_pseudo_states.scss
|
320
|
-
- app/pb_kits/playbook/pb_advanced_table/table_body.html.erb
|
321
|
-
- app/pb_kits/playbook/pb_advanced_table/table_body.rb
|
322
|
-
- app/pb_kits/playbook/pb_advanced_table/table_header.html.erb
|
323
|
-
- app/pb_kits/playbook/pb_advanced_table/table_header.rb
|
324
|
-
- app/pb_kits/playbook/pb_advanced_table/table_row.html.erb
|
325
|
-
- app/pb_kits/playbook/pb_advanced_table/table_row.rb
|
326
317
|
- app/pb_kits/playbook/pb_avatar/_avatar.scss
|
327
318
|
- app/pb_kits/playbook/pb_avatar/_avatar.tsx
|
328
319
|
- app/pb_kits/playbook/pb_avatar/avatar.html.erb
|
@@ -2894,11 +2885,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
2894
2885
|
version: '0'
|
2895
2886
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
2896
2887
|
requirements:
|
2897
|
-
- - "
|
2888
|
+
- - ">"
|
2898
2889
|
- !ruby/object:Gem::Version
|
2899
|
-
version:
|
2890
|
+
version: 1.3.1
|
2900
2891
|
requirements: []
|
2901
|
-
rubygems_version: 3.
|
2892
|
+
rubygems_version: 3.3.7
|
2902
2893
|
signing_key:
|
2903
2894
|
specification_version: 4
|
2904
2895
|
summary: Playbook Design System
|
@@ -1,14 +0,0 @@
|
|
1
|
-
<%= content_tag(:div,
|
2
|
-
aria: object.aria,
|
3
|
-
class: object.classname,
|
4
|
-
data: object.data,
|
5
|
-
id: object.id) do %>
|
6
|
-
<%= pb_rails("table", props: { size: "sm", tag:"div", data_table: true, number_spacing:"tabular", responsive:"none" }) do %>
|
7
|
-
<% if content.present? %>
|
8
|
-
<% content.presence %>
|
9
|
-
<% else %>
|
10
|
-
<%= pb_rails("advanced_table/table_header", props: {column_definitions: object.column_definitions, enable_toggle_expansion: object.enable_toggle_expansion }) %>
|
11
|
-
<%= pb_rails("advanced_table/table_body", props: {table_data: object.table_data, column_definitions: object.column_definitions}) %>
|
12
|
-
<% end %>
|
13
|
-
<% end %>
|
14
|
-
<% end %>
|
@@ -1,19 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Playbook
|
4
|
-
module PbAdvancedTable
|
5
|
-
class AdvancedTable < Playbook::KitBase
|
6
|
-
prop :table_data, type: Playbook::Props::Array,
|
7
|
-
default: []
|
8
|
-
prop :column_definitions, type: Playbook::Props::Array,
|
9
|
-
default: []
|
10
|
-
prop :enable_toggle_expansion, type: Playbook::Props::Enum,
|
11
|
-
values: %w[all header none],
|
12
|
-
default: "header"
|
13
|
-
|
14
|
-
def classname
|
15
|
-
generate_classname("pb_advanced_table")
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Playbook
|
4
|
-
module PbAdvancedTable
|
5
|
-
class TableBody < Playbook::KitBase
|
6
|
-
prop :table_data, type: Playbook::Props::Array,
|
7
|
-
default: []
|
8
|
-
prop :column_definitions, type: Playbook::Props::Array,
|
9
|
-
default: []
|
10
|
-
|
11
|
-
def render_row_and_children(row, column_definitions, current_depth = 0)
|
12
|
-
output = ActiveSupport::SafeBuffer.new
|
13
|
-
|
14
|
-
output << pb_rails("advanced_table/table_row", props: { row: row, column_definitions: column_definitions, depth: current_depth })
|
15
|
-
|
16
|
-
if row[:children].present?
|
17
|
-
row[:children].each do |child_row|
|
18
|
-
output << render_row_and_children(child_row, column_definitions, current_depth + 1)
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
output
|
23
|
-
end
|
24
|
-
|
25
|
-
def classname
|
26
|
-
generate_classname("pb_advanced_table_body", "pb_table_tbody", separator: " ")
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
<%= content_tag(:div,
|
2
|
-
aria: object.aria,
|
3
|
-
class: object.classname,
|
4
|
-
data: object.data,
|
5
|
-
id: object.id) do %>
|
6
|
-
<%= pb_rails("table/table_row", props: {tag:"div"}) do %>
|
7
|
-
<% object.column_definitions.each_with_index do |item, index| %>
|
8
|
-
<%= pb_rails("table/table_header", props: { tag:"div", id:item[:accessor], classname:object.th_classname}) do %>
|
9
|
-
<%= pb_rails("flex", props:{ align: "center", justify: index.zero? ? "start" : "end", text_align:"end" }) do %>
|
10
|
-
<% if index.zero? && (object.enable_toggle_expansion == "header" || object.enable_toggle_expansion == "all") %>
|
11
|
-
<button class="gray-icon toggle-all-icon">
|
12
|
-
<%= pb_rails("icon", props: { icon: "arrows-from-line", cursor: "pointer", fixed_width: true, padding_right:"xs" }) %>
|
13
|
-
</button>
|
14
|
-
<% end %>
|
15
|
-
<%= item[:label] %>
|
16
|
-
<% end %>
|
17
|
-
<% end %>
|
18
|
-
<% end %>
|
19
|
-
<% end %>
|
20
|
-
<% end %>
|
@@ -1,21 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Playbook
|
4
|
-
module PbAdvancedTable
|
5
|
-
class TableHeader < Playbook::KitBase
|
6
|
-
prop :column_definitions, type: Playbook::Props::Array,
|
7
|
-
default: []
|
8
|
-
prop :enable_toggle_expansion, type: Playbook::Props::Enum,
|
9
|
-
values: %w[all header none],
|
10
|
-
default: "header"
|
11
|
-
|
12
|
-
def classname
|
13
|
-
generate_classname("pb_advanced_table_header", "pb_table_thead", separator: " ")
|
14
|
-
end
|
15
|
-
|
16
|
-
def th_classname
|
17
|
-
generate_classname("table-header-cells", separator: " ")
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
<%= content_tag(:div,
|
2
|
-
aria: object.aria,
|
3
|
-
class: object.classname,
|
4
|
-
data: object.data,
|
5
|
-
id: object.id) do %>
|
6
|
-
<% object.column_definitions.each_with_index do |column, index| %>
|
7
|
-
<%= pb_rails("table/table_cell", props: { tag:"div", classname:object.td_classname}) do %>
|
8
|
-
<%= pb_rails("flex", props:{ align: "center", justify: index.zero? ? "start" : "end" }) do %>
|
9
|
-
<div style="padding-left: <%= depth * 1.25 %>em">
|
10
|
-
<%= pb_rails("flex", props:{align: "center", column_gap: "xs"}) do %>
|
11
|
-
<% if index.zero? && object.row[:children].present? %>
|
12
|
-
<button class="gray-icon expand-toggle-icon">
|
13
|
-
<%= pb_rails("icon", props: { icon: "circle-play", cursor: "pointer" }) %>
|
14
|
-
</button>
|
15
|
-
<% end %>
|
16
|
-
<%= pb_rails("flex/flex_item", props:{padding_left: index.zero? && object.row[:children].present? ? "none" : "xs"}) do %>
|
17
|
-
<% if index.zero? %>
|
18
|
-
<% if object.depth.zero? %>
|
19
|
-
<%= object.row[column[:accessor].to_sym] %>
|
20
|
-
<% else %>
|
21
|
-
<% object.depth_accessors.each_with_index do |item, accessor_index| %>
|
22
|
-
<% if object.depth - 1 == accessor_index %>
|
23
|
-
<% key = item.to_sym %>
|
24
|
-
<%= object.row[key] %>
|
25
|
-
<% end %>
|
26
|
-
<% end %>
|
27
|
-
<% end %>
|
28
|
-
<% else %>
|
29
|
-
<%= object.row[column[:accessor].to_sym] %>
|
30
|
-
<% end %>
|
31
|
-
<% end %>
|
32
|
-
<% end %>
|
33
|
-
</div>
|
34
|
-
<% end %>
|
35
|
-
<% end %>
|
36
|
-
<% end %>
|
37
|
-
<% end %>
|
@@ -1,32 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Playbook
|
4
|
-
module PbAdvancedTable
|
5
|
-
class TableRow < Playbook::KitBase
|
6
|
-
prop :column_definitions, type: Playbook::Props::Array,
|
7
|
-
default: []
|
8
|
-
prop :row
|
9
|
-
prop :depth
|
10
|
-
|
11
|
-
def classname
|
12
|
-
generate_classname("pb_table_tr", "bg-white", subrow_depth_classname, separator: " ")
|
13
|
-
end
|
14
|
-
|
15
|
-
def td_classname
|
16
|
-
generate_classname("id-cell", "chrome-styles", separator: " ")
|
17
|
-
end
|
18
|
-
|
19
|
-
def depth_accessors
|
20
|
-
column_definitions.flat_map do |column|
|
21
|
-
column[:cellAccessors] if column.key?(:cellAccessors)
|
22
|
-
end.compact
|
23
|
-
end
|
24
|
-
|
25
|
-
private
|
26
|
-
|
27
|
-
def subrow_depth_classname
|
28
|
-
depth.positive? ? "depth-sub-row-#{depth}" : ""
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|