From 46e14624747a2cc28f6bb72515690b520838112c Mon Sep 17 00:00:00 2001 From: Carlos Pinedo Date: Tue, 14 Nov 2023 09:59:17 +0100 Subject: [PATCH] refactor(Table): Changed cell renderer config property name --- packages/table/src/core/Row/Row.stories.tsx | 4 ++-- packages/table/src/declarations.ts | 2 +- packages/table/src/editors/EditBoolean.stories.tsx | 2 +- packages/table/src/renderers/tag/Tag.stories.tsx | 4 ++-- packages/table/src/renderers/tag/Tag.tsx | 6 +++--- packages/table/src/types/boolean.ts | 2 +- packages/table/src/types/declarations.ts | 2 +- packages/table/src/types/tag.ts | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/table/src/core/Row/Row.stories.tsx b/packages/table/src/core/Row/Row.stories.tsx index cdd3c5351..556f56e64 100644 --- a/packages/table/src/core/Row/Row.stories.tsx +++ b/packages/table/src/core/Row/Row.stories.tsx @@ -59,7 +59,7 @@ const colDefs: ColDef[] = [ id: 'booleanValue', headerName: 'booleanValue', type: 'tag', - tagConfig: { + cellRendererConfig: { true: { color: '#1EC990', text: 'Active' }, false: { color: '#ED5353', text: 'Inactive' }, }, @@ -69,7 +69,7 @@ const colDefs: ColDef[] = [ id: 'status', headerName: 'status', type: 'tag', - tagConfig: { + cellRendererConfig: { TODO: { color: '#1EC990', text: 'TODO' }, inProgress: { color: '#ED5353', text: 'inProgress' }, test: { color: 'orange', text: 'test' }, diff --git a/packages/table/src/declarations.ts b/packages/table/src/declarations.ts index 908064ee0..4d9f36fbb 100644 --- a/packages/table/src/declarations.ts +++ b/packages/table/src/declarations.ts @@ -43,7 +43,7 @@ export interface ColDef { valueFormatter?: (value: unknown, context: DateContext) => void; // revisar - tagConfig?: any; + cellRendererConfig?: any; context?: { [key: string]: unknown; }; diff --git a/packages/table/src/editors/EditBoolean.stories.tsx b/packages/table/src/editors/EditBoolean.stories.tsx index 20a0d733a..917bd4788 100644 --- a/packages/table/src/editors/EditBoolean.stories.tsx +++ b/packages/table/src/editors/EditBoolean.stories.tsx @@ -25,7 +25,7 @@ export const BooleanEditor: Story = { headerName: 'booleanValue', CellEditor: () => EditBoolean({ value: boolean, onChange }), CellRenderer: TagRenderer, - tagConfig: { + cellRendererConfig: { true: { color: '#1EC990', text: 'Active' }, false: { color: '#ED5353', text: 'Inactive' }, }, diff --git a/packages/table/src/renderers/tag/Tag.stories.tsx b/packages/table/src/renderers/tag/Tag.stories.tsx index f1ea318de..45b6d2bb6 100644 --- a/packages/table/src/renderers/tag/Tag.stories.tsx +++ b/packages/table/src/renderers/tag/Tag.stories.tsx @@ -18,7 +18,7 @@ const columnBoolean: ColDef = { id: 'booleanValue', headerName: 'booleanValue', type: 'tag', - tagConfig: { + cellRendererConfig: { true: { color: '#1EC990', text: 'Active' }, false: { color: '#ED5353', text: 'Inactive' }, }, @@ -29,7 +29,7 @@ const columnStatus: ColDef = { id: 'status', headerName: 'status', type: 'tag', - tagConfig: { + cellRendererConfig: { TODO: { color: '#1EC990', text: 'TODO' }, inProgress: { color: '#ED5353', text: 'inProgress' }, test: { color: 'orange', text: 'test' }, diff --git a/packages/table/src/renderers/tag/Tag.tsx b/packages/table/src/renderers/tag/Tag.tsx index 251d9ed6e..fcedaaf36 100644 --- a/packages/table/src/renderers/tag/Tag.tsx +++ b/packages/table/src/renderers/tag/Tag.tsx @@ -11,9 +11,9 @@ interface TagProps { export const TagRenderer: React.FC = ({ value, columnDef }) => { return ( ); }; diff --git a/packages/table/src/types/boolean.ts b/packages/table/src/types/boolean.ts index d1b5a39c4..91b0ce09b 100644 --- a/packages/table/src/types/boolean.ts +++ b/packages/table/src/types/boolean.ts @@ -6,7 +6,7 @@ export const typeBoolean: ColumnType = { id: 'tagBoolean', CellRenderer: TagRenderer, CellEditor: EditBoolean, - tagConfig: { + cellRendererConfig: { true: { color: '#1EC990', text: 'Active' }, false: { color: '#ED5353', text: 'Inactive' }, }, diff --git a/packages/table/src/types/declarations.ts b/packages/table/src/types/declarations.ts index f728bcc2c..875c3d22d 100644 --- a/packages/table/src/types/declarations.ts +++ b/packages/table/src/types/declarations.ts @@ -6,5 +6,5 @@ export type ColumnType = { context?: { [key: string]: unknown; }; - tagConfig?: { [key: string]: { color: string; text: string } }; + cellRendererConfig?: { [key: string]: { color: string; text: string } }; }; diff --git a/packages/table/src/types/tag.ts b/packages/table/src/types/tag.ts index ce2eab629..622686da9 100644 --- a/packages/table/src/types/tag.ts +++ b/packages/table/src/types/tag.ts @@ -4,7 +4,7 @@ import { ColumnType } from './declarations'; export const typeTag: ColumnType = { id: 'tag', CellRenderer: TagRenderer, - tagConfig: { + cellRendererConfig: { TODO: { color: '#1EC990', text: 'TODO' }, inProgress: { color: '#ED5353', text: 'inProgress' }, test: { color: 'orange', text: 'test' },