@ant-design/charts-util
Advanced tools
Comparing version 0.0.1-alpha.0 to 0.0.1-alpha.1
/*! For license information please see utils.min.js.LICENSE.txt */ | ||
"use strict";!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],e):"object"==typeof exports?exports.ChartsUtils=e(require("react"),require("react-dom")):t.ChartsUtils=e(t.React,t.ReactDOM)}(self,((t,e)=>(self.webpackChunkChartsUtils=self.webpackChunkChartsUtils||[]).push([[493],{203:(t,e,r)=>{function n(t){return n="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},n(t)}function o(){o=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof d?e:d,a=Object.create(o.prototype),c=new P(n||[]);return i(a,"_invoke",{value:O(t,r,c)}),a}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var h={};function d(){}function y(){}function v(){}var m={};f(m,c,(function(){return this}));var g=Object.getPrototypeOf,b=g&&g(g(k([])));b&&b!==e&&r.call(b,c)&&(m=b);var x=v.prototype=d.prototype=Object.create(m);function w(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function o(i,a,c,u){var l=p(t[i],t,a);if("throw"!==l.type){var f=l.arg,s=f.value;return s&&"object"==n(s)&&r.call(s,"__await")?e.resolve(s.__await).then((function(t){o("next",t,c,u)}),(function(t){o("throw",t,c,u)})):e.resolve(s).then((function(t){f.value=t,c(f)}),(function(t){return o("throw",t,c,u)}))}u(l.arg)}var a;i(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return a=a?a.then(n,n):n()}})}function O(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=E(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=p(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function E(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var o=p(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,h;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function j(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 L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function k(t){if(t||""===t){var e=t[c];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function e(){for(;++o<t.length;)if(r.call(t,o))return e.value=t[o],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return y.prototype=v,i(x,"constructor",{value:v,configurable:!0}),i(v,"constructor",{value:y,configurable:!0}),y.displayName=f(v,l,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,f(t,l,"GeneratorFunction")),t.prototype=Object.create(x),t},t.awrap=function(t){return{__await:t}},w(_.prototype),f(_.prototype,u,(function(){return this})),t.AsyncIterator=_,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new _(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},w(x),f(x,l,"Generator"),f(x,c,(function(){return this})),f(x,"toString",(function(){return"[object Generator]"})),t.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}},t.values=k,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(L),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},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(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.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,h):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),h},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),L(r),h}},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;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:k(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}function i(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 a(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function c(t){i(a,n,o,c,u,"next",t)}function u(t){i(a,n,o,c,u,"throw",t)}c(void 0)}))}}function c(t){var e=function(t,e){if("object"!==n(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,"string");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===n(e)?e:String(e)}function u(t,e,r){return(e=c(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function l(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}r.r(e),r.d(e,{ChartLoading:()=>k,ErrorBoundary:()=>A,createNode:()=>O,deepAssign:()=>D,render:()=>m,unmount:()=>w,uuid:()=>F});var f,s=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?l(Object(r),!0).forEach((function(e){u(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},r(156)),p=s.version,h=s.render,d=s.unmountComponentAtNode;try{Number((p||"").split(".")[0])>=18&&(f=s.createRoot)}catch(t){}function y(t){var e=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;e&&"object"===n(e)&&(e.usingClientEntryPoint=t)}var v="__rc_react_root__";function m(t,e){f?function(t,e){y(!0);var r=e[v]||f(e);y(!1),r.render(t),e[v]=r}(t,e):function(t,e){h(t,e)}(t,e)}function g(t){return b.apply(this,arguments)}function b(){return(b=a(o().mark((function t(e){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Promise.resolve().then((function(){var t;null===(t=e[v])||void 0===t||t.unmount(),delete e[v]})));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function x(t){d(t)}function w(t){return _.apply(this,arguments)}function _(){return(_=a(o().mark((function t(e){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0===f){t.next=2;break}return t.abrupt("return",g(e));case 2:x(e);case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var O=function(t,e){var r=document.createElement("div");return e&&Object.keys(e).forEach((function(t){r.setAttribute(t,e[t])})),m(t,r),r},E=r(787),j=r.n(E),L="/Users/liufu/publicWorkspace/ant-design-charts/packages/util/src/rc/chart-loading.tsx",P=void 0,k=function(t){var e=t.loadingTemplate,r=t.theme,n=void 0===r?"light":r,o=j().useRef(null);return j().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))}),[]),j().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:L,lineNumber:96,columnNumber:5}},e||j().createElement("div",{ref:o,__self:P,__source:{fileName:L,lineNumber:92,columnNumber:12}}))};function N(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,c(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 T(t,e){return T=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},T(t,e)}function C(t){return C=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},C(t)}var R="/Users/liufu/publicWorkspace/ant-design-charts/packages/util/src/rc/error-boundary.tsx",A=function(t){!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&&T(t,e)}(u,t);var e,r,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 t,e=C(i);if(a){var r=C(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return S(t)}(this,t)});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||j().createElement("h5",{__self:S(t),__source:{fileName:R,lineNumber:31,columnNumber:48}},"组件出错了,请核查后重试: ",e.message)},t}return e=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}}],(r=[{key:"render",value:function(){return this.state.hasError?this.renderError(this.state.error):j().createElement(E.Fragment,{__self:this,__source:{fileName:R,lineNumber:39,columnNumber:12}},this.props.children)}}])&&N(e.prototype,r),o&&N(e,o),Object.defineProperty(e,"prototype",{writable:!1}),u}(j().Component),D=function t(e){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];if(!o.length)return e;var a,c=o.shift();for(var u in c)Object.hasOwnProperty.call(c,u)&&(null===(a=c[u])||"object"!==n(a)||function(t){return Array.isArray(t)}(a)?e[u]=c[u]:(e[u]&&"object"===n(e[u])||(e[u]={}),t(e[u],c[u])));return t.apply(void 0,[e].concat(o))},F=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)}))}},787:e=>{e.exports=t},156:t=>{t.exports=e}},t=>(203,t(t.s=203))]))); | ||
!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:S(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 S(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=k(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 k(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,k(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)||null===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:()=>_,deepAssign:()=>D,render:()=>y,unmount:()=>b,uuid:()=>A});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,_=function(t){return w.has(t)||w.set(t,document.createElement("div")),y(t,w.get(t)),w.get(t)},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 S(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 k(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 k(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:k(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)}}])&&S(r.prototype,n),o&&S(r,o),Object.defineProperty(r,"prototype",{writable:!1}),u}(E().Component),D=function e(r){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];if(!o.length)return r;var a,c=o.shift();for(var u in c)Object.hasOwnProperty.call(c,u)&&(null===(a=c[u])||"object"!==t(a)||function(t){return Array.isArray(t)}(a)?r[u]=c[u]:(r[u]&&"object"===t(r[u])||(r[u]={}),e(r[u],c[u])));return e.apply(void 0,[r].concat(o))},A=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})())); | ||
//# sourceMappingURL=utils.min.js.map |
import React from 'react'; | ||
export declare const createNode: (children: React.ReactElement, extra?: object) => HTMLDivElement; | ||
export declare const createNode: (children: React.ReactElement) => any; |
import { render } from '../react/render'; | ||
export var createNode = function (children, extra) { | ||
var mountPoint = document.createElement('div'); | ||
if (extra) { | ||
Object.keys(extra).forEach(function (key) { | ||
mountPoint.setAttribute(key, extra[key]); | ||
}); | ||
var mountMapping = new Map(); | ||
export var createNode = function (children) { | ||
if (!mountMapping.has(children)) { | ||
mountMapping.set(children, document.createElement('div')); | ||
} | ||
render(children, mountPoint); | ||
return mountPoint; | ||
render(children, mountMapping.get(children)); | ||
return mountMapping.get(children); | ||
}; |
import React from 'react'; | ||
export declare const createNode: (children: React.ReactElement, extra?: object) => HTMLDivElement; | ||
export declare const createNode: (children: React.ReactElement) => any; |
@@ -5,12 +5,10 @@ "use strict"; | ||
var render_1 = require("../react/render"); | ||
var createNode = function (children, extra) { | ||
var mountPoint = document.createElement('div'); | ||
if (extra) { | ||
Object.keys(extra).forEach(function (key) { | ||
mountPoint.setAttribute(key, extra[key]); | ||
}); | ||
var mountMapping = new Map(); | ||
var createNode = function (children) { | ||
if (!mountMapping.has(children)) { | ||
mountMapping.set(children, document.createElement('div')); | ||
} | ||
(0, render_1.render)(children, mountPoint); | ||
return mountPoint; | ||
(0, render_1.render)(children, mountMapping.get(children)); | ||
return mountMapping.get(children); | ||
}; | ||
exports.createNode = createNode; |
{ | ||
"name": "@ant-design/charts-util", | ||
"version": "0.0.1-alpha.0", | ||
"version": "0.0.1-alpha.1", | ||
"description": "charts utils", | ||
@@ -5,0 +5,0 @@ "bugs": { |
# charts-utils | ||
Ant Design Charts Utils Library | ||
Ant Design Charts Utils Library |
Sorry, the diff of this file is not supported yet
4
104987
41
872