@para-ui/core 2.2.20 → 2.2.23
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/Button/index.js +1 -1
- package/ButtonGroup/index.js +1 -1
- package/Cascader/index.js +1 -1
- package/CollapseBox/index.js +1 -1
- package/CollapseLayout/index.d.ts +51 -0
- package/CollapseLayout/index.js +15 -0
- package/ComboSelect/index.js +2 -2
- package/DatePicker/index.js +1 -1
- package/Drawer/index.js +1 -1
- package/Empty/index.js +1 -1
- package/Form/index.js +2 -2
- package/FormItem/index.js +2 -2
- package/FunctionModal/index.js +1 -1
- package/Menu/index.js +1 -1
- package/Modal/index.js +1 -1
- package/OperateBtn/index.js +1 -1
- package/PageHeader/index.js +1 -1
- package/Pagination/index.js +1 -1
- package/PopConfirm/index.js +1 -1
- package/Querying/index.js +1 -1
- package/README.md +20 -0
- package/Search/index.js +1 -1
- package/Select/index.js +1 -1
- package/SelectInput/index.js +1 -1
- package/Selector/index.js +1 -1
- package/SelectorPicker/index.js +1 -1
- package/Table/index.js +2 -2
- package/Table/interface.d.ts +2 -0
- package/Tabs/index.js +1 -1
- package/TimePicker/index.js +1 -1
- package/Title/index.d.ts +30 -0
- package/Title/index.js +15 -0
- package/ToggleButton/index.js +1 -1
- package/Transfer/index.d.ts +24 -4
- package/Transfer/index.js +2 -2
- package/Transfer/lang/en_US.d.ts +2 -0
- package/Transfer/lang/index.d.ts +4 -0
- package/Transfer/lang/zh_CN.d.ts +2 -0
- package/Tree/index.js +1 -1
- package/Upload/index.js +1 -1
- package/cdn/Button/index.js +1 -1
- package/cdn/ButtonGroup/index.js +1 -1
- package/cdn/Cascader/index.js +3 -3
- package/cdn/CollapseLayout/index.js +29 -0
- package/cdn/ComboSelect/index.js +2 -2
- package/cdn/DatePicker/index.js +1 -1
- package/cdn/Drawer/index.js +1 -1
- package/cdn/Empty/index.js +1 -1
- package/cdn/Form/index.js +2 -2
- package/cdn/FormItem/index.js +2 -2
- package/cdn/FunctionModal/index.js +1 -1
- package/cdn/Modal/index.js +1 -1
- package/cdn/OperateBtn/index.js +5 -5
- package/cdn/PageHeader/index.js +5 -5
- package/cdn/Pagination/index.js +1 -1
- package/cdn/PopConfirm/index.js +1 -1
- package/cdn/Querying/index.js +1 -1
- package/cdn/Search/index.js +1 -1
- package/cdn/Select/index.js +1 -1
- package/cdn/SelectInput/index.js +1 -1
- package/cdn/Selector/index.js +1 -1
- package/cdn/SelectorPicker/index.js +1 -1
- package/cdn/Table/index.js +5 -5
- package/cdn/Tabs/index.js +1 -1
- package/cdn/TimePicker/index.js +1 -1
- package/cdn/Title/index.js +1 -0
- package/cdn/ToggleButton/index.js +1 -1
- package/cdn/Transfer/index.js +5 -5
- package/cdn/Tree/index.js +1 -1
- package/cdn/Upload/index.js +1 -1
- package/index.d.ts +4 -2
- package/index.js +3 -3
- package/package.json +1 -1
- package/style.css +4 -2
- package/Test/index.d.ts +0 -2
- package/Test/index.js +0 -16
- package/cdn/Test/index.js +0 -1
package/Button/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
|
-
*/n(7418);var r=n(8156),i=60103;if(o.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var e=Symbol.for;i=e("react.element"),o.Fragment=e("react.fragment")}var a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u=Object.prototype.hasOwnProperty,c={key:!0,ref:!0,__self:!0,__source:!0};function l(t,o,n){var r,e={},l=null,s=null;for(r in void 0!==n&&(l=""+n),void 0!==o.key&&(l=""+o.key),void 0!==o.ref&&(s=o.ref),o)u.call(o,r)&&!c.hasOwnProperty(r)&&(e[r]=o[r]);if(t&&t.defaultProps)for(r in o=t.defaultProps)void 0===e[r]&&(e[r]=o[r]);return{$$typeof:i,type:t,key:l,ref:s,props:e,_owner:a.current}}o.jsx=l,o.jsxs=l},5893:function(t,o,n){"use strict";t.exports=n(5251)},5822:function(t,o,n){var r=n(3379),i=n(8313);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[t.id,i,""]]);var e={insert:("body","body"),singleton:!1};r(i,e);t.exports=i.locals||{}},2310:function(t,o,n){var r=n(3379),i=n(9929);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[t.id,i,""]]);var e={insert:("body","body"),singleton:!1};r(i,e);t.exports=i.locals||{}},3379:function(t,o,n){"use strict";var r,i=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},e=function(){var t={};return function(o){if(void 0===t[o]){var n=document.querySelector(o);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}t[o]=n}return t[o]}}(),a=[];function u(t){for(var o=-1,n=0;n<a.length;n++)if(a[n].identifier===t){o=n;break}return o}function c(t,o){for(var n={},r=[],i=0;i<t.length;i++){var e=t[i],c=o.base?e[0]+o.base:e[0],l=n[c]||0,s="".concat(c," ").concat(l);n[c]=l+1;var p=u(s),d={css:e[1],media:e[2],sourceMap:e[3]};-1!==p?(a[p].references++,a[p].updater(d)):a.push({identifier:s,updater:v(d,o),references:1}),r.push(s)}return r}function l(t){var o=document.createElement("style"),r=t.attributes||{};if(void 0===r.nonce){var i=n.nc;i&&(r.nonce=i)}if(Object.keys(r).forEach((function(t){o.setAttribute(t,r[t])})),"function"==typeof t.insert)t.insert(o);else{var a=e(t.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(o)}return o}var s,p=(s=[],function(t,o){return s[t]=o,s.filter(Boolean).join("\n")});function d(t,o,n,r){var i=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(t.styleSheet)t.styleSheet.cssText=p(o,i);else{var e=document.createTextNode(i),a=t.childNodes;a[o]&&t.removeChild(a[o]),a.length?t.insertBefore(e,a[o]):t.appendChild(e)}}function b(t,o,n){var r=n.css,i=n.media,e=n.sourceMap;if(i?t.setAttribute("media",i):t.removeAttribute("media"),e&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(e))))," */")),t.styleSheet)t.styleSheet.cssText=r;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(r))}}var f=null,g=0;function v(t,o){var n,r,i;if(o.singleton){var e=g++;n=f||(f=l(o)),r=d.bind(null,n,e,!1),i=d.bind(null,n,e,!0)}else n=l(o),r=b.bind(null,n,o),i=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(n)};return r(t),function(o){if(o){if(o.css===t.css&&o.media===t.media&&o.sourceMap===t.sourceMap)return;r(t=o)}else i()}}t.exports=function(t,o){(o=o||{}).singleton||"boolean"==typeof o.singleton||(o.singleton=i());var n=c(t=t||[],o);return function(t){if(t=t||[],"[object Array]"===Object.prototype.toString.call(t)){for(var r=0;r<n.length;r++){var i=u(n[r]);a[i].references--}for(var e=c(t,o),l=0;l<n.length;l++){var s=u(n[l]);0===a[s].references&&(a[s].updater(),a.splice(s,1))}n=e}}}},3054:function(t,o,n){"use strict";var r=n(8156),i=n.n(r),e=n(5395),a=n.n(e);o.Z=function(t,o){var n=i().useContext(a()).intlFormat;return o.zh_CN=o.zh,o.en_US=o.en,n&&n(t,o)}},7371:function(t,o,n){"use strict";var r=n(5893),i=n(670),e=n(5744),a=n.n(e),u=(n(2310),function(){return u=Object.assign||function(t){for(var o,n=1,r=arguments.length;n<r;n++)for(var i in o=arguments[n])Object.prototype.hasOwnProperty.call(o,i)&&(t[i]=o[i]);return t},u.apply(this,arguments)}),c=function(t,o){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&o.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)o.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};o.default=function(t){var o,n=t.placement,e=void 0===n?"top-start":n,l=t.className,s=t.arrow,p=void 0===s||s,d=t.PopperProps,b=t.boundariesElement,f=void 0===b?"scrollParent":b,g=c(t,["placement","className","arrow","PopperProps","boundariesElement"]),v=u(u({},t.classes),{popper:a()("paraui-tooltip",l,null===(o=t.classes)||void 0===o?void 0:o.popper,{"paraui-tooltip-left-right":(null==e?void 0:e.includes("left"))||(null==e?void 0:e.includes("right")),"paraui-tooltip-top-bottom":(null==e?void 0:e.includes("top"))||(null==e?void 0:e.includes("bottom"))})});return(0,r.jsx)(i.Tooltip,u({},g,{enterTouchDelay:0,arrow:p,placement:e,classes:v,PopperProps:u(u({},d),{modifiers:{preventOverflow:{boundariesElement:f}}})}))}},670:function(t){"use strict";t.exports=o},5395:function(t){"use strict";t.exports=a},2396:function(t){"use strict";t.exports=e},3835:function(t){"use strict";t.exports=i},2788:function(t){"use strict";t.exports=r},5744:function(t){"use strict";t.exports=n},8156:function(o){"use strict";o.exports=t}},c={};function l(t){var o=c[t];if(void 0!==o)return o.exports;var n=c[t]={id:t,exports:{}};return u[t](n,n.exports,l),n.exports}l.n=function(t){var o=t&&t.__esModule?function(){return t.default}:function(){return t};return l.d(o,{a:o}),o},l.d=function(t,o){for(var n in o)l.o(o,n)&&!l.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})},l.o=function(t,o){return Object.prototype.hasOwnProperty.call(t,o)},l.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},l.nc=void 0;var s={};return function(){"use strict";l.r(s),l.d(s,{Button:function(){return m},default:function(){return y}});var t=l(5893),o=l(8156),n=l(670),r=l(5744),i=l.n(r),e=l(2788),a=l.n(e),u=l(3835),c=l.n(u),p=l(7371),d=l(2396),b=l.n(d),f=l(3054),g={zh:{moreActions:"更多操作"},en:{moreActions:"More actions"}},v=function(){return v=Object.assign||function(t){for(var o,n=1,r=arguments.length;n<r;n++)for(var i in o=arguments[n])Object.prototype.hasOwnProperty.call(o,i)&&(t[i]=o[i]);return t},v.apply(this,arguments)};l(5822);var h=function(){return h=Object.assign||function(t){for(var o,n=1,r=arguments.length;n<r;n++)for(var i in o=arguments[n])Object.prototype.hasOwnProperty.call(o,i)&&(t[i]=o[i]);return t},h.apply(this,arguments)},x=function(t,o){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&o.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)o.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n},m=function(r){var e=r.variant,u=void 0===e?"contained":e,l=r.size,s=void 0===l?"large":l,d=r.className,b=r.disabled,f=void 0!==b&&b,g=r.children,v=r.startIcon,m=r.endIcon,y=r.loading,j=void 0!==y&&y,w=r.toolTipTitle,O=void 0===w?"":w,k=r.TooltipProps,S=r.danger,P=void 0!==S&&S,N=x(r,["variant","size","className","disabled","children","startIcon","endIcon","loading","toolTipTitle","TooltipProps","danger"]),T=(0,o.useState)(!1),C=T[0],_=T[1],E=function(o){if(!C)return"start"===o&&v?(0,t.jsx)("span",h({className:i()("btn-icon","start-icon")},{children:v})):"end"===o&&m?(0,t.jsx)("span",h({className:i()("btn-icon","end-icon")},{children:m})):null;if("object"==typeof j){var n=j.delay||0;setTimeout((function(){return _(!1)}),n)}return"start"===o?(0,t.jsx)("span",h({className:"btn-icon loading-icon"},{children:(0,t.jsx)(a(),{})})):null},z=(0,t.jsx)(n.Button,h({},N,{color:"default",variant:"contained",disabled:f,disableRipple:!0,disableElevation:!0,className:i()("paraui-button",d,"paraui-button-".concat(u),"paraui-button-".concat(s),C&&"paraui-button-loading",P&&!f&&"paraui-button-dangerous"),classes:{label:"paraui-button-label"},startIcon:E("start"),endIcon:E("end")},{children:g}));return(0,o.useEffect)((function(){_(!!j)}),[j]),f&&O?(0,t.jsx)(p.default,h({},k,{title:function(){if(f&&O){return(0,t.jsxs)("span",{children:[(0,t.jsx)(c(),{style:{marginRight:"4px",fontSize:"11px",color:"inherit"}}),O]})}return O}()},{children:(0,t.jsx)("span",h({className:"paraui-button--disabled"},{children:z}))})):z};m.IconButton=function(r){var e=r.variant,u=void 0===e?"contained":e,l=r.size,s=void 0===l?"large":l,d=r.toolTipTitle,b=void 0===d?"":d,f=r.children,g=r.className,v=r.disabled,m=void 0!==v&&v,y=r.loading,j=void 0!==y&&y,w=r.TooltipProps,O=r.danger,k=void 0!==O&&O,S=x(r,["variant","size","toolTipTitle","children","className","disabled","loading","TooltipProps","danger"]),P=(0,o.useState)(!1),N=P[0],T=P[1],C=(0,t.jsx)(n.IconButton,h({},S,{disabled:m,disableRipple:!0,className:i()("paraui-icon-button",g,"paraui-icon-button-".concat(u),"paraui-icon-button-".concat(s),N&&"paraui-icon-button-loading",k&&!m&&"paraui-icon-button-dangerous")},{children:function(){if(!N)return f;if("object"==typeof j){var o=j.delay||0;setTimeout((function(){return T(!1)}),o)}return(0,t.jsx)("span",h({className:"loading-icon"},{children:(0,t.jsx)(a(),{})}))}()}));return(0,o.useEffect)((function(){T(!!j)}),[j]),b?(0,t.jsx)(p.default,h({},w,{title:function(){if(m&&b){return(0,t.jsxs)("span",{children:[(0,t.jsx)(c(),{style:{marginRight:"4px",fontSize:"11px",color:"inherit"}}),b]})}return b}()},{children:m?(0,t.jsx)("span",h({className:"paraui-button--disabled"},{children:C})):C}),+N):C},m.SplitButton=function(r){var e=r.buttonText,a=r.options,u=void 0===a?[]:a,c=r.className,l=r.popperClassName,s=r.style,p=r.popperStyle,d=r.disabled,h=void 0!==d&&d,x=r.onClick,m=r.optionRender,j=r.placement,w=void 0===j?"bottom-end":j,O=r.buttonProps,k=r.iconButton,S=void 0!==k&&k,P=(0,f.Z)("Button",g),N=(0,o.useState)(!1),T=N[0],C=N[1],_=(0,o.useRef)(null),E=(0,o.useRef)(),z=(0,o.useRef)(),I=(0,o.useState)(),M=I[0],R=I[1],L=function(t,o,n){var r;t.disabled?n.stopPropagation():(R(o),C(!1),null===(r=E.current)||void 0===r||r.classList.remove("paraui-button-split--active"),null==x||x(t,n))},q=function(t){t.stopPropagation(),F();var o=t.currentTarget;z.current=window.setTimeout((function(){E.current=o,o.classList.add("paraui-button-split--active"),C(!0)}),150)},F=function(){z.current&&(clearTimeout(z.current),z.current=null)},A=function(t){var o,n;(null===(o=_.current)||void 0===o?void 0:o.contains(t.target))||(C(!1),null===(n=E.current)||void 0===n||n.classList.remove("paraui-button-split--active"))},B=function(){return(0,t.jsx)("div",v({className:"paraui-button-split-list"},{children:(0,t.jsx)("ul",{children:u.map((function(o,n){return Array.isArray(o)?function(o,n){return(0,t.jsx)("li",v({className:"split-li-group"},{children:o.map((function(o,r){var e="".concat(n,"-").concat(r);return(0,t.jsx)("div",v({className:i()("split-li",e===M&&"split-li--active",o.disabled&&"split-li--disabled"),onClick:function(t){return L(o,e,t)}},{children:(null==m?void 0:m(o))||o.label}),e)}))}),n)}(o,n):(0,t.jsx)("li",v({className:i()("split-li",n===M&&"split-li--active",o.disabled&&"split-li--disabled"),onClick:function(t){return L(o,n,t)}},{children:(null==m?void 0:m(o))||o.label}),n)}))})}))};return(0,t.jsxs)("div",v({className:i()("paraui-button-split",c),ref:_,style:s,onMouseLeave:function(t){var o;t.stopPropagation(),F(),null===(o=t.currentTarget.firstElementChild)||void 0===o||o.classList.remove("paraui-button-split--active"),C(!1)}},{children:[S?(0,t.jsx)(y.IconButton,v({variant:"text",size:"small",disabled:h},O,{onMouseEnter:q},{children:null!=e?e:P({id:"moreActions"})})):(0,t.jsx)(y,v({variant:"outlined",size:"large",startIcon:(0,t.jsx)(b(),{}),disabled:h},O,{onMouseEnter:q},{children:null!=e?e:P({id:"moreActions"})})),(0,t.jsx)(n.Popper,v({open:T,anchorEl:_.current,transition:!0,placement:w,style:v({zIndex:1500},p),className:i()("paraui-button-split-popper",l)},{children:function(o){var r=o.TransitionProps;o.placement;return(0,t.jsx)(n.Grow,v({},r,{children:(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(n.ClickAwayListener,v({onClickAway:A},{children:B()}))})}))}}))]}))};var y=m}(),s}()}));
|
|
14
|
+
*/n(7418);var r=n(8156),i=60103;if(o.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var e=Symbol.for;i=e("react.element"),o.Fragment=e("react.fragment")}var a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u=Object.prototype.hasOwnProperty,c={key:!0,ref:!0,__self:!0,__source:!0};function l(t,o,n){var r,e={},l=null,s=null;for(r in void 0!==n&&(l=""+n),void 0!==o.key&&(l=""+o.key),void 0!==o.ref&&(s=o.ref),o)u.call(o,r)&&!c.hasOwnProperty(r)&&(e[r]=o[r]);if(t&&t.defaultProps)for(r in o=t.defaultProps)void 0===e[r]&&(e[r]=o[r]);return{$$typeof:i,type:t,key:l,ref:s,props:e,_owner:a.current}}o.jsx=l,o.jsxs=l},5893:function(t,o,n){"use strict";t.exports=n(5251)},5822:function(t,o,n){var r=n(3379),i=n(8313);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[t.id,i,""]]);var e={insert:("body","body"),singleton:!1};r(i,e);t.exports=i.locals||{}},2310:function(t,o,n){var r=n(3379),i=n(9929);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[t.id,i,""]]);var e={insert:("body","body"),singleton:!1};r(i,e);t.exports=i.locals||{}},3379:function(t,o,n){"use strict";var r,i=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},e=function(){var t={};return function(o){if(void 0===t[o]){var n=document.querySelector(o);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}t[o]=n}return t[o]}}(),a=[];function u(t){for(var o=-1,n=0;n<a.length;n++)if(a[n].identifier===t){o=n;break}return o}function c(t,o){for(var n={},r=[],i=0;i<t.length;i++){var e=t[i],c=o.base?e[0]+o.base:e[0],l=n[c]||0,s="".concat(c," ").concat(l);n[c]=l+1;var p=u(s),d={css:e[1],media:e[2],sourceMap:e[3]};-1!==p?(a[p].references++,a[p].updater(d)):a.push({identifier:s,updater:h(d,o),references:1}),r.push(s)}return r}function l(t){var o=document.createElement("style"),r=t.attributes||{};if(void 0===r.nonce){var i=n.nc;i&&(r.nonce=i)}if(Object.keys(r).forEach((function(t){o.setAttribute(t,r[t])})),"function"==typeof t.insert)t.insert(o);else{var a=e(t.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(o)}return o}var s,p=(s=[],function(t,o){return s[t]=o,s.filter(Boolean).join("\n")});function d(t,o,n,r){var i=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(t.styleSheet)t.styleSheet.cssText=p(o,i);else{var e=document.createTextNode(i),a=t.childNodes;a[o]&&t.removeChild(a[o]),a.length?t.insertBefore(e,a[o]):t.appendChild(e)}}function b(t,o,n){var r=n.css,i=n.media,e=n.sourceMap;if(i?t.setAttribute("media",i):t.removeAttribute("media"),e&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(e))))," */")),t.styleSheet)t.styleSheet.cssText=r;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(r))}}var f=null,g=0;function h(t,o){var n,r,i;if(o.singleton){var e=g++;n=f||(f=l(o)),r=d.bind(null,n,e,!1),i=d.bind(null,n,e,!0)}else n=l(o),r=b.bind(null,n,o),i=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(n)};return r(t),function(o){if(o){if(o.css===t.css&&o.media===t.media&&o.sourceMap===t.sourceMap)return;r(t=o)}else i()}}t.exports=function(t,o){(o=o||{}).singleton||"boolean"==typeof o.singleton||(o.singleton=i());var n=c(t=t||[],o);return function(t){if(t=t||[],"[object Array]"===Object.prototype.toString.call(t)){for(var r=0;r<n.length;r++){var i=u(n[r]);a[i].references--}for(var e=c(t,o),l=0;l<n.length;l++){var s=u(n[l]);0===a[s].references&&(a[s].updater(),a.splice(s,1))}n=e}}}},3054:function(t,o,n){"use strict";var r=n(8156),i=n.n(r),e=n(5395),a=n.n(e);o.Z=function(t,o){var n=i().useContext(a()).intlFormat;return o.zh_CN=o.zh,o["zh-CN"]=o.zh,o.en_US=o.en,o["en-US"]=o.en,n&&n(t,o)}},7371:function(t,o,n){"use strict";var r=n(5893),i=n(670),e=n(5744),a=n.n(e),u=(n(2310),function(){return u=Object.assign||function(t){for(var o,n=1,r=arguments.length;n<r;n++)for(var i in o=arguments[n])Object.prototype.hasOwnProperty.call(o,i)&&(t[i]=o[i]);return t},u.apply(this,arguments)}),c=function(t,o){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&o.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)o.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};o.default=function(t){var o,n=t.placement,e=void 0===n?"top-start":n,l=t.className,s=t.arrow,p=void 0===s||s,d=t.PopperProps,b=t.boundariesElement,f=void 0===b?"scrollParent":b,g=c(t,["placement","className","arrow","PopperProps","boundariesElement"]),h=u(u({},t.classes),{popper:a()("paraui-tooltip",l,null===(o=t.classes)||void 0===o?void 0:o.popper,{"paraui-tooltip-left-right":(null==e?void 0:e.includes("left"))||(null==e?void 0:e.includes("right")),"paraui-tooltip-top-bottom":(null==e?void 0:e.includes("top"))||(null==e?void 0:e.includes("bottom"))})});return(0,r.jsx)(i.Tooltip,u({},g,{enterTouchDelay:0,arrow:p,placement:e,classes:h,PopperProps:u(u({},d),{modifiers:{preventOverflow:{boundariesElement:f}}})}))}},670:function(t){"use strict";t.exports=o},5395:function(t){"use strict";t.exports=a},2396:function(t){"use strict";t.exports=e},3835:function(t){"use strict";t.exports=i},2788:function(t){"use strict";t.exports=r},5744:function(t){"use strict";t.exports=n},8156:function(o){"use strict";o.exports=t}},c={};function l(t){var o=c[t];if(void 0!==o)return o.exports;var n=c[t]={id:t,exports:{}};return u[t](n,n.exports,l),n.exports}l.n=function(t){var o=t&&t.__esModule?function(){return t.default}:function(){return t};return l.d(o,{a:o}),o},l.d=function(t,o){for(var n in o)l.o(o,n)&&!l.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})},l.o=function(t,o){return Object.prototype.hasOwnProperty.call(t,o)},l.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},l.nc=void 0;var s={};return function(){"use strict";l.r(s),l.d(s,{Button:function(){return m},default:function(){return y}});var t=l(5893),o=l(8156),n=l(670),r=l(5744),i=l.n(r),e=l(2788),a=l.n(e),u=l(3835),c=l.n(u),p=l(7371),d=l(2396),b=l.n(d),f=l(3054),g={zh:{moreActions:"更多操作"},en:{moreActions:"More actions"}},h=function(){return h=Object.assign||function(t){for(var o,n=1,r=arguments.length;n<r;n++)for(var i in o=arguments[n])Object.prototype.hasOwnProperty.call(o,i)&&(t[i]=o[i]);return t},h.apply(this,arguments)};l(5822);var v=function(){return v=Object.assign||function(t){for(var o,n=1,r=arguments.length;n<r;n++)for(var i in o=arguments[n])Object.prototype.hasOwnProperty.call(o,i)&&(t[i]=o[i]);return t},v.apply(this,arguments)},x=function(t,o){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&o.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)o.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n},m=function(r){var e=r.variant,u=void 0===e?"contained":e,l=r.size,s=void 0===l?"large":l,d=r.className,b=r.disabled,f=void 0!==b&&b,g=r.children,h=r.startIcon,m=r.endIcon,y=r.loading,j=void 0!==y&&y,w=r.toolTipTitle,O=void 0===w?"":w,k=r.TooltipProps,S=r.danger,P=void 0!==S&&S,N=x(r,["variant","size","className","disabled","children","startIcon","endIcon","loading","toolTipTitle","TooltipProps","danger"]),T=(0,o.useState)(!1),C=T[0],_=T[1],E=function(o){if(!C)return"start"===o&&h?(0,t.jsx)("span",v({className:i()("btn-icon","start-icon")},{children:h})):"end"===o&&m?(0,t.jsx)("span",v({className:i()("btn-icon","end-icon")},{children:m})):null;if("object"==typeof j){var n=j.delay||0;setTimeout((function(){return _(!1)}),n)}return"start"===o?(0,t.jsx)("span",v({className:"btn-icon loading-icon"},{children:(0,t.jsx)(a(),{})})):null},z=(0,t.jsx)(n.Button,v({},N,{color:"default",variant:"contained",disabled:f,disableRipple:!0,disableElevation:!0,className:i()("paraui-button",d,"paraui-button-".concat(u),"paraui-button-".concat(s),C&&"paraui-button-loading",P&&!f&&"paraui-button-dangerous"),classes:{label:"paraui-button-label"},startIcon:E("start"),endIcon:E("end")},{children:g}));return(0,o.useEffect)((function(){_(!!j)}),[j]),f&&O?(0,t.jsx)(p.default,v({},k,{title:function(){if(f&&O){return(0,t.jsxs)("span",{children:[(0,t.jsx)(c(),{style:{marginRight:"4px",fontSize:"11px",color:"inherit"}}),O]})}return O}()},{children:(0,t.jsx)("span",v({className:"paraui-button--disabled"},{children:z}))})):z};m.IconButton=function(r){var e=r.variant,u=void 0===e?"contained":e,l=r.size,s=void 0===l?"large":l,d=r.toolTipTitle,b=void 0===d?"":d,f=r.children,g=r.className,h=r.disabled,m=void 0!==h&&h,y=r.loading,j=void 0!==y&&y,w=r.TooltipProps,O=r.danger,k=void 0!==O&&O,S=x(r,["variant","size","toolTipTitle","children","className","disabled","loading","TooltipProps","danger"]),P=(0,o.useState)(!1),N=P[0],T=P[1],C=(0,t.jsx)(n.IconButton,v({},S,{disabled:m,disableRipple:!0,className:i()("paraui-icon-button",g,"paraui-icon-button-".concat(u),"paraui-icon-button-".concat(s),N&&"paraui-icon-button-loading",k&&!m&&"paraui-icon-button-dangerous")},{children:function(){if(!N)return f;if("object"==typeof j){var o=j.delay||0;setTimeout((function(){return T(!1)}),o)}return(0,t.jsx)("span",v({className:"loading-icon"},{children:(0,t.jsx)(a(),{})}))}()}));return(0,o.useEffect)((function(){T(!!j)}),[j]),b?(0,t.jsx)(p.default,v({},w,{title:function(){if(m&&b){return(0,t.jsxs)("span",{children:[(0,t.jsx)(c(),{style:{marginRight:"4px",fontSize:"11px",color:"inherit"}}),b]})}return b}()},{children:m?(0,t.jsx)("span",v({className:"paraui-button--disabled"},{children:C})):C}),+N):C},m.SplitButton=function(r){var e=r.buttonText,a=r.options,u=void 0===a?[]:a,c=r.className,l=r.popperClassName,s=r.style,p=r.popperStyle,d=r.disabled,v=void 0!==d&&d,x=r.onClick,m=r.optionRender,j=r.placement,w=void 0===j?"bottom-end":j,O=r.buttonProps,k=r.iconButton,S=void 0!==k&&k,P=(0,f.Z)("Button",g),N=(0,o.useState)(!1),T=N[0],C=N[1],_=(0,o.useRef)(null),E=(0,o.useRef)(),z=(0,o.useRef)(),I=(0,o.useState)(),M=I[0],R=I[1],L=function(t,o,n){var r;t.disabled?n.stopPropagation():(R(o),C(!1),null===(r=E.current)||void 0===r||r.classList.remove("paraui-button-split--active"),null==x||x(t,n))},q=function(t){t.stopPropagation(),F();var o=t.currentTarget;z.current=window.setTimeout((function(){E.current=o,o.classList.add("paraui-button-split--active"),C(!0)}),150)},F=function(){z.current&&(clearTimeout(z.current),z.current=null)},A=function(t){var o,n;(null===(o=_.current)||void 0===o?void 0:o.contains(t.target))||(C(!1),null===(n=E.current)||void 0===n||n.classList.remove("paraui-button-split--active"))},B=function(){return(0,t.jsx)("div",h({className:"paraui-button-split-list"},{children:(0,t.jsx)("ul",{children:u.map((function(o,n){return Array.isArray(o)?function(o,n){return(0,t.jsx)("li",h({className:"split-li-group"},{children:o.map((function(o,r){var e="".concat(n,"-").concat(r);return(0,t.jsx)("div",h({className:i()("split-li",e===M&&"split-li--active",o.disabled&&"split-li--disabled"),onClick:function(t){return L(o,e,t)}},{children:(null==m?void 0:m(o))||o.label}),e)}))}),n)}(o,n):(0,t.jsx)("li",h({className:i()("split-li",n===M&&"split-li--active",o.disabled&&"split-li--disabled"),onClick:function(t){return L(o,n,t)}},{children:(null==m?void 0:m(o))||o.label}),n)}))})}))};return(0,t.jsxs)("div",h({className:i()("paraui-button-split",c),ref:_,style:s,onMouseLeave:function(t){var o;t.stopPropagation(),F(),null===(o=t.currentTarget.firstElementChild)||void 0===o||o.classList.remove("paraui-button-split--active"),C(!1)}},{children:[S?(0,t.jsx)(y.IconButton,h({variant:"text",size:"small",disabled:v},O,{onMouseEnter:q},{children:null!=e?e:P({id:"moreActions"})})):(0,t.jsx)(y,h({variant:"outlined",size:"large",startIcon:(0,t.jsx)(b(),{}),disabled:v},O,{onMouseEnter:q},{children:null!=e?e:P({id:"moreActions"})})),(0,t.jsx)(n.Popper,h({open:T,anchorEl:_.current,transition:!0,placement:w,style:h({zIndex:1500},p),className:i()("paraui-button-split-popper",l)},{children:function(o){var r=o.TransitionProps;o.placement;return(0,t.jsx)(n.Grow,h({},r,{children:(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(n.ClickAwayListener,h({onClickAway:A},{children:B()}))})}))}}))]}))};var y=m}(),s}()}));
|
package/ButtonGroup/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
|
-
*/n(7418);var r=n(8156),i=60103;if(o.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var e=Symbol.for;i=e("react.element"),o.Fragment=e("react.fragment")}var a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u=Object.prototype.hasOwnProperty,l={key:!0,ref:!0,__self:!0,__source:!0};function c(t,o,n){var r,e={},c=null,s=null;for(r in void 0!==n&&(c=""+n),void 0!==o.key&&(c=""+o.key),void 0!==o.ref&&(s=o.ref),o)u.call(o,r)&&!l.hasOwnProperty(r)&&(e[r]=o[r]);if(t&&t.defaultProps)for(r in o=t.defaultProps)void 0===e[r]&&(e[r]=o[r]);return{$$typeof:i,type:t,key:c,ref:s,props:e,_owner:a.current}}o.jsx=c,o.jsxs=c},5893:function(t,o,n){"use strict";t.exports=n(5251)},5822:function(t,o,n){var r=n(3379),i=n(8313);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[t.id,i,""]]);var e={insert:("body","body"),singleton:!1};r(i,e);t.exports=i.locals||{}},954:function(t,o,n){var r=n(3379),i=n(9114);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[t.id,i,""]]);var e={insert:("body","body"),singleton:!1};r(i,e);t.exports=i.locals||{}},2310:function(t,o,n){var r=n(3379),i=n(9929);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[t.id,i,""]]);var e={insert:("body","body"),singleton:!1};r(i,e);t.exports=i.locals||{}},3379:function(t,o,n){"use strict";var r,i=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},e=function(){var t={};return function(o){if(void 0===t[o]){var n=document.querySelector(o);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}t[o]=n}return t[o]}}(),a=[];function u(t){for(var o=-1,n=0;n<a.length;n++)if(a[n].identifier===t){o=n;break}return o}function l(t,o){for(var n={},r=[],i=0;i<t.length;i++){var e=t[i],l=o.base?e[0]+o.base:e[0],c=n[l]||0,s="".concat(l," ").concat(c);n[l]=c+1;var p=u(s),d={css:e[1],media:e[2],sourceMap:e[3]};-1!==p?(a[p].references++,a[p].updater(d)):a.push({identifier:s,updater:h(d,o),references:1}),r.push(s)}return r}function c(t){var o=document.createElement("style"),r=t.attributes||{};if(void 0===r.nonce){var i=n.nc;i&&(r.nonce=i)}if(Object.keys(r).forEach((function(t){o.setAttribute(t,r[t])})),"function"==typeof t.insert)t.insert(o);else{var a=e(t.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(o)}return o}var s,p=(s=[],function(t,o){return s[t]=o,s.filter(Boolean).join("\n")});function d(t,o,n,r){var i=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(t.styleSheet)t.styleSheet.cssText=p(o,i);else{var e=document.createTextNode(i),a=t.childNodes;a[o]&&t.removeChild(a[o]),a.length?t.insertBefore(e,a[o]):t.appendChild(e)}}function b(t,o,n){var r=n.css,i=n.media,e=n.sourceMap;if(i?t.setAttribute("media",i):t.removeAttribute("media"),e&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(e))))," */")),t.styleSheet)t.styleSheet.cssText=r;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(r))}}var f=null,g=0;function h(t,o){var n,r,i;if(o.singleton){var e=g++;n=f||(f=c(o)),r=d.bind(null,n,e,!1),i=d.bind(null,n,e,!0)}else n=c(o),r=b.bind(null,n,o),i=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(n)};return r(t),function(o){if(o){if(o.css===t.css&&o.media===t.media&&o.sourceMap===t.sourceMap)return;r(t=o)}else i()}}t.exports=function(t,o){(o=o||{}).singleton||"boolean"==typeof o.singleton||(o.singleton=i());var n=l(t=t||[],o);return function(t){if(t=t||[],"[object Array]"===Object.prototype.toString.call(t)){for(var r=0;r<n.length;r++){var i=u(n[r]);a[i].references--}for(var e=l(t,o),c=0;c<n.length;c++){var s=u(n[c]);0===a[s].references&&(a[s].updater(),a.splice(s,1))}n=e}}}},7896:function(t,o,n){"use strict";n.d(o,{default:function(){return j}});var r=n(5893),i=n(8156),e=n(670),a=n(5744),u=n.n(a),l=n(2788),c=n.n(l),s=n(3835),p=n.n(s),d=n(7371),b=n(2396),f=n.n(b),g=n(3054),h={zh:{moreActions:"更多操作"},en:{moreActions:"More actions"}},x=function(){return x=Object.assign||function(t){for(var o,n=1,r=arguments.length;n<r;n++)for(var i in o=arguments[n])Object.prototype.hasOwnProperty.call(o,i)&&(t[i]=o[i]);return t},x.apply(this,arguments)};n(5822);var v=function(){return v=Object.assign||function(t){for(var o,n=1,r=arguments.length;n<r;n++)for(var i in o=arguments[n])Object.prototype.hasOwnProperty.call(o,i)&&(t[i]=o[i]);return t},v.apply(this,arguments)},m=function(t,o){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&o.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)o.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n},y=function(t){var o=t.variant,n=void 0===o?"contained":o,a=t.size,l=void 0===a?"large":a,s=t.className,b=t.disabled,f=void 0!==b&&b,g=t.children,h=t.startIcon,x=t.endIcon,y=t.loading,j=void 0!==y&&y,w=t.toolTipTitle,O=void 0===w?"":w,S=t.TooltipProps,k=t.danger,P=void 0!==k&&k,N=m(t,["variant","size","className","disabled","children","startIcon","endIcon","loading","toolTipTitle","TooltipProps","danger"]),T=(0,i.useState)(!1),C=T[0],_=T[1],E=function(t){if(!C)return"start"===t&&h?(0,r.jsx)("span",v({className:u()("btn-icon","start-icon")},{children:h})):"end"===t&&x?(0,r.jsx)("span",v({className:u()("btn-icon","end-icon")},{children:x})):null;if("object"==typeof j){var o=j.delay||0;setTimeout((function(){return _(!1)}),o)}return"start"===t?(0,r.jsx)("span",v({className:"btn-icon loading-icon"},{children:(0,r.jsx)(c(),{})})):null},z=(0,r.jsx)(e.Button,v({},N,{color:"default",variant:"contained",disabled:f,disableRipple:!0,disableElevation:!0,className:u()("paraui-button",s,"paraui-button-".concat(n),"paraui-button-".concat(l),C&&"paraui-button-loading",P&&!f&&"paraui-button-dangerous"),classes:{label:"paraui-button-label"},startIcon:E("start"),endIcon:E("end")},{children:g}));return(0,i.useEffect)((function(){_(!!j)}),[j]),f&&O?(0,r.jsx)(d.default,v({},S,{title:function(){if(f&&O){return(0,r.jsxs)("span",{children:[(0,r.jsx)(p(),{style:{marginRight:"4px",fontSize:"11px",color:"inherit"}}),O]})}return O}()},{children:(0,r.jsx)("span",v({className:"paraui-button--disabled"},{children:z}))})):z};y.IconButton=function(t){var o=t.variant,n=void 0===o?"contained":o,a=t.size,l=void 0===a?"large":a,s=t.toolTipTitle,b=void 0===s?"":s,f=t.children,g=t.className,h=t.disabled,x=void 0!==h&&h,y=t.loading,j=void 0!==y&&y,w=t.TooltipProps,O=t.danger,S=void 0!==O&&O,k=m(t,["variant","size","toolTipTitle","children","className","disabled","loading","TooltipProps","danger"]),P=(0,i.useState)(!1),N=P[0],T=P[1],C=(0,r.jsx)(e.IconButton,v({},k,{disabled:x,disableRipple:!0,className:u()("paraui-icon-button",g,"paraui-icon-button-".concat(n),"paraui-icon-button-".concat(l),N&&"paraui-icon-button-loading",S&&!x&&"paraui-icon-button-dangerous")},{children:function(){if(!N)return f;if("object"==typeof j){var t=j.delay||0;setTimeout((function(){return T(!1)}),t)}return(0,r.jsx)("span",v({className:"loading-icon"},{children:(0,r.jsx)(c(),{})}))}()}));return(0,i.useEffect)((function(){T(!!j)}),[j]),b?(0,r.jsx)(d.default,v({},w,{title:function(){if(x&&b){return(0,r.jsxs)("span",{children:[(0,r.jsx)(p(),{style:{marginRight:"4px",fontSize:"11px",color:"inherit"}}),b]})}return b}()},{children:x?(0,r.jsx)("span",v({className:"paraui-button--disabled"},{children:C})):C}),+N):C},y.SplitButton=function(t){var o=t.buttonText,n=t.options,a=void 0===n?[]:n,l=t.className,c=t.popperClassName,s=t.style,p=t.popperStyle,d=t.disabled,b=void 0!==d&&d,v=t.onClick,m=t.optionRender,y=t.placement,w=void 0===y?"bottom-end":y,O=t.buttonProps,S=t.iconButton,k=void 0!==S&&S,P=(0,g.Z)("Button",h),N=(0,i.useState)(!1),T=N[0],C=N[1],_=(0,i.useRef)(null),E=(0,i.useRef)(),z=(0,i.useRef)(),I=(0,i.useState)(),M=I[0],R=I[1],F=function(t,o,n){var r;t.disabled?n.stopPropagation():(R(o),C(!1),null===(r=E.current)||void 0===r||r.classList.remove("paraui-button-split--active"),null==v||v(t,n))},L=function(t){t.stopPropagation(),q();var o=t.currentTarget;z.current=window.setTimeout((function(){E.current=o,o.classList.add("paraui-button-split--active"),C(!0)}),150)},q=function(){z.current&&(clearTimeout(z.current),z.current=null)},B=function(t){var o,n;(null===(o=_.current)||void 0===o?void 0:o.contains(t.target))||(C(!1),null===(n=E.current)||void 0===n||n.classList.remove("paraui-button-split--active"))},A=function(){return(0,r.jsx)("div",x({className:"paraui-button-split-list"},{children:(0,r.jsx)("ul",{children:a.map((function(t,o){return Array.isArray(t)?function(t,o){return(0,r.jsx)("li",x({className:"split-li-group"},{children:t.map((function(t,n){var i="".concat(o,"-").concat(n);return(0,r.jsx)("div",x({className:u()("split-li",i===M&&"split-li--active",t.disabled&&"split-li--disabled"),onClick:function(o){return F(t,i,o)}},{children:(null==m?void 0:m(t))||t.label}),i)}))}),o)}(t,o):(0,r.jsx)("li",x({className:u()("split-li",o===M&&"split-li--active",t.disabled&&"split-li--disabled"),onClick:function(n){return F(t,o,n)}},{children:(null==m?void 0:m(t))||t.label}),o)}))})}))};return(0,r.jsxs)("div",x({className:u()("paraui-button-split",l),ref:_,style:s,onMouseLeave:function(t){var o;t.stopPropagation(),q(),null===(o=t.currentTarget.firstElementChild)||void 0===o||o.classList.remove("paraui-button-split--active"),C(!1)}},{children:[k?(0,r.jsx)(j.IconButton,x({variant:"text",size:"small",disabled:b},O,{onMouseEnter:L},{children:null!=o?o:P({id:"moreActions"})})):(0,r.jsx)(j,x({variant:"outlined",size:"large",startIcon:(0,r.jsx)(f(),{}),disabled:b},O,{onMouseEnter:L},{children:null!=o?o:P({id:"moreActions"})})),(0,r.jsx)(e.Popper,x({open:T,anchorEl:_.current,transition:!0,placement:w,style:x({zIndex:1500},p),className:u()("paraui-button-split-popper",c)},{children:function(t){var o=t.TransitionProps;t.placement;return(0,r.jsx)(e.Grow,x({},o,{children:(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(e.ClickAwayListener,x({onClickAway:B},{children:A()}))})}))}}))]}))};var j=y},3054:function(t,o,n){"use strict";var r=n(8156),i=n.n(r),e=n(5395),a=n.n(e);o.Z=function(t,o){var n=i().useContext(a()).intlFormat;return o.zh_CN=o.zh,o.en_US=o.en,n&&n(t,o)}},7371:function(t,o,n){"use strict";var r=n(5893),i=n(670),e=n(5744),a=n.n(e),u=(n(2310),function(){return u=Object.assign||function(t){for(var o,n=1,r=arguments.length;n<r;n++)for(var i in o=arguments[n])Object.prototype.hasOwnProperty.call(o,i)&&(t[i]=o[i]);return t},u.apply(this,arguments)}),l=function(t,o){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&o.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)o.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};o.default=function(t){var o,n=t.placement,e=void 0===n?"top-start":n,c=t.className,s=t.arrow,p=void 0===s||s,d=t.PopperProps,b=t.boundariesElement,f=void 0===b?"scrollParent":b,g=l(t,["placement","className","arrow","PopperProps","boundariesElement"]),h=u(u({},t.classes),{popper:a()("paraui-tooltip",c,null===(o=t.classes)||void 0===o?void 0:o.popper,{"paraui-tooltip-left-right":(null==e?void 0:e.includes("left"))||(null==e?void 0:e.includes("right")),"paraui-tooltip-top-bottom":(null==e?void 0:e.includes("top"))||(null==e?void 0:e.includes("bottom"))})});return(0,r.jsx)(i.Tooltip,u({},g,{enterTouchDelay:0,arrow:p,placement:e,classes:h,PopperProps:u(u({},d),{modifiers:{preventOverflow:{boundariesElement:f}}})}))}},670:function(t){"use strict";t.exports=o},5395:function(t){"use strict";t.exports=a},2396:function(t){"use strict";t.exports=e},3835:function(t){"use strict";t.exports=i},2788:function(t){"use strict";t.exports=r},5744:function(t){"use strict";t.exports=n},8156:function(o){"use strict";o.exports=t}},l={};function c(t){var o=l[t];if(void 0!==o)return o.exports;var n=l[t]={id:t,exports:{}};return u[t](n,n.exports,c),n.exports}c.n=function(t){var o=t&&t.__esModule?function(){return t.default}:function(){return t};return c.d(o,{a:o}),o},c.d=function(t,o){for(var n in o)c.o(o,n)&&!c.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})},c.o=function(t,o){return Object.prototype.hasOwnProperty.call(t,o)},c.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},c.nc=void 0;var s={};return function(){"use strict";c.r(s),c.d(s,{ButtonGroup:function(){return b}});var t=c(5893),o=c(8156),n=c.n(o),r=c(7896),i=c(7371),e=c(5744),a=c.n(e),u=c(3835),l=c.n(u),p=(c(954),function(){return p=Object.assign||function(t){for(var o,n=1,r=arguments.length;n<r;n++)for(var i in o=arguments[n])Object.prototype.hasOwnProperty.call(o,i)&&(t[i]=o[i]);return t},p.apply(this,arguments)}),d=function(t,o){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&o.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)o.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n},b=function(o){var e=o.mode,u=void 0===e?"icon":e,c=o.data,s=void 0===c?[]:c,b=o.className,f=o.showToolTip,g=void 0!==f&&f,h=o.onClick,x=o.disabled,v=void 0!==x&&x,m=o.style,y=function(o,n){if(o&&n){return(0,t.jsxs)("span",{children:[(0,t.jsx)(l(),{style:{marginRight:"4px",fontSize:"11px",color:"inherit"}}),n]})}return n},j=function(t){return function(o){null==h||h(t,o)}},w=function(o){var n=null!=o?o:{},i=n.text,e=n.icon,a=d(n,["text","icon"]);switch(u){case"text":return(0,t.jsx)(r.default,p({onClick:j(o),variant:"outlined",size:"small"},a,{children:i}));case"icon":case"iconSplit":return(0,t.jsx)(r.default.IconButton,p({onClick:j(o),variant:"outlined"},a,{children:e}))}};return(0,t.jsx)("div",p({className:a()("paraui-button-group","paraui-button-group-".concat(u),b,g&&"paraui-button-group-tooltip"),style:m},{children:s&&s.length?s.map((function(o,r){var e=o.text,a=o.disabled;return void 0===a&&(a=v,o.disabled=v),g&&["icon","iconSplit"].includes(u)?(0,t.jsx)(i.default,p({title:y(a,e)},{children:(0,t.jsx)("span",{children:w(o)})}),r):(0,t.jsx)(n().Fragment,{children:w(o)},r)})):null}))};s.default=b}(),s}()}));
|
|
14
|
+
*/n(7418);var r=n(8156),i=60103;if(o.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var e=Symbol.for;i=e("react.element"),o.Fragment=e("react.fragment")}var a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u=Object.prototype.hasOwnProperty,l={key:!0,ref:!0,__self:!0,__source:!0};function c(t,o,n){var r,e={},c=null,s=null;for(r in void 0!==n&&(c=""+n),void 0!==o.key&&(c=""+o.key),void 0!==o.ref&&(s=o.ref),o)u.call(o,r)&&!l.hasOwnProperty(r)&&(e[r]=o[r]);if(t&&t.defaultProps)for(r in o=t.defaultProps)void 0===e[r]&&(e[r]=o[r]);return{$$typeof:i,type:t,key:c,ref:s,props:e,_owner:a.current}}o.jsx=c,o.jsxs=c},5893:function(t,o,n){"use strict";t.exports=n(5251)},5822:function(t,o,n){var r=n(3379),i=n(8313);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[t.id,i,""]]);var e={insert:("body","body"),singleton:!1};r(i,e);t.exports=i.locals||{}},954:function(t,o,n){var r=n(3379),i=n(9114);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[t.id,i,""]]);var e={insert:("body","body"),singleton:!1};r(i,e);t.exports=i.locals||{}},2310:function(t,o,n){var r=n(3379),i=n(9929);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[t.id,i,""]]);var e={insert:("body","body"),singleton:!1};r(i,e);t.exports=i.locals||{}},3379:function(t,o,n){"use strict";var r,i=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},e=function(){var t={};return function(o){if(void 0===t[o]){var n=document.querySelector(o);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}t[o]=n}return t[o]}}(),a=[];function u(t){for(var o=-1,n=0;n<a.length;n++)if(a[n].identifier===t){o=n;break}return o}function l(t,o){for(var n={},r=[],i=0;i<t.length;i++){var e=t[i],l=o.base?e[0]+o.base:e[0],c=n[l]||0,s="".concat(l," ").concat(c);n[l]=c+1;var p=u(s),d={css:e[1],media:e[2],sourceMap:e[3]};-1!==p?(a[p].references++,a[p].updater(d)):a.push({identifier:s,updater:h(d,o),references:1}),r.push(s)}return r}function c(t){var o=document.createElement("style"),r=t.attributes||{};if(void 0===r.nonce){var i=n.nc;i&&(r.nonce=i)}if(Object.keys(r).forEach((function(t){o.setAttribute(t,r[t])})),"function"==typeof t.insert)t.insert(o);else{var a=e(t.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(o)}return o}var s,p=(s=[],function(t,o){return s[t]=o,s.filter(Boolean).join("\n")});function d(t,o,n,r){var i=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(t.styleSheet)t.styleSheet.cssText=p(o,i);else{var e=document.createTextNode(i),a=t.childNodes;a[o]&&t.removeChild(a[o]),a.length?t.insertBefore(e,a[o]):t.appendChild(e)}}function b(t,o,n){var r=n.css,i=n.media,e=n.sourceMap;if(i?t.setAttribute("media",i):t.removeAttribute("media"),e&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(e))))," */")),t.styleSheet)t.styleSheet.cssText=r;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(r))}}var f=null,g=0;function h(t,o){var n,r,i;if(o.singleton){var e=g++;n=f||(f=c(o)),r=d.bind(null,n,e,!1),i=d.bind(null,n,e,!0)}else n=c(o),r=b.bind(null,n,o),i=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(n)};return r(t),function(o){if(o){if(o.css===t.css&&o.media===t.media&&o.sourceMap===t.sourceMap)return;r(t=o)}else i()}}t.exports=function(t,o){(o=o||{}).singleton||"boolean"==typeof o.singleton||(o.singleton=i());var n=l(t=t||[],o);return function(t){if(t=t||[],"[object Array]"===Object.prototype.toString.call(t)){for(var r=0;r<n.length;r++){var i=u(n[r]);a[i].references--}for(var e=l(t,o),c=0;c<n.length;c++){var s=u(n[c]);0===a[s].references&&(a[s].updater(),a.splice(s,1))}n=e}}}},7896:function(t,o,n){"use strict";n.d(o,{default:function(){return j}});var r=n(5893),i=n(8156),e=n(670),a=n(5744),u=n.n(a),l=n(2788),c=n.n(l),s=n(3835),p=n.n(s),d=n(7371),b=n(2396),f=n.n(b),g=n(3054),h={zh:{moreActions:"更多操作"},en:{moreActions:"More actions"}},x=function(){return x=Object.assign||function(t){for(var o,n=1,r=arguments.length;n<r;n++)for(var i in o=arguments[n])Object.prototype.hasOwnProperty.call(o,i)&&(t[i]=o[i]);return t},x.apply(this,arguments)};n(5822);var v=function(){return v=Object.assign||function(t){for(var o,n=1,r=arguments.length;n<r;n++)for(var i in o=arguments[n])Object.prototype.hasOwnProperty.call(o,i)&&(t[i]=o[i]);return t},v.apply(this,arguments)},m=function(t,o){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&o.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)o.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n},y=function(t){var o=t.variant,n=void 0===o?"contained":o,a=t.size,l=void 0===a?"large":a,s=t.className,b=t.disabled,f=void 0!==b&&b,g=t.children,h=t.startIcon,x=t.endIcon,y=t.loading,j=void 0!==y&&y,w=t.toolTipTitle,O=void 0===w?"":w,S=t.TooltipProps,k=t.danger,P=void 0!==k&&k,N=m(t,["variant","size","className","disabled","children","startIcon","endIcon","loading","toolTipTitle","TooltipProps","danger"]),T=(0,i.useState)(!1),C=T[0],_=T[1],z=function(t){if(!C)return"start"===t&&h?(0,r.jsx)("span",v({className:u()("btn-icon","start-icon")},{children:h})):"end"===t&&x?(0,r.jsx)("span",v({className:u()("btn-icon","end-icon")},{children:x})):null;if("object"==typeof j){var o=j.delay||0;setTimeout((function(){return _(!1)}),o)}return"start"===t?(0,r.jsx)("span",v({className:"btn-icon loading-icon"},{children:(0,r.jsx)(c(),{})})):null},E=(0,r.jsx)(e.Button,v({},N,{color:"default",variant:"contained",disabled:f,disableRipple:!0,disableElevation:!0,className:u()("paraui-button",s,"paraui-button-".concat(n),"paraui-button-".concat(l),C&&"paraui-button-loading",P&&!f&&"paraui-button-dangerous"),classes:{label:"paraui-button-label"},startIcon:z("start"),endIcon:z("end")},{children:g}));return(0,i.useEffect)((function(){_(!!j)}),[j]),f&&O?(0,r.jsx)(d.default,v({},S,{title:function(){if(f&&O){return(0,r.jsxs)("span",{children:[(0,r.jsx)(p(),{style:{marginRight:"4px",fontSize:"11px",color:"inherit"}}),O]})}return O}()},{children:(0,r.jsx)("span",v({className:"paraui-button--disabled"},{children:E}))})):E};y.IconButton=function(t){var o=t.variant,n=void 0===o?"contained":o,a=t.size,l=void 0===a?"large":a,s=t.toolTipTitle,b=void 0===s?"":s,f=t.children,g=t.className,h=t.disabled,x=void 0!==h&&h,y=t.loading,j=void 0!==y&&y,w=t.TooltipProps,O=t.danger,S=void 0!==O&&O,k=m(t,["variant","size","toolTipTitle","children","className","disabled","loading","TooltipProps","danger"]),P=(0,i.useState)(!1),N=P[0],T=P[1],C=(0,r.jsx)(e.IconButton,v({},k,{disabled:x,disableRipple:!0,className:u()("paraui-icon-button",g,"paraui-icon-button-".concat(n),"paraui-icon-button-".concat(l),N&&"paraui-icon-button-loading",S&&!x&&"paraui-icon-button-dangerous")},{children:function(){if(!N)return f;if("object"==typeof j){var t=j.delay||0;setTimeout((function(){return T(!1)}),t)}return(0,r.jsx)("span",v({className:"loading-icon"},{children:(0,r.jsx)(c(),{})}))}()}));return(0,i.useEffect)((function(){T(!!j)}),[j]),b?(0,r.jsx)(d.default,v({},w,{title:function(){if(x&&b){return(0,r.jsxs)("span",{children:[(0,r.jsx)(p(),{style:{marginRight:"4px",fontSize:"11px",color:"inherit"}}),b]})}return b}()},{children:x?(0,r.jsx)("span",v({className:"paraui-button--disabled"},{children:C})):C}),+N):C},y.SplitButton=function(t){var o=t.buttonText,n=t.options,a=void 0===n?[]:n,l=t.className,c=t.popperClassName,s=t.style,p=t.popperStyle,d=t.disabled,b=void 0!==d&&d,v=t.onClick,m=t.optionRender,y=t.placement,w=void 0===y?"bottom-end":y,O=t.buttonProps,S=t.iconButton,k=void 0!==S&&S,P=(0,g.Z)("Button",h),N=(0,i.useState)(!1),T=N[0],C=N[1],_=(0,i.useRef)(null),z=(0,i.useRef)(),E=(0,i.useRef)(),I=(0,i.useState)(),M=I[0],R=I[1],F=function(t,o,n){var r;t.disabled?n.stopPropagation():(R(o),C(!1),null===(r=z.current)||void 0===r||r.classList.remove("paraui-button-split--active"),null==v||v(t,n))},L=function(t){t.stopPropagation(),q();var o=t.currentTarget;E.current=window.setTimeout((function(){z.current=o,o.classList.add("paraui-button-split--active"),C(!0)}),150)},q=function(){E.current&&(clearTimeout(E.current),E.current=null)},B=function(t){var o,n;(null===(o=_.current)||void 0===o?void 0:o.contains(t.target))||(C(!1),null===(n=z.current)||void 0===n||n.classList.remove("paraui-button-split--active"))},A=function(){return(0,r.jsx)("div",x({className:"paraui-button-split-list"},{children:(0,r.jsx)("ul",{children:a.map((function(t,o){return Array.isArray(t)?function(t,o){return(0,r.jsx)("li",x({className:"split-li-group"},{children:t.map((function(t,n){var i="".concat(o,"-").concat(n);return(0,r.jsx)("div",x({className:u()("split-li",i===M&&"split-li--active",t.disabled&&"split-li--disabled"),onClick:function(o){return F(t,i,o)}},{children:(null==m?void 0:m(t))||t.label}),i)}))}),o)}(t,o):(0,r.jsx)("li",x({className:u()("split-li",o===M&&"split-li--active",t.disabled&&"split-li--disabled"),onClick:function(n){return F(t,o,n)}},{children:(null==m?void 0:m(t))||t.label}),o)}))})}))};return(0,r.jsxs)("div",x({className:u()("paraui-button-split",l),ref:_,style:s,onMouseLeave:function(t){var o;t.stopPropagation(),q(),null===(o=t.currentTarget.firstElementChild)||void 0===o||o.classList.remove("paraui-button-split--active"),C(!1)}},{children:[k?(0,r.jsx)(j.IconButton,x({variant:"text",size:"small",disabled:b},O,{onMouseEnter:L},{children:null!=o?o:P({id:"moreActions"})})):(0,r.jsx)(j,x({variant:"outlined",size:"large",startIcon:(0,r.jsx)(f(),{}),disabled:b},O,{onMouseEnter:L},{children:null!=o?o:P({id:"moreActions"})})),(0,r.jsx)(e.Popper,x({open:T,anchorEl:_.current,transition:!0,placement:w,style:x({zIndex:1500},p),className:u()("paraui-button-split-popper",c)},{children:function(t){var o=t.TransitionProps;t.placement;return(0,r.jsx)(e.Grow,x({},o,{children:(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(e.ClickAwayListener,x({onClickAway:B},{children:A()}))})}))}}))]}))};var j=y},3054:function(t,o,n){"use strict";var r=n(8156),i=n.n(r),e=n(5395),a=n.n(e);o.Z=function(t,o){var n=i().useContext(a()).intlFormat;return o.zh_CN=o.zh,o["zh-CN"]=o.zh,o.en_US=o.en,o["en-US"]=o.en,n&&n(t,o)}},7371:function(t,o,n){"use strict";var r=n(5893),i=n(670),e=n(5744),a=n.n(e),u=(n(2310),function(){return u=Object.assign||function(t){for(var o,n=1,r=arguments.length;n<r;n++)for(var i in o=arguments[n])Object.prototype.hasOwnProperty.call(o,i)&&(t[i]=o[i]);return t},u.apply(this,arguments)}),l=function(t,o){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&o.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)o.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};o.default=function(t){var o,n=t.placement,e=void 0===n?"top-start":n,c=t.className,s=t.arrow,p=void 0===s||s,d=t.PopperProps,b=t.boundariesElement,f=void 0===b?"scrollParent":b,g=l(t,["placement","className","arrow","PopperProps","boundariesElement"]),h=u(u({},t.classes),{popper:a()("paraui-tooltip",c,null===(o=t.classes)||void 0===o?void 0:o.popper,{"paraui-tooltip-left-right":(null==e?void 0:e.includes("left"))||(null==e?void 0:e.includes("right")),"paraui-tooltip-top-bottom":(null==e?void 0:e.includes("top"))||(null==e?void 0:e.includes("bottom"))})});return(0,r.jsx)(i.Tooltip,u({},g,{enterTouchDelay:0,arrow:p,placement:e,classes:h,PopperProps:u(u({},d),{modifiers:{preventOverflow:{boundariesElement:f}}})}))}},670:function(t){"use strict";t.exports=o},5395:function(t){"use strict";t.exports=a},2396:function(t){"use strict";t.exports=e},3835:function(t){"use strict";t.exports=i},2788:function(t){"use strict";t.exports=r},5744:function(t){"use strict";t.exports=n},8156:function(o){"use strict";o.exports=t}},l={};function c(t){var o=l[t];if(void 0!==o)return o.exports;var n=l[t]={id:t,exports:{}};return u[t](n,n.exports,c),n.exports}c.n=function(t){var o=t&&t.__esModule?function(){return t.default}:function(){return t};return c.d(o,{a:o}),o},c.d=function(t,o){for(var n in o)c.o(o,n)&&!c.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})},c.o=function(t,o){return Object.prototype.hasOwnProperty.call(t,o)},c.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},c.nc=void 0;var s={};return function(){"use strict";c.r(s),c.d(s,{ButtonGroup:function(){return b}});var t=c(5893),o=c(8156),n=c.n(o),r=c(7896),i=c(7371),e=c(5744),a=c.n(e),u=c(3835),l=c.n(u),p=(c(954),function(){return p=Object.assign||function(t){for(var o,n=1,r=arguments.length;n<r;n++)for(var i in o=arguments[n])Object.prototype.hasOwnProperty.call(o,i)&&(t[i]=o[i]);return t},p.apply(this,arguments)}),d=function(t,o){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&o.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)o.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n},b=function(o){var e=o.mode,u=void 0===e?"icon":e,c=o.data,s=void 0===c?[]:c,b=o.className,f=o.showToolTip,g=void 0!==f&&f,h=o.onClick,x=o.disabled,v=void 0!==x&&x,m=o.style,y=function(o,n){if(o&&n){return(0,t.jsxs)("span",{children:[(0,t.jsx)(l(),{style:{marginRight:"4px",fontSize:"11px",color:"inherit"}}),n]})}return n},j=function(t){return function(o){null==h||h(t,o)}},w=function(o){var n=null!=o?o:{},i=n.text,e=n.icon,a=d(n,["text","icon"]);switch(u){case"text":return(0,t.jsx)(r.default,p({onClick:j(o),variant:"outlined",size:"small"},a,{children:i}));case"icon":case"iconSplit":return(0,t.jsx)(r.default.IconButton,p({onClick:j(o),variant:"outlined"},a,{children:e}))}};return(0,t.jsx)("div",p({className:a()("paraui-button-group","paraui-button-group-".concat(u),b,g&&"paraui-button-group-tooltip"),style:m},{children:s&&s.length?s.map((function(o,r){var e=o.text,a=o.disabled;return void 0===a&&(a=v,o.disabled=v),g&&["icon","iconSplit"].includes(u)?(0,t.jsx)(i.default,p({title:y(a,e)},{children:(0,t.jsx)("span",{children:w(o)})}),r):(0,t.jsx)(n().Fragment,{children:w(o)},r)})):null}))};s.default=b}(),s}()}));
|
package/Cascader/index.js
CHANGED
|
@@ -12,4 +12,4 @@ object-assign
|
|
|
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
14
|
*/
|
|
15
|
-
r(7418);var t=r(8156),a=60103;if(60107,"function"==typeof Symbol&&Symbol.for){var o=Symbol.for;a=o("react.element"),o("react.fragment")}var i=t.__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 u(e,n,r){var t,o={},u=null,l=null;for(t in void 0!==r&&(u=""+r),void 0!==n.key&&(u=""+n.key),void 0!==n.ref&&(l=n.ref),n)c.call(n,t)&&!s.hasOwnProperty(t)&&(o[t]=n[t]);if(e&&e.defaultProps)for(t in n=e.defaultProps)void 0===o[t]&&(o[t]=n[t]);return{$$typeof:a,type:e,key:u,ref:l,props:o,_owner:i.current}}n.jsx=u},5893:function(e,n,r){"use strict";e.exports=r(5251)},1149:function(e,n,r){var t=r(3379),a=r(585);"string"==typeof(a=a.__esModule?a.default:a)&&(a=[[e.id,a,""]]);var o={insert:("body","body"),singleton:!1};t(a,o);e.exports=a.locals||{}},3379:function(e,n,r){"use strict";var t,a=function(){return void 0===t&&(t=Boolean(window&&document&&document.all&&!window.atob)),t},o=function(){var e={};return function(n){if(void 0===e[n]){var r=document.querySelector(n);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}e[n]=r}return e[n]}}(),i=[];function c(e){for(var n=-1,r=0;r<i.length;r++)if(i[r].identifier===e){n=r;break}return n}function s(e,n){for(var r={},t=[],a=0;a<e.length;a++){var o=e[a],s=n.base?o[0]+n.base:o[0],u=r[s]||0,l="".concat(s," ").concat(u);r[s]=u+1;var d=c(l),p={css:o[1],media:o[2],sourceMap:o[3]};-1!==d?(i[d].references++,i[d].updater(p)):i.push({identifier:l,updater:h(p,n),references:1}),t.push(l)}return t}function u(e){var n=document.createElement("style"),t=e.attributes||{};if(void 0===t.nonce){var a=r.nc;a&&(t.nonce=a)}if(Object.keys(t).forEach((function(e){n.setAttribute(e,t[e])})),"function"==typeof e.insert)e.insert(n);else{var i=o(e.insert||"head");if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(n)}return n}var l,d=(l=[],function(e,n){return l[e]=n,l.filter(Boolean).join("\n")});function p(e,n,r,t){var a=r?"":t.media?"@media ".concat(t.media," {").concat(t.css,"}"):t.css;if(e.styleSheet)e.styleSheet.cssText=d(n,a);else{var o=document.createTextNode(a),i=e.childNodes;i[n]&&e.removeChild(i[n]),i.length?e.insertBefore(o,i[n]):e.appendChild(o)}}function f(e,n,r){var t=r.css,a=r.media,o=r.sourceMap;if(a?e.setAttribute("media",a):e.removeAttribute("media"),o&&"undefined"!=typeof btoa&&(t+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}var m=null,v=0;function h(e,n){var r,t,a;if(n.singleton){var o=v++;r=m||(m=u(n)),t=p.bind(null,r,o,!1),a=p.bind(null,r,o,!0)}else r=u(n),t=f.bind(null,r,n),a=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(r)};return t(e),function(n){if(n){if(n.css===e.css&&n.media===e.media&&n.sourceMap===e.sourceMap)return;t(e=n)}else a()}}e.exports=function(e,n){(n=n||{}).singleton||"boolean"==typeof n.singleton||(n.singleton=a());var r=s(e=e||[],n);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var t=0;t<r.length;t++){var a=c(r[t]);i[a].references--}for(var o=s(e,n),u=0;u<r.length;u++){var l=c(r[u]);0===i[l].references&&(i[l].updater(),i.splice(l,1))}r=o}}}},3054:function(e,n,r){"use strict";var t=r(8156),a=r.n(t),o=r(5395),i=r.n(o);n.Z=function(e,n){var r=a().useContext(i()).intlFormat;return n.zh_CN=n.zh,n.en_US=n.en,r&&r(e,n)}},5395:function(e){"use strict";e.exports=a},4135:function(e){"use strict";e.exports=t},7375:function(e){"use strict";e.exports=r},3888:function(e){"use strict";e.exports=n},8156:function(n){"use strict";n.exports=e}},i={};function c(e){var n=i[e];if(void 0!==n)return n.exports;var r=i[e]={id:e,exports:{}};return o[e](r,r.exports,c),r.exports}c.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(n,{a:n}),n},c.d=function(e,n){for(var r in n)c.o(n,r)&&!c.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},c.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},c.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.nc=void 0;var s={};return function(){"use strict";c.r(s),c.d(s,{Cascader:function(){return h},default:function(){return b}});var e=c(5893),n=c(8156),r=c(3888),t=c.n(r),a=c(7375),o=c.n(a),i=c(4135),u=c.n(i),l=c(3054),d={zh:{placeholder:"请选择"},en:{placeholder:"Please select"}},p=(c(1149),function(){return p=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++)for(var a in n=arguments[r])Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a]);return e},p.apply(this,arguments)}),f=function(e,n,r,t){return new(r||(r=Promise))((function(a,o){function i(e){try{s(t.next(e))}catch(e){o(e)}}function c(e){try{s(t.throw(e))}catch(e){o(e)}}function s(e){var n;e.done?a(e.value):(n=e.value,n instanceof r?n:new r((function(e){e(n)}))).then(i,c)}s((t=t.apply(e,n||[])).next())}))},m=function(e,n){var r,t,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function c(o){return function(c){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,t&&(a=2&o[0]?t.return:o[0]?t.throw||((a=t.return)&&a.call(t),0):t.next)&&!(a=a.call(t,o[1])).done)return a;switch(t=0,a&&(o=[2&o[0],a.value]),o[0]){case 0:case 1:a=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(a=i.trys,(a=a.length>0&&a[a.length-1])||6!==o[0]&&2!==o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]<a[3])){i.label=o[1];break}if(6===o[0]&&i.label<a[1]){i.label=a[1],a=o;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(o);break}a[2]&&i.ops.pop(),i.trys.pop();continue}o=n.call(e,i)}catch(e){o=[6,e],t=0}finally{r=a=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}},v=function(e,n,r){if(r||2===arguments.length)for(var t,a=0,o=n.length;a<o;a++)!t&&a in n||(t||(t=Array.prototype.slice.call(n,0,a)),t[a]=n[a]);return e.concat(t||Array.prototype.slice.call(n))},h=function(r){var a=r.data,i=r.expandTrigger,c=void 0===i?"click":i,s=r.value,h=void 0===s?[]:s,b=r.onChange,g=r.onDropdownVisibleChange,y=r.changeOnSelect,x=void 0!==y&&y,w=r.expandIcon,j=void 0===w?(0,e.jsx)(o(),{}):w,O=r.expandJoin,S=void 0===O?" , ":O,C=r.fieldNames,_=void 0===C?{label:"label",value:"value",children:"children"}:C,k=r.disabled,I=void 0!==k&&k,L=r.placeholder,
|
|
15
|
+
r(7418);var t=r(8156),a=60103;if(60107,"function"==typeof Symbol&&Symbol.for){var o=Symbol.for;a=o("react.element"),o("react.fragment")}var i=t.__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 u(e,n,r){var t,o={},u=null,l=null;for(t in void 0!==r&&(u=""+r),void 0!==n.key&&(u=""+n.key),void 0!==n.ref&&(l=n.ref),n)c.call(n,t)&&!s.hasOwnProperty(t)&&(o[t]=n[t]);if(e&&e.defaultProps)for(t in n=e.defaultProps)void 0===o[t]&&(o[t]=n[t]);return{$$typeof:a,type:e,key:u,ref:l,props:o,_owner:i.current}}n.jsx=u},5893:function(e,n,r){"use strict";e.exports=r(5251)},1149:function(e,n,r){var t=r(3379),a=r(585);"string"==typeof(a=a.__esModule?a.default:a)&&(a=[[e.id,a,""]]);var o={insert:("body","body"),singleton:!1};t(a,o);e.exports=a.locals||{}},3379:function(e,n,r){"use strict";var t,a=function(){return void 0===t&&(t=Boolean(window&&document&&document.all&&!window.atob)),t},o=function(){var e={};return function(n){if(void 0===e[n]){var r=document.querySelector(n);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}e[n]=r}return e[n]}}(),i=[];function c(e){for(var n=-1,r=0;r<i.length;r++)if(i[r].identifier===e){n=r;break}return n}function s(e,n){for(var r={},t=[],a=0;a<e.length;a++){var o=e[a],s=n.base?o[0]+n.base:o[0],u=r[s]||0,l="".concat(s," ").concat(u);r[s]=u+1;var d=c(l),p={css:o[1],media:o[2],sourceMap:o[3]};-1!==d?(i[d].references++,i[d].updater(p)):i.push({identifier:l,updater:h(p,n),references:1}),t.push(l)}return t}function u(e){var n=document.createElement("style"),t=e.attributes||{};if(void 0===t.nonce){var a=r.nc;a&&(t.nonce=a)}if(Object.keys(t).forEach((function(e){n.setAttribute(e,t[e])})),"function"==typeof e.insert)e.insert(n);else{var i=o(e.insert||"head");if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(n)}return n}var l,d=(l=[],function(e,n){return l[e]=n,l.filter(Boolean).join("\n")});function p(e,n,r,t){var a=r?"":t.media?"@media ".concat(t.media," {").concat(t.css,"}"):t.css;if(e.styleSheet)e.styleSheet.cssText=d(n,a);else{var o=document.createTextNode(a),i=e.childNodes;i[n]&&e.removeChild(i[n]),i.length?e.insertBefore(o,i[n]):e.appendChild(o)}}function f(e,n,r){var t=r.css,a=r.media,o=r.sourceMap;if(a?e.setAttribute("media",a):e.removeAttribute("media"),o&&"undefined"!=typeof btoa&&(t+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}var m=null,v=0;function h(e,n){var r,t,a;if(n.singleton){var o=v++;r=m||(m=u(n)),t=p.bind(null,r,o,!1),a=p.bind(null,r,o,!0)}else r=u(n),t=f.bind(null,r,n),a=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(r)};return t(e),function(n){if(n){if(n.css===e.css&&n.media===e.media&&n.sourceMap===e.sourceMap)return;t(e=n)}else a()}}e.exports=function(e,n){(n=n||{}).singleton||"boolean"==typeof n.singleton||(n.singleton=a());var r=s(e=e||[],n);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var t=0;t<r.length;t++){var a=c(r[t]);i[a].references--}for(var o=s(e,n),u=0;u<r.length;u++){var l=c(r[u]);0===i[l].references&&(i[l].updater(),i.splice(l,1))}r=o}}}},3054:function(e,n,r){"use strict";var t=r(8156),a=r.n(t),o=r(5395),i=r.n(o);n.Z=function(e,n){var r=a().useContext(i()).intlFormat;return n.zh_CN=n.zh,n["zh-CN"]=n.zh,n.en_US=n.en,n["en-US"]=n.en,r&&r(e,n)}},5395:function(e){"use strict";e.exports=a},4135:function(e){"use strict";e.exports=t},7375:function(e){"use strict";e.exports=r},3888:function(e){"use strict";e.exports=n},8156:function(n){"use strict";n.exports=e}},i={};function c(e){var n=i[e];if(void 0!==n)return n.exports;var r=i[e]={id:e,exports:{}};return o[e](r,r.exports,c),r.exports}c.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(n,{a:n}),n},c.d=function(e,n){for(var r in n)c.o(n,r)&&!c.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},c.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},c.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.nc=void 0;var s={};return function(){"use strict";c.r(s),c.d(s,{Cascader:function(){return h},default:function(){return b}});var e=c(5893),n=c(8156),r=c(3888),t=c.n(r),a=c(7375),o=c.n(a),i=c(4135),u=c.n(i),l=c(3054),d={zh:{placeholder:"请选择"},en:{placeholder:"Please select"}},p=(c(1149),function(){return p=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++)for(var a in n=arguments[r])Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a]);return e},p.apply(this,arguments)}),f=function(e,n,r,t){return new(r||(r=Promise))((function(a,o){function i(e){try{s(t.next(e))}catch(e){o(e)}}function c(e){try{s(t.throw(e))}catch(e){o(e)}}function s(e){var n;e.done?a(e.value):(n=e.value,n instanceof r?n:new r((function(e){e(n)}))).then(i,c)}s((t=t.apply(e,n||[])).next())}))},m=function(e,n){var r,t,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function c(o){return function(c){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,t&&(a=2&o[0]?t.return:o[0]?t.throw||((a=t.return)&&a.call(t),0):t.next)&&!(a=a.call(t,o[1])).done)return a;switch(t=0,a&&(o=[2&o[0],a.value]),o[0]){case 0:case 1:a=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(a=i.trys,(a=a.length>0&&a[a.length-1])||6!==o[0]&&2!==o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]<a[3])){i.label=o[1];break}if(6===o[0]&&i.label<a[1]){i.label=a[1],a=o;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(o);break}a[2]&&i.ops.pop(),i.trys.pop();continue}o=n.call(e,i)}catch(e){o=[6,e],t=0}finally{r=a=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}},v=function(e,n,r){if(r||2===arguments.length)for(var t,a=0,o=n.length;a<o;a++)!t&&a in n||(t||(t=Array.prototype.slice.call(n,0,a)),t[a]=n[a]);return e.concat(t||Array.prototype.slice.call(n))},h=function(r){var a=r.data,i=r.expandTrigger,c=void 0===i?"click":i,s=r.value,h=void 0===s?[]:s,b=r.onChange,g=r.onDropdownVisibleChange,y=r.changeOnSelect,x=void 0!==y&&y,w=r.expandIcon,j=void 0===w?(0,e.jsx)(o(),{}):w,O=r.expandJoin,S=void 0===O?" , ":O,C=r.fieldNames,_=void 0===C?{label:"label",value:"value",children:"children"}:C,k=r.disabled,I=void 0!==k&&k,L=r.placeholder,N=r.loadData,P=void 0===N?function(){return f(void 0,void 0,void 0,(function(){return m(this,(function(e){return[2]}))}))}:N,T=r.loadingIcon,E=void 0===T?(0,e.jsx)(u(),{}):T,R=r.children,U=(0,l.Z)("Cascader",d),q=(0,n.useState)(a),M=q[0],z=q[1],D=(0,n.useState)(h),Y=D[0],A=D[1],G=(0,n.useState)(function(e,n,r){var t=[],a=0;function o(e){for(var r=0;r<e.length;r++)e[r].value===n[a]&&(r===e.length-1?t.push(e[r].label):(a++,t.push(e[r].label),o(e[r].children)));return t}return o(e),t.join(r)}(a,h,S)),B=G[0],F=G[1],V=(0,n.useCallback)((function(e,n){A(e),F(n.map((function(e){return e.label})).join(S)),b&&b(e,n)}),[]);return(0,e.jsx)("div",p({className:"cascader"},{children:(0,e.jsx)(t(),p({options:M,onChange:V,changeOnSelect:x,expandTrigger:c,expandIcon:j,fieldNames:_,loadData:function(e){return f(void 0,void 0,void 0,(function(){return m(this,(function(n){switch(n.label){case 0:return[4,P(e)];case 1:return n.sent(),z(v([],a,!0)),[2]}}))}))},loadingIcon:E,onDropdownVisibleChange:g,value:Y},{children:R?(0,e.jsx)("button",p({disabled:I},{children:R})):(0,e.jsx)("input",{value:B,readOnly:!0,disabled:I,placeholder:L||U({id:"placeholder"})})}))}))};var b=h}(),s}()}));
|
package/CollapseBox/index.js
CHANGED
|
@@ -12,4 +12,4 @@ object-assign
|
|
|
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
14
|
*/
|
|
15
|
-
n(7418);var r=n(8156),o=60103;if(60107,"function"==typeof Symbol&&Symbol.for){var i=Symbol.for;o=i("react.element"),i("react.fragment")}var a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c=Object.prototype.hasOwnProperty,u={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,n){var r,i={},s=null,l=null;for(r in void 0!==n&&(s=""+n),void 0!==t.key&&(s=""+t.key),void 0!==t.ref&&(l=t.ref),t)c.call(t,r)&&!u.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:o,type:e,key:s,ref:l,props:i,_owner:a.current}}t.jsx=s},5893:function(e,t,n){"use strict";e.exports=n(5251)},7262:function(e,t,n){var r=n(3379),o=n(7283);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:("body","body"),singleton:!1};r(o,i);e.exports=o.locals||{}},3379:function(e,t,n){"use strict";var r,o=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},i=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),a=[];function c(e){for(var t=-1,n=0;n<a.length;n++)if(a[n].identifier===e){t=n;break}return t}function u(e,t){for(var n={},r=[],o=0;o<e.length;o++){var i=e[o],u=t.base?i[0]+t.base:i[0],s=n[u]||0,l="".concat(u," ").concat(s);n[u]=s+1;var f=c(l),p={css:i[1],media:i[2],sourceMap:i[3]};-1!==f?(a[f].references++,a[f].updater(p)):a.push({identifier:l,updater:y(p,t),references:1}),r.push(l)}return r}function s(e){var t=document.createElement("style"),r=e.attributes||{};if(void 0===r.nonce){var o=n.nc;o&&(r.nonce=o)}if(Object.keys(r).forEach((function(e){t.setAttribute(e,r[e])})),"function"==typeof e.insert)e.insert(t);else{var a=i(e.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(t)}return t}var l,f=(l=[],function(e,t){return l[e]=t,l.filter(Boolean).join("\n")});function p(e,t,n,r){var o=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(e.styleSheet)e.styleSheet.cssText=f(t,o);else{var i=document.createTextNode(o),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}function d(e,t,n){var r=n.css,o=n.media,i=n.sourceMap;if(o?e.setAttribute("media",o):e.removeAttribute("media"),i&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}var v=null,h=0;function y(e,t){var n,r,o;if(t.singleton){var i=h++;n=v||(v=s(t)),r=p.bind(null,n,i,!1),o=p.bind(null,n,i,!0)}else n=s(t),r=d.bind(null,n,t),o=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=o());var n=u(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var r=0;r<n.length;r++){var o=c(n[r]);a[o].references--}for(var i=u(e,t),s=0;s<n.length;s++){var l=c(n[s]);0===a[l].references&&(a[l].updater(),a.splice(l,1))}n=i}}}},8156:function(t){"use strict";t.exports=e},5002:function(e){"use strict";e.exports=t}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var i=r[e]={id:e,exports:{}};return n[e](i,i.exports,o),i.exports}o.d=function(e,t){for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nc=void 0;var i={};return function(){"use strict";o.r(i)
|
|
15
|
+
n(7418);var r=n(8156),o=60103;if(60107,"function"==typeof Symbol&&Symbol.for){var i=Symbol.for;o=i("react.element"),i("react.fragment")}var a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c=Object.prototype.hasOwnProperty,u={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,n){var r,i={},s=null,l=null;for(r in void 0!==n&&(s=""+n),void 0!==t.key&&(s=""+t.key),void 0!==t.ref&&(l=t.ref),t)c.call(t,r)&&!u.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:o,type:e,key:s,ref:l,props:i,_owner:a.current}}t.jsx=s},5893:function(e,t,n){"use strict";e.exports=n(5251)},7262:function(e,t,n){var r=n(3379),o=n(7283);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:("body","body"),singleton:!1};r(o,i);e.exports=o.locals||{}},3379:function(e,t,n){"use strict";var r,o=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},i=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),a=[];function c(e){for(var t=-1,n=0;n<a.length;n++)if(a[n].identifier===e){t=n;break}return t}function u(e,t){for(var n={},r=[],o=0;o<e.length;o++){var i=e[o],u=t.base?i[0]+t.base:i[0],s=n[u]||0,l="".concat(u," ").concat(s);n[u]=s+1;var f=c(l),p={css:i[1],media:i[2],sourceMap:i[3]};-1!==f?(a[f].references++,a[f].updater(p)):a.push({identifier:l,updater:y(p,t),references:1}),r.push(l)}return r}function s(e){var t=document.createElement("style"),r=e.attributes||{};if(void 0===r.nonce){var o=n.nc;o&&(r.nonce=o)}if(Object.keys(r).forEach((function(e){t.setAttribute(e,r[e])})),"function"==typeof e.insert)e.insert(t);else{var a=i(e.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(t)}return t}var l,f=(l=[],function(e,t){return l[e]=t,l.filter(Boolean).join("\n")});function p(e,t,n,r){var o=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(e.styleSheet)e.styleSheet.cssText=f(t,o);else{var i=document.createTextNode(o),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}function d(e,t,n){var r=n.css,o=n.media,i=n.sourceMap;if(o?e.setAttribute("media",o):e.removeAttribute("media"),i&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}var v=null,h=0;function y(e,t){var n,r,o;if(t.singleton){var i=h++;n=v||(v=s(t)),r=p.bind(null,n,i,!1),o=p.bind(null,n,i,!0)}else n=s(t),r=d.bind(null,n,t),o=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=o());var n=u(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var r=0;r<n.length;r++){var o=c(n[r]);a[o].references--}for(var i=u(e,t),s=0;s<n.length;s++){var l=c(n[s]);0===a[l].references&&(a[l].updater(),a.splice(l,1))}n=i}}}},2458:function(e,t,n){"use strict";function r(e,t){var n=e.timeout,r=e.style,o=void 0===r?{}:r;return{duration:o.transitionDuration||"number"==typeof n?n:n[t.mode]||0,delay:o.transitionDelay}}function o(e){if(!e)return 0;var t=e/36;return Math.round(10*(4+15*Math.pow(t,.25)+t/5))}n.d(t,{C:function(){return r},O:function(){return o}})},8156:function(t){"use strict";t.exports=e},5002:function(e){"use strict";e.exports=t}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var i=r[e]={id:e,exports:{}};return n[e](i,i.exports,o),i.exports}o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,{a:t}),t},o.d=function(e,t){for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nc=void 0;var i={};return function(){"use strict";o.r(i);var e=o(5893),t=o(8156),n=o(5002),r=o(2458),a=(o(7262),function(){return a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},a.apply(this,arguments)});i.default=function(o){var i=o.className,c=o.style,u=o.in,s=o.collapsedHeight,l=void 0===s?"0px":s,f=o.timeout,p=void 0===f?"auto":f,d=o.unmountOnExit,v=o.children,h=(0,t.useRef)(null),y=(0,t.useRef)(null),b=(0,t.useRef)(null),m=(0,t.useRef)(null),g="number"==typeof l?"".concat(l,"px"):l;(0,t.useEffect)((function(){return function(){clearTimeout(h.current)}}),[]);var x=function(e){return function(t){e&&e(t)}},O=x((function(e){e.style.height=g})),j=x((function(e){var t=b.current?b.current.clientHeight:0,n=(0,r.C)({style:c,timeout:p},{mode:"enter"}).duration;if("auto"===p){var o=(0,r.O)(t);e.style.transitionDuration="".concat(o,"ms"),m.current=o}else e.style.transitionDuration="string"==typeof n?n:"".concat(n,"ms");e.style.height="".concat(t,"px")})),w=x((function(e){e.style.height="auto"})),E=x((function(e){var t=b.current?b.current.clientHeight:0;e.style.height="".concat(t,"px")})),S=x((function(e){var t=b.current?b.current.clientHeight:0,n=(0,r.C)({style:c,timeout:p},{mode:"exit"}).duration;if("auto"===p){var o=(0,r.O)(t);e.style.transitionDuration="".concat(o,"ms"),m.current=o}else e.style.transitionDuration="string"==typeof n?n:"".concat(n,"ms");e.style.height=g})),_=function(e){var t="paraui-collapse-box";return i&&(t+=" "+i),"entered"===e&&(t+=" paraui-collapse-box-entered"),"exited"!==e||u||"0px"!==g||(t+=" paraui-collapse-box-hidden"),t};return(0,e.jsx)(n.Transition,a({in:u,unmountOnExit:d,onEnter:O,onEntered:w,onEntering:j,onExit:E,onExiting:S,timeout:"auto"===p?void 0:p,addEndListener:function(e,t){h.current=setTimeout(t,m.current||0)}},{children:function(t,n){return(0,e.jsx)("div",a({className:_(t),style:a({minHeight:g},c),ref:y},n,{children:(0,e.jsx)("div",a({className:"paraui-collapse-box-wrapper",ref:b},{children:(0,e.jsx)("div",a({className:"paraui-collapse-box-wrapper-inner"},{children:v}))}))}))}}))}}(),i}()}));
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
import './index.scss';
|
|
3
|
+
export interface CollapseLayoutProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
style?: React.CSSProperties;
|
|
6
|
+
/**
|
|
7
|
+
* 收起出现的位置
|
|
8
|
+
* 默认 left
|
|
9
|
+
*/
|
|
10
|
+
type?: 'left' | 'right' | 'top' | 'bottom';
|
|
11
|
+
/**
|
|
12
|
+
* 普通展示数据
|
|
13
|
+
*/
|
|
14
|
+
defaultContent?: React.ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* 显示隐藏的数据
|
|
17
|
+
*/
|
|
18
|
+
displayContent?: React.ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* 展开还是收起
|
|
21
|
+
*/
|
|
22
|
+
open?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* 允许缩放的长度
|
|
25
|
+
* */
|
|
26
|
+
zoomLength?: number;
|
|
27
|
+
/**
|
|
28
|
+
* 单位
|
|
29
|
+
* 默认px
|
|
30
|
+
*/
|
|
31
|
+
unit?: string;
|
|
32
|
+
/**
|
|
33
|
+
* 展开按钮显示文字
|
|
34
|
+
*/
|
|
35
|
+
showLabel?: string;
|
|
36
|
+
/**
|
|
37
|
+
* 收起按钮展示文字
|
|
38
|
+
*/
|
|
39
|
+
hideLabel?: string;
|
|
40
|
+
/**
|
|
41
|
+
* 间距
|
|
42
|
+
* 默认20
|
|
43
|
+
*/
|
|
44
|
+
spacing?: number;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* @author zhanzl
|
|
48
|
+
* @date 2022/08/09
|
|
49
|
+
*/
|
|
50
|
+
declare const CollapseLayout: FC<CollapseLayoutProps>;
|
|
51
|
+
export default CollapseLayout;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
!function(t,a){"object"==typeof exports&&"object"==typeof module?module.exports=a(require("react"),require("@para-ui/icons/DoubleLeft"),require("@para-ui/icons/DoubleRight"),require("clsx")):"function"==typeof define&&define.amd?define(["react","@para-ui/icons/DoubleLeft","@para-ui/icons/DoubleRight","clsx"],a):"object"==typeof exports?exports.ParaUI=a(require("react"),require("@para-ui/icons/DoubleLeft"),require("@para-ui/icons/DoubleRight"),require("clsx")):t.ParaUI=a(t.react,t["@para-ui/icons/DoubleLeft"],t["@para-ui/icons/DoubleRight"],t.clsx)}(self,(function(t,a,e,o){return function(){var r={9116:function(t,a,e){(a=e(3645)(!1)).push([t.id,'.paraui-collapse-layout{height:100%;width:100%;position:relative;overflow:hidden}.paraui-collapse-layout .collapse-layout-icon-transform-top{transform:rotate(90deg)}.paraui-collapse-layout .collapse-layout-icon-transform-bottom{transform:rotate(-90deg)}.paraui-collapse-layout .collapse-layout-icon-transform-right{transform:rotate(180deg)}.paraui-collapse-layout .collapse-layout-display{overflow:hidden}.paraui-collapse-layout.paraui-collapse-layout-left .collapse-layout-click span,.paraui-collapse-layout.paraui-collapse-layout-right .collapse-layout-click span,.paraui-collapse-layout.paraui-collapse-layout-top .collapse-layout-click span,.paraui-collapse-layout.paraui-collapse-layout-bottom .collapse-layout-click span{font-size:12px;font-weight:400;text-align:center;color:#3666d6}.paraui-collapse-layout.paraui-collapse-layout-right .collapse-layout-click{position:absolute;top:50%;left:"";width:20px;height:72px;background:rgba(171,176,185,.12);text-align:center;cursor:pointer;line-height:23px;margin-top:-36px;z-index:1;display:grid;transition-property:right;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-delay:0ms;right:0px;border-radius:4px 0 0 4px;border-right:1px solid #3666d6}.paraui-collapse-layout.paraui-collapse-layout-right .collapse-layout-click>svg{align-self:center;justify-self:center}.paraui-collapse-layout.paraui-collapse-layout-right .collapse-layout-display-shadow{transition-property:margin-right;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-delay:0ms}.paraui-collapse-layout.paraui-collapse-layout-left .collapse-layout-click{position:absolute;top:50%;left:0;width:20px;height:72px;background:rgba(171,176,185,.12);text-align:center;cursor:pointer;line-height:23px;margin-top:-36px;z-index:1;display:grid;transition-property:left;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-delay:0ms;border-left:1px solid #3666d6;border-radius:0 4px 4px 0}.paraui-collapse-layout.paraui-collapse-layout-left .collapse-layout-click>svg{align-self:center;justify-self:center}.paraui-collapse-layout.paraui-collapse-layout-left .collapse-layout-display-shadow{transition-property:margin-left;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-delay:0ms}.paraui-collapse-layout.paraui-collapse-layout-left>div,.paraui-collapse-layout.paraui-collapse-layout-right>div{display:inline-block;vertical-align:middle;height:100%;position:relative}.paraui-collapse-layout.paraui-collapse-layout-left .collapse-layout-display-shadow,.paraui-collapse-layout.paraui-collapse-layout-right .collapse-layout-display-shadow{height:100%}.paraui-collapse-layout.paraui-collapse-layout-left .collapse-layout-display,.paraui-collapse-layout.paraui-collapse-layout-left .collapse-layout-default,.paraui-collapse-layout.paraui-collapse-layout-right .collapse-layout-display,.paraui-collapse-layout.paraui-collapse-layout-right .collapse-layout-default{transition:width}.paraui-collapse-layout.paraui-collapse-layout-top .collapse-layout-click{position:absolute;top:0;left:50%;width:72px;height:20px;background:rgba(171,176,185,.12);text-align:center;cursor:pointer;line-height:23px;margin-top:0;z-index:1;display:grid;transition-property:top;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-delay:0ms;margin-left:-36px;border-top:1px solid #3666d6;border-radius:0 0 4px 4px}.paraui-collapse-layout.paraui-collapse-layout-top .collapse-layout-click>svg{align-self:center;justify-self:center}.paraui-collapse-layout.paraui-collapse-layout-top .collapse-layout-display-shadow{transition-property:margin-top}.paraui-collapse-layout.paraui-collapse-layout-bottom .collapse-layout-click{position:absolute;top:"";left:50%;width:72px;height:20px;background:rgba(171,176,185,.12);text-align:center;cursor:pointer;line-height:23px;margin-top:0;z-index:1;display:grid;transition-property:bottom;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-delay:0ms;margin-left:-36px;bottom:0px;border-bottom:1px solid #3666d6;border-radius:4px 4px 0 0}.paraui-collapse-layout.paraui-collapse-layout-bottom .collapse-layout-click>svg{align-self:center;justify-self:center}.paraui-collapse-layout.paraui-collapse-layout-bottom .collapse-layout-display-shadow{transition-property:margin-bottom;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-delay:0ms}.paraui-collapse-layout.paraui-collapse-layout-top .collapse-layout-display,.paraui-collapse-layout.paraui-collapse-layout-top .collapse-layout-default,.paraui-collapse-layout.paraui-collapse-layout-bottom .collapse-layout-display,.paraui-collapse-layout.paraui-collapse-layout-bottom .collapse-layout-default{transition-property:height;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-delay:0ms}.paraui-collapse-layout.paraui-collapse-layout-top .collapse-layout-display-shadow,.paraui-collapse-layout.paraui-collapse-layout-bottom .collapse-layout-display-shadow{width:100%}.paraui-collapse-layout.paraui-collapse-layout-top>div,.paraui-collapse-layout.paraui-collapse-layout-bottom>div{display:block;width:100%;position:relative}',""]),t.exports=a},3645:function(t){"use strict";t.exports=function(t){var a=[];return a.toString=function(){return this.map((function(a){var e=function(t,a){var e=t[1]||"",o=t[3];if(!o)return e;if(a&&"function"==typeof btoa){var r=(i=o,n=btoa(unescape(encodeURIComponent(JSON.stringify(i)))),c="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(n),"/*# ".concat(c," */")),l=o.sources.map((function(t){return"/*# sourceURL=".concat(o.sourceRoot||"").concat(t," */")}));return[e].concat(l).concat([r]).join("\n")}var i,n,c;return[e].join("\n")}(a,t);return a[2]?"@media ".concat(a[2]," {").concat(e,"}"):e})).join("")},a.i=function(t,e,o){"string"==typeof t&&(t=[[null,t,""]]);var r={};if(o)for(var l=0;l<this.length;l++){var i=this[l][0];null!=i&&(r[i]=!0)}for(var n=0;n<t.length;n++){var c=[].concat(t[n]);o&&r[c[0]]||(e&&(c[2]?c[2]="".concat(e," and ").concat(c[2]):c[2]=e),a.push(c))}},a}},7418:function(t){"use strict";
|
|
2
|
+
/*
|
|
3
|
+
object-assign
|
|
4
|
+
(c) Sindre Sorhus
|
|
5
|
+
@license MIT
|
|
6
|
+
*/var a=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function r(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 a={},e=0;e<10;e++)a["_"+String.fromCharCode(e)]=e;if("0123456789"!==Object.getOwnPropertyNames(a).map((function(t){return a[t]})).join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach((function(t){o[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(t){return!1}}()?Object.assign:function(t,l){for(var i,n,c=r(t),u=1;u<arguments.length;u++){for(var s in i=Object(arguments[u]))e.call(i,s)&&(c[s]=i[s]);if(a){n=a(i);for(var p=0;p<n.length;p++)o.call(i,n[p])&&(c[n[p]]=i[n[p]])}}return c}},5251:function(t,a,e){"use strict";
|
|
7
|
+
/** @license React v17.0.2
|
|
8
|
+
* react-jsx-runtime.production.min.js
|
|
9
|
+
*
|
|
10
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
11
|
+
*
|
|
12
|
+
* This source code is licensed under the MIT license found in the
|
|
13
|
+
* LICENSE file in the root directory of this source tree.
|
|
14
|
+
*/
|
|
15
|
+
e(7418);var o=e(8156),r=60103;if(60107,"function"==typeof Symbol&&Symbol.for){var l=Symbol.for;r=l("react.element"),l("react.fragment")}var i=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,n=Object.prototype.hasOwnProperty,c={key:!0,ref:!0,__self:!0,__source:!0};function u(t,a,e){var o,l={},u=null,s=null;for(o in void 0!==e&&(u=""+e),void 0!==a.key&&(u=""+a.key),void 0!==a.ref&&(s=a.ref),a)n.call(a,o)&&!c.hasOwnProperty(o)&&(l[o]=a[o]);if(t&&t.defaultProps)for(o in a=t.defaultProps)void 0===l[o]&&(l[o]=a[o]);return{$$typeof:r,type:t,key:u,ref:s,props:l,_owner:i.current}}a.jsx=u,a.jsxs=u},5893:function(t,a,e){"use strict";t.exports=e(5251)},2906:function(t,a,e){var o=e(3379),r=e(9116);"string"==typeof(r=r.__esModule?r.default:r)&&(r=[[t.id,r,""]]);var l={insert:("body","body"),singleton:!1};o(r,l);t.exports=r.locals||{}},3379:function(t,a,e){"use strict";var o,r=function(){return void 0===o&&(o=Boolean(window&&document&&document.all&&!window.atob)),o},l=function(){var t={};return function(a){if(void 0===t[a]){var e=document.querySelector(a);if(window.HTMLIFrameElement&&e instanceof window.HTMLIFrameElement)try{e=e.contentDocument.head}catch(t){e=null}t[a]=e}return t[a]}}(),i=[];function n(t){for(var a=-1,e=0;e<i.length;e++)if(i[e].identifier===t){a=e;break}return a}function c(t,a){for(var e={},o=[],r=0;r<t.length;r++){var l=t[r],c=a.base?l[0]+a.base:l[0],u=e[c]||0,s="".concat(c," ").concat(u);e[c]=u+1;var p=n(s),f={css:l[1],media:l[2],sourceMap:l[3]};-1!==p?(i[p].references++,i[p].updater(f)):i.push({identifier:s,updater:g(f,a),references:1}),o.push(s)}return o}function u(t){var a=document.createElement("style"),o=t.attributes||{};if(void 0===o.nonce){var r=e.nc;r&&(o.nonce=r)}if(Object.keys(o).forEach((function(t){a.setAttribute(t,o[t])})),"function"==typeof t.insert)t.insert(a);else{var i=l(t.insert||"head");if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(a)}return a}var s,p=(s=[],function(t,a){return s[t]=a,s.filter(Boolean).join("\n")});function f(t,a,e,o){var r=e?"":o.media?"@media ".concat(o.media," {").concat(o.css,"}"):o.css;if(t.styleSheet)t.styleSheet.cssText=p(a,r);else{var l=document.createTextNode(r),i=t.childNodes;i[a]&&t.removeChild(i[a]),i.length?t.insertBefore(l,i[a]):t.appendChild(l)}}function d(t,a,e){var o=e.css,r=e.media,l=e.sourceMap;if(r?t.setAttribute("media",r):t.removeAttribute("media"),l&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(l))))," */")),t.styleSheet)t.styleSheet.cssText=o;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(o))}}var y=null,h=0;function g(t,a){var e,o,r;if(a.singleton){var l=h++;e=y||(y=u(a)),o=f.bind(null,e,l,!1),r=f.bind(null,e,l,!0)}else e=u(a),o=d.bind(null,e,a),r=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)};return o(t),function(a){if(a){if(a.css===t.css&&a.media===t.media&&a.sourceMap===t.sourceMap)return;o(t=a)}else r()}}t.exports=function(t,a){(a=a||{}).singleton||"boolean"==typeof a.singleton||(a.singleton=r());var e=c(t=t||[],a);return function(t){if(t=t||[],"[object Array]"===Object.prototype.toString.call(t)){for(var o=0;o<e.length;o++){var r=n(e[o]);i[r].references--}for(var l=c(t,a),u=0;u<e.length;u++){var s=n(e[u]);0===i[s].references&&(i[s].updater(),i.splice(s,1))}e=l}}}},2458:function(t,a,e){"use strict";function o(t){if(!t)return 0;var a=t/36;return Math.round(10*(4+15*Math.pow(a,.25)+a/5))}e.d(a,{O:function(){return o}})},54:function(t){"use strict";t.exports=a},9438:function(t){"use strict";t.exports=e},5744:function(t){"use strict";t.exports=o},8156:function(a){"use strict";a.exports=t}},l={};function i(t){var a=l[t];if(void 0!==a)return a.exports;var e=l[t]={id:t,exports:{}};return r[t](e,e.exports,i),e.exports}i.n=function(t){var a=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(a,{a:a}),a},i.d=function(t,a){for(var e in a)i.o(a,e)&&!i.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:a[e]})},i.o=function(t,a){return Object.prototype.hasOwnProperty.call(t,a)},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.nc=void 0;var n={};return function(){"use strict";i.r(n);var t=i(5893),a=i(8156),e=i(54),o=i.n(e),r=i(9438),l=i.n(r),c=i(5744),u=i.n(c),s=i(2458),p=(i(2906),function(){return p=Object.assign||function(t){for(var a,e=1,o=arguments.length;e<o;e++)for(var r in a=arguments[e])Object.prototype.hasOwnProperty.call(a,r)&&(t[r]=a[r]);return t},p.apply(this,arguments)});n.default=function(e){var r=e.type,i=void 0===r?"left":r,n=e.showLabel,c=e.open,f=void 0!==c&&c,d=e.hideLabel,y=e.spacing,h=void 0===y?20:y,g=e.zoomLength,b=void 0===g?0:g,m=e.unit,v=void 0===m?"px":m,x=e.style,j=e.className,w=void 0===j?"":j,O=(0,a.useRef)(null),k=function(){var t=O.current;if(!t)return 0;var a=t.getBoundingClientRect();return(0,s.O)(a.width)}(),S=(0,a.useState)(),_=S[0],C=S[1],N={layout:{left:["display","default"],right:["default","display"],top:["display","default"],bottom:["default","display"]}},R=function(t){return t.slice(0,1).toUpperCase()+t.slice(1)},D=function(){var t="width";return"top"!==i&&"bottom"!==i||(t="height"),t},E=function(){var t={},a="margin".concat(R(i));return t[D()]=b+v,t[a]=(_?0:b)+v,t.transitionDuration=k+"ms",t},L=function(){var t={},a=D(),e=_?b:0;return t[a]="calc(100% - ".concat(e+h).concat(v),t["margin".concat(R(i))]=h+v,t.transitionDuration=k+"ms",t};return(0,a.useEffect)((function(){C(f)}),[f]),(0,t.jsxs)("div",p({className:u()("paraui-collapse-layout","paraui-collapse-layout-".concat(_),"paraui-collapse-layout-".concat(i),"paraui-collapse-layout-".concat(i,"-").concat(_),w),style:x},{children:[function(){var a,e=_?n:d;return(0,t.jsxs)("div",p({className:"collapse-layout-click collapse-layout-click-label-".concat(!!e),style:(a={},a[i]="".concat(_?b:0).concat(v),a.transitionDuration=k+"ms",a),onClick:function(){return C(!_)}},{children:[e&&(0,t.jsx)("span",{children:e}),_?(0,t.jsx)(o(),{className:"collapse-layout-icon-transform-".concat(i)}):(0,t.jsx)(l(),{className:"collapse-layout-icon-transform-".concat(i)})]}))}(),N.layout[i].map((function(a,o){return"display"===a?(0,t.jsx)("div",p({className:"collapse-layout-display",style:(r={},l=(_?b:0)+v,r[D()]=l,r.transitionDuration=k+"ms",r)},{children:(0,t.jsx)("div",p({className:"collapse-layout-display-shadow",style:E(),ref:O},{children:e.displayContent}))}),o):(0,t.jsx)("div",p({className:"collapse-layout-default",style:L()},{children:e.defaultContent}),o);var r,l}))]}))}}(),n}()}));
|