intelicoreact 1.6.19 → 1.6.20
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 +102 -1
- package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.js +89 -1
- package/dist/Atomic/FormElements/Calendar/Calendar.js +232 -1
- package/dist/Atomic/FormElements/Calendar/Calendar.props.js +3 -1
- package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.js +101 -1
- package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.js +70 -1
- package/dist/Atomic/FormElements/Datepicker/Datepicker.js +350 -1
- package/dist/Atomic/FormElements/Datepicker/Datepicker.props.js +3 -1
- package/dist/Atomic/FormElements/Datepicker/components/DatepickerCalendar.js +177 -1
- package/dist/Atomic/FormElements/Datepicker/components/DatepickerCalendar.props.js +3 -1
- package/dist/Atomic/FormElements/Dropdown/Dropdown.js +561 -1
- package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.js +20 -1
- package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.js +405 -1
- package/dist/Atomic/FormElements/FileLoader/FileLoader.js +94 -1
- package/dist/Atomic/FormElements/FileLoader/partial/LoadZone.js +105 -1
- package/dist/Atomic/FormElements/FileLoader/partial/LoadedContent.js +67 -1
- package/dist/Atomic/FormElements/FileLoaderDescription/FileLoaderDescription.js +247 -1
- package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.js +160 -1
- package/dist/Atomic/FormElements/FileLoaderLocalGroup/FileLoaderLocalGroup.js +193 -1
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.js +135 -1
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN_old.js +116 -1
- package/dist/Atomic/FormElements/Input/Input.js +467 -1
- package/dist/Atomic/FormElements/InputCalendar/InputCalendar.js +161 -1
- package/dist/Atomic/FormElements/InputColor/InputColor.js +64 -1
- package/dist/Atomic/FormElements/InputCurrency/InputCurrency.js +166 -1
- package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +354 -1
- package/dist/Atomic/FormElements/InputDateRange/components/DateInput.js +71 -1
- package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.js +693 -1
- package/dist/Atomic/FormElements/InputDateRange/components/OpenedPart.js +254 -1
- package/dist/Atomic/FormElements/InputDateRange/components/SelectItem.js +32 -1
- package/dist/Atomic/FormElements/InputDateRange/dependencies.js +200 -1
- package/dist/Atomic/FormElements/InputLink/InputLink.js +99 -1
- package/dist/Atomic/FormElements/InputMask/InputCarretPosition.js +37 -1
- package/dist/Atomic/FormElements/InputMask/InputMask.js +1214 -1
- package/dist/Atomic/FormElements/InputMask/config.js +15 -1
- package/dist/Atomic/FormElements/InputMask/functions.js +58 -1
- package/dist/Atomic/FormElements/InputMask2/InputMask2.js +674 -1
- package/dist/Atomic/FormElements/InputMask2/config.js +15 -1
- package/dist/Atomic/FormElements/InputMask2/functions.js +58 -1
- package/dist/Atomic/FormElements/InputMask3/InputMask3.js +766 -1
- package/dist/Atomic/FormElements/InputMask3/config.js +15 -1
- package/dist/Atomic/FormElements/InputMask3/functions.js +58 -1
- package/dist/Atomic/FormElements/InputWithAction/InputWithAction.js +114 -1
- package/dist/Atomic/FormElements/InputsRow/InputsRow.js +140 -1
- package/dist/Atomic/FormElements/Label/Label.js +82 -1
- package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +506 -1
- package/dist/Atomic/FormElements/MultiSelect/MultiSelect.js +45 -1
- package/dist/Atomic/FormElements/NumericInput/NumericInput.js +331 -1
- package/dist/Atomic/FormElements/RadioGroup/RadioGroup.js +66 -1
- package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +80 -1
- package/dist/Atomic/FormElements/RadioInput/RadioInput.js +64 -1
- package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.js +54 -1
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +183 -1
- package/dist/Atomic/FormElements/RangeInputs/RangeInputs.js +209 -1
- package/dist/Atomic/FormElements/RangeList/RangeList.js +175 -1
- package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.js +43 -1
- package/dist/Atomic/FormElements/RangeSlider/RangeSlider.js +443 -1
- package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +858 -1
- package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.js +39 -1
- package/dist/Atomic/FormElements/Switcher/Switcher.js +59 -1
- package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.js +50 -1
- package/dist/Atomic/FormElements/SwitcherHide/SwitcherHide.js +47 -1
- package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.js +96 -1
- package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.js +40 -1
- package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.js +64 -1
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.js +170 -1
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/partial/States.js +202 -1
- package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.js +67 -1
- package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.js +115 -1
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +826 -1
- package/dist/Atomic/FormElements/Text/Text.js +125 -1
- package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.js +45 -1
- package/dist/Atomic/FormElements/Textarea/Textarea.js +80 -1
- package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +176 -1
- package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.js +62 -1
- package/dist/Atomic/FormElements/TimeRange/TimeRange.js +127 -1
- package/dist/Atomic/FormElements/UserContacts/UserContacts.js +220 -1
- package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.js +83 -1
- package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.js +82 -1
- package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.js +101 -1
- package/dist/Atomic/FormElements/WidgetPseudoTable/partial/constructor.js +29 -1
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.js +113 -1
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/partial/constructor.js +30 -1
- package/dist/Atomic/Layout/Header/Header.js +85 -1
- package/dist/Atomic/Layout/Spinner/Spinner.js +39 -1
- package/dist/Atomic/UI/Accordion/Accordion.js +118 -1
- package/dist/Atomic/UI/Accordion/AccordionItem.js +181 -1
- package/dist/Atomic/UI/AccordionTable/AccordionTable.js +238 -1
- package/dist/Atomic/UI/AccordionText/AccordionText.js +69 -1
- package/dist/Atomic/UI/AdvancedTag/AdvTag.js +207 -1
- package/dist/Atomic/UI/AdvancedTag/AdvancedTags.js +56 -1
- package/dist/Atomic/UI/Alert/Alert.js +72 -1
- package/dist/Atomic/UI/Arrow/Arrow.js +132 -1
- package/dist/Atomic/UI/Box/Box.js +52 -1
- package/dist/Atomic/UI/Button/Button.js +89 -1
- package/dist/Atomic/UI/ButtonsBar/ButtonsBar.js +72 -1
- package/dist/Atomic/UI/Chart/Chart.js +172 -1
- package/dist/Atomic/UI/Chart/partial/Chart.constants.js +95 -1
- package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +80 -1
- package/dist/Atomic/UI/Chart/partial/datasetSetters.js +188 -1
- package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +335 -1
- package/dist/Atomic/UI/Chart/partial/optionsSetters.js +43 -1
- package/dist/Atomic/UI/Chart/partial/utils.js +60 -1
- package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +109 -1
- package/dist/Atomic/UI/DateTime/DateTime.js +57 -1
- package/dist/Atomic/UI/DebugContainer/DebugContainer.js +44 -1
- package/dist/Atomic/UI/DebugContainer/useDebugContainer.js +15 -1
- package/dist/Atomic/UI/DoubleString/DoubleString.js +102 -1
- package/dist/Atomic/UI/DynamicIcon/DynamicIcon.js +226 -1
- package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +221 -1
- package/dist/Atomic/UI/ExampleChartIntegration/partial/utils.js +106 -1
- package/dist/Atomic/UI/Hint/Hint.js +193 -1
- package/dist/Atomic/UI/Hint/partials/_utils.js +51 -1
- package/dist/Atomic/UI/Modal/Modal.js +188 -1
- package/dist/Atomic/UI/Modal/ModalHOC.js +72 -1
- package/dist/Atomic/UI/Modal/partials/ModalFooter.js +46 -1
- package/dist/Atomic/UI/Modal/partials/ModalTitle.js +83 -1
- package/dist/Atomic/UI/Modal/partials/useMobileModal.js +200 -1
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion._test.js +75 -1
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +80 -1
- package/dist/Atomic/UI/NavLine/NavLine.js +293 -1
- package/dist/Atomic/UI/PageTitle/PageTitle.js +75 -1
- package/dist/Atomic/UI/PieChart/PieChart.js +42 -1
- package/dist/Atomic/UI/Price/Price.js +22 -1
- package/dist/Atomic/UI/PriceRange/PriceRange.js +36 -1
- package/dist/Atomic/UI/ProgressLine/ProgressLine.js +71 -1
- package/dist/Atomic/UI/Status/Status.js +59 -1
- package/dist/Atomic/UI/Table/Partials/TdCell.js +87 -1
- package/dist/Atomic/UI/Table/Partials/TdHeader.js +38 -1
- package/dist/Atomic/UI/Table/Partials/TdRow.js +99 -1
- package/dist/Atomic/UI/Table/Partials/TdTitle.js +52 -1
- package/dist/Atomic/UI/Table/Table.js +63 -1
- package/dist/Atomic/UI/Table/TdTypes/TdActions.js +80 -1
- package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +28 -1
- package/dist/Atomic/UI/Table/TdTypes/TdRange.js +13 -1
- package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +53 -1
- package/dist/Atomic/UI/Tag/Tag.js +160 -1
- package/dist/Atomic/UI/TagList/TagList.js +251 -1
- package/dist/Atomic/UI/UserBox/UserBox.js +73 -1
- package/dist/Atomic/UI/WizardStepper/constructor.js +84 -1
- package/dist/Atomic/UI/WizardStepper/index.js +3 -1
- package/dist/Atomic/UI/WizardStepper/ui/StateIcon/StateIcon.js +37 -1
- package/dist/Atomic/UI/WizardStepper/ui/StateIcon/index.js +3 -1
- package/dist/Atomic/UI/WizardStepper/ui/StepRow/StepRow.js +61 -1
- package/dist/Atomic/UI/WizardStepper/ui/StepRow/index.js +3 -1
- package/dist/Atomic/UI/WizardStepper/ui/StepWrapper/StepWrapper.js +39 -1
- package/dist/Atomic/UI/WizardStepper/ui/StepWrapper/index.js +3 -1
- package/dist/Atomic/UI/WizardStepper/ui/icons.js +49 -1
- package/dist/Atomic/UI/WizardStepper/ui/index.js +3 -1
- package/dist/Classes/AbortableFetch.js +454 -1
- package/dist/Classes/AnimatedHandler.js +47 -1
- package/dist/Classes/RESTAPI/index.js +228 -1
- package/dist/Classes/RESTAPI/partials/AbortableFetch.js +457 -1
- package/dist/Classes/RESTAPI/partials/ApiBase.js +48 -1
- package/dist/Classes/RESTAPI/partials/ApiRequestCreators.js +112 -1
- package/dist/Classes/RESTAPI/partials/ApiUtils.js +189 -1
- package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +252 -1
- package/dist/Classes/RESTAPI/partials/Utils.js +92 -1
- package/dist/Classes/RESTAPI/partials/_outerDependencies.js +3 -1
- package/dist/Classes/RESTAPI/partials/_utils.js +197 -1
- package/dist/Constants/index.constants.js +78 -1
- package/dist/Functions/Portal.js +22 -1
- package/dist/Functions/customEventListener.js +96 -1
- package/dist/Functions/dateTime.js +149 -1
- package/dist/Functions/fieldValueFormatters.js +405 -1
- package/dist/Functions/guards/assertions.js +66 -1
- package/dist/Functions/guards/safeValue.js +30 -1
- package/dist/Functions/guards/typeGuards.js +116 -1
- package/dist/Functions/hooks/useFormFieldsChangesManager.js +95 -1
- package/dist/Functions/locale/createTranslator.js +32 -1
- package/dist/Functions/operations.js +130 -1
- package/dist/Functions/presets/inputMaskPresets.js +170 -1
- package/dist/Functions/presets/inputPresets.js +60 -1
- package/dist/Functions/presets/mobileKeyboardTypesPresets.js +45 -1
- package/dist/Functions/schemas.js +31 -1
- package/dist/Functions/useBodyScrollLock.js +17 -1
- package/dist/Functions/useClickOutside.js +15 -1
- package/dist/Functions/useDebounce.js +17 -1
- package/dist/Functions/useFieldFocus.js +84 -1
- package/dist/Functions/useFormTools/form-drivers/ArrayWithObjects.js +39 -1
- package/dist/Functions/useFormTools/form-drivers/ObjectWithIterableObjects.js +159 -1
- package/dist/Functions/useFormTools/form-drivers/ObjectWithNamedKeyObjects.js +78 -1
- package/dist/Functions/useFormTools/functions/General.js +134 -1
- package/dist/Functions/useFormTools/functions/RenderFields.js +111 -1
- package/dist/Functions/useFormTools/functions/usePrevious.js +12 -1
- package/dist/Functions/useFormTools/index.js +778 -1
- package/dist/Functions/useInputHighlightError.js +67 -1
- package/dist/Functions/useIsMobile/useIsMobile.js +53 -1
- package/dist/Functions/useKeyPress/useHandleKeyPress.js +21 -1
- package/dist/Functions/useKeyPress/useKeyPress.js +75 -1
- package/dist/Functions/useLocalStorage.js +34 -1
- package/dist/Functions/useLocationParams.js +27 -1
- package/dist/Functions/useMediaQuery.js +17 -1
- package/dist/Functions/useMetaInfo.js +43 -1
- package/dist/Functions/useMouseUpOutside.js +16 -1
- package/dist/Functions/useOnlineStatus.js +29 -1
- package/dist/Functions/usePasswordChecker.js +110 -1
- package/dist/Functions/usePrevious.js +12 -1
- package/dist/Functions/useResize.js +31 -1
- package/dist/Functions/useScrollTo.js +17 -1
- package/dist/Functions/useToggle.js +17 -1
- package/dist/Functions/utils.js +522 -1
- package/dist/Langs.js +168 -1
- package/dist/Molecular/CustomIcons/components/AffiliateNetworks.js +21 -1
- package/dist/Molecular/CustomIcons/components/AlertCircle.js +23 -1
- package/dist/Molecular/CustomIcons/components/AppStore.js +29 -1
- package/dist/Molecular/CustomIcons/components/Arrow.js +32 -1
- package/dist/Molecular/CustomIcons/components/ArrowDown.js +17 -1
- package/dist/Molecular/CustomIcons/components/ArrowLeft.js +22 -1
- package/dist/Molecular/CustomIcons/components/ArrowRight.js +22 -1
- package/dist/Molecular/CustomIcons/components/ArrowUp.js +17 -1
- package/dist/Molecular/CustomIcons/components/Bell.js +15 -1
- package/dist/Molecular/CustomIcons/components/Button.js +12 -1
- package/dist/Molecular/CustomIcons/components/Campaigns.js +16 -1
- package/dist/Molecular/CustomIcons/components/Check.js +14 -1
- package/dist/Molecular/CustomIcons/components/Check2.js +12 -1
- package/dist/Molecular/CustomIcons/components/ChevronDown.js +12 -1
- package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.js +11 -1
- package/dist/Molecular/CustomIcons/components/ChevronLeft.js +11 -1
- package/dist/Molecular/CustomIcons/components/ChevronRight.js +11 -1
- package/dist/Molecular/CustomIcons/components/ChevronUp.js +11 -1
- package/dist/Molecular/CustomIcons/components/ChevronUpDown.js +27 -1
- package/dist/Molecular/CustomIcons/components/Close.js +14 -1
- package/dist/Molecular/CustomIcons/components/ColumnsOrder.js +17 -1
- package/dist/Molecular/CustomIcons/components/Delete.js +16 -1
- package/dist/Molecular/CustomIcons/components/Edit.js +15 -1
- package/dist/Molecular/CustomIcons/components/Email.js +31 -1
- package/dist/Molecular/CustomIcons/components/FinturfLogo.js +18 -1
- package/dist/Molecular/CustomIcons/components/FinturfLogo2.js +35 -1
- package/dist/Molecular/CustomIcons/components/Flows.js +15 -1
- package/dist/Molecular/CustomIcons/components/Gift.js +25 -1
- package/dist/Molecular/CustomIcons/components/GoogleAuth.js +29 -1
- package/dist/Molecular/CustomIcons/components/GooglePlay.js +29 -1
- package/dist/Molecular/CustomIcons/components/HelpCircle.js +19 -1
- package/dist/Molecular/CustomIcons/components/HelpCircle2.js +20 -1
- package/dist/Molecular/CustomIcons/components/HelpCircleFilled.js +19 -1
- package/dist/Molecular/CustomIcons/components/Home.js +16 -1
- package/dist/Molecular/CustomIcons/components/Home2.js +22 -1
- package/dist/Molecular/CustomIcons/components/Key.js +23 -1
- package/dist/Molecular/CustomIcons/components/Landers.js +20 -1
- package/dist/Molecular/CustomIcons/components/Lock.js +15 -1
- package/dist/Molecular/CustomIcons/components/Mail.js +26 -1
- package/dist/Molecular/CustomIcons/components/Mastercard.js +73 -1
- package/dist/Molecular/CustomIcons/components/Minus.js +25 -1
- package/dist/Molecular/CustomIcons/components/Offers.js +16 -1
- package/dist/Molecular/CustomIcons/components/Pause.js +28 -1
- package/dist/Molecular/CustomIcons/components/PayPal.js +41 -1
- package/dist/Molecular/CustomIcons/components/PayPalLightLarge.js +28 -1
- package/dist/Molecular/CustomIcons/components/Phone.js +30 -1
- package/dist/Molecular/CustomIcons/components/Play.js +25 -1
- package/dist/Molecular/CustomIcons/components/Plus.js +25 -1
- package/dist/Molecular/CustomIcons/components/Profile.js +16 -1
- package/dist/Molecular/CustomIcons/components/QRCode.js +29 -1
- package/dist/Molecular/CustomIcons/components/Rectangle.js +12 -1
- package/dist/Molecular/CustomIcons/components/Revert.js +13 -1
- package/dist/Molecular/CustomIcons/components/Star.js +14 -1
- package/dist/Molecular/CustomIcons/components/Star2.js +16 -1
- package/dist/Molecular/CustomIcons/components/TrafficSources.js +14 -1
- package/dist/Molecular/CustomIcons/components/Trash.js +15 -1
- package/dist/Molecular/CustomIcons/components/TrashRed.js +15 -1
- package/dist/Molecular/CustomIcons/components/Triggers.js +15 -1
- package/dist/Molecular/CustomIcons/components/User.js +25 -1
- package/dist/Molecular/CustomIcons/components/Visa.js +31 -1
- package/dist/Molecular/CustomIcons/components/X.js +12 -1
- package/dist/Molecular/CustomIcons/index.js +61 -1
- package/dist/Molecular/FormElement/FormElement.js +54 -1
- package/dist/Molecular/FormWithDependOn/FormWithDependOn.js +184 -1
- package/dist/Molecular/FormWithDependOn/partials/_utils.js +53 -1
- package/dist/Molecular/InputAddress/InputAddress.js +620 -1
- package/dist/Molecular/InputPassword/InputPassword.js +48 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1,405 @@
|
|
|
1
|
-
function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,l=Array(t);n<t;n++)l[n]=e[n];return l}function t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n(e){for(var n=1;n<arguments.length;n++){var l=null!=arguments[n]?arguments[n]:{},r=Object.keys(l);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(l).filter(function(e){return Object.getOwnPropertyDescriptor(l,e).enumerable}))),r.forEach(function(n){t(e,n,l[n])})}return e}function l(t,n){return function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n,l,r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],u=!0,i=!1;try{for(r=r.call(e);!(u=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);u=!0);}catch(e){i=!0,l=e}finally{try{u||null==r.return||r.return()}finally{if(i)throw l}}return o}}(t,n)||function(t,n){if(t){if("string"==typeof t)return e(t,n);var l=Object.prototype.toString.call(t).slice(8,-1);if("Object"===l&&t.constructor&&(l=t.constructor.name),"Map"===l||"Set"===l)return Array.from(l);if("Arguments"===l||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return e(t,n)}}(t,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return b}});var r=require("react/jsx-runtime"),o=p(require("classnames")),u=function(e,t){if(e&&e.__esModule)return e;if(null===e||(void 0===e?"undefined":e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)!="object"&&"function"!=typeof e)return{default:e};var n=m(t);if(n&&n.has(e))return n.get(e);var l={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var u=r?Object.getOwnPropertyDescriptor(e,o):null;u&&(u.get||u.set)?Object.defineProperty(l,o,u):l[o]=e[o]}return l.default=e,n&&n.set(e,l),l}(require("react")),i=require("react-dom"),c=require("react-feather"),a=require("../../../Functions/fieldValueFormatters"),s=require("../../../Functions/useDebounce"),d=p(require("../../../Functions/useIsMobile/useIsMobile")),f=p(require("../../Layout/Spinner/Spinner")),v=p(require("../RadioInput/RadioInput"));function p(e){return e&&e.__esModule?e:{default:e}}function m(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(m=function(e){return e?n:t})(e)}require("./DropdownLiveSearch.scss");var h="dropdown-live-search",b=function(e){var p,m,b,g,_=e.label,w=e.value,y=e.error,x=e.disabled,j=e.onChange,E=e.placeholder,S=e.className,L=e.isSearchable,N=e.doRequest,C=e.isLoading,I=e.options,k=e.fieldKey,O=e.id,M=e.isListTop,q=e.attributesOfNativeInput,P=e.withMobileLogic,R=e.tabIndex,H=e.isNotValidateASCII,D=void 0!==H&&H,A=e.noOptionsText,T=void 0===A?"No options available":A,F=e.testId,B=void 0===F?"dropdown-live-search":F,W=l((0,u.useState)(O||k||Math.random().toString(16).slice(2)),1)[0],V=l((0,u.useState)(!1),2),$=V[0],U=V[1],z=l((0,u.useState)(!1),2),K=z[0],X=z[1],G=(0,d.default)().isMobile&&P&&window.screen.width<=768,J=(0,u.useMemo)(function(){var e,t;return null!=(t=null==I||null==(e=I.find(function(e){return e.value===w}))?void 0:e.label)?t:""},[w,I]),Q=l((0,u.useState)(""),2),Y=Q[0],Z=Q[1],ee=l((0,u.useState)(!1),2),et=ee[0],en=ee[1],el=(0,u.useRef)(null),er=(0,u.useRef)(null),eo=(0,u.useRef)(null),eu=(0,u.useRef)(null),ei=(0,u.useRef)(null),ec=(0,u.useRef)(null),ea=(0,u.useRef)(null),es=(0,u.useRef)(null),ed=l((0,u.useState)(!1),2),ef=ed[0],ev=ed[1],ep=l((0,u.useState)(null),2),em=ep[0],eh=ep[1],eb=l((0,u.useState)(!1),2),eg=eb[0],e_=eb[1],ew=l((0,u.useState)(0),2),ey=ew[0],ex=ew[1],ej=l((0,u.useState)(1),2),eE=ej[0],eS=ej[1],eL=(0,s.useDebounce)({searchValue:Y,delay:600}),eN=(0,u.useCallback)(function(e){if(N&&"function"==typeof N){var t,n=null==e?void 0:e.target;Math.round(n.clientHeight+n.scrollTop)===n.scrollHeight&&N(null!=(t=ea.current)?t:"",!0)}},[I]),eC=function(e){var t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];t&&en(!0),Z(e),ea.current=e},eI=function(e){U(e),eC("",!1),e||en(!1)},ek=function(){var e,t;return null!=(t=null!=(e=document.querySelector("div#root"))?e:document.querySelector("div#app"))?t:document.querySelector("div#storybook-root")},eO=function(){return document.getElementById(null==W?void 0:W.toString())},eM=function(e){e.target===(null==es?void 0:es.current)&&(e.stopPropagation(),e.preventDefault(),eI(!1))},eq=function(e){$||(e.preventDefault(),e.stopPropagation())},eP=function(e){var t;!el.current||el.current.contains(e.target)||eO()&&(null==(t=eO())?void 0:t.contains(e.target))||eI(!1)},eR=function(e){[27].includes(e.keyCode)&&eI(!1)},eH=$?eP:function(){},eD=function(e){var t,n=null==(t=e.target)?void 0:t.value;D||(n=(0,a.formatToOnlyASCIICodeText)(n)),eC(n),!Y&&et||e.target.value?X(!1):(null==j||j(""),eC(""),X(!0))},eA=function(e,t){if(!L)return e;var n=et||G&&P?Y:J;return e=e.replace(/["&<>]/g,function(e){var t;return null!=(t=({'"':""","&":"&","<":"<",">":">"})[e])?t:""}),(n?null==e?void 0:e.replace(RegExp(null==n?void 0:n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&"),"i"),function(e){return'<span class="bg--yellow">'.concat(e,"</span>")}):e)+(t?'<span class="dropdown__list-item-postfix">'.concat(t,"</span>"):"")},eT=function(e,n,l){var u,i,a,s,d=e.label.toLowerCase(),f=null==Y?void 0:Y.toLowerCase();return(0,r.jsxs)("button",{type:"button","data-testid":"".concat(B,"-").concat(l||n,"-option"),onClick:function(){null==j||j(e.value),eI(!1)},className:(0,o.default)("".concat(h,"__list-item"),(t(s={},"".concat(h,"__list-item_active"),e.value===w),t(s,"".concat(h,"__list-item_disabled"),e.disabled),s),e.className),children:[!G||G&&!P&&(0,r.jsx)("span",{className:(0,o.default)("".concat(h,"__active-icon"),t({},"".concat(h,"__active-icon_active"),d===f)),children:(0,r.jsx)(c.Check,{})}),(0,r.jsx)("p",{title:e.label,className:e.labelClassName||"",dangerouslySetInnerHTML:{__html:eA(e.label,e.postfix)}}),G?null!=(a=null==e?void 0:e.customMobileIcon)?a:(0,r.jsx)(v.default,{value:e.value,checked:null==w?void 0:w.toString()}):""]},null==(i=e.value)||null==(u=i.toString())?void 0:u.replace(/ /g,"_"))},eF=function(){var e,l,u;return(0,r.jsx)("div",{className:(0,o.default)("".concat(h,"__container-wrapper")),ref:es,onClick:G?eM:function(){},children:(0,r.jsx)("div",{className:(0,o.default)("".concat(h,"__list-wrapper"),(t(l={},"".concat(h,"__list-wrapper--fixed-height"),eg),t(l,"".concat(h,"__list-wrapper--with-bottom-shadow"),em&&G),t(l,"".concat(h,"__list-wrapper--with-bottom-shadow-hidden"),ey===eE),l)),children:(0,r.jsxs)("div",{id:"dropdown-live-search-list",className:(0,o.default)("".concat(h,"__container"),t({},"".concat(h,"__list-top"),M)),ref:er,children:[G&&(0,r.jsxs)("div",{ref:eu,className:(0,o.default)("".concat(h,"__list-header"),(t(u={},"".concat(h,"__list-header-with-shadow"),em&&G),t(u,"".concat(h,"__list-header-with-shadow-hidden"),0===ey),u)),children:[(0,r.jsxs)("div",{className:(0,o.default)("".concat(h,"__list-header-row")),children:[(0,r.jsx)("div",{className:(0,o.default)("".concat(h,"__list-label")),children:_}),(0,r.jsx)("div",{className:(0,o.default)("".concat(h,"__list-close-icon")),onClick:function(){return eI(!1)},children:(0,r.jsx)(c.X,{onClick:function(){return eI(!1)}})})]}),L&&(0,r.jsx)("input",n({ref:ec,className:"".concat(h,"__input"),value:$?Y:J,onChange:eD,placeholder:E,onFocus:eq,tabIndex:-1},q))]}),(0,r.jsxs)("div",{className:(0,o.default)("".concat(h,"__list"),{disabled:C}),ref:eo,children:[null==I?void 0:I.map(function(e){return eT(e)}),!(null==I?void 0:I.length)&&(0,r.jsx)("div",{className:"".concat(h,"__list-item ").concat(h,"__list-item--no-options"),children:T})]}),C&&$&&(0,r.jsx)(f.default,{size:(null!=(e=null==I?void 0:I.length)?e:0)<=3?"small":null})]})})})},eB=function(){var e=document.createElement("div");e.setAttribute("id",null==W?void 0:W.toString()),e.classList.add("dropdown__container"),G&&e.addEventListener("click",function(e){e.target.id===W&&eI(!1)});try{null==(t=eO())||t.remove()}finally{if(G){try{null==(r=document.getElementById("mlw-".concat(W)))||r.remove()}catch(e){}var t,n,l,r,o=document.createElement("div");o.classList.add("dropdown-live-search-mobile"),o.setAttribute("id","mlw-".concat(W)),null==o||o.append(e),null==(l=ek())||l.append(o)}else null==(n=ek())||n.append(e)}};return((0,u.useEffect)(function(){return document.addEventListener("click",eP,!0),function(){return document.removeEventListener("click",eP,!0)}},[]),(0,u.useEffect)(function(){(null==I?void 0:I.length)===1&&Y===I[0].label&&(eC(I[0].label),null==j||j(I[0].value))},[I]),(0,u.useEffect)(function(){L&&(eL||K)&&(null==N||N(eL),K&&X(!1))},[eL,K]),(0,u.useEffect)(function(){G&&P&&eB()},[G,P]),(0,u.useEffect)(function(){if($&&G&&(null==eo?void 0:eo.current)&&!Y){var e,t,n,l;eh((null==eo||null==(e=eo.current)?void 0:e.scrollHeight)>(null==eo||null==(t=eo.current)?void 0:t.clientHeight)),e_(em||(null==eo||null==(n=eo.current)?void 0:n.scrollHeight)>(null==eo||null==(l=eo.current)?void 0:l.clientHeight))}},[$,G,em,null==eo?void 0:eo.current,null==eo||null==(m=eo.current)?void 0:m.scrollHeight,null==eo||null==(b=eo.current)?void 0:b.clientHeight]),(0,u.useLayoutEffect)(function(){var e=document.getElementById("dropdown-live-search-list");if((e||$)&&(!P||!G)){var t,n=null==el||null==(t=el.current)?void 0:t.clientWidth;e&&(e.style.minWidth="".concat(n,"px"))}},[el,$,P]),(0,u.useEffect)(function(){if(!$&&(ev(!1),P&&G&&eC("")),$&&eo&&eo.current){if(G&&P){var e;null==N||N("").then(function(){setTimeout(function(){if(eo.current&&(null==er?void 0:er.current)&&(null==eu?void 0:eu.current)){var e,t,n,l;eo.current.style.maxHeight="".concat((null==er||null==(t=er.current)||null==(e=t.getBoundingClientRect())?void 0:e.height)-(null==eu||null==(l=eu.current)||null==(n=l.getBoundingClientRect())?void 0:n.height),"px")}},1)}),null==ec||null==(e=ec.current)||e.focus()}eo.current.addEventListener("scroll",eN)}return function(){removeEventListener("scroll",eN)}},[$,eo]),(0,u.useLayoutEffect)(function(){var e;return G?(window.removeEventListener("mousewheel",eH),window.removeEventListener("scroll",eH),window.removeEventListener("touchmove",eH)):(window.addEventListener("mousewheel",eH),window.addEventListener("scroll",eH),window.addEventListener("touchmove",eH)),null==(e=eO())||e.addEventListener("click",eH),window.addEventListener("keyup",eR),function(){var e;window.removeEventListener("mousewheel",eH),window.removeEventListener("scroll",eH),window.removeEventListener("touchmove",eH),window.removeEventListener("keyup",eR),null==(e=eO())||e.removeEventListener("click",eH)}},[eO]),(0,u.useEffect)(function(){var e,t=function(e){var t,n;ex(Number.parseInt(null==(n=e.target)||null==(t=n.scrollTop)?void 0:t.toString(),10))};return $&&G&&(null==eo?void 0:eo.current)&&(null==eo||null==(e=eo.current)||e.addEventListener("scroll",t)),function(){var e;null==eo||null==(e=eo.current)||e.removeEventListener("scroll",t)}},[$,G,null==eo?void 0:eo.current]),(0,u.useEffect)(function(){if(null==eo?void 0:eo.current){var e,t,n;eS(Number.parseInt((e=(null==eo||null==(t=eo.current)?void 0:t.scrollHeight)-(null==eo||null==(n=eo.current)?void 0:n.clientHeight),e.toString()),10))}},[ey,null==eo?void 0:eo.current]),I)?(0,r.jsxs)("div",{className:(0,o.default)(h,S,(t(g={disabled:x},"".concat(h,"-mobile"),G),t(g,"".concat(h,"--focused"),$),g)),ref:el,children:[(0,r.jsxs)("button",{type:"button","data-testid":B,className:"".concat(h,"__trigger input__wrap ").concat($?"input__wrap--focus":""," ").concat(!w?"placeholder":""," ").concat(y?"error":""),onClick:function(){return L?null:eI(!$)},onMouseDown:function(){return ev(!0)},onFocus:function(){return ef?null:eI(!0)},tabIndex:R,children:[L?(0,r.jsx)("input",n({ref:ei,className:"".concat(h,"__input"),value:$?G&&P||!et?J:Y:J,onChange:eD,placeholder:E,onFocus:eq,onClick:function(e){var t,n;$||eI(!0),G&&P?(e.preventDefault(),e.stopPropagation(),e.target&&(null==(t=e.target)||t.blur())):e.target&&(null==(n=e.target)||n.select())},tabIndex:-1},q)):(0,r.jsx)("span",{className:"text",children:J||E}),(0,r.jsx)("span",{className:(0,o.default)("".concat(h,"__arrow"),t({},"".concat(h,"__arrow_active"),$)),onClick:function(){return eI(!$)},children:G?(0,r.jsx)(c.Code,{className:"mobile-icon"}):$?(0,r.jsx)(c.ChevronUp,{}):(0,r.jsx)(c.ChevronDown,{})})]}),$&&(G&&P?(p=eO())?(0,i.createPortal)(eF(),p):null:eF())]}):null};
|
|
1
|
+
function e(e, t) {
|
|
2
|
+
(null == t || t > e.length) && (t = e.length);
|
|
3
|
+
for(var n = 0, l = Array(t); n < t; n++)l[n] = e[n];
|
|
4
|
+
return l;
|
|
5
|
+
}
|
|
6
|
+
function t(e, t, n) {
|
|
7
|
+
return t in e ? Object.defineProperty(e, t, {
|
|
8
|
+
value: n,
|
|
9
|
+
enumerable: !0,
|
|
10
|
+
configurable: !0,
|
|
11
|
+
writable: !0
|
|
12
|
+
}) : e[t] = n, e;
|
|
13
|
+
}
|
|
14
|
+
function n(e) {
|
|
15
|
+
for(var n = 1; n < arguments.length; n++){
|
|
16
|
+
var l = null != arguments[n] ? arguments[n] : {}, r = Object.keys(l);
|
|
17
|
+
"function" == typeof Object.getOwnPropertySymbols && (r = r.concat(Object.getOwnPropertySymbols(l).filter(function(e) {
|
|
18
|
+
return Object.getOwnPropertyDescriptor(l, e).enumerable;
|
|
19
|
+
}))), r.forEach(function(n) {
|
|
20
|
+
t(e, n, l[n]);
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return e;
|
|
24
|
+
}
|
|
25
|
+
function l(t, n) {
|
|
26
|
+
return function(e) {
|
|
27
|
+
if (Array.isArray(e)) return e;
|
|
28
|
+
}(t) || function(e, t) {
|
|
29
|
+
var n, l, r = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
|
|
30
|
+
if (null != r) {
|
|
31
|
+
var o = [], u = !0, i = !1;
|
|
32
|
+
try {
|
|
33
|
+
for(r = r.call(e); !(u = (n = r.next()).done) && (o.push(n.value), !t || o.length !== t); u = !0);
|
|
34
|
+
} catch (e) {
|
|
35
|
+
i = !0, l = e;
|
|
36
|
+
} finally{
|
|
37
|
+
try {
|
|
38
|
+
u || null == r.return || r.return();
|
|
39
|
+
} finally{
|
|
40
|
+
if (i) throw l;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return o;
|
|
44
|
+
}
|
|
45
|
+
}(t, n) || function(t, n) {
|
|
46
|
+
if (t) {
|
|
47
|
+
if ("string" == typeof t) return e(t, n);
|
|
48
|
+
var l = Object.prototype.toString.call(t).slice(8, -1);
|
|
49
|
+
if ("Object" === l && t.constructor && (l = t.constructor.name), "Map" === l || "Set" === l) return Array.from(l);
|
|
50
|
+
if ("Arguments" === l || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l)) return e(t, n);
|
|
51
|
+
}
|
|
52
|
+
}(t, n) || function() {
|
|
53
|
+
throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
54
|
+
}();
|
|
55
|
+
}
|
|
56
|
+
Object.defineProperty(exports, "__esModule", {
|
|
57
|
+
value: !0
|
|
58
|
+
}), Object.defineProperty(exports, "default", {
|
|
59
|
+
enumerable: !0,
|
|
60
|
+
get: function() {
|
|
61
|
+
return b;
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
var r = require("react/jsx-runtime"), o = p(require("classnames")), u = function(e, t) {
|
|
65
|
+
if (e && e.__esModule) return e;
|
|
66
|
+
if (null === e || (void 0 === e ? "undefined" : e && "undefined" != typeof Symbol && e.constructor === Symbol ? "symbol" : typeof e) != "object" && "function" != typeof e) return {
|
|
67
|
+
default: e
|
|
68
|
+
};
|
|
69
|
+
var n = m(t);
|
|
70
|
+
if (n && n.has(e)) return n.get(e);
|
|
71
|
+
var l = {
|
|
72
|
+
__proto__: null
|
|
73
|
+
}, r = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
74
|
+
for(var o in e)if ("default" !== o && Object.prototype.hasOwnProperty.call(e, o)) {
|
|
75
|
+
var u = r ? Object.getOwnPropertyDescriptor(e, o) : null;
|
|
76
|
+
u && (u.get || u.set) ? Object.defineProperty(l, o, u) : l[o] = e[o];
|
|
77
|
+
}
|
|
78
|
+
return l.default = e, n && n.set(e, l), l;
|
|
79
|
+
}(require("react")), i = require("react-dom"), c = require("react-feather"), a = require("../../../Functions/fieldValueFormatters"), s = require("../../../Functions/useDebounce"), d = p(require("../../../Functions/useIsMobile/useIsMobile")), f = p(require("../../Layout/Spinner/Spinner")), v = p(require("../RadioInput/RadioInput"));
|
|
80
|
+
function p(e) {
|
|
81
|
+
return e && e.__esModule ? e : {
|
|
82
|
+
default: e
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
function m(e) {
|
|
86
|
+
if ("function" != typeof WeakMap) return null;
|
|
87
|
+
var t = new WeakMap(), n = new WeakMap();
|
|
88
|
+
return (m = function(e) {
|
|
89
|
+
return e ? n : t;
|
|
90
|
+
})(e);
|
|
91
|
+
}
|
|
92
|
+
require("./DropdownLiveSearch.scss");
|
|
93
|
+
var h = 'dropdown-live-search', b = function(e) {
|
|
94
|
+
var p, m, b, g, _ = e.label, w = e.value, y = e.error, x = e.disabled, j = e.onChange, E = e.placeholder, S = e.className, L = e.isSearchable, N = e.doRequest, C = e.isLoading, I = e.options, k = e.fieldKey, O = e.id, M = e.isListTop, q = e.attributesOfNativeInput, P = e.withMobileLogic, R = e.tabIndex, H = e.isNotValidateASCII, D = void 0 !== H && H, A = e.noOptionsText, T = void 0 === A ? 'No options available' : A, F = e.testId, B = void 0 === F ? 'dropdown-live-search' : F, W = l((0, u.useState)(O || k || Math.random().toString(16).slice(2)), 1)[0], V = l((0, u.useState)(!1), 2), $ = V[0], U = V[1], z = l((0, u.useState)(!1), 2), K = z[0], X = z[1], G = (0, d.default)().isMobile && P && window.screen.width <= 768, J = (0, u.useMemo)(function() {
|
|
95
|
+
var e, t;
|
|
96
|
+
return null != (t = null == I || null == (e = I.find(function(e) {
|
|
97
|
+
return e.value === w;
|
|
98
|
+
})) ? void 0 : e.label) ? t : '';
|
|
99
|
+
}, [
|
|
100
|
+
w,
|
|
101
|
+
I
|
|
102
|
+
]), Q = l((0, u.useState)(''), 2), Y = Q[0], Z = Q[1], ee = l((0, u.useState)(!1), 2), et = ee[0], en = ee[1], el = (0, u.useRef)(null), er = (0, u.useRef)(null), eo = (0, u.useRef)(null), eu = (0, u.useRef)(null), ei = (0, u.useRef)(null), ec = (0, u.useRef)(null), ea = (0, u.useRef)(null), es = (0, u.useRef)(null), ed = l((0, u.useState)(!1), 2), ef = ed[0], ev = ed[1], ep = l((0, u.useState)(null), 2), em = ep[0], eh = ep[1], eb = l((0, u.useState)(!1), 2), eg = eb[0], e_ = eb[1], ew = l((0, u.useState)(0), 2), ey = ew[0], ex = ew[1], ej = l((0, u.useState)(1), 2), eE = ej[0], eS = ej[1], eL = (0, s.useDebounce)({
|
|
103
|
+
searchValue: Y,
|
|
104
|
+
delay: 600
|
|
105
|
+
}), eN = (0, u.useCallback)(function(e) {
|
|
106
|
+
if (N && 'function' == typeof N) {
|
|
107
|
+
var t, n = null == e ? void 0 : e.target;
|
|
108
|
+
Math.round(n.clientHeight + n.scrollTop) === n.scrollHeight && N(null != (t = ea.current) ? t : '', !0);
|
|
109
|
+
}
|
|
110
|
+
}, [
|
|
111
|
+
I
|
|
112
|
+
]), eC = function(e) {
|
|
113
|
+
var t = !(arguments.length > 1) || void 0 === arguments[1] || arguments[1];
|
|
114
|
+
t && en(!0), Z(e), ea.current = e;
|
|
115
|
+
}, eI = function(e) {
|
|
116
|
+
U(e), eC('', !1), e || en(!1);
|
|
117
|
+
}, ek = function() {
|
|
118
|
+
var e, t;
|
|
119
|
+
return null != (t = null != (e = document.querySelector('div#root')) ? e : document.querySelector('div#app')) ? t : document.querySelector('div#storybook-root');
|
|
120
|
+
}, eO = function() {
|
|
121
|
+
return document.getElementById(null == W ? void 0 : W.toString());
|
|
122
|
+
}, eM = function(e) {
|
|
123
|
+
e.target === (null == es ? void 0 : es.current) && (e.stopPropagation(), e.preventDefault(), eI(!1));
|
|
124
|
+
}, eq = function(e) {
|
|
125
|
+
$ || (e.preventDefault(), e.stopPropagation());
|
|
126
|
+
}, eP = function(e) {
|
|
127
|
+
var t;
|
|
128
|
+
!el.current || el.current.contains(e.target) || eO() && (null == (t = eO()) ? void 0 : t.contains(e.target)) || eI(!1);
|
|
129
|
+
}, eR = function(e) {
|
|
130
|
+
[
|
|
131
|
+
27
|
|
132
|
+
].includes(e.keyCode) && eI(!1);
|
|
133
|
+
}, eH = $ ? eP : function() {}, eD = function(e) {
|
|
134
|
+
var t, n = null == (t = e.target) ? void 0 : t.value;
|
|
135
|
+
D || (n = (0, a.formatToOnlyASCIICodeText)(n)), eC(n), !Y && et || e.target.value ? X(!1) : (null == j || j(''), eC(''), X(!0));
|
|
136
|
+
}, eA = function(e, t) {
|
|
137
|
+
if (!L) return e;
|
|
138
|
+
var n = et || G && P ? Y : J;
|
|
139
|
+
return e = e.replace(/["&<>]/g, function(e) {
|
|
140
|
+
var t;
|
|
141
|
+
return null != (t = ({
|
|
142
|
+
'"': '"',
|
|
143
|
+
'&': '&',
|
|
144
|
+
'<': '<',
|
|
145
|
+
'>': '>'
|
|
146
|
+
})[e]) ? t : '';
|
|
147
|
+
}), (n ? null == e ? void 0 : e.replace(RegExp(null == n ? void 0 : n.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&'), 'i'), function(e) {
|
|
148
|
+
return '<span class="bg--yellow">'.concat(e, "</span>");
|
|
149
|
+
}) : e) + (t ? '<span class="dropdown__list-item-postfix">'.concat(t, "</span>") : '');
|
|
150
|
+
}, eT = function(e, n, l) {
|
|
151
|
+
var u, i, a, s, d = e.label.toLowerCase(), f = null == Y ? void 0 : Y.toLowerCase();
|
|
152
|
+
return (0, r.jsxs)("button", {
|
|
153
|
+
type: "button",
|
|
154
|
+
"data-testid": "".concat(B, "-").concat(l || n, "-option"),
|
|
155
|
+
onClick: function() {
|
|
156
|
+
null == j || j(e.value), eI(!1);
|
|
157
|
+
},
|
|
158
|
+
className: (0, o.default)("".concat(h, "__list-item"), (t(s = {}, "".concat(h, "__list-item_active"), e.value === w), t(s, "".concat(h, "__list-item_disabled"), e.disabled), s), e.className),
|
|
159
|
+
children: [
|
|
160
|
+
!G || G && !P && (0, r.jsx)("span", {
|
|
161
|
+
className: (0, o.default)("".concat(h, "__active-icon"), t({}, "".concat(h, "__active-icon_active"), d === f)),
|
|
162
|
+
children: (0, r.jsx)(c.Check, {})
|
|
163
|
+
}),
|
|
164
|
+
(0, r.jsx)("p", {
|
|
165
|
+
title: e.label,
|
|
166
|
+
className: e.labelClassName || '',
|
|
167
|
+
dangerouslySetInnerHTML: {
|
|
168
|
+
__html: eA(e.label, e.postfix)
|
|
169
|
+
}
|
|
170
|
+
}),
|
|
171
|
+
G ? null != (a = null == e ? void 0 : e.customMobileIcon) ? a : (0, r.jsx)(v.default, {
|
|
172
|
+
value: e.value,
|
|
173
|
+
checked: null == w ? void 0 : w.toString()
|
|
174
|
+
}) : ''
|
|
175
|
+
]
|
|
176
|
+
}, null == (i = e.value) || null == (u = i.toString()) ? void 0 : u.replace(/ /g, '_'));
|
|
177
|
+
}, eF = function() {
|
|
178
|
+
var e, l, u;
|
|
179
|
+
return (0, r.jsx)("div", {
|
|
180
|
+
className: (0, o.default)("".concat(h, "__container-wrapper")),
|
|
181
|
+
ref: es,
|
|
182
|
+
onClick: G ? eM : function() {},
|
|
183
|
+
children: (0, r.jsx)("div", {
|
|
184
|
+
className: (0, o.default)("".concat(h, "__list-wrapper"), (t(l = {}, "".concat(h, "__list-wrapper--fixed-height"), eg), t(l, "".concat(h, "__list-wrapper--with-bottom-shadow"), em && G), t(l, "".concat(h, "__list-wrapper--with-bottom-shadow-hidden"), ey === eE), l)),
|
|
185
|
+
children: (0, r.jsxs)("div", {
|
|
186
|
+
id: "dropdown-live-search-list",
|
|
187
|
+
className: (0, o.default)("".concat(h, "__container"), t({}, "".concat(h, "__list-top"), M)),
|
|
188
|
+
ref: er,
|
|
189
|
+
children: [
|
|
190
|
+
G && (0, r.jsxs)("div", {
|
|
191
|
+
ref: eu,
|
|
192
|
+
className: (0, o.default)("".concat(h, "__list-header"), (t(u = {}, "".concat(h, "__list-header-with-shadow"), em && G), t(u, "".concat(h, "__list-header-with-shadow-hidden"), 0 === ey), u)),
|
|
193
|
+
children: [
|
|
194
|
+
(0, r.jsxs)("div", {
|
|
195
|
+
className: (0, o.default)("".concat(h, "__list-header-row")),
|
|
196
|
+
children: [
|
|
197
|
+
(0, r.jsx)("div", {
|
|
198
|
+
className: (0, o.default)("".concat(h, "__list-label")),
|
|
199
|
+
children: _
|
|
200
|
+
}),
|
|
201
|
+
(0, r.jsx)("div", {
|
|
202
|
+
className: (0, o.default)("".concat(h, "__list-close-icon")),
|
|
203
|
+
onClick: function() {
|
|
204
|
+
return eI(!1);
|
|
205
|
+
},
|
|
206
|
+
children: (0, r.jsx)(c.X, {
|
|
207
|
+
onClick: function() {
|
|
208
|
+
return eI(!1);
|
|
209
|
+
}
|
|
210
|
+
})
|
|
211
|
+
})
|
|
212
|
+
]
|
|
213
|
+
}),
|
|
214
|
+
L && (0, r.jsx)("input", n({
|
|
215
|
+
ref: ec,
|
|
216
|
+
className: "".concat(h, "__input"),
|
|
217
|
+
value: $ ? Y : J,
|
|
218
|
+
onChange: eD,
|
|
219
|
+
placeholder: E,
|
|
220
|
+
onFocus: eq,
|
|
221
|
+
tabIndex: -1
|
|
222
|
+
}, q))
|
|
223
|
+
]
|
|
224
|
+
}),
|
|
225
|
+
(0, r.jsxs)("div", {
|
|
226
|
+
className: (0, o.default)("".concat(h, "__list"), {
|
|
227
|
+
disabled: C
|
|
228
|
+
}),
|
|
229
|
+
ref: eo,
|
|
230
|
+
children: [
|
|
231
|
+
null == I ? void 0 : I.map(function(e) {
|
|
232
|
+
return eT(e);
|
|
233
|
+
}),
|
|
234
|
+
!(null == I ? void 0 : I.length) && (0, r.jsx)("div", {
|
|
235
|
+
className: "".concat(h, "__list-item ").concat(h, "__list-item--no-options"),
|
|
236
|
+
children: T
|
|
237
|
+
})
|
|
238
|
+
]
|
|
239
|
+
}),
|
|
240
|
+
C && $ && (0, r.jsx)(f.default, {
|
|
241
|
+
size: (null != (e = null == I ? void 0 : I.length) ? e : 0) <= 3 ? 'small' : null
|
|
242
|
+
})
|
|
243
|
+
]
|
|
244
|
+
})
|
|
245
|
+
})
|
|
246
|
+
});
|
|
247
|
+
}, eB = function() {
|
|
248
|
+
var e = document.createElement('div');
|
|
249
|
+
e.setAttribute('id', null == W ? void 0 : W.toString()), e.classList.add('dropdown__container'), G && e.addEventListener('click', function(e) {
|
|
250
|
+
e.target.id === W && eI(!1);
|
|
251
|
+
});
|
|
252
|
+
try {
|
|
253
|
+
null == (t = eO()) || t.remove();
|
|
254
|
+
} finally{
|
|
255
|
+
if (G) {
|
|
256
|
+
try {
|
|
257
|
+
null == (r = document.getElementById("mlw-".concat(W))) || r.remove();
|
|
258
|
+
} catch (e) {}
|
|
259
|
+
var t, n, l, r, o = document.createElement('div');
|
|
260
|
+
o.classList.add('dropdown-live-search-mobile'), o.setAttribute('id', "mlw-".concat(W)), null == o || o.append(e), null == (l = ek()) || l.append(o);
|
|
261
|
+
} else null == (n = ek()) || n.append(e);
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
return ((0, u.useEffect)(function() {
|
|
265
|
+
return document.addEventListener('click', eP, !0), function() {
|
|
266
|
+
return document.removeEventListener('click', eP, !0);
|
|
267
|
+
};
|
|
268
|
+
}, []), (0, u.useEffect)(function() {
|
|
269
|
+
(null == I ? void 0 : I.length) === 1 && Y === I[0].label && (eC(I[0].label), null == j || j(I[0].value));
|
|
270
|
+
}, [
|
|
271
|
+
I
|
|
272
|
+
]), (0, u.useEffect)(function() {
|
|
273
|
+
L && (eL || K) && (null == N || N(eL), K && X(!1));
|
|
274
|
+
}, [
|
|
275
|
+
eL,
|
|
276
|
+
K
|
|
277
|
+
]), (0, u.useEffect)(function() {
|
|
278
|
+
G && P && eB();
|
|
279
|
+
}, [
|
|
280
|
+
G,
|
|
281
|
+
P
|
|
282
|
+
]), (0, u.useEffect)(function() {
|
|
283
|
+
if ($ && G && (null == eo ? void 0 : eo.current) && !Y) {
|
|
284
|
+
var e, t, n, l;
|
|
285
|
+
eh((null == eo || null == (e = eo.current) ? void 0 : e.scrollHeight) > (null == eo || null == (t = eo.current) ? void 0 : t.clientHeight)), e_(em || (null == eo || null == (n = eo.current) ? void 0 : n.scrollHeight) > (null == eo || null == (l = eo.current) ? void 0 : l.clientHeight));
|
|
286
|
+
}
|
|
287
|
+
}, [
|
|
288
|
+
$,
|
|
289
|
+
G,
|
|
290
|
+
em,
|
|
291
|
+
null == eo ? void 0 : eo.current,
|
|
292
|
+
null == eo || null == (m = eo.current) ? void 0 : m.scrollHeight,
|
|
293
|
+
null == eo || null == (b = eo.current) ? void 0 : b.clientHeight
|
|
294
|
+
]), (0, u.useLayoutEffect)(function() {
|
|
295
|
+
var e = document.getElementById('dropdown-live-search-list');
|
|
296
|
+
if ((e || $) && (!P || !G)) {
|
|
297
|
+
var t, n = null == el || null == (t = el.current) ? void 0 : t.clientWidth;
|
|
298
|
+
e && (e.style.minWidth = "".concat(n, "px"));
|
|
299
|
+
}
|
|
300
|
+
}, [
|
|
301
|
+
el,
|
|
302
|
+
$,
|
|
303
|
+
P
|
|
304
|
+
]), (0, u.useEffect)(function() {
|
|
305
|
+
if (!$ && (ev(!1), P && G && eC('')), $ && eo && eo.current) {
|
|
306
|
+
if (G && P) {
|
|
307
|
+
var e;
|
|
308
|
+
null == N || N('').then(function() {
|
|
309
|
+
setTimeout(function() {
|
|
310
|
+
if (eo.current && (null == er ? void 0 : er.current) && (null == eu ? void 0 : eu.current)) {
|
|
311
|
+
var e, t, n, l;
|
|
312
|
+
eo.current.style.maxHeight = "".concat((null == er || null == (t = er.current) || null == (e = t.getBoundingClientRect()) ? void 0 : e.height) - (null == eu || null == (l = eu.current) || null == (n = l.getBoundingClientRect()) ? void 0 : n.height), "px");
|
|
313
|
+
}
|
|
314
|
+
}, 1);
|
|
315
|
+
}), null == ec || null == (e = ec.current) || e.focus();
|
|
316
|
+
}
|
|
317
|
+
eo.current.addEventListener('scroll', eN);
|
|
318
|
+
}
|
|
319
|
+
return function() {
|
|
320
|
+
removeEventListener('scroll', eN);
|
|
321
|
+
};
|
|
322
|
+
}, [
|
|
323
|
+
$,
|
|
324
|
+
eo
|
|
325
|
+
]), (0, u.useLayoutEffect)(function() {
|
|
326
|
+
var e;
|
|
327
|
+
return G ? (window.removeEventListener('mousewheel', eH), window.removeEventListener('scroll', eH), window.removeEventListener('touchmove', eH)) : (window.addEventListener('mousewheel', eH), window.addEventListener('scroll', eH), window.addEventListener('touchmove', eH)), null == (e = eO()) || e.addEventListener('click', eH), window.addEventListener('keyup', eR), function() {
|
|
328
|
+
var e;
|
|
329
|
+
window.removeEventListener('mousewheel', eH), window.removeEventListener('scroll', eH), window.removeEventListener('touchmove', eH), window.removeEventListener('keyup', eR), null == (e = eO()) || e.removeEventListener('click', eH);
|
|
330
|
+
};
|
|
331
|
+
}, [
|
|
332
|
+
eO
|
|
333
|
+
]), (0, u.useEffect)(function() {
|
|
334
|
+
var e, t = function(e) {
|
|
335
|
+
var t, n;
|
|
336
|
+
ex(Number.parseInt(null == (n = e.target) || null == (t = n.scrollTop) ? void 0 : t.toString(), 10));
|
|
337
|
+
};
|
|
338
|
+
return $ && G && (null == eo ? void 0 : eo.current) && (null == eo || null == (e = eo.current) || e.addEventListener('scroll', t)), function() {
|
|
339
|
+
var e;
|
|
340
|
+
null == eo || null == (e = eo.current) || e.removeEventListener('scroll', t);
|
|
341
|
+
};
|
|
342
|
+
}, [
|
|
343
|
+
$,
|
|
344
|
+
G,
|
|
345
|
+
null == eo ? void 0 : eo.current
|
|
346
|
+
]), (0, u.useEffect)(function() {
|
|
347
|
+
if (null == eo ? void 0 : eo.current) {
|
|
348
|
+
var e, t, n;
|
|
349
|
+
eS(Number.parseInt((e = (null == eo || null == (t = eo.current) ? void 0 : t.scrollHeight) - (null == eo || null == (n = eo.current) ? void 0 : n.clientHeight), e.toString()), 10));
|
|
350
|
+
}
|
|
351
|
+
}, [
|
|
352
|
+
ey,
|
|
353
|
+
null == eo ? void 0 : eo.current
|
|
354
|
+
]), I) ? (0, r.jsxs)("div", {
|
|
355
|
+
className: (0, o.default)(h, S, (t(g = {
|
|
356
|
+
disabled: x
|
|
357
|
+
}, "".concat(h, "-mobile"), G), t(g, "".concat(h, "--focused"), $), g)),
|
|
358
|
+
ref: el,
|
|
359
|
+
children: [
|
|
360
|
+
(0, r.jsxs)("button", {
|
|
361
|
+
type: "button",
|
|
362
|
+
"data-testid": B,
|
|
363
|
+
className: "".concat(h, "__trigger input__wrap ").concat($ ? 'input__wrap--focus' : '', " ").concat(!w ? 'placeholder' : '', " ").concat(y ? 'error' : ''),
|
|
364
|
+
onClick: function() {
|
|
365
|
+
return L ? null : eI(!$);
|
|
366
|
+
},
|
|
367
|
+
onMouseDown: function() {
|
|
368
|
+
return ev(!0);
|
|
369
|
+
},
|
|
370
|
+
onFocus: function() {
|
|
371
|
+
return ef ? null : eI(!0);
|
|
372
|
+
},
|
|
373
|
+
tabIndex: R,
|
|
374
|
+
children: [
|
|
375
|
+
L ? (0, r.jsx)("input", n({
|
|
376
|
+
ref: ei,
|
|
377
|
+
className: "".concat(h, "__input"),
|
|
378
|
+
value: $ ? G && P || !et ? J : Y : J,
|
|
379
|
+
onChange: eD,
|
|
380
|
+
placeholder: E,
|
|
381
|
+
onFocus: eq,
|
|
382
|
+
onClick: function(e) {
|
|
383
|
+
var t, n;
|
|
384
|
+
$ || eI(!0), G && P ? (e.preventDefault(), e.stopPropagation(), e.target && (null == (t = e.target) || t.blur())) : e.target && (null == (n = e.target) || n.select());
|
|
385
|
+
},
|
|
386
|
+
tabIndex: -1
|
|
387
|
+
}, q)) : (0, r.jsx)("span", {
|
|
388
|
+
className: "text",
|
|
389
|
+
children: J || E
|
|
390
|
+
}),
|
|
391
|
+
(0, r.jsx)("span", {
|
|
392
|
+
className: (0, o.default)("".concat(h, "__arrow"), t({}, "".concat(h, "__arrow_active"), $)),
|
|
393
|
+
onClick: function() {
|
|
394
|
+
return eI(!$);
|
|
395
|
+
},
|
|
396
|
+
children: G ? (0, r.jsx)(c.Code, {
|
|
397
|
+
className: "mobile-icon"
|
|
398
|
+
}) : $ ? (0, r.jsx)(c.ChevronUp, {}) : (0, r.jsx)(c.ChevronDown, {})
|
|
399
|
+
})
|
|
400
|
+
]
|
|
401
|
+
}),
|
|
402
|
+
$ && (G && P ? (p = eO()) ? (0, i.createPortal)(eF(), p) : null : eF())
|
|
403
|
+
]
|
|
404
|
+
}) : null;
|
|
405
|
+
};
|
|
@@ -1 +1,94 @@
|
|
|
1
|
-
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
|
|
3
|
+
import cn from "classnames";
|
|
4
|
+
|
|
5
|
+
import LoadZone from "./partial/LoadZone";
|
|
6
|
+
import LoadedContent from "./partial/LoadedContent";
|
|
7
|
+
|
|
8
|
+
import "./FileLoader.scss";
|
|
9
|
+
|
|
10
|
+
const RC = "file-loader";
|
|
11
|
+
|
|
12
|
+
const FileLoader = (props) => {
|
|
13
|
+
const {
|
|
14
|
+
// будет использован в качестве id инпута в LoadZone, обязателен для корректной работы
|
|
15
|
+
fieldKey,
|
|
16
|
+
// null или структура { name, path, ... остальное по желанию }
|
|
17
|
+
value,
|
|
18
|
+
disabled,
|
|
19
|
+
error,
|
|
20
|
+
|
|
21
|
+
className,
|
|
22
|
+
placeholder,
|
|
23
|
+
|
|
24
|
+
onChange,
|
|
25
|
+
doLoad,
|
|
26
|
+
filterFiles,
|
|
27
|
+
processErrors,
|
|
28
|
+
|
|
29
|
+
isBlockNullValues,
|
|
30
|
+
isDisableErrorsClass = true,
|
|
31
|
+
|
|
32
|
+
uploadIcon,
|
|
33
|
+
downloadIcon,
|
|
34
|
+
deleteIcon,
|
|
35
|
+
spiner,
|
|
36
|
+
|
|
37
|
+
isIconAfter,
|
|
38
|
+
isLinkTypeDownload = false,
|
|
39
|
+
isUseLinkTitle = false,
|
|
40
|
+
attributesOfNativeInput = {},
|
|
41
|
+
} = props;
|
|
42
|
+
|
|
43
|
+
const [isLoadContent, setIsLoadContent] = useState(false);
|
|
44
|
+
const [dragenter, setDragenter] = useState(false);
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<div
|
|
48
|
+
className={cn(RC, className, {
|
|
49
|
+
[`${RC}_load-content`]: isLoadContent,
|
|
50
|
+
[`${RC}_load-zone`]: !value,
|
|
51
|
+
[`${RC}_hover`]: dragenter,
|
|
52
|
+
[`${RC}_disabled`]: disabled,
|
|
53
|
+
[`${RC}_error`]: !isDisableErrorsClass && Boolean(error),
|
|
54
|
+
})}
|
|
55
|
+
>
|
|
56
|
+
{isLoadContent && spiner}
|
|
57
|
+
|
|
58
|
+
{!doLoad && "develop error: no doLoad"}
|
|
59
|
+
|
|
60
|
+
{Boolean(doLoad) && Boolean(value) && (
|
|
61
|
+
<LoadedContent
|
|
62
|
+
RC={RC}
|
|
63
|
+
value={value}
|
|
64
|
+
onDelete={() => onChange(null)}
|
|
65
|
+
icon={downloadIcon}
|
|
66
|
+
isIconAfter={isIconAfter}
|
|
67
|
+
deleteIcon={deleteIcon}
|
|
68
|
+
isUseLinkTitle={isUseLinkTitle}
|
|
69
|
+
isLinkTypeDownload={isLinkTypeDownload}
|
|
70
|
+
/>
|
|
71
|
+
)}
|
|
72
|
+
|
|
73
|
+
{Boolean(doLoad) && !value && (
|
|
74
|
+
<LoadZone
|
|
75
|
+
RC={RC}
|
|
76
|
+
fieldKey={fieldKey}
|
|
77
|
+
onChange={onChange}
|
|
78
|
+
icon={uploadIcon}
|
|
79
|
+
doLoad={doLoad}
|
|
80
|
+
dragenter={dragenter}
|
|
81
|
+
setDragenter={setDragenter}
|
|
82
|
+
setIsLoadContent={setIsLoadContent}
|
|
83
|
+
placeholder={placeholder}
|
|
84
|
+
filterFiles={filterFiles}
|
|
85
|
+
processErrors={processErrors}
|
|
86
|
+
isBlockNullValues={isBlockNullValues}
|
|
87
|
+
attributesOfNativeInput={attributesOfNativeInput}
|
|
88
|
+
/>
|
|
89
|
+
)}
|
|
90
|
+
</div>
|
|
91
|
+
);
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export default FileLoader;
|
|
@@ -1 +1,105 @@
|
|
|
1
|
-
|
|
1
|
+
import React, { useEffect } from "react";
|
|
2
|
+
|
|
3
|
+
import cn from "classnames";
|
|
4
|
+
|
|
5
|
+
import "../FileLoader.scss";
|
|
6
|
+
|
|
7
|
+
const DEFAULT_MAX_FILE_SIZE = 1024 * 1024; //1Мб
|
|
8
|
+
const FILTER_FILES_DEFAULT = (file) =>
|
|
9
|
+
file.size <= DEFAULT_MAX_FILE_SIZE ? file : null;
|
|
10
|
+
|
|
11
|
+
const LoadZone = ({
|
|
12
|
+
RC,
|
|
13
|
+
fieldKey,
|
|
14
|
+
onChange,
|
|
15
|
+
doLoad,
|
|
16
|
+
setDragenter,
|
|
17
|
+
setIsLoadContent,
|
|
18
|
+
icon,
|
|
19
|
+
placeholder = "",
|
|
20
|
+
filterFiles = FILTER_FILES_DEFAULT,
|
|
21
|
+
processErrors,
|
|
22
|
+
isBlockNullValues,
|
|
23
|
+
attributesOfNativeInput = {},
|
|
24
|
+
}) => {
|
|
25
|
+
const dropZoneId = `dropZone-${fieldKey}`;
|
|
26
|
+
|
|
27
|
+
const handle = {
|
|
28
|
+
change: async (e) => {
|
|
29
|
+
setIsLoadContent?.(true);
|
|
30
|
+
const file =
|
|
31
|
+
e.type === "change" ? e.target.files[0] : e.dataTransfer.files[0];
|
|
32
|
+
const validatedFile = filterFiles ? await filterFiles(file) : file;
|
|
33
|
+
if (processErrors && !validatedFile) await processErrors(file);
|
|
34
|
+
if (!isBlockNullValues || validatedFile) {
|
|
35
|
+
onChange(await doLoad(validatedFile).catch(() => null));
|
|
36
|
+
}
|
|
37
|
+
setIsLoadContent?.(false);
|
|
38
|
+
},
|
|
39
|
+
dragover: (e) => {
|
|
40
|
+
e.stopPropagation();
|
|
41
|
+
e.preventDefault();
|
|
42
|
+
return false;
|
|
43
|
+
},
|
|
44
|
+
dragenter: (e) => {
|
|
45
|
+
e.stopPropagation();
|
|
46
|
+
e.preventDefault();
|
|
47
|
+
setDragenter(true);
|
|
48
|
+
return false;
|
|
49
|
+
},
|
|
50
|
+
dragleave: (e) => {
|
|
51
|
+
e.stopPropagation();
|
|
52
|
+
e.preventDefault();
|
|
53
|
+
setDragenter(false);
|
|
54
|
+
return false;
|
|
55
|
+
},
|
|
56
|
+
drop: (e) => {
|
|
57
|
+
e.stopPropagation();
|
|
58
|
+
e.preventDefault();
|
|
59
|
+
setDragenter(false);
|
|
60
|
+
handle.change(e);
|
|
61
|
+
return false;
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
const dropbox = document.getElementById(dropZoneId);
|
|
67
|
+
dropbox?.addEventListener("dragenter", handle.dragenter, false);
|
|
68
|
+
dropbox?.addEventListener("dragover", handle.dragover, false);
|
|
69
|
+
dropbox?.addEventListener("dragleave", handle.dragleave, false);
|
|
70
|
+
dropbox?.addEventListener("drop", handle.drop, false);
|
|
71
|
+
dropbox?.addEventListener("dragend", handle.dragleave, false);
|
|
72
|
+
|
|
73
|
+
return () => {
|
|
74
|
+
dropbox?.removeEventListener("dragenter", handle.dragenter, false);
|
|
75
|
+
dropbox?.removeEventListener("dragover", handle.dragover, false);
|
|
76
|
+
dropbox?.removeEventListener("dragleave", handle.dragleave, false);
|
|
77
|
+
dropbox?.removeEventListener("drop", handle.drop, false);
|
|
78
|
+
dropbox?.removeEventListener("dragend", handle.dragleave, false);
|
|
79
|
+
};
|
|
80
|
+
}, [fieldKey, doLoad]);
|
|
81
|
+
|
|
82
|
+
return (
|
|
83
|
+
<>
|
|
84
|
+
{icon && <div className={cn(`${RC}__icon-block`)}>{icon}</div>}
|
|
85
|
+
<label
|
|
86
|
+
id={dropZoneId}
|
|
87
|
+
className={cn(`${RC}__input-label`, {
|
|
88
|
+
[`${RC}__input-label_no-icon`]: !icon,
|
|
89
|
+
})}
|
|
90
|
+
htmlFor={fieldKey}
|
|
91
|
+
>
|
|
92
|
+
{placeholder}
|
|
93
|
+
<input
|
|
94
|
+
id={fieldKey}
|
|
95
|
+
className={cn(`${RC}__input`)}
|
|
96
|
+
type="file"
|
|
97
|
+
onChange={handle.change}
|
|
98
|
+
{...attributesOfNativeInput}
|
|
99
|
+
/>
|
|
100
|
+
</label>
|
|
101
|
+
</>
|
|
102
|
+
);
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export default LoadZone;
|