@visactor/vtable 1.10.5-alpha.0 → 1.10.6-alpha.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.
Files changed (231) hide show
  1. package/cjs/ListTable.d.ts +4 -3
  2. package/cjs/ListTable.js +13 -8
  3. package/cjs/ListTable.js.map +1 -1
  4. package/cjs/PivotChart.d.ts +1 -1
  5. package/cjs/PivotChart.js +5 -3
  6. package/cjs/PivotChart.js.map +1 -1
  7. package/cjs/PivotTable.d.ts +2 -2
  8. package/cjs/PivotTable.js +7 -7
  9. package/cjs/PivotTable.js.map +1 -1
  10. package/cjs/core/BaseTable.d.ts +2 -2
  11. package/cjs/core/BaseTable.js +4 -3
  12. package/cjs/core/BaseTable.js.map +1 -1
  13. package/cjs/core/TABLE_EVENT_TYPE.d.ts +2 -0
  14. package/cjs/core/TABLE_EVENT_TYPE.js +2 -0
  15. package/cjs/core/TABLE_EVENT_TYPE.js.map +1 -1
  16. package/cjs/core/animation.js +3 -2
  17. package/cjs/core/animation.js.map +1 -1
  18. package/cjs/event/event.js +2 -1
  19. package/cjs/event/event.js.map +1 -1
  20. package/cjs/event/listener/container-dom.js +24 -11
  21. package/cjs/event/listener/container-dom.js.map +1 -1
  22. package/cjs/event/listener/table-group.js +12 -2
  23. package/cjs/event/listener/table-group.js.map +1 -1
  24. package/cjs/icons.js +18 -0
  25. package/cjs/icons.js.map +1 -1
  26. package/cjs/index.d.ts +4 -1
  27. package/cjs/index.js +3 -2
  28. package/cjs/index.js.map +1 -1
  29. package/cjs/layout/pivot-header-layout.d.ts +1 -0
  30. package/cjs/layout/pivot-header-layout.js +5 -2
  31. package/cjs/layout/pivot-header-layout.js.map +1 -1
  32. package/cjs/layout/simple-header-layout.d.ts +1 -0
  33. package/cjs/layout/simple-header-layout.js +5 -2
  34. package/cjs/layout/simple-header-layout.js.map +1 -1
  35. package/cjs/plugins/carousel-animation.d.ts +29 -0
  36. package/cjs/plugins/carousel-animation.js +60 -0
  37. package/cjs/plugins/carousel-animation.js.map +1 -0
  38. package/cjs/plugins/chartModules.js +1 -1
  39. package/cjs/plugins/custom-cell-style.js +22 -15
  40. package/cjs/plugins/custom-cell-style.js.map +1 -1
  41. package/cjs/plugins/header-highlight.d.ts +21 -0
  42. package/cjs/plugins/header-highlight.js +106 -0
  43. package/cjs/plugins/header-highlight.js.map +1 -0
  44. package/cjs/plugins/invert-highlight.d.ts +19 -0
  45. package/cjs/plugins/invert-highlight.js +72 -0
  46. package/cjs/plugins/invert-highlight.js.map +1 -0
  47. package/cjs/scenegraph/component/cell-mover.d.ts +6 -1
  48. package/cjs/scenegraph/component/cell-mover.js +7 -2
  49. package/cjs/scenegraph/component/cell-mover.js.map +1 -1
  50. package/cjs/scenegraph/component/custom.d.ts +2 -1
  51. package/cjs/scenegraph/component/custom.js +13 -7
  52. package/cjs/scenegraph/component/custom.js.map +1 -1
  53. package/cjs/scenegraph/component/table-component.d.ts +6 -1
  54. package/cjs/scenegraph/component/table-component.js +1 -1
  55. package/cjs/scenegraph/component/table-component.js.map +1 -1
  56. package/cjs/scenegraph/graphic/chart.js +6 -4
  57. package/cjs/scenegraph/graphic/chart.js.map +1 -1
  58. package/cjs/scenegraph/graphic/contributions/draw-interceptor.js +4 -2
  59. package/cjs/scenegraph/graphic/contributions/draw-interceptor.js.map +1 -1
  60. package/cjs/scenegraph/graphic/contributions/image-contribution-render.d.ts +18 -0
  61. package/cjs/scenegraph/graphic/contributions/image-contribution-render.js +30 -1
  62. package/cjs/scenegraph/graphic/contributions/image-contribution-render.js.map +1 -1
  63. package/cjs/scenegraph/graphic/contributions/index.js +4 -0
  64. package/cjs/scenegraph/graphic/contributions/index.js.map +1 -1
  65. package/cjs/scenegraph/graphic/group.js +2 -1
  66. package/cjs/scenegraph/graphic/group.js.map +1 -1
  67. package/cjs/scenegraph/graphic/icon.d.ts +18 -1
  68. package/cjs/scenegraph/graphic/icon.js +43 -2
  69. package/cjs/scenegraph/graphic/icon.js.map +1 -1
  70. package/cjs/scenegraph/group-creater/cell-helper.js +5 -4
  71. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  72. package/cjs/scenegraph/layout/compute-row-height.js +7 -7
  73. package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
  74. package/cjs/scenegraph/layout/frozen.js +2 -4
  75. package/cjs/scenegraph/layout/frozen.js.map +1 -1
  76. package/cjs/scenegraph/layout/update-height.js +2 -2
  77. package/cjs/scenegraph/layout/update-height.js.map +1 -1
  78. package/cjs/scenegraph/refresh-node/update-chart.js +6 -4
  79. package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
  80. package/cjs/scenegraph/scenegraph.d.ts +2 -1
  81. package/cjs/scenegraph/scenegraph.js +37 -7
  82. package/cjs/scenegraph/scenegraph.js.map +1 -1
  83. package/cjs/scenegraph/utils/text-icon-layout.d.ts +1 -1
  84. package/cjs/scenegraph/utils/text-icon-layout.js +14 -12
  85. package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
  86. package/cjs/state/cell-move/index.d.ts +2 -2
  87. package/cjs/state/cell-move/index.js +26 -6
  88. package/cjs/state/cell-move/index.js.map +1 -1
  89. package/cjs/state/select/is-cell-select-highlight.js +26 -4
  90. package/cjs/state/select/is-cell-select-highlight.js.map +1 -1
  91. package/cjs/state/select/update-position.d.ts +1 -1
  92. package/cjs/state/select/update-position.js +2 -2
  93. package/cjs/state/select/update-position.js.map +1 -1
  94. package/cjs/state/state.d.ts +3 -2
  95. package/cjs/state/state.js +13 -18
  96. package/cjs/state/state.js.map +1 -1
  97. package/cjs/tools/cell-range.d.ts +2 -0
  98. package/cjs/tools/cell-range.js +10 -0
  99. package/cjs/tools/cell-range.js.map +1 -0
  100. package/cjs/tools/helper.js +1 -1
  101. package/cjs/tools/helper.js.map +1 -1
  102. package/cjs/tools/icons.js +1 -1
  103. package/cjs/tools/icons.js.map +1 -1
  104. package/cjs/ts-types/base-table.d.ts +7 -2
  105. package/cjs/ts-types/base-table.js.map +1 -1
  106. package/cjs/ts-types/events.d.ts +22 -0
  107. package/cjs/ts-types/events.js.map +1 -1
  108. package/cjs/ts-types/icon.d.ts +3 -1
  109. package/cjs/ts-types/icon.js +2 -1
  110. package/cjs/ts-types/icon.js.map +1 -1
  111. package/cjs/ts-types/table-engine.d.ts +2 -1
  112. package/cjs/ts-types/table-engine.js +2 -1
  113. package/cjs/ts-types/table-engine.js.map +1 -1
  114. package/cjs/vrender.js.map +1 -1
  115. package/dist/vtable.js +1852 -303
  116. package/dist/vtable.min.js +2 -2
  117. package/es/ListTable.d.ts +4 -3
  118. package/es/ListTable.js +12 -8
  119. package/es/ListTable.js.map +1 -1
  120. package/es/PivotChart.d.ts +1 -1
  121. package/es/PivotChart.js +5 -3
  122. package/es/PivotChart.js.map +1 -1
  123. package/es/PivotTable.d.ts +2 -2
  124. package/es/PivotTable.js +7 -7
  125. package/es/PivotTable.js.map +1 -1
  126. package/es/core/BaseTable.d.ts +2 -2
  127. package/es/core/BaseTable.js +4 -3
  128. package/es/core/BaseTable.js.map +1 -1
  129. package/es/core/TABLE_EVENT_TYPE.d.ts +2 -0
  130. package/es/core/TABLE_EVENT_TYPE.js +2 -0
  131. package/es/core/TABLE_EVENT_TYPE.js.map +1 -1
  132. package/es/core/animation.js +3 -2
  133. package/es/core/animation.js.map +1 -1
  134. package/es/event/event.js +2 -1
  135. package/es/event/event.js.map +1 -1
  136. package/es/event/listener/container-dom.js +24 -11
  137. package/es/event/listener/container-dom.js.map +1 -1
  138. package/es/event/listener/table-group.js +12 -2
  139. package/es/event/listener/table-group.js.map +1 -1
  140. package/es/icons.js +18 -0
  141. package/es/icons.js.map +1 -1
  142. package/es/index.d.ts +4 -1
  143. package/es/index.js +7 -1
  144. package/es/index.js.map +1 -1
  145. package/es/layout/pivot-header-layout.d.ts +1 -0
  146. package/es/layout/pivot-header-layout.js +5 -2
  147. package/es/layout/pivot-header-layout.js.map +1 -1
  148. package/es/layout/simple-header-layout.d.ts +1 -0
  149. package/es/layout/simple-header-layout.js +5 -2
  150. package/es/layout/simple-header-layout.js.map +1 -1
  151. package/es/plugins/carousel-animation.d.ts +29 -0
  152. package/es/plugins/carousel-animation.js +52 -0
  153. package/es/plugins/carousel-animation.js.map +1 -0
  154. package/es/plugins/chartModules.js +1 -1
  155. package/es/plugins/custom-cell-style.js +22 -15
  156. package/es/plugins/custom-cell-style.js.map +1 -1
  157. package/es/plugins/header-highlight.d.ts +21 -0
  158. package/es/plugins/header-highlight.js +98 -0
  159. package/es/plugins/header-highlight.js.map +1 -0
  160. package/es/plugins/invert-highlight.d.ts +19 -0
  161. package/es/plugins/invert-highlight.js +69 -0
  162. package/es/plugins/invert-highlight.js.map +1 -0
  163. package/es/scenegraph/component/cell-mover.d.ts +6 -1
  164. package/es/scenegraph/component/cell-mover.js +7 -2
  165. package/es/scenegraph/component/cell-mover.js.map +1 -1
  166. package/es/scenegraph/component/custom.d.ts +2 -1
  167. package/es/scenegraph/component/custom.js +13 -7
  168. package/es/scenegraph/component/custom.js.map +1 -1
  169. package/es/scenegraph/component/table-component.d.ts +6 -1
  170. package/es/scenegraph/component/table-component.js +1 -1
  171. package/es/scenegraph/component/table-component.js.map +1 -1
  172. package/es/scenegraph/graphic/chart.js +6 -4
  173. package/es/scenegraph/graphic/chart.js.map +1 -1
  174. package/es/scenegraph/graphic/contributions/draw-interceptor.js +4 -2
  175. package/es/scenegraph/graphic/contributions/draw-interceptor.js.map +1 -1
  176. package/es/scenegraph/graphic/contributions/image-contribution-render.d.ts +18 -0
  177. package/es/scenegraph/graphic/contributions/image-contribution-render.js +29 -0
  178. package/es/scenegraph/graphic/contributions/image-contribution-render.js.map +1 -1
  179. package/es/scenegraph/graphic/contributions/index.js +4 -2
  180. package/es/scenegraph/graphic/contributions/index.js.map +1 -1
  181. package/es/scenegraph/graphic/group.js +2 -1
  182. package/es/scenegraph/graphic/group.js.map +1 -1
  183. package/es/scenegraph/graphic/icon.d.ts +18 -1
  184. package/es/scenegraph/graphic/icon.js +45 -2
  185. package/es/scenegraph/graphic/icon.js.map +1 -1
  186. package/es/scenegraph/group-creater/cell-helper.js +6 -3
  187. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  188. package/es/scenegraph/layout/compute-row-height.js +7 -7
  189. package/es/scenegraph/layout/compute-row-height.js.map +1 -1
  190. package/es/scenegraph/layout/frozen.js +2 -3
  191. package/es/scenegraph/layout/frozen.js.map +1 -1
  192. package/es/scenegraph/layout/update-height.js +2 -2
  193. package/es/scenegraph/layout/update-height.js.map +1 -1
  194. package/es/scenegraph/refresh-node/update-chart.js +6 -4
  195. package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
  196. package/es/scenegraph/scenegraph.d.ts +2 -1
  197. package/es/scenegraph/scenegraph.js +18 -5
  198. package/es/scenegraph/scenegraph.js.map +1 -1
  199. package/es/scenegraph/utils/text-icon-layout.d.ts +1 -1
  200. package/es/scenegraph/utils/text-icon-layout.js +14 -12
  201. package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
  202. package/es/state/cell-move/index.d.ts +2 -2
  203. package/es/state/cell-move/index.js +27 -5
  204. package/es/state/cell-move/index.js.map +1 -1
  205. package/es/state/select/is-cell-select-highlight.js +24 -3
  206. package/es/state/select/is-cell-select-highlight.js.map +1 -1
  207. package/es/state/select/update-position.d.ts +1 -1
  208. package/es/state/select/update-position.js +2 -2
  209. package/es/state/select/update-position.js.map +1 -1
  210. package/es/state/state.d.ts +3 -2
  211. package/es/state/state.js +13 -18
  212. package/es/state/state.js.map +1 -1
  213. package/es/tools/cell-range.d.ts +2 -0
  214. package/es/tools/cell-range.js +4 -0
  215. package/es/tools/cell-range.js.map +1 -0
  216. package/es/tools/helper.js +1 -1
  217. package/es/tools/helper.js.map +1 -1
  218. package/es/tools/icons.js +1 -1
  219. package/es/tools/icons.js.map +1 -1
  220. package/es/ts-types/base-table.d.ts +7 -2
  221. package/es/ts-types/base-table.js.map +1 -1
  222. package/es/ts-types/events.d.ts +22 -0
  223. package/es/ts-types/events.js.map +1 -1
  224. package/es/ts-types/icon.d.ts +3 -1
  225. package/es/ts-types/icon.js +2 -1
  226. package/es/ts-types/icon.js.map +1 -1
  227. package/es/ts-types/table-engine.d.ts +2 -1
  228. package/es/ts-types/table-engine.js +2 -1
  229. package/es/ts-types/table-engine.js.map +1 -1
  230. package/es/vrender.js.map +1 -1
  231. package/package.json +9 -8
package/dist/vtable.js CHANGED
@@ -3050,11 +3050,12 @@
3050
3050
  for (let i = 0, len = paths.length; i < len; i++) if (currPath = paths[i], coordsStr = currPath.slice(1), commandChar = currPath[0], currCommandData = [commandChar], coordsStrArr = coordsStr.match(rePathCommand), null !== coordsStrArr) {
3051
3051
  for (let i = 0, len = coordsStrArr.length; i < len; i++) coordStr = coordsStrArr[i], coordNumber = parseFloat(coordStr), Number.isNaN(coordNumber) || currCommandData.push(coordNumber);
3052
3052
  if (standardCommandLen = commandLengths[commandChar], currCommandData.length - 1 > standardCommandLen) {
3053
- let subCommand;
3053
+ let subCommand,
3054
+ bestCommandChar = commandChar;
3054
3055
  for (let i = 1, len = currCommandData.length; i < len; i += standardCommandLen) {
3055
- subCommand = [commandChar];
3056
+ subCommand = [bestCommandChar];
3056
3057
  for (let j = i, subLen = i + standardCommandLen; j < subLen; j++) subCommand.push(currCommandData[j]);
3057
- result.push(subCommand);
3058
+ result.push(subCommand), "m" === bestCommandChar ? bestCommandChar = "l" : "M" === bestCommandChar && (bestCommandChar = "L");
3058
3059
  }
3059
3060
  } else result.push(currCommandData);
3060
3061
  } else result.push(currCommandData);
@@ -4265,6 +4266,7 @@
4265
4266
  zIndex: 0,
4266
4267
  layout: null,
4267
4268
  boundsPadding: 0,
4269
+ fillStrokeOrder: 0,
4268
4270
  renderStyle: "default",
4269
4271
  pickMode: "accurate",
4270
4272
  customPickShape: null,
@@ -4335,6 +4337,7 @@
4335
4337
  });
4336
4338
  const DefaultPathAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
4337
4339
  path: new CustomPath2D(),
4340
+ fillStrokeOrder: 1,
4338
4341
  customPath: () => {
4339
4342
  Logger.getInstance().warn("空函数");
4340
4343
  }
@@ -4647,6 +4650,14 @@
4647
4650
  return data;
4648
4651
  }
4649
4652
  _clipTextEnd(text, options, width, leftIdx, rightIdx) {
4653
+ if (leftIdx === rightIdx) {
4654
+ Logger.getInstance().warn(`【_clipTextEnd】不应该走到这里${text}, ${leftIdx}, ${rightIdx}`);
4655
+ const subText = text.substring(0, rightIdx + 1);
4656
+ return {
4657
+ str: subText,
4658
+ width: this.measureTextWidth(subText, options)
4659
+ };
4660
+ }
4650
4661
  const middleIdx = Math.floor((leftIdx + rightIdx) / 2),
4651
4662
  subText = text.substring(0, middleIdx + 1),
4652
4663
  strWidth = this.measureTextWidth(subText, options);
@@ -4680,7 +4691,7 @@
4680
4691
  }
4681
4692
  _clipTextStart(text, options, width, leftIdx, rightIdx) {
4682
4693
  const middleIdx = Math.ceil((leftIdx + rightIdx) / 2),
4683
- subText = text.substring(middleIdx - 1, text.length - 1),
4694
+ subText = text.substring(middleIdx - 1, text.length),
4684
4695
  strWidth = this.measureTextWidth(subText, options);
4685
4696
  let length;
4686
4697
  if (strWidth > width) {
@@ -4688,18 +4699,18 @@
4688
4699
  str: "",
4689
4700
  width: 0
4690
4701
  };
4691
- const str = text.substring(middleIdx, text.length - 1);
4702
+ const str = text.substring(middleIdx, text.length);
4692
4703
  return length = this.measureTextWidth(str, options), length <= width ? {
4693
4704
  str: str,
4694
4705
  width: length
4695
- } : this._clipTextStart(text, options, width, middleIdx, text.length - 1);
4706
+ } : this._clipTextStart(text, options, width, middleIdx, text.length);
4696
4707
  }
4697
4708
  if (strWidth < width) {
4698
4709
  if (middleIdx <= 0) return {
4699
4710
  str: text,
4700
4711
  width: this.measureTextWidth(text, options)
4701
4712
  };
4702
- const str = text.substring(middleIdx - 2, text.length - 1);
4713
+ const str = text.substring(middleIdx - 2, text.length);
4703
4714
  return length = this.measureTextWidth(str, options), length >= width ? {
4704
4715
  str: subText,
4705
4716
  width: strWidth
@@ -5008,7 +5019,7 @@
5008
5019
  }
5009
5020
  hasSubView() {
5010
5021
  const viewBox = this._handler.getViewBox();
5011
- return !(0 === viewBox.x1 && 0 === viewBox.y1 && this.width === viewBox.width() && this.height === viewBox.height());
5022
+ return !(0 === viewBox.x1 && 0 === viewBox.y1 && isNumberClose(this.width, viewBox.width()) && isNumberClose(this.height, viewBox.height()));
5012
5023
  }
5013
5024
  isVisible(bbox) {
5014
5025
  return this._handler.isVisible(bbox);
@@ -5932,7 +5943,7 @@
5932
5943
  timeStamp: now
5933
5944
  });
5934
5945
  const clickHistory = trackingData.clicksByButton[from.button];
5935
- clickHistory.target === clickEvent.target && now - clickHistory.timeStamp < (null !== (_a = this._config.clickInterval) && void 0 !== _a ? _a : 200) ? ++clickHistory.clickCount : clickHistory.clickCount = 1, clickHistory.target = clickEvent.target, clickHistory.timeStamp = now, clickEvent.detail = clickHistory.clickCount, isMouseLike(clickEvent.pointerType) ? (this.dispatchEvent(clickEvent, "click"), 2 === clickHistory.clickCount && this.dispatchEvent(clickEvent, "dblclick")) : "touch" === clickEvent.pointerType && (this.dispatchEvent(clickEvent, "tap"), 2 === clickHistory.clickCount && this.dispatchEvent(clickEvent, "dbltap")), this.dispatchEvent(clickEvent, "pointertap"), this.freeEvent(clickEvent);
5946
+ clickHistory.target === clickEvent.target && now - clickHistory.timeStamp < (null !== (_a = this._config.clickInterval) && void 0 !== _a ? _a : 200) ? ++clickHistory.clickCount : clickHistory.clickCount = 1, clickHistory.target = clickEvent.target, clickHistory.timeStamp = now, clickEvent.detail = clickHistory.clickCount, isMouseLike(clickEvent.pointerType) ? (this.dispatchEvent(clickEvent, "click"), 2 === clickHistory.clickCount && this.dispatchEvent(clickEvent, "dblclick")) : "touch" === clickEvent.pointerType && this._config.supportsTouchEvents && (this.dispatchEvent(clickEvent, "tap"), 2 === clickHistory.clickCount && this.dispatchEvent(clickEvent, "dbltap")), this.dispatchEvent(clickEvent, "pointertap"), this.freeEvent(clickEvent);
5936
5947
  }
5937
5948
  this.freeEvent(e);
5938
5949
  }, this.onPointerUpOutside = (from, target) => {
@@ -6149,7 +6160,8 @@
6149
6160
  supportsPointerEvents = global.supportsPointerEvents
6150
6161
  } = params;
6151
6162
  this.manager = new EventManager$1(rootNode, {
6152
- clickInterval: clickInterval
6163
+ clickInterval: clickInterval,
6164
+ supportsTouchEvents: supportsTouchEvents
6153
6165
  }), this.globalObj = global, this.supportsPointerEvents = supportsPointerEvents, this.supportsTouchEvents = supportsTouchEvents, this.supportsMouseEvents = global.supportsMouseEvents, this.applyStyles = global.applyStyles, this.autoPreventDefault = autoPreventDefault, this.eventsAdded = !1, this.rootPointerEvent = new FederatedPointerEvent(), this.rootWheelEvent = new FederatedWheelEvent(), this.cursorStyles = {
6154
6166
  default: "inherit",
6155
6167
  pointer: "pointer"
@@ -7241,7 +7253,7 @@
7241
7253
  }
7242
7254
  static GetFile(url, type) {
7243
7255
  let data = ResourceLoader.cache.get(url);
7244
- return data ? "init" === data.loadState || "fail" === data.loadState ? Promise.reject() : "loading" === data.loadState ? data.dataPromise.then(data => data.data) : Promise.resolve(data.data) : (data = {
7256
+ return data ? "fail" === data.loadState ? Promise.reject() : "init" === data.loadState || "loading" === data.loadState ? data.dataPromise.then(data => data.data) : Promise.resolve(data.data) : (data = {
7245
7257
  type: type,
7246
7258
  loadState: "init"
7247
7259
  }, ResourceLoader.cache.set(url, data), "arrayBuffer" === type ? data.dataPromise = application.global.loadArrayBuffer(url) : "blob" === type ? data.dataPromise = application.global.loadBlob(url) : "json" === type && (data.dataPromise = application.global.loadJson(url)), data.dataPromise.then(data => data.data));
@@ -9499,7 +9511,7 @@
9499
9511
  }
9500
9512
  }
9501
9513
 
9502
- const parse$3 = function () {
9514
+ const parse$4 = function () {
9503
9515
  const tokens = {
9504
9516
  linearGradient: /^(linear\-gradient)/i,
9505
9517
  radialGradient: /^(radial\-gradient)/i,
@@ -9652,7 +9664,7 @@
9652
9664
  }
9653
9665
  static Parse(c) {
9654
9666
  if (GradientParser.IsGradientStr(c)) try {
9655
- const datum = parse$3(c)[0];
9667
+ const datum = parse$4(c)[0];
9656
9668
  if (datum) {
9657
9669
  if ("linear" === datum.type) return GradientParser.ParseLinear(datum);
9658
9670
  if ("radial" === datum.type) return GradientParser.ParseRadial(datum);
@@ -10335,8 +10347,9 @@
10335
10347
  constructor() {
10336
10348
  super(...arguments), this.time = BaseRenderContributionTime.afterFillStroke, this.useStyle = !0, this.order = 0;
10337
10349
  }
10338
- drawShape(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb) {
10339
- return super.drawShape(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb);
10350
+ drawShape(image, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb) {
10351
+ if (!(image.isGifImage && image.renderFrame && image.playing)) return super.drawShape(image, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb);
10352
+ image.renderFrame(context, x, y);
10340
10353
  }
10341
10354
  }
10342
10355
  const defaultImageRenderContribution = new DefaultImageRenderContribution();
@@ -10489,7 +10502,8 @@
10489
10502
  fill = arcAttribute.fill,
10490
10503
  stroke = arcAttribute.stroke,
10491
10504
  x: originX = arcAttribute.x,
10492
- y: originY = arcAttribute.y
10505
+ y: originY = arcAttribute.y,
10506
+ fillStrokeOrder = arcAttribute.fillStrokeOrder
10493
10507
  } = arc.attribute,
10494
10508
  data = this.valid(arc, arcAttribute, fillCb, strokeCb);
10495
10509
  if (!data) return;
@@ -10525,7 +10539,17 @@
10525
10539
  isFullStroke: isFullStroke,
10526
10540
  stroke: arrayStroke
10527
10541
  } = parseStroke(stroke);
10528
- if ((doFill || isFullStroke) && (context.beginPath(), drawArcPath(arc, context, x, y, outerRadius, innerRadius), beforeRenderContribitionsRuned = !0, context.setShadowBlendStyle && context.setShadowBlendStyle(arc, arc.attribute, arcAttribute), this.beforeRenderStep(arc, context, x, y, doFill, doStroke, fVisible, sVisible, arcAttribute, drawContext, fillCb, strokeCb), doFill && (fillCb ? fillCb(context, arc.attribute, arcAttribute) : fVisible && (context.setCommonStyle(arc, arc.attribute, originX - x, originY - y, arcAttribute), context.fill())), doStroke && isFullStroke && (strokeCb ? strokeCb(context, arc.attribute, arcAttribute) : sVisible && (context.setStrokeStyle(arc, arc.attribute, originX - x, originY - y, arcAttribute), context.stroke()))), !isFullStroke && doStroke) {
10542
+ if (doFill || isFullStroke) {
10543
+ context.beginPath(), drawArcPath(arc, context, x, y, outerRadius, innerRadius), beforeRenderContribitionsRuned = !0, context.setShadowBlendStyle && context.setShadowBlendStyle(arc, arc.attribute, arcAttribute), this.beforeRenderStep(arc, context, x, y, doFill, doStroke, fVisible, sVisible, arcAttribute, drawContext, fillCb, strokeCb);
10544
+ const _runFill = () => {
10545
+ doFill && (fillCb ? fillCb(context, arc.attribute, arcAttribute) : fVisible && (context.setCommonStyle(arc, arc.attribute, originX - x, originY - y, arcAttribute), context.fill()));
10546
+ },
10547
+ _runStroke = () => {
10548
+ doStroke && isFullStroke && (strokeCb ? strokeCb(context, arc.attribute, arcAttribute) : sVisible && (context.setStrokeStyle(arc, arc.attribute, originX - x, originY - y, arcAttribute), context.stroke()));
10549
+ };
10550
+ fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke());
10551
+ }
10552
+ if (!isFullStroke && doStroke) {
10529
10553
  context.beginPath();
10530
10554
  drawArcPath(arc, context, x, y, outerRadius, innerRadius, arrayStroke);
10531
10555
  beforeRenderContribitionsRuned || this.beforeRenderStep(arc, context, x, y, doFill, doStroke, fVisible, sVisible, arcAttribute, drawContext, fillCb, strokeCb), strokeCb ? strokeCb(context, arc.attribute, arcAttribute) : sVisible && (context.setStrokeStyle(arc, arc.attribute, x, y, arcAttribute), context.stroke());
@@ -10543,14 +10567,20 @@
10543
10567
  fill = arcAttribute.fill
10544
10568
  } = arc.attribute,
10545
10569
  startAngle = endAngle;
10546
- if (this.drawArcTailCapPath(arc, context, x, y, outerRadius, innerRadius, startAngle, startAngle + capAngle), beforeRenderContribitionsRuned || this.beforeRenderStep(arc, context, x, y, doFill, doStroke, fVisible, sVisible, arcAttribute, drawContext, fillCb, strokeCb), doFill) {
10547
- const color = fill;
10548
- if ("conical" === color.gradient) {
10549
- const lastColor = getConicGradientAt(0, 0, endAngle, color);
10550
- fillCb || fillVisible && (context.setCommonStyle(arc, arc.attribute, x, y, arcAttribute), context.fillStyle = lastColor, context.fill());
10551
- }
10552
- }
10553
- doStroke && (strokeCb || sVisible && (context.setStrokeStyle(arc, arc.attribute, x, y, arcAttribute), context.stroke()));
10570
+ this.drawArcTailCapPath(arc, context, x, y, outerRadius, innerRadius, startAngle, startAngle + capAngle), beforeRenderContribitionsRuned || this.beforeRenderStep(arc, context, x, y, doFill, doStroke, fVisible, sVisible, arcAttribute, drawContext, fillCb, strokeCb);
10571
+ const _runFill = () => {
10572
+ if (doFill) {
10573
+ const color = fill;
10574
+ if ("conical" === color.gradient) {
10575
+ const lastColor = getConicGradientAt(0, 0, endAngle, color);
10576
+ fillCb || fillVisible && (context.setCommonStyle(arc, arc.attribute, x, y, arcAttribute), context.fillStyle = lastColor, context.fill());
10577
+ }
10578
+ }
10579
+ },
10580
+ _runStroke = () => {
10581
+ doStroke && (strokeCb || sVisible && (context.setStrokeStyle(arc, arc.attribute, x, y, arcAttribute), context.stroke()));
10582
+ };
10583
+ _runFill(), _runStroke();
10554
10584
  }
10555
10585
  }
10556
10586
  this.afterRenderStep(arc, context, x, y, doFill, doStroke, fVisible, sVisible, arcAttribute, drawContext, fillCb, strokeCb), tempChangeConicalColor && (fill.startAngle += conicalOffset, fill.endAngle += conicalOffset);
@@ -10588,7 +10618,8 @@
10588
10618
  startAngle = circleAttribute.startAngle,
10589
10619
  endAngle = circleAttribute.endAngle,
10590
10620
  x: originX = circleAttribute.x,
10591
- y: originY = circleAttribute.y
10621
+ y: originY = circleAttribute.y,
10622
+ fillStrokeOrder = circleAttribute.fillStrokeOrder
10592
10623
  } = circle.attribute,
10593
10624
  data = this.valid(circle, circleAttribute, fillCb, strokeCb);
10594
10625
  if (!data) return;
@@ -10598,7 +10629,14 @@
10598
10629
  doFill: doFill,
10599
10630
  doStroke: doStroke
10600
10631
  } = data;
10601
- context.beginPath(), context.arc(x, y, radius, startAngle, endAngle), context.closePath(), context.setShadowBlendStyle && context.setShadowBlendStyle(circle, circle.attribute, circleAttribute), this.beforeRenderStep(circle, context, x, y, doFill, doStroke, fVisible, sVisible, circleAttribute, drawContext, fillCb, strokeCb), doFill && (fillCb ? fillCb(context, circle.attribute, circleAttribute) : fVisible && (context.setCommonStyle(circle, circle.attribute, originX - x, originY - y, circleAttribute), context.fill())), doStroke && (strokeCb ? strokeCb(context, circle.attribute, circleAttribute) : sVisible && (context.setStrokeStyle(circle, circle.attribute, originX - x, originY - y, circleAttribute), context.stroke())), this.afterRenderStep(circle, context, x, y, doFill, doStroke, fVisible, sVisible, circleAttribute, drawContext, fillCb, strokeCb);
10632
+ context.beginPath(), context.arc(x, y, radius, startAngle, endAngle), context.closePath(), context.setShadowBlendStyle && context.setShadowBlendStyle(circle, circle.attribute, circleAttribute), this.beforeRenderStep(circle, context, x, y, doFill, doStroke, fVisible, sVisible, circleAttribute, drawContext, fillCb, strokeCb);
10633
+ const _runFill = () => {
10634
+ doFill && (fillCb ? fillCb(context, circle.attribute, circleAttribute) : fVisible && (context.setCommonStyle(circle, circle.attribute, originX - x, originY - y, circleAttribute), context.fill()));
10635
+ },
10636
+ _runStroke = () => {
10637
+ doStroke && (strokeCb ? strokeCb(context, circle.attribute, circleAttribute) : sVisible && (context.setStrokeStyle(circle, circle.attribute, originX - x, originY - y, circleAttribute), context.stroke()));
10638
+ };
10639
+ fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this.afterRenderStep(circle, context, x, y, doFill, doStroke, fVisible, sVisible, circleAttribute, drawContext, fillCb, strokeCb);
10602
10640
  }
10603
10641
  draw(circle, renderService, drawContext, params) {
10604
10642
  const circleAttribute = getTheme(circle, null == params ? void 0 : params.theme).circle;
@@ -11039,7 +11077,7 @@
11039
11077
  super(), this.areaRenderContribitions = areaRenderContribitions, this.numberType = AREA_NUMBER_TYPE, this.builtinContributions = [defaultAreaTextureRenderContribution, defaultAreaBackgroundRenderContribution], this.init(areaRenderContribitions);
11040
11078
  }
11041
11079
  drawLinearAreaHighPerformance(area, context, fill, stroke, fillOpacity, strokeOpacity, offsetX, offsetY, areaAttribute, drawContext, params, fillCb, strokeCb) {
11042
- var _a, _b, _c, _d, _e;
11080
+ var _a, _b, _c;
11043
11081
  const {
11044
11082
  points: points
11045
11083
  } = area.attribute;
@@ -11063,28 +11101,31 @@
11063
11101
  x: originX = 0,
11064
11102
  x: originY = 0
11065
11103
  } = area.attribute;
11066
- if (!1 !== fill && (fillCb ? fillCb(context, area.attribute, areaAttribute) : fillOpacity && (context.setCommonStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute), context.fill())), this.afterRenderStep(area, context, offsetX, offsetY, !!fillOpacity, !1, fill, !1, areaAttribute, drawContext, fillCb, null, {
11104
+ !1 !== fill && (fillCb ? fillCb(context, area.attribute, areaAttribute) : fillOpacity && (context.setCommonStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute), context.fill())), this.afterRenderStep(area, context, offsetX, offsetY, !!fillOpacity, !1, fill, !1, areaAttribute, drawContext, fillCb, null, {
11067
11105
  attribute: area.attribute
11068
- }), stroke) {
11069
- const {
11070
- stroke = areaAttribute && areaAttribute.stroke
11071
- } = area.attribute;
11072
- if (isArray$1(stroke) && (stroke[0] || stroke[2]) && !1 === stroke[1]) if (context.beginPath(), stroke[0]) {
11073
- context.moveTo(startP.x + offsetX, startP.y + offsetY, z);
11074
- for (let i = 1; i < points.length; i++) {
11075
- const p = points[i];
11076
- context.lineTo(p.x + offsetX, p.y + offsetY, z);
11077
- }
11078
- } else if (stroke[2]) {
11079
- const endP = points[points.length - 1];
11080
- context.moveTo(endP.x + offsetX, endP.y + offsetY, z);
11081
- for (let i = points.length - 2; i >= 0; i--) {
11082
- const p = points[i];
11083
- context.lineTo((null !== (_d = p.x1) && void 0 !== _d ? _d : p.x) + offsetX, (null !== (_e = p.y1) && void 0 !== _e ? _e : p.y) + offsetY, z);
11106
+ }), (() => {
11107
+ var _a, _b;
11108
+ if (stroke) {
11109
+ const {
11110
+ stroke = areaAttribute && areaAttribute.stroke
11111
+ } = area.attribute;
11112
+ if (isArray$1(stroke) && (stroke[0] || stroke[2]) && !1 === stroke[1]) if (context.beginPath(), stroke[0]) {
11113
+ context.moveTo(startP.x + offsetX, startP.y + offsetY, z);
11114
+ for (let i = 1; i < points.length; i++) {
11115
+ const p = points[i];
11116
+ context.lineTo(p.x + offsetX, p.y + offsetY, z);
11117
+ }
11118
+ } else if (stroke[2]) {
11119
+ const endP = points[points.length - 1];
11120
+ context.moveTo(endP.x + offsetX, endP.y + offsetY, z);
11121
+ for (let i = points.length - 2; i >= 0; i--) {
11122
+ const p = points[i];
11123
+ context.lineTo((null !== (_a = p.x1) && void 0 !== _a ? _a : p.x) + offsetX, (null !== (_b = p.y1) && void 0 !== _b ? _b : p.y) + offsetY, z);
11124
+ }
11084
11125
  }
11126
+ strokeCb ? strokeCb(context, area.attribute, areaAttribute) : (context.setStrokeStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute), context.stroke());
11085
11127
  }
11086
- strokeCb ? strokeCb(context, area.attribute, areaAttribute) : (context.setStrokeStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute), context.stroke());
11087
- }
11128
+ })();
11088
11129
  }
11089
11130
  drawShape(area, context, x, y, drawContext, params, fillCb, strokeCb) {
11090
11131
  var _a, _b, _c, _d, _e, _f;
@@ -11249,23 +11290,24 @@
11249
11290
  x: originX = 0,
11250
11291
  x: originY = 0
11251
11292
  } = attribute;
11252
- if (!1 !== fill && (fillCb ? fillCb(context, attribute, defaultAttribute) : fillOpacity && (context.setCommonStyle(area, connect ? connectedStyle : attribute, originX - offsetX, originY - offsetY, connect ? da : defaultAttribute), context.fill())), this.afterRenderStep(area, context, offsetX, offsetY, !!fillOpacity, !1, fill, !1, defaultAttribute, drawContext, fillCb, null, {
11293
+ return !1 !== fill && (fillCb ? fillCb(context, attribute, defaultAttribute) : fillOpacity && (context.setCommonStyle(area, connect ? connectedStyle : attribute, originX - offsetX, originY - offsetY, connect ? da : defaultAttribute), context.fill())), this.afterRenderStep(area, context, offsetX, offsetY, !!fillOpacity, !1, fill, !1, defaultAttribute, drawContext, fillCb, null, {
11253
11294
  attribute: attribute
11254
- }), !1 !== stroke) if (strokeCb) strokeCb(context, attribute, defaultAttribute);else {
11255
- const {
11256
- stroke = defaultAttribute && defaultAttribute[1] && defaultAttribute[1].stroke
11257
- } = attribute;
11258
- isArray$1(stroke) && (stroke[0] || stroke[2]) && !1 === stroke[1] && (context.beginPath(), drawSegments(context.camera ? context : context.nativeContext, stroke[0] ? cache.top : cache.bottom, clipRange, direction === Direction$1.ROW ? "x" : "y", {
11259
- offsetX: offsetX,
11260
- offsetY: offsetY,
11261
- offsetZ: offsetZ,
11262
- drawConnect: connect,
11263
- mode: connectedType,
11264
- zeroX: connectedX,
11265
- zeroY: connectedY
11266
- })), context.setStrokeStyle(area, connect ? connectedStyle : attribute, originX - offsetX, originY - offsetY, connect ? da : defaultAttribute), context.stroke();
11267
- }
11268
- return !1;
11295
+ }), (() => {
11296
+ if (!1 !== stroke) if (strokeCb) strokeCb(context, attribute, defaultAttribute);else {
11297
+ const {
11298
+ stroke = defaultAttribute && defaultAttribute[1] && defaultAttribute[1].stroke
11299
+ } = attribute;
11300
+ isArray$1(stroke) && (stroke[0] || stroke[2]) && !1 === stroke[1] && (context.beginPath(), drawSegments(context.camera ? context : context.nativeContext, stroke[0] ? cache.top : cache.bottom, clipRange, direction === Direction$1.ROW ? "x" : "y", {
11301
+ offsetX: offsetX,
11302
+ offsetY: offsetY,
11303
+ offsetZ: offsetZ,
11304
+ drawConnect: connect,
11305
+ mode: connectedType,
11306
+ zeroX: connectedX,
11307
+ zeroY: connectedY
11308
+ })), context.setStrokeStyle(area, connect ? connectedStyle : attribute, originX - offsetX, originY - offsetY, connect ? da : defaultAttribute), context.stroke();
11309
+ }
11310
+ })(), !1;
11269
11311
  }
11270
11312
  };
11271
11313
  DefaultCanvasAreaRender = __decorate$Q([injectable(), __param$u(0, inject(ContributionProvider)), __param$u(0, named(AreaRenderContribution)), __metadata$E("design:paramtypes", [Object])], DefaultCanvasAreaRender);
@@ -11297,7 +11339,8 @@
11297
11339
  const pathAttribute = null !== (_a = this.tempTheme) && void 0 !== _a ? _a : getTheme(path, null == params ? void 0 : params.theme).path,
11298
11340
  {
11299
11341
  x: originX = pathAttribute.x,
11300
- y: originY = pathAttribute.y
11342
+ y: originY = pathAttribute.y,
11343
+ fillStrokeOrder = pathAttribute.fillStrokeOrder
11301
11344
  } = path.attribute,
11302
11345
  z = null !== (_b = this.z) && void 0 !== _b ? _b : 0,
11303
11346
  data = this.valid(path, pathAttribute, fillCb, strokeCb);
@@ -11312,7 +11355,14 @@
11312
11355
  const path2D = null !== (_c = path.attribute.path) && void 0 !== _c ? _c : pathAttribute.path;
11313
11356
  renderCommandList(path2D.commandList, context, x, y, 1, 1, z);
11314
11357
  }
11315
- context.setShadowBlendStyle && context.setShadowBlendStyle(path, path.attribute, pathAttribute), this.beforeRenderStep(path, context, x, y, doFill, doStroke, fVisible, sVisible, pathAttribute, drawContext, fillCb, strokeCb), doStroke && (strokeCb ? strokeCb(context, path.attribute, pathAttribute) : sVisible && (context.setStrokeStyle(path, path.attribute, originX - x, originY - y, pathAttribute), context.stroke())), doFill && (fillCb ? fillCb(context, path.attribute, pathAttribute) : fVisible && (context.setCommonStyle(path, path.attribute, originX - x, originY - y, pathAttribute), context.fill())), this.afterRenderStep(path, context, x, y, doFill, doStroke, fVisible, sVisible, pathAttribute, drawContext, fillCb, strokeCb);
11358
+ context.setShadowBlendStyle && context.setShadowBlendStyle(path, path.attribute, pathAttribute), this.beforeRenderStep(path, context, x, y, doFill, doStroke, fVisible, sVisible, pathAttribute, drawContext, fillCb, strokeCb);
11359
+ const _runStroke = () => {
11360
+ doStroke && (strokeCb ? strokeCb(context, path.attribute, pathAttribute) : sVisible && (context.setStrokeStyle(path, path.attribute, originX - x, originY - y, pathAttribute), context.stroke()));
11361
+ },
11362
+ _runFill = () => {
11363
+ doFill && (fillCb ? fillCb(context, path.attribute, pathAttribute) : fVisible && (context.setCommonStyle(path, path.attribute, originX - x, originY - y, pathAttribute), context.fill()));
11364
+ };
11365
+ fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this.afterRenderStep(path, context, x, y, doFill, doStroke, fVisible, sVisible, pathAttribute, drawContext, fillCb, strokeCb);
11316
11366
  }
11317
11367
  draw(path, renderService, drawContext, params) {
11318
11368
  const pathAttribute = getTheme(path, null == params ? void 0 : params.theme).path;
@@ -11356,7 +11406,8 @@
11356
11406
  x1: x1,
11357
11407
  y1: y1,
11358
11408
  x: originX = rectAttribute.x,
11359
- y: originY = rectAttribute.y
11409
+ y: originY = rectAttribute.y,
11410
+ fillStrokeOrder = rectAttribute.fillStrokeOrder
11360
11411
  } = rect.attribute;
11361
11412
  let {
11362
11413
  width: width,
@@ -11375,7 +11426,14 @@
11375
11426
  doFill: doFill,
11376
11427
  doStroke: doStroke
11377
11428
  };
11378
- context.setShadowBlendStyle && context.setShadowBlendStyle(rect, rect.attribute, rectAttribute), this.beforeRenderStep(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb, doFillOrStroke), doFillOrStroke.doFill && (fillCb ? fillCb(context, rect.attribute, rectAttribute) : fVisible && (context.setCommonStyle(rect, rect.attribute, originX - x, originY - y, rectAttribute), context.fill())), doFillOrStroke.doStroke && (strokeCb ? strokeCb(context, rect.attribute, rectAttribute) : sVisible && (context.setStrokeStyle(rect, rect.attribute, originX - x, originY - y, rectAttribute), context.stroke())), this.afterRenderStep(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb);
11429
+ context.setShadowBlendStyle && context.setShadowBlendStyle(rect, rect.attribute, rectAttribute), this.beforeRenderStep(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb, doFillOrStroke);
11430
+ const _runFill = () => {
11431
+ doFillOrStroke.doFill && (fillCb ? fillCb(context, rect.attribute, rectAttribute) : fVisible && (context.setCommonStyle(rect, rect.attribute, originX - x, originY - y, rectAttribute), context.fill()));
11432
+ },
11433
+ _runStroke = () => {
11434
+ doFillOrStroke.doStroke && (strokeCb ? strokeCb(context, rect.attribute, rectAttribute) : sVisible && (context.setStrokeStyle(rect, rect.attribute, originX - x, originY - y, rectAttribute), context.stroke()));
11435
+ };
11436
+ fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this.afterRenderStep(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb);
11379
11437
  }
11380
11438
  draw(rect, renderService, drawContext, params) {
11381
11439
  const rectAttribute = getTheme(rect, null == params ? void 0 : params.theme).rect;
@@ -11411,7 +11469,8 @@
11411
11469
  x: originX = symbolAttribute.x,
11412
11470
  y: originY = symbolAttribute.y,
11413
11471
  scaleX = symbolAttribute.scaleX,
11414
- scaleY = symbolAttribute.scaleY
11472
+ scaleY = symbolAttribute.scaleY,
11473
+ fillStrokeOrder = symbolAttribute.fillStrokeOrder
11415
11474
  } = symbol.attribute,
11416
11475
  data = this.valid(symbol, symbolAttribute, fillCb, strokeCb);
11417
11476
  if (!data) return;
@@ -11434,14 +11493,27 @@
11434
11493
  const obj = Object.assign({}, a);
11435
11494
  obj.fill = null !== (_a = a.fill) && void 0 !== _a ? _a : symbol.attribute.fill, obj.opacity = null !== (_b = a.opacity) && void 0 !== _b ? _b : symbol.attribute.opacity, obj.fillOpacity = symbol.attribute.fillOpacity, obj.stroke = null !== (_c = a.stroke) && void 0 !== _c ? _c : symbol.attribute.stroke, a = obj;
11436
11495
  }
11437
- a.fill && (fillCb ? fillCb(context, symbol.attribute, symbolAttribute) : (context.setCommonStyle(symbol, a, originX - x, originY - y, symbolAttribute), context.fill())), a.stroke && (strokeCb ? strokeCb(context, symbol.attribute, symbolAttribute) : (context.setStrokeStyle(symbol, a, (originX - x) / scaleX, (originY - y) / scaleY, symbolAttribute), context.stroke()));
11496
+ const _runFill = () => {
11497
+ a.fill && (fillCb ? fillCb(context, symbol.attribute, symbolAttribute) : (context.setCommonStyle(symbol, a, originX - x, originY - y, symbolAttribute), context.fill()));
11498
+ },
11499
+ _runStroke = () => {
11500
+ a.stroke && (strokeCb ? strokeCb(context, symbol.attribute, symbolAttribute) : (context.setStrokeStyle(symbol, a, (originX - x) / scaleX, (originY - y) / scaleY, symbolAttribute), context.stroke()));
11501
+ };
11502
+ fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke());
11438
11503
  };
11439
11504
  if (keepDirIn3d && context.camera && context.project) {
11440
11505
  const p = context.project(x, y, z),
11441
11506
  camera = context.camera;
11442
11507
  context.camera = null, !1 === parsedPath.draw(context, isArray$1(size) ? [size[0] * scaleX, size[1] * scaleY] : size * scaleX, p.x, p.y, void 0, callback) && context.closePath(), context.camera = camera;
11443
11508
  } else !1 === parsedPath.draw(context, size, x, y, z, callback) && context.closePath();
11444
- context.setShadowBlendStyle && context.setShadowBlendStyle(symbol, symbol.attribute, symbolAttribute), this.beforeRenderStep(symbol, context, x, y, doFill, doStroke, fVisible, sVisible, symbolAttribute, drawContext, fillCb, strokeCb), doFill && !parsedPath.isSvg && (fillCb ? fillCb(context, symbol.attribute, symbolAttribute) : fVisible && (context.setCommonStyle(symbol, symbol.attribute, originX - x, originY - y, symbolAttribute), context.fill())), doStroke && !parsedPath.isSvg && (strokeCb ? strokeCb(context, symbol.attribute, symbolAttribute) : sVisible && (context.setStrokeStyle(symbol, symbol.attribute, (originX - x) / scaleX, (originY - y) / scaleY, symbolAttribute), context.stroke())), this.afterRenderStep(symbol, context, x, y, doFill, doStroke, fVisible, sVisible, symbolAttribute, drawContext, fillCb, strokeCb);
11509
+ context.setShadowBlendStyle && context.setShadowBlendStyle(symbol, symbol.attribute, symbolAttribute), this.beforeRenderStep(symbol, context, x, y, doFill, doStroke, fVisible, sVisible, symbolAttribute, drawContext, fillCb, strokeCb);
11510
+ const _runFill = () => {
11511
+ doFill && !parsedPath.isSvg && (fillCb ? fillCb(context, symbol.attribute, symbolAttribute) : fVisible && (context.setCommonStyle(symbol, symbol.attribute, originX - x, originY - y, symbolAttribute), context.fill()));
11512
+ },
11513
+ _runStroke = () => {
11514
+ doStroke && !parsedPath.isSvg && (strokeCb ? strokeCb(context, symbol.attribute, symbolAttribute) : sVisible && (context.setStrokeStyle(symbol, symbol.attribute, (originX - x) / scaleX, (originY - y) / scaleY, symbolAttribute), context.stroke()));
11515
+ };
11516
+ fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this.afterRenderStep(symbol, context, x, y, doFill, doStroke, fVisible, sVisible, symbolAttribute, drawContext, fillCb, strokeCb);
11445
11517
  }
11446
11518
  draw(symbol, renderService, drawContext, params) {
11447
11519
  const symbolAttribute = getTheme(symbol, null == params ? void 0 : params.theme).symbol;
@@ -11815,7 +11887,8 @@
11815
11887
  cornerRadius = polygonAttribute.cornerRadius,
11816
11888
  x: originX = polygonAttribute.x,
11817
11889
  y: originY = polygonAttribute.y,
11818
- closePath = polygonAttribute.closePath
11890
+ closePath = polygonAttribute.closePath,
11891
+ fillStrokeOrder = polygonAttribute.fillStrokeOrder
11819
11892
  } = polygon.attribute,
11820
11893
  data = this.valid(polygon, polygonAttribute, fillCb, strokeCb);
11821
11894
  if (!data) return;
@@ -11825,7 +11898,14 @@
11825
11898
  doFill: doFill,
11826
11899
  doStroke: doStroke
11827
11900
  } = data;
11828
- context.beginPath(), cornerRadius <= 0 || isArray$1(cornerRadius) && cornerRadius.every(num => 0 === num) ? drawPolygon(context.camera ? context : context.nativeContext, points, x, y) : drawRoundedPolygon(context.camera ? context : context.nativeContext, points, x, y, cornerRadius, closePath), closePath && context.closePath(), context.setShadowBlendStyle && context.setShadowBlendStyle(polygon, polygon.attribute, polygonAttribute), this.beforeRenderStep(polygon, context, x, y, doFill, doStroke, fVisible, sVisible, polygonAttribute, drawContext, fillCb, strokeCb), doFill && (fillCb ? fillCb(context, polygon.attribute, polygonAttribute) : fVisible && (context.setCommonStyle(polygon, polygon.attribute, originX - x, originY - y, polygonAttribute), context.fill())), doStroke && (strokeCb ? strokeCb(context, polygon.attribute, polygonAttribute) : sVisible && (context.setStrokeStyle(polygon, polygon.attribute, originX - x, originY - y, polygonAttribute), context.stroke())), this.afterRenderStep(polygon, context, x, y, doFill, doStroke, fVisible, sVisible, polygonAttribute, drawContext, fillCb, strokeCb);
11901
+ context.beginPath(), cornerRadius <= 0 || isArray$1(cornerRadius) && cornerRadius.every(num => 0 === num) ? drawPolygon(context.camera ? context : context.nativeContext, points, x, y) : drawRoundedPolygon(context.camera ? context : context.nativeContext, points, x, y, cornerRadius, closePath), closePath && context.closePath(), context.setShadowBlendStyle && context.setShadowBlendStyle(polygon, polygon.attribute, polygonAttribute), this.beforeRenderStep(polygon, context, x, y, doFill, doStroke, fVisible, sVisible, polygonAttribute, drawContext, fillCb, strokeCb);
11902
+ const _runFill = () => {
11903
+ doFill && (fillCb ? fillCb(context, polygon.attribute, polygonAttribute) : fVisible && (context.setCommonStyle(polygon, polygon.attribute, originX - x, originY - y, polygonAttribute), context.fill()));
11904
+ },
11905
+ _runStroke = () => {
11906
+ doStroke && (strokeCb ? strokeCb(context, polygon.attribute, polygonAttribute) : sVisible && (context.setStrokeStyle(polygon, polygon.attribute, originX - x, originY - y, polygonAttribute), context.stroke()));
11907
+ };
11908
+ fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this.afterRenderStep(polygon, context, x, y, doFill, doStroke, fVisible, sVisible, polygonAttribute, drawContext, fillCb, strokeCb);
11829
11909
  }
11830
11910
  draw(polygon, renderService, drawContext, params) {
11831
11911
  const polygonAttribute = getTheme(polygon, null == params ? void 0 : params.theme).polygon;
@@ -11868,7 +11948,10 @@
11868
11948
  cornerRadius = groupAttribute.cornerRadius,
11869
11949
  path = groupAttribute.path,
11870
11950
  lineWidth = groupAttribute.lineWidth,
11871
- visible = groupAttribute.visible
11951
+ visible = groupAttribute.visible,
11952
+ fillStrokeOrder = groupAttribute.fillStrokeOrder,
11953
+ x: originX = groupAttribute.x,
11954
+ y: originY = groupAttribute.y
11872
11955
  } = group.attribute,
11873
11956
  fVisible = rectFillVisible(opacity, fillOpacity, width, height, fill),
11874
11957
  sVisible = rectStrokeVisible(opacity, strokeOpacity, width, height),
@@ -11894,7 +11977,14 @@
11894
11977
  };
11895
11978
  this._groupRenderContribitions.forEach(c => {
11896
11979
  c.time === BaseRenderContributionTime.beforeFillStroke && c.drawShape(group, context, x, y, doFill, doStroke, fVisible, sVisible, groupAttribute, drawContext, fillCb, strokeCb, doFillOrStroke);
11897
- }), clip && context.clip(), context.setShadowBlendStyle && context.setShadowBlendStyle(group, group.attribute, groupAttribute), doFillOrStroke.doFill && (fillCb ? fillCb(context, group.attribute, groupAttribute) : fVisible && (context.setCommonStyle(group, group.attribute, x, y, groupAttribute), context.fill())), doFillOrStroke.doStroke && (strokeCb ? strokeCb(context, group.attribute, groupAttribute) : sVisible && (context.setStrokeStyle(group, group.attribute, x, y, groupAttribute), context.stroke())), this._groupRenderContribitions.forEach(c => {
11980
+ }), clip && context.clip(), context.setShadowBlendStyle && context.setShadowBlendStyle(group, group.attribute, groupAttribute);
11981
+ const _runFill = () => {
11982
+ doFillOrStroke.doFill && (fillCb ? fillCb(context, group.attribute, groupAttribute) : fVisible && (context.setCommonStyle(group, group.attribute, originX - x, originY - y, groupAttribute), context.fill()));
11983
+ },
11984
+ _runStroke = () => {
11985
+ doFillOrStroke.doStroke && (strokeCb ? strokeCb(context, group.attribute, groupAttribute) : sVisible && (context.setStrokeStyle(group, group.attribute, originX - x, originY - y, groupAttribute), context.stroke()));
11986
+ };
11987
+ fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this._groupRenderContribitions.forEach(c => {
11898
11988
  c.time === BaseRenderContributionTime.afterFillStroke && c.drawShape(group, context, x, y, doFill, doStroke, fVisible, sVisible, groupAttribute, drawContext, fillCb, strokeCb);
11899
11989
  });
11900
11990
  }
@@ -11960,6 +12050,7 @@
11960
12050
  x: originX = imageAttribute.x,
11961
12051
  y: originY = imageAttribute.y,
11962
12052
  cornerRadius = imageAttribute.cornerRadius,
12053
+ fillStrokeOrder = imageAttribute.fillStrokeOrder,
11963
12054
  image: url
11964
12055
  } = image.attribute,
11965
12056
  data = this.valid(image, imageAttribute, fillCb);
@@ -11970,29 +12061,37 @@
11970
12061
  doFill: doFill,
11971
12062
  doStroke: doStroke
11972
12063
  } = data;
11973
- if (context.setShadowBlendStyle && context.setShadowBlendStyle(image, imageAttribute), this.beforeRenderStep(image, context, x, y, doFill, !1, fVisible, !1, imageAttribute, drawContext, fillCb), doFill) if (fillCb) fillCb(context, image.attribute, imageAttribute);else if (fVisible) {
11974
- if (!url || !image.resources) return;
11975
- const res = image.resources.get(url);
11976
- if ("success" !== res.state) return;
11977
- let needRestore = !1;
11978
- 0 === cornerRadius || isArray$1(cornerRadius) && cornerRadius.every(num => 0 === num) || (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius), context.save(), context.clip(), needRestore = !0), context.setCommonStyle(image, image.attribute, x, y, imageAttribute);
11979
- let repeat = 0;
11980
- if ("repeat" === repeatX && (repeat |= 1), "repeat" === repeatY && (repeat |= 2), repeat) {
11981
- const pattern = context.createPattern(res.data, repeatStr[repeat]);
11982
- context.fillStyle = pattern, context.translate(x, y, !0), context.fillRect(0, 0, width, height), context.translate(-x, -y, !0);
11983
- } else context.drawImage(res.data, x, y, width, height);
11984
- needRestore && context.restore();
11985
- }
11986
- doStroke && (strokeCb ? strokeCb(context, image.attribute, imageAttribute) : sVisible && (context.setStrokeStyle(image, image.attribute, originX - x, originY - y, imageAttribute), context.stroke())), this.afterRenderStep(image, context, x, y, doFill, !1, fVisible, !1, imageAttribute, drawContext, fillCb);
12064
+ context.setShadowBlendStyle && context.setShadowBlendStyle(image, imageAttribute), this.beforeRenderStep(image, context, x, y, doFill, !1, fVisible, !1, imageAttribute, drawContext, fillCb);
12065
+ const _runFill = () => {
12066
+ if (doFill) if (fillCb) fillCb(context, image.attribute, imageAttribute);else if (fVisible) {
12067
+ if (!url || !image.resources) return;
12068
+ const res = image.resources.get(url);
12069
+ if ("success" !== res.state) return;
12070
+ let needRestore = !1;
12071
+ 0 === cornerRadius || isArray$1(cornerRadius) && cornerRadius.every(num => 0 === num) || (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius), context.save(), context.clip(), needRestore = !0), context.setCommonStyle(image, image.attribute, x, y, imageAttribute);
12072
+ let repeat = 0;
12073
+ if ("repeat" === repeatX && (repeat |= 1), "repeat" === repeatY && (repeat |= 2), repeat) {
12074
+ const pattern = context.createPattern(res.data, repeatStr[repeat]);
12075
+ context.fillStyle = pattern, context.translate(x, y, !0), context.fillRect(0, 0, width, height), context.translate(-x, -y, !0);
12076
+ } else context.drawImage(res.data, x, y, width, height);
12077
+ needRestore && context.restore();
12078
+ }
12079
+ },
12080
+ _runStroke = () => {
12081
+ doStroke && (strokeCb ? strokeCb(context, image.attribute, imageAttribute) : sVisible && (context.setStrokeStyle(image, image.attribute, originX - x, originY - y, imageAttribute), context.stroke()));
12082
+ };
12083
+ fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this.afterRenderStep(image, context, x, y, doFill, !1, fVisible, !1, imageAttribute, drawContext, fillCb);
11987
12084
  }
11988
12085
  draw(image, renderService, drawContext) {
11989
12086
  const {
11990
12087
  image: url
11991
12088
  } = image.attribute;
11992
- if (!url || !image.resources) return;
11993
- const res = image.resources.get(url);
11994
- if ("loading" === res.state && isString$2(url)) return void ResourceLoader.improveImageLoading(url);
11995
- if ("success" !== res.state) return;
12089
+ if (!image.isGifImage) {
12090
+ if (!url || !image.resources) return;
12091
+ const res = image.resources.get(url);
12092
+ if ("loading" === res.state && isString$2(url)) return void ResourceLoader.improveImageLoading(url);
12093
+ if ("success" !== res.state) return;
12094
+ }
11996
12095
  const {
11997
12096
  context: context
11998
12097
  } = renderService.drawParams;
@@ -15848,6 +15947,42 @@
15848
15947
  }
15849
15948
  }
15850
15949
 
15950
+ class AutoRefreshPlugin {
15951
+ constructor() {
15952
+ this.name = "AutoRefreshPlugin", this.activeEvent = "onRegister", this._uid = Generator.GenAutoIncrementId(), this.key = this.name + this._uid, this.handleChange = graphic => {
15953
+ graphic.glyphHost && (graphic = graphic.glyphHost), graphic.stage === this.pluginService.stage && null != graphic.stage && graphic.stage.renderNextFrame();
15954
+ };
15955
+ }
15956
+ activate(context) {
15957
+ this.pluginService = context, this.dpr = application.global.devicePixelRatio, this.refresh();
15958
+ }
15959
+ refresh() {
15960
+ this._refreshByMediaQuery() || this._refreshByRaf();
15961
+ }
15962
+ _refreshByRaf() {
15963
+ const raf = application.global.getRequestAnimationFrame();
15964
+ this.rafId = raf(() => {
15965
+ application.global.devicePixelRatio !== this.dpr && (this.dpr = application.global.devicePixelRatio, this.pluginService.stage.setDpr(this.dpr, !0)), this.refresh();
15966
+ });
15967
+ }
15968
+ _refreshByMediaQuery() {
15969
+ try {
15970
+ const mqString = `(resolution: ${window.devicePixelRatio}dppx)`,
15971
+ updatePixelRatio = () => {
15972
+ window.devicePixelRatio !== this.dpr && (this.dpr = window.devicePixelRatio, this.pluginService.stage.setDpr(this.dpr, !0));
15973
+ };
15974
+ matchMedia(mqString).addEventListener("change", updatePixelRatio);
15975
+ } catch (err) {
15976
+ return !1;
15977
+ }
15978
+ return !0;
15979
+ }
15980
+ deactivate(context) {
15981
+ const craf = application.global.getCancelAnimationFrame();
15982
+ craf && this.rafId && craf(this.rafId);
15983
+ }
15984
+ }
15985
+
15851
15986
  class IncrementalAutoRenderPlugin {
15852
15987
  constructor() {
15853
15988
  this.name = "IncrementalAutoRenderPlugin", this.activeEvent = "onRegister", this.nextFrameRenderGroupSet = new Set(), this.willNextFrameRender = !1, this.nextUserParams = {}, this._uid = Generator.GenAutoIncrementId(), this.key = this.name + this._uid;
@@ -16047,7 +16182,7 @@
16047
16182
  canvas: params.canvas
16048
16183
  }), this.state = "normal", this.renderCount = 0, this.tryInitEventSystem(), this._background = null !== (_a = params.background) && void 0 !== _a ? _a : DefaultConfig$1.BACKGROUND, this.appendChild(this.layerService.createLayer(this, {
16049
16184
  main: !0
16050
- })), this.nextFrameRenderLayerSet = new Set(), this.willNextFrameRender = !1, this.stage = this, this.renderStyle = params.renderStyle, params.autoRender && this.enableAutoRender(), !1 === params.disableDirtyBounds && this.enableDirtyBounds(), params.enableHtmlAttribute && this.enableHtmlAttribute(params.enableHtmlAttribute), params.ReactDOM && this.enableReactAttribute(params.ReactDOM), params.enableLayout && this.enableLayout(), this.hooks.beforeRender.tap("constructor", this.beforeRender), this.hooks.afterRender.tap("constructor", this.afterRender), this._beforeRender = params.beforeRender, this._afterRender = params.afterRender, this.ticker = params.ticker || defaultTicker, this.supportInteractiveLayer = !1 !== params.interactiveLayer, this.timeline = new DefaultTimeline(), this.ticker.addTimeline(this.timeline), this.timeline.pause(), params.optimize || (params.optimize = {}), this.optmize(params.optimize), params.background && isString$2(this._background) && this._background.includes("/") && this.setAttributes({
16185
+ })), this.nextFrameRenderLayerSet = new Set(), this.willNextFrameRender = !1, this.stage = this, this.renderStyle = params.renderStyle, params.autoRender && this.enableAutoRender(), params.autoRefresh && this.enableAutoRefresh(), !1 === params.disableDirtyBounds && this.enableDirtyBounds(), params.enableHtmlAttribute && this.enableHtmlAttribute(params.enableHtmlAttribute), params.ReactDOM && this.enableReactAttribute(params.ReactDOM), params.enableLayout && this.enableLayout(), this.hooks.beforeRender.tap("constructor", this.beforeRender), this.hooks.afterRender.tap("constructor", this.afterRender), this._beforeRender = params.beforeRender, this._afterRender = params.afterRender, this.ticker = params.ticker || defaultTicker, this.supportInteractiveLayer = !1 !== params.interactiveLayer, this.timeline = new DefaultTimeline(), this.ticker.addTimeline(this.timeline), this.timeline.pause(), params.optimize || (params.optimize = {}), this.optmize(params.optimize), params.background && isString$2(this._background) && this._background.includes("/") && this.setAttributes({
16051
16186
  background: this._background
16052
16187
  });
16053
16188
  }
@@ -16182,6 +16317,14 @@
16182
16317
  this.pluginService.unRegister(plugin);
16183
16318
  }));
16184
16319
  }
16320
+ enableAutoRefresh() {
16321
+ this.autoRefresh || (this.autoRefresh = !0, this.pluginService.register(new AutoRefreshPlugin()));
16322
+ }
16323
+ disableAutoRefresh() {
16324
+ this.autoRefresh && (this.autoRefresh = !1, this.pluginService.findPluginsByName("AutoRefreshPlugin").forEach(plugin => {
16325
+ this.pluginService.unRegister(plugin);
16326
+ }));
16327
+ }
16185
16328
  enableIncrementalAutoRender() {
16186
16329
  this.increaseAutoRender || (this.increaseAutoRender = !0, this.pluginService.register(new IncrementalAutoRenderPlugin()));
16187
16330
  }
@@ -17392,9 +17535,11 @@
17392
17535
  name: name,
17393
17536
  id: id,
17394
17537
  attribute: attribute,
17395
- stateProxy: stateProxy
17538
+ stateProxy: stateProxy,
17539
+ animation: animation,
17540
+ timeline: timeline
17396
17541
  } = _a,
17397
- props = __rest$4(_a, ["key", "name", "id", "attribute", "stateProxy"]);
17542
+ props = __rest$4(_a, ["key", "name", "id", "attribute", "stateProxy", "animation", "timeline"]);
17398
17543
  let c = type;
17399
17544
  isString$2(type) && (c = graphicCreator[type]);
17400
17545
  const childrenList = [];
@@ -17403,7 +17548,13 @@
17403
17548
  }
17404
17549
  children.length && flatten(1 === children.length ? children[0] : children, childrenList);
17405
17550
  const g = "Group" === c.name ? new c(attribute) : c(config);
17406
- return parseToGraphic$1(g, childrenList, props), stateProxy && (g.stateProxy = stateProxy), g;
17551
+ if (parseToGraphic$1(g, childrenList, props), stateProxy && (g.stateProxy = stateProxy), name && (g.name = name), isArray$1(animation)) {
17552
+ const animate = g.animate();
17553
+ timeline && animate.setTimeline(timeline), animation.forEach(item => {
17554
+ animate[item[0]](...item.slice(1));
17555
+ });
17556
+ }
17557
+ return g;
17407
17558
  }
17408
17559
  function parseToGraphic$1(g, childrenList, props) {
17409
17560
  let out,
@@ -17456,7 +17607,7 @@
17456
17607
  let config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
17457
17608
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
17458
17609
  super(), this.cachedEvents = [], this.startPoints = [], this.processEvent = {}, this.throttleTimer = 0, this.emitThrottles = [], this.lastTapTarget = null, this.onStart = ev => {
17459
- this.reset(), this.startTime = clock.now();
17610
+ this.cachedEvents = [], this.startPoints = [], this.reset(), this.startTime = clock.now();
17460
17611
  const {
17461
17612
  cachedEvents: cachedEvents,
17462
17613
  startPoints: startPoints
@@ -17476,7 +17627,7 @@
17476
17627
  if (1 !== startPoints.length) this.startDistance = calcDistance(startPoints[0], startPoints[1]), this.center = getCenter([startPoints[0], startPoints[1]]);else {
17477
17628
  const event = cachedEvents[0];
17478
17629
  this.pressTimeout = setTimeout(() => {
17479
- event.direction = "none", event.deltaX = 0, event.deltaY = 0, event.points = startPoints, this.triggerStartEvent("press", event), this.triggerEvent("press", event), this.eventType = "press", this.direction = "none";
17630
+ event.direction = "none", event.deltaX = 0, event.deltaY = 0, event.points = startPoints, this.triggerStartEvent("press", event), this.triggerEvent("press", event), this.eventType = "press", this.direction = "none", this.pressTimeout = null;
17480
17631
  }, this.config.press.time);
17481
17632
  }
17482
17633
  }, this.onMove = ev => {
@@ -17539,10 +17690,10 @@
17539
17690
  lastMovePoint = this.lastMovePoint || startPoints[0],
17540
17691
  distance = calcDistance(prevMovePoint, lastMovePoint),
17541
17692
  velocity = distance / intervalTime;
17542
- velocity > this.config.swipe.velocity && distance > this.config.swipe.threshold && (endEvent.velocity = velocity, endEvent.direction = calcDirection(prevMovePoint, lastMovePoint), this.triggerEvent("swipe", endEvent));
17693
+ if (velocity > this.config.swipe.velocity && distance > this.config.swipe.threshold) return endEvent.velocity = velocity, endEvent.direction = calcDirection(prevMovePoint, lastMovePoint), this.triggerEvent("swipe", endEvent), this.cachedEvents = [], this.startPoints = [], void this.reset();
17543
17694
  }
17544
17695
  }
17545
- now - this.lastTapTime < this.config.tap.interval && ev.target === this.lastTapTarget ? this.tapCount++ : this.tapCount = 1, this.lastTapTime = now, this.lastTapTarget = ev.target, 1 === this.tapCount ? this.triggerEvent("tap", endEvent) : 2 === this.tapCount && (this.triggerEvent("doubletap", endEvent), this.tapCount = 0);
17696
+ now - this.startTime < this.config.press.time && (now - this.lastTapTime < this.config.tap.interval && ev.target === this.lastTapTarget ? this.tapCount++ : this.tapCount = 1, this.lastTapTime = now, this.lastTapTarget = ev.target, 1 === this.tapCount ? this.triggerEvent("tap", endEvent) : 2 === this.tapCount && (this.triggerEvent("doubletap", endEvent), this.tapCount = 0));
17546
17697
  }
17547
17698
  for (let i = 0, len = cachedEvents.length; i < len; i++) if (cachedEvents[i].pointerId === endEvent.pointerId) {
17548
17699
  cachedEvents.splice(i, 1), startPoints.splice(i, 1);
@@ -17618,6 +17769,7 @@
17618
17769
  emitThrottles: emitThrottles
17619
17770
  } = this;
17620
17771
  throttleTimer || (this.throttleTimer = application.global.getRequestAnimationFrame()(() => {
17772
+ application.global.getCancelAnimationFrame()(this.throttleTimer), this.throttleTimer = null;
17621
17773
  for (let i = 0, len = emitThrottles.length; i < len; i++) {
17622
17774
  const {
17623
17775
  type: type,
@@ -17625,7 +17777,7 @@
17625
17777
  } = emitThrottles[i];
17626
17778
  this.emitEvent(type, ev);
17627
17779
  }
17628
- this.throttleTimer = 0, this.emitThrottles.length = 0;
17780
+ this.emitThrottles.length = 0;
17629
17781
  }));
17630
17782
  }
17631
17783
  triggerStartEvent(type, ev) {
@@ -21618,21 +21770,23 @@
21618
21770
  axisLength: axisLength
21619
21771
  } = config;
21620
21772
  if (isEmpty(labels) || !isValidNumber$1(limitLength)) return;
21621
- const overflowLimitLength = normalizeOverflowLimitLength(config.overflowLimitLength);
21773
+ const overflowLimitLength = normalizeOverflowLimitLength(config.overflowLimitLength),
21774
+ firstLabel = labels[0],
21775
+ angle = firstLabel.attribute.angle,
21776
+ hasAngle = !isNil$1(angle),
21777
+ cos = hasAngle ? Math.cos(angle) : 1,
21778
+ sin = hasAngle ? Math.sin(angle) : 0,
21779
+ isHorizontal = isAngleHorizontal(angle),
21780
+ isVertical = isAngleVertical(angle),
21781
+ isX = "top" === orient || "bottom" === orient,
21782
+ direction = firstLabel.attribute.direction,
21783
+ checkBox = !isHorizontal && !isVertical && isX && (labels.length < 2 || labels.some(label => Math.abs(label.AABBBounds.width() - firstLabel.AABBBounds.width()) >= 2)) && firstLabel.AABBBounds.width() > Math.abs(limitLength / sin);
21622
21784
  labels.forEach(label => {
21623
21785
  var _a;
21624
- const angle = label.attribute.angle,
21625
- hasAngle = !isNil$1(angle),
21626
- cos = hasAngle ? Math.cos(angle) : 1,
21627
- sin = hasAngle ? Math.sin(angle) : 0,
21628
- isHorizontal = isAngleHorizontal(angle),
21629
- isVertical = isAngleVertical(angle),
21630
- isX = "top" === orient || "bottom" === orient;
21631
21786
  if (isX) {
21632
21787
  if (isVertical && Math.floor(label.AABBBounds.height()) <= limitLength) return;
21633
21788
  if (isHorizontal && Math.floor(label.AABBBounds.width()) <= verticalLimitLength) return;
21634
21789
  }
21635
- const direction = label.attribute.direction;
21636
21790
  if (!isX) {
21637
21791
  if ("vertical" === direction && Math.floor(label.AABBBounds.height()) <= verticalLimitLength) return;
21638
21792
  if ("vertical" !== direction) {
@@ -21648,11 +21802,11 @@
21648
21802
  } = label.AABBBounds,
21649
21803
  tan = sin / cos,
21650
21804
  verticalSizeLimit = Math.abs(limitLength / sin);
21651
- if (tan > 0 && x1 <= axisLength && limitLength / tan + x1 > axisLength) {
21652
- const lengthLimit = (axisLength - x1) / Math.abs(cos) + overflowLimitLength.right;
21805
+ if (checkBox && tan > 0 && x1 <= axisLength + overflowLimitLength.right && limitLength / tan + x1 > axisLength + overflowLimitLength.right) {
21806
+ const lengthLimit = (axisLength - x1 + overflowLimitLength.right) / Math.abs(cos);
21653
21807
  limitLabelLength = Math.min(lengthLimit, verticalSizeLimit);
21654
- } else if (tan < 0 && x2 >= 0 && limitLength / tan + x2 < 0) {
21655
- const lengthLimit = x2 / Math.abs(cos) + overflowLimitLength.left;
21808
+ } else if (checkBox && tan < 0 && x2 >= -overflowLimitLength.left && limitLength / tan + x2 < -overflowLimitLength.left) {
21809
+ const lengthLimit = (x2 + overflowLimitLength.left) / Math.abs(cos);
21656
21810
  limitLabelLength = Math.min(lengthLimit, verticalSizeLimit);
21657
21811
  } else limitLabelLength = verticalSizeLimit;
21658
21812
  } else limitLabelLength = Math.abs(limitLength / cos);
@@ -21671,30 +21825,40 @@
21671
21825
  orient: orient
21672
21826
  } = config;
21673
21827
  if (isEmpty(labels) || !isValidNumber$1(limitLength)) return;
21674
- const verticalLimitLength = axisLength / labels.length;
21675
- labels.forEach(label => {
21676
- var _a;
21677
- const angle = label.attribute.angle,
21678
- isHorizontal = isAngleHorizontal(angle),
21679
- isVertical = isAngleVertical(angle),
21680
- isX = "top" === orient || "bottom" === orient;
21828
+ const angle = labels[0].attribute.angle,
21829
+ isHorizontal = isAngleHorizontal(angle),
21830
+ isVertical = isAngleVertical(angle),
21831
+ isX = "top" === orient || "bottom" === orient;
21832
+ let verticalLimitLength = axisLength / labels.length;
21833
+ labels.forEach((label, index) => {
21834
+ var _a, _b, _c, _d, _e;
21681
21835
  if (isX) {
21682
21836
  if (isVertical && Math.floor(label.AABBBounds.height()) <= limitLength) return;
21683
- if (isHorizontal && Math.floor(label.AABBBounds.width()) <= verticalLimitLength) return;
21837
+ if (isHorizontal) {
21838
+ const minGap = getLabelMinGap(label.attribute.x, null === (_a = labels[index + 1]) || void 0 === _a ? void 0 : _a.attribute.x, null === (_b = labels[index - 1]) || void 0 === _b ? void 0 : _b.attribute.x);
21839
+ isValidNumber$1(minGap) && (verticalLimitLength = min(verticalLimitLength, minGap));
21840
+ }
21684
21841
  } else {
21685
- if (isVertical && Math.floor(label.AABBBounds.height()) <= verticalLimitLength) return;
21842
+ if (isVertical) {
21843
+ const minGap = getLabelMinGap(label.attribute.y, null === (_c = labels[index + 1]) || void 0 === _c ? void 0 : _c.attribute.y, null === (_d = labels[index - 1]) || void 0 === _d ? void 0 : _d.attribute.y);
21844
+ isValidNumber$1(minGap) && (verticalLimitLength = min(verticalLimitLength, minGap));
21845
+ }
21686
21846
  if (isHorizontal && Math.floor(label.AABBBounds.width()) <= limitLength) return;
21687
21847
  }
21688
21848
  let limitLabelLength = null,
21689
21849
  heightLimit = null;
21690
21850
  isX ? isVertical ? (limitLabelLength = limitLength, heightLimit = verticalLimitLength) : (limitLabelLength = verticalLimitLength, heightLimit = limitLength) : isVertical ? (limitLabelLength = verticalLimitLength, heightLimit = limitLength) : (limitLabelLength = limitLength, heightLimit = verticalLimitLength), label.setAttributes({
21691
21851
  maxLineWidth: limitLabelLength,
21692
- ellipsis: null !== (_a = label.attribute.ellipsis) && void 0 !== _a ? _a : ellipsis,
21852
+ ellipsis: null !== (_e = label.attribute.ellipsis) && void 0 !== _e ? _e : ellipsis,
21693
21853
  whiteSpace: "normal",
21694
21854
  heightLimit: heightLimit
21695
21855
  });
21696
21856
  });
21697
21857
  }
21858
+ function getLabelMinGap(current, next, prev) {
21859
+ let minGap;
21860
+ return isValidNumber$1(next) && (minGap = Math.abs(next - current)), isValidNumber$1(prev) && (minGap = isValidNumber$1(minGap) ? Math.min(Math.abs(current - prev), minGap) : Math.abs(current - prev)), minGap;
21861
+ }
21698
21862
 
21699
21863
  function alignAxisLabels(labels, start, containerSize, orient, align) {
21700
21864
  "left" === orient || "right" === orient ? "left" === align ? labels.forEach(label => {
@@ -23698,20 +23862,20 @@
23698
23862
  render() {
23699
23863
  this.removeAllChild(!0);
23700
23864
  const {
23701
- interactive = !0,
23702
- title: title,
23703
- padding = 0
23704
- } = this.attribute,
23705
- parsedPadding = normalizePadding(padding),
23706
- innerView = graphicCreator.group({
23707
- x: parsedPadding[3],
23708
- y: parsedPadding[0],
23709
- pickable: interactive,
23710
- childrenPickable: interactive
23711
- });
23865
+ interactive = !0,
23866
+ title: title,
23867
+ padding = 0
23868
+ } = this.attribute;
23869
+ this._parsedPadding = normalizePadding(padding);
23870
+ const innerView = graphicCreator.group({
23871
+ x: this._parsedPadding[3],
23872
+ y: this._parsedPadding[0],
23873
+ pickable: interactive,
23874
+ childrenPickable: interactive
23875
+ });
23712
23876
  innerView.name = LEGEND_ELEMENT_NAME.innerView, this.add(innerView), this._innerView = innerView, (null == title ? void 0 : title.visible) && this._renderTitle(title), this._renderContent(), this._adjustLayout(), interactive && this._bindEvents();
23713
23877
  const viewBounds = this._innerView.AABBBounds;
23714
- this.attribute.width = viewBounds.width() + parsedPadding[1] + parsedPadding[3], this.attribute.height = viewBounds.height() + parsedPadding[0] + parsedPadding[2];
23878
+ this.attribute.width = viewBounds.width() + this._parsedPadding[1] + this._parsedPadding[3], this.attribute.height = viewBounds.height() + this._parsedPadding[0] + this._parsedPadding[2];
23715
23879
  }
23716
23880
  _renderTitle(title) {
23717
23881
  const {
@@ -23787,7 +23951,7 @@
23787
23951
  loadDiscreteLegendComponent();
23788
23952
  class DiscreteLegend extends LegendBase {
23789
23953
  constructor(attributes, options) {
23790
- super((null == options ? void 0 : options.skipDefault) ? attributes : merge({}, DiscreteLegend.defaultAttributes, attributes)), this.name = "discreteLegend", this._itemsContainer = null, this._itemHeightByUser = void 0, this._itemHeight = 0, this._itemMaxWidth = 0, this._onHover = e => {
23954
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge({}, DiscreteLegend.defaultAttributes, attributes)), this.name = "discreteLegend", this._itemsContainer = null, this._itemHeightByUser = void 0, this._itemHeight = 0, this._itemMaxWidth = 0, this._contentMaxHeight = 0, this._onHover = e => {
23791
23955
  const target = e.target;
23792
23956
  if (target && target.name && target.name.startsWith(LEGEND_ELEMENT_NAME.item)) {
23793
23957
  const legendItem = target.delegate;
@@ -23850,7 +24014,6 @@
23850
24014
  maxCol = 1,
23851
24015
  maxRow = 2,
23852
24016
  maxWidth: maxWidth,
23853
- maxHeight: maxHeight,
23854
24017
  defaultSelected: defaultSelected,
23855
24018
  lazyload: lazyload,
23856
24019
  autoPage: autoPage
@@ -23866,7 +24029,8 @@
23866
24029
  startIndex: startIndex,
23867
24030
  isScrollbar: isScrollbar
23868
24031
  } = this._itemContext,
23869
- maxPages = isScrollbar ? 1 : isHorizontal ? maxRow : maxCol;
24032
+ maxPages = isScrollbar ? 1 : isHorizontal ? maxRow : maxCol,
24033
+ maxHeight = this._contentMaxHeight;
23870
24034
  let item,
23871
24035
  {
23872
24036
  doWrap: doWrap,
@@ -23898,11 +24062,12 @@
23898
24062
  item = {},
23899
24063
  items: items,
23900
24064
  reversed: reversed,
23901
- maxWidth: maxWidth
24065
+ maxWidth: maxWidth,
24066
+ maxHeight: maxHeight
23902
24067
  } = this.attribute;
23903
24068
  if (!1 === item.visible || isEmpty(items)) return;
23904
24069
  let legendItems = items;
23905
- reversed && (legendItems = null == items ? void 0 : items.reverse());
24070
+ reversed && (legendItems = null == items ? void 0 : items.reverse()), this._contentMaxHeight = Math.max(0, maxHeight - this._parsedPadding[0] - this._parsedPadding[2]);
23906
24071
  const itemsContainer = graphicCreator.group({
23907
24072
  x: 0,
23908
24073
  y: 0
@@ -23933,7 +24098,8 @@
23933
24098
  items: legendItems,
23934
24099
  isHorizontal: isHorizontal,
23935
24100
  totalPage: 1 / 0,
23936
- isScrollbar: pager && "scrollbar" === pager.type
24101
+ isScrollbar: pager && "scrollbar" === pager.type,
24102
+ clipContainer: void 0
23937
24103
  }, this._itemContext = this._renderItems();
23938
24104
  let pagerRendered = !1;
23939
24105
  this._itemContext.doWrap && autoPage && this._itemContext.pages > this._itemContext.maxPages && (pagerRendered = this._renderPagerComponent()), pagerRendered || (itemsContainer.setAttribute("y", this._title ? this._title.AABBBounds.height() + get$5(this.attribute, "title.space", 8) : 0), this._innerView.add(itemsContainer));
@@ -23945,7 +24111,15 @@
23945
24111
  hover = !0,
23946
24112
  select = !0
23947
24113
  } = this.attribute;
23948
- hover && (this._itemsContainer.addEventListener("pointermove", this._onHover), this._itemsContainer.addEventListener("pointerleave", this._onUnHover)), select && this._itemsContainer.addEventListener("pointerdown", this._onClick);
24114
+ if (hover) {
24115
+ let trigger = "pointermove",
24116
+ triggerOff = "pointerleave";
24117
+ isObject$4(hover) && (hover.trigger && (trigger = hover.trigger), hover.triggerOff && (triggerOff = hover.triggerOff)), this._itemsContainer.addEventListener(trigger, this._onHover), this._itemsContainer.addEventListener(triggerOff, this._onUnHover);
24118
+ }
24119
+ if (select) {
24120
+ let trigger = "pointerdown";
24121
+ isObject$4(select) && select.trigger && (trigger = select.trigger), this._itemsContainer.addEventListener(trigger, this._onClick);
24122
+ }
23949
24123
  }
23950
24124
  _autoEllipsis(autoEllipsisStrategy, layoutWidth, labelShape, valueShape) {
23951
24125
  var _a, _b;
@@ -24120,12 +24294,12 @@
24120
24294
  direction: "horizontal",
24121
24295
  disableTriggerEvent: disableTriggerEvent,
24122
24296
  range: [0, .5],
24123
- height: 12
24297
+ height: !1 === compStyle.visible ? 0 : 12
24124
24298
  }, compStyle), {
24125
24299
  width: compSize
24126
24300
  })) : new ScrollBar(Object.assign(Object.assign({
24127
24301
  direction: "vertical",
24128
- width: 12,
24302
+ width: !1 === compStyle.visible ? 0 : 12,
24129
24303
  range: [0, .5]
24130
24304
  }, compStyle), {
24131
24305
  height: compSize,
@@ -24155,13 +24329,24 @@
24155
24329
  });
24156
24330
  }
24157
24331
  }
24332
+ _computeScrollbarDelta() {
24333
+ const {
24334
+ isHorizontal: isHorizontal,
24335
+ clipContainer: clipContainer
24336
+ } = this._itemContext,
24337
+ itemContainerBounds = this._itemsContainer.AABBBounds,
24338
+ clipContainerBounds = clipContainer.AABBBounds;
24339
+ let delta, innerViewSize;
24340
+ return isHorizontal ? (innerViewSize = clipContainerBounds.width(), delta = innerViewSize / itemContainerBounds.width()) : (innerViewSize = clipContainerBounds.height(), delta = innerViewSize / itemContainerBounds.height()), delta;
24341
+ }
24158
24342
  _updatePositionOfScrollbar(contentWidth, contentHeight, renderStartY) {
24159
24343
  const {
24160
- currentPage: currentPage,
24161
- totalPage: totalPage,
24162
- isHorizontal: isHorizontal
24163
- } = this._itemContext;
24164
- this._pagerComponent.setScrollRange([(currentPage - 1) / totalPage, currentPage / totalPage]), isHorizontal ? this._pagerComponent.setAttributes({
24344
+ isHorizontal: isHorizontal,
24345
+ currentPage: currentPage,
24346
+ totalPage: totalPage
24347
+ } = this._itemContext,
24348
+ start = (currentPage - 1) / totalPage;
24349
+ this._pagerComponent.setScrollRange([start, start + this._computeScrollbarDelta()]), isHorizontal ? this._pagerComponent.setAttributes({
24165
24350
  x: 0,
24166
24351
  y: renderStartY + contentHeight
24167
24352
  }) : this._pagerComponent.setAttributes({
@@ -24181,7 +24366,7 @@
24181
24366
  value: value
24182
24367
  } = e.detail;
24183
24368
  let newPage;
24184
- return 0 === value[0] ? newPage = 1 : 1 === value[1] ? newPage = this._itemContext.totalPage : (newPage = value[0] * this._itemContext.totalPage, pager.scrollByPosition ? newPage += 1 : newPage = Math.floor(newPage) + 1), newPage;
24369
+ return newPage = 0 === value[0] ? 1 : 1 === value[1] ? this._itemContext.totalPage : value[0] * this._itemContext.totalPage + 1, newPage;
24185
24370
  } : e => e.detail.current,
24186
24371
  onScroll = e => {
24187
24372
  const scrollComponent = this._pagerComponent,
@@ -24194,7 +24379,7 @@
24194
24379
  height: height
24195
24380
  } = scrollComponent.getSliderRenderBounds(),
24196
24381
  currentScrollValue = "vertical" === direction ? e.deltaY / height : e.deltaX / width;
24197
- scrollComponent.setScrollRange([preScrollRange[0] + currentScrollValue, preScrollRange[1] + currentScrollValue], !0);
24382
+ scrollComponent.setScrollRange([preScrollRange[0] + currentScrollValue, preScrollRange[1] + currentScrollValue], !0), this.updateScrollMask();
24198
24383
  },
24199
24384
  onPaging = e => {
24200
24385
  const newPage = pageParser(e);
@@ -24202,9 +24387,21 @@
24202
24387
  if (this._itemContext.currentPage = newPage, this._itemContext && this._itemContext.startIndex < this._itemContext.items.length) {
24203
24388
  this._renderItems();
24204
24389
  const newTotalPage = Math.ceil(this._itemContext.pages / this._itemContext.maxPages);
24205
- this._itemContext.totalPage = newTotalPage, this._pagerComponent.setScrollRange([(newPage - 1) / newTotalPage, newPage / newTotalPage]);
24390
+ if (this._itemContext.totalPage = newTotalPage, this._itemContext.isScrollbar && this._pagerComponent) {
24391
+ const newDelta = this._computeScrollbarDelta(),
24392
+ [start] = this._pagerComponent.getScrollRange();
24393
+ this._pagerComponent.setScrollRange([start, start + newDelta]);
24394
+ }
24206
24395
  }
24207
- animation ? this._itemsContainer.animate().to({
24396
+ if (this._itemContext.isScrollbar) {
24397
+ const [start] = this._pagerComponent.getScrollRange();
24398
+ let containerSize;
24399
+ containerSize = this._itemContext.isHorizontal ? this._itemsContainer.AABBBounds.width() : this._itemsContainer.AABBBounds.height();
24400
+ const startOffset = containerSize * start;
24401
+ this.updateScrollMask(), animation ? this._itemsContainer.animate().to({
24402
+ [channel]: -startOffset
24403
+ }, animationDuration, animationEasing) : this._itemsContainer.setAttribute(channel, -startOffset);
24404
+ } else animation ? this._itemsContainer.animate().to({
24208
24405
  [channel]: -(newPage - 1) * pageSize
24209
24406
  }, animationDuration, animationEasing) : this._itemsContainer.setAttribute(channel, -(newPage - 1) * pageSize);
24210
24407
  }
@@ -24220,7 +24417,6 @@
24220
24417
  const renderStartY = this._title ? this._title.AABBBounds.height() + get$5(this.attribute, "title.space", 8) : 0,
24221
24418
  {
24222
24419
  maxWidth: maxWidth,
24223
- maxHeight: maxHeight,
24224
24420
  maxCol = 1,
24225
24421
  maxRow = 2,
24226
24422
  item = {},
@@ -24238,7 +24434,8 @@
24238
24434
  compStyle = __rest(pager, ["space", "defaultCurrent"]),
24239
24435
  {
24240
24436
  isHorizontal: isHorizontal
24241
- } = this._itemContext;
24437
+ } = this._itemContext,
24438
+ maxHeight = this._contentMaxHeight;
24242
24439
  let comp,
24243
24440
  compWidth = 0,
24244
24441
  compHeight = 0,
@@ -24284,13 +24481,13 @@
24284
24481
  clip: !0,
24285
24482
  pickable: !1
24286
24483
  });
24287
- return clipGroup.add(itemsContainer), this._innerView.add(clipGroup), this._bindEventsOfPager(isHorizontal ? compHeight + spaceRow : compWidth + spaceCol, isHorizontal ? "y" : "x"), !0;
24484
+ return clipGroup.add(itemsContainer), this._innerView.add(clipGroup), this._itemContext.clipContainer = clipGroup, this._bindEventsOfPager(isHorizontal ? compHeight + spaceRow : compWidth + spaceCol, isHorizontal ? "y" : "x"), !0;
24288
24485
  }
24289
24486
  _renderScrollbar() {
24487
+ var _a;
24290
24488
  const renderStartY = this._title ? this._title.AABBBounds.height() + get$5(this.attribute, "title.space", 8) : 0,
24291
24489
  {
24292
24490
  maxWidth: maxWidth,
24293
- maxHeight: maxHeight,
24294
24491
  item = {},
24295
24492
  pager = {}
24296
24493
  } = this.attribute,
@@ -24306,23 +24503,39 @@
24306
24503
  compStyle = __rest(pager, ["space", "defaultCurrent"]),
24307
24504
  {
24308
24505
  isHorizontal: isHorizontal
24309
- } = this._itemContext;
24506
+ } = this._itemContext,
24507
+ maxHeight = this._contentMaxHeight;
24310
24508
  let comp,
24311
- compSize = 0,
24312
24509
  contentWidth = 0,
24313
24510
  contentHeight = 0,
24314
24511
  startY = 0,
24315
24512
  pages = 1;
24316
- if (isHorizontal) compSize = maxWidth, contentWidth = maxWidth, contentHeight = this._itemHeight, comp = this._createScrollbar(compStyle, compSize), this._pagerComponent = comp, this._innerView.add(comp), this._updatePositionOfScrollbar(contentWidth, contentHeight, renderStartY);else {
24317
- if (compSize = maxHeight, comp = this._createScrollbar(compStyle, compSize), this._pagerComponent = comp, this._innerView.add(comp), contentHeight = maxHeight - renderStartY, contentWidth = this._itemMaxWidth, contentHeight <= 0) return this._innerView.removeChild(comp), !1;
24318
- itemsContainer.getChildren().forEach((item, index) => {
24513
+ if (isHorizontal) contentWidth = maxWidth, contentHeight = this._itemHeight, comp = this._createScrollbar(compStyle, contentWidth), this._pagerComponent = comp, this._innerView.add(comp);else {
24514
+ if (contentHeight = maxHeight - renderStartY, contentWidth = this._itemMaxWidth, comp = this._createScrollbar(compStyle, contentHeight), this._pagerComponent = comp, this._innerView.add(comp), contentHeight <= 0) return this._innerView.removeChild(comp), !1;
24515
+ const items = itemsContainer.getChildren(),
24516
+ itemsHeightArr = items.map(item => item.attribute.height);
24517
+ if (1 === itemsHeightArr.length || itemsHeightArr.every(entry => entry === itemsHeightArr[0])) {
24518
+ const itemHeight = itemsHeightArr[0],
24519
+ maxContentHeight = contentHeight,
24520
+ pageItemsCount = Math.floor(maxContentHeight / (spaceRow + itemHeight));
24521
+ contentHeight = pageItemsCount * (spaceRow + itemHeight), pages = Math.ceil(items.length / pageItemsCount);
24522
+ } else items.forEach((item, index) => {
24319
24523
  const {
24320
- height: height
24321
- } = item.attribute;
24322
- pages = Math.floor((startY + height) / contentHeight) + 1, startY += spaceRow + height;
24323
- }), this._itemContext.totalPage = pages, this._itemContext.pages = pages, this._updatePositionOfScrollbar(contentWidth, contentHeight, renderStartY);
24524
+ height: height
24525
+ } = item.attribute,
24526
+ prePages = pages,
24527
+ preStartY = startY;
24528
+ pages = Math.floor((startY + height) / contentHeight) + 1, startY += spaceRow + height, prePages !== pages && index === itemsContainer.getChildren().length - 1 && startY - contentHeight >= 1 / 3 * height && (contentHeight = preStartY + height, pages -= 1);
24529
+ });
24530
+ this._itemContext.totalPage = pages, this._itemContext.pages = pages;
24531
+ }
24532
+ if (defaultCurrent > 1) if (isHorizontal) {
24533
+ const maxOffset = this._itemsContainer.AABBBounds.width() - contentWidth;
24534
+ itemsContainer.setAttribute("x", -Math.min((defaultCurrent - 1) * (contentWidth + spaceCol), maxOffset));
24535
+ } else {
24536
+ const maxOffset = this._itemsContainer.AABBBounds.height() - contentHeight;
24537
+ itemsContainer.setAttribute("y", -Math.min((defaultCurrent - 1) * (contentHeight + spaceRow), maxOffset));
24324
24538
  }
24325
- defaultCurrent > 1 && (isHorizontal ? itemsContainer.setAttribute("x", -(defaultCurrent - 1) * (contentWidth + spaceCol)) : itemsContainer.setAttribute("y", -(defaultCurrent - 1) * (contentHeight + spaceRow)));
24326
24539
  const clipGroup = graphicCreator.group({
24327
24540
  x: 0,
24328
24541
  y: renderStartY,
@@ -24331,7 +24544,64 @@
24331
24544
  clip: !0,
24332
24545
  pickable: !1
24333
24546
  });
24334
- return clipGroup.add(itemsContainer), this._innerView.add(clipGroup), this._bindEventsOfPager(isHorizontal ? contentWidth : contentHeight, isHorizontal ? "x" : "y"), !0;
24547
+ return clipGroup.add(itemsContainer), this._innerView.add(clipGroup), this._itemContext.clipContainer = clipGroup, this._updatePositionOfScrollbar(contentWidth, contentHeight, renderStartY), (null === (_a = pager.scrollMask) || void 0 === _a ? void 0 : _a.visible) && this.renderScrollMask(clipGroup), this._bindEventsOfPager(isHorizontal ? contentWidth : contentHeight, isHorizontal ? "x" : "y"), !0;
24548
+ }
24549
+ renderScrollMask(clipGroup) {
24550
+ const {
24551
+ scrollMask = {}
24552
+ } = this.attribute.pager,
24553
+ {
24554
+ visible = !0,
24555
+ gradientLength = 16,
24556
+ gradientStops: gradientStops
24557
+ } = scrollMask;
24558
+ if (!visible || !gradientStops) return;
24559
+ const width = clipGroup.AABBBounds.width(),
24560
+ height = clipGroup.AABBBounds.height(),
24561
+ totalLength = this._itemContext.isHorizontal ? width : height,
24562
+ startStops = gradientStops.map(stop => ({
24563
+ offset: gradientLength * stop.offset / totalLength,
24564
+ color: stop.color
24565
+ })),
24566
+ endStops = gradientStops.map(stop => ({
24567
+ offset: (totalLength - gradientLength * stop.offset) / totalLength,
24568
+ color: stop.color
24569
+ })),
24570
+ mask = graphicCreator.rect({
24571
+ x: 0,
24572
+ y: 0,
24573
+ width: width,
24574
+ height: height
24575
+ });
24576
+ this._scrollMask = mask, this._scrollMaskContext = {
24577
+ startStops: startStops,
24578
+ endStops: endStops
24579
+ }, this.updateScrollMask(), clipGroup.add(mask);
24580
+ }
24581
+ updateScrollMask() {
24582
+ if (!this._scrollMask || !this._pagerComponent) return;
24583
+ if (!this._itemContext.isScrollbar) return;
24584
+ const [start, end] = this._pagerComponent.getScrollRange(),
24585
+ stops = [];
24586
+ isNumberClose(clamp$1(end, 0, 1), 1) || stops.push(...this._scrollMaskContext.endStops), isNumberClose(clamp$1(start, 0, 1), 0) || stops.push(...this._scrollMaskContext.startStops), stops.length && (this._itemContext.isHorizontal ? this._scrollMask.setAttributes({
24587
+ fill: {
24588
+ gradient: "linear",
24589
+ x0: 0,
24590
+ y0: 0,
24591
+ x1: 1,
24592
+ y1: 0,
24593
+ stops: stops
24594
+ }
24595
+ }) : this._scrollMask.setAttributes({
24596
+ fill: {
24597
+ gradient: "linear",
24598
+ x0: 0,
24599
+ y0: 0,
24600
+ x1: 0,
24601
+ y1: 1,
24602
+ stops: stops
24603
+ }
24604
+ }));
24335
24605
  }
24336
24606
  _renderPagerComponent() {
24337
24607
  return this._itemContext.isScrollbar ? this._renderScrollbar() : this._renderPager(), !0;
@@ -25888,6 +26158,598 @@
25888
26158
  }
25889
26159
  };
25890
26160
 
26161
+ var lib$1 = {};
26162
+
26163
+ var gif = {};
26164
+
26165
+ var lib = {};
26166
+
26167
+ Object.defineProperty(lib, "__esModule", {
26168
+ value: true
26169
+ });
26170
+ lib.loop = lib.conditional = lib.parse = void 0;
26171
+ var parse$3 = function parse(stream, schema) {
26172
+ var result = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
26173
+ var parent = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : result;
26174
+ if (Array.isArray(schema)) {
26175
+ schema.forEach(function (partSchema) {
26176
+ return parse(stream, partSchema, result, parent);
26177
+ });
26178
+ } else if (typeof schema === 'function') {
26179
+ schema(stream, result, parent, parse);
26180
+ } else {
26181
+ var key = Object.keys(schema)[0];
26182
+ if (Array.isArray(schema[key])) {
26183
+ parent[key] = {};
26184
+ parse(stream, schema[key], result, parent[key]);
26185
+ } else {
26186
+ parent[key] = schema[key](stream, result, parent, parse);
26187
+ }
26188
+ }
26189
+ return result;
26190
+ };
26191
+ lib.parse = parse$3;
26192
+ var conditional = function conditional(schema, conditionFunc) {
26193
+ return function (stream, result, parent, parse) {
26194
+ if (conditionFunc(stream, result, parent)) {
26195
+ parse(stream, schema, result, parent);
26196
+ }
26197
+ };
26198
+ };
26199
+ lib.conditional = conditional;
26200
+ var loop = function loop(schema, continueFunc) {
26201
+ return function (stream, result, parent, parse) {
26202
+ var arr = [];
26203
+ var lastStreamPos = stream.pos;
26204
+ while (continueFunc(stream, result, parent)) {
26205
+ var newParent = {};
26206
+ parse(stream, schema, result, newParent); // cases when whole file is parsed but no termination is there and stream position is not getting updated as well
26207
+ // it falls into infinite recursion, null check to avoid the same
26208
+
26209
+ if (stream.pos === lastStreamPos) {
26210
+ break;
26211
+ }
26212
+ lastStreamPos = stream.pos;
26213
+ arr.push(newParent);
26214
+ }
26215
+ return arr;
26216
+ };
26217
+ };
26218
+ lib.loop = loop;
26219
+
26220
+ var uint8 = {};
26221
+
26222
+ Object.defineProperty(uint8, "__esModule", {
26223
+ value: true
26224
+ });
26225
+ uint8.readBits = uint8.readArray = uint8.readUnsigned = uint8.readString = uint8.peekBytes = uint8.readBytes = uint8.peekByte = uint8.readByte = uint8.buildStream = void 0;
26226
+
26227
+ // Default stream and parsers for Uint8TypedArray data type
26228
+ var buildStream = function buildStream(uint8Data) {
26229
+ return {
26230
+ data: uint8Data,
26231
+ pos: 0
26232
+ };
26233
+ };
26234
+ uint8.buildStream = buildStream;
26235
+ var readByte = function readByte() {
26236
+ return function (stream) {
26237
+ return stream.data[stream.pos++];
26238
+ };
26239
+ };
26240
+ uint8.readByte = readByte;
26241
+ var peekByte = function peekByte() {
26242
+ var offset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
26243
+ return function (stream) {
26244
+ return stream.data[stream.pos + offset];
26245
+ };
26246
+ };
26247
+ uint8.peekByte = peekByte;
26248
+ var readBytes = function readBytes(length) {
26249
+ return function (stream) {
26250
+ return stream.data.subarray(stream.pos, stream.pos += length);
26251
+ };
26252
+ };
26253
+ uint8.readBytes = readBytes;
26254
+ var peekBytes = function peekBytes(length) {
26255
+ return function (stream) {
26256
+ return stream.data.subarray(stream.pos, stream.pos + length);
26257
+ };
26258
+ };
26259
+ uint8.peekBytes = peekBytes;
26260
+ var readString = function readString(length) {
26261
+ return function (stream) {
26262
+ return Array.from(readBytes(length)(stream)).map(function (value) {
26263
+ return String.fromCharCode(value);
26264
+ }).join('');
26265
+ };
26266
+ };
26267
+ uint8.readString = readString;
26268
+ var readUnsigned = function readUnsigned(littleEndian) {
26269
+ return function (stream) {
26270
+ var bytes = readBytes(2)(stream);
26271
+ return littleEndian ? (bytes[1] << 8) + bytes[0] : (bytes[0] << 8) + bytes[1];
26272
+ };
26273
+ };
26274
+ uint8.readUnsigned = readUnsigned;
26275
+ var readArray = function readArray(byteSize, totalOrFunc) {
26276
+ return function (stream, result, parent) {
26277
+ var total = typeof totalOrFunc === 'function' ? totalOrFunc(stream, result, parent) : totalOrFunc;
26278
+ var parser = readBytes(byteSize);
26279
+ var arr = new Array(total);
26280
+ for (var i = 0; i < total; i++) {
26281
+ arr[i] = parser(stream);
26282
+ }
26283
+ return arr;
26284
+ };
26285
+ };
26286
+ uint8.readArray = readArray;
26287
+ var subBitsTotal = function subBitsTotal(bits, startIndex, length) {
26288
+ var result = 0;
26289
+ for (var i = 0; i < length; i++) {
26290
+ result += bits[startIndex + i] && Math.pow(2, length - i - 1);
26291
+ }
26292
+ return result;
26293
+ };
26294
+ var readBits = function readBits(schema) {
26295
+ return function (stream) {
26296
+ var _byte = readByte()(stream); // convert the byte to bit array
26297
+
26298
+ var bits = new Array(8);
26299
+ for (var i = 0; i < 8; i++) {
26300
+ bits[7 - i] = !!(_byte & 1 << i);
26301
+ } // convert the bit array to values based on the schema
26302
+
26303
+ return Object.keys(schema).reduce(function (res, key) {
26304
+ var def = schema[key];
26305
+ if (def.length) {
26306
+ res[key] = subBitsTotal(bits, def.index, def.length);
26307
+ } else {
26308
+ res[key] = bits[def.index];
26309
+ }
26310
+ return res;
26311
+ }, {});
26312
+ };
26313
+ };
26314
+ uint8.readBits = readBits;
26315
+
26316
+ (function (exports) {
26317
+
26318
+ Object.defineProperty(exports, "__esModule", {
26319
+ value: true
26320
+ });
26321
+ exports["default"] = void 0;
26322
+ var _ = lib;
26323
+ var _uint = uint8;
26324
+
26325
+ // a set of 0x00 terminated subblocks
26326
+ var subBlocksSchema = {
26327
+ blocks: function blocks(stream) {
26328
+ var terminator = 0x00;
26329
+ var chunks = [];
26330
+ var streamSize = stream.data.length;
26331
+ var total = 0;
26332
+ for (var size = (0, _uint.readByte)()(stream); size !== terminator; size = (0, _uint.readByte)()(stream)) {
26333
+ // size becomes undefined for some case when file is corrupted and terminator is not proper
26334
+ // null check to avoid recursion
26335
+ if (!size) break; // catch corrupted files with no terminator
26336
+
26337
+ if (stream.pos + size >= streamSize) {
26338
+ var availableSize = streamSize - stream.pos;
26339
+ chunks.push((0, _uint.readBytes)(availableSize)(stream));
26340
+ total += availableSize;
26341
+ break;
26342
+ }
26343
+ chunks.push((0, _uint.readBytes)(size)(stream));
26344
+ total += size;
26345
+ }
26346
+ var result = new Uint8Array(total);
26347
+ var offset = 0;
26348
+ for (var i = 0; i < chunks.length; i++) {
26349
+ result.set(chunks[i], offset);
26350
+ offset += chunks[i].length;
26351
+ }
26352
+ return result;
26353
+ }
26354
+ }; // global control extension
26355
+
26356
+ var gceSchema = (0, _.conditional)({
26357
+ gce: [{
26358
+ codes: (0, _uint.readBytes)(2)
26359
+ }, {
26360
+ byteSize: (0, _uint.readByte)()
26361
+ }, {
26362
+ extras: (0, _uint.readBits)({
26363
+ future: {
26364
+ index: 0,
26365
+ length: 3
26366
+ },
26367
+ disposal: {
26368
+ index: 3,
26369
+ length: 3
26370
+ },
26371
+ userInput: {
26372
+ index: 6
26373
+ },
26374
+ transparentColorGiven: {
26375
+ index: 7
26376
+ }
26377
+ })
26378
+ }, {
26379
+ delay: (0, _uint.readUnsigned)(true)
26380
+ }, {
26381
+ transparentColorIndex: (0, _uint.readByte)()
26382
+ }, {
26383
+ terminator: (0, _uint.readByte)()
26384
+ }]
26385
+ }, function (stream) {
26386
+ var codes = (0, _uint.peekBytes)(2)(stream);
26387
+ return codes[0] === 0x21 && codes[1] === 0xf9;
26388
+ }); // image pipeline block
26389
+
26390
+ var imageSchema = (0, _.conditional)({
26391
+ image: [{
26392
+ code: (0, _uint.readByte)()
26393
+ }, {
26394
+ descriptor: [{
26395
+ left: (0, _uint.readUnsigned)(true)
26396
+ }, {
26397
+ top: (0, _uint.readUnsigned)(true)
26398
+ }, {
26399
+ width: (0, _uint.readUnsigned)(true)
26400
+ }, {
26401
+ height: (0, _uint.readUnsigned)(true)
26402
+ }, {
26403
+ lct: (0, _uint.readBits)({
26404
+ exists: {
26405
+ index: 0
26406
+ },
26407
+ interlaced: {
26408
+ index: 1
26409
+ },
26410
+ sort: {
26411
+ index: 2
26412
+ },
26413
+ future: {
26414
+ index: 3,
26415
+ length: 2
26416
+ },
26417
+ size: {
26418
+ index: 5,
26419
+ length: 3
26420
+ }
26421
+ })
26422
+ }]
26423
+ }, (0, _.conditional)({
26424
+ lct: (0, _uint.readArray)(3, function (stream, result, parent) {
26425
+ return Math.pow(2, parent.descriptor.lct.size + 1);
26426
+ })
26427
+ }, function (stream, result, parent) {
26428
+ return parent.descriptor.lct.exists;
26429
+ }), {
26430
+ data: [{
26431
+ minCodeSize: (0, _uint.readByte)()
26432
+ }, subBlocksSchema]
26433
+ }]
26434
+ }, function (stream) {
26435
+ return (0, _uint.peekByte)()(stream) === 0x2c;
26436
+ }); // plain text block
26437
+
26438
+ var textSchema = (0, _.conditional)({
26439
+ text: [{
26440
+ codes: (0, _uint.readBytes)(2)
26441
+ }, {
26442
+ blockSize: (0, _uint.readByte)()
26443
+ }, {
26444
+ preData: function preData(stream, result, parent) {
26445
+ return (0, _uint.readBytes)(parent.text.blockSize)(stream);
26446
+ }
26447
+ }, subBlocksSchema]
26448
+ }, function (stream) {
26449
+ var codes = (0, _uint.peekBytes)(2)(stream);
26450
+ return codes[0] === 0x21 && codes[1] === 0x01;
26451
+ }); // application block
26452
+
26453
+ var applicationSchema = (0, _.conditional)({
26454
+ application: [{
26455
+ codes: (0, _uint.readBytes)(2)
26456
+ }, {
26457
+ blockSize: (0, _uint.readByte)()
26458
+ }, {
26459
+ id: function id(stream, result, parent) {
26460
+ return (0, _uint.readString)(parent.blockSize)(stream);
26461
+ }
26462
+ }, subBlocksSchema]
26463
+ }, function (stream) {
26464
+ var codes = (0, _uint.peekBytes)(2)(stream);
26465
+ return codes[0] === 0x21 && codes[1] === 0xff;
26466
+ }); // comment block
26467
+
26468
+ var commentSchema = (0, _.conditional)({
26469
+ comment: [{
26470
+ codes: (0, _uint.readBytes)(2)
26471
+ }, subBlocksSchema]
26472
+ }, function (stream) {
26473
+ var codes = (0, _uint.peekBytes)(2)(stream);
26474
+ return codes[0] === 0x21 && codes[1] === 0xfe;
26475
+ });
26476
+ var schema = [{
26477
+ header: [{
26478
+ signature: (0, _uint.readString)(3)
26479
+ }, {
26480
+ version: (0, _uint.readString)(3)
26481
+ }]
26482
+ }, {
26483
+ lsd: [{
26484
+ width: (0, _uint.readUnsigned)(true)
26485
+ }, {
26486
+ height: (0, _uint.readUnsigned)(true)
26487
+ }, {
26488
+ gct: (0, _uint.readBits)({
26489
+ exists: {
26490
+ index: 0
26491
+ },
26492
+ resolution: {
26493
+ index: 1,
26494
+ length: 3
26495
+ },
26496
+ sort: {
26497
+ index: 4
26498
+ },
26499
+ size: {
26500
+ index: 5,
26501
+ length: 3
26502
+ }
26503
+ })
26504
+ }, {
26505
+ backgroundColorIndex: (0, _uint.readByte)()
26506
+ }, {
26507
+ pixelAspectRatio: (0, _uint.readByte)()
26508
+ }]
26509
+ }, (0, _.conditional)({
26510
+ gct: (0, _uint.readArray)(3, function (stream, result) {
26511
+ return Math.pow(2, result.lsd.gct.size + 1);
26512
+ })
26513
+ }, function (stream, result) {
26514
+ return result.lsd.gct.exists;
26515
+ }),
26516
+ // content frames
26517
+ {
26518
+ frames: (0, _.loop)([gceSchema, applicationSchema, commentSchema, imageSchema, textSchema], function (stream) {
26519
+ var nextCode = (0, _uint.peekByte)()(stream); // rather than check for a terminator, we should check for the existence
26520
+ // of an ext or image block to avoid infinite loops
26521
+ //var terminator = 0x3B;
26522
+ //return nextCode !== terminator;
26523
+
26524
+ return nextCode === 0x21 || nextCode === 0x2c;
26525
+ })
26526
+ }];
26527
+ var _default = schema;
26528
+ exports["default"] = _default;
26529
+ })(gif);
26530
+
26531
+ var deinterlace$1 = {};
26532
+
26533
+ Object.defineProperty(deinterlace$1, "__esModule", {
26534
+ value: true
26535
+ });
26536
+ deinterlace$1.deinterlace = void 0;
26537
+
26538
+ /**
26539
+ * Deinterlace function from https://github.com/shachaf/jsgif
26540
+ */
26541
+ var deinterlace = function deinterlace(pixels, width) {
26542
+ var newPixels = new Array(pixels.length);
26543
+ var rows = pixels.length / width;
26544
+ var cpRow = function cpRow(toRow, fromRow) {
26545
+ var fromPixels = pixels.slice(fromRow * width, (fromRow + 1) * width);
26546
+ newPixels.splice.apply(newPixels, [toRow * width, width].concat(fromPixels));
26547
+ }; // See appendix E.
26548
+
26549
+ var offsets = [0, 4, 2, 1];
26550
+ var steps = [8, 8, 4, 2];
26551
+ var fromRow = 0;
26552
+ for (var pass = 0; pass < 4; pass++) {
26553
+ for (var toRow = offsets[pass]; toRow < rows; toRow += steps[pass]) {
26554
+ cpRow(toRow, fromRow);
26555
+ fromRow++;
26556
+ }
26557
+ }
26558
+ return newPixels;
26559
+ };
26560
+ deinterlace$1.deinterlace = deinterlace;
26561
+
26562
+ var lzw$1 = {};
26563
+
26564
+ Object.defineProperty(lzw$1, "__esModule", {
26565
+ value: true
26566
+ });
26567
+ lzw$1.lzw = void 0;
26568
+
26569
+ /**
26570
+ * javascript port of java LZW decompression
26571
+ * Original java author url: https://gist.github.com/devunwired/4479231
26572
+ */
26573
+ var lzw = function lzw(minCodeSize, data, pixelCount) {
26574
+ var MAX_STACK_SIZE = 4096;
26575
+ var nullCode = -1;
26576
+ var npix = pixelCount;
26577
+ var available, clear, code_mask, code_size, end_of_information, in_code, old_code, bits, code, i, datum, data_size, first, top, bi, pi;
26578
+ var dstPixels = new Array(pixelCount);
26579
+ var prefix = new Array(MAX_STACK_SIZE);
26580
+ var suffix = new Array(MAX_STACK_SIZE);
26581
+ var pixelStack = new Array(MAX_STACK_SIZE + 1); // Initialize GIF data stream decoder.
26582
+
26583
+ data_size = minCodeSize;
26584
+ clear = 1 << data_size;
26585
+ end_of_information = clear + 1;
26586
+ available = clear + 2;
26587
+ old_code = nullCode;
26588
+ code_size = data_size + 1;
26589
+ code_mask = (1 << code_size) - 1;
26590
+ for (code = 0; code < clear; code++) {
26591
+ prefix[code] = 0;
26592
+ suffix[code] = code;
26593
+ } // Decode GIF pixel stream.
26594
+
26595
+ var datum, bits, first, top, pi, bi;
26596
+ datum = bits = first = top = pi = bi = 0;
26597
+ for (i = 0; i < npix;) {
26598
+ if (top === 0) {
26599
+ if (bits < code_size) {
26600
+ // get the next byte
26601
+ datum += data[bi] << bits;
26602
+ bits += 8;
26603
+ bi++;
26604
+ continue;
26605
+ } // Get the next code.
26606
+
26607
+ code = datum & code_mask;
26608
+ datum >>= code_size;
26609
+ bits -= code_size; // Interpret the code
26610
+
26611
+ if (code > available || code == end_of_information) {
26612
+ break;
26613
+ }
26614
+ if (code == clear) {
26615
+ // Reset decoder.
26616
+ code_size = data_size + 1;
26617
+ code_mask = (1 << code_size) - 1;
26618
+ available = clear + 2;
26619
+ old_code = nullCode;
26620
+ continue;
26621
+ }
26622
+ if (old_code == nullCode) {
26623
+ pixelStack[top++] = suffix[code];
26624
+ old_code = code;
26625
+ first = code;
26626
+ continue;
26627
+ }
26628
+ in_code = code;
26629
+ if (code == available) {
26630
+ pixelStack[top++] = first;
26631
+ code = old_code;
26632
+ }
26633
+ while (code > clear) {
26634
+ pixelStack[top++] = suffix[code];
26635
+ code = prefix[code];
26636
+ }
26637
+ first = suffix[code] & 0xff;
26638
+ pixelStack[top++] = first; // add a new string to the table, but only if space is available
26639
+ // if not, just continue with current table until a clear code is found
26640
+ // (deferred clear code implementation as per GIF spec)
26641
+
26642
+ if (available < MAX_STACK_SIZE) {
26643
+ prefix[available] = old_code;
26644
+ suffix[available] = first;
26645
+ available++;
26646
+ if ((available & code_mask) === 0 && available < MAX_STACK_SIZE) {
26647
+ code_size++;
26648
+ code_mask += available;
26649
+ }
26650
+ }
26651
+ old_code = in_code;
26652
+ } // Pop a pixel off the pixel stack.
26653
+
26654
+ top--;
26655
+ dstPixels[pi++] = pixelStack[top];
26656
+ i++;
26657
+ }
26658
+ for (i = pi; i < npix; i++) {
26659
+ dstPixels[i] = 0; // clear missing pixels
26660
+ }
26661
+
26662
+ return dstPixels;
26663
+ };
26664
+ lzw$1.lzw = lzw;
26665
+
26666
+ Object.defineProperty(lib$1, "__esModule", {
26667
+ value: true
26668
+ });
26669
+ var decompressFrames_1 = lib$1.decompressFrames = lib$1.decompressFrame = parseGIF_1 = lib$1.parseGIF = void 0;
26670
+ var _gif = _interopRequireDefault(gif);
26671
+ var _jsBinarySchemaParser = lib;
26672
+ var _uint = uint8;
26673
+ var _deinterlace = deinterlace$1;
26674
+ var _lzw = lzw$1;
26675
+ function _interopRequireDefault(obj) {
26676
+ return obj && obj.__esModule ? obj : {
26677
+ "default": obj
26678
+ };
26679
+ }
26680
+ var parseGIF = function parseGIF(arrayBuffer) {
26681
+ var byteData = new Uint8Array(arrayBuffer);
26682
+ return (0, _jsBinarySchemaParser.parse)((0, _uint.buildStream)(byteData), _gif["default"]);
26683
+ };
26684
+ var parseGIF_1 = lib$1.parseGIF = parseGIF;
26685
+ var generatePatch = function generatePatch(image) {
26686
+ var totalPixels = image.pixels.length;
26687
+ var patchData = new Uint8ClampedArray(totalPixels * 4);
26688
+ for (var i = 0; i < totalPixels; i++) {
26689
+ var pos = i * 4;
26690
+ var colorIndex = image.pixels[i];
26691
+ var color = image.colorTable[colorIndex] || [0, 0, 0];
26692
+ patchData[pos] = color[0];
26693
+ patchData[pos + 1] = color[1];
26694
+ patchData[pos + 2] = color[2];
26695
+ patchData[pos + 3] = colorIndex !== image.transparentIndex ? 255 : 0;
26696
+ }
26697
+ return patchData;
26698
+ };
26699
+ var decompressFrame = function decompressFrame(frame, gct, buildImagePatch) {
26700
+ if (!frame.image) {
26701
+ return;
26702
+ }
26703
+ var image = frame.image; // get the number of pixels
26704
+
26705
+ var totalPixels = image.descriptor.width * image.descriptor.height; // do lzw decompression
26706
+
26707
+ var pixels = (0, _lzw.lzw)(image.data.minCodeSize, image.data.blocks, totalPixels); // deal with interlacing if necessary
26708
+
26709
+ if (image.descriptor.lct.interlaced) {
26710
+ pixels = (0, _deinterlace.deinterlace)(pixels, image.descriptor.width);
26711
+ }
26712
+ var resultImage = {
26713
+ pixels: pixels,
26714
+ dims: {
26715
+ top: frame.image.descriptor.top,
26716
+ left: frame.image.descriptor.left,
26717
+ width: frame.image.descriptor.width,
26718
+ height: frame.image.descriptor.height
26719
+ }
26720
+ }; // color table
26721
+
26722
+ if (image.descriptor.lct && image.descriptor.lct.exists) {
26723
+ resultImage.colorTable = image.lct;
26724
+ } else {
26725
+ resultImage.colorTable = gct;
26726
+ } // add per frame relevant gce information
26727
+
26728
+ if (frame.gce) {
26729
+ resultImage.delay = (frame.gce.delay || 10) * 10; // convert to ms
26730
+
26731
+ resultImage.disposalType = frame.gce.extras.disposal; // transparency
26732
+
26733
+ if (frame.gce.extras.transparentColorGiven) {
26734
+ resultImage.transparentIndex = frame.gce.transparentColorIndex;
26735
+ }
26736
+ } // create canvas usable imagedata if desired
26737
+
26738
+ if (buildImagePatch) {
26739
+ resultImage.patch = generatePatch(resultImage);
26740
+ }
26741
+ return resultImage;
26742
+ };
26743
+ lib$1.decompressFrame = decompressFrame;
26744
+ var decompressFrames = function decompressFrames(parsedGif, buildImagePatches) {
26745
+ return parsedGif.frames.filter(function (f) {
26746
+ return f.image;
26747
+ }).map(function (f) {
26748
+ return decompressFrame(f, parsedGif.gct, buildImagePatches);
26749
+ });
26750
+ };
26751
+ decompressFrames_1 = lib$1.decompressFrames = decompressFrames;
26752
+
25891
26753
  let registed = false;
25892
26754
  function registerForVrender() {
25893
26755
  if (registed) {
@@ -25943,6 +26805,7 @@
25943
26805
  HierarchyState["expand"] = "expand";
25944
26806
  HierarchyState["collapse"] = "collapse";
25945
26807
  HierarchyState["none"] = "none";
26808
+ HierarchyState["loading"] = "loading";
25946
26809
  })(HierarchyState || (HierarchyState = {}));
25947
26810
 
25948
26811
  var AggregationType;
@@ -26004,6 +26867,7 @@
26004
26867
  InternalIconName["expandIconName"] = "expand";
26005
26868
  InternalIconName["collapseIconName"] = "collapse";
26006
26869
  InternalIconName["dragReorderIconName"] = "dragReorder";
26870
+ InternalIconName["loadingIconName"] = "loading";
26007
26871
  })(InternalIconName || (InternalIconName = {}));
26008
26872
 
26009
26873
  var index$1 = /*#__PURE__*/Object.freeze({
@@ -27184,7 +28048,9 @@
27184
28048
  }
27185
28049
  function cellInRange(range, col, row) {
27186
28050
  return ((range.start.col <= col && col <= range.end.col && range.start.row <= row && row <= range.end.row) ||
27187
- (range.end.col <= col && col <= range.start.col && range.end.row <= row && row <= range.start.row));
28051
+ (range.end.col <= col && col <= range.start.col && range.end.row <= row && row <= range.start.row) ||
28052
+ (range.end.col <= col && col <= range.start.col && range.start.row <= row && row <= range.end.row) ||
28053
+ (range.start.col <= col && col <= range.end.col && range.end.row <= row && row <= range.start.row));
27188
28054
  }
27189
28055
  function cellInRanges(ranges, col, row) {
27190
28056
  for (let i = 0; i < ranges.length; i++) {
@@ -27269,6 +28135,8 @@
27269
28135
  RESIZE_ROW_END: 'resize_row_end',
27270
28136
  CHANGE_HEADER_POSITION_START: 'change_header_position_start',
27271
28137
  CHANGE_HEADER_POSITION: 'change_header_position',
28138
+ CHANGING_HEADER_POSITION: 'changing_header_position',
28139
+ CHANGE_HEADER_POSITION_FAIL: 'change_header_position_fail',
27272
28140
  SORT_CLICK: 'sort_click',
27273
28141
  AFTER_SORT: 'after_sort',
27274
28142
  FREEZE_CLICK: 'freeze_click',
@@ -32291,6 +33159,15 @@
32291
33159
  let Icon$1 = class Icon extends Image$2 {
32292
33160
  role;
32293
33161
  tooltip;
33162
+ frameImageData;
33163
+ tempCanvas;
33164
+ tempCtx;
33165
+ gifCanvas;
33166
+ gifCtx;
33167
+ loadedFrames;
33168
+ frameIndex;
33169
+ playing;
33170
+ lastTime;
32294
33171
  constructor(params) {
32295
33172
  super(params);
32296
33173
  if (this.attribute.visibleTime === 'mouseenter_cell' || this.attribute.visibleTime === 'click_cell') {
@@ -32299,6 +33176,24 @@
32299
33176
  if (this.attribute.hoverImage) {
32300
33177
  this.attribute.originImage = this.attribute.image;
32301
33178
  }
33179
+ if (this.attribute.isGif && this.attribute.gif) {
33180
+ this.loadGif();
33181
+ }
33182
+ }
33183
+ loadGif() {
33184
+ this.playing = false;
33185
+ ResourceLoader.GetFile(this.attribute.gif, 'arrayBuffer')
33186
+ .then((res) => {
33187
+ const gif = parseGIF_1(res);
33188
+ const frames = decompressFrames_1(gif, true);
33189
+ this.renderGIF(frames);
33190
+ this.resources.set(this.attribute.image, {
33191
+ state: 'success',
33192
+ data: this.gifCanvas
33193
+ });
33194
+ })
33195
+ .catch((e) => {
33196
+ });
32302
33197
  }
32303
33198
  get backgroundWidth() {
32304
33199
  return this.attribute.backgroundWidth ?? this.attribute.width ?? 0;
@@ -32306,6 +33201,67 @@
32306
33201
  get backgroundHeight() {
32307
33202
  return this.attribute.backgroundHeight ?? this.attribute.height ?? 0;
32308
33203
  }
33204
+ renderGIF(frames) {
33205
+ this.loadedFrames = frames;
33206
+ this.frameIndex = 0;
33207
+ if (!this.tempCanvas) {
33208
+ this.tempCanvas = document.createElement('canvas');
33209
+ this.tempCtx = this.tempCanvas.getContext('2d');
33210
+ }
33211
+ if (!this.gifCanvas) {
33212
+ this.gifCanvas = document.createElement('canvas');
33213
+ this.gifCtx = this.gifCanvas.getContext('2d');
33214
+ }
33215
+ this.gifCanvas.width = frames[0].dims.width;
33216
+ this.gifCanvas.height = frames[0].dims.height;
33217
+ this.playing = true;
33218
+ this.lastTime = new Date().getTime();
33219
+ this.animate().to({}, 1000, 'linear').loop(Infinity);
33220
+ }
33221
+ renderFrame(context, x, y) {
33222
+ const frame = this.loadedFrames[this.frameIndex || 0];
33223
+ if (frame.disposalType === 2) {
33224
+ this.gifCtx.clearRect(0, 0, this.gifCanvas.width, this.gifCanvas.height);
33225
+ }
33226
+ this.drawPatch(frame);
33227
+ this.manipulate(context, x, y);
33228
+ const diff = new Date().getTime() - this.lastTime;
33229
+ if (frame.delay < diff) {
33230
+ this.frameIndex++;
33231
+ this.lastTime = new Date().getTime();
33232
+ }
33233
+ if (this.frameIndex >= this.loadedFrames.length) {
33234
+ this.frameIndex = 0;
33235
+ }
33236
+ }
33237
+ drawPatch(frame) {
33238
+ const dims = frame.dims;
33239
+ if (!this.frameImageData ||
33240
+ dims.width !== this.frameImageData.width ||
33241
+ dims.height !== this.frameImageData.height) {
33242
+ this.tempCanvas.width = dims.width;
33243
+ this.tempCanvas.height = dims.height;
33244
+ this.frameImageData = this.tempCtx.createImageData(dims.width, dims.height);
33245
+ }
33246
+ this.frameImageData.data.set(frame.patch);
33247
+ this.tempCtx.putImageData(this.frameImageData, 0, 0);
33248
+ this.gifCtx.drawImage(this.tempCanvas, dims.left, dims.top);
33249
+ }
33250
+ manipulate(context, x, y) {
33251
+ context.drawImage(this.gifCanvas, 0, 0, this.gifCanvas.width, this.gifCanvas.height, x, y, this.attribute.width, this.attribute.height);
33252
+ }
33253
+ setAttribute(key, value, forceUpdateTag, context) {
33254
+ super.setAttribute(key, value, forceUpdateTag, context);
33255
+ if (key === 'gif') {
33256
+ this.loadGif();
33257
+ }
33258
+ }
33259
+ setAttributes(params, forceUpdateTag, context) {
33260
+ super.setAttributes(params, forceUpdateTag, context);
33261
+ if (params.gif) {
33262
+ this.loadGif();
33263
+ }
33264
+ }
32309
33265
  };
32310
33266
 
32311
33267
  function emptyCustomLayout(args) {
@@ -32600,7 +33556,7 @@
32600
33556
  };
32601
33557
  const customRenderObj = customLayout(arg);
32602
33558
  if (customRenderObj.rootContainer) {
32603
- customRenderObj.rootContainer = decodeReactDom(customRenderObj.rootContainer);
33559
+ customRenderObj.rootContainer = decodeReactDom(customRenderObj.rootContainer, table.animationManager.timeline);
32604
33560
  }
32605
33561
  if (customRenderObj.rootContainer instanceof Group$2) {
32606
33562
  elementsGroup = customRenderObj.rootContainer;
@@ -32902,14 +33858,14 @@
32902
33858
  }
32903
33859
  });
32904
33860
  }
32905
- function decodeReactDom(dom) {
33861
+ function decodeReactDom(dom, timeline) {
32906
33862
  if (!dom ||
32907
33863
  (!isValid$1(dom.$$typeof) &&
32908
33864
  !isValid$1(dom.vtype))) {
32909
33865
  return dom;
32910
33866
  }
32911
33867
  const type = dom.type;
32912
- const { attribute, children, stateProxy } = dom.props;
33868
+ const { attribute, children, stateProxy, animation } = dom.props;
32913
33869
  const g = type({ attribute });
32914
33870
  parseToGraphic(g, dom.props);
32915
33871
  if (stateProxy) {
@@ -32919,12 +33875,19 @@
32919
33875
  g.name = attribute.name;
32920
33876
  if (isArray$1(children)) {
32921
33877
  children.forEach((item) => {
32922
- const c = decodeReactDom(item);
33878
+ const c = decodeReactDom(item, timeline);
32923
33879
  c && c.type && g.add(c);
32924
33880
  });
32925
33881
  }
32926
33882
  else if (children) {
32927
- g.add(decodeReactDom(children));
33883
+ g.add(decodeReactDom(children, timeline));
33884
+ }
33885
+ if (isArray$1(animation) && timeline) {
33886
+ const animate = g.animate();
33887
+ animate.setTimeline(timeline);
33888
+ animation.forEach((item) => {
33889
+ animate[item[0]](...item.slice(1));
33890
+ });
32928
33891
  }
32929
33892
  return g;
32930
33893
  }
@@ -33311,6 +34274,24 @@
33311
34274
  cursor: 'pointer'
33312
34275
  };
33313
34276
  },
34277
+ get loading() {
34278
+ return {
34279
+ type: 'image',
34280
+ src: 'https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VTable/media/loading-circle.gif',
34281
+ width: collapse_size,
34282
+ height: collapse_size,
34283
+ name: 'loading',
34284
+ positionType: IconPosition.contentLeft,
34285
+ marginLeft: 0,
34286
+ marginRight: 4,
34287
+ hover: {
34288
+ width: collapse_size_2,
34289
+ height: collapse_size_2,
34290
+ bgColor: 'rgba(101, 117, 168, 0.1)'
34291
+ },
34292
+ isGif: true
34293
+ };
34294
+ },
33314
34295
  get drillDown() {
33315
34296
  return {
33316
34297
  name: 'drillDown',
@@ -33543,6 +34524,9 @@
33543
34524
  this._AABBBounds.setValue(x, y, x + width, y + height);
33544
34525
  this.parent && this.parent.addChildUpdateBoundTag();
33545
34526
  this.clearUpdateBoundTag();
34527
+ if (this.shadowRoot) {
34528
+ this.shadowRoot.tryUpdateAABBBounds();
34529
+ }
33546
34530
  return this._AABBBounds;
33547
34531
  }
33548
34532
  else if (this.role === 'body' ||
@@ -33973,12 +34957,18 @@
33973
34957
  autoWrapText,
33974
34958
  lineClamp,
33975
34959
  wordBreak: 'break-word',
33976
- heightLimit: autoRowHeight && !table.options.customConfig?.multilinesForXTable
34960
+ heightLimit: table.options.customConfig?.limitContentHeight === false
33977
34961
  ? -1
33978
- : cellHeight - Math.floor(padding[0] + padding[2]),
34962
+ : autoRowHeight && !table.options.customConfig?.multilinesForXTable
34963
+ ? -1
34964
+ : cellHeight - Math.floor(padding[0] + padding[2]),
33979
34965
  pickable: false,
33980
34966
  dx: (textAlign === 'left' ? hierarchyOffset : 0) + _contentOffset,
33981
- whiteSpace: text.length === 1 && !autoWrapText ? 'no-wrap' : 'normal'
34967
+ whiteSpace: table.options.customConfig?.limitContentHeight === false
34968
+ ? 'normal'
34969
+ : text.length === 1 && !autoWrapText
34970
+ ? 'no-wrap'
34971
+ : 'normal'
33982
34972
  };
33983
34973
  const wrapText = new Text$1(cellTheme.text ? Object.assign({}, cellTheme.text, attribute) : attribute);
33984
34974
  wrapText.name = 'text';
@@ -34015,14 +35005,20 @@
34015
35005
  ? Infinity
34016
35006
  : cellWidth - (padding[1] + padding[3]) - leftIconWidth - rightIconWidth - hierarchyOffset,
34017
35007
  textBaseline: 'top',
34018
- heightLimit: autoRowHeight && !table.options.customConfig?.multilinesForXTable
35008
+ heightLimit: table.options.customConfig?.limitContentHeight === false
34019
35009
  ? -1
34020
- : cellHeight - Math.floor(padding[0] + padding[2]),
35010
+ : autoRowHeight && !table.options.customConfig?.multilinesForXTable
35011
+ ? -1
35012
+ : cellHeight - Math.floor(padding[0] + padding[2]),
34021
35013
  pickable: false,
34022
35014
  autoWrapText,
34023
35015
  lineClamp,
34024
35016
  wordBreak: 'break-word',
34025
- whiteSpace: text.length === 1 && !autoWrapText ? 'no-wrap' : 'normal',
35017
+ whiteSpace: table.options.customConfig?.limitContentHeight === false
35018
+ ? 'normal'
35019
+ : text.length === 1 && !autoWrapText
35020
+ ? 'no-wrap'
35021
+ : 'normal',
34026
35022
  dx: (textAlign === 'left' ? (!contentLeftIcons.length ? hierarchyOffset : 0) : 0) + _contentOffset
34027
35023
  };
34028
35024
  const wrapText = new Text$1(cellTheme.text ? Object.assign({}, cellTheme.text, attribute) : attribute);
@@ -34151,7 +35147,13 @@
34151
35147
  function dealWithIcon(icon, mark, col, row, range, table, dealWithIconComputeVar) {
34152
35148
  const iconAttribute = {};
34153
35149
  if (icon.type === 'image') {
34154
- iconAttribute.image = icon.src;
35150
+ if (icon.isGif) {
35151
+ iconAttribute.gif = icon.src;
35152
+ iconAttribute.image = icon.src;
35153
+ }
35154
+ else {
35155
+ iconAttribute.image = icon.src;
35156
+ }
34155
35157
  }
34156
35158
  else if (icon.type === 'svg' || 'svg' in icon) {
34157
35159
  iconAttribute.image = icon.svg;
@@ -34161,6 +35163,7 @@
34161
35163
  iconAttribute.visibleTime = icon.visibleTime ?? 'always';
34162
35164
  iconAttribute.funcType = icon.funcType;
34163
35165
  iconAttribute.interactive = icon.interactive;
35166
+ iconAttribute.isGif = icon.isGif;
34164
35167
  let hierarchyOffset = 0;
34165
35168
  if ((!dealWithIconComputeVar || dealWithIconComputeVar?.addedHierarchyOffset === 0) &&
34166
35169
  isNumber$2(col) &&
@@ -34197,10 +35200,13 @@
34197
35200
  if (mark) {
34198
35201
  mark.setAttributes(iconAttribute);
34199
35202
  mark.loadImage(iconAttribute.image);
35203
+ mark.tooltip = icon.tooltip;
35204
+ mark.name = icon.name;
34200
35205
  return mark;
34201
35206
  }
34202
35207
  const iconMark = new Icon$1(iconAttribute);
34203
35208
  iconMark.tooltip = icon.tooltip;
35209
+ iconMark.name = icon.name;
34204
35210
  return iconMark;
34205
35211
  }
34206
35212
  function dealWithRichTextIcon(icon) {
@@ -34345,12 +35351,12 @@
34345
35351
  }
34346
35352
  return false;
34347
35353
  }
34348
- function updateCellContentHeight(cellGroup, distHeight, detaY, autoRowHeight, padding, textAlign, textBaseline) {
35354
+ function updateCellContentHeight(cellGroup, distHeight, detaY, autoRowHeight, padding, textAlign, textBaseline, table) {
34349
35355
  const newHeight = distHeight - Math.floor(padding[0] + padding[2]);
34350
35356
  const textMark = cellGroup.getChildByName('text');
34351
35357
  if (textMark instanceof Text$1 && !autoRowHeight) {
34352
35358
  textMark.setAttributes({
34353
- heightLimit: newHeight
35359
+ heightLimit: table.options.customConfig?.limitContentHeight === false ? -1 : newHeight
34354
35360
  });
34355
35361
  }
34356
35362
  else if (textMark instanceof RichText && !autoRowHeight) {
@@ -34915,6 +35921,107 @@
34915
35921
  });
34916
35922
  }
34917
35923
 
35924
+ function isSameRange$1(range1, range2) {
35925
+ if (!range1 && !range2) {
35926
+ return true;
35927
+ }
35928
+ if (!range1 || !range2) {
35929
+ return false;
35930
+ }
35931
+ return (range1.start.col === range2.start.col &&
35932
+ range1.start.row === range2.start.row &&
35933
+ range1.end.col === range2.end.col &&
35934
+ range1.end.row === range2.end.row);
35935
+ }
35936
+
35937
+ class InvertHighlightPlugin {
35938
+ table;
35939
+ range;
35940
+ _fill;
35941
+ _opacity;
35942
+ constructor(table, options) {
35943
+ this.table = table;
35944
+ this._fill = options?.fill ?? '#000';
35945
+ this._opacity = options?.opacity ?? 0.5;
35946
+ }
35947
+ setInvertHighlightRange(range) {
35948
+ if (isSameRange$1(this.range, range)) {
35949
+ return;
35950
+ }
35951
+ this.range = range;
35952
+ if (!range) {
35953
+ this.deleteAllCellGroupShadow();
35954
+ }
35955
+ else {
35956
+ this.updateCellGroupShadow();
35957
+ }
35958
+ this.table.scenegraph.updateNextFrame();
35959
+ }
35960
+ deleteAllCellGroupShadow() {
35961
+ if (!this.table.isPivotTable()) {
35962
+ this.updateCellGroupShadowInContainer(this.table.scenegraph.rowHeaderGroup);
35963
+ this.updateCellGroupShadowInContainer(this.table.scenegraph.leftBottomCornerGroup);
35964
+ }
35965
+ this.updateCellGroupShadowInContainer(this.table.scenegraph.bodyGroup);
35966
+ this.updateCellGroupShadowInContainer(this.table.scenegraph.rightFrozenGroup);
35967
+ this.updateCellGroupShadowInContainer(this.table.scenegraph.bottomFrozenGroup);
35968
+ this.updateCellGroupShadowInContainer(this.table.scenegraph.rightBottomCornerGroup);
35969
+ }
35970
+ updateCellGroupShadow() {
35971
+ if (!this.table.isPivotTable()) {
35972
+ this.updateCellGroupShadowInContainer(this.table.scenegraph.rowHeaderGroup, this.range);
35973
+ this.updateCellGroupShadowInContainer(this.table.scenegraph.leftBottomCornerGroup, this.range);
35974
+ }
35975
+ this.updateCellGroupShadowInContainer(this.table.scenegraph.bodyGroup, this.range);
35976
+ this.updateCellGroupShadowInContainer(this.table.scenegraph.rightFrozenGroup, this.range);
35977
+ this.updateCellGroupShadowInContainer(this.table.scenegraph.bottomFrozenGroup), this.range;
35978
+ this.updateCellGroupShadowInContainer(this.table.scenegraph.rightBottomCornerGroup, this.range);
35979
+ }
35980
+ updateCellGroupShadowInContainer(container, range) {
35981
+ container.forEachChildrenSkipChild((column) => {
35982
+ if (column.role === 'column') {
35983
+ column.forEachChildrenSkipChild((cell) => {
35984
+ if (cell.role !== 'cell') {
35985
+ return;
35986
+ }
35987
+ cell.attachShadow(cell.shadowRoot);
35988
+ const shadowGroup = cell.shadowRoot;
35989
+ if (!range) {
35990
+ shadowGroup.removeAllChild();
35991
+ }
35992
+ else if (cellInRange(range, cell.col, cell.row)) {
35993
+ shadowGroup.removeAllChild();
35994
+ }
35995
+ else if (!shadowGroup.firstChild) {
35996
+ const shadowRect = createRect({
35997
+ x: 0,
35998
+ y: 0,
35999
+ width: cell.attribute.width,
36000
+ height: cell.attribute.height,
36001
+ fill: this._fill,
36002
+ opacity: this._opacity
36003
+ });
36004
+ shadowRect.name = 'shadow-rect';
36005
+ shadowGroup.appendChild(shadowRect);
36006
+ }
36007
+ });
36008
+ }
36009
+ });
36010
+ }
36011
+ }
36012
+ function onBeforeAttributeUpdateForInvertHighlight(val, attribute) {
36013
+ const graphic = this;
36014
+ if (graphic.shadowRoot && graphic.shadowRoot.childrenCount && (isValid$1(val.width) || isValid$1(val.height))) {
36015
+ const shadowRect = graphic.shadowRoot.findChildrenByName('shadow-rect')[0];
36016
+ if (shadowRect) {
36017
+ shadowRect.setAttributes({
36018
+ width: val.width ?? shadowRect.attribute.width,
36019
+ height: val.height ?? shadowRect.attribute.height
36020
+ });
36021
+ }
36022
+ }
36023
+ }
36024
+
34918
36025
  function createCell(type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme, range, customResult) {
34919
36026
  let isAsync = false;
34920
36027
  let cellGroup;
@@ -35033,6 +36140,7 @@
35033
36140
  const createRadioCellGroup = Factory.getFunction('createRadioCellGroup');
35034
36141
  cellGroup = createRadioCellGroup(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, table, cellTheme, define);
35035
36142
  }
36143
+ cellGroup.onBeforeAttributeUpdate = onBeforeAttributeUpdateForInvertHighlight;
35036
36144
  return cellGroup;
35037
36145
  }
35038
36146
  function updateCell$1(col, row, table, addNew, isShadow) {
@@ -35288,7 +36396,7 @@
35288
36396
  continue;
35289
36397
  }
35290
36398
  if (range.start.row !== range.end.row && cellGroup.contentHeight !== cellHeight) {
35291
- updateCellContentHeight(cellGroup, cellHeight, cellHeight, table.isAutoRowHeight(row), padding, textAlign, textBaseline);
36399
+ updateCellContentHeight(cellGroup, cellHeight, cellHeight, table.isAutoRowHeight(row), padding, textAlign, textBaseline, table);
35292
36400
  }
35293
36401
  if (range.start.col !== range.end.col && cellGroup.contentWidth !== cellWidth) {
35294
36402
  updateCellContentWidth(cellGroup, cellWidth, cellHeight, 0, table.isAutoRowHeight(row), padding, textAlign, textBaseline, table.scenegraph);
@@ -35304,7 +36412,7 @@
35304
36412
  function dealWithMergeCellSizeForShadow(range, cellWidth, cellHeight, padding, textAlign, textBaseline, table, cellGroup) {
35305
36413
  const { col, row } = cellGroup;
35306
36414
  if (range.start.row !== range.end.row && cellGroup.contentHeight !== cellHeight) {
35307
- updateCellContentHeight(cellGroup, cellHeight, cellHeight, table.isAutoRowHeight(row), padding, textAlign, textBaseline);
36415
+ updateCellContentHeight(cellGroup, cellHeight, cellHeight, table.isAutoRowHeight(row), padding, textAlign, textBaseline, table);
35308
36416
  }
35309
36417
  if (range.start.col !== range.end.col && cellGroup.contentWidth !== cellWidth) {
35310
36418
  updateCellContentWidth(cellGroup, cellWidth, cellHeight, 0, table.isAutoRowHeight(row), padding, textAlign, textBaseline, table.scenegraph);
@@ -35709,7 +36817,8 @@
35709
36817
  table.defaultHeaderColWidth;
35710
36818
  const isDefaultHeaderHasAuto = table.defaultHeaderRowHeight === 'auto' ||
35711
36819
  (isArray$1(table.defaultHeaderRowHeight) && table.defaultHeaderRowHeight.some(item => item === 'auto'));
35712
- const isAllRowsAuto = table.heightMode === 'autoHeight' || table.heightMode === 'adaptive';
36820
+ const isAllRowsAuto = table.heightMode === 'autoHeight' ||
36821
+ (table.heightMode === 'adaptive' && table.options.autoHeightInAdaptiveMode !== false);
35713
36822
  if (isAllRowsAuto || isDefaultHeaderHasAuto) {
35714
36823
  rowStart = rowStart ?? 0;
35715
36824
  rowEnd = rowEnd ?? table.rowCount - 1;
@@ -35729,7 +36838,9 @@
35729
36838
  if (isAllRowsAuto || table.getDefaultRowHeight(row) === 'auto') {
35730
36839
  const height = computeRowHeight(row, startCol, endCol, table);
35731
36840
  newHeights[row] = Math.round(height);
35732
- table._setRowHeight(row, height);
36841
+ if (table.heightAdaptiveMode === 'only-body' || !update) {
36842
+ table._setRowHeight(row, height);
36843
+ }
35733
36844
  }
35734
36845
  }
35735
36846
  for (let row = table.rowCount - table.bottomFrozenRowCount; row <= rowEnd; row++) {
@@ -35894,7 +37005,7 @@
35894
37005
  if (update) {
35895
37006
  for (let row = rowStart; row <= rowEnd; row++) {
35896
37007
  const newRowHeight = newHeights[row] ?? table.getRowHeight(row);
35897
- if (newRowHeight !== (oldRowHeights[row] ?? table.getRowHeight(row))) {
37008
+ if (isValid$1(newRowHeight)) {
35898
37009
  table._setRowHeight(row, newRowHeight);
35899
37010
  }
35900
37011
  }
@@ -36503,7 +37614,7 @@
36503
37614
  });
36504
37615
  if (renderDefault) {
36505
37616
  const style = table._getCellStyle(colStart, rowStart);
36506
- updateCellContentHeight(singleCellGroup, distHeight, detaY, autoRowHeight, getQuadProps(style.padding), style.textAlign, style.textBaseline);
37617
+ updateCellContentHeight(singleCellGroup, distHeight, detaY, autoRowHeight, getQuadProps(style.padding), style.textAlign, style.textBaseline, table);
36507
37618
  }
36508
37619
  const rangeHeight = table.getRowHeight(row);
36509
37620
  const rangeWidth = table.getColWidth(col);
@@ -36526,7 +37637,7 @@
36526
37637
  }
36527
37638
  else {
36528
37639
  const style = table._getCellStyle(cellGroup.col, cellGroup.row);
36529
- updateCellContentHeight(cellGroup, distHeight, detaY, autoRowHeight, getQuadProps(style.padding), style.textAlign, style.textBaseline);
37640
+ updateCellContentHeight(cellGroup, distHeight, detaY, autoRowHeight, getQuadProps(style.padding), style.textAlign, style.textBaseline, table);
36530
37641
  }
36531
37642
  }
36532
37643
 
@@ -37366,6 +38477,12 @@
37366
38477
  y: symbolY,
37367
38478
  angle: symbolRotate
37368
38479
  });
38480
+ return {
38481
+ backX: rectX - rectDx,
38482
+ lineX: symbolX,
38483
+ backY: rectY - rectDy,
38484
+ lineY: symbolY
38485
+ };
37369
38486
  }
37370
38487
  hide() {
37371
38488
  this.columnMoverLabel.setAttribute('visible', false);
@@ -37904,7 +39021,7 @@
37904
39021
  this.cellMover.hide();
37905
39022
  }
37906
39023
  showMoveCol(col, row, delta) {
37907
- this.cellMover.show(col, row, delta);
39024
+ return this.cellMover.show(col, row, delta);
37908
39025
  }
37909
39026
  updateMoveCol(backX, lineX, backY, lineY) {
37910
39027
  this.cellMover.update(backX, lineX, backY, lineY);
@@ -38569,17 +39686,18 @@
38569
39686
  bodyBound.x2 = tableBound.x2;
38570
39687
  bodyBound.y1 = tableBound.y1;
38571
39688
  bodyBound.y2 = tableBound.y2;
38572
- if (!layoutMap.isFrozenColumn(col, row) && !layoutMap.isRightFrozenColumn(col, row)) {
38573
- bodyBound.x1 = tableBound.x1 + table.getFrozenColsWidth();
38574
- bodyBound.x2 = tableBound.x2 - table.getRightFrozenColsWidth();
38575
- bodyBound.y1 = tableBound.y1 + table.getFrozenRowsHeight();
38576
- bodyBound.y2 = tableBound.y2 - table.getBottomFrozenRowsHeight();
38577
- }
38578
- else if (layoutMap.isLeftBottomCorner(col, row) || layoutMap.isRightTopCorner(col, row)) ;
39689
+ if (layoutMap.isLeftBottomCorner(col, row) ||
39690
+ layoutMap.isRightTopCorner(col, row) ||
39691
+ layoutMap.isLeftTopCorner(col, row) ||
39692
+ layoutMap.isRightBottomCorner(col, row)) ;
38579
39693
  else if (layoutMap.isFrozenColumn(col, row)) {
38580
39694
  bodyBound.y1 = tableBound.y1 + table.getFrozenRowsHeight();
38581
39695
  bodyBound.y2 = tableBound.y2 - table.getBottomFrozenRowsHeight();
38582
39696
  }
39697
+ else if (layoutMap.isFrozenRow(col, row)) {
39698
+ bodyBound.x1 = tableBound.x1 + table.getFrozenColsWidth();
39699
+ bodyBound.x2 = tableBound.x2 - table.getRightFrozenColsWidth();
39700
+ }
38583
39701
  else if (layoutMap.isRightFrozenColumn(col, row)) {
38584
39702
  bodyBound.y1 = tableBound.y1 + table.getFrozenRowsHeight();
38585
39703
  bodyBound.y2 = tableBound.y2 - table.getBottomFrozenRowsHeight();
@@ -38588,6 +39706,12 @@
38588
39706
  bodyBound.x1 = tableBound.x1 + table.getFrozenColsWidth();
38589
39707
  bodyBound.x2 = tableBound.x2 - table.getRightFrozenColsWidth();
38590
39708
  }
39709
+ else if (!layoutMap.isFrozenColumn(col, row) && !layoutMap.isRightFrozenColumn(col, row)) {
39710
+ bodyBound.x1 = tableBound.x1 + table.getFrozenColsWidth();
39711
+ bodyBound.x2 = tableBound.x2 - table.getRightFrozenColsWidth();
39712
+ bodyBound.y1 = tableBound.y1 + table.getFrozenRowsHeight();
39713
+ bodyBound.y2 = tableBound.y2 - table.getBottomFrozenRowsHeight();
39714
+ }
38591
39715
  bodyBound.x1 = bodyBound.x1 + (table.options.viewBox?.x1 ?? 0);
38592
39716
  bodyBound.x2 = bodyBound.x2 + (table.options.viewBox?.x1 ?? 0);
38593
39717
  bodyBound.y1 = bodyBound.y1 + (table.options.viewBox?.y1 ?? 0);
@@ -38927,6 +40051,36 @@
38927
40051
  AfterImageRenderContribution = __decorate([
38928
40052
  injectable()
38929
40053
  ], AfterImageRenderContribution);
40054
+ let BeforeGifImageRenderContribution = class BeforeGifImageRenderContribution {
40055
+ time = BaseRenderContributionTime.beforeFillStroke;
40056
+ useStyle = true;
40057
+ order = 0;
40058
+ drawShape(image, context, x, y, doFill, doStroke, fVisible, sVisible, imageAttribute, drawContext, fillCb, strokeCb, doFillOrStroke) {
40059
+ const { isGif } = image.attribute;
40060
+ if (isGif && image.playing) {
40061
+ image.attribute.opacity = 0;
40062
+ }
40063
+ }
40064
+ };
40065
+ BeforeGifImageRenderContribution = __decorate([
40066
+ injectable()
40067
+ ], BeforeGifImageRenderContribution);
40068
+ let AfterGifImageRenderContribution = class AfterGifImageRenderContribution {
40069
+ time = BaseRenderContributionTime.afterFillStroke;
40070
+ useStyle = true;
40071
+ order = 0;
40072
+ drawShape(image, context, x, y, doFill, doStroke, fVisible, sVisible, imageAttribute, drawContext, fillCb, strokeCb, doFillOrStroke) {
40073
+ const { isGif } = image.attribute;
40074
+ if (isGif && image.playing) {
40075
+ image.attribute.opacity = 1;
40076
+ context.globalAlpha = image.attribute.opacity;
40077
+ image.renderFrame(context, x, y);
40078
+ }
40079
+ }
40080
+ };
40081
+ AfterGifImageRenderContribution = __decorate([
40082
+ injectable()
40083
+ ], AfterGifImageRenderContribution);
38930
40084
 
38931
40085
  function getCellHoverColor(cellGroup, table) {
38932
40086
  let colorKey;
@@ -39086,45 +40240,97 @@
39086
40240
  const fillColor = getProp(colorKey, selectStyle, cellGroup.col, cellGroup.row, table);
39087
40241
  return fillColor;
39088
40242
  }
39089
- function isCellSelected(state, col, row, cellGroup) {
39090
- const { highlightScope, disableHeader, cellPos, ranges } = state.select;
40243
+ function isSelectMultipleRange(range) {
40244
+ return range.start.col !== range.end.col || range.start.row !== range.end.row;
40245
+ }
40246
+ function getSelectModeRange(state, col, row) {
39091
40247
  let selectMode;
39092
- if (ranges?.length === 1 && ranges[0].end.col === ranges[0].start.col && ranges[0].end.row === ranges[0].start.row) {
39093
- const table = state.table;
39094
- const isHeader = table.isHeader(col, row);
39095
- if (isHeader && disableHeader) {
39096
- return undefined;
40248
+ const { highlightScope, cellPos, ranges } = state.select;
40249
+ const range = ranges[0];
40250
+ const rangeColStart = Math.min(range.start.col, range.end.col);
40251
+ const rangeColEnd = Math.max(range.start.col, range.end.col);
40252
+ const rangeRowStart = Math.min(range.start.row, range.end.row);
40253
+ const rangeRowEnd = Math.max(range.start.row, range.end.row);
40254
+ if (highlightScope === HighlightScope.single && cellPos.col === col && cellPos.row === row) {
40255
+ selectMode = 'cellBgColor';
40256
+ }
40257
+ else if (highlightScope === HighlightScope.column && col >= rangeColStart && col <= rangeColEnd) {
40258
+ if (cellInRange(ranges[0], col, row)) {
40259
+ selectMode = 'cellBgColor';
39097
40260
  }
39098
- if (highlightScope === HighlightScope.single && cellPos.col === col && cellPos.row === row) {
40261
+ else {
40262
+ selectMode = 'inlineColumnBgColor';
40263
+ }
40264
+ }
40265
+ else if (highlightScope === HighlightScope.row && row >= rangeRowStart && row <= rangeRowEnd) {
40266
+ if (cellInRange(ranges[0], col, row)) {
39099
40267
  selectMode = 'cellBgColor';
39100
40268
  }
39101
- else if (highlightScope === HighlightScope.column && cellPos.col === col) {
39102
- if (cellPos.col === col && cellPos.row === row) {
39103
- selectMode = 'cellBgColor';
39104
- }
39105
- else {
39106
- selectMode = 'inlineColumnBgColor';
39107
- }
40269
+ else {
40270
+ selectMode = 'inlineRowBgColor';
39108
40271
  }
39109
- else if (highlightScope === HighlightScope.row && cellPos.row === row) {
39110
- if (cellPos.col === col && cellPos.row === row) {
39111
- selectMode = 'cellBgColor';
39112
- }
39113
- else {
39114
- selectMode = 'inlineRowBgColor';
39115
- }
40272
+ }
40273
+ else if (highlightScope === HighlightScope.cross) {
40274
+ if (cellInRange(ranges[0], col, row)) {
40275
+ selectMode = 'cellBgColor';
39116
40276
  }
39117
- else if (highlightScope === HighlightScope.cross) {
39118
- if (cellPos.col === col && cellPos.row === row) {
39119
- selectMode = 'cellBgColor';
39120
- }
39121
- else if (cellPos.col === col) {
39122
- selectMode = 'inlineColumnBgColor';
39123
- }
39124
- else if (cellPos.row === row) {
39125
- selectMode = 'inlineRowBgColor';
39126
- }
40277
+ else if (col >= rangeColStart && col <= rangeColEnd) {
40278
+ selectMode = 'inlineColumnBgColor';
39127
40279
  }
40280
+ else if (row >= rangeRowStart && row <= rangeRowEnd) {
40281
+ selectMode = 'inlineRowBgColor';
40282
+ }
40283
+ }
40284
+ return selectMode;
40285
+ }
40286
+ function getSelectMode(state, col, row) {
40287
+ let selectMode;
40288
+ const { highlightScope, cellPos } = state.select;
40289
+ if (highlightScope === HighlightScope.single && cellPos.col === col && cellPos.row === row) {
40290
+ selectMode = 'cellBgColor';
40291
+ }
40292
+ else if (highlightScope === HighlightScope.column && cellPos.col === col) {
40293
+ if (cellPos.col === col && cellPos.row === row) {
40294
+ selectMode = 'cellBgColor';
40295
+ }
40296
+ else {
40297
+ selectMode = 'inlineColumnBgColor';
40298
+ }
40299
+ }
40300
+ else if (highlightScope === HighlightScope.row && cellPos.row === row) {
40301
+ if (cellPos.col === col && cellPos.row === row) {
40302
+ selectMode = 'cellBgColor';
40303
+ }
40304
+ else {
40305
+ selectMode = 'inlineRowBgColor';
40306
+ }
40307
+ }
40308
+ else if (highlightScope === HighlightScope.cross) {
40309
+ if (cellPos.col === col && cellPos.row === row) {
40310
+ selectMode = 'cellBgColor';
40311
+ }
40312
+ else if (cellPos.col === col) {
40313
+ selectMode = 'inlineColumnBgColor';
40314
+ }
40315
+ else if (cellPos.row === row) {
40316
+ selectMode = 'inlineRowBgColor';
40317
+ }
40318
+ }
40319
+ return selectMode;
40320
+ }
40321
+ function isCellSelected(state, col, row, cellGroup) {
40322
+ const { highlightInRange, disableHeader, ranges } = state.select;
40323
+ let selectMode;
40324
+ const isSelectRange = ranges.length === 1 && isSelectMultipleRange(ranges?.[0]) && highlightInRange;
40325
+ if (isSelectRange
40326
+ ? ranges?.length === 1 && ranges[0].start && ranges[0].end
40327
+ : ranges?.length === 1 && ranges[0].end.col === ranges[0].start.col && ranges[0].end.row === ranges[0].start.row) {
40328
+ const table = state.table;
40329
+ const isHeader = table.isHeader(col, row);
40330
+ if (isHeader && disableHeader) {
40331
+ return undefined;
40332
+ }
40333
+ selectMode = isSelectRange ? getSelectModeRange(state, col, row) : getSelectMode(state, col, row);
39128
40334
  if (selectMode) {
39129
40335
  let cellDisable;
39130
40336
  if (isHeader) {
@@ -40038,12 +41244,15 @@
40038
41244
  return false;
40039
41245
  }
40040
41246
  drawItem(graphic, renderService, drawContext, drawContribution, params) {
40041
- const { image: url } = graphic.attribute;
41247
+ const { image: url, gif } = graphic.attribute;
41248
+ if (gif && graphic.playing) {
41249
+ return false;
41250
+ }
40042
41251
  if (!url || !graphic.resources) {
40043
41252
  return false;
40044
41253
  }
40045
41254
  const res = graphic.resources.get(url);
40046
- if (res.state !== 'loading') {
41255
+ if (!res || res.state !== 'loading') {
40047
41256
  return false;
40048
41257
  }
40049
41258
  if (!loadingImage) {
@@ -40198,6 +41407,10 @@
40198
41407
  bind(ImageRenderContribution).toService(BeforeImageRenderContribution);
40199
41408
  bind(AfterImageRenderContribution).toSelf().inSingletonScope();
40200
41409
  bind(ImageRenderContribution).toService(AfterImageRenderContribution);
41410
+ bind(BeforeGifImageRenderContribution).toSelf().inSingletonScope();
41411
+ bind(ImageRenderContribution).toService(BeforeGifImageRenderContribution);
41412
+ bind(AfterGifImageRenderContribution).toSelf().inSingletonScope();
41413
+ bind(ImageRenderContribution).toService(AfterGifImageRenderContribution);
40201
41414
  bind(AdjustColorGroupBeforeRenderContribution).toSelf().inSingletonScope();
40202
41415
  bind(GroupRenderContribution).toService(AdjustColorGroupBeforeRenderContribution);
40203
41416
  bind(AdjustColorGroupAfterRenderContribution).toSelf().inSingletonScope();
@@ -43949,10 +45162,7 @@
43949
45162
  }
43950
45163
  }
43951
45164
  updateReactComponentContainer(scene);
43952
- scene.deleteAllSelectBorder();
43953
- scene.table.stateManager.select.ranges.forEach(range => {
43954
- scene.updateCellSelectBorder(range);
43955
- });
45165
+ scene.recreateAllSelectRangeComponents();
43956
45166
  scene.frozenColCount = scene.table.frozenColCount;
43957
45167
  scene.frozenRowCount = scene.colHeaderGroup.firstChild?.childrenCount ?? 0;
43958
45168
  scene.proxy.colStart = scene.bodyGroup.firstChild?.col ?? scene.table.frozenColCount;
@@ -44401,10 +45611,13 @@
44401
45611
  cellNode.children.forEach((node) => {
44402
45612
  if (node.type === 'chart') {
44403
45613
  node.updateData(table.getCellValue(col, row));
44404
- const newAxes = table.internalProps.layoutMap.getChartAxes(col, row);
44405
- node.setAttribute('axes', newAxes);
44406
45614
  const chartSpec = node.attribute.spec;
44407
- chartSpec.axes = newAxes;
45615
+ const chartType = chartSpec.type;
45616
+ if (chartType !== 'gauge' && chartType !== 'rose' && chartType !== 'radar') {
45617
+ const newAxes = table.internalProps.layoutMap.getChartAxes(col, row);
45618
+ node.setAttribute('axes', newAxes);
45619
+ chartSpec.axes = newAxes;
45620
+ }
44408
45621
  node.setAttribute('spec', chartSpec);
44409
45622
  }
44410
45623
  });
@@ -45289,6 +46502,7 @@
45289
46502
  enableLayout: true,
45290
46503
  beforeRender: (stage) => {
45291
46504
  this.table.options.beforeRender && this.table.options.beforeRender(stage);
46505
+ this.table.animationManager.ticker.start();
45292
46506
  },
45293
46507
  afterRender: (stage) => {
45294
46508
  this.table.options.afterRender && this.table.options.afterRender(stage);
@@ -45661,8 +46875,8 @@
45661
46875
  deleteAllSelectBorder(this);
45662
46876
  this.table.stateManager.select.ranges.forEach((cellRange) => {
45663
46877
  updateCellSelectBorder(this, cellRange);
46878
+ moveSelectingRangeComponentsToSelectedRangeComponents(this);
45664
46879
  });
45665
- moveSelectingRangeComponentsToSelectedRangeComponents(this);
45666
46880
  }
45667
46881
  updateColWidth(col, detaX, skipUpdateContainer, skipTableWidthMap) {
45668
46882
  updateColWidth(this, col, Math.round(detaX), skipTableWidthMap);
@@ -46527,7 +47741,7 @@
46527
47741
  this.stage.render();
46528
47742
  this.stage.enableDirtyBounds();
46529
47743
  }
46530
- updateRow(removeCells, addCells, updateCells = []) {
47744
+ updateRow(removeCells, addCells, updateCells = [], recalculateColWidths = true) {
46531
47745
  this.table.internalProps.layoutMap.clearCellRangeMap();
46532
47746
  this.table.internalProps.useOneRowHeightFillAll = false;
46533
47747
  const addRows = deduplication$1(addCells.map(cell => cell.row)).sort((a, b) => a - b);
@@ -46538,7 +47752,7 @@
46538
47752
  }, 0) <=
46539
47753
  this.table.tableNoFrameHeight;
46540
47754
  updateRow(removeCells, addCells, updateCells, this.table);
46541
- this.recalculateColWidths();
47755
+ recalculateColWidths && this.recalculateColWidths();
46542
47756
  if (this.table.heightMode === 'adaptive' ||
46543
47757
  (this.table.autoFillHeight && (this.table.getAllRowsHeight() <= this.table.tableNoFrameHeight || isNotFillHeight))) {
46544
47758
  this.table.scenegraph.recalculateRowHeights();
@@ -46625,6 +47839,15 @@
46625
47839
  updateDomContainer() {
46626
47840
  updateReactContainer(this.table);
46627
47841
  }
47842
+ setLoadingHierarchyState(col, row) {
47843
+ const cellGroup = this.getCell(col, row);
47844
+ const iconGraphic = cellGroup.getChildByName('collapse', true);
47845
+ if (iconGraphic) {
47846
+ const regedIcons = get$2();
47847
+ const loadingIcon = regedIcons[InternalIconName.loadingIconName];
47848
+ dealWithIcon(loadingIcon, iconGraphic, col, row);
47849
+ }
47850
+ }
46628
47851
  }
46629
47852
 
46630
47853
  function checkCellInSelect(col, row, cellRanges) {
@@ -46899,11 +48122,11 @@
46899
48122
  return table._getLayoutCellId(col, row) === table._getLayoutCellId(range1Col, range1Row);
46900
48123
  }
46901
48124
 
46902
- function updateSelectPosition(state, col, row, isShift, isCtrl, isSelectAll, isSelectMoving = false, skipBodyMerge = false) {
48125
+ function updateSelectPosition(state, col, row, isShift, isCtrl, isSelectAll, isSelectMoving = false, skipBodyMerge = false, forceSelect = false) {
46903
48126
  const { table, interactionState } = state;
46904
48127
  const { scenegraph } = table;
46905
48128
  const { highlightScope, disableHeader, cellPos } = state.select;
46906
- if ((disableHeader && table.isHeader(col, row)) || highlightScope === 'none') {
48129
+ if (((disableHeader && table.isHeader(col, row)) || highlightScope === 'none') && forceSelect === false) {
46907
48130
  if (col !== -1 && row !== -1 && !isSelectMoving) {
46908
48131
  table._makeVisibleCell(col, row);
46909
48132
  }
@@ -47458,7 +48681,7 @@
47458
48681
  return target;
47459
48682
  }
47460
48683
 
47461
- function startMoveCol(col, row, x, y, state) {
48684
+ function startMoveCol(col, row, x, y, state, event) {
47462
48685
  if (!('canMoveHeaderPosition' in state.table.internalProps.layoutMap)) {
47463
48686
  return;
47464
48687
  }
@@ -47474,13 +48697,24 @@
47474
48697
  state.table.internalProps.layoutMap.isSeriesNumberInBody(col, row)
47475
48698
  ? state.columnMove.y
47476
48699
  : 0;
47477
- state.table.scenegraph.component.showMoveCol(col, row, delta);
48700
+ const { backX, lineX, backY, lineY } = state.table.scenegraph.component.showMoveCol(col, row, delta);
48701
+ state.table.fireListeners(TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION_START, {
48702
+ col,
48703
+ row,
48704
+ x,
48705
+ y,
48706
+ backX,
48707
+ lineX,
48708
+ backY,
48709
+ lineY,
48710
+ event
48711
+ });
47478
48712
  const isHasSelected = !!state.select.ranges?.length;
47479
48713
  state.table.stateManager.updateSelectPos(-1, -1);
47480
48714
  state.table.stateManager.endSelectCells(true, isHasSelected);
47481
48715
  state.table.scenegraph.updateNextFrame();
47482
48716
  }
47483
- function updateMoveCol(col, row, x, y, state) {
48717
+ function updateMoveCol(col, row, x, y, state, event) {
47484
48718
  if (!('canMoveHeaderPosition' in state.table.internalProps.layoutMap)) {
47485
48719
  return;
47486
48720
  }
@@ -47543,6 +48777,17 @@
47543
48777
  }
47544
48778
  }
47545
48779
  state.table.scenegraph.component.updateMoveCol(backX, lineX, backY, lineY);
48780
+ state.table.fireListeners(TABLE_EVENT_TYPE.CHANGING_HEADER_POSITION, {
48781
+ col,
48782
+ row,
48783
+ x,
48784
+ y,
48785
+ backX,
48786
+ lineX,
48787
+ backY,
48788
+ lineY,
48789
+ event
48790
+ });
47546
48791
  state.table.scenegraph.updateNextFrame();
47547
48792
  }
47548
48793
  }
@@ -48597,11 +49842,12 @@
48597
49842
  }
48598
49843
  }
48599
49844
  setSelectState() {
48600
- const { headerSelectMode, disableSelect, disableHeaderSelect, highlightMode } = Object.assign({}, {
49845
+ const { headerSelectMode, disableSelect, disableHeaderSelect, highlightMode, highlightInRange } = Object.assign({}, {
48601
49846
  headerSelectMode: 'inline',
48602
49847
  disableSelect: false,
48603
49848
  disableHeaderSelect: false,
48604
- highlightMode: 'cell'
49849
+ highlightMode: 'cell',
49850
+ highlightInRange: false
48605
49851
  }, this.table.options.select);
48606
49852
  if (!disableSelect) {
48607
49853
  if (highlightMode === 'cross') {
@@ -48623,6 +49869,7 @@
48623
49869
  this.select.singleStyle = !disableSelect;
48624
49870
  this.select.disableHeader = disableHeaderSelect;
48625
49871
  this.select.headerSelectMode = headerSelectMode;
49872
+ this.select.highlightInRange = highlightInRange;
48626
49873
  }
48627
49874
  isSelected(col, row) {
48628
49875
  let seled = false;
@@ -48664,16 +49911,16 @@
48664
49911
  prev.push({
48665
49912
  field: item.field,
48666
49913
  order: item.order,
48667
- row: column.startInTotal + this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount ?? 0,
48668
- col: column.level
49914
+ row: column?.startInTotal + this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount ?? 0,
49915
+ col: column?.level
48669
49916
  });
48670
49917
  }
48671
49918
  else {
48672
49919
  prev.push({
48673
49920
  field: item.field,
48674
49921
  order: item.order,
48675
- col: column.startInTotal + this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount ?? 0,
48676
- row: column.level
49922
+ col: column?.startInTotal + this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount ?? 0,
49923
+ row: column?.level
48677
49924
  });
48678
49925
  }
48679
49926
  return prev;
@@ -48703,11 +49950,11 @@
48703
49950
  updateHoverPos(col, row) {
48704
49951
  updateHoverPosition(this, col, row);
48705
49952
  }
48706
- updateSelectPos(col, row, isShift = false, isCtrl = false, isSelectAll = false, isSelectMoving = false, skipBodyMerge = false) {
49953
+ updateSelectPos(col, row, isShift = false, isCtrl = false, isSelectAll = false, isSelectMoving = false, skipBodyMerge = false, forceSelect = false) {
48707
49954
  if (row !== -1 && row !== -1) {
48708
49955
  this.select.selecting = true;
48709
49956
  }
48710
- updateSelectPosition(this, col, row, isShift, isCtrl, isSelectAll, isSelectMoving, skipBodyMerge);
49957
+ updateSelectPosition(this, col, row, isShift, isCtrl, isSelectAll, isSelectMoving, skipBodyMerge, forceSelect);
48711
49958
  }
48712
49959
  checkCellRangeInSelect(cellPosStart, cellPosEnd) {
48713
49960
  return checkMultiCellInSelect(cellPosStart, cellPosEnd, this.select.ranges, this.select.highlightScope);
@@ -48897,11 +50144,10 @@
48897
50144
  this.fillHandle.beforeFillMinRow = undefined;
48898
50145
  }
48899
50146
  startMoveCol(col, row, x, y, event) {
48900
- startMoveCol(col, row, x, y, this);
48901
- this.table.fireListeners(TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION_START, { col, row, x, y, event });
50147
+ startMoveCol(col, row, x, y, this, event);
48902
50148
  }
48903
- updateMoveCol(col, row, x, y) {
48904
- updateMoveCol(col, row, x, y, this);
50149
+ updateMoveCol(col, row, x, y, event) {
50150
+ updateMoveCol(col, row, x, y, this, event);
48905
50151
  }
48906
50152
  isMoveCol() {
48907
50153
  return this.columnMove.moving;
@@ -50127,6 +51373,18 @@
50127
51373
  event: e.nativeEvent
50128
51374
  });
50129
51375
  }
51376
+ else if (!endMoveColSuccess) {
51377
+ if (table.hasListeners(TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION_FAIL)) {
51378
+ table.fireListeners(TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION_FAIL, {
51379
+ target: { col: table.stateManager.columnMove.colTarget, row: table.stateManager.columnMove.rowTarget },
51380
+ source: {
51381
+ col: table.stateManager.columnMove.colSource,
51382
+ row: table.stateManager.columnMove.rowSource
51383
+ },
51384
+ event: e
51385
+ });
51386
+ }
51387
+ }
50130
51388
  }
50131
51389
  else if (stateManager.isSelecting()) {
50132
51390
  table.stateManager.endSelectCells();
@@ -51192,6 +52450,18 @@
51192
52450
  });
51193
52451
  }
51194
52452
  }
52453
+ else if (!endMoveColSuccess) {
52454
+ if (table.hasListeners(TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION_FAIL)) {
52455
+ table.fireListeners(TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION_FAIL, {
52456
+ target: { col: table.stateManager.columnMove.colTarget, row: table.stateManager.columnMove.rowTarget },
52457
+ source: {
52458
+ col: table.stateManager.columnMove.colSource,
52459
+ row: table.stateManager.columnMove.rowSource
52460
+ },
52461
+ event: e
52462
+ });
52463
+ }
52464
+ }
51195
52465
  }
51196
52466
  else if (stateManager.isSelecting()) {
51197
52467
  if (table.stateManager.select?.ranges?.length) {
@@ -51941,7 +53211,7 @@
51941
53211
  dealColumnMover(eventArgsSet) {
51942
53212
  const { eventArgs } = eventArgsSet;
51943
53213
  if (isValid$1(eventArgs.col) && isValid$1(eventArgs.row)) {
51944
- this.table.stateManager.updateMoveCol(eventArgs.col, eventArgs.row, eventArgsSet.abstractPos.x, eventArgsSet.abstractPos.y);
53214
+ this.table.stateManager.updateMoveCol(eventArgs.col, eventArgs.row, eventArgsSet.abstractPos.x, eventArgsSet.abstractPos.y, eventArgs?.event?.nativeEvent);
51945
53215
  }
51946
53216
  }
51947
53217
  startColumnResize(eventArgsSet) {
@@ -52174,7 +53444,8 @@
52174
53444
  'hover',
52175
53445
  'cursor',
52176
53446
  'shape',
52177
- 'interactive'
53447
+ 'interactive',
53448
+ 'isGif'
52178
53449
  ];
52179
53450
  const iconPropKeys = ICON_PROP_KEYS;
52180
53451
 
@@ -54042,19 +55313,24 @@
54042
55313
  }
54043
55314
  getCustomCellStyleId(col, row) {
54044
55315
  let customStyleId;
54045
- this.customCellStyleArrangement.forEach(style => {
54046
- if (style.cellPosition.range) {
54047
- if (style.cellPosition.range.start.col <= col &&
54048
- style.cellPosition.range.end.col >= col &&
54049
- style.cellPosition.range.start.row <= row &&
54050
- style.cellPosition.range.end.row >= row) {
54051
- customStyleId = style.customStyleId;
54052
- }
54053
- }
54054
- else if (style.cellPosition.col === col && style.cellPosition.row === row) {
54055
- customStyleId = style.customStyleId;
55316
+ const range = this.table.getCellRange(col, row);
55317
+ for (let c = range.start.col; c <= range.end.col; c++) {
55318
+ for (let r = range.start.row; r <= range.end.row; r++) {
55319
+ this.customCellStyleArrangement.forEach(style => {
55320
+ if (style.cellPosition.range) {
55321
+ if (style.cellPosition.range.start.col <= c &&
55322
+ style.cellPosition.range.end.col >= c &&
55323
+ style.cellPosition.range.start.row <= r &&
55324
+ style.cellPosition.range.end.row >= r) {
55325
+ customStyleId = style.customStyleId;
55326
+ }
55327
+ }
55328
+ else if (style.cellPosition.col === c && style.cellPosition.row === r) {
55329
+ customStyleId = style.customStyleId;
55330
+ }
55331
+ });
54056
55332
  }
54057
- });
55333
+ }
54058
55334
  return customStyleId;
54059
55335
  }
54060
55336
  getCustomCellStyleOption(customStyleId) {
@@ -54101,7 +55377,10 @@
54101
55377
  }
54102
55378
  return style.cellPosition.col === cellPos.col && style.cellPosition.row === cellPos.row;
54103
55379
  });
54104
- if (index === -1) {
55380
+ if (index === -1 && !customStyleId) {
55381
+ return;
55382
+ }
55383
+ else if (index === -1 && customStyleId) {
54105
55384
  this.customCellStyleArrangement.push({
54106
55385
  cellPosition: {
54107
55386
  col: cellPos.col,
@@ -54114,13 +55393,21 @@
54114
55393
  else if (this.customCellStyleArrangement[index].customStyleId === customStyleId) {
54115
55394
  return;
54116
55395
  }
54117
- else {
55396
+ else if (customStyleId) {
54118
55397
  this.customCellStyleArrangement[index].customStyleId = customStyleId;
54119
55398
  }
55399
+ else {
55400
+ this.customCellStyleArrangement.splice(index, 1);
55401
+ }
54120
55402
  if (cellPos.range) {
54121
55403
  for (let col = cellPos.range.start.col; col <= cellPos.range.end.col; col++) {
54122
55404
  for (let row = cellPos.range.start.row; row <= cellPos.range.end.row; row++) {
54123
- this.table.scenegraph.updateCellContent(col, row);
55405
+ const range = this.table.getCellRange(col, row);
55406
+ for (let c = range.start.col; c <= range.end.col; c++) {
55407
+ for (let r = range.start.row; r <= range.end.row; r++) {
55408
+ this.table.scenegraph.updateCellContent(c, r);
55409
+ }
55410
+ }
54124
55411
  }
54125
55412
  }
54126
55413
  }
@@ -56096,7 +57383,10 @@
56096
57383
  constructor(table) {
56097
57384
  this.table = table;
56098
57385
  this.timeline = new DefaultTimeline();
56099
- this.ticker = new DefaultTicker([this.timeline]);
57386
+ this.ticker = new DefaultTicker();
57387
+ this.ticker.addTimeline(this.timeline);
57388
+ const TICKER_FPS = 60;
57389
+ this.ticker.setFPS(TICKER_FPS);
56100
57390
  this.tempGraphic = createRect({});
56101
57391
  }
56102
57392
  scrollTo(position, animationOption) {
@@ -56157,7 +57447,7 @@
56157
57447
  return TABLE_EVENT_TYPE;
56158
57448
  }
56159
57449
  options;
56160
- version = "1.10.5-alpha.0";
57450
+ version = "1.10.6-alpha.0";
56161
57451
  pagination;
56162
57452
  id = `VTable${Date.now()}`;
56163
57453
  headerStyleCache;
@@ -57394,6 +58684,9 @@
57394
58684
  }
57395
58685
  release() {
57396
58686
  const internalProps = this.internalProps;
58687
+ if (this.isReleased) {
58688
+ return;
58689
+ }
57397
58690
  internalProps.tooltipHandler?.release?.();
57398
58691
  internalProps.menuHandler?.release?.();
57399
58692
  IconCache.clearAll();
@@ -57676,9 +58969,9 @@
57676
58969
  clearSelected() {
57677
58970
  this.stateManager.updateSelectPos(-1, -1);
57678
58971
  }
57679
- selectCell(col, row, isShift, isCtrl, makeSelectCellVisible = true) {
58972
+ selectCell(col, row, isShift, isCtrl, makeSelectCellVisible = true, skipBodyMerge = false, forceSelect = false) {
57680
58973
  const isHasSelected = !!this.stateManager.select.ranges?.length;
57681
- this.stateManager.updateSelectPos(col, row, isShift, isCtrl, false, !makeSelectCellVisible);
58974
+ this.stateManager.updateSelectPos(col, row, isShift, isCtrl, false, !makeSelectCellVisible, skipBodyMerge, forceSelect);
57682
58975
  this.stateManager.endSelectCells(true, isHasSelected);
57683
58976
  }
57684
58977
  selectCells(cellRanges) {
@@ -60513,14 +61806,20 @@
60513
61806
  }
60514
61807
  return false;
60515
61808
  }
61809
+ isLeftTopCorner(col, row) {
61810
+ if (col >= 0 && col < this.frozenColCount && row >= 0 && row < this.frozenRowCount) {
61811
+ return true;
61812
+ }
61813
+ return false;
61814
+ }
60516
61815
  isLeftBottomCorner(col, row) {
60517
- if (col >= 0 && col < this.rowHeaderLevelCount && row >= this.rowCount - this.bottomFrozenRowCount) {
61816
+ if (col >= 0 && col < this.frozenColCount && row >= this.rowCount - this.bottomFrozenRowCount) {
60518
61817
  return true;
60519
61818
  }
60520
61819
  return false;
60521
61820
  }
60522
61821
  isRightTopCorner(col, row) {
60523
- if (col >= this.colCount - this.rightFrozenColCount && row >= 0 && row < this.columnHeaderLevelCount) {
61822
+ if (col >= this.colCount - this.rightFrozenColCount && row >= 0 && row < this.frozenRowCount) {
60524
61823
  return true;
60525
61824
  }
60526
61825
  return false;
@@ -62554,11 +63853,11 @@
62554
63853
  const index = this.getRecordShowIndexByCell(col, row);
62555
63854
  return this.dataSource.getHierarchyState(index);
62556
63855
  }
62557
- toggleHierarchyState(col, row) {
63856
+ toggleHierarchyState(col, row, recalculateColWidths = true) {
62558
63857
  this.stateManager.updateHoverIcon(col, row, undefined, undefined);
62559
63858
  const hierarchyState = this.getHierarchyState(col, row);
62560
63859
  if (hierarchyState === HierarchyState.expand) {
62561
- this._refreshHierarchyState(col, row);
63860
+ this._refreshHierarchyState(col, row, recalculateColWidths);
62562
63861
  this.fireListeners(TABLE_EVENT_TYPE.TREE_HIERARCHY_STATE_CHANGE, {
62563
63862
  col: col,
62564
63863
  row: row,
@@ -62568,7 +63867,7 @@
62568
63867
  else if (hierarchyState === HierarchyState.collapse) {
62569
63868
  const record = this.getCellOriginRecord(col, row);
62570
63869
  if (Array.isArray(record.children)) {
62571
- this._refreshHierarchyState(col, row);
63870
+ this._refreshHierarchyState(col, row, recalculateColWidths);
62572
63871
  }
62573
63872
  this.fireListeners(TABLE_EVENT_TYPE.TREE_HIERARCHY_STATE_CHANGE, {
62574
63873
  col: col,
@@ -62578,7 +63877,10 @@
62578
63877
  });
62579
63878
  }
62580
63879
  }
62581
- _refreshHierarchyState(col, row) {
63880
+ setLoadingHierarchyState(col, row) {
63881
+ this.scenegraph.setLoadingHierarchyState(col, row);
63882
+ }
63883
+ _refreshHierarchyState(col, row, recalculateColWidths = true) {
62582
63884
  let notFillWidth = false;
62583
63885
  let notFillHeight = false;
62584
63886
  const checkHasChart = this.internalProps.layoutMap.checkHasChart();
@@ -62616,7 +63918,7 @@
62616
63918
  diffPositions.removeCellPositions = [];
62617
63919
  this.scenegraph.proxy.refreshRowCount();
62618
63920
  }
62619
- this.scenegraph.updateRow(diffPositions.removeCellPositions, diffPositions.addCellPositions, updateCells);
63921
+ this.scenegraph.updateRow(diffPositions.removeCellPositions, diffPositions.addCellPositions, updateCells, recalculateColWidths);
62620
63922
  if (checkHasChart) {
62621
63923
  if (this.autoFillWidth && !notFillWidth) {
62622
63924
  notFillWidth = this.getAllColsWidth() <= this.tableNoFrameWidth;
@@ -62773,8 +64075,10 @@
62773
64075
  const oldHoverState = { col: this.stateManager.hover.cellPos.col, row: this.stateManager.hover.cellPos.row };
62774
64076
  this.scenegraph.clearCells();
62775
64077
  if (sort !== undefined) {
62776
- this.internalProps.sortState = this.internalProps.multipleSort ? (Array.isArray(sort) ? sort : [sort]) : sort;
62777
- this.stateManager.setSortState(this.sortState);
64078
+ if (sort === null || (!Array.isArray(sort) && isValid$1(sort.field)) || Array.isArray(sort)) {
64079
+ this.internalProps.sortState = this.internalProps.multipleSort ? (Array.isArray(sort) ? sort : [sort]) : sort;
64080
+ this.stateManager.setSortState(this.sortState);
64081
+ }
62778
64082
  }
62779
64083
  if (records) {
62780
64084
  _setRecords(this, records);
@@ -62825,12 +64129,12 @@
62825
64129
  }, 0);
62826
64130
  }
62827
64131
  }
62828
- setRecordChildren(records, col, row) {
64132
+ setRecordChildren(records, col, row, recalculateColWidths = true) {
62829
64133
  const record = this.getCellOriginRecord(col, row);
62830
64134
  record.children = records;
62831
64135
  const index = this.getRecordShowIndexByCell(col, row);
62832
64136
  this.dataSource.setRecord(record, index);
62833
- this._refreshHierarchyState(col, row);
64137
+ this._refreshHierarchyState(col, row, recalculateColWidths);
62834
64138
  }
62835
64139
  startEditCell(col, row, value) {
62836
64140
  if (isValid$1(col) && isValid$1(row)) {
@@ -68661,14 +69965,20 @@
68661
69965
  }
68662
69966
  return false;
68663
69967
  }
69968
+ isLeftTopCorner(col, row) {
69969
+ if (col >= 0 && col < this.frozenColCount && row >= 0 && row < this.frozenRowCount) {
69970
+ return true;
69971
+ }
69972
+ return false;
69973
+ }
68664
69974
  isLeftBottomCorner(col, row) {
68665
- if (col >= 0 && col < this.rowHeaderLevelCount && row >= this.rowCount - this.bottomFrozenRowCount) {
69975
+ if (col >= 0 && col < this.frozenColCount && row >= this.rowCount - this.bottomFrozenRowCount) {
68666
69976
  return true;
68667
69977
  }
68668
69978
  return false;
68669
69979
  }
68670
69980
  isRightTopCorner(col, row) {
68671
- if (col >= this.colCount - this.rightFrozenColCount && row >= 0 && row < this.columnHeaderLevelCount) {
69981
+ if (col >= this.colCount - this.rightFrozenColCount && row >= 0 && row < this.frozenRowCount) {
68672
69982
  return true;
68673
69983
  }
68674
69984
  return false;
@@ -73354,10 +74664,10 @@
73354
74664
  }
73355
74665
  return null;
73356
74666
  }
73357
- toggleHierarchyState(col, row) {
74667
+ toggleHierarchyState(col, row, recalculateColWidths = true) {
73358
74668
  const hierarchyState = this.getHierarchyState(col, row);
73359
74669
  if (hierarchyState === HierarchyState.expand) {
73360
- this._refreshHierarchyState(col, row);
74670
+ this._refreshHierarchyState(col, row, recalculateColWidths);
73361
74671
  this.fireListeners(PIVOT_TABLE_EVENT_TYPE.TREE_HIERARCHY_STATE_CHANGE, {
73362
74672
  col: col,
73363
74673
  row: row,
@@ -73367,7 +74677,7 @@
73367
74677
  else if (hierarchyState === HierarchyState.collapse) {
73368
74678
  const headerTreeNode = this.internalProps.layoutMap.getHeadNode(col, row);
73369
74679
  if (Array.isArray(headerTreeNode.children)) {
73370
- this._refreshHierarchyState(col, row);
74680
+ this._refreshHierarchyState(col, row, recalculateColWidths);
73371
74681
  }
73372
74682
  this.fireListeners(PIVOT_TABLE_EVENT_TYPE.TREE_HIERARCHY_STATE_CHANGE, {
73373
74683
  col: col,
@@ -73377,7 +74687,7 @@
73377
74687
  });
73378
74688
  }
73379
74689
  }
73380
- _refreshHierarchyState(col, row, beforeUpdateCell) {
74690
+ _refreshHierarchyState(col, row, recalculateColWidths = true, beforeUpdateCell) {
73381
74691
  let notFillWidth = false;
73382
74692
  let notFillHeight = false;
73383
74693
  this.stateManager.updateHoverIcon(col, row, undefined, undefined);
@@ -73395,7 +74705,7 @@
73395
74705
  this.refreshRowColCount();
73396
74706
  this.clearCellStyleCache();
73397
74707
  this.scenegraph.updateHierarchyIcon(col, row);
73398
- this.scenegraph.updateRow(result.removeCellPositions, result.addCellPositions, result.updateCellPositions);
74708
+ this.scenegraph.updateRow(result.removeCellPositions, result.addCellPositions, result.updateCellPositions, recalculateColWidths);
73399
74709
  if (checkHasChart) {
73400
74710
  if (this.autoFillWidth && !notFillWidth) {
73401
74711
  notFillWidth = this.getAllColsWidth() <= this.tableNoFrameWidth;
@@ -73831,7 +75141,7 @@
73831
75141
  if (this.flatDataToObjects) {
73832
75142
  const headerTreeNode = this.internalProps.layoutMap.getHeadNode(col, row);
73833
75143
  headerTreeNode.children = children;
73834
- this._refreshHierarchyState(col, row, () => {
75144
+ this._refreshHierarchyState(col, row, true, () => {
73835
75145
  this.flatDataToObjects.changeDataConfig({
73836
75146
  rows: this.internalProps.layoutMap.fullRowDimensionKeys,
73837
75147
  columns: this.internalProps.layoutMap.colDimensionKeys,
@@ -73845,7 +75155,7 @@
73845
75155
  else {
73846
75156
  const headerTreeNode = this.internalProps.layoutMap.getHeadNode(col, row);
73847
75157
  headerTreeNode.children = children;
73848
- this._refreshHierarchyState(col, row, () => {
75158
+ this._refreshHierarchyState(col, row, true, () => {
73849
75159
  this.dataset._rowTreeHasChanged();
73850
75160
  this.dataset.changeDataConfig({
73851
75161
  rows: this.internalProps.layoutMap.fullRowDimensionKeys,
@@ -74454,7 +75764,7 @@
74454
75764
  }
74455
75765
  return null;
74456
75766
  }
74457
- toggleHierarchyState(col, row) {
75767
+ toggleHierarchyState(col, row, recalculateColWidths = true) {
74458
75768
  }
74459
75769
  getHeaderCellAddressByPath(dimensionPaths) {
74460
75770
  const cellAddress = this.internalProps.layoutMap.getPivotCellAdress(dimensionPaths);
@@ -74690,6 +76000,12 @@
74690
76000
  delete spec.area.state.selected;
74691
76001
  delete spec.area.state.selected_reverse;
74692
76002
  }
76003
+ if (spec.pie?.state?.selected) {
76004
+ spec.pie.state.vtable_selected = spec.pie.state.selected;
76005
+ spec.pie.state.vtable_selected_reverse = spec.pie.state.selected_reverse;
76006
+ delete spec.pie.state.selected;
76007
+ delete spec.pie.state.selected_reverse;
76008
+ }
74693
76009
  };
74694
76010
  this.internalProps.indicators?.forEach((indicator) => {
74695
76011
  if (indicator.chartSpec) {
@@ -75512,8 +76828,237 @@
75512
76828
  return new Radio(params ? params.attribute : {});
75513
76829
  }
75514
76830
 
76831
+ class CarouselAnimationPlugin {
76832
+ table;
76833
+ rowCount;
76834
+ colCount;
76835
+ animationDuration;
76836
+ animationDelay;
76837
+ animationEasing;
76838
+ replaceScrollAction;
76839
+ playing;
76840
+ row;
76841
+ col;
76842
+ constructor(table, options) {
76843
+ this.table = table;
76844
+ this.rowCount = options?.rowCount ?? undefined;
76845
+ this.colCount = options?.colCount ?? undefined;
76846
+ this.animationDuration = options?.animationDuration ?? 500;
76847
+ this.animationDelay = options?.animationDelay ?? 1000;
76848
+ this.animationEasing = options?.animationEasing ?? 'linear';
76849
+ this.replaceScrollAction = options?.replaceScrollAction ?? false;
76850
+ this.playing = false;
76851
+ this.row = table.frozenRowCount;
76852
+ this.col = table.frozenColCount;
76853
+ this.init();
76854
+ }
76855
+ init() {
76856
+ if (this.replaceScrollAction) {
76857
+ this.table.disableScroll();
76858
+ this.table.scenegraph.stage.addEventListener('wheel', this.onScrollEnd.bind(this));
76859
+ }
76860
+ }
76861
+ onScrollEnd(e) {
76862
+ if (this.rowCount) {
76863
+ if (e.deltaY > 0) {
76864
+ this.row += this.rowCount;
76865
+ this.row = Math.min(this.row, this.table.rowCount - this.table.frozenRowCount);
76866
+ }
76867
+ else if (e.deltaY < 0) {
76868
+ this.row -= this.rowCount;
76869
+ this.row = Math.max(this.row, this.table.frozenRowCount);
76870
+ }
76871
+ this.table.scrollToRow(this.row, { duration: this.animationDuration, easing: this.animationEasing });
76872
+ }
76873
+ else if (this.colCount) {
76874
+ if (e.deltaX > 0) {
76875
+ this.col += this.colCount;
76876
+ this.col = Math.min(this.col, this.table.colCount - this.table.frozenColCount);
76877
+ }
76878
+ else if (e.deltaX < 0) {
76879
+ this.col -= this.colCount;
76880
+ this.col = Math.max(this.col, this.table.frozenColCount);
76881
+ }
76882
+ this.table.scrollToCol(this.col, { duration: this.animationDuration, easing: this.animationEasing });
76883
+ }
76884
+ }
76885
+ play() {
76886
+ this.playing = true;
76887
+ if (this.rowCount) {
76888
+ this.updateRow();
76889
+ }
76890
+ else if (this.colCount) {
76891
+ this.updateCol();
76892
+ }
76893
+ }
76894
+ pause() {
76895
+ this.playing = false;
76896
+ }
76897
+ updateRow() {
76898
+ if (!this.playing) {
76899
+ return;
76900
+ }
76901
+ if (this.table.scenegraph.proxy.screenTopRow !== this.row) {
76902
+ this.row = this.table.frozenRowCount;
76903
+ }
76904
+ else {
76905
+ this.row += this.rowCount;
76906
+ }
76907
+ this.table.scrollToRow(this.row, { duration: this.animationDuration, easing: this.animationEasing });
76908
+ setTimeout(() => {
76909
+ this.updateRow();
76910
+ }, this.animationDuration + this.animationDelay);
76911
+ }
76912
+ updateCol() {
76913
+ if (!this.playing) {
76914
+ return;
76915
+ }
76916
+ if (this.table.scenegraph.proxy.screenLeftCol !== this.col) {
76917
+ this.col = this.table.frozenColCount;
76918
+ }
76919
+ else {
76920
+ this.col += this.colCount;
76921
+ }
76922
+ this.table.scrollToCol(this.col, { duration: this.animationDuration, easing: this.animationEasing });
76923
+ setTimeout(() => {
76924
+ this.updateCol();
76925
+ }, this.animationDuration + 50);
76926
+ }
76927
+ }
76928
+
76929
+ class HeaderHighlightPlugin {
76930
+ table;
76931
+ options;
76932
+ colHeaderRange;
76933
+ rowHeaderRange;
76934
+ constructor(table, options) {
76935
+ this.table = table;
76936
+ this.options = options;
76937
+ this.registerStyle();
76938
+ this.bindEvent();
76939
+ }
76940
+ registerStyle() {
76941
+ this.table.registerCustomCellStyle('col-highlight', {
76942
+ bgColor: this.options?.colHighlightBGColor ?? '#82b2f5',
76943
+ color: this.options?.colHighlightColor ?? '#FFF'
76944
+ });
76945
+ this.table.registerCustomCellStyle('row-highlight', {
76946
+ bgColor: this.options?.rowHighlightBGColor ?? '#82b2f5',
76947
+ color: this.options?.rowHighlightColor ?? '#FFF'
76948
+ });
76949
+ }
76950
+ bindEvent() {
76951
+ this.table.on('selected_cell', e => {
76952
+ this.updateHighlight();
76953
+ });
76954
+ this.table.on('selected_clear', () => {
76955
+ this.clearHighlight();
76956
+ });
76957
+ }
76958
+ clearHighlight() {
76959
+ this.colHeaderRange && this.table.arrangeCustomCellStyle({ range: this.colHeaderRange }, undefined);
76960
+ this.rowHeaderRange && this.table.arrangeCustomCellStyle({ range: this.rowHeaderRange }, undefined);
76961
+ this.colHeaderRange = undefined;
76962
+ this.rowHeaderRange = undefined;
76963
+ }
76964
+ updateHighlight() {
76965
+ if (this.options?.colHighlight === false && this.options?.rowHighlight === false) {
76966
+ return;
76967
+ }
76968
+ const selectRanges = this.table.getSelectedCellRanges();
76969
+ if (selectRanges.length === 0) {
76970
+ this.clearHighlight();
76971
+ return;
76972
+ }
76973
+ const selectRange = selectRanges[0];
76974
+ const rowSelectRange = [selectRange.start.row, selectRange.end.row];
76975
+ rowSelectRange.sort((a, b) => a - b);
76976
+ const colSelectRange = [selectRange.start.col, selectRange.end.col];
76977
+ colSelectRange.sort((a, b) => a - b);
76978
+ let colHeaderRange;
76979
+ let rowHeaderRange;
76980
+ if (this.table.isPivotTable()) {
76981
+ colHeaderRange = {
76982
+ start: {
76983
+ col: colSelectRange[0],
76984
+ row: 0
76985
+ },
76986
+ end: {
76987
+ col: colSelectRange[1],
76988
+ row: this.table.columnHeaderLevelCount - 1
76989
+ }
76990
+ };
76991
+ rowHeaderRange = {
76992
+ start: {
76993
+ col: 0,
76994
+ row: rowSelectRange[0]
76995
+ },
76996
+ end: {
76997
+ col: this.table.rowHeaderLevelCount - 1,
76998
+ row: rowSelectRange[1]
76999
+ }
77000
+ };
77001
+ }
77002
+ else if (this.table.internalProps.transpose) {
77003
+ rowHeaderRange = {
77004
+ start: {
77005
+ col: 0,
77006
+ row: rowSelectRange[0]
77007
+ },
77008
+ end: {
77009
+ col: this.table.rowHeaderLevelCount - 1,
77010
+ row: rowSelectRange[1]
77011
+ }
77012
+ };
77013
+ }
77014
+ else {
77015
+ colHeaderRange = {
77016
+ start: {
77017
+ col: colSelectRange[0],
77018
+ row: 0
77019
+ },
77020
+ end: {
77021
+ col: colSelectRange[1],
77022
+ row: this.table.columnHeaderLevelCount - 1
77023
+ }
77024
+ };
77025
+ if (this.table.internalProps.rowSeriesNumber) {
77026
+ rowHeaderRange = {
77027
+ start: {
77028
+ col: 0,
77029
+ row: rowSelectRange[0]
77030
+ },
77031
+ end: {
77032
+ col: 0,
77033
+ row: rowSelectRange[1]
77034
+ }
77035
+ };
77036
+ }
77037
+ }
77038
+ if (this.options?.colHighlight !== false && !isSameRange(this.colHeaderRange, colHeaderRange)) {
77039
+ this.colHeaderRange && this.table.arrangeCustomCellStyle({ range: this.colHeaderRange }, undefined);
77040
+ colHeaderRange && this.table.arrangeCustomCellStyle({ range: colHeaderRange }, 'col-highlight');
77041
+ this.colHeaderRange = colHeaderRange;
77042
+ }
77043
+ if (this.options?.rowHighlight !== false && !isSameRange(this.rowHeaderRange, rowHeaderRange)) {
77044
+ this.rowHeaderRange && this.table.arrangeCustomCellStyle({ range: this.rowHeaderRange }, undefined);
77045
+ rowHeaderRange && this.table.arrangeCustomCellStyle({ range: rowHeaderRange }, 'row-highlight');
77046
+ this.rowHeaderRange = rowHeaderRange;
77047
+ }
77048
+ }
77049
+ }
77050
+ function isSameRange(a, b) {
77051
+ if (a === undefined && b === undefined) {
77052
+ return true;
77053
+ }
77054
+ if (a === undefined || b === undefined) {
77055
+ return false;
77056
+ }
77057
+ return (a.start.col === b.start.col && a.start.row === b.start.row && a.end.col === b.end.col && a.end.row === b.end.row);
77058
+ }
77059
+
75515
77060
  registerForVrender();
75516
- const version = "1.10.5-alpha.0";
77061
+ const version = "1.10.6-alpha.0";
75517
77062
  function getIcons() {
75518
77063
  return get$2();
75519
77064
  }
@@ -75521,8 +77066,11 @@
75521
77066
  clearAll();
75522
77067
  }
75523
77068
 
77069
+ exports.CarouselAnimationPlugin = CarouselAnimationPlugin;
75524
77070
  exports.CustomLayout = index;
75525
77071
  exports.DataStatistics = DataStatistics;
77072
+ exports.HeaderHighlightPlugin = HeaderHighlightPlugin;
77073
+ exports.InvertHighlightPlugin = InvertHighlightPlugin;
75526
77074
  exports.ListTable = ListTableAll;
75527
77075
  exports.ListTableSimple = ListTableSimple;
75528
77076
  exports.PIVOT_CHART_EVENT_TYPE = PIVOT_CHART_EVENT_TYPE;
@@ -75555,6 +77103,7 @@
75555
77103
  exports.getTargetCell = getTargetCell;
75556
77104
  exports.graphicUtil = graphicUtil;
75557
77105
  exports.jsx = jsx;
77106
+ exports.onBeforeAttributeUpdateForInvertHighlight = onBeforeAttributeUpdateForInvertHighlight;
75558
77107
  exports.register = register$1;
75559
77108
  exports.registerAxis = registerAxis;
75560
77109
  exports.registerChartCell = registerChartCell;