From 9d78c0eb19313ce30d19ecf89860cccd4e177a25 Mon Sep 17 00:00:00 2001 From: minlovehua <321512939@qq.com> Date: Wed, 21 Jan 2026 13:45:12 +0800 Subject: [PATCH] fix(grid): fix warn Konva warning: true is a not valid value for "transformsEnabled" attribute. The value should be a string. --- .../src/renderer/components/action-icon.component.ts | 4 ++-- .../grid/src/renderer/components/icon.component.ts | 4 ++-- packages/grid/src/renderer/drawers/drawer.ts | 3 ++- packages/grid/src/utils/get-placeholder-cells.ts | 11 +++++++++-- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/packages/grid/src/renderer/components/action-icon.component.ts b/packages/grid/src/renderer/components/action-icon.component.ts index 2974e02b..47563adf 100644 --- a/packages/grid/src/renderer/components/action-icon.component.ts +++ b/packages/grid/src/renderer/components/action-icon.component.ts @@ -2,7 +2,7 @@ import { ChangeDetectionStrategy, Component, computed, input, output, signal } f import { StageConfig } from 'konva/lib/Stage'; import { KoContainer, KoEventObject } from '../../angular-konva'; import { KoShape } from '../../angular-konva/components/shape.component'; -import { Check, Colors, DEFAULT_ICON_SIZE, Unchecked } from '../../constants'; +import { Check, Colors, DEFAULT_ICON_SIZE, DEFAULT_TEXT_TRANSFORMS_ENABLED, Unchecked } from '../../constants'; import { AITableActionIconConfig, AITableCheckType } from '../../types'; import { setMouseStyle } from '../../utils'; @@ -93,7 +93,7 @@ export class AITableActionIcon { rotation, fill, hoverFill: hoverFill, - transformsEnabled = 'position' + transformsEnabled = DEFAULT_TEXT_TRANSFORMS_ENABLED } = this.config(); fill = fill || Colors.gray600; let pathData = data; diff --git a/packages/grid/src/renderer/components/icon.component.ts b/packages/grid/src/renderer/components/icon.component.ts index 5b700f20..0d309e26 100644 --- a/packages/grid/src/renderer/components/icon.component.ts +++ b/packages/grid/src/renderer/components/icon.component.ts @@ -2,7 +2,7 @@ import { ChangeDetectionStrategy, Component, computed, input, output } from '@an import { StageConfig } from 'konva/lib/Stage'; import { KoContainer, KoEventObject } from '../../angular-konva'; import { KoShape } from '../../angular-konva/components/shape.component'; -import { Check, Colors, DEFAULT_ICON_SIZE, RowDragPath, Unchecked } from '../../constants'; +import { Check, Colors, DEFAULT_ICON_SIZE, DEFAULT_TEXT_TRANSFORMS_ENABLED, RowDragPath, Unchecked } from '../../constants'; import { AITableCheckType, AITableIconConfig } from '../../types'; import { DragType } from '@ai-table/utils'; @@ -64,7 +64,7 @@ export class AITableIcon { offsetY, rotation, fill = Colors.gray600, - transformsEnabled = 'position', + transformsEnabled = DEFAULT_TEXT_TRANSFORMS_ENABLED, disabled } = this.config(); diff --git a/packages/grid/src/renderer/drawers/drawer.ts b/packages/grid/src/renderer/drawers/drawer.ts index 4f3c17b3..5c54e06b 100644 --- a/packages/grid/src/renderer/drawers/drawer.ts +++ b/packages/grid/src/renderer/drawers/drawer.ts @@ -11,6 +11,7 @@ import { DEFAULT_TEXT_ALIGN_CENTER, DEFAULT_TEXT_ALIGN_LEFT, DEFAULT_TEXT_DECORATION, + DEFAULT_TEXT_TRANSFORMS_ENABLED, DEFAULT_TEXT_VERTICAL_ALIGN_MIDDLE, DEFAULT_TEXT_VERTICAL_ALIGN_TOP, DEFAULT_WRAP_TEXT_MAX_ROW, @@ -434,7 +435,7 @@ export class Drawer { verticalAlign: 'top', fontStyle: fontStyle, ellipsis: true, - transformsEnabled: true, + transformsEnabled: DEFAULT_TEXT_TRANSFORMS_ENABLED, listening: false }); konvaText.textArr.forEach((item, index) => { diff --git a/packages/grid/src/utils/get-placeholder-cells.ts b/packages/grid/src/utils/get-placeholder-cells.ts index 8ea2f80f..2c3f5cd7 100644 --- a/packages/grid/src/utils/get-placeholder-cells.ts +++ b/packages/grid/src/utils/get-placeholder-cells.ts @@ -1,4 +1,11 @@ -import { AI_TABLE_CELL, AI_TABLE_CELL_LINE_BORDER, AI_TABLE_FIELD_HEAD_ICON_GAP_SIZE, AI_TABLE_OFFSET, Colors } from '../constants'; +import { + AI_TABLE_CELL, + AI_TABLE_CELL_LINE_BORDER, + AI_TABLE_FIELD_HEAD_ICON_GAP_SIZE, + AI_TABLE_OFFSET, + Colors, + DEFAULT_TEXT_TRANSFORMS_ENABLED +} from '../constants'; import { AITable } from '../core'; import { AITableCellsConfig, AITableRowType } from '../types'; import { getCellHorizontalPosition } from './cell'; @@ -67,7 +74,7 @@ export function getPlaceHolderCellsConfigs(options: AITableCellsConfig) { fill: Colors.transparent, strokeEnabled: false, hitStrokeWidth: 0, - transformsEnabled: 'position', + transformsEnabled: DEFAULT_TEXT_TRANSFORMS_ENABLED, perfectDrawEnabled: false, shadowEnabled: false });