intelicoreact 1.8.60 → 1.8.62
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var l=[],u=!0,i=!1;try{for(o=o.call(e);!(u=(r=o.next()).done)&&(l.push(r.value),!t||l.length!==t);u=!0);}catch(e){i=!0,n=e}finally{try{u||null==o.return||o.return()}finally{if(i)throw n}}return l}}(e,t)||n(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||n(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.")}()}function n(t,r){if(t){if("string"==typeof t)return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}}Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return s}});var o,l=require("react"),u=(o=require("../../../Functions/useIsMobile"))&&o.__esModule?o:{default:o},i=require("./_utils"),a=require("./Dropdown"),s=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.id,o=e.fieldKey,s=e.value,c=e.sortAlphabetical,f=e.withMobileLogic,d=e.options,p=e.minItemsForShowMobileSearch,b=e.isSearchable,v=e.isDoNotPullOutListOfMainContainer,y=(0,u.default)().isMobile&&f
|
|
1
|
+
function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var l=[],u=!0,i=!1;try{for(o=o.call(e);!(u=(r=o.next()).done)&&(l.push(r.value),!t||l.length!==t);u=!0);}catch(e){i=!0,n=e}finally{try{u||null==o.return||o.return()}finally{if(i)throw n}}return l}}(e,t)||n(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||n(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.")}()}function n(t,r){if(t){if("string"==typeof t)return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}}Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return s}});var o,l=require("react"),u=(o=require("../../../Functions/useIsMobile"))&&o.__esModule?o:{default:o},i=require("./_utils"),a=require("./Dropdown"),s=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.id,o=e.fieldKey,s=e.value,c=e.sortAlphabetical,f=e.withMobileLogic,d=e.options,p=e.minItemsForShowMobileSearch,b=e.isSearchable,v=e.isDoNotPullOutListOfMainContainer,y=(0,u.default)().isMobile&&f,S=t((0,l.useState)((n||o||Math.random().toString(16).slice(2)).toString()),1)[0],g=t((0,l.useState)(!1),2),h=g[0],m=g[1],O=t((0,l.useState)(null),2),M=O[0],w=O[1],I=(0,l.useRef)(null),L=t((0,l.useState)(),2),j=L[0],P=L[1],R=(0,l.useRef)(null),C=(0,l.useRef)(null),A=(0,l.useRef)(null),_=(0,l.useRef)(null),x=(0,l.useRef)(null),H=(0,l.useRef)(null),T=t((0,l.useState)(null),2),E=T[0],F=T[1],D=t((0,l.useState)(!1),2),N=D[0],W=D[1],q=t((0,l.useState)(!1),2),V=q[0],k=q[1],B=t((0,l.useState)(!1),2),G=B[0],K=B[1],U=t((0,l.useState)(!1),2),$=U[0],z=U[1],J=t((0,l.useState)(0),2),Q=J[0],X=J[1],Y=t((0,l.useState)(1),2),Z=Y[0],ee=Y[1],et=t((0,l.useState)(0),2),er=et[0],en=et[1],eo=(0,l.useMemo)(function(){return d?(0,i.getTotalOptions)(d):0},[d]),el=(0,l.useMemo)(function(){return y?eo>(p||a.MIN_ITEMS_FOR_SHOW_MOBILE_SEARCH):b},[y,b,eo,p,a.MIN_ITEMS_FOR_SHOW_MOBILE_SEARCH]),eu=(0,l.useMemo)(function(){return(0,i.moveOtherToEnd)(null!=d?d:[])},[d]),ei=(0,l.useMemo)(function(){return eu.map(function(e){var t,r,n;return r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},e),n=n={items:el&&N?null==(t=e.items)?void 0:t.slice().filter(function(e){var t,r;return(null==e||null==(r=e.label)?void 0:r.toLowerCase().includes((null==j||null==(t=j.toString())?void 0:t.toLowerCase())||""))||!(null==e?void 0:e.value)||(null==e?void 0:e.value)===""}):null==e?void 0:e.items},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(n)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}),r}).filter(function(e){var t,r;return(null!=(r=null==(t=e.items)?void 0:t.length)?r:0)>0})},[eu,j,el,N]),ea=(0,l.useMemo)(function(){return eu.filter(function(e){var t;return!(null==(t=e.items)?void 0:t.length)}).filter(function(e){var t,r;return!el||!N||(null==e||null==(r=e.label)?void 0:r.toLowerCase().includes((null==j||null==(t=j.toString())?void 0:t.toLowerCase())||""))||!(null==e?void 0:e.value)||(null==e?void 0:e.value)===""})},[eu,j,el,N]),es=(0,l.useMemo)(function(){return r(ea).concat(r(ei))},[ea,ei]),ec=(0,l.useMemo)(function(){var e,t;return null!=(t=null==d||null==(e=d.find(function(e){return e.value===s}))?void 0:e.label)?t:null==d?void 0:d.reduce(function(e,t){var r,n,o;return(null==e?void 0:e.length)?e:null!=(o=null==(n=t.items)||null==(r=n.find(function(e){return e.value===s}))?void 0:r.label)?o:""},"")},[d,s]),ef=(0,l.useMemo)(function(){var e;return ec&&(null==(e=es.find(function(e){return e.value===s}))?void 0:e.postfix)||null},[ec,es,s]);return{isMobile:y,dropdownId:S,isOpen:h,setIsOpen:m,searchValue:j,setSearchValue:P,initListHeight:E,setInitListHeight:F,isSearchChanged:N,setIsSearchChanged:W,isSearchInputFocused:V,setIsSearchInputFocused:k,isScrollableList:G,setIsScrollableList:K,isFixedMaxHeight:$,setIsFixedMaxHeight:z,scrollTop:Q,setScrollTop:X,scrollHeight:Z,setScrollHeight:ee,maxListContainerHeight:er,setMaxListContainerHeight:en,getListContainer:function(){return(0,i.getListContainer)(S)},getListContainerWrapper:function(){return(0,i.getListContainerWrapper)(S)},getParentNode:function(){return(0,i.getParentNode)(R,v)},getPreparedOptionLabel:function(e,t,r){return(0,i.getPreparedOptionLabel)(j,e,el,t,r)},getSortedOptions:function(e){return(0,i.getSortedOptions)(e,c)},filteredGroups:ei,filteredItems:ea,filteredOptions:es,selectedLabel:ec,postfixText:ef,dropdownRef:R,dropdownListRef:C,dropdownListWrapperRef:_,dropdownFooterRef:A,searchInputRef:x,wrapperRef:H,totalOptionsLength:eo,isSearchable:el,valueToApply:M,valueToApplyRef:I,setValueToApply:function(e){I.current=e,w(e)}}};
|