Refactor #3924 - For OrderList

This commit is contained in:
Tuğçe Küçükoğlu 2023-05-09 19:03:01 +03:00
parent c7ffcaa08d
commit f1ea8f9f9a
4 changed files with 150 additions and 16 deletions

View file

@ -8,8 +8,20 @@
*
*/
import { ButtonHTMLAttributes, HTMLAttributes, VNode } from 'vue';
import { ButtonPassThroughOptionType } from '../button';
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
export declare type OrderListPassThroughOptionType = OrderListPassThroughAttributes | ((options: OrderListPassThroughMethodOptions) => OrderListPassThroughAttributes) | null | undefined;
/**
* Custom passthrough(pt) option method.
*/
export interface OrderListPassThroughMethodOptions {
props: OrderListProps;
state: OrderListState;
context: OrderListState;
}
/**
* Custom reorder event
* @see {@link OrderListEmits.reorder}
@ -44,6 +56,100 @@ export interface OrderListSelectionChangeEvent {
value: any[];
}
/**
* Custom passthrough(pt) options.
* @see {@link OrderListProps.pt}
*/
export interface OrderListPassThroughOptions {
/**
* Uses to pass attributes to the root's DOM element.
*/
root?: OrderListPassThroughOptionType;
/**
* Uses to pass attributes to the controls' DOM element.
*/
controls?: OrderListPassThroughOptionType;
/**
* Uses to pass attributes to the Button component.
*/
moveUpButton?: ButtonPassThroughOptionType;
/**
* Uses to pass attributes to the Button component.
*/
moveTopButton?: ButtonPassThroughOptionType;
/**
* Uses to pass attributes to the Button component.
*/
moveDownButton?: ButtonPassThroughOptionType;
/**
* Uses to pass attributes to the Button component.
*/
moveBottomButton?: ButtonPassThroughOptionType;
/**
* Uses to pass attributes to the container's DOM element.
*/
container?: OrderListPassThroughOptionType;
/**
* Uses to pass attributes to the header's DOM element.
*/
header?: OrderListPassThroughOptionType;
/**
* Uses to pass attributes to the list's DOM element.
*/
list?: OrderListPassThroughOptionType;
/**
* Uses to pass attributes to the item's DOM element.
*/
item?: OrderListPassThroughOptionType;
}
/**
* Custom passthrough attributes for each DOM elements
*/
export interface OrderListPassThroughAttributes {
[key: string]: any;
}
/**
* Defines current inline state in OrderList component.
*/
export interface OrderListState {
/**
* Current id state as a string.
*/
id: string;
/**
* Current id state as a string.
*/
d_selection: any[];
/**
* Current focused state as a boolean.
* @defaultValue false
*/
focused: boolean;
/**
* Current focused item index as a number.
* @defaultvalue -1
*/
focusedOptionIndex: number;
}
/**
* Defines current inline state in OrderList component.
*/
export interface OrderListState {
/**
* Current active state of the item as a boolean.
* @defaultValue false
*/
active: boolean;
/**
* Current focus state of the item as a boolean.
* @defaultValue false
*/
focused: boolean;
}
/**
* Defines valid properties in OrderList component.
*/