intelicoreact 1.3.22 → 1.3.24
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/dist/Atomic/FormElements/ActionAlert/ActionAlert.js +5 -8
- package/dist/Atomic/FormElements/ActionAlert/ActionAlert.scss +9 -9
- package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.js +6 -9
- package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.scss +8 -10
- package/dist/Atomic/FormElements/Calendar/Calendar.js +31 -33
- package/dist/Atomic/FormElements/Calendar/Calendar.scss +23 -27
- package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.js +4 -4
- package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.scss +16 -19
- package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.js +1 -1
- package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.scss +2 -2
- package/dist/Atomic/FormElements/Datepicker/Datepicker.js +53 -53
- package/dist/Atomic/FormElements/Datepicker/Datepicker.scss +0 -8
- package/dist/Atomic/FormElements/Datepicker/components/Calendar.js +20 -20
- package/dist/Atomic/FormElements/Dropdown/Dropdown.js +81 -83
- package/dist/Atomic/FormElements/Dropdown/Dropdown.scss +141 -95
- package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.js +1 -1
- package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.scss +3 -3
- package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.js +30 -28
- package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.scss +54 -18
- package/dist/Atomic/FormElements/FileLoader/FileLoader.js +4 -4
- package/dist/Atomic/FormElements/FileLoader/FileLoader.scss +31 -30
- package/dist/Atomic/FormElements/FileLoader/partial/LoadZone.js +12 -12
- package/dist/Atomic/FormElements/FileLoader/partial/LoadedContent.js +3 -3
- package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.js +8 -8
- package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.scss +44 -29
- package/dist/Atomic/FormElements/FileLoaderLocalGroup/FileLoaderLocalGroup.js +17 -15
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.js +15 -15
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.scss +24 -21
- package/dist/Atomic/FormElements/Input/Input.js +43 -45
- package/dist/Atomic/FormElements/Input/Input.scss +18 -18
- package/dist/Atomic/FormElements/InputCalendar/InputCalendar.js +19 -19
- package/dist/Atomic/FormElements/InputColor/InputColor.js +7 -9
- package/dist/Atomic/FormElements/InputCurrency/InputCurrency.js +12 -12
- package/dist/Atomic/FormElements/InputCurrency/InputCurrency.scss +9 -6
- package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +42 -42
- package/dist/Atomic/FormElements/InputDateRange/InputDateRange.scss +95 -95
- package/dist/Atomic/FormElements/InputDateRange/components/DateInput.js +10 -10
- package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.js +81 -81
- package/dist/Atomic/FormElements/InputDateRange/components/OpenedPart.js +14 -14
- package/dist/Atomic/FormElements/InputDateRange/components/SelectItem.js +4 -4
- package/dist/Atomic/FormElements/InputDateRange/dependencies.js +54 -54
- package/dist/Atomic/FormElements/InputLink/InputLink.js +11 -13
- package/dist/Atomic/FormElements/InputLink/InputLink.scss +5 -5
- package/dist/Atomic/FormElements/InputMask/InputCarretPosition.js +2 -2
- package/dist/Atomic/FormElements/InputMask/InputMask.js +66 -67
- package/dist/Atomic/FormElements/InputMask/InputMask.scss +10 -10
- package/dist/Atomic/FormElements/InputMask/config.js +9 -9
- package/dist/Atomic/FormElements/InputMask/functions.js +8 -7
- package/dist/Atomic/FormElements/InputMask2/InputMask2.js +42 -42
- package/dist/Atomic/FormElements/InputMask2/InputMask2.scss +13 -12
- package/dist/Atomic/FormElements/InputMask2/config.js +9 -9
- package/dist/Atomic/FormElements/InputMask2/functions.js +8 -7
- package/dist/Atomic/FormElements/InputMask3/InputMask3.js +50 -50
- package/dist/Atomic/FormElements/InputMask3/InputMask3.scss +13 -12
- package/dist/Atomic/FormElements/InputMask3/config.js +9 -9
- package/dist/Atomic/FormElements/InputMask3/functions.js +8 -7
- package/dist/Atomic/FormElements/InputWithAction/InputWithAction.js +7 -9
- package/dist/Atomic/FormElements/InputWithAction/InputWithAction.scss +34 -31
- package/dist/Atomic/FormElements/InputsRow/InputsRow.js +23 -23
- package/dist/Atomic/FormElements/InputsRow/InputsRow.scss +4 -5
- package/dist/Atomic/FormElements/Label/Label.js +2 -2
- package/dist/Atomic/FormElements/Label/Label.scss +2 -2
- package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +69 -69
- package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.scss +8 -9
- package/dist/Atomic/FormElements/MultiSelect/MultiSelect.js +2 -2
- package/dist/Atomic/FormElements/MultiSelect/MultiSelect.scss +2 -2
- package/dist/Atomic/FormElements/NumericInput/NumericInput.js +27 -27
- package/dist/Atomic/FormElements/NumericInput/NumericInput.scss +18 -18
- package/dist/Atomic/FormElements/RadioGroup/RadioGroup.js +3 -3
- package/dist/Atomic/FormElements/RadioGroup/RadioGroup.scss +1 -0
- package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +6 -6
- package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.scss +1 -0
- package/dist/Atomic/FormElements/RadioInput/RadioInput.js +2 -2
- package/dist/Atomic/FormElements/RadioInput/RadioInput.scss +4 -8
- package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.js +7 -7
- package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.scss +26 -25
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +24 -24
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.scss +17 -19
- package/dist/Atomic/FormElements/RangeInputs/RangeInputs.js +30 -30
- package/dist/Atomic/FormElements/RangeInputs/RangeInputs.scss +5 -5
- package/dist/Atomic/FormElements/RangeList/RangeList.js +27 -27
- package/dist/Atomic/FormElements/RangeList/RangeList.scss +23 -23
- package/dist/Atomic/FormElements/RangeList/partial/AnyOuterClass.scss +5 -4
- package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.js +1 -1
- package/dist/Atomic/FormElements/RangeSlider/RangeSlider.js +31 -31
- package/dist/Atomic/FormElements/RangeSlider/RangeSlider.scss +19 -24
- package/dist/Atomic/FormElements/RangeSlider/RangeSlider.stories.scss +7 -7
- package/dist/Atomic/FormElements/RangeSlider2/RangeSlider.stories.scss +8 -8
- package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +22 -22
- package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.scss +165 -91
- package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.js +1 -1
- package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.scss +2 -2
- package/dist/Atomic/FormElements/Switcher/Switcher.js +1 -1
- package/dist/Atomic/FormElements/Switcher/Switcher.scss +10 -12
- package/dist/Atomic/FormElements/Switcher/partial/AnyOuterClass.scss +2 -2
- package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.js +4 -6
- package/dist/Atomic/FormElements/SwitcherCheckbox/partial/AnyOuterClass.scss +2 -2
- package/dist/Atomic/FormElements/SwitcherHide/SwitcherHide.js +2 -2
- package/dist/Atomic/FormElements/SwitcherHide/partial/AnyOuterClass.scss +2 -2
- package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.js +4 -4
- package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.scss +1 -1
- package/dist/Atomic/FormElements/SwitcherRadio/partial/AnyOuterClass.scss +2 -2
- package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.js +5 -5
- package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.js +2 -2
- package/dist/Atomic/FormElements/SwitcherRangeList/partial/AnyOuterClass.scss +6 -6
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.js +9 -9
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.scss +2 -3
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/partial/AnyOuterClass.scss +2 -2
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/partial/States.js +100 -100
- package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.js +5 -5
- package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.scss +2 -3
- package/dist/Atomic/FormElements/SwitcherTextarea/partial/AnyOuterClass.scss +4 -4
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +67 -68
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.scss +103 -64
- package/dist/Atomic/FormElements/Text/Text.js +13 -13
- package/dist/Atomic/FormElements/Text/Text.scss +0 -1
- package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.js +4 -4
- package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.scss +15 -15
- package/dist/Atomic/FormElements/Textarea/Textarea.js +2 -2
- package/dist/Atomic/FormElements/Textarea/Textarea.scss +7 -8
- package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +3 -3
- package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.scss +5 -6
- package/dist/Atomic/FormElements/TimeRange/TimeRange.js +9 -9
- package/dist/Atomic/FormElements/TimeRange/TimeRange.scss +1 -1
- package/dist/Atomic/FormElements/UserContacts/UserContacts.js +36 -37
- package/dist/Atomic/FormElements/UserContacts/partial/AnyOuterClass.scss +5 -6
- package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.js +3 -3
- package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.scss +77 -59
- package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.js +3 -3
- package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.scss +9 -10
- package/dist/Atomic/FormElements/WidgetPseudoTable/partial/AnyOuterClass.scss +16 -14
- package/dist/Atomic/FormElements/WidgetPseudoTable/partial/constructor.js +18 -18
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.js +6 -6
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.scss +9 -10
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/partial/AnyOuterClass.scss +16 -14
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/partial/constructor.js +14 -14
- package/dist/Atomic/Layout/Header/Header.js +11 -11
- package/dist/Atomic/Layout/Header/Header.scss +9 -10
- package/dist/Atomic/Layout/MainMenu/MainMenu.js +17 -18
- package/dist/Atomic/Layout/MainMenu/MainMenu.scss +14 -17
- package/dist/Atomic/Layout/Spinner/Spinner.js +4 -4
- package/dist/Atomic/Layout/Spinner/Spinner.scss +3 -3
- package/dist/Atomic/UI/Accordion/Accordion.js +7 -7
- package/dist/Atomic/UI/Accordion/Accordion.scss +11 -11
- package/dist/Atomic/UI/Accordion/AccordionItem.js +12 -12
- package/dist/Atomic/UI/AccordionTable/AccordionTable.js +22 -23
- package/dist/Atomic/UI/AccordionTable/AccordionTable.scss +33 -38
- package/dist/Atomic/UI/AccordionText/AccordionText.js +3 -3
- package/dist/Atomic/UI/AccordionText/AccordionText.scss +18 -10
- package/dist/Atomic/UI/AdvancedTag/AdvTag.js +31 -32
- package/dist/Atomic/UI/AdvancedTag/AdvancedTags.js +5 -5
- package/dist/Atomic/UI/AdvancedTag/AdvancedTags.scss +19 -18
- package/dist/Atomic/UI/Alert/Alert.js +5 -5
- package/dist/Atomic/UI/Alert/Alert.scss +21 -21
- package/dist/Atomic/UI/Arrow/Arrow.js +5 -5
- package/dist/Atomic/UI/Box/Box.js +10 -10
- package/dist/Atomic/UI/Box/Box.scss +2 -4
- package/dist/Atomic/UI/Button/Button.js +9 -9
- package/dist/Atomic/UI/Button/Button.scss +34 -34
- package/dist/Atomic/UI/ButtonsBar/ButtonsBar.js +4 -4
- package/dist/Atomic/UI/ButtonsBar/ButtonsBar.scss +1 -1
- package/dist/Atomic/UI/Chart/Chart.js +16 -16
- package/dist/Atomic/UI/Chart/Chart.scss +4 -4
- package/dist/Atomic/UI/Chart/partial/AnyOuterClass.scss +10 -14
- package/dist/Atomic/UI/Chart/partial/Chart.constants.js +30 -30
- package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +3 -3
- package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.scss +1 -1
- package/dist/Atomic/UI/Chart/partial/datasetSetters.js +15 -15
- package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +28 -28
- package/dist/Atomic/UI/Chart/partial/optionsSetters.js +2 -2
- package/dist/Atomic/UI/Chart/partial/utils.js +4 -4
- package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +9 -9
- package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.scss +7 -9
- package/dist/Atomic/UI/DateTime/DateTime.js +6 -6
- package/dist/Atomic/UI/DateTime/DateTime.scss +1 -1
- package/dist/Atomic/UI/DateTime/partial/AnyOuterClass.scss +2 -2
- package/dist/Atomic/UI/DebugContainer/DebugContainer.js +4 -4
- package/dist/Atomic/UI/DebugContainer/DebugContainer.scss +15 -9
- package/dist/Atomic/UI/DoubleString/DoubleString.js +6 -6
- package/dist/Atomic/UI/DoubleString/DoubleString.scss +11 -5
- package/dist/Atomic/UI/DoubleString/partial/AnyOuterClass.scss +4 -4
- package/dist/Atomic/UI/DynamicIcon/DynamicIcon.js +1 -1
- package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +48 -48
- package/dist/Atomic/UI/ExampleChartIntegration/partial/AnyOuterClass.scss +10 -15
- package/dist/Atomic/UI/ExampleChartIntegration/partial/utils.js +18 -18
- package/dist/Atomic/UI/Hint/Hint.js +40 -41
- package/dist/Atomic/UI/Hint/Hint.scss +12 -11
- package/dist/Atomic/UI/Modal/Modal.js +28 -36
- package/dist/Atomic/UI/Modal/Modal.scss +42 -43
- package/dist/Atomic/UI/Modal/ModalHOC.js +2 -5
- package/dist/Atomic/UI/Modal/ModalMobile.scss +18 -11
- package/dist/Atomic/UI/Modal/partials/ModalFooter.js +2 -2
- package/dist/Atomic/UI/Modal/partials/ModalTitle.js +6 -6
- package/dist/Atomic/UI/Modal/partials/useMobileModal.js +8 -8
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +1 -1
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.scss +5 -5
- package/dist/Atomic/UI/MonoAccordion/partial/AnyOuterClass.scss +4 -5
- package/dist/Atomic/UI/NavLine/NavLine.js +26 -26
- package/dist/Atomic/UI/NavLine/NavLine.scss +34 -36
- package/dist/Atomic/UI/NavLine/Tabs.js +38 -38
- package/dist/Atomic/UI/PageTitle/PageTitle.js +1 -1
- package/dist/Atomic/UI/PageTitle/PageTitle.scss +7 -7
- package/dist/Atomic/UI/PieChart/PieChart.js +4 -4
- package/dist/Atomic/UI/PieChart/PieChart.scss +21 -10
- package/dist/Atomic/UI/Price/Price.js +2 -2
- package/dist/Atomic/UI/PriceRange/PriceRange.js +2 -2
- package/dist/Atomic/UI/ProgressLine/ProgressLine.js +10 -10
- package/dist/Atomic/UI/ProgressLine/ProgressLine.scss +36 -40
- package/dist/Atomic/UI/Status/Status.js +6 -6
- package/dist/Atomic/UI/Status/Status.scss +19 -19
- package/dist/Atomic/UI/Table/Partials/TdCell.js +11 -11
- package/dist/Atomic/UI/Table/Partials/TdHeader.js +3 -3
- package/dist/Atomic/UI/Table/Partials/TdRow.js +6 -6
- package/dist/Atomic/UI/Table/Partials/TdTitle.js +1 -1
- package/dist/Atomic/UI/Table/Table.js +3 -3
- package/dist/Atomic/UI/Table/Table.scss +11 -13
- package/dist/Atomic/UI/Table/TdTypes/TdActions.js +8 -8
- package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +2 -2
- package/dist/Atomic/UI/Table/TdTypes/TdRange.js +1 -3
- package/dist/Atomic/UI/Table/TdTypes/TdTypes.scss +9 -8
- package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +10 -13
- package/dist/Atomic/UI/Tag/Tag.js +6 -6
- package/dist/Atomic/UI/Tag/Tag.scss +12 -11
- package/dist/Atomic/UI/TagList/TagList.js +8 -8
- package/dist/Atomic/UI/TagList/TagList.scss +1 -1
- package/dist/Atomic/UI/UserBox/UserBox.js +5 -5
- package/dist/Atomic/UI/UserBox/UserBox.scss +9 -9
- package/dist/Classes/AbortableFetch.js +35 -35
- package/dist/Classes/AnimatedHandler.js +3 -3
- package/dist/Classes/RESTAPI/index.js +9 -9
- package/dist/Classes/RESTAPI/partials/AbortableFetch.js +37 -37
- package/dist/Classes/RESTAPI/partials/ApiBase.js +7 -7
- package/dist/Classes/RESTAPI/partials/ApiRequestCreators.js +4 -4
- package/dist/Classes/RESTAPI/partials/ApiUtils.js +4 -4
- package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +31 -31
- package/dist/Classes/RESTAPI/partials/Utils.js +15 -15
- package/dist/Classes/RESTAPI/partials/_utils.js +14 -14
- package/dist/Constants/index.constants.js +10 -10
- package/dist/Functions/Portal.js +1 -1
- package/dist/Functions/customEventListener.js +5 -5
- package/dist/Functions/fieldValueFormatters.js +66 -82
- package/dist/Functions/hooks/useFormFieldsChangesManager.js +4 -4
- package/dist/Functions/locale/createTranslator.js +4 -15
- package/dist/Functions/operations.js +14 -14
- package/dist/Functions/presets/inputMaskPresets.js +34 -34
- package/dist/Functions/presets/inputPresets.js +3 -3
- package/dist/Functions/presets/mobileKeyboardTypesPresets.js +2 -2
- package/dist/Functions/schemas.js +8 -8
- package/dist/Functions/useBodyScrollLock.js +20 -0
- package/dist/Functions/useClickOutside.js +2 -2
- package/dist/Functions/useFieldFocus.js +3 -7
- package/dist/Functions/useFormTools/form-drivers/ArrayWithObjects.js +1 -1
- package/dist/Functions/useFormTools/form-drivers/ObjectWithIterableObjects.js +11 -11
- package/dist/Functions/useFormTools/form-drivers/ObjectWithNamedKeyObjects.js +1 -1
- package/dist/Functions/useFormTools/functions/General.js +9 -9
- package/dist/Functions/useFormTools/functions/RenderFields.js +6 -6
- package/dist/Functions/useFormTools/index.js +18 -20
- package/dist/Functions/useInputHighlightError.js +5 -5
- package/dist/Functions/useKeyPress/useHandleKeyPress.js +44 -0
- package/dist/Functions/useKeyPress/useKeyPress.js +38 -0
- package/dist/Functions/useLocalStorage.js +2 -13
- package/dist/Functions/useLocationParams.js +2 -2
- package/dist/Functions/useMetaInfo.js +7 -7
- package/dist/Functions/useMouseUpOutside.js +2 -2
- package/dist/Functions/useOnlineStatus.js +5 -14
- package/dist/Functions/usePasswordChecker.js +26 -26
- package/dist/Functions/usePrevious.js +0 -12
- package/dist/Functions/useResize.js +6 -24
- package/dist/Functions/useScrollTo.js +1 -1
- package/dist/Functions/useToggle.js +1 -1
- package/dist/Functions/utils.js +64 -143
- package/dist/Molecular/FormElement/FormElement.js +1 -1
- package/dist/Molecular/FormElement/FormElement.scss +4 -3
- package/dist/Molecular/FormWithDependOn/FormWithDependOn.js +14 -14
- package/dist/Molecular/FormWithDependOn/partials/_utils.js +2 -2
- package/dist/Molecular/InputAddress/InputAddress.js +47 -46
- package/dist/Molecular/InputAddress/InputAddress.scss +176 -112
- package/dist/Molecular/InputPassword/InputPassword.js +11 -15
- package/dist/Molecular/InputPassword/InputPassword.scss +8 -7
- package/dist/scss/_fonts.scss +60 -36
- package/dist/scss/_vars.scss +18 -18
- package/dist/scss/main.scss +4 -4
- package/package.json +1 -1
|
@@ -7,19 +7,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _reactDom = require("react-dom");
|
|
11
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
var _reactDom = require("react-dom");
|
|
12
12
|
var _reactFeather = require("react-feather");
|
|
13
|
-
var _TagList = _interopRequireDefault(require("../../UI/TagList/TagList"));
|
|
14
|
-
var _Tag = _interopRequireDefault(require("../../UI/Tag/Tag"));
|
|
15
|
-
var _CheckboxInput = _interopRequireDefault(require("../../FormElements/CheckboxInput/CheckboxInput"));
|
|
16
|
-
var _Input = _interopRequireDefault(require("../../FormElements/Input/Input"));
|
|
17
13
|
var _fieldValueFormatters = require("../../../Functions/fieldValueFormatters");
|
|
18
14
|
var _useIsMobile = _interopRequireDefault(require("../../../Functions/useIsMobile"));
|
|
15
|
+
var _CheckboxInput = _interopRequireDefault(require("../../FormElements/CheckboxInput/CheckboxInput"));
|
|
16
|
+
var _Input = _interopRequireDefault(require("../../FormElements/Input/Input"));
|
|
17
|
+
var _Tag = _interopRequireDefault(require("../../UI/Tag/Tag"));
|
|
18
|
+
var _TagList = _interopRequireDefault(require("../../UI/TagList/TagList"));
|
|
19
19
|
require("./TagsDropdown.scss");
|
|
20
20
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
21
21
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
22
|
-
const RC =
|
|
22
|
+
const RC = "tags-dropdown";
|
|
23
23
|
const MIN_ITEMS_FOR_SHOW_MOBILE_SEARCH = 10;
|
|
24
24
|
const TagsDropdown = _ref => {
|
|
25
25
|
var _dropdownListWrapperR, _dropdownListRef$curr5, _dropdownListRef$curr6;
|
|
@@ -54,7 +54,7 @@ const TagsDropdown = _ref => {
|
|
|
54
54
|
closeOnSelectAllMobile = false,
|
|
55
55
|
fieldKey,
|
|
56
56
|
id,
|
|
57
|
-
noOptionsText =
|
|
57
|
+
noOptionsText = "No options available",
|
|
58
58
|
mobileSearchPlaceholder,
|
|
59
59
|
isSearchable = true,
|
|
60
60
|
attributesOfNativeInput = {},
|
|
@@ -67,7 +67,7 @@ const TagsDropdown = _ref => {
|
|
|
67
67
|
const isMobile = isMobileProp && withMobileLogic;
|
|
68
68
|
const [dropdownId, setDropdownId] = (0, _react.useState)(id || fieldKey || Math.random().toString(16).slice(2));
|
|
69
69
|
const [isOpen, setIsOpen] = (0, _react.useState)(false);
|
|
70
|
-
const [searchValue, setSearchValue] = (0, _react.useState)(
|
|
70
|
+
const [searchValue, setSearchValue] = (0, _react.useState)("");
|
|
71
71
|
const dropdownRef = (0, _react.useRef)(null);
|
|
72
72
|
const dropdownListRef = (0, _react.useRef)(null);
|
|
73
73
|
const dropdownListWrapperRef = (0, _react.useRef)(null);
|
|
@@ -86,24 +86,24 @@ const TagsDropdown = _ref => {
|
|
|
86
86
|
} = _ref2;
|
|
87
87
|
if (!((_getListContainer = getListContainer()) !== null && _getListContainer !== void 0 && _getListContainer.contains(target)) /* && !isTargetInParent(target) */) {
|
|
88
88
|
setIsOpen(false);
|
|
89
|
-
setSearchValue(
|
|
89
|
+
setSearchValue("");
|
|
90
90
|
}
|
|
91
91
|
};
|
|
92
92
|
const deleteChosen = value => {
|
|
93
93
|
if (isMobile ? closeOnRemoveMobile : closeOnRemove) setIsOpen(false);
|
|
94
|
-
onChange(chosenOptions.filter(item => item !== value),
|
|
94
|
+
onChange(chosenOptions.filter(item => item !== value), "chosenOptions");
|
|
95
95
|
};
|
|
96
96
|
const onChangeHandler = item => {
|
|
97
97
|
if (item !== null && item !== void 0 && item.isFreezed) return false;
|
|
98
98
|
if ((item === null || item === void 0 ? void 0 : item.closeOnOptionSelect) !== undefined) {
|
|
99
99
|
if (item.closeOnOptionSelect) setIsOpen(false);
|
|
100
100
|
} else if (isMobile ? closeOnSelectMobile : closeOnSelect) setIsOpen(false);
|
|
101
|
-
setSearchValue(
|
|
101
|
+
setSearchValue("");
|
|
102
102
|
if (chosenOptions.some(el => el === item.value)) {
|
|
103
103
|
deleteChosen(item.value);
|
|
104
104
|
return null;
|
|
105
105
|
}
|
|
106
|
-
onChange([...chosenOptions, item.value],
|
|
106
|
+
onChange([...chosenOptions, item.value], "chosenOptions");
|
|
107
107
|
return null;
|
|
108
108
|
};
|
|
109
109
|
const onSearchHandler = name => {
|
|
@@ -133,7 +133,7 @@ const TagsDropdown = _ref => {
|
|
|
133
133
|
}, title.substring(index, index + (searchValue === null || searchValue === void 0 ? void 0 : searchValue.length))), title.substring(index + (searchValue === null || searchValue === void 0 ? void 0 : searchValue.length)));
|
|
134
134
|
};
|
|
135
135
|
return /*#__PURE__*/_react.default.createElement("button", {
|
|
136
|
-
key: title === null || title === void 0 || (_title$toString = title.toString()) === null || _title$toString === void 0 ? void 0 : _title$toString.replace(/ /g,
|
|
136
|
+
key: title === null || title === void 0 || (_title$toString = title.toString()) === null || _title$toString === void 0 ? void 0 : _title$toString.replace(/ /g, "_"),
|
|
137
137
|
onClick: e => {
|
|
138
138
|
e.preventDefault();
|
|
139
139
|
e.stopPropagation();
|
|
@@ -177,13 +177,13 @@ const TagsDropdown = _ref => {
|
|
|
177
177
|
isFreezed,
|
|
178
178
|
value
|
|
179
179
|
} = _ref3;
|
|
180
|
-
return !isFreezed && !(chosenOptions !== null && chosenOptions !== void 0 && chosenOptions.includes(value)) && value !==
|
|
180
|
+
return !isFreezed && !(chosenOptions !== null && chosenOptions !== void 0 && chosenOptions.includes(value)) && value !== "open_modal";
|
|
181
181
|
})) === null || _prepareOptions === void 0 ? void 0 : _prepareOptions.map(_ref4 => {
|
|
182
182
|
let {
|
|
183
183
|
value
|
|
184
184
|
} = _ref4;
|
|
185
185
|
return value;
|
|
186
|
-
})) || [])],
|
|
186
|
+
})) || [])], "chosenOptions");
|
|
187
187
|
if (isMobile ? closeOnSelectAllMobile : closeOnSelectAll) setIsOpen(false);
|
|
188
188
|
};
|
|
189
189
|
const unselectAllItems = e => {
|
|
@@ -195,19 +195,19 @@ const TagsDropdown = _ref => {
|
|
|
195
195
|
} = _ref5;
|
|
196
196
|
return value === item;
|
|
197
197
|
})) === null || _prepareOptions2 === void 0 ? void 0 : _prepareOptions2.isFreezed;
|
|
198
|
-
}),
|
|
198
|
+
}), "chosenOptions");
|
|
199
199
|
if (isMobile ? closeOnRemoveAllMobile : closeOnRemoveAll) setIsOpen(false);
|
|
200
200
|
};
|
|
201
201
|
const getParentNode = () => {
|
|
202
202
|
var _document$querySelect;
|
|
203
|
-
return (_document$querySelect = document.querySelector(
|
|
203
|
+
return (_document$querySelect = document.querySelector("div#root")) !== null && _document$querySelect !== void 0 ? _document$querySelect : document.querySelector("div#app");
|
|
204
204
|
};
|
|
205
205
|
const initListContainer = () => {
|
|
206
|
-
const dropdownList = document.createElement(
|
|
207
|
-
dropdownList.setAttribute(
|
|
208
|
-
dropdownList.classList.add(
|
|
206
|
+
const dropdownList = document.createElement("div");
|
|
207
|
+
dropdownList.setAttribute("id", dropdownId);
|
|
208
|
+
dropdownList.classList.add("tags-dropdown__container");
|
|
209
209
|
if (isMobile) {
|
|
210
|
-
dropdownList.addEventListener(
|
|
210
|
+
dropdownList.addEventListener("click", e => {
|
|
211
211
|
if (e.target.id === dropdownId) setIsOpen(false);
|
|
212
212
|
});
|
|
213
213
|
}
|
|
@@ -216,10 +216,9 @@ const TagsDropdown = _ref => {
|
|
|
216
216
|
var _document$getElementB;
|
|
217
217
|
(_document$getElementB = document.getElementById("mlw-".concat(dropdownId))) === null || _document$getElementB === void 0 || _document$getElementB.remove();
|
|
218
218
|
} catch (e) {}
|
|
219
|
-
;
|
|
220
|
-
|
|
221
|
-
dropdownMobileListWrapper.
|
|
222
|
-
dropdownMobileListWrapper.setAttribute('id', "mlw-".concat(dropdownId));
|
|
219
|
+
const dropdownMobileListWrapper = document.createElement("div");
|
|
220
|
+
dropdownMobileListWrapper.classList.add("tags-dropdown-mobile");
|
|
221
|
+
dropdownMobileListWrapper.setAttribute("id", "mlw-".concat(dropdownId));
|
|
223
222
|
dropdownMobileListWrapper.append(dropdownList);
|
|
224
223
|
getParentNode().append(dropdownMobileListWrapper);
|
|
225
224
|
} else {
|
|
@@ -244,11 +243,11 @@ const TagsDropdown = _ref => {
|
|
|
244
243
|
top
|
|
245
244
|
} = (_dropdownRef$current$ = dropdownRef === null || dropdownRef === void 0 || (_dropdownRef$current = dropdownRef.current) === null || _dropdownRef$current === void 0 ? void 0 : _dropdownRef$current.getBoundingClientRect()) !== null && _dropdownRef$current$ !== void 0 ? _dropdownRef$current$ : {};
|
|
246
245
|
const sw = dropdownListWrapperRef === null || dropdownListWrapperRef === void 0 ? void 0 : dropdownListWrapperRef.current;
|
|
247
|
-
const dl = lc.getElementsByClassName(
|
|
248
|
-
const lh = sw === null || sw === void 0 ? void 0 : sw.getElementsByClassName(
|
|
249
|
-
const lf = sw === null || sw === void 0 ? void 0 : sw.getElementsByClassName(
|
|
250
|
-
const margin = parseInt((_getComputedStyle$mar = (_getComputedStyle = getComputedStyle(sw)) === null || _getComputedStyle === void 0 || (_getComputedStyle = _getComputedStyle.marginTop) === null || _getComputedStyle === void 0 ? void 0 : _getComputedStyle.replace(
|
|
251
|
-
const maxHeight = initListHeight !== null && initListHeight !== void 0 ? initListHeight : parseInt((_getComputedStyle$max = (_getComputedStyle2 = getComputedStyle(dl)) === null || _getComputedStyle2 === void 0 || (_getComputedStyle2 = _getComputedStyle2.maxHeight) === null || _getComputedStyle2 === void 0 ? void 0 : _getComputedStyle2.replace(
|
|
246
|
+
const dl = lc.getElementsByClassName("tags-dropdown__list")[0];
|
|
247
|
+
const lh = sw === null || sw === void 0 ? void 0 : sw.getElementsByClassName("tags-dropdown__header")[0];
|
|
248
|
+
const lf = sw === null || sw === void 0 ? void 0 : sw.getElementsByClassName("tags-dropdown__footer")[0];
|
|
249
|
+
const margin = parseInt((_getComputedStyle$mar = (_getComputedStyle = getComputedStyle(sw)) === null || _getComputedStyle === void 0 || (_getComputedStyle = _getComputedStyle.marginTop) === null || _getComputedStyle === void 0 ? void 0 : _getComputedStyle.replace("px", "")) !== null && _getComputedStyle$mar !== void 0 ? _getComputedStyle$mar : 0, 10);
|
|
250
|
+
const maxHeight = initListHeight !== null && initListHeight !== void 0 ? initListHeight : parseInt((_getComputedStyle$max = (_getComputedStyle2 = getComputedStyle(dl)) === null || _getComputedStyle2 === void 0 || (_getComputedStyle2 = _getComputedStyle2.maxHeight) === null || _getComputedStyle2 === void 0 ? void 0 : _getComputedStyle2.replace("px", "")) !== null && _getComputedStyle$max !== void 0 ? _getComputedStyle$max : 0, 10);
|
|
252
251
|
if (initListHeight === null) setInitListHeight(maxHeight);
|
|
253
252
|
const toTop = top - margin;
|
|
254
253
|
const toBottom = windowHeight - top - height - margin * 2;
|
|
@@ -257,11 +256,11 @@ const TagsDropdown = _ref => {
|
|
|
257
256
|
const controlsHeight = swHeight - dlHeight;
|
|
258
257
|
if (swHeight > maxHeight) swHeight = maxHeight - 2 * margin;
|
|
259
258
|
const maxSwHeight = isMobile ? (sw === null || sw === void 0 || (_sw$getBoundingClient2 = sw.getBoundingClientRect()) === null || _sw$getBoundingClient2 === void 0 ? void 0 : _sw$getBoundingClient2.height) - (lh === null || lh === void 0 || (_lh$getBoundingClient = lh.getBoundingClientRect()) === null || _lh$getBoundingClient === void 0 ? void 0 : _lh$getBoundingClient.height) - (lf === null || lf === void 0 || (_lf$getBoundingClient = lf.getBoundingClientRect()) === null || _lf$getBoundingClient === void 0 ? void 0 : _lf$getBoundingClient.height) : toTop - margin >= maxHeight || toBottom - margin >= maxHeight ? maxHeight - 3 * margin : toTop > toBottom ? toTop - 3 * margin : toBottom - 4 * margin;
|
|
260
|
-
const listPos = toTop < toBottom || toBottom >= swHeight ?
|
|
261
|
-
if (swHeight > (listPos ===
|
|
259
|
+
const listPos = toTop < toBottom || toBottom >= swHeight ? "bottom" : "top";
|
|
260
|
+
if (swHeight > (listPos === "top" ? toTop : toBottom)) swHeight = (listPos === "top" ? toTop : toBottom) - 3 * margin;
|
|
262
261
|
lc.style.minWidth = "".concat(width, "px");
|
|
263
262
|
lc.style.left = "".concat(left, "px");
|
|
264
|
-
lc.style.top = "".concat(listPos ===
|
|
263
|
+
lc.style.top = "".concat(listPos === "bottom" ? top + height : top - swHeight - 2 * margin, "px");
|
|
265
264
|
dl.style.maxHeight = "".concat(isMobile ? maxSwHeight : maxSwHeight - controlsHeight, "px");
|
|
266
265
|
};
|
|
267
266
|
const renderListContainer = () => {
|
|
@@ -271,13 +270,13 @@ const TagsDropdown = _ref => {
|
|
|
271
270
|
};
|
|
272
271
|
const isTargetInParent = target => {
|
|
273
272
|
var _target$className, _target$className$ind, _target$className2, _target$className2$in;
|
|
274
|
-
if ((target === null || target === void 0 ? void 0 : target.tagName) ===
|
|
275
|
-
if ((target === null || target === void 0 ? void 0 : target.tagName) ===
|
|
273
|
+
if ((target === null || target === void 0 ? void 0 : target.tagName) === "svg" && (target === null || target === void 0 ? void 0 : target.parentNodclassName) === "tag__button" || (target === null || target === void 0 ? void 0 : target.tagName) === "line") return false;
|
|
274
|
+
if ((target === null || target === void 0 ? void 0 : target.tagName) === "svg" && (target === null || target === void 0 ? void 0 : target.parentNodclassName) !== "tag__button" || (target === null || target === void 0 || (_target$className = target.className) === null || _target$className === void 0 || (_target$className$ind = _target$className.indexOf) === null || _target$className$ind === void 0 ? void 0 : _target$className$ind.call(_target$className, "tag__label")) !== -1 || (target === null || target === void 0 || (_target$className2 = target.className) === null || _target$className2 === void 0 || (_target$className2$in = _target$className2.indexOf) === null || _target$className2$in === void 0 ? void 0 : _target$className2$in.call(_target$className2, "tag-list_wrapper")) !== -1 || (target === null || target === void 0 ? void 0 : target.className) === "".concat(RC, "__trigger") || (target === null || target === void 0 ? void 0 : target.className) === "tags-dropdown__arrow") return true;
|
|
276
275
|
return false;
|
|
277
276
|
};
|
|
278
277
|
const isItemMatchesSearch = item => {
|
|
279
278
|
const title = item.title || item.label;
|
|
280
|
-
return searchValue.length ? title.toLowerCase().includes((searchValue === null || searchValue === void 0 ? void 0 : searchValue.toLowerCase()) ||
|
|
279
|
+
return searchValue.length ? title.toLowerCase().includes((searchValue === null || searchValue === void 0 ? void 0 : searchValue.toLowerCase()) || "") : true;
|
|
281
280
|
};
|
|
282
281
|
const getFilteredOptions = options => options === null || options === void 0 ? void 0 : options.reduce((result, option) => {
|
|
283
282
|
if (option.groupName) {
|
|
@@ -343,7 +342,7 @@ const TagsDropdown = _ref => {
|
|
|
343
342
|
className: "".concat(RC, "__input"),
|
|
344
343
|
value: searchValue,
|
|
345
344
|
onChange: v => setSearchValue(v),
|
|
346
|
-
placeholder: mobileSearchPlaceholder ||
|
|
345
|
+
placeholder: mobileSearchPlaceholder || "Search",
|
|
347
346
|
withDelete: true,
|
|
348
347
|
onMouseDown: e => {
|
|
349
348
|
if (!isOpen) {
|
|
@@ -355,11 +354,11 @@ const TagsDropdown = _ref => {
|
|
|
355
354
|
className: (0, _classnames.default)("".concat(RC, "__header-row"))
|
|
356
355
|
}, headerContent)) : null, /*#__PURE__*/_react.default.createElement("div", {
|
|
357
356
|
ref: dropdownListRef,
|
|
358
|
-
className: "".concat(RC, "__list ").concat(headerContent || isMobile ? "".concat(RC, "__list--with-header") :
|
|
357
|
+
className: "".concat(RC, "__list ").concat(headerContent || isMobile ? "".concat(RC, "__list--with-header") : "", " ").concat(footerContent ? "".concat(RC, "__list--with-footer") : "")
|
|
359
358
|
}, filteredOptions === null || filteredOptions === void 0 ? void 0 : filteredOptions.map(option => {
|
|
360
359
|
var _option$groupName, _option$list2;
|
|
361
360
|
return option.groupName ? /*#__PURE__*/_react.default.createElement("div", {
|
|
362
|
-
key: (_option$groupName = option.groupName) === null || _option$groupName === void 0 || (_option$groupName = _option$groupName.toString()) === null || _option$groupName === void 0 ? void 0 : _option$groupName.replace(/ /g,
|
|
361
|
+
key: (_option$groupName = option.groupName) === null || _option$groupName === void 0 || (_option$groupName = _option$groupName.toString()) === null || _option$groupName === void 0 ? void 0 : _option$groupName.replace(/ /g, "_").concat(Date.now()),
|
|
363
362
|
className: (0, _classnames.default)("".concat(RC, "-group"), option.className)
|
|
364
363
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
365
364
|
className: "".concat(RC, "-group__name")
|
|
@@ -368,14 +367,14 @@ const TagsDropdown = _ref => {
|
|
|
368
367
|
let {
|
|
369
368
|
value
|
|
370
369
|
} = _ref6;
|
|
371
|
-
return value !==
|
|
370
|
+
return value !== "open_modal";
|
|
372
371
|
})) === null || _filteredOptions$filt === void 0 ? void 0 : _filteredOptions$filt.length) === 0 ? /*#__PURE__*/_react.default.createElement("div", {
|
|
373
372
|
className: "".concat(RC, "__no-options")
|
|
374
373
|
}, noOptionsText) : null), (footerContent || isMobile) && ((_filteredOptions$filt2 = filteredOptions.filter(_ref7 => {
|
|
375
374
|
let {
|
|
376
375
|
value
|
|
377
376
|
} = _ref7;
|
|
378
|
-
return value !==
|
|
377
|
+
return value !== "open_modal";
|
|
379
378
|
})) === null || _filteredOptions$filt2 === void 0 ? void 0 : _filteredOptions$filt2.length) > 0 ? /*#__PURE__*/_react.default.createElement("div", {
|
|
380
379
|
className: (0, _classnames.default)("".concat(RC, "__footer"), {
|
|
381
380
|
["".concat(RC, "__footer-with-shadow")]: isMobile && isScrollableList,
|
|
@@ -383,7 +382,7 @@ const TagsDropdown = _ref => {
|
|
|
383
382
|
})
|
|
384
383
|
}, footerContent, isMobile && /*#__PURE__*/_react.default.createElement("button", {
|
|
385
384
|
onClick: () => setIsOpen(false)
|
|
386
|
-
}, "Apply", chosenOptions !== null && chosenOptions !== void 0 && chosenOptions.length ? "(".concat(chosenOptions === null || chosenOptions === void 0 ? void 0 : chosenOptions.length, ")") :
|
|
385
|
+
}, "Apply", chosenOptions !== null && chosenOptions !== void 0 && chosenOptions.length ? "(".concat(chosenOptions === null || chosenOptions === void 0 ? void 0 : chosenOptions.length, ")") : "")) : null));
|
|
387
386
|
};
|
|
388
387
|
const closeList = e => {
|
|
389
388
|
var _inputRef$current;
|
|
@@ -395,18 +394,18 @@ const TagsDropdown = _ref => {
|
|
|
395
394
|
}, []);
|
|
396
395
|
(0, _react.useLayoutEffect)(() => {
|
|
397
396
|
if (!isMobile) {
|
|
398
|
-
window.addEventListener(
|
|
399
|
-
window.addEventListener(
|
|
400
|
-
window.addEventListener(
|
|
397
|
+
window.addEventListener("resize", setListContainerStyles);
|
|
398
|
+
window.addEventListener("mousewheel", closeList);
|
|
399
|
+
window.addEventListener("mouseup", handleClickOutside);
|
|
401
400
|
} else {
|
|
402
|
-
window.removeEventListener(
|
|
403
|
-
window.removeEventListener(
|
|
404
|
-
window.removeEventListener(
|
|
401
|
+
window.removeEventListener("resize", setListContainerStyles);
|
|
402
|
+
window.removeEventListener("mousewheel", closeList);
|
|
403
|
+
window.removeEventListener("mouseup", handleClickOutside);
|
|
405
404
|
}
|
|
406
405
|
return () => {
|
|
407
|
-
window.removeEventListener(
|
|
408
|
-
window.removeEventListener(
|
|
409
|
-
window.removeEventListener(
|
|
406
|
+
window.removeEventListener("resize", setListContainerStyles);
|
|
407
|
+
window.removeEventListener("mousewheel", closeList);
|
|
408
|
+
window.removeEventListener("mouseup", handleClickOutside);
|
|
410
409
|
};
|
|
411
410
|
}, [getListContainer]);
|
|
412
411
|
(0, _react.useLayoutEffect)(() => {
|
|
@@ -414,23 +413,23 @@ const TagsDropdown = _ref => {
|
|
|
414
413
|
}, [isOpen, chosenOptions, isMobile, dropdownListWrapperRef === null || dropdownListWrapperRef === void 0 || (_dropdownListWrapperR = dropdownListWrapperRef.current) === null || _dropdownListWrapperR === void 0 || (_dropdownListWrapperR = _dropdownListWrapperR.getBoundingClientRect()) === null || _dropdownListWrapperR === void 0 ? void 0 : _dropdownListWrapperR.height]);
|
|
415
414
|
(0, _react.useEffect)(() => {
|
|
416
415
|
if (!isMobile) {
|
|
417
|
-
document.addEventListener(
|
|
416
|
+
document.addEventListener("click", handleClickOutside, true);
|
|
418
417
|
} else {
|
|
419
|
-
document.removeEventListener(
|
|
418
|
+
document.removeEventListener("click", handleClickOutside, true);
|
|
420
419
|
}
|
|
421
|
-
return () => document.removeEventListener(
|
|
420
|
+
return () => document.removeEventListener("click", handleClickOutside, true);
|
|
422
421
|
}, [isMobile]);
|
|
423
422
|
(0, _react.useEffect)(() => {
|
|
424
423
|
var _selectAllButtonRef$c, _unselectAllButtonRef;
|
|
425
|
-
const fn = isOpen ?
|
|
426
|
-
selectAllButtonRef === null || selectAllButtonRef === void 0 || (_selectAllButtonRef$c = selectAllButtonRef.current) === null || _selectAllButtonRef$c === void 0 || _selectAllButtonRef$c[fn](
|
|
427
|
-
unselectAllButtonRef === null || unselectAllButtonRef === void 0 || (_unselectAllButtonRef = unselectAllButtonRef.current) === null || _unselectAllButtonRef === void 0 || _unselectAllButtonRef[fn](
|
|
424
|
+
const fn = isOpen ? "addEventListener" : "removeEventListener";
|
|
425
|
+
selectAllButtonRef === null || selectAllButtonRef === void 0 || (_selectAllButtonRef$c = selectAllButtonRef.current) === null || _selectAllButtonRef$c === void 0 || _selectAllButtonRef$c[fn]("click", selectAllItems, true);
|
|
426
|
+
unselectAllButtonRef === null || unselectAllButtonRef === void 0 || (_unselectAllButtonRef = unselectAllButtonRef.current) === null || _unselectAllButtonRef === void 0 || _unselectAllButtonRef[fn]("click", unselectAllItems, true);
|
|
428
427
|
if (isOpen) {
|
|
429
428
|
var _getListContainer2;
|
|
430
|
-
(_getListContainer2 = getListContainer()) === null || _getListContainer2 === void 0 || _getListContainer2.classList.add(
|
|
429
|
+
(_getListContainer2 = getListContainer()) === null || _getListContainer2 === void 0 || _getListContainer2.classList.add("tags-dropdown__container--opened");
|
|
431
430
|
} else {
|
|
432
431
|
var _getListContainer3;
|
|
433
|
-
(_getListContainer3 = getListContainer()) === null || _getListContainer3 === void 0 || _getListContainer3.classList.remove(
|
|
432
|
+
(_getListContainer3 = getListContainer()) === null || _getListContainer3 === void 0 || _getListContainer3.classList.remove("tags-dropdown__container--opened");
|
|
434
433
|
}
|
|
435
434
|
}, [isOpen]);
|
|
436
435
|
(0, _react.useEffect)(() => {
|
|
@@ -445,21 +444,21 @@ const TagsDropdown = _ref => {
|
|
|
445
444
|
}, [isOpen, isMobile, dropdownListRef === null || dropdownListRef === void 0 ? void 0 : dropdownListRef.current, dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr5 = dropdownListRef.current) === null || _dropdownListRef$curr5 === void 0 ? void 0 : _dropdownListRef$curr5.scrollHeight, dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr6 = dropdownListRef.current) === null || _dropdownListRef$curr6 === void 0 ? void 0 : _dropdownListRef$curr6.clientHeight]);
|
|
446
445
|
(0, _react.useEffect)(() => {
|
|
447
446
|
const setScrollTopValue = e => {
|
|
448
|
-
setScrollTop(parseInt(e.target.scrollTop));
|
|
447
|
+
setScrollTop(parseInt(e.target.scrollTop, 10));
|
|
449
448
|
};
|
|
450
449
|
if (isOpen && isMobile && dropdownListRef !== null && dropdownListRef !== void 0 && dropdownListRef.current) {
|
|
451
450
|
var _dropdownListRef$curr7;
|
|
452
|
-
dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr7 = dropdownListRef.current) === null || _dropdownListRef$curr7 === void 0 || _dropdownListRef$curr7.addEventListener(
|
|
451
|
+
dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr7 = dropdownListRef.current) === null || _dropdownListRef$curr7 === void 0 || _dropdownListRef$curr7.addEventListener("scroll", setScrollTopValue);
|
|
453
452
|
}
|
|
454
453
|
return () => {
|
|
455
454
|
var _dropdownListRef$curr8;
|
|
456
|
-
dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr8 = dropdownListRef.current) === null || _dropdownListRef$curr8 === void 0 || _dropdownListRef$curr8.removeEventListener(
|
|
455
|
+
dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr8 = dropdownListRef.current) === null || _dropdownListRef$curr8 === void 0 || _dropdownListRef$curr8.removeEventListener("scroll", setScrollTopValue);
|
|
457
456
|
};
|
|
458
457
|
}, [isOpen, isMobile, dropdownListRef === null || dropdownListRef === void 0 ? void 0 : dropdownListRef.current]);
|
|
459
458
|
(0, _react.useEffect)(() => {
|
|
460
459
|
if (dropdownListRef !== null && dropdownListRef !== void 0 && dropdownListRef.current) {
|
|
461
460
|
var _dropdownListRef$curr9, _dropdownListRef$curr10;
|
|
462
|
-
setScrollHeight(parseInt((dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr9 = dropdownListRef.current) === null || _dropdownListRef$curr9 === void 0 ? void 0 : _dropdownListRef$curr9.scrollHeight) - (dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr10 = dropdownListRef.current) === null || _dropdownListRef$curr10 === void 0 ? void 0 : _dropdownListRef$curr10.clientHeight)));
|
|
461
|
+
setScrollHeight(parseInt((dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr9 = dropdownListRef.current) === null || _dropdownListRef$curr9 === void 0 ? void 0 : _dropdownListRef$curr9.scrollHeight) - (dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr10 = dropdownListRef.current) === null || _dropdownListRef$curr10 === void 0 ? void 0 : _dropdownListRef$curr10.clientHeight), 10));
|
|
463
462
|
}
|
|
464
463
|
}, [scrollTop, dropdownListRef === null || dropdownListRef === void 0 ? void 0 : dropdownListRef.current]);
|
|
465
464
|
(0, _react.useEffect)(() => {
|
|
@@ -477,13 +476,13 @@ const TagsDropdown = _ref => {
|
|
|
477
476
|
ref: dropdownRef
|
|
478
477
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
479
478
|
className: (0, _classnames.default)("".concat(RC, "__trigger"), {
|
|
480
|
-
|
|
479
|
+
"tags-dropdown__error": error
|
|
481
480
|
}),
|
|
482
481
|
onClick: _ref8 => {
|
|
483
482
|
let {
|
|
484
483
|
target
|
|
485
484
|
} = _ref8;
|
|
486
|
-
if ((target === null || target === void 0 ? void 0 : target.tagName) ===
|
|
485
|
+
if ((target === null || target === void 0 ? void 0 : target.tagName) === "INPUT") setIsOpen(true);else if (isTargetInParent(target)) {
|
|
487
486
|
setIsOpen(isOpen => !isOpen);
|
|
488
487
|
}
|
|
489
488
|
}
|
|
@@ -504,7 +503,7 @@ const TagsDropdown = _ref => {
|
|
|
504
503
|
return /*#__PURE__*/_react.default.createElement(_Tag.default, {
|
|
505
504
|
key: value,
|
|
506
505
|
className: (0, _classnames.default)(tagClassname, {
|
|
507
|
-
|
|
506
|
+
"tag_with-btn": !(tag !== null && tag !== void 0 && tag.isFreezed)
|
|
508
507
|
}),
|
|
509
508
|
label: label,
|
|
510
509
|
removeItem: tag !== null && tag !== void 0 && tag.isFreezed ? null : () => deleteChosen(value),
|
|
@@ -515,13 +514,13 @@ const TagsDropdown = _ref => {
|
|
|
515
514
|
className: "".concat(RC, "__input"),
|
|
516
515
|
value: searchValue,
|
|
517
516
|
onChange: e => onSearchHandler(e.target.value),
|
|
518
|
-
placeholder: placeholder ||
|
|
517
|
+
placeholder: placeholder || "Select from list",
|
|
519
518
|
onKeyDown: e => onKeyPress(e, searchValue),
|
|
520
519
|
onFocus: e => {
|
|
521
520
|
var _e$target;
|
|
522
521
|
if (isMobile) e === null || e === void 0 || (_e$target = e.target) === null || _e$target === void 0 || _e$target.blur();
|
|
523
522
|
}
|
|
524
|
-
}, attributesOfNativeInput)) :
|
|
523
|
+
}, attributesOfNativeInput)) : "", isOpen && renderListContainer(), /*#__PURE__*/_react.default.createElement("span", {
|
|
525
524
|
className: (0, _classnames.default)("".concat(RC, "__arrow"), {
|
|
526
525
|
["".concat(RC, "__arrow_active")]: isOpen
|
|
527
526
|
})
|