intelicoreact 1.3.22 → 1.3.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 +5 -8
- package/dist/Atomic/FormElements/ActionAlert/ActionAlert.scss +9 -9
- package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.js +6 -9
- package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.scss +8 -10
- package/dist/Atomic/FormElements/Calendar/Calendar.js +31 -33
- package/dist/Atomic/FormElements/Calendar/Calendar.scss +23 -27
- package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.js +4 -4
- package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.scss +16 -19
- package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.js +1 -1
- package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.scss +2 -2
- package/dist/Atomic/FormElements/Datepicker/Datepicker.js +53 -53
- package/dist/Atomic/FormElements/Datepicker/Datepicker.scss +0 -8
- package/dist/Atomic/FormElements/Datepicker/components/Calendar.js +20 -20
- package/dist/Atomic/FormElements/Dropdown/Dropdown.js +81 -83
- package/dist/Atomic/FormElements/Dropdown/Dropdown.scss +141 -95
- package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.js +1 -1
- package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.scss +3 -3
- package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.js +30 -28
- package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.scss +54 -18
- package/dist/Atomic/FormElements/FileLoader/FileLoader.js +4 -4
- package/dist/Atomic/FormElements/FileLoader/FileLoader.scss +31 -30
- package/dist/Atomic/FormElements/FileLoader/partial/LoadZone.js +12 -12
- package/dist/Atomic/FormElements/FileLoader/partial/LoadedContent.js +3 -3
- package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.js +8 -8
- package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.scss +44 -29
- package/dist/Atomic/FormElements/FileLoaderLocalGroup/FileLoaderLocalGroup.js +17 -15
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.js +15 -15
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.scss +24 -21
- package/dist/Atomic/FormElements/Input/Input.js +43 -45
- package/dist/Atomic/FormElements/Input/Input.scss +18 -18
- package/dist/Atomic/FormElements/InputCalendar/InputCalendar.js +19 -19
- package/dist/Atomic/FormElements/InputColor/InputColor.js +7 -9
- package/dist/Atomic/FormElements/InputCurrency/InputCurrency.js +12 -12
- package/dist/Atomic/FormElements/InputCurrency/InputCurrency.scss +9 -6
- package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +42 -42
- package/dist/Atomic/FormElements/InputDateRange/InputDateRange.scss +95 -95
- package/dist/Atomic/FormElements/InputDateRange/components/DateInput.js +10 -10
- package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.js +81 -81
- package/dist/Atomic/FormElements/InputDateRange/components/OpenedPart.js +14 -14
- package/dist/Atomic/FormElements/InputDateRange/components/SelectItem.js +4 -4
- package/dist/Atomic/FormElements/InputDateRange/dependencies.js +54 -54
- package/dist/Atomic/FormElements/InputLink/InputLink.js +11 -13
- package/dist/Atomic/FormElements/InputLink/InputLink.scss +5 -5
- package/dist/Atomic/FormElements/InputMask/InputCarretPosition.js +2 -2
- package/dist/Atomic/FormElements/InputMask/InputMask.js +66 -67
- package/dist/Atomic/FormElements/InputMask/InputMask.scss +10 -10
- package/dist/Atomic/FormElements/InputMask/config.js +9 -9
- package/dist/Atomic/FormElements/InputMask/functions.js +8 -7
- package/dist/Atomic/FormElements/InputMask2/InputMask2.js +42 -42
- package/dist/Atomic/FormElements/InputMask2/InputMask2.scss +13 -12
- package/dist/Atomic/FormElements/InputMask2/config.js +9 -9
- package/dist/Atomic/FormElements/InputMask2/functions.js +8 -7
- package/dist/Atomic/FormElements/InputMask3/InputMask3.js +50 -50
- package/dist/Atomic/FormElements/InputMask3/InputMask3.scss +13 -12
- package/dist/Atomic/FormElements/InputMask3/config.js +9 -9
- package/dist/Atomic/FormElements/InputMask3/functions.js +8 -7
- package/dist/Atomic/FormElements/InputWithAction/InputWithAction.js +7 -9
- package/dist/Atomic/FormElements/InputWithAction/InputWithAction.scss +34 -31
- package/dist/Atomic/FormElements/InputsRow/InputsRow.js +23 -23
- package/dist/Atomic/FormElements/InputsRow/InputsRow.scss +4 -5
- package/dist/Atomic/FormElements/Label/Label.js +2 -2
- package/dist/Atomic/FormElements/Label/Label.scss +2 -2
- package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +69 -69
- package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.scss +8 -9
- package/dist/Atomic/FormElements/MultiSelect/MultiSelect.js +2 -2
- package/dist/Atomic/FormElements/MultiSelect/MultiSelect.scss +2 -2
- package/dist/Atomic/FormElements/NumericInput/NumericInput.js +27 -27
- package/dist/Atomic/FormElements/NumericInput/NumericInput.scss +18 -18
- package/dist/Atomic/FormElements/RadioGroup/RadioGroup.js +3 -3
- package/dist/Atomic/FormElements/RadioGroup/RadioGroup.scss +1 -0
- package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +6 -6
- package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.scss +1 -0
- package/dist/Atomic/FormElements/RadioInput/RadioInput.js +2 -2
- package/dist/Atomic/FormElements/RadioInput/RadioInput.scss +4 -8
- package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.js +7 -7
- package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.scss +26 -25
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +24 -24
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.scss +17 -19
- package/dist/Atomic/FormElements/RangeInputs/RangeInputs.js +30 -30
- package/dist/Atomic/FormElements/RangeInputs/RangeInputs.scss +5 -5
- package/dist/Atomic/FormElements/RangeList/RangeList.js +27 -27
- package/dist/Atomic/FormElements/RangeList/RangeList.scss +23 -23
- package/dist/Atomic/FormElements/RangeList/partial/AnyOuterClass.scss +5 -4
- package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.js +1 -1
- package/dist/Atomic/FormElements/RangeSlider/RangeSlider.js +31 -31
- package/dist/Atomic/FormElements/RangeSlider/RangeSlider.scss +19 -24
- package/dist/Atomic/FormElements/RangeSlider/RangeSlider.stories.scss +7 -7
- package/dist/Atomic/FormElements/RangeSlider2/RangeSlider.stories.scss +8 -8
- package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +22 -22
- package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.scss +165 -91
- package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.js +1 -1
- package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.scss +2 -2
- package/dist/Atomic/FormElements/Switcher/Switcher.js +1 -1
- package/dist/Atomic/FormElements/Switcher/Switcher.scss +10 -12
- package/dist/Atomic/FormElements/Switcher/partial/AnyOuterClass.scss +2 -2
- package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.js +4 -6
- package/dist/Atomic/FormElements/SwitcherCheckbox/partial/AnyOuterClass.scss +2 -2
- package/dist/Atomic/FormElements/SwitcherHide/SwitcherHide.js +2 -2
- package/dist/Atomic/FormElements/SwitcherHide/partial/AnyOuterClass.scss +2 -2
- package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.js +4 -4
- package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.scss +1 -1
- package/dist/Atomic/FormElements/SwitcherRadio/partial/AnyOuterClass.scss +2 -2
- package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.js +5 -5
- package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.js +2 -2
- package/dist/Atomic/FormElements/SwitcherRangeList/partial/AnyOuterClass.scss +6 -6
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.js +9 -9
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.scss +2 -3
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/partial/AnyOuterClass.scss +2 -2
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/partial/States.js +100 -100
- package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.js +5 -5
- package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.scss +2 -3
- package/dist/Atomic/FormElements/SwitcherTextarea/partial/AnyOuterClass.scss +4 -4
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +67 -68
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.scss +103 -64
- package/dist/Atomic/FormElements/Text/Text.js +13 -13
- package/dist/Atomic/FormElements/Text/Text.scss +0 -1
- package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.js +4 -4
- package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.scss +15 -15
- package/dist/Atomic/FormElements/Textarea/Textarea.js +2 -2
- package/dist/Atomic/FormElements/Textarea/Textarea.scss +7 -8
- package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +3 -3
- package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.scss +5 -6
- package/dist/Atomic/FormElements/TimeRange/TimeRange.js +9 -9
- package/dist/Atomic/FormElements/TimeRange/TimeRange.scss +1 -1
- package/dist/Atomic/FormElements/UserContacts/UserContacts.js +36 -37
- package/dist/Atomic/FormElements/UserContacts/partial/AnyOuterClass.scss +5 -6
- package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.js +3 -3
- package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.scss +77 -59
- package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.js +3 -3
- package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.scss +9 -10
- package/dist/Atomic/FormElements/WidgetPseudoTable/partial/AnyOuterClass.scss +16 -14
- package/dist/Atomic/FormElements/WidgetPseudoTable/partial/constructor.js +18 -18
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.js +6 -6
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.scss +9 -10
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/partial/AnyOuterClass.scss +16 -14
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/partial/constructor.js +14 -14
- package/dist/Atomic/Layout/Header/Header.js +11 -11
- package/dist/Atomic/Layout/Header/Header.scss +9 -10
- package/dist/Atomic/Layout/MainMenu/MainMenu.js +17 -18
- package/dist/Atomic/Layout/MainMenu/MainMenu.scss +14 -17
- package/dist/Atomic/Layout/Spinner/Spinner.js +4 -4
- package/dist/Atomic/Layout/Spinner/Spinner.scss +3 -3
- package/dist/Atomic/UI/Accordion/Accordion.js +7 -7
- package/dist/Atomic/UI/Accordion/Accordion.scss +11 -11
- package/dist/Atomic/UI/Accordion/AccordionItem.js +12 -12
- package/dist/Atomic/UI/AccordionTable/AccordionTable.js +22 -23
- package/dist/Atomic/UI/AccordionTable/AccordionTable.scss +33 -38
- package/dist/Atomic/UI/AccordionText/AccordionText.js +3 -3
- package/dist/Atomic/UI/AccordionText/AccordionText.scss +18 -10
- package/dist/Atomic/UI/AdvancedTag/AdvTag.js +31 -32
- package/dist/Atomic/UI/AdvancedTag/AdvancedTags.js +5 -5
- package/dist/Atomic/UI/AdvancedTag/AdvancedTags.scss +19 -18
- package/dist/Atomic/UI/Alert/Alert.js +5 -5
- package/dist/Atomic/UI/Alert/Alert.scss +21 -21
- package/dist/Atomic/UI/Arrow/Arrow.js +5 -5
- package/dist/Atomic/UI/Box/Box.js +10 -10
- package/dist/Atomic/UI/Box/Box.scss +2 -4
- package/dist/Atomic/UI/Button/Button.js +9 -9
- package/dist/Atomic/UI/Button/Button.scss +34 -34
- package/dist/Atomic/UI/ButtonsBar/ButtonsBar.js +4 -4
- package/dist/Atomic/UI/ButtonsBar/ButtonsBar.scss +1 -1
- package/dist/Atomic/UI/Chart/Chart.js +16 -16
- package/dist/Atomic/UI/Chart/Chart.scss +4 -4
- package/dist/Atomic/UI/Chart/partial/AnyOuterClass.scss +10 -14
- package/dist/Atomic/UI/Chart/partial/Chart.constants.js +30 -30
- package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +3 -3
- package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.scss +1 -1
- package/dist/Atomic/UI/Chart/partial/datasetSetters.js +15 -15
- package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +28 -28
- package/dist/Atomic/UI/Chart/partial/optionsSetters.js +2 -2
- package/dist/Atomic/UI/Chart/partial/utils.js +4 -4
- package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +9 -9
- package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.scss +7 -9
- package/dist/Atomic/UI/DateTime/DateTime.js +6 -6
- package/dist/Atomic/UI/DateTime/DateTime.scss +1 -1
- package/dist/Atomic/UI/DateTime/partial/AnyOuterClass.scss +2 -2
- package/dist/Atomic/UI/DebugContainer/DebugContainer.js +4 -4
- package/dist/Atomic/UI/DebugContainer/DebugContainer.scss +15 -9
- package/dist/Atomic/UI/DoubleString/DoubleString.js +6 -6
- package/dist/Atomic/UI/DoubleString/DoubleString.scss +11 -5
- package/dist/Atomic/UI/DoubleString/partial/AnyOuterClass.scss +4 -4
- package/dist/Atomic/UI/DynamicIcon/DynamicIcon.js +1 -1
- package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +48 -48
- package/dist/Atomic/UI/ExampleChartIntegration/partial/AnyOuterClass.scss +10 -15
- package/dist/Atomic/UI/ExampleChartIntegration/partial/utils.js +18 -18
- package/dist/Atomic/UI/Hint/Hint.js +40 -41
- package/dist/Atomic/UI/Hint/Hint.scss +12 -11
- package/dist/Atomic/UI/Modal/Modal.js +28 -36
- package/dist/Atomic/UI/Modal/Modal.scss +42 -43
- package/dist/Atomic/UI/Modal/ModalHOC.js +2 -5
- package/dist/Atomic/UI/Modal/ModalMobile.scss +18 -11
- package/dist/Atomic/UI/Modal/partials/ModalFooter.js +2 -2
- package/dist/Atomic/UI/Modal/partials/ModalTitle.js +6 -6
- package/dist/Atomic/UI/Modal/partials/useMobileModal.js +8 -8
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +1 -1
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.scss +5 -5
- package/dist/Atomic/UI/MonoAccordion/partial/AnyOuterClass.scss +4 -5
- package/dist/Atomic/UI/NavLine/NavLine.js +26 -26
- package/dist/Atomic/UI/NavLine/NavLine.scss +34 -36
- package/dist/Atomic/UI/NavLine/Tabs.js +38 -38
- package/dist/Atomic/UI/PageTitle/PageTitle.js +1 -1
- package/dist/Atomic/UI/PageTitle/PageTitle.scss +7 -7
- package/dist/Atomic/UI/PieChart/PieChart.js +4 -4
- package/dist/Atomic/UI/PieChart/PieChart.scss +21 -10
- package/dist/Atomic/UI/Price/Price.js +2 -2
- package/dist/Atomic/UI/PriceRange/PriceRange.js +2 -2
- package/dist/Atomic/UI/ProgressLine/ProgressLine.js +10 -10
- package/dist/Atomic/UI/ProgressLine/ProgressLine.scss +36 -40
- package/dist/Atomic/UI/Status/Status.js +6 -6
- package/dist/Atomic/UI/Status/Status.scss +19 -19
- package/dist/Atomic/UI/Table/Partials/TdCell.js +11 -11
- package/dist/Atomic/UI/Table/Partials/TdHeader.js +3 -3
- package/dist/Atomic/UI/Table/Partials/TdRow.js +6 -6
- package/dist/Atomic/UI/Table/Partials/TdTitle.js +1 -1
- package/dist/Atomic/UI/Table/Table.js +3 -3
- package/dist/Atomic/UI/Table/Table.scss +11 -13
- package/dist/Atomic/UI/Table/TdTypes/TdActions.js +8 -8
- package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +2 -2
- package/dist/Atomic/UI/Table/TdTypes/TdRange.js +1 -3
- package/dist/Atomic/UI/Table/TdTypes/TdTypes.scss +9 -8
- package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +10 -13
- package/dist/Atomic/UI/Tag/Tag.js +6 -6
- package/dist/Atomic/UI/Tag/Tag.scss +12 -11
- package/dist/Atomic/UI/TagList/TagList.js +8 -8
- package/dist/Atomic/UI/TagList/TagList.scss +1 -1
- package/dist/Atomic/UI/UserBox/UserBox.js +5 -5
- package/dist/Atomic/UI/UserBox/UserBox.scss +9 -9
- package/dist/Classes/AbortableFetch.js +35 -35
- package/dist/Classes/AnimatedHandler.js +3 -3
- package/dist/Classes/RESTAPI/index.js +9 -9
- package/dist/Classes/RESTAPI/partials/AbortableFetch.js +37 -37
- package/dist/Classes/RESTAPI/partials/ApiBase.js +7 -7
- package/dist/Classes/RESTAPI/partials/ApiRequestCreators.js +4 -4
- package/dist/Classes/RESTAPI/partials/ApiUtils.js +4 -4
- package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +31 -31
- package/dist/Classes/RESTAPI/partials/Utils.js +15 -15
- package/dist/Classes/RESTAPI/partials/_utils.js +14 -14
- package/dist/Constants/index.constants.js +10 -10
- package/dist/Functions/Portal.js +1 -1
- package/dist/Functions/customEventListener.js +5 -5
- package/dist/Functions/fieldValueFormatters.js +66 -82
- package/dist/Functions/hooks/useFormFieldsChangesManager.js +4 -4
- package/dist/Functions/locale/createTranslator.js +4 -15
- package/dist/Functions/operations.js +14 -14
- package/dist/Functions/presets/inputMaskPresets.js +34 -34
- package/dist/Functions/presets/inputPresets.js +3 -3
- package/dist/Functions/presets/mobileKeyboardTypesPresets.js +2 -2
- package/dist/Functions/schemas.js +8 -8
- package/dist/Functions/useBodyScrollLock.js +20 -0
- package/dist/Functions/useClickOutside.js +2 -2
- package/dist/Functions/useFieldFocus.js +3 -7
- package/dist/Functions/useFormTools/form-drivers/ArrayWithObjects.js +1 -1
- package/dist/Functions/useFormTools/form-drivers/ObjectWithIterableObjects.js +11 -11
- package/dist/Functions/useFormTools/form-drivers/ObjectWithNamedKeyObjects.js +1 -1
- package/dist/Functions/useFormTools/functions/General.js +9 -9
- package/dist/Functions/useFormTools/functions/RenderFields.js +6 -6
- package/dist/Functions/useFormTools/index.js +18 -20
- package/dist/Functions/useInputHighlightError.js +5 -5
- package/dist/Functions/useKeyPress/useHandleKeyPress.js +44 -0
- package/dist/Functions/useKeyPress/useKeyPress.js +38 -0
- package/dist/Functions/useLocalStorage.js +2 -13
- package/dist/Functions/useLocationParams.js +2 -2
- package/dist/Functions/useMetaInfo.js +7 -7
- package/dist/Functions/useMouseUpOutside.js +2 -2
- package/dist/Functions/useOnlineStatus.js +5 -14
- package/dist/Functions/usePasswordChecker.js +26 -26
- package/dist/Functions/usePrevious.js +0 -12
- package/dist/Functions/useResize.js +6 -24
- package/dist/Functions/useScrollTo.js +1 -1
- package/dist/Functions/useToggle.js +1 -1
- package/dist/Functions/utils.js +64 -143
- package/dist/Molecular/FormElement/FormElement.js +1 -1
- package/dist/Molecular/FormElement/FormElement.scss +4 -3
- package/dist/Molecular/FormWithDependOn/FormWithDependOn.js +14 -14
- package/dist/Molecular/FormWithDependOn/partials/_utils.js +2 -2
- package/dist/Molecular/InputAddress/InputAddress.js +47 -46
- package/dist/Molecular/InputAddress/InputAddress.scss +176 -112
- package/dist/Molecular/InputPassword/InputPassword.js +11 -15
- package/dist/Molecular/InputPassword/InputPassword.scss +8 -7
- package/dist/scss/_fonts.scss +60 -36
- package/dist/scss/_vars.scss +18 -18
- package/dist/scss/main.scss +4 -4
- package/package.json +1 -1
|
@@ -8,18 +8,18 @@ var yup = _interopRequireWildcard(require("yup"));
|
|
|
8
8
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
9
9
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
10
10
|
const forgotSchema = exports.forgotSchema = yup.object().shape({
|
|
11
|
-
email: yup.string().email(
|
|
11
|
+
email: yup.string().email("Invalid email").required("E-mail is required")
|
|
12
12
|
});
|
|
13
13
|
const loginSchema = exports.loginSchema = yup.object().shape({
|
|
14
|
-
email: yup.string().email(
|
|
15
|
-
password: yup.string().required(
|
|
14
|
+
email: yup.string().email("Invalid email").required("E-mail is required"),
|
|
15
|
+
password: yup.string().required("No password provided").min(8, "Password is too short - should be 8 chars minimum").matches(/[a-zA-Z]/, "Password can only contain Latin letters"),
|
|
16
16
|
remember: yup.bool()
|
|
17
17
|
});
|
|
18
18
|
const registerSchema = exports.registerSchema = yup.object().shape({
|
|
19
|
-
name: yup.string().required(
|
|
20
|
-
email: yup.string().email(
|
|
21
|
-
password: yup.string().required(
|
|
22
|
-
confirmPassword: yup.string().required(
|
|
19
|
+
name: yup.string().required("Name is required"),
|
|
20
|
+
email: yup.string().email("Invalid email").required("E-mail is required"),
|
|
21
|
+
password: yup.string().required("No password provided").min(8, "Password is too short - should be 8 chars minimum").matches(/[a-zA-Z]/, "Password can only contain Latin letters"),
|
|
22
|
+
confirmPassword: yup.string().required("Confirm password").oneOf([yup.ref("password")], "Passwords must match"),
|
|
23
23
|
promo: yup.string(),
|
|
24
|
-
recaptcha: yup.bool().oneOf([true],
|
|
24
|
+
recaptcha: yup.bool().oneOf([true], "Field must be checked")
|
|
25
25
|
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
const useBodyScrollLock = isScrollBodyLocked => {
|
|
9
|
+
(0, _react.useEffect)(() => {
|
|
10
|
+
if (isScrollBodyLocked) {
|
|
11
|
+
document.body.style.overflow = "hidden";
|
|
12
|
+
} else {
|
|
13
|
+
document.body.style.overflow = "auto";
|
|
14
|
+
}
|
|
15
|
+
return () => {
|
|
16
|
+
document.body.style.overflow = "auto";
|
|
17
|
+
};
|
|
18
|
+
}, [isScrollBodyLocked]);
|
|
19
|
+
};
|
|
20
|
+
var _default = exports.default = useBodyScrollLock;
|
|
@@ -12,9 +12,9 @@ const useClickOutside = (ref, setOut, open) => {
|
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
(0, _react.useEffect)(() => {
|
|
15
|
-
document.addEventListener(
|
|
15
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
16
16
|
return () => {
|
|
17
|
-
document.removeEventListener(
|
|
17
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
18
18
|
};
|
|
19
19
|
}, [ref]);
|
|
20
20
|
};
|
|
@@ -5,16 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = useFieldsFocus;
|
|
7
7
|
var _react = require("react");
|
|
8
|
-
/**
|
|
9
|
-
* It adds refs to each field in the form, and provides a function to set focus to a field by key
|
|
10
|
-
* @returns An object with two functions.
|
|
11
|
-
*/
|
|
12
8
|
function useFieldsFocus(_ref) {
|
|
13
9
|
let {
|
|
14
10
|
form,
|
|
15
11
|
setForm
|
|
16
12
|
} = _ref;
|
|
17
|
-
const isFormAsObject = Boolean(typeof form ===
|
|
13
|
+
const isFormAsObject = Boolean(typeof form === "object" && !Array.isArray(form));
|
|
18
14
|
const getField = key => {
|
|
19
15
|
if (isFormAsObject) {
|
|
20
16
|
var _form$key, _Object$values;
|
|
@@ -60,12 +56,12 @@ function useFieldsFocus(_ref) {
|
|
|
60
56
|
const toggleFieldFocus = _ref2 => {
|
|
61
57
|
let {
|
|
62
58
|
field,
|
|
63
|
-
action =
|
|
59
|
+
action = "focus"
|
|
64
60
|
} = _ref2;
|
|
65
61
|
if (!field || !(field !== null && field !== void 0 && field.ref)) return null;
|
|
66
62
|
setTimeout(() => {
|
|
67
63
|
var _field$ref$current;
|
|
68
|
-
(_field$ref$current = field.ref.current) === null || _field$ref$current === void 0 || (_field$ref$current = _field$ref$current.querySelector((field === null || field === void 0 ? void 0 : field.focusSelector) ||
|
|
64
|
+
(_field$ref$current = field.ref.current) === null || _field$ref$current === void 0 || (_field$ref$current = _field$ref$current.querySelector((field === null || field === void 0 ? void 0 : field.focusSelector) || "input")) === null || _field$ref$current === void 0 || _field$ref$current[action]();
|
|
69
65
|
}, 50);
|
|
70
66
|
};
|
|
71
67
|
const setFocusTo = key => {
|
|
@@ -28,7 +28,7 @@ function ArrayWithObjects(_ref) {
|
|
|
28
28
|
return (_getFormFields = getFormFields(argForm)) === null || _getFormFields === void 0 ? void 0 : _getFormFields.find(f => f.key === key);
|
|
29
29
|
};
|
|
30
30
|
const setFormFields = data => {
|
|
31
|
-
const isFunction = typeof data ===
|
|
31
|
+
const isFunction = typeof data === "function";
|
|
32
32
|
setForm(state => isFunction ? data(state) : data);
|
|
33
33
|
};
|
|
34
34
|
const setFormField = function (data) {
|
|
@@ -15,17 +15,17 @@ function ObjectWithIterableObjects(_ref) {
|
|
|
15
15
|
args[_key] = arguments[_key];
|
|
16
16
|
}
|
|
17
17
|
const [mainArg] = args;
|
|
18
|
-
const MainArgProto = Array.isArray(mainArg) ?
|
|
19
|
-
const template = Array.isArray(mainArg) ? [] : typeof mainArg ===
|
|
18
|
+
const MainArgProto = Array.isArray(mainArg) ? "Array" : typeof mainArg === "object" ? "Object" : undefined;
|
|
19
|
+
const template = Array.isArray(mainArg) ? [] : typeof mainArg === "object" ? {} : null;
|
|
20
20
|
if (!template) return undefined;
|
|
21
21
|
return args.reduce((result, item) => {
|
|
22
|
-
if (MainArgProto ===
|
|
22
|
+
if (MainArgProto === "Array") {
|
|
23
23
|
if (Array.isArray(item)) {
|
|
24
24
|
return [...result, ...item];
|
|
25
25
|
} else {
|
|
26
26
|
return [...result, item];
|
|
27
27
|
}
|
|
28
|
-
} else if (MainArgProto ===
|
|
28
|
+
} else if (MainArgProto === "Object") {
|
|
29
29
|
return {
|
|
30
30
|
...result,
|
|
31
31
|
...item
|
|
@@ -38,7 +38,7 @@ function ObjectWithIterableObjects(_ref) {
|
|
|
38
38
|
const getFieldData = key => {
|
|
39
39
|
if (Array.isArray(FormFields)) {
|
|
40
40
|
return FormFields[key] || FormFields.find(f => f.key === key);
|
|
41
|
-
} else if (typeof FormFields ===
|
|
41
|
+
} else if (typeof FormFields === "object") {
|
|
42
42
|
return FormFields[key] || Object.values(FormFields).find(f => f.key === key);
|
|
43
43
|
} else {
|
|
44
44
|
return undefined;
|
|
@@ -49,10 +49,10 @@ function ObjectWithIterableObjects(_ref) {
|
|
|
49
49
|
};
|
|
50
50
|
const getFormField = key => {
|
|
51
51
|
// eslint-disable-next-line no-undef
|
|
52
|
-
if (FormProto ===
|
|
52
|
+
if (FormProto === "Array") {
|
|
53
53
|
return getFormFields().find(field => field.key === key);
|
|
54
54
|
// eslint-disable-next-line no-undef
|
|
55
|
-
} else if (FormProto ===
|
|
55
|
+
} else if (FormProto === "Object") {
|
|
56
56
|
return Object.values(getFormFields()).find(field => field.key === key) || Object.keys(getFormFields()).reduce((result, field) => {
|
|
57
57
|
if (field === key) result = getFormFields()[field];
|
|
58
58
|
return result;
|
|
@@ -62,7 +62,7 @@ function ObjectWithIterableObjects(_ref) {
|
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
64
|
const setFormFields = data => {
|
|
65
|
-
const isFunction = typeof data ===
|
|
65
|
+
const isFunction = typeof data === "function";
|
|
66
66
|
setForm(state => {
|
|
67
67
|
if (state.fields) {
|
|
68
68
|
return {
|
|
@@ -76,7 +76,7 @@ function ObjectWithIterableObjects(_ref) {
|
|
|
76
76
|
};
|
|
77
77
|
const setFormField = function (data) {
|
|
78
78
|
let key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
79
|
-
const isFunction = typeof data ===
|
|
79
|
+
const isFunction = typeof data === "function";
|
|
80
80
|
setFormFields(fields => {
|
|
81
81
|
const pop = (fields, key) => {
|
|
82
82
|
const result = {
|
|
@@ -86,13 +86,13 @@ function ObjectWithIterableObjects(_ref) {
|
|
|
86
86
|
result.item = fields[key] || fields.find(f => f.key === key);
|
|
87
87
|
if (!result.item) return result;
|
|
88
88
|
if (Array.isArray(fields)) {
|
|
89
|
-
const index = parseInt(key);
|
|
89
|
+
const index = parseInt(key, 10);
|
|
90
90
|
if (!isNaN(index)) {
|
|
91
91
|
result.fields.splice(key, 1);
|
|
92
92
|
} else {
|
|
93
93
|
result.fields = result.fields.filter(f => f.key !== key);
|
|
94
94
|
}
|
|
95
|
-
} else if (typeof fields ===
|
|
95
|
+
} else if (typeof fields === "object") {
|
|
96
96
|
result.fields = Object.values(fields).reduce((object, _ref2) => {
|
|
97
97
|
let {
|
|
98
98
|
key: fKey
|
|
@@ -14,17 +14,17 @@ function General() {
|
|
|
14
14
|
args[_key] = arguments[_key];
|
|
15
15
|
}
|
|
16
16
|
const [mainArg] = args;
|
|
17
|
-
const MainArgProto = Array.isArray(mainArg) ?
|
|
18
|
-
const template = Array.isArray(mainArg) ? [] : typeof mainArg ===
|
|
17
|
+
const MainArgProto = Array.isArray(mainArg) ? "Array" : typeof mainArg === "object" ? "Object" : undefined;
|
|
18
|
+
const template = Array.isArray(mainArg) ? [] : typeof mainArg === "object" ? {} : null;
|
|
19
19
|
if (!template) return undefined;
|
|
20
20
|
return args.reduce((result, item) => {
|
|
21
|
-
if (MainArgProto ===
|
|
21
|
+
if (MainArgProto === "Array") {
|
|
22
22
|
if (Array.isArray(item)) {
|
|
23
23
|
return [...result, ...item];
|
|
24
24
|
} else {
|
|
25
25
|
return [...result, item];
|
|
26
26
|
}
|
|
27
|
-
} else if (MainArgProto ===
|
|
27
|
+
} else if (MainArgProto === "Object") {
|
|
28
28
|
return {
|
|
29
29
|
...result,
|
|
30
30
|
...item
|
|
@@ -45,7 +45,7 @@ function General() {
|
|
|
45
45
|
...FormFields.find(f => f.key === key)
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
|
-
} else if (typeof FormFields ===
|
|
48
|
+
} else if (typeof FormFields === "object") {
|
|
49
49
|
return {
|
|
50
50
|
...FormFields[key]
|
|
51
51
|
} || {
|
|
@@ -61,7 +61,7 @@ function General() {
|
|
|
61
61
|
};
|
|
62
62
|
const getFormFieldsAsArray = fields => {
|
|
63
63
|
if (Array.isArray(fields)) return fields;
|
|
64
|
-
if (typeof fields ===
|
|
64
|
+
if (typeof fields === "object") {
|
|
65
65
|
return Object.values(fields);
|
|
66
66
|
}
|
|
67
67
|
return fields;
|
|
@@ -74,7 +74,7 @@ function General() {
|
|
|
74
74
|
} = _ref;
|
|
75
75
|
return key;
|
|
76
76
|
});
|
|
77
|
-
if (typeof fields ===
|
|
77
|
+
if (typeof fields === "object") {
|
|
78
78
|
return Object.values(fields).map(_ref2 => {
|
|
79
79
|
let {
|
|
80
80
|
key
|
|
@@ -92,14 +92,14 @@ function General() {
|
|
|
92
92
|
if (Array.isArray(fields)) {
|
|
93
93
|
result.item = fields === null || fields === void 0 ? void 0 : fields.find(f => f.key === key);
|
|
94
94
|
result.itemIndex = result.item ? fields.findIndex(f => f.key === key) : fields.length;
|
|
95
|
-
} else if (typeof fields ===
|
|
95
|
+
} else if (typeof fields === "object") {
|
|
96
96
|
result.item = fields[key] || Object.values(fields).find(f => f.key === key);
|
|
97
97
|
result.itemIndex = result.item ? fields[key] ? key : Object.values(fields).findIndex(f => f.key === key) : key;
|
|
98
98
|
}
|
|
99
99
|
return result;
|
|
100
100
|
};
|
|
101
101
|
const updateFormField = (fields, data, key) => {
|
|
102
|
-
const isFunction = typeof data ===
|
|
102
|
+
const isFunction = typeof data === "function";
|
|
103
103
|
//KEY is NULLable
|
|
104
104
|
if (!key) {
|
|
105
105
|
return data.key ? Object.values(fields).reduce((result, field, i) => {
|
|
@@ -6,22 +6,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = RenderFields;
|
|
7
7
|
const defaultRenderFieldComponent = () => {
|
|
8
8
|
// eslint-disable-next-line no-console
|
|
9
|
-
console.error(
|
|
9
|
+
console.error("RenderFields: RenderFieldComponent Property is not recieved!");
|
|
10
10
|
return null;
|
|
11
11
|
};
|
|
12
12
|
const defaultFormDataDriver = () => {
|
|
13
13
|
// eslint-disable-next-line no-console
|
|
14
|
-
console.error(
|
|
14
|
+
console.error("RenderFields: FormDataDriver Property is not recieved!");
|
|
15
15
|
return null;
|
|
16
16
|
};
|
|
17
17
|
const defaultOnFieldChange = () => {
|
|
18
18
|
// eslint-disable-next-line no-console
|
|
19
|
-
console.warn(
|
|
19
|
+
console.warn("RenderFields: Be careful, onFieldChange handler is not recieved!");
|
|
20
20
|
return null;
|
|
21
21
|
};
|
|
22
22
|
const defaultOnFieldBlur = () => {
|
|
23
23
|
// eslint-disable-next-line no-console
|
|
24
|
-
console.warn(
|
|
24
|
+
console.warn("RenderFields: Be careful, defaultOnFieldBlur handler is not recieved!");
|
|
25
25
|
return null;
|
|
26
26
|
};
|
|
27
27
|
function RenderFields() {
|
|
@@ -56,7 +56,7 @@ function RenderFields() {
|
|
|
56
56
|
return /*#__PURE__*/React.createElement("div", {
|
|
57
57
|
key: "render-field-wrapper-".concat(key),
|
|
58
58
|
id: "render-field-wrapper-".concat(key),
|
|
59
|
-
ref: wrapperRef ? typeof wrapperRef ===
|
|
59
|
+
ref: wrapperRef ? typeof wrapperRef === "function" ? node => wrapperRef(node, key) : wrapperRef : null
|
|
60
60
|
}, /*#__PURE__*/React.createElement(RenderFieldComponent, {
|
|
61
61
|
key: key,
|
|
62
62
|
field: field,
|
|
@@ -85,7 +85,7 @@ function RenderFields() {
|
|
|
85
85
|
className: "row"
|
|
86
86
|
}, parts.map((part, i) => /*#__PURE__*/React.createElement("div", {
|
|
87
87
|
key: "render-fields-row-".concat(i),
|
|
88
|
-
className: "col-12 col-lg-".concat(parseInt(maxWidth / columnsQty))
|
|
88
|
+
className: "col-12 col-lg-".concat(parseInt(maxWidth / columnsQty, 10))
|
|
89
89
|
}, part.map(renderFormField))));
|
|
90
90
|
};
|
|
91
91
|
const render = cols === 1 ? renderSingleColumn : renderSplitColumns;
|
|
@@ -5,14 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = useFormTools;
|
|
8
|
-
var _react =
|
|
9
|
-
var _General = _interopRequireDefault(require("./functions/General"));
|
|
8
|
+
var _react = require("react");
|
|
10
9
|
var _ArrayWithObjects = _interopRequireDefault(require("./form-drivers/ArrayWithObjects"));
|
|
11
10
|
var _ObjectWithIterableObjects = _interopRequireDefault(require("./form-drivers/ObjectWithIterableObjects"));
|
|
12
11
|
var _ObjectWithNamedKeyObjects = _interopRequireDefault(require("./form-drivers/ObjectWithNamedKeyObjects"));
|
|
12
|
+
var _General = _interopRequireDefault(require("./functions/General"));
|
|
13
13
|
var _RenderFields = _interopRequireDefault(require("./functions/RenderFields"));
|
|
14
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
15
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
14
|
// eslint-disable-next-line no-unused-vars
|
|
17
15
|
|
|
18
16
|
const DefaultFocusControllerProps = {
|
|
@@ -25,7 +23,7 @@ function useFormTools() {
|
|
|
25
23
|
setForm,
|
|
26
24
|
FormType,
|
|
27
25
|
FormFields,
|
|
28
|
-
FormDataDriverName =
|
|
26
|
+
FormDataDriverName = "ArrayWithObjects" || "ObjectWithIterableObjects" || "ObjectWithNamedKeyObjects",
|
|
29
27
|
FormDataDriver = null,
|
|
30
28
|
FocusControllerProps = DefaultFocusControllerProps,
|
|
31
29
|
goToNextFieldOnEnterPressed = true
|
|
@@ -99,7 +97,7 @@ function useFormTools() {
|
|
|
99
97
|
});
|
|
100
98
|
};
|
|
101
99
|
const onChangeObserver = (key, value) => {
|
|
102
|
-
if (!onChangeObservers[key] || typeof onChangeObservers[key] !==
|
|
100
|
+
if (!onChangeObservers[key] || typeof onChangeObservers[key] !== "object") return;
|
|
103
101
|
const Observers = onChangeObservers[key];
|
|
104
102
|
Object.values(Observers).map(cb => {
|
|
105
103
|
cb({
|
|
@@ -115,7 +113,7 @@ function useFormTools() {
|
|
|
115
113
|
onChangeObserver(key, value);
|
|
116
114
|
setFormField(field => ({
|
|
117
115
|
...field,
|
|
118
|
-
error:
|
|
116
|
+
error: "",
|
|
119
117
|
value
|
|
120
118
|
}), key);
|
|
121
119
|
};
|
|
@@ -215,11 +213,11 @@ function useFormTools() {
|
|
|
215
213
|
return renderFormFields.reduce((result, key) => {
|
|
216
214
|
var _field$className;
|
|
217
215
|
const fieldData = getFieldData(key);
|
|
218
|
-
|
|
216
|
+
const field = getFormField(key) ? getFormField(key) : fieldData;
|
|
219
217
|
if (!(field !== null && field !== void 0 && field.className) || (field === null || field === void 0 || (_field$className = field.className) === null || _field$className === void 0 ? void 0 : _field$className.indexOf(getFieldClassName(key, FormType))) === -1) {
|
|
220
218
|
field.className = "".concat(field === null || field === void 0 ? void 0 : field.className, " ").concat(getFieldClassName(key, FormType));
|
|
221
219
|
}
|
|
222
|
-
if (typeof (fieldData === null || fieldData === void 0 ? void 0 : fieldData.label) ===
|
|
220
|
+
if (typeof (fieldData === null || fieldData === void 0 ? void 0 : fieldData.label) === "object") {
|
|
223
221
|
field.label = fieldData.label[FormType] || fieldData.label.default;
|
|
224
222
|
}
|
|
225
223
|
field.ref = /*#__PURE__*/(0, _react.createRef)();
|
|
@@ -237,14 +235,14 @@ function useFormTools() {
|
|
|
237
235
|
// eslint-disable-next-line no-use-before-define
|
|
238
236
|
addOnFieldRenderedObserver(key, () => {
|
|
239
237
|
var _getFormField2;
|
|
240
|
-
const element = (_getFormField2 = getFormField(key)) === null || _getFormField2 === void 0 || (_getFormField2 = _getFormField2.ref) === null || _getFormField2 === void 0 || (_getFormField2 = _getFormField2.current) === null || _getFormField2 === void 0 ? void 0 : _getFormField2.querySelector((field === null || field === void 0 ? void 0 : field.focusSelector) ||
|
|
238
|
+
const element = (_getFormField2 = getFormField(key)) === null || _getFormField2 === void 0 || (_getFormField2 = _getFormField2.ref) === null || _getFormField2 === void 0 || (_getFormField2 = _getFormField2.current) === null || _getFormField2 === void 0 ? void 0 : _getFormField2.querySelector((field === null || field === void 0 ? void 0 : field.focusSelector) || "input");
|
|
241
239
|
const handler = () => setFormField({
|
|
242
240
|
isValueChangedByUser: true
|
|
243
241
|
}, key);
|
|
244
|
-
element === null || element === void 0 || element.addEventListener(
|
|
242
|
+
element === null || element === void 0 || element.addEventListener("paste", handler, {
|
|
245
243
|
once: true
|
|
246
244
|
});
|
|
247
|
-
element === null || element === void 0 || element.addEventListener(
|
|
245
|
+
element === null || element === void 0 || element.addEventListener("keypress", handler, {
|
|
248
246
|
once: true
|
|
249
247
|
});
|
|
250
248
|
}, true);
|
|
@@ -331,9 +329,9 @@ function useFormTools() {
|
|
|
331
329
|
filtered === null || filtered === void 0 || filtered.map(field => {
|
|
332
330
|
const formField = document.querySelector(".".concat(field === null || field === void 0 ? void 0 : field.className));
|
|
333
331
|
if (!formField) return null;
|
|
334
|
-
formField.classList.remove(
|
|
332
|
+
formField.classList.remove("errorLabelHightlite");
|
|
335
333
|
if (field !== null && field !== void 0 && field.error) {
|
|
336
|
-
formField.classList.add(
|
|
334
|
+
formField.classList.add("errorLabelHightlite");
|
|
337
335
|
}
|
|
338
336
|
return null;
|
|
339
337
|
});
|
|
@@ -358,17 +356,17 @@ function useFormTools() {
|
|
|
358
356
|
form: argForm,
|
|
359
357
|
field
|
|
360
358
|
} = _ref;
|
|
361
|
-
let action = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] :
|
|
359
|
+
let action = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "focus";
|
|
362
360
|
if (!key && !field) return null;
|
|
363
361
|
if (!argForm) argForm = form;
|
|
364
362
|
const formField = field || getFormField(key, argForm);
|
|
365
363
|
if (!formField || !formField.ref) {
|
|
366
364
|
return false;
|
|
367
365
|
}
|
|
368
|
-
if (action ===
|
|
366
|
+
if (action === "focus" && FocusControllerProps.onlyEmptyFieldAutoFocus && Boolean(formField === null || formField === void 0 ? void 0 : formField.value)) return null;
|
|
369
367
|
setTimeout(() => {
|
|
370
368
|
var _formField$ref$curren;
|
|
371
|
-
(_formField$ref$curren = formField.ref.current) === null || _formField$ref$curren === void 0 || (_formField$ref$curren = _formField$ref$curren.querySelector((formField === null || formField === void 0 ? void 0 : formField.focusSelector) ||
|
|
369
|
+
(_formField$ref$curren = formField.ref.current) === null || _formField$ref$curren === void 0 || (_formField$ref$curren = _formField$ref$curren.querySelector((formField === null || formField === void 0 ? void 0 : formField.focusSelector) || "input")) === null || _formField$ref$curren === void 0 || _formField$ref$curren[action]();
|
|
372
370
|
cb();
|
|
373
371
|
}, 50);
|
|
374
372
|
};
|
|
@@ -384,7 +382,7 @@ function useFormTools() {
|
|
|
384
382
|
cb,
|
|
385
383
|
form: argForm,
|
|
386
384
|
field
|
|
387
|
-
},
|
|
385
|
+
}, "focus");
|
|
388
386
|
};
|
|
389
387
|
const setFieldBlur = _ref3 => {
|
|
390
388
|
let {
|
|
@@ -398,7 +396,7 @@ function useFormTools() {
|
|
|
398
396
|
cb,
|
|
399
397
|
form: argForm,
|
|
400
398
|
field
|
|
401
|
-
},
|
|
399
|
+
}, "blur");
|
|
402
400
|
};
|
|
403
401
|
const setFirstFieldFocus = () => {
|
|
404
402
|
var _field;
|
|
@@ -541,7 +539,7 @@ function useFormTools() {
|
|
|
541
539
|
});
|
|
542
540
|
};
|
|
543
541
|
const onFieldRenderedObserver = (key, data) => {
|
|
544
|
-
if (!onFieldRenderedObservers[key] || typeof onFieldRenderedObservers[key] !==
|
|
542
|
+
if (!onFieldRenderedObservers[key] || typeof onFieldRenderedObservers[key] !== "object") return;
|
|
545
543
|
const Observers = onFieldRenderedObservers[key];
|
|
546
544
|
const FilteredObservers = Object.values(Observers).filter(observer => !(observer !== null && observer !== void 0 && observer.isObserverWorkedOut));
|
|
547
545
|
if (FilteredObservers.length === 0) return null;
|
|
@@ -19,11 +19,11 @@ const useInputHighlightError = _ref => {
|
|
|
19
19
|
const [isAttemptToChange, setIsAttemptToChange] = (0, _react.useState)(false);
|
|
20
20
|
const [prevValue, setPreviousValue] = (0, _react.useState)(value);
|
|
21
21
|
function hasHighlightError(e) {
|
|
22
|
-
const changedValue = "".concat(value !== null && value !== void 0 ? value :
|
|
23
|
-
const previousValue = "".concat(prevValue !== null && prevValue !== void 0 ? prevValue :
|
|
22
|
+
const changedValue = "".concat(value !== null && value !== void 0 ? value : "");
|
|
23
|
+
const previousValue = "".concat(prevValue !== null && prevValue !== void 0 ? prevValue : "");
|
|
24
24
|
const short = previousValue.length <= changedValue.length ? previousValue : changedValue;
|
|
25
25
|
const long = previousValue.length > changedValue.length ? previousValue : changedValue;
|
|
26
|
-
const infoAboutDifferencesSameness = short.split(
|
|
26
|
+
const infoAboutDifferencesSameness = short.split("").reduce((acc, symbol, idx) => {
|
|
27
27
|
if (acc.countOn && symbol === long[idx]) acc.same.push(symbol);else {
|
|
28
28
|
acc.countOn = false;
|
|
29
29
|
acc.differences.push([idx, symbol]);
|
|
@@ -34,9 +34,9 @@ const useInputHighlightError = _ref => {
|
|
|
34
34
|
countOn: true,
|
|
35
35
|
differences: []
|
|
36
36
|
});
|
|
37
|
-
const samePart = infoAboutDifferencesSameness.same.join(
|
|
37
|
+
const samePart = infoAboutDifferencesSameness.same.join("");
|
|
38
38
|
const differencesLength = infoAboutDifferencesSameness.differences.length;
|
|
39
|
-
const currentSet = changedValue === null || changedValue === void 0 ? void 0 : changedValue.replace(samePart,
|
|
39
|
+
const currentSet = changedValue === null || changedValue === void 0 ? void 0 : changedValue.replace(samePart, "");
|
|
40
40
|
if (!_index.KEYBOARD_SERVICE_KEYS.includes(e.key) && changedValue === previousValue) setIsAttemptToChange(!(!differencesLength && e.key === currentSet));
|
|
41
41
|
}
|
|
42
42
|
(0, _react.useEffect)(() => {
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
var _useKeyPress = _interopRequireDefault(require("./useKeyPress"));
|
|
10
|
+
/**
|
|
11
|
+
* @function useHandleKeyPress
|
|
12
|
+
* @param {Object} props - объект с действиями и состоянием обновления.
|
|
13
|
+
* @param {Function} props.escCallback - функция, которая вызывается при нажатии клавиши 'Escape'.
|
|
14
|
+
* @param {Function} props.enterCallback - функция, которая вызывается при нажатии клавиши 'Enter'.
|
|
15
|
+
* @returns {void} - возвращает null.
|
|
16
|
+
* @description
|
|
17
|
+
* Хук `useHandleKeyPress` используется для создания действий при нажатии определённых клавиш ('Escape' и 'Enter').
|
|
18
|
+
* Если props.escCallback и props.enterCallback определены и передано состояние обновления (isUpdating) равное false,
|
|
19
|
+
* то при нажатии на клавиши 'Escape' или 'Enter' будут вызваны соответственные функции обратного вызова (escCallback и enterCallback).
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* function Component() {
|
|
23
|
+
* useHandleKeyPress({
|
|
24
|
+
* escCallback: () => console.log('Esc pressed'),
|
|
25
|
+
* enterCallback: () => console.log('Enter pressed'),
|
|
26
|
+
* });
|
|
27
|
+
*
|
|
28
|
+
* // ...
|
|
29
|
+
* }
|
|
30
|
+
*
|
|
31
|
+
*/
|
|
32
|
+
const useHandleKeyPress = _ref => {
|
|
33
|
+
let {
|
|
34
|
+
escCallback,
|
|
35
|
+
enterCallback
|
|
36
|
+
} = _ref;
|
|
37
|
+
const isPressEnter = (0, _useKeyPress.default)("Enter");
|
|
38
|
+
const isPressEscape = (0, _useKeyPress.default)("Escape");
|
|
39
|
+
(0, _react.useEffect)(() => {
|
|
40
|
+
if (isPressEnter && typeof enterCallback === "function") enterCallback();
|
|
41
|
+
if (isPressEscape && typeof escCallback === "function") escCallback();
|
|
42
|
+
}, [enterCallback, escCallback, isPressEnter, isPressEscape]);
|
|
43
|
+
};
|
|
44
|
+
var _default = exports.default = useHandleKeyPress;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
const useKeyPress = targetKey => {
|
|
9
|
+
const [keyPressed, setKeyPressed] = (0, _react.useState)(false);
|
|
10
|
+
const downHandler = (0, _react.useCallback)(_ref => {
|
|
11
|
+
let {
|
|
12
|
+
key
|
|
13
|
+
} = _ref;
|
|
14
|
+
if (key === targetKey) {
|
|
15
|
+
setKeyPressed(true);
|
|
16
|
+
}
|
|
17
|
+
}, [targetKey]);
|
|
18
|
+
const upHandler = (0, _react.useCallback)(_ref2 => {
|
|
19
|
+
let {
|
|
20
|
+
key
|
|
21
|
+
} = _ref2;
|
|
22
|
+
if (key === targetKey) {
|
|
23
|
+
setKeyPressed(false);
|
|
24
|
+
}
|
|
25
|
+
}, [targetKey]);
|
|
26
|
+
(0, _react.useEffect)(() => {
|
|
27
|
+
const handleDown = event => downHandler(event);
|
|
28
|
+
const handleUp = event => upHandler(event);
|
|
29
|
+
window.addEventListener("keydown", handleDown);
|
|
30
|
+
window.addEventListener("keyup", handleUp);
|
|
31
|
+
return () => {
|
|
32
|
+
window.removeEventListener("keydown", handleDown);
|
|
33
|
+
window.removeEventListener("keyup", handleUp);
|
|
34
|
+
};
|
|
35
|
+
}, [downHandler, upHandler]);
|
|
36
|
+
return keyPressed;
|
|
37
|
+
};
|
|
38
|
+
var _default = exports.default = useKeyPress;
|
|
@@ -5,20 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
|
-
/**
|
|
9
|
-
* The useLocalStorage function is a hook that allows you to store and retrieve data from localStorage.
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* @param key Store the value in localstorage
|
|
13
|
-
* @param initialValue Set the initial value of the state
|
|
14
|
-
*
|
|
15
|
-
* @return An array of two values
|
|
16
|
-
*
|
|
17
|
-
* @docauthor Trelent
|
|
18
|
-
*/
|
|
19
8
|
const useLocalStorage = (key, initialValue) => {
|
|
20
9
|
const [storedValue, setStoredValue] = (0, _react.useState)(() => {
|
|
21
|
-
if (typeof window ===
|
|
10
|
+
if (typeof window === "undefined") {
|
|
22
11
|
return initialValue;
|
|
23
12
|
}
|
|
24
13
|
try {
|
|
@@ -34,7 +23,7 @@ const useLocalStorage = (key, initialValue) => {
|
|
|
34
23
|
try {
|
|
35
24
|
const valueToStore = value instanceof Function ? value(storedValue) : value;
|
|
36
25
|
setStoredValue(valueToStore);
|
|
37
|
-
if (typeof window !==
|
|
26
|
+
if (typeof window !== "undefined") {
|
|
38
27
|
window.localStorage.setItem(key, JSON.stringify(valueToStore));
|
|
39
28
|
}
|
|
40
29
|
} catch (error) {
|
|
@@ -10,11 +10,11 @@ function useLocationParams() {
|
|
|
10
10
|
(0, _react.useEffect)(() => {
|
|
11
11
|
setParams(state => {
|
|
12
12
|
var _window$location$sear;
|
|
13
|
-
const arr = (_window$location$sear = window.location.search) === null || _window$location$sear === void 0 ? void 0 : _window$location$sear.replace(
|
|
13
|
+
const arr = (_window$location$sear = window.location.search) === null || _window$location$sear === void 0 ? void 0 : _window$location$sear.replace("?", "").split("&");
|
|
14
14
|
return {
|
|
15
15
|
...state,
|
|
16
16
|
...arr.reduce((obj, item) => {
|
|
17
|
-
const keyVal = item.split(
|
|
17
|
+
const keyVal = item.split("=");
|
|
18
18
|
const key = keyVal[0];
|
|
19
19
|
const value = keyVal[1];
|
|
20
20
|
return {
|
|
@@ -6,27 +6,27 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.useMetaInfo = exports.default = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
const useMetaInfo = () => {
|
|
9
|
-
const [browser, setBrowser] = (0, _react.useState)(
|
|
10
|
-
const [device, setDevice] = (0, _react.useState)(
|
|
9
|
+
const [browser, setBrowser] = (0, _react.useState)("Other");
|
|
10
|
+
const [device, setDevice] = (0, _react.useState)("desktop");
|
|
11
11
|
const [isiOS, setIsiOS] = (0, _react.useState)(false);
|
|
12
12
|
const [chromeVersion, setChromeVersion] = (0, _react.useState)(null);
|
|
13
13
|
const [iOSVersion, setiOSVersion] = (0, _react.useState)(null);
|
|
14
14
|
(0, _react.useEffect)(() => {
|
|
15
15
|
const userAgent = navigator.userAgent;
|
|
16
|
-
if (userAgent.indexOf(
|
|
17
|
-
setBrowser(
|
|
16
|
+
if (userAgent.indexOf("Chrome") !== -1) {
|
|
17
|
+
setBrowser("Chrome");
|
|
18
18
|
|
|
19
19
|
// Извлечение версии Chrome
|
|
20
20
|
const version = userAgent.match(/Chrom(e|ium)\/([0-9\.]+)/)[2];
|
|
21
21
|
setChromeVersion(version);
|
|
22
|
-
} else if (userAgent.indexOf(
|
|
23
|
-
const iOSV = ((userAgent.match(/(CPU|iPhone).*OS (\d+_?\d*)|CPU like Mac OS X/i) || [])[2] ||
|
|
22
|
+
} else if (userAgent.indexOf("Safari") !== -1) setBrowser("Safari");
|
|
23
|
+
const iOSV = ((userAgent.match(/(CPU|iPhone).*OS (\d+_?\d*)|CPU like Mac OS X/i) || [])[2] || "0").replace("_", ".");
|
|
24
24
|
const iOSVersion = parseFloat(iOSV);
|
|
25
25
|
setIsiOS(!isNaN(iOSVersion));
|
|
26
26
|
if (!isNaN(iOSVersion)) {
|
|
27
27
|
setiOSVersion(iOSV); // Записываем версию iOS
|
|
28
28
|
}
|
|
29
|
-
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(userAgent)) setDevice(
|
|
29
|
+
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(userAgent)) setDevice("mobile");
|
|
30
30
|
}, []);
|
|
31
31
|
return {
|
|
32
32
|
browser,
|