intelicoreact 1.6.20 → 1.6.21
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 +1 -102
- package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.js +1 -89
- package/dist/Atomic/FormElements/Calendar/Calendar.js +1 -232
- package/dist/Atomic/FormElements/Calendar/Calendar.props.js +1 -3
- package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.js +1 -101
- package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.js +1 -70
- package/dist/Atomic/FormElements/Datepicker/Datepicker.js +1 -350
- package/dist/Atomic/FormElements/Datepicker/Datepicker.props.js +1 -3
- package/dist/Atomic/FormElements/Datepicker/components/DatepickerCalendar.js +1 -177
- package/dist/Atomic/FormElements/Datepicker/components/DatepickerCalendar.props.js +1 -3
- package/dist/Atomic/FormElements/Dropdown/Dropdown.js +1 -561
- package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.js +1 -20
- package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.js +1 -405
- package/dist/Atomic/FormElements/FileLoader/FileLoader.js +1 -94
- package/dist/Atomic/FormElements/FileLoader/partial/LoadZone.js +1 -105
- package/dist/Atomic/FormElements/FileLoader/partial/LoadedContent.js +1 -67
- package/dist/Atomic/FormElements/FileLoaderDescription/FileLoaderDescription.js +1 -247
- package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.js +1 -160
- package/dist/Atomic/FormElements/FileLoaderLocalGroup/FileLoaderLocalGroup.js +1 -193
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.js +1 -135
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN_old.js +1 -116
- package/dist/Atomic/FormElements/Input/Input.js +1 -467
- package/dist/Atomic/FormElements/InputCalendar/InputCalendar.js +1 -161
- package/dist/Atomic/FormElements/InputColor/InputColor.js +1 -64
- package/dist/Atomic/FormElements/InputCurrency/InputCurrency.js +1 -166
- package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +1 -354
- package/dist/Atomic/FormElements/InputDateRange/components/DateInput.js +1 -71
- package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.js +1 -693
- package/dist/Atomic/FormElements/InputDateRange/components/OpenedPart.js +1 -254
- package/dist/Atomic/FormElements/InputDateRange/components/SelectItem.js +1 -32
- package/dist/Atomic/FormElements/InputDateRange/dependencies.js +1 -200
- package/dist/Atomic/FormElements/InputLink/InputLink.js +1 -99
- package/dist/Atomic/FormElements/InputMask/InputCarretPosition.js +1 -37
- package/dist/Atomic/FormElements/InputMask/InputMask.js +1 -1214
- package/dist/Atomic/FormElements/InputMask/config.js +1 -15
- package/dist/Atomic/FormElements/InputMask/functions.js +1 -58
- package/dist/Atomic/FormElements/InputMask2/InputMask2.js +1 -674
- package/dist/Atomic/FormElements/InputMask2/config.js +1 -15
- package/dist/Atomic/FormElements/InputMask2/functions.js +1 -58
- package/dist/Atomic/FormElements/InputMask3/InputMask3.js +1 -766
- package/dist/Atomic/FormElements/InputMask3/config.js +1 -15
- package/dist/Atomic/FormElements/InputMask3/functions.js +1 -58
- package/dist/Atomic/FormElements/InputWithAction/InputWithAction.js +1 -114
- package/dist/Atomic/FormElements/InputsRow/InputsRow.js +1 -140
- package/dist/Atomic/FormElements/Label/Label.js +1 -82
- package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +1 -506
- package/dist/Atomic/FormElements/MultiSelect/MultiSelect.js +1 -45
- package/dist/Atomic/FormElements/NumericInput/NumericInput.js +1 -331
- package/dist/Atomic/FormElements/RadioGroup/RadioGroup.js +1 -66
- package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +1 -80
- package/dist/Atomic/FormElements/RadioInput/RadioInput.js +1 -64
- package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.js +1 -54
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +1 -183
- package/dist/Atomic/FormElements/RangeInputs/RangeInputs.js +1 -209
- package/dist/Atomic/FormElements/RangeList/RangeList.js +1 -175
- package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.js +1 -43
- package/dist/Atomic/FormElements/RangeSlider/RangeSlider.js +1 -443
- package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +1 -858
- package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.js +1 -39
- package/dist/Atomic/FormElements/Switcher/Switcher.js +1 -59
- package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.js +1 -50
- package/dist/Atomic/FormElements/SwitcherHide/SwitcherHide.js +1 -47
- package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.js +1 -96
- package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.js +1 -40
- package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.js +1 -64
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.js +1 -170
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/partial/States.js +1 -202
- package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.js +1 -67
- package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.js +1 -115
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +1 -826
- package/dist/Atomic/FormElements/Text/Text.js +1 -125
- package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.js +1 -45
- package/dist/Atomic/FormElements/Textarea/Textarea.js +1 -80
- package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +1 -176
- package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.js +1 -62
- package/dist/Atomic/FormElements/TimeRange/TimeRange.js +1 -127
- package/dist/Atomic/FormElements/UserContacts/UserContacts.js +1 -220
- package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.js +1 -83
- package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.js +1 -82
- package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.js +1 -101
- package/dist/Atomic/FormElements/WidgetPseudoTable/partial/constructor.js +1 -29
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.js +1 -113
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/partial/constructor.js +1 -30
- package/dist/Atomic/Layout/Header/Header.js +1 -85
- package/dist/Atomic/Layout/Spinner/Spinner.js +1 -39
- package/dist/Atomic/UI/Accordion/Accordion.js +1 -118
- package/dist/Atomic/UI/Accordion/AccordionItem.js +1 -181
- package/dist/Atomic/UI/AccordionTable/AccordionTable.js +1 -238
- package/dist/Atomic/UI/AccordionText/AccordionText.js +1 -69
- package/dist/Atomic/UI/AdvancedTag/AdvTag.js +1 -207
- package/dist/Atomic/UI/AdvancedTag/AdvancedTags.js +1 -56
- package/dist/Atomic/UI/Alert/Alert.js +1 -72
- package/dist/Atomic/UI/Arrow/Arrow.js +1 -132
- package/dist/Atomic/UI/Box/Box.js +1 -52
- package/dist/Atomic/UI/Button/Button.js +1 -89
- package/dist/Atomic/UI/ButtonsBar/ButtonsBar.js +1 -72
- package/dist/Atomic/UI/Chart/Chart.js +1 -172
- package/dist/Atomic/UI/Chart/partial/Chart.constants.js +1 -95
- package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +1 -80
- package/dist/Atomic/UI/Chart/partial/datasetSetters.js +1 -188
- package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +1 -335
- package/dist/Atomic/UI/Chart/partial/optionsSetters.js +1 -43
- package/dist/Atomic/UI/Chart/partial/utils.js +1 -60
- package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +1 -109
- package/dist/Atomic/UI/DateTime/DateTime.js +1 -57
- package/dist/Atomic/UI/DebugContainer/DebugContainer.js +1 -44
- package/dist/Atomic/UI/DebugContainer/useDebugContainer.js +1 -15
- package/dist/Atomic/UI/DoubleString/DoubleString.js +1 -102
- package/dist/Atomic/UI/DynamicIcon/DynamicIcon.js +1 -226
- package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +1 -221
- package/dist/Atomic/UI/ExampleChartIntegration/partial/utils.js +1 -106
- package/dist/Atomic/UI/Hint/Hint.js +1 -193
- package/dist/Atomic/UI/Hint/partials/_utils.js +1 -51
- package/dist/Atomic/UI/Modal/Modal.js +1 -188
- package/dist/Atomic/UI/Modal/ModalHOC.js +1 -72
- package/dist/Atomic/UI/Modal/partials/ModalFooter.js +1 -46
- package/dist/Atomic/UI/Modal/partials/ModalTitle.js +1 -83
- package/dist/Atomic/UI/Modal/partials/useMobileModal.js +1 -200
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion._test.js +1 -75
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +1 -80
- package/dist/Atomic/UI/NavLine/NavLine.js +1 -293
- package/dist/Atomic/UI/PageTitle/PageTitle.js +1 -75
- package/dist/Atomic/UI/PieChart/PieChart.js +1 -42
- package/dist/Atomic/UI/Price/Price.js +1 -22
- package/dist/Atomic/UI/PriceRange/PriceRange.js +1 -36
- package/dist/Atomic/UI/ProgressLine/ProgressLine.js +1 -71
- package/dist/Atomic/UI/Status/Status.js +1 -59
- package/dist/Atomic/UI/Table/Partials/TdCell.js +1 -87
- package/dist/Atomic/UI/Table/Partials/TdHeader.js +1 -38
- package/dist/Atomic/UI/Table/Partials/TdRow.js +1 -99
- package/dist/Atomic/UI/Table/Partials/TdTitle.js +1 -52
- package/dist/Atomic/UI/Table/Table.js +1 -63
- package/dist/Atomic/UI/Table/TdTypes/TdActions.js +1 -80
- package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +1 -28
- package/dist/Atomic/UI/Table/TdTypes/TdRange.js +1 -13
- package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +1 -53
- package/dist/Atomic/UI/Tag/Tag.js +1 -160
- package/dist/Atomic/UI/TagList/TagList.js +1 -251
- package/dist/Atomic/UI/UserBox/UserBox.js +1 -73
- package/dist/Atomic/UI/WizardStepper/constructor.js +1 -84
- package/dist/Atomic/UI/WizardStepper/index.js +1 -3
- package/dist/Atomic/UI/WizardStepper/ui/StateIcon/StateIcon.js +1 -37
- package/dist/Atomic/UI/WizardStepper/ui/StateIcon/index.js +1 -3
- package/dist/Atomic/UI/WizardStepper/ui/StepRow/StepRow.js +1 -61
- package/dist/Atomic/UI/WizardStepper/ui/StepRow/index.js +1 -3
- package/dist/Atomic/UI/WizardStepper/ui/StepWrapper/StepWrapper.js +1 -39
- package/dist/Atomic/UI/WizardStepper/ui/StepWrapper/index.js +1 -3
- package/dist/Atomic/UI/WizardStepper/ui/icons.js +1 -49
- package/dist/Atomic/UI/WizardStepper/ui/index.js +1 -3
- package/dist/Classes/AbortableFetch.js +1 -454
- package/dist/Classes/AnimatedHandler.js +1 -47
- package/dist/Classes/RESTAPI/index.js +1 -228
- package/dist/Classes/RESTAPI/partials/AbortableFetch.js +1 -457
- package/dist/Classes/RESTAPI/partials/ApiBase.js +1 -48
- package/dist/Classes/RESTAPI/partials/ApiRequestCreators.js +1 -112
- package/dist/Classes/RESTAPI/partials/ApiUtils.js +1 -189
- package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +1 -252
- package/dist/Classes/RESTAPI/partials/Utils.js +1 -92
- package/dist/Classes/RESTAPI/partials/_outerDependencies.js +1 -3
- package/dist/Classes/RESTAPI/partials/_utils.js +1 -197
- package/dist/Constants/index.constants.js +1 -78
- package/dist/Functions/Portal.js +1 -22
- package/dist/Functions/customEventListener.js +1 -96
- package/dist/Functions/dateTime.js +1 -149
- package/dist/Functions/fieldValueFormatters.js +1 -405
- package/dist/Functions/guards/assertions.js +1 -66
- package/dist/Functions/guards/safeValue.js +1 -30
- package/dist/Functions/guards/typeGuards.js +1 -116
- package/dist/Functions/hooks/useFormFieldsChangesManager.js +1 -95
- package/dist/Functions/locale/createTranslator.js +1 -32
- package/dist/Functions/operations.js +1 -130
- package/dist/Functions/presets/inputMaskPresets.js +1 -170
- package/dist/Functions/presets/inputPresets.js +1 -60
- package/dist/Functions/presets/mobileKeyboardTypesPresets.js +1 -45
- package/dist/Functions/schemas.js +1 -31
- package/dist/Functions/useBodyScrollLock.js +1 -17
- package/dist/Functions/useClickOutside.js +1 -15
- package/dist/Functions/useDebounce.js +1 -17
- package/dist/Functions/useFieldFocus.js +1 -84
- package/dist/Functions/useFormTools/form-drivers/ArrayWithObjects.js +1 -39
- package/dist/Functions/useFormTools/form-drivers/ObjectWithIterableObjects.js +1 -159
- package/dist/Functions/useFormTools/form-drivers/ObjectWithNamedKeyObjects.js +1 -78
- package/dist/Functions/useFormTools/functions/General.js +1 -134
- package/dist/Functions/useFormTools/functions/RenderFields.js +1 -111
- package/dist/Functions/useFormTools/functions/usePrevious.js +1 -12
- package/dist/Functions/useFormTools/index.js +1 -778
- package/dist/Functions/useInputHighlightError.js +1 -67
- package/dist/Functions/useIsMobile/useIsMobile.js +1 -53
- package/dist/Functions/useKeyPress/useHandleKeyPress.js +1 -21
- package/dist/Functions/useKeyPress/useKeyPress.js +1 -75
- package/dist/Functions/useLocalStorage.js +1 -34
- package/dist/Functions/useLocationParams.js +1 -27
- package/dist/Functions/useMediaQuery.js +1 -17
- package/dist/Functions/useMetaInfo.js +1 -43
- package/dist/Functions/useMouseUpOutside.js +1 -16
- package/dist/Functions/useOnlineStatus.js +1 -29
- package/dist/Functions/usePasswordChecker.js +1 -110
- package/dist/Functions/usePrevious.js +1 -12
- package/dist/Functions/useResize.js +1 -31
- package/dist/Functions/useScrollTo.js +1 -17
- package/dist/Functions/useToggle.js +1 -17
- package/dist/Functions/utils.js +1 -522
- package/dist/Langs.js +1 -168
- package/dist/Molecular/CustomIcons/components/AffiliateNetworks.js +1 -21
- package/dist/Molecular/CustomIcons/components/AlertCircle.js +1 -23
- package/dist/Molecular/CustomIcons/components/AppStore.js +1 -29
- package/dist/Molecular/CustomIcons/components/Arrow.js +1 -32
- package/dist/Molecular/CustomIcons/components/ArrowDown.js +1 -17
- package/dist/Molecular/CustomIcons/components/ArrowLeft.js +1 -22
- package/dist/Molecular/CustomIcons/components/ArrowRight.js +1 -22
- package/dist/Molecular/CustomIcons/components/ArrowUp.js +1 -17
- package/dist/Molecular/CustomIcons/components/Bell.js +1 -15
- package/dist/Molecular/CustomIcons/components/Button.js +1 -12
- package/dist/Molecular/CustomIcons/components/Campaigns.js +1 -16
- package/dist/Molecular/CustomIcons/components/Check.js +1 -14
- package/dist/Molecular/CustomIcons/components/Check2.js +1 -12
- package/dist/Molecular/CustomIcons/components/ChevronDown.js +1 -12
- package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.js +1 -11
- package/dist/Molecular/CustomIcons/components/ChevronLeft.js +1 -11
- package/dist/Molecular/CustomIcons/components/ChevronRight.js +1 -11
- package/dist/Molecular/CustomIcons/components/ChevronUp.js +1 -11
- package/dist/Molecular/CustomIcons/components/ChevronUpDown.js +1 -27
- package/dist/Molecular/CustomIcons/components/Close.js +1 -14
- package/dist/Molecular/CustomIcons/components/ColumnsOrder.js +1 -17
- package/dist/Molecular/CustomIcons/components/Delete.js +1 -16
- package/dist/Molecular/CustomIcons/components/Edit.js +1 -15
- package/dist/Molecular/CustomIcons/components/Email.js +1 -31
- package/dist/Molecular/CustomIcons/components/FinturfLogo.js +1 -18
- package/dist/Molecular/CustomIcons/components/FinturfLogo2.js +1 -35
- package/dist/Molecular/CustomIcons/components/Flows.js +1 -15
- package/dist/Molecular/CustomIcons/components/Gift.js +1 -25
- package/dist/Molecular/CustomIcons/components/GoogleAuth.js +1 -29
- package/dist/Molecular/CustomIcons/components/GooglePlay.js +1 -29
- package/dist/Molecular/CustomIcons/components/HelpCircle.js +1 -19
- package/dist/Molecular/CustomIcons/components/HelpCircle2.js +1 -20
- package/dist/Molecular/CustomIcons/components/HelpCircleFilled.js +1 -19
- package/dist/Molecular/CustomIcons/components/Home.js +1 -16
- package/dist/Molecular/CustomIcons/components/Home2.js +1 -22
- package/dist/Molecular/CustomIcons/components/Key.js +1 -23
- package/dist/Molecular/CustomIcons/components/Landers.js +1 -20
- package/dist/Molecular/CustomIcons/components/Lock.js +1 -15
- package/dist/Molecular/CustomIcons/components/Mail.js +1 -26
- package/dist/Molecular/CustomIcons/components/Mastercard.js +1 -73
- package/dist/Molecular/CustomIcons/components/Minus.js +1 -25
- package/dist/Molecular/CustomIcons/components/Offers.js +1 -16
- package/dist/Molecular/CustomIcons/components/Pause.js +1 -28
- package/dist/Molecular/CustomIcons/components/PayPal.js +1 -41
- package/dist/Molecular/CustomIcons/components/PayPalLightLarge.js +1 -28
- package/dist/Molecular/CustomIcons/components/Phone.js +1 -30
- package/dist/Molecular/CustomIcons/components/Play.js +1 -25
- package/dist/Molecular/CustomIcons/components/Plus.js +1 -25
- package/dist/Molecular/CustomIcons/components/Profile.js +1 -16
- package/dist/Molecular/CustomIcons/components/QRCode.js +1 -29
- package/dist/Molecular/CustomIcons/components/Rectangle.js +1 -12
- package/dist/Molecular/CustomIcons/components/Revert.js +1 -13
- package/dist/Molecular/CustomIcons/components/Star.js +1 -14
- package/dist/Molecular/CustomIcons/components/Star2.js +1 -16
- package/dist/Molecular/CustomIcons/components/TrafficSources.js +1 -14
- package/dist/Molecular/CustomIcons/components/Trash.js +1 -15
- package/dist/Molecular/CustomIcons/components/TrashRed.js +1 -15
- package/dist/Molecular/CustomIcons/components/Triggers.js +1 -15
- package/dist/Molecular/CustomIcons/components/User.js +1 -25
- package/dist/Molecular/CustomIcons/components/Visa.js +1 -31
- package/dist/Molecular/CustomIcons/components/X.js +1 -12
- package/dist/Molecular/CustomIcons/index.js +1 -61
- package/dist/Molecular/FormElement/FormElement.js +1 -54
- package/dist/Molecular/FormWithDependOn/FormWithDependOn.js +1 -184
- package/dist/Molecular/FormWithDependOn/partials/_utils.js +1 -53
- package/dist/Molecular/InputAddress/InputAddress.js +1 -620
- package/dist/Molecular/InputPassword/InputPassword.js +1 -48
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,826 +1 @@
|
|
|
1
|
-
function e(e, n) {
|
|
2
|
-
(null == n || n > e.length) && (n = e.length);
|
|
3
|
-
for(var l = 0, t = Array(n); l < n; l++)t[l] = e[l];
|
|
4
|
-
return t;
|
|
5
|
-
}
|
|
6
|
-
function n(e, n, l) {
|
|
7
|
-
return n in e ? Object.defineProperty(e, n, {
|
|
8
|
-
value: l,
|
|
9
|
-
enumerable: !0,
|
|
10
|
-
configurable: !0,
|
|
11
|
-
writable: !0
|
|
12
|
-
}) : e[n] = l, e;
|
|
13
|
-
}
|
|
14
|
-
function l(e) {
|
|
15
|
-
for(var l = 1; l < arguments.length; l++){
|
|
16
|
-
var t = null != arguments[l] ? arguments[l] : {}, o = Object.keys(t);
|
|
17
|
-
"function" == typeof Object.getOwnPropertySymbols && (o = o.concat(Object.getOwnPropertySymbols(t).filter(function(e) {
|
|
18
|
-
return Object.getOwnPropertyDescriptor(t, e).enumerable;
|
|
19
|
-
}))), o.forEach(function(l) {
|
|
20
|
-
n(e, l, t[l]);
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
return e;
|
|
24
|
-
}
|
|
25
|
-
function t(e, n) {
|
|
26
|
-
return n = null != n ? n : {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : (function(e, n) {
|
|
27
|
-
var l = Object.keys(e);
|
|
28
|
-
if (Object.getOwnPropertySymbols) {
|
|
29
|
-
var t = Object.getOwnPropertySymbols(e);
|
|
30
|
-
l.push.apply(l, t);
|
|
31
|
-
}
|
|
32
|
-
return l;
|
|
33
|
-
})(Object(n)).forEach(function(l) {
|
|
34
|
-
Object.defineProperty(e, l, Object.getOwnPropertyDescriptor(n, l));
|
|
35
|
-
}), e;
|
|
36
|
-
}
|
|
37
|
-
function o(e, n) {
|
|
38
|
-
return function(e) {
|
|
39
|
-
if (Array.isArray(e)) return e;
|
|
40
|
-
}(e) || function(e, n) {
|
|
41
|
-
var l, t, o = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
|
|
42
|
-
if (null != o) {
|
|
43
|
-
var r = [], i = !0, u = !1;
|
|
44
|
-
try {
|
|
45
|
-
for(o = o.call(e); !(i = (l = o.next()).done) && (r.push(l.value), !n || r.length !== n); i = !0);
|
|
46
|
-
} catch (e) {
|
|
47
|
-
u = !0, t = e;
|
|
48
|
-
} finally{
|
|
49
|
-
try {
|
|
50
|
-
i || null == o.return || o.return();
|
|
51
|
-
} finally{
|
|
52
|
-
if (u) throw t;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return r;
|
|
56
|
-
}
|
|
57
|
-
}(e, n) || i(e, n) || function() {
|
|
58
|
-
throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
59
|
-
}();
|
|
60
|
-
}
|
|
61
|
-
function r(n) {
|
|
62
|
-
return function(n) {
|
|
63
|
-
if (Array.isArray(n)) return e(n);
|
|
64
|
-
}(n) || function(e) {
|
|
65
|
-
if ("undefined" != typeof Symbol && null != e[Symbol.iterator] || null != e["@@iterator"]) return Array.from(e);
|
|
66
|
-
}(n) || i(n) || function() {
|
|
67
|
-
throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
68
|
-
}();
|
|
69
|
-
}
|
|
70
|
-
function i(n, l) {
|
|
71
|
-
if (n) {
|
|
72
|
-
if ("string" == typeof n) return e(n, l);
|
|
73
|
-
var t = Object.prototype.toString.call(n).slice(8, -1);
|
|
74
|
-
if ("Object" === t && n.constructor && (t = n.constructor.name), "Map" === t || "Set" === t) return Array.from(t);
|
|
75
|
-
if ("Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return e(n, l);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
Object.defineProperty(exports, "__esModule", {
|
|
79
|
-
value: !0
|
|
80
|
-
}), Object.defineProperty(exports, "default", {
|
|
81
|
-
enumerable: !0,
|
|
82
|
-
get: function() {
|
|
83
|
-
return j;
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
var u = require("react/jsx-runtime"), a = w(require("classnames")), c = function(e, n) {
|
|
87
|
-
if (e && e.__esModule) return e;
|
|
88
|
-
if (null === e || (void 0 === e ? "undefined" : e && "undefined" != typeof Symbol && e.constructor === Symbol ? "symbol" : typeof e) != "object" && "function" != typeof e) return {
|
|
89
|
-
default: e
|
|
90
|
-
};
|
|
91
|
-
var l = y(n);
|
|
92
|
-
if (l && l.has(e)) return l.get(e);
|
|
93
|
-
var t = {
|
|
94
|
-
__proto__: null
|
|
95
|
-
}, o = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
96
|
-
for(var r in e)if ("default" !== r && Object.prototype.hasOwnProperty.call(e, r)) {
|
|
97
|
-
var i = o ? Object.getOwnPropertyDescriptor(e, r) : null;
|
|
98
|
-
i && (i.get || i.set) ? Object.defineProperty(t, r, i) : t[r] = e[r];
|
|
99
|
-
}
|
|
100
|
-
return t.default = e, l && l.set(e, t), t;
|
|
101
|
-
}(require("react")), s = require("react-dom"), d = require("react-feather"), v = require("../../../Functions/fieldValueFormatters"), f = require("../../../Functions/useDebounce"), m = w(require("../../../Functions/useIsMobile/useIsMobile")), p = w(require("../../UI/Button/Button")), h = w(require("../../UI/Tag/Tag")), g = w(require("../../UI/TagList/TagList")), b = w(require("../CheckboxInput/CheckboxInput")), _ = w(require("../Input/Input"));
|
|
102
|
-
function w(e) {
|
|
103
|
-
return e && e.__esModule ? e : {
|
|
104
|
-
default: e
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
function y(e) {
|
|
108
|
-
if ("function" != typeof WeakMap) return null;
|
|
109
|
-
var n = new WeakMap(), l = new WeakMap();
|
|
110
|
-
return (y = function(e) {
|
|
111
|
-
return e ? l : n;
|
|
112
|
-
})(e);
|
|
113
|
-
}
|
|
114
|
-
require("./TagsDropdown.scss");
|
|
115
|
-
var x = 'tags-dropdown', N = [
|
|
116
|
-
'#F1F0F0',
|
|
117
|
-
'#E3E2E0',
|
|
118
|
-
'#EEDFDA',
|
|
119
|
-
'#F9DEC9',
|
|
120
|
-
'#FDECC8',
|
|
121
|
-
'#DBECDB',
|
|
122
|
-
'#D3E4EF',
|
|
123
|
-
'#E8DEEE',
|
|
124
|
-
'#F4E0E9',
|
|
125
|
-
'#FFE2DD',
|
|
126
|
-
'#D3EFED',
|
|
127
|
-
'#ECEEDE'
|
|
128
|
-
], j = function(e) {
|
|
129
|
-
var i, w, y, j, C, E, O, S = e.options, L = e.chosenOptions, k = e.onChange, D = e.className, I = e.tagClassname, P = e.listClassName, M = e.onKeyPress, R = e.placeholder, A = e.label, F = e.disabled, T = e.isValuesInTags, B = e.error, H = e.isNotValidateASCII, q = void 0 !== H && H, z = e.noTagsWrap, W = void 0 !== z && z, U = e.headerContent, K = void 0 === U ? null : U, V = e.footerContent, X = void 0 === V ? null : V, Y = e.selectAllButtonRef, $ = void 0 === Y ? null : Y, G = e.unselectAllButtonRef, J = void 0 === G ? null : G, Q = e.closeOnSelect, Z = void 0 !== Q && Q, ee = e.closeOnRemove, en = void 0 !== ee && ee, el = e.closeOnRemoveAll, et = void 0 !== el && el, eo = e.closeOnSelectAll, er = void 0 !== eo && eo, ei = e.closeOnSelectMobile, eu = void 0 !== ei && ei, ea = e.closeOnRemoveMobile, ec = void 0 !== ea && ea, es = e.closeOnRemoveAllMobile, ed = void 0 !== es && es, ev = e.closeOnSelectAllMobile, ef = void 0 !== ev && ev, em = e.fieldKey, ep = e.id, eh = e.noOptionsText, eg = void 0 === eh ? 'No options available' : eh, eb = e.mobileSearchPlaceholder, e_ = e.isSearchable, ew = void 0 === e_ || e_, ey = e.useLiveSearch, ex = e.doRequest, eN = e.attributesOfNativeInput, ej = e.isUseLocalOptionsStore, eC = void 0 === ej || ej, eE = e.isDefaultOpened, eO = void 0 !== eE && eE, eS = e.withMobileLogic, eL = e.withCreateLogic, ek = e.withActions, eD = e.withSearchInputInList, eI = e.renderOptionsAsTags, eP = e.minItemsForShowMobileSearch, eM = void 0 === eP ? 10 : eP, eR = e.onOptionCreate, eA = e.onOptionEdit, eF = e.onOptionDelete, eT = e.onActionConfirmClick, eB = e.onActionCancelClick, eH = e.onDropdownListClose, eq = e.customTriggerRef, ez = e.renderCustomTrigger, eW = e.recalculateListContainerStylesTrigger, eU = (0, c.useRef)(null), eK = (0, c.useRef)(null), eV = (0, c.useRef)(null), eX = (0, c.useRef)(null), eY = (0, c.useRef)(null), e$ = (0, c.useRef)(null), eG = (0, m.default)().isMobile, eJ = eG && eS && window.screen.width <= 768, eQ = o((0, c.useState)(ep || em || Math.random().toString(16).slice(2)), 1)[0], eZ = o((0, c.useState)(!1), 2), e0 = eZ[0], e1 = eZ[1], e2 = o((0, c.useState)(0), 2), e3 = e2[0], e6 = e2[1], e8 = o((0, c.useState)(null), 2), e5 = e8[0], e9 = e8[1], e4 = o((0, c.useState)(null), 2), e7 = e4[0], ne = e4[1], nn = o((0, c.useState)(null), 2), nl = nn[0], nt = nn[1], no = o((0, c.useState)(!1), 2), nr = no[0], ni = no[1], nu = o((0, c.useState)(0), 2), na = nu[0], nc = nu[1], ns = o((0, c.useState)(1), 2), nd = ns[0], nv = ns[1], nf = (0, c.useRef)(null), nm = o((0, c.useState)(''), 2), np = nm[0], nh = nm[1], ng = (0, f.useDebounce)({
|
|
130
|
-
searchValue: np,
|
|
131
|
-
delay: 600
|
|
132
|
-
}), nb = o((0, c.useState)(!1), 2), n_ = nb[0], nw = nb[1], ny = function(e) {
|
|
133
|
-
nh(e), nw(np !== e && '' === e), nf.current = e;
|
|
134
|
-
}, nx = (0, c.useRef)(null), nN = o((0, c.useState)([]), 2), nj = nN[0], nC = nN[1], nE = o((0, c.useState)(null), 2), nO = nE[0], nS = nE[1], nL = function(e) {
|
|
135
|
-
nS(function(n) {
|
|
136
|
-
return e ? t(l({}, null != n ? n : {}, 'function' == typeof e ? null == e ? void 0 : e(n) : e), {
|
|
137
|
-
isChanged: !!n
|
|
138
|
-
}) : e;
|
|
139
|
-
});
|
|
140
|
-
}, nk = (0, c.useMemo)(function() {
|
|
141
|
-
return !!nO && (!!nj.filter(function(e) {
|
|
142
|
-
return e.value !== nO.value;
|
|
143
|
-
}).some(function(e) {
|
|
144
|
-
return e.label === nO.label;
|
|
145
|
-
}) || null);
|
|
146
|
-
}, [
|
|
147
|
-
nj,
|
|
148
|
-
nO
|
|
149
|
-
]), nD = o((0, c.useState)({}), 2), nI = nD[0], nP = nD[1], nM = (0, c.useMemo)(function() {
|
|
150
|
-
var e = Math.floor(Math.random() * (N.length - 1 - 0 + 1)) + 0;
|
|
151
|
-
return N[e];
|
|
152
|
-
}, [
|
|
153
|
-
nj.length
|
|
154
|
-
]), nR = null == nj ? void 0 : nj.reduce(function(e, n) {
|
|
155
|
-
var l, t = function(e, n) {
|
|
156
|
-
var l = null == e ? void 0 : e.findIndex(function(e) {
|
|
157
|
-
return e.value === (null == n ? void 0 : n.value);
|
|
158
|
-
});
|
|
159
|
-
-1 !== l ? e[l] = n : e.push(n);
|
|
160
|
-
};
|
|
161
|
-
return n.groupName ? null == (l = n.list) || l.map(function(n) {
|
|
162
|
-
return t(e, n);
|
|
163
|
-
}) : t(e, n), e;
|
|
164
|
-
}, eC ? null == (w = Object.keys(nI)) ? void 0 : w.map(function(e) {
|
|
165
|
-
var n;
|
|
166
|
-
return {
|
|
167
|
-
value: e,
|
|
168
|
-
label: null != (n = null == nI ? void 0 : nI[e]) ? n : ''
|
|
169
|
-
};
|
|
170
|
-
}) : []), nA = function(e) {
|
|
171
|
-
(eJ ? ec : en) && e1(!1), eC && nP(function(o) {
|
|
172
|
-
return t(l({}, o), n({}, e, void 0));
|
|
173
|
-
}), null == k || k(L.filter(function(n) {
|
|
174
|
-
return n !== e;
|
|
175
|
-
}), 'chosenOptions');
|
|
176
|
-
}, nF = function() {
|
|
177
|
-
var e, n;
|
|
178
|
-
return null != (n = null != (e = document.querySelector('div#root')) ? e : document.querySelector('div#app')) ? n : document.querySelector('div#storybook-root');
|
|
179
|
-
}, nT = function() {
|
|
180
|
-
var e, n = document.createElement('div');
|
|
181
|
-
if (n.setAttribute('id', eQ), n.classList.add('tags-dropdown__container'), P && n.classList.add(P), eJ && n.addEventListener('click', function(e) {
|
|
182
|
-
e.target && e.target.id === eQ && e1(!1);
|
|
183
|
-
}), eJ) {
|
|
184
|
-
try {
|
|
185
|
-
null == (t = document.getElementById("mlw-".concat(eQ))) || t.remove();
|
|
186
|
-
} catch (e) {}
|
|
187
|
-
var l, t, o = document.createElement('div');
|
|
188
|
-
o.classList.add('tags-dropdown-mobile'), o.setAttribute('id', "mlw-".concat(eQ)), null == o || o.append(n), null == (l = nF()) || l.append(o);
|
|
189
|
-
} else null == (e = nF()) || e.append(n);
|
|
190
|
-
}, nB = function() {
|
|
191
|
-
return document.getElementById(eQ);
|
|
192
|
-
}, nH = function() {
|
|
193
|
-
var e = nB();
|
|
194
|
-
if (!e || !e0) return !1;
|
|
195
|
-
var n = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight, l = null != (x = null == eV || null == (h = eV.current) ? void 0 : h.getBoundingClientRect()) ? x : {}, t = l.width, o = l.height, r = void 0 === o ? 0 : o, i = l.left, u = l.top, a = void 0 === u ? 0 : u, c = null == e$ ? void 0 : e$.current, s = e.getElementsByClassName('tags-dropdown__list')[0], d = null == c ? void 0 : c.getElementsByClassName('tags-dropdown__header')[0], v = null == c ? void 0 : c.getElementsByClassName('tags-dropdown__footer')[0], f = Number.parseInt(null != (N = null == (b = getComputedStyle(c)) || null == (g = b.marginTop) ? void 0 : g.replace('px', '')) ? N : 0, 10), m = null != (j = null == c || null == (_ = c.getBoundingClientRect()) ? void 0 : _.height) ? j : 0, p = 500 - (null != (C = null == d || null == (w = d.getBoundingClientRect()) ? void 0 : w.height) ? C : 0) - (null != (E = null == v || null == (y = v.getBoundingClientRect()) ? void 0 : y.height) ? E : 0);
|
|
196
|
-
if (eJ && eS) s.style.maxHeight = "".concat(p, "px");
|
|
197
|
-
else {
|
|
198
|
-
var h, g, b, _, w, y, x, N, j, C, E, O, S, L, k, D, I = null == (O = getComputedStyle(s)) ? void 0 : O.maxHeight, P = null != e7 ? e7 : Number.parseInt(null != (k = null == I ? void 0 : I.replace('px', '')) ? k : 0, 10);
|
|
199
|
-
null !== e7 || Number.isNaN(P) || ne(P), void 0 !== m && m > P && !Number.isNaN(P) && (m = P - 2 * f);
|
|
200
|
-
var M = ez ? a - f - (null != (D = null == eq || null == (L = eq.current) || null == (S = L.getBoundingClientRect()) ? void 0 : S.height) ? D : 0) : a - f, R = n - a - r - 2 * f, A = e5;
|
|
201
|
-
!e5 && nj.length && e9(A = M < R || R >= m ? 'bottom' : 'top'), m > ('top' === A ? M : R) && ((m = ('top' === A ? M : R) - 3 * f) < 200 && (m = 200), c && (c.style.maxHeight = "".concat(m, "px"))), e.style.minWidth = "".concat(t, "px"), e.style.left = "".concat(i, "px"), e.style.top = "".concat('bottom' === A ? a + r : a - m - 2 * f, "px");
|
|
202
|
-
}
|
|
203
|
-
}, nq = function() {
|
|
204
|
-
var e, n = {
|
|
205
|
-
label: np,
|
|
206
|
-
style: {
|
|
207
|
-
backgroundColor: nM
|
|
208
|
-
},
|
|
209
|
-
isEditable: !0,
|
|
210
|
-
ref: (0, c.createRef)()
|
|
211
|
-
};
|
|
212
|
-
(null != (e = null == eR ? void 0 : eR(n)) ? e : new Promise(function(e) {
|
|
213
|
-
return e(1);
|
|
214
|
-
})).then(function(e) {
|
|
215
|
-
var l, t = Math.random().toString(16).slice(2);
|
|
216
|
-
n.value = null != (l = null == e ? void 0 : e.id) ? l : t, nC(function(e) {
|
|
217
|
-
return r(e).concat([
|
|
218
|
-
n
|
|
219
|
-
]);
|
|
220
|
-
}), nh(''), nQ(n);
|
|
221
|
-
});
|
|
222
|
-
}, nz = function(e, n) {
|
|
223
|
-
null == e || e.preventDefault(), null == e || e.stopPropagation(), nL((null == nO ? void 0 : nO.value) === (null == n ? void 0 : n.value) ? null : n);
|
|
224
|
-
}, nW = function() {
|
|
225
|
-
var e;
|
|
226
|
-
(null != (e = null == eF ? void 0 : eF(nO)) ? e : new Promise(function(e) {
|
|
227
|
-
return e(1);
|
|
228
|
-
})).then(function() {
|
|
229
|
-
(null == nO ? void 0 : nO.value) && nA(null == nO ? void 0 : nO.value), nC(function(e) {
|
|
230
|
-
return e.filter(function(e) {
|
|
231
|
-
return e.value !== (null == nO ? void 0 : nO.value);
|
|
232
|
-
});
|
|
233
|
-
}), nL(null);
|
|
234
|
-
});
|
|
235
|
-
}, nU = function() {
|
|
236
|
-
if (!(null == nO ? void 0 : nO.isChanged) || nk) return nL(null), !1;
|
|
237
|
-
null == eA || eA(nO), nC(function(e) {
|
|
238
|
-
return e.map(function(e) {
|
|
239
|
-
if (nO && e.value === (null == nO ? void 0 : nO.value)) {
|
|
240
|
-
var n = l({}, nO);
|
|
241
|
-
return nL(null), n;
|
|
242
|
-
}
|
|
243
|
-
return e;
|
|
244
|
-
});
|
|
245
|
-
});
|
|
246
|
-
}, nK = function() {
|
|
247
|
-
if (!nO || !(null == eY ? void 0 : eY.current)) return null;
|
|
248
|
-
var e, n, l, t, o, r, i, u = window.scrollX, a = window.scrollY, c = {
|
|
249
|
-
left: 'modal-left',
|
|
250
|
-
right: 'modal-right',
|
|
251
|
-
top: 'modal-top',
|
|
252
|
-
bottom: 'modal-bottom'
|
|
253
|
-
}, s = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth, d = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight, v = null == nO || null == (e = nO.ref) ? void 0 : e.current, f = null != (l = null == v ? void 0 : v.getBoundingClientRect()) ? l : {}, m = f.x, p = f.y, h = void 0 === p ? 0 : p, g = f.width, b = f.height, _ = void 0 === b ? 0 : b, w = null == e$ || null == (n = e$.current) ? void 0 : n.getBoundingClientRect(), y = s - (null != (t = null == w ? void 0 : w.x) ? t : 0) - (null != (o = null == w ? void 0 : w.width) ? o : 0), x = d - h - a - _;
|
|
254
|
-
Object.values(c).map(function(e) {
|
|
255
|
-
return eY.current && eY.current.classList.remove(e), e;
|
|
256
|
-
}), eY.current.classList.add(null != (r = null == c ? void 0 : c[y < 200 ? 'left' : 'right']) ? r : ''), eY.current.classList.add(null != (i = null == c ? void 0 : c[x < 200 ? 'top' : 'bottom']) ? i : ''), eY.current.style.left = "".concat((void 0 === m ? 0 : m) + u + (void 0 === g ? 0 : g), "px"), eY.current.style.top = "".concat(h + a + _, "px"), eY.current.style.transform = "translate(".concat(y < 200 ? 'calc(-100% + 7px)' : '-35px', ", ").concat(x < 200 ? "calc(-100% - ".concat(_ + 10, "px)") : '10px', ")");
|
|
257
|
-
}, nV = function(e) {
|
|
258
|
-
var n, l, t, o, r, i, u = e.target;
|
|
259
|
-
!e0 || (null == (n = nB()) ? void 0 : n.contains(u)) || eY.current ? eY.current && !(null == (l = eY.current) ? void 0 : l.contains(u)) && ((null == (i = document) || null == (r = i.getElementById) || null == (o = r.call(i, "editTrigger".concat(null == nO ? void 0 : nO.value))) || null == (t = o.contains) ? void 0 : t.call(o, u)) || nU()) : (e1(!1), null == eH || eH(e));
|
|
260
|
-
}, nX = function(e) {
|
|
261
|
-
var n;
|
|
262
|
-
nV(e), e.target.isEqualNode(null == eU ? void 0 : eU.current) || null == eU || null == (n = eU.current) || n.blur();
|
|
263
|
-
}, nY = function(e) {
|
|
264
|
-
var n, l, t, o, r, i;
|
|
265
|
-
return ((null == e ? void 0 : e.tagName) !== 'svg' || (null == e || null == (n = e.parentNode) ? void 0 : n.className) !== 'tag__button') && (null == e ? void 0 : e.tagName) !== 'line' && ((null == e ? void 0 : e.tagName) === 'svg' && (null == e || null == (l = e.parentNode) ? void 0 : l.className) !== 'tag__button' || (null == e || null == (o = e.className) || null == (t = o.indexOf) ? void 0 : t.call(o, 'tag__label')) !== -1 || (null == e || null == (i = e.className) || null == (r = i.indexOf) ? void 0 : r.call(i, 'tag-list_wrapper')) !== -1 || (null == e ? void 0 : e.className.indexOf("".concat(x, "__trigger"))) !== -1 || (null == e ? void 0 : e.className) === 'tags-dropdown__arrow');
|
|
266
|
-
}, n$ = function(e) {
|
|
267
|
-
if (e.isHiddenInList) return !1;
|
|
268
|
-
var n = e.title || e.label;
|
|
269
|
-
return !np.length || !!(null == n ? void 0 : n.toLowerCase().includes((null == np ? void 0 : np.toLowerCase()) || ''));
|
|
270
|
-
}, nG = function(e) {
|
|
271
|
-
return null == e ? void 0 : e.map(function(e) {
|
|
272
|
-
var n;
|
|
273
|
-
return (null == e ? void 0 : e.groupName) ? null != (n = null == e ? void 0 : e.list) ? n : [] : e;
|
|
274
|
-
}).flat();
|
|
275
|
-
}, nJ = (0, c.useCallback)(function() {
|
|
276
|
-
return null == nj ? void 0 : nj.reduce(function(e, n) {
|
|
277
|
-
if (null == n ? void 0 : n.list) {
|
|
278
|
-
var l;
|
|
279
|
-
e += (null == n || null == (l = n.list) ? void 0 : l.length) || 0;
|
|
280
|
-
} else ++e;
|
|
281
|
-
return e;
|
|
282
|
-
}, 0);
|
|
283
|
-
}, [
|
|
284
|
-
nj
|
|
285
|
-
]), nQ = function(e) {
|
|
286
|
-
var o, i;
|
|
287
|
-
return (null == e || !e.isFreezed) && (((null == e ? void 0 : e.closeOnOptionSelect) !== void 0 ? e.closeOnOptionSelect && e1(!1) : (eJ ? eu : Z) && e1(!1), ny(''), e.value && L.includes(null == (o = e.value) ? void 0 : o.toString())) ? nA(e.value) : (e.value && eC && nP(function(o) {
|
|
288
|
-
var r;
|
|
289
|
-
return e.value ? t(l({}, o), n({}, null == (r = e.value) ? void 0 : r.toString(), null == e ? void 0 : e.label)) : o;
|
|
290
|
-
}), e.value && (null == k || k(r(L).concat([
|
|
291
|
-
null == (i = e.value) ? void 0 : i.toString()
|
|
292
|
-
]), 'chosenOptions'))), null);
|
|
293
|
-
}, nZ = function(e) {
|
|
294
|
-
var n = e;
|
|
295
|
-
q || (n = (0, v.formatToOnlyASCIICodeText)(n)), ny(n);
|
|
296
|
-
}, n0 = function(e) {
|
|
297
|
-
e.target === (null == eK ? void 0 : eK.current) && (e.stopPropagation(), e.preventDefault(), e1(!1));
|
|
298
|
-
}, n1 = function() {
|
|
299
|
-
var e, n = null == (e = nG(nj)) ? void 0 : e.filter(function(e) {
|
|
300
|
-
var n = e.isFreezed, l = e.value;
|
|
301
|
-
return l && !n && !(null == L ? void 0 : L.includes(null == l ? void 0 : l.toString())) && 'open_modal' !== l;
|
|
302
|
-
});
|
|
303
|
-
eC && nP(function(e) {
|
|
304
|
-
return null == n ? void 0 : n.reduce(function(e, n) {
|
|
305
|
-
var l = n.value, t = n.label;
|
|
306
|
-
return l && (e[l] = t), e;
|
|
307
|
-
}, e);
|
|
308
|
-
}), null == k || k(r(L).concat(r((null == n ? void 0 : n.map(function(e) {
|
|
309
|
-
var n = e.value;
|
|
310
|
-
return n ? null == n ? void 0 : n.toString() : '';
|
|
311
|
-
})) || [])), 'chosenOptions'), (eJ ? ef : er) && e1(!1);
|
|
312
|
-
}, n2 = function() {
|
|
313
|
-
eC && nP({}), null == k || k(null == L ? void 0 : L.filter(function(e) {
|
|
314
|
-
var n, l;
|
|
315
|
-
return null == (l = nG(nj)) || null == (n = l.find(function(n) {
|
|
316
|
-
return n.value === e;
|
|
317
|
-
})) ? void 0 : n.isFreezed;
|
|
318
|
-
}), 'chosenOptions'), (eJ ? ed : et) && e1(!1);
|
|
319
|
-
}, n3 = (0, c.useCallback)(function(e) {
|
|
320
|
-
ex && 'function' == typeof ex && +Math.round(e.target.clientHeight + e.target.scrollTop) == +e.target.scrollHeight && ex(nf.current, !0);
|
|
321
|
-
}, [
|
|
322
|
-
nj
|
|
323
|
-
]), n6 = function(e) {
|
|
324
|
-
var l, t = e.description, o = e.title || e.label, r = function(e) {
|
|
325
|
-
var n, l = null == e || null == (n = e.toLowerCase()) ? void 0 : n.indexOf(null == np ? void 0 : np.toLowerCase());
|
|
326
|
-
return -1 === l ? e : (0, u.jsxs)("pre", {
|
|
327
|
-
className: "inherit-styles",
|
|
328
|
-
children: [
|
|
329
|
-
(0, u.jsx)("span", {
|
|
330
|
-
children: e.substring(0, l)
|
|
331
|
-
}),
|
|
332
|
-
(0, u.jsx)("span", {
|
|
333
|
-
className: "search-match bg--yellow",
|
|
334
|
-
children: e.substring(l, l + (null == np ? void 0 : np.length))
|
|
335
|
-
}),
|
|
336
|
-
(0, u.jsx)("span", {
|
|
337
|
-
children: e.substring(l + (null == np ? void 0 : np.length))
|
|
338
|
-
})
|
|
339
|
-
]
|
|
340
|
-
});
|
|
341
|
-
};
|
|
342
|
-
return (0, u.jsxs)("button", {
|
|
343
|
-
type: "button",
|
|
344
|
-
ref: null == e ? void 0 : e.ref,
|
|
345
|
-
onClick: function(n) {
|
|
346
|
-
n.preventDefault(), n.stopPropagation(), nQ(e);
|
|
347
|
-
},
|
|
348
|
-
className: (0, a.default)("".concat(x, "__list-item"), n({}, "".concat(x, "__list-item_active"), null == L ? void 0 : L.some(function(n) {
|
|
349
|
-
return n === e.value;
|
|
350
|
-
})), n({}, "".concat(x, "__list-item_disabled"), e.disabled), n({}, "".concat(x, "__list-item_freezed"), null == e ? void 0 : e.isFreezed), n({}, "".concat(x, "__list-item--editing"), (null == e ? void 0 : e.value) === (null == nO ? void 0 : nO.value)), e.className),
|
|
351
|
-
children: [
|
|
352
|
-
!eJ && (0, u.jsx)("span", {
|
|
353
|
-
className: (0, a.default)("".concat(x, "__active-icon"), n({}, "".concat(x, "__active-icon_active"), null == L ? void 0 : L.some(function(n) {
|
|
354
|
-
return n === e.value;
|
|
355
|
-
}))),
|
|
356
|
-
children: (0, u.jsx)(d.Check, {
|
|
357
|
-
width: 16,
|
|
358
|
-
height: 16,
|
|
359
|
-
className: "color--text"
|
|
360
|
-
})
|
|
361
|
-
}),
|
|
362
|
-
(0, u.jsxs)("div", {
|
|
363
|
-
className: (0, a.default)("".concat(x, "__list-item-body")),
|
|
364
|
-
children: [
|
|
365
|
-
eI ? (0, u.jsx)(h.default, {
|
|
366
|
-
className: (0, a.default)("".concat(x, "__list-item-title"), null == e ? void 0 : e.labelClassName, {
|
|
367
|
-
'tag_with-btn': !(null == e ? void 0 : e.isFreezed)
|
|
368
|
-
}),
|
|
369
|
-
label: o ? r(o) : '',
|
|
370
|
-
style: null == e ? void 0 : e.style,
|
|
371
|
-
isNoDismiss: !0
|
|
372
|
-
}, null == e ? void 0 : e.value) : (0, u.jsx)("span", {
|
|
373
|
-
className: (0, a.default)("".concat(x, "__list-item-title"), e.labelClassName),
|
|
374
|
-
children: o ? r(o) : ''
|
|
375
|
-
}),
|
|
376
|
-
t && (0, u.jsx)("span", {
|
|
377
|
-
className: (0, a.default)("".concat(x, "__list-item-description")),
|
|
378
|
-
children: t
|
|
379
|
-
})
|
|
380
|
-
]
|
|
381
|
-
}),
|
|
382
|
-
!eJ && (null == e ? void 0 : e.isEditable) && eA && eF && (0, u.jsx)("div", {
|
|
383
|
-
id: "editTrigger".concat(null == e ? void 0 : e.value),
|
|
384
|
-
className: (0, a.default)("".concat(x, "__list-item-edit-trigger")),
|
|
385
|
-
onClick: function(n) {
|
|
386
|
-
return nz(n, e);
|
|
387
|
-
},
|
|
388
|
-
children: (0, u.jsx)(d.MoreHorizontal, {})
|
|
389
|
-
}),
|
|
390
|
-
eJ ? null != (l = null == e ? void 0 : e.customMobileIcon) ? l : (0, u.jsx)(b.default, {
|
|
391
|
-
value: null == L ? void 0 : L.some(function(n) {
|
|
392
|
-
return n === e.value;
|
|
393
|
-
}),
|
|
394
|
-
onChange: function() {
|
|
395
|
-
nQ(e);
|
|
396
|
-
},
|
|
397
|
-
label: "",
|
|
398
|
-
id: ""
|
|
399
|
-
}) : ''
|
|
400
|
-
]
|
|
401
|
-
}, "".concat(x, "__list-item-").concat(e.id || e.value));
|
|
402
|
-
}, n8 = function() {
|
|
403
|
-
return (0, u.jsx)(_.default, l({
|
|
404
|
-
ref: eU,
|
|
405
|
-
className: (0, a.default)("".concat(x, "__input"), n({}, "".concat(x, "__input--in-list"), eD)),
|
|
406
|
-
value: np,
|
|
407
|
-
onChange: nZ,
|
|
408
|
-
placeholder: R || 'Select from list',
|
|
409
|
-
attributesOfNativeInput: t(l({}, eN), {
|
|
410
|
-
onKeyDown: function(e) {
|
|
411
|
-
13 === e.keyCode && eL && eR && nR.every(function(e) {
|
|
412
|
-
var n = e.label;
|
|
413
|
-
return (null == n ? void 0 : n.toLowerCase()) !== (null == np ? void 0 : np.toLowerCase());
|
|
414
|
-
}) && nq(), null == M || M(e, np);
|
|
415
|
-
}
|
|
416
|
-
})
|
|
417
|
-
}, eL ? {
|
|
418
|
-
symbolsLimit: 50
|
|
419
|
-
} : {}));
|
|
420
|
-
}, n5 = (0, c.useCallback)(function() {
|
|
421
|
-
var e;
|
|
422
|
-
return null != (e = null == ez ? void 0 : ez({
|
|
423
|
-
chosenOptions: L,
|
|
424
|
-
singleLevelOptions: nR,
|
|
425
|
-
deleteChosen: nA,
|
|
426
|
-
inputRef: eU,
|
|
427
|
-
onSearchHandler: nZ,
|
|
428
|
-
isOpen: e0,
|
|
429
|
-
setIsOpen: e1
|
|
430
|
-
})) ? e : (0, u.jsxs)("div", {
|
|
431
|
-
className: (0, a.default)("".concat(x, "__trigger"), n({
|
|
432
|
-
'tags-dropdown__error': B
|
|
433
|
-
}, "".concat(x, "__trigger--with-actions"), ek)),
|
|
434
|
-
onClick: function(e) {
|
|
435
|
-
var n = e.target;
|
|
436
|
-
(null == n ? void 0 : n.tagName) === 'INPUT' ? e1(!0) : nY(n) && e1(function(e) {
|
|
437
|
-
return !e;
|
|
438
|
-
});
|
|
439
|
-
},
|
|
440
|
-
children: [
|
|
441
|
-
W ? (0, u.jsx)(g.default, {
|
|
442
|
-
items: null == L ? void 0 : L.map(function(e, n) {
|
|
443
|
-
var l = null == nR ? void 0 : nR.find(function(n) {
|
|
444
|
-
var l;
|
|
445
|
-
return (null == (l = n.value) ? void 0 : l.toString()) === (null == e ? void 0 : e.toString());
|
|
446
|
-
});
|
|
447
|
-
return {
|
|
448
|
-
value: e,
|
|
449
|
-
label: T ? null == l ? void 0 : l.value : (null == l ? void 0 : l.label) || (null == l ? void 0 : l.name) || (null == l ? void 0 : l.title),
|
|
450
|
-
id: n,
|
|
451
|
-
className: null == l ? void 0 : l.labelClassName,
|
|
452
|
-
style: null == l ? void 0 : l.style
|
|
453
|
-
};
|
|
454
|
-
}),
|
|
455
|
-
disableShowMore: !0
|
|
456
|
-
}) : null == L ? void 0 : L.map(function(e) {
|
|
457
|
-
var n = null == nR ? void 0 : nR.find(function(n) {
|
|
458
|
-
var l;
|
|
459
|
-
return (null == (l = n.value) ? void 0 : l.toString()) === (null == e ? void 0 : e.toString());
|
|
460
|
-
}), l = T ? null == n ? void 0 : n.value : (null == n ? void 0 : n.label) || (null == n ? void 0 : n.name) || (null == n ? void 0 : n.title);
|
|
461
|
-
return (0, u.jsx)(h.default, {
|
|
462
|
-
className: (0, a.default)(I, null == n ? void 0 : n.labelClassName, {
|
|
463
|
-
'tag_with-btn': !(null == n ? void 0 : n.isFreezed)
|
|
464
|
-
}),
|
|
465
|
-
label: l,
|
|
466
|
-
style: null == n ? void 0 : n.style,
|
|
467
|
-
removeItem: (null == n ? void 0 : n.isFreezed) ? void 0 : function() {
|
|
468
|
-
return nA(e);
|
|
469
|
-
},
|
|
470
|
-
isNoDismiss: !1
|
|
471
|
-
}, e);
|
|
472
|
-
}),
|
|
473
|
-
0 !== L.length && W ? '' : n8(),
|
|
474
|
-
(0, u.jsx)("span", {
|
|
475
|
-
className: (0, a.default)("".concat(x, "__arrow"), n({}, "".concat(x, "__arrow_active"), e0)),
|
|
476
|
-
children: eJ ? (0, u.jsx)(d.Code, {
|
|
477
|
-
className: "mobile-icon"
|
|
478
|
-
}) : e0 ? (0, u.jsx)(d.ChevronUp, {
|
|
479
|
-
className: "color--text"
|
|
480
|
-
}) : (0, u.jsx)(d.ChevronDown, {
|
|
481
|
-
className: "color--text"
|
|
482
|
-
})
|
|
483
|
-
})
|
|
484
|
-
]
|
|
485
|
-
});
|
|
486
|
-
}, [
|
|
487
|
-
L,
|
|
488
|
-
nR,
|
|
489
|
-
eU,
|
|
490
|
-
e0
|
|
491
|
-
]);
|
|
492
|
-
return (0, c.useLayoutEffect)(function() {
|
|
493
|
-
return nT(), eO && !eG && e1(!0), function() {
|
|
494
|
-
var e, n;
|
|
495
|
-
null == (e = nB()) || e.remove(), null == (n = document.getElementById("mlw-".concat(eQ))) || n.remove();
|
|
496
|
-
};
|
|
497
|
-
}, []), (0, c.useLayoutEffect)(function() {
|
|
498
|
-
var e;
|
|
499
|
-
return eJ ? (window.removeEventListener('mousewheel', nX), window.removeEventListener('wheel', nX), window.removeEventListener('touchmove', nX), window.removeEventListener('mouseup', nV)) : (window.addEventListener('mousewheel', nX), window.addEventListener('wheel', nX), window.addEventListener('touchmove', nX), window.addEventListener('mouseup', nV)), null == (e = nB()) || e.addEventListener('click', nX), function() {
|
|
500
|
-
var e;
|
|
501
|
-
window.removeEventListener('mousewheel', nX), window.removeEventListener('mouseup', nV), window.removeEventListener('wheel', nX), window.removeEventListener('touchmove', nX), null == (e = nB()) || e.removeEventListener('click', nX);
|
|
502
|
-
};
|
|
503
|
-
}, [
|
|
504
|
-
nB,
|
|
505
|
-
eJ
|
|
506
|
-
]), (0, c.useLayoutEffect)(function() {
|
|
507
|
-
e0 && (nH(), nK());
|
|
508
|
-
}, [
|
|
509
|
-
e0,
|
|
510
|
-
S,
|
|
511
|
-
L,
|
|
512
|
-
np,
|
|
513
|
-
eJ,
|
|
514
|
-
null == e$ || null == (j = e$.current) || null == (y = j.getBoundingClientRect()) ? void 0 : y.height,
|
|
515
|
-
eW
|
|
516
|
-
]), (0, c.useEffect)(function() {
|
|
517
|
-
eC && L.length !== Object.keys(nI).length && nj.map(function(e) {
|
|
518
|
-
var o;
|
|
519
|
-
return (null == e ? void 0 : e.value) && !(null == nI ? void 0 : nI[null == e || null == (o = e.value) ? void 0 : o.toString()]) && nP(function(o) {
|
|
520
|
-
var r;
|
|
521
|
-
return e.value ? t(l({}, o), n({}, null == e || null == (r = e.value) ? void 0 : r.toString(), null == e ? void 0 : e.label)) : o;
|
|
522
|
-
}), e;
|
|
523
|
-
});
|
|
524
|
-
}, [
|
|
525
|
-
L,
|
|
526
|
-
eC
|
|
527
|
-
]), (0, c.useEffect)(function() {
|
|
528
|
-
var e, n, l, t, o, r, i, u, a = function() {
|
|
529
|
-
e6(window.scrollY);
|
|
530
|
-
}, c = e0 ? 'addEventListener' : 'removeEventListener';
|
|
531
|
-
null == $ || null == (e = $.current) || e[c]('click', n1, !0), null == J || null == (n = J.current) || n[c]('click', n2, !0), e0 ? (eJ && eS || window.removeEventListener('scroll', a), (null == eq ? void 0 : eq.current) && (eq.current.style.pointerEvents = 'none'), null == (l = nB()) || l.classList.add('tags-dropdown__container--opened'), eJ ? null == eU || null == (i = eU.current) || null == (r = i.blur) || r.call(i) : null == eU || null == (o = eU.current) || null == (t = o.focus) || t.call(o)) : (eJ && eS || window.addEventListener('scroll', a), (null == eq ? void 0 : eq.current) && (eq.current.style.pointerEvents = 'auto'), null == (u = nB()) || u.classList.remove('tags-dropdown__container--opened'), eD && ny(''), e9(null), nh(''));
|
|
532
|
-
}, [
|
|
533
|
-
e0
|
|
534
|
-
]), (0, c.useEffect)(function() {
|
|
535
|
-
var e, n, l, t, o, r = function(e) {
|
|
536
|
-
var n;
|
|
537
|
-
nc(Number.parseInt(null == (n = e.target.scrollTop) ? void 0 : n.toString(), 10));
|
|
538
|
-
}, i = function(e) {
|
|
539
|
-
e.preventDefault(), window.scrollTo({
|
|
540
|
-
top: e3
|
|
541
|
-
});
|
|
542
|
-
};
|
|
543
|
-
return e0 && eJ && (null == eX ? void 0 : eX.current) && (null == eX || null == (e = eX.current) || e.addEventListener('scroll', r), nt((null == eX || null == (n = eX.current) ? void 0 : n.scrollHeight) > (null == eX || null == (l = eX.current) ? void 0 : l.clientHeight)), null === nl && ni((null == eX || null == (t = eX.current) ? void 0 : t.scrollHeight) > (null == eX || null == (o = eX.current) ? void 0 : o.clientHeight))), e0 && eX && eX.current && (eX.current.addEventListener('scroll', n3), eJ && eS || window.addEventListener('scroll', i)), function() {
|
|
544
|
-
var e, n;
|
|
545
|
-
eJ && eS || window.removeEventListener('scroll', i), null == eX || null == (e = eX.current) || e.removeEventListener('scroll', n3), null == eX || null == (n = eX.current) || n.removeEventListener('scroll', r);
|
|
546
|
-
};
|
|
547
|
-
}, [
|
|
548
|
-
e0,
|
|
549
|
-
eJ,
|
|
550
|
-
null == eX ? void 0 : eX.current,
|
|
551
|
-
null == eX || null == (C = eX.current) ? void 0 : C.scrollHeight,
|
|
552
|
-
null == eX || null == (E = eX.current) ? void 0 : E.clientHeight
|
|
553
|
-
]), (0, c.useEffect)(function() {
|
|
554
|
-
if (null == eX ? void 0 : eX.current) {
|
|
555
|
-
var e, n, l;
|
|
556
|
-
nv(Number.parseInt((e = (null == eX || null == (n = eX.current) ? void 0 : n.scrollHeight) - (null == eX || null == (l = eX.current) ? void 0 : l.clientHeight), e.toString()), 10));
|
|
557
|
-
}
|
|
558
|
-
}, [
|
|
559
|
-
na,
|
|
560
|
-
null == eX ? void 0 : eX.current
|
|
561
|
-
]), (0, c.useEffect)(function() {
|
|
562
|
-
ew && ey && (ng || n_ || e0) && (null == ex || ex(ng));
|
|
563
|
-
}, [
|
|
564
|
-
e0,
|
|
565
|
-
ng,
|
|
566
|
-
n_
|
|
567
|
-
]), (0, c.useEffect)(function() {
|
|
568
|
-
nC(S.map(function(e) {
|
|
569
|
-
return t(l({}, e), {
|
|
570
|
-
ref: (0, c.createRef)()
|
|
571
|
-
});
|
|
572
|
-
}));
|
|
573
|
-
}, [
|
|
574
|
-
S
|
|
575
|
-
]), (0, c.useEffect)(function() {
|
|
576
|
-
if (nO) {
|
|
577
|
-
var e, n;
|
|
578
|
-
nK(), null == nx || null == (n = nx.current) || null == (e = n.focus) || e.call(n);
|
|
579
|
-
}
|
|
580
|
-
}, [
|
|
581
|
-
null == nO ? void 0 : nO.value
|
|
582
|
-
]), (0, u.jsxs)("div", {
|
|
583
|
-
className: (0, a.default)(x, D, (n(O = {}, "".concat(x, "_disabled"), F), n(O, "".concat(x, "-mobile"), eJ), n(O, "".concat(x, "--focused"), e0 && !(null == eq ? void 0 : eq.current) && !eJ), n(O, "".concat(x, "--custom-trigger"), !!(null == eq ? void 0 : eq.current)), O)),
|
|
584
|
-
ref: eV,
|
|
585
|
-
children: [
|
|
586
|
-
n5(),
|
|
587
|
-
ek && (0, u.jsxs)("div", {
|
|
588
|
-
className: (0, a.default)("".concat(x, "__actions")),
|
|
589
|
-
children: [
|
|
590
|
-
(0, u.jsx)("div", {
|
|
591
|
-
className: (0, a.default)("".concat(x, "__actions-item")),
|
|
592
|
-
onClick: eT,
|
|
593
|
-
children: (0, u.jsx)(d.Check, {})
|
|
594
|
-
}),
|
|
595
|
-
(0, u.jsx)("div", {
|
|
596
|
-
className: (0, a.default)("".concat(x, "__actions-item")),
|
|
597
|
-
onClick: eB,
|
|
598
|
-
children: (0, u.jsx)(d.X, {})
|
|
599
|
-
})
|
|
600
|
-
]
|
|
601
|
-
}),
|
|
602
|
-
e0 && ((i = nB()) ? (0, s.createPortal)(function() {
|
|
603
|
-
var e, o, r, i = null == nj ? void 0 : nj.reduce(function(e, n) {
|
|
604
|
-
if (n.groupName) {
|
|
605
|
-
var o, r = null == n || null == (o = n.list) ? void 0 : o.filter(function(e) {
|
|
606
|
-
return n$(e);
|
|
607
|
-
});
|
|
608
|
-
(null == r ? void 0 : r.length) && e.push(t(l({}, n), {
|
|
609
|
-
list: r
|
|
610
|
-
}));
|
|
611
|
-
} else n$(n) && e.push(n);
|
|
612
|
-
return e;
|
|
613
|
-
}, []), c = [], v = !0, f = !1, m = void 0;
|
|
614
|
-
try {
|
|
615
|
-
for(var g, b, w, y = i[Symbol.iterator](); !(v = (w = y.next()).done); v = !0){
|
|
616
|
-
var j, C, E, O, S = w.value;
|
|
617
|
-
S.groupName ? c.push((0, u.jsxs)("div", {
|
|
618
|
-
className: (0, a.default)("".concat(x, "-group"), S.className),
|
|
619
|
-
children: [
|
|
620
|
-
(0, u.jsx)("span", {
|
|
621
|
-
className: "".concat(x, "-group__name"),
|
|
622
|
-
children: S.groupName
|
|
623
|
-
}),
|
|
624
|
-
null == (j = S.list) ? void 0 : j.map(function(e) {
|
|
625
|
-
return n6(e);
|
|
626
|
-
})
|
|
627
|
-
]
|
|
628
|
-
}, null == (O = S.groupName) || null == (E = O.toString()) ? void 0 : E.replace(/ /g, '_').concat(null == (C = Date.now()) ? void 0 : C.toString()))) : c.push(n6(S));
|
|
629
|
-
}
|
|
630
|
-
} catch (e) {
|
|
631
|
-
f = !0, m = e;
|
|
632
|
-
} finally{
|
|
633
|
-
try {
|
|
634
|
-
v || null == y.return || y.return();
|
|
635
|
-
} finally{
|
|
636
|
-
if (f) throw m;
|
|
637
|
-
}
|
|
638
|
-
}
|
|
639
|
-
return (0, u.jsx)("div", {
|
|
640
|
-
className: (0, a.default)("".concat(x, "__container-wrapper")),
|
|
641
|
-
ref: eK,
|
|
642
|
-
onClick: eJ ? n0 : function() {},
|
|
643
|
-
children: (0, u.jsxs)("div", {
|
|
644
|
-
ref: e$,
|
|
645
|
-
className: (0, a.default)("".concat(x, "__selector-wrapper"), n({}, "".concat(x, "__selector-wrapper--fixed-height"), nr && eJ)),
|
|
646
|
-
children: [
|
|
647
|
-
K || eJ ? (0, u.jsxs)("div", {
|
|
648
|
-
className: (0, a.default)("".concat(x, "__header"), (n(o = {}, "".concat(x, "__header-with-shadow"), nl && eJ), n(o, "".concat(x, "__header-with-shadow-hidden"), 0 === na), o)),
|
|
649
|
-
children: [
|
|
650
|
-
eJ && (0, u.jsxs)(u.Fragment, {
|
|
651
|
-
children: [
|
|
652
|
-
(0, u.jsxs)("div", {
|
|
653
|
-
className: (0, a.default)("".concat(x, "__header-row")),
|
|
654
|
-
children: [
|
|
655
|
-
(0, u.jsx)("div", {
|
|
656
|
-
className: (0, a.default)("".concat(x, "__label")),
|
|
657
|
-
children: A
|
|
658
|
-
}),
|
|
659
|
-
(0, u.jsx)("div", {
|
|
660
|
-
className: (0, a.default)("".concat(x, "__close-icon")),
|
|
661
|
-
onClick: function(e) {
|
|
662
|
-
e.stopPropagation(), e1(!1);
|
|
663
|
-
},
|
|
664
|
-
children: (0, u.jsx)(d.X, {
|
|
665
|
-
onClick: function(e) {
|
|
666
|
-
e.stopPropagation(), e1(!1);
|
|
667
|
-
}
|
|
668
|
-
})
|
|
669
|
-
})
|
|
670
|
-
]
|
|
671
|
-
}),
|
|
672
|
-
nJ() > (eM || 10) && (0, u.jsx)("div", {
|
|
673
|
-
className: (0, a.default)("".concat(x, "__header-row")),
|
|
674
|
-
children: (0, u.jsx)(_.default, l({
|
|
675
|
-
className: "".concat(x, "__input"),
|
|
676
|
-
value: np,
|
|
677
|
-
onChange: function(e) {
|
|
678
|
-
return ny(e);
|
|
679
|
-
},
|
|
680
|
-
placeholder: eb || 'Search',
|
|
681
|
-
withDelete: !0,
|
|
682
|
-
onMouseDown: function() {
|
|
683
|
-
e0 || e1(!0);
|
|
684
|
-
}
|
|
685
|
-
}, eN))
|
|
686
|
-
})
|
|
687
|
-
]
|
|
688
|
-
}),
|
|
689
|
-
K && (0, u.jsx)("div", {
|
|
690
|
-
className: (0, a.default)("".concat(x, "__header-row")),
|
|
691
|
-
children: K
|
|
692
|
-
})
|
|
693
|
-
]
|
|
694
|
-
}) : null,
|
|
695
|
-
eD && (0, u.jsx)("div", {
|
|
696
|
-
className: (0, a.default)("".concat(x, "__input-list-wrapper")),
|
|
697
|
-
children: n8()
|
|
698
|
-
}),
|
|
699
|
-
eL && eR && np && i.length && nR.every(function(e) {
|
|
700
|
-
var n = e.label;
|
|
701
|
-
return (null == n ? void 0 : n.toLowerCase()) !== (null == np ? void 0 : np.toLowerCase());
|
|
702
|
-
}) ? (0, u.jsx)("div", {
|
|
703
|
-
className: (0, a.default)("".concat(x, "__creatable-helper")),
|
|
704
|
-
children: "Select an option or create one"
|
|
705
|
-
}) : null,
|
|
706
|
-
(0, u.jsxs)("div", {
|
|
707
|
-
ref: eX,
|
|
708
|
-
className: "".concat(x, "__list ").concat(K || eJ ? "".concat(x, "__list--with-header") : '', " ").concat(X ? "".concat(x, "__list--with-footer") : ''),
|
|
709
|
-
children: [
|
|
710
|
-
c,
|
|
711
|
-
(null == (g = i.filter(function(e) {
|
|
712
|
-
return 'open_modal' !== e.value;
|
|
713
|
-
})) ? void 0 : g.length) !== 0 || eL && np ? null : (0, u.jsx)("div", {
|
|
714
|
-
className: "".concat(x, "__no-options"),
|
|
715
|
-
children: eg
|
|
716
|
-
})
|
|
717
|
-
]
|
|
718
|
-
}),
|
|
719
|
-
(X || eJ) && (null == (b = i.filter(function(e) {
|
|
720
|
-
return 'open_modal' !== e.value;
|
|
721
|
-
})) ? void 0 : b.length) > 0 ? (0, u.jsxs)("div", {
|
|
722
|
-
className: (0, a.default)("".concat(x, "__footer"), (n(r = {}, "".concat(x, "__footer-with-shadow"), eJ && nl), n(r, "".concat(x, "__footer-with-shadow-hidden"), na === nd), r)),
|
|
723
|
-
children: [
|
|
724
|
-
X,
|
|
725
|
-
eJ && (0, u.jsxs)("button", {
|
|
726
|
-
type: "button",
|
|
727
|
-
onClick: function() {
|
|
728
|
-
return e1(!1);
|
|
729
|
-
},
|
|
730
|
-
children: [
|
|
731
|
-
"Apply",
|
|
732
|
-
(null == L ? void 0 : L.length) ? "(".concat(null == L ? void 0 : L.length, ")") : ''
|
|
733
|
-
]
|
|
734
|
-
})
|
|
735
|
-
]
|
|
736
|
-
}) : null,
|
|
737
|
-
nO && (0, s.createPortal)((0, u.jsxs)("div", {
|
|
738
|
-
ref: eY,
|
|
739
|
-
className: (0, a.default)("".concat(x, "__edit-option-modal")),
|
|
740
|
-
children: [
|
|
741
|
-
(0, u.jsxs)("div", {
|
|
742
|
-
className: (0, a.default)("".concat(x, "__edit-option-modal-section")),
|
|
743
|
-
children: [
|
|
744
|
-
(0, u.jsx)(_.default, {
|
|
745
|
-
value: nO.label,
|
|
746
|
-
onChange: function(e) {
|
|
747
|
-
return nL(function(n) {
|
|
748
|
-
return t(l({}, n), {
|
|
749
|
-
label: e
|
|
750
|
-
});
|
|
751
|
-
});
|
|
752
|
-
},
|
|
753
|
-
error: nk,
|
|
754
|
-
onKeyDown: function(e) {
|
|
755
|
-
13 === e && nU();
|
|
756
|
-
},
|
|
757
|
-
symbolsLimit: "50",
|
|
758
|
-
ref: nx
|
|
759
|
-
}),
|
|
760
|
-
(0, u.jsx)(p.default, {
|
|
761
|
-
variant: "link",
|
|
762
|
-
icon: (0, u.jsx)(d.Trash2, {}),
|
|
763
|
-
label: "Delete",
|
|
764
|
-
onClick: nW
|
|
765
|
-
})
|
|
766
|
-
]
|
|
767
|
-
}),
|
|
768
|
-
(0, u.jsx)("div", {
|
|
769
|
-
className: (0, a.default)("".concat(x, "__edit-option-modal-section-divider"))
|
|
770
|
-
}),
|
|
771
|
-
(0, u.jsxs)("div", {
|
|
772
|
-
className: (0, a.default)("".concat(x, "__edit-option-modal-section")),
|
|
773
|
-
children: [
|
|
774
|
-
(0, u.jsx)("h3", {
|
|
775
|
-
children: "Colors"
|
|
776
|
-
}),
|
|
777
|
-
(0, u.jsx)("div", {
|
|
778
|
-
className: (0, a.default)("".concat(x, "__edit-option-modal-section-colors")),
|
|
779
|
-
children: N.map(function(e) {
|
|
780
|
-
var n;
|
|
781
|
-
return (0, u.jsx)("div", {
|
|
782
|
-
className: "color-block",
|
|
783
|
-
style: {
|
|
784
|
-
backgroundColor: e
|
|
785
|
-
},
|
|
786
|
-
onClick: function() {
|
|
787
|
-
return nL(function(n) {
|
|
788
|
-
return t(l({}, n), {
|
|
789
|
-
style: t(l({}, n ? n.style : {}), {
|
|
790
|
-
backgroundColor: e
|
|
791
|
-
})
|
|
792
|
-
});
|
|
793
|
-
});
|
|
794
|
-
},
|
|
795
|
-
children: (null == nO || null == (n = nO.style) ? void 0 : n.backgroundColor) === e ? (0, u.jsx)(d.Check, {}) : null
|
|
796
|
-
}, e);
|
|
797
|
-
})
|
|
798
|
-
})
|
|
799
|
-
]
|
|
800
|
-
})
|
|
801
|
-
]
|
|
802
|
-
}, "editOptionModal".concat(null == nO ? void 0 : nO.value)), null != (e = document.getElementById('app')) ? e : document.body),
|
|
803
|
-
eL && eR && np && nR.every(function(e) {
|
|
804
|
-
var n = e.label;
|
|
805
|
-
return (null == n ? void 0 : n.toLowerCase()) !== (null == np ? void 0 : np.toLowerCase());
|
|
806
|
-
}) && (0, u.jsxs)("div", {
|
|
807
|
-
className: (0, a.default)("".concat(x, "__create-option")),
|
|
808
|
-
onClick: nq,
|
|
809
|
-
children: [
|
|
810
|
-
"Create",
|
|
811
|
-
(0, u.jsx)(h.default, {
|
|
812
|
-
label: np,
|
|
813
|
-
style: {
|
|
814
|
-
backgroundColor: nM
|
|
815
|
-
},
|
|
816
|
-
isNoDismiss: !0
|
|
817
|
-
})
|
|
818
|
-
]
|
|
819
|
-
})
|
|
820
|
-
]
|
|
821
|
-
})
|
|
822
|
-
});
|
|
823
|
-
}(), i) : null)
|
|
824
|
-
]
|
|
825
|
-
});
|
|
826
|
-
};
|
|
1
|
+
function e(e,n){(null==n||n>e.length)&&(n=e.length);for(var l=0,t=Array(n);l<n;l++)t[l]=e[l];return t}function n(e,n,l){return n in e?Object.defineProperty(e,n,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[n]=l,e}function l(e){for(var l=1;l<arguments.length;l++){var t=null!=arguments[l]?arguments[l]:{},o=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),o.forEach(function(l){n(e,l,t[l])})}return e}function t(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):(function(e,n){var l=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);l.push.apply(l,t)}return l})(Object(n)).forEach(function(l){Object.defineProperty(e,l,Object.getOwnPropertyDescriptor(n,l))}),e}function o(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var l,t,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var r=[],i=!0,u=!1;try{for(o=o.call(e);!(i=(l=o.next()).done)&&(r.push(l.value),!n||r.length!==n);i=!0);}catch(e){u=!0,t=e}finally{try{i||null==o.return||o.return()}finally{if(u)throw t}}return r}}(e,n)||i(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(n){return function(n){if(Array.isArray(n))return e(n)}(n)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||i(n)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(n,l){if(n){if("string"==typeof n)return e(n,l);var t=Object.prototype.toString.call(n).slice(8,-1);if("Object"===t&&n.constructor&&(t=n.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return e(n,l)}}Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return j}});var u=require("react/jsx-runtime"),a=w(require("classnames")),c=function(e,n){if(e&&e.__esModule)return e;if(null===e||(void 0===e?"undefined":e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)!="object"&&"function"!=typeof e)return{default:e};var l=y(n);if(l&&l.has(e))return l.get(e);var t={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var i=o?Object.getOwnPropertyDescriptor(e,r):null;i&&(i.get||i.set)?Object.defineProperty(t,r,i):t[r]=e[r]}return t.default=e,l&&l.set(e,t),t}(require("react")),s=require("react-dom"),d=require("react-feather"),v=require("../../../Functions/fieldValueFormatters"),f=require("../../../Functions/useDebounce"),m=w(require("../../../Functions/useIsMobile/useIsMobile")),p=w(require("../../UI/Button/Button")),h=w(require("../../UI/Tag/Tag")),g=w(require("../../UI/TagList/TagList")),b=w(require("../CheckboxInput/CheckboxInput")),_=w(require("../Input/Input"));function w(e){return e&&e.__esModule?e:{default:e}}function y(e){if("function"!=typeof WeakMap)return null;var n=new WeakMap,l=new WeakMap;return(y=function(e){return e?l:n})(e)}require("./TagsDropdown.scss");var x="tags-dropdown",N=["#F1F0F0","#E3E2E0","#EEDFDA","#F9DEC9","#FDECC8","#DBECDB","#D3E4EF","#E8DEEE","#F4E0E9","#FFE2DD","#D3EFED","#ECEEDE"],j=function(e){var i,w,y,j,C,E,O,S=e.options,L=e.chosenOptions,k=e.onChange,D=e.className,I=e.tagClassname,P=e.listClassName,M=e.onKeyPress,R=e.placeholder,A=e.label,F=e.disabled,T=e.isValuesInTags,B=e.error,H=e.isNotValidateASCII,q=void 0!==H&&H,z=e.noTagsWrap,W=void 0!==z&&z,U=e.headerContent,K=void 0===U?null:U,V=e.footerContent,X=void 0===V?null:V,Y=e.selectAllButtonRef,$=void 0===Y?null:Y,G=e.unselectAllButtonRef,J=void 0===G?null:G,Q=e.closeOnSelect,Z=void 0!==Q&&Q,ee=e.closeOnRemove,en=void 0!==ee&&ee,el=e.closeOnRemoveAll,et=void 0!==el&&el,eo=e.closeOnSelectAll,er=void 0!==eo&&eo,ei=e.closeOnSelectMobile,eu=void 0!==ei&&ei,ea=e.closeOnRemoveMobile,ec=void 0!==ea&&ea,es=e.closeOnRemoveAllMobile,ed=void 0!==es&&es,ev=e.closeOnSelectAllMobile,ef=void 0!==ev&&ev,em=e.fieldKey,ep=e.id,eh=e.noOptionsText,eg=void 0===eh?"No options available":eh,eb=e.mobileSearchPlaceholder,e_=e.isSearchable,ew=void 0===e_||e_,ey=e.useLiveSearch,ex=e.doRequest,eN=e.attributesOfNativeInput,ej=e.isUseLocalOptionsStore,eC=void 0===ej||ej,eE=e.isDefaultOpened,eO=void 0!==eE&&eE,eS=e.withMobileLogic,eL=e.withCreateLogic,ek=e.withActions,eD=e.withSearchInputInList,eI=e.renderOptionsAsTags,eP=e.minItemsForShowMobileSearch,eM=void 0===eP?10:eP,eR=e.onOptionCreate,eA=e.onOptionEdit,eF=e.onOptionDelete,eT=e.onActionConfirmClick,eB=e.onActionCancelClick,eH=e.onDropdownListClose,eq=e.customTriggerRef,ez=e.renderCustomTrigger,eW=e.recalculateListContainerStylesTrigger,eU=(0,c.useRef)(null),eK=(0,c.useRef)(null),eV=(0,c.useRef)(null),eX=(0,c.useRef)(null),eY=(0,c.useRef)(null),e$=(0,c.useRef)(null),eG=(0,m.default)().isMobile,eJ=eG&&eS&&window.screen.width<=768,eQ=o((0,c.useState)(ep||em||Math.random().toString(16).slice(2)),1)[0],eZ=o((0,c.useState)(!1),2),e0=eZ[0],e1=eZ[1],e2=o((0,c.useState)(0),2),e3=e2[0],e6=e2[1],e8=o((0,c.useState)(null),2),e5=e8[0],e9=e8[1],e4=o((0,c.useState)(null),2),e7=e4[0],ne=e4[1],nn=o((0,c.useState)(null),2),nl=nn[0],nt=nn[1],no=o((0,c.useState)(!1),2),nr=no[0],ni=no[1],nu=o((0,c.useState)(0),2),na=nu[0],nc=nu[1],ns=o((0,c.useState)(1),2),nd=ns[0],nv=ns[1],nf=(0,c.useRef)(null),nm=o((0,c.useState)(""),2),np=nm[0],nh=nm[1],ng=(0,f.useDebounce)({searchValue:np,delay:600}),nb=o((0,c.useState)(!1),2),n_=nb[0],nw=nb[1],ny=function(e){nh(e),nw(np!==e&&""===e),nf.current=e},nx=(0,c.useRef)(null),nN=o((0,c.useState)([]),2),nj=nN[0],nC=nN[1],nE=o((0,c.useState)(null),2),nO=nE[0],nS=nE[1],nL=function(e){nS(function(n){return e?t(l({},null!=n?n:{},"function"==typeof e?null==e?void 0:e(n):e),{isChanged:!!n}):e})},nk=(0,c.useMemo)(function(){return!!nO&&(!!nj.filter(function(e){return e.value!==nO.value}).some(function(e){return e.label===nO.label})||null)},[nj,nO]),nD=o((0,c.useState)({}),2),nI=nD[0],nP=nD[1],nM=(0,c.useMemo)(function(){var e=Math.floor(Math.random()*(N.length-1-0+1))+0;return N[e]},[nj.length]),nR=null==nj?void 0:nj.reduce(function(e,n){var l,t=function(e,n){var l=null==e?void 0:e.findIndex(function(e){return e.value===(null==n?void 0:n.value)});-1!==l?e[l]=n:e.push(n)};return n.groupName?null==(l=n.list)||l.map(function(n){return t(e,n)}):t(e,n),e},eC?null==(w=Object.keys(nI))?void 0:w.map(function(e){var n;return{value:e,label:null!=(n=null==nI?void 0:nI[e])?n:""}}):[]),nA=function(e){(eJ?ec:en)&&e1(!1),eC&&nP(function(o){return t(l({},o),n({},e,void 0))}),null==k||k(L.filter(function(n){return n!==e}),"chosenOptions")},nF=function(){var e,n;return null!=(n=null!=(e=document.querySelector("div#root"))?e:document.querySelector("div#app"))?n:document.querySelector("div#storybook-root")},nT=function(){var e,n=document.createElement("div");if(n.setAttribute("id",eQ),n.classList.add("tags-dropdown__container"),P&&n.classList.add(P),eJ&&n.addEventListener("click",function(e){e.target&&e.target.id===eQ&&e1(!1)}),eJ){try{null==(t=document.getElementById("mlw-".concat(eQ)))||t.remove()}catch(e){}var l,t,o=document.createElement("div");o.classList.add("tags-dropdown-mobile"),o.setAttribute("id","mlw-".concat(eQ)),null==o||o.append(n),null==(l=nF())||l.append(o)}else null==(e=nF())||e.append(n)},nB=function(){return document.getElementById(eQ)},nH=function(){var e=nB();if(!e||!e0)return!1;var n=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,l=null!=(x=null==eV||null==(h=eV.current)?void 0:h.getBoundingClientRect())?x:{},t=l.width,o=l.height,r=void 0===o?0:o,i=l.left,u=l.top,a=void 0===u?0:u,c=null==e$?void 0:e$.current,s=e.getElementsByClassName("tags-dropdown__list")[0],d=null==c?void 0:c.getElementsByClassName("tags-dropdown__header")[0],v=null==c?void 0:c.getElementsByClassName("tags-dropdown__footer")[0],f=Number.parseInt(null!=(N=null==(b=getComputedStyle(c))||null==(g=b.marginTop)?void 0:g.replace("px",""))?N:0,10),m=null!=(j=null==c||null==(_=c.getBoundingClientRect())?void 0:_.height)?j:0,p=500-(null!=(C=null==d||null==(w=d.getBoundingClientRect())?void 0:w.height)?C:0)-(null!=(E=null==v||null==(y=v.getBoundingClientRect())?void 0:y.height)?E:0);if(eJ&&eS)s.style.maxHeight="".concat(p,"px");else{var h,g,b,_,w,y,x,N,j,C,E,O,S,L,k,D,I=null==(O=getComputedStyle(s))?void 0:O.maxHeight,P=null!=e7?e7:Number.parseInt(null!=(k=null==I?void 0:I.replace("px",""))?k:0,10);null!==e7||Number.isNaN(P)||ne(P),void 0!==m&&m>P&&!Number.isNaN(P)&&(m=P-2*f);var M=ez?a-f-(null!=(D=null==eq||null==(L=eq.current)||null==(S=L.getBoundingClientRect())?void 0:S.height)?D:0):a-f,R=n-a-r-2*f,A=e5;!e5&&nj.length&&e9(A=M<R||R>=m?"bottom":"top"),m>("top"===A?M:R)&&((m=("top"===A?M:R)-3*f)<200&&(m=200),c&&(c.style.maxHeight="".concat(m,"px"))),e.style.minWidth="".concat(t,"px"),e.style.left="".concat(i,"px"),e.style.top="".concat("bottom"===A?a+r:a-m-2*f,"px")}},nq=function(){var e,n={label:np,style:{backgroundColor:nM},isEditable:!0,ref:(0,c.createRef)()};(null!=(e=null==eR?void 0:eR(n))?e:new Promise(function(e){return e(1)})).then(function(e){var l,t=Math.random().toString(16).slice(2);n.value=null!=(l=null==e?void 0:e.id)?l:t,nC(function(e){return r(e).concat([n])}),nh(""),nQ(n)})},nz=function(e,n){null==e||e.preventDefault(),null==e||e.stopPropagation(),nL((null==nO?void 0:nO.value)===(null==n?void 0:n.value)?null:n)},nW=function(){var e;(null!=(e=null==eF?void 0:eF(nO))?e:new Promise(function(e){return e(1)})).then(function(){(null==nO?void 0:nO.value)&&nA(null==nO?void 0:nO.value),nC(function(e){return e.filter(function(e){return e.value!==(null==nO?void 0:nO.value)})}),nL(null)})},nU=function(){if(!(null==nO?void 0:nO.isChanged)||nk)return nL(null),!1;null==eA||eA(nO),nC(function(e){return e.map(function(e){if(nO&&e.value===(null==nO?void 0:nO.value)){var n=l({},nO);return nL(null),n}return e})})},nK=function(){if(!nO||!(null==eY?void 0:eY.current))return null;var e,n,l,t,o,r,i,u=window.scrollX,a=window.scrollY,c={left:"modal-left",right:"modal-right",top:"modal-top",bottom:"modal-bottom"},s=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,d=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,v=null==nO||null==(e=nO.ref)?void 0:e.current,f=null!=(l=null==v?void 0:v.getBoundingClientRect())?l:{},m=f.x,p=f.y,h=void 0===p?0:p,g=f.width,b=f.height,_=void 0===b?0:b,w=null==e$||null==(n=e$.current)?void 0:n.getBoundingClientRect(),y=s-(null!=(t=null==w?void 0:w.x)?t:0)-(null!=(o=null==w?void 0:w.width)?o:0),x=d-h-a-_;Object.values(c).map(function(e){return eY.current&&eY.current.classList.remove(e),e}),eY.current.classList.add(null!=(r=null==c?void 0:c[y<200?"left":"right"])?r:""),eY.current.classList.add(null!=(i=null==c?void 0:c[x<200?"top":"bottom"])?i:""),eY.current.style.left="".concat((void 0===m?0:m)+u+(void 0===g?0:g),"px"),eY.current.style.top="".concat(h+a+_,"px"),eY.current.style.transform="translate(".concat(y<200?"calc(-100% + 7px)":"-35px",", ").concat(x<200?"calc(-100% - ".concat(_+10,"px)"):"10px",")")},nV=function(e){var n,l,t,o,r,i,u=e.target;!e0||(null==(n=nB())?void 0:n.contains(u))||eY.current?eY.current&&!(null==(l=eY.current)?void 0:l.contains(u))&&((null==(i=document)||null==(r=i.getElementById)||null==(o=r.call(i,"editTrigger".concat(null==nO?void 0:nO.value)))||null==(t=o.contains)?void 0:t.call(o,u))||nU()):(e1(!1),null==eH||eH(e))},nX=function(e){var n;nV(e),e.target.isEqualNode(null==eU?void 0:eU.current)||null==eU||null==(n=eU.current)||n.blur()},nY=function(e){var n,l,t,o,r,i;return((null==e?void 0:e.tagName)!=="svg"||(null==e||null==(n=e.parentNode)?void 0:n.className)!=="tag__button")&&(null==e?void 0:e.tagName)!=="line"&&((null==e?void 0:e.tagName)==="svg"&&(null==e||null==(l=e.parentNode)?void 0:l.className)!=="tag__button"||(null==e||null==(o=e.className)||null==(t=o.indexOf)?void 0:t.call(o,"tag__label"))!==-1||(null==e||null==(i=e.className)||null==(r=i.indexOf)?void 0:r.call(i,"tag-list_wrapper"))!==-1||(null==e?void 0:e.className.indexOf("".concat(x,"__trigger")))!==-1||(null==e?void 0:e.className)==="tags-dropdown__arrow")},n$=function(e){if(e.isHiddenInList)return!1;var n=e.title||e.label;return!np.length||!!(null==n?void 0:n.toLowerCase().includes((null==np?void 0:np.toLowerCase())||""))},nG=function(e){return null==e?void 0:e.map(function(e){var n;return(null==e?void 0:e.groupName)?null!=(n=null==e?void 0:e.list)?n:[]:e}).flat()},nJ=(0,c.useCallback)(function(){return null==nj?void 0:nj.reduce(function(e,n){if(null==n?void 0:n.list){var l;e+=(null==n||null==(l=n.list)?void 0:l.length)||0}else++e;return e},0)},[nj]),nQ=function(e){var o,i;return(null==e||!e.isFreezed)&&(((null==e?void 0:e.closeOnOptionSelect)!==void 0?e.closeOnOptionSelect&&e1(!1):(eJ?eu:Z)&&e1(!1),ny(""),e.value&&L.includes(null==(o=e.value)?void 0:o.toString()))?nA(e.value):(e.value&&eC&&nP(function(o){var r;return e.value?t(l({},o),n({},null==(r=e.value)?void 0:r.toString(),null==e?void 0:e.label)):o}),e.value&&(null==k||k(r(L).concat([null==(i=e.value)?void 0:i.toString()]),"chosenOptions"))),null)},nZ=function(e){var n=e;q||(n=(0,v.formatToOnlyASCIICodeText)(n)),ny(n)},n0=function(e){e.target===(null==eK?void 0:eK.current)&&(e.stopPropagation(),e.preventDefault(),e1(!1))},n1=function(){var e,n=null==(e=nG(nj))?void 0:e.filter(function(e){var n=e.isFreezed,l=e.value;return l&&!n&&!(null==L?void 0:L.includes(null==l?void 0:l.toString()))&&"open_modal"!==l});eC&&nP(function(e){return null==n?void 0:n.reduce(function(e,n){var l=n.value,t=n.label;return l&&(e[l]=t),e},e)}),null==k||k(r(L).concat(r((null==n?void 0:n.map(function(e){var n=e.value;return n?null==n?void 0:n.toString():""}))||[])),"chosenOptions"),(eJ?ef:er)&&e1(!1)},n2=function(){eC&&nP({}),null==k||k(null==L?void 0:L.filter(function(e){var n,l;return null==(l=nG(nj))||null==(n=l.find(function(n){return n.value===e}))?void 0:n.isFreezed}),"chosenOptions"),(eJ?ed:et)&&e1(!1)},n3=(0,c.useCallback)(function(e){ex&&"function"==typeof ex&&+Math.round(e.target.clientHeight+e.target.scrollTop)==+e.target.scrollHeight&&ex(nf.current,!0)},[nj]),n6=function(e){var l,t=e.description,o=e.title||e.label,r=function(e){var n,l=null==e||null==(n=e.toLowerCase())?void 0:n.indexOf(null==np?void 0:np.toLowerCase());return -1===l?e:(0,u.jsxs)("pre",{className:"inherit-styles",children:[(0,u.jsx)("span",{children:e.substring(0,l)}),(0,u.jsx)("span",{className:"search-match bg--yellow",children:e.substring(l,l+(null==np?void 0:np.length))}),(0,u.jsx)("span",{children:e.substring(l+(null==np?void 0:np.length))})]})};return(0,u.jsxs)("button",{type:"button",ref:null==e?void 0:e.ref,onClick:function(n){n.preventDefault(),n.stopPropagation(),nQ(e)},className:(0,a.default)("".concat(x,"__list-item"),n({},"".concat(x,"__list-item_active"),null==L?void 0:L.some(function(n){return n===e.value})),n({},"".concat(x,"__list-item_disabled"),e.disabled),n({},"".concat(x,"__list-item_freezed"),null==e?void 0:e.isFreezed),n({},"".concat(x,"__list-item--editing"),(null==e?void 0:e.value)===(null==nO?void 0:nO.value)),e.className),children:[!eJ&&(0,u.jsx)("span",{className:(0,a.default)("".concat(x,"__active-icon"),n({},"".concat(x,"__active-icon_active"),null==L?void 0:L.some(function(n){return n===e.value}))),children:(0,u.jsx)(d.Check,{width:16,height:16,className:"color--text"})}),(0,u.jsxs)("div",{className:(0,a.default)("".concat(x,"__list-item-body")),children:[eI?(0,u.jsx)(h.default,{className:(0,a.default)("".concat(x,"__list-item-title"),null==e?void 0:e.labelClassName,{"tag_with-btn":!(null==e?void 0:e.isFreezed)}),label:o?r(o):"",style:null==e?void 0:e.style,isNoDismiss:!0},null==e?void 0:e.value):(0,u.jsx)("span",{className:(0,a.default)("".concat(x,"__list-item-title"),e.labelClassName),children:o?r(o):""}),t&&(0,u.jsx)("span",{className:(0,a.default)("".concat(x,"__list-item-description")),children:t})]}),!eJ&&(null==e?void 0:e.isEditable)&&eA&&eF&&(0,u.jsx)("div",{id:"editTrigger".concat(null==e?void 0:e.value),className:(0,a.default)("".concat(x,"__list-item-edit-trigger")),onClick:function(n){return nz(n,e)},children:(0,u.jsx)(d.MoreHorizontal,{})}),eJ?null!=(l=null==e?void 0:e.customMobileIcon)?l:(0,u.jsx)(b.default,{value:null==L?void 0:L.some(function(n){return n===e.value}),onChange:function(){nQ(e)},label:"",id:""}):""]},"".concat(x,"__list-item-").concat(e.id||e.value))},n8=function(){return(0,u.jsx)(_.default,l({ref:eU,className:(0,a.default)("".concat(x,"__input"),n({},"".concat(x,"__input--in-list"),eD)),value:np,onChange:nZ,placeholder:R||"Select from list",attributesOfNativeInput:t(l({},eN),{onKeyDown:function(e){13===e.keyCode&&eL&&eR&&nR.every(function(e){var n=e.label;return(null==n?void 0:n.toLowerCase())!==(null==np?void 0:np.toLowerCase())})&&nq(),null==M||M(e,np)}})},eL?{symbolsLimit:50}:{}))},n5=(0,c.useCallback)(function(){var e;return null!=(e=null==ez?void 0:ez({chosenOptions:L,singleLevelOptions:nR,deleteChosen:nA,inputRef:eU,onSearchHandler:nZ,isOpen:e0,setIsOpen:e1}))?e:(0,u.jsxs)("div",{className:(0,a.default)("".concat(x,"__trigger"),n({"tags-dropdown__error":B},"".concat(x,"__trigger--with-actions"),ek)),onClick:function(e){var n=e.target;(null==n?void 0:n.tagName)==="INPUT"?e1(!0):nY(n)&&e1(function(e){return!e})},children:[W?(0,u.jsx)(g.default,{items:null==L?void 0:L.map(function(e,n){var l=null==nR?void 0:nR.find(function(n){var l;return(null==(l=n.value)?void 0:l.toString())===(null==e?void 0:e.toString())});return{value:e,label:T?null==l?void 0:l.value:(null==l?void 0:l.label)||(null==l?void 0:l.name)||(null==l?void 0:l.title),id:n,className:null==l?void 0:l.labelClassName,style:null==l?void 0:l.style}}),disableShowMore:!0}):null==L?void 0:L.map(function(e){var n=null==nR?void 0:nR.find(function(n){var l;return(null==(l=n.value)?void 0:l.toString())===(null==e?void 0:e.toString())}),l=T?null==n?void 0:n.value:(null==n?void 0:n.label)||(null==n?void 0:n.name)||(null==n?void 0:n.title);return(0,u.jsx)(h.default,{className:(0,a.default)(I,null==n?void 0:n.labelClassName,{"tag_with-btn":!(null==n?void 0:n.isFreezed)}),label:l,style:null==n?void 0:n.style,removeItem:(null==n?void 0:n.isFreezed)?void 0:function(){return nA(e)},isNoDismiss:!1},e)}),0!==L.length&&W?"":n8(),(0,u.jsx)("span",{className:(0,a.default)("".concat(x,"__arrow"),n({},"".concat(x,"__arrow_active"),e0)),children:eJ?(0,u.jsx)(d.Code,{className:"mobile-icon"}):e0?(0,u.jsx)(d.ChevronUp,{className:"color--text"}):(0,u.jsx)(d.ChevronDown,{className:"color--text"})})]})},[L,nR,eU,e0]);return(0,c.useLayoutEffect)(function(){return nT(),eO&&!eG&&e1(!0),function(){var e,n;null==(e=nB())||e.remove(),null==(n=document.getElementById("mlw-".concat(eQ)))||n.remove()}},[]),(0,c.useLayoutEffect)(function(){var e;return eJ?(window.removeEventListener("mousewheel",nX),window.removeEventListener("wheel",nX),window.removeEventListener("touchmove",nX),window.removeEventListener("mouseup",nV)):(window.addEventListener("mousewheel",nX),window.addEventListener("wheel",nX),window.addEventListener("touchmove",nX),window.addEventListener("mouseup",nV)),null==(e=nB())||e.addEventListener("click",nX),function(){var e;window.removeEventListener("mousewheel",nX),window.removeEventListener("mouseup",nV),window.removeEventListener("wheel",nX),window.removeEventListener("touchmove",nX),null==(e=nB())||e.removeEventListener("click",nX)}},[nB,eJ]),(0,c.useLayoutEffect)(function(){e0&&(nH(),nK())},[e0,S,L,np,eJ,null==e$||null==(j=e$.current)||null==(y=j.getBoundingClientRect())?void 0:y.height,eW]),(0,c.useEffect)(function(){eC&&L.length!==Object.keys(nI).length&&nj.map(function(e){var o;return(null==e?void 0:e.value)&&!(null==nI?void 0:nI[null==e||null==(o=e.value)?void 0:o.toString()])&&nP(function(o){var r;return e.value?t(l({},o),n({},null==e||null==(r=e.value)?void 0:r.toString(),null==e?void 0:e.label)):o}),e})},[L,eC]),(0,c.useEffect)(function(){var e,n,l,t,o,r,i,u,a=function(){e6(window.scrollY)},c=e0?"addEventListener":"removeEventListener";null==$||null==(e=$.current)||e[c]("click",n1,!0),null==J||null==(n=J.current)||n[c]("click",n2,!0),e0?(eJ&&eS||window.removeEventListener("scroll",a),(null==eq?void 0:eq.current)&&(eq.current.style.pointerEvents="none"),null==(l=nB())||l.classList.add("tags-dropdown__container--opened"),eJ?null==eU||null==(i=eU.current)||null==(r=i.blur)||r.call(i):null==eU||null==(o=eU.current)||null==(t=o.focus)||t.call(o)):(eJ&&eS||window.addEventListener("scroll",a),(null==eq?void 0:eq.current)&&(eq.current.style.pointerEvents="auto"),null==(u=nB())||u.classList.remove("tags-dropdown__container--opened"),eD&&ny(""),e9(null),nh(""))},[e0]),(0,c.useEffect)(function(){var e,n,l,t,o,r=function(e){var n;nc(Number.parseInt(null==(n=e.target.scrollTop)?void 0:n.toString(),10))},i=function(e){e.preventDefault(),window.scrollTo({top:e3})};return e0&&eJ&&(null==eX?void 0:eX.current)&&(null==eX||null==(e=eX.current)||e.addEventListener("scroll",r),nt((null==eX||null==(n=eX.current)?void 0:n.scrollHeight)>(null==eX||null==(l=eX.current)?void 0:l.clientHeight)),null===nl&&ni((null==eX||null==(t=eX.current)?void 0:t.scrollHeight)>(null==eX||null==(o=eX.current)?void 0:o.clientHeight))),e0&&eX&&eX.current&&(eX.current.addEventListener("scroll",n3),eJ&&eS||window.addEventListener("scroll",i)),function(){var e,n;eJ&&eS||window.removeEventListener("scroll",i),null==eX||null==(e=eX.current)||e.removeEventListener("scroll",n3),null==eX||null==(n=eX.current)||n.removeEventListener("scroll",r)}},[e0,eJ,null==eX?void 0:eX.current,null==eX||null==(C=eX.current)?void 0:C.scrollHeight,null==eX||null==(E=eX.current)?void 0:E.clientHeight]),(0,c.useEffect)(function(){if(null==eX?void 0:eX.current){var e,n,l;nv(Number.parseInt((e=(null==eX||null==(n=eX.current)?void 0:n.scrollHeight)-(null==eX||null==(l=eX.current)?void 0:l.clientHeight),e.toString()),10))}},[na,null==eX?void 0:eX.current]),(0,c.useEffect)(function(){ew&&ey&&(ng||n_||e0)&&(null==ex||ex(ng))},[e0,ng,n_]),(0,c.useEffect)(function(){nC(S.map(function(e){return t(l({},e),{ref:(0,c.createRef)()})}))},[S]),(0,c.useEffect)(function(){if(nO){var e,n;nK(),null==nx||null==(n=nx.current)||null==(e=n.focus)||e.call(n)}},[null==nO?void 0:nO.value]),(0,u.jsxs)("div",{className:(0,a.default)(x,D,(n(O={},"".concat(x,"_disabled"),F),n(O,"".concat(x,"-mobile"),eJ),n(O,"".concat(x,"--focused"),e0&&!(null==eq?void 0:eq.current)&&!eJ),n(O,"".concat(x,"--custom-trigger"),!!(null==eq?void 0:eq.current)),O)),ref:eV,children:[n5(),ek&&(0,u.jsxs)("div",{className:(0,a.default)("".concat(x,"__actions")),children:[(0,u.jsx)("div",{className:(0,a.default)("".concat(x,"__actions-item")),onClick:eT,children:(0,u.jsx)(d.Check,{})}),(0,u.jsx)("div",{className:(0,a.default)("".concat(x,"__actions-item")),onClick:eB,children:(0,u.jsx)(d.X,{})})]}),e0&&((i=nB())?(0,s.createPortal)(function(){var e,o,r,i=null==nj?void 0:nj.reduce(function(e,n){if(n.groupName){var o,r=null==n||null==(o=n.list)?void 0:o.filter(function(e){return n$(e)});(null==r?void 0:r.length)&&e.push(t(l({},n),{list:r}))}else n$(n)&&e.push(n);return e},[]),c=[],v=!0,f=!1,m=void 0;try{for(var g,b,w,y=i[Symbol.iterator]();!(v=(w=y.next()).done);v=!0){var j,C,E,O,S=w.value;S.groupName?c.push((0,u.jsxs)("div",{className:(0,a.default)("".concat(x,"-group"),S.className),children:[(0,u.jsx)("span",{className:"".concat(x,"-group__name"),children:S.groupName}),null==(j=S.list)?void 0:j.map(function(e){return n6(e)})]},null==(O=S.groupName)||null==(E=O.toString())?void 0:E.replace(/ /g,"_").concat(null==(C=Date.now())?void 0:C.toString()))):c.push(n6(S))}}catch(e){f=!0,m=e}finally{try{v||null==y.return||y.return()}finally{if(f)throw m}}return(0,u.jsx)("div",{className:(0,a.default)("".concat(x,"__container-wrapper")),ref:eK,onClick:eJ?n0:function(){},children:(0,u.jsxs)("div",{ref:e$,className:(0,a.default)("".concat(x,"__selector-wrapper"),n({},"".concat(x,"__selector-wrapper--fixed-height"),nr&&eJ)),children:[K||eJ?(0,u.jsxs)("div",{className:(0,a.default)("".concat(x,"__header"),(n(o={},"".concat(x,"__header-with-shadow"),nl&&eJ),n(o,"".concat(x,"__header-with-shadow-hidden"),0===na),o)),children:[eJ&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)("div",{className:(0,a.default)("".concat(x,"__header-row")),children:[(0,u.jsx)("div",{className:(0,a.default)("".concat(x,"__label")),children:A}),(0,u.jsx)("div",{className:(0,a.default)("".concat(x,"__close-icon")),onClick:function(e){e.stopPropagation(),e1(!1)},children:(0,u.jsx)(d.X,{onClick:function(e){e.stopPropagation(),e1(!1)}})})]}),nJ()>(eM||10)&&(0,u.jsx)("div",{className:(0,a.default)("".concat(x,"__header-row")),children:(0,u.jsx)(_.default,l({className:"".concat(x,"__input"),value:np,onChange:function(e){return ny(e)},placeholder:eb||"Search",withDelete:!0,onMouseDown:function(){e0||e1(!0)}},eN))})]}),K&&(0,u.jsx)("div",{className:(0,a.default)("".concat(x,"__header-row")),children:K})]}):null,eD&&(0,u.jsx)("div",{className:(0,a.default)("".concat(x,"__input-list-wrapper")),children:n8()}),eL&&eR&&np&&i.length&&nR.every(function(e){var n=e.label;return(null==n?void 0:n.toLowerCase())!==(null==np?void 0:np.toLowerCase())})?(0,u.jsx)("div",{className:(0,a.default)("".concat(x,"__creatable-helper")),children:"Select an option or create one"}):null,(0,u.jsxs)("div",{ref:eX,className:"".concat(x,"__list ").concat(K||eJ?"".concat(x,"__list--with-header"):""," ").concat(X?"".concat(x,"__list--with-footer"):""),children:[c,(null==(g=i.filter(function(e){return"open_modal"!==e.value}))?void 0:g.length)!==0||eL&&np?null:(0,u.jsx)("div",{className:"".concat(x,"__no-options"),children:eg})]}),(X||eJ)&&(null==(b=i.filter(function(e){return"open_modal"!==e.value}))?void 0:b.length)>0?(0,u.jsxs)("div",{className:(0,a.default)("".concat(x,"__footer"),(n(r={},"".concat(x,"__footer-with-shadow"),eJ&&nl),n(r,"".concat(x,"__footer-with-shadow-hidden"),na===nd),r)),children:[X,eJ&&(0,u.jsxs)("button",{type:"button",onClick:function(){return e1(!1)},children:["Apply",(null==L?void 0:L.length)?"(".concat(null==L?void 0:L.length,")"):""]})]}):null,nO&&(0,s.createPortal)((0,u.jsxs)("div",{ref:eY,className:(0,a.default)("".concat(x,"__edit-option-modal")),children:[(0,u.jsxs)("div",{className:(0,a.default)("".concat(x,"__edit-option-modal-section")),children:[(0,u.jsx)(_.default,{value:nO.label,onChange:function(e){return nL(function(n){return t(l({},n),{label:e})})},error:nk,onKeyDown:function(e){13===e&&nU()},symbolsLimit:"50",ref:nx}),(0,u.jsx)(p.default,{variant:"link",icon:(0,u.jsx)(d.Trash2,{}),label:"Delete",onClick:nW})]}),(0,u.jsx)("div",{className:(0,a.default)("".concat(x,"__edit-option-modal-section-divider"))}),(0,u.jsxs)("div",{className:(0,a.default)("".concat(x,"__edit-option-modal-section")),children:[(0,u.jsx)("h3",{children:"Colors"}),(0,u.jsx)("div",{className:(0,a.default)("".concat(x,"__edit-option-modal-section-colors")),children:N.map(function(e){var n;return(0,u.jsx)("div",{className:"color-block",style:{backgroundColor:e},onClick:function(){return nL(function(n){return t(l({},n),{style:t(l({},n?n.style:{}),{backgroundColor:e})})})},children:(null==nO||null==(n=nO.style)?void 0:n.backgroundColor)===e?(0,u.jsx)(d.Check,{}):null},e)})})]})]},"editOptionModal".concat(null==nO?void 0:nO.value)),null!=(e=document.getElementById("app"))?e:document.body),eL&&eR&&np&&nR.every(function(e){var n=e.label;return(null==n?void 0:n.toLowerCase())!==(null==np?void 0:np.toLowerCase())})&&(0,u.jsxs)("div",{className:(0,a.default)("".concat(x,"__create-option")),onClick:nq,children:["Create",(0,u.jsx)(h.default,{label:np,style:{backgroundColor:nM},isNoDismiss:!0})]})]})})}(),i):null)]})};
|