-
Notifications
You must be signed in to change notification settings - Fork 665
Collection.Base: convert to ES6 Class #28762
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -16,6 +16,7 @@ import { extend } from '@js/core/utils/extend'; | |||||
| import { each } from '@js/core/utils/iterator'; | ||||||
| import { isDefined, isPlainObject } from '@js/core/utils/type'; | ||||||
| import { compare as compareVersions } from '@js/core/utils/version'; | ||||||
| import type { DxEvent } from '@js/events'; | ||||||
| import { focusable as focusableSelector } from '@js/ui/widget/selectors'; | ||||||
| import type { WidgetOptions } from '@js/ui/widget/ui.widget'; | ||||||
|
|
||||||
|
|
@@ -47,14 +48,14 @@ export interface Properties<TComponent = any> extends WidgetOptions<TComponent> | |||||
| class Widget< | ||||||
| TProperties extends Properties = Properties, | ||||||
| > extends DOMComponent<Widget<TProperties>, TProperties> { | ||||||
| private readonly _feedbackHideTimeout = 400; | ||||||
| public _activeStateUnit!: string; | ||||||
|
|
||||||
| public _feedbackHideTimeout = 400; | ||||||
|
|
||||||
| private readonly _feedbackShowTimeout = 30; | ||||||
|
|
||||||
| private _contentReadyAction?: ((event?: Record<string, unknown>) => void) | null; | ||||||
|
|
||||||
| private readonly _activeStateUnit!: string; | ||||||
|
|
||||||
| private _keyboardListenerId?: string | null; | ||||||
|
|
||||||
| private _isReady?: boolean; | ||||||
|
|
@@ -265,8 +266,9 @@ class Widget< | |||||
| return this._getActiveElement(); | ||||||
| } | ||||||
|
|
||||||
| _isFocusTarget(element: Element): boolean { | ||||||
| _isFocusTarget(element: Element | undefined): boolean { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion: we can use shorter form
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll consider in the further PRs |
||||||
| const focusTargets = $(this._focusTarget()).toArray(); | ||||||
| // @ts-expect-error ts-error | ||||||
| return focusTargets.includes(element); | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's fix error instead of muting
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll consider in the further PRs |
||||||
| } | ||||||
|
|
||||||
|
|
@@ -306,7 +308,7 @@ class Widget< | |||||
| } | ||||||
|
|
||||||
| // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types | ||||||
| _focusInHandler(event): void { | ||||||
| _focusInHandler(event: DxEvent): void { | ||||||
| if (!event.isDefaultPrevented()) { | ||||||
| this._createActionByOption('onFocusIn', { | ||||||
| beforeExecute: () => this._updateFocusState(event, true), | ||||||
|
|
@@ -316,7 +318,7 @@ class Widget< | |||||
| } | ||||||
|
|
||||||
| // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types | ||||||
| _focusOutHandler(event): void { | ||||||
| _focusOutHandler(event: DxEvent): void { | ||||||
| if (!event.isDefaultPrevented()) { | ||||||
| this._createActionByOption('onFocusOut', { | ||||||
| beforeExecute: () => this._updateFocusState(event, false), | ||||||
|
|
||||||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why should it be public?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because _feedbackHideTimeout overrides inside the children