Skip to content

Commit 9d78c0e

Browse files
committed
fix(grid): fix warn Konva warning: true is a not valid value for "transformsEnabled" attribute. The value should be a string.
1 parent 1ec9b5f commit 9d78c0e

4 files changed

Lines changed: 15 additions & 7 deletions

File tree

packages/grid/src/renderer/components/action-icon.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ChangeDetectionStrategy, Component, computed, input, output, signal } f
22
import { StageConfig } from 'konva/lib/Stage';
33
import { KoContainer, KoEventObject } from '../../angular-konva';
44
import { KoShape } from '../../angular-konva/components/shape.component';
5-
import { Check, Colors, DEFAULT_ICON_SIZE, Unchecked } from '../../constants';
5+
import { Check, Colors, DEFAULT_ICON_SIZE, DEFAULT_TEXT_TRANSFORMS_ENABLED, Unchecked } from '../../constants';
66
import { AITableActionIconConfig, AITableCheckType } from '../../types';
77
import { setMouseStyle } from '../../utils';
88

@@ -93,7 +93,7 @@ export class AITableActionIcon {
9393
rotation,
9494
fill,
9595
hoverFill: hoverFill,
96-
transformsEnabled = 'position'
96+
transformsEnabled = DEFAULT_TEXT_TRANSFORMS_ENABLED
9797
} = this.config();
9898
fill = fill || Colors.gray600;
9999
let pathData = data;

packages/grid/src/renderer/components/icon.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ChangeDetectionStrategy, Component, computed, input, output } from '@an
22
import { StageConfig } from 'konva/lib/Stage';
33
import { KoContainer, KoEventObject } from '../../angular-konva';
44
import { KoShape } from '../../angular-konva/components/shape.component';
5-
import { Check, Colors, DEFAULT_ICON_SIZE, RowDragPath, Unchecked } from '../../constants';
5+
import { Check, Colors, DEFAULT_ICON_SIZE, DEFAULT_TEXT_TRANSFORMS_ENABLED, RowDragPath, Unchecked } from '../../constants';
66
import { AITableCheckType, AITableIconConfig } from '../../types';
77
import { DragType } from '@ai-table/utils';
88

@@ -64,7 +64,7 @@ export class AITableIcon {
6464
offsetY,
6565
rotation,
6666
fill = Colors.gray600,
67-
transformsEnabled = 'position',
67+
transformsEnabled = DEFAULT_TEXT_TRANSFORMS_ENABLED,
6868
disabled
6969
} = this.config();
7070

packages/grid/src/renderer/drawers/drawer.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
DEFAULT_TEXT_ALIGN_CENTER,
1212
DEFAULT_TEXT_ALIGN_LEFT,
1313
DEFAULT_TEXT_DECORATION,
14+
DEFAULT_TEXT_TRANSFORMS_ENABLED,
1415
DEFAULT_TEXT_VERTICAL_ALIGN_MIDDLE,
1516
DEFAULT_TEXT_VERTICAL_ALIGN_TOP,
1617
DEFAULT_WRAP_TEXT_MAX_ROW,
@@ -434,7 +435,7 @@ export class Drawer {
434435
verticalAlign: 'top',
435436
fontStyle: fontStyle,
436437
ellipsis: true,
437-
transformsEnabled: true,
438+
transformsEnabled: DEFAULT_TEXT_TRANSFORMS_ENABLED,
438439
listening: false
439440
});
440441
konvaText.textArr.forEach((item, index) => {

packages/grid/src/utils/get-placeholder-cells.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
import { AI_TABLE_CELL, AI_TABLE_CELL_LINE_BORDER, AI_TABLE_FIELD_HEAD_ICON_GAP_SIZE, AI_TABLE_OFFSET, Colors } from '../constants';
1+
import {
2+
AI_TABLE_CELL,
3+
AI_TABLE_CELL_LINE_BORDER,
4+
AI_TABLE_FIELD_HEAD_ICON_GAP_SIZE,
5+
AI_TABLE_OFFSET,
6+
Colors,
7+
DEFAULT_TEXT_TRANSFORMS_ENABLED
8+
} from '../constants';
29
import { AITable } from '../core';
310
import { AITableCellsConfig, AITableRowType } from '../types';
411
import { getCellHorizontalPosition } from './cell';
@@ -67,7 +74,7 @@ export function getPlaceHolderCellsConfigs(options: AITableCellsConfig) {
6774
fill: Colors.transparent,
6875
strokeEnabled: false,
6976
hitStrokeWidth: 0,
70-
transformsEnabled: 'position',
77+
transformsEnabled: DEFAULT_TEXT_TRANSFORMS_ENABLED,
7178
perfectDrawEnabled: false,
7279
shadowEnabled: false
7380
});

0 commit comments

Comments
 (0)