playbook_ui 15.6.0.pre.alpha.play266913088 → 15.6.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/pb_advanced_table/Components/RegularTableView.tsx +2 -3
- data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +0 -4
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +0 -95
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_control_rails.html.erb +5 -11
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_control_rails.md +1 -7
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.html.erb +163 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.jsx +190 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +1 -4
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +1 -3
- data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/table_header.rb +0 -57
- data/app/pb_kits/playbook/pb_background/_background.tsx +6 -6
- data/app/pb_kits/playbook/pb_background/background.test.js +1 -5
- data/app/pb_kits/playbook/pb_background/docs/_background_light.html.erb +1 -1
- data/app/pb_kits/playbook/pb_background/docs/_background_light.jsx +1 -0
- data/app/pb_kits/playbook/pb_background/docs/example.yml +2 -2
- data/app/pb_kits/playbook/pb_card/docs/_card_header.md +1 -1
- data/app/pb_kits/playbook/pb_card/docs/_card_highlight.md +1 -1
- data/app/pb_kits/playbook/pb_collapsible/__snapshots__/collapsible.test.js.snap +2 -2
- data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleIcon.tsx +8 -10
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_icons.jsx +1 -0
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_state.jsx +3 -0
- data/app/pb_kits/playbook/pb_contact/_contact.tsx +24 -51
- data/app/pb_kits/playbook/pb_contact/contact.html.erb +19 -53
- data/app/pb_kits/playbook/pb_contact/contact.rb +1 -11
- data/app/pb_kits/playbook/pb_contact/contact.test.js +0 -76
- data/app/pb_kits/playbook/pb_contact/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_contact/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_date_picker/date_picker.test.js +0 -24
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +7 -197
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern_rails.html.erb +14 -23
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern_rails.md +1 -1
- data/app/pb_kits/playbook/pb_dialog/_dialog.tsx +1 -2
- data/app/pb_kits/playbook/pb_dialog/dialog.html.erb +1 -1
- data/app/pb_kits/playbook/pb_dialog/dialog.rb +0 -1
- data/app/pb_kits/playbook/pb_dialog/dialog.test.jsx +0 -14
- data/app/pb_kits/playbook/pb_dialog/dialog_header.html.erb +4 -5
- data/app/pb_kits/playbook/pb_dialog/dialog_header.rb +0 -2
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_compound_components.html.erb +0 -31
- data/app/pb_kits/playbook/pb_dialog/docs/example.yml +0 -4
- data/app/pb_kits/playbook/pb_dialog/docs/index.js +1 -3
- data/app/pb_kits/playbook/pb_distribution_bar/docs/_distribution_bar_custom_colors.md +1 -1
- data/app/pb_kits/playbook/pb_draggable/context/index.tsx +7 -458
- data/app/pb_kits/playbook/pb_draggable/context/types.ts +3 -8
- data/app/pb_kits/playbook/pb_draggable/docs/example.yml +2 -3
- data/app/pb_kits/playbook/pb_draggable/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_draggable/draggable.test.jsx +1 -77
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default_rails.html.erb +5 -7
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display_rails.html.erb +1 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +0 -5
- data/app/pb_kits/playbook/pb_dropdown/dropdown.html.erb +0 -4
- data/app/pb_kits/playbook/pb_dropdown/dropdown.rb +5 -39
- data/app/pb_kits/playbook/pb_dropdown/index.js +3 -171
- data/app/pb_kits/playbook/pb_file_upload/_file_upload.scss +4 -4
- data/app/pb_kits/playbook/pb_filter/Filter/FilterBackground.tsx +3 -3
- data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.tsx +22 -34
- data/app/pb_kits/playbook/pb_home_address_street/city_emphasis.html.erb +12 -16
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_default.html.erb +1 -1
- data/app/pb_kits/playbook/pb_home_address_street/none_emphasis.html.erb +12 -16
- data/app/pb_kits/playbook/pb_home_address_street/street_emphasis.html.erb +12 -16
- data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.scss +0 -10
- data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.tsx +15 -66
- data/app/pb_kits/playbook/pb_multiple_users/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_multiple_users/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_multiple_users/multiple_users.test.js +0 -25
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +10 -44
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_validation.html.erb +4 -34
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_validation.jsx +7 -16
- data/app/pb_kits/playbook/pb_radio/docs/_radio_error.md +1 -1
- data/app/pb_kits/playbook/pb_select/_select.tsx +3 -8
- data/app/pb_kits/playbook/pb_select/docs/_select_error.md +1 -1
- data/app/pb_kits/playbook/pb_select/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_select/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_select/select.html.erb +2 -2
- data/app/pb_kits/playbook/pb_select/select.rb +1 -3
- data/app/pb_kits/playbook/pb_select/select.test.js +0 -23
- data/app/pb_kits/playbook/pb_table/_table.tsx +33 -187
- data/app/pb_kits/playbook/pb_table/docs/example.yml +0 -4
- data/app/pb_kits/playbook/pb_table/docs/index.js +0 -2
- data/app/pb_kits/playbook/pb_table/table.html.erb +12 -68
- data/app/pb_kits/playbook/pb_table/table.rb +3 -22
- data/app/pb_kits/playbook/pb_table/table.test.js +0 -143
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_error.md +1 -1
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_error.md +1 -1
- data/app/pb_kits/playbook/pb_timeline/_item.tsx +0 -3
- data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_date.md +1 -1
- data/app/pb_kits/playbook/pb_timeline/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_timeline/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_timeline/item.html.erb +1 -1
- data/app/pb_kits/playbook/pb_timeline/item.rb +0 -2
- data/app/pb_kits/playbook/pb_timeline/label.html.erb +1 -2
- data/app/pb_kits/playbook/pb_timeline/label.rb +0 -2
- data/app/pb_kits/playbook/pb_timeline/subcomponents/Label.tsx +0 -3
- data/app/pb_kits/playbook/pb_timeline/timeline.test.js +0 -51
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.test.jsx +0 -15
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +0 -3
- data/app/pb_kits/playbook/pb_typeahead/components/ClearIndicator.tsx +2 -13
- data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.tsx +1 -6
- data/app/pb_kits/playbook/pb_typeahead/components/ValueContainer.tsx +7 -34
- data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_typeahead/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +1 -6
- data/app/pb_kits/playbook/tokens/_colors.scss +1 -2
- data/dist/chunks/_typeahead-kRdz5zPn.js +6 -0
- data/dist/chunks/lib-CgpqUb6l.js +29 -0
- data/dist/chunks/vendor.js +3 -3
- data/dist/menu.yml +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/collection_select_field.rb +1 -9
- data/lib/playbook/forms/builder/select_field.rb +1 -9
- data/lib/playbook/forms/builder/time_zone_select_field.rb +1 -9
- data/lib/playbook/pb_kit_helper.rb +0 -35
- data/lib/playbook/version.rb +2 -2
- metadata +4 -54
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_colors_rails.html.erb +0 -43
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_colors_rails.md +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background.jsx +0 -54
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background.md +0 -9
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background_multi.jsx +0 -80
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background_multi.md +0 -3
- data/app/pb_kits/playbook/pb_background/docs/_background_light.md +0 -1
- data/app/pb_kits/playbook/pb_contact/docs/_contact_unstyled.html.erb +0 -33
- data/app/pb_kits/playbook/pb_contact/docs/_contact_unstyled.jsx +0 -46
- data/app/pb_kits/playbook/pb_contact/docs/_contact_unstyled_rails.md +0 -2
- data/app/pb_kits/playbook/pb_contact/docs/_contact_unstyled_react.md +0 -2
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_closeable.html.erb +0 -24
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_closeable.jsx +0 -60
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_closeable.md +0 -3
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_overflow_visible.html.erb +0 -71
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_overflow_visible.jsx +0 -57
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_overflow_visible_rails.md +0 -1
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_overflow_visible_react.md +0 -1
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_dropzone.jsx +0 -180
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_dropzone.md +0 -22
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_default_dates.html.erb +0 -19
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_rails.html.erb +0 -12
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_rails.md +0 -26
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_range_end_rails.html.erb +0 -19
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_range_end_rails.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_with_date_pickers_default_rails.html.erb +0 -30
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_with_date_pickers_default_rails.md +0 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_with_date_pickers_rails.html.erb +0 -29
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_with_date_pickers_rails.md +0 -13
- data/app/pb_kits/playbook/pb_dropdown/quickpick_helper.rb +0 -75
- data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_with_tooltip.jsx +0 -42
- data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_with_tooltip.md +0 -1
- data/app/pb_kits/playbook/pb_select/docs/_select_input_options.html.erb +0 -16
- data/app/pb_kits/playbook/pb_select/docs/_select_input_options.jsx +0 -30
- data/app/pb_kits/playbook/pb_select/docs/_select_input_options.md +0 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant.jsx +0 -134
- data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant.md +0 -34
- data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_rails.html.erb +0 -101
- data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_rails.md +0 -33
- data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_with_pagination.jsx +0 -180
- data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_with_pagination.md +0 -3
- data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_with_pagination_rails.html.erb +0 -122
- data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_with_pagination_rails.md +0 -3
- data/app/pb_kits/playbook/pb_timeline/docs/_timeline_show_current_year.html.erb +0 -60
- data/app/pb_kits/playbook/pb_timeline/docs/_timeline_show_current_year.jsx +0 -118
- data/app/pb_kits/playbook/pb_timeline/docs/_timeline_show_current_year.md +0 -1
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_input_display.html.erb +0 -30
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_input_display.jsx +0 -37
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_input_display.md +0 -3
- data/app/pb_kits/playbook/utilities/deprecated.ts +0 -73
- data/dist/chunks/_typeahead-CbjBmIDu.js +0 -6
- data/dist/chunks/lib-DxDBrGZX.js +0 -29
|
@@ -10,11 +10,6 @@ import {
|
|
|
10
10
|
TableCell,
|
|
11
11
|
} from "./subcomponents";
|
|
12
12
|
import { addDataTitle } from './utilities/addDataTitle'
|
|
13
|
-
import Card from '../pb_card/_card'
|
|
14
|
-
import Flex from '../pb_flex/_flex'
|
|
15
|
-
import Title from '../pb_title/_title'
|
|
16
|
-
import SectionSeparator from '../pb_section_separator/_section_separator'
|
|
17
|
-
import Filter from '../pb_filter/_filter'
|
|
18
13
|
|
|
19
14
|
type TableProps = {
|
|
20
15
|
aria?: { [key: string]: string },
|
|
@@ -26,13 +21,10 @@ type TableProps = {
|
|
|
26
21
|
data?: { [key: string]: string },
|
|
27
22
|
dataTable: boolean,
|
|
28
23
|
disableHover?: boolean,
|
|
29
|
-
filterProps?: { [key: string]: any },
|
|
30
|
-
filterContent?: any,
|
|
31
24
|
headerStyle?: "default" | "borderless" | "floating"
|
|
32
25
|
htmlOptions?: { [key: string]: string | number | boolean | (() => void) },
|
|
33
26
|
id?: string,
|
|
34
27
|
outerPadding?: "none" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl",
|
|
35
|
-
pagination?: React.ReactElement,
|
|
36
28
|
responsive?: "collapse" | "scroll" | "none",
|
|
37
29
|
singleLine?: boolean,
|
|
38
30
|
size?: "sm" | "md" | "lg",
|
|
@@ -41,32 +33,24 @@ type TableProps = {
|
|
|
41
33
|
stickyRightColumn?: string[],
|
|
42
34
|
striped?: boolean,
|
|
43
35
|
tag?: "table" | "div",
|
|
44
|
-
title?: string,
|
|
45
|
-
variant?: "default" | "withFilter",
|
|
46
36
|
verticalBorder?: boolean,
|
|
47
37
|
} & GlobalProps
|
|
48
38
|
|
|
49
|
-
type AllSizes = "none" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "auto" | "initial" | "inherit"
|
|
50
|
-
|
|
51
39
|
const Table = (props: TableProps): React.ReactElement => {
|
|
52
40
|
const {
|
|
53
41
|
aria = {},
|
|
54
|
-
variant = 'default',
|
|
55
42
|
children,
|
|
56
43
|
className,
|
|
57
|
-
collapse =
|
|
44
|
+
collapse = 'sm',
|
|
58
45
|
container = true,
|
|
59
46
|
dark,
|
|
60
47
|
data = {},
|
|
61
48
|
dataTable = false,
|
|
62
49
|
disableHover = false,
|
|
63
|
-
filterProps = {},
|
|
64
|
-
filterContent,
|
|
65
50
|
headerStyle = "default",
|
|
66
51
|
htmlOptions = {},
|
|
67
52
|
id,
|
|
68
53
|
outerPadding = '',
|
|
69
|
-
pagination,
|
|
70
54
|
responsive = 'collapse',
|
|
71
55
|
singleLine = false,
|
|
72
56
|
size = 'sm',
|
|
@@ -75,7 +59,6 @@ const Table = (props: TableProps): React.ReactElement => {
|
|
|
75
59
|
stickyRightColumn= [],
|
|
76
60
|
striped = false,
|
|
77
61
|
tag = 'table',
|
|
78
|
-
title,
|
|
79
62
|
verticalBorder = false,
|
|
80
63
|
} = props
|
|
81
64
|
|
|
@@ -90,15 +73,12 @@ const Table = (props: TableProps): React.ReactElement => {
|
|
|
90
73
|
const dynamicInlineProps = globalInlineProps(props)
|
|
91
74
|
const stickyRightColumnReversed = stickyRightColumn.reverse()
|
|
92
75
|
|
|
93
|
-
const isFilterVariant = variant === 'withFilter'
|
|
94
|
-
const effectiveContainer = isFilterVariant ? false : container
|
|
95
|
-
|
|
96
76
|
const classNames = classnames(
|
|
97
77
|
'pb_table',
|
|
98
78
|
`table-${size}`,
|
|
99
79
|
`table-responsive-${responsive}`,
|
|
100
80
|
{
|
|
101
|
-
'table-card':
|
|
81
|
+
'table-card': container,
|
|
102
82
|
'table-dark': dark,
|
|
103
83
|
'data_table': dataTable,
|
|
104
84
|
'single-line': singleLine,
|
|
@@ -225,70 +205,36 @@ const Table = (props: TableProps): React.ReactElement => {
|
|
|
225
205
|
addDataTitle()
|
|
226
206
|
}, [])
|
|
227
207
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
</div>
|
|
256
|
-
) : (
|
|
257
|
-
isTableTag ? (
|
|
258
|
-
<table
|
|
259
|
-
{...ariaProps}
|
|
260
|
-
{...dataProps}
|
|
261
|
-
{...htmlProps}
|
|
262
|
-
className={classNames}
|
|
263
|
-
id={id}
|
|
264
|
-
style={dynamicInlineProps}
|
|
265
|
-
>
|
|
266
|
-
{children}
|
|
267
|
-
</table>
|
|
268
|
-
) : (
|
|
269
|
-
<div
|
|
270
|
-
{...ariaProps}
|
|
271
|
-
{...dataProps}
|
|
272
|
-
{...htmlProps}
|
|
273
|
-
className={classNames}
|
|
274
|
-
id={id}
|
|
275
|
-
style={dynamicInlineProps}
|
|
276
|
-
>
|
|
277
|
-
{children}
|
|
208
|
+
return (
|
|
209
|
+
<>
|
|
210
|
+
{responsive === 'scroll' ? (
|
|
211
|
+
<div className='table-responsive-scroll'>
|
|
212
|
+
{isTableTag ? (
|
|
213
|
+
<table
|
|
214
|
+
{...ariaProps}
|
|
215
|
+
{...dataProps}
|
|
216
|
+
{...htmlProps}
|
|
217
|
+
className={classNames}
|
|
218
|
+
id={id}
|
|
219
|
+
style={dynamicInlineProps}
|
|
220
|
+
>
|
|
221
|
+
{children}
|
|
222
|
+
</table>
|
|
223
|
+
) : (
|
|
224
|
+
<div
|
|
225
|
+
{...ariaProps}
|
|
226
|
+
{...dataProps}
|
|
227
|
+
{...htmlProps}
|
|
228
|
+
className={classNames}
|
|
229
|
+
id={id}
|
|
230
|
+
style={dynamicInlineProps}
|
|
231
|
+
>
|
|
232
|
+
{children}
|
|
233
|
+
</div>
|
|
234
|
+
)}
|
|
278
235
|
</div>
|
|
279
|
-
)
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
return tableElement
|
|
283
|
-
}
|
|
284
|
-
// ------------ End Default Table (non-filter variant rendering) ------------
|
|
285
|
-
|
|
286
|
-
// ------------ variant = 'withFilter' rendering ------------
|
|
287
|
-
const renderCardVariant = () => {
|
|
288
|
-
// Render table element
|
|
289
|
-
const tableElement = responsive === 'scroll' ? (
|
|
290
|
-
<div className='table-responsive-scroll'>
|
|
291
|
-
{isTableTag ? (
|
|
236
|
+
) : (
|
|
237
|
+
isTableTag ? (
|
|
292
238
|
<table
|
|
293
239
|
{...ariaProps}
|
|
294
240
|
{...dataProps}
|
|
@@ -310,108 +256,8 @@ const Table = (props: TableProps): React.ReactElement => {
|
|
|
310
256
|
>
|
|
311
257
|
{children}
|
|
312
258
|
</div>
|
|
313
|
-
)
|
|
314
|
-
|
|
315
|
-
) : (
|
|
316
|
-
isTableTag ? (
|
|
317
|
-
<table
|
|
318
|
-
{...ariaProps}
|
|
319
|
-
{...dataProps}
|
|
320
|
-
{...htmlProps}
|
|
321
|
-
className={classNames}
|
|
322
|
-
id={id}
|
|
323
|
-
style={dynamicInlineProps}
|
|
324
|
-
>
|
|
325
|
-
{children}
|
|
326
|
-
</table>
|
|
327
|
-
) : (
|
|
328
|
-
<div
|
|
329
|
-
{...ariaProps}
|
|
330
|
-
{...dataProps}
|
|
331
|
-
{...htmlProps}
|
|
332
|
-
className={classNames}
|
|
333
|
-
id={id}
|
|
334
|
-
style={dynamicInlineProps}
|
|
335
|
-
>
|
|
336
|
-
{children}
|
|
337
|
-
</div>
|
|
338
|
-
)
|
|
339
|
-
)
|
|
340
|
-
|
|
341
|
-
// Default filter props that CAN be overridden (All props from Filter kit CAN be used, but these are the ones we set as defaults)
|
|
342
|
-
const defaultFilterProps = {
|
|
343
|
-
background: false,
|
|
344
|
-
maxHeight: "50vh",
|
|
345
|
-
minWidth: "xs",
|
|
346
|
-
popoverProps: { width: "350px" },
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
// Merge default props with user-provided props (user props override defaults)
|
|
350
|
-
const mergedFilterProps = { ...defaultFilterProps, ...filterProps }
|
|
351
|
-
|
|
352
|
-
return (
|
|
353
|
-
<>
|
|
354
|
-
{title && (
|
|
355
|
-
<Title
|
|
356
|
-
paddingLeft={{
|
|
357
|
-
xs: "sm",
|
|
358
|
-
sm: "sm",
|
|
359
|
-
md: "xl",
|
|
360
|
-
lg: "xl",
|
|
361
|
-
xl: "xl",
|
|
362
|
-
default: "xl",
|
|
363
|
-
} as any}
|
|
364
|
-
paddingY="md"
|
|
365
|
-
size={3}
|
|
366
|
-
text={title}
|
|
367
|
-
/>
|
|
368
|
-
)}
|
|
369
|
-
<Card
|
|
370
|
-
marginX={{
|
|
371
|
-
xs: "sm",
|
|
372
|
-
sm: "sm",
|
|
373
|
-
md: "xl",
|
|
374
|
-
lg: "xl",
|
|
375
|
-
xl: "xl",
|
|
376
|
-
default: "xl",
|
|
377
|
-
} as any}
|
|
378
|
-
padding="none"
|
|
379
|
-
>
|
|
380
|
-
<Flex
|
|
381
|
-
align="stretch"
|
|
382
|
-
flexDirection="column"
|
|
383
|
-
gap="none"
|
|
384
|
-
>
|
|
385
|
-
{filterContent && (
|
|
386
|
-
<Filter {...mergedFilterProps}>
|
|
387
|
-
{filterContent}
|
|
388
|
-
</Filter>
|
|
389
|
-
)}
|
|
390
|
-
{filterContent && <SectionSeparator />}
|
|
391
|
-
{pagination && (
|
|
392
|
-
<>
|
|
393
|
-
{pagination}
|
|
394
|
-
<SectionSeparator />
|
|
395
|
-
</>
|
|
396
|
-
)}
|
|
397
|
-
{tableElement}
|
|
398
|
-
{pagination && (
|
|
399
|
-
<>
|
|
400
|
-
{pagination}
|
|
401
|
-
</>
|
|
402
|
-
)}
|
|
403
|
-
</Flex>
|
|
404
|
-
</Card>
|
|
405
|
-
</>
|
|
406
|
-
)
|
|
407
|
-
}
|
|
408
|
-
// ------------ End variant = 'withFilter' rendering ------------
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
return (
|
|
413
|
-
<>
|
|
414
|
-
{isFilterVariant ? renderCardVariant() : renderTable()}
|
|
259
|
+
)
|
|
260
|
+
)}
|
|
415
261
|
</>
|
|
416
262
|
)
|
|
417
263
|
}
|
|
@@ -40,8 +40,6 @@ examples:
|
|
|
40
40
|
- table_with_selectable_rows: Table with Selectable Rows
|
|
41
41
|
- table_with_header_style_borderless: Header Style Borderless
|
|
42
42
|
- table_with_header_style_floating: Header Style Floating
|
|
43
|
-
- table_with_filter_variant_rails: Variant with Filter
|
|
44
|
-
- table_with_filter_variant_with_pagination_rails: Variant with Filter and Pagination
|
|
45
43
|
|
|
46
44
|
react:
|
|
47
45
|
- table_sm: Small
|
|
@@ -83,5 +81,3 @@ examples:
|
|
|
83
81
|
- table_with_selectable_rows: Table with Selectable Rows
|
|
84
82
|
- table_with_header_style_borderless: Header Style Borderless
|
|
85
83
|
- table_with_header_style_floating: Header Style Floating
|
|
86
|
-
- table_with_filter_variant: Variant with Filter
|
|
87
|
-
- table_with_filter_variant_with_pagination: Variant with Filter and Pagination
|
|
@@ -38,5 +38,3 @@ export { default as TableWithSelectableRows } from './_table_with_selectable_row
|
|
|
38
38
|
export { default as TableWithClickableRows } from './_table_with_clickable_rows.jsx'
|
|
39
39
|
export { default as TableWithHeaderStyleBorderless } from './_table_with_header_style_borderless.jsx'
|
|
40
40
|
export { default as TableWithHeaderStyleFloating } from './_table_with_header_style_floating.jsx'
|
|
41
|
-
export { default as TableWithFilterVariant } from './_table_with_filter_variant.jsx'
|
|
42
|
-
export { default as TableWithFilterVariantWithPagination } from './_table_with_filter_variant_with_pagination.jsx'
|
|
@@ -1,73 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
<%
|
|
3
|
-
<%= pb_rails("title", props: {
|
|
4
|
-
padding_left: { xs: "sm", sm: "sm", md: "xl", lg: "xl", xl: "xl", default: "xl" },
|
|
5
|
-
padding_y: "md",
|
|
6
|
-
size: 3,
|
|
7
|
-
text: object.title
|
|
8
|
-
}) if object.title.present? %>
|
|
9
|
-
<%= pb_rails("card", props: {
|
|
10
|
-
margin_x: { xs: "sm", sm: "sm", md: "xl", lg: "xl", xl: "xl", default: "xl" },
|
|
11
|
-
padding: "none"
|
|
12
|
-
}) do %>
|
|
13
|
-
<%= pb_rails("flex", props: {
|
|
14
|
-
align: "stretch",
|
|
15
|
-
flex_direction: "column",
|
|
16
|
-
gap: "none"
|
|
17
|
-
}) do %>
|
|
18
|
-
<% if object.filter_content.present? %>
|
|
19
|
-
<%
|
|
20
|
-
default_filter_props = {
|
|
21
|
-
background: false,
|
|
22
|
-
max_height: "50vh",
|
|
23
|
-
min_width: "xs",
|
|
24
|
-
popover_props: { width: "350px" },
|
|
25
|
-
template: 'single'
|
|
26
|
-
}
|
|
27
|
-
merged_filter_props = default_filter_props.merge(object.filter_props)
|
|
28
|
-
%>
|
|
29
|
-
<%= pb_rails("filter", props: merged_filter_props) do %>
|
|
30
|
-
<%= object.filter_content %>
|
|
31
|
-
<% end %>
|
|
32
|
-
<% end %>
|
|
33
|
-
<%= pb_rails("section_separator") if object.filter_content.present? %>
|
|
34
|
-
<% if object.pagination.present? %>
|
|
35
|
-
<%= object.pagination %>
|
|
36
|
-
<%= pb_rails("section_separator") %>
|
|
37
|
-
<% end %>
|
|
38
|
-
<% if object.tag == "table" %>
|
|
39
|
-
<%= pb_content_tag(:table) do %>
|
|
40
|
-
<%= content.presence %>
|
|
41
|
-
<% end %>
|
|
42
|
-
<% else %>
|
|
43
|
-
<%= pb_content_tag do %>
|
|
44
|
-
<%= content.presence %>
|
|
45
|
-
<% end %>
|
|
46
|
-
<% end %>
|
|
47
|
-
<% if object.pagination.present? %>
|
|
48
|
-
<%= object.pagination %>
|
|
49
|
-
<% end %>
|
|
50
|
-
<% end %>
|
|
51
|
-
<% end %>
|
|
52
|
-
<%# ------------ End variant = 'withFilter' rendering ------------ %>
|
|
1
|
+
<% if object.responsive_classname %>
|
|
2
|
+
<% responsive_class = object.responsive_classname %>
|
|
53
3
|
<% else %>
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
<% responsive_class = object.responsive_classname %>
|
|
57
|
-
<% else %>
|
|
58
|
-
<% responsive_class = nil %>
|
|
59
|
-
<% end %>
|
|
4
|
+
<% responsive_class = nil %>
|
|
5
|
+
<% end %>
|
|
60
6
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
<% end %>
|
|
7
|
+
<%= content_tag(:div, class: responsive_class, 'data-pb-table-wrapper' => true) do %>
|
|
8
|
+
<% if object.tag == "table" %>
|
|
9
|
+
<%= pb_content_tag(:table) do %>
|
|
10
|
+
<%= content.presence %>
|
|
11
|
+
<% end %>
|
|
12
|
+
<% else %>
|
|
13
|
+
<%= pb_content_tag do %>
|
|
14
|
+
<%= content.presence %>
|
|
70
15
|
<% end %>
|
|
71
16
|
<% end %>
|
|
72
|
-
<%# ------------ End Default Table (non-filter variant rendering) ------------ %>
|
|
73
17
|
<% end %>
|
|
@@ -40,23 +40,10 @@ module Playbook
|
|
|
40
40
|
prop :header_style, type: Playbook::Props::Enum,
|
|
41
41
|
values: %w[default borderless floating],
|
|
42
42
|
default: "default"
|
|
43
|
-
prop :variant, type: Playbook::Props::Enum,
|
|
44
|
-
values: %w[default with_filter],
|
|
45
|
-
default: "default"
|
|
46
|
-
prop :filter_props, type: Playbook::Props::HashProp,
|
|
47
|
-
default: {}
|
|
48
|
-
prop :filter_content
|
|
49
|
-
prop :pagination
|
|
50
|
-
prop :title, type: Playbook::Props::String,
|
|
51
|
-
default: nil
|
|
52
|
-
|
|
53
|
-
def size_class
|
|
54
|
-
variant === "with_filter" && size == "md" ? "sm" : size
|
|
55
|
-
end
|
|
56
43
|
|
|
57
44
|
def classname
|
|
58
45
|
generate_classname(
|
|
59
|
-
"pb_table", "table-#{
|
|
46
|
+
"pb_table", "table-#{size}", single_line_class, dark_class,
|
|
60
47
|
disable_hover_class, container_class, data_table_class, sticky_class, sticky_left_column_class,
|
|
61
48
|
sticky_right_column_class, collapse_class, vertical_border_class, striped_class, outer_padding_class,
|
|
62
49
|
"table-responsive-#{responsive}", header_style_class, separator: " "
|
|
@@ -67,10 +54,6 @@ module Playbook
|
|
|
67
54
|
responsive ? "table-responsive-#{responsive}" : nil
|
|
68
55
|
end
|
|
69
56
|
|
|
70
|
-
def with_filter_variant?
|
|
71
|
-
variant == "with_filter"
|
|
72
|
-
end
|
|
73
|
-
|
|
74
57
|
private
|
|
75
58
|
|
|
76
59
|
def dark_class
|
|
@@ -90,13 +73,11 @@ module Playbook
|
|
|
90
73
|
end
|
|
91
74
|
|
|
92
75
|
def container_class
|
|
93
|
-
|
|
94
|
-
effective_container ? "table-card" : nil
|
|
76
|
+
container ? "table-card" : nil
|
|
95
77
|
end
|
|
96
78
|
|
|
97
79
|
def collapse_class
|
|
98
|
-
|
|
99
|
-
responsive != "none" ? "table-collapse-#{effective_collapse}" : ""
|
|
80
|
+
responsive != "none" ? "table-collapse-#{collapse}" : ""
|
|
100
81
|
end
|
|
101
82
|
|
|
102
83
|
def sticky_class
|
|
@@ -184,146 +184,3 @@ test("when headerStyle is floating", () => {
|
|
|
184
184
|
const kit = renderKit(Table, props, { headerStyle: "floating" })
|
|
185
185
|
expect(kit).toHaveClass("pb_table table-sm table-responsive-collapse table-card header-floating table-collapse-sm")
|
|
186
186
|
})
|
|
187
|
-
|
|
188
|
-
test("renders withFilter variant with Card wrapper", () => {
|
|
189
|
-
const { container } = render(
|
|
190
|
-
<Table
|
|
191
|
-
data={{testid: "table-with-filter"}}
|
|
192
|
-
filterContent={<div>{"Mock Filter"}</div>}
|
|
193
|
-
title="Test Table"
|
|
194
|
-
variant="withFilter"
|
|
195
|
-
>
|
|
196
|
-
<Table.Head>
|
|
197
|
-
<Table.Row>
|
|
198
|
-
<Table.Header>{"Column 1"}</Table.Header>
|
|
199
|
-
</Table.Row>
|
|
200
|
-
</Table.Head>
|
|
201
|
-
<Table.Body>
|
|
202
|
-
<Table.Row>
|
|
203
|
-
<Table.Cell>{"Value 1"}</Table.Cell>
|
|
204
|
-
</Table.Row>
|
|
205
|
-
</Table.Body>
|
|
206
|
-
</Table>
|
|
207
|
-
)
|
|
208
|
-
|
|
209
|
-
const card = container.querySelector('.pb_card_kit')
|
|
210
|
-
expect(card).toBeInTheDocument()
|
|
211
|
-
const filter = container.querySelector('.pb_filter_kit')
|
|
212
|
-
expect(filter).toBeInTheDocument()
|
|
213
|
-
})
|
|
214
|
-
|
|
215
|
-
test("renders title when provided with withFilter variant", () => {
|
|
216
|
-
render(
|
|
217
|
-
<Table
|
|
218
|
-
filterContent={<div>{"Mock Filter"}</div>}
|
|
219
|
-
title="Test Title"
|
|
220
|
-
variant="withFilter"
|
|
221
|
-
>
|
|
222
|
-
<Table.Head>
|
|
223
|
-
<Table.Row>
|
|
224
|
-
<Table.Header>{"Column 1"}</Table.Header>
|
|
225
|
-
</Table.Row>
|
|
226
|
-
</Table.Head>
|
|
227
|
-
<Table.Body>
|
|
228
|
-
<Table.Row>
|
|
229
|
-
<Table.Cell>{"Value 1"}</Table.Cell>
|
|
230
|
-
</Table.Row>
|
|
231
|
-
</Table.Body>
|
|
232
|
-
</Table>
|
|
233
|
-
)
|
|
234
|
-
|
|
235
|
-
expect(screen.getByText("Test Title")).toBeInTheDocument()
|
|
236
|
-
})
|
|
237
|
-
|
|
238
|
-
test("renders filter component in withFilter variant", () => {
|
|
239
|
-
const { container } = render(
|
|
240
|
-
<Table
|
|
241
|
-
filterContent={<div data-testid="test-filter">{"Filter inputs"}</div>}
|
|
242
|
-
variant="withFilter"
|
|
243
|
-
>
|
|
244
|
-
<Table.Head>
|
|
245
|
-
<Table.Row>
|
|
246
|
-
<Table.Header>{"Column 1"}</Table.Header>
|
|
247
|
-
</Table.Row>
|
|
248
|
-
</Table.Head>
|
|
249
|
-
<Table.Body>
|
|
250
|
-
<Table.Row>
|
|
251
|
-
<Table.Cell>{"Value 1"}</Table.Cell>
|
|
252
|
-
</Table.Row>
|
|
253
|
-
</Table.Body>
|
|
254
|
-
</Table>
|
|
255
|
-
)
|
|
256
|
-
|
|
257
|
-
const filter = container.querySelector('.pb_filter_kit')
|
|
258
|
-
expect(filter).toBeInTheDocument()
|
|
259
|
-
})
|
|
260
|
-
|
|
261
|
-
test("renders SectionSeparator between filter and table in withFilter variant", () => {
|
|
262
|
-
const { container } = render(
|
|
263
|
-
<Table
|
|
264
|
-
filterContent={<div>{"Filter content"}</div>}
|
|
265
|
-
variant="withFilter"
|
|
266
|
-
>
|
|
267
|
-
<Table.Head>
|
|
268
|
-
<Table.Row>
|
|
269
|
-
<Table.Header>{"Column 1"}</Table.Header>
|
|
270
|
-
</Table.Row>
|
|
271
|
-
</Table.Head>
|
|
272
|
-
<Table.Body>
|
|
273
|
-
<Table.Row>
|
|
274
|
-
<Table.Cell>{"Value 1"}</Table.Cell>
|
|
275
|
-
</Table.Row>
|
|
276
|
-
</Table.Body>
|
|
277
|
-
</Table>
|
|
278
|
-
)
|
|
279
|
-
|
|
280
|
-
const separator = container.querySelector('.pb_section_separator_kit')
|
|
281
|
-
expect(separator).toBeInTheDocument()
|
|
282
|
-
})
|
|
283
|
-
|
|
284
|
-
test("does not render title when not provided with withFilter variant", () => {
|
|
285
|
-
const { container } = render(
|
|
286
|
-
<Table
|
|
287
|
-
filterContent={<div>{"Filter content"}</div>}
|
|
288
|
-
variant="withFilter"
|
|
289
|
-
>
|
|
290
|
-
<Table.Head>
|
|
291
|
-
<Table.Row>
|
|
292
|
-
<Table.Header>{"Column 1"}</Table.Header>
|
|
293
|
-
</Table.Row>
|
|
294
|
-
</Table.Head>
|
|
295
|
-
<Table.Body>
|
|
296
|
-
<Table.Row>
|
|
297
|
-
<Table.Cell>{"Value 1"}</Table.Cell>
|
|
298
|
-
</Table.Row>
|
|
299
|
-
</Table.Body>
|
|
300
|
-
</Table>
|
|
301
|
-
)
|
|
302
|
-
|
|
303
|
-
const title = container.querySelector('.pb_title_kit')
|
|
304
|
-
expect(title).not.toBeInTheDocument()
|
|
305
|
-
})
|
|
306
|
-
|
|
307
|
-
test("renders default variant without Card wrapper", () => {
|
|
308
|
-
render(
|
|
309
|
-
<Table
|
|
310
|
-
data={{testid: "default-table"}}
|
|
311
|
-
variant="default"
|
|
312
|
-
>
|
|
313
|
-
<Table.Head>
|
|
314
|
-
<Table.Row>
|
|
315
|
-
<Table.Header>{"Column 1"}</Table.Header>
|
|
316
|
-
</Table.Row>
|
|
317
|
-
</Table.Head>
|
|
318
|
-
<Table.Body>
|
|
319
|
-
<Table.Row>
|
|
320
|
-
<Table.Cell>{"Value 1"}</Table.Cell>
|
|
321
|
-
</Table.Row>
|
|
322
|
-
</Table.Body>
|
|
323
|
-
</Table>
|
|
324
|
-
)
|
|
325
|
-
|
|
326
|
-
const table = screen.getByTestId("default-table")
|
|
327
|
-
expect(table).toBeInTheDocument()
|
|
328
|
-
expect(table.closest('.pb_card_kit')).not.toBeInTheDocument()
|
|
329
|
-
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Text Input w/ Error shows that the
|
|
1
|
+
Text Input w/ Error shows that the radio option must be selected or is invalid (ie when used in a form it signals a user to fix an error).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Textarea w/ Error shows that the
|
|
1
|
+
Textarea w/ Error shows that the radio option must be selected or is invalid (ie when used in a form it signals a user to fix an error).
|
|
@@ -18,7 +18,6 @@ type ItemProps = {
|
|
|
18
18
|
icon?: string,
|
|
19
19
|
iconColor?: 'default' | 'royal' | 'blue' | 'purple' | 'teal' | 'red' | 'yellow' | 'green',
|
|
20
20
|
lineStyle?: 'solid' | 'dotted',
|
|
21
|
-
showCurrentYear?: boolean,
|
|
22
21
|
} & GlobalProps
|
|
23
22
|
|
|
24
23
|
function isElementOfType<P>(
|
|
@@ -36,7 +35,6 @@ const TimelineItem = ({
|
|
|
36
35
|
icon = 'user',
|
|
37
36
|
iconColor = 'default',
|
|
38
37
|
lineStyle = 'solid',
|
|
39
|
-
showCurrentYear = false,
|
|
40
38
|
...props
|
|
41
39
|
}: ItemProps): React.ReactElement => {
|
|
42
40
|
const timelineItemCss = buildCss('pb_timeline_item_kit', lineStyle)
|
|
@@ -75,7 +73,6 @@ const TimelineItem = ({
|
|
|
75
73
|
<DateStacked
|
|
76
74
|
align="center"
|
|
77
75
|
date={date}
|
|
78
|
-
showCurrentYear={showCurrentYear}
|
|
79
76
|
size="sm"
|
|
80
77
|
/>
|
|
81
78
|
)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Use the optional `showDate` prop to render the timeline kit with a visible date.
|
|
1
|
+
Use the optional `showDate` prop to render the timeline kit with a visible date. If the date is from the current year, the year will not be displayed, however if date is NOT from the current year, the kit will display the year as well.
|
|
@@ -5,7 +5,6 @@ examples:
|
|
|
5
5
|
- timeline_vertical: Vertical
|
|
6
6
|
- timeline_with_date: With Date
|
|
7
7
|
- timeline_with_children: With Children
|
|
8
|
-
- timeline_show_current_year: Show Current Year
|
|
9
8
|
- timeline_with_gap: With Gap
|
|
10
9
|
|
|
11
10
|
|
|
@@ -14,5 +13,4 @@ examples:
|
|
|
14
13
|
- timeline_vertical: Vertical
|
|
15
14
|
- timeline_with_date: With Date
|
|
16
15
|
- timeline_with_children: With Children
|
|
17
|
-
- timeline_show_current_year: Show Current Year
|
|
18
16
|
- timeline_with_gap: With Gap
|
|
@@ -3,5 +3,4 @@ export { default as TimelineVertical } from './_timeline_vertical.jsx'
|
|
|
3
3
|
export { default as TimelineWithDate } from './_timeline_with_date.jsx'
|
|
4
4
|
export { default as TimelineWithChildren } from './_timeline_with_children.jsx'
|
|
5
5
|
export { default as TimelineWithGap } from './_timeline_with_gap.jsx'
|
|
6
|
-
export { default as TimelineShowCurrentYear } from './_timeline_show_current_year.jsx'
|
|
7
6
|
|