intelicoreact 1.6.20 → 1.6.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Atomic/FormElements/ActionAlert/ActionAlert.js +1 -102
- package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.js +1 -89
- package/dist/Atomic/FormElements/Calendar/Calendar.js +1 -232
- package/dist/Atomic/FormElements/Calendar/Calendar.props.js +1 -3
- package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.js +1 -101
- package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.js +1 -70
- package/dist/Atomic/FormElements/Datepicker/Datepicker.js +1 -350
- package/dist/Atomic/FormElements/Datepicker/Datepicker.props.js +1 -3
- package/dist/Atomic/FormElements/Datepicker/components/DatepickerCalendar.js +1 -177
- package/dist/Atomic/FormElements/Datepicker/components/DatepickerCalendar.props.js +1 -3
- package/dist/Atomic/FormElements/Dropdown/Dropdown.js +1 -561
- package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.js +1 -20
- package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.js +1 -405
- package/dist/Atomic/FormElements/FileLoader/FileLoader.js +1 -94
- package/dist/Atomic/FormElements/FileLoader/partial/LoadZone.js +1 -105
- package/dist/Atomic/FormElements/FileLoader/partial/LoadedContent.js +1 -67
- package/dist/Atomic/FormElements/FileLoaderDescription/FileLoaderDescription.js +1 -247
- package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.js +1 -160
- package/dist/Atomic/FormElements/FileLoaderLocalGroup/FileLoaderLocalGroup.js +1 -193
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.js +1 -135
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN_old.js +1 -116
- package/dist/Atomic/FormElements/Input/Input.js +1 -467
- package/dist/Atomic/FormElements/InputCalendar/InputCalendar.js +1 -161
- package/dist/Atomic/FormElements/InputColor/InputColor.js +1 -64
- package/dist/Atomic/FormElements/InputCurrency/InputCurrency.js +1 -166
- package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +1 -354
- package/dist/Atomic/FormElements/InputDateRange/components/DateInput.js +1 -71
- package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.js +1 -693
- package/dist/Atomic/FormElements/InputDateRange/components/OpenedPart.js +1 -254
- package/dist/Atomic/FormElements/InputDateRange/components/SelectItem.js +1 -32
- package/dist/Atomic/FormElements/InputDateRange/dependencies.js +1 -200
- package/dist/Atomic/FormElements/InputLink/InputLink.js +1 -99
- package/dist/Atomic/FormElements/InputMask/InputCarretPosition.js +1 -37
- package/dist/Atomic/FormElements/InputMask/InputMask.js +1 -1214
- package/dist/Atomic/FormElements/InputMask/config.js +1 -15
- package/dist/Atomic/FormElements/InputMask/functions.js +1 -58
- package/dist/Atomic/FormElements/InputMask2/InputMask2.js +1 -674
- package/dist/Atomic/FormElements/InputMask2/config.js +1 -15
- package/dist/Atomic/FormElements/InputMask2/functions.js +1 -58
- package/dist/Atomic/FormElements/InputMask3/InputMask3.js +1 -766
- package/dist/Atomic/FormElements/InputMask3/config.js +1 -15
- package/dist/Atomic/FormElements/InputMask3/functions.js +1 -58
- package/dist/Atomic/FormElements/InputWithAction/InputWithAction.js +1 -114
- package/dist/Atomic/FormElements/InputsRow/InputsRow.js +1 -140
- package/dist/Atomic/FormElements/Label/Label.js +1 -82
- package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +1 -506
- package/dist/Atomic/FormElements/MultiSelect/MultiSelect.js +1 -45
- package/dist/Atomic/FormElements/NumericInput/NumericInput.js +1 -331
- package/dist/Atomic/FormElements/RadioGroup/RadioGroup.js +1 -66
- package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +1 -80
- package/dist/Atomic/FormElements/RadioInput/RadioInput.js +1 -64
- package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.js +1 -54
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +1 -183
- package/dist/Atomic/FormElements/RangeInputs/RangeInputs.js +1 -209
- package/dist/Atomic/FormElements/RangeList/RangeList.js +1 -175
- package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.js +1 -43
- package/dist/Atomic/FormElements/RangeSlider/RangeSlider.js +1 -443
- package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +1 -858
- package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.js +1 -39
- package/dist/Atomic/FormElements/Switcher/Switcher.js +1 -59
- package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.js +1 -50
- package/dist/Atomic/FormElements/SwitcherHide/SwitcherHide.js +1 -47
- package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.js +1 -96
- package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.js +1 -40
- package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.js +1 -64
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.js +1 -170
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/partial/States.js +1 -202
- package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.js +1 -67
- package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.js +1 -115
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +1 -826
- package/dist/Atomic/FormElements/Text/Text.js +1 -125
- package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.js +1 -45
- package/dist/Atomic/FormElements/Textarea/Textarea.js +1 -80
- package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +1 -176
- package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.js +1 -62
- package/dist/Atomic/FormElements/TimeRange/TimeRange.js +1 -127
- package/dist/Atomic/FormElements/UserContacts/UserContacts.js +1 -220
- package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.js +1 -83
- package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.js +1 -82
- package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.js +1 -101
- package/dist/Atomic/FormElements/WidgetPseudoTable/partial/constructor.js +1 -29
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.js +1 -113
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/partial/constructor.js +1 -30
- package/dist/Atomic/Layout/Header/Header.js +1 -85
- package/dist/Atomic/Layout/Spinner/Spinner.js +1 -39
- package/dist/Atomic/UI/Accordion/Accordion.js +1 -118
- package/dist/Atomic/UI/Accordion/AccordionItem.js +1 -181
- package/dist/Atomic/UI/AccordionTable/AccordionTable.js +1 -238
- package/dist/Atomic/UI/AccordionText/AccordionText.js +1 -69
- package/dist/Atomic/UI/AdvancedTag/AdvTag.js +1 -207
- package/dist/Atomic/UI/AdvancedTag/AdvancedTags.js +1 -56
- package/dist/Atomic/UI/Alert/Alert.js +1 -72
- package/dist/Atomic/UI/Arrow/Arrow.js +1 -132
- package/dist/Atomic/UI/Box/Box.js +1 -52
- package/dist/Atomic/UI/Button/Button.js +1 -89
- package/dist/Atomic/UI/ButtonsBar/ButtonsBar.js +1 -72
- package/dist/Atomic/UI/Chart/Chart.js +1 -172
- package/dist/Atomic/UI/Chart/partial/Chart.constants.js +1 -95
- package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +1 -80
- package/dist/Atomic/UI/Chart/partial/datasetSetters.js +1 -188
- package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +1 -335
- package/dist/Atomic/UI/Chart/partial/optionsSetters.js +1 -43
- package/dist/Atomic/UI/Chart/partial/utils.js +1 -60
- package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +1 -109
- package/dist/Atomic/UI/DateTime/DateTime.js +1 -57
- package/dist/Atomic/UI/DebugContainer/DebugContainer.js +1 -44
- package/dist/Atomic/UI/DebugContainer/useDebugContainer.js +1 -15
- package/dist/Atomic/UI/DoubleString/DoubleString.js +1 -102
- package/dist/Atomic/UI/DynamicIcon/DynamicIcon.js +1 -226
- package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +1 -221
- package/dist/Atomic/UI/ExampleChartIntegration/partial/utils.js +1 -106
- package/dist/Atomic/UI/Hint/Hint.js +1 -193
- package/dist/Atomic/UI/Hint/partials/_utils.js +1 -51
- package/dist/Atomic/UI/Modal/Modal.js +1 -188
- package/dist/Atomic/UI/Modal/ModalHOC.js +1 -72
- package/dist/Atomic/UI/Modal/partials/ModalFooter.js +1 -46
- package/dist/Atomic/UI/Modal/partials/ModalTitle.js +1 -83
- package/dist/Atomic/UI/Modal/partials/useMobileModal.js +1 -200
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion._test.js +1 -75
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +1 -80
- package/dist/Atomic/UI/NavLine/NavLine.js +1 -293
- package/dist/Atomic/UI/PageTitle/PageTitle.js +1 -75
- package/dist/Atomic/UI/PieChart/PieChart.js +1 -42
- package/dist/Atomic/UI/Price/Price.js +1 -22
- package/dist/Atomic/UI/PriceRange/PriceRange.js +1 -36
- package/dist/Atomic/UI/ProgressLine/ProgressLine.js +1 -71
- package/dist/Atomic/UI/Status/Status.js +1 -59
- package/dist/Atomic/UI/Table/Partials/TdCell.js +1 -87
- package/dist/Atomic/UI/Table/Partials/TdHeader.js +1 -38
- package/dist/Atomic/UI/Table/Partials/TdRow.js +1 -99
- package/dist/Atomic/UI/Table/Partials/TdTitle.js +1 -52
- package/dist/Atomic/UI/Table/Table.js +1 -63
- package/dist/Atomic/UI/Table/TdTypes/TdActions.js +1 -80
- package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +1 -28
- package/dist/Atomic/UI/Table/TdTypes/TdRange.js +1 -13
- package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +1 -53
- package/dist/Atomic/UI/Tag/Tag.js +1 -160
- package/dist/Atomic/UI/TagList/TagList.js +1 -251
- package/dist/Atomic/UI/UserBox/UserBox.js +1 -73
- package/dist/Atomic/UI/WizardStepper/constructor.js +1 -84
- package/dist/Atomic/UI/WizardStepper/index.js +1 -3
- package/dist/Atomic/UI/WizardStepper/ui/StateIcon/StateIcon.js +1 -37
- package/dist/Atomic/UI/WizardStepper/ui/StateIcon/index.js +1 -3
- package/dist/Atomic/UI/WizardStepper/ui/StepRow/StepRow.js +1 -61
- package/dist/Atomic/UI/WizardStepper/ui/StepRow/index.js +1 -3
- package/dist/Atomic/UI/WizardStepper/ui/StepWrapper/StepWrapper.js +1 -39
- package/dist/Atomic/UI/WizardStepper/ui/StepWrapper/index.js +1 -3
- package/dist/Atomic/UI/WizardStepper/ui/icons.js +1 -49
- package/dist/Atomic/UI/WizardStepper/ui/index.js +1 -3
- package/dist/Classes/AbortableFetch.js +1 -454
- package/dist/Classes/AnimatedHandler.js +1 -47
- package/dist/Classes/RESTAPI/index.js +1 -228
- package/dist/Classes/RESTAPI/partials/AbortableFetch.js +1 -457
- package/dist/Classes/RESTAPI/partials/ApiBase.js +1 -48
- package/dist/Classes/RESTAPI/partials/ApiRequestCreators.js +1 -112
- package/dist/Classes/RESTAPI/partials/ApiUtils.js +1 -189
- package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +1 -252
- package/dist/Classes/RESTAPI/partials/Utils.js +1 -92
- package/dist/Classes/RESTAPI/partials/_outerDependencies.js +1 -3
- package/dist/Classes/RESTAPI/partials/_utils.js +1 -197
- package/dist/Constants/index.constants.js +1 -78
- package/dist/Functions/Portal.js +1 -22
- package/dist/Functions/customEventListener.js +1 -96
- package/dist/Functions/dateTime.js +1 -149
- package/dist/Functions/fieldValueFormatters.js +1 -405
- package/dist/Functions/guards/assertions.js +1 -66
- package/dist/Functions/guards/safeValue.js +1 -30
- package/dist/Functions/guards/typeGuards.js +1 -116
- package/dist/Functions/hooks/useFormFieldsChangesManager.js +1 -95
- package/dist/Functions/locale/createTranslator.js +1 -32
- package/dist/Functions/operations.js +1 -130
- package/dist/Functions/presets/inputMaskPresets.js +1 -170
- package/dist/Functions/presets/inputPresets.js +1 -60
- package/dist/Functions/presets/mobileKeyboardTypesPresets.js +1 -45
- package/dist/Functions/schemas.js +1 -31
- package/dist/Functions/useBodyScrollLock.js +1 -17
- package/dist/Functions/useClickOutside.js +1 -15
- package/dist/Functions/useDebounce.js +1 -17
- package/dist/Functions/useFieldFocus.js +1 -84
- package/dist/Functions/useFormTools/form-drivers/ArrayWithObjects.js +1 -39
- package/dist/Functions/useFormTools/form-drivers/ObjectWithIterableObjects.js +1 -159
- package/dist/Functions/useFormTools/form-drivers/ObjectWithNamedKeyObjects.js +1 -78
- package/dist/Functions/useFormTools/functions/General.js +1 -134
- package/dist/Functions/useFormTools/functions/RenderFields.js +1 -111
- package/dist/Functions/useFormTools/functions/usePrevious.js +1 -12
- package/dist/Functions/useFormTools/index.js +1 -778
- package/dist/Functions/useInputHighlightError.js +1 -67
- package/dist/Functions/useIsMobile/useIsMobile.js +1 -53
- package/dist/Functions/useKeyPress/useHandleKeyPress.js +1 -21
- package/dist/Functions/useKeyPress/useKeyPress.js +1 -75
- package/dist/Functions/useLocalStorage.js +1 -34
- package/dist/Functions/useLocationParams.js +1 -27
- package/dist/Functions/useMediaQuery.js +1 -17
- package/dist/Functions/useMetaInfo.js +1 -43
- package/dist/Functions/useMouseUpOutside.js +1 -16
- package/dist/Functions/useOnlineStatus.js +1 -29
- package/dist/Functions/usePasswordChecker.js +1 -110
- package/dist/Functions/usePrevious.js +1 -12
- package/dist/Functions/useResize.js +1 -31
- package/dist/Functions/useScrollTo.js +1 -17
- package/dist/Functions/useToggle.js +1 -17
- package/dist/Functions/utils.js +1 -522
- package/dist/Langs.js +1 -168
- package/dist/Molecular/CustomIcons/components/AffiliateNetworks.js +1 -21
- package/dist/Molecular/CustomIcons/components/AlertCircle.js +1 -23
- package/dist/Molecular/CustomIcons/components/AppStore.js +1 -29
- package/dist/Molecular/CustomIcons/components/Arrow.js +1 -32
- package/dist/Molecular/CustomIcons/components/ArrowDown.js +1 -17
- package/dist/Molecular/CustomIcons/components/ArrowLeft.js +1 -22
- package/dist/Molecular/CustomIcons/components/ArrowRight.js +1 -22
- package/dist/Molecular/CustomIcons/components/ArrowUp.js +1 -17
- package/dist/Molecular/CustomIcons/components/Bell.js +1 -15
- package/dist/Molecular/CustomIcons/components/Button.js +1 -12
- package/dist/Molecular/CustomIcons/components/Campaigns.js +1 -16
- package/dist/Molecular/CustomIcons/components/Check.js +1 -14
- package/dist/Molecular/CustomIcons/components/Check2.js +1 -12
- package/dist/Molecular/CustomIcons/components/ChevronDown.js +1 -12
- package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.js +1 -11
- package/dist/Molecular/CustomIcons/components/ChevronLeft.js +1 -11
- package/dist/Molecular/CustomIcons/components/ChevronRight.js +1 -11
- package/dist/Molecular/CustomIcons/components/ChevronUp.js +1 -11
- package/dist/Molecular/CustomIcons/components/ChevronUpDown.js +1 -27
- package/dist/Molecular/CustomIcons/components/Close.js +1 -14
- package/dist/Molecular/CustomIcons/components/ColumnsOrder.js +1 -17
- package/dist/Molecular/CustomIcons/components/Delete.js +1 -16
- package/dist/Molecular/CustomIcons/components/Edit.js +1 -15
- package/dist/Molecular/CustomIcons/components/Email.js +1 -31
- package/dist/Molecular/CustomIcons/components/FinturfLogo.js +1 -18
- package/dist/Molecular/CustomIcons/components/FinturfLogo2.js +1 -35
- package/dist/Molecular/CustomIcons/components/Flows.js +1 -15
- package/dist/Molecular/CustomIcons/components/Gift.js +1 -25
- package/dist/Molecular/CustomIcons/components/GoogleAuth.js +1 -29
- package/dist/Molecular/CustomIcons/components/GooglePlay.js +1 -29
- package/dist/Molecular/CustomIcons/components/HelpCircle.js +1 -19
- package/dist/Molecular/CustomIcons/components/HelpCircle2.js +1 -20
- package/dist/Molecular/CustomIcons/components/HelpCircleFilled.js +1 -19
- package/dist/Molecular/CustomIcons/components/Home.js +1 -16
- package/dist/Molecular/CustomIcons/components/Home2.js +1 -22
- package/dist/Molecular/CustomIcons/components/Key.js +1 -23
- package/dist/Molecular/CustomIcons/components/Landers.js +1 -20
- package/dist/Molecular/CustomIcons/components/Lock.js +1 -15
- package/dist/Molecular/CustomIcons/components/Mail.js +1 -26
- package/dist/Molecular/CustomIcons/components/Mastercard.js +1 -73
- package/dist/Molecular/CustomIcons/components/Minus.js +1 -25
- package/dist/Molecular/CustomIcons/components/Offers.js +1 -16
- package/dist/Molecular/CustomIcons/components/Pause.js +1 -28
- package/dist/Molecular/CustomIcons/components/PayPal.js +1 -41
- package/dist/Molecular/CustomIcons/components/PayPalLightLarge.js +1 -28
- package/dist/Molecular/CustomIcons/components/Phone.js +1 -30
- package/dist/Molecular/CustomIcons/components/Play.js +1 -25
- package/dist/Molecular/CustomIcons/components/Plus.js +1 -25
- package/dist/Molecular/CustomIcons/components/Profile.js +1 -16
- package/dist/Molecular/CustomIcons/components/QRCode.js +1 -29
- package/dist/Molecular/CustomIcons/components/Rectangle.js +1 -12
- package/dist/Molecular/CustomIcons/components/Revert.js +1 -13
- package/dist/Molecular/CustomIcons/components/Star.js +1 -14
- package/dist/Molecular/CustomIcons/components/Star2.js +1 -16
- package/dist/Molecular/CustomIcons/components/TrafficSources.js +1 -14
- package/dist/Molecular/CustomIcons/components/Trash.js +1 -15
- package/dist/Molecular/CustomIcons/components/TrashRed.js +1 -15
- package/dist/Molecular/CustomIcons/components/Triggers.js +1 -15
- package/dist/Molecular/CustomIcons/components/User.js +1 -25
- package/dist/Molecular/CustomIcons/components/Visa.js +1 -31
- package/dist/Molecular/CustomIcons/components/X.js +1 -12
- package/dist/Molecular/CustomIcons/index.js +1 -61
- package/dist/Molecular/FormElement/FormElement.js +1 -54
- package/dist/Molecular/FormWithDependOn/FormWithDependOn.js +1 -184
- package/dist/Molecular/FormWithDependOn/partials/_utils.js +1 -53
- package/dist/Molecular/InputAddress/InputAddress.js +1 -620
- package/dist/Molecular/InputPassword/InputPassword.js +1 -48
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,221 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import cn from "classnames";
|
|
4
|
-
import { v4 as uuid } from "uuid";
|
|
5
|
-
|
|
6
|
-
import { formatToPriceWithUSD } from "../../../Functions/fieldValueFormatters";
|
|
7
|
-
import { clone } from "../../../Functions/utils";
|
|
8
|
-
import InputDateRange from "../../FormElements/InputDateRange/InputDateRange";
|
|
9
|
-
import Chart from "../Chart/Chart";
|
|
10
|
-
|
|
11
|
-
import {
|
|
12
|
-
getLabels,
|
|
13
|
-
getMockValue,
|
|
14
|
-
getSafelyDateRange,
|
|
15
|
-
getTab,
|
|
16
|
-
} from "./partial/utils";
|
|
17
|
-
|
|
18
|
-
import "./partial/AnyOuterClass.scss";
|
|
19
|
-
|
|
20
|
-
const ExampleChartIntegration = (props) => {
|
|
21
|
-
const { inputDateRangeProps, chartProps } = props || {};
|
|
22
|
-
const { value: outerDateRange, onChange: changeDateRange } =
|
|
23
|
-
inputDateRangeProps || {};
|
|
24
|
-
const { initialChartType } = chartProps || {};
|
|
25
|
-
const dateRange = useMemo(
|
|
26
|
-
() => getSafelyDateRange(outerDateRange),
|
|
27
|
-
[outerDateRange],
|
|
28
|
-
);
|
|
29
|
-
|
|
30
|
-
const [chartType, setChartType] = useState(initialChartType || "Bar");
|
|
31
|
-
const [tab, setTab] = useState("tab1");
|
|
32
|
-
const [initialModel, setInitialModel] = useState(
|
|
33
|
-
chartType === "Bar" ? "finturfLoadingModeBar" : "finturfLoadingModeLine",
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
const [tab1, setTab1] = useState(null);
|
|
37
|
-
const [tab2, setTab2] = useState(null);
|
|
38
|
-
const [tab3, setTab3] = useState(null);
|
|
39
|
-
const [tab4, setTab4] = useState(null);
|
|
40
|
-
|
|
41
|
-
const [dataForRender, setDataForRender] = useState(null);
|
|
42
|
-
|
|
43
|
-
const getMockData = () => {
|
|
44
|
-
const labels = getLabels(dateRange);
|
|
45
|
-
const mock = () => labels.map((label) => getMockValue());
|
|
46
|
-
return {
|
|
47
|
-
labels,
|
|
48
|
-
datasets: [
|
|
49
|
-
{
|
|
50
|
-
data: mock(),
|
|
51
|
-
},
|
|
52
|
-
],
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
const getTabData = (tabId) => {
|
|
57
|
-
switch (tabId) {
|
|
58
|
-
case "tab1":
|
|
59
|
-
return !tab1 ? null : clone(tab1);
|
|
60
|
-
case "tab2":
|
|
61
|
-
return !tab2 ? null : clone(tab2);
|
|
62
|
-
case "tab3":
|
|
63
|
-
return !tab3 ? null : clone(tab3);
|
|
64
|
-
case "tab4":
|
|
65
|
-
return !tab4 ? null : clone(tab4);
|
|
66
|
-
default:
|
|
67
|
-
return null;
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
const getDescription = (tabId) => {
|
|
72
|
-
switch (tabId) {
|
|
73
|
-
case "tab1":
|
|
74
|
-
return "Tab 1";
|
|
75
|
-
case "tab2":
|
|
76
|
-
return "Tab 2";
|
|
77
|
-
case "tab3":
|
|
78
|
-
return "Tab 3";
|
|
79
|
-
case "tab4":
|
|
80
|
-
return "Tab 4";
|
|
81
|
-
default:
|
|
82
|
-
return null;
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
const selectData = () => (getTabData(tab) ? getTabData(tab) : getMockData());
|
|
87
|
-
|
|
88
|
-
const modelsForSwitch = useMemo(
|
|
89
|
-
() =>
|
|
90
|
-
getTabData(tab)
|
|
91
|
-
? ["finturfChartBar", "finturfChartLine"]
|
|
92
|
-
: ["finturfLoadingModeBar", "finturfLoadingModeLine"],
|
|
93
|
-
[Boolean(getTabData(tab))],
|
|
94
|
-
);
|
|
95
|
-
|
|
96
|
-
const handleChangeChartType = (model) => {
|
|
97
|
-
setChartType(model.includes("Line") ? "Line" : "Bar");
|
|
98
|
-
setInitialModel(model);
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
const getModel = () => {
|
|
102
|
-
if (!getTabData(tab))
|
|
103
|
-
return chartType === "Bar"
|
|
104
|
-
? "finturfLoadingModeBar"
|
|
105
|
-
: "finturfLoadingModeLine";
|
|
106
|
-
else return chartType === "Bar" ? "finturfChartBar" : "finturfChartLine";
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
const processResponse = (res, tabId) => {
|
|
110
|
-
switch (tabId) {
|
|
111
|
-
case "tab1":
|
|
112
|
-
setTab1(res);
|
|
113
|
-
break;
|
|
114
|
-
case "tab2":
|
|
115
|
-
setTab2(res);
|
|
116
|
-
break;
|
|
117
|
-
case "tab3":
|
|
118
|
-
setTab3(res);
|
|
119
|
-
break;
|
|
120
|
-
case "tab4":
|
|
121
|
-
setTab4(res);
|
|
122
|
-
break;
|
|
123
|
-
default:
|
|
124
|
-
break;
|
|
125
|
-
}
|
|
126
|
-
return res;
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
useLayoutEffect(() => {
|
|
130
|
-
setTab1(null);
|
|
131
|
-
setTab2(null);
|
|
132
|
-
setTab3(null);
|
|
133
|
-
setTab4(null);
|
|
134
|
-
|
|
135
|
-
// эмуляция запросов
|
|
136
|
-
// вся логика происходит в самих входящих промисах
|
|
137
|
-
// Promise.all добавлен для расширения на случай надобности описания эффектов по завершении всех запросов
|
|
138
|
-
Promise.all([
|
|
139
|
-
getTab("tab1", dateRange, processResponse),
|
|
140
|
-
getTab("tab2", dateRange, processResponse),
|
|
141
|
-
getTab("tab3", dateRange, processResponse),
|
|
142
|
-
getTab("tab4", dateRange, processResponse),
|
|
143
|
-
]);
|
|
144
|
-
}, [dateRange]);
|
|
145
|
-
|
|
146
|
-
useLayoutEffect(() => {
|
|
147
|
-
setInitialModel(getModel());
|
|
148
|
-
setDataForRender(selectData());
|
|
149
|
-
}, [Boolean(getTabData(tab)), tab, chartType]);
|
|
150
|
-
|
|
151
|
-
return (
|
|
152
|
-
<div className="example-wrapper">
|
|
153
|
-
<InputDateRange
|
|
154
|
-
{...inputDateRangeProps}
|
|
155
|
-
value={outerDateRange}
|
|
156
|
-
onChange={changeDateRange}
|
|
157
|
-
/>
|
|
158
|
-
|
|
159
|
-
<div className="buttons-block">
|
|
160
|
-
<button
|
|
161
|
-
className={cn("tab-button", { "tab-button_active": tab === "tab1" })}
|
|
162
|
-
onClick={() => setTab("tab1")}
|
|
163
|
-
>
|
|
164
|
-
Tab 1
|
|
165
|
-
</button>
|
|
166
|
-
<button
|
|
167
|
-
className={cn("tab-button", { "tab-button_active": tab === "tab2" })}
|
|
168
|
-
onClick={() => setTab("tab2")}
|
|
169
|
-
>
|
|
170
|
-
Tab 2
|
|
171
|
-
</button>
|
|
172
|
-
<button
|
|
173
|
-
className={cn("tab-button", { "tab-button_active": tab === "tab3" })}
|
|
174
|
-
onClick={() => setTab("tab3")}
|
|
175
|
-
>
|
|
176
|
-
Tab 3
|
|
177
|
-
</button>
|
|
178
|
-
<button
|
|
179
|
-
className={cn("tab-button", { "tab-button_active": tab === "tab4" })}
|
|
180
|
-
onClick={() => setTab("tab4")}
|
|
181
|
-
>
|
|
182
|
-
Tab 4
|
|
183
|
-
</button>
|
|
184
|
-
</div>
|
|
185
|
-
|
|
186
|
-
<Chart
|
|
187
|
-
{...chartProps}
|
|
188
|
-
key={JSON.stringify(dataForRender)}
|
|
189
|
-
data={dataForRender}
|
|
190
|
-
setModelExternalValue={handleChangeChartType}
|
|
191
|
-
initialModel={initialModel}
|
|
192
|
-
modelsForSwitch={modelsForSwitch}
|
|
193
|
-
description={{ label: getDescription(tab) }}
|
|
194
|
-
addToDatasets={{ id: tab }}
|
|
195
|
-
modifyOptions={(options) => ({
|
|
196
|
-
...options,
|
|
197
|
-
options: {
|
|
198
|
-
...options?.options,
|
|
199
|
-
plugins: {
|
|
200
|
-
...options?.options?.plugins,
|
|
201
|
-
tooltip: {
|
|
202
|
-
...options?.options?.plugins?.tooltip,
|
|
203
|
-
callbacks: {
|
|
204
|
-
...options?.options?.plugins?.tooltip?.callbacks,
|
|
205
|
-
label: (context) => {
|
|
206
|
-
return context.dataset.id === "tab3" ||
|
|
207
|
-
context.dataset.id === "tab4"
|
|
208
|
-
? formatToPriceWithUSD(context.raw || "0")
|
|
209
|
-
: context.raw || "0";
|
|
210
|
-
},
|
|
211
|
-
},
|
|
212
|
-
},
|
|
213
|
-
},
|
|
214
|
-
},
|
|
215
|
-
})}
|
|
216
|
-
/>
|
|
217
|
-
</div>
|
|
218
|
-
);
|
|
219
|
-
};
|
|
220
|
-
|
|
221
|
-
export default ExampleChartIntegration;
|
|
1
|
+
function t(t,n){(null==n||n>t.length)&&(n=t.length);for(var r=0,e=Array(n);r<n;r++)e[r]=t[r];return e}function n(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{},e=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(e=e.concat(Object.getOwnPropertySymbols(r).filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),e.forEach(function(n){var e;e=r[n],n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e})}return t}function r(t,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(t,n){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);r.push.apply(r,e)}return r})(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))}),t}function e(n,r){return function(t){if(Array.isArray(t))return t}(n)||function(t,n){var r,e,a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var o=[],i=!0,u=!1;try{for(a=a.call(t);!(i=(r=a.next()).done)&&(o.push(r.value),!n||o.length!==n);i=!0);}catch(t){u=!0,e=t}finally{try{i||null==a.return||a.return()}finally{if(u)throw e}}return o}}(n,r)||function(n,r){if(n){if("string"==typeof n)return t(n,r);var e=Object.prototype.toString.call(n).slice(8,-1);if("Object"===e&&n.constructor&&(e=n.constructor.name),"Map"===e||"Set"===e)return Array.from(e);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return t(n,r)}}(n,r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}import{jsx as a,jsxs as o}from"react/jsx-runtime";import{createElement as i}from"react";import{useLayoutEffect as u,useMemo as l,useState as c}from"react";import s from"classnames";import"uuid";import{formatToPriceWithUSD as b}from"../../../Functions/fieldValueFormatters";import{clone as f}from"../../../Functions/utils";import p from"../../FormElements/InputDateRange/InputDateRange";import d from"../Chart/Chart";import{getLabels as m,getMockValue as y,getSafelyDateRange as h,getTab as g}from"./partial/utils";import"./partial/AnyOuterClass.scss";export default function(t){var v=t||{},O=v.inputDateRangeProps,j=v.chartProps,w=O||{},C=w.value,P=w.onChange,k=(j||{}).initialChartType,L=l(function(){return h(C)},[C]),S=e(c(k||"Bar"),2),T=S[0],B=S[1],M=e(c("tab1"),2),D=M[0],x=M[1],A=e(c("Bar"===T?"finturfLoadingModeBar":"finturfLoadingModeLine"),2),N=A[0],E=A[1],F=e(c(null),2),I=F[0],_=F[1],R=e(c(null),2),V=R[0],J=R[1],U=e(c(null),2),$=U[0],q=U[1],z=e(c(null),2),G=z[0],H=z[1],K=e(c(null),2),Q=K[0],W=K[1],X=function(){var t=m(L);return{labels:t,datasets:[{data:t.map(function(t){return y()})}]}},Y=function(t){switch(t){case"tab1":return I?f(I):null;case"tab2":return V?f(V):null;case"tab3":return $?f($):null;case"tab4":return G?f(G):null;default:return null}},Z=l(function(){return Y(D)?["finturfChartBar","finturfChartLine"]:["finturfLoadingModeBar","finturfLoadingModeLine"]},[!!Y(D)]),tt=function(t,n){switch(n){case"tab1":_(t);break;case"tab2":J(t);break;case"tab3":q(t);break;case"tab4":H(t)}return t};return u(function(){_(null),J(null),q(null),H(null),Promise.all([g("tab1",L,tt),g("tab2",L,tt),g("tab3",L,tt),g("tab4",L,tt)])},[L]),u(function(){E(Y(D)?"Bar"===T?"finturfChartBar":"finturfChartLine":"Bar"===T?"finturfLoadingModeBar":"finturfLoadingModeLine"),W(Y(D)?Y(D):X())},[!!Y(D),D,T]),o("div",{className:"example-wrapper",children:[a(p,r(n({},O),{value:C,onChange:P})),o("div",{className:"buttons-block",children:[a("button",{className:s("tab-button",{"tab-button_active":"tab1"===D}),onClick:function(){return x("tab1")},children:"Tab 1"}),a("button",{className:s("tab-button",{"tab-button_active":"tab2"===D}),onClick:function(){return x("tab2")},children:"Tab 2"}),a("button",{className:s("tab-button",{"tab-button_active":"tab3"===D}),onClick:function(){return x("tab3")},children:"Tab 3"}),a("button",{className:s("tab-button",{"tab-button_active":"tab4"===D}),onClick:function(){return x("tab4")},children:"Tab 4"})]}),i(d,r(n({},j),{key:JSON.stringify(Q),data:Q,setModelExternalValue:function(t){B(t.includes("Line")?"Line":"Bar"),E(t)},initialModel:N,modelsForSwitch:Z,description:{label:function(t){switch(t){case"tab1":return"Tab 1";case"tab2":return"Tab 2";case"tab3":return"Tab 3";case"tab4":return"Tab 4";default:return null}}(D)},addToDatasets:{id:D},modifyOptions:function(t){var e,a,o,i,u,l;return r(n({},t),{options:r(n({},null==t?void 0:t.options),{plugins:r(n({},null==t||null==(e=t.options)?void 0:e.plugins),{tooltip:r(n({},null==t||null==(o=t.options)||null==(a=o.plugins)?void 0:a.tooltip),{callbacks:r(n({},null==t||null==(l=t.options)||null==(u=l.plugins)||null==(i=u.tooltip)?void 0:i.callbacks),{label:function(t){return"tab3"===t.dataset.id||"tab4"===t.dataset.id?b(t.raw||"0"):t.raw||"0"}})})})})})}}))]})}
|
|
@@ -1,106 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import { getActualDateRange } from "../../../FormElements/InputDateRange/dependencies";
|
|
4
|
-
|
|
5
|
-
export const getSafelyDateRange = (dateRange) =>
|
|
6
|
-
(!dateRange?.start || !dateRange?.end) &&
|
|
7
|
-
(!dateRange?.intervalKey || dateRange?.intervalKey === "allTime")
|
|
8
|
-
? getActualDateRange({
|
|
9
|
-
start: "2022-01-01T00:00:00",
|
|
10
|
-
end: moment().endOf("day").format("YYYY-MM-DDTHH:mm:ss"),
|
|
11
|
-
})
|
|
12
|
-
: getActualDateRange(dateRange);
|
|
13
|
-
|
|
14
|
-
export const getLabels = (range) => {
|
|
15
|
-
const MINIMUM_INTERVAL = "hour";
|
|
16
|
-
const NO_MORE_THAN_THREE_HOURS = 3; // this is hours
|
|
17
|
-
const NO_MORE_THAN_TWO_DAYS = 48; // this is hours
|
|
18
|
-
const NO_MORE_THAN_TWO_MONTHS = 2; // this is months
|
|
19
|
-
const NO_MORE_THAN_THREE_YEARS = 24; // this is months
|
|
20
|
-
|
|
21
|
-
// safely Range must have 'start' and 'end' properties
|
|
22
|
-
const safelyRange = getActualDateRange(range);
|
|
23
|
-
const start = moment(safelyRange?.start).startOf(MINIMUM_INTERVAL);
|
|
24
|
-
const end = moment(safelyRange?.end).startOf(MINIMUM_INTERVAL);
|
|
25
|
-
|
|
26
|
-
const getValues = (intervalStepKey) => {
|
|
27
|
-
let format;
|
|
28
|
-
switch (intervalStepKey) {
|
|
29
|
-
case "minutes":
|
|
30
|
-
format = "MM.DD hh:mm";
|
|
31
|
-
break;
|
|
32
|
-
case "hours":
|
|
33
|
-
format = "MM.DD.YYYY h A";
|
|
34
|
-
break;
|
|
35
|
-
case "days":
|
|
36
|
-
format = "MM.DD.YYYY";
|
|
37
|
-
break;
|
|
38
|
-
case "months":
|
|
39
|
-
format = "MM.YYYY";
|
|
40
|
-
break;
|
|
41
|
-
default:
|
|
42
|
-
format = "YYYY";
|
|
43
|
-
break;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const structure = [...Array(end.diff(start, intervalStepKey)).keys()];
|
|
47
|
-
|
|
48
|
-
const process = structure.reduce(
|
|
49
|
-
(acc, iteration) => {
|
|
50
|
-
acc.values.push(acc.point.format(format));
|
|
51
|
-
acc.point = moment(acc.point).add(1, intervalStepKey);
|
|
52
|
-
return acc;
|
|
53
|
-
},
|
|
54
|
-
{ point: start, values: [] },
|
|
55
|
-
);
|
|
56
|
-
|
|
57
|
-
return process.values;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
if (end.diff(start, "hours") <= NO_MORE_THAN_THREE_HOURS)
|
|
61
|
-
return getValues("minutes");
|
|
62
|
-
else if (end.diff(start, "hours") <= NO_MORE_THAN_TWO_DAYS)
|
|
63
|
-
return getValues("hours");
|
|
64
|
-
else if (end.diff(start, "months") <= NO_MORE_THAN_TWO_MONTHS)
|
|
65
|
-
return getValues("days");
|
|
66
|
-
else if (end.diff(start, "months") <= NO_MORE_THAN_THREE_YEARS)
|
|
67
|
-
return getValues("months");
|
|
68
|
-
else return getValues("years");
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
export const getMockValue = () => Math.trunc(Math.random() * 1000000);
|
|
72
|
-
|
|
73
|
-
export const getTab = async (tabId, range, callback) => {
|
|
74
|
-
let requestDelay;
|
|
75
|
-
switch (tabId) {
|
|
76
|
-
case "tab1":
|
|
77
|
-
requestDelay = 2000;
|
|
78
|
-
break;
|
|
79
|
-
case "tab2":
|
|
80
|
-
requestDelay = 1500;
|
|
81
|
-
break;
|
|
82
|
-
case "tab3":
|
|
83
|
-
requestDelay = 3000;
|
|
84
|
-
break;
|
|
85
|
-
case "tab4":
|
|
86
|
-
requestDelay = 500;
|
|
87
|
-
break;
|
|
88
|
-
default:
|
|
89
|
-
requestDelay = 1000;
|
|
90
|
-
break;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
return new Promise((res) =>
|
|
94
|
-
setTimeout(() => {
|
|
95
|
-
const labels = getLabels(range);
|
|
96
|
-
res({
|
|
97
|
-
labels,
|
|
98
|
-
datasets: [
|
|
99
|
-
{
|
|
100
|
-
data: labels.map(() => getMockValue()),
|
|
101
|
-
},
|
|
102
|
-
],
|
|
103
|
-
});
|
|
104
|
-
}, requestDelay),
|
|
105
|
-
).then((res) => (callback ? callback(res, tabId) : res));
|
|
106
|
-
};
|
|
1
|
+
var t,e;function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function n(t,e,r,n,a,o,i){try{var u=t[o](i),l=u.value}catch(t){r(t);return}u.done?e(l):Promise.resolve(l).then(n,a)}import a from"moment-timezone";import{getActualDateRange as o}from"../../../FormElements/InputDateRange/dependencies";export var getSafelyDateRange=function(t){return(null==t?void 0:t.start)&&(null==t?void 0:t.end)||(null==t?void 0:t.intervalKey)&&(null==t?void 0:t.intervalKey)!=="allTime"?o(t):o({start:"2022-01-01T00:00:00",end:a().endOf("day").format("YYYY-MM-DDTHH:mm:ss")})};export var getLabels=function(t){var e="hour",n=o(t),i=a(null==n?void 0:n.start).startOf(e),u=a(null==n?void 0:n.end).startOf(e),l=function(t){var e,n;switch(t){case"minutes":n="MM.DD hh:mm";break;case"hours":n="MM.DD.YYYY h A";break;case"days":n="MM.DD.YYYY";break;case"months":n="MM.YYYY";break;default:n="YYYY"}return((function(t){if(Array.isArray(t))return r(t)})(e=Array(u.diff(i,t)).keys())||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||function(t,e){if(t){if("string"==typeof t)return r(t,void 0);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(t,e)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).reduce(function(e,r){return e.values.push(e.point.format(n)),e.point=a(e.point).add(1,t),e},{point:i,values:[]}).values};return 3>=u.diff(i,"hours")?l("minutes"):48>=u.diff(i,"hours")?l("hours"):2>=u.diff(i,"months")?l("days"):24>=u.diff(i,"months")?l("months"):l("years")};export var getMockValue=function(){return Math.trunc(1e6*Math.random())};export var getTab=(t=function(t,e,r){var n;return function(t,e){var r,n,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=u(0),i.throw=u(1),i.return=u(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(u){return function(l){var s=[u,l];if(r)throw TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(o=0)),o;)try{if(r=1,n&&(a=2&s[0]?n.return:s[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,s[1])).done)return a;switch(n=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){o.label=s[1];break}if(6===s[0]&&o.label<a[1]){o.label=a[1],a=s;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(s);break}a[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t],n=0}finally{r=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}}(this,function(a){switch(t){case"tab1":n=2e3;break;case"tab2":n=1500;break;case"tab3":n=3e3;break;case"tab4":n=500;break;default:n=1e3}return[2,new Promise(function(t){return setTimeout(function(){var r=getLabels(e);t({labels:r,datasets:[{data:r.map(function(){return getMockValue()})}]})},n)}).then(function(e){return r?r(e,t):e})]})},e=function(){var e=this,r=arguments;return new Promise(function(a,o){var i=t.apply(e,r);function u(t){n(i,a,o,u,l,"next",t)}function l(t){n(i,a,o,u,l,"throw",t)}u(void 0)})},function(t,r,n){return e.apply(this,arguments)});
|
|
@@ -1,193 +1 @@
|
|
|
1
|
-
function e(e, t) {
|
|
2
|
-
(null == t || t > e.length) && (t = e.length);
|
|
3
|
-
for(var n = 0, r = Array(t); n < t; n++)r[n] = e[n];
|
|
4
|
-
return r;
|
|
5
|
-
}
|
|
6
|
-
function t(t, n) {
|
|
7
|
-
return function(e) {
|
|
8
|
-
if (Array.isArray(e)) return e;
|
|
9
|
-
}(t) || function(e, t) {
|
|
10
|
-
var n, r, i = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
|
|
11
|
-
if (null != i) {
|
|
12
|
-
var o = [], l = !0, u = !1;
|
|
13
|
-
try {
|
|
14
|
-
for(i = i.call(e); !(l = (n = i.next()).done) && (o.push(n.value), !t || o.length !== t); l = !0);
|
|
15
|
-
} catch (e) {
|
|
16
|
-
u = !0, r = e;
|
|
17
|
-
} finally{
|
|
18
|
-
try {
|
|
19
|
-
l || null == i.return || i.return();
|
|
20
|
-
} finally{
|
|
21
|
-
if (u) throw r;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
return o;
|
|
25
|
-
}
|
|
26
|
-
}(t, n) || function(t, n) {
|
|
27
|
-
if (t) {
|
|
28
|
-
if ("string" == typeof t) return e(t, n);
|
|
29
|
-
var r = Object.prototype.toString.call(t).slice(8, -1);
|
|
30
|
-
if ("Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r) return Array.from(r);
|
|
31
|
-
if ("Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return e(t, n);
|
|
32
|
-
}
|
|
33
|
-
}(t, n) || function() {
|
|
34
|
-
throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
35
|
-
}();
|
|
36
|
-
}
|
|
37
|
-
Object.defineProperty(exports, "__esModule", {
|
|
38
|
-
value: !0
|
|
39
|
-
}), Object.defineProperty(exports, "default", {
|
|
40
|
-
enumerable: !0,
|
|
41
|
-
get: function() {
|
|
42
|
-
return p;
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
var n = require("react/jsx-runtime"), r = d(require("classnames")), i = function(e, t) {
|
|
46
|
-
if (e && e.__esModule) return e;
|
|
47
|
-
if (null === e || (void 0 === e ? "undefined" : e && "undefined" != typeof Symbol && e.constructor === Symbol ? "symbol" : typeof e) != "object" && "function" != typeof e) return {
|
|
48
|
-
default: e
|
|
49
|
-
};
|
|
50
|
-
var n = f(t);
|
|
51
|
-
if (n && n.has(e)) return n.get(e);
|
|
52
|
-
var r = {
|
|
53
|
-
__proto__: null
|
|
54
|
-
}, i = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
55
|
-
for(var o in e)if ("default" !== o && Object.prototype.hasOwnProperty.call(e, o)) {
|
|
56
|
-
var l = i ? Object.getOwnPropertyDescriptor(e, o) : null;
|
|
57
|
-
l && (l.get || l.set) ? Object.defineProperty(r, o, l) : r[o] = e[o];
|
|
58
|
-
}
|
|
59
|
-
return r.default = e, n && n.set(e, r), r;
|
|
60
|
-
}(require("react")), o = require("react-dom"), l = require("react-feather"), u = require("../../../Functions/utils"), c = require("../../../Molecular/CustomIcons"), a = d(require("../../Layout/Spinner/Spinner")), s = require("./partials/_utils");
|
|
61
|
-
function d(e) {
|
|
62
|
-
return e && e.__esModule ? e : {
|
|
63
|
-
default: e
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
function f(e) {
|
|
67
|
-
if ("function" != typeof WeakMap) return null;
|
|
68
|
-
var t = new WeakMap(), n = new WeakMap();
|
|
69
|
-
return (f = function(e) {
|
|
70
|
-
return e ? n : t;
|
|
71
|
-
})(e);
|
|
72
|
-
}
|
|
73
|
-
require("./Hint.scss");
|
|
74
|
-
var v = !1, h = {};
|
|
75
|
-
function m() {}
|
|
76
|
-
var p = function(e) {
|
|
77
|
-
var d, f, p = e.hint, _ = e.side, b = void 0 === _ ? 'right' : _, y = e.className, g = e.hintContainer, x = void 0 === g ? h : g, C = e.label, j = void 0 === C ? '' : C, L = e.variant, k = void 0 === L ? 'filled' : L, M = e.handleOpenType, S = void 0 === M ? 'click' : M, N = e.onClickCallback, O = e.onOpenChange, w = void 0 === O ? m : O, T = e.key, E = e.id, H = e.children, q = e.icon, A = e.isAccessability, P = void 0 !== A && A, I = e.testId, B = void 0 === I ? 'hint' : I, W = e.isHoverableContent, D = void 0 !== W && W, F = e.isLoading, R = e.isCloseOnChildrenClick, z = (0, i.useRef)(null), U = (0, i.useRef)(null), $ = t((0, i.useState)(null != (f = null != T ? T : E) ? f : Math.random().toString(16).slice(2)), 1)[0], G = t((0, i.useState)(!1), 2), J = G[0], K = G[1], Q = t((0, i.useState)(new s.HandleScrollObj(K)), 1)[0], V = t((0, i.useState)(new s.HandleClickOutsideObj($, K)), 1)[0], X = 'function' == typeof N, Y = {
|
|
78
|
-
onMouseEnter: function() {
|
|
79
|
-
'hover' === S && (U.current = setTimeout(function() {
|
|
80
|
-
K(!0), J || null == N || N();
|
|
81
|
-
}, 350));
|
|
82
|
-
},
|
|
83
|
-
onMouseLeave: function() {
|
|
84
|
-
D || 'hover' !== S ? D && 'hover' === S && (null !== U.current && clearTimeout(U.current), U.current = setTimeout(function() {
|
|
85
|
-
v || K(!1);
|
|
86
|
-
}, 100)) : (null !== U.current && clearTimeout(U.current), U.current = setTimeout(function() {
|
|
87
|
-
K(!1);
|
|
88
|
-
}, 1000));
|
|
89
|
-
},
|
|
90
|
-
onMouseLeaveHoverableContent: function() {
|
|
91
|
-
D && 'hover' === S && (null !== U.current && clearTimeout(U.current), U.current = setTimeout(function() {
|
|
92
|
-
K(!1), v = !1;
|
|
93
|
-
}, 100));
|
|
94
|
-
},
|
|
95
|
-
onClick: void 0 !== R && R ? function() {
|
|
96
|
-
return K(!1);
|
|
97
|
-
} : function() {}
|
|
98
|
-
}, Z = function() {
|
|
99
|
-
var e, t, n, r, i = (0, s.getHintContainer)($);
|
|
100
|
-
if (!i || !J) return !1;
|
|
101
|
-
var o = (null == z ? void 0 : z.current) !== null ? null == z || null == (e = z.current) ? void 0 : e.getBoundingClientRect() : {}, l = o.width, u = void 0 === l ? 0 : l, c = o.top, a = void 0 === c ? 0 : c, d = o.left, f = void 0 === d ? 0 : d, v = null != x ? x : {}, h = v.addWidth, m = v.addLeft, p = v.addTop, _ = document.documentElement.clientWidth, y = document.documentElement.clientHeight, g = i.getElementsByClassName('hint__text')[0], C = (null == g ? void 0 : g.getBoundingClientRect()) || {}, j = C.width, L = C.height;
|
|
102
|
-
switch(i.style.width = J ? null == (t = (h && !Number.isNaN(+h) ? +h : 0) + u) ? void 0 : t.toString().concat('px') : '0', i.style.left = J ? null == (n = (m && !Number.isNaN(+m) ? +m : 0) + f) ? void 0 : n.toString().concat('px') : '0', i.style.top = J ? null == (r = (p && !Number.isNaN(+p) ? +p : 0) + a) ? void 0 : r.toString().concat('px') : '0', i.style.maxHeight = J ? null == L ? void 0 : L.toString().concat('px') : '0', b){
|
|
103
|
-
case 'top':
|
|
104
|
-
case 'centeredTop':
|
|
105
|
-
a - L - 10 < 0 && (g.classList.remove("hint__text_".concat(b)), g.classList.add("hint__text_".concat('top' === b ? 'bottom' : 'centeredBottom')));
|
|
106
|
-
break;
|
|
107
|
-
case 'bottom':
|
|
108
|
-
case 'centeredBottom':
|
|
109
|
-
a + L + 20 > y && (g.classList.remove("hint__text_".concat(b)), g.classList.add("hint__text_".concat('bottom' === b ? 'top' : 'centeredTop')));
|
|
110
|
-
break;
|
|
111
|
-
case 'left':
|
|
112
|
-
f - j - 10 < 0 && (g.classList.remove("hint__text_".concat(b)), g.classList.add('hint__text_right'));
|
|
113
|
-
break;
|
|
114
|
-
default:
|
|
115
|
-
f + u + j + 10 > _ && (g.classList.remove("hint__text_".concat(b)), g.classList.add('hint__text_left'));
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
return (0, i.useEffect)(function() {
|
|
119
|
-
return (0, s.initHintContainer)($, x), function() {
|
|
120
|
-
null !== U.current && clearTimeout(U.current);
|
|
121
|
-
};
|
|
122
|
-
}, []), (0, i.useEffect)(function() {
|
|
123
|
-
return Z(), null == w || w(J), J ? (document.addEventListener('scroll', Q, !0), document.addEventListener('click', V, !0)) : (document.removeEventListener('scroll', Q, !0), document.removeEventListener('click', V, !0)), function() {
|
|
124
|
-
null !== U.current && clearTimeout(U.current);
|
|
125
|
-
};
|
|
126
|
-
}, [
|
|
127
|
-
J
|
|
128
|
-
]), (0, n.jsxs)("div", {
|
|
129
|
-
"data-testid": B,
|
|
130
|
-
className: (0, r.default)('hint', y),
|
|
131
|
-
ref: z,
|
|
132
|
-
children: [
|
|
133
|
-
(0, n.jsxs)("button", {
|
|
134
|
-
tabIndex: P ? 0 : -1,
|
|
135
|
-
"data-testid": 'string' == typeof j && j.length ? null == (d = j.replace) ? void 0 : d.call(j, /\s/g, '-') : "".concat(B, "--button"),
|
|
136
|
-
"aria-label": P && 'string' == typeof j ? j : '',
|
|
137
|
-
onClick: function() {
|
|
138
|
-
return 'click' === S && (X ? null == N ? void 0 : N() : K(!J));
|
|
139
|
-
},
|
|
140
|
-
onMouseEnter: Y.onMouseEnter,
|
|
141
|
-
onMouseLeave: Y.onMouseLeave,
|
|
142
|
-
className: (0, r.default)('hint__button', {
|
|
143
|
-
hint__button_active: J
|
|
144
|
-
}),
|
|
145
|
-
children: [
|
|
146
|
-
q || null === q || (0, n.jsxs)(n.Fragment, {
|
|
147
|
-
children: [
|
|
148
|
-
'outlined' === k && (0, n.jsx)(l.HelpCircle, {
|
|
149
|
-
width: 16,
|
|
150
|
-
height: 16,
|
|
151
|
-
className: "hint__icon outlined"
|
|
152
|
-
}),
|
|
153
|
-
'filled' === k && (0, n.jsx)(c.HelpCircleFilled, {
|
|
154
|
-
className: "hint__icon filled"
|
|
155
|
-
}),
|
|
156
|
-
'warning' === k && (0, n.jsx)(l.AlertTriangle, {
|
|
157
|
-
className: "hint__icon",
|
|
158
|
-
color: "#F06D8D",
|
|
159
|
-
width: 16,
|
|
160
|
-
height: 16
|
|
161
|
-
})
|
|
162
|
-
]
|
|
163
|
-
}),
|
|
164
|
-
j && (0, n.jsx)("span", {
|
|
165
|
-
className: (0, r.default)('hint__label', {
|
|
166
|
-
'color--primary': J
|
|
167
|
-
}),
|
|
168
|
-
children: (0, u.capitalized)(j)
|
|
169
|
-
})
|
|
170
|
-
]
|
|
171
|
-
}),
|
|
172
|
-
J && function(e) {
|
|
173
|
-
var t = (0, s.getHintContainer)($);
|
|
174
|
-
return t ? (0, o.createPortal)((0, n.jsxs)("div", {
|
|
175
|
-
"data-testid": "test-hint-text",
|
|
176
|
-
className: (0, r.default)('hint__text', "hint__text_".concat(b), "hint--".concat(e, "__text")),
|
|
177
|
-
onMouseEnter: function() {
|
|
178
|
-
v = !0;
|
|
179
|
-
},
|
|
180
|
-
onMouseLeave: Y.onMouseLeaveHoverableContent,
|
|
181
|
-
onClick: Y.onClick,
|
|
182
|
-
children: [
|
|
183
|
-
F && (0, n.jsx)(a.default, {
|
|
184
|
-
size: "small"
|
|
185
|
-
}),
|
|
186
|
-
p,
|
|
187
|
-
H
|
|
188
|
-
]
|
|
189
|
-
}), t) : null;
|
|
190
|
-
}(y)
|
|
191
|
-
]
|
|
192
|
-
});
|
|
193
|
-
};
|
|
1
|
+
function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function t(t,n){return function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n,r,i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var o=[],l=!0,u=!1;try{for(i=i.call(e);!(l=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);l=!0);}catch(e){u=!0,r=e}finally{try{l||null==i.return||i.return()}finally{if(u)throw r}}return o}}(t,n)||function(t,n){if(t){if("string"==typeof t)return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);if("Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,n)}}(t,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return p}});var n=require("react/jsx-runtime"),r=d(require("classnames")),i=function(e,t){if(e&&e.__esModule)return e;if(null===e||(void 0===e?"undefined":e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)!="object"&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var l=i?Object.getOwnPropertyDescriptor(e,o):null;l&&(l.get||l.set)?Object.defineProperty(r,o,l):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}(require("react")),o=require("react-dom"),l=require("react-feather"),u=require("../../../Functions/utils"),c=require("../../../Molecular/CustomIcons"),a=d(require("../../Layout/Spinner/Spinner")),s=require("./partials/_utils");function d(e){return e&&e.__esModule?e:{default:e}}function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}require("./Hint.scss");var v=!1,h={};function m(){}var p=function(e){var d,f,p=e.hint,_=e.side,b=void 0===_?"right":_,y=e.className,g=e.hintContainer,x=void 0===g?h:g,C=e.label,j=void 0===C?"":C,L=e.variant,k=void 0===L?"filled":L,M=e.handleOpenType,S=void 0===M?"click":M,N=e.onClickCallback,O=e.onOpenChange,w=void 0===O?m:O,T=e.key,E=e.id,H=e.children,q=e.icon,A=e.isAccessability,P=void 0!==A&&A,I=e.testId,B=void 0===I?"hint":I,W=e.isHoverableContent,D=void 0!==W&&W,F=e.isLoading,R=e.isCloseOnChildrenClick,z=(0,i.useRef)(null),U=(0,i.useRef)(null),$=t((0,i.useState)(null!=(f=null!=T?T:E)?f:Math.random().toString(16).slice(2)),1)[0],G=t((0,i.useState)(!1),2),J=G[0],K=G[1],Q=t((0,i.useState)(new s.HandleScrollObj(K)),1)[0],V=t((0,i.useState)(new s.HandleClickOutsideObj($,K)),1)[0],X="function"==typeof N,Y={onMouseEnter:function(){"hover"===S&&(U.current=setTimeout(function(){K(!0),J||null==N||N()},350))},onMouseLeave:function(){D||"hover"!==S?D&&"hover"===S&&(null!==U.current&&clearTimeout(U.current),U.current=setTimeout(function(){v||K(!1)},100)):(null!==U.current&&clearTimeout(U.current),U.current=setTimeout(function(){K(!1)},1e3))},onMouseLeaveHoverableContent:function(){D&&"hover"===S&&(null!==U.current&&clearTimeout(U.current),U.current=setTimeout(function(){K(!1),v=!1},100))},onClick:void 0!==R&&R?function(){return K(!1)}:function(){}},Z=function(){var e,t,n,r,i=(0,s.getHintContainer)($);if(!i||!J)return!1;var o=(null==z?void 0:z.current)!==null?null==z||null==(e=z.current)?void 0:e.getBoundingClientRect():{},l=o.width,u=void 0===l?0:l,c=o.top,a=void 0===c?0:c,d=o.left,f=void 0===d?0:d,v=null!=x?x:{},h=v.addWidth,m=v.addLeft,p=v.addTop,_=document.documentElement.clientWidth,y=document.documentElement.clientHeight,g=i.getElementsByClassName("hint__text")[0],C=(null==g?void 0:g.getBoundingClientRect())||{},j=C.width,L=C.height;switch(i.style.width=J?null==(t=(h&&!Number.isNaN(+h)?+h:0)+u)?void 0:t.toString().concat("px"):"0",i.style.left=J?null==(n=(m&&!Number.isNaN(+m)?+m:0)+f)?void 0:n.toString().concat("px"):"0",i.style.top=J?null==(r=(p&&!Number.isNaN(+p)?+p:0)+a)?void 0:r.toString().concat("px"):"0",i.style.maxHeight=J?null==L?void 0:L.toString().concat("px"):"0",b){case"top":case"centeredTop":a-L-10<0&&(g.classList.remove("hint__text_".concat(b)),g.classList.add("hint__text_".concat("top"===b?"bottom":"centeredBottom")));break;case"bottom":case"centeredBottom":a+L+20>y&&(g.classList.remove("hint__text_".concat(b)),g.classList.add("hint__text_".concat("bottom"===b?"top":"centeredTop")));break;case"left":f-j-10<0&&(g.classList.remove("hint__text_".concat(b)),g.classList.add("hint__text_right"));break;default:f+u+j+10>_&&(g.classList.remove("hint__text_".concat(b)),g.classList.add("hint__text_left"))}};return(0,i.useEffect)(function(){return(0,s.initHintContainer)($,x),function(){null!==U.current&&clearTimeout(U.current)}},[]),(0,i.useEffect)(function(){return Z(),null==w||w(J),J?(document.addEventListener("scroll",Q,!0),document.addEventListener("click",V,!0)):(document.removeEventListener("scroll",Q,!0),document.removeEventListener("click",V,!0)),function(){null!==U.current&&clearTimeout(U.current)}},[J]),(0,n.jsxs)("div",{"data-testid":B,className:(0,r.default)("hint",y),ref:z,children:[(0,n.jsxs)("button",{tabIndex:P?0:-1,"data-testid":"string"==typeof j&&j.length?null==(d=j.replace)?void 0:d.call(j,/\s/g,"-"):"".concat(B,"--button"),"aria-label":P&&"string"==typeof j?j:"",onClick:function(){return"click"===S&&(X?null==N?void 0:N():K(!J))},onMouseEnter:Y.onMouseEnter,onMouseLeave:Y.onMouseLeave,className:(0,r.default)("hint__button",{hint__button_active:J}),children:[q||null===q||(0,n.jsxs)(n.Fragment,{children:["outlined"===k&&(0,n.jsx)(l.HelpCircle,{width:16,height:16,className:"hint__icon outlined"}),"filled"===k&&(0,n.jsx)(c.HelpCircleFilled,{className:"hint__icon filled"}),"warning"===k&&(0,n.jsx)(l.AlertTriangle,{className:"hint__icon",color:"#F06D8D",width:16,height:16})]}),j&&(0,n.jsx)("span",{className:(0,r.default)("hint__label",{"color--primary":J}),children:(0,u.capitalized)(j)})]}),J&&function(e){var t=(0,s.getHintContainer)($);return t?(0,o.createPortal)((0,n.jsxs)("div",{"data-testid":"test-hint-text",className:(0,r.default)("hint__text","hint__text_".concat(b),"hint--".concat(e,"__text")),onMouseEnter:function(){v=!0},onMouseLeave:Y.onMouseLeaveHoverableContent,onClick:Y.onClick,children:[F&&(0,n.jsx)(a.default,{size:"small"}),p,H]}),t):null}(y)]})};
|
|
@@ -1,51 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
value: !0
|
|
3
|
-
});
|
|
4
|
-
var n = exports, t = {
|
|
5
|
-
HandleClickOutsideObj: function() {
|
|
6
|
-
return d;
|
|
7
|
-
},
|
|
8
|
-
HandleScrollObj: function() {
|
|
9
|
-
return c;
|
|
10
|
-
},
|
|
11
|
-
getHintContainer: function() {
|
|
12
|
-
return r;
|
|
13
|
-
},
|
|
14
|
-
getHintContainerId: function() {
|
|
15
|
-
return i;
|
|
16
|
-
},
|
|
17
|
-
getParentNode: function() {
|
|
18
|
-
return o;
|
|
19
|
-
},
|
|
20
|
-
initHintContainer: function() {
|
|
21
|
-
return u;
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
for(var e in t)Object.defineProperty(n, e, {
|
|
25
|
-
enumerable: !0,
|
|
26
|
-
get: t[e]
|
|
27
|
-
});
|
|
28
|
-
var i = function(n) {
|
|
29
|
-
return "hint-container-for-hint--id-".concat(n);
|
|
30
|
-
};
|
|
31
|
-
function r(n) {
|
|
32
|
-
return document.getElementById(i(n));
|
|
33
|
-
}
|
|
34
|
-
function o() {
|
|
35
|
-
var n, t;
|
|
36
|
-
return null != (t = null != (n = document.querySelector('div#root')) ? n : document.querySelector('div#app')) ? t : document.body;
|
|
37
|
-
}
|
|
38
|
-
function u(n, t) {
|
|
39
|
-
var e, r = t.className, u = document.createElement('div');
|
|
40
|
-
u.setAttribute('id', i(n)), u.classList.add('hint__container'), r && u.classList.add(r), null == (e = o()) || e.append(u);
|
|
41
|
-
}
|
|
42
|
-
function c(n) {
|
|
43
|
-
this.setIsOpen = n, this.handleEvent = function() {
|
|
44
|
-
this.setIsOpen(!1);
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
function d(n, t) {
|
|
48
|
-
this.id = n, this.setIsOpen = t, this.handleEvent = function(n) {
|
|
49
|
-
r(this.id) && !r(this.id).contains(null == n ? void 0 : n.target) && this.setIsOpen(!1);
|
|
50
|
-
};
|
|
51
|
-
}
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0});var n=exports,t={HandleClickOutsideObj:function(){return d},HandleScrollObj:function(){return c},getHintContainer:function(){return r},getHintContainerId:function(){return i},getParentNode:function(){return o},initHintContainer:function(){return u}};for(var e in t)Object.defineProperty(n,e,{enumerable:!0,get:t[e]});var i=function(n){return"hint-container-for-hint--id-".concat(n)};function r(n){return document.getElementById(i(n))}function o(){var n,t;return null!=(t=null!=(n=document.querySelector("div#root"))?n:document.querySelector("div#app"))?t:document.body}function u(n,t){var e,r=t.className,u=document.createElement("div");u.setAttribute("id",i(n)),u.classList.add("hint__container"),r&&u.classList.add(r),null==(e=o())||e.append(u)}function c(n){this.setIsOpen=n,this.handleEvent=function(){this.setIsOpen(!1)}}function d(n,t){this.id=n,this.setIsOpen=t,this.handleEvent=function(n){r(this.id)&&!r(this.id).contains(null==n?void 0:n.target)&&this.setIsOpen(!1)}}
|