Skip to content

Commit 066085d

Browse files
committed
refactor(infographic): list column grid row structure support zigzag
1 parent f2cfe4a commit 066085d

33 files changed

Lines changed: 60 additions & 63 deletions

packages/infographic/src/designs/items/BadgeCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,5 +138,5 @@ export const BadgeCard: ComponentType<BadgeCardProps> = (props) => {
138138

139139
registerItem('badge-card', {
140140
component: BadgeCard,
141-
values: ['icon', 'label', 'value', 'desc'],
141+
composites: ['icon', 'label', 'value', 'desc'],
142142
});

packages/infographic/src/designs/items/BulletText.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,5 @@ export const BulletText: ComponentType<BulletTextProps> = (props) => {
7777

7878
registerItem('bullet-text', {
7979
component: BulletText,
80-
values: ['label'],
80+
composites: ['label'],
8181
});

packages/infographic/src/designs/items/CandyCardLite.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,5 @@ export const CandyCardLite: ComponentType<CandyCardLiteProps> = (props) => {
8484

8585
registerItem('candy-card-lite', {
8686
component: CandyCardLite,
87-
values: ['icon', 'label', 'desc'],
87+
composites: ['icon', 'label', 'desc'],
8888
});

packages/infographic/src/designs/items/ChartColumn.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,5 +127,5 @@ export const ChartColumn: ComponentType<ChartColumnProps> = (props) => {
127127

128128
registerItem('chart-column', {
129129
component: ChartColumn,
130-
values: ['label', 'value'],
130+
composites: ['label', 'value'],
131131
});

packages/infographic/src/designs/items/CircleNode.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export const CircleNode: ComponentType<CircleNodeProps> = (props) => {
9595

9696
registerItem('circle-node', {
9797
component: CircleNode,
98-
values: ['label'],
98+
composites: ['label'],
9999
});
100100

101101
function fadeWithWhite(

packages/infographic/src/designs/items/CircularProgress.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,5 +102,5 @@ export const CircularProgress: ComponentType<CircularProgressProps> = (
102102

103103
registerItem('circular-progress', {
104104
component: CircularProgress,
105-
values: ['label', 'value'],
105+
composites: ['label', 'value'],
106106
});

packages/infographic/src/designs/items/CompactCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,5 +126,5 @@ export const CompactCard: ComponentType<CompactCardProps> = (props) => {
126126

127127
registerItem('compact-card', {
128128
component: CompactCard,
129-
values: ['icon', 'label', 'value', 'desc'],
129+
composites: ['icon', 'label', 'value', 'desc'],
130130
});

packages/infographic/src/designs/items/DoneList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,5 @@ export const DoneList: ComponentType<DoneListProps> = (props) => {
6565

6666
registerItem('done-list', {
6767
component: DoneList,
68-
values: ['desc'],
68+
composites: ['desc'],
6969
});

packages/infographic/src/designs/items/HorizontalIconArrow.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,15 @@ import type { BaseItemProps } from './types';
1818

1919
export interface HorizontalIconArrowProps extends BaseItemProps {
2020
width?: number;
21-
/** 翻转方向 */
22-
flipped?: boolean;
2321
}
2422

2523
export const HorizontalIconArrow: ComponentType<HorizontalIconArrowProps> = (
2624
props,
2725
) => {
28-
const [{ indexes, datum, width = 140, themeColors, flipped }, restProps] =
29-
getItemProps(props, ['width', 'flipped']);
30-
31-
const positionV = indexes[0] % 2 === (flipped ? 0 : 1) ? 'normal' : 'flipped';
26+
const [
27+
{ indexes, datum, width = 140, themeColors, positionV = 'normal' },
28+
restProps,
29+
] = getItemProps(props, ['width']);
3230

3331
const textAlignVertical = positionV === 'normal' ? 'bottom' : 'top';
3432
const label = (
@@ -183,7 +181,7 @@ const DotLine = (props: {
183181
width?: number;
184182
height?: number;
185183
fill: string;
186-
positionV?: 'normal' | 'flipped';
184+
positionV?: 'normal' | 'center' | 'flipped';
187185
}) => {
188186
const {
189187
x = 0,
@@ -220,5 +218,5 @@ const DotLine = (props: {
220218

221219
registerItem('horizontal-icon-arrow', {
222220
component: HorizontalIconArrow,
223-
values: ['icon', 'label', 'desc'],
221+
composites: ['icon', 'label', 'desc'],
224222
});

packages/infographic/src/designs/items/HorizontalIconLine.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,5 +148,5 @@ export const HorizontalIconLine: ComponentType<HorizontalIconLineProps> = (
148148

149149
registerItem('horizontal-icon-line', {
150150
component: HorizontalIconLine,
151-
values: ['icon', 'label', 'desc'],
151+
composites: ['icon', 'label', 'desc'],
152152
});

0 commit comments

Comments
 (0)