Skip to content

Commit

Permalink
feat(DDIDS-1152): Table component number column styling
Browse files Browse the repository at this point in the history
  • Loading branch information
amar-ABgov committed Feb 7, 2023
1 parent 8447396 commit 0c2c98b
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 5 deletions.
2 changes: 1 addition & 1 deletion apps/angular-demo/src/app/table/table.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<tr *ngFor="let user of users; index as i">
<td>{{ user.firstName }}</td>
<td>{{ user.lastName }}</td>
<td>{{ user.age }}</td>
<td class="goa-table-number-column">{{ user.age }}</td>
</tr>
</tbody>
</goa-table>
Expand Down
2 changes: 1 addition & 1 deletion apps/react-demo/src/routes/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default function Table() {
<tr key={user.id}>
<td>{user.firstName}</td>
<td>{user.lastName}</td>
<td>{user.age}</td>
<td className="goa-table-number-column">{user.age}</td>
</tr>
))}
</tbody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ describe("Notification Banner", () => {
it("Event triggered on notification banner dismiss", async () => {
const onDismiss = jest.fn();
const { container } = render(
<GoANotification type="information" onDismiss={onDismiss}>Information to the user goes in the content</GoANotification>
<GoANotification type="information" onDismiss={onDismiss}>
Information to the user goes in the content
</GoANotification>
);
const notificationBanner = container.querySelector("goa-notification");
fireEvent(notificationBanner, new CustomEvent("_dismiss"));
expect(onDismiss).toBeCalled();
});

});
5 changes: 5 additions & 0 deletions libs/web-components/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion libs/web-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"svelte-check": "^2.0.0",
"svelte-preprocess": "^4.0.0",
"tslib": "^2.0.0",
"typescript": "^4.0.0"
"typescript": "^4.0.0",
"vite-plugin-replace": "^0.1.1"
}
}
9 changes: 9 additions & 0 deletions libs/web-components/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import preprocess from "svelte-preprocess";
import commonjs from "@rollup/plugin-commonjs";
import typescript from "@rollup/plugin-typescript";
import css from 'rollup-plugin-css-only';
import {replaceCodePlugin} from 'vite-plugin-replace';

export default {
input: "src/index.ts",
Expand Down Expand Up @@ -36,6 +37,14 @@ export default {
resolve(),
terser(),
summary(),
replaceCodePlugin({
replacements: [
{
from: /:global\(([\[\]\(\)\-\.\:\*\w]+)\)/g,
to: "$1",
}
]
}),
],
watch: {
clearScreen: true,
Expand Down
5 changes: 5 additions & 0 deletions libs/web-components/src/components/table/Table.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@
line-height: 1rem;
}
table :global(.goa-table-number-column) {
font: var(--goa-typography-number-m);
text-align: right;
}
table.relaxed td{
padding: 1.25rem 1rem 1rem;
}
Expand Down

0 comments on commit 0c2c98b

Please sign in to comment.