primevue-mirror/components/lib/orderlist/OrderList.d.ts

382 lines
10 KiB
TypeScript
Raw Normal View History

2023-03-01 11:45:26 +00:00
/**
*
* OrderList is used to managed the order of a collection.
*
2023-03-03 14:17:03 +00:00
* [Live Demo](https://primevue.org/orderlist)
2023-03-01 11:45:26 +00:00
*
* @module orderlist
*
*/
2024-03-21 13:20:49 +00:00
import { TransitionProps, VNode } from 'vue';
2023-07-06 11:17:08 +00:00
import { ComponentHooks } from '../basecomponent';
import { ButtonPassThroughOptions, ButtonProps } from '../button';
2024-03-21 13:20:49 +00:00
import { ListboxPassThroughOptions } from '../listbox';
2023-09-05 08:50:46 +00:00
import { PassThroughOptions } from '../passthrough';
import { DefineComponent, DesignToken, EmitFn, GlobalComponentConstructor, PassThrough } from '../ts-helpers';
2022-09-06 12:03:37 +00:00
export declare type OrderListPassThroughOptionType = OrderListPassThroughAttributes | ((options: OrderListPassThroughMethodOptions) => OrderListPassThroughAttributes | string) | string | null | undefined;
2023-05-09 16:03:01 +00:00
2023-08-02 14:07:22 +00:00
export declare type OrderListPassThroughTransitionType = TransitionProps | ((options: OrderListPassThroughMethodOptions) => TransitionProps) | undefined;
2023-05-09 16:03:01 +00:00
/**
* Custom passthrough(pt) option method.
*/
export interface OrderListPassThroughMethodOptions {
/**
* Defines instance.
*/
2023-07-06 12:01:33 +00:00
instance: any;
/**
* Defines valid properties.
*/
2023-05-09 16:03:01 +00:00
props: OrderListProps;
/**
* Defines current inline state.
*/
2023-05-09 16:03:01 +00:00
state: OrderListState;
/**
* Defines valid attributes.
*/
attrs: any;
/**
* Defines parent options.
*/
parent: any;
2023-09-05 08:50:46 +00:00
/**
* Defines passthrough(pt) options in global config.
*/
global: object | undefined;
2023-05-09 16:03:01 +00:00
}
/**
* Custom shared passthrough(pt) option method.
*/
export interface OrderListSharedPassThroughMethodOptions {
/**
* Defines valid properties.
*/
props: OrderListProps;
/**
* Defines current inline state.
*/
state: OrderListState;
}
2023-03-01 11:45:26 +00:00
/**
* Custom reorder event
2024-05-16 14:05:43 +00:00
* @see {@link OrderListEmitsOptions.reorder}
2023-03-01 11:45:26 +00:00
*/
2022-09-06 12:03:37 +00:00
export interface OrderListReorderEvent {
/**
* Browser event
*/
originalEvent: Event;
/**
* Ordered list
*/
value: any[];
/**
* Direction of the change; 'up', 'down', 'bottom', 'top'
*/
direction: string;
}
2023-03-01 11:45:26 +00:00
/**
* Custom selection change event
2024-05-16 14:05:43 +00:00
* @see {@link OrderListEmitsOptions['selection-change']}
2023-03-01 11:45:26 +00:00
*/
2022-09-06 12:03:37 +00:00
export interface OrderListSelectionChangeEvent {
/**
* Browser event
*/
originalEvent: Event;
/**
* Ordered list
*/
value: any[];
}
2023-05-09 16:03:01 +00:00
/**
* Custom passthrough(pt) options.
* @see {@link OrderListProps.pt}
*/
export interface OrderListPassThroughOptions {
/**
* Used to pass attributes to the root's DOM element.
2023-05-09 16:03:01 +00:00
*/
root?: OrderListPassThroughOptionType;
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the controls' DOM element.
2023-05-09 16:03:01 +00:00
*/
controls?: OrderListPassThroughOptionType;
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the Button component.
2024-03-21 13:20:49 +00:00
* @see {@link ButtonPassThroughOptions}
2023-05-09 16:03:01 +00:00
*/
2024-05-06 15:23:01 +00:00
pcMoveUpButton?: ButtonPassThroughOptions<OrderListSharedPassThroughMethodOptions>;
2023-05-09 16:03:01 +00:00
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the Button component.
2024-03-21 13:20:49 +00:00
* @see {@link ButtonPassThroughOptions}
2023-05-09 16:03:01 +00:00
*/
2024-05-06 15:23:01 +00:00
pcMoveTopButton?: ButtonPassThroughOptions<OrderListSharedPassThroughMethodOptions>;
2023-05-09 16:03:01 +00:00
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the Button component.
2024-03-21 13:20:49 +00:00
* @see {@link ButtonPassThroughOptions}
2023-05-09 16:03:01 +00:00
*/
2024-05-06 15:23:01 +00:00
pcMoveDownButton?: ButtonPassThroughOptions<OrderListSharedPassThroughMethodOptions>;
2023-05-09 16:03:01 +00:00
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the Button component.
2024-03-21 13:20:49 +00:00
* @see {@link ButtonPassThroughOptions}
2023-05-09 16:03:01 +00:00
*/
2024-05-06 15:23:01 +00:00
pcMoveBottomButton?: ButtonPassThroughOptions<OrderListSharedPassThroughMethodOptions>;
2023-05-09 16:03:01 +00:00
/**
* Used to pass attributes to the container's DOM element.
2023-05-09 16:03:01 +00:00
*/
container?: OrderListPassThroughOptionType;
/**
2024-03-21 13:20:49 +00:00
* Used to pass attributes to the Listbox component.
* @see {@link ListboxPassThroughOptions}
2023-05-09 16:03:01 +00:00
*/
2024-05-06 15:23:01 +00:00
pcList?: ListboxPassThroughOptions<OrderListSharedPassThroughMethodOptions>;
2023-07-06 11:09:01 +00:00
/**
2023-11-07 06:16:39 +00:00
* Used to manage all lifecycle hooks.
2023-07-06 11:09:01 +00:00
* @see {@link BaseComponent.ComponentHooks}
*/
hooks?: ComponentHooks;
2023-08-02 12:01:49 +00:00
/**
* Used to control Vue Transition API.
*/
2023-08-02 14:07:22 +00:00
transition?: OrderListPassThroughTransitionType;
2023-05-09 16:03:01 +00:00
}
/**
* 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[];
}
2023-03-01 11:45:26 +00:00
/**
* Defines valid properties in OrderList component.
*/
2022-09-06 12:03:37 +00:00
export interface OrderListProps {
/**
* Value of the component.
*/
modelValue?: any[];
/**
* Name of the field that uniquely identifies the a record in the data.
*/
dataKey?: string | undefined;
/**
* Selected items in the list.
*/
selection?: any[];
/**
2024-03-21 13:20:49 +00:00
* Defines whether metaKey is required or not for the selection.
2022-09-06 12:03:37 +00:00
* When true metaKey needs to be pressed to select or unselect an item and
* when set to false selection of each item can be toggled individually. On touch enabled devices, metaKeySelection is turned off automatically.
2023-12-20 10:35:18 +00:00
* @defaultValue false
2022-09-06 12:03:37 +00:00
*/
metaKeySelection?: boolean | undefined;
/**
* Whether to focus on the first visible or selected element.
2024-01-24 07:02:00 +00:00
* @defaultValue true
*/
autoOptionFocus?: boolean | undefined;
2024-01-24 07:02:00 +00:00
/**
* When enabled, the focus is placed on the hovered option.
* @defaultValue true
*/
focusOnHover?: boolean | undefined;
2022-09-06 12:03:37 +00:00
/**
* Inline style of the the list element.
*/
listStyle?: any;
/**
* Whether the list optimizes layout based on screen size.
2023-03-01 11:45:26 +00:00
* @defaultValue true
2022-09-06 12:03:37 +00:00
*/
responsive?: boolean | undefined;
/**
* The breakpoint to define the maximum width boundary when responsiveness is enabled.
2023-03-08 10:51:52 +00:00
* @defaultValue 960px
2022-09-06 12:03:37 +00:00
*/
breakpoint?: string | undefined;
/**
* Whether to displays rows with alternating colors.
2024-03-21 13:52:26 +00:00
* @defaultValue false
2022-09-06 12:03:37 +00:00
*/
2024-05-27 06:39:11 +00:00
striped?: boolean | undefined;
2022-12-08 11:04:25 +00:00
/**
* Index of the element in tabbing order.
*/
tabindex?: number | string | undefined;
2024-03-26 14:21:39 +00:00
/**
* Height of the viewport, a scrollbar is defined if height of list exceeds this value.
* @defaultValue 14rem
*/
scrollHeight?: string | undefined;
2022-12-08 11:04:25 +00:00
/**
2024-05-13 12:45:23 +00:00
* Used to pass all properties of the ButtonProps to the button inside the component.
* @type {ButtonProps}
* @defaultValue { severity: 'secondary' }
2022-12-08 11:04:25 +00:00
*/
buttonProps?: object | undefined;
/**
* Used to pass all properties of the ButtonProps to the move up button inside the component.
*/
moveUpButtonProps?: object | undefined;
/**
* Used to pass all properties of the ButtonProps to the move top button inside the component.
*/
moveTopButtonProps?: object | undefined;
/**
* Used to pass all properties of the ButtonProps to the move down button inside the component.
*/
moveDownButtonProps?: object | undefined;
/**
* Used to pass all properties of the ButtonProps to the move bottom button inside the component.
*/
moveBottomButtonProps?: object | undefined;
2022-12-08 11:04:25 +00:00
/**
* Defines a string value that labels an interactive list element.
*/
2023-11-24 12:21:54 +00:00
ariaLabel?: string | undefined;
2022-12-08 11:04:25 +00:00
/**
* Identifier of the underlying list element.
*/
2023-11-24 12:21:54 +00:00
ariaLabelledby?: string | undefined;
/**
* It generates scoped CSS variables using design tokens for the component.
*/
dt?: DesignToken<any>;
2023-05-09 21:43:42 +00:00
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to DOM elements inside the component.
2023-05-09 21:43:42 +00:00
* @type {OrderListPassThroughOptions}
*/
pt?: PassThrough<OrderListPassThroughOptions>;
2023-09-05 08:50:46 +00:00
/**
* Used to configure passthrough(pt) options of the component.
* @type {PassThroughOptions}
*/
ptOptions?: PassThroughOptions;
2023-06-02 09:10:49 +00:00
/**
* When enabled, it removes component related styles in the core.
* @defaultValue false
*/
unstyled?: boolean;
2022-09-06 12:03:37 +00:00
}
2023-03-01 11:45:26 +00:00
/**
* Defines valid slots in OrderList component.
*/
2022-09-06 12:03:37 +00:00
export interface OrderListSlots {
/**
* Custom header template.
*/
2023-03-01 11:45:26 +00:00
header(): VNode[];
2022-09-06 12:03:37 +00:00
/**
* Custom item template.
* @param {Object} scope - item slot's params.
*/
2023-03-01 11:45:26 +00:00
item(scope: {
2022-09-06 12:03:37 +00:00
/**
* Item of the component
*/
item: any;
/**
* Index of the item.
*/
index: number;
2023-03-01 11:45:26 +00:00
}): VNode[];
2022-09-06 12:03:37 +00:00
/**
* Custom controls start template.
*/
2023-03-01 11:45:26 +00:00
controlsstart(): VNode[];
2022-09-06 12:03:37 +00:00
/**
* Custom controls end template.
*/
2023-03-01 11:45:26 +00:00
controlsend(): VNode[];
/**
* Custom move up icon template.
*/
moveupicon(): VNode[];
/**
* Custom move top icon template.
*/
movetopicon(): VNode[];
/**
* Custom move down icon template.
*/
movedownicon(): VNode[];
/**
* Custom move bottom icon template.
*/
movebottomicon(): VNode[];
2022-09-06 12:03:37 +00:00
}
2023-03-01 11:45:26 +00:00
/**
* Defines valid slots in OrderList component.
*/
2024-05-16 14:05:43 +00:00
export interface OrderListEmitsOptions {
2022-09-06 12:03:37 +00:00
/**
* Emitted when the value changes.
* @param {*} value - New value.
*/
2023-03-01 11:45:26 +00:00
'update:modelValue'(value: any[]): void;
2022-09-06 12:03:37 +00:00
/**
* Emitted when the selection changes.
* @param {*} value - New value.
*/
2023-03-01 11:45:26 +00:00
'update:selection'(value: any[]): void;
2022-09-06 12:03:37 +00:00
/**
* Callback to invoke when the list is reordered.
* @param {OrderListReorderEvent} event - Custom reorder event.
*/
2023-03-01 11:45:26 +00:00
reorder(event: OrderListReorderEvent): void;
2022-09-06 12:03:37 +00:00
/**
* Callback to invoke when selection changes.
* @param {OrderListSelectionChangeEvent} event - Custom selection change event.
*/
2023-03-01 11:45:26 +00:00
'selection-change'(event: OrderListSelectionChangeEvent): void;
}
2022-09-06 12:03:37 +00:00
export declare type OrderListEmits = EmitFn<OrderListEmitsOptions>;
2023-03-01 11:45:26 +00:00
/**
* **PrimeVue - OrderList**
*
* _OrderList is used to sort a collection._
*
* [Live Demo](https://www.primevue.org/orderlist/)
* --- ---
* ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo-100.png)
*
* @group Component
*
2023-03-01 11:45:26 +00:00
*/
declare const OrderList: DefineComponent<OrderListProps, OrderListSlots, OrderListEmits>;
2022-09-06 12:03:37 +00:00
declare module 'vue' {
export interface GlobalComponents {
OrderList: GlobalComponentConstructor<OrderListProps, OrderListSlots, OrderListEmits>;
2022-09-06 12:03:37 +00:00
}
}
export default OrderList;