@ant-design/charts-util
Advanced tools
Comparing version 0.0.1-alpha.5 to 0.0.1-alpha.6
/*! For license information please see utils.min.js.LICENSE.txt */ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react-dom"),require("react")):"function"==typeof define&&define.amd?define(["react-dom","react"],e):"object"==typeof exports?exports.ChartsUtils=e(require("react-dom"),require("react")):t.ChartsUtils=e(t.ReactDOM,t.React)}(self,((t,e)=>(()=>{"use strict";var r={787:t=>{t.exports=e},156:e=>{e.exports=t}},n={};function o(t){var e=n[t];if(void 0!==e)return e.exports;var i=n[t]={exports:{}};return r[t](i,i.exports,o),i.exports}o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var r in e)o.o(e,r)&&!o.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};return(()=>{function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(){e=function(){return n};var r,n={},o=Object.prototype,i=o.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",l=c.asyncIterator||"@@asyncIterator",f=c.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(r){s=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var o=e&&e.prototype instanceof b?e:b,i=Object.create(o.prototype),c=new R(n||[]);return a(i,"_invoke",{value:k(t,r,c)}),i}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}n.wrap=p;var d="suspendedStart",y="suspendedYield",v="executing",m="completed",g={};function b(){}function x(){}function w(){}var _={};s(_,u,(function(){return this}));var O=Object.getPrototypeOf,E=O&&O(O(C([])));E&&E!==o&&i.call(E,u)&&(_=E);var j=w.prototype=b.prototype=Object.create(_);function P(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function L(e,r){function n(o,a,c,u){var l=h(e[o],e,a);if("throw"!==l.type){var f=l.arg,s=f.value;return s&&"object"==t(s)&&i.call(s,"__await")?r.resolve(s.__await).then((function(t){n("next",t,c,u)}),(function(t){n("throw",t,c,u)})):r.resolve(s).then((function(t){f.value=t,c(f)}),(function(t){return n("throw",t,c,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(t,e){function i(){return new r((function(r,o){n(t,e,r,o)}))}return o=o?o.then(i,i):i()}})}function k(t,e,n){var o=d;return function(i,a){if(o===v)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:r,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=S(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var l=h(t,e,n);if("normal"===l.type){if(o=n.done?m:y,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function S(t,e){var n=e.method,o=t.iterator[n];if(o===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=r,S(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=h(o,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,g;var a=i.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,g):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,g)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function R(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function C(e){if(e||""===e){var n=e[u];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function t(){for(;++o<e.length;)if(i.call(e,o))return t.value=e[o],t.done=!1,t;return t.value=r,t.done=!0,t};return a.next=a}}throw new TypeError(t(e)+" is not iterable")}return x.prototype=w,a(j,"constructor",{value:w,configurable:!0}),a(w,"constructor",{value:x,configurable:!0}),x.displayName=s(w,f,"GeneratorFunction"),n.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===x||"GeneratorFunction"===(e.displayName||e.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,s(t,f,"GeneratorFunction")),t.prototype=Object.create(j),t},n.awrap=function(t){return{__await:t}},P(L.prototype),s(L.prototype,l,(function(){return this})),n.AsyncIterator=L,n.async=function(t,e,r,o,i){void 0===i&&(i=Promise);var a=new L(p(t,e,r,o),i);return n.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},P(j),s(j,f,"Generator"),s(j,u,(function(){return this})),s(j,"toString",(function(){return"[object Generator]"})),n.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},n.values=C,R.prototype={constructor:R,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(T),!t)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,o){return c.type="throw",c.arg=t,e.next=n,o&&(e.method="next",e.arg=r),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:C(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),g}},n}function r(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function n(t){return function(){var e=this,n=arguments;return new Promise((function(o,i){var a=t.apply(e,n);function c(t){r(a,o,i,c,u,"next",t)}function u(t){r(a,o,i,c,u,"throw",t)}c(void 0)}))}}function a(e){var r=function(e,r){if("object"!=t(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!=t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==t(r)?r:String(r)}function c(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}o.r(i),o.d(i,{ChartLoading:()=>L,ErrorBoundary:()=>C,createNode:()=>_,render:()=>y,unmount:()=>b,uuid:()=>D});var u,l=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?c(Object(r),!0).forEach((function(e){var n,o,i;n=t,o=e,i=r[e],(o=a(o))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},o(156)),f=l.version,s=l.render,p=l.unmountComponentAtNode;try{Number((f||"").split(".")[0])>=18&&(u=l.createRoot)}catch(t){}function h(e){var r=l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;r&&"object"===t(r)&&(r.usingClientEntryPoint=e)}var d="__rc_react_root__";function y(t,e){u?function(t,e){h(!0);var r=e[d]||u(e);h(!1),r.render(t),e[d]=r}(t,e):function(t,e){s(t,e)}(t,e)}function v(t){return m.apply(this,arguments)}function m(){return(m=n(e().mark((function t(r){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Promise.resolve().then((function(){var t;null===(t=r[d])||void 0===t||t.unmount(),delete r[d]})));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function g(t){p(t)}function b(t){return x.apply(this,arguments)}function x(){return(x=n(e().mark((function t(r){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0===u){t.next=2;break}return t.abrupt("return",v(r));case 2:g(r);case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var w=new Map;w.set("tooltip",document.createElement("div"));var _=function(t){var e=null;if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])e=w.get("tooltip");else if(e=document.createElement("div"),null!=t&&t.key){var r=w.get(t.key);r?e=r:w.set(t.key,e)}return y(t,e),e},O=o(787),E=o.n(O),j="/Users/liufu/publicWorkspace/ant-design-charts/packages/util/src/rc/chart-loading.tsx",P=void 0,L=function(t){var e=t.loadingTemplate,r=t.theme,n=void 0===r?"light":r,o=E().useRef(null);return E().useEffect((function(){var t,r,n;!e&&o.current&&(t=o.current.attachShadow({mode:"open"}),r=document.createElement("div"),(n=document.createElement("style")).innerHTML=".loading {\n display: inline-block;\n position: relative;\n width: 80px;\n height: 80px;\n }\n .loading div {\n position: absolute;\n top: 33px;\n width: 13px;\n height: 13px;\n border-radius: 50%;\n background: #ccc;\n animation-timing-function: cubic-bezier(0, 1, 1, 0);\n }\n .loading div:nth-child(1) {\n left: 8px;\n animation: loading1 0.6s infinite;\n }\n .loading div:nth-child(2) {\n left: 8px;\n animation: loading2 0.6s infinite;\n }\n .loading div:nth-child(3) {\n left: 32px;\n animation: loading2 0.6s infinite;\n }\n .loading div:nth-child(4) {\n left: 56px;\n animation: loading3 0.6s infinite;\n }\n @keyframes loading1 {\n 0% {\n transform: scale(0);\n }\n 100% {\n transform: scale(1);\n }\n }\n @keyframes loading3 {\n 0% {\n transform: scale(1);\n }\n 100% {\n transform: scale(0);\n }\n }\n @keyframes loading2 {\n 0% {\n transform: translate(0, 0);\n }\n 100% {\n transform: translate(24px, 0);\n }\n }\n ",r.classList.add("loading"),r.innerHTML="<div></div><div></div><div></div><div></div>",t.appendChild(n),t.appendChild(r))}),[]),E().createElement("div",{className:"charts-loading-container",style:{position:"absolute",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",left:0,top:0,zIndex:99,backgroundColor:"dark"===n?"rgb(20, 20, 20)":"rgb(255, 255, 255)"},__self:P,__source:{fileName:j,lineNumber:96,columnNumber:5}},e||E().createElement("div",{ref:o,__self:P,__source:{fileName:j,lineNumber:92,columnNumber:12}}))};function k(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,a(n.key),n)}}function S(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function N(t,e){return N=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},N(t,e)}function T(t){return T=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},T(t)}var R="/Users/liufu/publicWorkspace/ant-design-charts/packages/util/src/rc/error-boundary.tsx",C=function(e){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&N(t,e)}(u,e);var r,n,o,i,a,c=(i=u,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var e,r=T(i);if(a){var n=T(this).constructor;e=Reflect.construct(r,arguments,n)}else e=r.apply(this,arguments);return function(e,r){if(r&&("object"===t(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return S(e)}(this,e)});function u(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u);for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return(t=c.call.apply(c,[this].concat(r))).state={hasError:!1},t.renderError=function(e){var r=t.props.errorTemplate;return"function"==typeof r?r(e):r||E().createElement("h5",{__self:S(t),__source:{fileName:R,lineNumber:31,columnNumber:48}},"组件出错了,请核查后重试: ",e.message)},t}return r=u,o=[{key:"getDerivedStateFromError",value:function(t){return{hasError:!0,error:t}}},{key:"getDerivedStateFromProps",value:function(t,e){return e.children!==t.children?{children:t.children,hasError:!1,error:void 0}:null}}],(n=[{key:"render",value:function(){return this.state.hasError?this.renderError(this.state.error):E().createElement(O.Fragment,{__self:this,__source:{fileName:R,lineNumber:39,columnNumber:12}},this.props.children)}}])&&k(r.prototype,n),o&&k(r,o),Object.defineProperty(r,"prototype",{writable:!1}),u}(E().Component),D=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}))}})(),i})())); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react-dom"),require("react")):"function"==typeof define&&define.amd?define(["react-dom","react"],e):"object"==typeof exports?exports.ChartsUtils=e(require("react-dom"),require("react")):t.ChartsUtils=e(t.ReactDOM,t.React)}(self,((t,e)=>(()=>{"use strict";var r={442:t=>{t.exports=e},3:e=>{e.exports=t}},n={};function o(t){var e=n[t];if(void 0!==e)return e.exports;var i=n[t]={exports:{}};return r[t](i,i.exports,o),i.exports}o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var r in e)o.o(e,r)&&!o.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function c(){c=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},u=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",f=i.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),c=new C(n||[]);return o(a,"_invoke",{value:k(t,r,c)}),a}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=p;var d="suspendedStart",y="suspendedYield",v="executing",m="completed",g={};function b(){}function x(){}function w(){}var _={};s(_,u,(function(){return this}));var O=Object.getPrototypeOf,E=O&&O(O(R([])));E&&E!==r&&n.call(E,u)&&(_=E);var j=w.prototype=b.prototype=Object.create(_);function L(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function P(t,e){function r(o,i,c,u){var l=h(t[o],t,i);if("throw"!==l.type){var f=l.arg,s=f.value;return s&&"object"==a(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,c,u)}),(function(t){r("throw",t,c,u)})):e.resolve(s).then((function(t){f.value=t,c(f)}),(function(t){return r("throw",t,c,u)}))}u(l.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function k(e,r,n){var o=d;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=S(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var l=h(e,r,n);if("normal"===l.type){if(o=n.done?m:y,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function S(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,S(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=h(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function R(e){if(e||""===e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(a(e)+" is not iterable")}return x.prototype=w,o(j,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:x,configurable:!0}),x.displayName=s(w,f,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===x||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,s(t,f,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},L(P.prototype),s(P.prototype,l,(function(){return this})),e.AsyncIterator=P,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new P(p(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},L(j),s(j,f,"Generator"),s(j,u,(function(){return this})),s(j,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=R,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:R(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function u(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function l(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){u(i,n,o,a,c,"next",t)}function c(t){u(i,n,o,a,c,"throw",t)}a(void 0)}))}}function f(t){var e=function(t,e){if("object"!=a(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==a(e)?e:e+""}function s(t,e,r){return(e=f(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function p(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}o.r(i),o.d(i,{ChartLoading:()=>C,ErrorBoundary:()=>M,createNode:()=>P,render:()=>x,unmount:()=>E,uuid:()=>U});var h,d=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?p(Object(r),!0).forEach((function(e){s(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},o(3)),y=d.version,v=d.render,m=d.unmountComponentAtNode;try{Number((y||"").split(".")[0])>=18&&(h=d.createRoot)}catch(t){}function g(t){var e=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;e&&"object"===a(e)&&(e.usingClientEntryPoint=t)}var b="__rc_react_root__";function x(t,e){h?function(t,e){g(!0);var r=e[b]||h(e);g(!1),r.render(t),e[b]=r}(t,e):function(t,e){v(t,e)}(t,e)}function w(t){return _.apply(this,arguments)}function _(){return(_=l(c().mark((function t(e){return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Promise.resolve().then((function(){var t;null===(t=e[b])||void 0===t||t.unmount(),delete e[b]})));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function O(t){m(t)}function E(t){return j.apply(this,arguments)}function j(){return(j=l(c().mark((function t(e){return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0===h){t.next=2;break}return t.abrupt("return",w(e));case 2:O(e);case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var L=new Map;"undefined"!=typeof document&&L.set("tooltip",document.createElement("div"));var P=function(t){var e=null;if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])e=L.get("tooltip");else if(e=document.createElement("div"),null!=t&&t.key){var r=L.get(t.key);r?e=r:L.set(t.key,e)}return x(t,e),e},k=o(442),S=o.n(k),N="/Users/liufu/publicWorkspace/ant-design-charts/packages/util/src/rc/chart-loading.tsx",T=void 0,C=function(t){var e=t.loadingTemplate,r=t.theme,n=void 0===r?"light":r,o=S().useRef(null);return S().useEffect((function(){!e&&o.current&&function(t){if("undefined"==typeof document)return"loading";var e=t.attachShadow({mode:"open"}),r=document.createElement("div"),n=document.createElement("style");n.innerHTML=".loading {\n display: inline-block;\n position: relative;\n width: 80px;\n height: 80px;\n }\n .loading div {\n position: absolute;\n top: 33px;\n width: 13px;\n height: 13px;\n border-radius: 50%;\n background: #ccc;\n animation-timing-function: cubic-bezier(0, 1, 1, 0);\n }\n .loading div:nth-child(1) {\n left: 8px;\n animation: loading1 0.6s infinite;\n }\n .loading div:nth-child(2) {\n left: 8px;\n animation: loading2 0.6s infinite;\n }\n .loading div:nth-child(3) {\n left: 32px;\n animation: loading2 0.6s infinite;\n }\n .loading div:nth-child(4) {\n left: 56px;\n animation: loading3 0.6s infinite;\n }\n @keyframes loading1 {\n 0% {\n transform: scale(0);\n }\n 100% {\n transform: scale(1);\n }\n }\n @keyframes loading3 {\n 0% {\n transform: scale(1);\n }\n 100% {\n transform: scale(0);\n }\n }\n @keyframes loading2 {\n 0% {\n transform: translate(0, 0);\n }\n 100% {\n transform: translate(24px, 0);\n }\n }\n ",r.classList.add("loading"),r.innerHTML="<div></div><div></div><div></div><div></div>",e.appendChild(n),e.appendChild(r)}(o.current)}),[]),S().createElement("div",{className:"charts-loading-container",style:{position:"absolute",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",left:0,top:0,zIndex:99,backgroundColor:"dark"===n?"rgb(20, 20, 20)":"rgb(255, 255, 255)"},__self:T,__source:{fileName:N,lineNumber:99,columnNumber:5}},e||S().createElement("div",{ref:o,__self:T,__source:{fileName:N,lineNumber:95,columnNumber:12}}))};function R(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,f(n.key),n)}}function D(t){return D=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},D(t)}function F(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(F=function(){return!!t})()}function G(t,e){return G=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},G(t,e)}var I="/Users/liufu/publicWorkspace/ant-design-charts/packages/util/src/rc/error-boundary.tsx",M=function(t){function e(){var t,r,n,o;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var i=arguments.length,c=new Array(i),u=0;u<i;u++)c[u]=arguments[u];return r=this,n=e,o=[].concat(c),n=D(n),(t=function(t,e){if(e&&("object"==a(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(r,F()?Reflect.construct(n,o||[],D(r).constructor):n.apply(r,o))).state={hasError:!1},t.renderError=function(e){var r=t.props.errorTemplate;return"function"==typeof r?r(e):r||S().createElement("h5",{__self:t,__source:{fileName:I,lineNumber:31,columnNumber:48}},"组件出错了,请核查后重试: ",e.message)},t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&G(t,e)}(e,t),r=e,o=[{key:"getDerivedStateFromError",value:function(t){return{hasError:!0,error:t}}},{key:"getDerivedStateFromProps",value:function(t,e){return e.children!==t.children?{children:t.children,hasError:!1,error:void 0}:null}}],(n=[{key:"render",value:function(){return this.state.hasError?this.renderError(this.state.error):S().createElement(k.Fragment,{__self:this,__source:{fileName:I,lineNumber:39,columnNumber:12}},this.props.children)}}])&&R(r.prototype,n),o&&R(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(S().Component),U=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}))};return i})())); | ||
//# sourceMappingURL=utils.min.js.map |
import React from 'react'; | ||
var shadowLoading = function (ele) { | ||
if (typeof document === 'undefined') { | ||
return 'loading'; | ||
} | ||
var shadowRoot = ele.attachShadow({ mode: 'open' }); | ||
@@ -4,0 +7,0 @@ var shadowDiv = document.createElement('div'); |
import { render } from '../react/render'; | ||
var mountMapping = new Map(); | ||
mountMapping.set('tooltip', document.createElement('div')); | ||
if (typeof document !== 'undefined') { | ||
mountMapping.set('tooltip', document.createElement('div')); | ||
} | ||
export var createNode = function (children, isTooltip) { | ||
@@ -5,0 +7,0 @@ if (isTooltip === void 0) { isTooltip = false; } |
@@ -9,2 +9,5 @@ "use strict"; | ||
var shadowLoading = function (ele) { | ||
if (typeof document === 'undefined') { | ||
return 'loading'; | ||
} | ||
var shadowRoot = ele.attachShadow({ mode: 'open' }); | ||
@@ -11,0 +14,0 @@ var shadowDiv = document.createElement('div'); |
@@ -6,3 +6,5 @@ "use strict"; | ||
var mountMapping = new Map(); | ||
mountMapping.set('tooltip', document.createElement('div')); | ||
if (typeof document !== 'undefined') { | ||
mountMapping.set('tooltip', document.createElement('div')); | ||
} | ||
var createNode = function (children, isTooltip) { | ||
@@ -9,0 +11,0 @@ if (isTooltip === void 0) { isTooltip = false; } |
{ | ||
"name": "@ant-design/charts-util", | ||
"version": "0.0.1-alpha.5", | ||
"version": "0.0.1-alpha.6", | ||
"description": "charts utils", | ||
@@ -5,0 +5,0 @@ "bugs": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
810
99852