intelicoreact 1.4.21 → 1.4.23
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 -9
- package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.js +1 -10
- package/dist/Atomic/FormElements/Calendar/Calendar.js +4 -24
- package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.js +1 -10
- package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.js +2 -14
- package/dist/Atomic/FormElements/Datepicker/Datepicker.js +5 -54
- package/dist/Atomic/FormElements/Datepicker/components/Calendar.js +3 -21
- package/dist/Atomic/FormElements/Dropdown/Dropdown.js +51 -144
- package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.js +1 -7
- package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.js +25 -91
- package/dist/Atomic/FormElements/FileLoader/FileLoader.js +3 -15
- package/dist/Atomic/FormElements/FileLoader/partial/LoadZone.js +15 -29
- package/dist/Atomic/FormElements/FileLoader/partial/LoadedContent.js +5 -15
- package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.js +6 -26
- package/dist/Atomic/FormElements/FileLoaderLocalGroup/FileLoaderLocalGroup.js +19 -35
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.js +9 -38
- package/dist/Atomic/FormElements/Input/Input.js +25 -60
- package/dist/Atomic/FormElements/InputCalendar/InputCalendar.js +4 -31
- package/dist/Atomic/FormElements/InputColor/InputColor.js +4 -14
- package/dist/Atomic/FormElements/InputCurrency/InputCurrency.js +6 -29
- package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +8 -43
- package/dist/Atomic/FormElements/InputDateRange/components/DateInput.js +3 -21
- package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.js +58 -81
- package/dist/Atomic/FormElements/InputDateRange/components/OpenedPart.js +6 -41
- package/dist/Atomic/FormElements/InputDateRange/components/SelectItem.js +1 -8
- package/dist/Atomic/FormElements/InputDateRange/dependencies.js +16 -46
- package/dist/Atomic/FormElements/InputLink/InputLink.js +6 -23
- package/dist/Atomic/FormElements/InputMask/InputCarretPosition.js +0 -4
- package/dist/Atomic/FormElements/InputMask/InputMask.js +77 -208
- package/dist/Atomic/FormElements/InputMask/functions.js +2 -28
- package/dist/Atomic/FormElements/InputMask2/InputMask2.js +43 -119
- package/dist/Atomic/FormElements/InputMask2/functions.js +2 -28
- package/dist/Atomic/FormElements/InputMask3/InputMask3.js +44 -137
- package/dist/Atomic/FormElements/InputMask3/functions.js +2 -28
- package/dist/Atomic/FormElements/InputWithAction/InputWithAction.js +3 -17
- package/dist/Atomic/FormElements/InputsRow/InputsRow.js +5 -24
- package/dist/Atomic/FormElements/Label/Label.js +1 -9
- package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +35 -73
- package/dist/Atomic/FormElements/MultiSelect/MultiSelect.js +3 -15
- package/dist/Atomic/FormElements/NumericInput/NumericInput.js +23 -44
- package/dist/Atomic/FormElements/RadioGroup/RadioGroup.js +7 -17
- package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +3 -14
- package/dist/Atomic/FormElements/RadioInput/RadioInput.js +1 -10
- package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.js +3 -14
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +3 -23
- package/dist/Atomic/FormElements/RangeInputs/RangeInputs.js +17 -34
- package/dist/Atomic/FormElements/RangeList/RangeList.js +6 -25
- package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.js +1 -11
- package/dist/Atomic/FormElements/RangeSlider/RangeSlider.js +14 -85
- package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +43 -132
- package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.js +1 -10
- package/dist/Atomic/FormElements/Switcher/Switcher.js +1 -10
- package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.js +1 -13
- package/dist/Atomic/FormElements/SwitcherHide/SwitcherHide.js +1 -10
- package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.js +2 -17
- package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.js +3 -17
- package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.js +1 -11
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.js +6 -29
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/partial/States.js +2 -3
- package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.js +1 -12
- package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.js +9 -31
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +125 -213
- package/dist/Atomic/FormElements/Text/Text.js +10 -16
- package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.js +1 -9
- package/dist/Atomic/FormElements/Textarea/Textarea.js +4 -20
- package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +6 -35
- package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.js +4 -13
- package/dist/Atomic/FormElements/TimeRange/TimeRange.js +7 -21
- package/dist/Atomic/FormElements/UserContacts/UserContacts.js +8 -35
- package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.js +5 -18
- package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.js +3 -10
- package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.js +3 -11
- package/dist/Atomic/FormElements/WidgetPseudoTable/partial/constructor.js +1 -2
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.js +5 -12
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/partial/constructor.js +3 -3
- package/dist/Atomic/Layout/Header/Header.js +3 -15
- package/dist/Atomic/Layout/MainMenu/MainMenu.js +3 -20
- package/dist/Atomic/Layout/Spinner/Spinner.js +1 -8
- package/dist/Atomic/UI/Accordion/Accordion.js +3 -19
- package/dist/Atomic/UI/Accordion/AccordionItem.js +9 -23
- package/dist/Atomic/UI/AccordionTable/AccordionTable.js +7 -32
- package/dist/Atomic/UI/AccordionText/AccordionText.js +3 -15
- package/dist/Atomic/UI/AdvancedTag/AdvTag.js +4 -21
- package/dist/Atomic/UI/AdvancedTag/AdvancedTags.js +3 -15
- package/dist/Atomic/UI/Alert/Alert.js +3 -19
- package/dist/Atomic/UI/Arrow/Arrow.js +3 -16
- package/dist/Atomic/UI/Box/Box.js +3 -9
- package/dist/Atomic/UI/Button/Button.js +2 -11
- package/dist/Atomic/UI/ButtonsBar/ButtonsBar.js +1 -10
- package/dist/Atomic/UI/Chart/Chart.js +4 -29
- package/dist/Atomic/UI/Chart/partial/Chart.constants.js +11 -19
- package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +1 -12
- package/dist/Atomic/UI/Chart/partial/datasetSetters.js +11 -34
- package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +82 -56
- package/dist/Atomic/UI/Chart/partial/optionsSetters.js +15 -19
- package/dist/Atomic/UI/Chart/partial/utils.js +6 -20
- package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +3 -13
- package/dist/Atomic/UI/DateTime/DateTime.js +3 -14
- package/dist/Atomic/UI/DebugContainer/DebugContainer.js +4 -16
- package/dist/Atomic/UI/DebugContainer/useDebugContainer.js +3 -11
- package/dist/Atomic/UI/DoubleString/DoubleString.js +5 -17
- package/dist/Atomic/UI/DynamicIcon/DynamicIcon.js +3 -10
- package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +17 -52
- package/dist/Atomic/UI/ExampleChartIntegration/partial/utils.js +1 -29
- package/dist/Atomic/UI/Hint/Hint.js +5 -31
- package/dist/Atomic/UI/Modal/Modal.js +6 -28
- package/dist/Atomic/UI/Modal/ModalHOC.js +1 -9
- package/dist/Atomic/UI/Modal/partials/ModalFooter.js +1 -7
- package/dist/Atomic/UI/Modal/partials/ModalTitle.js +1 -8
- package/dist/Atomic/UI/Modal/partials/useMobileModal.js +32 -49
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +6 -21
- package/dist/Atomic/UI/NavLine/NavLine.js +26 -55
- package/dist/Atomic/UI/NavLine/Tabs.js +2 -3
- package/dist/Atomic/UI/PageTitle/PageTitle.js +2 -10
- package/dist/Atomic/UI/PieChart/PieChart.js +1 -10
- package/dist/Atomic/UI/Price/Price.js +3 -8
- package/dist/Atomic/UI/PriceRange/PriceRange.js +1 -7
- package/dist/Atomic/UI/ProgressLine/ProgressLine.js +1 -16
- package/dist/Atomic/UI/Status/Status.js +1 -8
- package/dist/Atomic/UI/Table/Partials/TdCell.js +5 -29
- package/dist/Atomic/UI/Table/Partials/TdHeader.js +1 -11
- package/dist/Atomic/UI/Table/Partials/TdRow.js +5 -17
- package/dist/Atomic/UI/Table/Partials/TdTitle.js +3 -14
- package/dist/Atomic/UI/Table/Table.js +1 -12
- package/dist/Atomic/UI/Table/TdTypes/TdActions.js +2 -18
- package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +1 -9
- package/dist/Atomic/UI/Table/TdTypes/TdRange.js +1 -4
- package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +1 -13
- package/dist/Atomic/UI/Tag/Tag.js +7 -19
- package/dist/Atomic/UI/TagList/TagList.js +20 -38
- package/dist/Atomic/UI/UserBox/UserBox.js +1 -13
- package/dist/Classes/AbortableFetch.js +36 -93
- package/dist/Classes/AnimatedHandler.js +3 -7
- package/dist/Classes/RESTAPI/index.js +39 -42
- package/dist/Classes/RESTAPI/partials/AbortableFetch.js +35 -93
- package/dist/Classes/RESTAPI/partials/ApiBase.js +1 -9
- package/dist/Classes/RESTAPI/partials/ApiRequestCreators.js +24 -32
- package/dist/Classes/RESTAPI/partials/ApiUtils.js +34 -41
- package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +21 -44
- package/dist/Classes/RESTAPI/partials/Utils.js +6 -19
- package/dist/Classes/RESTAPI/partials/_outerDependencies.js +2 -6
- package/dist/Classes/RESTAPI/partials/_utils.js +13 -36
- package/dist/Constants/index.constants.js +8 -15
- package/dist/Functions/Portal.js +5 -16
- package/dist/Functions/customEventListener.js +4 -17
- package/dist/Functions/fieldValueFormatters.js +43 -83
- package/dist/Functions/hooks/useFormFieldsChangesManager.js +23 -26
- package/dist/Functions/locale/createTranslator.js +4 -9
- package/dist/Functions/operations.js +12 -22
- package/dist/Functions/presets/inputMaskPresets.js +9 -11
- package/dist/Functions/presets/inputPresets.js +8 -11
- package/dist/Functions/presets/mobileKeyboardTypesPresets.js +7 -9
- package/dist/Functions/schemas.js +6 -13
- package/dist/Functions/useBodyScrollLock.js +1 -6
- package/dist/Functions/useClickOutside.js +0 -4
- package/dist/Functions/useDebounce.js +2 -7
- package/dist/Functions/useFieldFocus.js +6 -18
- package/dist/Functions/useFormTools/form-drivers/ArrayWithObjects.js +0 -9
- package/dist/Functions/useFormTools/form-drivers/ObjectWithIterableObjects.js +12 -23
- package/dist/Functions/useFormTools/form-drivers/ObjectWithNamedKeyObjects.js +6 -15
- package/dist/Functions/useFormTools/functions/General.js +18 -28
- package/dist/Functions/useFormTools/functions/RenderFields.js +2 -11
- package/dist/Functions/useFormTools/functions/usePrevious.js +1 -5
- package/dist/Functions/useFormTools/index.js +85 -144
- package/dist/Functions/useInputHighlightError.js +3 -12
- package/dist/Functions/useIsMobile.js +7 -13
- package/dist/Functions/useKeyPress/useHandleKeyPress.js +1 -7
- package/dist/Functions/useKeyPress/useKeyPress.js +1 -9
- package/dist/Functions/useLocalStorage.js +1 -9
- package/dist/Functions/useLocationParams.js +4 -5
- package/dist/Functions/useMediaQuery.js +3 -9
- package/dist/Functions/useMetaInfo.js +3 -10
- package/dist/Functions/useMouseUpOutside.js +0 -3
- package/dist/Functions/useOnlineStatus.js +1 -9
- package/dist/Functions/usePasswordChecker.js +4 -20
- package/dist/Functions/usePrevious.js +1 -5
- package/dist/Functions/useResize.js +2 -10
- package/dist/Functions/useScrollTo.js +2 -7
- package/dist/Functions/useToggle.js +1 -5
- package/dist/Functions/utils.js +56 -131
- package/dist/Molecular/CustomIcons/components/AffiliateNetworks.js +2 -9
- package/dist/Molecular/CustomIcons/components/AlertCircle.js +2 -9
- package/dist/Molecular/CustomIcons/components/AppStore.js +2 -9
- package/dist/Molecular/CustomIcons/components/Arrow.js +2 -9
- package/dist/Molecular/CustomIcons/components/ArrowDown.js +2 -9
- package/dist/Molecular/CustomIcons/components/ArrowLeft.js +2 -9
- package/dist/Molecular/CustomIcons/components/ArrowRight.js +2 -9
- package/dist/Molecular/CustomIcons/components/ArrowUp.js +2 -9
- package/dist/Molecular/CustomIcons/components/Bell.js +2 -9
- package/dist/Molecular/CustomIcons/components/Button.js +2 -9
- package/dist/Molecular/CustomIcons/components/Campaigns.js +2 -9
- package/dist/Molecular/CustomIcons/components/Check.js +2 -9
- package/dist/Molecular/CustomIcons/components/Check2.js +2 -9
- package/dist/Molecular/CustomIcons/components/ChevronDown.js +2 -9
- package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.js +2 -9
- package/dist/Molecular/CustomIcons/components/ChevronLeft.js +2 -9
- package/dist/Molecular/CustomIcons/components/ChevronRight.js +2 -9
- package/dist/Molecular/CustomIcons/components/ChevronUp.js +2 -9
- package/dist/Molecular/CustomIcons/components/ChevronUpDown.js +2 -9
- package/dist/Molecular/CustomIcons/components/Close.js +2 -9
- package/dist/Molecular/CustomIcons/components/ColumnsOrder.js +2 -9
- package/dist/Molecular/CustomIcons/components/Delete.js +2 -9
- package/dist/Molecular/CustomIcons/components/Edit.js +2 -9
- package/dist/Molecular/CustomIcons/components/Email.js +2 -9
- package/dist/Molecular/CustomIcons/components/FinturfLogo.js +2 -9
- package/dist/Molecular/CustomIcons/components/FinturfLogo2.js +2 -9
- package/dist/Molecular/CustomIcons/components/Flows.js +2 -9
- package/dist/Molecular/CustomIcons/components/Gift.js +2 -9
- package/dist/Molecular/CustomIcons/components/GoogleAuth.js +2 -9
- package/dist/Molecular/CustomIcons/components/GooglePlay.js +2 -9
- package/dist/Molecular/CustomIcons/components/HelpCircle.js +2 -9
- package/dist/Molecular/CustomIcons/components/HelpCircle2.js +2 -9
- package/dist/Molecular/CustomIcons/components/HelpCircleFilled.js +2 -9
- package/dist/Molecular/CustomIcons/components/Home.js +2 -9
- package/dist/Molecular/CustomIcons/components/Home2.js +2 -9
- package/dist/Molecular/CustomIcons/components/Key.js +2 -9
- package/dist/Molecular/CustomIcons/components/Landers.js +2 -9
- package/dist/Molecular/CustomIcons/components/Lock.js +2 -9
- package/dist/Molecular/CustomIcons/components/Mail.js +2 -9
- package/dist/Molecular/CustomIcons/components/Mastercard.js +2 -9
- package/dist/Molecular/CustomIcons/components/Minus.js +2 -9
- package/dist/Molecular/CustomIcons/components/Offers.js +2 -9
- package/dist/Molecular/CustomIcons/components/Pause.js +2 -9
- package/dist/Molecular/CustomIcons/components/PayPal.js +2 -9
- package/dist/Molecular/CustomIcons/components/PayPalLightLarge.js +2 -9
- package/dist/Molecular/CustomIcons/components/Phone.js +2 -9
- package/dist/Molecular/CustomIcons/components/Play.js +2 -9
- package/dist/Molecular/CustomIcons/components/Plus.js +2 -9
- package/dist/Molecular/CustomIcons/components/Profile.js +2 -9
- package/dist/Molecular/CustomIcons/components/QRCode.js +2 -9
- package/dist/Molecular/CustomIcons/components/Rectangle.js +2 -9
- package/dist/Molecular/CustomIcons/components/Revert.js +2 -9
- package/dist/Molecular/CustomIcons/components/Star.js +2 -9
- package/dist/Molecular/CustomIcons/components/Star2.js +2 -9
- package/dist/Molecular/CustomIcons/components/TrafficSources.js +2 -9
- package/dist/Molecular/CustomIcons/components/Trash.js +2 -9
- package/dist/Molecular/CustomIcons/components/TrashRed.js +2 -9
- package/dist/Molecular/CustomIcons/components/Triggers.js +2 -9
- package/dist/Molecular/CustomIcons/components/User.js +2 -9
- package/dist/Molecular/CustomIcons/components/Visa.js +2 -9
- package/dist/Molecular/CustomIcons/components/X.js +2 -9
- package/dist/Molecular/CustomIcons/index.js +0 -122
- package/dist/Molecular/FormElement/FormElement.js +1 -12
- package/dist/Molecular/FormWithDependOn/FormWithDependOn.js +30 -31
- package/dist/Molecular/FormWithDependOn/partials/_utils.js +9 -12
- package/dist/Molecular/InputAddress/InputAddress.js +65 -114
- package/dist/Molecular/InputPassword/InputPassword.js +5 -19
- package/dist/index.js +0 -2
- package/package.json +1 -1
- package/dist/Atomic/FormElements/UserContacts/partial/defaultIcons.js +0 -91
- package/dist/Atomic/UI/ModalBackup/Modal.js +0 -174
- package/dist/Atomic/UI/ModalBackup/Modal.scss +0 -333
- package/dist/Atomic/UI/ModalBackup/ModalHOC.js +0 -51
- package/dist/Atomic/UI/ModalBackup/partials/ModalFooter.js +0 -24
- package/dist/Atomic/UI/ModalBackup/partials/ModalTitle.js +0 -41
|
@@ -4,15 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.useInputHighlightError = exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
8
|
var _index = require("../Constants/index.constants");
|
|
11
|
-
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
|
-
|
|
9
|
+
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); }
|
|
10
|
+
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
11
|
const useInputHighlightError = _ref => {
|
|
17
12
|
let {
|
|
18
13
|
value,
|
|
@@ -23,7 +18,6 @@ const useInputHighlightError = _ref => {
|
|
|
23
18
|
const [isToHighlightError, setIsToHighlightError] = (0, _react.useState)(false);
|
|
24
19
|
const [isAttemptToChange, setIsAttemptToChange] = (0, _react.useState)(false);
|
|
25
20
|
const [prevValue, setPreviousValue] = (0, _react.useState)(value);
|
|
26
|
-
|
|
27
21
|
function hasHighlightError(e) {
|
|
28
22
|
const changedValue = "".concat(value !== null && value !== void 0 ? value : "");
|
|
29
23
|
const previousValue = "".concat(prevValue !== null && prevValue !== void 0 ? prevValue : "");
|
|
@@ -45,7 +39,6 @@ const useInputHighlightError = _ref => {
|
|
|
45
39
|
const currentSet = changedValue === null || changedValue === void 0 ? void 0 : changedValue.replace(samePart, "");
|
|
46
40
|
if (!_index.KEYBOARD_SERVICE_KEYS.includes(e.key) && changedValue === previousValue) setIsAttemptToChange(!(!differencesLength && e.key === currentSet));
|
|
47
41
|
}
|
|
48
|
-
|
|
49
42
|
(0, _react.useEffect)(() => {
|
|
50
43
|
if (isUseErrorsBlink && isAttemptToChange) {
|
|
51
44
|
setIsAttemptToChange(null);
|
|
@@ -62,7 +55,5 @@ const useInputHighlightError = _ref => {
|
|
|
62
55
|
hasHighlightError
|
|
63
56
|
};
|
|
64
57
|
};
|
|
65
|
-
|
|
66
58
|
exports.useInputHighlightError = useInputHighlightError;
|
|
67
|
-
var _default = useInputHighlightError;
|
|
68
|
-
exports.default = _default;
|
|
59
|
+
var _default = exports.default = useInputHighlightError;
|
|
@@ -4,29 +4,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
|
-
|
|
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
|
+
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; }
|
|
14
10
|
const useIsMobile = function () {
|
|
15
11
|
let {
|
|
16
12
|
isWithoutWidthCheck = false
|
|
17
13
|
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
18
|
-
|
|
19
14
|
const getIsMobile = () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
15
|
+
const [isMobile, setIsMobile] = (0, _react.useState)(getIsMobile());
|
|
20
16
|
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
// Detect Mobile
|
|
23
18
|
(0, _react.useEffect)(() => {
|
|
24
19
|
if (getIsMobile()) setIsMobile(true);
|
|
25
20
|
}, [navigator.userAgent]);
|
|
26
|
-
return {
|
|
21
|
+
return {
|
|
22
|
+
...navigator,
|
|
27
23
|
isMobile: isMobile && (isWithoutWidthCheck || window.screen.width <= 768)
|
|
28
24
|
};
|
|
29
25
|
};
|
|
30
|
-
|
|
31
|
-
var _default = useIsMobile;
|
|
32
|
-
exports.default = _default;
|
|
26
|
+
var _default = exports.default = useIsMobile;
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = require("react");
|
|
11
|
-
|
|
12
9
|
var _useKeyPress = _interopRequireDefault(require("./useKeyPress"));
|
|
13
|
-
|
|
14
10
|
/**
|
|
15
11
|
* @function useHandleKeyPress
|
|
16
12
|
* @param {Object} props - объект с действиями и состоянием обновления.
|
|
@@ -46,6 +42,4 @@ const useHandleKeyPress = _ref => {
|
|
|
46
42
|
if (isPressEscape && typeof escCallback === "function") escCallback();
|
|
47
43
|
}, [enterCallback, escCallback, isPressEnter, isPressEscape]);
|
|
48
44
|
};
|
|
49
|
-
|
|
50
|
-
var _default = useHandleKeyPress;
|
|
51
|
-
exports.default = _default;
|
|
45
|
+
var _default = exports.default = useHandleKeyPress;
|
|
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
const useKeyPress = function (targetKey) {
|
|
11
9
|
let clamping = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
12
10
|
const [keyPressed, setKeyPressed] = (0, _react.useState)(false);
|
|
@@ -15,7 +13,6 @@ const useKeyPress = function (targetKey) {
|
|
|
15
13
|
key,
|
|
16
14
|
repeat
|
|
17
15
|
} = _ref;
|
|
18
|
-
|
|
19
16
|
if (key === targetKey) {
|
|
20
17
|
if (!clamping && repeat) return;
|
|
21
18
|
setKeyPressed(true);
|
|
@@ -26,7 +23,6 @@ const useKeyPress = function (targetKey) {
|
|
|
26
23
|
key,
|
|
27
24
|
repeat
|
|
28
25
|
} = _ref2;
|
|
29
|
-
|
|
30
26
|
if (key === targetKey) {
|
|
31
27
|
if (!clamping && repeat) return;
|
|
32
28
|
setKeyPressed(false);
|
|
@@ -34,9 +30,7 @@ const useKeyPress = function (targetKey) {
|
|
|
34
30
|
}, [clamping, targetKey]);
|
|
35
31
|
(0, _react.useEffect)(() => {
|
|
36
32
|
const handleDown = event => downHandler(event);
|
|
37
|
-
|
|
38
33
|
const handleUp = event => upHandler(event);
|
|
39
|
-
|
|
40
34
|
window.addEventListener("keydown", handleDown);
|
|
41
35
|
window.addEventListener("keyup", handleUp);
|
|
42
36
|
return () => {
|
|
@@ -46,6 +40,4 @@ const useKeyPress = function (targetKey) {
|
|
|
46
40
|
}, [downHandler, upHandler]);
|
|
47
41
|
return keyPressed;
|
|
48
42
|
};
|
|
49
|
-
|
|
50
|
-
var _default = useKeyPress;
|
|
51
|
-
exports.default = _default;
|
|
43
|
+
var _default = exports.default = useKeyPress;
|
|
@@ -4,15 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
const useLocalStorage = (key, initialValue) => {
|
|
11
9
|
const [storedValue, setStoredValue] = (0, _react.useState)(() => {
|
|
12
10
|
if (typeof window === "undefined") {
|
|
13
11
|
return initialValue;
|
|
14
12
|
}
|
|
15
|
-
|
|
16
13
|
try {
|
|
17
14
|
const item = window.localStorage.getItem(key);
|
|
18
15
|
return item ? JSON.parse(item) : initialValue;
|
|
@@ -22,12 +19,10 @@ const useLocalStorage = (key, initialValue) => {
|
|
|
22
19
|
return initialValue;
|
|
23
20
|
}
|
|
24
21
|
});
|
|
25
|
-
|
|
26
22
|
const setValue = value => {
|
|
27
23
|
try {
|
|
28
24
|
const valueToStore = value instanceof Function ? value(storedValue) : value;
|
|
29
25
|
setStoredValue(valueToStore);
|
|
30
|
-
|
|
31
26
|
if (typeof window !== "undefined") {
|
|
32
27
|
window.localStorage.setItem(key, JSON.stringify(valueToStore));
|
|
33
28
|
}
|
|
@@ -36,9 +31,6 @@ const useLocalStorage = (key, initialValue) => {
|
|
|
36
31
|
console.log(error);
|
|
37
32
|
}
|
|
38
33
|
};
|
|
39
|
-
|
|
40
34
|
return [storedValue, setValue];
|
|
41
35
|
};
|
|
42
|
-
|
|
43
|
-
var _default = useLocalStorage;
|
|
44
|
-
exports.default = _default;
|
|
36
|
+
var _default = exports.default = useLocalStorage;
|
|
@@ -4,22 +4,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = useLocationParams;
|
|
7
|
-
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
function useLocationParams() {
|
|
11
9
|
const [params, setParams] = (0, _react.useState)({});
|
|
12
10
|
(0, _react.useEffect)(() => {
|
|
13
11
|
setParams(state => {
|
|
14
12
|
var _window$location$sear;
|
|
15
|
-
|
|
16
13
|
const arr = (_window$location$sear = window.location.search) === null || _window$location$sear === void 0 ? void 0 : _window$location$sear.replace("?", "").split("&");
|
|
17
|
-
return {
|
|
14
|
+
return {
|
|
15
|
+
...state,
|
|
18
16
|
...arr.reduce((obj, item) => {
|
|
19
17
|
const keyVal = item.split("=");
|
|
20
18
|
const key = keyVal[0];
|
|
21
19
|
const value = keyVal[1];
|
|
22
|
-
return {
|
|
20
|
+
return {
|
|
21
|
+
...obj,
|
|
23
22
|
[key]: value
|
|
24
23
|
};
|
|
25
24
|
}, {})
|
|
@@ -4,18 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
var _utils = require("./utils");
|
|
11
|
-
|
|
12
9
|
function useMediaQuery(query) {
|
|
13
10
|
const getMatches = (0, _react.useMemo)(() => {
|
|
14
11
|
return inputQuery => {
|
|
15
12
|
if (typeof window !== "undefined" && "matchMedia" in window) {
|
|
16
13
|
return window.matchMedia(inputQuery).matches;
|
|
17
14
|
}
|
|
18
|
-
|
|
19
15
|
return false;
|
|
20
16
|
};
|
|
21
17
|
}, []);
|
|
@@ -24,14 +20,12 @@ function useMediaQuery(query) {
|
|
|
24
20
|
if (typeof window !== "undefined" && "matchMedia" in window) {
|
|
25
21
|
const matchMedia = window.matchMedia(query);
|
|
26
22
|
const debouncedChangeHandler = (0, _utils.debounce)(() => setMatches(getMatches(query)), 300);
|
|
27
|
-
matchMedia === null || matchMedia === void 0
|
|
23
|
+
matchMedia === null || matchMedia === void 0 || matchMedia.addEventListener("change", debouncedChangeHandler);
|
|
28
24
|
return () => {
|
|
29
|
-
matchMedia === null || matchMedia === void 0
|
|
25
|
+
matchMedia === null || matchMedia === void 0 || matchMedia.removeEventListener("change", debouncedChangeHandler);
|
|
30
26
|
};
|
|
31
27
|
}
|
|
32
28
|
}, [query, getMatches]);
|
|
33
29
|
return matches;
|
|
34
30
|
}
|
|
35
|
-
|
|
36
|
-
var _default = useMediaQuery;
|
|
37
|
-
exports.default = _default;
|
|
31
|
+
var _default = exports.default = useMediaQuery;
|
|
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.useMetaInfo = exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
const useMetaInfo = () => {
|
|
11
9
|
const [browser, setBrowser] = (0, _react.useState)("Other");
|
|
12
10
|
const [device, setDevice] = (0, _react.useState)("desktop");
|
|
@@ -15,22 +13,19 @@ const useMetaInfo = () => {
|
|
|
15
13
|
const [iOSVersion, setiOSVersion] = (0, _react.useState)(null);
|
|
16
14
|
(0, _react.useEffect)(() => {
|
|
17
15
|
const userAgent = navigator.userAgent;
|
|
18
|
-
|
|
19
16
|
if (userAgent.indexOf("Chrome") !== -1) {
|
|
20
|
-
setBrowser("Chrome");
|
|
17
|
+
setBrowser("Chrome");
|
|
21
18
|
|
|
19
|
+
// Извлечение версии Chrome
|
|
22
20
|
const version = userAgent.match(/Chrom(e|ium)\/([0-9\.]+)/)[2];
|
|
23
21
|
setChromeVersion(version);
|
|
24
22
|
} else if (userAgent.indexOf("Safari") !== -1) setBrowser("Safari");
|
|
25
|
-
|
|
26
23
|
const iOSV = ((userAgent.match(/(CPU|iPhone).*OS (\d+_?\d*)|CPU like Mac OS X/i) || [])[2] || "0").replace("_", ".");
|
|
27
24
|
const iOSVersion = parseFloat(iOSV);
|
|
28
25
|
setIsiOS(!isNaN(iOSVersion));
|
|
29
|
-
|
|
30
26
|
if (!isNaN(iOSVersion)) {
|
|
31
27
|
setiOSVersion(iOSV); // Записываем версию iOS
|
|
32
28
|
}
|
|
33
|
-
|
|
34
29
|
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(userAgent)) setDevice("mobile");
|
|
35
30
|
}, []);
|
|
36
31
|
return {
|
|
@@ -41,7 +36,5 @@ const useMetaInfo = () => {
|
|
|
41
36
|
iOSVersion
|
|
42
37
|
}; // Возврат версий Chrome и iOS
|
|
43
38
|
};
|
|
44
|
-
|
|
45
39
|
exports.useMetaInfo = useMetaInfo;
|
|
46
|
-
var _default = useMetaInfo;
|
|
47
|
-
exports.default = _default;
|
|
40
|
+
var _default = exports.default = useMetaInfo;
|
|
@@ -4,16 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = useMouseUpOutside;
|
|
7
|
-
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
function useMouseUpOutside(ref, setOut, open) {
|
|
11
9
|
function handleMouseUpOutside(event) {
|
|
12
10
|
if (ref.current && !ref.current.contains(event.target)) {
|
|
13
11
|
setOut(open);
|
|
14
12
|
}
|
|
15
13
|
}
|
|
16
|
-
|
|
17
14
|
(0, _react.useEffect)(() => {
|
|
18
15
|
document.addEventListener("mouseup", handleMouseUpOutside);
|
|
19
16
|
return () => {
|
|
@@ -4,20 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
const useOnlineStatus = () => {
|
|
11
9
|
function getOnlineStatus() {
|
|
12
10
|
return typeof navigator !== "undefined" && typeof navigator.onLine === "boolean" ? navigator.onLine : true;
|
|
13
11
|
}
|
|
14
|
-
|
|
15
12
|
const [onlineStatus, setOnlineStatus] = (0, _react.useState)(getOnlineStatus());
|
|
16
|
-
|
|
17
13
|
const goOnline = () => setOnlineStatus(true);
|
|
18
|
-
|
|
19
14
|
const goOffline = () => setOnlineStatus(false);
|
|
20
|
-
|
|
21
15
|
(0, _react.useEffect)(() => {
|
|
22
16
|
window.addEventListener("online", goOnline);
|
|
23
17
|
window.addEventListener("offline", goOffline);
|
|
@@ -28,6 +22,4 @@ const useOnlineStatus = () => {
|
|
|
28
22
|
}, []);
|
|
29
23
|
return onlineStatus;
|
|
30
24
|
};
|
|
31
|
-
|
|
32
|
-
var _default = useOnlineStatus;
|
|
33
|
-
exports.default = _default;
|
|
25
|
+
var _default = exports.default = useOnlineStatus;
|
|
@@ -1,25 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = usePasswordChecker;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
-
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
-
|
|
10
|
+
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); }
|
|
11
|
+
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; }
|
|
18
12
|
function usePasswordChecker() {
|
|
19
13
|
const [checkRules, setCheckRules] = (0, _react.useState)([]);
|
|
20
|
-
|
|
21
14
|
const addCheckRule = data => setCheckRules(state => [...state, data]);
|
|
22
|
-
|
|
23
15
|
const handleCheckRule = function (type) {
|
|
24
16
|
let props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
25
17
|
let value = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "";
|
|
@@ -27,13 +19,11 @@ function usePasswordChecker() {
|
|
|
27
19
|
min,
|
|
28
20
|
max
|
|
29
21
|
} = props;
|
|
30
|
-
|
|
31
22
|
switch (type) {
|
|
32
23
|
case "len":
|
|
33
24
|
if (min && value.length < min) return false;
|
|
34
25
|
if (max && value.length > max) return false;
|
|
35
26
|
return true;
|
|
36
|
-
|
|
37
27
|
case "lowerCaseContains":
|
|
38
28
|
{
|
|
39
29
|
const toUpperCase = value.slice().toUpperCase().split("");
|
|
@@ -43,7 +33,6 @@ function usePasswordChecker() {
|
|
|
43
33
|
return isMatch;
|
|
44
34
|
}, false);
|
|
45
35
|
}
|
|
46
|
-
|
|
47
36
|
case "upperCaseContains":
|
|
48
37
|
{
|
|
49
38
|
const toLowerCase = value.slice().toLowerCase().split("");
|
|
@@ -53,7 +42,6 @@ function usePasswordChecker() {
|
|
|
53
42
|
return isMatch;
|
|
54
43
|
}, false);
|
|
55
44
|
}
|
|
56
|
-
|
|
57
45
|
case "numberContains":
|
|
58
46
|
{
|
|
59
47
|
const original = value.slice().split("");
|
|
@@ -62,7 +50,6 @@ function usePasswordChecker() {
|
|
|
62
50
|
return isMatch;
|
|
63
51
|
}, false);
|
|
64
52
|
}
|
|
65
|
-
|
|
66
53
|
case "specialContains":
|
|
67
54
|
{
|
|
68
55
|
const original = value.slice().split("");
|
|
@@ -71,12 +58,10 @@ function usePasswordChecker() {
|
|
|
71
58
|
return isMatch;
|
|
72
59
|
}, false);
|
|
73
60
|
}
|
|
74
|
-
|
|
75
61
|
default:
|
|
76
62
|
return false;
|
|
77
63
|
}
|
|
78
64
|
};
|
|
79
|
-
|
|
80
65
|
const testCheckRules = value => {
|
|
81
66
|
let result = true;
|
|
82
67
|
setCheckRules(state => {
|
|
@@ -84,14 +69,14 @@ function usePasswordChecker() {
|
|
|
84
69
|
return rules.map(rule => {
|
|
85
70
|
const isMatch = handleCheckRule(rule.type, rule.props, value);
|
|
86
71
|
if (!isMatch) result = false;
|
|
87
|
-
return {
|
|
72
|
+
return {
|
|
73
|
+
...rule,
|
|
88
74
|
isMatch
|
|
89
75
|
};
|
|
90
76
|
});
|
|
91
77
|
});
|
|
92
78
|
return result;
|
|
93
79
|
};
|
|
94
|
-
|
|
95
80
|
const renderPasswordChecker = () => {
|
|
96
81
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
97
82
|
className: "password-checker"
|
|
@@ -121,7 +106,6 @@ function usePasswordChecker() {
|
|
|
121
106
|
}, " ", text, " "), " ");
|
|
122
107
|
}), " "), " ");
|
|
123
108
|
};
|
|
124
|
-
|
|
125
109
|
return {
|
|
126
110
|
addCheckRule,
|
|
127
111
|
testCheckRules,
|
|
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
function usePrevious(value) {
|
|
11
9
|
const ref = (0, _react.useRef)();
|
|
12
10
|
(0, _react.useEffect)(() => {
|
|
@@ -14,6 +12,4 @@ function usePrevious(value) {
|
|
|
14
12
|
}, [value]);
|
|
15
13
|
return ref.current;
|
|
16
14
|
}
|
|
17
|
-
|
|
18
|
-
var _default = usePrevious;
|
|
19
|
-
exports.default = _default;
|
|
15
|
+
var _default = exports.default = usePrevious;
|
|
@@ -4,23 +4,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.useResize = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
const useResize = function () {
|
|
11
9
|
let element = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
12
10
|
const [elemPosition, setElemPosition] = (0, _react.useState)("");
|
|
13
|
-
|
|
14
11
|
const onResize = elemRightPosition => {
|
|
15
12
|
if (elemRightPosition > document.documentElement.clientWidth) {
|
|
16
13
|
return setElemPosition("left");
|
|
17
14
|
} else setElemPosition("");
|
|
18
15
|
};
|
|
19
|
-
|
|
20
16
|
(0, _react.useEffect)(() => {
|
|
21
17
|
var _element$current;
|
|
22
|
-
|
|
23
|
-
const elemRightPosition = (element === null || element === void 0 ? void 0 : (_element$current = element.current) === null || _element$current === void 0 ? void 0 : _element$current.getBoundingClientRect().right) + 20;
|
|
18
|
+
const elemRightPosition = (element === null || element === void 0 || (_element$current = element.current) === null || _element$current === void 0 ? void 0 : _element$current.getBoundingClientRect().right) + 20;
|
|
24
19
|
window.addEventListener("resize", () => onResize(elemRightPosition));
|
|
25
20
|
return () => {
|
|
26
21
|
window.removeEventListener("resize", () => setElemPosition(""));
|
|
@@ -28,9 +23,7 @@ const useResize = function () {
|
|
|
28
23
|
}, []);
|
|
29
24
|
(0, _react.useLayoutEffect)(() => {
|
|
30
25
|
var _element$current2;
|
|
31
|
-
|
|
32
|
-
const elemRightPosition = (element === null || element === void 0 ? void 0 : (_element$current2 = element.current) === null || _element$current2 === void 0 ? void 0 : _element$current2.getBoundingClientRect().right) + 20;
|
|
33
|
-
|
|
26
|
+
const elemRightPosition = (element === null || element === void 0 || (_element$current2 = element.current) === null || _element$current2 === void 0 ? void 0 : _element$current2.getBoundingClientRect().right) + 20;
|
|
34
27
|
if (elemRightPosition > document.documentElement.clientWidth) {
|
|
35
28
|
return setElemPosition("left");
|
|
36
29
|
}
|
|
@@ -39,5 +32,4 @@ const useResize = function () {
|
|
|
39
32
|
elemPosition
|
|
40
33
|
};
|
|
41
34
|
};
|
|
42
|
-
|
|
43
35
|
exports.useResize = useResize;
|
|
@@ -4,17 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
const useScrollTo = reference => {
|
|
11
9
|
const ref = (0, _react.useRef)(reference);
|
|
12
10
|
const [shouldScrollTo, setShouldScrollTo] = (0, _react.useState)(false);
|
|
13
11
|
(0, _react.useEffect)(() => {
|
|
14
12
|
if (ref !== null && ref !== void 0 && ref.current && shouldScrollTo) {
|
|
15
13
|
var _ref$current, _ref$current$scrollIn;
|
|
16
|
-
|
|
17
|
-
ref === null || ref === void 0 ? void 0 : (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : (_ref$current$scrollIn = _ref$current.scrollIntoView) === null || _ref$current$scrollIn === void 0 ? void 0 : _ref$current$scrollIn.call(_ref$current, {
|
|
14
|
+
ref === null || ref === void 0 || (_ref$current = ref.current) === null || _ref$current === void 0 || (_ref$current$scrollIn = _ref$current.scrollIntoView) === null || _ref$current$scrollIn === void 0 || _ref$current$scrollIn.call(_ref$current, {
|
|
18
15
|
behavior: "smooth"
|
|
19
16
|
});
|
|
20
17
|
setShouldScrollTo(false);
|
|
@@ -22,6 +19,4 @@ const useScrollTo = reference => {
|
|
|
22
19
|
}, [shouldScrollTo]);
|
|
23
20
|
return [ref, setShouldScrollTo];
|
|
24
21
|
};
|
|
25
|
-
|
|
26
|
-
var _default = useScrollTo;
|
|
27
|
-
exports.default = _default;
|
|
22
|
+
var _default = exports.default = useScrollTo;
|
|
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
const useToggle = initialState => {
|
|
11
9
|
const [isToggled, setToggle] = (0, _react.useState)(Boolean(initialState));
|
|
12
10
|
const toggle = (0, _react.useCallback)(() => setToggle(isOn => !isOn), []);
|
|
@@ -19,6 +17,4 @@ const useToggle = initialState => {
|
|
|
19
17
|
toggleOff
|
|
20
18
|
};
|
|
21
19
|
};
|
|
22
|
-
|
|
23
|
-
var _default = useToggle;
|
|
24
|
-
exports.default = _default;
|
|
20
|
+
var _default = exports.default = useToggle;
|