intelicoreact 1.6.22 → 1.6.24

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 (275) hide show
  1. package/dist/Atomic/FormElements/ActionAlert/ActionAlert.js +98 -1
  2. package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.js +48 -1
  3. package/dist/Atomic/FormElements/Calendar/Calendar.js +249 -1
  4. package/dist/Atomic/FormElements/Calendar/Calendar.props.js +4 -1
  5. package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.js +65 -1
  6. package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.js +52 -1
  7. package/dist/Atomic/FormElements/Datepicker/Datepicker.js +424 -1
  8. package/dist/Atomic/FormElements/Datepicker/Datepicker.props.js +4 -1
  9. package/dist/Atomic/FormElements/Datepicker/components/DatepickerCalendar.js +173 -1
  10. package/dist/Atomic/FormElements/Datepicker/components/DatepickerCalendar.props.js +4 -1
  11. package/dist/Atomic/FormElements/Dropdown/Dropdown.js +735 -1
  12. package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.js +20 -1
  13. package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.js +529 -1
  14. package/dist/Atomic/FormElements/FileLoader/FileLoader.js +94 -1
  15. package/dist/Atomic/FormElements/FileLoader/partial/LoadZone.js +105 -1
  16. package/dist/Atomic/FormElements/FileLoader/partial/LoadedContent.js +67 -1
  17. package/dist/Atomic/FormElements/FileLoaderDescription/FileLoaderDescription.js +247 -1
  18. package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.js +160 -1
  19. package/dist/Atomic/FormElements/FileLoaderLocalGroup/FileLoaderLocalGroup.js +193 -1
  20. package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.js +135 -1
  21. package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN_old.js +116 -1
  22. package/dist/Atomic/FormElements/Input/Input.js +467 -1
  23. package/dist/Atomic/FormElements/InputCalendar/InputCalendar.js +161 -1
  24. package/dist/Atomic/FormElements/InputColor/InputColor.js +64 -1
  25. package/dist/Atomic/FormElements/InputCurrency/InputCurrency.js +200 -1
  26. package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +354 -1
  27. package/dist/Atomic/FormElements/InputDateRange/components/DateInput.js +71 -1
  28. package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.js +693 -1
  29. package/dist/Atomic/FormElements/InputDateRange/components/OpenedPart.js +254 -1
  30. package/dist/Atomic/FormElements/InputDateRange/components/SelectItem.js +32 -1
  31. package/dist/Atomic/FormElements/InputDateRange/dependencies.js +200 -1
  32. package/dist/Atomic/FormElements/InputLink/InputLink.js +99 -1
  33. package/dist/Atomic/FormElements/InputMask/InputCarretPosition.js +37 -1
  34. package/dist/Atomic/FormElements/InputMask/InputMask.js +1214 -1
  35. package/dist/Atomic/FormElements/InputMask/config.js +15 -1
  36. package/dist/Atomic/FormElements/InputMask/functions.js +58 -1
  37. package/dist/Atomic/FormElements/InputMask2/InputMask2.js +674 -1
  38. package/dist/Atomic/FormElements/InputMask2/config.js +15 -1
  39. package/dist/Atomic/FormElements/InputMask2/functions.js +58 -1
  40. package/dist/Atomic/FormElements/InputMask3/InputMask3.js +766 -1
  41. package/dist/Atomic/FormElements/InputMask3/config.js +15 -1
  42. package/dist/Atomic/FormElements/InputMask3/functions.js +58 -1
  43. package/dist/Atomic/FormElements/InputWithAction/InputWithAction.js +114 -1
  44. package/dist/Atomic/FormElements/InputsRow/InputsRow.js +140 -1
  45. package/dist/Atomic/FormElements/Label/Label.js +87 -1
  46. package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +506 -1
  47. package/dist/Atomic/FormElements/MultiSelect/MultiSelect.js +45 -1
  48. package/dist/Atomic/FormElements/NumericInput/NumericInput.js +331 -1
  49. package/dist/Atomic/FormElements/RadioGroup/RadioGroup.js +66 -1
  50. package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +80 -1
  51. package/dist/Atomic/FormElements/RadioInput/RadioInput.js +57 -1
  52. package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.js +54 -1
  53. package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +183 -1
  54. package/dist/Atomic/FormElements/RangeInputs/RangeInputs.js +222 -1
  55. package/dist/Atomic/FormElements/RangeList/RangeList.js +175 -1
  56. package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.js +43 -1
  57. package/dist/Atomic/FormElements/RangeSlider/RangeSlider.js +443 -1
  58. package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +858 -1
  59. package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.js +39 -1
  60. package/dist/Atomic/FormElements/Switcher/Switcher.js +59 -1
  61. package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.js +50 -1
  62. package/dist/Atomic/FormElements/SwitcherHide/SwitcherHide.js +44 -1
  63. package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.js +100 -1
  64. package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.js +52 -1
  65. package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.js +64 -1
  66. package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.js +170 -1
  67. package/dist/Atomic/FormElements/SwitcherTagsDropdown/partial/States.js +202 -1
  68. package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.js +67 -1
  69. package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.js +115 -1
  70. package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.interface.ts +2 -2
  71. package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +1110 -1
  72. package/dist/Atomic/FormElements/Text/Text.js +125 -1
  73. package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.js +49 -1
  74. package/dist/Atomic/FormElements/Textarea/Textarea.js +80 -1
  75. package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +176 -1
  76. package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.js +62 -1
  77. package/dist/Atomic/FormElements/TimeRange/TimeRange.js +119 -1
  78. package/dist/Atomic/FormElements/UserContacts/UserContacts.js +188 -1
  79. package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.js +83 -1
  80. package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.js +82 -1
  81. package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.js +101 -1
  82. package/dist/Atomic/FormElements/WidgetPseudoTable/partial/constructor.js +29 -1
  83. package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.js +113 -1
  84. package/dist/Atomic/FormElements/WidgetWithSwitchableRows/partial/constructor.js +30 -1
  85. package/dist/Atomic/Layout/Header/Header.js +85 -1
  86. package/dist/Atomic/Layout/Spinner/Spinner.js +44 -1
  87. package/dist/Atomic/UI/Accordion/Accordion.js +108 -1
  88. package/dist/Atomic/UI/Accordion/AccordionItem.js +176 -1
  89. package/dist/Atomic/UI/AccordionTable/AccordionTable.js +238 -1
  90. package/dist/Atomic/UI/AccordionText/AccordionText.js +69 -1
  91. package/dist/Atomic/UI/AdvancedTag/AdvTag.js +207 -1
  92. package/dist/Atomic/UI/AdvancedTag/AdvancedTags.js +56 -1
  93. package/dist/Atomic/UI/Alert/Alert.js +72 -1
  94. package/dist/Atomic/UI/Arrow/Arrow.js +132 -1
  95. package/dist/Atomic/UI/Box/Box.js +52 -1
  96. package/dist/Atomic/UI/Button/Button.js +47 -1
  97. package/dist/Atomic/UI/ButtonsBar/ButtonsBar.js +72 -1
  98. package/dist/Atomic/UI/Chart/Chart.js +172 -1
  99. package/dist/Atomic/UI/Chart/partial/Chart.constants.js +95 -1
  100. package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +80 -1
  101. package/dist/Atomic/UI/Chart/partial/datasetSetters.js +188 -1
  102. package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +335 -1
  103. package/dist/Atomic/UI/Chart/partial/optionsSetters.js +43 -1
  104. package/dist/Atomic/UI/Chart/partial/utils.js +60 -1
  105. package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +109 -1
  106. package/dist/Atomic/UI/DateTime/DateTime.js +57 -1
  107. package/dist/Atomic/UI/DebugContainer/DebugContainer.js +44 -1
  108. package/dist/Atomic/UI/DebugContainer/useDebugContainer.js +15 -1
  109. package/dist/Atomic/UI/DoubleString/DoubleString.js +102 -1
  110. package/dist/Atomic/UI/DynamicIcon/DynamicIcon.js +70 -1
  111. package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +221 -1
  112. package/dist/Atomic/UI/ExampleChartIntegration/partial/utils.js +106 -1
  113. package/dist/Atomic/UI/Hint/Hint.js +256 -1
  114. package/dist/Atomic/UI/Hint/partials/_utils.js +64 -1
  115. package/dist/Atomic/UI/Modal/Modal.js +179 -1
  116. package/dist/Atomic/UI/Modal/ModalHOC.js +97 -1
  117. package/dist/Atomic/UI/Modal/partials/ModalFooter.js +71 -1
  118. package/dist/Atomic/UI/Modal/partials/ModalTitle.js +110 -1
  119. package/dist/Atomic/UI/Modal/partials/useMobileModal.js +192 -1
  120. package/dist/Atomic/UI/MonoAccordion/MonoAccordion._test.js +75 -1
  121. package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +80 -1
  122. package/dist/Atomic/UI/NavLine/NavLine.js +317 -1
  123. package/dist/Atomic/UI/PageTitle/PageTitle.js +77 -1
  124. package/dist/Atomic/UI/PieChart/PieChart.js +42 -1
  125. package/dist/Atomic/UI/Price/Price.js +31 -1
  126. package/dist/Atomic/UI/PriceRange/PriceRange.js +44 -1
  127. package/dist/Atomic/UI/ProgressLine/ProgressLine.js +98 -1
  128. package/dist/Atomic/UI/Status/Status.js +67 -1
  129. package/dist/Atomic/UI/Table/Partials/TdCell.js +87 -1
  130. package/dist/Atomic/UI/Table/Partials/TdHeader.js +38 -1
  131. package/dist/Atomic/UI/Table/Partials/TdRow.js +99 -1
  132. package/dist/Atomic/UI/Table/Partials/TdTitle.js +52 -1
  133. package/dist/Atomic/UI/Table/Table.js +63 -1
  134. package/dist/Atomic/UI/Table/TdTypes/TdActions.js +80 -1
  135. package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +28 -1
  136. package/dist/Atomic/UI/Table/TdTypes/TdRange.js +13 -1
  137. package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +53 -1
  138. package/dist/Atomic/UI/Tag/Tag.js +167 -1
  139. package/dist/Atomic/UI/TagList/TagList.js +251 -1
  140. package/dist/Atomic/UI/UserBox/UserBox.js +86 -1
  141. package/dist/Atomic/UI/WizardStepper/constructor.js +84 -1
  142. package/dist/Atomic/UI/WizardStepper/index.js +3 -1
  143. package/dist/Atomic/UI/WizardStepper/ui/StateIcon/StateIcon.js +37 -1
  144. package/dist/Atomic/UI/WizardStepper/ui/StateIcon/index.js +3 -1
  145. package/dist/Atomic/UI/WizardStepper/ui/StepRow/StepRow.js +61 -1
  146. package/dist/Atomic/UI/WizardStepper/ui/StepRow/index.js +3 -1
  147. package/dist/Atomic/UI/WizardStepper/ui/StepWrapper/StepWrapper.js +39 -1
  148. package/dist/Atomic/UI/WizardStepper/ui/StepWrapper/index.js +3 -1
  149. package/dist/Atomic/UI/WizardStepper/ui/icons.js +49 -1
  150. package/dist/Atomic/UI/WizardStepper/ui/index.js +3 -1
  151. package/dist/Classes/AbortableFetch.js +454 -1
  152. package/dist/Classes/AnimatedHandler.js +47 -1
  153. package/dist/Classes/RESTAPI/index.js +228 -1
  154. package/dist/Classes/RESTAPI/partials/AbortableFetch.js +457 -1
  155. package/dist/Classes/RESTAPI/partials/ApiBase.js +48 -1
  156. package/dist/Classes/RESTAPI/partials/ApiRequestCreators.js +112 -1
  157. package/dist/Classes/RESTAPI/partials/ApiUtils.js +189 -1
  158. package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +252 -1
  159. package/dist/Classes/RESTAPI/partials/Utils.js +92 -1
  160. package/dist/Classes/RESTAPI/partials/_outerDependencies.js +3 -1
  161. package/dist/Classes/RESTAPI/partials/_utils.js +197 -1
  162. package/dist/Constants/index.constants.js +78 -1
  163. package/dist/Functions/Portal.js +22 -1
  164. package/dist/Functions/customEventListener.js +96 -1
  165. package/dist/Functions/dateTime.js +149 -1
  166. package/dist/Functions/fieldValueFormatters.js +405 -1
  167. package/dist/Functions/guards/assertions.js +294 -1
  168. package/dist/Functions/guards/safeValue.js +75 -1
  169. package/dist/Functions/guards/typeGuards.js +373 -1
  170. package/dist/Functions/hooks/useFormFieldsChangesManager.js +95 -1
  171. package/dist/Functions/locale/createTranslator.js +32 -1
  172. package/dist/Functions/operations.js +130 -1
  173. package/dist/Functions/presets/inputMaskPresets.js +170 -1
  174. package/dist/Functions/presets/inputPresets.js +60 -1
  175. package/dist/Functions/presets/mobileKeyboardTypesPresets.js +45 -1
  176. package/dist/Functions/schemas.js +31 -1
  177. package/dist/Functions/useBodyScrollLock.js +17 -1
  178. package/dist/Functions/useClickOutside.js +15 -1
  179. package/dist/Functions/useDebounce.js +17 -1
  180. package/dist/Functions/useFieldFocus.js +84 -1
  181. package/dist/Functions/useFormTools/form-drivers/ArrayWithObjects.js +39 -1
  182. package/dist/Functions/useFormTools/form-drivers/ObjectWithIterableObjects.js +159 -1
  183. package/dist/Functions/useFormTools/form-drivers/ObjectWithNamedKeyObjects.js +78 -1
  184. package/dist/Functions/useFormTools/functions/General.js +134 -1
  185. package/dist/Functions/useFormTools/functions/RenderFields.js +111 -1
  186. package/dist/Functions/useFormTools/functions/usePrevious.js +12 -1
  187. package/dist/Functions/useFormTools/index.js +778 -1
  188. package/dist/Functions/useInputHighlightError.js +67 -1
  189. package/dist/Functions/useIsMobile/useIsMobile.js +33 -1
  190. package/dist/Functions/useKeyPress/useHandleKeyPress.js +52 -1
  191. package/dist/Functions/useKeyPress/useKeyPress.js +52 -1
  192. package/dist/Functions/useLocalStorage.js +34 -1
  193. package/dist/Functions/useLocationParams.js +27 -1
  194. package/dist/Functions/useMediaQuery.js +17 -1
  195. package/dist/Functions/useMetaInfo.js +43 -1
  196. package/dist/Functions/useMouseUpOutside.js +16 -1
  197. package/dist/Functions/useOnlineStatus.js +29 -1
  198. package/dist/Functions/usePasswordChecker.js +110 -1
  199. package/dist/Functions/usePrevious.js +12 -1
  200. package/dist/Functions/useResize.js +31 -1
  201. package/dist/Functions/useScrollTo.js +17 -1
  202. package/dist/Functions/useToggle.js +17 -1
  203. package/dist/Functions/utils.js +522 -1
  204. package/dist/Langs.js +168 -1
  205. package/dist/Molecular/CustomIcons/components/AffiliateNetworks.js +21 -1
  206. package/dist/Molecular/CustomIcons/components/AlertCircle.js +23 -1
  207. package/dist/Molecular/CustomIcons/components/AppStore.js +29 -1
  208. package/dist/Molecular/CustomIcons/components/Arrow.js +32 -1
  209. package/dist/Molecular/CustomIcons/components/ArrowDown.js +17 -1
  210. package/dist/Molecular/CustomIcons/components/ArrowLeft.js +22 -1
  211. package/dist/Molecular/CustomIcons/components/ArrowRight.js +22 -1
  212. package/dist/Molecular/CustomIcons/components/ArrowUp.js +17 -1
  213. package/dist/Molecular/CustomIcons/components/Bell.js +15 -1
  214. package/dist/Molecular/CustomIcons/components/Button.js +12 -1
  215. package/dist/Molecular/CustomIcons/components/Campaigns.js +16 -1
  216. package/dist/Molecular/CustomIcons/components/Check.js +14 -1
  217. package/dist/Molecular/CustomIcons/components/Check2.js +12 -1
  218. package/dist/Molecular/CustomIcons/components/ChevronDown.js +12 -1
  219. package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.js +11 -1
  220. package/dist/Molecular/CustomIcons/components/ChevronLeft.js +11 -1
  221. package/dist/Molecular/CustomIcons/components/ChevronRight.js +11 -1
  222. package/dist/Molecular/CustomIcons/components/ChevronUp.js +11 -1
  223. package/dist/Molecular/CustomIcons/components/ChevronUpDown.js +27 -1
  224. package/dist/Molecular/CustomIcons/components/Close.js +14 -1
  225. package/dist/Molecular/CustomIcons/components/ColumnsOrder.js +17 -1
  226. package/dist/Molecular/CustomIcons/components/Delete.js +16 -1
  227. package/dist/Molecular/CustomIcons/components/Edit.js +15 -1
  228. package/dist/Molecular/CustomIcons/components/Email.js +31 -1
  229. package/dist/Molecular/CustomIcons/components/FinturfLogo.js +18 -1
  230. package/dist/Molecular/CustomIcons/components/FinturfLogo2.js +35 -1
  231. package/dist/Molecular/CustomIcons/components/Flows.js +15 -1
  232. package/dist/Molecular/CustomIcons/components/Gift.js +25 -1
  233. package/dist/Molecular/CustomIcons/components/GoogleAuth.js +29 -1
  234. package/dist/Molecular/CustomIcons/components/GooglePlay.js +29 -1
  235. package/dist/Molecular/CustomIcons/components/HelpCircle.js +19 -1
  236. package/dist/Molecular/CustomIcons/components/HelpCircle2.js +20 -1
  237. package/dist/Molecular/CustomIcons/components/HelpCircleFilled.js +19 -1
  238. package/dist/Molecular/CustomIcons/components/Home.js +16 -1
  239. package/dist/Molecular/CustomIcons/components/Home2.js +22 -1
  240. package/dist/Molecular/CustomIcons/components/Key.js +23 -1
  241. package/dist/Molecular/CustomIcons/components/Landers.js +20 -1
  242. package/dist/Molecular/CustomIcons/components/Lock.js +15 -1
  243. package/dist/Molecular/CustomIcons/components/Mail.js +26 -1
  244. package/dist/Molecular/CustomIcons/components/Mastercard.js +73 -1
  245. package/dist/Molecular/CustomIcons/components/Minus.js +25 -1
  246. package/dist/Molecular/CustomIcons/components/Offers.js +16 -1
  247. package/dist/Molecular/CustomIcons/components/Pause.js +28 -1
  248. package/dist/Molecular/CustomIcons/components/PayPal.js +41 -1
  249. package/dist/Molecular/CustomIcons/components/PayPalLightLarge.js +28 -1
  250. package/dist/Molecular/CustomIcons/components/Phone.js +30 -1
  251. package/dist/Molecular/CustomIcons/components/Play.js +25 -1
  252. package/dist/Molecular/CustomIcons/components/Plus.js +25 -1
  253. package/dist/Molecular/CustomIcons/components/Profile.js +16 -1
  254. package/dist/Molecular/CustomIcons/components/QRCode.js +29 -1
  255. package/dist/Molecular/CustomIcons/components/Rectangle.js +12 -1
  256. package/dist/Molecular/CustomIcons/components/Revert.js +13 -1
  257. package/dist/Molecular/CustomIcons/components/Star.js +14 -1
  258. package/dist/Molecular/CustomIcons/components/Star2.js +16 -1
  259. package/dist/Molecular/CustomIcons/components/TrafficSources.js +14 -1
  260. package/dist/Molecular/CustomIcons/components/Trash.js +15 -1
  261. package/dist/Molecular/CustomIcons/components/TrashRed.js +15 -1
  262. package/dist/Molecular/CustomIcons/components/Triggers.js +15 -1
  263. package/dist/Molecular/CustomIcons/components/User.js +25 -1
  264. package/dist/Molecular/CustomIcons/components/Visa.js +31 -1
  265. package/dist/Molecular/CustomIcons/components/X.js +12 -1
  266. package/dist/Molecular/CustomIcons/index.js +61 -1
  267. package/dist/Molecular/FormElement/FormElement.js +54 -1
  268. package/dist/Molecular/FormWithDependOn/FormWithDependOn.js +184 -1
  269. package/dist/Molecular/FormWithDependOn/partials/_utils.js +53 -1
  270. package/dist/Molecular/InputAddress/InputAddress.js +626 -1
  271. package/dist/Molecular/InputPassword/InputPassword.js +48 -1
  272. package/dist/index.js +104 -1
  273. package/package.json +1 -1
  274. package/dist/Molecular/InputAddress/InputAddress.d.ts +0 -26
  275. package/dist/Molecular/InputAddress/InputAddress.js.map +0 -1
@@ -1 +1,109 @@
1
- function r(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,i=Array(t);e<t;e++)i[e]=r[e];return i}import{jsx as t,jsxs as e}from"react/jsx-runtime";import{useEffect as i,useState as s}from"react";import o from"classnames";import"./CircleProgressBar.scss";export default function(n){var a,l=n.amount,c=n.totalAmount,d=n.isReverseType,f=n.children,m=n.className,u=n.colors,p=n.isInnerLine,h=n.radius,g=void 0===h?59:h,y=n.strokeWidth,v=n.innerLineStrokeWidth,b=n.testId,x=Math.round(2*Math.PI*g),S=l<c?Math.round(l/c*100):100,k={start:"#6b81dd",finish:"#f06d8d",meter:"#ffcad6"},_=(a=s(d?String(0):x),function(r){if(Array.isArray(r))return r}(a)||function(r,t){var e,i,s=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=s){var o=[],n=!0,a=!1;try{for(s=s.call(r);!(n=(e=s.next()).done)&&(o.push(e.value),o.length!==t);n=!0);}catch(r){a=!0,i=r}finally{try{n||null==s.return||s.return()}finally{if(a)throw i}}return o}}(a,2)||function(t,e){if(t){if("string"==typeof t)return r(t,2);var i=Object.prototype.toString.call(t).slice(8,-1);if("Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i)return Array.from(i);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return r(t,e)}}(a,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),A=_[0],j=_[1];return i(function(){j(x-x*S/100)},[S]),e("div",{"data-testid":void 0===b?"circle-progress-bar":b,className:o("limit-progress-bar",{"limit-progress-bar--reverse":d},m),children:[e("svg",{className:"limit-progress-bar__progress",width:"124",height:"124",viewBox:"0 0 124 124",children:[t("defs",{children:d?e("linearGradient",{id:"limit-progress-bar-linear-gradient-reverse",x1:"0",y1:"1",x2:"0",y2:"0",children:[t("stop",{offset:"0",stopColor:u.finish||k.finish}),t("stop",{offset:"1",stopColor:u.start||k.start})]}):e("linearGradient",{id:"limit-progress-bar-linear-gradient",x1:"0",y1:"1",x2:"0",y2:"0",children:[t("stop",{offset:"0",stopColor:u.start||k.start}),t("stop",{offset:"1",stopColor:u.finish||k.finish})]})}),t("circle",{className:"limit-progress-bar__meter",cx:g,cy:g,r:g,stroke:p?u.meter||k.meter:"",strokeWidth:String(void 0===v?2:v)}),t("circle",{className:"limit-progress-bar__value",cx:g,cy:g,r:g,strokeWidth:String(void 0===y?2:y),stroke:"url(#limit-progress-bar-linear-gradient".concat(d?"-reverse":"",")"),style:{strokeDasharray:x,strokeDashoffset:A}})]}),t("div",{className:"limit-progress-bar__content",children:f})]})}
1
+ import React, { useEffect, useState } from "react";
2
+
3
+ import cn from "classnames";
4
+
5
+ import "./CircleProgressBar.scss";
6
+
7
+ const CircleProgressBar = ({
8
+ amount,
9
+ totalAmount,
10
+ isReverseType,
11
+ children,
12
+ className,
13
+ colors,
14
+ isInnerLine,
15
+ radius = 59,
16
+ strokeWidth = 2,
17
+ innerLineStrokeWidth = 2,
18
+ testId = "circle-progress-bar",
19
+ }) => {
20
+ const circumference = Math.round(2 * Math.PI * radius);
21
+ const amountProgress =
22
+ amount < totalAmount ? Math.round((amount / totalAmount) * 100) : 100; //%
23
+ const defaultColors = {
24
+ start: "#6b81dd",
25
+ finish: "#f06d8d",
26
+ meter: "#ffcad6",
27
+ };
28
+
29
+ const [strokeDashoffset, setStrokeDashoffset] = useState(isReverseType ? String(0) : circumference);
30
+
31
+ useEffect(() => {
32
+ setStrokeDashoffset(circumference - (circumference * amountProgress) / 100);
33
+ }, [amountProgress]);
34
+
35
+ return (
36
+ <div
37
+ data-testid={testId}
38
+ className={cn("limit-progress-bar", { "limit-progress-bar--reverse": isReverseType }, className)}
39
+ >
40
+ <svg
41
+ className="limit-progress-bar__progress"
42
+ width="124"
43
+ height="124"
44
+ viewBox="0 0 124 124"
45
+ >
46
+ <defs>
47
+ {isReverseType ? (
48
+ <linearGradient
49
+ id="limit-progress-bar-linear-gradient-reverse"
50
+ x1="0"
51
+ y1="1"
52
+ x2="0"
53
+ y2="0"
54
+ >
55
+ <stop
56
+ offset="0"
57
+ stopColor={colors.finish || defaultColors.finish}
58
+ />
59
+ <stop
60
+ offset="1"
61
+ stopColor={colors.start || defaultColors.start}
62
+ />
63
+ </linearGradient>
64
+ ) : (
65
+ <linearGradient
66
+ id="limit-progress-bar-linear-gradient"
67
+ x1="0"
68
+ y1="1"
69
+ x2="0"
70
+ y2="0"
71
+ >
72
+ <stop
73
+ offset="0"
74
+ stopColor={colors.start || defaultColors.start}
75
+ />
76
+ <stop
77
+ offset="1"
78
+ stopColor={colors.finish || defaultColors.finish}
79
+ />
80
+ </linearGradient>
81
+ )}
82
+ </defs>
83
+ <circle
84
+ className="limit-progress-bar__meter"
85
+ cx={radius}
86
+ cy={radius}
87
+ r={radius}
88
+ stroke={!isInnerLine ? "" : colors.meter || defaultColors.meter}
89
+ strokeWidth={String(innerLineStrokeWidth)}
90
+ />
91
+ <circle
92
+ className="limit-progress-bar__value"
93
+ cx={radius}
94
+ cy={radius}
95
+ r={radius}
96
+ strokeWidth={String(strokeWidth)}
97
+ stroke={`url(#limit-progress-bar-linear-gradient${isReverseType ? "-reverse" : ""})`}
98
+ style={{
99
+ strokeDasharray: circumference,
100
+ strokeDashoffset,
101
+ }}
102
+ />
103
+ </svg>
104
+ <div className="limit-progress-bar__content">{children}</div>
105
+ </div>
106
+ );
107
+ };
108
+
109
+ export default CircleProgressBar;
@@ -1 +1,57 @@
1
- import{jsx as t,jsxs as e}from"react/jsx-runtime";import{useMemo as a}from"react";import r from"classnames";import m from"moment-timezone";import"./DateTime.scss";var o="date-time";export default function(i){var s,c,n,d=i.className,l=i.value,u=i.valueFormat,f=i.dateFormat,p=i.timeFormat,v=i.isNoDate,N=i.isNoTime,_=i.testId,b=void 0===_?"date-time":_,j=f||"DD.MM.YYYY",x=p||"HH:mm:ss",D=a(function(){return(u?m(l,u):m(l)).format(j)},[l,u,j]),Y=a(function(){return(u?m(l,u):m(l)).format(x)},[l,u,x]);return e("div",{"data-testid":b,className:r(o,d),children:[!v&&t("span",{"data-testid":"".concat(b,"-date"),className:r("".concat(o,"__date")),children:D}),!N&&t("span",{"data-testid":"".concat(b,"-time"),className:r("".concat(o,"__time"),(s={},c="".concat(o,"_color--pause"),n=!v,c in s?Object.defineProperty(s,c,{value:n,enumerable:!0,configurable:!0,writable:!0}):s[c]=n,s)),children:Y})]})}
1
+ import React, { useMemo } from "react";
2
+
3
+ import cn from "classnames";
4
+ import moment from "moment-timezone";
5
+
6
+ import "./DateTime.scss";
7
+
8
+ const RC = "date-time";
9
+
10
+ const DEFAULT_DATE_FORMAT = "DD.MM.YYYY";
11
+ const DEFAULT_TIME_FORMAT = "HH:mm:ss";
12
+
13
+ const DateTime = ({
14
+ className,
15
+ value,
16
+ valueFormat,
17
+ dateFormat: inputDateFormat,
18
+ timeFormat: inputTimeFormat,
19
+ isNoDate,
20
+ isNoTime,
21
+ testId = "date-time",
22
+ }) => {
23
+ const dateFormat = inputDateFormat ? inputDateFormat : DEFAULT_DATE_FORMAT;
24
+ const timeFormat = inputTimeFormat ? inputTimeFormat : DEFAULT_TIME_FORMAT;
25
+
26
+ const date = useMemo(
27
+ () =>
28
+ (valueFormat ? moment(value, valueFormat) : moment(value)).format(
29
+ dateFormat,
30
+ ),
31
+ [value, valueFormat, dateFormat],
32
+ );
33
+ const time = useMemo(
34
+ () =>
35
+ (valueFormat ? moment(value, valueFormat) : moment(value)).format(
36
+ timeFormat,
37
+ ),
38
+ [value, valueFormat, timeFormat],
39
+ );
40
+
41
+ return (
42
+ <div data-testid={testId} className={cn(RC, className)}>
43
+ {!isNoDate && (
44
+ <span data-testid={`${testId}-date`} className={cn(`${RC}__date`)}>
45
+ {date}
46
+ </span>
47
+ )}
48
+ {!isNoTime && (
49
+ <span data-testid={`${testId}-time`} className={cn(`${RC}__time`, { [`${RC}_color--pause`]: !isNoDate })}>
50
+ {time}
51
+ </span>
52
+ )}
53
+ </div>
54
+ );
55
+ };
56
+
57
+ export default DateTime;
@@ -1 +1,44 @@
1
- function r(r,n){(null==n||n>r.length)&&(n=r.length);for(var t=0,e=Array(n);t<n;t++)e[t]=r[t];return e}import{jsx as n,jsxs as t}from"react/jsx-runtime";import{useState as e}from"react";import{ChevronDown as o,ChevronUp as a}from"react-feather";import"./DebugContainer.scss";export default function(i){var l,c,u,d,s=i.data,f=i.children,m=(l=e(!0),function(r){if(Array.isArray(r))return r}(l)||function(r,n){var t,e,o=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(r);!(i=(t=o.next()).done)&&(a.push(t.value),a.length!==n);i=!0);}catch(r){l=!0,e=r}finally{try{i||null==o.return||o.return()}finally{if(l)throw e}}return a}}(l,2)||function(n,t){if(n){if("string"==typeof n)return r(n,2);var e=Object.prototype.toString.call(n).slice(8,-1);if("Object"===e&&n.constructor&&(e=n.constructor.name),"Map"===e||"Set"===e)return Array.from(e);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return r(n,t)}}(l,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),y=m[0],b=m[1];return t("div",{className:"debug-container",children:[y&&t("div",{className:"debug-container__body",children:[n("h5",{children:"Debug:"}),s&&!!(null==(d=Object)||null==(u=d.keys(s))?void 0:u.length)&&n("div",{className:"debug-container__body-row",children:t("pre",{children:["{\n",null==(c=Object.keys(s))?void 0:c.map(function(r){return" ".concat(r,": ").concat(null==s?void 0:s[r],",\n")}),"}"]})}),f&&n("div",{className:"debug-container__body-row",children:f})]}),n("div",{className:"debug-container__toggler",onClick:function(){return b(function(r){return!r})},children:y?n(a,{}):n(o,{})})]})}
1
+ import React, { useState } from "react";
2
+
3
+ import { ChevronDown, ChevronUp } from "react-feather";
4
+
5
+ import "./DebugContainer.scss";
6
+
7
+ const DebugContainer = ({ data, children }) => {
8
+ const [isVisible, setIsVisible] = useState(true);
9
+ const renderData = () => {
10
+ return (
11
+ <pre>
12
+ {"{\n"}
13
+ {Object.keys(data)?.map((key) => {
14
+ return ` ${key}: ${data?.[key]},\n`;
15
+ })}
16
+ {"}"}
17
+ </pre>
18
+ );
19
+ };
20
+
21
+ return (
22
+ <div className="debug-container">
23
+ {isVisible && (
24
+ <div className="debug-container__body">
25
+ <h5>Debug:</h5>
26
+ {data && Boolean(Object?.keys(data)?.length) && (
27
+ <div className="debug-container__body-row">{renderData()}</div>
28
+ )}
29
+ {children && (
30
+ <div className="debug-container__body-row">{children}</div>
31
+ )}
32
+ </div>
33
+ )}
34
+ <div
35
+ className="debug-container__toggler"
36
+ onClick={() => setIsVisible((v) => !v)}
37
+ >
38
+ {isVisible ? <ChevronUp /> : <ChevronDown />}
39
+ </div>
40
+ </div>
41
+ );
42
+ };
43
+
44
+ export default DebugContainer;
@@ -1 +1,15 @@
1
- function r(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=Array(t);e<t;e++)n[e]=r[e];return n}import{jsx as t}from"react/jsx-runtime";import{useState as e}from"react";import n from"./DebugContainer";export default function(){var o,a=(o=e({}),function(r){if(Array.isArray(r))return r}(o)||function(r,t){var e,n,o=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=o){var a=[],u=!0,i=!1;try{for(o=o.call(r);!(u=(e=o.next()).done)&&(a.push(e.value),a.length!==t);u=!0);}catch(r){i=!0,n=r}finally{try{u||null==o.return||o.return()}finally{if(i)throw n}}return a}}(o,2)||function(t,e){if(t){if("string"==typeof t)return r(t,2);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(t,e)}}(o,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),u=a[0];return{debugData:u,setDebugData:a[1],renderDebugContainer:t(n,{data:u})}}
1
+ import React, { useState } from "react";
2
+
3
+ import DebugContainer from "./DebugContainer";
4
+
5
+ const useDebugContainer = () => {
6
+ const [data, setData] = useState({});
7
+
8
+ return {
9
+ debugData: data,
10
+ setDebugData: setData,
11
+ renderDebugContainer: <DebugContainer data={data} />,
12
+ };
13
+ };
14
+
15
+ export default useDebugContainer;
@@ -1 +1,102 @@
1
- function t(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function e(e,r){return function(t){if(Array.isArray(t))return t}(e)||function(t,e){var r,n,i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var o=[],a=!0,l=!1;try{for(i=i.call(t);!(a=(r=i.next()).done)&&(o.push(r.value),!e||o.length!==e);a=!0);}catch(t){l=!0,n=t}finally{try{a||null==i.return||i.return()}finally{if(l)throw n}}return o}}(e,r)||function(e,r){if(e){if("string"==typeof e)return t(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return t(e,r)}}(e,r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}import{jsx as r,jsxs as n,Fragment as i}from"react/jsx-runtime";import{useEffect as o,useRef as a,useState as l}from"react";import c from"classnames";import s from"moment";import{Eye as u,EyeOff as d}from"react-feather";import"./DoubleString.scss";var m="double-string";export default function(t){var f=t.value,p=t.description,v=t.valuePostfix,h=t.className,y=t.testId,b=t.isFormatValueToDate,g=t.isUseOnClick,_=t.dateFormatSettings,x=void 0===_?{}:_,N=x.parseFormat,S=x.displayFormat,W=t.revert,Y=void 0!==W&&W,A=t.noTitle,j=t.isUseHideMode,D=void 0!==j&&j,M=t.isShowHiddenValueAvailable,C=void 0!==M&&M,F=e(l(D),2),k=F[0],I=F[1],w=b?s(f,void 0===N?"MM.DD.YYYY":N).format(void 0===S?"MM.DD.YYYY":S):f,O=a(null),T=a(null),U=e(l({valueWidth:0,descriptionWidth:0}),2),H=U[0],V=U[1],E=e(l(!1),2),P=E[0],$=E[1],q=function(){$(!P)};return o(function(){var t,e;V({valueWidth:null==O||null==(t=O.current)?void 0:t.clientWidth,descriptionWidth:null==T||null==(e=T.current)?void 0:e.clientWidth})},[T,O]),n("div",{"data-testid":void 0===y?"double-string":y,className:c(m,h),children:[r("p",{onClick:function(){return q()},ref:O,className:c("".concat(m,"__value"),{"double-string--value-opened":P&&g},{pointer:g}),title:!A&&H.valueWidth>99?w:"",children:Y?p:n(i,{children:[D?r("span",{children:k?"*********":w}):w,D&&C&&k&&r(u,{className:"".concat(m,"__hide-mode-icon"),onClick:function(){return I(!1)}}),D&&C&&!k&&r(d,{className:"".concat(m,"__hide-mode-icon"),onClick:function(){return I(!0)}}),v&&r("span",{className:c("".concat(m,"__value-postfix")),children:v})]})}),r("p",{ref:T,className:c("".concat(m,"__description")),title:!A&&H.descriptionWidth>99?w:"",children:Y?n(i,{children:[w,v&&r("span",{className:c("".concat(m,"__value-postfix")),children:v})]}):p})]})}
1
+ import React, { useEffect, useRef, useState } from "react";
2
+
3
+ import cn from "classnames";
4
+ import moment from "moment";
5
+ import { Eye, EyeOff } from "react-feather";
6
+
7
+ import "./DoubleString.scss";
8
+
9
+ const RC = "double-string";
10
+
11
+ const DoubleString = ({
12
+ value,
13
+ description,
14
+ valuePostfix,
15
+ className,
16
+ testId = "double-string",
17
+ isFormatValueToDate,
18
+ isUseOnClick,
19
+ dateFormatSettings: {
20
+ parseFormat = "MM.DD.YYYY",
21
+ displayFormat = "MM.DD.YYYY",
22
+ } = {},
23
+ revert = false,
24
+ noTitle,
25
+ isUseHideMode = false,
26
+ isShowHiddenValueAvailable= false,
27
+ }) => {
28
+ const [isValueHidden, setIsValueHidden] = useState(isUseHideMode);
29
+
30
+ const computedValue = isFormatValueToDate
31
+ ? moment(value, parseFormat).format(displayFormat)
32
+ : value;
33
+ const valueRef = useRef(null);
34
+ const descriptionRef = useRef(null);
35
+ const [elemsWidth, setElemsWidth] = useState({
36
+ valueWidth: 0,
37
+ descriptionWidth: 0,
38
+ });
39
+ const [isOnClickON, setIsOnClickON] = useState(false);
40
+
41
+ const handle = {
42
+ click: () => {
43
+ setIsOnClickON(!isOnClickON);
44
+ },
45
+ };
46
+
47
+ useEffect(() => {
48
+ const valueWidth = valueRef?.current?.clientWidth;
49
+ const descriptionWidth = descriptionRef?.current?.clientWidth;
50
+
51
+ setElemsWidth({ valueWidth, descriptionWidth });
52
+ }, [descriptionRef, valueRef]);
53
+
54
+ return (
55
+ <div data-testid={testId} className={cn(RC, className)}>
56
+ <p
57
+ onClick={() => handle.click()}
58
+ ref={valueRef}
59
+ className={cn(
60
+ `${RC}__value`,
61
+ {
62
+ "double-string--value-opened": isOnClickON && isUseOnClick,
63
+ },
64
+ { pointer: isUseOnClick },
65
+ )}
66
+ title={!noTitle && elemsWidth.valueWidth > 99 ? computedValue : ""}
67
+ >
68
+ {!revert ? (
69
+ <>
70
+ {isUseHideMode ? <span>{!isValueHidden ? computedValue : '*********'}</span> : computedValue}
71
+ {isUseHideMode && isShowHiddenValueAvailable && isValueHidden && <Eye className={`${RC}__hide-mode-icon`} onClick={() => setIsValueHidden(false)} />}
72
+ {isUseHideMode && isShowHiddenValueAvailable && !isValueHidden && <EyeOff className={`${RC}__hide-mode-icon`} onClick={() => setIsValueHidden(true)}/>}
73
+ {valuePostfix && (
74
+ <span className={cn(`${RC}__value-postfix`)}>{valuePostfix}</span>
75
+ )}
76
+ </>
77
+ ) : (
78
+ description
79
+ )}
80
+ </p>
81
+
82
+ <p
83
+ ref={descriptionRef}
84
+ className={cn(`${RC}__description`)}
85
+ title={!noTitle && elemsWidth.descriptionWidth > 99 ? computedValue : ""}
86
+ >
87
+ {!revert ? (
88
+ description
89
+ ) : (
90
+ <>
91
+ {computedValue}
92
+ {valuePostfix && (
93
+ <span className={cn(`${RC}__value-postfix`)}>{valuePostfix}</span>
94
+ )}
95
+ </>
96
+ )}
97
+ </p>
98
+ </div>
99
+ );
100
+ };
101
+
102
+ export default DoubleString;
@@ -1 +1,70 @@
1
- function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function t(e,t,r,n,o,u,a){try{var i=e[u](a),l=i.value}catch(e){r(e);return}i.done?t(l):Promise.resolve(l).then(n,o)}Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return a}});var r=require("react/jsx-runtime"),n=u(require("react"));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(o=function(e){return e?r:t})(e)}function u(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||(void 0===e?"undefined":e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)!="object"&&"function"!=typeof e)return{default:e};var r=o(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var i=u?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(n,a,i):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}var a=function(o){var a,i=o.iconKey,l=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},u=Object.keys(e);for(n=0;n<u.length;n++)r=u[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(n=0;n<u.length;n++)r=u[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(o,["iconKey"]),c=(a=(0,n.useState)(null),function(e){if(Array.isArray(e))return e}(a)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var u=[],a=!0,i=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(u.push(r.value),u.length!==t);a=!0);}catch(e){i=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(i)throw n}}return u}}(a,2)||function(t,r){if(t){if("string"==typeof t)return e(t,2);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}}(a,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),f=c[0],s=c[1];return(0,n.useEffect)(function(){var e,r;(e=function(){var e;return function(e,t){var r,n,o,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=i(0),a.throw=i(1),a.return=i(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function i(i){return function(l){var c=[i,l];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(u=0)),u;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return u.label++,{value:c[1],done:!1};case 5:u.label++,n=c[1],c=[0];continue;case 7:c=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){u=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){u.label=c[1];break}if(6===c[0]&&u.label<o[1]){u.label=o[1],o=c;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(c);break}o[2]&&u.ops.pop(),u.trys.pop();continue}c=t.call(e,u)}catch(e){c=[6,e],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(t){switch(t.label){case 0:return[4,Promise.resolve().then(function(){return u(require("react-feather"))})];case 1:return e=t.sent()[i],s(function(){return e}),[2]}})},r=function(){var r=this,n=arguments;return new Promise(function(o,u){var a=e.apply(r,n);function i(e){t(a,o,u,i,l,"next",e)}function l(e){t(a,o,u,i,l,"throw",e)}i(void 0)})},function(){return r.apply(this,arguments)})()},[i]),f?(0,r.jsx)(f,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},l)):null};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "default", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return _default;
9
+ }
10
+ });
11
+ const _jsxruntime = require("react/jsx-runtime");
12
+ const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
13
+ function _getRequireWildcardCache(nodeInterop) {
14
+ if (typeof WeakMap !== "function") return null;
15
+ var cacheBabelInterop = new WeakMap();
16
+ var cacheNodeInterop = new WeakMap();
17
+ return (_getRequireWildcardCache = function(nodeInterop) {
18
+ return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
19
+ })(nodeInterop);
20
+ }
21
+ function _interop_require_wildcard(obj, nodeInterop) {
22
+ if (!nodeInterop && obj && obj.__esModule) {
23
+ return obj;
24
+ }
25
+ if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
26
+ return {
27
+ default: obj
28
+ };
29
+ }
30
+ var cache = _getRequireWildcardCache(nodeInterop);
31
+ if (cache && cache.has(obj)) {
32
+ return cache.get(obj);
33
+ }
34
+ var newObj = {
35
+ __proto__: null
36
+ };
37
+ var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
38
+ for(var key in obj){
39
+ if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
40
+ var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
41
+ if (desc && (desc.get || desc.set)) {
42
+ Object.defineProperty(newObj, key, desc);
43
+ } else {
44
+ newObj[key] = obj[key];
45
+ }
46
+ }
47
+ }
48
+ newObj.default = obj;
49
+ if (cache) {
50
+ cache.set(obj, newObj);
51
+ }
52
+ return newObj;
53
+ }
54
+ const DynamicIcon = ({ iconKey, ...props })=>{
55
+ const [Icon, setIcon] = (0, _react.useState)(null);
56
+ (0, _react.useEffect)(()=>{
57
+ const fetchData = async ()=>{
58
+ const FeatherIcons = await Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require("react-feather")));
59
+ const iconComponent = FeatherIcons[iconKey];
60
+ setIcon(()=>iconComponent);
61
+ };
62
+ fetchData();
63
+ }, [
64
+ iconKey
65
+ ]);
66
+ return Icon ? /*#__PURE__*/ (0, _jsxruntime.jsx)(Icon, {
67
+ ...props
68
+ }) : null;
69
+ };
70
+ const _default = DynamicIcon;
@@ -1 +1,221 @@
1
- function t(t,n){(null==n||n>t.length)&&(n=t.length);for(var r=0,e=Array(n);r<n;r++)e[r]=t[r];return e}function n(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{},e=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(e=e.concat(Object.getOwnPropertySymbols(r).filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),e.forEach(function(n){var e;e=r[n],n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e})}return t}function r(t,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(t,n){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);r.push.apply(r,e)}return r})(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))}),t}function e(n,r){return function(t){if(Array.isArray(t))return t}(n)||function(t,n){var r,e,a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var o=[],i=!0,u=!1;try{for(a=a.call(t);!(i=(r=a.next()).done)&&(o.push(r.value),!n||o.length!==n);i=!0);}catch(t){u=!0,e=t}finally{try{i||null==a.return||a.return()}finally{if(u)throw e}}return o}}(n,r)||function(n,r){if(n){if("string"==typeof n)return t(n,r);var e=Object.prototype.toString.call(n).slice(8,-1);if("Object"===e&&n.constructor&&(e=n.constructor.name),"Map"===e||"Set"===e)return Array.from(e);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return t(n,r)}}(n,r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}import{jsx as a,jsxs as o}from"react/jsx-runtime";import{createElement as i}from"react";import{useLayoutEffect as u,useMemo as l,useState as c}from"react";import s from"classnames";import"uuid";import{formatToPriceWithUSD as b}from"../../../Functions/fieldValueFormatters";import{clone as f}from"../../../Functions/utils";import p from"../../FormElements/InputDateRange/InputDateRange";import d from"../Chart/Chart";import{getLabels as m,getMockValue as y,getSafelyDateRange as h,getTab as g}from"./partial/utils";import"./partial/AnyOuterClass.scss";export default function(t){var v=t||{},O=v.inputDateRangeProps,j=v.chartProps,w=O||{},C=w.value,P=w.onChange,k=(j||{}).initialChartType,L=l(function(){return h(C)},[C]),S=e(c(k||"Bar"),2),T=S[0],B=S[1],M=e(c("tab1"),2),D=M[0],x=M[1],A=e(c("Bar"===T?"finturfLoadingModeBar":"finturfLoadingModeLine"),2),N=A[0],E=A[1],F=e(c(null),2),I=F[0],_=F[1],R=e(c(null),2),V=R[0],J=R[1],U=e(c(null),2),$=U[0],q=U[1],z=e(c(null),2),G=z[0],H=z[1],K=e(c(null),2),Q=K[0],W=K[1],X=function(){var t=m(L);return{labels:t,datasets:[{data:t.map(function(t){return y()})}]}},Y=function(t){switch(t){case"tab1":return I?f(I):null;case"tab2":return V?f(V):null;case"tab3":return $?f($):null;case"tab4":return G?f(G):null;default:return null}},Z=l(function(){return Y(D)?["finturfChartBar","finturfChartLine"]:["finturfLoadingModeBar","finturfLoadingModeLine"]},[!!Y(D)]),tt=function(t,n){switch(n){case"tab1":_(t);break;case"tab2":J(t);break;case"tab3":q(t);break;case"tab4":H(t)}return t};return u(function(){_(null),J(null),q(null),H(null),Promise.all([g("tab1",L,tt),g("tab2",L,tt),g("tab3",L,tt),g("tab4",L,tt)])},[L]),u(function(){E(Y(D)?"Bar"===T?"finturfChartBar":"finturfChartLine":"Bar"===T?"finturfLoadingModeBar":"finturfLoadingModeLine"),W(Y(D)?Y(D):X())},[!!Y(D),D,T]),o("div",{className:"example-wrapper",children:[a(p,r(n({},O),{value:C,onChange:P})),o("div",{className:"buttons-block",children:[a("button",{className:s("tab-button",{"tab-button_active":"tab1"===D}),onClick:function(){return x("tab1")},children:"Tab 1"}),a("button",{className:s("tab-button",{"tab-button_active":"tab2"===D}),onClick:function(){return x("tab2")},children:"Tab 2"}),a("button",{className:s("tab-button",{"tab-button_active":"tab3"===D}),onClick:function(){return x("tab3")},children:"Tab 3"}),a("button",{className:s("tab-button",{"tab-button_active":"tab4"===D}),onClick:function(){return x("tab4")},children:"Tab 4"})]}),i(d,r(n({},j),{key:JSON.stringify(Q),data:Q,setModelExternalValue:function(t){B(t.includes("Line")?"Line":"Bar"),E(t)},initialModel:N,modelsForSwitch:Z,description:{label:function(t){switch(t){case"tab1":return"Tab 1";case"tab2":return"Tab 2";case"tab3":return"Tab 3";case"tab4":return"Tab 4";default:return null}}(D)},addToDatasets:{id:D},modifyOptions:function(t){var e,a,o,i,u,l;return r(n({},t),{options:r(n({},null==t?void 0:t.options),{plugins:r(n({},null==t||null==(e=t.options)?void 0:e.plugins),{tooltip:r(n({},null==t||null==(o=t.options)||null==(a=o.plugins)?void 0:a.tooltip),{callbacks:r(n({},null==t||null==(l=t.options)||null==(u=l.plugins)||null==(i=u.tooltip)?void 0:i.callbacks),{label:function(t){return"tab3"===t.dataset.id||"tab4"===t.dataset.id?b(t.raw||"0"):t.raw||"0"}})})})})})}}))]})}
1
+ import React, { useLayoutEffect, useMemo, useState } from "react";
2
+
3
+ import cn from "classnames";
4
+ import { v4 as uuid } from "uuid";
5
+
6
+ import { formatToPriceWithUSD } from "../../../Functions/fieldValueFormatters";
7
+ import { clone } from "../../../Functions/utils";
8
+ import InputDateRange from "../../FormElements/InputDateRange/InputDateRange";
9
+ import Chart from "../Chart/Chart";
10
+
11
+ import {
12
+ getLabels,
13
+ getMockValue,
14
+ getSafelyDateRange,
15
+ getTab,
16
+ } from "./partial/utils";
17
+
18
+ import "./partial/AnyOuterClass.scss";
19
+
20
+ const ExampleChartIntegration = (props) => {
21
+ const { inputDateRangeProps, chartProps } = props || {};
22
+ const { value: outerDateRange, onChange: changeDateRange } =
23
+ inputDateRangeProps || {};
24
+ const { initialChartType } = chartProps || {};
25
+ const dateRange = useMemo(
26
+ () => getSafelyDateRange(outerDateRange),
27
+ [outerDateRange],
28
+ );
29
+
30
+ const [chartType, setChartType] = useState(initialChartType || "Bar");
31
+ const [tab, setTab] = useState("tab1");
32
+ const [initialModel, setInitialModel] = useState(
33
+ chartType === "Bar" ? "finturfLoadingModeBar" : "finturfLoadingModeLine",
34
+ );
35
+
36
+ const [tab1, setTab1] = useState(null);
37
+ const [tab2, setTab2] = useState(null);
38
+ const [tab3, setTab3] = useState(null);
39
+ const [tab4, setTab4] = useState(null);
40
+
41
+ const [dataForRender, setDataForRender] = useState(null);
42
+
43
+ const getMockData = () => {
44
+ const labels = getLabels(dateRange);
45
+ const mock = () => labels.map((label) => getMockValue());
46
+ return {
47
+ labels,
48
+ datasets: [
49
+ {
50
+ data: mock(),
51
+ },
52
+ ],
53
+ };
54
+ };
55
+
56
+ const getTabData = (tabId) => {
57
+ switch (tabId) {
58
+ case "tab1":
59
+ return !tab1 ? null : clone(tab1);
60
+ case "tab2":
61
+ return !tab2 ? null : clone(tab2);
62
+ case "tab3":
63
+ return !tab3 ? null : clone(tab3);
64
+ case "tab4":
65
+ return !tab4 ? null : clone(tab4);
66
+ default:
67
+ return null;
68
+ }
69
+ };
70
+
71
+ const getDescription = (tabId) => {
72
+ switch (tabId) {
73
+ case "tab1":
74
+ return "Tab 1";
75
+ case "tab2":
76
+ return "Tab 2";
77
+ case "tab3":
78
+ return "Tab 3";
79
+ case "tab4":
80
+ return "Tab 4";
81
+ default:
82
+ return null;
83
+ }
84
+ };
85
+
86
+ const selectData = () => (getTabData(tab) ? getTabData(tab) : getMockData());
87
+
88
+ const modelsForSwitch = useMemo(
89
+ () =>
90
+ getTabData(tab)
91
+ ? ["finturfChartBar", "finturfChartLine"]
92
+ : ["finturfLoadingModeBar", "finturfLoadingModeLine"],
93
+ [Boolean(getTabData(tab))],
94
+ );
95
+
96
+ const handleChangeChartType = (model) => {
97
+ setChartType(model.includes("Line") ? "Line" : "Bar");
98
+ setInitialModel(model);
99
+ };
100
+
101
+ const getModel = () => {
102
+ if (!getTabData(tab))
103
+ return chartType === "Bar"
104
+ ? "finturfLoadingModeBar"
105
+ : "finturfLoadingModeLine";
106
+ else return chartType === "Bar" ? "finturfChartBar" : "finturfChartLine";
107
+ };
108
+
109
+ const processResponse = (res, tabId) => {
110
+ switch (tabId) {
111
+ case "tab1":
112
+ setTab1(res);
113
+ break;
114
+ case "tab2":
115
+ setTab2(res);
116
+ break;
117
+ case "tab3":
118
+ setTab3(res);
119
+ break;
120
+ case "tab4":
121
+ setTab4(res);
122
+ break;
123
+ default:
124
+ break;
125
+ }
126
+ return res;
127
+ };
128
+
129
+ useLayoutEffect(() => {
130
+ setTab1(null);
131
+ setTab2(null);
132
+ setTab3(null);
133
+ setTab4(null);
134
+
135
+ // эмуляция запросов
136
+ // вся логика происходит в самих входящих промисах
137
+ // Promise.all добавлен для расширения на случай надобности описания эффектов по завершении всех запросов
138
+ Promise.all([
139
+ getTab("tab1", dateRange, processResponse),
140
+ getTab("tab2", dateRange, processResponse),
141
+ getTab("tab3", dateRange, processResponse),
142
+ getTab("tab4", dateRange, processResponse),
143
+ ]);
144
+ }, [dateRange]);
145
+
146
+ useLayoutEffect(() => {
147
+ setInitialModel(getModel());
148
+ setDataForRender(selectData());
149
+ }, [Boolean(getTabData(tab)), tab, chartType]);
150
+
151
+ return (
152
+ <div className="example-wrapper">
153
+ <InputDateRange
154
+ {...inputDateRangeProps}
155
+ value={outerDateRange}
156
+ onChange={changeDateRange}
157
+ />
158
+
159
+ <div className="buttons-block">
160
+ <button
161
+ className={cn("tab-button", { "tab-button_active": tab === "tab1" })}
162
+ onClick={() => setTab("tab1")}
163
+ >
164
+ Tab 1
165
+ </button>
166
+ <button
167
+ className={cn("tab-button", { "tab-button_active": tab === "tab2" })}
168
+ onClick={() => setTab("tab2")}
169
+ >
170
+ Tab 2
171
+ </button>
172
+ <button
173
+ className={cn("tab-button", { "tab-button_active": tab === "tab3" })}
174
+ onClick={() => setTab("tab3")}
175
+ >
176
+ Tab 3
177
+ </button>
178
+ <button
179
+ className={cn("tab-button", { "tab-button_active": tab === "tab4" })}
180
+ onClick={() => setTab("tab4")}
181
+ >
182
+ Tab 4
183
+ </button>
184
+ </div>
185
+
186
+ <Chart
187
+ {...chartProps}
188
+ key={JSON.stringify(dataForRender)}
189
+ data={dataForRender}
190
+ setModelExternalValue={handleChangeChartType}
191
+ initialModel={initialModel}
192
+ modelsForSwitch={modelsForSwitch}
193
+ description={{ label: getDescription(tab) }}
194
+ addToDatasets={{ id: tab }}
195
+ modifyOptions={(options) => ({
196
+ ...options,
197
+ options: {
198
+ ...options?.options,
199
+ plugins: {
200
+ ...options?.options?.plugins,
201
+ tooltip: {
202
+ ...options?.options?.plugins?.tooltip,
203
+ callbacks: {
204
+ ...options?.options?.plugins?.tooltip?.callbacks,
205
+ label: (context) => {
206
+ return context.dataset.id === "tab3" ||
207
+ context.dataset.id === "tab4"
208
+ ? formatToPriceWithUSD(context.raw || "0")
209
+ : context.raw || "0";
210
+ },
211
+ },
212
+ },
213
+ },
214
+ },
215
+ })}
216
+ />
217
+ </div>
218
+ );
219
+ };
220
+
221
+ export default ExampleChartIntegration;