Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

Topic/backport core property initialization #6595

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"@web/dev-server-storybook": "0.3.5",
"@web/storybook-prebuilt": "0.1.20",
"@web/test-runner": "0.13.4",
"@web/test-runner-playwright": "0.8.6",
"@web/test-runner-playwright": "0.8.8",
"autoprefixer": "10.2.5",
"browserslist": "4.16.6",
"bundlesize": "1.0.0-beta.2",
Expand All @@ -101,7 +101,7 @@
"lit-analyzer": "1.2.1",
"npm-run-all": "4.1.5",
"patch-package": "6.4.7",
"playwright": "1.11.1",
"playwright": "1.18.0",
"purgecss": "4.0.3",
"replace": "1.2.0",
"rollup-plugin-copy": "3.4.0",
Expand Down
7 changes: 5 additions & 2 deletions packages/core/src/breadcrumb/breadcrumb.element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ export class CdsBreadcrumb extends LitElement {

@querySlot('[slot="cds-separator"]') private customSeparator: HTMLElement;

role = 'navigation';

render() {
return html`
<div class="private-host">
Expand All @@ -47,6 +45,11 @@ export class CdsBreadcrumb extends LitElement {
`;
}

connectedCallback() {
super.connectedCallback();
this.role = 'navigation';
}

private get separator() {
if (this.customSeparator) {
const separatorClone = this.customSeparator.cloneNode(true) as Element;
Expand Down
7 changes: 5 additions & 2 deletions packages/core/src/card/card.element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ import styles from './card.element.scss';
* @cssprop --cds-card-remove-margin
*/
export class CdsCard extends CdsInternalPanel {
role = 'region';

@globalStyle() globalStyles = css`
[cds-card-remove-margin] {
margin-left: calc(-1 * var(--card-remove-margin));
Expand All @@ -61,4 +59,9 @@ export class CdsCard extends CdsInternalPanel {
static get styles() {
return [...super.styles, styles];
}

connectedCallback() {
super.connectedCallback();
this.role = 'region';
}
}
10 changes: 3 additions & 7 deletions packages/core/src/internal-components/overlay/overlay.element.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved.
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
* This software is released under MIT license.
* The full license information can be found in LICENSE in the root directory of this project.
*/
Expand Down Expand Up @@ -92,12 +92,6 @@ export class CdsInternalOverlay extends CdsBaseFocusTrap implements Animatable {
@event()
cdsMotionChange: EventEmitter<string>;

@property({ type: String })
ariaModal = 'true';

@property({ type: String })
role = 'dialog';

// renderRoot needs delegatesFocus so that focus can cross the shadowDOM
// inside an element with aria-modal set to true
/** @private */
Expand Down Expand Up @@ -138,6 +132,8 @@ export class CdsInternalOverlay extends CdsBaseFocusTrap implements Animatable {

connectedCallback() {
super.connectedCallback();
this.ariaModal = 'true';
this.role = 'dialog';
window.addEventListener('keydown', this.fireEventOnEscape);
}

Expand Down
5 changes: 2 additions & 3 deletions packages/core/src/navigation/navigation-item.element.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved.
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
* This software is released under MIT license.
* The full license information can be found in LICENSE in the root directory of this project.
*/
Expand Down Expand Up @@ -71,10 +71,9 @@ export class CdsNavigationItem extends LitElement implements FocusableItem {
@querySlotAll('[cds-navigation-sr-text]')
itemText: NodeListOf<HTMLSpanElement>;

role = 'listitem';

connectedCallback() {
super.connectedCallback();
this.role = 'listitem';
if (!this.id) {
this.id = createId();
}
Expand Down
6 changes: 2 additions & 4 deletions packages/core/src/navigation/navigation-start.element.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved.
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
* This software is released under MIT license.
* The full license information can be found in LICENSE in the root directory of this project.
*/
Expand Down Expand Up @@ -67,9 +67,6 @@ export class CdsNavigationStart extends LitElement implements FocusableItem {
@property({ type: Boolean, reflect: true })
isGroupStart = false;

@property({ type: String, reflect: true })
role = 'listitem';

@property({ type: String })
navigationGroupId: string;

Expand Down Expand Up @@ -107,6 +104,7 @@ export class CdsNavigationStart extends LitElement implements FocusableItem {

connectedCallback() {
super.connectedCallback();
this.role = 'listitem';
if (!this.id) {
this.id = createId();
}
Expand Down
5 changes: 2 additions & 3 deletions packages/core/src/navigation/navigation.element.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved.
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
* This software is released under MIT license.
* The full license information can be found in LICENSE in the root directory of this project.
*/
Expand Down Expand Up @@ -174,8 +174,6 @@ export class CdsNavigation extends LitElement implements Animatable {
@querySlotAll('cds-navigation-group')
protected navigationGroupRefs: NodeListOf<CdsNavigationGroup>;

role = 'list';

private toggle() {
this.expandedChange.emit(!this.expanded);
}
Expand Down Expand Up @@ -365,6 +363,7 @@ export class CdsNavigation extends LitElement implements Animatable {

connectedCallback() {
super.connectedCallback();
this.role = 'list';
this.rootNavigationStart?.addEventListener('focus', this.focusRootStart.bind(this));
this.rootNavigationStart?.addEventListener('blur', this.blurRootStart.bind(this));
this.rootNavigationStart?.addEventListener('keydown', this.handleRootStartKeys.bind(this));
Expand Down
67 changes: 48 additions & 19 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3241,7 +3241,7 @@
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==

"@cds/angular@./dist/angular":
version "5.5.8"
version "5.6.2"
dependencies:
jsdom "^16.5.3"
tslib "^2.0.0"
Expand Down Expand Up @@ -7276,16 +7276,7 @@
"@types/mocha" "^8.2.0"
"@web/test-runner-core" "^0.10.20"

"@web/[email protected]":
version "0.8.6"
resolved "https://registry.yarnpkg.com/@web/test-runner-playwright/-/test-runner-playwright-0.8.6.tgz#4f1c1543bef2d6b6d7788e4c835e5cf0cf365abe"
integrity sha512-GjjCd5MtCxmCsNlfe4HmmRyTg1S1SMAn0+i+2yhG9pvYwSJWLmLqN4AE39ZhlhuPh79spSVU889F6CGEXZGXPg==
dependencies:
"@web/test-runner-core" "^0.10.8"
"@web/test-runner-coverage-v8" "^0.4.5"
playwright "^1.8.1"

"@web/test-runner-playwright@^0.8.8":
"@web/[email protected]", "@web/test-runner-playwright@^0.8.8":
version "0.8.8"
resolved "https://registry.yarnpkg.com/@web/test-runner-playwright/-/test-runner-playwright-0.8.8.tgz#c06de60c0283611f5f0ef478779a7605a35e0895"
integrity sha512-bhb0QVldfDoPJqOj5mm1hpE6FReyddc/iIuAkVf/kbJvgggTCT2bWGxUvXJlGzf+4epmDhU+hSTfEoLL9R2vGw==
Expand Down Expand Up @@ -7763,7 +7754,7 @@ [email protected]:
resolved "https://registry.yarnpkg.com/after/-/after-0.8.2.tgz#fedb394f9f0e02aa9768e702bda23b505fae7e1f"
integrity sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8=

agent-base@6:
agent-base@6, agent-base@^6.0.2:
version "6.0.2"
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77"
integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==
Expand Down Expand Up @@ -10490,6 +10481,11 @@ commander@^7.1.0:
resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7"
integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==

commander@^8.2.0:
version "8.3.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66"
integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==

commander@~2.19.0:
version "2.19.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a"
Expand Down Expand Up @@ -12029,6 +12025,13 @@ debug@^3.0.0, debug@^3.1.0, debug@^3.1.1, debug@^3.2.5, debug@^3.2.6:
dependencies:
ms "^2.1.1"

debug@^4.3.1:
version "4.3.3"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664"
integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==
dependencies:
ms "2.1.2"

decamelize-keys@^1.0.0, decamelize-keys@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/decamelize-keys/-/decamelize-keys-1.1.0.tgz#d171a87933252807eb3cb61dc1c1445d078df2d9"
Expand Down Expand Up @@ -22924,12 +22927,12 @@ pkg-up@^2.0.0:
dependencies:
find-up "^2.1.0"

playwright@1.11.1, playwright@^1.8.1:
version "1.11.1"
resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.11.1.tgz#c5f2946db5195bd099a57ce4e188c01057876cff"
integrity sha512-UuMrYuvzttbJXUD7sTVcQBsGRojelGepvuQPD+QtVm/n5zyKvkiUErU/DGRXfX8VDZRdQ5D6qVqZndrydC2b4w==
playwright-core@=1.18.0:
version "1.18.0"
resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.18.0.tgz#b4d2b9068f26357adaa952a13254796fd439f322"
integrity sha512-JTRlCVpfAFcC1nth+XIE07w6M5m6C8PaEoClv7wGWF97cyDMcHIij0xIVEKMKli7IG5N0mqjLDFc/akXSbMZ1g==
dependencies:
commander "^6.1.0"
commander "^8.2.0"
debug "^4.1.1"
extract-zip "^2.0.1"
https-proxy-agent "^5.0.0"
Expand All @@ -22940,10 +22943,19 @@ [email protected], playwright@^1.8.1:
proper-lockfile "^4.1.1"
proxy-from-env "^1.1.0"
rimraf "^3.0.2"
socks-proxy-agent "^6.1.0"
stack-utils "^2.0.3"
ws "^7.3.1"
ws "^7.4.6"
yauzl "^2.10.0"
yazl "^2.5.1"

[email protected]:
version "1.18.0"
resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.18.0.tgz#4613e19147ffa5f77ad845227f007b9b94a366f8"
integrity sha512-GOWvcWRtL7o6QCj6tvZCxqHKx2sIhXeEmEJAqQdOZgxzQiCkPe1hnTHab1p8R1bDvHK703fDS2oIbs3mcvg6gw==
dependencies:
playwright-core "=1.18.0"

playwright@^1.14.0:
version "1.15.2"
resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.15.2.tgz#b350056d1fffbe5de5b1bdaca6ab73e35758baad"
Expand Down Expand Up @@ -26829,6 +26841,15 @@ socks-proxy-agent@^5.0.0:
debug "4"
socks "^2.3.3"

socks-proxy-agent@^6.1.0:
version "6.1.1"
resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-6.1.1.tgz#e664e8f1aaf4e1fb3df945f09e3d94f911137f87"
integrity sha512-t8J0kG3csjA4g6FTbsMOWws+7R7vuRC8aQ/wy3/1OWmsgwA68zs/+cExQ0koSitUDXqhufF/YJr9wtNMZHw5Ew==
dependencies:
agent-base "^6.0.2"
debug "^4.3.1"
socks "^2.6.1"

socks@^2.3.3:
version "2.6.0"
resolved "https://registry.yarnpkg.com/socks/-/socks-2.6.0.tgz#6b984928461d39871b3666754b9000ecf39dfac2"
Expand All @@ -26837,6 +26858,14 @@ socks@^2.3.3:
ip "^1.1.5"
smart-buffer "^4.1.0"

socks@^2.6.1:
version "2.6.1"
resolved "https://registry.yarnpkg.com/socks/-/socks-2.6.1.tgz#989e6534a07cf337deb1b1c94aaa44296520d30e"
integrity sha512-kLQ9N5ucj8uIcxrDwjm0Jsqk06xdpBjGNQtpXy4Q8/QY2k+fY7nZH8CARy+hkbG+SGAovmzzuauCpBlb8FrnBA==
dependencies:
ip "^1.1.5"
smart-buffer "^4.1.0"

sort-keys-length@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/sort-keys-length/-/sort-keys-length-1.0.1.tgz#9cb6f4f4e9e48155a6aa0671edd336ff1479a188"
Expand Down Expand Up @@ -30748,7 +30777,7 @@ [email protected]:
dependencies:
mkdirp "^0.5.1"

[email protected], ws@^7.3.1, ws@^7.4.2:
[email protected], ws@^7.4.2:
version "7.4.6"
resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c"
integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==
Expand Down