intelicoreact 1.3.21 → 1.3.22
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 +15 -23
- package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.js +15 -23
- package/dist/Atomic/FormElements/Calendar/Calendar.js +69 -124
- package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.js +27 -36
- package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.js +23 -39
- package/dist/Atomic/FormElements/Datepicker/Datepicker.js +110 -246
- package/dist/Atomic/FormElements/Datepicker/components/Calendar.js +44 -85
- package/dist/Atomic/FormElements/Dropdown/Dropdown.js +246 -414
- package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.js +5 -9
- package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.js +93 -165
- package/dist/Atomic/FormElements/FileLoader/FileLoader.js +39 -64
- package/dist/Atomic/FormElements/FileLoader/partial/LoadZone.js +51 -132
- package/dist/Atomic/FormElements/FileLoader/partial/LoadedContent.js +34 -73
- package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.js +54 -75
- package/dist/Atomic/FormElements/FileLoaderLocalGroup/FileLoaderLocalGroup.js +67 -110
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.js +33 -83
- package/dist/Atomic/FormElements/Input/Input.js +161 -253
- package/dist/Atomic/FormElements/InputCalendar/InputCalendar.js +48 -102
- package/dist/Atomic/FormElements/InputColor/InputColor.js +27 -40
- package/dist/Atomic/FormElements/InputCurrency/InputCurrency.js +28 -58
- package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +108 -176
- package/dist/Atomic/FormElements/InputDateRange/components/DateInput.js +32 -57
- package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.js +184 -302
- package/dist/Atomic/FormElements/InputDateRange/components/OpenedPart.js +85 -157
- package/dist/Atomic/FormElements/InputDateRange/components/SelectItem.js +11 -16
- package/dist/Atomic/FormElements/InputDateRange/dependencies.js +76 -193
- package/dist/Atomic/FormElements/InputLink/InputLink.js +34 -58
- package/dist/Atomic/FormElements/InputMask/InputCarretPosition.js +8 -12
- package/dist/Atomic/FormElements/InputMask/InputMask.js +554 -964
- package/dist/Atomic/FormElements/InputMask/config.js +1 -1
- package/dist/Atomic/FormElements/InputMask/functions.js +17 -43
- package/dist/Atomic/FormElements/InputMask2/InputMask2.js +268 -404
- package/dist/Atomic/FormElements/InputMask2/config.js +1 -1
- package/dist/Atomic/FormElements/InputMask2/functions.js +17 -43
- package/dist/Atomic/FormElements/InputMask3/InputMask3.js +300 -460
- package/dist/Atomic/FormElements/InputMask3/config.js +1 -1
- package/dist/Atomic/FormElements/InputMask3/functions.js +17 -43
- package/dist/Atomic/FormElements/InputWithAction/InputWithAction.js +53 -113
- package/dist/Atomic/FormElements/InputsRow/InputsRow.js +64 -118
- package/dist/Atomic/FormElements/Label/Label.js +13 -23
- package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +217 -349
- package/dist/Atomic/FormElements/MultiSelect/MultiSelect.js +25 -47
- package/dist/Atomic/FormElements/NumericInput/NumericInput.js +133 -207
- package/dist/Atomic/FormElements/RadioGroup/RadioGroup.js +29 -61
- package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +20 -42
- package/dist/Atomic/FormElements/RadioInput/RadioInput.js +22 -33
- package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.js +20 -43
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +54 -101
- package/dist/Atomic/FormElements/RangeInputs/RangeInputs.js +59 -102
- package/dist/Atomic/FormElements/RangeList/RangeList.js +89 -150
- package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.js +23 -29
- package/dist/Atomic/FormElements/RangeSlider/RangeSlider.js +135 -300
- package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +381 -571
- package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.js +14 -24
- package/dist/Atomic/FormElements/Switcher/Switcher.js +24 -29
- package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.js +25 -47
- package/dist/Atomic/FormElements/SwitcherHide/SwitcherHide.js +20 -32
- package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.js +32 -55
- package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.js +22 -42
- package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.js +23 -33
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.js +51 -120
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/partial/States.js +2 -3
- package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.js +23 -46
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +260 -413
- package/dist/Atomic/FormElements/Text/Text.js +47 -53
- package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.js +21 -31
- package/dist/Atomic/FormElements/Textarea/Textarea.js +16 -27
- package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +68 -128
- package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.js +25 -36
- package/dist/Atomic/FormElements/TimeRange/TimeRange.js +33 -70
- package/dist/Atomic/FormElements/UserContacts/UserContacts.js +58 -124
- package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.js +48 -80
- package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.js +32 -42
- package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.js +40 -60
- package/dist/Atomic/FormElements/WidgetPseudoTable/partial/constructor.js +2 -3
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.js +50 -69
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/partial/constructor.js +3 -3
- package/dist/Atomic/Layout/Header/Header.js +21 -48
- package/dist/Atomic/Layout/MainMenu/MainMenu.js +36 -79
- package/dist/Atomic/Layout/Spinner/Spinner.js +8 -14
- package/dist/Atomic/UI/Accordion/Accordion.js +18 -48
- package/dist/Atomic/UI/Accordion/AccordionItem.js +35 -60
- package/dist/Atomic/UI/AccordionTable/AccordionTable.js +49 -106
- package/dist/Atomic/UI/AccordionText/AccordionText.js +13 -37
- package/dist/Atomic/UI/AdvancedTag/AdvTag.js +48 -94
- package/dist/Atomic/UI/AdvancedTag/AdvancedTags.js +22 -50
- package/dist/Atomic/UI/Alert/Alert.js +20 -44
- package/dist/Atomic/UI/Arrow/Arrow.js +15 -35
- package/dist/Atomic/UI/Box/Box.js +14 -21
- package/dist/Atomic/UI/Button/Button.js +26 -35
- package/dist/Atomic/UI/ButtonsBar/ButtonsBar.js +22 -31
- package/dist/Atomic/UI/Chart/Chart.js +45 -86
- package/dist/Atomic/UI/Chart/partial/Chart.constants.js +14 -24
- package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +13 -22
- package/dist/Atomic/UI/Chart/partial/datasetSetters.js +68 -113
- package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +158 -140
- package/dist/Atomic/UI/Chart/partial/optionsSetters.js +26 -42
- package/dist/Atomic/UI/Chart/partial/utils.js +20 -48
- package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +22 -42
- package/dist/Atomic/UI/DateTime/DateTime.js +23 -38
- package/dist/Atomic/UI/DebugContainer/DebugContainer.js +12 -36
- package/dist/Atomic/UI/DebugContainer/useDebugContainer.js +5 -21
- package/dist/Atomic/UI/DoubleString/DoubleString.js +27 -50
- package/dist/Atomic/UI/DynamicIcon/DynamicIcon.js +15 -63
- package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +62 -157
- package/dist/Atomic/UI/ExampleChartIntegration/partial/utils.js +47 -110
- package/dist/Atomic/UI/Hint/Hint.js +49 -94
- package/dist/Atomic/UI/Modal/Modal.js +149 -179
- package/dist/Atomic/UI/Modal/ModalHOC.js +12 -21
- package/dist/Atomic/UI/Modal/partials/ModalFooter.js +7 -12
- package/dist/Atomic/UI/Modal/partials/ModalTitle.js +17 -21
- package/dist/Atomic/UI/Modal/partials/useMobileModal.js +98 -160
- package/dist/Atomic/UI/ModalBackup/Modal.js +65 -90
- package/dist/Atomic/UI/ModalBackup/ModalHOC.js +12 -21
- package/dist/Atomic/UI/ModalBackup/partials/ModalFooter.js +6 -11
- package/dist/Atomic/UI/ModalBackup/partials/ModalTitle.js +15 -19
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +32 -62
- package/dist/Atomic/UI/NavLine/NavLine.js +120 -211
- package/dist/Atomic/UI/NavLine/Tabs.js +2 -3
- package/dist/Atomic/UI/PageTitle/PageTitle.js +13 -17
- package/dist/Atomic/UI/PieChart/PieChart.js +11 -21
- package/dist/Atomic/UI/Price/Price.js +10 -13
- package/dist/Atomic/UI/PriceRange/PriceRange.js +7 -11
- package/dist/Atomic/UI/ProgressLine/ProgressLine.js +27 -56
- package/dist/Atomic/UI/Status/Status.js +19 -30
- package/dist/Atomic/UI/Table/Partials/TdCell.js +28 -71
- package/dist/Atomic/UI/Table/Partials/TdHeader.js +7 -16
- package/dist/Atomic/UI/Table/Partials/TdRow.js +29 -65
- package/dist/Atomic/UI/Table/Partials/TdTitle.js +16 -40
- package/dist/Atomic/UI/Table/Table.js +27 -47
- package/dist/Atomic/UI/Table/TdTypes/TdActions.js +18 -48
- package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +9 -19
- package/dist/Atomic/UI/Table/TdTypes/TdRange.js +5 -8
- package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +25 -47
- package/dist/Atomic/UI/Tag/Tag.js +20 -48
- package/dist/Atomic/UI/TagList/TagList.js +80 -150
- package/dist/Atomic/UI/UserBox/UserBox.js +14 -26
- package/dist/Classes/AbortableFetch.js +283 -422
- package/dist/Classes/AnimatedHandler.js +44 -56
- package/dist/Classes/RESTAPI/index.js +154 -433
- package/dist/Classes/RESTAPI/partials/AbortableFetch.js +290 -428
- package/dist/Classes/RESTAPI/partials/ApiBase.js +24 -67
- package/dist/Classes/RESTAPI/partials/ApiRequestCreators.js +57 -275
- package/dist/Classes/RESTAPI/partials/ApiUtils.js +146 -377
- package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +155 -403
- package/dist/Classes/RESTAPI/partials/Utils.js +81 -135
- package/dist/Classes/RESTAPI/partials/_outerDependencies.js +2 -6
- package/dist/Classes/RESTAPI/partials/_utils.js +101 -395
- package/dist/Constants/index.constants.js +8 -15
- package/dist/Functions/Portal.js +14 -33
- package/dist/Functions/customEventListener.js +5 -20
- package/dist/Functions/fieldValueFormatters.js +148 -211
- package/dist/Functions/hooks/useFormFieldsChangesManager.js +75 -137
- package/dist/Functions/locale/createTranslator.js +13 -27
- package/dist/Functions/operations.js +35 -49
- package/dist/Functions/presets/inputMaskPresets.js +25 -27
- package/dist/Functions/presets/inputPresets.js +19 -22
- package/dist/Functions/presets/mobileKeyboardTypesPresets.js +7 -9
- package/dist/Functions/schemas.js +6 -15
- package/dist/Functions/useClickOutside.js +3 -7
- package/dist/Functions/useDebounce.js +11 -25
- package/dist/Functions/useFieldFocus.js +42 -67
- package/dist/Functions/useFormTools/form-drivers/ArrayWithObjects.js +35 -54
- package/dist/Functions/useFormTools/form-drivers/ObjectWithIterableObjects.js +74 -95
- package/dist/Functions/useFormTools/form-drivers/ObjectWithNamedKeyObjects.js +55 -91
- package/dist/Functions/useFormTools/functions/General.js +80 -99
- package/dist/Functions/useFormTools/functions/RenderFields.js +45 -72
- package/dist/Functions/useFormTools/functions/usePrevious.js +3 -7
- package/dist/Functions/useFormTools/index.js +382 -598
- package/dist/Functions/useInputHighlightError.js +27 -52
- package/dist/Functions/useIsMobile.js +13 -36
- package/dist/Functions/useLocalStorage.js +7 -22
- package/dist/Functions/useLocationParams.js +16 -27
- package/dist/Functions/useMetaInfo.js +19 -50
- package/dist/Functions/useMouseUpOutside.js +2 -5
- package/dist/Functions/useOnlineStatus.js +7 -26
- package/dist/Functions/usePasswordChecker.js +42 -77
- package/dist/Functions/usePrevious.js +3 -7
- package/dist/Functions/useResize.js +12 -32
- package/dist/Functions/useScrollTo.js +6 -20
- package/dist/Functions/useToggle.js +10 -30
- package/dist/Functions/utils.js +186 -366
- package/dist/Molecular/CustomIcons/components/AffiliateNetworks.js +21 -32
- package/dist/Molecular/CustomIcons/components/AlertCircle.js +21 -32
- package/dist/Molecular/CustomIcons/components/AppStore.js +25 -36
- package/dist/Molecular/CustomIcons/components/Arrow.js +31 -42
- package/dist/Molecular/CustomIcons/components/ArrowDown.js +13 -24
- package/dist/Molecular/CustomIcons/components/ArrowLeft.js +16 -27
- package/dist/Molecular/CustomIcons/components/ArrowRight.js +16 -27
- package/dist/Molecular/CustomIcons/components/ArrowUp.js +13 -24
- package/dist/Molecular/CustomIcons/components/Bell.js +11 -22
- package/dist/Molecular/CustomIcons/components/Button.js +11 -22
- package/dist/Molecular/CustomIcons/components/Campaigns.js +12 -23
- package/dist/Molecular/CustomIcons/components/Check.js +12 -23
- package/dist/Molecular/CustomIcons/components/Check2.js +11 -22
- package/dist/Molecular/CustomIcons/components/ChevronDown.js +11 -22
- package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.js +11 -22
- package/dist/Molecular/CustomIcons/components/ChevronLeft.js +11 -22
- package/dist/Molecular/CustomIcons/components/ChevronRight.js +11 -22
- package/dist/Molecular/CustomIcons/components/ChevronUp.js +11 -22
- package/dist/Molecular/CustomIcons/components/ChevronUpDown.js +26 -37
- package/dist/Molecular/CustomIcons/components/Close.js +13 -24
- package/dist/Molecular/CustomIcons/components/ColumnsOrder.js +38 -49
- package/dist/Molecular/CustomIcons/components/Delete.js +12 -23
- package/dist/Molecular/CustomIcons/components/Edit.js +11 -22
- package/dist/Molecular/CustomIcons/components/Email.js +29 -40
- package/dist/Molecular/CustomIcons/components/FinturfLogo.js +19 -30
- package/dist/Molecular/CustomIcons/components/FinturfLogo2.js +27 -38
- package/dist/Molecular/CustomIcons/components/Flows.js +11 -22
- package/dist/Molecular/CustomIcons/components/Gift.js +16 -27
- package/dist/Molecular/CustomIcons/components/GoogleAuth.js +25 -36
- package/dist/Molecular/CustomIcons/components/GooglePlay.js +25 -36
- package/dist/Molecular/CustomIcons/components/HelpCircle.js +14 -25
- package/dist/Molecular/CustomIcons/components/HelpCircle2.js +15 -26
- package/dist/Molecular/CustomIcons/components/HelpCircleFilled.js +14 -25
- package/dist/Molecular/CustomIcons/components/Home.js +14 -25
- package/dist/Molecular/CustomIcons/components/Home2.js +17 -28
- package/dist/Molecular/CustomIcons/components/Key.js +19 -30
- package/dist/Molecular/CustomIcons/components/Landers.js +15 -26
- package/dist/Molecular/CustomIcons/components/Lock.js +11 -22
- package/dist/Molecular/CustomIcons/components/Mail.js +19 -30
- package/dist/Molecular/CustomIcons/components/Mastercard.js +61 -72
- package/dist/Molecular/CustomIcons/components/Minus.js +24 -35
- package/dist/Molecular/CustomIcons/components/Offers.js +12 -23
- package/dist/Molecular/CustomIcons/components/Pause.js +24 -35
- package/dist/Molecular/CustomIcons/components/PayPal.js +38 -49
- package/dist/Molecular/CustomIcons/components/PayPalLightLarge.js +25 -36
- package/dist/Molecular/CustomIcons/components/Phone.js +26 -37
- package/dist/Molecular/CustomIcons/components/Play.js +24 -35
- package/dist/Molecular/CustomIcons/components/Plus.js +24 -35
- package/dist/Molecular/CustomIcons/components/Profile.js +16 -27
- package/dist/Molecular/CustomIcons/components/QRCode.js +26 -37
- package/dist/Molecular/CustomIcons/components/Rectangle.js +11 -22
- package/dist/Molecular/CustomIcons/components/Revert.js +14 -25
- package/dist/Molecular/CustomIcons/components/Star.js +10 -21
- package/dist/Molecular/CustomIcons/components/Star2.js +12 -23
- package/dist/Molecular/CustomIcons/components/TrafficSources.js +14 -25
- package/dist/Molecular/CustomIcons/components/Trash.js +11 -22
- package/dist/Molecular/CustomIcons/components/TrashRed.js +11 -22
- package/dist/Molecular/CustomIcons/components/Triggers.js +11 -22
- package/dist/Molecular/CustomIcons/components/User.js +16 -27
- package/dist/Molecular/CustomIcons/components/Visa.js +27 -38
- package/dist/Molecular/CustomIcons/components/X.js +11 -22
- package/dist/Molecular/CustomIcons/index.js +61 -183
- package/dist/Molecular/FormElement/FormElement.js +18 -27
- package/dist/Molecular/FormWithDependOn/FormWithDependOn.js +95 -112
- package/dist/Molecular/FormWithDependOn/partials/_utils.js +35 -34
- package/dist/Molecular/InputAddress/InputAddress.js +176 -312
- package/dist/Molecular/InputPassword/InputPassword.js +15 -39
- package/dist/index.js +1 -3
- package/package.json +1 -1
- package/dist/Atomic/FormElements/UserContacts/partial/defaultIcons.js +0 -91
|
@@ -1,119 +1,83 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
4
|
Object.defineProperty(exports, "__esModule", {
|
|
8
5
|
value: true
|
|
9
6
|
});
|
|
10
7
|
exports.default = usePasswordChecker;
|
|
11
|
-
|
|
12
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
-
|
|
14
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
15
|
-
|
|
16
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
17
|
-
|
|
18
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
19
|
-
|
|
20
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
21
|
-
|
|
22
|
-
function
|
|
23
|
-
|
|
24
|
-
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; }
|
|
25
|
-
|
|
26
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
27
|
-
|
|
28
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
29
|
-
|
|
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; }
|
|
30
12
|
function usePasswordChecker() {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
var addCheckRule = function addCheckRule(data) {
|
|
37
|
-
return setCheckRules(function (state) {
|
|
38
|
-
return [].concat((0, _toConsumableArray2.default)(state), [data]);
|
|
39
|
-
});
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
var handleCheckRule = function handleCheckRule(type) {
|
|
43
|
-
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
44
|
-
var value = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
45
|
-
|
|
13
|
+
const [checkRules, setCheckRules] = (0, _react.useState)([]);
|
|
14
|
+
const addCheckRule = data => setCheckRules(state => [...state, data]);
|
|
15
|
+
const handleCheckRule = function (type) {
|
|
16
|
+
let props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
17
|
+
let value = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
46
18
|
switch (type) {
|
|
47
19
|
case 'len':
|
|
48
|
-
|
|
49
|
-
|
|
20
|
+
const {
|
|
21
|
+
min,
|
|
22
|
+
max
|
|
23
|
+
} = props;
|
|
50
24
|
if (min && value.length < min) return false;
|
|
51
25
|
if (max && value.length > max) return false;
|
|
52
26
|
return true;
|
|
53
|
-
|
|
54
27
|
case 'lowerCaseContains':
|
|
55
28
|
{
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return original.reduce(
|
|
29
|
+
const toUpperCase = value.slice().toUpperCase().split('');
|
|
30
|
+
const original = value.slice().split('');
|
|
31
|
+
return original.reduce((isMatch, char, i) => {
|
|
59
32
|
if (char !== toUpperCase[i]) isMatch = true;
|
|
60
33
|
return isMatch;
|
|
61
34
|
}, false);
|
|
62
35
|
}
|
|
63
|
-
|
|
64
36
|
case 'upperCaseContains':
|
|
65
37
|
{
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
return _original.reduce(function (isMatch, char, i) {
|
|
38
|
+
const toLowerCase = value.slice().toLowerCase().split('');
|
|
39
|
+
const original = value.slice().split('');
|
|
40
|
+
return original.reduce((isMatch, char, i) => {
|
|
71
41
|
if (char !== toLowerCase[i]) isMatch = true;
|
|
72
42
|
return isMatch;
|
|
73
43
|
}, false);
|
|
74
44
|
}
|
|
75
|
-
|
|
76
45
|
case 'numberContains':
|
|
77
46
|
{
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
return _original2.reduce(function (isMatch, char) {
|
|
47
|
+
const original = value.slice().split('');
|
|
48
|
+
return original.reduce((isMatch, char) => {
|
|
81
49
|
if (Number.isInteger(parseInt(char))) isMatch = true;
|
|
82
50
|
return isMatch;
|
|
83
51
|
}, false);
|
|
84
52
|
}
|
|
85
|
-
|
|
86
53
|
case 'specialContains':
|
|
87
54
|
{
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
return _original3.reduce(function (isMatch, char) {
|
|
55
|
+
const original = value.slice().split('');
|
|
56
|
+
return original.reduce((isMatch, char) => {
|
|
91
57
|
if (!Number.isInteger(parseInt(char)) && !char.match(/[a-z]/i)) isMatch = true;
|
|
92
58
|
return isMatch;
|
|
93
59
|
}, false);
|
|
94
60
|
}
|
|
95
|
-
|
|
96
61
|
default:
|
|
97
62
|
return false;
|
|
98
63
|
}
|
|
99
64
|
};
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
var isMatch = handleCheckRule(rule.type, rule.props, value);
|
|
65
|
+
const testCheckRules = value => {
|
|
66
|
+
let result = true;
|
|
67
|
+
setCheckRules(state => {
|
|
68
|
+
const rules = [...state];
|
|
69
|
+
return rules.map(rule => {
|
|
70
|
+
const isMatch = handleCheckRule(rule.type, rule.props, value);
|
|
107
71
|
if (!isMatch) result = false;
|
|
108
|
-
return
|
|
109
|
-
|
|
110
|
-
|
|
72
|
+
return {
|
|
73
|
+
...rule,
|
|
74
|
+
isMatch
|
|
75
|
+
};
|
|
111
76
|
});
|
|
112
77
|
});
|
|
113
78
|
return result;
|
|
114
79
|
};
|
|
115
|
-
|
|
116
|
-
var renderPasswordChecker = function renderPasswordChecker() {
|
|
80
|
+
const renderPasswordChecker = () => {
|
|
117
81
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
118
82
|
className: "password-checker"
|
|
119
83
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -122,11 +86,13 @@ function usePasswordChecker() {
|
|
|
122
86
|
className: "password-checker__header-label"
|
|
123
87
|
}, " Password must: "), ' '), ' ', /*#__PURE__*/_react.default.createElement("div", {
|
|
124
88
|
className: "password-checker__body"
|
|
125
|
-
}, ' ', checkRules.map(
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
89
|
+
}, ' ', checkRules.map(_ref => {
|
|
90
|
+
let {
|
|
91
|
+
icon,
|
|
92
|
+
text,
|
|
93
|
+
isMatch,
|
|
94
|
+
key
|
|
95
|
+
} = _ref;
|
|
130
96
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
131
97
|
key: key,
|
|
132
98
|
className: (0, _classnames.default)('password-checker__body-item', {
|
|
@@ -140,10 +106,9 @@ function usePasswordChecker() {
|
|
|
140
106
|
}, " ", text, " "), ' ');
|
|
141
107
|
}), ' '), ' ');
|
|
142
108
|
};
|
|
143
|
-
|
|
144
109
|
return {
|
|
145
|
-
addCheckRule
|
|
146
|
-
testCheckRules
|
|
147
|
-
renderPasswordChecker
|
|
110
|
+
addCheckRule,
|
|
111
|
+
testCheckRules,
|
|
112
|
+
renderPasswordChecker
|
|
148
113
|
};
|
|
149
114
|
}
|
|
@@ -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
|
/**
|
|
11
9
|
* The usePrevious function is a hook that allows you to access the previous value of a state variable.
|
|
12
10
|
*
|
|
@@ -20,12 +18,10 @@ const searchbar = ({ onsubmit, searchterm }) => {
|
|
|
20
18
|
* @return The previous value of the inputted value
|
|
21
19
|
*/
|
|
22
20
|
function usePrevious(value) {
|
|
23
|
-
|
|
24
|
-
(0, _react.useEffect)(
|
|
21
|
+
const ref = (0, _react.useRef)();
|
|
22
|
+
(0, _react.useEffect)(() => {
|
|
25
23
|
ref.current = value;
|
|
26
24
|
}, [value]);
|
|
27
25
|
return ref.current;
|
|
28
26
|
}
|
|
29
|
-
|
|
30
|
-
var _default = usePrevious;
|
|
31
|
-
exports.default = _default;
|
|
27
|
+
var _default = exports.default = usePrevious;
|
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.useResize = void 0;
|
|
9
|
-
|
|
10
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
-
|
|
12
7
|
var _react = require("react");
|
|
13
|
-
|
|
14
8
|
/**
|
|
15
9
|
* The useResize function is a hook that returns the position of an element relative to the viewport.
|
|
16
10
|
*
|
|
@@ -29,45 +23,31 @@ var _react = require("react");
|
|
|
29
23
|
*
|
|
30
24
|
* @return An object with two properties:
|
|
31
25
|
*/
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
37
|
-
elemPosition = _useState2[0],
|
|
38
|
-
setElemPosition = _useState2[1];
|
|
39
|
-
|
|
40
|
-
var onResize = function onResize(elemRightPosition) {
|
|
26
|
+
const useResize = function () {
|
|
27
|
+
let element = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
28
|
+
const [elemPosition, setElemPosition] = (0, _react.useState)('');
|
|
29
|
+
const onResize = elemRightPosition => {
|
|
41
30
|
if (elemRightPosition > document.documentElement.clientWidth) {
|
|
42
31
|
return setElemPosition('left');
|
|
43
32
|
} else setElemPosition('');
|
|
44
33
|
};
|
|
45
|
-
|
|
46
|
-
(0, _react.useEffect)(function () {
|
|
34
|
+
(0, _react.useEffect)(() => {
|
|
47
35
|
var _element$current;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
});
|
|
53
|
-
return function () {
|
|
54
|
-
window.removeEventListener('resize', function () {
|
|
55
|
-
return setElemPosition('');
|
|
56
|
-
});
|
|
36
|
+
const elemRightPosition = (element === null || element === void 0 || (_element$current = element.current) === null || _element$current === void 0 ? void 0 : _element$current.getBoundingClientRect().right) + 20;
|
|
37
|
+
window.addEventListener('resize', () => onResize(elemRightPosition));
|
|
38
|
+
return () => {
|
|
39
|
+
window.removeEventListener('resize', () => setElemPosition(''));
|
|
57
40
|
};
|
|
58
41
|
}, []);
|
|
59
|
-
(0, _react.useLayoutEffect)(
|
|
42
|
+
(0, _react.useLayoutEffect)(() => {
|
|
60
43
|
var _element$current2;
|
|
61
|
-
|
|
62
|
-
var elemRightPosition = (element === null || element === void 0 ? void 0 : (_element$current2 = element.current) === null || _element$current2 === void 0 ? void 0 : _element$current2.getBoundingClientRect().right) + 20;
|
|
63
|
-
|
|
44
|
+
const elemRightPosition = (element === null || element === void 0 || (_element$current2 = element.current) === null || _element$current2 === void 0 ? void 0 : _element$current2.getBoundingClientRect().right) + 20;
|
|
64
45
|
if (elemRightPosition > document.documentElement.clientWidth) {
|
|
65
46
|
return setElemPosition('left');
|
|
66
47
|
}
|
|
67
48
|
}, []);
|
|
68
49
|
return {
|
|
69
|
-
elemPosition
|
|
50
|
+
elemPosition
|
|
70
51
|
};
|
|
71
52
|
};
|
|
72
|
-
|
|
73
53
|
exports.useResize = useResize;
|
|
@@ -1,29 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
-
|
|
12
7
|
var _react = require("react");
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
var _useState = (0, _react.useState)(false),
|
|
18
|
-
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
19
|
-
shouldScrollTo = _useState2[0],
|
|
20
|
-
setShouldScrollTo = _useState2[1];
|
|
21
|
-
|
|
22
|
-
(0, _react.useEffect)(function () {
|
|
8
|
+
const useScrollTo = reference => {
|
|
9
|
+
const ref = (0, _react.useRef)(reference);
|
|
10
|
+
const [shouldScrollTo, setShouldScrollTo] = (0, _react.useState)(false);
|
|
11
|
+
(0, _react.useEffect)(() => {
|
|
23
12
|
if (ref !== null && ref !== void 0 && ref.current && shouldScrollTo) {
|
|
24
13
|
var _ref$current, _ref$current$scrollIn;
|
|
25
|
-
|
|
26
|
-
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, {
|
|
27
15
|
behavior: 'smooth'
|
|
28
16
|
});
|
|
29
17
|
setShouldScrollTo(false);
|
|
@@ -31,6 +19,4 @@ var useScrollTo = function useScrollTo(reference) {
|
|
|
31
19
|
}, [shouldScrollTo]);
|
|
32
20
|
return [ref, setShouldScrollTo];
|
|
33
21
|
};
|
|
34
|
-
|
|
35
|
-
var _default = useScrollTo;
|
|
36
|
-
exports.default = _default;
|
|
22
|
+
var _default = exports.default = useScrollTo;
|
|
@@ -1,40 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
-
|
|
12
7
|
var _react = require("react");
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
setToggle = _useState2[1];
|
|
19
|
-
|
|
20
|
-
var toggle = (0, _react.useCallback)(function () {
|
|
21
|
-
return setToggle(function (isOn) {
|
|
22
|
-
return !isOn;
|
|
23
|
-
});
|
|
24
|
-
}, []);
|
|
25
|
-
var toggleOn = (0, _react.useCallback)(function () {
|
|
26
|
-
return setToggle(true);
|
|
27
|
-
}, []);
|
|
28
|
-
var toggleOff = (0, _react.useCallback)(function () {
|
|
29
|
-
return setToggle(false);
|
|
30
|
-
}, []);
|
|
8
|
+
const useToggle = initialState => {
|
|
9
|
+
const [isToggled, setToggle] = (0, _react.useState)(!!initialState);
|
|
10
|
+
const toggle = (0, _react.useCallback)(() => setToggle(isOn => !isOn), []);
|
|
11
|
+
const toggleOn = (0, _react.useCallback)(() => setToggle(true), []);
|
|
12
|
+
const toggleOff = (0, _react.useCallback)(() => setToggle(false), []);
|
|
31
13
|
return {
|
|
32
|
-
isToggled
|
|
33
|
-
toggle
|
|
34
|
-
toggleOn
|
|
35
|
-
toggleOff
|
|
14
|
+
isToggled,
|
|
15
|
+
toggle,
|
|
16
|
+
toggleOn,
|
|
17
|
+
toggleOff
|
|
36
18
|
};
|
|
37
19
|
};
|
|
38
|
-
|
|
39
|
-
var _default = useToggle;
|
|
40
|
-
exports.default = _default;
|
|
20
|
+
var _default = exports.default = useToggle;
|