Skip to content

Commit

Permalink
fix: remove .map function that doesn't work in SSR support #94
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-capsule42 committed Oct 31, 2024
1 parent cf3ae3e commit 5cdb374
Show file tree
Hide file tree
Showing 7 changed files with 134 additions and 7 deletions.
2 changes: 1 addition & 1 deletion demo/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
Prism.highlightAll();
});
</script>
<script type="module" src="../index.js" data-demo-script="true"></script>
<script type="module" src="./api.min.js" data-demo-script="true"></script>

<!-- If additional elements are needed for the demo, add them here. -->
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-accordion@latest/dist/auro-accordion__bundled.js" type="module"></script>
Expand Down
1 change: 1 addition & 0 deletions demo/api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import '../index.js';
114 changes: 114 additions & 0 deletions demo/api.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion demo/index.min.js

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

12 changes: 11 additions & 1 deletion rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,14 @@ const indexExamplesConfig = {
}
};

export default [modernConfig, indexExamplesConfig];
const apExamplesConfig = {
input: {
['api.min']: './demo/api.js',
},
output: {
format: 'esm',
dir: 'demo/'
}
};

export default [modernConfig, indexExamplesConfig, apExamplesConfig];
2 changes: 1 addition & 1 deletion src/auro-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export class AuroTable extends LitElement {
<table>
<thead>
<tr>
${this.columnHeaders.map((header) => html`
${this.columnHeaders.forEach((header) => html`
<th>${header}</th>
`)}
</tr>
Expand Down
8 changes: 5 additions & 3 deletions test/auro-table.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ describe('auro-table', () => {
`);

const table = el.shadowRoot.querySelector('table');
const columns = table.querySelectorAll('th');
const rows = table.querySelectorAll('tr');
const columns = rows[1].querySelectorAll('td');

expect(columns.length).to.equal(3);
expect(rows.length).to.equal(3);
Expand All @@ -33,7 +33,8 @@ describe('auro-table', () => {
`);

const table = el.shadowRoot.querySelector('table');
const columns = table.querySelectorAll('th');
const rows = table.querySelectorAll('tr');
const columns = rows[1].querySelectorAll('td');
const details = table.querySelectorAll('td');

expect(columns.length).to.equal(3);
Expand All @@ -50,7 +51,8 @@ describe('auro-table', () => {
`);

const table = el.shadowRoot.querySelector('table');
const columns = table.querySelectorAll('th');
const rows = table.querySelectorAll('tr');
const columns = rows[1].querySelectorAll('td');
const details = table.querySelectorAll('td');

expect(columns.length).to.equal(3);
Expand Down

0 comments on commit 5cdb374

Please sign in to comment.