playbook_ui 15.6.0.pre.alpha.draggableask12907 → 15.6.0.pre.alpha.play261013050

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.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/Components/RegularTableView.tsx +3 -2
  3. data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +4 -0
  4. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +95 -0
  5. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_colors_rails.html.erb +43 -0
  6. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_colors_rails.md +1 -0
  7. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_control_rails.html.erb +11 -5
  8. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_control_rails.md +7 -1
  9. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background.jsx +54 -0
  10. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background.md +9 -0
  11. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background_multi.jsx +80 -0
  12. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background_multi.md +3 -0
  13. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +4 -1
  14. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +3 -1
  15. data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +2 -2
  16. data/app/pb_kits/playbook/pb_advanced_table/table_header.rb +57 -0
  17. data/app/pb_kits/playbook/pb_card/docs/_card_header.md +1 -1
  18. data/app/pb_kits/playbook/pb_card/docs/_card_highlight.md +1 -1
  19. data/app/pb_kits/playbook/pb_collapsible/__snapshots__/collapsible.test.js.snap +2 -2
  20. data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleIcon.tsx +10 -8
  21. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_icons.jsx +0 -1
  22. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_state.jsx +0 -3
  23. data/app/pb_kits/playbook/pb_date_picker/date_picker.test.js +24 -0
  24. data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +181 -3
  25. data/app/pb_kits/playbook/pb_distribution_bar/docs/_distribution_bar_custom_colors.md +1 -1
  26. data/app/pb_kits/playbook/pb_filter/Filter/FilterBackground.tsx +3 -3
  27. data/app/pb_kits/playbook/pb_select/_select.tsx +8 -3
  28. data/app/pb_kits/playbook/pb_select/docs/_select_input_options.html.erb +16 -0
  29. data/app/pb_kits/playbook/pb_select/docs/_select_input_options.jsx +30 -0
  30. data/app/pb_kits/playbook/pb_select/docs/_select_input_options.md +1 -0
  31. data/app/pb_kits/playbook/pb_select/docs/example.yml +2 -0
  32. data/app/pb_kits/playbook/pb_select/docs/index.js +1 -0
  33. data/app/pb_kits/playbook/pb_select/select.html.erb +2 -2
  34. data/app/pb_kits/playbook/pb_select/select.rb +3 -1
  35. data/app/pb_kits/playbook/pb_select/select.test.js +23 -0
  36. data/app/pb_kits/playbook/pb_table/_table.tsx +187 -33
  37. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant.jsx +134 -0
  38. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant.md +34 -0
  39. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_rails.html.erb +101 -0
  40. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_rails.md +33 -0
  41. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_with_pagination.jsx +180 -0
  42. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_with_pagination.md +3 -0
  43. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_with_pagination_rails.html.erb +122 -0
  44. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_with_pagination_rails.md +3 -0
  45. data/app/pb_kits/playbook/pb_table/docs/example.yml +4 -0
  46. data/app/pb_kits/playbook/pb_table/docs/index.js +2 -0
  47. data/app/pb_kits/playbook/pb_table/table.html.erb +68 -12
  48. data/app/pb_kits/playbook/pb_table/table.rb +22 -3
  49. data/app/pb_kits/playbook/pb_table/table.test.js +143 -0
  50. data/app/pb_kits/playbook/pb_timeline/_item.tsx +3 -0
  51. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_show_current_year.html.erb +60 -0
  52. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_show_current_year.jsx +118 -0
  53. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_show_current_year.md +1 -0
  54. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_date.md +1 -1
  55. data/app/pb_kits/playbook/pb_timeline/docs/example.yml +2 -0
  56. data/app/pb_kits/playbook/pb_timeline/docs/index.js +1 -0
  57. data/app/pb_kits/playbook/pb_timeline/item.html.erb +1 -1
  58. data/app/pb_kits/playbook/pb_timeline/item.rb +2 -0
  59. data/app/pb_kits/playbook/pb_timeline/label.html.erb +2 -1
  60. data/app/pb_kits/playbook/pb_timeline/label.rb +2 -0
  61. data/app/pb_kits/playbook/pb_timeline/subcomponents/Label.tsx +3 -0
  62. data/app/pb_kits/playbook/pb_timeline/timeline.test.js +51 -0
  63. data/app/pb_kits/playbook/tokens/_colors.scss +2 -1
  64. data/app/pb_kits/playbook/utilities/deprecated.ts +73 -0
  65. data/dist/chunks/_typeahead-CHwm9MTE.js +6 -0
  66. data/dist/chunks/lib-Cugvy62C.js +29 -0
  67. data/dist/chunks/vendor.js +3 -3
  68. data/dist/menu.yml +1 -1
  69. data/dist/playbook-rails-react-bindings.js +1 -1
  70. data/dist/playbook-rails.js +1 -1
  71. data/dist/playbook.css +1 -1
  72. data/lib/playbook/forms/builder/collection_select_field.rb +9 -1
  73. data/lib/playbook/forms/builder/select_field.rb +9 -1
  74. data/lib/playbook/forms/builder/time_zone_select_field.rb +9 -1
  75. data/lib/playbook/pb_kit_helper.rb +35 -0
  76. data/lib/playbook/version.rb +1 -1
  77. metadata +25 -4
  78. data/dist/chunks/_typeahead-Ch3OzX5L.js +0 -6
  79. data/dist/chunks/lib-CgpqUb6l.js +0 -29
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4b0f188b0fa59810bc278d4f0fd8211ec8488472f38d61f3cf422edacdb4e918
4
- data.tar.gz: 8b4daf06eead8575f94da3c2307c6df40bb49cf17128b765d7a234bbacaa895c
3
+ metadata.gz: d3d89ee926ed30d6e2b557a56d47ef4c4224fc2f5f9d0ec7e91c6fcc32789e0e
4
+ data.tar.gz: 7f354c72614822bace8289b4fb2e2e7039a00172eab31a203b2894298b5d64a2
5
5
  SHA512:
6
- metadata.gz: 4c2cb58e0e5f3891d8c15954fc83e9a0e5904d71600883654d15a9ffd339c399d9f19bb4688401d2f735c3adaa557e57108a43ac6c743df9587e8d2f99032913
7
- data.tar.gz: a939b477c9565c5bdb334fd8bab4cc7abc507ff2f4b6e30a18e422b22233db8598df43811066c443253094e9f8609f0ca3e0058409a1beeed20a9f9d5264c348
6
+ metadata.gz: 85c0d2ad40ed0c74d43db5df10f1ca3e7159864fc300a1922773ad927510b1f4dc0b8bf756e3571abe5386ac51c46f804b61f04fd2349fadef32cb59ffc60a34
7
+ data.tar.gz: 184cbc2c3abc572492ef22ecedbc22f2cedf1217c06be4259396edbb00153e9dcf7c51154e24ae13cdb45b0a0a4e97b0e9cf32a578461f0ef7e45c35e897576a
@@ -63,10 +63,11 @@ const TableCellRenderer = ({
63
63
 
64
64
  const { column } = cell;
65
65
 
66
- // Find the owning colDefinition by accessor. Needed for multi column logic
66
+ // Find the "owning" colDefinition by accessor. Needed for multi column logic
67
67
  const colDef = findColumnDefByAccessor(columnDefinitions ?? [], column.id)
68
68
  const cellAlignment = colDef?.columnStyling?.cellAlignment ?? "right"
69
69
  const cellFontColor = colDef?.columnStyling?.fontColor
70
+ const cellBackgroundColor = colDef?.columnStyling?.cellBackgroundColor
70
71
  const paddingValue = colDef?.columnStyling?.cellPadding ?? customRowStyle?.cellPadding
71
72
  const paddingClass = paddingValue ? `p_${paddingValue}` : undefined
72
73
 
@@ -88,7 +89,7 @@ const TableCellRenderer = ({
88
89
  ? '180px'
89
90
  : `${column.getStart("left")}px`
90
91
  : undefined,
91
- backgroundColor: i === 0 && customRowStyle?.backgroundColor,
92
+ backgroundColor: cellBackgroundColor || (i === 0 && customRowStyle?.backgroundColor),
92
93
  color: cellFontColor || customRowStyle?.fontColor,
93
94
  }}
94
95
  >
@@ -90,6 +90,8 @@ export const TableHeaderCell = ({
90
90
  : undefined
91
91
 
92
92
  const headerAlignment = colDef?.columnStyling?.headerAlignment ?? colDef?.columnStyling?.headerAligment
93
+ const headerBackgroundColor = colDef?.columnStyling?.headerBackgroundColor
94
+ const headerFontColor = colDef?.columnStyling?.headerFontColor
93
95
 
94
96
  const isLeafColumn =
95
97
  header?.column.getLeafColumns().length === 1 &&
@@ -194,6 +196,8 @@ const isToggleExpansionEnabled =
194
196
  id={cellId}
195
197
  key={`${header?.id}-header`}
196
198
  style={{
199
+ backgroundColor: headerBackgroundColor,
200
+ color: headerFontColor,
197
201
  left: isPinnedLeft
198
202
  ? header?.index === 1 //Accounting for set min-width for first column
199
203
  ? '180px'
@@ -888,3 +888,98 @@ test("Sort icon renders with enableSort on individual columns", () => {
888
888
  expect(sortButton).toBeInTheDocument();
889
889
  });
890
890
 
891
+ test("columnStyling.backgroundColor works as excpected", () => {
892
+ const styledColumnDefs = [
893
+ {
894
+ accessor: "year",
895
+ label: "Year",
896
+ cellAccessors: ["quarter", "month", "day"],
897
+ },
898
+ {
899
+ accessor: "newEnrollments",
900
+ label: "New Enrollments",
901
+ columnStyling: {
902
+ cellBackgroundColor: colors.error_subtle,
903
+ },
904
+ },
905
+ {
906
+ accessor: "scheduledMeetings",
907
+ label: "Scheduled Meetings",
908
+ },
909
+ ];
910
+
911
+ render(
912
+ <AdvancedTable
913
+ columnDefinitions={styledColumnDefs}
914
+ data={{ testid: testId }}
915
+ tableData={MOCK_DATA}
916
+ />
917
+ );
918
+
919
+ const firstEnrollmentCell = screen.getAllByText("20")[0].closest("td");
920
+ expect(firstEnrollmentCell).toHaveStyle({ backgroundColor: colors.error_subtle });
921
+ });
922
+
923
+ test("columnStyling.headerBackgroundColor works as excpected", () => {
924
+ const styledColumnDefs = [
925
+ {
926
+ accessor: "year",
927
+ label: "Year",
928
+ cellAccessors: ["quarter", "month", "day"],
929
+ },
930
+ {
931
+ accessor: "newEnrollments",
932
+ label: "New Enrollments",
933
+ columnStyling: {
934
+ headerBackgroundColor: colors.error_subtle,
935
+ },
936
+ },
937
+ {
938
+ accessor: "scheduledMeetings",
939
+ label: "Scheduled Meetings",
940
+ },
941
+ ];
942
+
943
+ render(
944
+ <AdvancedTable
945
+ columnDefinitions={styledColumnDefs}
946
+ data={{ testid: testId }}
947
+ tableData={MOCK_DATA}
948
+ />
949
+ );
950
+
951
+ const firstEnrollmentHeader = screen.getAllByText("New Enrollments")[0].closest("th");
952
+ expect(firstEnrollmentHeader).toHaveStyle({ backgroundColor: colors.error_subtle });
953
+ });
954
+
955
+ test("columnStyling.headerFontColor works as excpected", () => {
956
+ const styledColumnDefs = [
957
+ {
958
+ accessor: "year",
959
+ label: "Year",
960
+ cellAccessors: ["quarter", "month", "day"],
961
+ },
962
+ {
963
+ accessor: "newEnrollments",
964
+ label: "New Enrollments",
965
+ columnStyling: {
966
+ headerFontColor: colors.white,
967
+ },
968
+ },
969
+ {
970
+ accessor: "scheduledMeetings",
971
+ label: "Scheduled Meetings",
972
+ },
973
+ ];
974
+
975
+ render(
976
+ <AdvancedTable
977
+ columnDefinitions={styledColumnDefs}
978
+ data={{ testid: testId }}
979
+ tableData={MOCK_DATA}
980
+ />
981
+ );
982
+
983
+ const firstEnrollmentHeader = screen.getAllByText("New Enrollments")[0].closest("th");
984
+ expect(firstEnrollmentHeader).toHaveStyle({ color: colors.white });
985
+ });
@@ -0,0 +1,43 @@
1
+ <% column_definitions = [
2
+ {
3
+ accessor: "year",
4
+ label: "Year",
5
+ cellAccessors: ["quarter", "month", "day"],
6
+ },
7
+ {
8
+ accessor: "newEnrollments",
9
+ label: "New Enrollments",
10
+ column_styling: {
11
+ cell_background_color: ->(row) { row[:newEnrollments].to_i > 20 ? "success_secondary" : "warning_secondary" }
12
+ }
13
+ },
14
+ {
15
+ accessor: "scheduledMeetings",
16
+ label: "Scheduled Meetings",
17
+ },
18
+ {
19
+ accessor: "attendanceRate",
20
+ label: "Attendance Rate",
21
+ },
22
+ {
23
+ accessor: "completedClasses",
24
+ label: "Completed Classes",
25
+ },
26
+ {
27
+ accessor: "classCompletionRate",
28
+ label: "Class Completion Rate",
29
+ column_styling: {
30
+ cell_background_color: "category_1",
31
+ font_color: "white"
32
+ }
33
+ },
34
+ {
35
+ accessor: "graduatedStudents",
36
+ label: "Graduated Students",
37
+ }
38
+ ] %>
39
+
40
+ <%= pb_rails("advanced_table", props: { id: "background-control", table_data: @table_data, column_definitions: column_definitions }) do %>
41
+ <%= pb_rails("advanced_table/table_header", props: { table_id: "background-control", column_definitions: column_definitions }) %>
42
+ <%= pb_rails("advanced_table/table_body", props: { table_id: "background-control", table_data: @table_data, column_definitions: column_definitions }) %>
43
+ <% end %>
@@ -0,0 +1 @@
1
+ `column_styling` can also be used to control the background color on individual cells in a given column as shown here.
@@ -8,16 +8,26 @@
8
8
  accessor: "newEnrollments",
9
9
  label: "New Enrollments",
10
10
  column_styling: {
11
- cell_background_color: ->(row) { row[:newEnrollments].to_i > 20 ? "success_secondary" : "warning_secondary" }
11
+ cell_background_color: "error_subtle",
12
+ header_background_color: "error_subtle"
12
13
  }
13
14
  },
14
15
  {
15
16
  accessor: "scheduledMeetings",
16
17
  label: "Scheduled Meetings",
18
+ column_styling: {
19
+ cell_background_color: "info_subtle",
20
+ }
17
21
  },
18
22
  {
19
23
  accessor: "attendanceRate",
20
24
  label: "Attendance Rate",
25
+ column_styling: {
26
+ cell_background_color: "info",
27
+ header_background_color: "info",
28
+ header_font_color: "white",
29
+ font_color: "white"
30
+ }
21
31
  },
22
32
  {
23
33
  accessor: "completedClasses",
@@ -26,10 +36,6 @@
26
36
  {
27
37
  accessor: "classCompletionRate",
28
38
  label: "Class Completion Rate",
29
- column_styling: {
30
- cell_background_color: "category_1",
31
- font_color: "white"
32
- }
33
39
  },
34
40
  {
35
41
  accessor: "graduatedStudents",
@@ -1 +1,7 @@
1
- `column_styling` can also be used to control the background color on all cells in a given column via the use of the `cell_background_color` key/value pair. Use `cell_background_color` to achieve custom background colors for individual cells as seen here. Use `font_color` to achieve better contrast between cell content and background for darker backgrounds.
1
+ `column_styling` can also be used to control the background color on all cells in a given column. Use the following key/values pairs to achieve this:
2
+
3
+ 1) `cell_background_color`: use this to control the background color of all cells in the given column
4
+ 2) `font_color`: use this to control font color for all cells in the given column if needed, for example if using a darker background color
5
+ 3) `header_background_color`: use this to control the background color of the column header
6
+ 4) `header_font_color`: use this to control font color for the header in the given column if needed, for example if using a darker background color.
7
+
@@ -0,0 +1,54 @@
1
+ import React from "react"
2
+ import AdvancedTable from '../_advanced_table'
3
+ import colors from '../../tokens/exports/_colors.module.scss'
4
+ import MOCK_DATA from "./advanced_table_mock_data.json"
5
+
6
+
7
+ const AdvancedTableColumnStylingBackground = (props) => {
8
+ const columnDefinitions = [
9
+ {
10
+ accessor: "year",
11
+ label: "Year",
12
+ cellAccessors: ["quarter", "month", "day"],
13
+ },
14
+ {
15
+ accessor: "newEnrollments",
16
+ label: "New Enrollments",
17
+ columnStyling:{cellBackgroundColor: colors.error_subtle, headerBackgroundColor: colors.error_subtle},
18
+ },
19
+ {
20
+ accessor: "scheduledMeetings",
21
+ label: "Scheduled Meetings",
22
+ columnStyling:{cellBackgroundColor: colors.info_subtle},
23
+ },
24
+ {
25
+ accessor: "attendanceRate",
26
+ label: "Attendance Rate",
27
+ columnStyling:{cellBackgroundColor: colors.info, headerBackgroundColor: colors.info, fontColor: colors.white, headerFontColor: colors.white},
28
+ },
29
+ {
30
+ accessor: "completedClasses",
31
+ label: "Completed Classes",
32
+ },
33
+ {
34
+ accessor: "classCompletionRate",
35
+ label: "Class Completion Rate",
36
+ },
37
+ {
38
+ accessor: "graduatedStudents",
39
+ label: "Graduated Students",
40
+ },
41
+ ]
42
+
43
+ return (
44
+ <div>
45
+ <AdvancedTable
46
+ columnDefinitions={columnDefinitions}
47
+ tableData={MOCK_DATA}
48
+ {...props}
49
+ />
50
+ </div>
51
+ )
52
+ }
53
+
54
+ export default AdvancedTableColumnStylingBackground
@@ -0,0 +1,9 @@
1
+ The `columnStyling` prop can also be used to set background color for entire columns.As stated above, `columnStyling` is an object that has several optional key/value pairs, here are the options highlighted in this doc:
2
+
3
+ 1) `cellBackgroundColor`: use this to control the background color of all cells in the given column
4
+ 2) `headerBackgroundColor`: use this to control the background color of the column header
5
+ 3) `fontColor`: use this to control font color for all cells in the given column if needed, for example if using a darker background color.
6
+ 4) `headerFontColor`: use this to control font color for the header in the given column if needed, for example if using a darker background color.
7
+
8
+
9
+
@@ -0,0 +1,80 @@
1
+ import React from "react"
2
+ import AdvancedTable from '../_advanced_table'
3
+ import colors from '../../tokens/exports/_colors.module.scss'
4
+ import MOCK_DATA from "./advanced_table_mock_data.json"
5
+
6
+
7
+ const AdvancedTableColumnStylingBackgroundMulti = (props) => {
8
+ const columnDefinitions = [
9
+ {
10
+ accessor: "year",
11
+ label: "Year",
12
+ cellAccessors: ["quarter", "month", "day"],
13
+ },
14
+ {
15
+ label: "Enrollment Data",
16
+ columns: [
17
+ {
18
+ label: "Enrollment Stats",
19
+ columns: [
20
+ {
21
+ accessor: "newEnrollments",
22
+ label: "New Enrollments",
23
+ columnStyling:{cellBackgroundColor: colors.error_subtle, headerBackgroundColor: colors.error_subtle},
24
+ },
25
+ {
26
+ accessor: "scheduledMeetings",
27
+ label: "Scheduled Meetings",
28
+ },
29
+ ],
30
+ },
31
+ ],
32
+ },
33
+ {
34
+ label: "Performance Data",
35
+ columns: [
36
+ {
37
+ label: "Completion Metrics",
38
+ columns: [
39
+ {
40
+ accessor: "completedClasses",
41
+ label: "Completed Classes",
42
+ columnStyling:{cellBackgroundColor: colors.info, headerBackgroundColor: colors.info, fontColor: colors.white, headerFontColor: colors.white},
43
+ },
44
+ {
45
+ accessor: "classCompletionRate",
46
+ label: "Class Completion Rate",
47
+ },
48
+ ],
49
+ },
50
+ {
51
+ label: "Attendance",
52
+ columns: [
53
+ {
54
+ accessor: "attendanceRate",
55
+ label: "Attendance Rate",
56
+ columnStyling:{cellBackgroundColor: colors.info_subtle},
57
+ },
58
+ {
59
+ accessor: "scheduledMeetings",
60
+ label: "Scheduled Meetings",
61
+ },
62
+ ],
63
+ },
64
+ ],
65
+ },
66
+ ];
67
+
68
+
69
+ return (
70
+ <div>
71
+ <AdvancedTable
72
+ columnDefinitions={columnDefinitions}
73
+ tableData={MOCK_DATA}
74
+ {...props}
75
+ />
76
+ </div>
77
+ )
78
+ }
79
+
80
+ export default AdvancedTableColumnStylingBackgroundMulti
@@ -0,0 +1,3 @@
1
+ The `columnStyling` prop can also be used to set background color for entire columns for the multi header variant as well.
2
+
3
+ It should be noted that `headerFontColor` and `headerBackgroundColor` in the multi header variant will only apply to the immediate header for the given column as shown here.
@@ -26,7 +26,8 @@ examples:
26
26
  - advanced_table_column_styling_rails: Column Styling
27
27
  - advanced_table_column_styling_column_headers_rails: Column Styling with Multiple Headers
28
28
  - advanced_table_padding_control_rails: Padding Control using Column Styling
29
- - advanced_table_background_control_rails: Background Control using Column Styling
29
+ - advanced_table_background_control_rails: Column Styling Background Color
30
+ - advanced_table_background_colors_rails: Column Styling Individual Cell Background Color
30
31
  - advanced_table_column_border_color_rails: Column Group Border Color
31
32
 
32
33
 
@@ -75,6 +76,8 @@ examples:
75
76
  - advanced_table_padding_control_per_row: Padding Control using Row Styling
76
77
  - advanced_table_column_styling: Column Styling
77
78
  - advanced_table_column_styling_column_headers: Column Styling with Multiple Headers
79
+ - advanced_table_column_styling_background: Column Styling Background Color
80
+ - advanced_table_column_styling_background_multi: Column Styling Background Color with Multiple Headers
78
81
  - advanced_table_padding_control: Padding Control using Column Styling
79
82
  - advanced_table_column_border_color: Column Group Border Color
80
83
  - advanced_table_fullscreen: Fullscreen
@@ -45,4 +45,6 @@ export { default as AdvancedTableWithCustomHeaderMultiHeader } from './_advanced
45
45
  export { default as AdvancedTableSortPerColumn } from './_advanced_table_sort_per_column.jsx'
46
46
  export { default as AdvancedTableSortPerColumnForMultiColumn } from './_advanced_table_sort_per_column_for_multi_column.jsx'
47
47
  export { default as AdvancedTablePaddingControl } from './_advanced_table_padding_control.jsx'
48
- export { default as AdvancedTablePaddingControlPerRow } from './_advanced_table_padding_control_per_row.jsx'
48
+ export { default as AdvancedTablePaddingControlPerRow } from './_advanced_table_padding_control_per_row.jsx'
49
+ export { default as AdvancedTableColumnStylingBackground } from './_advanced_table_column_styling_background.jsx'
50
+ export { default as AdvancedTableColumnStylingBackgroundMulti } from './_advanced_table_column_styling_background_multi.jsx'
@@ -5,8 +5,8 @@
5
5
  <%= object.render_select_all_header %>
6
6
  <% end %>
7
7
  <% header_row.each_with_index do |cell, cell_index| %>
8
- <% header_id = cell[:accessor].present? ? cell[:accessor] : "header_#{row_index}_#{cell_index}" %>
9
- <%= pb_rails("table/table_header", props: { id: header_id, colspan: cell[:colspan], classname: [object.th_classname(is_first_column: cell_index.zero?), ('last-header-cell' if cell[:is_last_in_group] && cell_index != 0)].compact.join(' '), sort_menu: cell[:accessor] ? cell[:sort_menu] : nil }) do %>
8
+ <% header_component = object.header_component_info(cell, cell_index, row_index) %>
9
+ <%= pb_rails(header_component[:name], props: header_component[:props]) do %>
10
10
  <%= pb_rails("flex", props: { align: "center", justify: cell_index.zero? ? "start" : row_index === header_rows.size - 1 ? "end" : "center", text_align: (cell[:header_alignment] || "end") }) do %>
11
11
  <% if cell_index.zero? && row_index === header_rows.size - 1 %>
12
12
  <% if object.selectable_rows && object.enable_toggle_expansion != "none" %>
@@ -119,6 +119,59 @@ module Playbook
119
119
  end
120
120
  end
121
121
 
122
+ # Get header background color from column styling
123
+ def header_background_color(cell)
124
+ original_def = find_original_column_def_for_cell(cell)
125
+ return nil unless original_def
126
+
127
+ original_def.dig(:column_styling, :header_background_color)
128
+ end
129
+
130
+ # Get header font color from column styling
131
+ def header_font_color(cell)
132
+ original_def = find_original_column_def_for_cell(cell)
133
+ return nil unless original_def
134
+
135
+ original_def.dig(:column_styling, :header_font_color)
136
+ end
137
+
138
+ # Check if header has custom background color
139
+ def has_custom_header_background_color?(cell)
140
+ cell[:header_background_color].present?
141
+ end
142
+
143
+ # Returns component info for header cell (uses background kit if custom bg color)
144
+ def header_component_info(cell, cell_index, row_index)
145
+ header_id = cell[:accessor].present? ? cell[:accessor] : "header_#{row_index}_#{cell_index}"
146
+ classname = [th_classname(is_first_column: cell_index.zero?), ("last-header-cell" if cell[:is_last_in_group] && cell_index != 0)].compact.join(" ")
147
+
148
+ if has_custom_header_background_color?(cell)
149
+ component_name = "background"
150
+ component_props = {
151
+ background_color: cell[:header_background_color],
152
+ tag: "th",
153
+ classname: classname,
154
+ }
155
+ component_props[:html_options] = {
156
+ id: header_id,
157
+ colspan: cell[:colspan],
158
+ style: { color: cell[:header_font_color] },
159
+ }
160
+ component_props[:html_options][:style].delete(:color) unless cell[:header_font_color].present?
161
+ else
162
+ component_name = "table/table_header"
163
+ component_props = {
164
+ id: header_id,
165
+ colspan: cell[:colspan],
166
+ classname: classname,
167
+ sort_menu: cell[:accessor] ? cell[:sort_menu] : nil,
168
+ }
169
+ component_props[:html_options] = { style: { color: cell[:header_font_color] } } if cell[:header_font_color].present?
170
+ end
171
+
172
+ { name: component_name, props: component_props }
173
+ end
174
+
122
175
  private
123
176
 
124
177
  # Find the original column definition for a cell
@@ -163,6 +216,8 @@ module Playbook
163
216
  else
164
217
  raw_styling = col[:column_styling] || {}
165
218
  header_alignment = raw_styling[:header_alignment]
219
+ header_background_color = raw_styling[:header_background_color]
220
+ header_font_color = raw_styling[:header_font_color]
166
221
 
167
222
  colspan = 1
168
223
  cell_hash = {
@@ -172,6 +227,8 @@ module Playbook
172
227
  sort_menu: col[:sort_menu],
173
228
  is_last_in_group: is_last && current_depth.positive?,
174
229
  header_alignment: header_alignment,
230
+ header_background_color: header_background_color,
231
+ header_font_color: header_font_color,
175
232
  }
176
233
  cell_hash[:id] = col[:id] if col[:id].present?
177
234
  rows[current_depth] << cell_hash
@@ -1 +1 @@
1
- Card headers pass category, product, status and background colors only. List of all category, product, status and background colors can be viewed <a href="https://playbook.powerapp.cloud/token/colors" target="_blank">here</a>.
1
+ Card headers pass category, product, status and background colors only. List of all category, product, status and background colors can be viewed <a href="https://playbook.powerapp.cloud/tokens/colors" target="_blank">here</a>.
@@ -1 +1 @@
1
- Card highlight can pass status, product, and category colors. List of all colors can be viewed <a href="https://playbook.powerapp.cloud/token/colors" target="_blank">here</a>.
1
+ Card highlight can pass status, product, and category colors. List of all colors can be viewed <a href="https://playbook.powerapp.cloud/tokens/colors" target="_blank">here</a>.
@@ -25,11 +25,11 @@ exports[`html structure is correct 1`] = `
25
25
  >
26
26
  <div
27
27
  class="icon_wrapper"
28
- style="vertical-align: middle; color: rgb(193, 205, 214);"
28
+ style="vertical-align: middle;"
29
29
  >
30
30
  <svg
31
31
  aria-label="chevron-down icon"
32
- class="pb_custom_icon svg-inline--fa svg_lg svg_fw"
32
+ class="pb_custom_icon svg-inline--fa color_text_lt_lighter svg_lg svg_fw"
33
33
  color="currentColor"
34
34
  fill="none"
35
35
  height="auto"
@@ -27,12 +27,12 @@ type colorMap = {
27
27
  };
28
28
 
29
29
  const colorMap = {
30
- default: "#242B42",
31
- light: "#687887",
32
- lighter: "#C1CDD6",
33
- link: "#0056CF",
34
- error: "#FF2229",
35
- success: "#00CA74",
30
+ default:"text_lt_default",
31
+ light: "text_lt_light",
32
+ lighter: "text_lt_lighter",
33
+ link: "primary",
34
+ error: "error",
35
+ success: "text_dk_success_sm",
36
36
  };
37
37
 
38
38
  const CollapsibleIcon = ({
@@ -68,9 +68,10 @@ const CollapsibleIcon = ({
68
68
  className="icon_wrapper"
69
69
  key={icon ? showIcon(icon)[0] : "chevron-down"}
70
70
  onClick={(e) => handleIconClick(e)}
71
- style={{ verticalAlign: "middle", color: color }}
71
+ style={{ verticalAlign: "middle"}}
72
72
  >
73
73
  <Icon
74
+ color={color}
74
75
  icon={icon ? showIcon(icon)[0] : "chevron-down"}
75
76
  size={iconSize}
76
77
  />
@@ -80,9 +81,10 @@ const CollapsibleIcon = ({
80
81
  className="icon_wrapper"
81
82
  key={icon ? showIcon(icon)[1] : "chevron-up"}
82
83
  onClick={(e) => handleIconClick(e)}
83
- style={{ verticalAlign: "middle", color: color }}
84
+ style={{ verticalAlign: "middle" }}
84
85
  >
85
86
  <Icon
87
+ color={color}
86
88
  icon={icon ? showIcon(icon)[1] : "chevron-up"}
87
89
  size={iconSize}
88
90
  />
@@ -7,7 +7,6 @@ const CollapsibleIcons = (props) => {
7
7
  <>
8
8
  <Collapsible
9
9
  icon={['plus','minus']}
10
- iconColor='white'
11
10
  >
12
11
  <Collapsible.Main {...props}>
13
12
  <div>{'Main Section'}</div>
@@ -22,7 +22,6 @@ const CollapsibleState = (props) => {
22
22
  <Collapsible
23
23
  collapsed={isCollapsed}
24
24
  icon={["plus", "minus"]}
25
- iconColor='white'
26
25
  padding="none"
27
26
  >
28
27
  <Collapsible.Main padding="sm"
@@ -41,7 +40,6 @@ const CollapsibleState = (props) => {
41
40
  <Collapsible
42
41
  collapsed={isCollapsed}
43
42
  icon={["plus", "minus"]}
44
- iconColor='white'
45
43
  padding="none"
46
44
  >
47
45
  <Collapsible.Main padding="sm"
@@ -60,7 +58,6 @@ const CollapsibleState = (props) => {
60
58
  <Collapsible
61
59
  collapsed={isCollapsed}
62
60
  icon={["plus", "minus"]}
63
- iconColor='white'
64
61
  padding="none"
65
62
  >
66
63
  <Collapsible.Main padding="sm"
@@ -251,4 +251,28 @@ describe('DatePicker Kit', () => {
251
251
  expect(input).toHaveValue(DateTime.getYearStartDate(new Date()).formatDate() + " to " + new Date().formatDate())
252
252
  })
253
253
  })
254
+
255
+
256
+ test('displays defaultDate when it is later than maxDate', async () => {
257
+ const testId = 'datepicker-out-of-range-after'
258
+ const futureDateString = '01/15/2020'
259
+ const maxDateString = '01/10/2020'
260
+
261
+ render(
262
+ <DatePicker
263
+ data={{ testid: testId }}
264
+ defaultDate={futureDateString}
265
+ format="m/d/Y"
266
+ maxDate={maxDateString}
267
+ pickerId="date-picker-out-of-range-after"
268
+ />
269
+ )
270
+
271
+ const kit = screen.getByTestId(testId)
272
+ const input = within(kit).getByPlaceholderText('Select Date')
273
+
274
+ await waitFor(() => {
275
+ expect(input).toHaveValue('01/15/2020')
276
+ }, { timeout: 5000 })
277
+ })
254
278
  })