0

WebUI: Fix type errors in cr_elements, when stricter flags are used.

These errors only show up if tools/typescript/tsconfig_base_lit.json
is used as the configuration, which unfortunately is not yet possible,
due to still maintaining several Polymer files (mostly Mixins) under
the same ts_library() target.

Bug: 40943652
Change-Id: I648af0148f0e4daafe3103077dc5d66be5263a09
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5540235
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1301631}
This commit is contained in:
dpapad
2024-05-15 22:46:48 +00:00
committed by Chromium LUCI CQ
parent d25f3322f8
commit 3d87dab48a
11 changed files with 18 additions and 21 deletions
ui/webui/resources/cr_elements

@ -59,8 +59,8 @@ export class CrButtonElement extends CrButtonElementBase {
}
disabled: boolean = false;
private hasPrefixIcon_: boolean = false;
private hasSuffixIcon_: boolean = false;
protected hasPrefixIcon_: boolean = false;
protected hasSuffixIcon_: boolean = false;
/**
* It is possible to activate a tab when the space key is pressed down. When

@ -111,7 +111,6 @@ export class CrDialogElement extends CrDialogElementBase {
showOnAttach: boolean = false;
ariaDescriptionText?: string;
private intersectionObserver_: IntersectionObserver|null = null;
private mutationObserver_: MutationObserver|null = null;
private boundKeydown_: ((e: KeyboardEvent) => void)|null = null;

@ -49,7 +49,7 @@ export class CrDrawerElement extends CrLitElement {
heading: string;
align: 'ltr'|'rtl' = 'ltr';
private show_: boolean;
protected show_: boolean = false;
get open(): boolean {
return this.$.dialog.open;

@ -40,8 +40,8 @@ export class CrIconElement extends CrLitElement {
if (changedProperties.has('icon')) {
const [iconsetName, iconName] = this.icon.split(':');
this.iconName_ = iconName;
this.iconsetName_ = iconsetName;
this.iconName_ = iconName || '';
this.iconsetName_ = iconsetName || '';
this.updateIcon();
}
}

@ -99,7 +99,7 @@ export class CrIconButtonElement extends CrIconbuttonElementBase {
disabled: boolean = false;
ironIcon?: string;
private multipleIcons_: boolean = false;
protected multipleIcons_: boolean = false;
/**
* It is possible to activate a tab when the space key is pressed down. When

@ -87,7 +87,6 @@ export const CrSelectableMixin = <T extends Constructor<CrLitElement>>(
selectOnClick: boolean = true;
private items_: Element[] = [];
private observer_: MutationObserver;
private selectedItem_: Element|null = null;
override firstUpdated(changedProperties: PropertyValues<this>) {

@ -180,10 +180,10 @@ export class CrSliderElement extends CrSliderElementBase {
ticks: SliderTick[]|number[] = [];
value: number;
private disabled_: boolean;
protected disabled_: boolean;
protected label_: string = '';
private showLabel_: boolean = false;
private transiting_: boolean = false;
protected showLabel_: boolean = false;
protected transiting_: boolean = false;
private deltaKeyMap_: Map<string, number>|null = null;
private draggingEventTracker_: EventTracker|null = null;

@ -65,7 +65,6 @@ export class CrTabsElement extends CrLitElement {
selected: number;
private isRtl_: boolean = false;
private lastSelected_: number|null = null;
override connectedCallback() {
super.connectedCallback();

@ -96,14 +96,14 @@ export class CrToolbarElement extends CrLitElement {
searchPrompt: string;
clearLabel: string;
menuLabel: string;
spinnerActive: boolean;
spinnerActive: boolean = false;
showMenu: boolean = false;
showSearch: boolean = true;
override autofocus: boolean = false;
narrow: boolean;
narrow: boolean = false;
narrowThreshold: number = 900;
alwaysShowLogo: boolean = false;
protected showingSearch_: boolean;
protected showingSearch_: boolean = false;
searchIconOverride?: string;
private narrowQuery_: MediaQueryList|null = null;

@ -76,11 +76,11 @@ export class CrToolbarSearchFieldElement extends
};
}
narrow: boolean;
narrow: boolean = false;
showingSearch: boolean = false;
disabled: boolean = false;
override autofocus: boolean = false;
spinnerActive: boolean;
spinnerActive: boolean = false;
private searchFocused_: boolean = false;
iconOverride?: string;

@ -120,7 +120,7 @@ export class CrUrlListItemElement extends CrUrlListItemElementBase {
};
}
alwaysShowSuffix: boolean;
alwaysShowSuffix: boolean = false;
asAnchor: boolean = false;
itemAriaLabel?: string;
itemAriaDescription?: string;
@ -128,9 +128,9 @@ export class CrUrlListItemElement extends CrUrlListItemElementBase {
description?: string;
reverseElideDescription: boolean = false;
hasBadges: boolean = false;
private hasDescriptions_: boolean = false;
private hasSlottedContent_: boolean = false;
private isFolder_: boolean = false;
protected hasDescriptions_: boolean = false;
protected hasSlottedContent_: boolean = false;
protected isFolder_: boolean = false;
size: CrUrlListItemSize = CrUrlListItemSize.MEDIUM;
override title: string = '';
url?: string;