@para-ui/core 2.0.7 → 2.0.11
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 +2 -2
- package/Button/index.js +3 -3
- package/ButtonGroup/index.js +1 -1
- package/ComboSelect/index.js +1 -1
- package/DatePicker/index.js +1 -1
- package/Drawer/index.js +1 -1
- package/Form/index.d.ts +4 -0
- package/Form/index.js +1 -1
- package/FormItem/index.js +3 -3
- package/FunctionModal/index.js +3 -3
- package/Help/index.js +2 -2
- package/InputLang/index.js +3 -3
- package/InputNumber/index.js +1 -1
- package/Modal/index.js +3 -3
- package/MultiBox/index.js +3 -3
- package/PageHeader/index.js +1 -1
- package/Pagination/index.js +2 -2
- package/PopConfirm/index.d.ts +5 -1
- package/PopConfirm/index.js +3 -3
- package/Popper/index.d.ts +13 -0
- package/Popper/index.js +16 -0
- package/Search/index.js +3 -3
- package/Select/index.d.ts +2 -0
- package/Select/index.js +3 -3
- package/SingleBox/index.js +1 -1
- package/Slider/index.js +1 -1
- package/Table/index.js +3 -3
- package/Tabs/index.js +3 -3
- package/TextField/index.js +1 -1
- package/TimePicker/index.js +1 -1
- package/ToggleButton/index.js +3 -3
- package/Tooltip/index.js +2 -2
- package/Transfer/index.js +3 -3
- package/Tree/index.js +1 -1
- package/Tree/interface.d.ts +7 -3
- package/Tree/utils/tools.d.ts +10 -2
- package/Upload/index.js +3 -3
- package/index.d.ts +1 -0
- package/index.js +2 -2
- package/package.json +1 -1
- package/style.css +5 -5
package/TimePicker/index.js
CHANGED
|
@@ -11,4 +11,4 @@ object-assign
|
|
|
11
11
|
*
|
|
12
12
|
* This source code is licensed under the MIT license found in the
|
|
13
13
|
* LICENSE file in the root directory of this source tree.
|
|
14
|
-
*/t(4126);var n=t(9297),o=60103;if(r.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var a=Symbol.for;o=a("react.element"),r.Fragment=a("react.fragment")}var i=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c=Object.prototype.hasOwnProperty,l={key:!0,ref:!0,__self:!0,__source:!0};function u(e,r,t){var n,a={},u=null,s=null;for(n in void 0!==t&&(u=""+t),void 0!==r.key&&(u=""+r.key),void 0!==r.ref&&(s=r.ref),r)c.call(r,n)&&!l.hasOwnProperty(n)&&(a[n]=r[n]);if(e&&e.defaultProps)for(n in r=e.defaultProps)void 0===a[n]&&(a[n]=r[n]);return{$$typeof:o,type:e,key:u,ref:s,props:a,_owner:i.current}}r.jsx=u,r.jsxs=u},7712:function(e,r,t){"use strict";e.exports=t(9524)},2990:function(e,r,t){"use strict";t.d(r,{default:function(){return g}});var n=t(7712),o=t(9297),a=t(1731),i=t(4927),c=t(1102),l=t.n(c),u=t(2749),s=t.n(u),p=t(6885),d=t(6028),f=t.n(d),v=function(){return v=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},v.apply(this,arguments)};var h=function(){return h=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},h.apply(this,arguments)},m=function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)r.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(t[n[o]]=e[n[o]])}return t},y=function(e){var r=e.variant,t=void 0===r?"contained":r,c=e.size,u=void 0===c?"large":c,d=e.className,f=e.disabled,v=void 0!==f&&f,y=e.children,g=e.startIcon,b=e.endIcon,x=e.loading,j=void 0!==x&&x,k=e.toolTipTitle,O=void 0===k?"":k,P=e.danger,w=void 0!==P&&P,C=m(e,["variant","size","className","disabled","children","startIcon","endIcon","loading","toolTipTitle","danger"]),S=(0,o.useState)(!1),N=S[0],T=S[1],_=function(e){if(!N)return"start"===e&&g?(0,n.jsx)("span",h({className:(0,i.Z)("btn-icon","start-icon")},{children:g}),void 0):"end"===e&&b?(0,n.jsx)("span",h({className:(0,i.Z)("btn-icon","end-icon")},{children:b}),void 0):null;if("object"==typeof j){var r=j.delay||0;setTimeout((function(){return T(!1)}),r)}return"start"===e?(0,n.jsx)("span",h({className:"btn-icon loading-icon"},{children:(0,n.jsx)(l(),{},void 0)}),void 0):null},Y=(0,n.jsx)(a.Button,h({},C,{color:"default",variant:"contained",disabled:v,disableRipple:!0,disableElevation:!0,className:(0,i.Z)("paraui-button",d,"paraui-button-".concat(t),"paraui-button-".concat(u),N&&"paraui-button-loading",w&&!v&&"paraui-button-dangerous"),startIcon:_("start"),endIcon:_("end")},{children:y}),void 0);return(0,o.useEffect)((function(){T(!!j)}),[j]),v&&O?(0,n.jsx)(p.default,h({title:function(){if(v&&O){return(0,n.jsxs)("span",{children:[(0,n.jsx)(s(),{style:{marginRight:"4px",fontSize:"11px",color:"inherit"}},void 0),O]},void 0)}return O}()},{children:(0,n.jsx)("span",h({className:"paraui-button--disabled"},{children:Y}),void 0)}),void 0):Y};y.IconButton=function(e){var r=e.variant,t=void 0===r?"contained":r,c=e.size,u=void 0===c?"large":c,d=e.toolTipTitle,f=void 0===d?"":d,v=e.children,y=e.className,g=e.disabled,b=void 0!==g&&g,x=e.loading,j=void 0!==x&&x,k=e.TooltipProps,O=e.danger,P=void 0!==O&&O,w=m(e,["variant","size","toolTipTitle","children","className","disabled","loading","TooltipProps","danger"]),C=(0,o.useState)(!1),S=C[0],N=C[1],T=(0,n.jsx)(a.IconButton,h({},w,{disabled:b,disableRipple:!0,className:(0,i.Z)("paraui-icon-button",y,"paraui-icon-button-".concat(t),"paraui-icon-button-".concat(u),S&&"paraui-icon-button-loading",P&&!b&&"paraui-icon-button-dangerous")},{children:function(){if(!S)return v;if("object"==typeof j){var e=j.delay||0;setTimeout((function(){return N(!1)}),e)}return(0,n.jsx)("span",h({className:"loading-icon"},{children:(0,n.jsx)(l(),{},void 0)}),void 0)}()}),void 0);return(0,o.useEffect)((function(){N(!!j)}),[j]),f?(0,n.jsx)(p.default,h({},k,{title:function(){if(b&&f){return(0,n.jsxs)("span",{children:[(0,n.jsx)(s(),{style:{marginRight:"4px",fontSize:"11px",color:"inherit"}},void 0),f]},void 0)}return f}()},{children:b?(0,n.jsx)("span",h({className:"paraui-button--disabled"},{children:T}),void 0):T}),void 0):T},y.SplitButton=function(e){var r=e.buttonText,t=e.options,c=void 0===t?[]:t,l=e.className,u=e.disabled,s=void 0!==u&&u,p=e.onClick,d=e.optionRender,h=(0,o.useState)(!1),m=h[0],y=h[1],b=(0,o.useRef)(null),x=(0,o.useRef)(),j=(0,o.useState)(0),k=j[0],O=j[1],P=function(e,r,t){var n;O(r),y(!1),null===(n=x.current)||void 0===n||n.classList.remove("paraui-button-split--active"),null==p||p(e,t)},w=function(e){var r,t;(null===(r=b.current)||void 0===r?void 0:r.contains(e.target))||(y(!1),null===(t=x.current)||void 0===t||t.classList.remove("paraui-button-split--active"))},C=function(){return(0,n.jsx)("div",v({className:"paraui-button-split-list"},{children:(0,n.jsx)("ul",{children:c.map((function(e,r){return Array.isArray(e)?function(e,r){return(0,n.jsx)("li",v({className:"split-li-group"},{children:e.map((function(e,t){var o="".concat(r,"-").concat(t);return(0,n.jsx)("div",v({className:(0,i.Z)("split-li",o===k&&"split-li--active"),onClick:function(r){return P(e,o,r)}},{children:(null==d?void 0:d(e))||e.label}),o)}))}),r)}(e,r):(0,n.jsx)("li",v({className:(0,i.Z)("split-li",r===k&&"split-li--active"),onClick:function(t){return P(e,r,t)}},{children:(null==d?void 0:d(e))||e.label}),r)}))},void 0)}),void 0)};return(0,n.jsxs)("div",v({className:(0,i.Z)("paraui-button-split",l),ref:b,onMouseLeave:function(e){var r;e.stopPropagation(),null===(r=e.currentTarget.firstElementChild)||void 0===r||r.classList.remove("paraui-button-split--active"),y(!1)}},{children:[(0,n.jsx)(g,v({variant:"outlined",onMouseEnter:function(e){e.stopPropagation();var r=e.currentTarget;x.current=r,r.classList.add("paraui-button-split--active"),y(!0)},startIcon:(0,n.jsx)(f(),{},void 0),disabled:s},{children:null!=r?r:"更多操作"}),void 0),(0,n.jsx)(a.Popper,v({open:m,anchorEl:b.current,transition:!0,placement:"bottom-end"},{children:function(e){var r=e.TransitionProps;e.placement;return(0,n.jsx)(a.Grow,v({},r,{children:(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(a.ClickAwayListener,v({onClickAway:w},{children:C()}),void 0)},void 0)}),void 0)}}),void 0)]}),void 0)};var g=y},6779:function(e,r,t){"use strict";t.d(r,{default:function(){return V}});var n=t(4466),o=t(7712),a=t(2990),i=function(){return i=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},i.apply(this,arguments)};var c=t(1731),l=function(){return l=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},l.apply(this,arguments)};var u=t(9297),s=t.n(u),p=t(4927),d=t(4016),f=t.n(d),v=t(20),h=t.n(v),m=t(6088),y=t.n(m),g=t(8239),b=t.n(g),x=t(1545),j=t.n(x),k=function(){return k=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},k.apply(this,arguments)};function O(e,r,t){return void 0!==t?t:"year"===e&&r.lang.yearPlaceholder?r.lang.yearPlaceholder:"quarter"===e&&r.lang.quarterPlaceholder?r.lang.quarterPlaceholder:"month"===e&&r.lang.monthPlaceholder?r.lang.monthPlaceholder:"week"===e&&r.lang.weekPlaceholder?r.lang.weekPlaceholder:"time"===e&&r.timePickerLocale.placeholder?r.timePickerLocale.placeholder:r.lang.placeholder}function P(e,r,t){return void 0!==t?t:"year"===e&&r.lang.yearPlaceholder?r.lang.rangeYearPlaceholder:"month"===e&&r.lang.monthPlaceholder?r.lang.rangeMonthPlaceholder:"week"===e&&r.lang.weekPlaceholder?r.lang.rangeWeekPlaceholder:"time"===e&&r.timePickerLocale.placeholder?r.timePickerLocale.rangePlaceholder:r.lang.rangePlaceholder}function w(e,r){return r||(e?"paraui-".concat(e):"paraui")}function C(e){var r,t=e.format,n=e.picker,o=e.showHour,a=e.showMinute,i=e.showSecond,c=e.use12Hours,l=(r=t,r?Array.isArray(r)?r:[r]:[])[0],u=k({},e);return l&&"string"==typeof l&&(l.includes("s")||void 0!==i||(u.showSecond=!1),l.includes("m")||void 0!==a||(u.showMinute=!1),l.includes("H")||l.includes("h")||void 0!==o||(u.showHour=!1),(l.includes("a")||l.includes("A"))&&void 0===c&&(u.use12Hours=!0)),"time"===n?u:("function"==typeof l&&delete u.format,{showTime:u})}var S,N=(S=function(e,r){return S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])},S(e,r)},function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function t(){this.constructor=e}S(e,r),e.prototype=null===r?Object.create(r):(t.prototype=r.prototype,new t)}),T=function(){return T=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},T.apply(this,arguments)},_=function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)r.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(t[n[o]]=e[n[o]])}return t};var Y=t(2888),D=t.n(Y),M=function(){var e=function(r,t){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])},e(r,t)};return function(r,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}(),R=function(){return R=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},R.apply(this,arguments)},I=function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)r.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(t[n[o]]=e[n[o]])}return t};var q=t(1482),F={placeholder:"请选择时间",rangePlaceholder:["开始时间","结束时间"]},E=function(){return E=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},E.apply(this,arguments)},Z={lang:E(E({placeholder:"请选择日期",yearPlaceholder:"请选择年份",quarterPlaceholder:"请选择季度",monthPlaceholder:"请选择月份",weekPlaceholder:"请选择周",rangePlaceholder:["开始日期","结束日期"],rangeYearPlaceholder:["开始年份","结束年份"],rangeMonthPlaceholder:["开始月份","结束月份"],rangeWeekPlaceholder:["开始周","结束周"]},q.Z),{today:"选择今天",now:"当前时间",ok:"确 定"}),timePickerLocale:E({},F)},L=t(3877),W={placeholder:"Select time",rangePlaceholder:["Start time","End time"]},z=function(){return z=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},z.apply(this,arguments)},H={lang:z({placeholder:"Select date",yearPlaceholder:"Select year",quarterPlaceholder:"Select quarter",monthPlaceholder:"Select month",weekPlaceholder:"Select week",rangePlaceholder:["Start date","End date"],rangeYearPlaceholder:["Start year","End year"],rangeMonthPlaceholder:["Start month","End month"],rangeWeekPlaceholder:["Start week","End week"]},L.Z),timePickerLocale:z({},W)},A={button:function(e){return(0,o.jsx)(a.default,i({},e,{size:"small",variant:"contained"}),void 0)},rangeItem:function(e){return(0,o.jsx)(c.Chip,l({},e),void 0)}},U={zh:Z,en:H};var B=function(e){var r=function(e){function r(r,t){var n=function(t){function n(n){var a=t.call(this,n)||this;return a.pickerRef=s().createRef(),a.focus=function(){a.pickerRef.current&&a.pickerRef.current.focus()},a.blur=function(){a.pickerRef.current&&a.pickerRef.current.blur()},a.renderPicker=function(t){var n,i=a.props,c=i.prefixCls,l=i.className,u=(i.size,i.bordered),s=void 0===u||u,d=i.placeholder,v=i.error,m=void 0!==v&&v,g=i.helperText,x=_(i,["prefixCls","className","size","bordered","placeholder","error","helperText"]),k=a.props,P=k.format,S=k.showTime,N=k.use12Hours,Y=w("picker",c),D={};r&&(D.picker=r);var M=r||a.props.picker;return D=T(T(T({},D),S?C(T({format:P,picker:M},S)):{}),"time"===M?C(T(T({format:P},a.props),{picker:M})):{}),console.log(x),(0,o.jsxs)("div",T({className:(0,p.Z)("paraui-picker-wrapper")},{children:[(0,o.jsx)(f(),T({ref:a.pickerRef,placeholder:O(M,t,d),suffixIcon:"time"===M?(0,o.jsx)(j(),{},void 0):(0,o.jsx)(b(),{},void 0),clearIcon:"time"===M?(0,o.jsx)(y(),{},void 0):(0,o.jsx)(h(),{},void 0),allowClear:!0},{showToday:!0},x,D,{locale:t.lang,className:(0,p.Z)((n={},n["".concat(Y,"-borderless")]=!s,n["paraui-picker-error"]=m,n),l),prefixCls:Y,generateConfig:e,prevIcon:(0,o.jsx)("span",{className:"".concat(Y,"-prev-icon")},void 0),nextIcon:(0,o.jsx)("span",{className:"".concat(Y,"-next-icon")},void 0),superPrevIcon:(0,o.jsx)("span",{className:"".concat(Y,"-super-prev-icon")},void 0),superNextIcon:(0,o.jsx)("span",{className:"".concat(Y,"-super-next-icon")},void 0),components:A,direction:"ltr",dropdownClassName:(0,p.Z)(x.dropdownClassName,N&&"paraui-picker-use12Hours")}),void 0),g?(0,o.jsx)("p",T({className:"paraui-picker-helperText"},{children:g}),void 0):null]}),void 0)},a}return N(n,t),n.prototype.render=function(){var e=U[this.props.locale||"zh"];return(0,o.jsx)(o.Fragment,{children:this.renderPicker(e)},void 0)},n}(s().Component);return n}return{DatePicker:r(),WeekPicker:r("week"),MonthPicker:r("month"),YearPicker:r("year"),TimePicker:r("time"),QuarterPicker:r("quarter")}}(e),t=r.DatePicker,n=r.WeekPicker,a=r.MonthPicker,i=r.YearPicker,c=r.TimePicker,l=r.QuarterPicker,u=function(e){var r=function(r){function t(){var t=null!==r&&r.apply(this,arguments)||this;return t.pickerRef=s().createRef(),t.focus=function(){t.pickerRef.current&&t.pickerRef.current.focus()},t.blur=function(){t.pickerRef.current&&t.pickerRef.current.blur()},t.renderPicker=function(r){var n,a=t.props,i=a.prefixCls,c=a.className,l=(a.size,a.bordered),u=void 0===l||l,s=a.placeholder,f=a.error,v=void 0!==f&&f,m=a.helperText,g=I(a,["prefixCls","className","size","bordered","placeholder","error","helperText"]),x=t.props,k=x.format,O=x.showTime,S=x.picker,N=x.use12Hours,T=w("picker",i),_={};return _=R(R(R({},_),O?C(R({format:k,picker:S},O)):{}),"time"===S?C(R(R({format:k},t.props),{picker:S})):{}),(0,o.jsxs)("div",R({className:(0,p.Z)("paraui-picker-wrapper")},{children:[(0,o.jsx)(d.RangePicker,R({separator:(0,o.jsx)("span",R({"aria-label":"to",className:"".concat(T,"-separator")},{children:(0,o.jsx)(D(),{},void 0)}),void 0),ref:t.pickerRef,placeholder:P(S,r,s),suffixIcon:"time"===S?(0,o.jsx)(j(),{},void 0):(0,o.jsx)(b(),{className:"picker-icon"},void 0),clearIcon:"time"===S?(0,o.jsx)(y(),{},void 0):(0,o.jsx)(h(),{},void 0),allowClear:!0},g,_,{className:(0,p.Z)((n={},n["".concat(T,"-borderless")]=!u,n["paraui-picker-error"]=v,n),c),locale:r.lang,prefixCls:T,generateConfig:e,prevIcon:(0,o.jsx)("span",{className:"".concat(T,"-prev-icon")},void 0),nextIcon:(0,o.jsx)("span",{className:"".concat(T,"-next-icon")},void 0),superPrevIcon:(0,o.jsx)("span",{className:"".concat(T,"-super-prev-icon")},void 0),superNextIcon:(0,o.jsx)("span",{className:"".concat(T,"-super-next-icon")},void 0),components:A,direction:"ltr",dropdownClassName:(0,p.Z)(g.dropdownClassName,N&&"paraui-picker-use12Hours")}),void 0),m?(0,o.jsx)("p",R({className:"paraui-picker-helperText"},{children:m}),void 0):null]}),void 0)},t}return M(t,r),t.prototype.render=function(){var e=U[this.props.locale||"zh"];return(0,o.jsx)(o.Fragment,{children:this.renderPicker(e)},void 0)},t}(s().Component);return r}(e),v=t;return v.WeekPicker=n,v.MonthPicker=a,v.YearPicker=i,v.RangePicker=u,v.TimePicker=c,v.QuarterPicker=l,v},V=B(n.Z)},319:function(e,r,t){"use strict";t.r(r);var n=t(7712),o=t(9297),a=t(6779),i=function(){return i=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},i.apply(this,arguments)},c=function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)r.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(t[n[o]]=e[n[o]])}return t},l=a.default.TimePicker,u=a.default.RangePicker,s=o.forwardRef((function(e,r){return(0,n.jsx)(u,i({},e,{dropdownClassName:e.popupClassName,picker:"time",mode:void 0,ref:r}),void 0)})),p=o.forwardRef((function(e,r){var t=e.addon,a=e.renderExtraFooter,u=e.popupClassName,s=c(e,["addon","renderExtraFooter","popupClassName"]),p=o.useMemo((function(){return a||(t||void 0)}),[t,a]);return(0,n.jsx)(l,i({},s,{dropdownClassName:u,mode:void 0,ref:r,renderExtraFooter:p}),void 0)}));p.displayName="TimePicker",p.TimeRangePicker=s,r.default=p},6885:function(e,r,t){"use strict";var n=t(7712),o=t(1731),a=t(4927),i=function(){return i=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},i.apply(this,arguments)};r.default=function(e){var r,t=i(i({},e.classes),{popper:(0,a.Z)("paraui-tooltip",null===(r=e.classes)||void 0===r?void 0:r.popper)});return(0,n.jsx)(o.Tooltip,i({},e,{classes:t},{children:e.children}),void 0)}},1731:function(r){"use strict";r.exports=e},8239:function(e){"use strict";e.exports=r},6088:function(e){"use strict";e.exports=t},20:function(e){"use strict";e.exports=n},6028:function(e){"use strict";e.exports=o},2749:function(e){"use strict";e.exports=a},1102:function(e){"use strict";e.exports=i},2888:function(e){"use strict";e.exports=c},1545:function(e){"use strict";e.exports=l},5295:function(e){"use strict";e.exports=u},4016:function(e){"use strict";e.exports=s},9297:function(e){"use strict";e.exports=p}},v={};function h(e){var r=v[e];if(void 0!==r)return r.exports;var t=v[e]={exports:{}};return f[e](t,t.exports,h),t.exports}h.m=f,d=[],h.O=function(e,r,t,n){if(!r){var o=1/0;for(c=0;c<d.length;c++){r=d[c][0],t=d[c][1],n=d[c][2];for(var a=!0,i=0;i<r.length;i++)(!1&n||o>=n)&&Object.keys(h.O).every((function(e){return h.O[e](r[i])}))?r.splice(i--,1):(a=!1,n<o&&(o=n));a&&(d.splice(c--,1),e=t())}return e}n=n||0;for(var c=d.length;c>0&&d[c-1][2]>n;c--)d[c]=d[c-1];d[c]=[r,t,n]},h.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return h.d(r,{a:r}),r},h.d=function(e,r){for(var t in r)h.o(r,t)&&!h.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},h.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},h.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e={7088:0,6615:0,5821:0,2823:0,9296:0};h.O.j=function(r){return 0===e[r]};var r=function(r,t){var n,o,a=t[0],i=t[1],c=t[2],l=0;for(n in i)h.o(i,n)&&(h.m[n]=i[n]);if(c)var u=c(h);for(r&&r(t);l<a.length;l++)o=a[l],h.o(e,o)&&e[o]&&e[o][0](),e[a[l]]=0;return h.O(u)},t=self.webpackChunkParaUI=self.webpackChunkParaUI||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))}();var m=h.O(void 0,[9296],(function(){return h(319)}));return m=h.O(m)}()}));
|
|
14
|
+
*/t(4126);var n=t(9297),o=60103;if(r.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var a=Symbol.for;o=a("react.element"),r.Fragment=a("react.fragment")}var i=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c=Object.prototype.hasOwnProperty,l={key:!0,ref:!0,__self:!0,__source:!0};function u(e,r,t){var n,a={},u=null,s=null;for(n in void 0!==t&&(u=""+t),void 0!==r.key&&(u=""+r.key),void 0!==r.ref&&(s=r.ref),r)c.call(r,n)&&!l.hasOwnProperty(n)&&(a[n]=r[n]);if(e&&e.defaultProps)for(n in r=e.defaultProps)void 0===a[n]&&(a[n]=r[n]);return{$$typeof:o,type:e,key:u,ref:s,props:a,_owner:i.current}}r.jsx=u,r.jsxs=u},7712:function(e,r,t){"use strict";e.exports=t(9524)},2990:function(e,r,t){"use strict";t.d(r,{default:function(){return g}});var n=t(7712),o=t(9297),a=t(1731),i=t(4927),c=t(1102),l=t.n(c),u=t(2749),s=t.n(u),p=t(6885),d=t(6028),f=t.n(d),v=function(){return v=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},v.apply(this,arguments)};var h=function(){return h=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},h.apply(this,arguments)},m=function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)r.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(t[n[o]]=e[n[o]])}return t},y=function(e){var r=e.variant,t=void 0===r?"contained":r,c=e.size,u=void 0===c?"large":c,d=e.className,f=e.disabled,v=void 0!==f&&f,y=e.children,g=e.startIcon,b=e.endIcon,x=e.loading,j=void 0!==x&&x,k=e.toolTipTitle,O=void 0===k?"":k,P=e.danger,w=void 0!==P&&P,C=m(e,["variant","size","className","disabled","children","startIcon","endIcon","loading","toolTipTitle","danger"]),S=(0,o.useState)(!1),N=S[0],T=S[1],_=function(e){if(!N)return"start"===e&&g?(0,n.jsx)("span",h({className:(0,i.Z)("btn-icon","start-icon")},{children:g}),void 0):"end"===e&&b?(0,n.jsx)("span",h({className:(0,i.Z)("btn-icon","end-icon")},{children:b}),void 0):null;if("object"==typeof j){var r=j.delay||0;setTimeout((function(){return T(!1)}),r)}return"start"===e?(0,n.jsx)("span",h({className:"btn-icon loading-icon"},{children:(0,n.jsx)(l(),{},void 0)}),void 0):null},Y=(0,n.jsx)(a.Button,h({},C,{color:"default",variant:"contained",disabled:v,disableRipple:!0,disableElevation:!0,className:(0,i.Z)("paraui-button",d,"paraui-button-".concat(t),"paraui-button-".concat(u),N&&"paraui-button-loading",w&&!v&&"paraui-button-dangerous"),startIcon:_("start"),endIcon:_("end")},{children:y}),void 0);return(0,o.useEffect)((function(){T(!!j)}),[j]),v&&O?(0,n.jsx)(p.default,h({title:function(){if(v&&O){return(0,n.jsxs)("span",{children:[(0,n.jsx)(s(),{style:{marginRight:"4px",fontSize:"11px",color:"inherit"}},void 0),O]},void 0)}return O}()},{children:(0,n.jsx)("span",h({className:"paraui-button--disabled"},{children:Y}),void 0)}),void 0):Y};y.IconButton=function(e){var r=e.variant,t=void 0===r?"contained":r,c=e.size,u=void 0===c?"large":c,d=e.toolTipTitle,f=void 0===d?"":d,v=e.children,y=e.className,g=e.disabled,b=void 0!==g&&g,x=e.loading,j=void 0!==x&&x,k=e.TooltipProps,O=e.danger,P=void 0!==O&&O,w=m(e,["variant","size","toolTipTitle","children","className","disabled","loading","TooltipProps","danger"]),C=(0,o.useState)(!1),S=C[0],N=C[1],T=(0,n.jsx)(a.IconButton,h({},w,{disabled:b,disableRipple:!0,className:(0,i.Z)("paraui-icon-button",y,"paraui-icon-button-".concat(t),"paraui-icon-button-".concat(u),S&&"paraui-icon-button-loading",P&&!b&&"paraui-icon-button-dangerous")},{children:function(){if(!S)return v;if("object"==typeof j){var e=j.delay||0;setTimeout((function(){return N(!1)}),e)}return(0,n.jsx)("span",h({className:"loading-icon"},{children:(0,n.jsx)(l(),{},void 0)}),void 0)}()}),void 0);return(0,o.useEffect)((function(){N(!!j)}),[j]),f?(0,n.jsx)(p.default,h({},k,{title:function(){if(b&&f){return(0,n.jsxs)("span",{children:[(0,n.jsx)(s(),{style:{marginRight:"4px",fontSize:"11px",color:"inherit"}},void 0),f]},void 0)}return f}()},{children:b?(0,n.jsx)("span",h({className:"paraui-button--disabled"},{children:T}),void 0):T}),void 0):T},y.SplitButton=function(e){var r=e.buttonText,t=e.options,c=void 0===t?[]:t,l=e.className,u=e.disabled,s=void 0!==u&&u,p=e.onClick,d=e.optionRender,h=(0,o.useState)(!1),m=h[0],y=h[1],b=(0,o.useRef)(null),x=(0,o.useRef)(),j=(0,o.useState)(0),k=j[0],O=j[1],P=function(e,r,t){var n;O(r),y(!1),null===(n=x.current)||void 0===n||n.classList.remove("paraui-button-split--active"),null==p||p(e,t)},w=function(e){var r,t;(null===(r=b.current)||void 0===r?void 0:r.contains(e.target))||(y(!1),null===(t=x.current)||void 0===t||t.classList.remove("paraui-button-split--active"))},C=function(){return(0,n.jsx)("div",v({className:"paraui-button-split-list"},{children:(0,n.jsx)("ul",{children:c.map((function(e,r){return Array.isArray(e)?function(e,r){return(0,n.jsx)("li",v({className:"split-li-group"},{children:e.map((function(e,t){var o="".concat(r,"-").concat(t);return(0,n.jsx)("div",v({className:(0,i.Z)("split-li",o===k&&"split-li--active"),onClick:function(r){return P(e,o,r)}},{children:(null==d?void 0:d(e))||e.label}),o)}))}),r)}(e,r):(0,n.jsx)("li",v({className:(0,i.Z)("split-li",r===k&&"split-li--active"),onClick:function(t){return P(e,r,t)}},{children:(null==d?void 0:d(e))||e.label}),r)}))},void 0)}),void 0)};return(0,n.jsxs)("div",v({className:(0,i.Z)("paraui-button-split",l),ref:b,onMouseLeave:function(e){var r;e.stopPropagation(),null===(r=e.currentTarget.firstElementChild)||void 0===r||r.classList.remove("paraui-button-split--active"),y(!1)}},{children:[(0,n.jsx)(g,v({variant:"outlined",onMouseEnter:function(e){e.stopPropagation();var r=e.currentTarget;x.current=r,r.classList.add("paraui-button-split--active"),y(!0)},startIcon:(0,n.jsx)(f(),{},void 0),disabled:s},{children:null!=r?r:"更多操作"}),void 0),(0,n.jsx)(a.Popper,v({open:m,anchorEl:b.current,transition:!0,placement:"bottom-end"},{children:function(e){var r=e.TransitionProps;e.placement;return(0,n.jsx)(a.Grow,v({},r,{children:(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(a.ClickAwayListener,v({onClickAway:w},{children:C()}),void 0)},void 0)}),void 0)}}),void 0)]}),void 0)};var g=y},6779:function(e,r,t){"use strict";t.d(r,{default:function(){return V}});var n=t(4466),o=t(7712),a=t(2990),i=function(){return i=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},i.apply(this,arguments)};var c=t(1731),l=function(){return l=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},l.apply(this,arguments)};var u=t(9297),s=t.n(u),p=t(4927),d=t(4016),f=t.n(d),v=t(20),h=t.n(v),m=t(6088),y=t.n(m),g=t(8239),b=t.n(g),x=t(1545),j=t.n(x),k=function(){return k=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},k.apply(this,arguments)};function O(e,r,t){return void 0!==t?t:"year"===e&&r.lang.yearPlaceholder?r.lang.yearPlaceholder:"quarter"===e&&r.lang.quarterPlaceholder?r.lang.quarterPlaceholder:"month"===e&&r.lang.monthPlaceholder?r.lang.monthPlaceholder:"week"===e&&r.lang.weekPlaceholder?r.lang.weekPlaceholder:"time"===e&&r.timePickerLocale.placeholder?r.timePickerLocale.placeholder:r.lang.placeholder}function P(e,r,t){return void 0!==t?t:"year"===e&&r.lang.yearPlaceholder?r.lang.rangeYearPlaceholder:"month"===e&&r.lang.monthPlaceholder?r.lang.rangeMonthPlaceholder:"week"===e&&r.lang.weekPlaceholder?r.lang.rangeWeekPlaceholder:"time"===e&&r.timePickerLocale.placeholder?r.timePickerLocale.rangePlaceholder:r.lang.rangePlaceholder}function w(e,r){return r||(e?"paraui-".concat(e):"paraui")}function C(e){var r,t=e.format,n=e.picker,o=e.showHour,a=e.showMinute,i=e.showSecond,c=e.use12Hours,l=(r=t,r?Array.isArray(r)?r:[r]:[])[0],u=k({},e);return l&&"string"==typeof l&&(l.includes("s")||void 0!==i||(u.showSecond=!1),l.includes("m")||void 0!==a||(u.showMinute=!1),l.includes("H")||l.includes("h")||void 0!==o||(u.showHour=!1),(l.includes("a")||l.includes("A"))&&void 0===c&&(u.use12Hours=!0)),"time"===n?u:("function"==typeof l&&delete u.format,{showTime:u})}var S,N=(S=function(e,r){return S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])},S(e,r)},function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function t(){this.constructor=e}S(e,r),e.prototype=null===r?Object.create(r):(t.prototype=r.prototype,new t)}),T=function(){return T=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},T.apply(this,arguments)},_=function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)r.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(t[n[o]]=e[n[o]])}return t};var Y=t(2888),D=t.n(Y),M=function(){var e=function(r,t){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])},e(r,t)};return function(r,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}(),R=function(){return R=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},R.apply(this,arguments)},I=function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)r.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(t[n[o]]=e[n[o]])}return t};var q=t(1482),F={placeholder:"请选择时间",rangePlaceholder:["开始时间","结束时间"]},E=function(){return E=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},E.apply(this,arguments)},Z={lang:E(E({placeholder:"请选择日期",yearPlaceholder:"请选择年份",quarterPlaceholder:"请选择季度",monthPlaceholder:"请选择月份",weekPlaceholder:"请选择周",rangePlaceholder:["开始日期","结束日期"],rangeYearPlaceholder:["开始年份","结束年份"],rangeMonthPlaceholder:["开始月份","结束月份"],rangeWeekPlaceholder:["开始周","结束周"]},q.Z),{today:"选择今天",now:"当前时间",ok:"确 定"}),timePickerLocale:E({},F)},L=t(3877),W={placeholder:"Select time",rangePlaceholder:["Start time","End time"]},z=function(){return z=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},z.apply(this,arguments)},H={lang:z({placeholder:"Select date",yearPlaceholder:"Select year",quarterPlaceholder:"Select quarter",monthPlaceholder:"Select month",weekPlaceholder:"Select week",rangePlaceholder:["Start date","End date"],rangeYearPlaceholder:["Start year","End year"],rangeMonthPlaceholder:["Start month","End month"],rangeWeekPlaceholder:["Start week","End week"]},L.Z),timePickerLocale:z({},W)},A={button:function(e){return(0,o.jsx)(a.default,i({},e,{size:"small",variant:"contained"}),void 0)},rangeItem:function(e){return(0,o.jsx)(c.Chip,l({},e),void 0)}},U={zh:Z,en:H};var B=function(e){var r=function(e){function r(r,t){var n=function(t){function n(n){var a=t.call(this,n)||this;return a.pickerRef=s().createRef(),a.focus=function(){a.pickerRef.current&&a.pickerRef.current.focus()},a.blur=function(){a.pickerRef.current&&a.pickerRef.current.blur()},a.renderPicker=function(t){var n,i=a.props,c=i.prefixCls,l=i.className,u=(i.size,i.bordered),s=void 0===u||u,d=i.placeholder,v=i.error,m=void 0!==v&&v,g=i.helperText,x=_(i,["prefixCls","className","size","bordered","placeholder","error","helperText"]),k=a.props,P=k.format,S=k.showTime,N=k.use12Hours,Y=w("picker",c),D={};r&&(D.picker=r);var M=r||a.props.picker;return D=T(T(T({},D),S?C(T({format:P,picker:M},S)):{}),"time"===M?C(T(T({format:P},a.props),{picker:M})):{}),console.log(x),(0,o.jsxs)("div",T({className:(0,p.Z)("paraui-picker-wrapper")},{children:[(0,o.jsx)(f(),T({ref:a.pickerRef,placeholder:O(M,t,d),suffixIcon:"time"===M?(0,o.jsx)(j(),{},void 0):(0,o.jsx)(b(),{},void 0),clearIcon:"time"===M?(0,o.jsx)(y(),{},void 0):(0,o.jsx)(h(),{},void 0),allowClear:!0},{showToday:!0},x,D,{locale:t.lang,className:(0,p.Z)((n={},n["".concat(Y,"-borderless")]=!s,n["paraui-picker-error"]=m,n),l),prefixCls:Y,generateConfig:e,prevIcon:(0,o.jsx)("span",{className:"".concat(Y,"-prev-icon")},void 0),nextIcon:(0,o.jsx)("span",{className:"".concat(Y,"-next-icon")},void 0),superPrevIcon:(0,o.jsx)("span",{className:"".concat(Y,"-super-prev-icon")},void 0),superNextIcon:(0,o.jsx)("span",{className:"".concat(Y,"-super-next-icon")},void 0),components:A,direction:"ltr",dropdownClassName:(0,p.Z)(x.dropdownClassName,N&&"paraui-picker-use12Hours")}),void 0),g?(0,o.jsx)("p",T({className:"paraui-picker-helperText"},{children:g}),void 0):null]}),void 0)},a}return N(n,t),n.prototype.render=function(){var e=U[this.props.locale||"zh"];return(0,o.jsx)(o.Fragment,{children:this.renderPicker(e)},void 0)},n}(s().Component);return n}return{DatePicker:r(),WeekPicker:r("week"),MonthPicker:r("month"),YearPicker:r("year"),TimePicker:r("time"),QuarterPicker:r("quarter")}}(e),t=r.DatePicker,n=r.WeekPicker,a=r.MonthPicker,i=r.YearPicker,c=r.TimePicker,l=r.QuarterPicker,u=function(e){var r=function(r){function t(){var t=null!==r&&r.apply(this,arguments)||this;return t.pickerRef=s().createRef(),t.focus=function(){t.pickerRef.current&&t.pickerRef.current.focus()},t.blur=function(){t.pickerRef.current&&t.pickerRef.current.blur()},t.renderPicker=function(r){var n,a=t.props,i=a.prefixCls,c=a.className,l=(a.size,a.bordered),u=void 0===l||l,s=a.placeholder,f=a.error,v=void 0!==f&&f,m=a.helperText,g=I(a,["prefixCls","className","size","bordered","placeholder","error","helperText"]),x=t.props,k=x.format,O=x.showTime,S=x.picker,N=x.use12Hours,T=w("picker",i),_={};return _=R(R(R({},_),O?C(R({format:k,picker:S},O)):{}),"time"===S?C(R(R({format:k},t.props),{picker:S})):{}),(0,o.jsxs)("div",R({className:(0,p.Z)("paraui-picker-wrapper")},{children:[(0,o.jsx)(d.RangePicker,R({separator:(0,o.jsx)("span",R({"aria-label":"to",className:"".concat(T,"-separator")},{children:(0,o.jsx)(D(),{},void 0)}),void 0),ref:t.pickerRef,placeholder:P(S,r,s),suffixIcon:"time"===S?(0,o.jsx)(j(),{},void 0):(0,o.jsx)(b(),{className:"picker-icon"},void 0),clearIcon:"time"===S?(0,o.jsx)(y(),{},void 0):(0,o.jsx)(h(),{},void 0),allowClear:!0},g,_,{className:(0,p.Z)((n={},n["".concat(T,"-borderless")]=!u,n["paraui-picker-error"]=v,n),c),locale:r.lang,prefixCls:T,generateConfig:e,prevIcon:(0,o.jsx)("span",{className:"".concat(T,"-prev-icon")},void 0),nextIcon:(0,o.jsx)("span",{className:"".concat(T,"-next-icon")},void 0),superPrevIcon:(0,o.jsx)("span",{className:"".concat(T,"-super-prev-icon")},void 0),superNextIcon:(0,o.jsx)("span",{className:"".concat(T,"-super-next-icon")},void 0),components:A,direction:"ltr",dropdownClassName:(0,p.Z)(g.dropdownClassName,N&&"paraui-picker-use12Hours")}),void 0),m?(0,o.jsx)("p",R({className:"paraui-picker-helperText"},{children:m}),void 0):null]}),void 0)},t}return M(t,r),t.prototype.render=function(){var e=U[this.props.locale||"zh"];return(0,o.jsx)(o.Fragment,{children:this.renderPicker(e)},void 0)},t}(s().Component);return r}(e),v=t;return v.WeekPicker=n,v.MonthPicker=a,v.YearPicker=i,v.RangePicker=u,v.TimePicker=c,v.QuarterPicker=l,v},V=B(n.Z)},319:function(e,r,t){"use strict";t.r(r);var n=t(7712),o=t(9297),a=t(6779),i=function(){return i=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},i.apply(this,arguments)},c=function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)r.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(t[n[o]]=e[n[o]])}return t},l=a.default.TimePicker,u=a.default.RangePicker,s=o.forwardRef((function(e,r){return(0,n.jsx)(u,i({},e,{dropdownClassName:e.popupClassName,picker:"time",mode:void 0,ref:r}),void 0)})),p=o.forwardRef((function(e,r){var t=e.addon,a=e.renderExtraFooter,u=e.popupClassName,s=c(e,["addon","renderExtraFooter","popupClassName"]),p=o.useMemo((function(){return a||(t||void 0)}),[t,a]);return(0,n.jsx)(l,i({},s,{dropdownClassName:u,mode:void 0,ref:r,renderExtraFooter:p}),void 0)}));p.displayName="TimePicker",p.TimeRangePicker=s,r.default=p},6885:function(e,r,t){"use strict";var n=t(7712),o=t(1731),a=t(4927),i=function(){return i=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},i.apply(this,arguments)};r.default=function(e){var r,t=e.placement,c=void 0===t?"bottom":t,l=i(i({},e.classes),{popper:(0,a.Z)("paraui-tooltip",null===(r=e.classes)||void 0===r?void 0:r.popper,{"paraui-tooltip-left-right":(null==c?void 0:c.includes("left"))||(null==c?void 0:c.includes("right")),"paraui-tooltip-top-bottom":(null==c?void 0:c.includes("top"))||(null==c?void 0:c.includes("bottom"))})});return(0,n.jsx)(o.Tooltip,i({},e,{classes:l}),void 0)}},1731:function(r){"use strict";r.exports=e},8239:function(e){"use strict";e.exports=r},6088:function(e){"use strict";e.exports=t},20:function(e){"use strict";e.exports=n},6028:function(e){"use strict";e.exports=o},2749:function(e){"use strict";e.exports=a},1102:function(e){"use strict";e.exports=i},2888:function(e){"use strict";e.exports=c},1545:function(e){"use strict";e.exports=l},5295:function(e){"use strict";e.exports=u},4016:function(e){"use strict";e.exports=s},9297:function(e){"use strict";e.exports=p}},v={};function h(e){var r=v[e];if(void 0!==r)return r.exports;var t=v[e]={exports:{}};return f[e](t,t.exports,h),t.exports}h.m=f,d=[],h.O=function(e,r,t,n){if(!r){var o=1/0;for(c=0;c<d.length;c++){r=d[c][0],t=d[c][1],n=d[c][2];for(var a=!0,i=0;i<r.length;i++)(!1&n||o>=n)&&Object.keys(h.O).every((function(e){return h.O[e](r[i])}))?r.splice(i--,1):(a=!1,n<o&&(o=n));a&&(d.splice(c--,1),e=t())}return e}n=n||0;for(var c=d.length;c>0&&d[c-1][2]>n;c--)d[c]=d[c-1];d[c]=[r,t,n]},h.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return h.d(r,{a:r}),r},h.d=function(e,r){for(var t in r)h.o(r,t)&&!h.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},h.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},h.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e={7088:0,6615:0,5821:0,2823:0,9296:0};h.O.j=function(r){return 0===e[r]};var r=function(r,t){var n,o,a=t[0],i=t[1],c=t[2],l=0;for(n in i)h.o(i,n)&&(h.m[n]=i[n]);if(c)var u=c(h);for(r&&r(t);l<a.length;l++)o=a[l],h.o(e,o)&&e[o]&&e[o][0](),e[a[l]]=0;return h.O(u)},t=self.webpackChunkParaUI=self.webpackChunkParaUI||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))}();var m=h.O(void 0,[9296],(function(){return h(319)}));return m=h.O(m)}()}));
|
package/ToggleButton/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
!function(n
|
|
1
|
+
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("@material-ui/core"),require("@para-ui/icons/Down"),require("@para-ui/icons/Forbid"),require("@para-ui/icons/LoadingF"),require("para-lib"),require("react")):"function"==typeof define&&define.amd?define(["@material-ui/core","@para-ui/icons/Down","@para-ui/icons/Forbid","@para-ui/icons/LoadingF","para-lib","react"],n):"object"==typeof exports?exports.ParaUI=n(require("@material-ui/core"),require("@para-ui/icons/Down"),require("@para-ui/icons/Forbid"),require("@para-ui/icons/LoadingF"),require("para-lib"),require("react")):t.ParaUI=n(t["@material-ui/core"],t["@para-ui/icons/Down"],t["@para-ui/icons/Forbid"],t["@para-ui/icons/LoadingF"],t["para-lib"],t.react)}(self,(function(t,n,e,r,o,i){return function(){"use strict";var a,l={4927:function(t,n,e){function r(t){var n,e,o="";if("string"==typeof t||"number"==typeof t)o+=t;else if("object"==typeof t)if(Array.isArray(t))for(n=0;n<t.length;n++)t[n]&&(e=r(t[n]))&&(o&&(o+=" "),o+=e);else for(n in t)t[n]&&(o&&(o+=" "),o+=n);return o}function o(){for(var t,n,e=0,o="";e<arguments.length;)(t=arguments[e++])&&(n=r(t))&&(o&&(o+=" "),o+=n);return o}e.d(n,{Z:function(){return o}})},4126:function(t){
|
|
2
2
|
/*
|
|
3
3
|
object-assign
|
|
4
4
|
(c) Sindre Sorhus
|
|
5
5
|
@license MIT
|
|
6
6
|
*/
|
|
7
|
-
var
|
|
7
|
+
var n=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function o(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var n={},e=0;e<10;e++)n["_"+String.fromCharCode(e)]=e;if("0123456789"!==Object.getOwnPropertyNames(n).map((function(t){return n[t]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(t){r[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}}()?Object.assign:function(t,i){for(var a,l,u=o(t),c=1;c<arguments.length;c++){for(var s in a=Object(arguments[c]))e.call(a,s)&&(u[s]=a[s]);if(n){l=n(a);for(var d=0;d<l.length;d++)r.call(a,l[d])&&(u[l[d]]=a[l[d]])}}return u}},9524:function(t,n,e){
|
|
8
8
|
/** @license React v17.0.2
|
|
9
9
|
* react-jsx-runtime.production.min.js
|
|
10
10
|
*
|
|
@@ -13,4 +13,4 @@ var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,r=Object.pr
|
|
|
13
13
|
* This source code is licensed under the MIT license found in the
|
|
14
14
|
* LICENSE file in the root directory of this source tree.
|
|
15
15
|
*/
|
|
16
|
-
t(4126);var r=t(9297),i=60103;if(e.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var o=Symbol.for;i=o("react.element"),e.Fragment=o("react.fragment")}var a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l=Object.prototype.hasOwnProperty,u={key:!0,ref:!0,__self:!0,__source:!0};function c(n,e,t){var r,o={},c=null,s=null;for(r in void 0!==t&&(c=""+t),void 0!==e.key&&(c=""+e.key),void 0!==e.ref&&(s=e.ref),e)l.call(e,r)&&!u.hasOwnProperty(r)&&(o[r]=e[r]);if(n&&n.defaultProps)for(r in e=n.defaultProps)void 0===o[r]&&(o[r]=e[r]);return{$$typeof:i,type:n,key:c,ref:s,props:o,_owner:a.current}}e.jsx=c,e.jsxs=c},7712:function(n,e,t){n.exports=t(9524)},2990:function(n,e,t){t.d(e,{default:function(){return h}});var r=t(7712),i=t(9297),o=t(1731),a=t(4927),l=t(1102),u=t.n(l),c=t(2749),s=t.n(c),d=t(6885),p=t(6028),f=t.n(p),v=function(){return v=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var i in e=arguments[t])Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n},v.apply(this,arguments)};var b=function(){return b=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var i in e=arguments[t])Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n},b.apply(this,arguments)},y=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]])}return t},g=function(n){var e=n.variant,t=void 0===e?"contained":e,l=n.size,c=void 0===l?"large":l,p=n.className,f=n.disabled,v=void 0!==f&&f,g=n.children,h=n.startIcon,j=n.endIcon,m=n.loading,O=void 0!==m&&m,x=n.toolTipTitle,w=void 0===x?"":x,P=n.danger,N=void 0!==P&&P,S=y(n,["variant","size","className","disabled","children","startIcon","endIcon","loading","toolTipTitle","danger"]),T=(0,i.useState)(!1),_=T[0],k=T[1],E=function(n){if(!_)return"start"===n&&h?(0,r.jsx)("span",b({className:(0,a.Z)("btn-icon","start-icon")},{children:h}),void 0):"end"===n&&j?(0,r.jsx)("span",b({className:(0,a.Z)("btn-icon","end-icon")},{children:j}),void 0):null;if("object"==typeof O){var e=O.delay||0;setTimeout((function(){return k(!1)}),e)}return"start"===n?(0,r.jsx)("span",b({className:"btn-icon loading-icon"},{children:(0,r.jsx)(u(),{},void 0)}),void 0):null},I=(0,r.jsx)(o.Button,b({},S,{color:"default",variant:"contained",disabled:v,disableRipple:!0,disableElevation:!0,className:(0,a.Z)("paraui-button",p,"paraui-button-".concat(t),"paraui-button-".concat(c),_&&"paraui-button-loading",N&&!v&&"paraui-button-dangerous"),startIcon:E("start"),endIcon:E("end")},{children:g}),void 0);return(0,i.useEffect)((function(){k(!!O)}),[O]),v&&w?(0,r.jsx)(d.default,b({title:function(){if(v&&w){return(0,r.jsxs)("span",{children:[(0,r.jsx)(s(),{style:{marginRight:"4px",fontSize:"11px",color:"inherit"}},void 0),w]},void 0)}return w}()},{children:(0,r.jsx)("span",b({className:"paraui-button--disabled"},{children:I}),void 0)}),void 0):I};g.IconButton=function(n){var e=n.variant,t=void 0===e?"contained":e,l=n.size,c=void 0===l?"large":l,p=n.toolTipTitle,f=void 0===p?"":p,v=n.children,g=n.className,h=n.disabled,j=void 0!==h&&h,m=n.loading,O=void 0!==m&&m,x=n.TooltipProps,w=n.danger,P=void 0!==w&&w,N=y(n,["variant","size","toolTipTitle","children","className","disabled","loading","TooltipProps","danger"]),S=(0,i.useState)(!1),T=S[0],_=S[1],k=(0,r.jsx)(o.IconButton,b({},N,{disabled:j,disableRipple:!0,className:(0,a.Z)("paraui-icon-button",g,"paraui-icon-button-".concat(t),"paraui-icon-button-".concat(c),T&&"paraui-icon-button-loading",P&&!j&&"paraui-icon-button-dangerous")},{children:function(){if(!T)return v;if("object"==typeof O){var n=O.delay||0;setTimeout((function(){return _(!1)}),n)}return(0,r.jsx)("span",b({className:"loading-icon"},{children:(0,r.jsx)(u(),{},void 0)}),void 0)}()}),void 0);return(0,i.useEffect)((function(){_(!!O)}),[O]),f?(0,r.jsx)(d.default,b({},x,{title:function(){if(j&&f){return(0,r.jsxs)("span",{children:[(0,r.jsx)(s(),{style:{marginRight:"4px",fontSize:"11px",color:"inherit"}},void 0),f]},void 0)}return f}()},{children:j?(0,r.jsx)("span",b({className:"paraui-button--disabled"},{children:k}),void 0):k}),void 0):k},g.SplitButton=function(n){var e=n.buttonText,t=n.options,l=void 0===t?[]:t,u=n.className,c=n.disabled,s=void 0!==c&&c,d=n.onClick,p=n.optionRender,b=(0,i.useState)(!1),y=b[0],g=b[1],j=(0,i.useRef)(null),m=(0,i.useRef)(),O=(0,i.useState)(0),x=O[0],w=O[1],P=function(n,e,t){var r;w(e),g(!1),null===(r=m.current)||void 0===r||r.classList.remove("paraui-button-split--active"),null==d||d(n,t)},N=function(n){var e,t;(null===(e=j.current)||void 0===e?void 0:e.contains(n.target))||(g(!1),null===(t=m.current)||void 0===t||t.classList.remove("paraui-button-split--active"))},S=function(){return(0,r.jsx)("div",v({className:"paraui-button-split-list"},{children:(0,r.jsx)("ul",{children:l.map((function(n,e){return Array.isArray(n)?function(n,e){return(0,r.jsx)("li",v({className:"split-li-group"},{children:n.map((function(n,t){var i="".concat(e,"-").concat(t);return(0,r.jsx)("div",v({className:(0,a.Z)("split-li",i===x&&"split-li--active"),onClick:function(e){return P(n,i,e)}},{children:(null==p?void 0:p(n))||n.label}),i)}))}),e)}(n,e):(0,r.jsx)("li",v({className:(0,a.Z)("split-li",e===x&&"split-li--active"),onClick:function(t){return P(n,e,t)}},{children:(null==p?void 0:p(n))||n.label}),e)}))},void 0)}),void 0)};return(0,r.jsxs)("div",v({className:(0,a.Z)("paraui-button-split",u),ref:j,onMouseLeave:function(n){var e;n.stopPropagation(),null===(e=n.currentTarget.firstElementChild)||void 0===e||e.classList.remove("paraui-button-split--active"),g(!1)}},{children:[(0,r.jsx)(h,v({variant:"outlined",onMouseEnter:function(n){n.stopPropagation();var e=n.currentTarget;m.current=e,e.classList.add("paraui-button-split--active"),g(!0)},startIcon:(0,r.jsx)(f(),{},void 0),disabled:s},{children:null!=e?e:"更多操作"}),void 0),(0,r.jsx)(o.Popper,v({open:y,anchorEl:j.current,transition:!0,placement:"bottom-end"},{children:function(n){var e=n.TransitionProps;n.placement;return(0,r.jsx)(o.Grow,v({},e,{children:(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(o.ClickAwayListener,v({onClickAway:N},{children:S()}),void 0)},void 0)}),void 0)}}),void 0)]}),void 0)};var h=g},4284:function(n,e,t){t.r(e),t.d(e,{ToggleButton:function(){return f},ToggleButtonGroup:function(){return c},default:function(){return v}});var r=t(7712),i=t(9297),o=t(2990),a=t(4927),l=function(){return l=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var i in e=arguments[t])Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n},l.apply(this,arguments)},u=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]])}return t},c=function(n){var e=n.className,t=n.style,i=n.exclusive,o=void 0!==i&&i,c=n.data,s=n.value,d=n.onChange,p=(0,a.Z)("paraui-togglebutton-group",e),f=function(n,e){if(d){var t,r=s&&(null==s?void 0:s.indexOf(e));s&&r>=0?(t=s.slice()).splice(r,1):t=s?s.concat(e):[e],d(n,t)}},b=function(n,e){d&&d(n,s===e?null:e)};return(0,r.jsx)("div",l({className:p},{children:c&&(null==c?void 0:c.length)?c.map((function(n,e){var i=n.label,a=n.selected,c=u(n,["label","selected"]),d=void 0===a?function(n,e){return void 0!==e&&void 0!==n&&(Array.isArray(e)?e.includes(n):n===e)}(c.value,s):a;return(0,r.jsx)(v,l({},c,{style:t,selected:d,onClick:o?b:f},{children:i}),e)})):null}),void 0)},s=t(6885),d=t(3475),p=function(){return p=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var i in e=arguments[t])Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n},p.apply(this,arguments)},f=function(n){var e=n.className,t=n.style,l=n.children,u=n.disabled,c=void 0!==u&&u,f=n.selected,v=void 0!==f&&f,b=n.value,y=n.onClick,g=(0,i.useState)(!1),h=g[0],j=g[1],m=(0,i.useRef)((0,d.UUID)()).current,O=(0,a.Z)("paraui-toggle-button",e,{"paraui-toggle-button-selected":v,"paraui-toggle-button-disabled":c}),x=function(n){y&&y(n,b)};(0,i.useLayoutEffect)((function(){var n=document.querySelector('[data-id="'.concat(m,'"]'));if(n){var e=document.createElement("span");e.textContent=l,document.body.appendChild(e),e.offsetWidth>n.offsetWidth-32&&j(!0),null==e||e.remove()}}),[]);var w;return(0,r.jsx)(r.Fragment,{children:(w=(0,r.jsx)(o.default,p({"data-id":m,variant:"outlined",size:"medium",style:t,className:O,disabled:c,value:b,onClick:x},{children:(0,r.jsx)("span",p({className:"paraui-toggle-button-text"},{children:l}),void 0)}),void 0),h?(0,r.jsx)(s.default,p({title:l},{children:(0,r.jsx)("span",{children:w},void 0)}),void 0):w)},void 0)},v=f},6885:function(n,e,t){var r=t(7712),i=t(1731),o=t(4927),a=function(){return a=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var i in e=arguments[t])Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n},a.apply(this,arguments)};e.default=function(n){var e,t=a(a({},n.classes),{popper:(0,o.Z)("paraui-tooltip",null===(e=n.classes)||void 0===e?void 0:e.popper)});return(0,r.jsx)(i.Tooltip,a({},n,{classes:t},{children:n.children}),void 0)}},1731:function(e){e.exports=n},6028:function(n){n.exports=e},2749:function(n){n.exports=t},1102:function(n){n.exports=r},3475:function(n){n.exports=i},9297:function(n){n.exports=o}},u={};function c(n){var e=u[n];if(void 0!==e)return e.exports;var t=u[n]={exports:{}};return l[n](t,t.exports,c),t.exports}c.m=l,a=[],c.O=function(n,e,t,r){if(!e){var i=1/0;for(u=0;u<a.length;u++){e=a[u][0],t=a[u][1],r=a[u][2];for(var o=!0,l=0;l<e.length;l++)(!1&r||i>=r)&&Object.keys(c.O).every((function(n){return c.O[n](e[l])}))?e.splice(l--,1):(o=!1,r<i&&(i=r));o&&(a.splice(u--,1),n=t())}return n}r=r||0;for(var u=a.length;u>0&&a[u-1][2]>r;u--)a[u]=a[u-1];a[u]=[e,t,r]},c.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return c.d(e,{a:e}),e},c.d=function(n,e){for(var t in e)c.o(e,t)&&!c.o(n,t)&&Object.defineProperty(n,t,{enumerable:!0,get:e[t]})},c.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},c.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},function(){var n={7473:0,6615:0,2823:0,9296:0};c.O.j=function(e){return 0===n[e]};var e=function(e,t){var r,i,o=t[0],a=t[1],l=t[2],u=0;for(r in a)c.o(a,r)&&(c.m[r]=a[r]);if(l)var s=l(c);for(e&&e(t);u<o.length;u++)i=o[u],c.o(n,i)&&n[i]&&n[i][0](),n[o[u]]=0;return c.O(s)},t=self.webpackChunkParaUI=self.webpackChunkParaUI||[];t.forEach(e.bind(null,0)),t.push=e.bind(null,t.push.bind(t))}();var s=c.O(void 0,[9296],(function(){return c(4284)}));return s=c.O(s)}()}));
|
|
16
|
+
e(4126);var r=e(9297),o=60103;if(n.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var i=Symbol.for;o=i("react.element"),n.Fragment=i("react.fragment")}var a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l=Object.prototype.hasOwnProperty,u={key:!0,ref:!0,__self:!0,__source:!0};function c(t,n,e){var r,i={},c=null,s=null;for(r in void 0!==e&&(c=""+e),void 0!==n.key&&(c=""+n.key),void 0!==n.ref&&(s=n.ref),n)l.call(n,r)&&!u.hasOwnProperty(r)&&(i[r]=n[r]);if(t&&t.defaultProps)for(r in n=t.defaultProps)void 0===i[r]&&(i[r]=n[r]);return{$$typeof:o,type:t,key:c,ref:s,props:i,_owner:a.current}}n.jsx=c,n.jsxs=c},7712:function(t,n,e){t.exports=e(9524)},2990:function(t,n,e){e.d(n,{default:function(){return h}});var r=e(7712),o=e(9297),i=e(1731),a=e(4927),l=e(1102),u=e.n(l),c=e(2749),s=e.n(c),d=e(6885),p=e(6028),f=e.n(p),v=function(){return v=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t},v.apply(this,arguments)};var b=function(){return b=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t},b.apply(this,arguments)},y=function(t,n){var e={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&n.indexOf(r)<0&&(e[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(e[r[o]]=t[r[o]])}return e},g=function(t){var n=t.variant,e=void 0===n?"contained":n,l=t.size,c=void 0===l?"large":l,p=t.className,f=t.disabled,v=void 0!==f&&f,g=t.children,h=t.startIcon,j=t.endIcon,m=t.loading,O=void 0!==m&&m,x=t.toolTipTitle,w=void 0===x?"":x,P=t.danger,N=void 0!==P&&P,S=y(t,["variant","size","className","disabled","children","startIcon","endIcon","loading","toolTipTitle","danger"]),T=(0,o.useState)(!1),_=T[0],k=T[1],E=function(t){if(!_)return"start"===t&&h?(0,r.jsx)("span",b({className:(0,a.Z)("btn-icon","start-icon")},{children:h}),void 0):"end"===t&&j?(0,r.jsx)("span",b({className:(0,a.Z)("btn-icon","end-icon")},{children:j}),void 0):null;if("object"==typeof O){var n=O.delay||0;setTimeout((function(){return k(!1)}),n)}return"start"===t?(0,r.jsx)("span",b({className:"btn-icon loading-icon"},{children:(0,r.jsx)(u(),{},void 0)}),void 0):null},I=(0,r.jsx)(i.Button,b({},S,{color:"default",variant:"contained",disabled:v,disableRipple:!0,disableElevation:!0,className:(0,a.Z)("paraui-button",p,"paraui-button-".concat(e),"paraui-button-".concat(c),_&&"paraui-button-loading",N&&!v&&"paraui-button-dangerous"),startIcon:E("start"),endIcon:E("end")},{children:g}),void 0);return(0,o.useEffect)((function(){k(!!O)}),[O]),v&&w?(0,r.jsx)(d.default,b({title:function(){if(v&&w){return(0,r.jsxs)("span",{children:[(0,r.jsx)(s(),{style:{marginRight:"4px",fontSize:"11px",color:"inherit"}},void 0),w]},void 0)}return w}()},{children:(0,r.jsx)("span",b({className:"paraui-button--disabled"},{children:I}),void 0)}),void 0):I};g.IconButton=function(t){var n=t.variant,e=void 0===n?"contained":n,l=t.size,c=void 0===l?"large":l,p=t.toolTipTitle,f=void 0===p?"":p,v=t.children,g=t.className,h=t.disabled,j=void 0!==h&&h,m=t.loading,O=void 0!==m&&m,x=t.TooltipProps,w=t.danger,P=void 0!==w&&w,N=y(t,["variant","size","toolTipTitle","children","className","disabled","loading","TooltipProps","danger"]),S=(0,o.useState)(!1),T=S[0],_=S[1],k=(0,r.jsx)(i.IconButton,b({},N,{disabled:j,disableRipple:!0,className:(0,a.Z)("paraui-icon-button",g,"paraui-icon-button-".concat(e),"paraui-icon-button-".concat(c),T&&"paraui-icon-button-loading",P&&!j&&"paraui-icon-button-dangerous")},{children:function(){if(!T)return v;if("object"==typeof O){var t=O.delay||0;setTimeout((function(){return _(!1)}),t)}return(0,r.jsx)("span",b({className:"loading-icon"},{children:(0,r.jsx)(u(),{},void 0)}),void 0)}()}),void 0);return(0,o.useEffect)((function(){_(!!O)}),[O]),f?(0,r.jsx)(d.default,b({},x,{title:function(){if(j&&f){return(0,r.jsxs)("span",{children:[(0,r.jsx)(s(),{style:{marginRight:"4px",fontSize:"11px",color:"inherit"}},void 0),f]},void 0)}return f}()},{children:j?(0,r.jsx)("span",b({className:"paraui-button--disabled"},{children:k}),void 0):k}),void 0):k},g.SplitButton=function(t){var n=t.buttonText,e=t.options,l=void 0===e?[]:e,u=t.className,c=t.disabled,s=void 0!==c&&c,d=t.onClick,p=t.optionRender,b=(0,o.useState)(!1),y=b[0],g=b[1],j=(0,o.useRef)(null),m=(0,o.useRef)(),O=(0,o.useState)(0),x=O[0],w=O[1],P=function(t,n,e){var r;w(n),g(!1),null===(r=m.current)||void 0===r||r.classList.remove("paraui-button-split--active"),null==d||d(t,e)},N=function(t){var n,e;(null===(n=j.current)||void 0===n?void 0:n.contains(t.target))||(g(!1),null===(e=m.current)||void 0===e||e.classList.remove("paraui-button-split--active"))},S=function(){return(0,r.jsx)("div",v({className:"paraui-button-split-list"},{children:(0,r.jsx)("ul",{children:l.map((function(t,n){return Array.isArray(t)?function(t,n){return(0,r.jsx)("li",v({className:"split-li-group"},{children:t.map((function(t,e){var o="".concat(n,"-").concat(e);return(0,r.jsx)("div",v({className:(0,a.Z)("split-li",o===x&&"split-li--active"),onClick:function(n){return P(t,o,n)}},{children:(null==p?void 0:p(t))||t.label}),o)}))}),n)}(t,n):(0,r.jsx)("li",v({className:(0,a.Z)("split-li",n===x&&"split-li--active"),onClick:function(e){return P(t,n,e)}},{children:(null==p?void 0:p(t))||t.label}),n)}))},void 0)}),void 0)};return(0,r.jsxs)("div",v({className:(0,a.Z)("paraui-button-split",u),ref:j,onMouseLeave:function(t){var n;t.stopPropagation(),null===(n=t.currentTarget.firstElementChild)||void 0===n||n.classList.remove("paraui-button-split--active"),g(!1)}},{children:[(0,r.jsx)(h,v({variant:"outlined",onMouseEnter:function(t){t.stopPropagation();var n=t.currentTarget;m.current=n,n.classList.add("paraui-button-split--active"),g(!0)},startIcon:(0,r.jsx)(f(),{},void 0),disabled:s},{children:null!=n?n:"更多操作"}),void 0),(0,r.jsx)(i.Popper,v({open:y,anchorEl:j.current,transition:!0,placement:"bottom-end"},{children:function(t){var n=t.TransitionProps;t.placement;return(0,r.jsx)(i.Grow,v({},n,{children:(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(i.ClickAwayListener,v({onClickAway:N},{children:S()}),void 0)},void 0)}),void 0)}}),void 0)]}),void 0)};var h=g},4284:function(t,n,e){e.r(n),e.d(n,{ToggleButton:function(){return f},ToggleButtonGroup:function(){return c},default:function(){return v}});var r=e(7712),o=e(9297),i=e(2990),a=e(4927),l=function(){return l=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t},l.apply(this,arguments)},u=function(t,n){var e={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&n.indexOf(r)<0&&(e[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(e[r[o]]=t[r[o]])}return e},c=function(t){var n=t.className,e=t.style,o=t.exclusive,i=void 0!==o&&o,c=t.data,s=t.value,d=t.onChange,p=(0,a.Z)("paraui-togglebutton-group",n),f=function(t,n){if(d){var e,r=s&&(null==s?void 0:s.indexOf(n));s&&r>=0?(e=s.slice()).splice(r,1):e=s?s.concat(n):[n],d(t,e)}},b=function(t,n){d&&d(t,s===n?null:n)};return(0,r.jsx)("div",l({className:p},{children:c&&(null==c?void 0:c.length)?c.map((function(t,n){var o=t.label,a=t.selected,c=u(t,["label","selected"]),d=void 0===a?function(t,n){return void 0!==n&&void 0!==t&&(Array.isArray(n)?n.includes(t):t===n)}(c.value,s):a;return(0,r.jsx)(v,l({},c,{style:e,selected:d,onClick:i?b:f},{children:o}),n)})):null}),void 0)},s=e(6885),d=e(3475),p=function(){return p=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t},p.apply(this,arguments)},f=function(t){var n=t.className,e=t.style,l=t.children,u=t.disabled,c=void 0!==u&&u,f=t.selected,v=void 0!==f&&f,b=t.value,y=t.onClick,g=(0,o.useState)(!1),h=g[0],j=g[1],m=(0,o.useRef)((0,d.UUID)()).current,O=(0,a.Z)("paraui-toggle-button",n,{"paraui-toggle-button-selected":v,"paraui-toggle-button-disabled":c}),x=function(t){y&&y(t,b)};(0,o.useLayoutEffect)((function(){var t=document.querySelector('[data-id="'.concat(m,'"]'));if(t){var n=document.createElement("span");n.textContent=l,document.body.appendChild(n),n.offsetWidth>t.offsetWidth-32&&j(!0),null==n||n.remove()}}),[]);var w;return(0,r.jsx)(r.Fragment,{children:(w=(0,r.jsx)(i.default,p({"data-id":m,variant:"outlined",size:"medium",style:e,className:O,disabled:c,value:b,onClick:x},{children:(0,r.jsx)("span",p({className:"paraui-toggle-button-text"},{children:l}),void 0)}),void 0),h?(0,r.jsx)(s.default,p({title:l},{children:(0,r.jsx)("span",{children:w},void 0)}),void 0):w)},void 0)},v=f},6885:function(t,n,e){var r=e(7712),o=e(1731),i=e(4927),a=function(){return a=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t},a.apply(this,arguments)};n.default=function(t){var n,e=t.placement,l=void 0===e?"bottom":e,u=a(a({},t.classes),{popper:(0,i.Z)("paraui-tooltip",null===(n=t.classes)||void 0===n?void 0:n.popper,{"paraui-tooltip-left-right":(null==l?void 0:l.includes("left"))||(null==l?void 0:l.includes("right")),"paraui-tooltip-top-bottom":(null==l?void 0:l.includes("top"))||(null==l?void 0:l.includes("bottom"))})});return(0,r.jsx)(o.Tooltip,a({},t,{classes:u}),void 0)}},1731:function(n){n.exports=t},6028:function(t){t.exports=n},2749:function(t){t.exports=e},1102:function(t){t.exports=r},3475:function(t){t.exports=o},9297:function(t){t.exports=i}},u={};function c(t){var n=u[t];if(void 0!==n)return n.exports;var e=u[t]={exports:{}};return l[t](e,e.exports,c),e.exports}c.m=l,a=[],c.O=function(t,n,e,r){if(!n){var o=1/0;for(u=0;u<a.length;u++){n=a[u][0],e=a[u][1],r=a[u][2];for(var i=!0,l=0;l<n.length;l++)(!1&r||o>=r)&&Object.keys(c.O).every((function(t){return c.O[t](n[l])}))?n.splice(l--,1):(i=!1,r<o&&(o=r));i&&(a.splice(u--,1),t=e())}return t}r=r||0;for(var u=a.length;u>0&&a[u-1][2]>r;u--)a[u]=a[u-1];a[u]=[n,e,r]},c.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return c.d(n,{a:n}),n},c.d=function(t,n){for(var e in n)c.o(n,e)&&!c.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:n[e]})},c.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},c.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},function(){var t={7473:0,6615:0,2823:0,9296:0};c.O.j=function(n){return 0===t[n]};var n=function(n,e){var r,o,i=e[0],a=e[1],l=e[2],u=0;for(r in a)c.o(a,r)&&(c.m[r]=a[r]);if(l)var s=l(c);for(n&&n(e);u<i.length;u++)o=i[u],c.o(t,o)&&t[o]&&t[o][0](),t[i[u]]=0;return c.O(s)},e=self.webpackChunkParaUI=self.webpackChunkParaUI||[];e.forEach(n.bind(null,0)),e.push=n.bind(null,e.push.bind(e))}();var s=c.O(void 0,[9296],(function(){return c(4284)}));return s=c.O(s)}()}));
|
package/Tooltip/index.js
CHANGED
|
@@ -4,7 +4,7 @@ object-assign
|
|
|
4
4
|
(c) Sindre Sorhus
|
|
5
5
|
@license MIT
|
|
6
6
|
*/
|
|
7
|
-
var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function o(r){if(null==r)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}r.exports=function(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de","5"===Object.getOwnPropertyNames(r)[0])return!1;for(var e={},t=0;t<10;t++)e["_"+String.fromCharCode(t)]=t;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(r){return e[r]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(r){n[r]=r})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(r){return!1}}()?Object.assign:function(r,i){for(var u,f
|
|
7
|
+
var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function o(r){if(null==r)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}r.exports=function(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de","5"===Object.getOwnPropertyNames(r)[0])return!1;for(var e={},t=0;t<10;t++)e["_"+String.fromCharCode(t)]=t;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(r){return e[r]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(r){n[r]=r})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(r){return!1}}()?Object.assign:function(r,i){for(var u,a,f=o(r),c=1;c<arguments.length;c++){for(var l in u=Object(arguments[c]))t.call(u,l)&&(f[l]=u[l]);if(e){a=e(u);for(var p=0;p<a.length;p++)n.call(u,a[p])&&(f[a[p]]=u[a[p]])}}return f}},9524:function(r,e,t){
|
|
8
8
|
/** @license React v17.0.2
|
|
9
9
|
* react-jsx-runtime.production.min.js
|
|
10
10
|
*
|
|
@@ -13,4 +13,4 @@ var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.pr
|
|
|
13
13
|
* This source code is licensed under the MIT license found in the
|
|
14
14
|
* LICENSE file in the root directory of this source tree.
|
|
15
15
|
*/
|
|
16
|
-
t(4126);var n=t(9297),o=60103;if(60107,"function"==typeof Symbol&&Symbol.for){var i=Symbol.for;o=i("react.element"),i("react.fragment")}var u=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,
|
|
16
|
+
t(4126);var n=t(9297),o=60103;if(60107,"function"==typeof Symbol&&Symbol.for){var i=Symbol.for;o=i("react.element"),i("react.fragment")}var u=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a=Object.prototype.hasOwnProperty,f={key:!0,ref:!0,__self:!0,__source:!0};function c(r,e,t){var n,i={},c=null,l=null;for(n in void 0!==t&&(c=""+t),void 0!==e.key&&(c=""+e.key),void 0!==e.ref&&(l=e.ref),e)a.call(e,n)&&!f.hasOwnProperty(n)&&(i[n]=e[n]);if(r&&r.defaultProps)for(n in e=r.defaultProps)void 0===i[n]&&(i[n]=e[n]);return{$$typeof:o,type:r,key:c,ref:l,props:i,_owner:u.current}}e.jsx=c},7712:function(r,e,t){r.exports=t(9524)},6885:function(r,e,t){t.r(e),t.d(e,{Tooltip:function(){return a}});var n=t(7712),o=t(1731),i=t(4927),u=function(){return u=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o]);return r},u.apply(this,arguments)},a=function(r){var e,t=r.placement,a=void 0===t?"bottom":t,f=u(u({},r.classes),{popper:(0,i.Z)("paraui-tooltip",null===(e=r.classes)||void 0===e?void 0:e.popper,{"paraui-tooltip-left-right":(null==a?void 0:a.includes("left"))||(null==a?void 0:a.includes("right")),"paraui-tooltip-top-bottom":(null==a?void 0:a.includes("top"))||(null==a?void 0:a.includes("bottom"))})});return(0,n.jsx)(o.Tooltip,u({},r,{classes:f}),void 0)};e.default=a},1731:function(e){e.exports=r},9297:function(r){r.exports=e}},o={};function i(r){var e=o[r];if(void 0!==e)return e.exports;var t=o[r]={exports:{}};return n[r](t,t.exports,i),t.exports}i.m=n,t=[],i.O=function(r,e,n,o){if(!e){var u=1/0;for(c=0;c<t.length;c++){e=t[c][0],n=t[c][1],o=t[c][2];for(var a=!0,f=0;f<e.length;f++)(!1&o||u>=o)&&Object.keys(i.O).every((function(r){return i.O[r](e[f])}))?e.splice(f--,1):(a=!1,o<u&&(u=o));a&&(t.splice(c--,1),r=n())}return r}o=o||0;for(var c=t.length;c>0&&t[c-1][2]>o;c--)t[c]=t[c-1];t[c]=[e,n,o]},i.n=function(r){var e=r&&r.__esModule?function(){return r.default}:function(){return r};return i.d(e,{a:e}),e},i.d=function(r,e){for(var t in e)i.o(e,t)&&!i.o(r,t)&&Object.defineProperty(r,t,{enumerable:!0,get:e[t]})},i.o=function(r,e){return Object.prototype.hasOwnProperty.call(r,e)},i.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},function(){var r={2823:0,9296:0};i.O.j=function(e){return 0===r[e]};var e=function(e,t){var n,o,u=t[0],a=t[1],f=t[2],c=0;for(n in a)i.o(a,n)&&(i.m[n]=a[n]);if(f)var l=f(i);for(e&&e(t);c<u.length;c++)o=u[c],i.o(r,o)&&r[o]&&r[o][0](),r[u[c]]=0;return i.O(l)},t=self.webpackChunkParaUI=self.webpackChunkParaUI||[];t.forEach(e.bind(null,0)),t.push=e.bind(null,t.push.bind(t))}();var u=i.O(void 0,[9296],(function(){return i(6885)}));return u=i.O(u)}()}));
|
package/Transfer/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
!function(e,
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@material-ui/core"),require("@para-ui/icons/CloseCircle"),require("@para-ui/icons/Down"),require("@para-ui/icons/Forbid"),require("@para-ui/icons/Left"),require("@para-ui/icons/LoadingF"),require("@para-ui/icons/PreviewClose"),require("@para-ui/icons/PreviewOpen"),require("@para-ui/icons/Right"),require("@para-ui/icons/Search"),require("para-lib"),require("react")):"function"==typeof define&&define.amd?define(["@material-ui/core","@para-ui/icons/CloseCircle","@para-ui/icons/Down","@para-ui/icons/Forbid","@para-ui/icons/Left","@para-ui/icons/LoadingF","@para-ui/icons/PreviewClose","@para-ui/icons/PreviewOpen","@para-ui/icons/Right","@para-ui/icons/Search","para-lib","react"],t):"object"==typeof exports?exports.ParaUI=t(require("@material-ui/core"),require("@para-ui/icons/CloseCircle"),require("@para-ui/icons/Down"),require("@para-ui/icons/Forbid"),require("@para-ui/icons/Left"),require("@para-ui/icons/LoadingF"),require("@para-ui/icons/PreviewClose"),require("@para-ui/icons/PreviewOpen"),require("@para-ui/icons/Right"),require("@para-ui/icons/Search"),require("para-lib"),require("react")):e.ParaUI=t(e["@material-ui/core"],e["@para-ui/icons/CloseCircle"],e["@para-ui/icons/Down"],e["@para-ui/icons/Forbid"],e["@para-ui/icons/Left"],e["@para-ui/icons/LoadingF"],e["@para-ui/icons/PreviewClose"],e["@para-ui/icons/PreviewOpen"],e["@para-ui/icons/Right"],e["@para-ui/icons/Search"],e["para-lib"],e.react)}(self,(function(e,t,n,i,o,r,a,c,l,s,u,d){return function(){"use strict";var f,v={4927:function(e,t,n){function i(e){var t,n,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=i(e[t]))&&(o&&(o+=" "),o+=n);else for(t in e)e[t]&&(o&&(o+=" "),o+=t);return o}function o(){for(var e,t,n=0,o="";n<arguments.length;)(e=arguments[n++])&&(t=i(e))&&(o&&(o+=" "),o+=t);return o}n.d(t,{Z:function(){return o}})},4126:function(e){
|
|
2
2
|
/*
|
|
3
3
|
object-assign
|
|
4
4
|
(c) Sindre Sorhus
|
|
5
5
|
@license MIT
|
|
6
6
|
*/
|
|
7
|
-
var
|
|
7
|
+
var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function o(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 t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[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,r){for(var a,c,l=o(e),s=1;s<arguments.length;s++){for(var u in a=Object(arguments[s]))n.call(a,u)&&(l[u]=a[u]);if(t){c=t(a);for(var d=0;d<c.length;d++)i.call(a,c[d])&&(l[c[d]]=a[c[d]])}}return l}},9524:function(e,t,n){
|
|
8
8
|
/** @license React v17.0.2
|
|
9
9
|
* react-jsx-runtime.production.min.js
|
|
10
10
|
*
|
|
@@ -13,4 +13,4 @@ var n=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,i=Object.pr
|
|
|
13
13
|
* This source code is licensed under the MIT license found in the
|
|
14
14
|
* LICENSE file in the root directory of this source tree.
|
|
15
15
|
*/
|
|
16
|
-
t(4126);var i=t(9297),o=60103;if(n.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var r=Symbol.for;o=r("react.element"),n.Fragment=r("react.fragment")}var a=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c=Object.prototype.hasOwnProperty,s={key:!0,ref:!0,__self:!0,__source:!0};function l(e,n,t){var i,r={},l=null,u=null;for(i in void 0!==t&&(l=""+t),void 0!==n.key&&(l=""+n.key),void 0!==n.ref&&(u=n.ref),n)c.call(n,i)&&!s.hasOwnProperty(i)&&(r[i]=n[i]);if(e&&e.defaultProps)for(i in n=e.defaultProps)void 0===r[i]&&(r[i]=n[i]);return{$$typeof:o,type:e,key:l,ref:u,props:r,_owner:a.current}}n.jsx=l,n.jsxs=l},7712:function(e,n,t){e.exports=t(9524)},3094:function(e,n,t){var i=t(7712),o=t(9297),r=t(6885),a=function(){return a=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},a.apply(this,arguments)};n.default=function(e){var n=e.children,t=e.placement,c=void 0===t?"bottom-start":t,s=e.tips,l=void 0===s?"":s,u=e.className,d=void 0===u?"":u,f=(0,o.useRef)(),v=(0,o.useState)(""),p=v[0],h=v[1];(0,o.useEffect)((function(){h(l)}),[l]);var x;return(0,i.jsx)("div",a({ref:function(e){e&&(f.current=e)},className:(x="paraui-auto-tips",d&&(x+=" "+d),x),onMouseOver:function(){f.current.scrollWidth>f.current.offsetWidth?h(p||f.current.innerText):h("")}},{children:(0,i.jsx)(r.default,a({title:p,placement:c},{children:(0,i.jsx)("div",a({className:"auto-tips-content"},{children:n}),void 0)}),void 0)}),void 0)}},2990:function(e,n,t){t.d(n,{default:function(){return g}});var i=t(7712),o=t(9297),r=t(1731),a=t(4927),c=t(1102),s=t.n(c),l=t(2749),u=t.n(l),d=t(6885),f=t(6028),v=t.n(f),p=function(){return p=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},p.apply(this,arguments)};var h=function(){return h=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},h.apply(this,arguments)},x=function(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)n.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(t[i[o]]=e[i[o]])}return t},b=function(e){var n=e.variant,t=void 0===n?"contained":n,c=e.size,l=void 0===c?"large":c,f=e.className,v=e.disabled,p=void 0!==v&&v,b=e.children,g=e.startIcon,m=e.endIcon,j=e.loading,y=void 0!==j&&j,k=e.toolTipTitle,O=void 0===k?"":k,w=e.danger,C=void 0!==w&&w,N=x(e,["variant","size","className","disabled","children","startIcon","endIcon","loading","toolTipTitle","danger"]),S=(0,o.useState)(!1),P=S[0],E=S[1],I=function(e){if(!P)return"start"===e&&g?(0,i.jsx)("span",h({className:(0,a.Z)("btn-icon","start-icon")},{children:g}),void 0):"end"===e&&m?(0,i.jsx)("span",h({className:(0,a.Z)("btn-icon","end-icon")},{children:m}),void 0):null;if("object"==typeof y){var n=y.delay||0;setTimeout((function(){return E(!1)}),n)}return"start"===e?(0,i.jsx)("span",h({className:"btn-icon loading-icon"},{children:(0,i.jsx)(s(),{},void 0)}),void 0):null},T=(0,i.jsx)(r.Button,h({},N,{color:"default",variant:"contained",disabled:p,disableRipple:!0,disableElevation:!0,className:(0,a.Z)("paraui-button",f,"paraui-button-".concat(t),"paraui-button-".concat(l),P&&"paraui-button-loading",C&&!p&&"paraui-button-dangerous"),startIcon:I("start"),endIcon:I("end")},{children:b}),void 0);return(0,o.useEffect)((function(){E(!!y)}),[y]),p&&O?(0,i.jsx)(d.default,h({title:function(){if(p&&O){return(0,i.jsxs)("span",{children:[(0,i.jsx)(u(),{style:{marginRight:"4px",fontSize:"11px",color:"inherit"}},void 0),O]},void 0)}return O}()},{children:(0,i.jsx)("span",h({className:"paraui-button--disabled"},{children:T}),void 0)}),void 0):T};b.IconButton=function(e){var n=e.variant,t=void 0===n?"contained":n,c=e.size,l=void 0===c?"large":c,f=e.toolTipTitle,v=void 0===f?"":f,p=e.children,b=e.className,g=e.disabled,m=void 0!==g&&g,j=e.loading,y=void 0!==j&&j,k=e.TooltipProps,O=e.danger,w=void 0!==O&&O,C=x(e,["variant","size","toolTipTitle","children","className","disabled","loading","TooltipProps","danger"]),N=(0,o.useState)(!1),S=N[0],P=N[1],E=(0,i.jsx)(r.IconButton,h({},C,{disabled:m,disableRipple:!0,className:(0,a.Z)("paraui-icon-button",b,"paraui-icon-button-".concat(t),"paraui-icon-button-".concat(l),S&&"paraui-icon-button-loading",w&&!m&&"paraui-icon-button-dangerous")},{children:function(){if(!S)return p;if("object"==typeof y){var e=y.delay||0;setTimeout((function(){return P(!1)}),e)}return(0,i.jsx)("span",h({className:"loading-icon"},{children:(0,i.jsx)(s(),{},void 0)}),void 0)}()}),void 0);return(0,o.useEffect)((function(){P(!!y)}),[y]),v?(0,i.jsx)(d.default,h({},k,{title:function(){if(m&&v){return(0,i.jsxs)("span",{children:[(0,i.jsx)(u(),{style:{marginRight:"4px",fontSize:"11px",color:"inherit"}},void 0),v]},void 0)}return v}()},{children:m?(0,i.jsx)("span",h({className:"paraui-button--disabled"},{children:E}),void 0):E}),void 0):E},b.SplitButton=function(e){var n=e.buttonText,t=e.options,c=void 0===t?[]:t,s=e.className,l=e.disabled,u=void 0!==l&&l,d=e.onClick,f=e.optionRender,h=(0,o.useState)(!1),x=h[0],b=h[1],m=(0,o.useRef)(null),j=(0,o.useRef)(),y=(0,o.useState)(0),k=y[0],O=y[1],w=function(e,n,t){var i;O(n),b(!1),null===(i=j.current)||void 0===i||i.classList.remove("paraui-button-split--active"),null==d||d(e,t)},C=function(e){var n,t;(null===(n=m.current)||void 0===n?void 0:n.contains(e.target))||(b(!1),null===(t=j.current)||void 0===t||t.classList.remove("paraui-button-split--active"))},N=function(){return(0,i.jsx)("div",p({className:"paraui-button-split-list"},{children:(0,i.jsx)("ul",{children:c.map((function(e,n){return Array.isArray(e)?function(e,n){return(0,i.jsx)("li",p({className:"split-li-group"},{children:e.map((function(e,t){var o="".concat(n,"-").concat(t);return(0,i.jsx)("div",p({className:(0,a.Z)("split-li",o===k&&"split-li--active"),onClick:function(n){return w(e,o,n)}},{children:(null==f?void 0:f(e))||e.label}),o)}))}),n)}(e,n):(0,i.jsx)("li",p({className:(0,a.Z)("split-li",n===k&&"split-li--active"),onClick:function(t){return w(e,n,t)}},{children:(null==f?void 0:f(e))||e.label}),n)}))},void 0)}),void 0)};return(0,i.jsxs)("div",p({className:(0,a.Z)("paraui-button-split",s),ref:m,onMouseLeave:function(e){var n;e.stopPropagation(),null===(n=e.currentTarget.firstElementChild)||void 0===n||n.classList.remove("paraui-button-split--active"),b(!1)}},{children:[(0,i.jsx)(g,p({variant:"outlined",onMouseEnter:function(e){e.stopPropagation();var n=e.currentTarget;j.current=n,n.classList.add("paraui-button-split--active"),b(!0)},startIcon:(0,i.jsx)(v(),{},void 0),disabled:u},{children:null!=n?n:"更多操作"}),void 0),(0,i.jsx)(r.Popper,p({open:x,anchorEl:m.current,transition:!0,placement:"bottom-end"},{children:function(e){var n=e.TransitionProps;e.placement;return(0,i.jsx)(r.Grow,p({},n,{children:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(r.ClickAwayListener,p({onClickAway:C},{children:N()}),void 0)},void 0)}),void 0)}}),void 0)]}),void 0)};var g=b},6150:function(e,n,t){t.d(n,{Checkbox:function(){return a}});var i=t(7712),o=t(9297),r=function(){return r=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},r.apply(this,arguments)},a=function(e){var n=e.className,t=void 0===n?"":n,a=e.label,c=void 0===a?"":a,s=e.size,l=void 0===s?"large":s,u=e.disabled,d=void 0!==u&&u,f=e.indeterminate,v=void 0!==f&&f,p=e.onChange,h=(0,o.useState)(!1),x=h[0],b=h[1];(0,o.useEffect)((function(){void 0!==e.defaultChecked&&b(e.defaultChecked)}),[]),(0,o.useEffect)((function(){void 0!==e.checked&&b(e.checked)}),[e.checked]);var g;return(0,i.jsxs)("label",r({className:(g="paraui-check-box",t&&(g+=" "+t),l&&(g+=" check-box-"+l),d&&(g+=" check-box-disabled"),v?g+=" check-box-indeterminate":x&&(g+=" check-box-checked"),g),onClick:function(n){if(n.preventDefault(),!d){if(v)return void 0===e.checked&&b(!0),void(p&&p(n,!0));void 0===e.checked&&b(!x),n.target.checked=!x,n.target.value=!x,p&&p(n,!x)}}},{children:[(0,i.jsxs)("span",r({className:"paraui-checkbox-box"},{children:[(0,i.jsx)("input",r({type:"checkbox",value:x},e.inputProps),void 0),(0,i.jsx)("span",{className:"paraui-checkbox-box-inner"},void 0)]}),void 0),c&&(0,i.jsx)("span",r({className:"paraui-check-box-label"},{children:c}),void 0)]}),void 0)}},9011:function(e,n,t){var i=t(7712),o=t(9297),r=t(1102),a=t.n(r),c=function(){return c=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},c.apply(this,arguments)};n.default=function(e){var n=e.className,t=e.style,r=e.opacity,s=void 0===r?.7:r,l=(0,o.useRef)(null);(0,o.useEffect)((function(){l&&l.current&&l.current.parentNode&&((getComputedStyle(l.current.parentNode)||{}).position||(l.current.parentNode.style.position="relative"))}),[]);var u;return(0,i.jsxs)("div",c({className:(u="paraui-loading",n&&(u+=" "+n),u),style:t,ref:l},{children:[(0,i.jsx)("div",c({className:"paraui-loading-box"},{children:(0,i.jsx)(a(),{},void 0)}),void 0),(0,i.jsx)("div",{className:"paraui-loading-mask",style:{opacity:s}},void 0)]}),void 0)}},7785:function(e,n,t){t.d(n,{Search:function(){return f}});var i=t(7712),o=t(9297),r=t(3672),a=t(2990),c=t(6088),s=t.n(c),l=t(4115),u=t.n(l),d=function(){return d=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},d.apply(this,arguments)},f=function(e){var n=e.className,t=void 0===n?"":n,c=e.size,l=void 0===c?"large":c,f=e.btnType,v=void 0===f?"outside":f,p=e.showBtn,h=void 0===p||p,x=e.btnIcon,b=e.btnText,g=void 0===b?"":b,m=e.placeholder,j=void 0===m?"":m,y=(e.defaultValue,e.value),k=e.rightIcon,O=e.showRightIcon,w=void 0===O||O,C=e.onChange,N=e.onBlur,S=e.onFocus,P=e.onKeydown,E=e.onKeyUp,I=e.onClickBtn,T=e.onClickRightIcon,q=e.onEnter,L=(0,o.useState)(""),F=L[0],R=L[1];(0,o.useEffect)((function(){void 0!==e.defaultValue&&R(e.defaultValue)}),[]),(0,o.useEffect)((function(){void 0!==y&&R(y)}),[y]);var B,_=function(){return x||(0,i.jsx)(u(),{},void 0)},A=function(){I&&I(F)};return(0,i.jsxs)("div",d({className:(B="paraui-search",t&&(B+=" "+t),l&&(B+=" search-"+l),v&&(B+=" search-"+v),h&&(B+=" search-showbtn"),g&&(B+=" search-btntext"),B)},{children:[(0,i.jsx)(r.default,{size:l,placeholder:j,value:F,rightIcon:w?k||(0,i.jsx)(s(),{},void 0):"",onClickIcon:function(){T&&T(F)},onChange:function(n){var t=n.target.value;void 0===e.value&&R(t),C&&C(t,n)},onBlur:N,onFocus:S,onKeydown:P,onKeyUp:E,onEnter:q,addonAfter:function(){if(h&&"inside"===v)return(0,i.jsx)(a.default,d({size:l,startIcon:_(),variant:"outlined",onClick:A},{children:g}),void 0)}()},void 0),h&&"outside"===v&&(0,i.jsx)(a.default,d({size:l,startIcon:_(),variant:"contained",onClick:A},{children:g}),void 0)]}),void 0)}},3672:function(e,n,t){var i=t(7712),o=t(9297),r=t(1731),a=t(3094),c=t(9011),s=t(8528),l=t.n(s),u=t(6570),d=t.n(u),f=t(3475),v=function(){return v=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},v.apply(this,arguments)},p=function(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)n.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(t[i[o]]=e[i[o]])}return t};n.default=function(e){var n=e.className,t=e.size,s=void 0===t?"large":t,u=e.labelMode,h=void 0===u?"outside":u,x=e.placeholder,b=void 0===x?"":x,g=e.label,m=void 0===g?"":g,j=e.disabled,y=void 0!==j&&j,k=e.multiline,O=void 0!==k&&k,w=e.required,C=void 0!==w&&w,N=e.labelSign,S=e.rows,P=void 0===S?2:S,E=e.error,I=void 0!==E&&E,T=e.helperText,q=void 0===T?"":T,L=e.addonBefore,F=void 0===L?"":L,R=e.addonAfter,B=void 0===R?"":R,_=(e.defaultValue,e.value),A=e.autoFocus,z=void 0!==A&&A,D=e.type,M=void 0===D?"text":D,U=e.onClickIcon,K=e.rightIcon,Z=e.showRightIcon,V=void 0===Z||Z,W=e.limitLength,H=e.fetchSuggestions,J=e.selectPopoverClass,$=e.renderSelectItem,G=e.showSelectName,Y=void 0===G?"value":G,Q=e.onBlur,X=e.onFocus,ee=e.onChange,ne=e.onKeydown,te=e.onKeyUp,ie=e.onEnter,oe=e.onClickAddonBefore,re=e.onClickAddonAfter,ae=e.onSelect,ce=p(e,["className","size","labelMode","placeholder","label","disabled","multiline","required","labelSign","rows","error","helperText","addonBefore","addonAfter","defaultValue","value","autoFocus","type","onClickIcon","rightIcon","showRightIcon","limitLength","fetchSuggestions","selectPopoverClass","renderSelectItem","showSelectName","onBlur","onFocus","onChange","onKeydown","onKeyUp","onEnter","onClickAddonBefore","onClickAddonAfter","onSelect"]),se=(0,o.useState)("text-field-select-content-"+(0,f.UUID)())[0],le=(0,o.useState)(!0),ue=le[0],de=le[1],fe=(0,o.useState)(""),ve=fe[0],pe=fe[1],he=(0,o.useState)(!1),xe=he[0],be=he[1],ge=(0,o.useState)("text"),me=ge[0],je=ge[1],ye=(0,o.useState)(!1),ke=ye[0],Oe=ye[1],we=(0,o.useState)(!1),Ce=we[0],Ne=we[1],Se=(0,o.useState)([]),Pe=Se[0],Ee=Se[1],Ie=(0,o.useRef)(null),Te=(0,o.useRef)(null);(0,o.useEffect)((function(){if(void 0!==e.defaultValue){var n=Le(e.defaultValue);pe(n),Fe(n)}}),[]),(0,o.useEffect)((function(){M!==me&&je(M)}),[M]),(0,o.useEffect)((function(){if(void 0!==_){var e=Le(_);pe(e),Fe(e)}}),[_]),(0,o.useEffect)((function(){de(""===ve||void 0===ve)}),[ve]),(0,o.useEffect)((function(){H&&Oe(xe)}),[xe,H]),(0,o.useEffect)((function(){return ke?window.addEventListener("keydown",Ae):window.removeEventListener("keydown",Ae),function(){window.removeEventListener("keydown",Ae)}}),[ke]);var qe,Le=function(n){var t=n;return e.limitLength&&n.toString().length>e.limitLength&&(t=t.toString().substr(0,e.limitLength)),t},Fe=function(e){Ie&&Ie.current&&(Ie.current.value=e,Ie.current.setAttribute("value",e))},Re=function(){y||(de(!1),(Ie&&Ie.current).focus())},Be=function(e){var n=e.selectDom,t=e.keyCode,i=e.currentDom,o="nextSibling",r=".text-field-select-content-item";38===t&&(o="previousSibling",r=".text-field-select-content-item:last-child"),i?(i=i[o])||(i=n.querySelector(r)):i=n.querySelector(".text-field-select-content-item"),i&&(i.classList.add("text-field-select-content-item-keydown"),_e(i,n))},_e=function(e,n){var t=n.clientHeight,i=e.offsetTop+e.clientHeight-t;n.scrollTop=i>0?i:0},Ae=function(e){var n=document.querySelector("."+se),t=null,i=n.querySelector(".text-field-select-content-item-keydown");if(13===e.keyCode&&i){var o=i.dataset.val;He(JSON.parse(o))(e),(Ie&&Ie.current).blur()}i&&(t=i,i.classList.remove("text-field-select-content-item-keydown")),40===e.keyCode&&Be({selectDom:n,keyCode:e.keyCode,currentDom:t}),38===e.keyCode&&Be({selectDom:n,keyCode:e.keyCode,currentDom:t})},ze=function(e){be(!1),""===e.target.value&&de(!0),Q&&Q(e)},De=function(e){Ne(!0),H&&H(e,(function(e){Ee(e||[]),Ne(!1)}))},Me=function(e){be(!0),X&&X(e),De(e.target.value)},Ue=function(n){var t=n.target.value;t&&de(!1),W&&void 0!==t&&""!==t&&t.toString().length>W?Fe(ve):(void 0===e.value&&(pe(t),Fe(t)),ee&&ee(n),De(n.target.value))},Ke=function(e){13===e.keyCode&&ie&&ie(e),ne&&ne(e)},Ze=function(e){te&&te(e)},Ve=function(e){"password"===M&&("text"===me&&je("password"),"password"===me&&je("text")),U&&U(e)},We=function(){Oe(!1)},He=function(e){return function(n){ae&&ae(e)}},Je=(0,o.useMemo)((function(){return(0,i.jsx)(i.Fragment,{children:void 0!==W&&(0,i.jsx)("span",v({className:"length-limit"},{children:(ve?ve.toString().length:0)+"/"+W}),void 0)},void 0)}),[W,ve]),$e=(0,o.useMemo)((function(){var e=K||("password"===M?"password"===me?(0,i.jsx)(d(),{},void 0):(0,i.jsx)(l(),{},void 0):null);return(0,i.jsx)(i.Fragment,{children:V&&e&&(0,i.jsx)("span",v({className:"right-icon",onClick:Ve},{children:e}),void 0)},void 0)}),[V,K,M,me]),Ge=(0,o.useMemo)((function(){return(0,i.jsxs)("div",v({className:"text-field-content-within",ref:Te},{children:[(0,i.jsxs)("div",v({className:"text-field-content-within-input"},{children:[O?(0,i.jsx)("textarea",v({ref:Ie,rows:P,onBlur:ze,onFocus:Me,onChange:Ue,onKeyDown:Ke,onKeyUp:Ze,disabled:y},ce),void 0):(0,i.jsx)("input",v({ref:Ie,type:me,onBlur:ze,onFocus:Me,onChange:Ue,onKeyDown:Ke,onKeyUp:Ze,disabled:y},ce),void 0),ue&&(0,i.jsx)("span",v({className:"text-field-label-placeholder",onClick:Re},{children:"outside"===h?b:(0,i.jsxs)(i.Fragment,{children:[m||b,C&&(0,i.jsx)("span",v({className:"text-field-required"},{children:"*"}),void 0),N&&(0,i.jsx)("span",{children:N},void 0)]},void 0)}),void 0)]}),void 0),Je,$e]}),void 0)}),[ue,z,me,ve,Je,$e,h,b,m,y,O,P,ce,ee,H]),Ye=(0,o.useMemo)((function(){var e;return(0,i.jsxs)("div",v({className:(e="text-field-select-content",Ce&&(e+=" text-field-select-content-loading"),se&&(e+=" "+se),e),style:{width:(Te&&Te.current?Te.current.offsetWidth:0)+"px"}},{children:[Pe&&Pe.map((function(e,n){return(0,i.jsx)("div",v({className:"text-field-select-content-item",onMouseDown:He(e),"data-val":JSON.stringify(e)},{children:$?$(e):(0,i.jsx)(a.default,{children:e[Y]},void 0)}),n)})),Ce&&(0,i.jsx)(c.default,{},void 0)]}),void 0)}),[Te,ke,Pe,$,Y,ae,Ce,se]),Qe=(0,o.useMemo)((function(){return(0,i.jsx)(r.Tooltip,v({open:ke,title:Ye,onClose:We,interactive:!0,disableFocusListener:!0,disableHoverListener:!0,disableTouchListener:!0,arrow:!0,classes:{popper:(e="paraui-text-field-select",s&&(e+=" paraui-text-field-select-"+s),J&&(e+=" "+J),e)}},{children:Ge}),void 0);var e}),[ue,z,me,ve,Je,$e,h,b,m,y,O,P,ce,ee,H,ae,Te,ke,J,s]),Xe=(0,o.useMemo)((function(){var e=Boolean(C||N||m);return(0,i.jsx)(i.Fragment,{children:"outside"===h&&e&&(0,i.jsxs)("label",v({className:"text-field-label"},{children:[m,C&&(0,i.jsx)("span",v({className:"text-field-required"},{children:"*"}),void 0),N&&(0,i.jsx)("span",{children:N},void 0)]}),void 0)},void 0)}),[h,m,N,C]);return(0,i.jsxs)("div",v({className:(qe="paraui-text-field",qe+=" text-field",s&&!O&&(qe+=" text-field-"+s),n&&(qe+=" "+n),I&&(qe+=" text-field-error"),xe&&(qe+=" text-field-focus"),y&&(qe+=" text-field-disabled"),O&&(qe+=" text-field-multiline"),qe)},{children:[Xe,(0,i.jsxs)("div",v({className:"text-field-content"},{children:[F&&(0,i.jsx)("div",v({className:"text-field-content-before",onClick:function(e){oe&&oe(e)}},{children:F}),void 0),H?Qe:Ge,B&&(0,i.jsx)("div",v({className:"text-field-content-after",onClick:function(e){re&&re(e)}},{children:B}),void 0)]}),void 0),q&&(0,i.jsx)("p",v({className:"text-field-error-text"},{children:q}),void 0)]}),void 0)}},6885:function(e,n,t){var i=t(7712),o=t(1731),r=t(4927),a=function(){return a=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},a.apply(this,arguments)};n.default=function(e){var n,t=a(a({},e.classes),{popper:(0,r.Z)("paraui-tooltip",null===(n=e.classes)||void 0===n?void 0:n.popper)});return(0,i.jsx)(o.Tooltip,a({},e,{classes:t},{children:e.children}),void 0)}},1596:function(e,n,t){t.r(n),t.d(n,{Transfer:function(){return h}});var i=t(7712),o=t(9297),r=t(6150),a=t(7785),c=t(4115),s=t.n(c),l=t(1127),u=t.n(l),d=t(6288),f=t.n(d),v=function(){return v=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},v.apply(this,arguments)},p=function(e,n,t){if(t||2===arguments.length)for(var i,o=0,r=n.length;o<r;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return e.concat(i||Array.prototype.slice.call(n))},h=function(e){var n=e.data,t=void 0===n?[]:n,c=e.value,l=void 0===c?[]:c,d=e.onChange,h=e.titles,x=void 0===h?["左侧","右侧"]:h,b=(0,o.useState)(t),g=b[0],m=b[1],j=(0,o.useState)(l),y=j[0],k=j[1],O=(0,o.useState)(""),w=O[0],C=O[1],N=(0,o.useState)(""),S=N[0],P=N[1],E=(0,o.useState)(0),I=E[0],T=E[1],q=(0,o.useState)(0),L=q[0],F=q[1],R=(0,o.useState)(""),B=R[0],_=R[1],A=(0,o.useState)(""),z=A[0],D=A[1],M=(0,o.useCallback)((function(e,n,t,i){"left"===i?(g[t].checked=e.target.checked,m(p([],g,!0))):(y[t].checked=e.target.checked,k(p([],y,!0)))}),[g,y]),U=(0,o.useCallback)((function(e,n){"left"===n?(g.forEach((function(n){n.checked=e.target.checked})),m(p([],g,!0))):(y.forEach((function(n){n.checked=e.target.checked})),k(p([],y,!0))),console.log(e.target.checked),C(e.target.checked)}),[g,y]),K=(0,o.useCallback)((function(e){"left"===e?p([],y,!0).forEach((function(e){e.checked&&(e.checked=!1,g.push(e),y.splice(y.indexOf(e),1))})):p([],g,!0).forEach((function(e){e.checked&&(e.checked=!1,y.push(e),g.splice(g.indexOf(e),1))})),m(p([],g,!0)),k(p([],y,!0)),d&&d(y)}),[]),Z=(0,o.useCallback)((function(e,n){var t=p(p([""],e,!0),[""],!1).join(".*"),i=new RegExp(t),o=[];"left"===n?(o=g.filter((function(e){return i.test(e.name)||i.test(e.description)})),m(o)):(o=y.filter((function(e){return i.test(e.name)||i.test(e.description)})),k(o))}),[]);return(0,o.useEffect)((function(){var e=g.filter((function(e){return e.checked}));T(e.length),e.length&&e.length!==g.length?(C("indeterminate"),D("on")):e.length&&e.length===g.length?(C("checked"),D("on")):(C(""),D(""));var n=y.filter((function(e){return e.checked}));F(n.length),n.length&&n.length!==y.length?(P("indeterminate"),_("on")):n.length&&n.length===y.length?(P("checked"),_("on")):(P(""),_(""))}),[g,y]),(0,i.jsxs)("div",v({className:"transfer"},{children:[(0,i.jsxs)("div",v({className:"box"},{children:[(0,i.jsxs)("div",v({className:"box-header"},{children:[(0,i.jsx)(r.Checkbox,{label:x[0],size:"medium",checked:"checked"===w,indeterminate:"indeterminate"===w,onChange:function(e){U(e,"left")}},1),(0,i.jsxs)("div",v({className:"count"},{children:[I,"/",g.length]}),void 0)]}),void 0),(0,i.jsx)(a.Search,{btnType:"inside",placeholder:"请输入搜索内容",showBtn:!1,rightIcon:(0,i.jsx)(s(),{},void 0),onChange:function(e){Z(e,"left")}},void 0),(0,i.jsx)("div",v({className:"context"},{children:g.map((function(e,n){return(0,i.jsx)("div",v({className:"item"},{children:(0,i.jsx)(r.Checkbox,{label:e.name,size:"medium",checked:e.checked,disabled:e.disabled,onChange:function(e,t){M(e,t,n,"left")}},void 0)}),e.name)}))}),void 0)]}),void 0),(0,i.jsxs)("div",v({className:"moveBtn"},{children:[(0,i.jsx)("div",v({className:"btn "+B,onClick:function(){K("left")}},{children:(0,i.jsx)(u(),{},void 0)}),void 0),(0,i.jsx)("div",v({className:"btn "+z,onClick:function(){K("right")}},{children:(0,i.jsx)(f(),{},void 0)}),void 0)]}),void 0),(0,i.jsxs)("div",v({className:"box"},{children:[(0,i.jsxs)("div",v({className:"box-header"},{children:[(0,i.jsx)(r.Checkbox,{label:x[1],size:"medium",checked:"checked"===S,indeterminate:"indeterminate"===S,onChange:function(e){U(e,"right")}},void 0),(0,i.jsxs)("div",v({className:"count"},{children:[L,"/",y.length]}),void 0)]}),void 0),(0,i.jsx)(a.Search,{btnType:"inside",placeholder:"请输入搜索内容",showBtn:!1,rightIcon:(0,i.jsx)(s(),{},void 0),onChange:function(e){Z(e,"right")}},void 0),(0,i.jsx)("div",v({className:"context"},{children:y.map((function(e,n){return(0,i.jsx)("div",v({className:"item"},{children:(0,i.jsx)(r.Checkbox,{label:e.name,size:"medium",checked:e.checked,disabled:e.disabled,onChange:function(e,t){M(e,t,n,"right")}},void 0)}),e.name)}))}),void 0)]}),void 0)]}),void 0)};n.default=h},1731:function(n){n.exports=e},6088:function(e){e.exports=n},6028:function(e){e.exports=t},2749:function(e){e.exports=i},1127:function(e){e.exports=o},1102:function(e){e.exports=r},6570:function(e){e.exports=a},8528:function(e){e.exports=c},6288:function(e){e.exports=s},4115:function(e){e.exports=l},3475:function(e){e.exports=u},9297:function(e){e.exports=d}},p={};function h(e){var n=p[e];if(void 0!==n)return n.exports;var t=p[e]={exports:{}};return v[e](t,t.exports,h),t.exports}h.m=v,f=[],h.O=function(e,n,t,i){if(!n){var o=1/0;for(c=0;c<f.length;c++){n=f[c][0],t=f[c][1],i=f[c][2];for(var r=!0,a=0;a<n.length;a++)(!1&i||o>=i)&&Object.keys(h.O).every((function(e){return h.O[e](n[a])}))?n.splice(a--,1):(r=!1,i<o&&(o=i));r&&(f.splice(c--,1),e=t())}return e}i=i||0;for(var c=f.length;c>0&&f[c-1][2]>i;c--)f[c]=f[c-1];f[c]=[n,t,i]},h.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return h.d(n,{a:n}),n},h.d=function(e,n){for(var t in n)h.o(n,t)&&!h.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},h.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},h.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e={1852:0,1465:0,6615:0,7056:0,5717:0,3708:0,2996:0,2823:0,9296:0};h.O.j=function(n){return 0===e[n]};var n=function(n,t){var i,o,r=t[0],a=t[1],c=t[2],s=0;for(i in a)h.o(a,i)&&(h.m[i]=a[i]);if(c)var l=c(h);for(n&&n(t);s<r.length;s++)o=r[s],h.o(e,o)&&e[o]&&e[o][0](),e[r[s]]=0;return h.O(l)},t=self.webpackChunkParaUI=self.webpackChunkParaUI||[];t.forEach(n.bind(null,0)),t.push=n.bind(null,t.push.bind(t))}();var x=h.O(void 0,[9296],(function(){return h(1596)}));return x=h.O(x)}()}));
|
|
16
|
+
n(4126);var i=n(9297),o=60103;if(t.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var r=Symbol.for;o=r("react.element"),t.Fragment=r("react.fragment")}var a=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c=Object.prototype.hasOwnProperty,l={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,n){var i,r={},s=null,u=null;for(i in void 0!==n&&(s=""+n),void 0!==t.key&&(s=""+t.key),void 0!==t.ref&&(u=t.ref),t)c.call(t,i)&&!l.hasOwnProperty(i)&&(r[i]=t[i]);if(e&&e.defaultProps)for(i in t=e.defaultProps)void 0===r[i]&&(r[i]=t[i]);return{$$typeof:o,type:e,key:s,ref:u,props:r,_owner:a.current}}t.jsx=s,t.jsxs=s},7712:function(e,t,n){e.exports=n(9524)},3094:function(e,t,n){var i=n(7712),o=n(9297),r=n(6885),a=function(){return a=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},a.apply(this,arguments)};t.default=function(e){var t=e.children,n=e.placement,c=void 0===n?"bottom-start":n,l=e.tips,s=void 0===l?"":l,u=e.className,d=void 0===u?"":u,f=(0,o.useRef)(),v=(0,o.useState)(""),p=v[0],h=v[1];(0,o.useEffect)((function(){h(s)}),[s]);var x;return(0,i.jsx)("div",a({ref:f,className:(x="paraui-auto-tips",d&&(x+=" "+d),x),onMouseOver:function(e){f.current&&f.current.scrollWidth>f.current.offsetWidth?h(s||f.current.innerText):h("")}},{children:(0,i.jsx)(r.default,a({title:p,placement:c},{children:(0,i.jsx)("div",a({className:"auto-tips-content"},{children:t}),void 0)}),void 0)}),void 0)}},2990:function(e,t,n){n.d(t,{default:function(){return g}});var i=n(7712),o=n(9297),r=n(1731),a=n(4927),c=n(1102),l=n.n(c),s=n(2749),u=n.n(s),d=n(6885),f=n(6028),v=n.n(f),p=function(){return p=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},p.apply(this,arguments)};var h=function(){return h=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},h.apply(this,arguments)},x=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n},b=function(e){var t=e.variant,n=void 0===t?"contained":t,c=e.size,s=void 0===c?"large":c,f=e.className,v=e.disabled,p=void 0!==v&&v,b=e.children,g=e.startIcon,m=e.endIcon,j=e.loading,y=void 0!==j&&j,k=e.toolTipTitle,O=void 0===k?"":k,w=e.danger,C=void 0!==w&&w,N=x(e,["variant","size","className","disabled","children","startIcon","endIcon","loading","toolTipTitle","danger"]),S=(0,o.useState)(!1),P=S[0],E=S[1],I=function(e){if(!P)return"start"===e&&g?(0,i.jsx)("span",h({className:(0,a.Z)("btn-icon","start-icon")},{children:g}),void 0):"end"===e&&m?(0,i.jsx)("span",h({className:(0,a.Z)("btn-icon","end-icon")},{children:m}),void 0):null;if("object"==typeof y){var t=y.delay||0;setTimeout((function(){return E(!1)}),t)}return"start"===e?(0,i.jsx)("span",h({className:"btn-icon loading-icon"},{children:(0,i.jsx)(l(),{},void 0)}),void 0):null},T=(0,i.jsx)(r.Button,h({},N,{color:"default",variant:"contained",disabled:p,disableRipple:!0,disableElevation:!0,className:(0,a.Z)("paraui-button",f,"paraui-button-".concat(n),"paraui-button-".concat(s),P&&"paraui-button-loading",C&&!p&&"paraui-button-dangerous"),startIcon:I("start"),endIcon:I("end")},{children:b}),void 0);return(0,o.useEffect)((function(){E(!!y)}),[y]),p&&O?(0,i.jsx)(d.default,h({title:function(){if(p&&O){return(0,i.jsxs)("span",{children:[(0,i.jsx)(u(),{style:{marginRight:"4px",fontSize:"11px",color:"inherit"}},void 0),O]},void 0)}return O}()},{children:(0,i.jsx)("span",h({className:"paraui-button--disabled"},{children:T}),void 0)}),void 0):T};b.IconButton=function(e){var t=e.variant,n=void 0===t?"contained":t,c=e.size,s=void 0===c?"large":c,f=e.toolTipTitle,v=void 0===f?"":f,p=e.children,b=e.className,g=e.disabled,m=void 0!==g&&g,j=e.loading,y=void 0!==j&&j,k=e.TooltipProps,O=e.danger,w=void 0!==O&&O,C=x(e,["variant","size","toolTipTitle","children","className","disabled","loading","TooltipProps","danger"]),N=(0,o.useState)(!1),S=N[0],P=N[1],E=(0,i.jsx)(r.IconButton,h({},C,{disabled:m,disableRipple:!0,className:(0,a.Z)("paraui-icon-button",b,"paraui-icon-button-".concat(n),"paraui-icon-button-".concat(s),S&&"paraui-icon-button-loading",w&&!m&&"paraui-icon-button-dangerous")},{children:function(){if(!S)return p;if("object"==typeof y){var e=y.delay||0;setTimeout((function(){return P(!1)}),e)}return(0,i.jsx)("span",h({className:"loading-icon"},{children:(0,i.jsx)(l(),{},void 0)}),void 0)}()}),void 0);return(0,o.useEffect)((function(){P(!!y)}),[y]),v?(0,i.jsx)(d.default,h({},k,{title:function(){if(m&&v){return(0,i.jsxs)("span",{children:[(0,i.jsx)(u(),{style:{marginRight:"4px",fontSize:"11px",color:"inherit"}},void 0),v]},void 0)}return v}()},{children:m?(0,i.jsx)("span",h({className:"paraui-button--disabled"},{children:E}),void 0):E}),void 0):E},b.SplitButton=function(e){var t=e.buttonText,n=e.options,c=void 0===n?[]:n,l=e.className,s=e.disabled,u=void 0!==s&&s,d=e.onClick,f=e.optionRender,h=(0,o.useState)(!1),x=h[0],b=h[1],m=(0,o.useRef)(null),j=(0,o.useRef)(),y=(0,o.useState)(0),k=y[0],O=y[1],w=function(e,t,n){var i;O(t),b(!1),null===(i=j.current)||void 0===i||i.classList.remove("paraui-button-split--active"),null==d||d(e,n)},C=function(e){var t,n;(null===(t=m.current)||void 0===t?void 0:t.contains(e.target))||(b(!1),null===(n=j.current)||void 0===n||n.classList.remove("paraui-button-split--active"))},N=function(){return(0,i.jsx)("div",p({className:"paraui-button-split-list"},{children:(0,i.jsx)("ul",{children:c.map((function(e,t){return Array.isArray(e)?function(e,t){return(0,i.jsx)("li",p({className:"split-li-group"},{children:e.map((function(e,n){var o="".concat(t,"-").concat(n);return(0,i.jsx)("div",p({className:(0,a.Z)("split-li",o===k&&"split-li--active"),onClick:function(t){return w(e,o,t)}},{children:(null==f?void 0:f(e))||e.label}),o)}))}),t)}(e,t):(0,i.jsx)("li",p({className:(0,a.Z)("split-li",t===k&&"split-li--active"),onClick:function(n){return w(e,t,n)}},{children:(null==f?void 0:f(e))||e.label}),t)}))},void 0)}),void 0)};return(0,i.jsxs)("div",p({className:(0,a.Z)("paraui-button-split",l),ref:m,onMouseLeave:function(e){var t;e.stopPropagation(),null===(t=e.currentTarget.firstElementChild)||void 0===t||t.classList.remove("paraui-button-split--active"),b(!1)}},{children:[(0,i.jsx)(g,p({variant:"outlined",onMouseEnter:function(e){e.stopPropagation();var t=e.currentTarget;j.current=t,t.classList.add("paraui-button-split--active"),b(!0)},startIcon:(0,i.jsx)(v(),{},void 0),disabled:u},{children:null!=t?t:"更多操作"}),void 0),(0,i.jsx)(r.Popper,p({open:x,anchorEl:m.current,transition:!0,placement:"bottom-end"},{children:function(e){var t=e.TransitionProps;e.placement;return(0,i.jsx)(r.Grow,p({},t,{children:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(r.ClickAwayListener,p({onClickAway:C},{children:N()}),void 0)},void 0)}),void 0)}}),void 0)]}),void 0)};var g=b},6150:function(e,t,n){n.d(t,{Checkbox:function(){return a}});var i=n(7712),o=n(9297),r=function(){return r=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},a=function(e){var t=e.className,n=void 0===t?"":t,a=e.label,c=void 0===a?"":a,l=e.size,s=void 0===l?"large":l,u=e.disabled,d=void 0!==u&&u,f=e.indeterminate,v=void 0!==f&&f,p=e.onChange,h=(0,o.useState)(!1),x=h[0],b=h[1];(0,o.useEffect)((function(){void 0!==e.defaultChecked&&b(e.defaultChecked)}),[]),(0,o.useEffect)((function(){void 0!==e.checked&&b(e.checked)}),[e.checked]);var g;return(0,i.jsxs)("label",r({className:(g="paraui-check-box",n&&(g+=" "+n),s&&(g+=" check-box-"+s),d&&(g+=" check-box-disabled"),v?g+=" check-box-indeterminate":x&&(g+=" check-box-checked"),g),onClick:function(t){if(t.preventDefault(),!d){if(v)return void 0===e.checked&&b(!0),void(p&&p(t,!0));void 0===e.checked&&b(!x),t.target.checked=!x,t.target.value=!x,p&&p(t,!x)}}},{children:[(0,i.jsxs)("span",r({className:"paraui-checkbox-box"},{children:[(0,i.jsx)("input",r({type:"checkbox",value:x},e.inputProps),void 0),(0,i.jsx)("span",{className:"paraui-checkbox-box-inner"},void 0)]}),void 0),c&&(0,i.jsx)("span",r({className:"paraui-check-box-label"},{children:c}),void 0)]}),void 0)}},9011:function(e,t,n){var i=n(7712),o=n(9297),r=n(1102),a=n.n(r),c=function(){return c=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},c.apply(this,arguments)};t.default=function(e){var t=e.className,n=e.style,r=e.opacity,l=void 0===r?.7:r,s=(0,o.useRef)(null);(0,o.useEffect)((function(){s&&s.current&&s.current.parentNode&&((getComputedStyle(s.current.parentNode)||{}).position||(s.current.parentNode.style.position="relative"))}),[]);var u;return(0,i.jsxs)("div",c({className:(u="paraui-loading",t&&(u+=" "+t),u),style:n,ref:s},{children:[(0,i.jsx)("div",c({className:"paraui-loading-box"},{children:(0,i.jsx)(a(),{},void 0)}),void 0),(0,i.jsx)("div",{className:"paraui-loading-mask",style:{opacity:l}},void 0)]}),void 0)}},7785:function(e,t,n){n.d(t,{Search:function(){return f}});var i=n(7712),o=n(9297),r=n(3672),a=n(2990),c=n(6088),l=n.n(c),s=n(4115),u=n.n(s),d=function(){return d=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},d.apply(this,arguments)},f=function(e){var t=e.className,n=void 0===t?"":t,c=e.size,s=void 0===c?"large":c,f=e.btnType,v=void 0===f?"outside":f,p=e.showBtn,h=void 0===p||p,x=e.btnIcon,b=e.btnText,g=void 0===b?"":b,m=e.placeholder,j=void 0===m?"":m,y=(e.defaultValue,e.value),k=e.rightIcon,O=e.showRightIcon,w=void 0===O||O,C=e.onChange,N=e.onBlur,S=e.onFocus,P=e.onKeydown,E=e.onKeyUp,I=e.onClickBtn,T=e.onClickRightIcon,q=e.onEnter,L=(0,o.useState)(""),F=L[0],R=L[1];(0,o.useEffect)((function(){void 0!==e.defaultValue&&R(e.defaultValue)}),[]),(0,o.useEffect)((function(){void 0!==y&&R(y)}),[y]);var B,_=function(){return x||(0,i.jsx)(u(),{},void 0)},A=function(){I&&I(F)};return(0,i.jsxs)("div",d({className:(B="paraui-search",n&&(B+=" "+n),s&&(B+=" search-"+s),v&&(B+=" search-"+v),h&&(B+=" search-showbtn"),g&&(B+=" search-btntext"),B)},{children:[(0,i.jsx)(r.default,{size:s,placeholder:j,value:F,rightIcon:w?k||(0,i.jsx)(l(),{},void 0):"",onClickIcon:function(){T&&T(F)},onChange:function(t){var n=t.target.value;void 0===e.value&&R(n),C&&C(n,t)},onBlur:N,onFocus:S,onKeydown:P,onKeyUp:E,onEnter:q,addonAfter:function(){if(h&&"inside"===v)return(0,i.jsx)(a.default,d({size:s,startIcon:_(),variant:"outlined",onClick:A},{children:g}),void 0)}()},void 0),h&&"outside"===v&&(0,i.jsx)(a.default,d({size:s,startIcon:_(),variant:"contained",onClick:A},{children:g}),void 0)]}),void 0)}},3672:function(e,t,n){var i=n(7712),o=n(9297),r=n(1731),a=n(3094),c=n(9011),l=n(8528),s=n.n(l),u=n(6570),d=n.n(u),f=n(3475),v=function(){return v=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},v.apply(this,arguments)},p=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n};t.default=function(e){var t=e.className,n=e.size,l=void 0===n?"large":n,u=e.labelMode,h=void 0===u?"outside":u,x=e.placeholder,b=void 0===x?"":x,g=e.label,m=void 0===g?"":g,j=e.disabled,y=void 0!==j&&j,k=e.multiline,O=void 0!==k&&k,w=e.required,C=void 0!==w&&w,N=e.labelSign,S=e.rows,P=void 0===S?2:S,E=e.error,I=void 0!==E&&E,T=e.helperText,q=void 0===T?"":T,L=e.addonBefore,F=void 0===L?"":L,R=e.addonAfter,B=void 0===R?"":R,_=(e.defaultValue,e.value),A=e.autoFocus,z=void 0!==A&&A,D=e.type,M=void 0===D?"text":D,U=e.onClickIcon,K=e.rightIcon,Z=e.showRightIcon,V=void 0===Z||Z,W=e.limitLength,H=e.fetchSuggestions,J=e.selectPopoverClass,$=e.renderSelectItem,G=e.showSelectName,Y=void 0===G?"value":G,Q=e.onBlur,X=e.onFocus,ee=e.onChange,te=e.onKeydown,ne=e.onKeyUp,ie=e.onEnter,oe=e.onClickAddonBefore,re=e.onClickAddonAfter,ae=e.onSelect,ce=p(e,["className","size","labelMode","placeholder","label","disabled","multiline","required","labelSign","rows","error","helperText","addonBefore","addonAfter","defaultValue","value","autoFocus","type","onClickIcon","rightIcon","showRightIcon","limitLength","fetchSuggestions","selectPopoverClass","renderSelectItem","showSelectName","onBlur","onFocus","onChange","onKeydown","onKeyUp","onEnter","onClickAddonBefore","onClickAddonAfter","onSelect"]),le=(0,o.useState)("text-field-select-content-"+(0,f.UUID)())[0],se=(0,o.useState)(!0),ue=se[0],de=se[1],fe=(0,o.useState)(""),ve=fe[0],pe=fe[1],he=(0,o.useState)(!1),xe=he[0],be=he[1],ge=(0,o.useState)("text"),me=ge[0],je=ge[1],ye=(0,o.useState)(!1),ke=ye[0],Oe=ye[1],we=(0,o.useState)(!1),Ce=we[0],Ne=we[1],Se=(0,o.useState)([]),Pe=Se[0],Ee=Se[1],Ie=((0,o.useState)({isCompositions:!0})[0],(0,o.useRef)(null)),Te=(0,o.useRef)(null);(0,o.useEffect)((function(){void 0!==e.defaultValue&&(pe(e.defaultValue),Fe(e.defaultValue))}),[]),(0,o.useEffect)((function(){M!==me&&je(M)}),[M]),(0,o.useEffect)((function(){void 0!==_&&(pe(_),Fe(_))}),[_]),(0,o.useEffect)((function(){de(""===ve||void 0===ve)}),[ve]),(0,o.useEffect)((function(){H&&Oe(xe)}),[xe,H]),(0,o.useEffect)((function(){return ke?window.addEventListener("keydown",Ae):window.removeEventListener("keydown",Ae),function(){window.removeEventListener("keydown",Ae)}}),[ke]),(0,o.useEffect)((function(){if(!xe&&ve){var t=Le(ve);if(t!==ve){var n={};n.target=Ie.current,n.target.value=t,e.onChange&&e.onChange(n)}}}),[ve,xe]);var qe,Le=function(t){var n=t;return e.limitLength&&t.toString().length>e.limitLength&&(n=n.toString().substr(0,e.limitLength)),n},Fe=function(e){Ie&&Ie.current&&(Ie.current.value=e,Ie.current.setAttribute("value",e))},Re=function(){y||(de(!1),(Ie&&Ie.current).focus())},Be=function(e){var t=e.selectDom,n=e.keyCode,i=e.currentDom,o="nextSibling",r=".text-field-select-content-item";38===n&&(o="previousSibling",r=".text-field-select-content-item:last-child"),i?(i=i[o])||(i=t.querySelector(r)):i=t.querySelector(".text-field-select-content-item"),i&&(i.classList.add("text-field-select-content-item-keydown"),_e(i,t))},_e=function(e,t){var n=t.clientHeight,i=e.offsetTop+e.clientHeight-n;t.scrollTop=i>0?i:0},Ae=function(e){var t=document.querySelector("."+le),n=null,i=t.querySelector(".text-field-select-content-item-keydown");if(13===e.keyCode&&i){var o=i.dataset.val;He(JSON.parse(o))(e),(Ie&&Ie.current).blur()}i&&(n=i,i.classList.remove("text-field-select-content-item-keydown")),40===e.keyCode&&Be({selectDom:t,keyCode:e.keyCode,currentDom:n}),38===e.keyCode&&Be({selectDom:t,keyCode:e.keyCode,currentDom:n})},ze=function(e){be(!1),""===e.target.value&&de(!0),Q&&Q(e)},De=function(e){Ne(!0),H&&H(e,(function(e){Ee(e||[]),Ne(!1)}))},Me=function(e){be(!0),X&&X(e),De(e.target.value)},Ue=function(t){var n=t.target.value;n&&de(!1),void 0===e.value&&(pe(n),Fe(n)),ee&&ee(t),De(t.target.value)},Ke=function(e){13===e.keyCode&&ie&&ie(e),te&&te(e)},Ze=function(e){ne&&ne(e)},Ve=function(e){"password"===M&&("text"===me&&je("password"),"password"===me&&je("text")),U&&U(e)},We=function(){Oe(!1)},He=function(e){return function(t){ae&&ae(e)}},Je=(0,o.useMemo)((function(){return(0,i.jsx)(i.Fragment,{children:void 0!==W&&(0,i.jsx)("span",v({className:"length-limit"},{children:(ve?ve.toString().length:0)+"/"+W}),void 0)},void 0)}),[W,ve]),$e=(0,o.useMemo)((function(){var e=K||("password"===M?"password"===me?(0,i.jsx)(d(),{},void 0):(0,i.jsx)(s(),{},void 0):null);return(0,i.jsx)(i.Fragment,{children:V&&e&&(0,i.jsx)("span",v({className:"right-icon",onClick:Ve},{children:e}),void 0)},void 0)}),[V,K,M,me]),Ge=(0,o.useMemo)((function(){return(0,i.jsxs)("div",v({className:"text-field-content-within",ref:Te},{children:[(0,i.jsxs)("div",v({className:"text-field-content-within-input"},{children:[O?(0,i.jsx)("textarea",v({ref:Ie,rows:P,onBlur:ze,onFocus:Me,onChange:Ue,onKeyDown:Ke,onKeyUp:Ze,disabled:y},ce),void 0):(0,i.jsx)("input",v({ref:Ie,type:me,onBlur:ze,onFocus:Me,onChange:Ue,onKeyDown:Ke,onKeyUp:Ze,disabled:y},ce),void 0),ue&&!xe&&(0,i.jsx)("span",v({className:"text-field-label-placeholder",onClick:Re},{children:"outside"===h?b:(0,i.jsxs)(i.Fragment,{children:[m||b,C&&(0,i.jsx)("span",v({className:"text-field-required"},{children:"*"}),void 0),N&&(0,i.jsx)("span",{children:N},void 0)]},void 0)}),void 0)]}),void 0),Je,$e]}),void 0)}),[ue,xe,z,me,ve,Je,$e,h,b,m,y,O,P,ce,ee,H]),Ye=(0,o.useMemo)((function(){var e;return(0,i.jsxs)("div",v({className:(e="text-field-select-content",Ce&&(e+=" text-field-select-content-loading"),le&&(e+=" "+le),e),style:{width:(Te&&Te.current?Te.current.offsetWidth:0)+"px"}},{children:[Pe&&Pe.map((function(e,t){return(0,i.jsx)("div",v({className:"text-field-select-content-item",onMouseDown:He(e),"data-val":JSON.stringify(e)},{children:$?$(e):(0,i.jsx)(a.default,{children:e[Y]},void 0)}),t)})),Ce&&(0,i.jsx)(c.default,{},void 0)]}),void 0)}),[Te,ke,Pe,$,Y,ae,Ce,le]),Qe=(0,o.useMemo)((function(){return(0,i.jsx)(r.Tooltip,v({open:ke,title:Ye,onClose:We,interactive:!0,disableFocusListener:!0,disableHoverListener:!0,disableTouchListener:!0,arrow:!0,classes:{popper:(e="paraui-text-field-select",l&&(e+=" paraui-text-field-select-"+l),J&&(e+=" "+J),e)}},{children:Ge}),void 0);var e}),[ue,xe,z,me,ve,Je,$e,h,b,m,y,O,P,ce,ee,H,ae,Te,ke,J,l]),Xe=(0,o.useMemo)((function(){var e=Boolean(C||N||m);return(0,i.jsx)(i.Fragment,{children:"outside"===h&&e&&(0,i.jsxs)("label",v({className:"text-field-label"},{children:[m,C&&(0,i.jsx)("span",v({className:"text-field-required"},{children:"*"}),void 0),N&&(0,i.jsx)("span",{children:N},void 0)]}),void 0)},void 0)}),[h,m,N,C]);return(0,i.jsxs)("div",v({className:(qe="paraui-text-field",qe+=" text-field",l&&!O&&(qe+=" text-field-"+l),t&&(qe+=" "+t),I&&(qe+=" text-field-error"),xe&&(qe+=" text-field-focus"),y&&(qe+=" text-field-disabled"),O&&(qe+=" text-field-multiline"),e.limitLength&&ve&&ve.toString().length>e.limitLength&&(qe+=" text-field-limit"),qe)},{children:[Xe,(0,i.jsxs)("div",v({className:"text-field-content"},{children:[F&&(0,i.jsx)("div",v({className:"text-field-content-before",onClick:function(e){oe&&oe(e)}},{children:F}),void 0),H?Qe:Ge,B&&(0,i.jsx)("div",v({className:"text-field-content-after",onClick:function(e){re&&re(e)}},{children:B}),void 0)]}),void 0),q&&(0,i.jsx)("p",v({className:"text-field-error-text"},{children:q}),void 0)]}),void 0)}},6885:function(e,t,n){var i=n(7712),o=n(1731),r=n(4927),a=function(){return a=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},a.apply(this,arguments)};t.default=function(e){var t,n=e.placement,c=void 0===n?"bottom":n,l=a(a({},e.classes),{popper:(0,r.Z)("paraui-tooltip",null===(t=e.classes)||void 0===t?void 0:t.popper,{"paraui-tooltip-left-right":(null==c?void 0:c.includes("left"))||(null==c?void 0:c.includes("right")),"paraui-tooltip-top-bottom":(null==c?void 0:c.includes("top"))||(null==c?void 0:c.includes("bottom"))})});return(0,i.jsx)(o.Tooltip,a({},e,{classes:l}),void 0)}},1596:function(e,t,n){n.r(t),n.d(t,{Transfer:function(){return h}});var i=n(7712),o=n(9297),r=n(6150),a=n(7785),c=n(4115),l=n.n(c),s=n(1127),u=n.n(s),d=n(6288),f=n.n(d),v=function(){return v=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},v.apply(this,arguments)},p=function(e,t,n){if(n||2===arguments.length)for(var i,o=0,r=t.length;o<r;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))},h=function(e){var t=e.data,n=void 0===t?[]:t,c=e.value,s=void 0===c?[]:c,d=e.onChange,h=e.titles,x=void 0===h?["左侧","右侧"]:h,b=(0,o.useState)(n),g=b[0],m=b[1],j=(0,o.useState)(s),y=j[0],k=j[1],O=(0,o.useState)(""),w=O[0],C=O[1],N=(0,o.useState)(""),S=N[0],P=N[1],E=(0,o.useState)(0),I=E[0],T=E[1],q=(0,o.useState)(0),L=q[0],F=q[1],R=(0,o.useState)(""),B=R[0],_=R[1],A=(0,o.useState)(""),z=A[0],D=A[1],M=(0,o.useCallback)((function(e,t,n,i){"left"===i?(g[n].checked=e.target.checked,m(p([],g,!0))):(y[n].checked=e.target.checked,k(p([],y,!0)))}),[g,y]),U=(0,o.useCallback)((function(e,t){"left"===t?(g.forEach((function(t){t.checked=e.target.checked})),m(p([],g,!0))):(y.forEach((function(t){t.checked=e.target.checked})),k(p([],y,!0))),console.log(e.target.checked),C(e.target.checked)}),[g,y]),K=(0,o.useCallback)((function(e){"left"===e?p([],y,!0).forEach((function(e){e.checked&&(e.checked=!1,g.push(e),y.splice(y.indexOf(e),1))})):p([],g,!0).forEach((function(e){e.checked&&(e.checked=!1,y.push(e),g.splice(g.indexOf(e),1))})),m(p([],g,!0)),k(p([],y,!0)),d&&d(y)}),[]),Z=(0,o.useCallback)((function(e,t){var n=p(p([""],e,!0),[""],!1).join(".*"),i=new RegExp(n),o=[];"left"===t?(o=g.filter((function(e){return i.test(e.name)||i.test(e.description)})),m(o)):(o=y.filter((function(e){return i.test(e.name)||i.test(e.description)})),k(o))}),[]);return(0,o.useEffect)((function(){var e=g.filter((function(e){return e.checked}));T(e.length),e.length&&e.length!==g.length?(C("indeterminate"),D("on")):e.length&&e.length===g.length?(C("checked"),D("on")):(C(""),D(""));var t=y.filter((function(e){return e.checked}));F(t.length),t.length&&t.length!==y.length?(P("indeterminate"),_("on")):t.length&&t.length===y.length?(P("checked"),_("on")):(P(""),_(""))}),[g,y]),(0,i.jsxs)("div",v({className:"transfer"},{children:[(0,i.jsxs)("div",v({className:"box"},{children:[(0,i.jsxs)("div",v({className:"box-header"},{children:[(0,i.jsx)(r.Checkbox,{label:x[0],size:"medium",checked:"checked"===w,indeterminate:"indeterminate"===w,onChange:function(e){U(e,"left")}},1),(0,i.jsxs)("div",v({className:"count"},{children:[I,"/",g.length]}),void 0)]}),void 0),(0,i.jsx)(a.Search,{btnType:"inside",placeholder:"请输入搜索内容",showBtn:!1,rightIcon:(0,i.jsx)(l(),{},void 0),onChange:function(e){Z(e,"left")}},void 0),(0,i.jsx)("div",v({className:"context"},{children:g.map((function(e,t){return(0,i.jsx)("div",v({className:"item"},{children:(0,i.jsx)(r.Checkbox,{label:e.name,size:"medium",checked:e.checked,disabled:e.disabled,onChange:function(e,n){M(e,n,t,"left")}},void 0)}),e.name)}))}),void 0)]}),void 0),(0,i.jsxs)("div",v({className:"moveBtn"},{children:[(0,i.jsx)("div",v({className:"btn "+B,onClick:function(){K("left")}},{children:(0,i.jsx)(u(),{},void 0)}),void 0),(0,i.jsx)("div",v({className:"btn "+z,onClick:function(){K("right")}},{children:(0,i.jsx)(f(),{},void 0)}),void 0)]}),void 0),(0,i.jsxs)("div",v({className:"box"},{children:[(0,i.jsxs)("div",v({className:"box-header"},{children:[(0,i.jsx)(r.Checkbox,{label:x[1],size:"medium",checked:"checked"===S,indeterminate:"indeterminate"===S,onChange:function(e){U(e,"right")}},void 0),(0,i.jsxs)("div",v({className:"count"},{children:[L,"/",y.length]}),void 0)]}),void 0),(0,i.jsx)(a.Search,{btnType:"inside",placeholder:"请输入搜索内容",showBtn:!1,rightIcon:(0,i.jsx)(l(),{},void 0),onChange:function(e){Z(e,"right")}},void 0),(0,i.jsx)("div",v({className:"context"},{children:y.map((function(e,t){return(0,i.jsx)("div",v({className:"item"},{children:(0,i.jsx)(r.Checkbox,{label:e.name,size:"medium",checked:e.checked,disabled:e.disabled,onChange:function(e,n){M(e,n,t,"right")}},void 0)}),e.name)}))}),void 0)]}),void 0)]}),void 0)};t.default=h},1731:function(t){t.exports=e},6088:function(e){e.exports=t},6028:function(e){e.exports=n},2749:function(e){e.exports=i},1127:function(e){e.exports=o},1102:function(e){e.exports=r},6570:function(e){e.exports=a},8528:function(e){e.exports=c},6288:function(e){e.exports=l},4115:function(e){e.exports=s},3475:function(e){e.exports=u},9297:function(e){e.exports=d}},p={};function h(e){var t=p[e];if(void 0!==t)return t.exports;var n=p[e]={exports:{}};return v[e](n,n.exports,h),n.exports}h.m=v,f=[],h.O=function(e,t,n,i){if(!t){var o=1/0;for(c=0;c<f.length;c++){t=f[c][0],n=f[c][1],i=f[c][2];for(var r=!0,a=0;a<t.length;a++)(!1&i||o>=i)&&Object.keys(h.O).every((function(e){return h.O[e](t[a])}))?t.splice(a--,1):(r=!1,i<o&&(o=i));r&&(f.splice(c--,1),e=n())}return e}i=i||0;for(var c=f.length;c>0&&f[c-1][2]>i;c--)f[c]=f[c-1];f[c]=[t,n,i]},h.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return h.d(t,{a:t}),t},h.d=function(e,t){for(var n in t)h.o(t,n)&&!h.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},h.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},h.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e={1852:0,1465:0,6615:0,7056:0,5717:0,3708:0,2996:0,2823:0,9296:0};h.O.j=function(t){return 0===e[t]};var t=function(t,n){var i,o,r=n[0],a=n[1],c=n[2],l=0;for(i in a)h.o(a,i)&&(h.m[i]=a[i]);if(c)var s=c(h);for(t&&t(n);l<r.length;l++)o=r[l],h.o(e,o)&&e[o]&&e[o][0](),e[r[l]]=0;return h.O(s)},n=self.webpackChunkParaUI=self.webpackChunkParaUI||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}();var x=h.O(void 0,[9296],(function(){return h(1596)}));return x=h.O(x)}()}));
|
package/Tree/index.js
CHANGED
|
@@ -13,4 +13,4 @@ var n=Object.getOwnPropertySymbols,r=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
|
-
r(4126);var t=r(9297),o=60103;if(n.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var i=Symbol.for;o=i("react.element"),n.Fragment=i("react.fragment")}var a=t.__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 l(e,n,r){var t,i={},l=null,s=null;for(t in void 0!==r&&(l=""+r),void 0!==n.key&&(l=""+n.key),void 0!==n.ref&&(s=n.ref),n)c.call(n,t)&&!u.hasOwnProperty(t)&&(i[t]=n[t]);if(e&&e.defaultProps)for(t in n=e.defaultProps)void 0===i[t]&&(i[t]=n[t]);return{$$typeof:o,type:e,key:l,ref:s,props:i,_owner:a.current}}n.jsx=l,n.jsxs=l},7712:function(e,n,r){e.exports=r(9524)},4296:function(e,n,r){var t=r(7712),o=r(9297),i=function(){return i=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},i.apply(this,arguments)};n.default=function(e){var n=e.className,r=void 0===n?"":n,a=e.label,c=void 0===a?"":a,u=e.size,l=void 0===u?"large":u,s=e.disabled,d=void 0!==s&&s,f=e.onChange,p=(0,o.useState)(!1),v=p[0],h=p[1];(0,o.useEffect)((function(){void 0!==e.defaultChecked&&h(e.defaultChecked)}),[]),(0,o.useEffect)((function(){void 0!==e.checked&&h(e.checked)}),[e.checked]);var y;return(0,t.jsxs)("label",i({className:(y="paraui-radio",r&&(y+=" "+r),l&&(y+=" radio-"+l),d&&(y+=" radio-disabled"),v&&(y+=" radio-checked"),y),onClick:function(n){n.preventDefault(),d||(void 0===e.checked&&h(!v),n.target.checked=!v,f&&f(n,!v))}},{children:[(0,t.jsxs)("span",i({className:"paraui-radio-box"},{children:[(0,t.jsx)("input",i({type:"radio",value:v},e.inputProps),void 0),(0,t.jsx)("span",{className:"paraui-radio-box-inner"},void 0)]}),void 0),c&&(0,t.jsx)("span",i({className:"paraui-radio-label"},{children:c}),void 0)]}),void 0)}},6885:function(e,n,r){var t=r(7712),o=r(1731),i=r(4927),a=function(){return a=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},a.apply(this,arguments)};n.default=function(e){var n,r=a(a({},e.classes),{popper:(0,i.Z)("paraui-tooltip",null===(n=e.classes)||void 0===n?void 0:n.popper)});return(0,t.jsx)(o.Tooltip,a({},e,{classes:r},{children:e.children}),void 0)}},3160:function(e,n,r){r.r(n),r.d(n,{default:function(){return V}});var t=r(7712),o=r(9297),i=r.n(o),a=r(5768),c=r.n(a),u=r(4927),l=function(e,n){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(t=Object.getOwnPropertySymbols(e);o<t.length;o++)n.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(r[t[o]]=e[t[o]])}return r},s=function(e){var n=[];return function e(r){if("object"!=typeof r||!r)return r;for(var t=0;t<n.length;t++)if(n[t].target===r)return n[t].copyTarget;var o={};return Array.isArray(r)&&(o=[]),n.push({target:r,copyTarget:o}),Object.keys(r).forEach((function(n){o[n]||(o[n]=e(r[n]))})),o}(e)},d=function(e){return e?e.reduce((function(e,n){var r=n.children,t=void 0===r?[]:r,o=l(n,["children"]);return e.concat([o],d(t))}),[]):[]},f=function(e,n){void 0===n&&(n={key:"key",parentId:"parentId"});for(var r=[],t=e.reduce((function(e,r){return e[r[n.key]]=r,e}),{}),o=0,i=e;o<i.length;o++){var a=i[o],c=a[n.parentId];if(c in t){var u=t[c];u.children=u.children||[],u.children.push(a)}else r.push(a)}return r},p=r(1102),v=r.n(p),h=r(9767),y=r.n(h),m=r(8381),g=r.n(m),b=r(4296),x=function(){return{height:0,opacity:0}},k=function(e){return{height:e.scrollHeight,opacity:1}},w=function(e,n){return"height"===n.propertyName},j={motionName:"paraui-motion-collapse",onAppearStart:x,onEnterStart:x,onAppearActive:k,onEnterActive:k,onLeaveStart:function(e){return{height:e.offsetHeight}},onLeaveActive:x,onAppearEnd:w,onEnterEnd:w,onLeaveEnd:w,motionDeadline:500};var O=r(2268),E=r.n(O),C=r(4984),P=r.n(C),I=r(17),S=r.n(I),N=r(6243),q=r.n(N),T=r(2749),F=r.n(T),R=r(6885),L=r(3475),_=function(){return _=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},_.apply(this,arguments)},A={add:{icon:(0,t.jsx)(S(),{},void 0),text:"新增"},edit:{icon:(0,t.jsx)(P(),{},void 0),text:"编辑"},enable:{icon:(0,t.jsx)(F(),{},void 0),text:"禁用"},del:{icon:(0,t.jsx)(q(),{},void 0),text:"删除"}},D=function(e){var n,r=e.actionsCallback,i=e.opRef,a=e.mouseInRef,c=e.showActions,l=e.onRemove,s=(0,o.useRef)(null),d=(0,o.useRef)((0,L.UUID)().replace(/-/g,"")),f=(0,o.useState)({}),p=f[0],v=f[1],h=(0,o.useState)(!1),y=h[0],m=h[1],g=(0,o.useState)(!1),b=g[0],x=g[1],k=i.current,w=function(e,n){return{left:Math.round(Math.sin(Math.PI/180*n)*e)+"px",top:-Math.round(Math.cos(Math.PI/180*n)*e+12)+"px"}},j=function(e,n){var r=0;return 4===e?r=n*60:3===e?r=(2*n+1)*30:2===e?r=(n+1)*60:1===e?r=90:5===e?r=n*45:e>5&&e<=7?r=n*30:e>7&&(r=n*20),r},O=function(){var e,n,r=document.getElementById(d.current),t=null===(e=null==r?void 0:r.getElementsByClassName("sector-item-container"))||void 0===e?void 0:e[0],o=(null==t?void 0:t.childNodes)||[],a=null==t?void 0:t.parentNode,c=(n=o.length)<=4?40:5===n?60:n>5&&n<7?80:100;a&&function(e,n){var r,t,o=(null===(t=null===(r=i.current)||void 0===r?void 0:r.anchorEl)||void 0===t?void 0:t.getBoundingClientRect())||{},a=o.top,c=o.left,u=n+24+12,l=2*n+24+12;a=a-l/2+o.height/2,e.style.cssText="\n position: fixed;\n width:".concat(u,"px;\n height: ").concat(l,"px;\n top: ").concat(a,"px;\n left: ").concat(c,"px;\n ")}(a,c);for(var u=0;u<o.length;u++){var l=o[u];l.style.transition=".3s",l.style.opacity=1;var s=j(o.length,u),f=w(c,s),p=f.left,v=f.top;l.style.transform="translate(".concat(p,",").concat(v,")")}},C=function(e,n){n?(v(e),O()):function(){for(var e,n,r=document.getElementById(d.current),t=null===(e=null==r?void 0:r.getElementsByClassName("sector-item-container"))||void 0===e?void 0:e[0],o=(null==t?void 0:t.childNodes)||[],i=0;i<o.length;i++){var a=o[i];a.style.transition=".3s",a.style.transform="translate(0,0)",a.style.opacity=0}null===(n=null==r?void 0:r.parentNode)||void 0===n||n.removeChild(r),x(!1)}()};return(0,o.useImperativeHandle)(i,(function(){return _(_({},k),{uid:d.current,onShowSector:C})})),(0,o.useEffect)((function(){var e;b||((e=document.getElementById(d.current))||((e=document.createElement("div")).id=d.current,e.style.position="fixed",e.style.top="-9999px",document.body.appendChild(e),x(!0)),m(!0),s.current=e)}),[b]),(0,o.useEffect)((function(){return function(){var e,n;null===(n=null===(e=s.current)||void 0===e?void 0:e.parentNode)||void 0===n||n.removeChild(s.current),x(!1)}}),[]),(0,t.jsx)(t.Fragment,{children:y&&E().createPortal((0,t.jsx)("div",_({className:"sector-container",onMouseLeave:function(){null==l||l(k.anchorEl)},onMouseEnter:function(){a.current=!0}},{children:(0,t.jsx)("ul",_({className:"sector-item-container"},{children:(n=function(e,n){if(void 0===e||!1===e)return[];if(!0===e)return Object.keys(A).map((function(e){return _(_({},A[e]),{action:e})}));var r=[];return Object.keys(e).forEach((function(t){var o=e[t];"customizeActions"!==t?"object"==typeof o?"function"==typeof o.show?o.show(n)&&r.push(_(_(_({},A[t]),o),{action:t})):r.push(_(_(_({},A[t]),o),{action:t})):"function"==typeof o?o(n)&&r.push(_(_({},A[t]),{action:t})):o&&r.push(_(_({},A[t]),{action:t})):Array.isArray(o)&&o.length&&o.forEach((function(e){"function"==typeof e.show?e.show(n)&&r.push(e):r.push(e)}))})),r}(c,p),(null==n?void 0:n.length)?n.map((function(e,n){var o=null!=e?e:{},i=o.action,a=o.text,c=o.icon;return(0,t.jsx)(R.default,_({title:a},{children:(0,t.jsx)("li",_({className:(0,u.Z)("sector-item",{"sector-item--del":"del"===i}),onClick:function(e){return function(e,n,t){t.stopPropagation(),null==r||r(e,n,t)}(p,i,e)}},{children:c}),void 0)}),n)})):null)}),void 0)}),void 0),s.current)},void 0)},M=r(9962),K=r.n(M),z=function(){return z=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},z.apply(this,arguments)},B=function(e,n,r,t){return new(r||(r=Promise))((function(o,i){function a(e){try{u(t.next(e))}catch(e){i(e)}}function c(e){try{u(t.throw(e))}catch(e){i(e)}}function u(e){var n;e.done?o(e.value):(n=e.value,n instanceof r?n:new r((function(e){e(n)}))).then(a,c)}u((t=t.apply(e,n||[])).next())}))},U=function(e,n){var r,t,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,t&&(o=2&i[0]?t.return:i[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,i[1])).done)return o;switch(t=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,t=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=n.call(e,a)}catch(e){i=[6,e],t=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}},Z=function(e,n,r){if(r||2===arguments.length)for(var t,o=0,i=n.length;o<i;o++)!t&&o in n||(t||(t=Array.prototype.slice.call(n,0,o)),t[o]=n[o]);return e.concat(t||Array.prototype.slice.call(n))},H={page:1,size:10},Y=i().forwardRef((function(e,n){var r=e.url,i=e.ctx,a=e.params,l=void 0===a?null:a,p=e.method,h=void 0===p?"GET":p,m=e.requestCallback,x=e.refresh,k=e.replaceFields,w=void 0===k?{key:"key",parentId:"parentId",children:"children",title:"title",loadKey:"key"}:k,j=e.treeData,O=e.prefixCls,E=e.className,C=e.showIcon,P=e.showLine,I=e.switcherIcon,S=e.blockNode,N=e.checkable,q=e.selectable,T=e.radioable,F=void 0!==T&&T,R=e.showRadio,_=void 0===R||R,A=e.checkStrictly,M=void 0!==A&&A,Y=e.actionsCallback,G=e.showActions,V=e.checkedKeys,$=e.defaultCheckedKeys,W=e.expandedKeys,J=e.defaultExpandedKeys,Q=e.onCheck,X=e.onExpand,ee=e.asyncLoad,ne=void 0!==ee&&ee,re=e.pagination,te=void 0!==re&&re,oe=e.pageSize,ie=void 0===oe?H:oe,ae=e.loadData,ce=e.localFilter,ue=void 0!==ce&&ce,le=e.localParams,se=e.onFilter,de=e.loadMoreNode,fe=void 0===de?null:de,pe=e.paramsCallback,ve=(0,o.useState)([]),he=ve[0],ye=ve[1],me=(0,o.useState)([]),ge=me[0],be=me[1],xe=(0,o.useState)([]),ke=xe[0],we=xe[1],je=(0,o.useRef)({}),Oe=(0,o.useRef)(!1),Ee=(0,o.useRef)(-1),Ce=(0,o.useRef)([]),Pe=function(e,n){return n||(e?"paraui-".concat(e):"paraui")}("tree",O),Ie=(0,o.useRef)({}),Se=(0,o.useRef)([]),Ne=function(e,n){for(var r=[],t=d(n),o=function(e){-1===t.findIndex((function(n){return n.key===e}))&&r.push(e)},i=0,a=e;i<a.length;i++)o(a[i]);return r}(ge,he),qe=z(z({},H),ie),Te=z(z({},e),{showLine:Boolean(P),checkStrictly:F||M,showIcon:F||C}),Fe=function(){var e;return(0,u.Z)("paraui-tree",((e={})["".concat(Pe,"-icon-hide")]=!C,e["".concat(Pe,"-block-node")]=S,e["".concat(Pe,"-unselectable")]=!q,e["".concat(Pe,"-radioable")]=F,e["".concat(Pe,"-radioable-showradio")]=F&&_,e),E)},Re=function(e){return w&&function e(n){var r=w||{},t=r.key,o=r.title,i=r.children,a=r.parentId;n.forEach((function(n){var r;t&&(n.key=n[t]),o&&(n.title=n[o]),i&&(n.children=n[i]),a&&(n.parentId=n[a]),(null===(r=n.children)||void 0===r?void 0:r.length)&&e(n.children)}))}(e),e},Le=function(e){return(0,t.jsxs)("span",z({className:"paraui-tree-title-wrapper",onMouseEnter:_e,onMouseLeave:Ae},{children:[e.title,(0,t.jsx)("div",z({className:"sector-anchor",onMouseEnter:function(n){return Me(e,n)},onMouseLeave:Ke},{children:(0,t.jsx)(K(),{},void 0)}),void 0)]}),void 0)},_e=function(e){e.stopPropagation(),Ze();var n=e.currentTarget;if(n){var r=n.closest(".paraui-tree-node-content-wrapper");Ce.current.push(r),De(r,!0)}},Ae=function(e){e.stopPropagation(),Ze();var n=e.currentTarget;if(n){var r=n.closest(".paraui-tree-node-content-wrapper");De(r,!1)}},De=function(e,n){e&&(n?null==e||e.classList.add("paraui-tree-node-content-wrapper--active"):null==e||e.classList.remove("paraui-tree-node-content-wrapper--active"))},Me=function(e,n){n.stopPropagation();var r=n.currentTarget;je.current.anchorEl=r,Ee.current=setTimeout((function(){clearTimeout(Ee.current),ze(r,e)}),300)},Ke=function(e){e.stopPropagation(),clearTimeout(Ee.current);var n=e.currentTarget,r=setTimeout((function(){clearTimeout(r),Oe.current||Be(n)}),300)},ze=function(e,n){var r,t,o=document.getElementById(je.current.uid);(e.classList.add("sector-anchor--active"),o)&&(o.querySelector(".sector-container")&&(null===(t=null===(r=je.current)||void 0===r?void 0:r.onShowSector)||void 0===t||t.call(r,n,!0)))},Be=function(e){var n,r;e&&(e.classList.remove("sector-anchor--active"),null===(r=null===(n=je.current)||void 0===n?void 0:n.onShowSector)||void 0===r||r.call(n,{},!1))},Ue=function(e){if(e){var n=e.closest(".paraui-tree-node-content-wrapper");De(n,!1),Be(e)}},Ze=function(){var e;(null===(e=Ce.current)||void 0===e?void 0:e.length)&&(Ce.current.forEach((function(e){var n;null===(n=null==e?void 0:e.classList)||void 0===n||n.remove("paraui-tree-node-content-wrapper--active")})),Ce.current.length=0)},He=function(e,n){var r=[],t=[];if(F){var o=n.node,i=w.key;n.checked&&(r=[o[i]])}else M?(r=e.checked,t=e.halfChecked):r=e;var a=Z(Z([],r,!0),Ne,!0);be(a),null==Q||Q(a,n,t)},Ye=function(e,n){we(Z([],e,!0)),null==X||X(e,n)},Ge=function(e){return void 0===e&&(e={}),B(void 0,void 0,void 0,(function(){var n,t,o,a,c,u;return U(this,(function(l){switch(l.label){case 0:return r?(n=(null==pe?void 0:pe(e))||e,t=null==h?void 0:h.toUpperCase(),(u={url:r,ctx:i,method:t})["GET"===t?"params":"data"]=n||{},o=u,[4,(0,L.Request)(o)]):[2,[]];case 1:return a=l.sent(),c=a.data,a.err?[2,[]]:[2,c.data||[]]}}))}))},Ve=function(e,n,r,t){return"ROOT_KEY"===n?(e.pop(),e.concat(r)):e.map((function(e){if(e.key===n){if(t){var o=e.children||[];return o.pop(),z(z({},e),{children:o.concat(r)})}return z(z({},e),{children:r})}return e.children?z(z({},e),{children:Ve(e.children,n,r,t)}):e}))},$e=function(e){var n=e.key,r=e.children,t=e.parentId,o=e.moreFlag;return new Promise((function(e){return B(void 0,void 0,void 0,(function(){var i,a,c,u,s,d,f,p,v,h,y,g;return U(this,(function(b){switch(b.label){case 0:return r?(e(),[2]):(i=n,a=w.loadKey,c=z(((g={})[a]=i,g),l),te&&(o&&(i=t,Ie.current[i].page+=1,c[a]=i,"ROOT_KEY"===i&&delete c[a]),c.page=Ie.current[i].page,c.size=Ie.current[i].size),[4,Ge(c)]);case 1:return u=b.sent(),[4,null==m?void 0:m(u)];case 2:return(s=b.sent())&&(u=s),d={},te&&(f=u.list,p=void 0===f?[]:f,v=u.page,h=u.size,y=u.total,u=p,d={page:v,size:h,total:y}),(null==u?void 0:u.length)?(u=Re(u),te&&(u=We(u,d,i)),ye((function(e){return Ve(e,i,u,o)}))):ye([]),e(),[2]}}))}))}))},We=function(e,n,r){var o,i,a,c=f(e);if(n.page*n.size<n.total){var u={key:String((1e6*Math.random()|0)+Date.now()),title:"加载更多",checkable:!1,disableCheckbox:!0,isLeaf:!0,selectable:!1,icon:null,moreFlag:!0};u.parentId=r||"ROOT_KEY",u.title=(o=u,(0,t.jsx)("span",z({className:"paraui-treenode-more-wrapper",onClick:function(e){e.stopPropagation(),$e(o)}},{children:fe||o.title}),void 0)),c.push(u)}return Ie.current=(i=c,a=Ie.current,(null==i?void 0:i.length)?(i.forEach((function(e){var n=e.moreFlag?e.parentId:e.key;a[n]||(a[n]=z(z({},e),qe))})),a):a),c};(0,o.useEffect)((function(){$&&be(Z([],$,!0)),J&&we(Z([],J,!0))}),[$,J]),(0,o.useEffect)((function(){V&&be(Z([],V,!0)),W&&we(Z([],W,!0))}),[V,W]),(0,o.useEffect)((function(){if(Array.isArray(j)){var e=Re(j);ue&&(Se.current=s(e)),Te.defaultExpandAll&&function(e){var n=[];W||J||(function e(r){r.forEach((function(r){var t;(null===(t=r.children)||void 0===t?void 0:t.length)&&(n.push(r.key),e(r.children))}))}(e),n.length&&we(n))}(e),ye(Z([],e,!0))}else B(void 0,void 0,void 0,(function(){var e,n,r,t,o,i,a,c,u;return U(this,(function(d){switch(d.label){case 0:return e=z({},l),te&&(e.page=qe.page,e.size=qe.size),[4,Ge(e)];case 1:return n=d.sent(),r={},[4,null==m?void 0:m(n)];case 2:return(t=d.sent())&&(n=t),te&&(o=n.list,i=void 0===o?[]:o,a=n.page,c=n.size,u=n.total,n=i,r={page:a,size:c,total:u},Ie.current={}),(null==n?void 0:n.length)?(n=Re(n),ue&&(Se.current=s(n)),te&&(n=We(n,r)),ye(Z([],n,!0)),[2]):[2,ye([])]}}))}))}),[r,i,l,h,x,j]),(0,o.useEffect)((function(){function e(n){return n.reduce((function(n,r){return n.concat(r.key,e(r.children||[]))}),[])}if(ue){if(se){var n=se(Se.current);if(!n)return;return void ye(n)}!function(n){var r=n.searchKey,t=n.searchValue;if(r){if(""===t)return ye(Se.current),void we(Z([],W||J||[],!0));var o=d(Se.current),i=o.reduce((function(e,n){return String(n[r]).toLowerCase().includes(null==t?void 0:t.toLowerCase())?e.concat(n):e}),[]),a=function(e,n,r){void 0===r&&(r={key:"key",parentId:"parentId"});for(var t={},o=e.reduce((function(e,n){return e[n[r.key]]=n,e}),{}),i=n.reduce((function(e,n){return e[n[r.key]]=n,e}),{}),a=0,c=e;a<c.length;a++){var u=c[a];u[r.key]in i&&l(u)}function l(e){t[e[r.key]]=e;var n=o[e[r.parentId]];n&&(t[n[r.key]]=n,n[r.parentId]&&l(n))}var s=Object.keys(t).reduce((function(e,n){return e.concat(t[n])}),[]);return f(s)}(s(o),i);ye(a),we(e(a))}}(le)}}),[ue,le]);var Je=(0,o.useMemo)((function(){return(null==he?void 0:he.length)?(0,t.jsx)(c(),z({itemHeight:20,ref:n},Te,{prefixCls:Pe,className:Fe(),checkable:F||N?(0,t.jsx)("span",{className:"".concat(Pe,"-checkbox-inner")},void 0):N,selectable:!F&&q,switcherIcon:function(e){return function(e,n,r,i){var a,c=i.isLeaf,l=(i.expanded,i.loading);if(i.eventKey,l)return(0,t.jsx)(v(),{className:"".concat(e,"-switcher-loading-icon")},void 0);if(r&&"object"==typeof r&&(a=r.showLeafIcon),c)return r?"object"!=typeof r||a?(0,t.jsx)(y(),{className:"".concat(e,"-switcher-line-icon")},void 0):(0,t.jsx)("span",{className:"".concat(e,"-switcher-leaf-line")},void 0):null;var s="".concat(e,"-switcher-icon");return(0,o.isValidElement)(n)?(0,o.cloneElement)(n,{className:(0,u.Z)(n.props.className||"",s)}):n||(r?(0,t.jsx)(g(),{className:"".concat(e,"-switcher-line-icon")},void 0):(0,t.jsx)(g(),{className:s},void 0))}(Pe,I,P,e)}},(e={},ne&&(e.loadData=$e),ae&&(e.loadData=ae),G&&(e.titleRender=Le),e),{treeData:he,checkedKeys:ge,expandedKeys:ke,onCheck:He,onExpand:Ye,icon:function(e){return!1===e.checkable?null:F&&_?function(e,n,r,o){var i;if(!n)return null;var a=o.key,c=(null===(i=e.data)||void 0===i?void 0:i[a])===r;return(0,t.jsx)(b.default,{className:"paraui-tree-node-radio",checked:c},void 0)}(e,F,ge[0],w):null}}),void 0):null;var e}),[he,ge,ke,Te.selectedKeys]);return(0,t.jsxs)(t.Fragment,{children:[Je,G?(0,t.jsx)(D,{opRef:je,mouseInRef:Oe,actionsCallback:Y,onRemove:Ue,showActions:G},void 0):null]},void 0)}));Y.defaultProps={checkable:!1,selectable:!0,showIcon:!1,motion:z(z({},j),{motionAppear:!1}),blockNode:!1};var G=Y,V=(r(8075),G)},8075:function(){Element.prototype.closest||(Element.prototype.closest=function(e){var n=this;if(!document.documentElement.contains(n))return null;do{if(n.matches(e))return n;n=n.parentElement}while(null!==n);return null})},1731:function(n){n.exports=e},6243:function(e){e.exports=n},9767:function(e){e.exports=r},8381:function(e){e.exports=t},4984:function(e){e.exports=o},2749:function(e){e.exports=i},1102:function(e){e.exports=a},9962:function(e){e.exports=c},17:function(e){e.exports=u},3475:function(e){e.exports=l},5768:function(e){e.exports=s},9297:function(e){e.exports=d},2268:function(e){e.exports=f}},h={};function y(e){var n=h[e];if(void 0!==n)return n.exports;var r=h[e]={exports:{}};return v[e](r,r.exports,y),r.exports}y.m=v,p=[],y.O=function(e,n,r,t){if(!n){var o=1/0;for(c=0;c<p.length;c++){n=p[c][0],r=p[c][1],t=p[c][2];for(var i=!0,a=0;a<n.length;a++)(!1&t||o>=t)&&Object.keys(y.O).every((function(e){return y.O[e](n[a])}))?n.splice(a--,1):(i=!1,t<o&&(o=t));i&&(p.splice(c--,1),e=r())}return e}t=t||0;for(var c=p.length;c>0&&p[c-1][2]>t;c--)p[c]=p[c-1];p[c]=[n,r,t]},y.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return y.d(n,{a:n}),n},y.d=function(e,n){for(var r in n)y.o(n,r)&&!y.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},y.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},y.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e={8170:0,6573:0,2823:0,9296:0};y.O.j=function(n){return 0===e[n]};var n=function(n,r){var t,o,i=r[0],a=r[1],c=r[2],u=0;for(t in a)y.o(a,t)&&(y.m[t]=a[t]);if(c)var l=c(y);for(n&&n(r);u<i.length;u++)o=i[u],y.o(e,o)&&e[o]&&e[o][0](),e[i[u]]=0;return y.O(l)},r=self.webpackChunkParaUI=self.webpackChunkParaUI||[];r.forEach(n.bind(null,0)),r.push=n.bind(null,r.push.bind(r))}();var m=y.O(void 0,[9296],(function(){return y(3160)}));return m=y.O(m)}()}));
|
|
16
|
+
r(4126);var t=r(9297),o=60103;if(n.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var i=Symbol.for;o=i("react.element"),n.Fragment=i("react.fragment")}var a=t.__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 l(e,n,r){var t,i={},l=null,s=null;for(t in void 0!==r&&(l=""+r),void 0!==n.key&&(l=""+n.key),void 0!==n.ref&&(s=n.ref),n)c.call(n,t)&&!u.hasOwnProperty(t)&&(i[t]=n[t]);if(e&&e.defaultProps)for(t in n=e.defaultProps)void 0===i[t]&&(i[t]=n[t]);return{$$typeof:o,type:e,key:l,ref:s,props:i,_owner:a.current}}n.jsx=l,n.jsxs=l},7712:function(e,n,r){e.exports=r(9524)},4296:function(e,n,r){var t=r(7712),o=r(9297),i=function(){return i=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},i.apply(this,arguments)};n.default=function(e){var n=e.className,r=void 0===n?"":n,a=e.label,c=void 0===a?"":a,u=e.size,l=void 0===u?"large":u,s=e.disabled,d=void 0!==s&&s,f=e.onChange,p=(0,o.useState)(!1),v=p[0],h=p[1];(0,o.useEffect)((function(){void 0!==e.defaultChecked&&h(e.defaultChecked)}),[]),(0,o.useEffect)((function(){void 0!==e.checked&&h(e.checked)}),[e.checked]);var y;return(0,t.jsxs)("label",i({className:(y="paraui-radio",r&&(y+=" "+r),l&&(y+=" radio-"+l),d&&(y+=" radio-disabled"),v&&(y+=" radio-checked"),y),onClick:function(n){n.preventDefault(),d||(void 0===e.checked&&h(!v),n.target.checked=!v,f&&f(n,!v))}},{children:[(0,t.jsxs)("span",i({className:"paraui-radio-box"},{children:[(0,t.jsx)("input",i({type:"radio",value:v},e.inputProps),void 0),(0,t.jsx)("span",{className:"paraui-radio-box-inner"},void 0)]}),void 0),c&&(0,t.jsx)("span",i({className:"paraui-radio-label"},{children:c}),void 0)]}),void 0)}},6885:function(e,n,r){var t=r(7712),o=r(1731),i=r(4927),a=function(){return a=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},a.apply(this,arguments)};n.default=function(e){var n,r=e.placement,c=void 0===r?"bottom":r,u=a(a({},e.classes),{popper:(0,i.Z)("paraui-tooltip",null===(n=e.classes)||void 0===n?void 0:n.popper,{"paraui-tooltip-left-right":(null==c?void 0:c.includes("left"))||(null==c?void 0:c.includes("right")),"paraui-tooltip-top-bottom":(null==c?void 0:c.includes("top"))||(null==c?void 0:c.includes("bottom"))})});return(0,t.jsx)(o.Tooltip,a({},e,{classes:u}),void 0)}},3160:function(e,n,r){r.r(n),r.d(n,{default:function(){return V}});var t=r(7712),o=r(9297),i=r.n(o),a=r(5768),c=r.n(a),u=r(4927),l=function(e,n){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(t=Object.getOwnPropertySymbols(e);o<t.length;o++)n.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(r[t[o]]=e[t[o]])}return r},s=function(e){var n=[];return function e(r){if("object"!=typeof r||!r)return r;for(var t=0;t<n.length;t++)if(n[t].target===r)return n[t].copyTarget;var o={};return Array.isArray(r)&&(o=[]),n.push({target:r,copyTarget:o}),Object.keys(r).forEach((function(n){o[n]||(o[n]=e(r[n]))})),o}(e)},d=function(e){return e?e.reduce((function(e,n){var r=n.children,t=void 0===r?[]:r,o=l(n,["children"]);return e.concat([o],d(t))}),[]):[]},f=function(e,n){void 0===n&&(n={key:"key",parentId:"parentId"});for(var r=[],t=e.reduce((function(e,r){return e[r[n.key]]=r,e}),{}),o=0,i=e;o<i.length;o++){var a=i[o],c=a[n.parentId];if(c in t){var u=t[c];u.children=u.children||[],u.children.push(a)}else r.push(a)}return r},p=r(1102),v=r.n(p),h=r(9767),y=r.n(h),m=r(8381),g=r.n(m),b=r(4296),x=function(){return{height:0,opacity:0}},k=function(e){return{height:e.scrollHeight,opacity:1}},w=function(e,n){return"height"===n.propertyName},j={motionName:"paraui-motion-collapse",onAppearStart:x,onEnterStart:x,onAppearActive:k,onEnterActive:k,onLeaveStart:function(e){return{height:e.offsetHeight}},onLeaveActive:x,onAppearEnd:w,onEnterEnd:w,onLeaveEnd:w,motionDeadline:500};var O=r(2268),E=r.n(O),C=r(4984),P=r.n(C),I=r(17),S=r.n(I),N=r(6243),q=r.n(N),T=r(2749),R=r.n(T),A=r(6885),F=r(3475),L=function(){return L=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},L.apply(this,arguments)},_={add:{icon:(0,t.jsx)(S(),{},void 0),text:"新增"},edit:{icon:(0,t.jsx)(P(),{},void 0),text:"编辑"},enable:{icon:(0,t.jsx)(R(),{},void 0),text:"禁用"},del:{icon:(0,t.jsx)(q(),{},void 0),text:"删除"}},D=function(e){var n,r=e.actionsCallback,i=e.opRef,a=e.mouseInRef,c=e.showActions,l=e.onRemove,s=(0,o.useRef)(null),d=(0,o.useRef)((0,F.UUID)().replace(/-/g,"")),f=(0,o.useState)({}),p=f[0],v=f[1],h=(0,o.useState)(!1),y=h[0],m=h[1],g=(0,o.useState)(!1),b=g[0],x=g[1],k=i.current,w=function(e,n){return{left:Math.round(Math.sin(Math.PI/180*n)*e)+"px",top:-Math.round(Math.cos(Math.PI/180*n)*e+12)+"px"}},j=function(e,n){var r=0;return 4===e?r=n*60:3===e?r=(2*n+1)*30:2===e?r=(n+1)*60:1===e?r=90:5===e?r=n*45:e>5&&e<=7?r=n*30:e>7&&(r=n*20),r},O=function(){var e,n,r=document.getElementById(d.current),t=null===(e=null==r?void 0:r.getElementsByClassName("sector-item-container"))||void 0===e?void 0:e[0],o=(null==t?void 0:t.childNodes)||[],a=null==t?void 0:t.parentNode,c=(n=o.length)<=4?40:5===n?60:n>5&&n<7?80:100;a&&function(e,n){var r,t,o=(null===(t=null===(r=i.current)||void 0===r?void 0:r.anchorEl)||void 0===t?void 0:t.getBoundingClientRect())||{},a=o.top,c=o.left,u=n+24+12,l=2*n+24+12;a=a-l/2+o.height/2,e.style.cssText="\n position: fixed;\n width:".concat(u,"px;\n height: ").concat(l,"px;\n top: ").concat(a,"px;\n left: ").concat(c,"px;\n ")}(a,c);for(var u=0;u<o.length;u++){var l=o[u];l.style.transition=".3s",l.style.opacity=1;var s=j(o.length,u),f=w(c,s),p=f.left,v=f.top;l.style.transform="translate(".concat(p,",").concat(v,")")}},C=function(e,n){n?(v(e),O()):function(){for(var e,n,r=document.getElementById(d.current),t=null===(e=null==r?void 0:r.getElementsByClassName("sector-item-container"))||void 0===e?void 0:e[0],o=(null==t?void 0:t.childNodes)||[],i=0;i<o.length;i++){var a=o[i];a.style.transition=".3s",a.style.transform="translate(0,0)",a.style.opacity=0}null===(n=null==r?void 0:r.parentNode)||void 0===n||n.removeChild(r),x(!1)}()};return(0,o.useImperativeHandle)(i,(function(){return L(L({},k),{uid:d.current,onShowSector:C})})),(0,o.useEffect)((function(){var e;b||((e=document.getElementById(d.current))||((e=document.createElement("div")).id=d.current,e.style.position="fixed",e.style.top="-9999px",document.body.appendChild(e),x(!0)),m(!0),s.current=e)}),[b]),(0,o.useEffect)((function(){return function(){var e,n;null===(n=null===(e=s.current)||void 0===e?void 0:e.parentNode)||void 0===n||n.removeChild(s.current),x(!1)}}),[]),(0,t.jsx)(t.Fragment,{children:y&&E().createPortal((0,t.jsx)("div",L({className:"sector-container",onMouseLeave:function(){null==l||l(k.anchorEl)},onMouseEnter:function(){a.current=!0}},{children:(0,t.jsx)("ul",L({className:"sector-item-container"},{children:(n=function(e,n){if(void 0===e||!1===e)return[];if(!0===e)return Object.keys(_).map((function(e){return L(L({},_[e]),{action:e})}));var r=[];return Object.keys(e).forEach((function(t){var o=e[t];"customizeActions"!==t?"object"==typeof o?"function"==typeof o.show?o.show(n)&&r.push(L(L(L({},_[t]),o),{action:t})):r.push(L(L(L({},_[t]),o),{action:t})):"function"==typeof o?o(n)&&r.push(L(L({},_[t]),{action:t})):o&&r.push(L(L({},_[t]),{action:t})):Array.isArray(o)&&o.length&&o.forEach((function(e){"function"==typeof e.show?e.show(n)&&r.push(e):r.push(e)}))})),r}(c,p),(null==n?void 0:n.length)?n.map((function(e,n){var o=null!=e?e:{},i=o.action,a=o.text,c=o.icon;return(0,t.jsx)(A.default,L({title:a},{children:(0,t.jsx)("li",L({className:(0,u.Z)("sector-item",{"sector-item--del":"del"===i}),onClick:function(e){return function(e,n,t){t.stopPropagation(),null==r||r(e,n,t)}(p,i,e)}},{children:c}),void 0)}),n)})):null)}),void 0)}),void 0),s.current)},void 0)},M=r(9962),K=r.n(M),z=function(){return z=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},z.apply(this,arguments)},B=function(e,n,r,t){return new(r||(r=Promise))((function(o,i){function a(e){try{u(t.next(e))}catch(e){i(e)}}function c(e){try{u(t.throw(e))}catch(e){i(e)}}function u(e){var n;e.done?o(e.value):(n=e.value,n instanceof r?n:new r((function(e){e(n)}))).then(a,c)}u((t=t.apply(e,n||[])).next())}))},U=function(e,n){var r,t,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,t&&(o=2&i[0]?t.return:i[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,i[1])).done)return o;switch(t=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,t=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=n.call(e,a)}catch(e){i=[6,e],t=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}},Z=function(e,n,r){if(r||2===arguments.length)for(var t,o=0,i=n.length;o<i;o++)!t&&o in n||(t||(t=Array.prototype.slice.call(n,0,o)),t[o]=n[o]);return e.concat(t||Array.prototype.slice.call(n))},H={page:1,size:10},Y=i().forwardRef((function(e,n){var r=e.url,i=e.ctx,a=e.params,l=void 0===a?null:a,p=e.method,h=void 0===p?"GET":p,m=e.requestCallback,x=e.refresh,k=e.replaceFields,w=void 0===k?{key:"key",parentId:"parentId",children:"children",title:"title",loadKey:"key"}:k,j=e.treeData,O=e.prefixCls,E=e.className,C=e.showIcon,P=e.showLine,I=e.switcherIcon,S=e.blockNode,N=e.checkable,q=e.selectable,T=e.radioable,R=void 0!==T&&T,A=e.showRadio,L=void 0===A||A,_=e.checkStrictly,M=void 0!==_&&_,Y=e.actionsCallback,G=e.showActions,V=e.checkedKeys,$=e.defaultCheckedKeys,W=e.expandedKeys,J=e.defaultExpandedKeys,Q=e.onCheck,X=e.onExpand,ee=e.asyncLoad,ne=void 0!==ee&&ee,re=e.pagination,te=void 0!==re&&re,oe=e.pageSize,ie=void 0===oe?H:oe,ae=e.loadData,ce=e.localFilter,ue=void 0!==ce&&ce,le=e.localParams,se=e.onFilter,de=e.loadMoreNode,fe=void 0===de?null:de,pe=e.paramsCallback,ve=(0,o.useState)([]),he=ve[0],ye=ve[1],me=(0,o.useState)([]),ge=me[0],be=me[1],xe=(0,o.useState)([]),ke=xe[0],we=xe[1],je=(0,o.useRef)({}),Oe=(0,o.useRef)(!1),Ee=(0,o.useRef)(-1),Ce=(0,o.useRef)([]),Pe=function(e,n){return n||(e?"paraui-".concat(e):"paraui")}("tree",O),Ie=(0,o.useRef)({}),Se=(0,o.useRef)([]),Ne=function(e,n){for(var r=[],t=d(n),o=function(e){-1===t.findIndex((function(n){return n.key===e}))&&r.push(e)},i=0,a=e;i<a.length;i++)o(a[i]);return r}(ge,he),qe=z(z({},H),ie),Te=(0,o.useRef)([]),Re=z(z({},e),{showLine:Boolean(P),checkStrictly:R||M,showIcon:R||C}),Ae=function(){var e;return(0,u.Z)("paraui-tree",((e={})["".concat(Pe,"-icon-hide")]=!C,e["".concat(Pe,"-block-node")]=S,e["".concat(Pe,"-unselectable")]=!q,e["".concat(Pe,"-radioable")]=R,e["".concat(Pe,"-radioable-showradio")]=R&&L,e),E)},Fe=function(e){return w&&function e(n){var r=w||{},t=r.key,o=r.title,i=r.children,a=r.parentId;n.forEach((function(n){var r;t&&(n.key=n[t]),o&&(n.title=n[o]),i&&(n.children=n[i]),a&&(n.parentId=n[a]),(null===(r=n.children)||void 0===r?void 0:r.length)&&e(n.children)}))}(e),e},Le=function(e){return(0,t.jsxs)("span",z({className:"paraui-tree-title-wrapper",onMouseEnter:_e,onMouseLeave:De},{children:[e.title,(0,t.jsx)("div",z({className:"sector-anchor",onMouseEnter:function(n){return Ke(e,n)},onMouseLeave:ze},{children:(0,t.jsx)(K(),{},void 0)}),void 0)]}),void 0)},_e=function(e){e.stopPropagation(),He();var n=e.currentTarget;if(n){var r=n.closest(".paraui-tree-node-content-wrapper");Ce.current.push(r),Me(r,!0)}},De=function(e){e.stopPropagation(),He();var n=e.currentTarget;if(n){var r=n.closest(".paraui-tree-node-content-wrapper");Me(r,!1)}},Me=function(e,n){e&&(n?null==e||e.classList.add("paraui-tree-node-content-wrapper--active"):null==e||e.classList.remove("paraui-tree-node-content-wrapper--active"))},Ke=function(e,n){n.stopPropagation();var r=n.currentTarget;je.current.anchorEl=r,Ee.current=setTimeout((function(){clearTimeout(Ee.current),Be(r,e)}),300)},ze=function(e){e.stopPropagation(),clearTimeout(Ee.current);var n=e.currentTarget,r=setTimeout((function(){clearTimeout(r),Oe.current||Ue(n)}),300)},Be=function(e,n){var r,t,o=document.getElementById(je.current.uid);(e.classList.add("sector-anchor--active"),o)&&(o.querySelector(".sector-container")&&(null===(t=null===(r=je.current)||void 0===r?void 0:r.onShowSector)||void 0===t||t.call(r,n,!0)))},Ue=function(e){var n,r;e&&(e.classList.remove("sector-anchor--active"),null===(r=null===(n=je.current)||void 0===n?void 0:n.onShowSector)||void 0===r||r.call(n,{},!1))},Ze=function(e){if(e){var n=e.closest(".paraui-tree-node-content-wrapper");Me(n,!1),Ue(e)}},He=function(){var e;(null===(e=Ce.current)||void 0===e?void 0:e.length)&&(Ce.current.forEach((function(e){var n;null===(n=null==e?void 0:e.classList)||void 0===n||n.remove("paraui-tree-node-content-wrapper--active")})),Ce.current.length=0)},Ye=function(e,n){var r=[],t=[];if(R){var o=n.node,i=w.key;n.checked&&(r=[o[i]])}else M?(r=e.checked,t=e.halfChecked,Te.current=t):r=e;var a=Z(Z([],r,!0),Ne,!0);be(a),null==Q||Q(a,n,t)},Ge=function(e,n){we(Z([],e,!0)),null==X||X(e,n)},Ve=function(e){return void 0===e&&(e={}),B(void 0,void 0,void 0,(function(){var n,t,o,a,c,u;return U(this,(function(l){switch(l.label){case 0:return r?(n=(null==pe?void 0:pe(e))||e,t=null==h?void 0:h.toUpperCase(),(u={url:r,ctx:i,method:t})["GET"===t?"params":"data"]=n||{},o=u,[4,(0,F.Request)(o)]):[2,[]];case 1:return a=l.sent(),c=a.data,a.err?[2,[]]:[2,c.data||[]]}}))}))},$e=function(e,n,r,t){return"ROOT_KEY"===n?(e.pop(),e.concat(r)):e.map((function(e){if(e.key===n){if(t){var o=e.children||[];return o.pop(),z(z({},e),{children:o.concat(r)})}return z(z({},e),{children:r})}return e.children?z(z({},e),{children:$e(e.children,n,r,t)}):e}))},We=function(e){var n=e.key,r=e.children,t=e.parentId,o=e.moreFlag;return new Promise((function(e){return B(void 0,void 0,void 0,(function(){var i,a,c,u,s,d,f,p,v,h,y,g;return U(this,(function(b){switch(b.label){case 0:return r?(e(),[2]):(i=n,a=w.loadKey,c=z(((g={})[a]=i,g),l),te&&(o&&(i=t,Ie.current[i].page+=1,c[a]=i,"ROOT_KEY"===i&&delete c[a]),c.page=Ie.current[i].page,c.size=Ie.current[i].size),[4,Ve(c)]);case 1:return u=b.sent(),[4,null==m?void 0:m(u)];case 2:return(s=b.sent())&&(u=s),d={},te&&(f=u.list,p=void 0===f?[]:f,v=u.page,h=u.size,y=u.total,u=p,d={page:v,size:h,total:y}),(null==u?void 0:u.length)?(u=Fe(u),te&&(u=Je(u,d,i)),ye((function(e){return $e(e,i,u,o)}))):ye([]),e(),[2]}}))}))}))},Je=function(e,n,r){var o,i,a,c=f(e);if(n.page*n.size<n.total){var u={key:String((1e6*Math.random()|0)+Date.now()),title:"加载更多",checkable:!1,disableCheckbox:!0,isLeaf:!0,selectable:!1,icon:null,moreFlag:!0};u.parentId=r||"ROOT_KEY",u.title=(o=u,(0,t.jsx)("span",z({className:"paraui-treenode-more-wrapper",onClick:function(e){e.stopPropagation(),We(o)}},{children:fe||o.title}),void 0)),c.push(u)}return Ie.current=(i=c,a=Ie.current,(null==i?void 0:i.length)?(i.forEach((function(e){var n=e.moreFlag?e.parentId:e.key;a[n]||(a[n]=z(z({},e),qe))})),a):a),c};(0,o.useEffect)((function(){$&&be(Z([],$,!0)),J&&we(Z([],J,!0))}),[$,J]),(0,o.useEffect)((function(){var e;V&&(be(Z([],(e=V,Array.isArray(e)?e:e.checked),!0)),Te.current=function(e){return Array.isArray(e)?[]:e.halfChecked}(V)),W&&we(Z([],W,!0))}),[V,W]),(0,o.useEffect)((function(){if(Array.isArray(j)){var e=Fe(j);ue&&(Se.current=s(e)),Re.defaultExpandAll&&function(e){var n=[];W||J||(function e(r){r.forEach((function(r){var t;(null===(t=r.children)||void 0===t?void 0:t.length)&&(n.push(r.key),e(r.children))}))}(e),n.length&&we(n))}(e),ye(Z([],e,!0))}else B(void 0,void 0,void 0,(function(){var e,n,r,t,o,i,a,c,u;return U(this,(function(d){switch(d.label){case 0:return e=z({},l),te&&(e.page=qe.page,e.size=qe.size),[4,Ve(e)];case 1:return n=d.sent(),r={},[4,null==m?void 0:m(n)];case 2:return(t=d.sent())&&(n=t),te&&(o=n.list,i=void 0===o?[]:o,a=n.page,c=n.size,u=n.total,n=i,r={page:a,size:c,total:u},Ie.current={}),(null==n?void 0:n.length)?(n=Fe(n),ue&&(Se.current=s(n)),te&&(n=Je(n,r)),ye(Z([],n,!0)),[2]):[2,ye([])]}}))}))}),[r,i,l,h,x,j]),(0,o.useEffect)((function(){function e(n){return n.reduce((function(n,r){return n.concat(r.key,e(r.children||[]))}),[])}if(ue){if(se){var n=se(Se.current);if(!n)return;return void ye(n)}!function(n){var r=n.searchKey,t=n.searchValue;if(r){if(""===t)return ye(Se.current),void we(Z([],W||J||[],!0));var o=d(Se.current),i=o.reduce((function(e,n){return String(n[r]).toLowerCase().includes(null==t?void 0:t.toLowerCase())?e.concat(n):e}),[]),a=function(e,n,r){void 0===r&&(r={key:"key",parentId:"parentId"});for(var t={},o=e.reduce((function(e,n){return e[n[r.key]]=n,e}),{}),i=n.reduce((function(e,n){return e[n[r.key]]=n,e}),{}),a=0,c=e;a<c.length;a++){var u=c[a];u[r.key]in i&&l(u)}function l(e){t[e[r.key]]=e;var n=o[e[r.parentId]];n&&(t[n[r.key]]=n,n[r.parentId]&&l(n))}var s=Object.keys(t).reduce((function(e,n){return e.concat(t[n])}),[]);return f(s)}(s(o),i);ye(a),we(e(a))}}(le)}}),[ue,le]);var Qe=(0,o.useMemo)((function(){if(!(null==he?void 0:he.length))return null;var e,r=ge;return M&&(r={checked:ge,halfChecked:Te.current}),(0,t.jsx)(c(),z({itemHeight:20,ref:n},Re,{prefixCls:Pe,className:Ae(),checkable:R||N?(0,t.jsx)("span",{className:"".concat(Pe,"-checkbox-inner")},void 0):N,selectable:!R&&q,switcherIcon:function(e){return function(e,n,r,i){var a,c=i.isLeaf,l=(i.expanded,i.loading);if(i.eventKey,l)return(0,t.jsx)(v(),{className:"".concat(e,"-switcher-loading-icon")},void 0);if(r&&"object"==typeof r&&(a=r.showLeafIcon),c)return r?"object"!=typeof r||a?(0,t.jsx)(y(),{className:"".concat(e,"-switcher-line-icon")},void 0):(0,t.jsx)("span",{className:"".concat(e,"-switcher-leaf-line")},void 0):null;var s="".concat(e,"-switcher-icon");return(0,o.isValidElement)(n)?(0,o.cloneElement)(n,{className:(0,u.Z)(n.props.className||"",s)}):n||(r?(0,t.jsx)(g(),{className:"".concat(e,"-switcher-line-icon")},void 0):(0,t.jsx)(g(),{className:s},void 0))}(Pe,I,P,e)}},(e={},ne&&(e.loadData=We),ae&&(e.loadData=ae),G&&(e.titleRender=Le),e),{treeData:he,checkedKeys:r,expandedKeys:ke,onCheck:Ye,onExpand:Ge,icon:function(e){return!1===e.checkable?null:R&&L?function(e,n,r,o){var i;if(!n)return null;var a=o.key,c=(null===(i=e.data)||void 0===i?void 0:i[a])===r;return(0,t.jsx)(b.default,{className:"paraui-tree-node-radio",checked:c},void 0)}(e,R,ge[0],w):null}}),void 0)}),[he,ge,ke,Re.selectedKeys]);return(0,t.jsxs)(t.Fragment,{children:[Qe,G?(0,t.jsx)(D,{opRef:je,mouseInRef:Oe,actionsCallback:Y,onRemove:Ze,showActions:G},void 0):null]},void 0)}));Y.defaultProps={checkable:!1,selectable:!0,showIcon:!1,motion:z(z({},j),{motionAppear:!1}),blockNode:!1};var G=Y,V=(r(8075),G)},8075:function(){Element.prototype.closest||(Element.prototype.closest=function(e){var n=this;if(!document.documentElement.contains(n))return null;do{if(n.matches(e))return n;n=n.parentElement}while(null!==n);return null})},1731:function(n){n.exports=e},6243:function(e){e.exports=n},9767:function(e){e.exports=r},8381:function(e){e.exports=t},4984:function(e){e.exports=o},2749:function(e){e.exports=i},1102:function(e){e.exports=a},9962:function(e){e.exports=c},17:function(e){e.exports=u},3475:function(e){e.exports=l},5768:function(e){e.exports=s},9297:function(e){e.exports=d},2268:function(e){e.exports=f}},h={};function y(e){var n=h[e];if(void 0!==n)return n.exports;var r=h[e]={exports:{}};return v[e](r,r.exports,y),r.exports}y.m=v,p=[],y.O=function(e,n,r,t){if(!n){var o=1/0;for(c=0;c<p.length;c++){n=p[c][0],r=p[c][1],t=p[c][2];for(var i=!0,a=0;a<n.length;a++)(!1&t||o>=t)&&Object.keys(y.O).every((function(e){return y.O[e](n[a])}))?n.splice(a--,1):(i=!1,t<o&&(o=t));i&&(p.splice(c--,1),e=r())}return e}t=t||0;for(var c=p.length;c>0&&p[c-1][2]>t;c--)p[c]=p[c-1];p[c]=[n,r,t]},y.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return y.d(n,{a:n}),n},y.d=function(e,n){for(var r in n)y.o(n,r)&&!y.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},y.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},y.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e={8170:0,6573:0,2823:0,9296:0};y.O.j=function(n){return 0===e[n]};var n=function(n,r){var t,o,i=r[0],a=r[1],c=r[2],u=0;for(t in a)y.o(a,t)&&(y.m[t]=a[t]);if(c)var l=c(y);for(n&&n(r);u<i.length;u++)o=i[u],y.o(e,o)&&e[o]&&e[o][0](),e[i[u]]=0;return y.O(l)},r=self.webpackChunkParaUI=self.webpackChunkParaUI||[];r.forEach(n.bind(null,0)),r.push=n.bind(null,r.push.bind(r))}();var m=y.O(void 0,[9296],(function(){return y(3160)}));return m=y.O(m)}()}));
|
package/Tree/interface.d.ts
CHANGED
|
@@ -26,6 +26,10 @@ export declare type IActions = boolean | {
|
|
|
26
26
|
del?: ActionItem;
|
|
27
27
|
customizeActions?: CustomActionItem[];
|
|
28
28
|
};
|
|
29
|
+
export declare type ICheckedKeys = Key[] | {
|
|
30
|
+
checked: Key[];
|
|
31
|
+
halfChecked: Key[];
|
|
32
|
+
};
|
|
29
33
|
export interface TreeProps extends Omit<RcTreeProps, 'prefixCls' | 'showLine' | 'direction' | 'onCheck' | 'loadData' | 'onExpand'> {
|
|
30
34
|
/** 是否展示连接线 */
|
|
31
35
|
showLine?: boolean | {
|
|
@@ -52,7 +56,7 @@ export interface TreeProps extends Omit<RcTreeProps, 'prefixCls' | 'showLine' |
|
|
|
52
56
|
/** (受控)展开指定的树节点 */
|
|
53
57
|
expandedKeys?: Key[];
|
|
54
58
|
/** (受控)选中复选框的树节点 */
|
|
55
|
-
checkedKeys?:
|
|
59
|
+
checkedKeys?: ICheckedKeys;
|
|
56
60
|
/** 默认选中复选框的树节点 */
|
|
57
61
|
defaultCheckedKeys?: Key[];
|
|
58
62
|
/** (受控)设置选中的树节点 */
|
|
@@ -115,9 +119,9 @@ export interface TreeProps extends Omit<RcTreeProps, 'prefixCls' | 'showLine' |
|
|
|
115
119
|
/** radioable为true时是否显示radio*/
|
|
116
120
|
showRadio?: boolean;
|
|
117
121
|
/** 点击复选框触发 */
|
|
118
|
-
onCheck?: (checkedKeys:
|
|
122
|
+
onCheck?: (checkedKeys: Key[], info: any, halfCheckedKeys?: Key[]) => void;
|
|
119
123
|
/** 展开/收起节点时触发 */
|
|
120
|
-
onExpand?: (expandedKeys:
|
|
124
|
+
onExpand?: (expandedKeys: Key[], info: {
|
|
121
125
|
node: EventDataNode;
|
|
122
126
|
expanded: boolean;
|
|
123
127
|
nativeEvent: MouseEvent;
|
package/Tree/utils/tools.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DataNode, Key } from "rc-tree/lib/interface";
|
|
1
2
|
interface RFiled {
|
|
2
3
|
key: string;
|
|
3
4
|
parentId: string;
|
|
@@ -13,6 +14,13 @@ export declare const deepCopy: (target: any) => any;
|
|
|
13
14
|
export declare const flatten: (data: any[]) => any[];
|
|
14
15
|
export declare const convert: (list: any, rFiled?: RFiled) => any;
|
|
15
16
|
export declare const convertByFilter: (sourceList: any[], filterList: any[], rFiled?: RFiled) => any[];
|
|
16
|
-
export declare const getUnMatchDataOfKeys: (keys:
|
|
17
|
-
export declare const
|
|
17
|
+
export declare const getUnMatchDataOfKeys: (keys: Key[], oriData: DataNode[]) => Key[];
|
|
18
|
+
export declare const getCheckedKeys: (cKeys: Key[] | {
|
|
19
|
+
checked: Key[];
|
|
20
|
+
halfChecked: Key[];
|
|
21
|
+
}) => Key[];
|
|
22
|
+
export declare const getHalfCheckedKeys: (cKeys: Key[] | {
|
|
23
|
+
checked: Key[];
|
|
24
|
+
halfChecked: Key[];
|
|
25
|
+
}) => Key[];
|
|
18
26
|
export {};
|