@para-ui/core 2.0.3 → 2.0.7
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/ComboSelect/index.js +3 -3
- package/ComboSelect/interface.d.ts +1 -1
- package/Drawer/index.js +2 -2
- package/Drawer/interface.d.ts +2 -0
- package/Form/index.d.ts +4 -0
- package/Form/index.js +1 -1
- package/FormItem/index.d.ts +11 -2
- package/FormItem/index.js +3 -3
- package/FormItem/itemType.d.ts +1 -1
- package/Help/index.d.ts +1 -0
- package/Help/index.js +3 -3
- package/InputLang/index.js +3 -3
- package/InputNumber/index.js +3 -3
- package/Loading/index.d.ts +17 -0
- package/Loading/index.js +16 -0
- package/MultiBox/index.js +3 -3
- package/Pagination/index.js +1 -1
- package/Search/index.js +3 -3
- package/Select/index.js +1 -1
- package/SingleBox/index.js +1 -1
- package/Slider/index.js +2 -2
- package/Styles/theme.scss +4 -0
- package/Table/index.js +2 -2
- package/Table/tableBodyInterface.d.ts +2 -0
- package/TextField/index.js +1 -1
- package/ToggleButton/ToggleButtonGroup.d.ts +1 -1
- package/ToggleButton/index.d.ts +1 -1
- package/ToggleButton/index.js +3 -3
- package/Transfer/index.js +1 -1
- package/index.d.ts +1 -0
- package/index.js +2 -2
- package/package.json +1 -1
- package/style.css +14 -10
package/Transfer/index.js
CHANGED
|
@@ -13,4 +13,4 @@ var n=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,i=Object.pr
|
|
|
13
13
|
* This source code is licensed under the MIT license found in the
|
|
14
14
|
* LICENSE file in the root directory of this source tree.
|
|
15
15
|
*/
|
|
16
|
-
t(4126);var i=t(9297),o=60103;if(n.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var r=Symbol.for;o=r("react.element"),n.Fragment=r("react.fragment")}var a=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c=Object.prototype.hasOwnProperty,s={key:!0,ref:!0,__self:!0,__source:!0};function l(e,n,t){var i,r={},l=null,u=null;for(i in void 0!==t&&(l=""+t),void 0!==n.key&&(l=""+n.key),void 0!==n.ref&&(u=n.ref),n)c.call(n,i)&&!s.hasOwnProperty(i)&&(r[i]=n[i]);if(e&&e.defaultProps)for(i in n=e.defaultProps)void 0===r[i]&&(r[i]=n[i]);return{$$typeof:o,type:e,key:l,ref:u,props:r,_owner:a.current}}n.jsx=l,n.jsxs=l},7712:function(e,n,t){e.exports=t(9524)},3094:function(e,n,t){var i=t(7712),o=t(9297),r=t(6885),a=function(){return a=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},a.apply(this,arguments)};n.default=function(e){var n=e.children,t=e.placement,c=void 0===t?"bottom-start":t,s=e.tips,l=void 0===s?"":s,u=e.className,d=void 0===u?"":u,f=(0,o.useRef)(),v=(0,o.useState)(""),p=v[0],h=v[1];(0,o.useEffect)((function(){h(l)}),[l]);var x;return(0,i.jsx)("div",a({ref:function(e){e&&(f.current=e)},className:(x="paraui-auto-tips",d&&(x+=" "+d),x),onMouseOver:function(){f.current.scrollWidth>f.current.offsetWidth?h(p||f.current.innerText):h("")}},{children:(0,i.jsx)(r.default,a({title:p,placement:c},{children:(0,i.jsx)("div",a({className:"auto-tips-content"},{children:n}),void 0)}),void 0)}),void 0)}},2990:function(e,n,t){t.d(n,{default:function(){return m}});var i=t(7712),o=t(9297),r=t(1731),a=t(4927),c=t(1102),s=t.n(c),l=t(2749),u=t.n(l),d=t(6885),f=t(6028),v=t.n(f),p=function(){return p=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},p.apply(this,arguments)};var h=function(){return h=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},h.apply(this,arguments)},x=function(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)n.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(t[i[o]]=e[i[o]])}return t},b=function(e){var n=e.variant,t=void 0===n?"contained":n,c=e.size,l=void 0===c?"large":c,f=e.className,v=e.disabled,p=void 0!==v&&v,b=e.children,m=e.startIcon,g=e.endIcon,j=e.loading,y=void 0!==j&&j,k=e.toolTipTitle,O=void 0===k?"":k,w=e.danger,C=void 0!==w&&w,S=x(e,["variant","size","className","disabled","children","startIcon","endIcon","loading","toolTipTitle","danger"]),N=(0,o.useState)(!1),P=N[0],E=N[1],I=function(e){if(!P)return"start"===e&&m?(0,i.jsx)("span",h({className:(0,a.Z)("btn-icon","start-icon")},{children:m}),void 0):"end"===e&&g?(0,i.jsx)("span",h({className:(0,a.Z)("btn-icon","end-icon")},{children:g}),void 0):null;if("object"==typeof y){var n=y.delay||0;setTimeout((function(){return E(!1)}),n)}return"start"===e?(0,i.jsx)("span",h({className:"btn-icon loading-icon"},{children:(0,i.jsx)(s(),{},void 0)}),void 0):null},T=(0,i.jsx)(r.Button,h({},S,{color:"default",variant:"contained",disabled:p,disableRipple:!0,disableElevation:!0,className:(0,a.Z)("paraui-button",f,"paraui-button-".concat(t),"paraui-button-".concat(l),P&&"paraui-button-loading",C&&!p&&"paraui-button-dangerous"),startIcon:I("start"),endIcon:I("end")},{children:b}),void 0);return(0,o.useEffect)((function(){E(!!y)}),[y]),p&&O?(0,i.jsx)(d.default,h({title:function(){if(p&&O){return(0,i.jsxs)("span",{children:[(0,i.jsx)(u(),{style:{marginRight:"4px",fontSize:"11px",color:"inherit"}},void 0),O]},void 0)}return O}()},{children:(0,i.jsx)("span",h({className:"paraui-button--disabled"},{children:T}),void 0)}),void 0):T};b.IconButton=function(e){var n=e.variant,t=void 0===n?"contained":n,c=e.size,l=void 0===c?"large":c,f=e.toolTipTitle,v=void 0===f?"":f,p=e.children,b=e.className,m=e.disabled,g=void 0!==m&&m,j=e.loading,y=void 0!==j&&j,k=e.TooltipProps,O=e.danger,w=void 0!==O&&O,C=x(e,["variant","size","toolTipTitle","children","className","disabled","loading","TooltipProps","danger"]),S=(0,o.useState)(!1),N=S[0],P=S[1],E=(0,i.jsx)(r.IconButton,h({},C,{disabled:g,disableRipple:!0,className:(0,a.Z)("paraui-icon-button",b,"paraui-icon-button-".concat(t),"paraui-icon-button-".concat(l),N&&"paraui-icon-button-loading",w&&!g&&"paraui-icon-button-dangerous")},{children:function(){if(!N)return p;if("object"==typeof y){var e=y.delay||0;setTimeout((function(){return P(!1)}),e)}return(0,i.jsx)("span",h({className:"loading-icon"},{children:(0,i.jsx)(s(),{},void 0)}),void 0)}()}),void 0);return(0,o.useEffect)((function(){P(!!y)}),[y]),v?(0,i.jsx)(d.default,h({},k,{title:function(){if(g&&v){return(0,i.jsxs)("span",{children:[(0,i.jsx)(u(),{style:{marginRight:"4px",fontSize:"11px",color:"inherit"}},void 0),v]},void 0)}return v}()},{children:g?(0,i.jsx)("span",h({className:"paraui-button--disabled"},{children:E}),void 0):E}),void 0):E},b.SplitButton=function(e){var n=e.buttonText,t=e.options,c=void 0===t?[]:t,s=e.className,l=e.disabled,u=void 0!==l&&l,d=e.onClick,f=e.optionRender,h=(0,o.useState)(!1),x=h[0],b=h[1],g=(0,o.useRef)(null),j=(0,o.useRef)(),y=(0,o.useState)(0),k=y[0],O=y[1],w=function(e,n,t){var i;O(n),b(!1),null===(i=j.current)||void 0===i||i.classList.remove("paraui-button-split--active"),null==d||d(e,t)},C=function(e){var n,t;(null===(n=g.current)||void 0===n?void 0:n.contains(e.target))||(b(!1),null===(t=j.current)||void 0===t||t.classList.remove("paraui-button-split--active"))},S=function(){return(0,i.jsx)("div",p({className:"paraui-button-split-list"},{children:(0,i.jsx)("ul",{children:c.map((function(e,n){return Array.isArray(e)?function(e,n){return(0,i.jsx)("li",p({className:"split-li-group"},{children:e.map((function(e,t){var o="".concat(n,"-").concat(t);return(0,i.jsx)("div",p({className:(0,a.Z)("split-li",o===k&&"split-li--active"),onClick:function(n){return w(e,o,n)}},{children:(null==f?void 0:f(e))||e.label}),o)}))}),n)}(e,n):(0,i.jsx)("li",p({className:(0,a.Z)("split-li",n===k&&"split-li--active"),onClick:function(t){return w(e,n,t)}},{children:(null==f?void 0:f(e))||e.label}),n)}))},void 0)}),void 0)};return(0,i.jsxs)("div",p({className:(0,a.Z)("paraui-button-split",s),ref:g,onMouseLeave:function(e){var n;e.stopPropagation(),null===(n=e.currentTarget.firstElementChild)||void 0===n||n.classList.remove("paraui-button-split--active"),b(!1)}},{children:[(0,i.jsx)(m,p({variant:"outlined",onMouseEnter:function(e){e.stopPropagation();var n=e.currentTarget;j.current=n,n.classList.add("paraui-button-split--active"),b(!0)},startIcon:(0,i.jsx)(v(),{},void 0),disabled:u},{children:null!=n?n:"更多操作"}),void 0),(0,i.jsx)(r.Popper,p({open:x,anchorEl:g.current,transition:!0,placement:"bottom-end"},{children:function(e){var n=e.TransitionProps;e.placement;return(0,i.jsx)(r.Grow,p({},n,{children:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(r.ClickAwayListener,p({onClickAway:C},{children:S()}),void 0)},void 0)}),void 0)}}),void 0)]}),void 0)};var m=b},6150:function(e,n,t){t.d(n,{Checkbox:function(){return a}});var i=t(7712),o=t(9297),r=function(){return r=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},r.apply(this,arguments)},a=function(e){var n=e.className,t=void 0===n?"":n,a=e.label,c=void 0===a?"":a,s=e.size,l=void 0===s?"large":s,u=e.disabled,d=void 0!==u&&u,f=e.indeterminate,v=void 0!==f&&f,p=e.onChange,h=(0,o.useState)(!1),x=h[0],b=h[1];(0,o.useEffect)((function(){void 0!==e.defaultChecked&&b(e.defaultChecked)}),[]),(0,o.useEffect)((function(){void 0!==e.checked&&b(e.checked)}),[e.checked]);var m;return(0,i.jsxs)("label",r({className:(m="paraui-check-box",t&&(m+=" "+t),l&&(m+=" check-box-"+l),d&&(m+=" check-box-disabled"),v?m+=" check-box-indeterminate":x&&(m+=" check-box-checked"),m),onClick:function(n){if(n.preventDefault(),!d){if(v)return void 0===e.checked&&b(!0),void(p&&p(n,!0));void 0===e.checked&&b(!x),n.target.checked=!x,n.target.value=!x,p&&p(n,!x)}}},{children:[(0,i.jsxs)("span",r({className:"paraui-checkbox-box"},{children:[(0,i.jsx)("input",r({type:"checkbox",value:x},e.inputProps),void 0),(0,i.jsx)("span",{className:"paraui-checkbox-box-inner"},void 0)]}),void 0),c&&(0,i.jsx)("span",r({className:"paraui-check-box-label"},{children:c}),void 0)]}),void 0)}},7785:function(e,n,t){t.d(n,{Search:function(){return f}});var i=t(7712),o=t(9297),r=t(3672),a=t(2990),c=t(6088),s=t.n(c),l=t(4115),u=t.n(l),d=function(){return d=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},d.apply(this,arguments)},f=function(e){var n=e.className,t=void 0===n?"":n,c=e.size,l=void 0===c?"large":c,f=e.btnType,v=void 0===f?"outside":f,p=e.showBtn,h=void 0===p||p,x=e.btnIcon,b=e.btnText,m=void 0===b?"":b,g=e.placeholder,j=void 0===g?"":g,y=(e.defaultValue,e.value),k=e.rightIcon,O=e.showRightIcon,w=void 0===O||O,C=e.onChange,S=e.onBlur,N=e.onFocus,P=e.onKeydown,E=e.onKeyUp,I=e.onClickBtn,T=e.onClickRightIcon,q=e.onEnter,L=(0,o.useState)(""),F=L[0],R=L[1];(0,o.useEffect)((function(){void 0!==e.defaultValue&&R(e.defaultValue)}),[]),(0,o.useEffect)((function(){void 0!==y&&R(y)}),[y]);var B,_=function(){return x||(0,i.jsx)(u(),{},void 0)},A=function(){I&&I(F)};return(0,i.jsxs)("div",d({className:(B="paraui-search",t&&(B+=" "+t),l&&(B+=" search-"+l),v&&(B+=" search-"+v),h&&(B+=" search-showbtn"),m&&(B+=" search-btntext"),B)},{children:[(0,i.jsx)(r.default,{size:l,placeholder:j,value:F,rightIcon:w?k||(0,i.jsx)(s(),{},void 0):"",onClickIcon:function(){T&&T(F)},onChange:function(n){var t=n.target.value;void 0===e.value&&R(t),C&&C(t,n)},onBlur:S,onFocus:N,onKeydown:P,onKeyUp:E,onEnter:q,addonAfter:function(){if(h&&"inside"===v)return(0,i.jsx)(a.default,d({size:l,startIcon:_(),variant:"outlined",onClick:A},{children:m}),void 0)}()},void 0),h&&"outside"===v&&(0,i.jsx)(a.default,d({size:l,startIcon:_(),variant:"contained",onClick:A},{children:m}),void 0)]}),void 0)}},3672:function(e,n,t){var i=t(7712),o=t(9297),r=t(1731),a=t(3094),c=t(8528),s=t.n(c),l=t(6570),u=t.n(l),d=t(1102),f=t.n(d),v=t(3475),p=function(){return p=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},p.apply(this,arguments)},h=function(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)n.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(t[i[o]]=e[i[o]])}return t};n.default=function(e){var n=e.className,t=e.size,c=void 0===t?"large":t,l=e.labelMode,d=void 0===l?"outside":l,x=e.placeholder,b=void 0===x?"":x,m=e.label,g=void 0===m?"":m,j=e.disabled,y=void 0!==j&&j,k=e.multiline,O=void 0!==k&&k,w=e.required,C=void 0!==w&&w,S=e.labelSign,N=e.rows,P=void 0===N?2:N,E=e.error,I=void 0!==E&&E,T=e.helperText,q=void 0===T?"":T,L=e.addonBefore,F=void 0===L?"":L,R=e.addonAfter,B=void 0===R?"":R,_=(e.defaultValue,e.value),A=e.autoFocus,z=void 0!==A&&A,D=e.type,M=void 0===D?"text":D,U=e.onClickIcon,K=e.rightIcon,Z=e.showRightIcon,V=void 0===Z||Z,W=e.limitLength,H=e.fetchSuggestions,J=e.selectPopoverClass,$=e.renderSelectItem,G=e.showSelectName,Y=void 0===G?"value":G,Q=e.onBlur,X=e.onFocus,ee=e.onChange,ne=e.onKeydown,te=e.onKeyUp,ie=e.onEnter,oe=e.onClickAddonBefore,re=e.onClickAddonAfter,ae=e.onSelect,ce=h(e,["className","size","labelMode","placeholder","label","disabled","multiline","required","labelSign","rows","error","helperText","addonBefore","addonAfter","defaultValue","value","autoFocus","type","onClickIcon","rightIcon","showRightIcon","limitLength","fetchSuggestions","selectPopoverClass","renderSelectItem","showSelectName","onBlur","onFocus","onChange","onKeydown","onKeyUp","onEnter","onClickAddonBefore","onClickAddonAfter","onSelect"]),se=(0,o.useState)("text-field-select-content-"+(0,v.UUID)())[0],le=(0,o.useState)(!0),ue=le[0],de=le[1],fe=(0,o.useState)(""),ve=fe[0],pe=fe[1],he=(0,o.useState)(!1),xe=he[0],be=he[1],me=(0,o.useState)("text"),ge=me[0],je=me[1],ye=(0,o.useState)(!1),ke=ye[0],Oe=ye[1],we=(0,o.useState)(!1),Ce=we[0],Se=we[1],Ne=(0,o.useState)([]),Pe=Ne[0],Ee=Ne[1],Ie=(0,o.useRef)(null),Te=(0,o.useRef)(null);(0,o.useEffect)((function(){void 0!==e.defaultValue&&(pe(e.defaultValue),Le(e.defaultValue))}),[]),(0,o.useEffect)((function(){M!==ge&&je(M)}),[M]),(0,o.useEffect)((function(){void 0!==_&&(pe(_),Le(_))}),[_]),(0,o.useEffect)((function(){de(""===ve||void 0===ve)}),[ve]),(0,o.useEffect)((function(){H&&Oe(xe)}),[xe,H]),(0,o.useEffect)((function(){return ke?window.addEventListener("keydown",_e):window.removeEventListener("keydown",_e),function(){window.removeEventListener("keydown",_e)}}),[ke]);var qe,Le=function(e){Ie&&Ie.current&&(Ie.current.value=e,Ie.current.setAttribute("value",e))},Fe=function(){y||(de(!1),(Ie&&Ie.current).focus())},Re=function(e){var n=e.selectDom,t=e.keyCode,i=e.currentDom,o="nextSibling",r=".text-field-select-content-item";38===t&&(o="previousSibling",r=".text-field-select-content-item:last-child"),i?(i=i[o])||(i=n.querySelector(r)):i=n.querySelector(".text-field-select-content-item"),i&&(i.classList.add("text-field-select-content-item-keydown"),Be(i,n))},Be=function(e,n){var t=n.clientHeight,i=e.offsetTop+e.clientHeight-t;n.scrollTop=i>0?i:0},_e=function(e){var n=document.querySelector("."+se),t=null,i=n.querySelector(".text-field-select-content-item-keydown");if(13===e.keyCode&&i){var o=i.dataset.val;We(JSON.parse(o))(e),(Ie&&Ie.current).blur()}i&&(t=i,i.classList.remove("text-field-select-content-item-keydown")),40===e.keyCode&&Re({selectDom:n,keyCode:e.keyCode,currentDom:t}),38===e.keyCode&&Re({selectDom:n,keyCode:e.keyCode,currentDom:t})},Ae=function(e){be(!1),""===e.target.value&&de(!0),Q&&Q(e)},ze=function(e){Se(!0),H&&H(e,(function(e){Ee(e||[]),Se(!1)}))},De=function(e){be(!0),X&&X(e),ze(e.target.value)},Me=function(n){var t=n.target.value;t&&de(!1),W&&void 0!==t&&""!==t&&t.toString().length>W||(void 0===e.value&&(pe(t),Le(t)),ee&&ee(n),ze(n.target.value))},Ue=function(e){13===e.keyCode&&ie&&ie(e),ne&&ne(e)},Ke=function(e){te&&te(e)},Ze=function(e){"password"===M&&("text"===ge&&je("password"),"password"===ge&&je("text")),U&&U(e)},Ve=function(){Oe(!1)},We=function(e){return function(n){ae&&ae(e)}},He=(0,o.useMemo)((function(){return(0,i.jsx)(i.Fragment,{children:void 0!==W&&(0,i.jsx)("span",p({className:"length-limit"},{children:(ve?ve.toString().length:0)+"/"+W}),void 0)},void 0)}),[W,ve]),Je=(0,o.useMemo)((function(){var e=K||("password"===M?"password"===ge?(0,i.jsx)(u(),{},void 0):(0,i.jsx)(s(),{},void 0):null);return(0,i.jsx)(i.Fragment,{children:V&&e&&(0,i.jsx)("span",p({className:"right-icon",onClick:Ze},{children:e}),void 0)},void 0)}),[V,K,M,ge]),$e=(0,o.useMemo)((function(){return(0,i.jsxs)("div",p({className:"text-field-content-within",ref:Te},{children:[(0,i.jsxs)("div",p({className:"text-field-content-within-input"},{children:[O?(0,i.jsx)("textarea",p({ref:Ie,rows:P,onBlur:Ae,onFocus:De,onChange:Me,onKeyDown:Ue,onKeyUp:Ke,disabled:y},ce),void 0):(0,i.jsx)("input",p({ref:Ie,type:ge,onBlur:Ae,onFocus:De,onChange:Me,onKeyDown:Ue,onKeyUp:Ke,disabled:y},ce),void 0),ue&&(0,i.jsx)("span",p({className:"text-field-label-placeholder",onClick:Fe},{children:"outside"===d?b:(0,i.jsxs)(i.Fragment,{children:[g||b,C&&(0,i.jsx)("span",p({className:"text-field-required"},{children:"*"}),void 0),S&&(0,i.jsx)("span",{children:S},void 0)]},void 0)}),void 0)]}),void 0),He,Je]}),void 0)}),[ue,z,ge,ve,He,Je,d,b,g,y,O,P,ce,ee,H]),Ge=(0,o.useMemo)((function(){var e;return(0,i.jsxs)("div",p({className:(e="text-field-select-content",Ce&&(e+=" text-field-select-content-loading"),se&&(e+=" "+se),e),style:{width:(Te&&Te.current?Te.current.offsetWidth:0)+"px"}},{children:[Pe&&Pe.map((function(e,n){return(0,i.jsx)("div",p({className:"text-field-select-content-item",onMouseDown:We(e),"data-val":JSON.stringify(e)},{children:$?$(e):(0,i.jsx)(a.default,{children:e[Y]},void 0)}),n)})),Ce&&(0,i.jsx)("div",p({className:"loading-box"},{children:(0,i.jsx)(f(),{},void 0)}),void 0)]}),void 0)}),[Te,ke,Pe,$,Y,ae,Ce,se]),Ye=(0,o.useMemo)((function(){return(0,i.jsx)(r.Tooltip,p({open:ke,title:Ge,onClose:Ve,interactive:!0,disableFocusListener:!0,disableHoverListener:!0,disableTouchListener:!0,arrow:!0,classes:{popper:(e="paraui-text-field-select",c&&(e+=" paraui-text-field-select-"+c),J&&(e+=" "+J),e)}},{children:$e}),void 0);var e}),[ue,z,ge,ve,He,Je,d,b,g,y,O,P,ce,ee,H,ae,Te,ke,J,c]),Qe=(0,o.useMemo)((function(){var e=Boolean(C||S||g);return(0,i.jsx)(i.Fragment,{children:"outside"===d&&e&&(0,i.jsxs)("label",p({className:"text-field-label"},{children:[g,C&&(0,i.jsx)("span",p({className:"text-field-required"},{children:"*"}),void 0),S&&(0,i.jsx)("span",{children:S},void 0)]}),void 0)},void 0)}),[d,g,S,C]);return(0,i.jsxs)("div",p({className:(qe="paraui-text-field",qe+=" text-field",c&&!O&&(qe+=" text-field-"+c),n&&(qe+=" "+n),I&&(qe+=" text-field-error"),xe&&(qe+=" text-field-focus"),y&&(qe+=" text-field-disabled"),O&&(qe+=" text-field-multiline"),qe)},{children:[Qe,(0,i.jsxs)("div",p({className:"text-field-content"},{children:[F&&(0,i.jsx)("div",p({className:"text-field-content-before",onClick:function(e){oe&&oe(e)}},{children:F}),void 0),H?Ye:$e,B&&(0,i.jsx)("div",p({className:"text-field-content-after",onClick:function(e){re&&re(e)}},{children:B}),void 0)]}),void 0),q&&(0,i.jsx)("p",p({className:"text-field-error-text"},{children:q}),void 0)]}),void 0)}},6885:function(e,n,t){var i=t(7712),o=t(1731),r=t(4927),a=function(){return a=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},a.apply(this,arguments)};n.default=function(e){var n,t=a(a({},e.classes),{popper:(0,r.Z)("paraui-tooltip",null===(n=e.classes)||void 0===n?void 0:n.popper)});return(0,i.jsx)(o.Tooltip,a({},e,{classes:t},{children:e.children}),void 0)}},1596:function(e,n,t){t.r(n),t.d(n,{Transfer:function(){return h}});var i=t(7712),o=t(9297),r=t(6150),a=t(7785),c=t(4115),s=t.n(c),l=t(1127),u=t.n(l),d=t(6288),f=t.n(d),v=function(){return v=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},v.apply(this,arguments)},p=function(e,n,t){if(t||2===arguments.length)for(var i,o=0,r=n.length;o<r;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return e.concat(i||Array.prototype.slice.call(n))},h=function(e){var n=e.data,t=void 0===n?[]:n,c=e.value,l=void 0===c?[]:c,d=e.onChange,h=e.titles,x=void 0===h?["左侧","右侧"]:h,b=(0,o.useState)(t),m=b[0],g=b[1],j=(0,o.useState)(l),y=j[0],k=j[1],O=(0,o.useState)(""),w=O[0],C=O[1],S=(0,o.useState)(""),N=S[0],P=S[1],E=(0,o.useState)(0),I=E[0],T=E[1],q=(0,o.useState)(0),L=q[0],F=q[1],R=(0,o.useState)(""),B=R[0],_=R[1],A=(0,o.useState)(""),z=A[0],D=A[1],M=(0,o.useCallback)((function(e,n,t,i){"left"===i?(m[t].checked=e.target.checked,g(p([],m,!0))):(y[t].checked=e.target.checked,k(p([],y,!0)))}),[m,y]),U=(0,o.useCallback)((function(e,n){"left"===n?(m.forEach((function(n){n.checked=e.target.checked})),g(p([],m,!0))):(y.forEach((function(n){n.checked=e.target.checked})),k(p([],y,!0))),console.log(e.target.checked),C(e.target.checked)}),[m,y]),K=(0,o.useCallback)((function(e){"left"===e?p([],y,!0).forEach((function(e){e.checked&&(e.checked=!1,m.push(e),y.splice(y.indexOf(e),1))})):p([],m,!0).forEach((function(e){e.checked&&(e.checked=!1,y.push(e),m.splice(m.indexOf(e),1))})),g(p([],m,!0)),k(p([],y,!0)),d&&d(y)}),[]),Z=(0,o.useCallback)((function(e,n){var t=p(p([""],e,!0),[""],!1).join(".*"),i=new RegExp(t),o=[];"left"===n?(o=m.filter((function(e){return i.test(e.name)||i.test(e.description)})),g(o)):(o=y.filter((function(e){return i.test(e.name)||i.test(e.description)})),k(o))}),[]);return(0,o.useEffect)((function(){var e=m.filter((function(e){return e.checked}));T(e.length),e.length&&e.length!==m.length?(C("indeterminate"),D("on")):e.length&&e.length===m.length?(C("checked"),D("on")):(C(""),D(""));var n=y.filter((function(e){return e.checked}));F(n.length),n.length&&n.length!==y.length?(P("indeterminate"),_("on")):n.length&&n.length===y.length?(P("checked"),_("on")):(P(""),_(""))}),[m,y]),(0,i.jsxs)("div",v({className:"transfer"},{children:[(0,i.jsxs)("div",v({className:"box"},{children:[(0,i.jsxs)("div",v({className:"box-header"},{children:[(0,i.jsx)(r.Checkbox,{label:x[0],size:"medium",checked:"checked"===w,indeterminate:"indeterminate"===w,onChange:function(e){U(e,"left")}},1),(0,i.jsxs)("div",v({className:"count"},{children:[I,"/",m.length]}),void 0)]}),void 0),(0,i.jsx)(a.Search,{btnType:"inside",placeholder:"请输入搜索内容",showBtn:!1,rightIcon:(0,i.jsx)(s(),{},void 0),onChange:function(e){Z(e,"left")}},void 0),(0,i.jsx)("div",v({className:"context"},{children:m.map((function(e,n){return(0,i.jsx)("div",v({className:"item"},{children:(0,i.jsx)(r.Checkbox,{label:e.name,size:"medium",checked:e.checked,disabled:e.disabled,onChange:function(e,t){M(e,t,n,"left")}},void 0)}),e.name)}))}),void 0)]}),void 0),(0,i.jsxs)("div",v({className:"moveBtn"},{children:[(0,i.jsx)("div",v({className:"btn "+B,onClick:function(){K("left")}},{children:(0,i.jsx)(u(),{},void 0)}),void 0),(0,i.jsx)("div",v({className:"btn "+z,onClick:function(){K("right")}},{children:(0,i.jsx)(f(),{},void 0)}),void 0)]}),void 0),(0,i.jsxs)("div",v({className:"box"},{children:[(0,i.jsxs)("div",v({className:"box-header"},{children:[(0,i.jsx)(r.Checkbox,{label:x[1],size:"medium",checked:"checked"===N,indeterminate:"indeterminate"===N,onChange:function(e){U(e,"right")}},void 0),(0,i.jsxs)("div",v({className:"count"},{children:[L,"/",y.length]}),void 0)]}),void 0),(0,i.jsx)(a.Search,{btnType:"inside",placeholder:"请输入搜索内容",showBtn:!1,rightIcon:(0,i.jsx)(s(),{},void 0),onChange:function(e){Z(e,"right")}},void 0),(0,i.jsx)("div",v({className:"context"},{children:y.map((function(e,n){return(0,i.jsx)("div",v({className:"item"},{children:(0,i.jsx)(r.Checkbox,{label:e.name,size:"medium",checked:e.checked,disabled:e.disabled,onChange:function(e,t){M(e,t,n,"right")}},void 0)}),e.name)}))}),void 0)]}),void 0)]}),void 0)};n.default=h},1731:function(n){n.exports=e},6088:function(e){e.exports=n},6028:function(e){e.exports=t},2749:function(e){e.exports=i},1127:function(e){e.exports=o},1102:function(e){e.exports=r},6570:function(e){e.exports=a},8528:function(e){e.exports=c},6288:function(e){e.exports=s},4115:function(e){e.exports=l},3475:function(e){e.exports=u},9297:function(e){e.exports=d}},p={};function h(e){var n=p[e];if(void 0!==n)return n.exports;var t=p[e]={exports:{}};return v[e](t,t.exports,h),t.exports}h.m=v,f=[],h.O=function(e,n,t,i){if(!n){var o=1/0;for(c=0;c<f.length;c++){n=f[c][0],t=f[c][1],i=f[c][2];for(var r=!0,a=0;a<n.length;a++)(!1&i||o>=i)&&Object.keys(h.O).every((function(e){return h.O[e](n[a])}))?n.splice(a--,1):(r=!1,i<o&&(o=i));r&&(f.splice(c--,1),e=t())}return e}i=i||0;for(var c=f.length;c>0&&f[c-1][2]>i;c--)f[c]=f[c-1];f[c]=[n,t,i]},h.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return h.d(n,{a:n}),n},h.d=function(e,n){for(var t in n)h.o(n,t)&&!h.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},h.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},h.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e={1852:0,1465:0,6615:0,7056:0,3708:0,2996:0,2823:0,9296:0};h.O.j=function(n){return 0===e[n]};var n=function(n,t){var i,o,r=t[0],a=t[1],c=t[2],s=0;for(i in a)h.o(a,i)&&(h.m[i]=a[i]);if(c)var l=c(h);for(n&&n(t);s<r.length;s++)o=r[s],h.o(e,o)&&e[o]&&e[o][0](),e[r[s]]=0;return h.O(l)},t=self.webpackChunkParaUI=self.webpackChunkParaUI||[];t.forEach(n.bind(null,0)),t.push=n.bind(null,t.push.bind(t))}();var x=h.O(void 0,[9296],(function(){return h(1596)}));return x=h.O(x)}()}));
|
|
16
|
+
t(4126);var i=t(9297),o=60103;if(n.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var r=Symbol.for;o=r("react.element"),n.Fragment=r("react.fragment")}var a=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c=Object.prototype.hasOwnProperty,s={key:!0,ref:!0,__self:!0,__source:!0};function l(e,n,t){var i,r={},l=null,u=null;for(i in void 0!==t&&(l=""+t),void 0!==n.key&&(l=""+n.key),void 0!==n.ref&&(u=n.ref),n)c.call(n,i)&&!s.hasOwnProperty(i)&&(r[i]=n[i]);if(e&&e.defaultProps)for(i in n=e.defaultProps)void 0===r[i]&&(r[i]=n[i]);return{$$typeof:o,type:e,key:l,ref:u,props:r,_owner:a.current}}n.jsx=l,n.jsxs=l},7712:function(e,n,t){e.exports=t(9524)},3094:function(e,n,t){var i=t(7712),o=t(9297),r=t(6885),a=function(){return a=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},a.apply(this,arguments)};n.default=function(e){var n=e.children,t=e.placement,c=void 0===t?"bottom-start":t,s=e.tips,l=void 0===s?"":s,u=e.className,d=void 0===u?"":u,f=(0,o.useRef)(),v=(0,o.useState)(""),p=v[0],h=v[1];(0,o.useEffect)((function(){h(l)}),[l]);var x;return(0,i.jsx)("div",a({ref:function(e){e&&(f.current=e)},className:(x="paraui-auto-tips",d&&(x+=" "+d),x),onMouseOver:function(){f.current.scrollWidth>f.current.offsetWidth?h(p||f.current.innerText):h("")}},{children:(0,i.jsx)(r.default,a({title:p,placement:c},{children:(0,i.jsx)("div",a({className:"auto-tips-content"},{children:n}),void 0)}),void 0)}),void 0)}},2990:function(e,n,t){t.d(n,{default:function(){return g}});var i=t(7712),o=t(9297),r=t(1731),a=t(4927),c=t(1102),s=t.n(c),l=t(2749),u=t.n(l),d=t(6885),f=t(6028),v=t.n(f),p=function(){return p=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},p.apply(this,arguments)};var h=function(){return h=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},h.apply(this,arguments)},x=function(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)n.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(t[i[o]]=e[i[o]])}return t},b=function(e){var n=e.variant,t=void 0===n?"contained":n,c=e.size,l=void 0===c?"large":c,f=e.className,v=e.disabled,p=void 0!==v&&v,b=e.children,g=e.startIcon,m=e.endIcon,j=e.loading,y=void 0!==j&&j,k=e.toolTipTitle,O=void 0===k?"":k,w=e.danger,C=void 0!==w&&w,N=x(e,["variant","size","className","disabled","children","startIcon","endIcon","loading","toolTipTitle","danger"]),S=(0,o.useState)(!1),P=S[0],E=S[1],I=function(e){if(!P)return"start"===e&&g?(0,i.jsx)("span",h({className:(0,a.Z)("btn-icon","start-icon")},{children:g}),void 0):"end"===e&&m?(0,i.jsx)("span",h({className:(0,a.Z)("btn-icon","end-icon")},{children:m}),void 0):null;if("object"==typeof y){var n=y.delay||0;setTimeout((function(){return E(!1)}),n)}return"start"===e?(0,i.jsx)("span",h({className:"btn-icon loading-icon"},{children:(0,i.jsx)(s(),{},void 0)}),void 0):null},T=(0,i.jsx)(r.Button,h({},N,{color:"default",variant:"contained",disabled:p,disableRipple:!0,disableElevation:!0,className:(0,a.Z)("paraui-button",f,"paraui-button-".concat(t),"paraui-button-".concat(l),P&&"paraui-button-loading",C&&!p&&"paraui-button-dangerous"),startIcon:I("start"),endIcon:I("end")},{children:b}),void 0);return(0,o.useEffect)((function(){E(!!y)}),[y]),p&&O?(0,i.jsx)(d.default,h({title:function(){if(p&&O){return(0,i.jsxs)("span",{children:[(0,i.jsx)(u(),{style:{marginRight:"4px",fontSize:"11px",color:"inherit"}},void 0),O]},void 0)}return O}()},{children:(0,i.jsx)("span",h({className:"paraui-button--disabled"},{children:T}),void 0)}),void 0):T};b.IconButton=function(e){var n=e.variant,t=void 0===n?"contained":n,c=e.size,l=void 0===c?"large":c,f=e.toolTipTitle,v=void 0===f?"":f,p=e.children,b=e.className,g=e.disabled,m=void 0!==g&&g,j=e.loading,y=void 0!==j&&j,k=e.TooltipProps,O=e.danger,w=void 0!==O&&O,C=x(e,["variant","size","toolTipTitle","children","className","disabled","loading","TooltipProps","danger"]),N=(0,o.useState)(!1),S=N[0],P=N[1],E=(0,i.jsx)(r.IconButton,h({},C,{disabled:m,disableRipple:!0,className:(0,a.Z)("paraui-icon-button",b,"paraui-icon-button-".concat(t),"paraui-icon-button-".concat(l),S&&"paraui-icon-button-loading",w&&!m&&"paraui-icon-button-dangerous")},{children:function(){if(!S)return p;if("object"==typeof y){var e=y.delay||0;setTimeout((function(){return P(!1)}),e)}return(0,i.jsx)("span",h({className:"loading-icon"},{children:(0,i.jsx)(s(),{},void 0)}),void 0)}()}),void 0);return(0,o.useEffect)((function(){P(!!y)}),[y]),v?(0,i.jsx)(d.default,h({},k,{title:function(){if(m&&v){return(0,i.jsxs)("span",{children:[(0,i.jsx)(u(),{style:{marginRight:"4px",fontSize:"11px",color:"inherit"}},void 0),v]},void 0)}return v}()},{children:m?(0,i.jsx)("span",h({className:"paraui-button--disabled"},{children:E}),void 0):E}),void 0):E},b.SplitButton=function(e){var n=e.buttonText,t=e.options,c=void 0===t?[]:t,s=e.className,l=e.disabled,u=void 0!==l&&l,d=e.onClick,f=e.optionRender,h=(0,o.useState)(!1),x=h[0],b=h[1],m=(0,o.useRef)(null),j=(0,o.useRef)(),y=(0,o.useState)(0),k=y[0],O=y[1],w=function(e,n,t){var i;O(n),b(!1),null===(i=j.current)||void 0===i||i.classList.remove("paraui-button-split--active"),null==d||d(e,t)},C=function(e){var n,t;(null===(n=m.current)||void 0===n?void 0:n.contains(e.target))||(b(!1),null===(t=j.current)||void 0===t||t.classList.remove("paraui-button-split--active"))},N=function(){return(0,i.jsx)("div",p({className:"paraui-button-split-list"},{children:(0,i.jsx)("ul",{children:c.map((function(e,n){return Array.isArray(e)?function(e,n){return(0,i.jsx)("li",p({className:"split-li-group"},{children:e.map((function(e,t){var o="".concat(n,"-").concat(t);return(0,i.jsx)("div",p({className:(0,a.Z)("split-li",o===k&&"split-li--active"),onClick:function(n){return w(e,o,n)}},{children:(null==f?void 0:f(e))||e.label}),o)}))}),n)}(e,n):(0,i.jsx)("li",p({className:(0,a.Z)("split-li",n===k&&"split-li--active"),onClick:function(t){return w(e,n,t)}},{children:(null==f?void 0:f(e))||e.label}),n)}))},void 0)}),void 0)};return(0,i.jsxs)("div",p({className:(0,a.Z)("paraui-button-split",s),ref:m,onMouseLeave:function(e){var n;e.stopPropagation(),null===(n=e.currentTarget.firstElementChild)||void 0===n||n.classList.remove("paraui-button-split--active"),b(!1)}},{children:[(0,i.jsx)(g,p({variant:"outlined",onMouseEnter:function(e){e.stopPropagation();var n=e.currentTarget;j.current=n,n.classList.add("paraui-button-split--active"),b(!0)},startIcon:(0,i.jsx)(v(),{},void 0),disabled:u},{children:null!=n?n:"更多操作"}),void 0),(0,i.jsx)(r.Popper,p({open:x,anchorEl:m.current,transition:!0,placement:"bottom-end"},{children:function(e){var n=e.TransitionProps;e.placement;return(0,i.jsx)(r.Grow,p({},n,{children:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(r.ClickAwayListener,p({onClickAway:C},{children:N()}),void 0)},void 0)}),void 0)}}),void 0)]}),void 0)};var g=b},6150:function(e,n,t){t.d(n,{Checkbox:function(){return a}});var i=t(7712),o=t(9297),r=function(){return r=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},r.apply(this,arguments)},a=function(e){var n=e.className,t=void 0===n?"":n,a=e.label,c=void 0===a?"":a,s=e.size,l=void 0===s?"large":s,u=e.disabled,d=void 0!==u&&u,f=e.indeterminate,v=void 0!==f&&f,p=e.onChange,h=(0,o.useState)(!1),x=h[0],b=h[1];(0,o.useEffect)((function(){void 0!==e.defaultChecked&&b(e.defaultChecked)}),[]),(0,o.useEffect)((function(){void 0!==e.checked&&b(e.checked)}),[e.checked]);var g;return(0,i.jsxs)("label",r({className:(g="paraui-check-box",t&&(g+=" "+t),l&&(g+=" check-box-"+l),d&&(g+=" check-box-disabled"),v?g+=" check-box-indeterminate":x&&(g+=" check-box-checked"),g),onClick:function(n){if(n.preventDefault(),!d){if(v)return void 0===e.checked&&b(!0),void(p&&p(n,!0));void 0===e.checked&&b(!x),n.target.checked=!x,n.target.value=!x,p&&p(n,!x)}}},{children:[(0,i.jsxs)("span",r({className:"paraui-checkbox-box"},{children:[(0,i.jsx)("input",r({type:"checkbox",value:x},e.inputProps),void 0),(0,i.jsx)("span",{className:"paraui-checkbox-box-inner"},void 0)]}),void 0),c&&(0,i.jsx)("span",r({className:"paraui-check-box-label"},{children:c}),void 0)]}),void 0)}},9011:function(e,n,t){var i=t(7712),o=t(9297),r=t(1102),a=t.n(r),c=function(){return c=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},c.apply(this,arguments)};n.default=function(e){var n=e.className,t=e.style,r=e.opacity,s=void 0===r?.7:r,l=(0,o.useRef)(null);(0,o.useEffect)((function(){l&&l.current&&l.current.parentNode&&((getComputedStyle(l.current.parentNode)||{}).position||(l.current.parentNode.style.position="relative"))}),[]);var u;return(0,i.jsxs)("div",c({className:(u="paraui-loading",n&&(u+=" "+n),u),style:t,ref:l},{children:[(0,i.jsx)("div",c({className:"paraui-loading-box"},{children:(0,i.jsx)(a(),{},void 0)}),void 0),(0,i.jsx)("div",{className:"paraui-loading-mask",style:{opacity:s}},void 0)]}),void 0)}},7785:function(e,n,t){t.d(n,{Search:function(){return f}});var i=t(7712),o=t(9297),r=t(3672),a=t(2990),c=t(6088),s=t.n(c),l=t(4115),u=t.n(l),d=function(){return d=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},d.apply(this,arguments)},f=function(e){var n=e.className,t=void 0===n?"":n,c=e.size,l=void 0===c?"large":c,f=e.btnType,v=void 0===f?"outside":f,p=e.showBtn,h=void 0===p||p,x=e.btnIcon,b=e.btnText,g=void 0===b?"":b,m=e.placeholder,j=void 0===m?"":m,y=(e.defaultValue,e.value),k=e.rightIcon,O=e.showRightIcon,w=void 0===O||O,C=e.onChange,N=e.onBlur,S=e.onFocus,P=e.onKeydown,E=e.onKeyUp,I=e.onClickBtn,T=e.onClickRightIcon,q=e.onEnter,L=(0,o.useState)(""),F=L[0],R=L[1];(0,o.useEffect)((function(){void 0!==e.defaultValue&&R(e.defaultValue)}),[]),(0,o.useEffect)((function(){void 0!==y&&R(y)}),[y]);var B,_=function(){return x||(0,i.jsx)(u(),{},void 0)},A=function(){I&&I(F)};return(0,i.jsxs)("div",d({className:(B="paraui-search",t&&(B+=" "+t),l&&(B+=" search-"+l),v&&(B+=" search-"+v),h&&(B+=" search-showbtn"),g&&(B+=" search-btntext"),B)},{children:[(0,i.jsx)(r.default,{size:l,placeholder:j,value:F,rightIcon:w?k||(0,i.jsx)(s(),{},void 0):"",onClickIcon:function(){T&&T(F)},onChange:function(n){var t=n.target.value;void 0===e.value&&R(t),C&&C(t,n)},onBlur:N,onFocus:S,onKeydown:P,onKeyUp:E,onEnter:q,addonAfter:function(){if(h&&"inside"===v)return(0,i.jsx)(a.default,d({size:l,startIcon:_(),variant:"outlined",onClick:A},{children:g}),void 0)}()},void 0),h&&"outside"===v&&(0,i.jsx)(a.default,d({size:l,startIcon:_(),variant:"contained",onClick:A},{children:g}),void 0)]}),void 0)}},3672:function(e,n,t){var i=t(7712),o=t(9297),r=t(1731),a=t(3094),c=t(9011),s=t(8528),l=t.n(s),u=t(6570),d=t.n(u),f=t(3475),v=function(){return v=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},v.apply(this,arguments)},p=function(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)n.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(t[i[o]]=e[i[o]])}return t};n.default=function(e){var n=e.className,t=e.size,s=void 0===t?"large":t,u=e.labelMode,h=void 0===u?"outside":u,x=e.placeholder,b=void 0===x?"":x,g=e.label,m=void 0===g?"":g,j=e.disabled,y=void 0!==j&&j,k=e.multiline,O=void 0!==k&&k,w=e.required,C=void 0!==w&&w,N=e.labelSign,S=e.rows,P=void 0===S?2:S,E=e.error,I=void 0!==E&&E,T=e.helperText,q=void 0===T?"":T,L=e.addonBefore,F=void 0===L?"":L,R=e.addonAfter,B=void 0===R?"":R,_=(e.defaultValue,e.value),A=e.autoFocus,z=void 0!==A&&A,D=e.type,M=void 0===D?"text":D,U=e.onClickIcon,K=e.rightIcon,Z=e.showRightIcon,V=void 0===Z||Z,W=e.limitLength,H=e.fetchSuggestions,J=e.selectPopoverClass,$=e.renderSelectItem,G=e.showSelectName,Y=void 0===G?"value":G,Q=e.onBlur,X=e.onFocus,ee=e.onChange,ne=e.onKeydown,te=e.onKeyUp,ie=e.onEnter,oe=e.onClickAddonBefore,re=e.onClickAddonAfter,ae=e.onSelect,ce=p(e,["className","size","labelMode","placeholder","label","disabled","multiline","required","labelSign","rows","error","helperText","addonBefore","addonAfter","defaultValue","value","autoFocus","type","onClickIcon","rightIcon","showRightIcon","limitLength","fetchSuggestions","selectPopoverClass","renderSelectItem","showSelectName","onBlur","onFocus","onChange","onKeydown","onKeyUp","onEnter","onClickAddonBefore","onClickAddonAfter","onSelect"]),se=(0,o.useState)("text-field-select-content-"+(0,f.UUID)())[0],le=(0,o.useState)(!0),ue=le[0],de=le[1],fe=(0,o.useState)(""),ve=fe[0],pe=fe[1],he=(0,o.useState)(!1),xe=he[0],be=he[1],ge=(0,o.useState)("text"),me=ge[0],je=ge[1],ye=(0,o.useState)(!1),ke=ye[0],Oe=ye[1],we=(0,o.useState)(!1),Ce=we[0],Ne=we[1],Se=(0,o.useState)([]),Pe=Se[0],Ee=Se[1],Ie=(0,o.useRef)(null),Te=(0,o.useRef)(null);(0,o.useEffect)((function(){if(void 0!==e.defaultValue){var n=Le(e.defaultValue);pe(n),Fe(n)}}),[]),(0,o.useEffect)((function(){M!==me&&je(M)}),[M]),(0,o.useEffect)((function(){if(void 0!==_){var e=Le(_);pe(e),Fe(e)}}),[_]),(0,o.useEffect)((function(){de(""===ve||void 0===ve)}),[ve]),(0,o.useEffect)((function(){H&&Oe(xe)}),[xe,H]),(0,o.useEffect)((function(){return ke?window.addEventListener("keydown",Ae):window.removeEventListener("keydown",Ae),function(){window.removeEventListener("keydown",Ae)}}),[ke]);var qe,Le=function(n){var t=n;return e.limitLength&&n.toString().length>e.limitLength&&(t=t.toString().substr(0,e.limitLength)),t},Fe=function(e){Ie&&Ie.current&&(Ie.current.value=e,Ie.current.setAttribute("value",e))},Re=function(){y||(de(!1),(Ie&&Ie.current).focus())},Be=function(e){var n=e.selectDom,t=e.keyCode,i=e.currentDom,o="nextSibling",r=".text-field-select-content-item";38===t&&(o="previousSibling",r=".text-field-select-content-item:last-child"),i?(i=i[o])||(i=n.querySelector(r)):i=n.querySelector(".text-field-select-content-item"),i&&(i.classList.add("text-field-select-content-item-keydown"),_e(i,n))},_e=function(e,n){var t=n.clientHeight,i=e.offsetTop+e.clientHeight-t;n.scrollTop=i>0?i:0},Ae=function(e){var n=document.querySelector("."+se),t=null,i=n.querySelector(".text-field-select-content-item-keydown");if(13===e.keyCode&&i){var o=i.dataset.val;He(JSON.parse(o))(e),(Ie&&Ie.current).blur()}i&&(t=i,i.classList.remove("text-field-select-content-item-keydown")),40===e.keyCode&&Be({selectDom:n,keyCode:e.keyCode,currentDom:t}),38===e.keyCode&&Be({selectDom:n,keyCode:e.keyCode,currentDom:t})},ze=function(e){be(!1),""===e.target.value&&de(!0),Q&&Q(e)},De=function(e){Ne(!0),H&&H(e,(function(e){Ee(e||[]),Ne(!1)}))},Me=function(e){be(!0),X&&X(e),De(e.target.value)},Ue=function(n){var t=n.target.value;t&&de(!1),W&&void 0!==t&&""!==t&&t.toString().length>W?Fe(ve):(void 0===e.value&&(pe(t),Fe(t)),ee&&ee(n),De(n.target.value))},Ke=function(e){13===e.keyCode&&ie&&ie(e),ne&&ne(e)},Ze=function(e){te&&te(e)},Ve=function(e){"password"===M&&("text"===me&&je("password"),"password"===me&&je("text")),U&&U(e)},We=function(){Oe(!1)},He=function(e){return function(n){ae&&ae(e)}},Je=(0,o.useMemo)((function(){return(0,i.jsx)(i.Fragment,{children:void 0!==W&&(0,i.jsx)("span",v({className:"length-limit"},{children:(ve?ve.toString().length:0)+"/"+W}),void 0)},void 0)}),[W,ve]),$e=(0,o.useMemo)((function(){var e=K||("password"===M?"password"===me?(0,i.jsx)(d(),{},void 0):(0,i.jsx)(l(),{},void 0):null);return(0,i.jsx)(i.Fragment,{children:V&&e&&(0,i.jsx)("span",v({className:"right-icon",onClick:Ve},{children:e}),void 0)},void 0)}),[V,K,M,me]),Ge=(0,o.useMemo)((function(){return(0,i.jsxs)("div",v({className:"text-field-content-within",ref:Te},{children:[(0,i.jsxs)("div",v({className:"text-field-content-within-input"},{children:[O?(0,i.jsx)("textarea",v({ref:Ie,rows:P,onBlur:ze,onFocus:Me,onChange:Ue,onKeyDown:Ke,onKeyUp:Ze,disabled:y},ce),void 0):(0,i.jsx)("input",v({ref:Ie,type:me,onBlur:ze,onFocus:Me,onChange:Ue,onKeyDown:Ke,onKeyUp:Ze,disabled:y},ce),void 0),ue&&(0,i.jsx)("span",v({className:"text-field-label-placeholder",onClick:Re},{children:"outside"===h?b:(0,i.jsxs)(i.Fragment,{children:[m||b,C&&(0,i.jsx)("span",v({className:"text-field-required"},{children:"*"}),void 0),N&&(0,i.jsx)("span",{children:N},void 0)]},void 0)}),void 0)]}),void 0),Je,$e]}),void 0)}),[ue,z,me,ve,Je,$e,h,b,m,y,O,P,ce,ee,H]),Ye=(0,o.useMemo)((function(){var e;return(0,i.jsxs)("div",v({className:(e="text-field-select-content",Ce&&(e+=" text-field-select-content-loading"),se&&(e+=" "+se),e),style:{width:(Te&&Te.current?Te.current.offsetWidth:0)+"px"}},{children:[Pe&&Pe.map((function(e,n){return(0,i.jsx)("div",v({className:"text-field-select-content-item",onMouseDown:He(e),"data-val":JSON.stringify(e)},{children:$?$(e):(0,i.jsx)(a.default,{children:e[Y]},void 0)}),n)})),Ce&&(0,i.jsx)(c.default,{},void 0)]}),void 0)}),[Te,ke,Pe,$,Y,ae,Ce,se]),Qe=(0,o.useMemo)((function(){return(0,i.jsx)(r.Tooltip,v({open:ke,title:Ye,onClose:We,interactive:!0,disableFocusListener:!0,disableHoverListener:!0,disableTouchListener:!0,arrow:!0,classes:{popper:(e="paraui-text-field-select",s&&(e+=" paraui-text-field-select-"+s),J&&(e+=" "+J),e)}},{children:Ge}),void 0);var e}),[ue,z,me,ve,Je,$e,h,b,m,y,O,P,ce,ee,H,ae,Te,ke,J,s]),Xe=(0,o.useMemo)((function(){var e=Boolean(C||N||m);return(0,i.jsx)(i.Fragment,{children:"outside"===h&&e&&(0,i.jsxs)("label",v({className:"text-field-label"},{children:[m,C&&(0,i.jsx)("span",v({className:"text-field-required"},{children:"*"}),void 0),N&&(0,i.jsx)("span",{children:N},void 0)]}),void 0)},void 0)}),[h,m,N,C]);return(0,i.jsxs)("div",v({className:(qe="paraui-text-field",qe+=" text-field",s&&!O&&(qe+=" text-field-"+s),n&&(qe+=" "+n),I&&(qe+=" text-field-error"),xe&&(qe+=" text-field-focus"),y&&(qe+=" text-field-disabled"),O&&(qe+=" text-field-multiline"),qe)},{children:[Xe,(0,i.jsxs)("div",v({className:"text-field-content"},{children:[F&&(0,i.jsx)("div",v({className:"text-field-content-before",onClick:function(e){oe&&oe(e)}},{children:F}),void 0),H?Qe:Ge,B&&(0,i.jsx)("div",v({className:"text-field-content-after",onClick:function(e){re&&re(e)}},{children:B}),void 0)]}),void 0),q&&(0,i.jsx)("p",v({className:"text-field-error-text"},{children:q}),void 0)]}),void 0)}},6885:function(e,n,t){var i=t(7712),o=t(1731),r=t(4927),a=function(){return a=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},a.apply(this,arguments)};n.default=function(e){var n,t=a(a({},e.classes),{popper:(0,r.Z)("paraui-tooltip",null===(n=e.classes)||void 0===n?void 0:n.popper)});return(0,i.jsx)(o.Tooltip,a({},e,{classes:t},{children:e.children}),void 0)}},1596:function(e,n,t){t.r(n),t.d(n,{Transfer:function(){return h}});var i=t(7712),o=t(9297),r=t(6150),a=t(7785),c=t(4115),s=t.n(c),l=t(1127),u=t.n(l),d=t(6288),f=t.n(d),v=function(){return v=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},v.apply(this,arguments)},p=function(e,n,t){if(t||2===arguments.length)for(var i,o=0,r=n.length;o<r;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return e.concat(i||Array.prototype.slice.call(n))},h=function(e){var n=e.data,t=void 0===n?[]:n,c=e.value,l=void 0===c?[]:c,d=e.onChange,h=e.titles,x=void 0===h?["左侧","右侧"]:h,b=(0,o.useState)(t),g=b[0],m=b[1],j=(0,o.useState)(l),y=j[0],k=j[1],O=(0,o.useState)(""),w=O[0],C=O[1],N=(0,o.useState)(""),S=N[0],P=N[1],E=(0,o.useState)(0),I=E[0],T=E[1],q=(0,o.useState)(0),L=q[0],F=q[1],R=(0,o.useState)(""),B=R[0],_=R[1],A=(0,o.useState)(""),z=A[0],D=A[1],M=(0,o.useCallback)((function(e,n,t,i){"left"===i?(g[t].checked=e.target.checked,m(p([],g,!0))):(y[t].checked=e.target.checked,k(p([],y,!0)))}),[g,y]),U=(0,o.useCallback)((function(e,n){"left"===n?(g.forEach((function(n){n.checked=e.target.checked})),m(p([],g,!0))):(y.forEach((function(n){n.checked=e.target.checked})),k(p([],y,!0))),console.log(e.target.checked),C(e.target.checked)}),[g,y]),K=(0,o.useCallback)((function(e){"left"===e?p([],y,!0).forEach((function(e){e.checked&&(e.checked=!1,g.push(e),y.splice(y.indexOf(e),1))})):p([],g,!0).forEach((function(e){e.checked&&(e.checked=!1,y.push(e),g.splice(g.indexOf(e),1))})),m(p([],g,!0)),k(p([],y,!0)),d&&d(y)}),[]),Z=(0,o.useCallback)((function(e,n){var t=p(p([""],e,!0),[""],!1).join(".*"),i=new RegExp(t),o=[];"left"===n?(o=g.filter((function(e){return i.test(e.name)||i.test(e.description)})),m(o)):(o=y.filter((function(e){return i.test(e.name)||i.test(e.description)})),k(o))}),[]);return(0,o.useEffect)((function(){var e=g.filter((function(e){return e.checked}));T(e.length),e.length&&e.length!==g.length?(C("indeterminate"),D("on")):e.length&&e.length===g.length?(C("checked"),D("on")):(C(""),D(""));var n=y.filter((function(e){return e.checked}));F(n.length),n.length&&n.length!==y.length?(P("indeterminate"),_("on")):n.length&&n.length===y.length?(P("checked"),_("on")):(P(""),_(""))}),[g,y]),(0,i.jsxs)("div",v({className:"transfer"},{children:[(0,i.jsxs)("div",v({className:"box"},{children:[(0,i.jsxs)("div",v({className:"box-header"},{children:[(0,i.jsx)(r.Checkbox,{label:x[0],size:"medium",checked:"checked"===w,indeterminate:"indeterminate"===w,onChange:function(e){U(e,"left")}},1),(0,i.jsxs)("div",v({className:"count"},{children:[I,"/",g.length]}),void 0)]}),void 0),(0,i.jsx)(a.Search,{btnType:"inside",placeholder:"请输入搜索内容",showBtn:!1,rightIcon:(0,i.jsx)(s(),{},void 0),onChange:function(e){Z(e,"left")}},void 0),(0,i.jsx)("div",v({className:"context"},{children:g.map((function(e,n){return(0,i.jsx)("div",v({className:"item"},{children:(0,i.jsx)(r.Checkbox,{label:e.name,size:"medium",checked:e.checked,disabled:e.disabled,onChange:function(e,t){M(e,t,n,"left")}},void 0)}),e.name)}))}),void 0)]}),void 0),(0,i.jsxs)("div",v({className:"moveBtn"},{children:[(0,i.jsx)("div",v({className:"btn "+B,onClick:function(){K("left")}},{children:(0,i.jsx)(u(),{},void 0)}),void 0),(0,i.jsx)("div",v({className:"btn "+z,onClick:function(){K("right")}},{children:(0,i.jsx)(f(),{},void 0)}),void 0)]}),void 0),(0,i.jsxs)("div",v({className:"box"},{children:[(0,i.jsxs)("div",v({className:"box-header"},{children:[(0,i.jsx)(r.Checkbox,{label:x[1],size:"medium",checked:"checked"===S,indeterminate:"indeterminate"===S,onChange:function(e){U(e,"right")}},void 0),(0,i.jsxs)("div",v({className:"count"},{children:[L,"/",y.length]}),void 0)]}),void 0),(0,i.jsx)(a.Search,{btnType:"inside",placeholder:"请输入搜索内容",showBtn:!1,rightIcon:(0,i.jsx)(s(),{},void 0),onChange:function(e){Z(e,"right")}},void 0),(0,i.jsx)("div",v({className:"context"},{children:y.map((function(e,n){return(0,i.jsx)("div",v({className:"item"},{children:(0,i.jsx)(r.Checkbox,{label:e.name,size:"medium",checked:e.checked,disabled:e.disabled,onChange:function(e,t){M(e,t,n,"right")}},void 0)}),e.name)}))}),void 0)]}),void 0)]}),void 0)};n.default=h},1731:function(n){n.exports=e},6088:function(e){e.exports=n},6028:function(e){e.exports=t},2749:function(e){e.exports=i},1127:function(e){e.exports=o},1102:function(e){e.exports=r},6570:function(e){e.exports=a},8528:function(e){e.exports=c},6288:function(e){e.exports=s},4115:function(e){e.exports=l},3475:function(e){e.exports=u},9297:function(e){e.exports=d}},p={};function h(e){var n=p[e];if(void 0!==n)return n.exports;var t=p[e]={exports:{}};return v[e](t,t.exports,h),t.exports}h.m=v,f=[],h.O=function(e,n,t,i){if(!n){var o=1/0;for(c=0;c<f.length;c++){n=f[c][0],t=f[c][1],i=f[c][2];for(var r=!0,a=0;a<n.length;a++)(!1&i||o>=i)&&Object.keys(h.O).every((function(e){return h.O[e](n[a])}))?n.splice(a--,1):(r=!1,i<o&&(o=i));r&&(f.splice(c--,1),e=t())}return e}i=i||0;for(var c=f.length;c>0&&f[c-1][2]>i;c--)f[c]=f[c-1];f[c]=[n,t,i]},h.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return h.d(n,{a:n}),n},h.d=function(e,n){for(var t in n)h.o(n,t)&&!h.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},h.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},h.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e={1852:0,1465:0,6615:0,7056:0,5717:0,3708:0,2996:0,2823:0,9296:0};h.O.j=function(n){return 0===e[n]};var n=function(n,t){var i,o,r=t[0],a=t[1],c=t[2],s=0;for(i in a)h.o(a,i)&&(h.m[i]=a[i]);if(c)var l=c(h);for(n&&n(t);s<r.length;s++)o=r[s],h.o(e,o)&&e[o]&&e[o][0](),e[r[s]]=0;return h.O(l)},t=self.webpackChunkParaUI=self.webpackChunkParaUI||[];t.forEach(n.bind(null,0)),t.push=n.bind(null,t.push.bind(t))}();var x=h.O(void 0,[9296],(function(){return h(1596)}));return x=h.O(x)}()}));
|
package/index.d.ts
CHANGED