@para-ui/core 2.0.1 → 2.0.2
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 +1 -1
- package/ComboSelect/interface.d.ts +9 -3
- package/Form/index.js +1 -1
- package/FormItem/index.js +1 -1
- package/FunctionModal/index.js +3 -3
- package/InputLang/index.js +1 -1
- package/InputNumber/index.js +1 -1
- package/Modal/index.js +3 -3
- package/MultiBox/index.js +1 -1
- package/PageHeader/index.js +1 -1
- package/PageHeader/interface.d.ts +2 -0
- package/Pagination/index.js +1 -1
- package/PopConfirm/index.d.ts +2 -0
- package/PopConfirm/index.js +1 -1
- package/Search/index.js +1 -1
- package/SingleBox/index.js +1 -1
- package/Table/index.js +1 -1
- package/TextField/index.js +1 -1
- package/Transfer/index.js +1 -1
- package/index.js +2 -2
- package/package.json +1 -1
- package/style.css +5 -5
package/PageHeader/index.js
CHANGED
|
@@ -13,4 +13,4 @@ var n=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,r=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 r=t(9297),i=60103;if(n.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var o=Symbol.for;i=o("react.element"),n.Fragment=o("react.fragment")}var a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l=Object.prototype.hasOwnProperty,u={key:!0,ref:!0,__self:!0,__source:!0};function s(e,n,t){var r,o={},s=null,c=null;for(r in void 0!==t&&(s=""+t),void 0!==n.key&&(s=""+n.key),void 0!==n.ref&&(c=n.ref),n)l.call(n,r)&&!u.hasOwnProperty(r)&&(o[r]=n[r]);if(e&&e.defaultProps)for(r in n=e.defaultProps)void 0===o[r]&&(o[r]=n[r]);return{$$typeof:i,type:e,key:s,ref:c,props:o,_owner:a.current}}n.jsx=s,n.jsxs=s},7712:function(e,n,t){e.exports=t(9524)},2990:function(e,n,t){t.d(n,{default:function(){return g}});var r=t(7712),i=t(9297),o=t(1731),a=t(4927),l=t(1102),u=t.n(l),s=t(2749),c=t.n(s),d=t(6885),v=t(6028),p=t.n(v),f=function(){return f=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},f.apply(this,arguments)};var m=function(){return m=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},m.apply(this,arguments)},h=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)n.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(t[r[i]]=e[r[i]])}return t},b=function(e){var n=e.variant,t=void 0===n?"contained":n,l=e.size,s=void 0===l?"large":l,v=e.className,p=e.disabled,f=void 0!==p&&p,b=e.children,g=e.startIcon,j=e.endIcon,x=e.loading,y=void 0!==x&&x,N=e.toolTipTitle,O=void 0===N?"":N,M=e.danger,T=void 0!==M&&M,P=h(e,["variant","size","className","disabled","children","startIcon","endIcon","loading","toolTipTitle","danger"]),S=(0,i.useState)(!1),E=S[0],w=S[1],k=function(e){if(!E)return"start"===e&&g?(0,r.jsx)("span",m({className:(0,a.Z)("btn-icon","start-icon")},{children:g}),void 0):"end"===e&&j?(0,r.jsx)("span",m({className:(0,a.Z)("btn-icon","end-icon")},{children:j}),void 0):null;if("object"==typeof y){var n=y.delay||0;setTimeout((function(){return w(!1)}),n)}return"start"===e?(0,r.jsx)("span",m({className:"btn-icon loading-icon"},{children:(0,r.jsx)(u(),{},void 0)}),void 0):null},C=(0,r.jsx)(o.Button,m({},P,{color:"default",variant:"outlined",disabled:f,disableRipple:!0,disableElevation:!0,className:(0,a.Z)("paraui-button",v,"paraui-button-".concat(t),"paraui-button-".concat(s),E&&"paraui-button-loading",T&&!f&&"paraui-button-dangerous"),startIcon:k("start"),endIcon:k("end")},{children:b}),void 0);return(0,i.useEffect)((function(){w(!!y)}),[y]),f&&O?(0,r.jsx)(d.default,m({title:function(){if(f&&O){return(0,r.jsxs)("span",{children:[(0,r.jsx)(c(),{style:{marginRight:"4px",fontSize:"11px",color:"inherit"}},void 0),O]},void 0)}return O}()},{children:(0,r.jsx)("span",m({className:"paraui-button--disabled"},{children:C}),void 0)}),void 0):C};b.IconButton=function(e){var n=e.variant,t=void 0===n?"contained":n,l=e.size,s=void 0===l?"large":l,v=e.toolTipTitle,p=void 0===v?"":v,f=e.children,b=e.className,g=e.disabled,j=void 0!==g&&g,x=e.loading,y=void 0!==x&&x,N=e.TooltipProps,O=e.danger,M=void 0!==O&&O,T=h(e,["variant","size","toolTipTitle","children","className","disabled","loading","TooltipProps","danger"]),P=(0,i.useState)(!1),S=P[0],E=P[1],w=(0,r.jsx)(o.IconButton,m({},T,{disabled:j,disableRipple:!0,className:(0,a.Z)("paraui-icon-button",b,"paraui-icon-button-".concat(t),"paraui-icon-button-".concat(s),S&&"paraui-icon-button-loading",M&&!j&&"paraui-icon-button-dangerous")},{children:function(){if(!S)return f;if("object"==typeof y){var e=y.delay||0;setTimeout((function(){return E(!1)}),e)}return(0,r.jsx)("span",m({className:"loading-icon"},{children:(0,r.jsx)(u(),{},void 0)}),void 0)}()}),void 0);return(0,i.useEffect)((function(){E(!!y)}),[y]),p?(0,r.jsx)(d.default,m({},N,{title:function(){if(j&&p){return(0,r.jsxs)("span",{children:[(0,r.jsx)(c(),{style:{marginRight:"4px",fontSize:"11px",color:"inherit"}},void 0),p]},void 0)}return p}()},{children:j?(0,r.jsx)("span",m({className:"paraui-button--disabled"},{children:w}),void 0):w}),void 0):w},b.SplitButton=function(e){var n=e.buttonText,t=e.options,l=void 0===t?[]:t,u=e.className,s=e.disabled,c=void 0!==s&&s,d=e.onClick,v=e.optionRender,m=(0,i.useState)(!1),h=m[0],b=m[1],j=(0,i.useRef)(null),x=(0,i.useRef)(),y=(0,i.useState)(0),N=y[0],O=y[1],M=function(e,n,t){var r;O(n),b(!1),null===(r=x.current)||void 0===r||r.classList.remove("paraui-button-split--active"),null==d||d(e,t)},T=function(e){var n,t;(null===(n=j.current)||void 0===n?void 0:n.contains(e.target))||(b(!1),null===(t=x.current)||void 0===t||t.classList.remove("paraui-button-split--active"))},P=function(){return(0,r.jsx)("div",f({className:"paraui-button-split-list"},{children:(0,r.jsx)("ul",{children:l.map((function(e,n){return Array.isArray(e)?function(e,n){return(0,r.jsx)("li",f({className:"split-li-group"},{children:e.map((function(e,t){var i="".concat(n,"-").concat(t);return(0,r.jsx)("div",f({className:(0,a.Z)("split-li",i===N&&"split-li--active"),onClick:function(n){return M(e,i,n)}},{children:(null==v?void 0:v(e))||e.label}),i)}))}),n)}(e,n):(0,r.jsx)("li",f({className:(0,a.Z)("split-li",n===N&&"split-li--active"),onClick:function(t){return M(e,n,t)}},{children:(null==v?void 0:v(e))||e.label}),n)}))},void 0)}),void 0)};return(0,r.jsxs)("div",f({className:(0,a.Z)("paraui-button-split",u),ref:j,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,r.jsx)(g,f({variant:"outlined",onMouseEnter:function(e){e.stopPropagation();var n=e.currentTarget;x.current=n,n.classList.add("paraui-button-split--active"),b(!0)},startIcon:(0,r.jsx)(p(),{},void 0),disabled:c},{children:null!=n?n:"更多操作"}),void 0),(0,r.jsx)(o.Popper,f({open:h,anchorEl:j.current,transition:!0,placement:"bottom-end"},{children:function(e){var n=e.TransitionProps;e.placement;return(0,r.jsx)(o.Grow,f({},n,{children:(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(o.ClickAwayListener,f({onClickAway:T},{children:P()}),void 0)},void 0)}),void 0)}}),void 0)]}),void 0)};var g=b},7456:function(e,n,t){t.r(n),t.d(n,{PageHeader:function(){return T},default:function(){return P}});var r=t(7712),i=t(9297),o=t(2268),a=t(1731),l=t(6028),u=t.n(l),s=t(1609),c=t(6090),d=t.n(c),v=t(3475),p=function(){return p=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},p.apply(this,arguments)},f=function(e,n,t){if(t||2===arguments.length)for(var r,i=0,o=n.length;i<o;i++)!r&&i in n||(r||(r=Array.prototype.slice.call(n,0,i)),r[i]=n[i]);return e.concat(r||Array.prototype.slice.call(n))},m=function(e){var n=e.open,t=void 0!==n&&n,l=e.anchorEl,c=e.idMenuLast,d=e.selectMenu,v=void 0===d?"":d,f=e.onClickMenu,h=e.list,b=void 0===h?[]:h,g=e.onMouseEnter,j=e.onMouseLeave,x=e.level,y=void 0===x?1:x,N=e.className,O=(0,i.useState)(null),M=O[0],T=O[1],P=(0,i.useState)(null),S=P[0],E=P[1],w=(0,i.useState)([]),k=w[0],C=w[1],L=(0,i.useState)({})[0],F=function(e,n){return function(t){var r;r=t,clearTimeout(L.leaveTimer),L.leaveTimer=setTimeout((function(){1===y&&g&&g();var t=[e];e.children&&e.children.length>0&&(t=e.children);var i=r.target;E(i),C(t),T(n)}),50)}},z=function(e){return function(n){e.children&&e.children.length>0||(f&&f(e),j&&j())}},q=function(e){var n="menu-item-popper-content-item",t=c&&c[v];return t&&-1!==t.indexOf(e.path)&&(n+=" menu-item-popper-content-item-select"),n},_=function(){var e="menu-item-popper";return N&&(e+=" "+N),e},I=(0,i.useCallback)((function(e,n){return(0,r.jsx)(r.Fragment,{children:e.children&&e.children.length>0&&M===n&&(0,r.jsx)(m,{open:M===n,anchorEl:S,list:k,idMenuLast:c,selectMenu:v,onClickMenu:f,onMouseEnter:g,onMouseLeave:j,level:y+1},void 0)},void 0)}),[M,S,k,c,v,f,g,j,y]),R=(0,i.useMemo)((function(){return(0,r.jsx)("div",p({className:"menu-item-popper-content"},{children:b.map((function(e,n){var t=function(e){var n=e.icon;if(n){var t=s[n];return t?t():n}}(e),i=function(e){var n=e.children;if(n&&n.length>0)return(0,r.jsx)(u(),{},void 0)}(e);return(0,r.jsx)("div",p({className:q(e),onMouseLeave:function(e){clearTimeout(L.leaveTimer),L.leaveTimer=setTimeout((function(){1===y&&j&&j(),T(null),E(null),C([])}))},onMouseEnter:F(e,n)},{children:(0,r.jsxs)("div",p({className:"menu-item-popper-content-item-content",onClick:z(e)},{children:[t&&(0,r.jsx)("span",p({className:"menu-item-icon"},{children:t}),void 0),(0,r.jsx)("span",p({className:"menu-item-label"},{children:e.label}),void 0),i&&(0,r.jsx)("span",p({className:"menu-item-arrow"},{children:i}),void 0),I(e,n)]}),void 0)}),n)}))}),void 0)}),[b,f,M,S,k,c,v,f,g,j,y]),A=function(){return 1!==y?(0,r.jsx)("div",p({className:_()},{children:R}),void 0):(0,r.jsx)(a.Popper,p({open:t,anchorEl:l,disablePortal:!0,placement:"bottom-start",className:_()},{children:R}),void 0)};return(0,r.jsx)(r.Fragment,{children:1===y?(0,o.createPortal)((0,r.jsx)(A,{},void 0),document.getElementsByTagName("body")[0]):(0,r.jsx)(A,{},void 0)},void 0)},h=function(e){var n=e.list,t=void 0===n?[]:n,o=e.selectMenu,a=void 0===o?"":o,l=e.onClickMenu,c=e.className,h=e.moreCustomize,b=(0,i.useState)(!1),g=b[0],j=b[1],x=(0,i.useState)(null),y=x[0],N=x[1],O=(0,i.useState)(null),M=O[0],T=O[1],P=(0,i.useState)([]),S=P[0],E=P[1],w=(0,i.useState)(""),k=w[0],C=w[1],L=(0,i.useState)({}),F=L[0],z=L[1],q=(0,i.useState)({}),_=q[0],I=q[1],R=(0,i.useState)("horizontal-menu-list-"+(0,v.UUID)())[0],A=(0,i.useState)(null),B=A[0],Z=A[1],D=(0,i.useState)({})[0];(0,i.useEffect)((function(){a!==k&&C(a)}),[a]),(0,i.useEffect)((function(){return V(t),H(),window.addEventListener("resize",H),function(){window.removeEventListener("resize",H)}}),[t]);var U,H=function(){clearTimeout(D.timerResize),G(),D.timerResize=setTimeout((function(){Z(t.length),$()}),100)},$=function(e){if(null!==e&&0!==e){void 0===e&&(e=t.length);var n=document.querySelector("."+R);if(n)if(n.scrollHeight>n.clientHeight){var r=Number(e)-1;Z(r),$(r)}else t.length<=e&&G()}},G=function(){},V=function(e){var n={},t={},r={},i={},o=function(e,a,l){for(var u=0,s=e.length;u<s;u++){var c=e[u],d=c.path;n[d]=c;var p=void 0===l?u:l;if(a){var m=(0,v.DeepClone)(t[a.path]||[]);m.push(d),t[d]=f([],m,!0)}else t[d]=[d];c.children&&c.children.length>0?o(c.children,c,p):(r[d]=t[d],i[d]=p)}};o(e),I(i),z(r)},W=function(e,n){return function(t){clearTimeout(D.leaveTimer);var r=[];e.children&&e.children.length>0&&(r=e.children),N(n),T(t.target),E(r),j(!0)}},Y=function(){j(!1),T(null),E([]),N(null)},J=function(){clearTimeout(D.leaveTimer)},K=function(){Y()},Q=function(e){l&&l(e)},X=function(e,n){var t=" horizontal-menu-list-item",r=F[k];return r&&-1!==r.indexOf(e.path)&&(t+=" horizontal-menu-list-item-select"),y===n&&(t+=" horizontal-menu-list-item-hover"),t},ee=(0,i.useMemo)((function(){return(0,r.jsx)(r.Fragment,{children:g&&(0,r.jsx)(m,{open:g,anchorEl:M,list:S,idMenuLast:F,selectMenu:k,onClickMenu:Q,onMouseEnter:J,onMouseLeave:K,className:"paraui-horizontal-menu-popper",level:1},void 0)},void 0)}),[g,M,S,F,k,l,D]),ne=function(e){clearTimeout(D.leaveTimer);for(var n=[],r=Number(B),i=t.length;r<i;r++)n.push(t[r]);N(B),T(e.target),E(n),j(!0)},te=function(){clearTimeout(D.leaveTimer),D.leaveTimer=setTimeout((function(){Y()}),100)},re=function(){var e=" horizontal-menu-list-item",n=_[k];return null!==B&&B<=n&&(e+=" horizontal-menu-list-item-select"),y===B&&(e+=" horizontal-menu-list-item-hover"),e};return(0,r.jsxs)("div",p({className:(U="horizontal-menu-list",c&&(U+=" "+c),R&&(U+=" "+R),U)},{children:[t.map((function(e,n){if(null!==B&&B<=n)return null;var t=function(e){var n=e.icon;if(n){var t=s[n];return t?t():n}}(e),i=function(e){var n=e.children;if(n&&n.length>0)return(0,r.jsx)(u(),{},void 0)}(e);return(0,r.jsxs)("div",p({onClick:function(){Q(e)},onMouseEnter:W(e,n),onMouseLeave:function(e){clearTimeout(D.leaveTimer),D.leaveTimer=setTimeout((function(){Y()}),100)},className:X(e,n)},{children:[t&&(0,r.jsx)("span",p({className:"menu-item-icon"},{children:t}),void 0),(0,r.jsx)("span",p({className:"menu-item-label"},{children:e.label}),void 0),i&&(0,r.jsx)("span",p({className:"menu-item-arrow"},{children:i}),void 0)]}),n)})),function(){if(null!==B&&t.length>B)return(0,r.jsx)("div",p({onMouseEnter:ne,onMouseLeave:te,className:re()},{children:h||(0,r.jsx)("span",p({className:"menu-item-icon"},{children:(0,r.jsx)(d(),{},void 0)}),void 0)}),void 0)}(),ee]}),void 0)},b=t(2990),g=function(){return g=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},g.apply(this,arguments)},j=function(e){var n,t=e.icon,i=e.label,o=e.render,a=e.onClick,l=e.className,u=function(e){a&&a(e)};return(0,r.jsx)(r.Fragment,{children:o||(0,r.jsx)("div",g({className:(n="back-btn",l&&(n+=" "+l),n)},{children:(0,r.jsx)(b.default,g({startIcon:t,variant:"contained",onClick:u},{children:i}),void 0)}),void 0)},void 0)},x=function(e){var n=e.language,t=void 0===n?[]:n,l=e.selectLang,u=void 0===l?"":l,s=e.onClick,c=e.className,d=e.render,v=(0,i.useState)({}),p=v[0],f=v[1],m=(0,i.useState)({}),h=m[0],b=m[1],j=(0,i.useState)(!1),x=j[0],y=j[1],N=(0,i.useState)(null),O=N[0],M=N[1],T=(0,i.useState)({})[0];(0,i.useEffect)((function(){var e=p[u]||{};b(e)}),[u,p]),(0,i.useEffect)((function(){for(var e={},n=0,r=t.length;n<r;n++){var i=t[n];i.value&&(e[i.value]=i)}f(e)}),[t]);var P,S=function(e){return function(){s&&s(e.value,e),y(!1)}},E=function(e){T.timer=setTimeout((function(){y(!1),M(null)}),100)},w=function(e){return function(n){clearTimeout(T.timer),y(!0),e&&M(n.target)}},k=(0,i.useMemo)((function(){return(0,r.jsx)("div",g({className:"language-item",onMouseLeave:E,onMouseEnter:w(!0)},{children:(0,r.jsxs)(r.Fragment,{children:[h.icon&&(0,r.jsx)("span",g({className:"language-item-icon"},{children:h.icon}),void 0),h.label&&(0,r.jsx)("span",g({className:"language-item-label"},{children:h.label}),void 0)]},void 0)}),void 0)}),[h,t,T]),C=(0,i.useMemo)((function(){var e=function(e){var n="menu-popover-item";return e.value===h.value&&(n+=" menu-popover-item-select"),n};return(0,o.createPortal)((0,r.jsx)((function(){return(0,r.jsx)(a.Popper,g({open:x,anchorEl:O,disablePortal:!0,placement:"bottom-end",onMouseLeave:E,onMouseEnter:w(!1),className:"paraui-horizontal-meun-right-popover menu-popover"},{children:(0,r.jsx)("div",g({className:"menu-popover-box"},{children:t.map((function(n,t){return(0,r.jsxs)("div",g({className:e(n),onClick:S(n)},{children:[n.icon&&(0,r.jsx)("span",g({className:"icon"},{children:n.icon}),void 0),n.label&&(0,r.jsx)("span",g({className:"label",style:{marginLeft:"5px"}},{children:n.label}),void 0)]}),t)}))}),void 0)}),void 0)}),{},void 0),document.getElementsByTagName("body")[0])}),[t,h,x,O,T,s]);return(0,r.jsx)(r.Fragment,{children:d||(0,r.jsxs)("div",g({className:(P="language",c&&(P+=" "+c),x&&(P+=" language-select"),P)},{children:[k,x&&C]}),void 0)},void 0)},y=function(e){var n,t=e.list,o=void 0===t?[]:t,a=e.render,l=e.className,u=e.onClick,s=function(e){return function(n){u&&u(e,n)}},c=(0,i.useMemo)((function(){var e=function(e){return(0,r.jsxs)(r.Fragment,{children:[e.icon&&(0,r.jsx)("span",g({className:"btn-list-item-icon"},{children:e.icon}),void 0),e.label&&(0,r.jsx)("span",g({className:"btn-list-item-label"},{children:e.label}),void 0)]},void 0)};return(0,r.jsx)(r.Fragment,{children:o.map((function(n,t){var i="btn-list-item";return n.sign&&(i+=" btn-list-item-sign"),(0,r.jsx)("div",g({className:i,onClick:s(n)},{children:e(n)}),t)}))},void 0)}),[o]);return(0,r.jsx)(r.Fragment,{children:a||(0,r.jsx)("div",g({className:(n="btn-list",l&&(n+=" "+l),n)},{children:c}),void 0)},void 0)},N=function(e){var n,t=e.img,l=e.label,s=e.render,c=e.className,d=e.list,v=e.onClick,p=e.onClickMenu,f=e.selectValue,m=(0,i.useState)(!1),h=m[0],b=m[1],j=(0,i.useState)(null),x=j[0],y=j[1],N=(0,i.useState)({})[0],O=function(e){return function(){p&&p(e.value,e),b(!1)}},M=function(e){N.timer=setTimeout((function(){b(!1),y(null)}),100)},T=function(e){return function(n){clearTimeout(N.timer),b(!0),e&&y(n.target)}},P=(0,i.useMemo)((function(){var e=function(e){var n="menu-popover-item";return e.value===f&&(n+=" menu-popover-item-select"),n};return(0,o.createPortal)((0,r.jsx)((function(){var n;return(0,r.jsx)(a.Popper,g({open:h,anchorEl:x,disablePortal:!0,placement:"bottom-end",onMouseLeave:M,onMouseEnter:T(!1),className:"paraui-horizontal-meun-right-popover menu-popover"},{children:(0,r.jsx)("div",g({className:"menu-popover-box",style:(n={},x&&(n.width=x.getBoundingClientRect().width+"px"),n)},{children:d&&d.map((function(n,t){return(0,r.jsxs)("div",g({className:e(n),onClick:O(n)},{children:[n.icon&&(0,r.jsx)("span",g({className:"icon",style:{marginRight:"5px"}},{children:n.icon}),void 0),n.label&&(0,r.jsx)("span",g({className:"label"},{children:n.label}),void 0)]}),t)}))}),void 0)}),void 0)}),{},void 0),document.getElementsByTagName("body")[0])}),[d,f,h,x,N]);return(0,r.jsx)(r.Fragment,{children:s||(0,r.jsxs)("div",g({className:(n="logo",c&&(n+=" "+c),h&&(n+=" logo-show-dialog"),n),onClick:function(e){v&&v(e)},onMouseLeave:M,onMouseEnter:T(!0)},{children:[(0,r.jsxs)(r.Fragment,{children:[t&&(0,r.jsx)("img",{src:t,alt:""},void 0),l&&(0,r.jsx)("span",g({className:"label"},{children:l}),void 0),d&&d.length>0&&(0,r.jsx)("span",g({className:"arrow"},{children:(0,r.jsx)(u(),{},void 0)}),void 0)]},void 0),h&&P]}),void 0)},void 0)},O=function(e){var n,t=e.className,o=void 0===t?"":t,a=e.backSelfcareProps,l=e.languageProps,u=e.btnListProps,s=e.userProps,c=e.render,d=(0,i.useMemo)((function(){return a&&(0,r.jsx)(j,g({},a),void 0)}),[a]),v=(0,i.useMemo)((function(){return l&&(0,r.jsx)(x,g({},l),void 0)}),[l]),p=(0,i.useMemo)((function(){return u&&(0,r.jsx)(y,g({},u),void 0)}),[u]),f=(0,i.useMemo)((function(){return s&&(0,r.jsx)(N,g({},s),void 0)}),[s]);return(0,r.jsx)(r.Fragment,{children:c||(0,r.jsxs)("div",g({className:(n="paraui-horizontal-meun-right",o&&(n+=" "+o),n)},{children:[d,v,p,f]}),void 0)},void 0)},M=function(){return M=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},M.apply(this,arguments)},T=function(e){var n,t=e.leftRender,o=e.menuListProps,a=e.footerProps,l=e.selectMenu,u=e.onClickMenu,s=e.className,c=(0,i.useMemo)((function(){return t&&(0,r.jsx)("div",M({className:"paraui-page-header-left"},{children:t}),void 0)}),[t]),d=(0,i.useMemo)((function(){return e.menuListProps&&(0,r.jsx)("div",M({className:"menu-box"},{children:(0,r.jsx)(h,M({},o,{selectMenu:l,onClickMenu:u}),void 0)}),void 0)}),[o,l,u]),v=(0,i.useMemo)((function(){return e.footerProps&&(0,r.jsx)(O,M({},a),void 0)}),[a]);return(0,r.jsxs)("div",M({className:(n="paraui-page-header",s&&(n+=" "+s),n)},{children:[c,d,v]}),void 0)},P=T},6885:function(e,n,t){var r=t(7712),i=t(1731),o=t(4927),a=function(){return a=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},a.apply(this,arguments)};n.default=function(e){var n,t=a(a({},e.classes),{popper:(0,o.Z)("paraui-tooltip",null===(n=e.classes)||void 0===n?void 0:n.popper)});return(0,r.jsx)(i.Tooltip,a({},e,{classes:t},{children:e.children}),void 0)}},1731:function(n){n.exports=e},1609:function(e){e.exports=n},6028:function(e){e.exports=t},2749:function(e){e.exports=r},1102:function(e){e.exports=i},6090:function(e){e.exports=o},3475:function(e){e.exports=a},9297:function(e){e.exports=l},2268:function(e){e.exports=u}},d={};function v(e){var n=d[e];if(void 0!==n)return n.exports;var t=d[e]={exports:{}};return c[e](t,t.exports,v),t.exports}v.m=c,s=[],v.O=function(e,n,t,r){if(!n){var i=1/0;for(l=0;l<s.length;l++){n=s[l][0],t=s[l][1],r=s[l][2];for(var o=!0,a=0;a<n.length;a++)(!1&r||i>=r)&&Object.keys(v.O).every((function(e){return v.O[e](n[a])}))?n.splice(a--,1):(o=!1,r<i&&(i=r));o&&(s.splice(l--,1),e=t())}return e}r=r||0;for(var l=s.length;l>0&&s[l-1][2]>r;l--)s[l]=s[l-1];s[l]=[n,t,r]},v.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return v.d(n,{a:n}),n},v.d=function(e,n){for(var t in n)v.o(n,t)&&!v.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},v.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},v.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e={3462:0,6615:0,2823:0,9296:0};v.O.j=function(n){return 0===e[n]};var n=function(n,t){var r,i,o=t[0],a=t[1],l=t[2],u=0;for(r in a)v.o(a,r)&&(v.m[r]=a[r]);if(l)var s=l(v);for(n&&n(t);u<o.length;u++)i=o[u],v.o(e,i)&&e[i]&&e[i][0](),e[o[u]]=0;return v.O(s)},t=self.webpackChunkParaUI=self.webpackChunkParaUI||[];t.forEach(n.bind(null,0)),t.push=n.bind(null,t.push.bind(t))}();var p=v.O(void 0,[9296],(function(){return v(7456)}));return p=v.O(p)}()}));
|
|
16
|
+
t(4126);var r=t(9297),i=60103;if(n.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var o=Symbol.for;i=o("react.element"),n.Fragment=o("react.fragment")}var a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l=Object.prototype.hasOwnProperty,u={key:!0,ref:!0,__self:!0,__source:!0};function s(e,n,t){var r,o={},s=null,c=null;for(r in void 0!==t&&(s=""+t),void 0!==n.key&&(s=""+n.key),void 0!==n.ref&&(c=n.ref),n)l.call(n,r)&&!u.hasOwnProperty(r)&&(o[r]=n[r]);if(e&&e.defaultProps)for(r in n=e.defaultProps)void 0===o[r]&&(o[r]=n[r]);return{$$typeof:i,type:e,key:s,ref:c,props:o,_owner:a.current}}n.jsx=s,n.jsxs=s},7712:function(e,n,t){e.exports=t(9524)},2990:function(e,n,t){t.d(n,{default:function(){return g}});var r=t(7712),i=t(9297),o=t(1731),a=t(4927),l=t(1102),u=t.n(l),s=t(2749),c=t.n(s),d=t(6885),v=t(6028),p=t.n(v),f=function(){return f=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},f.apply(this,arguments)};var m=function(){return m=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},m.apply(this,arguments)},h=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)n.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(t[r[i]]=e[r[i]])}return t},b=function(e){var n=e.variant,t=void 0===n?"contained":n,l=e.size,s=void 0===l?"large":l,v=e.className,p=e.disabled,f=void 0!==p&&p,b=e.children,g=e.startIcon,j=e.endIcon,x=e.loading,y=void 0!==x&&x,N=e.toolTipTitle,O=void 0===N?"":N,M=e.danger,T=void 0!==M&&M,P=h(e,["variant","size","className","disabled","children","startIcon","endIcon","loading","toolTipTitle","danger"]),S=(0,i.useState)(!1),E=S[0],w=S[1],k=function(e){if(!E)return"start"===e&&g?(0,r.jsx)("span",m({className:(0,a.Z)("btn-icon","start-icon")},{children:g}),void 0):"end"===e&&j?(0,r.jsx)("span",m({className:(0,a.Z)("btn-icon","end-icon")},{children:j}),void 0):null;if("object"==typeof y){var n=y.delay||0;setTimeout((function(){return w(!1)}),n)}return"start"===e?(0,r.jsx)("span",m({className:"btn-icon loading-icon"},{children:(0,r.jsx)(u(),{},void 0)}),void 0):null},C=(0,r.jsx)(o.Button,m({},P,{color:"default",variant:"outlined",disabled:f,disableRipple:!0,disableElevation:!0,className:(0,a.Z)("paraui-button",v,"paraui-button-".concat(t),"paraui-button-".concat(s),E&&"paraui-button-loading",T&&!f&&"paraui-button-dangerous"),startIcon:k("start"),endIcon:k("end")},{children:b}),void 0);return(0,i.useEffect)((function(){w(!!y)}),[y]),f&&O?(0,r.jsx)(d.default,m({title:function(){if(f&&O){return(0,r.jsxs)("span",{children:[(0,r.jsx)(c(),{style:{marginRight:"4px",fontSize:"11px",color:"inherit"}},void 0),O]},void 0)}return O}()},{children:(0,r.jsx)("span",m({className:"paraui-button--disabled"},{children:C}),void 0)}),void 0):C};b.IconButton=function(e){var n=e.variant,t=void 0===n?"contained":n,l=e.size,s=void 0===l?"large":l,v=e.toolTipTitle,p=void 0===v?"":v,f=e.children,b=e.className,g=e.disabled,j=void 0!==g&&g,x=e.loading,y=void 0!==x&&x,N=e.TooltipProps,O=e.danger,M=void 0!==O&&O,T=h(e,["variant","size","toolTipTitle","children","className","disabled","loading","TooltipProps","danger"]),P=(0,i.useState)(!1),S=P[0],E=P[1],w=(0,r.jsx)(o.IconButton,m({},T,{disabled:j,disableRipple:!0,className:(0,a.Z)("paraui-icon-button",b,"paraui-icon-button-".concat(t),"paraui-icon-button-".concat(s),S&&"paraui-icon-button-loading",M&&!j&&"paraui-icon-button-dangerous")},{children:function(){if(!S)return f;if("object"==typeof y){var e=y.delay||0;setTimeout((function(){return E(!1)}),e)}return(0,r.jsx)("span",m({className:"loading-icon"},{children:(0,r.jsx)(u(),{},void 0)}),void 0)}()}),void 0);return(0,i.useEffect)((function(){E(!!y)}),[y]),p?(0,r.jsx)(d.default,m({},N,{title:function(){if(j&&p){return(0,r.jsxs)("span",{children:[(0,r.jsx)(c(),{style:{marginRight:"4px",fontSize:"11px",color:"inherit"}},void 0),p]},void 0)}return p}()},{children:j?(0,r.jsx)("span",m({className:"paraui-button--disabled"},{children:w}),void 0):w}),void 0):w},b.SplitButton=function(e){var n=e.buttonText,t=e.options,l=void 0===t?[]:t,u=e.className,s=e.disabled,c=void 0!==s&&s,d=e.onClick,v=e.optionRender,m=(0,i.useState)(!1),h=m[0],b=m[1],j=(0,i.useRef)(null),x=(0,i.useRef)(),y=(0,i.useState)(0),N=y[0],O=y[1],M=function(e,n,t){var r;O(n),b(!1),null===(r=x.current)||void 0===r||r.classList.remove("paraui-button-split--active"),null==d||d(e,t)},T=function(e){var n,t;(null===(n=j.current)||void 0===n?void 0:n.contains(e.target))||(b(!1),null===(t=x.current)||void 0===t||t.classList.remove("paraui-button-split--active"))},P=function(){return(0,r.jsx)("div",f({className:"paraui-button-split-list"},{children:(0,r.jsx)("ul",{children:l.map((function(e,n){return Array.isArray(e)?function(e,n){return(0,r.jsx)("li",f({className:"split-li-group"},{children:e.map((function(e,t){var i="".concat(n,"-").concat(t);return(0,r.jsx)("div",f({className:(0,a.Z)("split-li",i===N&&"split-li--active"),onClick:function(n){return M(e,i,n)}},{children:(null==v?void 0:v(e))||e.label}),i)}))}),n)}(e,n):(0,r.jsx)("li",f({className:(0,a.Z)("split-li",n===N&&"split-li--active"),onClick:function(t){return M(e,n,t)}},{children:(null==v?void 0:v(e))||e.label}),n)}))},void 0)}),void 0)};return(0,r.jsxs)("div",f({className:(0,a.Z)("paraui-button-split",u),ref:j,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,r.jsx)(g,f({variant:"outlined",onMouseEnter:function(e){e.stopPropagation();var n=e.currentTarget;x.current=n,n.classList.add("paraui-button-split--active"),b(!0)},startIcon:(0,r.jsx)(p(),{},void 0),disabled:c},{children:null!=n?n:"更多操作"}),void 0),(0,r.jsx)(o.Popper,f({open:h,anchorEl:j.current,transition:!0,placement:"bottom-end"},{children:function(e){var n=e.TransitionProps;e.placement;return(0,r.jsx)(o.Grow,f({},n,{children:(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(o.ClickAwayListener,f({onClickAway:T},{children:P()}),void 0)},void 0)}),void 0)}}),void 0)]}),void 0)};var g=b},7456:function(e,n,t){t.r(n),t.d(n,{PageHeader:function(){return T},default:function(){return P}});var r=t(7712),i=t(9297),o=t(2268),a=t(1731),l=t(6028),u=t.n(l),s=t(1609),c=t(6090),d=t.n(c),v=t(3475),p=function(){return p=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},p.apply(this,arguments)},f=function(e,n,t){if(t||2===arguments.length)for(var r,i=0,o=n.length;i<o;i++)!r&&i in n||(r||(r=Array.prototype.slice.call(n,0,i)),r[i]=n[i]);return e.concat(r||Array.prototype.slice.call(n))},m=function(e){var n=e.open,t=void 0!==n&&n,l=e.anchorEl,c=e.idMenuLast,d=e.selectMenu,v=void 0===d?"":d,f=e.onClickMenu,h=e.list,b=void 0===h?[]:h,g=e.onMouseEnter,j=e.onMouseLeave,x=e.level,y=void 0===x?1:x,N=e.className,O=(0,i.useState)(null),M=O[0],T=O[1],P=(0,i.useState)(null),S=P[0],E=P[1],w=(0,i.useState)([]),k=w[0],C=w[1],L=(0,i.useState)({})[0],z=function(e,n){return function(t){var r;r=t,clearTimeout(L.leaveTimer),L.leaveTimer=setTimeout((function(){1===y&&g&&g();var t=[e];e.children&&e.children.length>0&&(t=e.children);var i=r.target;E(i),C(t),T(n)}),50)}},F=function(e){return function(n){e.children&&e.children.length>0||(f&&f(e),j&&j())}},q=function(e){var n="menu-item-popper-content-item",t=c&&c[v];return t&&-1!==t.indexOf(e.path)&&(n+=" menu-item-popper-content-item-select"),n},_=function(){var e="menu-item-popper";return N&&(e+=" "+N),e},I=(0,i.useCallback)((function(e,n){return(0,r.jsx)(r.Fragment,{children:e.children&&e.children.length>0&&M===n&&(0,r.jsx)(m,{open:M===n,anchorEl:S,list:k,idMenuLast:c,selectMenu:v,onClickMenu:f,onMouseEnter:g,onMouseLeave:j,level:y+1},void 0)},void 0)}),[M,S,k,c,v,f,g,j,y]),R=(0,i.useMemo)((function(){return(0,r.jsx)("div",p({className:"menu-item-popper-content"},{children:b.map((function(e,n){var t=function(e){var n=e.icon;if(n){var t=s[n];return t?t():n}}(e),i=function(e){var n=e.children;if(n&&n.length>0)return(0,r.jsx)(u(),{},void 0)}(e);return(0,r.jsx)("div",p({className:q(e),onMouseLeave:function(e){clearTimeout(L.leaveTimer),L.leaveTimer=setTimeout((function(){1===y&&j&&j(),T(null),E(null),C([])}))},onMouseEnter:z(e,n)},{children:(0,r.jsxs)("div",p({className:"menu-item-popper-content-item-content",onClick:F(e)},{children:[t&&(0,r.jsx)("span",p({className:"menu-item-icon"},{children:t}),void 0),(0,r.jsx)("span",p({className:"menu-item-label"},{children:e.label}),void 0),i&&(0,r.jsx)("span",p({className:"menu-item-arrow"},{children:i}),void 0),I(e,n)]}),void 0)}),n)}))}),void 0)}),[b,f,M,S,k,c,v,f,g,j,y]),A=function(){return 1!==y?(0,r.jsx)("div",p({className:_()},{children:R}),void 0):(0,r.jsx)(a.Popper,p({open:t,anchorEl:l,disablePortal:!0,placement:"bottom-start",className:_()},{children:R}),void 0)};return(0,r.jsx)(r.Fragment,{children:1===y?(0,o.createPortal)((0,r.jsx)(A,{},void 0),document.getElementsByTagName("body")[0]):(0,r.jsx)(A,{},void 0)},void 0)},h=function(e){var n=e.list,t=void 0===n?[]:n,o=e.selectMenu,a=void 0===o?"":o,l=e.onClickMenu,c=e.className,h=e.moreCustomize,b=(0,i.useState)(!1),g=b[0],j=b[1],x=(0,i.useState)(null),y=x[0],N=x[1],O=(0,i.useState)(null),M=O[0],T=O[1],P=(0,i.useState)([]),S=P[0],E=P[1],w=(0,i.useState)(""),k=w[0],C=w[1],L=(0,i.useState)({}),z=L[0],F=L[1],q=(0,i.useState)({}),_=q[0],I=q[1],R=(0,i.useState)("horizontal-menu-list-"+(0,v.UUID)())[0],A=(0,i.useState)(null),B=A[0],Z=A[1],D=(0,i.useState)({})[0];(0,i.useEffect)((function(){a!==k&&C(a)}),[a]),(0,i.useEffect)((function(){return V(t),H(),window.addEventListener("resize",H),function(){window.removeEventListener("resize",H)}}),[t]);var U,H=function(){clearTimeout(D.timerResize),G(),D.timerResize=setTimeout((function(){Z(t.length),$()}),100)},$=function(e){if(null!==e&&0!==e){void 0===e&&(e=t.length);var n=document.querySelector("."+R);if(n)if(n.scrollHeight>n.clientHeight){var r=Number(e)-1;Z(r),$(r)}else t.length<=e&&G()}},G=function(){},V=function(e){var n={},t={},r={},i={},o=function(e,a,l){for(var u=0,s=e.length;u<s;u++){var c=e[u],d=c.path;n[d]=c;var p=void 0===l?u:l;if(a){var m=(0,v.DeepClone)(t[a.path]||[]);m.push(d),t[d]=f([],m,!0)}else t[d]=[d];c.children&&c.children.length>0?o(c.children,c,p):(r[d]=t[d],i[d]=p)}};o(e),I(i),F(r)},W=function(e,n){return function(t){clearTimeout(D.leaveTimer);var r=[];e.children&&e.children.length>0&&(r=e.children),N(n),T(t.target),E(r),j(!0)}},Y=function(){j(!1),T(null),E([]),N(null)},J=function(){clearTimeout(D.leaveTimer)},K=function(){Y()},Q=function(e){l&&l(e)},X=function(e,n){var t=" horizontal-menu-list-item",r=z[k];return r&&-1!==r.indexOf(e.path)&&(t+=" horizontal-menu-list-item-select"),y===n&&(t+=" horizontal-menu-list-item-hover"),t},ee=(0,i.useMemo)((function(){return(0,r.jsx)(r.Fragment,{children:g&&(0,r.jsx)(m,{open:g,anchorEl:M,list:S,idMenuLast:z,selectMenu:k,onClickMenu:Q,onMouseEnter:J,onMouseLeave:K,className:"paraui-horizontal-menu-popper",level:1},void 0)},void 0)}),[g,M,S,z,k,l,D]),ne=function(e){clearTimeout(D.leaveTimer);for(var n=[],r=Number(B),i=t.length;r<i;r++)n.push(t[r]);N(B),T(e.target),E(n),j(!0)},te=function(){clearTimeout(D.leaveTimer),D.leaveTimer=setTimeout((function(){Y()}),100)},re=function(){var e=" horizontal-menu-list-item",n=_[k];return null!==B&&B<=n&&(e+=" horizontal-menu-list-item-select"),y===B&&(e+=" horizontal-menu-list-item-hover"),e};return(0,r.jsxs)("div",p({className:(U="horizontal-menu-list",c&&(U+=" "+c),R&&(U+=" "+R),U)},{children:[t.map((function(e,n){if(null!==B&&B<=n)return null;var t=function(e){var n=e.icon;if(n){var t=s[n];return t?t():n}}(e),i=function(e){var n=e.children;if(n&&n.length>0)return(0,r.jsx)(u(),{},void 0)}(e);return(0,r.jsxs)("div",p({onClick:function(){Q(e)},onMouseEnter:W(e,n),onMouseLeave:function(e){clearTimeout(D.leaveTimer),D.leaveTimer=setTimeout((function(){Y()}),100)},className:X(e,n)},{children:[t&&(0,r.jsx)("span",p({className:"menu-item-icon"},{children:t}),void 0),(0,r.jsx)("span",p({className:"menu-item-label"},{children:e.label}),void 0),i&&(0,r.jsx)("span",p({className:"menu-item-arrow"},{children:i}),void 0)]}),n)})),function(){if(null!==B&&t.length>B)return(0,r.jsx)("div",p({onMouseEnter:ne,onMouseLeave:te,className:re()},{children:h||(0,r.jsx)("span",p({className:"menu-item-icon"},{children:(0,r.jsx)(d(),{},void 0)}),void 0)}),void 0)}(),ee]}),void 0)},b=t(2990),g=function(){return g=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},g.apply(this,arguments)},j=function(e){var n,t=e.icon,i=e.label,o=e.render,a=e.onClick,l=e.className,u=function(e){a&&a(e)};return(0,r.jsx)(r.Fragment,{children:o||(0,r.jsx)("div",g({className:(n="back-btn",l&&(n+=" "+l),n)},{children:(0,r.jsx)(b.default,g({startIcon:t,variant:"contained",onClick:u},{children:i}),void 0)}),void 0)},void 0)},x=function(e){var n=e.language,t=void 0===n?[]:n,l=e.selectLang,u=void 0===l?"":l,s=e.onClick,c=e.className,d=e.render,v=(0,i.useState)({}),p=v[0],f=v[1],m=(0,i.useState)({}),h=m[0],b=m[1],j=(0,i.useState)(!1),x=j[0],y=j[1],N=(0,i.useState)(null),O=N[0],M=N[1],T=(0,i.useState)({})[0];(0,i.useEffect)((function(){var e=p[u]||{};b(e)}),[u,p]),(0,i.useEffect)((function(){for(var e={},n=0,r=t.length;n<r;n++){var i=t[n];i.value&&(e[i.value]=i)}f(e)}),[t]);var P,S=function(e){return function(){s&&s(e.value,e),y(!1)}},E=function(e){T.timer=setTimeout((function(){y(!1),M(null)}),100)},w=function(e){return function(n){clearTimeout(T.timer),y(!0),e&&M(n.target)}},k=(0,i.useMemo)((function(){return(0,r.jsx)("div",g({className:"language-item",onMouseLeave:E,onMouseEnter:w(!0)},{children:(0,r.jsxs)(r.Fragment,{children:[h.icon&&(0,r.jsx)("span",g({className:"language-item-icon"},{children:h.icon}),void 0),h.label&&(0,r.jsx)("span",g({className:"language-item-label"},{children:h.label}),void 0)]},void 0)}),void 0)}),[h,t,T]),C=(0,i.useMemo)((function(){var e=function(e){var n="menu-popover-item";return e.value===h.value&&(n+=" menu-popover-item-select"),n};return(0,o.createPortal)((0,r.jsx)((function(){return(0,r.jsx)(a.Popper,g({open:x,anchorEl:O,disablePortal:!0,placement:"bottom-end",onMouseLeave:E,onMouseEnter:w(!1),className:"paraui-horizontal-meun-right-popover menu-popover"},{children:(0,r.jsx)("div",g({className:"menu-popover-box"},{children:t.map((function(n,t){return(0,r.jsxs)("div",g({className:e(n),onClick:S(n)},{children:[n.icon&&(0,r.jsx)("span",g({className:"icon"},{children:n.icon}),void 0),n.label&&(0,r.jsx)("span",g({className:"label",style:{marginLeft:"5px"}},{children:n.label}),void 0)]}),t)}))}),void 0)}),void 0)}),{},void 0),document.getElementsByTagName("body")[0])}),[t,h,x,O,T,s]);return(0,r.jsx)(r.Fragment,{children:d||(0,r.jsxs)("div",g({className:(P="language",c&&(P+=" "+c),x&&(P+=" language-select"),P)},{children:[k,x&&C]}),void 0)},void 0)},y=function(e){var n,t=e.list,o=void 0===t?[]:t,a=e.render,l=e.className,u=e.onClick,s=function(e){return function(n){u&&u(e,n)}},c=(0,i.useMemo)((function(){var e=function(e){return(0,r.jsxs)(r.Fragment,{children:[e.icon&&(0,r.jsx)("span",g({className:"btn-list-item-icon"},{children:e.icon}),void 0),e.label&&(0,r.jsx)("span",g({className:"btn-list-item-label"},{children:e.label}),void 0)]},void 0)};return(0,r.jsx)(r.Fragment,{children:o.map((function(n,t){var i="btn-list-item";return n.sign&&(i+=" btn-list-item-sign"),(0,r.jsx)("div",g({className:i,onClick:s(n)},{children:e(n)}),t)}))},void 0)}),[o]);return(0,r.jsx)(r.Fragment,{children:a||(0,r.jsx)("div",g({className:(n="btn-list",l&&(n+=" "+l),n)},{children:c}),void 0)},void 0)},N=function(e){var n,t=e.img,l=e.imgRender,s=e.label,c=e.render,d=e.className,v=e.list,p=e.onClick,f=e.onClickMenu,m=e.selectValue,h=(0,i.useState)(!1),b=h[0],j=h[1],x=(0,i.useState)(null),y=x[0],N=x[1],O=(0,i.useState)({})[0],M=function(e){return function(){f&&f(e.value,e),j(!1)}},T=function(e){O.timer=setTimeout((function(){j(!1),N(null)}),100)},P=function(e){return function(n){clearTimeout(O.timer),j(!0),e&&N(n.target)}},S=(0,i.useMemo)((function(){var e=function(e){var n="menu-popover-item";return e.value===m&&(n+=" menu-popover-item-select"),n};return(0,o.createPortal)((0,r.jsx)((function(){var n;return(0,r.jsx)(a.Popper,g({open:b,anchorEl:y,disablePortal:!0,placement:"bottom-end",onMouseLeave:T,onMouseEnter:P(!1),className:"paraui-horizontal-meun-right-popover menu-popover"},{children:(0,r.jsx)("div",g({className:"menu-popover-box",style:(n={},y&&(n.width=y.getBoundingClientRect().width+"px"),n)},{children:v&&v.map((function(n,t){return(0,r.jsxs)("div",g({className:e(n),onClick:M(n)},{children:[n.icon&&(0,r.jsx)("span",g({className:"icon",style:{marginRight:"5px"}},{children:n.icon}),void 0),n.label&&(0,r.jsx)("span",g({className:"label"},{children:n.label}),void 0)]}),t)}))}),void 0)}),void 0)}),{},void 0),document.getElementsByTagName("body")[0])}),[v,m,b,y,O]);return(0,r.jsxs)("div",g({className:(n="logo",d&&(n+=" "+d),b&&(n+=" logo-show-dialog"),n),onClick:function(e){p&&p(e)},onMouseLeave:T,onMouseEnter:P(!0)},{children:[c||(0,r.jsxs)(r.Fragment,{children:[l||t&&(0,r.jsx)("img",{src:t,alt:""},void 0),s&&(0,r.jsx)("span",g({className:"label"},{children:s}),void 0),v&&v.length>0&&(0,r.jsx)("span",g({className:"arrow"},{children:(0,r.jsx)(u(),{},void 0)}),void 0)]},void 0),b&&S]}),void 0)},O=function(e){var n,t=e.className,o=void 0===t?"":t,a=e.backSelfcareProps,l=e.languageProps,u=e.btnListProps,s=e.userProps,c=e.render,d=(0,i.useMemo)((function(){return a&&(0,r.jsx)(j,g({},a),void 0)}),[a]),v=(0,i.useMemo)((function(){return l&&(0,r.jsx)(x,g({},l),void 0)}),[l]),p=(0,i.useMemo)((function(){return u&&(0,r.jsx)(y,g({},u),void 0)}),[u]),f=(0,i.useMemo)((function(){return s&&(0,r.jsx)(N,g({},s),void 0)}),[s]);return(0,r.jsx)(r.Fragment,{children:c||(0,r.jsxs)("div",g({className:(n="paraui-horizontal-meun-right",o&&(n+=" "+o),n)},{children:[d,v,p,f]}),void 0)},void 0)},M=function(){return M=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},M.apply(this,arguments)},T=function(e){var n,t=e.leftRender,o=e.menuListProps,a=e.footerProps,l=e.selectMenu,u=e.onClickMenu,s=e.className,c=(0,i.useMemo)((function(){return t&&(0,r.jsx)("div",M({className:"paraui-page-header-left"},{children:t}),void 0)}),[t]),d=(0,i.useMemo)((function(){return e.menuListProps&&(0,r.jsx)("div",M({className:"menu-box"},{children:(0,r.jsx)(h,M({},o,{selectMenu:l,onClickMenu:u}),void 0)}),void 0)}),[o,l,u]),v=(0,i.useMemo)((function(){return e.footerProps&&(0,r.jsx)(O,M({},a),void 0)}),[a]);return(0,r.jsxs)("div",M({className:(n="paraui-page-header",s&&(n+=" "+s),n)},{children:[c,d,v]}),void 0)},P=T},6885:function(e,n,t){var r=t(7712),i=t(1731),o=t(4927),a=function(){return a=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},a.apply(this,arguments)};n.default=function(e){var n,t=a(a({},e.classes),{popper:(0,o.Z)("paraui-tooltip",null===(n=e.classes)||void 0===n?void 0:n.popper)});return(0,r.jsx)(i.Tooltip,a({},e,{classes:t},{children:e.children}),void 0)}},1731:function(n){n.exports=e},1609:function(e){e.exports=n},6028:function(e){e.exports=t},2749:function(e){e.exports=r},1102:function(e){e.exports=i},6090:function(e){e.exports=o},3475:function(e){e.exports=a},9297:function(e){e.exports=l},2268:function(e){e.exports=u}},d={};function v(e){var n=d[e];if(void 0!==n)return n.exports;var t=d[e]={exports:{}};return c[e](t,t.exports,v),t.exports}v.m=c,s=[],v.O=function(e,n,t,r){if(!n){var i=1/0;for(l=0;l<s.length;l++){n=s[l][0],t=s[l][1],r=s[l][2];for(var o=!0,a=0;a<n.length;a++)(!1&r||i>=r)&&Object.keys(v.O).every((function(e){return v.O[e](n[a])}))?n.splice(a--,1):(o=!1,r<i&&(i=r));o&&(s.splice(l--,1),e=t())}return e}r=r||0;for(var l=s.length;l>0&&s[l-1][2]>r;l--)s[l]=s[l-1];s[l]=[n,t,r]},v.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return v.d(n,{a:n}),n},v.d=function(e,n){for(var t in n)v.o(n,t)&&!v.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},v.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},v.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e={3462:0,6615:0,2823:0,9296:0};v.O.j=function(n){return 0===e[n]};var n=function(n,t){var r,i,o=t[0],a=t[1],l=t[2],u=0;for(r in a)v.o(a,r)&&(v.m[r]=a[r]);if(l)var s=l(v);for(n&&n(t);u<o.length;u++)i=o[u],v.o(e,i)&&e[i]&&e[i][0](),e[o[u]]=0;return v.O(s)},t=self.webpackChunkParaUI=self.webpackChunkParaUI||[];t.forEach(n.bind(null,0)),t.push=n.bind(null,t.push.bind(t))}();var p=v.O(void 0,[9296],(function(){return v(7456)}));return p=v.O(p)}()}));
|
package/Pagination/index.js
CHANGED
|
@@ -13,4 +13,4 @@ var t=Object.getOwnPropertySymbols,n=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
|
-
n(4126);var i=n(9297),o=60103;if(t.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var r=Symbol.for;o=r("react.element"),t.Fragment=r("react.fragment")}var s=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a=Object.prototype.hasOwnProperty,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var i,r={},c=null,u=null;for(i in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)a.call(t,i)&&!l.hasOwnProperty(i)&&(r[i]=t[i]);if(e&&e.defaultProps)for(i in t=e.defaultProps)void 0===r[i]&&(r[i]=t[i]);return{$$typeof:o,type:e,key:c,ref:u,props:r,_owner:s.current}}t.jsx=c,t.jsxs=c},7712:function(e,t,n){e.exports=n(9524)},3094:function(e,t,n){var i=n(7712),o=n(9297),r=n(1731),s=function(){return s=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},s.apply(this,arguments)};t.default=function(e){var t=e.children,n=e.placement,a=void 0===n?"bottom-start":n,l=e.tips,c=void 0===l?"":l,u=e.className,d=void 0===u?"":u,f=(0,o.useRef)(),v=(0,o.useState)(""),p=v[0],m=v[1];(0,o.useEffect)((function(){m(c)}),[c]);var h;return(0,i.jsx)("div",s({ref:function(e){e&&(f.current=e)},className:(h="paraui-auto-tips",d&&(h+=" "+d),h),onMouseOver:function(){f.current.scrollWidth>f.current.offsetWidth?m(p||f.current.innerText):m("")}},{children:(0,i.jsx)(r.Tooltip,s({title:p,placement:a},{children:(0,i.jsx)("div",s({className:"auto-tips-content"},{children:t}),void 0)}),void 0)}),void 0)}},4905:function(e,t,n){n.r(t),n.d(t,{Pagination:function(){return g}});var i=n(7712),o=n(9297),r=n(3780),s=n.n(r),a=n(7428),l=n.n(a),c=n(934),u=n.n(c),d=n(1127),f=n.n(d),v=n(6288),p=n.n(v),m=n(370),h=n(3672),x=function(){return x=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},x.apply(this,arguments)},g=function(e){var t=e.className,n=e.type,r=void 0===n?"simple":n,a=e.total,c=void 0===a?0:a,d=e.rowsPerPage,v=void 0===d?[10,20,30]:d,g=e.currentRowsPerPage,j=void 0===g?10:g,y=e.page,b=void 0===y?1:y,w=e.skipFunc,N=e.changePage,S=e.changeRowsPerPage,k=(0,o.useState)(j),C=k[0],O=k[1],E=(0,o.useState)(b),q=E[0],P=E[1],L=(0,o.useState)(),D=L[0],M=L[1],T=(0,o.useState)(),F=T[0],I=T[1],R=(0,o.useState)([]),_=R[0],U=R[1];(0,o.useEffect)((function(){j!==C&&O(j)}),[j]),(0,o.useEffect)((function(){b!==q&&P(b)}),[b]),(0,o.useEffect)((function(){var e=Number(D);q>e&&e!==q&&P(e)}),[q,D]),(0,o.useEffect)((function(){var e=Math.ceil(c/C);M(e||1)}),[C,c]),(0,o.useEffect)((function(){for(var e=[],t=0,n=v.length;t<n;t++){var i=v[t],o={label:i.toString(),value:i};e.push(o)}U(e)}),[e.rowsPerPage]);var z,K=function(e){e!==C&&(O(e),S&&S(e))},A=function(e){return function(t){var n=q;switch(e){case"first":if(1===q)return;n=1;break;case"prev":if(1===q)return;n--;break;case"last":if(q===D)return;n=D;break;case"next":if(q===D)return;n++;break;case"pagination":n=t}void 0!==n&&P(n),N&&N(n)}},B=function(e){-1!==["E","e",".","-"].indexOf(e.key)&&e.preventDefault()},V=function(e){if(13===e.keyCode){var t=parseInt(F&&F.toString()||"0");t<=0&&I(t=1),t>Number(D)&&(t=Number(D),I(t)),w&&w(t,F),P(t),N&&N(t)}},H=function(e){I(e.target.value)},W=(0,o.useMemo)((function(){return(0,i.jsxs)("div",x({className:"total-num"},{children:["共",c,"条"]}),void 0)}),[c]),J=(0,o.useMemo)((function(){return(0,i.jsxs)("div",x({className:"page-line-memo"},{children:[(0,i.jsx)("span",{children:"每页行数"},void 0),(0,i.jsx)(m.default,{size:"medium",value:C,list:_,onChange:K},void 0)]}),void 0)}),[_,C]),$=(0,o.useMemo)((function(){return(0,i.jsxs)("div",x({className:"current-page"},{children:["当前第",(0,i.jsx)("span",x({className:"current-page-num"},{children:q}),void 0),(0,i.jsx)("span",x({className:"current-page-sign"},{children:"/"}),void 0),(0,i.jsx)("span",x({className:"current-page-last"},{children:D}),void 0),"页"]}),void 0)}),[q,D]),Y=(0,o.useMemo)((function(){return(0,i.jsxs)("div",x({className:"pagination-content"},{children:[(0,i.jsxs)("div",x({className:"left-page"},{children:[(0,i.jsx)("div",x({onClick:A("first"),className:1===q?"disabled-btn":""},{children:(0,i.jsx)(l(),{},void 0)}),void 0),(0,i.jsx)("div",x({onClick:A("prev"),className:1===q?"disabled-btn":""},{children:(0,i.jsx)(f(),{},void 0)}),void 0)]}),void 0),"complex"===r&&(0,i.jsx)(s(),{current:q,pageSize:C,total:c,jumpPrevIcon:"...",jumpNextIcon:"...",onChange:A("pagination"),showTitle:!1},void 0),(0,i.jsxs)("div",x({className:"right-page"},{children:[(0,i.jsx)("div",x({onClick:A("next"),className:q===D?"disabled-btn":""},{children:(0,i.jsx)(p(),{},void 0)}),void 0),(0,i.jsx)("div",x({onClick:A("last"),className:q===D?"disabled-btn":""},{children:(0,i.jsx)(u(),{},void 0)}),void 0)]}),void 0)]}),void 0)}),[c,q,D,C,r]),G=(0,o.useMemo)((function(){return(0,i.jsxs)("div",x({className:"skip-page-memo"},{children:[(0,i.jsx)("span",{children:"跳转到"},void 0),(0,i.jsx)(h.default,{size:"medium",type:"number",value:F||"",onChange:H,rightIcon:"页",onKeyDown:B,onKeyUp:V},void 0)]}),void 0)}),[F,D]);return(0,i.jsxs)("div",x({className:(z="paraui-pagination",t&&(z+=" "+t),z)},{children:["complex"===r&&W,$,J,Y,"complex"===r&&G]}),void 0)};t.default=g},370:function(e,t,n){var i=n(7712),o=n(9297),r=n(1731),s=n(6028),a=n.n(s),l=n(4115),c=n.n(l),u=n(6110),d=n.n(u),f=n(19),v=n.n(f),p=n(3094),m=n(3475),h=function(){return h=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},h.apply(this,arguments)},x=function(e,t,n){if(n||2===arguments.length)for(var i,o=0,r=t.length;o<r;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))};t.default=function(e){var t=e.className,n=e.size,s=void 0===n?"large":n,l=e.labelMode,u=void 0===l?"outside":l,f=e.placeholder,g=void 0===f?"":f,j=e.label,y=void 0===j?"":j,b=e.disabled,w=void 0!==b&&b,N=e.multiple,S=void 0!==N&&N,k=e.required,C=void 0!==k&&k,O=e.labelSign,E=e.error,q=void 0!==E&&E,P=e.helperText,L=void 0===P?"":P,D=e.list,M=e.showName,T=void 0===M?"label":M,F=e.showValue,I=void 0===F?"value":F,R=e.childrenName,_=void 0===R?"children":R,U=e.value,z=e.onChange,K=e.overLine,A=void 0!==K&&K,B=e.search,V=void 0!==B&&B,H=e.searchModel,W=void 0===H?"inside":H,J=e.selectPopoverClassName,$=e.morePopoverClassName,Y=e.onEnter,G=(0,o.useRef)(null),Q=(0,o.useState)("select-"+(0,m.UUID)())[0],X=(0,o.useState)("select-popover-"+(0,m.UUID)())[0],Z=(0,o.useState)(!1),ee=Z[0],te=Z[1],ne=(0,o.useState)(!1),ie=ne[0],oe=ne[1],re=(0,o.useState)([]),se=re[0],ae=re[1],le=(0,o.useState)([]),ce=le[0],ue=le[1],de=(0,o.useState)({}),fe=de[0],ve=de[1],pe=(0,o.useState)(null),me=pe[0],he=pe[1],xe=(0,o.useState)({})[0],ge=(0,o.useState)(!1),je=ge[0],ye=ge[1],be=(0,o.useState)(""),we=be[0],Ne=be[1],Se=(0,o.useState)(!1),ke=Se[0],Ce=Se[1],Oe=(0,o.useRef)(null);(0,o.useEffect)((function(){void 0!==e.defaultValue&&(e.multiple?ae((0,m.DeepClone)(e.defaultValue||[])):ae(""===e.defaultValue?[]:[e.defaultValue]))}),[]),(0,o.useEffect)((function(){void 0!==U&&ae(S?(0,m.DeepClone)(U||[]):""===U?[]:[U])}),[U,S]),(0,o.useEffect)((function(){if(V&&"outside"===W)return Ce(!!S);Ce(A)}),[A,V,W,S]),(0,o.useEffect)((function(){for(var e={},t=0,n=D.length;t<n;t++){var i=D[t];if(i[_]&&i[_].length>0)for(var o=i[_],r=0,s=o.length;r<s;r++){var a=o[r];e[a[I]]=a}else e[i[I]]=i}ve(e)}),[D]),(0,o.useEffect)((function(){S&&(ke||he(se.length))}),[ke,S,se]),(0,o.useEffect)((function(){return ke?he(se.length):(setTimeout((function(){Me(se.length)})),window.addEventListener("resize",Te)),function(){window.removeEventListener("resize",Te)}}),[se,ke]),(0,o.useEffect)((function(){se&&se.length>0?oe(!0):(oe(!1),V&&"outside"===W&&oe(""!==we))}),[V,we,W,se]),(0,o.useEffect)((function(){clearTimeout(xe.searchTimer),V&&""!==we.trim()?xe.searchTimer=setTimeout((function(){for(var e=[],t=(0,m.DeepClone)(D),n=0,i=t.length;n<i;n++){var o=t[n];if(o[_]&&o[_].length>0){for(var r=o[_],s=[],a=0,l=r.length;a<l;a++){var c=r[a];De(c)&&s.push(c)}s.length>0&&(o[_]=s,e.push(o))}else{De(o)&&e.push(o)}}ue(e)}),100):ue((0,m.DeepClone)(D))}),[V,we,D]),(0,o.useEffect)((function(){return ee?setTimeout((function(){qe(),window.addEventListener("click",Le),window.addEventListener("keydown",He)})):(Ne(""),window.removeEventListener("click",Le),window.removeEventListener("keydown",He)),function(){window.removeEventListener("click",Le),window.removeEventListener("keydown",He)}}),[ee]),(0,o.useEffect)((function(){we&&te(!0)}),[we]),(0,o.useEffect)((function(){S&&"outside"===W&&!0!==w&&Ae(we)}),[we,S,w,W]);var Ee,qe=function(){var e=Oe&&Oe.current;e&&e.focus()},Pe=function(e,t){for(var n=e.matches||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector;e&&!n.call(e,t);)e=e.parentElement;return e},Le=function(e){Pe(e.target,"."+X)||te(!1)},De=function(e){var t=!1;return-1!==e[T].indexOf(we)&&(t=!0),t},Me=function(e){if(null!==e&&0!==e){void 0===e&&(e=se.length);var t=document.querySelector("."+Q+" > .select-content > .check-select-content");if(t)if(t.scrollHeight>t.clientHeight){var n=Number(e)-1;he(n),Me(n)}else se.length<=e&&_e()}},Te=function(){clearTimeout(xe.timer),xe.timer=setTimeout((function(){he(se.length),Me()}),100)},Fe=function(){!0!==w&&te(!0)},Ie=function(){te(!1)},Re=function(e){ye(!0),te(!1),e.stopPropagation()},_e=function(){ye(!1)},Ue=function(t,n){return function(i){var o=t[I];if("object"!=typeof w||-1===w.indexOf(o))if(S){var r=se.indexOf(o);-1!==r?se.splice(r,1):se.push(o),void 0===e.value&&ae(x([],se,!0)),z&&z(x([],se,!0),i),n&&Y&&Y(x([],se,!0)),qe()}else void 0===e.value&&ae([o]),z&&z(o,i),n&&Y&&Y(o),Ie(),Ne("")}},ze=function(e,t){return function(n){var i;e||((i={})[I]=t,e=i),Ue(e)(n),n.stopPropagation()}},Ke=function(e){Ne(e.target.value)},Ae=function(e){var t=Oe&&Oe.current;if(!t)return null;var n=window.getComputedStyle(t),i=n.fontFamily,o=function(e,t,n){var i=document.createElement("span");i.id="referenceSpan";var o={};o.width=i.offsetWidth,o.height=i.offsetHeight,i.style.visibility="hidden",i.style.fontSize=e,i.style.fontFamily=t,i.style.display="inline-block";var r=document.getElementById("referenceSpan");return r&&document.body.removeChild(r),document.body.appendChild(i),void 0!==i.textContent?i.textContent=n:i.innerText=n,o.width=parseFloat(window.getComputedStyle(i).width)-o.width,o.height=parseFloat(window.getComputedStyle(i).height)-o.height,document.body.removeChild(i),o}(n.fontSize,i,e),r=o.width;r<10&&(r=10),t.style.width=r+"px"},Be=function(e){var t=e.selectDom,n=e.keyCode,i=e.currentKeydownDom,o=null,r="nextSibling",s=".select-popover-list > div",a=".select-popover-list-item";if(38===n&&(r="previousSibling",s=".select-popover-list > div:last-child",a=".select-popover-list-item:last-child"),i)if(o=i[r])-1!==o.className.indexOf("select-popover-list-group-label")&&((o=(o=i.parentNode)[r])||(o=t.querySelector(s)));else{var l=i.parentNode;l&&l.className&&-1!==l.className.indexOf("select-popover-list-group")&&(o=(o=i.parentNode)[r])||(o=t.querySelector(s))}else o=t.querySelector(s);if(o)if(-1!==o.className.indexOf("select-popover-list-group")){var c=o.querySelector(a);c&&(c.classList.add("select-popover-list-item-keydown"),Ve(c,t))}else o.classList.add("select-popover-list-item-keydown"),Ve(o,t)},Ve=function(e,t){clearTimeout(xe.scrollTimer);var n=t.clientHeight,i=e.offsetTop+e.clientHeight-n;xe.scroll=!0,t.scrollTop=i>0?i:0,xe.scrollTimer=setTimeout((function(){xe.scroll=!1}),100)},He=function(e){var t=document.querySelector("."+X+" .select-popover-list");if(t){var n=t.querySelector(".select-popover-list-item-select"),i=t.querySelector(".select-popover-list-item-hover"),o=t.querySelector(".select-popover-list-item-keydown"),r=n;if(i&&(r=i),13===e.keyCode){var s=o||i;if(s){var a=s.dataset.val;Ue(fe[a],!0)({target:o})}else Y&&Y(U)}o&&(r=o,o.classList.remove("select-popover-list-item-keydown")),40===e.keyCode&&Be({selectDom:t,keyCode:e.keyCode,currentKeydownDom:r}),38===e.keyCode&&Be({selectDom:t,keyCode:e.keyCode,currentKeydownDom:r})}},We=function(e){if(!xe.scroll){var t=Pe(e.target,".select-popover-list-item");if(t){t.classList.add("select-popover-list-item-hover");var n=document.querySelector("."+X).querySelector(".select-popover-list-item-keydown");n&&n.classList.remove("select-popover-list-item-keydown")}}},Je=function(e){var t=Pe(e.target,".select-popover-list-item");t&&t.classList.remove("select-popover-list-item-hover")},$e=(0,o.useMemo)((function(){var e=Boolean(y||C||O);return(0,i.jsx)(i.Fragment,{children:"outside"===u&&e&&(0,i.jsxs)("label",h({className:"select-label"},{children:[y,C&&(0,i.jsx)("span",h({className:"select-required"},{children:"*"}),void 0),O&&(0,i.jsx)("span",{children:O},void 0)]}),void 0)},void 0)}),[u,y,O,C]),Ye=(0,o.useMemo)((function(){return(0,i.jsx)(i.Fragment,{children:!ie&&(0,i.jsx)("span",h({className:"select-label-placeholder"},{children:"outside"===u?g:(0,i.jsxs)(i.Fragment,{children:[y||g,C&&(0,i.jsx)("span",h({className:"select-required"},{children:"*"}),void 0),O&&(0,i.jsx)("span",{children:O},void 0)]},void 0)}),void 0)},void 0)}),[ie,u,g,y,O,C]),Ge=(0,o.useMemo)((function(){return(0,i.jsx)(i.Fragment,{children:!S&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",h({className:"radio-select-content"},{children:function(){if(""!==we)return null;var e=fe[se[0]]&&fe[se[0]][T]||se[0];return ke?e:(0,i.jsx)(p.default,{children:e},void 0)}()}),void 0),V&&"outside"===W&&!0!==w&&(0,i.jsx)("input",{className:"radio-search-outside",value:we,onChange:Ke,ref:Oe},void 0)]},void 0)},void 0)}),[S,ie,ke,fe,se,T,V,W,we,w]),Qe=(0,o.useMemo)((function(){var e=function(e){return fe[se[e]]&&fe[se[e]][T]||se[e]};return(0,i.jsx)(i.Fragment,{children:S&&(0,i.jsxs)("div",h({className:"check-select-content"},{children:[se&&se.map((function(t,n){if(null!==me&&me<=n)return null;var o=!0;return(!0===w||"object"==typeof w&&-1!==w.indexOf(se[n]))&&(o=!1),(0,i.jsxs)("div",h({className:o?"check-select-content-item":"check-select-content-item check-select-content-item-noclose"},{children:[(0,i.jsx)("span",{children:e(n)},void 0),o&&(0,i.jsx)(v(),{onClick:ze(fe[se[n]],se[n])},void 0)]}),n)})),function(){if(null!==me&&se.length>me)return(0,i.jsx)("div",h({className:"check-select-content-item check-select-content-item-more",onClick:Re},{children:(0,i.jsxs)("span",{children:["+",se.length-me]},void 0)}),void 0)}(),V&&"outside"===W&&!0!==w&&(0,i.jsx)("input",{className:"check-search-outside",value:we,onChange:Ke,ref:Oe},void 0)]}),void 0)},void 0)}),[S,ie,se,me,fe,w,z,we,V,W]),Xe=(0,o.useMemo)((function(){return(0,i.jsxs)("div",h({className:"select-content",onClick:Fe,ref:G},{children:[Ye,(0,i.jsx)("span",h({className:"select-svg"},{children:(0,i.jsx)(a(),{},void 0)}),void 0),Ge,Qe]}),void 0)}),[G,ie,u,g,y,O,C,ke,fe,se,T,S,me,w,z,we,W]),Ze=(0,o.useMemo)((function(){return(0,i.jsx)("div",h({className:"select-popover-list"},{children:ce&&ce.length>0?(0,i.jsx)(i.Fragment,{children:ce.map((function(e,t){if(e[_]&&e[_].length>0){var n=e[_];return(0,i.jsxs)("div",h({className:"select-popover-list-group"},{children:[(0,i.jsx)("span",h({className:"select-popover-list-group-label"},{children:e[T]}),void 0),n.map((function(e,t){var n=e[I],o="select-popover-list-item";return-1!==se.indexOf(n)&&(o+=" select-popover-list-item-select"),"object"==typeof w&&-1!==w.indexOf(n)&&(o+=" select-popover-list-item-disabled"),(0,i.jsxs)("div",h({onClick:Ue(e),className:o,onMouseEnter:We,onMouseLeave:Je,"data-val":n},{children:[(0,i.jsx)("span",h({className:"select-popover-list-item-label"},{children:(0,i.jsx)(p.default,{children:e[T]},void 0)}),void 0),S&&(0,i.jsx)("span",h({className:"select-popover-list-item-svg"},{children:(0,i.jsx)(d(),{},void 0)}),void 0)]}),t)}))]}),t)}var o=e[I],r="select-popover-list-item";return-1!==se.indexOf(o)&&(r+=" select-popover-list-item-select"),"object"==typeof w&&-1!==w.indexOf(o)&&(r+=" select-popover-list-item-disabled"),(0,i.jsxs)("div",h({onClick:Ue(e),className:r,onMouseEnter:We,onMouseLeave:Je,"data-val":o},{children:[(0,i.jsx)("span",h({className:"select-popover-list-item-label"},{children:(0,i.jsx)(p.default,{children:e[T]},void 0)}),void 0),S&&(0,i.jsx)("span",h({className:"select-popover-list-item-svg"},{children:(0,i.jsx)(d(),{},void 0)}),void 0)]}),t)}))},void 0):(0,i.jsx)("div",h({className:"select-nodata"},{children:"暂无选项"}),void 0)}),void 0)}),[ce,T,I,se,z,S]),et=(0,o.useMemo)((function(){return(0,i.jsxs)("div",h({style:{width:(G&&G.current?G.current.offsetWidth:0)+"px"},className:"select-popover-content "+X},{children:[V&&"inside"===W&&(0,i.jsxs)("div",h({className:"select-popover-search"},{children:[(0,i.jsx)("input",{placeholder:"请输入搜索名",value:we,onChange:Ke,ref:Oe},void 0),(0,i.jsx)(c(),{},void 0)]}),void 0),Ze]}),void 0)}),[ee,G,ce,_,I,T,se,we,V,X,W,S]),tt=(0,o.useMemo)((function(){var e,t=function(e){return fe[se[e]]&&fe[se[e]][T]||se[e]};return(0,i.jsx)(r.Popover,h({open:je,anchorEl:G&&G.current,onClose:_e,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},className:(e="paraui-select-more-popover",s&&(e+=" paraui-select-more-popover-"+s),$&&(e+=" "+$),e)},{children:(0,i.jsxs)("div",h({className:"select-more"},{children:[(0,i.jsxs)("div",h({className:"select-more-title"},{children:[(0,i.jsx)("span",{children:"已选中"},void 0),(0,i.jsxs)("span",{children:["(",se.length-Number(me),")"]},void 0)]}),void 0),(0,i.jsx)("div",h({className:"select-more-content"},{children:se&&se.map((function(e,n){if(null!==me&&me>n)return null;var o=!0;return(!0===w||"object"==typeof w&&-1!==w.indexOf(se[n]))&&(o=!1),(0,i.jsxs)("div",h({className:"select-more-content-item"},{children:[(0,i.jsx)("span",{children:(0,i.jsx)(p.default,{children:t(n)},void 0)},void 0),o&&(0,i.jsx)(v(),{onClick:ze(fe[se[n]],se[n])},void 0)]}),n)}))}),void 0)]}),void 0)}),void 0)}),[je,se,me,fe,w,T,$,s]);return(0,i.jsxs)("div",h({className:(Ee="paraui-select select",S&&!ke&&(Ee+=" "+Q),t&&(Ee+=" "+t),s&&(Ee+=" select-"+s),q&&(Ee+=" select-error"),!0===w&&(Ee+=" select-disabled"),ee&&(Ee+=" select-open"),S&&(Ee+=" select-multiple"),ke&&(Ee+=" select-over-line"),Ee)},{children:[$e,(0,i.jsx)(r.Tooltip,h({open:ee,title:et,onClose:Ie,interactive:!0,disableFocusListener:!0,disableHoverListener:!0,disableTouchListener:!0,arrow:!0,classes:{popper:function(){var e="paraui-select-popover";return s&&(e+=" paraui-select-popover-"+s),e+=S?" paraui-select-popover-multiple":" paraui-select-popover-radio",J&&(e+=" "+J),e}()},placement:"bottom-start"},{children:Xe}),void 0),L&&(0,i.jsx)("p",h({className:"select-error-text"},{children:L}),void 0),tt]}),void 0)}},3672:function(e,t,n){var i=n(7712),o=n(9297),r=n(1731),s=n(3094),a=n(8528),l=n.n(a),c=n(6570),u=n.n(c),d=n(1102),f=n.n(d),v=n(3475),p=function(){return p=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},p.apply(this,arguments)},m=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n};t.default=function(e){var t=e.className,n=e.size,a=void 0===n?"large":n,c=e.labelMode,d=void 0===c?"outside":c,h=e.placeholder,x=void 0===h?"":h,g=e.label,j=void 0===g?"":g,y=e.disabled,b=void 0!==y&&y,w=e.multiline,N=void 0!==w&&w,S=e.required,k=void 0!==S&&S,C=e.labelSign,O=e.rows,E=void 0===O?2:O,q=e.error,P=void 0!==q&&q,L=e.helperText,D=void 0===L?"":L,M=e.addonBefore,T=void 0===M?"":M,F=e.addonAfter,I=void 0===F?"":F,R=(e.defaultValue,e.value),_=e.autoFocus,U=void 0!==_&&_,z=e.type,K=void 0===z?"text":z,A=e.onClickIcon,B=e.rightIcon,V=e.showRightIcon,H=void 0===V||V,W=e.limitLength,J=e.fetchSuggestions,$=e.selectPopoverClass,Y=e.renderSelectItem,G=e.showSelectName,Q=void 0===G?"value":G,X=e.onBlur,Z=e.onFocus,ee=e.onChange,te=e.onKeydown,ne=e.onKeyUp,ie=e.onEnter,oe=e.onClickAddonBefore,re=e.onClickAddonAfter,se=e.onSelect,ae=m(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"]),le=(0,o.useState)("text-field-select-content-"+(0,v.UUID)())[0],ce=(0,o.useState)(!0),ue=ce[0],de=ce[1],fe=(0,o.useState)(""),ve=fe[0],pe=fe[1],me=(0,o.useState)(!1),he=me[0],xe=me[1],ge=(0,o.useState)("text"),je=ge[0],ye=ge[1],be=(0,o.useState)(!1),we=be[0],Ne=be[1],Se=(0,o.useState)(!1),ke=Se[0],Ce=Se[1],Oe=(0,o.useState)([]),Ee=Oe[0],qe=Oe[1],Pe=(0,o.useRef)(null),Le=(0,o.useRef)(null);(0,o.useEffect)((function(){void 0!==e.defaultValue&&(pe(e.defaultValue),Me(e.defaultValue))}),[]),(0,o.useEffect)((function(){K!==je&&ye(K)}),[K]),(0,o.useEffect)((function(){void 0!==R&&(pe(R),Me(R))}),[R]),(0,o.useEffect)((function(){de(""===ve||void 0===ve)}),[ve]),(0,o.useEffect)((function(){J&&Ne(he)}),[he,J]),(0,o.useEffect)((function(){return we?window.addEventListener("keydown",Re):window.removeEventListener("keydown",Re),function(){window.removeEventListener("keydown",Re)}}),[we]);var De,Me=function(e){Pe&&Pe.current&&(Pe.current.value=e,Pe.current.setAttribute("value",e))},Te=function(){b||(de(!1),(Pe&&Pe.current).focus())},Fe=function(e){var t=e.selectDom,n=e.keyCode,i=e.currentDom,o="nextSibling",r=".text-field-select-content-item";38===n&&(o="previousSibling",r=".text-field-select-content-item:last-child"),i?(i=i[o])||(i=t.querySelector(r)):i=t.querySelector(".text-field-select-content-item"),i&&(i.classList.add("text-field-select-content-item-keydown"),Ie(i,t))},Ie=function(e,t){var n=t.clientHeight,i=e.offsetTop+e.clientHeight-n;t.scrollTop=i>0?i:0},Re=function(e){var t=document.querySelector("."+le),n=null,i=t.querySelector(".text-field-select-content-item-keydown");if(13===e.keyCode&&i){var o=i.dataset.val;We(JSON.parse(o))(e),(Pe&&Pe.current).blur()}i&&(n=i,i.classList.remove("text-field-select-content-item-keydown")),40===e.keyCode&&Fe({selectDom:t,keyCode:e.keyCode,currentDom:n}),38===e.keyCode&&Fe({selectDom:t,keyCode:e.keyCode,currentDom:n})},_e=function(e){xe(!1),""===e.target.value&&de(!0),X&&X(e)},Ue=function(e){Ce(!0),J&&J(e,(function(e){qe(e||[]),Ce(!1)}))},ze=function(e){xe(!0),Z&&Z(e),Ue(e.target.value)},Ke=function(t){var n=t.target.value;W&&void 0!==n&&""!==n&&n.toString().length>W||(void 0===e.value&&(pe(n),Me(n)),ee&&ee(t),Ue(t.target.value))},Ae=function(e){13===e.keyCode&&ie&&ie(e),te&&te(e)},Be=function(e){ne&&ne(e)},Ve=function(e){"password"===K&&("text"===je&&ye("password"),"password"===je&&ye("text")),A&&A(e)},He=function(){Ne(!1)},We=function(e){return function(t){se&&se(e)}},Je=(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]),$e=(0,o.useMemo)((function(){var e=B||("password"===K?"password"===je?(0,i.jsx)(u(),{},void 0):(0,i.jsx)(l(),{},void 0):null);return(0,i.jsx)(i.Fragment,{children:H&&e&&(0,i.jsx)("span",p({className:"right-icon",onClick:Ve},{children:e}),void 0)},void 0)}),[H,B,K,je]),Ye=(0,o.useMemo)((function(){return(0,i.jsxs)("div",p({className:"text-field-content-within",ref:Le},{children:[(0,i.jsxs)("div",p({className:"text-field-content-within-input"},{children:[N?(0,i.jsx)("textarea",p({ref:Pe,rows:E,onBlur:_e,onFocus:ze,onChange:Ke,onKeyDown:Ae,onKeyUp:Be,disabled:b},ae),void 0):(0,i.jsx)("input",p({ref:Pe,type:je,onBlur:_e,onFocus:ze,onChange:Ke,onKeyDown:Ae,onKeyUp:Be,disabled:b},ae),void 0),ue&&(0,i.jsx)("span",p({className:"text-field-label-placeholder",onClick:Te},{children:"outside"===d?x:(0,i.jsxs)(i.Fragment,{children:[j||x,k&&(0,i.jsx)("span",p({className:"text-field-required"},{children:"*"}),void 0),C&&(0,i.jsx)("span",{children:C},void 0)]},void 0)}),void 0)]}),void 0),Je,$e]}),void 0)}),[ue,U,je,ve,Je,$e,d,x,j,b,N,E,ae,ee,J]),Ge=(0,o.useMemo)((function(){var e;return(0,i.jsxs)("div",p({className:(e="text-field-select-content",ke&&(e+=" text-field-select-content-loading"),le&&(e+=" "+le),e),style:{width:(Le&&Le.current?Le.current.offsetWidth:0)+"px"}},{children:[Ee&&Ee.map((function(e,t){return(0,i.jsx)("div",p({className:"text-field-select-content-item",onMouseDown:We(e),"data-val":JSON.stringify(e)},{children:Y?Y(e):(0,i.jsx)(s.default,{children:e[Q]},void 0)}),t)})),ke&&(0,i.jsx)("div",p({className:"loading-box"},{children:(0,i.jsx)(f(),{},void 0)}),void 0)]}),void 0)}),[Le,we,Ee,Y,Q,se,ke,le]),Qe=(0,o.useMemo)((function(){return(0,i.jsx)(r.Tooltip,p({open:we,title:Ge,onClose:He,interactive:!0,disableFocusListener:!0,disableHoverListener:!0,disableTouchListener:!0,arrow:!0,classes:{popper:(e="paraui-text-field-select",a&&(e+=" paraui-text-field-select-"+a),$&&(e+=" "+$),e)}},{children:Ye}),void 0);var e}),[ue,U,je,ve,Je,$e,d,x,j,b,N,E,ae,ee,J,se,Le,we,$,a]),Xe=(0,o.useMemo)((function(){var e=Boolean(k||C||j);return(0,i.jsx)(i.Fragment,{children:"outside"===d&&e&&(0,i.jsxs)("label",p({className:"text-field-label"},{children:[j,k&&(0,i.jsx)("span",p({className:"text-field-required"},{children:"*"}),void 0),C&&(0,i.jsx)("span",{children:C},void 0)]}),void 0)},void 0)}),[d,j,C,k]);return(0,i.jsxs)("div",p({className:(De="paraui-text-field",De+=" text-field",a&&!N&&(De+=" text-field-"+a),t&&(De+=" "+t),P&&(De+=" text-field-error"),he&&(De+=" text-field-focus"),b&&(De+=" text-field-disabled"),N&&(De+=" text-field-multiline"),De)},{children:[Xe,(0,i.jsxs)("div",p({className:"text-field-content"},{children:[T&&(0,i.jsx)("div",p({className:"text-field-content-before",onClick:function(e){oe&&oe(e)}},{children:T}),void 0),J?Qe:Ye,I&&(0,i.jsx)("div",p({className:"text-field-content-after",onClick:function(e){re&&re(e)}},{children:I}),void 0)]}),void 0),D&&(0,i.jsx)("p",p({className:"text-field-error-text"},{children:D}),void 0)]}),void 0)}},1731:function(t){t.exports=e},6110:function(e){e.exports=t},19:function(e){e.exports=n},7428:function(e){e.exports=i},934:function(e){e.exports=o},6028:function(e){e.exports=r},1127:function(e){e.exports=s},1102:function(e){e.exports=a},6570:function(e){e.exports=l},8528:function(e){e.exports=c},6288:function(e){e.exports=u},4115:function(e){e.exports=d},3475:function(e){e.exports=f},3780:function(e){e.exports=v},9297:function(e){e.exports=p}},x={};function g(e){var t=x[e];if(void 0!==t)return t.exports;var n=x[e]={exports:{}};return h[e](n,n.exports,g),n.exports}g.m=h,m=[],g.O=function(e,t,n,i){if(!t){var o=1/0;for(a=0;a<m.length;a++){t=m[a][0],n=m[a][1],i=m[a][2];for(var r=!0,s=0;s<t.length;s++)(!1&i||o>=i)&&Object.keys(g.O).every((function(e){return g.O[e](t[s])}))?t.splice(s--,1):(r=!1,i<o&&(o=i));r&&(m.splice(a--,1),e=n())}return e}i=i||0;for(var a=m.length;a>0&&m[a-1][2]>i;a--)m[a]=m[a-1];m[a]=[t,n,i]},g.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return g.d(t,{a:t}),t},g.d=function(e,t){for(var n in t)g.o(t,n)&&!g.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},g.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},g.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e={8910:0,1465:0,8306:0,2996:0,9296:0};g.O.j=function(t){return 0===e[t]};var t=function(t,n){var i,o,r=n[0],s=n[1],a=n[2],l=0;for(i in s)g.o(s,i)&&(g.m[i]=s[i]);if(a)var c=a(g);for(t&&t(n);l<r.length;l++)o=r[l],g.o(e,o)&&e[o]&&e[o][0](),e[r[l]]=0;return g.O(c)},n=self.webpackChunkParaUI=self.webpackChunkParaUI||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}();var j=g.O(void 0,[9296],(function(){return g(4905)}));return j=g.O(j)}()}));
|
|
16
|
+
n(4126);var i=n(9297),o=60103;if(t.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var r=Symbol.for;o=r("react.element"),t.Fragment=r("react.fragment")}var s=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a=Object.prototype.hasOwnProperty,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var i,r={},c=null,u=null;for(i in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)a.call(t,i)&&!l.hasOwnProperty(i)&&(r[i]=t[i]);if(e&&e.defaultProps)for(i in t=e.defaultProps)void 0===r[i]&&(r[i]=t[i]);return{$$typeof:o,type:e,key:c,ref:u,props:r,_owner:s.current}}t.jsx=c,t.jsxs=c},7712:function(e,t,n){e.exports=n(9524)},3094:function(e,t,n){var i=n(7712),o=n(9297),r=n(1731),s=function(){return s=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},s.apply(this,arguments)};t.default=function(e){var t=e.children,n=e.placement,a=void 0===n?"bottom-start":n,l=e.tips,c=void 0===l?"":l,u=e.className,d=void 0===u?"":u,f=(0,o.useRef)(),v=(0,o.useState)(""),p=v[0],m=v[1];(0,o.useEffect)((function(){m(c)}),[c]);var h;return(0,i.jsx)("div",s({ref:function(e){e&&(f.current=e)},className:(h="paraui-auto-tips",d&&(h+=" "+d),h),onMouseOver:function(){f.current.scrollWidth>f.current.offsetWidth?m(p||f.current.innerText):m("")}},{children:(0,i.jsx)(r.Tooltip,s({title:p,placement:a},{children:(0,i.jsx)("div",s({className:"auto-tips-content"},{children:t}),void 0)}),void 0)}),void 0)}},4905:function(e,t,n){n.r(t),n.d(t,{Pagination:function(){return g}});var i=n(7712),o=n(9297),r=n(3780),s=n.n(r),a=n(7428),l=n.n(a),c=n(934),u=n.n(c),d=n(1127),f=n.n(d),v=n(6288),p=n.n(v),m=n(370),h=n(3672),x=function(){return x=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},x.apply(this,arguments)},g=function(e){var t=e.className,n=e.type,r=void 0===n?"simple":n,a=e.total,c=void 0===a?0:a,d=e.rowsPerPage,v=void 0===d?[10,20,30]:d,g=e.currentRowsPerPage,j=void 0===g?10:g,y=e.page,b=void 0===y?1:y,w=e.skipFunc,N=e.changePage,S=e.changeRowsPerPage,k=(0,o.useState)(j),C=k[0],O=k[1],E=(0,o.useState)(b),q=E[0],P=E[1],L=(0,o.useState)(),D=L[0],M=L[1],T=(0,o.useState)(),F=T[0],I=T[1],R=(0,o.useState)([]),_=R[0],U=R[1];(0,o.useEffect)((function(){j!==C&&O(j)}),[j]),(0,o.useEffect)((function(){b!==q&&P(b)}),[b]),(0,o.useEffect)((function(){var e=Number(D);q>e&&e!==q&&P(e)}),[q,D]),(0,o.useEffect)((function(){var e=Math.ceil(c/C);M(e||1)}),[C,c]),(0,o.useEffect)((function(){for(var e=[],t=0,n=v.length;t<n;t++){var i=v[t],o={label:i.toString(),value:i};e.push(o)}U(e)}),[e.rowsPerPage]);var z,K=function(e){e!==C&&(O(e),S&&S(e))},A=function(e){return function(t){var n=q;switch(e){case"first":if(1===q)return;n=1;break;case"prev":if(1===q)return;n--;break;case"last":if(q===D)return;n=D;break;case"next":if(q===D)return;n++;break;case"pagination":n=t}void 0!==n&&P(n),N&&N(n)}},B=function(e){-1!==["E","e",".","-"].indexOf(e.key)&&e.preventDefault()},V=function(e){if(13===e.keyCode){var t=parseInt(F&&F.toString()||"0");t<=0&&I(t=1),t>Number(D)&&(t=Number(D),I(t)),w&&w(t,F),P(t),N&&N(t)}},H=function(e){I(e.target.value)},W=(0,o.useMemo)((function(){return(0,i.jsxs)("div",x({className:"total-num"},{children:["共",c,"条"]}),void 0)}),[c]),J=(0,o.useMemo)((function(){return(0,i.jsxs)("div",x({className:"page-line-memo"},{children:[(0,i.jsx)("span",{children:"每页行数"},void 0),(0,i.jsx)(m.default,{size:"medium",value:C,list:_,onChange:K},void 0)]}),void 0)}),[_,C]),$=(0,o.useMemo)((function(){return(0,i.jsxs)("div",x({className:"current-page"},{children:["当前第",(0,i.jsx)("span",x({className:"current-page-num"},{children:q}),void 0),(0,i.jsx)("span",x({className:"current-page-sign"},{children:"/"}),void 0),(0,i.jsx)("span",x({className:"current-page-last"},{children:D}),void 0),"页"]}),void 0)}),[q,D]),Y=(0,o.useMemo)((function(){return(0,i.jsxs)("div",x({className:"pagination-content"},{children:[(0,i.jsxs)("div",x({className:"left-page"},{children:[(0,i.jsx)("div",x({onClick:A("first"),className:1===q?"disabled-btn":""},{children:(0,i.jsx)(l(),{},void 0)}),void 0),(0,i.jsx)("div",x({onClick:A("prev"),className:1===q?"disabled-btn":""},{children:(0,i.jsx)(f(),{},void 0)}),void 0)]}),void 0),"complex"===r&&(0,i.jsx)(s(),{current:q,pageSize:C,total:c,jumpPrevIcon:"...",jumpNextIcon:"...",onChange:A("pagination"),showTitle:!1},void 0),(0,i.jsxs)("div",x({className:"right-page"},{children:[(0,i.jsx)("div",x({onClick:A("next"),className:q===D?"disabled-btn":""},{children:(0,i.jsx)(p(),{},void 0)}),void 0),(0,i.jsx)("div",x({onClick:A("last"),className:q===D?"disabled-btn":""},{children:(0,i.jsx)(u(),{},void 0)}),void 0)]}),void 0)]}),void 0)}),[c,q,D,C,r]),G=(0,o.useMemo)((function(){return(0,i.jsxs)("div",x({className:"skip-page-memo"},{children:[(0,i.jsx)("span",{children:"跳转到"},void 0),(0,i.jsx)(h.default,{size:"medium",type:"number",value:F||"",onChange:H,rightIcon:"页",onKeyDown:B,onKeyUp:V},void 0)]}),void 0)}),[F,D]);return(0,i.jsxs)("div",x({className:(z="paraui-pagination",t&&(z+=" "+t),z)},{children:["complex"===r&&W,$,J,Y,"complex"===r&&G]}),void 0)};t.default=g},370:function(e,t,n){var i=n(7712),o=n(9297),r=n(1731),s=n(6028),a=n.n(s),l=n(4115),c=n.n(l),u=n(6110),d=n.n(u),f=n(19),v=n.n(f),p=n(3094),m=n(3475),h=function(){return h=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},h.apply(this,arguments)},x=function(e,t,n){if(n||2===arguments.length)for(var i,o=0,r=t.length;o<r;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))};t.default=function(e){var t=e.className,n=e.size,s=void 0===n?"large":n,l=e.labelMode,u=void 0===l?"outside":l,f=e.placeholder,g=void 0===f?"":f,j=e.label,y=void 0===j?"":j,b=e.disabled,w=void 0!==b&&b,N=e.multiple,S=void 0!==N&&N,k=e.required,C=void 0!==k&&k,O=e.labelSign,E=e.error,q=void 0!==E&&E,P=e.helperText,L=void 0===P?"":P,D=e.list,M=e.showName,T=void 0===M?"label":M,F=e.showValue,I=void 0===F?"value":F,R=e.childrenName,_=void 0===R?"children":R,U=e.value,z=e.onChange,K=e.overLine,A=void 0!==K&&K,B=e.search,V=void 0!==B&&B,H=e.searchModel,W=void 0===H?"inside":H,J=e.selectPopoverClassName,$=e.morePopoverClassName,Y=e.onEnter,G=(0,o.useRef)(null),Q=(0,o.useState)("select-"+(0,m.UUID)())[0],X=(0,o.useState)("select-popover-"+(0,m.UUID)())[0],Z=(0,o.useState)(!1),ee=Z[0],te=Z[1],ne=(0,o.useState)(!1),ie=ne[0],oe=ne[1],re=(0,o.useState)([]),se=re[0],ae=re[1],le=(0,o.useState)([]),ce=le[0],ue=le[1],de=(0,o.useState)({}),fe=de[0],ve=de[1],pe=(0,o.useState)(null),me=pe[0],he=pe[1],xe=(0,o.useState)({})[0],ge=(0,o.useState)(!1),je=ge[0],ye=ge[1],be=(0,o.useState)(""),we=be[0],Ne=be[1],Se=(0,o.useState)(!1),ke=Se[0],Ce=Se[1],Oe=(0,o.useRef)(null);(0,o.useEffect)((function(){void 0!==e.defaultValue&&(e.multiple?ae((0,m.DeepClone)(e.defaultValue||[])):ae(""===e.defaultValue?[]:[e.defaultValue]))}),[]),(0,o.useEffect)((function(){void 0!==U&&ae(S?(0,m.DeepClone)(U||[]):""===U?[]:[U])}),[U,S]),(0,o.useEffect)((function(){if(V&&"outside"===W)return Ce(!!S);Ce(A)}),[A,V,W,S]),(0,o.useEffect)((function(){for(var e={},t=0,n=D.length;t<n;t++){var i=D[t];if(i[_]&&i[_].length>0)for(var o=i[_],r=0,s=o.length;r<s;r++){var a=o[r];e[a[I]]=a}else e[i[I]]=i}ve(e)}),[D]),(0,o.useEffect)((function(){S&&(ke||he(se.length))}),[ke,S,se]),(0,o.useEffect)((function(){return ke?he(se.length):(setTimeout((function(){Me(se.length)})),window.addEventListener("resize",Te)),function(){window.removeEventListener("resize",Te)}}),[se,ke]),(0,o.useEffect)((function(){se&&se.length>0?oe(!0):(oe(!1),V&&"outside"===W&&oe(""!==we))}),[V,we,W,se]),(0,o.useEffect)((function(){clearTimeout(xe.searchTimer),V&&""!==we.trim()?xe.searchTimer=setTimeout((function(){for(var e=[],t=(0,m.DeepClone)(D),n=0,i=t.length;n<i;n++){var o=t[n];if(o[_]&&o[_].length>0){for(var r=o[_],s=[],a=0,l=r.length;a<l;a++){var c=r[a];De(c)&&s.push(c)}s.length>0&&(o[_]=s,e.push(o))}else{De(o)&&e.push(o)}}ue(e)}),100):ue((0,m.DeepClone)(D))}),[V,we,D]),(0,o.useEffect)((function(){return ee?setTimeout((function(){qe(),window.addEventListener("click",Le),window.addEventListener("keydown",He)})):(Ne(""),window.removeEventListener("click",Le),window.removeEventListener("keydown",He)),function(){window.removeEventListener("click",Le),window.removeEventListener("keydown",He)}}),[ee]),(0,o.useEffect)((function(){we&&te(!0)}),[we]),(0,o.useEffect)((function(){S&&"outside"===W&&!0!==w&&Ae(we)}),[we,S,w,W]);var Ee,qe=function(){var e=Oe&&Oe.current;e&&e.focus()},Pe=function(e,t){for(var n=e.matches||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector;e&&!n.call(e,t);)e=e.parentElement;return e},Le=function(e){Pe(e.target,"."+X)||te(!1)},De=function(e){var t=!1;return-1!==e[T].indexOf(we)&&(t=!0),t},Me=function(e){if(null!==e&&0!==e){void 0===e&&(e=se.length);var t=document.querySelector("."+Q+" > .select-content > .check-select-content");if(t)if(t.scrollHeight>t.clientHeight){var n=Number(e)-1;he(n),Me(n)}else se.length<=e&&_e()}},Te=function(){clearTimeout(xe.timer),xe.timer=setTimeout((function(){he(se.length),Me()}),100)},Fe=function(){!0!==w&&te(!0)},Ie=function(){te(!1)},Re=function(e){ye(!0),te(!1),e.stopPropagation()},_e=function(){ye(!1)},Ue=function(t,n){return function(i){var o=t[I];if("object"!=typeof w||-1===w.indexOf(o))if(S){var r=se.indexOf(o);-1!==r?se.splice(r,1):se.push(o),void 0===e.value&&ae(x([],se,!0)),z&&z(x([],se,!0),i),n&&Y&&Y(x([],se,!0)),qe()}else void 0===e.value&&ae([o]),z&&z(o,i),n&&Y&&Y(o),Ie(),Ne("")}},ze=function(e,t){return function(n){var i;e||((i={})[I]=t,e=i),Ue(e)(n),n.stopPropagation()}},Ke=function(e){Ne(e.target.value)},Ae=function(e){var t=Oe&&Oe.current;if(!t)return null;var n=window.getComputedStyle(t),i=n.fontFamily,o=function(e,t,n){var i=document.createElement("span");i.id="referenceSpan";var o={};o.width=i.offsetWidth,o.height=i.offsetHeight,i.style.visibility="hidden",i.style.fontSize=e,i.style.fontFamily=t,i.style.display="inline-block";var r=document.getElementById("referenceSpan");return r&&document.body.removeChild(r),document.body.appendChild(i),void 0!==i.textContent?i.textContent=n:i.innerText=n,o.width=parseFloat(window.getComputedStyle(i).width)-o.width,o.height=parseFloat(window.getComputedStyle(i).height)-o.height,document.body.removeChild(i),o}(n.fontSize,i,e),r=o.width;r<10&&(r=10),t.style.width=r+"px"},Be=function(e){var t=e.selectDom,n=e.keyCode,i=e.currentKeydownDom,o=null,r="nextSibling",s=".select-popover-list > div",a=".select-popover-list-item";if(38===n&&(r="previousSibling",s=".select-popover-list > div:last-child",a=".select-popover-list-item:last-child"),i)if(o=i[r])-1!==o.className.indexOf("select-popover-list-group-label")&&((o=(o=i.parentNode)[r])||(o=t.querySelector(s)));else{var l=i.parentNode;l&&l.className&&-1!==l.className.indexOf("select-popover-list-group")&&(o=(o=i.parentNode)[r])||(o=t.querySelector(s))}else o=t.querySelector(s);if(o)if(-1!==o.className.indexOf("select-popover-list-group")){var c=o.querySelector(a);c&&(c.classList.add("select-popover-list-item-keydown"),Ve(c,t))}else o.classList.add("select-popover-list-item-keydown"),Ve(o,t)},Ve=function(e,t){clearTimeout(xe.scrollTimer);var n=t.clientHeight,i=e.offsetTop+e.clientHeight-n;xe.scroll=!0,t.scrollTop=i>0?i:0,xe.scrollTimer=setTimeout((function(){xe.scroll=!1}),100)},He=function(e){var t=document.querySelector("."+X+" .select-popover-list");if(t){var n=t.querySelector(".select-popover-list-item-select"),i=t.querySelector(".select-popover-list-item-hover"),o=t.querySelector(".select-popover-list-item-keydown"),r=n;if(i&&(r=i),13===e.keyCode){var s=o||i;if(s){var a=s.dataset.val;Ue(fe[a],!0)({target:o})}else Y&&Y(U)}o&&(r=o,o.classList.remove("select-popover-list-item-keydown")),40===e.keyCode&&Be({selectDom:t,keyCode:e.keyCode,currentKeydownDom:r}),38===e.keyCode&&Be({selectDom:t,keyCode:e.keyCode,currentKeydownDom:r})}},We=function(e){if(!xe.scroll){var t=Pe(e.target,".select-popover-list-item");if(t){t.classList.add("select-popover-list-item-hover");var n=document.querySelector("."+X).querySelector(".select-popover-list-item-keydown");n&&n.classList.remove("select-popover-list-item-keydown")}}},Je=function(e){var t=Pe(e.target,".select-popover-list-item");t&&t.classList.remove("select-popover-list-item-hover")},$e=(0,o.useMemo)((function(){var e=Boolean(y||C||O);return(0,i.jsx)(i.Fragment,{children:"outside"===u&&e&&(0,i.jsxs)("label",h({className:"select-label"},{children:[y,C&&(0,i.jsx)("span",h({className:"select-required"},{children:"*"}),void 0),O&&(0,i.jsx)("span",{children:O},void 0)]}),void 0)},void 0)}),[u,y,O,C]),Ye=(0,o.useMemo)((function(){return(0,i.jsx)(i.Fragment,{children:!ie&&(0,i.jsx)("span",h({className:"select-label-placeholder"},{children:"outside"===u?g:(0,i.jsxs)(i.Fragment,{children:[y||g,C&&(0,i.jsx)("span",h({className:"select-required"},{children:"*"}),void 0),O&&(0,i.jsx)("span",{children:O},void 0)]},void 0)}),void 0)},void 0)}),[ie,u,g,y,O,C]),Ge=(0,o.useMemo)((function(){return(0,i.jsx)(i.Fragment,{children:!S&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",h({className:"radio-select-content"},{children:function(){if(""!==we)return null;var e=fe[se[0]]&&fe[se[0]][T]||se[0];return ke?e:(0,i.jsx)(p.default,{children:e},void 0)}()}),void 0),V&&"outside"===W&&!0!==w&&(0,i.jsx)("input",{className:"radio-search-outside",value:we,onChange:Ke,ref:Oe},void 0)]},void 0)},void 0)}),[S,ie,ke,fe,se,T,V,W,we,w]),Qe=(0,o.useMemo)((function(){var e=function(e){return fe[se[e]]&&fe[se[e]][T]||se[e]};return(0,i.jsx)(i.Fragment,{children:S&&(0,i.jsxs)("div",h({className:"check-select-content"},{children:[se&&se.map((function(t,n){if(null!==me&&me<=n)return null;var o=!0;return(!0===w||"object"==typeof w&&-1!==w.indexOf(se[n]))&&(o=!1),(0,i.jsxs)("div",h({className:o?"check-select-content-item":"check-select-content-item check-select-content-item-noclose"},{children:[(0,i.jsx)("span",{children:e(n)},void 0),o&&(0,i.jsx)(v(),{onClick:ze(fe[se[n]],se[n])},void 0)]}),n)})),function(){if(null!==me&&se.length>me)return(0,i.jsx)("div",h({className:"check-select-content-item check-select-content-item-more",onClick:Re},{children:(0,i.jsxs)("span",{children:["+",se.length-me]},void 0)}),void 0)}(),V&&"outside"===W&&!0!==w&&(0,i.jsx)("input",{className:"check-search-outside",value:we,onChange:Ke,ref:Oe},void 0)]}),void 0)},void 0)}),[S,ie,se,me,fe,w,z,we,V,W]),Xe=(0,o.useMemo)((function(){return(0,i.jsxs)("div",h({className:"select-content",onClick:Fe,ref:G},{children:[Ye,(0,i.jsx)("span",h({className:"select-svg"},{children:(0,i.jsx)(a(),{},void 0)}),void 0),Ge,Qe]}),void 0)}),[G,ie,u,g,y,O,C,ke,fe,se,T,S,me,w,z,we,W]),Ze=(0,o.useMemo)((function(){return(0,i.jsx)("div",h({className:"select-popover-list"},{children:ce&&ce.length>0?(0,i.jsx)(i.Fragment,{children:ce.map((function(e,t){if(e[_]&&e[_].length>0){var n=e[_];return(0,i.jsxs)("div",h({className:"select-popover-list-group"},{children:[(0,i.jsx)("span",h({className:"select-popover-list-group-label"},{children:e[T]}),void 0),n.map((function(e,t){var n=e[I],o="select-popover-list-item";return-1!==se.indexOf(n)&&(o+=" select-popover-list-item-select"),"object"==typeof w&&-1!==w.indexOf(n)&&(o+=" select-popover-list-item-disabled"),(0,i.jsxs)("div",h({onClick:Ue(e),className:o,onMouseEnter:We,onMouseLeave:Je,"data-val":n},{children:[(0,i.jsx)("span",h({className:"select-popover-list-item-label"},{children:(0,i.jsx)(p.default,{children:e[T]},void 0)}),void 0),S&&(0,i.jsx)("span",h({className:"select-popover-list-item-svg"},{children:(0,i.jsx)(d(),{},void 0)}),void 0)]}),t)}))]}),t)}var o=e[I],r="select-popover-list-item";return-1!==se.indexOf(o)&&(r+=" select-popover-list-item-select"),"object"==typeof w&&-1!==w.indexOf(o)&&(r+=" select-popover-list-item-disabled"),(0,i.jsxs)("div",h({onClick:Ue(e),className:r,onMouseEnter:We,onMouseLeave:Je,"data-val":o},{children:[(0,i.jsx)("span",h({className:"select-popover-list-item-label"},{children:(0,i.jsx)(p.default,{children:e[T]},void 0)}),void 0),S&&(0,i.jsx)("span",h({className:"select-popover-list-item-svg"},{children:(0,i.jsx)(d(),{},void 0)}),void 0)]}),t)}))},void 0):(0,i.jsx)("div",h({className:"select-nodata"},{children:"暂无选项"}),void 0)}),void 0)}),[ce,T,I,se,z,S]),et=(0,o.useMemo)((function(){return(0,i.jsxs)("div",h({style:{width:(G&&G.current?G.current.offsetWidth:0)+"px"},className:"select-popover-content "+X},{children:[V&&"inside"===W&&(0,i.jsxs)("div",h({className:"select-popover-search"},{children:[(0,i.jsx)("input",{placeholder:"请输入搜索名",value:we,onChange:Ke,ref:Oe},void 0),(0,i.jsx)(c(),{},void 0)]}),void 0),Ze]}),void 0)}),[ee,G,ce,_,I,T,se,we,V,X,W,S]),tt=(0,o.useMemo)((function(){var e,t=function(e){return fe[se[e]]&&fe[se[e]][T]||se[e]};return(0,i.jsx)(r.Popover,h({open:je,anchorEl:G&&G.current,onClose:_e,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},className:(e="paraui-select-more-popover",s&&(e+=" paraui-select-more-popover-"+s),$&&(e+=" "+$),e)},{children:(0,i.jsxs)("div",h({className:"select-more"},{children:[(0,i.jsxs)("div",h({className:"select-more-title"},{children:[(0,i.jsx)("span",{children:"已选中"},void 0),(0,i.jsxs)("span",{children:["(",se.length-Number(me),")"]},void 0)]}),void 0),(0,i.jsx)("div",h({className:"select-more-content"},{children:se&&se.map((function(e,n){if(null!==me&&me>n)return null;var o=!0;return(!0===w||"object"==typeof w&&-1!==w.indexOf(se[n]))&&(o=!1),(0,i.jsxs)("div",h({className:"select-more-content-item"},{children:[(0,i.jsx)("span",{children:(0,i.jsx)(p.default,{children:t(n)},void 0)},void 0),o&&(0,i.jsx)(v(),{onClick:ze(fe[se[n]],se[n])},void 0)]}),n)}))}),void 0)]}),void 0)}),void 0)}),[je,se,me,fe,w,T,$,s]);return(0,i.jsxs)("div",h({className:(Ee="paraui-select select",S&&!ke&&(Ee+=" "+Q),t&&(Ee+=" "+t),s&&(Ee+=" select-"+s),q&&(Ee+=" select-error"),!0===w&&(Ee+=" select-disabled"),ee&&(Ee+=" select-open"),S&&(Ee+=" select-multiple"),ke&&(Ee+=" select-over-line"),Ee)},{children:[$e,(0,i.jsx)(r.Tooltip,h({open:ee,title:et,onClose:Ie,interactive:!0,disableFocusListener:!0,disableHoverListener:!0,disableTouchListener:!0,arrow:!0,classes:{popper:function(){var e="paraui-select-popover";return s&&(e+=" paraui-select-popover-"+s),e+=S?" paraui-select-popover-multiple":" paraui-select-popover-radio",J&&(e+=" "+J),e}()},placement:"bottom-start"},{children:Xe}),void 0),L&&(0,i.jsx)("p",h({className:"select-error-text"},{children:L}),void 0),tt]}),void 0)}},3672:function(e,t,n){var i=n(7712),o=n(9297),r=n(1731),s=n(3094),a=n(8528),l=n.n(a),c=n(6570),u=n.n(c),d=n(1102),f=n.n(d),v=n(3475),p=function(){return p=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},p.apply(this,arguments)},m=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n};t.default=function(e){var t=e.className,n=e.size,a=void 0===n?"large":n,c=e.labelMode,d=void 0===c?"outside":c,h=e.placeholder,x=void 0===h?"":h,g=e.label,j=void 0===g?"":g,y=e.disabled,b=void 0!==y&&y,w=e.multiline,N=void 0!==w&&w,S=e.required,k=void 0!==S&&S,C=e.labelSign,O=e.rows,E=void 0===O?2:O,q=e.error,P=void 0!==q&&q,L=e.helperText,D=void 0===L?"":L,M=e.addonBefore,T=void 0===M?"":M,F=e.addonAfter,I=void 0===F?"":F,R=(e.defaultValue,e.value),_=e.autoFocus,U=void 0!==_&&_,z=e.type,K=void 0===z?"text":z,A=e.onClickIcon,B=e.rightIcon,V=e.showRightIcon,H=void 0===V||V,W=e.limitLength,J=e.fetchSuggestions,$=e.selectPopoverClass,Y=e.renderSelectItem,G=e.showSelectName,Q=void 0===G?"value":G,X=e.onBlur,Z=e.onFocus,ee=e.onChange,te=e.onKeydown,ne=e.onKeyUp,ie=e.onEnter,oe=e.onClickAddonBefore,re=e.onClickAddonAfter,se=e.onSelect,ae=m(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"]),le=(0,o.useState)("text-field-select-content-"+(0,v.UUID)())[0],ce=(0,o.useState)(!0),ue=ce[0],de=ce[1],fe=(0,o.useState)(""),ve=fe[0],pe=fe[1],me=(0,o.useState)(!1),he=me[0],xe=me[1],ge=(0,o.useState)("text"),je=ge[0],ye=ge[1],be=(0,o.useState)(!1),we=be[0],Ne=be[1],Se=(0,o.useState)(!1),ke=Se[0],Ce=Se[1],Oe=(0,o.useState)([]),Ee=Oe[0],qe=Oe[1],Pe=(0,o.useRef)(null),Le=(0,o.useRef)(null);(0,o.useEffect)((function(){void 0!==e.defaultValue&&(pe(e.defaultValue),Me(e.defaultValue))}),[]),(0,o.useEffect)((function(){K!==je&&ye(K)}),[K]),(0,o.useEffect)((function(){void 0!==R&&(pe(R),Me(R))}),[R]),(0,o.useEffect)((function(){de(""===ve||void 0===ve)}),[ve]),(0,o.useEffect)((function(){J&&Ne(he)}),[he,J]),(0,o.useEffect)((function(){return we?window.addEventListener("keydown",Re):window.removeEventListener("keydown",Re),function(){window.removeEventListener("keydown",Re)}}),[we]);var De,Me=function(e){Pe&&Pe.current&&(Pe.current.value=e,Pe.current.setAttribute("value",e))},Te=function(){b||(de(!1),(Pe&&Pe.current).focus())},Fe=function(e){var t=e.selectDom,n=e.keyCode,i=e.currentDom,o="nextSibling",r=".text-field-select-content-item";38===n&&(o="previousSibling",r=".text-field-select-content-item:last-child"),i?(i=i[o])||(i=t.querySelector(r)):i=t.querySelector(".text-field-select-content-item"),i&&(i.classList.add("text-field-select-content-item-keydown"),Ie(i,t))},Ie=function(e,t){var n=t.clientHeight,i=e.offsetTop+e.clientHeight-n;t.scrollTop=i>0?i:0},Re=function(e){var t=document.querySelector("."+le),n=null,i=t.querySelector(".text-field-select-content-item-keydown");if(13===e.keyCode&&i){var o=i.dataset.val;We(JSON.parse(o))(e),(Pe&&Pe.current).blur()}i&&(n=i,i.classList.remove("text-field-select-content-item-keydown")),40===e.keyCode&&Fe({selectDom:t,keyCode:e.keyCode,currentDom:n}),38===e.keyCode&&Fe({selectDom:t,keyCode:e.keyCode,currentDom:n})},_e=function(e){xe(!1),""===e.target.value&&de(!0),X&&X(e)},Ue=function(e){Ce(!0),J&&J(e,(function(e){qe(e||[]),Ce(!1)}))},ze=function(e){xe(!0),Z&&Z(e),Ue(e.target.value)},Ke=function(t){var n=t.target.value;n&&de(!1),W&&void 0!==n&&""!==n&&n.toString().length>W||(void 0===e.value&&(pe(n),Me(n)),ee&&ee(t),Ue(t.target.value))},Ae=function(e){13===e.keyCode&&ie&&ie(e),te&&te(e)},Be=function(e){ne&&ne(e)},Ve=function(e){"password"===K&&("text"===je&&ye("password"),"password"===je&&ye("text")),A&&A(e)},He=function(){Ne(!1)},We=function(e){return function(t){se&&se(e)}},Je=(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]),$e=(0,o.useMemo)((function(){var e=B||("password"===K?"password"===je?(0,i.jsx)(u(),{},void 0):(0,i.jsx)(l(),{},void 0):null);return(0,i.jsx)(i.Fragment,{children:H&&e&&(0,i.jsx)("span",p({className:"right-icon",onClick:Ve},{children:e}),void 0)},void 0)}),[H,B,K,je]),Ye=(0,o.useMemo)((function(){return(0,i.jsxs)("div",p({className:"text-field-content-within",ref:Le},{children:[(0,i.jsxs)("div",p({className:"text-field-content-within-input"},{children:[N?(0,i.jsx)("textarea",p({ref:Pe,rows:E,onBlur:_e,onFocus:ze,onChange:Ke,onKeyDown:Ae,onKeyUp:Be,disabled:b},ae),void 0):(0,i.jsx)("input",p({ref:Pe,type:je,onBlur:_e,onFocus:ze,onChange:Ke,onKeyDown:Ae,onKeyUp:Be,disabled:b},ae),void 0),ue&&(0,i.jsx)("span",p({className:"text-field-label-placeholder",onClick:Te},{children:"outside"===d?x:(0,i.jsxs)(i.Fragment,{children:[j||x,k&&(0,i.jsx)("span",p({className:"text-field-required"},{children:"*"}),void 0),C&&(0,i.jsx)("span",{children:C},void 0)]},void 0)}),void 0)]}),void 0),Je,$e]}),void 0)}),[ue,U,je,ve,Je,$e,d,x,j,b,N,E,ae,ee,J]),Ge=(0,o.useMemo)((function(){var e;return(0,i.jsxs)("div",p({className:(e="text-field-select-content",ke&&(e+=" text-field-select-content-loading"),le&&(e+=" "+le),e),style:{width:(Le&&Le.current?Le.current.offsetWidth:0)+"px"}},{children:[Ee&&Ee.map((function(e,t){return(0,i.jsx)("div",p({className:"text-field-select-content-item",onMouseDown:We(e),"data-val":JSON.stringify(e)},{children:Y?Y(e):(0,i.jsx)(s.default,{children:e[Q]},void 0)}),t)})),ke&&(0,i.jsx)("div",p({className:"loading-box"},{children:(0,i.jsx)(f(),{},void 0)}),void 0)]}),void 0)}),[Le,we,Ee,Y,Q,se,ke,le]),Qe=(0,o.useMemo)((function(){return(0,i.jsx)(r.Tooltip,p({open:we,title:Ge,onClose:He,interactive:!0,disableFocusListener:!0,disableHoverListener:!0,disableTouchListener:!0,arrow:!0,classes:{popper:(e="paraui-text-field-select",a&&(e+=" paraui-text-field-select-"+a),$&&(e+=" "+$),e)}},{children:Ye}),void 0);var e}),[ue,U,je,ve,Je,$e,d,x,j,b,N,E,ae,ee,J,se,Le,we,$,a]),Xe=(0,o.useMemo)((function(){var e=Boolean(k||C||j);return(0,i.jsx)(i.Fragment,{children:"outside"===d&&e&&(0,i.jsxs)("label",p({className:"text-field-label"},{children:[j,k&&(0,i.jsx)("span",p({className:"text-field-required"},{children:"*"}),void 0),C&&(0,i.jsx)("span",{children:C},void 0)]}),void 0)},void 0)}),[d,j,C,k]);return(0,i.jsxs)("div",p({className:(De="paraui-text-field",De+=" text-field",a&&!N&&(De+=" text-field-"+a),t&&(De+=" "+t),P&&(De+=" text-field-error"),he&&(De+=" text-field-focus"),b&&(De+=" text-field-disabled"),N&&(De+=" text-field-multiline"),De)},{children:[Xe,(0,i.jsxs)("div",p({className:"text-field-content"},{children:[T&&(0,i.jsx)("div",p({className:"text-field-content-before",onClick:function(e){oe&&oe(e)}},{children:T}),void 0),J?Qe:Ye,I&&(0,i.jsx)("div",p({className:"text-field-content-after",onClick:function(e){re&&re(e)}},{children:I}),void 0)]}),void 0),D&&(0,i.jsx)("p",p({className:"text-field-error-text"},{children:D}),void 0)]}),void 0)}},1731:function(t){t.exports=e},6110:function(e){e.exports=t},19:function(e){e.exports=n},7428:function(e){e.exports=i},934:function(e){e.exports=o},6028:function(e){e.exports=r},1127:function(e){e.exports=s},1102:function(e){e.exports=a},6570:function(e){e.exports=l},8528:function(e){e.exports=c},6288:function(e){e.exports=u},4115:function(e){e.exports=d},3475:function(e){e.exports=f},3780:function(e){e.exports=v},9297:function(e){e.exports=p}},x={};function g(e){var t=x[e];if(void 0!==t)return t.exports;var n=x[e]={exports:{}};return h[e](n,n.exports,g),n.exports}g.m=h,m=[],g.O=function(e,t,n,i){if(!t){var o=1/0;for(a=0;a<m.length;a++){t=m[a][0],n=m[a][1],i=m[a][2];for(var r=!0,s=0;s<t.length;s++)(!1&i||o>=i)&&Object.keys(g.O).every((function(e){return g.O[e](t[s])}))?t.splice(s--,1):(r=!1,i<o&&(o=i));r&&(m.splice(a--,1),e=n())}return e}i=i||0;for(var a=m.length;a>0&&m[a-1][2]>i;a--)m[a]=m[a-1];m[a]=[t,n,i]},g.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return g.d(t,{a:t}),t},g.d=function(e,t){for(var n in t)g.o(t,n)&&!g.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},g.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},g.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e={8910:0,1465:0,8306:0,2996:0,9296:0};g.O.j=function(t){return 0===e[t]};var t=function(t,n){var i,o,r=n[0],s=n[1],a=n[2],l=0;for(i in s)g.o(s,i)&&(g.m[i]=s[i]);if(a)var c=a(g);for(t&&t(n);l<r.length;l++)o=r[l],g.o(e,o)&&e[o]&&e[o][0](),e[r[l]]=0;return g.O(c)},n=self.webpackChunkParaUI=self.webpackChunkParaUI||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}();var j=g.O(void 0,[9296],(function(){return g(4905)}));return j=g.O(j)}()}));
|
package/PopConfirm/index.d.ts
CHANGED
package/PopConfirm/index.js
CHANGED
|
@@ -13,4 +13,4 @@ var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,e=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
|
-
i(4126);var e=i(9297),o=60103;if(r.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var t=Symbol.for;o=t("react.element"),r.Fragment=t("react.fragment")}var a=e.__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(n,r,i){var e,t={},l=null,u=null;for(e in void 0!==i&&(l=""+i),void 0!==r.key&&(l=""+r.key),void 0!==r.ref&&(u=r.ref),r)c.call(r,e)&&!s.hasOwnProperty(e)&&(t[e]=r[e]);if(n&&n.defaultProps)for(e in r=n.defaultProps)void 0===t[e]&&(t[e]=r[e]);return{$$typeof:o,type:n,key:l,ref:u,props:t,_owner:a.current}}r.jsx=l,r.jsxs=l},7712:function(n,r,i){n.exports=i(9524)},2990:function(n,r,i){i.d(r,{default:function(){return j}});var e=i(7712),o=i(9297),t=i(1731),a=i(4927),c=i(1102),s=i.n(c),l=i(2749),u=i.n(l),p=i(6885),d=i(6028),f=i.n(d),v=function(){return v=Object.assign||function(n){for(var r,i=1,e=arguments.length;i<e;i++)for(var o in r=arguments[i])Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o]);return n},v.apply(this,arguments)};var b=function(){return b=Object.assign||function(n){for(var r,i=1,e=arguments.length;i<e;i++)for(var o in r=arguments[i])Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o]);return n},b.apply(this,arguments)},h=function(n,r){var i={};for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&r.indexOf(e)<0&&(i[e]=n[e]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(e=Object.getOwnPropertySymbols(n);o<e.length;o++)r.indexOf(e[o])<0&&Object.prototype.propertyIsEnumerable.call(n,e[o])&&(i[e[o]]=n[e[o]])}return i},m=function(n){var r=n.variant,i=void 0===r?"contained":r,c=n.size,l=void 0===c?"large":c,d=n.className,f=n.disabled,v=void 0!==f&&f,m=n.children,j=n.startIcon,g=n.endIcon,y=n.loading,x=void 0!==y&&y,O=n.toolTipTitle,C=void 0===O?"":O,w=n.danger,P=void 0!==w&&w,k=h(n,["variant","size","className","disabled","children","startIcon","endIcon","loading","toolTipTitle","danger"]),N=(0,o.useState)(!1),F=N[0],T=N[1],S=function(n){if(!F)return"start"===n&&j?(0,e.jsx)("span",b({className:(0,a.Z)("btn-icon","start-icon")},{children:j}),void 0):"end"===n&&g?(0,e.jsx)("span",b({className:(0,a.Z)("btn-icon","end-icon")},{children:g}),void 0):null;if("object"==typeof x){var r=x.delay||0;setTimeout((function(){return T(!1)}),r)}return"start"===n?(0,e.jsx)("span",b({className:"btn-icon loading-icon"},{children:(0,e.jsx)(s(),{},void 0)}),void 0):null},_=(0,e.jsx)(t.Button,b({},k,{color:"default",variant:"outlined",disabled:v,disableRipple:!0,disableElevation:!0,className:(0,a.Z)("paraui-button",d,"paraui-button-".concat(i),"paraui-button-".concat(l),F&&"paraui-button-loading",P&&!v&&"paraui-button-dangerous"),startIcon:S("start"),endIcon:S("end")},{children:m}),void 0);return(0,o.useEffect)((function(){T(!!x)}),[x]),v&&C?(0,e.jsx)(p.default,b({title:function(){if(v&&C){return(0,e.jsxs)("span",{children:[(0,e.jsx)(u(),{style:{marginRight:"4px",fontSize:"11px",color:"inherit"}},void 0),C]},void 0)}return C}()},{children:(0,e.jsx)("span",b({className:"paraui-button--disabled"},{children:_}),void 0)}),void 0):_};m.IconButton=function(n){var r=n.variant,i=void 0===r?"contained":r,c=n.size,l=void 0===c?"large":c,d=n.toolTipTitle,f=void 0===d?"":d,v=n.children,m=n.className,j=n.disabled,g=void 0!==j&&j,y=n.loading,x=void 0!==y&&y,O=n.TooltipProps,C=n.danger,w=void 0!==C&&C,P=h(n,["variant","size","toolTipTitle","children","className","disabled","loading","TooltipProps","danger"]),k=(0,o.useState)(!1),N=k[0],F=k[1],T=(0,e.jsx)(t.IconButton,b({},P,{disabled:g,disableRipple:!0,className:(0,a.Z)("paraui-icon-button",m,"paraui-icon-button-".concat(i),"paraui-icon-button-".concat(l),N&&"paraui-icon-button-loading",w&&!g&&"paraui-icon-button-dangerous")},{children:function(){if(!N)return v;if("object"==typeof x){var n=x.delay||0;setTimeout((function(){return F(!1)}),n)}return(0,e.jsx)("span",b({className:"loading-icon"},{children:(0,e.jsx)(s(),{},void 0)}),void 0)}()}),void 0);return(0,o.useEffect)((function(){F(!!x)}),[x]),f?(0,e.jsx)(p.default,b({},O,{title:function(){if(g&&f){return(0,e.jsxs)("span",{children:[(0,e.jsx)(u(),{style:{marginRight:"4px",fontSize:"11px",color:"inherit"}},void 0),f]},void 0)}return f}()},{children:g?(0,e.jsx)("span",b({className:"paraui-button--disabled"},{children:T}),void 0):T}),void 0):T},m.SplitButton=function(n){var r=n.buttonText,i=n.options,c=void 0===i?[]:i,s=n.className,l=n.disabled,u=void 0!==l&&l,p=n.onClick,d=n.optionRender,b=(0,o.useState)(!1),h=b[0],m=b[1],g=(0,o.useRef)(null),y=(0,o.useRef)(),x=(0,o.useState)(0),O=x[0],C=x[1],w=function(n,r,i){var e;C(r),m(!1),null===(e=y.current)||void 0===e||e.classList.remove("paraui-button-split--active"),null==p||p(n,i)},P=function(n){var r,i;(null===(r=g.current)||void 0===r?void 0:r.contains(n.target))||(m(!1),null===(i=y.current)||void 0===i||i.classList.remove("paraui-button-split--active"))},k=function(){return(0,e.jsx)("div",v({className:"paraui-button-split-list"},{children:(0,e.jsx)("ul",{children:c.map((function(n,r){return Array.isArray(n)?function(n,r){return(0,e.jsx)("li",v({className:"split-li-group"},{children:n.map((function(n,i){var o="".concat(r,"-").concat(i);return(0,e.jsx)("div",v({className:(0,a.Z)("split-li",o===O&&"split-li--active"),onClick:function(r){return w(n,o,r)}},{children:(null==d?void 0:d(n))||n.label}),o)}))}),r)}(n,r):(0,e.jsx)("li",v({className:(0,a.Z)("split-li",r===O&&"split-li--active"),onClick:function(i){return w(n,r,i)}},{children:(null==d?void 0:d(n))||n.label}),r)}))},void 0)}),void 0)};return(0,e.jsxs)("div",v({className:(0,a.Z)("paraui-button-split",s),ref:g,onMouseLeave:function(n){var r;n.stopPropagation(),null===(r=n.currentTarget.firstElementChild)||void 0===r||r.classList.remove("paraui-button-split--active"),m(!1)}},{children:[(0,e.jsx)(j,v({variant:"outlined",onMouseEnter:function(n){n.stopPropagation();var r=n.currentTarget;y.current=r,r.classList.add("paraui-button-split--active"),m(!0)},startIcon:(0,e.jsx)(f(),{},void 0),disabled:u},{children:null!=r?r:"更多操作"}),void 0),(0,e.jsx)(t.Popper,v({open:h,anchorEl:g.current,transition:!0,placement:"bottom-end"},{children:function(n){var r=n.TransitionProps;n.placement;return(0,e.jsx)(t.Grow,v({},r,{children:(0,e.jsx)(e.Fragment,{children:(0,e.jsx)(t.ClickAwayListener,v({onClickAway:P},{children:k()}),void 0)},void 0)}),void 0)}}),void 0)]}),void 0)};var j=m},5598:function(n,r,i){i.r(r),i.d(r,{PopConfirm:function(){return j}});var e=i(7712),o=i(9297),t=i(1731),a=i(3285),c=i.n(a),s=i(6897),l=i.n(s),u=i(20),p=i.n(u),d=i(9248),f=i.n(d),v=i(2990),b=i(4927),h=function(){return h=Object.assign||function(n){for(var r,i=1,e=arguments.length;i<e;i++)for(var o in r=arguments[i])Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o]);return n},h.apply(this,arguments)},m={success:(0,e.jsx)(c(),{},void 0),warning:(0,e.jsx)(f(),{},void 0),error:(0,e.jsx)(p(),{},void 0),info:(0,e.jsx)(l(),{},void 0)},j=function(n){var r=n.trigger,i=void 0===r?"click":r,a=n.type,c=void 0===a?"warning":a,s=n.title,l=n.icon,u=n.okText,p=n.cancelText,d=n.onOk,f=n.onCancel,j=n.okButtonProps,g=n.cancelButtonProps,y=n.placement,x=void 0===y?"bottom":y,O=n.className,C=n.children,w={interactive:!0,arrow:!1},P="click"===i;P?(w.disableFocusListener=!0,w.disableHoverListener=!0,w.disableTouchListener=!0):w.disableFocusListener=!0;var k,N=(0,o.useState)(!1),F=N[0],T=N[1],S=function(){T(!1)},_=function(){T(!0)},q=function(){S()},I=(0,e.jsxs)("div",h({className:(0,b.Z)("popconfirm-wrapper"),onClick:function(n){return n.stopPropagation()}},{children:[(0,e.jsxs)("div",h({className:"popconfirm-message"},{children:[(0,e.jsx)("span",h({className:"popconfirm-message-icon"},{children:l||m[c]}),void 0),(0,e.jsx)("div",h({className:"popconfirm-message-title"},{children:s}),void 0)]}),void 0),(0,e.jsxs)("div",h({className:"popconfirm-btns"},{children:[(0,e.jsx)(v.default,h({onClick:function(){null==f||f(),S()}},g,{variant:"outlined",size:"small"},{children:p||"取消"}),void 0),(0,e.jsx)(v.default,h({onClick:function(){null==d||d(),S()}},j,{variant:"contained",size:"small"},{children:u||"确定"}),void 0)]}),void 0)]}),void 0);return(0,e.jsx)(e.Fragment,{children:(k=(0,e.jsx)(t.Tooltip,h({open:F,placement:x},w,{title:I,onClose:S,onOpen:_,classes:{popper:(0,b.Z)("paraui-popconfirm",O),tooltip:"paraui-popconfirm-tooltip",arrow:"paraui-popconfirm-arrow"}},{children:P?(0,e.jsx)("span",h({onClick:_,className:"paraui-popconfirm-anchor"},{children:C}),void 0):(0,e.jsx)("span",h({className:"paraui-popconfirm-anchor"},{children:C}),void 0)}),void 0),P?(0,e.jsx)(t.ClickAwayListener,h({onClickAway:q},{children:k}),void 0):k)},void 0)};r.default=j},6885:function(n,r,i){var e=i(7712),o=i(1731),t=i(4927),a=function(){return a=Object.assign||function(n){for(var r,i=1,e=arguments.length;i<e;i++)for(var o in r=arguments[i])Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o]);return n},a.apply(this,arguments)};r.default=function(n){var r,i=a(a({},n.classes),{popper:(0,t.Z)("paraui-tooltip",null===(r=n.classes)||void 0===r?void 0:r.popper)});return(0,e.jsx)(o.Tooltip,a({},n,{classes:i},{children:n.children}),void 0)}},1731:function(r){r.exports=n},3285:function(n){n.exports=r},20:function(n){n.exports=i},6028:function(n){n.exports=e},2749:function(n){n.exports=o},1102:function(n){n.exports=t},6897:function(n){n.exports=a},9248:function(n){n.exports=c},9297:function(n){n.exports=s}},p={};function d(n){var r=p[n];if(void 0!==r)return r.exports;var i=p[n]={exports:{}};return u[n](i,i.exports,d),i.exports}d.m=u,l=[],d.O=function(n,r,i,e){if(!r){var o=1/0;for(c=0;c<l.length;c++){r=l[c][0],i=l[c][1],e=l[c][2];for(var t=!0,a=0;a<r.length;a++)(!1&e||o>=e)&&Object.keys(d.O).every((function(n){return d.O[n](r[a])}))?r.splice(a--,1):(t=!1,e<o&&(o=e));t&&(l.splice(c--,1),n=i())}return n}e=e||0;for(var c=l.length;c>0&&l[c-1][2]>e;c--)l[c]=l[c-1];l[c]=[r,i,e]},d.n=function(n){var r=n&&n.__esModule?function(){return n.default}:function(){return n};return d.d(r,{a:r}),r},d.d=function(n,r){for(var i in r)d.o(r,i)&&!d.o(n,i)&&Object.defineProperty(n,i,{enumerable:!0,get:r[i]})},d.o=function(n,r){return Object.prototype.hasOwnProperty.call(n,r)},d.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},function(){var n={7095:0,6615:0,2823:0,9296:0};d.O.j=function(r){return 0===n[r]};var r=function(r,i){var e,o,t=i[0],a=i[1],c=i[2],s=0;for(e in a)d.o(a,e)&&(d.m[e]=a[e]);if(c)var l=c(d);for(r&&r(i);s<t.length;s++)o=t[s],d.o(n,o)&&n[o]&&n[o][0](),n[t[s]]=0;return d.O(l)},i=self.webpackChunkParaUI=self.webpackChunkParaUI||[];i.forEach(r.bind(null,0)),i.push=r.bind(null,i.push.bind(i))}();var f=d.O(void 0,[9296],(function(){return d(5598)}));return f=d.O(f)}()}));
|
|
16
|
+
i(4126);var e=i(9297),o=60103;if(r.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var t=Symbol.for;o=t("react.element"),r.Fragment=t("react.fragment")}var a=e.__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(n,r,i){var e,t={},l=null,u=null;for(e in void 0!==i&&(l=""+i),void 0!==r.key&&(l=""+r.key),void 0!==r.ref&&(u=r.ref),r)c.call(r,e)&&!s.hasOwnProperty(e)&&(t[e]=r[e]);if(n&&n.defaultProps)for(e in r=n.defaultProps)void 0===t[e]&&(t[e]=r[e]);return{$$typeof:o,type:n,key:l,ref:u,props:t,_owner:a.current}}r.jsx=l,r.jsxs=l},7712:function(n,r,i){n.exports=i(9524)},2990:function(n,r,i){i.d(r,{default:function(){return j}});var e=i(7712),o=i(9297),t=i(1731),a=i(4927),c=i(1102),s=i.n(c),l=i(2749),u=i.n(l),p=i(6885),d=i(6028),f=i.n(d),v=function(){return v=Object.assign||function(n){for(var r,i=1,e=arguments.length;i<e;i++)for(var o in r=arguments[i])Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o]);return n},v.apply(this,arguments)};var b=function(){return b=Object.assign||function(n){for(var r,i=1,e=arguments.length;i<e;i++)for(var o in r=arguments[i])Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o]);return n},b.apply(this,arguments)},m=function(n,r){var i={};for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&r.indexOf(e)<0&&(i[e]=n[e]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(e=Object.getOwnPropertySymbols(n);o<e.length;o++)r.indexOf(e[o])<0&&Object.prototype.propertyIsEnumerable.call(n,e[o])&&(i[e[o]]=n[e[o]])}return i},h=function(n){var r=n.variant,i=void 0===r?"contained":r,c=n.size,l=void 0===c?"large":c,d=n.className,f=n.disabled,v=void 0!==f&&f,h=n.children,j=n.startIcon,g=n.endIcon,y=n.loading,x=void 0!==y&&y,O=n.toolTipTitle,C=void 0===O?"":O,w=n.danger,N=void 0!==w&&w,P=m(n,["variant","size","className","disabled","children","startIcon","endIcon","loading","toolTipTitle","danger"]),k=(0,o.useState)(!1),F=k[0],T=k[1],S=function(n){if(!F)return"start"===n&&j?(0,e.jsx)("span",b({className:(0,a.Z)("btn-icon","start-icon")},{children:j}),void 0):"end"===n&&g?(0,e.jsx)("span",b({className:(0,a.Z)("btn-icon","end-icon")},{children:g}),void 0):null;if("object"==typeof x){var r=x.delay||0;setTimeout((function(){return T(!1)}),r)}return"start"===n?(0,e.jsx)("span",b({className:"btn-icon loading-icon"},{children:(0,e.jsx)(s(),{},void 0)}),void 0):null},_=(0,e.jsx)(t.Button,b({},P,{color:"default",variant:"outlined",disabled:v,disableRipple:!0,disableElevation:!0,className:(0,a.Z)("paraui-button",d,"paraui-button-".concat(i),"paraui-button-".concat(l),F&&"paraui-button-loading",N&&!v&&"paraui-button-dangerous"),startIcon:S("start"),endIcon:S("end")},{children:h}),void 0);return(0,o.useEffect)((function(){T(!!x)}),[x]),v&&C?(0,e.jsx)(p.default,b({title:function(){if(v&&C){return(0,e.jsxs)("span",{children:[(0,e.jsx)(u(),{style:{marginRight:"4px",fontSize:"11px",color:"inherit"}},void 0),C]},void 0)}return C}()},{children:(0,e.jsx)("span",b({className:"paraui-button--disabled"},{children:_}),void 0)}),void 0):_};h.IconButton=function(n){var r=n.variant,i=void 0===r?"contained":r,c=n.size,l=void 0===c?"large":c,d=n.toolTipTitle,f=void 0===d?"":d,v=n.children,h=n.className,j=n.disabled,g=void 0!==j&&j,y=n.loading,x=void 0!==y&&y,O=n.TooltipProps,C=n.danger,w=void 0!==C&&C,N=m(n,["variant","size","toolTipTitle","children","className","disabled","loading","TooltipProps","danger"]),P=(0,o.useState)(!1),k=P[0],F=P[1],T=(0,e.jsx)(t.IconButton,b({},N,{disabled:g,disableRipple:!0,className:(0,a.Z)("paraui-icon-button",h,"paraui-icon-button-".concat(i),"paraui-icon-button-".concat(l),k&&"paraui-icon-button-loading",w&&!g&&"paraui-icon-button-dangerous")},{children:function(){if(!k)return v;if("object"==typeof x){var n=x.delay||0;setTimeout((function(){return F(!1)}),n)}return(0,e.jsx)("span",b({className:"loading-icon"},{children:(0,e.jsx)(s(),{},void 0)}),void 0)}()}),void 0);return(0,o.useEffect)((function(){F(!!x)}),[x]),f?(0,e.jsx)(p.default,b({},O,{title:function(){if(g&&f){return(0,e.jsxs)("span",{children:[(0,e.jsx)(u(),{style:{marginRight:"4px",fontSize:"11px",color:"inherit"}},void 0),f]},void 0)}return f}()},{children:g?(0,e.jsx)("span",b({className:"paraui-button--disabled"},{children:T}),void 0):T}),void 0):T},h.SplitButton=function(n){var r=n.buttonText,i=n.options,c=void 0===i?[]:i,s=n.className,l=n.disabled,u=void 0!==l&&l,p=n.onClick,d=n.optionRender,b=(0,o.useState)(!1),m=b[0],h=b[1],g=(0,o.useRef)(null),y=(0,o.useRef)(),x=(0,o.useState)(0),O=x[0],C=x[1],w=function(n,r,i){var e;C(r),h(!1),null===(e=y.current)||void 0===e||e.classList.remove("paraui-button-split--active"),null==p||p(n,i)},N=function(n){var r,i;(null===(r=g.current)||void 0===r?void 0:r.contains(n.target))||(h(!1),null===(i=y.current)||void 0===i||i.classList.remove("paraui-button-split--active"))},P=function(){return(0,e.jsx)("div",v({className:"paraui-button-split-list"},{children:(0,e.jsx)("ul",{children:c.map((function(n,r){return Array.isArray(n)?function(n,r){return(0,e.jsx)("li",v({className:"split-li-group"},{children:n.map((function(n,i){var o="".concat(r,"-").concat(i);return(0,e.jsx)("div",v({className:(0,a.Z)("split-li",o===O&&"split-li--active"),onClick:function(r){return w(n,o,r)}},{children:(null==d?void 0:d(n))||n.label}),o)}))}),r)}(n,r):(0,e.jsx)("li",v({className:(0,a.Z)("split-li",r===O&&"split-li--active"),onClick:function(i){return w(n,r,i)}},{children:(null==d?void 0:d(n))||n.label}),r)}))},void 0)}),void 0)};return(0,e.jsxs)("div",v({className:(0,a.Z)("paraui-button-split",s),ref:g,onMouseLeave:function(n){var r;n.stopPropagation(),null===(r=n.currentTarget.firstElementChild)||void 0===r||r.classList.remove("paraui-button-split--active"),h(!1)}},{children:[(0,e.jsx)(j,v({variant:"outlined",onMouseEnter:function(n){n.stopPropagation();var r=n.currentTarget;y.current=r,r.classList.add("paraui-button-split--active"),h(!0)},startIcon:(0,e.jsx)(f(),{},void 0),disabled:u},{children:null!=r?r:"更多操作"}),void 0),(0,e.jsx)(t.Popper,v({open:m,anchorEl:g.current,transition:!0,placement:"bottom-end"},{children:function(n){var r=n.TransitionProps;n.placement;return(0,e.jsx)(t.Grow,v({},r,{children:(0,e.jsx)(e.Fragment,{children:(0,e.jsx)(t.ClickAwayListener,v({onClickAway:N},{children:P()}),void 0)},void 0)}),void 0)}}),void 0)]}),void 0)};var j=h},5598:function(n,r,i){i.r(r),i.d(r,{PopConfirm:function(){return j}});var e=i(7712),o=i(9297),t=i(1731),a=i(3285),c=i.n(a),s=i(6897),l=i.n(s),u=i(20),p=i.n(u),d=i(9248),f=i.n(d),v=i(2990),b=i(4927),m=function(){return m=Object.assign||function(n){for(var r,i=1,e=arguments.length;i<e;i++)for(var o in r=arguments[i])Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o]);return n},m.apply(this,arguments)},h={success:(0,e.jsx)(c(),{},void 0),warning:(0,e.jsx)(f(),{},void 0),error:(0,e.jsx)(p(),{},void 0),info:(0,e.jsx)(l(),{},void 0)},j=function(n){var r=n.trigger,i=void 0===r?"click":r,a=n.type,c=void 0===a?"warning":a,s=n.title,l=n.content,u=n.icon,p=n.okText,d=n.cancelText,f=n.onOk,j=n.onCancel,g=n.okButtonProps,y=n.cancelButtonProps,x=n.placement,O=void 0===x?"bottom":x,C=n.className,w=n.children,N={interactive:!0,arrow:!1},P="click"===i;P?(N.disableFocusListener=!0,N.disableHoverListener=!0,N.disableTouchListener=!0):N.disableFocusListener=!0;var k,F=(0,o.useState)(!1),T=F[0],S=F[1],_=function(){S(!1)},q=function(){S(!0)},I=function(){_()},L=(0,e.jsxs)("div",m({className:(0,b.Z)("popconfirm-wrapper"),onClick:function(n){return n.stopPropagation()}},{children:[(0,e.jsxs)("div",m({className:"popconfirm-message"},{children:[(0,e.jsx)("span",m({className:"popconfirm-message-icon"},{children:u||h[c]}),void 0),(0,e.jsxs)("div",m({className:"popconfirm-message-body"},{children:[s&&(0,e.jsx)("div",m({className:"popconfirm-message-title"},{children:s}),void 0),(0,e.jsx)("div",m({className:"popconfirm-message-content"},{children:l}),void 0)]}),void 0)]}),void 0),(0,e.jsxs)("div",m({className:"popconfirm-btns"},{children:[(0,e.jsx)(v.default,m({onClick:function(){null==j||j(),_()}},y,{variant:"outlined",size:"small"},{children:d||"取消"}),void 0),(0,e.jsx)(v.default,m({onClick:function(){null==f||f(),_()}},g,{variant:"contained",size:"small"},{children:p||"确定"}),void 0)]}),void 0)]}),void 0);return(0,e.jsx)(e.Fragment,{children:(k=(0,e.jsx)(t.Tooltip,m({open:T,placement:O},N,{title:L,onClose:_,onOpen:q,classes:{popper:(0,b.Z)("paraui-popconfirm",C),tooltip:"paraui-popconfirm-tooltip",arrow:"paraui-popconfirm-arrow"}},{children:P?(0,e.jsx)("span",m({onClick:q,className:"paraui-popconfirm-anchor"},{children:w}),void 0):(0,e.jsx)("span",m({className:"paraui-popconfirm-anchor"},{children:w}),void 0)}),void 0),P?(0,e.jsx)(t.ClickAwayListener,m({onClickAway:I},{children:k}),void 0):k)},void 0)};r.default=j},6885:function(n,r,i){var e=i(7712),o=i(1731),t=i(4927),a=function(){return a=Object.assign||function(n){for(var r,i=1,e=arguments.length;i<e;i++)for(var o in r=arguments[i])Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o]);return n},a.apply(this,arguments)};r.default=function(n){var r,i=a(a({},n.classes),{popper:(0,t.Z)("paraui-tooltip",null===(r=n.classes)||void 0===r?void 0:r.popper)});return(0,e.jsx)(o.Tooltip,a({},n,{classes:i},{children:n.children}),void 0)}},1731:function(r){r.exports=n},3285:function(n){n.exports=r},20:function(n){n.exports=i},6028:function(n){n.exports=e},2749:function(n){n.exports=o},1102:function(n){n.exports=t},6897:function(n){n.exports=a},9248:function(n){n.exports=c},9297:function(n){n.exports=s}},p={};function d(n){var r=p[n];if(void 0!==r)return r.exports;var i=p[n]={exports:{}};return u[n](i,i.exports,d),i.exports}d.m=u,l=[],d.O=function(n,r,i,e){if(!r){var o=1/0;for(c=0;c<l.length;c++){r=l[c][0],i=l[c][1],e=l[c][2];for(var t=!0,a=0;a<r.length;a++)(!1&e||o>=e)&&Object.keys(d.O).every((function(n){return d.O[n](r[a])}))?r.splice(a--,1):(t=!1,e<o&&(o=e));t&&(l.splice(c--,1),n=i())}return n}e=e||0;for(var c=l.length;c>0&&l[c-1][2]>e;c--)l[c]=l[c-1];l[c]=[r,i,e]},d.n=function(n){var r=n&&n.__esModule?function(){return n.default}:function(){return n};return d.d(r,{a:r}),r},d.d=function(n,r){for(var i in r)d.o(r,i)&&!d.o(n,i)&&Object.defineProperty(n,i,{enumerable:!0,get:r[i]})},d.o=function(n,r){return Object.prototype.hasOwnProperty.call(n,r)},d.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},function(){var n={7095:0,6615:0,2823:0,9296:0};d.O.j=function(r){return 0===n[r]};var r=function(r,i){var e,o,t=i[0],a=i[1],c=i[2],s=0;for(e in a)d.o(a,e)&&(d.m[e]=a[e]);if(c)var l=c(d);for(r&&r(i);s<t.length;s++)o=t[s],d.o(n,o)&&n[o]&&n[o][0](),n[t[s]]=0;return d.O(l)},i=self.webpackChunkParaUI=self.webpackChunkParaUI||[];i.forEach(r.bind(null,0)),i.push=r.bind(null,i.push.bind(i))}();var f=d.O(void 0,[9296],(function(){return d(5598)}));return f=d.O(f)}()}));
|
package/Search/index.js
CHANGED
|
@@ -13,4 +13,4 @@ var n=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,o=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 o=t(9297),i=60103;if(n.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var r=Symbol.for;i=r("react.element"),n.Fragment=r("react.fragment")}var a=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c=Object.prototype.hasOwnProperty,l={key:!0,ref:!0,__self:!0,__source:!0};function s(e,n,t){var o,r={},s=null,u=null;for(o in void 0!==t&&(s=""+t),void 0!==n.key&&(s=""+n.key),void 0!==n.ref&&(u=n.ref),n)c.call(n,o)&&!l.hasOwnProperty(o)&&(r[o]=n[o]);if(e&&e.defaultProps)for(o in n=e.defaultProps)void 0===r[o]&&(r[o]=n[o]);return{$$typeof:i,type:e,key:s,ref:u,props:r,_owner:a.current}}n.jsx=s,n.jsxs=s},7712:function(e,n,t){e.exports=t(9524)},3094:function(e,n,t){var o=t(7712),i=t(9297),r=t(1731),a=function(){return a=Object.assign||function(e){for(var n,t=1,o=arguments.length;t<o;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},a.apply(this,arguments)};n.default=function(e){var n=e.children,t=e.placement,c=void 0===t?"bottom-start":t,l=e.tips,s=void 0===l?"":l,u=e.className,d=void 0===u?"":u,f=(0,i.useRef)(),p=(0,i.useState)(""),v=p[0],h=p[1];(0,i.useEffect)((function(){h(s)}),[s]);var b;return(0,o.jsx)("div",a({ref:function(e){e&&(f.current=e)},className:(b="paraui-auto-tips",d&&(b+=" "+d),b),onMouseOver:function(){f.current.scrollWidth>f.current.offsetWidth?h(v||f.current.innerText):h("")}},{children:(0,o.jsx)(r.Tooltip,a({title:v,placement:c},{children:(0,o.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 o=t(7712),i=t(9297),r=t(1731),a=t(4927),c=t(1102),l=t.n(c),s=t(2749),u=t.n(s),d=t(6885),f=t(6028),p=t.n(f),v=function(){return v=Object.assign||function(e){for(var n,t=1,o=arguments.length;t<o;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},v.apply(this,arguments)};var h=function(){return h=Object.assign||function(e){for(var n,t=1,o=arguments.length;t<o;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},h.apply(this,arguments)},b=function(e,n){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)n.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(t[o[i]]=e[o[i]])}return t},x=function(e){var n=e.variant,t=void 0===n?"contained":n,c=e.size,s=void 0===c?"large":c,f=e.className,p=e.disabled,v=void 0!==p&&p,x=e.children,m=e.startIcon,y=e.endIcon,g=e.loading,j=void 0!==g&&g,w=e.toolTipTitle,O=void 0===w?"":w,S=e.danger,C=void 0!==S&&S,N=b(e,["variant","size","className","disabled","children","startIcon","endIcon","loading","toolTipTitle","danger"]),k=(0,i.useState)(!1),P=k[0],I=k[1],E=function(e){if(!P)return"start"===e&&m?(0,o.jsx)("span",h({className:(0,a.Z)("btn-icon","start-icon")},{children:m}),void 0):"end"===e&&y?(0,o.jsx)("span",h({className:(0,a.Z)("btn-icon","end-icon")},{children:y}),void 0):null;if("object"==typeof j){var n=j.delay||0;setTimeout((function(){return I(!1)}),n)}return"start"===e?(0,o.jsx)("span",h({className:"btn-icon loading-icon"},{children:(0,o.jsx)(l(),{},void 0)}),void 0):null},T=(0,o.jsx)(r.Button,h({},N,{color:"default",variant:"outlined",disabled:v,disableRipple:!0,disableElevation:!0,className:(0,a.Z)("paraui-button",f,"paraui-button-".concat(t),"paraui-button-".concat(s),P&&"paraui-button-loading",C&&!v&&"paraui-button-dangerous"),startIcon:E("start"),endIcon:E("end")},{children:x}),void 0);return(0,i.useEffect)((function(){I(!!j)}),[j]),v&&O?(0,o.jsx)(d.default,h({title:function(){if(v&&O){return(0,o.jsxs)("span",{children:[(0,o.jsx)(u(),{style:{marginRight:"4px",fontSize:"11px",color:"inherit"}},void 0),O]},void 0)}return O}()},{children:(0,o.jsx)("span",h({className:"paraui-button--disabled"},{children:T}),void 0)}),void 0):T};x.IconButton=function(e){var n=e.variant,t=void 0===n?"contained":n,c=e.size,s=void 0===c?"large":c,f=e.toolTipTitle,p=void 0===f?"":f,v=e.children,x=e.className,m=e.disabled,y=void 0!==m&&m,g=e.loading,j=void 0!==g&&g,w=e.TooltipProps,O=e.danger,S=void 0!==O&&O,C=b(e,["variant","size","toolTipTitle","children","className","disabled","loading","TooltipProps","danger"]),N=(0,i.useState)(!1),k=N[0],P=N[1],I=(0,o.jsx)(r.IconButton,h({},C,{disabled:y,disableRipple:!0,className:(0,a.Z)("paraui-icon-button",x,"paraui-icon-button-".concat(t),"paraui-icon-button-".concat(s),k&&"paraui-icon-button-loading",S&&!y&&"paraui-icon-button-dangerous")},{children:function(){if(!k)return v;if("object"==typeof j){var e=j.delay||0;setTimeout((function(){return P(!1)}),e)}return(0,o.jsx)("span",h({className:"loading-icon"},{children:(0,o.jsx)(l(),{},void 0)}),void 0)}()}),void 0);return(0,i.useEffect)((function(){P(!!j)}),[j]),p?(0,o.jsx)(d.default,h({},w,{title:function(){if(y&&p){return(0,o.jsxs)("span",{children:[(0,o.jsx)(u(),{style:{marginRight:"4px",fontSize:"11px",color:"inherit"}},void 0),p]},void 0)}return p}()},{children:y?(0,o.jsx)("span",h({className:"paraui-button--disabled"},{children:I}),void 0):I}),void 0):I},x.SplitButton=function(e){var n=e.buttonText,t=e.options,c=void 0===t?[]:t,l=e.className,s=e.disabled,u=void 0!==s&&s,d=e.onClick,f=e.optionRender,h=(0,i.useState)(!1),b=h[0],x=h[1],y=(0,i.useRef)(null),g=(0,i.useRef)(),j=(0,i.useState)(0),w=j[0],O=j[1],S=function(e,n,t){var o;O(n),x(!1),null===(o=g.current)||void 0===o||o.classList.remove("paraui-button-split--active"),null==d||d(e,t)},C=function(e){var n,t;(null===(n=y.current)||void 0===n?void 0:n.contains(e.target))||(x(!1),null===(t=g.current)||void 0===t||t.classList.remove("paraui-button-split--active"))},N=function(){return(0,o.jsx)("div",v({className:"paraui-button-split-list"},{children:(0,o.jsx)("ul",{children:c.map((function(e,n){return Array.isArray(e)?function(e,n){return(0,o.jsx)("li",v({className:"split-li-group"},{children:e.map((function(e,t){var i="".concat(n,"-").concat(t);return(0,o.jsx)("div",v({className:(0,a.Z)("split-li",i===w&&"split-li--active"),onClick:function(n){return S(e,i,n)}},{children:(null==f?void 0:f(e))||e.label}),i)}))}),n)}(e,n):(0,o.jsx)("li",v({className:(0,a.Z)("split-li",n===w&&"split-li--active"),onClick:function(t){return S(e,n,t)}},{children:(null==f?void 0:f(e))||e.label}),n)}))},void 0)}),void 0)};return(0,o.jsxs)("div",v({className:(0,a.Z)("paraui-button-split",l),ref:y,onMouseLeave:function(e){var n;e.stopPropagation(),null===(n=e.currentTarget.firstElementChild)||void 0===n||n.classList.remove("paraui-button-split--active"),x(!1)}},{children:[(0,o.jsx)(m,v({variant:"outlined",onMouseEnter:function(e){e.stopPropagation();var n=e.currentTarget;g.current=n,n.classList.add("paraui-button-split--active"),x(!0)},startIcon:(0,o.jsx)(p(),{},void 0),disabled:u},{children:null!=n?n:"更多操作"}),void 0),(0,o.jsx)(r.Popper,v({open:b,anchorEl:y.current,transition:!0,placement:"bottom-end"},{children:function(e){var n=e.TransitionProps;e.placement;return(0,o.jsx)(r.Grow,v({},n,{children:(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(r.ClickAwayListener,v({onClickAway:C},{children:N()}),void 0)},void 0)}),void 0)}}),void 0)]}),void 0)};var m=x},7785:function(e,n,t){t.r(n),t.d(n,{Search:function(){return f}});var o=t(7712),i=t(9297),r=t(3672),a=t(2990),c=t(6088),l=t.n(c),s=t(4115),u=t.n(s),d=function(){return d=Object.assign||function(e){for(var n,t=1,o=arguments.length;t<o;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},d.apply(this,arguments)},f=function(e){var n=e.className,t=void 0===n?"":n,c=e.size,s=void 0===c?"large":c,f=e.btnType,p=void 0===f?"outside":f,v=e.showBtn,h=void 0===v||v,b=e.btnIcon,x=e.btnText,m=void 0===x?"":x,y=e.placeholder,g=void 0===y?"":y,j=(e.defaultValue,e.value),w=e.rightIcon,O=e.showRightIcon,S=void 0===O||O,C=e.onChange,N=e.onBlur,k=e.onFocus,P=e.onKeydown,I=e.onKeyUp,E=e.onClickBtn,T=e.onClickRightIcon,q=e.onEnter,F=(0,i.useState)(""),L=F[0],_=F[1];(0,i.useEffect)((function(){void 0!==e.defaultValue&&_(e.defaultValue)}),[]),(0,i.useEffect)((function(){void 0!==j&&_(j)}),[j]);var R,B=function(){return b||(0,o.jsx)(u(),{},void 0)},A=function(){E&&E(L)};return(0,o.jsxs)("div",d({className:(R="paraui-search",t&&(R+=" "+t),s&&(R+=" search-"+s),p&&(R+=" search-"+p),h&&(R+=" search-showbtn"),m&&(R+=" search-btntext"),R)},{children:[(0,o.jsx)(r.default,{size:s,placeholder:g,value:L,rightIcon:S?w||(0,o.jsx)(l(),{},void 0):"",onClickIcon:function(){T&&T(L)},onChange:function(n){var t=n.target.value;void 0===e.value&&_(t),C&&C(t,n)},onBlur:N,onFocus:k,onKeydown:P,onKeyUp:I,onEnter:q,addonAfter:function(){if(h&&"inside"===p)return(0,o.jsx)(a.default,d({size:s,startIcon:B(),variant:"outlined",onClick:A},{children:m}),void 0)}()},void 0),h&&"outside"===p&&(0,o.jsx)(a.default,d({size:s,startIcon:B(),variant:"contained",onClick:A},{children:m}),void 0)]}),void 0)};n.default=f},3672:function(e,n,t){var o=t(7712),i=t(9297),r=t(1731),a=t(3094),c=t(8528),l=t.n(c),s=t(6570),u=t.n(s),d=t(1102),f=t.n(d),p=t(3475),v=function(){return v=Object.assign||function(e){for(var n,t=1,o=arguments.length;t<o;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},v.apply(this,arguments)},h=function(e,n){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)n.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(t[o[i]]=e[o[i]])}return t};n.default=function(e){var n=e.className,t=e.size,c=void 0===t?"large":t,s=e.labelMode,d=void 0===s?"outside":s,b=e.placeholder,x=void 0===b?"":b,m=e.label,y=void 0===m?"":m,g=e.disabled,j=void 0!==g&&g,w=e.multiline,O=void 0!==w&&w,S=e.required,C=void 0!==S&&S,N=e.labelSign,k=e.rows,P=void 0===k?2:k,I=e.error,E=void 0!==I&&I,T=e.helperText,q=void 0===T?"":T,F=e.addonBefore,L=void 0===F?"":F,_=e.addonAfter,R=void 0===_?"":_,B=(e.defaultValue,e.value),A=e.autoFocus,D=void 0!==A&&A,M=e.type,U=void 0===M?"text":M,z=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,oe=e.onEnter,ie=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"]),le=(0,i.useState)("text-field-select-content-"+(0,p.UUID)())[0],se=(0,i.useState)(!0),ue=se[0],de=se[1],fe=(0,i.useState)(""),pe=fe[0],ve=fe[1],he=(0,i.useState)(!1),be=he[0],xe=he[1],me=(0,i.useState)("text"),ye=me[0],ge=me[1],je=(0,i.useState)(!1),we=je[0],Oe=je[1],Se=(0,i.useState)(!1),Ce=Se[0],Ne=Se[1],ke=(0,i.useState)([]),Pe=ke[0],Ie=ke[1],Ee=(0,i.useRef)(null),Te=(0,i.useRef)(null);(0,i.useEffect)((function(){void 0!==e.defaultValue&&(ve(e.defaultValue),Fe(e.defaultValue))}),[]),(0,i.useEffect)((function(){U!==ye&&ge(U)}),[U]),(0,i.useEffect)((function(){void 0!==B&&(ve(B),Fe(B))}),[B]),(0,i.useEffect)((function(){de(""===pe||void 0===pe)}),[pe]),(0,i.useEffect)((function(){H&&Oe(be)}),[be,H]),(0,i.useEffect)((function(){return we?window.addEventListener("keydown",Be):window.removeEventListener("keydown",Be),function(){window.removeEventListener("keydown",Be)}}),[we]);var qe,Fe=function(e){Ee&&Ee.current&&(Ee.current.value=e,Ee.current.setAttribute("value",e))},Le=function(){j||(de(!1),(Ee&&Ee.current).focus())},_e=function(e){var n=e.selectDom,t=e.keyCode,o=e.currentDom,i="nextSibling",r=".text-field-select-content-item";38===t&&(i="previousSibling",r=".text-field-select-content-item:last-child"),o?(o=o[i])||(o=n.querySelector(r)):o=n.querySelector(".text-field-select-content-item"),o&&(o.classList.add("text-field-select-content-item-keydown"),Re(o,n))},Re=function(e,n){var t=n.clientHeight,o=e.offsetTop+e.clientHeight-t;n.scrollTop=o>0?o:0},Be=function(e){var n=document.querySelector("."+le),t=null,o=n.querySelector(".text-field-select-content-item-keydown");if(13===e.keyCode&&o){var i=o.dataset.val;We(JSON.parse(i))(e),(Ee&&Ee.current).blur()}o&&(t=o,o.classList.remove("text-field-select-content-item-keydown")),40===e.keyCode&&_e({selectDom:n,keyCode:e.keyCode,currentDom:t}),38===e.keyCode&&_e({selectDom:n,keyCode:e.keyCode,currentDom:t})},Ae=function(e){xe(!1),""===e.target.value&&de(!0),Q&&Q(e)},De=function(e){Ne(!0),H&&H(e,(function(e){Ie(e||[]),Ne(!1)}))},Me=function(e){xe(!0),X&&X(e),De(e.target.value)},Ue=function(n){var t=n.target.value;W&&void 0!==t&&""!==t&&t.toString().length>W||(void 0===e.value&&(ve(t),Fe(t)),ee&&ee(n),De(n.target.value))},ze=function(e){13===e.keyCode&&oe&&oe(e),ne&&ne(e)},Ke=function(e){te&&te(e)},Ze=function(e){"password"===U&&("text"===ye&&ge("password"),"password"===ye&&ge("text")),z&&z(e)},Ve=function(){Oe(!1)},We=function(e){return function(n){ae&&ae(e)}},He=(0,i.useMemo)((function(){return(0,o.jsx)(o.Fragment,{children:void 0!==W&&(0,o.jsx)("span",v({className:"length-limit"},{children:(pe?pe.toString().length:0)+"/"+W}),void 0)},void 0)}),[W,pe]),Je=(0,i.useMemo)((function(){var e=K||("password"===U?"password"===ye?(0,o.jsx)(u(),{},void 0):(0,o.jsx)(l(),{},void 0):null);return(0,o.jsx)(o.Fragment,{children:V&&e&&(0,o.jsx)("span",v({className:"right-icon",onClick:Ze},{children:e}),void 0)},void 0)}),[V,K,U,ye]),$e=(0,i.useMemo)((function(){return(0,o.jsxs)("div",v({className:"text-field-content-within",ref:Te},{children:[(0,o.jsxs)("div",v({className:"text-field-content-within-input"},{children:[O?(0,o.jsx)("textarea",v({ref:Ee,rows:P,onBlur:Ae,onFocus:Me,onChange:Ue,onKeyDown:ze,onKeyUp:Ke,disabled:j},ce),void 0):(0,o.jsx)("input",v({ref:Ee,type:ye,onBlur:Ae,onFocus:Me,onChange:Ue,onKeyDown:ze,onKeyUp:Ke,disabled:j},ce),void 0),ue&&(0,o.jsx)("span",v({className:"text-field-label-placeholder",onClick:Le},{children:"outside"===d?x:(0,o.jsxs)(o.Fragment,{children:[y||x,C&&(0,o.jsx)("span",v({className:"text-field-required"},{children:"*"}),void 0),N&&(0,o.jsx)("span",{children:N},void 0)]},void 0)}),void 0)]}),void 0),He,Je]}),void 0)}),[ue,D,ye,pe,He,Je,d,x,y,j,O,P,ce,ee,H]),Ge=(0,i.useMemo)((function(){var e;return(0,o.jsxs)("div",v({className:(e="text-field-select-content",Ce&&(e+=" text-field-select-content-loading"),le&&(e+=" "+le),e),style:{width:(Te&&Te.current?Te.current.offsetWidth:0)+"px"}},{children:[Pe&&Pe.map((function(e,n){return(0,o.jsx)("div",v({className:"text-field-select-content-item",onMouseDown:We(e),"data-val":JSON.stringify(e)},{children:$?$(e):(0,o.jsx)(a.default,{children:e[Y]},void 0)}),n)})),Ce&&(0,o.jsx)("div",v({className:"loading-box"},{children:(0,o.jsx)(f(),{},void 0)}),void 0)]}),void 0)}),[Te,we,Pe,$,Y,ae,Ce,le]),Ye=(0,i.useMemo)((function(){return(0,o.jsx)(r.Tooltip,v({open:we,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,D,ye,pe,He,Je,d,x,y,j,O,P,ce,ee,H,ae,Te,we,J,c]),Qe=(0,i.useMemo)((function(){var e=Boolean(C||N||y);return(0,o.jsx)(o.Fragment,{children:"outside"===d&&e&&(0,o.jsxs)("label",v({className:"text-field-label"},{children:[y,C&&(0,o.jsx)("span",v({className:"text-field-required"},{children:"*"}),void 0),N&&(0,o.jsx)("span",{children:N},void 0)]}),void 0)},void 0)}),[d,y,N,C]);return(0,o.jsxs)("div",v({className:(qe="paraui-text-field",qe+=" text-field",c&&!O&&(qe+=" text-field-"+c),n&&(qe+=" "+n),E&&(qe+=" text-field-error"),be&&(qe+=" text-field-focus"),j&&(qe+=" text-field-disabled"),O&&(qe+=" text-field-multiline"),qe)},{children:[Qe,(0,o.jsxs)("div",v({className:"text-field-content"},{children:[L&&(0,o.jsx)("div",v({className:"text-field-content-before",onClick:function(e){ie&&ie(e)}},{children:L}),void 0),H?Ye:$e,R&&(0,o.jsx)("div",v({className:"text-field-content-after",onClick:function(e){re&&re(e)}},{children:R}),void 0)]}),void 0),q&&(0,o.jsx)("p",v({className:"text-field-error-text"},{children:q}),void 0)]}),void 0)}},6885:function(e,n,t){var o=t(7712),i=t(1731),r=t(4927),a=function(){return a=Object.assign||function(e){for(var n,t=1,o=arguments.length;t<o;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);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,o.jsx)(i.Tooltip,a({},e,{classes:t},{children:e.children}),void 0)}},1731:function(n){n.exports=e},6088:function(e){e.exports=n},6028:function(e){e.exports=t},2749:function(e){e.exports=o},1102:function(e){e.exports=i},6570:function(e){e.exports=r},8528:function(e){e.exports=a},4115:function(e){e.exports=c},3475:function(e){e.exports=l},9297:function(e){e.exports=s}},f={};function p(e){var n=f[e];if(void 0!==n)return n.exports;var t=f[e]={exports:{}};return d[e](t,t.exports,p),t.exports}p.m=d,u=[],p.O=function(e,n,t,o){if(!n){var i=1/0;for(c=0;c<u.length;c++){n=u[c][0],t=u[c][1],o=u[c][2];for(var r=!0,a=0;a<n.length;a++)(!1&o||i>=o)&&Object.keys(p.O).every((function(e){return p.O[e](n[a])}))?n.splice(a--,1):(r=!1,o<i&&(i=o));r&&(u.splice(c--,1),e=t())}return e}o=o||0;for(var c=u.length;c>0&&u[c-1][2]>o;c--)u[c]=u[c-1];u[c]=[n,t,o]},p.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return p.d(n,{a:n}),n},p.d=function(e,n){for(var t in n)p.o(n,t)&&!p.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},p.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},p.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e={3708:0,1465:0,6615:0,2996:0,2823:0,9296:0};p.O.j=function(n){return 0===e[n]};var n=function(n,t){var o,i,r=t[0],a=t[1],c=t[2],l=0;for(o in a)p.o(a,o)&&(p.m[o]=a[o]);if(c)var s=c(p);for(n&&n(t);l<r.length;l++)i=r[l],p.o(e,i)&&e[i]&&e[i][0](),e[r[l]]=0;return p.O(s)},t=self.webpackChunkParaUI=self.webpackChunkParaUI||[];t.forEach(n.bind(null,0)),t.push=n.bind(null,t.push.bind(t))}();var v=p.O(void 0,[9296],(function(){return p(7785)}));return v=p.O(v)}()}));
|
|
16
|
+
t(4126);var o=t(9297),i=60103;if(n.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var r=Symbol.for;i=r("react.element"),n.Fragment=r("react.fragment")}var a=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c=Object.prototype.hasOwnProperty,l={key:!0,ref:!0,__self:!0,__source:!0};function s(e,n,t){var o,r={},s=null,u=null;for(o in void 0!==t&&(s=""+t),void 0!==n.key&&(s=""+n.key),void 0!==n.ref&&(u=n.ref),n)c.call(n,o)&&!l.hasOwnProperty(o)&&(r[o]=n[o]);if(e&&e.defaultProps)for(o in n=e.defaultProps)void 0===r[o]&&(r[o]=n[o]);return{$$typeof:i,type:e,key:s,ref:u,props:r,_owner:a.current}}n.jsx=s,n.jsxs=s},7712:function(e,n,t){e.exports=t(9524)},3094:function(e,n,t){var o=t(7712),i=t(9297),r=t(1731),a=function(){return a=Object.assign||function(e){for(var n,t=1,o=arguments.length;t<o;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},a.apply(this,arguments)};n.default=function(e){var n=e.children,t=e.placement,c=void 0===t?"bottom-start":t,l=e.tips,s=void 0===l?"":l,u=e.className,d=void 0===u?"":u,f=(0,i.useRef)(),p=(0,i.useState)(""),v=p[0],h=p[1];(0,i.useEffect)((function(){h(s)}),[s]);var b;return(0,o.jsx)("div",a({ref:function(e){e&&(f.current=e)},className:(b="paraui-auto-tips",d&&(b+=" "+d),b),onMouseOver:function(){f.current.scrollWidth>f.current.offsetWidth?h(v||f.current.innerText):h("")}},{children:(0,o.jsx)(r.Tooltip,a({title:v,placement:c},{children:(0,o.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 o=t(7712),i=t(9297),r=t(1731),a=t(4927),c=t(1102),l=t.n(c),s=t(2749),u=t.n(s),d=t(6885),f=t(6028),p=t.n(f),v=function(){return v=Object.assign||function(e){for(var n,t=1,o=arguments.length;t<o;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},v.apply(this,arguments)};var h=function(){return h=Object.assign||function(e){for(var n,t=1,o=arguments.length;t<o;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},h.apply(this,arguments)},b=function(e,n){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)n.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(t[o[i]]=e[o[i]])}return t},x=function(e){var n=e.variant,t=void 0===n?"contained":n,c=e.size,s=void 0===c?"large":c,f=e.className,p=e.disabled,v=void 0!==p&&p,x=e.children,m=e.startIcon,y=e.endIcon,g=e.loading,j=void 0!==g&&g,w=e.toolTipTitle,O=void 0===w?"":w,S=e.danger,C=void 0!==S&&S,N=b(e,["variant","size","className","disabled","children","startIcon","endIcon","loading","toolTipTitle","danger"]),k=(0,i.useState)(!1),P=k[0],I=k[1],E=function(e){if(!P)return"start"===e&&m?(0,o.jsx)("span",h({className:(0,a.Z)("btn-icon","start-icon")},{children:m}),void 0):"end"===e&&y?(0,o.jsx)("span",h({className:(0,a.Z)("btn-icon","end-icon")},{children:y}),void 0):null;if("object"==typeof j){var n=j.delay||0;setTimeout((function(){return I(!1)}),n)}return"start"===e?(0,o.jsx)("span",h({className:"btn-icon loading-icon"},{children:(0,o.jsx)(l(),{},void 0)}),void 0):null},T=(0,o.jsx)(r.Button,h({},N,{color:"default",variant:"outlined",disabled:v,disableRipple:!0,disableElevation:!0,className:(0,a.Z)("paraui-button",f,"paraui-button-".concat(t),"paraui-button-".concat(s),P&&"paraui-button-loading",C&&!v&&"paraui-button-dangerous"),startIcon:E("start"),endIcon:E("end")},{children:x}),void 0);return(0,i.useEffect)((function(){I(!!j)}),[j]),v&&O?(0,o.jsx)(d.default,h({title:function(){if(v&&O){return(0,o.jsxs)("span",{children:[(0,o.jsx)(u(),{style:{marginRight:"4px",fontSize:"11px",color:"inherit"}},void 0),O]},void 0)}return O}()},{children:(0,o.jsx)("span",h({className:"paraui-button--disabled"},{children:T}),void 0)}),void 0):T};x.IconButton=function(e){var n=e.variant,t=void 0===n?"contained":n,c=e.size,s=void 0===c?"large":c,f=e.toolTipTitle,p=void 0===f?"":f,v=e.children,x=e.className,m=e.disabled,y=void 0!==m&&m,g=e.loading,j=void 0!==g&&g,w=e.TooltipProps,O=e.danger,S=void 0!==O&&O,C=b(e,["variant","size","toolTipTitle","children","className","disabled","loading","TooltipProps","danger"]),N=(0,i.useState)(!1),k=N[0],P=N[1],I=(0,o.jsx)(r.IconButton,h({},C,{disabled:y,disableRipple:!0,className:(0,a.Z)("paraui-icon-button",x,"paraui-icon-button-".concat(t),"paraui-icon-button-".concat(s),k&&"paraui-icon-button-loading",S&&!y&&"paraui-icon-button-dangerous")},{children:function(){if(!k)return v;if("object"==typeof j){var e=j.delay||0;setTimeout((function(){return P(!1)}),e)}return(0,o.jsx)("span",h({className:"loading-icon"},{children:(0,o.jsx)(l(),{},void 0)}),void 0)}()}),void 0);return(0,i.useEffect)((function(){P(!!j)}),[j]),p?(0,o.jsx)(d.default,h({},w,{title:function(){if(y&&p){return(0,o.jsxs)("span",{children:[(0,o.jsx)(u(),{style:{marginRight:"4px",fontSize:"11px",color:"inherit"}},void 0),p]},void 0)}return p}()},{children:y?(0,o.jsx)("span",h({className:"paraui-button--disabled"},{children:I}),void 0):I}),void 0):I},x.SplitButton=function(e){var n=e.buttonText,t=e.options,c=void 0===t?[]:t,l=e.className,s=e.disabled,u=void 0!==s&&s,d=e.onClick,f=e.optionRender,h=(0,i.useState)(!1),b=h[0],x=h[1],y=(0,i.useRef)(null),g=(0,i.useRef)(),j=(0,i.useState)(0),w=j[0],O=j[1],S=function(e,n,t){var o;O(n),x(!1),null===(o=g.current)||void 0===o||o.classList.remove("paraui-button-split--active"),null==d||d(e,t)},C=function(e){var n,t;(null===(n=y.current)||void 0===n?void 0:n.contains(e.target))||(x(!1),null===(t=g.current)||void 0===t||t.classList.remove("paraui-button-split--active"))},N=function(){return(0,o.jsx)("div",v({className:"paraui-button-split-list"},{children:(0,o.jsx)("ul",{children:c.map((function(e,n){return Array.isArray(e)?function(e,n){return(0,o.jsx)("li",v({className:"split-li-group"},{children:e.map((function(e,t){var i="".concat(n,"-").concat(t);return(0,o.jsx)("div",v({className:(0,a.Z)("split-li",i===w&&"split-li--active"),onClick:function(n){return S(e,i,n)}},{children:(null==f?void 0:f(e))||e.label}),i)}))}),n)}(e,n):(0,o.jsx)("li",v({className:(0,a.Z)("split-li",n===w&&"split-li--active"),onClick:function(t){return S(e,n,t)}},{children:(null==f?void 0:f(e))||e.label}),n)}))},void 0)}),void 0)};return(0,o.jsxs)("div",v({className:(0,a.Z)("paraui-button-split",l),ref:y,onMouseLeave:function(e){var n;e.stopPropagation(),null===(n=e.currentTarget.firstElementChild)||void 0===n||n.classList.remove("paraui-button-split--active"),x(!1)}},{children:[(0,o.jsx)(m,v({variant:"outlined",onMouseEnter:function(e){e.stopPropagation();var n=e.currentTarget;g.current=n,n.classList.add("paraui-button-split--active"),x(!0)},startIcon:(0,o.jsx)(p(),{},void 0),disabled:u},{children:null!=n?n:"更多操作"}),void 0),(0,o.jsx)(r.Popper,v({open:b,anchorEl:y.current,transition:!0,placement:"bottom-end"},{children:function(e){var n=e.TransitionProps;e.placement;return(0,o.jsx)(r.Grow,v({},n,{children:(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(r.ClickAwayListener,v({onClickAway:C},{children:N()}),void 0)},void 0)}),void 0)}}),void 0)]}),void 0)};var m=x},7785:function(e,n,t){t.r(n),t.d(n,{Search:function(){return f}});var o=t(7712),i=t(9297),r=t(3672),a=t(2990),c=t(6088),l=t.n(c),s=t(4115),u=t.n(s),d=function(){return d=Object.assign||function(e){for(var n,t=1,o=arguments.length;t<o;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},d.apply(this,arguments)},f=function(e){var n=e.className,t=void 0===n?"":n,c=e.size,s=void 0===c?"large":c,f=e.btnType,p=void 0===f?"outside":f,v=e.showBtn,h=void 0===v||v,b=e.btnIcon,x=e.btnText,m=void 0===x?"":x,y=e.placeholder,g=void 0===y?"":y,j=(e.defaultValue,e.value),w=e.rightIcon,O=e.showRightIcon,S=void 0===O||O,C=e.onChange,N=e.onBlur,k=e.onFocus,P=e.onKeydown,I=e.onKeyUp,E=e.onClickBtn,T=e.onClickRightIcon,q=e.onEnter,F=(0,i.useState)(""),L=F[0],_=F[1];(0,i.useEffect)((function(){void 0!==e.defaultValue&&_(e.defaultValue)}),[]),(0,i.useEffect)((function(){void 0!==j&&_(j)}),[j]);var R,B=function(){return b||(0,o.jsx)(u(),{},void 0)},A=function(){E&&E(L)};return(0,o.jsxs)("div",d({className:(R="paraui-search",t&&(R+=" "+t),s&&(R+=" search-"+s),p&&(R+=" search-"+p),h&&(R+=" search-showbtn"),m&&(R+=" search-btntext"),R)},{children:[(0,o.jsx)(r.default,{size:s,placeholder:g,value:L,rightIcon:S?w||(0,o.jsx)(l(),{},void 0):"",onClickIcon:function(){T&&T(L)},onChange:function(n){var t=n.target.value;void 0===e.value&&_(t),C&&C(t,n)},onBlur:N,onFocus:k,onKeydown:P,onKeyUp:I,onEnter:q,addonAfter:function(){if(h&&"inside"===p)return(0,o.jsx)(a.default,d({size:s,startIcon:B(),variant:"outlined",onClick:A},{children:m}),void 0)}()},void 0),h&&"outside"===p&&(0,o.jsx)(a.default,d({size:s,startIcon:B(),variant:"contained",onClick:A},{children:m}),void 0)]}),void 0)};n.default=f},3672:function(e,n,t){var o=t(7712),i=t(9297),r=t(1731),a=t(3094),c=t(8528),l=t.n(c),s=t(6570),u=t.n(s),d=t(1102),f=t.n(d),p=t(3475),v=function(){return v=Object.assign||function(e){for(var n,t=1,o=arguments.length;t<o;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},v.apply(this,arguments)},h=function(e,n){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)n.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(t[o[i]]=e[o[i]])}return t};n.default=function(e){var n=e.className,t=e.size,c=void 0===t?"large":t,s=e.labelMode,d=void 0===s?"outside":s,b=e.placeholder,x=void 0===b?"":b,m=e.label,y=void 0===m?"":m,g=e.disabled,j=void 0!==g&&g,w=e.multiline,O=void 0!==w&&w,S=e.required,C=void 0!==S&&S,N=e.labelSign,k=e.rows,P=void 0===k?2:k,I=e.error,E=void 0!==I&&I,T=e.helperText,q=void 0===T?"":T,F=e.addonBefore,L=void 0===F?"":F,_=e.addonAfter,R=void 0===_?"":_,B=(e.defaultValue,e.value),A=e.autoFocus,D=void 0!==A&&A,M=e.type,U=void 0===M?"text":M,z=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,oe=e.onEnter,ie=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"]),le=(0,i.useState)("text-field-select-content-"+(0,p.UUID)())[0],se=(0,i.useState)(!0),ue=se[0],de=se[1],fe=(0,i.useState)(""),pe=fe[0],ve=fe[1],he=(0,i.useState)(!1),be=he[0],xe=he[1],me=(0,i.useState)("text"),ye=me[0],ge=me[1],je=(0,i.useState)(!1),we=je[0],Oe=je[1],Se=(0,i.useState)(!1),Ce=Se[0],Ne=Se[1],ke=(0,i.useState)([]),Pe=ke[0],Ie=ke[1],Ee=(0,i.useRef)(null),Te=(0,i.useRef)(null);(0,i.useEffect)((function(){void 0!==e.defaultValue&&(ve(e.defaultValue),Fe(e.defaultValue))}),[]),(0,i.useEffect)((function(){U!==ye&&ge(U)}),[U]),(0,i.useEffect)((function(){void 0!==B&&(ve(B),Fe(B))}),[B]),(0,i.useEffect)((function(){de(""===pe||void 0===pe)}),[pe]),(0,i.useEffect)((function(){H&&Oe(be)}),[be,H]),(0,i.useEffect)((function(){return we?window.addEventListener("keydown",Be):window.removeEventListener("keydown",Be),function(){window.removeEventListener("keydown",Be)}}),[we]);var qe,Fe=function(e){Ee&&Ee.current&&(Ee.current.value=e,Ee.current.setAttribute("value",e))},Le=function(){j||(de(!1),(Ee&&Ee.current).focus())},_e=function(e){var n=e.selectDom,t=e.keyCode,o=e.currentDom,i="nextSibling",r=".text-field-select-content-item";38===t&&(i="previousSibling",r=".text-field-select-content-item:last-child"),o?(o=o[i])||(o=n.querySelector(r)):o=n.querySelector(".text-field-select-content-item"),o&&(o.classList.add("text-field-select-content-item-keydown"),Re(o,n))},Re=function(e,n){var t=n.clientHeight,o=e.offsetTop+e.clientHeight-t;n.scrollTop=o>0?o:0},Be=function(e){var n=document.querySelector("."+le),t=null,o=n.querySelector(".text-field-select-content-item-keydown");if(13===e.keyCode&&o){var i=o.dataset.val;We(JSON.parse(i))(e),(Ee&&Ee.current).blur()}o&&(t=o,o.classList.remove("text-field-select-content-item-keydown")),40===e.keyCode&&_e({selectDom:n,keyCode:e.keyCode,currentDom:t}),38===e.keyCode&&_e({selectDom:n,keyCode:e.keyCode,currentDom:t})},Ae=function(e){xe(!1),""===e.target.value&&de(!0),Q&&Q(e)},De=function(e){Ne(!0),H&&H(e,(function(e){Ie(e||[]),Ne(!1)}))},Me=function(e){xe(!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||(void 0===e.value&&(ve(t),Fe(t)),ee&&ee(n),De(n.target.value))},ze=function(e){13===e.keyCode&&oe&&oe(e),ne&&ne(e)},Ke=function(e){te&&te(e)},Ze=function(e){"password"===U&&("text"===ye&&ge("password"),"password"===ye&&ge("text")),z&&z(e)},Ve=function(){Oe(!1)},We=function(e){return function(n){ae&&ae(e)}},He=(0,i.useMemo)((function(){return(0,o.jsx)(o.Fragment,{children:void 0!==W&&(0,o.jsx)("span",v({className:"length-limit"},{children:(pe?pe.toString().length:0)+"/"+W}),void 0)},void 0)}),[W,pe]),Je=(0,i.useMemo)((function(){var e=K||("password"===U?"password"===ye?(0,o.jsx)(u(),{},void 0):(0,o.jsx)(l(),{},void 0):null);return(0,o.jsx)(o.Fragment,{children:V&&e&&(0,o.jsx)("span",v({className:"right-icon",onClick:Ze},{children:e}),void 0)},void 0)}),[V,K,U,ye]),$e=(0,i.useMemo)((function(){return(0,o.jsxs)("div",v({className:"text-field-content-within",ref:Te},{children:[(0,o.jsxs)("div",v({className:"text-field-content-within-input"},{children:[O?(0,o.jsx)("textarea",v({ref:Ee,rows:P,onBlur:Ae,onFocus:Me,onChange:Ue,onKeyDown:ze,onKeyUp:Ke,disabled:j},ce),void 0):(0,o.jsx)("input",v({ref:Ee,type:ye,onBlur:Ae,onFocus:Me,onChange:Ue,onKeyDown:ze,onKeyUp:Ke,disabled:j},ce),void 0),ue&&(0,o.jsx)("span",v({className:"text-field-label-placeholder",onClick:Le},{children:"outside"===d?x:(0,o.jsxs)(o.Fragment,{children:[y||x,C&&(0,o.jsx)("span",v({className:"text-field-required"},{children:"*"}),void 0),N&&(0,o.jsx)("span",{children:N},void 0)]},void 0)}),void 0)]}),void 0),He,Je]}),void 0)}),[ue,D,ye,pe,He,Je,d,x,y,j,O,P,ce,ee,H]),Ge=(0,i.useMemo)((function(){var e;return(0,o.jsxs)("div",v({className:(e="text-field-select-content",Ce&&(e+=" text-field-select-content-loading"),le&&(e+=" "+le),e),style:{width:(Te&&Te.current?Te.current.offsetWidth:0)+"px"}},{children:[Pe&&Pe.map((function(e,n){return(0,o.jsx)("div",v({className:"text-field-select-content-item",onMouseDown:We(e),"data-val":JSON.stringify(e)},{children:$?$(e):(0,o.jsx)(a.default,{children:e[Y]},void 0)}),n)})),Ce&&(0,o.jsx)("div",v({className:"loading-box"},{children:(0,o.jsx)(f(),{},void 0)}),void 0)]}),void 0)}),[Te,we,Pe,$,Y,ae,Ce,le]),Ye=(0,i.useMemo)((function(){return(0,o.jsx)(r.Tooltip,v({open:we,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,D,ye,pe,He,Je,d,x,y,j,O,P,ce,ee,H,ae,Te,we,J,c]),Qe=(0,i.useMemo)((function(){var e=Boolean(C||N||y);return(0,o.jsx)(o.Fragment,{children:"outside"===d&&e&&(0,o.jsxs)("label",v({className:"text-field-label"},{children:[y,C&&(0,o.jsx)("span",v({className:"text-field-required"},{children:"*"}),void 0),N&&(0,o.jsx)("span",{children:N},void 0)]}),void 0)},void 0)}),[d,y,N,C]);return(0,o.jsxs)("div",v({className:(qe="paraui-text-field",qe+=" text-field",c&&!O&&(qe+=" text-field-"+c),n&&(qe+=" "+n),E&&(qe+=" text-field-error"),be&&(qe+=" text-field-focus"),j&&(qe+=" text-field-disabled"),O&&(qe+=" text-field-multiline"),qe)},{children:[Qe,(0,o.jsxs)("div",v({className:"text-field-content"},{children:[L&&(0,o.jsx)("div",v({className:"text-field-content-before",onClick:function(e){ie&&ie(e)}},{children:L}),void 0),H?Ye:$e,R&&(0,o.jsx)("div",v({className:"text-field-content-after",onClick:function(e){re&&re(e)}},{children:R}),void 0)]}),void 0),q&&(0,o.jsx)("p",v({className:"text-field-error-text"},{children:q}),void 0)]}),void 0)}},6885:function(e,n,t){var o=t(7712),i=t(1731),r=t(4927),a=function(){return a=Object.assign||function(e){for(var n,t=1,o=arguments.length;t<o;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);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,o.jsx)(i.Tooltip,a({},e,{classes:t},{children:e.children}),void 0)}},1731:function(n){n.exports=e},6088:function(e){e.exports=n},6028:function(e){e.exports=t},2749:function(e){e.exports=o},1102:function(e){e.exports=i},6570:function(e){e.exports=r},8528:function(e){e.exports=a},4115:function(e){e.exports=c},3475:function(e){e.exports=l},9297:function(e){e.exports=s}},f={};function p(e){var n=f[e];if(void 0!==n)return n.exports;var t=f[e]={exports:{}};return d[e](t,t.exports,p),t.exports}p.m=d,u=[],p.O=function(e,n,t,o){if(!n){var i=1/0;for(c=0;c<u.length;c++){n=u[c][0],t=u[c][1],o=u[c][2];for(var r=!0,a=0;a<n.length;a++)(!1&o||i>=o)&&Object.keys(p.O).every((function(e){return p.O[e](n[a])}))?n.splice(a--,1):(r=!1,o<i&&(i=o));r&&(u.splice(c--,1),e=t())}return e}o=o||0;for(var c=u.length;c>0&&u[c-1][2]>o;c--)u[c]=u[c-1];u[c]=[n,t,o]},p.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return p.d(n,{a:n}),n},p.d=function(e,n){for(var t in n)p.o(n,t)&&!p.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},p.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},p.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e={3708:0,1465:0,6615:0,2996:0,2823:0,9296:0};p.O.j=function(n){return 0===e[n]};var n=function(n,t){var o,i,r=t[0],a=t[1],c=t[2],l=0;for(o in a)p.o(a,o)&&(p.m[o]=a[o]);if(c)var s=c(p);for(n&&n(t);l<r.length;l++)i=r[l],p.o(e,i)&&e[i]&&e[i][0](),e[r[l]]=0;return p.O(s)},t=self.webpackChunkParaUI=self.webpackChunkParaUI||[];t.forEach(n.bind(null,0)),t.push=n.bind(null,t.push.bind(t))}();var v=p.O(void 0,[9296],(function(){return p(7785)}));return v=p.O(v)}()}));
|
package/SingleBox/index.js
CHANGED
|
@@ -13,4 +13,4 @@ var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,o=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
|
-
n(4126);var o=n(9297),r=60103;if(t.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var i=Symbol.for;r=i("react.element"),t.Fragment=i("react.fragment")}var a=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l=Object.prototype.hasOwnProperty,s={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var o,i={},c=null,u=null;for(o in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)l.call(t,o)&&!s.hasOwnProperty(o)&&(i[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps)void 0===i[o]&&(i[o]=t[o]);return{$$typeof:r,type:e,key:c,ref:u,props:i,_owner:a.current}}t.jsx=c,t.jsxs=c},7712:function(e,t,n){e.exports=n(9524)},3094:function(e,t,n){var o=n(7712),r=n(9297),i=n(1731),a=function(){return a=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},a.apply(this,arguments)};t.default=function(e){var t=e.children,n=e.placement,l=void 0===n?"bottom-start":n,s=e.tips,c=void 0===s?"":s,u=e.className,d=void 0===u?"":u,f=(0,r.useRef)(),v=(0,r.useState)(""),p=v[0],x=v[1];(0,r.useEffect)((function(){x(c)}),[c]);var h;return(0,o.jsx)("div",a({ref:function(e){e&&(f.current=e)},className:(h="paraui-auto-tips",d&&(h+=" "+d),h),onMouseOver:function(){f.current.scrollWidth>f.current.offsetWidth?x(p||f.current.innerText):x("")}},{children:(0,o.jsx)(i.Tooltip,a({title:p,placement:l},{children:(0,o.jsx)("div",a({className:"auto-tips-content"},{children:t}),void 0)}),void 0)}),void 0)}},8901:function(e,t,n){n.r(t),n.d(t,{SingleBox:function(){return f}});var o=n(7712),r=n(9297),i=n(3672),a=n(5191),l=n.n(a),s=n(6243),c=n.n(s),u=function(){return u=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},u.apply(this,arguments)},d=function(e,t,n){if(n||2===arguments.length)for(var o,r=0,i=t.length;r<i;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},f=function(e){var t=e.className,n=e.size,a=void 0===n?"large":n,s=e.placeholder,f=void 0===s?"":s,v=e.label,p=void 0===v?"":v,x=e.labelSign,h=e.disabled,m=void 0!==h&&h,b=e.required,g=void 0!==b&&b,y=e.error,j=void 0!==y&&y,w=e.helperText,O=void 0===w?"":w,S=e.value,C=e.onChange,k=(0,r.useState)([]),N=k[0],P=k[1];(0,r.useEffect)((function(){void 0!==e.defaultValue&&P(d([],e.defaultValue,!0))}),[]),(0,r.useEffect)((function(){void 0!==S&&P(d([],S,!0))}),[S]);var q,E=function(t){return function(){m||(N.splice(t,1),void 0===e.value&&P(d([],N,!0)),C&&C(N))}},_=function(t){return function(n){N[t]=n.target.value,void 0===e.value&&P(d([],N,!0)),C&&C(N)}};return(0,o.jsxs)("div",u({className:(q="paraui-single-box single-box",t&&(q+=" "+t),a&&(q+=" single-box-"+a),j&&(q+=" single-box-error"),m&&(q+=" single-box-disabled"),q)},{children:[p?(0,o.jsxs)("label",u({className:"single-box-label"},{children:[p,g&&(0,o.jsx)("span",u({className:"single-box-label-required"},{children:"*"}),void 0),x&&(0,o.jsx)("span",{children:x},void 0)]}),void 0):null,(0,o.jsx)("div",u({className:"single-box-content"},{children:N.map((function(e,t){return(0,o.jsxs)("div",u({className:"single-box-content-item"},{children:[(0,o.jsx)(i.default,{disabled:m,value:e,placeholder:f,size:a,onChange:_(t)},void 0),(0,o.jsx)("span",u({className:"single-box-content-item-svg"},{children:(0,o.jsx)(c(),{onClick:E(t)},void 0)}),void 0)]}),t)}))}),void 0),(0,o.jsx)("div",u({className:"single-box-add",onClick:function(){m||(N.push(""),void 0===e.value&&P(d([],N,!0)),C&&C(N))}},{children:(0,o.jsx)(l(),{},void 0)}),void 0),O&&(0,o.jsx)("p",u({className:"single-box-error"},{children:O}),void 0)]}),void 0)};t.default=f},3672:function(e,t,n){var o=n(7712),r=n(9297),i=n(1731),a=n(3094),l=n(8528),s=n.n(l),c=n(6570),u=n.n(c),d=n(1102),f=n.n(d),v=n(3475),p=function(){return p=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},p.apply(this,arguments)},x=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};t.default=function(e){var t=e.className,n=e.size,l=void 0===n?"large":n,c=e.labelMode,d=void 0===c?"outside":c,h=e.placeholder,m=void 0===h?"":h,b=e.label,g=void 0===b?"":b,y=e.disabled,j=void 0!==y&&y,w=e.multiline,O=void 0!==w&&w,S=e.required,C=void 0!==S&&S,k=e.labelSign,N=e.rows,P=void 0===N?2:N,q=e.error,E=void 0!==q&&q,_=e.helperText,F=void 0===_?"":_,I=e.addonBefore,L=void 0===I?"":I,D=e.addonAfter,T=void 0===D?"":D,M=(e.defaultValue,e.value),A=e.autoFocus,U=void 0!==A&&A,B=e.type,R=void 0===B?"text":B,K=e.onClickIcon,V=e.rightIcon,z=e.showRightIcon,W=void 0===z||z,H=e.limitLength,J=e.fetchSuggestions,$=e.selectPopoverClass,Y=e.renderSelectItem,G=e.showSelectName,Q=void 0===G?"value":G,X=e.onBlur,Z=e.onFocus,ee=e.onChange,te=e.onKeydown,ne=e.onKeyUp,oe=e.onEnter,re=e.onClickAddonBefore,ie=e.onClickAddonAfter,ae=e.onSelect,le=x(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,r.useState)("text-field-select-content-"+(0,v.UUID)())[0],ce=(0,r.useState)(!0),ue=ce[0],de=ce[1],fe=(0,r.useState)(""),ve=fe[0],pe=fe[1],xe=(0,r.useState)(!1),he=xe[0],me=xe[1],be=(0,r.useState)("text"),ge=be[0],ye=be[1],je=(0,r.useState)(!1),we=je[0],Oe=je[1],Se=(0,r.useState)(!1),Ce=Se[0],ke=Se[1],Ne=(0,r.useState)([]),Pe=Ne[0],qe=Ne[1],Ee=(0,r.useRef)(null),_e=(0,r.useRef)(null);(0,r.useEffect)((function(){void 0!==e.defaultValue&&(pe(e.defaultValue),Ie(e.defaultValue))}),[]),(0,r.useEffect)((function(){R!==ge&&ye(R)}),[R]),(0,r.useEffect)((function(){void 0!==M&&(pe(M),Ie(M))}),[M]),(0,r.useEffect)((function(){de(""===ve||void 0===ve)}),[ve]),(0,r.useEffect)((function(){J&&Oe(he)}),[he,J]),(0,r.useEffect)((function(){return we?window.addEventListener("keydown",Me):window.removeEventListener("keydown",Me),function(){window.removeEventListener("keydown",Me)}}),[we]);var Fe,Ie=function(e){Ee&&Ee.current&&(Ee.current.value=e,Ee.current.setAttribute("value",e))},Le=function(){j||(de(!1),(Ee&&Ee.current).focus())},De=function(e){var t=e.selectDom,n=e.keyCode,o=e.currentDom,r="nextSibling",i=".text-field-select-content-item";38===n&&(r="previousSibling",i=".text-field-select-content-item:last-child"),o?(o=o[r])||(o=t.querySelector(i)):o=t.querySelector(".text-field-select-content-item"),o&&(o.classList.add("text-field-select-content-item-keydown"),Te(o,t))},Te=function(e,t){var n=t.clientHeight,o=e.offsetTop+e.clientHeight-n;t.scrollTop=o>0?o:0},Me=function(e){var t=document.querySelector("."+se),n=null,o=t.querySelector(".text-field-select-content-item-keydown");if(13===e.keyCode&&o){var r=o.dataset.val;He(JSON.parse(r))(e),(Ee&&Ee.current).blur()}o&&(n=o,o.classList.remove("text-field-select-content-item-keydown")),40===e.keyCode&&De({selectDom:t,keyCode:e.keyCode,currentDom:n}),38===e.keyCode&&De({selectDom:t,keyCode:e.keyCode,currentDom:n})},Ae=function(e){me(!1),""===e.target.value&&de(!0),X&&X(e)},Ue=function(e){ke(!0),J&&J(e,(function(e){qe(e||[]),ke(!1)}))},Be=function(e){me(!0),Z&&Z(e),Ue(e.target.value)},Re=function(t){var n=t.target.value;H&&void 0!==n&&""!==n&&n.toString().length>H||(void 0===e.value&&(pe(n),Ie(n)),ee&&ee(t),Ue(t.target.value))},Ke=function(e){13===e.keyCode&&oe&&oe(e),te&&te(e)},Ve=function(e){ne&&ne(e)},ze=function(e){"password"===R&&("text"===ge&&ye("password"),"password"===ge&&ye("text")),K&&K(e)},We=function(){Oe(!1)},He=function(e){return function(t){ae&&ae(e)}},Je=(0,r.useMemo)((function(){return(0,o.jsx)(o.Fragment,{children:void 0!==H&&(0,o.jsx)("span",p({className:"length-limit"},{children:(ve?ve.toString().length:0)+"/"+H}),void 0)},void 0)}),[H,ve]),$e=(0,r.useMemo)((function(){var e=V||("password"===R?"password"===ge?(0,o.jsx)(u(),{},void 0):(0,o.jsx)(s(),{},void 0):null);return(0,o.jsx)(o.Fragment,{children:W&&e&&(0,o.jsx)("span",p({className:"right-icon",onClick:ze},{children:e}),void 0)},void 0)}),[W,V,R,ge]),Ye=(0,r.useMemo)((function(){return(0,o.jsxs)("div",p({className:"text-field-content-within",ref:_e},{children:[(0,o.jsxs)("div",p({className:"text-field-content-within-input"},{children:[O?(0,o.jsx)("textarea",p({ref:Ee,rows:P,onBlur:Ae,onFocus:Be,onChange:Re,onKeyDown:Ke,onKeyUp:Ve,disabled:j},le),void 0):(0,o.jsx)("input",p({ref:Ee,type:ge,onBlur:Ae,onFocus:Be,onChange:Re,onKeyDown:Ke,onKeyUp:Ve,disabled:j},le),void 0),ue&&(0,o.jsx)("span",p({className:"text-field-label-placeholder",onClick:Le},{children:"outside"===d?m:(0,o.jsxs)(o.Fragment,{children:[g||m,C&&(0,o.jsx)("span",p({className:"text-field-required"},{children:"*"}),void 0),k&&(0,o.jsx)("span",{children:k},void 0)]},void 0)}),void 0)]}),void 0),Je,$e]}),void 0)}),[ue,U,ge,ve,Je,$e,d,m,g,j,O,P,le,ee,J]),Ge=(0,r.useMemo)((function(){var e;return(0,o.jsxs)("div",p({className:(e="text-field-select-content",Ce&&(e+=" text-field-select-content-loading"),se&&(e+=" "+se),e),style:{width:(_e&&_e.current?_e.current.offsetWidth:0)+"px"}},{children:[Pe&&Pe.map((function(e,t){return(0,o.jsx)("div",p({className:"text-field-select-content-item",onMouseDown:He(e),"data-val":JSON.stringify(e)},{children:Y?Y(e):(0,o.jsx)(a.default,{children:e[Q]},void 0)}),t)})),Ce&&(0,o.jsx)("div",p({className:"loading-box"},{children:(0,o.jsx)(f(),{},void 0)}),void 0)]}),void 0)}),[_e,we,Pe,Y,Q,ae,Ce,se]),Qe=(0,r.useMemo)((function(){return(0,o.jsx)(i.Tooltip,p({open:we,title:Ge,onClose:We,interactive:!0,disableFocusListener:!0,disableHoverListener:!0,disableTouchListener:!0,arrow:!0,classes:{popper:(e="paraui-text-field-select",l&&(e+=" paraui-text-field-select-"+l),$&&(e+=" "+$),e)}},{children:Ye}),void 0);var e}),[ue,U,ge,ve,Je,$e,d,m,g,j,O,P,le,ee,J,ae,_e,we,$,l]),Xe=(0,r.useMemo)((function(){var e=Boolean(C||k||g);return(0,o.jsx)(o.Fragment,{children:"outside"===d&&e&&(0,o.jsxs)("label",p({className:"text-field-label"},{children:[g,C&&(0,o.jsx)("span",p({className:"text-field-required"},{children:"*"}),void 0),k&&(0,o.jsx)("span",{children:k},void 0)]}),void 0)},void 0)}),[d,g,k,C]);return(0,o.jsxs)("div",p({className:(Fe="paraui-text-field",Fe+=" text-field",l&&!O&&(Fe+=" text-field-"+l),t&&(Fe+=" "+t),E&&(Fe+=" text-field-error"),he&&(Fe+=" text-field-focus"),j&&(Fe+=" text-field-disabled"),O&&(Fe+=" text-field-multiline"),Fe)},{children:[Xe,(0,o.jsxs)("div",p({className:"text-field-content"},{children:[L&&(0,o.jsx)("div",p({className:"text-field-content-before",onClick:function(e){re&&re(e)}},{children:L}),void 0),J?Qe:Ye,T&&(0,o.jsx)("div",p({className:"text-field-content-after",onClick:function(e){ie&&ie(e)}},{children:T}),void 0)]}),void 0),F&&(0,o.jsx)("p",p({className:"text-field-error-text"},{children:F}),void 0)]}),void 0)}},1731:function(t){t.exports=e},6243:function(e){e.exports=t},1102:function(e){e.exports=n},5191:function(e){e.exports=o},6570:function(e){e.exports=r},8528:function(e){e.exports=i},3475:function(e){e.exports=a},9297:function(e){e.exports=l}},u={};function d(e){var t=u[e];if(void 0!==t)return t.exports;var n=u[e]={exports:{}};return c[e](n,n.exports,d),n.exports}d.m=c,s=[],d.O=function(e,t,n,o){if(!t){var r=1/0;for(l=0;l<s.length;l++){t=s[l][0],n=s[l][1],o=s[l][2];for(var i=!0,a=0;a<t.length;a++)(!1&o||r>=o)&&Object.keys(d.O).every((function(e){return d.O[e](t[a])}))?t.splice(a--,1):(i=!1,o<r&&(r=o));i&&(s.splice(l--,1),e=n())}return e}o=o||0;for(var l=s.length;l>0&&s[l-1][2]>o;l--)s[l]=s[l-1];s[l]=[t,n,o]},d.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return d.d(t,{a:t}),t},d.d=function(e,t){for(var n in t)d.o(t,n)&&!d.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},d.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},d.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e={2576:0,1465:0,2996:0,9296:0};d.O.j=function(t){return 0===e[t]};var t=function(t,n){var o,r,i=n[0],a=n[1],l=n[2],s=0;for(o in a)d.o(a,o)&&(d.m[o]=a[o]);if(l)var c=l(d);for(t&&t(n);s<i.length;s++)r=i[s],d.o(e,r)&&e[r]&&e[r][0](),e[i[s]]=0;return d.O(c)},n=self.webpackChunkParaUI=self.webpackChunkParaUI||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}();var f=d.O(void 0,[9296],(function(){return d(8901)}));return f=d.O(f)}()}));
|
|
16
|
+
n(4126);var o=n(9297),r=60103;if(t.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var i=Symbol.for;r=i("react.element"),t.Fragment=i("react.fragment")}var a=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l=Object.prototype.hasOwnProperty,s={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var o,i={},c=null,u=null;for(o in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)l.call(t,o)&&!s.hasOwnProperty(o)&&(i[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps)void 0===i[o]&&(i[o]=t[o]);return{$$typeof:r,type:e,key:c,ref:u,props:i,_owner:a.current}}t.jsx=c,t.jsxs=c},7712:function(e,t,n){e.exports=n(9524)},3094:function(e,t,n){var o=n(7712),r=n(9297),i=n(1731),a=function(){return a=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},a.apply(this,arguments)};t.default=function(e){var t=e.children,n=e.placement,l=void 0===n?"bottom-start":n,s=e.tips,c=void 0===s?"":s,u=e.className,d=void 0===u?"":u,f=(0,r.useRef)(),v=(0,r.useState)(""),p=v[0],x=v[1];(0,r.useEffect)((function(){x(c)}),[c]);var h;return(0,o.jsx)("div",a({ref:function(e){e&&(f.current=e)},className:(h="paraui-auto-tips",d&&(h+=" "+d),h),onMouseOver:function(){f.current.scrollWidth>f.current.offsetWidth?x(p||f.current.innerText):x("")}},{children:(0,o.jsx)(i.Tooltip,a({title:p,placement:l},{children:(0,o.jsx)("div",a({className:"auto-tips-content"},{children:t}),void 0)}),void 0)}),void 0)}},8901:function(e,t,n){n.r(t),n.d(t,{SingleBox:function(){return f}});var o=n(7712),r=n(9297),i=n(3672),a=n(5191),l=n.n(a),s=n(6243),c=n.n(s),u=function(){return u=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},u.apply(this,arguments)},d=function(e,t,n){if(n||2===arguments.length)for(var o,r=0,i=t.length;r<i;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},f=function(e){var t=e.className,n=e.size,a=void 0===n?"large":n,s=e.placeholder,f=void 0===s?"":s,v=e.label,p=void 0===v?"":v,x=e.labelSign,h=e.disabled,m=void 0!==h&&h,b=e.required,g=void 0!==b&&b,y=e.error,j=void 0!==y&&y,w=e.helperText,O=void 0===w?"":w,S=e.value,C=e.onChange,k=(0,r.useState)([]),N=k[0],P=k[1];(0,r.useEffect)((function(){void 0!==e.defaultValue&&P(d([],e.defaultValue,!0))}),[]),(0,r.useEffect)((function(){void 0!==S&&P(d([],S,!0))}),[S]);var q,E=function(t){return function(){m||(N.splice(t,1),void 0===e.value&&P(d([],N,!0)),C&&C(N))}},_=function(t){return function(n){N[t]=n.target.value,void 0===e.value&&P(d([],N,!0)),C&&C(N)}};return(0,o.jsxs)("div",u({className:(q="paraui-single-box single-box",t&&(q+=" "+t),a&&(q+=" single-box-"+a),j&&(q+=" single-box-error"),m&&(q+=" single-box-disabled"),q)},{children:[p?(0,o.jsxs)("label",u({className:"single-box-label"},{children:[p,g&&(0,o.jsx)("span",u({className:"single-box-label-required"},{children:"*"}),void 0),x&&(0,o.jsx)("span",{children:x},void 0)]}),void 0):null,(0,o.jsx)("div",u({className:"single-box-content"},{children:N.map((function(e,t){return(0,o.jsxs)("div",u({className:"single-box-content-item"},{children:[(0,o.jsx)(i.default,{disabled:m,value:e,placeholder:f,size:a,onChange:_(t)},void 0),(0,o.jsx)("span",u({className:"single-box-content-item-svg"},{children:(0,o.jsx)(c(),{onClick:E(t)},void 0)}),void 0)]}),t)}))}),void 0),(0,o.jsx)("div",u({className:"single-box-add",onClick:function(){m||(N.push(""),void 0===e.value&&P(d([],N,!0)),C&&C(N))}},{children:(0,o.jsx)(l(),{},void 0)}),void 0),O&&(0,o.jsx)("p",u({className:"single-box-error"},{children:O}),void 0)]}),void 0)};t.default=f},3672:function(e,t,n){var o=n(7712),r=n(9297),i=n(1731),a=n(3094),l=n(8528),s=n.n(l),c=n(6570),u=n.n(c),d=n(1102),f=n.n(d),v=n(3475),p=function(){return p=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},p.apply(this,arguments)},x=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};t.default=function(e){var t=e.className,n=e.size,l=void 0===n?"large":n,c=e.labelMode,d=void 0===c?"outside":c,h=e.placeholder,m=void 0===h?"":h,b=e.label,g=void 0===b?"":b,y=e.disabled,j=void 0!==y&&y,w=e.multiline,O=void 0!==w&&w,S=e.required,C=void 0!==S&&S,k=e.labelSign,N=e.rows,P=void 0===N?2:N,q=e.error,E=void 0!==q&&q,_=e.helperText,F=void 0===_?"":_,I=e.addonBefore,L=void 0===I?"":I,D=e.addonAfter,T=void 0===D?"":D,M=(e.defaultValue,e.value),A=e.autoFocus,U=void 0!==A&&A,B=e.type,R=void 0===B?"text":B,K=e.onClickIcon,V=e.rightIcon,z=e.showRightIcon,W=void 0===z||z,H=e.limitLength,J=e.fetchSuggestions,$=e.selectPopoverClass,Y=e.renderSelectItem,G=e.showSelectName,Q=void 0===G?"value":G,X=e.onBlur,Z=e.onFocus,ee=e.onChange,te=e.onKeydown,ne=e.onKeyUp,oe=e.onEnter,re=e.onClickAddonBefore,ie=e.onClickAddonAfter,ae=e.onSelect,le=x(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,r.useState)("text-field-select-content-"+(0,v.UUID)())[0],ce=(0,r.useState)(!0),ue=ce[0],de=ce[1],fe=(0,r.useState)(""),ve=fe[0],pe=fe[1],xe=(0,r.useState)(!1),he=xe[0],me=xe[1],be=(0,r.useState)("text"),ge=be[0],ye=be[1],je=(0,r.useState)(!1),we=je[0],Oe=je[1],Se=(0,r.useState)(!1),Ce=Se[0],ke=Se[1],Ne=(0,r.useState)([]),Pe=Ne[0],qe=Ne[1],Ee=(0,r.useRef)(null),_e=(0,r.useRef)(null);(0,r.useEffect)((function(){void 0!==e.defaultValue&&(pe(e.defaultValue),Ie(e.defaultValue))}),[]),(0,r.useEffect)((function(){R!==ge&&ye(R)}),[R]),(0,r.useEffect)((function(){void 0!==M&&(pe(M),Ie(M))}),[M]),(0,r.useEffect)((function(){de(""===ve||void 0===ve)}),[ve]),(0,r.useEffect)((function(){J&&Oe(he)}),[he,J]),(0,r.useEffect)((function(){return we?window.addEventListener("keydown",Me):window.removeEventListener("keydown",Me),function(){window.removeEventListener("keydown",Me)}}),[we]);var Fe,Ie=function(e){Ee&&Ee.current&&(Ee.current.value=e,Ee.current.setAttribute("value",e))},Le=function(){j||(de(!1),(Ee&&Ee.current).focus())},De=function(e){var t=e.selectDom,n=e.keyCode,o=e.currentDom,r="nextSibling",i=".text-field-select-content-item";38===n&&(r="previousSibling",i=".text-field-select-content-item:last-child"),o?(o=o[r])||(o=t.querySelector(i)):o=t.querySelector(".text-field-select-content-item"),o&&(o.classList.add("text-field-select-content-item-keydown"),Te(o,t))},Te=function(e,t){var n=t.clientHeight,o=e.offsetTop+e.clientHeight-n;t.scrollTop=o>0?o:0},Me=function(e){var t=document.querySelector("."+se),n=null,o=t.querySelector(".text-field-select-content-item-keydown");if(13===e.keyCode&&o){var r=o.dataset.val;He(JSON.parse(r))(e),(Ee&&Ee.current).blur()}o&&(n=o,o.classList.remove("text-field-select-content-item-keydown")),40===e.keyCode&&De({selectDom:t,keyCode:e.keyCode,currentDom:n}),38===e.keyCode&&De({selectDom:t,keyCode:e.keyCode,currentDom:n})},Ae=function(e){me(!1),""===e.target.value&&de(!0),X&&X(e)},Ue=function(e){ke(!0),J&&J(e,(function(e){qe(e||[]),ke(!1)}))},Be=function(e){me(!0),Z&&Z(e),Ue(e.target.value)},Re=function(t){var n=t.target.value;n&&de(!1),H&&void 0!==n&&""!==n&&n.toString().length>H||(void 0===e.value&&(pe(n),Ie(n)),ee&&ee(t),Ue(t.target.value))},Ke=function(e){13===e.keyCode&&oe&&oe(e),te&&te(e)},Ve=function(e){ne&&ne(e)},ze=function(e){"password"===R&&("text"===ge&&ye("password"),"password"===ge&&ye("text")),K&&K(e)},We=function(){Oe(!1)},He=function(e){return function(t){ae&&ae(e)}},Je=(0,r.useMemo)((function(){return(0,o.jsx)(o.Fragment,{children:void 0!==H&&(0,o.jsx)("span",p({className:"length-limit"},{children:(ve?ve.toString().length:0)+"/"+H}),void 0)},void 0)}),[H,ve]),$e=(0,r.useMemo)((function(){var e=V||("password"===R?"password"===ge?(0,o.jsx)(u(),{},void 0):(0,o.jsx)(s(),{},void 0):null);return(0,o.jsx)(o.Fragment,{children:W&&e&&(0,o.jsx)("span",p({className:"right-icon",onClick:ze},{children:e}),void 0)},void 0)}),[W,V,R,ge]),Ye=(0,r.useMemo)((function(){return(0,o.jsxs)("div",p({className:"text-field-content-within",ref:_e},{children:[(0,o.jsxs)("div",p({className:"text-field-content-within-input"},{children:[O?(0,o.jsx)("textarea",p({ref:Ee,rows:P,onBlur:Ae,onFocus:Be,onChange:Re,onKeyDown:Ke,onKeyUp:Ve,disabled:j},le),void 0):(0,o.jsx)("input",p({ref:Ee,type:ge,onBlur:Ae,onFocus:Be,onChange:Re,onKeyDown:Ke,onKeyUp:Ve,disabled:j},le),void 0),ue&&(0,o.jsx)("span",p({className:"text-field-label-placeholder",onClick:Le},{children:"outside"===d?m:(0,o.jsxs)(o.Fragment,{children:[g||m,C&&(0,o.jsx)("span",p({className:"text-field-required"},{children:"*"}),void 0),k&&(0,o.jsx)("span",{children:k},void 0)]},void 0)}),void 0)]}),void 0),Je,$e]}),void 0)}),[ue,U,ge,ve,Je,$e,d,m,g,j,O,P,le,ee,J]),Ge=(0,r.useMemo)((function(){var e;return(0,o.jsxs)("div",p({className:(e="text-field-select-content",Ce&&(e+=" text-field-select-content-loading"),se&&(e+=" "+se),e),style:{width:(_e&&_e.current?_e.current.offsetWidth:0)+"px"}},{children:[Pe&&Pe.map((function(e,t){return(0,o.jsx)("div",p({className:"text-field-select-content-item",onMouseDown:He(e),"data-val":JSON.stringify(e)},{children:Y?Y(e):(0,o.jsx)(a.default,{children:e[Q]},void 0)}),t)})),Ce&&(0,o.jsx)("div",p({className:"loading-box"},{children:(0,o.jsx)(f(),{},void 0)}),void 0)]}),void 0)}),[_e,we,Pe,Y,Q,ae,Ce,se]),Qe=(0,r.useMemo)((function(){return(0,o.jsx)(i.Tooltip,p({open:we,title:Ge,onClose:We,interactive:!0,disableFocusListener:!0,disableHoverListener:!0,disableTouchListener:!0,arrow:!0,classes:{popper:(e="paraui-text-field-select",l&&(e+=" paraui-text-field-select-"+l),$&&(e+=" "+$),e)}},{children:Ye}),void 0);var e}),[ue,U,ge,ve,Je,$e,d,m,g,j,O,P,le,ee,J,ae,_e,we,$,l]),Xe=(0,r.useMemo)((function(){var e=Boolean(C||k||g);return(0,o.jsx)(o.Fragment,{children:"outside"===d&&e&&(0,o.jsxs)("label",p({className:"text-field-label"},{children:[g,C&&(0,o.jsx)("span",p({className:"text-field-required"},{children:"*"}),void 0),k&&(0,o.jsx)("span",{children:k},void 0)]}),void 0)},void 0)}),[d,g,k,C]);return(0,o.jsxs)("div",p({className:(Fe="paraui-text-field",Fe+=" text-field",l&&!O&&(Fe+=" text-field-"+l),t&&(Fe+=" "+t),E&&(Fe+=" text-field-error"),he&&(Fe+=" text-field-focus"),j&&(Fe+=" text-field-disabled"),O&&(Fe+=" text-field-multiline"),Fe)},{children:[Xe,(0,o.jsxs)("div",p({className:"text-field-content"},{children:[L&&(0,o.jsx)("div",p({className:"text-field-content-before",onClick:function(e){re&&re(e)}},{children:L}),void 0),J?Qe:Ye,T&&(0,o.jsx)("div",p({className:"text-field-content-after",onClick:function(e){ie&&ie(e)}},{children:T}),void 0)]}),void 0),F&&(0,o.jsx)("p",p({className:"text-field-error-text"},{children:F}),void 0)]}),void 0)}},1731:function(t){t.exports=e},6243:function(e){e.exports=t},1102:function(e){e.exports=n},5191:function(e){e.exports=o},6570:function(e){e.exports=r},8528:function(e){e.exports=i},3475:function(e){e.exports=a},9297:function(e){e.exports=l}},u={};function d(e){var t=u[e];if(void 0!==t)return t.exports;var n=u[e]={exports:{}};return c[e](n,n.exports,d),n.exports}d.m=c,s=[],d.O=function(e,t,n,o){if(!t){var r=1/0;for(l=0;l<s.length;l++){t=s[l][0],n=s[l][1],o=s[l][2];for(var i=!0,a=0;a<t.length;a++)(!1&o||r>=o)&&Object.keys(d.O).every((function(e){return d.O[e](t[a])}))?t.splice(a--,1):(i=!1,o<r&&(r=o));i&&(s.splice(l--,1),e=n())}return e}o=o||0;for(var l=s.length;l>0&&s[l-1][2]>o;l--)s[l]=s[l-1];s[l]=[t,n,o]},d.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return d.d(t,{a:t}),t},d.d=function(e,t){for(var n in t)d.o(t,n)&&!d.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},d.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},d.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e={2576:0,1465:0,2996:0,9296:0};d.O.j=function(t){return 0===e[t]};var t=function(t,n){var o,r,i=n[0],a=n[1],l=n[2],s=0;for(o in a)d.o(a,o)&&(d.m[o]=a[o]);if(l)var c=l(d);for(t&&t(n);s<i.length;s++)r=i[s],d.o(e,r)&&e[r]&&e[r][0](),e[i[s]]=0;return d.O(c)},n=self.webpackChunkParaUI=self.webpackChunkParaUI||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}();var f=d.O(void 0,[9296],(function(){return d(8901)}));return f=d.O(f)}()}));
|