@expressms/smartapp-ui 3.0.0-alpha.17 → 3.0.0-alpha.170
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/declined-invite-status.svg +4 -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/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/pdf-small.svg +5 -5
- package/build/main/assets/icons/ppt-small.svg +5 -5
- 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/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 +3 -0
- package/build/main/assets/storybook/index.js +3 -0
- package/build/main/assets/storybook/index.js.map +1 -1
- package/build/main/constants/constants.d.ts +92 -46
- package/build/main/constants/constants.js +133 -49
- 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 +199 -12
- 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 +84 -26
- package/build/main//321/201omponents/AttachedFile/AttachedFile.js.map +1 -1
- package/build/main//321/201omponents/AttachedFile/types.d.ts +1 -0
- package/build/main//321/201omponents/Avatar/Avatar.d.ts +3 -2
- package/build/main//321/201omponents/Avatar/Avatar.js +53 -23
- 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 +16 -10
- 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 +200 -45
- package/build/main//321/201omponents/Chip/Chip.js.map +1 -1
- package/build/main//321/201omponents/Chip/types.d.ts +14 -4
- 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 +66 -26
- package/build/main//321/201omponents/ContextMenu/ContextMenu.js.map +1 -1
- package/build/main//321/201omponents/ContextMenu/types.d.ts +13 -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 +21 -17
- package/build/main//321/201omponents/CustomSelect/CustomSelect.js.map +1 -1
- package/build/main//321/201omponents/CustomSelect/selectStyles.d.ts +1 -1
- package/build/main//321/201omponents/CustomSelect/selectStyles.js +21 -22
- package/build/main//321/201omponents/CustomSelect/selectStyles.js.map +1 -1
- package/build/main//321/201omponents/CustomSelect/types.d.ts +16 -3
- 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 +24 -18
- package/build/main//321/201omponents/DraggablePopup/DraggablePopup.js.map +1 -1
- package/build/main//321/201omponents/DraggablePopup/types.d.ts +8 -8
- 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 +21 -10
- package/build/main//321/201omponents/ListItem/ListItem.js.map +1 -1
- package/build/main//321/201omponents/ListItem/types.d.ts +7 -2
- package/build/main//321/201omponents/Modal/Modal.d.ts +3 -2
- package/build/main//321/201omponents/Modal/Modal.js +199 -87
- package/build/main//321/201omponents/Modal/Modal.js.map +1 -1
- package/build/main//321/201omponents/Modal/types.d.ts +37 -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 +2 -2
- package/build/main//321/201omponents/Textarea/Textarea.js.map +1 -1
- package/build/main//321/201omponents/Textarea/types.d.ts +2 -2
- package/build/main//321/201omponents/UserDropdown/ContactInfo/ContactInfo.js +12 -0
- 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 +34 -58
- 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 +34 -37
- package/build/main//321/201omponents/UserDropdown/MultiValueLabel/MultiValueLabel.js.map +1 -1
- package/build/main//321/201omponents/UserDropdown/Option/Option.js +2 -2
- 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 +230 -261
- 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 +59 -0
- package/build/main//321/201omponents/UserDropdown/constants.js.map +1 -1
- package/build/main//321/201omponents/UserDropdown/helpers.d.ts +76 -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 +49 -26
- package/build/main//321/201omponents/UserDropdown/selectStyles.js.map +1 -1
- package/build/main//321/201omponents/UserDropdown/types.d.ts +126 -59
- package/build/main//321/201omponents/UserDropdown/types.js +1 -8
- package/build/main//321/201omponents/UserDropdown/types.js.map +1 -1
- package/package.json +11 -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, 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,100 +34,82 @@ 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.language, language = _w === void 0 ? LANGUAGES.ru : _w, _x = _a.layoutType, layoutType = _x === void 0 ? LAYOUT_TYPE.minimal : _x, externalInputValue = _a.externalInputValue, title = _a.title, mask = _a.mask, suffix = _a.suffix, _y = _a.placeholder, placeholder = _y === void 0 ? EMPTY_STRING : _y, hint = _a.hint, onShowCatalogSearchButtonClick = _a.onShowCatalogSearchButtonClick, noOptionsMessage = _a.noOptionsMessage, maxMembersCount = _a.maxMembersCount, skeletonRowsCount = _a.skeletonRowsCount, _z = _a.maxRowsCountToCollapseChips, maxRowsCountToCollapseChips = _z === void 0 ? DEFAULT_MAX_ROWS_COUNT_TO_COLLAPSE_CHIPS : _z, _0 = _a.menuListMaxHeight, menuListMaxHeight = _0 === void 0 ? DEFAULT_MENU_LIST_MAX_HEIGHT : _0, _1 = _a.menuPosition, menuPosition = _1 === void 0 ? MENU_POSITIONS.top : _1, menuLocation = _a.menuLocation, menuPortalTarget = _a.menuPortalTarget, _2 = _a.autoFocus, autoFocus = _2 === void 0 ? false : _2, containerClassName = _a.containerClassName, containerPadding = _a.containerPadding, containerStyles = _a.containerStyles, _3 = _a.selectedEntries, selectedEntries = _3 === void 0 ? [] : _3, corporateEntries = _a.corporateEntries, myContactsEntries = _a.myContactsEntries, _4 = _a.emailsToExclude, emailsToExclude = _4 === void 0 ? [] : _4, _5 = _a.userDropdownId, initialUserDropdownId = _5 === void 0 ? EMPTY_STRING : _5, focusRef = _a.focusRef, onInputChange = _a.onInputChange, onImmediateInputChange = _a.onImmediateInputChange, onChange = _a.onChange, onMenuOpen = _a.onMenuOpen, onMenuClose = _a.onMenuClose, onLoadNextPage = _a.onLoadNextPage, onFocus = _a.onFocus;
|
|
50
|
+
var _6 = useState(initialUserDropdownId), userDropdownId = _6[0], setUserDropdownId = _6[1];
|
|
51
|
+
var _7 = useState([]), selectedUsers = _7[0], setSelectedUsers = _7[1];
|
|
52
|
+
var _8 = useState(EMPTY_STRING), paddingLeft = _8[0], setPaddingLeft = _8[1];
|
|
53
|
+
var _9 = useState(EMPTY_STRING), paddingRight = _9[0], setPaddingRight = _9[1];
|
|
54
|
+
var _10 = useState(0), maskWidth = _10[0], setMaskWidth = _10[1];
|
|
55
|
+
var _11 = useState(0), suffixWidth = _11[0], setSuffixWidth = _11[1];
|
|
56
|
+
var _12 = useState(true), isSearchable = _12[0], setIsSearchable = _12[1];
|
|
57
|
+
var _13 = useState(false), isUserTyping = _13[0], setIsUserTyping = _13[1];
|
|
58
|
+
var _14 = useState(null), modalData = _14[0], setModalData = _14[1];
|
|
59
|
+
var _15 = useState(EMPTY_STRING), chipLabelWithMaxWidth = _15[0], setChipLabelWithMaxWidth = _15[1];
|
|
60
|
+
var _16 = useState(EMPTY_STRING), inputValue = _16[0], setInputValue = _16[1];
|
|
61
|
+
var _17 = useState(placeholder), placeholderValue = _17[0], setPlaceholderValue = _17[1];
|
|
62
|
+
var _18 = useState(false), isDelimiterVisible = _18[0], setIsDelimiterVisible = _18[1];
|
|
63
|
+
var _19 = useState(0), delimiterOffset = _19[0], setDelimiterOffset = _19[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 _20 = useDroppable({ id: userDropdownId }), setNodeRef = _20.setNodeRef, over = _20.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
|
-
|
|
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
|
+
// TODO: emailsToExclude в массиве зависимостей вызывает бесконечный ререндер при драге
|
|
86
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
87
|
+
var checkIsEmailToExclude = useCallback(function (email) { return includes(emailsToExclude, email); }, []);
|
|
116
88
|
var generateStyles = function () {
|
|
117
89
|
return selectStyles({
|
|
118
90
|
isChipsVisible: isChipsVisible,
|
|
119
91
|
isMaxMembersAdded: maxMembersCount && isChipsVisible ? selectedUsersLength === maxMembersCount : false,
|
|
120
92
|
isDisabled: isDisabled,
|
|
121
|
-
|
|
93
|
+
isInputPlaceholderVisible: isInputPlaceholderVisible,
|
|
122
94
|
lastRowNumber: isChipsVisible ? Math.ceil(selectedUsersLength / 2) + 1 : 1,
|
|
123
95
|
paddingLeft: paddingLeft,
|
|
96
|
+
paddingRight: !isChipsVisible && !isEmpty(inputValue) ? PADDING_WITH_CLEAR_ICON : paddingRight,
|
|
124
97
|
platform: platform,
|
|
125
98
|
layoutType: layoutType,
|
|
126
99
|
isInputHidden: isInputHidden,
|
|
127
100
|
isDisabledMenuOffsetAtFullscreen: isDisabledMenuOffsetAtFullscreen,
|
|
101
|
+
isInputFocused: isInputFocused.current,
|
|
128
102
|
isMaskRepresented: !isEmpty(mask),
|
|
103
|
+
isSuffixRepresented: !isNil(suffix),
|
|
104
|
+
isMenuShadowless: isMenuShadowless,
|
|
105
|
+
isShowCatalogSearchButton: isShowCatalogSearchButton,
|
|
129
106
|
fontFamilyStyle: fontFamilyStyle,
|
|
130
107
|
containerPadding: containerPadding,
|
|
108
|
+
isDraggable: isDraggable,
|
|
109
|
+
isChipsCollapsed: isChipsCollapsable && !isInputFocused.current,
|
|
110
|
+
menuListMaxHeight: menuListMaxHeight,
|
|
111
|
+
maxRowsCountToCollapseChips: maxRowsCountToCollapseChips,
|
|
112
|
+
isError: isError,
|
|
131
113
|
});
|
|
132
114
|
};
|
|
133
115
|
var generateNoOptionsMessage = function (_a) {
|
|
@@ -152,71 +134,74 @@ var UserDropdown = function (_a) {
|
|
|
152
134
|
collapsableChipsCount: collapsableChipsCount,
|
|
153
135
|
lastVisibleChipIndex: lastVisibleChipIndex,
|
|
154
136
|
};
|
|
155
|
-
var
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
});
|
|
162
|
-
var query = ((_b = (_a = selectRef.current) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b.inputValue) || '';
|
|
163
|
-
var sortedCorporateContacts = sortContacts(corporateContacts, query);
|
|
164
|
-
var sortedMyContacts = sortContacts(myContactsEntries || [], query);
|
|
165
|
-
var filteredCorporateContacts = sortedCorporateContacts.filter(function (_a) {
|
|
166
|
-
var email = _a.email, contacts = _a.contacts;
|
|
167
|
-
return [email, contacts[0].contact].every(function (email) { return !checkIsEmailToExclude(email); });
|
|
168
|
-
});
|
|
169
|
-
var filteredMyContacts = sortedMyContacts.filter(function (_a) {
|
|
170
|
-
var email = _a.email;
|
|
171
|
-
return !checkIsEmailToExclude(email);
|
|
172
|
-
});
|
|
173
|
-
return __spreadArray(__spreadArray([], generateCorporateOptionsToSelect(__assign({ options: filteredCorporateContacts }, commonFields)), true), generateContactsOptionsToSelect(__assign({ options: filteredMyContacts }, commonFields)), true);
|
|
137
|
+
var _c = retrieveFilteredContacts({
|
|
138
|
+
query: ((_b = (_a = selectRef.current) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b.inputValue) || EMPTY_STRING,
|
|
139
|
+
corporateEntries: corporateEntries,
|
|
140
|
+
myContactsEntries: myContactsEntries,
|
|
141
|
+
checkIsEmailToExclude: checkIsEmailToExclude,
|
|
142
|
+
}), filteredCorporateContacts = _c.filteredCorporateContacts, filteredLocalContacts = _c.filteredLocalContacts, filteredMyContacts = _c.filteredMyContacts;
|
|
143
|
+
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);
|
|
174
144
|
};
|
|
145
|
+
var clearUserTypingTimeout = useCallback(function () {
|
|
146
|
+
var userTypingTimeoutRefCurrent = userTypingTimeoutRef.current;
|
|
147
|
+
if (userTypingTimeoutRefCurrent) {
|
|
148
|
+
clearTimeout(userTypingTimeoutRefCurrent);
|
|
149
|
+
userTypingTimeoutRef.current = null;
|
|
150
|
+
}
|
|
151
|
+
}, []);
|
|
152
|
+
useEffect(function () {
|
|
153
|
+
if (prevIsLoadingRef.current && !isLoading) {
|
|
154
|
+
setIsUserTyping(false);
|
|
155
|
+
clearUserTypingTimeout();
|
|
156
|
+
}
|
|
157
|
+
prevIsLoadingRef.current = isLoading;
|
|
158
|
+
}, [isLoading, clearUserTypingTimeout]);
|
|
175
159
|
var requestInputChangeDebounce = useMemo(function () {
|
|
176
160
|
return debounce(function (inputValue) {
|
|
177
161
|
onInputChange(inputValue);
|
|
178
|
-
|
|
162
|
+
clearUserTypingTimeout();
|
|
163
|
+
userTypingTimeoutRef.current = setTimeout(function () { return setIsUserTyping(false); }, CLEAR_USER_TYPING_TIMEOUT);
|
|
179
164
|
}, USER_TYPING_TIMEOUT);
|
|
180
|
-
}, [onInputChange]);
|
|
181
|
-
var resetIsUserTypingDebounce = useMemo(function () { return debounce(function () { return setIsUserTyping(false); }, USER_TYPING_TIMEOUT); }, []);
|
|
182
|
-
var handleResetError = function () { return isError && setIsError(false); };
|
|
165
|
+
}, [clearUserTypingTimeout, onInputChange]);
|
|
183
166
|
var handleMenuClose = function () {
|
|
184
167
|
menuScrollFromTop.current = 0;
|
|
185
|
-
|
|
186
|
-
onMenuClose
|
|
168
|
+
setIsDelimiterVisible(false);
|
|
169
|
+
onMenuClose === null || onMenuClose === void 0 ? void 0 : onMenuClose();
|
|
187
170
|
};
|
|
188
|
-
var handleInputChange = function (inputValue, additionalInfo) {
|
|
171
|
+
var handleInputChange = useCallback(function (inputValue, additionalInfo) {
|
|
189
172
|
if (additionalInfo) {
|
|
190
|
-
var action = additionalInfo.action,
|
|
173
|
+
var action = additionalInfo.action, _a = additionalInfo.prevInputValue, prevInputValue = _a === void 0 ? EMPTY_STRING : _a;
|
|
191
174
|
var trimPrevInputValue_1 = prevInputValue.trim();
|
|
192
175
|
var isInputBlurAction = action === INPUT_ACTIONS.blur;
|
|
193
176
|
var isMenuCloseAction = action === MENU_ACTIONS.close;
|
|
194
|
-
if (!isInputBlurAction && !isMenuCloseAction)
|
|
177
|
+
if (!isInputBlurAction && !isMenuCloseAction) {
|
|
195
178
|
setInputValue(inputValue);
|
|
179
|
+
onImmediateInputChange === null || onImmediateInputChange === void 0 ? void 0 : onImmediateInputChange(inputValue);
|
|
180
|
+
}
|
|
196
181
|
if ((isInputBlurAction || isMenuCloseAction) && checkIsValueIsEmail(trimPrevInputValue_1)) {
|
|
197
182
|
var isUserAlreadySelected = selectedUsers.some(function (_a) {
|
|
198
183
|
var email = _a.email;
|
|
199
184
|
return email === trimPrevInputValue_1;
|
|
200
185
|
});
|
|
201
|
-
|
|
186
|
+
var nextInputValue = isUserAlreadySelected || checkIsEmailToExclude(trimPrevInputValue_1) ? trimPrevInputValue_1 : inputValue;
|
|
187
|
+
setInputValue(nextInputValue);
|
|
188
|
+
onImmediateInputChange === null || onImmediateInputChange === void 0 ? void 0 : onImmediateInputChange(nextInputValue);
|
|
202
189
|
}
|
|
203
190
|
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
};
|
|
214
|
-
var handleAddUser = function (needToShowError) {
|
|
215
|
-
if (needToShowError === void 0) { needToShowError = true; }
|
|
216
|
-
var props = selectRef.current.props;
|
|
217
|
-
var options = props.options, inputValue = props.inputValue, onChange = props.onChange;
|
|
218
|
-
if (isEmpty(inputValue))
|
|
191
|
+
if (!isEmpty(inputValue)) {
|
|
192
|
+
clearUserTypingTimeout();
|
|
193
|
+
setIsUserTyping(true);
|
|
194
|
+
}
|
|
195
|
+
inputValue.length >= MIN_INPUT_SYMBOLS && requestInputChangeDebounce(inputValue);
|
|
196
|
+
}, [onImmediateInputChange, requestInputChangeDebounce, selectedUsers, checkIsEmailToExclude, clearUserTypingTimeout]);
|
|
197
|
+
var handleAddUser = function () {
|
|
198
|
+
var selectRefCurrent = selectRef.current;
|
|
199
|
+
if (isNil(selectRefCurrent))
|
|
219
200
|
return;
|
|
201
|
+
var props = selectRefCurrent.props;
|
|
202
|
+
var options = props.options, onChange = props.onChange;
|
|
203
|
+
if (isEmpty(inputValue))
|
|
204
|
+
return Promise.resolve();
|
|
220
205
|
var trimInputValue = inputValue.trim();
|
|
221
206
|
var optionProps = {
|
|
222
207
|
platform: platform,
|
|
@@ -248,10 +233,10 @@ var UserDropdown = function (_a) {
|
|
|
248
233
|
return email === inputEmail;
|
|
249
234
|
});
|
|
250
235
|
enteredUsers.push(existingUser || generateEnteredByUserOption(__assign(__assign({}, optionProps), { email: inputEmail })));
|
|
251
|
-
if (isUserAlreadySelected &&
|
|
252
|
-
|
|
236
|
+
if (isUserAlreadySelected && isSingleEmailEntered)
|
|
237
|
+
return;
|
|
253
238
|
else
|
|
254
|
-
handleInputChange(
|
|
239
|
+
handleInputChange(EMPTY_STRING, { action: INPUT_ACTIONS.change, prevInputValue: trimInputValue });
|
|
255
240
|
}
|
|
256
241
|
!isValueIsEmail && incorrectEmails.push(inputEmail);
|
|
257
242
|
});
|
|
@@ -265,7 +250,7 @@ var UserDropdown = function (_a) {
|
|
|
265
250
|
var isEnterPressed = code === ENTER_KEY || key === ENTER_KEY;
|
|
266
251
|
var isBackspacePressed = code === BACKSPACE_KEY || key === BACKSPACE_KEY;
|
|
267
252
|
var isSpacePressed = code === SPACE_KEY;
|
|
268
|
-
var isTransformChipToInputValue = isBackspacePressed && isBackspaceChipToInput && inputValue ===
|
|
253
|
+
var isTransformChipToInputValue = isBackspacePressed && isBackspaceChipToInput && inputValue === EMPTY_STRING && !isEmpty(selectedUsers);
|
|
269
254
|
if (isEnterPressed) {
|
|
270
255
|
event.preventDefault();
|
|
271
256
|
(_a = handleAddUser()) === null || _a === void 0 ? void 0 : _a.then(function () { });
|
|
@@ -291,26 +276,29 @@ var UserDropdown = function (_a) {
|
|
|
291
276
|
(_c = (_b = selectRef.current) === null || _b === void 0 ? void 0 : _b.onMenuOpen) === null || _c === void 0 ? void 0 : _c.call(_b);
|
|
292
277
|
}
|
|
293
278
|
};
|
|
294
|
-
var transformCurrentChipToInputValue = function (label,
|
|
279
|
+
var transformCurrentChipToInputValue = useCallback(function (label, value) {
|
|
295
280
|
var _a, _b;
|
|
296
281
|
skipAddUserToChipsOnNextBlurRef.current = true;
|
|
297
282
|
setSelectedUsers(function (prevSelectedUsers) {
|
|
298
283
|
var nextSelectedUsers = prevSelectedUsers.filter(function (_a) {
|
|
299
|
-
var userEmail = _a.email;
|
|
300
|
-
return userEmail !==
|
|
284
|
+
var userEmail = _a.email, userType = _a.userType, userUid = _a.uid;
|
|
285
|
+
return checkIfContactTypeIsGroup(userType) ? userUid !== value : userEmail !== value;
|
|
301
286
|
});
|
|
302
287
|
onChange === null || onChange === void 0 ? void 0 : onChange(nextSelectedUsers.map(function (userData) { return omit(userData, COMMON_FIELDS_TO_OMIT); }));
|
|
303
288
|
return nextSelectedUsers;
|
|
304
289
|
});
|
|
290
|
+
handleFocus();
|
|
305
291
|
setInputValue(label);
|
|
306
292
|
onInputChange(label);
|
|
307
293
|
handleInputChange(label);
|
|
308
294
|
onMenuOpen === null || onMenuOpen === void 0 ? void 0 : onMenuOpen();
|
|
309
295
|
(_b = (_a = selectRef.current) === null || _a === void 0 ? void 0 : _a.onMenuOpen) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
310
|
-
|
|
296
|
+
setIsUserTyping(false);
|
|
297
|
+
},
|
|
298
|
+
// eslint-disable-next-line
|
|
299
|
+
[onInputChange, handleInputChange, onMenuOpen, onChange]);
|
|
311
300
|
var handleChange = function (newSelectedUsers) {
|
|
312
|
-
var uniqNewSelectedUsers = uniqBy(newSelectedUsers, EMAIL_FIELD);
|
|
313
|
-
var users = [];
|
|
301
|
+
var uniqNewSelectedUsers = isDisabledCheckUniqueEmails ? newSelectedUsers : uniqBy(newSelectedUsers, EMAIL_FIELD);
|
|
314
302
|
var deletedUser = selectedUsers.find(function (_a) {
|
|
315
303
|
var value = _a.value;
|
|
316
304
|
return !uniqNewSelectedUsers.some(function (_a) {
|
|
@@ -320,108 +308,59 @@ var UserDropdown = function (_a) {
|
|
|
320
308
|
});
|
|
321
309
|
if (deletedUser === null || deletedUser === void 0 ? void 0 : deletedUser.isNotRemovable)
|
|
322
310
|
return;
|
|
323
|
-
|
|
324
|
-
var isEnteredByUser = user.isEnteredByUser, isMyContacts = user.isMyContacts;
|
|
325
|
-
var userToAdd = omit(user, COMMON_FIELDS_TO_OMIT);
|
|
326
|
-
var entryFieldsToExclude = isMyContacts ? [EXCLUDED_FIELDS.isMyContacts] : [EXCLUDED_FIELDS.language];
|
|
327
|
-
var fieldsToExclude = isEnteredByUser ? [EXCLUDED_FIELDS.isEnteredByUser] : entryFieldsToExclude;
|
|
328
|
-
users.push(omit(userToAdd, fieldsToExclude));
|
|
329
|
-
});
|
|
311
|
+
var users = transformSelectedUsers(uniqNewSelectedUsers);
|
|
330
312
|
onChange(users);
|
|
331
313
|
if (!isInputHidden)
|
|
332
314
|
setSelectedUsers(uniqNewSelectedUsers);
|
|
333
315
|
if (!isInputFocused.current && isChipsCollapsable)
|
|
334
316
|
handleFocus();
|
|
335
317
|
};
|
|
336
|
-
var isContainsValue = function (_a) {
|
|
337
|
-
var label = _a.label, email = _a.email, value = _a.value;
|
|
338
|
-
return label.toLowerCase().includes(value) || email.toLowerCase().includes(value);
|
|
339
|
-
};
|
|
340
318
|
var handleFilterOption = function (_a, inputValue) {
|
|
341
|
-
var
|
|
342
|
-
|
|
343
|
-
var transliteratedInputValue = tr(originInputValue);
|
|
344
|
-
var toEngInputValue = ru.toEn(originInputValue);
|
|
345
|
-
var fromEngInputValue = ru.fromEn(originInputValue);
|
|
346
|
-
var isUserAlreadySelected = selectedUsers.find(function (_a) {
|
|
347
|
-
var email = _a.email;
|
|
348
|
-
return email === optionEmail;
|
|
349
|
-
});
|
|
350
|
-
var isContainsInputValue = [originInputValue, transliteratedInputValue, toEngInputValue, fromEngInputValue].some(function (value) {
|
|
351
|
-
return isContainsValue({ label: label, email: optionEmail, value: value });
|
|
352
|
-
});
|
|
353
|
-
if (isFilteringDisabled)
|
|
354
|
-
return !isEmpty(selectedUsers) ? !isUserAlreadySelected : true;
|
|
355
|
-
return !isEmpty(selectedUsers) ? !isUserAlreadySelected && isContainsInputValue : isContainsInputValue;
|
|
356
|
-
};
|
|
357
|
-
var generateTruncatedElementY = function (element) { return Math.trunc(element.getBoundingClientRect().y); };
|
|
358
|
-
var calculateCounterWidth = function (counterNumber) {
|
|
359
|
-
if (counterNumber >= 100)
|
|
360
|
-
return THREE_DIGIT_NUMBER_WIDTH;
|
|
361
|
-
if (counterNumber >= 10)
|
|
362
|
-
return TWO_DIGIT_NUMBER_WIDTH;
|
|
363
|
-
return SINGLE_DIGIT_NUMBER_WIDTH;
|
|
319
|
+
var data = _a.data;
|
|
320
|
+
return applyFilteringToOption({ isFilteringDisabled: isFilteringDisabled, inputValue: inputValue, data: data, selectedUsers: selectedUsers });
|
|
364
321
|
};
|
|
365
322
|
var handleCollapseChips = function () {
|
|
366
|
-
var
|
|
367
|
-
var collapsableChips = 0;
|
|
368
|
-
var chipLabelWithMaxWidth = '';
|
|
369
|
-
var chipsNodes = ((_a = document.querySelector("#".concat(userDropdownId))) === null || _a === void 0 ? void 0 : _a.querySelectorAll('.smartapp-chip')) || [];
|
|
370
|
-
var chips = Array.from(chipsNodes);
|
|
323
|
+
var chips = retrieveChipsElements(userDropdownId);
|
|
371
324
|
if (isEmpty(chips))
|
|
372
325
|
return;
|
|
373
|
-
var
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
else {
|
|
383
|
-
y === ySecondRow && secondRow.push(chip);
|
|
384
|
-
}
|
|
385
|
-
});
|
|
386
|
-
var counterWidth = calculateCounterWidth(collapsableChips);
|
|
387
|
-
var rowWidth = counterWidth + INPUT_SPACE_WIDTH;
|
|
388
|
-
var dropdownWidth = ((_b = document.querySelector("#".concat(userDropdownId))) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect().width) - maskWidth;
|
|
389
|
-
secondRow.forEach(function (chip) {
|
|
390
|
-
var _a;
|
|
391
|
-
rowWidth += chip.getBoundingClientRect().width + GAP;
|
|
392
|
-
if (rowWidth > dropdownWidth) {
|
|
393
|
-
if (secondRow.length > 1) {
|
|
394
|
-
collapsableChips += 1;
|
|
395
|
-
}
|
|
396
|
-
else {
|
|
397
|
-
var emptySpaceWidth = collapsableChips > 0 ? counterWidth + INPUT_SPACE_WIDTH + GAP : INPUT_SPACE_WIDTH;
|
|
398
|
-
chip.style.maxWidth = "".concat(dropdownWidth - emptySpaceWidth, "px");
|
|
399
|
-
chipLabelWithMaxWidth = ((_a = chip.querySelector('.smartapp-chip__info--name')) === null || _a === void 0 ? void 0 : _a.innerHTML) || '';
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
});
|
|
326
|
+
var _a = collapseChips({
|
|
327
|
+
userDropdownId: userDropdownId,
|
|
328
|
+
maxRowsCountToCollapseChips: maxRowsCountToCollapseChips,
|
|
329
|
+
maskWidth: maskWidth,
|
|
330
|
+
suffixWidth: suffixWidth,
|
|
331
|
+
chips: chips,
|
|
332
|
+
}), collapsableChips = _a.collapsableChips, numberOfVisibleChips = _a.numberOfVisibleChips, chipLabelWithMaxWidth = _a.chipLabelWithMaxWidth;
|
|
333
|
+
isNeedCheckChipCollapsableCount.current = true;
|
|
334
|
+
visibleChipsCount.current = numberOfVisibleChips;
|
|
403
335
|
collapsableChipsCount.current = collapsableChips;
|
|
404
|
-
lastVisibleChipIndex.current =
|
|
336
|
+
lastVisibleChipIndex.current = numberOfVisibleChips;
|
|
405
337
|
setChipLabelWithMaxWidth(chipLabelWithMaxWidth || generateId());
|
|
406
338
|
};
|
|
407
|
-
var handleUnCollapseChips = function () {
|
|
408
|
-
var _a;
|
|
339
|
+
var handleUnCollapseChips = useCallback(function () {
|
|
409
340
|
if (!userDropdownId)
|
|
410
341
|
return;
|
|
411
|
-
var
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
var chipLabel = ((_a = chip.querySelector('.smartapp-chip__info--name')) === null || _a === void 0 ? void 0 : _a.innerHTML) || '';
|
|
416
|
-
chipLabel === chipLabelWithMaxWidth && (chip.style.maxWidth = '100%');
|
|
417
|
-
});
|
|
342
|
+
var chips = retrieveChipsElements(userDropdownId);
|
|
343
|
+
unCollapseChips(chipLabelWithMaxWidth, chips);
|
|
344
|
+
isNeedCheckChipCollapsableCount.current = false;
|
|
345
|
+
visibleChipsCount.current = chips.length;
|
|
418
346
|
collapsableChipsCount.current = 0;
|
|
419
347
|
lastVisibleChipIndex.current = -1;
|
|
420
|
-
setChipLabelWithMaxWidth(
|
|
348
|
+
setChipLabelWithMaxWidth(EMPTY_STRING);
|
|
349
|
+
}, [chipLabelWithMaxWidth, userDropdownId]);
|
|
350
|
+
var handleDragBlur = function (isDisableCheckFocused) {
|
|
351
|
+
var _a;
|
|
352
|
+
if (!isInputFocused.current && !isDisableCheckFocused)
|
|
353
|
+
return;
|
|
354
|
+
if (selectRef.current)
|
|
355
|
+
selectRef.current._preventBlur = false;
|
|
356
|
+
(_a = selectRef.current) === null || _a === void 0 ? void 0 : _a.blur();
|
|
421
357
|
};
|
|
422
358
|
var handleBlur = function () {
|
|
423
359
|
var _a;
|
|
424
360
|
var shouldSkipAddUserToChipsOnNextBlur = skipAddUserToChipsOnNextBlurRef.current;
|
|
361
|
+
var _b = selectRef.current || {}, _preventBlur = _b._preventBlur, _contextMenuOpen = _b._contextMenuOpen, _isDragging = _b._isDragging;
|
|
362
|
+
if (_preventBlur || _contextMenuOpen || _isDragging || skipAddUserToChipsOnNextBlurRef.current)
|
|
363
|
+
return;
|
|
425
364
|
var onBlurComplete = function () {
|
|
426
365
|
isChipsCollapsable && handleCollapseChips();
|
|
427
366
|
isInputFocused.current = false;
|
|
@@ -431,19 +370,38 @@ var UserDropdown = function (_a) {
|
|
|
431
370
|
return;
|
|
432
371
|
}
|
|
433
372
|
else
|
|
434
|
-
(_a = handleAddUser(
|
|
373
|
+
(_a = handleAddUser()) === null || _a === void 0 ? void 0 : _a.then(function () { return requestAnimationFrame(function () { return requestAnimationFrame(function () { return onBlurComplete(); }); }); });
|
|
435
374
|
skipAddUserToChipsOnNextBlurRef.current = false;
|
|
436
375
|
};
|
|
437
|
-
var
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
376
|
+
var handleSelectBlur = function () {
|
|
377
|
+
setPlaceholderValue(placeholder);
|
|
378
|
+
setTimeout(handleBlur, RENDER_DELAY);
|
|
379
|
+
};
|
|
380
|
+
var focusInputIOS = useCallback(function (input) {
|
|
381
|
+
var length = input.value.length;
|
|
382
|
+
requestAnimationFrame(function () {
|
|
383
|
+
input.focus();
|
|
384
|
+
input.value === EMPTY_STRING ? setCaretInEmptyInput(input) : setCaretPosition(input, length);
|
|
385
|
+
});
|
|
386
|
+
}, []);
|
|
387
|
+
var handleFocus = useCallback(function (isDisableCheckFocused) {
|
|
388
|
+
setPlaceholderValue(SEARCH_PLACEHOLDER[language]);
|
|
389
|
+
if (isInputFocused.current && !isDisableCheckFocused)
|
|
390
|
+
return;
|
|
444
391
|
isInputFocused.current = true;
|
|
392
|
+
var selectRefCurrent = selectRef.current;
|
|
393
|
+
var _a = selectRefCurrent || {}, _preventBlur = _a._preventBlur, inputRef = _a.inputRef;
|
|
394
|
+
setTimeout(function () {
|
|
395
|
+
if (selectRefCurrent && !_preventBlur)
|
|
396
|
+
isIosPlatform(platform) && inputRef ? focusInputIOS(inputRef) : selectRefCurrent.focus();
|
|
397
|
+
}, RENDER_DELAY);
|
|
445
398
|
isChipsCollapsable && handleUnCollapseChips();
|
|
446
|
-
};
|
|
399
|
+
}, [language, isChipsCollapsable, handleUnCollapseChips, platform, focusInputIOS]);
|
|
400
|
+
var handleForceFocus = useCallback(function () { return setTimeout(function () { return handleFocus(true); }, RENDER_DELAY); }, [handleFocus]);
|
|
401
|
+
var handleSelectFocus = useCallback(function () {
|
|
402
|
+
handleFocus();
|
|
403
|
+
onFocus === null || onFocus === void 0 ? void 0 : onFocus();
|
|
404
|
+
}, [handleFocus, onFocus]);
|
|
447
405
|
var handleCloseModal = function () {
|
|
448
406
|
setModalData(null);
|
|
449
407
|
setIsSearchable(true);
|
|
@@ -451,15 +409,6 @@ var UserDropdown = function (_a) {
|
|
|
451
409
|
new Promise(function (resolve) { return resolve(); }).then(function () { var _a; return (_a = selectRef.current) === null || _a === void 0 ? void 0 : _a.focus(); });
|
|
452
410
|
}
|
|
453
411
|
};
|
|
454
|
-
var renderTitle = function () { return title && _jsx("div", __assign({ className: "smartapp-user-dropdown__title" }, { children: title })); };
|
|
455
|
-
var renderMask = function () {
|
|
456
|
-
return mask && (_jsx("div", __assign({ ref: maskRef, className: "smartapp-user-dropdown__container--mask" }, { children: mask })));
|
|
457
|
-
};
|
|
458
|
-
var renderHint = function () {
|
|
459
|
-
if (isNil(hint))
|
|
460
|
-
return;
|
|
461
|
-
return isString(hint) ? _jsx("div", __assign({ className: "smartapp-user-dropdown__hint" }, { children: hint })) : hint;
|
|
462
|
-
};
|
|
463
412
|
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, {}));
|
|
464
413
|
useEffect(function () {
|
|
465
414
|
if (externalInputValue && isInputHidden) {
|
|
@@ -472,14 +421,23 @@ var UserDropdown = function (_a) {
|
|
|
472
421
|
!userDropdownId && setUserDropdownId("user_dropdown_".concat(generateId().replace(/-/g, '_')));
|
|
473
422
|
}, [userDropdownId]);
|
|
474
423
|
useLayoutEffect(function () {
|
|
475
|
-
if (
|
|
476
|
-
|
|
424
|
+
if (isChipsCollapsable && !isEmpty(chipLabelWithMaxWidth) && !isInputFocused.current) {
|
|
425
|
+
handleUnCollapseChips();
|
|
426
|
+
handleCollapseChips();
|
|
477
427
|
}
|
|
478
428
|
// eslint-disable-next-line
|
|
429
|
+
}, [hint]);
|
|
430
|
+
useLayoutEffect(function () {
|
|
431
|
+
if (userDropdownId)
|
|
432
|
+
setTimeout(function () { return (isChipsCollapsable ? handleCollapseChips() : handleUnCollapseChips()); }, RENDER_DELAY);
|
|
433
|
+
// eslint-disable-next-line
|
|
479
434
|
}, [isChipsCollapsable, userDropdownId]);
|
|
480
435
|
useEffect(function () {
|
|
481
|
-
setPaddingLeft(
|
|
436
|
+
setPaddingLeft(calculateHorizontalPadding(maskRef, setMaskWidth));
|
|
482
437
|
}, [mask]);
|
|
438
|
+
useEffect(function () {
|
|
439
|
+
setPaddingRight(calculateHorizontalPadding(suffixRef, setSuffixWidth));
|
|
440
|
+
}, [suffix]);
|
|
483
441
|
useEffect(function () {
|
|
484
442
|
setSelectedUsers(function (prevSelectedUsers) {
|
|
485
443
|
return prevSelectedUsers.map(function (selectedUser) { return (__assign(__assign({}, selectedUser), { layoutType: layoutType, fontFamily: fontFamily, language: language, isChipsCollapsable: isChipsCollapsable })); });
|
|
@@ -488,32 +446,20 @@ var UserDropdown = function (_a) {
|
|
|
488
446
|
useEffect(function () {
|
|
489
447
|
if (!isEmpty(selectedEntries)) {
|
|
490
448
|
setSelectedUsers(selectedEntries.map(function (entity) {
|
|
491
|
-
var
|
|
492
|
-
var
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
isResetChipsToInputValue: isResetChipsToInputValue,
|
|
499
|
-
contextMenuItems: contextMenuItems,
|
|
500
|
-
isSelectedChipHasTooltip: isSelectedChipHasTooltip,
|
|
501
|
-
isLoading: isLoading,
|
|
502
|
-
isWarning: isWarning,
|
|
503
|
-
isOrganizer: isOrganizer,
|
|
504
|
-
userType: userType,
|
|
505
|
-
uid: uid,
|
|
506
|
-
isInputFocused: isInputFocused,
|
|
507
|
-
selectRef: selectRef,
|
|
508
|
-
collapsableChipsCount: collapsableChipsCount,
|
|
509
|
-
lastVisibleChipIndex: lastVisibleChipIndex,
|
|
449
|
+
var contextMenuItems = entity.contextMenuItems;
|
|
450
|
+
var generateContextMenuItems = function () {
|
|
451
|
+
return contextMenuItems === null || contextMenuItems === void 0 ? void 0 : contextMenuItems.map(function (item) { return (__assign(__assign({}, item), { action: function (data) {
|
|
452
|
+
var _a;
|
|
453
|
+
(_a = item.action) === null || _a === void 0 ? void 0 : _a.call(item, data);
|
|
454
|
+
isMobilePlatform(platform) && handleFocus(true);
|
|
455
|
+
} })); });
|
|
510
456
|
};
|
|
511
|
-
var
|
|
512
|
-
|
|
513
|
-
: generateContactsOption(__assign({ option: entity }, commonFields));
|
|
514
|
-
return 'contacts' in entity ? generateCorporateOption(__assign({ option: entity }, commonFields)) : generatedNotCorporateEntity;
|
|
457
|
+
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() });
|
|
458
|
+
return transformSelectedEntity(entity, commonFields);
|
|
515
459
|
}));
|
|
516
460
|
}
|
|
461
|
+
else
|
|
462
|
+
setSelectedUsers([]);
|
|
517
463
|
// eslint-disable-next-line
|
|
518
464
|
}, [selectedEntries]);
|
|
519
465
|
useEffect(function () {
|
|
@@ -526,15 +472,38 @@ var UserDropdown = function (_a) {
|
|
|
526
472
|
useEffect(function () {
|
|
527
473
|
return function () {
|
|
528
474
|
requestInputChangeDebounce.cancel();
|
|
529
|
-
|
|
475
|
+
clearUserTypingTimeout();
|
|
530
476
|
};
|
|
531
|
-
}, [
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
477
|
+
}, [clearUserTypingTimeout, requestInputChangeDebounce]);
|
|
478
|
+
useEffect(function () {
|
|
479
|
+
if (isChipsCollapsable && !isInputFocused.current && isNeedCheckChipCollapsableCount.current)
|
|
480
|
+
collapsableChipsCount.current = selectedEntries.length - visibleChipsCount.current;
|
|
481
|
+
}, [isChipsCollapsable, selectedEntries]);
|
|
482
|
+
var OptionComponent = useCallback(function (props) { return _jsx(Option, __assign({}, props, { isMenuShadowless: isMenuShadowless, children: props.children })); }, [isMenuShadowless]);
|
|
483
|
+
var MenuListComponent = useCallback(function (props) { return (_jsx(MenuList, __assign({}, props, { children: props.children, selectRef: selectRef, scrollFromTop: menuScrollFromTop, language: language, platform: platform, menuListMaxHeight: menuListMaxHeight, 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 }))); }, [
|
|
484
|
+
hasNextPage,
|
|
485
|
+
isCharHintVisible,
|
|
486
|
+
isLoading,
|
|
487
|
+
isMenuShadowless,
|
|
488
|
+
isNextPageLoading,
|
|
489
|
+
isShowCatalogSearchButton,
|
|
490
|
+
isUserTyping,
|
|
491
|
+
language,
|
|
492
|
+
menuListMaxHeight,
|
|
493
|
+
onLoadNextPage,
|
|
494
|
+
onShowCatalogSearchButtonClick,
|
|
495
|
+
platform,
|
|
496
|
+
]);
|
|
497
|
+
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 }) }))); };
|
|
498
|
+
var InputComponent = useCallback(function (props) { return (_jsx(Input, __assign({}, props, { "data-is-clearable": !isChipsVisible, "data-placeholder": placeholderValue, suffixref: suffixRef, suffix: suffix }))); }, [isChipsVisible, placeholderValue, suffix]);
|
|
499
|
+
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]);
|
|
500
|
+
var setContainerNodeRef = function (ref) {
|
|
501
|
+
var _a = ((ref === null || ref === void 0 ? void 0 : ref.getBoundingClientRect()) || {}).left, left = _a === void 0 ? 0 : _a;
|
|
502
|
+
setNodeRef(ref);
|
|
503
|
+
setDelimiterOffset(isShowCatalogSearchButton ? 0 : left);
|
|
504
|
+
};
|
|
505
|
+
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, { text: 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, blurInputOnSelect: false, captureMenuScroll: false, isSearchable: isSearchable, menuPlacement: menuPosition, menuPosition: menuLocation, controlShouldRenderValue: isChipsVisible, backspaceRemovesValue: isChipsVisible, isDisabled: isDisabled, closeMenuOnSelect: isMenuCloseOnSelect, isLoading: isLoading || isUserTyping, isClearable: false, 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: {
|
|
506
|
+
Input: InputComponent,
|
|
538
507
|
MultiValueLabel: MultiValueLabelComponent,
|
|
539
508
|
MultiValueRemove: MultiValueRemove,
|
|
540
509
|
Option: OptionComponent,
|
|
@@ -543,7 +512,7 @@ var UserDropdown = function (_a) {
|
|
|
543
512
|
LoadingIndicator: LoadingIndicator,
|
|
544
513
|
MenuList: MenuListComponent,
|
|
545
514
|
NoOptionsMessage: NoOptionsButton,
|
|
546
|
-
} })] })),
|
|
515
|
+
} }), _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 })] })));
|
|
547
516
|
};
|
|
548
|
-
export default UserDropdown;
|
|
517
|
+
export default memo(UserDropdown);
|
|
549
518
|
//# sourceMappingURL=UserDropdown.js.map
|