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
|
|
|
|
*
|
|
|
|
*/
|
2022-12-08 11:04:25 +00:00
|
|
|
import { ButtonHTMLAttributes, HTMLAttributes, VNode } from 'vue';
|
2022-09-06 12:03:37 +00:00
|
|
|
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
|
|
|
|
|
2023-03-01 11:45:26 +00:00
|
|
|
/**
|
|
|
|
* Custom reorder event
|
|
|
|
* @see reorder
|
|
|
|
*/
|
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
|
|
|
|
* @see selection-change
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
export interface OrderListSelectionChangeEvent {
|
|
|
|
/**
|
|
|
|
* Browser event
|
|
|
|
*/
|
|
|
|
originalEvent: Event;
|
|
|
|
/**
|
|
|
|
* Ordered list
|
|
|
|
*/
|
|
|
|
value: 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[];
|
|
|
|
/**
|
|
|
|
* Defines whether metaKey is requred or not for the selection.
|
|
|
|
* 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-03-01 11:45:26 +00:00
|
|
|
* @defaultValue true
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
|
|
|
metaKeySelection?: boolean | undefined;
|
|
|
|
/**
|
|
|
|
* 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-03 08:18:55 +00:00
|
|
|
* @defaultValue '960px'
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
|
|
|
breakpoint?: string | undefined;
|
|
|
|
/**
|
|
|
|
* Whether to displays rows with alternating colors.
|
|
|
|
*/
|
|
|
|
stripedRows?: boolean | undefined;
|
2022-12-08 11:04:25 +00:00
|
|
|
/**
|
|
|
|
* Index of the element in tabbing order.
|
|
|
|
*/
|
|
|
|
tabindex?: number | string | undefined;
|
|
|
|
/**
|
|
|
|
* Uses to pass all properties of the HTMLAttributes to the list element.
|
|
|
|
*/
|
|
|
|
listProps?: HTMLAttributes | undefined;
|
|
|
|
/**
|
|
|
|
* Uses to pass all properties of the HTMLButtonElement to the move up button inside the component.
|
|
|
|
*/
|
|
|
|
moveUpButtonProps?: ButtonHTMLAttributes | undefined;
|
|
|
|
/**
|
|
|
|
* Uses to pass all properties of the HTMLButtonElement to the move top button inside the component.
|
|
|
|
*/
|
|
|
|
moveTopButtonProps?: ButtonHTMLAttributes | undefined;
|
|
|
|
/**
|
|
|
|
* Uses to pass all properties of the HTMLButtonElement to the move down button inside the component.
|
|
|
|
*/
|
|
|
|
moveDownButtonProps?: ButtonHTMLAttributes | undefined;
|
|
|
|
/**
|
|
|
|
* Uses to pass all properties of the HTMLButtonElement to the move bottom button inside the component.
|
|
|
|
*/
|
|
|
|
moveBottomButtonProps?: ButtonHTMLAttributes | undefined;
|
|
|
|
/**
|
|
|
|
* Defines a string value that labels an interactive list element.
|
|
|
|
*/
|
|
|
|
'aria-label'?: string | undefined;
|
|
|
|
/**
|
|
|
|
* Identifier of the underlying list element.
|
|
|
|
*/
|
|
|
|
'aria-labelledby'?: string | undefined;
|
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[];
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
|
2023-03-01 11:45:26 +00:00
|
|
|
/**
|
|
|
|
* Defines valid slots in OrderList component.
|
|
|
|
*/
|
|
|
|
export interface OrderListEmits {
|
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
|
|
|
|
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
|
|
|
|
*/
|
2022-09-14 11:26:01 +00:00
|
|
|
declare class OrderList extends ClassComponent<OrderListProps, OrderListSlots, OrderListEmits> {}
|
2022-09-06 12:03:37 +00:00
|
|
|
|
|
|
|
declare module '@vue/runtime-core' {
|
|
|
|
interface GlobalComponents {
|
2022-09-14 11:26:01 +00:00
|
|
|
OrderList: GlobalComponentConstructor<OrderList>;
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default OrderList;
|