@vaadin/vaadin-list-mixin
Advanced tools
Comparing version 22.0.0-beta1 to 22.0.0-beta2
{ | ||
"name": "@vaadin/vaadin-list-mixin", | ||
"version": "22.0.0-beta1", | ||
"version": "22.0.0-beta2", | ||
"publishConfig": { | ||
@@ -33,4 +33,5 @@ "access": "public" | ||
"dependencies": { | ||
"@open-wc/dedupe-mixin": "^1.3.0", | ||
"@polymer/polymer": "^3.0.0", | ||
"@vaadin/component-base": "22.0.0-beta1" | ||
"@vaadin/component-base": "22.0.0-beta2" | ||
}, | ||
@@ -42,3 +43,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "4cf8a9d0504994200c610e44b3676114fef49c1e" | ||
"gitHead": "f13833683e6667f6ca6678452db14aa6b7eac4a4" | ||
} |
@@ -6,2 +6,3 @@ /** | ||
*/ | ||
import { Constructor } from '@open-wc/dedupe-mixin'; | ||
@@ -11,13 +12,9 @@ /** | ||
*/ | ||
declare function ListMixin<T extends new (...args: any[]) => {}>(base: T): T & ListMixinConstructor; | ||
export declare function ListMixin<T extends Constructor<HTMLElement>>(base: T): T & Constructor<ListMixinClass>; | ||
interface ListMixinConstructor { | ||
new (...args: any[]): ListMixin; | ||
} | ||
export declare class ListMixinClass { | ||
protected readonly focused: Element | null; | ||
interface ListMixin { | ||
readonly focused: Element | null; | ||
protected readonly _scrollerElement: HTMLElement; | ||
readonly _scrollerElement: HTMLElement; | ||
/** | ||
@@ -54,3 +51,1 @@ * Used for mixin detection because `instanceof` does not work with mixins. | ||
} | ||
export { ListMixin, ListMixinConstructor }; |
@@ -7,5 +7,5 @@ /** | ||
import { FlattenedNodesObserver } from '@polymer/polymer/lib/utils/flattened-nodes-observer.js'; | ||
import { timeOut } from '@vaadin/component-base/src/async.js'; | ||
import { Debouncer } from '@vaadin/component-base/src/debounce.js'; | ||
import { DirHelper } from '@vaadin/component-base/src/dir-helper.js'; | ||
import { Debouncer } from '@vaadin/component-base/src/debounce.js'; | ||
import { timeOut } from '@vaadin/component-base/src/async.js'; | ||
@@ -288,5 +288,18 @@ /** | ||
this._scrollToItem(idx); | ||
item.focus(); | ||
this._focusItem(item); | ||
} | ||
/** | ||
* Always set focus-ring on the item managed by the list-box | ||
* for backwards compatibility with the old implementation. | ||
* @param {HTMLElement} item | ||
* @protected | ||
*/ | ||
_focusItem(item) { | ||
if (item) { | ||
item.focus(); | ||
item.setAttribute('focus-ring', ''); | ||
} | ||
} | ||
focus() { | ||
@@ -296,3 +309,3 @@ // In initialisation (e.g vaadin-select) observer might not been run yet. | ||
const firstItem = this.querySelector('[tabindex="0"]') || (this.items ? this.items[0] : null); | ||
firstItem && firstItem.focus(); | ||
this._focusItem(firstItem); | ||
} | ||
@@ -299,0 +312,0 @@ |
@@ -6,3 +6,4 @@ /** | ||
*/ | ||
import { ListMixin, ListMixinConstructor } from './vaadin-list-mixin.js'; | ||
import { Constructor } from '@open-wc/dedupe-mixin'; | ||
import { ListMixinClass } from './vaadin-list-mixin.js'; | ||
@@ -12,11 +13,7 @@ /** | ||
*/ | ||
declare function MultiSelectListMixin<T extends new (...args: any[]) => {}>( | ||
export declare function MultiSelectListMixin<T extends Constructor<HTMLElement>>( | ||
base: T | ||
): T & MultiSelectListMixinConstructor & ListMixinConstructor; | ||
): T & Constructor<ListMixinClass> & Constructor<ListMixinClass>; | ||
interface MultiSelectListMixinConstructor { | ||
new (...args: any[]): MultiSelectListMixin; | ||
} | ||
interface MultiSelectListMixin extends ListMixin { | ||
export declare class MultiSelectListMixinClass { | ||
/** | ||
@@ -33,3 +30,1 @@ * Specifies that multiple options can be selected at once. | ||
} | ||
export { MultiSelectListMixin, MultiSelectListMixinConstructor }; |
29334
510
3
+ Added@open-wc/dedupe-mixin@^1.3.0
+ Added@open-wc/dedupe-mixin@1.4.0(transitive)
+ Added@vaadin/component-base@22.0.0-beta2(transitive)
- Removed@vaadin/component-base@22.0.0-beta1(transitive)