@para-ui/core 1.1.27 → 1.1.31
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/AutoTips/index.js +1 -1
- package/Button/index.js +1 -1
- package/ButtonGroup/index.js +1 -1
- package/Checkbox/index.d.ts +2 -2
- package/Checkbox/index.js +1 -1
- package/CheckboxGroup/index.js +1 -1
- package/ComboSelect/index.js +2 -2
- package/ComboSelect/interface.d.ts +11 -8
- package/Container/index.js +1 -1
- package/DatePicker/index.js +3 -3
- package/Desktop/index.js +1 -1
- package/Form/index.js +3 -3
- package/FormItem/index.js +3 -3
- package/FunctionModal/index.js +1 -1
- package/IconList/index.js +3 -3
- package/InputLang/index.js +1 -1
- package/InputNumber/index.d.ts +4 -0
- package/InputNumber/index.js +1 -1
- package/Menu/index.js +1 -1
- package/Message/index.js +3 -3
- package/Modal/index.js +1 -1
- package/MultiBox/index.js +1 -1
- package/Pagination/index.js +3 -3
- package/ParauiProvider/index.js +1 -1
- package/PopConfirm/index.js +1 -1
- package/Popover/index.js +1 -1
- package/Radio/index.d.ts +2 -2
- package/Radio/index.js +1 -1
- package/RadioGroup/index.js +1 -1
- package/Search/index.js +1 -1
- package/Select/index.d.ts +2 -2
- package/Select/index.js +1 -1
- package/SingleBox/index.js +1 -1
- package/Stepper/index.js +3 -3
- package/Switch/index.d.ts +4 -4
- package/Switch/index.js +3 -3
- package/Table/index.js +1 -1
- package/Tabs/index.js +1 -1
- package/TextField/index.js +1 -1
- package/TimePicker/index.js +3 -3
- package/Timeline/index.js +1 -1
- package/Tree/index.js +1 -1
- package/Upload/index.d.ts +1 -1
- package/Upload/index.js +1 -1
- package/index.js +3 -3
- package/package.json +1 -1
package/Search/index.js
CHANGED
|
@@ -13,4 +13,4 @@ var t=Object.getOwnPropertySymbols,o=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
|
-
o(4126);var i=o(9297),n=60103;if(t.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var r=Symbol.for;n=r("react.element"),t.Fragment=r("react.fragment")}var l=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a=Object.prototype.hasOwnProperty,d={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,o){var i,r={},c=null,s=null;for(i in void 0!==o&&(c=""+o),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(s=t.ref),t)a.call(t,i)&&!d.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:n,type:e,key:c,ref:s,props:r,_owner:l.current}}t.jsx=c,t.jsxs=c},7712:function(e,t,o){e.exports=o(9524)},115:function(e,t,o){var i=o(7712),n=o(9297),r=o(1731),l=o(8604),a=o(853),d=function(){return d=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},d.apply(this,arguments)},c=((0,a.Z)(),(0,l.makeStyles)((function(e){return(0,l.createStyles)({"auto-tips":{maxWidth:"100%",display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","& > .auto-tips-content":{display:"inline",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})})));t.default=function(e){var t=e.children,o=e.placement,l=void 0===o?"bottom-start":o,a=e.tips,s=void 0===a?"":a,u=e.className,p=void 0===u?"":u,f=(0,n.useRef)(),x=c(),h=(0,n.useState)(""),g=h[0],v=h[1];(0,n.useEffect)((function(){v(s)}),[s]);var b;return(0,i.jsx)("div",d({ref:function(e){e&&(f.current=e)},className:(b=x["auto-tips"],b+=" paraui-auto-tips",p&&(b+=" "+p),b),onMouseOver:function(){f.current.scrollWidth>f.current.offsetWidth?v(g||f.current.innerText):v("")}},{children:(0,i.jsx)(r.Tooltip,d({title:g,placement:l},{children:(0,i.jsx)("div",d({className:"auto-tips-content"},{children:t}),void 0)}),void 0)}),void 0)}},5794:function(e,t,o){var i=o(7712),n=o(9297),r=o(1731),l=o(8604),a=o(4927),d=o(1102),c=o.n(d),s=o(853),u=function(){return u=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},u.apply(this,arguments)},p=function(e,t){var o={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(e);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(e,i[n])&&(o[i[n]]=e[i[n]])}return o},f=(0,s.Z)(),x=(0,l.makeStyles)((function(e){return(0,l.createStyles)({"@keyframes loadingCircle":{"100%":{transform:"rotate(1turn)"}},radius:{borderRadius:15},btnIcon:{"& .btn-icon":{display:"inline-flex",alignItems:"center"},"& .btn-icon svg":{color:"currentColor"}},outlinedBtn:{"& .btn-icon svg":{color:f.thmemColor.primary},"&:disabled":{"& .btn-icon svg":{color:"currentColor"}}},iconButtonToolTip:{display:"inline-block",cursor:"not-allowed","& .iconButton-disabled":{cursor:"not-allowed",pointerEvents:"none"}},loadingBtn:{position:"relative",pointerEvents:"none","&:before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:1,transition:"opacity .2s",pointerEvents:"none"},"& .loading-icon":{animation:"$loadingCircle 1s infinite linear"}}})})),h=(0,l.withStyles)((function(e){return{tooltip:{margin:"6px 0",backgroundColor:f.bgBorderColor.bg4}}}))(r.Tooltip),g=function(e){var t=x(),o=e.radius,l=e.className,d=e.disabled,s=void 0!==d&&d,f=e.children,h=e.startIcon,g=e.endIcon,v=e.loading,b=void 0!==v&&v,m=p(e,["radius","className","disabled","children","startIcon","endIcon","loading"]);"text"===m.variant&&(m.disableRipple=!0);var y=(0,n.useState)(!1),w=y[0],C=y[1];return(0,n.useEffect)((function(){C(!!b)}),[b]),(0,i.jsx)(r.Button,u({disabled:s,className:(0,a.Z)("paraui-button",l,t.btnIcon,o&&t.radius,"outlined"===m.variant&&t.outlinedBtn,w&&t.loadingBtn),startIcon:function(){if(!w)return(0,i.jsx)("span",u({className:"btn-icon"},{children:h}),void 0);if("object"==typeof b){var e=b.delay||0;setTimeout((function(){return C(!1)}),e)}return(0,i.jsx)("span",u({className:"btn-icon loading-icon"},{children:(0,i.jsx)(c(),{},void 0)}),void 0)}(),endIcon:(0,i.jsx)("span",u({className:"btn-icon"},{children:g}),void 0)},m,{children:f}),void 0)};g.IconButton=function(e){var t=x(),o=e.showToolTip,l=void 0===o||o,d=e.toolTipTitle,s=void 0===d?"":d,f=e.children,g=e.className,v=e.disabled,b=void 0!==v&&v,m=e.loading,y=void 0!==m&&m,w=e.TooltipProps,C=p(e,["showToolTip","toolTipTitle","children","className","disabled","loading","TooltipProps"]),S=(0,n.useState)(!1),j=S[0],F=S[1],O=(0,i.jsx)(r.IconButton,u({},C,{disabled:b,disableRipple:!0,className:(0,a.Z)("paraui-icon-button",g,l&&b&&"iconButton-disabled",j&&t.loadingBtn)},{children:function(){if(!j)return f;if("object"==typeof y){var e=y.delay||0;setTimeout((function(){return F(!1)}),e)}return(0,i.jsx)("span",u({className:"loading-icon"},{children:(0,i.jsx)(c(),{},void 0)}),void 0)}()}),void 0);return(0,n.useEffect)((function(){F(!!y)}),[y]),l?(0,i.jsx)(h,u({title:s},w,{children:(0,i.jsx)("span",u({className:(0,a.Z)(b&&t.iconButtonToolTip)},{children:O}),void 0)}),void 0):O},t.default=g},853:function(e,t){var o={thmemColor:{primary:"#3D66F8",secondary:"#7E98F5",thirdary:"#D6DFFD"},textColor:{primary:"#191919",secondary:"#6E7488",thirdary:"#BBBECB",white:"#FFFFFF"},bgBorderColor:{bg1:"#DCDDE3",bg2:"#F5F5F5",bg3:"#EDEDED",bg4:"#6E7488",line1:"#E5E9EF",universal:"#FFFFFF"},stateColor:{info:"#3D66F8",success:"#41D658",warning:"#FFA150",error:"#F46B53"},gradientColor:{gradient1:"linear-gradient(#3D66F8, #4F93F0)",gradient2:"linear-gradient(#0093FF, #4EB4FF)",gradient3:"linear-gradient(#844EFF, #A796FF)",gradient4:"linear-gradient(#FD7300, #FFBF69)",gradient5:"linear-gradient(#3D66F8, #D8DFFA)"},fontFamily:{zh:"Microsoft Yahei, Helvetica, sans-serif",en:"Microsoft Yahei, Helvetica, sans-serif"},fontSize:12,borderRadius:4,boxShadow:"4px 4px 6px rgba(70,75,105,0.2), -4px -4px 6px rgba(0,0,0,0.06)",buttonShadow:"4px 4px 6px rgba(70,75,105,0.1), -4px -4px 6px rgba(0,0,0,0.03)",standardFont:{standardFont1:{fontSize:"12px",fontWeight:"400"},standardFont2:{fontSize:"12px",fontWeight:"700"}},titleFont:{titleFont1:{fontSize:"14px",fontWeight:"400"},titleFont2:{fontSize:"14px",fontWeight:"700"}},visualLargeFont:{visualLargeFont1:{fontSize:"40px",fontWeight:"700"},visualLargeFont2:{fontSize:"40px",fontWeight:"700"}}};t.Z=function(){return o}},4661:function(e,t,o){var i=o(7712),n=o(9297),r=o(1731),l=o(115),a=o(8528),d=o.n(a),c=o(6570),s=o.n(c),u=o(1102),p=o.n(u),f=o(8604),x=o(853),h=o(3475),g=function(){return g=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},g.apply(this,arguments)},v=function(e,t){var o={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(e);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(e,i[n])&&(o[i[n]]=e[i[n]])}return o},b=(0,x.Z)(),m=(0,f.makeStyles)((function(){return(0,f.createStyles)({"@keyframes rotate":{"0%":{transformOrigin:"50% 50%"},"100%":{transform:"rotate(360deg)"}},"text-field":{fontFamily:b.fontFamily.zh,display:"inline-block",fontSize:b.standardFont.standardFont1.fontSize,width:"100%",paddingBottom:"20px","& fieldset":{border:0},"& .text-field-error-text":{margin:0,paddingLeft:"10px",height:"20px",lineHeight:"20px"},"& .text-field-label":{color:b.textColor.secondary,marginBottom:"9px",display:"inline-block"},"& .text-field-content":{border:"1px solid",borderColor:b.textColor.thirdary,borderRadius:b.borderRadius,position:"relative",display:"table",width:"100%",boxSizing:"border-box","&:hover":{borderColor:b.thmemColor.primary},"& > div":{display:"table-cell",height:"100%",verticalAlign:"top"},"& .text-field-content-before":{color:b.textColor.primary,padding:"0 10px",borderRight:"1px solid "+b.textColor.thirdary,backgroundColor:b.bgBorderColor.bg2,borderBottomLeftRadius:b.borderRadius,borderTopLeftRadius:b.borderRadius,whiteSpace:"nowrap","& svg":{fontSize:"20px",verticalAlign:"top",position:"relative"}},"& .text-field-content-within":{position:"relative",width:"100%","& > *":{display:"table-cell",verticalAlign:"top"},"& svg":{fontSize:"20px",color:b.textColor.secondary,cursor:"pointer"},"& .right-icon":{zIndex:"1",position:"relative",whiteSpace:"nowrap","& > svg":{marginRight:"10px"}},"& .length-limit":{zIndex:"1",position:"relative",paddingRight:"10px",color:b.textColor.secondary},"& .text-field-content-within-input":{width:"100vw","& > div":{width:"100%"},"& input":{height:"100%"},"& input,textarea":{fontSize:b.standardFont.standardFont1.fontSize,color:b.textColor.primary,"&:-ms-clear":{display:"none"},"&:-ms-reveal":{display:"none"}},"& .text-field-label-placeholder":{width:"100%",position:"absolute",left:"0",height:"100%",padding:"0 10px",boxSizing:"border-box",color:b.textColor.thirdary,cursor:"text",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}},"& .text-field-content-after":{color:b.textColor.primary,padding:"0 10px",borderLeft:"1px solid",borderColor:b.textColor.thirdary,backgroundColor:b.bgBorderColor.bg2,borderBottomRightRadius:b.borderRadius,borderTopRightRadius:b.borderRadius,whiteSpace:"nowrap","& svg":{fontSize:"20px",verticalAlign:"top",position:"relative"}}},"& .identification-label":{marginLeft:"3px"},"&.text-field-multiline":{"& .text-field-content":{"& .text-field-content-within":{"& > *":{display:"inline-block"},"& .length-limit":{width:"100%",boxSizing:"border-box",textAlign:"right",paddingBottom:"5px"},"& .text-field-content-within-input":{width:"100%","& > div:first-child":{width:"100%","& > div:first-child":{padding:"10px"}},"& .text-field-label-placeholder":{paddingTop:"10px"}}}}},"&.text-field-disabled":{"& .text-field-content":{backgroundColor:b.bgBorderColor.bg3,"&:hover":{borderColor:b.textColor.thirdary},"& .text-field-content-within":{"& .text-field-content-within-input":{"& .text-field-label-placeholder":{cursor:"not-allowed"},"& input":{cursor:"not-allowed",color:b.textColor.thirdary}}}}},"&.text-field-error":{"& .text-field-error-text":{color:b.stateColor.error},"& .text-field-content":{borderColor:b.stateColor.error,"&:hover":{borderColor:b.stateColor.error},"& .text-field-content-before":{borderColor:b.stateColor.error},"& .text-field-content-after":{borderColor:b.stateColor.error}}},"&.text-field-focus":{"& .text-field-content":{borderColor:b.thmemColor.primary,"& .text-field-content-before":{borderColor:b.thmemColor.primary},"& .text-field-content-after":{borderColor:b.thmemColor.primary}}},"&.text-field-small":{"& .text-field-content":{height:"28px","& .text-field-content-before":{lineHeight:"26px","& svg":{top:"3px"}},"& .text-field-content-within":{"& .text-field-content-within-input":{"& > div":{height:"26px","& > div":{height:"100%"}}},"& input":{padding:"5px 10px"},"& .text-field-label-placeholder":{lineHeight:"26px"},"& .right-icon":{paddingTop:"3px"},"& .length-limit":{lineHeight:"26px"}},"& .text-field-content-after":{lineHeight:"26px","& svg":{top:"3px"}}}},"&.text-field-medium":{"& .text-field-content":{height:"34px","& .text-field-content-before":{lineHeight:"32px","& svg":{top:"6px"}},"& .text-field-content-within":{"& .text-field-content-within-input":{"& > div":{height:"32px","& > div":{height:"100%"}}},"& input":{padding:"8px 10px"},"& .text-field-label-placeholder":{lineHeight:"32px"},"& .right-icon":{paddingTop:"7px"},"& .length-limit":{lineHeight:"32px","& svg":{top:"6px"}}},"& .text-field-content-after":{lineHeight:"32px","& svg":{top:"6px"}}}},"&.text-field-large":{"& .text-field-content":{height:"40px","& .text-field-content-before":{lineHeight:"38px","& svg":{top:"9px"}},"& .text-field-content-within":{"& .text-field-content-within-input":{"& > div":{height:"38px","& > div":{height:"100%"}}},"& input":{padding:"11px 10px"},"& .text-field-label-placeholder":{lineHeight:"38px"},"& .right-icon":{paddingTop:"10px"},"& .length-limit":{lineHeight:"38px"}},"& .text-field-content-after":{lineHeight:"38px","& svg":{top:"9px"}}}}},"text-field-select":{"& > div":{maxWidth:"none",padding:"0",backgroundColor:b.textColor.white,boxShadow:b.boxShadow,borderRadius:b.borderRadius,"& > span":{color:b.textColor.white},"& .text-field-select-content":{maxHeight:"300px",overflow:"auto","& > .text-field-select-content-item":{display:"flex",padding:"7px 10px",cursor:"pointer",lineHeight:"16px",color:b.textColor.secondary,"&:hover":{backgroundColor:b.bgBorderColor.bg2,color:b.thmemColor.primary},"&.text-field-select-content-item-keydown":{backgroundColor:b.bgBorderColor.bg2,color:b.thmemColor.primary}},"&.text-field-select-content-loading":{height:"100px",position:"relative",overflow:"hidden","& > .loading-box":{position:"absolute",left:"0",top:"0",width:"100%",height:"100%",backgroundColor:"white",display:"flex",justifyContent:"center",alignItems:"center","& > svg":{transition:"all .3s ease-in-out",animation:"$rotate 1s infinite linear",fontSzie:"20px"}}}}}}})}));t.default=function(e){var t=e.className,o=e.size,a=void 0===o?"small":o,c=e.labelMode,u=void 0===c?"outside":c,f=e.placeholder,x=void 0===f?"":f,b=e.label,y=void 0===b?"":b,w=e.disabled,C=void 0!==w&&w,S=e.multiline,j=void 0!==S&&S,F=e.required,O=void 0!==F&&F,k=e.showLabelSign,B=void 0===k||k,E=e.labelSign,N=e.rows,R=void 0===N?2:N,T=e.error,I=void 0!==T&&T,P=e.helperText,L=void 0===P?"":P,z=e.addonBefore,q=void 0===z?"":z,D=e.addonAfter,H=void 0===D?"":D,_=e.value,A=e.controlled,M=void 0!==A&&A,W=e.autoFocus,U=void 0!==W&&W,K=e.type,Z=void 0===K?"text":K,$=e.onClickIcon,Y=e.rightIcon,J=e.showRightIcon,G=void 0===J||J,Q=e.limitLength,V=e.fetchSuggestions,X=e.selectPopoverClass,ee=e.renderSelectItem,te=e.showSelectName,oe=void 0===te?"value":te,ie=e.onBlur,ne=e.onFocus,re=e.onChange,le=e.onKeydown,ae=e.onKeyUp,de=e.onEnter,ce=e.onClickAddonBefore,se=e.onClickAddonAfter,ue=e.onSelect,pe=v(e,["className","size","labelMode","placeholder","label","disabled","multiline","required","showLabelSign","labelSign","rows","error","helperText","addonBefore","addonAfter","value","controlled","autoFocus","type","onClickIcon","rightIcon","showRightIcon","limitLength","fetchSuggestions","selectPopoverClass","renderSelectItem","showSelectName","onBlur","onFocus","onChange","onKeydown","onKeyUp","onEnter","onClickAddonBefore","onClickAddonAfter","onSelect"]),fe=m(e),xe=(0,n.useState)("text-field-select-content-"+(0,h.UUID)())[0],he=(0,n.useState)(!0),ge=he[0],ve=he[1],be=(0,n.useState)(),me=be[0],ye=be[1],we=(0,n.useState)(!1),Ce=we[0],Se=we[1],je=(0,n.useState)(0),Fe=je[0],Oe=je[1],ke=(0,n.useState)("text"),Be=ke[0],Ee=ke[1],Ne=(0,n.useState)(!1),Re=Ne[0],Te=Ne[1],Ie=(0,n.useState)(!1),Pe=Ie[0],Le=Ie[1],ze=(0,n.useState)([]),qe=ze[0],De=ze[1],He=((0,n.useState)({})[0],(0,n.useRef)(null)),_e=(0,n.useRef)(null),Ae=(0,n.useRef)(null);(0,n.useEffect)((function(){He&&He.current&&Oe(He.current.offsetWidth)}),[]),(0,n.useEffect)((function(){Z!==Be&&Ee(Z)}),[Z]),(0,n.useEffect)((function(){ye(_)}),[_]),(0,n.useEffect)((function(){ve(""===me||void 0===me)}),[me]),(0,n.useEffect)((function(){V&&Te(Ce)}),[Ce,V]),(0,n.useEffect)((function(){return Re?window.addEventListener("keydown",Ze):window.removeEventListener("keydown",Ze),function(){window.removeEventListener("keydown",Ze)}}),[Re]);var Me,We=function(){C||(ve(!1),(_e&&_e.current&&_e.current.querySelector(j?"textarea":"input")).focus())},Ue=function(e){var t=e.selectDom,o=e.keyCode,i=e.currentDom,n="nextSibling",r=".text-field-select-content-item";38===o&&(n="previousSibling",r=".text-field-select-content-item:last-child"),i?(i=i[n])||(i=t.querySelector(r)):i=t.querySelector(".text-field-select-content-item"),i&&(i.classList.add("text-field-select-content-item-keydown"),Ke(i,t))},Ke=function(e,t){var o=t.clientHeight,i=e.offsetTop+e.clientHeight-o;t.scrollTop=i>0?i:0},Ze=function(e){var t=document.querySelector("."+xe),o=null,i=t.querySelector(".text-field-select-content-item-keydown");if(13===e.keyCode&&i){var n=i.dataset.val;tt(JSON.parse(n))(e),(_e&&_e.current&&_e.current.querySelector(j?"textarea":"input")).blur()}i&&(o=i,i.classList.remove("text-field-select-content-item-keydown")),40===e.keyCode&&Ue({selectDom:t,keyCode:e.keyCode,currentDom:o}),38===e.keyCode&&Ue({selectDom:t,keyCode:e.keyCode,currentDom:o})},$e=function(e){Se(!1),""===e.target.value&&ve(!0),ie&&ie(e)},Ye=function(e){Le(!0),V&&V(e,(function(e){De(e||[]),Le(!1)}))},Je=function(e){Se(!0),ne&&ne(e),Ye(e.target.value)},Ge=function(e){var t=e.target.value;Q&&void 0!==t&&""!==t&&t.toString().length>Q||(M||ye(t),re&&re(e),Ye(e.target.value))},Qe=function(e){13===e.keyCode&&de&&de(e),le&&le(e)},Ve=function(e){ae&&ae(e)},Xe=function(e){"password"===Z&&("text"===Be&&Ee("password"),"password"===Be&&Ee("text")),$&&$(e)},et=function(){Te(!1)},tt=function(e){return function(t){ue&&ue(e)}},ot=(0,n.useMemo)((function(){return(0,i.jsx)(i.Fragment,{children:void 0!==Q&&(0,i.jsx)("span",g({className:"length-limit"},{children:(me?me.toString().length:0)+"/"+Q}),void 0)},void 0)}),[Q,me]),it=(0,n.useMemo)((function(){return(0,i.jsx)(i.Fragment,{children:G&&(0,i.jsx)("span",g({className:"right-icon",onClick:Xe},{children:Y||("password"===Z?"password"===Be?(0,i.jsx)(s(),{},void 0):(0,i.jsx)(d(),{},void 0):null)}),void 0)},void 0)}),[G,Y,Z,Be]),nt=(0,n.useMemo)((function(){return(0,i.jsxs)("div",g({className:"text-field-content-within",ref:Ae},{children:[(0,i.jsxs)("div",g({className:"text-field-content-within-input"},{children:[(0,i.jsx)(r.TextField,g({size:"small",variant:"outlined",autoFocus:U,ref:_e,type:Be,value:me||"",disabled:C,multiline:j,rows:R,onBlur:$e,onFocus:Je,onChange:Ge,onKeyDown:Qe,onKeyUp:Ve},pe),void 0),ge&&(0,i.jsx)("span",g({className:"text-field-label-placeholder",onClick:We},{children:"outside"===u?x:(0,i.jsxs)(i.Fragment,{children:[y||x,B&&(0,i.jsx)("span",g({className:"identification-label"},{children:E||(0,i.jsx)(i.Fragment,{children:O?"(必填)":""},void 0)}),void 0)]},void 0)}),void 0)]}),void 0),ot,it]}),void 0)}),[ge,U,Be,me,ot,it,u,x,y,C,j,R,pe,re,V]),rt=(0,n.useMemo)((function(){var e;return(0,i.jsxs)("div",g({className:(e="text-field-select-content",Pe&&(e+=" text-field-select-content-loading"),xe&&(e+=" "+xe),e),style:{width:(Ae&&Ae.current?Ae.current.offsetWidth:0)+"px"}},{children:[qe&&qe.map((function(e,t){return(0,i.jsx)("div",g({className:"text-field-select-content-item",onMouseDown:tt(e),"data-val":JSON.stringify(e)},{children:ee?ee(e):(0,i.jsx)(l.default,{children:e[oe]},void 0)}),t)})),Pe&&(0,i.jsx)("div",g({className:"loading-box"},{children:(0,i.jsx)(p(),{},void 0)}),void 0)]}),void 0)}),[Ae,Re,qe,ee,oe,ue,Pe,xe]),lt=(0,n.useMemo)((function(){return(0,i.jsx)(r.Tooltip,g({open:Re,title:rt,onClose:et,interactive:!0,disableFocusListener:!0,disableHoverListener:!0,disableTouchListener:!0,arrow:!0,classes:{popper:(e=fe["text-field-select"],X&&(e+=" "+X),e)}},{children:nt}),void 0);var e}),[ge,U,Be,me,ot,it,u,x,y,C,j,R,pe,re,V,ue,Ae,Re,X]),at=(0,n.useMemo)((function(){var e=Boolean(B&&(E||O));if("outside"===u&&(y||e))return(0,i.jsxs)("label",g({className:"text-field-label"},{children:[y,B&&(0,i.jsx)("span",g({className:"identification-label"},{children:E||(0,i.jsx)(i.Fragment,{children:O?"(必填)":""},void 0)}),void 0)]}),void 0)}),[u,y,B,E,O]);return(0,i.jsxs)("div",g({className:(Me=fe["text-field"],Me+=" text-field",a&&!j&&(Me+=" text-field-"+a),t&&(Me+=" "+t),I&&(Me+=" text-field-error"),Ce&&(Me+=" text-field-focus"),C&&(Me+=" text-field-disabled"),j&&(Me+=" text-field-multiline"),Me)},{children:[at,(0,i.jsxs)("div",g({className:"text-field-content"},{children:[q&&(0,i.jsx)("div",g({className:"text-field-content-before",ref:He,onClick:function(e){ce&&ce(e)}},{children:q}),void 0),V?lt:nt,H&&(0,i.jsx)("div",g({className:"text-field-content-after",onClick:function(e){se&&se(e)}},{children:H}),void 0)]}),void 0),L&&(0,i.jsx)("p",g({className:"text-field-error-text",style:{marginLeft:Fe+"px"}},{children:L}),void 0)]}),void 0)}},1731:function(e){e.exports=t},8604:function(e){e.exports=o},6088:function(e){e.exports=a},1102:function(e){e.exports=r},6570:function(e){e.exports=n},8528:function(e){e.exports=i},4115:function(e){e.exports=d},3475:function(e){e.exports=l},9297:function(t){t.exports=e}},s={};function u(e){var t=s[e];if(void 0!==t)return t.exports;var o=s[e]={exports:{}};return c[e](o,o.exports,u),o.exports}u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,{a:t}),t},u.d=function(e,t){for(var o in t)u.o(t,o)&&!u.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var p={};return function(){u.r(p),u.d(p,{Search:function(){return h}});var e=u(7712),t=u(9297),o=u(4661),i=u(5794),n=u(6088),r=u.n(n),l=u(4115),a=u.n(l),d=u(8604),c=u(853),s=function(){return s=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},s.apply(this,arguments)},f=(0,c.Z)(),x=(0,d.makeStyles)((function(){return(0,d.createStyles)({search:{display:"flex","& > .text-field":{padding:0,"& > .text-field-content":{"& > .text-field-content-within":{"& > .right-icon":{"& > svg":{fontSize:"16px",position:"relative",top:"2px",color:f.textColor.thirdary},"&:hover":{"& > svg":{color:f.thmemColor.primary}}}}}},"& > button":{minWidth:"auto",whiteSpace:"nowrap",boxShadow:"none",padding:"0 7px",lineHeight:"0","&:hover":{backgroundColor:f.thmemColor.secondary,boxShadow:"none"},"& > span:first-child":{"& > span":{marginRight:"0px",marginLeft:"0px","& > svg":{color:"white"}}}},"&.search-outside":{"& > button":{marginLeft:"10px"}},"&.search-inside":{"& > .text-field":{"& > .text-field-content":{}},"& > button":{borderTopLeftRadius:"0",borderBottomLeftRadius:"0"}},"&.search-showbtn":{"&.search-inside":{"& > .text-field":{"& > .text-field-content":{borderTopRightRadius:"0",borderBottomRightRadius:"0",borderRight:"0"}}}},"&.search-btntext":{"& > button":{"& > span:first-child":{"& > span":{marginRight:"5px"}}}},"&.search-small":{"& > button":{height:"28px"}},"&.search-medium":{"& > button":{height:"34px"}},"&.search-large":{"& > button":{height:"40px"}}}})})),h=function(n){var l=n.className,d=void 0===l?"":l,c=n.size,u=void 0===c?"small":c,p=n.btnType,f=void 0===p?"outside":p,h=n.showBtn,g=void 0===h||h,v=n.btnIcon,b=n.btnText,m=void 0===b?"":b,y=n.placeholder,w=void 0===y?"":y,C=n.value,S=void 0===C?"":C,j=n.rightIcon,F=n.showRightIcon,O=void 0===F||F,k=n.onChange,B=n.onBlur,E=n.onFocus,N=n.onKeydown,R=n.onKeyUp,T=n.onClickBtn,I=n.onClickRightIcon,P=n.onEnter,L=x(n),z=(0,t.useState)(""),q=z[0],D=z[1];(0,t.useEffect)((function(){q!==S&&D(S)}),[S]);var H;return(0,e.jsxs)("div",s({className:(H=L.search,H+=" paraui-search",d&&(H+=" "+d),u&&(H+=" search-"+u),f&&(H+=" search-"+f),g&&(H+=" search-showbtn"),m&&(H+=" search-btntext"),H)},{children:[(0,e.jsx)(o.default,{size:u,placeholder:w,value:q,rightIcon:O?j||(0,e.jsx)(r(),{},void 0):"",onClickIcon:function(){I&&I(q)},onChange:function(e){var t=e.target.value;D(t),k&&k(t,e)},onBlur:B,onFocus:E,onKeydown:N,onKeyUp:R,onEnter:P},void 0),g&&(0,e.jsx)(i.default,s({startIcon:v||(0,e.jsx)(a(),{},void 0),variant:"contained",onClick:function(){T&&T(q)}},{children:m}),void 0)]}),void 0)};p.default=h}(),p}()}));
|
|
16
|
+
o(4126);var i=o(9297),n=60103;if(t.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var r=Symbol.for;n=r("react.element"),t.Fragment=r("react.fragment")}var l=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a=Object.prototype.hasOwnProperty,d={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,o){var i,r={},c=null,s=null;for(i in void 0!==o&&(c=""+o),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(s=t.ref),t)a.call(t,i)&&!d.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:n,type:e,key:c,ref:s,props:r,_owner:l.current}}t.jsx=c,t.jsxs=c},7712:function(e,t,o){e.exports=o(9524)},3094:function(e,t,o){var i=o(7712),n=o(9297),r=o(1731),l=o(8604),a=o(5415),d=function(){return d=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},d.apply(this,arguments)},c=((0,a.Z)(),(0,l.makeStyles)((function(e){return(0,l.createStyles)({"auto-tips":{maxWidth:"100%",display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","& > .auto-tips-content":{display:"inline",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})})));t.default=function(e){var t=e.children,o=e.placement,l=void 0===o?"bottom-start":o,a=e.tips,s=void 0===a?"":a,u=e.className,p=void 0===u?"":u,f=(0,n.useRef)(),x=c(),h=(0,n.useState)(""),g=h[0],v=h[1];(0,n.useEffect)((function(){v(s)}),[s]);var b;return(0,i.jsx)("div",d({ref:function(e){e&&(f.current=e)},className:(b=x["auto-tips"],b+=" paraui-auto-tips",p&&(b+=" "+p),b),onMouseOver:function(){f.current.scrollWidth>f.current.offsetWidth?v(g||f.current.innerText):v("")}},{children:(0,i.jsx)(r.Tooltip,d({title:g,placement:l},{children:(0,i.jsx)("div",d({className:"auto-tips-content"},{children:t}),void 0)}),void 0)}),void 0)}},36:function(e,t,o){var i=o(7712),n=o(9297),r=o(1731),l=o(8604),a=o(4927),d=o(1102),c=o.n(d),s=o(5415),u=function(){return u=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},u.apply(this,arguments)},p=function(e,t){var o={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(e);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(e,i[n])&&(o[i[n]]=e[i[n]])}return o},f=(0,s.Z)(),x=(0,l.makeStyles)((function(e){return(0,l.createStyles)({"@keyframes loadingCircle":{"100%":{transform:"rotate(1turn)"}},radius:{borderRadius:15},btnIcon:{"& .btn-icon":{display:"inline-flex",alignItems:"center"},"& .btn-icon svg":{color:"currentColor"}},outlinedBtn:{"& .btn-icon svg":{color:f.thmemColor.primary},"&:disabled":{"& .btn-icon svg":{color:"currentColor"}}},iconButtonToolTip:{display:"inline-block",cursor:"not-allowed","& .iconButton-disabled":{cursor:"not-allowed",pointerEvents:"none"}},loadingBtn:{position:"relative",pointerEvents:"none","&:before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:1,transition:"opacity .2s",pointerEvents:"none"},"& .loading-icon":{animation:"$loadingCircle 1s infinite linear"}}})})),h=(0,l.withStyles)((function(e){return{tooltip:{margin:"6px 0",backgroundColor:f.bgBorderColor.bg4}}}))(r.Tooltip),g=function(e){var t=x(),o=e.radius,l=e.className,d=e.disabled,s=void 0!==d&&d,f=e.children,h=e.startIcon,g=e.endIcon,v=e.loading,b=void 0!==v&&v,m=p(e,["radius","className","disabled","children","startIcon","endIcon","loading"]);"text"===m.variant&&(m.disableRipple=!0);var y=(0,n.useState)(!1),w=y[0],C=y[1];return(0,n.useEffect)((function(){C(!!b)}),[b]),(0,i.jsx)(r.Button,u({disabled:s,className:(0,a.Z)("paraui-button",l,t.btnIcon,o&&t.radius,"outlined"===m.variant&&t.outlinedBtn,w&&t.loadingBtn),startIcon:function(){if(!w)return(0,i.jsx)("span",u({className:"btn-icon"},{children:h}),void 0);if("object"==typeof b){var e=b.delay||0;setTimeout((function(){return C(!1)}),e)}return(0,i.jsx)("span",u({className:"btn-icon loading-icon"},{children:(0,i.jsx)(c(),{},void 0)}),void 0)}(),endIcon:(0,i.jsx)("span",u({className:"btn-icon"},{children:g}),void 0)},m,{children:f}),void 0)};g.IconButton=function(e){var t=x(),o=e.showToolTip,l=void 0===o||o,d=e.toolTipTitle,s=void 0===d?"":d,f=e.children,g=e.className,v=e.disabled,b=void 0!==v&&v,m=e.loading,y=void 0!==m&&m,w=e.TooltipProps,C=p(e,["showToolTip","toolTipTitle","children","className","disabled","loading","TooltipProps"]),S=(0,n.useState)(!1),j=S[0],F=S[1],O=(0,i.jsx)(r.IconButton,u({},C,{disabled:b,disableRipple:!0,className:(0,a.Z)("paraui-icon-button",g,l&&b&&"iconButton-disabled",j&&t.loadingBtn)},{children:function(){if(!j)return f;if("object"==typeof y){var e=y.delay||0;setTimeout((function(){return F(!1)}),e)}return(0,i.jsx)("span",u({className:"loading-icon"},{children:(0,i.jsx)(c(),{},void 0)}),void 0)}()}),void 0);return(0,n.useEffect)((function(){F(!!y)}),[y]),l?(0,i.jsx)(h,u({title:s},w,{children:(0,i.jsx)("span",u({className:(0,a.Z)(b&&t.iconButtonToolTip)},{children:O}),void 0)}),void 0):O},t.default=g},5415:function(e,t){var o={thmemColor:{primary:"#3D66F8",secondary:"#7E98F5",thirdary:"#D6DFFD"},textColor:{primary:"#191919",secondary:"#6E7488",thirdary:"#BBBECB",white:"#FFFFFF"},bgBorderColor:{bg1:"#DCDDE3",bg2:"#F5F5F5",bg3:"#EDEDED",bg4:"#6E7488",line1:"#E5E9EF",universal:"#FFFFFF"},stateColor:{info:"#3D66F8",success:"#41D658",warning:"#FFA150",error:"#F46B53"},gradientColor:{gradient1:"linear-gradient(#3D66F8, #4F93F0)",gradient2:"linear-gradient(#0093FF, #4EB4FF)",gradient3:"linear-gradient(#844EFF, #A796FF)",gradient4:"linear-gradient(#FD7300, #FFBF69)",gradient5:"linear-gradient(#3D66F8, #D8DFFA)"},fontFamily:{zh:"Microsoft Yahei, Helvetica, sans-serif",en:"Microsoft Yahei, Helvetica, sans-serif"},fontSize:12,borderRadius:4,boxShadow:"4px 4px 6px rgba(70,75,105,0.2), -4px -4px 6px rgba(0,0,0,0.06)",buttonShadow:"4px 4px 6px rgba(70,75,105,0.1), -4px -4px 6px rgba(0,0,0,0.03)",standardFont:{standardFont1:{fontSize:"12px",fontWeight:"400"},standardFont2:{fontSize:"12px",fontWeight:"700"}},titleFont:{titleFont1:{fontSize:"14px",fontWeight:"400"},titleFont2:{fontSize:"14px",fontWeight:"700"}},visualLargeFont:{visualLargeFont1:{fontSize:"40px",fontWeight:"700"},visualLargeFont2:{fontSize:"40px",fontWeight:"700"}}};t.Z=function(){return o}},3672:function(e,t,o){var i=o(7712),n=o(9297),r=o(1731),l=o(3094),a=o(8528),d=o.n(a),c=o(6570),s=o.n(c),u=o(1102),p=o.n(u),f=o(8604),x=o(5415),h=o(3475),g=function(){return g=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},g.apply(this,arguments)},v=function(e,t){var o={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(e);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(e,i[n])&&(o[i[n]]=e[i[n]])}return o},b=(0,x.Z)(),m=(0,f.makeStyles)((function(){return(0,f.createStyles)({"@keyframes rotate":{"0%":{transformOrigin:"50% 50%"},"100%":{transform:"rotate(360deg)"}},"text-field":{fontFamily:b.fontFamily.zh,display:"inline-block",fontSize:b.standardFont.standardFont1.fontSize,width:"100%",paddingBottom:"20px","& fieldset":{border:0},"& .text-field-error-text":{margin:0,paddingLeft:"10px",height:"20px",lineHeight:"20px"},"& .text-field-label":{color:b.textColor.secondary,marginBottom:"9px",display:"inline-block"},"& .text-field-content":{border:"1px solid",borderColor:b.textColor.thirdary,borderRadius:b.borderRadius,position:"relative",display:"table",width:"100%",boxSizing:"border-box","&:hover":{borderColor:b.thmemColor.primary},"& > div":{display:"table-cell",height:"100%",verticalAlign:"top"},"& .text-field-content-before":{color:b.textColor.primary,padding:"0 10px",borderRight:"1px solid "+b.textColor.thirdary,backgroundColor:b.bgBorderColor.bg2,borderBottomLeftRadius:b.borderRadius,borderTopLeftRadius:b.borderRadius,whiteSpace:"nowrap","& svg":{fontSize:"20px",verticalAlign:"top",position:"relative"}},"& .text-field-content-within":{position:"relative",width:"100%","& > *":{display:"table-cell",verticalAlign:"top"},"& svg":{fontSize:"20px",color:b.textColor.secondary,cursor:"pointer"},"& .right-icon":{zIndex:"1",position:"relative",whiteSpace:"nowrap","& > svg":{marginRight:"10px"}},"& .length-limit":{zIndex:"1",position:"relative",paddingRight:"10px",color:b.textColor.secondary},"& .text-field-content-within-input":{width:"100vw","& > div":{width:"100%"},"& input":{height:"100%"},"& input,textarea":{fontSize:b.standardFont.standardFont1.fontSize,color:b.textColor.primary,"&:-ms-clear":{display:"none"},"&:-ms-reveal":{display:"none"}},"& .text-field-label-placeholder":{width:"100%",position:"absolute",left:"0",height:"100%",padding:"0 10px",boxSizing:"border-box",color:b.textColor.thirdary,cursor:"text",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}},"& .text-field-content-after":{color:b.textColor.primary,padding:"0 10px",borderLeft:"1px solid",borderColor:b.textColor.thirdary,backgroundColor:b.bgBorderColor.bg2,borderBottomRightRadius:b.borderRadius,borderTopRightRadius:b.borderRadius,whiteSpace:"nowrap","& svg":{fontSize:"20px",verticalAlign:"top",position:"relative"}}},"& .identification-label":{marginLeft:"3px"},"&.text-field-multiline":{"& .text-field-content":{"& .text-field-content-within":{"& > *":{display:"inline-block"},"& .length-limit":{width:"100%",boxSizing:"border-box",textAlign:"right",paddingBottom:"5px"},"& .text-field-content-within-input":{width:"100%","& > div:first-child":{width:"100%","& > div:first-child":{padding:"10px"}},"& .text-field-label-placeholder":{paddingTop:"10px"}}}}},"&.text-field-disabled":{"& .text-field-content":{backgroundColor:b.bgBorderColor.bg3,"&:hover":{borderColor:b.textColor.thirdary},"& .text-field-content-within":{"& .text-field-content-within-input":{"& .text-field-label-placeholder":{cursor:"not-allowed"},"& input":{cursor:"not-allowed",color:b.textColor.thirdary}}}}},"&.text-field-error":{"& .text-field-error-text":{color:b.stateColor.error},"& .text-field-content":{borderColor:b.stateColor.error,"&:hover":{borderColor:b.stateColor.error},"& .text-field-content-before":{borderColor:b.stateColor.error},"& .text-field-content-after":{borderColor:b.stateColor.error}}},"&.text-field-focus":{"& .text-field-content":{borderColor:b.thmemColor.primary,"& .text-field-content-before":{borderColor:b.thmemColor.primary},"& .text-field-content-after":{borderColor:b.thmemColor.primary}}},"&.text-field-small":{"& .text-field-content":{height:"28px","& .text-field-content-before":{lineHeight:"26px","& svg":{top:"3px"}},"& .text-field-content-within":{"& .text-field-content-within-input":{"& > div":{height:"26px","& > div":{height:"100%"}}},"& input":{padding:"5px 10px"},"& .text-field-label-placeholder":{lineHeight:"26px"},"& .right-icon":{paddingTop:"3px"},"& .length-limit":{lineHeight:"26px"}},"& .text-field-content-after":{lineHeight:"26px","& svg":{top:"3px"}}}},"&.text-field-medium":{"& .text-field-content":{height:"34px","& .text-field-content-before":{lineHeight:"32px","& svg":{top:"6px"}},"& .text-field-content-within":{"& .text-field-content-within-input":{"& > div":{height:"32px","& > div":{height:"100%"}}},"& input":{padding:"8px 10px"},"& .text-field-label-placeholder":{lineHeight:"32px"},"& .right-icon":{paddingTop:"7px"},"& .length-limit":{lineHeight:"32px","& svg":{top:"6px"}}},"& .text-field-content-after":{lineHeight:"32px","& svg":{top:"6px"}}}},"&.text-field-large":{"& .text-field-content":{height:"40px","& .text-field-content-before":{lineHeight:"38px","& svg":{top:"9px"}},"& .text-field-content-within":{"& .text-field-content-within-input":{"& > div":{height:"38px","& > div":{height:"100%"}}},"& input":{padding:"11px 10px"},"& .text-field-label-placeholder":{lineHeight:"38px"},"& .right-icon":{paddingTop:"10px"},"& .length-limit":{lineHeight:"38px"}},"& .text-field-content-after":{lineHeight:"38px","& svg":{top:"9px"}}}}},"text-field-select":{"& > div":{maxWidth:"none",padding:"0",backgroundColor:b.textColor.white,boxShadow:b.boxShadow,borderRadius:b.borderRadius,"& > span":{color:b.textColor.white},"& .text-field-select-content":{maxHeight:"300px",overflow:"auto","& > .text-field-select-content-item":{display:"flex",padding:"7px 10px",cursor:"pointer",lineHeight:"16px",color:b.textColor.secondary,"&:hover":{backgroundColor:b.bgBorderColor.bg2,color:b.thmemColor.primary},"&.text-field-select-content-item-keydown":{backgroundColor:b.bgBorderColor.bg2,color:b.thmemColor.primary}},"&.text-field-select-content-loading":{height:"100px",position:"relative",overflow:"hidden","& > .loading-box":{position:"absolute",left:"0",top:"0",width:"100%",height:"100%",backgroundColor:"white",display:"flex",justifyContent:"center",alignItems:"center","& > svg":{transition:"all .3s ease-in-out",animation:"$rotate 1s infinite linear",fontSzie:"20px"}}}}}}})}));t.default=function(e){var t=e.className,o=e.size,a=void 0===o?"small":o,c=e.labelMode,u=void 0===c?"outside":c,f=e.placeholder,x=void 0===f?"":f,b=e.label,y=void 0===b?"":b,w=e.disabled,C=void 0!==w&&w,S=e.multiline,j=void 0!==S&&S,F=e.required,O=void 0!==F&&F,k=e.showLabelSign,B=void 0===k||k,E=e.labelSign,N=e.rows,R=void 0===N?2:N,T=e.error,I=void 0!==T&&T,P=e.helperText,L=void 0===P?"":P,z=e.addonBefore,q=void 0===z?"":z,D=e.addonAfter,H=void 0===D?"":D,_=e.value,A=e.controlled,M=void 0!==A&&A,W=e.autoFocus,U=void 0!==W&&W,K=e.type,Z=void 0===K?"text":K,$=e.onClickIcon,Y=e.rightIcon,J=e.showRightIcon,G=void 0===J||J,Q=e.limitLength,V=e.fetchSuggestions,X=e.selectPopoverClass,ee=e.renderSelectItem,te=e.showSelectName,oe=void 0===te?"value":te,ie=e.onBlur,ne=e.onFocus,re=e.onChange,le=e.onKeydown,ae=e.onKeyUp,de=e.onEnter,ce=e.onClickAddonBefore,se=e.onClickAddonAfter,ue=e.onSelect,pe=v(e,["className","size","labelMode","placeholder","label","disabled","multiline","required","showLabelSign","labelSign","rows","error","helperText","addonBefore","addonAfter","value","controlled","autoFocus","type","onClickIcon","rightIcon","showRightIcon","limitLength","fetchSuggestions","selectPopoverClass","renderSelectItem","showSelectName","onBlur","onFocus","onChange","onKeydown","onKeyUp","onEnter","onClickAddonBefore","onClickAddonAfter","onSelect"]),fe=m(e),xe=(0,n.useState)("text-field-select-content-"+(0,h.UUID)())[0],he=(0,n.useState)(!0),ge=he[0],ve=he[1],be=(0,n.useState)(),me=be[0],ye=be[1],we=(0,n.useState)(!1),Ce=we[0],Se=we[1],je=(0,n.useState)(0),Fe=je[0],Oe=je[1],ke=(0,n.useState)("text"),Be=ke[0],Ee=ke[1],Ne=(0,n.useState)(!1),Re=Ne[0],Te=Ne[1],Ie=(0,n.useState)(!1),Pe=Ie[0],Le=Ie[1],ze=(0,n.useState)([]),qe=ze[0],De=ze[1],He=((0,n.useState)({})[0],(0,n.useRef)(null)),_e=(0,n.useRef)(null),Ae=(0,n.useRef)(null);(0,n.useEffect)((function(){He&&He.current&&Oe(He.current.offsetWidth)}),[]),(0,n.useEffect)((function(){Z!==Be&&Ee(Z)}),[Z]),(0,n.useEffect)((function(){ye(_)}),[_]),(0,n.useEffect)((function(){ve(""===me||void 0===me)}),[me]),(0,n.useEffect)((function(){V&&Te(Ce)}),[Ce,V]),(0,n.useEffect)((function(){return Re?window.addEventListener("keydown",Ze):window.removeEventListener("keydown",Ze),function(){window.removeEventListener("keydown",Ze)}}),[Re]);var Me,We=function(){C||(ve(!1),(_e&&_e.current&&_e.current.querySelector(j?"textarea":"input")).focus())},Ue=function(e){var t=e.selectDom,o=e.keyCode,i=e.currentDom,n="nextSibling",r=".text-field-select-content-item";38===o&&(n="previousSibling",r=".text-field-select-content-item:last-child"),i?(i=i[n])||(i=t.querySelector(r)):i=t.querySelector(".text-field-select-content-item"),i&&(i.classList.add("text-field-select-content-item-keydown"),Ke(i,t))},Ke=function(e,t){var o=t.clientHeight,i=e.offsetTop+e.clientHeight-o;t.scrollTop=i>0?i:0},Ze=function(e){var t=document.querySelector("."+xe),o=null,i=t.querySelector(".text-field-select-content-item-keydown");if(13===e.keyCode&&i){var n=i.dataset.val;tt(JSON.parse(n))(e),(_e&&_e.current&&_e.current.querySelector(j?"textarea":"input")).blur()}i&&(o=i,i.classList.remove("text-field-select-content-item-keydown")),40===e.keyCode&&Ue({selectDom:t,keyCode:e.keyCode,currentDom:o}),38===e.keyCode&&Ue({selectDom:t,keyCode:e.keyCode,currentDom:o})},$e=function(e){Se(!1),""===e.target.value&&ve(!0),ie&&ie(e)},Ye=function(e){Le(!0),V&&V(e,(function(e){De(e||[]),Le(!1)}))},Je=function(e){Se(!0),ne&&ne(e),Ye(e.target.value)},Ge=function(e){var t=e.target.value;Q&&void 0!==t&&""!==t&&t.toString().length>Q||(M||ye(t),re&&re(e),Ye(e.target.value))},Qe=function(e){13===e.keyCode&&de&&de(e),le&&le(e)},Ve=function(e){ae&&ae(e)},Xe=function(e){"password"===Z&&("text"===Be&&Ee("password"),"password"===Be&&Ee("text")),$&&$(e)},et=function(){Te(!1)},tt=function(e){return function(t){ue&&ue(e)}},ot=(0,n.useMemo)((function(){return(0,i.jsx)(i.Fragment,{children:void 0!==Q&&(0,i.jsx)("span",g({className:"length-limit"},{children:(me?me.toString().length:0)+"/"+Q}),void 0)},void 0)}),[Q,me]),it=(0,n.useMemo)((function(){return(0,i.jsx)(i.Fragment,{children:G&&(0,i.jsx)("span",g({className:"right-icon",onClick:Xe},{children:Y||("password"===Z?"password"===Be?(0,i.jsx)(s(),{},void 0):(0,i.jsx)(d(),{},void 0):null)}),void 0)},void 0)}),[G,Y,Z,Be]),nt=(0,n.useMemo)((function(){return(0,i.jsxs)("div",g({className:"text-field-content-within",ref:Ae},{children:[(0,i.jsxs)("div",g({className:"text-field-content-within-input"},{children:[(0,i.jsx)(r.TextField,g({size:"small",variant:"outlined",autoFocus:U,ref:_e,type:Be,value:me||"",disabled:C,multiline:j,rows:R,onBlur:$e,onFocus:Je,onChange:Ge,onKeyDown:Qe,onKeyUp:Ve},pe),void 0),ge&&(0,i.jsx)("span",g({className:"text-field-label-placeholder",onClick:We},{children:"outside"===u?x:(0,i.jsxs)(i.Fragment,{children:[y||x,B&&(0,i.jsx)("span",g({className:"identification-label"},{children:E||(0,i.jsx)(i.Fragment,{children:O?"(必填)":""},void 0)}),void 0)]},void 0)}),void 0)]}),void 0),ot,it]}),void 0)}),[ge,U,Be,me,ot,it,u,x,y,C,j,R,pe,re,V]),rt=(0,n.useMemo)((function(){var e;return(0,i.jsxs)("div",g({className:(e="text-field-select-content",Pe&&(e+=" text-field-select-content-loading"),xe&&(e+=" "+xe),e),style:{width:(Ae&&Ae.current?Ae.current.offsetWidth:0)+"px"}},{children:[qe&&qe.map((function(e,t){return(0,i.jsx)("div",g({className:"text-field-select-content-item",onMouseDown:tt(e),"data-val":JSON.stringify(e)},{children:ee?ee(e):(0,i.jsx)(l.default,{children:e[oe]},void 0)}),t)})),Pe&&(0,i.jsx)("div",g({className:"loading-box"},{children:(0,i.jsx)(p(),{},void 0)}),void 0)]}),void 0)}),[Ae,Re,qe,ee,oe,ue,Pe,xe]),lt=(0,n.useMemo)((function(){return(0,i.jsx)(r.Tooltip,g({open:Re,title:rt,onClose:et,interactive:!0,disableFocusListener:!0,disableHoverListener:!0,disableTouchListener:!0,arrow:!0,classes:{popper:(e=fe["text-field-select"],X&&(e+=" "+X),e)}},{children:nt}),void 0);var e}),[ge,U,Be,me,ot,it,u,x,y,C,j,R,pe,re,V,ue,Ae,Re,X]),at=(0,n.useMemo)((function(){var e=Boolean(B&&(E||O));if("outside"===u&&(y||e))return(0,i.jsxs)("label",g({className:"text-field-label"},{children:[y,B&&(0,i.jsx)("span",g({className:"identification-label"},{children:E||(0,i.jsx)(i.Fragment,{children:O?"(必填)":""},void 0)}),void 0)]}),void 0)}),[u,y,B,E,O]);return(0,i.jsxs)("div",g({className:(Me=fe["text-field"],Me+=" text-field",a&&!j&&(Me+=" text-field-"+a),t&&(Me+=" "+t),I&&(Me+=" text-field-error"),Ce&&(Me+=" text-field-focus"),C&&(Me+=" text-field-disabled"),j&&(Me+=" text-field-multiline"),Me)},{children:[at,(0,i.jsxs)("div",g({className:"text-field-content"},{children:[q&&(0,i.jsx)("div",g({className:"text-field-content-before",ref:He,onClick:function(e){ce&&ce(e)}},{children:q}),void 0),V?lt:nt,H&&(0,i.jsx)("div",g({className:"text-field-content-after",onClick:function(e){se&&se(e)}},{children:H}),void 0)]}),void 0),L&&(0,i.jsx)("p",g({className:"text-field-error-text",style:{marginLeft:Fe+"px"}},{children:L}),void 0)]}),void 0)}},1731:function(e){e.exports=t},8604:function(e){e.exports=o},6088:function(e){e.exports=a},1102:function(e){e.exports=r},6570:function(e){e.exports=n},8528:function(e){e.exports=i},4115:function(e){e.exports=d},3475:function(e){e.exports=l},9297:function(t){t.exports=e}},s={};function u(e){var t=s[e];if(void 0!==t)return t.exports;var o=s[e]={exports:{}};return c[e](o,o.exports,u),o.exports}u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,{a:t}),t},u.d=function(e,t){for(var o in t)u.o(t,o)&&!u.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var p={};return function(){u.r(p),u.d(p,{Search:function(){return h}});var e=u(7712),t=u(9297),o=u(3672),i=u(36),n=u(6088),r=u.n(n),l=u(4115),a=u.n(l),d=u(8604),c=u(5415),s=function(){return s=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},s.apply(this,arguments)},f=(0,c.Z)(),x=(0,d.makeStyles)((function(){return(0,d.createStyles)({search:{display:"flex","& > .text-field":{padding:0,"& > .text-field-content":{"& > .text-field-content-within":{"& > .right-icon":{"& > svg":{fontSize:"16px",position:"relative",top:"2px",color:f.textColor.thirdary},"&:hover":{"& > svg":{color:f.thmemColor.primary}}}}}},"& > button":{minWidth:"auto",whiteSpace:"nowrap",boxShadow:"none",padding:"0 7px",lineHeight:"0","&:hover":{backgroundColor:f.thmemColor.secondary,boxShadow:"none"},"& > span:first-child":{"& > span":{marginRight:"0px",marginLeft:"0px","& > svg":{color:"white"}}}},"&.search-outside":{"& > button":{marginLeft:"10px"}},"&.search-inside":{"& > .text-field":{"& > .text-field-content":{}},"& > button":{borderTopLeftRadius:"0",borderBottomLeftRadius:"0"}},"&.search-showbtn":{"&.search-inside":{"& > .text-field":{"& > .text-field-content":{borderTopRightRadius:"0",borderBottomRightRadius:"0",borderRight:"0"}}}},"&.search-btntext":{"& > button":{"& > span:first-child":{"& > span":{marginRight:"5px"}}}},"&.search-small":{"& > button":{height:"28px"}},"&.search-medium":{"& > button":{height:"34px"}},"&.search-large":{"& > button":{height:"40px"}}}})})),h=function(n){var l=n.className,d=void 0===l?"":l,c=n.size,u=void 0===c?"small":c,p=n.btnType,f=void 0===p?"outside":p,h=n.showBtn,g=void 0===h||h,v=n.btnIcon,b=n.btnText,m=void 0===b?"":b,y=n.placeholder,w=void 0===y?"":y,C=n.value,S=void 0===C?"":C,j=n.rightIcon,F=n.showRightIcon,O=void 0===F||F,k=n.onChange,B=n.onBlur,E=n.onFocus,N=n.onKeydown,R=n.onKeyUp,T=n.onClickBtn,I=n.onClickRightIcon,P=n.onEnter,L=x(n),z=(0,t.useState)(""),q=z[0],D=z[1];(0,t.useEffect)((function(){q!==S&&D(S)}),[S]);var H;return(0,e.jsxs)("div",s({className:(H=L.search,H+=" paraui-search",d&&(H+=" "+d),u&&(H+=" search-"+u),f&&(H+=" search-"+f),g&&(H+=" search-showbtn"),m&&(H+=" search-btntext"),H)},{children:[(0,e.jsx)(o.default,{size:u,placeholder:w,value:q,rightIcon:O?j||(0,e.jsx)(r(),{},void 0):"",onClickIcon:function(){I&&I(q)},onChange:function(e){var t=e.target.value;D(t),k&&k(t,e)},onBlur:B,onFocus:E,onKeydown:N,onKeyUp:R,onEnter:P},void 0),g&&(0,e.jsx)(i.default,s({startIcon:v||(0,e.jsx)(a(),{},void 0),variant:"contained",onClick:function(){T&&T(q)}},{children:m}),void 0)]}),void 0)};p.default=h}(),p}()}));
|
package/Select/index.d.ts
CHANGED
package/Select/index.js
CHANGED
|
@@ -13,4 +13,4 @@ var t=Object.getOwnPropertySymbols,o=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
|
-
o(4126);var r=o(9297),i=60103;if(t.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var n=Symbol.for;i=n("react.element"),t.Fragment=n("react.fragment")}var l=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s=Object.prototype.hasOwnProperty,c={key:!0,ref:!0,__self:!0,__source:!0};function a(e,t,o){var r,n={},a=null,d=null;for(r in void 0!==o&&(a=""+o),void 0!==t.key&&(a=""+t.key),void 0!==t.ref&&(d=t.ref),t)s.call(t,r)&&!c.hasOwnProperty(r)&&(n[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===n[r]&&(n[r]=t[r]);return{$$typeof:i,type:e,key:a,ref:d,props:n,_owner:l.current}}t.jsx=a,t.jsxs=a},7712:function(e,t,o){e.exports=o(9524)},115:function(e,t,o){var r=o(7712),i=o(9297),n=o(1731),l=o(8604),s=o(853),c=function(){return c=Object.assign||function(e){for(var t,o=1,r=arguments.length;o<r;o++)for(var i in t=arguments[o])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},c.apply(this,arguments)},a=((0,s.Z)(),(0,l.makeStyles)((function(e){return(0,l.createStyles)({"auto-tips":{maxWidth:"100%",display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","& > .auto-tips-content":{display:"inline",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})})));t.default=function(e){var t=e.children,o=e.placement,l=void 0===o?"bottom-start":o,s=e.tips,d=void 0===s?"":s,p=e.className,u=void 0===p?"":p,h=(0,i.useRef)(),v=a(),f=(0,i.useState)(""),m=f[0],x=f[1];(0,i.useEffect)((function(){x(d)}),[d]);var g;return(0,r.jsx)("div",c({ref:function(e){e&&(h.current=e)},className:(g=v["auto-tips"],g+=" paraui-auto-tips",u&&(g+=" "+u),g),onMouseOver:function(){h.current.scrollWidth>h.current.offsetWidth?x(m||h.current.innerText):x("")}},{children:(0,r.jsx)(n.Tooltip,c({title:m,placement:l},{children:(0,r.jsx)("div",c({className:"auto-tips-content"},{children:t}),void 0)}),void 0)}),void 0)}},853:function(e,t){var o={thmemColor:{primary:"#3D66F8",secondary:"#7E98F5",thirdary:"#D6DFFD"},textColor:{primary:"#191919",secondary:"#6E7488",thirdary:"#BBBECB",white:"#FFFFFF"},bgBorderColor:{bg1:"#DCDDE3",bg2:"#F5F5F5",bg3:"#EDEDED",bg4:"#6E7488",line1:"#E5E9EF",universal:"#FFFFFF"},stateColor:{info:"#3D66F8",success:"#41D658",warning:"#FFA150",error:"#F46B53"},gradientColor:{gradient1:"linear-gradient(#3D66F8, #4F93F0)",gradient2:"linear-gradient(#0093FF, #4EB4FF)",gradient3:"linear-gradient(#844EFF, #A796FF)",gradient4:"linear-gradient(#FD7300, #FFBF69)",gradient5:"linear-gradient(#3D66F8, #D8DFFA)"},fontFamily:{zh:"Microsoft Yahei, Helvetica, sans-serif",en:"Microsoft Yahei, Helvetica, sans-serif"},fontSize:12,borderRadius:4,boxShadow:"4px 4px 6px rgba(70,75,105,0.2), -4px -4px 6px rgba(0,0,0,0.06)",buttonShadow:"4px 4px 6px rgba(70,75,105,0.1), -4px -4px 6px rgba(0,0,0,0.03)",standardFont:{standardFont1:{fontSize:"12px",fontWeight:"400"},standardFont2:{fontSize:"12px",fontWeight:"700"}},titleFont:{titleFont1:{fontSize:"14px",fontWeight:"400"},titleFont2:{fontSize:"14px",fontWeight:"700"}},visualLargeFont:{visualLargeFont1:{fontSize:"40px",fontWeight:"700"},visualLargeFont2:{fontSize:"40px",fontWeight:"700"}}};t.Z=function(){return o}},1731:function(e){e.exports=t},8604:function(e){e.exports=l},6110:function(e){e.exports=i},19:function(e){e.exports=n},6028:function(e){e.exports=o},4115:function(e){e.exports=r},3475:function(e){e.exports=s},9297:function(t){t.exports=e}},a={};function d(e){var t=a[e];if(void 0!==t)return t.exports;var o=a[e]={exports:{}};return c[e](o,o.exports,d),o.exports}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 o in t)d.o(t,o)&&!d.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},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})};var p={};return function(){d.r(p),d.d(p,{Select:function(){return w}});var e=d(7712),t=d(9297),o=d(1731),r=d(6028),i=d.n(r),n=d(4115),l=d.n(n),s=d(6110),c=d.n(s),a=d(19),u=d.n(a),h=d(115),v=d(8604),f=d(853),m=d(3475),x=function(){return x=Object.assign||function(e){for(var t,o=1,r=arguments.length;o<r;o++)for(var i in t=arguments[o])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},x.apply(this,arguments)},g=function(e,t,o){if(o||2===arguments.length)for(var r,i=0,n=t.length;i<n;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},y=(0,f.Z)(),b=(0,v.makeStyles)((function(){return(0,v.createStyles)({select:{"& *":{boxSizing:"border-box"},fontFamily:y.fontFamily.zh,display:"inline-block",fontSize:y.standardFont.standardFont1.fontSize,width:"100%",paddingBottom:"20px","& > .select-label":{color:y.textColor.secondary,marginBottom:"9px",display:"inline-block"},"& > .select-content":{lineHeight:"0",border:"1px solid",borderColor:y.textColor.thirdary,borderRadius:y.borderRadius,paddingRight:"30px",position:"relative",cursor:"pointer","&:hover":{borderColor:y.thmemColor.primary,"& > .select-svg":{"& > svg":{color:y.thmemColor.primary}}},"& > .select-label-placeholder":{width:"100%",height:"100%",padding:"0 10px",boxSizing:"border-box",color:y.textColor.thirdary,display:"inline-block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",position:"absolute",left:"0",top:"0"},"& > .select-svg":{position:"absolute",right:"8px",top:"0","& > svg":{fontSize:"16px",transition:"all .3s",color:y.textColor.secondary}},"& > .radio-select-content":{paddingLeft:"10px",color:y.textColor.primary,fontSize:"12px",lineHeight:"16px"},"& > .radio-search-outside":{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",padding:"0 30px 0 10px",fontSize:"12px",cursor:"pointer","& > div":{height:"100%",cursor:"pointer","& > input":{height:"100%",padding:"0",color:y.textColor.primary,fontSize:"12px",cursor:"pointer"},"& fieldset":{display:"none"}}},"& > .check-select-content":{paddingLeft:"10px",height:"100%",overflow:"hidden","& > .check-select-content-item":{display:"inline-block",backgroundColor:y.bgBorderColor.bg2,borderRadius:y.borderRadius,padding:"0 10px",color:y.textColor.primary,fontSize:"12px",marginRight:"10px",verticalAlign:"top",maxWidth:"100%",whiteSpace:"nowrap","&.check-select-content-item-more":{color:y.thmemColor.primary,cursor:"pointer","& > span":{maxWidth:"none"}},"& > span":{display:"inline-block",hieght:"100%",verticalAlign:"top",maxWidth:"calc(100% - 20px)",overflow:"hidden",textOverflow:"ellipsis"},"& > svg":{cursor:"pointer",marginLeft:"8px",color:y.textColor.secondary,fontSize:"16px",position:"relative",top:"2px","&:hover":{color:y.thmemColor.primary}}},"& > .check-search-outside":{width:"10px",maxWidth:"100% !important",display:"none","& > div":{width:"100%","& > input":{width:"100%",padding:"0",color:y.textColor.primary,fontSize:"12px",cursor:"pointer"},"& fieldset":{display:"none"}}}}},"& > .select-error-text":{margin:0,paddingLeft:"10px",height:"20px",lineHeight:"20px"},"&.select-disabled":{"& > .select-content":{backgroundColor:y.bgBorderColor.bg2,cursor:"not-allowed","&:hover":{borderColor:y.textColor.thirdary,"& > .select-svg":{"& > svg":{color:y.textColor.secondary}}},"& > .check-select-content":{"& > .check-select-content-item":{backgroundColor:y.bgBorderColor.bg3,"& > span":{maxWidth:"none"}}}}},"&.select-error":{"& > .select-content":{borderColor:y.stateColor.error+"!important"},"& > .select-error-text":{color:y.stateColor.error+"!important"}},"&.select-multiple":{},"&.select-open":{"& > .select-content":{borderColor:y.thmemColor.primary,"& > .select-svg":{"& > svg":{transform:"rotate(180deg)",color:y.thmemColor.primary}},"& > .check-select-content":{"& > .check-search-outside":{display:"inline-block"}}}},"&.select-small":{"& > .select-content":{height:"28px","& > .select-label-placeholder":{lineHeight:"26px"},"& > .select-svg":{top:"5px"},"& > .radio-select-content":{paddingTop:"5px",paddingBottom:"5px"},"& > .radio-search-outside":{"& > div":{paddingTop:"5px",paddingBottom:"5px"}},"& > .check-select-content":{paddingBottom:"3px","& > .check-select-content-item":{marginTop:"3px",height:"20px",lineHeight:"20px"},"& > .check-search-outside":{marginTop:"3px","& input":{height:"20px"}}}}},"&.select-medium":{"& > .select-content":{height:"34px","& > .select-label-placeholder":{lineHeight:"32px"},"& > .select-svg":{top:"8px"},"& > .radio-select-content":{paddingTop:"8px",paddingBottom:"8px"},"& > .radio-search-outside":{"& > div":{paddingTop:"8px",paddingBottom:"8px"}},"& > .check-select-content":{paddingBottom:"4px","& > .check-select-content-item":{marginTop:"4px",height:"24px",lineHeight:"24px"},"& > .check-search-outside":{marginTop:"4px","& input":{height:"24px"}}}}},"&.select-large":{"& > .select-content":{height:"40px","& > .select-label-placeholder":{lineHeight:"38px"},"& > .select-svg":{top:"11px"},"& > .radio-select-content":{paddingTop:"11px",paddingBottom:"11px"},"& > .radio-search-outside":{"& > div":{paddingTop:"11px",paddingBottom:"11px"}},"& > .check-select-content":{paddingBottom:"7px","& > .check-select-content-item":{marginTop:"7px",height:"24px",lineHeight:"24px"},"& > .check-search-outside":{marginTop:"7px","& input":{height:"24px"}}}}},"&.select-over-line":{"&.select-small":{"& > .select-content":{height:"inherit",minHeight:"28px","& > .radio-select-content":{}}},"&.select-medium":{"& > .select-content":{height:"inherit",minHeight:"34px","& > .radio-select-content":{}}},"&.select-large":{"& > .select-content":{height:"inherit",minHeight:"40px","& > .radio-select-content":{}}}}},"select-popover":{"& *":{boxSizing:"border-box"},"& > div":{maxWidth:"none",padding:"0",backgroundColor:y.textColor.white,boxShadow:y.boxShadow,borderRadius:y.borderRadius,"& > span":{color:y.textColor.white},"& .select-popover-content":{maxHeight:"300px",overflow:"auto","& > .select-popover-search":{height:"30px",borderBottom:"1px solid "+y.bgBorderColor.bg3,padding:"0 10px",display:"flex","& > div":{width:"100%","& input":{padding:"0",height:"28px",fontSize:"12px",color:y.textColor.primary,"&::placeholder":{fontSize:"12px",color:y.textColor.thirdary,opacity:1}},"& fieldset":{display:"none"}},"& > svg":{color:y.thmemColor.primary,fontSize:"16px",marginTop:"7px",cursor:"pointer"}},"& > .select-popover-list":{"& .select-popover-list-item":{display:"flex",padding:"7px 10px",cursor:"pointer",lineHeight:"16px","& > .select-popover-list-item-label":{width:"calc(100% - 25px)",color:y.textColor.secondary,fontSize:"12px"},"& > .select-popover-list-item-svg":{lineHeight:"0",display:"none","& > svg":{fontSize:"16px",color:y.thmemColor.primary}},"&.select-popover-list-item-select":{"& > .select-popover-list-item-label":{color:y.thmemColor.primary},"& > .select-popover-list-item-svg":{display:"inline-block"}},"&.select-popover-list-item-hover":{backgroundColor:y.bgBorderColor.bg2,"& > .select-popover-list-item-label":{color:y.thmemColor.primary}},"&.select-popover-list-item-keydown":{backgroundColor:y.bgBorderColor.bg2,"& > .select-popover-list-item-label":{color:y.thmemColor.primary}}},"& > .select-popover-list-group":{"& .select-popover-list-group-label":{display:"inline-block",width:"100%",padding:"7px 10px",color:y.textColor.thirdary,fontSize:"12px"},"& .select-popover-list-item":{padding:"7px 10px 7px 20px"}},"& > .select-nodata":{textAlign:"center",fontSize:"12px",color:y.textColor.primary,padding:"10px"}}}}},"select-more-popover":{"& *":{boxSizing:"border-box"},"& > div:nth-of-type(3),& > div:nth-of-type(2)":{marginLeft:"10px"},"& .select-more":{width:"200px",maxHeight:"300px",overflow:"auto","& > .select-more-title":{height:"30px",padding:"0 10px",color:y.textColor.secondary,borderBottom:"1px solid "+y.bgBorderColor.bg2,lineHeight:"30px",fontSize:"12px",display:"flex",justifyContent:"space-between"},"& > .select-more-content":{"& > .select-more-content-item":{padding:"7px 7px 7px 10px",display:"flex",justifyContent:"space-around","& > span":{width:"calc(100% - 25px)",display:"inline-block",fontSize:"12px"},"& > svg":{color:y.textColor.secondary,fontSize:"16px",position:"relative",top:"1px",cursor:"pointer","&:hover":{color:y.thmemColor.primary}}}}}}})})),w=function(r){var n=r.className,s=r.size,a=void 0===s?"small":s,d=r.labelMode,p=void 0===d?"outside":d,v=r.placeholder,f=void 0===v?"":v,y=r.label,w=void 0===y?"":y,C=r.disabled,S=void 0!==C&&C,j=r.multiple,k=void 0!==j&&j,F=r.required,N=void 0!==F&&F,O=r.showLabelSign,E=void 0===O||O,T=r.labelSign,z=r.error,D=void 0!==z&&z,q=r.helperText,L=void 0===q?"":q,B=r.list,H=r.showName,M=void 0===H?"label":H,P=r.showValue,_=void 0===P?"value":P,W=r.childrenName,R=void 0===W?"children":W,A=r.value,I=r.onChange,U=r.overLine,K=void 0!==U&&U,Y=r.search,Z=void 0!==Y&&Y,$=r.searchModel,V=void 0===$?"inside":$,G=r.selectPopoverClassName,J=r.morePopoverClassName,Q=r.onEnter,X=b(r),ee=(0,t.useRef)(null),te=(0,t.useState)("select-"+(0,m.UUID)())[0],oe=(0,t.useState)("select-popover-"+(0,m.UUID)())[0],re=(0,t.useState)(!1),ie=re[0],ne=re[1],le=(0,t.useState)(!1),se=le[0],ce=le[1],ae=(0,t.useState)([]),de=ae[0],pe=ae[1],ue=(0,t.useState)([]),he=ue[0],ve=ue[1],fe=(0,t.useState)({}),me=fe[0],xe=fe[1],ge=(0,t.useState)(null),ye=ge[0],be=ge[1],we=(0,t.useState)({})[0],Ce=(0,t.useState)(!1),Se=Ce[0],je=Ce[1],ke=(0,t.useState)(""),Fe=ke[0],Ne=ke[1],Oe=(0,t.useState)(!1),Ee=Oe[0],Te=Oe[1],ze=(0,t.useRef)(null);(0,t.useEffect)((function(){void 0!==A&&pe(k?(0,m.DeepClone)(A||[]):""===A?[]:[A])}),[A,k]),(0,t.useEffect)((function(){if(Z&&"outside"===V)return Te(!!k);Te(K)}),[K,Z,V,k]),(0,t.useEffect)((function(){for(var e={},t=0,o=B.length;t<o;t++){var r=B[t];if(r[R]&&r[R].length>0)for(var i=r[R],n=0,l=i.length;n<l;n++){var s=i[n];e[s[_]]=s}else e[r[_]]=r}xe(e)}),[B]),(0,t.useEffect)((function(){k&&(Ee||be(de.length))}),[Ee,k,de]),(0,t.useEffect)((function(){return Ee?be(de.length):(setTimeout((function(){Me(de.length)})),window.addEventListener("resize",Pe)),function(){window.removeEventListener("resize",Pe)}}),[de,Ee]),(0,t.useEffect)((function(){de&&de.length>0?ce(!0):(ce(!1),Z&&"outside"===V&&ce(""!==Fe))}),[Z,Fe,V,de]),(0,t.useEffect)((function(){clearTimeout(we.searchTimer),Z&&""!==Fe.trim()?we.searchTimer=setTimeout((function(){for(var e=[],t=(0,m.DeepClone)(B),o=0,r=t.length;o<r;o++){var i=t[o];if(i[R]&&i[R].length>0){for(var n=i[R],l=[],s=0,c=n.length;s<c;s++){var a=n[s];He(a)&&l.push(a)}l.length>0&&(i[R]=l,e.push(i))}else{He(i)&&e.push(i)}}ve(e)}),100):ve((0,m.DeepClone)(B))}),[Z,Fe,B]),(0,t.useEffect)((function(){return ie?setTimeout((function(){qe(),window.addEventListener("click",Be),window.addEventListener("keydown",Ve)})):(Ne(""),window.removeEventListener("click",Be),window.removeEventListener("keydown",Ve)),function(){window.removeEventListener("click",Be),window.removeEventListener("keydown",Ve)}}),[ie]),(0,t.useEffect)((function(){Fe&&ne(!0)}),[Fe]),(0,t.useEffect)((function(){k&&"outside"===V&&!S&&Ye(Fe)}),[Fe,k,S,V]);var De,qe=function(){var e=ze&&ze.current,t=e&&e.querySelector("input");t&&t.focus()},Le=function(e,t){for(var o=e.matches||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector;e&&!o.call(e,t);)e=e.parentElement;return e},Be=function(e){Le(e.target,"."+oe)||ne(!1)},He=function(e){var t=!1;return-1!==e[M].indexOf(Fe)&&(t=!0),t},Me=function(e){if(null!==e&&0!==e){void 0===e&&(e=de.length);var t=document.querySelector("."+te+" > .select-content > .check-select-content");if(t)if(t.scrollHeight>t.clientHeight){var o=Number(e)-1;be(o),Me(o)}else de.length<=e&&Ae()}},Pe=function(){clearTimeout(we.timer),we.timer=setTimeout((function(){be(de.length),Me()}),100)},_e=function(){S||ne(!0)},We=function(){ne(!1)},Re=function(e){je(!0),ne(!1),e.stopPropagation()},Ae=function(){je(!1)},Ie=function(e,t){return function(o){var r=e[_];if(k){var i=de.indexOf(r);-1!==i?de.splice(i,1):de.push(r),I&&I(g([],de,!0),o),t&&Q&&Q(g([],de,!0)),qe()}else I&&I(r,o),t&&Q&&Q(r),We(),Ne("")}},Ue=function(e,t){return function(o){var r;e||((r={})[_]=t,e=r),Ie(e)(o),o.stopPropagation()}},Ke=function(e){Ne(e.target.value)},Ye=function(e){var t=ze&&ze.current,o=t&&t.querySelector("input");if(!o)return null;var r=window.getComputedStyle(o),i=r.fontFamily,n=function(e,t,o){var r=document.createElement("span");r.id="referenceSpan";var i={};i.width=r.offsetWidth,i.height=r.offsetHeight,r.style.visibility="hidden",r.style.fontSize=e,r.style.fontFamily=t,r.style.display="inline-block";var n=document.getElementById("referenceSpan");return n&&document.body.removeChild(n),document.body.appendChild(r),void 0!==r.textContent?r.textContent=o:r.innerText=o,i.width=parseFloat(window.getComputedStyle(r).width)-i.width,i.height=parseFloat(window.getComputedStyle(r).height)-i.height,document.body.removeChild(r),i}(r.fontSize,i,e),l=n.width;l<10&&(l=10),t.style.width=l+"px"},Ze=function(e){var t=e.selectDom,o=e.keyCode,r=e.currentKeydownDom,i=null,n="nextSibling",l=".select-popover-list > div",s=".select-popover-list-item";if(38===o&&(n="previousSibling",l=".select-popover-list > div:last-child",s=".select-popover-list-item:last-child"),r)if(i=r[n])-1!==i.className.indexOf("select-popover-list-group-label")&&((i=(i=r.parentNode)[n])||(i=t.querySelector(l)));else{var c=r.parentNode;c&&c.className&&-1!==c.className.indexOf("select-popover-list-group")&&(i=(i=r.parentNode)[n])||(i=t.querySelector(l))}else i=t.querySelector(l);if(i)if(-1!==i.className.indexOf("select-popover-list-group")){var a=i.querySelector(s);a&&(a.classList.add("select-popover-list-item-keydown"),$e(a,t))}else i.classList.add("select-popover-list-item-keydown"),$e(i,t)},$e=function(e,t){clearTimeout(we.scrollTimer);var o=t.clientHeight,r=e.offsetTop+e.clientHeight-o;we.scroll=!0,t.scrollTop=r>0?r:0,we.scrollTimer=setTimeout((function(){we.scroll=!1}),100)},Ve=function(e){var t=document.querySelector("."+oe);if(t){var o=t.querySelector(".select-popover-list-item-select"),r=t.querySelector(".select-popover-list-item-hover"),i=t.querySelector(".select-popover-list-item-keydown"),n=o;if(r&&(n=r),13===e.keyCode){var l=i||r;if(l){var s=l.dataset.val;Ie(me[s],!0)({target:i})}else Q&&Q(A)}i&&(n=i,i.classList.remove("select-popover-list-item-keydown")),40===e.keyCode&&Ze({selectDom:t,keyCode:e.keyCode,currentKeydownDom:n}),38===e.keyCode&&Ze({selectDom:t,keyCode:e.keyCode,currentKeydownDom:n})}},Ge=function(e){if(!we.scroll){var t=Le(e.target,".select-popover-list-item");if(t){t.classList.add("select-popover-list-item-hover");var o=document.querySelector("."+oe).querySelector(".select-popover-list-item-keydown");o&&o.classList.remove("select-popover-list-item-keydown")}}},Je=function(e){var t=Le(e.target,".select-popover-list-item");t&&t.classList.remove("select-popover-list-item-hover")},Qe=(0,t.useMemo)((function(){return(0,e.jsx)(e.Fragment,{children:"outside"===p&&(0,e.jsxs)("label",x({className:"select-label"},{children:[w,E&&(0,e.jsx)("span",x({className:"identification-label"},{children:T||(0,e.jsx)(e.Fragment,{children:N?"(必填)":""},void 0)}),void 0)]}),void 0)},void 0)}),[p,w,E,T,N]),Xe=(0,t.useMemo)((function(){return(0,e.jsx)(e.Fragment,{children:!se&&(0,e.jsx)("span",x({className:"select-label-placeholder"},{children:"outside"===p?f:(0,e.jsxs)(e.Fragment,{children:[w||f,E&&(0,e.jsx)("span",x({className:"identification-label"},{children:T||(0,e.jsx)(e.Fragment,{children:N?"(必填)":""},void 0)}),void 0)]},void 0)}),void 0)},void 0)}),[se,p,f,w,E,T,N]),et=(0,t.useMemo)((function(){return(0,e.jsx)(e.Fragment,{children:!k&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",x({className:"radio-select-content"},{children:function(){if(""!==Fe)return null;var t=me[de[0]]&&me[de[0]][M]||de[0];return Ee?t:(0,e.jsx)(h.default,{children:t},void 0)}()}),void 0),Z&&"outside"===V&&!S&&(0,e.jsx)(o.TextField,{variant:"outlined",className:"radio-search-outside",value:Fe,onChange:Ke,ref:ze},void 0)]},void 0)},void 0)}),[k,se,Ee,me,de,M,Z,V,Fe,S]),tt=(0,t.useMemo)((function(){var t=function(e){return me[de[e]]&&me[de[e]][M]||de[e]};return(0,e.jsx)(e.Fragment,{children:k&&(0,e.jsxs)("div",x({className:"check-select-content"},{children:[de&&de.map((function(o,r){return null!==ye&&ye<=r?null:(0,e.jsxs)("div",x({className:"check-select-content-item"},{children:[(0,e.jsx)("span",{children:t(r)},void 0),!S&&(0,e.jsx)(u(),{onClick:Ue(me[de[r]],de[r])},void 0)]}),r)})),function(){if(null!==ye&&de.length>ye)return(0,e.jsx)("div",x({className:"check-select-content-item check-select-content-item-more",onClick:Re},{children:(0,e.jsxs)("span",{children:["+",de.length-ye]},void 0)}),void 0)}(),Z&&"outside"===V&&!S&&(0,e.jsx)(o.TextField,{variant:"outlined",className:"check-search-outside",value:Fe,onChange:Ke,ref:ze},void 0)]}),void 0)},void 0)}),[k,se,de,ye,me,S,I,Fe,Z,V]),ot=(0,t.useMemo)((function(){return(0,e.jsxs)("div",x({className:"select-content",onClick:_e,ref:ee},{children:[Xe,(0,e.jsx)("span",x({className:"select-svg"},{children:(0,e.jsx)(i(),{},void 0)}),void 0),et,tt]}),void 0)}),[ee,se,p,f,w,E,T,N,Ee,me,de,M,k,ye,S,I,Fe,V]),rt=(0,t.useMemo)((function(){return(0,e.jsx)("div",x({className:"select-popover-list"},{children:he&&he.length>0?(0,e.jsx)(e.Fragment,{children:he.map((function(t,o){if(t[R]&&t[R].length>0){var r=t[R];return(0,e.jsxs)("div",x({className:"select-popover-list-group"},{children:[(0,e.jsx)("span",x({className:"select-popover-list-group-label"},{children:t[M]}),void 0),r.map((function(t,o){var r=t[_],i="select-popover-list-item";return-1!==de.indexOf(r)&&(i+=" select-popover-list-item-select"),(0,e.jsxs)("div",x({onClick:Ie(t),className:i,onMouseEnter:Ge,onMouseLeave:Je,"data-val":r},{children:[(0,e.jsx)("span",x({className:"select-popover-list-item-label"},{children:(0,e.jsx)(h.default,{children:t[M]},void 0)}),void 0),(0,e.jsx)("span",x({className:"select-popover-list-item-svg"},{children:(0,e.jsx)(c(),{},void 0)}),void 0)]}),o)}))]}),o)}var i=t[_],n="select-popover-list-item";return-1!==de.indexOf(i)&&(n+=" select-popover-list-item-select"),(0,e.jsxs)("div",x({onClick:Ie(t),className:n,onMouseEnter:Ge,onMouseLeave:Je,"data-val":i},{children:[(0,e.jsx)("span",x({className:"select-popover-list-item-label"},{children:(0,e.jsx)(h.default,{children:t[M]},void 0)}),void 0),(0,e.jsx)("span",x({className:"select-popover-list-item-svg"},{children:(0,e.jsx)(c(),{},void 0)}),void 0)]}),o)}))},void 0):(0,e.jsx)("div",x({className:"select-nodata"},{children:"暂无选项"}),void 0)}),void 0)}),[he,M,_,de,I]),it=(0,t.useMemo)((function(){var t="select-popover-content "+oe;return(0,e.jsxs)("div",x({style:{width:(ee&&ee.current?ee.current.offsetWidth:0)+"px"},className:t},{children:[Z&&"inside"===V&&(0,e.jsxs)("div",x({className:"select-popover-search"},{children:[(0,e.jsx)(o.TextField,{variant:"outlined",placeholder:"请输入搜索名",value:Fe,onChange:Ke,ref:ze},void 0),(0,e.jsx)(l(),{},void 0)]}),void 0),rt]}),void 0)}),[ie,ee,he,R,_,M,de,Fe,Z,oe,V]),nt=(0,t.useMemo)((function(){var t,r=function(e){return me[de[e]]&&me[de[e]][M]||de[e]};return(0,e.jsx)(o.Popover,x({open:Se,anchorEl:ee&&ee.current,onClose:Ae,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},className:(t=X["select-more-popover"],J&&(t+=" "+J),t)},{children:(0,e.jsxs)("div",x({className:"select-more"},{children:[(0,e.jsxs)("div",x({className:"select-more-title"},{children:[(0,e.jsx)("span",{children:"已选中"},void 0),(0,e.jsx)("span",{children:de.length-Number(ye)},void 0)]}),void 0),(0,e.jsx)("div",x({className:"select-more-content"},{children:de&&de.map((function(t,o){return null!==ye&&ye>o?null:(0,e.jsxs)("div",x({className:"select-more-content-item"},{children:[(0,e.jsx)("span",{children:(0,e.jsx)(h.default,{children:r(o)},void 0)},void 0),!S&&(0,e.jsx)(u(),{onClick:Ue(me[de[o]],de[o])},void 0)]}),o)}))}),void 0)]}),void 0)}),void 0)}),[Se,de,ye,me,S,M,J]);return(0,e.jsxs)("div",x({className:(De=X.select,De+=" select",k&&!Ee&&(De+=" "+te),n&&(De+=" "+n),a&&(De+=" select-"+a),D&&(De+=" select-error"),S&&(De+=" select-disabled"),ie&&(De+=" select-open"),k&&(De+=" select-multiple"),Ee&&(De+=" select-over-line"),De)},{children:[Qe,(0,e.jsx)(o.Tooltip,x({open:ie,title:it,onClose:We,interactive:!0,disableFocusListener:!0,disableHoverListener:!0,disableTouchListener:!0,arrow:!0,classes:{popper:function(){var e=X["select-popover"];return G&&(e+=" "+G),e}()},placement:"bottom-start"},{children:ot}),void 0),L&&(0,e.jsx)("p",x({className:"select-error-text"},{children:L}),void 0),nt]}),void 0)};p.default=w}(),p}()}));
|
|
16
|
+
o(4126);var r=o(9297),i=60103;if(t.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var n=Symbol.for;i=n("react.element"),t.Fragment=n("react.fragment")}var l=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s=Object.prototype.hasOwnProperty,c={key:!0,ref:!0,__self:!0,__source:!0};function a(e,t,o){var r,n={},a=null,d=null;for(r in void 0!==o&&(a=""+o),void 0!==t.key&&(a=""+t.key),void 0!==t.ref&&(d=t.ref),t)s.call(t,r)&&!c.hasOwnProperty(r)&&(n[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===n[r]&&(n[r]=t[r]);return{$$typeof:i,type:e,key:a,ref:d,props:n,_owner:l.current}}t.jsx=a,t.jsxs=a},7712:function(e,t,o){e.exports=o(9524)},3094:function(e,t,o){var r=o(7712),i=o(9297),n=o(1731),l=o(8604),s=o(5415),c=function(){return c=Object.assign||function(e){for(var t,o=1,r=arguments.length;o<r;o++)for(var i in t=arguments[o])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},c.apply(this,arguments)},a=((0,s.Z)(),(0,l.makeStyles)((function(e){return(0,l.createStyles)({"auto-tips":{maxWidth:"100%",display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","& > .auto-tips-content":{display:"inline",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})})));t.default=function(e){var t=e.children,o=e.placement,l=void 0===o?"bottom-start":o,s=e.tips,d=void 0===s?"":s,p=e.className,u=void 0===p?"":p,h=(0,i.useRef)(),v=a(),f=(0,i.useState)(""),m=f[0],x=f[1];(0,i.useEffect)((function(){x(d)}),[d]);var g;return(0,r.jsx)("div",c({ref:function(e){e&&(h.current=e)},className:(g=v["auto-tips"],g+=" paraui-auto-tips",u&&(g+=" "+u),g),onMouseOver:function(){h.current.scrollWidth>h.current.offsetWidth?x(m||h.current.innerText):x("")}},{children:(0,r.jsx)(n.Tooltip,c({title:m,placement:l},{children:(0,r.jsx)("div",c({className:"auto-tips-content"},{children:t}),void 0)}),void 0)}),void 0)}},5415:function(e,t){var o={thmemColor:{primary:"#3D66F8",secondary:"#7E98F5",thirdary:"#D6DFFD"},textColor:{primary:"#191919",secondary:"#6E7488",thirdary:"#BBBECB",white:"#FFFFFF"},bgBorderColor:{bg1:"#DCDDE3",bg2:"#F5F5F5",bg3:"#EDEDED",bg4:"#6E7488",line1:"#E5E9EF",universal:"#FFFFFF"},stateColor:{info:"#3D66F8",success:"#41D658",warning:"#FFA150",error:"#F46B53"},gradientColor:{gradient1:"linear-gradient(#3D66F8, #4F93F0)",gradient2:"linear-gradient(#0093FF, #4EB4FF)",gradient3:"linear-gradient(#844EFF, #A796FF)",gradient4:"linear-gradient(#FD7300, #FFBF69)",gradient5:"linear-gradient(#3D66F8, #D8DFFA)"},fontFamily:{zh:"Microsoft Yahei, Helvetica, sans-serif",en:"Microsoft Yahei, Helvetica, sans-serif"},fontSize:12,borderRadius:4,boxShadow:"4px 4px 6px rgba(70,75,105,0.2), -4px -4px 6px rgba(0,0,0,0.06)",buttonShadow:"4px 4px 6px rgba(70,75,105,0.1), -4px -4px 6px rgba(0,0,0,0.03)",standardFont:{standardFont1:{fontSize:"12px",fontWeight:"400"},standardFont2:{fontSize:"12px",fontWeight:"700"}},titleFont:{titleFont1:{fontSize:"14px",fontWeight:"400"},titleFont2:{fontSize:"14px",fontWeight:"700"}},visualLargeFont:{visualLargeFont1:{fontSize:"40px",fontWeight:"700"},visualLargeFont2:{fontSize:"40px",fontWeight:"700"}}};t.Z=function(){return o}},1731:function(e){e.exports=t},8604:function(e){e.exports=l},6110:function(e){e.exports=i},19:function(e){e.exports=n},6028:function(e){e.exports=o},4115:function(e){e.exports=r},3475:function(e){e.exports=s},9297:function(t){t.exports=e}},a={};function d(e){var t=a[e];if(void 0!==t)return t.exports;var o=a[e]={exports:{}};return c[e](o,o.exports,d),o.exports}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 o in t)d.o(t,o)&&!d.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},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})};var p={};return function(){d.r(p),d.d(p,{Select:function(){return C}});var e=d(7712),t=d(9297),o=d(1731),r=d(6028),i=d.n(r),n=d(4115),l=d.n(n),s=d(6110),c=d.n(s),a=d(19),u=d.n(a),h=d(3094),v=d(8604),f=d(5415),m=d(3475),x=function(){return x=Object.assign||function(e){for(var t,o=1,r=arguments.length;o<r;o++)for(var i in t=arguments[o])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},x.apply(this,arguments)},g=function(e,t,o){if(o||2===arguments.length)for(var r,i=0,n=t.length;i<n;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},y=(0,f.Z)(),b=(0,v.makeStyles)((function(){return(0,v.createStyles)({select:{"& *":{boxSizing:"border-box"},fontFamily:y.fontFamily.zh,display:"inline-block",fontSize:y.standardFont.standardFont1.fontSize,width:"100%",paddingBottom:"20px","& > .select-label":{color:y.textColor.secondary,marginBottom:"9px",display:"inline-block"},"& > .select-content":{lineHeight:"0",border:"1px solid",borderColor:y.textColor.thirdary,borderRadius:y.borderRadius,paddingRight:"30px",position:"relative",cursor:"pointer","&:hover":{borderColor:y.thmemColor.primary,"& > .select-svg":{"& > svg":{color:y.thmemColor.primary}}},"& > .select-label-placeholder":{width:"100%",height:"100%",padding:"0 10px",boxSizing:"border-box",color:y.textColor.thirdary,display:"inline-block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",position:"absolute",left:"0",top:"0"},"& > .select-svg":{position:"absolute",right:"8px",top:"0","& > svg":{fontSize:"16px",transition:"all .3s",color:y.textColor.secondary}},"& > .radio-select-content":{paddingLeft:"10px",color:y.textColor.primary,fontSize:"12px",lineHeight:"16px"},"& > .radio-search-outside":{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",padding:"0 30px 0 10px",fontSize:"12px",cursor:"pointer","& > div":{height:"100%",cursor:"pointer","& > input":{height:"100%",padding:"0",color:y.textColor.primary,fontSize:"12px",cursor:"pointer"},"& fieldset":{display:"none"}}},"& > .check-select-content":{paddingLeft:"10px",height:"100%",overflow:"hidden","& > .check-select-content-item":{display:"inline-block",backgroundColor:y.bgBorderColor.bg2,borderRadius:y.borderRadius,padding:"0 10px",color:y.textColor.primary,fontSize:"12px",marginRight:"10px",verticalAlign:"top",maxWidth:"100%",whiteSpace:"nowrap","&.check-select-content-item-more":{color:y.thmemColor.primary,cursor:"pointer","& > span":{maxWidth:"none"}},"& > span":{display:"inline-block",hieght:"100%",verticalAlign:"top",maxWidth:"calc(100% - 20px)",overflow:"hidden",textOverflow:"ellipsis"},"& > svg":{cursor:"pointer",marginLeft:"8px",color:y.textColor.secondary,fontSize:"16px",position:"relative",top:"2px","&:hover":{color:y.thmemColor.primary}},"&.check-select-content-item-noclose":{"& > span":{maxWidth:"none"}}},"& > .check-search-outside":{width:"10px",maxWidth:"100% !important",display:"none","& > div":{width:"100%","& > input":{width:"100%",padding:"0",color:y.textColor.primary,fontSize:"12px",cursor:"pointer"},"& fieldset":{display:"none"}}}}},"& > .select-error-text":{margin:0,paddingLeft:"10px",height:"20px",lineHeight:"20px"},"&.select-disabled":{"& > .select-content":{backgroundColor:y.bgBorderColor.bg2,cursor:"not-allowed","&:hover":{borderColor:y.textColor.thirdary,"& > .select-svg":{"& > svg":{color:y.textColor.secondary}}},"& > .check-select-content":{"& > .check-select-content-item":{backgroundColor:y.bgBorderColor.bg3,"& > span":{maxWidth:"none"}}}}},"&.select-error":{"& > .select-content":{borderColor:y.stateColor.error+"!important"},"& > .select-error-text":{color:y.stateColor.error+"!important"}},"&.select-multiple":{},"&.select-open":{"& > .select-content":{borderColor:y.thmemColor.primary,"& > .select-svg":{"& > svg":{transform:"rotate(180deg)",color:y.thmemColor.primary}},"& > .check-select-content":{"& > .check-search-outside":{display:"inline-block"}}}},"&.select-small":{"& > .select-content":{height:"28px","& > .select-label-placeholder":{lineHeight:"26px"},"& > .select-svg":{top:"5px"},"& > .radio-select-content":{paddingTop:"5px",paddingBottom:"5px"},"& > .radio-search-outside":{"& > div":{paddingTop:"5px",paddingBottom:"5px"}},"& > .check-select-content":{paddingBottom:"3px","& > .check-select-content-item":{marginTop:"3px",height:"20px",lineHeight:"20px"},"& > .check-search-outside":{marginTop:"3px","& input":{height:"20px"}}}}},"&.select-medium":{"& > .select-content":{height:"34px","& > .select-label-placeholder":{lineHeight:"32px"},"& > .select-svg":{top:"8px"},"& > .radio-select-content":{paddingTop:"8px",paddingBottom:"8px"},"& > .radio-search-outside":{"& > div":{paddingTop:"8px",paddingBottom:"8px"}},"& > .check-select-content":{paddingBottom:"4px","& > .check-select-content-item":{marginTop:"4px",height:"24px",lineHeight:"24px"},"& > .check-search-outside":{marginTop:"4px","& input":{height:"24px"}}}}},"&.select-large":{"& > .select-content":{height:"40px","& > .select-label-placeholder":{lineHeight:"38px"},"& > .select-svg":{top:"11px"},"& > .radio-select-content":{paddingTop:"11px",paddingBottom:"11px"},"& > .radio-search-outside":{"& > div":{paddingTop:"11px",paddingBottom:"11px"}},"& > .check-select-content":{paddingBottom:"7px","& > .check-select-content-item":{marginTop:"7px",height:"24px",lineHeight:"24px"},"& > .check-search-outside":{marginTop:"7px","& input":{height:"24px"}}}}},"&.select-over-line":{"&.select-small":{"& > .select-content":{height:"inherit",minHeight:"28px","& > .radio-select-content":{}}},"&.select-medium":{"& > .select-content":{height:"inherit",minHeight:"34px","& > .radio-select-content":{}}},"&.select-large":{"& > .select-content":{height:"inherit",minHeight:"40px","& > .radio-select-content":{}}}}},"select-popover":{"& *":{boxSizing:"border-box"},"& > div":{maxWidth:"none",padding:"0",backgroundColor:y.textColor.white,boxShadow:y.boxShadow,borderRadius:y.borderRadius,"& > span":{color:y.textColor.white},"& .select-popover-content":{maxHeight:"300px",overflow:"auto","& > .select-popover-search":{height:"30px",borderBottom:"1px solid "+y.bgBorderColor.bg3,padding:"0 10px",display:"flex","& > div":{width:"100%","& input":{padding:"0",height:"28px",fontSize:"12px",color:y.textColor.primary,"&::placeholder":{fontSize:"12px",color:y.textColor.thirdary,opacity:1}},"& fieldset":{display:"none"}},"& > svg":{color:y.thmemColor.primary,fontSize:"16px",marginTop:"7px",cursor:"pointer"}},"& > .select-popover-list":{"& .select-popover-list-item":{display:"flex",padding:"7px 10px",cursor:"pointer",lineHeight:"16px","& > .select-popover-list-item-label":{width:"calc(100% - 25px)",color:y.textColor.secondary,fontSize:"12px"},"& > .select-popover-list-item-svg":{lineHeight:"0",display:"none","& > svg":{fontSize:"16px",color:y.thmemColor.primary}},"&.select-popover-list-item-select":{"& > .select-popover-list-item-label":{color:y.thmemColor.primary},"& > .select-popover-list-item-svg":{display:"inline-block"}},"&.select-popover-list-item-disabled":{backgroundColor:y.bgBorderColor.bg3+" !important",cursor:"not-allowed","&:hover":{backgroundColor:y.bgBorderColor.bg3+" !important"},"& > .select-popover-list-item-label":{color:y.textColor.secondary+" !important"},"& > .select-popover-list-item-svg":{"& > svg":{color:y.textColor.secondary+" !important"}}},"&.select-popover-list-item-hover":{backgroundColor:y.bgBorderColor.bg2,"& > .select-popover-list-item-label":{color:y.thmemColor.primary}},"&.select-popover-list-item-keydown":{backgroundColor:y.bgBorderColor.bg2,"& > .select-popover-list-item-label":{color:y.thmemColor.primary}}},"& > .select-popover-list-group":{"& .select-popover-list-group-label":{display:"inline-block",width:"100%",padding:"7px 10px",color:y.textColor.thirdary,fontSize:"12px"},"& .select-popover-list-item":{padding:"7px 10px 7px 20px"}},"& > .select-nodata":{textAlign:"center",fontSize:"12px",color:y.textColor.primary,padding:"10px"}}}}},"select-more-popover":{"& *":{boxSizing:"border-box"},"& > div:nth-of-type(3),& > div:nth-of-type(2)":{marginLeft:"10px"},"& .select-more":{width:"200px",maxHeight:"300px",overflow:"auto","& > .select-more-title":{height:"30px",padding:"0 10px",color:y.textColor.secondary,borderBottom:"1px solid "+y.bgBorderColor.bg2,lineHeight:"30px",fontSize:"12px",display:"flex",justifyContent:"space-between"},"& > .select-more-content":{"& > .select-more-content-item":{padding:"7px 7px 7px 10px",display:"flex",justifyContent:"space-between","& > span":{width:"calc(100% - 25px)",display:"inline-block",fontSize:"12px"},"& > svg":{color:y.textColor.secondary,fontSize:"16px",position:"relative",top:"1px",cursor:"pointer","&:hover":{color:y.thmemColor.primary}}}}}}})})),C=function(r){var n=r.className,s=r.size,a=void 0===s?"small":s,d=r.labelMode,p=void 0===d?"outside":d,v=r.placeholder,f=void 0===v?"":v,y=r.label,C=void 0===y?"":y,w=r.disabled,S=void 0!==w&&w,j=r.multiple,k=void 0!==j&&j,F=r.required,O=void 0!==F&&F,N=r.showLabelSign,E=void 0===N||N,T=r.labelSign,z=r.error,D=void 0!==z&&z,q=r.helperText,B=void 0===q?"":q,L=r.list,H=r.showName,M=void 0===H?"label":H,P=r.showValue,_=void 0===P?"value":P,W=r.childrenName,R=void 0===W?"children":W,A=r.value,I=r.onChange,U=r.overLine,K=void 0!==U&&U,Y=r.search,Z=void 0!==Y&&Y,$=r.searchModel,V=void 0===$?"inside":$,G=r.selectPopoverClassName,J=r.morePopoverClassName,Q=r.onEnter,X=b(r),ee=(0,t.useRef)(null),te=(0,t.useState)("select-"+(0,m.UUID)())[0],oe=(0,t.useState)("select-popover-"+(0,m.UUID)())[0],re=(0,t.useState)(!1),ie=re[0],ne=re[1],le=(0,t.useState)(!1),se=le[0],ce=le[1],ae=(0,t.useState)([]),de=ae[0],pe=ae[1],ue=(0,t.useState)([]),he=ue[0],ve=ue[1],fe=(0,t.useState)({}),me=fe[0],xe=fe[1],ge=(0,t.useState)(null),ye=ge[0],be=ge[1],Ce=(0,t.useState)({})[0],we=(0,t.useState)(!1),Se=we[0],je=we[1],ke=(0,t.useState)(""),Fe=ke[0],Oe=ke[1],Ne=(0,t.useState)(!1),Ee=Ne[0],Te=Ne[1],ze=(0,t.useRef)(null);(0,t.useEffect)((function(){void 0!==A&&pe(k?(0,m.DeepClone)(A||[]):""===A?[]:[A])}),[A,k]),(0,t.useEffect)((function(){if(Z&&"outside"===V)return Te(!!k);Te(K)}),[K,Z,V,k]),(0,t.useEffect)((function(){for(var e={},t=0,o=L.length;t<o;t++){var r=L[t];if(r[R]&&r[R].length>0)for(var i=r[R],n=0,l=i.length;n<l;n++){var s=i[n];e[s[_]]=s}else e[r[_]]=r}xe(e)}),[L]),(0,t.useEffect)((function(){k&&(Ee||be(de.length))}),[Ee,k,de]),(0,t.useEffect)((function(){return Ee?be(de.length):(setTimeout((function(){Me(de.length)})),window.addEventListener("resize",Pe)),function(){window.removeEventListener("resize",Pe)}}),[de,Ee]),(0,t.useEffect)((function(){de&&de.length>0?ce(!0):(ce(!1),Z&&"outside"===V&&ce(""!==Fe))}),[Z,Fe,V,de]),(0,t.useEffect)((function(){clearTimeout(Ce.searchTimer),Z&&""!==Fe.trim()?Ce.searchTimer=setTimeout((function(){for(var e=[],t=(0,m.DeepClone)(L),o=0,r=t.length;o<r;o++){var i=t[o];if(i[R]&&i[R].length>0){for(var n=i[R],l=[],s=0,c=n.length;s<c;s++){var a=n[s];He(a)&&l.push(a)}l.length>0&&(i[R]=l,e.push(i))}else{He(i)&&e.push(i)}}ve(e)}),100):ve((0,m.DeepClone)(L))}),[Z,Fe,L]),(0,t.useEffect)((function(){return ie?setTimeout((function(){qe(),window.addEventListener("click",Le),window.addEventListener("keydown",Ve)})):(Oe(""),window.removeEventListener("click",Le),window.removeEventListener("keydown",Ve)),function(){window.removeEventListener("click",Le),window.removeEventListener("keydown",Ve)}}),[ie]),(0,t.useEffect)((function(){Fe&&ne(!0)}),[Fe]),(0,t.useEffect)((function(){k&&"outside"===V&&!0!==S&&Ye(Fe)}),[Fe,k,S,V]);var De,qe=function(){var e=ze&&ze.current,t=e&&e.querySelector("input");t&&t.focus()},Be=function(e,t){for(var o=e.matches||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector;e&&!o.call(e,t);)e=e.parentElement;return e},Le=function(e){Be(e.target,"."+oe)||ne(!1)},He=function(e){var t=!1;return-1!==e[M].indexOf(Fe)&&(t=!0),t},Me=function(e){if(null!==e&&0!==e){void 0===e&&(e=de.length);var t=document.querySelector("."+te+" > .select-content > .check-select-content");if(t)if(t.scrollHeight>t.clientHeight){var o=Number(e)-1;be(o),Me(o)}else de.length<=e&&Ae()}},Pe=function(){clearTimeout(Ce.timer),Ce.timer=setTimeout((function(){be(de.length),Me()}),100)},_e=function(){!0!==S&&ne(!0)},We=function(){ne(!1)},Re=function(e){je(!0),ne(!1),e.stopPropagation()},Ae=function(){je(!1)},Ie=function(e,t){return function(o){var r=e[_];if("object"!=typeof S||-1===S.indexOf(r))if(k){var i=de.indexOf(r);-1!==i?de.splice(i,1):de.push(r),I&&I(g([],de,!0),o),t&&Q&&Q(g([],de,!0)),qe()}else I&&I(r,o),t&&Q&&Q(r),We(),Oe("")}},Ue=function(e,t){return function(o){var r;e||((r={})[_]=t,e=r),Ie(e)(o),o.stopPropagation()}},Ke=function(e){Oe(e.target.value)},Ye=function(e){var t=ze&&ze.current,o=t&&t.querySelector("input");if(!o)return null;var r=window.getComputedStyle(o),i=r.fontFamily,n=function(e,t,o){var r=document.createElement("span");r.id="referenceSpan";var i={};i.width=r.offsetWidth,i.height=r.offsetHeight,r.style.visibility="hidden",r.style.fontSize=e,r.style.fontFamily=t,r.style.display="inline-block";var n=document.getElementById("referenceSpan");return n&&document.body.removeChild(n),document.body.appendChild(r),void 0!==r.textContent?r.textContent=o:r.innerText=o,i.width=parseFloat(window.getComputedStyle(r).width)-i.width,i.height=parseFloat(window.getComputedStyle(r).height)-i.height,document.body.removeChild(r),i}(r.fontSize,i,e),l=n.width;l<10&&(l=10),t.style.width=l+"px"},Ze=function(e){var t=e.selectDom,o=e.keyCode,r=e.currentKeydownDom,i=null,n="nextSibling",l=".select-popover-list > div",s=".select-popover-list-item";if(38===o&&(n="previousSibling",l=".select-popover-list > div:last-child",s=".select-popover-list-item:last-child"),r)if(i=r[n])-1!==i.className.indexOf("select-popover-list-group-label")&&((i=(i=r.parentNode)[n])||(i=t.querySelector(l)));else{var c=r.parentNode;c&&c.className&&-1!==c.className.indexOf("select-popover-list-group")&&(i=(i=r.parentNode)[n])||(i=t.querySelector(l))}else i=t.querySelector(l);if(i)if(-1!==i.className.indexOf("select-popover-list-group")){var a=i.querySelector(s);a&&(a.classList.add("select-popover-list-item-keydown"),$e(a,t))}else i.classList.add("select-popover-list-item-keydown"),$e(i,t)},$e=function(e,t){clearTimeout(Ce.scrollTimer);var o=t.clientHeight,r=e.offsetTop+e.clientHeight-o;Ce.scroll=!0,t.scrollTop=r>0?r:0,Ce.scrollTimer=setTimeout((function(){Ce.scroll=!1}),100)},Ve=function(e){var t=document.querySelector("."+oe);if(t){var o=t.querySelector(".select-popover-list-item-select"),r=t.querySelector(".select-popover-list-item-hover"),i=t.querySelector(".select-popover-list-item-keydown"),n=o;if(r&&(n=r),13===e.keyCode){var l=i||r;if(l){var s=l.dataset.val;Ie(me[s],!0)({target:i})}else Q&&Q(A)}i&&(n=i,i.classList.remove("select-popover-list-item-keydown")),40===e.keyCode&&Ze({selectDom:t,keyCode:e.keyCode,currentKeydownDom:n}),38===e.keyCode&&Ze({selectDom:t,keyCode:e.keyCode,currentKeydownDom:n})}},Ge=function(e){if(!Ce.scroll){var t=Be(e.target,".select-popover-list-item");if(t){t.classList.add("select-popover-list-item-hover");var o=document.querySelector("."+oe).querySelector(".select-popover-list-item-keydown");o&&o.classList.remove("select-popover-list-item-keydown")}}},Je=function(e){var t=Be(e.target,".select-popover-list-item");t&&t.classList.remove("select-popover-list-item-hover")},Qe=(0,t.useMemo)((function(){return(0,e.jsx)(e.Fragment,{children:"outside"===p&&(0,e.jsxs)("label",x({className:"select-label"},{children:[C,E&&(0,e.jsx)("span",x({className:"identification-label"},{children:T||(0,e.jsx)(e.Fragment,{children:O?"(必填)":""},void 0)}),void 0)]}),void 0)},void 0)}),[p,C,E,T,O]),Xe=(0,t.useMemo)((function(){return(0,e.jsx)(e.Fragment,{children:!se&&(0,e.jsx)("span",x({className:"select-label-placeholder"},{children:"outside"===p?f:(0,e.jsxs)(e.Fragment,{children:[C||f,E&&(0,e.jsx)("span",x({className:"identification-label"},{children:T||(0,e.jsx)(e.Fragment,{children:O?"(必填)":""},void 0)}),void 0)]},void 0)}),void 0)},void 0)}),[se,p,f,C,E,T,O]),et=(0,t.useMemo)((function(){return(0,e.jsx)(e.Fragment,{children:!k&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",x({className:"radio-select-content"},{children:function(){if(""!==Fe)return null;var t=me[de[0]]&&me[de[0]][M]||de[0];return Ee?t:(0,e.jsx)(h.default,{children:t},void 0)}()}),void 0),Z&&"outside"===V&&!0!==S&&(0,e.jsx)(o.TextField,{variant:"outlined",className:"radio-search-outside",value:Fe,onChange:Ke,ref:ze},void 0)]},void 0)},void 0)}),[k,se,Ee,me,de,M,Z,V,Fe,S]),tt=(0,t.useMemo)((function(){var t=function(e){return me[de[e]]&&me[de[e]][M]||de[e]};return(0,e.jsx)(e.Fragment,{children:k&&(0,e.jsxs)("div",x({className:"check-select-content"},{children:[de&&de.map((function(o,r){if(null!==ye&&ye<=r)return null;var i=!0;return(!0===S||"object"==typeof S&&-1!==S.indexOf(de[r]))&&(i=!1),(0,e.jsxs)("div",x({className:i?"check-select-content-item":"check-select-content-item check-select-content-item-noclose"},{children:[(0,e.jsx)("span",{children:t(r)},void 0),i&&(0,e.jsx)(u(),{onClick:Ue(me[de[r]],de[r])},void 0)]}),r)})),function(){if(null!==ye&&de.length>ye)return(0,e.jsx)("div",x({className:"check-select-content-item check-select-content-item-more",onClick:Re},{children:(0,e.jsxs)("span",{children:["+",de.length-ye]},void 0)}),void 0)}(),Z&&"outside"===V&&!0!==S&&(0,e.jsx)(o.TextField,{variant:"outlined",className:"check-search-outside",value:Fe,onChange:Ke,ref:ze},void 0)]}),void 0)},void 0)}),[k,se,de,ye,me,S,I,Fe,Z,V]),ot=(0,t.useMemo)((function(){return(0,e.jsxs)("div",x({className:"select-content",onClick:_e,ref:ee},{children:[Xe,(0,e.jsx)("span",x({className:"select-svg"},{children:(0,e.jsx)(i(),{},void 0)}),void 0),et,tt]}),void 0)}),[ee,se,p,f,C,E,T,O,Ee,me,de,M,k,ye,S,I,Fe,V]),rt=(0,t.useMemo)((function(){return(0,e.jsx)("div",x({className:"select-popover-list"},{children:he&&he.length>0?(0,e.jsx)(e.Fragment,{children:he.map((function(t,o){if(t[R]&&t[R].length>0){var r=t[R];return(0,e.jsxs)("div",x({className:"select-popover-list-group"},{children:[(0,e.jsx)("span",x({className:"select-popover-list-group-label"},{children:t[M]}),void 0),r.map((function(t,o){var r=t[_],i="select-popover-list-item";return-1!==de.indexOf(r)&&(i+=" select-popover-list-item-select"),"object"==typeof S&&-1!==S.indexOf(r)&&(i+=" select-popover-list-item-disabled"),(0,e.jsxs)("div",x({onClick:Ie(t),className:i,onMouseEnter:Ge,onMouseLeave:Je,"data-val":r},{children:[(0,e.jsx)("span",x({className:"select-popover-list-item-label"},{children:(0,e.jsx)(h.default,{children:t[M]},void 0)}),void 0),(0,e.jsx)("span",x({className:"select-popover-list-item-svg"},{children:(0,e.jsx)(c(),{},void 0)}),void 0)]}),o)}))]}),o)}var i=t[_],n="select-popover-list-item";return-1!==de.indexOf(i)&&(n+=" select-popover-list-item-select"),"object"==typeof S&&-1!==S.indexOf(i)&&(n+=" select-popover-list-item-disabled"),(0,e.jsxs)("div",x({onClick:Ie(t),className:n,onMouseEnter:Ge,onMouseLeave:Je,"data-val":i},{children:[(0,e.jsx)("span",x({className:"select-popover-list-item-label"},{children:(0,e.jsx)(h.default,{children:t[M]},void 0)}),void 0),(0,e.jsx)("span",x({className:"select-popover-list-item-svg"},{children:(0,e.jsx)(c(),{},void 0)}),void 0)]}),o)}))},void 0):(0,e.jsx)("div",x({className:"select-nodata"},{children:"暂无选项"}),void 0)}),void 0)}),[he,M,_,de,I]),it=(0,t.useMemo)((function(){var t="select-popover-content "+oe;return(0,e.jsxs)("div",x({style:{width:(ee&&ee.current?ee.current.offsetWidth:0)+"px"},className:t},{children:[Z&&"inside"===V&&(0,e.jsxs)("div",x({className:"select-popover-search"},{children:[(0,e.jsx)(o.TextField,{variant:"outlined",placeholder:"请输入搜索名",value:Fe,onChange:Ke,ref:ze},void 0),(0,e.jsx)(l(),{},void 0)]}),void 0),rt]}),void 0)}),[ie,ee,he,R,_,M,de,Fe,Z,oe,V]),nt=(0,t.useMemo)((function(){var t,r=function(e){return me[de[e]]&&me[de[e]][M]||de[e]};return(0,e.jsx)(o.Popover,x({open:Se,anchorEl:ee&&ee.current,onClose:Ae,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},className:(t=X["select-more-popover"],J&&(t+=" "+J),t)},{children:(0,e.jsxs)("div",x({className:"select-more"},{children:[(0,e.jsxs)("div",x({className:"select-more-title"},{children:[(0,e.jsx)("span",{children:"已选中"},void 0),(0,e.jsx)("span",{children:de.length-Number(ye)},void 0)]}),void 0),(0,e.jsx)("div",x({className:"select-more-content"},{children:de&&de.map((function(t,o){if(null!==ye&&ye>o)return null;var i=!0;return(!0===S||"object"==typeof S&&-1!==S.indexOf(de[o]))&&(i=!1),(0,e.jsxs)("div",x({className:"select-more-content-item"},{children:[(0,e.jsx)("span",{children:(0,e.jsx)(h.default,{children:r(o)},void 0)},void 0),i&&(0,e.jsx)(u(),{onClick:Ue(me[de[o]],de[o])},void 0)]}),o)}))}),void 0)]}),void 0)}),void 0)}),[Se,de,ye,me,S,M,J]);return(0,e.jsxs)("div",x({className:(De=X.select,De+=" select",k&&!Ee&&(De+=" "+te),n&&(De+=" "+n),a&&(De+=" select-"+a),D&&(De+=" select-error"),!0===S&&(De+=" select-disabled"),ie&&(De+=" select-open"),k&&(De+=" select-multiple"),Ee&&(De+=" select-over-line"),De)},{children:[Qe,(0,e.jsx)(o.Tooltip,x({open:ie,title:it,onClose:We,interactive:!0,disableFocusListener:!0,disableHoverListener:!0,disableTouchListener:!0,arrow:!0,classes:{popper:function(){var e=X["select-popover"];return G&&(e+=" "+G),e}()},placement:"bottom-start"},{children:ot}),void 0),B&&(0,e.jsx)("p",x({className:"select-error-text"},{children:B}),void 0),nt]}),void 0)};p.default=C}(),p}()}));
|
package/SingleBox/index.js
CHANGED
|
@@ -13,4 +13,4 @@ var t=Object.getOwnPropertySymbols,o=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
|
-
o(4126);var i=o(9297),r=60103;if(t.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var n=Symbol.for;r=n("react.element"),t.Fragment=n("react.fragment")}var l=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a=Object.prototype.hasOwnProperty,d={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,o){var i,n={},s=null,c=null;for(i in void 0!==o&&(s=""+o),void 0!==t.key&&(s=""+t.key),void 0!==t.ref&&(c=t.ref),t)a.call(t,i)&&!d.hasOwnProperty(i)&&(n[i]=t[i]);if(e&&e.defaultProps)for(i in t=e.defaultProps)void 0===n[i]&&(n[i]=t[i]);return{$$typeof:r,type:e,key:s,ref:c,props:n,_owner:l.current}}t.jsx=s,t.jsxs=s},7712:function(e,t,o){e.exports=o(9524)},115:function(e,t,o){var i=o(7712),r=o(9297),n=o(1731),l=o(8604),a=o(853),d=function(){return d=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},d.apply(this,arguments)},s=((0,a.Z)(),(0,l.makeStyles)((function(e){return(0,l.createStyles)({"auto-tips":{maxWidth:"100%",display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","& > .auto-tips-content":{display:"inline",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})})));t.default=function(e){var t=e.children,o=e.placement,l=void 0===o?"bottom-start":o,a=e.tips,c=void 0===a?"":a,u=e.className,p=void 0===u?"":u,f=(0,r.useRef)(),x=s(),g=(0,r.useState)(""),h=g[0],v=g[1];(0,r.useEffect)((function(){v(c)}),[c]);var b;return(0,i.jsx)("div",d({ref:function(e){e&&(f.current=e)},className:(b=x["auto-tips"],b+=" paraui-auto-tips",p&&(b+=" "+p),b),onMouseOver:function(){f.current.scrollWidth>f.current.offsetWidth?v(h||f.current.innerText):v("")}},{children:(0,i.jsx)(n.Tooltip,d({title:h,placement:l},{children:(0,i.jsx)("div",d({className:"auto-tips-content"},{children:t}),void 0)}),void 0)}),void 0)}},853:function(e,t){var o={thmemColor:{primary:"#3D66F8",secondary:"#7E98F5",thirdary:"#D6DFFD"},textColor:{primary:"#191919",secondary:"#6E7488",thirdary:"#BBBECB",white:"#FFFFFF"},bgBorderColor:{bg1:"#DCDDE3",bg2:"#F5F5F5",bg3:"#EDEDED",bg4:"#6E7488",line1:"#E5E9EF",universal:"#FFFFFF"},stateColor:{info:"#3D66F8",success:"#41D658",warning:"#FFA150",error:"#F46B53"},gradientColor:{gradient1:"linear-gradient(#3D66F8, #4F93F0)",gradient2:"linear-gradient(#0093FF, #4EB4FF)",gradient3:"linear-gradient(#844EFF, #A796FF)",gradient4:"linear-gradient(#FD7300, #FFBF69)",gradient5:"linear-gradient(#3D66F8, #D8DFFA)"},fontFamily:{zh:"Microsoft Yahei, Helvetica, sans-serif",en:"Microsoft Yahei, Helvetica, sans-serif"},fontSize:12,borderRadius:4,boxShadow:"4px 4px 6px rgba(70,75,105,0.2), -4px -4px 6px rgba(0,0,0,0.06)",buttonShadow:"4px 4px 6px rgba(70,75,105,0.1), -4px -4px 6px rgba(0,0,0,0.03)",standardFont:{standardFont1:{fontSize:"12px",fontWeight:"400"},standardFont2:{fontSize:"12px",fontWeight:"700"}},titleFont:{titleFont1:{fontSize:"14px",fontWeight:"400"},titleFont2:{fontSize:"14px",fontWeight:"700"}},visualLargeFont:{visualLargeFont1:{fontSize:"40px",fontWeight:"700"},visualLargeFont2:{fontSize:"40px",fontWeight:"700"}}};t.Z=function(){return o}},4661:function(e,t,o){var i=o(7712),r=o(9297),n=o(1731),l=o(115),a=o(8528),d=o.n(a),s=o(6570),c=o.n(s),u=o(1102),p=o.n(u),f=o(8604),x=o(853),g=o(3475),h=function(){return h=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},h.apply(this,arguments)},v=function(e,t){var o={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(o[i[r]]=e[i[r]])}return o},b=(0,x.Z)(),m=(0,f.makeStyles)((function(){return(0,f.createStyles)({"@keyframes rotate":{"0%":{transformOrigin:"50% 50%"},"100%":{transform:"rotate(360deg)"}},"text-field":{fontFamily:b.fontFamily.zh,display:"inline-block",fontSize:b.standardFont.standardFont1.fontSize,width:"100%",paddingBottom:"20px","& fieldset":{border:0},"& .text-field-error-text":{margin:0,paddingLeft:"10px",height:"20px",lineHeight:"20px"},"& .text-field-label":{color:b.textColor.secondary,marginBottom:"9px",display:"inline-block"},"& .text-field-content":{border:"1px solid",borderColor:b.textColor.thirdary,borderRadius:b.borderRadius,position:"relative",display:"table",width:"100%",boxSizing:"border-box","&:hover":{borderColor:b.thmemColor.primary},"& > div":{display:"table-cell",height:"100%",verticalAlign:"top"},"& .text-field-content-before":{color:b.textColor.primary,padding:"0 10px",borderRight:"1px solid "+b.textColor.thirdary,backgroundColor:b.bgBorderColor.bg2,borderBottomLeftRadius:b.borderRadius,borderTopLeftRadius:b.borderRadius,whiteSpace:"nowrap","& svg":{fontSize:"20px",verticalAlign:"top",position:"relative"}},"& .text-field-content-within":{position:"relative",width:"100%","& > *":{display:"table-cell",verticalAlign:"top"},"& svg":{fontSize:"20px",color:b.textColor.secondary,cursor:"pointer"},"& .right-icon":{zIndex:"1",position:"relative",whiteSpace:"nowrap","& > svg":{marginRight:"10px"}},"& .length-limit":{zIndex:"1",position:"relative",paddingRight:"10px",color:b.textColor.secondary},"& .text-field-content-within-input":{width:"100vw","& > div":{width:"100%"},"& input":{height:"100%"},"& input,textarea":{fontSize:b.standardFont.standardFont1.fontSize,color:b.textColor.primary,"&:-ms-clear":{display:"none"},"&:-ms-reveal":{display:"none"}},"& .text-field-label-placeholder":{width:"100%",position:"absolute",left:"0",height:"100%",padding:"0 10px",boxSizing:"border-box",color:b.textColor.thirdary,cursor:"text",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}},"& .text-field-content-after":{color:b.textColor.primary,padding:"0 10px",borderLeft:"1px solid",borderColor:b.textColor.thirdary,backgroundColor:b.bgBorderColor.bg2,borderBottomRightRadius:b.borderRadius,borderTopRightRadius:b.borderRadius,whiteSpace:"nowrap","& svg":{fontSize:"20px",verticalAlign:"top",position:"relative"}}},"& .identification-label":{marginLeft:"3px"},"&.text-field-multiline":{"& .text-field-content":{"& .text-field-content-within":{"& > *":{display:"inline-block"},"& .length-limit":{width:"100%",boxSizing:"border-box",textAlign:"right",paddingBottom:"5px"},"& .text-field-content-within-input":{width:"100%","& > div:first-child":{width:"100%","& > div:first-child":{padding:"10px"}},"& .text-field-label-placeholder":{paddingTop:"10px"}}}}},"&.text-field-disabled":{"& .text-field-content":{backgroundColor:b.bgBorderColor.bg3,"&:hover":{borderColor:b.textColor.thirdary},"& .text-field-content-within":{"& .text-field-content-within-input":{"& .text-field-label-placeholder":{cursor:"not-allowed"},"& input":{cursor:"not-allowed",color:b.textColor.thirdary}}}}},"&.text-field-error":{"& .text-field-error-text":{color:b.stateColor.error},"& .text-field-content":{borderColor:b.stateColor.error,"&:hover":{borderColor:b.stateColor.error},"& .text-field-content-before":{borderColor:b.stateColor.error},"& .text-field-content-after":{borderColor:b.stateColor.error}}},"&.text-field-focus":{"& .text-field-content":{borderColor:b.thmemColor.primary,"& .text-field-content-before":{borderColor:b.thmemColor.primary},"& .text-field-content-after":{borderColor:b.thmemColor.primary}}},"&.text-field-small":{"& .text-field-content":{height:"28px","& .text-field-content-before":{lineHeight:"26px","& svg":{top:"3px"}},"& .text-field-content-within":{"& .text-field-content-within-input":{"& > div":{height:"26px","& > div":{height:"100%"}}},"& input":{padding:"5px 10px"},"& .text-field-label-placeholder":{lineHeight:"26px"},"& .right-icon":{paddingTop:"3px"},"& .length-limit":{lineHeight:"26px"}},"& .text-field-content-after":{lineHeight:"26px","& svg":{top:"3px"}}}},"&.text-field-medium":{"& .text-field-content":{height:"34px","& .text-field-content-before":{lineHeight:"32px","& svg":{top:"6px"}},"& .text-field-content-within":{"& .text-field-content-within-input":{"& > div":{height:"32px","& > div":{height:"100%"}}},"& input":{padding:"8px 10px"},"& .text-field-label-placeholder":{lineHeight:"32px"},"& .right-icon":{paddingTop:"7px"},"& .length-limit":{lineHeight:"32px","& svg":{top:"6px"}}},"& .text-field-content-after":{lineHeight:"32px","& svg":{top:"6px"}}}},"&.text-field-large":{"& .text-field-content":{height:"40px","& .text-field-content-before":{lineHeight:"38px","& svg":{top:"9px"}},"& .text-field-content-within":{"& .text-field-content-within-input":{"& > div":{height:"38px","& > div":{height:"100%"}}},"& input":{padding:"11px 10px"},"& .text-field-label-placeholder":{lineHeight:"38px"},"& .right-icon":{paddingTop:"10px"},"& .length-limit":{lineHeight:"38px"}},"& .text-field-content-after":{lineHeight:"38px","& svg":{top:"9px"}}}}},"text-field-select":{"& > div":{maxWidth:"none",padding:"0",backgroundColor:b.textColor.white,boxShadow:b.boxShadow,borderRadius:b.borderRadius,"& > span":{color:b.textColor.white},"& .text-field-select-content":{maxHeight:"300px",overflow:"auto","& > .text-field-select-content-item":{display:"flex",padding:"7px 10px",cursor:"pointer",lineHeight:"16px",color:b.textColor.secondary,"&:hover":{backgroundColor:b.bgBorderColor.bg2,color:b.thmemColor.primary},"&.text-field-select-content-item-keydown":{backgroundColor:b.bgBorderColor.bg2,color:b.thmemColor.primary}},"&.text-field-select-content-loading":{height:"100px",position:"relative",overflow:"hidden","& > .loading-box":{position:"absolute",left:"0",top:"0",width:"100%",height:"100%",backgroundColor:"white",display:"flex",justifyContent:"center",alignItems:"center","& > svg":{transition:"all .3s ease-in-out",animation:"$rotate 1s infinite linear",fontSzie:"20px"}}}}}}})}));t.default=function(e){var t=e.className,o=e.size,a=void 0===o?"small":o,s=e.labelMode,u=void 0===s?"outside":s,f=e.placeholder,x=void 0===f?"":f,b=e.label,y=void 0===b?"":b,w=e.disabled,C=void 0!==w&&w,S=e.multiline,j=void 0!==S&&S,F=e.required,O=void 0!==F&&F,k=e.showLabelSign,N=void 0===k||k,E=e.labelSign,P=e.rows,B=void 0===P?2:P,D=e.error,R=void 0!==D&&D,q=e.helperText,L=void 0===q?"":q,z=e.addonBefore,H=void 0===z?"":z,T=e.addonAfter,I=void 0===T?"":T,_=e.value,A=e.controlled,M=void 0!==A&&A,W=e.autoFocus,U=void 0!==W&&W,K=e.type,Z=void 0===K?"text":K,Y=e.onClickIcon,$=e.rightIcon,J=e.showRightIcon,G=void 0===J||J,Q=e.limitLength,V=e.fetchSuggestions,X=e.selectPopoverClass,ee=e.renderSelectItem,te=e.showSelectName,oe=void 0===te?"value":te,ie=e.onBlur,re=e.onFocus,ne=e.onChange,le=e.onKeydown,ae=e.onKeyUp,de=e.onEnter,se=e.onClickAddonBefore,ce=e.onClickAddonAfter,ue=e.onSelect,pe=v(e,["className","size","labelMode","placeholder","label","disabled","multiline","required","showLabelSign","labelSign","rows","error","helperText","addonBefore","addonAfter","value","controlled","autoFocus","type","onClickIcon","rightIcon","showRightIcon","limitLength","fetchSuggestions","selectPopoverClass","renderSelectItem","showSelectName","onBlur","onFocus","onChange","onKeydown","onKeyUp","onEnter","onClickAddonBefore","onClickAddonAfter","onSelect"]),fe=m(e),xe=(0,r.useState)("text-field-select-content-"+(0,g.UUID)())[0],ge=(0,r.useState)(!0),he=ge[0],ve=ge[1],be=(0,r.useState)(),me=be[0],ye=be[1],we=(0,r.useState)(!1),Ce=we[0],Se=we[1],je=(0,r.useState)(0),Fe=je[0],Oe=je[1],ke=(0,r.useState)("text"),Ne=ke[0],Ee=ke[1],Pe=(0,r.useState)(!1),Be=Pe[0],De=Pe[1],Re=(0,r.useState)(!1),qe=Re[0],Le=Re[1],ze=(0,r.useState)([]),He=ze[0],Te=ze[1],Ie=((0,r.useState)({})[0],(0,r.useRef)(null)),_e=(0,r.useRef)(null),Ae=(0,r.useRef)(null);(0,r.useEffect)((function(){Ie&&Ie.current&&Oe(Ie.current.offsetWidth)}),[]),(0,r.useEffect)((function(){Z!==Ne&&Ee(Z)}),[Z]),(0,r.useEffect)((function(){ye(_)}),[_]),(0,r.useEffect)((function(){ve(""===me||void 0===me)}),[me]),(0,r.useEffect)((function(){V&&De(Ce)}),[Ce,V]),(0,r.useEffect)((function(){return Be?window.addEventListener("keydown",Ze):window.removeEventListener("keydown",Ze),function(){window.removeEventListener("keydown",Ze)}}),[Be]);var Me,We=function(){C||(ve(!1),(_e&&_e.current&&_e.current.querySelector(j?"textarea":"input")).focus())},Ue=function(e){var t=e.selectDom,o=e.keyCode,i=e.currentDom,r="nextSibling",n=".text-field-select-content-item";38===o&&(r="previousSibling",n=".text-field-select-content-item:last-child"),i?(i=i[r])||(i=t.querySelector(n)):i=t.querySelector(".text-field-select-content-item"),i&&(i.classList.add("text-field-select-content-item-keydown"),Ke(i,t))},Ke=function(e,t){var o=t.clientHeight,i=e.offsetTop+e.clientHeight-o;t.scrollTop=i>0?i:0},Ze=function(e){var t=document.querySelector("."+xe),o=null,i=t.querySelector(".text-field-select-content-item-keydown");if(13===e.keyCode&&i){var r=i.dataset.val;tt(JSON.parse(r))(e),(_e&&_e.current&&_e.current.querySelector(j?"textarea":"input")).blur()}i&&(o=i,i.classList.remove("text-field-select-content-item-keydown")),40===e.keyCode&&Ue({selectDom:t,keyCode:e.keyCode,currentDom:o}),38===e.keyCode&&Ue({selectDom:t,keyCode:e.keyCode,currentDom:o})},Ye=function(e){Se(!1),""===e.target.value&&ve(!0),ie&&ie(e)},$e=function(e){Le(!0),V&&V(e,(function(e){Te(e||[]),Le(!1)}))},Je=function(e){Se(!0),re&&re(e),$e(e.target.value)},Ge=function(e){var t=e.target.value;Q&&void 0!==t&&""!==t&&t.toString().length>Q||(M||ye(t),ne&&ne(e),$e(e.target.value))},Qe=function(e){13===e.keyCode&&de&&de(e),le&&le(e)},Ve=function(e){ae&&ae(e)},Xe=function(e){"password"===Z&&("text"===Ne&&Ee("password"),"password"===Ne&&Ee("text")),Y&&Y(e)},et=function(){De(!1)},tt=function(e){return function(t){ue&&ue(e)}},ot=(0,r.useMemo)((function(){return(0,i.jsx)(i.Fragment,{children:void 0!==Q&&(0,i.jsx)("span",h({className:"length-limit"},{children:(me?me.toString().length:0)+"/"+Q}),void 0)},void 0)}),[Q,me]),it=(0,r.useMemo)((function(){return(0,i.jsx)(i.Fragment,{children:G&&(0,i.jsx)("span",h({className:"right-icon",onClick:Xe},{children:$||("password"===Z?"password"===Ne?(0,i.jsx)(c(),{},void 0):(0,i.jsx)(d(),{},void 0):null)}),void 0)},void 0)}),[G,$,Z,Ne]),rt=(0,r.useMemo)((function(){return(0,i.jsxs)("div",h({className:"text-field-content-within",ref:Ae},{children:[(0,i.jsxs)("div",h({className:"text-field-content-within-input"},{children:[(0,i.jsx)(n.TextField,h({size:"small",variant:"outlined",autoFocus:U,ref:_e,type:Ne,value:me||"",disabled:C,multiline:j,rows:B,onBlur:Ye,onFocus:Je,onChange:Ge,onKeyDown:Qe,onKeyUp:Ve},pe),void 0),he&&(0,i.jsx)("span",h({className:"text-field-label-placeholder",onClick:We},{children:"outside"===u?x:(0,i.jsxs)(i.Fragment,{children:[y||x,N&&(0,i.jsx)("span",h({className:"identification-label"},{children:E||(0,i.jsx)(i.Fragment,{children:O?"(必填)":""},void 0)}),void 0)]},void 0)}),void 0)]}),void 0),ot,it]}),void 0)}),[he,U,Ne,me,ot,it,u,x,y,C,j,B,pe,ne,V]),nt=(0,r.useMemo)((function(){var e;return(0,i.jsxs)("div",h({className:(e="text-field-select-content",qe&&(e+=" text-field-select-content-loading"),xe&&(e+=" "+xe),e),style:{width:(Ae&&Ae.current?Ae.current.offsetWidth:0)+"px"}},{children:[He&&He.map((function(e,t){return(0,i.jsx)("div",h({className:"text-field-select-content-item",onMouseDown:tt(e),"data-val":JSON.stringify(e)},{children:ee?ee(e):(0,i.jsx)(l.default,{children:e[oe]},void 0)}),t)})),qe&&(0,i.jsx)("div",h({className:"loading-box"},{children:(0,i.jsx)(p(),{},void 0)}),void 0)]}),void 0)}),[Ae,Be,He,ee,oe,ue,qe,xe]),lt=(0,r.useMemo)((function(){return(0,i.jsx)(n.Tooltip,h({open:Be,title:nt,onClose:et,interactive:!0,disableFocusListener:!0,disableHoverListener:!0,disableTouchListener:!0,arrow:!0,classes:{popper:(e=fe["text-field-select"],X&&(e+=" "+X),e)}},{children:rt}),void 0);var e}),[he,U,Ne,me,ot,it,u,x,y,C,j,B,pe,ne,V,ue,Ae,Be,X]),at=(0,r.useMemo)((function(){var e=Boolean(N&&(E||O));if("outside"===u&&(y||e))return(0,i.jsxs)("label",h({className:"text-field-label"},{children:[y,N&&(0,i.jsx)("span",h({className:"identification-label"},{children:E||(0,i.jsx)(i.Fragment,{children:O?"(必填)":""},void 0)}),void 0)]}),void 0)}),[u,y,N,E,O]);return(0,i.jsxs)("div",h({className:(Me=fe["text-field"],Me+=" text-field",a&&!j&&(Me+=" text-field-"+a),t&&(Me+=" "+t),R&&(Me+=" text-field-error"),Ce&&(Me+=" text-field-focus"),C&&(Me+=" text-field-disabled"),j&&(Me+=" text-field-multiline"),Me)},{children:[at,(0,i.jsxs)("div",h({className:"text-field-content"},{children:[H&&(0,i.jsx)("div",h({className:"text-field-content-before",ref:Ie,onClick:function(e){se&&se(e)}},{children:H}),void 0),V?lt:rt,I&&(0,i.jsx)("div",h({className:"text-field-content-after",onClick:function(e){ce&&ce(e)}},{children:I}),void 0)]}),void 0),L&&(0,i.jsx)("p",h({className:"text-field-error-text",style:{marginLeft:Fe+"px"}},{children:L}),void 0)]}),void 0)}},1731:function(e){e.exports=o},8604:function(e){e.exports=t},6243:function(e){e.exports=d},1102:function(e){e.exports=n},5191:function(e){e.exports=a},6570:function(e){e.exports=r},8528:function(e){e.exports=i},3475:function(e){e.exports=l},9297:function(t){t.exports=e}},c={};function u(e){var t=c[e];if(void 0!==t)return t.exports;var o=c[e]={exports:{}};return s[e](o,o.exports,u),o.exports}u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,{a:t}),t},u.d=function(e,t){for(var o in t)u.o(t,o)&&!u.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var p={};return function(){u.r(p),u.d(p,{SingleBox:function(){return g}});var e=u(7712),t=u(9297),o=u(8604),i=u(4661),r=u(5191),n=u.n(r),l=u(6243),a=u.n(l),d=u(853),s=function(){return s=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},s.apply(this,arguments)},c=function(e,t,o){if(o||2===arguments.length)for(var i,r=0,n=t.length;r<n;r++)!i&&r in t||(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))},f=(0,d.Z)(),x=(0,o.makeStyles)((function(){return(0,o.createStyles)({"single-box":{"&.single-box":{display:"inline-block",width:"100%","& > .single-box-label":{color:f.textColor.secondary,marginBottom:"9px",display:"inline-block"},"& > .single-box-content":{lineHeight:"0","& > .single-box-content-item":{paddingBottom:"15px",display:"flex","& > .text-field":{paddingBottom:"0",width:"calc(100% - 30px)"},"& > .single-box-content-item-svg":{display:"flex",alignItems:"center",justifyContent:"center",width:"30px",cursor:"pointer"}}},"& > .single-box-add":{textAlign:"center",border:"1px dashed "+f.textColor.thirdary,color:f.textColor.secondary,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:f.borderRadius,"& > svg":{fontSize:"24px"},"&:hover":{border:"1px dashed "+f.thmemColor.primary,color:f.thmemColor.primary}},"& > .single-box-error":{margin:0,paddingLeft:"10px",height:"20px",lineHeight:"20px"},"&.single-box-small":{"& > .single-box-add":{height:"26px"}},"&.single-box-medium":{"& > .single-box-add":{height:"34px"}},"&.single-box-large":{"& > .single-box-add":{height:"40px"}},"&.single-box-error":{"& > .single-box-error":{color:f.stateColor.error+"!important"}},"&.single-box-disabled":{"& > .single-box-content":{"& > .single-box-content-item":{"& > .single-box-content-item-svg":{cursor:"not-allowed","& > svg":{color:f.textColor.thirdary}}}},"& > .single-box-add":{border:"1px dashed "+f.textColor.thirdary,color:f.textColor.thirdary,cursor:"not-allowed",backgroundColor:f.bgBorderColor.bg3,"& > svg":{color:f.textColor.thirdary},"&:hover":{border:"1px dashed "+f.textColor.thirdary,color:f.textColor.thirdary}}}}}})})),g=function(o){var r=x(o),l=o.className,d=o.size,u=void 0===d?"small":d,p=o.placeholder,f=void 0===p?"":p,g=o.label,h=void 0===g?"":g,v=o.disabled,b=void 0!==v&&v,m=o.required,y=void 0!==m&&m,w=o.error,C=void 0!==w&&w,S=o.helperText,j=void 0===S?"":S,F=o.value,O=o.onChange,k=(0,t.useState)([]),N=k[0],E=k[1];(0,t.useEffect)((function(){F&&E(F)}),[F]);var P,B=function(e){return function(){N.splice(e,1),E(c([],N,!0)),O&&O(N)}},D=function(e){return function(t){N[e]=t.target.value,E(c([],N,!0)),O&&O(N)}};return(0,e.jsxs)("div",s({className:(P=r["single-box"],P+=" single-box",l&&(P+=" "+l),u&&(P+=" single-box-"+u),C&&(P+=" single-box-error"),b&&(P+=" single-box-disabled"),P)},{children:[h?(0,e.jsxs)("label",s({className:"single-box-label"},{children:[h,y&&(0,e.jsx)("span",{children:"(必填)"},void 0)]}),void 0):null,(0,e.jsx)("div",s({className:"single-box-content"},{children:N.map((function(t,o){return(0,e.jsxs)("div",s({className:"single-box-content-item"},{children:[(0,e.jsx)(i.default,{disabled:b,value:t,placeholder:f,size:u,onChange:D(o)},void 0),(0,e.jsx)("span",s({className:"single-box-content-item-svg"},{children:(0,e.jsx)(a(),{onClick:B(o)},void 0)}),void 0)]}),o)}))}),void 0),(0,e.jsx)("div",s({className:"single-box-add",onClick:function(){N.push(""),E(c([],N,!0)),O&&O(N)}},{children:(0,e.jsx)(n(),{},void 0)}),void 0),j&&(0,e.jsx)("p",s({className:"single-box-error"},{children:j}),void 0)]}),void 0)};p.default=g}(),p}()}));
|
|
16
|
+
o(4126);var i=o(9297),r=60103;if(t.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var n=Symbol.for;r=n("react.element"),t.Fragment=n("react.fragment")}var l=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a=Object.prototype.hasOwnProperty,d={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,o){var i,n={},s=null,c=null;for(i in void 0!==o&&(s=""+o),void 0!==t.key&&(s=""+t.key),void 0!==t.ref&&(c=t.ref),t)a.call(t,i)&&!d.hasOwnProperty(i)&&(n[i]=t[i]);if(e&&e.defaultProps)for(i in t=e.defaultProps)void 0===n[i]&&(n[i]=t[i]);return{$$typeof:r,type:e,key:s,ref:c,props:n,_owner:l.current}}t.jsx=s,t.jsxs=s},7712:function(e,t,o){e.exports=o(9524)},3094:function(e,t,o){var i=o(7712),r=o(9297),n=o(1731),l=o(8604),a=o(5415),d=function(){return d=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},d.apply(this,arguments)},s=((0,a.Z)(),(0,l.makeStyles)((function(e){return(0,l.createStyles)({"auto-tips":{maxWidth:"100%",display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","& > .auto-tips-content":{display:"inline",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})})));t.default=function(e){var t=e.children,o=e.placement,l=void 0===o?"bottom-start":o,a=e.tips,c=void 0===a?"":a,u=e.className,p=void 0===u?"":u,f=(0,r.useRef)(),x=s(),g=(0,r.useState)(""),h=g[0],v=g[1];(0,r.useEffect)((function(){v(c)}),[c]);var b;return(0,i.jsx)("div",d({ref:function(e){e&&(f.current=e)},className:(b=x["auto-tips"],b+=" paraui-auto-tips",p&&(b+=" "+p),b),onMouseOver:function(){f.current.scrollWidth>f.current.offsetWidth?v(h||f.current.innerText):v("")}},{children:(0,i.jsx)(n.Tooltip,d({title:h,placement:l},{children:(0,i.jsx)("div",d({className:"auto-tips-content"},{children:t}),void 0)}),void 0)}),void 0)}},5415:function(e,t){var o={thmemColor:{primary:"#3D66F8",secondary:"#7E98F5",thirdary:"#D6DFFD"},textColor:{primary:"#191919",secondary:"#6E7488",thirdary:"#BBBECB",white:"#FFFFFF"},bgBorderColor:{bg1:"#DCDDE3",bg2:"#F5F5F5",bg3:"#EDEDED",bg4:"#6E7488",line1:"#E5E9EF",universal:"#FFFFFF"},stateColor:{info:"#3D66F8",success:"#41D658",warning:"#FFA150",error:"#F46B53"},gradientColor:{gradient1:"linear-gradient(#3D66F8, #4F93F0)",gradient2:"linear-gradient(#0093FF, #4EB4FF)",gradient3:"linear-gradient(#844EFF, #A796FF)",gradient4:"linear-gradient(#FD7300, #FFBF69)",gradient5:"linear-gradient(#3D66F8, #D8DFFA)"},fontFamily:{zh:"Microsoft Yahei, Helvetica, sans-serif",en:"Microsoft Yahei, Helvetica, sans-serif"},fontSize:12,borderRadius:4,boxShadow:"4px 4px 6px rgba(70,75,105,0.2), -4px -4px 6px rgba(0,0,0,0.06)",buttonShadow:"4px 4px 6px rgba(70,75,105,0.1), -4px -4px 6px rgba(0,0,0,0.03)",standardFont:{standardFont1:{fontSize:"12px",fontWeight:"400"},standardFont2:{fontSize:"12px",fontWeight:"700"}},titleFont:{titleFont1:{fontSize:"14px",fontWeight:"400"},titleFont2:{fontSize:"14px",fontWeight:"700"}},visualLargeFont:{visualLargeFont1:{fontSize:"40px",fontWeight:"700"},visualLargeFont2:{fontSize:"40px",fontWeight:"700"}}};t.Z=function(){return o}},3672:function(e,t,o){var i=o(7712),r=o(9297),n=o(1731),l=o(3094),a=o(8528),d=o.n(a),s=o(6570),c=o.n(s),u=o(1102),p=o.n(u),f=o(8604),x=o(5415),g=o(3475),h=function(){return h=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},h.apply(this,arguments)},v=function(e,t){var o={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(o[i[r]]=e[i[r]])}return o},b=(0,x.Z)(),m=(0,f.makeStyles)((function(){return(0,f.createStyles)({"@keyframes rotate":{"0%":{transformOrigin:"50% 50%"},"100%":{transform:"rotate(360deg)"}},"text-field":{fontFamily:b.fontFamily.zh,display:"inline-block",fontSize:b.standardFont.standardFont1.fontSize,width:"100%",paddingBottom:"20px","& fieldset":{border:0},"& .text-field-error-text":{margin:0,paddingLeft:"10px",height:"20px",lineHeight:"20px"},"& .text-field-label":{color:b.textColor.secondary,marginBottom:"9px",display:"inline-block"},"& .text-field-content":{border:"1px solid",borderColor:b.textColor.thirdary,borderRadius:b.borderRadius,position:"relative",display:"table",width:"100%",boxSizing:"border-box","&:hover":{borderColor:b.thmemColor.primary},"& > div":{display:"table-cell",height:"100%",verticalAlign:"top"},"& .text-field-content-before":{color:b.textColor.primary,padding:"0 10px",borderRight:"1px solid "+b.textColor.thirdary,backgroundColor:b.bgBorderColor.bg2,borderBottomLeftRadius:b.borderRadius,borderTopLeftRadius:b.borderRadius,whiteSpace:"nowrap","& svg":{fontSize:"20px",verticalAlign:"top",position:"relative"}},"& .text-field-content-within":{position:"relative",width:"100%","& > *":{display:"table-cell",verticalAlign:"top"},"& svg":{fontSize:"20px",color:b.textColor.secondary,cursor:"pointer"},"& .right-icon":{zIndex:"1",position:"relative",whiteSpace:"nowrap","& > svg":{marginRight:"10px"}},"& .length-limit":{zIndex:"1",position:"relative",paddingRight:"10px",color:b.textColor.secondary},"& .text-field-content-within-input":{width:"100vw","& > div":{width:"100%"},"& input":{height:"100%"},"& input,textarea":{fontSize:b.standardFont.standardFont1.fontSize,color:b.textColor.primary,"&:-ms-clear":{display:"none"},"&:-ms-reveal":{display:"none"}},"& .text-field-label-placeholder":{width:"100%",position:"absolute",left:"0",height:"100%",padding:"0 10px",boxSizing:"border-box",color:b.textColor.thirdary,cursor:"text",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}},"& .text-field-content-after":{color:b.textColor.primary,padding:"0 10px",borderLeft:"1px solid",borderColor:b.textColor.thirdary,backgroundColor:b.bgBorderColor.bg2,borderBottomRightRadius:b.borderRadius,borderTopRightRadius:b.borderRadius,whiteSpace:"nowrap","& svg":{fontSize:"20px",verticalAlign:"top",position:"relative"}}},"& .identification-label":{marginLeft:"3px"},"&.text-field-multiline":{"& .text-field-content":{"& .text-field-content-within":{"& > *":{display:"inline-block"},"& .length-limit":{width:"100%",boxSizing:"border-box",textAlign:"right",paddingBottom:"5px"},"& .text-field-content-within-input":{width:"100%","& > div:first-child":{width:"100%","& > div:first-child":{padding:"10px"}},"& .text-field-label-placeholder":{paddingTop:"10px"}}}}},"&.text-field-disabled":{"& .text-field-content":{backgroundColor:b.bgBorderColor.bg3,"&:hover":{borderColor:b.textColor.thirdary},"& .text-field-content-within":{"& .text-field-content-within-input":{"& .text-field-label-placeholder":{cursor:"not-allowed"},"& input":{cursor:"not-allowed",color:b.textColor.thirdary}}}}},"&.text-field-error":{"& .text-field-error-text":{color:b.stateColor.error},"& .text-field-content":{borderColor:b.stateColor.error,"&:hover":{borderColor:b.stateColor.error},"& .text-field-content-before":{borderColor:b.stateColor.error},"& .text-field-content-after":{borderColor:b.stateColor.error}}},"&.text-field-focus":{"& .text-field-content":{borderColor:b.thmemColor.primary,"& .text-field-content-before":{borderColor:b.thmemColor.primary},"& .text-field-content-after":{borderColor:b.thmemColor.primary}}},"&.text-field-small":{"& .text-field-content":{height:"28px","& .text-field-content-before":{lineHeight:"26px","& svg":{top:"3px"}},"& .text-field-content-within":{"& .text-field-content-within-input":{"& > div":{height:"26px","& > div":{height:"100%"}}},"& input":{padding:"5px 10px"},"& .text-field-label-placeholder":{lineHeight:"26px"},"& .right-icon":{paddingTop:"3px"},"& .length-limit":{lineHeight:"26px"}},"& .text-field-content-after":{lineHeight:"26px","& svg":{top:"3px"}}}},"&.text-field-medium":{"& .text-field-content":{height:"34px","& .text-field-content-before":{lineHeight:"32px","& svg":{top:"6px"}},"& .text-field-content-within":{"& .text-field-content-within-input":{"& > div":{height:"32px","& > div":{height:"100%"}}},"& input":{padding:"8px 10px"},"& .text-field-label-placeholder":{lineHeight:"32px"},"& .right-icon":{paddingTop:"7px"},"& .length-limit":{lineHeight:"32px","& svg":{top:"6px"}}},"& .text-field-content-after":{lineHeight:"32px","& svg":{top:"6px"}}}},"&.text-field-large":{"& .text-field-content":{height:"40px","& .text-field-content-before":{lineHeight:"38px","& svg":{top:"9px"}},"& .text-field-content-within":{"& .text-field-content-within-input":{"& > div":{height:"38px","& > div":{height:"100%"}}},"& input":{padding:"11px 10px"},"& .text-field-label-placeholder":{lineHeight:"38px"},"& .right-icon":{paddingTop:"10px"},"& .length-limit":{lineHeight:"38px"}},"& .text-field-content-after":{lineHeight:"38px","& svg":{top:"9px"}}}}},"text-field-select":{"& > div":{maxWidth:"none",padding:"0",backgroundColor:b.textColor.white,boxShadow:b.boxShadow,borderRadius:b.borderRadius,"& > span":{color:b.textColor.white},"& .text-field-select-content":{maxHeight:"300px",overflow:"auto","& > .text-field-select-content-item":{display:"flex",padding:"7px 10px",cursor:"pointer",lineHeight:"16px",color:b.textColor.secondary,"&:hover":{backgroundColor:b.bgBorderColor.bg2,color:b.thmemColor.primary},"&.text-field-select-content-item-keydown":{backgroundColor:b.bgBorderColor.bg2,color:b.thmemColor.primary}},"&.text-field-select-content-loading":{height:"100px",position:"relative",overflow:"hidden","& > .loading-box":{position:"absolute",left:"0",top:"0",width:"100%",height:"100%",backgroundColor:"white",display:"flex",justifyContent:"center",alignItems:"center","& > svg":{transition:"all .3s ease-in-out",animation:"$rotate 1s infinite linear",fontSzie:"20px"}}}}}}})}));t.default=function(e){var t=e.className,o=e.size,a=void 0===o?"small":o,s=e.labelMode,u=void 0===s?"outside":s,f=e.placeholder,x=void 0===f?"":f,b=e.label,y=void 0===b?"":b,w=e.disabled,C=void 0!==w&&w,S=e.multiline,j=void 0!==S&&S,F=e.required,O=void 0!==F&&F,k=e.showLabelSign,N=void 0===k||k,E=e.labelSign,P=e.rows,B=void 0===P?2:P,D=e.error,R=void 0!==D&&D,q=e.helperText,L=void 0===q?"":q,z=e.addonBefore,H=void 0===z?"":z,T=e.addonAfter,I=void 0===T?"":T,_=e.value,A=e.controlled,M=void 0!==A&&A,W=e.autoFocus,U=void 0!==W&&W,K=e.type,Z=void 0===K?"text":K,Y=e.onClickIcon,$=e.rightIcon,J=e.showRightIcon,G=void 0===J||J,Q=e.limitLength,V=e.fetchSuggestions,X=e.selectPopoverClass,ee=e.renderSelectItem,te=e.showSelectName,oe=void 0===te?"value":te,ie=e.onBlur,re=e.onFocus,ne=e.onChange,le=e.onKeydown,ae=e.onKeyUp,de=e.onEnter,se=e.onClickAddonBefore,ce=e.onClickAddonAfter,ue=e.onSelect,pe=v(e,["className","size","labelMode","placeholder","label","disabled","multiline","required","showLabelSign","labelSign","rows","error","helperText","addonBefore","addonAfter","value","controlled","autoFocus","type","onClickIcon","rightIcon","showRightIcon","limitLength","fetchSuggestions","selectPopoverClass","renderSelectItem","showSelectName","onBlur","onFocus","onChange","onKeydown","onKeyUp","onEnter","onClickAddonBefore","onClickAddonAfter","onSelect"]),fe=m(e),xe=(0,r.useState)("text-field-select-content-"+(0,g.UUID)())[0],ge=(0,r.useState)(!0),he=ge[0],ve=ge[1],be=(0,r.useState)(),me=be[0],ye=be[1],we=(0,r.useState)(!1),Ce=we[0],Se=we[1],je=(0,r.useState)(0),Fe=je[0],Oe=je[1],ke=(0,r.useState)("text"),Ne=ke[0],Ee=ke[1],Pe=(0,r.useState)(!1),Be=Pe[0],De=Pe[1],Re=(0,r.useState)(!1),qe=Re[0],Le=Re[1],ze=(0,r.useState)([]),He=ze[0],Te=ze[1],Ie=((0,r.useState)({})[0],(0,r.useRef)(null)),_e=(0,r.useRef)(null),Ae=(0,r.useRef)(null);(0,r.useEffect)((function(){Ie&&Ie.current&&Oe(Ie.current.offsetWidth)}),[]),(0,r.useEffect)((function(){Z!==Ne&&Ee(Z)}),[Z]),(0,r.useEffect)((function(){ye(_)}),[_]),(0,r.useEffect)((function(){ve(""===me||void 0===me)}),[me]),(0,r.useEffect)((function(){V&&De(Ce)}),[Ce,V]),(0,r.useEffect)((function(){return Be?window.addEventListener("keydown",Ze):window.removeEventListener("keydown",Ze),function(){window.removeEventListener("keydown",Ze)}}),[Be]);var Me,We=function(){C||(ve(!1),(_e&&_e.current&&_e.current.querySelector(j?"textarea":"input")).focus())},Ue=function(e){var t=e.selectDom,o=e.keyCode,i=e.currentDom,r="nextSibling",n=".text-field-select-content-item";38===o&&(r="previousSibling",n=".text-field-select-content-item:last-child"),i?(i=i[r])||(i=t.querySelector(n)):i=t.querySelector(".text-field-select-content-item"),i&&(i.classList.add("text-field-select-content-item-keydown"),Ke(i,t))},Ke=function(e,t){var o=t.clientHeight,i=e.offsetTop+e.clientHeight-o;t.scrollTop=i>0?i:0},Ze=function(e){var t=document.querySelector("."+xe),o=null,i=t.querySelector(".text-field-select-content-item-keydown");if(13===e.keyCode&&i){var r=i.dataset.val;tt(JSON.parse(r))(e),(_e&&_e.current&&_e.current.querySelector(j?"textarea":"input")).blur()}i&&(o=i,i.classList.remove("text-field-select-content-item-keydown")),40===e.keyCode&&Ue({selectDom:t,keyCode:e.keyCode,currentDom:o}),38===e.keyCode&&Ue({selectDom:t,keyCode:e.keyCode,currentDom:o})},Ye=function(e){Se(!1),""===e.target.value&&ve(!0),ie&&ie(e)},$e=function(e){Le(!0),V&&V(e,(function(e){Te(e||[]),Le(!1)}))},Je=function(e){Se(!0),re&&re(e),$e(e.target.value)},Ge=function(e){var t=e.target.value;Q&&void 0!==t&&""!==t&&t.toString().length>Q||(M||ye(t),ne&&ne(e),$e(e.target.value))},Qe=function(e){13===e.keyCode&&de&&de(e),le&&le(e)},Ve=function(e){ae&&ae(e)},Xe=function(e){"password"===Z&&("text"===Ne&&Ee("password"),"password"===Ne&&Ee("text")),Y&&Y(e)},et=function(){De(!1)},tt=function(e){return function(t){ue&&ue(e)}},ot=(0,r.useMemo)((function(){return(0,i.jsx)(i.Fragment,{children:void 0!==Q&&(0,i.jsx)("span",h({className:"length-limit"},{children:(me?me.toString().length:0)+"/"+Q}),void 0)},void 0)}),[Q,me]),it=(0,r.useMemo)((function(){return(0,i.jsx)(i.Fragment,{children:G&&(0,i.jsx)("span",h({className:"right-icon",onClick:Xe},{children:$||("password"===Z?"password"===Ne?(0,i.jsx)(c(),{},void 0):(0,i.jsx)(d(),{},void 0):null)}),void 0)},void 0)}),[G,$,Z,Ne]),rt=(0,r.useMemo)((function(){return(0,i.jsxs)("div",h({className:"text-field-content-within",ref:Ae},{children:[(0,i.jsxs)("div",h({className:"text-field-content-within-input"},{children:[(0,i.jsx)(n.TextField,h({size:"small",variant:"outlined",autoFocus:U,ref:_e,type:Ne,value:me||"",disabled:C,multiline:j,rows:B,onBlur:Ye,onFocus:Je,onChange:Ge,onKeyDown:Qe,onKeyUp:Ve},pe),void 0),he&&(0,i.jsx)("span",h({className:"text-field-label-placeholder",onClick:We},{children:"outside"===u?x:(0,i.jsxs)(i.Fragment,{children:[y||x,N&&(0,i.jsx)("span",h({className:"identification-label"},{children:E||(0,i.jsx)(i.Fragment,{children:O?"(必填)":""},void 0)}),void 0)]},void 0)}),void 0)]}),void 0),ot,it]}),void 0)}),[he,U,Ne,me,ot,it,u,x,y,C,j,B,pe,ne,V]),nt=(0,r.useMemo)((function(){var e;return(0,i.jsxs)("div",h({className:(e="text-field-select-content",qe&&(e+=" text-field-select-content-loading"),xe&&(e+=" "+xe),e),style:{width:(Ae&&Ae.current?Ae.current.offsetWidth:0)+"px"}},{children:[He&&He.map((function(e,t){return(0,i.jsx)("div",h({className:"text-field-select-content-item",onMouseDown:tt(e),"data-val":JSON.stringify(e)},{children:ee?ee(e):(0,i.jsx)(l.default,{children:e[oe]},void 0)}),t)})),qe&&(0,i.jsx)("div",h({className:"loading-box"},{children:(0,i.jsx)(p(),{},void 0)}),void 0)]}),void 0)}),[Ae,Be,He,ee,oe,ue,qe,xe]),lt=(0,r.useMemo)((function(){return(0,i.jsx)(n.Tooltip,h({open:Be,title:nt,onClose:et,interactive:!0,disableFocusListener:!0,disableHoverListener:!0,disableTouchListener:!0,arrow:!0,classes:{popper:(e=fe["text-field-select"],X&&(e+=" "+X),e)}},{children:rt}),void 0);var e}),[he,U,Ne,me,ot,it,u,x,y,C,j,B,pe,ne,V,ue,Ae,Be,X]),at=(0,r.useMemo)((function(){var e=Boolean(N&&(E||O));if("outside"===u&&(y||e))return(0,i.jsxs)("label",h({className:"text-field-label"},{children:[y,N&&(0,i.jsx)("span",h({className:"identification-label"},{children:E||(0,i.jsx)(i.Fragment,{children:O?"(必填)":""},void 0)}),void 0)]}),void 0)}),[u,y,N,E,O]);return(0,i.jsxs)("div",h({className:(Me=fe["text-field"],Me+=" text-field",a&&!j&&(Me+=" text-field-"+a),t&&(Me+=" "+t),R&&(Me+=" text-field-error"),Ce&&(Me+=" text-field-focus"),C&&(Me+=" text-field-disabled"),j&&(Me+=" text-field-multiline"),Me)},{children:[at,(0,i.jsxs)("div",h({className:"text-field-content"},{children:[H&&(0,i.jsx)("div",h({className:"text-field-content-before",ref:Ie,onClick:function(e){se&&se(e)}},{children:H}),void 0),V?lt:rt,I&&(0,i.jsx)("div",h({className:"text-field-content-after",onClick:function(e){ce&&ce(e)}},{children:I}),void 0)]}),void 0),L&&(0,i.jsx)("p",h({className:"text-field-error-text",style:{marginLeft:Fe+"px"}},{children:L}),void 0)]}),void 0)}},1731:function(e){e.exports=o},8604:function(e){e.exports=t},6243:function(e){e.exports=d},1102:function(e){e.exports=n},5191:function(e){e.exports=a},6570:function(e){e.exports=r},8528:function(e){e.exports=i},3475:function(e){e.exports=l},9297:function(t){t.exports=e}},c={};function u(e){var t=c[e];if(void 0!==t)return t.exports;var o=c[e]={exports:{}};return s[e](o,o.exports,u),o.exports}u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,{a:t}),t},u.d=function(e,t){for(var o in t)u.o(t,o)&&!u.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var p={};return function(){u.r(p),u.d(p,{SingleBox:function(){return g}});var e=u(7712),t=u(9297),o=u(8604),i=u(3672),r=u(5191),n=u.n(r),l=u(6243),a=u.n(l),d=u(5415),s=function(){return s=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},s.apply(this,arguments)},c=function(e,t,o){if(o||2===arguments.length)for(var i,r=0,n=t.length;r<n;r++)!i&&r in t||(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))},f=(0,d.Z)(),x=(0,o.makeStyles)((function(){return(0,o.createStyles)({"single-box":{"&.single-box":{display:"inline-block",width:"100%","& > .single-box-label":{color:f.textColor.secondary,marginBottom:"9px",display:"inline-block"},"& > .single-box-content":{lineHeight:"0","& > .single-box-content-item":{paddingBottom:"15px",display:"flex","& > .text-field":{paddingBottom:"0",width:"calc(100% - 30px)"},"& > .single-box-content-item-svg":{display:"flex",alignItems:"center",justifyContent:"center",width:"30px",cursor:"pointer"}}},"& > .single-box-add":{textAlign:"center",border:"1px dashed "+f.textColor.thirdary,color:f.textColor.secondary,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:f.borderRadius,"& > svg":{fontSize:"24px"},"&:hover":{border:"1px dashed "+f.thmemColor.primary,color:f.thmemColor.primary}},"& > .single-box-error":{margin:0,paddingLeft:"10px",height:"20px",lineHeight:"20px"},"&.single-box-small":{"& > .single-box-add":{height:"26px"}},"&.single-box-medium":{"& > .single-box-add":{height:"34px"}},"&.single-box-large":{"& > .single-box-add":{height:"40px"}},"&.single-box-error":{"& > .single-box-error":{color:f.stateColor.error+"!important"}},"&.single-box-disabled":{"& > .single-box-content":{"& > .single-box-content-item":{"& > .single-box-content-item-svg":{cursor:"not-allowed","& > svg":{color:f.textColor.thirdary}}}},"& > .single-box-add":{border:"1px dashed "+f.textColor.thirdary,color:f.textColor.thirdary,cursor:"not-allowed",backgroundColor:f.bgBorderColor.bg3,"& > svg":{color:f.textColor.thirdary},"&:hover":{border:"1px dashed "+f.textColor.thirdary,color:f.textColor.thirdary}}}}}})})),g=function(o){var r=x(o),l=o.className,d=o.size,u=void 0===d?"small":d,p=o.placeholder,f=void 0===p?"":p,g=o.label,h=void 0===g?"":g,v=o.disabled,b=void 0!==v&&v,m=o.required,y=void 0!==m&&m,w=o.error,C=void 0!==w&&w,S=o.helperText,j=void 0===S?"":S,F=o.value,O=o.onChange,k=(0,t.useState)([]),N=k[0],E=k[1];(0,t.useEffect)((function(){F&&E(F)}),[F]);var P,B=function(e){return function(){N.splice(e,1),E(c([],N,!0)),O&&O(N)}},D=function(e){return function(t){N[e]=t.target.value,E(c([],N,!0)),O&&O(N)}};return(0,e.jsxs)("div",s({className:(P=r["single-box"],P+=" single-box",l&&(P+=" "+l),u&&(P+=" single-box-"+u),C&&(P+=" single-box-error"),b&&(P+=" single-box-disabled"),P)},{children:[h?(0,e.jsxs)("label",s({className:"single-box-label"},{children:[h,y&&(0,e.jsx)("span",{children:"(必填)"},void 0)]}),void 0):null,(0,e.jsx)("div",s({className:"single-box-content"},{children:N.map((function(t,o){return(0,e.jsxs)("div",s({className:"single-box-content-item"},{children:[(0,e.jsx)(i.default,{disabled:b,value:t,placeholder:f,size:u,onChange:D(o)},void 0),(0,e.jsx)("span",s({className:"single-box-content-item-svg"},{children:(0,e.jsx)(a(),{onClick:B(o)},void 0)}),void 0)]}),o)}))}),void 0),(0,e.jsx)("div",s({className:"single-box-add",onClick:function(){N.push(""),E(c([],N,!0)),O&&O(N)}},{children:(0,e.jsx)(n(),{},void 0)}),void 0),j&&(0,e.jsx)("p",s({className:"single-box-error"},{children:j}),void 0)]}),void 0)};p.default=g}(),p}()}));
|
package/Stepper/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("react"),require("@material-ui/core"),require("@material-ui/core/styles"),require("@para-ui/icons/One"),require("@para-ui/icons/Two"),require("@para-ui/icons/Three"),require("@para-ui/icons/Four"),require("@para-ui/icons/Five"),require("@para-ui/icons/Six"),require("@para-ui/icons/Seven"),require("@para-ui/icons/Eight"),require("@para-ui/icons/Nine"),require("@para-ui/icons/Check")):"function"==typeof define&&define.amd?define(["react","@material-ui/core","@material-ui/core/styles","@para-ui/icons/One","@para-ui/icons/Two","@para-ui/icons/Three","@para-ui/icons/Four","@para-ui/icons/Five","@para-ui/icons/Six","@para-ui/icons/Seven","@para-ui/icons/Eight","@para-ui/icons/Nine","@para-ui/icons/Check"],r):"object"==typeof exports?exports.ParaUI=r(require("react"),require("@material-ui/core"),require("@material-ui/core/styles"),require("@para-ui/icons/One"),require("@para-ui/icons/Two"),require("@para-ui/icons/Three"),require("@para-ui/icons/Four"),require("@para-ui/icons/Five"),require("@para-ui/icons/Six"),require("@para-ui/icons/Seven"),require("@para-ui/icons/Eight"),require("@para-ui/icons/Nine"),require("@para-ui/icons/Check")):e.ParaUI=r(e.react,e["@material-ui/core"],e["@material-ui/core/styles"],e["@para-ui/icons/One"],e["@para-ui/icons/Two"],e["@para-ui/icons/Three"],e["@para-ui/icons/Four"],e["@para-ui/icons/Five"],e["@para-ui/icons/Six"],e["@para-ui/icons/Seven"],e["@para-ui/icons/Eight"],e["@para-ui/icons/Nine"],e["@para-ui/icons/Check"])}(self,(function(e,r,i,
|
|
1
|
+
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("react"),require("@material-ui/core"),require("@material-ui/core/styles"),require("@para-ui/icons/One"),require("@para-ui/icons/Two"),require("@para-ui/icons/Three"),require("@para-ui/icons/Four"),require("@para-ui/icons/Five"),require("@para-ui/icons/Six"),require("@para-ui/icons/Seven"),require("@para-ui/icons/Eight"),require("@para-ui/icons/Nine"),require("@para-ui/icons/Check")):"function"==typeof define&&define.amd?define(["react","@material-ui/core","@material-ui/core/styles","@para-ui/icons/One","@para-ui/icons/Two","@para-ui/icons/Three","@para-ui/icons/Four","@para-ui/icons/Five","@para-ui/icons/Six","@para-ui/icons/Seven","@para-ui/icons/Eight","@para-ui/icons/Nine","@para-ui/icons/Check"],r):"object"==typeof exports?exports.ParaUI=r(require("react"),require("@material-ui/core"),require("@material-ui/core/styles"),require("@para-ui/icons/One"),require("@para-ui/icons/Two"),require("@para-ui/icons/Three"),require("@para-ui/icons/Four"),require("@para-ui/icons/Five"),require("@para-ui/icons/Six"),require("@para-ui/icons/Seven"),require("@para-ui/icons/Eight"),require("@para-ui/icons/Nine"),require("@para-ui/icons/Check")):e.ParaUI=r(e.react,e["@material-ui/core"],e["@material-ui/core/styles"],e["@para-ui/icons/One"],e["@para-ui/icons/Two"],e["@para-ui/icons/Three"],e["@para-ui/icons/Four"],e["@para-ui/icons/Five"],e["@para-ui/icons/Six"],e["@para-ui/icons/Seven"],e["@para-ui/icons/Eight"],e["@para-ui/icons/Nine"],e["@para-ui/icons/Check"])}(self,(function(e,r,t,i,n,o,a,c,u,s,p,l,f){return function(){"use strict";var d={4927:function(e,r,t){function i(e){var r,t,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(r=0;r<e.length;r++)e[r]&&(t=i(e[r]))&&(n&&(n+=" "),n+=t);else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function n(){for(var e,r,t=0,n="";t<arguments.length;)(e=arguments[t++])&&(r=i(e))&&(n&&(n+=" "),n+=r);return n}t.d(r,{Z:function(){return n}})},4126:function(e){
|
|
2
2
|
/*
|
|
3
3
|
object-assign
|
|
4
4
|
(c) Sindre Sorhus
|
|
5
5
|
@license MIT
|
|
6
6
|
*/
|
|
7
|
-
var r=Object.getOwnPropertySymbols,
|
|
7
|
+
var r=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function n(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var r={},t=0;t<10;t++)r["_"+String.fromCharCode(t)]=t;if("0123456789"!==Object.getOwnPropertyNames(r).map((function(e){return r[e]})).join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach((function(e){i[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(e){return!1}}()?Object.assign:function(e,o){for(var a,c,u=n(e),s=1;s<arguments.length;s++){for(var p in a=Object(arguments[s]))t.call(a,p)&&(u[p]=a[p]);if(r){c=r(a);for(var l=0;l<c.length;l++)i.call(a,c[l])&&(u[c[l]]=a[c[l]])}}return u}},9524:function(e,r,t){
|
|
8
8
|
/** @license React v17.0.2
|
|
9
9
|
* react-jsx-runtime.production.min.js
|
|
10
10
|
*
|
|
@@ -13,4 +13,4 @@ var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,t=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
|
-
|
|
16
|
+
t(4126);var i=t(9297),n=60103;if(60107,"function"==typeof Symbol&&Symbol.for){var o=Symbol.for;n=o("react.element"),o("react.fragment")}var a=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c=Object.prototype.hasOwnProperty,u={key:!0,ref:!0,__self:!0,__source:!0};function s(e,r,t){var i,o={},s=null,p=null;for(i in void 0!==t&&(s=""+t),void 0!==r.key&&(s=""+r.key),void 0!==r.ref&&(p=r.ref),r)c.call(r,i)&&!u.hasOwnProperty(i)&&(o[i]=r[i]);if(e&&e.defaultProps)for(i in r=e.defaultProps)void 0===o[i]&&(o[i]=r[i]);return{$$typeof:n,type:e,key:s,ref:p,props:o,_owner:a.current}}r.jsx=s},7712:function(e,r,t){e.exports=t(9524)},5415:function(e,r){var t={thmemColor:{primary:"#3D66F8",secondary:"#7E98F5",thirdary:"#D6DFFD"},textColor:{primary:"#191919",secondary:"#6E7488",thirdary:"#BBBECB",white:"#FFFFFF"},bgBorderColor:{bg1:"#DCDDE3",bg2:"#F5F5F5",bg3:"#EDEDED",bg4:"#6E7488",line1:"#E5E9EF",universal:"#FFFFFF"},stateColor:{info:"#3D66F8",success:"#41D658",warning:"#FFA150",error:"#F46B53"},gradientColor:{gradient1:"linear-gradient(#3D66F8, #4F93F0)",gradient2:"linear-gradient(#0093FF, #4EB4FF)",gradient3:"linear-gradient(#844EFF, #A796FF)",gradient4:"linear-gradient(#FD7300, #FFBF69)",gradient5:"linear-gradient(#3D66F8, #D8DFFA)"},fontFamily:{zh:"Microsoft Yahei, Helvetica, sans-serif",en:"Microsoft Yahei, Helvetica, sans-serif"},fontSize:12,borderRadius:4,boxShadow:"4px 4px 6px rgba(70,75,105,0.2), -4px -4px 6px rgba(0,0,0,0.06)",buttonShadow:"4px 4px 6px rgba(70,75,105,0.1), -4px -4px 6px rgba(0,0,0,0.03)",standardFont:{standardFont1:{fontSize:"12px",fontWeight:"400"},standardFont2:{fontSize:"12px",fontWeight:"700"}},titleFont:{titleFont1:{fontSize:"14px",fontWeight:"400"},titleFont2:{fontSize:"14px",fontWeight:"700"}},visualLargeFont:{visualLargeFont1:{fontSize:"40px",fontWeight:"700"},visualLargeFont2:{fontSize:"40px",fontWeight:"700"}}};r.Z=function(){return t}},1731:function(e){e.exports=r},8604:function(e){e.exports=t},6110:function(e){e.exports=f},1861:function(e){e.exports=p},2873:function(e){e.exports=c},8764:function(e){e.exports=a},1709:function(e){e.exports=l},5283:function(e){e.exports=i},1341:function(e){e.exports=s},763:function(e){e.exports=u},7214:function(e){e.exports=o},7139:function(e){e.exports=n},9297:function(r){r.exports=e}},g={};function v(e){var r=g[e];if(void 0!==r)return r.exports;var t=g[e]={exports:{}};return d[e](t,t.exports,v),t.exports}v.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return v.d(r,{a:r}),r},v.d=function(e,r){for(var t in r)v.o(r,t)&&!v.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},v.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},v.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var h={};return function(){v.r(h),v.d(h,{Stepper:function(){return I},default:function(){return B}});var e=v(7712),r=v(9297),t=v.n(r),i=v(1731),n=v(8604),o=v(4927),a=v(5283),c=v.n(a),u=v(7139),s=v.n(u),p=v(7214),l=v.n(p),f=v(8764),d=v.n(f),g=v(2873),b=v.n(g),m=v(763),y=v.n(m),x=v(1341),F=v.n(x),j=v(1861),S=v.n(j),O=v(1709),C=v.n(O),w=v(6110),q=v.n(w),E={1:(0,e.jsx)(c(),{},void 0),2:(0,e.jsx)(s(),{},void 0),3:(0,e.jsx)(l(),{},void 0),4:(0,e.jsx)(d(),{},void 0),5:(0,e.jsx)(b(),{},void 0),6:(0,e.jsx)(y(),{},void 0),7:(0,e.jsx)(F(),{},void 0),8:(0,e.jsx)(S(),{},void 0),9:(0,e.jsx)(C(),{},void 0),done:(0,e.jsx)(q(),{},void 0)},_=v(5415),k=function(){return k=Object.assign||function(e){for(var r,t=1,i=arguments.length;t<i;t++)for(var n in r=arguments[t])Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);return e},k.apply(this,arguments)},D=function(e,r){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&r.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(e);n<i.length;n++)r.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(e,i[n])&&(t[i[n]]=e[i[n]])}return t},P=(0,_.Z)(),L=(0,n.makeStyles)((function(e){return(0,n.createStyles)({gradientLine:{"& + div":{"& > div:first-child > span":{border:0,height:1,backgroundImage:"linear-gradient(to right,".concat(P.thmemColor.primary," 70%,").concat(P.thmemColor.thirdary,")")}}},gradientLineVertical:{"& + div":{"& > span":{border:0,height:1,backgroundImage:"linear-gradient(to right,".concat(P.thmemColor.primary," 70%,").concat(P.thmemColor.thirdary,")")}}},gradientLineAlternative:{"& + div":{color:"red","& > span":{border:0,height:1,backgroundImage:"linear-gradient(to right,".concat(P.thmemColor.primary," 70%,").concat(P.thmemColor.thirdary,")")}}}})})),N=(0,n.makeStyles)({root:{width:30,height:30,display:"flex",backgroundColor:P.bgBorderColor.universal,zIndex:1,borderRadius:"50%",justifyContent:"center",alignItems:"center",boxShadow:P.boxShadow,"& svg":{width:16,height:16,fill:P.textColor.secondary}},active:{backgroundColor:P.thmemColor.primary,"& svg":{width:16,height:16,fill:P.textColor.white}},completed:{backgroundColor:P.bgBorderColor.bg4,"& svg":{width:16,height:16,fill:P.textColor.white}}});function T(r){var t,i=N(),n=r.active,a=r.completed,c=r.mode,u=r.icon,s=r.iconComp;return(0,e.jsx)("div",k({className:(0,o.Z)(i.root,(t={},t[i.active]=n,t[i.completed]=a,t))},{children:a?E.done:"number"===c?E[String(u)]:"icon"===c?s||E.done:void 0}),void 0)}var I=function(r){var n=L(),a=r.activeStep,c=void 0===a?0:a,u=r.mode,s=void 0===u?"number":u,p=r.steps,l=void 0===p?[]:p,f=r.alternativeLabel,d=void 0===f||f,g=r.orientation,v=void 0===g?"horizontal":g,h=r.className,b=D(r,["activeStep","mode","steps","alternativeLabel","orientation","className"]),m=function(e){var r;return(0,o.Z)(((r={})[n.gradientLine]=c===e,r))},y=function(r){return t().forwardRef((function(t,i){return(0,e.jsx)(T,k({mode:s,iconComp:r.icon},t,{ref:i}),void 0)}))};return(0,e.jsx)(i.Stepper,k({className:(0,o.Z)("paraui-stepper",h),activeStep:c,alternativeLabel:d,orientation:v},b,{connector:(0,e.jsx)(i.StepConnector,{},void 0)},{children:(null==l?void 0:l.length)?l.map((function(r,t){var n="",o={};return"number"===s?(n=r,o.label=n):"object"==typeof r&&(n=r.label||"",o=k({},r)),(0,e.jsx)(i.Step,k({className:m(t)},{children:(0,e.jsx)(i.StepLabel,k({StepIconComponent:y(o)},{children:n}),void 0)}),t)})):null}),void 0)},B=I}(),h}()}));
|
package/Switch/index.d.ts
CHANGED
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
* @date 2021/8/5 下午7:23
|
|
4
4
|
* @description switch 开关
|
|
5
5
|
*/
|
|
6
|
-
import { FunctionComponent } from
|
|
6
|
+
import { FunctionComponent } from "react";
|
|
7
7
|
import { SwitchProps as MuiSwitchProps } from "@material-ui/core";
|
|
8
|
-
export declare type SwitchProps = Omit<MuiSwitchProps,
|
|
8
|
+
export declare type SwitchProps = Omit<MuiSwitchProps, "size"> & {
|
|
9
9
|
/**
|
|
10
10
|
* 类型
|
|
11
11
|
*/
|
|
12
|
-
type?:
|
|
12
|
+
type?: "compact" | "normal";
|
|
13
13
|
/**
|
|
14
14
|
* 大小
|
|
15
15
|
*/
|
|
16
|
-
size?:
|
|
16
|
+
size?: "small" | "medium" | "large";
|
|
17
17
|
};
|
|
18
18
|
declare const Switch: FunctionComponent<SwitchProps>;
|
|
19
19
|
export default Switch;
|