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,561 +1 @@
|
|
|
1
|
-
function e(e, n) {
|
|
2
|
-
(null == n || n > e.length) && (n = e.length);
|
|
3
|
-
for(var t = 0, l = Array(n); t < n; t++)l[t] = e[t];
|
|
4
|
-
return l;
|
|
5
|
-
}
|
|
6
|
-
function n(e, n, t) {
|
|
7
|
-
return n in e ? Object.defineProperty(e, n, {
|
|
8
|
-
value: t,
|
|
9
|
-
enumerable: !0,
|
|
10
|
-
configurable: !0,
|
|
11
|
-
writable: !0
|
|
12
|
-
}) : e[n] = t, e;
|
|
13
|
-
}
|
|
14
|
-
function t(e) {
|
|
15
|
-
for(var t = 1; t < arguments.length; t++){
|
|
16
|
-
var l = null != arguments[t] ? arguments[t] : {}, r = Object.keys(l);
|
|
17
|
-
"function" == typeof Object.getOwnPropertySymbols && (r = r.concat(Object.getOwnPropertySymbols(l).filter(function(e) {
|
|
18
|
-
return Object.getOwnPropertyDescriptor(l, e).enumerable;
|
|
19
|
-
}))), r.forEach(function(t) {
|
|
20
|
-
n(e, t, l[t]);
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
return e;
|
|
24
|
-
}
|
|
25
|
-
function l(e, n) {
|
|
26
|
-
return n = null != n ? n : {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : (function(e, n) {
|
|
27
|
-
var t = Object.keys(e);
|
|
28
|
-
if (Object.getOwnPropertySymbols) {
|
|
29
|
-
var l = Object.getOwnPropertySymbols(e);
|
|
30
|
-
t.push.apply(t, l);
|
|
31
|
-
}
|
|
32
|
-
return t;
|
|
33
|
-
})(Object(n)).forEach(function(t) {
|
|
34
|
-
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
35
|
-
}), e;
|
|
36
|
-
}
|
|
37
|
-
function r(e, n) {
|
|
38
|
-
return function(e) {
|
|
39
|
-
if (Array.isArray(e)) return e;
|
|
40
|
-
}(e) || function(e, n) {
|
|
41
|
-
var t, l, r = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
|
|
42
|
-
if (null != r) {
|
|
43
|
-
var o = [], i = !0, u = !1;
|
|
44
|
-
try {
|
|
45
|
-
for(r = r.call(e); !(i = (t = r.next()).done) && (o.push(t.value), !n || o.length !== n); i = !0);
|
|
46
|
-
} catch (e) {
|
|
47
|
-
u = !0, l = e;
|
|
48
|
-
} finally{
|
|
49
|
-
try {
|
|
50
|
-
i || null == r.return || r.return();
|
|
51
|
-
} finally{
|
|
52
|
-
if (u) throw l;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return o;
|
|
56
|
-
}
|
|
57
|
-
}(e, n) || u(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 o(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) || u(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(e) {
|
|
71
|
-
return e && "undefined" != typeof Symbol && e.constructor === Symbol ? "symbol" : typeof e;
|
|
72
|
-
}
|
|
73
|
-
function u(n, t) {
|
|
74
|
-
if (n) {
|
|
75
|
-
if ("string" == typeof n) return e(n, t);
|
|
76
|
-
var l = Object.prototype.toString.call(n).slice(8, -1);
|
|
77
|
-
if ("Object" === l && n.constructor && (l = n.constructor.name), "Map" === l || "Set" === l) return Array.from(l);
|
|
78
|
-
if ("Arguments" === l || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l)) return e(n, t);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
Object.defineProperty(exports, "__esModule", {
|
|
82
|
-
value: !0
|
|
83
|
-
}), Object.defineProperty(exports, "default", {
|
|
84
|
-
enumerable: !0,
|
|
85
|
-
get: function() {
|
|
86
|
-
return j;
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
var c = require("react/jsx-runtime"), a = w(require("classnames")), s = function(e, n) {
|
|
90
|
-
if (e && e.__esModule) return e;
|
|
91
|
-
if (null === e || (void 0 === e ? "undefined" : i(e)) !== "object" && "function" != typeof e) return {
|
|
92
|
-
default: e
|
|
93
|
-
};
|
|
94
|
-
var t = _(n);
|
|
95
|
-
if (t && t.has(e)) return t.get(e);
|
|
96
|
-
var l = {
|
|
97
|
-
__proto__: null
|
|
98
|
-
}, r = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
99
|
-
for(var o in e)if ("default" !== o && Object.prototype.hasOwnProperty.call(e, o)) {
|
|
100
|
-
var u = r ? Object.getOwnPropertyDescriptor(e, o) : null;
|
|
101
|
-
u && (u.get || u.set) ? Object.defineProperty(l, o, u) : l[o] = e[o];
|
|
102
|
-
}
|
|
103
|
-
return l.default = e, t && t.set(e, l), l;
|
|
104
|
-
}(require("react")), d = require("react-dom"), v = require("react-feather"), f = require("../../../Functions/fieldValueFormatters"), p = w(require("../../../Functions/useIsMobile/useIsMobile")), m = require("../../../Functions/utils"), h = w(require("../Input/Input")), g = w(require("../RadioInput/RadioInput")), b = w(require("./components/DropdownLoader"));
|
|
105
|
-
function w(e) {
|
|
106
|
-
return e && e.__esModule ? e : {
|
|
107
|
-
default: e
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
function _(e) {
|
|
111
|
-
if ("function" != typeof WeakMap) return null;
|
|
112
|
-
var n = new WeakMap(), t = new WeakMap();
|
|
113
|
-
return (_ = function(e) {
|
|
114
|
-
return e ? t : n;
|
|
115
|
-
})(e);
|
|
116
|
-
}
|
|
117
|
-
require("./Dropdown.scss");
|
|
118
|
-
var y = 'dropdown', j = function(e) {
|
|
119
|
-
var u, w, _, j, x, C, S, E, N, O, L, I, k, P, A, M, D, q = e.label, H = e.options, R = e.value, T = e.error, B = e.disabled, F = e.onChange, K = e.placeholder, W = e.className, U = e.isSearchable, z = e.entity, $ = e.scrollReactionObj, V = e.isListTop, X = e.isNotValidateASCII, G = void 0 !== X && X, J = e.testId, Q = void 0 === J ? 'dropdown' : J, Y = e.sortAlphabetical, Z = void 0 === Y || Y, ee = e.fieldKey, en = e.id, et = e.noOptionsText, el = void 0 === et ? 'No options available' : et, er = e.attributesOfNativeInput, eo = e.isDoNotPullOutListOfMainContainer, ei = e.withMobileLogic, eu = e.withActions, ec = e.minItemsForShowMobileSearch, ea = e.customTrigger, es = e.tabIndex, ed = e.onActionConfirmClick, ev = e.onActionCancelClick, ef = e.isDefaultOpened, ep = (0, p.default)().isMobile, em = ep && ei && window.screen.width <= 768, eh = r((0, s.useState)((en || ee || Math.random().toString(16).slice(2)).toString()), 1)[0], eg = r((0, s.useState)(!1), 2), eb = eg[0], ew = eg[1], e_ = r((0, s.useState)(), 2), ey = e_[0], ej = e_[1], ex = (0, s.useRef)(null), eC = (0, s.useRef)(null), eS = (0, s.useRef)(null), eE = (0, s.useRef)(null), eN = (0, s.useRef)(null), eO = r((0, s.useState)(null), 2), eL = eO[0], eI = eO[1], ek = r((0, s.useState)(!1), 2), eP = ek[0], eA = ek[1], eM = r((0, s.useState)(!1), 2), eD = eM[0], eq = eM[1], eH = r((0, s.useState)(!1), 2), eR = eH[0], eT = eH[1], eB = r((0, s.useState)(!1), 2), eF = eB[0], eK = eB[1], eW = r((0, s.useState)(0), 2), eU = eW[0], ez = eW[1], e$ = r((0, s.useState)(1), 2), eV = e$[0], eX = e$[1], eG = (0, s.useCallback)(function() {
|
|
120
|
-
var e;
|
|
121
|
-
return null != (e = null == H ? void 0 : H.reduce(function(e, n) {
|
|
122
|
-
if ((null == n ? void 0 : n.list) || (null == n ? void 0 : n.items)) {
|
|
123
|
-
var t, l;
|
|
124
|
-
e += (null == n || null == (t = n.list) ? void 0 : t.length) || (null == n || null == (l = n.items) ? void 0 : l.length) || 0;
|
|
125
|
-
} else ++e;
|
|
126
|
-
return e;
|
|
127
|
-
}, 0)) ? e : 0;
|
|
128
|
-
}, [
|
|
129
|
-
H
|
|
130
|
-
]);
|
|
131
|
-
em && (U = eG() > ((void 0 === ec ? 10 : ec) || 10));
|
|
132
|
-
var eJ = function(e) {
|
|
133
|
-
var n = null == e ? void 0 : e.findIndex(function(e) {
|
|
134
|
-
return (null == e ? void 0 : e.value) === 'other';
|
|
135
|
-
});
|
|
136
|
-
if (n > -1) {
|
|
137
|
-
var t = null == e ? void 0 : e.splice(n, 1);
|
|
138
|
-
e.push.apply(e, o(t));
|
|
139
|
-
}
|
|
140
|
-
return e;
|
|
141
|
-
}, eQ = eJ(null != H ? H : []);
|
|
142
|
-
null == H || H.map(function(e) {
|
|
143
|
-
return e.items ? e.items = eJ(e.items) : e;
|
|
144
|
-
});
|
|
145
|
-
var eY = eQ.map(function(e) {
|
|
146
|
-
var n;
|
|
147
|
-
return l(t({}, e), {
|
|
148
|
-
items: U && eP ? null == (n = e.items) ? void 0 : n.slice().filter(function(e) {
|
|
149
|
-
var n;
|
|
150
|
-
return (null == e || null == (n = e.label) ? void 0 : n.toLowerCase().includes((null == ey ? void 0 : ey.toLowerCase()) || '')) || !(null == e ? void 0 : e.value) || (null == e ? void 0 : e.value) === '';
|
|
151
|
-
}) : null == e ? void 0 : e.items
|
|
152
|
-
});
|
|
153
|
-
}).filter(function(e) {
|
|
154
|
-
var n, t;
|
|
155
|
-
return (null != (t = null == (n = e.items) ? void 0 : n.length) ? t : 0) > 0;
|
|
156
|
-
}), eZ = eQ.filter(function(e) {
|
|
157
|
-
var n;
|
|
158
|
-
return !(null == (n = e.items) ? void 0 : n.length);
|
|
159
|
-
}).filter(function(e) {
|
|
160
|
-
var n;
|
|
161
|
-
return !U || !eP || (null == e || null == (n = e.label) ? void 0 : n.toLowerCase().includes((null == ey ? void 0 : ey.toLowerCase()) || '')) || !(null == e ? void 0 : e.value) || (null == e ? void 0 : e.value) === '';
|
|
162
|
-
}), e0 = o(eZ).concat(o(eY)), e1 = function(e) {
|
|
163
|
-
ew(!1), null == F || F(e.value);
|
|
164
|
-
}, e2 = function(e) {
|
|
165
|
-
return !![
|
|
166
|
-
9,
|
|
167
|
-
13
|
|
168
|
-
].includes(e.keyCode) && (ew(!1), !0);
|
|
169
|
-
}, e3 = function(e) {
|
|
170
|
-
return !![
|
|
171
|
-
9,
|
|
172
|
-
13
|
|
173
|
-
].includes(e.keyCode) && (ew(!0), !0);
|
|
174
|
-
}, e6 = function() {
|
|
175
|
-
return document.getElementById(eh);
|
|
176
|
-
}, e8 = function(e) {
|
|
177
|
-
var n;
|
|
178
|
-
(null == (n = e6()) ? void 0 : n.contains(null == e ? void 0 : e.target)) || (null == ex ? void 0 : ex.current) === null || (null == ex ? void 0 : ex.current.contains(null == e ? void 0 : e.target)) || ew(!1);
|
|
179
|
-
}, e9 = function(e) {
|
|
180
|
-
var n = e;
|
|
181
|
-
G || (n = (0, f.formatToOnlyASCIICodeText)(n)), eA(!0), ej(n);
|
|
182
|
-
}, e4 = function(e) {
|
|
183
|
-
e.target === (null == eN ? void 0 : eN.current) && (e.stopPropagation(), e.preventDefault(), ew(!1));
|
|
184
|
-
}, e7 = function(e, n, t) {
|
|
185
|
-
return e = e.replace(/["&<>]/g, function(e) {
|
|
186
|
-
var n;
|
|
187
|
-
return null != (n = ({
|
|
188
|
-
'"': '"',
|
|
189
|
-
'&': '&',
|
|
190
|
-
'<': '<',
|
|
191
|
-
'>': '>'
|
|
192
|
-
})[e]) ? n : '';
|
|
193
|
-
}), (U && ey ? null == e ? void 0 : e.replace(RegExp(null == ey ? void 0 : ey.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&'), 'i'), function(e) {
|
|
194
|
-
return '<span class="bg--yellow">'.concat(e, "</span>");
|
|
195
|
-
}) : e) + (n ? '<span class="dropdown__list-item-postfix">'.concat(n, "</span>") : '') + (t ? '<span class="dropdown__list-item-description">'.concat(t, "</span>") : '');
|
|
196
|
-
}, e5 = (j = z && '' !== z && 'string' == typeof z, x = function(e) {
|
|
197
|
-
'open_modal' === e.value ? null == F || F('open_modal') : e1(e);
|
|
198
|
-
}, C = [
|
|
199
|
-
{
|
|
200
|
-
label: "New ".concat(z),
|
|
201
|
-
value: 'open_modal',
|
|
202
|
-
className: 'dropdown__list-item--modal'
|
|
203
|
-
}
|
|
204
|
-
].concat(o(null != e0 ? e0 : [])), {
|
|
205
|
-
onChange: function(e) {
|
|
206
|
-
return j ? x(e) : e1(e);
|
|
207
|
-
},
|
|
208
|
-
options: j ? C : H
|
|
209
|
-
}), ne = function(e, t, l) {
|
|
210
|
-
var r, o, i, u;
|
|
211
|
-
return (0, c.jsxs)("button", {
|
|
212
|
-
type: "button",
|
|
213
|
-
"data-testid": "".concat(Q, "-").concat(l, "-option"),
|
|
214
|
-
onMouseDown: function() {
|
|
215
|
-
return e5.onChange(e);
|
|
216
|
-
},
|
|
217
|
-
className: (0, a.default)("".concat(y, "__list-item"), (n(u = {}, "".concat(y, "__list-item_active"), e.value === R), n(u, "".concat(y, "__list-item_disabled"), e.disabled), u), e.className),
|
|
218
|
-
children: [
|
|
219
|
-
!em && (0, c.jsx)("span", {
|
|
220
|
-
className: (0, a.default)("".concat(y, "__active-icon"), n({}, "".concat(y, "__active-icon_active"), e.value === R)),
|
|
221
|
-
children: (0, c.jsx)(v.Check, {})
|
|
222
|
-
}),
|
|
223
|
-
(0, c.jsx)("div", {
|
|
224
|
-
className: (0, a.default)("".concat(y, "__list-item-label"), e.labelClassName || ''),
|
|
225
|
-
dangerouslySetInnerHTML: {
|
|
226
|
-
__html: e7(e.label, e.postfix, e.description)
|
|
227
|
-
}
|
|
228
|
-
}),
|
|
229
|
-
(null == e ? void 0 : e.icon) || '',
|
|
230
|
-
em ? null != (i = null == e ? void 0 : e.customMobileIcon) ? i : (0, c.jsx)(g.default, {
|
|
231
|
-
value: e.value,
|
|
232
|
-
checked: null == R ? void 0 : R.toString()
|
|
233
|
-
}) : ''
|
|
234
|
-
]
|
|
235
|
-
}, null == (o = e.value) || null == (r = o.toString()) ? void 0 : r.replace(/ /g, '_'));
|
|
236
|
-
}, nn = function(e) {
|
|
237
|
-
var n, t, l, r, o, i;
|
|
238
|
-
return (null != (i = null == (n = e.items) ? void 0 : n.length) ? i : 0) > 0 ? (0, c.jsxs)("div", {
|
|
239
|
-
className: (0, a.default)("".concat(y, "-group"), e.className),
|
|
240
|
-
children: [
|
|
241
|
-
(0, c.jsx)("div", {
|
|
242
|
-
className: "".concat(y, "-group__name"),
|
|
243
|
-
children: e.label
|
|
244
|
-
}),
|
|
245
|
-
null == (t = e.items) ? void 0 : t.map(function(e, n) {
|
|
246
|
-
var t;
|
|
247
|
-
return ne(e, n, null == (t = (null == e ? void 0 : e.testId) || n) ? void 0 : t.toString());
|
|
248
|
-
})
|
|
249
|
-
]
|
|
250
|
-
}, null == (o = e.label) || null == (r = o.toString()) ? void 0 : r.replace(/ /g, '_').concat(null == (l = Date.now()) ? void 0 : l.toString())) : null;
|
|
251
|
-
}, nt = null != (A = null == H || null == (E = H.find(function(e) {
|
|
252
|
-
return e.value === R;
|
|
253
|
-
})) ? void 0 : E.label) ? A : null == H ? void 0 : H.reduce(function(e, n) {
|
|
254
|
-
var t, l, r;
|
|
255
|
-
return (null == e ? void 0 : e.length) ? e : null != (r = null == (l = n.items) || null == (t = l.find(function(e) {
|
|
256
|
-
return e.value === R;
|
|
257
|
-
})) ? void 0 : t.label) ? r : '';
|
|
258
|
-
}, ''), nl = (0, s.useCallback)(function(e) {
|
|
259
|
-
var n = $ || {}, t = n.callback, l = n.isWithAnyScrolling, r = n.scrollingInaccuracy, o = null == e ? void 0 : e.target;
|
|
260
|
-
t && 'function' == typeof t && (l ? t(e) : Math.round(o.clientHeight + o.scrollTop + (void 0 === r ? 0 : r)) >= o.scrollHeight && t(e));
|
|
261
|
-
}, [
|
|
262
|
-
e0
|
|
263
|
-
]), nr = function() {
|
|
264
|
-
var e, n;
|
|
265
|
-
return eo ? ex.current : null != (n = null != (e = document.querySelector('div#root')) ? e : document.querySelector('div#app')) ? n : document.querySelector('div#storybook-root');
|
|
266
|
-
}, no = function() {
|
|
267
|
-
var e = document.createElement('div');
|
|
268
|
-
e.setAttribute('id', eh), e.classList.add('dropdown__container'), em && e.addEventListener('click', function(e) {
|
|
269
|
-
(null == e ? void 0 : e.target).id === eh && ew(!1);
|
|
270
|
-
});
|
|
271
|
-
try {
|
|
272
|
-
null == (n = e6()) || n.remove();
|
|
273
|
-
} finally{
|
|
274
|
-
if (em) {
|
|
275
|
-
try {
|
|
276
|
-
null == (r = document.getElementById("mlw-".concat(eh))) || r.remove();
|
|
277
|
-
} catch (e) {}
|
|
278
|
-
var n, t, l, r, o = document.createElement('div');
|
|
279
|
-
o.classList.add('dropdown-mobile'), o.setAttribute('id', "mlw-".concat(eh)), null == o || o.append(e), null == (l = nr()) || l.append(o);
|
|
280
|
-
} else null == (t = nr()) || t.append(e);
|
|
281
|
-
}
|
|
282
|
-
}, ni = function() {
|
|
283
|
-
var e, n, t, l, r, o, i, u, c, a, s, d, v, f, p, m, h = e6();
|
|
284
|
-
if (!h || !eb) return !1;
|
|
285
|
-
var g = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight, b = null != (v = null == ex || null == (e = ex.current) ? void 0 : e.getBoundingClientRect()) ? v : {}, w = b.width, _ = b.height, y = void 0 === _ ? 0 : _, j = b.left, x = b.top, C = void 0 === x ? 0 : x, S = h.getElementsByClassName('dropdown__list')[0], E = null == eS || null == (n = eS.current) ? void 0 : n.getElementsByClassName('dropdown__list-header')[0], N = Number.parseInt(null != (f = null == (l = getComputedStyle(null == eS ? void 0 : eS.current)) || null == (t = l.marginTop) ? void 0 : t.replace('px', '')) ? f : 0, 10), O = null != eL ? eL : Number.parseInt(null != (p = null == (o = getComputedStyle(S)) || null == (r = o.maxHeight) ? void 0 : r.replace('px', '')) ? p : 0, 10);
|
|
286
|
-
null === eL && eI(O);
|
|
287
|
-
var L = C - N, I = g - C - y - 2 * N, k = null == S || null == (i = S.getBoundingClientRect()) ? void 0 : i.height, P = em ? (null == eS || null == (c = eS.current) || null == (u = c.getBoundingClientRect()) ? void 0 : u.height) - (null == E || null == (a = E.getBoundingClientRect()) ? void 0 : a.height) : L >= O || I >= O ? O - 3 * N : L > I ? L - 3 * N : I - 4 * N;
|
|
288
|
-
return h.style.minWidth = "".concat(w, "px"), h.style.left = "".concat(j, "px"), h.style.top = "".concat('bottom' == (L < I || I >= k ? 'bottom' : 'top') ? C + y : C - 3 * N - Number.parseInt(null != (m = null == (d = getComputedStyle(null == eS ? void 0 : eS.current)) || null == (s = d.height) ? void 0 : s.replace('px', '')) ? m : 0, 10), "px"), S.style.maxHeight = "".concat(P, "px"), !0;
|
|
289
|
-
}, nu = function(e) {
|
|
290
|
-
var n = o(e);
|
|
291
|
-
if (Z) {
|
|
292
|
-
var t = n.filter(function(e) {
|
|
293
|
-
return 'open_modal' === e.value;
|
|
294
|
-
}), l = n.filter(function(e) {
|
|
295
|
-
return '' === e.value;
|
|
296
|
-
}), r = n.filter(function(e) {
|
|
297
|
-
var n = e.value;
|
|
298
|
-
return 'open_modal' !== n && '' !== n;
|
|
299
|
-
}).sort(m.compareAlphabetical);
|
|
300
|
-
n = o(t).concat(o(l), o(r)).map(function(e) {
|
|
301
|
-
return (null == e ? void 0 : e.items) && (e.items = o(e.items).sort(m.compareAlphabetical)), e;
|
|
302
|
-
});
|
|
303
|
-
}
|
|
304
|
-
return n;
|
|
305
|
-
}, nc = eb ? e8 : function() {};
|
|
306
|
-
(0, s.useEffect)(function() {
|
|
307
|
-
(!eo || ex.current) && (no(), ef && !ep && ew(!0));
|
|
308
|
-
}, [
|
|
309
|
-
eo,
|
|
310
|
-
ex.current
|
|
311
|
-
]), (0, s.useLayoutEffect)(function() {
|
|
312
|
-
var e;
|
|
313
|
-
return em ? (window.removeEventListener('resize', ni), window.removeEventListener('mousewheel', nc), window.removeEventListener('scroll', nc), window.removeEventListener('touchmove', nc)) : (window.addEventListener('resize', ni), window.addEventListener('mousewheel', nc), window.addEventListener('scroll', nc), window.addEventListener('touchmove', nc)), null == (e = e6()) || e.addEventListener('click', nc), function() {
|
|
314
|
-
var e;
|
|
315
|
-
window.removeEventListener('resize', ni), window.removeEventListener('mousewheel', nc), window.removeEventListener('scroll', nc), window.removeEventListener('touchmove', nc), null == (e = e6()) || e.removeEventListener('click', nc);
|
|
316
|
-
};
|
|
317
|
-
}, [
|
|
318
|
-
e6
|
|
319
|
-
]), (0, s.useLayoutEffect)(function() {
|
|
320
|
-
ni();
|
|
321
|
-
}, [
|
|
322
|
-
eb,
|
|
323
|
-
ey,
|
|
324
|
-
em,
|
|
325
|
-
H,
|
|
326
|
-
null == eS || null == (O = eS.current) || null == (N = O.getBoundingClientRect()) ? void 0 : N.height
|
|
327
|
-
]), (0, s.useEffect)(function() {
|
|
328
|
-
return document.addEventListener('click', e8, !0), function() {
|
|
329
|
-
return document.removeEventListener('click', e8, !0);
|
|
330
|
-
};
|
|
331
|
-
}, []), (0, s.useEffect)(function() {
|
|
332
|
-
return eb || eA(!1), $ && (void 0 === $ ? "undefined" : i($)) === 'object' && eb && eC && eC.current && eC.current.addEventListener('scroll', nl), function() {
|
|
333
|
-
$ && (void 0 === $ ? "undefined" : i($)) === 'object' && removeEventListener('scroll', nl);
|
|
334
|
-
};
|
|
335
|
-
}, [
|
|
336
|
-
eb,
|
|
337
|
-
eC
|
|
338
|
-
]), (0, s.useEffect)(function() {
|
|
339
|
-
var e;
|
|
340
|
-
return !ey && eD && (ej(nt), e = setTimeout(function() {
|
|
341
|
-
return eE.current.select();
|
|
342
|
-
}, 1)), eD || eb || ej(null), function() {
|
|
343
|
-
clearTimeout(e);
|
|
344
|
-
};
|
|
345
|
-
}, [
|
|
346
|
-
eD
|
|
347
|
-
]), (0, s.useEffect)(function() {
|
|
348
|
-
var e, n, t, l;
|
|
349
|
-
eb && !eD && (null == eE ? void 0 : eE.current) && !em && (null == (e = eE.current) || e.focus()), eb ? null == (n = e6()) || n.classList.add('dropdown__container--opened') : (null == (t = eE.current) || t.blur(), null == (l = e6()) || l.classList.remove('dropdown__container--opened')), !eb && em && ej(null);
|
|
350
|
-
}, [
|
|
351
|
-
eb
|
|
352
|
-
]), (0, s.useEffect)(function() {
|
|
353
|
-
if (eb && em && (null == eC ? void 0 : eC.current) && !ey) {
|
|
354
|
-
var e, n, t, l;
|
|
355
|
-
eT((null == eC || null == (e = eC.current) ? void 0 : e.scrollHeight) > (null == eC || null == (n = eC.current) ? void 0 : n.clientHeight)), eK(eR || (null == eC || null == (t = eC.current) ? void 0 : t.scrollHeight) > (null == eC || null == (l = eC.current) ? void 0 : l.clientHeight));
|
|
356
|
-
}
|
|
357
|
-
}, [
|
|
358
|
-
eb,
|
|
359
|
-
em,
|
|
360
|
-
eR,
|
|
361
|
-
null == eC ? void 0 : eC.current,
|
|
362
|
-
null == eC || null == (L = eC.current) ? void 0 : L.scrollHeight,
|
|
363
|
-
null == eC || null == (I = eC.current) ? void 0 : I.clientHeight
|
|
364
|
-
]), (0, s.useEffect)(function() {
|
|
365
|
-
var e, n = function(e) {
|
|
366
|
-
var n, t;
|
|
367
|
-
ez(Number.parseInt(null == e || null == (t = e.target) || null == (n = t.scrollTop) ? void 0 : n.toString(), 10));
|
|
368
|
-
};
|
|
369
|
-
return eb && em && (null == eC ? void 0 : eC.current) && (null == eC || null == (e = eC.current) || e.addEventListener('scroll', n)), function() {
|
|
370
|
-
if ((null == eC ? void 0 : eC.current) !== null) {
|
|
371
|
-
var e;
|
|
372
|
-
null == eC || null == (e = eC.current) || e.removeEventListener('scroll', n);
|
|
373
|
-
}
|
|
374
|
-
};
|
|
375
|
-
}, [
|
|
376
|
-
eb,
|
|
377
|
-
em,
|
|
378
|
-
null == eC ? void 0 : eC.current
|
|
379
|
-
]), (0, s.useEffect)(function() {
|
|
380
|
-
if (null == eC ? void 0 : eC.current) {
|
|
381
|
-
var e, n;
|
|
382
|
-
eX(Number.parseInt(((null == eC || null == (e = eC.current) ? void 0 : e.scrollHeight) - (null == eC || null == (n = eC.current) ? void 0 : n.clientHeight)).toString(), 10));
|
|
383
|
-
}
|
|
384
|
-
}, [
|
|
385
|
-
eU,
|
|
386
|
-
null == eC ? void 0 : eC.current
|
|
387
|
-
]), (0, s.useEffect)(function() {
|
|
388
|
-
return function() {
|
|
389
|
-
var e, n;
|
|
390
|
-
null == (e = e6()) || e.remove(), null == (n = document.getElementById("mlw-".concat(eh))) || n.remove();
|
|
391
|
-
};
|
|
392
|
-
}, []);
|
|
393
|
-
var na = nt && (null == (k = e0.find(function(e) {
|
|
394
|
-
return e.value === R;
|
|
395
|
-
})) ? void 0 : k.postfix) || null;
|
|
396
|
-
if (!H) return null;
|
|
397
|
-
return (0, c.jsxs)("div", {
|
|
398
|
-
className: (0, a.default)(y, W, (n(M = {
|
|
399
|
-
disabled: B
|
|
400
|
-
}, "".concat(y, "-mobile"), em), n(M, "".concat(y, "--focused"), eb && !em), n(M, "".concat(y, "--with-custom-trigger"), !!ea), M)),
|
|
401
|
-
ref: ex,
|
|
402
|
-
onKeyDown: e2,
|
|
403
|
-
onKeyUp: e3,
|
|
404
|
-
children: [
|
|
405
|
-
(0, c.jsx)("button", {
|
|
406
|
-
type: "button",
|
|
407
|
-
"data-testid": Q,
|
|
408
|
-
className: (0, a.default)("".concat(y, "__trigger"), 'input__wrap', (n(D = {}, "".concat(y, "__trigger--with-actions"), eu), n(D, "placeholder", !R), n(D, "error", T), D)),
|
|
409
|
-
onClick: function() {
|
|
410
|
-
return ew(!0);
|
|
411
|
-
},
|
|
412
|
-
onKeyDown: e2,
|
|
413
|
-
onKeyUp: e3,
|
|
414
|
-
tabIndex: es,
|
|
415
|
-
children: ea || (0, c.jsxs)(c.Fragment, {
|
|
416
|
-
children: [
|
|
417
|
-
U && !em ? (0, c.jsx)("input", l(t({
|
|
418
|
-
ref: eE,
|
|
419
|
-
className: "".concat(y, "__input"),
|
|
420
|
-
value: null == (P = eb ? null != ey ? ey : '' : null != nt ? nt : '') ? void 0 : P.toString(),
|
|
421
|
-
onChange: function(e) {
|
|
422
|
-
return e9(e.target.value);
|
|
423
|
-
},
|
|
424
|
-
placeholder: K,
|
|
425
|
-
onFocus: function() {
|
|
426
|
-
return eq(!0);
|
|
427
|
-
},
|
|
428
|
-
onBlur: function() {
|
|
429
|
-
return eq(!1);
|
|
430
|
-
},
|
|
431
|
-
onMouseDown: function() {
|
|
432
|
-
eb || eq(!0);
|
|
433
|
-
}
|
|
434
|
-
}, er), {
|
|
435
|
-
tabIndex: -1
|
|
436
|
-
})) : (0, c.jsxs)(c.Fragment, {
|
|
437
|
-
children: [
|
|
438
|
-
(0, c.jsx)("span", {
|
|
439
|
-
className: "text",
|
|
440
|
-
children: nt || K || ''
|
|
441
|
-
}),
|
|
442
|
-
na && (0, c.jsx)("span", {
|
|
443
|
-
className: "dropdown__list-item-postfix",
|
|
444
|
-
children: na
|
|
445
|
-
})
|
|
446
|
-
]
|
|
447
|
-
}),
|
|
448
|
-
(0, c.jsx)("span", {
|
|
449
|
-
className: (0, a.default)("".concat(y, "__arrow"), n({}, "".concat(y, "__arrow_active"), eb)),
|
|
450
|
-
onClick: function(e) {
|
|
451
|
-
null == e || e.stopPropagation(), ew(function(e) {
|
|
452
|
-
return !e;
|
|
453
|
-
});
|
|
454
|
-
},
|
|
455
|
-
children: em ? (0, c.jsx)(v.Code, {
|
|
456
|
-
className: "mobile-icon"
|
|
457
|
-
}) : eb ? (0, c.jsx)(v.ChevronUp, {}) : (0, c.jsx)(v.ChevronDown, {})
|
|
458
|
-
})
|
|
459
|
-
]
|
|
460
|
-
})
|
|
461
|
-
}),
|
|
462
|
-
eu && (0, c.jsxs)("div", {
|
|
463
|
-
className: (0, a.default)("".concat(y, "__actions")),
|
|
464
|
-
children: [
|
|
465
|
-
(0, c.jsx)("div", {
|
|
466
|
-
className: (0, a.default)("".concat(y, "__actions-item")),
|
|
467
|
-
onClick: ed,
|
|
468
|
-
children: (0, c.jsx)(v.Check, {})
|
|
469
|
-
}),
|
|
470
|
-
(0, c.jsx)("div", {
|
|
471
|
-
className: (0, a.default)("".concat(y, "__actions-item")),
|
|
472
|
-
onClick: ev,
|
|
473
|
-
children: (0, c.jsx)(v.X, {})
|
|
474
|
-
})
|
|
475
|
-
]
|
|
476
|
-
}),
|
|
477
|
-
eb && ((S = e6()) ? (0, d.createPortal)((0, c.jsx)("div", {
|
|
478
|
-
"data-testid": "".concat(Q, "-container-wrapper"),
|
|
479
|
-
className: (0, a.default)("".concat(y, "__container-wrapper")),
|
|
480
|
-
ref: eN,
|
|
481
|
-
onClick: em ? e4 : function() {},
|
|
482
|
-
children: (0, c.jsxs)("div", {
|
|
483
|
-
className: (0, a.default)("".concat(y, "__list-wrapper"), (n(w = {}, "".concat(y, "__list-wrapper--fixed-height"), eF), n(w, "".concat(y, "__list-wrapper--with-bottom-shadow"), eR && em), n(w, "".concat(y, "__list-wrapper--with-bottom-shadow-hidden"), eU === eV), w)),
|
|
484
|
-
ref: eS,
|
|
485
|
-
children: [
|
|
486
|
-
em && (0, c.jsxs)("div", {
|
|
487
|
-
className: (0, a.default)("".concat(y, "__list-header"), (n(_ = {}, "".concat(y, "__list-header-with-shadow"), eR && em), n(_, "".concat(y, "__list-header-with-shadow-hidden"), 0 === eU), _)),
|
|
488
|
-
children: [
|
|
489
|
-
(0, c.jsxs)("div", {
|
|
490
|
-
className: (0, a.default)("".concat(y, "__list-header-row")),
|
|
491
|
-
children: [
|
|
492
|
-
(0, c.jsx)("div", {
|
|
493
|
-
className: (0, a.default)("".concat(y, "__list-label")),
|
|
494
|
-
children: q
|
|
495
|
-
}),
|
|
496
|
-
(0, c.jsx)("div", {
|
|
497
|
-
className: (0, a.default)("".concat(y, "__list-close-icon")),
|
|
498
|
-
onClick: function() {
|
|
499
|
-
return ew(!1);
|
|
500
|
-
},
|
|
501
|
-
children: (0, c.jsx)(v.X, {
|
|
502
|
-
onClick: function() {
|
|
503
|
-
return ew(!1);
|
|
504
|
-
}
|
|
505
|
-
})
|
|
506
|
-
})
|
|
507
|
-
]
|
|
508
|
-
}),
|
|
509
|
-
U && (0, c.jsx)("div", {
|
|
510
|
-
className: (0, a.default)("".concat(y, "__list-header-row")),
|
|
511
|
-
children: (0, c.jsx)(h.default, t({
|
|
512
|
-
ref: eE,
|
|
513
|
-
className: "".concat(y, "__input"),
|
|
514
|
-
value: null != ey ? ey : nt,
|
|
515
|
-
onChange: e9,
|
|
516
|
-
placeholder: K || 'Search',
|
|
517
|
-
withDelete: !0,
|
|
518
|
-
onFocus: function() {
|
|
519
|
-
return eq(!0);
|
|
520
|
-
},
|
|
521
|
-
onBlur: function() {
|
|
522
|
-
return eq(!1);
|
|
523
|
-
},
|
|
524
|
-
onMouseDown: function() {
|
|
525
|
-
eb || eq(!0);
|
|
526
|
-
}
|
|
527
|
-
}, er))
|
|
528
|
-
})
|
|
529
|
-
]
|
|
530
|
-
}),
|
|
531
|
-
(0, c.jsxs)("div", {
|
|
532
|
-
className: (0, a.default)("".concat(y, "__list"), n({}, "".concat(y, "__list-top"), V)),
|
|
533
|
-
ref: eC,
|
|
534
|
-
children: [
|
|
535
|
-
e5.options && (null == (u = nu(e5.options)) ? void 0 : u.map(function(e, n) {
|
|
536
|
-
if (null == e || null == (o = e.items) ? void 0 : o.length) if (!U || !eP) return nn(e);
|
|
537
|
-
else {
|
|
538
|
-
var r, o, i, u, c = null == (u = e.items) ? void 0 : u.slice().filter(function(e) {
|
|
539
|
-
var n;
|
|
540
|
-
return (null == e || null == (n = e.label) ? void 0 : n.toLowerCase().includes((null == ey ? void 0 : ey.toLowerCase()) || '')) || !(null == e ? void 0 : e.value) || (null == e ? void 0 : e.value) === '';
|
|
541
|
-
});
|
|
542
|
-
if (null == c ? void 0 : c.length) return nn(l(t({}, e), {
|
|
543
|
-
items: c
|
|
544
|
-
}));
|
|
545
|
-
}
|
|
546
|
-
else if (!U || !eP || (null == e || null == (i = e.label) ? void 0 : i.toLowerCase().includes((null == ey ? void 0 : ey.toLowerCase()) || '')) || !(null == e ? void 0 : e.value) || (null == e ? void 0 : e.value) === '') return ne(e, n, null == (r = (null == e ? void 0 : e.testId) || n) ? void 0 : r.toString());
|
|
547
|
-
return null;
|
|
548
|
-
})),
|
|
549
|
-
!eZ.length && !eY.length && (0, c.jsx)("div", {
|
|
550
|
-
className: "".concat(y, "__list-item ").concat(y, "__list-item--no-options"),
|
|
551
|
-
children: el
|
|
552
|
-
}),
|
|
553
|
-
B && eb && (0, c.jsx)(b.default, {})
|
|
554
|
-
]
|
|
555
|
-
})
|
|
556
|
-
]
|
|
557
|
-
})
|
|
558
|
-
}), S) : null)
|
|
559
|
-
]
|
|
560
|
-
});
|
|
561
|
-
};
|
|
1
|
+
function e(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,l=Array(n);t<n;t++)l[t]=e[t];return l}function n(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function t(e){for(var t=1;t<arguments.length;t++){var l=null!=arguments[t]?arguments[t]:{},r=Object.keys(l);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(l).filter(function(e){return Object.getOwnPropertyDescriptor(l,e).enumerable}))),r.forEach(function(t){n(e,t,l[t])})}return e}function l(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):(function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t.push.apply(t,l)}return t})(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}function r(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t,l,r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,u=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){u=!0,l=e}finally{try{i||null==r.return||r.return()}finally{if(u)throw l}}return o}}(e,n)||u(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 o(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)||u(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(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function u(n,t){if(n){if("string"==typeof n)return e(n,t);var l=Object.prototype.toString.call(n).slice(8,-1);if("Object"===l&&n.constructor&&(l=n.constructor.name),"Map"===l||"Set"===l)return Array.from(l);if("Arguments"===l||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return e(n,t)}}Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return j}});var c=require("react/jsx-runtime"),a=w(require("classnames")),s=function(e,n){if(e&&e.__esModule)return e;if(null===e||(void 0===e?"undefined":i(e))!=="object"&&"function"!=typeof e)return{default:e};var t=_(n);if(t&&t.has(e))return t.get(e);var l={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var u=r?Object.getOwnPropertyDescriptor(e,o):null;u&&(u.get||u.set)?Object.defineProperty(l,o,u):l[o]=e[o]}return l.default=e,t&&t.set(e,l),l}(require("react")),d=require("react-dom"),v=require("react-feather"),f=require("../../../Functions/fieldValueFormatters"),p=w(require("../../../Functions/useIsMobile/useIsMobile")),m=require("../../../Functions/utils"),h=w(require("../Input/Input")),g=w(require("../RadioInput/RadioInput")),b=w(require("./components/DropdownLoader"));function w(e){return e&&e.__esModule?e:{default:e}}function _(e){if("function"!=typeof WeakMap)return null;var n=new WeakMap,t=new WeakMap;return(_=function(e){return e?t:n})(e)}require("./Dropdown.scss");var y="dropdown",j=function(e){var u,w,_,j,x,C,S,E,N,O,L,I,k,P,A,M,D,q=e.label,H=e.options,R=e.value,T=e.error,B=e.disabled,F=e.onChange,K=e.placeholder,W=e.className,U=e.isSearchable,z=e.entity,$=e.scrollReactionObj,V=e.isListTop,X=e.isNotValidateASCII,G=void 0!==X&&X,J=e.testId,Q=void 0===J?"dropdown":J,Y=e.sortAlphabetical,Z=void 0===Y||Y,ee=e.fieldKey,en=e.id,et=e.noOptionsText,el=void 0===et?"No options available":et,er=e.attributesOfNativeInput,eo=e.isDoNotPullOutListOfMainContainer,ei=e.withMobileLogic,eu=e.withActions,ec=e.minItemsForShowMobileSearch,ea=e.customTrigger,es=e.tabIndex,ed=e.onActionConfirmClick,ev=e.onActionCancelClick,ef=e.isDefaultOpened,ep=(0,p.default)().isMobile,em=ep&&ei&&window.screen.width<=768,eh=r((0,s.useState)((en||ee||Math.random().toString(16).slice(2)).toString()),1)[0],eg=r((0,s.useState)(!1),2),eb=eg[0],ew=eg[1],e_=r((0,s.useState)(),2),ey=e_[0],ej=e_[1],ex=(0,s.useRef)(null),eC=(0,s.useRef)(null),eS=(0,s.useRef)(null),eE=(0,s.useRef)(null),eN=(0,s.useRef)(null),eO=r((0,s.useState)(null),2),eL=eO[0],eI=eO[1],ek=r((0,s.useState)(!1),2),eP=ek[0],eA=ek[1],eM=r((0,s.useState)(!1),2),eD=eM[0],eq=eM[1],eH=r((0,s.useState)(!1),2),eR=eH[0],eT=eH[1],eB=r((0,s.useState)(!1),2),eF=eB[0],eK=eB[1],eW=r((0,s.useState)(0),2),eU=eW[0],ez=eW[1],e$=r((0,s.useState)(1),2),eV=e$[0],eX=e$[1],eG=(0,s.useCallback)(function(){var e;return null!=(e=null==H?void 0:H.reduce(function(e,n){if((null==n?void 0:n.list)||(null==n?void 0:n.items)){var t,l;e+=(null==n||null==(t=n.list)?void 0:t.length)||(null==n||null==(l=n.items)?void 0:l.length)||0}else++e;return e},0))?e:0},[H]);em&&(U=eG()>((void 0===ec?10:ec)||10));var eJ=function(e){var n=null==e?void 0:e.findIndex(function(e){return(null==e?void 0:e.value)==="other"});if(n>-1){var t=null==e?void 0:e.splice(n,1);e.push.apply(e,o(t))}return e},eQ=eJ(null!=H?H:[]);null==H||H.map(function(e){return e.items?e.items=eJ(e.items):e});var eY=eQ.map(function(e){var n;return l(t({},e),{items:U&&eP?null==(n=e.items)?void 0:n.slice().filter(function(e){var n;return(null==e||null==(n=e.label)?void 0:n.toLowerCase().includes((null==ey?void 0:ey.toLowerCase())||""))||!(null==e?void 0:e.value)||(null==e?void 0:e.value)===""}):null==e?void 0:e.items})}).filter(function(e){var n,t;return(null!=(t=null==(n=e.items)?void 0:n.length)?t:0)>0}),eZ=eQ.filter(function(e){var n;return!(null==(n=e.items)?void 0:n.length)}).filter(function(e){var n;return!U||!eP||(null==e||null==(n=e.label)?void 0:n.toLowerCase().includes((null==ey?void 0:ey.toLowerCase())||""))||!(null==e?void 0:e.value)||(null==e?void 0:e.value)===""}),e0=o(eZ).concat(o(eY)),e1=function(e){ew(!1),null==F||F(e.value)},e2=function(e){return!![9,13].includes(e.keyCode)&&(ew(!1),!0)},e3=function(e){return!![9,13].includes(e.keyCode)&&(ew(!0),!0)},e6=function(){return document.getElementById(eh)},e8=function(e){var n;(null==(n=e6())?void 0:n.contains(null==e?void 0:e.target))||(null==ex?void 0:ex.current)===null||(null==ex?void 0:ex.current.contains(null==e?void 0:e.target))||ew(!1)},e9=function(e){var n=e;G||(n=(0,f.formatToOnlyASCIICodeText)(n)),eA(!0),ej(n)},e4=function(e){e.target===(null==eN?void 0:eN.current)&&(e.stopPropagation(),e.preventDefault(),ew(!1))},e7=function(e,n,t){return e=e.replace(/["&<>]/g,function(e){var n;return null!=(n=({'"':""","&":"&","<":"<",">":">"})[e])?n:""}),(U&&ey?null==e?void 0:e.replace(RegExp(null==ey?void 0:ey.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&"),"i"),function(e){return'<span class="bg--yellow">'.concat(e,"</span>")}):e)+(n?'<span class="dropdown__list-item-postfix">'.concat(n,"</span>"):"")+(t?'<span class="dropdown__list-item-description">'.concat(t,"</span>"):"")},e5=(j=z&&""!==z&&"string"==typeof z,x=function(e){"open_modal"===e.value?null==F||F("open_modal"):e1(e)},C=[{label:"New ".concat(z),value:"open_modal",className:"dropdown__list-item--modal"}].concat(o(null!=e0?e0:[])),{onChange:function(e){return j?x(e):e1(e)},options:j?C:H}),ne=function(e,t,l){var r,o,i,u;return(0,c.jsxs)("button",{type:"button","data-testid":"".concat(Q,"-").concat(l,"-option"),onMouseDown:function(){return e5.onChange(e)},className:(0,a.default)("".concat(y,"__list-item"),(n(u={},"".concat(y,"__list-item_active"),e.value===R),n(u,"".concat(y,"__list-item_disabled"),e.disabled),u),e.className),children:[!em&&(0,c.jsx)("span",{className:(0,a.default)("".concat(y,"__active-icon"),n({},"".concat(y,"__active-icon_active"),e.value===R)),children:(0,c.jsx)(v.Check,{})}),(0,c.jsx)("div",{className:(0,a.default)("".concat(y,"__list-item-label"),e.labelClassName||""),dangerouslySetInnerHTML:{__html:e7(e.label,e.postfix,e.description)}}),(null==e?void 0:e.icon)||"",em?null!=(i=null==e?void 0:e.customMobileIcon)?i:(0,c.jsx)(g.default,{value:e.value,checked:null==R?void 0:R.toString()}):""]},null==(o=e.value)||null==(r=o.toString())?void 0:r.replace(/ /g,"_"))},nn=function(e){var n,t,l,r,o,i;return(null!=(i=null==(n=e.items)?void 0:n.length)?i:0)>0?(0,c.jsxs)("div",{className:(0,a.default)("".concat(y,"-group"),e.className),children:[(0,c.jsx)("div",{className:"".concat(y,"-group__name"),children:e.label}),null==(t=e.items)?void 0:t.map(function(e,n){var t;return ne(e,n,null==(t=(null==e?void 0:e.testId)||n)?void 0:t.toString())})]},null==(o=e.label)||null==(r=o.toString())?void 0:r.replace(/ /g,"_").concat(null==(l=Date.now())?void 0:l.toString())):null},nt=null!=(A=null==H||null==(E=H.find(function(e){return e.value===R}))?void 0:E.label)?A:null==H?void 0:H.reduce(function(e,n){var t,l,r;return(null==e?void 0:e.length)?e:null!=(r=null==(l=n.items)||null==(t=l.find(function(e){return e.value===R}))?void 0:t.label)?r:""},""),nl=(0,s.useCallback)(function(e){var n=$||{},t=n.callback,l=n.isWithAnyScrolling,r=n.scrollingInaccuracy,o=null==e?void 0:e.target;t&&"function"==typeof t&&(l?t(e):Math.round(o.clientHeight+o.scrollTop+(void 0===r?0:r))>=o.scrollHeight&&t(e))},[e0]),nr=function(){var e,n;return eo?ex.current:null!=(n=null!=(e=document.querySelector("div#root"))?e:document.querySelector("div#app"))?n:document.querySelector("div#storybook-root")},no=function(){var e=document.createElement("div");e.setAttribute("id",eh),e.classList.add("dropdown__container"),em&&e.addEventListener("click",function(e){(null==e?void 0:e.target).id===eh&&ew(!1)});try{null==(n=e6())||n.remove()}finally{if(em){try{null==(r=document.getElementById("mlw-".concat(eh)))||r.remove()}catch(e){}var n,t,l,r,o=document.createElement("div");o.classList.add("dropdown-mobile"),o.setAttribute("id","mlw-".concat(eh)),null==o||o.append(e),null==(l=nr())||l.append(o)}else null==(t=nr())||t.append(e)}},ni=function(){var e,n,t,l,r,o,i,u,c,a,s,d,v,f,p,m,h=e6();if(!h||!eb)return!1;var g=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,b=null!=(v=null==ex||null==(e=ex.current)?void 0:e.getBoundingClientRect())?v:{},w=b.width,_=b.height,y=void 0===_?0:_,j=b.left,x=b.top,C=void 0===x?0:x,S=h.getElementsByClassName("dropdown__list")[0],E=null==eS||null==(n=eS.current)?void 0:n.getElementsByClassName("dropdown__list-header")[0],N=Number.parseInt(null!=(f=null==(l=getComputedStyle(null==eS?void 0:eS.current))||null==(t=l.marginTop)?void 0:t.replace("px",""))?f:0,10),O=null!=eL?eL:Number.parseInt(null!=(p=null==(o=getComputedStyle(S))||null==(r=o.maxHeight)?void 0:r.replace("px",""))?p:0,10);null===eL&&eI(O);var L=C-N,I=g-C-y-2*N,k=null==S||null==(i=S.getBoundingClientRect())?void 0:i.height,P=em?(null==eS||null==(c=eS.current)||null==(u=c.getBoundingClientRect())?void 0:u.height)-(null==E||null==(a=E.getBoundingClientRect())?void 0:a.height):L>=O||I>=O?O-3*N:L>I?L-3*N:I-4*N;return h.style.minWidth="".concat(w,"px"),h.style.left="".concat(j,"px"),h.style.top="".concat("bottom"==(L<I||I>=k?"bottom":"top")?C+y:C-3*N-Number.parseInt(null!=(m=null==(d=getComputedStyle(null==eS?void 0:eS.current))||null==(s=d.height)?void 0:s.replace("px",""))?m:0,10),"px"),S.style.maxHeight="".concat(P,"px"),!0},nu=function(e){var n=o(e);if(Z){var t=n.filter(function(e){return"open_modal"===e.value}),l=n.filter(function(e){return""===e.value}),r=n.filter(function(e){var n=e.value;return"open_modal"!==n&&""!==n}).sort(m.compareAlphabetical);n=o(t).concat(o(l),o(r)).map(function(e){return(null==e?void 0:e.items)&&(e.items=o(e.items).sort(m.compareAlphabetical)),e})}return n},nc=eb?e8:function(){};(0,s.useEffect)(function(){(!eo||ex.current)&&(no(),ef&&!ep&&ew(!0))},[eo,ex.current]),(0,s.useLayoutEffect)(function(){var e;return em?(window.removeEventListener("resize",ni),window.removeEventListener("mousewheel",nc),window.removeEventListener("scroll",nc),window.removeEventListener("touchmove",nc)):(window.addEventListener("resize",ni),window.addEventListener("mousewheel",nc),window.addEventListener("scroll",nc),window.addEventListener("touchmove",nc)),null==(e=e6())||e.addEventListener("click",nc),function(){var e;window.removeEventListener("resize",ni),window.removeEventListener("mousewheel",nc),window.removeEventListener("scroll",nc),window.removeEventListener("touchmove",nc),null==(e=e6())||e.removeEventListener("click",nc)}},[e6]),(0,s.useLayoutEffect)(function(){ni()},[eb,ey,em,H,null==eS||null==(O=eS.current)||null==(N=O.getBoundingClientRect())?void 0:N.height]),(0,s.useEffect)(function(){return document.addEventListener("click",e8,!0),function(){return document.removeEventListener("click",e8,!0)}},[]),(0,s.useEffect)(function(){return eb||eA(!1),$&&(void 0===$?"undefined":i($))==="object"&&eb&&eC&&eC.current&&eC.current.addEventListener("scroll",nl),function(){$&&(void 0===$?"undefined":i($))==="object"&&removeEventListener("scroll",nl)}},[eb,eC]),(0,s.useEffect)(function(){var e;return!ey&&eD&&(ej(nt),e=setTimeout(function(){return eE.current.select()},1)),eD||eb||ej(null),function(){clearTimeout(e)}},[eD]),(0,s.useEffect)(function(){var e,n,t,l;eb&&!eD&&(null==eE?void 0:eE.current)&&!em&&(null==(e=eE.current)||e.focus()),eb?null==(n=e6())||n.classList.add("dropdown__container--opened"):(null==(t=eE.current)||t.blur(),null==(l=e6())||l.classList.remove("dropdown__container--opened")),!eb&&em&&ej(null)},[eb]),(0,s.useEffect)(function(){if(eb&&em&&(null==eC?void 0:eC.current)&&!ey){var e,n,t,l;eT((null==eC||null==(e=eC.current)?void 0:e.scrollHeight)>(null==eC||null==(n=eC.current)?void 0:n.clientHeight)),eK(eR||(null==eC||null==(t=eC.current)?void 0:t.scrollHeight)>(null==eC||null==(l=eC.current)?void 0:l.clientHeight))}},[eb,em,eR,null==eC?void 0:eC.current,null==eC||null==(L=eC.current)?void 0:L.scrollHeight,null==eC||null==(I=eC.current)?void 0:I.clientHeight]),(0,s.useEffect)(function(){var e,n=function(e){var n,t;ez(Number.parseInt(null==e||null==(t=e.target)||null==(n=t.scrollTop)?void 0:n.toString(),10))};return eb&&em&&(null==eC?void 0:eC.current)&&(null==eC||null==(e=eC.current)||e.addEventListener("scroll",n)),function(){if((null==eC?void 0:eC.current)!==null){var e;null==eC||null==(e=eC.current)||e.removeEventListener("scroll",n)}}},[eb,em,null==eC?void 0:eC.current]),(0,s.useEffect)(function(){if(null==eC?void 0:eC.current){var e,n;eX(Number.parseInt(((null==eC||null==(e=eC.current)?void 0:e.scrollHeight)-(null==eC||null==(n=eC.current)?void 0:n.clientHeight)).toString(),10))}},[eU,null==eC?void 0:eC.current]),(0,s.useEffect)(function(){return function(){var e,n;null==(e=e6())||e.remove(),null==(n=document.getElementById("mlw-".concat(eh)))||n.remove()}},[]);var na=nt&&(null==(k=e0.find(function(e){return e.value===R}))?void 0:k.postfix)||null;if(!H)return null;return(0,c.jsxs)("div",{className:(0,a.default)(y,W,(n(M={disabled:B},"".concat(y,"-mobile"),em),n(M,"".concat(y,"--focused"),eb&&!em),n(M,"".concat(y,"--with-custom-trigger"),!!ea),M)),ref:ex,onKeyDown:e2,onKeyUp:e3,children:[(0,c.jsx)("button",{type:"button","data-testid":Q,className:(0,a.default)("".concat(y,"__trigger"),"input__wrap",(n(D={},"".concat(y,"__trigger--with-actions"),eu),n(D,"placeholder",!R),n(D,"error",T),D)),onClick:function(){return ew(!0)},onKeyDown:e2,onKeyUp:e3,tabIndex:es,children:ea||(0,c.jsxs)(c.Fragment,{children:[U&&!em?(0,c.jsx)("input",l(t({ref:eE,className:"".concat(y,"__input"),value:null==(P=eb?null!=ey?ey:"":null!=nt?nt:"")?void 0:P.toString(),onChange:function(e){return e9(e.target.value)},placeholder:K,onFocus:function(){return eq(!0)},onBlur:function(){return eq(!1)},onMouseDown:function(){eb||eq(!0)}},er),{tabIndex:-1})):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("span",{className:"text",children:nt||K||""}),na&&(0,c.jsx)("span",{className:"dropdown__list-item-postfix",children:na})]}),(0,c.jsx)("span",{className:(0,a.default)("".concat(y,"__arrow"),n({},"".concat(y,"__arrow_active"),eb)),onClick:function(e){null==e||e.stopPropagation(),ew(function(e){return!e})},children:em?(0,c.jsx)(v.Code,{className:"mobile-icon"}):eb?(0,c.jsx)(v.ChevronUp,{}):(0,c.jsx)(v.ChevronDown,{})})]})}),eu&&(0,c.jsxs)("div",{className:(0,a.default)("".concat(y,"__actions")),children:[(0,c.jsx)("div",{className:(0,a.default)("".concat(y,"__actions-item")),onClick:ed,children:(0,c.jsx)(v.Check,{})}),(0,c.jsx)("div",{className:(0,a.default)("".concat(y,"__actions-item")),onClick:ev,children:(0,c.jsx)(v.X,{})})]}),eb&&((S=e6())?(0,d.createPortal)((0,c.jsx)("div",{"data-testid":"".concat(Q,"-container-wrapper"),className:(0,a.default)("".concat(y,"__container-wrapper")),ref:eN,onClick:em?e4:function(){},children:(0,c.jsxs)("div",{className:(0,a.default)("".concat(y,"__list-wrapper"),(n(w={},"".concat(y,"__list-wrapper--fixed-height"),eF),n(w,"".concat(y,"__list-wrapper--with-bottom-shadow"),eR&&em),n(w,"".concat(y,"__list-wrapper--with-bottom-shadow-hidden"),eU===eV),w)),ref:eS,children:[em&&(0,c.jsxs)("div",{className:(0,a.default)("".concat(y,"__list-header"),(n(_={},"".concat(y,"__list-header-with-shadow"),eR&&em),n(_,"".concat(y,"__list-header-with-shadow-hidden"),0===eU),_)),children:[(0,c.jsxs)("div",{className:(0,a.default)("".concat(y,"__list-header-row")),children:[(0,c.jsx)("div",{className:(0,a.default)("".concat(y,"__list-label")),children:q}),(0,c.jsx)("div",{className:(0,a.default)("".concat(y,"__list-close-icon")),onClick:function(){return ew(!1)},children:(0,c.jsx)(v.X,{onClick:function(){return ew(!1)}})})]}),U&&(0,c.jsx)("div",{className:(0,a.default)("".concat(y,"__list-header-row")),children:(0,c.jsx)(h.default,t({ref:eE,className:"".concat(y,"__input"),value:null!=ey?ey:nt,onChange:e9,placeholder:K||"Search",withDelete:!0,onFocus:function(){return eq(!0)},onBlur:function(){return eq(!1)},onMouseDown:function(){eb||eq(!0)}},er))})]}),(0,c.jsxs)("div",{className:(0,a.default)("".concat(y,"__list"),n({},"".concat(y,"__list-top"),V)),ref:eC,children:[e5.options&&(null==(u=nu(e5.options))?void 0:u.map(function(e,n){if(null==e||null==(o=e.items)?void 0:o.length)if(!U||!eP)return nn(e);else{var r,o,i,u,c=null==(u=e.items)?void 0:u.slice().filter(function(e){var n;return(null==e||null==(n=e.label)?void 0:n.toLowerCase().includes((null==ey?void 0:ey.toLowerCase())||""))||!(null==e?void 0:e.value)||(null==e?void 0:e.value)===""});if(null==c?void 0:c.length)return nn(l(t({},e),{items:c}))}else if(!U||!eP||(null==e||null==(i=e.label)?void 0:i.toLowerCase().includes((null==ey?void 0:ey.toLowerCase())||""))||!(null==e?void 0:e.value)||(null==e?void 0:e.value)==="")return ne(e,n,null==(r=(null==e?void 0:e.testId)||n)?void 0:r.toString());return null})),!eZ.length&&!eY.length&&(0,c.jsx)("div",{className:"".concat(y,"__list-item ").concat(y,"__list-item--no-options"),children:el}),B&&eb&&(0,c.jsx)(b.default,{})]})]})}),S):null)]})};
|
|
@@ -1,20 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import "./DropdownLoader.scss";
|
|
4
|
-
|
|
5
|
-
const DropdownLoader = function ({ variant = '' }) {
|
|
6
|
-
return (
|
|
7
|
-
<div className="dropdown-loader-box j5">
|
|
8
|
-
<div
|
|
9
|
-
className={`lds-ring${variant === "little" ? " lds-ring_little" : ""}`}
|
|
10
|
-
>
|
|
11
|
-
<div />
|
|
12
|
-
<div />
|
|
13
|
-
<div />
|
|
14
|
-
<div />
|
|
15
|
-
</div>
|
|
16
|
-
</div>
|
|
17
|
-
);
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export default DropdownLoader;
|
|
1
|
+
import{jsx as r,jsxs as i}from"react/jsx-runtime";import"react";import"./DropdownLoader.scss";export default function(d){var t=d.variant;return r("div",{className:"dropdown-loader-box j5",children:i("div",{className:"lds-ring".concat("little"===(void 0===t?"":t)?" lds-ring_little":""),children:[r("div",{}),r("div",{}),r("div",{}),r("div",{})]})})}
|