@visactor/vue-vtable 1.17.1 → 1.17.2

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 (131) hide show
  1. package/cjs/{packages/vue-vtable/src/components → components}/custom/vtable-vue-attribute-plugin.js +6 -7
  2. package/cjs/{packages/vue-vtable/src/hooks → hooks}/useCellRender.js +2 -2
  3. package/cjs/index.d.ts +1 -1
  4. package/cjs/{packages/vue-vtable/src/index.js → index.js} +1 -1
  5. package/dist/vue-vtable.js +11 -1795
  6. package/dist/vue-vtable.min.js +1 -1
  7. package/es/{packages/vue-vtable/src/components → components}/custom/vtable-vue-attribute-plugin.js +1 -2
  8. package/es/{packages/vue-vtable/src/hooks → hooks}/useCellRender.js +2 -2
  9. package/es/index.d.ts +1 -1
  10. package/es/{packages/vue-vtable/src/index.js → index.js} +1 -1
  11. package/package.json +3 -3
  12. package/cjs/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/application.js +0 -7
  13. package/cjs/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/bezier-utils.js +0 -33
  14. package/cjs/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/bounds-context.js +0 -57
  15. package/cjs/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/custom-path2d.js +0 -291
  16. package/cjs/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/enums.js +0 -38
  17. package/cjs/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/generator.js +0 -10
  18. package/cjs/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/path-svg.js +0 -58
  19. package/cjs/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/render-command-list.js +0 -16
  20. package/cjs/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/seg-context.js +0 -94
  21. package/cjs/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/segment/basis.js +0 -63
  22. package/cjs/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/segment/catmull-rom-close.js +0 -73
  23. package/cjs/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/segment/catmull-rom.js +0 -99
  24. package/cjs/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/segment/common.js +0 -17
  25. package/cjs/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/segment/curve/base.js +0 -9
  26. package/cjs/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/segment/curve/cubic-bezier.js +0 -34
  27. package/cjs/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/segment/curve/line.js +0 -29
  28. package/cjs/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/segment/curve/path.js +0 -26
  29. package/cjs/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/segment/index.js +0 -57
  30. package/cjs/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/segment/linear-closed.js +0 -27
  31. package/cjs/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/segment/linear.js +0 -55
  32. package/cjs/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/segment/monotone.js +0 -121
  33. package/cjs/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/segment/step.js +0 -63
  34. package/cjs/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/shape/arc.js +0 -100
  35. package/cjs/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/text.js +0 -16
  36. package/cjs/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/graphic/config.js +0 -305
  37. package/cjs/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/graphic/theme.js +0 -121
  38. package/cjs/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/interface/graphic/text.js +0 -6
  39. package/cjs/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/plugins/builtin-plugin/html-attribute-plugin.js +0 -194
  40. package/es/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/application.js +0 -4
  41. package/es/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/bezier-utils.js +0 -28
  42. package/es/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/bounds-context.js +0 -55
  43. package/es/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/custom-path2d.js +0 -289
  44. package/es/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/enums.js +0 -38
  45. package/es/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/generator.js +0 -8
  46. package/es/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/path-svg.js +0 -55
  47. package/es/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/render-command-list.js +0 -14
  48. package/es/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/seg-context.js +0 -91
  49. package/es/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/segment/basis.js +0 -58
  50. package/es/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/segment/catmull-rom-close.js +0 -70
  51. package/es/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/segment/catmull-rom.js +0 -94
  52. package/es/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/segment/common.js +0 -14
  53. package/es/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/segment/curve/base.js +0 -7
  54. package/es/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/segment/curve/cubic-bezier.js +0 -32
  55. package/es/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/segment/curve/line.js +0 -27
  56. package/es/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/segment/curve/path.js +0 -24
  57. package/es/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/segment/index.js +0 -41
  58. package/es/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/segment/linear-closed.js +0 -23
  59. package/es/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/segment/linear.js +0 -51
  60. package/es/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/segment/monotone.js +0 -114
  61. package/es/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/segment/step.js +0 -59
  62. package/es/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/shape/arc.js +0 -95
  63. package/es/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/common/text.js +0 -14
  64. package/es/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/graphic/config.js +0 -280
  65. package/es/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/graphic/theme.js +0 -115
  66. package/es/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/interface/graphic/text.js +0 -6
  67. package/es/common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/plugins/builtin-plugin/html-attribute-plugin.js +0 -192
  68. /package/cjs/{packages/vue-vtable/src/components → components}/component/menu.js +0 -0
  69. /package/cjs/{packages/vue-vtable/src/components → components}/component/tooltip.js +0 -0
  70. /package/cjs/{packages/vue-vtable/src/components → components}/custom/checkBox.js +0 -0
  71. /package/cjs/{packages/vue-vtable/src/components → components}/custom/group.js +0 -0
  72. /package/cjs/{packages/vue-vtable/src/components → components}/custom/image.js +0 -0
  73. /package/cjs/{packages/vue-vtable/src/components → components}/custom/radio.js +0 -0
  74. /package/cjs/{packages/vue-vtable/src/components → components}/custom/tag.js +0 -0
  75. /package/cjs/{packages/vue-vtable/src/components → components}/custom/text.js +0 -0
  76. /package/cjs/{packages/vue-vtable/src/components → components}/list/list-column.js +0 -0
  77. /package/cjs/{packages/vue-vtable/src/components → components}/pivot/pivot-column-dimension.js +0 -0
  78. /package/cjs/{packages/vue-vtable/src/components → components}/pivot/pivot-column-header-title.js +0 -0
  79. /package/cjs/{packages/vue-vtable/src/components → components}/pivot/pivot-corner.js +0 -0
  80. /package/cjs/{packages/vue-vtable/src/components → components}/pivot/pivot-indicator.js +0 -0
  81. /package/cjs/{packages/vue-vtable/src/components → components}/pivot/pivot-row-dimension.js +0 -0
  82. /package/cjs/{packages/vue-vtable/src/components → components}/pivot/pivot-row-header-title.js +0 -0
  83. /package/cjs/{packages/vue-vtable/src/edit → edit}/editor.js +0 -0
  84. /package/cjs/{packages/vue-vtable/src/edit → edit}/util.js +0 -0
  85. /package/cjs/{packages/vue-vtable/src/eventsUtils.js → eventsUtils.js} +0 -0
  86. /package/cjs/{packages/vue-vtable/src/hooks → hooks}/useEditorRender.js +0 -0
  87. /package/cjs/{packages/vue-vtable/src/tables → tables}/base-table.vue.js +0 -0
  88. /package/cjs/{packages/vue-vtable/src/tables → tables}/base-table.vue2.js +0 -0
  89. /package/cjs/{packages/vue-vtable/src/tables → tables}/chartModule.js +0 -0
  90. /package/cjs/{packages/vue-vtable/src/tables → tables}/list-table.vue.js +0 -0
  91. /package/cjs/{packages/vue-vtable/src/tables → tables}/list-table.vue2.js +0 -0
  92. /package/cjs/{packages/vue-vtable/src/tables → tables}/pivot-chart.vue.js +0 -0
  93. /package/cjs/{packages/vue-vtable/src/tables → tables}/pivot-chart.vue2.js +0 -0
  94. /package/cjs/{packages/vue-vtable/src/tables → tables}/pivot-table.vue.js +0 -0
  95. /package/cjs/{packages/vue-vtable/src/tables → tables}/pivot-table.vue2.js +0 -0
  96. /package/cjs/{packages/vue-vtable/src/utils → utils}/customLayoutUtils.js +0 -0
  97. /package/cjs/{packages/vue-vtable/src/utils → utils}/slotUtils.js +0 -0
  98. /package/cjs/{packages/vue-vtable/src/utils → utils}/stringUtils.js +0 -0
  99. /package/cjs/{packages/vue-vtable/src/utils → utils}/vnodeUtils.js +0 -0
  100. /package/es/{packages/vue-vtable/src/components → components}/component/menu.js +0 -0
  101. /package/es/{packages/vue-vtable/src/components → components}/component/tooltip.js +0 -0
  102. /package/es/{packages/vue-vtable/src/components → components}/custom/checkBox.js +0 -0
  103. /package/es/{packages/vue-vtable/src/components → components}/custom/group.js +0 -0
  104. /package/es/{packages/vue-vtable/src/components → components}/custom/image.js +0 -0
  105. /package/es/{packages/vue-vtable/src/components → components}/custom/radio.js +0 -0
  106. /package/es/{packages/vue-vtable/src/components → components}/custom/tag.js +0 -0
  107. /package/es/{packages/vue-vtable/src/components → components}/custom/text.js +0 -0
  108. /package/es/{packages/vue-vtable/src/components → components}/list/list-column.js +0 -0
  109. /package/es/{packages/vue-vtable/src/components → components}/pivot/pivot-column-dimension.js +0 -0
  110. /package/es/{packages/vue-vtable/src/components → components}/pivot/pivot-column-header-title.js +0 -0
  111. /package/es/{packages/vue-vtable/src/components → components}/pivot/pivot-corner.js +0 -0
  112. /package/es/{packages/vue-vtable/src/components → components}/pivot/pivot-indicator.js +0 -0
  113. /package/es/{packages/vue-vtable/src/components → components}/pivot/pivot-row-dimension.js +0 -0
  114. /package/es/{packages/vue-vtable/src/components → components}/pivot/pivot-row-header-title.js +0 -0
  115. /package/es/{packages/vue-vtable/src/edit → edit}/editor.js +0 -0
  116. /package/es/{packages/vue-vtable/src/edit → edit}/util.js +0 -0
  117. /package/es/{packages/vue-vtable/src/eventsUtils.js → eventsUtils.js} +0 -0
  118. /package/es/{packages/vue-vtable/src/hooks → hooks}/useEditorRender.js +0 -0
  119. /package/es/{packages/vue-vtable/src/tables → tables}/base-table.vue.js +0 -0
  120. /package/es/{packages/vue-vtable/src/tables → tables}/base-table.vue2.js +0 -0
  121. /package/es/{packages/vue-vtable/src/tables → tables}/chartModule.js +0 -0
  122. /package/es/{packages/vue-vtable/src/tables → tables}/list-table.vue.js +0 -0
  123. /package/es/{packages/vue-vtable/src/tables → tables}/list-table.vue2.js +0 -0
  124. /package/es/{packages/vue-vtable/src/tables → tables}/pivot-chart.vue.js +0 -0
  125. /package/es/{packages/vue-vtable/src/tables → tables}/pivot-chart.vue2.js +0 -0
  126. /package/es/{packages/vue-vtable/src/tables → tables}/pivot-table.vue.js +0 -0
  127. /package/es/{packages/vue-vtable/src/tables → tables}/pivot-table.vue2.js +0 -0
  128. /package/es/{packages/vue-vtable/src/utils → utils}/customLayoutUtils.js +0 -0
  129. /package/es/{packages/vue-vtable/src/utils → utils}/slotUtils.js +0 -0
  130. /package/es/{packages/vue-vtable/src/utils → utils}/stringUtils.js +0 -0
  131. /package/es/{packages/vue-vtable/src/utils → utils}/vnodeUtils.js +0 -0
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@visactor/vtable"),require("vue"),require("@visactor/vutils")):"function"==typeof define&&define.amd?define(["exports","@visactor/vtable","vue","@visactor/vutils"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).VueVTable={},t.VTable,t.vue,t.vutils)}(this,(function(t,e,i,n){"use strict";function s(t){var e=Object.create(null);return t&&Object.keys(t).forEach((function(i){if("default"!==i){var n=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,n.get?n:{enumerable:!0,get:function(){return t[i]}})}})),e.default=t,Object.freeze(e)}var o=s(e);function r(t){return t.replace(/-([a-z])/g,(t=>t[1].toUpperCase()))}function a(t){const e={};for(const i in t)if(t.hasOwnProperty(i)){e[r(i)]=t[i]}return e}function l(t){return t.flatMap((t=>Array.isArray(t.children)?l(t.children):t))}function h(t,e,s){const l={Group:o.CustomLayout.Group,Image:o.CustomLayout.Image,Text:o.CustomLayout.Text,Tag:o.CustomLayout.Tag,Radio:o.CustomLayout.Radio,CheckBox:o.CustomLayout.CheckBox};return{rootComponent:function t(o){if(!o)return null;const{type:h,children:c}=o,u=a(o.props),d=l[h?.symbol||h?.name];if(!d)return null;const p=new d({...u});!function(t,e){Object.keys(e).forEach((i=>{if(function(t,e){return t.startsWith("on")&&n.isFunction(e[t])}(i,e)){let n;n=i.startsWith("on")?i.slice(2).toLowerCase():r(i.slice(2)).toLowerCase(),t.addEventListener(n,e[i])}}))}(p,u);const _=function(t){return t?.default?.()||t||[]}(c);if(n.isObject(u?.vue)){const{element:t}=u.vue,n=t??_[0];return Object.assign(o.props.vue,{element:i.isVNode(n)?n:null,container:e?s?.table?.headerDomContainer:s?.table?.bodyDomContainer}),p}return _.forEach((e=>{const i=t(e);i?p.add(i):e.type===Symbol.for("v-fgt")&&e.children.forEach((e=>{const i=t(e);i&&p.add(i)}))})),p}(t)}}function c(t,e){return i=>{const{table:n,row:s,col:o,rect:r}=i,a=n.getCellOriginRecord(o,s),{height:l,width:c}=r??n.getCellRect(o,s),u=e?"headerCustomLayout":"customLayout";if(!t[u])return null;const d=t[u]({table:n,row:s,col:o,rect:r,record:a,height:l,width:c})[0],{rootComponent:p}=h(d,e,i);return{rootContainer:p,renderDefault:!1}}}class u{wrapContainer;tableContainer;currentValue;nodeMap;constructor(){this.tableContainer=null,this.currentValue=null,this.wrapContainer=null,this.nodeMap=new Map}registerNode(t,e,i){n.isValid(t)&&n.isValid(e)&&"function"==typeof i&&(this.nodeMap.has(t)||this.nodeMap.set(t,new Map),this.nodeMap.get(t).set(e,i))}getNode(t,e){return this.nodeMap.get(t)?.get(e)}removeNode(t){this.nodeMap.delete(t)}release(t){n.isValid(t)?this.removeNode(t):this.nodeMap.clear()}async onStart(t){const{value:e}=t;this.setValue(e),await this.createElement(t)}async createElement(t){const{row:s,col:o,value:r,table:a,container:l,referencePosition:h}=t;if(!l)return!1;const c=a.getBodyColumnDefine(o,s),{editConfig:u}=c||{},{id:d}=a,p=this.getColumnKeyField(c);if(!n.isValid(p)||!n.isValid(d))return!1;if("function"==typeof u?.editBefore){if(!await u.editBefore(t))return a.showTooltip(o,s,{content:u.disablePrompt||"This field is not allowed to be edited",referencePosition:{rect:h?.rect,placement:e.TYPES.Placement.top},style:{bgColor:"black",color:"white",arrowMark:!0},disappearDelay:1e3}),!1}const _=this.getNode(d,p)?.({row:s,col:o,value:r,table:a,onChange:t=>this.setValue(t)})?.[0];if(!_||!i.isVNode(_))return!1;const g=document.createElement("div");g.style.position="absolute",g.style.width="100%",g.style.boxSizing="border-box";const{bgColor:f}=a.getCellStyle(o,s)||{};return g.style.backgroundColor=f||"#FFFFFF",this.wrapContainer=g,this.tableContainer=l,this.tableContainer.appendChild(g),i.render(_,g),h?.rect&&this.adjustPosition(h.rect),!0}getColumnKeyField(t){const{field:e,key:i}=t||{};return n.isValid(i)?i:e}getValue(){return this.currentValue}setValue(t){this.currentValue=t}adjustPosition(t){this.wrapContainer&&(this.wrapContainer.style.top=`${t.top}px`,this.wrapContainer.style.left=`${t.left}px`,this.wrapContainer.style.width=`${t.width}px`,this.wrapContainer.style.height=`${t.height}px`)}async validateValue(t,i,s,o){const{col:r,row:a}=s||{};if(!n.isValid(r)||!n.isValid(a))return!0;const l=o.getBodyColumnDefine(r,a),{editConfig:h}=l||{};if("function"==typeof h?.validateValue){const n=await h.validateValue({col:r,row:a,value:t,oldValue:i,table:o});if(!1===n){const t=o.getVisibleCellRangeRelativeRect({col:r,row:a});return o.showTooltip(r,a,{content:h.invalidPrompt||"invalid",referencePosition:{rect:t,placement:e.TYPES.Placement.top},style:{bgColor:"red",color:"white",arrowMark:!0},disappearDelay:1e3}),!1}return n}return!0}onEnd(){this.wrapContainer&&this.tableContainer&&(i.render(null,this.wrapContainer),this.tableContainer.removeChild(this.wrapContainer)),this.wrapContainer=null,this.tableContainer=null}isEditorElement(t){return this.wrapContainer?.contains(t)||this.isClickEditorElement(t)}isClickEditorElement(t){for(;t;){if(t.classList&&t.classList.contains("table-editor-element"))return!0;t=t.parentNode}return!1}}const d="dynamic-render-editor";function p(t,e){const{editor:i}=t||{},s=_(t);return!(!n.isValid(s)||i!==d)&&("function"==typeof e?(t.getEditCustomNode=e,!0):"function"==typeof t.getEditCustomNode)}function _(t){const{field:e,key:i}=t||{};return n.isValid(i)?i:e}function g(t){let i=e.register.editor(d);return!i&&t&&(i=new u,e.register.editor(d,i)),i}function f(t){const e={columns:[],columnHeaderTitle:[],rows:[],rowHeaderTitle:[],indicators:[],corner:{},tooltip:{},menu:{}},i={PivotColumnDimension:"columns",PivotColumnHeaderTitle:"columnHeaderTitle",PivotRowDimension:"rows",PivotRowHeaderTitle:"rowHeaderTitle",PivotCorner:"corner",PivotIndicator:"indicators",Tooltip:"tooltip",Menu:"menu"};return t.forEach((t=>{t.props=a(t.props);const n=t.type?.symbol||t.type?.name,s=i[n];s&&(Array.isArray(e[s])?t.props.hasOwnProperty("objectHandler")?e[s].push(t.props.objectHandler):e[s].push(t.props):e[s]=t.props)})),e}function m(t,e){return{...t,columns:e.columns&&e.columns.length?e.columns:t.columns,columnHeaderTitle:e.columnHeaderTitle&&e.columnHeaderTitle.length?e.columnHeaderTitle:t.columnHeaderTitle,rows:e.rows&&e.rows.length?e.rows:t.rows,rowHeaderTitle:e.rowHeaderTitle&&e.rowHeaderTitle.length?e.rowHeaderTitle:t.rowHeaderTitle,indicators:e.indicators&&e.indicators.length?e.indicators:t.indicators,corner:Object.keys(t.corner||{}).length?t.corner:e.corner,tooltip:Object.keys(e.tooltip||{}).length?e.tooltip:t.tooltip,menu:Object.keys(e.menu||{}).length?e.menu:t.menu}}const b={...e.ListTable.EVENT_TYPE,...e.PivotTable.EVENT_TYPE,...e.PivotChart.EVENT_TYPE},C={onClickCell:b.CLICK_CELL,onDblClickCell:b.DBLCLICK_CELL,onMouseDownCell:b.MOUSEDOWN_CELL,onMouseUpCell:b.MOUSEUP_CELL,onSelectedCell:b.SELECTED_CELL,onKeyDown:b.KEYDOWN,onMouseEnterTable:b.MOUSEENTER_TABLE,onMouseLeaveTable:b.MOUSELEAVE_TABLE,onMouseDownTable:b.MOUSEDOWN_TABLE,onMouseMoveCell:b.MOUSEMOVE_CELL,onMouseEnterCell:b.MOUSEENTER_CELL,onMouseLeaveCell:b.MOUSELEAVE_CELL,onContextMenuCell:b.CONTEXTMENU_CELL,onResizeColumn:b.RESIZE_COLUMN,onResizeColumnEnd:b.RESIZE_COLUMN_END,onChangeHeaderPosition:b.CHANGE_HEADER_POSITION,onChangeHeaderPositionStart:b.CHANGE_HEADER_POSITION_START,onChangeHeaderPositionFail:b.CHANGE_HEADER_POSITION_FAIL,onSortClick:b.SORT_CLICK,onFreezeClick:b.FREEZE_CLICK,onScroll:b.SCROLL,onDropdownMenuClick:b.DROPDOWN_MENU_CLICK,onMouseOverChartSymbol:b.MOUSEOVER_CHART_SYMBOL,onDragSelectEnd:b.DRAG_SELECT_END,onDropdownIconClick:b.DROPDOWN_ICON_CLICK,onDropdownMenuClear:b.DROPDOWN_MENU_CLEAR,onTreeHierarchyStateChange:b.TREE_HIERARCHY_STATE_CHANGE,onShowMenu:b.SHOW_MENU,onHideMenu:b.HIDE_MENU,onIconClick:b.ICON_CLICK,onLegendItemClick:b.LEGEND_ITEM_CLICK,onLegendItemHover:b.LEGEND_ITEM_HOVER,onLegendItemUnHover:b.LEGEND_ITEM_UNHOVER,onLegendChange:b.LEGEND_CHANGE,onMouseEnterAxis:b.MOUSEENTER_AXIS,onMouseLeaveAxis:b.MOUSELEAVE_AXIS,onCheckboxStateChange:b.CHECKBOX_STATE_CHANGE,onRadioStateChange:b.RADIO_STATE_CHANGE,onAfterRender:b.AFTER_RENDER,onInitialized:b.INITIALIZED,onPivotSortClick:b.PIVOT_SORT_CLICK,onDrillMenuClick:b.DRILLMENU_CLICK,onVChartEventType:b.VCHART_EVENT_TYPE,onChangeCellValue:b.CHANGE_CELL_VALUE,onMousedownFillHandle:b.MOUSEDOWN_FILL_HANDLE,onDragFillHandleEnd:b.DRAG_FILL_HANDLE_END,onDblclickFillHandle:b.DBLCLICK_FILL_HANDLE,onScrollVerticalEnd:b.SCROLL_VERTICAL_END,onScrollHorizontalEnd:b.SCROLL_HORIZONTAL_END,onChangCellValue:b.CHANGE_CELL_VALUE},y=Object.keys(C);function T(t,e){const s=i.computed((()=>{const e=t.options?.columns;return n.isArray(e)?e.filter((t=>!!n.isObject(t)&&!!p(t))):[]}));function o(){return e.value?.id}i.watchEffect((()=>{!function(){const t=o();if(!n.isValid(t))return;let e=g();e?e.removeNode(t):s.value.length>0&&(e=g(!0));s.value.forEach((i=>{const{getEditCustomNode:n}=i,s=_(i);e.registerNode(t,s,n),delete i.editCustomNode}))}()})),i.onBeforeUnmount((()=>{!function(){const t=o();if(!n.isValid(t))return;const e=g();e?.release(t)}()}))}class v{static GenAutoIncrementId(){return v.auto_increment_id++}}var E;v.auto_increment_id=0,function(t){t[t.estimate=0]="estimate",t[t.actualBounding=1]="actualBounding",t[t.fontBounding=2]="fontBounding"}(E||(E={}));const x=n.tau-1e-8;class L{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,i,s,o,r){if(Math.abs(o-s)>x)return this.bounds.add(t-i,e-i),void this.bounds.add(t+i,e+i);let a,l,h,c,u=1/0,d=-1/0,p=1/0,_=-1/0;function g(t){h=i*Math.cos(t),c=i*Math.sin(t),h<u&&(u=h),h>d&&(d=h),c<p&&(p=c),c>_&&(_=c)}if(g(s),g(o),o!==s)if((s%=n.tau)<0&&(s+=n.tau),(o%=n.tau)<0&&(o+=n.tau),o<s&&(r=!r,a=s,s=o,o=a),r)for(o-=n.tau,a=s-s%n.halfPi,l=0;l<4&&a>o;++l,a-=n.halfPi)g(a);else for(a=s-s%n.halfPi+n.halfPi,l=0;l<4&&a<o;++l,a+=n.halfPi)g(a);this.bounds.add(t+u,e+p),this.bounds.add(t+d,e+_)}arcTo(t,e,i,n,s){this.bounds.add(t,e)}bezierCurveTo(t,e,i,n,s,o){this.bounds.add(t,e),this.bounds.add(i,n),this.bounds.add(s,o)}closePath(){}ellipse(){throw new Error("不支持ellipse")}lineTo(t,e){this.bounds.add(t,e)}moveTo(t,e){this.bounds.add(t,e)}quadraticCurveTo(t,e,i,n){this.bounds.add(t,e),this.bounds.add(i,n)}rect(t,e,i,n){this.bounds.add(t,e),this.bounds.add(t+i,e+n)}clear(){this.bounds.clear()}release(){}}class w{constructor(){this.curves=[],this.bounds=new n.AABBBounds}getCurveLengths(){return this.curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const O=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,A={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7,M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7},P=0,M=1,N=2,D=3,S=4,k=5,R=6,I=7,j=8;let B,H,q,U,z,V;var F,W,$,G,Y,X,K,Q,Z;function J(t){const e=t[0],i=t[1],n=t[2],s=t[3],o=t[4],r=t[5],a=t[6],l=t[7],h=l*o,c=-a*r,u=a*o,d=l*r,p=Math.cos(n),_=Math.sin(n),g=Math.cos(s),f=Math.sin(s),m=.5*(s-n),b=Math.sin(.5*m),C=8/3*b*b/Math.sin(m),y=e+p-C*_,T=i+_+C*p,v=e+g,E=i+f,x=v+C*f,L=E-C*g;return[h*y+c*T,u*y+d*T,h*x+c*L,u*x+d*L,h*v+c*E,u*v+d*E]}function tt(t,e,i,s){const o=function(t,e,i,s,o,r,a,l,h){const c=n.degreeToRadian(a),u=Math.sin(c),d=Math.cos(c),p=d*(l-t)*.5+u*(h-e)*.5,_=d*(h-e)*.5-u*(l-t)*.5;let g=p*p/((i=Math.abs(i))*i)+_*_/((s=Math.abs(s))*s);g>1&&(g=Math.sqrt(g),i*=g,s*=g);const f=d/i,m=u/i,b=-u/s,C=d/s,y=f*l+m*h,T=b*l+C*h,v=f*t+m*e,E=b*t+C*e;let x=1/((v-y)*(v-y)+(E-T)*(E-T))-.25;x<0&&(x=0);let L=Math.sqrt(x);r===o&&(L=-L);const w=.5*(y+v)-L*(E-T),O=.5*(T+E)+L*(v-y),A=Math.atan2(T-O,y-w);let P=Math.atan2(E-O,v-w)-A;P<0&&1===r?P+=n.tau:P>0&&0===r&&(P-=n.tau);const M=Math.ceil(Math.abs(P/(n.halfPi+.001))),N=[];for(let t=0;t<M;++t){const e=A+t*P/M,n=A+(t+1)*P/M;N[t]=[w,O,e,n,i,s,u,d]}return N}(s[5],s[6],s[0],s[1],s[3],s[4],s[2],e,i);for(let e=0;e<o.length;++e){const i=J(o[e]);t.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5])}}!function(t){t[t.NONE=0]="NONE",t[t.UPDATE_BOUNDS=1]="UPDATE_BOUNDS",t[t.UPDATE_SHAPE=2]="UPDATE_SHAPE",t[t.CLEAR_SHAPE=253]="CLEAR_SHAPE",t[t.UPDATE_SHAPE_AND_BOUNDS=3]="UPDATE_SHAPE_AND_BOUNDS",t[t.INIT=179]="INIT",t[t.CLEAR_BOUNDS=254]="CLEAR_BOUNDS",t[t.UPDATE_GLOBAL_MATRIX=32]="UPDATE_GLOBAL_MATRIX",t[t.CLEAR_GLOBAL_MATRIX=223]="CLEAR_GLOBAL_MATRIX",t[t.UPDATE_LOCAL_MATRIX=16]="UPDATE_LOCAL_MATRIX",t[t.CLEAR_LOCAL_MATRIX=239]="CLEAR_LOCAL_MATRIX",t[t.UPDATE_GLOBAL_LOCAL_MATRIX=48]="UPDATE_GLOBAL_LOCAL_MATRIX",t[t.UPDATE_LAYOUT=128]="UPDATE_LAYOUT",t[t.CLEAR_LAYOUT=127]="CLEAR_LAYOUT"}(F||(F={})),function(t){t[t.GLOBAL=1]="GLOBAL",t[t.LOCAL=16]="LOCAL",t[t.GLOBAL_ACCURATE=3]="GLOBAL_ACCURATE",t[t.LOCAL_ACCURATE=48]="LOCAL_ACCURATE"}(W||(W={})),function(t){t[t.INIT=0]="INIT",t[t.DEFAULT=1]="DEFAULT",t[t.STATE=2]="STATE",t[t.ANIMATE_BIND=10]="ANIMATE_BIND",t[t.ANIMATE_PLAY=11]="ANIMATE_PLAY",t[t.ANIMATE_START=12]="ANIMATE_START",t[t.ANIMATE_UPDATE=13]="ANIMATE_UPDATE",t[t.ANIMATE_END=14]="ANIMATE_END",t[t.TRANSLATE=20]="TRANSLATE",t[t.TRANSLATE_TO=21]="TRANSLATE_TO",t[t.SCALE=22]="SCALE",t[t.SCALE_TO=23]="SCALE_TO",t[t.ROTATE=24]="ROTATE",t[t.ROTATE_TO=25]="ROTATE_TO"}($||($={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSED=2]="PAUSED",t[t.END=3]="END"}(G||(G={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY"}(Y||(Y={})),function(t){t.wait="wait",t.from="from",t.to="to",t.customAnimate="customAnimate"}(X||(X={})),function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(K||(K={})),function(t){t[t.CubicBezierCurve=0]="CubicBezierCurve",t[t.QuadraticBezierCurve=1]="QuadraticBezierCurve",t[t.ArcCurve=2]="ArcCurve",t[t.LineCurve=3]="LineCurve",t[t.EllipseCurve=4]="EllipseCurve",t[t.MoveCurve=5]="MoveCurve"}(Q||(Q={})),function(t){t[t.beforeFillStroke=0]="beforeFillStroke",t[t.afterFillStroke=1]="afterFillStroke"}(Z||(Z={}));const et=[(t,e,i,n,s,o,r)=>e.arc(t[1]*s+i,t[2]*o+n,t[3]*(s+o)/2,t[4],t[5],t[6],r),(t,e,i,n,s,o,r)=>e.arcTo(t[1]*s+i,t[2]*o+n,t[3]*s+i,t[4]*o+n,t[5]*(s+o)/2,r),(t,e,i,n,s,o,r)=>e.bezierCurveTo(t[1]*s+i,t[2]*o+n,t[3]*s+i,t[4]*o+n,t[5]*s+i,t[6]*o+n,r),(t,e,i,n)=>e.closePath(),(t,e,i,n,s,o)=>e.ellipse(t[1]*s+i,t[2]*o+n,t[3]*s,t[4]*o,t[5],t[6],t[7],t[8]),(t,e,i,n,s,o,r)=>e.lineTo(t[1]*s+i,t[2]*o+n,r),(t,e,i,n,s,o,r)=>e.moveTo(t[1]*s+i,t[2]*o+n,r),(t,e,i,n,s,o,r)=>e.quadraticCurveTo(t[1]*s+i,t[2]*o+n,t[3]*s+i,t[4]*o+n,r),(t,e,i,n,s,o,r)=>e.rect(t[1]*s+i,t[2]*o+n,t[3]*s,t[4]*o,r)];class it{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function nt(t,e,i,s,o){return function(t,e){let i=0;const s=t.length;for(let o=0;o<s;o++){const r=t[o],a=e[o],l=t[(o+1)%s],h=e[(o+1)%s];i+=n.PointService.distanceNN(r,a,l,h)}return i/2}([t.x,e.x,i.x,s.x],[t.y,e.y,i.y,s.y])}function st(t,e,i,n,s){const o=1-s;return o*o*o*t+3*e*s*o*o+3*i*s*s*o+n*s*s*s}class ot extends it{constructor(t,e,i,n){super(),this.type=Q.CubicBezierCurve,this.p0=t,this.p1=e,this.p2=i,this.p3=n}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y+this.p3.x+this.p3.y)}getPointAt(t){if(!1!==this.defined)return function(t,e,i,s,o){const r=st(t.x,e.x,i.x,s.x,o),a=st(t.y,e.y,i.y,s.y,o);return new n.Point(r,a)}(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?nt(this.p0,this.p1,this.p2,this.p3):60}calcProjLength(t){return t===K.ROW?n.abs(this.p0.x-this.p3.x):t===K.COLUMN?n.abs(this.p0.y-this.p3.y):0}getAngleAt(t){const e=n.max(t-.01,0),i=n.min(t+.01,1),s=this.getPointAt(e),o=this.getPointAt(i);return n.atan2(o.y-s.y,o.x-s.x)}}class rt extends it{constructor(t,e){super(),this.type=Q.LineCurve,this.p0=t,this.p1=e}getPointAt(t){if(!1!==this.defined)return n.PointService.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=n.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)),this.angle}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y)}calcLength(){return this._validPoint()?n.PointService.distancePP(this.p0,this.p1):60}calcProjLength(t){return t===K.ROW?n.abs(this.p0.x-this.p1.x):t===K.COLUMN?n.abs(this.p0.y-this.p1.y):0}}class at{get endX(){return this._lastX}get endY(){return this._lastY}constructor(t,e){this.init(t,e)}init(t,e){this._lastX=this._lastY=this._startX=this._startY=0,this.curveType=t,this.direction=e,this.curves=[]}bezierCurveTo(t,e,i,s,o,r,a,l){const h=new ot(new n.Point(this._lastX,this._lastY),new n.Point(t,e),new n.Point(i,s),new n.Point(o,r));h.originP1=this._lastOriginP,h.originP2=l,h.defined=a,this.curves.push(h),this._lastX=o,this._lastY=r,this._lastOriginP=l}closePath(){if(this.curves.length<2)return;const t=this.curves[this.curves.length-1];this.lineTo(this._startX,this._startY,t.defined,this._startOriginP)}ellipse(){throw new Error("SegContext不支持调用ellipse")}lineTo(t,e,i,n){const s=this.addLinearCurve(t,e,i,this._lastOriginP,n);this.curves.push(s),this._lastX=t,this._lastY=e,this._lastOriginP=n}moveTo(t,e,i){return this._lastX=this._startX=t,this._lastY=this._startY=e,this._lastOriginP=i,this._startOriginP=i,this}quadraticCurveTo(t,e,i,n){throw new Error("SegContext不支持调用quadraticCurveTo")}clear(){this.curves=[],this.length=NaN}tryUpdateLength(t){return this.getLength(t)}addLinearCurve(t,e,i,s,o){const r=new rt(new n.Point(this._lastX,this._lastY),new n.Point(t,e));return r.originP1=s,r.originP2=o,r.defined=i,r}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(t){var e,i;if(t===K.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],i=this.curves[this.curves.length-1],s=null!==(e=i.p3)&&void 0!==e?e:i.p1;return n.abs(t.p0.y-s.y)}if(t===K.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1],s=null!==(i=e.p3)&&void 0!==i?i:e.p1;return n.abs(t.p0.x-s.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class lt extends at{bezierCurveTo(t,e,i,n,s,o,r,a){return super.bezierCurveTo(e,t,n,i,o,s,r,a)}lineTo(t,e,i,n){return super.lineTo(e,t,i,n)}moveTo(t,e,i){return super.moveTo(e,t,i)}clear(){return super.clear()}}function ht(t,e){let i=!1;for(let n=0,s=e.length;n<=s;n++)n>=s===i&&((i=!i)?t.lineStart():t.lineEnd()),i&&t.point(e[n])}function ct(t,e,i){const s=null!=e?e:n.abs(i[i.length-1].x-i[0].x)>n.abs(i[i.length-1].y-i[0].y)?K.ROW:K.COLUMN;return"monotoneY"===t?new lt(t,s):new at(t,s)}class ut{constructor(t,e){this.context=t,e&&(this.startPoint=e)}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function dt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;const s=ct("linear",i,t);return function(t,e){ht(t,e)}(new ut(s,n),t),s}function pt(t,e,i,n,s){t.context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+i)/6,n,t.lastPoint1)}class _t{constructor(t,e){this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){2===this._point&&pt(this,6*this._x1-(this._x0+4*this._x1),6*this._y1-(this._y0+4*this._y1),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;break;default:pt(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}function gt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return dt(t,e);const s=ct("basis",i,t);return function(t,e){ht(t,e)}(new _t(s,n),t),s}function ft(t){return t<0?-1:1}function mt(t,e,i){const n=t._x1-t._x0,s=e-t._x1,o=(t._y1-t._y0)/(n||Number(s<0&&-0)),r=(i-t._y1)/(s||Number(n<0&&-0)),a=(o*s+r*n)/(n+s);return(ft(o)+ft(r))*Math.min(Math.abs(o),Math.abs(r),.5*Math.abs(a))||0}function bt(t,e){const i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function Ct(t,e,i,n,s){const o=t._x0,r=t._y0,a=t._x1,l=t._y1,h=(a-o)/3;t.context.bezierCurveTo(o+h,r+h*e,a-h,l-h*i,a,l,n,t.lastPoint1)}class yt{constructor(t,e){this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x1,this._y1,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:Ct(this,this._t0,bt(this,this._t0),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1)}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){let e=NaN;const i=t.x,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(i,n,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(i,n,t);break;case 1:this._point=2;break;case 2:this._point=3,Ct(this,bt(this,e=mt(this,i,n)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:Ct(this,this._t0,e=mt(this,i,n),!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=i,this._y0=this._y1,this._y1=n,this._t0=e,this._lastDefined1=this._lastDefined2,this._lastDefined2=!1!==t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}class Tt extends yt{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function vt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return dt(t,e);const s=ct("monotoneX",i,t);return function(t,e){ht(t,e)}(new yt(s,n),t),s}function Et(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return dt(t,e);const s=ct("monotoneY",i,t);return function(t,e){ht(t,e)}(new Tt(s,n),t),s}class xt{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;this.context=t,this._t=e,this.startPoint=i}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x=this._y=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){0<this._t&&this._t<1&&2===this._point&&this.context.lineTo(this._x,this._y,!1!==this._lastDefined,this.lastPoint),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,i,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t);else{const n=this._x*(1-this._t)+e*this._t;this.context.lineTo(n,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(n,i,!1!==this._lastDefined&&!1!==t.defined,t)}}this._lastDefined=t.defined,this._x=e,this._y=i,this.lastPoint=t}tryUpdateLength(){return this.context.tryUpdateLength()}}function Lt(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:s,startPoint:o}=i;if(t.length<2-Number(!!o))return null;const r=new at("step",null!=s?s:n.abs(t[t.length-1].x-t[0].x)>n.abs(t[t.length-1].y-t[0].y)?K.ROW:K.COLUMN);return function(t,e){ht(t,e)}(new xt(r,e,o),t),r}class wt extends ut{lineEnd(){this.context.closePath()}}function Ot(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;const s=ct("linear",i,t);return function(t,e){ht(t,e)}(new wt(s,n),t),s}function At(t,e,i,s,o){let r=t._x1,a=t._y1,l=t._x2,h=t._y2;if(t._l01_a>n.epsilon){const e=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,i=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*e-t._x0*t._l12_2a+t._x2*t._l01_2a)/i,a=(a*e-t._y0*t._l12_2a+t._y2*t._l01_2a)/i}if(t._l23_a>n.epsilon){const n=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,s=3*t._l23_a*(t._l23_a+t._l12_a);l=(l*n+t._x1*t._l23_2a-e*t._l12_2a)/s,h=(h*n+t._y1*t._l23_2a-i*t._l12_2a)/s}t.context.bezierCurveTo(r,a,l,h,t._x2,t._y2,s,t.lastPoint1)}function Pt(t,e){return function(i,n){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:o,startPoint:r}=s;if(i.length<2-Number(!!r))return null;if(i.length<3-Number(!!r))return dt(i,s);const a=ct(t,o,i);return ht(new e(a,n,r),i),a}}const Mt=Pt("catmullRom",class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;this.context=t,this.startPoint=i,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x2,this._y2,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:this.point({x:this._x2,y:this._y2})}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const{x:e,y:i}=t;if(this._point){const t=this._x2-e,n=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2):this.context.moveTo(e,i);break;case 1:this._point=2;break;case 2:this._point=3;default:At(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}});const Nt=Pt("catmullRomClosed",class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;this.context=t,this.startPoint=i,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 1:this.context.moveTo(this._x3,this._y3,this.lastPoint1),this.context.closePath();break;case 2:this.context.lineTo(this._x3,this._y3,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),this.context.closePath();break;case 3:this.point({x:this._x3,y:this._y3}),this.point({x:this._x4,y:this._y4}),this.point({x:this._x5,y:this._y5})}}point(t){const{x:e,y:i}=t;if(this._point){const t=this._x2-e,n=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=i;break;case 1:this._point=2,this.context.moveTo(this._x4=e,this._y4=i,t);break;case 2:this._point=3,this._x5=e,this._y5=i;break;default:At(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}});const Dt=["l",0,0,0,0,0,0,0];function St(t,e,i){const n=Dt[0]=t[0];if("a"===n||"A"===n)Dt[1]=e*t[1],Dt[2]=i*t[2],Dt[3]=t[3],Dt[4]=t[4],Dt[5]=t[5],Dt[6]=e*t[6],Dt[7]=i*t[7];else if("h"===n||"H"===n)Dt[1]=e*t[1];else if("v"===n||"V"===n)Dt[1]=i*t[1];else for(let n=1,s=t.length;n<s;++n)Dt[n]=(n%2==1?e:i)*t[n];return Dt}const kt={x:0,y:0,z:0,dx:0,dy:0,dz:0,scrollX:0,scrollY:0,scaleX:1,scaleY:1,scaleZ:1,angle:0,alpha:0,beta:0,scaleCenter:[0,0],anchor:[0,0],anchor3d:[0,0],postMatrix:new n.Matrix},Rt={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},It=Object.assign({outerBorder:Object.assign(Object.assign({},Rt),{distance:0}),innerBorder:Object.assign(Object.assign({},Rt),{distance:0})},Rt),jt={text:"",maxLineWidth:1/0,maxWidth:1/0,textAlign:"left",textBaseline:"alphabetic",fontSize:16,fontFamily:"PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",fontWeight:"",ellipsis:"…",fontVariant:"",fontStyle:"",lineHeight:void 0,underline:0,lineThrough:0,scaleIn3d:!1,direction:"horizontal",wordBreak:"break-all",ignoreBuf:!1,verticalMode:0,wrap:!1,whiteSpace:"no-wrap",heightLimit:1/0,lineClamp:1/0,suffixPosition:"end",underlineDash:[],underlineOffset:0,disableAutoClipedPoptip:void 0,measureMode:E.fontBounding,keepCenterInLine:!1},Bt=Object.assign(Object.assign(Object.assign(Object.assign({forceBoundsWidth:void 0,forceBoundsHeight:void 0,opacity:1,background:null,backgroundOpacity:1,backgroundCornerRadius:0,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:"no-repeat",backgroundFit:!0,blur:0,cursor:null,html:null,react:null},{fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0}),It),{alignSelf:"auto"}),{pickStrokeBuffer:0}),Ht={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},qt=Object.assign(Object.assign(Object.assign({strokeSeg:null,renderable:!0,pickable:!0,shadowGraphic:void 0,childrenPickable:!0,fillPickable:!0,strokePickable:!0,visible:!0,zIndex:0,layout:null,boundsPadding:0,fillStrokeOrder:0,renderStyle:"default",pickMode:"accurate",customPickShape:null,boundsMode:"accurate",keepDirIn3d:!0,shadowRootIdx:1,globalZIndex:1,globalCompositeOperation:"",overflow:"hidden",shadowPickMode:"graphic",keepStrokeScale:!1},{_debug_bounds:!1}),Bt),kt),Ut=Object.assign(Object.assign({},qt),{startAngle:0,endAngle:n.pi2,innerRadius:0,outerRadius:1,innerPadding:0,outerPadding:0,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),zt=Object.assign(Object.assign(Object.assign({},qt),Ht),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1,curveTension:1}),Vt=Object.assign(Object.assign({},qt),{radius:1,startAngle:0,endAngle:n.pi2}),Ft=Object.assign(Object.assign({},qt),{width:0,height:0,cornerRadius:0,path:[],clip:!1,visibleAll:!0,display:"relative",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-start",alignItems:"flex-start",alignContent:"flex-start",baseOpacity:1}),Wt=Object.assign(Object.assign({},qt),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),$t=Object.assign(Object.assign(Object.assign({},qt),Ht),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1,curveTension:1}),Gt=Object.assign(Object.assign({},qt),{path:new class extends w{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new L(this.bounds)}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([R,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([k,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,n){return this.commandList.push([I,t,e,i,n]),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,n),this}bezierCurveTo(t,e,i,n,s,o){return this.commandList.push([N,t,e,i,n,s,o]),this._ctx&&this._ctx.bezierCurveTo(t,e,i,n,s,o),this}arcTo(t,e,i,n,s){return this.commandList.push([M,t,e,i,n,s]),this._ctx&&this._ctx.arcTo(t,e,i,n,s),this}ellipse(t,e,i,n,s,o,r,a){return this.commandList.push([S,t,e,i,n,s,o,r,a]),this._ctx&&this._ctx.ellipse(t,e,i,n,s,o,r,a),this}rect(t,e,i,n){return this.commandList.push([j,t,e,i,n]),this._ctx&&this._ctx.rect(t,e,i,n),this}arc(t,e,i,n,s,o){return this.commandList.push([P,t,e,i,n,s,o]),this._ctx&&this._ctx.arc(t,e,i,n,s,o),this}closePath(){return this.commandList.push([D]),this._ctx&&this._ctx.closePath(),this}addCurve(t){this.curves.push(t)}clear(){this.transformCbList=null,this.commandList.length=0,this.curves.length=0}beginPath(){this.clear()}toString(){if(!this.toStringCbList){const t=[];t[R]=t=>`M${t[1]} ${t[2]}`,t[k]=t=>`L${t[1]} ${t[2]}`,t[I]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[N]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[P]=t=>{const e=[];((t,e,i,n,s,o,r)=>{const a=Math.abs(i-e),l=a>.5*Math.PI?Math.ceil(2*a/Math.PI):1,h=(i-e)/l;for(let i=0;i<l;i++){const a=e+h*i,l=e+h*(i+1),c=4*Math.tan(Math.abs(h)/4)/3,u=l<a?-1:1,d=Math.cos(a),p=Math.sin(a),_=Math.cos(l),g=Math.sin(l),f=d*o+n,m=p*r+s,b=_*o+n,C=g*r+s,y=o*c*u,T=r*c*u;t.push(f-y*p,m+T*d,b+y*g,C-T*_,b,C)}})(e,t[4],t[5],t[1],t[2],t[3],t[3]);let i="";for(let t=0;t<e.length;t+=6)i+=`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`;return i},t[j]=t=>`M${t[1]} ${t[2]} h${t[3]} v${t[4]} H${t[1]}Z`,t[D]=t=>"Z",this.toStringCbList=t}const t=this.toStringCbList;let e="";return this.commandList.forEach((i=>{e+=t[i[0]](i)})),e}fromString(t,e,i,n,s){this.clear();const o=function(t){if(!t)return[];const e=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===e)return[];let i,n;const s=[];for(let t=0,o=e.length;t<o;t++)if(B=e[t],H=B.slice(1),q=B[0],i=[q],n=H.match(O),null!==n){for(let t=0,e=n.length;t<e;t++)U=n[t],z=parseFloat(U),Number.isNaN(z)||i.push(z);if(V=A[q],i.length-1>V){let t,e=q;for(let n=1,o=i.length;n<o;n+=V){t=[e];for(let e=n,s=n+V;e<s;e++)t.push(i[e]);s.push(t),"m"===e?e="l":"M"===e&&(e="L")}}else s.push(i)}else s.push(i);return s}(t);return this._runCommandStrList(o,e,i,n,s),this._updateBounds(),this}fromLine(t){const{points:e,curveType:i,clipRangeByDimension:n}=t.attribute;if(!e)return;const s=function(t,e,i){var n,s;switch(e){case"linear":default:return dt(t,i);case"basis":return gt(t,i);case"monotoneX":return vt(t,i);case"monotoneY":return Et(t,i);case"step":return Lt(t,.5,i);case"stepBefore":return Lt(t,0,i);case"stepAfter":return Lt(t,1,i);case"catmullRom":return Mt(t,null!==(n=null==i?void 0:i.curveTension)&&void 0!==n?n:.5,i);case"catmullRomClosed":return Nt(t,null!==(s=null==i?void 0:i.curveTension)&&void 0!==s?s:.5,i);case"linearClosed":return Ot(t,i)}}(e,i);"x"===n?this.direction=K.ROW:"y"===n?this.direction=K.COLUMN:"auto"===n&&(this.direction=s.direction),this.curves=s.curves}fromCustomPath2D(t,e,i,n,s){return this.clear(),this._runCommandList(t.commandList,e,i,n,s),this._updateBounds(),this}transform(t,e,i,n){const s=this.commandList;if(!this.transformCbList){const t=[];t[R]=this.moveToTransform,t[k]=this.lineToTransform,t[I]=this.quadraticCurveToTransform,t[N]=this.bezierCurveToTransform,t[M]=this.arcToTransform,t[S]=this.ellipseTransform,t[j]=this.rectTransform,t[P]=this.arcTransform,t[D]=this.closePathTransform,this.transformCbList=t}s.forEach((s=>{this.transformCbList[s[0]](s,t,e,i,n)})),this._updateBounds()}moveToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i}lineToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i}quadraticCurveToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n+e,t[4]=t[4]*s+i}bezierCurveToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n+e,t[4]=t[4]*s+i,t[5]=t[5]*n+e,t[6]=t[6]*s+i}arcToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n+e,t[4]=t[4]*s+i,t[5]=t[5]*(n+s)/2}ellipseTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n,t[4]=t[4]*s}rectTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n,t[4]=t[4]*s}arcTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*(n+s)/2}closePathTransform(){}_runCommandStrList(t){let e,i,n,s,o,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,c=null,u=0,d=0,p=0,_=0;for(let g=0,f=t.length;g<f;++g){switch(e=t[g],1===l&&1===h||(e=St(e,l,h)),e[0]){case"l":u+=e[1],d+=e[2],this.lineTo(u+r,d+a);break;case"L":u=e[1],d=e[2],this.lineTo(u+r,d+a);break;case"h":u+=e[1],this.lineTo(u+r,d+a);break;case"H":u=e[1],this.lineTo(u+r,d+a);break;case"v":d+=e[1],this.lineTo(u+r,d+a);break;case"V":d=e[1],this.lineTo(u+r,d+a);break;case"m":u+=e[1],d+=e[2],this.moveTo(u+r,d+a);break;case"M":u=e[1],d=e[2],this.moveTo(u+r,d+a);break;case"c":i=u+e[5],n=d+e[6],p=u+e[3],_=d+e[4],this.bezierCurveTo(u+e[1]+r,d+e[2]+a,p+r,_+a,i+r,n+a),u=i,d=n;break;case"C":u=e[5],d=e[6],p=e[3],_=e[4],this.bezierCurveTo(e[1]+r,e[2]+a,p+r,_+a,u+r,d+a);break;case"s":i=u+e[3],n=d+e[4],p=2*u-p,_=2*d-_,this.bezierCurveTo(p+r,_+a,u+e[1]+r,d+e[2]+a,i+r,n+a),p=u+e[1],_=d+e[2],u=i,d=n;break;case"S":i=e[3],n=e[4],p=2*u-p,_=2*d-_,this.bezierCurveTo(p+r,_+a,e[1]+r,e[2]+a,i+r,n+a),u=i,d=n,p=e[1],_=e[2];break;case"q":i=u+e[3],n=d+e[4],p=u+e[1],_=d+e[2],this.quadraticCurveTo(p+r,_+a,i+r,n+a),u=i,d=n;break;case"Q":i=e[3],n=e[4],this.quadraticCurveTo(e[1]+r,e[2]+a,i+r,n+a),u=i,d=n,p=e[1],_=e[2];break;case"t":i=u+e[1],n=d+e[2],null===c[0].match(/[QqTt]/)?(p=u,_=d):"t"===c[0]?(p=2*u-s,_=2*d-o):"q"===c[0]&&(p=2*u-p,_=2*d-_),s=p,o=_,this.quadraticCurveTo(p+r,_+a,i+r,n+a),u=i,d=n,p=u+e[1],_=d+e[2];break;case"T":i=e[1],n=e[2],p=2*u-p,_=2*d-_,this.quadraticCurveTo(p+r,_+a,i+r,n+a),u=i,d=n;break;case"a":tt(this,u+r,d+a,[e[1],e[2],e[3],e[4],e[5],e[6]+u+r,e[7]+d+a]),u+=e[6],d+=e[7];break;case"A":tt(this,u+r,d+a,[e[1],e[2],e[3],e[4],e[5],e[6]+r,e[7]+a]),u=e[6],d=e[7];break;case"z":case"Z":this.closePath()}c=e}}_runCommandList(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;if(0!==e||0!==i||1!==n||1!==s)for(let o=0,r=t.length;o<r;++o){const r=t[o].slice();switch(r[0]){case k:this.lineToTransform(r,e,i,n,s);break;case R:this.moveToTransform(r,e,i,n,s);break;case N:this.bezierCurveToTransform(r,e,i,n,s);break;case I:this.quadraticCurveToTransform(r,e,i,n,s);break;case P:this.arcToTransform(r,e,i,n,s);break;case S:this.ellipseTransform(r,e,i,n,s);break;case j:this.rectTransform(r,e,i,n,s);break;case M:this.arcToTransform(r,e,i,n,s);break;case D:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,r=arguments.length>6?arguments[6]:void 0;for(let a=0;a<t.length;a++){const l=t[a];et[l[0]](l,e,i,n,s,o,r)}}(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===K.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return n.abs(t.p0.y-e.p1.y)}if(this.direction===K.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return n.abs(t.p0.x-e.p1.x)}return this.curves.reduce(((t,e)=>t+e.getLength()),0)}getAttrAt(t){if(!this.curves)return{pos:{x:0,y:0},angle:0};let e,i=0;for(let n=0;n<this.curves.length;n++){e=this.curves[n];const s=e.getLength(this.direction);if(i+s>=t)break;i+=s}const n=(t-i)/e.getLength(this.direction);return{pos:e.getPointAt(n),angle:e.getAngleAt(n)}}},fillStrokeOrder:1,customPath:()=>{n.Logger.getInstance().warn("空函数")}}),Yt=Object.assign(Object.assign({},qt),{points:[],cornerRadius:0,closePath:!0}),Xt=Object.assign(Object.assign({},qt),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0});Object.assign(Object.assign({},qt),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0});const Kt=Object.assign(Object.assign({},qt),{symbolType:"circle",size:10,keepDirIn3d:!0}),Qt=Object.assign(Object.assign(Object.assign({},qt),jt),{strokeBoundsBuffer:0,keepDirIn3d:!0}),Zt=Object.assign(Object.assign(Object.assign({},qt),jt),{editable:!1,width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],disableAutoWrapLine:!1,maxHeight:void 0,maxWidth:void 0,singleLine:!1}),Jt=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0},qt),{fill:!0,cornerRadius:0}),te=Object.assign(Object.assign({},Jt),{backgroundShowMode:"never",backgroundWidth:0,backgroundHeight:0,textAlign:"left",textBaseline:"middle",direction:"horizontal",margin:0,id:"",width:20,height:20,backgroundFill:"rgba(101, 117, 168, 0.1)",backgroundFillOpacity:1,backgroundStroke:!1,backgroundStrokeOpacity:1,backgroundRadius:4,opacity:1});const ee=new class{},ie={arc:Ut,area:zt,circle:Vt,line:$t,path:Gt,symbol:Kt,text:Qt,rect:Xt,polygon:Yt,richtext:Zt,richtextIcon:te,image:Jt,group:Ft,glyph:Wt},ne=Object.keys(ie);function se(t,e){Object.keys(e).forEach((i=>{t[i]=e[i]}))}const oe={arc:Object.assign({},ie.arc),area:Object.assign({},ie.area),circle:Object.assign({},ie.circle),line:Object.assign({},ie.line),path:Object.assign({},ie.path),symbol:Object.assign({},ie.symbol),text:Object.assign({},ie.text),rect:Object.assign({},ie.rect),polygon:Object.assign({},ie.polygon),richtext:Object.assign({},ie.richtext),richtextIcon:Object.assign({},ie.richtextIcon),image:Object.assign({},ie.image),group:Object.assign({},ie.group),glyph:Object.assign({},ie.glyph)};const re=new class{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},ne.forEach((t=>{this._defaultTheme[t]=Object.create(oe[t])})),this.combinedTheme=this._defaultTheme}getTheme(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;let e={};const i=this.getParentWithTheme(t);return i&&(e=i.theme),this.applyTheme(t,e),this.combinedTheme}getParentWithTheme(t){for(;t.parent;)if((t=t.parent).theme)return t;return null}applyTheme(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.dirty){const s=this.getParentWithTheme(t);if(s){const t=s.theme;(t.dirty||i)&&t.applyTheme(s,e,!0)}this.userTheme?this.doCombine(s&&s.theme.combinedTheme):(s?this.combinedTheme=s.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,n.Logger.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,i=this.combinedTheme;ne.forEach((n=>{const s=Object.create(oe[n]);t&&t[n]&&se(s,t[n]),i[n]&&se(s,i[n]),e[n]&&se(s,e[n]),this.combinedTheme[n]=s})),e.common&&ne.forEach((t=>{se(this.combinedTheme[t],e.common)})),this.dirty=!1}setTheme(t,e){let i=this.userTheme;i?Object.keys(t).forEach((e=>{i[e]?Object.assign(i[e],t[e]):i[e]=Object.assign({},t[e])})):i=t,this.userTheme=i,this.dirty=!0,this.dirtyChildren(e)}resetTheme(t,e){this.userTheme=t,this.dirty=!0,this.dirtyChildren(e)}dirtyChildren(t){t.forEachChildren((t=>{t.isContainer&&(t.theme&&(t.theme.dirty=!0),this.dirtyChildren(t))}))}};function ae(t,e){return t.glyphHost?ae(t.glyphHost):e?(t.isContainer,e):function(t){let e;if(e=t.isContainer?t:t.parent,e){for(;e&&!e.theme;)e=e.parent;return e?(e.theme||e.createTheme(),e.theme.getTheme(e)):re.getTheme()}return null}(t)||t.attachedThemeGraphic&&ae(t.attachedThemeGraphic)||re.getTheme()}class le{constructor(){this.name="HtmlAttributePlugin",this.activeEvent="onRegister",this._uid=v.GenAutoIncrementId(),this.key=this.name+this._uid,this.htmlMap={},this.renderId=0,this.onWheel=t=>{try{const e=new t.constructor(t.type,t);this.pluginService.stage.window.getContext().getCanvas().nativeCanvas.dispatchEvent(e)}catch(t){return}}}activate(t){this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,(e=>{e&&e===this.pluginService.stage&&this.drawHTML([...t.stage.getChildren()])}))}deactivate(t){t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter((t=>t.name!==this.key)),ee.graphicService.hooks.onRemove.unTap(this.key),ee.graphicService.hooks.onRelease.unTap(this.key),this.release()}getWrapContainer(t,e,i){let n;return n=e?"string"==typeof e?ee.global.getElementById(e):e:t.window.getContainer(),{wrapContainer:ee.global.createDom(Object.assign({tagName:"div",parent:n},i)),nativeContainer:n}}parseDefaultStyleFromGraphic(t){return function(t){const e={},i=t=>/^\d+(\.\d+)?$/.test(`${t}`)?`${t}px`:`${t}`;return["textAlign","fontFamily","fontVariant","fontStyle","fontWeight"].forEach((i=>{t[i]&&(e[n.lowerCamelCaseToMiddle(i)]=t[i])})),["fontSize","lineHeight"].forEach((s=>{const o=n.lowerCamelCaseToMiddle(s);n.isNil(t[s])||(e[o]=i(t[s]))})),n.isValid(t.maxLineWidth)&&(e["max-width"]=i(t.maxLineWidth)),t.underline?e["text-decoration"]="underline":t.lineThrough&&(e["text-decoration"]="line-through"),t.fill&&n.isString(t.fill)&&(e.color=t.fill),e}("text"===t.type&&t.attribute?t.attribute:ae(t).text)}getTransformOfText(t){const e=ae(t).text,{textAlign:i=e.textAlign,textBaseline:n=e.textBaseline}=t.attribute,s=t.globalTransMatrix.toTransformAttrs(),{rotateDeg:o,scaleX:r,scaleY:a}=s,l={left:"0",start:"0",end:"-100%",center:"-50%",right:"-100%",top:"0",middle:"-50%",bottom:"-100%",alphabetic:"-79%"},h={left:"0",start:"0",end:"100%",center:"50%",right:"100%",top:"0",middle:"50%",bottom:"100%",alphabetic:"79%"};return{textAlign:i,transform:`translate(${l[i]},${l[n]}) rotate(${o}deg) scaleX(${r}) scaleY(${a})`,transformOrigin:`${h[i]} ${h[n]}`}}updateStyleOfWrapContainer(t,e,i,s,o){const{pointerEvents:r,penetrateEventList:a=[]}=o;let l=this.parseDefaultStyleFromGraphic(t);l.display=!1!==t.attribute.visible?"block":"none",l.pointerEvents=!0===r?"all":r||"none","none"!==l.pointerEvents&&(this.removeWrapContainerEventListener(i),a.forEach((t=>{"wheel"===t&&i.addEventListener("wheel",this.onWheel)}))),i.style.position||(i.style.position="absolute",s.style.position="relative");let h=0,c=0;const u=t.globalAABBBounds;let d=o.anchorType;if(n.isNil(d)&&(d="text"===t.type?"position":"boundsLeftTop"),"boundsLeftTop"===d&&(d="top-left"),"position"===d||u.empty()){const e=t.globalTransMatrix;h=e.e,c=e.f}else{const t=n.calculateAnchorOfBounds(u,d);h=t.x,c=t.y}const p=ee.global.getElementTopLeft(s,!1),_=e.window.getTopLeft(!1),g=e.viewBox,f=h+_.left-p.left+g.x1,m=c+_.top-p.top+g.y1;if(l.left=`${f}px`,l.top=`${m}px`,"text"===t.type&&"position"===d&&(l=Object.assign(Object.assign({},l),this.getTransformOfText(t))),n.isFunction(o.style)){const e=o.style({top:m,left:f,width:u.width(),height:u.height()},t,i);e&&(l=Object.assign(Object.assign({},l),e))}else n.isObject(o.style)?l=Object.assign(Object.assign({},l),o.style):n.isString(o.style)&&o.style&&(l=Object.assign(Object.assign({},l),n.styleStringToObject(o.style)));ee.global.updateDom(i,{width:o.width,height:o.height,style:l})}clearCacheContainer(){this.htmlMap&&Object.keys(this.htmlMap).forEach((t=>{this.htmlMap[t]&&this.htmlMap[t].renderId!==this.renderId&&this.removeElement(t)})),this.renderId+=1}drawHTML(t){"browser"===ee.global.env&&(t.sort(((t,e)=>{var i,n;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:qt.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:qt.zIndex)})).forEach((t=>{this.renderGroupHTML(t)})),this.clearCacheContainer())}renderGroupHTML(t){this.renderGraphicHTML(t),t.forEachChildren((t=>{t.isContainer?this.renderGroupHTML(t):this.renderGraphicHTML(t)}))}removeElement(t){if(!this.htmlMap||!this.htmlMap[t])return;const{wrapContainer:e}=this.htmlMap[t];e&&ee.global.removeDom(e),this.htmlMap[t]=null}removeWrapContainerEventListener(t){t.removeEventListener("wheel",this.onWheel)}renderGraphicHTML(t){var e;const{html:i}=t.attribute;if(!i)return;const s=t.stage;if(!s)return;const{dom:o,container:r}=i;if(!o)return;const a=n.isNil(i.id)?`${null!==(e=t.id)&&void 0!==e?e:t._uid}_react`:i.id;if(this.htmlMap&&this.htmlMap[a]&&r&&r!==this.htmlMap[a].container&&this.removeElement(a),this.htmlMap&&this.htmlMap[a])"string"==typeof o?this.htmlMap[a].wrapContainer.innerHTML=o:o!==this.htmlMap[a].wrapContainer.firstChild&&(this.htmlMap[a].wrapContainer.removeChild(this.htmlMap[a].wrapContainer.firstChild),this.htmlMap[a].wrapContainer.appendChild(o));else{const{wrapContainer:t,nativeContainer:e}=this.getWrapContainer(s,r);t&&("string"==typeof o?t.innerHTML=o:t.appendChild(o),this.htmlMap||(this.htmlMap={}),this.htmlMap[a]={wrapContainer:t,nativeContainer:e,container:r,renderId:this.renderId})}if(!this.htmlMap||!this.htmlMap[a])return;const{wrapContainer:l,nativeContainer:h}=this.htmlMap[a];this.updateStyleOfWrapContainer(t,s,l,h,i),this.htmlMap[a].renderId=this.renderId}release(){"browser"===ee.global.env&&this.removeAllDom(this.pluginService.stage.defaultLayer)}removeAllDom(t){this.htmlMap&&(Object.keys(this.htmlMap).forEach((t=>{this.removeElement(t)})),this.htmlMap=null)}}class he extends le{renderQueue=new Set;isRendering=!1;renderGraphicHTML(t){this.checkNeedRender(t)&&(this.renderQueue.add(t),this.scheduleRender())}scheduleRender(){this.isRendering||(this.isRendering=!0,requestAnimationFrame((()=>{this.renderQueue.forEach((t=>{try{this.doRenderGraphic(t)}catch(e){const{id:i}=this.getGraphicOptions(t)||{};this.removeElement(i,!0)}})),this.renderQueue.clear(),this.isRendering=!1})))}doRenderGraphic(t){const{id:e,options:n}=this.getGraphicOptions(t),s=t.stage,{element:o,container:r}=n,a=r?function(t){const{col:e,row:i,stage:n}=ce(t);let s=t.attribute.vue?.container;const{table:o}=n;s===o.bodyDomContainer?e<o.frozenColCount&&i>=o.rowCount-o.bottomFrozenRowCount?s=o.bottomFrozenBodyDomContainer:e>=o.colCount-o.rightFrozenColCount&&i>=o.rowCount-o.bottomFrozenRowCount?s=o.rightFrozenBottomDomContainer:i>=o.rowCount-o.bottomFrozenRowCount?s=o.bottomFrozenBodyDomContainer:e<o.frozenColCount?s=o.frozenBodyDomContainer:e>=o.colCount-o.rightFrozenColCount&&(s=o.rightFrozenBodyDomContainer):s===o.headerDomContainer&&(e<o.frozenColCount?s=o.frozenHeaderDomContainer:e>=o.colCount-o.rightFrozenColCount&&(s=o.rightFrozenHeaderDomContainer));return s}(t):r;let l=this.htmlMap?.[e];if(l&&a&&a!==l.container&&(this.removeElement(e),l=null),l&&this.checkDom(l.wrapContainer))i.render(o,l.wrapContainer);else{const{wrapContainer:r,nativeContainer:h}=this.getWrapContainer(s,a,{id:e,options:n});r&&(i.render(o,r),l={wrapContainer:r,nativeContainer:h,container:a,renderId:this.renderId,graphic:t,isInViewport:!0,lastPosition:null,lastStyle:{}},this.htmlMap[e]=l)}l&&(this.updateStyleOfWrapContainer(t,s,l.wrapContainer,l.nativeContainer),l.renderId=this.renderId)}getGraphicOptions(t){const{vue:e}=t.attribute;if(!e)return null;return{id:n.isNil(e.id)?`${t.id??t._uid}_vue`:e.id,options:e}}checkNeedRender(t){const{id:e,options:i}=this.getGraphicOptions(t)||{};if(!e)return!1;if(!t.stage)return!1;const{element:n}=i;if(!n)return!1;return this.checkInViewport(t)}checkInViewport(t){const{stage:e,globalAABBBounds:i}=t;if(!e)return!1;const n=100,{AABBBounds:s}=e,o=s.x1-n,r=s.x2+n,a=s.y1-n,l=s.y2+n;return i.x1<r&&i.x2>o&&i.y1<l&&i.y2>a}checkDom(t){return!!t&&document.contains(t)}removeAllDom(t){this.htmlMap&&(Object.keys(this.htmlMap).forEach((t=>{this.removeElement(t,!0)})),this.htmlMap=null)}removeElement(t,e){const n=this.htmlMap?.[t];if(!n)return;const{wrapContainer:s}=n;s&&(i.render(null,s),e?(this.checkDom(s)&&super.removeElement(t),delete this.htmlMap[t]):(s.remove(),n.isInViewport=!1),this.removeWrapContainerEventListener(s))}getWrapContainer(t,e,i){let n;n=e?"string"==typeof e?ee.global.getElementById(e):e:t.window.getContainer();const{id:s}=i||{},o=this.htmlMap?.[s];if(o&&!o.isInViewport){const{wrapContainer:t}=o;return this.checkDom(t)||n.appendChild(t),{wrapContainer:t,nativeContainer:n}}return{wrapContainer:ee.global.createDom({tagName:"div",parent:n}),nativeContainer:n}}updateStyleOfWrapContainer(t,e,i,s){const{attribute:o,type:r}=t,{vue:a,width:l,height:h,visible:c,display:u,...d}=o||{},{x:p,y:_}=this.calculatePosition(t,a.anchorType),{left:g,top:f}=this.calculateOffset(e,s,p,_),{id:m}=this.getGraphicOptions(t)||{},b=m?this.htmlMap[m]:null;if(!b)return;if(!(!b.lastPosition||b.lastPosition.x!==g||b.lastPosition.y!==f))return;const{pointerEvents:C=!0,penetrateEventList:y=["wheel"]}=a,T=this.parseDefaultStyleFromGraphic(t),v=this.convertCellStyle(t);Object.assign(T,{overflow:"hidden",...v||{},...d||{},transform:`translate(${g}px, ${f}px)`,boxSizing:"border-box",display:!1!==c?u||"block":"none",pointerEvents:!0===C?"all":C||"none",position:"absolute"}),"none"!==T.pointerEvents&&(this.removeWrapContainerEventListener(i),n.uniqArray(y).forEach((t=>{"wheel"===t&&(i.addEventListener("wheel",this.onWheel),i.addEventListener("wheel",(t=>t.preventDefault()),!0))}))),"text"===r&&"position"===a.anchorType&&Object.assign(T,this.getTransformOfText(t)),this.applyUserStyles(a,T,{offsetX:g,offsetTop:f,graphic:t,wrapContainer:i});!n.isEqual(b.lastStyle,T)&&(ee.global.updateDom(i,{width:l,height:h,style:T}),b.lastStyle=T)}convertCellStyle(t){const{col:e,row:i,stage:s}=ce(t),o=s?.table?.getCellStyle(e,i);if(!n.isObject(o))return;const{lineHeight:r,padding:a,...l}=o;return{...l,padding:n.isArray(a)?a.map((t=>`${t}px`)).join(" "):a}}calculatePosition(t,e){const i=t.globalAABBBounds;if("position"===e||i.empty()){const e=t.globalTransMatrix;return{x:e.e,y:e.f}}return n.calculateAnchorOfBounds(i,e||"top-left")}calculateOffset(t,e,i,n){const s=ee.global.getElementTopLeft(e,!1),o=t.window.getTopLeft(!1);return{left:i+o.left-s.left,top:n+o.top-s.top}}applyUserStyles(t,e,i){if(n.isFunction(t.style)){const n=t.style({top:i.offsetTop,left:i.offsetX,width:i.graphic.globalAABBBounds.width(),height:i.graphic.globalAABBBounds.height()},i.graphic,i.wrapContainer);Object.assign(e,n)}else n.isObject(t.style)?Object.assign(e,t.style):n.isString(t.style)&&Object.assign(e,n.styleStringToObject(t.style))}}function ce(t){for(;t?.parent;){if("custom-container"===t.name)return t;t=t.parent}return{col:-1,row:-1,stage:null}}var ue=i.defineComponent({__name:"base-table",props:{type:{type:String,required:!1},options:{type:null,required:!1},records:{type:Array,required:!1},width:{type:[Number,String],required:!1,default:"100%"},height:{type:[Number,String],required:!1,default:"100%"},onReady:{type:Function,required:!1},onError:{type:Function,required:!1},keepColumnWidthChange:{type:Boolean,required:!1},onClickCell:{type:null,required:!1},onDblClickCell:{type:null,required:!1},onMouseDownCell:{type:null,required:!1},onMouseUpCell:{type:null,required:!1},onSelectedCell:{type:null,required:!1},onKeyDown:{type:null,required:!1},onMouseEnterTable:{type:null,required:!1},onMouseLeaveTable:{type:null,required:!1},onMouseDownTable:{type:null,required:!1},onMouseMoveCell:{type:null,required:!1},onMouseEnterCell:{type:null,required:!1},onMouseLeaveCell:{type:null,required:!1},onContextMenuCell:{type:null,required:!1},onResizeColumn:{type:null,required:!1},onResizeColumnEnd:{type:null,required:!1},onChangeHeaderPosition:{type:null,required:!1},onChangeHeaderPositionStart:{type:null,required:!1},onChangeHeaderPositionFail:{type:null,required:!1},onSortClick:{type:null,required:!1},onFreezeClick:{type:null,required:!1},onScroll:{type:null,required:!1},onDropdownMenuClick:{type:null,required:!1},onMouseOverChartSymbol:{type:null,required:!1},onDragSelectEnd:{type:null,required:!1},onDropdownIconClick:{type:null,required:!1},onDropdownMenuClear:{type:null,required:!1},onTreeHierarchyStateChange:{type:null,required:!1},onShowMenu:{type:null,required:!1},onHideMenu:{type:null,required:!1},onIconClick:{type:null,required:!1},onLegendItemClick:{type:null,required:!1},onLegendItemHover:{type:null,required:!1},onLegendItemUnHover:{type:null,required:!1},onLegendChange:{type:null,required:!1},onMouseEnterAxis:{type:null,required:!1},onMouseLeaveAxis:{type:null,required:!1},onCheckboxStateChange:{type:null,required:!1},onRadioStateChange:{type:null,required:!1},onAfterRender:{type:null,required:!1},onInitialized:{type:null,required:!1},onPivotSortClick:{type:null,required:!1},onDrillMenuClick:{type:null,required:!1},onVChartEventType:{type:null,required:!1},onChangeCellValue:{type:null,required:!1},onMousedownFillHandle:{type:null,required:!1},onDragFillHandleEnd:{type:null,required:!1},onDblclickFillHandle:{type:null,required:!1},onScrollVerticalEnd:{type:null,required:!1},onScrollHorizontalEnd:{type:null,required:!1}},emits:y,setup(t,{expose:n,emit:s}){const o=t,r=i.ref(null),a=i.shallowRef(null),l=i.ref(new Map),h=i.ref([]),c=i.ref([]);T(o,a),function(t,e){i.watchEffect((()=>{t?.customConfig?.createReactContainer&&e.value&&e.value.scenegraph.stage.pluginService.register(new he)}))}(o,a),n({vTableInstance:a});const u=i.computed((()=>"number"==typeof o.width?`${o.width}px`:o.width)),d=i.computed((()=>"number"==typeof o.height?`${o.height}px`:o.height)),p=s,_=(t,e)=>{const i=new t(r.value,e);a.value=i,l.value.clear(),h.value=[],c.value=[],i.on("resize_column_end",(t=>{if(!o.keepColumnWidthChange)return;const{col:e,colWidths:n}=t,s=n[e];if(i.isPivotTable()){const t=i.getCellHeaderPaths(e,i.columnHeaderLevelCount);let n=null;n="rowHeader"===t.cellLocation?t.rowHeaderPaths:t.colHeaderPaths;let o=!1;for(let t=0;t<h.value.length;t++){const e=h.value[t];JSON.stringify(e.dimensions)===JSON.stringify(n)&&(e.width=s,o=!0)}o||h.value.push({dimensions:n,width:s})}else{const t=i.getBodyColumnDefine(e,0);t?.key&&l.value.set(t.key,s)}}))},g=()=>{if(!r.value)return;a.value&&a.value.release();const t=()=>void 0!==o.records&&null!==o.records&&o.records.length>0?o.records:o.options.records;try{switch(o.type){case"list":_(e.ListTable,{...o.options,records:t()});break;case"pivot":_(e.PivotTable,{...o.options,records:t()});break;case"chart":_(e.PivotChart,{...o.options,records:t()})}i=a.value,y.forEach((t=>{i.on(C[t],(e=>{p(t,e)}))})),o.onReady?.(a.value,!0)}catch(t){o.onError?.(t)}var i},f=t=>{if(a.value)try{if(o.keepColumnWidthChange){const e=function(t,e,i){if(i.isPivotTable())return e;const n=[];return t.forEach(((t,e)=>{n.push({key:e,width:t})})),n}(l.value,h.value,a.value);t={...t,columnWidthConfig:e,columnWidthConfigForRowHeader:e}}switch(o.type){case"list":a.value instanceof e.ListTable&&a.value.updateOption(t);break;case"pivot":a.value instanceof e.PivotTable&&a.value.updateOption(t);break;case"chart":a.value instanceof e.PivotChart&&a.value.updateOption(t)}}catch(t){o.onError?.(t)}};return i.onMounted(g),i.onBeforeUnmount((()=>{a.value?.release()})),i.watch((()=>o.options),((t,e)=>{a.value?f(t):g()})),i.watch((()=>o.records),((t,e)=>{a.value?f({...o.options,records:t}):g()}),{deep:!0}),(t,e)=>(i.openBlock(),i.createElementBlock("div",{ref_key:"vTableContainer",ref:r,style:i.normalizeStyle([{width:u.value,height:d.value},{position:"relative"}])},null,4))}}),de=i.defineComponent({__name:"list-table",props:{options:{type:Object,required:!0},records:{type:Array,required:!1},width:{type:[String,Number],required:!1},height:{type:[String,Number],required:!1}},setup(t,{expose:e}){const n=t,s=i.ref(null),o=i.useSlots(),r=i.computed((()=>{const t=function(t){const e={columns:[],tooltip:{},menu:{}},i={ListColumn:"columns",Tooltip:"tooltip",Menu:"menu"};return t.forEach((t=>{t.props=a(t.props);const n=t.type?.symbol||t.type?.name,s=i[n];s&&("columns"===s&&t.children&&(t.children.customLayout&&(t.props.customLayout=c(t.children)),t.children.headerCustomLayout&&(t.props.headerCustomLayout=c(t.children,!0)),p(t.props,t.children.edit)),Array.isArray(e[s])?e[s].push(t.props):e[s]=t.props)})),e}(l(o.default?.()||[]));return m(n.options,t)}));return e({vTableInstance:i.computed((()=>s.value?.vTableInstance||null))}),(t,e)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(ue,i.mergeProps({type:"list",options:r.value,records:t.records,width:t.width,height:t.height,ref_key:"baseTableRef",ref:s},t.$attrs),null,16,["options","records","width","height"]),i.renderSlot(t.$slots,"default")],64))}}),pe=i.defineComponent({__name:"pivot-table",props:{options:{type:Object,required:!0},records:{type:Array,required:!1},width:{type:[String,Number],required:!1},height:{type:[String,Number],required:!1}},setup(t,{expose:e}){const n=t,s=i.shallowRef(null),o=i.useSlots(),r=i.computed((()=>{const t=f(l(o.default?.()||[]));return m(n.options,t)}));return e({vTableInstance:i.computed((()=>s.value?.vTableInstance||null))}),(t,e)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(ue,i.mergeProps({type:"pivot",options:r.value,records:t.records,width:t.width,height:t.height,ref_key:"baseTableRef",ref:s},t.$attrs),null,16,["options","records","width","height"]),i.renderSlot(t.$slots,"default")],64))}}),_e=i.defineComponent({__name:"pivot-chart",props:{options:{type:Object,required:!0},records:{type:Array,required:!1},width:{type:[String,Number],required:!1},height:{type:[String,Number],required:!1}},setup(t,{expose:e}){const n=t,s=i.shallowRef(null),o=i.useSlots(),r=i.computed((()=>{const t=f(l(o.default?.()||[]));return m(n.options,t)}));return e({vTableInstance:i.computed((()=>s.value?.vTableInstance||null))}),(t,e)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(ue,i.mergeProps({type:"chart",options:r.value,records:t.records,width:t.width,height:t.height,ref_key:"baseTableRef",ref:s},t.$attrs),null,16,["options","records","width","height"]),i.renderSlot(t.$slots,"default")],64))}});function ge(t){return null}function fe(t){return null}function me(t){return null}function be(t){return null}function Ce(t){return null}function ye(t){return null}function Te(t){return null}function ve(t){return null}function Ee(t){return null}function xe(){return null}function Le(){return null}function we(){return null}function Oe(t){return null}function Ae(t){return null}function Pe(t){return null}ge.symbol="ListColumn",fe.symbol="PivotColumnDimension",me.symbol="PivotRowDimension",be.symbol="PivotColumnHeaderTitle",Ce.symbol="PivotRowHeaderTitle",ye.symbol="PivotIndicator",Te.symbol="PivotCorner",ve.symbol="Menu",Ee.symbol="Tooltip",xe.symbol="Group",Le.symbol="Image",we.symbol="Text",Oe.symbol="Tag",Ae.symbol="Radio",Pe.symbol="CheckBox";t.VTable=o,Object.defineProperty(t,"register",{enumerable:!0,get:function(){return e.register}}),t.CheckBox=Pe,t.Group=xe,t.Image=Le,t.ListColumn=ge,t.ListTable=de,t.Menu=ve,t.PivotChart=_e,t.PivotColumnDimension=fe,t.PivotColumnHeaderTitle=be,t.PivotCorner=Te,t.PivotIndicator=ye,t.PivotRowDimension=me,t.PivotRowHeaderTitle=Ce,t.PivotTable=pe,t.Radio=Ae,t.Tag=Oe,t.Text=we,t.Tooltip=Ee,t.registerChartModule=(t,e)=>{o.register.chartModule(t,e)},t.version="1.17.1"}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@visactor/vtable"),require("vue"),require("@visactor/vutils"),require("@visactor/vtable/es/vrender")):"function"==typeof define&&define.amd?define(["exports","@visactor/vtable","vue","@visactor/vutils","@visactor/vtable/es/vrender"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).VueVTable={},e.VTable,e.Vue,e.VUtils,e.VTable.vrender)}(this,(function(e,t,n,o,r){"use strict";function i(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var l=i(t);function a(e){return e.replace(/-([a-z])/g,(e=>e[1].toUpperCase()))}function s(e){const t={};for(const n in e)if(e.hasOwnProperty(n)){t[a(n)]=e[n]}return t}function u(e){return e.flatMap((e=>Array.isArray(e.children)?u(e.children):e))}function c(e,t,r){const i={Group:l.CustomLayout.Group,Image:l.CustomLayout.Image,Text:l.CustomLayout.Text,Tag:l.CustomLayout.Tag,Radio:l.CustomLayout.Radio,CheckBox:l.CustomLayout.CheckBox};return{rootComponent:function e(l){if(!l)return null;const{type:u,children:c}=l,d=s(l.props),p=i[u?.symbol||u?.name];if(!p)return null;const h=new p({...d});!function(e,t){Object.keys(t).forEach((n=>{if(function(e,t){return e.startsWith("on")&&o.isFunction(t[e])}(n,t)){let o;o=n.startsWith("on")?n.slice(2).toLowerCase():a(n.slice(2)).toLowerCase(),e.addEventListener(o,t[n])}}))}(h,d);const C=function(e){return e?.default?.()||e||[]}(c);if(o.isObject(d?.vue)){const{element:e}=d.vue,o=e??C[0];return Object.assign(l.props.vue,{element:n.isVNode(o)?o:null,container:t?r?.table?.headerDomContainer:r?.table?.bodyDomContainer}),h}return C.forEach((t=>{const n=e(t);n?h.add(n):t.type===Symbol.for("v-fgt")&&t.children.forEach((t=>{const n=e(t);n&&h.add(n)}))})),h}(e)}}function d(e,t){return n=>{const{table:o,row:r,col:i,rect:l}=n,a=o.getCellOriginRecord(i,r),{height:s,width:u}=l??o.getCellRect(i,r),d=t?"headerCustomLayout":"customLayout";if(!e[d])return null;const p=e[d]({table:o,row:r,col:i,rect:l,record:a,height:s,width:u})[0],{rootComponent:h}=c(p,t,n);return{rootContainer:h,renderDefault:!1}}}class p{wrapContainer;tableContainer;currentValue;nodeMap;constructor(){this.tableContainer=null,this.currentValue=null,this.wrapContainer=null,this.nodeMap=new Map}registerNode(e,t,n){o.isValid(e)&&o.isValid(t)&&"function"==typeof n&&(this.nodeMap.has(e)||this.nodeMap.set(e,new Map),this.nodeMap.get(e).set(t,n))}getNode(e,t){return this.nodeMap.get(e)?.get(t)}removeNode(e){this.nodeMap.delete(e)}release(e){o.isValid(e)?this.removeNode(e):this.nodeMap.clear()}async onStart(e){const{value:t}=e;this.setValue(t),await this.createElement(e)}async createElement(e){const{row:r,col:i,value:l,table:a,container:s,referencePosition:u}=e;if(!s)return!1;const c=a.getBodyColumnDefine(i,r),{editConfig:d}=c||{},{id:p}=a,h=this.getColumnKeyField(c);if(!o.isValid(h)||!o.isValid(p))return!1;if("function"==typeof d?.editBefore){if(!await d.editBefore(e))return a.showTooltip(i,r,{content:d.disablePrompt||"This field is not allowed to be edited",referencePosition:{rect:u?.rect,placement:t.TYPES.Placement.top},style:{bgColor:"black",color:"white",arrowMark:!0},disappearDelay:1e3}),!1}const C=this.getNode(p,h)?.({row:r,col:i,value:l,table:a,onChange:e=>this.setValue(e)})?.[0];if(!C||!n.isVNode(C))return!1;const m=document.createElement("div");m.style.position="absolute",m.style.width="100%",m.style.boxSizing="border-box";const{bgColor:y}=a.getCellStyle(i,r)||{};return m.style.backgroundColor=y||"#FFFFFF",this.wrapContainer=m,this.tableContainer=s,this.tableContainer.appendChild(m),n.render(C,m),u?.rect&&this.adjustPosition(u.rect),!0}getColumnKeyField(e){const{field:t,key:n}=e||{};return o.isValid(n)?n:t}getValue(){return this.currentValue}setValue(e){this.currentValue=e}adjustPosition(e){this.wrapContainer&&(this.wrapContainer.style.top=`${e.top}px`,this.wrapContainer.style.left=`${e.left}px`,this.wrapContainer.style.width=`${e.width}px`,this.wrapContainer.style.height=`${e.height}px`)}async validateValue(e,n,r,i){const{col:l,row:a}=r||{};if(!o.isValid(l)||!o.isValid(a))return!0;const s=i.getBodyColumnDefine(l,a),{editConfig:u}=s||{};if("function"==typeof u?.validateValue){const o=await u.validateValue({col:l,row:a,value:e,oldValue:n,table:i});if(!1===o){const e=i.getVisibleCellRangeRelativeRect({col:l,row:a});return i.showTooltip(l,a,{content:u.invalidPrompt||"invalid",referencePosition:{rect:e,placement:t.TYPES.Placement.top},style:{bgColor:"red",color:"white",arrowMark:!0},disappearDelay:1e3}),!1}return o}return!0}onEnd(){this.wrapContainer&&this.tableContainer&&(n.render(null,this.wrapContainer),this.tableContainer.removeChild(this.wrapContainer)),this.wrapContainer=null,this.tableContainer=null}isEditorElement(e){return this.wrapContainer?.contains(e)||this.isClickEditorElement(e)}isClickEditorElement(e){for(;e;){if(e.classList&&e.classList.contains("table-editor-element"))return!0;e=e.parentNode}return!1}}const h="dynamic-render-editor";function C(e,t){const{editor:n}=e||{},r=m(e);return!(!o.isValid(r)||n!==h)&&("function"==typeof t?(e.getEditCustomNode=t,!0):"function"==typeof e.getEditCustomNode)}function m(e){const{field:t,key:n}=e||{};return o.isValid(n)?n:t}function y(e){let n=t.register.editor(h);return!n&&e&&(n=new p,t.register.editor(h,n)),n}function f(e){const t={columns:[],columnHeaderTitle:[],rows:[],rowHeaderTitle:[],indicators:[],corner:{},tooltip:{},menu:{}},n={PivotColumnDimension:"columns",PivotColumnHeaderTitle:"columnHeaderTitle",PivotRowDimension:"rows",PivotRowHeaderTitle:"rowHeaderTitle",PivotCorner:"corner",PivotIndicator:"indicators",Tooltip:"tooltip",Menu:"menu"};return e.forEach((e=>{e.props=s(e.props);const o=e.type?.symbol||e.type?.name,r=n[o];r&&(Array.isArray(t[r])?e.props.hasOwnProperty("objectHandler")?t[r].push(e.props.objectHandler):t[r].push(e.props):t[r]=e.props)})),t}function g(e,t){return{...e,columns:t.columns&&t.columns.length?t.columns:e.columns,columnHeaderTitle:t.columnHeaderTitle&&t.columnHeaderTitle.length?t.columnHeaderTitle:e.columnHeaderTitle,rows:t.rows&&t.rows.length?t.rows:e.rows,rowHeaderTitle:t.rowHeaderTitle&&t.rowHeaderTitle.length?t.rowHeaderTitle:e.rowHeaderTitle,indicators:t.indicators&&t.indicators.length?t.indicators:e.indicators,corner:Object.keys(e.corner||{}).length?e.corner:t.corner,tooltip:Object.keys(t.tooltip||{}).length?t.tooltip:e.tooltip,menu:Object.keys(t.menu||{}).length?t.menu:e.menu}}const E={...t.ListTable.EVENT_TYPE,...t.PivotTable.EVENT_TYPE,...t.PivotChart.EVENT_TYPE},v={onClickCell:E.CLICK_CELL,onDblClickCell:E.DBLCLICK_CELL,onMouseDownCell:E.MOUSEDOWN_CELL,onMouseUpCell:E.MOUSEUP_CELL,onSelectedCell:E.SELECTED_CELL,onKeyDown:E.KEYDOWN,onMouseEnterTable:E.MOUSEENTER_TABLE,onMouseLeaveTable:E.MOUSELEAVE_TABLE,onMouseDownTable:E.MOUSEDOWN_TABLE,onMouseMoveCell:E.MOUSEMOVE_CELL,onMouseEnterCell:E.MOUSEENTER_CELL,onMouseLeaveCell:E.MOUSELEAVE_CELL,onContextMenuCell:E.CONTEXTMENU_CELL,onResizeColumn:E.RESIZE_COLUMN,onResizeColumnEnd:E.RESIZE_COLUMN_END,onChangeHeaderPosition:E.CHANGE_HEADER_POSITION,onChangeHeaderPositionStart:E.CHANGE_HEADER_POSITION_START,onChangeHeaderPositionFail:E.CHANGE_HEADER_POSITION_FAIL,onSortClick:E.SORT_CLICK,onFreezeClick:E.FREEZE_CLICK,onScroll:E.SCROLL,onDropdownMenuClick:E.DROPDOWN_MENU_CLICK,onMouseOverChartSymbol:E.MOUSEOVER_CHART_SYMBOL,onDragSelectEnd:E.DRAG_SELECT_END,onDropdownIconClick:E.DROPDOWN_ICON_CLICK,onDropdownMenuClear:E.DROPDOWN_MENU_CLEAR,onTreeHierarchyStateChange:E.TREE_HIERARCHY_STATE_CHANGE,onShowMenu:E.SHOW_MENU,onHideMenu:E.HIDE_MENU,onIconClick:E.ICON_CLICK,onLegendItemClick:E.LEGEND_ITEM_CLICK,onLegendItemHover:E.LEGEND_ITEM_HOVER,onLegendItemUnHover:E.LEGEND_ITEM_UNHOVER,onLegendChange:E.LEGEND_CHANGE,onMouseEnterAxis:E.MOUSEENTER_AXIS,onMouseLeaveAxis:E.MOUSELEAVE_AXIS,onCheckboxStateChange:E.CHECKBOX_STATE_CHANGE,onRadioStateChange:E.RADIO_STATE_CHANGE,onAfterRender:E.AFTER_RENDER,onInitialized:E.INITIALIZED,onPivotSortClick:E.PIVOT_SORT_CLICK,onDrillMenuClick:E.DRILLMENU_CLICK,onVChartEventType:E.VCHART_EVENT_TYPE,onChangeCellValue:E.CHANGE_CELL_VALUE,onMousedownFillHandle:E.MOUSEDOWN_FILL_HANDLE,onDragFillHandleEnd:E.DRAG_FILL_HANDLE_END,onDblclickFillHandle:E.DBLCLICK_FILL_HANDLE,onScrollVerticalEnd:E.SCROLL_VERTICAL_END,onScrollHorizontalEnd:E.SCROLL_HORIZONTAL_END,onChangCellValue:E.CHANGE_CELL_VALUE},b=Object.keys(v);function w(e,t){const r=n.computed((()=>{const t=e.options?.columns;return o.isArray(t)?t.filter((e=>!!o.isObject(e)&&!!C(e))):[]}));function i(){return t.value?.id}n.watchEffect((()=>{!function(){const e=i();if(!o.isValid(e))return;let t=y();t?t.removeNode(e):r.value.length>0&&(t=y(!0));r.value.forEach((n=>{const{getEditCustomNode:o}=n,r=m(n);t.registerNode(e,r,o),delete n.editCustomNode}))}()})),n.onBeforeUnmount((()=>{!function(){const e=i();if(!o.isValid(e))return;const t=y();t?.release(e)}()}))}class T extends r.HtmlAttributePlugin{renderQueue=new Set;isRendering=!1;renderGraphicHTML(e){this.checkNeedRender(e)&&(this.renderQueue.add(e),this.scheduleRender())}scheduleRender(){this.isRendering||(this.isRendering=!0,requestAnimationFrame((()=>{this.renderQueue.forEach((e=>{try{this.doRenderGraphic(e)}catch(t){const{id:n}=this.getGraphicOptions(e)||{};this.removeElement(n,!0)}})),this.renderQueue.clear(),this.isRendering=!1})))}doRenderGraphic(e){const{id:t,options:o}=this.getGraphicOptions(e),r=e.stage,{element:i,container:l}=o,a=l?function(e){const{col:t,row:n,stage:o}=L(e);let r=e.attribute.vue?.container;const{table:i}=o;r===i.bodyDomContainer?t<i.frozenColCount&&n>=i.rowCount-i.bottomFrozenRowCount?r=i.bottomFrozenBodyDomContainer:t>=i.colCount-i.rightFrozenColCount&&n>=i.rowCount-i.bottomFrozenRowCount?r=i.rightFrozenBottomDomContainer:n>=i.rowCount-i.bottomFrozenRowCount?r=i.bottomFrozenBodyDomContainer:t<i.frozenColCount?r=i.frozenBodyDomContainer:t>=i.colCount-i.rightFrozenColCount&&(r=i.rightFrozenBodyDomContainer):r===i.headerDomContainer&&(t<i.frozenColCount?r=i.frozenHeaderDomContainer:t>=i.colCount-i.rightFrozenColCount&&(r=i.rightFrozenHeaderDomContainer));return r}(e):l;let s=this.htmlMap?.[t];if(s&&a&&a!==s.container&&(this.removeElement(t),s=null),s&&this.checkDom(s.wrapContainer))n.render(i,s.wrapContainer);else{const{wrapContainer:l,nativeContainer:u}=this.getWrapContainer(r,a,{id:t,options:o});l&&(n.render(i,l),s={wrapContainer:l,nativeContainer:u,container:a,renderId:this.renderId,graphic:e,isInViewport:!0,lastPosition:null,lastStyle:{}},this.htmlMap[t]=s)}s&&(this.updateStyleOfWrapContainer(e,r,s.wrapContainer,s.nativeContainer),s.renderId=this.renderId)}getGraphicOptions(e){const{vue:t}=e.attribute;if(!t)return null;return{id:o.isNil(t.id)?`${e.id??e._uid}_vue`:t.id,options:t}}checkNeedRender(e){const{id:t,options:n}=this.getGraphicOptions(e)||{};if(!t)return!1;if(!e.stage)return!1;const{element:o}=n;if(!o)return!1;return this.checkInViewport(e)}checkInViewport(e){const{stage:t,globalAABBBounds:n}=e;if(!t)return!1;const o=100,{AABBBounds:r}=t,i=r.x1-o,l=r.x2+o,a=r.y1-o,s=r.y2+o;return n.x1<l&&n.x2>i&&n.y1<s&&n.y2>a}checkDom(e){return!!e&&document.contains(e)}removeAllDom(e){this.htmlMap&&(Object.keys(this.htmlMap).forEach((e=>{this.removeElement(e,!0)})),this.htmlMap=null)}removeElement(e,t){const o=this.htmlMap?.[e];if(!o)return;const{wrapContainer:r}=o;r&&(n.render(null,r),t?(this.checkDom(r)&&super.removeElement(e),delete this.htmlMap[e]):(r.remove(),o.isInViewport=!1),this.removeWrapContainerEventListener(r))}getWrapContainer(e,t,n){let o;o=t?"string"==typeof t?r.application.global.getElementById(t):t:e.window.getContainer();const{id:i}=n||{},l=this.htmlMap?.[i];if(l&&!l.isInViewport){const{wrapContainer:e}=l;return this.checkDom(e)||o.appendChild(e),{wrapContainer:e,nativeContainer:o}}return{wrapContainer:r.application.global.createDom({tagName:"div",parent:o}),nativeContainer:o}}updateStyleOfWrapContainer(e,t,n,i){const{attribute:l,type:a}=e,{vue:s,width:u,height:c,visible:d,display:p,...h}=l||{},{x:C,y:m}=this.calculatePosition(e,s.anchorType),{left:y,top:f}=this.calculateOffset(t,i,C,m),{id:g}=this.getGraphicOptions(e)||{},E=g?this.htmlMap[g]:null;if(!E)return;if(!(!E.lastPosition||E.lastPosition.x!==y||E.lastPosition.y!==f))return;const{pointerEvents:v=!0,penetrateEventList:b=["wheel"]}=s,w=this.parseDefaultStyleFromGraphic(e),T=this.convertCellStyle(e);Object.assign(w,{overflow:"hidden",...T||{},...h||{},transform:`translate(${y}px, ${f}px)`,boxSizing:"border-box",display:!1!==d?p||"block":"none",pointerEvents:!0===v?"all":v||"none",position:"absolute"}),"none"!==w.pointerEvents&&(this.removeWrapContainerEventListener(n),o.uniqArray(b).forEach((e=>{"wheel"===e&&(n.addEventListener("wheel",this.onWheel),n.addEventListener("wheel",(e=>e.preventDefault()),!0))}))),"text"===a&&"position"===s.anchorType&&Object.assign(w,this.getTransformOfText(e)),this.applyUserStyles(s,w,{offsetX:y,offsetTop:f,graphic:e,wrapContainer:n});!o.isEqual(E.lastStyle,w)&&(r.application.global.updateDom(n,{width:u,height:c,style:w}),E.lastStyle=w)}convertCellStyle(e){const{col:t,row:n,stage:r}=L(e),i=r?.table?.getCellStyle(t,n);if(!o.isObject(i))return;const{lineHeight:l,padding:a,...s}=i;return{...s,padding:o.isArray(a)?a.map((e=>`${e}px`)).join(" "):a}}calculatePosition(e,t){const n=e.globalAABBBounds;if("position"===t||n.empty()){const t=e.globalTransMatrix;return{x:t.e,y:t.f}}return o.calculateAnchorOfBounds(n,t||"top-left")}calculateOffset(e,t,n,o){const i=r.application.global.getElementTopLeft(t,!1),l=e.window.getTopLeft(!1);return{left:n+l.left-i.left,top:o+l.top-i.top}}applyUserStyles(e,t,n){if(o.isFunction(e.style)){const o=e.style({top:n.offsetTop,left:n.offsetX,width:n.graphic.globalAABBBounds.width(),height:n.graphic.globalAABBBounds.height()},n.graphic,n.wrapContainer);Object.assign(t,o)}else o.isObject(e.style)?Object.assign(t,e.style):o.isString(e.style)&&Object.assign(t,o.styleStringToObject(e.style))}}function L(e){for(;e?.parent;){if("custom-container"===e.name)return e;e=e.parent}return{col:-1,row:-1,stage:null}}var S=n.defineComponent({__name:"base-table",props:{type:{type:String,required:!1},options:{type:null,required:!1},records:{type:Array,required:!1},width:{type:[Number,String],required:!1,default:"100%"},height:{type:[Number,String],required:!1,default:"100%"},onReady:{type:Function,required:!1},onError:{type:Function,required:!1},keepColumnWidthChange:{type:Boolean,required:!1},onClickCell:{type:null,required:!1},onDblClickCell:{type:null,required:!1},onMouseDownCell:{type:null,required:!1},onMouseUpCell:{type:null,required:!1},onSelectedCell:{type:null,required:!1},onKeyDown:{type:null,required:!1},onMouseEnterTable:{type:null,required:!1},onMouseLeaveTable:{type:null,required:!1},onMouseDownTable:{type:null,required:!1},onMouseMoveCell:{type:null,required:!1},onMouseEnterCell:{type:null,required:!1},onMouseLeaveCell:{type:null,required:!1},onContextMenuCell:{type:null,required:!1},onResizeColumn:{type:null,required:!1},onResizeColumnEnd:{type:null,required:!1},onChangeHeaderPosition:{type:null,required:!1},onChangeHeaderPositionStart:{type:null,required:!1},onChangeHeaderPositionFail:{type:null,required:!1},onSortClick:{type:null,required:!1},onFreezeClick:{type:null,required:!1},onScroll:{type:null,required:!1},onDropdownMenuClick:{type:null,required:!1},onMouseOverChartSymbol:{type:null,required:!1},onDragSelectEnd:{type:null,required:!1},onDropdownIconClick:{type:null,required:!1},onDropdownMenuClear:{type:null,required:!1},onTreeHierarchyStateChange:{type:null,required:!1},onShowMenu:{type:null,required:!1},onHideMenu:{type:null,required:!1},onIconClick:{type:null,required:!1},onLegendItemClick:{type:null,required:!1},onLegendItemHover:{type:null,required:!1},onLegendItemUnHover:{type:null,required:!1},onLegendChange:{type:null,required:!1},onMouseEnterAxis:{type:null,required:!1},onMouseLeaveAxis:{type:null,required:!1},onCheckboxStateChange:{type:null,required:!1},onRadioStateChange:{type:null,required:!1},onAfterRender:{type:null,required:!1},onInitialized:{type:null,required:!1},onPivotSortClick:{type:null,required:!1},onDrillMenuClick:{type:null,required:!1},onVChartEventType:{type:null,required:!1},onChangeCellValue:{type:null,required:!1},onMousedownFillHandle:{type:null,required:!1},onDragFillHandleEnd:{type:null,required:!1},onDblclickFillHandle:{type:null,required:!1},onScrollVerticalEnd:{type:null,required:!1},onScrollHorizontalEnd:{type:null,required:!1}},emits:b,setup(e,{expose:o,emit:r}){const i=e,l=n.ref(null),a=n.shallowRef(null),s=n.ref(new Map),u=n.ref([]),c=n.ref([]);w(i,a),function(e,t){n.watchEffect((()=>{e?.options?.customConfig?.createReactContainer&&t.value&&t.value.scenegraph.stage.pluginService.register(new T)}))}(i,a),o({vTableInstance:a});const d=n.computed((()=>"number"==typeof i.width?`${i.width}px`:i.width)),p=n.computed((()=>"number"==typeof i.height?`${i.height}px`:i.height)),h=r,C=(e,t)=>{const n=new e(l.value,t);a.value=n,s.value.clear(),u.value=[],c.value=[],n.on("resize_column_end",(e=>{if(!i.keepColumnWidthChange)return;const{col:t,colWidths:o}=e,r=o[t];if(n.isPivotTable()){const e=n.getCellHeaderPaths(t,n.columnHeaderLevelCount);let o=null;o="rowHeader"===e.cellLocation?e.rowHeaderPaths:e.colHeaderPaths;let i=!1;for(let e=0;e<u.value.length;e++){const t=u.value[e];JSON.stringify(t.dimensions)===JSON.stringify(o)&&(t.width=r,i=!0)}i||u.value.push({dimensions:o,width:r})}else{const e=n.getBodyColumnDefine(t,0);e?.key&&s.value.set(e.key,r)}}))},m=()=>{if(!l.value)return;a.value&&a.value.release();const e=()=>void 0!==i.records&&null!==i.records&&i.records.length>0?i.records:i.options.records;try{switch(i.type){case"list":C(t.ListTable,{...i.options,records:e()});break;case"pivot":C(t.PivotTable,{...i.options,records:e()});break;case"chart":C(t.PivotChart,{...i.options,records:e()})}n=a.value,b.forEach((e=>{n.on(v[e],(t=>{h(e,t)}))})),i.onReady?.(a.value,!0)}catch(e){i.onError?.(e)}var n},y=e=>{if(a.value)try{if(i.keepColumnWidthChange){const t=function(e,t,n){if(n.isPivotTable())return t;const o=[];return e.forEach(((e,t)=>{o.push({key:t,width:e})})),o}(s.value,u.value,a.value);e={...e,columnWidthConfig:t,columnWidthConfigForRowHeader:t}}switch(i.type){case"list":a.value instanceof t.ListTable&&a.value.updateOption(e);break;case"pivot":a.value instanceof t.PivotTable&&a.value.updateOption(e);break;case"chart":a.value instanceof t.PivotChart&&a.value.updateOption(e)}}catch(e){i.onError?.(e)}};return n.onMounted(m),n.onBeforeUnmount((()=>{a.value?.release()})),n.watch((()=>i.options),((e,t)=>{a.value?y(e):m()})),n.watch((()=>i.records),((e,t)=>{a.value?y({...i.options,records:e}):m()}),{deep:!0}),(e,t)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"vTableContainer",ref:l,style:n.normalizeStyle([{width:d.value,height:p.value},{position:"relative"}])},null,4))}}),O=n.defineComponent({__name:"list-table",props:{options:{type:Object,required:!0},records:{type:Array,required:!1},width:{type:[String,Number],required:!1},height:{type:[String,Number],required:!1}},setup(e,{expose:t}){const o=e,r=n.ref(null),i=n.useSlots(),l=n.computed((()=>{const e=function(e){const t={columns:[],tooltip:{},menu:{}},n={ListColumn:"columns",Tooltip:"tooltip",Menu:"menu"};return e.forEach((e=>{e.props=s(e.props);const o=e.type?.symbol||e.type?.name,r=n[o];r&&("columns"===r&&e.children&&(e.children.customLayout&&(e.props.customLayout=d(e.children)),e.children.headerCustomLayout&&(e.props.headerCustomLayout=d(e.children,!0)),C(e.props,e.children.edit)),Array.isArray(t[r])?t[r].push(e.props):t[r]=e.props)})),t}(u(i.default?.()||[]));return g(o.options,e)}));return t({vTableInstance:n.computed((()=>r.value?.vTableInstance||null))}),(e,t)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createVNode(S,n.mergeProps({type:"list",options:l.value,records:e.records,width:e.width,height:e.height,ref_key:"baseTableRef",ref:r},e.$attrs),null,16,["options","records","width","height"]),n.renderSlot(e.$slots,"default")],64))}}),M=n.defineComponent({__name:"pivot-table",props:{options:{type:Object,required:!0},records:{type:Array,required:!1},width:{type:[String,Number],required:!1},height:{type:[String,Number],required:!1}},setup(e,{expose:t}){const o=e,r=n.shallowRef(null),i=n.useSlots(),l=n.computed((()=>{const e=f(u(i.default?.()||[]));return g(o.options,e)}));return t({vTableInstance:n.computed((()=>r.value?.vTableInstance||null))}),(e,t)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createVNode(S,n.mergeProps({type:"pivot",options:l.value,records:e.records,width:e.width,height:e.height,ref_key:"baseTableRef",ref:r},e.$attrs),null,16,["options","records","width","height"]),n.renderSlot(e.$slots,"default")],64))}}),_=n.defineComponent({__name:"pivot-chart",props:{options:{type:Object,required:!0},records:{type:Array,required:!1},width:{type:[String,Number],required:!1},height:{type:[String,Number],required:!1}},setup(e,{expose:t}){const o=e,r=n.shallowRef(null),i=n.useSlots(),l=n.computed((()=>{const e=f(u(i.default?.()||[]));return g(o.options,e)}));return t({vTableInstance:n.computed((()=>r.value?.vTableInstance||null))}),(e,t)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createVNode(S,n.mergeProps({type:"chart",options:l.value,records:e.records,width:e.width,height:e.height,ref_key:"baseTableRef",ref:r},e.$attrs),null,16,["options","records","width","height"]),n.renderSlot(e.$slots,"default")],64))}});function D(e){return null}function N(e){return null}function R(e){return null}function H(e){return null}function I(e){return null}function P(e){return null}function q(e){return null}function k(e){return null}function A(e){return null}function V(){return null}function B(){return null}function x(){return null}function F(e){return null}function U(e){return null}function j(e){return null}D.symbol="ListColumn",N.symbol="PivotColumnDimension",R.symbol="PivotRowDimension",H.symbol="PivotColumnHeaderTitle",I.symbol="PivotRowHeaderTitle",P.symbol="PivotIndicator",q.symbol="PivotCorner",k.symbol="Menu",A.symbol="Tooltip",V.symbol="Group",B.symbol="Image",x.symbol="Text",F.symbol="Tag",U.symbol="Radio",j.symbol="CheckBox";e.VTable=l,Object.defineProperty(e,"register",{enumerable:!0,get:function(){return t.register}}),e.CheckBox=j,e.Group=V,e.Image=B,e.ListColumn=D,e.ListTable=O,e.Menu=k,e.PivotChart=_,e.PivotColumnDimension=N,e.PivotColumnHeaderTitle=H,e.PivotCorner=q,e.PivotIndicator=P,e.PivotRowDimension=R,e.PivotRowHeaderTitle=I,e.PivotTable=M,e.Radio=U,e.Tag=F,e.Text=x,e.Tooltip=A,e.registerChartModule=(e,t)=>{l.register.chartModule(e,t)},e.version="1.17.2"}));
@@ -1,8 +1,7 @@
1
1
  import { __rest } from 'tslib';
2
+ import { HtmlAttributePlugin, application } from '@visactor/vtable/es/vrender';
2
3
  import { isNil, uniqArray, isEqual, isObject, isArray, calculateAnchorOfBounds, isFunction, isString, styleStringToObject } from '@visactor/vutils';
3
4
  import { render } from 'vue';
4
- import { HtmlAttributePlugin } from '../../../../../common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/plugins/builtin-plugin/html-attribute-plugin.js';
5
- import { application } from '../../../../../common/temp/node_modules/.pnpm/@visactor_vrender-core@0.21.9-alpha.2/node_modules/@visactor/vrender-core/es/application.js';
6
5
 
7
6
  class VTableVueAttributePlugin extends HtmlAttributePlugin {
8
7
  constructor() {
@@ -3,8 +3,8 @@ import { VTableVueAttributePlugin } from '../components/custom/vtable-vue-attrib
3
3
 
4
4
  function useCellRender(props, tableRef) {
5
5
  watchEffect(() => {
6
- var _a;
7
- if (!((_a = props === null || props === void 0 ? void 0 : props.customConfig) === null || _a === void 0 ? void 0 : _a.createReactContainer)) {
6
+ var _a, _b;
7
+ if (!((_b = (_a = props === null || props === void 0 ? void 0 : props.options) === null || _a === void 0 ? void 0 : _a.customConfig) === null || _b === void 0 ? void 0 : _b.createReactContainer)) {
8
8
  return;
9
9
  }
10
10
  if (!tableRef.value) {
package/es/index.d.ts CHANGED
@@ -2,4 +2,4 @@ import * as VTable from '@visactor/vtable';
2
2
  export * from './tables';
3
3
  export * from './components';
4
4
  export { VTable };
5
- export declare const version = "1.17.1";
5
+ export declare const version = "1.17.2";
@@ -21,6 +21,6 @@ export { default as Tag } from './components/custom/tag.js';
21
21
  export { default as Radio } from './components/custom/radio.js';
22
22
  export { default as CheckBox } from './components/custom/checkBox.js';
23
23
 
24
- const version = "1.17.1";
24
+ const version = "1.17.2";
25
25
 
26
26
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visactor/vue-vtable",
3
- "version": "1.17.1",
3
+ "version": "1.17.2",
4
4
  "description": "The vue version of VTable",
5
5
  "keywords": [
6
6
  "vue",
@@ -44,7 +44,7 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "@visactor/vutils": "~0.19.1",
47
- "@visactor/vtable": "1.17.1"
47
+ "@visactor/vtable": "1.17.2"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@arco-design/web-vue": "^2.11.0",
@@ -87,8 +87,8 @@
87
87
  "axios": "^1.4.0",
88
88
  "eslint-plugin-vue": "^9.26.0",
89
89
  "vue-eslint-parser": "^9.4.2",
90
- "@internal/eslint-config": "0.0.1",
91
90
  "@internal/bundler": "0.0.1",
91
+ "@internal/eslint-config": "0.0.1",
92
92
  "@internal/ts-config": "0.0.1"
93
93
  },
94
94
  "scripts": {
@@ -1,7 +0,0 @@
1
- 'use strict';
2
-
3
- class Application {}
4
- const application = new Application();
5
-
6
- exports.Application = Application;
7
- exports.application = application;
@@ -1,33 +0,0 @@
1
- 'use strict';
2
-
3
- var vutils = require('@visactor/vutils');
4
-
5
- function snapLength(xArr, yArr) {
6
- let totalLength = 0;
7
- const count = xArr.length;
8
- for (let i = 0; i < count; i++) {
9
- const x = xArr[i],
10
- y = yArr[i],
11
- nextX = xArr[(i + 1) % count],
12
- nextY = yArr[(i + 1) % count];
13
- totalLength += vutils.PointService.distanceNN(x, y, nextX, nextY);
14
- }
15
- return totalLength / 2;
16
- }
17
- function cubicLength(p0, p1, p2, p3, iterationCount) {
18
- return snapLength([p0.x, p1.x, p2.x, p3.x], [p0.y, p1.y, p2.y, p3.y]);
19
- }
20
- function cubicCalc(p0, p1, p2, p3, t) {
21
- const one = 1 - t;
22
- return one * one * one * p0 + 3 * p1 * t * one * one + 3 * p2 * t * t * one + p3 * t * t * t;
23
- }
24
- function cubicPointAt(p0, p1, p2, p3, t) {
25
- const x = cubicCalc(p0.x, p1.x, p2.x, p3.x, t),
26
- y = cubicCalc(p0.y, p1.y, p2.y, p3.y, t);
27
- return new vutils.Point(x, y);
28
- }
29
-
30
- exports.cubicCalc = cubicCalc;
31
- exports.cubicLength = cubicLength;
32
- exports.cubicPointAt = cubicPointAt;
33
- exports.snapLength = snapLength;
@@ -1,57 +0,0 @@
1
- 'use strict';
2
-
3
- var vutils = require('@visactor/vutils');
4
-
5
- const circleThreshold = vutils.tau - 1e-8;
6
- class BoundsContext {
7
- constructor(bounds) {
8
- this.init(bounds);
9
- }
10
- init(bounds) {
11
- this.bounds = bounds;
12
- }
13
- arc(cx, cy, r, sa, ea, ccw) {
14
- if (Math.abs(ea - sa) > circleThreshold) return this.bounds.add(cx - r, cy - r), void this.bounds.add(cx + r, cy + r);
15
- let s,
16
- i,
17
- x,
18
- y,
19
- xmin = 1 / 0,
20
- xmax = -1 / 0,
21
- ymin = 1 / 0,
22
- ymax = -1 / 0;
23
- function update(a) {
24
- x = r * Math.cos(a), y = r * Math.sin(a), x < xmin && (xmin = x), x > xmax && (xmax = x), y < ymin && (ymin = y), y > ymax && (ymax = y);
25
- }
26
- if (update(sa), update(ea), ea !== sa) if ((sa %= vutils.tau) < 0 && (sa += vutils.tau), (ea %= vutils.tau) < 0 && (ea += vutils.tau), ea < sa && (ccw = !ccw, s = sa, sa = ea, ea = s), ccw) for (ea -= vutils.tau, s = sa - sa % vutils.halfPi, i = 0; i < 4 && s > ea; ++i, s -= vutils.halfPi) update(s);else for (s = sa - sa % vutils.halfPi + vutils.halfPi, i = 0; i < 4 && s < ea; ++i, s += vutils.halfPi) update(s);
27
- this.bounds.add(cx + xmin, cy + ymin), this.bounds.add(cx + xmax, cy + ymax);
28
- }
29
- arcTo(x1, y1, x2, y2, radius) {
30
- this.bounds.add(x1, y1);
31
- }
32
- bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y) {
33
- this.bounds.add(cp1x, cp1y), this.bounds.add(cp2x, cp2y), this.bounds.add(x, y);
34
- }
35
- closePath() {}
36
- ellipse() {
37
- throw new Error("不支持ellipse");
38
- }
39
- lineTo(x, y) {
40
- this.bounds.add(x, y);
41
- }
42
- moveTo(x, y) {
43
- this.bounds.add(x, y);
44
- }
45
- quadraticCurveTo(cpx, cpy, x, y) {
46
- this.bounds.add(cpx, cpy), this.bounds.add(x, y);
47
- }
48
- rect(x, y, w, h) {
49
- this.bounds.add(x, y), this.bounds.add(x + w, y + h);
50
- }
51
- clear() {
52
- this.bounds.clear();
53
- }
54
- release() {}
55
- }
56
-
57
- exports.BoundsContext = BoundsContext;