playbook_ui 14.11.1.pre.alpha.PBNTR769sticky5359 → 14.11.1.pre.alpha.PBNTR798datepickerturbo5537

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 (68) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +0 -6
  3. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_control.md +2 -2
  4. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -1
  5. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +1 -2
  6. data/app/pb_kits/playbook/pb_button/button.html.erb +2 -3
  7. data/app/pb_kits/playbook/pb_checkbox/checkbox.html.erb +1 -6
  8. data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +24 -16
  9. data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +2 -0
  10. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default_date.md +1 -1
  11. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_turbo_frames.html.erb +13 -0
  12. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_turbo_frames_rails.md +3 -0
  13. data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +1 -0
  14. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_list_rails.html.erb +3 -9
  15. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_list_rails.md +5 -0
  16. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_selectable_list_rails.html.erb +38 -0
  17. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_selectable_list_rails.md +3 -0
  18. data/app/pb_kits/playbook/pb_draggable/docs/example.yml +1 -0
  19. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subtle_variant.md +1 -1
  20. data/app/pb_kits/playbook/pb_dropdown/dropdown.html.erb +7 -12
  21. data/app/pb_kits/playbook/pb_dropdown/dropdown_container.html.erb +9 -14
  22. data/app/pb_kits/playbook/pb_dropdown/dropdown_option.html.erb +6 -11
  23. data/app/pb_kits/playbook/pb_dropdown/dropdown_trigger.html.erb +8 -14
  24. data/app/pb_kits/playbook/pb_list/item.html.erb +30 -8
  25. data/app/pb_kits/playbook/pb_list/item.rb +7 -0
  26. data/app/pb_kits/playbook/pb_list/list.html.erb +31 -11
  27. data/app/pb_kits/playbook/pb_list/list.rb +4 -0
  28. data/app/pb_kits/playbook/pb_loading_inline/_loading_inline.tsx +6 -1
  29. data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +30 -12
  30. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_format.html.erb +15 -0
  31. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_format.jsx +24 -0
  32. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_format.md +1 -0
  33. data/app/pb_kits/playbook/pb_phone_number_input/docs/example.yml +3 -1
  34. data/app/pb_kits/playbook/pb_phone_number_input/docs/index.js +1 -0
  35. data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.rb +3 -0
  36. data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.test.js +20 -1
  37. data/app/pb_kits/playbook/pb_radio/_radio.scss +12 -8
  38. data/app/pb_kits/playbook/pb_radio/docs/_radio_custom_children.jsx +8 -3
  39. data/app/pb_kits/playbook/pb_selectable_list/selectable_list.html.erb +17 -3
  40. data/app/pb_kits/playbook/pb_selectable_list/selectable_list.rb +3 -0
  41. data/app/pb_kits/playbook/pb_selectable_list/selectable_list_item.html.erb +11 -4
  42. data/app/pb_kits/playbook/pb_selectable_list/selectable_list_item.rb +3 -0
  43. data/app/pb_kits/playbook/pb_table/_table.tsx +2 -3
  44. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns.html.erb +74 -0
  45. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns_rails.md +3 -0
  46. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns_rails.md +2 -2
  47. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns.html.erb +74 -0
  48. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns_rails.md +3 -0
  49. data/app/pb_kits/playbook/pb_table/docs/example.yml +2 -0
  50. data/app/pb_kits/playbook/pb_table/index.ts +93 -34
  51. data/app/pb_kits/playbook/pb_table/styles/_scroll.scss +6 -5
  52. data/app/pb_kits/playbook/pb_table/table.html.erb +1 -1
  53. data/app/pb_kits/playbook/pb_table/table.rb +17 -2
  54. data/app/pb_kits/playbook/pb_table/utilities/addDataTitle.ts +22 -0
  55. data/app/pb_kits/playbook/pb_timeline/_timeline.scss +30 -30
  56. data/dist/chunks/{_typeahead-BNULwihE.js → _typeahead-TN5aDUj9.js} +2 -2
  57. data/dist/chunks/_weekday_stacked-BcnpLG66.js +45 -0
  58. data/dist/chunks/{lib-B7sgJtGS.js → lib-OFT985dg.js} +2 -2
  59. data/dist/chunks/{pb_form_validation-C5Cc0-1v.js → pb_form_validation-CrsXd1-Y.js} +1 -1
  60. data/dist/chunks/vendor.js +1 -1
  61. data/dist/playbook-doc.js +1 -1
  62. data/dist/playbook-rails-react-bindings.js +1 -1
  63. data/dist/playbook-rails.js +1 -1
  64. data/dist/playbook.css +1 -1
  65. data/lib/playbook/version.rb +1 -1
  66. metadata +33 -7
  67. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header_responsive.jsx +0 -52
  68. data/dist/chunks/_weekday_stacked-BKWemDAe.js +0 -45
@@ -0,0 +1,15 @@
1
+ <%= pb_rails("phone_number_input", props: {
2
+ id: "phone_number_input",
3
+ format_as_you_type: true
4
+ }) %>
5
+
6
+ <%= pb_rails("button", props: {id: "clickable", text: "Save Phone Number"}) %>
7
+
8
+ <%= javascript_tag do %>
9
+ document.querySelector('#clickable').addEventListener('click', () => {
10
+ const formattedPhoneNumber = document.querySelector('#phone_number_input').value
11
+ const unformattedPhoneNumber = formattedPhoneNumber.replace(/\D/g, "")
12
+
13
+ alert(`Formatted: ${formattedPhoneNumber}. Unformatted: ${unformattedPhoneNumber}`)
14
+ })
15
+ <% end %>
@@ -0,0 +1,24 @@
1
+ import React, { useState } from "react";
2
+ import { PhoneNumberInput, Body } from "playbook-ui";
3
+
4
+ const PhoneNumberInputFormat = (props) => {
5
+ const [phoneNumber, setPhoneNumber] = useState("");
6
+
7
+ const handleOnChange = ({ number }) => {
8
+ setPhoneNumber(number);
9
+ };
10
+
11
+ return (
12
+ <>
13
+ <PhoneNumberInput
14
+ formatAsYouType
15
+ id="format"
16
+ onChange={handleOnChange}
17
+ {...props}
18
+ />
19
+ {phoneNumber && <Body>Unformatted number: {phoneNumber}</Body>}
20
+ </>
21
+ );
22
+ };
23
+
24
+ export default PhoneNumberInputFormat;
@@ -0,0 +1 @@
1
+ NOTE: the `number` in the React `onChange` event will not include formatting (no spaces, dashes, and parentheses). For Rails, the `value` will include formatting and its value must be sanitized manually.
@@ -8,10 +8,12 @@ examples:
8
8
  - phone_number_input_validation: Form Validation
9
9
  - phone_number_input_clear_field: Clearing the Input Field
10
10
  - phone_number_input_access_input_element: Accessing the Input Element
11
+ - phone_number_input_format: Format as You Type
11
12
 
12
13
  rails:
13
14
  - phone_number_input_default: Default
14
15
  - phone_number_input_preferred_countries: Preferred Countries
15
16
  - phone_number_input_initial_country: Initial Country
16
17
  - phone_number_input_only_countries: Limited Countries
17
- - phone_number_input_validation: Form Validation
18
+ - phone_number_input_validation: Form Validation
19
+ - phone_number_input_format: Format as You Type
@@ -5,3 +5,4 @@ export { default as PhoneNumberInputOnlyCountries } from './_phone_number_input_
5
5
  export { default as PhoneNumberInputValidation } from './_phone_number_input_validation'
6
6
  export { default as PhoneNumberInputClearField } from './_phone_number_input_clear_field'
7
7
  export { default as PhoneNumberInputAccessInputElement } from './_phone_number_input_access_input_element'
8
+ export { default as PhoneNumberInputFormat } from './_phone_number_input_format'
@@ -21,6 +21,8 @@ module Playbook
21
21
  default: ""
22
22
  prop :value, type: Playbook::Props::String,
23
23
  default: ""
24
+ prop :format_as_you_type, type: Playbook::Props::Boolean,
25
+ default: false
24
26
 
25
27
  def classname
26
28
  generate_classname("pb_phone_number_input")
@@ -32,6 +34,7 @@ module Playbook
32
34
  dark: dark,
33
35
  disabled: disabled,
34
36
  error: error,
37
+ formatAsYouType: format_as_you_type,
35
38
  initialCountry: initial_country,
36
39
  label: label,
37
40
  name: name,
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { render, screen } from "../utilities/test-utils";
2
+ import { render, screen, act } from "../utilities/test-utils";
3
3
  import PhoneNumberInput from "./_phone_number_input";
4
4
 
5
5
  const testId = "phoneNumberInput";
@@ -120,3 +120,22 @@ test("should trigger callback", () => {
120
120
 
121
121
  expect(handleOnValidate).toBeCalledWith(true)
122
122
  });
123
+
124
+ test("should format phone number as '555-555-5555' with formatAsYouType and 'us' country", () => {
125
+ const props = {
126
+ initialCountry: 'us',
127
+ formatAsYouType: true,
128
+ id: testId,
129
+ };
130
+
131
+ render(<PhoneNumberInput {...props} />);
132
+
133
+ const input = screen.getByRole("textbox");
134
+
135
+ act(() => {
136
+ input.value = "5555555555";
137
+ input.dispatchEvent(new Event('input', { bubbles: true }));
138
+ });
139
+
140
+ expect(input.value).toBe("555-555-5555");
141
+ });
@@ -4,7 +4,7 @@
4
4
  @import "../pb_body/body";
5
5
  @import "../tokens/transition";
6
6
 
7
- [class^=pb_radio_kit] {
7
+ [class^="pb_radio_kit"] {
8
8
  display: inline-flex;
9
9
  cursor: pointer;
10
10
 
@@ -16,10 +16,11 @@
16
16
  border-radius: 1000px;
17
17
  border: 2px solid $border_light;
18
18
  margin-right: $space_xs;
19
- transition: background $transition_default ease, box-shadow $transition_default ease, border-color $transition_default ease;
19
+ transition: background $transition_default ease,
20
+ box-shadow $transition_default ease, border-color $transition_default ease;
20
21
  }
21
22
 
22
- @media (hover:hover) {
23
+ @media (hover: hover) {
23
24
  &:hover .pb_radio_button {
24
25
  background-color: $bg_light;
25
26
  border-color: $border_light;
@@ -52,14 +53,14 @@
52
53
  }
53
54
  }
54
55
 
55
- &:disabled:checked + .pb_radio_button{
56
+ &:disabled:checked + .pb_radio_button {
56
57
  cursor: not-allowed;
57
58
  background-color: $white;
58
59
  border: 6px solid $neutral;
59
60
  }
60
61
  }
61
62
 
62
- &[class*=vertical] {
63
+ &[class*="vertical"] {
63
64
  flex-direction: column;
64
65
  align-items: center;
65
66
  .pb_radio_button {
@@ -80,7 +81,7 @@
80
81
  }
81
82
  &:checked {
82
83
  & ~ .pb_radio_button {
83
- border: 6px solid $primary;
84
+ border: 6px solid $active_dark;
84
85
  }
85
86
  }
86
87
 
@@ -103,10 +104,10 @@
103
104
  }
104
105
  }
105
106
 
106
- @media (hover:hover) {
107
+ @media (hover: hover) {
107
108
  &:hover {
108
109
  .pb_radio_button {
109
- background-color: rgba($white,.10);
110
+ background-color: rgba($white, 0.1);
110
111
  border-color: $border_dark;
111
112
  }
112
113
  }
@@ -115,6 +116,9 @@
115
116
  > .pb_radio_button {
116
117
  border-color: $error_dark;
117
118
  }
119
+ > .pb_body_kit_negative {
120
+ color: $error_dark;
121
+ }
118
122
  }
119
123
  }
120
124
  &.error {
@@ -29,6 +29,7 @@ const RadioChildren = (props) => {
29
29
  marginBottom="none"
30
30
  minWidth="xs"
31
31
  options={options}
32
+ {...props}
32
33
  />
33
34
  </Radio>
34
35
  <Radio
@@ -40,10 +41,11 @@ const RadioChildren = (props) => {
40
41
  value="Typeahead"
41
42
  {...props}
42
43
  >
43
- <Typeahead
44
+ <Typeahead
44
45
  marginBottom="none"
45
46
  minWidth="xs"
46
47
  options={options}
48
+ {...props}
47
49
  />
48
50
  </Radio>
49
51
  <Radio
@@ -54,9 +56,12 @@ const RadioChildren = (props) => {
54
56
  value="Typography"
55
57
  {...props}
56
58
  >
57
- <Title text="Custom Typography" />
59
+ <Title
60
+ text="Custom Typography"
61
+ {...props}
62
+ />
58
63
  </Radio>
59
64
  </div>
60
65
  )
61
66
  }
62
- export default RadioChildren
67
+ export default RadioChildren
@@ -4,9 +4,23 @@
4
4
  data: object.data,
5
5
  id: object.id,
6
6
  **combined_html_options) do %>
7
- <%= pb_rails("list") do %>
8
- <% object.items.each do |item| %>
9
- <%= pb_rails("selectable_list/selectable_list_item", props: item.merge(variant: object.variant, id: object.get_id(item)) )%>
7
+ <% if enable_drag %>
8
+ <%= pb_rails("draggable", props: {initial_items: object.items}) do %>
9
+ <%= pb_rails("draggable/draggable_container") do %>
10
+ <%= pb_rails("list", props: {ordered: false}) do %>
11
+ <% object.items.each do |item| %>
12
+ <%= pb_rails("draggable/draggable_item", props: {drag_id: item[:drag_id]}) do %>
13
+ <%= pb_rails("selectable_list/selectable_list_item", props: item.merge(variant: object.variant, id: object.get_id(item), drag_id: item[:drag_id]) )%>
14
+ <% end %>
15
+ <% end %>
16
+ <% end %>
17
+ <% end %>
18
+ <% end %>
19
+ <% else %>
20
+ <%= pb_rails("list") do %>
21
+ <% object.items.each do |item| %>
22
+ <%= pb_rails("selectable_list/selectable_list_item", props: item.merge(variant: object.variant, id: object.get_id(item)) )%>
23
+ <% end %>
10
24
  <% end %>
11
25
  <% end %>
12
26
  <% end %>
@@ -14,6 +14,9 @@ module Playbook
14
14
  prop :items, type: Playbook::Props::Array,
15
15
  default: []
16
16
 
17
+ prop :enable_drag, type: Playbook::Props::Boolean,
18
+ default: false
19
+
17
20
  def classname
18
21
  generate_classname("pb_selectable_list_kit")
19
22
  end
@@ -4,6 +4,13 @@
4
4
  data: object.data,
5
5
  id: object.id,
6
6
  **combined_html_options) do %>
7
+ <% if object.drag_id && object.drag_handle %>
8
+ <span style="vertical-align: middle;">
9
+ <%= pb_rails("body") do %>
10
+ <svg width="auto" height="auto" viewBox="0 0 31 25" fill="none" xmlns="http://www.w3.org/2000/svg" color="currentColor" class="pb_custom_icon svg-inline--fa vertical_align_middle svg_fw"><path d="M12.904 6.355a1.48 1.48 0 01-1.5-1.5c0-.796.656-1.5 1.5-1.5.797 0 1.5.704 1.5 1.5 0 .844-.703 1.5-1.5 1.5zm0 7.5a1.48 1.48 0 01-1.5-1.5c0-.796.656-1.5 1.5-1.5.797 0 1.5.704 1.5 1.5 0 .844-.703 1.5-1.5 1.5zm1.5 6c0 .844-.703 1.5-1.5 1.5a1.48 1.48 0 01-1.5-1.5c0-.796.656-1.5 1.5-1.5.797 0 1.5.704 1.5 1.5zm4.5-13.5a1.48 1.48 0 01-1.5-1.5c0-.796.657-1.5 1.5-1.5.797 0 1.5.704 1.5 1.5 0 .844-.703 1.5-1.5 1.5zm1.5 6c0 .844-.703 1.5-1.5 1.5a1.48 1.48 0 01-1.5-1.5c0-.796.657-1.5 1.5-1.5.797 0 1.5.704 1.5 1.5zm-1.5 9a1.48 1.48 0 01-1.5-1.5c0-.796.657-1.5 1.5-1.5.797 0 1.5.704 1.5 1.5 0 .844-.703 1.5-1.5 1.5z" fill="#242B42"></path></svg>
11
+ <% end %>
12
+ </span>
13
+ <% end %>
7
14
  <% if object.variant == "radio"%>
8
15
  <%= pb_rails("radio", props: { text: object.text, checked: object.checked, input_options: object.input_options } ) %>
9
16
  <% if content.present? %>
@@ -19,10 +26,10 @@
19
26
  <% if object.variant == "checkbox"%>
20
27
  <script>
21
28
  var checkboxElement = document.querySelector("#<%=object.id%> input[type=checkbox]")
22
-
29
+
23
30
  checkboxElement.addEventListener("change", (evt) => {
24
31
  var listItemElement = document.querySelector("#<%=object.id%>")
25
-
32
+
26
33
  if (evt.target.checked) {
27
34
  listItemElement.classList.add("checked_item");
28
35
  } else {
@@ -34,9 +41,9 @@
34
41
  <script>
35
42
  var radioElement = document.querySelector("#<%=object.id%> input[type=radio]")
36
43
 
37
- radioElement.addEventListener("change", () => {
44
+ radioElement.addEventListener("change", () => {
38
45
  var radios = radioElement.closest("ul").querySelectorAll("input[type=radio]")
39
-
46
+
40
47
  radios.forEach((radio) => {
41
48
  if (radio.checked) {
42
49
  radio.closest("li").classList.add("checked_item");
@@ -6,6 +6,9 @@ module Playbook
6
6
  prop :tabindex
7
7
  prop :checked, type: Playbook::Props::Boolean,
8
8
  default: false
9
+ prop :drag_handle, type: Playbook::Props::Boolean,
10
+ default: true
11
+ prop :drag_id, type: Playbook::Props::String
9
12
  prop :name, type: Playbook::Props::String
10
13
  prop :text, type: Playbook::Props::String
11
14
  prop :value, type: Playbook::Props::String
@@ -2,7 +2,6 @@ import React, { useEffect } from 'react'
2
2
  import classnames from 'classnames'
3
3
  import { buildAriaProps, buildDataProps, buildHtmlProps } from '../utilities/props'
4
4
  import { globalProps, GlobalProps, globalInlineProps } from '../utilities/globalProps'
5
- import PbTable from '.'
6
5
  import {
7
6
  TableHead,
8
7
  TableHeader,
@@ -10,6 +9,7 @@ import {
10
9
  TableRow,
11
10
  TableCell,
12
11
  } from "./subcomponents";
12
+ import { addDataTitle } from './utilities/addDataTitle'
13
13
 
14
14
  type TableProps = {
15
15
  aria?: { [key: string]: string },
@@ -196,8 +196,7 @@ const Table = (props: TableProps): React.ReactElement => {
196
196
  }, [stickyRightColumn]);
197
197
 
198
198
  useEffect(() => {
199
- const instance = new PbTable()
200
- instance.connect()
199
+ addDataTitle()
201
200
  }, [])
202
201
 
203
202
  return (
@@ -0,0 +1,74 @@
1
+ <%= pb_rails("table", props: { size: "md", responsive: "scroll", sticky_left_column: ["a"], sticky_right_column: ["b"] }) do %>
2
+ <thead>
3
+ <tr>
4
+ <th id="a">Column 1</th>
5
+ <th>Column 2</th>
6
+ <th>Column 3</th>
7
+ <th>Column 4</th>
8
+ <th>Column 5</th>
9
+ <th>Column 6</th>
10
+ <th>Column 7</th>
11
+ <th>Column 8</th>
12
+ <th>Column 9</th>
13
+ <th>Column 10</th>
14
+ <th>Column 11</th>
15
+ <th>Column 12</th>
16
+ <th>Column 13</th>
17
+ <th>Column 14</th>
18
+ <th id="b">Column 15</th>
19
+ </tr>
20
+ </thead>
21
+ <tbody>
22
+ <tr>
23
+ <td id="a">Value 1</td>
24
+ <td>Value 2</td>
25
+ <td>Value 3</td>
26
+ <td>Value 4</td>
27
+ <td>Value 5</td>
28
+ <td>Value 6</td>
29
+ <td>Value 7</td>
30
+ <td>Value 8</td>
31
+ <td>Value 9</td>
32
+ <td>Value 10</td>
33
+ <td>Value 11</td>
34
+ <td>Value 12</td>
35
+ <td>Value 13</td>
36
+ <td>Value 14</td>
37
+ <td id="b">Value 15</td>
38
+ </tr>
39
+ <tr>
40
+ <td id="a">Value 1</td>
41
+ <td>Value 2</td>
42
+ <td>Value 3</td>
43
+ <td>Value 4</td>
44
+ <td>Value 5</td>
45
+ <td>Value 6</td>
46
+ <td>Value 7</td>
47
+ <td>Value 8</td>
48
+ <td>Value 9</td>
49
+ <td>Value 10</td>
50
+ <td>Value 11</td>
51
+ <td>Value 12</td>
52
+ <td>Value 13</td>
53
+ <td>Value 14</td>
54
+ <td id="b">Value 15</td>
55
+ </tr>
56
+ <tr>
57
+ <td id="a">Value 1</td>
58
+ <td>Value 2</td>
59
+ <td>Value 3</td>
60
+ <td>Value 4</td>
61
+ <td>Value 5</td>
62
+ <td>Value 6</td>
63
+ <td>Value 7</td>
64
+ <td>Value 8</td>
65
+ <td>Value 9</td>
66
+ <td>Value 10</td>
67
+ <td>Value 11</td>
68
+ <td>Value 12</td>
69
+ <td>Value 13</td>
70
+ <td>Value 14</td>
71
+ <td id="b">Value 15</td>
72
+ </tr>
73
+ </tbody>
74
+ <% end %>
@@ -0,0 +1,3 @@
1
+ The `sticky_left_column` and `sticky_right_column` props can be used together on the same table as needed.
2
+
3
+ Please ensure that unique ids are used for all columns across multiple tables. Using the same columns ids on multiple tables can lead to issues when using props.
@@ -1,3 +1,3 @@
1
- The `stickyLeftColumn` prop expects an array of the column ids you want to be sticky. Make sure to add the corresponding id to the `<th>` and `<td>`.
1
+ The `sticky_left_column` prop expects an array of the column ids you want to be sticky. Make sure to add the corresponding id to the `<th>` and `<td>`.
2
2
 
3
- Please ensure that unique ids are used for all columns across multiple tables. Using the same columns ids on multiple tables can lead to issues when using the `stickyLeftColumn`.
3
+ Please ensure that unique ids are used for all columns across multiple tables. Using the same columns ids on multiple tables can lead to issues when using the `sticky_left_column`.
@@ -0,0 +1,74 @@
1
+ <%= pb_rails("table", props: { size: "md", responsive: "scroll", sticky_right_column: ["13", "14", "15"] }) do %>
2
+ <thead>
3
+ <tr>
4
+ <th>Column 1</th>
5
+ <th>Column 2</th>
6
+ <th>Column 3</th>
7
+ <th>Column 4</th>
8
+ <th>Column 5</th>
9
+ <th>Column 6</th>
10
+ <th>Column 7</th>
11
+ <th>Column 8</th>
12
+ <th>Column 9</th>
13
+ <th>Column 10</th>
14
+ <th>Column 11</th>
15
+ <th>Column 12</th>
16
+ <th id="13">Column 13</th>
17
+ <th id="14">Column 14</th>
18
+ <th id="15">Column 15</th>
19
+ </tr>
20
+ </thead>
21
+ <tbody>
22
+ <tr>
23
+ <td>Value 1</td>
24
+ <td>Value 2</td>
25
+ <td>Value 3</td>
26
+ <td>Value 4</td>
27
+ <td>Value 5</td>
28
+ <td>Value 6</td>
29
+ <td>Value 7</td>
30
+ <td>Value 8</td>
31
+ <td>Value 9</td>
32
+ <td>Value 10</td>
33
+ <td>Value 11</td>
34
+ <td>Value 12</td>
35
+ <td id="13">Value 13</td>
36
+ <td id="14">Value 14</td>
37
+ <td id="15">Value 15</td>
38
+ </tr>
39
+ <tr>
40
+ <td>Value 1</td>
41
+ <td>Value 2</td>
42
+ <td>Value 3</td>
43
+ <td>Value 4</td>
44
+ <td>Value 5</td>
45
+ <td>Value 6</td>
46
+ <td>Value 7</td>
47
+ <td>Value 8</td>
48
+ <td>Value 9</td>
49
+ <td>Value 10</td>
50
+ <td>Value 11</td>
51
+ <td>Value 12</td>
52
+ <td id="13">Value 13</td>
53
+ <td id="14">Value 14</td>
54
+ <td id="15">Value 15</td>
55
+ </tr>
56
+ <tr>
57
+ <td>Value 1</td>
58
+ <td>Value 2</td>
59
+ <td>Value 3</td>
60
+ <td>Value 4</td>
61
+ <td>Value 5</td>
62
+ <td>Value 6</td>
63
+ <td>Value 7</td>
64
+ <td>Value 8</td>
65
+ <td>Value 9</td>
66
+ <td>Value 10</td>
67
+ <td>Value 11</td>
68
+ <td>Value 12</td>
69
+ <td id="13">Value 13</td>
70
+ <td id="14">Value 14</td>
71
+ <td id="15">Value 15</td>
72
+ </tr>
73
+ </tbody>
74
+ <% end %>
@@ -0,0 +1,3 @@
1
+ The `sticky_right_column` prop works in the same way as the above `sticky_left_column` prop. It expects an array of the column ids you want to be sticky. Make sure to add the corresponding id to the `<th>` and `<td>`.
2
+
3
+ Please ensure that unique ids are used for all columns across multiple tables. Using the same columns ids on multiple tables can lead to issues when using the `sticky_right_column` prop.
@@ -5,6 +5,8 @@ examples:
5
5
  - table_lg: Large
6
6
  - table_sticky: Sticky Header
7
7
  - table_sticky_left_columns: Sticky Left Column
8
+ - table_sticky_right_columns: Sticky Right Column
9
+ - table_sticky_columns: Sticky Left and Right Columns
8
10
  - table_header: Table Header
9
11
  - table_alignment_row_rails: Row Alignment
10
12
  - table_alignment_column_rails: Cell Alignment