@para-ui/core 2.1.36 → 2.1.37

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.
@@ -0,0 +1,27 @@
1
+ /**
2
+ * @author linhd
3
+ * @date 2022/5/23 2:19 PM
4
+ * @description 折叠容器
5
+ */
6
+ import React, { FunctionComponent } from 'react';
7
+ import './index.scss';
8
+ export interface CollapseBoxProps {
9
+ /** className */
10
+ className?: string;
11
+ /** css样式 */
12
+ style?: React.CSSProperties;
13
+ /** 收起状态最小高度 */
14
+ collapsedHeight?: string | number;
15
+ /** 收起时是否不渲染子节点 */
16
+ unmountOnExit?: boolean;
17
+ /** 动画时间 */
18
+ timeout?: 'auto' | number | {
19
+ appear?: number | undefined;
20
+ enter?: number | undefined;
21
+ exit?: number | undefined;
22
+ };
23
+ children?: any;
24
+ [name: string]: any;
25
+ }
26
+ declare const CollapseBox: FunctionComponent<CollapseBoxProps>;
27
+ export default CollapseBox;
@@ -0,0 +1,15 @@
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-transition-group")):"function"==typeof define&&define.amd?define(["react","react-transition-group"],t):"object"==typeof exports?exports.ParaUI=t(require("react"),require("react-transition-group")):e.ParaUI=t(e.react,e["react-transition-group"])}(self,(function(e,t){return function(){var n={7283:function(e,t,n){(t=n(3645)(!1)).push([e.id,".paraui-collapse-box{transition:height 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;width:100%;overflow:hidden;height:0}.paraui-collapse-box>.paraui-collapse-box-wrapper{display:flex;width:100%}.paraui-collapse-box>.paraui-collapse-box-wrapper>.paraui-collapse-box-wrapper-inner{width:100%}.paraui-collapse-box.paraui-collapse-box-entered{overflow:visible}.paraui-collapse-box.paraui-collapse-box-hidden{visibility:hidden}\n",""]),e.exports=t},3645:function(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var o=(a=r,c=btoa(unescape(encodeURIComponent(JSON.stringify(a)))),u="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(c),"/*# ".concat(u," */")),i=r.sources.map((function(e){return"/*# sourceURL=".concat(r.sourceRoot||"").concat(e," */")}));return[n].concat(i).concat([o]).join("\n")}var a,c,u;return[n].join("\n")}(t,e);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(r)for(var i=0;i<this.length;i++){var a=this[i][0];null!=a&&(o[a]=!0)}for(var c=0;c<e.length;c++){var u=[].concat(e[c]);r&&o[u[0]]||(n&&(u[2]?u[2]="".concat(n," and ").concat(u[2]):u[2]=n),t.push(u))}},t}},7418:function(e){"use strict";
2
+ /*
3
+ object-assign
4
+ (c) Sindre Sorhus
5
+ @license MIT
6
+ */var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,i){for(var a,c,u=o(e),s=1;s<arguments.length;s++){for(var l in a=Object(arguments[s]))n.call(a,l)&&(u[l]=a[l]);if(t){c=t(a);for(var f=0;f<c.length;f++)r.call(a,c[f])&&(u[c[f]]=a[c[f]])}}return u}},5251:function(e,t,n){"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
+ 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})};var i={};return function(){"use strict";o.r(i),o.d(i,{default:function(){return u}});var e=o(5893),t=o(8156),n=o(5002);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 a(e){if(!e)return 0;var t=e/36;return Math.round(10*(4+15*Math.pow(t,.25)+t/5))}o(7262);var c=function(){return c=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},c.apply(this,arguments)},u=function(o){var i=o.className,u=o.style,s=o.in,l=o.collapsedHeight,f=void 0===l?"0px":l,p=o.timeout,d=void 0===p?"auto":p,v=o.unmountOnExit,h=o.children,y=(0,t.useRef)(null),b=(0,t.useRef)(null),m=(0,t.useRef)(null),g="number"==typeof f?"".concat(f,"px"):f,x=function(e){return function(t){e&&e(t)}},j=x((function(e){e.style.height=g})),O=x((function(e){var t=b.current?b.current.clientHeight:0,n=r({style:u,timeout:d},{mode:"enter"}).duration;if("auto"===d){var o=a(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"})),S=x((function(e){var t=b.current?b.current.clientHeight:0;e.style.height="".concat(t,"px")})),E=x((function(e){var t=b.current?b.current.clientHeight:0,n=r({style:u,timeout:d},{mode:"exit"}).duration;if("auto"===d){var o=a(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||s||"0px"!==g||(t+=" paraui-collapse-box-hidden"),t};return(0,e.jsx)(n.Transition,c({in:s,unmountOnExit:v,onEnter:j,onEntered:w,onEntering:O,onExit:S,onExiting:E,timeout:"auto"===d?void 0:d,addEndListener:function(){}},{children:function(t,n){return(0,e.jsx)("div",c({className:_(t),style:c({minHeight:g},u),ref:y},n,{children:(0,e.jsx)("div",c({className:"paraui-collapse-box-wrapper",ref:b},{children:(0,e.jsx)("div",c({className:"paraui-collapse-box-wrapper-inner"},{children:h}))}))}))}}))}}(),i}()}));
@@ -0,0 +1,5 @@
1
+ export declare function getTransitionProps(props: any, options: any): {
2
+ duration: any;
3
+ delay: any;
4
+ };
5
+ export declare function getAutoHeightDuration(height: any): number;