intelicoreact 1.8.3 → 1.8.5
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.jsx +18 -0
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN_old.jsx +121 -0
- package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.jsx +507 -0
- package/dist/Atomic/FormElements/MultiSelect/MultiSelect.jsx +46 -0
- package/dist/Atomic/FormElements/NumericInput/NumericInput.jsx +337 -0
- package/dist/Atomic/FormElements/RadioGroup/RadioGroup.jsx +66 -0
- package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.jsx +78 -0
- package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.jsx +54 -0
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.jsx +183 -0
- package/dist/Atomic/FormElements/RangeList/RangeList.jsx +181 -0
- package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.jsx +41 -0
- package/dist/Atomic/FormElements/RangeSlider/RangeSlider.jsx +449 -0
- package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.jsx +865 -0
- package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.jsx +37 -0
- package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.jsx +48 -0
- package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.jsx +62 -0
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.jsx +175 -0
- package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.jsx +65 -0
- package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.jsx +118 -0
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.interface.ts +2 -0
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +1 -1
- package/dist/Atomic/FormElements/Text/Text.jsx +126 -0
- package/dist/Atomic/FormElements/Textarea/Textarea.jsx +61 -0
- package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.jsx +181 -0
- package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.jsx +60 -0
- package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.jsx +83 -0
- package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.jsx +80 -0
- package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.jsx +103 -0
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.jsx +115 -0
- package/dist/Atomic/Layout/Header/Header.jsx +86 -0
- package/dist/Atomic/UI/AccordionTable/AccordionTable.jsx +250 -0
- package/dist/Atomic/UI/AccordionText/AccordionText.jsx +68 -0
- package/dist/Atomic/UI/Arrow/Arrow.jsx +134 -0
- package/dist/Atomic/UI/Box/Box.jsx +53 -0
- package/dist/Atomic/UI/Chart/Chart.jsx +178 -0
- package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.jsx +78 -0
- package/dist/Atomic/UI/Chart/partial/optionsConstructor.jsx +334 -0
- package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.jsx +111 -0
- package/dist/Atomic/UI/DateTime/DateTime.jsx +57 -0
- package/dist/Atomic/UI/DebugContainer/DebugContainer.jsx +44 -0
- package/dist/Atomic/UI/DebugContainer/useDebugContainer.jsx +15 -0
- package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.jsx +223 -0
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion._test.jsx +75 -0
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.jsx +86 -0
- package/dist/Atomic/UI/PieChart/PieChart.jsx +41 -0
- package/dist/Atomic/UI/Table/Partials/TdCell.jsx +87 -0
- package/dist/Atomic/UI/Table/Partials/TdHeader.jsx +36 -0
- package/dist/Atomic/UI/Table/Partials/TdRow.jsx +103 -0
- package/dist/Atomic/UI/Table/Partials/TdTitle.jsx +55 -0
- package/dist/Atomic/UI/Table/Table.jsx +63 -0
- package/dist/Atomic/UI/Table/TdTypes/TdActions.jsx +80 -0
- package/dist/Atomic/UI/Table/TdTypes/TdPriority.jsx +26 -0
- package/dist/Atomic/UI/Table/TdTypes/TdRange.jsx +13 -0
- package/dist/Atomic/UI/Table/TdTypes/TdWeight.jsx +56 -0
- package/dist/Atomic/UI/Tag/Tag.interface.ts +1 -0
- package/dist/Atomic/UI/Tag/Tag.js +1 -1
- package/dist/Atomic/UI/TagList/TagList.jsx +256 -0
- package/dist/Atomic/UI/WizardStepper/constructor.jsx +86 -0
- package/dist/Classes/RESTAPI/partials/CredentialsProcessing.jsx +254 -0
- package/dist/Functions/customEventListener.jsx +96 -0
- package/dist/Functions/operations.jsx +138 -0
- package/dist/Functions/useFormTools/functions/RenderFields.jsx +108 -0
- package/dist/Functions/useFormTools/index.jsx +777 -0
- package/dist/Functions/usePasswordChecker.jsx +128 -0
- package/dist/Functions/utils.jsx +492 -0
- package/dist/Molecular/CustomIcons/components/AffiliateNetworks.jsx +22 -0
- package/dist/Molecular/CustomIcons/components/AlertCircle.jsx +24 -0
- package/dist/Molecular/CustomIcons/components/AppStore.jsx +30 -0
- package/dist/Molecular/CustomIcons/components/Arrow.jsx +33 -0
- package/dist/Molecular/CustomIcons/components/ArrowDown.jsx +18 -0
- package/dist/Molecular/CustomIcons/components/ArrowLeft.jsx +23 -0
- package/dist/Molecular/CustomIcons/components/ArrowRight.jsx +23 -0
- package/dist/Molecular/CustomIcons/components/ArrowUp.jsx +18 -0
- package/dist/Molecular/CustomIcons/components/Bell.jsx +16 -0
- package/dist/Molecular/CustomIcons/components/Button.jsx +13 -0
- package/dist/Molecular/CustomIcons/components/Campaigns.jsx +17 -0
- package/dist/Molecular/CustomIcons/components/Check.jsx +15 -0
- package/dist/Molecular/CustomIcons/components/Check2.jsx +13 -0
- package/dist/Molecular/CustomIcons/components/ChevronDown.jsx +13 -0
- package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.jsx +12 -0
- package/dist/Molecular/CustomIcons/components/ChevronLeft.jsx +12 -0
- package/dist/Molecular/CustomIcons/components/ChevronRight.jsx +12 -0
- package/dist/Molecular/CustomIcons/components/ChevronUp.jsx +12 -0
- package/dist/Molecular/CustomIcons/components/ChevronUpDown.jsx +28 -0
- package/dist/Molecular/CustomIcons/components/Close.jsx +15 -0
- package/dist/Molecular/CustomIcons/components/ColumnsOrder.jsx +18 -0
- package/dist/Molecular/CustomIcons/components/Delete.jsx +17 -0
- package/dist/Molecular/CustomIcons/components/Edit.jsx +16 -0
- package/dist/Molecular/CustomIcons/components/Email.jsx +32 -0
- package/dist/Molecular/CustomIcons/components/FinturfLogo.jsx +19 -0
- package/dist/Molecular/CustomIcons/components/FinturfLogo2.jsx +36 -0
- package/dist/Molecular/CustomIcons/components/Flows.jsx +16 -0
- package/dist/Molecular/CustomIcons/components/Gift.jsx +26 -0
- package/dist/Molecular/CustomIcons/components/GoogleAuth.jsx +30 -0
- package/dist/Molecular/CustomIcons/components/GooglePlay.jsx +30 -0
- package/dist/Molecular/CustomIcons/components/HelpCircle.jsx +20 -0
- package/dist/Molecular/CustomIcons/components/HelpCircle2.jsx +21 -0
- package/dist/Molecular/CustomIcons/components/HelpCircleFilled.jsx +20 -0
- package/dist/Molecular/CustomIcons/components/Home.jsx +17 -0
- package/dist/Molecular/CustomIcons/components/Home2.jsx +23 -0
- package/dist/Molecular/CustomIcons/components/Key.jsx +24 -0
- package/dist/Molecular/CustomIcons/components/Landers.jsx +21 -0
- package/dist/Molecular/CustomIcons/components/Lock.jsx +16 -0
- package/dist/Molecular/CustomIcons/components/Mail.jsx +27 -0
- package/dist/Molecular/CustomIcons/components/Mastercard.jsx +74 -0
- package/dist/Molecular/CustomIcons/components/Minus.jsx +26 -0
- package/dist/Molecular/CustomIcons/components/Offers.jsx +17 -0
- package/dist/Molecular/CustomIcons/components/Pause.jsx +29 -0
- package/dist/Molecular/CustomIcons/components/PayPal.jsx +42 -0
- package/dist/Molecular/CustomIcons/components/PayPalLightLarge.jsx +29 -0
- package/dist/Molecular/CustomIcons/components/Phone.jsx +31 -0
- package/dist/Molecular/CustomIcons/components/Play.jsx +26 -0
- package/dist/Molecular/CustomIcons/components/Plus.jsx +26 -0
- package/dist/Molecular/CustomIcons/components/Profile.jsx +17 -0
- package/dist/Molecular/CustomIcons/components/QRCode.jsx +30 -0
- package/dist/Molecular/CustomIcons/components/Rectangle.jsx +13 -0
- package/dist/Molecular/CustomIcons/components/Revert.jsx +14 -0
- package/dist/Molecular/CustomIcons/components/Star.jsx +15 -0
- package/dist/Molecular/CustomIcons/components/Star2.jsx +17 -0
- package/dist/Molecular/CustomIcons/components/TrafficSources.jsx +15 -0
- package/dist/Molecular/CustomIcons/components/Trash.jsx +16 -0
- package/dist/Molecular/CustomIcons/components/TrashRed.jsx +16 -0
- package/dist/Molecular/CustomIcons/components/Triggers.jsx +16 -0
- package/dist/Molecular/CustomIcons/components/User.jsx +26 -0
- package/dist/Molecular/CustomIcons/components/Visa.jsx +32 -0
- package/dist/Molecular/CustomIcons/components/X.jsx +13 -0
- package/dist/Molecular/FormElement/FormElement.jsx +52 -0
- package/dist/Molecular/FormWithDependOn/FormWithDependOn.jsx +161 -0
- package/dist/Molecular/InputAddress/InputAddress.jsx +641 -0
- package/dist/Molecular/InputPassword/InputPassword.jsx +50 -0
- package/package.json +13 -6
- package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.js +0 -1
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN_old.js +0 -1
- package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +0 -1
- package/dist/Atomic/FormElements/MultiSelect/MultiSelect.js +0 -1
- package/dist/Atomic/FormElements/NumericInput/NumericInput.js +0 -1
- package/dist/Atomic/FormElements/RadioGroup/RadioGroup.js +0 -1
- package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +0 -1
- package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.js +0 -1
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +0 -1
- package/dist/Atomic/FormElements/RangeList/RangeList.js +0 -1
- package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.js +0 -1
- package/dist/Atomic/FormElements/RangeSlider/RangeSlider.js +0 -1
- package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +0 -1
- package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.js +0 -1
- package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.js +0 -1
- package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.js +0 -1
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.d.ts +0 -16
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.js +0 -1
- package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.js +0 -1
- package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.d.ts +0 -9
- package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.js +0 -1
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.d.ts +0 -5
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.interface.d.ts +0 -79
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.interface.js +0 -1
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.interface.js.map +0 -1
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js.map +0 -1
- package/dist/Atomic/FormElements/Text/Text.js +0 -1
- package/dist/Atomic/FormElements/Textarea/Textarea.js +0 -1
- package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +0 -1
- package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.js +0 -1
- package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.js +0 -1
- package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.js +0 -1
- package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.js +0 -1
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.js +0 -1
- package/dist/Atomic/Layout/Header/Header.js +0 -1
- package/dist/Atomic/UI/AccordionTable/AccordionTable.js +0 -1
- package/dist/Atomic/UI/AccordionText/AccordionText.js +0 -1
- package/dist/Atomic/UI/Arrow/Arrow.js +0 -1
- package/dist/Atomic/UI/Box/Box.js +0 -1
- package/dist/Atomic/UI/Chart/Chart.js +0 -1
- package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +0 -1
- package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +0 -1
- package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +0 -1
- package/dist/Atomic/UI/DateTime/DateTime.js +0 -1
- package/dist/Atomic/UI/DebugContainer/DebugContainer.js +0 -1
- package/dist/Atomic/UI/DebugContainer/useDebugContainer.js +0 -1
- package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +0 -1
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion._test.js +0 -1
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +0 -1
- package/dist/Atomic/UI/PieChart/PieChart.js +0 -1
- package/dist/Atomic/UI/Table/Partials/TdCell.js +0 -1
- package/dist/Atomic/UI/Table/Partials/TdHeader.js +0 -1
- package/dist/Atomic/UI/Table/Partials/TdRow.js +0 -1
- package/dist/Atomic/UI/Table/Partials/TdTitle.js +0 -1
- package/dist/Atomic/UI/Table/Table.js +0 -1
- package/dist/Atomic/UI/Table/TdTypes/TdActions.js +0 -1
- package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +0 -1
- package/dist/Atomic/UI/Table/TdTypes/TdRange.js +0 -1
- package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +0 -1
- package/dist/Atomic/UI/TagList/TagList.js +0 -1
- package/dist/Atomic/UI/WizardStepper/constructor.js +0 -1
- package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +0 -1
- package/dist/Functions/customEventListener.js +0 -1
- package/dist/Functions/operations.js +0 -1
- package/dist/Functions/useFormTools/functions/RenderFields.js +0 -1
- package/dist/Functions/useFormTools/index.js +0 -1
- package/dist/Functions/usePasswordChecker.js +0 -1
- package/dist/Functions/utils.js +0 -1
- package/dist/Molecular/CustomIcons/components/AffiliateNetworks.js +0 -1
- package/dist/Molecular/CustomIcons/components/AlertCircle.js +0 -1
- package/dist/Molecular/CustomIcons/components/AppStore.js +0 -1
- package/dist/Molecular/CustomIcons/components/Arrow.js +0 -1
- package/dist/Molecular/CustomIcons/components/ArrowDown.js +0 -1
- package/dist/Molecular/CustomIcons/components/ArrowLeft.js +0 -1
- package/dist/Molecular/CustomIcons/components/ArrowRight.js +0 -1
- package/dist/Molecular/CustomIcons/components/ArrowUp.js +0 -1
- package/dist/Molecular/CustomIcons/components/Bell.js +0 -1
- package/dist/Molecular/CustomIcons/components/Button.js +0 -1
- package/dist/Molecular/CustomIcons/components/Campaigns.js +0 -1
- package/dist/Molecular/CustomIcons/components/Check.js +0 -1
- package/dist/Molecular/CustomIcons/components/Check2.js +0 -1
- package/dist/Molecular/CustomIcons/components/ChevronDown.js +0 -1
- package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.js +0 -1
- package/dist/Molecular/CustomIcons/components/ChevronLeft.js +0 -1
- package/dist/Molecular/CustomIcons/components/ChevronRight.js +0 -1
- package/dist/Molecular/CustomIcons/components/ChevronUp.js +0 -1
- package/dist/Molecular/CustomIcons/components/ChevronUpDown.js +0 -1
- package/dist/Molecular/CustomIcons/components/Close.js +0 -1
- package/dist/Molecular/CustomIcons/components/ColumnsOrder.js +0 -1
- package/dist/Molecular/CustomIcons/components/Delete.js +0 -1
- package/dist/Molecular/CustomIcons/components/Edit.js +0 -1
- package/dist/Molecular/CustomIcons/components/Email.js +0 -1
- package/dist/Molecular/CustomIcons/components/FinturfLogo.js +0 -1
- package/dist/Molecular/CustomIcons/components/FinturfLogo2.js +0 -1
- package/dist/Molecular/CustomIcons/components/Flows.js +0 -1
- package/dist/Molecular/CustomIcons/components/Gift.js +0 -1
- package/dist/Molecular/CustomIcons/components/GoogleAuth.js +0 -1
- package/dist/Molecular/CustomIcons/components/GooglePlay.js +0 -1
- package/dist/Molecular/CustomIcons/components/HelpCircle.js +0 -1
- package/dist/Molecular/CustomIcons/components/HelpCircle2.js +0 -1
- package/dist/Molecular/CustomIcons/components/HelpCircleFilled.js +0 -1
- package/dist/Molecular/CustomIcons/components/Home.js +0 -1
- package/dist/Molecular/CustomIcons/components/Home2.js +0 -1
- package/dist/Molecular/CustomIcons/components/Key.js +0 -1
- package/dist/Molecular/CustomIcons/components/Landers.js +0 -1
- package/dist/Molecular/CustomIcons/components/Lock.js +0 -1
- package/dist/Molecular/CustomIcons/components/Mail.js +0 -1
- package/dist/Molecular/CustomIcons/components/Mastercard.js +0 -1
- package/dist/Molecular/CustomIcons/components/Minus.js +0 -1
- package/dist/Molecular/CustomIcons/components/Offers.js +0 -1
- package/dist/Molecular/CustomIcons/components/Pause.js +0 -1
- package/dist/Molecular/CustomIcons/components/PayPal.js +0 -1
- package/dist/Molecular/CustomIcons/components/PayPalLightLarge.js +0 -1
- package/dist/Molecular/CustomIcons/components/Phone.js +0 -1
- package/dist/Molecular/CustomIcons/components/Play.js +0 -1
- package/dist/Molecular/CustomIcons/components/Plus.js +0 -1
- package/dist/Molecular/CustomIcons/components/Profile.js +0 -1
- package/dist/Molecular/CustomIcons/components/QRCode.js +0 -1
- package/dist/Molecular/CustomIcons/components/Rectangle.js +0 -1
- package/dist/Molecular/CustomIcons/components/Revert.js +0 -1
- package/dist/Molecular/CustomIcons/components/Star.js +0 -1
- package/dist/Molecular/CustomIcons/components/Star2.js +0 -1
- package/dist/Molecular/CustomIcons/components/TrafficSources.js +0 -1
- package/dist/Molecular/CustomIcons/components/Trash.js +0 -1
- package/dist/Molecular/CustomIcons/components/TrashRed.js +0 -1
- package/dist/Molecular/CustomIcons/components/Triggers.js +0 -1
- package/dist/Molecular/CustomIcons/components/User.js +0 -1
- package/dist/Molecular/CustomIcons/components/Visa.js +0 -1
- package/dist/Molecular/CustomIcons/components/X.js +0 -1
- package/dist/Molecular/FormElement/FormElement.js +0 -1
- package/dist/Molecular/FormWithDependOn/FormWithDependOn.js +0 -1
- package/dist/Molecular/InputAddress/InputAddress.js +0 -1
- package/dist/Molecular/InputPassword/InputPassword.js +0 -1
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import cn from 'classnames';
|
|
2
|
+
|
|
3
|
+
import './WidgetWithSwitchableRows.scss';
|
|
4
|
+
|
|
5
|
+
const RC = 'widget-with-switchable-rows';
|
|
6
|
+
|
|
7
|
+
function WidgetWithSwitchableRows(props) {
|
|
8
|
+
const {
|
|
9
|
+
className,
|
|
10
|
+
title,
|
|
11
|
+
rightHeaderContent,
|
|
12
|
+
nullContentData,
|
|
13
|
+
|
|
14
|
+
columns = [],
|
|
15
|
+
rows,
|
|
16
|
+
CellComponent,
|
|
17
|
+
CellComponentProps,
|
|
18
|
+
onChange,
|
|
19
|
+
isNoHeader = false,
|
|
20
|
+
} = props || {};
|
|
21
|
+
|
|
22
|
+
const preperedColumns = [
|
|
23
|
+
{ ...columns[0], key: 'isActive', type: 'switcher' },
|
|
24
|
+
...columns.slice(1),
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<div className={cn(RC, className)}>
|
|
29
|
+
{!isNoHeader && (
|
|
30
|
+
<div className={cn(`${RC}__header`)}>
|
|
31
|
+
<div className={cn(`${RC}__title-block`)}>{title}</div>
|
|
32
|
+
<div className={cn(`${RC}__right-header-content-block`)}>
|
|
33
|
+
{rightHeaderContent}
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
)}
|
|
37
|
+
<div
|
|
38
|
+
className={cn(`${RC}__body`, {
|
|
39
|
+
[`${RC}__body_no-content`]: !rows?.length,
|
|
40
|
+
})}
|
|
41
|
+
>
|
|
42
|
+
{Boolean(rows?.length) && (
|
|
43
|
+
<div className={cn(`${RC}__thead`)}>
|
|
44
|
+
{preperedColumns.map(field => (
|
|
45
|
+
<div
|
|
46
|
+
key={`thead-${field.key}`}
|
|
47
|
+
className={cn(
|
|
48
|
+
`${RC}__thead-cell`,
|
|
49
|
+
field.theadCellClassName,
|
|
50
|
+
field.columnClassName,
|
|
51
|
+
{
|
|
52
|
+
[`${RC}__thead-cell_reqiured`]: field.isRequired,
|
|
53
|
+
},
|
|
54
|
+
)}
|
|
55
|
+
data-key={field.key}
|
|
56
|
+
>
|
|
57
|
+
{field.label}
|
|
58
|
+
</div>
|
|
59
|
+
))}
|
|
60
|
+
</div>
|
|
61
|
+
)}
|
|
62
|
+
|
|
63
|
+
<div className={cn(`${RC}__table`)}>
|
|
64
|
+
{rows?.length
|
|
65
|
+
? (
|
|
66
|
+
rows.map(row => (
|
|
67
|
+
<div
|
|
68
|
+
key={`row-${row.id}`}
|
|
69
|
+
className={cn(`${RC}__row`)}
|
|
70
|
+
data-id={row.id}
|
|
71
|
+
>
|
|
72
|
+
{preperedColumns.map(cell => (
|
|
73
|
+
<div
|
|
74
|
+
key={`row-${row.id}-cell-${cell.key}`}
|
|
75
|
+
className={cn(
|
|
76
|
+
`${RC}__cell`,
|
|
77
|
+
cell.cellClassName,
|
|
78
|
+
cell.columnClassName,
|
|
79
|
+
)}
|
|
80
|
+
>
|
|
81
|
+
<CellComponent
|
|
82
|
+
{...CellComponentProps}
|
|
83
|
+
field={{
|
|
84
|
+
...cell,
|
|
85
|
+
value: row[cell.key],
|
|
86
|
+
rowData: row,
|
|
87
|
+
...(cell.key === 'isActive'
|
|
88
|
+
? {
|
|
89
|
+
disabled: cell.disabled,
|
|
90
|
+
label: row.label,
|
|
91
|
+
isActive: row.isActive,
|
|
92
|
+
}
|
|
93
|
+
: { disabled: !row.isActive, label: cell.label }),
|
|
94
|
+
}}
|
|
95
|
+
onChange={(key, value, propName, innerFieldKey, additional) => onChange({ value, additional, propName, innerFieldKey, key: cell.key || key, rowId: row.id })}
|
|
96
|
+
/>
|
|
97
|
+
</div>
|
|
98
|
+
))}
|
|
99
|
+
</div>
|
|
100
|
+
))
|
|
101
|
+
)
|
|
102
|
+
: (
|
|
103
|
+
<div className={cn(`${RC}__row`)} data-id="empty-row">
|
|
104
|
+
<span className={cn(`${RC}__no-data-content`)}>
|
|
105
|
+
{nullContentData ?? 'No data'}
|
|
106
|
+
</span>
|
|
107
|
+
</div>
|
|
108
|
+
)}
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export default WidgetWithSwitchableRows;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import cn from 'classnames';
|
|
2
|
+
|
|
3
|
+
import { useRef, useState } from 'react';
|
|
4
|
+
import { Bell, ChevronRight, Power } from 'react-feather';
|
|
5
|
+
|
|
6
|
+
import Hint from '../../UI/Hint/Hint';
|
|
7
|
+
|
|
8
|
+
import './Header.scss';
|
|
9
|
+
|
|
10
|
+
function Header({
|
|
11
|
+
className,
|
|
12
|
+
name = 'John',
|
|
13
|
+
surname = 'Silver',
|
|
14
|
+
status = 'admin',
|
|
15
|
+
img = '',
|
|
16
|
+
hintLabel = 'Help',
|
|
17
|
+
hintText = 'Hint text',
|
|
18
|
+
}) {
|
|
19
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
20
|
+
|
|
21
|
+
const userMenu = useRef(null);
|
|
22
|
+
|
|
23
|
+
const handle = {
|
|
24
|
+
toggleMenu: () => {
|
|
25
|
+
if (!isOpen) setIsOpen(!isOpen);
|
|
26
|
+
},
|
|
27
|
+
closeMenu: () => {
|
|
28
|
+
setTimeout(() => setIsOpen(false), 50);
|
|
29
|
+
},
|
|
30
|
+
logout: () => {
|
|
31
|
+
handle.toggleMenu();
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<header className={cn('header', className)}>
|
|
37
|
+
<div className="df">
|
|
38
|
+
<Hint
|
|
39
|
+
side="bottom"
|
|
40
|
+
hint={hintText}
|
|
41
|
+
className="header__hint"
|
|
42
|
+
label={hintLabel}
|
|
43
|
+
iconOutline
|
|
44
|
+
/>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
<div className="j6 user-menu">
|
|
48
|
+
<div onClick={() => {}} className="header--bell">
|
|
49
|
+
<Bell className="header--bell-icon" />
|
|
50
|
+
<div className="header--bell-notification-icon" />
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
<div className="header--user-ava">
|
|
54
|
+
<img src={img} alt="" />
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
<div className="dfc mr10">
|
|
58
|
+
<span className="header--user-name">
|
|
59
|
+
{name}
|
|
60
|
+
{' '}
|
|
61
|
+
{surname}
|
|
62
|
+
</span>
|
|
63
|
+
<span className="header--user-status">{status}</span>
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
<ChevronRight
|
|
67
|
+
onClick={handle.toggleMenu}
|
|
68
|
+
className={cn('accordion--title-chevron', {
|
|
69
|
+
'accordion--title-chevron-open': isOpen,
|
|
70
|
+
})}
|
|
71
|
+
/>
|
|
72
|
+
{isOpen && (
|
|
73
|
+
<div className="user-menu__dropdown" ref={userMenu}>
|
|
74
|
+
<div className="user-menu__item" onClick={handle.logout}>
|
|
75
|
+
<Power className="mr10" />
|
|
76
|
+
{' '}
|
|
77
|
+
Logout
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
)}
|
|
81
|
+
</div>
|
|
82
|
+
</header>
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export default Header;
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import cn from 'classnames';
|
|
2
|
+
|
|
3
|
+
import { useEffect, useState } from 'react';
|
|
4
|
+
import { ArrowDown, ArrowUp, ChevronDown, Tag } from 'react-feather';
|
|
5
|
+
|
|
6
|
+
import MonoAccordion from '../MonoAccordion/MonoAccordion';
|
|
7
|
+
|
|
8
|
+
import './AccordionTable.scss';
|
|
9
|
+
|
|
10
|
+
function AccordionTable({
|
|
11
|
+
className,
|
|
12
|
+
header,
|
|
13
|
+
items,
|
|
14
|
+
onChange,
|
|
15
|
+
testId,
|
|
16
|
+
onSort = () => {},
|
|
17
|
+
sortParams,
|
|
18
|
+
}) {
|
|
19
|
+
const [accordions, setAccordions] = useState(items);
|
|
20
|
+
|
|
21
|
+
const sortedColClassName = item =>
|
|
22
|
+
cn(
|
|
23
|
+
'accordion-table__header-item',
|
|
24
|
+
item.className,
|
|
25
|
+
{
|
|
26
|
+
'accordion-table--sorted-col':
|
|
27
|
+
sortParams && sortParams.key === item.key,
|
|
28
|
+
},
|
|
29
|
+
{ 'accordion-table__header-item-sortable': !item.noSort },
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
const handle = {
|
|
33
|
+
accordionChange: (key, e) => {
|
|
34
|
+
const newArr = accordions?.map((item) => {
|
|
35
|
+
if (item.key === key) {
|
|
36
|
+
return {
|
|
37
|
+
...item,
|
|
38
|
+
isOpen: !item.isOpen,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
return item;
|
|
42
|
+
});
|
|
43
|
+
const isArrowSvg = e?.target?.tagName === 'svg';
|
|
44
|
+
const isAccordionElement
|
|
45
|
+
= e.target.className?.includes?.('accordion-table');
|
|
46
|
+
if (isAccordionElement || isArrowSvg) {
|
|
47
|
+
onChange(newArr);
|
|
48
|
+
setAccordions(newArr);
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
setSort: (key) => {
|
|
53
|
+
let newSorting;
|
|
54
|
+
if (key !== sortParams.key) {
|
|
55
|
+
newSorting = { key, direction: 'DESC' };
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
newSorting = {
|
|
59
|
+
key,
|
|
60
|
+
direction: sortParams.direction === 'ASC' ? 'DESC' : 'ASC',
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
onSort(newSorting);
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const getHeaderItem = (key) => {
|
|
68
|
+
return header?.find(item => item.key === key);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const renderTd = (tr) => {
|
|
72
|
+
return Object.entries(tr)?.map(([key, value]) => {
|
|
73
|
+
return key === 'promoDetails' || key === 'disclosure'
|
|
74
|
+
? null
|
|
75
|
+
: (
|
|
76
|
+
<div
|
|
77
|
+
key={key}
|
|
78
|
+
style={{ flexBasis: `${getHeaderItem(key)?.width}%` }}
|
|
79
|
+
className={cn(
|
|
80
|
+
'accordion-table__td',
|
|
81
|
+
`accordion-table__td--${key}`,
|
|
82
|
+
getHeaderItem(key)?.className,
|
|
83
|
+
)}
|
|
84
|
+
>
|
|
85
|
+
<p
|
|
86
|
+
className="accordion-table__statistics-td-value"
|
|
87
|
+
title={typeof value !== 'object' ? value : value.value}
|
|
88
|
+
>
|
|
89
|
+
{typeof value !== 'object' ? value : value.value}
|
|
90
|
+
</p>
|
|
91
|
+
</div>
|
|
92
|
+
);
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const renderTr = (rows) => {
|
|
97
|
+
return rows?.map((row, index) => {
|
|
98
|
+
return (
|
|
99
|
+
<div
|
|
100
|
+
key={index}
|
|
101
|
+
className={cn(
|
|
102
|
+
'accordion-table__tr',
|
|
103
|
+
{
|
|
104
|
+
'accordion-table__tr-with-promo':
|
|
105
|
+
row.promoDetails || row.cols?.promoDetails,
|
|
106
|
+
},
|
|
107
|
+
row.className,
|
|
108
|
+
)}
|
|
109
|
+
>
|
|
110
|
+
<div className="df w100">{renderTd(row.cols || row)}</div>
|
|
111
|
+
{row.promoDetails || row.cols?.promoDetails
|
|
112
|
+
? (
|
|
113
|
+
<div className="accordion-table__tr-promo-wrapper">
|
|
114
|
+
<div className="accordion-table__tr-promo">
|
|
115
|
+
<Tag className="tr-promo-icon" width={16} height={16} />
|
|
116
|
+
<span className="tr-promo-label">PROMOTION</span>
|
|
117
|
+
{row.promoDetails || row.cols?.promoDetails}
|
|
118
|
+
</div>
|
|
119
|
+
</div>
|
|
120
|
+
)
|
|
121
|
+
: null}
|
|
122
|
+
|
|
123
|
+
{row.disclosure || row.cols?.disclosure
|
|
124
|
+
? (
|
|
125
|
+
<div className="accordion-table__tr-promo-wrapper">
|
|
126
|
+
<div className="accordion-table__tr-promo accordion-table__tr-promo-disclosure">
|
|
127
|
+
{row.disclosure || row.cols?.disclosure}
|
|
128
|
+
</div>
|
|
129
|
+
</div>
|
|
130
|
+
)
|
|
131
|
+
: null}
|
|
132
|
+
</div>
|
|
133
|
+
);
|
|
134
|
+
});
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
const defineAccordionTitle = (row) => {
|
|
138
|
+
return (
|
|
139
|
+
<div
|
|
140
|
+
onClick={e => handle.accordionChange(row.key, e)}
|
|
141
|
+
className="accordion-table__accordion-label-box"
|
|
142
|
+
>
|
|
143
|
+
<div className="accordion-table__accordion-label-wrapper j4">
|
|
144
|
+
<ChevronDown
|
|
145
|
+
width={8}
|
|
146
|
+
height={4}
|
|
147
|
+
className={cn('accordion-label-box__icon', {
|
|
148
|
+
'accordion-label-box__icon--open': row.isOpen,
|
|
149
|
+
})}
|
|
150
|
+
/>
|
|
151
|
+
<span className="accordion-label-box__label">{row.label}</span>
|
|
152
|
+
{row.statistics && (
|
|
153
|
+
<div className={cn('accordion-table__tr', row.className)}>
|
|
154
|
+
{Object.entries(row.statistics).map(([key, value]) => {
|
|
155
|
+
return (
|
|
156
|
+
<div
|
|
157
|
+
key={key}
|
|
158
|
+
style={{ width: `${getHeaderItem(key)?.width}%` }}
|
|
159
|
+
className={cn(
|
|
160
|
+
'accordion-table__statistics-td',
|
|
161
|
+
getHeaderItem(key)?.className,
|
|
162
|
+
)}
|
|
163
|
+
>
|
|
164
|
+
<div className="accordion-table__statistics-td-value-wrapper">
|
|
165
|
+
{key === 'status'
|
|
166
|
+
? (
|
|
167
|
+
<div className="accordion-table__statistics-td-value">
|
|
168
|
+
{value}
|
|
169
|
+
</div>
|
|
170
|
+
)
|
|
171
|
+
: (
|
|
172
|
+
<p
|
|
173
|
+
className="accordion-table__statistics-td-value"
|
|
174
|
+
title={value}
|
|
175
|
+
>
|
|
176
|
+
{value}
|
|
177
|
+
</p>
|
|
178
|
+
)}
|
|
179
|
+
</div>
|
|
180
|
+
</div>
|
|
181
|
+
);
|
|
182
|
+
})}
|
|
183
|
+
</div>
|
|
184
|
+
)}
|
|
185
|
+
</div>
|
|
186
|
+
|
|
187
|
+
{row.titleContent}
|
|
188
|
+
</div>
|
|
189
|
+
);
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
useEffect(() => {
|
|
193
|
+
setAccordions(items);
|
|
194
|
+
}, [items]);
|
|
195
|
+
|
|
196
|
+
return (
|
|
197
|
+
<div className={cn('accordion-table', className)}>
|
|
198
|
+
<div className="accordion-table__header">
|
|
199
|
+
{header?.map((item) => {
|
|
200
|
+
return (
|
|
201
|
+
<div
|
|
202
|
+
style={{ flexBasis: `${item.width}%` }}
|
|
203
|
+
key={item.key}
|
|
204
|
+
className={sortedColClassName(item)}
|
|
205
|
+
onClick={() => !item.noSort && handle.setSort(item.key)}
|
|
206
|
+
>
|
|
207
|
+
{sortParams
|
|
208
|
+
&& item.key === sortParams.key
|
|
209
|
+
&& sortParams.key !== 'actions'
|
|
210
|
+
&& (sortParams.direction === 'DESC'
|
|
211
|
+
? (
|
|
212
|
+
<ArrowDown size={16} />
|
|
213
|
+
)
|
|
214
|
+
: (
|
|
215
|
+
<ArrowUp size={16} />
|
|
216
|
+
))}
|
|
217
|
+
|
|
218
|
+
{item.label}
|
|
219
|
+
</div>
|
|
220
|
+
);
|
|
221
|
+
})}
|
|
222
|
+
</div>
|
|
223
|
+
|
|
224
|
+
<div className="accordion-table__body">
|
|
225
|
+
{accordions?.map((accordion) => {
|
|
226
|
+
return (
|
|
227
|
+
<MonoAccordion
|
|
228
|
+
testId={testId}
|
|
229
|
+
key={accordion.key}
|
|
230
|
+
onClick={e => handle.accordionChange(accordion.key, e)}
|
|
231
|
+
isOpen={accordion.isOpen}
|
|
232
|
+
className={cn(
|
|
233
|
+
'accordion-table__body-accordion',
|
|
234
|
+
{
|
|
235
|
+
'accordion-table__body-accordion--closed': !accordion.isOpen,
|
|
236
|
+
},
|
|
237
|
+
accordion.className,
|
|
238
|
+
)}
|
|
239
|
+
titleJSX={defineAccordionTitle(accordion)}
|
|
240
|
+
>
|
|
241
|
+
{accordion.children ?? renderTr(accordion.rows)}
|
|
242
|
+
</MonoAccordion>
|
|
243
|
+
);
|
|
244
|
+
})}
|
|
245
|
+
</div>
|
|
246
|
+
</div>
|
|
247
|
+
);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
export default AccordionTable;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import cn from 'classnames';
|
|
2
|
+
import { useEffect, useRef, useState } from 'react';
|
|
3
|
+
import { ChevronDown, ChevronUp } from 'react-feather';
|
|
4
|
+
import './AccordionText.scss';
|
|
5
|
+
|
|
6
|
+
const defaultText = `Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.`;
|
|
7
|
+
|
|
8
|
+
function AccordionText({
|
|
9
|
+
isDefaultOpen = false,
|
|
10
|
+
isOuterOpen = false,
|
|
11
|
+
className,
|
|
12
|
+
text = defaultText,
|
|
13
|
+
shortText = null,
|
|
14
|
+
}) {
|
|
15
|
+
const bodyRef = useRef(null);
|
|
16
|
+
const [isOpen, setIsOpen] = useState(isDefaultOpen);
|
|
17
|
+
const [isNeedTrimText, setIsNeedTrimText] = useState(false);
|
|
18
|
+
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
setIsOpen(isOuterOpen);
|
|
21
|
+
}, [isOuterOpen]);
|
|
22
|
+
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
const checkEllipsis = () => {
|
|
25
|
+
if (bodyRef.current) {
|
|
26
|
+
setIsNeedTrimText(bodyRef.current.scrollWidth > bodyRef.current.clientWidth);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
31
|
+
checkEllipsis();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
if (bodyRef.current) {
|
|
35
|
+
resizeObserver.observe(bodyRef.current);
|
|
36
|
+
checkEllipsis();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return () => {
|
|
40
|
+
if (bodyRef.current) {
|
|
41
|
+
resizeObserver.unobserve(bodyRef.current);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
}, [text]);
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<div
|
|
48
|
+
className={cn('accordion-text', className, {
|
|
49
|
+
'accordion-text--open': isOpen,
|
|
50
|
+
})}
|
|
51
|
+
onClick={() => setIsOpen(prevIsOpen => !prevIsOpen)}
|
|
52
|
+
>
|
|
53
|
+
<div
|
|
54
|
+
className={cn('accordion-text__body', {
|
|
55
|
+
'accordion-text__body--trim-text': isNeedTrimText && !isOpen,
|
|
56
|
+
})}
|
|
57
|
+
ref={bodyRef}
|
|
58
|
+
>
|
|
59
|
+
{shortText ? (isOpen ? text : shortText) : text}
|
|
60
|
+
</div>
|
|
61
|
+
<div className="accordion-text__toggle">
|
|
62
|
+
{isOpen ? <ChevronUp /> : <ChevronDown />}
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export default AccordionText;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import cn from 'classnames';
|
|
2
|
+
|
|
3
|
+
import { useEffect, useRef, useState } from 'react';
|
|
4
|
+
|
|
5
|
+
import { getStyles } from '../../../Functions/utils';
|
|
6
|
+
|
|
7
|
+
import './Arrow.scss';
|
|
8
|
+
|
|
9
|
+
function Arrow({ type, className, onClick, disabled, testId, isAlt }) {
|
|
10
|
+
if (!type || (type !== 'left' && type !== 'right')) return null;
|
|
11
|
+
const ref = useRef();
|
|
12
|
+
const [color, setColor] = useState('currentColor');
|
|
13
|
+
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
if (ref.current) {
|
|
16
|
+
setColor(getStyles(ref.current, 'color'));
|
|
17
|
+
}
|
|
18
|
+
}, [ref.current]);
|
|
19
|
+
|
|
20
|
+
function renderSVG() {
|
|
21
|
+
if (type === 'left') {
|
|
22
|
+
if (isAlt) {
|
|
23
|
+
return (
|
|
24
|
+
<svg
|
|
25
|
+
data-testid={testId}
|
|
26
|
+
version="1.1"
|
|
27
|
+
id="Layer_1"
|
|
28
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
29
|
+
width="16"
|
|
30
|
+
height="16"
|
|
31
|
+
viewBox="0 0 16 16"
|
|
32
|
+
>
|
|
33
|
+
<path
|
|
34
|
+
d="M12.7,8H3.3"
|
|
35
|
+
stroke={color}
|
|
36
|
+
fill="none"
|
|
37
|
+
strokeWidth={1.3333}
|
|
38
|
+
strokeLinecap="round"
|
|
39
|
+
strokeLinejoin="round"
|
|
40
|
+
/>
|
|
41
|
+
<path
|
|
42
|
+
d="M8,3.3L3.3,8L8,12.7"
|
|
43
|
+
stroke={color}
|
|
44
|
+
fill="none"
|
|
45
|
+
strokeWidth={1.3333}
|
|
46
|
+
strokeLinecap="round"
|
|
47
|
+
strokeLinejoin="round"
|
|
48
|
+
/>
|
|
49
|
+
</svg>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
return (
|
|
53
|
+
<svg
|
|
54
|
+
data-testid={testId}
|
|
55
|
+
width="24"
|
|
56
|
+
height="24"
|
|
57
|
+
viewBox="0 0 24 24"
|
|
58
|
+
fill="none"
|
|
59
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
60
|
+
>
|
|
61
|
+
<path
|
|
62
|
+
d="M15 18L9 12L15 6"
|
|
63
|
+
stroke={color}
|
|
64
|
+
strokeWidth="2"
|
|
65
|
+
strokeLinecap="round"
|
|
66
|
+
strokeLinejoin="round"
|
|
67
|
+
/>
|
|
68
|
+
</svg>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
if (isAlt) {
|
|
72
|
+
return (
|
|
73
|
+
<svg
|
|
74
|
+
data-testid={testId}
|
|
75
|
+
id="Layer_1"
|
|
76
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
77
|
+
width="16"
|
|
78
|
+
height="16"
|
|
79
|
+
viewBox="0 0 16 16"
|
|
80
|
+
>
|
|
81
|
+
<path
|
|
82
|
+
d="M3.3,8h9.3"
|
|
83
|
+
stroke={color}
|
|
84
|
+
fill="none"
|
|
85
|
+
strokeWidth={1.3333}
|
|
86
|
+
strokeLinecap="round"
|
|
87
|
+
strokeLinejoin="round"
|
|
88
|
+
/>
|
|
89
|
+
<path
|
|
90
|
+
d="M8,3.3L12.7,8L8,12.7"
|
|
91
|
+
stroke={color}
|
|
92
|
+
fill="none"
|
|
93
|
+
strokeWidth={1.3333}
|
|
94
|
+
strokeLinecap="round"
|
|
95
|
+
strokeLinejoin="round"
|
|
96
|
+
/>
|
|
97
|
+
</svg>
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
return (
|
|
101
|
+
<svg
|
|
102
|
+
data-testid={testId}
|
|
103
|
+
width="24"
|
|
104
|
+
height="24"
|
|
105
|
+
viewBox="0 0 24 24"
|
|
106
|
+
fill="none"
|
|
107
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
108
|
+
>
|
|
109
|
+
<path
|
|
110
|
+
d="M9 18L15 12L9 6"
|
|
111
|
+
stroke="currentColor"
|
|
112
|
+
strokeWidth="2"
|
|
113
|
+
strokeLinecap="round"
|
|
114
|
+
strokeLinejoin="round"
|
|
115
|
+
/>
|
|
116
|
+
</svg>
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return (
|
|
121
|
+
<div
|
|
122
|
+
data-testid={`arrow--key-${testId}--type-${type}`}
|
|
123
|
+
ref={ref}
|
|
124
|
+
className={cn('arrow', `arrow_${type}`, className, {
|
|
125
|
+
arrow_disabled: disabled,
|
|
126
|
+
})}
|
|
127
|
+
onClick={onClick}
|
|
128
|
+
>
|
|
129
|
+
{renderSVG()}
|
|
130
|
+
</div>
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export default Arrow;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import cn from 'classnames';
|
|
2
|
+
|
|
3
|
+
// global
|
|
4
|
+
|
|
5
|
+
// styles
|
|
6
|
+
import './Box.scss';
|
|
7
|
+
|
|
8
|
+
const directionVariants = {
|
|
9
|
+
column: 'column',
|
|
10
|
+
row: 'row',
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const sizes = {
|
|
14
|
+
none: 'none',
|
|
15
|
+
xs: 'xs',
|
|
16
|
+
s: 's',
|
|
17
|
+
m: 'm',
|
|
18
|
+
l: 'l',
|
|
19
|
+
xl: 'xl',
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
function Box({
|
|
23
|
+
children,
|
|
24
|
+
paddingVariant = sizes.m,
|
|
25
|
+
radiiVariant = sizes.s,
|
|
26
|
+
direction = directionVariants.column,
|
|
27
|
+
className,
|
|
28
|
+
...restProps
|
|
29
|
+
}) {
|
|
30
|
+
const styles = {
|
|
31
|
+
flexDirection: direction,
|
|
32
|
+
};
|
|
33
|
+
return (
|
|
34
|
+
<div
|
|
35
|
+
style={styles}
|
|
36
|
+
className={cn(
|
|
37
|
+
'box',
|
|
38
|
+
`box--padding-${paddingVariant}`,
|
|
39
|
+
`box--radii-${radiiVariant}`,
|
|
40
|
+
className,
|
|
41
|
+
{
|
|
42
|
+
'df': direction === directionVariants.row,
|
|
43
|
+
'dfc-jc': direction === directionVariants.column,
|
|
44
|
+
},
|
|
45
|
+
)}
|
|
46
|
+
{...restProps}
|
|
47
|
+
>
|
|
48
|
+
{children}
|
|
49
|
+
</div>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export default Box;
|