intelicoreact 1.6.22 → 1.6.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Atomic/FormElements/ActionAlert/ActionAlert.js +98 -1
- package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.js +48 -1
- package/dist/Atomic/FormElements/Calendar/Calendar.js +249 -1
- package/dist/Atomic/FormElements/Calendar/Calendar.props.js +4 -1
- package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.js +65 -1
- package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.js +52 -1
- package/dist/Atomic/FormElements/Datepicker/Datepicker.js +424 -1
- package/dist/Atomic/FormElements/Datepicker/Datepicker.props.js +4 -1
- package/dist/Atomic/FormElements/Datepicker/components/DatepickerCalendar.js +173 -1
- package/dist/Atomic/FormElements/Datepicker/components/DatepickerCalendar.props.js +4 -1
- package/dist/Atomic/FormElements/Dropdown/Dropdown.js +735 -1
- package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.js +20 -1
- package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.js +529 -1
- package/dist/Atomic/FormElements/FileLoader/FileLoader.js +94 -1
- package/dist/Atomic/FormElements/FileLoader/partial/LoadZone.js +105 -1
- package/dist/Atomic/FormElements/FileLoader/partial/LoadedContent.js +67 -1
- package/dist/Atomic/FormElements/FileLoaderDescription/FileLoaderDescription.js +247 -1
- package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.js +160 -1
- package/dist/Atomic/FormElements/FileLoaderLocalGroup/FileLoaderLocalGroup.js +193 -1
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.js +135 -1
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN_old.js +116 -1
- package/dist/Atomic/FormElements/Input/Input.js +467 -1
- package/dist/Atomic/FormElements/InputCalendar/InputCalendar.js +161 -1
- package/dist/Atomic/FormElements/InputColor/InputColor.js +64 -1
- package/dist/Atomic/FormElements/InputCurrency/InputCurrency.js +200 -1
- package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +354 -1
- package/dist/Atomic/FormElements/InputDateRange/components/DateInput.js +71 -1
- package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.js +693 -1
- package/dist/Atomic/FormElements/InputDateRange/components/OpenedPart.js +254 -1
- package/dist/Atomic/FormElements/InputDateRange/components/SelectItem.js +32 -1
- package/dist/Atomic/FormElements/InputDateRange/dependencies.js +200 -1
- package/dist/Atomic/FormElements/InputLink/InputLink.js +99 -1
- package/dist/Atomic/FormElements/InputMask/InputCarretPosition.js +37 -1
- package/dist/Atomic/FormElements/InputMask/InputMask.js +1214 -1
- package/dist/Atomic/FormElements/InputMask/config.js +15 -1
- package/dist/Atomic/FormElements/InputMask/functions.js +58 -1
- package/dist/Atomic/FormElements/InputMask2/InputMask2.js +674 -1
- package/dist/Atomic/FormElements/InputMask2/config.js +15 -1
- package/dist/Atomic/FormElements/InputMask2/functions.js +58 -1
- package/dist/Atomic/FormElements/InputMask3/InputMask3.js +766 -1
- package/dist/Atomic/FormElements/InputMask3/config.js +15 -1
- package/dist/Atomic/FormElements/InputMask3/functions.js +58 -1
- package/dist/Atomic/FormElements/InputWithAction/InputWithAction.js +114 -1
- package/dist/Atomic/FormElements/InputsRow/InputsRow.js +140 -1
- package/dist/Atomic/FormElements/Label/Label.js +87 -1
- package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +506 -1
- package/dist/Atomic/FormElements/MultiSelect/MultiSelect.js +45 -1
- package/dist/Atomic/FormElements/NumericInput/NumericInput.js +331 -1
- package/dist/Atomic/FormElements/RadioGroup/RadioGroup.js +66 -1
- package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +80 -1
- package/dist/Atomic/FormElements/RadioInput/RadioInput.js +57 -1
- package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.js +54 -1
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +183 -1
- package/dist/Atomic/FormElements/RangeInputs/RangeInputs.js +222 -1
- package/dist/Atomic/FormElements/RangeList/RangeList.js +175 -1
- package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.js +43 -1
- package/dist/Atomic/FormElements/RangeSlider/RangeSlider.js +443 -1
- package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +858 -1
- package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.js +39 -1
- package/dist/Atomic/FormElements/Switcher/Switcher.js +59 -1
- package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.js +50 -1
- package/dist/Atomic/FormElements/SwitcherHide/SwitcherHide.js +44 -1
- package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.js +100 -1
- package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.js +52 -1
- package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.js +64 -1
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.js +170 -1
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/partial/States.js +202 -1
- package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.js +67 -1
- package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.js +115 -1
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.interface.ts +2 -2
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +1110 -1
- package/dist/Atomic/FormElements/Text/Text.js +125 -1
- package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.js +49 -1
- package/dist/Atomic/FormElements/Textarea/Textarea.js +80 -1
- package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +176 -1
- package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.js +62 -1
- package/dist/Atomic/FormElements/TimeRange/TimeRange.js +119 -1
- package/dist/Atomic/FormElements/UserContacts/UserContacts.js +188 -1
- package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.js +83 -1
- package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.js +82 -1
- package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.js +101 -1
- package/dist/Atomic/FormElements/WidgetPseudoTable/partial/constructor.js +29 -1
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.js +113 -1
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/partial/constructor.js +30 -1
- package/dist/Atomic/Layout/Header/Header.js +85 -1
- package/dist/Atomic/Layout/Spinner/Spinner.js +44 -1
- package/dist/Atomic/UI/Accordion/Accordion.js +108 -1
- package/dist/Atomic/UI/Accordion/AccordionItem.js +176 -1
- package/dist/Atomic/UI/AccordionTable/AccordionTable.js +238 -1
- package/dist/Atomic/UI/AccordionText/AccordionText.js +69 -1
- package/dist/Atomic/UI/AdvancedTag/AdvTag.js +207 -1
- package/dist/Atomic/UI/AdvancedTag/AdvancedTags.js +56 -1
- package/dist/Atomic/UI/Alert/Alert.js +72 -1
- package/dist/Atomic/UI/Arrow/Arrow.js +132 -1
- package/dist/Atomic/UI/Box/Box.js +52 -1
- package/dist/Atomic/UI/Button/Button.js +47 -1
- package/dist/Atomic/UI/ButtonsBar/ButtonsBar.js +72 -1
- package/dist/Atomic/UI/Chart/Chart.js +172 -1
- package/dist/Atomic/UI/Chart/partial/Chart.constants.js +95 -1
- package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +80 -1
- package/dist/Atomic/UI/Chart/partial/datasetSetters.js +188 -1
- package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +335 -1
- package/dist/Atomic/UI/Chart/partial/optionsSetters.js +43 -1
- package/dist/Atomic/UI/Chart/partial/utils.js +60 -1
- package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +109 -1
- package/dist/Atomic/UI/DateTime/DateTime.js +57 -1
- package/dist/Atomic/UI/DebugContainer/DebugContainer.js +44 -1
- package/dist/Atomic/UI/DebugContainer/useDebugContainer.js +15 -1
- package/dist/Atomic/UI/DoubleString/DoubleString.js +102 -1
- package/dist/Atomic/UI/DynamicIcon/DynamicIcon.js +70 -1
- package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +221 -1
- package/dist/Atomic/UI/ExampleChartIntegration/partial/utils.js +106 -1
- package/dist/Atomic/UI/Hint/Hint.js +256 -1
- package/dist/Atomic/UI/Hint/partials/_utils.js +64 -1
- package/dist/Atomic/UI/Modal/Modal.js +179 -1
- package/dist/Atomic/UI/Modal/ModalHOC.js +97 -1
- package/dist/Atomic/UI/Modal/partials/ModalFooter.js +71 -1
- package/dist/Atomic/UI/Modal/partials/ModalTitle.js +110 -1
- package/dist/Atomic/UI/Modal/partials/useMobileModal.js +192 -1
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion._test.js +75 -1
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +80 -1
- package/dist/Atomic/UI/NavLine/NavLine.js +317 -1
- package/dist/Atomic/UI/PageTitle/PageTitle.js +77 -1
- package/dist/Atomic/UI/PieChart/PieChart.js +42 -1
- package/dist/Atomic/UI/Price/Price.js +31 -1
- package/dist/Atomic/UI/PriceRange/PriceRange.js +44 -1
- package/dist/Atomic/UI/ProgressLine/ProgressLine.js +98 -1
- package/dist/Atomic/UI/Status/Status.js +67 -1
- package/dist/Atomic/UI/Table/Partials/TdCell.js +87 -1
- package/dist/Atomic/UI/Table/Partials/TdHeader.js +38 -1
- package/dist/Atomic/UI/Table/Partials/TdRow.js +99 -1
- package/dist/Atomic/UI/Table/Partials/TdTitle.js +52 -1
- package/dist/Atomic/UI/Table/Table.js +63 -1
- package/dist/Atomic/UI/Table/TdTypes/TdActions.js +80 -1
- package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +28 -1
- package/dist/Atomic/UI/Table/TdTypes/TdRange.js +13 -1
- package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +53 -1
- package/dist/Atomic/UI/Tag/Tag.js +167 -1
- package/dist/Atomic/UI/TagList/TagList.js +251 -1
- package/dist/Atomic/UI/UserBox/UserBox.js +86 -1
- package/dist/Atomic/UI/WizardStepper/constructor.js +84 -1
- package/dist/Atomic/UI/WizardStepper/index.js +3 -1
- package/dist/Atomic/UI/WizardStepper/ui/StateIcon/StateIcon.js +37 -1
- package/dist/Atomic/UI/WizardStepper/ui/StateIcon/index.js +3 -1
- package/dist/Atomic/UI/WizardStepper/ui/StepRow/StepRow.js +61 -1
- package/dist/Atomic/UI/WizardStepper/ui/StepRow/index.js +3 -1
- package/dist/Atomic/UI/WizardStepper/ui/StepWrapper/StepWrapper.js +39 -1
- package/dist/Atomic/UI/WizardStepper/ui/StepWrapper/index.js +3 -1
- package/dist/Atomic/UI/WizardStepper/ui/icons.js +49 -1
- package/dist/Atomic/UI/WizardStepper/ui/index.js +3 -1
- package/dist/Classes/AbortableFetch.js +454 -1
- package/dist/Classes/AnimatedHandler.js +47 -1
- package/dist/Classes/RESTAPI/index.js +228 -1
- package/dist/Classes/RESTAPI/partials/AbortableFetch.js +457 -1
- package/dist/Classes/RESTAPI/partials/ApiBase.js +48 -1
- package/dist/Classes/RESTAPI/partials/ApiRequestCreators.js +112 -1
- package/dist/Classes/RESTAPI/partials/ApiUtils.js +189 -1
- package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +252 -1
- package/dist/Classes/RESTAPI/partials/Utils.js +92 -1
- package/dist/Classes/RESTAPI/partials/_outerDependencies.js +3 -1
- package/dist/Classes/RESTAPI/partials/_utils.js +197 -1
- package/dist/Constants/index.constants.js +78 -1
- package/dist/Functions/Portal.js +22 -1
- package/dist/Functions/customEventListener.js +96 -1
- package/dist/Functions/dateTime.js +149 -1
- package/dist/Functions/fieldValueFormatters.js +405 -1
- package/dist/Functions/guards/assertions.js +294 -1
- package/dist/Functions/guards/safeValue.js +75 -1
- package/dist/Functions/guards/typeGuards.js +373 -1
- package/dist/Functions/hooks/useFormFieldsChangesManager.js +95 -1
- package/dist/Functions/locale/createTranslator.js +32 -1
- package/dist/Functions/operations.js +130 -1
- package/dist/Functions/presets/inputMaskPresets.js +170 -1
- package/dist/Functions/presets/inputPresets.js +60 -1
- package/dist/Functions/presets/mobileKeyboardTypesPresets.js +45 -1
- package/dist/Functions/schemas.js +31 -1
- package/dist/Functions/useBodyScrollLock.js +17 -1
- package/dist/Functions/useClickOutside.js +15 -1
- package/dist/Functions/useDebounce.js +17 -1
- package/dist/Functions/useFieldFocus.js +84 -1
- package/dist/Functions/useFormTools/form-drivers/ArrayWithObjects.js +39 -1
- package/dist/Functions/useFormTools/form-drivers/ObjectWithIterableObjects.js +159 -1
- package/dist/Functions/useFormTools/form-drivers/ObjectWithNamedKeyObjects.js +78 -1
- package/dist/Functions/useFormTools/functions/General.js +134 -1
- package/dist/Functions/useFormTools/functions/RenderFields.js +111 -1
- package/dist/Functions/useFormTools/functions/usePrevious.js +12 -1
- package/dist/Functions/useFormTools/index.js +778 -1
- package/dist/Functions/useInputHighlightError.js +67 -1
- package/dist/Functions/useIsMobile/useIsMobile.js +33 -1
- package/dist/Functions/useKeyPress/useHandleKeyPress.js +52 -1
- package/dist/Functions/useKeyPress/useKeyPress.js +52 -1
- package/dist/Functions/useLocalStorage.js +34 -1
- package/dist/Functions/useLocationParams.js +27 -1
- package/dist/Functions/useMediaQuery.js +17 -1
- package/dist/Functions/useMetaInfo.js +43 -1
- package/dist/Functions/useMouseUpOutside.js +16 -1
- package/dist/Functions/useOnlineStatus.js +29 -1
- package/dist/Functions/usePasswordChecker.js +110 -1
- package/dist/Functions/usePrevious.js +12 -1
- package/dist/Functions/useResize.js +31 -1
- package/dist/Functions/useScrollTo.js +17 -1
- package/dist/Functions/useToggle.js +17 -1
- package/dist/Functions/utils.js +522 -1
- package/dist/Langs.js +168 -1
- package/dist/Molecular/CustomIcons/components/AffiliateNetworks.js +21 -1
- package/dist/Molecular/CustomIcons/components/AlertCircle.js +23 -1
- package/dist/Molecular/CustomIcons/components/AppStore.js +29 -1
- package/dist/Molecular/CustomIcons/components/Arrow.js +32 -1
- package/dist/Molecular/CustomIcons/components/ArrowDown.js +17 -1
- package/dist/Molecular/CustomIcons/components/ArrowLeft.js +22 -1
- package/dist/Molecular/CustomIcons/components/ArrowRight.js +22 -1
- package/dist/Molecular/CustomIcons/components/ArrowUp.js +17 -1
- package/dist/Molecular/CustomIcons/components/Bell.js +15 -1
- package/dist/Molecular/CustomIcons/components/Button.js +12 -1
- package/dist/Molecular/CustomIcons/components/Campaigns.js +16 -1
- package/dist/Molecular/CustomIcons/components/Check.js +14 -1
- package/dist/Molecular/CustomIcons/components/Check2.js +12 -1
- package/dist/Molecular/CustomIcons/components/ChevronDown.js +12 -1
- package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.js +11 -1
- package/dist/Molecular/CustomIcons/components/ChevronLeft.js +11 -1
- package/dist/Molecular/CustomIcons/components/ChevronRight.js +11 -1
- package/dist/Molecular/CustomIcons/components/ChevronUp.js +11 -1
- package/dist/Molecular/CustomIcons/components/ChevronUpDown.js +27 -1
- package/dist/Molecular/CustomIcons/components/Close.js +14 -1
- package/dist/Molecular/CustomIcons/components/ColumnsOrder.js +17 -1
- package/dist/Molecular/CustomIcons/components/Delete.js +16 -1
- package/dist/Molecular/CustomIcons/components/Edit.js +15 -1
- package/dist/Molecular/CustomIcons/components/Email.js +31 -1
- package/dist/Molecular/CustomIcons/components/FinturfLogo.js +18 -1
- package/dist/Molecular/CustomIcons/components/FinturfLogo2.js +35 -1
- package/dist/Molecular/CustomIcons/components/Flows.js +15 -1
- package/dist/Molecular/CustomIcons/components/Gift.js +25 -1
- package/dist/Molecular/CustomIcons/components/GoogleAuth.js +29 -1
- package/dist/Molecular/CustomIcons/components/GooglePlay.js +29 -1
- package/dist/Molecular/CustomIcons/components/HelpCircle.js +19 -1
- package/dist/Molecular/CustomIcons/components/HelpCircle2.js +20 -1
- package/dist/Molecular/CustomIcons/components/HelpCircleFilled.js +19 -1
- package/dist/Molecular/CustomIcons/components/Home.js +16 -1
- package/dist/Molecular/CustomIcons/components/Home2.js +22 -1
- package/dist/Molecular/CustomIcons/components/Key.js +23 -1
- package/dist/Molecular/CustomIcons/components/Landers.js +20 -1
- package/dist/Molecular/CustomIcons/components/Lock.js +15 -1
- package/dist/Molecular/CustomIcons/components/Mail.js +26 -1
- package/dist/Molecular/CustomIcons/components/Mastercard.js +73 -1
- package/dist/Molecular/CustomIcons/components/Minus.js +25 -1
- package/dist/Molecular/CustomIcons/components/Offers.js +16 -1
- package/dist/Molecular/CustomIcons/components/Pause.js +28 -1
- package/dist/Molecular/CustomIcons/components/PayPal.js +41 -1
- package/dist/Molecular/CustomIcons/components/PayPalLightLarge.js +28 -1
- package/dist/Molecular/CustomIcons/components/Phone.js +30 -1
- package/dist/Molecular/CustomIcons/components/Play.js +25 -1
- package/dist/Molecular/CustomIcons/components/Plus.js +25 -1
- package/dist/Molecular/CustomIcons/components/Profile.js +16 -1
- package/dist/Molecular/CustomIcons/components/QRCode.js +29 -1
- package/dist/Molecular/CustomIcons/components/Rectangle.js +12 -1
- package/dist/Molecular/CustomIcons/components/Revert.js +13 -1
- package/dist/Molecular/CustomIcons/components/Star.js +14 -1
- package/dist/Molecular/CustomIcons/components/Star2.js +16 -1
- package/dist/Molecular/CustomIcons/components/TrafficSources.js +14 -1
- package/dist/Molecular/CustomIcons/components/Trash.js +15 -1
- package/dist/Molecular/CustomIcons/components/TrashRed.js +15 -1
- package/dist/Molecular/CustomIcons/components/Triggers.js +15 -1
- package/dist/Molecular/CustomIcons/components/User.js +25 -1
- package/dist/Molecular/CustomIcons/components/Visa.js +31 -1
- package/dist/Molecular/CustomIcons/components/X.js +12 -1
- package/dist/Molecular/CustomIcons/index.js +61 -1
- package/dist/Molecular/FormElement/FormElement.js +54 -1
- package/dist/Molecular/FormWithDependOn/FormWithDependOn.js +184 -1
- package/dist/Molecular/FormWithDependOn/partials/_utils.js +53 -1
- package/dist/Molecular/InputAddress/InputAddress.js +626 -1
- package/dist/Molecular/InputPassword/InputPassword.js +48 -1
- package/dist/index.js +104 -1
- package/package.json +1 -1
- package/dist/Molecular/InputAddress/InputAddress.d.ts +0 -26
- package/dist/Molecular/InputAddress/InputAddress.js.map +0 -1
|
@@ -1 +1,16 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export const Star2 = (props) => (
|
|
3
|
+
<svg
|
|
4
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
5
|
+
xmlSpace="preserve"
|
|
6
|
+
viewBox="0 0 16 16"
|
|
7
|
+
{...props}
|
|
8
|
+
>
|
|
9
|
+
<path
|
|
10
|
+
fill="none"
|
|
11
|
+
stroke="#9AA0B9"
|
|
12
|
+
strokeMiterlimit={10}
|
|
13
|
+
d="m8 1.2 2.1 4.2 4.6.7-3.3 3.2.8 4.6L8 11.7l-4.1 2.2.8-4.6-3.4-3.2 4.6-.7L8 1.2z"
|
|
14
|
+
/>
|
|
15
|
+
</svg>
|
|
16
|
+
);
|
|
@@ -1 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export const TrafficSources = (props) => (
|
|
3
|
+
<svg
|
|
4
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
5
|
+
xmlSpace="preserve"
|
|
6
|
+
viewBox="0 0 16 16"
|
|
7
|
+
{...props}
|
|
8
|
+
>
|
|
9
|
+
<g fill="none" stroke="#9AA0B9">
|
|
10
|
+
<path d="M4.7 10.7 8 14l3.3-3.3" />
|
|
11
|
+
<path d="M.7 2.7h4.7c.7 0 1.4.3 1.9.8.4.4.7 1.1.7 1.8v8M15.3 2.7h-4.7c-.7 0-1.4.3-1.9.8S8 4.6 8 5.3v8" />
|
|
12
|
+
</g>
|
|
13
|
+
</svg>
|
|
14
|
+
);
|
|
@@ -1 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export const Trash = (props) => (
|
|
3
|
+
<svg
|
|
4
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
5
|
+
xmlSpace="preserve"
|
|
6
|
+
viewBox="0 0 16 16"
|
|
7
|
+
{...props}
|
|
8
|
+
>
|
|
9
|
+
<path
|
|
10
|
+
fill="none"
|
|
11
|
+
stroke="currentColor"
|
|
12
|
+
d="M2 4h12M5.3 4V2.7c0-.4.1-.7.4-.9.3-.3.6-.5 1-.5h2.7c.4 0 .7.1.9.4.3.3.4.6.4.9V4m2 0v9.3c0 .4-.1.7-.4.9-.3.3-.6.4-.9.4H4.7c-.4 0-.7-.1-.9-.4-.3-.3-.4-.6-.4-.9V4h9.3zM6.7 7.3v4M9.3 7.3v4"
|
|
13
|
+
/>
|
|
14
|
+
</svg>
|
|
15
|
+
);
|
|
@@ -1 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export const TrashRed = (props) => (
|
|
3
|
+
<svg
|
|
4
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
5
|
+
xmlSpace="preserve"
|
|
6
|
+
viewBox="0 0 16 16"
|
|
7
|
+
{...props}
|
|
8
|
+
>
|
|
9
|
+
<path
|
|
10
|
+
fill="none"
|
|
11
|
+
stroke="#F06D8D"
|
|
12
|
+
d="M2 4h12M5.3 4V2.7c0-.4.1-.7.4-.9.3-.3.6-.5 1-.5h2.7c.4 0 .7.1.9.4.3.3.4.6.4.9V4m2 0v9.3c0 .4-.1.7-.4.9-.3.3-.6.4-.9.4H4.7c-.4 0-.7-.1-.9-.4-.3-.3-.4-.6-.4-.9V4h9.3zM6.7 7.3v4M9.3 7.3v4"
|
|
13
|
+
/>
|
|
14
|
+
</svg>
|
|
15
|
+
);
|
|
@@ -1 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export const Triggers = (props) => (
|
|
3
|
+
<svg
|
|
4
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
5
|
+
xmlSpace="preserve"
|
|
6
|
+
viewBox="0 0 24 24"
|
|
7
|
+
{...props}
|
|
8
|
+
>
|
|
9
|
+
<path
|
|
10
|
+
fill="none"
|
|
11
|
+
stroke="#9AA0B9"
|
|
12
|
+
d="M4 21v-7M4 10V3M12 21v-9M12 8V3M20 21v-5M20 12V3M1 14h6M9 8h6M17 16h6"
|
|
13
|
+
/>
|
|
14
|
+
</svg>
|
|
15
|
+
);
|
|
@@ -1 +1,25 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export const User = (props) => (
|
|
3
|
+
<svg
|
|
4
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
5
|
+
xmlSpace="preserve"
|
|
6
|
+
id="Layer_1"
|
|
7
|
+
x={0}
|
|
8
|
+
y={0}
|
|
9
|
+
style={{
|
|
10
|
+
enableBackground: "new 0 0 16 16",
|
|
11
|
+
}}
|
|
12
|
+
viewBox="0 0 16 16"
|
|
13
|
+
{...props}
|
|
14
|
+
>
|
|
15
|
+
<style>
|
|
16
|
+
{
|
|
17
|
+
".st0{fill:none;stroke:#9aa0b9;strokeWidth:1.07;strokeLinecap:round;strokeLinejoin:round}"
|
|
18
|
+
}
|
|
19
|
+
</style>
|
|
20
|
+
<path
|
|
21
|
+
d="M13.3 14v-1.3a2.732 2.732 0 0 0-2.7-2.7H5.3a2.732 2.732 0 0 0-2.7 2.7V14M8 7.3c1.5 0 2.7-1.2 2.7-2.7S9.5 2 8 2 5.3 3.2 5.3 4.7 6.5 7.3 8 7.3z"
|
|
22
|
+
className="st0"
|
|
23
|
+
/>
|
|
24
|
+
</svg>
|
|
25
|
+
);
|
|
@@ -1 +1,31 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export const Visa = (props) => (
|
|
3
|
+
<svg
|
|
4
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
5
|
+
width={38}
|
|
6
|
+
height={24}
|
|
7
|
+
fill="none"
|
|
8
|
+
{...props}
|
|
9
|
+
>
|
|
10
|
+
<g fillRule="evenodd" clipPath="url(#a)" clipRule="evenodd">
|
|
11
|
+
<path
|
|
12
|
+
fill="#fff"
|
|
13
|
+
d="M0 1.784C0 .799.799 0 1.784 0H36.27c.985 0 1.784.799 1.784 1.784v21.405c0 .985-.799 1.784-1.784 1.784H1.784A1.784 1.784 0 0 1 0 23.189V1.784Z"
|
|
14
|
+
/>
|
|
15
|
+
<path
|
|
16
|
+
fill="#0071CE"
|
|
17
|
+
d="M23.325 9.21a4.132 4.132 0 0 0-1.543-.291c-1.702 0-2.9.938-2.91 2.281-.01.994.855 1.548 1.508 1.878.67.339.896.555.893.858-.004.463-.535.675-1.03.675-.69 0-1.055-.104-1.622-.363l-.221-.11-.24 1.548c.4.192 1.145.36 1.917.368 1.81 0 2.984-.927 2.998-2.36.006-.789-.452-1.386-1.446-1.88-.601-.32-.97-.532-.966-.856 0-.288.311-.595.986-.595.563-.01.97.125 1.288.265l.155.08.233-1.499Zm-7.966 6.742 1.077-6.913h1.721l-1.077 6.913H15.36Zm10.944-4.383s-.543 1.535-.685 1.932h1.429c-.068-.346-.399-1.995-.399-1.995l-.116-.597c-.046.137-.11.318-.158.456v.001a4.467 4.467 0 0 0-.07.203Zm1.438-2.523h-1.33c-.413 0-.722.123-.902.573l-2.557 6.335h1.808s.295-.852.362-1.04l.994.002 1.211.002c.052.242.21 1.036.21 1.036h1.598L27.74 9.046Zm-13.826 0-1.685 4.712-.18-.958-.001-.003-.603-3.173c-.104-.438-.407-.568-.78-.583H7.888l-.023.143c.676.179 1.28.437 1.81.758l1.53 6.004 1.822-.002 2.711-6.899h-1.824Z"
|
|
18
|
+
/>
|
|
19
|
+
<path
|
|
20
|
+
fill="#E5E5E5"
|
|
21
|
+
fillOpacity={0.01}
|
|
22
|
+
d="M0 1.784C0 .799.799 0 1.784 0H36.27c.985 0 1.784.799 1.784 1.784v21.405c0 .985-.799 1.784-1.784 1.784H1.784A1.784 1.784 0 0 1 0 23.189V1.784Z"
|
|
23
|
+
/>
|
|
24
|
+
</g>
|
|
25
|
+
<defs>
|
|
26
|
+
<clipPath id="a">
|
|
27
|
+
<path fill="#fff" d="M0 0h38v24H0z" />
|
|
28
|
+
</clipPath>
|
|
29
|
+
</defs>
|
|
30
|
+
</svg>
|
|
31
|
+
);
|
|
@@ -1 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export const X = (props) => (
|
|
3
|
+
<svg
|
|
4
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
5
|
+
width={16}
|
|
6
|
+
height={16}
|
|
7
|
+
fill="none"
|
|
8
|
+
{...props}
|
|
9
|
+
>
|
|
10
|
+
<path stroke="#000" d="m12 4-8 8M4 4l8 8" />
|
|
11
|
+
</svg>
|
|
12
|
+
);
|
|
@@ -1 +1,61 @@
|
|
|
1
|
-
export*from"./components/AffiliateNetworks";
|
|
1
|
+
export * from "./components/AffiliateNetworks";
|
|
2
|
+
export * from "./components/AlertCircle";
|
|
3
|
+
export * from "./components/AppStore";
|
|
4
|
+
export * from "./components/Arrow";
|
|
5
|
+
export * from "./components/ArrowDown";
|
|
6
|
+
export * from "./components/ArrowLeft";
|
|
7
|
+
export * from "./components/ArrowRight";
|
|
8
|
+
export * from "./components/ArrowUp";
|
|
9
|
+
export * from "./components/Bell";
|
|
10
|
+
export * from "./components/Button";
|
|
11
|
+
export * from "./components/Campaigns";
|
|
12
|
+
export * from "./components/Check";
|
|
13
|
+
export * from "./components/Check2";
|
|
14
|
+
export * from "./components/ChevronDown";
|
|
15
|
+
export * from "./components/ChevronDownDisabled";
|
|
16
|
+
export * from "./components/ChevronLeft";
|
|
17
|
+
export * from "./components/ChevronRight";
|
|
18
|
+
export * from "./components/ChevronUp";
|
|
19
|
+
export * from "./components/ChevronUpDown";
|
|
20
|
+
export * from "./components/Close";
|
|
21
|
+
export * from "./components/ColumnsOrder";
|
|
22
|
+
export * from "./components/Delete";
|
|
23
|
+
export * from "./components/Edit";
|
|
24
|
+
export * from "./components/Email";
|
|
25
|
+
export * from "./components/FinturfLogo";
|
|
26
|
+
export * from "./components/FinturfLogo2";
|
|
27
|
+
export * from "./components/Flows";
|
|
28
|
+
export * from "./components/Gift";
|
|
29
|
+
export * from "./components/GoogleAuth";
|
|
30
|
+
export * from "./components/GooglePlay";
|
|
31
|
+
export * from "./components/HelpCircle";
|
|
32
|
+
export * from "./components/HelpCircle2";
|
|
33
|
+
export * from "./components/HelpCircleFilled";
|
|
34
|
+
export * from "./components/Home";
|
|
35
|
+
export * from "./components/Home2";
|
|
36
|
+
export * from "./components/Key";
|
|
37
|
+
export * from "./components/Landers";
|
|
38
|
+
export * from "./components/Lock";
|
|
39
|
+
export * from "./components/Mail";
|
|
40
|
+
export * from "./components/Mastercard";
|
|
41
|
+
export * from "./components/Minus";
|
|
42
|
+
export * from "./components/Offers";
|
|
43
|
+
export * from "./components/Pause";
|
|
44
|
+
export * from "./components/PayPal";
|
|
45
|
+
export * from "./components/PayPalLightLarge";
|
|
46
|
+
export * from "./components/Phone";
|
|
47
|
+
export * from "./components/Play";
|
|
48
|
+
export * from "./components/Plus";
|
|
49
|
+
export * from "./components/Profile";
|
|
50
|
+
export * from "./components/QRCode";
|
|
51
|
+
export * from "./components/Rectangle";
|
|
52
|
+
export * from "./components/Revert";
|
|
53
|
+
export * from "./components/Star";
|
|
54
|
+
export * from "./components/Star2";
|
|
55
|
+
export * from "./components/TrafficSources";
|
|
56
|
+
export * from "./components/Trash";
|
|
57
|
+
export * from "./components/TrashRed";
|
|
58
|
+
export * from "./components/Triggers";
|
|
59
|
+
export * from "./components/User";
|
|
60
|
+
export * from "./components/Visa";
|
|
61
|
+
export * from "./components/X";
|
|
@@ -1 +1,54 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import cn from "classnames";
|
|
4
|
+
|
|
5
|
+
import Label from "../../Atomic/FormElements/Label/Label";
|
|
6
|
+
|
|
7
|
+
import Alert from "./../../Atomic/UI/Alert/Alert";
|
|
8
|
+
|
|
9
|
+
import "./FormElement.scss";
|
|
10
|
+
|
|
11
|
+
const RC = "form-element";
|
|
12
|
+
|
|
13
|
+
const FormElement = ({
|
|
14
|
+
label,
|
|
15
|
+
required,
|
|
16
|
+
children,
|
|
17
|
+
error,
|
|
18
|
+
className,
|
|
19
|
+
hint,
|
|
20
|
+
isLabelBolt,
|
|
21
|
+
isNoLabel,
|
|
22
|
+
alert,
|
|
23
|
+
onClickHintCallback,
|
|
24
|
+
note,
|
|
25
|
+
}) => {
|
|
26
|
+
return (
|
|
27
|
+
<div className={cn(className, RC)}>
|
|
28
|
+
{label && !isNoLabel && (
|
|
29
|
+
<Label
|
|
30
|
+
className={`${RC}__label`}
|
|
31
|
+
label={label}
|
|
32
|
+
hint={hint}
|
|
33
|
+
note={note}
|
|
34
|
+
isRequired={required}
|
|
35
|
+
isLabelBolt={isLabelBolt}
|
|
36
|
+
onClickHintCallback={onClickHintCallback}
|
|
37
|
+
/>
|
|
38
|
+
)}
|
|
39
|
+
{children}
|
|
40
|
+
{error && (
|
|
41
|
+
<span
|
|
42
|
+
className={cn(`${RC}__error`, {
|
|
43
|
+
[`${RC}__error--with-alert`]: alert,
|
|
44
|
+
})}
|
|
45
|
+
>
|
|
46
|
+
{error}
|
|
47
|
+
</span>
|
|
48
|
+
)}
|
|
49
|
+
{alert && <Alert className={`${RC}__alert`} {...alert} />}
|
|
50
|
+
</div>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export default FormElement;
|
|
@@ -1 +1,184 @@
|
|
|
1
|
-
|
|
1
|
+
// global
|
|
2
|
+
import React, { useEffect, useState } from "react";
|
|
3
|
+
|
|
4
|
+
import cn from "classnames";
|
|
5
|
+
|
|
6
|
+
import useFormFieldsChangesManager from "../../Functions/hooks/useFormFieldsChangesManager";
|
|
7
|
+
import { clone, getIsOnlyAnObject } from "../../Functions/utils";
|
|
8
|
+
|
|
9
|
+
// local functions
|
|
10
|
+
import { getDependOnStarter } from "./partials/_utils";
|
|
11
|
+
|
|
12
|
+
const RC = "form-with-depend-on";
|
|
13
|
+
|
|
14
|
+
const FormWithDependOn = React.forwardRef(
|
|
15
|
+
(
|
|
16
|
+
{
|
|
17
|
+
form,
|
|
18
|
+
formId,
|
|
19
|
+
setForm,
|
|
20
|
+
|
|
21
|
+
//! Рекомендую НЕ использовать, пока что работает плохо
|
|
22
|
+
//? По задумке вводилась для коррекции формы при асинхронных последовательных зависимостях
|
|
23
|
+
// todo(VL) - как-нибудь попробовать допилить
|
|
24
|
+
getActualForm: getActualFormOuter,
|
|
25
|
+
|
|
26
|
+
onChange,
|
|
27
|
+
renderField,
|
|
28
|
+
|
|
29
|
+
getAnotherActions,
|
|
30
|
+
|
|
31
|
+
className,
|
|
32
|
+
isInitializeByDependOn,
|
|
33
|
+
isFormDisabled,
|
|
34
|
+
typeOfUse = "default",
|
|
35
|
+
},
|
|
36
|
+
ref,
|
|
37
|
+
) => {
|
|
38
|
+
// ? Прихраниваем состояние формы на момент входа
|
|
39
|
+
const [initialForm] = useState(clone(form));
|
|
40
|
+
|
|
41
|
+
const safelySetForm = typeof setForm === "function" ? setForm : () => {};
|
|
42
|
+
const safelyOnChange = typeof onChange === "function" ? onChange : () => {};
|
|
43
|
+
|
|
44
|
+
const getActualForm = typeof getActualFormOuter === "function" ? getActualFormOuter : () => form;
|
|
45
|
+
|
|
46
|
+
const { assignChangesToField } = useFormFieldsChangesManager({
|
|
47
|
+
form: Array.isArray(form) ? form : [],
|
|
48
|
+
setForm: safelySetForm,
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
const assign = assignChangesToField;
|
|
52
|
+
|
|
53
|
+
// ***** handlers *****
|
|
54
|
+
|
|
55
|
+
const anotherActions = typeof getAnotherActions === "function"
|
|
56
|
+
? getAnotherActions({ setForm, assign, getActualForm })
|
|
57
|
+
: {};
|
|
58
|
+
|
|
59
|
+
const getMainOfAdditional = (onChange, additionalOfOnChange) => ({
|
|
60
|
+
formId,
|
|
61
|
+
actions: anotherActions,
|
|
62
|
+
isInit: true,
|
|
63
|
+
...(getIsOnlyAnObject(additionalOfOnChange) ? additionalOfOnChange : {}),
|
|
64
|
+
onChange,
|
|
65
|
+
setForm: safelySetForm,
|
|
66
|
+
assign,
|
|
67
|
+
getActualForm,
|
|
68
|
+
initialForm,
|
|
69
|
+
typeOfUse,
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
const startDependOn = getDependOnStarter({ assign, getActualForm });
|
|
73
|
+
|
|
74
|
+
// ? Местный handleChange добавляет логику dependOn к верхнему onChange,
|
|
75
|
+
// ? а так же запускает прочие экшены, из объекта методов, возвращаемым getAnotherActions
|
|
76
|
+
const handleChange = (
|
|
77
|
+
newValue,
|
|
78
|
+
fieldKey,
|
|
79
|
+
propKey,
|
|
80
|
+
additionalOfOnChange,
|
|
81
|
+
) => {
|
|
82
|
+
const {
|
|
83
|
+
updatedForm = null,
|
|
84
|
+
isMakeChangesAnyway = false,
|
|
85
|
+
isUseActualForm = false,
|
|
86
|
+
} = getIsOnlyAnObject(additionalOfOnChange) ? additionalOfOnChange : {};
|
|
87
|
+
|
|
88
|
+
const currentForm = clone(
|
|
89
|
+
(() => {
|
|
90
|
+
if (isUseActualForm) return getActualForm();
|
|
91
|
+
return Array.isArray(updatedForm) ? updatedForm : form;
|
|
92
|
+
})(),
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
const currField = clone(currentForm.find(field => field.key === fieldKey));
|
|
96
|
+
|
|
97
|
+
// ? Защита от дублирующих вызовов onChange снизу
|
|
98
|
+
// ? "Если newValue такое же как уже есть и нет флага "применять изменения всегда""
|
|
99
|
+
// ! (*) - Важно !
|
|
100
|
+
// ! Отключайте прямую мутацию на уровне проектного FormItem (в каждом филде указать isNotUseInnerHandler: true)
|
|
101
|
+
// ! т.к. тот хендлер запускатся раньше и сюда филд доходит с измененным значением,
|
|
102
|
+
// ! а значит не пройдет эту if-ку
|
|
103
|
+
if (currField[propKey || "value"] === newValue && !isMakeChangesAnyway) return;
|
|
104
|
+
|
|
105
|
+
// ? Сразу же мутируем
|
|
106
|
+
safelyOnChange(newValue, fieldKey, propKey, { ...additionalOfOnChange, updatedForm: currentForm });
|
|
107
|
+
|
|
108
|
+
// ? Механика dependOn (обработка зависимостей)
|
|
109
|
+
// ? В текущей реализации отделил от экшена all.
|
|
110
|
+
|
|
111
|
+
startDependOn({
|
|
112
|
+
newValue,
|
|
113
|
+
fieldKey,
|
|
114
|
+
propKey,
|
|
115
|
+
field: currField,
|
|
116
|
+
form: currentForm,
|
|
117
|
+
additional: getMainOfAdditional(handleChange, additionalOfOnChange),
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
// ? Если в объекте методов возвращаемом getAnotherActions есть метод all, то он запускается отдельно
|
|
121
|
+
if (typeof anotherActions.all === "function") {
|
|
122
|
+
anotherActions.all({
|
|
123
|
+
newValue,
|
|
124
|
+
fieldKey,
|
|
125
|
+
propKey,
|
|
126
|
+
field: currField,
|
|
127
|
+
form: currentForm,
|
|
128
|
+
additional: getMainOfAdditional(handleChange, additionalOfOnChange),
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if (fieldKey in anotherActions && typeof anotherActions[fieldKey] === "function") {
|
|
133
|
+
const postChanges = anotherActions[fieldKey]({
|
|
134
|
+
newValue,
|
|
135
|
+
fieldKey,
|
|
136
|
+
propKey,
|
|
137
|
+
field: currField,
|
|
138
|
+
form: currentForm,
|
|
139
|
+
additional: getMainOfAdditional(handleChange, additionalOfOnChange),
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
if (postChanges) assign(postChanges, fieldKey);
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
// ***** useEffects *****
|
|
147
|
+
|
|
148
|
+
useEffect(() => {
|
|
149
|
+
if (isInitializeByDependOn && typeof setForm === "function" && typeof onChange === "function")
|
|
150
|
+
form.forEach(field => {
|
|
151
|
+
startDependOn({
|
|
152
|
+
newValue: field.value,
|
|
153
|
+
fieldKey: field.key,
|
|
154
|
+
field,
|
|
155
|
+
form,
|
|
156
|
+
additional: {
|
|
157
|
+
...getMainOfAdditional(handleChange),
|
|
158
|
+
isInitialization: true,
|
|
159
|
+
isInit: false,
|
|
160
|
+
},
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
}, [isInitializeByDependOn]);
|
|
164
|
+
|
|
165
|
+
// ***** output *****
|
|
166
|
+
return (
|
|
167
|
+
<div {...(formId ? { id: formId } : {})} className={cn(RC, className)}>
|
|
168
|
+
{typeof renderField === "function"
|
|
169
|
+
? form.map(field =>
|
|
170
|
+
renderField({
|
|
171
|
+
...getMainOfAdditional(handleChange),
|
|
172
|
+
field: {
|
|
173
|
+
...field,
|
|
174
|
+
disabled: Boolean(isFormDisabled || field.disabled),
|
|
175
|
+
},
|
|
176
|
+
}),
|
|
177
|
+
)
|
|
178
|
+
: null}
|
|
179
|
+
</div>
|
|
180
|
+
);
|
|
181
|
+
},
|
|
182
|
+
);
|
|
183
|
+
|
|
184
|
+
export default FormWithDependOn;
|
|
@@ -1 +1,53 @@
|
|
|
1
|
-
|
|
1
|
+
import { getIsOnlyAnObject } from "../../../Functions/utils";
|
|
2
|
+
|
|
3
|
+
export const getDependOnStarter = (props) => {
|
|
4
|
+
const { assign } = props;
|
|
5
|
+
|
|
6
|
+
return ({ newValue, fieldKey, propKey, field, form, additional }) => {
|
|
7
|
+
if (field.isDominantField) {
|
|
8
|
+
const dependFields = form.filter((f) =>
|
|
9
|
+
f.dependOn?.keys?.includes?.(fieldKey),
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
if (dependFields.length > 0) {
|
|
13
|
+
const { isNotResetErrors } = additional;
|
|
14
|
+
dependFields.forEach((dependField) => {
|
|
15
|
+
// ! Для звисимого филда есть 2 способа назначить обработчик
|
|
16
|
+
|
|
17
|
+
// ? - прописать в объекте dependOn callback, который будет вызываться для каждой зависимости,
|
|
18
|
+
// ? а уже внутри самого колбэка разбираться, для какой имменно зависимости вызван обработчик
|
|
19
|
+
|
|
20
|
+
// ? - прописать в объекте dependOn пропу callbacks, передать в нее объект в формате
|
|
21
|
+
// ? { ... [ключ_доминирующего_поля]: соответствующий_коллбэк, ... }
|
|
22
|
+
// ? таким образом для каждой зависимости будет вызван свой обработчик
|
|
23
|
+
const execute =
|
|
24
|
+
dependField.dependOn.callbacks?.[fieldKey] ??
|
|
25
|
+
dependField.dependOn.callback;
|
|
26
|
+
|
|
27
|
+
// ? Пытаемся получить объект изменений и если они приходят - назначаем.
|
|
28
|
+
// ? Выбранная конструкция позволяет обрабатывать обычные и асинхронные колбеки вразнобой,
|
|
29
|
+
// ? причем не ожидая выполнения предыдущих
|
|
30
|
+
new Promise((resolve) => {
|
|
31
|
+
resolve(
|
|
32
|
+
execute?.(
|
|
33
|
+
{
|
|
34
|
+
...field,
|
|
35
|
+
[propKey || "value"]: newValue,
|
|
36
|
+
...(!isNotResetErrors ? { error: "" } : {}),
|
|
37
|
+
},
|
|
38
|
+
dependField,
|
|
39
|
+
form,
|
|
40
|
+
{ ...additional, propKey },
|
|
41
|
+
),
|
|
42
|
+
);
|
|
43
|
+
})
|
|
44
|
+
.then((changes) => {
|
|
45
|
+
if (getIsOnlyAnObject(changes)) assign(changes, dependField.key);
|
|
46
|
+
return changes;
|
|
47
|
+
})
|
|
48
|
+
.catch(() => {});
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
};
|