Skip to content

Commit

Permalink
Merge pull request #2543 from VisActor/fix/vue-component-name
Browse files Browse the repository at this point in the history
Fix/vue component name
  • Loading branch information
fangsmile authored Sep 29, 2024
2 parents 7e981e6 + 9d587a7 commit 2bedb8d
Show file tree
Hide file tree
Showing 21 changed files with 47 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "refactor: rename vue component name\n\n",
"type": "none",
"packageName": "@visactor/vtable"
}
],
"packageName": "@visactor/vtable",
"email": "[email protected]"
}
2 changes: 2 additions & 0 deletions packages/vue-vtable/src/components/component/menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ export type MenuProps = {
export default function Menu(props: MenuProps): VNode {
return null;
}

Menu.symbol = 'Menu';
2 changes: 2 additions & 0 deletions packages/vue-vtable/src/components/component/tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ export type TooltipProps = {
export default function Tooltip(props: TooltipProps): VNode {
return null;
}

Tooltip.symbol = 'Tooltip';
2 changes: 2 additions & 0 deletions packages/vue-vtable/src/components/custom/checkBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ export interface CheckboxProps {
export default function CheckBox(props: CheckboxProps): VNode {
return null;
}

CheckBox.symbol = 'CheckBox';
2 changes: 2 additions & 0 deletions packages/vue-vtable/src/components/custom/custom-layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ export interface CustomComponentProps {
export default function CustomLayout(props: CustomComponentProps): VNode {
return null;
}

CustomLayout.symbol = 'CustomLayout';
2 changes: 2 additions & 0 deletions packages/vue-vtable/src/components/custom/group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ import type { VNode } from 'vue';
export default function Group(): VNode {
return null;
}

Group.symbol = 'Group';
2 changes: 2 additions & 0 deletions packages/vue-vtable/src/components/custom/image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ import type { VNode } from 'vue';
export default function Image(): VNode {
return null;
}

Image.symbol = 'Image';
2 changes: 2 additions & 0 deletions packages/vue-vtable/src/components/custom/radio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ export interface RadioProps {
export default function Radio(props: RadioProps): any {
return null;
}

Radio.symbol = 'Radio';
2 changes: 2 additions & 0 deletions packages/vue-vtable/src/components/custom/tag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ export interface TagProps {
export default function Tag(props: TagProps): VNode {
return null;
}

Tag.symbol = 'Tag';
2 changes: 2 additions & 0 deletions packages/vue-vtable/src/components/custom/text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ import type { VNode } from 'vue';
export default function Text(): VNode {
return null;
}

Text.symbol = 'Text';
2 changes: 2 additions & 0 deletions packages/vue-vtable/src/components/list/list-column.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ import type { ColumnDefine } from '@visactor/vtable';
export default function ListColumn(props: ColumnDefine): VNode {
return null;
}

ListColumn.symbol = 'ListColumn';
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ export type PivotColumnDimensionProps = IDimension & ObjectHandler;
export default function PivotColumnDimension(props: PivotColumnDimensionProps): VNode {
return null;
}

PivotColumnDimension.symbol = 'PivotColumnDimension';
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ import type { ITitleDefine } from '@visactor/vtable';
export default function PivotColumnHeaderTitle(props: ITitleDefine): VNode {
return null;
}

PivotColumnHeaderTitle.symbol = 'PivotColumnHeaderTitle';
2 changes: 2 additions & 0 deletions packages/vue-vtable/src/components/pivot/pivot-corner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ import type { ICornerDefine } from '@visactor/vtable';
export default function PivotCorner(props: ICornerDefine): VNode {
return null;
}

PivotCorner.symbol = 'PivotCorner';
2 changes: 2 additions & 0 deletions packages/vue-vtable/src/components/pivot/pivot-indicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ import type { IIndicator } from '@visactor/vtable';
export default function PivotIndicator(props: IIndicator): VNode {
return null;
}

PivotIndicator.symbol = 'PivotIndicator';
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ export type PivotColumnDimensionProps = IDimension & ObjectHandler;
export default function PivotRowDimension(props: PivotColumnDimensionProps): VNode {
return null;
}

PivotRowDimension.symbol = 'PivotRowDimension';
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ import type { ITitleDefine } from '@visactor/vtable';
export default function PivotRowHeaderTitle(props: ITitleDefine): VNode {
return null;
}

PivotRowHeaderTitle.symbol = 'PivotRowHeaderTitle';
2 changes: 1 addition & 1 deletion packages/vue-vtable/src/tables/list-table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function extractSlotOptions(vnodes: any[]) {
};
vnodes.forEach(vnode => {
const typeName = vnode.type?.name || vnode.type?.__name;
const typeName = vnode.type?.symbol || vnode.type?.name;
const optionKey = typeMapping[typeName];
if (optionKey) {
Expand Down
2 changes: 1 addition & 1 deletion packages/vue-vtable/src/tables/pivot-chart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const computedOptions = computed(() => {
};
flattenedSlots.forEach(vnode => {
const typeName = vnode.type?.name || vnode.type?.__name;
const typeName = vnode.type?.symbol || vnode.type?.name ;
const optionKey = typeMapping[typeName];
if (optionKey) {
Expand Down
2 changes: 1 addition & 1 deletion packages/vue-vtable/src/tables/pivot-table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const computedOptions = computed(() => {
};
flattenedSlots.forEach(vnode => {
const typeName = vnode.type?.name || vnode.type?.__name;
const typeName = vnode.type?.symbol || vnode.type?.name ;
const optionKey = typeMapping[typeName];
if (optionKey) {
Expand Down
2 changes: 1 addition & 1 deletion packages/vue-vtable/src/tables/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function createCustomLayout(children: any): any {
}

const { type, props, children: childChildren } = child;
const componentName = type?.name || type;
const componentName = type?.symbol || type?.name;
const ComponentClass = componentMap[componentName];

if (!ComponentClass) {
Expand Down

0 comments on commit 2bedb8d

Please sign in to comment.