@visactor/vchart 1.3.1 → 1.3.2-hotfix.1

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/build/index.js CHANGED
@@ -58246,6 +58246,7 @@
58246
58246
  constructor(spec, options) {
58247
58247
  var _a, _b, _c, _d;
58248
58248
  this.id = createID();
58249
+ this._userEvents = [];
58249
58250
  this._autoSize = true;
58250
58251
  this._option = {
58251
58252
  mode: exports.RenderModeEnum['desktop-browser'],
@@ -58446,6 +58447,7 @@
58446
58447
  this._chart.release();
58447
58448
  this._chart = null;
58448
58449
  (_a = this._compiler) === null || _a === void 0 ? void 0 : _a.releaseGrammar();
58450
+ this._userEvents.forEach(e => { var _a; return (_a = this._event) === null || _a === void 0 ? void 0 : _a.on(e.eType, e.query, e.handler); });
58449
58451
  }
58450
58452
  else if (updateResult.reCompile) {
58451
58453
  (_b = this._compiler) === null || _b === void 0 ? void 0 : _b.clear({ chart: this._chart, vChart: this });
@@ -58516,11 +58518,13 @@
58516
58518
  (_b = this._chart) === null || _b === void 0 ? void 0 : _b.release();
58517
58519
  (_c = this._compiler) === null || _c === void 0 ? void 0 : _c.release();
58518
58520
  (_d = this._eventDispatcher) === null || _d === void 0 ? void 0 : _d.release();
58521
+ this._userEvents.length = 0;
58519
58522
  this._unBindResizeEvent();
58520
58523
  this._releaseData();
58521
58524
  this._chart = null;
58522
58525
  this._compiler = null;
58523
58526
  this._spec = null;
58527
+ this._userEvents = null;
58524
58528
  this._event = null;
58525
58529
  this._eventDispatcher = null;
58526
58530
  InstanceManager.unregisterInstance(this);
@@ -58731,11 +58735,31 @@
58731
58735
  }
58732
58736
  on(eType, query, handler) {
58733
58737
  var _a;
58738
+ this._userEvents.push({
58739
+ eType,
58740
+ query: typeof query === 'function' ? null : query,
58741
+ handler: typeof query === 'function' ? query : handler
58742
+ });
58734
58743
  (_a = this._event) === null || _a === void 0 ? void 0 : _a.on(eType, query, handler);
58735
58744
  }
58736
58745
  off(eType, handler) {
58737
58746
  var _a;
58738
- (_a = this._event) === null || _a === void 0 ? void 0 : _a.off(eType, handler);
58747
+ if (handler) {
58748
+ const index = this._userEvents.findIndex(e => e.eType === eType && e.handler === handler);
58749
+ if (index >= 0) {
58750
+ this._userEvents.splice(index, 1);
58751
+ (_a = this._event) === null || _a === void 0 ? void 0 : _a.off(eType, handler);
58752
+ }
58753
+ }
58754
+ else {
58755
+ this._userEvents.forEach(e => {
58756
+ var _a;
58757
+ if (e.eType === eType) {
58758
+ (_a = this._event) === null || _a === void 0 ? void 0 : _a.off(eType, e.handler);
58759
+ }
58760
+ });
58761
+ this._userEvents = this._userEvents.filter(e => e.eType !== eType);
58762
+ }
58739
58763
  }
58740
58764
  updateState(state, filter) {
58741
58765
  if (!this._chart) {
@@ -61873,7 +61897,7 @@
61873
61897
  VChart.useMark([ComponentMark, GroupMark, ImageMark]);
61874
61898
  Factory.registerRegion('region', Region);
61875
61899
  Factory.registerLayout('base', Layout);
61876
- const version = "1.3.1";
61900
+ const version = "1.3.2-hotfix.1";
61877
61901
  Logger.getInstance(LoggerLevel.Error);
61878
61902
 
61879
61903
  const Appear_ClipIn$1 = {