@superdispatch/ui-lab 0.47.0 → 0.47.2
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.
|
@@ -28,26 +28,15 @@ export var EmailAutocomplete = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
28
28
|
ref: ref,
|
|
29
29
|
multiple: true,
|
|
30
30
|
freeSolo: true,
|
|
31
|
-
filterSelectedOptions: true,
|
|
32
|
-
disableClearable: true,
|
|
33
31
|
value: value,
|
|
32
|
+
disableClearable: true,
|
|
33
|
+
filterSelectedOptions: true,
|
|
34
34
|
filterOptions: _filterOptions => {
|
|
35
35
|
return _filterOptions.filter(option => option !== '');
|
|
36
36
|
},
|
|
37
|
-
onChange: (
|
|
38
|
-
var
|
|
39
|
-
|
|
40
|
-
if (keyboardEvent.key === 'Backspace') {
|
|
41
|
-
var removeLatesElement = value === null || value === void 0 ? void 0 : value.filter((_, index) => index < value.length - 1);
|
|
42
|
-
_onChange === null || _onChange === void 0 ? void 0 : _onChange(removeLatesElement, 'remove-option');
|
|
43
|
-
} else if (keyboardEvent.key === 'Enter' && lastElement) {
|
|
44
|
-
_onChange === null || _onChange === void 0 ? void 0 : _onChange([...(value || []), lastElement], 'select-option');
|
|
45
|
-
} else if (lastElement) {
|
|
46
|
-
var emails = lastElement.split(',').map(item => item.replace(' ', ''));
|
|
47
|
-
_onChange === null || _onChange === void 0 ? void 0 : _onChange(emails, 'select-option');
|
|
48
|
-
} else {
|
|
49
|
-
_onChange === null || _onChange === void 0 ? void 0 : _onChange(selectedValue, 'select-option');
|
|
50
|
-
}
|
|
37
|
+
onChange: (_event, selectedValue, reason) => {
|
|
38
|
+
var emails = selectedValue.flatMap(item => item.split(',')).map(item => item.trim());
|
|
39
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange(emails, reason);
|
|
51
40
|
},
|
|
52
41
|
renderTags: items => {
|
|
53
42
|
return /*#__PURE__*/_jsx(Inline, {
|
package/dist-web/index.js
CHANGED
|
@@ -896,26 +896,15 @@ var EmailAutocomplete = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
896
896
|
ref: ref,
|
|
897
897
|
multiple: true,
|
|
898
898
|
freeSolo: true,
|
|
899
|
-
filterSelectedOptions: true,
|
|
900
|
-
disableClearable: true,
|
|
901
899
|
value: value,
|
|
900
|
+
disableClearable: true,
|
|
901
|
+
filterSelectedOptions: true,
|
|
902
902
|
filterOptions: _filterOptions => {
|
|
903
903
|
return _filterOptions.filter(option => option !== '');
|
|
904
904
|
},
|
|
905
|
-
onChange: (
|
|
906
|
-
var
|
|
907
|
-
|
|
908
|
-
if (keyboardEvent.key === 'Backspace') {
|
|
909
|
-
var removeLatesElement = value === null || value === void 0 ? void 0 : value.filter((_, index) => index < value.length - 1);
|
|
910
|
-
_onChange === null || _onChange === void 0 ? void 0 : _onChange(removeLatesElement, 'remove-option');
|
|
911
|
-
} else if (keyboardEvent.key === 'Enter' && lastElement) {
|
|
912
|
-
_onChange === null || _onChange === void 0 ? void 0 : _onChange([...(value || []), lastElement], 'select-option');
|
|
913
|
-
} else if (lastElement) {
|
|
914
|
-
var emails = lastElement.split(',').map(item => item.replace(' ', ''));
|
|
915
|
-
_onChange === null || _onChange === void 0 ? void 0 : _onChange(emails, 'select-option');
|
|
916
|
-
} else {
|
|
917
|
-
_onChange === null || _onChange === void 0 ? void 0 : _onChange(selectedValue, 'select-option');
|
|
918
|
-
}
|
|
905
|
+
onChange: (_event, selectedValue, reason) => {
|
|
906
|
+
var emails = selectedValue.flatMap(item => item.split(',')).map(item => item.trim());
|
|
907
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange(emails, reason);
|
|
919
908
|
},
|
|
920
909
|
renderTags: items => {
|
|
921
910
|
return /*#__PURE__*/jsx(Inline, {
|