Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: frozenRowCell 重命名为 rowCell #2450

Merged
merged 4 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/s2-core/__tests__/unit/cell/row-cell-spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { get } from 'lodash';
import { createPivotSheet } from 'tests/util/helpers';
import type { RowCell } from '@antv/s2';
import type { Group } from '@antv/g-canvas';
import type { RowCell } from '../../../src/cell';
import type { SpreadSheet } from '@/sheet-type';
import type { TextAlign } from '@/common';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { createPivotSheet } from 'tests/util/helpers';
import { get } from 'lodash';
import { RowCell } from '../../../../src/cell/row-cell';
import { DEFAULT_OPTIONS } from '@/common';

import { FrozenRowCell, SeriesNumberCell } from '@/cell';
import { SeriesNumberCell } from '@/cell';
import { PivotRowHeader } from '@/facet/header';
import { SeriesNumberHeader } from '@/facet/header/series-number';

Expand Down Expand Up @@ -31,13 +31,13 @@ describe('Frozen Row Header Test', () => {
expect(rowHeader.frozenHeadGroup.getChildren()).toHaveLength(1);
const frozenRowCell = rowHeader.frozenHeadGroup.getChildren()[0];

expect(frozenRowCell instanceof FrozenRowCell).toBeTrue();
expect(frozenRowCell instanceof RowCell).toBeTrue();
expect(get(frozenRowCell, 'meta.height')).toEqual(30);

expect(rowHeader.scrollGroup.getChildren()).toHaveLength(10);
const scrollCell = rowHeader.scrollGroup.getChildren()[0];

expect(scrollCell instanceof FrozenRowCell).toBeTrue();
expect(scrollCell instanceof RowCell).toBeTrue();
expect(get(frozenRowCell, 'meta.height')).toEqual(30);

expect(rowHeader.getFrozenFirstRowHeight()).toBe(30);
Expand Down
11 changes: 4 additions & 7 deletions packages/s2-core/__tests__/unit/facet/pivot-facet-frozen-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
import type { IGroup } from '@antv/g-canvas';
import { get } from 'lodash';
import { createPivotSheet } from 'tests/util/helpers';

import type { PivotSheet, S2Options } from '@antv/s2';
import { FrozenRowCell, SeriesNumberCell } from '@/cell';
import { type PivotSheet, RowCell, SeriesNumberCell } from '../../../src';
import {
FrozenGroup,
KEY_GROUP_ROW_HEADER_FROZEN,
KEY_GROUP_ROW_SCROLL,
type S2Options,
} from '@/common';
import type { FrozenFacet } from '@/facet/frozen-facet';
import { getFrozenRowCfgPivot } from '@/facet/utils';
Expand Down Expand Up @@ -371,12 +370,10 @@ describe('test frozen group', () => {
scrollHeaderGroup as IGroup
).getChildren();
expect(frozenRowGroupChildren).toHaveLength(1);
expect(frozenRowGroupChildren[0] instanceof FrozenRowCell).toBe(true);
expect(frozenRowGroupChildren[0] instanceof RowCell).toBeTruthy();
expect(get(frozenRowGroupChildren[0], 'meta.value')).toBe('总计');
expect(scrollRowHeaderGroupChildren).toHaveLength(10);
expect(scrollRowHeaderGroupChildren[0] instanceof FrozenRowCell).toBe(
true,
);
expect(scrollRowHeaderGroupChildren[0] instanceof RowCell).toBeTruthy();
expect(get(scrollRowHeaderGroupChildren[0], 'meta.value')).toBe('浙江省');

// serial number header
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import {
sleep,
} from 'tests/util/helpers';
import type { Event as GEvent } from '@antv/g-canvas';
import type { InteractionCellHighlight } from '@antv/s2';
import type { S2Options } from '@/common/interface';
import type { InteractionCellHighlight, S2Options } from '@/common/interface';
import type { SpreadSheet } from '@/sheet-type';
import {
HOVER_FOCUS_DURATION,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Node } from '@antv/s2';
import type { Node } from '../../../../src';
import { CellTypes, type HeaderActionIcon } from '@/common';
import { getActionIconConfig } from '@/utils/cell/header-cell';

Expand Down
3 changes: 1 addition & 2 deletions packages/s2-core/__tests__/unit/utils/export/copy-spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import type { S2DataConfig } from '@antv/s2';
import { assembleDataCfg, assembleOptions, TOTALS_OPTIONS } from 'tests/util';
import { getContainer } from 'tests/util/helpers';
import { data as originalData, totalData } from 'tests/data/mock-dataset.json';
import { map } from 'lodash';
import type { S2DataConfig } from '../../../../src/common';
import { TableSheet, PivotSheet } from '@/sheet-type';

import {
CellTypes,
InteractionStateName,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RowCell } from '../../../../src/cell';
import { getCellMeta } from '@/utils/interaction/select-event';
import type { RowCell } from '@/cell/row-cell';
import { CellTypes, InteractionStateName } from '@/common/constant/interaction';
import type { S2Options } from '@/common/interface';
import { Store } from '@/common/store';
Expand Down
Loading
Loading