Skip to content

Commit 95d472d

Browse files
committed
feat: remove borderedRows prop and rename stripedRows prop to rowStriped
1 parent fdb7a3d commit 95d472d

23 files changed

Lines changed: 65 additions & 64 deletions

.changeset/few-sites-design.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
'@algoux/standard-ranklist-renderer-component-angular': patch
3+
'@algoux/standard-ranklist-renderer-component-svelte': patch
4+
'@algoux/standard-ranklist-renderer-component-react': patch
5+
'@algoux/standard-ranklist-renderer-component-solid': patch
6+
'@algoux/standard-ranklist-renderer-component-vue': patch
7+
---
8+
9+
Remove `borderedRows` prop and rename `stripedRows` prop to `rowStriped`

docs/agents/ranklist-renderer-props.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ showProblemStatisticsFooter?: boolean;
2424
showDirtColumn?: boolean;
2525
showSEColumn?: boolean;
2626
rowBordered?: boolean;
27+
rowStriped?: boolean;
2728
columnBordered?: boolean;
2829
emptyStatusPlaceholder?: string | null;
2930
userAvatarPlacement?: 'user' | 'organization';
@@ -58,7 +59,8 @@ Default labels are: series title from SRK, `Name`, `Organization`, `Score`,
5859
| `showProblemStatisticsFooter` | `false` | Renders the multi-row problem statistics footer plus the final problem alias row. |
5960
| `showDirtColumn` | `false` | Appends the row Dirt percentage column after problem columns. |
6061
| `showSEColumn` | `false` | Appends the row SE column after problems and after Dirt when both are enabled. |
61-
| `rowBordered` | `false` | Enables row separators via shared CSS variables. Existing `borderedRows` remains a React alias. |
62+
| `rowBordered` | `false` | Enables row separators via shared CSS variables. |
63+
| `rowStriped` | `false` | Enables striped body rows. |
6264
| `columnBordered` | `false` | Enables column separators via shared CSS variables. |
6365
| `emptyStatusPlaceholder` | `null` | Replaces no-submission status cell blank content with a custom string. |
6466
| `userAvatarPlacement` | `user` | Moves the default avatar into the split Organization column only when set to `organization` and `splitOrganization` is enabled. |
@@ -153,10 +155,11 @@ Default labels are: series title from SRK, `Name`, `Organization`, `Score`,
153155
- If the footer and appended extra columns are both enabled, the footer gets
154156
one empty alignment cell for each enabled extra column, in column order
155157
(`Dirt`, then `SE`).
156-
- `rowBordered` enables a light horizontal separator between body rows.
157-
`borderedRows` remains supported as the existing React alias. The color is
158-
controlled by `--srk-table-row-border-color`, which defaults to
158+
- `rowBordered` enables a light horizontal separator between body rows. The
159+
color is controlled by `--srk-table-row-border-color`, which defaults to
159160
`--srk-table-border` only when row borders are enabled.
161+
- `rowStriped` enables the existing `.srk-table-row-striped` body-row
162+
background treatment.
160163
- `columnBordered` enables light vertical separators between columns. The color
161164
is controlled by `--srk-table-column-border-color`, which defaults to
162165
`--srk-table-border` only when column borders are enabled. Column separator

packages/angular/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ import '@algoux/standard-ranklist-renderer-component-styles';
5252
></srk-progress-bar>
5353
<srk-ranklist
5454
[data]="staticRanklist"
55-
[stripedRows]="true"
55+
[rowStriped]="true"
5656
(userClick)="handleUserClick($event)"
5757
(solutionClick)="handleSolutionClick($event)"
5858
></srk-ranklist>
@@ -111,6 +111,7 @@ Use `ModalComponent` directly when you want custom modal content. `SrkUserCellTe
111111
- `showDirtColumn`: appends a Dirt percentage column after problem columns.
112112
- `showSEColumn`: appends a contestant SE column after problem columns, placed after Dirt when both are enabled.
113113
- `rowBordered`: adds row separators controlled by CSS variables.
114+
- `rowStriped`: adds striped body rows.
114115
- `columnBordered`: adds column separators controlled by CSS variables.
115116
- `emptyStatusPlaceholder`: renders a custom string in no-submission status cells.
116117
- `userAvatarPlacement`: chooses whether the default user avatar renders in the user column or, when `splitOrganization` is enabled, in the organization column.
@@ -140,6 +141,7 @@ export class BoardComponent {
140141
[statusCellPreset]="'compact'"
141142
[statusColorAsText]="true"
142143
[rowBordered]="true"
144+
[rowStriped]="true"
143145
[columnBordered]="true"
144146
[emptyStatusPlaceholder]="'·'"
145147
[userAvatarPlacement]="'organization'"

packages/angular/dev/app.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ function resolvePreferredTheme() {
183183
<srk-ranklist
184184
[data]="staticRanklist"
185185
[theme]="preferredTheme"
186-
[stripedRows]="true"
186+
[rowStriped]="true"
187187
[splitOrganization]="splitOrganization"
188188
[columnTitles]="useCustomColumnTitles ? demoColumnTitles : undefined"
189189
[statusCellPreset]="statusCellPreset"

packages/angular/src/lib/__tests__/ranklist-display-contract.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ import { RanklistComponent } from '../index';
2121
template: `
2222
<srk-ranklist
2323
[data]="data"
24-
[borderedRows]="borderedRows"
25-
[stripedRows]="stripedRows"
24+
[rowBordered]="rowBordered"
25+
[rowStriped]="rowStriped"
2626
[formatSrkAssetUrl]="formatSrkAssetUrl"
2727
/>
2828
`,
@@ -41,8 +41,8 @@ class ContractHostComponent {
4141
problems: [],
4242
rows: [],
4343
};
44-
borderedRows = false;
45-
stripedRows = false;
44+
rowBordered = false;
45+
rowStriped = false;
4646
formatSrkAssetUrl?: (url: string, field: string) => string;
4747
}
4848

@@ -62,8 +62,8 @@ async function renderHost(data: unknown, props: RanklistDisplayRenderProps = {})
6262
});
6363
Object.assign(componentRef.instance, {
6464
data,
65-
borderedRows: !!props.borderedRows,
66-
stripedRows: !!props.stripedRows,
65+
rowBordered: !!props.rowBordered,
66+
rowStriped: !!props.rowStriped,
6767
formatSrkAssetUrl: props.formatSrkAssetUrl,
6868
});
6969
appRef.attachView(componentRef.hostView);

packages/angular/src/lib/__tests__/ranklist-render-options.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import { RanklistComponent } from '../index';
2626
[showDirtColumn]="showDirtColumn"
2727
[showSEColumn]="showSEColumn"
2828
[rowBordered]="rowBordered"
29-
[borderedRows]="borderedRows"
3029
[columnBordered]="columnBordered"
3130
[emptyStatusPlaceholder]="emptyStatusPlaceholder"
3231
[userAvatarPlacement]="userAvatarPlacement"
@@ -43,7 +42,6 @@ class RenderOptionsHostComponent {
4342
showDirtColumn?: RanklistRenderOptionsProps['showDirtColumn'];
4443
showSEColumn?: RanklistRenderOptionsProps['showSEColumn'];
4544
rowBordered?: RanklistRenderOptionsProps['rowBordered'];
46-
borderedRows?: RanklistRenderOptionsProps['borderedRows'];
4745
columnBordered?: RanklistRenderOptionsProps['columnBordered'];
4846
emptyStatusPlaceholder?: RanklistRenderOptionsProps['emptyStatusPlaceholder'];
4947
userAvatarPlacement?: RanklistRenderOptionsProps['userAvatarPlacement'];

packages/angular/src/lib/ranklist/ranklist.component.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ import {
7474
<ng-template #ranklistTable>
7575
<div class="srk-common-table srk-main">
7676
<table
77-
[class.srk-table-row-bordered]="borderedRows || rowBordered"
77+
[class.srk-table-row-bordered]="rowBordered"
7878
[class.srk-table-column-bordered]="columnBordered"
79-
[class.srk-table-row-striped]="stripedRows"
79+
[class.srk-table-row-striped]="rowStriped"
8080
>
8181
<thead>
8282
<tr>
@@ -379,10 +379,9 @@ import {
379379
export class RanklistComponent {
380380
@Input({ required: true }) data!: StaticRanklist;
381381
@Input() theme: EnumTheme = EnumTheme.light;
382-
@Input() borderedRows = false;
383382
@Input() rowBordered = false;
384383
@Input() columnBordered = false;
385-
@Input() stripedRows = false;
384+
@Input() rowStriped = false;
386385
@Input() formatSrkAssetUrl?: (url: string, field: string) => string;
387386
@Input() splitOrganization = false;
388387
@Input() columnTitles?: RanklistColumnTitles;

packages/react/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function Board({ ranklist }) {
4545
<ProgressBar data={ranklist} enableTimeTravel onTimeTravel={(time) => console.log(time)} />
4646
<Ranklist
4747
data={staticRanklist}
48-
stripedRows
48+
rowStriped
4949
onUserClick={(payload) => {
5050
setActiveUser(payload);
5151
setActiveSolution(null);
@@ -88,6 +88,7 @@ Use `Modal` directly when you want custom modal content. `Ranklist` also accepts
8888
- `showDirtColumn`: appends a Dirt percentage column after problem columns.
8989
- `showSEColumn`: appends a contestant SE column after problem columns, placed after Dirt when both are enabled.
9090
- `rowBordered`: adds row separators controlled by CSS variables.
91+
- `rowStriped`: adds striped body rows.
9192
- `columnBordered`: adds column separators controlled by CSS variables.
9293
- `emptyStatusPlaceholder`: renders a custom string in no-submission status cells.
9394
- `userAvatarPlacement`: chooses whether the default user avatar renders in the user column or, when `splitOrganization` is enabled, in the organization column.
@@ -102,6 +103,7 @@ Use `Modal` directly when you want custom modal content. `Ranklist` also accepts
102103
statusCellPreset="compact"
103104
statusColorAsText
104105
rowBordered
106+
rowStriped
105107
columnBordered
106108
emptyStatusPlaceholder="·"
107109
userAvatarPlacement="organization"

packages/react/dev/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ export default class App extends React.Component<Record<string, never>, AppState
311311
<Ranklist
312312
data={staticRanklist}
313313
theme={this.preferredTheme}
314-
stripedRows
314+
rowStriped
315315
onUserClick={this.handleUserClick}
316316
onSolutionClick={this.handleSolutionClick}
317317
splitOrganization={this.state.splitOrganization}

packages/react/src/Ranklist.tsx

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,6 @@ export interface RanklistProps {
6262
*/
6363
theme?: EnumTheme;
6464

65-
/**
66-
* Enable border between rows in the table.
67-
* @defaultValue false
68-
*/
69-
borderedRows?: boolean;
70-
7165
/**
7266
* Enable border between rows in the table.
7367
* @defaultValue false
@@ -84,7 +78,7 @@ export interface RanklistProps {
8478
* Enable striped rows style in the table.
8579
* @defaultValue false
8680
*/
87-
stripedRows?: boolean;
81+
rowStriped?: boolean;
8882

8983
formatSrkAssetUrl?: (url: string, field: string) => string;
9084
onUserClick?: (payload: UserClickPayload) => void | Promise<void>;
@@ -109,10 +103,9 @@ interface State {
109103
export class Ranklist extends React.Component<RanklistProps, State> {
110104
static defaultProps: Partial<RanklistProps> = {
111105
theme: EnumTheme.light,
112-
borderedRows: false,
113106
rowBordered: false,
114107
columnBordered: false,
115-
stripedRows: false,
108+
rowStriped: false,
116109
splitOrganization: false,
117110
statusCellPreset: 'classic',
118111
statusColorAsText: false,
@@ -396,10 +389,9 @@ export class Ranklist extends React.Component<RanklistProps, State> {
396389
}
397390
const {
398391
data,
399-
borderedRows,
400392
rowBordered,
401393
columnBordered,
402-
stripedRows,
394+
rowStriped,
403395
splitOrganization,
404396
statusCellPreset,
405397
statusColorAsText,
@@ -433,9 +425,9 @@ export class Ranklist extends React.Component<RanklistProps, State> {
433425
<div className="srk-common-table srk-main">
434426
<table
435427
className={classnames({
436-
'srk-table-row-bordered': borderedRows || rowBordered,
428+
'srk-table-row-bordered': rowBordered,
437429
'srk-table-column-bordered': columnBordered,
438-
'srk-table-row-striped': stripedRows,
430+
'srk-table-row-striped': rowStriped,
439431
})}
440432
>
441433
<thead>

0 commit comments

Comments
 (0)