playbook_ui 7.4.0.pre.test2 → 7.4.0.pre.test3

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: edcd483154d0afd156eefc07b277386e923c18ebf81792ad5ff820edec18e49a
4
- data.tar.gz: 5b226758e48f33b05fc5198f88d5b47f6f1083ffbd6fd2c391bf1b305c1e57a3
3
+ metadata.gz: f4211d32c465852e435e15c2ef8f84f09eb8c3b7a1688fe716cd8e5a7dbe3010
4
+ data.tar.gz: aa2b0edb1d453cfa833e456d05ba66cd3d673c03aefb489e1354f30fbf896a95
5
5
  SHA512:
6
- metadata.gz: 3a0aa8bc5d8b1257b9026f4e33eb5b92fb4577b15369e99a22f42ca753fc65ab4b8b25323e81c31ad460f58e8b6b0071e22d8187ddf543444453c9157a61506c
7
- data.tar.gz: b9f3b18987643f6a9ec374f68b8fc4ae866e1a5e57dde52529375da4c61fcb1555ca689473fde8c3eaef6104e8cd7ea16dc9b2b87bcfce03fceba961d69397dd
6
+ metadata.gz: b485cc3abd09ab954532ac9dd39a97c841b58be95a35b1e2ae1d6fc985d081131431f552eb50be5e9254257895041b0f278941f0a7d17810244d6742f5d34024
7
+ data.tar.gz: fc0c06ccb718a5b0b77ac77080836a3865f27f98ad63ed5cb4cf7e584114de508e95384307d535855aef5214cbb6e74bc9415f37049c1e3117ba193a2de2297d
@@ -60,7 +60,16 @@ const Typeahead = (props: Props) => {
60
60
 
61
61
  const Tag = props.async ? AsyncSelect : Select
62
62
 
63
- const handleOnChange = (data, { action }) => {
63
+ const handleOnChange = (data, { action, option, removedValue }) => {
64
+ if (action === 'select-option') {
65
+ if (selectProps.onMultiValueClick) selectProps.onMultiValueClick(option)
66
+ const multiValueClearEvent = new CustomEvent('pb-typeahead-kit-result-option-select', { detail: option })
67
+ document.dispatchEvent(multiValueClearEvent)
68
+ }
69
+ if (action === 'remove-value' || action === 'pop-value') {
70
+ const multiValueRemoveEvent = new CustomEvent('pb-typeahead-kit-result-option-remove', { detail: removedValue })
71
+ document.dispatchEvent(multiValueRemoveEvent)
72
+ }
64
73
  if (action === 'clear') {
65
74
  const multiValueClearEvent = new CustomEvent('pb-typeahead-kit-result-clear')
66
75
  document.dispatchEvent(multiValueClearEvent)
@@ -13,24 +13,17 @@ type Props = {
13
13
  }
14
14
 
15
15
  const MultiValue = (props: Props) => {
16
- const {
17
- data,
18
- removeProps,
19
- selectProps,
20
- } = props
16
+ const { removeProps } = props
17
+ const { imageUrl, label } = props.data
21
18
 
22
- const { imageUrl, label } = data
23
-
24
- const handleOnMultiValueRemove = () => {
25
- const multiValueRemoveEvent = new CustomEvent('pb-typeahead-kit-result-option-remove', { detail: data })
26
- document.dispatchEvent(multiValueRemoveEvent)
19
+ const formPillProps = {
20
+ marginRight: 'xs',
21
+ name: label,
27
22
  }
28
23
 
29
- const handleOnClick = () => {
30
- if (selectProps.onMultiValueClick) selectProps.onMultiValueClick(data)
31
- handleOnMultiValueRemove()
32
- removeProps.onClick()
33
- }
24
+ if (typeof imageUrl === 'string') formPillProps.avatarUrl = imageUrl
25
+
26
+ const handleOnClick = removeProps.onClick
34
27
 
35
28
  return (
36
29
  <components.MultiValueContainer
@@ -13,14 +13,9 @@ const Option = (props: any) => {
13
13
  label,
14
14
  } = props.data
15
15
 
16
- const handleOptionClicked = () => {
17
- const resultSelectedEvent = new CustomEvent('pb-typeahead-kit-result-option-select', { detail: props.data })
18
- document.dispatchEvent(resultSelectedEvent)
19
- }
20
-
21
16
  return (
22
17
  <components.Option {...props}>
23
- <div onClick={handleOptionClicked}>
18
+ <div>
24
19
  <Choose>
25
20
  <When condition={imageUrl}>
26
21
  <User
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Playbook
4
- VERSION = "7.4.0.pre.test2"
4
+ VERSION = "7.4.0.pre.test3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playbook_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.4.0.pre.test2
4
+ version: 7.4.0.pre.test3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Power UX