intelicoreact 1.4.76 → 1.4.78

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.
Files changed (269) hide show
  1. package/dist/Atomic/FormElements/ActionAlert/ActionAlert.js +9 -1
  2. package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.js +10 -1
  3. package/dist/Atomic/FormElements/Calendar/Calendar.js +24 -4
  4. package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.js +10 -1
  5. package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.js +14 -2
  6. package/dist/Atomic/FormElements/Datepicker/Datepicker.js +54 -5
  7. package/dist/Atomic/FormElements/Datepicker/components/Calendar.js +21 -3
  8. package/dist/Atomic/FormElements/Dropdown/Dropdown.js +145 -52
  9. package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.js +7 -1
  10. package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.js +91 -25
  11. package/dist/Atomic/FormElements/FileLoader/FileLoader.js +15 -3
  12. package/dist/Atomic/FormElements/FileLoader/partial/LoadZone.js +29 -15
  13. package/dist/Atomic/FormElements/FileLoader/partial/LoadedContent.js +15 -5
  14. package/dist/Atomic/FormElements/FileLoaderDescription/FileLoaderDescription.js +23 -4
  15. package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.js +26 -6
  16. package/dist/Atomic/FormElements/FileLoaderLocalGroup/FileLoaderLocalGroup.js +38 -19
  17. package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.js +38 -9
  18. package/dist/Atomic/FormElements/Input/Input.js +60 -25
  19. package/dist/Atomic/FormElements/InputCalendar/InputCalendar.js +31 -4
  20. package/dist/Atomic/FormElements/InputColor/InputColor.js +14 -4
  21. package/dist/Atomic/FormElements/InputCurrency/InputCurrency.js +29 -6
  22. package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +43 -8
  23. package/dist/Atomic/FormElements/InputDateRange/components/DateInput.js +21 -3
  24. package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.js +81 -58
  25. package/dist/Atomic/FormElements/InputDateRange/components/OpenedPart.js +41 -6
  26. package/dist/Atomic/FormElements/InputDateRange/components/SelectItem.js +8 -1
  27. package/dist/Atomic/FormElements/InputDateRange/dependencies.js +46 -16
  28. package/dist/Atomic/FormElements/InputLink/InputLink.js +23 -6
  29. package/dist/Atomic/FormElements/InputMask/InputCarretPosition.js +4 -0
  30. package/dist/Atomic/FormElements/InputMask/InputMask.js +208 -77
  31. package/dist/Atomic/FormElements/InputMask/functions.js +28 -2
  32. package/dist/Atomic/FormElements/InputMask2/InputMask2.js +119 -43
  33. package/dist/Atomic/FormElements/InputMask2/functions.js +28 -2
  34. package/dist/Atomic/FormElements/InputMask3/InputMask3.js +137 -44
  35. package/dist/Atomic/FormElements/InputMask3/functions.js +28 -2
  36. package/dist/Atomic/FormElements/InputWithAction/InputWithAction.js +17 -3
  37. package/dist/Atomic/FormElements/InputsRow/InputsRow.js +24 -5
  38. package/dist/Atomic/FormElements/Label/Label.js +9 -1
  39. package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +73 -35
  40. package/dist/Atomic/FormElements/MultiSelect/MultiSelect.js +15 -3
  41. package/dist/Atomic/FormElements/NumericInput/NumericInput.js +44 -23
  42. package/dist/Atomic/FormElements/RadioGroup/RadioGroup.js +17 -7
  43. package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +14 -3
  44. package/dist/Atomic/FormElements/RadioInput/RadioInput.js +10 -1
  45. package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.js +14 -3
  46. package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +23 -3
  47. package/dist/Atomic/FormElements/RangeInputs/RangeInputs.js +34 -17
  48. package/dist/Atomic/FormElements/RangeList/RangeList.js +25 -6
  49. package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.js +11 -1
  50. package/dist/Atomic/FormElements/RangeSlider/RangeSlider.js +85 -14
  51. package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +132 -43
  52. package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.js +10 -1
  53. package/dist/Atomic/FormElements/Switcher/Switcher.js +10 -1
  54. package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.js +13 -1
  55. package/dist/Atomic/FormElements/SwitcherHide/SwitcherHide.js +10 -1
  56. package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.js +17 -2
  57. package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.js +17 -3
  58. package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.js +11 -1
  59. package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.js +29 -6
  60. package/dist/Atomic/FormElements/SwitcherTagsDropdown/partial/States.js +3 -2
  61. package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.js +12 -1
  62. package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.js +23 -6
  63. package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +223 -105
  64. package/dist/Atomic/FormElements/Text/Text.js +16 -10
  65. package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.js +9 -1
  66. package/dist/Atomic/FormElements/Textarea/Textarea.js +16 -5
  67. package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +35 -6
  68. package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.js +13 -4
  69. package/dist/Atomic/FormElements/TimeRange/TimeRange.js +21 -7
  70. package/dist/Atomic/FormElements/UserContacts/UserContacts.js +35 -8
  71. package/dist/Atomic/FormElements/UserContacts/partial/defaultIcons.js +91 -0
  72. package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.js +18 -5
  73. package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.js +10 -3
  74. package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.js +11 -3
  75. package/dist/Atomic/FormElements/WidgetPseudoTable/partial/constructor.js +2 -1
  76. package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.js +12 -5
  77. package/dist/Atomic/FormElements/WidgetWithSwitchableRows/partial/constructor.js +3 -3
  78. package/dist/Atomic/Layout/Header/Header.js +15 -3
  79. package/dist/Atomic/Layout/MainMenu/MainMenu.js +20 -3
  80. package/dist/Atomic/Layout/Spinner/Spinner.js +8 -1
  81. package/dist/Atomic/UI/Accordion/Accordion.js +19 -3
  82. package/dist/Atomic/UI/Accordion/AccordionItem.js +23 -9
  83. package/dist/Atomic/UI/AccordionTable/AccordionTable.js +32 -7
  84. package/dist/Atomic/UI/AccordionText/AccordionText.js +17 -3
  85. package/dist/Atomic/UI/AdvancedTag/AdvTag.js +21 -4
  86. package/dist/Atomic/UI/AdvancedTag/AdvancedTags.js +15 -3
  87. package/dist/Atomic/UI/Alert/Alert.js +19 -3
  88. package/dist/Atomic/UI/Arrow/Arrow.js +16 -3
  89. package/dist/Atomic/UI/Box/Box.js +9 -3
  90. package/dist/Atomic/UI/Button/Button.js +11 -2
  91. package/dist/Atomic/UI/ButtonsBar/ButtonsBar.js +10 -1
  92. package/dist/Atomic/UI/Chart/Chart.js +29 -4
  93. package/dist/Atomic/UI/Chart/partial/Chart.constants.js +19 -11
  94. package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +12 -1
  95. package/dist/Atomic/UI/Chart/partial/datasetSetters.js +34 -11
  96. package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +56 -82
  97. package/dist/Atomic/UI/Chart/partial/optionsSetters.js +19 -15
  98. package/dist/Atomic/UI/Chart/partial/utils.js +20 -6
  99. package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +13 -3
  100. package/dist/Atomic/UI/DateTime/DateTime.js +14 -3
  101. package/dist/Atomic/UI/DebugContainer/DebugContainer.js +16 -4
  102. package/dist/Atomic/UI/DebugContainer/useDebugContainer.js +11 -3
  103. package/dist/Atomic/UI/DoubleString/DoubleString.js +17 -5
  104. package/dist/Atomic/UI/DynamicIcon/DynamicIcon.js +10 -3
  105. package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +52 -17
  106. package/dist/Atomic/UI/ExampleChartIntegration/partial/utils.js +29 -1
  107. package/dist/Atomic/UI/Hint/Hint.js +39 -13
  108. package/dist/Atomic/UI/Hint/partials/_utils.js +19 -4
  109. package/dist/Atomic/UI/Modal/Modal.js +28 -6
  110. package/dist/Atomic/UI/Modal/ModalHOC.js +9 -1
  111. package/dist/Atomic/UI/Modal/partials/ModalFooter.js +7 -1
  112. package/dist/Atomic/UI/Modal/partials/ModalTitle.js +8 -1
  113. package/dist/Atomic/UI/Modal/partials/useMobileModal.js +49 -32
  114. package/dist/Atomic/UI/ModalBackup/Modal.js +174 -0
  115. package/dist/Atomic/UI/ModalBackup/Modal.scss +333 -0
  116. package/dist/Atomic/UI/ModalBackup/ModalHOC.js +51 -0
  117. package/dist/Atomic/UI/ModalBackup/partials/ModalFooter.js +24 -0
  118. package/dist/Atomic/UI/ModalBackup/partials/ModalTitle.js +41 -0
  119. package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +21 -6
  120. package/dist/Atomic/UI/NavLine/NavLine.js +55 -26
  121. package/dist/Atomic/UI/NavLine/Tabs.js +3 -2
  122. package/dist/Atomic/UI/PageTitle/PageTitle.js +10 -2
  123. package/dist/Atomic/UI/PieChart/PieChart.js +10 -1
  124. package/dist/Atomic/UI/Price/Price.js +8 -3
  125. package/dist/Atomic/UI/PriceRange/PriceRange.js +7 -1
  126. package/dist/Atomic/UI/ProgressLine/ProgressLine.js +16 -1
  127. package/dist/Atomic/UI/Status/Status.js +8 -1
  128. package/dist/Atomic/UI/Table/Partials/TdCell.js +29 -5
  129. package/dist/Atomic/UI/Table/Partials/TdHeader.js +11 -1
  130. package/dist/Atomic/UI/Table/Partials/TdRow.js +17 -5
  131. package/dist/Atomic/UI/Table/Partials/TdTitle.js +14 -3
  132. package/dist/Atomic/UI/Table/Table.js +12 -1
  133. package/dist/Atomic/UI/Table/TdTypes/TdActions.js +18 -2
  134. package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +9 -1
  135. package/dist/Atomic/UI/Table/TdTypes/TdRange.js +4 -1
  136. package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +13 -1
  137. package/dist/Atomic/UI/Tag/Tag.js +26 -11
  138. package/dist/Atomic/UI/TagList/TagList.js +52 -21
  139. package/dist/Atomic/UI/TagList/TagList.scss +3 -2
  140. package/dist/Atomic/UI/UserBox/UserBox.js +13 -1
  141. package/dist/Atomic/UI/WizardStepper/constructor.js +11 -3
  142. package/dist/Atomic/UI/WizardStepper/index.js +5 -1
  143. package/dist/Atomic/UI/WizardStepper/ui/StateIcon/StateIcon.js +10 -0
  144. package/dist/Atomic/UI/WizardStepper/ui/StateIcon/index.js +4 -1
  145. package/dist/Atomic/UI/WizardStepper/ui/StepRow/StepRow.js +17 -2
  146. package/dist/Atomic/UI/WizardStepper/ui/StepRow/index.js +5 -1
  147. package/dist/Atomic/UI/WizardStepper/ui/StepWrapper/StepWrapper.js +15 -1
  148. package/dist/Atomic/UI/WizardStepper/ui/StepWrapper/index.js +5 -1
  149. package/dist/Atomic/UI/WizardStepper/ui/icons.js +9 -2
  150. package/dist/Atomic/UI/WizardStepper/ui/index.js +5 -1
  151. package/dist/Classes/AbortableFetch.js +93 -36
  152. package/dist/Classes/AnimatedHandler.js +7 -3
  153. package/dist/Classes/RESTAPI/index.js +43 -39
  154. package/dist/Classes/RESTAPI/partials/AbortableFetch.js +93 -35
  155. package/dist/Classes/RESTAPI/partials/ApiBase.js +9 -1
  156. package/dist/Classes/RESTAPI/partials/ApiRequestCreators.js +32 -24
  157. package/dist/Classes/RESTAPI/partials/ApiUtils.js +41 -34
  158. package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +46 -21
  159. package/dist/Classes/RESTAPI/partials/Utils.js +19 -6
  160. package/dist/Classes/RESTAPI/partials/_outerDependencies.js +6 -2
  161. package/dist/Classes/RESTAPI/partials/_utils.js +39 -16
  162. package/dist/Constants/index.constants.js +15 -8
  163. package/dist/Functions/Portal.js +16 -5
  164. package/dist/Functions/customEventListener.js +17 -4
  165. package/dist/Functions/fieldValueFormatters.js +83 -43
  166. package/dist/Functions/hooks/useFormFieldsChangesManager.js +26 -23
  167. package/dist/Functions/locale/createTranslator.js +9 -4
  168. package/dist/Functions/operations.js +22 -12
  169. package/dist/Functions/presets/inputMaskPresets.js +11 -9
  170. package/dist/Functions/presets/inputPresets.js +11 -8
  171. package/dist/Functions/presets/mobileKeyboardTypesPresets.js +9 -7
  172. package/dist/Functions/schemas.js +13 -6
  173. package/dist/Functions/useBodyScrollLock.js +6 -1
  174. package/dist/Functions/useClickOutside.js +4 -0
  175. package/dist/Functions/useDebounce.js +7 -2
  176. package/dist/Functions/useFieldFocus.js +18 -6
  177. package/dist/Functions/useFormTools/form-drivers/ArrayWithObjects.js +9 -0
  178. package/dist/Functions/useFormTools/form-drivers/ObjectWithIterableObjects.js +23 -12
  179. package/dist/Functions/useFormTools/form-drivers/ObjectWithNamedKeyObjects.js +15 -6
  180. package/dist/Functions/useFormTools/functions/General.js +28 -18
  181. package/dist/Functions/useFormTools/functions/RenderFields.js +11 -2
  182. package/dist/Functions/useFormTools/functions/usePrevious.js +5 -1
  183. package/dist/Functions/useFormTools/index.js +144 -85
  184. package/dist/Functions/useInputHighlightError.js +12 -3
  185. package/dist/Functions/useIsMobile.js +13 -7
  186. package/dist/Functions/useKeyPress/useHandleKeyPress.js +7 -1
  187. package/dist/Functions/useKeyPress/useKeyPress.js +9 -1
  188. package/dist/Functions/useLocalStorage.js +9 -1
  189. package/dist/Functions/useLocationParams.js +5 -4
  190. package/dist/Functions/useMediaQuery.js +9 -3
  191. package/dist/Functions/useMetaInfo.js +10 -3
  192. package/dist/Functions/useMouseUpOutside.js +3 -0
  193. package/dist/Functions/useOnlineStatus.js +9 -1
  194. package/dist/Functions/usePasswordChecker.js +20 -4
  195. package/dist/Functions/usePrevious.js +5 -1
  196. package/dist/Functions/useResize.js +10 -2
  197. package/dist/Functions/useScrollTo.js +7 -2
  198. package/dist/Functions/useToggle.js +5 -1
  199. package/dist/Functions/utils.js +131 -56
  200. package/dist/Molecular/CustomIcons/components/AffiliateNetworks.js +9 -2
  201. package/dist/Molecular/CustomIcons/components/AlertCircle.js +9 -2
  202. package/dist/Molecular/CustomIcons/components/AppStore.js +9 -2
  203. package/dist/Molecular/CustomIcons/components/Arrow.js +9 -2
  204. package/dist/Molecular/CustomIcons/components/ArrowDown.js +9 -2
  205. package/dist/Molecular/CustomIcons/components/ArrowLeft.js +9 -2
  206. package/dist/Molecular/CustomIcons/components/ArrowRight.js +9 -2
  207. package/dist/Molecular/CustomIcons/components/ArrowUp.js +9 -2
  208. package/dist/Molecular/CustomIcons/components/Bell.js +9 -2
  209. package/dist/Molecular/CustomIcons/components/Button.js +9 -2
  210. package/dist/Molecular/CustomIcons/components/Campaigns.js +9 -2
  211. package/dist/Molecular/CustomIcons/components/Check.js +9 -2
  212. package/dist/Molecular/CustomIcons/components/Check2.js +9 -2
  213. package/dist/Molecular/CustomIcons/components/ChevronDown.js +9 -2
  214. package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.js +9 -2
  215. package/dist/Molecular/CustomIcons/components/ChevronLeft.js +9 -2
  216. package/dist/Molecular/CustomIcons/components/ChevronRight.js +9 -2
  217. package/dist/Molecular/CustomIcons/components/ChevronUp.js +9 -2
  218. package/dist/Molecular/CustomIcons/components/ChevronUpDown.js +9 -2
  219. package/dist/Molecular/CustomIcons/components/Close.js +9 -2
  220. package/dist/Molecular/CustomIcons/components/ColumnsOrder.js +9 -2
  221. package/dist/Molecular/CustomIcons/components/Delete.js +9 -2
  222. package/dist/Molecular/CustomIcons/components/Edit.js +9 -2
  223. package/dist/Molecular/CustomIcons/components/Email.js +9 -2
  224. package/dist/Molecular/CustomIcons/components/FinturfLogo.js +9 -2
  225. package/dist/Molecular/CustomIcons/components/FinturfLogo2.js +9 -2
  226. package/dist/Molecular/CustomIcons/components/Flows.js +9 -2
  227. package/dist/Molecular/CustomIcons/components/Gift.js +9 -2
  228. package/dist/Molecular/CustomIcons/components/GoogleAuth.js +9 -2
  229. package/dist/Molecular/CustomIcons/components/GooglePlay.js +9 -2
  230. package/dist/Molecular/CustomIcons/components/HelpCircle.js +9 -2
  231. package/dist/Molecular/CustomIcons/components/HelpCircle2.js +9 -2
  232. package/dist/Molecular/CustomIcons/components/HelpCircleFilled.js +9 -2
  233. package/dist/Molecular/CustomIcons/components/Home.js +9 -2
  234. package/dist/Molecular/CustomIcons/components/Home2.js +9 -2
  235. package/dist/Molecular/CustomIcons/components/Key.js +9 -2
  236. package/dist/Molecular/CustomIcons/components/Landers.js +9 -2
  237. package/dist/Molecular/CustomIcons/components/Lock.js +9 -2
  238. package/dist/Molecular/CustomIcons/components/Mail.js +9 -2
  239. package/dist/Molecular/CustomIcons/components/Mastercard.js +9 -2
  240. package/dist/Molecular/CustomIcons/components/Minus.js +9 -2
  241. package/dist/Molecular/CustomIcons/components/Offers.js +9 -2
  242. package/dist/Molecular/CustomIcons/components/Pause.js +9 -2
  243. package/dist/Molecular/CustomIcons/components/PayPal.js +9 -2
  244. package/dist/Molecular/CustomIcons/components/PayPalLightLarge.js +9 -2
  245. package/dist/Molecular/CustomIcons/components/Phone.js +9 -2
  246. package/dist/Molecular/CustomIcons/components/Play.js +9 -2
  247. package/dist/Molecular/CustomIcons/components/Plus.js +9 -2
  248. package/dist/Molecular/CustomIcons/components/Profile.js +9 -2
  249. package/dist/Molecular/CustomIcons/components/QRCode.js +9 -2
  250. package/dist/Molecular/CustomIcons/components/Rectangle.js +9 -2
  251. package/dist/Molecular/CustomIcons/components/Revert.js +9 -2
  252. package/dist/Molecular/CustomIcons/components/Star.js +9 -2
  253. package/dist/Molecular/CustomIcons/components/Star2.js +9 -2
  254. package/dist/Molecular/CustomIcons/components/TrafficSources.js +9 -2
  255. package/dist/Molecular/CustomIcons/components/Trash.js +9 -2
  256. package/dist/Molecular/CustomIcons/components/TrashRed.js +9 -2
  257. package/dist/Molecular/CustomIcons/components/Triggers.js +9 -2
  258. package/dist/Molecular/CustomIcons/components/User.js +9 -2
  259. package/dist/Molecular/CustomIcons/components/Visa.js +9 -2
  260. package/dist/Molecular/CustomIcons/components/X.js +9 -2
  261. package/dist/Molecular/CustomIcons/index.js +122 -0
  262. package/dist/Molecular/FormElement/FormElement.js +12 -1
  263. package/dist/Molecular/FormWithDependOn/FormWithDependOn.js +31 -30
  264. package/dist/Molecular/FormWithDependOn/partials/_utils.js +12 -9
  265. package/dist/Molecular/InputAddress/InputAddress.js +114 -65
  266. package/dist/Molecular/InputPassword/InputPassword.js +19 -5
  267. package/dist/index.js +2 -0
  268. package/package.json +1 -1
  269. package/dist/Atomic/UI/Hint/partial/_utils.js +0 -52
@@ -1,26 +1,43 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
8
  exports.default = void 0;
9
+
8
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
+
9
12
  var _react = _interopRequireWildcard(require("react"));
13
+
10
14
  var _classnames = _interopRequireDefault(require("classnames"));
15
+
11
16
  var _reactDom = require("react-dom");
17
+
12
18
  var _reactFeather = require("react-feather");
19
+
13
20
  var _fieldValueFormatters = require("../../../Functions/fieldValueFormatters");
21
+
14
22
  var _useDebounce = require("../../../Functions/useDebounce");
23
+
15
24
  var _useIsMobile = _interopRequireDefault(require("../../../Functions/useIsMobile"));
25
+
16
26
  var _Spinner = _interopRequireDefault(require("../../Layout/Spinner/Spinner"));
27
+
17
28
  var _RadioInput = _interopRequireDefault(require("../RadioInput/RadioInput"));
29
+
18
30
  require("./DropdownLiveSearch.scss");
19
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
20
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
31
+
32
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
33
+
34
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
35
+
21
36
  const RC = "dropdown-live-search";
37
+
22
38
  const DropdownLiveSearch = _ref => {
23
39
  var _dropdownListRef$curr5, _dropdownListRef$curr6, _tabIndex$toString;
40
+
24
41
  let {
25
42
  label,
26
43
  value,
@@ -52,7 +69,8 @@ const DropdownLiveSearch = _ref => {
52
69
  const isMobile = isMobileProp && withMobileLogic && window.screen.width <= 768;
53
70
  const labelByValue = (0, _react.useMemo)(() => {
54
71
  var _options$find$label, _options$find;
55
- return (_options$find$label = options === null || options === void 0 || (_options$find = options.find(item => item.value === value)) === null || _options$find === void 0 ? void 0 : _options$find.label) !== null && _options$find$label !== void 0 ? _options$find$label : "";
72
+
73
+ return (_options$find$label = options === null || options === void 0 ? void 0 : (_options$find = options.find(item => item.value === value)) === null || _options$find === void 0 ? void 0 : _options$find.label) !== null && _options$find$label !== void 0 ? _options$find$label : "";
56
74
  }, [value]);
57
75
  const [searchValue, setSV] = (0, _react.useState)("");
58
76
  const [isSearchValueChangedAfterOpen, setIsSearchValueChangedAfterOpen] = (0, _react.useState)(false);
@@ -80,24 +98,30 @@ const DropdownLiveSearch = _ref => {
80
98
  }
81
99
  }
82
100
  }, [options]);
101
+
83
102
  const setSearchValue = function (val) {
84
103
  let isChanged = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
85
104
  if (isChanged) setIsSearchValueChangedAfterOpen(true);
86
105
  setSV(val);
87
106
  searchValueRef.current = val;
88
107
  };
108
+
89
109
  const setIsOpen = v => {
90
110
  setIsOpenState(v);
91
111
  setSearchValue("", false);
92
112
  if (!v) setIsSearchValueChangedAfterOpen(false);
93
113
  };
114
+
94
115
  const getParentNode = () => {
95
116
  var _ref2, _document$querySelect;
117
+
96
118
  return (_ref2 = (_document$querySelect = document.querySelector("div#root")) !== null && _document$querySelect !== void 0 ? _document$querySelect : document.querySelector("div#app")) !== null && _ref2 !== void 0 ? _ref2 : document.querySelector("div#storybook-root");
97
119
  };
120
+
98
121
  const getListContainer = () => {
99
122
  return document.getElementById(dropdownId);
100
123
  };
124
+
101
125
  const onWrapperClick = e => {
102
126
  if (e.target === (wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current)) {
103
127
  e.stopPropagation();
@@ -105,23 +129,29 @@ const DropdownLiveSearch = _ref => {
105
129
  setIsOpen(false);
106
130
  }
107
131
  };
132
+
108
133
  const onSearchableInputFocus = e => {
109
134
  if (!isOpen) {
110
135
  e.preventDefault();
111
136
  e.stopPropagation();
112
137
  }
113
138
  };
139
+
114
140
  const handleClickOutside = event => {
115
141
  var _getListContainer;
142
+
116
143
  if (!dropdownLiveSearchRef.current.contains(event.target) && (!getListContainer() || !((_getListContainer = getListContainer()) !== null && _getListContainer !== void 0 && _getListContainer.contains(event.target)))) setIsOpen(false);
117
144
  };
145
+
118
146
  const closeListViaEsc = e => {
119
147
  if ([27].includes(e.keyCode)) setIsOpen(false);
120
148
  };
149
+
121
150
  const closeList = isOpen ? handleClickOutside : () => {};
122
151
  const handle = {
123
152
  onInputClick: e => {
124
153
  if (!isOpen) setIsOpen(true);
154
+
125
155
  if (isMobile && withMobileLogic) {
126
156
  e.preventDefault();
127
157
  e.stopPropagation();
@@ -134,6 +164,7 @@ const DropdownLiveSearch = _ref => {
134
164
  let inputValue = e.target.value;
135
165
  if (!isNotValidateASCII) inputValue = (0, _fieldValueFormatters.formatToOnlyASCIICodeText)(inputValue);
136
166
  setSearchValue(inputValue);
167
+
137
168
  if ((searchValue || !isSearchValueChangedAfterOpen) && !e.target.value) {
138
169
  onChange("");
139
170
  setSearchValue("");
@@ -141,11 +172,15 @@ const DropdownLiveSearch = _ref => {
141
172
  } else setIsValueDeleted(false);
142
173
  }
143
174
  };
175
+
144
176
  const highlightedText = (text, postfix) => {
145
177
  if (!isSearchable) return text;else {
146
178
  var _text;
179
+
147
180
  const preparedSearchValue = isSearchValueChangedAfterOpen || isMobile && withMobileLogic ? searchValue : labelByValue;
181
+
148
182
  const prepare = text => text === null || text === void 0 ? void 0 : text.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&");
183
+
149
184
  text = text.replace(/["&<>]/g, a => {
150
185
  return {
151
186
  '"': "&quot;",
@@ -159,13 +194,15 @@ const DropdownLiveSearch = _ref => {
159
194
  return main + postfixPart;
160
195
  }
161
196
  };
197
+
162
198
  const getMarkupForElement = (item, index, optTestId) => {
163
- var _item$value, _item$value2, _item$customMobileIco;
199
+ var _item$value, _item$value$toString, _item$value2, _item$value2$toString, _item$customMobileIco;
200
+
164
201
  const lowerLabel = item.label.toLowerCase();
165
202
  const lowerSearchValue = searchValue === null || searchValue === void 0 ? void 0 : searchValue.toLowerCase();
166
203
  return /*#__PURE__*/_react.default.createElement("button", {
167
- "data-testid": "dropdown-live-search--button--key-".concat(optTestId || (item === null || item === void 0 || (_item$value = item.value) === null || _item$value === void 0 || (_item$value = _item$value.toString()) === null || _item$value === void 0 ? void 0 : _item$value.replace(/\s/, "-")) || (item === null || item === void 0 ? void 0 : item.key) || "item", "--option"),
168
- key: (_item$value2 = item.value) === null || _item$value2 === void 0 || (_item$value2 = _item$value2.toString()) === null || _item$value2 === void 0 ? void 0 : _item$value2.replace(/ /g, "_"),
204
+ "data-testid": "dropdown-live-search--button--key-".concat(optTestId || (item === null || item === void 0 ? void 0 : (_item$value = item.value) === null || _item$value === void 0 ? void 0 : (_item$value$toString = _item$value.toString()) === null || _item$value$toString === void 0 ? void 0 : _item$value$toString.replace(/\s/, "-")) || (item === null || item === void 0 ? void 0 : item.key) || "item", "--option"),
205
+ key: (_item$value2 = item.value) === null || _item$value2 === void 0 ? void 0 : (_item$value2$toString = _item$value2.toString()) === null || _item$value2$toString === void 0 ? void 0 : _item$value2$toString.replace(/ /g, "_"),
169
206
  onClick: () => {
170
207
  onChange(item.value);
171
208
  setIsOpen(false);
@@ -189,6 +226,7 @@ const DropdownLiveSearch = _ref => {
189
226
  checked: value
190
227
  }) : "");
191
228
  };
229
+
192
230
  const getListMarkUp = () => {
193
231
  return /*#__PURE__*/_react.default.createElement("div", {
194
232
  className: (0, _classnames.default)("".concat(RC, "__container-wrapper")),
@@ -240,41 +278,51 @@ const DropdownLiveSearch = _ref => {
240
278
  size: options.length <= 3 ? "small" : null
241
279
  }))));
242
280
  };
281
+
243
282
  const initListContainer = () => {
244
283
  const dropdownList = document.createElement("div");
245
284
  dropdownList.setAttribute("id", dropdownId);
246
285
  dropdownList.classList.add("dropdown__container");
286
+
247
287
  if (isMobile) {
248
288
  dropdownList.addEventListener("click", e => {
249
289
  if (e.target.id === dropdownId) setIsOpen(false);
250
290
  });
251
291
  }
292
+
252
293
  try {
253
294
  var _getListContainer2;
254
- (_getListContainer2 = getListContainer()) === null || _getListContainer2 === void 0 || _getListContainer2.remove();
295
+
296
+ (_getListContainer2 = getListContainer()) === null || _getListContainer2 === void 0 ? void 0 : _getListContainer2.remove();
255
297
  } finally {
256
298
  if (isMobile) {
257
299
  var _getParentNode;
300
+
258
301
  try {
259
302
  var _document$getElementB;
260
- (_document$getElementB = document.getElementById("mlw-".concat(dropdownId))) === null || _document$getElementB === void 0 || _document$getElementB.remove();
303
+
304
+ (_document$getElementB = document.getElementById("mlw-".concat(dropdownId))) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.remove();
261
305
  } catch (e) {}
306
+
262
307
  const dropdownMobileListWrapper = document.createElement("div");
263
308
  dropdownMobileListWrapper.classList.add("dropdown-live-search-mobile");
264
309
  dropdownMobileListWrapper.setAttribute("id", "mlw-".concat(dropdownId));
265
- dropdownMobileListWrapper === null || dropdownMobileListWrapper === void 0 || dropdownMobileListWrapper.append(dropdownList);
266
- (_getParentNode = getParentNode()) === null || _getParentNode === void 0 || _getParentNode.append(dropdownMobileListWrapper);
310
+ dropdownMobileListWrapper === null || dropdownMobileListWrapper === void 0 ? void 0 : dropdownMobileListWrapper.append(dropdownList);
311
+ (_getParentNode = getParentNode()) === null || _getParentNode === void 0 ? void 0 : _getParentNode.append(dropdownMobileListWrapper);
267
312
  } else {
268
313
  var _getParentNode2;
269
- (_getParentNode2 = getParentNode()) === null || _getParentNode2 === void 0 || _getParentNode2.append(dropdownList);
314
+
315
+ (_getParentNode2 = getParentNode()) === null || _getParentNode2 === void 0 ? void 0 : _getParentNode2.append(dropdownList);
270
316
  }
271
317
  }
272
318
  };
319
+
273
320
  const renderListContainer = () => {
274
321
  const lc = getListContainer();
275
322
  if (!lc) return null;
276
323
  return /*#__PURE__*/(0, _reactDom.createPortal)(getListMarkUp(), lc);
277
324
  };
325
+
278
326
  (0, _react.useEffect)(() => {
279
327
  document.addEventListener("click", handleClickOutside, true);
280
328
  return () => document.removeEventListener("click", handleClickOutside, true);
@@ -299,15 +347,18 @@ const DropdownLiveSearch = _ref => {
299
347
  (0, _react.useEffect)(() => {
300
348
  if (isOpen && isMobile && dropdownListRef !== null && dropdownListRef !== void 0 && dropdownListRef.current && !searchValue) {
301
349
  var _dropdownListRef$curr, _dropdownListRef$curr2, _dropdownListRef$curr3, _dropdownListRef$curr4;
302
- setIsScrollableList((dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr = dropdownListRef.current) === null || _dropdownListRef$curr === void 0 ? void 0 : _dropdownListRef$curr.scrollHeight) > (dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr2 = dropdownListRef.current) === null || _dropdownListRef$curr2 === void 0 ? void 0 : _dropdownListRef$curr2.clientHeight));
303
- setIsFixedMaxHeight(isScrollableList || (dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr3 = dropdownListRef.current) === null || _dropdownListRef$curr3 === void 0 ? void 0 : _dropdownListRef$curr3.scrollHeight) > (dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr4 = dropdownListRef.current) === null || _dropdownListRef$curr4 === void 0 ? void 0 : _dropdownListRef$curr4.clientHeight));
350
+
351
+ setIsScrollableList((dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr = dropdownListRef.current) === null || _dropdownListRef$curr === void 0 ? void 0 : _dropdownListRef$curr.scrollHeight) > (dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr2 = dropdownListRef.current) === null || _dropdownListRef$curr2 === void 0 ? void 0 : _dropdownListRef$curr2.clientHeight));
352
+ setIsFixedMaxHeight(isScrollableList || (dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr3 = dropdownListRef.current) === null || _dropdownListRef$curr3 === void 0 ? void 0 : _dropdownListRef$curr3.scrollHeight) > (dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr4 = dropdownListRef.current) === null || _dropdownListRef$curr4 === void 0 ? void 0 : _dropdownListRef$curr4.clientHeight));
304
353
  }
305
- }, [isOpen, isMobile, isScrollableList, dropdownListRef === null || dropdownListRef === void 0 ? void 0 : dropdownListRef.current, dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr5 = dropdownListRef.current) === null || _dropdownListRef$curr5 === void 0 ? void 0 : _dropdownListRef$curr5.scrollHeight, dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr6 = dropdownListRef.current) === null || _dropdownListRef$curr6 === void 0 ? void 0 : _dropdownListRef$curr6.clientHeight]);
354
+ }, [isOpen, isMobile, isScrollableList, dropdownListRef === null || dropdownListRef === void 0 ? void 0 : dropdownListRef.current, dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr5 = dropdownListRef.current) === null || _dropdownListRef$curr5 === void 0 ? void 0 : _dropdownListRef$curr5.scrollHeight, dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr6 = dropdownListRef.current) === null || _dropdownListRef$curr6 === void 0 ? void 0 : _dropdownListRef$curr6.clientHeight]);
306
355
  (0, _react.useLayoutEffect)(() => {
307
356
  const list = document.getElementById("dropdown-live-search-list");
357
+
308
358
  if ((list || isOpen) && (!withMobileLogic || !isMobile)) {
309
359
  var _dropdownLiveSearchRe;
310
- const dropdownWidth = dropdownLiveSearchRef === null || dropdownLiveSearchRef === void 0 || (_dropdownLiveSearchRe = dropdownLiveSearchRef.current) === null || _dropdownLiveSearchRe === void 0 ? void 0 : _dropdownLiveSearchRe.clientWidth;
360
+
361
+ const dropdownWidth = dropdownLiveSearchRef === null || dropdownLiveSearchRef === void 0 ? void 0 : (_dropdownLiveSearchRe = dropdownLiveSearchRef.current) === null || _dropdownLiveSearchRe === void 0 ? void 0 : _dropdownLiveSearchRe.clientWidth;
311
362
  list.style.minWidth = "".concat(dropdownWidth, "px");
312
363
  }
313
364
  }, [dropdownLiveSearchRef, isOpen, withMobileLogic]);
@@ -316,25 +367,31 @@ const DropdownLiveSearch = _ref => {
316
367
  setIsFocusedByClick(false);
317
368
  if (withMobileLogic && isMobile) setSearchValue("");
318
369
  }
370
+
319
371
  if (isOpen && dropdownListRef && dropdownListRef.current) {
320
372
  if (isMobile && withMobileLogic) {
321
373
  var _searchInputModalRef$;
374
+
322
375
  doRequest("").then(() => {
323
376
  setTimeout(() => {
324
- var _dropdownListBoxRef$c, _dropdownListHeaderRe;
325
- dropdownListRef.current.style.maxHeight = "".concat((dropdownListBoxRef === null || dropdownListBoxRef === void 0 || (_dropdownListBoxRef$c = dropdownListBoxRef.current) === null || _dropdownListBoxRef$c === void 0 || (_dropdownListBoxRef$c = _dropdownListBoxRef$c.getBoundingClientRect()) === null || _dropdownListBoxRef$c === void 0 ? void 0 : _dropdownListBoxRef$c.height) - (dropdownListHeaderRef === null || dropdownListHeaderRef === void 0 || (_dropdownListHeaderRe = dropdownListHeaderRef.current) === null || _dropdownListHeaderRe === void 0 || (_dropdownListHeaderRe = _dropdownListHeaderRe.getBoundingClientRect()) === null || _dropdownListHeaderRe === void 0 ? void 0 : _dropdownListHeaderRe.height), "px");
377
+ var _dropdownListBoxRef$c, _dropdownListBoxRef$c2, _dropdownListHeaderRe, _dropdownListHeaderRe2;
378
+
379
+ dropdownListRef.current.style.maxHeight = "".concat((dropdownListBoxRef === null || dropdownListBoxRef === void 0 ? void 0 : (_dropdownListBoxRef$c = dropdownListBoxRef.current) === null || _dropdownListBoxRef$c === void 0 ? void 0 : (_dropdownListBoxRef$c2 = _dropdownListBoxRef$c.getBoundingClientRect()) === null || _dropdownListBoxRef$c2 === void 0 ? void 0 : _dropdownListBoxRef$c2.height) - (dropdownListHeaderRef === null || dropdownListHeaderRef === void 0 ? void 0 : (_dropdownListHeaderRe = dropdownListHeaderRef.current) === null || _dropdownListHeaderRe === void 0 ? void 0 : (_dropdownListHeaderRe2 = _dropdownListHeaderRe.getBoundingClientRect()) === null || _dropdownListHeaderRe2 === void 0 ? void 0 : _dropdownListHeaderRe2.height), "px");
326
380
  }, 1);
327
381
  });
328
- searchInputModalRef === null || searchInputModalRef === void 0 || (_searchInputModalRef$ = searchInputModalRef.current) === null || _searchInputModalRef$ === void 0 || _searchInputModalRef$.focus();
382
+ searchInputModalRef === null || searchInputModalRef === void 0 ? void 0 : (_searchInputModalRef$ = searchInputModalRef.current) === null || _searchInputModalRef$ === void 0 ? void 0 : _searchInputModalRef$.focus();
329
383
  }
384
+
330
385
  dropdownListRef.current.addEventListener("scroll", doScrollCallback);
331
386
  }
387
+
332
388
  return () => {
333
389
  removeEventListener("scroll", doScrollCallback);
334
390
  };
335
391
  }, [isOpen, dropdownListRef]);
336
392
  (0, _react.useLayoutEffect)(() => {
337
393
  var _getListContainer3;
394
+
338
395
  if (!isMobile) {
339
396
  window.addEventListener("mousewheel", closeList);
340
397
  window.addEventListener("scroll", closeList);
@@ -344,34 +401,41 @@ const DropdownLiveSearch = _ref => {
344
401
  window.removeEventListener("scroll", closeList);
345
402
  window.removeEventListener("touchmove", closeList);
346
403
  }
347
- (_getListContainer3 = getListContainer()) === null || _getListContainer3 === void 0 || _getListContainer3.addEventListener("click", closeList);
404
+
405
+ (_getListContainer3 = getListContainer()) === null || _getListContainer3 === void 0 ? void 0 : _getListContainer3.addEventListener("click", closeList);
348
406
  window.addEventListener("keyup", closeListViaEsc);
349
407
  return () => {
350
408
  var _getListContainer4;
409
+
351
410
  window.removeEventListener("mousewheel", closeList);
352
411
  window.removeEventListener("scroll", closeList);
353
412
  window.removeEventListener("touchmove", closeList);
354
413
  window.removeEventListener("keyup", closeListViaEsc);
355
- (_getListContainer4 = getListContainer()) === null || _getListContainer4 === void 0 || _getListContainer4.removeEventListener("click", closeList);
414
+ (_getListContainer4 = getListContainer()) === null || _getListContainer4 === void 0 ? void 0 : _getListContainer4.removeEventListener("click", closeList);
356
415
  };
357
416
  }, [getListContainer]);
358
417
  (0, _react.useEffect)(() => {
359
418
  const setScrollTopValue = e => {
360
419
  setScrollTop(parseInt(e.target.scrollTop, 10));
361
420
  };
421
+
362
422
  if (isOpen && isMobile && dropdownListRef !== null && dropdownListRef !== void 0 && dropdownListRef.current) {
363
423
  var _dropdownListRef$curr7;
364
- dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr7 = dropdownListRef.current) === null || _dropdownListRef$curr7 === void 0 || _dropdownListRef$curr7.addEventListener("scroll", setScrollTopValue);
424
+
425
+ dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr7 = dropdownListRef.current) === null || _dropdownListRef$curr7 === void 0 ? void 0 : _dropdownListRef$curr7.addEventListener("scroll", setScrollTopValue);
365
426
  }
427
+
366
428
  return () => {
367
429
  var _dropdownListRef$curr8;
368
- dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr8 = dropdownListRef.current) === null || _dropdownListRef$curr8 === void 0 || _dropdownListRef$curr8.removeEventListener("scroll", setScrollTopValue);
430
+
431
+ dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr8 = dropdownListRef.current) === null || _dropdownListRef$curr8 === void 0 ? void 0 : _dropdownListRef$curr8.removeEventListener("scroll", setScrollTopValue);
369
432
  };
370
433
  }, [isOpen, isMobile, dropdownListRef === null || dropdownListRef === void 0 ? void 0 : dropdownListRef.current]);
371
434
  (0, _react.useEffect)(() => {
372
435
  if (dropdownListRef !== null && dropdownListRef !== void 0 && dropdownListRef.current) {
373
436
  var _dropdownListRef$curr9, _dropdownListRef$curr10;
374
- setScrollHeight(parseInt((dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr9 = dropdownListRef.current) === null || _dropdownListRef$curr9 === void 0 ? void 0 : _dropdownListRef$curr9.scrollHeight) - (dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr10 = dropdownListRef.current) === null || _dropdownListRef$curr10 === void 0 ? void 0 : _dropdownListRef$curr10.clientHeight), 10));
437
+
438
+ setScrollHeight(parseInt((dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr9 = dropdownListRef.current) === null || _dropdownListRef$curr9 === void 0 ? void 0 : _dropdownListRef$curr9.scrollHeight) - (dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr10 = dropdownListRef.current) === null || _dropdownListRef$curr10 === void 0 ? void 0 : _dropdownListRef$curr10.clientHeight), 10));
375
439
  }
376
440
  }, [scrollTop, dropdownListRef === null || dropdownListRef === void 0 ? void 0 : dropdownListRef.current]);
377
441
  if (!options) return null;
@@ -388,7 +452,7 @@ const DropdownLiveSearch = _ref => {
388
452
  onClick: () => !isSearchable ? setIsOpen(!isOpen) : null,
389
453
  onMouseDown: () => setIsFocusedByClick(true),
390
454
  onFocus: () => !isFocusedByClick ? setIsOpen(true) : null,
391
- tabIndex: tabIndex === null || tabIndex === void 0 || (_tabIndex$toString = tabIndex.toString) === null || _tabIndex$toString === void 0 ? void 0 : _tabIndex$toString.call(tabIndex)
455
+ tabIndex: tabIndex === null || tabIndex === void 0 ? void 0 : (_tabIndex$toString = tabIndex.toString) === null || _tabIndex$toString === void 0 ? void 0 : _tabIndex$toString.call(tabIndex)
392
456
  }, isSearchable ? /*#__PURE__*/_react.default.createElement("input", (0, _extends2.default)({
393
457
  ref: searchInputRef,
394
458
  className: "".concat(RC, "__input"),
@@ -409,4 +473,6 @@ const DropdownLiveSearch = _ref => {
409
473
  className: "mobile-icon"
410
474
  }) : isOpen ? /*#__PURE__*/_react.default.createElement(_reactFeather.ChevronUp, null) : /*#__PURE__*/_react.default.createElement(_reactFeather.ChevronDown, null))), isOpen && (isMobile && withMobileLogic ? renderListContainer() : getListMarkUp()));
411
475
  };
412
- var _default = exports.default = DropdownLiveSearch;
476
+
477
+ var _default = DropdownLiveSearch;
478
+ exports.default = _default;
@@ -1,18 +1,28 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
8
  exports.default = void 0;
9
+
8
10
  var _react = _interopRequireWildcard(require("react"));
11
+
9
12
  var _classnames = _interopRequireDefault(require("classnames"));
13
+
10
14
  var _LoadZone = _interopRequireDefault(require("./partial/LoadZone"));
15
+
11
16
  var _LoadedContent = _interopRequireDefault(require("./partial/LoadedContent"));
17
+
12
18
  require("./FileLoader.scss");
13
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
14
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
19
+
20
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
21
+
22
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23
+
15
24
  const RC = "file-loader";
25
+
16
26
  const FileLoader = props => {
17
27
  const {
18
28
  // будет использован в качестве id инпута в LoadZone, обязателен для корректной работы
@@ -73,4 +83,6 @@ const FileLoader = props => {
73
83
  attributesOfNativeInput: attributesOfNativeInput
74
84
  }));
75
85
  };
76
- var _default = exports.default = FileLoader;
86
+
87
+ var _default = FileLoader;
88
+ exports.default = _default;
@@ -1,18 +1,28 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
8
  exports.default = void 0;
9
+
8
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
+
9
12
  var _react = _interopRequireWildcard(require("react"));
13
+
10
14
  var _classnames = _interopRequireDefault(require("classnames"));
15
+
11
16
  require("../FileLoader.scss");
12
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
13
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
17
+
18
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
+
20
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
+
14
22
  const DEFAULT_MAX_FILE_SIZE = 1024 * 1024; //1Мб
23
+
15
24
  const FILTER_FILES_DEFAULT = file => file.size <= DEFAULT_MAX_FILE_SIZE ? file : null;
25
+
16
26
  const LoadZone = _ref => {
17
27
  let {
18
28
  RC,
@@ -31,14 +41,16 @@ const LoadZone = _ref => {
31
41
  const dropZoneId = "dropZone-".concat(fieldKey);
32
42
  const handle = {
33
43
  change: async e => {
34
- setIsLoadContent === null || setIsLoadContent === void 0 || setIsLoadContent(true);
44
+ setIsLoadContent === null || setIsLoadContent === void 0 ? void 0 : setIsLoadContent(true);
35
45
  const file = e.type === "change" ? e.target.files[0] : e.dataTransfer.files[0];
36
46
  const validatedFile = filterFiles ? await filterFiles(file) : file;
37
47
  if (processErrors && !validatedFile) await processErrors(file);
48
+
38
49
  if (!isBlockNullValues || validatedFile) {
39
50
  onChange(await doLoad(validatedFile).catch(() => null));
40
51
  }
41
- setIsLoadContent === null || setIsLoadContent === void 0 || setIsLoadContent(false);
52
+
53
+ setIsLoadContent === null || setIsLoadContent === void 0 ? void 0 : setIsLoadContent(false);
42
54
  },
43
55
  dragover: e => {
44
56
  e.stopPropagation();
@@ -67,17 +79,17 @@ const LoadZone = _ref => {
67
79
  };
68
80
  (0, _react.useEffect)(() => {
69
81
  const dropbox = document.getElementById(dropZoneId);
70
- dropbox === null || dropbox === void 0 || dropbox.addEventListener("dragenter", handle.dragenter, false);
71
- dropbox === null || dropbox === void 0 || dropbox.addEventListener("dragover", handle.dragover, false);
72
- dropbox === null || dropbox === void 0 || dropbox.addEventListener("dragleave", handle.dragleave, false);
73
- dropbox === null || dropbox === void 0 || dropbox.addEventListener("drop", handle.drop, false);
74
- dropbox === null || dropbox === void 0 || dropbox.addEventListener("dragend", handle.dragleave, false);
82
+ dropbox === null || dropbox === void 0 ? void 0 : dropbox.addEventListener("dragenter", handle.dragenter, false);
83
+ dropbox === null || dropbox === void 0 ? void 0 : dropbox.addEventListener("dragover", handle.dragover, false);
84
+ dropbox === null || dropbox === void 0 ? void 0 : dropbox.addEventListener("dragleave", handle.dragleave, false);
85
+ dropbox === null || dropbox === void 0 ? void 0 : dropbox.addEventListener("drop", handle.drop, false);
86
+ dropbox === null || dropbox === void 0 ? void 0 : dropbox.addEventListener("dragend", handle.dragleave, false);
75
87
  return () => {
76
- dropbox === null || dropbox === void 0 || dropbox.removeEventListener("dragenter", handle.dragenter, false);
77
- dropbox === null || dropbox === void 0 || dropbox.removeEventListener("dragover", handle.dragover, false);
78
- dropbox === null || dropbox === void 0 || dropbox.removeEventListener("dragleave", handle.dragleave, false);
79
- dropbox === null || dropbox === void 0 || dropbox.removeEventListener("drop", handle.drop, false);
80
- dropbox === null || dropbox === void 0 || dropbox.removeEventListener("dragend", handle.dragleave, false);
88
+ dropbox === null || dropbox === void 0 ? void 0 : dropbox.removeEventListener("dragenter", handle.dragenter, false);
89
+ dropbox === null || dropbox === void 0 ? void 0 : dropbox.removeEventListener("dragover", handle.dragover, false);
90
+ dropbox === null || dropbox === void 0 ? void 0 : dropbox.removeEventListener("dragleave", handle.dragleave, false);
91
+ dropbox === null || dropbox === void 0 ? void 0 : dropbox.removeEventListener("drop", handle.drop, false);
92
+ dropbox === null || dropbox === void 0 ? void 0 : dropbox.removeEventListener("dragend", handle.dragleave, false);
81
93
  };
82
94
  }, [fieldKey, doLoad]);
83
95
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, icon && /*#__PURE__*/_react.default.createElement("div", {
@@ -95,4 +107,6 @@ const LoadZone = _ref => {
95
107
  onChange: handle.change
96
108
  }, attributesOfNativeInput))));
97
109
  };
98
- var _default = exports.default = LoadZone;
110
+
111
+ var _default = LoadZone;
112
+ exports.default = _default;
@@ -1,17 +1,26 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
8
  exports.default = void 0;
9
+
8
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
+
9
12
  var _react = _interopRequireWildcard(require("react"));
13
+
10
14
  var _classnames = _interopRequireDefault(require("classnames"));
15
+
11
16
  var _utils = require("../../../../Functions/utils");
17
+
12
18
  require("../FileLoader.scss");
13
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
14
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
19
+
20
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
21
+
22
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23
+
15
24
  const LoadedContent = props => {
16
25
  const {
17
26
  RC,
@@ -34,8 +43,7 @@ const LoadedContent = props => {
34
43
  });
35
44
  }
36
45
  };
37
- const additionalProps = (0, _react.useMemo)(() => ({
38
- ...(isUseLinkTitle ? {
46
+ const additionalProps = (0, _react.useMemo)(() => ({ ...(isUseLinkTitle ? {
39
47
  title: isLinkTypeDownload ? "Download ".concat(value.name) : value.path
40
48
  } : {}),
41
49
  ...(isLinkTypeDownload ? {
@@ -58,4 +66,6 @@ const LoadedContent = props => {
58
66
  onClick: onDelete
59
67
  }, deleteIcon || "X"));
60
68
  };
61
- var _default = exports.default = LoadedContent;
69
+
70
+ var _default = LoadedContent;
71
+ exports.default = _default;
@@ -1,21 +1,32 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
8
  exports.default = void 0;
9
+
8
10
  var _react = _interopRequireWildcard(require("react"));
11
+
9
12
  var _classnames = _interopRequireDefault(require("classnames"));
13
+
10
14
  var _utils = require("../../../Functions/utils");
15
+
11
16
  var _AccordionText = _interopRequireDefault(require("../../UI/AccordionText/AccordionText"));
17
+
12
18
  var _FileLoaderLocal = _interopRequireDefault(require("../FileLoaderLocal/FileLoaderLocal"));
19
+
13
20
  require("./FileLoaderDescription.scss");
14
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
15
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
21
+
22
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
23
+
24
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25
+
16
26
  const MAX_FILE_SIZE = 10 * 1024 * 1024;
17
27
  const ACCEPT_EXTENSIONS_DEFAULT = ".jpg, .jpeg, .png, .pdf";
18
28
  const RC = "file-loader-description";
29
+
19
30
  const accordionData = (accordionTitle, accordionListContent) => {
20
31
  return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
21
32
  testId: "accordion-title",
@@ -35,6 +46,7 @@ const accordionData = (accordionTitle, accordionListContent) => {
35
46
  }, item.description)));
36
47
  })));
37
48
  };
49
+
38
50
  const FileLoaderDescription = _ref => {
39
51
  let {
40
52
  testId,
@@ -64,16 +76,20 @@ const FileLoaderDescription = _ref => {
64
76
  error: "",
65
77
  accept: ACCEPT_EXTENSIONS_DEFAULT
66
78
  };
79
+
67
80
  const generateUniqueFileName = (files, name) => {
68
81
  let fileName = name;
69
82
  const [nameWithoutExtension, extension] = name.split(/(?=\.[^.]+$)/);
70
83
  let count = 1;
84
+
71
85
  while (files.some(file => file.value === fileName)) {
72
86
  fileName = "".concat(nameWithoutExtension, "(").concat(count, ")").concat(extension);
73
87
  count += 1;
74
88
  }
89
+
75
90
  return fileName;
76
91
  };
92
+
77
93
  const handle = {
78
94
  change: _ref2 => {
79
95
  let {
@@ -83,6 +99,7 @@ const FileLoaderDescription = _ref => {
83
99
  file
84
100
  } = _ref2;
85
101
  const changedField = fields.find(item => item.id === id);
102
+
86
103
  if (error) {
87
104
  changedField.value = name;
88
105
  changedField.error = error;
@@ -107,7 +124,7 @@ const FileLoaderDescription = _ref => {
107
124
  }
108
125
  }, [fields]);
109
126
  (0, _react.useEffect)(() => {
110
- onChange === null || onChange === void 0 || onChange(fields.filter(item => item.value && item.base64));
127
+ onChange === null || onChange === void 0 ? void 0 : onChange(fields.filter(item => item.value && item.base64));
111
128
  }, [fields]);
112
129
  return /*#__PURE__*/_react.default.createElement("div", {
113
130
  "data-testid": "".concat(RC, "-").concat(testId),
@@ -139,4 +156,6 @@ const FileLoaderDescription = _ref => {
139
156
  });
140
157
  }));
141
158
  };
142
- var _default = exports.default = FileLoaderDescription;
159
+
160
+ var _default = FileLoaderDescription;
161
+ exports.default = _default;