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.
- package/dist/Atomic/FormElements/ActionAlert/ActionAlert.js +98 -1
- package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.js +48 -1
- package/dist/Atomic/FormElements/Calendar/Calendar.js +249 -1
- package/dist/Atomic/FormElements/Calendar/Calendar.props.js +4 -1
- package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.js +65 -1
- package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.js +52 -1
- package/dist/Atomic/FormElements/Datepicker/Datepicker.js +424 -1
- package/dist/Atomic/FormElements/Datepicker/Datepicker.props.js +4 -1
- package/dist/Atomic/FormElements/Datepicker/components/DatepickerCalendar.js +173 -1
- package/dist/Atomic/FormElements/Datepicker/components/DatepickerCalendar.props.js +4 -1
- package/dist/Atomic/FormElements/Dropdown/Dropdown.js +735 -1
- package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.js +20 -1
- package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.js +529 -1
- package/dist/Atomic/FormElements/FileLoader/FileLoader.js +94 -1
- package/dist/Atomic/FormElements/FileLoader/partial/LoadZone.js +105 -1
- package/dist/Atomic/FormElements/FileLoader/partial/LoadedContent.js +67 -1
- package/dist/Atomic/FormElements/FileLoaderDescription/FileLoaderDescription.js +247 -1
- package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.js +160 -1
- package/dist/Atomic/FormElements/FileLoaderLocalGroup/FileLoaderLocalGroup.js +193 -1
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.js +135 -1
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN_old.js +116 -1
- package/dist/Atomic/FormElements/Input/Input.js +467 -1
- package/dist/Atomic/FormElements/InputCalendar/InputCalendar.js +161 -1
- package/dist/Atomic/FormElements/InputColor/InputColor.js +64 -1
- package/dist/Atomic/FormElements/InputCurrency/InputCurrency.js +200 -1
- package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +354 -1
- package/dist/Atomic/FormElements/InputDateRange/components/DateInput.js +71 -1
- package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.js +693 -1
- package/dist/Atomic/FormElements/InputDateRange/components/OpenedPart.js +254 -1
- package/dist/Atomic/FormElements/InputDateRange/components/SelectItem.js +32 -1
- package/dist/Atomic/FormElements/InputDateRange/dependencies.js +200 -1
- package/dist/Atomic/FormElements/InputLink/InputLink.js +99 -1
- package/dist/Atomic/FormElements/InputMask/InputCarretPosition.js +37 -1
- package/dist/Atomic/FormElements/InputMask/InputMask.js +1214 -1
- package/dist/Atomic/FormElements/InputMask/config.js +15 -1
- package/dist/Atomic/FormElements/InputMask/functions.js +58 -1
- package/dist/Atomic/FormElements/InputMask2/InputMask2.js +674 -1
- package/dist/Atomic/FormElements/InputMask2/config.js +15 -1
- package/dist/Atomic/FormElements/InputMask2/functions.js +58 -1
- package/dist/Atomic/FormElements/InputMask3/InputMask3.js +766 -1
- package/dist/Atomic/FormElements/InputMask3/config.js +15 -1
- package/dist/Atomic/FormElements/InputMask3/functions.js +58 -1
- package/dist/Atomic/FormElements/InputWithAction/InputWithAction.js +114 -1
- package/dist/Atomic/FormElements/InputsRow/InputsRow.js +140 -1
- package/dist/Atomic/FormElements/Label/Label.js +87 -1
- package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +506 -1
- package/dist/Atomic/FormElements/MultiSelect/MultiSelect.js +45 -1
- package/dist/Atomic/FormElements/NumericInput/NumericInput.js +331 -1
- package/dist/Atomic/FormElements/RadioGroup/RadioGroup.js +66 -1
- package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +80 -1
- package/dist/Atomic/FormElements/RadioInput/RadioInput.js +57 -1
- package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.js +54 -1
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +183 -1
- package/dist/Atomic/FormElements/RangeInputs/RangeInputs.js +222 -1
- package/dist/Atomic/FormElements/RangeList/RangeList.js +175 -1
- package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.js +43 -1
- package/dist/Atomic/FormElements/RangeSlider/RangeSlider.js +443 -1
- package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +858 -1
- package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.js +39 -1
- package/dist/Atomic/FormElements/Switcher/Switcher.js +59 -1
- package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.js +50 -1
- package/dist/Atomic/FormElements/SwitcherHide/SwitcherHide.js +44 -1
- package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.js +100 -1
- package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.js +52 -1
- package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.js +64 -1
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.js +170 -1
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/partial/States.js +202 -1
- package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.js +67 -1
- package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.js +115 -1
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.interface.ts +2 -2
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +1110 -1
- package/dist/Atomic/FormElements/Text/Text.js +125 -1
- package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.js +49 -1
- package/dist/Atomic/FormElements/Textarea/Textarea.js +80 -1
- package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +176 -1
- package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.js +62 -1
- package/dist/Atomic/FormElements/TimeRange/TimeRange.js +119 -1
- package/dist/Atomic/FormElements/UserContacts/UserContacts.js +188 -1
- package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.js +83 -1
- package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.js +82 -1
- package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.js +101 -1
- package/dist/Atomic/FormElements/WidgetPseudoTable/partial/constructor.js +29 -1
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.js +113 -1
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/partial/constructor.js +30 -1
- package/dist/Atomic/Layout/Header/Header.js +85 -1
- package/dist/Atomic/Layout/Spinner/Spinner.js +44 -1
- package/dist/Atomic/UI/Accordion/Accordion.js +108 -1
- package/dist/Atomic/UI/Accordion/AccordionItem.js +176 -1
- package/dist/Atomic/UI/AccordionTable/AccordionTable.js +238 -1
- package/dist/Atomic/UI/AccordionText/AccordionText.js +69 -1
- package/dist/Atomic/UI/AdvancedTag/AdvTag.js +207 -1
- package/dist/Atomic/UI/AdvancedTag/AdvancedTags.js +56 -1
- package/dist/Atomic/UI/Alert/Alert.js +72 -1
- package/dist/Atomic/UI/Arrow/Arrow.js +132 -1
- package/dist/Atomic/UI/Box/Box.js +52 -1
- package/dist/Atomic/UI/Button/Button.js +47 -1
- package/dist/Atomic/UI/ButtonsBar/ButtonsBar.js +72 -1
- package/dist/Atomic/UI/Chart/Chart.js +172 -1
- package/dist/Atomic/UI/Chart/partial/Chart.constants.js +95 -1
- package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +80 -1
- package/dist/Atomic/UI/Chart/partial/datasetSetters.js +188 -1
- package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +335 -1
- package/dist/Atomic/UI/Chart/partial/optionsSetters.js +43 -1
- package/dist/Atomic/UI/Chart/partial/utils.js +60 -1
- package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +109 -1
- package/dist/Atomic/UI/DateTime/DateTime.js +57 -1
- package/dist/Atomic/UI/DebugContainer/DebugContainer.js +44 -1
- package/dist/Atomic/UI/DebugContainer/useDebugContainer.js +15 -1
- package/dist/Atomic/UI/DoubleString/DoubleString.js +102 -1
- package/dist/Atomic/UI/DynamicIcon/DynamicIcon.js +70 -1
- package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +221 -1
- package/dist/Atomic/UI/ExampleChartIntegration/partial/utils.js +106 -1
- package/dist/Atomic/UI/Hint/Hint.js +256 -1
- package/dist/Atomic/UI/Hint/partials/_utils.js +64 -1
- package/dist/Atomic/UI/Modal/Modal.js +179 -1
- package/dist/Atomic/UI/Modal/ModalHOC.js +97 -1
- package/dist/Atomic/UI/Modal/partials/ModalFooter.js +71 -1
- package/dist/Atomic/UI/Modal/partials/ModalTitle.js +110 -1
- package/dist/Atomic/UI/Modal/partials/useMobileModal.js +192 -1
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion._test.js +75 -1
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +80 -1
- package/dist/Atomic/UI/NavLine/NavLine.js +317 -1
- package/dist/Atomic/UI/PageTitle/PageTitle.js +77 -1
- package/dist/Atomic/UI/PieChart/PieChart.js +42 -1
- package/dist/Atomic/UI/Price/Price.js +31 -1
- package/dist/Atomic/UI/PriceRange/PriceRange.js +44 -1
- package/dist/Atomic/UI/ProgressLine/ProgressLine.js +98 -1
- package/dist/Atomic/UI/Status/Status.js +67 -1
- package/dist/Atomic/UI/Table/Partials/TdCell.js +87 -1
- package/dist/Atomic/UI/Table/Partials/TdHeader.js +38 -1
- package/dist/Atomic/UI/Table/Partials/TdRow.js +99 -1
- package/dist/Atomic/UI/Table/Partials/TdTitle.js +52 -1
- package/dist/Atomic/UI/Table/Table.js +63 -1
- package/dist/Atomic/UI/Table/TdTypes/TdActions.js +80 -1
- package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +28 -1
- package/dist/Atomic/UI/Table/TdTypes/TdRange.js +13 -1
- package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +53 -1
- package/dist/Atomic/UI/Tag/Tag.js +167 -1
- package/dist/Atomic/UI/TagList/TagList.js +251 -1
- package/dist/Atomic/UI/UserBox/UserBox.js +86 -1
- package/dist/Atomic/UI/WizardStepper/constructor.js +84 -1
- package/dist/Atomic/UI/WizardStepper/index.js +3 -1
- package/dist/Atomic/UI/WizardStepper/ui/StateIcon/StateIcon.js +37 -1
- package/dist/Atomic/UI/WizardStepper/ui/StateIcon/index.js +3 -1
- package/dist/Atomic/UI/WizardStepper/ui/StepRow/StepRow.js +61 -1
- package/dist/Atomic/UI/WizardStepper/ui/StepRow/index.js +3 -1
- package/dist/Atomic/UI/WizardStepper/ui/StepWrapper/StepWrapper.js +39 -1
- package/dist/Atomic/UI/WizardStepper/ui/StepWrapper/index.js +3 -1
- package/dist/Atomic/UI/WizardStepper/ui/icons.js +49 -1
- package/dist/Atomic/UI/WizardStepper/ui/index.js +3 -1
- package/dist/Classes/AbortableFetch.js +454 -1
- package/dist/Classes/AnimatedHandler.js +47 -1
- package/dist/Classes/RESTAPI/index.js +228 -1
- package/dist/Classes/RESTAPI/partials/AbortableFetch.js +457 -1
- package/dist/Classes/RESTAPI/partials/ApiBase.js +48 -1
- package/dist/Classes/RESTAPI/partials/ApiRequestCreators.js +112 -1
- package/dist/Classes/RESTAPI/partials/ApiUtils.js +189 -1
- package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +252 -1
- package/dist/Classes/RESTAPI/partials/Utils.js +92 -1
- package/dist/Classes/RESTAPI/partials/_outerDependencies.js +3 -1
- package/dist/Classes/RESTAPI/partials/_utils.js +197 -1
- package/dist/Constants/index.constants.js +78 -1
- package/dist/Functions/Portal.js +22 -1
- package/dist/Functions/customEventListener.js +96 -1
- package/dist/Functions/dateTime.js +149 -1
- package/dist/Functions/fieldValueFormatters.js +405 -1
- package/dist/Functions/guards/assertions.js +294 -1
- package/dist/Functions/guards/safeValue.js +75 -1
- package/dist/Functions/guards/typeGuards.js +373 -1
- package/dist/Functions/hooks/useFormFieldsChangesManager.js +95 -1
- package/dist/Functions/locale/createTranslator.js +32 -1
- package/dist/Functions/operations.js +130 -1
- package/dist/Functions/presets/inputMaskPresets.js +170 -1
- package/dist/Functions/presets/inputPresets.js +60 -1
- package/dist/Functions/presets/mobileKeyboardTypesPresets.js +45 -1
- package/dist/Functions/schemas.js +31 -1
- package/dist/Functions/useBodyScrollLock.js +17 -1
- package/dist/Functions/useClickOutside.js +15 -1
- package/dist/Functions/useDebounce.js +17 -1
- package/dist/Functions/useFieldFocus.js +84 -1
- package/dist/Functions/useFormTools/form-drivers/ArrayWithObjects.js +39 -1
- package/dist/Functions/useFormTools/form-drivers/ObjectWithIterableObjects.js +159 -1
- package/dist/Functions/useFormTools/form-drivers/ObjectWithNamedKeyObjects.js +78 -1
- package/dist/Functions/useFormTools/functions/General.js +134 -1
- package/dist/Functions/useFormTools/functions/RenderFields.js +111 -1
- package/dist/Functions/useFormTools/functions/usePrevious.js +12 -1
- package/dist/Functions/useFormTools/index.js +778 -1
- package/dist/Functions/useInputHighlightError.js +67 -1
- package/dist/Functions/useIsMobile/useIsMobile.js +33 -1
- package/dist/Functions/useKeyPress/useHandleKeyPress.js +52 -1
- package/dist/Functions/useKeyPress/useKeyPress.js +52 -1
- package/dist/Functions/useLocalStorage.js +34 -1
- package/dist/Functions/useLocationParams.js +27 -1
- package/dist/Functions/useMediaQuery.js +17 -1
- package/dist/Functions/useMetaInfo.js +43 -1
- package/dist/Functions/useMouseUpOutside.js +16 -1
- package/dist/Functions/useOnlineStatus.js +29 -1
- package/dist/Functions/usePasswordChecker.js +110 -1
- package/dist/Functions/usePrevious.js +12 -1
- package/dist/Functions/useResize.js +31 -1
- package/dist/Functions/useScrollTo.js +17 -1
- package/dist/Functions/useToggle.js +17 -1
- package/dist/Functions/utils.js +522 -1
- package/dist/Langs.js +168 -1
- package/dist/Molecular/CustomIcons/components/AffiliateNetworks.js +21 -1
- package/dist/Molecular/CustomIcons/components/AlertCircle.js +23 -1
- package/dist/Molecular/CustomIcons/components/AppStore.js +29 -1
- package/dist/Molecular/CustomIcons/components/Arrow.js +32 -1
- package/dist/Molecular/CustomIcons/components/ArrowDown.js +17 -1
- package/dist/Molecular/CustomIcons/components/ArrowLeft.js +22 -1
- package/dist/Molecular/CustomIcons/components/ArrowRight.js +22 -1
- package/dist/Molecular/CustomIcons/components/ArrowUp.js +17 -1
- package/dist/Molecular/CustomIcons/components/Bell.js +15 -1
- package/dist/Molecular/CustomIcons/components/Button.js +12 -1
- package/dist/Molecular/CustomIcons/components/Campaigns.js +16 -1
- package/dist/Molecular/CustomIcons/components/Check.js +14 -1
- package/dist/Molecular/CustomIcons/components/Check2.js +12 -1
- package/dist/Molecular/CustomIcons/components/ChevronDown.js +12 -1
- package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.js +11 -1
- package/dist/Molecular/CustomIcons/components/ChevronLeft.js +11 -1
- package/dist/Molecular/CustomIcons/components/ChevronRight.js +11 -1
- package/dist/Molecular/CustomIcons/components/ChevronUp.js +11 -1
- package/dist/Molecular/CustomIcons/components/ChevronUpDown.js +27 -1
- package/dist/Molecular/CustomIcons/components/Close.js +14 -1
- package/dist/Molecular/CustomIcons/components/ColumnsOrder.js +17 -1
- package/dist/Molecular/CustomIcons/components/Delete.js +16 -1
- package/dist/Molecular/CustomIcons/components/Edit.js +15 -1
- package/dist/Molecular/CustomIcons/components/Email.js +31 -1
- package/dist/Molecular/CustomIcons/components/FinturfLogo.js +18 -1
- package/dist/Molecular/CustomIcons/components/FinturfLogo2.js +35 -1
- package/dist/Molecular/CustomIcons/components/Flows.js +15 -1
- package/dist/Molecular/CustomIcons/components/Gift.js +25 -1
- package/dist/Molecular/CustomIcons/components/GoogleAuth.js +29 -1
- package/dist/Molecular/CustomIcons/components/GooglePlay.js +29 -1
- package/dist/Molecular/CustomIcons/components/HelpCircle.js +19 -1
- package/dist/Molecular/CustomIcons/components/HelpCircle2.js +20 -1
- package/dist/Molecular/CustomIcons/components/HelpCircleFilled.js +19 -1
- package/dist/Molecular/CustomIcons/components/Home.js +16 -1
- package/dist/Molecular/CustomIcons/components/Home2.js +22 -1
- package/dist/Molecular/CustomIcons/components/Key.js +23 -1
- package/dist/Molecular/CustomIcons/components/Landers.js +20 -1
- package/dist/Molecular/CustomIcons/components/Lock.js +15 -1
- package/dist/Molecular/CustomIcons/components/Mail.js +26 -1
- package/dist/Molecular/CustomIcons/components/Mastercard.js +73 -1
- package/dist/Molecular/CustomIcons/components/Minus.js +25 -1
- package/dist/Molecular/CustomIcons/components/Offers.js +16 -1
- package/dist/Molecular/CustomIcons/components/Pause.js +28 -1
- package/dist/Molecular/CustomIcons/components/PayPal.js +41 -1
- package/dist/Molecular/CustomIcons/components/PayPalLightLarge.js +28 -1
- package/dist/Molecular/CustomIcons/components/Phone.js +30 -1
- package/dist/Molecular/CustomIcons/components/Play.js +25 -1
- package/dist/Molecular/CustomIcons/components/Plus.js +25 -1
- package/dist/Molecular/CustomIcons/components/Profile.js +16 -1
- package/dist/Molecular/CustomIcons/components/QRCode.js +29 -1
- package/dist/Molecular/CustomIcons/components/Rectangle.js +12 -1
- package/dist/Molecular/CustomIcons/components/Revert.js +13 -1
- package/dist/Molecular/CustomIcons/components/Star.js +14 -1
- package/dist/Molecular/CustomIcons/components/Star2.js +16 -1
- package/dist/Molecular/CustomIcons/components/TrafficSources.js +14 -1
- package/dist/Molecular/CustomIcons/components/Trash.js +15 -1
- package/dist/Molecular/CustomIcons/components/TrashRed.js +15 -1
- package/dist/Molecular/CustomIcons/components/Triggers.js +15 -1
- package/dist/Molecular/CustomIcons/components/User.js +25 -1
- package/dist/Molecular/CustomIcons/components/Visa.js +31 -1
- package/dist/Molecular/CustomIcons/components/X.js +12 -1
- package/dist/Molecular/CustomIcons/index.js +61 -1
- package/dist/Molecular/FormElement/FormElement.js +54 -1
- package/dist/Molecular/FormWithDependOn/FormWithDependOn.js +184 -1
- package/dist/Molecular/FormWithDependOn/partials/_utils.js +53 -1
- package/dist/Molecular/InputAddress/InputAddress.js +626 -1
- package/dist/Molecular/InputPassword/InputPassword.js +48 -1
- package/dist/index.js +104 -1
- package/package.json +1 -1
- package/dist/Molecular/InputAddress/InputAddress.d.ts +0 -26
- package/dist/Molecular/InputAddress/InputAddress.js.map +0 -1
|
@@ -1 +1,109 @@
|
|
|
1
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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;
|