intelicoreact 1.8.63 → 1.8.64
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/Dropdown/Dropdown.js +1 -1
- package/package.json +1 -1
- package/dist/Atomic/FormElements/Datepicker/Datepicker.d.ts +0 -5
- package/dist/Atomic/FormElements/Dropdown/Dropdown.d.ts +0 -6
- package/dist/Atomic/FormElements/Dropdown/index.d.ts +0 -4
- package/dist/Atomic/FormElements/Dropdown/useDropdown.d.ts +0 -3
- package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.d.ts +0 -5
- package/dist/Atomic/FormElements/InputDateRange/InputDateRange.d.ts +0 -5
- package/dist/Atomic/FormElements/InputDateRange/InputDateRange.interface.d.ts +0 -144
- package/dist/Atomic/FormElements/InputDateRange/components/DateInput.d.ts +0 -7
- package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.d.ts +0 -4
- package/dist/Atomic/FormElements/InputDateRange/components/OpenedPart.d.ts +0 -4
- package/dist/Atomic/FormElements/InputDateRange/components/SelectItem.d.ts +0 -4
- package/dist/Atomic/FormElements/InputDateRange/dependencies.d.ts +0 -18
- package/dist/Atomic/FormElements/RangeSlider/RangeSlider.d.ts +0 -19
- package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.d.ts +0 -5
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.d.ts +0 -5
- package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.d.ts +0 -3
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.d.ts +0 -5
- package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.d.ts +0 -2
- package/dist/Atomic/UI/ExampleChartIntegration/partial/utils.d.ts +0 -4
- package/dist/Atomic/UI/Modal/Modal.d.ts +0 -20
- package/dist/Atomic/UI/Modal/index.d.ts +0 -9
- package/dist/Atomic/UI/Modal/partials/useMobileModal.d.ts +0 -31
- package/dist/Atomic/UI/Table/Partials/TdCell.d.ts +0 -13
- package/dist/Atomic/UI/Table/Partials/TdRow.d.ts +0 -17
- package/dist/Atomic/UI/Table/Partials/TdTitle.d.ts +0 -5
- package/dist/Atomic/UI/Table/Table.d.ts +0 -9
- package/dist/Atomic/UI/Table/TdTypes/TdWeight.d.ts +0 -7
- package/dist/Functions/useIsMobile/index.d.ts +0 -2
- package/dist/Functions/useIsMobile/useIsMobile.d.ts +0 -18
- package/dist/Functions/useIsMobile/useIsMobile.js.map +0 -1
- package/dist/Molecular/InputAddress/InputAddress.d.ts +0 -5
- package/dist/Molecular/InputCustomFetch/InputCustomFetch.d.ts +0 -4
- package/dist/Molecular/InputCustomFetch/index.d.ts +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,l=Array(n);t<n;t++)l[t]=e[t];return l}function n(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function t(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}Object.defineProperty(exports,"__esModule",{value:!0});var l=exports,o={MIN_ITEMS_FOR_SHOW_MOBILE_SEARCH:function(){return w},default:function(){return b}};for(var r in o)Object.defineProperty(l,r,{enumerable:!0,get:o[r]});var i=require("react/jsx-runtime"),u=h(require("classnames")),c=function(e,n){if(e&&e.__esModule)return e;if(null===e||(void 0===e?"undefined":t(e))!=="object"&&"function"!=typeof e)return{default:e};var l=g(n);if(l&&l.has(e))return l.get(e);var o={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var u=r?Object.getOwnPropertyDescriptor(e,i):null;u&&(u.get||u.set)?Object.defineProperty(o,i,u):o[i]=e[i]}return o.default=e,l&&l.set(e,o),o}(require("react")),a=require("react-dom"),s=require("react-feather"),d=require("../../../Functions/fieldValueFormatters"),v=h(require("../Input/Input")),f=h(require("../RadioInput/RadioInput")),p=h(require("./components/DropdownLoader")),m=h(require("./useDropdown"));function h(e){return e&&e.__esModule?e:{default:e}}function g(e){if("function"!=typeof WeakMap)return null;var n=new WeakMap,t=new WeakMap;return(g=function(e){return e?t:n})(e)}require("./Dropdown.scss");var _="dropdown",w=10,b=function(l){var o,r,h,g,b,y,j,x,C,L,O=l.label,S=l.options,E=l.value,N=l.error,I=l.disabled,k=l.onChange,M=l.placeholder,H=l.className,P=l.isSearchable,A=l.entity,R=l.scrollReactionObj,T=l.isListTop,D=l.isNotValidateASCII,B=void 0!==D&&D,F=l.testId,q=void 0===F?"dropdown":F,W=l.sortAlphabetical,K=l.fieldKey,V=l.id,U=l.noOptionsText,z=void 0===U?"No options available":U,X=l.isDoNotPullOutListOfMainContainer,G=l.withMobileLogic,$=l.withActions,J=l.minItemsForShowMobileSearch,Q=l.customTrigger,Y=l.tabIndex,Z=l.onActionConfirmClick,ee=l.onActionCancelClick,en=l.isDefaultOpened,et=l.isDefaultOpenedMobile,el=l.footerContent,eo=l.closeOnSelect,er=void 0===eo||eo,ei=l.closeOnSelectMobile,eu=void 0===ei||ei,ec=l.withApplyLogic,ea=void 0!==ec&&ec,es=l.cancelButtonRef,ed=l.applyButtonRef,ev=(0,m.default)({id:V,fieldKey:K,value:E,sortAlphabetical:void 0===W||W,withMobileLogic:G,options:S,isSearchable:P,minItemsForShowMobileSearch:void 0===J?w:J,isDoNotPullOutListOfMainContainer:X}),ef=ev.dropdownId,ep=ev.isMobile,em=ev.isOpen,eh=ev.setIsOpen,eg=ev.searchValue,e_=ev.setSearchValue,ew=ev.initListHeight,eb=ev.setInitListHeight,ey=ev.isSearchChanged,ej=ev.setIsSearchChanged,ex=ev.isSearchInputFocused,eC=ev.setIsSearchInputFocused,eL=ev.isScrollableList,eO=ev.setIsScrollableList,eS=ev.isFixedMaxHeight,eE=ev.setIsFixedMaxHeight,eN=ev.scrollTop,eI=ev.setScrollTop,ek=ev.scrollHeight,eM=ev.setScrollHeight,eH=ev.maxListContainerHeight,eP=ev.setMaxListContainerHeight,eA=ev.getListContainer,eR=ev.getListContainerWrapper,eT=ev.getParentNode,eD=ev.getPreparedOptionLabel,eB=ev.getSortedOptions,eF=ev.filteredGroups,eq=ev.filteredItems,eW=ev.filteredOptions,eK=ev.selectedLabel,eV=ev.postfixText,eU=ev.dropdownRef,ez=ev.dropdownListRef,eX=ev.dropdownListWrapperRef,eG=ev.dropdownFooterRef,e$=ev.searchInputRef,eJ=ev.wrapperRef,eQ=ev.isSearchable,eY=ev.valueToApply,eZ=ev.valueToApplyRef,e0=ev.setValueToApply,e1=function(){eh(!1),null==e0||e0(null),null==ee||ee()},e3=function(){(null==eZ?void 0:eZ.current)!==null&&(null==eZ?void 0:eZ.current)!==void 0&&(null==k||k(eZ.current),setTimeout(function(){return null==Z?void 0:Z()},1)),null==e1||e1()},e2=function(e){(ep?eu:er)&&e1(),ea&&(null==ed?void 0:ed.current)?null==e0||e0(e.value):null==k||k(e.value)},e6=function(e){return!![9,13].includes(e.keyCode)&&(e1(),!0)},e8=function(e){return!![9,13].includes(e.keyCode)&&(eh(!0),!0)},e9=function(e){var n=e;B||(n=(0,d.formatToOnlyASCIICodeText)(n)),ej(!0),e_(n)},e4=function(e){e.target===(null==eJ?void 0:eJ.current)&&(e.stopPropagation(),e.preventDefault(),e1())},e5=function(e){e9(e)},e7=function(e){var n;(null==(n=eA())?void 0:n.contains(null==e?void 0:e.target))||(null==eU?void 0:eU.current)===null||(null==eU?void 0:eU.current.contains(null==e?void 0:e.target))||e1()},ne=(0,c.useCallback)(function(e){var n=R||{},t=n.callback,l=n.isWithAnyScrolling,o=n.scrollingInaccuracy,r=null==e?void 0:e.target;t&&"function"==typeof t&&(l?t(e):Math.round(r.clientHeight+r.scrollTop+(void 0===o?0:o))>=r.scrollHeight&&t(e))},[eW]),nn=function(){var e=document.createElement("div");e.setAttribute("id",ef),e.classList.add("dropdown__container"),ep&&e.addEventListener("click",function(e){(null==e?void 0:e.target).id===ef&&e1()});try{null==(n=eA())||n.remove()}finally{if(ep){try{null==(o=document.getElementById("mlw-".concat(ef)))||o.remove()}catch(e){}var n,t,l,o,r=document.createElement("div");r.classList.add("dropdown-mobile"),r.setAttribute("id","mlw-".concat(ef)),null==r||r.append(e),null==(l=eT())||l.append(r)}else null==(t=eT())||t.append(e)}},nt=function(){var e,n,t,l,o,r,i,u,c,a,s,d,v,f,p,m,h,g,_,w=eA();if(!w||!em)return!1;var b=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,y=null!=(p=null==eU||null==(e=eU.current)?void 0:e.getBoundingClientRect())?p:{},j=y.width,x=y.height,C=void 0===x?0:x,L=y.left,O=y.top,S=void 0===O?0:O,E=w.getElementsByClassName("dropdown__list")[0],N=null==eX||null==(n=eX.current)?void 0:n.getElementsByClassName("dropdown__list-header")[0],I=Number.parseInt(null!=(m=null==(l=getComputedStyle(null==eX?void 0:eX.current))||null==(t=l.marginTop)?void 0:t.replace("px",""))?m:"0",10),k=null!=ew?ew:Number.parseInt(null!=(h=null==(r=getComputedStyle(E))||null==(o=r.maxHeight)?void 0:o.replace("px",""))?h:"0",10);null===ew&&eb(k);var M=S-I,H=b-S-C-2*I,P=null==E||null==(i=E.getBoundingClientRect())?void 0:i.height,A=(ep?(null==eX||null==(c=eX.current)||null==(u=c.getBoundingClientRect())?void 0:u.height)-(null==N||null==(a=N.getBoundingClientRect())?void 0:a.height):M>=k||H>=k?k-3*I:M>H?M-3*I:H-4*I)-(null!=(g=null==eG||null==(d=eG.current)||null==(s=d.getBoundingClientRect())?void 0:s.height)?g:0);return w.style.minWidth="".concat(j,"px"),w.style.left="".concat(L,"px"),w.style.top="".concat("bottom"==(M<H||H>=P?"bottom":"top")?S+C:S-3*I-Number.parseInt(null!=(_=null==(f=getComputedStyle(null==eX?void 0:eX.current))||null==(v=f.height)?void 0:v.replace("px",""))?_:"0",10),"px"),eH===A||ep||eP(A),E.style.maxHeight="".concat(A,"px"),!0},nl=em?e7:function(){},no=function(n){var t,l=function(e){"open_modal"===e.value?null==k||k("open_modal"):e2(e)},o=[{label:"New ".concat(A),value:"open_modal",className:"dropdown__list-item--modal"}].concat(function(n){if(Array.isArray(n))return e(n)}(t=null!=eW?eW:[])||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(n,t){if(n){if("string"==typeof n)return e(n,void 0);var l=Object.prototype.toString.call(n).slice(8,-1);if("Object"===l&&n.constructor&&(l=n.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(n,t)}}(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());return{onChange:function(e){return n?l(e):e2(e)},options:n?o:S}},nr=(0,c.useMemo)(function(){return A&&""!==A&&"string"==typeof A},[A]),ni=(0,c.useMemo)(function(){return no(nr)},[nr,eW]),nu=function(e,t,l){var o,r,c,a;return(0,i.jsxs)("button",{type:"button","data-testid":"".concat(q,"-").concat(l,"-option"),onMouseDown:function(){return ni.onChange(e)},className:(0,u.default)("".concat(_,"__list-item"),(n(a={},"".concat(_,"__list-item_active"),e.value===(null!=eY?eY:E)),n(a,"".concat(_,"__list-item_disabled"),e.disabled),a),e.className),value:null==e?void 0:e.value,children:[!ep&&(0,i.jsx)("span",{className:(0,u.default)("".concat(_,"__active-icon"),n({},"".concat(_,"__active-icon_active"),e.value===E)),children:(0,i.jsx)(s.Check,{})}),(0,i.jsx)("div",{className:(0,u.default)("".concat(_,"__list-item-label"),e.labelClassName||""),dangerouslySetInnerHTML:{__html:eD(e.label,e.postfix,e.description)}}),(null==e?void 0:e.icon)||"",ep?null!=(c=null==e?void 0:e.customMobileIcon)?c:(0,i.jsx)(f.default,{value:e.value,checked:null!=eY?eY:E}):""]},null==(r=e.value)||null==(o=r.toString())?void 0:o.replace(/ /g,"_"))},nc=function(e){var n,t,l,o,r,c;return(null!=(c=null==(n=e.items)?void 0:n.length)?c:0)>0?(0,i.jsxs)("div",{className:(0,u.default)("".concat(_,"-group"),e.className),children:[(0,i.jsx)("div",{className:"".concat(_,"-group__name"),children:e.label}),null==(t=e.items)?void 0:t.map(function(e,n){var t;return nu(e,n,null==(t=(null==e?void 0:e.testId)||n)?void 0:t.toString())})]},null==(r=e.label)||null==(o=r.toString())?void 0:o.replace(/ /g,"_").concat(null==(l=Date.now())?void 0:l.toString())):null};if((0,c.useEffect)(function(){return document.addEventListener("click",e7,!0),function(){var e,n;null==(e=eA())||e.remove(),null==(n=eR())||n.remove(),document.removeEventListener("click",e7,!0)}},[]),(0,c.useEffect)(function(){(!X||eU.current)&&(nn(),(en&&!ep||et)&&eh(!0))},[X,eU.current]),(0,c.useLayoutEffect)(function(){var e;return ep?(window.removeEventListener("resize",nt),window.removeEventListener("mousewheel",nl),window.removeEventListener("scroll",nl),window.removeEventListener("touchmove",nl)):(window.addEventListener("resize",nt),window.addEventListener("mousewheel",nl),window.addEventListener("scroll",nl),window.addEventListener("touchmove",nl)),null==(e=eA())||e.addEventListener("click",nl),function(){var e;window.removeEventListener("resize",nt),window.removeEventListener("mousewheel",nl),window.removeEventListener("scroll",nl),window.removeEventListener("touchmove",nl),null==(e=eA())||e.removeEventListener("click",nl)}},[eA]),(0,c.useLayoutEffect)(function(){nt()},[eH,em,eg,ep,eS,S]),(0,c.useEffect)(function(){var e,n,l=em?"addEventListener":"removeEventListener";return null==es||null==(e=es.current)||e[l]("click",e1,!0),null==ed||null==(n=ed.current)||n[l]("click",e3,!0),!em&&(ej(!1),ep||eP(0)),R&&(void 0===R?"undefined":t(R))==="object"&&em&&ez&&ez.current&&ez.current.addEventListener("scroll",ne),function(){R&&(void 0===R?"undefined":t(R))==="object"&&removeEventListener("scroll",ne)}},[em,ez]),(0,c.useEffect)(function(){var e;return eg||!ex||ep||(e_(eK),e=setTimeout(function(){return e$.current.select()},1)),ex||em||e_(null),function(){clearTimeout(e)}},[ex]),(0,c.useEffect)(function(){if(em&&!ex&&(null==e$?void 0:e$.current)&&!ep&&(null==(e=e$.current)||e.focus()),em?null==(n=eA())||n.classList.add("dropdown__container--opened"):(null==(t=e$.current)||t.blur(),null==(l=eA())||l.classList.remove("dropdown__container--opened")),em&&ep){var e,n,t,l,o,r,i,u,c=null==ez||null==(o=ez.current)?void 0:o.querySelector("button[value='".concat(null!=eY?eY:E,"']"));c&&(null==ez||null==(u=ez.current)||u.scrollTo(0,(null==c||null==(r=c.getBoundingClientRect())?void 0:r.y)-(null==ez||null==(i=ez.current)?void 0:i.getBoundingClientRect().y)-16))}!em&&ep&&e_(null)},[em]),(0,c.useEffect)(function(){if(em&&ep&&(null==ez?void 0:ez.current)&&!eg){var e,n,t,l;eO((null==ez||null==(e=ez.current)?void 0:e.scrollHeight)>(null==ez||null==(n=ez.current)?void 0:n.clientHeight)),eE(eL||(null==ez||null==(t=ez.current)?void 0:t.scrollHeight)>(null==ez||null==(l=ez.current)?void 0:l.clientHeight))}},[em,ep,eL,null==ez?void 0:ez.current,null==ez||null==(j=ez.current)?void 0:j.scrollHeight,null==ez||null==(x=ez.current)?void 0:x.clientHeight]),(0,c.useEffect)(function(){var e,n=function(e){var n,t;eI(Number.parseInt(null==e||null==(t=e.target)||null==(n=t.scrollTop)?void 0:n.toString(),10))};return em&&ep&&(null==ez?void 0:ez.current)&&(null==ez||null==(e=ez.current)||e.addEventListener("scroll",n)),function(){if((null==ez?void 0:ez.current)!==null){var e;null==ez||null==(e=ez.current)||e.removeEventListener("scroll",n)}}},[em,ep,null==ez?void 0:ez.current]),(0,c.useEffect)(function(){if(null==ez?void 0:ez.current){var e,n;eM(Number.parseInt(((null==ez||null==(e=ez.current)?void 0:e.scrollHeight)-(null==ez||null==(n=ez.current)?void 0:n.clientHeight)).toString(),10))}},[eN,null==ez?void 0:ez.current]),!S)return null;return(0,i.jsxs)("div",{className:(0,u.default)(_,H,(n(C={disabled:I},"".concat(_,"-mobile"),ep),n(C,"".concat(_,"--focused"),em&&!ep),n(C,"".concat(_,"--with-custom-trigger"),!!Q),C)),ref:eU,onKeyDown:e6,onKeyUp:e8,children:[(0,i.jsx)("button",{type:"button","data-testid":q,className:(0,u.default)("".concat(_,"__trigger"),"input__wrap",(n(L={},"".concat(_,"__trigger--with-actions"),$),n(L,"placeholder",null==E||""===E),n(L,"error",N),L)),onClick:function(){return eh(!0)},onKeyDown:e6,onKeyUp:e8,tabIndex:Y,children:Q||(0,i.jsxs)(i.Fragment,{children:[eQ&&!ep?(0,i.jsx)("input",{ref:e$,className:"".concat(_,"__input"),value:String(em?null!=eg?eg:"":null!=eK?eK:""),onChange:function(e){return e5(e.target.value)},placeholder:M,onFocus:function(){return eC(!0)},onBlur:function(){return eC(!1)}}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:"text",children:eK||M||""}),eV&&(0,i.jsx)("span",{className:"dropdown__list-item-postfix",children:eV})]}),(0,i.jsx)("span",{className:(0,u.default)("".concat(_,"__arrow"),n({},"".concat(_,"__arrow_active"),em)),onClick:function(e){null==e||e.stopPropagation(),eh(function(e){return!e})},children:ep?(0,i.jsx)(s.Code,{className:"mobile-icon"}):em?(0,i.jsx)(s.ChevronUp,{}):(0,i.jsx)(s.ChevronDown,{})})]})}),$&&(0,i.jsxs)("div",{className:(0,u.default)("".concat(_,"__actions")),children:[(0,i.jsx)("div",{className:(0,u.default)("".concat(_,"__actions-item")),onClick:Z,children:(0,i.jsx)(s.Check,{})}),(0,i.jsx)("div",{className:(0,u.default)("".concat(_,"__actions-item")),onClick:ee,children:(0,i.jsx)(s.X,{})})]}),em&&((y=eA())?(0,a.createPortal)((0,i.jsx)("div",{"data-testid":"".concat(q,"-container-wrapper"),className:(0,u.default)("".concat(_,"__container-wrapper")),ref:eJ,onClick:ep?e4:function(){},children:(0,i.jsxs)("div",{className:(0,u.default)("".concat(_,"__list-wrapper"),(n(r={},"".concat(_,"__list-wrapper--fixed-height"),eS),n(r,"".concat(_,"__list-wrapper--with-bottom-shadow"),eL&&ep&&!el),n(r,"".concat(_,"__list-wrapper--with-bottom-shadow-hidden"),eN===ek&&!el),r)),ref:eX,children:[ep&&(0,i.jsxs)("div",{className:(0,u.default)("".concat(_,"__list-header"),(n(h={},"".concat(_,"__list-header-with-shadow"),eL&&ep),n(h,"".concat(_,"__list-header-with-shadow-hidden"),0===eN),h)),children:[(0,i.jsxs)("div",{className:(0,u.default)("".concat(_,"__list-header-row")),children:[(0,i.jsx)("div",{className:(0,u.default)("".concat(_,"__list-label")),children:O}),(0,i.jsx)("div",{className:(0,u.default)("".concat(_,"__list-close-icon")),onClick:e1,children:(0,i.jsx)(s.X,{onClick:e1})})]}),eQ&&(0,i.jsx)("div",{className:(0,u.default)("".concat(_,"__list-header-row")),children:(0,i.jsx)(v.default,{ref:e$,className:"".concat(_,"__input"),value:eg||"",onChange:e5,placeholder:M||"Search",withDelete:!0,onFocus:function(){return eC(!0)},onBlur:function(){return eC(!1)}})})]}),(0,i.jsxs)("div",{className:(0,u.default)("".concat(_,"__list"),(n(g={},"".concat(_,"__list-top"),T),n(g,"".concat(_,"__list--with-footer"),el),g)),ref:ez,children:[ni.options&&(null==(o=eB(ni.options))?void 0:o.map(function(e,t){if(null==e||null==(i=e.items)?void 0:i.length)if(!eQ||!ey)return nc(e);else{var l,o,r,i,u,c,a=null==(c=e.items)?void 0:c.slice().filter(function(e){var n;return(null==e||null==(n=e.label)?void 0:n.toLowerCase().includes((null==eg?void 0:eg.toLowerCase())||""))||!(null==e?void 0:e.value)||(null==e?void 0:e.value)===""});if(null==a?void 0:a.length)return nc((l=function(e){for(var t=1;t<arguments.length;t++){var l=null!=arguments[t]?arguments[t]:{},o=Object.keys(l);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(l).filter(function(e){return Object.getOwnPropertyDescriptor(l,e).enumerable}))),o.forEach(function(t){n(e,t,l[t])})}return e}({},e),o=o={items:a},Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(o)):(function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t.push.apply(t,l)}return t})(Object(o)).forEach(function(e){Object.defineProperty(l,e,Object.getOwnPropertyDescriptor(o,e))}),l))}else if(!eQ||!ey||(null==e||null==(u=e.label)?void 0:u.toLowerCase().includes((null==eg?void 0:eg.toLowerCase())||""))||!(null==e?void 0:e.value)||(null==e?void 0:e.value)==="")return nu(e,t,null==(r=(null==e?void 0:e.testId)||t)?void 0:r.toString());return null})),!(null==eq?void 0:eq.length)&&!(null==eF?void 0:eF.length)&&(0,i.jsx)("div",{className:"".concat(_,"__list-item ").concat(_,"__list-item--no-options"),children:z}),I&&em&&(0,i.jsx)(p.default,{})]}),el&&(0,i.jsx)("div",{ref:eG,className:(0,u.default)("".concat(_,"__footer"),(n(b={},"".concat(_,"__footer-with-shadow"),ep&&eL),n(b,"".concat(_,"__footer-with-shadow-hidden"),eN===ek),b)),children:el})]})}),y):null)]})};
|
|
1
|
+
function e(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,l=Array(n);t<n;t++)l[t]=e[t];return l}function n(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function t(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}Object.defineProperty(exports,"__esModule",{value:!0});var l=exports,o={MIN_ITEMS_FOR_SHOW_MOBILE_SEARCH:function(){return w},default:function(){return b}};for(var r in o)Object.defineProperty(l,r,{enumerable:!0,get:o[r]});var i=require("react/jsx-runtime"),u=h(require("classnames")),c=function(e,n){if(e&&e.__esModule)return e;if(null===e||(void 0===e?"undefined":t(e))!=="object"&&"function"!=typeof e)return{default:e};var l=g(n);if(l&&l.has(e))return l.get(e);var o={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var u=r?Object.getOwnPropertyDescriptor(e,i):null;u&&(u.get||u.set)?Object.defineProperty(o,i,u):o[i]=e[i]}return o.default=e,l&&l.set(e,o),o}(require("react")),a=require("react-dom"),s=require("react-feather"),d=require("../../../Functions/fieldValueFormatters"),v=h(require("../Input/Input")),f=h(require("../RadioInput/RadioInput")),p=h(require("./components/DropdownLoader")),m=h(require("./useDropdown"));function h(e){return e&&e.__esModule?e:{default:e}}function g(e){if("function"!=typeof WeakMap)return null;var n=new WeakMap,t=new WeakMap;return(g=function(e){return e?t:n})(e)}require("./Dropdown.scss");var _="dropdown",w=10,b=function(l){var o,r,h,g,b,y,j,x,L,C,O=l.label,E=l.options,S=l.value,N=l.error,I=l.disabled,k=l.onChange,H=l.placeholder,M=l.className,P=l.isSearchable,A=l.entity,T=l.scrollReactionObj,D=l.isListTop,R=l.isNotValidateASCII,B=void 0!==R&&R,F=l.testId,q=void 0===F?"dropdown":F,W=l.sortAlphabetical,K=l.fieldKey,V=l.id,U=l.noOptionsText,z=void 0===U?"No options available":U,X=l.isDoNotPullOutListOfMainContainer,Y=l.withMobileLogic,G=l.withActions,$=l.minItemsForShowMobileSearch,J=l.customTrigger,Q=l.tabIndex,Z=l.onActionConfirmClick,ee=l.onActionCancelClick,en=l.isDefaultOpened,et=l.isDefaultOpenedMobile,el=l.footerContent,eo=l.closeOnSelect,er=void 0===eo||eo,ei=l.closeOnSelectMobile,eu=void 0===ei||ei,ec=l.withApplyLogic,ea=void 0!==ec&&ec,es=l.cancelButtonRef,ed=l.applyButtonRef,ev=(0,m.default)({id:V,fieldKey:K,value:S,sortAlphabetical:void 0===W||W,withMobileLogic:Y,options:E,isSearchable:P,minItemsForShowMobileSearch:void 0===$?w:$,isDoNotPullOutListOfMainContainer:X}),ef=ev.dropdownId,ep=ev.isMobile,em=ev.isOpen,eh=ev.setIsOpen,eg=ev.searchValue,e_=ev.setSearchValue,ew=ev.initListHeight,eb=ev.setInitListHeight,ey=ev.isSearchChanged,ej=ev.setIsSearchChanged,ex=ev.isSearchInputFocused,eL=ev.setIsSearchInputFocused,eC=ev.isScrollableList,eO=ev.setIsScrollableList,eE=ev.isFixedMaxHeight,eS=ev.setIsFixedMaxHeight,eN=ev.scrollTop,eI=ev.setScrollTop,ek=ev.scrollHeight,eH=ev.setScrollHeight,eM=ev.maxListContainerHeight,eP=ev.setMaxListContainerHeight,eA=ev.getListContainer,eT=ev.getListContainerWrapper,eD=ev.getParentNode,eR=ev.getPreparedOptionLabel,eB=ev.getSortedOptions,eF=ev.filteredGroups,eq=ev.filteredItems,eW=ev.filteredOptions,eK=ev.selectedLabel,eV=ev.postfixText,eU=ev.dropdownRef,ez=ev.dropdownListRef,eX=ev.dropdownListWrapperRef,eY=ev.dropdownFooterRef,eG=ev.searchInputRef,e$=ev.wrapperRef,eJ=ev.isSearchable,eQ=ev.valueToApply,eZ=ev.valueToApplyRef,e0=ev.setValueToApply,e1=function(){eh(!1),null==e0||e0(null),null==ee||ee()},e3=function(){(null==eZ?void 0:eZ.current)!==null&&(null==eZ?void 0:eZ.current)!==void 0&&(null==k||k(eZ.current),setTimeout(function(){return null==Z?void 0:Z()},1)),null==e1||e1()},e2=function(e){(ep?eu:er)&&e1(),ea&&(null==ed?void 0:ed.current)?null==e0||e0(e.value):null==k||k(e.value)},e6=function(e){return!![9,13].includes(e.keyCode)&&(e1(),!0)},e8=function(e){return!![9,13].includes(e.keyCode)&&(eh(!0),!0)},e9=function(e){var n=e;B||(n=(0,d.formatToOnlyASCIICodeText)(n)),ej(!0),e_(n)},e4=function(e){e.target===(null==e$?void 0:e$.current)&&(e.stopPropagation(),e.preventDefault(),e1())},e5=function(e){e9(e)},e7=function(e){var n;(null==(n=eA())?void 0:n.contains(null==e?void 0:e.target))||(null==eU?void 0:eU.current)===null||(null==eU?void 0:eU.current.contains(null==e?void 0:e.target))||e1()},ne=(0,c.useCallback)(function(e){var n=T||{},t=n.callback,l=n.isWithAnyScrolling,o=n.scrollingInaccuracy,r=null==e?void 0:e.target;t&&"function"==typeof t&&(l?t(e):Math.round(r.clientHeight+r.scrollTop+(void 0===o?0:o))>=r.scrollHeight&&t(e))},[eW]),nn=function(){var e=document.createElement("div");e.setAttribute("id",ef),e.classList.add("dropdown__container"),ep&&e.addEventListener("click",function(e){(null==e?void 0:e.target).id===ef&&e1()});try{null==(n=eA())||n.remove()}finally{if(ep){try{null==(o=document.getElementById("mlw-".concat(ef)))||o.remove()}catch(e){}var n,t,l,o,r=document.createElement("div");r.classList.add("dropdown-mobile"),r.setAttribute("id","mlw-".concat(ef)),null==r||r.append(e),null==(l=eD())||l.append(r)}else null==(t=eD())||t.append(e)}},nt=function(){var e,n,t,l,o,r,i,u,c,a,s,d,v,f,p,m,h,g,_,w=eA();if(!w||!em)return!1;var b=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,y=null!=(p=null==eU||null==(e=eU.current)?void 0:e.getBoundingClientRect())?p:{},j=y.width,x=y.height,L=void 0===x?0:x,C=y.left,O=y.top,E=void 0===O?0:O,S=w.getElementsByClassName("dropdown__list")[0],N=null==eX||null==(n=eX.current)?void 0:n.getElementsByClassName("dropdown__list-header")[0],I=Number.parseInt(null!=(m=null==(l=getComputedStyle(null==eX?void 0:eX.current))||null==(t=l.marginTop)?void 0:t.replace("px",""))?m:"0",10),k=null!=ew?ew:Number.parseInt(null!=(h=null==(r=getComputedStyle(S))||null==(o=r.maxHeight)?void 0:o.replace("px",""))?h:"0",10);null===ew&&eb(k);var H=E-I,M=b-E-L-2*I,P=null==S||null==(i=S.getBoundingClientRect())?void 0:i.height,A=(ep?(null==eX||null==(c=eX.current)||null==(u=c.getBoundingClientRect())?void 0:u.height)-(null==N||null==(a=N.getBoundingClientRect())?void 0:a.height):H>=k||M>=k?k-3*I:H>M?H-3*I:M-4*I)-(null!=(g=null==eY||null==(d=eY.current)||null==(s=d.getBoundingClientRect())?void 0:s.height)?g:0);return w.style.minWidth="".concat(j,"px"),w.style.left="".concat(C,"px"),w.style.top="".concat("bottom"==(H<M||M>=P?"bottom":"top")?E+L:E-3*I-Number.parseInt(null!=(_=null==(f=getComputedStyle(null==eX?void 0:eX.current))||null==(v=f.height)?void 0:v.replace("px",""))?_:"0",10),"px"),eM===A||ep||eP(A),S.style.maxHeight="".concat(A,"px"),!0},nl=em?e7:function(){},no=function(n){var t,l=function(e){"open_modal"===e.value?null==k||k("open_modal"):e2(e)},o=[{label:"New ".concat(A),value:"open_modal",className:"dropdown__list-item--modal"}].concat(function(n){if(Array.isArray(n))return e(n)}(t=null!=eW?eW:[])||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(n,t){if(n){if("string"==typeof n)return e(n,void 0);var l=Object.prototype.toString.call(n).slice(8,-1);if("Object"===l&&n.constructor&&(l=n.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(n,t)}}(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());return{onChange:function(e){return n?l(e):e2(e)},options:n?o:E}},nr=(0,c.useMemo)(function(){return A&&""!==A&&"string"==typeof A},[A]),ni=(0,c.useMemo)(function(){return no(nr)},[nr,eW]),nu=function(e,t,l){var o,r,c,a;return(0,i.jsxs)("button",{type:"button","data-testid":"".concat(q,"-").concat(l,"-option"),onMouseDown:function(){return ni.onChange(e)},className:(0,u.default)("".concat(_,"__list-item"),(n(a={},"".concat(_,"__list-item_active"),e.value===(null!=eQ?eQ:S)),n(a,"".concat(_,"__list-item_disabled"),e.disabled),a),e.className),value:null==e?void 0:e.value,children:[!ep&&(0,i.jsx)("span",{className:(0,u.default)("".concat(_,"__active-icon"),n({},"".concat(_,"__active-icon_active"),e.value===S)),children:(0,i.jsx)(s.Check,{})}),(0,i.jsx)("div",{className:(0,u.default)("".concat(_,"__list-item-label"),e.labelClassName||""),dangerouslySetInnerHTML:{__html:eR(e.label,e.postfix,e.description)}}),(null==e?void 0:e.icon)||"",ep?null!=(c=null==e?void 0:e.customMobileIcon)?c:(0,i.jsx)(f.default,{value:e.value,checked:null!=eQ?eQ:S}):""]},null==(r=e.value)||null==(o=r.toString())?void 0:o.replace(/ /g,"_"))},nc=function(e){var n,t,l,o,r,c;return(null!=(c=null==(n=e.items)?void 0:n.length)?c:0)>0?(0,i.jsxs)("div",{className:(0,u.default)("".concat(_,"-group"),e.className),children:[(0,i.jsx)("div",{className:"".concat(_,"-group__name"),children:e.label}),null==(t=e.items)?void 0:t.map(function(e,n){var t;return nu(e,n,null==(t=(null==e?void 0:e.testId)||n)?void 0:t.toString())})]},null==(r=e.label)||null==(o=r.toString())?void 0:o.replace(/ /g,"_").concat(null==(l=Date.now())?void 0:l.toString())):null};if((0,c.useEffect)(function(){return document.addEventListener("click",e7,!0),function(){var e,n;null==(e=eA())||e.remove(),null==(n=eT())||n.remove(),document.removeEventListener("click",e7,!0)}},[]),(0,c.useEffect)(function(){(!X||eU.current)&&(nn(),(en&&!ep||et)&&eh(!0))},[X,eU.current]),(0,c.useLayoutEffect)(function(){var e;return ep?(window.removeEventListener("resize",nt),window.removeEventListener("mousewheel",nl),window.removeEventListener("scroll",nl),window.removeEventListener("touchmove",nl)):(window.addEventListener("resize",nt),window.addEventListener("mousewheel",nl),window.addEventListener("scroll",nl),window.addEventListener("touchmove",nl)),null==(e=eA())||e.addEventListener("click",nl),function(){var e;window.removeEventListener("resize",nt),window.removeEventListener("mousewheel",nl),window.removeEventListener("scroll",nl),window.removeEventListener("touchmove",nl),null==(e=eA())||e.removeEventListener("click",nl)}},[eA]),(0,c.useLayoutEffect)(function(){nt()},[eM,em,eg,ep,eE,E]),(0,c.useEffect)(function(){var e,n,l=em?"addEventListener":"removeEventListener";return null==es||null==(e=es.current)||e[l]("click",e1,!0),null==ed||null==(n=ed.current)||n[l]("click",e3,!0),!em&&(ej(!1),ep||eP(0)),T&&(void 0===T?"undefined":t(T))==="object"&&em&&ez&&ez.current&&ez.current.addEventListener("scroll",ne),function(){T&&(void 0===T?"undefined":t(T))==="object"&&removeEventListener("scroll",ne)}},[em,ez]),(0,c.useEffect)(function(){var e;return eg||!ex||ep||(e_(eK),e=setTimeout(function(){return eG.current.select()},1)),ex||em||e_(null),function(){clearTimeout(e)}},[ex]),(0,c.useEffect)(function(){if(em&&!ex&&(null==eG?void 0:eG.current)&&!ep&&(null==(e=eG.current)||e.focus()),em?null==(n=eA())||n.classList.add("dropdown__container--opened"):(null==(t=eG.current)||t.blur(),null==(l=eA())||l.classList.remove("dropdown__container--opened")),em&&ep){var e,n,t,l,o,r,i,u,c=null==ez||null==(o=ez.current)?void 0:o.querySelector("button[value='".concat(null!=eQ?eQ:S,"']"));c&&(null==ez||null==(u=ez.current)||u.scrollTo(0,(null==c||null==(r=c.getBoundingClientRect())?void 0:r.y)-(null==ez||null==(i=ez.current)?void 0:i.getBoundingClientRect().y)-16))}!em&&ep&&e_(null)},[em]),(0,c.useEffect)(function(){if(!ep){var e,n=null==(e=eA())?void 0:e.getElementsByClassName("dropdown__list")[0],t=function(e){var t=n.scrollTop,l=n.scrollHeight,o=n.clientHeight,r=e.deltaY<0,i=e.deltaY>0;(r&&t<=0||i&&t+o>=l-1)&&e.preventDefault()};return em?null==n||n.addEventListener("wheel",t,{passive:!1}):null==n||n.removeEventListener("wheel",t),function(){null==n||n.removeEventListener("wheel",t)}}return function(){}},[em,ep]),(0,c.useEffect)(function(){if(em&&ep&&(null==ez?void 0:ez.current)&&!eg){var e,n,t,l;eO((null==ez||null==(e=ez.current)?void 0:e.scrollHeight)>(null==ez||null==(n=ez.current)?void 0:n.clientHeight)),eS(eC||(null==ez||null==(t=ez.current)?void 0:t.scrollHeight)>(null==ez||null==(l=ez.current)?void 0:l.clientHeight))}},[em,ep,eC,null==ez?void 0:ez.current,null==ez||null==(j=ez.current)?void 0:j.scrollHeight,null==ez||null==(x=ez.current)?void 0:x.clientHeight]),(0,c.useEffect)(function(){var e,n=function(e){var n,t;eI(Number.parseInt(null==e||null==(t=e.target)||null==(n=t.scrollTop)?void 0:n.toString(),10))};return em&&ep&&(null==ez?void 0:ez.current)&&(null==ez||null==(e=ez.current)||e.addEventListener("scroll",n)),function(){if((null==ez?void 0:ez.current)!==null){var e;null==ez||null==(e=ez.current)||e.removeEventListener("scroll",n)}}},[em,ep,null==ez?void 0:ez.current]),(0,c.useEffect)(function(){if(null==ez?void 0:ez.current){var e,n;eH(Number.parseInt(((null==ez||null==(e=ez.current)?void 0:e.scrollHeight)-(null==ez||null==(n=ez.current)?void 0:n.clientHeight)).toString(),10))}},[eN,null==ez?void 0:ez.current]),!E)return null;return(0,i.jsxs)("div",{className:(0,u.default)(_,M,(n(L={disabled:I},"".concat(_,"-mobile"),ep),n(L,"".concat(_,"--focused"),em&&!ep),n(L,"".concat(_,"--with-custom-trigger"),!!J),L)),ref:eU,onKeyDown:e6,onKeyUp:e8,children:[(0,i.jsx)("button",{type:"button","data-testid":q,className:(0,u.default)("".concat(_,"__trigger"),"input__wrap",(n(C={},"".concat(_,"__trigger--with-actions"),G),n(C,"placeholder",null==S||""===S),n(C,"error",N),C)),onClick:function(){return eh(!0)},onKeyDown:e6,onKeyUp:e8,tabIndex:Q,children:J||(0,i.jsxs)(i.Fragment,{children:[eJ&&!ep?(0,i.jsx)("input",{ref:eG,className:"".concat(_,"__input"),value:String(em?null!=eg?eg:"":null!=eK?eK:""),onChange:function(e){return e5(e.target.value)},placeholder:H,onFocus:function(){return eL(!0)},onBlur:function(){return eL(!1)}}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:"text",children:eK||H||""}),eV&&(0,i.jsx)("span",{className:"dropdown__list-item-postfix",children:eV})]}),(0,i.jsx)("span",{className:(0,u.default)("".concat(_,"__arrow"),n({},"".concat(_,"__arrow_active"),em)),onClick:function(e){null==e||e.stopPropagation(),eh(function(e){return!e})},children:ep?(0,i.jsx)(s.Code,{className:"mobile-icon"}):em?(0,i.jsx)(s.ChevronUp,{}):(0,i.jsx)(s.ChevronDown,{})})]})}),G&&(0,i.jsxs)("div",{className:(0,u.default)("".concat(_,"__actions")),children:[(0,i.jsx)("div",{className:(0,u.default)("".concat(_,"__actions-item")),onClick:Z,children:(0,i.jsx)(s.Check,{})}),(0,i.jsx)("div",{className:(0,u.default)("".concat(_,"__actions-item")),onClick:ee,children:(0,i.jsx)(s.X,{})})]}),em&&((y=eA())?(0,a.createPortal)((0,i.jsx)("div",{"data-testid":"".concat(q,"-container-wrapper"),className:(0,u.default)("".concat(_,"__container-wrapper")),ref:e$,onClick:ep?e4:function(){},children:(0,i.jsxs)("div",{className:(0,u.default)("".concat(_,"__list-wrapper"),(n(r={},"".concat(_,"__list-wrapper--fixed-height"),eE),n(r,"".concat(_,"__list-wrapper--with-bottom-shadow"),eC&&ep&&!el),n(r,"".concat(_,"__list-wrapper--with-bottom-shadow-hidden"),eN===ek&&!el),r)),ref:eX,children:[ep&&(0,i.jsxs)("div",{className:(0,u.default)("".concat(_,"__list-header"),(n(h={},"".concat(_,"__list-header-with-shadow"),eC&&ep),n(h,"".concat(_,"__list-header-with-shadow-hidden"),0===eN),h)),children:[(0,i.jsxs)("div",{className:(0,u.default)("".concat(_,"__list-header-row")),children:[(0,i.jsx)("div",{className:(0,u.default)("".concat(_,"__list-label")),children:O}),(0,i.jsx)("div",{className:(0,u.default)("".concat(_,"__list-close-icon")),onClick:e1,children:(0,i.jsx)(s.X,{onClick:e1})})]}),eJ&&(0,i.jsx)("div",{className:(0,u.default)("".concat(_,"__list-header-row")),children:(0,i.jsx)(v.default,{ref:eG,className:"".concat(_,"__input"),value:eg||"",onChange:e5,placeholder:H||"Search",withDelete:!0,onFocus:function(){return eL(!0)},onBlur:function(){return eL(!1)}})})]}),(0,i.jsxs)("div",{className:(0,u.default)("".concat(_,"__list"),(n(g={},"".concat(_,"__list-top"),D),n(g,"".concat(_,"__list--with-footer"),el),g)),ref:ez,children:[ni.options&&(null==(o=eB(ni.options))?void 0:o.map(function(e,t){if(null==e||null==(i=e.items)?void 0:i.length)if(!eJ||!ey)return nc(e);else{var l,o,r,i,u,c,a=null==(c=e.items)?void 0:c.slice().filter(function(e){var n;return(null==e||null==(n=e.label)?void 0:n.toLowerCase().includes((null==eg?void 0:eg.toLowerCase())||""))||!(null==e?void 0:e.value)||(null==e?void 0:e.value)===""});if(null==a?void 0:a.length)return nc((l=function(e){for(var t=1;t<arguments.length;t++){var l=null!=arguments[t]?arguments[t]:{},o=Object.keys(l);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(l).filter(function(e){return Object.getOwnPropertyDescriptor(l,e).enumerable}))),o.forEach(function(t){n(e,t,l[t])})}return e}({},e),o=o={items:a},Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(o)):(function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t.push.apply(t,l)}return t})(Object(o)).forEach(function(e){Object.defineProperty(l,e,Object.getOwnPropertyDescriptor(o,e))}),l))}else if(!eJ||!ey||(null==e||null==(u=e.label)?void 0:u.toLowerCase().includes((null==eg?void 0:eg.toLowerCase())||""))||!(null==e?void 0:e.value)||(null==e?void 0:e.value)==="")return nu(e,t,null==(r=(null==e?void 0:e.testId)||t)?void 0:r.toString());return null})),!(null==eq?void 0:eq.length)&&!(null==eF?void 0:eF.length)&&(0,i.jsx)("div",{className:"".concat(_,"__list-item ").concat(_,"__list-item--no-options"),children:z}),I&&em&&(0,i.jsx)(p.default,{})]}),el&&(0,i.jsx)("div",{ref:eY,className:(0,u.default)("".concat(_,"__footer"),(n(b={},"".concat(_,"__footer-with-shadow"),ep&&eC),n(b,"".concat(_,"__footer-with-shadow-hidden"),eN===ek),b)),children:el})]})}),y):null)]})};
|
package/package.json
CHANGED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { IDropdownProps } from './Dropdown.interface';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import './Dropdown.scss';
|
|
4
|
-
export declare const MIN_ITEMS_FOR_SHOW_MOBILE_SEARCH = 10;
|
|
5
|
-
declare function Dropdown<T extends string | number = string | number>({ label, options, value, error, disabled, onChange, placeholder, className, isSearchable: isSearchableProp, entity, scrollReactionObj, isListTop, isNotValidateASCII, testId, sortAlphabetical, fieldKey, id, noOptionsText, isDoNotPullOutListOfMainContainer, withMobileLogic, withActions, minItemsForShowMobileSearch, customTrigger, tabIndex, onActionConfirmClick, onActionCancelClick, isDefaultOpened, isDefaultOpenedMobile, footerContent, closeOnSelect, closeOnSelectMobile, withApplyLogic, cancelButtonRef, applyButtonRef, }: IDropdownProps): React.ReactElement | null;
|
|
6
|
-
export default Dropdown;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { IDropdownProps, IUseDropdown } from './Dropdown.interface';
|
|
2
|
-
declare function useDropdown({ id, fieldKey, value, sortAlphabetical, withMobileLogic, options, minItemsForShowMobileSearch, isSearchable: isSearchableProp, isDoNotPullOutListOfMainContainer }?: Partial<IDropdownProps>): IUseDropdown;
|
|
3
|
-
export default useDropdown;
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import type { Moment } from 'moment';
|
|
2
|
-
import type { FocusEvent, KeyboardEvent, MouseEventHandler } from 'react';
|
|
3
|
-
import type { IUniProps } from '../../../types/base.interface';
|
|
4
|
-
import type { IDropdownProps } from '../Dropdown';
|
|
5
|
-
export interface IIntervalItem {
|
|
6
|
-
label: string;
|
|
7
|
-
start: () => Moment;
|
|
8
|
-
end: () => Moment;
|
|
9
|
-
isHidden?: boolean;
|
|
10
|
-
}
|
|
11
|
-
export interface IIntervals {
|
|
12
|
-
[key: string]: IIntervalItem;
|
|
13
|
-
}
|
|
14
|
-
export interface IInputDateRange {
|
|
15
|
-
intervalKey?: string;
|
|
16
|
-
start?: Moment | Date | string | null;
|
|
17
|
-
end?: Moment | Date | string | null;
|
|
18
|
-
compare?: boolean;
|
|
19
|
-
startPrevDate?: Moment | Date | string | null;
|
|
20
|
-
endPrevDate?: Moment | Date | string | null;
|
|
21
|
-
}
|
|
22
|
-
export interface IDateInputProps extends IUniProps {
|
|
23
|
-
RC: string;
|
|
24
|
-
isFocused?: boolean;
|
|
25
|
-
disabled?: boolean;
|
|
26
|
-
value: string;
|
|
27
|
-
date: Date | Moment | string;
|
|
28
|
-
prepareDate?: (value: string | Date | Moment) => string;
|
|
29
|
-
onChange: (value: string) => void;
|
|
30
|
-
onFocus: MouseEventHandler<HTMLDivElement>;
|
|
31
|
-
onBlur: (e: FocusEvent<HTMLInputElement>) => void;
|
|
32
|
-
onKeyUp: (keyCode: number | string, e: KeyboardEvent<HTMLInputElement>) => void;
|
|
33
|
-
}
|
|
34
|
-
export interface IDatepickerProps extends IUniProps {
|
|
35
|
-
txt?: {
|
|
36
|
-
buttons?: {
|
|
37
|
-
[key: string]: string;
|
|
38
|
-
};
|
|
39
|
-
labels?: {
|
|
40
|
-
[key: string]: string;
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
buttonsTypes?: {
|
|
44
|
-
cancel?: string;
|
|
45
|
-
apply?: string;
|
|
46
|
-
};
|
|
47
|
-
values: IInputDateRange;
|
|
48
|
-
onChange?: ({ start, end, startPrevDate, endPrevDate, compare, }: {
|
|
49
|
-
start: string;
|
|
50
|
-
end: string;
|
|
51
|
-
startPrevDate: string;
|
|
52
|
-
endPrevDate: string;
|
|
53
|
-
compare: boolean;
|
|
54
|
-
}) => void;
|
|
55
|
-
onChangeMobile?: ({ start, end, startPrevDate, endPrevDate, compare, }: {
|
|
56
|
-
start: string;
|
|
57
|
-
end: string;
|
|
58
|
-
startPrevDate: string;
|
|
59
|
-
endPrevDate: string;
|
|
60
|
-
compare: boolean;
|
|
61
|
-
}) => void;
|
|
62
|
-
onChangeCompare?: (value: boolean) => void;
|
|
63
|
-
onCancel?: () => void;
|
|
64
|
-
getSelectedMode: ({ start, end }: {
|
|
65
|
-
start: Moment | string;
|
|
66
|
-
end: Moment | string;
|
|
67
|
-
}) => string;
|
|
68
|
-
onChangeInterval: (value: string) => void;
|
|
69
|
-
isCompareHidden?: boolean;
|
|
70
|
-
limitRange?: number;
|
|
71
|
-
setActiveInterval?: (value: string) => void;
|
|
72
|
-
isShortWeekNames?: boolean;
|
|
73
|
-
minDate?: string;
|
|
74
|
-
maxDate?: string;
|
|
75
|
-
momentMinDate?: Moment;
|
|
76
|
-
momentMaxDate?: Moment;
|
|
77
|
-
isDontLimitFuture?: boolean;
|
|
78
|
-
mainId?: string;
|
|
79
|
-
withMobileLogic?: boolean;
|
|
80
|
-
isDoNotPullOutListOfMainContainer?: IDropdownProps['isDoNotPullOutListOfMainContainer'];
|
|
81
|
-
}
|
|
82
|
-
export interface ISelectItemProps extends IUniProps {
|
|
83
|
-
item: string;
|
|
84
|
-
label: string;
|
|
85
|
-
isActive: boolean;
|
|
86
|
-
onItemClick: React.MouseEventHandler<HTMLDivElement>;
|
|
87
|
-
onMouseEnter?: React.MouseEventHandler<HTMLDivElement>;
|
|
88
|
-
disabled?: boolean;
|
|
89
|
-
}
|
|
90
|
-
export interface IOpenedPartProps extends IUniProps {
|
|
91
|
-
dateRangeContainerId: string;
|
|
92
|
-
txt?: IDatepickerProps['txt'];
|
|
93
|
-
buttonsTypes?: {
|
|
94
|
-
cancel?: string;
|
|
95
|
-
apply?: string;
|
|
96
|
-
};
|
|
97
|
-
actualValues: IDatepickerProps['values'];
|
|
98
|
-
onChange: (value: IInputDateRange) => void;
|
|
99
|
-
isCompact?: boolean;
|
|
100
|
-
isIntervalsHidden?: boolean;
|
|
101
|
-
isCompareHidden?: boolean;
|
|
102
|
-
limitRange?: IDatepickerProps['limitRange'];
|
|
103
|
-
isOptionsRight?: boolean;
|
|
104
|
-
current: string;
|
|
105
|
-
setCurrent: (value: string) => void;
|
|
106
|
-
isCompare?: boolean;
|
|
107
|
-
setIsCompare?: (value: boolean) => void;
|
|
108
|
-
toggleOff: () => void;
|
|
109
|
-
isShortWeekNames?: boolean;
|
|
110
|
-
minDate?: string;
|
|
111
|
-
maxDate?: string;
|
|
112
|
-
momentMinDate?: Moment;
|
|
113
|
-
momentMaxDate?: Moment;
|
|
114
|
-
isDontLimitFuture?: boolean;
|
|
115
|
-
isListTop?: boolean;
|
|
116
|
-
mainId: string;
|
|
117
|
-
withMobileLogic?: boolean;
|
|
118
|
-
isDoNotPullOutListOfMainContainer?: IDropdownProps['isDoNotPullOutListOfMainContainer'];
|
|
119
|
-
renderIntervals?: string[];
|
|
120
|
-
}
|
|
121
|
-
export interface IInputDateRangeProps extends IUniProps {
|
|
122
|
-
txt?: IDatepickerProps['txt'];
|
|
123
|
-
id?: string;
|
|
124
|
-
label?: string;
|
|
125
|
-
subLabel?: string;
|
|
126
|
-
value: IInputDateRange;
|
|
127
|
-
onChange: (value: IInputDateRange) => void;
|
|
128
|
-
error?: string | boolean;
|
|
129
|
-
disabled?: boolean;
|
|
130
|
-
isHoverable?: boolean;
|
|
131
|
-
isCompact?: boolean;
|
|
132
|
-
hideArrows?: boolean;
|
|
133
|
-
isOptionsRight?: boolean;
|
|
134
|
-
isUseAbs?: boolean;
|
|
135
|
-
minDate?: string;
|
|
136
|
-
maxDate?: string;
|
|
137
|
-
minMaxDateParseFormat?: string;
|
|
138
|
-
isDontLimitFuture?: boolean;
|
|
139
|
-
isListTop?: boolean;
|
|
140
|
-
isAltArrows?: boolean;
|
|
141
|
-
renderIntervals?: string[];
|
|
142
|
-
isDoNotPullOutListOfMainContainer?: IDropdownProps['isDoNotPullOutListOfMainContainer'];
|
|
143
|
-
dateRange?: IInputDateRange;
|
|
144
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ReactElement } from 'react';
|
|
2
|
-
import type { IDateInputProps } from '../InputDateRange.interface';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
declare function DateInput({ ref, ...props }: IDateInputProps & {
|
|
5
|
-
ref?: React.RefObject<Omit<HTMLInputElement, 'value'> | null>;
|
|
6
|
-
}): ReactElement;
|
|
7
|
-
export default DateInput;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { Moment } from 'moment-timezone';
|
|
2
|
-
import type { IInputDateRange, IIntervals } from './InputDateRange.interface';
|
|
3
|
-
export declare const getIsDateValid: (date: Date | Moment | string | null) => boolean;
|
|
4
|
-
export declare function useClickOutside(hideComponent: () => void, additionalComponent?: HTMLCollectionOf<Element>, onlyGetRef?: boolean): React.MutableRefObject<Element | null>;
|
|
5
|
-
export declare function useToggle(initialState?: string | boolean): {
|
|
6
|
-
isToggled: boolean;
|
|
7
|
-
toggle: () => void;
|
|
8
|
-
toggleOn: () => void;
|
|
9
|
-
toggleOff: () => void;
|
|
10
|
-
};
|
|
11
|
-
export declare const INTERVALS: IIntervals;
|
|
12
|
-
export declare const ALL_TIME_KEY = "allTime";
|
|
13
|
-
export declare const CUSTOM_INTERVAL_KEY = "customDate";
|
|
14
|
-
export declare const CUSTOM_INTERVAL_KEY_TEXT = "Custom Date";
|
|
15
|
-
export declare const MAIN_FORMAT = "YYYY-MM-DDTHH:mm";
|
|
16
|
-
export declare const MAIN_DATE_FORMAT = "YYYY-MM-DD";
|
|
17
|
-
export declare const MAIN_TIME_FORMAT = "HH:mm";
|
|
18
|
-
export declare function getActualDateRange(inputDateRange: IInputDateRange): IInputDateRange;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export default function RangeSlider({ required, noTrack, rangeSymbol, min, max, decimalPlaces, minRange, precision, testId, value, unit, label, isUseBitPoints, onChange, }: {
|
|
2
|
-
required: any;
|
|
3
|
-
noTrack: any;
|
|
4
|
-
rangeSymbol: any;
|
|
5
|
-
min?: number | undefined;
|
|
6
|
-
max?: number | undefined;
|
|
7
|
-
decimalPlaces?: number | undefined;
|
|
8
|
-
minRange?: number | undefined;
|
|
9
|
-
precision?: number | undefined;
|
|
10
|
-
testId?: string | undefined;
|
|
11
|
-
value?: {
|
|
12
|
-
from: any;
|
|
13
|
-
to: any;
|
|
14
|
-
} | undefined;
|
|
15
|
-
unit?: string | undefined;
|
|
16
|
-
label?: string | undefined;
|
|
17
|
-
isUseBitPoints?: boolean | undefined;
|
|
18
|
-
onChange?: (() => void) | undefined;
|
|
19
|
-
}): JSX.Element;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export function getSafelyDateRange(dateRange: any): import("../../../FormElements/InputDateRange/InputDateRange.interface").IInputDateRange;
|
|
2
|
-
export function getLabels(range: any): never[];
|
|
3
|
-
export function getMockValue(): number;
|
|
4
|
-
export function getTab(tabId: any, range: any, callback: any): Promise<any>;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { ReactElement } from 'react';
|
|
2
|
-
import type { IModalProps } from './Modal.interface';
|
|
3
|
-
import './Modal.scss';
|
|
4
|
-
import './ModalMobile.scss';
|
|
5
|
-
export declare const KEY_CODE: Readonly<{
|
|
6
|
-
readonly ENTER: 13;
|
|
7
|
-
readonly ESC: 27;
|
|
8
|
-
}>;
|
|
9
|
-
export declare function renderModalTitle({ mode, title, onlyTitle, }: {
|
|
10
|
-
mode?: string;
|
|
11
|
-
title: string;
|
|
12
|
-
onlyTitle?: boolean;
|
|
13
|
-
}): string;
|
|
14
|
-
declare function Modal({ ref, id, testId, zIndex, isOpen, onConfirm, onDecline, closeModal, className, variant, size, mode, title, onlyTitle, atributesForModalBody, confirmBtnClassName, confirmBtnLabel, confirmBtnVariant, confirmBtnDisable, confirmBtnIcon, isConfirmBtnIconPositionRight, noConfirmBtn, forced, closeBtnClassName, closeBtnText, closeBtnVariant, closeBtnDisable, closeBtnIcon, btnClassNames, isCloseBtnIconPositionRight, noCloseBtn, noHeader, noHeaderCloseBtn, customHeader, declineBtnDisable, noFooter, customFooter, withFixedFooter, leftContentOfFooter, isSubmittingByEnter: isSubmittingByEnterOuter, isClosingByEsc: isClosingByEscOuter, withEventManagement, submitOnEnter, closeOnEsc, withMobileLogic, children, }: IModalProps & {
|
|
15
|
-
ref?: React.RefObject<HTMLDivElement | null>;
|
|
16
|
-
}): ReactElement | null;
|
|
17
|
-
declare namespace Modal {
|
|
18
|
-
var displayName: string;
|
|
19
|
-
}
|
|
20
|
-
export default Modal;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import Modal from './Modal';
|
|
2
|
-
import ModalHOC from './ModalHOC';
|
|
3
|
-
import { EVENTS } from './partials/_constants';
|
|
4
|
-
import { dispatchEventForModalManagement } from './partials/_utils';
|
|
5
|
-
export type { IModalFooterProps, IModalHOCProps, IModalProps, IModalTitleProps } from './Modal.interface';
|
|
6
|
-
export { Modal, ModalHOC };
|
|
7
|
-
export { EVENTS };
|
|
8
|
-
export { dispatchEventForModalManagement };
|
|
9
|
-
export default Modal;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { MutableRefObject, ReactNode } from 'react';
|
|
2
|
-
type ScrollDirection = 'up' | 'down';
|
|
3
|
-
interface ModalsLogic {
|
|
4
|
-
IS_HEADER_HIDDEN: boolean;
|
|
5
|
-
IS_HEADER_STICKY: boolean;
|
|
6
|
-
IS_FOOTER_HIDDEN: boolean;
|
|
7
|
-
IS_FOOTER_STICKY: boolean;
|
|
8
|
-
}
|
|
9
|
-
interface UseMobileModalProps {
|
|
10
|
-
modalRef?: React.RefObject<HTMLDivElement>;
|
|
11
|
-
withMobileLogic?: boolean;
|
|
12
|
-
withFixedFooter?: boolean;
|
|
13
|
-
isOpen?: boolean;
|
|
14
|
-
}
|
|
15
|
-
interface UseMobileModalReturn {
|
|
16
|
-
modalMobileContainerRef: MutableRefObject<HTMLDivElement | null>;
|
|
17
|
-
modalMobileHeaderRef: MutableRefObject<HTMLDivElement | null>;
|
|
18
|
-
modalMobileBodyRef: MutableRefObject<HTMLDivElement | null>;
|
|
19
|
-
modalMobileFooterRef: MutableRefObject<HTMLDivElement | null>;
|
|
20
|
-
MODALS_LOGIC: ModalsLogic;
|
|
21
|
-
SCROLL_DIRECTION: {
|
|
22
|
-
UP: ScrollDirection;
|
|
23
|
-
DOWN: ScrollDirection;
|
|
24
|
-
};
|
|
25
|
-
scrollTop: number;
|
|
26
|
-
scrollHeight: number;
|
|
27
|
-
renderModal: (modal: ReactNode) => ReactNode;
|
|
28
|
-
isMobile: boolean;
|
|
29
|
-
}
|
|
30
|
-
export default function useMobileModal({ modalRef, withMobileLogic, withFixedFooter, isOpen, }: UseMobileModalProps): UseMobileModalReturn;
|
|
31
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export default TdCell;
|
|
2
|
-
declare function TdCell({ type, item, rowIndex, onChange, cardLength, changePriority, getAdviceWeight, onActionClick, rowItem, isDeleted, }: {
|
|
3
|
-
type: any;
|
|
4
|
-
item: any;
|
|
5
|
-
rowIndex: any;
|
|
6
|
-
onChange: any;
|
|
7
|
-
cardLength: any;
|
|
8
|
-
changePriority: any;
|
|
9
|
-
getAdviceWeight: any;
|
|
10
|
-
onActionClick: any;
|
|
11
|
-
rowItem: any;
|
|
12
|
-
isDeleted: any;
|
|
13
|
-
}): any;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export default TdRow;
|
|
2
|
-
declare function TdRow({ item, onChange, rowIndex, cardStatus, range, type, rowSpan, colSpan, cardLength, changePriority, getAdviceWeight, onActionClick, isDeleted, testId, }: {
|
|
3
|
-
item: any;
|
|
4
|
-
onChange: any;
|
|
5
|
-
rowIndex: any;
|
|
6
|
-
cardStatus: any;
|
|
7
|
-
range: any;
|
|
8
|
-
type: any;
|
|
9
|
-
rowSpan: any;
|
|
10
|
-
colSpan: any;
|
|
11
|
-
cardLength: any;
|
|
12
|
-
changePriority: any;
|
|
13
|
-
getAdviceWeight: any;
|
|
14
|
-
onActionClick: any;
|
|
15
|
-
isDeleted: any;
|
|
16
|
-
testId?: string | undefined;
|
|
17
|
-
}): JSX.Element;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
interface UseIsMobileProps {
|
|
2
|
-
isWithoutWidthCheck?: boolean;
|
|
3
|
-
}
|
|
4
|
-
interface UseIsMobileProps {
|
|
5
|
-
isWithoutWidthCheck?: boolean;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Hook to detect if the current device is a mobile device
|
|
9
|
-
* @param props - Configuration options
|
|
10
|
-
* @param props.isWithoutWidthCheck - If true, only checks user agent without width verification
|
|
11
|
-
* @returns Object containing isMobile flag
|
|
12
|
-
*/
|
|
13
|
-
declare function useIsMobile({ isWithoutWidthCheck }?: UseIsMobileProps): {
|
|
14
|
-
isMobile: boolean;
|
|
15
|
-
isMobilePortrait: boolean;
|
|
16
|
-
isMobileLandscape: boolean;
|
|
17
|
-
};
|
|
18
|
-
export default useIsMobile;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useIsMobile.js","sourceRoot":"","sources":["../../../src/Functions/useIsMobile/useIsMobile.ts"],"names":[],"mappings":";;AAAA,iCAA4C;AAS5C;;;;;GAKG;AACH,SAAS,WAAW,CAAC,EAAE,mBAAmB,GAAG,KAAK,KAAuB,EAAE;IACzE,MAAM,MAAM,GAAG,GAAY,EAAE;QAC3B,MAAM,EAAE,GAAG,SAAS,CAAC,SAAS,IAAI,SAAS,CAAC,MAAM,IAAK,MAAc,CAAC,KAAK,CAAC;QAE5E,qDAAqD;QACrD,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACnC,MAAM,QAAQ,GAAG,SAAS,CAAC,cAAc,IAAI,SAAS,CAAC,cAAc,GAAG,CAAC,CAAC;QAE1E,OAAO,KAAK,IAAI,CAAC,CAAC,QAAQ,CAAC;IAC7B,CAAC,CAAC;IAEF,MAAM,WAAW,GAAG,GAAY,EAAE;QAChC,OAAO,gEAAgE,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,MAAM,EAAE,CAAC;IAChH,CAAC,CAAC;IAEF,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,IAAA,gBAAQ,EAAU,WAAW,EAAE,CAAC,CAAC;IAEjE,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,WAAW,EAAE,EAAE,CAAC;YAClB,WAAW,CAAC,IAAI,CAAC,CAAC;QACpB,CAAC;IACH,CAAC,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;IAE1B,OAAO;QACL,QAAQ,EAAE,QAAQ,IAAI,CAAC,mBAAmB,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,IAAI,IAAI,IAAI,MAAM,CAAC,UAAU,CAAC,0BAA0B,CAAC,CAAC,OAAO,CAAC,CAAC;QACnK,gBAAgB,EAAE,QAAQ,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,IAAI,GAAG,IAAI,MAAM,CAAC,UAAU,CAAC,wBAAwB,CAAC,CAAC,OAAO;QAC/G,iBAAiB,EAAE,QAAQ,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,IAAI,IAAI,IAAI,MAAM,CAAC,UAAU,CAAC,0BAA0B,CAAC,CAAC,OAAO;KACpH,CAAC;AACJ,CAAC;AAED,kBAAe,WAAW,CAAC"}
|