intelicoreact 1.3.95 → 1.3.97

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