intelicoreact 1.8.6 → 1.8.7
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 +1 -18
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN_old.jsx +1 -121
- package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.jsx +1 -507
- package/dist/Atomic/FormElements/MultiSelect/MultiSelect.jsx +1 -46
- package/dist/Atomic/FormElements/NumericInput/NumericInput.jsx +1 -337
- package/dist/Atomic/FormElements/RadioGroup/RadioGroup.jsx +1 -66
- package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.jsx +1 -78
- package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.jsx +1 -54
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.jsx +1 -183
- package/dist/Atomic/FormElements/RangeList/RangeList.jsx +1 -181
- package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.jsx +1 -41
- package/dist/Atomic/FormElements/RangeSlider/RangeSlider.jsx +1 -449
- package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.jsx +1 -865
- package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.jsx +1 -37
- package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.jsx +1 -48
- package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.jsx +1 -62
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.jsx +1 -175
- package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.jsx +1 -65
- package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.jsx +1 -118
- package/dist/Atomic/FormElements/Text/Text.jsx +1 -126
- package/dist/Atomic/FormElements/Textarea/Textarea.jsx +1 -61
- package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.jsx +1 -181
- package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.jsx +1 -60
- package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.jsx +1 -83
- package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.jsx +1 -80
- package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.jsx +1 -103
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.jsx +1 -115
- package/dist/Atomic/Layout/Header/Header.jsx +1 -86
- package/dist/Atomic/Layout/MainMenu/MainMenu.jsx +1 -164
- package/dist/Atomic/UI/AccordionTable/AccordionTable.jsx +1 -250
- package/dist/Atomic/UI/AccordionText/AccordionText.jsx +1 -68
- package/dist/Atomic/UI/Arrow/Arrow.jsx +1 -134
- package/dist/Atomic/UI/Box/Box.jsx +1 -53
- package/dist/Atomic/UI/Chart/Chart.jsx +1 -178
- package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.jsx +1 -78
- package/dist/Atomic/UI/Chart/partial/optionsConstructor.jsx +1 -334
- package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.jsx +1 -111
- package/dist/Atomic/UI/DateTime/DateTime.jsx +1 -57
- package/dist/Atomic/UI/DebugContainer/DebugContainer.jsx +1 -44
- package/dist/Atomic/UI/DebugContainer/useDebugContainer.jsx +1 -15
- package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.jsx +1 -223
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion._test.jsx +1 -75
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.jsx +1 -86
- package/dist/Atomic/UI/PieChart/PieChart.jsx +1 -41
- package/dist/Atomic/UI/Table/Partials/TdCell.jsx +1 -87
- package/dist/Atomic/UI/Table/Partials/TdHeader.jsx +1 -36
- package/dist/Atomic/UI/Table/Partials/TdRow.jsx +1 -103
- package/dist/Atomic/UI/Table/Partials/TdTitle.jsx +1 -55
- package/dist/Atomic/UI/Table/Table.jsx +1 -63
- package/dist/Atomic/UI/Table/TdTypes/TdActions.jsx +1 -80
- package/dist/Atomic/UI/Table/TdTypes/TdPriority.jsx +1 -26
- package/dist/Atomic/UI/Table/TdTypes/TdRange.jsx +1 -13
- package/dist/Atomic/UI/Table/TdTypes/TdWeight.jsx +1 -56
- package/dist/Atomic/UI/TagList/TagList.jsx +1 -256
- package/dist/Atomic/UI/WizardStepper/constructor.jsx +1 -86
- package/dist/Classes/RESTAPI/partials/CredentialsProcessing.jsx +1 -254
- package/dist/Functions/customEventListener.jsx +1 -96
- package/dist/Functions/operations.jsx +1 -138
- package/dist/Functions/useFormTools/functions/RenderFields.jsx +1 -108
- package/dist/Functions/useFormTools/index.jsx +1 -777
- package/dist/Functions/usePasswordChecker.jsx +1 -128
- package/dist/Functions/utils.jsx +1 -492
- package/dist/Molecular/CustomIcons/components/AffiliateNetworks.jsx +1 -22
- package/dist/Molecular/CustomIcons/components/AlertCircle.jsx +1 -24
- package/dist/Molecular/CustomIcons/components/AppStore.jsx +1 -30
- package/dist/Molecular/CustomIcons/components/Arrow.jsx +1 -33
- package/dist/Molecular/CustomIcons/components/ArrowDown.jsx +1 -18
- package/dist/Molecular/CustomIcons/components/ArrowLeft.jsx +1 -23
- package/dist/Molecular/CustomIcons/components/ArrowRight.jsx +1 -23
- package/dist/Molecular/CustomIcons/components/ArrowUp.jsx +1 -18
- package/dist/Molecular/CustomIcons/components/Bell.jsx +1 -16
- package/dist/Molecular/CustomIcons/components/Button.jsx +1 -13
- package/dist/Molecular/CustomIcons/components/Campaigns.jsx +1 -17
- package/dist/Molecular/CustomIcons/components/Check.jsx +1 -15
- package/dist/Molecular/CustomIcons/components/Check2.jsx +1 -13
- package/dist/Molecular/CustomIcons/components/ChevronDown.jsx +1 -13
- package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.jsx +1 -12
- package/dist/Molecular/CustomIcons/components/ChevronLeft.jsx +1 -12
- package/dist/Molecular/CustomIcons/components/ChevronRight.jsx +1 -12
- package/dist/Molecular/CustomIcons/components/ChevronUp.jsx +1 -12
- package/dist/Molecular/CustomIcons/components/ChevronUpDown.jsx +1 -28
- package/dist/Molecular/CustomIcons/components/Close.jsx +1 -15
- package/dist/Molecular/CustomIcons/components/ColumnsOrder.jsx +1 -18
- package/dist/Molecular/CustomIcons/components/Delete.jsx +1 -17
- package/dist/Molecular/CustomIcons/components/Edit.jsx +1 -16
- package/dist/Molecular/CustomIcons/components/Email.jsx +1 -32
- package/dist/Molecular/CustomIcons/components/FinturfLogo.jsx +1 -19
- package/dist/Molecular/CustomIcons/components/FinturfLogo2.jsx +1 -36
- package/dist/Molecular/CustomIcons/components/Flows.jsx +1 -16
- package/dist/Molecular/CustomIcons/components/Gift.jsx +1 -26
- package/dist/Molecular/CustomIcons/components/GoogleAuth.jsx +1 -30
- package/dist/Molecular/CustomIcons/components/GooglePlay.jsx +1 -30
- package/dist/Molecular/CustomIcons/components/HelpCircle.jsx +1 -20
- package/dist/Molecular/CustomIcons/components/HelpCircle2.jsx +1 -21
- package/dist/Molecular/CustomIcons/components/HelpCircleFilled.jsx +1 -20
- package/dist/Molecular/CustomIcons/components/Home.jsx +1 -17
- package/dist/Molecular/CustomIcons/components/Home2.jsx +1 -23
- package/dist/Molecular/CustomIcons/components/Key.jsx +1 -24
- package/dist/Molecular/CustomIcons/components/Landers.jsx +1 -21
- package/dist/Molecular/CustomIcons/components/Lock.jsx +1 -16
- package/dist/Molecular/CustomIcons/components/Mail.jsx +1 -27
- package/dist/Molecular/CustomIcons/components/Mastercard.jsx +1 -74
- package/dist/Molecular/CustomIcons/components/Minus.jsx +1 -26
- package/dist/Molecular/CustomIcons/components/Offers.jsx +1 -17
- package/dist/Molecular/CustomIcons/components/Pause.jsx +1 -29
- package/dist/Molecular/CustomIcons/components/PayPal.jsx +1 -42
- package/dist/Molecular/CustomIcons/components/PayPalLightLarge.jsx +1 -29
- package/dist/Molecular/CustomIcons/components/Phone.jsx +1 -31
- package/dist/Molecular/CustomIcons/components/Play.jsx +1 -26
- package/dist/Molecular/CustomIcons/components/Plus.jsx +1 -26
- package/dist/Molecular/CustomIcons/components/Profile.jsx +1 -17
- package/dist/Molecular/CustomIcons/components/QRCode.jsx +1 -30
- package/dist/Molecular/CustomIcons/components/Rectangle.jsx +1 -13
- package/dist/Molecular/CustomIcons/components/Revert.jsx +1 -14
- package/dist/Molecular/CustomIcons/components/Star.jsx +1 -15
- package/dist/Molecular/CustomIcons/components/Star2.jsx +1 -17
- package/dist/Molecular/CustomIcons/components/TrafficSources.jsx +1 -15
- package/dist/Molecular/CustomIcons/components/Trash.jsx +1 -16
- package/dist/Molecular/CustomIcons/components/TrashRed.jsx +1 -16
- package/dist/Molecular/CustomIcons/components/Triggers.jsx +1 -16
- package/dist/Molecular/CustomIcons/components/User.jsx +1 -26
- package/dist/Molecular/CustomIcons/components/Visa.jsx +1 -32
- package/dist/Molecular/CustomIcons/components/X.jsx +1 -13
- package/dist/Molecular/FormElement/FormElement.jsx +1 -52
- package/dist/Molecular/FormWithDependOn/FormWithDependOn.jsx +1 -161
- package/dist/Molecular/InputAddress/InputAddress.jsx +1 -641
- package/dist/Molecular/InputPassword/InputPassword.jsx +1 -50
- package/package.json +1 -1
- package/dist/Atomic/FormElements/RangeInputs/RangeInputs.d.ts +0 -5
- package/dist/Atomic/FormElements/RangeInputs/RangeInputs.js.map +0 -1
- /package/dist/Atomic/FormElements/ActionAlert/{ActionAlert.js → ActionAlert.jsx} +0 -0
- /package/dist/Atomic/FormElements/AdvancedStatus/{AdvancedStatus.js → AdvancedStatus.jsx} +0 -0
- /package/dist/Atomic/FormElements/Calendar/{Calendar.js → Calendar.jsx} +0 -0
- /package/dist/Atomic/FormElements/Calendar/{Calendar.props.js → Calendar.props.jsx} +0 -0
- /package/dist/Atomic/FormElements/CheckboxInput/{CheckboxInput.js → CheckboxInput.jsx} +0 -0
- /package/dist/Atomic/FormElements/CheckboxesLine/{CheckboxesLine.js → CheckboxesLine.jsx} +0 -0
- /package/dist/Atomic/FormElements/Datepicker/{Datepicker.js → Datepicker.jsx} +0 -0
- /package/dist/Atomic/FormElements/Datepicker/{Datepicker.props.js → Datepicker.props.jsx} +0 -0
- /package/dist/Atomic/FormElements/Datepicker/components/{DatepickerCalendar.js → DatepickerCalendar.jsx} +0 -0
- /package/dist/Atomic/FormElements/Datepicker/components/{DatepickerCalendar.props.js → DatepickerCalendar.props.jsx} +0 -0
- /package/dist/Atomic/FormElements/Dropdown/{Dropdown.js → Dropdown.jsx} +0 -0
- /package/dist/Atomic/FormElements/DropdownLiveSearch/{DropdownLiveSearch.js → DropdownLiveSearch.jsx} +0 -0
- /package/dist/Atomic/FormElements/FileLoader/{FileLoader.js → FileLoader.jsx} +0 -0
- /package/dist/Atomic/FormElements/FileLoader/partial/{LoadZone.js → LoadZone.jsx} +0 -0
- /package/dist/Atomic/FormElements/FileLoader/partial/{LoadedContent.js → LoadedContent.jsx} +0 -0
- /package/dist/Atomic/FormElements/FileLoaderDescription/{FileLoaderDescription.js → FileLoaderDescription.jsx} +0 -0
- /package/dist/Atomic/FormElements/FileLoaderLocal/{FileLoaderLocal.js → FileLoaderLocal.jsx} +0 -0
- /package/dist/Atomic/FormElements/FileLoaderLocalGroup/{FileLoaderLocalGroup.js → FileLoaderLocalGroup.jsx} +0 -0
- /package/dist/Atomic/FormElements/FormattedRawSSN/{FormattedRawSSN.js → FormattedRawSSN.jsx} +0 -0
- /package/dist/Atomic/FormElements/Input/{Input.js → Input.jsx} +0 -0
- /package/dist/Atomic/FormElements/Input/hooks/{useErrorBlink.js → useErrorBlink.jsx} +0 -0
- /package/dist/Atomic/FormElements/Input/hooks/{useInputFocus.js → useInputFocus.jsx} +0 -0
- /package/dist/Atomic/FormElements/Input/hooks/{useInputHover.js → useInputHover.jsx} +0 -0
- /package/dist/Atomic/FormElements/Input/hooks/{useInputValueProcessing.js → useInputValueProcessing.jsx} +0 -0
- /package/dist/Atomic/FormElements/Input/hooks/{useKeyboardHandling.js → useKeyboardHandling.jsx} +0 -0
- /package/dist/Atomic/FormElements/Input/lib/{autocomplete.js → autocomplete.jsx} +0 -0
- /package/dist/Atomic/FormElements/Input/{types.js → types.jsx} +0 -0
- /package/dist/Atomic/FormElements/InputCalendar/{InputCalendar.js → InputCalendar.jsx} +0 -0
- /package/dist/Atomic/FormElements/InputColor/{InputColor.js → InputColor.jsx} +0 -0
- /package/dist/Atomic/FormElements/InputCurrency/{InputCurrency.js → InputCurrency.jsx} +0 -0
- /package/dist/Atomic/FormElements/InputDateRange/{InputDateRange.js → InputDateRange.jsx} +0 -0
- /package/dist/Atomic/FormElements/InputDateRange/components/{DateInput.js → DateInput.jsx} +0 -0
- /package/dist/Atomic/FormElements/InputDateRange/components/{Datepicker.js → Datepicker.jsx} +0 -0
- /package/dist/Atomic/FormElements/InputDateRange/components/{OpenedPart.js → OpenedPart.jsx} +0 -0
- /package/dist/Atomic/FormElements/InputDateRange/components/{SelectItem.js → SelectItem.jsx} +0 -0
- /package/dist/Atomic/FormElements/InputDateRange/{dependencies.js → dependencies.jsx} +0 -0
- /package/dist/Atomic/FormElements/InputLink/{InputLink.js → InputLink.jsx} +0 -0
- /package/dist/Atomic/FormElements/InputMask/{InputMask.js → InputMask.jsx} +0 -0
- /package/dist/Atomic/FormElements/InputMask3/{InputMask3.js → InputMask3.jsx} +0 -0
- /package/dist/Atomic/FormElements/InputMask3/{config.js → config.jsx} +0 -0
- /package/dist/Atomic/FormElements/InputMask3/{functions.js → functions.jsx} +0 -0
- /package/dist/Atomic/FormElements/InputWithAction/{InputWithAction.js → InputWithAction.jsx} +0 -0
- /package/dist/Atomic/FormElements/InputsRow/{InputsRow.js → InputsRow.jsx} +0 -0
- /package/dist/Atomic/FormElements/Label/{Label.js → Label.jsx} +0 -0
- /package/dist/Atomic/FormElements/RadioInput/{RadioInput.js → RadioInput.jsx} +0 -0
- /package/dist/Atomic/FormElements/RangeInputs/{RangeInputs.js → RangeInputs.jsx} +0 -0
- /package/dist/Atomic/FormElements/Switcher/{Switcher.js → Switcher.jsx} +0 -0
- /package/dist/Atomic/FormElements/SwitcherHide/{SwitcherHide.js → SwitcherHide.jsx} +0 -0
- /package/dist/Atomic/FormElements/SwitcherRadio/{SwitcherRadio.js → SwitcherRadio.jsx} +0 -0
- /package/dist/Atomic/FormElements/SwitcherRange/{SwitcherRange.js → SwitcherRange.jsx} +0 -0
- /package/dist/Atomic/FormElements/TagsDropdown/{TagsDropdown.js → TagsDropdown.jsx} +0 -0
- /package/dist/Atomic/FormElements/TextSwitcher/{TextSwitcher.js → TextSwitcher.jsx} +0 -0
- /package/dist/Atomic/FormElements/TimeRange/{TimeRange.js → TimeRange.jsx} +0 -0
- /package/dist/Atomic/FormElements/UserContacts/{UserContacts.js → UserContacts.jsx} +0 -0
- /package/dist/Atomic/Layout/Spinner/{Spinner.js → Spinner.jsx} +0 -0
- /package/dist/Atomic/UI/Accordion/{Accordion.js → Accordion.jsx} +0 -0
- /package/dist/Atomic/UI/Accordion/{AccordionItem.js → AccordionItem.jsx} +0 -0
- /package/dist/Atomic/UI/AdvancedTag/{AdvTag.js → AdvTag.jsx} +0 -0
- /package/dist/Atomic/UI/AdvancedTag/{AdvancedTags.js → AdvancedTags.jsx} +0 -0
- /package/dist/Atomic/UI/Alert/{Alert.js → Alert.jsx} +0 -0
- /package/dist/Atomic/UI/Button/{Button.js → Button.jsx} +0 -0
- /package/dist/Atomic/UI/ButtonsBar/{ButtonsBar.js → ButtonsBar.jsx} +0 -0
- /package/dist/Atomic/UI/DoubleString/{DoubleString.js → DoubleString.jsx} +0 -0
- /package/dist/Atomic/UI/DynamicIcon/{DynamicIcon.js → DynamicIcon.jsx} +0 -0
- /package/dist/Atomic/UI/Hint/{Hint.js → Hint.jsx} +0 -0
- /package/dist/Atomic/UI/Hint/partials/{_constants.js → _constants.jsx} +0 -0
- /package/dist/Atomic/UI/Hint/partials/{_utils.js → _utils.jsx} +0 -0
- /package/dist/Atomic/UI/Modal/{Modal.js → Modal.jsx} +0 -0
- /package/dist/Atomic/UI/Modal/{ModalHOC.js → ModalHOC.jsx} +0 -0
- /package/dist/Atomic/UI/Modal/partials/{ModalFooter.js → ModalFooter.jsx} +0 -0
- /package/dist/Atomic/UI/Modal/partials/{ModalTitle.js → ModalTitle.jsx} +0 -0
- /package/dist/Atomic/UI/Modal/partials/{_constants.js → _constants.jsx} +0 -0
- /package/dist/Atomic/UI/Modal/partials/{_utils.js → _utils.jsx} +0 -0
- /package/dist/Atomic/UI/Modal/partials/{useMobileModal.js → useMobileModal.jsx} +0 -0
- /package/dist/Atomic/UI/NavLine/{NavLine.js → NavLine.jsx} +0 -0
- /package/dist/Atomic/UI/PageTitle/{PageTitle.js → PageTitle.jsx} +0 -0
- /package/dist/Atomic/UI/Price/{Price.js → Price.jsx} +0 -0
- /package/dist/Atomic/UI/PriceRange/{PriceRange.js → PriceRange.jsx} +0 -0
- /package/dist/Atomic/UI/ProgressLine/{ProgressLine.js → ProgressLine.jsx} +0 -0
- /package/dist/Atomic/UI/Status/{Status.js → Status.jsx} +0 -0
- /package/dist/Atomic/UI/Tag/{Tag.js → Tag.jsx} +0 -0
- /package/dist/Atomic/UI/UserBox/{UserBox.js → UserBox.jsx} +0 -0
- /package/dist/Atomic/UI/WizardStepper/ui/StateIcon/{StateIcon.js → StateIcon.jsx} +0 -0
- /package/dist/Atomic/UI/WizardStepper/ui/StepRow/{StepRow.js → StepRow.jsx} +0 -0
- /package/dist/Atomic/UI/WizardStepper/ui/StepWrapper/{StepWrapper.js → StepWrapper.jsx} +0 -0
- /package/dist/Atomic/UI/WizardStepper/ui/{icons.js → icons.jsx} +0 -0
- /package/dist/Functions/guards/{assertions.js → assertions.jsx} +0 -0
- /package/dist/Functions/guards/{safeValue.js → safeValue.jsx} +0 -0
- /package/dist/Functions/guards/{typeGuards.js → typeGuards.jsx} +0 -0
- /package/dist/Functions/useIsMobile/{useIsMobile.js → useIsMobile.jsx} +0 -0
- /package/dist/Functions/useKeyPress/{useHandleKeyPress.js → useHandleKeyPress.jsx} +0 -0
- /package/dist/Functions/useKeyPress/{useKeyPress.js → useKeyPress.jsx} +0 -0
- /package/dist/Functions/utils/{disableDefaultBehavior.js → disableDefaultBehavior.jsx} +0 -0
- /package/dist/Functions/utils/{getLimitedMask.js → getLimitedMask.jsx} +0 -0
- /package/dist/types/declaration/TWithEventManagementAsObj/innerTypes/{Modal.js → Modal.jsx} +0 -0
|
@@ -1,68 +1 @@
|
|
|
1
|
-
import
|
|
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;
|
|
1
|
+
function t(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}function r(r,e){return function(t){if(Array.isArray(t))return t}(r)||function(t,r){var e,n,o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=o){var i=[],a=!0,c=!1;try{for(o=o.call(t);!(a=(e=o.next()).done)&&(i.push(e.value),!r||i.length!==r);a=!0);}catch(t){c=!0,n=t}finally{try{a||null==o.return||o.return()}finally{if(c)throw n}}return i}}(r,e)||function(r,e){if(r){if("string"==typeof r)return t(r,e);var n=Object.prototype.toString.call(r).slice(8,-1);if("Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return t(r,e)}}(r,e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}import{jsx as e,jsxs as n}from"react/jsx-runtime";import o from"classnames";import{useEffect as i,useRef as a,useState as c}from"react";import{ChevronDown as u,ChevronUp as l}from"react-feather";import"./AccordionText.scss";export default function(t){var s=t.isDefaultOpen,d=t.isOuterOpen,m=void 0!==d&&d,f=t.className,p=t.text,v=void 0===p?"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.":p,y=t.shortText,b=void 0===y?null:y,h=a(null),x=r(c(void 0!==s&&s),2),g=x[0],A=x[1],j=r(c(!1),2),O=j[0],S=j[1];return i(function(){A(m)},[m]),i(function(){var t=function(){h.current&&S(h.current.scrollWidth>h.current.clientWidth)},r=new ResizeObserver(function(){t()});return h.current&&(r.observe(h.current),t()),function(){h.current&&r.unobserve(h.current)}},[v]),n("div",{className:o("accordion-text",f,{"accordion-text--open":g}),onClick:function(){return A(function(t){return!t})},children:[e("div",{className:o("accordion-text__body",{"accordion-text__body--trim-text":O&&!g}),ref:h,children:b?g?v:b:v}),e("div",{className:"accordion-text__toggle",children:g?e(l,{}):e(u,{})})]})}
|
|
@@ -1,134 +1 @@
|
|
|
1
|
-
import
|
|
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;
|
|
1
|
+
function t(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}import{jsx as r,jsxs as e}from"react/jsx-runtime";import n from"classnames";import{useEffect as o,useRef as i,useState as a}from"react";import{getStyles as s}from"../../../Functions/utils";import"./Arrow.scss";export default function(l){var d,c=l.type,u=l.className,h=l.onClick,f=l.disabled,p=l.testId,w=l.isAlt;if(!c||"left"!==c&&"right"!==c)return null;var k=i(),m=(d=a("currentColor"),function(t){if(Array.isArray(t))return t}(d)||function(t,r){var e,n,o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=o){var i=[],a=!0,s=!1;try{for(o=o.call(t);!(a=(e=o.next()).done)&&(i.push(e.value),i.length!==r);a=!0);}catch(t){s=!0,n=t}finally{try{a||null==o.return||o.return()}finally{if(s)throw n}}return i}}(d,2)||function(r,e){if(r){if("string"==typeof r)return t(r,2);var n=Object.prototype.toString.call(r).slice(8,-1);if("Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return t(r,e)}}(d,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),g=m[0],v=m[1];return o(function(){k.current&&v(s(k.current,"color"))},[k.current]),r("div",{"data-testid":"arrow--key-".concat(p,"--type-").concat(c),ref:k,className:n("arrow","arrow_".concat(c),u,{arrow_disabled:f}),onClick:h,children:"left"===c?w?e("svg",{"data-testid":p,version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",children:[r("path",{d:"M12.7,8H3.3",stroke:g,fill:"none",strokeWidth:1.3333,strokeLinecap:"round",strokeLinejoin:"round"}),r("path",{d:"M8,3.3L3.3,8L8,12.7",stroke:g,fill:"none",strokeWidth:1.3333,strokeLinecap:"round",strokeLinejoin:"round"})]}):r("svg",{"data-testid":p,width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:r("path",{d:"M15 18L9 12L15 6",stroke:g,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}):w?e("svg",{"data-testid":p,id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",children:[r("path",{d:"M3.3,8h9.3",stroke:g,fill:"none",strokeWidth:1.3333,strokeLinecap:"round",strokeLinejoin:"round"}),r("path",{d:"M8,3.3L12.7,8L8,12.7",stroke:g,fill:"none",strokeWidth:1.3333,strokeLinecap:"round",strokeLinejoin:"round"})]}):r("svg",{"data-testid":p,width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:r("path",{d:"M9 18L15 12L9 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}
|
|
@@ -1,53 +1 @@
|
|
|
1
|
-
import
|
|
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;
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import r from"classnames";import"./Box.scss";var t={column:"column",row:"row"},n={s:"s",m:"m"};export default function(o){var c,i,a=o.children,l=o.paddingVariant,s=void 0===l?n.m:l,b=o.radiiVariant,f=void 0===b?n.s:b,p=o.direction,u=void 0===p?t.column:p,O=o.className,d=function(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},c=Object.keys(e);for(n=0;n<c.length;n++)t=c[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(n=0;n<c.length;n++)t=c[n],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(o,["children","paddingVariant","radiiVariant","direction","className"]);return e("div",(c=function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){var n;n=t[r],r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n})}return e}({style:{flexDirection:u},className:r("box","box--padding-".concat(s),"box--radii-".concat(f),O,{df:u===t.row,"dfc-jc":u===t.column})},d),i=i={children:a},Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(i)):(function(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(i)).forEach(function(e){Object.defineProperty(c,e,Object.getOwnPropertyDescriptor(i,e))}),c))}
|
|
@@ -1,178 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
BarElement,
|
|
3
|
-
CategoryScale,
|
|
4
|
-
Chart as ChartJS,
|
|
5
|
-
Filler,
|
|
6
|
-
LinearScale,
|
|
7
|
-
LineElement,
|
|
8
|
-
PointElement,
|
|
9
|
-
Tooltip,
|
|
10
|
-
} from 'chart.js';
|
|
11
|
-
|
|
12
|
-
import cn from 'classnames';
|
|
13
|
-
import {
|
|
14
|
-
useCallback,
|
|
15
|
-
useEffect,
|
|
16
|
-
useLayoutEffect,
|
|
17
|
-
useMemo,
|
|
18
|
-
useRef,
|
|
19
|
-
useState,
|
|
20
|
-
} from 'react';
|
|
21
|
-
import * as ChartComponents from 'react-chartjs-2';
|
|
22
|
-
|
|
23
|
-
import { clone } from '../../../Functions/utils';
|
|
24
|
-
|
|
25
|
-
import {
|
|
26
|
-
COMPONENT_OPTIONS,
|
|
27
|
-
DEFAULT_CHART_MODEL,
|
|
28
|
-
ICON_MODELS,
|
|
29
|
-
} from './partial/Chart.constants';
|
|
30
|
-
import ChartTypeSwitcherIcon from './partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon';
|
|
31
|
-
import {
|
|
32
|
-
correctModelKey,
|
|
33
|
-
getChartTypeKey,
|
|
34
|
-
getNotLibraryOptionsOptions,
|
|
35
|
-
getOptions,
|
|
36
|
-
prepareData,
|
|
37
|
-
} from './partial/utils';
|
|
38
|
-
|
|
39
|
-
import './Chart.scss';
|
|
40
|
-
|
|
41
|
-
const RC = 'chart';
|
|
42
|
-
|
|
43
|
-
ChartJS.register(
|
|
44
|
-
CategoryScale,
|
|
45
|
-
LinearScale,
|
|
46
|
-
BarElement,
|
|
47
|
-
PointElement,
|
|
48
|
-
LineElement,
|
|
49
|
-
Filler,
|
|
50
|
-
Tooltip,
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
function Chart({
|
|
54
|
-
className,
|
|
55
|
-
initialModel,
|
|
56
|
-
modelsForSwitch,
|
|
57
|
-
setModelExternalValue,
|
|
58
|
-
description,
|
|
59
|
-
customOptions,
|
|
60
|
-
data,
|
|
61
|
-
addToDatasets,
|
|
62
|
-
modifyOptions,
|
|
63
|
-
}) {
|
|
64
|
-
if (!data) return null;
|
|
65
|
-
|
|
66
|
-
const { label, value } = description || {};
|
|
67
|
-
|
|
68
|
-
const [model, setModel] = useState(DEFAULT_CHART_MODEL);
|
|
69
|
-
const [localData, setLocalData] = useState(data);
|
|
70
|
-
const chartRef = useRef(null);
|
|
71
|
-
const charContainertRef = useRef(null);
|
|
72
|
-
|
|
73
|
-
const options = useMemo(
|
|
74
|
-
() =>
|
|
75
|
-
customOptions
|
|
76
|
-
|| (modifyOptions ? modifyOptions(getOptions(model)) : getOptions(model)),
|
|
77
|
-
[customOptions, model, modifyOptions?.toString?.(), data],
|
|
78
|
-
);
|
|
79
|
-
|
|
80
|
-
const notLibraryOptionsOptions = useMemo(
|
|
81
|
-
() =>
|
|
82
|
-
customOptions
|
|
83
|
-
? customOptions?.notLibraryOptions
|
|
84
|
-
: getNotLibraryOptionsOptions(model),
|
|
85
|
-
[customOptions, model, data],
|
|
86
|
-
);
|
|
87
|
-
|
|
88
|
-
const ChartComponent = useCallback(
|
|
89
|
-
(props) => {
|
|
90
|
-
const Component = ChartComponents[getChartTypeKey(model)];
|
|
91
|
-
return <Component ref={chartRef} {...props} />;
|
|
92
|
-
},
|
|
93
|
-
[model],
|
|
94
|
-
);
|
|
95
|
-
|
|
96
|
-
const isExcludeDescription
|
|
97
|
-
= COMPONENT_OPTIONS.disableDescriptionsFor.includes(model);
|
|
98
|
-
const isExcludeChartTypeSwitcher
|
|
99
|
-
= COMPONENT_OPTIONS.disableChartTypeSwitcherFor.includes(model);
|
|
100
|
-
|
|
101
|
-
useLayoutEffect(() => {
|
|
102
|
-
if (setModelExternalValue && model !== 'emptyLayout')
|
|
103
|
-
setModelExternalValue(model);
|
|
104
|
-
}, [model]);
|
|
105
|
-
|
|
106
|
-
useLayoutEffect(() => {
|
|
107
|
-
const { setCanvasDimensions } = notLibraryOptionsOptions || {};
|
|
108
|
-
if (charContainertRef.current) {
|
|
109
|
-
charContainertRef.current.style.width = setCanvasDimensions?.width ?? '';
|
|
110
|
-
charContainertRef.current.style.height
|
|
111
|
-
= setCanvasDimensions?.height ?? '';
|
|
112
|
-
}
|
|
113
|
-
}, [notLibraryOptionsOptions]);
|
|
114
|
-
|
|
115
|
-
useEffect(() => {
|
|
116
|
-
setModel(correctModelKey(initialModel));
|
|
117
|
-
}, [initialModel]);
|
|
118
|
-
|
|
119
|
-
useEffect(() => {
|
|
120
|
-
setLocalData(
|
|
121
|
-
prepareData(model, clone(data), chartRef.current, addToDatasets),
|
|
122
|
-
);
|
|
123
|
-
}, [model, data]);
|
|
124
|
-
|
|
125
|
-
return (
|
|
126
|
-
<div
|
|
127
|
-
className={cn(
|
|
128
|
-
RC,
|
|
129
|
-
{ [`${RC}_icon-mode`]: ICON_MODELS.includes(model) },
|
|
130
|
-
className,
|
|
131
|
-
)}
|
|
132
|
-
>
|
|
133
|
-
<div
|
|
134
|
-
className={cn(`${RC}__header`, {
|
|
135
|
-
[`${RC}__header_only-switcher`]: !description,
|
|
136
|
-
})}
|
|
137
|
-
>
|
|
138
|
-
{description && !isExcludeDescription
|
|
139
|
-
? (
|
|
140
|
-
<div className={cn(`${RC}__description`)}>
|
|
141
|
-
{label
|
|
142
|
-
? (
|
|
143
|
-
<span className={cn(`${RC}__description-title`)}>{label}</span>
|
|
144
|
-
)
|
|
145
|
-
: null}
|
|
146
|
-
{value
|
|
147
|
-
? (
|
|
148
|
-
<div className={cn(`${RC}__description-value`)}>{value}</div>
|
|
149
|
-
)
|
|
150
|
-
: null}
|
|
151
|
-
</div>
|
|
152
|
-
)
|
|
153
|
-
: null}
|
|
154
|
-
{!isExcludeChartTypeSwitcher
|
|
155
|
-
? (
|
|
156
|
-
<div className={cn(`${RC}__type-switcher`)}>
|
|
157
|
-
<ChartTypeSwitcherIcon
|
|
158
|
-
iconType="Bar"
|
|
159
|
-
isActive={getChartTypeKey(model) === 'Bar'}
|
|
160
|
-
onClick={() => setModel(modelsForSwitch?.[0] || 'barLayout')}
|
|
161
|
-
/>
|
|
162
|
-
<ChartTypeSwitcherIcon
|
|
163
|
-
iconType="Line"
|
|
164
|
-
isActive={getChartTypeKey(model) === 'Line'}
|
|
165
|
-
onClick={() => setModel(modelsForSwitch?.[1] || 'lineLayout')}
|
|
166
|
-
/>
|
|
167
|
-
</div>
|
|
168
|
-
)
|
|
169
|
-
: null}
|
|
170
|
-
</div>
|
|
171
|
-
<div ref={charContainertRef} className={cn(`${RC}__chart-wrapper`)}>
|
|
172
|
-
<ChartComponent {...options} data={localData} />
|
|
173
|
-
</div>
|
|
174
|
-
</div>
|
|
175
|
-
);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
export default Chart;
|
|
1
|
+
function t(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}function r(t,r,e){return r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function e(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),i.forEach(function(e){r(t,e,n[e])})}return t}function n(r,e){return function(t){if(Array.isArray(t))return t}(r)||function(t,r){var e,n,i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var o=[],c=!0,a=!1;try{for(i=i.call(t);!(c=(e=i.next()).done)&&(o.push(e.value),!r||o.length!==r);c=!0);}catch(t){a=!0,n=t}finally{try{c||null==i.return||i.return()}finally{if(a)throw n}}return o}}(r,e)||function(r,e){if(r){if("string"==typeof r)return t(r,e);var n=Object.prototype.toString.call(r).slice(8,-1);if("Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return t(r,e)}}(r,e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}import{jsx as i,jsxs as o}from"react/jsx-runtime";import{BarElement as c,CategoryScale as a,Chart as l,Filler as u,LinearScale as s,LineElement as f,PointElement as p,Tooltip as d}from"chart.js";import m from"classnames";import{useCallback as y,useEffect as h,useLayoutEffect as b,useMemo as v,useRef as O,useState as j}from"react";import*as g from"react-chartjs-2";import{clone as w}from"../../../Functions/utils";import{COMPONENT_OPTIONS as _,DEFAULT_CHART_MODEL as S,ICON_MODELS as P}from"./partial/Chart.constants";import C from"./partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon";import{correctModelKey as A,getChartTypeKey as N,getNotLibraryOptionsOptions as D,getOptions as T,prepareData as x}from"./partial/utils";import"./Chart.scss";var L="chart";l.register(a,s,c,p,f,u,d);export default function(t){var c,a,l,u=t.className,s=t.initialModel,f=t.modelsForSwitch,p=t.setModelExternalValue,d=t.description,I=t.customOptions,k=t.data,E=t.addToDatasets,F=t.modifyOptions;if(!k)return null;var M=d||{},B=M.label,U=M.value,V=n(j(S),2),$=V[0],q=V[1],z=n(j(k),2),G=z[0],H=z[1],J=O(null),K=O(null),Q=v(function(){return I||(F?F(T($)):T($))},[I,$,null==F||null==(l=F.toString)?void 0:l.call(F),k]),R=v(function(){return I?null==I?void 0:I.notLibraryOptions:D($)},[I,$,k]),W=y(function(t){return i(g[N($)],e({ref:J},t))},[$]),X=_.disableDescriptionsFor.includes($),Y=_.disableChartTypeSwitcherFor.includes($);return b(function(){p&&"emptyLayout"!==$&&p($)},[$]),b(function(){var t,r,e=(R||{}).setCanvasDimensions;K.current&&(K.current.style.width=null!=(t=null==e?void 0:e.width)?t:"",K.current.style.height=null!=(r=null==e?void 0:e.height)?r:"")},[R]),h(function(){q(A(s))},[s]),h(function(){H(x($,w(k),J.current,E))},[$,k]),o("div",{className:m(L,r({},"".concat(L,"_icon-mode"),P.includes($)),u),children:[o("div",{className:m("".concat(L,"__header"),r({},"".concat(L,"__header_only-switcher"),!d)),children:[d&&!X?o("div",{className:m("".concat(L,"__description")),children:[B?i("span",{className:m("".concat(L,"__description-title")),children:B}):null,U?i("div",{className:m("".concat(L,"__description-value")),children:U}):null]}):null,Y?null:o("div",{className:m("".concat(L,"__type-switcher")),children:[i(C,{iconType:"Bar",isActive:"Bar"===N($),onClick:function(){return q((null==f?void 0:f[0])||"barLayout")}}),i(C,{iconType:"Line",isActive:"Line"===N($),onClick:function(){return q((null==f?void 0:f[1])||"lineLayout")}})]})]}),i("div",{ref:K,className:m("".concat(L,"__chart-wrapper")),children:i(W,(c=e({},Q),a=a={data:G},Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(a)):(function(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e.push.apply(e,n)}return e})(Object(a)).forEach(function(t){Object.defineProperty(c,t,Object.getOwnPropertyDescriptor(a,t))}),c))})]})}
|
|
@@ -1,78 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import './ChartTypeSwitcherIcon.scss';
|
|
4
|
-
|
|
5
|
-
const RC = 'chart__type-switcher-icon';
|
|
6
|
-
|
|
7
|
-
function getIcon(type) {
|
|
8
|
-
switch (type) {
|
|
9
|
-
case 'Bar':
|
|
10
|
-
return (
|
|
11
|
-
<svg
|
|
12
|
-
width="24"
|
|
13
|
-
height="24"
|
|
14
|
-
viewBox="0 0 24 25"
|
|
15
|
-
fill="none"
|
|
16
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
17
|
-
>
|
|
18
|
-
<rect y="0.5" width="24" height="24" rx="4" fill="#EAF2FF" />
|
|
19
|
-
<path
|
|
20
|
-
d="M18 18V11"
|
|
21
|
-
stroke="#1F7499"
|
|
22
|
-
strokeWidth="2"
|
|
23
|
-
strokeLinecap="round"
|
|
24
|
-
strokeLinejoin="round"
|
|
25
|
-
/>
|
|
26
|
-
<path
|
|
27
|
-
d="M12 18V6"
|
|
28
|
-
stroke="#1F7499"
|
|
29
|
-
strokeWidth="2"
|
|
30
|
-
strokeLinecap="round"
|
|
31
|
-
strokeLinejoin="round"
|
|
32
|
-
/>
|
|
33
|
-
<path
|
|
34
|
-
d="M6 18V13"
|
|
35
|
-
stroke="#1F7499"
|
|
36
|
-
strokeWidth="2"
|
|
37
|
-
strokeLinecap="round"
|
|
38
|
-
strokeLinejoin="round"
|
|
39
|
-
/>
|
|
40
|
-
</svg>
|
|
41
|
-
);
|
|
42
|
-
case 'Line':
|
|
43
|
-
return (
|
|
44
|
-
<svg
|
|
45
|
-
width="24"
|
|
46
|
-
height="24"
|
|
47
|
-
viewBox="0 0 24 25"
|
|
48
|
-
fill="none"
|
|
49
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
50
|
-
>
|
|
51
|
-
<rect y="0.5" width="24" height="24" rx="4" fill="#EAF2FF" />
|
|
52
|
-
<path
|
|
53
|
-
d="M21 8L15.2544 13.2668C14.1075 14.3181 12.3288 14.3014 11.1818
|
|
54
|
-
13.25V13.25C10.0349 12.1986 8.25615 12.1819 7.10919 13.2332L3 17"
|
|
55
|
-
stroke="#1F7499"
|
|
56
|
-
strokeWidth="2"
|
|
57
|
-
strokeLinecap="round"
|
|
58
|
-
strokeLinejoin="round"
|
|
59
|
-
/>
|
|
60
|
-
</svg>
|
|
61
|
-
);
|
|
62
|
-
default:
|
|
63
|
-
return null;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
function ChartTypeSwitcherIcon({ iconType, isActive, className, onClick }) {
|
|
68
|
-
return (
|
|
69
|
-
<div
|
|
70
|
-
className={cn(RC, { [`${RC}_active`]: isActive }, className)}
|
|
71
|
-
onClick={onClick}
|
|
72
|
-
>
|
|
73
|
-
{getIcon(iconType)}
|
|
74
|
-
</div>
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export default ChartTypeSwitcherIcon;
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import r from"classnames";import"./ChartTypeSwitcherIcon.scss";var i="chart__type-switcher-icon";export default function(n){var o,s,c=n.iconType,a=n.isActive,h=n.className,d=n.onClick;return e("div",{className:r(i,(o={},s="".concat(i,"_active"),s in o?Object.defineProperty(o,s,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[s]=a,o),h),onClick:d,children:function(r){switch(r){case"Bar":return t("svg",{width:"24",height:"24",viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("rect",{y:"0.5",width:"24",height:"24",rx:"4",fill:"#EAF2FF"}),e("path",{d:"M18 18V11",stroke:"#1F7499",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e("path",{d:"M12 18V6",stroke:"#1F7499",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e("path",{d:"M6 18V13",stroke:"#1F7499",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]});case"Line":return t("svg",{width:"24",height:"24",viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("rect",{y:"0.5",width:"24",height:"24",rx:"4",fill:"#EAF2FF"}),e("path",{d:"M21 8L15.2544 13.2668C14.1075 14.3181 12.3288 14.3014 11.1818 13.25V13.25C10.0349 12.1986 8.25615 12.1819 7.10919 13.2332L3 17",stroke:"#1F7499",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]});default:return null}}(c)})}
|