react-apexcharts 1.8.0 → 1.9.0

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/README.md CHANGED
@@ -1,7 +1,6 @@
1
1
  <p align="center"><img src="https://apexcharts.com/media/react-apexcharts.png"></p>
2
2
 
3
3
  <p align="center">
4
- <a href="https://github.com/apexcharts/react-apexcharts/blob/master/LICENSE"><img src="https://img.shields.io/badge/License-MIT-brightgreen.svg" alt="License"></a>
5
4
  <a href="https://travis-ci.com/apexcharts/react-apexcharts"><img src="https://api.travis-ci.com/apexcharts/react-apexcharts.svg?branch=master" alt="build" /></a>
6
5
  <a href="https://www.npmjs.com/package/react-apexcharts"><img src="https://img.shields.io/npm/v/react-apexcharts.svg" alt="ver"></a>
7
6
  </p>
@@ -168,4 +167,5 @@ npm run build
168
167
 
169
168
  ## License
170
169
 
171
- React-ApexCharts is released under MIT license. You are free to use, modify and distribute this software, as long as the copyright header is left intact.
170
+ ApexCharts is offered under a **dual-license model** to support individuals, startups, and commercial products of all sizes.
171
+ Read full license agreements here: [https://apexcharts.com/license](https://apexcharts.com/license)
@@ -0,0 +1 @@
1
+ "use strict";var e=require("react"),r=require("apexcharts"),t=require("prop-types");function n(e,r,t){return(r=function(e){var r=function(e,r){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,r||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==typeof r?r:r+""}(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function i(){return i=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},i.apply(null,arguments)}function o(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function u(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?o(Object(t),!0).forEach((function(r){n(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):o(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}var f=["type","width","height","series","options","chartRef"];function s(e){return e&&"object"===c(e)&&!Array.isArray(e)}function a(e,r){var t=u({},e);return s(e)&&s(r)&&Object.keys(r).forEach((function(n){s(r[n])?t[n]=n in e?a(e[n],r[n]):r[n]:t[n]=r[n]})),t}function l(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new WeakSet;if(e===r)return!0;if("object"!==c(e)||null===e||"object"!==c(r)||null===r)return!1;if(t.has(e)||t.has(r))return!0;t.add(e),t.add(r);var n=Object.keys(e),i=Object.keys(r);if(n.length!==i.length)return!1;for(var o=0,u=n;o<u.length;o++){var f=u[o];if(!i.includes(f)||!l(e[f],r[f],t))return!1}return!0}var p=["type","series","options","width","height","chartRef"];function y(t){var n=t.type,o=void 0===n?"line":n,c=t.width,s=void 0===c?"100%":c,y=t.height,b=void 0===y?"auto":y,h=t.series,v=t.options,d=t.chartRef,O=function(e,r){if(null==e)return{};var t,n,i=function(e,r){if(null==e)return{};var t={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(r.includes(n))continue;t[n]=e[n]}return t}(e,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)t=o[n],r.includes(t)||{}.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}(t,f),g=e.useRef(null),j=e.useRef(null),m=e.useRef(null),w=d||m,P=function(){return a(v,{chart:{type:o,height:b,width:s},series:h})};e.useEffect((function(){return w.current=new r(g.current,P()),w.current.render(),j.current=v,function(){w.current&&"function"==typeof w.current.destroy&&w.current.destroy()}}),[]),e.useEffect((function(){if(w.current&&w.current.w){var e=!l(w.current.w.config.series,h),r=!l(j.current,v)||b!==w.current.opts.chart.height||s!==w.current.opts.chart.width;(e||r)&&(e?r?w.current.updateOptions(P()):w.current.updateSeries(h):w.current.updateOptions(P())),j.current=v}}),[v,h,b,s]);var S,R,E=(S=p,R=u({},O),S.forEach((function(e){delete R[e]})),R);return e.createElement("div",i({ref:g},E))}y.propTypes={type:t.string.isRequired,series:t.array.isRequired,options:t.object.isRequired,width:t.oneOfType([t.string,t.number]),height:t.oneOfType([t.string,t.number]),chartRef:t.shape({current:t.any})},module.exports=y;
@@ -0,0 +1 @@
1
+ import r,{useRef as e,useEffect as t}from"react";import n from"apexcharts";import o from"prop-types";function i(r,e,t){return(e=function(r){var e=function(r,e){if("object"!=typeof r||!r)return r;var t=r[Symbol.toPrimitive];if(void 0!==t){var n=t.call(r,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(r)}(r,"string");return"symbol"==typeof e?e:e+""}(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function u(){return u=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},u.apply(null,arguments)}function c(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.push.apply(t,n)}return t}function f(r){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?c(Object(t),!0).forEach((function(e){i(r,e,t[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):c(Object(t)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))}))}return r}function a(r){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},a(r)}var s=["type","width","height","series","options","chartRef"];function p(r){return r&&"object"===a(r)&&!Array.isArray(r)}function l(r,e){var t=f({},r);return p(r)&&p(e)&&Object.keys(e).forEach((function(n){p(e[n])?t[n]=n in r?l(r[n],e[n]):e[n]:t[n]=e[n]})),t}function y(r,e){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new WeakSet;if(r===e)return!0;if("object"!==a(r)||null===r||"object"!==a(e)||null===e)return!1;if(t.has(r)||t.has(e))return!0;t.add(r),t.add(e);var n=Object.keys(r),o=Object.keys(e);if(n.length!==o.length)return!1;for(var i=0,u=n;i<u.length;i++){var c=u[i];if(!o.includes(c)||!y(r[c],e[c],t))return!1}return!0}var b=["type","series","options","width","height","chartRef"];function h(o){var i=o.type,c=void 0===i?"line":i,a=o.width,p=void 0===a?"100%":a,h=o.height,d=void 0===h?"auto":h,v=o.series,O=o.options,g=o.chartRef,m=function(r,e){if(null==r)return{};var t,n,o=function(r,e){if(null==r)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(e.includes(n))continue;t[n]=r[n]}return t}(r,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);for(n=0;n<i.length;n++)t=i[n],e.includes(t)||{}.propertyIsEnumerable.call(r,t)&&(o[t]=r[t])}return o}(o,s),j=e(null),w=e(null),P=e(null),S=g||P,E=function(){return l(O,{chart:{type:c,height:d,width:p},series:v})};t((function(){return S.current=new n(j.current,E()),S.current.render(),w.current=O,function(){S.current&&"function"==typeof S.current.destroy&&S.current.destroy()}}),[]),t((function(){if(S.current&&S.current.w){var r=!y(S.current.w.config.series,v),e=!y(w.current,O)||d!==S.current.opts.chart.height||p!==S.current.opts.chart.width;(r||e)&&(r?e?S.current.updateOptions(E()):S.current.updateSeries(v):S.current.updateOptions(E())),w.current=O}}),[O,v,d,p]);var R,k,D=(R=b,k=f({},m),R.forEach((function(r){delete k[r]})),k);return r.createElement("div",u({ref:j},D))}h.propTypes={type:o.string.isRequired,series:o.array.isRequired,options:o.object.isRequired,width:o.oneOfType([o.string,o.number]),height:o.oneOfType([o.string,o.number]),chartRef:o.shape({current:o.any})};export{h as default};
@@ -1 +1 @@
1
- var ReactApexChart=function(e,r,t){"use strict";function n(e,r,t){return(r=function(e){var r=function(e,r){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,r||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==typeof r?r:r+""}(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function o(){return o=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},o.apply(null,arguments)}function i(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function u(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?i(Object(t),!0).forEach((function(r){n(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):i(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}var f=["type","width","height","series","options","chartRef"];function s(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new WeakSet;if(e===r)return!0;if("object"!==c(e)||null===e||"object"!==c(r)||null===r)return!1;if(t.has(e)||t.has(r))return!0;t.add(e),t.add(r);var n=Object.keys(e),o=Object.keys(r);if(n.length!==o.length)return!1;for(var i=0,u=n;i<u.length;i++){var f=u[i];if(!o.includes(f)||!s(e[f],r[f],t))return!1}return!0}function a(t){var i=t.type,p=void 0===i?"line":i,l=t.width,y=void 0===l?"100%":l,b=t.height,h=void 0===b?"auto":b,v=t.series,O=t.options,d=t.chartRef,g=function(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(r.includes(n))continue;t[n]=e[n]}return t}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)t=i[n],r.includes(t)||{}.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(t,f),j=e.useRef(null),m=d||e.useRef(null),w=e.useRef();e.useEffect((function(){w.current=O;var e=j.current;return m.current=new r(e,E()),m.current.render(),function(){m.current&&"function"==typeof m.current.destroy&&m.current.destroy()}}),[]),e.useEffect((function(){var e=!s(m.current.w.config.series,v),r=!s(w.current,O)||h!==m.current.opts.chart.height||y!==m.current.opts.chart.width;(e||r)&&(e?r?m.current.updateOptions(E()):m.current.updateSeries(v):m.current.updateOptions(E())),w.current=O}),[O,v,h,y]);var P,S,R,E=function(){return T(O,{chart:{type:p,height:h,width:y},series:v})},k=function(e){return e&&"object"===c(e)&&!Array.isArray(e)},T=function(e,r){var t=u({},e);return k(e)&&k(r)&&Object.keys(r).forEach((function(o){k(r[o])&&o in e?t[o]=T(e[o],r[o]):Object.assign(t,n({},o,r[o]))})),t},A=(P=g,S=Object.keys(a.propTypes),R=u({},P),S.forEach((function(e){delete R[e]})),R);return e.createElement("div",o({ref:j},A))}return a.propTypes={type:t.string.isRequired,series:t.array.isRequired,options:t.object.isRequired,width:t.oneOfType([t.string,t.number]),height:t.oneOfType([t.string,t.number]),chartRef:t.shape({current:t.any})},a}(React,ApexCharts,PropTypes);
1
+ var ReactApexChart=function(e,r,t){"use strict";function n(e,r,t){return(r=function(e){var r=function(e,r){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,r||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==typeof r?r:r+""}(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function i(){return i=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},i.apply(null,arguments)}function o(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function u(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?o(Object(t),!0).forEach((function(r){n(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):o(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}var f=["type","width","height","series","options","chartRef"];function a(e){return e&&"object"===c(e)&&!Array.isArray(e)}function s(e,r){var t=u({},e);return a(e)&&a(r)&&Object.keys(r).forEach((function(n){a(r[n])?t[n]=n in e?s(e[n],r[n]):r[n]:t[n]=r[n]})),t}function l(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new WeakSet;if(e===r)return!0;if("object"!==c(e)||null===e||"object"!==c(r)||null===r)return!1;if(t.has(e)||t.has(r))return!0;t.add(e),t.add(r);var n=Object.keys(e),i=Object.keys(r);if(n.length!==i.length)return!1;for(var o=0,u=n;o<u.length;o++){var f=u[o];if(!i.includes(f)||!l(e[f],r[f],t))return!1}return!0}var p=["type","series","options","width","height","chartRef"];function y(t){var n=t.type,o=void 0===n?"line":n,c=t.width,a=void 0===c?"100%":c,y=t.height,b=void 0===y?"auto":y,h=t.series,v=t.options,d=t.chartRef,O=function(e,r){if(null==e)return{};var t,n,i=function(e,r){if(null==e)return{};var t={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(r.includes(n))continue;t[n]=e[n]}return t}(e,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)t=o[n],r.includes(t)||{}.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}(t,f),g=e.useRef(null),j=e.useRef(null),m=e.useRef(null),w=d||m,P=function(){return s(v,{chart:{type:o,height:b,width:a},series:h})};e.useEffect((function(){return w.current=new r(g.current,P()),w.current.render(),j.current=v,function(){w.current&&"function"==typeof w.current.destroy&&w.current.destroy()}}),[]),e.useEffect((function(){if(w.current&&w.current.w){var e=!l(w.current.w.config.series,h),r=!l(j.current,v)||b!==w.current.opts.chart.height||a!==w.current.opts.chart.width;(e||r)&&(e?r?w.current.updateOptions(P()):w.current.updateSeries(h):w.current.updateOptions(P())),j.current=v}}),[v,h,b,a]);var S,R,E=(S=p,R=u({},O),S.forEach((function(e){delete R[e]})),R);return e.createElement("div",i({ref:g},E))}return y.propTypes={type:t.string.isRequired,series:t.array.isRequired,options:t.object.isRequired,width:t.oneOfType([t.string,t.number]),height:t.oneOfType([t.string,t.number]),chartRef:t.shape({current:t.any})},y}(React,ApexCharts,PropTypes);
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=Charts;var _react=_interopRequireWildcard(require("react")),_apexcharts=_interopRequireDefault(require("apexcharts")),_propTypes=_interopRequireDefault(require("prop-types")),_excluded=["type","width","height","series","options","chartRef"];function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _getRequireWildcardCache(e){var t,r;return"function"!=typeof WeakMap?null:(t=new WeakMap,r=new WeakMap,(_getRequireWildcardCache=function(e){return e?r:t})(e))}function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=_typeof(e)&&"function"!=typeof e)return{default:e};t=_getRequireWildcardCache(t);if(t&&t.has(e))return t.get(e);var r,n,o={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e)"default"!==r&&{}.hasOwnProperty.call(e,r)&&((n=i?Object.getOwnPropertyDescriptor(e,r):null)&&(n.get||n.set)?Object.defineProperty(o,r,n):o[r]=e[r]);return o.default=e,t&&t.set(e,o),o}function _extends(){return(_extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r,n=arguments[t];for(r in n)!{}.hasOwnProperty.call(n,r)||(e[r]=n[r])}return e}).apply(null,arguments)}function _objectWithoutProperties(e,t){if(null==e)return{};var r,n=_objectWithoutPropertiesLoose(e,t);if(Object.getOwnPropertySymbols)for(var o=Object.getOwnPropertySymbols(e),i=0;i<o.length;i++)r=o[i],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(n[r]=e[r]);return n}function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var r,n={};for(r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ownKeys(t,e){var r,n=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)),n}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(r),!0).forEach(function(e){_defineProperty(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);r=r.call(e,t||"default");if("object"!=_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}function omit(e,t){var r=_objectSpread({},e);return t.forEach(function(e){delete r[e]}),r}function deepEqual(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:new WeakSet;if(e!==t){if("object"!==_typeof(e)||null===e||"object"!==_typeof(t)||null===t)return!1;if(!r.has(e)&&!r.has(t)){r.add(e),r.add(t);var n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(var i=0,u=n;i<u.length;i++){var c=u[i];if(!o.includes(c)||!deepEqual(e[c],t[c],r))return!1}}}return!0}function Charts(e){function o(e){return e&&"object"===_typeof(e)&&!Array.isArray(e)}var t=e.type,r=void 0===t?"line":t,t=e.width,n=void 0===t?"100%":t,t=e.height,i=void 0===t?"auto":t,u=e.series,c=e.options,t=e.chartRef,e=_objectWithoutProperties(e,_excluded),p=(0,_react.useRef)(null),a=t||(0,_react.useRef)(null),f=(0,_react.useRef)(),s=((0,_react.useEffect)(function(){f.current=c;var e=p.current;return a.current=new _apexcharts.default(e,s()),a.current.render(),function(){a.current&&"function"==typeof a.current.destroy&&a.current.destroy()}},[]),(0,_react.useEffect)(function(){var e=!deepEqual(a.current.w.config.series,u),t=!deepEqual(f.current,c)||i!==a.current.opts.chart.height||n!==a.current.opts.chart.width;(e||t)&&(!e||t?a.current.updateOptions(s()):a.current.updateSeries(u)),f.current=c},[c,u,i,n]),function(){return l(c,{chart:{type:r,height:i,width:n},series:u})}),l=function(t,r){var n=_objectSpread({},t);return o(t)&&o(r)&&Object.keys(r).forEach(function(e){o(r[e])&&e in t?n[e]=l(t[e],r[e]):Object.assign(n,_defineProperty({},e,r[e]))}),n},t=omit(e,Object.keys(Charts.propTypes));return _react.default.createElement("div",_extends({ref:p},t))}Charts.propTypes={type:_propTypes.default.string.isRequired,series:_propTypes.default.array.isRequired,options:_propTypes.default.object.isRequired,width:_propTypes.default.oneOfType([_propTypes.default.string,_propTypes.default.number]),height:_propTypes.default.oneOfType([_propTypes.default.string,_propTypes.default.number]),chartRef:_propTypes.default.shape({current:_propTypes.default.any})};
1
+ "use strict";var e=require("react"),r=require("apexcharts"),t=require("prop-types");function n(e,r,t){return(r=function(e){var r=function(e,r){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,r||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==typeof r?r:r+""}(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function i(){return i=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},i.apply(null,arguments)}function o(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function u(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?o(Object(t),!0).forEach((function(r){n(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):o(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}var f=["type","width","height","series","options","chartRef"];function s(e){return e&&"object"===c(e)&&!Array.isArray(e)}function a(e,r){var t=u({},e);return s(e)&&s(r)&&Object.keys(r).forEach((function(n){s(r[n])?t[n]=n in e?a(e[n],r[n]):r[n]:t[n]=r[n]})),t}function l(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new WeakSet;if(e===r)return!0;if("object"!==c(e)||null===e||"object"!==c(r)||null===r)return!1;if(t.has(e)||t.has(r))return!0;t.add(e),t.add(r);var n=Object.keys(e),i=Object.keys(r);if(n.length!==i.length)return!1;for(var o=0,u=n;o<u.length;o++){var f=u[o];if(!i.includes(f)||!l(e[f],r[f],t))return!1}return!0}var p=["type","series","options","width","height","chartRef"];function y(t){var n=t.type,o=void 0===n?"line":n,c=t.width,s=void 0===c?"100%":c,y=t.height,b=void 0===y?"auto":y,h=t.series,v=t.options,d=t.chartRef,O=function(e,r){if(null==e)return{};var t,n,i=function(e,r){if(null==e)return{};var t={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(r.includes(n))continue;t[n]=e[n]}return t}(e,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)t=o[n],r.includes(t)||{}.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}(t,f),g=e.useRef(null),j=e.useRef(null),m=e.useRef(null),w=d||m,P=function(){return a(v,{chart:{type:o,height:b,width:s},series:h})};e.useEffect((function(){return w.current=new r(g.current,P()),w.current.render(),j.current=v,function(){w.current&&"function"==typeof w.current.destroy&&w.current.destroy()}}),[]),e.useEffect((function(){if(w.current&&w.current.w){var e=!l(w.current.w.config.series,h),r=!l(j.current,v)||b!==w.current.opts.chart.height||s!==w.current.opts.chart.width;(e||r)&&(e?r?w.current.updateOptions(P()):w.current.updateSeries(h):w.current.updateOptions(P())),j.current=v}}),[v,h,b,s]);var S,R,E=(S=p,R=u({},O),S.forEach((function(e){delete R[e]})),R);return e.createElement("div",i({ref:g},E))}y.propTypes={type:t.string.isRequired,series:t.array.isRequired,options:t.object.isRequired,width:t.oneOfType([t.string,t.number]),height:t.oneOfType([t.string,t.number]),chartRef:t.shape({current:t.any})},module.exports=y;
package/package.json CHANGED
@@ -1,12 +1,24 @@
1
1
  {
2
2
  "name": "react-apexcharts",
3
- "version": "1.8.0",
3
+ "version": "1.9.0",
4
4
  "description": "React.js wrapper for ApexCharts",
5
- "main": "dist/react-apexcharts.min.js",
5
+ "main": "dist/react-apexcharts.cjs.js",
6
+ "module": "dist/react-apexcharts.esm.js",
7
+ "browser": "dist/react-apexcharts.iife.min.js",
6
8
  "types": "types/react-apexcharts.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/react-apexcharts.esm.js",
12
+ "require": "./dist/react-apexcharts.cjs.js",
13
+ "types": "./types/react-apexcharts.d.ts"
14
+ }
15
+ },
16
+ "files": [
17
+ "dist",
18
+ "types"
19
+ ],
7
20
  "scripts": {
8
- "build": "concurrently \"rollup -c rollup.config.js\" \"gulp\"",
9
- "dev-build": "concurrently \"rollup -c rollup.config.js\" \"gulp devBuild\"",
21
+ "build": "rollup -c rollup.config.js",
10
22
  "test": "jest"
11
23
  },
12
24
  "keywords": [
@@ -30,7 +42,7 @@
30
42
  },
31
43
  "peerDependencies": {
32
44
  "apexcharts": ">=4.0.0",
33
- "react": ">=0.13"
45
+ "react": ">=16.8.0"
34
46
  },
35
47
  "devDependencies": {
36
48
  "@babel/core": "^7.25.8",
@@ -41,19 +53,17 @@
41
53
  "@rollup/plugin-node-resolve": "^15.3.0",
42
54
  "@rollup/plugin-terser": "^0.4.4",
43
55
  "@types/react": "^18.3.11",
44
- "concurrently": "^9.0.1",
45
56
  "eslint": "^9.12.0",
46
57
  "eslint-plugin-react": "^7.37.1",
47
- "gulp": "^5.0.0",
48
- "gulp-babel": "^8.0.0",
49
- "gulp-concat": "^2.6.1",
50
- "gulp-uglify": "^3.0.2",
51
58
  "jest": "^29.7.0",
52
59
  "jest-environment-jsdom": "^29.7.0",
53
60
  "react": "^18.3.1",
54
61
  "react-dom": "^18.3.1",
55
62
  "react-test-renderer": "^18.3.1",
56
- "rollup": "4.24.0",
57
- "rollup-plugin-postcss": "^4.0.2"
63
+ "rollup": "4.24.0"
64
+ },
65
+ "repository": {
66
+ "type": "git",
67
+ "url": "https://github.com/apexcharts/react-apexcharts.git"
58
68
  }
59
69
  }
@@ -1,20 +0,0 @@
1
- name: Mark stale issues and pull requests
2
- on:
3
- schedule:
4
- - cron: '21 14 * * *'
5
- jobs:
6
- stale:
7
- runs-on: ubuntu-latest
8
- permissions:
9
- issues: write
10
- pull-requests: write
11
- steps:
12
- - uses: actions/stale@v9
13
- with:
14
- repo-token: ${{ secrets.GITHUB_TOKEN }}
15
- stale-issue-message: 'This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.'
16
- stale-pr-message: 'This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.'
17
- stale-issue-label: 'no-issue-activity'
18
- stale-pr-label: 'no-pr-activity'
19
- exempt-issue-labels: 'bug,high-priority'
20
- operations-per-run: 100