@visactor/vue-vtable 1.26.1-alpha.0 → 1.26.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/index.js +1 -1
- package/dist/vue-vtable.js +1 -1
- package/dist/vue-vtable.min.js +1 -1
- package/es/components/component/menu.d.ts +14 -0
- package/es/components/component/tooltip.d.ts +11 -0
- package/es/components/custom/checkBox.d.ts +20 -0
- package/es/components/custom/custom-layout.d.ts +20 -0
- package/es/components/custom/group.d.ts +6 -0
- package/es/components/custom/image.d.ts +6 -0
- package/es/components/custom/radio.d.ts +17 -0
- package/es/components/custom/tag.d.ts +16 -0
- package/es/components/custom/text.d.ts +6 -0
- package/es/components/custom/vtable-vue-attribute-plugin.d.ts +62 -0
- package/es/components/index.d.ts +15 -0
- package/es/components/list/list-column.d.ts +7 -0
- package/es/components/pivot/pivot-column-dimension.d.ts +11 -0
- package/es/components/pivot/pivot-column-header-title.d.ts +7 -0
- package/es/components/pivot/pivot-corner.d.ts +7 -0
- package/es/components/pivot/pivot-indicator.d.ts +7 -0
- package/es/components/pivot/pivot-row-dimension.d.ts +11 -0
- package/es/components/pivot/pivot-row-header-title.d.ts +7 -0
- package/es/constants.d.ts +1 -0
- package/es/edit/editor.d.ts +50 -0
- package/es/edit/index.d.ts +2 -0
- package/es/edit/util.d.ts +4 -0
- package/es/eventsUtils.d.ts +120 -0
- package/es/global.d.ts +1 -0
- package/es/hooks/index.d.ts +2 -0
- package/es/hooks/useCellRender.d.ts +2 -0
- package/es/hooks/useEditorRender.d.ts +2 -0
- package/es/index.d.ts +6 -0
- package/es/index.js +1 -1
- package/es/tables/base-table.vue.d.ts +4 -0
- package/es/tables/chartModule.d.ts +1 -0
- package/es/tables/index.d.ts +5 -0
- package/es/tables/list-table.vue.d.ts +4 -0
- package/es/tables/pivot-chart.vue.d.ts +4 -0
- package/es/tables/pivot-table.vue.d.ts +4 -0
- package/es/utils/customLayoutUtils.d.ts +5 -0
- package/es/utils/slotUtils.d.ts +28 -0
- package/es/utils/stringUtils.d.ts +2 -0
- package/es/utils/vnodeUtils.d.ts +1 -0
- package/es/utils.d.ts +4 -0
- package/es/vue-shims.d.ts +5 -0
- package/package.json +6 -5
package/cjs/index.js
CHANGED
|
@@ -41,7 +41,7 @@ function _interopNamespaceDefault(e) {
|
|
|
41
41
|
|
|
42
42
|
var VTable__namespace = /*#__PURE__*/_interopNamespaceDefault(VTable);
|
|
43
43
|
|
|
44
|
-
const version = "1.26.1
|
|
44
|
+
const version = "1.26.1";
|
|
45
45
|
|
|
46
46
|
exports.VTable = VTable__namespace;
|
|
47
47
|
Object.defineProperty(exports, 'register', {
|
package/dist/vue-vtable.js
CHANGED
package/dist/vue-vtable.min.js
CHANGED
|
@@ -1 +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,i){"use strict";function r(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=r(t);function s(e){return e.replace(/-([a-z])/g,(e=>e[1].toUpperCase()))}function a(e){const t={};for(const n in e)if(e.hasOwnProperty(n)){t[s(n)]=e[n]}return t}function u(e){return e.flatMap((e=>Array.isArray(e.children)?u(e.children):e))}function c(e,t,i){let r=0;const u={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){var c,d;if(!l)return null;const{type:p,children:h}=l,C=a(l.props),v=(null==p?void 0:p.symbol)||(null==p?void 0:p.name),y=u[v];if(!y)return null;const f=new y(Object.assign({},C));!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():s(n.slice(2)).toLowerCase(),e.addEventListener(o,t[n])}}))}(f,C);const m=function(e){var t;return(null===(t=null==e?void 0:e.default)||void 0===t?void 0:t.call(e))||e||[]}(h);if(o.isObject(null==C?void 0:C.vue)){const{element:e}=C.vue;let s=null!=e?e:m.find((e=>(null==e?void 0:e.type)!==Symbol.for("v-cmt")));s=n.isVNode(s)?s.key?s:n.cloneVNode(s,{key:`row_${i.row}_col_${i.col}`}):null;const a=o.isNil(C.vue.id)?`cell_${i.col}_${i.row}_${r++}`:void 0;return Object.assign(l.props.vue,Object.assign({element:s,container:t?null===(c=null==i?void 0:i.table)||void 0===c?void 0:c.headerDomContainer:null===(d=null==i?void 0:i.table)||void 0===d?void 0:d.bodyDomContainer},a?{id:a}:{})),f}return m.forEach((t=>{const n=e(t);n?f.add(n):t.type===Symbol.for("v-fgt")&&t.children.forEach((t=>{const n=e(t);n&&f.add(n)}))})),f}(e)}}function d(e,t){return n=>{const{table:o,row:i,col:r,rect:l}=n,s=o.getCellOriginRecord(r,i),{height:a,width:u}=null!=l?l:o.getCellRect(r,i),d=t?"headerCustomLayout":"customLayout";if(!e[d])return null;const p=e[d]({table:o,row:i,col:r,rect:l,record:s,height:a,width:u})[0],{rootComponent:h}=c(p,t,n);return{rootContainer:h,renderDefault:!1}}}class p{constructor(e){this.currentContext=e,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){var n;return null===(n=this.nodeMap.get(e))||void 0===n?void 0:n.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:i,col:r,value:l,table:s,container:a,referencePosition:u}=e;if(!a)return!1;const c=s.getBodyColumnDefine(r,i),{editConfig:d}=c||{},{id:p}=s,h=this.getColumnKeyField(c);if(!o.isValid(h)||!o.isValid(p))return!1;if("function"==typeof(null==d?void 0:d.editBefore)){if(!await d.editBefore(e))return s.showTooltip(r,i,{content:d.disablePrompt||"This field is not allowed to be edited",referencePosition:{rect:null==u?void 0:u.rect,placement:t.TYPES.Placement.top},style:{bgColor:"black",color:"white",arrowMark:!0},disappearDelay:1e3}),!1}const C=null==s?void 0:s.getCellOriginRecord(r,i),v=this.getNode(p,h);if(!v)return!1;const y=n.h(v,{row:i,col:r,value:l,refValue:n.customRef(((e,t)=>({get:()=>(e(),this.getValue()),set:e=>{this.setValue(e),t()}}))),record:C,table:s,onChange:e=>this.setValue(e)});if(!y||!n.isVNode(y))return!1;this.checkToPassAppContext(y,s);const f=document.createElement("div");f.style.position="absolute",f.style.width="100%",f.style.boxSizing="border-box";const{bgColor:m}=s.getCellStyle(r,i)||{};return f.style.backgroundColor=m||"#FFFFFF",this.wrapContainer=f,this.tableContainer=a,this.tableContainer.appendChild(f),n.render(y,f),(null==u?void 0:u.rect)&&this.adjustPosition(u.rect),!0}checkToPassAppContext(e,t){var n,o,i,r;try{const l=null!==(r=null===(i=null===(o=null===(n=t.options)||void 0===n?void 0:n.customConfig)||void 0===o?void 0:o.getVueUserAppContext)||void 0===i?void 0:i.call(o))&&void 0!==r?r:this.currentContext;(null==l?void 0:l.components)&&(null==l?void 0:l.directives)&&(e.appContext=l)}catch(e){}}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,i,r){const{col:l,row:s}=i||{};if(!o.isValid(l)||!o.isValid(s))return!0;const a=r.getBodyColumnDefine(l,s),{editConfig:u}=a||{};if("function"==typeof(null==u?void 0:u.validateValue)){const o=await u.validateValue({col:l,row:s,value:e,oldValue:n,table:r});if(!1===o){const e=r.getVisibleCellRangeRelativeRect({col:l,row:s});return r.showTooltip(l,s,{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){var t;return(null===(t=this.wrapContainer)||void 0===t?void 0:t.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||{},i=v(e);if(!o.isValid(i)||n!==h)return!1;if("function"==typeof t){if(e.getEditCustomNode=t,Array.isArray(e.columns)&&e.columns.length)for(const n of e.columns)C(n,t);return!0}return"function"==typeof e.getEditCustomNode}function v(e){const{field:t,key:n}=e||{};return o.isValid(n)?n:t}function y(e,n){const o=t.register.editor(h);let i=o||void 0;return!i&&e&&(i=new p(n),t.register.editor(h,i)),i}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=>{var o,i;e.props=a(e.props);const r=(null===(o=e.type)||void 0===o?void 0:o.symbol)||(null===(i=e.type)||void 0===i?void 0:i.name),l=n[r];l&&(Array.isArray(t[l])?e.props.hasOwnProperty("objectHandler")?t[l].push(e.props.objectHandler):t[l].push(e.props):t[l]=e.props)})),t}function m(e,t){return Object.assign(Object.assign({},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 g=Object.assign(Object.assign(Object.assign({},t.ListTable.EVENT_TYPE),t.PivotTable.EVENT_TYPE),t.PivotChart.EVENT_TYPE),E={onClickCell:g.CLICK_CELL,onDblClickCell:g.DBLCLICK_CELL,onMouseDownCell:g.MOUSEDOWN_CELL,onMouseUpCell:g.MOUSEUP_CELL,onSelectedCell:g.SELECTED_CELL,onKeyDown:g.KEYDOWN,onMouseEnterTable:g.MOUSEENTER_TABLE,onMouseLeaveTable:g.MOUSELEAVE_TABLE,onMouseDownTable:g.MOUSEDOWN_TABLE,onMouseMoveCell:g.MOUSEMOVE_CELL,onMouseEnterCell:g.MOUSEENTER_CELL,onMouseLeaveCell:g.MOUSELEAVE_CELL,onContextMenuCell:g.CONTEXTMENU_CELL,onContextMenuCanvas:g.CONTEXTMENU_CANVAS,onResizeColumn:g.RESIZE_COLUMN,onResizeColumnEnd:g.RESIZE_COLUMN_END,onChangeHeaderPosition:g.CHANGE_HEADER_POSITION,onChangeHeaderPositionStart:g.CHANGE_HEADER_POSITION_START,onChangeHeaderPositionFail:g.CHANGE_HEADER_POSITION_FAIL,onSortClick:g.SORT_CLICK,onFreezeClick:g.FREEZE_CLICK,onScroll:g.SCROLL,onDropdownMenuClick:g.DROPDOWN_MENU_CLICK,onMouseOverChartSymbol:g.MOUSEOVER_CHART_SYMBOL,onDragSelectEnd:g.DRAG_SELECT_END,onDropdownIconClick:g.DROPDOWN_ICON_CLICK,onDropdownMenuClear:g.DROPDOWN_MENU_CLEAR,onTreeHierarchyStateChange:g.TREE_HIERARCHY_STATE_CHANGE,onShowMenu:g.SHOW_MENU,onHideMenu:g.HIDE_MENU,onIconClick:g.ICON_CLICK,onLegendItemClick:g.LEGEND_ITEM_CLICK,onLegendItemHover:g.LEGEND_ITEM_HOVER,onLegendItemUnHover:g.LEGEND_ITEM_UNHOVER,onLegendChange:g.LEGEND_CHANGE,onMouseEnterAxis:g.MOUSEENTER_AXIS,onMouseLeaveAxis:g.MOUSELEAVE_AXIS,onCheckboxStateChange:g.CHECKBOX_STATE_CHANGE,onRadioStateChange:g.RADIO_STATE_CHANGE,onAfterRender:g.AFTER_RENDER,onInitialized:g.INITIALIZED,onPivotSortClick:g.PIVOT_SORT_CLICK,onDrillMenuClick:g.DRILLMENU_CLICK,onVChartEventType:g.VCHART_EVENT_TYPE,onChangeCellValue:g.CHANGE_CELL_VALUE,onMousedownFillHandle:g.MOUSEDOWN_FILL_HANDLE,onDragFillHandleEnd:g.DRAG_FILL_HANDLE_END,onDblclickFillHandle:g.DBLCLICK_FILL_HANDLE,onScrollVerticalEnd:g.SCROLL_VERTICAL_END,onScrollHorizontalEnd:g.SCROLL_HORIZONTAL_END,onChangCellValue:g.CHANGE_CELL_VALUE,onEmptyTipClick:g.EMPTY_TIP_CLICK,onEmptyTipDblClick:g.EMPTY_TIP_DBLCLICK,onButtonClick:g.BUTTON_CLICK,onBeforeCacheChartImage:g.BEFORE_CACHE_CHART_IMAGE,onPastedData:g.PASTED_DATA,onSelectedClear:g.SELECTED_CLEAR},b=Object.keys(E);function w(e,t){const i=n.getCurrentInstance(),r=n.computed((()=>{var t;const n=T((null===(t=e.options)||void 0===t?void 0:t.columns)||[]);return o.isArray(n)?n.filter((e=>!!o.isObject(e)&&!!C(e))):[]}));function l(){var e;return null===(e=t.value)||void 0===e?void 0:e.id}n.watchEffect((()=>{!function(){const e=l();if(!o.isValid(e))return;let t=y();t?t.removeNode(e):r.value.length>0&&(t=y(!0,null==i?void 0:i.appContext));r.value.forEach((n=>{const{getEditCustomNode:o}=n,i=v(n);t.registerNode(e,i,o),delete n.editCustomNode}))}()})),n.onBeforeUnmount((()=>{!function(){const e=l();if(!o.isValid(e))return;const t=y();null==t||t.release(e)}()}))}function T(e){return e.flatMap((e=>Array.isArray(e.columns)?T(e.columns):e))}var O=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(n[o[i]]=e[o[i]])}return n};class L extends i.HtmlAttributePlugin{constructor(e){super(),this.name="VTableVueAttributePlugin",this.renderQueue=new Set,this.isRendering=!1,this.MAX_CACHE_COUNT=100,this.accessQueue=[],this.VIEWPORT_BUFFER=100,this.BUFFER_ZONE=500,this.styleUpdateQueue=new Map,this.styleUpdateRequested=!1,this.eventHandlers=new WeakMap,this.currentContext=e}renderGraphicHTML(e){var t;if(!this.checkNeedRender(e))return;const n=this.getGraphicOptions(e);if(n){const o=null===(t=this.htmlMap)||void 0===t?void 0:t[n.id];if(o&&this.checkDom(o.wrapContainer))return void this.doRenderGraphic(e)}this.renderQueue.add(e),this.scheduleRender()}scheduleRender(){this.isRendering||(this.isRendering=!0,i.vglobal.getRequestAnimationFrame()((()=>{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){var t;const{id:o,options:i}=this.getGraphicOptions(e);if(!o)return;const r=e.stage,{element:l,container:s}=i,a=s?function(e){var t;const{col:n,row:o,stage:i}=_(e);let r=null===(t=e.attribute.vue)||void 0===t?void 0:t.container;const{table:l}=i;r===l.bodyDomContainer?n<l.frozenColCount&&o>=l.rowCount-l.bottomFrozenRowCount?r=l.bottomFrozenBodyDomContainer:n>=l.colCount-l.rightFrozenColCount&&o>=l.rowCount-l.bottomFrozenRowCount?r=l.rightFrozenBottomDomContainer:o>=l.rowCount-l.bottomFrozenRowCount?r=l.bottomFrozenBodyDomContainer:n<l.frozenColCount?r=l.frozenBodyDomContainer:n>=l.colCount-l.rightFrozenColCount&&(r=l.rightFrozenBodyDomContainer):r===l.headerDomContainer&&(n<l.frozenColCount?r=l.frozenHeaderDomContainer:n>=l.colCount-l.rightFrozenColCount&&(r=l.rightFrozenHeaderDomContainer));return r}(e):s;let u=null===(t=this.htmlMap)||void 0===t?void 0:t[o];if(u&&a&&a!==u.container&&(this.removeElement(o),u=null),this.checkToPassAppContext(l,e),!u||!this.checkDom(u.wrapContainer)){this.checkAndClearCache(e);const{wrapContainer:t,nativeContainer:s,reuse:c}=this.getWrapContainer(r,a,{id:o,options:i});if(t){const i=`${this.renderId}`;t.id=o,t.setAttribute("data-vue-renderId",i),t.style.display="none",c||n.render(l,t),u={wrapContainer:t,nativeContainer:s,container:a,renderId:this.renderId,graphic:e,isInViewport:!0,lastPosition:null,lastStyle:{}},this.htmlMap[o]=u}}u&&(u.renderId=this.renderId,u.graphic=e,u.lastAccessed=Date.now(),this.updateAccessQueue(o),this.updateStyleOfWrapContainer(e,r,u.wrapContainer,u.nativeContainer))}getGraphicOptions(e){var t;const{vue:n}=(null==e?void 0:e.attribute)||{};if(!n)return null;return{id:`vue_${o.isNil(n.id)?null!==(t=e.id)&&void 0!==t?t:e._uid:n.id}`,options:n}}checkToPassAppContext(e,t){var n,o;try{const i=this.getCustomConfig(t),r=null!==(o=null===(n=null==i?void 0:i.getVueUserAppContext)||void 0===n?void 0:n.call(i))&&void 0!==o?o:this.currentContext;(null==r?void 0:r.components)&&(null==r?void 0:r.directives)&&(e.appContext=r)}catch(e){}}getCustomConfig(e){var t,n,o;const i=_(e);return null===(o=null===(n=null===(t=null==i?void 0:i.stage)||void 0===t?void 0:t.table)||void 0===n?void 0:n.options)||void 0===o?void 0:o.customConfig}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){return this.checkInViewportByZone(e,this.VIEWPORT_BUFFER)}checkInBuffer(e){return this.checkInViewportByZone(e,this.BUFFER_ZONE)}checkInViewportByZone(e,t=0){const{stage:n,globalAABBBounds:o}=e;if(!n)return!1;const{AABBBounds:i}=n,r=i.x1-t,l=i.x2+t,s=i.y1-t,a=i.y2+t;return o.x1<l&&o.x2>r&&o.y1<a&&o.y2>s}updateAccessQueue(e){const t=this.accessQueue.indexOf(e);t>-1&&this.accessQueue.splice(t,1),this.accessQueue.unshift(e)}checkAndClearCache(e){var t;const{viewportNodes:n,bufferNodes:o,cacheNodes:i}=this.classifyNodes(),r=n.length+o.length+i.length,l=this.getCustomConfig(e),s=null!==(t=null==l?void 0:l.maxDomCacheCount)&&void 0!==t?t:this.MAX_CACHE_COUNT;if(r<=s)return;const a=r-s;let u=i.slice(0,a);if(u.length<a){const e=o.sort(((e,t)=>this.htmlMap[e].lastAccessed-this.htmlMap[t].lastAccessed)).slice(0,a-u.length);u=u.concat(e)}u.forEach((e=>this.removeElement(e,!0)))}classifyNodes(){const e=[],t=[],n=[];return Object.keys(this.htmlMap).forEach((o=>{const i=this.htmlMap[o];i.isInViewport?e.push(o):this.checkInBuffer(i.graphic)?t.push(o):n.push(o)})),{viewportNodes:e,bufferNodes:t,cacheNodes:n}}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){var o;const i=null===(o=this.htmlMap)||void 0===o?void 0:o[e];if(!i)return;const{wrapContainer:r}=i;if(r){if(t)n.render(null,r),this.checkDom(r)&&super.removeElement(e),delete this.htmlMap[e];else{r.remove(),i.isInViewport=!1;const t=this.accessQueue.indexOf(e);t>-1&&this.accessQueue.splice(t,1)}this.removeWrapContainerEventListener(r)}}getWrapContainer(e,t,n){var o;let r;r=t?"string"==typeof t?i.application.global.getElementById(t):t:e.window.getContainer();const{id:l}=n||{},s=null===(o=this.htmlMap)||void 0===o?void 0:o[l];if(s&&!s.isInViewport){const{wrapContainer:e}=s;return this.checkDom(e)||r.appendChild(e),{reuse:!0,wrapContainer:e,nativeContainer:r}}return{wrapContainer:i.application.global.createDom({tagName:"div",parent:r}),nativeContainer:r}}updateStyleOfWrapContainer(e,t,n,i){const{attribute:r,type:l}=e,s=r||{},{vue:a,width:u,height:c,visible:d,display:p}=s,h=O(s,["vue","width","height","visible","display"]),{x:C,y:v}=this.calculatePosition(e,a.anchorType),{left:y,top:f}=this.calculateOffset(t,i,C,v),{id:m}=this.getGraphicOptions(e)||{},g=m?this.htmlMap[m]:null;if(!g)return;if(!(!g.lastPosition||g.lastPosition.x!==y||g.lastPosition.y!==f))return;const{pointerEvents:E}=a,b=this.parseDefaultStyleFromGraphic(e),w=this.convertCellStyle(e);Object.assign(b,Object.assign(Object.assign(Object.assign({width:`${u}px`,height:`${c}px`,overflow:"hidden"},w||{}),h||{}),{transform:`translate(${y}px, ${f}px)`,boxSizing:"border-box",display:!1!==d?p||"block":"none",pointerEvents:!0===E?"all":E||"none",position:"absolute"})),"none"!==b.pointerEvents&&this.checkToAddEventListener(n),"text"===l&&"position"===a.anchorType&&Object.assign(b,this.getTransformOfText(e)),this.applyUserStyles(a,b,{offsetX:y,offsetTop:f,graphic:e,wrapContainer:n});!o.isEqual(g.lastStyle,b)&&(this.styleUpdateQueue.set(n.id,b),this.requestStyleUpdate(),g.lastStyle=b)}checkToAddEventListener(e){if(!this.eventHandlers.has(e)){const t=e=>{e.preventDefault(),this.onWheel(e)};e.addEventListener("wheel",t,{passive:!1}),this.eventHandlers.set(e,t)}}requestStyleUpdate(){this.styleUpdateRequested||(this.styleUpdateRequested=!0,i.vglobal.getRequestAnimationFrame()((()=>{this.styleUpdateQueue.forEach(((e,t)=>{var n,o;const i=null===(o=null===(n=this.htmlMap)||void 0===n?void 0:n[t])||void 0===o?void 0:o.wrapContainer;i&&Object.assign(i.style,e)})),this.styleUpdateQueue.clear(),this.styleUpdateRequested=!1})))}convertCellStyle(e){var t;const{col:n,row:i,stage:r}=_(e),l=null===(t=null==r?void 0:r.table)||void 0===t?void 0:t.getCellStyle(n,i);if(!o.isObject(l))return;const s=l,{lineHeight:a,padding:u}=s,c=O(s,["lineHeight","padding"]);return Object.assign(Object.assign({},c),{padding:o.isArray(u)?u.map((e=>`${e}px`)).join(" "):u})}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 r=i.application.global.getElementTopLeft(t,!1),l=e.window.getTopLeft(!1);return{left:n+l.left-r.left,top:o+l.top-r.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 _(e){for(;null==e?void 0:e.parent;){if(e.name===t.CUSTOM_CONTAINER_NAME||(e.name||"").startsWith(t.CUSTOM_MERGE_PRE_NAME))return e;e=e.parent}return{col:-1,row:-1,stage:null}}var M=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:Function,required:!1},onDblClickCell:{type:Function,required:!1},onMouseDownCell:{type:Function,required:!1},onMouseUpCell:{type:Function,required:!1},onSelectedCell:{type:Function,required:!1},onKeyDown:{type:Function,required:!1},onMouseEnterTable:{type:Function,required:!1},onMouseLeaveTable:{type:Function,required:!1},onMouseDownTable:{type:Function,required:!1},onMouseMoveCell:{type:Function,required:!1},onMouseEnterCell:{type:Function,required:!1},onMouseLeaveCell:{type:Function,required:!1},onContextMenuCell:{type:Function,required:!1},onContextMenuCanvas:{type:Function,required:!1},onResizeColumn:{type:Function,required:!1},onResizeColumnEnd:{type:Function,required:!1},onChangeHeaderPosition:{type:Function,required:!1},onChangeHeaderPositionStart:{type:Function,required:!1},onChangeHeaderPositionFail:{type:Function,required:!1},onSortClick:{type:Function,required:!1},onFreezeClick:{type:Function,required:!1},onScroll:{type:Function,required:!1},onDropdownMenuClick:{type:Function,required:!1},onMouseOverChartSymbol:{type:Function,required:!1},onDragSelectEnd:{type:Function,required:!1},onDropdownIconClick:{type:Function,required:!1},onDropdownMenuClear:{type:Function,required:!1},onTreeHierarchyStateChange:{type:Function,required:!1},onShowMenu:{type:Function,required:!1},onHideMenu:{type:Function,required:!1},onIconClick:{type:Function,required:!1},onLegendItemClick:{type:Function,required:!1},onLegendItemHover:{type:Function,required:!1},onLegendItemUnHover:{type:Function,required:!1},onLegendChange:{type:Function,required:!1},onMouseEnterAxis:{type:Function,required:!1},onMouseLeaveAxis:{type:Function,required:!1},onCheckboxStateChange:{type:Function,required:!1},onRadioStateChange:{type:Function,required:!1},onAfterRender:{type:Function,required:!1},onInitialized:{type:Function,required:!1},onPivotSortClick:{type:Function,required:!1},onDrillMenuClick:{type:Function,required:!1},onVChartEventType:{type:Function,required:!1},onChangeCellValue:{type:Function,required:!1},onMousedownFillHandle:{type:Function,required:!1},onDragFillHandleEnd:{type:Function,required:!1},onDblclickFillHandle:{type:Function,required:!1},onScrollVerticalEnd:{type:Function,required:!1},onScrollHorizontalEnd:{type:Function,required:!1},onChangCellValue:{type:Function,required:!1},onEmptyTipClick:{type:Function,required:!1},onEmptyTipDblClick:{type:Function,required:!1},onButtonClick:{type:Function,required:!1},onBeforeCacheChartImage:{type:Function,required:!1},onPastedData:{type:Function,required:!1}},emits:b,setup(e,{expose:i,emit:r}){const l=e,s=n.ref(null),a=n.shallowRef(null),u=n.ref(new Map),c=n.ref([]),d=n.ref([]);w(l,a),function(e,t){var i,r;const l=n.getCurrentInstance(),s=null===(r=null===(i=null==e?void 0:e.options)||void 0===i?void 0:i.customConfig)||void 0===r?void 0:r.createReactContainer;n.watchEffect((()=>{var e,n,i;if(!s)return;const r=null===(i=null===(n=null===(e=t.value)||void 0===e?void 0:e.scenegraph)||void 0===n?void 0:n.stage)||void 0===i?void 0:i.pluginService;if(!r)return;const a=r.findPluginsByName("VTableVueAttributePlugin");if(o.isArray(a)&&a.length)return;const u=new L(null==l?void 0:l.appContext);r.register(u)}))}(l,a),i({vTableInstance:a});const p=n.computed((()=>"number"==typeof l.width?`${l.width}px`:l.width)),h=n.computed((()=>"number"==typeof l.height?`${l.height}px`:l.height)),C=r,v=(e,t)=>{const n=new e(s.value,t);a.value=n,u.value.clear(),c.value=[],d.value=[],n.on("resize_column_end",(e=>{if(!l.keepColumnWidthChange)return;const{col:t,colWidths:o}=e,i=o[t];if(n.isPivotTable()){const e=n.getCellHeaderPaths(t,n.columnHeaderLevelCount);let o=null;o="rowHeader"===e.cellLocation?e.rowHeaderPaths:e.colHeaderPaths;let r=!1;for(let e=0;e<c.value.length;e++){const t=c.value[e];JSON.stringify(t.dimensions)===JSON.stringify(o)&&(t.width=i,r=!0)}r||c.value.push({dimensions:o,width:i})}else{const e=n.getBodyColumnDefine(t,0);(null==e?void 0:e.key)&&u.value.set(e.key,i)}}))},y=()=>{var e,n;if(!s.value)return;a.value&&a.value.release();const o=()=>void 0!==l.records&&null!==l.records&&l.records.length>0?l.records:l.options.records;try{switch(l.type){case"list":v(t.ListTable,Object.assign(Object.assign({},l.options),{records:o()}));break;case"pivot":v(t.PivotTable,Object.assign(Object.assign({},l.options),{records:o()}));break;case"chart":v(t.PivotChart,Object.assign(Object.assign({},l.options),{records:o()}))}i=a.value,b.forEach((e=>{i.on(E[e],(t=>{C(e,t)}))})),null===(e=l.onReady)||void 0===e||e.call(l,a.value,!0)}catch(e){null===(n=l.onError)||void 0===n||n.call(l,e)}var i},f=e=>{var n;if(a.value)try{if(l.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}(u.value,c.value,a.value);e=Object.assign(Object.assign({},e),{columnWidthConfig:t,columnWidthConfigForRowHeader:t})}switch(l.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){null===(n=l.onError)||void 0===n||n.call(l,e)}};return n.onMounted(y),n.onBeforeUnmount((()=>{var e;null===(e=a.value)||void 0===e||e.release()})),n.watch((()=>l.options),((e,t)=>{a.value?f(e):y()})),n.watch((()=>l.records),((e,t)=>{a.value?f(Object.assign(Object.assign({},l.options),{records:e})):y()}),{deep:!0}),(e,t)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"vTableContainer",ref:s,style:n.normalizeStyle([{width:p.value,height:h.value},{position:"relative"}])},null,4))}}),A=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,i=n.ref(null),r=n.useSlots(),l=n.computed((()=>{var e;const t=function(e){const t={columns:[],tooltip:{},menu:{}},n={ListColumn:"columns",Tooltip:"tooltip",Menu:"menu"};return e.forEach((e=>{var o,i;e.props=a(e.props);const r=(null===(o=e.type)||void 0===o?void 0:o.symbol)||(null===(i=e.type)||void 0===i?void 0:i.name),l=n[r];l&&("columns"===l&&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[l])?t[l].push(e.props):t[l]=e.props)})),t}(u((null===(e=r.default)||void 0===e?void 0:e.call(r))||[]));return m(o.options,t)}));return t({vTableInstance:n.computed((()=>{var e;return(null===(e=i.value)||void 0===e?void 0:e.vTableInstance)||null}))}),(t,o)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createVNode(M,n.mergeProps({type:"list",options:l.value,records:e.records,width:e.width,height:e.height,ref_key:"baseTableRef",ref:i},t.$attrs),null,16,["options","records","width","height"]),n.renderSlot(t.$slots,"default")],64))}}),F=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,i=n.shallowRef(null),r=n.useSlots(),l=n.computed((()=>{var e;const t=f(u((null===(e=r.default)||void 0===e?void 0:e.call(r))||[]));return m(o.options,t)}));return t({vTableInstance:n.computed((()=>{var e;return(null===(e=i.value)||void 0===e?void 0:e.vTableInstance)||null}))}),(t,o)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createVNode(M,n.mergeProps({type:"pivot",options:l.value,records:e.records,width:e.width,height:e.height,ref_key:"baseTableRef",ref:i},t.$attrs),null,16,["options","records","width","height"]),n.renderSlot(t.$slots,"default")],64))}}),N=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,i=n.shallowRef(null),r=n.useSlots(),l=n.computed((()=>{var e;const t=f(u((null===(e=r.default)||void 0===e?void 0:e.call(r))||[]));return m(o.options,t)}));return t({vTableInstance:n.computed((()=>{var e;return(null===(e=i.value)||void 0===e?void 0:e.vTableInstance)||null}))}),(t,o)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createVNode(M,n.mergeProps({type:"chart",options:l.value,records:e.records,width:e.width,height:e.height,ref_key:"baseTableRef",ref:i},t.$attrs),null,16,["options","records","width","height"]),n.renderSlot(t.$slots,"default")],64))}});function S(e){return null}function R(e){return null}function D(e){return null}function I(e){return null}function k(e){return null}function P(e){return null}function q(e){return null}function H(e){return null}function V(e){return null}function x(){return null}function B(){return null}function j(){return null}function U(e){return null}function z(e){return null}function G(e){return null}S.symbol="ListColumn",R.symbol="PivotColumnDimension",D.symbol="PivotRowDimension",I.symbol="PivotColumnHeaderTitle",k.symbol="PivotRowHeaderTitle",P.symbol="PivotIndicator",q.symbol="PivotCorner",H.symbol="Menu",V.symbol="Tooltip",x.symbol="Group",B.symbol="Image",j.symbol="Text",U.symbol="Tag",z.symbol="Radio",G.symbol="CheckBox";e.VTable=l,Object.defineProperty(e,"register",{enumerable:!0,get:function(){return t.register}}),e.CheckBox=G,e.DYNAMIC_RENDER_EDITOR=h,e.Group=x,e.Image=B,e.ListColumn=S,e.ListTable=A,e.Menu=H,e.PivotChart=N,e.PivotColumnDimension=R,e.PivotColumnHeaderTitle=I,e.PivotCorner=q,e.PivotIndicator=P,e.PivotRowDimension=D,e.PivotRowHeaderTitle=k,e.PivotTable=F,e.Radio=z,e.Tag=U,e.Text=j,e.Tooltip=V,e.registerChartModule=(e,t)=>{l.register.chartModule(e,t)},e.version="1.26.1-alpha.0"}));
|
|
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,i){"use strict";function r(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=r(t);function s(e){return e.replace(/-([a-z])/g,(e=>e[1].toUpperCase()))}function a(e){const t={};for(const n in e)if(e.hasOwnProperty(n)){t[s(n)]=e[n]}return t}function u(e){return e.flatMap((e=>Array.isArray(e.children)?u(e.children):e))}function c(e,t,i){let r=0;const u={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){var c,d;if(!l)return null;const{type:p,children:h}=l,C=a(l.props),v=(null==p?void 0:p.symbol)||(null==p?void 0:p.name),y=u[v];if(!y)return null;const f=new y(Object.assign({},C));!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():s(n.slice(2)).toLowerCase(),e.addEventListener(o,t[n])}}))}(f,C);const m=function(e){var t;return(null===(t=null==e?void 0:e.default)||void 0===t?void 0:t.call(e))||e||[]}(h);if(o.isObject(null==C?void 0:C.vue)){const{element:e}=C.vue;let s=null!=e?e:m.find((e=>(null==e?void 0:e.type)!==Symbol.for("v-cmt")));s=n.isVNode(s)?s.key?s:n.cloneVNode(s,{key:`row_${i.row}_col_${i.col}`}):null;const a=o.isNil(C.vue.id)?`cell_${i.col}_${i.row}_${r++}`:void 0;return Object.assign(l.props.vue,Object.assign({element:s,container:t?null===(c=null==i?void 0:i.table)||void 0===c?void 0:c.headerDomContainer:null===(d=null==i?void 0:i.table)||void 0===d?void 0:d.bodyDomContainer},a?{id:a}:{})),f}return m.forEach((t=>{const n=e(t);n?f.add(n):t.type===Symbol.for("v-fgt")&&t.children.forEach((t=>{const n=e(t);n&&f.add(n)}))})),f}(e)}}function d(e,t){return n=>{const{table:o,row:i,col:r,rect:l}=n,s=o.getCellOriginRecord(r,i),{height:a,width:u}=null!=l?l:o.getCellRect(r,i),d=t?"headerCustomLayout":"customLayout";if(!e[d])return null;const p=e[d]({table:o,row:i,col:r,rect:l,record:s,height:a,width:u})[0],{rootComponent:h}=c(p,t,n);return{rootContainer:h,renderDefault:!1}}}class p{constructor(e){this.currentContext=e,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){var n;return null===(n=this.nodeMap.get(e))||void 0===n?void 0:n.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:i,col:r,value:l,table:s,container:a,referencePosition:u}=e;if(!a)return!1;const c=s.getBodyColumnDefine(r,i),{editConfig:d}=c||{},{id:p}=s,h=this.getColumnKeyField(c);if(!o.isValid(h)||!o.isValid(p))return!1;if("function"==typeof(null==d?void 0:d.editBefore)){if(!await d.editBefore(e))return s.showTooltip(r,i,{content:d.disablePrompt||"This field is not allowed to be edited",referencePosition:{rect:null==u?void 0:u.rect,placement:t.TYPES.Placement.top},style:{bgColor:"black",color:"white",arrowMark:!0},disappearDelay:1e3}),!1}const C=null==s?void 0:s.getCellOriginRecord(r,i),v=this.getNode(p,h);if(!v)return!1;const y=n.h(v,{row:i,col:r,value:l,refValue:n.customRef(((e,t)=>({get:()=>(e(),this.getValue()),set:e=>{this.setValue(e),t()}}))),record:C,table:s,onChange:e=>this.setValue(e)});if(!y||!n.isVNode(y))return!1;this.checkToPassAppContext(y,s);const f=document.createElement("div");f.style.position="absolute",f.style.width="100%",f.style.boxSizing="border-box";const{bgColor:m}=s.getCellStyle(r,i)||{};return f.style.backgroundColor=m||"#FFFFFF",this.wrapContainer=f,this.tableContainer=a,this.tableContainer.appendChild(f),n.render(y,f),(null==u?void 0:u.rect)&&this.adjustPosition(u.rect),!0}checkToPassAppContext(e,t){var n,o,i,r;try{const l=null!==(r=null===(i=null===(o=null===(n=t.options)||void 0===n?void 0:n.customConfig)||void 0===o?void 0:o.getVueUserAppContext)||void 0===i?void 0:i.call(o))&&void 0!==r?r:this.currentContext;(null==l?void 0:l.components)&&(null==l?void 0:l.directives)&&(e.appContext=l)}catch(e){}}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,i,r){const{col:l,row:s}=i||{};if(!o.isValid(l)||!o.isValid(s))return!0;const a=r.getBodyColumnDefine(l,s),{editConfig:u}=a||{};if("function"==typeof(null==u?void 0:u.validateValue)){const o=await u.validateValue({col:l,row:s,value:e,oldValue:n,table:r});if(!1===o){const e=r.getVisibleCellRangeRelativeRect({col:l,row:s});return r.showTooltip(l,s,{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){var t;return(null===(t=this.wrapContainer)||void 0===t?void 0:t.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||{},i=v(e);if(!o.isValid(i)||n!==h)return!1;if("function"==typeof t){if(e.getEditCustomNode=t,Array.isArray(e.columns)&&e.columns.length)for(const n of e.columns)C(n,t);return!0}return"function"==typeof e.getEditCustomNode}function v(e){const{field:t,key:n}=e||{};return o.isValid(n)?n:t}function y(e,n){const o=t.register.editor(h);let i=o||void 0;return!i&&e&&(i=new p(n),t.register.editor(h,i)),i}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=>{var o,i;e.props=a(e.props);const r=(null===(o=e.type)||void 0===o?void 0:o.symbol)||(null===(i=e.type)||void 0===i?void 0:i.name),l=n[r];l&&(Array.isArray(t[l])?e.props.hasOwnProperty("objectHandler")?t[l].push(e.props.objectHandler):t[l].push(e.props):t[l]=e.props)})),t}function m(e,t){return Object.assign(Object.assign({},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 g=Object.assign(Object.assign(Object.assign({},t.ListTable.EVENT_TYPE),t.PivotTable.EVENT_TYPE),t.PivotChart.EVENT_TYPE),E={onClickCell:g.CLICK_CELL,onDblClickCell:g.DBLCLICK_CELL,onMouseDownCell:g.MOUSEDOWN_CELL,onMouseUpCell:g.MOUSEUP_CELL,onSelectedCell:g.SELECTED_CELL,onKeyDown:g.KEYDOWN,onMouseEnterTable:g.MOUSEENTER_TABLE,onMouseLeaveTable:g.MOUSELEAVE_TABLE,onMouseDownTable:g.MOUSEDOWN_TABLE,onMouseMoveCell:g.MOUSEMOVE_CELL,onMouseEnterCell:g.MOUSEENTER_CELL,onMouseLeaveCell:g.MOUSELEAVE_CELL,onContextMenuCell:g.CONTEXTMENU_CELL,onContextMenuCanvas:g.CONTEXTMENU_CANVAS,onResizeColumn:g.RESIZE_COLUMN,onResizeColumnEnd:g.RESIZE_COLUMN_END,onChangeHeaderPosition:g.CHANGE_HEADER_POSITION,onChangeHeaderPositionStart:g.CHANGE_HEADER_POSITION_START,onChangeHeaderPositionFail:g.CHANGE_HEADER_POSITION_FAIL,onSortClick:g.SORT_CLICK,onFreezeClick:g.FREEZE_CLICK,onScroll:g.SCROLL,onDropdownMenuClick:g.DROPDOWN_MENU_CLICK,onMouseOverChartSymbol:g.MOUSEOVER_CHART_SYMBOL,onDragSelectEnd:g.DRAG_SELECT_END,onDropdownIconClick:g.DROPDOWN_ICON_CLICK,onDropdownMenuClear:g.DROPDOWN_MENU_CLEAR,onTreeHierarchyStateChange:g.TREE_HIERARCHY_STATE_CHANGE,onShowMenu:g.SHOW_MENU,onHideMenu:g.HIDE_MENU,onIconClick:g.ICON_CLICK,onLegendItemClick:g.LEGEND_ITEM_CLICK,onLegendItemHover:g.LEGEND_ITEM_HOVER,onLegendItemUnHover:g.LEGEND_ITEM_UNHOVER,onLegendChange:g.LEGEND_CHANGE,onMouseEnterAxis:g.MOUSEENTER_AXIS,onMouseLeaveAxis:g.MOUSELEAVE_AXIS,onCheckboxStateChange:g.CHECKBOX_STATE_CHANGE,onRadioStateChange:g.RADIO_STATE_CHANGE,onAfterRender:g.AFTER_RENDER,onInitialized:g.INITIALIZED,onPivotSortClick:g.PIVOT_SORT_CLICK,onDrillMenuClick:g.DRILLMENU_CLICK,onVChartEventType:g.VCHART_EVENT_TYPE,onChangeCellValue:g.CHANGE_CELL_VALUE,onMousedownFillHandle:g.MOUSEDOWN_FILL_HANDLE,onDragFillHandleEnd:g.DRAG_FILL_HANDLE_END,onDblclickFillHandle:g.DBLCLICK_FILL_HANDLE,onScrollVerticalEnd:g.SCROLL_VERTICAL_END,onScrollHorizontalEnd:g.SCROLL_HORIZONTAL_END,onChangCellValue:g.CHANGE_CELL_VALUE,onEmptyTipClick:g.EMPTY_TIP_CLICK,onEmptyTipDblClick:g.EMPTY_TIP_DBLCLICK,onButtonClick:g.BUTTON_CLICK,onBeforeCacheChartImage:g.BEFORE_CACHE_CHART_IMAGE,onPastedData:g.PASTED_DATA,onSelectedClear:g.SELECTED_CLEAR},b=Object.keys(E);function w(e,t){const i=n.getCurrentInstance(),r=n.computed((()=>{var t;const n=T((null===(t=e.options)||void 0===t?void 0:t.columns)||[]);return o.isArray(n)?n.filter((e=>!!o.isObject(e)&&!!C(e))):[]}));function l(){var e;return null===(e=t.value)||void 0===e?void 0:e.id}n.watchEffect((()=>{!function(){const e=l();if(!o.isValid(e))return;let t=y();t?t.removeNode(e):r.value.length>0&&(t=y(!0,null==i?void 0:i.appContext));r.value.forEach((n=>{const{getEditCustomNode:o}=n,i=v(n);t.registerNode(e,i,o),delete n.editCustomNode}))}()})),n.onBeforeUnmount((()=>{!function(){const e=l();if(!o.isValid(e))return;const t=y();null==t||t.release(e)}()}))}function T(e){return e.flatMap((e=>Array.isArray(e.columns)?T(e.columns):e))}var O=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(n[o[i]]=e[o[i]])}return n};class L extends i.HtmlAttributePlugin{constructor(e){super(),this.name="VTableVueAttributePlugin",this.renderQueue=new Set,this.isRendering=!1,this.MAX_CACHE_COUNT=100,this.accessQueue=[],this.VIEWPORT_BUFFER=100,this.BUFFER_ZONE=500,this.styleUpdateQueue=new Map,this.styleUpdateRequested=!1,this.eventHandlers=new WeakMap,this.currentContext=e}renderGraphicHTML(e){var t;if(!this.checkNeedRender(e))return;const n=this.getGraphicOptions(e);if(n){const o=null===(t=this.htmlMap)||void 0===t?void 0:t[n.id];if(o&&this.checkDom(o.wrapContainer))return void this.doRenderGraphic(e)}this.renderQueue.add(e),this.scheduleRender()}scheduleRender(){this.isRendering||(this.isRendering=!0,i.vglobal.getRequestAnimationFrame()((()=>{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){var t;const{id:o,options:i}=this.getGraphicOptions(e);if(!o)return;const r=e.stage,{element:l,container:s}=i,a=s?function(e){var t;const{col:n,row:o,stage:i}=_(e);let r=null===(t=e.attribute.vue)||void 0===t?void 0:t.container;const{table:l}=i;r===l.bodyDomContainer?n<l.frozenColCount&&o>=l.rowCount-l.bottomFrozenRowCount?r=l.bottomFrozenBodyDomContainer:n>=l.colCount-l.rightFrozenColCount&&o>=l.rowCount-l.bottomFrozenRowCount?r=l.rightFrozenBottomDomContainer:o>=l.rowCount-l.bottomFrozenRowCount?r=l.bottomFrozenBodyDomContainer:n<l.frozenColCount?r=l.frozenBodyDomContainer:n>=l.colCount-l.rightFrozenColCount&&(r=l.rightFrozenBodyDomContainer):r===l.headerDomContainer&&(n<l.frozenColCount?r=l.frozenHeaderDomContainer:n>=l.colCount-l.rightFrozenColCount&&(r=l.rightFrozenHeaderDomContainer));return r}(e):s;let u=null===(t=this.htmlMap)||void 0===t?void 0:t[o];if(u&&a&&a!==u.container&&(this.removeElement(o),u=null),this.checkToPassAppContext(l,e),!u||!this.checkDom(u.wrapContainer)){this.checkAndClearCache(e);const{wrapContainer:t,nativeContainer:s,reuse:c}=this.getWrapContainer(r,a,{id:o,options:i});if(t){const i=`${this.renderId}`;t.id=o,t.setAttribute("data-vue-renderId",i),t.style.display="none",c||n.render(l,t),u={wrapContainer:t,nativeContainer:s,container:a,renderId:this.renderId,graphic:e,isInViewport:!0,lastPosition:null,lastStyle:{}},this.htmlMap[o]=u}}u&&(u.renderId=this.renderId,u.graphic=e,u.lastAccessed=Date.now(),this.updateAccessQueue(o),this.updateStyleOfWrapContainer(e,r,u.wrapContainer,u.nativeContainer))}getGraphicOptions(e){var t;const{vue:n}=(null==e?void 0:e.attribute)||{};if(!n)return null;return{id:`vue_${o.isNil(n.id)?null!==(t=e.id)&&void 0!==t?t:e._uid:n.id}`,options:n}}checkToPassAppContext(e,t){var n,o;try{const i=this.getCustomConfig(t),r=null!==(o=null===(n=null==i?void 0:i.getVueUserAppContext)||void 0===n?void 0:n.call(i))&&void 0!==o?o:this.currentContext;(null==r?void 0:r.components)&&(null==r?void 0:r.directives)&&(e.appContext=r)}catch(e){}}getCustomConfig(e){var t,n,o;const i=_(e);return null===(o=null===(n=null===(t=null==i?void 0:i.stage)||void 0===t?void 0:t.table)||void 0===n?void 0:n.options)||void 0===o?void 0:o.customConfig}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){return this.checkInViewportByZone(e,this.VIEWPORT_BUFFER)}checkInBuffer(e){return this.checkInViewportByZone(e,this.BUFFER_ZONE)}checkInViewportByZone(e,t=0){const{stage:n,globalAABBBounds:o}=e;if(!n)return!1;const{AABBBounds:i}=n,r=i.x1-t,l=i.x2+t,s=i.y1-t,a=i.y2+t;return o.x1<l&&o.x2>r&&o.y1<a&&o.y2>s}updateAccessQueue(e){const t=this.accessQueue.indexOf(e);t>-1&&this.accessQueue.splice(t,1),this.accessQueue.unshift(e)}checkAndClearCache(e){var t;const{viewportNodes:n,bufferNodes:o,cacheNodes:i}=this.classifyNodes(),r=n.length+o.length+i.length,l=this.getCustomConfig(e),s=null!==(t=null==l?void 0:l.maxDomCacheCount)&&void 0!==t?t:this.MAX_CACHE_COUNT;if(r<=s)return;const a=r-s;let u=i.slice(0,a);if(u.length<a){const e=o.sort(((e,t)=>this.htmlMap[e].lastAccessed-this.htmlMap[t].lastAccessed)).slice(0,a-u.length);u=u.concat(e)}u.forEach((e=>this.removeElement(e,!0)))}classifyNodes(){const e=[],t=[],n=[];return Object.keys(this.htmlMap).forEach((o=>{const i=this.htmlMap[o];i.isInViewport?e.push(o):this.checkInBuffer(i.graphic)?t.push(o):n.push(o)})),{viewportNodes:e,bufferNodes:t,cacheNodes:n}}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){var o;const i=null===(o=this.htmlMap)||void 0===o?void 0:o[e];if(!i)return;const{wrapContainer:r}=i;if(r){if(t)n.render(null,r),this.checkDom(r)&&super.removeElement(e),delete this.htmlMap[e];else{r.remove(),i.isInViewport=!1;const t=this.accessQueue.indexOf(e);t>-1&&this.accessQueue.splice(t,1)}this.removeWrapContainerEventListener(r)}}getWrapContainer(e,t,n){var o;let r;r=t?"string"==typeof t?i.application.global.getElementById(t):t:e.window.getContainer();const{id:l}=n||{},s=null===(o=this.htmlMap)||void 0===o?void 0:o[l];if(s&&!s.isInViewport){const{wrapContainer:e}=s;return this.checkDom(e)||r.appendChild(e),{reuse:!0,wrapContainer:e,nativeContainer:r}}return{wrapContainer:i.application.global.createDom({tagName:"div",parent:r}),nativeContainer:r}}updateStyleOfWrapContainer(e,t,n,i){const{attribute:r,type:l}=e,s=r||{},{vue:a,width:u,height:c,visible:d,display:p}=s,h=O(s,["vue","width","height","visible","display"]),{x:C,y:v}=this.calculatePosition(e,a.anchorType),{left:y,top:f}=this.calculateOffset(t,i,C,v),{id:m}=this.getGraphicOptions(e)||{},g=m?this.htmlMap[m]:null;if(!g)return;if(!(!g.lastPosition||g.lastPosition.x!==y||g.lastPosition.y!==f))return;const{pointerEvents:E}=a,b=this.parseDefaultStyleFromGraphic(e),w=this.convertCellStyle(e);Object.assign(b,Object.assign(Object.assign(Object.assign({width:`${u}px`,height:`${c}px`,overflow:"hidden"},w||{}),h||{}),{transform:`translate(${y}px, ${f}px)`,boxSizing:"border-box",display:!1!==d?p||"block":"none",pointerEvents:!0===E?"all":E||"none",position:"absolute"})),"none"!==b.pointerEvents&&this.checkToAddEventListener(n),"text"===l&&"position"===a.anchorType&&Object.assign(b,this.getTransformOfText(e)),this.applyUserStyles(a,b,{offsetX:y,offsetTop:f,graphic:e,wrapContainer:n});!o.isEqual(g.lastStyle,b)&&(this.styleUpdateQueue.set(n.id,b),this.requestStyleUpdate(),g.lastStyle=b)}checkToAddEventListener(e){if(!this.eventHandlers.has(e)){const t=e=>{e.preventDefault(),this.onWheel(e)};e.addEventListener("wheel",t,{passive:!1}),this.eventHandlers.set(e,t)}}requestStyleUpdate(){this.styleUpdateRequested||(this.styleUpdateRequested=!0,i.vglobal.getRequestAnimationFrame()((()=>{this.styleUpdateQueue.forEach(((e,t)=>{var n,o;const i=null===(o=null===(n=this.htmlMap)||void 0===n?void 0:n[t])||void 0===o?void 0:o.wrapContainer;i&&Object.assign(i.style,e)})),this.styleUpdateQueue.clear(),this.styleUpdateRequested=!1})))}convertCellStyle(e){var t;const{col:n,row:i,stage:r}=_(e),l=null===(t=null==r?void 0:r.table)||void 0===t?void 0:t.getCellStyle(n,i);if(!o.isObject(l))return;const s=l,{lineHeight:a,padding:u}=s,c=O(s,["lineHeight","padding"]);return Object.assign(Object.assign({},c),{padding:o.isArray(u)?u.map((e=>`${e}px`)).join(" "):u})}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 r=i.application.global.getElementTopLeft(t,!1),l=e.window.getTopLeft(!1);return{left:n+l.left-r.left,top:o+l.top-r.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 _(e){for(;null==e?void 0:e.parent;){if(e.name===t.CUSTOM_CONTAINER_NAME||(e.name||"").startsWith(t.CUSTOM_MERGE_PRE_NAME))return e;e=e.parent}return{col:-1,row:-1,stage:null}}var M=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:Function,required:!1},onDblClickCell:{type:Function,required:!1},onMouseDownCell:{type:Function,required:!1},onMouseUpCell:{type:Function,required:!1},onSelectedCell:{type:Function,required:!1},onKeyDown:{type:Function,required:!1},onMouseEnterTable:{type:Function,required:!1},onMouseLeaveTable:{type:Function,required:!1},onMouseDownTable:{type:Function,required:!1},onMouseMoveCell:{type:Function,required:!1},onMouseEnterCell:{type:Function,required:!1},onMouseLeaveCell:{type:Function,required:!1},onContextMenuCell:{type:Function,required:!1},onContextMenuCanvas:{type:Function,required:!1},onResizeColumn:{type:Function,required:!1},onResizeColumnEnd:{type:Function,required:!1},onChangeHeaderPosition:{type:Function,required:!1},onChangeHeaderPositionStart:{type:Function,required:!1},onChangeHeaderPositionFail:{type:Function,required:!1},onSortClick:{type:Function,required:!1},onFreezeClick:{type:Function,required:!1},onScroll:{type:Function,required:!1},onDropdownMenuClick:{type:Function,required:!1},onMouseOverChartSymbol:{type:Function,required:!1},onDragSelectEnd:{type:Function,required:!1},onDropdownIconClick:{type:Function,required:!1},onDropdownMenuClear:{type:Function,required:!1},onTreeHierarchyStateChange:{type:Function,required:!1},onShowMenu:{type:Function,required:!1},onHideMenu:{type:Function,required:!1},onIconClick:{type:Function,required:!1},onLegendItemClick:{type:Function,required:!1},onLegendItemHover:{type:Function,required:!1},onLegendItemUnHover:{type:Function,required:!1},onLegendChange:{type:Function,required:!1},onMouseEnterAxis:{type:Function,required:!1},onMouseLeaveAxis:{type:Function,required:!1},onCheckboxStateChange:{type:Function,required:!1},onRadioStateChange:{type:Function,required:!1},onAfterRender:{type:Function,required:!1},onInitialized:{type:Function,required:!1},onPivotSortClick:{type:Function,required:!1},onDrillMenuClick:{type:Function,required:!1},onVChartEventType:{type:Function,required:!1},onChangeCellValue:{type:Function,required:!1},onMousedownFillHandle:{type:Function,required:!1},onDragFillHandleEnd:{type:Function,required:!1},onDblclickFillHandle:{type:Function,required:!1},onScrollVerticalEnd:{type:Function,required:!1},onScrollHorizontalEnd:{type:Function,required:!1},onChangCellValue:{type:Function,required:!1},onEmptyTipClick:{type:Function,required:!1},onEmptyTipDblClick:{type:Function,required:!1},onButtonClick:{type:Function,required:!1},onBeforeCacheChartImage:{type:Function,required:!1},onPastedData:{type:Function,required:!1}},emits:b,setup(e,{expose:i,emit:r}){const l=e,s=n.ref(null),a=n.shallowRef(null),u=n.ref(new Map),c=n.ref([]),d=n.ref([]);w(l,a),function(e,t){var i,r;const l=n.getCurrentInstance(),s=null===(r=null===(i=null==e?void 0:e.options)||void 0===i?void 0:i.customConfig)||void 0===r?void 0:r.createReactContainer;n.watchEffect((()=>{var e,n,i;if(!s)return;const r=null===(i=null===(n=null===(e=t.value)||void 0===e?void 0:e.scenegraph)||void 0===n?void 0:n.stage)||void 0===i?void 0:i.pluginService;if(!r)return;const a=r.findPluginsByName("VTableVueAttributePlugin");if(o.isArray(a)&&a.length)return;const u=new L(null==l?void 0:l.appContext);r.register(u)}))}(l,a),i({vTableInstance:a});const p=n.computed((()=>"number"==typeof l.width?`${l.width}px`:l.width)),h=n.computed((()=>"number"==typeof l.height?`${l.height}px`:l.height)),C=r,v=(e,t)=>{const n=new e(s.value,t);a.value=n,u.value.clear(),c.value=[],d.value=[],n.on("resize_column_end",(e=>{if(!l.keepColumnWidthChange)return;const{col:t,colWidths:o}=e,i=o[t];if(n.isPivotTable()){const e=n.getCellHeaderPaths(t,n.columnHeaderLevelCount);let o=null;o="rowHeader"===e.cellLocation?e.rowHeaderPaths:e.colHeaderPaths;let r=!1;for(let e=0;e<c.value.length;e++){const t=c.value[e];JSON.stringify(t.dimensions)===JSON.stringify(o)&&(t.width=i,r=!0)}r||c.value.push({dimensions:o,width:i})}else{const e=n.getBodyColumnDefine(t,0);(null==e?void 0:e.key)&&u.value.set(e.key,i)}}))},y=()=>{var e,n;if(!s.value)return;a.value&&a.value.release();const o=()=>void 0!==l.records&&null!==l.records&&l.records.length>0?l.records:l.options.records;try{switch(l.type){case"list":v(t.ListTable,Object.assign(Object.assign({},l.options),{records:o()}));break;case"pivot":v(t.PivotTable,Object.assign(Object.assign({},l.options),{records:o()}));break;case"chart":v(t.PivotChart,Object.assign(Object.assign({},l.options),{records:o()}))}i=a.value,b.forEach((e=>{i.on(E[e],(t=>{C(e,t)}))})),null===(e=l.onReady)||void 0===e||e.call(l,a.value,!0)}catch(e){null===(n=l.onError)||void 0===n||n.call(l,e)}var i},f=e=>{var n;if(a.value)try{if(l.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}(u.value,c.value,a.value);e=Object.assign(Object.assign({},e),{columnWidthConfig:t,columnWidthConfigForRowHeader:t})}switch(l.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){null===(n=l.onError)||void 0===n||n.call(l,e)}};return n.onMounted(y),n.onBeforeUnmount((()=>{var e;null===(e=a.value)||void 0===e||e.release()})),n.watch((()=>l.options),((e,t)=>{a.value?f(e):y()})),n.watch((()=>l.records),((e,t)=>{a.value?f(Object.assign(Object.assign({},l.options),{records:e})):y()}),{deep:!0}),(e,t)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"vTableContainer",ref:s,style:n.normalizeStyle([{width:p.value,height:h.value},{position:"relative"}])},null,4))}}),A=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,i=n.ref(null),r=n.useSlots(),l=n.computed((()=>{var e;const t=function(e){const t={columns:[],tooltip:{},menu:{}},n={ListColumn:"columns",Tooltip:"tooltip",Menu:"menu"};return e.forEach((e=>{var o,i;e.props=a(e.props);const r=(null===(o=e.type)||void 0===o?void 0:o.symbol)||(null===(i=e.type)||void 0===i?void 0:i.name),l=n[r];l&&("columns"===l&&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[l])?t[l].push(e.props):t[l]=e.props)})),t}(u((null===(e=r.default)||void 0===e?void 0:e.call(r))||[]));return m(o.options,t)}));return t({vTableInstance:n.computed((()=>{var e;return(null===(e=i.value)||void 0===e?void 0:e.vTableInstance)||null}))}),(t,o)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createVNode(M,n.mergeProps({type:"list",options:l.value,records:e.records,width:e.width,height:e.height,ref_key:"baseTableRef",ref:i},t.$attrs),null,16,["options","records","width","height"]),n.renderSlot(t.$slots,"default")],64))}}),F=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,i=n.shallowRef(null),r=n.useSlots(),l=n.computed((()=>{var e;const t=f(u((null===(e=r.default)||void 0===e?void 0:e.call(r))||[]));return m(o.options,t)}));return t({vTableInstance:n.computed((()=>{var e;return(null===(e=i.value)||void 0===e?void 0:e.vTableInstance)||null}))}),(t,o)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createVNode(M,n.mergeProps({type:"pivot",options:l.value,records:e.records,width:e.width,height:e.height,ref_key:"baseTableRef",ref:i},t.$attrs),null,16,["options","records","width","height"]),n.renderSlot(t.$slots,"default")],64))}}),N=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,i=n.shallowRef(null),r=n.useSlots(),l=n.computed((()=>{var e;const t=f(u((null===(e=r.default)||void 0===e?void 0:e.call(r))||[]));return m(o.options,t)}));return t({vTableInstance:n.computed((()=>{var e;return(null===(e=i.value)||void 0===e?void 0:e.vTableInstance)||null}))}),(t,o)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createVNode(M,n.mergeProps({type:"chart",options:l.value,records:e.records,width:e.width,height:e.height,ref_key:"baseTableRef",ref:i},t.$attrs),null,16,["options","records","width","height"]),n.renderSlot(t.$slots,"default")],64))}});function S(e){return null}function R(e){return null}function D(e){return null}function I(e){return null}function k(e){return null}function P(e){return null}function q(e){return null}function H(e){return null}function V(e){return null}function x(){return null}function B(){return null}function j(){return null}function U(e){return null}function z(e){return null}function G(e){return null}S.symbol="ListColumn",R.symbol="PivotColumnDimension",D.symbol="PivotRowDimension",I.symbol="PivotColumnHeaderTitle",k.symbol="PivotRowHeaderTitle",P.symbol="PivotIndicator",q.symbol="PivotCorner",H.symbol="Menu",V.symbol="Tooltip",x.symbol="Group",B.symbol="Image",j.symbol="Text",U.symbol="Tag",z.symbol="Radio",G.symbol="CheckBox";e.VTable=l,Object.defineProperty(e,"register",{enumerable:!0,get:function(){return t.register}}),e.CheckBox=G,e.DYNAMIC_RENDER_EDITOR=h,e.Group=x,e.Image=B,e.ListColumn=S,e.ListTable=A,e.Menu=H,e.PivotChart=N,e.PivotColumnDimension=R,e.PivotColumnHeaderTitle=I,e.PivotCorner=q,e.PivotIndicator=P,e.PivotRowDimension=D,e.PivotRowHeaderTitle=k,e.PivotTable=F,e.Radio=z,e.Tag=U,e.Text=j,e.Tooltip=V,e.registerChartModule=(e,t)=>{l.register.chartModule(e,t)},e.version="1.26.1"}));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { VNode } from 'vue';
|
|
2
|
+
import type { TYPES } from '@visactor/vtable';
|
|
3
|
+
export type MenuProps = {
|
|
4
|
+
renderMode?: 'canvas' | 'html';
|
|
5
|
+
defaultHeaderMenuItems?: TYPES.MenuListItem[];
|
|
6
|
+
contextMenuItems?: TYPES.MenuListItem[] | ((field: string, row: number, col: number) => TYPES.MenuListItem[]);
|
|
7
|
+
dropDownMenuHighlight?: TYPES.DropDownMenuHighlightInfo[];
|
|
8
|
+
contextMenuWorkOnlyCell?: boolean;
|
|
9
|
+
};
|
|
10
|
+
declare function Menu(props: MenuProps): VNode;
|
|
11
|
+
declare namespace Menu {
|
|
12
|
+
var symbol: string;
|
|
13
|
+
}
|
|
14
|
+
export default Menu;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { VNode } from 'vue';
|
|
2
|
+
export type TooltipProps = {
|
|
3
|
+
renderMode?: 'html';
|
|
4
|
+
isShowOverflowTextTooltip?: boolean;
|
|
5
|
+
confine?: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare function Tooltip(props: TooltipProps): VNode;
|
|
8
|
+
declare namespace Tooltip {
|
|
9
|
+
var symbol: string;
|
|
10
|
+
}
|
|
11
|
+
export default Tooltip;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { VNode } from 'vue';
|
|
2
|
+
export interface CheckboxProps {
|
|
3
|
+
children?: string;
|
|
4
|
+
textStyle?: any;
|
|
5
|
+
boxStyle?: any;
|
|
6
|
+
iconStyle?: any;
|
|
7
|
+
checked?: boolean;
|
|
8
|
+
indeterminate?: boolean;
|
|
9
|
+
interactive?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
disableCursor?: any;
|
|
12
|
+
spaceBetweenTextAndIcon?: number;
|
|
13
|
+
visible?: boolean;
|
|
14
|
+
onChange?: (checked: boolean) => void;
|
|
15
|
+
}
|
|
16
|
+
declare function CheckBox(props: CheckboxProps): VNode;
|
|
17
|
+
declare namespace CheckBox {
|
|
18
|
+
var symbol: string;
|
|
19
|
+
}
|
|
20
|
+
export default CheckBox;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { VNode } from 'vue';
|
|
2
|
+
export interface CustomComponentProps {
|
|
3
|
+
style?: any;
|
|
4
|
+
className?: string;
|
|
5
|
+
displayMode: 'position' | 'cell';
|
|
6
|
+
x?: number;
|
|
7
|
+
y?: number;
|
|
8
|
+
width?: number | string;
|
|
9
|
+
height?: number | string;
|
|
10
|
+
row?: number;
|
|
11
|
+
col?: number;
|
|
12
|
+
anchor?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
13
|
+
dx?: number | string;
|
|
14
|
+
dy?: number | string;
|
|
15
|
+
}
|
|
16
|
+
declare function CustomLayout(props: CustomComponentProps): VNode;
|
|
17
|
+
declare namespace CustomLayout {
|
|
18
|
+
var symbol: string;
|
|
19
|
+
}
|
|
20
|
+
export default CustomLayout;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface RadioProps {
|
|
2
|
+
children?: string;
|
|
3
|
+
textStyle?: any;
|
|
4
|
+
circleStyle?: any;
|
|
5
|
+
checked?: boolean;
|
|
6
|
+
interactive?: boolean;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
disableCursor?: any;
|
|
9
|
+
spaceBetweenTextAndIcon?: number;
|
|
10
|
+
visible?: boolean;
|
|
11
|
+
onChange?: (checked: boolean) => void;
|
|
12
|
+
}
|
|
13
|
+
declare function Radio(props: RadioProps): any;
|
|
14
|
+
declare namespace Radio {
|
|
15
|
+
var symbol: string;
|
|
16
|
+
}
|
|
17
|
+
export default Radio;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { VNode } from 'vue';
|
|
2
|
+
export interface TagProps {
|
|
3
|
+
attribute?: any;
|
|
4
|
+
children?: string;
|
|
5
|
+
textStyle?: any;
|
|
6
|
+
panelStyle?: any;
|
|
7
|
+
padding?: any;
|
|
8
|
+
minWidth?: number;
|
|
9
|
+
maxWidth?: number;
|
|
10
|
+
visible?: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare function Tag(props: TagProps): VNode;
|
|
13
|
+
declare namespace Tag {
|
|
14
|
+
var symbol: string;
|
|
15
|
+
}
|
|
16
|
+
export default Tag;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { IGraphic, IPlugin, IStage } from '@visactor/vtable/es/vrender';
|
|
2
|
+
import { HtmlAttributePlugin } from '@visactor/vtable/es/vrender';
|
|
3
|
+
export declare class VTableVueAttributePlugin extends HtmlAttributePlugin implements IPlugin {
|
|
4
|
+
name: string;
|
|
5
|
+
htmlMap: Record<string, {
|
|
6
|
+
wrapContainer: HTMLElement;
|
|
7
|
+
nativeContainer: HTMLElement;
|
|
8
|
+
container: string | HTMLElement | null;
|
|
9
|
+
renderId: number;
|
|
10
|
+
graphic: IGraphic;
|
|
11
|
+
isInViewport: boolean;
|
|
12
|
+
lastPosition?: {
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
} | null;
|
|
16
|
+
lastStyle?: Record<string, any>;
|
|
17
|
+
lastAccessed?: number;
|
|
18
|
+
}>;
|
|
19
|
+
private renderQueue;
|
|
20
|
+
private isRendering;
|
|
21
|
+
private MAX_CACHE_COUNT;
|
|
22
|
+
private accessQueue;
|
|
23
|
+
private VIEWPORT_BUFFER;
|
|
24
|
+
private BUFFER_ZONE;
|
|
25
|
+
private styleUpdateQueue;
|
|
26
|
+
private styleUpdateRequested;
|
|
27
|
+
private eventHandlers;
|
|
28
|
+
currentContext?: any;
|
|
29
|
+
constructor(currentContext?: any);
|
|
30
|
+
renderGraphicHTML(graphic: IGraphic): void;
|
|
31
|
+
private scheduleRender;
|
|
32
|
+
doRenderGraphic(graphic: IGraphic): void;
|
|
33
|
+
private getGraphicOptions;
|
|
34
|
+
private checkToPassAppContext;
|
|
35
|
+
private getCustomConfig;
|
|
36
|
+
private checkNeedRender;
|
|
37
|
+
private checkInViewport;
|
|
38
|
+
private checkInBuffer;
|
|
39
|
+
private checkInViewportByZone;
|
|
40
|
+
private updateAccessQueue;
|
|
41
|
+
private checkAndClearCache;
|
|
42
|
+
private classifyNodes;
|
|
43
|
+
private checkDom;
|
|
44
|
+
removeAllDom(g: IGraphic): void;
|
|
45
|
+
removeElement(id: string, clear?: boolean): void;
|
|
46
|
+
getWrapContainer(stage: IStage, userContainer?: string | HTMLElement | null, domParams?: any): {
|
|
47
|
+
reuse: boolean;
|
|
48
|
+
wrapContainer: HTMLElement;
|
|
49
|
+
nativeContainer: HTMLElement;
|
|
50
|
+
} | {
|
|
51
|
+
wrapContainer: HTMLElement;
|
|
52
|
+
nativeContainer: HTMLElement;
|
|
53
|
+
reuse?: undefined;
|
|
54
|
+
};
|
|
55
|
+
updateStyleOfWrapContainer(graphic: IGraphic, stage: IStage, wrapContainer: HTMLElement, nativeContainer: HTMLElement): void;
|
|
56
|
+
private checkToAddEventListener;
|
|
57
|
+
private requestStyleUpdate;
|
|
58
|
+
private convertCellStyle;
|
|
59
|
+
private calculatePosition;
|
|
60
|
+
private calculateOffset;
|
|
61
|
+
private applyUserStyles;
|
|
62
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { default as ListColumn } from './list/list-column';
|
|
2
|
+
export { default as PivotColumnDimension } from './pivot/pivot-column-dimension';
|
|
3
|
+
export { default as PivotRowDimension } from './pivot/pivot-row-dimension';
|
|
4
|
+
export { default as PivotColumnHeaderTitle } from './pivot/pivot-column-header-title';
|
|
5
|
+
export { default as PivotRowHeaderTitle } from './pivot/pivot-row-header-title';
|
|
6
|
+
export { default as PivotIndicator } from './pivot/pivot-indicator';
|
|
7
|
+
export { default as PivotCorner } from './pivot/pivot-corner';
|
|
8
|
+
export { default as Menu } from './component/menu';
|
|
9
|
+
export { default as Tooltip } from './component/tooltip';
|
|
10
|
+
export { default as Group } from './custom/group';
|
|
11
|
+
export { default as Image } from './custom/image';
|
|
12
|
+
export { default as Text } from './custom/text';
|
|
13
|
+
export { default as Tag } from './custom/tag';
|
|
14
|
+
export { default as Radio } from './custom/radio';
|
|
15
|
+
export { default as CheckBox } from './custom/checkBox';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { VNode } from 'vue';
|
|
2
|
+
import type { IDimension } from '@visactor/vtable';
|
|
3
|
+
interface ObjectHandler {
|
|
4
|
+
objectHandler?: string | Array<string>;
|
|
5
|
+
}
|
|
6
|
+
export type PivotColumnDimensionProps = IDimension & ObjectHandler;
|
|
7
|
+
declare function PivotColumnDimension(props: PivotColumnDimensionProps): VNode;
|
|
8
|
+
declare namespace PivotColumnDimension {
|
|
9
|
+
var symbol: string;
|
|
10
|
+
}
|
|
11
|
+
export default PivotColumnDimension;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { VNode } from 'vue';
|
|
2
|
+
import type { ITitleDefine } from '@visactor/vtable';
|
|
3
|
+
declare function PivotColumnHeaderTitle(props: ITitleDefine): VNode;
|
|
4
|
+
declare namespace PivotColumnHeaderTitle {
|
|
5
|
+
var symbol: string;
|
|
6
|
+
}
|
|
7
|
+
export default PivotColumnHeaderTitle;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { VNode } from 'vue';
|
|
2
|
+
import type { IDimension } from '@visactor/vtable';
|
|
3
|
+
interface ObjectHandler {
|
|
4
|
+
objectHandler?: string | Array<string>;
|
|
5
|
+
}
|
|
6
|
+
export type PivotColumnDimensionProps = IDimension & ObjectHandler;
|
|
7
|
+
declare function PivotRowDimension(props: PivotColumnDimensionProps): VNode;
|
|
8
|
+
declare namespace PivotRowDimension {
|
|
9
|
+
var symbol: string;
|
|
10
|
+
}
|
|
11
|
+
export default PivotRowDimension;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DYNAMIC_RENDER_EDITOR = "dynamic-render-editor";
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { Ref, VNode } from 'vue';
|
|
2
|
+
import type { RectProps } from '@visactor/vtable/es/ts-types/common';
|
|
3
|
+
export interface DynamicRenderEditorParams {
|
|
4
|
+
row: number;
|
|
5
|
+
col: number;
|
|
6
|
+
value: any;
|
|
7
|
+
refValue: Ref<any>;
|
|
8
|
+
record: any;
|
|
9
|
+
table: any;
|
|
10
|
+
onChange: (value: any) => void;
|
|
11
|
+
}
|
|
12
|
+
export interface DynamicRenderEditorConfig {
|
|
13
|
+
editBefore?: (editorContext?: any) => boolean | Promise<boolean>;
|
|
14
|
+
disablePrompt?: string;
|
|
15
|
+
validateValue?: (params?: ValidateValueParams) => boolean | Promise<boolean>;
|
|
16
|
+
invalidPrompt?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface ValidateValueParams {
|
|
19
|
+
row: number;
|
|
20
|
+
col: number;
|
|
21
|
+
value?: any;
|
|
22
|
+
oldValue?: any;
|
|
23
|
+
table?: any;
|
|
24
|
+
}
|
|
25
|
+
export declare class DynamicRenderEditor {
|
|
26
|
+
wrapContainer: HTMLElement;
|
|
27
|
+
tableContainer: HTMLElement | null;
|
|
28
|
+
currentValue: string | null;
|
|
29
|
+
nodeMap?: Map<string | number, Map<string | number, (params: DynamicRenderEditorParams) => any>>;
|
|
30
|
+
currentContext?: any;
|
|
31
|
+
constructor(currentContext?: any);
|
|
32
|
+
registerNode(tableId?: string | number, key?: string | number, getNode?: () => (params: DynamicRenderEditorParams) => any): void;
|
|
33
|
+
getNode(tableId?: string | number, key?: string | number): (params: DynamicRenderEditorParams) => any;
|
|
34
|
+
removeNode(tableId: string | number): void;
|
|
35
|
+
release(tableId?: string | number): void;
|
|
36
|
+
onStart(editorContext: any): Promise<void>;
|
|
37
|
+
createElement(editorContext: any): Promise<boolean>;
|
|
38
|
+
checkToPassAppContext(vnode: VNode, table: any): void;
|
|
39
|
+
getColumnKeyField(column: any): any;
|
|
40
|
+
getValue(): string;
|
|
41
|
+
setValue(value: any): void;
|
|
42
|
+
adjustPosition(rect: RectProps): void;
|
|
43
|
+
validateValue(value?: any, oldValue?: any, editCell?: {
|
|
44
|
+
col: number;
|
|
45
|
+
row: number;
|
|
46
|
+
}, table?: any): Promise<boolean>;
|
|
47
|
+
onEnd(): void;
|
|
48
|
+
isEditorElement(target: HTMLElement): boolean;
|
|
49
|
+
isClickEditorElement(target: HTMLElement): boolean;
|
|
50
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DynamicRenderEditor } from './editor';
|
|
2
|
+
export declare function checkRenderEditor(column: any, getEditCustomNode?: any): boolean;
|
|
3
|
+
export declare function getRenderEditorColumnKeyField(column: any): any;
|
|
4
|
+
export declare function getRenderEditor(create?: boolean, currentContext?: any): DynamicRenderEditor | undefined;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import type { TYPES } from '@visactor/vtable';
|
|
2
|
+
export type EventCallback<Params> = (params: Params) => void;
|
|
3
|
+
export interface EventsProps {
|
|
4
|
+
onClickCell?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['click_cell']>;
|
|
5
|
+
onDblClickCell?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['dblclick_cell']>;
|
|
6
|
+
onMouseDownCell?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['mousedown_cell']>;
|
|
7
|
+
onMouseUpCell?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['mouseup_cell']>;
|
|
8
|
+
onSelectedCell?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['selected_cell']>;
|
|
9
|
+
onKeyDown?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['keydown']>;
|
|
10
|
+
onMouseEnterTable?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['mouseenter_table']>;
|
|
11
|
+
onMouseLeaveTable?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['mouseleave_table']>;
|
|
12
|
+
onMouseDownTable?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['mousedown_table']>;
|
|
13
|
+
onMouseMoveCell?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['mousemove_cell']>;
|
|
14
|
+
onMouseEnterCell?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['mouseenter_cell']>;
|
|
15
|
+
onMouseLeaveCell?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['mouseleave_cell']>;
|
|
16
|
+
onContextMenuCell?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['contextmenu_cell']>;
|
|
17
|
+
onContextMenuCanvas?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['contextmenu_canvas']>;
|
|
18
|
+
onResizeColumn?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['resize_column']>;
|
|
19
|
+
onResizeColumnEnd?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['resize_column_end']>;
|
|
20
|
+
onChangeHeaderPosition?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['change_header_position']>;
|
|
21
|
+
onChangeHeaderPositionStart?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['change_header_position_start']>;
|
|
22
|
+
onChangeHeaderPositionFail?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['change_header_position_fail']>;
|
|
23
|
+
onSortClick?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['sort_click']>;
|
|
24
|
+
onFreezeClick?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['freeze_click']>;
|
|
25
|
+
onScroll?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['scroll']>;
|
|
26
|
+
onDropdownMenuClick?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['dropdown_menu_click']>;
|
|
27
|
+
onMouseOverChartSymbol?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['mouseover_chart_symbol']>;
|
|
28
|
+
onDragSelectEnd?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['drag_select_end']>;
|
|
29
|
+
onDropdownIconClick?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['dropdown_icon_click']>;
|
|
30
|
+
onDropdownMenuClear?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['dropdown_menu_clear']>;
|
|
31
|
+
onTreeHierarchyStateChange?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['tree_hierarchy_state_change']>;
|
|
32
|
+
onShowMenu?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['show_menu']>;
|
|
33
|
+
onHideMenu?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['hide_menu']>;
|
|
34
|
+
onIconClick?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['icon_click']>;
|
|
35
|
+
onLegendItemClick?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['legend_item_click']>;
|
|
36
|
+
onLegendItemHover?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['legend_item_hover']>;
|
|
37
|
+
onLegendItemUnHover?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['legend_item_unHover']>;
|
|
38
|
+
onLegendChange?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['legend_change']>;
|
|
39
|
+
onMouseEnterAxis?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['mouseenter_axis']>;
|
|
40
|
+
onMouseLeaveAxis?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['mouseleave_axis']>;
|
|
41
|
+
onCheckboxStateChange?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['checkbox_state_change']>;
|
|
42
|
+
onRadioStateChange?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['radio_state_change']>;
|
|
43
|
+
onAfterRender?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['after_render']>;
|
|
44
|
+
onInitialized?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['initialized']>;
|
|
45
|
+
onPivotSortClick?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['pivot_sort_click']>;
|
|
46
|
+
onDrillMenuClick?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['drillmenu_click']>;
|
|
47
|
+
onVChartEventType?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['vchart_event_type']>;
|
|
48
|
+
onChangeCellValue?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['change_cell_value']>;
|
|
49
|
+
onMousedownFillHandle?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['mousedown_fill_handle']>;
|
|
50
|
+
onDragFillHandleEnd?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['drag_fill_handle_end']>;
|
|
51
|
+
onDblclickFillHandle?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['dblclick_fill_handle']>;
|
|
52
|
+
onScrollVerticalEnd?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['scroll_vertical_end']>;
|
|
53
|
+
onScrollHorizontalEnd?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['scroll_horizontal_end']>;
|
|
54
|
+
onChangCellValue?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['change_cell_value']>;
|
|
55
|
+
onEmptyTipClick?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['empty_tip_click']>;
|
|
56
|
+
onEmptyTipDblClick?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['empty_tip_dblclick']>;
|
|
57
|
+
onButtonClick?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['button_click']>;
|
|
58
|
+
onBeforeCacheChartImage?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['before_cache_chart_image']>;
|
|
59
|
+
onPastedData?: EventCallback<TYPES.TableEventHandlersEventArgumentMap['pasted_data']>;
|
|
60
|
+
}
|
|
61
|
+
export declare const TABLE_EVENTS: {
|
|
62
|
+
onClickCell: "click_cell";
|
|
63
|
+
onDblClickCell: "dblclick_cell";
|
|
64
|
+
onMouseDownCell: "mousedown_cell";
|
|
65
|
+
onMouseUpCell: "mouseup_cell";
|
|
66
|
+
onSelectedCell: "selected_cell";
|
|
67
|
+
onKeyDown: "keydown";
|
|
68
|
+
onMouseEnterTable: "mouseenter_table";
|
|
69
|
+
onMouseLeaveTable: "mouseleave_table";
|
|
70
|
+
onMouseDownTable: "mousedown_table";
|
|
71
|
+
onMouseMoveCell: "mousemove_cell";
|
|
72
|
+
onMouseEnterCell: "mouseenter_cell";
|
|
73
|
+
onMouseLeaveCell: "mouseleave_cell";
|
|
74
|
+
onContextMenuCell: "contextmenu_cell";
|
|
75
|
+
onContextMenuCanvas: "contextmenu_canvas";
|
|
76
|
+
onResizeColumn: "resize_column";
|
|
77
|
+
onResizeColumnEnd: "resize_column_end";
|
|
78
|
+
onChangeHeaderPosition: "change_header_position";
|
|
79
|
+
onChangeHeaderPositionStart: "change_header_position_start";
|
|
80
|
+
onChangeHeaderPositionFail: "change_header_position_fail";
|
|
81
|
+
onSortClick: "sort_click";
|
|
82
|
+
onFreezeClick: "freeze_click";
|
|
83
|
+
onScroll: "scroll";
|
|
84
|
+
onDropdownMenuClick: "dropdown_menu_click";
|
|
85
|
+
onMouseOverChartSymbol: "mouseover_chart_symbol";
|
|
86
|
+
onDragSelectEnd: "drag_select_end";
|
|
87
|
+
onDropdownIconClick: "dropdown_icon_click";
|
|
88
|
+
onDropdownMenuClear: "dropdown_menu_clear";
|
|
89
|
+
onTreeHierarchyStateChange: "tree_hierarchy_state_change";
|
|
90
|
+
onShowMenu: "show_menu";
|
|
91
|
+
onHideMenu: "hide_menu";
|
|
92
|
+
onIconClick: "icon_click";
|
|
93
|
+
onLegendItemClick: "legend_item_click";
|
|
94
|
+
onLegendItemHover: "legend_item_hover";
|
|
95
|
+
onLegendItemUnHover: "legend_item_unHover";
|
|
96
|
+
onLegendChange: "legend_change";
|
|
97
|
+
onMouseEnterAxis: "mouseenter_axis";
|
|
98
|
+
onMouseLeaveAxis: "mouseleave_axis";
|
|
99
|
+
onCheckboxStateChange: "checkbox_state_change";
|
|
100
|
+
onRadioStateChange: "radio_state_change";
|
|
101
|
+
onAfterRender: "after_render";
|
|
102
|
+
onInitialized: "initialized";
|
|
103
|
+
onPivotSortClick: "pivot_sort_click";
|
|
104
|
+
onDrillMenuClick: "drillmenu_click";
|
|
105
|
+
onVChartEventType: "vchart_event_type";
|
|
106
|
+
onChangeCellValue: "change_cell_value";
|
|
107
|
+
onMousedownFillHandle: "mousedown_fill_handle";
|
|
108
|
+
onDragFillHandleEnd: "drag_fill_handle_end";
|
|
109
|
+
onDblclickFillHandle: "dblclick_fill_handle";
|
|
110
|
+
onScrollVerticalEnd: "scroll_vertical_end";
|
|
111
|
+
onScrollHorizontalEnd: "scroll_horizontal_end";
|
|
112
|
+
onChangCellValue: "change_cell_value";
|
|
113
|
+
onEmptyTipClick: "empty_tip_click";
|
|
114
|
+
onEmptyTipDblClick: "empty_tip_dblclick";
|
|
115
|
+
onButtonClick: "button_click";
|
|
116
|
+
onBeforeCacheChartImage: "before_cache_chart_image";
|
|
117
|
+
onPastedData: "pasted_data";
|
|
118
|
+
onSelectedClear: "selected_clear";
|
|
119
|
+
};
|
|
120
|
+
export declare const TABLE_EVENTS_KEYS: string[];
|
package/es/global.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare const __VERSION__: string;
|
package/es/index.d.ts
ADDED
package/es/index.js
CHANGED
|
@@ -22,6 +22,6 @@ export { default as Radio } from './components/custom/radio.js';
|
|
|
22
22
|
export { default as CheckBox } from './components/custom/checkBox.js';
|
|
23
23
|
export { registerChartModule } from './tables/chartModule.js';
|
|
24
24
|
|
|
25
|
-
const version = "1.26.1
|
|
25
|
+
const version = "1.26.1";
|
|
26
26
|
|
|
27
27
|
export { version };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const registerChartModule: (name: string, chart: any) => void;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as ListTable } from './list-table.vue';
|
|
2
|
+
export { default as PivotTable } from './pivot-table.vue';
|
|
3
|
+
export { default as PivotChart } from './pivot-chart.vue';
|
|
4
|
+
export { registerChartModule } from './chartModule';
|
|
5
|
+
export { register } from '@visactor/vtable';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ColumnDefine, ICornerDefine, IIndicator, IDimension, ITitleDefine } from '@visactor/vtable';
|
|
2
|
+
import type { TooltipProps } from '../components/component/tooltip';
|
|
3
|
+
import type { MenuProps } from '../components/component/menu';
|
|
4
|
+
export declare function extractPivotSlotOptions(vnodes: any[]): {
|
|
5
|
+
columns: ColumnDefine[];
|
|
6
|
+
columnHeaderTitle: ITitleDefine[];
|
|
7
|
+
rows: IDimension[];
|
|
8
|
+
rowHeaderTitle: ITitleDefine[];
|
|
9
|
+
indicators: IIndicator[];
|
|
10
|
+
corner: ICornerDefine;
|
|
11
|
+
tooltip: TooltipProps;
|
|
12
|
+
menu: MenuProps;
|
|
13
|
+
};
|
|
14
|
+
export declare function extractListSlotOptions(vnodes: any[]): {
|
|
15
|
+
columns: ColumnDefine[];
|
|
16
|
+
tooltip: TooltipProps;
|
|
17
|
+
menu: MenuProps;
|
|
18
|
+
};
|
|
19
|
+
export declare function mergeSlotOptions(propsOptions: Record<string, unknown>, slotOptions: Record<string, any>): {
|
|
20
|
+
columns: any;
|
|
21
|
+
columnHeaderTitle: any;
|
|
22
|
+
rows: any;
|
|
23
|
+
rowHeaderTitle: any;
|
|
24
|
+
indicators: any;
|
|
25
|
+
corner: any;
|
|
26
|
+
tooltip: any;
|
|
27
|
+
menu: any;
|
|
28
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function flattenVNodes(vnodes: any[]): any[];
|
package/es/utils.d.ts
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visactor/vue-vtable",
|
|
3
|
-
"version": "1.26.1
|
|
3
|
+
"version": "1.26.1",
|
|
4
4
|
"description": "The vue version of VTable",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vue",
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
],
|
|
32
32
|
"exports": {
|
|
33
33
|
".": {
|
|
34
|
+
"types": "./es/index.d.ts",
|
|
34
35
|
"require": "./cjs/index.js",
|
|
35
36
|
"import": "./es/index.js"
|
|
36
37
|
},
|
|
@@ -50,8 +51,8 @@
|
|
|
50
51
|
"access": "public"
|
|
51
52
|
},
|
|
52
53
|
"dependencies": {
|
|
53
|
-
"@visactor/
|
|
54
|
-
"@visactor/
|
|
54
|
+
"@visactor/vutils": "~1.0.17",
|
|
55
|
+
"@visactor/vtable": "1.26.1"
|
|
55
56
|
},
|
|
56
57
|
"devDependencies": {
|
|
57
58
|
"@arco-design/web-vue": "^2.11.0",
|
|
@@ -95,9 +96,9 @@
|
|
|
95
96
|
"axios": "^1.4.0",
|
|
96
97
|
"eslint-plugin-vue": "^9.26.0",
|
|
97
98
|
"vue-eslint-parser": "^9.4.2",
|
|
98
|
-
"@internal/eslint-config": "0.0.1",
|
|
99
99
|
"@internal/bundler": "0.0.1",
|
|
100
|
-
"@internal/ts-config": "0.0.1"
|
|
100
|
+
"@internal/ts-config": "0.0.1",
|
|
101
|
+
"@internal/eslint-config": "0.0.1"
|
|
101
102
|
},
|
|
102
103
|
"scripts": {
|
|
103
104
|
"start": "vite ./demo",
|