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,24 +1,20 @@
|
|
|
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 = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
9
|
require("./DropdownLoader.scss");
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
const DropdownLoader = function (_ref) {
|
|
11
|
+
let {
|
|
12
|
+
variant
|
|
13
|
+
} = _ref;
|
|
16
14
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
17
15
|
className: "dropdown-loader-box j5"
|
|
18
16
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
19
17
|
className: "lds-ring".concat(variant === 'little' ? ' lds-ring_little' : '')
|
|
20
18
|
}, /*#__PURE__*/_react.default.createElement("div", null), /*#__PURE__*/_react.default.createElement("div", null), /*#__PURE__*/_react.default.createElement("div", null), /*#__PURE__*/_react.default.createElement("div", null)));
|
|
21
19
|
};
|
|
22
|
-
|
|
23
|
-
var _default = DropdownLoader;
|
|
24
|
-
exports.default = _default;
|
|
20
|
+
var _default = exports.default = DropdownLoader;
|
|
@@ -1,125 +1,74 @@
|
|
|
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 = void 0;
|
|
11
|
-
|
|
12
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
-
|
|
14
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
-
|
|
16
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
17
|
-
|
|
18
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
19
|
-
|
|
20
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
21
|
-
|
|
22
11
|
var _reactFeather = require("react-feather");
|
|
23
|
-
|
|
24
12
|
var _useDebounce = require("../../../Functions/useDebounce");
|
|
25
|
-
|
|
26
13
|
var _fieldValueFormatters = require("../../../Functions/fieldValueFormatters");
|
|
27
|
-
|
|
28
14
|
var _Spinner = _interopRequireDefault(require("../../Layout/Spinner/Spinner"));
|
|
29
|
-
|
|
30
15
|
require("./DropdownLiveSearch.scss");
|
|
31
|
-
|
|
32
|
-
function
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
var RC = 'dropdown-live-search';
|
|
37
|
-
|
|
38
|
-
var DropdownLiveSearch = function DropdownLiveSearch(_ref) {
|
|
16
|
+
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); }
|
|
17
|
+
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
|
+
const RC = 'dropdown-live-search';
|
|
19
|
+
const DropdownLiveSearch = _ref => {
|
|
39
20
|
var _tabIndex$toString;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
var _useState = (0, _react.useState)(false),
|
|
66
|
-
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
67
|
-
isOpen = _useState2[0],
|
|
68
|
-
setIsOpen = _useState2[1];
|
|
69
|
-
|
|
70
|
-
var _useState3 = (0, _react.useState)(false),
|
|
71
|
-
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
72
|
-
isValueDeleted = _useState4[0],
|
|
73
|
-
setIsValueDeleted = _useState4[1];
|
|
74
|
-
|
|
75
|
-
var labelByValue = (0, _react.useMemo)(function () {
|
|
21
|
+
let {
|
|
22
|
+
value,
|
|
23
|
+
error,
|
|
24
|
+
disabled,
|
|
25
|
+
onChange,
|
|
26
|
+
placeholder,
|
|
27
|
+
className,
|
|
28
|
+
isSearchable,
|
|
29
|
+
testId,
|
|
30
|
+
doRequest,
|
|
31
|
+
isLoading,
|
|
32
|
+
options = [],
|
|
33
|
+
fieldKey,
|
|
34
|
+
id,
|
|
35
|
+
isListTop,
|
|
36
|
+
isNotValidateASCII = false,
|
|
37
|
+
noOptionsText = 'No options available',
|
|
38
|
+
attributesOfNativeInput = {},
|
|
39
|
+
tabIndex
|
|
40
|
+
} = _ref;
|
|
41
|
+
const dropdownId = fieldKey || id;
|
|
42
|
+
const [isOpen, setIsOpen] = (0, _react.useState)(false);
|
|
43
|
+
const [isValueDeleted, setIsValueDeleted] = (0, _react.useState)(false);
|
|
44
|
+
const labelByValue = (0, _react.useMemo)(() => {
|
|
76
45
|
var _options$find;
|
|
77
|
-
|
|
78
|
-
return (options === null || options === void 0 ? void 0 : (_options$find = options.find(function (item) {
|
|
79
|
-
return item.value === value;
|
|
80
|
-
})) === null || _options$find === void 0 ? void 0 : _options$find.label) || '';
|
|
46
|
+
return (options === null || options === void 0 || (_options$find = options.find(item => item.value === value)) === null || _options$find === void 0 ? void 0 : _options$find.label) || '';
|
|
81
47
|
}, [value]);
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
var dropdownListBoxRef = (0, _react.useRef)(null);
|
|
90
|
-
var dropdownListRef = (0, _react.useRef)(null);
|
|
91
|
-
var searchInputRef = (0, _react.useRef)(null);
|
|
92
|
-
var searchValueRef = (0, _react.useRef)(labelByValue);
|
|
93
|
-
|
|
94
|
-
var setSearchValue = function setSearchValue(val) {
|
|
48
|
+
const [searchValue, setSV] = (0, _react.useState)(labelByValue);
|
|
49
|
+
const dropdownLiveSearchRef = (0, _react.useRef)(null);
|
|
50
|
+
const dropdownListBoxRef = (0, _react.useRef)(null);
|
|
51
|
+
const dropdownListRef = (0, _react.useRef)(null);
|
|
52
|
+
const searchInputRef = (0, _react.useRef)(null);
|
|
53
|
+
const searchValueRef = (0, _react.useRef)(labelByValue);
|
|
54
|
+
const setSearchValue = val => {
|
|
95
55
|
setSV(val);
|
|
96
56
|
searchValueRef.current = val;
|
|
97
57
|
};
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
isFocusedByClick = _useState8[0],
|
|
102
|
-
setIsFocusedByClick = _useState8[1];
|
|
103
|
-
|
|
104
|
-
var debouncedSearchTerm = (0, _useDebounce.useDebounce)({
|
|
105
|
-
searchValue: searchValue,
|
|
58
|
+
const [isFocusedByClick, setIsFocusedByClick] = (0, _react.useState)(false);
|
|
59
|
+
const debouncedSearchTerm = (0, _useDebounce.useDebounce)({
|
|
60
|
+
searchValue,
|
|
106
61
|
delay: 600
|
|
107
62
|
});
|
|
108
63
|
if (!options) return null;
|
|
109
|
-
|
|
110
|
-
var handleClickOutside = function handleClickOutside(event) {
|
|
64
|
+
const handleClickOutside = event => {
|
|
111
65
|
if (!dropdownLiveSearchRef.current.contains(event.target)) setIsOpen(false);
|
|
112
66
|
};
|
|
113
|
-
|
|
114
|
-
var highlightedText = function highlightedText(text, postfix) {
|
|
67
|
+
const highlightedText = (text, postfix) => {
|
|
115
68
|
if (!isSearchable) return text;else {
|
|
116
69
|
var _text;
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
return text === null || text === void 0 ? void 0 : text.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&');
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
text = text.replace(/["&<>]/g, function (a) {
|
|
70
|
+
const prepare = text => text === null || text === void 0 ? void 0 : text.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&');
|
|
71
|
+
text = text.replace(/["&<>]/g, a => {
|
|
123
72
|
return {
|
|
124
73
|
'"': '"',
|
|
125
74
|
'&': '&',
|
|
@@ -127,30 +76,31 @@ var DropdownLiveSearch = function DropdownLiveSearch(_ref) {
|
|
|
127
76
|
'>': '>'
|
|
128
77
|
}[a];
|
|
129
78
|
});
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}) : text;
|
|
133
|
-
var postfixPart = postfix ? "<span class=\"dropdown__list-item-postfix\">".concat(postfix, "</span>") : '';
|
|
79
|
+
const main = searchValue ? (_text = text) === null || _text === void 0 ? void 0 : _text.replace(new RegExp(prepare(searchValue), 'i'), match => "<span class=\"bg--yellow\">".concat(match, "</span>")) : text;
|
|
80
|
+
const postfixPart = postfix ? "<span class=\"dropdown__list-item-postfix\">".concat(postfix, "</span>") : '';
|
|
134
81
|
return main + postfixPart;
|
|
135
82
|
}
|
|
136
83
|
};
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
var lowerLabel = item.label.toLowerCase();
|
|
142
|
-
var lowerSearchValue = searchValue.toLowerCase();
|
|
84
|
+
const getMarkupForElement = (item, index, optTestId) => {
|
|
85
|
+
var _item$value, _item$value2;
|
|
86
|
+
const lowerLabel = item.label.toLowerCase();
|
|
87
|
+
const lowerSearchValue = searchValue.toLowerCase();
|
|
143
88
|
return /*#__PURE__*/_react.default.createElement("button", {
|
|
144
|
-
"data-testid": "dropdown-live-search--button--key-".concat(optTestId || (item === null || item === void 0
|
|
145
|
-
key: (_item$value2 = item.value) === null || _item$value2 === void 0
|
|
146
|
-
onClick:
|
|
89
|
+
"data-testid": "dropdown-live-search--button--key-".concat(optTestId || (item === null || item === void 0 || (_item$value = item.value) === null || _item$value === void 0 || (_item$value = _item$value.toString()) === null || _item$value === void 0 ? void 0 : _item$value.replace(/\s/, '-')) || (item === null || item === void 0 ? void 0 : item.key) || 'item', "--option"),
|
|
90
|
+
key: (_item$value2 = item.value) === null || _item$value2 === void 0 || (_item$value2 = _item$value2.toString()) === null || _item$value2 === void 0 ? void 0 : _item$value2.replace(/ /g, '_'),
|
|
91
|
+
onClick: () => {
|
|
147
92
|
onChange(item.value);
|
|
148
93
|
setIsOpen(false);
|
|
149
94
|
setSearchValue(item.label);
|
|
150
95
|
},
|
|
151
|
-
className: (0, _classnames.default)("".concat(RC, "__list-item"),
|
|
96
|
+
className: (0, _classnames.default)("".concat(RC, "__list-item"), {
|
|
97
|
+
["".concat(RC, "__list-item_active")]: item.value === value,
|
|
98
|
+
["".concat(RC, "__list-item_disabled")]: item.disabled
|
|
99
|
+
}, item.className)
|
|
152
100
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
153
|
-
className: (0, _classnames.default)("".concat(RC, "__active-icon"),
|
|
101
|
+
className: (0, _classnames.default)("".concat(RC, "__active-icon"), {
|
|
102
|
+
["".concat(RC, "__active-icon_active")]: lowerLabel === lowerSearchValue
|
|
103
|
+
})
|
|
154
104
|
}, /*#__PURE__*/_react.default.createElement(_reactFeather.Check, null)), /*#__PURE__*/_react.default.createElement("p", {
|
|
155
105
|
title: item.label,
|
|
156
106
|
className: item.labelClassName || '',
|
|
@@ -159,63 +109,55 @@ var DropdownLiveSearch = function DropdownLiveSearch(_ref) {
|
|
|
159
109
|
}
|
|
160
110
|
}));
|
|
161
111
|
};
|
|
162
|
-
|
|
163
|
-
var getListMarkUp = function getListMarkUp() {
|
|
112
|
+
const getListMarkUp = () => {
|
|
164
113
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
165
114
|
id: "dropdown-live-search-list",
|
|
166
|
-
className: (0, _classnames.default)("".concat(RC, "__container"),
|
|
115
|
+
className: (0, _classnames.default)("".concat(RC, "__container"), {
|
|
116
|
+
["".concat(RC, "__list-top")]: isListTop
|
|
117
|
+
}),
|
|
167
118
|
ref: dropdownListBoxRef
|
|
168
119
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
169
120
|
className: (0, _classnames.default)("".concat(RC, "__list"), {
|
|
170
121
|
disabled: isLoading
|
|
171
122
|
}),
|
|
172
123
|
ref: dropdownListRef
|
|
173
|
-
}, options.map(
|
|
174
|
-
return getMarkupForElement(option);
|
|
175
|
-
}), !options.length && /*#__PURE__*/_react.default.createElement("div", {
|
|
124
|
+
}, options.map(option => getMarkupForElement(option)), !options.length && /*#__PURE__*/_react.default.createElement("div", {
|
|
176
125
|
className: "".concat(RC, "__list-item ").concat(RC, "__list-item--no-options")
|
|
177
126
|
}, noOptionsText)), isLoading && isOpen && /*#__PURE__*/_react.default.createElement(_Spinner.default, {
|
|
178
127
|
size: options.length <= 3 ? 'small' : null
|
|
179
128
|
}));
|
|
180
129
|
};
|
|
181
|
-
|
|
182
|
-
var getListContainer = function getListContainer() {
|
|
130
|
+
const getListContainer = () => {
|
|
183
131
|
return document.getElementById(dropdownId);
|
|
184
132
|
};
|
|
185
|
-
|
|
186
|
-
(0, _react.useEffect)(function () {
|
|
133
|
+
(0, _react.useEffect)(() => {
|
|
187
134
|
if (!value) setSearchValue('');
|
|
188
135
|
}, [value]);
|
|
189
|
-
(0, _react.useEffect)(
|
|
136
|
+
(0, _react.useEffect)(() => {
|
|
190
137
|
document.addEventListener('click', handleClickOutside, true);
|
|
191
|
-
return
|
|
192
|
-
return document.removeEventListener('click', handleClickOutside, true);
|
|
193
|
-
};
|
|
138
|
+
return () => document.removeEventListener('click', handleClickOutside, true);
|
|
194
139
|
}, [value]);
|
|
195
|
-
(0, _react.useEffect)(
|
|
140
|
+
(0, _react.useEffect)(() => {
|
|
196
141
|
if (options.length === 1 && searchValue === options[0].label) {
|
|
197
142
|
setSearchValue(options[0].label);
|
|
198
143
|
onChange(options[0].value);
|
|
199
144
|
}
|
|
200
145
|
}, [options]);
|
|
201
|
-
|
|
202
|
-
var searchableInputFocus = function searchableInputFocus(e) {
|
|
146
|
+
const searchableInputFocus = e => {
|
|
203
147
|
if (!isOpen) {
|
|
204
148
|
e.preventDefault();
|
|
205
149
|
e.stopPropagation();
|
|
206
150
|
}
|
|
207
151
|
};
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
onInputClick: function onInputClick(e) {
|
|
152
|
+
const handle = {
|
|
153
|
+
onInputClick: e => {
|
|
211
154
|
if (!isOpen) setIsOpen(true);
|
|
212
155
|
e.target.select();
|
|
213
156
|
},
|
|
214
|
-
onInputChange:
|
|
215
|
-
|
|
157
|
+
onInputChange: e => {
|
|
158
|
+
let inputValue = e.target.value;
|
|
216
159
|
if (!isNotValidateASCII) inputValue = (0, _fieldValueFormatters.formatToOnlyASCIICodeText)(inputValue);
|
|
217
160
|
setSearchValue(inputValue);
|
|
218
|
-
|
|
219
161
|
if (searchValue && !e.target.value) {
|
|
220
162
|
onChange('');
|
|
221
163
|
setSearchValue('');
|
|
@@ -223,47 +165,41 @@ var DropdownLiveSearch = function DropdownLiveSearch(_ref) {
|
|
|
223
165
|
} else setIsValueDeleted(false);
|
|
224
166
|
}
|
|
225
167
|
};
|
|
226
|
-
(0, _react.useEffect)(
|
|
168
|
+
(0, _react.useEffect)(() => {
|
|
227
169
|
if (isSearchable && debouncedSearchTerm || isValueDeleted) {
|
|
228
170
|
doRequest(debouncedSearchTerm);
|
|
229
171
|
}
|
|
230
172
|
}, [debouncedSearchTerm, isValueDeleted]);
|
|
231
|
-
|
|
232
|
-
var closeListViaEsc = function closeListViaEsc(e) {
|
|
173
|
+
const closeListViaEsc = e => {
|
|
233
174
|
if ([27].includes(e.keyCode)) setIsOpen(false);
|
|
234
175
|
};
|
|
235
|
-
|
|
236
|
-
(0, _react.useLayoutEffect)(function () {
|
|
176
|
+
(0, _react.useLayoutEffect)(() => {
|
|
237
177
|
window.addEventListener('keyup', closeListViaEsc);
|
|
238
|
-
return
|
|
178
|
+
return () => {
|
|
239
179
|
window.removeEventListener('keyup', closeListViaEsc);
|
|
240
180
|
};
|
|
241
181
|
}, [getListContainer]);
|
|
242
|
-
(0, _react.useLayoutEffect)(
|
|
243
|
-
|
|
244
|
-
|
|
182
|
+
(0, _react.useLayoutEffect)(() => {
|
|
183
|
+
const list = document.getElementById('dropdown-live-search-list');
|
|
245
184
|
if (list || isOpen) {
|
|
246
185
|
var _dropdownLiveSearchRe;
|
|
247
|
-
|
|
248
|
-
var dropdownWidth = dropdownLiveSearchRef === null || dropdownLiveSearchRef === void 0 ? void 0 : (_dropdownLiveSearchRe = dropdownLiveSearchRef.current) === null || _dropdownLiveSearchRe === void 0 ? void 0 : _dropdownLiveSearchRe.clientWidth;
|
|
186
|
+
const dropdownWidth = dropdownLiveSearchRef === null || dropdownLiveSearchRef === void 0 || (_dropdownLiveSearchRe = dropdownLiveSearchRef.current) === null || _dropdownLiveSearchRe === void 0 ? void 0 : _dropdownLiveSearchRe.clientWidth;
|
|
249
187
|
list.style.width = "".concat(dropdownWidth, "px");
|
|
250
188
|
}
|
|
251
189
|
}, [dropdownLiveSearchRef, isOpen]);
|
|
252
|
-
|
|
190
|
+
const doScrollCallback = (0, _react.useCallback)(e => {
|
|
253
191
|
if (doRequest && typeof doRequest === 'function') {
|
|
254
192
|
if (Math.round(e.target.clientHeight + e.target.scrollTop) == e.target.scrollHeight) {
|
|
255
193
|
doRequest(searchValueRef.current, true);
|
|
256
194
|
}
|
|
257
195
|
}
|
|
258
196
|
}, [options]);
|
|
259
|
-
(0, _react.useEffect)(
|
|
197
|
+
(0, _react.useEffect)(() => {
|
|
260
198
|
if (!isOpen) setIsFocusedByClick(false);
|
|
261
|
-
|
|
262
199
|
if (isOpen && dropdownListRef && dropdownListRef.current) {
|
|
263
200
|
dropdownListRef.current.addEventListener('scroll', doScrollCallback);
|
|
264
201
|
}
|
|
265
|
-
|
|
266
|
-
return function () {
|
|
202
|
+
return () => {
|
|
267
203
|
removeEventListener('scroll', doScrollCallback);
|
|
268
204
|
};
|
|
269
205
|
}, [isOpen, dropdownListRef]);
|
|
@@ -275,16 +211,10 @@ var DropdownLiveSearch = function DropdownLiveSearch(_ref) {
|
|
|
275
211
|
}, /*#__PURE__*/_react.default.createElement("button", {
|
|
276
212
|
"data-testid": "dropdown-live-search--".concat(testId || '', "--container"),
|
|
277
213
|
className: "".concat(RC, "__trigger input__wrap ").concat(isOpen ? 'input__wrap--focus' : '', " ").concat(!value ? 'placeholder' : '', " ").concat(error ? 'error' : ''),
|
|
278
|
-
onClick:
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
return setIsFocusedByClick(true);
|
|
283
|
-
},
|
|
284
|
-
onFocus: function onFocus() {
|
|
285
|
-
return !isFocusedByClick ? setIsOpen(true) : null;
|
|
286
|
-
},
|
|
287
|
-
tabIndex: tabIndex === null || tabIndex === void 0 ? void 0 : (_tabIndex$toString = tabIndex.toString) === null || _tabIndex$toString === void 0 ? void 0 : _tabIndex$toString.call(tabIndex)
|
|
214
|
+
onClick: () => !isSearchable ? setIsOpen(!isOpen) : null,
|
|
215
|
+
onMouseDown: () => setIsFocusedByClick(true),
|
|
216
|
+
onFocus: () => !isFocusedByClick ? setIsOpen(true) : null,
|
|
217
|
+
tabIndex: tabIndex === null || tabIndex === void 0 || (_tabIndex$toString = tabIndex.toString) === null || _tabIndex$toString === void 0 ? void 0 : _tabIndex$toString.call(tabIndex)
|
|
288
218
|
}, isSearchable ? /*#__PURE__*/_react.default.createElement("input", (0, _extends2.default)({
|
|
289
219
|
ref: searchInputRef,
|
|
290
220
|
className: "".concat(RC, "__input"),
|
|
@@ -297,12 +227,10 @@ var DropdownLiveSearch = function DropdownLiveSearch(_ref) {
|
|
|
297
227
|
}, attributesOfNativeInput)) : /*#__PURE__*/_react.default.createElement("span", {
|
|
298
228
|
className: "text"
|
|
299
229
|
}, labelByValue || placeholder), /*#__PURE__*/_react.default.createElement("span", {
|
|
300
|
-
className: (0, _classnames.default)("".concat(RC, "__arrow"),
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
230
|
+
className: (0, _classnames.default)("".concat(RC, "__arrow"), {
|
|
231
|
+
["".concat(RC, "__arrow_active")]: isOpen
|
|
232
|
+
}),
|
|
233
|
+
onClick: () => setIsOpen(!isOpen)
|
|
304
234
|
}, isOpen ? /*#__PURE__*/_react.default.createElement(_reactFeather.ChevronUp, null) : /*#__PURE__*/_react.default.createElement(_reactFeather.ChevronDown, null))), isOpen && getListMarkUp());
|
|
305
235
|
};
|
|
306
|
-
|
|
307
|
-
var _default = DropdownLiveSearch;
|
|
308
|
-
exports.default = _default;
|
|
236
|
+
var _default = exports.default = DropdownLiveSearch;
|
|
@@ -1,80 +1,57 @@
|
|
|
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 = void 0;
|
|
11
|
-
|
|
12
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
-
|
|
14
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
|
-
|
|
16
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
-
|
|
18
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
19
|
-
|
|
20
10
|
var _LoadZone = _interopRequireDefault(require("./partial/LoadZone"));
|
|
21
|
-
|
|
22
11
|
var _LoadedContent = _interopRequireDefault(require("./partial/LoadedContent"));
|
|
23
|
-
|
|
24
12
|
require("./FileLoader.scss");
|
|
25
|
-
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
_props$isUseLinkTitle = props.isUseLinkTitle,
|
|
56
|
-
isUseLinkTitle = _props$isUseLinkTitle === void 0 ? false : _props$isUseLinkTitle,
|
|
57
|
-
_props$attributesOfNa = props.attributesOfNativeInput,
|
|
58
|
-
attributesOfNativeInput = _props$attributesOfNa === void 0 ? {} : _props$attributesOfNa;
|
|
59
|
-
|
|
60
|
-
var _useState = (0, _react.useState)(false),
|
|
61
|
-
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
62
|
-
isLoadContent = _useState2[0],
|
|
63
|
-
setIsLoadContent = _useState2[1];
|
|
64
|
-
|
|
65
|
-
var _useState3 = (0, _react.useState)(false),
|
|
66
|
-
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
67
|
-
dragenter = _useState4[0],
|
|
68
|
-
setDragenter = _useState4[1];
|
|
69
|
-
|
|
13
|
+
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); }
|
|
14
|
+
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; }
|
|
15
|
+
const RC = 'file-loader';
|
|
16
|
+
const FileLoader = props => {
|
|
17
|
+
const {
|
|
18
|
+
// будет использован в качестве id инпута в LoadZone, обязателен для корректной работы
|
|
19
|
+
fieldKey,
|
|
20
|
+
// null или структура { name, path, ... остальное по желанию }
|
|
21
|
+
value,
|
|
22
|
+
disabled,
|
|
23
|
+
error,
|
|
24
|
+
className,
|
|
25
|
+
placeholder,
|
|
26
|
+
onChange,
|
|
27
|
+
doLoad,
|
|
28
|
+
filterFiles,
|
|
29
|
+
processErrors,
|
|
30
|
+
isBlockNullValues,
|
|
31
|
+
isDisableErrorsClass = true,
|
|
32
|
+
uploadIcon,
|
|
33
|
+
downloadIcon,
|
|
34
|
+
deleteIcon,
|
|
35
|
+
spiner,
|
|
36
|
+
isIconAfter,
|
|
37
|
+
isLinkTypeDownload = false,
|
|
38
|
+
isUseLinkTitle = false,
|
|
39
|
+
attributesOfNativeInput = {}
|
|
40
|
+
} = props;
|
|
41
|
+
const [isLoadContent, setIsLoadContent] = (0, _react.useState)(false);
|
|
42
|
+
const [dragenter, setDragenter] = (0, _react.useState)(false);
|
|
70
43
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
71
|
-
className: (0, _classnames.default)(RC, className,
|
|
44
|
+
className: (0, _classnames.default)(RC, className, {
|
|
45
|
+
["".concat(RC, "_load-content")]: isLoadContent,
|
|
46
|
+
["".concat(RC, "_load-zone")]: !value,
|
|
47
|
+
["".concat(RC, "_hover")]: dragenter,
|
|
48
|
+
["".concat(RC, "_disabled")]: disabled,
|
|
49
|
+
["".concat(RC, "_error")]: !isDisableErrorsClass && !!error
|
|
50
|
+
})
|
|
72
51
|
}, isLoadContent && spiner, !doLoad && 'develop error: no doLoad', !!doLoad && !!value && /*#__PURE__*/_react.default.createElement(_LoadedContent.default, {
|
|
73
52
|
RC: RC,
|
|
74
53
|
value: value,
|
|
75
|
-
onDelete:
|
|
76
|
-
return onChange(null);
|
|
77
|
-
},
|
|
54
|
+
onDelete: () => onChange(null),
|
|
78
55
|
icon: downloadIcon,
|
|
79
56
|
isIconAfter: isIconAfter,
|
|
80
57
|
deleteIcon: deleteIcon,
|
|
@@ -96,6 +73,4 @@ var FileLoader = function FileLoader(props) {
|
|
|
96
73
|
attributesOfNativeInput: attributesOfNativeInput
|
|
97
74
|
}));
|
|
98
75
|
};
|
|
99
|
-
|
|
100
|
-
var _default = FileLoader;
|
|
101
|
-
exports.default = _default;
|
|
76
|
+
var _default = exports.default = FileLoader;
|