2023-03-03 13:17:50 +00:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* The helper DataViewLayoutOptions component can be used to switch between the modes however this component is optional and you may use your own UI to switch modes as well.
|
|
|
|
*
|
|
|
|
* [Live Demo](https://www.primevue.org/dataview/)
|
|
|
|
*
|
|
|
|
* @module dataviewlayoutoptions
|
|
|
|
*
|
|
|
|
*/
|
2023-04-07 06:47:10 +00:00
|
|
|
import { VNode } from 'vue';
|
2023-07-06 11:17:08 +00:00
|
|
|
import { ComponentHooks } from '../basecomponent';
|
2023-09-05 08:50:46 +00:00
|
|
|
import { PassThroughOptions } from '../passthrough';
|
2024-03-20 07:02:27 +00:00
|
|
|
import { SelectButtonPassThroughOptions } from '../selectbutton';
|
2023-09-05 11:28:04 +00:00
|
|
|
import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers';
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2023-07-11 22:42:43 +00:00
|
|
|
export declare type DataViewLayoutOptionsPassThroughOptionType =
|
|
|
|
| DataViewLayoutOptionsPassThroughAttributes
|
|
|
|
| ((options: DataViewLayoutOptionsPassThroughMethodOptions) => DataViewLayoutOptionsPassThroughAttributes | string)
|
|
|
|
| string
|
|
|
|
| null
|
|
|
|
| undefined;
|
2023-05-09 22:39:10 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Custom passthrough(pt) option method.
|
|
|
|
*/
|
|
|
|
export interface DataViewLayoutOptionsPassThroughMethodOptions {
|
2023-09-05 06:50:04 +00:00
|
|
|
/**
|
|
|
|
* Defines instance.
|
|
|
|
*/
|
2023-07-06 12:01:33 +00:00
|
|
|
instance: any;
|
2023-09-05 06:50:04 +00:00
|
|
|
/**
|
|
|
|
* Defines valid properties.
|
|
|
|
*/
|
2023-05-09 22:39:10 +00:00
|
|
|
props: DataViewLayoutOptionsProps;
|
2023-09-05 06:50:04 +00:00
|
|
|
/**
|
|
|
|
* Defines current inline state.
|
|
|
|
*/
|
2023-05-09 22:39:10 +00:00
|
|
|
state: DataViewLayoutOptionsState;
|
2023-12-10 21:41:17 +00:00
|
|
|
/**
|
|
|
|
* Defines valid attributes.
|
|
|
|
*/
|
|
|
|
attrs: any;
|
2023-12-05 11:06:32 +00:00
|
|
|
/**
|
|
|
|
* 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 22:39:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Custom passthrough(pt) options.
|
|
|
|
* @see {@link DataViewLayoutOptionsProps.pt}
|
|
|
|
*/
|
|
|
|
export interface DataViewLayoutOptionsPassThroughOptions {
|
|
|
|
/**
|
2023-08-01 14:01:12 +00:00
|
|
|
* Used to pass attributes to the root's DOM element.
|
2024-03-20 07:02:27 +00:00
|
|
|
* @see {@link SelectButtonPassThroughOptions}
|
2023-05-09 22:39:10 +00:00
|
|
|
*/
|
2024-03-20 07:02:27 +00:00
|
|
|
root?: SelectButtonPassThroughOptions<DataViewLayoutOptionsSharedPassThroughMethodOptions>;
|
2024-03-21 13:10:41 +00:00
|
|
|
/**
|
2024-03-25 06:35:20 +00:00
|
|
|
* Used to pass attributes to the root's DOM element.
|
|
|
|
* @see {@link SelectButtonPassThroughOptions}
|
|
|
|
*/
|
|
|
|
selectbutton?: SelectButtonPassThroughOptions<DataViewLayoutOptionsSharedPassThroughMethodOptions>;
|
|
|
|
/**
|
2024-03-21 13:10:41 +00:00
|
|
|
* Used to pass attributes to the list icon's DOM element.
|
|
|
|
*/
|
|
|
|
listIcon?: DataViewLayoutOptionsPassThroughOptionType;
|
|
|
|
/**
|
|
|
|
* Used to pass attributes to the grid icon's DOM element.
|
|
|
|
*/
|
|
|
|
gridIcon?: DataViewLayoutOptionsPassThroughOptionType;
|
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-05-09 22:39:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Custom passthrough attributes for each DOM elements
|
|
|
|
*/
|
|
|
|
export interface DataViewLayoutOptionsPassThroughAttributes {
|
|
|
|
[key: string]: any;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Defines current inline state in DataViewLayoutOptions component.
|
|
|
|
*/
|
|
|
|
export interface DataViewLayoutOptionsState {
|
|
|
|
/**
|
2024-03-20 07:02:27 +00:00
|
|
|
* Default options of the component.
|
|
|
|
* @defaultValue ['list', 'grid']
|
|
|
|
*/
|
|
|
|
options: string[];
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Custom shared passthrough(pt) option method.
|
|
|
|
*/
|
|
|
|
export interface DataViewLayoutOptionsSharedPassThroughMethodOptions {
|
|
|
|
/**
|
|
|
|
* Defines valid properties.
|
2023-05-09 22:39:10 +00:00
|
|
|
*/
|
2024-03-20 07:02:27 +00:00
|
|
|
props: DataViewLayoutOptionsProps;
|
2023-05-09 22:39:10 +00:00
|
|
|
/**
|
2024-03-20 07:02:27 +00:00
|
|
|
* Defines current inline state.
|
2023-05-09 22:39:10 +00:00
|
|
|
*/
|
2024-03-20 07:02:27 +00:00
|
|
|
state: DataViewLayoutOptionsState;
|
2023-05-09 22:39:10 +00:00
|
|
|
}
|
|
|
|
|
2023-03-03 13:17:50 +00:00
|
|
|
/**
|
|
|
|
* Defines valid properties in DataViewLayoutOptions component.
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
export interface DataViewLayoutOptionsProps {
|
|
|
|
/**
|
|
|
|
* Value of the component.
|
|
|
|
*/
|
|
|
|
modelValue?: string | undefined;
|
2023-05-09 22:39:10 +00:00
|
|
|
/**
|
2023-08-01 14:01:12 +00:00
|
|
|
* Used to pass attributes to DOM elements inside the component.
|
2023-05-09 22:39:10 +00:00
|
|
|
* @type {DataViewLayoutOptionsPassThroughOptions}
|
|
|
|
*/
|
2023-09-05 11:28:04 +00:00
|
|
|
pt?: PassThrough<DataViewLayoutOptionsPassThroughOptions>;
|
2023-09-05 08:50:46 +00:00
|
|
|
/**
|
|
|
|
* Used to configure passthrough(pt) options of the component.
|
|
|
|
* @type {PassThroughOptions}
|
|
|
|
*/
|
|
|
|
ptOptions?: PassThroughOptions;
|
2023-06-02 16:04:55 +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-03 13:17:50 +00:00
|
|
|
/**
|
2023-04-07 06:47:10 +00:00
|
|
|
* Defines valid slots in DataViewLayoutOptions component.
|
2023-03-03 13:17:50 +00:00
|
|
|
*/
|
2023-04-07 06:47:10 +00:00
|
|
|
export interface DataViewLayoutOptionsSlots {
|
|
|
|
/**
|
|
|
|
* Custom list icon template.
|
|
|
|
*/
|
|
|
|
listicon(): VNode[];
|
|
|
|
/**
|
|
|
|
* Custom grid icon template.
|
|
|
|
*/
|
|
|
|
gridicon(): VNode[];
|
|
|
|
}
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2023-03-03 13:17:50 +00:00
|
|
|
/**
|
|
|
|
* Defines valid emits in DataViewLayoutOptions component.
|
|
|
|
*/
|
|
|
|
export interface DataViewLayoutOptionsEmits {
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Emitted when the value changes.
|
|
|
|
* @param {*} value - New value.
|
|
|
|
*/
|
2023-03-03 13:17:50 +00:00
|
|
|
'update:modelValue'(value: string): void;
|
|
|
|
}
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2023-03-03 13:17:50 +00:00
|
|
|
/**
|
|
|
|
* **PrimeVue - DataViewLayoutOptions**
|
|
|
|
*
|
|
|
|
* _The helper DataViewLayoutOptions component can be used to switch between the modes however this component is optional and you may use your own UI to switch modes as well._
|
|
|
|
*
|
|
|
|
* [Live Demo](https://www.primevue.org/dataview/)
|
|
|
|
* --- ---
|
|
|
|
* ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo-100.png)
|
|
|
|
*
|
|
|
|
* @group Component
|
|
|
|
*
|
|
|
|
*/
|
2022-09-14 11:26:01 +00:00
|
|
|
declare class DataViewLayoutOptions extends ClassComponent<DataViewLayoutOptionsProps, DataViewLayoutOptionsSlots, DataViewLayoutOptionsEmits> {}
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2024-03-14 22:58:11 +00:00
|
|
|
declare module 'vue' {
|
|
|
|
export interface GlobalComponents {
|
2022-09-14 11:26:01 +00:00
|
|
|
DataViewLayoutOptions: GlobalComponentConstructor<DataViewLayoutOptions>;
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default DataViewLayoutOptions;
|