playbook_ui 15.3.0.pre.alpha.PLAY2532flexboxdefaultresponsive12209 → 15.3.0.pre.alpha.PLAY2565formkitsubmitfix11681

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 (156) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/Components/RegularTableView.tsx +1 -2
  3. data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +1 -3
  4. data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableActions.ts +3 -18
  5. data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableState.ts +14 -71
  6. data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableHeader.tsx +0 -3
  7. data/app/pb_kits/playbook/pb_advanced_table/Utilities/RowUtils.ts +1 -1
  8. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +4 -4
  9. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +3 -12
  10. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +5 -127
  11. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_control_rails.html.erb +0 -4
  12. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_control_rails.md +1 -1
  13. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_border_color.md +1 -1
  14. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_border_color_rails.md +1 -1
  15. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling.jsx +1 -3
  16. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling.md +0 -2
  17. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_column_headers.jsx +1 -1
  18. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_rails.html.erb +0 -1
  19. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_rails.md +0 -2
  20. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_inline_row_loading.jsx +0 -28
  21. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_inline_row_loading.md +2 -11
  22. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control.jsx +1 -9
  23. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control.md +1 -1
  24. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.jsx +1 -4
  25. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.md +2 -3
  26. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns_and_header.md +1 -1
  27. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_rails.md +1 -1
  28. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_react.md +1 -1
  29. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header_multi_header.jsx +0 -16
  30. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header_rails.html.erb +1 -1
  31. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -1
  32. data/app/pb_kits/playbook/pb_advanced_table/flat_advanced_table.js +2 -2
  33. data/app/pb_kits/playbook/pb_advanced_table/index.js +7 -7
  34. data/app/pb_kits/playbook/pb_advanced_table/scss_partials/advanced_table_sticky_mixin.scss +2 -2
  35. data/app/pb_kits/playbook/pb_advanced_table/table_header.rb +20 -90
  36. data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +3 -32
  37. data/app/pb_kits/playbook/pb_background/background.html.erb +2 -10
  38. data/app/pb_kits/playbook/pb_background/docs/_background_category.md +1 -1
  39. data/app/pb_kits/playbook/pb_badge/_badge.tsx +1 -4
  40. data/app/pb_kits/playbook/pb_badge/badge.test.js +0 -13
  41. data/app/pb_kits/playbook/pb_card/docs/_card_background.md +1 -1
  42. data/app/pb_kits/playbook/pb_card/docs/_card_header.md +1 -1
  43. data/app/pb_kits/playbook/pb_card/docs/_card_highlight.md +1 -1
  44. data/app/pb_kits/playbook/pb_card/docs/_card_light.md +1 -1
  45. data/app/pb_kits/playbook/pb_currency/_currency.tsx +7 -20
  46. data/app/pb_kits/playbook/pb_currency/currency.rb +8 -35
  47. data/app/pb_kits/playbook/pb_currency/currency.test.js +0 -47
  48. data/app/pb_kits/playbook/pb_currency/docs/_currency_variants.html.erb +1 -1
  49. data/app/pb_kits/playbook/pb_currency/docs/_currency_variants.jsx +1 -1
  50. data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +0 -2
  51. data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +4 -16
  52. data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +1 -2
  53. data/app/pb_kits/playbook/pb_date_picker/docs/index.js +1 -2
  54. data/app/pb_kits/playbook/pb_date_picker/sass_partials/_quick_pick_styles.scss +30 -11
  55. data/app/pb_kits/playbook/pb_distribution_bar/docs/_distribution_bar_custom_colors.md +1 -1
  56. data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +0 -1
  57. data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +6 -111
  58. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_active_style_options_react.md +1 -1
  59. data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +0 -5
  60. data/app/pb_kits/playbook/pb_dropdown/docs/index.js +1 -5
  61. data/app/pb_kits/playbook/pb_dropdown/dropdown.test.jsx +2 -148
  62. data/app/pb_kits/playbook/pb_filter/docs/_filter_max_width.md +1 -1
  63. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close.html.erb +1 -15
  64. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_multi_line.html.erb +8 -9
  65. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_positions.html.erb +10 -11
  66. data/app/pb_kits/playbook/pb_form/pb_form_validation.js +11 -44
  67. data/app/pb_kits/playbook/pb_form_pill/_form_pill.tsx +1 -1
  68. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text_rails.md +1 -1
  69. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text_react.md +1 -1
  70. data/app/pb_kits/playbook/pb_icon/docs/_icon_color.md +1 -1
  71. data/app/pb_kits/playbook/pb_icon_circle/docs/_icon_circle_color.md +1 -1
  72. data/app/pb_kits/playbook/pb_icon_stat_value/docs/_icon_stat_value_color.html.erb +14 -7
  73. data/app/pb_kits/playbook/pb_icon_stat_value/docs/_icon_stat_value_color.jsx +15 -6
  74. data/app/pb_kits/playbook/pb_layout/docs/_layout_collection.md +1 -1
  75. data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_item_spacing.md +1 -1
  76. data/app/pb_kits/playbook/pb_nav/docs/_nav_with_spacing_control.md +1 -1
  77. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_layout.md +1 -1
  78. data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +17 -110
  79. data/app/pb_kits/playbook/pb_pill/docs/_description.md +1 -1
  80. data/app/pb_kits/playbook/pb_popover/_popover.tsx +34 -69
  81. data/app/pb_kits/playbook/pb_popover/docs/example.yml +0 -1
  82. data/app/pb_kits/playbook/pb_popover/docs/index.js +0 -1
  83. data/app/pb_kits/playbook/pb_popover/popover.test.js +0 -80
  84. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_description.md +1 -1
  85. data/app/pb_kits/playbook/pb_section_separator/docs/_description.md +1 -1
  86. data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +0 -29
  87. data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_border_radius_rails.md +1 -1
  88. data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_border_radius_react.md +1 -1
  89. data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_layout.md +1 -1
  90. data/app/pb_kits/playbook/pb_table/docs/_table_side_highlight.md +1 -1
  91. data/app/pb_kits/playbook/pb_table/docs/_table_sm.md +1 -1
  92. data/app/pb_kits/playbook/pb_table/docs/example.yml +0 -2
  93. data/app/pb_kits/playbook/pb_table/docs/index.js +0 -1
  94. data/app/pb_kits/playbook/pb_text_input/text_input.rb +2 -2
  95. data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +0 -7
  96. data/app/pb_kits/playbook/pb_typeahead/_typeahead.test.jsx +1 -105
  97. data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +9 -23
  98. data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.tsx +1 -33
  99. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default_options.html.erb +1 -67
  100. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default_value.jsx +6 -68
  101. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.md +1 -1
  102. data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +0 -2
  103. data/app/pb_kits/playbook/pb_typeahead/docs/index.js +1 -2
  104. data/app/pb_kits/playbook/utilities/globalProps.ts +8 -26
  105. data/app/pb_kits/playbook/utilities/test/globalProps/alignContent.test.js +0 -18
  106. data/app/pb_kits/playbook/utilities/test/globalProps/alignItems.test.js +0 -18
  107. data/app/pb_kits/playbook/utilities/test/globalProps/alignSelf.test.js +0 -18
  108. data/app/pb_kits/playbook/utilities/test/globalProps/display.test.js +0 -18
  109. data/app/pb_kits/playbook/utilities/test/globalProps/flex.test.js +0 -18
  110. data/app/pb_kits/playbook/utilities/test/globalProps/flexDirection.test.js +0 -18
  111. data/app/pb_kits/playbook/utilities/test/globalProps/flexGrow.test.js +0 -18
  112. data/app/pb_kits/playbook/utilities/test/globalProps/flexShrink.test.js +0 -18
  113. data/app/pb_kits/playbook/utilities/test/globalProps/flexWrap.test.js +0 -18
  114. data/app/pb_kits/playbook/utilities/test/globalProps/justifyContent.test.js +0 -18
  115. data/app/pb_kits/playbook/utilities/test/globalProps/justifySelf.test.js +0 -18
  116. data/app/pb_kits/playbook/utilities/test/globalProps/order.test.js +0 -18
  117. data/dist/chunks/{_line_graph-9bI76O2f.js → _line_graph-h5H-imfn.js} +1 -1
  118. data/dist/chunks/_typeahead-U8AjZIIW.js +6 -0
  119. data/dist/chunks/_weekday_stacked-CbCUYuuZ.js +37 -0
  120. data/dist/chunks/{lib-BXBHAZMY.js → lib-CGxXTQ75.js} +1 -1
  121. data/dist/chunks/pb_form_validation-DebqlUKZ.js +1 -0
  122. data/dist/chunks/vendor.js +1 -1
  123. data/dist/playbook-doc.js +2 -2
  124. data/dist/playbook-rails-react-bindings.js +1 -1
  125. data/dist/playbook-rails.js +1 -1
  126. data/dist/playbook.css +1 -1
  127. data/lib/playbook/version.rb +1 -1
  128. metadata +8 -32
  129. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header_multi_header_rails.html.erb +0 -104
  130. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header_multi_header_rails.md +0 -1
  131. data/app/pb_kits/playbook/pb_advanced_table/docs/_mock_data_inline_loading_empty_children.js +0 -42
  132. data/app/pb_kits/playbook/pb_currency/docs/_currency_variants.md +0 -1
  133. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_and_dropdown_range.jsx +0 -38
  134. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_and_dropdown_range.md +0 -14
  135. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick.jsx +0 -18
  136. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick.md +0 -4
  137. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_default_dates.jsx +0 -18
  138. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_default_dates.md +0 -1
  139. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_range_end.jsx +0 -19
  140. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_range_end.md +0 -1
  141. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_with_date_pickers.jsx +0 -38
  142. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_with_date_pickers.md +0 -14
  143. data/app/pb_kits/playbook/pb_dropdown/quickpick/index.ts +0 -60
  144. data/app/pb_kits/playbook/pb_popover/docs/_popover_append_to.jsx +0 -68
  145. data/app/pb_kits/playbook/pb_popover/docs/_popover_append_to_react.md +0 -1
  146. data/app/pb_kits/playbook/pb_table/docs/_table_with_dynamic_collapsible.html.erb +0 -63
  147. data/app/pb_kits/playbook/pb_table/docs/_table_with_dynamic_collapsible.jsx +0 -89
  148. data/app/pb_kits/playbook/pb_table/docs/_table_with_dynamic_collapsible_rails.md +0 -4
  149. data/app/pb_kits/playbook/pb_table/docs/_table_with_dynamic_collapsible_react.md +0 -3
  150. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_custom_options.html.erb +0 -64
  151. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_custom_options.jsx +0 -70
  152. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_custom_options.md +0 -1
  153. data/dist/chunks/_typeahead-By0NwDwL.js +0 -6
  154. data/dist/chunks/_weekday_stacked-ClJbIaDx.js +0 -37
  155. data/dist/chunks/pb_form_validation-BNfSnIUF.js +0 -1
  156. /data/app/pb_kits/playbook/pb_popover/docs/{_popover_append_to_rails.md → _popover_append_to.md} +0 -0
@@ -1,8 +1,6 @@
1
1
  import React from "react"
2
2
  import AdvancedTable from '../../pb_advanced_table/_advanced_table'
3
- import Caption from '../../pb_caption/_caption'
4
3
  import { MOCK_DATA_INLINE_LOADING } from "./_mock_data_inline_loading"
5
- import { MOCK_DATA_INLINE_LOADING_EMPTY_CHILDREN } from "./_mock_data_inline_loading_empty_children"
6
4
 
7
5
  const AdvancedTableInlineRowLoading = (props) => {
8
6
  const columnDefinitions = [
@@ -43,42 +41,16 @@ const AdvancedTableInlineRowLoading = (props) => {
43
41
 
44
42
  return (
45
43
  <div>
46
- <Caption text="Inline Row Loading - Demonstrated in Row 1 (Rows 2 and 3 have data)" />
47
44
  <AdvancedTable
48
45
  columnDefinitions={columnDefinitions}
49
46
  enableToggleExpansion="all"
50
47
  inlineRowLoading
51
- marginBottom="md"
52
48
  tableData={MOCK_DATA_INLINE_LOADING}
53
49
  {...props}
54
50
  >
55
51
  <AdvancedTable.Header />
56
52
  <AdvancedTable.Body subRowHeaders={subRowHeaders}/>
57
53
  </AdvancedTable>
58
- <Caption text="Inline Row Loading with No Subrow Data - All Rows Display Inline Row Loading and the Toggle All Button is not rendered" />
59
- <AdvancedTable
60
- columnDefinitions={columnDefinitions}
61
- enableToggleExpansion="all"
62
- inlineRowLoading
63
- marginBottom="md"
64
- tableData={MOCK_DATA_INLINE_LOADING_EMPTY_CHILDREN}
65
- {...props}
66
- >
67
- <AdvancedTable.Header />
68
- <AdvancedTable.Body subRowHeaders={subRowHeaders}/>
69
- </AdvancedTable>
70
- <Caption text="Inline Row Loading and Persist Toggle Expansion Button with No Subrow Data - All Rows Display Inline Row Loading and the Toggle All Button is rendered" />
71
- <AdvancedTable
72
- columnDefinitions={columnDefinitions}
73
- enableToggleExpansion="all"
74
- inlineRowLoading
75
- persistToggleExpansionButton
76
- tableData={MOCK_DATA_INLINE_LOADING_EMPTY_CHILDREN}
77
- {...props}
78
- >
79
- <AdvancedTable.Header />
80
- <AdvancedTable.Body subRowHeaders={subRowHeaders}/>
81
- </AdvancedTable>
82
54
  </div>
83
55
  )
84
56
  }
@@ -1,14 +1,5 @@
1
- ### inlineRowLoading
2
1
  As a default, the kit assumes that the initial dataset is complete, and it renders all expansion buttons/controls based on that data; if no children are present, no expansion controls are rendered. If, however, you want to change the initial dataset to omit some or all of its children (to improve load times of a complex dataset, perhaps), and you implement a querying logic that loads children only when its parent is expanded, then you must use the `inlineRowLoading` prop to ensure your expansion controls are rendered even though your child data is not yet loaded. You must also pass an empty `children` array to any node that will have children to ensure its parent maintains its ability to expand. If this prop is called AND your data contains empty `children` arrays, the kit will render expansion controls on any row with empty children, and then add an inline loading state within the expanded subrow until those child row(s) are returned to the page [by your query logic].
3
2
 
4
- In the first Advanced Table in this code example, 2021 has an empty children array. Toggle it open to see the inline loading state. Once the correct data loads, this state will be replaced with the correct data rows.
3
+ In this code example, 2021 has an empty children array. Toggle it open to see the inline loading state. Once the correct data loads, this state will be replaced with the correct data rows.
5
4
 
6
- This prop is set to `false` by default.
7
-
8
-
9
- ### persistToggleExpansion
10
- The `persistToggleExpansionButton` is a boolean prop that renders the toggle-all icon in the top left header cell for complex datasets with empty `children` arrays and advanced querying logic explained in the preceeding doc example. Your logic may require an additional query helper file to update data specifically from requerying via toggle all buttons.
11
-
12
- In the second and third Advanced Tables in this code example, all 3 rows have empty children arrays. The second Advanced Table demonstrates that the toggle all button does not render (prior to an initial row expansion) without `persistToggleExpansionButton` in place. The third Advanced Table shows the toggle all button due to `persistToggleExpansionButton`.
13
-
14
- This prop is set to false by default and should only be used in conjunction with `inlineRowLoading`.
5
+ This prop is set to `false` by default.
@@ -22,6 +22,7 @@ const AdvancedTablePaddingControl = (props) => {
22
22
  {value}
23
23
  </Background>
24
24
  ),
25
+
25
26
  },
26
27
  {
27
28
  accessor: "scheduledMeetings",
@@ -38,15 +39,6 @@ const AdvancedTablePaddingControl = (props) => {
38
39
  {
39
40
  accessor: "classCompletionRate",
40
41
  label: "Class Completion Rate",
41
- columnStyling:{cellPadding: "none", fontColor: "white"},
42
- customRenderer: (row, value) => (
43
- <Background
44
- backgroundColor={"category_1"}
45
- padding="xs"
46
- >
47
- {value}
48
- </Background>
49
- ),
50
42
  },
51
43
  {
52
44
  accessor: "graduatedStudents",
@@ -1,3 +1,3 @@
1
1
  `columnStyling` can also be used to control padding on all cells in a given column via the use of the `cellPadding` key/value pair. `cellPadding` lets you use 'xxs', 'xs', 'sm', 'md', 'lg', 'xl' and 'none'.
2
2
 
3
- This control can be used in conjunction with the `customRenderer` item within each columnDefinition to achieve custom background colors for individual cells as seen here. Use `fontColor` to achieve better contrast between cell content and background for darker backgrounds.
3
+ This control can be used in conjunction with the `customRenderer` item within each columnDefinition to achieve custom background colors for individual cells as seen here.
@@ -38,10 +38,7 @@ const AdvancedTablePaginationWithProps = (props) => {
38
38
  const paginationProps = {
39
39
  pageIndex: 1,
40
40
  pageSize: 10,
41
- range: 2,
42
- onPageChange: (pageIndex) => {
43
- console.log('Current page index:', pageIndex);
44
- }
41
+ range: 2
45
42
  }
46
43
 
47
44
  return (
@@ -1,6 +1,5 @@
1
- `paginationProps` is an optional prop that can be used to further customize pagination for the AdvancedTable. This prop is an object with the following optional items:
1
+ `paginationProps` is an optional prop that can be used to further customize pagination for the AdvancedTable. This prop is an object with 2 optional items:
2
2
 
3
3
  - `pageIndex`: An optional prop to set which page is set to open on initial load. Default is '0'
4
4
  - `pageSize`: An optional prop to set total number of rows for each page before the Table paginates. Default is '20'
5
- - `range`: The range prop determines how many pages to display in the Pagination component. Regardless of this value, the first two and last two pages are always visible to facilitate navigation to the beginning and end of the pagination. If these always-visible pages fall within the specified range, they are included in the display. If they fall outside the range, the pagination will show additional pages up to the number defined by the range prop. See [here for more details](https://playbook.powerapp.cloud/kits/pagination/react#default). Default is set to '5'
6
- - `onPageChange`: A callback function that gives to access to the current page index.
5
+ - `range`: The range prop determines how many pages to display in the Pagination component. Regardless of this value, the first two and last two pages are always visible to facilitate navigation to the beginning and end of the pagination. If these always-visible pages fall within the specified range, they are included in the display. If they fall outside the range, the pagination will show additional pages up to the number defined by the range prop. See [here for more details](https://playbook.powerapp.cloud/kits/pagination/react#default). Default is set to '5'
@@ -1,7 +1,7 @@
1
1
  To achieve a sticky header AND sticky columns together, in addition to the `stickyLeftColumn` logic outlined above, you can:
2
2
 
3
3
  - Set `sticky: true` via `tableProps`
4
- - Give the AdvancedTable a `maxHeight` using our [Max Height](https://playbook.powerapp.cloud//global_props/max_height) global prop.
4
+ - Give the AdvancedTable a `maxHeight` using our [Max Height](https://playbook.powerapp.cloud/visual_guidelines/max_height) global prop.
5
5
 
6
6
  **NOTE**: This behavior requires a `maxHeight` to work. The header is sticky within the table container, allowing for it to work along with the column stickiness.
7
7
 
@@ -1,4 +1,4 @@
1
- Create a sticky header that works for responsive Advanced Tables by setting `sticky: true` via `table_props` and giving the AdvancedTable a `max_height` using our [Max Height](https://playbook.powerapp.cloud/global_props/max_height) global prop.
1
+ Create a sticky header that works for responsive Advanced Tables by setting `sticky: true` via `table_props` and giving the AdvancedTable a `max_height` using our [Max Height](https://playbook.powerapp.cloud/visual_guidelines/max_height) global prop.
2
2
 
3
3
  **NOTE**: This behavior requires a `max_height` to work. The header is sticky within the table container, allowing for it to work along with the first column stickiness of a responsive table on smaller screen sizes.
4
4
 
@@ -1,4 +1,4 @@
1
- Create a sticky header that works for responsive Advanced Tables by setting `sticky: true` via `tableProps` and giving the AdvancedTable a `maxHeight` using our [Max Height](https://playbook.powerapp.cloud/global_props/max_height) global prop.
1
+ Create a sticky header that works for responsive Advanced Tables by setting `sticky: true` via `tableProps` and giving the AdvancedTable a `maxHeight` using our [Max Height](https://playbook.powerapp.cloud/visual_guidelines/max_height) global prop.
2
2
 
3
3
  **NOTE**: This behavior requires a `maxHeight` to work. The header is sticky within the table container, allowing for it to work along with the first column stickiness of a responsive table on smaller screen sizes.
4
4
 
@@ -76,22 +76,6 @@ const columnDefinitions = [
76
76
  {
77
77
  label: "Attendance",
78
78
  id: "attendance",
79
- header: () => (
80
- <Flex alignItems="center"
81
- justifyContent="center"
82
- >
83
- <Caption marginRight="xs">Attendance</Caption>
84
- <Tooltip placement="top"
85
- text="Whoa. I'm a Tooltip Too!"
86
- zIndex={10}
87
- >
88
- <Icon cursor="pointer"
89
- icon="info"
90
- size="xs"
91
- />
92
- </Tooltip>
93
- </Flex>
94
- ),
95
79
  columns: [
96
80
  {
97
81
  accessor: "attendanceRate",
@@ -12,7 +12,7 @@
12
12
  capture do
13
13
  pb_rails("flex", props: { align_items: "center", justify_content: "center" }) do
14
14
  pb_rails("caption", props: { margin_right: "xs", text: "New Enrollments" }) +
15
- pb_rails("icon", props: { id: "tooltip-interact", icon: "info", size: "xs", cursor: "pointer" }) +
15
+ pb_rails("icon", props: { id: "tooltip-interact", icon: "info", size: "xs" }) +
16
16
  pb_rails("tooltip", props: {
17
17
  trigger_element_id: "tooltip-interact",
18
18
  tooltip_id: "example-custom-tooltip",
@@ -11,7 +11,6 @@ examples:
11
11
  - advanced_table_responsive: Responsive Tables
12
12
  - advanced_table_custom_cell_rails: Custom Components for Cells
13
13
  - advanced_table_with_custom_header_rails: Custom Header Cell
14
- - advanced_table_with_custom_header_multi_header_rails: Custom Header with Multiple Headers
15
14
  - advanced_table_column_headers: Multi-Header Columns
16
15
  - advanced_table_column_headers_multiple: Multi-Header Columns (Multiple Levels)
17
16
  - advanced_table_column_headers_vertical_border: Multi-Header Columns with Vertical Borders
@@ -51,7 +51,7 @@ export default class PbFlatAdvancedTable extends PbEnhancedElement {
51
51
 
52
52
  const tr = rowCb.closest("tr");
53
53
  tr?.classList.toggle("bg-row-selection", rowCb.checked);
54
- tr?.classList.toggle("pb-bg-row-white", !rowCb.checked);
54
+ tr?.classList.toggle("bg-white", !rowCb.checked);
55
55
  }
56
56
 
57
57
  if (allCb) {
@@ -62,7 +62,7 @@ export default class PbFlatAdvancedTable extends PbEnhancedElement {
62
62
  cb.checked = checked;
63
63
  const tr = cb.closest("tr");
64
64
  tr?.classList.toggle("bg-row-selection", checked);
65
- tr?.classList.toggle("pb-bg-row-white", !checked);
65
+ tr?.classList.toggle("bg-white", !checked);
66
66
  const id = cb.id;
67
67
  if (checked) this.selectedRows.add(id);
68
68
  else this.selectedRows.delete(id);
@@ -76,7 +76,7 @@ export default class PbAdvancedTable extends PbEnhancedElement {
76
76
  // Only apply styling if the checkbox is inside a table row
77
77
  if (rowEl) {
78
78
  rowEl.classList.add("bg-row-selection");
79
- rowEl.classList.remove("pb-bg-row-white", "bg-silver");
79
+ rowEl.classList.remove("bg-white", "bg-silver");
80
80
  }
81
81
  } else {
82
82
  // Only apply styling if the checkbox is inside a table row
@@ -85,9 +85,9 @@ export default class PbAdvancedTable extends PbEnhancedElement {
85
85
 
86
86
  if (this.isRowExpanded(rowEl)) {
87
87
  rowEl.classList.remove("bg-silver");
88
- rowEl.classList.add("pb-bg-row-white");
88
+ rowEl.classList.add("bg-white");
89
89
  } else {
90
- rowEl.classList.remove("pb-bg-row-white");
90
+ rowEl.classList.remove("bg-white");
91
91
  rowEl.classList.add("bg-silver");
92
92
  }
93
93
  }
@@ -120,7 +120,7 @@ export default class PbAdvancedTable extends PbEnhancedElement {
120
120
  if (isChecked) {
121
121
  PbAdvancedTable.selectedRows.add(rowId);
122
122
  rowEl.classList.add("bg-row-selection");
123
- rowEl.classList.remove("pb-bg-row-white", "bg-silver");
123
+ rowEl.classList.remove("bg-white", "bg-silver");
124
124
  } else {
125
125
  PbAdvancedTable.selectedRows.delete(rowId);
126
126
  }
@@ -130,9 +130,9 @@ export default class PbAdvancedTable extends PbEnhancedElement {
130
130
 
131
131
  if (this.isRowExpanded(rowEl)) {
132
132
  rowEl.classList.remove("bg-silver");
133
- rowEl.classList.add("pb-bg-row-white");
133
+ rowEl.classList.add("bg-white");
134
134
  } else {
135
- rowEl.classList.remove("pb-bg-row-white");
135
+ rowEl.classList.remove("bg-white");
136
136
  rowEl.classList.add("bg-silver");
137
137
  }
138
138
  }
@@ -407,7 +407,7 @@ export default class PbAdvancedTable extends PbEnhancedElement {
407
407
  const row = this.element.closest("tr");
408
408
  if (row) {
409
409
  row.classList.toggle("bg-silver", !isVisible);
410
- row.classList.toggle("pb-bg-row-white", isVisible);
410
+ row.classList.toggle("bg-white", isVisible);
411
411
  }
412
412
 
413
413
  this.addBorderRadiusOnLastVisibleRow();
@@ -52,7 +52,7 @@
52
52
  }
53
53
  }
54
54
 
55
- .pb-bg-row-white {
55
+ .bg-white {
56
56
  td:first-child,
57
57
  .sticky-left {
58
58
  background-color: $bg-main;
@@ -63,7 +63,7 @@
63
63
  &.bg-silver td:first-child {
64
64
  background-color: $bg-secondary;
65
65
  }
66
- &.pb-bg-row-white td:first-child {
66
+ &.bg-white td:first-child {
67
67
  background-color: $bg-main;
68
68
  }
69
69
  &.bg-row-selection td:first-child {
@@ -82,62 +82,32 @@ module Playbook
82
82
  end
83
83
  end
84
84
 
85
- # Get original column definition for custom rendering by accessor
85
+ # Get original column definition for custom rendering
86
86
  def find_original_column_def(accessor)
87
87
  find_column_def_by_accessor(column_definitions, accessor)
88
88
  end
89
89
 
90
- # Get original column definition for custom rendering by id
91
- def find_original_column_def_by_id(id)
92
- find_column_def_by_id(column_definitions, id)
93
- end
94
-
95
90
  # Check if a header cell has a custom renderer
96
91
  def has_header_renderer?(cell)
97
- original_def = find_original_column_def_for_cell(cell)
98
- original_def&.dig(:header).present?
99
- rescue
100
- false
92
+ return false unless cell[:accessor].present?
93
+
94
+ original_def = find_original_column_def(cell[:accessor])
95
+ original_def && original_def[:header].present?
101
96
  end
102
97
 
103
98
  # Render custom header content
104
99
  def render_header(cell)
105
100
  return cell[:label] unless has_header_renderer?(cell)
106
101
 
107
- original_def = find_original_column_def_for_cell(cell)
108
- return cell[:label] unless original_def
109
-
102
+ original_def = find_original_column_def(cell[:accessor])
110
103
  custom_renderer = original_def[:header]
111
- return cell[:label] unless custom_renderer
112
104
 
113
105
  # Call the custom renderer with the cell data and label
114
- begin
115
- result = custom_renderer.call(cell, cell[:label])
116
- result.present? ? result.to_s : cell[:label]
117
- rescue
118
- cell[:label]
119
- end
106
+ custom_renderer.call(cell, cell[:label])
120
107
  end
121
108
 
122
109
  private
123
110
 
124
- # Find the original column definition for a cell
125
- def find_original_column_def_for_cell(cell)
126
- # Try accessor first (for leaf columns)
127
- if cell[:accessor].present?
128
- found = find_original_column_def(cell[:accessor])
129
- return found if found
130
- end
131
-
132
- # Try id if accessor lookup didn't find it (for grouped columns or leaf columns with id)
133
- if cell[:id].present?
134
- found = find_original_column_def_by_id(cell[:id])
135
- return found if found
136
- end
137
-
138
- nil
139
- end
140
-
141
111
  def compute_max_depth(columns)
142
112
  columns.map do |col|
143
113
  col[:columns] ? 1 + compute_max_depth(col[:columns]) : 1
@@ -148,24 +118,21 @@ module Playbook
148
118
  total_columns = columns.size
149
119
  columns.each_with_index do |col, index|
150
120
  is_last = index == total_columns - 1
151
- nested_columns = col[:columns]
152
- if nested_columns
153
- colspan = compute_leaf_columns(nested_columns)
154
- cell_hash = {
121
+ if col[:columns]
122
+ colspan = compute_leaf_columns(col[:columns])
123
+ rows[current_depth] << {
155
124
  label: col[:label],
156
125
  colspan: colspan,
157
126
  is_last_in_group: is_last && current_depth.positive?,
158
127
  }
159
- cell_hash[:id] = col[:id] if col[:id].present?
160
- rows[current_depth] << cell_hash
161
128
 
162
- process_columns(nested_columns, rows, current_depth + 1, max_depth)
129
+ process_columns(col[:columns], rows, current_depth + 1, max_depth)
163
130
  else
164
- raw_styling = col[:column_styling] || {}
165
- header_alignment = raw_styling[:header_alignment]
131
+ raw_styling = col[:column_styling] || {}
132
+ header_alignment = raw_styling[:header_alignment]
166
133
 
167
134
  colspan = 1
168
- cell_hash = {
135
+ rows[current_depth] << {
169
136
  label: col[:label],
170
137
  colspan: colspan,
171
138
  accessor: col[:accessor],
@@ -173,8 +140,6 @@ module Playbook
173
140
  is_last_in_group: is_last && current_depth.positive?,
174
141
  header_alignment: header_alignment,
175
142
  }
176
- cell_hash[:id] = col[:id] if col[:id].present?
177
- rows[current_depth] << cell_hash
178
143
  end
179
144
  end
180
145
  end
@@ -189,15 +154,11 @@ module Playbook
189
154
  max_depth = compute_max_depth(column_definitions)
190
155
 
191
156
  column_definitions.map do |col|
192
- if col[:columns]
193
- nested_columns = col[:columns]
194
- wrapped = {
157
+ if col.key?(:columns)
158
+ {
195
159
  label: col[:label],
196
- columns: wrap_leaf_columns(nested_columns),
160
+ columns: wrap_leaf_columns(col[:columns]),
197
161
  }
198
- wrapped[:id] = col[:id] if col[:id].present?
199
- wrapped[:header] = col[:header] if col[:header].present?
200
- wrapped
201
162
  else
202
163
  # For leaf columns, wrap with empty labels up to max depth to get proper structure
203
164
  wrap_leaf_column(col, max_depth)
@@ -212,7 +173,6 @@ module Playbook
212
173
  sort_menu: col[:sort_menu] || nil,
213
174
  column_styling: col[:column_styling] || {},
214
175
  }
215
- wrapped[:id] = col[:id] if col[:id].present?
216
176
  (max_depth - 1).times do
217
177
  wrapped = { label: "", columns: [wrapped] }
218
178
  end
@@ -220,41 +180,11 @@ module Playbook
220
180
  end
221
181
 
222
182
  def find_column_def_by_accessor(defs, target_accessor)
223
- return nil if target_accessor.blank?
224
-
225
183
  defs.each do |col|
226
- col_accessor = col[:accessor]
227
- next if col_accessor.blank?
228
-
229
- return col if col_accessor.to_s == target_accessor.to_s
230
-
231
- nested_columns = col[:columns]
232
- if nested_columns.is_a?(Array)
233
- found = find_column_def_by_accessor(nested_columns, target_accessor)
234
- return found if found
235
- end
236
- end
237
- nil
238
- end
239
-
240
- def find_column_def_by_id(defs, target_id)
241
- return nil if target_id.blank?
242
-
243
- defs.each do |col|
244
- col_id = col[:id]
245
-
246
- return col if col_id.present? && col_id.to_s == target_id.to_s
247
-
248
- # Recursively search nested columns, even if current col has no id or doesn't match
249
- nested_columns = col[:columns]
250
-
251
- next unless nested_columns.present?
252
-
253
- # Convert to array if needed (for edge cases where is_a?(Array) might fail)
254
- array_columns = Array(nested_columns)
184
+ return col if col[:accessor] == target_accessor
255
185
 
256
- if array_columns.any?
257
- found = find_column_def_by_id(array_columns, target_id)
186
+ if col[:columns].is_a?(Array)
187
+ found = find_column_def_by_accessor(col[:columns], target_accessor)
258
188
  return found if found
259
189
  end
260
190
  end
@@ -39,7 +39,7 @@ module Playbook
39
39
  end
40
40
 
41
41
  def classname
42
- generate_classname("pb_table_tr", "pb-bg-row-white", subrow_depth_classname, separator: " ")
42
+ generate_classname("pb_table_tr", "bg-white", subrow_depth_classname, separator: " ")
43
43
  end
44
44
 
45
45
  def td_classname(column, index)
@@ -79,44 +79,15 @@ module Playbook
79
79
  cell_background_color(column).present?
80
80
  end
81
81
 
82
- def cell_font_color(column)
83
- return nil unless column[:accessor].present?
84
-
85
- orig_def = find_column_def_by_accessor(column_definitions, column[:accessor])
86
- if orig_def && orig_def[:column_styling].is_a?(Hash) && orig_def[:column_styling][:font_color].present?
87
- font_color = orig_def[:column_styling][:font_color]
88
- if font_color.respond_to?(:call)
89
- font_color.call(row)
90
- else
91
- font_color
92
- end
93
- end
94
- end
95
-
96
82
  # Uses a regular table/table_cell component if there is no custom background color; if there is a cell_background_color uses a background component with tag "td"
97
83
  def cell_component_info(column, index, bg_color, font_color)
98
- column_font_color = cell_font_color(column)
99
- effective_font_color = column_font_color || font_color
100
-
101
84
  if has_custom_background_color?(column)
102
85
  custom_bg_color = cell_background_color(column)
103
86
  component_name = "background"
104
- component_props = {
105
- background_color: custom_bg_color,
106
- tag: "td",
107
- classname: td_classname(column, index),
108
- }
109
- component_props[:html_options] = { style: { color: effective_font_color } } if effective_font_color.present?
87
+ component_props = { background_color: custom_bg_color, tag: "td", classname: td_classname(column, index) }
110
88
  else
111
89
  component_name = "table/table_cell"
112
- style_hash = { "background-color": bg_color }
113
- style_hash[:color] = effective_font_color if effective_font_color.present?
114
- component_props = {
115
- html_options: {
116
- style: style_hash,
117
- },
118
- classname: td_classname(column, index),
119
- }
90
+ component_props = { html_options: { style: { "background-color": bg_color, color: font_color } }, classname: td_classname(column, index) }
120
91
  end
121
92
 
122
93
  { name: component_name, props: component_props }
@@ -1,11 +1,3 @@
1
- <%
2
- html_options_style = ""
3
- if object.html_options[:style].is_a?(Hash)
4
- html_options_style = object.html_options[:style].map { |k, v| "#{k.to_s.tr('_', '-')}: #{v}" }.join("; ")
5
- elsif object.html_options[:style].is_a?(String)
6
- html_options_style = object.html_options[:style]
7
- end
8
- %>
9
1
  <% if object.image_url.present? %>
10
2
  <%= pb_content_tag(object.tag,
11
3
  style: "background-image: url('#{object.image_url}');
@@ -17,8 +9,8 @@
17
9
  <% end %>
18
10
  <% else %>
19
11
  <%= pb_content_tag(object.tag,
20
- style: "#{object.custom_background_color}#{html_options_style.present? ? "; #{html_options_style}" : ""}"
12
+ style: object.custom_background_color
21
13
  ) do %>
22
14
  <%= content.presence %>
23
15
  <% end %>
24
- <% end %>
16
+ <% end %>
@@ -1 +1 @@
1
- Category colors can be passed into the background kit. Values `category_1` to `category_21` are accepted. List of all category and status colors can be viewed <a href="https://playbook.powerapp.cloud/tokens/colors" target="_blank">here</a>.
1
+ Category colors can be passed into the background kit. Values `category_1` to `category_21` are accepted. List of all category and status colors can be viewed <a href="https://playbook.powerapp.cloud/visual_guidelines" target="_blank">here</a>.
@@ -20,12 +20,11 @@ type BadgeProps = {
20
20
  onTouchEnd?: React.TouchEventHandler<HTMLSpanElement>,
21
21
  },
22
22
  data?: {[key: string]: string},
23
- htmlOptions?: {[key: string]: string | number | boolean | (() => void) | ((event: any) => void) | any},
23
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
24
24
  id?: string,
25
25
  removeIcon?: boolean,
26
26
  removeOnClick?: React.MouseEventHandler<HTMLSpanElement>,
27
27
  rounded?: boolean,
28
- tabIndex?: number,
29
28
  text?: string,
30
29
  variant?: "error" | "info" | "neutral" | "notification" | "notificationError" | "primary" | "success" | "warning",
31
30
  } & GlobalProps
@@ -40,7 +39,6 @@ const Badge = (props: BadgeProps): React.ReactElement => {
40
39
  removeIcon = false,
41
40
  removeOnClick,
42
41
  rounded = false,
43
- tabIndex,
44
42
  text,
45
43
  variant = 'neutral',
46
44
  } = props
@@ -63,7 +61,6 @@ const Badge = (props: BadgeProps): React.ReactElement => {
63
61
  {...htmlProps}
64
62
  className={css}
65
63
  id={id}
66
- tabIndex={tabIndex}
67
64
  >
68
65
  <span>
69
66
  {text}
@@ -112,16 +112,3 @@ test('displays notification variants', () => {
112
112
  cleanup()
113
113
  })
114
114
  })
115
-
116
- test('should allow tabIndex to be set', () => {
117
- render(
118
- <Badge
119
- data={{ testid: testId }}
120
- tabIndex={0}
121
- text="+1"
122
- />
123
- )
124
-
125
- const kit = screen.getByTestId(testId)
126
- expect(kit).toHaveAttribute('tabIndex', '0')
127
- })
@@ -1 +1 @@
1
- Add a background color by passing the color name to background. List of all colors can be viewed <a href="https://playbook.powerapp.cloud/tokens/colors" target="_blank">here</a> under Product Colors and Status: Subtle Variations.
1
+ Add a background color by passing the color name to background. List of all colors can be viewed <a href="https://playbook.powerapp.cloud/visual_guidelines" target="_blank">here</a> under Product Colors and Status: Subtle Variations.
@@ -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/visual_guidelines/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/visual_guidelines/colors" target="_blank">here</a>.
@@ -1 +1 @@
1
- Card can leverage the max-width property. Learn more in our <a href="https://playbook.powerapp.cloud/global_props/max_width" target="_blank">visual guidelines.</a>
1
+ Card can leverage the max-width property. Learn more in our <a href="https://playbook.powerapp.cloud/visual_guidelines" target="_blank">visual guidelines.</a>