intelicoreact 1.3.27 → 1.3.29

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 (252) 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 +153 -58
  9. package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.js +7 -1
  10. package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.js +47 -9
  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 +26 -6
  15. package/dist/Atomic/FormElements/FileLoaderLocalGroup/FileLoaderLocalGroup.js +35 -19
  16. package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.js +38 -9
  17. package/dist/Atomic/FormElements/Input/Input.js +57 -24
  18. package/dist/Atomic/FormElements/InputCalendar/InputCalendar.js +31 -4
  19. package/dist/Atomic/FormElements/InputColor/InputColor.js +14 -4
  20. package/dist/Atomic/FormElements/InputCurrency/InputCurrency.js +27 -6
  21. package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +42 -7
  22. package/dist/Atomic/FormElements/InputDateRange/components/DateInput.js +21 -3
  23. package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.js +81 -58
  24. package/dist/Atomic/FormElements/InputDateRange/components/OpenedPart.js +41 -6
  25. package/dist/Atomic/FormElements/InputDateRange/components/SelectItem.js +8 -1
  26. package/dist/Atomic/FormElements/InputDateRange/dependencies.js +44 -14
  27. package/dist/Atomic/FormElements/InputLink/InputLink.js +23 -6
  28. package/dist/Atomic/FormElements/InputMask/InputCarretPosition.js +4 -0
  29. package/dist/Atomic/FormElements/InputMask/InputMask.js +208 -77
  30. package/dist/Atomic/FormElements/InputMask/functions.js +28 -2
  31. package/dist/Atomic/FormElements/InputMask2/InputMask2.js +119 -43
  32. package/dist/Atomic/FormElements/InputMask2/functions.js +28 -2
  33. package/dist/Atomic/FormElements/InputMask3/InputMask3.js +137 -44
  34. package/dist/Atomic/FormElements/InputMask3/functions.js +28 -2
  35. package/dist/Atomic/FormElements/InputWithAction/InputWithAction.js +17 -3
  36. package/dist/Atomic/FormElements/InputsRow/InputsRow.js +24 -5
  37. package/dist/Atomic/FormElements/Label/Label.js +9 -1
  38. package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +73 -35
  39. package/dist/Atomic/FormElements/MultiSelect/MultiSelect.js +15 -3
  40. package/dist/Atomic/FormElements/NumericInput/NumericInput.js +44 -23
  41. package/dist/Atomic/FormElements/RadioGroup/RadioGroup.js +17 -7
  42. package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +14 -3
  43. package/dist/Atomic/FormElements/RadioInput/RadioInput.js +10 -1
  44. package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.js +14 -3
  45. package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +23 -3
  46. package/dist/Atomic/FormElements/RangeInputs/RangeInputs.js +34 -17
  47. package/dist/Atomic/FormElements/RangeList/RangeList.js +25 -6
  48. package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.js +11 -1
  49. package/dist/Atomic/FormElements/RangeSlider/RangeSlider.js +72 -14
  50. package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +124 -40
  51. package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.js +10 -1
  52. package/dist/Atomic/FormElements/Switcher/Switcher.js +10 -1
  53. package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.js +13 -1
  54. package/dist/Atomic/FormElements/SwitcherHide/SwitcherHide.js +10 -1
  55. package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.js +17 -2
  56. package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.js +17 -3
  57. package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.js +11 -1
  58. package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.js +29 -6
  59. package/dist/Atomic/FormElements/SwitcherTagsDropdown/partial/States.js +3 -2
  60. package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.js +12 -1
  61. package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +133 -45
  62. package/dist/Atomic/FormElements/Text/Text.js +16 -10
  63. package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.js +9 -1
  64. package/dist/Atomic/FormElements/Textarea/Textarea.js +10 -1
  65. package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +35 -6
  66. package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.js +13 -4
  67. package/dist/Atomic/FormElements/TimeRange/TimeRange.js +21 -7
  68. package/dist/Atomic/FormElements/UserContacts/UserContacts.js +35 -8
  69. package/dist/Atomic/FormElements/UserContacts/partial/defaultIcons.js +91 -0
  70. package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.js +18 -5
  71. package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.js +10 -3
  72. package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.js +11 -3
  73. package/dist/Atomic/FormElements/WidgetPseudoTable/partial/constructor.js +2 -1
  74. package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.js +12 -5
  75. package/dist/Atomic/FormElements/WidgetWithSwitchableRows/partial/constructor.js +3 -3
  76. package/dist/Atomic/Layout/Header/Header.js +15 -3
  77. package/dist/Atomic/Layout/MainMenu/MainMenu.js +20 -3
  78. package/dist/Atomic/Layout/Spinner/Spinner.js +8 -1
  79. package/dist/Atomic/UI/Accordion/Accordion.js +19 -3
  80. package/dist/Atomic/UI/Accordion/AccordionItem.js +23 -9
  81. package/dist/Atomic/UI/AccordionTable/AccordionTable.js +32 -7
  82. package/dist/Atomic/UI/AccordionText/AccordionText.js +15 -3
  83. package/dist/Atomic/UI/AdvancedTag/AdvTag.js +21 -4
  84. package/dist/Atomic/UI/AdvancedTag/AdvancedTags.js +15 -3
  85. package/dist/Atomic/UI/Alert/Alert.js +16 -3
  86. package/dist/Atomic/UI/Arrow/Arrow.js +16 -3
  87. package/dist/Atomic/UI/Box/Box.js +9 -3
  88. package/dist/Atomic/UI/Button/Button.js +11 -2
  89. package/dist/Atomic/UI/ButtonsBar/ButtonsBar.js +10 -1
  90. package/dist/Atomic/UI/Chart/Chart.js +29 -4
  91. package/dist/Atomic/UI/Chart/partial/Chart.constants.js +19 -11
  92. package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +12 -1
  93. package/dist/Atomic/UI/Chart/partial/datasetSetters.js +34 -11
  94. package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +56 -82
  95. package/dist/Atomic/UI/Chart/partial/optionsSetters.js +19 -15
  96. package/dist/Atomic/UI/Chart/partial/utils.js +20 -6
  97. package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +13 -3
  98. package/dist/Atomic/UI/DateTime/DateTime.js +14 -3
  99. package/dist/Atomic/UI/DebugContainer/DebugContainer.js +16 -4
  100. package/dist/Atomic/UI/DebugContainer/useDebugContainer.js +11 -3
  101. package/dist/Atomic/UI/DoubleString/DoubleString.js +17 -5
  102. package/dist/Atomic/UI/DynamicIcon/DynamicIcon.js +10 -3
  103. package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +52 -17
  104. package/dist/Atomic/UI/ExampleChartIntegration/partial/utils.js +29 -1
  105. package/dist/Atomic/UI/Hint/Hint.js +30 -5
  106. package/dist/Atomic/UI/Modal/Modal.js +29 -6
  107. package/dist/Atomic/UI/Modal/ModalHOC.js +15 -2
  108. package/dist/Atomic/UI/Modal/partials/ModalFooter.js +7 -1
  109. package/dist/Atomic/UI/Modal/partials/ModalTitle.js +8 -1
  110. package/dist/Atomic/UI/Modal/partials/useMobileModal.js +49 -32
  111. package/dist/Atomic/UI/ModalBackup/Modal.js +90 -65
  112. package/dist/Atomic/UI/ModalBackup/ModalHOC.js +21 -12
  113. package/dist/Atomic/UI/ModalBackup/partials/ModalFooter.js +11 -6
  114. package/dist/Atomic/UI/ModalBackup/partials/ModalTitle.js +19 -15
  115. package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +21 -6
  116. package/dist/Atomic/UI/NavLine/NavLine.js +55 -26
  117. package/dist/Atomic/UI/NavLine/Tabs.js +3 -2
  118. package/dist/Atomic/UI/PageTitle/PageTitle.js +10 -2
  119. package/dist/Atomic/UI/PieChart/PieChart.js +10 -1
  120. package/dist/Atomic/UI/Price/Price.js +8 -3
  121. package/dist/Atomic/UI/PriceRange/PriceRange.js +7 -1
  122. package/dist/Atomic/UI/ProgressLine/ProgressLine.js +16 -1
  123. package/dist/Atomic/UI/Status/Status.js +8 -1
  124. package/dist/Atomic/UI/Table/Partials/TdCell.js +29 -5
  125. package/dist/Atomic/UI/Table/Partials/TdHeader.js +11 -1
  126. package/dist/Atomic/UI/Table/Partials/TdRow.js +17 -5
  127. package/dist/Atomic/UI/Table/Partials/TdTitle.js +14 -3
  128. package/dist/Atomic/UI/Table/Table.js +12 -1
  129. package/dist/Atomic/UI/Table/TdTypes/TdActions.js +18 -2
  130. package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +9 -1
  131. package/dist/Atomic/UI/Table/TdTypes/TdRange.js +4 -1
  132. package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +13 -1
  133. package/dist/Atomic/UI/Tag/Tag.js +14 -3
  134. package/dist/Atomic/UI/TagList/TagList.js +35 -19
  135. package/dist/Atomic/UI/UserBox/UserBox.js +13 -1
  136. package/dist/Classes/AbortableFetch.js +93 -36
  137. package/dist/Classes/AnimatedHandler.js +7 -3
  138. package/dist/Classes/RESTAPI/index.js +43 -39
  139. package/dist/Classes/RESTAPI/partials/AbortableFetch.js +93 -35
  140. package/dist/Classes/RESTAPI/partials/ApiBase.js +9 -1
  141. package/dist/Classes/RESTAPI/partials/ApiRequestCreators.js +19 -7
  142. package/dist/Classes/RESTAPI/partials/ApiUtils.js +35 -28
  143. package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +44 -21
  144. package/dist/Classes/RESTAPI/partials/Utils.js +19 -6
  145. package/dist/Classes/RESTAPI/partials/_outerDependencies.js +6 -2
  146. package/dist/Classes/RESTAPI/partials/_utils.js +36 -13
  147. package/dist/Constants/index.constants.js +15 -8
  148. package/dist/Functions/Portal.js +16 -5
  149. package/dist/Functions/customEventListener.js +17 -4
  150. package/dist/Functions/fieldValueFormatters.js +83 -43
  151. package/dist/Functions/hooks/useFormFieldsChangesManager.js +26 -23
  152. package/dist/Functions/locale/createTranslator.js +9 -4
  153. package/dist/Functions/operations.js +22 -12
  154. package/dist/Functions/presets/inputMaskPresets.js +11 -9
  155. package/dist/Functions/presets/inputPresets.js +11 -8
  156. package/dist/Functions/presets/mobileKeyboardTypesPresets.js +9 -7
  157. package/dist/Functions/schemas.js +13 -6
  158. package/dist/Functions/useBodyScrollLock.js +6 -1
  159. package/dist/Functions/useClickOutside.js +4 -0
  160. package/dist/Functions/useDebounce.js +7 -2
  161. package/dist/Functions/useFieldFocus.js +18 -6
  162. package/dist/Functions/useFormTools/form-drivers/ArrayWithObjects.js +9 -0
  163. package/dist/Functions/useFormTools/form-drivers/ObjectWithIterableObjects.js +23 -12
  164. package/dist/Functions/useFormTools/form-drivers/ObjectWithNamedKeyObjects.js +15 -6
  165. package/dist/Functions/useFormTools/functions/General.js +28 -18
  166. package/dist/Functions/useFormTools/functions/RenderFields.js +11 -2
  167. package/dist/Functions/useFormTools/functions/usePrevious.js +5 -1
  168. package/dist/Functions/useFormTools/index.js +144 -85
  169. package/dist/Functions/useInputHighlightError.js +12 -3
  170. package/dist/Functions/useIsMobile.js +12 -7
  171. package/dist/Functions/useKeyPress/useHandleKeyPress.js +7 -1
  172. package/dist/Functions/useKeyPress/useKeyPress.js +9 -1
  173. package/dist/Functions/useLocalStorage.js +9 -1
  174. package/dist/Functions/useLocationParams.js +5 -4
  175. package/dist/Functions/useMetaInfo.js +10 -3
  176. package/dist/Functions/useMouseUpOutside.js +3 -0
  177. package/dist/Functions/useOnlineStatus.js +9 -1
  178. package/dist/Functions/usePasswordChecker.js +20 -4
  179. package/dist/Functions/usePrevious.js +5 -1
  180. package/dist/Functions/useResize.js +10 -2
  181. package/dist/Functions/useScrollTo.js +7 -2
  182. package/dist/Functions/useToggle.js +5 -1
  183. package/dist/Functions/utils.js +127 -49
  184. package/dist/Molecular/CustomIcons/components/AffiliateNetworks.js +9 -2
  185. package/dist/Molecular/CustomIcons/components/AlertCircle.js +9 -2
  186. package/dist/Molecular/CustomIcons/components/AppStore.js +9 -2
  187. package/dist/Molecular/CustomIcons/components/Arrow.js +9 -2
  188. package/dist/Molecular/CustomIcons/components/ArrowDown.js +9 -2
  189. package/dist/Molecular/CustomIcons/components/ArrowLeft.js +9 -2
  190. package/dist/Molecular/CustomIcons/components/ArrowRight.js +9 -2
  191. package/dist/Molecular/CustomIcons/components/ArrowUp.js +9 -2
  192. package/dist/Molecular/CustomIcons/components/Bell.js +9 -2
  193. package/dist/Molecular/CustomIcons/components/Button.js +9 -2
  194. package/dist/Molecular/CustomIcons/components/Campaigns.js +9 -2
  195. package/dist/Molecular/CustomIcons/components/Check.js +9 -2
  196. package/dist/Molecular/CustomIcons/components/Check2.js +9 -2
  197. package/dist/Molecular/CustomIcons/components/ChevronDown.js +9 -2
  198. package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.js +9 -2
  199. package/dist/Molecular/CustomIcons/components/ChevronLeft.js +9 -2
  200. package/dist/Molecular/CustomIcons/components/ChevronRight.js +9 -2
  201. package/dist/Molecular/CustomIcons/components/ChevronUp.js +9 -2
  202. package/dist/Molecular/CustomIcons/components/ChevronUpDown.js +9 -2
  203. package/dist/Molecular/CustomIcons/components/Close.js +9 -2
  204. package/dist/Molecular/CustomIcons/components/ColumnsOrder.js +9 -2
  205. package/dist/Molecular/CustomIcons/components/Delete.js +9 -2
  206. package/dist/Molecular/CustomIcons/components/Edit.js +9 -2
  207. package/dist/Molecular/CustomIcons/components/Email.js +9 -2
  208. package/dist/Molecular/CustomIcons/components/FinturfLogo.js +9 -2
  209. package/dist/Molecular/CustomIcons/components/FinturfLogo2.js +9 -2
  210. package/dist/Molecular/CustomIcons/components/Flows.js +9 -2
  211. package/dist/Molecular/CustomIcons/components/Gift.js +9 -2
  212. package/dist/Molecular/CustomIcons/components/GoogleAuth.js +9 -2
  213. package/dist/Molecular/CustomIcons/components/GooglePlay.js +9 -2
  214. package/dist/Molecular/CustomIcons/components/HelpCircle.js +9 -2
  215. package/dist/Molecular/CustomIcons/components/HelpCircle2.js +9 -2
  216. package/dist/Molecular/CustomIcons/components/HelpCircleFilled.js +9 -2
  217. package/dist/Molecular/CustomIcons/components/Home.js +9 -2
  218. package/dist/Molecular/CustomIcons/components/Home2.js +9 -2
  219. package/dist/Molecular/CustomIcons/components/Key.js +9 -2
  220. package/dist/Molecular/CustomIcons/components/Landers.js +9 -2
  221. package/dist/Molecular/CustomIcons/components/Lock.js +9 -2
  222. package/dist/Molecular/CustomIcons/components/Mail.js +9 -2
  223. package/dist/Molecular/CustomIcons/components/Mastercard.js +9 -2
  224. package/dist/Molecular/CustomIcons/components/Minus.js +9 -2
  225. package/dist/Molecular/CustomIcons/components/Offers.js +9 -2
  226. package/dist/Molecular/CustomIcons/components/Pause.js +9 -2
  227. package/dist/Molecular/CustomIcons/components/PayPal.js +9 -2
  228. package/dist/Molecular/CustomIcons/components/PayPalLightLarge.js +9 -2
  229. package/dist/Molecular/CustomIcons/components/Phone.js +9 -2
  230. package/dist/Molecular/CustomIcons/components/Play.js +9 -2
  231. package/dist/Molecular/CustomIcons/components/Plus.js +9 -2
  232. package/dist/Molecular/CustomIcons/components/Profile.js +9 -2
  233. package/dist/Molecular/CustomIcons/components/QRCode.js +9 -2
  234. package/dist/Molecular/CustomIcons/components/Rectangle.js +9 -2
  235. package/dist/Molecular/CustomIcons/components/Revert.js +9 -2
  236. package/dist/Molecular/CustomIcons/components/Star.js +9 -2
  237. package/dist/Molecular/CustomIcons/components/Star2.js +9 -2
  238. package/dist/Molecular/CustomIcons/components/TrafficSources.js +9 -2
  239. package/dist/Molecular/CustomIcons/components/Trash.js +9 -2
  240. package/dist/Molecular/CustomIcons/components/TrashRed.js +9 -2
  241. package/dist/Molecular/CustomIcons/components/Triggers.js +9 -2
  242. package/dist/Molecular/CustomIcons/components/User.js +9 -2
  243. package/dist/Molecular/CustomIcons/components/Visa.js +9 -2
  244. package/dist/Molecular/CustomIcons/components/X.js +9 -2
  245. package/dist/Molecular/CustomIcons/index.js +122 -0
  246. package/dist/Molecular/FormElement/FormElement.js +12 -1
  247. package/dist/Molecular/FormWithDependOn/FormWithDependOn.js +31 -30
  248. package/dist/Molecular/FormWithDependOn/partials/_utils.js +12 -9
  249. package/dist/Molecular/InputAddress/InputAddress.js +114 -65
  250. package/dist/Molecular/InputPassword/InputPassword.js +13 -3
  251. package/dist/index.js +2 -0
  252. package/package.json +2 -1
@@ -1,28 +1,46 @@
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 _useIsMobile = _interopRequireDefault(require("../../../Functions/useIsMobile"));
23
+
15
24
  var _CheckboxInput = _interopRequireDefault(require("../../FormElements/CheckboxInput/CheckboxInput"));
25
+
16
26
  var _Input = _interopRequireDefault(require("../../FormElements/Input/Input"));
27
+
17
28
  var _Tag = _interopRequireDefault(require("../../UI/Tag/Tag"));
29
+
18
30
  var _TagList = _interopRequireDefault(require("../../UI/TagList/TagList"));
31
+
19
32
  require("./TagsDropdown.scss");
20
- 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); }
21
- 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; }
33
+
34
+ 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); }
35
+
36
+ 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; }
37
+
22
38
  const RC = "tags-dropdown";
23
39
  const MIN_ITEMS_FOR_SHOW_MOBILE_SEARCH = 10;
40
+
24
41
  const TagsDropdown = _ref => {
25
- var _dropdownListWrapperR, _dropdownListRef$curr5, _dropdownListRef$curr6;
42
+ var _dropdownListWrapperR, _dropdownListWrapperR2, _dropdownListRef$curr5, _dropdownListRef$curr6;
43
+
26
44
  let {
27
45
  options,
28
46
  chosenOptions = [],
@@ -79,38 +97,51 @@ const TagsDropdown = _ref => {
79
97
  const [scrollTop, setScrollTop] = (0, _react.useState)(0);
80
98
  const [scrollHeight, setScrollHeight] = (0, _react.useState)(1);
81
99
  const singleLevelOptions = options === null || options === void 0 ? void 0 : options.reduce((acc, item) => [...acc, ...(item.groupName ? item.list : [item])], []);
100
+
82
101
  const handleClickOutside = _ref2 => {
83
102
  var _getListContainer;
103
+
84
104
  let {
85
105
  target
86
106
  } = _ref2;
87
- if (!((_getListContainer = getListContainer()) !== null && _getListContainer !== void 0 && _getListContainer.contains(target)) /* && !isTargetInParent(target) */) {
107
+
108
+ if (!((_getListContainer = getListContainer()) !== null && _getListContainer !== void 0 && _getListContainer.contains(target))
109
+ /* && !isTargetInParent(target) */
110
+ ) {
88
111
  setIsOpen(false);
89
112
  setSearchValue("");
90
113
  }
91
114
  };
115
+
92
116
  const deleteChosen = value => {
93
117
  if (isMobile ? closeOnRemoveMobile : closeOnRemove) setIsOpen(false);
94
118
  onChange(chosenOptions.filter(item => item !== value), "chosenOptions");
95
119
  };
120
+
96
121
  const onChangeHandler = item => {
97
122
  if (item !== null && item !== void 0 && item.isFreezed) return false;
123
+
98
124
  if ((item === null || item === void 0 ? void 0 : item.closeOnOptionSelect) !== undefined) {
99
125
  if (item.closeOnOptionSelect) setIsOpen(false);
100
126
  } else if (isMobile ? closeOnSelectMobile : closeOnSelect) setIsOpen(false);
127
+
101
128
  setSearchValue("");
129
+
102
130
  if (chosenOptions.some(el => el === item.value)) {
103
131
  deleteChosen(item.value);
104
132
  return null;
105
133
  }
134
+
106
135
  onChange([...chosenOptions, item.value], "chosenOptions");
107
136
  return null;
108
137
  };
138
+
109
139
  const onSearchHandler = name => {
110
140
  let inputValue = name;
111
141
  if (!isNotValidateASCII) inputValue = (0, _fieldValueFormatters.formatToOnlyASCIICodeText)(inputValue);
112
142
  setSearchValue(inputValue);
113
143
  };
144
+
114
145
  const onWrapperClick = e => {
115
146
  if (e.target === (wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current)) {
116
147
  e.stopPropagation();
@@ -118,22 +149,27 @@ const TagsDropdown = _ref => {
118
149
  setIsOpen(false);
119
150
  }
120
151
  };
152
+
121
153
  const getMarkupForElement = item => {
122
154
  var _title$toString, _item$customMobileIco;
155
+
123
156
  const {
124
157
  description
125
158
  } = item;
126
159
  const title = item.title || item.label;
160
+
127
161
  const hightlightSearchValue = title => {
128
162
  var _title$toLowerCase;
163
+
129
164
  const index = (_title$toLowerCase = title.toLowerCase()) === null || _title$toLowerCase === void 0 ? void 0 : _title$toLowerCase.indexOf(searchValue.toLowerCase());
130
165
  if (index === -1) return title;
131
166
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, title.substring(0, index), /*#__PURE__*/_react.default.createElement("span", {
132
167
  className: "search-match"
133
168
  }, title.substring(index, index + (searchValue === null || searchValue === void 0 ? void 0 : searchValue.length))), title.substring(index + (searchValue === null || searchValue === void 0 ? void 0 : searchValue.length)));
134
169
  };
170
+
135
171
  return /*#__PURE__*/_react.default.createElement("button", {
136
- key: title === null || title === void 0 || (_title$toString = title.toString()) === null || _title$toString === void 0 ? void 0 : _title$toString.replace(/ /g, "_"),
172
+ key: title === null || title === void 0 ? void 0 : (_title$toString = title.toString()) === null || _title$toString === void 0 ? void 0 : _title$toString.replace(/ /g, "_"),
137
173
  onClick: e => {
138
174
  e.preventDefault();
139
175
  e.stopPropagation();
@@ -167,18 +203,21 @@ const TagsDropdown = _ref => {
167
203
  }
168
204
  }) : "");
169
205
  };
206
+
170
207
  const prepareOptions = options => {
171
208
  return options === null || options === void 0 ? void 0 : options.map(option => option !== null && option !== void 0 && option.groupName ? option === null || option === void 0 ? void 0 : option.list : option).flat();
172
209
  };
210
+
173
211
  const selectAllItems = e => {
174
- var _prepareOptions;
175
- onChange([...chosenOptions, ...(((_prepareOptions = prepareOptions(options)) === null || _prepareOptions === void 0 || (_prepareOptions = _prepareOptions.filter(_ref3 => {
212
+ var _prepareOptions, _prepareOptions$filte;
213
+
214
+ onChange([...chosenOptions, ...(((_prepareOptions = prepareOptions(options)) === null || _prepareOptions === void 0 ? void 0 : (_prepareOptions$filte = _prepareOptions.filter(_ref3 => {
176
215
  let {
177
216
  isFreezed,
178
217
  value
179
218
  } = _ref3;
180
219
  return !isFreezed && !(chosenOptions !== null && chosenOptions !== void 0 && chosenOptions.includes(value)) && value !== "open_modal";
181
- })) === null || _prepareOptions === void 0 ? void 0 : _prepareOptions.map(_ref4 => {
220
+ })) === null || _prepareOptions$filte === void 0 ? void 0 : _prepareOptions$filte.map(_ref4 => {
182
221
  let {
183
222
  value
184
223
  } = _ref4;
@@ -186,55 +225,70 @@ const TagsDropdown = _ref => {
186
225
  })) || [])], "chosenOptions");
187
226
  if (isMobile ? closeOnSelectAllMobile : closeOnSelectAll) setIsOpen(false);
188
227
  };
228
+
189
229
  const unselectAllItems = e => {
190
230
  onChange(chosenOptions === null || chosenOptions === void 0 ? void 0 : chosenOptions.filter(item => {
191
- var _prepareOptions2;
192
- return (_prepareOptions2 = prepareOptions(options)) === null || _prepareOptions2 === void 0 || (_prepareOptions2 = _prepareOptions2.find(_ref5 => {
231
+ var _prepareOptions2, _prepareOptions2$find;
232
+
233
+ return (_prepareOptions2 = prepareOptions(options)) === null || _prepareOptions2 === void 0 ? void 0 : (_prepareOptions2$find = _prepareOptions2.find(_ref5 => {
193
234
  let {
194
235
  value
195
236
  } = _ref5;
196
237
  return value === item;
197
- })) === null || _prepareOptions2 === void 0 ? void 0 : _prepareOptions2.isFreezed;
238
+ })) === null || _prepareOptions2$find === void 0 ? void 0 : _prepareOptions2$find.isFreezed;
198
239
  }), "chosenOptions");
199
240
  if (isMobile ? closeOnRemoveAllMobile : closeOnRemoveAll) setIsOpen(false);
200
241
  };
242
+
201
243
  const getParentNode = () => {
202
244
  var _ref6, _document$querySelect;
245
+
203
246
  return (_ref6 = (_document$querySelect = document.querySelector("div#root")) !== null && _document$querySelect !== void 0 ? _document$querySelect : document.querySelector("div#app")) !== null && _ref6 !== void 0 ? _ref6 : document.querySelector("div#storybook-root");
204
247
  };
248
+
205
249
  const initListContainer = () => {
206
250
  const dropdownList = document.createElement("div");
207
251
  dropdownList.setAttribute("id", dropdownId);
208
252
  dropdownList.classList.add("tags-dropdown__container");
253
+
209
254
  if (isMobile) {
210
255
  dropdownList.addEventListener("click", e => {
211
256
  if (e.target.id === dropdownId) setIsOpen(false);
212
257
  });
213
258
  }
259
+
214
260
  if (isMobile) {
215
261
  var _getParentNode;
262
+
216
263
  try {
217
264
  var _document$getElementB;
218
- (_document$getElementB = document.getElementById("mlw-".concat(dropdownId))) === null || _document$getElementB === void 0 || _document$getElementB.remove();
265
+
266
+ (_document$getElementB = document.getElementById("mlw-".concat(dropdownId))) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.remove();
219
267
  } catch (e) {}
268
+
220
269
  const dropdownMobileListWrapper = document.createElement("div");
221
270
  dropdownMobileListWrapper.classList.add("tags-dropdown-mobile");
222
271
  dropdownMobileListWrapper.setAttribute("id", "mlw-".concat(dropdownId));
223
- dropdownMobileListWrapper === null || dropdownMobileListWrapper === void 0 || dropdownMobileListWrapper.append(dropdownList);
224
- (_getParentNode = getParentNode()) === null || _getParentNode === void 0 || _getParentNode.append(dropdownMobileListWrapper);
272
+ dropdownMobileListWrapper === null || dropdownMobileListWrapper === void 0 ? void 0 : dropdownMobileListWrapper.append(dropdownList);
273
+ (_getParentNode = getParentNode()) === null || _getParentNode === void 0 ? void 0 : _getParentNode.append(dropdownMobileListWrapper);
225
274
  } else {
226
275
  var _getParentNode2;
227
- (_getParentNode2 = getParentNode()) === null || _getParentNode2 === void 0 || _getParentNode2.append(dropdownList);
276
+
277
+ (_getParentNode2 = getParentNode()) === null || _getParentNode2 === void 0 ? void 0 : _getParentNode2.append(dropdownList);
228
278
  }
229
279
  };
280
+
230
281
  const getListContainer = () => {
231
282
  return document.getElementById(dropdownId);
232
283
  };
284
+
233
285
  const getListContainerWrapper = () => {
234
286
  return document.getElementById("mlw-".concat(dropdownId));
235
287
  };
288
+
236
289
  const setListContainerStyles = () => {
237
- var _dropdownRef$current$, _dropdownRef$current, _getComputedStyle$mar, _getComputedStyle, _getComputedStyle$max, _getComputedStyle2, _dl$getBoundingClient, _sw$getBoundingClient, _sw$getBoundingClient2, _lh$getBoundingClient, _lf$getBoundingClient;
290
+ var _dropdownRef$current$, _dropdownRef$current, _getComputedStyle$mar, _getComputedStyle, _getComputedStyle$mar2, _getComputedStyle$max, _getComputedStyle2, _getComputedStyle2$ma, _dl$getBoundingClient, _sw$getBoundingClient, _sw$getBoundingClient2, _lh$getBoundingClient, _lf$getBoundingClient;
291
+
238
292
  const lc = getListContainer();
239
293
  if (!lc || !isOpen) return false;
240
294
  const windowHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
@@ -243,21 +297,21 @@ const TagsDropdown = _ref => {
243
297
  height,
244
298
  left,
245
299
  top
246
- } = (_dropdownRef$current$ = dropdownRef === null || dropdownRef === void 0 || (_dropdownRef$current = dropdownRef.current) === null || _dropdownRef$current === void 0 ? void 0 : _dropdownRef$current.getBoundingClientRect()) !== null && _dropdownRef$current$ !== void 0 ? _dropdownRef$current$ : {};
300
+ } = (_dropdownRef$current$ = dropdownRef === null || dropdownRef === void 0 ? void 0 : (_dropdownRef$current = dropdownRef.current) === null || _dropdownRef$current === void 0 ? void 0 : _dropdownRef$current.getBoundingClientRect()) !== null && _dropdownRef$current$ !== void 0 ? _dropdownRef$current$ : {};
247
301
  const sw = dropdownListWrapperRef === null || dropdownListWrapperRef === void 0 ? void 0 : dropdownListWrapperRef.current;
248
302
  const dl = lc.getElementsByClassName("tags-dropdown__list")[0];
249
303
  const lh = sw === null || sw === void 0 ? void 0 : sw.getElementsByClassName("tags-dropdown__header")[0];
250
304
  const lf = sw === null || sw === void 0 ? void 0 : sw.getElementsByClassName("tags-dropdown__footer")[0];
251
- const margin = parseInt((_getComputedStyle$mar = (_getComputedStyle = getComputedStyle(sw)) === null || _getComputedStyle === void 0 || (_getComputedStyle = _getComputedStyle.marginTop) === null || _getComputedStyle === void 0 ? void 0 : _getComputedStyle.replace("px", "")) !== null && _getComputedStyle$mar !== void 0 ? _getComputedStyle$mar : 0, 10);
252
- const maxHeight = initListHeight !== null && initListHeight !== void 0 ? initListHeight : parseInt((_getComputedStyle$max = (_getComputedStyle2 = getComputedStyle(dl)) === null || _getComputedStyle2 === void 0 || (_getComputedStyle2 = _getComputedStyle2.maxHeight) === null || _getComputedStyle2 === void 0 ? void 0 : _getComputedStyle2.replace("px", "")) !== null && _getComputedStyle$max !== void 0 ? _getComputedStyle$max : 0, 10);
305
+ const margin = parseInt((_getComputedStyle$mar = (_getComputedStyle = getComputedStyle(sw)) === null || _getComputedStyle === void 0 ? void 0 : (_getComputedStyle$mar2 = _getComputedStyle.marginTop) === null || _getComputedStyle$mar2 === void 0 ? void 0 : _getComputedStyle$mar2.replace("px", "")) !== null && _getComputedStyle$mar !== void 0 ? _getComputedStyle$mar : 0, 10);
306
+ const maxHeight = initListHeight !== null && initListHeight !== void 0 ? initListHeight : parseInt((_getComputedStyle$max = (_getComputedStyle2 = getComputedStyle(dl)) === null || _getComputedStyle2 === void 0 ? void 0 : (_getComputedStyle2$ma = _getComputedStyle2.maxHeight) === null || _getComputedStyle2$ma === void 0 ? void 0 : _getComputedStyle2$ma.replace("px", "")) !== null && _getComputedStyle$max !== void 0 ? _getComputedStyle$max : 0, 10);
253
307
  if (initListHeight === null) setInitListHeight(maxHeight);
254
308
  const toTop = top - margin;
255
309
  const toBottom = windowHeight - top - height - margin * 2;
256
- const dlHeight = dl === null || dl === void 0 || (_dl$getBoundingClient = dl.getBoundingClientRect()) === null || _dl$getBoundingClient === void 0 ? void 0 : _dl$getBoundingClient.height;
257
- let swHeight = sw === null || sw === void 0 || (_sw$getBoundingClient = sw.getBoundingClientRect()) === null || _sw$getBoundingClient === void 0 ? void 0 : _sw$getBoundingClient.height;
310
+ const dlHeight = dl === null || dl === void 0 ? void 0 : (_dl$getBoundingClient = dl.getBoundingClientRect()) === null || _dl$getBoundingClient === void 0 ? void 0 : _dl$getBoundingClient.height;
311
+ let swHeight = sw === null || sw === void 0 ? void 0 : (_sw$getBoundingClient = sw.getBoundingClientRect()) === null || _sw$getBoundingClient === void 0 ? void 0 : _sw$getBoundingClient.height;
258
312
  const controlsHeight = swHeight - dlHeight;
259
313
  if (swHeight > maxHeight) swHeight = maxHeight - 2 * margin;
260
- const maxSwHeight = isMobile ? (sw === null || sw === void 0 || (_sw$getBoundingClient2 = sw.getBoundingClientRect()) === null || _sw$getBoundingClient2 === void 0 ? void 0 : _sw$getBoundingClient2.height) - (lh === null || lh === void 0 || (_lh$getBoundingClient = lh.getBoundingClientRect()) === null || _lh$getBoundingClient === void 0 ? void 0 : _lh$getBoundingClient.height) - (lf === null || lf === void 0 || (_lf$getBoundingClient = lf.getBoundingClientRect()) === null || _lf$getBoundingClient === void 0 ? void 0 : _lf$getBoundingClient.height) : toTop - margin >= maxHeight || toBottom - margin >= maxHeight ? maxHeight - 3 * margin : toTop > toBottom ? toTop - 3 * margin : toBottom - 4 * margin;
314
+ const maxSwHeight = isMobile ? (sw === null || sw === void 0 ? void 0 : (_sw$getBoundingClient2 = sw.getBoundingClientRect()) === null || _sw$getBoundingClient2 === void 0 ? void 0 : _sw$getBoundingClient2.height) - (lh === null || lh === void 0 ? void 0 : (_lh$getBoundingClient = lh.getBoundingClientRect()) === null || _lh$getBoundingClient === void 0 ? void 0 : _lh$getBoundingClient.height) - (lf === null || lf === void 0 ? void 0 : (_lf$getBoundingClient = lf.getBoundingClientRect()) === null || _lf$getBoundingClient === void 0 ? void 0 : _lf$getBoundingClient.height) : toTop - margin >= maxHeight || toBottom - margin >= maxHeight ? maxHeight - 3 * margin : toTop > toBottom ? toTop - 3 * margin : toBottom - 4 * margin;
261
315
  const listPos = toTop < toBottom || toBottom >= swHeight ? "bottom" : "top";
262
316
  if (swHeight > (listPos === "top" ? toTop : toBottom)) swHeight = (listPos === "top" ? toTop : toBottom) - 3 * margin;
263
317
  lc.style.minWidth = "".concat(width, "px");
@@ -265,49 +319,61 @@ const TagsDropdown = _ref => {
265
319
  lc.style.top = "".concat(listPos === "bottom" ? top + height : top - swHeight - 2 * margin, "px");
266
320
  dl.style.maxHeight = "".concat(isMobile ? maxSwHeight : maxSwHeight - controlsHeight, "px");
267
321
  };
322
+
268
323
  const renderListContainer = () => {
269
324
  const lc = getListContainer();
270
325
  if (!lc) return null;
271
326
  return /*#__PURE__*/(0, _reactDom.createPortal)(getListMarkUp(), lc);
272
327
  };
328
+
273
329
  const isTargetInParent = target => {
274
330
  var _target$className, _target$className$ind, _target$className2, _target$className2$in;
331
+
275
332
  if ((target === null || target === void 0 ? void 0 : target.tagName) === "svg" && (target === null || target === void 0 ? void 0 : target.parentNodclassName) === "tag__button" || (target === null || target === void 0 ? void 0 : target.tagName) === "line") return false;
276
- if ((target === null || target === void 0 ? void 0 : target.tagName) === "svg" && (target === null || target === void 0 ? void 0 : target.parentNodclassName) !== "tag__button" || (target === null || target === void 0 || (_target$className = target.className) === null || _target$className === void 0 || (_target$className$ind = _target$className.indexOf) === null || _target$className$ind === void 0 ? void 0 : _target$className$ind.call(_target$className, "tag__label")) !== -1 || (target === null || target === void 0 || (_target$className2 = target.className) === null || _target$className2 === void 0 || (_target$className2$in = _target$className2.indexOf) === null || _target$className2$in === void 0 ? void 0 : _target$className2$in.call(_target$className2, "tag-list_wrapper")) !== -1 || (target === null || target === void 0 ? void 0 : target.className) === "".concat(RC, "__trigger") || (target === null || target === void 0 ? void 0 : target.className) === "tags-dropdown__arrow") return true;
333
+ if ((target === null || target === void 0 ? void 0 : target.tagName) === "svg" && (target === null || target === void 0 ? void 0 : target.parentNodclassName) !== "tag__button" || (target === null || target === void 0 ? void 0 : (_target$className = target.className) === null || _target$className === void 0 ? void 0 : (_target$className$ind = _target$className.indexOf) === null || _target$className$ind === void 0 ? void 0 : _target$className$ind.call(_target$className, "tag__label")) !== -1 || (target === null || target === void 0 ? void 0 : (_target$className2 = target.className) === null || _target$className2 === void 0 ? void 0 : (_target$className2$in = _target$className2.indexOf) === null || _target$className2$in === void 0 ? void 0 : _target$className2$in.call(_target$className2, "tag-list_wrapper")) !== -1 || (target === null || target === void 0 ? void 0 : target.className) === "".concat(RC, "__trigger") || (target === null || target === void 0 ? void 0 : target.className) === "tags-dropdown__arrow") return true;
277
334
  return false;
278
335
  };
336
+
279
337
  const isItemMatchesSearch = item => {
280
338
  const title = item.title || item.label;
281
339
  return searchValue.length ? title.toLowerCase().includes((searchValue === null || searchValue === void 0 ? void 0 : searchValue.toLowerCase()) || "") : true;
282
340
  };
341
+
283
342
  const getFilteredOptions = options => options === null || options === void 0 ? void 0 : options.reduce((result, option) => {
284
343
  if (option.groupName) {
285
344
  var _option$list;
286
- const filteredGroupItems = option === null || option === void 0 || (_option$list = option.list) === null || _option$list === void 0 ? void 0 : _option$list.filter(item => isItemMatchesSearch(item));
345
+
346
+ const filteredGroupItems = option === null || option === void 0 ? void 0 : (_option$list = option.list) === null || _option$list === void 0 ? void 0 : _option$list.filter(item => isItemMatchesSearch(item));
347
+
287
348
  if (filteredGroupItems !== null && filteredGroupItems !== void 0 && filteredGroupItems.length) {
288
- result.push({
289
- ...option,
349
+ result.push({ ...option,
290
350
  list: filteredGroupItems
291
351
  });
292
352
  }
293
353
  } else if (isItemMatchesSearch(option)) {
294
354
  result.push(option);
295
355
  }
356
+
296
357
  return result;
297
358
  }, []);
359
+
298
360
  const getTotalOptions = (0, _react.useCallback)(() => {
299
361
  return options === null || options === void 0 ? void 0 : options.reduce((result, item) => {
300
362
  if (item !== null && item !== void 0 && item.list) {
301
363
  var _item$list;
302
- result += (item === null || item === void 0 || (_item$list = item.list) === null || _item$list === void 0 ? void 0 : _item$list.length) || 0;
364
+
365
+ result += (item === null || item === void 0 ? void 0 : (_item$list = item.list) === null || _item$list === void 0 ? void 0 : _item$list.length) || 0;
303
366
  } else {
304
367
  ++result;
305
368
  }
369
+
306
370
  return result;
307
371
  }, 0);
308
372
  }, [options]);
373
+
309
374
  const getListMarkUp = () => {
310
375
  var _filteredOptions$filt, _filteredOptions$filt2;
376
+
311
377
  const filteredOptions = getFilteredOptions(options);
312
378
  return /*#__PURE__*/_react.default.createElement("div", {
313
379
  className: (0, _classnames.default)("".concat(RC, "__container-wrapper")),
@@ -358,9 +424,10 @@ const TagsDropdown = _ref => {
358
424
  ref: dropdownListRef,
359
425
  className: "".concat(RC, "__list ").concat(headerContent || isMobile ? "".concat(RC, "__list--with-header") : "", " ").concat(footerContent ? "".concat(RC, "__list--with-footer") : "")
360
426
  }, filteredOptions === null || filteredOptions === void 0 ? void 0 : filteredOptions.map(option => {
361
- var _option$groupName, _option$list2;
427
+ var _option$groupName, _option$groupName$toS, _option$list2;
428
+
362
429
  return option.groupName ? /*#__PURE__*/_react.default.createElement("div", {
363
- key: (_option$groupName = option.groupName) === null || _option$groupName === void 0 || (_option$groupName = _option$groupName.toString()) === null || _option$groupName === void 0 ? void 0 : _option$groupName.replace(/ /g, "_").concat(Date.now()),
430
+ key: (_option$groupName = option.groupName) === null || _option$groupName === void 0 ? void 0 : (_option$groupName$toS = _option$groupName.toString()) === null || _option$groupName$toS === void 0 ? void 0 : _option$groupName$toS.replace(/ /g, "_").concat(Date.now()),
364
431
  className: (0, _classnames.default)("".concat(RC, "-group"), option.className)
365
432
  }, /*#__PURE__*/_react.default.createElement("span", {
366
433
  className: "".concat(RC, "-group__name")
@@ -386,11 +453,14 @@ const TagsDropdown = _ref => {
386
453
  onClick: () => setIsOpen(false)
387
454
  }, "Apply", chosenOptions !== null && chosenOptions !== void 0 && chosenOptions.length ? "(".concat(chosenOptions === null || chosenOptions === void 0 ? void 0 : chosenOptions.length, ")") : "")) : null));
388
455
  };
456
+
389
457
  const closeList = e => {
390
458
  var _inputRef$current;
459
+
391
460
  handleClickOutside(e);
392
- inputRef === null || inputRef === void 0 || (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.blur();
461
+ inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.blur();
393
462
  };
463
+
394
464
  (0, _react.useLayoutEffect)(() => {
395
465
  initListContainer();
396
466
  }, []);
@@ -404,6 +474,7 @@ const TagsDropdown = _ref => {
404
474
  window.removeEventListener("mousewheel", closeList);
405
475
  window.removeEventListener("mouseup", handleClickOutside);
406
476
  }
477
+
407
478
  return () => {
408
479
  window.removeEventListener("resize", setListContainerStyles);
409
480
  window.removeEventListener("mousewheel", closeList);
@@ -412,62 +483,76 @@ const TagsDropdown = _ref => {
412
483
  }, [getListContainer]);
413
484
  (0, _react.useLayoutEffect)(() => {
414
485
  setListContainerStyles();
415
- }, [isOpen, chosenOptions, isMobile, dropdownListWrapperRef === null || dropdownListWrapperRef === void 0 || (_dropdownListWrapperR = dropdownListWrapperRef.current) === null || _dropdownListWrapperR === void 0 || (_dropdownListWrapperR = _dropdownListWrapperR.getBoundingClientRect()) === null || _dropdownListWrapperR === void 0 ? void 0 : _dropdownListWrapperR.height]);
486
+ }, [isOpen, chosenOptions, isMobile, dropdownListWrapperRef === null || dropdownListWrapperRef === void 0 ? void 0 : (_dropdownListWrapperR = dropdownListWrapperRef.current) === null || _dropdownListWrapperR === void 0 ? void 0 : (_dropdownListWrapperR2 = _dropdownListWrapperR.getBoundingClientRect()) === null || _dropdownListWrapperR2 === void 0 ? void 0 : _dropdownListWrapperR2.height]);
416
487
  (0, _react.useEffect)(() => {
417
488
  if (!isMobile) {
418
489
  document.addEventListener("click", handleClickOutside, true);
419
490
  } else {
420
491
  document.removeEventListener("click", handleClickOutside, true);
421
492
  }
493
+
422
494
  return () => document.removeEventListener("click", handleClickOutside, true);
423
495
  }, [isMobile]);
424
496
  (0, _react.useEffect)(() => {
425
497
  var _selectAllButtonRef$c, _unselectAllButtonRef;
498
+
426
499
  const fn = isOpen ? "addEventListener" : "removeEventListener";
427
- selectAllButtonRef === null || selectAllButtonRef === void 0 || (_selectAllButtonRef$c = selectAllButtonRef.current) === null || _selectAllButtonRef$c === void 0 || _selectAllButtonRef$c[fn]("click", selectAllItems, true);
428
- unselectAllButtonRef === null || unselectAllButtonRef === void 0 || (_unselectAllButtonRef = unselectAllButtonRef.current) === null || _unselectAllButtonRef === void 0 || _unselectAllButtonRef[fn]("click", unselectAllItems, true);
500
+ selectAllButtonRef === null || selectAllButtonRef === void 0 ? void 0 : (_selectAllButtonRef$c = selectAllButtonRef.current) === null || _selectAllButtonRef$c === void 0 ? void 0 : _selectAllButtonRef$c[fn]("click", selectAllItems, true);
501
+ unselectAllButtonRef === null || unselectAllButtonRef === void 0 ? void 0 : (_unselectAllButtonRef = unselectAllButtonRef.current) === null || _unselectAllButtonRef === void 0 ? void 0 : _unselectAllButtonRef[fn]("click", unselectAllItems, true);
502
+
429
503
  if (isOpen) {
430
504
  var _getListContainer2;
431
- (_getListContainer2 = getListContainer()) === null || _getListContainer2 === void 0 || _getListContainer2.classList.add("tags-dropdown__container--opened");
505
+
506
+ (_getListContainer2 = getListContainer()) === null || _getListContainer2 === void 0 ? void 0 : _getListContainer2.classList.add("tags-dropdown__container--opened");
432
507
  } else {
433
508
  var _getListContainer3;
434
- (_getListContainer3 = getListContainer()) === null || _getListContainer3 === void 0 || _getListContainer3.classList.remove("tags-dropdown__container--opened");
509
+
510
+ (_getListContainer3 = getListContainer()) === null || _getListContainer3 === void 0 ? void 0 : _getListContainer3.classList.remove("tags-dropdown__container--opened");
435
511
  }
436
512
  }, [isOpen]);
437
513
  (0, _react.useEffect)(() => {
438
514
  if (isOpen && isMobile, dropdownListRef !== null && dropdownListRef !== void 0 && dropdownListRef.current) {
439
515
  var _dropdownListRef$curr, _dropdownListRef$curr2;
440
- 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));
516
+
517
+ 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));
518
+
441
519
  if (isScrollableList === null) {
442
520
  var _dropdownListRef$curr3, _dropdownListRef$curr4;
443
- setIsFixedMaxHeight((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));
521
+
522
+ setIsFixedMaxHeight((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));
444
523
  }
445
524
  }
446
- }, [isOpen, isMobile, 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]);
525
+ }, [isOpen, isMobile, 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]);
447
526
  (0, _react.useEffect)(() => {
448
527
  const setScrollTopValue = e => {
449
528
  setScrollTop(parseInt(e.target.scrollTop, 10));
450
529
  };
530
+
451
531
  if (isOpen && isMobile && dropdownListRef !== null && dropdownListRef !== void 0 && dropdownListRef.current) {
452
532
  var _dropdownListRef$curr7;
453
- dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr7 = dropdownListRef.current) === null || _dropdownListRef$curr7 === void 0 || _dropdownListRef$curr7.addEventListener("scroll", setScrollTopValue);
533
+
534
+ dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr7 = dropdownListRef.current) === null || _dropdownListRef$curr7 === void 0 ? void 0 : _dropdownListRef$curr7.addEventListener("scroll", setScrollTopValue);
454
535
  }
536
+
455
537
  return () => {
456
538
  var _dropdownListRef$curr8;
457
- dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr8 = dropdownListRef.current) === null || _dropdownListRef$curr8 === void 0 || _dropdownListRef$curr8.removeEventListener("scroll", setScrollTopValue);
539
+
540
+ dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr8 = dropdownListRef.current) === null || _dropdownListRef$curr8 === void 0 ? void 0 : _dropdownListRef$curr8.removeEventListener("scroll", setScrollTopValue);
458
541
  };
459
542
  }, [isOpen, isMobile, dropdownListRef === null || dropdownListRef === void 0 ? void 0 : dropdownListRef.current]);
460
543
  (0, _react.useEffect)(() => {
461
544
  if (dropdownListRef !== null && dropdownListRef !== void 0 && dropdownListRef.current) {
462
545
  var _dropdownListRef$curr9, _dropdownListRef$curr10;
463
- setScrollHeight(parseInt((dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr9 = dropdownListRef.current) === null || _dropdownListRef$curr9 === void 0 ? void 0 : _dropdownListRef$curr9.scrollHeight) - (dropdownListRef === null || dropdownListRef === void 0 || (_dropdownListRef$curr10 = dropdownListRef.current) === null || _dropdownListRef$curr10 === void 0 ? void 0 : _dropdownListRef$curr10.clientHeight), 10));
546
+
547
+ setScrollHeight(parseInt((dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr9 = dropdownListRef.current) === null || _dropdownListRef$curr9 === void 0 ? void 0 : _dropdownListRef$curr9.scrollHeight) - (dropdownListRef === null || dropdownListRef === void 0 ? void 0 : (_dropdownListRef$curr10 = dropdownListRef.current) === null || _dropdownListRef$curr10 === void 0 ? void 0 : _dropdownListRef$curr10.clientHeight), 10));
464
548
  }
465
549
  }, [scrollTop, dropdownListRef === null || dropdownListRef === void 0 ? void 0 : dropdownListRef.current]);
466
550
  (0, _react.useEffect)(() => {
467
551
  return () => {
468
552
  var _getListContainer4, _getListContainerWrap;
469
- (_getListContainer4 = getListContainer()) === null || _getListContainer4 === void 0 || _getListContainer4.remove();
470
- (_getListContainerWrap = getListContainerWrapper()) === null || _getListContainerWrap === void 0 || _getListContainerWrap.remove();
553
+
554
+ (_getListContainer4 = getListContainer()) === null || _getListContainer4 === void 0 ? void 0 : _getListContainer4.remove();
555
+ (_getListContainerWrap = getListContainerWrapper()) === null || _getListContainerWrap === void 0 ? void 0 : _getListContainerWrap.remove();
471
556
  };
472
557
  }, []);
473
558
  return /*#__PURE__*/_react.default.createElement("div", {
@@ -520,7 +605,8 @@ const TagsDropdown = _ref => {
520
605
  onKeyDown: e => onKeyPress(e, searchValue),
521
606
  onFocus: e => {
522
607
  var _e$target;
523
- if (isMobile) e === null || e === void 0 || (_e$target = e.target) === null || _e$target === void 0 || _e$target.blur();
608
+
609
+ if (isMobile) e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.blur();
524
610
  }
525
611
  }, attributesOfNativeInput)) : "", isOpen && renderListContainer(), /*#__PURE__*/_react.default.createElement("span", {
526
612
  className: (0, _classnames.default)("".concat(RC, "__arrow"), {
@@ -534,4 +620,6 @@ const TagsDropdown = _ref => {
534
620
  className: "color--text"
535
621
  }))));
536
622
  };
537
- var _default = exports.default = TagsDropdown;
623
+
624
+ var _default = TagsDropdown;
625
+ exports.default = _default;
@@ -1,16 +1,21 @@
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
  require("./Text.scss");
12
- const RC = "text";
13
17
 
18
+ const RC = "text";
14
19
  /**
15
20
  *
16
21
  * @param value
@@ -23,7 +28,6 @@ const RC = "text";
23
28
  * @return {JSX.Element|null}
24
29
  * @constructor
25
30
  */
26
-
27
31
  //? Прототип лежит на проекте кабинета src\JS\Components\Atomic\FormElements\Text\Text.js
28
32
  //? Что поменял?
29
33
  //? - в верстке убрал дополнительную вложенность
@@ -35,18 +39,13 @@ const RC = "text";
35
39
  //? - переработал пропу link, может быть строкой или объектом
36
40
  //? если это объект, то у него могут быть свойства
37
41
  //? - path - значение для href
38
-
39
42
  //? - target - значение для атрибута target, имеет смысл передавать, если не передаются onClick или redirect
40
-
41
43
  //? - onClick - альтернативный обработчик нажатия, если он есть то он будет ипользован в приоритете,
42
44
  //? ф-я будет вызвана с 1 аргументом - props, в объекте props будет свойство ev (event) и все содержание link,
43
45
  //? по умолчанию до использования onClick будут вызваны e.preventDefault() и e.stopPropagation
44
-
45
46
  //? - redirect - альтернативный исполнитель редиректа (например history.push),
46
47
  //? если есть и нет onClick - будет вызван с одним аргументом (link.path)
47
-
48
48
  //? - isNoPreventDefault - отключает вызов e.preventDefault перед вызовом onClick или redirect
49
-
50
49
  //? - isNoStopPropagation - отключает вызов e.preventDefault перед вызовом onClick или redirect
51
50
 
52
51
  const Text = _ref => {
@@ -72,17 +71,19 @@ const Text = _ref => {
72
71
  isNoPreventDefault,
73
72
  isNoStopPropagation
74
73
  } = linkObj;
74
+
75
75
  const preparedPath = (() => {
76
76
  if (!isLink) return "";
77
77
  return isLinkAsObj ? path : link;
78
78
  })();
79
+
79
80
  const atributes = {};
81
+
80
82
  if (typeof onClickInner === "function" || typeof redirect === "function") {
81
83
  atributes.onClick = function onClick(ev) {
82
84
  if (!isNoPreventDefault) ev.preventDefault();
83
- if (!isNoStopPropagation) ev.stopPropagation();
85
+ if (!isNoStopPropagation) ev.stopPropagation(); //? если переданы и onClick, и redirect, то onClick считается приоритетнее redirect
84
86
 
85
- //? если переданы и onClick, и redirect, то onClick считается приоритетнее redirect
86
87
  if (onClickInner) {
87
88
  onClickInner({
88
89
  ev,
@@ -90,12 +91,15 @@ const Text = _ref => {
90
91
  });
91
92
  return;
92
93
  }
94
+
93
95
  redirect(preparedPath);
94
96
  };
95
97
  }
98
+
96
99
  const mainInner = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, icon && /*#__PURE__*/_react.default.createElement("div", {
97
100
  className: "".concat(RC, "__icon-container")
98
101
  }, icon), value);
102
+
99
103
  return /*#__PURE__*/_react.default.createElement("div", {
100
104
  "data-testid": "text--".concat(testId),
101
105
  className: (0, _classnames.default)(RC, className, {
@@ -111,4 +115,6 @@ const Text = _ref => {
111
115
  rel: "noreferrer"
112
116
  }), mainInner) : mainInner);
113
117
  };
114
- var _default = exports.default = Text;
118
+
119
+ var _default = Text;
120
+ exports.default = _default;
@@ -1,14 +1,20 @@
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 = _interopRequireDefault(require("react"));
11
+
9
12
  var _classnames = _interopRequireDefault(require("classnames"));
13
+
10
14
  require("./TextSwitcher.scss");
15
+
11
16
  const RC = "text-switcher";
17
+
12
18
  const TextSwitcher = _ref => {
13
19
  let {
14
20
  isActive,
@@ -37,4 +43,6 @@ const TextSwitcher = _ref => {
37
43
  })
38
44
  }));
39
45
  };
40
- var _default = exports.default = TextSwitcher;
46
+
47
+ var _default = TextSwitcher;
48
+ exports.default = _default;
@@ -1,15 +1,22 @@
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 = _interopRequireDefault(require("react"));
11
+
9
12
  var _classnames = _interopRequireDefault(require("classnames"));
13
+
10
14
  var _fieldValueFormatters = require("../../../Functions/fieldValueFormatters");
15
+
11
16
  require("./Textarea.scss");
17
+
12
18
  const RC = "textarea";
19
+
13
20
  const Textarea = _ref => {
14
21
  let {
15
22
  value,
@@ -38,4 +45,6 @@ const Textarea = _ref => {
38
45
  disabled: disabled
39
46
  }));
40
47
  };
41
- var _default = exports.default = Textarea;
48
+
49
+ var _default = Textarea;
50
+ exports.default = _default;