intelicoreact 1.8.10 → 1.8.12
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/Dropdown/components/DropdownLoader.js +1 -0
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN_old.js +1 -0
- package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +1 -0
- package/dist/Atomic/FormElements/MultiSelect/MultiSelect.js +1 -0
- package/dist/Atomic/FormElements/NumericInput/NumericInput.js +1 -0
- package/dist/Atomic/FormElements/RadioGroup/RadioGroup.js +1 -0
- package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +1 -0
- package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.js +1 -0
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +1 -0
- package/dist/Atomic/FormElements/RangeInputs/RangeInputs.js +1 -1
- package/dist/Atomic/FormElements/RangeList/RangeList.js +1 -0
- package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.js +1 -0
- package/dist/Atomic/FormElements/RangeSlider/RangeSlider.js +1 -0
- package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +1 -0
- package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.js +1 -0
- package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.js +1 -0
- package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.js +1 -0
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.js +1 -0
- package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.js +1 -0
- package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.js +1 -0
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.interface.ts +3 -3
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +1 -1
- package/dist/Atomic/FormElements/Text/Text.js +1 -0
- package/dist/Atomic/FormElements/Textarea/Textarea.js +1 -0
- package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +1 -0
- package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.js +1 -0
- package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.js +1 -0
- package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.js +1 -0
- package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.js +1 -0
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.js +1 -0
- package/dist/Atomic/Layout/Header/Header.js +1 -0
- package/dist/Atomic/Layout/MainMenu/MainMenu.js +1 -0
- package/dist/Atomic/UI/AccordionTable/AccordionTable.js +1 -0
- package/dist/Atomic/UI/AccordionText/AccordionText.js +1 -0
- package/dist/Atomic/UI/Arrow/Arrow.js +1 -0
- package/dist/Atomic/UI/Box/Box.js +1 -0
- package/dist/Atomic/UI/Chart/Chart.js +1 -0
- package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +1 -0
- package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +1 -0
- package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +1 -0
- package/dist/Atomic/UI/DateTime/DateTime.js +1 -0
- package/dist/Atomic/UI/DebugContainer/DebugContainer.js +1 -0
- package/dist/Atomic/UI/DebugContainer/useDebugContainer.js +1 -0
- package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +1 -0
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion._test.js +1 -0
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +1 -0
- package/dist/Atomic/UI/PieChart/PieChart.js +1 -0
- package/dist/Atomic/UI/Table/Partials/TdCell.js +1 -0
- package/dist/Atomic/UI/Table/Partials/TdHeader.js +1 -0
- package/dist/Atomic/UI/Table/Partials/TdRow.js +1 -0
- package/dist/Atomic/UI/Table/Partials/TdTitle.js +1 -0
- package/dist/Atomic/UI/Table/Table.js +1 -0
- package/dist/Atomic/UI/Table/TdTypes/TdActions.js +1 -0
- package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +1 -0
- package/dist/Atomic/UI/Table/TdTypes/TdRange.js +1 -0
- package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +1 -0
- package/dist/Atomic/UI/Tag/Tag.interface.ts +1 -1
- package/dist/Atomic/UI/Tag/Tag.js +1 -1
- package/dist/Atomic/UI/TagList/TagList.js +1 -0
- package/dist/Atomic/UI/WizardStepper/constructor.js +1 -0
- package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +1 -0
- package/dist/Functions/customEventListener.js +1 -0
- package/dist/Functions/operations.js +1 -0
- package/dist/Functions/useFormTools/functions/RenderFields.js +1 -0
- package/dist/Functions/useFormTools/index.js +1 -0
- package/dist/Functions/usePasswordChecker.js +1 -0
- package/dist/Functions/utils.js +1 -0
- package/dist/Molecular/CustomIcons/components/AffiliateNetworks.js +1 -0
- package/dist/Molecular/CustomIcons/components/AlertCircle.js +1 -0
- package/dist/Molecular/CustomIcons/components/AppStore.js +1 -0
- package/dist/Molecular/CustomIcons/components/Arrow.js +1 -0
- package/dist/Molecular/CustomIcons/components/ArrowDown.js +1 -0
- package/dist/Molecular/CustomIcons/components/ArrowLeft.js +1 -0
- package/dist/Molecular/CustomIcons/components/ArrowRight.js +1 -0
- package/dist/Molecular/CustomIcons/components/ArrowUp.js +1 -0
- package/dist/Molecular/CustomIcons/components/Bell.js +1 -0
- package/dist/Molecular/CustomIcons/components/Button.js +1 -0
- package/dist/Molecular/CustomIcons/components/Campaigns.js +1 -0
- package/dist/Molecular/CustomIcons/components/Check.js +1 -0
- package/dist/Molecular/CustomIcons/components/Check2.js +1 -0
- package/dist/Molecular/CustomIcons/components/ChevronDown.js +1 -0
- package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.js +1 -0
- package/dist/Molecular/CustomIcons/components/ChevronLeft.js +1 -0
- package/dist/Molecular/CustomIcons/components/ChevronRight.js +1 -0
- package/dist/Molecular/CustomIcons/components/ChevronUp.js +1 -0
- package/dist/Molecular/CustomIcons/components/ChevronUpDown.js +1 -0
- package/dist/Molecular/CustomIcons/components/Close.js +1 -0
- package/dist/Molecular/CustomIcons/components/ColumnsOrder.js +1 -0
- package/dist/Molecular/CustomIcons/components/Delete.js +1 -0
- package/dist/Molecular/CustomIcons/components/Edit.js +1 -0
- package/dist/Molecular/CustomIcons/components/Email.js +1 -0
- package/dist/Molecular/CustomIcons/components/FinturfLogo.js +1 -0
- package/dist/Molecular/CustomIcons/components/FinturfLogo2.js +1 -0
- package/dist/Molecular/CustomIcons/components/Flows.js +1 -0
- package/dist/Molecular/CustomIcons/components/Gift.js +1 -0
- package/dist/Molecular/CustomIcons/components/GoogleAuth.js +1 -0
- package/dist/Molecular/CustomIcons/components/GooglePlay.js +1 -0
- package/dist/Molecular/CustomIcons/components/HelpCircle.js +1 -0
- package/dist/Molecular/CustomIcons/components/HelpCircle2.js +1 -0
- package/dist/Molecular/CustomIcons/components/HelpCircleFilled.js +1 -0
- package/dist/Molecular/CustomIcons/components/Home.js +1 -0
- package/dist/Molecular/CustomIcons/components/Home2.js +1 -0
- package/dist/Molecular/CustomIcons/components/Key.js +1 -0
- package/dist/Molecular/CustomIcons/components/Landers.js +1 -0
- package/dist/Molecular/CustomIcons/components/Lock.js +1 -0
- package/dist/Molecular/CustomIcons/components/Mail.js +1 -0
- package/dist/Molecular/CustomIcons/components/Mastercard.js +1 -0
- package/dist/Molecular/CustomIcons/components/Minus.js +1 -0
- package/dist/Molecular/CustomIcons/components/Offers.js +1 -0
- package/dist/Molecular/CustomIcons/components/Pause.js +1 -0
- package/dist/Molecular/CustomIcons/components/PayPal.js +1 -0
- package/dist/Molecular/CustomIcons/components/PayPalLightLarge.js +1 -0
- package/dist/Molecular/CustomIcons/components/Phone.js +1 -0
- package/dist/Molecular/CustomIcons/components/Play.js +1 -0
- package/dist/Molecular/CustomIcons/components/Plus.js +1 -0
- package/dist/Molecular/CustomIcons/components/Profile.js +1 -0
- package/dist/Molecular/CustomIcons/components/QRCode.js +1 -0
- package/dist/Molecular/CustomIcons/components/Rectangle.js +1 -0
- package/dist/Molecular/CustomIcons/components/Revert.js +1 -0
- package/dist/Molecular/CustomIcons/components/Star.js +1 -0
- package/dist/Molecular/CustomIcons/components/Star2.js +1 -0
- package/dist/Molecular/CustomIcons/components/TrafficSources.js +1 -0
- package/dist/Molecular/CustomIcons/components/Trash.js +1 -0
- package/dist/Molecular/CustomIcons/components/TrashRed.js +1 -0
- package/dist/Molecular/CustomIcons/components/Triggers.js +1 -0
- package/dist/Molecular/CustomIcons/components/User.js +1 -0
- package/dist/Molecular/CustomIcons/components/Visa.js +1 -0
- package/dist/Molecular/CustomIcons/components/X.js +1 -0
- package/dist/Molecular/FormElement/FormElement.js +1 -0
- package/dist/Molecular/FormWithDependOn/FormWithDependOn.js +1 -0
- package/dist/Molecular/InputAddress/InputAddress.js +1 -0
- package/dist/Molecular/InputPassword/InputPassword.js +1 -0
- package/package.json +6 -13
- package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.jsx +0 -18
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN_old.jsx +0 -121
- package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.jsx +0 -507
- package/dist/Atomic/FormElements/MultiSelect/MultiSelect.jsx +0 -46
- package/dist/Atomic/FormElements/NumericInput/NumericInput.jsx +0 -337
- package/dist/Atomic/FormElements/RadioGroup/RadioGroup.jsx +0 -66
- package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.jsx +0 -78
- package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.jsx +0 -54
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.jsx +0 -183
- package/dist/Atomic/FormElements/RangeList/RangeList.jsx +0 -181
- package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.jsx +0 -41
- package/dist/Atomic/FormElements/RangeSlider/RangeSlider.jsx +0 -449
- package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.jsx +0 -865
- package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.jsx +0 -37
- package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.jsx +0 -48
- package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.jsx +0 -62
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.jsx +0 -175
- package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.jsx +0 -65
- package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.jsx +0 -118
- package/dist/Atomic/FormElements/Text/Text.jsx +0 -126
- package/dist/Atomic/FormElements/Textarea/Textarea.jsx +0 -61
- package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.jsx +0 -181
- package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.jsx +0 -60
- package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.jsx +0 -83
- package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.jsx +0 -80
- package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.jsx +0 -103
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.jsx +0 -115
- package/dist/Atomic/Layout/Header/Header.jsx +0 -86
- package/dist/Atomic/UI/AccordionTable/AccordionTable.jsx +0 -250
- package/dist/Atomic/UI/AccordionText/AccordionText.jsx +0 -68
- package/dist/Atomic/UI/Arrow/Arrow.jsx +0 -134
- package/dist/Atomic/UI/Box/Box.jsx +0 -53
- package/dist/Atomic/UI/Chart/Chart.jsx +0 -178
- package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.jsx +0 -78
- package/dist/Atomic/UI/Chart/partial/optionsConstructor.jsx +0 -334
- package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.jsx +0 -111
- package/dist/Atomic/UI/DateTime/DateTime.jsx +0 -57
- package/dist/Atomic/UI/DebugContainer/DebugContainer.jsx +0 -44
- package/dist/Atomic/UI/DebugContainer/useDebugContainer.jsx +0 -15
- package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.jsx +0 -223
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion._test.jsx +0 -75
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.jsx +0 -86
- package/dist/Atomic/UI/PieChart/PieChart.jsx +0 -41
- package/dist/Atomic/UI/Table/Partials/TdCell.jsx +0 -87
- package/dist/Atomic/UI/Table/Partials/TdHeader.jsx +0 -36
- package/dist/Atomic/UI/Table/Partials/TdRow.jsx +0 -103
- package/dist/Atomic/UI/Table/Partials/TdTitle.jsx +0 -55
- package/dist/Atomic/UI/Table/Table.jsx +0 -63
- package/dist/Atomic/UI/Table/TdTypes/TdActions.jsx +0 -80
- package/dist/Atomic/UI/Table/TdTypes/TdPriority.jsx +0 -26
- package/dist/Atomic/UI/Table/TdTypes/TdRange.jsx +0 -13
- package/dist/Atomic/UI/Table/TdTypes/TdWeight.jsx +0 -56
- package/dist/Atomic/UI/TagList/TagList.jsx +0 -256
- package/dist/Atomic/UI/WizardStepper/constructor.jsx +0 -86
- package/dist/Classes/RESTAPI/partials/CredentialsProcessing.jsx +0 -254
- package/dist/Functions/customEventListener.jsx +0 -96
- package/dist/Functions/operations.jsx +0 -138
- package/dist/Functions/useFormTools/functions/RenderFields.jsx +0 -108
- package/dist/Functions/useFormTools/index.jsx +0 -777
- package/dist/Functions/usePasswordChecker.jsx +0 -128
- package/dist/Functions/utils.jsx +0 -492
- package/dist/Molecular/CustomIcons/components/AffiliateNetworks.jsx +0 -22
- package/dist/Molecular/CustomIcons/components/AlertCircle.jsx +0 -24
- package/dist/Molecular/CustomIcons/components/AppStore.jsx +0 -30
- package/dist/Molecular/CustomIcons/components/Arrow.jsx +0 -33
- package/dist/Molecular/CustomIcons/components/ArrowDown.jsx +0 -18
- package/dist/Molecular/CustomIcons/components/ArrowLeft.jsx +0 -23
- package/dist/Molecular/CustomIcons/components/ArrowRight.jsx +0 -23
- package/dist/Molecular/CustomIcons/components/ArrowUp.jsx +0 -18
- package/dist/Molecular/CustomIcons/components/Bell.jsx +0 -16
- package/dist/Molecular/CustomIcons/components/Button.jsx +0 -13
- package/dist/Molecular/CustomIcons/components/Campaigns.jsx +0 -17
- package/dist/Molecular/CustomIcons/components/Check.jsx +0 -15
- package/dist/Molecular/CustomIcons/components/Check2.jsx +0 -13
- package/dist/Molecular/CustomIcons/components/ChevronDown.jsx +0 -13
- package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.jsx +0 -12
- package/dist/Molecular/CustomIcons/components/ChevronLeft.jsx +0 -12
- package/dist/Molecular/CustomIcons/components/ChevronRight.jsx +0 -12
- package/dist/Molecular/CustomIcons/components/ChevronUp.jsx +0 -12
- package/dist/Molecular/CustomIcons/components/ChevronUpDown.jsx +0 -28
- package/dist/Molecular/CustomIcons/components/Close.jsx +0 -15
- package/dist/Molecular/CustomIcons/components/ColumnsOrder.jsx +0 -18
- package/dist/Molecular/CustomIcons/components/Delete.jsx +0 -17
- package/dist/Molecular/CustomIcons/components/Edit.jsx +0 -16
- package/dist/Molecular/CustomIcons/components/Email.jsx +0 -32
- package/dist/Molecular/CustomIcons/components/FinturfLogo.jsx +0 -19
- package/dist/Molecular/CustomIcons/components/FinturfLogo2.jsx +0 -36
- package/dist/Molecular/CustomIcons/components/Flows.jsx +0 -16
- package/dist/Molecular/CustomIcons/components/Gift.jsx +0 -26
- package/dist/Molecular/CustomIcons/components/GoogleAuth.jsx +0 -30
- package/dist/Molecular/CustomIcons/components/GooglePlay.jsx +0 -30
- package/dist/Molecular/CustomIcons/components/HelpCircle.jsx +0 -20
- package/dist/Molecular/CustomIcons/components/HelpCircle2.jsx +0 -21
- package/dist/Molecular/CustomIcons/components/HelpCircleFilled.jsx +0 -20
- package/dist/Molecular/CustomIcons/components/Home.jsx +0 -17
- package/dist/Molecular/CustomIcons/components/Home2.jsx +0 -23
- package/dist/Molecular/CustomIcons/components/Key.jsx +0 -24
- package/dist/Molecular/CustomIcons/components/Landers.jsx +0 -21
- package/dist/Molecular/CustomIcons/components/Lock.jsx +0 -16
- package/dist/Molecular/CustomIcons/components/Mail.jsx +0 -27
- package/dist/Molecular/CustomIcons/components/Mastercard.jsx +0 -74
- package/dist/Molecular/CustomIcons/components/Minus.jsx +0 -26
- package/dist/Molecular/CustomIcons/components/Offers.jsx +0 -17
- package/dist/Molecular/CustomIcons/components/Pause.jsx +0 -29
- package/dist/Molecular/CustomIcons/components/PayPal.jsx +0 -42
- package/dist/Molecular/CustomIcons/components/PayPalLightLarge.jsx +0 -29
- package/dist/Molecular/CustomIcons/components/Phone.jsx +0 -31
- package/dist/Molecular/CustomIcons/components/Play.jsx +0 -26
- package/dist/Molecular/CustomIcons/components/Plus.jsx +0 -26
- package/dist/Molecular/CustomIcons/components/Profile.jsx +0 -17
- package/dist/Molecular/CustomIcons/components/QRCode.jsx +0 -30
- package/dist/Molecular/CustomIcons/components/Rectangle.jsx +0 -13
- package/dist/Molecular/CustomIcons/components/Revert.jsx +0 -14
- package/dist/Molecular/CustomIcons/components/Star.jsx +0 -15
- package/dist/Molecular/CustomIcons/components/Star2.jsx +0 -17
- package/dist/Molecular/CustomIcons/components/TrafficSources.jsx +0 -15
- package/dist/Molecular/CustomIcons/components/Trash.jsx +0 -16
- package/dist/Molecular/CustomIcons/components/TrashRed.jsx +0 -16
- package/dist/Molecular/CustomIcons/components/Triggers.jsx +0 -16
- package/dist/Molecular/CustomIcons/components/User.jsx +0 -26
- package/dist/Molecular/CustomIcons/components/Visa.jsx +0 -32
- package/dist/Molecular/CustomIcons/components/X.jsx +0 -13
- package/dist/Molecular/FormElement/FormElement.jsx +0 -52
- package/dist/Molecular/FormWithDependOn/FormWithDependOn.jsx +0 -161
- package/dist/Molecular/InputAddress/InputAddress.jsx +0 -641
- package/dist/Molecular/InputPassword/InputPassword.jsx +0 -50
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
import cn from 'classnames';
|
|
2
|
-
|
|
3
|
-
import { useLayoutEffect, useMemo, useState } from 'react';
|
|
4
|
-
|
|
5
|
-
import { formatToPriceWithUSD } from '../../../Functions/fieldValueFormatters';
|
|
6
|
-
import { clone } from '../../../Functions/utils';
|
|
7
|
-
import InputDateRange from '../../FormElements/InputDateRange/InputDateRange';
|
|
8
|
-
import Chart from '../Chart/Chart';
|
|
9
|
-
|
|
10
|
-
import {
|
|
11
|
-
getLabels,
|
|
12
|
-
getMockValue,
|
|
13
|
-
getSafelyDateRange,
|
|
14
|
-
getTab,
|
|
15
|
-
} from './partial/utils';
|
|
16
|
-
|
|
17
|
-
import './partial/AnyOuterClass.scss';
|
|
18
|
-
|
|
19
|
-
function ExampleChartIntegration(props) {
|
|
20
|
-
const { inputDateRangeProps, chartProps } = props || {};
|
|
21
|
-
const { value: outerDateRange, onChange: changeDateRange }
|
|
22
|
-
= inputDateRangeProps || {};
|
|
23
|
-
const { initialChartType } = chartProps || {};
|
|
24
|
-
const dateRange = useMemo(
|
|
25
|
-
() => getSafelyDateRange(outerDateRange),
|
|
26
|
-
[outerDateRange],
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
const [chartType, setChartType] = useState(initialChartType || 'Bar');
|
|
30
|
-
const [tab, setTab] = useState('tab1');
|
|
31
|
-
const [initialModel, setInitialModel] = useState(
|
|
32
|
-
chartType === 'Bar' ? 'finturfLoadingModeBar' : 'finturfLoadingModeLine',
|
|
33
|
-
);
|
|
34
|
-
|
|
35
|
-
const [tab1, setTab1] = useState(null);
|
|
36
|
-
const [tab2, setTab2] = useState(null);
|
|
37
|
-
const [tab3, setTab3] = useState(null);
|
|
38
|
-
const [tab4, setTab4] = useState(null);
|
|
39
|
-
|
|
40
|
-
const [dataForRender, setDataForRender] = useState(null);
|
|
41
|
-
|
|
42
|
-
const getMockData = () => {
|
|
43
|
-
const labels = getLabels(dateRange);
|
|
44
|
-
const mock = () => labels.map(label => getMockValue());
|
|
45
|
-
return {
|
|
46
|
-
labels,
|
|
47
|
-
datasets: [
|
|
48
|
-
{
|
|
49
|
-
data: mock(),
|
|
50
|
-
},
|
|
51
|
-
],
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
const getTabData = (tabId) => {
|
|
56
|
-
switch (tabId) {
|
|
57
|
-
case 'tab1':
|
|
58
|
-
return !tab1 ? null : clone(tab1);
|
|
59
|
-
case 'tab2':
|
|
60
|
-
return !tab2 ? null : clone(tab2);
|
|
61
|
-
case 'tab3':
|
|
62
|
-
return !tab3 ? null : clone(tab3);
|
|
63
|
-
case 'tab4':
|
|
64
|
-
return !tab4 ? null : clone(tab4);
|
|
65
|
-
default:
|
|
66
|
-
return null;
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
const getDescription = (tabId) => {
|
|
71
|
-
switch (tabId) {
|
|
72
|
-
case 'tab1':
|
|
73
|
-
return 'Tab 1';
|
|
74
|
-
case 'tab2':
|
|
75
|
-
return 'Tab 2';
|
|
76
|
-
case 'tab3':
|
|
77
|
-
return 'Tab 3';
|
|
78
|
-
case 'tab4':
|
|
79
|
-
return 'Tab 4';
|
|
80
|
-
default:
|
|
81
|
-
return null;
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
const selectData = () => (getTabData(tab) ? getTabData(tab) : getMockData());
|
|
86
|
-
|
|
87
|
-
const modelsForSwitch = useMemo(
|
|
88
|
-
() =>
|
|
89
|
-
getTabData(tab)
|
|
90
|
-
? ['finturfChartBar', 'finturfChartLine']
|
|
91
|
-
: ['finturfLoadingModeBar', 'finturfLoadingModeLine'],
|
|
92
|
-
[Boolean(getTabData(tab))],
|
|
93
|
-
);
|
|
94
|
-
|
|
95
|
-
const handleChangeChartType = (model) => {
|
|
96
|
-
setChartType(model.includes('Line') ? 'Line' : 'Bar');
|
|
97
|
-
setInitialModel(model);
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
const getModel = () => {
|
|
101
|
-
if (!getTabData(tab)) {
|
|
102
|
-
return chartType === 'Bar'
|
|
103
|
-
? 'finturfLoadingModeBar'
|
|
104
|
-
: 'finturfLoadingModeLine';
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
return chartType === 'Bar' ? 'finturfChartBar' : 'finturfChartLine';
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
const processResponse = (res, tabId) => {
|
|
112
|
-
switch (tabId) {
|
|
113
|
-
case 'tab1':
|
|
114
|
-
setTab1(res);
|
|
115
|
-
break;
|
|
116
|
-
case 'tab2':
|
|
117
|
-
setTab2(res);
|
|
118
|
-
break;
|
|
119
|
-
case 'tab3':
|
|
120
|
-
setTab3(res);
|
|
121
|
-
break;
|
|
122
|
-
case 'tab4':
|
|
123
|
-
setTab4(res);
|
|
124
|
-
break;
|
|
125
|
-
default:
|
|
126
|
-
break;
|
|
127
|
-
}
|
|
128
|
-
return res;
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
useLayoutEffect(() => {
|
|
132
|
-
setTab1(null);
|
|
133
|
-
setTab2(null);
|
|
134
|
-
setTab3(null);
|
|
135
|
-
setTab4(null);
|
|
136
|
-
|
|
137
|
-
// эмуляция запросов
|
|
138
|
-
// вся логика происходит в самих входящих промисах
|
|
139
|
-
// Promise.all добавлен для расширения на случай надобности описания эффектов по завершении всех запросов
|
|
140
|
-
Promise.all([
|
|
141
|
-
getTab('tab1', dateRange, processResponse),
|
|
142
|
-
getTab('tab2', dateRange, processResponse),
|
|
143
|
-
getTab('tab3', dateRange, processResponse),
|
|
144
|
-
getTab('tab4', dateRange, processResponse),
|
|
145
|
-
]);
|
|
146
|
-
}, [dateRange]);
|
|
147
|
-
|
|
148
|
-
useLayoutEffect(() => {
|
|
149
|
-
setInitialModel(getModel());
|
|
150
|
-
setDataForRender(selectData());
|
|
151
|
-
}, [Boolean(getTabData(tab)), tab, chartType]);
|
|
152
|
-
|
|
153
|
-
return (
|
|
154
|
-
<div className="example-wrapper">
|
|
155
|
-
<InputDateRange
|
|
156
|
-
{...inputDateRangeProps}
|
|
157
|
-
value={outerDateRange}
|
|
158
|
-
onChange={changeDateRange}
|
|
159
|
-
/>
|
|
160
|
-
|
|
161
|
-
<div className="buttons-block">
|
|
162
|
-
<button
|
|
163
|
-
className={cn('tab-button', { 'tab-button_active': tab === 'tab1' })}
|
|
164
|
-
onClick={() => setTab('tab1')}
|
|
165
|
-
>
|
|
166
|
-
Tab 1
|
|
167
|
-
</button>
|
|
168
|
-
<button
|
|
169
|
-
className={cn('tab-button', { 'tab-button_active': tab === 'tab2' })}
|
|
170
|
-
onClick={() => setTab('tab2')}
|
|
171
|
-
>
|
|
172
|
-
Tab 2
|
|
173
|
-
</button>
|
|
174
|
-
<button
|
|
175
|
-
className={cn('tab-button', { 'tab-button_active': tab === 'tab3' })}
|
|
176
|
-
onClick={() => setTab('tab3')}
|
|
177
|
-
>
|
|
178
|
-
Tab 3
|
|
179
|
-
</button>
|
|
180
|
-
<button
|
|
181
|
-
className={cn('tab-button', { 'tab-button_active': tab === 'tab4' })}
|
|
182
|
-
onClick={() => setTab('tab4')}
|
|
183
|
-
>
|
|
184
|
-
Tab 4
|
|
185
|
-
</button>
|
|
186
|
-
</div>
|
|
187
|
-
|
|
188
|
-
<Chart
|
|
189
|
-
{...chartProps}
|
|
190
|
-
key={JSON.stringify(dataForRender)}
|
|
191
|
-
data={dataForRender}
|
|
192
|
-
setModelExternalValue={handleChangeChartType}
|
|
193
|
-
initialModel={initialModel}
|
|
194
|
-
modelsForSwitch={modelsForSwitch}
|
|
195
|
-
description={{ label: getDescription(tab) }}
|
|
196
|
-
addToDatasets={{ id: tab }}
|
|
197
|
-
modifyOptions={options => ({
|
|
198
|
-
...options,
|
|
199
|
-
options: {
|
|
200
|
-
...options?.options,
|
|
201
|
-
plugins: {
|
|
202
|
-
...options?.options?.plugins,
|
|
203
|
-
tooltip: {
|
|
204
|
-
...options?.options?.plugins?.tooltip,
|
|
205
|
-
callbacks: {
|
|
206
|
-
...options?.options?.plugins?.tooltip?.callbacks,
|
|
207
|
-
label: (context) => {
|
|
208
|
-
return context.dataset.id === 'tab3'
|
|
209
|
-
|| context.dataset.id === 'tab4'
|
|
210
|
-
? formatToPriceWithUSD(context.raw || '0')
|
|
211
|
-
: context.raw || '0';
|
|
212
|
-
},
|
|
213
|
-
},
|
|
214
|
-
},
|
|
215
|
-
},
|
|
216
|
-
},
|
|
217
|
-
})}
|
|
218
|
-
/>
|
|
219
|
-
</div>
|
|
220
|
-
);
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
export default ExampleChartIntegration;
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { fireEvent, render, screen } from '@testing-library/react';
|
|
2
|
-
|
|
3
|
-
import MonoAccordion from './MonoAccordion';
|
|
4
|
-
|
|
5
|
-
describe('monoAccordion', () => {
|
|
6
|
-
const defaultProps = {
|
|
7
|
-
titleJSX: <div>Accordion Title</div>,
|
|
8
|
-
icon: <span>▼</span>,
|
|
9
|
-
isOpen: false,
|
|
10
|
-
onClick: jest.fn(),
|
|
11
|
-
testId: 'test-accordion',
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
it('renders correctly with default props', () => {
|
|
15
|
-
render(
|
|
16
|
-
<MonoAccordion {...defaultProps}>
|
|
17
|
-
<div>Accordion Content</div>
|
|
18
|
-
</MonoAccordion>,
|
|
19
|
-
);
|
|
20
|
-
|
|
21
|
-
expect(screen.getByTestId('test-accordion')).toBeInTheDocument();
|
|
22
|
-
expect(screen.getByText('Accordion Title')).toBeInTheDocument();
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it('handles click events correctly', () => {
|
|
26
|
-
render(
|
|
27
|
-
<MonoAccordion {...defaultProps}>
|
|
28
|
-
<div>Accordion Content</div>
|
|
29
|
-
</MonoAccordion>,
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
fireEvent.click(screen.getByRole('button'));
|
|
33
|
-
expect(defaultProps.onClick).toHaveBeenCalled();
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
it('applies correct classes when open', () => {
|
|
37
|
-
render(
|
|
38
|
-
<MonoAccordion {...defaultProps} isOpen={true}>
|
|
39
|
-
<div>Accordion Content</div>
|
|
40
|
-
</MonoAccordion>,
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
expect(screen.getByTestId('test-accordion')).toHaveClass('mono-accordion--is-open');
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
it('applies disabled state correctly', () => {
|
|
47
|
-
render(
|
|
48
|
-
<MonoAccordion {...defaultProps} disabled={true}>
|
|
49
|
-
<div>Accordion Content</div>
|
|
50
|
-
</MonoAccordion>,
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
const button = screen.getByRole('button');
|
|
54
|
-
expect(button).toBeDisabled();
|
|
55
|
-
expect(screen.getByTestId('test-accordion')).toHaveClass('mono-accordion--disabled');
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
it('handles aria attributes correctly', () => {
|
|
59
|
-
const { rerender } = render(
|
|
60
|
-
<MonoAccordion {...defaultProps}>
|
|
61
|
-
<div>Accordion Content</div>
|
|
62
|
-
</MonoAccordion>,
|
|
63
|
-
);
|
|
64
|
-
|
|
65
|
-
expect(screen.getByRole('button')).toHaveAttribute('aria-expanded', 'false');
|
|
66
|
-
|
|
67
|
-
rerender(
|
|
68
|
-
<MonoAccordion {...defaultProps} isOpen={true}>
|
|
69
|
-
<div>Accordion Content</div>
|
|
70
|
-
</MonoAccordion>,
|
|
71
|
-
);
|
|
72
|
-
|
|
73
|
-
expect(screen.getByRole('button')).toHaveAttribute('aria-expanded', 'true');
|
|
74
|
-
});
|
|
75
|
-
});
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import cn from 'classnames';
|
|
2
|
-
|
|
3
|
-
import { useEffect, useRef, useState } from 'react';
|
|
4
|
-
|
|
5
|
-
import './MonoAccordion.scss';
|
|
6
|
-
|
|
7
|
-
const RC = 'mono-accordion';
|
|
8
|
-
|
|
9
|
-
function MonoAccordion({
|
|
10
|
-
titleJSX,
|
|
11
|
-
icon,
|
|
12
|
-
children,
|
|
13
|
-
isOpen,
|
|
14
|
-
onClick,
|
|
15
|
-
className,
|
|
16
|
-
disabled,
|
|
17
|
-
testId = 'mono-accordion',
|
|
18
|
-
datasetProp = {},
|
|
19
|
-
}) {
|
|
20
|
-
const [maxHeight, setMaxHeight] = useState();
|
|
21
|
-
const titleRef = useRef();
|
|
22
|
-
const containerRef = useRef();
|
|
23
|
-
|
|
24
|
-
const setHeight = (value) => {
|
|
25
|
-
if (value !== undefined) {
|
|
26
|
-
setMaxHeight(state => `${value}px`);
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
setMaxHeight(
|
|
30
|
-
state =>
|
|
31
|
-
`${Array.from(containerRef.current?.childNodes)?.reduce?.((acc, el) => acc + el.offsetHeight, 0)}px`,
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
const handleClick = (e) => {
|
|
37
|
-
if (
|
|
38
|
-
!Array.from(titleRef.current.childNodes).some(el =>
|
|
39
|
-
el.contains(e.target),
|
|
40
|
-
)
|
|
41
|
-
) {
|
|
42
|
-
onClick(e);
|
|
43
|
-
e?.preventDefault();
|
|
44
|
-
e?.stopPropagation();
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
return e;
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
useEffect(() => {
|
|
52
|
-
if (!isOpen) setHeight(0);
|
|
53
|
-
else setHeight();
|
|
54
|
-
}, [isOpen, children]);
|
|
55
|
-
|
|
56
|
-
return (
|
|
57
|
-
<div
|
|
58
|
-
{...datasetProp}
|
|
59
|
-
data-testid={testId}
|
|
60
|
-
className={cn(RC, className, {
|
|
61
|
-
[`${RC}_is-open`]: isOpen,
|
|
62
|
-
[`${RC}_disabled`]: disabled,
|
|
63
|
-
})}
|
|
64
|
-
>
|
|
65
|
-
<div
|
|
66
|
-
className={`${RC}__head`}
|
|
67
|
-
onClick={handleClick}
|
|
68
|
-
>
|
|
69
|
-
<div ref={titleRef} className={`${RC}__tile-container`}>
|
|
70
|
-
{titleJSX}
|
|
71
|
-
</div>
|
|
72
|
-
<span className={`${RC}__icon-container`}>{icon}</span>
|
|
73
|
-
</div>
|
|
74
|
-
|
|
75
|
-
<div
|
|
76
|
-
ref={containerRef}
|
|
77
|
-
style={{ maxHeight }}
|
|
78
|
-
className={cn(`${RC}__container`)}
|
|
79
|
-
>
|
|
80
|
-
<div className={`${RC}__content-wrapper`}>{children}</div>
|
|
81
|
-
</div>
|
|
82
|
-
</div>
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export default MonoAccordion;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { ArcElement, Chart as ChartJS, Tooltip } from 'chart.js';
|
|
2
|
-
import { Pie } from 'react-chartjs-2';
|
|
3
|
-
|
|
4
|
-
import './PieChart.scss';
|
|
5
|
-
|
|
6
|
-
ChartJS.register(ArcElement, Tooltip);
|
|
7
|
-
|
|
8
|
-
function PieChart({
|
|
9
|
-
data,
|
|
10
|
-
cutout = '80%',
|
|
11
|
-
resultLabel,
|
|
12
|
-
resultValue = 0,
|
|
13
|
-
withLegend = false,
|
|
14
|
-
}) {
|
|
15
|
-
const options = {
|
|
16
|
-
cutout,
|
|
17
|
-
plugins: {
|
|
18
|
-
legend: {
|
|
19
|
-
display: withLegend,
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
return (
|
|
25
|
-
<div className="pie-chart-box" style={{ maxWidth: `320px` }}>
|
|
26
|
-
<Pie data={data} options={options} />
|
|
27
|
-
{Boolean(resultLabel) && (
|
|
28
|
-
<div className="pie-chart__result">
|
|
29
|
-
<div className="pie-chart__result-value">
|
|
30
|
-
{resultValue}
|
|
31
|
-
<span className="pie-chart__result-percent">%</span>
|
|
32
|
-
{' '}
|
|
33
|
-
</div>
|
|
34
|
-
<div className="pie-chart__result-label">{resultLabel}</div>
|
|
35
|
-
</div>
|
|
36
|
-
)}
|
|
37
|
-
</div>
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export default PieChart;
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
|
-
|
|
3
|
-
import AccordionItem from '../../Accordion/AccordionItem';
|
|
4
|
-
import AdvancedTags from '../../AdvancedTag/AdvancedTags';
|
|
5
|
-
import Status from '../../Status/Status';
|
|
6
|
-
import Tag from '../../Tag/Tag';
|
|
7
|
-
import Table from '../Table';
|
|
8
|
-
import { TdActions } from '../TdTypes/TdActions';
|
|
9
|
-
import TdPriority from '../TdTypes/TdPriority';
|
|
10
|
-
import TdWeight from '../TdTypes/TdWeight';
|
|
11
|
-
|
|
12
|
-
import '../Table.scss';
|
|
13
|
-
|
|
14
|
-
function TdCell({
|
|
15
|
-
type,
|
|
16
|
-
item,
|
|
17
|
-
rowIndex,
|
|
18
|
-
onChange,
|
|
19
|
-
cardLength,
|
|
20
|
-
changePriority,
|
|
21
|
-
getAdviceWeight,
|
|
22
|
-
onActionClick,
|
|
23
|
-
rowItem,
|
|
24
|
-
isDeleted,
|
|
25
|
-
}) {
|
|
26
|
-
const [isAccordionOpen, setIsAccordionOpen] = useState(item.isOpen);
|
|
27
|
-
|
|
28
|
-
const percent
|
|
29
|
-
= item.type === 'weight' && getAdviceWeight(isDeleted ? 0 : item.value);
|
|
30
|
-
|
|
31
|
-
switch (type) {
|
|
32
|
-
case 'accordion':
|
|
33
|
-
return (
|
|
34
|
-
<AccordionItem
|
|
35
|
-
className={item.itemClassName}
|
|
36
|
-
item={item}
|
|
37
|
-
isOpen={isAccordionOpen}
|
|
38
|
-
onClick={e => setIsAccordionOpen(e)}
|
|
39
|
-
>
|
|
40
|
-
<Table rows={item.rows} className="accordion--table" />
|
|
41
|
-
</AccordionItem>
|
|
42
|
-
);
|
|
43
|
-
case 'actions':
|
|
44
|
-
return (
|
|
45
|
-
<TdActions
|
|
46
|
-
rowItem={rowItem}
|
|
47
|
-
actions={item}
|
|
48
|
-
onChange={onChange}
|
|
49
|
-
onActionClick={onActionClick}
|
|
50
|
-
/>
|
|
51
|
-
);
|
|
52
|
-
case 'advancedTags':
|
|
53
|
-
return <AdvancedTags items={item} />;
|
|
54
|
-
case 'link':
|
|
55
|
-
return <a href={item.link}>{item.label}</a>;
|
|
56
|
-
case 'priority':
|
|
57
|
-
return (
|
|
58
|
-
<TdPriority
|
|
59
|
-
rowIndex={rowIndex}
|
|
60
|
-
cardLength={cardLength}
|
|
61
|
-
onClick={changePriority}
|
|
62
|
-
/>
|
|
63
|
-
);
|
|
64
|
-
case 'status':
|
|
65
|
-
return (
|
|
66
|
-
<Status
|
|
67
|
-
className={item.className}
|
|
68
|
-
label={item.label}
|
|
69
|
-
status={item.status}
|
|
70
|
-
/>
|
|
71
|
-
);
|
|
72
|
-
case 'tags':
|
|
73
|
-
return item.map((tag, index) => <Tag key={index} label={tag.label} />);
|
|
74
|
-
case 'weight':
|
|
75
|
-
return (
|
|
76
|
-
<TdWeight
|
|
77
|
-
value={item.value}
|
|
78
|
-
percent={percent}
|
|
79
|
-
onChange={value => onChange({ ...item, value })}
|
|
80
|
-
/>
|
|
81
|
-
);
|
|
82
|
-
default:
|
|
83
|
-
return <span className={item.className}>{item.value}</span>;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export default TdCell;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import cn from 'classnames';
|
|
2
|
-
|
|
3
|
-
import Langs from '../../../../Langs';
|
|
4
|
-
|
|
5
|
-
import '../Table.scss';
|
|
6
|
-
|
|
7
|
-
function TdHeader({ item, testId = 'td-header' }) {
|
|
8
|
-
const txt = Langs[globalThis.lng];
|
|
9
|
-
|
|
10
|
-
switch (item.type) {
|
|
11
|
-
case 'double':
|
|
12
|
-
return (
|
|
13
|
-
<th data-testid={testId}>
|
|
14
|
-
<div className="j46">
|
|
15
|
-
<div className="">{txt.labels[item.left] || item.left}</div>
|
|
16
|
-
<div className="">{txt.labels[item.right] || item.right}</div>
|
|
17
|
-
</div>
|
|
18
|
-
</th>
|
|
19
|
-
);
|
|
20
|
-
default:
|
|
21
|
-
return (
|
|
22
|
-
<th data-testid={testId} className={cn(item.className)}>
|
|
23
|
-
<div className={cn({ df: item.button })}>
|
|
24
|
-
<div className="mr5">{txt.labels[item.label] || item.label}</div>
|
|
25
|
-
{item.button && (
|
|
26
|
-
<div className="cards-table__btn">
|
|
27
|
-
{txt.buttons[item.button] || item.button}
|
|
28
|
-
</div>
|
|
29
|
-
)}
|
|
30
|
-
</div>
|
|
31
|
-
</th>
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export default TdHeader;
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import cn from 'classnames';
|
|
2
|
-
|
|
3
|
-
import { useState } from 'react';
|
|
4
|
-
|
|
5
|
-
import { handleObjectChange } from '../../../../Functions/utils';
|
|
6
|
-
import Modal from '../../Modal/Modal';
|
|
7
|
-
import TdRange from '../TdTypes/TdRange';
|
|
8
|
-
|
|
9
|
-
import TdCell from './TdCell';
|
|
10
|
-
|
|
11
|
-
import '../Table.scss';
|
|
12
|
-
|
|
13
|
-
function TdRow({
|
|
14
|
-
item,
|
|
15
|
-
onChange,
|
|
16
|
-
rowIndex,
|
|
17
|
-
cardStatus,
|
|
18
|
-
range,
|
|
19
|
-
type,
|
|
20
|
-
rowSpan,
|
|
21
|
-
colSpan,
|
|
22
|
-
cardLength,
|
|
23
|
-
changePriority,
|
|
24
|
-
getAdviceWeight,
|
|
25
|
-
onActionClick,
|
|
26
|
-
isDeleted,
|
|
27
|
-
testId = 'td-row',
|
|
28
|
-
}) {
|
|
29
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
30
|
-
|
|
31
|
-
const handleChange = handleObjectChange(item, () => onChange({ ...item }));
|
|
32
|
-
|
|
33
|
-
return (
|
|
34
|
-
<>
|
|
35
|
-
<tr data-testid={testId}>
|
|
36
|
-
{type && rowSpan && (
|
|
37
|
-
<td className="rel" rowSpan={rowSpan + 1}>
|
|
38
|
-
<span
|
|
39
|
-
className={cn(
|
|
40
|
-
type && `cards-table__score cards-table__score-${cardStatus}`,
|
|
41
|
-
)}
|
|
42
|
-
>
|
|
43
|
-
<TdRange item={range} />
|
|
44
|
-
</span>
|
|
45
|
-
</td>
|
|
46
|
-
)}
|
|
47
|
-
|
|
48
|
-
{Object.entries(item).map(([key, value]) =>
|
|
49
|
-
key === 'id' || key === 'isDeleted'
|
|
50
|
-
? null
|
|
51
|
-
: (
|
|
52
|
-
<td
|
|
53
|
-
key={key}
|
|
54
|
-
className={cn('cards-table__body-item', {
|
|
55
|
-
'cards-table__accordion': value.type === 'accordion',
|
|
56
|
-
})}
|
|
57
|
-
>
|
|
58
|
-
<TdCell
|
|
59
|
-
onActionClick={onActionClick}
|
|
60
|
-
changePriority={changePriority}
|
|
61
|
-
cardLength={cardLength}
|
|
62
|
-
rowIndex={rowIndex}
|
|
63
|
-
rowItem={item}
|
|
64
|
-
type={key}
|
|
65
|
-
item={value}
|
|
66
|
-
onChange={newValue => handleChange(newValue, key)}
|
|
67
|
-
getAdviceWeight={getAdviceWeight}
|
|
68
|
-
isDeleted={isDeleted}
|
|
69
|
-
/>
|
|
70
|
-
</td>
|
|
71
|
-
),
|
|
72
|
-
)}
|
|
73
|
-
</tr>
|
|
74
|
-
|
|
75
|
-
{type && colSpan
|
|
76
|
-
? (
|
|
77
|
-
<tr>
|
|
78
|
-
<td />
|
|
79
|
-
<td colSpan={colSpan}>
|
|
80
|
-
<span
|
|
81
|
-
className="cards-table__title-select-lender-btn"
|
|
82
|
-
onClick={() => setIsOpen(true)}
|
|
83
|
-
>
|
|
84
|
-
Select Lender
|
|
85
|
-
</span>
|
|
86
|
-
|
|
87
|
-
<Modal
|
|
88
|
-
closeModal={() => setIsOpen(false)}
|
|
89
|
-
isOpen={isOpen}
|
|
90
|
-
title="Choose Lender"
|
|
91
|
-
size="420"
|
|
92
|
-
>
|
|
93
|
-
test
|
|
94
|
-
</Modal>
|
|
95
|
-
</td>
|
|
96
|
-
</tr>
|
|
97
|
-
)
|
|
98
|
-
: null}
|
|
99
|
-
</>
|
|
100
|
-
);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export default TdRow;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
|
-
|
|
3
|
-
import Langs from '../../../../../Langs';
|
|
4
|
-
import Modal from '../../Modal/Modal';
|
|
5
|
-
import Tag from '../../Tag/Tag';
|
|
6
|
-
|
|
7
|
-
import '../Table.scss';
|
|
8
|
-
|
|
9
|
-
function TdTitle({ locations, title }) {
|
|
10
|
-
const txt = Langs[globalThis.lng];
|
|
11
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
12
|
-
|
|
13
|
-
return (
|
|
14
|
-
<div className="cards-table__title-box">
|
|
15
|
-
<div className="cards-table__title-box--left">
|
|
16
|
-
<div className="cards-table__title-box--title">
|
|
17
|
-
{txt.titles[title] || title}
|
|
18
|
-
</div>
|
|
19
|
-
<div className="cards-table__title-box--tags">
|
|
20
|
-
<span className="mr5">
|
|
21
|
-
{txt.labels.locations.toUpperCase()}
|
|
22
|
-
:
|
|
23
|
-
</span>
|
|
24
|
-
{locations?.map((tag, index) => (
|
|
25
|
-
<Tag key={index} label={tag.label} />
|
|
26
|
-
))}
|
|
27
|
-
</div>
|
|
28
|
-
</div>
|
|
29
|
-
|
|
30
|
-
<div className="cards-table__title-box--right">
|
|
31
|
-
<span
|
|
32
|
-
onClick={() => setIsOpen(true)}
|
|
33
|
-
className="cards-table__title-edit-btn mr5"
|
|
34
|
-
>
|
|
35
|
-
{txt.buttons.edit}
|
|
36
|
-
</span>
|
|
37
|
-
|
|
38
|
-
<Modal
|
|
39
|
-
mode="edit"
|
|
40
|
-
closeModal={() => setIsOpen(false)}
|
|
41
|
-
isOpen={isOpen}
|
|
42
|
-
title={txt.titles.pingTree}
|
|
43
|
-
size="420"
|
|
44
|
-
>
|
|
45
|
-
test
|
|
46
|
-
</Modal>
|
|
47
|
-
<span className="cards-table__title-delete-btn">
|
|
48
|
-
{txt.buttons.deletePingTree}
|
|
49
|
-
</span>
|
|
50
|
-
</div>
|
|
51
|
-
</div>
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export default TdTitle;
|