playbook_ui 15.5.0.pre.alpha.revert5553typeaheadfix12763 → 15.5.0.pre.alpha.testingdialog12768

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1a59cf8f69d5fe52b8de77c8841a833bf94874562f059e400cd0d579d594a138
4
- data.tar.gz: 6cfe8278c2647fbd8d2a9e8a53aa9b3e05dd4ed95956054f875614b4b39de579
3
+ metadata.gz: 3fc58093c90c85fa3578a54f915a7848dadb2cd71d10e35b83e7833eb5ec4e73
4
+ data.tar.gz: 78ae55c27c5d0675721821cb1df1189339018fee574d6ab167649136b6056cc6
5
5
  SHA512:
6
- metadata.gz: 7a9ddcc0dc503a03291f2098bc20dbf1e2c7e061dd5813b47d22d668e69e6174a329ee0124d3f97eb456d3d2eae3407206e9b538284f1d800e007dd90533481a
7
- data.tar.gz: 4617c2fa17d4fd3cc8ea7d5fbb046f4a7963fa62a5c7410cceed78b028b1ba93a75043ea54e13744f2b14c0a57f63750235984cc9949122c83c7c1616d41665b
6
+ metadata.gz: 10481336ad49cc598aa3f54ef73df833998e006329e7d9f697c695fa4663666890865f78bdf2867024f684d8a1ff98aba9806c14d37f43a957bbbcca1af82d81
7
+ data.tar.gz: 7c611b805bcae6b620f503fba42542767f63fa9674837e359129583c4b2bf42cfce5140c3cbb2ad9657b023dacfe46aa49a19731d7c072a46e7a3e558d1806e0
@@ -1,3 +1,24 @@
1
+ <%
2
+ options = [
3
+ {
4
+ label: "United States",
5
+ value: "unitedStates",
6
+ id: "us"
7
+ },
8
+ {
9
+ label: "United Kingdom",
10
+ value: "unitedKingdom",
11
+ id: "gb"
12
+ },
13
+ {
14
+ label: "Pakistan",
15
+ value: "pakistan",
16
+ id: "pk"
17
+ }
18
+ ]
19
+ %>
20
+
21
+
1
22
  <%= pb_rails("button", props: { text: "Open Complex Dialog", data:{"open-dialog": "dialog-complex"} }) %>
2
23
 
3
24
  <%= pb_rails("dialog", props: { id:"dialog-complex", size: "lg", full_height: true }) do %>
@@ -10,6 +31,16 @@
10
31
  <%= pb_rails("rich_text_editor", props: {id: "default", value: "Add your text here"}) %>
11
32
  <%= pb_rails("caption", props: { text: "Type in a word or term too help find tickets later. ex. training, phone setup, hr", margin_bottom: "xs", margin_top: "sm" }) %>
12
33
  <%= pb_rails("typeahead", props: { placeholder: "Tags.."}) %>
34
+ <%= pb_rails("dropdown", props: {options: options, autocomplete: true}) %>
35
+ <%= pb_rails("typeahead", props: {
36
+ id: "typeahead-default",
37
+ placeholder: "Select one...",
38
+ options: options,
39
+ name: :foo,
40
+ margin_top: "sm",
41
+ is_multi: false
42
+ })
43
+ %>
13
44
 
14
45
  <% end %>
15
46
  <%= pb_rails("dialog/dialog_footer", props: {cancel_button: "Back", confirm_button: "Send my Issue", confirm_button_id:"confirm-complex", id: "dialog-complex"}) %>
@@ -7,18 +7,29 @@ type ClearContainerProps = {
7
7
  id: string,
8
8
  },
9
9
  clearValue: () => void,
10
+ innerProps?: any,
10
11
  }
11
12
 
12
- const ClearContainer = (props: ClearContainerProps): React.ReactElement => {
13
- const { selectProps, clearValue } = props
13
+ const ClearContainer = (props: ClearContainerProps | any): React.ReactElement => {
14
+ const { selectProps, clearValue, innerProps } = props
14
15
  useEffect(() => {
15
16
  document.addEventListener(`pb-typeahead-kit-${selectProps.id}:clear`, clearValue)
16
17
  }, [clearValue, selectProps.id])
17
18
 
19
+ // To stop this from bubbling up when inside a dialog or other modal
20
+ const handleMouseDown = (event: React.MouseEvent) => {
21
+ event.stopPropagation()
22
+ innerProps?.onMouseDown?.(event)
23
+ }
24
+
18
25
  return (
19
26
  <components.ClearIndicator
20
27
  className="clear_indicator"
21
28
  {...props}
29
+ innerProps={{
30
+ ...innerProps,
31
+ onMouseDown: handleMouseDown,
32
+ }}
22
33
  />
23
34
  )
24
35
  }