@daoyi/nmtl-ui 2.0.1-beta.33 → 2.0.1-beta.34
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/lib/components/Autocomplete.js +1 -1
- package/lib/components/BackTop.js +1 -1
- package/lib/components/ContactModal.js +2 -2
- package/lib/components/Footer.js +1 -1
- package/lib/components/Header.js +1 -1
- package/lib/components/KeywordSearch-974c1601.js +1 -0
- package/lib/components/KeywordSearch.js +1 -1
- package/lib/components/Keywords.js +1 -1
- package/lib/components/SNA.js +1 -1
- package/lib/components/{createSvgIcon-be0b4e38.js → createSvgIcon-9244cfb8.js} +0 -0
- package/lib/components/{createSvgIcon-a0a657e2.js → createSvgIcon-9c1645fc.js} +0 -0
- package/package.json +1 -1
- package/lib/components/KeywordSearch-aa4a8e40.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,a as n,b as o}from"./_rollupPluginBabelHelpers-b6a1ebe2.js";import t,{useCallback as r,useState as a,useRef as l,useEffect as u}from"react";import i from"prop-types";import{c}from"./index-b2745105.js";import{d as p}from"./debounce-c993109b.js";import{Autocomplete as s}from"@material-ui/lab";import{Chip as f,TextField as d,CircularProgress as m}from"@material-ui/core";import{Close as b,SearchOutlined as g}from"@material-ui/icons";import
|
|
1
|
+
import{_ as e,a as n,b as o}from"./_rollupPluginBabelHelpers-b6a1ebe2.js";import t,{useCallback as r,useState as a,useRef as l,useEffect as u}from"react";import i from"prop-types";import{c}from"./index-b2745105.js";import{d as p}from"./debounce-c993109b.js";import{Autocomplete as s}from"@material-ui/lab";import{Chip as f,TextField as d,CircularProgress as m}from"@material-ui/core";import{Close as b,SearchOutlined as g}from"@material-ui/icons";import{s as h}from"./style-inject.es-1f59c1d0.js";import y from"./Empty.js";h(".autocomplete .MuiAutocomplete-inputRoot[class*='MuiOutlinedInput-root'] {\n padding: 0px 8px; }\n\n.autocomplete .MuiChip-deleteIcon {\n width: 16px;\n height: 16px; }\n\n.autocomplete__icon {\n font-size: 1.25rem;\n margin-right: 8px;\n cursor: pointer; }\n\n.autocomplete--showSearchIcon .MuiAutocomplete-inputRoot[class*='MuiOutlinedInput-root'] {\n display: flex;\n flex-wrap: nowrap;\n padding: 4px 8px; }\n");var I=function(i){var h=i.options,I=i.defaultValue,v=i.renderAfterDefaultValueChange,A=i.filterable,C=i.loading,V=i.labelInValue,E=i.disabled,x=i.onSearchIconClick,w=i.className,S=i.multiple,O=i.freeTyping,T=i.placeholder,_=i.searchIcon,j=i.renderInput,k=i.renderTags,D=i.onChange,N=i.onSearch,F=i.onFocus,R=i.onBlur,B=i.onEnter,M=a(!0),P=n(M,2),L=P[0],z=P[1],H=a(),J=n(H,2),K=J[0],U=J[1],q=a(),G=n(q,2),Q=G[0],W=G[1],X=a(),Y=n(X,2),Z=Y[0],$=Y[1],ee=a(),ne=n(ee,2),oe=ne[0],te=ne[1],re=(n=>{let{options:o,placeholder:a,loading:l,searchIcon:u,labelInValue:i,onSearchIconClick:c,onEnter:p,currentResult:s,setCurrentDefaultValue:h}=n;const y=r((e=>"object"==typeof e?e.value:e),[]),I=r((e=>{const n=(Array.isArray(o)?o:[]).find((n=>y(n)===y(e)));return n?"object"==typeof n?n.label:n:"object"==typeof e?e.label:e}),[o]),v=r((e=>{if(Array.isArray(o)){if(Array.isArray(e))return e.map((e=>o.find((n=>{let{value:o}=n;return e===o||e.value===o}))||e));const n=o.find((n=>{let{value:o}=n;return e===o}));return i?e:n||{label:e,value:e}}return e}),[o,i]),A=r(((n,o)=>n.map(((n,r)=>t.createElement(f,e({label:I(n),deleteIcon:t.createElement(b,null)},o({index:r})))))),[o]),C=r((n=>t.createElement(d,e({},n,{variant:"outlined",placeholder:a,InputProps:{...n.InputProps,endAdornment:t.createElement(t.Fragment,null,l&&t.createElement(m,{className:"autocomplete__icon",color:"inherit",size:20}),u&&t.createElement(g,{className:"autocomplete__icon",onClick:e=>(h({label:s,value:s}),"string"==typeof s&&""!==s?p(e,{label:s,value:s}):c())}),n.InputProps.endAdornment)}}))),[l,u]);return{getValue:y,getValueFromOptions:v,defaultTag:A,defaultRenderInput:C}})(o({},{options:h,placeholder:T,loading:C,searchIcon:_,labelInValue:V,onSearchIconClick:x,currentResult:Q,onEnter:B,setCurrentDefaultValue:te})),ae=re.getValue,le=re.getValueFromOptions,ue=re.defaultTag,ie=re.defaultRenderInput,ce=l(p((function(e){return N(e)}),500)).current;return u((function(){te("string"==typeof I&&S?{label:K,value:K}:le(I))}),[JSON.stringify(I)]),u((function(){v&&z(!1)}),[oe]),u((function(){L||z(!0)}),[L]),u((function(){Q&&(U(Q),ce(Q))}),[Q]),t.createElement("div",{className:c("autocomplete",{"autocomplete--showSearchIcon":_},w)},L&&t.createElement(s,{className:"autocomplete__component",options:Array.isArray(h)&&(O&&K?[{label:K,value:K}].concat(h):h)||[],defaultValue:oe,disabled:E,multiple:S,filterOptions:function(e,n){var o=n.inputValue,t=void 0===o?"":o;return(Array.isArray(e)?e:[]).filter((function(e){var n=(e||{}).label;return!A||(void 0===n?"":n).toLowerCase().indexOf(t.toLowerCase())>-1}))},onChange:function(e,n){Array.isArray(n)?D(n.map((function(e){return V?e:ae(e)}))):n&&D(V?n:ae(n))},onInputChange:function(e,n,o){n&&"string"==typeof n&&"input"===o&&W(n)},onKeyDown:function(e){switch(e.key){case"ArrowDown":case"ArrowUp":$(!0);break;case"Enter":if(!Z){var n=O&&!S;B(e,n?{label:K,value:K}:void 0),n&&te({label:K,value:K})}break;default:$(!1)}},getOptionLabel:function(e){return e&&e.label||""},getOptionDisabled:function(e){return e.disabled},renderInput:function(e){return j&&j(e)||ie(e)},renderTags:function(e,n){return k&&k(e,n)||ue(e,n)},popupIcon:null,noOptionsText:t.createElement(y,null),onFocus:F,onBlur:R}))};I.defaultProps={className:void 0,defaultValue:void 0,renderAfterDefaultValueChange:!1,options:void 0,freeTyping:!1,loading:!1,disabled:!1,labelInValue:!0,searchIcon:!0,multiple:!1,placeholder:"Search...",filterable:!1,renderInput:void 0,renderTags:void 0,onChange:function(){},onSearch:function(){},onFocus:function(){},onBlur:function(){},onEnter:function(){},onSearchIconClick:function(){}},I.propTypes={className:i.string,defaultValue:i.any,renderAfterDefaultValueChange:i.bool,options:i.arrayOf(i.any),freeTyping:i.bool,loading:i.bool,disabled:i.bool,labelInValue:i.bool,searchIcon:i.bool,multiple:i.bool,placeholder:i.string,filterable:i.bool,renderInput:i.func,renderTags:i.func,onChange:i.func,onSearch:i.func,onFocus:i.func,onBlur:i.func,onEnter:i.func,onSearchIconClick:i.func};export{I as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./_rollupPluginBabelHelpers-b6a1ebe2.js";import n,{useState as o,useRef as t,useEffect as i}from"react";import r from"prop-types";import{u as a,b as
|
|
1
|
+
import{a as e}from"./_rollupPluginBabelHelpers-b6a1ebe2.js";import n,{useState as o,useRef as t,useEffect as i}from"react";import r from"prop-types";import{u as a,b as c,c as l}from"./index-b2745105.js";import{d as s}from"./debounce-c993109b.js";import{Fade as p,NoSsr as m,Box as d}from"@material-ui/core";import{i as u,a as f,r as b}from"./createSvgIcon-9c1645fc.js";import{s as v}from"./style-inject.es-1f59c1d0.js";import"@material-ui/styles";import"react-dom";var x=a(c((function(e,o){Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0;var t=u(n),i=(0,f(b).default)(t.createElement("path",{d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14l-6-6z"}),"ExpandLessSharp");o.default=i})));v(".backTop {\n right: 30px;\n bottom: 50px;\n position: fixed;\n z-index: 10;\n opacity: 0;\n cursor: pointer; }\n .backTop__default {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n width: 70px;\n height: 70px;\n border-radius: 45px;\n opacity: 0.8;\n transition: opacity 0.3s ease-in-out; }\n .backTop__default:hover {\n opacity: 1; }\n .backTop__default .MuiSvgIcon-root {\n margin-bottom: -3px; }\n .backTop:hover {\n opacity: 0.7; }\n\n@media only screen and (max-width: 484px) {\n .backTop {\n right: 15px; } }\n");var y=function(r){var a=r.className,c=r.visibilityHeight,u=r.onClick,f=r.children,b=o(!1),v=e(b,2),y=v[0],h=v[1],w=t(s((function(){var e=window.scrollY;h(e>=c)}),100)).current;return i((function(){return window.addEventListener("scroll",(function(){return w()})),function(){window.removeEventListener("scroll",(function(){return w()}))}}),[]),n.createElement(p,{in:y,timeout:500,unmountOnExit:!0},n.createElement("div",{className:l("backTop",a),onClick:function(){window.scrollTo?window.scrollTo({top:0,left:0,behavior:"smooth"}):window.scrollTop=0,u()}},f?n.createElement("div",null,f):n.createElement(m,null,n.createElement(d,{className:"backTop__default",color:"text.primary",bgcolor:"primary.main",borderColor:"text.secondary"},n.createElement(x,null),"Top"))))};y.defaultProps={className:void 0,visibilityHeight:300,onClick:function(){},children:void 0},y.propTypes={className:r.string,visibilityHeight:r.number,onClick:r.func,children:r.node};export{y as default};
|