@expressms/smartapp-ui 3.0.0-alpha.2 → 3.0.0-alpha.200
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.
- package/build/main/assets/icons/accepted-invite-status.svg +4 -0
- package/build/main/assets/icons/calendar-arrow-next.svg +3 -0
- package/build/main/assets/icons/calendar-arrow-prev.svg +3 -0
- package/build/main/assets/icons/chevron.svg +3 -0
- package/build/main/assets/icons/close-modal.svg +1 -1
- package/build/main/assets/icons/copy.svg +3 -0
- package/build/main/assets/icons/declined-invite-status.svg +4 -0
- package/build/main/assets/icons/department.svg +3 -0
- package/build/main/assets/icons/doc-small.svg +5 -5
- package/build/main/assets/icons/download.svg +3 -0
- package/build/main/assets/icons/file-small.svg +5 -5
- package/build/main/assets/icons/file.svg +1 -1
- package/build/main/assets/icons/image-no-preview-small.svg +11 -0
- package/build/main/assets/icons/image-no-preview.svg +11 -0
- package/build/main/assets/icons/job-position.svg +3 -0
- package/build/main/assets/icons/needs-action-invite-status.svg +4 -0
- package/build/main/assets/icons/notification-close.svg +1 -1
- package/build/main/assets/icons/notification-error.svg +5 -0
- package/build/main/assets/icons/notification-failure-filled.svg +3 -0
- package/build/main/assets/icons/notification-info-filled.svg +5 -0
- package/build/main/assets/icons/notification-success-filled.svg +4 -0
- package/build/main/assets/icons/office.svg +3 -0
- package/build/main/assets/icons/pdf-small.svg +5 -5
- package/build/main/assets/icons/ppt-small.svg +5 -5
- package/build/main/assets/icons/private.svg +4 -11
- package/build/main/assets/icons/search.svg +1 -1
- package/build/main/assets/icons/select-arrow-down.svg +3 -0
- package/build/main/assets/icons/select-arrow-up.svg +3 -0
- package/build/main/assets/icons/server.svg +3 -0
- package/build/main/assets/icons/txt-small.svg +5 -5
- package/build/main/assets/icons/video-no-preview-small.svg +11 -0
- package/build/main/assets/icons/video-no-preview.svg +11 -0
- package/build/main/assets/icons/xls-small.svg +5 -5
- package/build/main/assets/storybook/index.d.ts +4 -0
- package/build/main/assets/storybook/index.js +4 -0
- package/build/main/assets/storybook/index.js.map +1 -1
- package/build/main/constants/constants.d.ts +95 -47
- package/build/main/constants/constants.js +136 -50
- package/build/main/constants/constants.js.map +1 -1
- package/build/main/constants/types.d.ts +11 -1
- package/build/main/helpers/index.d.ts +3 -1
- package/build/main/helpers/index.js +21 -2
- package/build/main/helpers/index.js.map +1 -1
- package/build/main/hooks/useCharHintDisplay.d.ts +9 -0
- package/build/main/hooks/useCharHintDisplay.js +35 -0
- package/build/main/hooks/useCharHintDisplay.js.map +1 -0
- package/build/main/hooks/useMobileLongTap.d.ts +16 -0
- package/build/main/hooks/useMobileLongTap.js +65 -0
- package/build/main/hooks/useMobileLongTap.js.map +1 -0
- package/build/main/hooks/useModal.d.ts +18 -10
- package/build/main/hooks/useModal.js +235 -14
- package/build/main/hooks/useModal.js.map +1 -1
- package/build/main/index.d.ts +2 -0
- package/build/main/index.js +2 -0
- package/build/main/index.js.map +1 -1
- package/build/main/styles/styles.scss +2 -2
- package/build/main//321/201omponents/ActionModal/ActionModal.js +1 -1
- package/build/main//321/201omponents/ActionModal/ActionModal.js.map +1 -1
- package/build/main//321/201omponents/AttachedFile/AttachedFile.d.ts +1 -1
- package/build/main//321/201omponents/AttachedFile/AttachedFile.js +133 -28
- package/build/main//321/201omponents/AttachedFile/AttachedFile.js.map +1 -1
- package/build/main//321/201omponents/AttachedFile/types.d.ts +7 -5
- package/build/main//321/201omponents/Avatar/Avatar.d.ts +3 -2
- package/build/main//321/201omponents/Avatar/Avatar.js +56 -27
- package/build/main//321/201omponents/Avatar/Avatar.js.map +1 -1
- package/build/main//321/201omponents/Avatar/types.d.ts +9 -5
- package/build/main//321/201omponents/Avatar/types.js +5 -2
- package/build/main//321/201omponents/Avatar/types.js.map +1 -1
- package/build/main//321/201omponents/Button/Button.d.ts +1 -1
- package/build/main//321/201omponents/Button/Button.js +22 -11
- package/build/main//321/201omponents/Button/Button.js.map +1 -1
- package/build/main//321/201omponents/Button/types.d.ts +9 -2
- package/build/main//321/201omponents/Button/types.js +3 -0
- package/build/main//321/201omponents/Button/types.js.map +1 -1
- package/build/main//321/201omponents/Calendar/Calendar.d.ts +14 -2
- package/build/main//321/201omponents/Calendar/Calendar.js +238 -45
- package/build/main//321/201omponents/Calendar/Calendar.js.map +1 -1
- package/build/main//321/201omponents/Calendar/types.d.ts +22 -8
- package/build/main//321/201omponents/Charts/ChartBar/ChartBar.js +1 -1
- package/build/main//321/201omponents/Charts/ChartLine/ChartLine.js +1 -1
- package/build/main//321/201omponents/Charts/ChartPie/ChartPie.js +1 -1
- package/build/main//321/201omponents/Chip/Chip.d.ts +3 -2
- package/build/main//321/201omponents/Chip/Chip.js +198 -45
- package/build/main//321/201omponents/Chip/Chip.js.map +1 -1
- package/build/main//321/201omponents/Chip/types.d.ts +15 -5
- package/build/main//321/201omponents/ChipDndContext/ChipDndContext.d.ts +13 -0
- package/build/main//321/201omponents/ChipDndContext/ChipDndContext.js +76 -0
- package/build/main//321/201omponents/ChipDndContext/ChipDndContext.js.map +1 -0
- package/build/main//321/201omponents/ChipDndContext/index.d.ts +1 -0
- package/build/main//321/201omponents/ChipDndContext/index.js +2 -0
- package/build/main//321/201omponents/ChipDndContext/index.js.map +1 -0
- package/build/main//321/201omponents/ConfirmationModal/ConfirmationModal.d.ts +1 -1
- package/build/main//321/201omponents/ConfirmationModal/ConfirmationModal.js +3 -2
- package/build/main//321/201omponents/ConfirmationModal/ConfirmationModal.js.map +1 -1
- package/build/main//321/201omponents/ConfirmationModal/types.d.ts +5 -2
- package/build/main//321/201omponents/ContextMenu/ContextMenu.d.ts +1 -1
- package/build/main//321/201omponents/ContextMenu/ContextMenu.js +68 -27
- package/build/main//321/201omponents/ContextMenu/ContextMenu.js.map +1 -1
- package/build/main//321/201omponents/ContextMenu/types.d.ts +14 -7
- package/build/main//321/201omponents/ContextMenuItem/ContextMenuItem.d.ts +4 -0
- package/build/main//321/201omponents/ContextMenuItem/ContextMenuItem.js +49 -0
- package/build/main//321/201omponents/ContextMenuItem/ContextMenuItem.js.map +1 -0
- package/build/main//321/201omponents/ContextMenuItem/index.d.ts +1 -0
- package/build/main//321/201omponents/ContextMenuItem/index.js +2 -0
- package/build/main//321/201omponents/ContextMenuItem/index.js.map +1 -0
- package/build/main//321/201omponents/ContextMenuItem/types.d.ts +28 -0
- package/build/main//321/201omponents/ContextMenuItem/types.js +6 -0
- package/build/main//321/201omponents/ContextMenuItem/types.js.map +1 -0
- package/build/main//321/201omponents/CustomSelect/CustomSelect.d.ts +1 -1
- package/build/main//321/201omponents/CustomSelect/CustomSelect.js +57 -23
- package/build/main//321/201omponents/CustomSelect/CustomSelect.js.map +1 -1
- package/build/main//321/201omponents/CustomSelect/selectStyles.d.ts +2 -2
- package/build/main//321/201omponents/CustomSelect/selectStyles.js +35 -28
- package/build/main//321/201omponents/CustomSelect/selectStyles.js.map +1 -1
- package/build/main//321/201omponents/CustomSelect/types.d.ts +23 -4
- package/build/main//321/201omponents/CustomSelectProfiles/CustomSelectProfiles.d.ts +1 -1
- package/build/main//321/201omponents/CustomSelectProfiles/CustomSelectProfiles.js +33 -24
- package/build/main//321/201omponents/CustomSelectProfiles/CustomSelectProfiles.js.map +1 -1
- package/build/main//321/201omponents/CustomSelectProfiles/selectStyles.d.ts +11 -0
- package/build/main//321/201omponents/CustomSelectProfiles/selectStyles.js +39 -0
- package/build/main//321/201omponents/CustomSelectProfiles/selectStyles.js.map +1 -0
- package/build/main//321/201omponents/CustomSelectProfiles/types.d.ts +6 -5
- package/build/main//321/201omponents/DragAndDrop/DragAndDrop.js +2 -2
- package/build/main//321/201omponents/DragAndDrop/DragAndDrop.js.map +1 -1
- package/build/main//321/201omponents/DraggablePopup/DraggablePopup.d.ts +1 -1
- package/build/main//321/201omponents/DraggablePopup/DraggablePopup.js +25 -20
- package/build/main//321/201omponents/DraggablePopup/DraggablePopup.js.map +1 -1
- package/build/main//321/201omponents/DraggablePopup/types.d.ts +13 -11
- package/build/main//321/201omponents/Flex/Flex.d.ts +1 -1
- package/build/main//321/201omponents/Flex/Flex.js +2 -2
- package/build/main//321/201omponents/Flex/Flex.js.map +1 -1
- package/build/main//321/201omponents/Flex/types.d.ts +2 -0
- package/build/main//321/201omponents/Input/Input.d.ts +1 -1
- package/build/main//321/201omponents/Input/Input.js +90 -33
- package/build/main//321/201omponents/Input/Input.js.map +1 -1
- package/build/main//321/201omponents/Input/types.d.ts +10 -3
- package/build/main//321/201omponents/ListItem/ListItem.js +26 -20
- package/build/main//321/201omponents/ListItem/ListItem.js.map +1 -1
- package/build/main//321/201omponents/ListItem/types.d.ts +9 -4
- package/build/main//321/201omponents/Modal/Modal.d.ts +3 -2
- package/build/main//321/201omponents/Modal/Modal.js +276 -61
- package/build/main//321/201omponents/Modal/Modal.js.map +1 -1
- package/build/main//321/201omponents/Modal/types.d.ts +44 -2
- package/build/main//321/201omponents/Notification/Notification.d.ts +4 -6
- package/build/main//321/201omponents/Notification/Notification.js +88 -30
- package/build/main//321/201omponents/Notification/Notification.js.map +1 -1
- package/build/main//321/201omponents/Notification/types.d.ts +23 -5
- package/build/main//321/201omponents/Skeleton/Skeleton.js +1 -1
- package/build/main//321/201omponents/Skeleton/Skeleton.js.map +1 -1
- package/build/main//321/201omponents/Stories/Stories.js +72 -4
- package/build/main//321/201omponents/Stories/Stories.js.map +1 -1
- package/build/main//321/201omponents/Textarea/Textarea.d.ts +1 -1
- package/build/main//321/201omponents/Textarea/Textarea.js +9 -6
- package/build/main//321/201omponents/Textarea/Textarea.js.map +1 -1
- package/build/main//321/201omponents/Textarea/types.d.ts +6 -3
- package/build/main//321/201omponents/UserDropdown/ContactBottomSheet/ContactBottomSheet.d.ts +1 -1
- package/build/main//321/201omponents/UserDropdown/ContactBottomSheet/ContactBottomSheet.js +12 -2
- package/build/main//321/201omponents/UserDropdown/ContactBottomSheet/ContactBottomSheet.js.map +1 -1
- package/build/main//321/201omponents/UserDropdown/ContactInfo/ContactInfo.js +28 -12
- package/build/main//321/201omponents/UserDropdown/ContactInfo/ContactInfo.js.map +1 -1
- package/build/main//321/201omponents/UserDropdown/LoadingMessage/LoadingMessage.d.ts +2 -1
- package/build/main//321/201omponents/UserDropdown/LoadingMessage/LoadingMessage.js +4 -3
- package/build/main//321/201omponents/UserDropdown/LoadingMessage/LoadingMessage.js.map +1 -1
- package/build/main//321/201omponents/UserDropdown/MenuList/MenuList.js +35 -59
- package/build/main//321/201omponents/UserDropdown/MenuList/MenuList.js.map +1 -1
- package/build/main//321/201omponents/UserDropdown/MultiValueLabel/MultiValueLabel.d.ts +3 -2
- package/build/main//321/201omponents/UserDropdown/MultiValueLabel/MultiValueLabel.js +33 -24
- package/build/main//321/201omponents/UserDropdown/MultiValueLabel/MultiValueLabel.js.map +1 -1
- package/build/main//321/201omponents/UserDropdown/Option/Option.js +16 -11
- package/build/main//321/201omponents/UserDropdown/Option/Option.js.map +1 -1
- package/build/main//321/201omponents/UserDropdown/SearchInCatalogButton/SearchInCatalogButton.d.ts +1 -1
- package/build/main//321/201omponents/UserDropdown/SearchInCatalogButton/SearchInCatalogButton.js +7 -9
- package/build/main//321/201omponents/UserDropdown/SearchInCatalogButton/SearchInCatalogButton.js.map +1 -1
- package/build/main//321/201omponents/UserDropdown/UserDropdown.d.ts +3 -3
- package/build/main//321/201omponents/UserDropdown/UserDropdown.js +239 -262
- package/build/main//321/201omponents/UserDropdown/UserDropdown.js.map +1 -1
- package/build/main//321/201omponents/UserDropdown/components/Delimiter.d.ts +8 -0
- package/build/main//321/201omponents/UserDropdown/components/Delimiter.js +10 -0
- package/build/main//321/201omponents/UserDropdown/components/Delimiter.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/components/Hint.d.ts +6 -0
- package/build/main//321/201omponents/UserDropdown/components/Hint.js +21 -0
- package/build/main//321/201omponents/UserDropdown/components/Hint.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/components/Input.d.ts +2 -0
- package/build/main//321/201omponents/UserDropdown/components/Input.js +24 -0
- package/build/main//321/201omponents/UserDropdown/components/Input.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/components/Mask.d.ts +7 -0
- package/build/main//321/201omponents/UserDropdown/components/Mask.js +18 -0
- package/build/main//321/201omponents/UserDropdown/components/Mask.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/components/Title.d.ts +5 -0
- package/build/main//321/201omponents/UserDropdown/components/Title.js +18 -0
- package/build/main//321/201omponents/UserDropdown/components/Title.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/constants.d.ts +57 -0
- package/build/main//321/201omponents/UserDropdown/constants.js +73 -0
- package/build/main//321/201omponents/UserDropdown/constants.js.map +1 -1
- package/build/main//321/201omponents/UserDropdown/helpers.d.ts +84 -41
- package/build/main//321/201omponents/UserDropdown/helpers.js +184 -14
- package/build/main//321/201omponents/UserDropdown/helpers.js.map +1 -1
- package/build/main//321/201omponents/UserDropdown/selectStyles.d.ts +1 -1
- package/build/main//321/201omponents/UserDropdown/selectStyles.js +58 -27
- package/build/main//321/201omponents/UserDropdown/selectStyles.js.map +1 -1
- package/build/main//321/201omponents/UserDropdown/types.d.ts +146 -60
- package/build/main//321/201omponents/UserDropdown/types.js +1 -8
- package/build/main//321/201omponents/UserDropdown/types.js.map +1 -1
- package/package.json +12 -7
- package/build/main/assets/icons/avatar-arrow-down.svg +0 -3
- package/build/main/assets/icons/avatar-arrow-up.svg +0 -3
- package/build/main/hooks/useLongTap.d.ts +0 -12
- package/build/main/hooks/useLongTap.js +0 -29
- package/build/main/hooks/useLongTap.js.map +0 -1
|
@@ -20,12 +20,12 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
20
20
|
};
|
|
21
21
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
22
|
/* eslint-disable max-lines */
|
|
23
|
-
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
23
|
+
import { memo, useCallback, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
24
24
|
import Select, { components } from 'react-select';
|
|
25
25
|
import classNames from 'classnames';
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
26
|
+
import { debounce, includes, isArray, isEmpty, isNil, isNull, omit, pick, uniqBy } from 'lodash';
|
|
27
|
+
import { useDroppable } from '@dnd-kit/core';
|
|
28
|
+
import { useCharHintDisplay } from '../../hooks/useCharHintDisplay';
|
|
29
29
|
import Modal from '../Modal';
|
|
30
30
|
import ContactBottomSheet from './ContactBottomSheet/ContactBottomSheet';
|
|
31
31
|
import LoadingMessage from './LoadingMessage/LoadingMessage';
|
|
@@ -34,99 +34,80 @@ import MultiValueLabel from './MultiValueLabel/MultiValueLabel';
|
|
|
34
34
|
import Option from './Option/Option';
|
|
35
35
|
import SearchInCatalogButton from './SearchInCatalogButton/SearchInCatalogButton';
|
|
36
36
|
import selectStyles from './selectStyles';
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import
|
|
37
|
+
import Delimiter from './components/Delimiter';
|
|
38
|
+
import Hint from './components/Hint';
|
|
39
|
+
import Input from './components/Input';
|
|
40
|
+
import Mask from './components/Mask';
|
|
41
|
+
import Title from './components/Title';
|
|
42
|
+
import { checkIfContactTypeIsGroup, generateFontFamilyStyle, generateId, isIosPlatform, isMobilePlatform } from '../../helpers';
|
|
43
|
+
import { DropdownIndicator, IndicatorSeparator, LoadingIndicator, MultiValueRemove, applyFilteringToOption, calculateHorizontalPadding, checkIsValueIsEmail, collapseChips, extractInputEmails, generateContactsOptionsToSelect, generateCorporateOptionsToSelect, generateEnteredByUserOption, retrieveChipsElements, retrieveFilteredContacts, setCaretInEmptyInput, setCaretPosition, transformSelectedEntity, transformSelectedUsers, unCollapseChips, } from './helpers';
|
|
44
|
+
import { BACKSPACE_KEY, EMAIL_FIELD, EMPTY_STRING, ENTER_KEY, EVENT_LISTENER_TYPES, LANGUAGES, LAYOUT_TYPE, MENU_POSITIONS, MIN_INPUT_SYMBOLS, PLATFORM, RENDER_DELAY, SEARCH_PLACEHOLDER, SPACE, SPACE_KEY, } from '../../constants';
|
|
45
|
+
import { CLEAR_USER_TYPING_TIMEOUT, COMMON_FIELDS_TO_OMIT, COMMON_FIELDS_TO_PICK, DEFAULT_MAX_ROWS_COUNT_TO_COLLAPSE_CHIPS, DEFAULT_MENU_LIST_MAX_HEIGHT, EMAIL_SEPARATORS, INPUT_ACTIONS, MENU_ACTIONS, PADDING_WITH_CLEAR_ICON, USER_TYPING_TIMEOUT, } from './constants';
|
|
40
46
|
import '../../styles/styles.scss';
|
|
41
|
-
var MIN_INPUT_SYMBOLS = 3;
|
|
42
|
-
var THREE_DIGIT_NUMBER_WIDTH = 48;
|
|
43
|
-
var TWO_DIGIT_NUMBER_WIDTH = 40;
|
|
44
|
-
var SINGLE_DIGIT_NUMBER_WIDTH = 32;
|
|
45
|
-
var INPUT_SPACE_WIDTH = 46;
|
|
46
|
-
var GAP = 8;
|
|
47
|
-
var USER_TYPING_TIMEOUT = 1000;
|
|
48
|
-
export var EMAIL_FIELD = 'email';
|
|
49
|
-
var MENU_ACTIONS;
|
|
50
|
-
(function (MENU_ACTIONS) {
|
|
51
|
-
MENU_ACTIONS["close"] = "menu-close";
|
|
52
|
-
})(MENU_ACTIONS || (MENU_ACTIONS = {}));
|
|
53
|
-
var INPUT_ACTIONS;
|
|
54
|
-
(function (INPUT_ACTIONS) {
|
|
55
|
-
INPUT_ACTIONS["change"] = "input-change";
|
|
56
|
-
INPUT_ACTIONS["blur"] = "input-blur";
|
|
57
|
-
})(INPUT_ACTIONS || (INPUT_ACTIONS = {}));
|
|
58
|
-
var EMAIL_SEPARATORS;
|
|
59
|
-
(function (EMAIL_SEPARATORS) {
|
|
60
|
-
EMAIL_SEPARATORS["semicolon"] = ";";
|
|
61
|
-
EMAIL_SEPARATORS["comma"] = ",";
|
|
62
|
-
})(EMAIL_SEPARATORS || (EMAIL_SEPARATORS = {}));
|
|
63
|
-
var EXCLUDED_FIELDS;
|
|
64
|
-
(function (EXCLUDED_FIELDS) {
|
|
65
|
-
EXCLUDED_FIELDS["value"] = "value";
|
|
66
|
-
EXCLUDED_FIELDS["label"] = "label";
|
|
67
|
-
EXCLUDED_FIELDS["layoutType"] = "layoutType";
|
|
68
|
-
EXCLUDED_FIELDS["platform"] = "platform";
|
|
69
|
-
EXCLUDED_FIELDS["language"] = "language";
|
|
70
|
-
EXCLUDED_FIELDS["isEnteredByUser"] = "isEnteredByUser";
|
|
71
|
-
EXCLUDED_FIELDS["isMyContacts"] = "isMyContacts";
|
|
72
|
-
EXCLUDED_FIELDS["isChipsCollapsable"] = "isChipsCollapsable";
|
|
73
|
-
EXCLUDED_FIELDS["isSelectedChipHasTooltip"] = "isSelectedChipHasTooltip";
|
|
74
|
-
EXCLUDED_FIELDS["isInputFocused"] = "isInputFocused";
|
|
75
|
-
EXCLUDED_FIELDS["setIsSearchable"] = "setIsSearchable";
|
|
76
|
-
EXCLUDED_FIELDS["selectRef"] = "selectRef";
|
|
77
|
-
EXCLUDED_FIELDS["setModalData"] = "setModalData";
|
|
78
|
-
EXCLUDED_FIELDS["collapsableChipsCount"] = "collapsableChipsCount";
|
|
79
|
-
EXCLUDED_FIELDS["lastVisibleChipIndex"] = "lastVisibleChipIndex";
|
|
80
|
-
EXCLUDED_FIELDS["fontFamily"] = "fontFamily";
|
|
81
|
-
})(EXCLUDED_FIELDS || (EXCLUDED_FIELDS = {}));
|
|
82
|
-
var COMMON_FIELDS_TO_OMIT = Object.keys(omit(EXCLUDED_FIELDS, [EXCLUDED_FIELDS.language, EXCLUDED_FIELDS.isMyContacts, EXCLUDED_FIELDS.isEnteredByUser]));
|
|
83
|
-
var Input = function (props) { return _jsx(components.Input, __assign({}, props, { enterKeyHint: "done" })); };
|
|
84
47
|
var UserDropdown = function (_a) {
|
|
85
|
-
var _b
|
|
86
|
-
var _y =
|
|
87
|
-
var
|
|
88
|
-
var
|
|
89
|
-
var
|
|
90
|
-
var
|
|
91
|
-
var
|
|
92
|
-
var
|
|
93
|
-
var
|
|
94
|
-
var
|
|
95
|
-
var
|
|
48
|
+
var _b;
|
|
49
|
+
var _c = _a.platform, platform = _c === void 0 ? PLATFORM.web : _c, fontFamily = _a.fontFamily, _d = _a.isDisabled, isDisabled = _d === void 0 ? false : _d, _e = _a.isLoading, isLoading = _e === void 0 ? false : _e, _f = _a.isChipsOutline, isChipsOutline = _f === void 0 ? false : _f, _g = _a.isError, isError = _g === void 0 ? false : _g, _h = _a.isChipsVisible, isChipsVisible = _h === void 0 ? true : _h, _j = _a.isChipsCollapsable, isChipsCollapsable = _j === void 0 ? false : _j, _k = _a.isSelectedChipHasTooltip, isSelectedChipHasTooltip = _k === void 0 ? false : _k, _l = _a.isMenuCloseOnSelect, isMenuCloseOnSelect = _l === void 0 ? true : _l, _m = _a.isFilteringDisabled, isFilteringDisabled = _m === void 0 ? false : _m, _o = _a.hasNextPage, hasNextPage = _o === void 0 ? false : _o, _p = _a.isNextPageLoading, isNextPageLoading = _p === void 0 ? false : _p, _q = _a.isInputHidden, isInputHidden = _q === void 0 ? false : _q, _r = _a.isBackspaceChipToInput, isBackspaceChipToInput = _r === void 0 ? false : _r, _s = _a.isShowCatalogSearchButton, isShowCatalogSearchButton = _s === void 0 ? false : _s, _t = _a.isDisabledMenuOffsetAtFullscreen, isDisabledMenuOffsetAtFullscreen = _t === void 0 ? false : _t, _u = _a.isDisabledCheckUniqueEmails, isDisabledCheckUniqueEmails = _u === void 0 ? false : _u, _v = _a.isMenuShadowless, isMenuShadowless = _v === void 0 ? false : _v, _w = _a.isStateless, isStateless = _w === void 0 ? false : _w, _x = _a.isSelectedOptionsHidden, isSelectedOptionsHidden = _x === void 0 ? true : _x, _y = _a.isInputValueClearedOnBlur, isInputValueClearedOnBlur = _y === void 0 ? false : _y, _z = _a.language, language = _z === void 0 ? LANGUAGES.ru : _z, _0 = _a.layoutType, layoutType = _0 === void 0 ? LAYOUT_TYPE.minimal : _0, externalInputValue = _a.externalInputValue, title = _a.title, contactInfoTitle = _a.contactInfoTitle, mask = _a.mask, suffix = _a.suffix, _1 = _a.placeholder, placeholder = _1 === void 0 ? EMPTY_STRING : _1, focusPlaceholder = _a.focusPlaceholder, hint = _a.hint, onShowCatalogSearchButtonClick = _a.onShowCatalogSearchButtonClick, noOptionsMessage = _a.noOptionsMessage, maxMembersCount = _a.maxMembersCount, skeletonRowsCount = _a.skeletonRowsCount, _2 = _a.maxRowsCountToCollapseChips, maxRowsCountToCollapseChips = _2 === void 0 ? DEFAULT_MAX_ROWS_COUNT_TO_COLLAPSE_CHIPS : _2, _3 = _a.menuListMaxHeight, menuListMaxHeight = _3 === void 0 ? DEFAULT_MENU_LIST_MAX_HEIGHT : _3, _4 = _a.menuPosition, menuPosition = _4 === void 0 ? MENU_POSITIONS.top : _4, menuLocation = _a.menuLocation, menuPortalTarget = _a.menuPortalTarget, _5 = _a.autoFocus, autoFocus = _5 === void 0 ? false : _5, containerClassName = _a.containerClassName, charHintClassName = _a.charHintClassName, containerPadding = _a.containerPadding, containerStyles = _a.containerStyles, selectedEntries = _a.selectedEntries, corporateEntries = _a.corporateEntries, myContactsEntries = _a.myContactsEntries, emailsToExclude = _a.emailsToExclude, _6 = _a.userDropdownId, initialUserDropdownId = _6 === void 0 ? EMPTY_STRING : _6, focusRef = _a.focusRef, onInputChange = _a.onInputChange, onImmediateInputChange = _a.onImmediateInputChange, onChange = _a.onChange, onMenuOpen = _a.onMenuOpen, onMenuClose = _a.onMenuClose, onLoadNextPage = _a.onLoadNextPage, onClickContactInfoCopyEmail = _a.onClickContactInfoCopyEmail, onFocus = _a.onFocus;
|
|
50
|
+
var _7 = useState(initialUserDropdownId), userDropdownId = _7[0], setUserDropdownId = _7[1];
|
|
51
|
+
var _8 = useState([]), selectedUsers = _8[0], setSelectedUsers = _8[1];
|
|
52
|
+
var _9 = useState(EMPTY_STRING), paddingLeft = _9[0], setPaddingLeft = _9[1];
|
|
53
|
+
var _10 = useState(EMPTY_STRING), paddingRight = _10[0], setPaddingRight = _10[1];
|
|
54
|
+
var _11 = useState(0), maskWidth = _11[0], setMaskWidth = _11[1];
|
|
55
|
+
var _12 = useState(0), suffixWidth = _12[0], setSuffixWidth = _12[1];
|
|
56
|
+
var _13 = useState(true), isSearchable = _13[0], setIsSearchable = _13[1];
|
|
57
|
+
var _14 = useState(false), isUserTyping = _14[0], setIsUserTyping = _14[1];
|
|
58
|
+
var _15 = useState(null), modalData = _15[0], setModalData = _15[1];
|
|
59
|
+
var _16 = useState(EMPTY_STRING), chipLabelWithMaxWidth = _16[0], setChipLabelWithMaxWidth = _16[1];
|
|
60
|
+
var _17 = useState(EMPTY_STRING), inputValue = _17[0], setInputValue = _17[1];
|
|
61
|
+
var _18 = useState(placeholder), placeholderValue = _18[0], setPlaceholderValue = _18[1];
|
|
62
|
+
var _19 = useState(false), isDelimiterVisible = _19[0], setIsDelimiterVisible = _19[1];
|
|
63
|
+
var _20 = useState(0), delimiterOffset = _20[0], setDelimiterOffset = _20[1];
|
|
96
64
|
var isInputFocused = useRef(false);
|
|
97
65
|
var selectRef = useRef(null);
|
|
98
66
|
var maskRef = useRef(null);
|
|
67
|
+
var suffixRef = useRef(null);
|
|
99
68
|
var menuScrollFromTop = useRef(0);
|
|
100
69
|
var collapsableChipsCount = useRef(0);
|
|
70
|
+
var visibleChipsCount = useRef(0);
|
|
71
|
+
var isNeedCheckChipCollapsableCount = useRef(false);
|
|
101
72
|
var lastVisibleChipIndex = useRef(-1);
|
|
102
73
|
var skipAddUserToChipsOnNextBlurRef = useRef(false);
|
|
74
|
+
var userTypingTimeoutRef = useRef(null);
|
|
75
|
+
var prevIsLoadingRef = useRef(isLoading);
|
|
103
76
|
var selectedUsersLength = selectedUsers.length;
|
|
77
|
+
var _21 = useDroppable({ id: userDropdownId }), setNodeRef = _21.setNodeRef, over = _21.over;
|
|
78
|
+
var overId = (over || {}).id;
|
|
79
|
+
var isDraggable = overId === userDropdownId;
|
|
80
|
+
var isInputPlaceholderVisible = selectedUsersLength === 1 && isEmpty(inputValue) ? ((_b = selectedUsers[0].isNotRemovable) !== null && _b !== void 0 ? _b : false) : false;
|
|
81
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
82
|
+
useImperativeHandle(focusRef, function () { return ({ focus: handleFocus, blur: function () { return handleDragBlur(true); } }); }, []);
|
|
104
83
|
var fontFamilyStyle = generateFontFamilyStyle(fontFamily);
|
|
105
|
-
var
|
|
106
|
-
|
|
107
|
-
return regex.test(inputValue);
|
|
108
|
-
};
|
|
109
|
-
var checkIsEmailToExclude = function (email) { return includes(emailsToExclude, email); };
|
|
110
|
-
var calculatePaddingLeft = function () {
|
|
111
|
-
var _a, _b;
|
|
112
|
-
var maskWidth = ((_b = (_a = maskRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) === null || _b === void 0 ? void 0 : _b.width) || null;
|
|
113
|
-
maskWidth && setMaskWidth(maskWidth + GAP);
|
|
114
|
-
return "".concat(maskWidth ? maskWidth + MASK_INPUT_PL : DEFAULT_INPUT_PADDING, "px");
|
|
115
|
-
};
|
|
84
|
+
var isCharHintVisible = useCharHintDisplay({ inputValue: inputValue }).isCharHintVisible;
|
|
85
|
+
var checkIsEmailToExclude = useCallback(function (email) { return includes(emailsToExclude, email); }, [emailsToExclude]);
|
|
116
86
|
var generateStyles = function () {
|
|
117
87
|
return selectStyles({
|
|
118
88
|
isChipsVisible: isChipsVisible,
|
|
119
89
|
isMaxMembersAdded: maxMembersCount && isChipsVisible ? selectedUsersLength === maxMembersCount : false,
|
|
120
90
|
isDisabled: isDisabled,
|
|
121
|
-
|
|
91
|
+
isInputPlaceholderVisible: isInputPlaceholderVisible,
|
|
122
92
|
lastRowNumber: isChipsVisible ? Math.ceil(selectedUsersLength / 2) + 1 : 1,
|
|
123
93
|
paddingLeft: paddingLeft,
|
|
94
|
+
paddingRight: !isChipsVisible && !isEmpty(inputValue) ? PADDING_WITH_CLEAR_ICON : paddingRight,
|
|
124
95
|
platform: platform,
|
|
125
96
|
layoutType: layoutType,
|
|
126
97
|
isInputHidden: isInputHidden,
|
|
127
98
|
isDisabledMenuOffsetAtFullscreen: isDisabledMenuOffsetAtFullscreen,
|
|
99
|
+
isInputFocused: isInputFocused.current,
|
|
128
100
|
isMaskRepresented: !isEmpty(mask),
|
|
101
|
+
isSuffixRepresented: !isNil(suffix),
|
|
102
|
+
isMenuShadowless: isMenuShadowless,
|
|
103
|
+
isShowCatalogSearchButton: isShowCatalogSearchButton,
|
|
129
104
|
fontFamilyStyle: fontFamilyStyle,
|
|
105
|
+
containerPadding: containerPadding,
|
|
106
|
+
isDraggable: isDraggable,
|
|
107
|
+
isChipsCollapsed: isChipsCollapsable && !isInputFocused.current,
|
|
108
|
+
menuListMaxHeight: menuListMaxHeight,
|
|
109
|
+
maxRowsCountToCollapseChips: maxRowsCountToCollapseChips,
|
|
110
|
+
isError: isError,
|
|
130
111
|
});
|
|
131
112
|
};
|
|
132
113
|
var generateNoOptionsMessage = function (_a) {
|
|
@@ -151,71 +132,74 @@ var UserDropdown = function (_a) {
|
|
|
151
132
|
collapsableChipsCount: collapsableChipsCount,
|
|
152
133
|
lastVisibleChipIndex: lastVisibleChipIndex,
|
|
153
134
|
};
|
|
154
|
-
var
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
});
|
|
161
|
-
var query = ((_b = (_a = selectRef.current) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b.inputValue) || '';
|
|
162
|
-
var sortedCorporateContacts = sortContacts(corporateContacts, query);
|
|
163
|
-
var sortedMyContacts = sortContacts(myContactsEntries || [], query);
|
|
164
|
-
var filteredCorporateContacts = sortedCorporateContacts.filter(function (_a) {
|
|
165
|
-
var email = _a.email, contacts = _a.contacts;
|
|
166
|
-
return [email, contacts[0].contact].every(function (email) { return !checkIsEmailToExclude(email); });
|
|
167
|
-
});
|
|
168
|
-
var filteredMyContacts = sortedMyContacts.filter(function (_a) {
|
|
169
|
-
var email = _a.email;
|
|
170
|
-
return !checkIsEmailToExclude(email);
|
|
171
|
-
});
|
|
172
|
-
return __spreadArray(__spreadArray([], generateCorporateOptionsToSelect(__assign({ options: filteredCorporateContacts }, commonFields)), true), generateContactsOptionsToSelect(__assign({ options: filteredMyContacts }, commonFields)), true);
|
|
135
|
+
var _c = retrieveFilteredContacts({
|
|
136
|
+
query: ((_b = (_a = selectRef.current) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b.inputValue) || EMPTY_STRING,
|
|
137
|
+
corporateEntries: corporateEntries,
|
|
138
|
+
myContactsEntries: myContactsEntries,
|
|
139
|
+
checkIsEmailToExclude: checkIsEmailToExclude,
|
|
140
|
+
}), filteredCorporateContacts = _c.filteredCorporateContacts, filteredLocalContacts = _c.filteredLocalContacts, filteredMyContacts = _c.filteredMyContacts;
|
|
141
|
+
return __spreadArray(__spreadArray(__spreadArray([], generateCorporateOptionsToSelect(__assign({ options: filteredCorporateContacts }, commonFields)), true), generateContactsOptionsToSelect(__assign({ options: filteredLocalContacts, isLocalContact: true }, commonFields)), true), generateContactsOptionsToSelect(__assign({ options: filteredMyContacts, isMyContacts: true }, commonFields)), true);
|
|
173
142
|
};
|
|
143
|
+
var clearUserTypingTimeout = useCallback(function () {
|
|
144
|
+
var userTypingTimeoutRefCurrent = userTypingTimeoutRef.current;
|
|
145
|
+
if (userTypingTimeoutRefCurrent) {
|
|
146
|
+
clearTimeout(userTypingTimeoutRefCurrent);
|
|
147
|
+
userTypingTimeoutRef.current = null;
|
|
148
|
+
}
|
|
149
|
+
}, []);
|
|
150
|
+
useEffect(function () {
|
|
151
|
+
if (prevIsLoadingRef.current && !isLoading) {
|
|
152
|
+
setIsUserTyping(false);
|
|
153
|
+
clearUserTypingTimeout();
|
|
154
|
+
}
|
|
155
|
+
prevIsLoadingRef.current = isLoading;
|
|
156
|
+
}, [isLoading, clearUserTypingTimeout]);
|
|
174
157
|
var requestInputChangeDebounce = useMemo(function () {
|
|
175
158
|
return debounce(function (inputValue) {
|
|
176
159
|
onInputChange(inputValue);
|
|
177
|
-
|
|
160
|
+
clearUserTypingTimeout();
|
|
161
|
+
userTypingTimeoutRef.current = setTimeout(function () { return setIsUserTyping(false); }, CLEAR_USER_TYPING_TIMEOUT);
|
|
178
162
|
}, USER_TYPING_TIMEOUT);
|
|
179
|
-
}, [onInputChange]);
|
|
180
|
-
var resetIsUserTypingDebounce = useMemo(function () { return debounce(function () { return setIsUserTyping(false); }, USER_TYPING_TIMEOUT); }, []);
|
|
181
|
-
var handleResetError = function () { return isError && setIsError(false); };
|
|
163
|
+
}, [clearUserTypingTimeout, onInputChange]);
|
|
182
164
|
var handleMenuClose = function () {
|
|
183
165
|
menuScrollFromTop.current = 0;
|
|
184
|
-
|
|
185
|
-
onMenuClose
|
|
166
|
+
setIsDelimiterVisible(false);
|
|
167
|
+
onMenuClose === null || onMenuClose === void 0 ? void 0 : onMenuClose();
|
|
186
168
|
};
|
|
187
|
-
var handleInputChange = function (inputValue, additionalInfo) {
|
|
169
|
+
var handleInputChange = useCallback(function (inputValue, additionalInfo) {
|
|
188
170
|
if (additionalInfo) {
|
|
189
|
-
var action = additionalInfo.action,
|
|
171
|
+
var action = additionalInfo.action, _a = additionalInfo.prevInputValue, prevInputValue = _a === void 0 ? EMPTY_STRING : _a;
|
|
190
172
|
var trimPrevInputValue_1 = prevInputValue.trim();
|
|
191
173
|
var isInputBlurAction = action === INPUT_ACTIONS.blur;
|
|
192
174
|
var isMenuCloseAction = action === MENU_ACTIONS.close;
|
|
193
|
-
if (!isInputBlurAction && !isMenuCloseAction)
|
|
175
|
+
if (!isInputBlurAction && !isMenuCloseAction) {
|
|
194
176
|
setInputValue(inputValue);
|
|
177
|
+
onImmediateInputChange === null || onImmediateInputChange === void 0 ? void 0 : onImmediateInputChange(inputValue);
|
|
178
|
+
}
|
|
195
179
|
if ((isInputBlurAction || isMenuCloseAction) && checkIsValueIsEmail(trimPrevInputValue_1)) {
|
|
196
180
|
var isUserAlreadySelected = selectedUsers.some(function (_a) {
|
|
197
181
|
var email = _a.email;
|
|
198
182
|
return email === trimPrevInputValue_1;
|
|
199
183
|
});
|
|
200
|
-
|
|
184
|
+
var nextInputValue = isUserAlreadySelected || checkIsEmailToExclude(trimPrevInputValue_1) ? trimPrevInputValue_1 : inputValue;
|
|
185
|
+
setInputValue(nextInputValue);
|
|
186
|
+
onImmediateInputChange === null || onImmediateInputChange === void 0 ? void 0 : onImmediateInputChange(nextInputValue);
|
|
201
187
|
}
|
|
202
188
|
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
};
|
|
213
|
-
var handleAddUser = function (needToShowError) {
|
|
214
|
-
if (needToShowError === void 0) { needToShowError = true; }
|
|
215
|
-
var props = selectRef.current.props;
|
|
216
|
-
var options = props.options, inputValue = props.inputValue, onChange = props.onChange;
|
|
217
|
-
if (isEmpty(inputValue))
|
|
189
|
+
if (!isEmpty(inputValue)) {
|
|
190
|
+
clearUserTypingTimeout();
|
|
191
|
+
setIsUserTyping(true);
|
|
192
|
+
}
|
|
193
|
+
inputValue.length >= MIN_INPUT_SYMBOLS && requestInputChangeDebounce(inputValue);
|
|
194
|
+
}, [onImmediateInputChange, requestInputChangeDebounce, selectedUsers, checkIsEmailToExclude, clearUserTypingTimeout]);
|
|
195
|
+
var handleAddUser = function () {
|
|
196
|
+
var selectRefCurrent = selectRef.current;
|
|
197
|
+
if (isNil(selectRefCurrent))
|
|
218
198
|
return;
|
|
199
|
+
var props = selectRefCurrent.props;
|
|
200
|
+
var options = props.options, onChange = props.onChange;
|
|
201
|
+
if (isEmpty(inputValue))
|
|
202
|
+
return Promise.resolve();
|
|
219
203
|
var trimInputValue = inputValue.trim();
|
|
220
204
|
var optionProps = {
|
|
221
205
|
platform: platform,
|
|
@@ -247,10 +231,10 @@ var UserDropdown = function (_a) {
|
|
|
247
231
|
return email === inputEmail;
|
|
248
232
|
});
|
|
249
233
|
enteredUsers.push(existingUser || generateEnteredByUserOption(__assign(__assign({}, optionProps), { email: inputEmail })));
|
|
250
|
-
if (isUserAlreadySelected &&
|
|
251
|
-
|
|
234
|
+
if (isUserAlreadySelected && isSingleEmailEntered)
|
|
235
|
+
return;
|
|
252
236
|
else
|
|
253
|
-
handleInputChange(
|
|
237
|
+
handleInputChange(EMPTY_STRING, { action: INPUT_ACTIONS.change, prevInputValue: trimInputValue });
|
|
254
238
|
}
|
|
255
239
|
!isValueIsEmail && incorrectEmails.push(inputEmail);
|
|
256
240
|
});
|
|
@@ -264,7 +248,7 @@ var UserDropdown = function (_a) {
|
|
|
264
248
|
var isEnterPressed = code === ENTER_KEY || key === ENTER_KEY;
|
|
265
249
|
var isBackspacePressed = code === BACKSPACE_KEY || key === BACKSPACE_KEY;
|
|
266
250
|
var isSpacePressed = code === SPACE_KEY;
|
|
267
|
-
var isTransformChipToInputValue = isBackspacePressed && isBackspaceChipToInput && inputValue ===
|
|
251
|
+
var isTransformChipToInputValue = isBackspacePressed && isBackspaceChipToInput && inputValue === EMPTY_STRING && !isEmpty(selectedUsers);
|
|
268
252
|
if (isEnterPressed) {
|
|
269
253
|
event.preventDefault();
|
|
270
254
|
(_a = handleAddUser()) === null || _a === void 0 ? void 0 : _a.then(function () { });
|
|
@@ -290,26 +274,29 @@ var UserDropdown = function (_a) {
|
|
|
290
274
|
(_c = (_b = selectRef.current) === null || _b === void 0 ? void 0 : _b.onMenuOpen) === null || _c === void 0 ? void 0 : _c.call(_b);
|
|
291
275
|
}
|
|
292
276
|
};
|
|
293
|
-
var transformCurrentChipToInputValue = function (label,
|
|
277
|
+
var transformCurrentChipToInputValue = useCallback(function (label, value) {
|
|
294
278
|
var _a, _b;
|
|
295
279
|
skipAddUserToChipsOnNextBlurRef.current = true;
|
|
296
280
|
setSelectedUsers(function (prevSelectedUsers) {
|
|
297
281
|
var nextSelectedUsers = prevSelectedUsers.filter(function (_a) {
|
|
298
|
-
var userEmail = _a.email;
|
|
299
|
-
return userEmail !==
|
|
282
|
+
var userEmail = _a.email, userType = _a.userType, userUid = _a.uid;
|
|
283
|
+
return checkIfContactTypeIsGroup(userType) ? userUid !== value : userEmail !== value;
|
|
300
284
|
});
|
|
301
285
|
onChange === null || onChange === void 0 ? void 0 : onChange(nextSelectedUsers.map(function (userData) { return omit(userData, COMMON_FIELDS_TO_OMIT); }));
|
|
302
286
|
return nextSelectedUsers;
|
|
303
287
|
});
|
|
288
|
+
handleFocus();
|
|
304
289
|
setInputValue(label);
|
|
305
290
|
onInputChange(label);
|
|
306
291
|
handleInputChange(label);
|
|
307
292
|
onMenuOpen === null || onMenuOpen === void 0 ? void 0 : onMenuOpen();
|
|
308
293
|
(_b = (_a = selectRef.current) === null || _a === void 0 ? void 0 : _a.onMenuOpen) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
309
|
-
|
|
294
|
+
setIsUserTyping(false);
|
|
295
|
+
},
|
|
296
|
+
// eslint-disable-next-line
|
|
297
|
+
[onInputChange, handleInputChange, onMenuOpen, onChange]);
|
|
310
298
|
var handleChange = function (newSelectedUsers) {
|
|
311
|
-
var uniqNewSelectedUsers = uniqBy(newSelectedUsers, EMAIL_FIELD);
|
|
312
|
-
var users = [];
|
|
299
|
+
var uniqNewSelectedUsers = isDisabledCheckUniqueEmails ? newSelectedUsers : uniqBy(newSelectedUsers, EMAIL_FIELD);
|
|
313
300
|
var deletedUser = selectedUsers.find(function (_a) {
|
|
314
301
|
var value = _a.value;
|
|
315
302
|
return !uniqNewSelectedUsers.some(function (_a) {
|
|
@@ -319,108 +306,59 @@ var UserDropdown = function (_a) {
|
|
|
319
306
|
});
|
|
320
307
|
if (deletedUser === null || deletedUser === void 0 ? void 0 : deletedUser.isNotRemovable)
|
|
321
308
|
return;
|
|
322
|
-
|
|
323
|
-
var isEnteredByUser = user.isEnteredByUser, isMyContacts = user.isMyContacts;
|
|
324
|
-
var userToAdd = omit(user, COMMON_FIELDS_TO_OMIT);
|
|
325
|
-
var entryFieldsToExclude = isMyContacts ? [EXCLUDED_FIELDS.isMyContacts] : [EXCLUDED_FIELDS.language];
|
|
326
|
-
var fieldsToExclude = isEnteredByUser ? [EXCLUDED_FIELDS.isEnteredByUser] : entryFieldsToExclude;
|
|
327
|
-
users.push(omit(userToAdd, fieldsToExclude));
|
|
328
|
-
});
|
|
309
|
+
var users = transformSelectedUsers(uniqNewSelectedUsers);
|
|
329
310
|
onChange(users);
|
|
330
|
-
if (!isInputHidden)
|
|
311
|
+
if (!isInputHidden && !isStateless)
|
|
331
312
|
setSelectedUsers(uniqNewSelectedUsers);
|
|
332
313
|
if (!isInputFocused.current && isChipsCollapsable)
|
|
333
314
|
handleFocus();
|
|
334
315
|
};
|
|
335
|
-
var isContainsValue = function (_a) {
|
|
336
|
-
var label = _a.label, email = _a.email, value = _a.value;
|
|
337
|
-
return label.toLowerCase().includes(value) || email.toLowerCase().includes(value);
|
|
338
|
-
};
|
|
339
316
|
var handleFilterOption = function (_a, inputValue) {
|
|
340
|
-
var
|
|
341
|
-
|
|
342
|
-
var transliteratedInputValue = tr(originInputValue);
|
|
343
|
-
var toEngInputValue = ru.toEn(originInputValue);
|
|
344
|
-
var fromEngInputValue = ru.fromEn(originInputValue);
|
|
345
|
-
var isUserAlreadySelected = selectedUsers.find(function (_a) {
|
|
346
|
-
var email = _a.email;
|
|
347
|
-
return email === optionEmail;
|
|
348
|
-
});
|
|
349
|
-
var isContainsInputValue = [originInputValue, transliteratedInputValue, toEngInputValue, fromEngInputValue].some(function (value) {
|
|
350
|
-
return isContainsValue({ label: label, email: optionEmail, value: value });
|
|
351
|
-
});
|
|
352
|
-
if (isFilteringDisabled)
|
|
353
|
-
return !isEmpty(selectedUsers) ? !isUserAlreadySelected : true;
|
|
354
|
-
return !isEmpty(selectedUsers) ? !isUserAlreadySelected && isContainsInputValue : isContainsInputValue;
|
|
355
|
-
};
|
|
356
|
-
var generateTruncatedElementY = function (element) { return Math.trunc(element.getBoundingClientRect().y); };
|
|
357
|
-
var calculateCounterWidth = function (counterNumber) {
|
|
358
|
-
if (counterNumber >= 100)
|
|
359
|
-
return THREE_DIGIT_NUMBER_WIDTH;
|
|
360
|
-
if (counterNumber >= 10)
|
|
361
|
-
return TWO_DIGIT_NUMBER_WIDTH;
|
|
362
|
-
return SINGLE_DIGIT_NUMBER_WIDTH;
|
|
317
|
+
var data = _a.data;
|
|
318
|
+
return applyFilteringToOption({ isFilteringDisabled: isFilteringDisabled, isSelectedOptionsHidden: isSelectedOptionsHidden, inputValue: inputValue, data: data, selectedUsers: selectedUsers });
|
|
363
319
|
};
|
|
364
320
|
var handleCollapseChips = function () {
|
|
365
|
-
var
|
|
366
|
-
var collapsableChips = 0;
|
|
367
|
-
var chipLabelWithMaxWidth = '';
|
|
368
|
-
var chipsNodes = ((_a = document.querySelector("#".concat(userDropdownId))) === null || _a === void 0 ? void 0 : _a.querySelectorAll('.smartapp-chip')) || [];
|
|
369
|
-
var chips = Array.from(chipsNodes);
|
|
321
|
+
var chips = retrieveChipsElements(userDropdownId);
|
|
370
322
|
if (isEmpty(chips))
|
|
371
323
|
return;
|
|
372
|
-
var
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
else {
|
|
382
|
-
y === ySecondRow && secondRow.push(chip);
|
|
383
|
-
}
|
|
384
|
-
});
|
|
385
|
-
var counterWidth = calculateCounterWidth(collapsableChips);
|
|
386
|
-
var rowWidth = counterWidth + INPUT_SPACE_WIDTH;
|
|
387
|
-
var dropdownWidth = ((_b = document.querySelector("#".concat(userDropdownId))) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect().width) - maskWidth;
|
|
388
|
-
secondRow.forEach(function (chip) {
|
|
389
|
-
var _a;
|
|
390
|
-
rowWidth += chip.getBoundingClientRect().width + GAP;
|
|
391
|
-
if (rowWidth > dropdownWidth) {
|
|
392
|
-
if (secondRow.length > 1) {
|
|
393
|
-
collapsableChips += 1;
|
|
394
|
-
}
|
|
395
|
-
else {
|
|
396
|
-
var emptySpaceWidth = collapsableChips > 0 ? counterWidth + INPUT_SPACE_WIDTH + GAP : INPUT_SPACE_WIDTH;
|
|
397
|
-
chip.style.maxWidth = "".concat(dropdownWidth - emptySpaceWidth, "px");
|
|
398
|
-
chipLabelWithMaxWidth = ((_a = chip.querySelector('.smartapp-chip__info--name')) === null || _a === void 0 ? void 0 : _a.innerHTML) || '';
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
});
|
|
324
|
+
var _a = collapseChips({
|
|
325
|
+
userDropdownId: userDropdownId,
|
|
326
|
+
maxRowsCountToCollapseChips: maxRowsCountToCollapseChips,
|
|
327
|
+
maskWidth: maskWidth,
|
|
328
|
+
suffixWidth: suffixWidth,
|
|
329
|
+
chips: chips,
|
|
330
|
+
}), collapsableChips = _a.collapsableChips, numberOfVisibleChips = _a.numberOfVisibleChips, chipLabelWithMaxWidth = _a.chipLabelWithMaxWidth;
|
|
331
|
+
isNeedCheckChipCollapsableCount.current = true;
|
|
332
|
+
visibleChipsCount.current = numberOfVisibleChips;
|
|
402
333
|
collapsableChipsCount.current = collapsableChips;
|
|
403
|
-
lastVisibleChipIndex.current =
|
|
334
|
+
lastVisibleChipIndex.current = numberOfVisibleChips;
|
|
404
335
|
setChipLabelWithMaxWidth(chipLabelWithMaxWidth || generateId());
|
|
405
336
|
};
|
|
406
|
-
var handleUnCollapseChips = function () {
|
|
407
|
-
var _a;
|
|
337
|
+
var handleUnCollapseChips = useCallback(function () {
|
|
408
338
|
if (!userDropdownId)
|
|
409
339
|
return;
|
|
410
|
-
var
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
var chipLabel = ((_a = chip.querySelector('.smartapp-chip__info--name')) === null || _a === void 0 ? void 0 : _a.innerHTML) || '';
|
|
415
|
-
chipLabel === chipLabelWithMaxWidth && (chip.style.maxWidth = '100%');
|
|
416
|
-
});
|
|
340
|
+
var chips = retrieveChipsElements(userDropdownId);
|
|
341
|
+
unCollapseChips(chipLabelWithMaxWidth, chips);
|
|
342
|
+
isNeedCheckChipCollapsableCount.current = false;
|
|
343
|
+
visibleChipsCount.current = chips.length;
|
|
417
344
|
collapsableChipsCount.current = 0;
|
|
418
345
|
lastVisibleChipIndex.current = -1;
|
|
419
|
-
setChipLabelWithMaxWidth(
|
|
346
|
+
setChipLabelWithMaxWidth(EMPTY_STRING);
|
|
347
|
+
}, [chipLabelWithMaxWidth, userDropdownId]);
|
|
348
|
+
var handleDragBlur = function (isDisableCheckFocused) {
|
|
349
|
+
var _a;
|
|
350
|
+
if (!isInputFocused.current && !isDisableCheckFocused)
|
|
351
|
+
return;
|
|
352
|
+
if (selectRef.current)
|
|
353
|
+
selectRef.current._preventBlur = false;
|
|
354
|
+
(_a = selectRef.current) === null || _a === void 0 ? void 0 : _a.blur();
|
|
420
355
|
};
|
|
421
356
|
var handleBlur = function () {
|
|
422
357
|
var _a;
|
|
423
358
|
var shouldSkipAddUserToChipsOnNextBlur = skipAddUserToChipsOnNextBlurRef.current;
|
|
359
|
+
var _b = selectRef.current || {}, _preventBlur = _b._preventBlur, _contextMenuOpen = _b._contextMenuOpen, _isDragging = _b._isDragging;
|
|
360
|
+
if (_preventBlur || _contextMenuOpen || _isDragging || skipAddUserToChipsOnNextBlurRef.current)
|
|
361
|
+
return;
|
|
424
362
|
var onBlurComplete = function () {
|
|
425
363
|
isChipsCollapsable && handleCollapseChips();
|
|
426
364
|
isInputFocused.current = false;
|
|
@@ -430,19 +368,42 @@ var UserDropdown = function (_a) {
|
|
|
430
368
|
return;
|
|
431
369
|
}
|
|
432
370
|
else
|
|
433
|
-
(_a = handleAddUser(
|
|
371
|
+
(_a = handleAddUser()) === null || _a === void 0 ? void 0 : _a.then(function () { return requestAnimationFrame(function () { return requestAnimationFrame(function () { return onBlurComplete(); }); }); });
|
|
434
372
|
skipAddUserToChipsOnNextBlurRef.current = false;
|
|
435
373
|
};
|
|
436
|
-
var
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
setTimeout(function () { var _a; return (_a = selectRef.current) === null || _a === void 0 ? void 0 : _a.focus(); }, 100);
|
|
374
|
+
var handleSelectBlur = function () {
|
|
375
|
+
setPlaceholderValue(placeholder);
|
|
376
|
+
if (isInputValueClearedOnBlur) {
|
|
377
|
+
setInputValue(EMPTY_STRING);
|
|
378
|
+
onImmediateInputChange === null || onImmediateInputChange === void 0 ? void 0 : onImmediateInputChange(EMPTY_STRING);
|
|
442
379
|
}
|
|
380
|
+
setTimeout(handleBlur, RENDER_DELAY);
|
|
381
|
+
};
|
|
382
|
+
var focusInputIOS = useCallback(function (input) {
|
|
383
|
+
var length = input.value.length;
|
|
384
|
+
requestAnimationFrame(function () {
|
|
385
|
+
input.focus();
|
|
386
|
+
input.value === EMPTY_STRING ? setCaretInEmptyInput(input) : setCaretPosition(input, length);
|
|
387
|
+
});
|
|
388
|
+
}, []);
|
|
389
|
+
var handleFocus = useCallback(function (isDisableCheckFocused) {
|
|
390
|
+
setPlaceholderValue(focusPlaceholder || SEARCH_PLACEHOLDER[language]);
|
|
391
|
+
if (isInputFocused.current && !isDisableCheckFocused)
|
|
392
|
+
return;
|
|
443
393
|
isInputFocused.current = true;
|
|
394
|
+
var selectRefCurrent = selectRef.current;
|
|
395
|
+
var _a = selectRefCurrent || {}, _preventBlur = _a._preventBlur, inputRef = _a.inputRef;
|
|
396
|
+
setTimeout(function () {
|
|
397
|
+
if (selectRefCurrent && !_preventBlur)
|
|
398
|
+
isIosPlatform(platform) && inputRef ? focusInputIOS(inputRef) : selectRefCurrent.focus();
|
|
399
|
+
}, RENDER_DELAY);
|
|
444
400
|
isChipsCollapsable && handleUnCollapseChips();
|
|
445
|
-
};
|
|
401
|
+
}, [focusPlaceholder, language, isChipsCollapsable, handleUnCollapseChips, platform, focusInputIOS]);
|
|
402
|
+
var handleForceFocus = useCallback(function () { return setTimeout(function () { return handleFocus(true); }, RENDER_DELAY); }, [handleFocus]);
|
|
403
|
+
var handleSelectFocus = useCallback(function () {
|
|
404
|
+
handleFocus();
|
|
405
|
+
onFocus === null || onFocus === void 0 ? void 0 : onFocus();
|
|
406
|
+
}, [handleFocus, onFocus]);
|
|
446
407
|
var handleCloseModal = function () {
|
|
447
408
|
setModalData(null);
|
|
448
409
|
setIsSearchable(true);
|
|
@@ -450,16 +411,7 @@ var UserDropdown = function (_a) {
|
|
|
450
411
|
new Promise(function (resolve) { return resolve(); }).then(function () { var _a; return (_a = selectRef.current) === null || _a === void 0 ? void 0 : _a.focus(); });
|
|
451
412
|
}
|
|
452
413
|
};
|
|
453
|
-
var
|
|
454
|
-
var renderMask = function () {
|
|
455
|
-
return mask && (_jsx("div", __assign({ ref: maskRef, className: "smartapp-user-dropdown__container--mask" }, { children: mask })));
|
|
456
|
-
};
|
|
457
|
-
var renderHint = function () {
|
|
458
|
-
if (isNil(hint))
|
|
459
|
-
return;
|
|
460
|
-
return isString(hint) ? _jsx("div", __assign({ className: "smartapp-user-dropdown__hint" }, { children: hint })) : hint;
|
|
461
|
-
};
|
|
462
|
-
var modalContent = modalData ? (_jsx(ContactBottomSheet, { fontFamily: fontFamily, language: language, avatar: modalData.avatar, name: modalData.name, email: modalData.email, serverName: modalData.serverName, company: modalData.company, department: modalData.department, companyPosition: modalData.companyPosition })) : (_jsx(_Fragment, {}));
|
|
414
|
+
var modalContent = modalData ? (_jsx(ContactBottomSheet, { fontFamily: fontFamily, language: language, contactInfoTitle: contactInfoTitle, avatar: modalData.avatar, name: modalData.name, email: modalData.email, serverName: modalData.serverName, company: modalData.company, department: modalData.department, companyPosition: modalData.companyPosition, handleCloseModal: handleCloseModal, onClickContactInfoCopyEmail: onClickContactInfoCopyEmail })) : (_jsx(_Fragment, {}));
|
|
463
415
|
useEffect(function () {
|
|
464
416
|
if (externalInputValue && isInputHidden) {
|
|
465
417
|
setInputValue(externalInputValue);
|
|
@@ -471,47 +423,45 @@ var UserDropdown = function (_a) {
|
|
|
471
423
|
!userDropdownId && setUserDropdownId("user_dropdown_".concat(generateId().replace(/-/g, '_')));
|
|
472
424
|
}, [userDropdownId]);
|
|
473
425
|
useLayoutEffect(function () {
|
|
474
|
-
if (
|
|
475
|
-
|
|
426
|
+
if (isChipsCollapsable && !isEmpty(chipLabelWithMaxWidth) && !isInputFocused.current) {
|
|
427
|
+
handleUnCollapseChips();
|
|
428
|
+
handleCollapseChips();
|
|
476
429
|
}
|
|
477
430
|
// eslint-disable-next-line
|
|
431
|
+
}, [hint]);
|
|
432
|
+
useLayoutEffect(function () {
|
|
433
|
+
if (userDropdownId)
|
|
434
|
+
setTimeout(function () { return (isChipsCollapsable ? handleCollapseChips() : handleUnCollapseChips()); }, RENDER_DELAY);
|
|
435
|
+
// eslint-disable-next-line
|
|
478
436
|
}, [isChipsCollapsable, userDropdownId]);
|
|
479
437
|
useEffect(function () {
|
|
480
|
-
setPaddingLeft(
|
|
438
|
+
setPaddingLeft(calculateHorizontalPadding(maskRef, setMaskWidth));
|
|
481
439
|
}, [mask]);
|
|
440
|
+
useEffect(function () {
|
|
441
|
+
setPaddingRight(calculateHorizontalPadding(suffixRef, setSuffixWidth));
|
|
442
|
+
}, [suffix]);
|
|
482
443
|
useEffect(function () {
|
|
483
444
|
setSelectedUsers(function (prevSelectedUsers) {
|
|
484
445
|
return prevSelectedUsers.map(function (selectedUser) { return (__assign(__assign({}, selectedUser), { layoutType: layoutType, fontFamily: fontFamily, language: language, isChipsCollapsable: isChipsCollapsable })); });
|
|
485
446
|
});
|
|
486
447
|
}, [layoutType, fontFamily, language, isChipsCollapsable]);
|
|
487
448
|
useEffect(function () {
|
|
488
|
-
if (!isEmpty(selectedEntries)) {
|
|
449
|
+
if (isArray(selectedEntries) && !isEmpty(selectedEntries)) {
|
|
489
450
|
setSelectedUsers(selectedEntries.map(function (entity) {
|
|
490
|
-
var
|
|
491
|
-
var
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
contextMenuItems: contextMenuItems,
|
|
498
|
-
isSelectedChipHasTooltip: isSelectedChipHasTooltip,
|
|
499
|
-
isLoading: isLoading,
|
|
500
|
-
isWarning: isWarning,
|
|
501
|
-
isOrganizer: isOrganizer,
|
|
502
|
-
userType: userType,
|
|
503
|
-
uid: uid,
|
|
504
|
-
isInputFocused: isInputFocused,
|
|
505
|
-
selectRef: selectRef,
|
|
506
|
-
collapsableChipsCount: collapsableChipsCount,
|
|
507
|
-
lastVisibleChipIndex: lastVisibleChipIndex,
|
|
451
|
+
var contextMenuItems = entity.contextMenuItems;
|
|
452
|
+
var generateContextMenuItems = function () {
|
|
453
|
+
return contextMenuItems === null || contextMenuItems === void 0 ? void 0 : contextMenuItems.map(function (item) { return (__assign(__assign({}, item), { action: function (data) {
|
|
454
|
+
var _a;
|
|
455
|
+
(_a = item.action) === null || _a === void 0 ? void 0 : _a.call(item, data);
|
|
456
|
+
isMobilePlatform(platform) && handleFocus(true);
|
|
457
|
+
} })); });
|
|
508
458
|
};
|
|
509
|
-
var
|
|
510
|
-
|
|
511
|
-
: generateContactsOption(__assign({ option: entity }, commonFields));
|
|
512
|
-
return 'contacts' in entity ? generateCorporateOption(__assign({ option: entity }, commonFields)) : generatedNotCorporateEntity;
|
|
459
|
+
var commonFields = __assign(__assign({}, pick(entity, COMMON_FIELDS_TO_PICK)), { platform: platform, layoutType: layoutType, fontFamily: fontFamily, language: language, isChipsCollapsable: isChipsCollapsable, isSelectedChipHasTooltip: isSelectedChipHasTooltip, isInputFocused: isInputFocused, selectRef: selectRef, collapsableChipsCount: collapsableChipsCount, lastVisibleChipIndex: lastVisibleChipIndex, contextMenuItems: generateContextMenuItems() });
|
|
460
|
+
return transformSelectedEntity(entity, commonFields);
|
|
513
461
|
}));
|
|
514
462
|
}
|
|
463
|
+
else
|
|
464
|
+
setSelectedUsers([]);
|
|
515
465
|
// eslint-disable-next-line
|
|
516
466
|
}, [selectedEntries]);
|
|
517
467
|
useEffect(function () {
|
|
@@ -524,15 +474,42 @@ var UserDropdown = function (_a) {
|
|
|
524
474
|
useEffect(function () {
|
|
525
475
|
return function () {
|
|
526
476
|
requestInputChangeDebounce.cancel();
|
|
527
|
-
|
|
477
|
+
clearUserTypingTimeout();
|
|
528
478
|
};
|
|
529
|
-
}, [
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
479
|
+
}, [clearUserTypingTimeout, requestInputChangeDebounce]);
|
|
480
|
+
useEffect(function () {
|
|
481
|
+
if (isChipsCollapsable && !isInputFocused.current && isNeedCheckChipCollapsableCount.current)
|
|
482
|
+
collapsableChipsCount.current = (selectedEntries || []).length - visibleChipsCount.current;
|
|
483
|
+
}, [isChipsCollapsable, selectedEntries]);
|
|
484
|
+
var OptionComponent = useCallback(function (props) { return _jsx(Option, __assign({}, props, { isMenuShadowless: isMenuShadowless, children: props.children })); }, [isMenuShadowless]);
|
|
485
|
+
var MenuListComponent = useCallback(function (props) { return (_jsx(MenuList, __assign({}, props, { children: props.children, selectRef: selectRef, scrollFromTop: menuScrollFromTop, language: language, platform: platform, menuListMaxHeight: menuListMaxHeight, charHintClassName: charHintClassName, hasNextPage: hasNextPage, isLoading: isLoading, isShowCatalogSearchButton: isShowCatalogSearchButton, onShowCatalogSearchButtonClick: onShowCatalogSearchButtonClick, isUserTyping: isUserTyping, isCharHintVisible: isCharHintVisible, isMenuShadowless: isMenuShadowless, isNextPageLoading: isNextPageLoading, onLoadNextPage: function (inputValue) { return onLoadNextPage === null || onLoadNextPage === void 0 ? void 0 : onLoadNextPage(inputValue); }, setIsDelimiterVisible: setIsDelimiterVisible }))); }, [
|
|
486
|
+
charHintClassName,
|
|
487
|
+
hasNextPage,
|
|
488
|
+
isCharHintVisible,
|
|
489
|
+
isLoading,
|
|
490
|
+
isMenuShadowless,
|
|
491
|
+
isNextPageLoading,
|
|
492
|
+
isShowCatalogSearchButton,
|
|
493
|
+
isUserTyping,
|
|
494
|
+
language,
|
|
495
|
+
menuListMaxHeight,
|
|
496
|
+
onLoadNextPage,
|
|
497
|
+
onShowCatalogSearchButtonClick,
|
|
498
|
+
platform,
|
|
499
|
+
]);
|
|
500
|
+
var NoOptionsButton = function (props) { return (_jsx(components.NoOptionsMessage, __assign({}, props, { children: _jsx(SearchInCatalogButton, { language: language, isOnlyButtonInList: true, isMenuShadowless: isMenuShadowless, noOptionText: isShowCatalogSearchButton ? undefined : generateNoOptionsMessage({ inputValue: inputValue }), onShowCatalogSearchButtonClick: onShowCatalogSearchButtonClick }) }))); };
|
|
501
|
+
var InputComponent = useCallback(function (props) { return (_jsx(Input, __assign({}, props, { "data-is-clearable": !isChipsVisible, "data-placeholder": placeholderValue, suffixref: suffixRef, suffix: suffix }))); }, [isChipsVisible, placeholderValue, suffix]);
|
|
502
|
+
var MultiValueLabelComponent = useCallback(function (props) { return (_jsx(MultiValueLabel, __assign({}, props, { platform: platform, isChipsOutline: isChipsOutline, transformCurrentChipToInputValue: transformCurrentChipToInputValue, handleBlurDropdown: function () { return handleDragBlur(true); }, handleRequestFocus: handleForceFocus }))); }, [platform, isChipsOutline, transformCurrentChipToInputValue, handleForceFocus]);
|
|
503
|
+
var setContainerNodeRef = function (ref) {
|
|
504
|
+
var _a = ((ref === null || ref === void 0 ? void 0 : ref.getBoundingClientRect()) || {}).left, left = _a === void 0 ? 0 : _a;
|
|
505
|
+
setNodeRef(ref);
|
|
506
|
+
setDelimiterOffset(isShowCatalogSearchButton ? 0 : left);
|
|
507
|
+
};
|
|
508
|
+
return (_jsxs("div", __assign({ id: userDropdownId, className: classNames('smartapp-user-dropdown', containerClassName), style: __assign(__assign({}, fontFamilyStyle), containerStyles) }, { children: [_jsx(Title, { text: title }), _jsxs("div", __assign({ className: "smartapp-user-dropdown__container", ref: setContainerNodeRef }, { children: [_jsx(Mask, { mask: mask, elementRef: maskRef }), _jsx(Select, { ref: selectRef, menuIsOpen: isInputHidden ? !!externalInputValue : undefined, menuPortalTarget: menuPortalTarget === null || menuPortalTarget === void 0 ? void 0 : menuPortalTarget.current, isMulti: true, openMenuOnFocus: true, hideSelectedOptions: isSelectedOptionsHidden, blurInputOnSelect: false, captureMenuScroll: false, isSearchable: isSearchable, menuPlacement: menuPosition, menuPosition: menuLocation, controlShouldRenderValue: isChipsVisible, backspaceRemovesValue: isChipsVisible, isDisabled: isDisabled, closeMenuOnSelect: isMenuCloseOnSelect, isLoading: isLoading || isUserTyping, isClearable: false, isOptionDisabled: function (_a) {
|
|
509
|
+
var _b = _a.isAlreadyAdded, isAlreadyAdded = _b === void 0 ? false : _b;
|
|
510
|
+
return isAlreadyAdded;
|
|
511
|
+
}, styles: generateStyles(), placeholder: placeholderValue, noOptionsMessage: generateNoOptionsMessage, loadingMessage: function () { return _jsx(LoadingMessage, { isMenuShadowless: isMenuShadowless, skeletonRowsCount: skeletonRowsCount }); }, value: selectedUsers, inputValue: inputValue, options: !isNull(corporateEntries) || !isNull(myContactsEntries) ? generateOptions() : undefined, filterOption: handleFilterOption, onInputChange: handleInputChange, onChange: handleChange, onMenuClose: handleMenuClose, onMenuOpen: onMenuOpen, onKeyDown: handleKeyDown, onBlur: handleSelectBlur, autoFocus: autoFocus, onFocus: handleSelectFocus, instanceId: userDropdownId, components: {
|
|
512
|
+
Input: InputComponent,
|
|
536
513
|
MultiValueLabel: MultiValueLabelComponent,
|
|
537
514
|
MultiValueRemove: MultiValueRemove,
|
|
538
515
|
Option: OptionComponent,
|
|
@@ -541,7 +518,7 @@ var UserDropdown = function (_a) {
|
|
|
541
518
|
LoadingIndicator: LoadingIndicator,
|
|
542
519
|
MenuList: MenuListComponent,
|
|
543
520
|
NoOptionsMessage: NoOptionsButton,
|
|
544
|
-
} })] })),
|
|
521
|
+
} }), _jsx(Delimiter, { isDelimiterVisible: isDelimiterVisible, isMenuShadowless: isMenuShadowless, isShowCatalogSearchButton: isShowCatalogSearchButton, delimiterOffset: delimiterOffset })] })), _jsx(Hint, { text: hint }), _jsx(Modal, { isModalOpen: !isNull(modalData), platform: platform, fontFamily: fontFamily, content: modalContent, isBottomSheet: isMobilePlatform(platform), backgroundColor: "var(--color-bg-blackout-transparent)", handleCloseModal: handleCloseModal })] })));
|
|
545
522
|
};
|
|
546
|
-
export default UserDropdown;
|
|
523
|
+
export default memo(UserDropdown);
|
|
547
524
|
//# sourceMappingURL=UserDropdown.js.map
|