intelicoreact 1.3.96 → 1.3.98

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 (255) 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 +144 -51
  9. package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.js +7 -1
  10. package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.js +87 -26
  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/FileLoaderLocal/FileLoaderLocal.js +29 -8
  15. package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.scss +9 -0
  16. package/dist/Atomic/FormElements/FileLoaderLocalGroup/FileLoaderLocalGroup.js +35 -19
  17. package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.js +38 -9
  18. package/dist/Atomic/FormElements/Input/Input.js +57 -24
  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 +72 -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/TagsDropdown/TagsDropdown.js +151 -55
  63. package/dist/Atomic/FormElements/Text/Text.js +16 -10
  64. package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.js +9 -1
  65. package/dist/Atomic/FormElements/Textarea/Textarea.js +16 -3
  66. package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +35 -6
  67. package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.js +13 -4
  68. package/dist/Atomic/FormElements/TimeRange/TimeRange.js +21 -7
  69. package/dist/Atomic/FormElements/UserContacts/UserContacts.js +35 -8
  70. package/dist/Atomic/FormElements/UserContacts/partial/defaultIcons.js +91 -0
  71. package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.js +18 -5
  72. package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.js +10 -3
  73. package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.js +11 -3
  74. package/dist/Atomic/FormElements/WidgetPseudoTable/partial/constructor.js +2 -1
  75. package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.js +12 -5
  76. package/dist/Atomic/FormElements/WidgetWithSwitchableRows/partial/constructor.js +3 -3
  77. package/dist/Atomic/Layout/Header/Header.js +15 -3
  78. package/dist/Atomic/Layout/MainMenu/MainMenu.js +20 -3
  79. package/dist/Atomic/Layout/Spinner/Spinner.js +8 -1
  80. package/dist/Atomic/UI/Accordion/Accordion.js +19 -3
  81. package/dist/Atomic/UI/Accordion/AccordionItem.js +23 -9
  82. package/dist/Atomic/UI/AccordionTable/AccordionTable.js +32 -7
  83. package/dist/Atomic/UI/AccordionText/AccordionText.js +15 -3
  84. package/dist/Atomic/UI/AdvancedTag/AdvTag.js +21 -4
  85. package/dist/Atomic/UI/AdvancedTag/AdvancedTags.js +15 -3
  86. package/dist/Atomic/UI/Alert/Alert.js +19 -3
  87. package/dist/Atomic/UI/Arrow/Arrow.js +16 -3
  88. package/dist/Atomic/UI/Box/Box.js +9 -3
  89. package/dist/Atomic/UI/Button/Button.js +11 -2
  90. package/dist/Atomic/UI/ButtonsBar/ButtonsBar.js +10 -1
  91. package/dist/Atomic/UI/Chart/Chart.js +29 -4
  92. package/dist/Atomic/UI/Chart/partial/Chart.constants.js +19 -11
  93. package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +12 -1
  94. package/dist/Atomic/UI/Chart/partial/datasetSetters.js +34 -11
  95. package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +56 -82
  96. package/dist/Atomic/UI/Chart/partial/optionsSetters.js +19 -15
  97. package/dist/Atomic/UI/Chart/partial/utils.js +20 -6
  98. package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +13 -3
  99. package/dist/Atomic/UI/DateTime/DateTime.js +14 -3
  100. package/dist/Atomic/UI/DebugContainer/DebugContainer.js +16 -4
  101. package/dist/Atomic/UI/DebugContainer/useDebugContainer.js +11 -3
  102. package/dist/Atomic/UI/DoubleString/DoubleString.js +17 -5
  103. package/dist/Atomic/UI/DynamicIcon/DynamicIcon.js +10 -3
  104. package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +52 -17
  105. package/dist/Atomic/UI/ExampleChartIntegration/partial/utils.js +29 -1
  106. package/dist/Atomic/UI/Hint/Hint.js +31 -5
  107. package/dist/Atomic/UI/Modal/Modal.js +28 -6
  108. package/dist/Atomic/UI/Modal/ModalHOC.js +9 -1
  109. package/dist/Atomic/UI/Modal/partials/ModalFooter.js +7 -1
  110. package/dist/Atomic/UI/Modal/partials/ModalTitle.js +8 -1
  111. package/dist/Atomic/UI/Modal/partials/useMobileModal.js +49 -32
  112. package/dist/Atomic/UI/ModalBackup/Modal.js +174 -0
  113. package/dist/Atomic/UI/ModalBackup/Modal.scss +333 -0
  114. package/dist/Atomic/UI/ModalBackup/ModalHOC.js +51 -0
  115. package/dist/Atomic/UI/ModalBackup/partials/ModalFooter.js +24 -0
  116. package/dist/Atomic/UI/ModalBackup/partials/ModalTitle.js +41 -0
  117. package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +21 -6
  118. package/dist/Atomic/UI/NavLine/NavLine.js +55 -26
  119. package/dist/Atomic/UI/NavLine/Tabs.js +3 -2
  120. package/dist/Atomic/UI/PageTitle/PageTitle.js +10 -2
  121. package/dist/Atomic/UI/PieChart/PieChart.js +10 -1
  122. package/dist/Atomic/UI/Price/Price.js +8 -3
  123. package/dist/Atomic/UI/PriceRange/PriceRange.js +7 -1
  124. package/dist/Atomic/UI/ProgressLine/ProgressLine.js +16 -1
  125. package/dist/Atomic/UI/Status/Status.js +8 -1
  126. package/dist/Atomic/UI/Table/Partials/TdCell.js +29 -5
  127. package/dist/Atomic/UI/Table/Partials/TdHeader.js +11 -1
  128. package/dist/Atomic/UI/Table/Partials/TdRow.js +17 -5
  129. package/dist/Atomic/UI/Table/Partials/TdTitle.js +14 -3
  130. package/dist/Atomic/UI/Table/Table.js +12 -1
  131. package/dist/Atomic/UI/Table/TdTypes/TdActions.js +18 -2
  132. package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +9 -1
  133. package/dist/Atomic/UI/Table/TdTypes/TdRange.js +4 -1
  134. package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +13 -1
  135. package/dist/Atomic/UI/Tag/Tag.js +14 -3
  136. package/dist/Atomic/UI/TagList/TagList.js +35 -19
  137. package/dist/Atomic/UI/UserBox/UserBox.js +13 -1
  138. package/dist/Classes/AbortableFetch.js +93 -36
  139. package/dist/Classes/AnimatedHandler.js +7 -3
  140. package/dist/Classes/RESTAPI/index.js +44 -39
  141. package/dist/Classes/RESTAPI/partials/AbortableFetch.js +93 -35
  142. package/dist/Classes/RESTAPI/partials/ApiBase.js +9 -1
  143. package/dist/Classes/RESTAPI/partials/ApiRequestCreators.js +32 -24
  144. package/dist/Classes/RESTAPI/partials/ApiUtils.js +41 -34
  145. package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +44 -21
  146. package/dist/Classes/RESTAPI/partials/Utils.js +19 -6
  147. package/dist/Classes/RESTAPI/partials/_outerDependencies.js +6 -2
  148. package/dist/Classes/RESTAPI/partials/_utils.js +36 -13
  149. package/dist/Constants/index.constants.js +15 -8
  150. package/dist/Functions/Portal.js +16 -5
  151. package/dist/Functions/customEventListener.js +17 -4
  152. package/dist/Functions/fieldValueFormatters.js +83 -43
  153. package/dist/Functions/hooks/useFormFieldsChangesManager.js +26 -23
  154. package/dist/Functions/locale/createTranslator.js +9 -4
  155. package/dist/Functions/operations.js +22 -12
  156. package/dist/Functions/presets/inputMaskPresets.js +11 -9
  157. package/dist/Functions/presets/inputPresets.js +11 -8
  158. package/dist/Functions/presets/mobileKeyboardTypesPresets.js +9 -7
  159. package/dist/Functions/schemas.js +13 -6
  160. package/dist/Functions/useBodyScrollLock.js +6 -1
  161. package/dist/Functions/useClickOutside.js +4 -0
  162. package/dist/Functions/useDebounce.js +7 -2
  163. package/dist/Functions/useFieldFocus.js +18 -6
  164. package/dist/Functions/useFormTools/form-drivers/ArrayWithObjects.js +9 -0
  165. package/dist/Functions/useFormTools/form-drivers/ObjectWithIterableObjects.js +23 -12
  166. package/dist/Functions/useFormTools/form-drivers/ObjectWithNamedKeyObjects.js +15 -6
  167. package/dist/Functions/useFormTools/functions/General.js +28 -18
  168. package/dist/Functions/useFormTools/functions/RenderFields.js +11 -2
  169. package/dist/Functions/useFormTools/functions/usePrevious.js +5 -1
  170. package/dist/Functions/useFormTools/index.js +144 -85
  171. package/dist/Functions/useInputHighlightError.js +12 -3
  172. package/dist/Functions/useIsMobile.js +13 -7
  173. package/dist/Functions/useKeyPress/useHandleKeyPress.js +7 -1
  174. package/dist/Functions/useKeyPress/useKeyPress.js +9 -1
  175. package/dist/Functions/useLocalStorage.js +9 -1
  176. package/dist/Functions/useLocationParams.js +5 -4
  177. package/dist/Functions/useMediaQuery.js +9 -3
  178. package/dist/Functions/useMetaInfo.js +10 -3
  179. package/dist/Functions/useMouseUpOutside.js +3 -0
  180. package/dist/Functions/useOnlineStatus.js +9 -1
  181. package/dist/Functions/usePasswordChecker.js +20 -4
  182. package/dist/Functions/usePrevious.js +5 -1
  183. package/dist/Functions/useResize.js +10 -2
  184. package/dist/Functions/useScrollTo.js +7 -2
  185. package/dist/Functions/useToggle.js +5 -1
  186. package/dist/Functions/utils.js +131 -56
  187. package/dist/Molecular/CustomIcons/components/AffiliateNetworks.js +9 -2
  188. package/dist/Molecular/CustomIcons/components/AlertCircle.js +9 -2
  189. package/dist/Molecular/CustomIcons/components/AppStore.js +9 -2
  190. package/dist/Molecular/CustomIcons/components/Arrow.js +9 -2
  191. package/dist/Molecular/CustomIcons/components/ArrowDown.js +9 -2
  192. package/dist/Molecular/CustomIcons/components/ArrowLeft.js +9 -2
  193. package/dist/Molecular/CustomIcons/components/ArrowRight.js +9 -2
  194. package/dist/Molecular/CustomIcons/components/ArrowUp.js +9 -2
  195. package/dist/Molecular/CustomIcons/components/Bell.js +9 -2
  196. package/dist/Molecular/CustomIcons/components/Button.js +9 -2
  197. package/dist/Molecular/CustomIcons/components/Campaigns.js +9 -2
  198. package/dist/Molecular/CustomIcons/components/Check.js +9 -2
  199. package/dist/Molecular/CustomIcons/components/Check2.js +9 -2
  200. package/dist/Molecular/CustomIcons/components/ChevronDown.js +9 -2
  201. package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.js +9 -2
  202. package/dist/Molecular/CustomIcons/components/ChevronLeft.js +9 -2
  203. package/dist/Molecular/CustomIcons/components/ChevronRight.js +9 -2
  204. package/dist/Molecular/CustomIcons/components/ChevronUp.js +9 -2
  205. package/dist/Molecular/CustomIcons/components/ChevronUpDown.js +9 -2
  206. package/dist/Molecular/CustomIcons/components/Close.js +9 -2
  207. package/dist/Molecular/CustomIcons/components/ColumnsOrder.js +9 -2
  208. package/dist/Molecular/CustomIcons/components/Delete.js +9 -2
  209. package/dist/Molecular/CustomIcons/components/Edit.js +9 -2
  210. package/dist/Molecular/CustomIcons/components/Email.js +9 -2
  211. package/dist/Molecular/CustomIcons/components/FinturfLogo.js +9 -2
  212. package/dist/Molecular/CustomIcons/components/FinturfLogo2.js +9 -2
  213. package/dist/Molecular/CustomIcons/components/Flows.js +9 -2
  214. package/dist/Molecular/CustomIcons/components/Gift.js +9 -2
  215. package/dist/Molecular/CustomIcons/components/GoogleAuth.js +9 -2
  216. package/dist/Molecular/CustomIcons/components/GooglePlay.js +9 -2
  217. package/dist/Molecular/CustomIcons/components/HelpCircle.js +9 -2
  218. package/dist/Molecular/CustomIcons/components/HelpCircle2.js +9 -2
  219. package/dist/Molecular/CustomIcons/components/HelpCircleFilled.js +9 -2
  220. package/dist/Molecular/CustomIcons/components/Home.js +9 -2
  221. package/dist/Molecular/CustomIcons/components/Home2.js +9 -2
  222. package/dist/Molecular/CustomIcons/components/Key.js +9 -2
  223. package/dist/Molecular/CustomIcons/components/Landers.js +9 -2
  224. package/dist/Molecular/CustomIcons/components/Lock.js +9 -2
  225. package/dist/Molecular/CustomIcons/components/Mail.js +9 -2
  226. package/dist/Molecular/CustomIcons/components/Mastercard.js +9 -2
  227. package/dist/Molecular/CustomIcons/components/Minus.js +9 -2
  228. package/dist/Molecular/CustomIcons/components/Offers.js +9 -2
  229. package/dist/Molecular/CustomIcons/components/Pause.js +9 -2
  230. package/dist/Molecular/CustomIcons/components/PayPal.js +9 -2
  231. package/dist/Molecular/CustomIcons/components/PayPalLightLarge.js +9 -2
  232. package/dist/Molecular/CustomIcons/components/Phone.js +9 -2
  233. package/dist/Molecular/CustomIcons/components/Play.js +9 -2
  234. package/dist/Molecular/CustomIcons/components/Plus.js +9 -2
  235. package/dist/Molecular/CustomIcons/components/Profile.js +9 -2
  236. package/dist/Molecular/CustomIcons/components/QRCode.js +9 -2
  237. package/dist/Molecular/CustomIcons/components/Rectangle.js +9 -2
  238. package/dist/Molecular/CustomIcons/components/Revert.js +9 -2
  239. package/dist/Molecular/CustomIcons/components/Star.js +9 -2
  240. package/dist/Molecular/CustomIcons/components/Star2.js +9 -2
  241. package/dist/Molecular/CustomIcons/components/TrafficSources.js +9 -2
  242. package/dist/Molecular/CustomIcons/components/Trash.js +9 -2
  243. package/dist/Molecular/CustomIcons/components/TrashRed.js +9 -2
  244. package/dist/Molecular/CustomIcons/components/Triggers.js +9 -2
  245. package/dist/Molecular/CustomIcons/components/User.js +9 -2
  246. package/dist/Molecular/CustomIcons/components/Visa.js +9 -2
  247. package/dist/Molecular/CustomIcons/components/X.js +9 -2
  248. package/dist/Molecular/CustomIcons/index.js +122 -0
  249. package/dist/Molecular/FormElement/FormElement.js +12 -1
  250. package/dist/Molecular/FormWithDependOn/FormWithDependOn.js +31 -30
  251. package/dist/Molecular/FormWithDependOn/partials/_utils.js +12 -9
  252. package/dist/Molecular/InputAddress/InputAddress.js +114 -65
  253. package/dist/Molecular/InputPassword/InputPassword.js +19 -5
  254. package/dist/index.js +2 -0
  255. package/package.json +1 -1
@@ -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;
55
- return (options === null || options === void 0 || (_options$find = options.find(item => item.value === value)) === null || _options$find === void 0 ? void 0 : _options$find.label) || "";
72
+
73
+ return (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) || "";
56
74
  }, [value]);
57
75
  const [searchValue, setSV] = (0, _react.useState)(labelByValue);
58
76
  const dropdownLiveSearchRef = (0, _react.useRef)(null);
@@ -67,10 +85,12 @@ const DropdownLiveSearch = _ref => {
67
85
  const [isFixedMaxHeight, setIsFixedMaxHeight] = (0, _react.useState)(false);
68
86
  const [scrollTop, setScrollTop] = (0, _react.useState)(0);
69
87
  const [scrollHeight, setScrollHeight] = (0, _react.useState)(1);
88
+
70
89
  const setSearchValue = val => {
71
90
  setSV(val);
72
91
  searchValueRef.current = val;
73
92
  };
93
+
74
94
  const onWrapperClick = e => {
75
95
  if (e.target === (wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current)) {
76
96
  e.stopPropagation();
@@ -78,19 +98,26 @@ const DropdownLiveSearch = _ref => {
78
98
  setIsOpen(false);
79
99
  }
80
100
  };
101
+
81
102
  const [isFocusedByClick, setIsFocusedByClick] = (0, _react.useState)(false);
82
103
  const debouncedSearchTerm = (0, _useDebounce.useDebounce)({
83
104
  searchValue,
84
105
  delay: 600
85
106
  });
86
107
  if (!options) return null;
108
+
87
109
  const handleClickOutside = event => {
88
- if (!dropdownLiveSearchRef.current.contains(event.target) && !getListContainer().contains(event.target)) setIsOpen(false);
110
+ var _getListContainer;
111
+
112
+ if (!dropdownLiveSearchRef.current.contains(event.target) && (!getListContainer() || !((_getListContainer = getListContainer()) !== null && _getListContainer !== void 0 && _getListContainer.contains(event.target)))) setIsOpen(false);
89
113
  };
114
+
90
115
  const highlightedText = (text, postfix) => {
91
116
  if (!isSearchable) return text;else {
92
117
  var _text;
118
+
93
119
  const prepare = text => text === null || text === void 0 ? void 0 : text.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&");
120
+
94
121
  text = text.replace(/["&<>]/g, a => {
95
122
  return {
96
123
  '"': "&quot;",
@@ -104,13 +131,15 @@ const DropdownLiveSearch = _ref => {
104
131
  return main + postfixPart;
105
132
  }
106
133
  };
134
+
107
135
  const getMarkupForElement = (item, index, optTestId) => {
108
- var _item$value, _item$value2, _item$customMobileIco;
136
+ var _item$value, _item$value$toString, _item$value2, _item$value2$toString, _item$customMobileIco;
137
+
109
138
  const lowerLabel = item.label.toLowerCase();
110
139
  const lowerSearchValue = searchValue.toLowerCase();
111
140
  return /*#__PURE__*/_react.default.createElement("button", {
112
- "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"),
113
- 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, "_"),
141
+ "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"),
142
+ 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, "_"),
114
143
  onClick: () => {
115
144
  onChange(item.value);
116
145
  setIsOpen(false);
@@ -135,6 +164,7 @@ const DropdownLiveSearch = _ref => {
135
164
  checked: value
136
165
  }) : "");
137
166
  };
167
+
138
168
  const getListMarkUp = () => {
139
169
  return /*#__PURE__*/_react.default.createElement("div", {
140
170
  className: (0, _classnames.default)("".concat(RC, "__container-wrapper")),
@@ -186,48 +216,61 @@ const DropdownLiveSearch = _ref => {
186
216
  size: options.length <= 3 ? "small" : null
187
217
  }))));
188
218
  };
219
+
189
220
  const getParentNode = () => {
190
221
  var _ref2, _document$querySelect;
222
+
191
223
  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");
192
224
  };
225
+
193
226
  const initListContainer = () => {
194
227
  const dropdownList = document.createElement("div");
195
228
  dropdownList.setAttribute("id", dropdownId);
196
229
  dropdownList.classList.add("dropdown__container");
230
+
197
231
  if (isMobile) {
198
232
  dropdownList.addEventListener("click", e => {
199
233
  if (e.target.id === dropdownId) setIsOpen(false);
200
234
  });
201
235
  }
236
+
202
237
  try {
203
- var _getListContainer;
204
- (_getListContainer = getListContainer()) === null || _getListContainer === void 0 || _getListContainer.remove();
238
+ var _getListContainer2;
239
+
240
+ (_getListContainer2 = getListContainer()) === null || _getListContainer2 === void 0 ? void 0 : _getListContainer2.remove();
205
241
  } finally {
206
242
  if (isMobile) {
207
243
  var _getParentNode;
244
+
208
245
  try {
209
246
  var _document$getElementB;
210
- (_document$getElementB = document.getElementById("mlw-".concat(dropdownId))) === null || _document$getElementB === void 0 || _document$getElementB.remove();
247
+
248
+ (_document$getElementB = document.getElementById("mlw-".concat(dropdownId))) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.remove();
211
249
  } catch (e) {}
250
+
212
251
  const dropdownMobileListWrapper = document.createElement("div");
213
252
  dropdownMobileListWrapper.classList.add("dropdown-live-search-mobile");
214
253
  dropdownMobileListWrapper.setAttribute("id", "mlw-".concat(dropdownId));
215
- dropdownMobileListWrapper === null || dropdownMobileListWrapper === void 0 || dropdownMobileListWrapper.append(dropdownList);
216
- (_getParentNode = getParentNode()) === null || _getParentNode === void 0 || _getParentNode.append(dropdownMobileListWrapper);
254
+ dropdownMobileListWrapper === null || dropdownMobileListWrapper === void 0 ? void 0 : dropdownMobileListWrapper.append(dropdownList);
255
+ (_getParentNode = getParentNode()) === null || _getParentNode === void 0 ? void 0 : _getParentNode.append(dropdownMobileListWrapper);
217
256
  } else {
218
257
  var _getParentNode2;
219
- (_getParentNode2 = getParentNode()) === null || _getParentNode2 === void 0 || _getParentNode2.append(dropdownList);
258
+
259
+ (_getParentNode2 = getParentNode()) === null || _getParentNode2 === void 0 ? void 0 : _getParentNode2.append(dropdownList);
220
260
  }
221
261
  }
222
262
  };
263
+
223
264
  const getListContainer = () => {
224
265
  return document.getElementById(dropdownId);
225
266
  };
267
+
226
268
  const renderListContainer = () => {
227
269
  const lc = getListContainer();
228
270
  if (!lc) return null;
229
271
  return /*#__PURE__*/(0, _reactDom.createPortal)(getListMarkUp(), lc);
230
272
  };
273
+
231
274
  (0, _react.useEffect)(() => {
232
275
  if (isMobile && withMobileLogic) {
233
276
  initListContainer();
@@ -236,10 +279,11 @@ const DropdownLiveSearch = _ref => {
236
279
  (0, _react.useEffect)(() => {
237
280
  if (isOpen && isMobile && dropdownListRef !== null && dropdownListRef !== void 0 && dropdownListRef.current && !searchValue) {
238
281
  var _dropdownListRef$curr, _dropdownListRef$curr2, _dropdownListRef$curr3, _dropdownListRef$curr4;
239
- 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));
240
- 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));
282
+
283
+ 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));
284
+ 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));
241
285
  }
242
- }, [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]);
286
+ }, [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]);
243
287
  (0, _react.useEffect)(() => {
244
288
  if (!value) setSearchValue("");
245
289
  }, [value]);
@@ -253,15 +297,18 @@ const DropdownLiveSearch = _ref => {
253
297
  onChange(options[0].value);
254
298
  }
255
299
  }, [options]);
300
+
256
301
  const searchableInputFocus = e => {
257
302
  if (!isOpen) {
258
303
  e.preventDefault();
259
304
  e.stopPropagation();
260
305
  }
261
306
  };
307
+
262
308
  const handle = {
263
309
  onInputClick: e => {
264
310
  if (!isOpen) setIsOpen(true);
311
+
265
312
  if (isMobile && withMobileLogic) {
266
313
  e.preventDefault();
267
314
  e.stopPropagation();
@@ -274,6 +321,7 @@ const DropdownLiveSearch = _ref => {
274
321
  let inputValue = e.target.value;
275
322
  if (!isNotValidateASCII) inputValue = (0, _fieldValueFormatters.formatToOnlyASCIICodeText)(inputValue);
276
323
  setSearchValue(inputValue);
324
+
277
325
  if (searchValue && !e.target.value) {
278
326
  onChange("");
279
327
  setSearchValue("");
@@ -286,9 +334,11 @@ const DropdownLiveSearch = _ref => {
286
334
  doRequest(debouncedSearchTerm);
287
335
  }
288
336
  }, [debouncedSearchTerm, isValueDeleted]);
337
+
289
338
  const closeListViaEsc = e => {
290
339
  if ([27].includes(e.keyCode)) setIsOpen(false);
291
340
  };
341
+
292
342
  (0, _react.useLayoutEffect)(() => {
293
343
  window.addEventListener("keyup", closeListViaEsc);
294
344
  return () => {
@@ -297,9 +347,11 @@ const DropdownLiveSearch = _ref => {
297
347
  }, [getListContainer]);
298
348
  (0, _react.useLayoutEffect)(() => {
299
349
  const list = document.getElementById("dropdown-live-search-list");
350
+
300
351
  if ((list || isOpen) && !withMobileLogic) {
301
352
  var _dropdownLiveSearchRe;
302
- const dropdownWidth = dropdownLiveSearchRef === null || dropdownLiveSearchRef === void 0 || (_dropdownLiveSearchRe = dropdownLiveSearchRef.current) === null || _dropdownLiveSearchRe === void 0 ? void 0 : _dropdownLiveSearchRe.clientWidth;
353
+
354
+ const dropdownWidth = dropdownLiveSearchRef === null || dropdownLiveSearchRef === void 0 ? void 0 : (_dropdownLiveSearchRe = dropdownLiveSearchRef.current) === null || _dropdownLiveSearchRe === void 0 ? void 0 : _dropdownLiveSearchRe.clientWidth;
303
355
  list.style.width = "".concat(dropdownWidth, "px");
304
356
  }
305
357
  }, [dropdownLiveSearchRef, isOpen, withMobileLogic]);
@@ -315,22 +367,27 @@ const DropdownLiveSearch = _ref => {
315
367
  setIsFocusedByClick(false);
316
368
  if (withMobileLogic) setSearchValue("");
317
369
  }
370
+
318
371
  if (isOpen && dropdownListRef && dropdownListRef.current) {
319
372
  if (isMobile && withMobileLogic) {
320
- var _dropdownListBoxRef$c, _dropdownListHeaderRe, _searchInputModalRef$;
373
+ var _dropdownListBoxRef$c, _dropdownListBoxRef$c2, _dropdownListHeaderRe, _dropdownListHeaderRe2, _searchInputModalRef$;
374
+
321
375
  doRequest("");
322
- 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");
323
- searchInputModalRef === null || searchInputModalRef === void 0 || (_searchInputModalRef$ = searchInputModalRef.current) === null || _searchInputModalRef$ === void 0 || _searchInputModalRef$.focus();
376
+ 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");
377
+ searchInputModalRef === null || searchInputModalRef === void 0 ? void 0 : (_searchInputModalRef$ = searchInputModalRef.current) === null || _searchInputModalRef$ === void 0 ? void 0 : _searchInputModalRef$.focus();
324
378
  }
379
+
325
380
  dropdownListRef.current.addEventListener("scroll", doScrollCallback);
326
381
  }
382
+
327
383
  return () => {
328
384
  removeEventListener("scroll", doScrollCallback);
329
385
  };
330
386
  }, [isOpen, dropdownListRef]);
331
387
  const closeList = isOpen ? handleClickOutside : () => {};
332
388
  (0, _react.useLayoutEffect)(() => {
333
- var _getListContainer2;
389
+ var _getListContainer3;
390
+
334
391
  if (!isMobile) {
335
392
  window.addEventListener("mousewheel", closeList);
336
393
  window.addEventListener("scroll", closeList);
@@ -340,13 +397,15 @@ const DropdownLiveSearch = _ref => {
340
397
  window.removeEventListener("scroll", closeList);
341
398
  window.removeEventListener("touchmove", closeList);
342
399
  }
343
- (_getListContainer2 = getListContainer()) === null || _getListContainer2 === void 0 || _getListContainer2.addEventListener("click", closeList);
400
+
401
+ (_getListContainer3 = getListContainer()) === null || _getListContainer3 === void 0 ? void 0 : _getListContainer3.addEventListener("click", closeList);
344
402
  return () => {
345
- var _getListContainer3;
403
+ var _getListContainer4;
404
+
346
405
  window.removeEventListener("mousewheel", closeList);
347
406
  window.removeEventListener("scroll", closeList);
348
407
  window.removeEventListener("touchmove", closeList);
349
- (_getListContainer3 = getListContainer()) === null || _getListContainer3 === void 0 || _getListContainer3.removeEventListener("click", closeList);
408
+ (_getListContainer4 = getListContainer()) === null || _getListContainer4 === void 0 ? void 0 : _getListContainer4.removeEventListener("click", closeList);
350
409
  };
351
410
  }, [getListContainer]);
352
411
  return /*#__PURE__*/_react.default.createElement("div", {
@@ -361,7 +420,7 @@ const DropdownLiveSearch = _ref => {
361
420
  onClick: () => !isSearchable ? setIsOpen(!isOpen) : null,
362
421
  onMouseDown: () => setIsFocusedByClick(true),
363
422
  onFocus: () => !isFocusedByClick ? setIsOpen(true) : null,
364
- tabIndex: tabIndex === null || tabIndex === void 0 || (_tabIndex$toString = tabIndex.toString) === null || _tabIndex$toString === void 0 ? void 0 : _tabIndex$toString.call(tabIndex)
423
+ tabIndex: tabIndex === null || tabIndex === void 0 ? void 0 : (_tabIndex$toString = tabIndex.toString) === null || _tabIndex$toString === void 0 ? void 0 : _tabIndex$toString.call(tabIndex)
365
424
  }, isSearchable ? /*#__PURE__*/_react.default.createElement("input", (0, _extends2.default)({
366
425
  ref: searchInputRef,
367
426
  className: "".concat(RC, "__input"),
@@ -382,4 +441,6 @@ const DropdownLiveSearch = _ref => {
382
441
  className: "mobile-icon"
383
442
  }) : isOpen ? /*#__PURE__*/_react.default.createElement(_reactFeather.ChevronUp, null) : /*#__PURE__*/_react.default.createElement(_reactFeather.ChevronDown, null))), isOpen && (isMobile && withMobileLogic ? renderListContainer() : getListMarkUp()));
384
443
  };
385
- var _default = exports.default = DropdownLiveSearch;
444
+
445
+ var _default = DropdownLiveSearch;
446
+ 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,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 = _interopRequireDefault(require("react"));
13
+
10
14
  var _classnames = _interopRequireDefault(require("classnames"));
15
+
11
16
  var _reactFeather = require("react-feather");
17
+
12
18
  var _utils = require("../../../Functions/utils");
19
+
13
20
  require("./FileLoaderLocal.scss");
21
+
14
22
  const MAX_FILE_SIZE = 10 * 1024 * 1024;
23
+
15
24
  const FileLoaderLocal = _ref => {
16
25
  let {
17
26
  groupId,
@@ -28,10 +37,12 @@ const FileLoaderLocal = _ref => {
28
37
  testId,
29
38
  attributesOfNativeInput = {}
30
39
  } = _ref;
40
+
31
41
  const getFileName = value => {
32
42
  const result = value.match(/[^\\]+$/);
33
43
  return result === null || result === void 0 ? void 0 : result[0];
34
44
  };
45
+
35
46
  const renderRequiredLabel = () => {
36
47
  if (!value) {
37
48
  if (isRequired) return /*#__PURE__*/_react.default.createElement("div", {
@@ -41,20 +52,26 @@ const FileLoaderLocal = _ref => {
41
52
  }, "Optional");
42
53
  }
43
54
  };
55
+
44
56
  const isFileSizeOutOfLimit = file => {
45
57
  var _ref2;
58
+
46
59
  return (_ref2 = file.size > maxItemSizeBytes) !== null && _ref2 !== void 0 ? _ref2 : MAX_FILE_SIZE;
47
60
  };
61
+
48
62
  const checkExtension = valueExtension => {
49
63
  return accept.includes(valueExtension);
50
64
  };
65
+
51
66
  const handle = {
52
67
  change: e => {
53
- var _name$match, _e$target, _e$target2;
68
+ var _name$match, _e$target, _e$target$files, _e$target2, _e$target2$files;
69
+
54
70
  const name = getFileName(e.target.value);
55
- const valueExtension = name === null || name === void 0 || (_name$match = name.match(/[^\.]+$/)) === null || _name$match === void 0 ? void 0 : _name$match[0];
56
- const file = (_e$target = e.target) === null || _e$target === void 0 || (_e$target = _e$target.files) === null || _e$target === void 0 ? void 0 : _e$target[0];
57
- if (isFileSizeOutOfLimit((_e$target2 = e.target) === null || _e$target2 === void 0 || (_e$target2 = _e$target2.files) === null || _e$target2 === void 0 ? void 0 : _e$target2[0])) {
71
+ const valueExtension = name === null || name === void 0 ? void 0 : (_name$match = name.match(/[^\.]+$/)) === null || _name$match === void 0 ? void 0 : _name$match[0];
72
+ const file = (_e$target = e.target) === null || _e$target === void 0 ? void 0 : (_e$target$files = _e$target.files) === null || _e$target$files === void 0 ? void 0 : _e$target$files[0];
73
+
74
+ if (isFileSizeOutOfLimit((_e$target2 = e.target) === null || _e$target2 === void 0 ? void 0 : (_e$target2$files = _e$target2.files) === null || _e$target2$files === void 0 ? void 0 : _e$target2$files[0])) {
58
75
  onChange({
59
76
  id,
60
77
  name,
@@ -66,7 +83,8 @@ const FileLoaderLocal = _ref => {
66
83
  });
67
84
  } else if (!checkExtension(valueExtension)) {
68
85
  var _accept$replace;
69
- const allowedExtensions = (accept === null || accept === void 0 || (_accept$replace = accept.replace(/\./g, "")) === null || _accept$replace === void 0 ? void 0 : _accept$replace.toUpperCase()) || "JPG, PNG, PDF";
86
+
87
+ const allowedExtensions = (accept === null || accept === void 0 ? void 0 : (_accept$replace = accept.replace(/\./g, "")) === null || _accept$replace === void 0 ? void 0 : _accept$replace.toUpperCase()) || "JPG, PNG, PDF";
70
88
  const uniqExts = (0, _utils.getUniqueFileExtensions)(allowedExtensions);
71
89
  onChange({
72
90
  id,
@@ -101,13 +119,14 @@ const FileLoaderLocal = _ref => {
101
119
  }, attributesOfNativeInput)), /*#__PURE__*/_react.default.createElement("label", {
102
120
  className: "file-loader-local__label-box",
103
121
  htmlFor: "file-input-".concat(id).concat(groupId ? "-".concat(groupId) : "")
104
- }, /*#__PURE__*/_react.default.createElement("div", {
105
- className: "j4"
106
122
  }, !value && /*#__PURE__*/_react.default.createElement(_reactFeather.Download, {
107
123
  className: "file-loader-local__upload-icon"
108
124
  }), value && /*#__PURE__*/_react.default.createElement(_reactFeather.Paperclip, {
109
125
  className: "file-loader-local__upload-icon"
110
126
  }), /*#__PURE__*/_react.default.createElement("div", {
127
+ title: value || label,
128
+ className: "file-loader-local__label-wrapper"
129
+ }, /*#__PURE__*/_react.default.createElement("div", {
111
130
  className: (0, _classnames.default)("file-loader-local__label", {
112
131
  "file-loader-local__label-filled": value
113
132
  })
@@ -123,4 +142,6 @@ const FileLoaderLocal = _ref => {
123
142
  })
124
143
  }), renderRequiredLabel()));
125
144
  };
126
- var _default = exports.default = FileLoaderLocal;
145
+
146
+ var _default = FileLoaderLocal;
147
+ exports.default = _default;
@@ -75,9 +75,18 @@
75
75
  color: #f06d8d;
76
76
  }
77
77
 
78
+ &__label-wrapper {
79
+ overflow: hidden;
80
+ text-overflow: ellipsis;
81
+ white-space: nowrap;
82
+ margin-right: 8px;
83
+ flex-grow: 1;
84
+ }
85
+
78
86
  &__label {
79
87
  display: flex;
80
88
  flex-direction: column;
89
+ width: 100%;
81
90
  }
82
91
 
83
92
  &__label-text {