Skip to content

Commit

Permalink
Prettier code
Browse files Browse the repository at this point in the history
  • Loading branch information
MikaelNordberg committed Dec 19, 2024
1 parent b852ea7 commit 42c577f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 28 deletions.
40 changes: 19 additions & 21 deletions packages/pxweb2-ui/src/lib/components/Table/Table.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
width: 40px;
padding-left: 16px;
@media screen and (min-width: fixed.$breakpoints-small-min-width) {
padding: 8px 12px;
padding: 8px 12px;
}
font-weight: normal;
text-align: center;
Expand Down Expand Up @@ -54,7 +54,7 @@

th.stub-0 {
@media screen and (min-width: fixed.$breakpoints-small-min-width) {
padding-left: 12px;
padding-left: 12px;
}
border-left: none;
}
Expand All @@ -78,13 +78,13 @@
}
th.stub-4 {
@media screen and (min-width: fixed.$breakpoints-small-min-width) {
padding-left: 76px;
padding-left: 76px;
}
border-left: none;
}
th.stub-5 {
@media screen and (min-width: fixed.$breakpoints-small-min-width) {
padding-left: 92px;
padding-left: 92px;
}
border-left: none;
}
Expand All @@ -111,7 +111,7 @@
td {
padding-right: 16px;
@media screen and (min-width: fixed.$breakpoints-small-min-width) {
padding: 8px 12px;
padding: 8px 12px;
}
width: 40px;
text-align: right;
Expand All @@ -124,8 +124,8 @@
}
tr.firstdim th {
border-top: 1px solid var(--px-color-border-default);
@media screen and (min-width: fixed.$breakpoints-small-min-width) {
border-top: 2px solid var(--px-color-border-default);
@media screen and (min-width: fixed.$breakpoints-small-min-width) {
border-top: 2px solid var(--px-color-border-default);
}
@media screen and (max-width: fixed.$breakpoints-xsmall-max-width) {
padding-top: 16px;
Expand Down Expand Up @@ -175,27 +175,25 @@
border-bottom: none;
border-top: none;
}
.mobileRowHeadSecondLastStub >th,
.mobileRowHeadSecondLastStub >td{

.mobileRowHeadSecondLastStub > th,
.mobileRowHeadSecondLastStub > td {
padding-top: 12px;
padding-bottom: 4px;
background:none;
border-left:none ;
border-right:none;
border-bottom:none ;
border-top: none ;
background: none;
border-left: none;
border-right: none;
border-bottom: none;
border-top: none;
font-family: PxWeb-font-700;
}

.mobileRowHeadThirdLastStub>th,
.mobileRowHeadThirdLastStub >td{
.mobileRowHeadThirdLastStub > th,
.mobileRowHeadThirdLastStub > td {
padding-bottom: 16px;
}
.mobileRowHeadlastValueOfLastStub>th,
.mobileRowHeadlastValueOfLastStub>td {
.mobileRowHeadlastValueOfLastStub > th,
.mobileRowHeadlastValueOfLastStub > td {
padding-bottom: 16px;
}


}
13 changes: 6 additions & 7 deletions packages/pxweb2-ui/src/lib/components/Table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export function createRows(
table: PxTable,
tableMeta: columnRowMeta,
headingDataCellCodes: DataCellCodes[],
isMobile: boolean
isMobile: boolean,
): React.JSX.Element[] {
const tableRows: React.JSX.Element[] = [];
const stubDatacellCodes: DataCellCodes = new Array<DataCellMeta>();
Expand All @@ -196,7 +196,7 @@ export function createRows(
tableMeta,
stubDatacellCodes,
headingDataCellCodes,
tableRows
tableRows,
);
} else {
createRowDesktop(
Expand Down Expand Up @@ -233,7 +233,7 @@ export function createRows(
*
* @param stubIndex - The index of the current stub variable.
* @param rowSpan - The rowspan for the cells to add in this call.
* @param stubIteration - Iteration for the value
* @param stubIteration - Iteration for the value
* @param table - The PxTable object representing the PxWeb table data.
* @param tableMeta - The metadata for the table columns and rows.
* @param stubDataCellCodes - The metadata structure for the dimensions of the stub cells.
Expand Down Expand Up @@ -337,7 +337,7 @@ function createRowDesktop(
*
* @param stubIndex - The index of the current stub variable.
* @param rowSpan - The rowspan for the cells to add in this call.
* @param stubIteration - Iteration for the value
* @param stubIteration - Iteration for the value
* @param table - The PxTable object representing the PxWeb table data.
* @param tableMeta - The metadata for the table columns and rows.
* @param stubDataCellCodes - The metadata structure for the dimensions of the stub cells.
Expand All @@ -353,9 +353,8 @@ function createRowMobile(
tableMeta: columnRowMeta,
stubDataCellCodes: DataCellCodes,
headingDataCellCodes: DataCellCodes[],
tableRows: React.JSX.Element[]
tableRows: React.JSX.Element[],
): React.JSX.Element[] {

// Calculate the rowspan for all the cells to add in this call
rowSpan = rowSpan / table.stub[stubIndex].values.length;

Expand Down Expand Up @@ -467,7 +466,7 @@ function createRowMobile(
tableMeta,
stubDataCellCodes,
headingDataCellCodes,
tableRows
tableRows,
);

stubDataCellCodes.pop();
Expand Down

0 comments on commit 42c577f

Please sign in to comment.