Skip to content

Commit eea9b30

Browse files
Elliott Marquezcopybara-github
authored andcommitted
refactor: change all private fields to protected
PiperOrigin-RevId: 370779647
1 parent c99d1fa commit eea9b30

File tree

19 files changed

+60
-59
lines changed

19 files changed

+60
-59
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
99
### Changed
1010
- all
1111
- Upgrade typescript to 4.1.4
12+
- Change all fields from `private` to `protected`
1213
- `base`
1314
- Clean up RippleInterface now that the ripple directive has been removed
1415
- Remove `HTMLElementWithRipple` interface

packages/base/test/aria-property.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class TestElement extends LitElement {
2929
@property({type: String, attribute: 'aria-label'})
3030
ariaLabel?: string;
3131

32-
private internalAriaChecked: 'true'|'false'|'mixed'|undefined = undefined;
32+
protected internalAriaChecked: 'true'|'false'|'mixed'|undefined = undefined;
3333

3434
@ariaProperty
3535
@property({attribute: 'aria-checked'})

packages/button/mwc-button-base.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ export class ButtonBase extends LitElement {
149149
}
150150

151151
@eventOptions({passive: true})
152-
private handleRippleActivate(evt?: Event) {
152+
protected handleRippleActivate(evt?: Event) {
153153
const onUp = () => {
154154
window.removeEventListener('mouseup', onUp);
155155

@@ -160,23 +160,23 @@ export class ButtonBase extends LitElement {
160160
this.rippleHandlers.startPress(evt);
161161
}
162162

163-
private handleRippleDeactivate() {
163+
protected handleRippleDeactivate() {
164164
this.rippleHandlers.endPress();
165165
}
166166

167-
private handleRippleMouseEnter() {
167+
protected handleRippleMouseEnter() {
168168
this.rippleHandlers.startHover();
169169
}
170170

171-
private handleRippleMouseLeave() {
171+
protected handleRippleMouseLeave() {
172172
this.rippleHandlers.endHover();
173173
}
174174

175-
private handleRippleFocus() {
175+
protected handleRippleFocus() {
176176
this.rippleHandlers.startFocus();
177177
}
178178

179-
private handleRippleBlur() {
179+
protected handleRippleBlur() {
180180
this.rippleHandlers.endFocus();
181181
}
182182
}

packages/checkbox/mwc-checkbox-base.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export class CheckboxBase extends FormElement {
107107
}
108108
}
109109

110-
private rippleElement: Ripple|null = null;
110+
protected rippleElement: Ripple|null = null;
111111

112112
protected rippleHandlers: RippleHandlers = new RippleHandlers(() => {
113113
this.shouldRenderRipple = true;

packages/circular-progress/mwc-circular-progress-base.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export class CircularProgressBase extends LitElement {
7878
/**
7979
* @soyTemplate
8080
*/
81-
private renderDeterminateContainer(): TemplateResult {
81+
protected renderDeterminateContainer(): TemplateResult {
8282
const sideLength = 48 + this.density * 4;
8383
const center = sideLength / 2;
8484
const circleRadius = this.density >= -3 ? 18 + this.density * 11 / 6 :

packages/dialog/mwc-dialog-base.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ export class DialogBase extends BaseElement {
114114
this.initialSupressDefaultPressSelector;
115115
}
116116

117-
private closingDueToDisconnect?: boolean;
118-
private initialSupressDefaultPressSelector = '';
117+
protected closingDueToDisconnect?: boolean;
118+
protected initialSupressDefaultPressSelector = '';
119119

120120
protected get primaryButton(): HTMLElement|null {
121121
let assignedNodes = (this.primarySlot as HTMLSlotElement).assignedNodes();
@@ -173,7 +173,7 @@ export class DialogBase extends BaseElement {
173173
return initFocusElement;
174174
}
175175

176-
private searchNodeTreesForAttribute(nodes: Node[], attribute: string):
176+
protected searchNodeTreesForAttribute(nodes: Node[], attribute: string):
177177
HTMLElement|null {
178178
for (const node of nodes) {
179179
if (!(node instanceof HTMLElement)) {

packages/drawer/mwc-drawer-base.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ export class DrawerBase extends BaseElement {
9191
};
9292
}
9393

94-
private _previousFocus: HTMLElement|null = null;
94+
protected _previousFocus: HTMLElement|null = null;
9595

96-
private _handleScrimClick() {
96+
protected _handleScrimClick() {
9797
if (this.mdcFoundation instanceof MDCModalDrawerFoundation) {
9898
this.mdcFoundation.handleScrimClick();
9999
}

packages/formfield/mwc-formfield-base.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export class FormfieldBase extends BaseElement {
109109
</div>`;
110110
}
111111

112-
private _labelClick() {
112+
protected _labelClick() {
113113
const input = this.input;
114114
if (input) {
115115
input.focus();

packages/linear-progress/mwc-linear-progress-base.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export class LinearProgressBase extends LitElement {
147147
this.attachResizeObserver();
148148
}
149149

150-
private syncClosedState() {
150+
protected syncClosedState() {
151151
this.closedAnimationOff = this.closed;
152152
}
153153

packages/list/mwc-list-foundation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export class MDCListFoundation extends MDCFoundation<MDCListAdapter> {
126126
};
127127
}
128128

129-
private isMulti_ = false;
129+
protected isMulti_ = false;
130130
private wrapFocus_ = false;
131131
private isVertical_ = true;
132132
private selectedIndex_: MWCListIndex = numbers.UNSET_INDEX;

0 commit comments

Comments
 (0)