@visactor/vue-vtable 1.8.0 → 1.8.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/components/component/menu.d.ts +5 -1
- package/cjs/components/component/menu.js +2 -1
- package/cjs/components/component/tooltip.d.ts +5 -1
- package/cjs/components/component/tooltip.js +2 -1
- package/cjs/components/custom/checkBox.d.ts +5 -1
- package/cjs/components/custom/checkBox.js +2 -1
- package/cjs/components/custom/custom-layout.d.ts +5 -1
- package/cjs/components/custom/group.d.ts +5 -1
- package/cjs/components/custom/group.js +2 -1
- package/cjs/components/custom/image.d.ts +5 -1
- package/cjs/components/custom/image.js +2 -1
- package/cjs/components/custom/radio.d.ts +5 -1
- package/cjs/components/custom/radio.js +2 -1
- package/cjs/components/custom/tag.d.ts +5 -1
- package/cjs/components/custom/tag.js +2 -1
- package/cjs/components/custom/text.d.ts +5 -1
- package/cjs/components/custom/text.js +2 -1
- package/cjs/components/list/list-column.d.ts +5 -1
- package/cjs/components/list/list-column.js +2 -1
- package/cjs/components/pivot/pivot-column-dimension.d.ts +5 -2
- package/cjs/components/pivot/pivot-column-dimension.js +2 -1
- package/cjs/components/pivot/pivot-column-header-title.d.ts +5 -1
- package/cjs/components/pivot/pivot-column-header-title.js +2 -1
- package/cjs/components/pivot/pivot-corner.d.ts +5 -1
- package/cjs/components/pivot/pivot-corner.js +2 -1
- package/cjs/components/pivot/pivot-indicator.d.ts +5 -1
- package/cjs/components/pivot/pivot-indicator.js +2 -1
- package/cjs/components/pivot/pivot-row-dimension.d.ts +5 -2
- package/cjs/components/pivot/pivot-row-dimension.js +2 -1
- package/cjs/components/pivot/pivot-row-header-title.d.ts +5 -1
- package/cjs/components/pivot/pivot-row-header-title.js +2 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/tables/list-table.vue.js +1 -1
- package/cjs/tables/pivot-chart.vue.js +1 -1
- package/cjs/tables/pivot-table.vue.js +1 -1
- package/cjs/tables/utils.js +1 -1
- package/dist/vue-vtable.js +35 -20
- package/dist/vue-vtable.min.js +1 -1
- package/es/components/component/menu.d.ts +5 -1
- package/es/components/component/menu.js +2 -1
- package/es/components/component/tooltip.d.ts +5 -1
- package/es/components/component/tooltip.js +2 -1
- package/es/components/custom/checkBox.d.ts +5 -1
- package/es/components/custom/checkBox.js +2 -1
- package/es/components/custom/custom-layout.d.ts +5 -1
- package/es/components/custom/group.d.ts +5 -1
- package/es/components/custom/group.js +2 -1
- package/es/components/custom/image.d.ts +5 -1
- package/es/components/custom/image.js +2 -1
- package/es/components/custom/radio.d.ts +5 -1
- package/es/components/custom/radio.js +2 -1
- package/es/components/custom/tag.d.ts +5 -1
- package/es/components/custom/tag.js +2 -1
- package/es/components/custom/text.d.ts +5 -1
- package/es/components/custom/text.js +2 -1
- package/es/components/list/list-column.d.ts +5 -1
- package/es/components/list/list-column.js +2 -1
- package/es/components/pivot/pivot-column-dimension.d.ts +5 -2
- package/es/components/pivot/pivot-column-dimension.js +2 -1
- package/es/components/pivot/pivot-column-header-title.d.ts +5 -1
- package/es/components/pivot/pivot-column-header-title.js +2 -1
- package/es/components/pivot/pivot-corner.d.ts +5 -1
- package/es/components/pivot/pivot-corner.js +2 -1
- package/es/components/pivot/pivot-indicator.d.ts +5 -1
- package/es/components/pivot/pivot-indicator.js +2 -1
- package/es/components/pivot/pivot-row-dimension.d.ts +5 -2
- package/es/components/pivot/pivot-row-dimension.js +2 -1
- package/es/components/pivot/pivot-row-header-title.d.ts +5 -1
- package/es/components/pivot/pivot-row-header-title.js +2 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/tables/list-table.vue.js +1 -1
- package/es/tables/pivot-chart.vue.js +1 -1
- package/es/tables/pivot-table.vue.js +1 -1
- package/es/tables/utils.js +1 -1
- package/package.json +2 -2
|
@@ -6,4 +6,8 @@ export type MenuProps = {
|
|
|
6
6
|
contextMenuItems?: TYPES.MenuListItem[] | ((field: string, row: number, col: number) => TYPES.MenuListItem[]);
|
|
7
7
|
dropDownMenuHighlight?: TYPES.DropDownMenuHighlightInfo[];
|
|
8
8
|
};
|
|
9
|
-
|
|
9
|
+
declare function Menu(props: MenuProps): VNode;
|
|
10
|
+
declare namespace Menu {
|
|
11
|
+
var symbol: string;
|
|
12
|
+
}
|
|
13
|
+
export default Menu;
|
|
@@ -4,4 +4,8 @@ export type TooltipProps = {
|
|
|
4
4
|
isShowOverflowTextTooltip?: boolean;
|
|
5
5
|
confine?: boolean;
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
declare function Tooltip(props: TooltipProps): VNode;
|
|
8
|
+
declare namespace Tooltip {
|
|
9
|
+
var symbol: string;
|
|
10
|
+
}
|
|
11
|
+
export default Tooltip;
|
|
@@ -13,4 +13,8 @@ export interface CheckboxProps {
|
|
|
13
13
|
visible?: boolean;
|
|
14
14
|
onChange?: (checked: boolean) => void;
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
declare function CheckBox(props: CheckboxProps): VNode;
|
|
17
|
+
declare namespace CheckBox {
|
|
18
|
+
var symbol: string;
|
|
19
|
+
}
|
|
20
|
+
export default CheckBox;
|
|
@@ -13,4 +13,8 @@ export interface CustomComponentProps {
|
|
|
13
13
|
dx?: number | string;
|
|
14
14
|
dy?: number | string;
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
declare function CustomLayout(props: CustomComponentProps): VNode;
|
|
17
|
+
declare namespace CustomLayout {
|
|
18
|
+
var symbol: string;
|
|
19
|
+
}
|
|
20
|
+
export default CustomLayout;
|
|
@@ -10,4 +10,8 @@ export interface RadioProps {
|
|
|
10
10
|
visible?: boolean;
|
|
11
11
|
onChange?: (checked: boolean) => void;
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
declare function Radio(props: RadioProps): any;
|
|
14
|
+
declare namespace Radio {
|
|
15
|
+
var symbol: string;
|
|
16
|
+
}
|
|
17
|
+
export default Radio;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import type { VNode } from 'vue';
|
|
2
2
|
import type { ColumnDefine } from '@visactor/vtable';
|
|
3
|
-
|
|
3
|
+
declare function ListColumn(props: ColumnDefine): VNode;
|
|
4
|
+
declare namespace ListColumn {
|
|
5
|
+
var symbol: string;
|
|
6
|
+
}
|
|
7
|
+
export default ListColumn;
|
|
@@ -4,5 +4,8 @@ interface ObjectHandler {
|
|
|
4
4
|
objectHandler?: string | Array<string>;
|
|
5
5
|
}
|
|
6
6
|
export type PivotColumnDimensionProps = IDimension & ObjectHandler;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
declare function PivotColumnDimension(props: PivotColumnDimensionProps): VNode;
|
|
8
|
+
declare namespace PivotColumnDimension {
|
|
9
|
+
var symbol: string;
|
|
10
|
+
}
|
|
11
|
+
export default PivotColumnDimension;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import type { VNode } from 'vue';
|
|
2
2
|
import type { ITitleDefine } from '@visactor/vtable';
|
|
3
|
-
|
|
3
|
+
declare function PivotColumnHeaderTitle(props: ITitleDefine): VNode;
|
|
4
|
+
declare namespace PivotColumnHeaderTitle {
|
|
5
|
+
var symbol: string;
|
|
6
|
+
}
|
|
7
|
+
export default PivotColumnHeaderTitle;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import type { VNode } from 'vue';
|
|
2
2
|
import type { ICornerDefine } from '@visactor/vtable';
|
|
3
|
-
|
|
3
|
+
declare function PivotCorner(props: ICornerDefine): VNode;
|
|
4
|
+
declare namespace PivotCorner {
|
|
5
|
+
var symbol: string;
|
|
6
|
+
}
|
|
7
|
+
export default PivotCorner;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import type { VNode } from 'vue';
|
|
2
2
|
import type { IIndicator } from '@visactor/vtable';
|
|
3
|
-
|
|
3
|
+
declare function PivotIndicator(props: IIndicator): VNode;
|
|
4
|
+
declare namespace PivotIndicator {
|
|
5
|
+
var symbol: string;
|
|
6
|
+
}
|
|
7
|
+
export default PivotIndicator;
|
|
@@ -4,5 +4,8 @@ interface ObjectHandler {
|
|
|
4
4
|
objectHandler?: string | Array<string>;
|
|
5
5
|
}
|
|
6
6
|
export type PivotColumnDimensionProps = IDimension & ObjectHandler;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
declare function PivotRowDimension(props: PivotColumnDimensionProps): VNode;
|
|
8
|
+
declare namespace PivotRowDimension {
|
|
9
|
+
var symbol: string;
|
|
10
|
+
}
|
|
11
|
+
export default PivotRowDimension;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import type { VNode } from 'vue';
|
|
2
2
|
import type { ITitleDefine } from '@visactor/vtable';
|
|
3
|
-
|
|
3
|
+
declare function PivotRowHeaderTitle(props: ITitleDefine): VNode;
|
|
4
|
+
declare namespace PivotRowHeaderTitle {
|
|
5
|
+
var symbol: string;
|
|
6
|
+
}
|
|
7
|
+
export default PivotRowHeaderTitle;
|
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.8.
|
|
43
|
+
const version = "1.8.1";
|
|
44
44
|
|
|
45
45
|
exports.VTable = VTable__namespace;
|
|
46
46
|
Object.defineProperty(exports, 'register', {
|
|
@@ -35,7 +35,7 @@ var _sfc_main = vue.defineComponent({
|
|
|
35
35
|
};
|
|
36
36
|
vnodes.forEach(vnode => {
|
|
37
37
|
var _a, _b;
|
|
38
|
-
const typeName = ((_a = vnode.type) === null || _a === void 0 ? void 0 : _a.
|
|
38
|
+
const typeName = ((_a = vnode.type) === null || _a === void 0 ? void 0 : _a.symbol) || ((_b = vnode.type) === null || _b === void 0 ? void 0 : _b.name);
|
|
39
39
|
const optionKey = typeMapping[typeName];
|
|
40
40
|
if (optionKey) {
|
|
41
41
|
if (optionKey === 'columns' && vnode.children) {
|
|
@@ -41,7 +41,7 @@ var _sfc_main = vue.defineComponent({
|
|
|
41
41
|
};
|
|
42
42
|
flattenedSlots.forEach(vnode => {
|
|
43
43
|
var _a, _b;
|
|
44
|
-
const typeName = ((_a = vnode.type) === null || _a === void 0 ? void 0 : _a.
|
|
44
|
+
const typeName = ((_a = vnode.type) === null || _a === void 0 ? void 0 : _a.symbol) || ((_b = vnode.type) === null || _b === void 0 ? void 0 : _b.name);
|
|
45
45
|
const optionKey = typeMapping[typeName];
|
|
46
46
|
if (optionKey) {
|
|
47
47
|
if (Array.isArray(options[optionKey])) {
|
|
@@ -41,7 +41,7 @@ var _sfc_main = vue.defineComponent({
|
|
|
41
41
|
};
|
|
42
42
|
flattenedSlots.forEach(vnode => {
|
|
43
43
|
var _a, _b;
|
|
44
|
-
const typeName = ((_a = vnode.type) === null || _a === void 0 ? void 0 : _a.
|
|
44
|
+
const typeName = ((_a = vnode.type) === null || _a === void 0 ? void 0 : _a.symbol) || ((_b = vnode.type) === null || _b === void 0 ? void 0 : _b.name);
|
|
45
45
|
const optionKey = typeMapping[typeName];
|
|
46
46
|
if (optionKey) {
|
|
47
47
|
if (Array.isArray(options[optionKey])) {
|
package/cjs/tables/utils.js
CHANGED
|
@@ -42,7 +42,7 @@ function createCustomLayout(children) {
|
|
|
42
42
|
return null;
|
|
43
43
|
}
|
|
44
44
|
const { type, props, children: childChildren } = child;
|
|
45
|
-
const componentName = (type === null || type === void 0 ? void 0 : type.
|
|
45
|
+
const componentName = (type === null || type === void 0 ? void 0 : type.symbol) || (type === null || type === void 0 ? void 0 : type.name);
|
|
46
46
|
const ComponentClass = componentMap[componentName];
|
|
47
47
|
if (!ComponentClass) {
|
|
48
48
|
return null;
|
package/dist/vue-vtable.js
CHANGED
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
return null;
|
|
44
44
|
}
|
|
45
45
|
const { type, props, children: childChildren } = child;
|
|
46
|
-
const componentName = type?.
|
|
46
|
+
const componentName = type?.symbol || type?.name;
|
|
47
47
|
const ComponentClass = componentMap[componentName];
|
|
48
48
|
if (!ComponentClass) {
|
|
49
49
|
return null;
|
|
@@ -339,7 +339,7 @@
|
|
|
339
339
|
Menu: 'menu',
|
|
340
340
|
};
|
|
341
341
|
vnodes.forEach(vnode => {
|
|
342
|
-
const typeName = vnode.type?.
|
|
342
|
+
const typeName = vnode.type?.symbol || vnode.type?.name;
|
|
343
343
|
const optionKey = typeMapping[typeName];
|
|
344
344
|
if (optionKey) {
|
|
345
345
|
if (optionKey === 'columns' && vnode.children) {
|
|
@@ -423,7 +423,7 @@
|
|
|
423
423
|
'Menu': 'menu',
|
|
424
424
|
};
|
|
425
425
|
flattenedSlots.forEach(vnode => {
|
|
426
|
-
const typeName = vnode.type?.
|
|
426
|
+
const typeName = vnode.type?.symbol || vnode.type?.name;
|
|
427
427
|
const optionKey = typeMapping[typeName];
|
|
428
428
|
if (optionKey) {
|
|
429
429
|
if (Array.isArray(options[optionKey])) {
|
|
@@ -499,7 +499,7 @@
|
|
|
499
499
|
'Menu': 'menu',
|
|
500
500
|
};
|
|
501
501
|
flattenedSlots.forEach(vnode => {
|
|
502
|
-
const typeName = vnode.type?.
|
|
502
|
+
const typeName = vnode.type?.symbol || vnode.type?.name;
|
|
503
503
|
const optionKey = typeMapping[typeName];
|
|
504
504
|
if (optionKey) {
|
|
505
505
|
if (Array.isArray(options[optionKey])) {
|
|
@@ -551,65 +551,80 @@
|
|
|
551
551
|
|
|
552
552
|
function ListColumn(props) {
|
|
553
553
|
return null;
|
|
554
|
-
}
|
|
554
|
+
}
|
|
555
|
+
ListColumn.symbol = 'ListColumn';
|
|
555
556
|
|
|
556
557
|
function PivotColumnDimension(props) {
|
|
557
558
|
return null;
|
|
558
|
-
}
|
|
559
|
+
}
|
|
560
|
+
PivotColumnDimension.symbol = 'PivotColumnDimension';
|
|
559
561
|
|
|
560
562
|
function PivotRowDimension(props) {
|
|
561
563
|
return null;
|
|
562
|
-
}
|
|
564
|
+
}
|
|
565
|
+
PivotRowDimension.symbol = 'PivotRowDimension';
|
|
563
566
|
|
|
564
567
|
function PivotColumnHeaderTitle(props) {
|
|
565
568
|
return null;
|
|
566
|
-
}
|
|
569
|
+
}
|
|
570
|
+
PivotColumnHeaderTitle.symbol = 'PivotColumnHeaderTitle';
|
|
567
571
|
|
|
568
572
|
function PivotRowHeaderTitle(props) {
|
|
569
573
|
return null;
|
|
570
|
-
}
|
|
574
|
+
}
|
|
575
|
+
PivotRowHeaderTitle.symbol = 'PivotRowHeaderTitle';
|
|
571
576
|
|
|
572
577
|
function PivotIndicator(props) {
|
|
573
578
|
return null;
|
|
574
|
-
}
|
|
579
|
+
}
|
|
580
|
+
PivotIndicator.symbol = 'PivotIndicator';
|
|
575
581
|
|
|
576
582
|
function PivotCorner(props) {
|
|
577
583
|
return null;
|
|
578
|
-
}
|
|
584
|
+
}
|
|
585
|
+
PivotCorner.symbol = 'PivotCorner';
|
|
579
586
|
|
|
580
587
|
function Menu(props) {
|
|
581
588
|
return null;
|
|
582
|
-
}
|
|
589
|
+
}
|
|
590
|
+
Menu.symbol = 'Menu';
|
|
583
591
|
|
|
584
592
|
function Tooltip(props) {
|
|
585
593
|
return null;
|
|
586
|
-
}
|
|
594
|
+
}
|
|
595
|
+
Tooltip.symbol = 'Tooltip';
|
|
587
596
|
|
|
588
597
|
function Group() {
|
|
589
598
|
return null;
|
|
590
|
-
}
|
|
599
|
+
}
|
|
600
|
+
Group.symbol = 'Group';
|
|
591
601
|
|
|
592
602
|
function Image() {
|
|
593
603
|
return null;
|
|
594
|
-
}
|
|
604
|
+
}
|
|
605
|
+
Image.symbol = 'Image';
|
|
595
606
|
|
|
596
607
|
function Text() {
|
|
597
608
|
return null;
|
|
598
|
-
}
|
|
609
|
+
}
|
|
610
|
+
Text.symbol = 'Text';
|
|
599
611
|
|
|
600
612
|
function Tag(props) {
|
|
601
613
|
return null;
|
|
602
|
-
}
|
|
614
|
+
}
|
|
615
|
+
Tag.symbol = 'Tag';
|
|
603
616
|
|
|
604
617
|
function Radio(props) {
|
|
605
618
|
return null;
|
|
606
|
-
}
|
|
619
|
+
}
|
|
620
|
+
Radio.symbol = 'Radio';
|
|
607
621
|
|
|
608
622
|
function CheckBox(props) {
|
|
609
623
|
return null;
|
|
610
|
-
}
|
|
624
|
+
}
|
|
625
|
+
CheckBox.symbol = 'CheckBox';
|
|
611
626
|
|
|
612
|
-
const version = "1.8.
|
|
627
|
+
const version = "1.8.1";
|
|
613
628
|
|
|
614
629
|
exports.VTable = VTable__namespace;
|
|
615
630
|
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: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"}));
|
|
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?.symbol||r?.name];if(!u)return null;const s=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])}}))}(s,l);return function(e){return e?.default?.()||e||[]}(i).forEach((o=>{const n=e(o);n?s.add(n):o.type===Symbol.for("v-fgt")&&o.children.forEach((o=>{const n=e(o);n&&s.add(n)}))})),s}(e)}}const s={...o.ListTable.EVENT_TYPE,...o.PivotTable.EVENT_TYPE,...o.PivotChart.EVENT_TYPE},a={onClickCell:s.CLICK_CELL,onDblClickCell:s.DBLCLICK_CELL,onMouseDownCell:s.MOUSEDOWN_CELL,onMouseUpCell:s.MOUSEUP_CELL,onSelectedCell:s.SELECTED_CELL,onKeyDown:s.KEYDOWN,onMouseEnterTable:s.MOUSEENTER_TABLE,onMouseLeaveTable:s.MOUSELEAVE_TABLE,onMouseDownTable:s.MOUSEDOWN_TABLE,onMouseMoveCell:s.MOUSEMOVE_CELL,onMouseEnterCell:s.MOUSEENTER_CELL,onMouseLeaveCell:s.MOUSELEAVE_CELL,onContextMenuCell:s.CONTEXTMENU_CELL,onResizeColumn:s.RESIZE_COLUMN,onResizeColumnEnd:s.RESIZE_COLUMN_END,onChangeHeaderPosition:s.CHANGE_HEADER_POSITION,onSortClick:s.SORT_CLICK,onFreezeClick:s.FREEZE_CLICK,onScroll:s.SCROLL,onDropdownMenuClick:s.DROPDOWN_MENU_CLICK,onMouseOverChartSymbol:s.MOUSEOVER_CHART_SYMBOL,onDragSelectEnd:s.DRAG_SELECT_END,onDropdownIconClick:s.DROPDOWN_ICON_CLICK,onDropdownMenuClear:s.DROPDOWN_MENU_CLEAR,onTreeHierarchyStateChange:s.TREE_HIERARCHY_STATE_CHANGE,onShowMenu:s.SHOW_MENU,onHideMenu:s.HIDE_MENU,onIconClick:s.ICON_CLICK,onLegendItemClick:s.LEGEND_ITEM_CLICK,onLegendItemHover:s.LEGEND_ITEM_HOVER,onLegendItemUnHover:s.LEGEND_ITEM_UNHOVER,onLegendChange:s.LEGEND_CHANGE,onMouseEnterAxis:s.MOUSEENTER_AXIS,onMouseLeaveAxis:s.MOUSELEAVE_AXIS,onCheckboxStateChange:s.CHECKBOX_STATE_CHANGE,onRadioStateChange:s.RADIO_STATE_CHANGE,onAfterRender:s.AFTER_RENDER,onInitialized:s.INITIALIZED,onPivotSortClick:s.PIVOT_SORT_CLICK,onDrillMenuClick:s.DRILLMENU_CLICK,onVChartEventType:s.VCHART_EVENT_TYPE,onChangCellValue:s.CHANGE_CELL_VALUE,onMousedownFillHandle:s.MOUSEDOWN_FILL_HANDLE,onDragFillHandleEnd:s.DRAG_FILL_HANDLE_END,onDblclickFillHandle:s.DBLCLICK_FILL_HANDLE,onScrollVerticalEnd:s.SCROLL_VERTICAL_END,onScrollHorizontalEnd:s.SCROLL_HORIZONTAL_END},c=Object.keys(a);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 s=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(a[e],(o=>{p(e,o)}))})),l.onReady?.(u.value,!0)}catch(e){}var t},m=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?m(e):C()}),{deep:!0}),n.watch((()=>l.records),((e,o)=>{u.value?m({...l.options,records:e}):C()}),{deep:!0}),(e,o)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"vTableContainer",ref:i,style:n.normalizeStyle([{width:s.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(),s=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?.symbol||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:s,width:a}=r??o.getCellRect(t,n),c=l.customLayout({table:o,row:n,col:t,rect:r,record:i,height:s,width:a})[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:s.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?.symbol||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))}}),m=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?.symbol||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))}});function y(e){return null}function E(e){return null}function h(e){return null}function T(e){return null}function v(e){return null}function b(e){return null}function L(e){return null}function f(e){return null}function g(e){return null}function _(){return null}function w(){return null}function H(){return null}function M(e){return null}function O(e){return null}function S(e){return null}y.symbol="ListColumn",E.symbol="PivotColumnDimension",h.symbol="PivotRowDimension",T.symbol="PivotColumnHeaderTitle",v.symbol="PivotRowHeaderTitle",b.symbol="PivotIndicator",L.symbol="PivotCorner",f.symbol="Menu",g.symbol="Tooltip",_.symbol="Group",w.symbol="Image",H.symbol="Text",M.symbol="Tag",O.symbol="Radio",S.symbol="CheckBox";e.VTable=l,Object.defineProperty(e,"register",{enumerable:!0,get:function(){return o.register}}),e.CheckBox=S,e.Group=_,e.Image=w,e.ListColumn=y,e.ListTable=p,e.Menu=f,e.PivotChart=m,e.PivotColumnDimension=E,e.PivotColumnHeaderTitle=T,e.PivotCorner=L,e.PivotIndicator=b,e.PivotRowDimension=h,e.PivotRowHeaderTitle=v,e.PivotTable=C,e.Radio=O,e.Tag=M,e.Text=H,e.Tooltip=g,e.registerChartModule=(e,o)=>{l.register.chartModule(e,o)},e.version="1.8.1"}));
|
|
@@ -6,4 +6,8 @@ export type MenuProps = {
|
|
|
6
6
|
contextMenuItems?: TYPES.MenuListItem[] | ((field: string, row: number, col: number) => TYPES.MenuListItem[]);
|
|
7
7
|
dropDownMenuHighlight?: TYPES.DropDownMenuHighlightInfo[];
|
|
8
8
|
};
|
|
9
|
-
|
|
9
|
+
declare function Menu(props: MenuProps): VNode;
|
|
10
|
+
declare namespace Menu {
|
|
11
|
+
var symbol: string;
|
|
12
|
+
}
|
|
13
|
+
export default Menu;
|
|
@@ -4,4 +4,8 @@ export type TooltipProps = {
|
|
|
4
4
|
isShowOverflowTextTooltip?: boolean;
|
|
5
5
|
confine?: boolean;
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
declare function Tooltip(props: TooltipProps): VNode;
|
|
8
|
+
declare namespace Tooltip {
|
|
9
|
+
var symbol: string;
|
|
10
|
+
}
|
|
11
|
+
export default Tooltip;
|
|
@@ -13,4 +13,8 @@ export interface CheckboxProps {
|
|
|
13
13
|
visible?: boolean;
|
|
14
14
|
onChange?: (checked: boolean) => void;
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
declare function CheckBox(props: CheckboxProps): VNode;
|
|
17
|
+
declare namespace CheckBox {
|
|
18
|
+
var symbol: string;
|
|
19
|
+
}
|
|
20
|
+
export default CheckBox;
|
|
@@ -13,4 +13,8 @@ export interface CustomComponentProps {
|
|
|
13
13
|
dx?: number | string;
|
|
14
14
|
dy?: number | string;
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
declare function CustomLayout(props: CustomComponentProps): VNode;
|
|
17
|
+
declare namespace CustomLayout {
|
|
18
|
+
var symbol: string;
|
|
19
|
+
}
|
|
20
|
+
export default CustomLayout;
|
|
@@ -10,4 +10,8 @@ export interface RadioProps {
|
|
|
10
10
|
visible?: boolean;
|
|
11
11
|
onChange?: (checked: boolean) => void;
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
declare function Radio(props: RadioProps): any;
|
|
14
|
+
declare namespace Radio {
|
|
15
|
+
var symbol: string;
|
|
16
|
+
}
|
|
17
|
+
export default Radio;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import type { VNode } from 'vue';
|
|
2
2
|
import type { ColumnDefine } from '@visactor/vtable';
|
|
3
|
-
|
|
3
|
+
declare function ListColumn(props: ColumnDefine): VNode;
|
|
4
|
+
declare namespace ListColumn {
|
|
5
|
+
var symbol: string;
|
|
6
|
+
}
|
|
7
|
+
export default ListColumn;
|
|
@@ -4,5 +4,8 @@ interface ObjectHandler {
|
|
|
4
4
|
objectHandler?: string | Array<string>;
|
|
5
5
|
}
|
|
6
6
|
export type PivotColumnDimensionProps = IDimension & ObjectHandler;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
declare function PivotColumnDimension(props: PivotColumnDimensionProps): VNode;
|
|
8
|
+
declare namespace PivotColumnDimension {
|
|
9
|
+
var symbol: string;
|
|
10
|
+
}
|
|
11
|
+
export default PivotColumnDimension;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import type { VNode } from 'vue';
|
|
2
2
|
import type { ITitleDefine } from '@visactor/vtable';
|
|
3
|
-
|
|
3
|
+
declare function PivotColumnHeaderTitle(props: ITitleDefine): VNode;
|
|
4
|
+
declare namespace PivotColumnHeaderTitle {
|
|
5
|
+
var symbol: string;
|
|
6
|
+
}
|
|
7
|
+
export default PivotColumnHeaderTitle;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import type { VNode } from 'vue';
|
|
2
2
|
import type { ICornerDefine } from '@visactor/vtable';
|
|
3
|
-
|
|
3
|
+
declare function PivotCorner(props: ICornerDefine): VNode;
|
|
4
|
+
declare namespace PivotCorner {
|
|
5
|
+
var symbol: string;
|
|
6
|
+
}
|
|
7
|
+
export default PivotCorner;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import type { VNode } from 'vue';
|
|
2
2
|
import type { IIndicator } from '@visactor/vtable';
|
|
3
|
-
|
|
3
|
+
declare function PivotIndicator(props: IIndicator): VNode;
|
|
4
|
+
declare namespace PivotIndicator {
|
|
5
|
+
var symbol: string;
|
|
6
|
+
}
|
|
7
|
+
export default PivotIndicator;
|
|
@@ -4,5 +4,8 @@ interface ObjectHandler {
|
|
|
4
4
|
objectHandler?: string | Array<string>;
|
|
5
5
|
}
|
|
6
6
|
export type PivotColumnDimensionProps = IDimension & ObjectHandler;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
declare function PivotRowDimension(props: PivotColumnDimensionProps): VNode;
|
|
8
|
+
declare namespace PivotRowDimension {
|
|
9
|
+
var symbol: string;
|
|
10
|
+
}
|
|
11
|
+
export default PivotRowDimension;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import type { VNode } from 'vue';
|
|
2
2
|
import type { ITitleDefine } from '@visactor/vtable';
|
|
3
|
-
|
|
3
|
+
declare function PivotRowHeaderTitle(props: ITitleDefine): VNode;
|
|
4
|
+
declare namespace PivotRowHeaderTitle {
|
|
5
|
+
var symbol: string;
|
|
6
|
+
}
|
|
7
|
+
export default PivotRowHeaderTitle;
|
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.8.
|
|
24
|
+
const version = "1.8.1";
|
|
25
25
|
|
|
26
26
|
export { version };
|
|
@@ -33,7 +33,7 @@ var _sfc_main = defineComponent({
|
|
|
33
33
|
};
|
|
34
34
|
vnodes.forEach(vnode => {
|
|
35
35
|
var _a, _b;
|
|
36
|
-
const typeName = ((_a = vnode.type) === null || _a === void 0 ? void 0 : _a.
|
|
36
|
+
const typeName = ((_a = vnode.type) === null || _a === void 0 ? void 0 : _a.symbol) || ((_b = vnode.type) === null || _b === void 0 ? void 0 : _b.name);
|
|
37
37
|
const optionKey = typeMapping[typeName];
|
|
38
38
|
if (optionKey) {
|
|
39
39
|
if (optionKey === 'columns' && vnode.children) {
|
|
@@ -39,7 +39,7 @@ var _sfc_main = defineComponent({
|
|
|
39
39
|
};
|
|
40
40
|
flattenedSlots.forEach(vnode => {
|
|
41
41
|
var _a, _b;
|
|
42
|
-
const typeName = ((_a = vnode.type) === null || _a === void 0 ? void 0 : _a.
|
|
42
|
+
const typeName = ((_a = vnode.type) === null || _a === void 0 ? void 0 : _a.symbol) || ((_b = vnode.type) === null || _b === void 0 ? void 0 : _b.name);
|
|
43
43
|
const optionKey = typeMapping[typeName];
|
|
44
44
|
if (optionKey) {
|
|
45
45
|
if (Array.isArray(options[optionKey])) {
|
|
@@ -39,7 +39,7 @@ var _sfc_main = defineComponent({
|
|
|
39
39
|
};
|
|
40
40
|
flattenedSlots.forEach(vnode => {
|
|
41
41
|
var _a, _b;
|
|
42
|
-
const typeName = ((_a = vnode.type) === null || _a === void 0 ? void 0 : _a.
|
|
42
|
+
const typeName = ((_a = vnode.type) === null || _a === void 0 ? void 0 : _a.symbol) || ((_b = vnode.type) === null || _b === void 0 ? void 0 : _b.name);
|
|
43
43
|
const optionKey = typeMapping[typeName];
|
|
44
44
|
if (optionKey) {
|
|
45
45
|
if (Array.isArray(options[optionKey])) {
|
package/es/tables/utils.js
CHANGED
|
@@ -21,7 +21,7 @@ function createCustomLayout(children) {
|
|
|
21
21
|
return null;
|
|
22
22
|
}
|
|
23
23
|
const { type, props, children: childChildren } = child;
|
|
24
|
-
const componentName = (type === null || type === void 0 ? void 0 : type.
|
|
24
|
+
const componentName = (type === null || type === void 0 ? void 0 : type.symbol) || (type === null || type === void 0 ? void 0 : type.name);
|
|
25
25
|
const ComponentClass = componentMap[componentName];
|
|
26
26
|
if (!ComponentClass) {
|
|
27
27
|
return null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visactor/vue-vtable",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.1",
|
|
4
4
|
"description": "The vue version of VTable",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vue",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@visactor/vutils": "~0.18.14",
|
|
47
|
-
"@visactor/vtable": "1.8.
|
|
47
|
+
"@visactor/vtable": "1.8.1"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@arco-design/web-vue": "^2.11.0",
|