DataTable: new filterButtonProp property

This commit is contained in:
tugcekucukoglu 2024-03-26 15:37:21 +03:00
parent 1cbaf36aa0
commit a0c3e47afd
6 changed files with 84 additions and 9 deletions

View file

@ -9,6 +9,7 @@
*/
import { InputHTMLAttributes, TableHTMLAttributes, TransitionProps, VNode } from 'vue';
import { ComponentHooks } from '../basecomponent';
import { ButtonProps } from '../button';
import { ColumnPassThroughOptionType } from '../column';
import { ColumnGroupPassThroughOptionType } from '../columngroup';
import { PaginatorPassThroughOptionType } from '../paginator';
@ -159,6 +160,28 @@ export interface DataTableExportCSVOptions {
selectionOnly: boolean;
}
/**
* Custom datatable filter button props options.
*/
export interface DataTableFilterButtonPropsOptions {
/**
* Add rule button props
*/
addRule: ButtonProps | undefined;
/**
* Remove rule button props
*/
removeRule: ButtonProps | undefined;
/**
* Apply button props
*/
apply: ButtonProps | undefined;
/**
* Apply button props
*/
clear: ButtonProps | undefined;
}
/**
* Custom sort event.
* @see {@link DataTableEmits.sort}
@ -1130,6 +1153,16 @@ export interface DataTableProps {
* Used to pass all properties of the HTMLInputElement to the focusable filter input element inside the component.
*/
filterInputProps?: InputHTMLAttributes | undefined;
/**
* Used to pass all filter button property object
* @defaultValue {
addRule: { severity: 'info', text: true, size: 'small' },
removeRule: { severity: 'danger', text: true, size: 'small' },
apply: { size: 'small' },
clear: { outlined: true, size: 'small' }
}
*/
filterButtonProps?: DataTableFilterButtonPropsOptions | undefined;
/**
* Used to pass attributes to DOM elements inside the component.
* @type {DataTablePassThroughOptions}