@visactor/vue-vtable 1.7.9-alpha.2 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/tables/pivot-table.vue.js +1 -1
- package/dist/vue-vtable.js +4 -4
- package/dist/vue-vtable.min.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/tables/pivot-table.vue.js +1 -1
- package/package.json +5 -5
package/cjs/index.d.ts
CHANGED
package/cjs/index.js
CHANGED
|
@@ -40,7 +40,7 @@ function _interopNamespaceDefault(e) {
|
|
|
40
40
|
|
|
41
41
|
var VTable__namespace = /*#__PURE__*/_interopNamespaceDefault(VTable);
|
|
42
42
|
|
|
43
|
-
const version = "1.
|
|
43
|
+
const version = "1.8.0";
|
|
44
44
|
|
|
45
45
|
exports.VTable = VTable__namespace;
|
|
46
46
|
Object.defineProperty(exports, 'register', {
|
|
@@ -52,7 +52,7 @@ var _sfc_main = vue.defineComponent({
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
});
|
|
55
|
-
return Object.assign(Object.assign({}, props.options), { columns: options.columns.length ? options.columns : props.options.columns, columnHeaderTitle: options.columnHeaderTitle.length ? options.columnHeaderTitle : props.options.columnHeaderTitle, rows: options.rows.length ? options.rows : props.options.rows, rowHeaderTitle: options.rowHeaderTitle.length ? options.rowHeaderTitle : props.options.rowHeaderTitle, indicators: options.indicators.length ? options.indicators : props.options.indicators, corner: options.corner ||
|
|
55
|
+
return Object.assign(Object.assign({}, props.options), { columns: options.columns.length ? options.columns : props.options.columns, columnHeaderTitle: options.columnHeaderTitle.length ? options.columnHeaderTitle : props.options.columnHeaderTitle, rows: options.rows.length ? options.rows : props.options.rows, rowHeaderTitle: options.rowHeaderTitle.length ? options.rowHeaderTitle : props.options.rowHeaderTitle, indicators: options.indicators.length ? options.indicators : props.options.indicators, corner: props.options.corner || options.corner, tooltip: props.options.tooltip || options.tooltip, menu: props.options.menu || options.menu });
|
|
56
56
|
});
|
|
57
57
|
__expose({ vTableInstance: vue.computed(() => { var _a; return ((_a = baseTableRef.value) === null || _a === void 0 ? void 0 : _a.vTableInstance) || null; }) });
|
|
58
58
|
return (_ctx, _cache) => {
|
package/dist/vue-vtable.js
CHANGED
|
@@ -441,9 +441,9 @@
|
|
|
441
441
|
rows: options.rows.length ? options.rows : props.options.rows,
|
|
442
442
|
rowHeaderTitle: options.rowHeaderTitle.length ? options.rowHeaderTitle : props.options.rowHeaderTitle,
|
|
443
443
|
indicators: options.indicators.length ? options.indicators : props.options.indicators,
|
|
444
|
-
corner: options.corner ||
|
|
445
|
-
tooltip: options.tooltip ||
|
|
446
|
-
menu: options.menu ||
|
|
444
|
+
corner: props.options.corner || options.corner,
|
|
445
|
+
tooltip: props.options.tooltip || options.tooltip,
|
|
446
|
+
menu: props.options.menu || options.menu,
|
|
447
447
|
};
|
|
448
448
|
});
|
|
449
449
|
__expose({ vTableInstance: vue.computed(() => baseTableRef.value?.vTableInstance || null) });
|
|
@@ -609,7 +609,7 @@
|
|
|
609
609
|
return null;
|
|
610
610
|
}
|
|
611
611
|
|
|
612
|
-
const version = "1.
|
|
612
|
+
const version = "1.8.0";
|
|
613
613
|
|
|
614
614
|
exports.VTable = VTable__namespace;
|
|
615
615
|
Object.defineProperty(exports, 'register', {
|
package/dist/vue-vtable.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports,require("@visactor/vtable"),require("vue"),require("@visactor/vutils")):"function"==typeof define&&define.amd?define(["exports","@visactor/vtable","vue","@visactor/vutils"],o):o((e="undefined"!=typeof globalThis?globalThis:e||self).VueVTable={},e.VTable,e.vue,e.vutils)}(this,(function(e,o,n,t){"use strict";function r(e){var o=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var t=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(o,n,t.get?t:{enumerable:!0,get:function(){return e[n]}})}})),o.default=e,Object.freeze(o)}var l=r(o);function i(e){return e.flatMap((e=>Array.isArray(e.children)?i(e.children):e))}function u(e){const o={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(n){if(!n)return null;const{type:r,props:l,children:i}=n,u=o[r?.name||r];if(!u)return null;const a=new u({...l});!function(e,o){Object.keys(o).forEach((n=>{if(function(e,o){return e.startsWith("on")&&t.isFunction(o[e])}(n,o)){const t=n.slice(2).toLowerCase();e.addEventListener(t,o[n])}}))}(a,l);return function(e){return e?.default?.()||e||[]}(i).forEach((o=>{const n=e(o);n?a.add(n):o.type===Symbol.for("v-fgt")&&o.children.forEach((o=>{const n=e(o);n&&a.add(n)}))})),a}(e)}}const a={...o.ListTable.EVENT_TYPE,...o.PivotTable.EVENT_TYPE,...o.PivotChart.EVENT_TYPE},s={onClickCell:a.CLICK_CELL,onDblClickCell:a.DBLCLICK_CELL,onMouseDownCell:a.MOUSEDOWN_CELL,onMouseUpCell:a.MOUSEUP_CELL,onSelectedCell:a.SELECTED_CELL,onKeyDown:a.KEYDOWN,onMouseEnterTable:a.MOUSEENTER_TABLE,onMouseLeaveTable:a.MOUSELEAVE_TABLE,onMouseDownTable:a.MOUSEDOWN_TABLE,onMouseMoveCell:a.MOUSEMOVE_CELL,onMouseEnterCell:a.MOUSEENTER_CELL,onMouseLeaveCell:a.MOUSELEAVE_CELL,onContextMenuCell:a.CONTEXTMENU_CELL,onResizeColumn:a.RESIZE_COLUMN,onResizeColumnEnd:a.RESIZE_COLUMN_END,onChangeHeaderPosition:a.CHANGE_HEADER_POSITION,onSortClick:a.SORT_CLICK,onFreezeClick:a.FREEZE_CLICK,onScroll:a.SCROLL,onDropdownMenuClick:a.DROPDOWN_MENU_CLICK,onMouseOverChartSymbol:a.MOUSEOVER_CHART_SYMBOL,onDragSelectEnd:a.DRAG_SELECT_END,onDropdownIconClick:a.DROPDOWN_ICON_CLICK,onDropdownMenuClear:a.DROPDOWN_MENU_CLEAR,onTreeHierarchyStateChange:a.TREE_HIERARCHY_STATE_CHANGE,onShowMenu:a.SHOW_MENU,onHideMenu:a.HIDE_MENU,onIconClick:a.ICON_CLICK,onLegendItemClick:a.LEGEND_ITEM_CLICK,onLegendItemHover:a.LEGEND_ITEM_HOVER,onLegendItemUnHover:a.LEGEND_ITEM_UNHOVER,onLegendChange:a.LEGEND_CHANGE,onMouseEnterAxis:a.MOUSEENTER_AXIS,onMouseLeaveAxis:a.MOUSELEAVE_AXIS,onCheckboxStateChange:a.CHECKBOX_STATE_CHANGE,onRadioStateChange:a.RADIO_STATE_CHANGE,onAfterRender:a.AFTER_RENDER,onInitialized:a.INITIALIZED,onPivotSortClick:a.PIVOT_SORT_CLICK,onDrillMenuClick:a.DRILLMENU_CLICK,onVChartEventType:a.VCHART_EVENT_TYPE,onChangCellValue:a.CHANGE_CELL_VALUE,onMousedownFillHandle:a.MOUSEDOWN_FILL_HANDLE,onDragFillHandleEnd:a.DRAG_FILL_HANDLE_END,onDblclickFillHandle:a.DBLCLICK_FILL_HANDLE,onScrollVerticalEnd:a.SCROLL_VERTICAL_END,onScrollHorizontalEnd:a.SCROLL_HORIZONTAL_END},c=Object.keys(s);var d=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},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},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},onChangCellValue:{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:c,setup(e,{expose:t,emit:r}){const l=e,i=n.ref(null),u=n.shallowRef(null);t({vTableInstance:u});const a=n.computed((()=>"number"==typeof l.width?`${l.width}px`:l.width)),d=n.computed((()=>"number"==typeof l.height?`${l.height}px`:l.height)),p=r,C=()=>{if(!i.value)return;u.value&&u.value.release();const e=()=>void 0!==l.records&&null!==l.records&&l.records.length>0?l.records:l.options.records,n=(e,o)=>{u.value=new e(i.value,o)};try{switch(l.type){case"list":n(o.ListTable,{...l.options,records:e()});break;case"pivot":n(o.PivotTable,{...l.options,records:e()});break;case"chart":n(o.PivotChart,{...l.options,records:e()})}t=u.value,c.forEach((e=>{t.on(s[e],(o=>{p(e,o)}))})),l.onReady?.(u.value,!0)}catch(e){}var t},E=e=>{if(u.value)try{switch(l.type){case"list":u.value instanceof o.ListTable&&u.value.updateOption(e);break;case"pivot":u.value instanceof o.PivotTable&&u.value.updateOption(e);break;case"chart":u.value instanceof o.PivotChart&&u.value.updateOption(e)}}catch(e){l.onError?.(e)}};return n.onMounted(C),n.onBeforeUnmount((()=>u.value?.release())),n.watch((()=>l.options),(e=>{u.value?E(e):C()}),{deep:!0}),n.watch((()=>l.records),((e,o)=>{u.value?E({...l.options,records:e}):C()}),{deep:!0}),(e,o)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"vTableContainer",ref:i,style:n.normalizeStyle([{width:a.value,height:d.value},{position:"relative"}])},null,4))}}),p=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:o}){const t=e,r=n.ref(null),l=n.useSlots(),a=n.computed((()=>{const e=function(e){const o={columns:[],tooltip:{},menu:{}},n={ListColumn:"columns",Tooltip:"tooltip",Menu:"menu"};return e.forEach((e=>{const t=e.type?.name||e.type?.__name,r=n[t];var l;r&&("columns"===r&&e.children&&(e.props.customLayout=(l=e.children,e=>{const{table:o,row:n,col:t,rect:r}=e,i=o.getCellOriginRecord(t,n),{height:a,width:s}=r??o.getCellRect(t,n),c=l.customLayout({table:o,row:n,col:t,rect:r,record:i,height:a,width:s})[0],{rootComponent:d}=u(c);return{rootContainer:d,renderDefault:!1}})),Array.isArray(o[r])?o[r].push(e.props):o[r]=e.props)})),o}(i(l.default?.()||[]));return{...t.options,columns:e.columns.length?e.columns:t.options.columns,tooltip:e.tooltip||t.options.tooltip,menu:e.menu||t.options.menu}}));return o({vTableInstance:n.computed((()=>r.value?.vTableInstance||null))}),(e,o)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createVNode(d,n.mergeProps({type:"list",options:a.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))}}),C=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:o}){const t=e,r=n.shallowRef(null),l=n.useSlots(),u=n.computed((()=>{const e=i(l.default?.()||[]),o={columns:[],columnHeaderTitle:[],rows:[],rowHeaderTitle:[],indicators:[],corner:Object,tooltip:Object,menu:Object},n={PivotColumnDimension:"columns",PivotColumnHeaderTitle:"columnHeaderTitle",PivotRowDimension:"rows",PivotRowHeaderTitle:"rowHeaderTitle",PivotCorner:"corner",PivotIndicator:"indicators",Tooltip:"tooltip",Menu:"menu"};return e.forEach((e=>{const t=e.type?.name||e.type?.__name,r=n[t];r&&(Array.isArray(o[r])?o[r].push(e.props):o[r]=e.props)})),{...t.options,columns:o.columns.length?o.columns:t.options.columns,columnHeaderTitle:o.columnHeaderTitle.length?o.columnHeaderTitle:t.options.columnHeaderTitle,rows:o.rows.length?o.rows:t.options.rows,rowHeaderTitle:o.rowHeaderTitle.length?o.rowHeaderTitle:t.options.rowHeaderTitle,indicators:o.indicators.length?o.indicators:t.options.indicators,corner:o.corner||t.options.corner,tooltip:o.tooltip||t.options.tooltip,menu:o.menu||t.options.menu}}));return o({vTableInstance:n.computed((()=>r.value?.vTableInstance||null))}),(e,o)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createVNode(d,n.mergeProps({type:"pivot",options:u.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))}}),E=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:o}){const t=e,r=n.shallowRef(null),l=n.useSlots(),u=n.computed((()=>{const e=i(l.default?.()||[]),o={columns:[],columnHeaderTitle:[],rows:[],rowHeaderTitle:[],indicators:[],corner:Object,tooltip:Object,menu:Object},n={PivotColumnDimension:"columns",PivotColumnHeaderTitle:"columnHeaderTitle",PivotRowDimension:"rows",PivotRowHeaderTitle:"rowHeaderTitle",PivotCorner:"corner",PivotIndicator:"indicators",Tooltip:"tooltip",Menu:"menu"};return e.forEach((e=>{const t=e.type?.name||e.type?.__name,r=n[t];r&&(Array.isArray(o[r])?e.props.hasOwnProperty("objectHandler")?o[r].push(e.props.objectHandler):o[r].push(e.props):o[r]=e.props)})),{...t.options,columns:o.columns.length?o.columns:t.options.columns,columnHeaderTitle:o.columnHeaderTitle.length?o.columnHeaderTitle:t.options.columnHeaderTitle,rows:o.rows.length?o.rows:t.options.rows,rowHeaderTitle:o.rowHeaderTitle.length?o.rowHeaderTitle:t.options.rowHeaderTitle,indicators:o.indicators.length?o.indicators:t.options.indicators,corner:o.corner||t.options.corner,tooltip:o.tooltip||t.options.tooltip,menu:o.menu||t.options.menu}}));return o({vTableInstance:n.computed((()=>r.value?.vTableInstance||null))}),(e,o)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createVNode(d,n.mergeProps({type:"chart",options:u.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))}});e.VTable=l,Object.defineProperty(e,"register",{enumerable:!0,get:function(){return o.register}}),e.CheckBox=function(e){return null},e.Group=function(){return null},e.Image=function(){return null},e.ListColumn=function(e){return null},e.ListTable=p,e.Menu=function(e){return null},e.PivotChart=E,e.PivotColumnDimension=function(e){return null},e.PivotColumnHeaderTitle=function(e){return null},e.PivotCorner=function(e){return null},e.PivotIndicator=function(e){return null},e.PivotRowDimension=function(e){return null},e.PivotRowHeaderTitle=function(e){return null},e.PivotTable=C,e.Radio=function(e){return null},e.Tag=function(e){return null},e.Text=function(){return null},e.Tooltip=function(e){return null},e.registerChartModule=(e,o)=>{l.register.chartModule(e,o)},e.version="1.7.9-alpha.2"}));
|
|
1
|
+
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports,require("@visactor/vtable"),require("vue"),require("@visactor/vutils")):"function"==typeof define&&define.amd?define(["exports","@visactor/vtable","vue","@visactor/vutils"],o):o((e="undefined"!=typeof globalThis?globalThis:e||self).VueVTable={},e.VTable,e.vue,e.vutils)}(this,(function(e,o,n,t){"use strict";function r(e){var o=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var t=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(o,n,t.get?t:{enumerable:!0,get:function(){return e[n]}})}})),o.default=e,Object.freeze(o)}var l=r(o);function i(e){return e.flatMap((e=>Array.isArray(e.children)?i(e.children):e))}function u(e){const o={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(n){if(!n)return null;const{type:r,props:l,children:i}=n,u=o[r?.name||r];if(!u)return null;const a=new u({...l});!function(e,o){Object.keys(o).forEach((n=>{if(function(e,o){return e.startsWith("on")&&t.isFunction(o[e])}(n,o)){const t=n.slice(2).toLowerCase();e.addEventListener(t,o[n])}}))}(a,l);return function(e){return e?.default?.()||e||[]}(i).forEach((o=>{const n=e(o);n?a.add(n):o.type===Symbol.for("v-fgt")&&o.children.forEach((o=>{const n=e(o);n&&a.add(n)}))})),a}(e)}}const a={...o.ListTable.EVENT_TYPE,...o.PivotTable.EVENT_TYPE,...o.PivotChart.EVENT_TYPE},s={onClickCell:a.CLICK_CELL,onDblClickCell:a.DBLCLICK_CELL,onMouseDownCell:a.MOUSEDOWN_CELL,onMouseUpCell:a.MOUSEUP_CELL,onSelectedCell:a.SELECTED_CELL,onKeyDown:a.KEYDOWN,onMouseEnterTable:a.MOUSEENTER_TABLE,onMouseLeaveTable:a.MOUSELEAVE_TABLE,onMouseDownTable:a.MOUSEDOWN_TABLE,onMouseMoveCell:a.MOUSEMOVE_CELL,onMouseEnterCell:a.MOUSEENTER_CELL,onMouseLeaveCell:a.MOUSELEAVE_CELL,onContextMenuCell:a.CONTEXTMENU_CELL,onResizeColumn:a.RESIZE_COLUMN,onResizeColumnEnd:a.RESIZE_COLUMN_END,onChangeHeaderPosition:a.CHANGE_HEADER_POSITION,onSortClick:a.SORT_CLICK,onFreezeClick:a.FREEZE_CLICK,onScroll:a.SCROLL,onDropdownMenuClick:a.DROPDOWN_MENU_CLICK,onMouseOverChartSymbol:a.MOUSEOVER_CHART_SYMBOL,onDragSelectEnd:a.DRAG_SELECT_END,onDropdownIconClick:a.DROPDOWN_ICON_CLICK,onDropdownMenuClear:a.DROPDOWN_MENU_CLEAR,onTreeHierarchyStateChange:a.TREE_HIERARCHY_STATE_CHANGE,onShowMenu:a.SHOW_MENU,onHideMenu:a.HIDE_MENU,onIconClick:a.ICON_CLICK,onLegendItemClick:a.LEGEND_ITEM_CLICK,onLegendItemHover:a.LEGEND_ITEM_HOVER,onLegendItemUnHover:a.LEGEND_ITEM_UNHOVER,onLegendChange:a.LEGEND_CHANGE,onMouseEnterAxis:a.MOUSEENTER_AXIS,onMouseLeaveAxis:a.MOUSELEAVE_AXIS,onCheckboxStateChange:a.CHECKBOX_STATE_CHANGE,onRadioStateChange:a.RADIO_STATE_CHANGE,onAfterRender:a.AFTER_RENDER,onInitialized:a.INITIALIZED,onPivotSortClick:a.PIVOT_SORT_CLICK,onDrillMenuClick:a.DRILLMENU_CLICK,onVChartEventType:a.VCHART_EVENT_TYPE,onChangCellValue:a.CHANGE_CELL_VALUE,onMousedownFillHandle:a.MOUSEDOWN_FILL_HANDLE,onDragFillHandleEnd:a.DRAG_FILL_HANDLE_END,onDblclickFillHandle:a.DBLCLICK_FILL_HANDLE,onScrollVerticalEnd:a.SCROLL_VERTICAL_END,onScrollHorizontalEnd:a.SCROLL_HORIZONTAL_END},c=Object.keys(s);var d=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},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},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},onChangCellValue:{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:c,setup(e,{expose:t,emit:r}){const l=e,i=n.ref(null),u=n.shallowRef(null);t({vTableInstance:u});const a=n.computed((()=>"number"==typeof l.width?`${l.width}px`:l.width)),d=n.computed((()=>"number"==typeof l.height?`${l.height}px`:l.height)),p=r,C=()=>{if(!i.value)return;u.value&&u.value.release();const e=()=>void 0!==l.records&&null!==l.records&&l.records.length>0?l.records:l.options.records,n=(e,o)=>{u.value=new e(i.value,o)};try{switch(l.type){case"list":n(o.ListTable,{...l.options,records:e()});break;case"pivot":n(o.PivotTable,{...l.options,records:e()});break;case"chart":n(o.PivotChart,{...l.options,records:e()})}t=u.value,c.forEach((e=>{t.on(s[e],(o=>{p(e,o)}))})),l.onReady?.(u.value,!0)}catch(e){}var t},E=e=>{if(u.value)try{switch(l.type){case"list":u.value instanceof o.ListTable&&u.value.updateOption(e);break;case"pivot":u.value instanceof o.PivotTable&&u.value.updateOption(e);break;case"chart":u.value instanceof o.PivotChart&&u.value.updateOption(e)}}catch(e){l.onError?.(e)}};return n.onMounted(C),n.onBeforeUnmount((()=>u.value?.release())),n.watch((()=>l.options),(e=>{u.value?E(e):C()}),{deep:!0}),n.watch((()=>l.records),((e,o)=>{u.value?E({...l.options,records:e}):C()}),{deep:!0}),(e,o)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"vTableContainer",ref:i,style:n.normalizeStyle([{width:a.value,height:d.value},{position:"relative"}])},null,4))}}),p=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:o}){const t=e,r=n.ref(null),l=n.useSlots(),a=n.computed((()=>{const e=function(e){const o={columns:[],tooltip:{},menu:{}},n={ListColumn:"columns",Tooltip:"tooltip",Menu:"menu"};return e.forEach((e=>{const t=e.type?.name||e.type?.__name,r=n[t];var l;r&&("columns"===r&&e.children&&(e.props.customLayout=(l=e.children,e=>{const{table:o,row:n,col:t,rect:r}=e,i=o.getCellOriginRecord(t,n),{height:a,width:s}=r??o.getCellRect(t,n),c=l.customLayout({table:o,row:n,col:t,rect:r,record:i,height:a,width:s})[0],{rootComponent:d}=u(c);return{rootContainer:d,renderDefault:!1}})),Array.isArray(o[r])?o[r].push(e.props):o[r]=e.props)})),o}(i(l.default?.()||[]));return{...t.options,columns:e.columns.length?e.columns:t.options.columns,tooltip:e.tooltip||t.options.tooltip,menu:e.menu||t.options.menu}}));return o({vTableInstance:n.computed((()=>r.value?.vTableInstance||null))}),(e,o)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createVNode(d,n.mergeProps({type:"list",options:a.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))}}),C=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:o}){const t=e,r=n.shallowRef(null),l=n.useSlots(),u=n.computed((()=>{const e=i(l.default?.()||[]),o={columns:[],columnHeaderTitle:[],rows:[],rowHeaderTitle:[],indicators:[],corner:Object,tooltip:Object,menu:Object},n={PivotColumnDimension:"columns",PivotColumnHeaderTitle:"columnHeaderTitle",PivotRowDimension:"rows",PivotRowHeaderTitle:"rowHeaderTitle",PivotCorner:"corner",PivotIndicator:"indicators",Tooltip:"tooltip",Menu:"menu"};return e.forEach((e=>{const t=e.type?.name||e.type?.__name,r=n[t];r&&(Array.isArray(o[r])?o[r].push(e.props):o[r]=e.props)})),{...t.options,columns:o.columns.length?o.columns:t.options.columns,columnHeaderTitle:o.columnHeaderTitle.length?o.columnHeaderTitle:t.options.columnHeaderTitle,rows:o.rows.length?o.rows:t.options.rows,rowHeaderTitle:o.rowHeaderTitle.length?o.rowHeaderTitle:t.options.rowHeaderTitle,indicators:o.indicators.length?o.indicators:t.options.indicators,corner:t.options.corner||o.corner,tooltip:t.options.tooltip||o.tooltip,menu:t.options.menu||o.menu}}));return o({vTableInstance:n.computed((()=>r.value?.vTableInstance||null))}),(e,o)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createVNode(d,n.mergeProps({type:"pivot",options:u.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))}}),E=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:o}){const t=e,r=n.shallowRef(null),l=n.useSlots(),u=n.computed((()=>{const e=i(l.default?.()||[]),o={columns:[],columnHeaderTitle:[],rows:[],rowHeaderTitle:[],indicators:[],corner:Object,tooltip:Object,menu:Object},n={PivotColumnDimension:"columns",PivotColumnHeaderTitle:"columnHeaderTitle",PivotRowDimension:"rows",PivotRowHeaderTitle:"rowHeaderTitle",PivotCorner:"corner",PivotIndicator:"indicators",Tooltip:"tooltip",Menu:"menu"};return e.forEach((e=>{const t=e.type?.name||e.type?.__name,r=n[t];r&&(Array.isArray(o[r])?e.props.hasOwnProperty("objectHandler")?o[r].push(e.props.objectHandler):o[r].push(e.props):o[r]=e.props)})),{...t.options,columns:o.columns.length?o.columns:t.options.columns,columnHeaderTitle:o.columnHeaderTitle.length?o.columnHeaderTitle:t.options.columnHeaderTitle,rows:o.rows.length?o.rows:t.options.rows,rowHeaderTitle:o.rowHeaderTitle.length?o.rowHeaderTitle:t.options.rowHeaderTitle,indicators:o.indicators.length?o.indicators:t.options.indicators,corner:o.corner||t.options.corner,tooltip:o.tooltip||t.options.tooltip,menu:o.menu||t.options.menu}}));return o({vTableInstance:n.computed((()=>r.value?.vTableInstance||null))}),(e,o)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createVNode(d,n.mergeProps({type:"chart",options:u.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))}});e.VTable=l,Object.defineProperty(e,"register",{enumerable:!0,get:function(){return o.register}}),e.CheckBox=function(e){return null},e.Group=function(){return null},e.Image=function(){return null},e.ListColumn=function(e){return null},e.ListTable=p,e.Menu=function(e){return null},e.PivotChart=E,e.PivotColumnDimension=function(e){return null},e.PivotColumnHeaderTitle=function(e){return null},e.PivotCorner=function(e){return null},e.PivotIndicator=function(e){return null},e.PivotRowDimension=function(e){return null},e.PivotRowHeaderTitle=function(e){return null},e.PivotTable=C,e.Radio=function(e){return null},e.Tag=function(e){return null},e.Text=function(){return null},e.Tooltip=function(e){return null},e.registerChartModule=(e,o)=>{l.register.chartModule(e,o)},e.version="1.8.0"}));
|
package/es/index.d.ts
CHANGED
package/es/index.js
CHANGED
|
@@ -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.
|
|
24
|
+
const version = "1.8.0";
|
|
25
25
|
|
|
26
26
|
export { version };
|
|
@@ -50,7 +50,7 @@ var _sfc_main = defineComponent({
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
|
-
return Object.assign(Object.assign({}, props.options), { columns: options.columns.length ? options.columns : props.options.columns, columnHeaderTitle: options.columnHeaderTitle.length ? options.columnHeaderTitle : props.options.columnHeaderTitle, rows: options.rows.length ? options.rows : props.options.rows, rowHeaderTitle: options.rowHeaderTitle.length ? options.rowHeaderTitle : props.options.rowHeaderTitle, indicators: options.indicators.length ? options.indicators : props.options.indicators, corner: options.corner ||
|
|
53
|
+
return Object.assign(Object.assign({}, props.options), { columns: options.columns.length ? options.columns : props.options.columns, columnHeaderTitle: options.columnHeaderTitle.length ? options.columnHeaderTitle : props.options.columnHeaderTitle, rows: options.rows.length ? options.rows : props.options.rows, rowHeaderTitle: options.rowHeaderTitle.length ? options.rowHeaderTitle : props.options.rowHeaderTitle, indicators: options.indicators.length ? options.indicators : props.options.indicators, corner: props.options.corner || options.corner, tooltip: props.options.tooltip || options.tooltip, menu: props.options.menu || options.menu });
|
|
54
54
|
});
|
|
55
55
|
__expose({ vTableInstance: computed(() => { var _a; return ((_a = baseTableRef.value) === null || _a === void 0 ? void 0 : _a.vTableInstance) || null; }) });
|
|
56
56
|
return (_ctx, _cache) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visactor/vue-vtable",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "The vue version of VTable",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vue",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"access": "public"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@visactor/
|
|
47
|
-
"@visactor/
|
|
46
|
+
"@visactor/vutils": "~0.18.14",
|
|
47
|
+
"@visactor/vtable": "1.8.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@arco-design/web-vue": "^2.11.0",
|
|
@@ -88,8 +88,8 @@
|
|
|
88
88
|
"eslint-plugin-vue": "^9.26.0",
|
|
89
89
|
"vue-eslint-parser": "^9.4.2",
|
|
90
90
|
"@internal/bundler": "0.0.1",
|
|
91
|
-
"@internal/
|
|
92
|
-
"@internal/
|
|
91
|
+
"@internal/ts-config": "0.0.1",
|
|
92
|
+
"@internal/eslint-config": "0.0.1"
|
|
93
93
|
},
|
|
94
94
|
"scripts": {
|
|
95
95
|
"start": "vite ./demo",
|