playbook_ui 16.0.0.pre.alpha.PLAY2744dropdownquickpickpt113758 → 16.0.0.pre.alpha.PLAY267213608

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 (73) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.html.erb +2 -2
  3. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.rb +0 -4
  4. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_inline_row_loading.md +2 -2
  5. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -1
  6. data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +1 -51
  7. data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +1 -1
  8. data/app/pb_kits/playbook/pb_advanced_table/table_header.rb +0 -34
  9. data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +1 -1
  10. data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +0 -19
  11. data/app/pb_kits/playbook/pb_background/docs/example.yml +0 -1
  12. data/app/pb_kits/playbook/pb_background/docs/index.js +0 -1
  13. data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +1 -3
  14. data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +1 -34
  15. data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +0 -4
  16. data/app/pb_kits/playbook/pb_dropdown/docs/index.js +1 -3
  17. data/app/pb_kits/playbook/pb_dropdown/dropdown.html.erb +1 -1
  18. data/app/pb_kits/playbook/pb_dropdown/dropdown.rb +0 -4
  19. data/app/pb_kits/playbook/pb_dropdown/dropdown.test.jsx +0 -94
  20. data/app/pb_kits/playbook/pb_dropdown/index.js +3 -47
  21. data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownTrigger.tsx +1 -2
  22. data/app/pb_kits/playbook/pb_form/docs/_form_with_required_indicator.html.erb +1 -3
  23. data/app/pb_kits/playbook/pb_multi_level_select/docs/example.yml +33 -35
  24. data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +0 -1
  25. data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx +6 -33
  26. data/app/pb_kits/playbook/pb_rich_text_editor/docs/example.yml +0 -3
  27. data/app/pb_kits/playbook/pb_rich_text_editor/docs/index.js +0 -2
  28. data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb +0 -5
  29. data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.test.js +18 -33
  30. data/app/pb_kits/playbook/pb_textarea/_textarea.tsx +11 -29
  31. data/app/pb_kits/playbook/pb_textarea/docs/_textarea_input_options.html.erb +0 -14
  32. data/app/pb_kits/playbook/pb_textarea/docs/_textarea_input_options.md +1 -3
  33. data/app/pb_kits/playbook/pb_textarea/docs/example.yml +1 -3
  34. data/app/pb_kits/playbook/pb_textarea/docs/index.js +0 -1
  35. data/app/pb_kits/playbook/pb_textarea/index.ts +5 -12
  36. data/app/pb_kits/playbook/pb_textarea/textarea.html.erb +6 -7
  37. data/app/pb_kits/playbook/pb_textarea/textarea.rb +0 -28
  38. data/app/pb_kits/playbook/pb_textarea/textarea.test.js +1 -18
  39. data/dist/chunks/{_pb_line_graph-BgKF_zz1.js → _pb_line_graph-hxi01lk7.js} +1 -1
  40. data/dist/chunks/{_typeahead-B9a6ZsEP.js → _typeahead-BgLnlhzP.js} +1 -1
  41. data/dist/chunks/{globalProps-BhVYCqRf.js → globalProps-DgYwLYNx.js} +1 -1
  42. data/dist/chunks/{lib-DD34ZrWL.js → lib-NLxTo8OB.js} +1 -1
  43. data/dist/chunks/vendor.js +2 -2
  44. data/dist/playbook-rails-react-bindings.js +1 -1
  45. data/dist/playbook-rails.js +1 -1
  46. data/dist/playbook.css +1 -1
  47. data/lib/playbook/version.rb +1 -1
  48. metadata +6 -31
  49. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_inline_row_loading_rails.html.erb +0 -64
  50. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_inline_row_loading_rails.md +0 -18
  51. data/app/pb_kits/playbook/pb_background/docs/_background_responsive.jsx +0 -30
  52. data/app/pb_kits/playbook/pb_background/docs/_background_responsive.md +0 -1
  53. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_blank_selection_rails.md +0 -3
  54. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_blank_selection_react.md +0 -3
  55. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_clearable.html.erb +0 -52
  56. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_clearable.jsx +0 -72
  57. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_clearable.md +0 -5
  58. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_placeholder.html.erb +0 -9
  59. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_placeholder.jsx +0 -33
  60. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_placeholder.md +0 -3
  61. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_input_display.html.erb +0 -74
  62. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_input_display.jsx +0 -87
  63. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_input_display.md +0 -3
  64. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_required_indicator.jsx +0 -35
  65. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_required_indicator.md +0 -3
  66. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_required_indicator.html.erb +0 -10
  67. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_required_indicator.jsx +0 -21
  68. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_required_indicator.md +0 -3
  69. data/app/pb_kits/playbook/pb_table/docs/_sections.yml +0 -68
  70. data/app/pb_kits/playbook/pb_textarea/docs/_textarea_required_indicator.html.erb +0 -5
  71. data/app/pb_kits/playbook/pb_textarea/docs/_textarea_required_indicator.jsx +0 -25
  72. data/app/pb_kits/playbook/pb_textarea/docs/_textarea_required_indicator.md +0 -3
  73. data/app/pb_kits/playbook/utilities/test/globalProps/globalProps.integration.test.js +0 -936
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 77d2aa38ac1c38d9be4fa1b827ac346255f9742aa6e4c4569845b3f8335c57cd
4
- data.tar.gz: e1034bf5c9ea8bc54b2e4c606f68dc0c0beea877674ac459aa767232bbdab299
3
+ metadata.gz: e6176ee8cfd1936b6e7b79e5716d8b099a74331977e5f3fcaba072943590ebd9
4
+ data.tar.gz: 7c2e3b2a2d0a7ee10c52de21dd6e66be1997f144dfb97e1cef4f653f6591e3ff
5
5
  SHA512:
6
- metadata.gz: fa2c94e31f5bacca5366fcf5c4438b0f740d85df8cf642af32b63ff588bf4f8c5b31b3016e981a44143068349b3ef833d1bd0a72c920d67d6fce157c11378cce
7
- data.tar.gz: f2a531ff9faca9f3524227c518482938e6c0ae648582befe352fcdfd3a11220c315b9a873e505ba8fd7bf4265b3d671c42d413606204405b76a74e35aa4dc4cb
6
+ metadata.gz: 5a362e44b418ef2a19d8861af43fe7671872d5396faa1cc04ee4b252ef59b29d7c46661175ecaec7a046924b280d4a29c2d1f6bbc605fe6dd026081362d74635
7
+ data.tar.gz: 1c8d077d1c087fcde6fb5c3da59580f3e674bdbf0fb26068c8c41be95bb1c8bdb92fb046e956f64ce16fd7c4cb6531ef3af07ade73010ec68ace747935a81b4c
@@ -11,8 +11,8 @@
11
11
  <% if content.present? %>
12
12
  <% content.presence %>
13
13
  <% else %>
14
- <%= pb_rails("advanced_table/table_header", props: { table_id: object.id, column_definitions: object.column_definitions, enable_toggle_expansion: object.enable_toggle_expansion, responsive: object.responsive, loading: object.loading, selectable_rows: object.selectable_rows, show_actions_bar: object.show_actions_bar, inline_row_loading: object.inline_row_loading, persist_toggle_expansion_button: object.persist_toggle_expansion_button, table_data: object.table_data }) %>
15
- <%= pb_rails("advanced_table/table_body", props: { table_id: object.id, table_data: object.table_data, column_definitions: object.column_definitions, responsive: object.responsive, loading: object.loading, selectable_rows: object.selectable_rows, enable_toggle_expansion: object.enable_toggle_expansion, row_styling: object.row_styling, inline_row_loading: object.inline_row_loading }) %>
14
+ <%= pb_rails("advanced_table/table_header", props: { table_id: object.id, column_definitions: object.column_definitions, enable_toggle_expansion: object.enable_toggle_expansion, responsive: object.responsive, loading: object.loading, selectable_rows: object.selectable_rows, show_actions_bar: object.show_actions_bar }) %>
15
+ <%= pb_rails("advanced_table/table_body", props: { table_id: object.id, table_data: object.table_data, column_definitions: object.column_definitions, responsive: object.responsive, loading: object.loading, selectable_rows: object.selectable_rows, enable_toggle_expansion: object.enable_toggle_expansion, row_styling: object.row_styling }) %>
16
16
  <% end %>
17
17
  <% end %>
18
18
  <% end %>
@@ -33,10 +33,6 @@ module Playbook
33
33
  default: false
34
34
  prop :row_styling, type: Playbook::Props::Array,
35
35
  default: []
36
- prop :inline_row_loading, type: Playbook::Props::Boolean,
37
- default: false
38
- prop :persist_toggle_expansion_button, type: Playbook::Props::Boolean,
39
- default: false
40
36
 
41
37
  def classname
42
38
  additional_classes = [
@@ -6,9 +6,9 @@ In the first Advanced Table in this code example, 2021 has an empty children arr
6
6
  This prop is set to `false` by default.
7
7
 
8
8
 
9
- ### persistToggleExpansionButton
9
+ ### persistToggleExpansion
10
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
11
 
12
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
13
 
14
- This prop is set to `false` by default and should only be used in conjunction with `inlineRowLoading`.
14
+ This prop is set to false by default and should only be used in conjunction with `inlineRowLoading`.
@@ -29,7 +29,6 @@ examples:
29
29
  - advanced_table_background_control_rails: Column Styling Background Color
30
30
  - advanced_table_background_colors_rails: Column Styling Individual Cell Background Color
31
31
  - advanced_table_column_border_color_rails: Column Group Border Color
32
- - advanced_table_inline_row_loading_rails: Inline Row Loading
33
32
 
34
33
 
35
34
  react:
@@ -25,8 +25,6 @@ module Playbook
25
25
  default: false
26
26
  prop :row_styling, type: Playbook::Props::Array,
27
27
  default: []
28
- prop :inline_row_loading, type: Playbook::Props::Boolean,
29
- default: false
30
28
 
31
29
  def flatten_columns(columns)
32
30
  columns.flat_map do |col|
@@ -71,24 +69,7 @@ module Playbook
71
69
  end
72
70
 
73
71
  # Additional class and data attributes needed for toggle logic
74
- output << pb_rails("advanced_table/table_row", props: { table_id: table_id, row: row, column_definitions: leaf_columns, depth: current_depth, collapsible_trail: collapsible_trail, classname: additional_classes, table_data_attributes: current_data_attributes, responsive: responsive, loading: loading, selectable_rows: selectable_rows, row_id: row[:id], enable_toggle_expansion: enable_toggle_expansion, row_styling: row_styling, last_row: last_row, immediate_parent_row_id: immediate_parent_row_id, inline_row_loading: inline_row_loading })
75
-
76
- # Render inline loading row when inline_row_loading is enabled and row has empty children
77
- if inline_row_loading
78
- children = row_children_for(row)
79
- if children.is_a?(::Array) && children.empty?
80
- max_depth = cell_accessors_length(column_definitions)
81
- if current_depth < max_depth
82
- loading_row_data_attributes = {
83
- advanced_table_content: "#{new_ancestor_ids.join('-')}-loading",
84
- row_depth: current_depth + 1,
85
- row_parent: "#{table_id}_#{row.object_id}",
86
- inline_loading_row: true,
87
- }
88
- output << render_inline_loading_row(leaf_columns.length, current_depth, loading_row_data_attributes)
89
- end
90
- end
91
- end
72
+ output << pb_rails("advanced_table/table_row", props: { table_id: table_id, row: row, column_definitions: leaf_columns, depth: current_depth, collapsible_trail: collapsible_trail, classname: additional_classes, table_data_attributes: current_data_attributes, responsive: responsive, loading: loading, selectable_rows: selectable_rows, row_id: row[:id], enable_toggle_expansion: enable_toggle_expansion, row_styling: row_styling, last_row: last_row, immediate_parent_row_id: immediate_parent_row_id })
92
73
 
93
74
  if row[:children].present?
94
75
  row[:children].each do |child_row|
@@ -123,37 +104,6 @@ module Playbook
123
104
  ""
124
105
  end
125
106
 
126
- # 3 helper methods for inline row loading
127
- def render_inline_loading_row(column_count, depth, data_attributes)
128
- padding_left = depth.zero? ? "0.5em" : "#{(depth + 1) * 2}em"
129
-
130
- content_tag(:tr, class: "toggle-content inline-loading-row", data: data_attributes) do
131
- content_tag(:td, colspan: column_count, style: "padding-left: #{padding_left}") do
132
- pb_rails("loading_inline")
133
- end
134
- end
135
- end
136
-
137
- def row_children_for(row)
138
- if row.respond_to?(:children)
139
- row.children
140
- elsif row.respond_to?(:[])
141
- row[:children] || row["children"]
142
- end
143
- end
144
-
145
- def cell_accessors_length(col_defs)
146
- first_col = col_defs.first
147
- return 0 unless first_col
148
-
149
- accessors = if first_col.respond_to?(:cellAccessors)
150
- first_col.cellAccessors
151
- elsif first_col.respond_to?(:[])
152
- first_col[:cellAccessors] || first_col["cellAccessors"]
153
- end
154
- accessors&.length || 0
155
- end
156
-
157
107
  private
158
108
 
159
109
  def has_grouped_headers?
@@ -14,7 +14,7 @@
14
14
  <%= object.render_select_all_checkbox %>
15
15
  <% end %>
16
16
  <% end %>
17
- <% if object.show_toggle_all_button? %>
17
+ <% if object.enable_toggle_expansion == "header" || object.enable_toggle_expansion == "all" %>
18
18
  <% if loading %>
19
19
  <div class="<%= object.loading ? 'loading-toggle-icon' : '' %>"></div>
20
20
  <% else %>
@@ -19,12 +19,6 @@ module Playbook
19
19
  default: false
20
20
  prop :show_actions_bar, type: Playbook::Props::Boolean,
21
21
  default: true
22
- prop :inline_row_loading, type: Playbook::Props::Boolean,
23
- default: false
24
- prop :persist_toggle_expansion_button, type: Playbook::Props::Boolean,
25
- default: false
26
- prop :table_data, type: Playbook::Props::Array,
27
- default: []
28
22
 
29
23
  def classname
30
24
  additional_classes = []
@@ -141,20 +135,6 @@ module Playbook
141
135
  original_def.dig(:column_styling, :header_font_color)
142
136
  end
143
137
 
144
- # Check if any row in the table has children
145
- def has_any_sub_rows?
146
- return false if table_data.blank?
147
-
148
- table_data.any? { |row| row_has_children?(row) }
149
- end
150
-
151
- # Determines if the toggle-all button should be shown in the header based on inline row loading and persist toggle expansion button props
152
- def show_toggle_all_button?
153
- return false unless enable_toggle_expansion == "header" || enable_toggle_expansion == "all"
154
-
155
- has_any_sub_rows? || (inline_row_loading && persist_toggle_expansion_button)
156
- end
157
-
158
138
  # Check if header has custom background color
159
139
  def has_custom_header_background_color?(cell)
160
140
  cell[:header_background_color].present?
@@ -337,20 +317,6 @@ module Playbook
337
317
  end
338
318
  nil
339
319
  end
340
-
341
- # 2 inline row loading helper methods
342
- def row_has_children?(row)
343
- children = row_children_for(row)
344
- children.present? && children.is_a?(::Array) && !children.empty?
345
- end
346
-
347
- def row_children_for(row)
348
- if row.respond_to?(:children)
349
- row.children
350
- elsif row.respond_to?(:[])
351
- row[:children] || row["children"]
352
- end
353
- end
354
320
  end
355
321
  end
356
322
  end
@@ -32,7 +32,7 @@
32
32
  <%= object.render_row_checkbox %>
33
33
  <% end %>
34
34
  <% end %>
35
- <% if object.show_expand_button? %>
35
+ <% if object.row[:children].present? %>
36
36
  <button
37
37
  id="<%= "#{object.table_id}_#{object.row.object_id}" %>"
38
38
  class="gray-icon expand-toggle-icon"
@@ -33,8 +33,6 @@ module Playbook
33
33
  default: false
34
34
  prop :immediate_parent_row_id, type: Playbook::Props::String,
35
35
  default: ""
36
- prop :inline_row_loading, type: Playbook::Props::Boolean,
37
- default: false
38
36
 
39
37
  def data
40
38
  Hash(prop(:data)).merge(table_data_attributes)
@@ -188,23 +186,6 @@ module Playbook
188
186
  end
189
187
  end
190
188
 
191
- # Determines if the row should show an expand button (true if row has children or inline_row_loading true and row has empty children array)
192
- def show_expand_button?
193
- children = row_children
194
- return true if children.present?
195
- return true if inline_row_loading && children.is_a?(::Array) && children.empty?
196
-
197
- false
198
- end
199
-
200
- def row_children
201
- if row.respond_to?(:children)
202
- row.children
203
- elsif row.respond_to?(:[])
204
- row[:children] || row["children"]
205
- end
206
- end
207
-
208
189
  private
209
190
 
210
191
  def custom_renderer_value(column, index)
@@ -20,4 +20,3 @@ examples:
20
20
  - background_category: Category
21
21
  - background_size: Size
22
22
  - background_overlay: Overlay
23
- - background_responsive: Responsive
@@ -7,4 +7,3 @@ export { default as BackgroundStatusSubtle } from './_background_status_subtle.j
7
7
  export { default as BackgroundCategory } from './_background_category.jsx'
8
8
  export { default as BackgroundSize } from './_background_size.jsx'
9
9
  export { default as BackgroundOverlay } from './_background_overlay.jsx'
10
- export { default as BackgroundResponsive } from './_background_responsive.jsx'
@@ -68,9 +68,7 @@
68
68
  .pb_dropdown_container {
69
69
  position: absolute;
70
70
  background-color: $white;
71
- overflow-y: auto;
72
- overflow-x: hidden;
73
- max-height: 18em;
71
+ overflow: hidden;
74
72
  box-shadow: $shadow_deep;
75
73
  border-radius: $border_rad_heavier;
76
74
  border: 1px solid $border_light;
@@ -36,7 +36,6 @@ type DropdownProps = {
36
36
  blankSelection?: string;
37
37
  children?: React.ReactChild[] | React.ReactChild | React.ReactElement[];
38
38
  className?: string;
39
- clearable?: boolean;
40
39
  customQuickPickDates?: CustomQuickPickDates;
41
40
  formPillProps?: GenericObject;
42
41
  dark?: boolean;
@@ -50,7 +49,6 @@ type DropdownProps = {
50
49
  multiSelect?: boolean;
51
50
  onSelect?: (arg: GenericObject) => null;
52
51
  options?: GenericObject;
53
- placeholder?: string;
54
52
  separators?: boolean;
55
53
  variant?: "default" | "subtle" | "quickpick";
56
54
  rangeEndsToday?: boolean;
@@ -76,7 +74,6 @@ let Dropdown = (props: DropdownProps, ref: any): React.ReactElement | null => {
76
74
  blankSelection = '',
77
75
  children,
78
76
  className,
79
- clearable = true,
80
77
  customQuickPickDates,
81
78
  dark = false,
82
79
  data = {},
@@ -90,7 +87,6 @@ let Dropdown = (props: DropdownProps, ref: any): React.ReactElement | null => {
90
87
  formPillProps,
91
88
  onSelect,
92
89
  options,
93
- placeholder,
94
90
  rangeEndsToday = false,
95
91
  controlsStartId,
96
92
  controlsEndId,
@@ -215,34 +211,6 @@ let Dropdown = (props: DropdownProps, ref: any): React.ReactElement | null => {
215
211
  }
216
212
  }, [isDropDownClosed]);
217
213
 
218
- // Auto-position dropdown above/below based on available space
219
- useEffect(() => {
220
- if (!isDropDownClosed && dropdownContainerRef.current) {
221
- const container = dropdownContainerRef.current;
222
- const wrapper = container.closest('.dropdown_wrapper') as HTMLElement;
223
- if (!wrapper) return;
224
-
225
- const wrapperRect = wrapper.getBoundingClientRect();
226
- const h = container.getBoundingClientRect().height || container.scrollHeight;
227
- const spaceBelow = window.innerHeight - wrapperRect.bottom;
228
- const spaceAbove = wrapperRect.top;
229
-
230
- // If not enough space below but enough space above, position above
231
- if (spaceBelow < h + 10 && spaceAbove >= h + 10) {
232
- container.style.top = "auto";
233
- container.style.bottom = "calc(100% + 5px)";
234
- container.style.marginTop = "0";
235
- container.style.marginBottom = "0";
236
- } else {
237
- // Default: position below
238
- container.style.top = "";
239
- container.style.bottom = "";
240
- container.style.marginTop = "";
241
- container.style.marginBottom = "";
242
- }
243
- }
244
- }, [isDropDownClosed, dropdownContainerRef]);
245
-
246
214
 
247
215
  const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
248
216
  setFilterItem(e.target.value);
@@ -407,7 +375,6 @@ let Dropdown = (props: DropdownProps, ref: any): React.ReactElement | null => {
407
375
  value={{
408
376
  activeStyle,
409
377
  autocomplete,
410
- clearable,
411
378
  dropdownContainerRef,
412
379
  filteredOptions,
413
380
  filterItem,
@@ -459,7 +426,7 @@ let Dropdown = (props: DropdownProps, ref: any): React.ReactElement | null => {
459
426
  </>
460
427
  ) : (
461
428
  <>
462
- <DropdownTrigger placeholder={placeholder} />
429
+ <DropdownTrigger />
463
430
  <DropdownContainer>
464
431
  {optionsWithBlankSelection &&
465
432
  optionsWithBlankSelection?.map((option: GenericObject) => (
@@ -21,9 +21,7 @@ examples:
21
21
  - dropdown_default_value: Default Value
22
22
  - dropdown_multi_select_with_default: Multi Select Default Value
23
23
  - dropdown_blank_selection: Blank Selection
24
- - dropdown_with_placeholder: Placeholder
25
24
  - dropdown_separators_hidden: Separators Hidden
26
- - dropdown_with_clearable: Clearable
27
25
  - dropdown_quickpick_rails: Quick Pick Variant
28
26
  - dropdown_quickpick_range_end_rails: Quick Pick Variant (Range Ends Today)
29
27
  - dropdown_quickpick_default_dates: Quick Pick Variant (Default Dates)
@@ -54,9 +52,7 @@ examples:
54
52
  - dropdown_default_value: Default Value
55
53
  - dropdown_multi_select_with_default: Multi Select Default Value
56
54
  - dropdown_blank_selection: Blank Selection
57
- - dropdown_with_placeholder: Placeholder
58
55
  - dropdown_clear_selection: Clear Selection
59
- - dropdown_with_clearable: Clearable
60
56
  - dropdown_separators_hidden: Separators Hidden
61
57
  - dropdown_with_external_control: useDropdown Hook
62
58
  - dropdown_quickpick: Quick Pick Variant
@@ -11,7 +11,6 @@ export { default as DropdownSubcomponentStructure } from './_dropdown_subcompone
11
11
  export { default as DropdownError } from './_dropdown_error.jsx'
12
12
  export { default as DropdownDefaultValue } from './_dropdown_default_value.jsx'
13
13
  export { default as DropdownBlankSelection } from './_dropdown_blank_selection.jsx'
14
- export { default as DropdownWithPlaceholder } from './_dropdown_with_placeholder.jsx'
15
14
  export { default as DropdownClearSelection } from './_dropdown_clear_selection.jsx'
16
15
  export { default as DropdownSubtleVariant } from './_dropdown_subtle_variant.jsx'
17
16
  export { default as DropdownSeparatorsHidden } from './_dropdown_separators_hidden.jsx'
@@ -28,5 +27,4 @@ export { default as DropdownQuickpick } from './_dropdown_quickpick.jsx'
28
27
  export { default as DropdownQuickpickRangeEnd } from './_dropdown_quickpick_range_end.jsx'
29
28
  export { default as DropdownQuickpickDefaultDates } from './_dropdown_quickpick_default_dates.jsx'
30
29
  export { default as DropdownQuickpickWithDatePickers } from './_dropdown_quickpick_with_date_pickers.jsx'
31
- export { default as DropdownQuickpickCustom } from './_dropdown_quickpick_custom.jsx'
32
- export { default as DropdownWithClearable } from './_dropdown_with_clearable.jsx'
30
+ export { default as DropdownQuickpickCustom } from './_dropdown_quickpick_custom.jsx'
@@ -18,7 +18,7 @@
18
18
  <%= content.presence %>
19
19
  <%= pb_rails("body", props: { status: "negative", text: object.error }) %>
20
20
  <% else %>
21
- <%= pb_rails("dropdown/dropdown_trigger", props:{ autocomplete: object.autocomplete, multi_select:object.multi_select, placeholder: object.placeholder }) %>
21
+ <%= pb_rails("dropdown/dropdown_trigger", props:{ autocomplete: object.autocomplete, multi_select:object.multi_select }) %>
22
22
  <%= pb_rails("dropdown/dropdown_container", props: { searchbar: object.searchbar }) do %>
23
23
  <% if options_with_blank.present? %>
24
24
  <% options_with_blank.each do |option| %>
@@ -36,8 +36,6 @@ module Playbook
36
36
  default: ""
37
37
  prop :controls_start_id, type: Playbook::Props::String,
38
38
  default: ""
39
- prop :clearable, type: Playbook::Props::Boolean,
40
- default: true
41
39
  prop :start_date_id, type: Playbook::Props::String,
42
40
  default: "start_date_id"
43
41
  prop :start_date_name, type: Playbook::Props::String,
@@ -46,14 +44,12 @@ module Playbook
46
44
  default: "end_date_id"
47
45
  prop :end_date_name, type: Playbook::Props::String,
48
46
  default: "end_date_name"
49
- prop :placeholder, type: Playbook::Props::String
50
47
 
51
48
  def data
52
49
  Hash(prop(:data)).merge(
53
50
  pb_dropdown: true,
54
51
  pb_dropdown_multi_select: multi_select,
55
52
  pb_dropdown_variant: variant,
56
- pb_dropdown_clearable: clearable,
57
53
  form_pill_props: form_pill_props.to_json,
58
54
  start_date_id: variant == "quickpick" ? start_date_id : nil,
59
55
  end_date_id: variant == "quickpick" ? end_date_id : nil,
@@ -122,80 +122,6 @@ test('generated placeholder prop', () => {
122
122
 
123
123
  })
124
124
 
125
- test('placeholder prop passed directly to Dropdown', () => {
126
- render(
127
- <Dropdown
128
- data={{ testid: testId }}
129
- options={options}
130
- placeholder="Choose a country"
131
- />
132
- )
133
-
134
- const kit = screen.getByTestId(testId)
135
- const trigger = kit.querySelector('.pb_dropdown_trigger')
136
- expect(trigger).toHaveTextContent('Choose a country')
137
- })
138
-
139
- test('placeholder works with default variant', () => {
140
- render(
141
- <Dropdown
142
- data={{ testid: testId }}
143
- options={options}
144
- placeholder="Select an option"
145
- variant="default"
146
- />
147
- )
148
-
149
- const kit = screen.getByTestId(testId)
150
- const trigger = kit.querySelector('.pb_dropdown_trigger')
151
- expect(trigger).toHaveTextContent('Select an option')
152
- })
153
-
154
- test('placeholder works with subtle variant', () => {
155
- render(
156
- <Dropdown
157
- data={{ testid: testId }}
158
- options={options}
159
- placeholder="Pick an option"
160
- separators={false}
161
- variant="subtle"
162
- />
163
- )
164
-
165
- const kit = screen.getByTestId(testId)
166
- expect(kit).toHaveClass('pb_dropdown_subtle_separators_hidden')
167
- const trigger = kit.querySelector('.pb_dropdown_trigger')
168
- expect(trigger).toHaveTextContent('Pick an option')
169
- })
170
-
171
- test('placeholder works with quickpick variant', () => {
172
- render(
173
- <Dropdown
174
- data={{ testid: testId }}
175
- placeholder="Select a date range"
176
- variant="quickpick"
177
- />
178
- )
179
-
180
- const kit = screen.getByTestId(testId)
181
- expect(kit).toHaveClass('pb_dropdown_quickpick')
182
- const trigger = kit.querySelector('.pb_dropdown_trigger')
183
- expect(trigger).toHaveTextContent('Select a date range')
184
- })
185
-
186
- test('placeholder shows default "Select..." when not provided', () => {
187
- render(
188
- <Dropdown
189
- data={{ testid: testId }}
190
- options={options}
191
- />
192
- )
193
-
194
- const kit = screen.getByTestId(testId)
195
- const trigger = kit.querySelector('.pb_dropdown_trigger')
196
- expect(trigger).toHaveTextContent('Select...')
197
- })
198
-
199
125
  test('generated label prop', () => {
200
126
  render (
201
127
  <Dropdown
@@ -540,27 +466,7 @@ test("quickpick clears selection when clicking X icon", () => {
540
466
  expect(trigger).toHaveTextContent("Select...")
541
467
  })
542
468
 
543
- test("quickpick hides clear icon when clearable is false", () => {
544
- render(
545
- <Dropdown
546
- clearable={false}
547
- data={{ testid: testId }}
548
- defaultValue="This Week"
549
- variant="quickpick"
550
- />
551
- )
552
-
553
- const kit = screen.getByTestId(testId)
554
- const trigger = kit.querySelector('.pb_dropdown_trigger')
555
-
556
- expect(trigger).toHaveTextContent("This Week")
557
-
558
- const clearIcon = kit.querySelector('[aria-label="times icon"]')
559
- expect(clearIcon).not.toBeInTheDocument()
560
- })
561
-
562
469
  test("quickpick returns date array values when option selected", () => {
563
- // eslint-disable-next-line react/no-multi-comp
564
470
  const TestComponent = () => {
565
471
  const [selected, setSelected] = useState(null)
566
472
  return (
@@ -48,7 +48,6 @@ export default class PbDropdown extends PbEnhancedElement {
48
48
  this.updatePills();
49
49
 
50
50
  this.clearBtn = this.element.querySelector(CLEAR_ICON_SELECTOR);
51
- this.isClearable = this.element.dataset.pbDropdownClearable !== "false";
52
51
  if (this.clearBtn) {
53
52
  this.clearBtn.style.display = "none";
54
53
  this.clearBtn.addEventListener("click", (e) => {
@@ -61,10 +60,6 @@ export default class PbDropdown extends PbEnhancedElement {
61
60
 
62
61
  updateClearButton() {
63
62
  if (!this.clearBtn) return;
64
- if (!this.isClearable) {
65
- this.clearBtn.style.display = "none";
66
- return;
67
- }
68
63
  const hasSelection = this.isMultiSelect
69
64
  ? this.selectedOptions.size > 0
70
65
  : Boolean(this.element.querySelector(DROPDOWN_INPUT).value);
@@ -116,43 +111,13 @@ export default class PbDropdown extends PbEnhancedElement {
116
111
  const el = this.target;
117
112
  el.style.height = "auto";
118
113
  requestAnimationFrame(() => {
119
- // Calculate 18em in pixels (matches SCSS max-height: 18em)
120
- const fontSize = parseFloat(getComputedStyle(el).fontSize) || 16;
121
- const maxHeight = fontSize * 18;
122
- const scrollHeight = el.scrollHeight;
123
- const newHeight = Math.min(scrollHeight, maxHeight);
114
+ const newHeight = el.scrollHeight + "px";
124
115
  el.offsetHeight; // force reflow
125
- el.style.height = newHeight + "px";
116
+ el.style.height = newHeight;
126
117
  });
127
118
  }
128
119
  }
129
120
 
130
- adjustDropdownPosition(container) {
131
- if (!container) return;
132
-
133
- const wrapper = this.element.querySelector(".dropdown_wrapper");
134
- if (!wrapper) return;
135
-
136
- const wrapperRect = wrapper.getBoundingClientRect();
137
- const h = container.getBoundingClientRect().height || container.scrollHeight;
138
- const spaceBelow = window.innerHeight - wrapperRect.bottom;
139
- const spaceAbove = wrapperRect.top;
140
-
141
- // If not enough space below but enough space above, position above
142
- if (spaceBelow < h + 10 && spaceAbove >= h + 10) {
143
- container.style.top = "auto";
144
- container.style.bottom = "calc(100% + 5px)";
145
- container.style.marginTop = "0";
146
- container.style.marginBottom = "0";
147
- } else {
148
- // Default: position below
149
- container.style.top = "";
150
- container.style.bottom = "";
151
- container.style.marginTop = "";
152
- container.style.marginBottom = "";
153
- }
154
- }
155
-
156
121
  handleSearch(term = "") {
157
122
  const lcTerm = term.toLowerCase();
158
123
  let hasMatch = false
@@ -400,16 +365,7 @@ export default class PbDropdown extends PbEnhancedElement {
400
365
  showElement(elem) {
401
366
  elem.classList.remove("close");
402
367
  elem.classList.add("open");
403
-
404
- // Calculate height respecting max-height constraint (18em)
405
- const fontSize = parseFloat(getComputedStyle(elem).fontSize) || 16;
406
- const maxHeight = fontSize * 18; // matches SCSS max-height: 18em
407
- const scrollHeight = elem.scrollHeight;
408
- const height = Math.min(scrollHeight, maxHeight);
409
- elem.style.height = height + "px";
410
-
411
- // Auto-position dropdown above if not enough space below
412
- this.adjustDropdownPosition(elem);
368
+ elem.style.height = elem.scrollHeight + "px";
413
369
  }
414
370
 
415
371
  hideElement(elem) {
@@ -44,7 +44,6 @@ const DropdownTrigger = (props: DropdownTriggerProps) => {
44
44
 
45
45
  const {
46
46
  autocomplete,
47
- clearable,
48
47
  filterItem,
49
48
  handleBackspace,
50
49
  handleChange,
@@ -226,7 +225,7 @@ const DropdownTrigger = (props: DropdownTriggerProps) => {
226
225
  key={`${isDropDownClosed ? "chevron-down" : "chevron-up"}`}
227
226
  >
228
227
  {
229
- clearable !== false && selectedArray.length > 0 && (
228
+ selectedArray.length > 0 && (
230
229
  <div onClick={(e)=>{e.stopPropagation();handleBackspace()}}>
231
230
  <Icon
232
231
  cursor="pointer"
@@ -1,8 +1,6 @@
1
1
  <%= pb_form_with(scope: :example, url: "", method: :get, validate: true) do |form| %>
2
2
  <%= form.text_field :example_text_field, props: { label: true, required: true, required_indicator: true } %>
3
3
  <%= form.text_field :example_text_field_2, props: { label: "Text Field Custom Label", required: true, required_indicator: true } %>
4
- <%= form.text_area :example_text_area, props: { label: true, required: true, required_indicator: true } %>
5
- <%= form.text_area :example_text_area_2, props: { label: "Textarea Custom Label", required: true, required_indicator: true } %>
6
4
  <%= form.email_field :example_email_field, props: { label: true, required: true, required_indicator: true } %>
7
5
  <%= form.number_field :example_number_field, props: { label: true, required: true, required_indicator: true } %>
8
6
  <%= form.search_field :example_search_field, props: { label: true, required: true, required_indicator: true } %>
@@ -13,4 +11,4 @@
13
11
  <%= action.submit %>
14
12
  <%= action.button props: { type: "reset", text: "Cancel", variant: "secondary" } %>
15
13
  <% end %>
16
- <% end %>
14
+ <% end %>