Skip to content

Commit 5646a63

Browse files
authored
Merge branch 'master' into dropdown-list-accessibility
2 parents c56690b + e54c845 commit 5646a63

File tree

13 files changed

+144
-46
lines changed

13 files changed

+144
-46
lines changed

integration/ng14/package-lock.json

Lines changed: 7 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

integration/ng15/package-lock.json

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

integration/ng16/angular.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
{
4848
"type": "initial",
4949
"maximumWarning": "500kb",
50-
"maximumError": "1mb"
50+
"maximumError": "1.5mb"
5151
},
5252
{
5353
"type": "anyComponentStyle",

integration/ng16/package-lock.json

Lines changed: 7 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 29 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"scripts": {
77
"build": "bash scripts/build.sh",
88
"storybook": "ng run carbon-components-angular:storybook",
9-
"docs:build": "compodoc -p tsconfig.doc.json -t",
9+
"docs:build": "compodoc -p tsconfig.doc.json -t && node ./scripts/compliance.js",
1010
"docs:json": "compodoc --config compodoc.storybook.json",
1111
"lint": "tslint 'src/**/*.ts'",
1212
"lint:fix": "tslint --fix 'src/**/*.ts'",
@@ -140,7 +140,7 @@
140140
},
141141
"dependencies": {
142142
"@carbon/icon-helpers": "10.37.0",
143-
"@carbon/icons": "11.14.0",
143+
"@carbon/icons": "11.58.0",
144144
"@carbon/utils-position": "1.1.4",
145145
"@floating-ui/dom": "1.6.13",
146146
"@ibm/telemetry-js": "^1.5.0",

scripts/compliance.js

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
const fs = require('fs');
2+
const path = require('path');
3+
4+
const entryDirectory = './documentation';
5+
6+
const componentToAppend = `
7+
8+
<footer class="carbon">
9+
<dds-footer-container key="footer" disable-locale-button="true" size="micro" />
10+
</footer>
11+
12+
<script
13+
key="8"
14+
type="module"
15+
src="https://1.www.s81c.com/common/carbon-for-ibm-dotcom/tag/v1/latest/footer.min.js">
16+
</script>
17+
18+
<!-- Storybook override -->
19+
<script>
20+
document.title = "Carbon Components Angular";
21+
</script>
22+
23+
<script
24+
src="//1.www.s81c.com/common/stats/ibm-common.js"
25+
type="text/javascript"
26+
async="async">
27+
</script>
28+
</body>`;
29+
const styleToAppend = `
30+
<style>
31+
footer.carbon {
32+
position: absolute;
33+
bottom: 0;
34+
width: 100%;
35+
z-index: 9999;
36+
}
37+
#root > div {
38+
/*
39+
* Subtracting the height of the footer to prevent
40+
* overlaying the footer ontop of content
41+
*/
42+
height: calc(100vh - 48px);
43+
}
44+
</style>
45+
</head>`;
46+
47+
48+
function rewriteHtmlFile(filePath) {
49+
fs.readFile(filePath, 'utf8', (err, data) => {
50+
if (err) {
51+
console.error('Error reading file', filePath, err);
52+
return;
53+
}
54+
55+
let newContent = data.replace('</body>', componentToAppend);
56+
newContent = newContent.replace('</head>', styleToAppend);
57+
58+
fs.writeFile(filePath, newContent, 'utf8', (err) => {
59+
if(err) {
60+
console.error('Error writing file', filePath, err);
61+
} else {
62+
console.log('Success writing file', filePath);
63+
}
64+
})
65+
})
66+
}
67+
68+
function walkDirectory(dir) {
69+
fs.readdir(dir, { withFileTypes: true }, (err, items) => {
70+
if (err) {
71+
console.error('Error reading directory', dir, err);
72+
return;
73+
}
74+
75+
items.forEach((item) => {
76+
const fullPath = path.join(dir, item.name);
77+
if (item.isDirectory()) {
78+
walkDirectory(fullPath);
79+
} else if (item.isFile() && path.extname(item.name) === '.html') {
80+
rewriteHtmlFile(fullPath);
81+
}
82+
})
83+
})
84+
}
85+
86+
walkDirectory(entryDirectory);

src/dropdown/dropdown.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ import { hasScrollableParents } from "carbon-components-angular/utils";
9696
[ngClass]="{'a': !menuIsClosed}"
9797
[attr.aria-expanded]="!menuIsClosed"
9898
[attr.aria-disabled]="disabled"
99-
[attr.aria-readonly]="readonly"
10099
aria-haspopup="listbox"
101100
(click)="disabled || readonly ? $event.stopPropagation() : toggleMenu()"
102101
(focus)="fluid ? handleFocus($event) : null"

src/dropdown/list/dropdown-list.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ export class DropdownList implements AbstractDropdownView, AfterViewInit, OnDest
508508
const selected = this.getSelected();
509509
if (selected.length) {
510510
this.index = this.displayItems.indexOf(selected[0]);
511-
} else if (this.hasNextElement()) {
511+
} else if (this.index < 0 && this.hasNextElement()) {
512512
this.getNextElement();
513513
}
514514
}

src/i18n/en.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export default {
4545
"TITLE": "Loading"
4646
},
4747
"MODAL": {
48-
"CLOSE": "Close modal"
48+
"CLOSE": "Close"
4949
},
5050
"NOTIFICATION": {
5151
"CLOSE_BUTTON": "Close alert notification"

0 commit comments

Comments
 (0)