@antv/g-lite 1.0.66 → 1.0.68

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/dist/index.esm.js CHANGED
@@ -12497,7 +12497,9 @@ var RenderingService = /*#__PURE__*/function () {
12497
12497
  if (index === -1) {
12498
12498
  // remove from sorted list
12499
12499
  var _index = sortable.sorted.indexOf(child);
12500
- sortable.sorted.splice(_index, 1);
12500
+ if (_index >= 0) {
12501
+ sortable.sorted.splice(_index, 1);
12502
+ }
12501
12503
  } else {
12502
12504
  if (sortable.sorted.length === 0) {
12503
12505
  sortable.sorted.push(child);
@@ -12927,7 +12929,9 @@ var DefaultSceneGraphService = /*#__PURE__*/function () {
12927
12929
  // parent needs re-sort
12928
12930
  var sortable = parent.sortable;
12929
12931
  if ((sortable === null || sortable === void 0 ? void 0 : (_sortable$sorted = sortable.sorted) === null || _sortable$sorted === void 0 ? void 0 : _sortable$sorted.length) || ((_child$style = child.style) === null || _child$style === void 0 ? void 0 : _child$style.zIndex)) {
12930
- sortable.dirtyChildren.push(child);
12932
+ if (sortable.dirtyChildren.indexOf(child) === -1) {
12933
+ sortable.dirtyChildren.push(child);
12934
+ }
12931
12935
  // if (sortable) {
12932
12936
  // only child has z-Index
12933
12937
  sortable.dirty = true;
@@ -12960,7 +12964,9 @@ var DefaultSceneGraphService = /*#__PURE__*/function () {
12960
12964
  var sortable = child.parentNode.sortable;
12961
12965
  // if (sortable) {
12962
12966
  if ((sortable === null || sortable === void 0 ? void 0 : (_sortable$sorted2 = sortable.sorted) === null || _sortable$sorted2 === void 0 ? void 0 : _sortable$sorted2.length) || ((_child$style2 = child.style) === null || _child$style2 === void 0 ? void 0 : _child$style2.zIndex)) {
12963
- sortable.dirtyChildren.push(child);
12967
+ if (sortable.dirtyChildren.indexOf(child) === -1) {
12968
+ sortable.dirtyChildren.push(child);
12969
+ }
12964
12970
  sortable.dirty = true;
12965
12971
  sortable.dirtyReason = SortReason.REMOVED;
12966
12972
  }
@@ -14030,6 +14036,17 @@ var EventPlugin = /*#__PURE__*/function () {
14030
14036
  }
14031
14037
  _this.setCursor(_this.context.eventService.cursor);
14032
14038
  };
14039
+ this.onClick = function (nativeEvent) {
14040
+ var _this$context$renderi3, _this$context$renderi4;
14041
+ var canvas = (_this$context$renderi3 = _this.context.renderingContext.root) === null || _this$context$renderi3 === void 0 ? void 0 : (_this$context$renderi4 = _this$context$renderi3.ownerDocument) === null || _this$context$renderi4 === void 0 ? void 0 : _this$context$renderi4.defaultView;
14042
+ var normalizedEvents = _this.normalizeToPointerEvent(nativeEvent, canvas);
14043
+ for (var _iterator2 = _createForOfIteratorHelperLoose(normalizedEvents), _step2; !(_step2 = _iterator2()).done;) {
14044
+ var normalizedEvent = _step2.value;
14045
+ var event = _this.bootstrapEvent(_this.rootPointerEvent, normalizedEvent, canvas, nativeEvent);
14046
+ _this.context.eventService.mapEvent(event);
14047
+ }
14048
+ _this.setCursor(_this.context.eventService.cursor);
14049
+ };
14033
14050
  }
14034
14051
  var _proto = EventPlugin.prototype;
14035
14052
  _proto.apply = function apply(context) {
@@ -14059,8 +14076,8 @@ var EventPlugin = /*#__PURE__*/function () {
14059
14076
  nativeEvent.preventDefault();
14060
14077
  }
14061
14078
  }
14062
- for (var _iterator2 = _createForOfIteratorHelperLoose(events), _step2; !(_step2 = _iterator2()).done;) {
14063
- var event = _step2.value;
14079
+ for (var _iterator3 = _createForOfIteratorHelperLoose(events), _step3; !(_step3 = _iterator3()).done;) {
14080
+ var event = _step3.value;
14064
14081
  var federatedEvent = _this2.bootstrapEvent(_this2.rootPointerEvent, event, canvas, nativeEvent);
14065
14082
  _this2.context.eventService.mapEvent(federatedEvent);
14066
14083
  }
@@ -14078,8 +14095,8 @@ var EventPlugin = /*#__PURE__*/function () {
14078
14095
  // @see https://github.com/antvis/G/issues/1235
14079
14096
  }
14080
14097
  var normalizedEvents = _this2.normalizeToPointerEvent(nativeEvent, canvas);
14081
- for (var _iterator3 = _createForOfIteratorHelperLoose(normalizedEvents), _step3; !(_step3 = _iterator3()).done;) {
14082
- var normalizedEvent = _step3.value;
14098
+ for (var _iterator4 = _createForOfIteratorHelperLoose(normalizedEvents), _step4; !(_step4 = _iterator4()).done;) {
14099
+ var normalizedEvent = _step4.value;
14083
14100
  var event = _this2.bootstrapEvent(_this2.rootPointerEvent, normalizedEvent, canvas, nativeEvent);
14084
14101
  event.type += outside;
14085
14102
  _this2.context.eventService.mapEvent(event);
@@ -14089,11 +14106,11 @@ var EventPlugin = /*#__PURE__*/function () {
14089
14106
  renderingService.hooks.pointerMove.tap(EventPlugin.tag, this.onPointerMove);
14090
14107
  renderingService.hooks.pointerOver.tap(EventPlugin.tag, this.onPointerMove);
14091
14108
  renderingService.hooks.pointerOut.tap(EventPlugin.tag, this.onPointerMove);
14092
- renderingService.hooks.click.tap(EventPlugin.tag, this.onPointerMove);
14109
+ renderingService.hooks.click.tap(EventPlugin.tag, this.onClick);
14093
14110
  renderingService.hooks.pointerCancel.tap(EventPlugin.tag, function (nativeEvent) {
14094
14111
  var normalizedEvents = _this2.normalizeToPointerEvent(nativeEvent, canvas);
14095
- for (var _iterator4 = _createForOfIteratorHelperLoose(normalizedEvents), _step4; !(_step4 = _iterator4()).done;) {
14096
- var normalizedEvent = _step4.value;
14112
+ for (var _iterator5 = _createForOfIteratorHelperLoose(normalizedEvents), _step5; !(_step5 = _iterator5()).done;) {
14113
+ var normalizedEvent = _step5.value;
14097
14114
  var event = _this2.bootstrapEvent(_this2.rootPointerEvent, normalizedEvent, canvas, nativeEvent);
14098
14115
  _this2.context.eventService.mapEvent(event);
14099
14116
  }
package/dist/index.js CHANGED
@@ -12489,7 +12489,9 @@ var RenderingService = /*#__PURE__*/function () {
12489
12489
  if (index === -1) {
12490
12490
  // remove from sorted list
12491
12491
  var _index = sortable.sorted.indexOf(child);
12492
- sortable.sorted.splice(_index, 1);
12492
+ if (_index >= 0) {
12493
+ sortable.sorted.splice(_index, 1);
12494
+ }
12493
12495
  } else {
12494
12496
  if (sortable.sorted.length === 0) {
12495
12497
  sortable.sorted.push(child);
@@ -12919,7 +12921,9 @@ var DefaultSceneGraphService = /*#__PURE__*/function () {
12919
12921
  // parent needs re-sort
12920
12922
  var sortable = parent.sortable;
12921
12923
  if ((sortable === null || sortable === void 0 ? void 0 : (_sortable$sorted = sortable.sorted) === null || _sortable$sorted === void 0 ? void 0 : _sortable$sorted.length) || ((_child$style = child.style) === null || _child$style === void 0 ? void 0 : _child$style.zIndex)) {
12922
- sortable.dirtyChildren.push(child);
12924
+ if (sortable.dirtyChildren.indexOf(child) === -1) {
12925
+ sortable.dirtyChildren.push(child);
12926
+ }
12923
12927
  // if (sortable) {
12924
12928
  // only child has z-Index
12925
12929
  sortable.dirty = true;
@@ -12952,7 +12956,9 @@ var DefaultSceneGraphService = /*#__PURE__*/function () {
12952
12956
  var sortable = child.parentNode.sortable;
12953
12957
  // if (sortable) {
12954
12958
  if ((sortable === null || sortable === void 0 ? void 0 : (_sortable$sorted2 = sortable.sorted) === null || _sortable$sorted2 === void 0 ? void 0 : _sortable$sorted2.length) || ((_child$style2 = child.style) === null || _child$style2 === void 0 ? void 0 : _child$style2.zIndex)) {
12955
- sortable.dirtyChildren.push(child);
12959
+ if (sortable.dirtyChildren.indexOf(child) === -1) {
12960
+ sortable.dirtyChildren.push(child);
12961
+ }
12956
12962
  sortable.dirty = true;
12957
12963
  sortable.dirtyReason = exports.SortReason.REMOVED;
12958
12964
  }
@@ -14022,6 +14028,17 @@ var EventPlugin = /*#__PURE__*/function () {
14022
14028
  }
14023
14029
  _this.setCursor(_this.context.eventService.cursor);
14024
14030
  };
14031
+ this.onClick = function (nativeEvent) {
14032
+ var _this$context$renderi3, _this$context$renderi4;
14033
+ var canvas = (_this$context$renderi3 = _this.context.renderingContext.root) === null || _this$context$renderi3 === void 0 ? void 0 : (_this$context$renderi4 = _this$context$renderi3.ownerDocument) === null || _this$context$renderi4 === void 0 ? void 0 : _this$context$renderi4.defaultView;
14034
+ var normalizedEvents = _this.normalizeToPointerEvent(nativeEvent, canvas);
14035
+ for (var _iterator2 = _createForOfIteratorHelperLoose(normalizedEvents), _step2; !(_step2 = _iterator2()).done;) {
14036
+ var normalizedEvent = _step2.value;
14037
+ var event = _this.bootstrapEvent(_this.rootPointerEvent, normalizedEvent, canvas, nativeEvent);
14038
+ _this.context.eventService.mapEvent(event);
14039
+ }
14040
+ _this.setCursor(_this.context.eventService.cursor);
14041
+ };
14025
14042
  }
14026
14043
  var _proto = EventPlugin.prototype;
14027
14044
  _proto.apply = function apply(context) {
@@ -14051,8 +14068,8 @@ var EventPlugin = /*#__PURE__*/function () {
14051
14068
  nativeEvent.preventDefault();
14052
14069
  }
14053
14070
  }
14054
- for (var _iterator2 = _createForOfIteratorHelperLoose(events), _step2; !(_step2 = _iterator2()).done;) {
14055
- var event = _step2.value;
14071
+ for (var _iterator3 = _createForOfIteratorHelperLoose(events), _step3; !(_step3 = _iterator3()).done;) {
14072
+ var event = _step3.value;
14056
14073
  var federatedEvent = _this2.bootstrapEvent(_this2.rootPointerEvent, event, canvas, nativeEvent);
14057
14074
  _this2.context.eventService.mapEvent(federatedEvent);
14058
14075
  }
@@ -14070,8 +14087,8 @@ var EventPlugin = /*#__PURE__*/function () {
14070
14087
  // @see https://github.com/antvis/G/issues/1235
14071
14088
  }
14072
14089
  var normalizedEvents = _this2.normalizeToPointerEvent(nativeEvent, canvas);
14073
- for (var _iterator3 = _createForOfIteratorHelperLoose(normalizedEvents), _step3; !(_step3 = _iterator3()).done;) {
14074
- var normalizedEvent = _step3.value;
14090
+ for (var _iterator4 = _createForOfIteratorHelperLoose(normalizedEvents), _step4; !(_step4 = _iterator4()).done;) {
14091
+ var normalizedEvent = _step4.value;
14075
14092
  var event = _this2.bootstrapEvent(_this2.rootPointerEvent, normalizedEvent, canvas, nativeEvent);
14076
14093
  event.type += outside;
14077
14094
  _this2.context.eventService.mapEvent(event);
@@ -14081,11 +14098,11 @@ var EventPlugin = /*#__PURE__*/function () {
14081
14098
  renderingService.hooks.pointerMove.tap(EventPlugin.tag, this.onPointerMove);
14082
14099
  renderingService.hooks.pointerOver.tap(EventPlugin.tag, this.onPointerMove);
14083
14100
  renderingService.hooks.pointerOut.tap(EventPlugin.tag, this.onPointerMove);
14084
- renderingService.hooks.click.tap(EventPlugin.tag, this.onPointerMove);
14101
+ renderingService.hooks.click.tap(EventPlugin.tag, this.onClick);
14085
14102
  renderingService.hooks.pointerCancel.tap(EventPlugin.tag, function (nativeEvent) {
14086
14103
  var normalizedEvents = _this2.normalizeToPointerEvent(nativeEvent, canvas);
14087
- for (var _iterator4 = _createForOfIteratorHelperLoose(normalizedEvents), _step4; !(_step4 = _iterator4()).done;) {
14088
- var normalizedEvent = _step4.value;
14104
+ for (var _iterator5 = _createForOfIteratorHelperLoose(normalizedEvents), _step5; !(_step5 = _iterator5()).done;) {
14105
+ var normalizedEvent = _step5.value;
14089
14106
  var event = _this2.bootstrapEvent(_this2.rootPointerEvent, normalizedEvent, canvas, nativeEvent);
14090
14107
  _this2.context.eventService.mapEvent(event);
14091
14108
  }
package/dist/index.umd.js CHANGED
@@ -19463,7 +19463,9 @@
19463
19463
  if (index === -1) {
19464
19464
  // remove from sorted list
19465
19465
  var _index = sortable.sorted.indexOf(child);
19466
- sortable.sorted.splice(_index, 1);
19466
+ if (_index >= 0) {
19467
+ sortable.sorted.splice(_index, 1);
19468
+ }
19467
19469
  } else {
19468
19470
  if (sortable.sorted.length === 0) {
19469
19471
  sortable.sorted.push(child);
@@ -19893,7 +19895,9 @@
19893
19895
  // parent needs re-sort
19894
19896
  var sortable = parent.sortable;
19895
19897
  if ((sortable === null || sortable === void 0 ? void 0 : (_sortable$sorted = sortable.sorted) === null || _sortable$sorted === void 0 ? void 0 : _sortable$sorted.length) || ((_child$style = child.style) === null || _child$style === void 0 ? void 0 : _child$style.zIndex)) {
19896
- sortable.dirtyChildren.push(child);
19898
+ if (sortable.dirtyChildren.indexOf(child) === -1) {
19899
+ sortable.dirtyChildren.push(child);
19900
+ }
19897
19901
  // if (sortable) {
19898
19902
  // only child has z-Index
19899
19903
  sortable.dirty = true;
@@ -19926,7 +19930,9 @@
19926
19930
  var sortable = child.parentNode.sortable;
19927
19931
  // if (sortable) {
19928
19932
  if ((sortable === null || sortable === void 0 ? void 0 : (_sortable$sorted2 = sortable.sorted) === null || _sortable$sorted2 === void 0 ? void 0 : _sortable$sorted2.length) || ((_child$style2 = child.style) === null || _child$style2 === void 0 ? void 0 : _child$style2.zIndex)) {
19929
- sortable.dirtyChildren.push(child);
19933
+ if (sortable.dirtyChildren.indexOf(child) === -1) {
19934
+ sortable.dirtyChildren.push(child);
19935
+ }
19930
19936
  sortable.dirty = true;
19931
19937
  sortable.dirtyReason = exports.SortReason.REMOVED;
19932
19938
  }
@@ -20996,6 +21002,17 @@
20996
21002
  }
20997
21003
  _this.setCursor(_this.context.eventService.cursor);
20998
21004
  };
21005
+ this.onClick = function (nativeEvent) {
21006
+ var _this$context$renderi3, _this$context$renderi4;
21007
+ var canvas = (_this$context$renderi3 = _this.context.renderingContext.root) === null || _this$context$renderi3 === void 0 ? void 0 : (_this$context$renderi4 = _this$context$renderi3.ownerDocument) === null || _this$context$renderi4 === void 0 ? void 0 : _this$context$renderi4.defaultView;
21008
+ var normalizedEvents = _this.normalizeToPointerEvent(nativeEvent, canvas);
21009
+ for (var _iterator2 = _createForOfIteratorHelperLoose(normalizedEvents), _step2; !(_step2 = _iterator2()).done;) {
21010
+ var normalizedEvent = _step2.value;
21011
+ var event = _this.bootstrapEvent(_this.rootPointerEvent, normalizedEvent, canvas, nativeEvent);
21012
+ _this.context.eventService.mapEvent(event);
21013
+ }
21014
+ _this.setCursor(_this.context.eventService.cursor);
21015
+ };
20999
21016
  }
21000
21017
  var _proto = EventPlugin.prototype;
21001
21018
  _proto.apply = function apply(context) {
@@ -21025,8 +21042,8 @@
21025
21042
  nativeEvent.preventDefault();
21026
21043
  }
21027
21044
  }
21028
- for (var _iterator2 = _createForOfIteratorHelperLoose(events), _step2; !(_step2 = _iterator2()).done;) {
21029
- var event = _step2.value;
21045
+ for (var _iterator3 = _createForOfIteratorHelperLoose(events), _step3; !(_step3 = _iterator3()).done;) {
21046
+ var event = _step3.value;
21030
21047
  var federatedEvent = _this2.bootstrapEvent(_this2.rootPointerEvent, event, canvas, nativeEvent);
21031
21048
  _this2.context.eventService.mapEvent(federatedEvent);
21032
21049
  }
@@ -21044,8 +21061,8 @@
21044
21061
  // @see https://github.com/antvis/G/issues/1235
21045
21062
  }
21046
21063
  var normalizedEvents = _this2.normalizeToPointerEvent(nativeEvent, canvas);
21047
- for (var _iterator3 = _createForOfIteratorHelperLoose(normalizedEvents), _step3; !(_step3 = _iterator3()).done;) {
21048
- var normalizedEvent = _step3.value;
21064
+ for (var _iterator4 = _createForOfIteratorHelperLoose(normalizedEvents), _step4; !(_step4 = _iterator4()).done;) {
21065
+ var normalizedEvent = _step4.value;
21049
21066
  var event = _this2.bootstrapEvent(_this2.rootPointerEvent, normalizedEvent, canvas, nativeEvent);
21050
21067
  event.type += outside;
21051
21068
  _this2.context.eventService.mapEvent(event);
@@ -21055,11 +21072,11 @@
21055
21072
  renderingService.hooks.pointerMove.tap(EventPlugin.tag, this.onPointerMove);
21056
21073
  renderingService.hooks.pointerOver.tap(EventPlugin.tag, this.onPointerMove);
21057
21074
  renderingService.hooks.pointerOut.tap(EventPlugin.tag, this.onPointerMove);
21058
- renderingService.hooks.click.tap(EventPlugin.tag, this.onPointerMove);
21075
+ renderingService.hooks.click.tap(EventPlugin.tag, this.onClick);
21059
21076
  renderingService.hooks.pointerCancel.tap(EventPlugin.tag, function (nativeEvent) {
21060
21077
  var normalizedEvents = _this2.normalizeToPointerEvent(nativeEvent, canvas);
21061
- for (var _iterator4 = _createForOfIteratorHelperLoose(normalizedEvents), _step4; !(_step4 = _iterator4()).done;) {
21062
- var normalizedEvent = _step4.value;
21078
+ for (var _iterator5 = _createForOfIteratorHelperLoose(normalizedEvents), _step5; !(_step5 = _iterator5()).done;) {
21079
+ var normalizedEvent = _step5.value;
21063
21080
  var event = _this2.bootstrapEvent(_this2.rootPointerEvent, normalizedEvent, canvas, nativeEvent);
21064
21081
  _this2.context.eventService.mapEvent(event);
21065
21082
  }