Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the order of private members for linting. #5101

Merged
merged 1 commit into from
Oct 23, 2024
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
20 changes: 10 additions & 10 deletions components/focus-trap/focus-trap.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,6 @@ class FocusTrap extends FocusMixin(LitElement) {
`;
}

static #exemptSelectors = [
'.d2l-focus-trap-exempt',
'.equatio-toolbar-wrapper',
'.equatio-toolbar-shadow-root-container'
].join(', ');

static #isExempt(target) {
return !!target?.closest(this.#exemptSelectors);
}

constructor() {
super();
this.trap = false;
Expand Down Expand Up @@ -91,6 +81,12 @@ class FocusTrap extends FocusMixin(LitElement) {
}
}

static #exemptSelectors = [
'.d2l-focus-trap-exempt',
'.equatio-toolbar-wrapper',
'.equatio-toolbar-shadow-root-container'
].join(', ');

_focusFirst() {
const focusable = this.shadowRoot &&
getNextFocusable(this.shadowRoot.querySelector('.d2l-focus-trap-start'));
Expand Down Expand Up @@ -147,6 +143,10 @@ class FocusTrap extends FocusMixin(LitElement) {
this._focusFirst();
}

static #isExempt(target) {
return !!target?.closest(this.#exemptSelectors);
}

}

customElements.define('d2l-focus-trap', FocusTrap);
14 changes: 7 additions & 7 deletions mixins/loading-complete/loading-complete-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@ import { dedupeMixin } from '@open-wc/dedupe-mixin';

export const LoadingCompleteMixin = dedupeMixin((superclass) => class extends superclass {

#loadingCompleteResolve;

// eslint-disable-next-line sort-class-members/sort-class-members
#loadingCompletePromise = !Object.prototype.hasOwnProperty.call(this.constructor.prototype, 'getLoadingComplete')
? new Promise(resolve => this.#loadingCompleteResolve = resolve)
: Promise.resolve();

get loadingComplete() {
return this.getLoadingComplete();
}
Expand All @@ -27,4 +20,11 @@ export const LoadingCompleteMixin = dedupeMixin((superclass) => class extends su
return this.#loadingCompletePromise;
}

#loadingCompleteResolve;

// eslint-disable-next-line sort-class-members/sort-class-members
#loadingCompletePromise = !Object.prototype.hasOwnProperty.call(this.constructor.prototype, 'getLoadingComplete')
? new Promise(resolve => this.#loadingCompleteResolve = resolve)
: Promise.resolve();

});
4 changes: 2 additions & 2 deletions mixins/localize/localize-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import { ifDefined } from 'lit/directives/if-defined.js';

export const _LocalizeMixinBase = dedupeMixin(superclass => class LocalizeMixinBaseClass extends getLocalizeClass(superclass) {

#updatedProperties = new Map();

constructor() {
super();
super.constructor.setLocalizeMarkup(localizeMarkup);
Expand Down Expand Up @@ -63,6 +61,8 @@ export const _LocalizeMixinBase = dedupeMixin(superclass => class LocalizeMixinB
this.requestUpdate('localize');
}

#updatedProperties = new Map();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do find defining the private properties down here a little weird. But that's the order we always had for them.


});

export const LocalizeMixin = superclass => class extends _LocalizeMixinBase(superclass) {
Expand Down
7 changes: 3 additions & 4 deletions package-lock.json

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

Loading