intelicoreact 1.4.81 → 1.4.83
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 +13 -13
- package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.js +12 -13
- package/dist/Atomic/FormElements/Calendar/Calendar.js +103 -68
- package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.js +26 -26
- package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.js +27 -23
- package/dist/Atomic/FormElements/Datepicker/Datepicker.js +201 -114
- package/dist/Atomic/FormElements/Datepicker/components/Calendar.js +69 -46
- package/dist/Atomic/FormElements/Dropdown/Dropdown.js +301 -230
- package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.js +2 -4
- package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.js +201 -145
- package/dist/Atomic/FormElements/FileLoader/FileLoader.js +54 -41
- package/dist/Atomic/FormElements/FileLoader/partial/LoadZone.js +112 -45
- package/dist/Atomic/FormElements/FileLoader/partial/LoadedContent.js +63 -34
- package/dist/Atomic/FormElements/FileLoaderDescription/FileLoaderDescription.js +153 -81
- package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.js +59 -57
- package/dist/Atomic/FormElements/FileLoaderLocalGroup/FileLoaderLocalGroup.js +98 -66
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.js +48 -27
- package/dist/Atomic/FormElements/Input/Input.js +209 -148
- package/dist/Atomic/FormElements/InputCalendar/InputCalendar.js +77 -50
- package/dist/Atomic/FormElements/InputColor/InputColor.js +28 -23
- package/dist/Atomic/FormElements/InputCurrency/InputCurrency.js +53 -38
- package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +139 -106
- package/dist/Atomic/FormElements/InputDateRange/components/DateInput.js +38 -31
- package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.js +230 -135
- package/dist/Atomic/FormElements/InputDateRange/components/OpenedPart.js +122 -85
- package/dist/Atomic/FormElements/InputDateRange/components/SelectItem.js +8 -10
- package/dist/Atomic/FormElements/InputDateRange/dependencies.js +159 -72
- package/dist/Atomic/FormElements/InputLink/InputLink.js +39 -30
- package/dist/Atomic/FormElements/InputMask/InputCarretPosition.js +8 -8
- package/dist/Atomic/FormElements/InputMask/InputMask.js +800 -521
- package/dist/Atomic/FormElements/InputMask/config.js +1 -1
- package/dist/Atomic/FormElements/InputMask/functions.js +15 -15
- package/dist/Atomic/FormElements/InputMask2/InputMask2.js +294 -234
- package/dist/Atomic/FormElements/InputMask2/config.js +1 -1
- package/dist/Atomic/FormElements/InputMask2/functions.js +15 -15
- package/dist/Atomic/FormElements/InputMask3/InputMask3.js +332 -265
- package/dist/Atomic/FormElements/InputMask3/config.js +1 -1
- package/dist/Atomic/FormElements/InputMask3/functions.js +15 -15
- package/dist/Atomic/FormElements/InputWithAction/InputWithAction.js +101 -53
- package/dist/Atomic/FormElements/InputsRow/InputsRow.js +99 -64
- package/dist/Atomic/FormElements/Label/Label.js +15 -13
- package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +284 -190
- package/dist/Atomic/FormElements/MultiSelect/MultiSelect.js +34 -24
- package/dist/Atomic/FormElements/NumericInput/NumericInput.js +170 -117
- package/dist/Atomic/FormElements/RadioGroup/RadioGroup.js +50 -28
- package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +29 -18
- package/dist/Atomic/FormElements/RadioInput/RadioInput.js +24 -22
- package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.js +31 -19
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +83 -56
- package/dist/Atomic/FormElements/RangeInputs/RangeInputs.js +75 -49
- package/dist/Atomic/FormElements/RangeList/RangeList.js +129 -87
- package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.js +18 -22
- package/dist/Atomic/FormElements/RangeSlider/RangeSlider.js +250 -143
- package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +477 -367
- package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.js +15 -14
- package/dist/Atomic/FormElements/Switcher/Switcher.js +20 -24
- package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.js +30 -24
- package/dist/Atomic/FormElements/SwitcherHide/SwitcherHide.js +23 -20
- package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.js +40 -32
- package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.js +31 -25
- package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.js +22 -22
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.js +98 -52
- package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.js +34 -22
- package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.js +81 -47
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +525 -415
- package/dist/Atomic/FormElements/Text/Text.js +39 -39
- package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.js +23 -21
- package/dist/Atomic/FormElements/Textarea/Textarea.js +33 -28
- package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +98 -67
- package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.js +24 -22
- package/dist/Atomic/FormElements/TimeRange/TimeRange.js +57 -34
- package/dist/Atomic/FormElements/UserContacts/UserContacts.js +94 -56
- package/dist/Atomic/FormElements/UserContacts/partial/defaultIcons.js +102 -74
- package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.js +69 -50
- package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.js +33 -30
- package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.js +50 -38
- package/dist/Atomic/FormElements/WidgetPseudoTable/partial/constructor.js +1 -1
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.js +59 -47
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/partial/constructor.js +1 -1
- package/dist/Atomic/Layout/Header/Header.js +37 -22
- package/dist/Atomic/Layout/MainMenu/MainMenu.js +59 -34
- package/dist/Atomic/Layout/Spinner/Spinner.js +6 -7
- package/dist/Atomic/UI/Accordion/Accordion.js +31 -17
- package/dist/Atomic/UI/Accordion/AccordionItem.js +41 -30
- package/dist/Atomic/UI/AccordionTable/AccordionTable.js +81 -50
- package/dist/Atomic/UI/AccordionText/AccordionText.js +39 -20
- package/dist/Atomic/UI/AdvancedTag/AdvTag.js +74 -46
- package/dist/Atomic/UI/AdvancedTag/AdvancedTags.js +37 -21
- package/dist/Atomic/UI/Alert/Alert.js +36 -23
- package/dist/Atomic/UI/Arrow/Arrow.js +21 -14
- package/dist/Atomic/UI/Box/Box.js +12 -11
- package/dist/Atomic/UI/Button/Button.js +26 -26
- package/dist/Atomic/UI/ButtonsBar/ButtonsBar.js +21 -21
- package/dist/Atomic/UI/Chart/Chart.js +60 -44
- package/dist/Atomic/UI/Chart/partial/Chart.constants.js +13 -11
- package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +10 -12
- package/dist/Atomic/UI/Chart/partial/datasetSetters.js +82 -60
- package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +124 -116
- package/dist/Atomic/UI/Chart/partial/optionsSetters.js +30 -18
- package/dist/Atomic/UI/Chart/partial/utils.js +30 -16
- package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +31 -21
- package/dist/Atomic/UI/DateTime/DateTime.js +29 -25
- package/dist/Atomic/UI/DebugContainer/DebugContainer.js +23 -11
- package/dist/Atomic/UI/DebugContainer/useDebugContainer.js +12 -4
- package/dist/Atomic/UI/DoubleString/DoubleString.js +53 -36
- package/dist/Atomic/UI/DynamicIcon/DynamicIcon.js +55 -14
- package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +114 -54
- package/dist/Atomic/UI/ExampleChartIntegration/partial/utils.js +88 -53
- package/dist/Atomic/UI/Hint/Hint.js +87 -58
- package/dist/Atomic/UI/Hint/partials/_utils.js +10 -10
- package/dist/Atomic/UI/Modal/Modal.js +159 -144
- package/dist/Atomic/UI/Modal/ModalHOC.js +17 -14
- package/dist/Atomic/UI/Modal/partials/ModalFooter.js +5 -6
- package/dist/Atomic/UI/Modal/partials/ModalTitle.js +13 -16
- package/dist/Atomic/UI/Modal/partials/useMobileModal.js +118 -73
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +48 -33
- package/dist/Atomic/UI/NavLine/NavLine.js +166 -104
- package/dist/Atomic/UI/PageTitle/PageTitle.js +8 -12
- package/dist/Atomic/UI/PieChart/PieChart.js +11 -10
- package/dist/Atomic/UI/Price/Price.js +5 -7
- package/dist/Atomic/UI/PriceRange/PriceRange.js +4 -6
- package/dist/Atomic/UI/ProgressLine/ProgressLine.js +42 -27
- package/dist/Atomic/UI/Status/Status.js +22 -18
- package/dist/Atomic/UI/Table/Partials/TdCell.js +47 -28
- package/dist/Atomic/UI/Table/Partials/TdHeader.js +5 -6
- package/dist/Atomic/UI/Table/Partials/TdRow.js +53 -29
- package/dist/Atomic/UI/Table/Partials/TdTitle.js +28 -15
- package/dist/Atomic/UI/Table/Table.js +36 -27
- package/dist/Atomic/UI/Table/TdTypes/TdActions.js +32 -18
- package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +10 -8
- package/dist/Atomic/UI/Table/TdTypes/TdRange.js +2 -4
- package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +26 -21
- package/dist/Atomic/UI/Tag/Tag.js +72 -52
- package/dist/Atomic/UI/TagList/TagList.js +102 -65
- package/dist/Atomic/UI/UserBox/UserBox.js +13 -13
- package/dist/Atomic/UI/WizardStepper/constructor.js +6 -6
- package/dist/Atomic/UI/WizardStepper/ui/StateIcon/StateIcon.js +16 -20
- package/dist/Atomic/UI/WizardStepper/ui/StepRow/StepRow.js +25 -27
- package/dist/Atomic/UI/WizardStepper/ui/StepWrapper/StepWrapper.js +27 -22
- package/dist/Atomic/UI/WizardStepper/ui/icons.js +41 -39
- package/dist/Classes/AbortableFetch.js +393 -311
- package/dist/Classes/AnimatedHandler.js +53 -45
- package/dist/Classes/RESTAPI/index.js +431 -152
- package/dist/Classes/RESTAPI/partials/AbortableFetch.js +400 -320
- package/dist/Classes/RESTAPI/partials/ApiBase.js +59 -24
- package/dist/Classes/RESTAPI/partials/ApiRequestCreators.js +338 -76
- package/dist/Classes/RESTAPI/partials/ApiUtils.js +378 -143
- package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +375 -159
- package/dist/Classes/RESTAPI/partials/Utils.js +128 -87
- package/dist/Classes/RESTAPI/partials/_utils.js +388 -116
- package/dist/Constants/index.constants.js +7 -7
- package/dist/Functions/Portal.js +19 -11
- package/dist/Functions/customEventListener.js +7 -5
- package/dist/Functions/fieldValueFormatters.js +131 -109
- package/dist/Functions/hooks/useFormFieldsChangesManager.js +128 -69
- package/dist/Functions/locale/createTranslator.js +21 -11
- package/dist/Functions/operations.js +27 -23
- package/dist/Functions/presets/inputMaskPreset.js +176 -0
- package/dist/Functions/presets/inputMaskPresets.js +17 -17
- package/dist/Functions/presets/inputPresets.js +15 -15
- package/dist/Functions/presets/mobileKeyboardTypesPresets.js +3 -3
- package/dist/Functions/schemas.js +7 -5
- package/dist/Functions/useBodyScrollLock.js +3 -3
- package/dist/Functions/useClickOutside.js +3 -3
- package/dist/Functions/useDebounce.js +20 -11
- package/dist/Functions/useFieldFocus.js +51 -38
- package/dist/Functions/useFormTools/form-drivers/ArrayWithObjects.js +46 -36
- package/dist/Functions/useFormTools/form-drivers/ObjectWithIterableObjects.js +78 -68
- package/dist/Functions/useFormTools/form-drivers/ObjectWithNamedKeyObjects.js +81 -54
- package/dist/Functions/useFormTools/functions/General.js +80 -71
- package/dist/Functions/useFormTools/functions/RenderFields.js +63 -45
- package/dist/Functions/useFormTools/functions/usePrevious.js +2 -2
- package/dist/Functions/useFormTools/index.js +467 -314
- package/dist/Functions/useInputHighlightError.js +42 -26
- package/dist/Functions/useIsMobile.js +29 -11
- package/dist/Functions/useKeyPress/useHandleKeyPress.js +8 -9
- package/dist/Functions/useKeyPress/useKeyPress.js +26 -17
- package/dist/Functions/useLocalStorage.js +13 -6
- package/dist/Functions/useLocationParams.js +24 -14
- package/dist/Functions/useMediaQuery.js +18 -7
- package/dist/Functions/useMetaInfo.js +40 -16
- package/dist/Functions/useMouseUpOutside.js +2 -2
- package/dist/Functions/useOnlineStatus.js +17 -6
- package/dist/Functions/usePasswordChecker.js +61 -42
- package/dist/Functions/usePrevious.js +2 -2
- package/dist/Functions/useResize.js +24 -12
- package/dist/Functions/useScrollTo.js +13 -4
- package/dist/Functions/useToggle.js +25 -9
- package/dist/Functions/utils.js +272 -147
- package/dist/Molecular/CustomIcons/components/AffiliateNetworks.js +27 -23
- package/dist/Molecular/CustomIcons/components/AlertCircle.js +27 -23
- package/dist/Molecular/CustomIcons/components/AppStore.js +31 -27
- package/dist/Molecular/CustomIcons/components/Arrow.js +37 -33
- package/dist/Molecular/CustomIcons/components/ArrowDown.js +19 -15
- package/dist/Molecular/CustomIcons/components/ArrowLeft.js +22 -18
- package/dist/Molecular/CustomIcons/components/ArrowRight.js +22 -18
- package/dist/Molecular/CustomIcons/components/ArrowUp.js +19 -15
- package/dist/Molecular/CustomIcons/components/Bell.js +17 -13
- package/dist/Molecular/CustomIcons/components/Button.js +17 -13
- package/dist/Molecular/CustomIcons/components/Campaigns.js +18 -14
- package/dist/Molecular/CustomIcons/components/Check.js +18 -14
- package/dist/Molecular/CustomIcons/components/Check2.js +17 -13
- package/dist/Molecular/CustomIcons/components/ChevronDown.js +17 -13
- package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.js +17 -13
- package/dist/Molecular/CustomIcons/components/ChevronLeft.js +17 -13
- package/dist/Molecular/CustomIcons/components/ChevronRight.js +17 -13
- package/dist/Molecular/CustomIcons/components/ChevronUp.js +17 -13
- package/dist/Molecular/CustomIcons/components/ChevronUpDown.js +32 -28
- package/dist/Molecular/CustomIcons/components/Close.js +19 -15
- package/dist/Molecular/CustomIcons/components/ColumnsOrder.js +44 -40
- package/dist/Molecular/CustomIcons/components/Delete.js +18 -14
- package/dist/Molecular/CustomIcons/components/Edit.js +17 -13
- package/dist/Molecular/CustomIcons/components/Email.js +35 -31
- package/dist/Molecular/CustomIcons/components/FinturfLogo.js +25 -21
- package/dist/Molecular/CustomIcons/components/FinturfLogo2.js +33 -29
- package/dist/Molecular/CustomIcons/components/Flows.js +17 -13
- package/dist/Molecular/CustomIcons/components/Gift.js +22 -18
- package/dist/Molecular/CustomIcons/components/GoogleAuth.js +31 -27
- package/dist/Molecular/CustomIcons/components/GooglePlay.js +31 -27
- package/dist/Molecular/CustomIcons/components/HelpCircle.js +20 -16
- package/dist/Molecular/CustomIcons/components/HelpCircle2.js +21 -17
- package/dist/Molecular/CustomIcons/components/HelpCircleFilled.js +20 -16
- package/dist/Molecular/CustomIcons/components/Home.js +20 -16
- package/dist/Molecular/CustomIcons/components/Home2.js +23 -19
- package/dist/Molecular/CustomIcons/components/Key.js +25 -21
- package/dist/Molecular/CustomIcons/components/Landers.js +21 -17
- package/dist/Molecular/CustomIcons/components/Lock.js +17 -13
- package/dist/Molecular/CustomIcons/components/Mail.js +25 -21
- package/dist/Molecular/CustomIcons/components/Mastercard.js +65 -61
- package/dist/Molecular/CustomIcons/components/Minus.js +30 -26
- package/dist/Molecular/CustomIcons/components/Offers.js +18 -14
- package/dist/Molecular/CustomIcons/components/Pause.js +30 -26
- package/dist/Molecular/CustomIcons/components/PayPal.js +44 -40
- package/dist/Molecular/CustomIcons/components/PayPalLightLarge.js +31 -27
- package/dist/Molecular/CustomIcons/components/Phone.js +32 -28
- package/dist/Molecular/CustomIcons/components/Play.js +30 -26
- package/dist/Molecular/CustomIcons/components/Plus.js +30 -26
- package/dist/Molecular/CustomIcons/components/Profile.js +22 -18
- package/dist/Molecular/CustomIcons/components/QRCode.js +32 -28
- package/dist/Molecular/CustomIcons/components/Rectangle.js +17 -13
- package/dist/Molecular/CustomIcons/components/Revert.js +20 -16
- package/dist/Molecular/CustomIcons/components/Star.js +14 -10
- package/dist/Molecular/CustomIcons/components/Star2.js +18 -14
- package/dist/Molecular/CustomIcons/components/TrafficSources.js +20 -16
- package/dist/Molecular/CustomIcons/components/Trash.js +17 -13
- package/dist/Molecular/CustomIcons/components/TrashRed.js +17 -13
- package/dist/Molecular/CustomIcons/components/Triggers.js +17 -13
- package/dist/Molecular/CustomIcons/components/User.js +22 -18
- package/dist/Molecular/CustomIcons/components/Visa.js +33 -29
- package/dist/Molecular/CustomIcons/components/X.js +17 -13
- package/dist/Molecular/CustomIcons/index.js +61 -61
- package/dist/Molecular/FormElement/FormElement.js +17 -19
- package/dist/Molecular/FormWithDependOn/FormWithDependOn.js +93 -73
- package/dist/Molecular/FormWithDependOn/partials/_utils.js +27 -28
- package/dist/Molecular/InputAddress/InputAddress.js +213 -126
- package/dist/Molecular/InputPassword/InputPassword.js +23 -13
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,89 +1,95 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
8
|
exports.default = General;
|
|
7
9
|
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
|
|
12
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
13
|
+
|
|
14
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
15
|
+
|
|
16
|
+
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; }
|
|
17
|
+
|
|
18
|
+
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; }
|
|
19
|
+
|
|
8
20
|
function General() {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
21
|
+
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
22
|
+
form = _ref.form,
|
|
23
|
+
_ref$FormFields = _ref.FormFields,
|
|
24
|
+
FormFields = _ref$FormFields === void 0 ? [] : _ref$FormFields;
|
|
13
25
|
|
|
14
|
-
|
|
26
|
+
var joinData = function joinData() {
|
|
15
27
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
16
28
|
args[_key] = arguments[_key];
|
|
17
29
|
}
|
|
18
30
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
31
|
+
var mainArg = args[0];
|
|
32
|
+
var MainArgProto = Array.isArray(mainArg) ? "Array" : (0, _typeof2.default)(mainArg) === "object" ? "Object" : undefined;
|
|
33
|
+
var template = Array.isArray(mainArg) ? [] : (0, _typeof2.default)(mainArg) === "object" ? {} : null;
|
|
22
34
|
if (!template) return undefined;
|
|
23
|
-
return args.reduce((result, item)
|
|
35
|
+
return args.reduce(function (result, item) {
|
|
24
36
|
if (MainArgProto === "Array") {
|
|
25
37
|
if (Array.isArray(item)) {
|
|
26
|
-
return [
|
|
38
|
+
return [].concat((0, _toConsumableArray2.default)(result), (0, _toConsumableArray2.default)(item));
|
|
27
39
|
} else {
|
|
28
|
-
return [
|
|
40
|
+
return [].concat((0, _toConsumableArray2.default)(result), [item]);
|
|
29
41
|
}
|
|
30
42
|
} else if (MainArgProto === "Object") {
|
|
31
|
-
return {
|
|
32
|
-
...item
|
|
33
|
-
};
|
|
43
|
+
return _objectSpread(_objectSpread({}, result), item);
|
|
34
44
|
} else {
|
|
35
45
|
return template;
|
|
36
46
|
}
|
|
37
47
|
}, template);
|
|
38
48
|
};
|
|
39
49
|
|
|
40
|
-
|
|
50
|
+
var getFieldData = function getFieldData(key) {
|
|
41
51
|
if (Array.isArray(FormFields)) {
|
|
42
52
|
if (FormFields[key]) {
|
|
43
|
-
return {
|
|
44
|
-
};
|
|
53
|
+
return _objectSpread({}, FormFields[key]);
|
|
45
54
|
} else {
|
|
46
|
-
return {
|
|
47
|
-
|
|
55
|
+
return _objectSpread({}, FormFields.find(function (f) {
|
|
56
|
+
return f.key === key;
|
|
57
|
+
}));
|
|
48
58
|
}
|
|
49
|
-
} else if (
|
|
50
|
-
return {
|
|
51
|
-
|
|
52
|
-
};
|
|
59
|
+
} else if ((0, _typeof2.default)(FormFields) === "object") {
|
|
60
|
+
return _objectSpread({}, FormFields[key]) || _objectSpread({}, Object.values(FormFields).find(function (f) {
|
|
61
|
+
return f.key === key;
|
|
62
|
+
}));
|
|
53
63
|
} else {
|
|
54
64
|
return undefined;
|
|
55
65
|
}
|
|
56
66
|
};
|
|
57
67
|
|
|
58
|
-
|
|
59
|
-
|
|
68
|
+
var getFormFields = function getFormFields() {
|
|
69
|
+
var argForm = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : form;
|
|
60
70
|
return (argForm === null || argForm === void 0 ? void 0 : argForm.fields) || argForm;
|
|
61
71
|
};
|
|
62
72
|
|
|
63
|
-
|
|
73
|
+
var getFormFieldsAsArray = function getFormFieldsAsArray(fields) {
|
|
64
74
|
if (Array.isArray(fields)) return fields;
|
|
65
75
|
|
|
66
|
-
if (
|
|
76
|
+
if ((0, _typeof2.default)(fields) === "object") {
|
|
67
77
|
return Object.values(fields);
|
|
68
78
|
}
|
|
69
79
|
|
|
70
80
|
return fields;
|
|
71
81
|
};
|
|
72
82
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
if (Array.isArray(fields)) return fields.map(
|
|
76
|
-
|
|
77
|
-
key
|
|
78
|
-
} = _ref;
|
|
83
|
+
var getFormFieldsKeys = function getFormFieldsKeys() {
|
|
84
|
+
var fields = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getFormFields();
|
|
85
|
+
if (Array.isArray(fields)) return fields.map(function (_ref2) {
|
|
86
|
+
var key = _ref2.key;
|
|
79
87
|
return key;
|
|
80
88
|
});
|
|
81
89
|
|
|
82
|
-
if (
|
|
83
|
-
return Object.values(fields).map(
|
|
84
|
-
|
|
85
|
-
key
|
|
86
|
-
} = _ref2;
|
|
90
|
+
if ((0, _typeof2.default)(fields) === "object") {
|
|
91
|
+
return Object.values(fields).map(function (_ref3) {
|
|
92
|
+
var key = _ref3.key;
|
|
87
93
|
return key;
|
|
88
94
|
});
|
|
89
95
|
}
|
|
@@ -91,59 +97,62 @@ function General() {
|
|
|
91
97
|
return fields;
|
|
92
98
|
};
|
|
93
99
|
|
|
94
|
-
|
|
95
|
-
|
|
100
|
+
var popFormField = function popFormField(fields, key) {
|
|
101
|
+
var result = {
|
|
96
102
|
item: undefined,
|
|
97
103
|
itemIndex: undefined
|
|
98
104
|
};
|
|
99
105
|
|
|
100
106
|
if (Array.isArray(fields)) {
|
|
101
|
-
result.item = fields === null || fields === void 0 ? void 0 : fields.find(
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
result.
|
|
105
|
-
|
|
107
|
+
result.item = fields === null || fields === void 0 ? void 0 : fields.find(function (f) {
|
|
108
|
+
return f.key === key;
|
|
109
|
+
});
|
|
110
|
+
result.itemIndex = result.item ? fields.findIndex(function (f) {
|
|
111
|
+
return f.key === key;
|
|
112
|
+
}) : fields.length;
|
|
113
|
+
} else if ((0, _typeof2.default)(fields) === "object") {
|
|
114
|
+
result.item = fields[key] || Object.values(fields).find(function (f) {
|
|
115
|
+
return f.key === key;
|
|
116
|
+
});
|
|
117
|
+
result.itemIndex = result.item ? fields[key] ? key : Object.values(fields).findIndex(function (f) {
|
|
118
|
+
return f.key === key;
|
|
119
|
+
}) : key;
|
|
106
120
|
}
|
|
107
121
|
|
|
108
122
|
return result;
|
|
109
123
|
};
|
|
110
124
|
|
|
111
|
-
|
|
112
|
-
|
|
125
|
+
var updateFormField = function updateFormField(fields, data, key) {
|
|
126
|
+
var isFunction = typeof data === "function"; //KEY is NULLable
|
|
113
127
|
|
|
114
128
|
if (!key) {
|
|
115
|
-
return data.key ? Object.values(fields).reduce((result, field, i)
|
|
116
|
-
|
|
117
|
-
return {
|
|
118
|
-
|
|
119
|
-
};
|
|
120
|
-
}, {}) : { ...fields,
|
|
121
|
-
[fields.length || 0]: isFunction ? data({}) : data
|
|
122
|
-
};
|
|
129
|
+
return data.key ? Object.values(fields).reduce(function (result, field, i) {
|
|
130
|
+
var index = fields[field.key] ? field.key : i;
|
|
131
|
+
return _objectSpread(_objectSpread({}, result), {}, (0, _defineProperty2.default)({}, index, data.key === field.key ? isFunction ? data(field) : data : field));
|
|
132
|
+
}, {}) : _objectSpread(_objectSpread({}, fields), {}, (0, _defineProperty2.default)({}, fields.length || 0, isFunction ? data({}) : data));
|
|
123
133
|
}
|
|
124
134
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
};
|
|
135
|
+
var _popFormField = popFormField(fields, key),
|
|
136
|
+
_popFormField$item = _popFormField.item,
|
|
137
|
+
field = _popFormField$item === void 0 ? data : _popFormField$item,
|
|
138
|
+
itemIndex = _popFormField.itemIndex;
|
|
139
|
+
|
|
140
|
+
fields[itemIndex] = isFunction ? data(field || {}) : _objectSpread(_objectSpread({}, field), data);
|
|
132
141
|
return fields;
|
|
133
142
|
};
|
|
134
143
|
|
|
135
|
-
|
|
144
|
+
var getFieldClassName = function getFieldClassName(key, type) {
|
|
136
145
|
return "form-".concat(type, "_field-").concat(key);
|
|
137
146
|
};
|
|
138
147
|
|
|
139
148
|
return {
|
|
140
|
-
joinData,
|
|
141
|
-
getFieldData,
|
|
142
|
-
popFormField,
|
|
143
|
-
updateFormField,
|
|
144
|
-
getFormFields,
|
|
145
|
-
getFormFieldsAsArray,
|
|
146
|
-
getFieldClassName,
|
|
147
|
-
getFormFieldsKeys
|
|
149
|
+
joinData: joinData,
|
|
150
|
+
getFieldData: getFieldData,
|
|
151
|
+
popFormField: popFormField,
|
|
152
|
+
updateFormField: updateFormField,
|
|
153
|
+
getFormFields: getFormFields,
|
|
154
|
+
getFormFieldsAsArray: getFormFieldsAsArray,
|
|
155
|
+
getFieldClassName: getFieldClassName,
|
|
156
|
+
getFormFieldsKeys: getFormFieldsKeys
|
|
148
157
|
};
|
|
149
158
|
}
|
|
@@ -1,74 +1,90 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
8
|
exports.default = RenderFields;
|
|
7
9
|
|
|
8
|
-
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
|
|
12
|
+
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; }
|
|
13
|
+
|
|
14
|
+
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; }
|
|
15
|
+
|
|
16
|
+
var defaultRenderFieldComponent = function defaultRenderFieldComponent() {
|
|
9
17
|
// eslint-disable-next-line no-console
|
|
10
18
|
console.error("RenderFields: RenderFieldComponent Property is not recieved!");
|
|
11
19
|
return null;
|
|
12
20
|
};
|
|
13
21
|
|
|
14
|
-
|
|
22
|
+
var defaultFormDataDriver = function defaultFormDataDriver() {
|
|
15
23
|
// eslint-disable-next-line no-console
|
|
16
24
|
console.error("RenderFields: FormDataDriver Property is not recieved!");
|
|
17
25
|
return null;
|
|
18
26
|
};
|
|
19
27
|
|
|
20
|
-
|
|
28
|
+
var defaultOnFieldChange = function defaultOnFieldChange() {
|
|
21
29
|
// eslint-disable-next-line no-console
|
|
22
30
|
console.warn("RenderFields: Be careful, onFieldChange handler is not recieved!");
|
|
23
31
|
return null;
|
|
24
32
|
};
|
|
25
33
|
|
|
26
|
-
|
|
34
|
+
var defaultOnFieldBlur = function defaultOnFieldBlur() {
|
|
27
35
|
// eslint-disable-next-line no-console
|
|
28
36
|
console.warn("RenderFields: Be careful, defaultOnFieldBlur handler is not recieved!");
|
|
29
37
|
return null;
|
|
30
38
|
};
|
|
31
39
|
|
|
32
40
|
function RenderFields() {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
41
|
+
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
42
|
+
form = _ref.form,
|
|
43
|
+
fields = _ref.fields,
|
|
44
|
+
_ref$cols = _ref.cols,
|
|
45
|
+
cols = _ref$cols === void 0 ? 1 : _ref$cols,
|
|
46
|
+
_ref$FormDataDriver = _ref.FormDataDriver,
|
|
47
|
+
FormDataDriver = _ref$FormDataDriver === void 0 ? defaultFormDataDriver : _ref$FormDataDriver,
|
|
48
|
+
_ref$RenderFieldCompo = _ref.RenderFieldComponent,
|
|
49
|
+
RenderFieldComponent = _ref$RenderFieldCompo === void 0 ? defaultRenderFieldComponent : _ref$RenderFieldCompo,
|
|
50
|
+
_ref$onFieldChange = _ref.onFieldChange,
|
|
51
|
+
onFieldChange = _ref$onFieldChange === void 0 ? defaultOnFieldChange : _ref$onFieldChange,
|
|
52
|
+
_ref$onFieldBlur = _ref.onFieldBlur,
|
|
53
|
+
onFieldBlur = _ref$onFieldBlur === void 0 ? defaultOnFieldBlur : _ref$onFieldBlur;
|
|
54
|
+
|
|
55
|
+
var maxColumns = 6;
|
|
56
|
+
var maxWidth = 12;
|
|
57
|
+
|
|
58
|
+
var _FormDataDriver = FormDataDriver({
|
|
59
|
+
form: form
|
|
60
|
+
}),
|
|
61
|
+
getFormField = _FormDataDriver.getFormField;
|
|
62
|
+
|
|
63
|
+
var getColumnsQty = function getColumnsQty() {
|
|
51
64
|
return cols > maxColumns ? maxColumns : cols;
|
|
52
65
|
};
|
|
53
66
|
|
|
54
|
-
|
|
67
|
+
var renderFormField = function renderFormField(key) {
|
|
55
68
|
try {
|
|
56
|
-
|
|
57
|
-
key
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
} = field;
|
|
69
|
+
var field = _objectSpread(_objectSpread({}, getFormField(key)), {}, {
|
|
70
|
+
key: key
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
var wrapperRef = field.wrapperRef;
|
|
62
74
|
return /*#__PURE__*/React.createElement("div", {
|
|
63
75
|
key: "render-field-wrapper-".concat(key),
|
|
64
76
|
id: "render-field-wrapper-".concat(key),
|
|
65
|
-
ref: wrapperRef ? typeof wrapperRef === "function" ?
|
|
77
|
+
ref: wrapperRef ? typeof wrapperRef === "function" ? function (node) {
|
|
78
|
+
return wrapperRef(node, key);
|
|
79
|
+
} : wrapperRef : null
|
|
66
80
|
}, /*#__PURE__*/React.createElement(RenderFieldComponent, {
|
|
67
81
|
key: key,
|
|
68
82
|
field: field,
|
|
69
|
-
onChange:
|
|
70
|
-
|
|
71
|
-
|
|
83
|
+
onChange: function onChange(value) {
|
|
84
|
+
return onFieldChange(key, value);
|
|
85
|
+
},
|
|
86
|
+
onBlur: function onBlur() {
|
|
87
|
+
return onFieldBlur.apply(void 0, arguments);
|
|
72
88
|
}
|
|
73
89
|
}));
|
|
74
90
|
} catch (e) {
|
|
@@ -76,27 +92,29 @@ function RenderFields() {
|
|
|
76
92
|
}
|
|
77
93
|
};
|
|
78
94
|
|
|
79
|
-
|
|
95
|
+
var renderSingleColumn = function renderSingleColumn() {
|
|
80
96
|
return fields.map(renderFormField);
|
|
81
97
|
};
|
|
82
98
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
99
|
+
var renderSplitColumns = function renderSplitColumns() {
|
|
100
|
+
var fieldsLen = (fields === null || fields === void 0 ? void 0 : fields.length) || 0;
|
|
101
|
+
var columnsQty = getColumnsQty() > fieldsLen ? fieldsLen : getColumnsQty();
|
|
86
102
|
if (!columnsQty) return null;
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
103
|
+
var parts = new Array(columnsQty).fill([]).map(function (v, i) {
|
|
104
|
+
var startIndex = fieldsLen / columnsQty * i;
|
|
105
|
+
var endIndex = startIndex + fieldsLen / columnsQty;
|
|
90
106
|
return fields.slice(startIndex, endIndex);
|
|
91
107
|
});
|
|
92
108
|
return /*#__PURE__*/React.createElement("div", {
|
|
93
109
|
className: "row"
|
|
94
|
-
}, parts.map((part, i)
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
110
|
+
}, parts.map(function (part, i) {
|
|
111
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
112
|
+
key: "render-fields-row-".concat(i),
|
|
113
|
+
className: "col-12 col-lg-".concat(parseInt(maxWidth / columnsQty, 10))
|
|
114
|
+
}, part.map(renderFormField));
|
|
115
|
+
}));
|
|
98
116
|
};
|
|
99
117
|
|
|
100
|
-
|
|
118
|
+
var render = cols === 1 ? renderSingleColumn : renderSplitColumns;
|
|
101
119
|
return render();
|
|
102
120
|
}
|
|
@@ -8,8 +8,8 @@ exports.default = void 0;
|
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
|
|
10
10
|
function usePrevious(value) {
|
|
11
|
-
|
|
12
|
-
(0, _react.useEffect)(()
|
|
11
|
+
var ref = (0, _react.useRef)();
|
|
12
|
+
(0, _react.useEffect)(function () {
|
|
13
13
|
ref.current = value;
|
|
14
14
|
}, [value]);
|
|
15
15
|
return ref.current;
|