playbook_ui 7.4.0.pre.test2 → 7.4.0.pre.test3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4211d32c465852e435e15c2ef8f84f09eb8c3b7a1688fe716cd8e5a7dbe3010
|
4
|
+
data.tar.gz: aa2b0edb1d453cfa833e456d05ba66cd3d673c03aefb489e1354f30fbf896a95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
18
|
-
removeProps,
|
19
|
-
selectProps,
|
20
|
-
} = props
|
16
|
+
const { removeProps } = props
|
17
|
+
const { imageUrl, label } = props.data
|
21
18
|
|
22
|
-
const
|
23
|
-
|
24
|
-
|
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
|
-
|
30
|
-
|
31
|
-
|
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
|
18
|
+
<div>
|
24
19
|
<Choose>
|
25
20
|
<When condition={imageUrl}>
|
26
21
|
<User
|
data/lib/playbook/version.rb
CHANGED