Fixed #5470 - Dropdown Pass Through: item
parent
45a4b259da
commit
fce857ae8c
|
@ -10,7 +10,7 @@
|
||||||
import { HTMLAttributes, InputHTMLAttributes, TransitionProps, VNode } from 'vue';
|
import { HTMLAttributes, InputHTMLAttributes, TransitionProps, VNode } from 'vue';
|
||||||
import { ComponentHooks } from '../basecomponent';
|
import { ComponentHooks } from '../basecomponent';
|
||||||
import { PassThroughOptions } from '../passthrough';
|
import { PassThroughOptions } from '../passthrough';
|
||||||
import { ClassComponent, GlobalComponentConstructor, PassThrough, HintedString } from '../ts-helpers';
|
import { ClassComponent, GlobalComponentConstructor, HintedString, PassThrough } from '../ts-helpers';
|
||||||
import { VirtualScrollerItemOptions, VirtualScrollerPassThroughOptionType, VirtualScrollerProps } from '../virtualscroller';
|
import { VirtualScrollerItemOptions, VirtualScrollerPassThroughOptionType, VirtualScrollerProps } from '../virtualscroller';
|
||||||
|
|
||||||
export declare type DropdownPassThroughOptionType<T = any> = DropdownPassThroughAttributes | ((options: DropdownPassThroughMethodOptions<T>) => DropdownPassThroughAttributes | string) | string | null | undefined;
|
export declare type DropdownPassThroughOptionType<T = any> = DropdownPassThroughAttributes | ((options: DropdownPassThroughMethodOptions<T>) => DropdownPassThroughAttributes | string) | string | null | undefined;
|
||||||
|
@ -234,6 +234,14 @@ export interface DropdownState {
|
||||||
* Defines current options in Dropdown component.
|
* Defines current options in Dropdown component.
|
||||||
*/
|
*/
|
||||||
export interface DropdownContext {
|
export interface DropdownContext {
|
||||||
|
/**
|
||||||
|
* Current item option.
|
||||||
|
*/
|
||||||
|
option: any;
|
||||||
|
/**
|
||||||
|
* Current item index.
|
||||||
|
*/
|
||||||
|
index: number;
|
||||||
/**
|
/**
|
||||||
* Current selection state of the item as a boolean.
|
* Current selection state of the item as a boolean.
|
||||||
* @defaultValue false
|
* @defaultValue false
|
||||||
|
|
|
@ -271,6 +271,8 @@ export default {
|
||||||
getPTItemOptions(option, itemOptions, index, key) {
|
getPTItemOptions(option, itemOptions, index, key) {
|
||||||
return this.ptm(key, {
|
return this.ptm(key, {
|
||||||
context: {
|
context: {
|
||||||
|
option,
|
||||||
|
index,
|
||||||
selected: this.isSelected(option),
|
selected: this.isSelected(option),
|
||||||
focused: this.focusedOptionIndex === this.getOptionIndex(index, itemOptions),
|
focused: this.focusedOptionIndex === this.getOptionIndex(index, itemOptions),
|
||||||
disabled: this.isOptionDisabled(option)
|
disabled: this.isOptionDisabled(option)
|
||||||
|
|
Loading…
Reference in New Issue