playbook_ui 14.14.0.pre.alpha.PBNTR866finalizecssendlessscroll6486 → 14.14.0.pre.alpha.PBNTR888selectvaliditymessage6348

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/Context/AdvancedTableContext.tsx +3 -143
  3. data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableBody.tsx +99 -45
  4. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +7 -123
  5. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +299 -153
  6. data/app/pb_kits/playbook/pb_drawer/_drawer.scss +8 -32
  7. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_default.html.erb +1 -20
  8. data/app/pb_kits/playbook/pb_drawer/docs/example.yml +0 -5
  9. data/app/pb_kits/playbook/pb_drawer/drawer.html.erb +12 -20
  10. data/app/pb_kits/playbook/pb_drawer/drawer.rb +1 -49
  11. data/app/pb_kits/playbook/pb_overlay/_overlay.scss +0 -13
  12. data/app/pb_kits/playbook/pb_overlay/_overlay.tsx +1 -7
  13. data/app/pb_kits/playbook/pb_overlay/docs/example.yml +0 -3
  14. data/app/pb_kits/playbook/pb_overlay/docs/index.js +0 -1
  15. data/app/pb_kits/playbook/pb_overlay/overlay.html.erb +3 -5
  16. data/app/pb_kits/playbook/pb_overlay/overlay.rb +1 -16
  17. data/app/pb_kits/playbook/pb_overlay/overlay.test.jsx +0 -12
  18. data/app/pb_kits/playbook/pb_tooltip/_tooltip.scss +3 -0
  19. data/app/pb_kits/playbook/pb_tooltip/docs/example.yml +0 -2
  20. data/app/pb_kits/playbook/pb_tooltip/index.js +1 -1
  21. data/app/pb_kits/playbook/pb_tooltip/tooltip.rb +2 -10
  22. data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +1 -34
  23. data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +0 -2
  24. data/app/pb_kits/playbook/pb_typeahead/index.ts +8 -61
  25. data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +1 -13
  26. data/dist/chunks/_typeahead-PqkcDf1H.js +36 -0
  27. data/dist/chunks/_weekday_stacked-BrSrpj7J.js +45 -0
  28. data/dist/chunks/{lib-Dmay5Z6U.js → lib-D3us1bGD.js} +1 -1
  29. data/dist/chunks/{pb_form_validation-DdP7BnVX.js → pb_form_validation-BpihMSOQ.js} +1 -1
  30. data/dist/chunks/vendor.js +1 -1
  31. data/dist/menu.yml +2 -2
  32. data/dist/playbook-doc.js +1 -1
  33. data/dist/playbook-rails-react-bindings.js +1 -1
  34. data/dist/playbook-rails.js +1 -1
  35. data/dist/playbook.css +1 -1
  36. data/lib/playbook/version.rb +1 -1
  37. metadata +6 -40
  38. data/app/pb_kits/playbook/pb_advanced_table/Components/RegularTableView.tsx +0 -127
  39. data/app/pb_kits/playbook/pb_advanced_table/Components/TableActionBar.tsx +0 -55
  40. data/app/pb_kits/playbook/pb_advanced_table/Components/TablePagination.tsx +0 -33
  41. data/app/pb_kits/playbook/pb_advanced_table/Components/VirtualizedTableView.tsx +0 -275
  42. data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableActions.ts +0 -66
  43. data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableState.ts +0 -195
  44. data/app/pb_kits/playbook/pb_advanced_table/Utilities/CellRendererUtils.tsx +0 -73
  45. data/app/pb_kits/playbook/pb_advanced_table/Utilities/RowUtils.ts +0 -52
  46. data/app/pb_kits/playbook/pb_advanced_table/Utilities/TableContainerStyles.ts +0 -80
  47. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_infinite_scroll.jsx +0 -50
  48. data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_mock_data_infinite_scroll.json +0 -152002
  49. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_behavior.html.erb +0 -8
  50. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_borders.html.erb +0 -33
  51. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.html.erb +0 -0
  52. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.html.erb +0 -24
  53. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.html.erb +0 -21
  54. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.md +0 -1
  55. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_sizes.html.erb +0 -49
  56. data/app/pb_kits/playbook/pb_drawer/index.js +0 -257
  57. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar.html.erb +0 -11
  58. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar.jsx +0 -37
  59. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar_rails.md +0 -1
  60. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar_react.md +0 -1
  61. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional.html.erb +0 -11
  62. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional.md +0 -1
  63. data/app/pb_kits/playbook/pb_overlay/index.js +0 -61
  64. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_delay_rails.html.erb +0 -39
  65. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_delay_rails.md +0 -3
  66. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_interaction.html.erb +0 -26
  67. data/app/pb_kits/playbook/pb_tooltip/floating_ui.js +0 -282
  68. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options.html.erb +0 -45
  69. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options.md +0 -5
  70. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options_pure_rails.html.erb +0 -33
  71. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options_pure_rails.md +0 -3
  72. data/dist/chunks/_typeahead-BBL6ThPp.js +0 -36
  73. data/dist/chunks/_weekday_stacked-CF_V6Rbs.js +0 -45
@@ -2,55 +2,7 @@
2
2
 
3
3
  module Playbook
4
4
  module PbDrawer
5
- class Drawer < Playbook::KitBase
6
- prop :size, type: Playbook::Props::Enum,
7
- values: %w[xs sm md lg xl full],
8
- default: "md"
9
- prop :placement, type: Playbook::Props::Enum,
10
- values: %w[left right bottom],
11
- default: "left"
12
- prop :behavior, type: Playbook::Props::Enum,
13
- values: %w[floating push],
14
- default: "floating"
15
- prop :overlay, type: Playbook::Props::Boolean,
16
- default: true
17
- prop :within_element, type: Playbook::Props::Boolean,
18
- default: false
19
- prop :border, type: Playbook::Props::Enum,
20
- values: %w[full none right left],
21
- default: "none"
22
- prop :breakpoint, type: Playbook::Props::Enum,
23
- values: %w[none xs sm md lg xl],
24
- default: "none"
25
-
26
- def classname
27
- generate_classname("pb_drawer pb_drawer_#{size}_#{placement} #{within_class} #{border_classes}")
28
- end
29
-
30
- def border_classes
31
- case border
32
- when "full"
33
- "drawer_border-full"
34
- when "right"
35
- "drawer_border-right"
36
- when "left"
37
- "drawer_border-left"
38
- else
39
- ""
40
- end
41
- end
42
-
43
- def overlay_close
44
- !should_close_on_overlay_click ? "overlay_close" : ""
45
- end
46
-
47
- def within_class
48
- within_element ? "pb_drawer_within_element_rails" : ""
49
- end
50
-
51
- def overlay_classes
52
- "pb_drawer_#{overlay ? '' : 'no_'}overlay drawer_content_#{placement} pb_drawer_overlay_after_open #{overlay ? '' : 'no-background'}"
53
- end
5
+ class Drawer < ::Playbook::KitBase
54
6
  end
55
7
  end
56
8
  end
@@ -69,17 +69,4 @@ $overlay_colors: (
69
69
  pointer-events: none;
70
70
  z-index: 1;
71
71
  }
72
-
73
- &.overlay-hide-scrollbar {
74
- & [class*="overflow_x_auto"],
75
- & [class*="overflow_y_auto"],
76
- & [class*="overflow_auto"] {
77
- &::-webkit-scrollbar {
78
- display: none !important;
79
- }
80
-
81
- -ms-overflow-style: none !important;
82
- scrollbar-width: none !important;
83
- }
84
- }
85
72
  }
@@ -11,7 +11,6 @@ export type OverlayChildrenProps = {
11
11
  dynamic?: boolean,
12
12
  position: string,
13
13
  size: string,
14
- scrollBarNone?: boolean,
15
14
  }
16
15
 
17
16
  type OverlayProps = {
@@ -24,8 +23,6 @@ type OverlayProps = {
24
23
  htmlOptions?: { [key: string]: string | number | boolean | (() => void) },
25
24
  id?: string,
26
25
  layout: { [key: string]: string },
27
- scrollBarNone?: boolean,
28
-
29
26
  }
30
27
 
31
28
  const Overlay = (props: OverlayProps) => {
@@ -39,12 +36,11 @@ const Overlay = (props: OverlayProps) => {
39
36
  htmlOptions = {},
40
37
  id,
41
38
  layout = { "bottom": "full" },
42
- scrollBarNone = false,
43
39
  } = props
44
40
 
45
41
  const ariaProps = buildAriaProps(aria)
46
42
  const dataProps = buildDataProps(data)
47
- const classes = classnames(buildCss('pb_overlay'), { 'overlay-hide-scrollbar': scrollBarNone }, globalProps(props), className )
43
+ const classes = classnames(buildCss('pb_overlay'), globalProps(props), className)
48
44
  const htmlProps = buildHtmlProps(htmlOptions)
49
45
  const dynamicInlineProps = globalInlineProps(props)
50
46
 
@@ -72,14 +68,12 @@ const Overlay = (props: OverlayProps) => {
72
68
  children,
73
69
  color,
74
70
  position: getPosition(),
75
- scrollBarNone,
76
71
  size: getSize()
77
72
  }) : OverlayToken({
78
73
  children,
79
74
  color,
80
75
  dynamic: dynamic,
81
76
  position: getPosition(),
82
- scrollBarNone,
83
77
  size: getSize()
84
78
  })
85
79
  }
@@ -4,11 +4,8 @@ examples:
4
4
  - overlay_multi_directional: Multi-directional
5
5
  - overlay_vertical_dynamic_multi_directional: Vertical Dynamic Multi-directional
6
6
  - overlay_toggle: Toggle
7
- - overlay_hide_scroll_bar: Hide Scroll Bar
8
7
 
9
8
  rails:
10
9
  - overlay_default: Default
11
10
  - overlay_multi_directional: Multi-directional
12
- - overlay_vertical_dynamic_multi_directional: Vertical Dynamic Multi-directional
13
11
  - overlay_toggle: Toggle
14
- - overlay_hide_scroll_bar: Hide Scroll Bar
@@ -2,4 +2,3 @@ export { default as OverlayDefault } from './_overlay_default.jsx'
2
2
  export { default as OverlayMultiDirectional } from './_overlay_multi_directional.jsx'
3
3
  export { default as OverlayToggle } from './_overlay_toggle.jsx'
4
4
  export { default as OverlayVerticalDynamicMultiDirectional } from './_overlay_vertical_dynamic_multi_directional.jsx'
5
- export { default as OverlayHideScrollBar } from './_overlay_hide_scroll_bar.jsx'
@@ -16,14 +16,12 @@ id: object.id,
16
16
  <% end %>
17
17
 
18
18
  <% else %>
19
- <div class="<%= previous_overlay_class_name %>" data-previous-overlay-classname="<%= previous_overlay_class_name %>"></div>
19
+ <div class="<%= previous_overlay_class_name %>"></div>
20
20
 
21
- <div data-overlay-scroll-element="true">
22
- <%= content.presence %>
23
- </div>
21
+ <%= content.presence %>
24
22
 
25
23
  <% if has_subsequent_overlay %>
26
- <div class="<%= subsequent_overlay_class_name %>" data-subsequent-overlay-classname="<%= subsequent_overlay_class_name %>"></div>
24
+ <div class="<%= subsequent_overlay_class_name %>"></div>
27
25
  <% end %>
28
26
  <% end %>
29
27
  <% end %>
@@ -8,13 +8,9 @@ module Playbook
8
8
  default: "card_light"
9
9
  prop :layout, type: Playbook::Props::HashProp,
10
10
  default: { "bottom": "full" }
11
- prop :dynamic, type: Playbook::Props::Boolean,
12
- default: false
13
- prop :scroll_bar_none, type: Playbook::Props::Boolean,
14
- default: false
15
11
 
16
12
  def classname
17
- generate_classname("pb_overlay", hide_scroll_bar_class)
13
+ generate_classname("pb_overlay")
18
14
  end
19
15
 
20
16
  def position
@@ -109,17 +105,6 @@ module Playbook
109
105
  "bg_dark": "#0a0527",
110
106
  }
111
107
  end
112
-
113
- def data_attributes
114
- data ||= {}
115
- data.merge!("data-pb-overlay" => true)
116
- data.merge!("data-overlay-dynamic" => true) if dynamic
117
- data
118
- end
119
-
120
- def hide_scroll_bar_class
121
- scroll_bar_none ? " overlay-hide-scrollbar" : ""
122
- end
123
108
  end
124
109
  end
125
110
  end
@@ -64,15 +64,3 @@ test('should render children', () => {
64
64
  const kit = screen.getByTestId(testId)
65
65
  expect(kit).toHaveTextContent(props.children)
66
66
  })
67
-
68
- test('should add overlay-hide-scrollbar class when scrollBarNone is true', () => {
69
- const props = {
70
- children,
71
- data: { testid: testId },
72
- scrollBarNone: true
73
- }
74
-
75
- render(<Overlay {...props} />)
76
- const kit = screen.getByTestId(testId)
77
- expect(kit).toHaveClass('overlay-hide-scrollbar')
78
- })
@@ -141,6 +141,7 @@ $tooltip_shadow: rgba(60, 106, 172, 0.18);
141
141
 
142
142
  &[data-popper-placement="right"] {
143
143
  box-shadow: -8px 0 28px 0 $tooltip_shadow;
144
+ margin: 0 0 0 $space_sm;
144
145
  .arrow {
145
146
  left: -18px;
146
147
  right: auto;
@@ -155,6 +156,7 @@ $tooltip_shadow: rgba(60, 106, 172, 0.18);
155
156
 
156
157
  &[data-popper-placement="bottom"] {
157
158
  box-shadow: 0 -12px 28px 0 $tooltip_shadow;
159
+ margin: $space_sm 0 0 0;
158
160
  .arrow {
159
161
  top: -18px;
160
162
  margin-bottom: 0;
@@ -167,6 +169,7 @@ $tooltip_shadow: rgba(60, 106, 172, 0.18);
167
169
 
168
170
  &[data-popper-placement="left"] {
169
171
  box-shadow: 8px 0 28px 0 $tooltip_shadow;
172
+ margin: 0 $space_sm 0 0;
170
173
  .arrow {
171
174
  margin-bottom: 0;
172
175
  right: -18px;
@@ -2,10 +2,8 @@ examples:
2
2
 
3
3
  rails:
4
4
  - tooltip_default: Default
5
- - tooltip_interaction: Content Interaction
6
5
  - tooltip_selectors: Using Common Selectors
7
6
  - tooltip_with_icon_circle: Icon Circle Tooltip
8
- - tooltip_delay_rails: Delay
9
7
  - tooltip_show_tooltip: Show Tooltip
10
8
 
11
9
  react:
@@ -11,7 +11,7 @@ const TOOLTIP_TIMEOUT = 250
11
11
 
12
12
  export default class PbTooltip extends PbEnhancedElement {
13
13
  static get selector() {
14
- return '[data-pb-tooltip-kit="true"][data-pb-tooltip-interaction="false"]:not([data-pb-tooltip-delay-open]):not([data-pb-tooltip-delay-close])'
14
+ return '[data-pb-tooltip-kit]'
15
15
  }
16
16
 
17
17
  connect() {
@@ -7,10 +7,6 @@ module Playbook
7
7
  prop :trigger_element_selector
8
8
  prop :trigger_element_id, deprecated: true
9
9
  prop :tooltip_id
10
- prop :interaction, type: Playbook::Props::Boolean,
11
- default: false
12
- prop :delay_open
13
- prop :delay_close
14
10
  prop :dark, type: Playbook::Props::Boolean,
15
11
  default: false
16
12
  prop :trigger_method, type: Playbook::Props::Enum,
@@ -22,19 +18,15 @@ module Playbook
22
18
  end
23
19
 
24
20
  def data
25
- data = Hash(values[:data]).merge(
21
+ Hash(values[:data]).merge(
26
22
  pb_tooltip_kit: true,
27
23
  pb_tooltip_position: position,
28
24
  pb_tooltip_trigger_element_selector: trigger_element_selector,
29
25
  pb_tooltip_trigger_element_id: trigger_element_id,
30
26
  pb_tooltip_tooltip_id: tooltip_id,
31
27
  pb_tooltip_show_tooltip: true,
32
- pb_tooltip_trigger_method: trigger_method,
33
- pb_tooltip_interaction: interaction
28
+ pb_tooltip_trigger_method: trigger_method
34
29
  )
35
- data = data.merge(pb_tooltip_delay_open: delay_open) if delay_open
36
- data = data.merge(pb_tooltip_delay_close: delay_close) if delay_close
37
- data
38
30
  end
39
31
 
40
32
  private
@@ -1,4 +1,4 @@
1
- import React, { useState, useEffect} from 'react'
1
+ import React from 'react'
2
2
  import Select from 'react-select'
3
3
  import AsyncSelect from 'react-select/async'
4
4
  import CreateableSelect from 'react-select/creatable'
@@ -45,12 +45,8 @@ type TypeaheadProps = {
45
45
  getOptionLabel?: string | (() => string),
46
46
  getOptionValue?: string | (() => string),
47
47
  name?: string,
48
- options?: Array<{ label: string; value?: string }>,
49
48
  marginBottom?: "none" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl",
50
49
  pillColor?: "primary" | "neutral" | "success" | "warning" | "error" | "info" | "data_1" | "data_2" | "data_3" | "data_4" | "data_5" | "data_6" | "data_7" | "data_8" | "windows" | "siding" | "roofing" | "doors" | "gutters" | "solar" | "insulation" | "accessories",
51
- optionsByContext?: Record<string, Array<{ label: string; value?: string }>>
52
- searchContextSelector?: string,
53
- clearOnContextChange?: boolean,
54
50
  } & GlobalProps
55
51
 
56
52
  export type SelectValueType = {
@@ -85,9 +81,6 @@ const Typeahead = ({
85
81
  loadOptions = noop,
86
82
  marginBottom = "sm",
87
83
  pillColor,
88
- optionsByContext = {},
89
- searchContextSelector,
90
- clearOnContextChange = false,
91
84
  ...props
92
85
  }: TypeaheadProps) => {
93
86
  const selectProps = {
@@ -122,32 +115,6 @@ const Typeahead = ({
122
115
  ...props,
123
116
  }
124
117
 
125
- const [contextValue, setContextValue] = useState("")
126
-
127
- useEffect(() => {
128
- if (searchContextSelector) {
129
- const searchContextElement = document.getElementById(searchContextSelector)
130
-
131
- setContextValue((searchContextElement as HTMLInputElement)?.value)
132
- const handleContextChange = (e: Event) => {
133
- const target = e.target as HTMLInputElement;
134
- setContextValue(target.value);
135
- if (clearOnContextChange) document.dispatchEvent(new CustomEvent(`pb-typeahead-kit-${selectProps.id}:clear`))
136
- }
137
-
138
- if (searchContextElement) searchContextElement.addEventListener('change', handleContextChange)
139
-
140
- return () => {
141
- if (searchContextElement) searchContextElement.removeEventListener('change', handleContextChange)
142
- }
143
- }
144
- }, [searchContextSelector])
145
-
146
- const contextArray = optionsByContext[contextValue]
147
- if (Array.isArray(contextArray) && contextArray.length > 0) {
148
- selectProps.options = contextArray
149
- }
150
-
151
118
  const Tag = (
152
119
  createable
153
120
  ? (async ? AsyncCreateableSelect : CreateableSelect)
@@ -12,8 +12,6 @@ examples:
12
12
  - typeahead_margin_bottom: Margin Bottom
13
13
  - typeahead_with_pills_color: With Pills (Custom Color)
14
14
  - typeahead_truncated_text: Truncated Text
15
- - typeahead_dynamic_options: Dynamic Options
16
- - typeahead_dynamic_options_pure_rails: Dynamic Options (Pure Rails)
17
15
 
18
16
  react:
19
17
  - typeahead_default: Default
@@ -20,34 +20,6 @@ export default class PbTypeahead extends PbEnhancedElement {
20
20
  this.searchInput.addEventListener('focus', () => this.debouncedSearch())
21
21
  this.searchInput.addEventListener('input', () => this.debouncedSearch())
22
22
  this.resultsElement.addEventListener('click', (event: MouseEvent) => this.optionSelected(event))
23
-
24
- if (this.clearOnContextChange && this.searchContextElement) {
25
- this.searchContextElement.addEventListener('change', () => {
26
- this.searchInputClear()
27
- this.resultsCacheClear()
28
- this.clearResults()
29
- })
30
- }
31
- }
32
-
33
- get optionsByContext() {
34
- return (this.element as HTMLElement).dataset.pbTypeaheadKitOptionsByContext
35
- ? JSON.parse((this.element as HTMLElement).dataset.pbTypeaheadKitOptionsByContext)
36
- : null
37
- }
38
-
39
- get searchContextElement() {
40
- const selector = (this.element as HTMLElement).dataset.pbTypeaheadKitSearchContextSelector
41
- if (!selector) return null
42
-
43
- const found = this.element.parentNode?.querySelector(`#${selector}`)
44
- || this.element.closest(selector)
45
-
46
- return found || null
47
- }
48
-
49
- get clearOnContextChange() {
50
- return (this.element as HTMLElement).dataset.pbTypeaheadKitClearOnContextChange === 'true'
51
23
  }
52
24
 
53
25
  handleKeydown(event: KeyboardEvent) {
@@ -68,32 +40,14 @@ export default class PbTypeahead extends PbEnhancedElement {
68
40
 
69
41
  const searchTerm = this.searchTerm
70
42
  const searchContext = this.searchContext
71
-
72
- if (this.optionsByContext && Object.keys(this.optionsByContext).length > 0) {
73
- const contextArray = this.optionsByContext[searchContext] || []
74
-
75
- const filteredResults = contextArray.filter((obj: { label: string, value: string }) => {
76
- return obj.label
77
- && obj.label.toLowerCase().includes(searchTerm.toLowerCase())
78
- })
79
-
80
- const optionFragments = filteredResults.map((obj: { label: string, value: string }) => {
81
- const singleOption = document.createDocumentFragment()
82
- singleOption.appendChild(document.createTextNode(obj.label))
83
- return singleOption
84
- })
85
-
86
- this.resultsCacheUpdate(searchTerm, searchContext, optionFragments)
87
- } else {
88
- const search = {
89
- searchingFor: searchTerm,
90
- searchingContext: searchContext,
91
- setResults: (results: Array<DocumentFragment>) => {
92
- this.resultsCacheUpdate(searchTerm, searchContext, results)
93
- },
94
- }
95
- this.element.dispatchEvent(new CustomEvent('pb-typeahead-kit-search', { bubbles: true, detail: search }))
43
+ const search = {
44
+ searchingFor: searchTerm,
45
+ searchingContext: searchContext,
46
+ setResults: (results: Array<DocumentFragment>) => {
47
+ this.resultsCacheUpdate(searchTerm, searchContext, results)
48
+ },
96
49
  }
50
+ this.element.dispatchEvent(new CustomEvent('pb-typeahead-kit-search', { bubbles: true, detail: search }))
97
51
  }
98
52
 
99
53
  resultsCacheUpdate(searchTerm: string, searchContext: string, results: Array<DocumentFragment>) {
@@ -133,15 +87,11 @@ export default class PbTypeahead extends PbEnhancedElement {
133
87
  const resultOption = (event.target as Element).closest('[data-result-option-item]')
134
88
  if (!resultOption) return
135
89
 
136
- const selectedText = resultOption.textContent.trim()
137
-
138
90
  this._validSelection = true
139
91
  this.removeValidationError()
140
92
 
141
- if (this.searchContextElement) this.searchInput.value = selectedText
142
-
143
93
  this.resultsCacheClear()
144
- if (!this.searchContextElement) this.searchInputClear()
94
+ this.searchInputClear()
145
95
  this.clearResults()
146
96
 
147
97
  this.element.dispatchEvent(new CustomEvent('pb-typeahead-kit-result-option-selected', { bubbles: true, detail: { selected: resultOption, typeahead: this } }))
@@ -223,9 +173,6 @@ export default class PbTypeahead extends PbEnhancedElement {
223
173
  this.element.parentNode.querySelector(selector) ||
224
174
  this.element.closest(selector)
225
175
  ) as HTMLInputElement).value
226
- else if (this.searchContextElement) {
227
- return (this.searchContextElement as HTMLInputElement).value
228
- }
229
176
 
230
177
  return null
231
178
  }
@@ -44,12 +44,6 @@ module Playbook
44
44
  default: false
45
45
  prop :validation, type: Playbook::Props::HashProp,
46
46
  default: {}
47
- prop :clear_on_context_change, type: Playbook::Props::Boolean,
48
- default: true
49
- prop :options_by_context, type: Playbook::Props::HashProp,
50
- default: {}
51
- prop :search_context_selector, type: Playbook::Props::String,
52
- default: nil
53
47
 
54
48
  def classname
55
49
  default_margin_bottom = margin_bottom.present? ? "" : " mb_sm"
@@ -64,10 +58,7 @@ module Playbook
64
58
  Hash(values[:data]).merge(
65
59
  pb_typeahead_kit: true,
66
60
  pb_typeahead_kit_search_term_minimum_length: search_term_minimum_length,
67
- pb_typeahead_kit_search_debounce_timeout: search_debounce_timeout,
68
- pb_typeahead_kit_clear_on_context_change: clear_on_context_change,
69
- pb_typeahead_kit_search_context_selector: search_context_selector,
70
- pb_typeahead_kit_options_by_context: options_by_context.to_json
61
+ pb_typeahead_kit_search_debounce_timeout: search_debounce_timeout
71
62
  )
72
63
  end
73
64
 
@@ -94,9 +85,6 @@ module Playbook
94
85
  placeholder: placeholder,
95
86
  plusIcon: plus_icon,
96
87
  truncate: truncate,
97
- searchContextSelector: search_context_selector,
98
- optionsByContext: options_by_context,
99
- clearOnContextChange: clear_on_context_change,
100
88
  }
101
89
 
102
90
  base_options[:getOptionLabel] = get_option_label if get_option_label.present?