tsv2-library 0.0.21 → 0.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/v2/ButtonBulkAction/ButtonBulkAction.vue.d.ts +5 -4
- package/dist/components/v2/ButtonRadio/ButtonRadio.vue.d.ts +10 -0
- package/dist/components/v2/DataTable/DataTable.vue.d.ts +179 -1
- package/dist/components/v2/DialogConfirm/DialogConfirm.vue.d.ts +8 -0
- package/dist/components/v2/Icon/Icon.vue.d.ts +14 -4
- package/dist/components/v2/InputText/InputText.vue.d.ts +5 -1
- package/dist/components/v2/Menu/Menu.vue.d.ts +383 -0
- package/dist/components/v2/MultiSelect/MultiSelect.vue.d.ts +31 -3
- package/dist/style.css +1 -1
- package/dist/tsv2-library.cjs.js +68 -68
- package/dist/tsv2-library.cjs.js.map +1 -1
- package/dist/tsv2-library.es.js +5542 -5476
- package/dist/tsv2-library.es.js.map +1 -1
- package/dist/tsv2-library.umd.js +90 -90
- package/dist/tsv2-library.umd.js.map +1 -1
- package/dist/types/options.d.ts +2 -1
- package/package.json +1 -1
- package/src/components/v2/ButtonBulkAction/ButtonBulkAction.vue.d.ts +5 -4
- package/src/components/v2/ButtonRadio/ButtonRadio.vue.d.ts +10 -0
- package/src/components/v2/DataTable/DataTable.vue.d.ts +179 -1
- package/src/components/v2/DialogConfirm/DialogConfirm.vue.d.ts +8 -0
- package/src/components/v2/Icon/Icon.vue.d.ts +14 -4
- package/src/components/v2/InputText/InputText.vue.d.ts +5 -1
- package/src/components/v2/Menu/Menu.vue.d.ts +383 -0
- package/src/components/v2/Menu/MenuItem.d.ts +92 -0
- package/src/components/v2/MultiSelect/MultiSelect.vue.d.ts +31 -3
- package/src/custom-events.d.ts +3 -0
- package/src/presets/datatable/index.js +14 -8
- package/src/presets/dialog/index.js +2 -2
- package/src/presets/inputgroup/index.js +1 -1
- package/src/presets/inputtext/index.js +1 -1
- package/src/presets/menu/index.js +31 -24
- package/src/presets/multiselect/index.js +7 -7
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
1
2
|
import { DefineComponent } from 'vue';
|
|
2
|
-
import { MenuItem } from '
|
|
3
|
+
import { MenuItem } from '../Menu/MenuItem.d';
|
|
3
4
|
import { TSVueIcons } from '../Icon/Icon.vue.d';
|
|
4
5
|
|
|
5
6
|
export type MenuOption = Omit<MenuItem, 'label', 'command', 'icon'> & {
|
|
@@ -26,9 +27,9 @@ export type MenuOption = Omit<MenuItem, 'label', 'command', 'icon'> & {
|
|
|
26
27
|
export interface ButtonBulkActionProps {
|
|
27
28
|
/**
|
|
28
29
|
* An array of data objects to be included in an action.
|
|
29
|
-
* Use as 'v-model:
|
|
30
|
+
* Use as 'v-model:selectedData' to automatically reset on Cancel or Apply.
|
|
30
31
|
*/
|
|
31
|
-
|
|
32
|
+
selectedData: Record<string, any>[];
|
|
32
33
|
options: MenuOption[];
|
|
33
34
|
/**
|
|
34
35
|
* Specify the name/label for selected data.
|
|
@@ -48,7 +49,7 @@ export type ButtonBulkActionEmits = {
|
|
|
48
49
|
/**
|
|
49
50
|
* Emits when Cancel or Apply button is clicked.
|
|
50
51
|
*/
|
|
51
|
-
'update:
|
|
52
|
+
'update:selectedData': [datas: Record<string, unknown>[]];
|
|
52
53
|
};
|
|
53
54
|
|
|
54
55
|
/**
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DefineComponent } from 'vue';
|
|
2
|
+
import { RadioButtonProps, RadioButtonEmits } from '../../../../node_modules/primevue/radiobutton';
|
|
3
|
+
|
|
4
|
+
export type ButtonRadioProps = RadioButtonProps;
|
|
5
|
+
|
|
6
|
+
export type ButtonRadioEmits = RadioButtonEmits;
|
|
7
|
+
|
|
8
|
+
declare const ButtonRadio: DefineComponent<ButtonRadioProps, ButtonRadioEmits>;
|
|
9
|
+
|
|
10
|
+
export default ButtonRadio;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
1
2
|
import { Component } from 'vue';
|
|
2
3
|
|
|
3
4
|
type Data = Record<string, unknown>;
|
|
@@ -28,7 +29,7 @@ export type TableColumn = {
|
|
|
28
29
|
excluded?: boolean;
|
|
29
30
|
bodyStyle?: (props: unknown) => string;
|
|
30
31
|
bodyTemplate?: (data: unknown) => string | undefined;
|
|
31
|
-
bodyComponent?: (data: unknown) =>
|
|
32
|
+
bodyComponent?: (data: unknown) => TableCellComponent;
|
|
32
33
|
headerTemplate?: () => string;
|
|
33
34
|
headerComponent?: () => {
|
|
34
35
|
component: string | Component;
|
|
@@ -51,3 +52,180 @@ export type TableOption = {
|
|
|
51
52
|
danger?: boolean;
|
|
52
53
|
visible?: boolean;
|
|
53
54
|
};
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Custom row click event.
|
|
58
|
+
* @see {@link DataTableEmits['row-click']}
|
|
59
|
+
*/
|
|
60
|
+
export interface DataTableRowClickEvent {
|
|
61
|
+
/**
|
|
62
|
+
* Browser event.
|
|
63
|
+
*/
|
|
64
|
+
originalEvent: Event;
|
|
65
|
+
/**
|
|
66
|
+
* Selected row data.
|
|
67
|
+
*/
|
|
68
|
+
data: any;
|
|
69
|
+
/**
|
|
70
|
+
* Row index.
|
|
71
|
+
*/
|
|
72
|
+
index: number;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Custom row select all change event.
|
|
77
|
+
* @see {@link DataTableEmits['select-all-change']}
|
|
78
|
+
*/
|
|
79
|
+
export interface DataTableSelectAllChangeEvent {
|
|
80
|
+
/**
|
|
81
|
+
* Browser event
|
|
82
|
+
*/
|
|
83
|
+
originalEvent: Event;
|
|
84
|
+
/**
|
|
85
|
+
* Whether all data is selected.
|
|
86
|
+
*/
|
|
87
|
+
checked: boolean;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface TSDataTableProps {
|
|
91
|
+
/**
|
|
92
|
+
* An array of table columns to display.
|
|
93
|
+
*/
|
|
94
|
+
columns: TableColumn[];
|
|
95
|
+
/**
|
|
96
|
+
* An array of objects to display in the table.
|
|
97
|
+
*/
|
|
98
|
+
data?: Data[];
|
|
99
|
+
/**
|
|
100
|
+
* The key of the data object to use as a unique identifier.
|
|
101
|
+
*/
|
|
102
|
+
dataKey: string;
|
|
103
|
+
/**
|
|
104
|
+
* The query search from ButtonSearch component.
|
|
105
|
+
*/
|
|
106
|
+
search?: string;
|
|
107
|
+
/**
|
|
108
|
+
* The default query params that must be included every fetch request.
|
|
109
|
+
*/
|
|
110
|
+
defaultQueryParams?: Readonly<Record<string, any>>;
|
|
111
|
+
/**
|
|
112
|
+
* The function to fetch data on DataTable mounted and on queryParams dependencies updated.
|
|
113
|
+
*/
|
|
114
|
+
fetchFunction(params: QueryParams): Promise<FetchResponse | undefined>;
|
|
115
|
+
/**
|
|
116
|
+
* The number of rows to display per page.
|
|
117
|
+
* @defaultValue 5
|
|
118
|
+
*/
|
|
119
|
+
rows?: number;
|
|
120
|
+
/**
|
|
121
|
+
* Whether all rows are selected or not.
|
|
122
|
+
*/
|
|
123
|
+
isSelectedAll?: boolean;
|
|
124
|
+
filters?: DataTableFilterMeta;
|
|
125
|
+
/**
|
|
126
|
+
* Determine the type of DataTable.
|
|
127
|
+
*
|
|
128
|
+
* Sets to lazy if you need to dynamicaly shows data.
|
|
129
|
+
*/
|
|
130
|
+
lazy?: boolean;
|
|
131
|
+
loading?: boolean;
|
|
132
|
+
/**
|
|
133
|
+
* Whether to enable 'checkbox' | 'single' selection.
|
|
134
|
+
*
|
|
135
|
+
* @default 'checkbox'
|
|
136
|
+
*/
|
|
137
|
+
selectionType?: 'single' | 'checkbox';
|
|
138
|
+
/**
|
|
139
|
+
* Whether to enable checkbox multi-selection.
|
|
140
|
+
*
|
|
141
|
+
* @deprecated use 'selection-type="checkbox"'
|
|
142
|
+
*/
|
|
143
|
+
useSelection?: boolean;
|
|
144
|
+
/**
|
|
145
|
+
* An array of selected objects from `data`.
|
|
146
|
+
*/
|
|
147
|
+
selectedData?: Data[];
|
|
148
|
+
/**
|
|
149
|
+
* Wether display pagination under the table or not.
|
|
150
|
+
*/
|
|
151
|
+
usePaginator?: boolean;
|
|
152
|
+
/**
|
|
153
|
+
* The options that will be visible for each row data.
|
|
154
|
+
*
|
|
155
|
+
* __Provide at least one option to display an Options Menu for each row.__
|
|
156
|
+
*
|
|
157
|
+
* The options menu will be displayed on the right side of the table row.
|
|
158
|
+
*/
|
|
159
|
+
options?: MenuOption[];
|
|
160
|
+
/**
|
|
161
|
+
* Whether to enable single selection or not.
|
|
162
|
+
* If enabled, clicking a row will trigger the `rowSelect` event with the corresponding data object passed as a parameter.
|
|
163
|
+
*
|
|
164
|
+
* @deprecated use 'selection-type="single"'
|
|
165
|
+
* @note Do not combine `singleSelect` with `useSelection`, as it may lead to unexpected behavior.
|
|
166
|
+
*/
|
|
167
|
+
singleSelect?: boolean;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export type TSDataTableEmits = {
|
|
171
|
+
/**
|
|
172
|
+
* Emits when option menu button clicked.
|
|
173
|
+
*/
|
|
174
|
+
'toggleOption': [data: Data];
|
|
175
|
+
/**
|
|
176
|
+
* @deprecated use 'v-model:selected-data' instead.
|
|
177
|
+
*/
|
|
178
|
+
'selectData': [data: Data[]];
|
|
179
|
+
'rowSelect': [data: DataTableRowClickEvent];
|
|
180
|
+
/**
|
|
181
|
+
* Event emitted when the `isSelectedAll` property is updated.
|
|
182
|
+
*
|
|
183
|
+
* @event update:isSelectedAll
|
|
184
|
+
* @param {boolean} data - The updated value of `isSelectedAll`.
|
|
185
|
+
*
|
|
186
|
+
* @example
|
|
187
|
+
* <TSDataTable v-model:is-selected-all="isSelectedAll" />
|
|
188
|
+
*
|
|
189
|
+
* This will update the `isSelectedAll` value when one of checkbox is unchecked.
|
|
190
|
+
*
|
|
191
|
+
* @deprecated;
|
|
192
|
+
*/
|
|
193
|
+
// 'update:isSelectedAll': [data: boolean];
|
|
194
|
+
/**
|
|
195
|
+
* Event emitted when the page changes in the data table.
|
|
196
|
+
*
|
|
197
|
+
* @event page
|
|
198
|
+
* @param {DataTablePageEvent} data - The event data containing information about the new page.
|
|
199
|
+
*
|
|
200
|
+
* @example
|
|
201
|
+
* <TSDataTable @page="handlePageChange" />
|
|
202
|
+
*
|
|
203
|
+
* This will call the `handlePageChange` method whenever the page changes in the data table.
|
|
204
|
+
*/
|
|
205
|
+
'page': [data: DataTablePageEvent];
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Event emitted when the sort order changes in the data table.
|
|
209
|
+
*
|
|
210
|
+
* @event sort
|
|
211
|
+
* @param {DataTableSortEvent} data - The event data containing information about the new sort order.
|
|
212
|
+
*
|
|
213
|
+
* @example
|
|
214
|
+
* <TSDataTable @sort="handleSortChange" />
|
|
215
|
+
*
|
|
216
|
+
* This will call the `handleSortChange` method whenever the sort order changes in the data table.
|
|
217
|
+
*/
|
|
218
|
+
'sort': [data: DataTableSortEvent];
|
|
219
|
+
/**
|
|
220
|
+
* Event emitted when the `selectedData` property is updated.
|
|
221
|
+
*
|
|
222
|
+
* @event update:selectedData
|
|
223
|
+
* @param {Data[]} datas - The updated array of selected data objects.
|
|
224
|
+
*
|
|
225
|
+
* @example
|
|
226
|
+
* <TSDataTable v-model:selected-data="selectedData" />
|
|
227
|
+
*
|
|
228
|
+
* This will update the `selectedData` value whenever a row is selected or deselected.
|
|
229
|
+
*/
|
|
230
|
+
'update:selectedData': [datas: Data[]];
|
|
231
|
+
};
|
|
@@ -39,6 +39,14 @@ export interface DialogConfirmProps {
|
|
|
39
39
|
* @default true
|
|
40
40
|
*/
|
|
41
41
|
closeAfterConfirm?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* To hide/show the confirm button.
|
|
44
|
+
*
|
|
45
|
+
* Set to 'false' Make the confirm dialog cannot be confirmed.
|
|
46
|
+
*
|
|
47
|
+
* @default true;
|
|
48
|
+
*/
|
|
49
|
+
actionable?: boolean;
|
|
42
50
|
}
|
|
43
51
|
|
|
44
52
|
/**
|
|
@@ -17,26 +17,36 @@ export type TSVueIcons =
|
|
|
17
17
|
| 'check'
|
|
18
18
|
| 'checkbox-circle'
|
|
19
19
|
| 'close'
|
|
20
|
+
| 'completion'
|
|
20
21
|
| 'delete-bin'
|
|
22
|
+
| 'disposal'
|
|
21
23
|
| 'download'
|
|
22
24
|
| 'edit'
|
|
23
25
|
| 'ellipsis-h'
|
|
24
26
|
| 'error'
|
|
25
27
|
| 'exchange'
|
|
28
|
+
| 'extension-borrow'
|
|
26
29
|
| 'file-edit'
|
|
27
30
|
| 'file-info'
|
|
28
31
|
| 'file-lines'
|
|
32
|
+
| 'file-settings'
|
|
29
33
|
| 'filter-fill'
|
|
30
34
|
| 'filter-line'
|
|
31
|
-
| 'file-settings'
|
|
32
35
|
| 'hand-coin'
|
|
36
|
+
| 'handheld'
|
|
33
37
|
| 'history'
|
|
34
38
|
| 'image-add'
|
|
35
39
|
| 'info'
|
|
36
|
-
| '
|
|
40
|
+
| 'move-to'
|
|
41
|
+
| 'note'
|
|
42
|
+
| 'pair-tag'
|
|
37
43
|
| 'pencil'
|
|
38
44
|
| 'refresh'
|
|
39
|
-
| '
|
|
45
|
+
| 'replace-tag'
|
|
46
|
+
| 'report-tag'
|
|
47
|
+
| 'search'
|
|
40
48
|
| 'search-eye'
|
|
49
|
+
| 'settings'
|
|
41
50
|
| 'spinner'
|
|
42
|
-
| '
|
|
51
|
+
| 'unassign'
|
|
52
|
+
| 'verification';
|
|
@@ -28,9 +28,13 @@ export interface InputTextProps {
|
|
|
28
28
|
* Wether this input field is required or not.
|
|
29
29
|
*/
|
|
30
30
|
mandatory?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Invalid input state.
|
|
33
|
+
*/
|
|
34
|
+
invalid?: boolean;
|
|
31
35
|
/**
|
|
32
36
|
* Set custom validator message.
|
|
33
|
-
*
|
|
37
|
+
* Will be show if invalid="true"
|
|
34
38
|
*/
|
|
35
39
|
validatorMessage?: string;
|
|
36
40
|
/**
|
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* Menu is a navigation / command component that supports dynamic and static positioning.
|
|
6
|
+
*
|
|
7
|
+
* [Live Demo](https://www.TSvue.org/menu/)
|
|
8
|
+
*
|
|
9
|
+
* @module menu
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
import { TransitionProps, VNode } from 'vue';
|
|
13
|
+
import { ComponentHooks } from '../BaseComponent/BaseComponent.d';
|
|
14
|
+
import { PassThroughOptions } from '../PassThrough';
|
|
15
|
+
import { MenuItem } from './MenuItem.d';
|
|
16
|
+
import {
|
|
17
|
+
ClassComponent,
|
|
18
|
+
GlobalComponentConstructor,
|
|
19
|
+
PassThrough,
|
|
20
|
+
} from '../ts-helpers';
|
|
21
|
+
|
|
22
|
+
export declare type MenuPassThroughOptionType =
|
|
23
|
+
| MenuPassThroughAttributes
|
|
24
|
+
| ((
|
|
25
|
+
options: MenuPassThroughMethodOptions,
|
|
26
|
+
) => MenuPassThroughAttributes | string)
|
|
27
|
+
| string
|
|
28
|
+
| null
|
|
29
|
+
| undefined;
|
|
30
|
+
|
|
31
|
+
export declare type MenuPassThroughTransitionType =
|
|
32
|
+
| TransitionProps
|
|
33
|
+
| ((options: MenuPassThroughMethodOptions) => TransitionProps)
|
|
34
|
+
| undefined;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Custom passthrough(pt) option method.
|
|
38
|
+
*/
|
|
39
|
+
export interface MenuPassThroughMethodOptions {
|
|
40
|
+
/**
|
|
41
|
+
* Defines instance.
|
|
42
|
+
*/
|
|
43
|
+
instance: any;
|
|
44
|
+
/**
|
|
45
|
+
* Defines valid properties.
|
|
46
|
+
*/
|
|
47
|
+
props: MenuProps;
|
|
48
|
+
/**
|
|
49
|
+
* Defines current inline state.
|
|
50
|
+
*/
|
|
51
|
+
state: MenuState;
|
|
52
|
+
/**
|
|
53
|
+
* Defines current options.
|
|
54
|
+
*/
|
|
55
|
+
context: MenuContext;
|
|
56
|
+
/**
|
|
57
|
+
* Defines valid attributes.
|
|
58
|
+
*/
|
|
59
|
+
attrs: any;
|
|
60
|
+
/**
|
|
61
|
+
* Defines parent options.
|
|
62
|
+
*/
|
|
63
|
+
parent: any;
|
|
64
|
+
/**
|
|
65
|
+
* Defines passthrough(pt) options in global config.
|
|
66
|
+
*/
|
|
67
|
+
global: object | undefined;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Custom passthrough(pt) options.
|
|
72
|
+
* @see {@link MenuProps.pt}
|
|
73
|
+
*/
|
|
74
|
+
export interface MenuPassThroughOptions {
|
|
75
|
+
/**
|
|
76
|
+
* Used to pass attributes to the root's DOM element.
|
|
77
|
+
*/
|
|
78
|
+
root?: MenuPassThroughOptionType;
|
|
79
|
+
/**
|
|
80
|
+
* Used to pass attributes to the list's DOM element.
|
|
81
|
+
*/
|
|
82
|
+
menu?: MenuPassThroughOptionType;
|
|
83
|
+
/**
|
|
84
|
+
* Used to pass attributes to the submenu header's DOM element.
|
|
85
|
+
*/
|
|
86
|
+
submenuHeader?: MenuPassThroughOptionType;
|
|
87
|
+
/**
|
|
88
|
+
* Used to pass attributes to the list item's DOM element.
|
|
89
|
+
*/
|
|
90
|
+
menuitem?: MenuPassThroughOptionType;
|
|
91
|
+
/**
|
|
92
|
+
* Used to pass attributes to the content's DOM element.
|
|
93
|
+
*/
|
|
94
|
+
content?: MenuPassThroughOptionType;
|
|
95
|
+
/**
|
|
96
|
+
* Used to pass attributes to the action's DOM element.
|
|
97
|
+
*/
|
|
98
|
+
action?: MenuPassThroughOptionType;
|
|
99
|
+
/**
|
|
100
|
+
* Used to pass attributes to the icon's DOM element.
|
|
101
|
+
*/
|
|
102
|
+
icon?: MenuPassThroughOptionType;
|
|
103
|
+
/**
|
|
104
|
+
* Used to pass attributes to the label's DOM element.
|
|
105
|
+
*/
|
|
106
|
+
label?: MenuPassThroughOptionType;
|
|
107
|
+
/**
|
|
108
|
+
* Used to pass attributes to the separator's DOM element.
|
|
109
|
+
*/
|
|
110
|
+
separator?: MenuPassThroughOptionType;
|
|
111
|
+
/**
|
|
112
|
+
* Used to pass attributes to the start of the component.
|
|
113
|
+
*/
|
|
114
|
+
start?: MenuPassThroughOptionType;
|
|
115
|
+
/**
|
|
116
|
+
* Used to pass attributes to the end of the component.
|
|
117
|
+
*/
|
|
118
|
+
end?: MenuPassThroughOptionType;
|
|
119
|
+
/**
|
|
120
|
+
* Used to manage all lifecycle hooks.
|
|
121
|
+
* @see {@link BaseComponent.ComponentHooks}
|
|
122
|
+
*/
|
|
123
|
+
hooks?: ComponentHooks;
|
|
124
|
+
/**
|
|
125
|
+
* Used to control Vue Transition API.
|
|
126
|
+
*/
|
|
127
|
+
transition?: MenuPassThroughTransitionType;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Custom passthrough attributes for each DOM elements
|
|
132
|
+
*/
|
|
133
|
+
export interface MenuPassThroughAttributes {
|
|
134
|
+
[key: string]: any;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Defines current inline state in Menu component.
|
|
139
|
+
*/
|
|
140
|
+
export interface MenuState {
|
|
141
|
+
/**
|
|
142
|
+
* Current id state as a string.
|
|
143
|
+
*/
|
|
144
|
+
id: string;
|
|
145
|
+
/**
|
|
146
|
+
* Current visible state as a boolean.
|
|
147
|
+
* @defaultValue false
|
|
148
|
+
*/
|
|
149
|
+
overlayVisible: boolean;
|
|
150
|
+
/**
|
|
151
|
+
* Current focus state as a boolean.
|
|
152
|
+
* @defaultValue false
|
|
153
|
+
*/
|
|
154
|
+
focused: boolean;
|
|
155
|
+
/**
|
|
156
|
+
* Focused option index.
|
|
157
|
+
*/
|
|
158
|
+
focusedOptionIndex: number;
|
|
159
|
+
/**
|
|
160
|
+
* Selected option index.
|
|
161
|
+
*/
|
|
162
|
+
selectedOptionIndex: number;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Defines current options in Menu component.
|
|
167
|
+
*/
|
|
168
|
+
export interface MenuContext {
|
|
169
|
+
/**
|
|
170
|
+
* Current menuitem
|
|
171
|
+
*/
|
|
172
|
+
item: any;
|
|
173
|
+
/**
|
|
174
|
+
* Current index of the menuitem.
|
|
175
|
+
*/
|
|
176
|
+
index: number;
|
|
177
|
+
/**
|
|
178
|
+
* Current focused state of menuitem as a boolean.
|
|
179
|
+
* @defaultValue false
|
|
180
|
+
*/
|
|
181
|
+
focused: boolean;
|
|
182
|
+
/**
|
|
183
|
+
* Current disabled state of menuitem as a boolean.
|
|
184
|
+
* @defaultValue false
|
|
185
|
+
*/
|
|
186
|
+
disabled: boolean;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Defines valid router binding props in Menu component.
|
|
191
|
+
*/
|
|
192
|
+
export interface MenuRouterBindProps {
|
|
193
|
+
/**
|
|
194
|
+
* Action element binding
|
|
195
|
+
*/
|
|
196
|
+
action: object;
|
|
197
|
+
/**
|
|
198
|
+
* Icon element binding
|
|
199
|
+
*/
|
|
200
|
+
icon: object;
|
|
201
|
+
/**
|
|
202
|
+
* Label element binding
|
|
203
|
+
*/
|
|
204
|
+
label: object;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Defines valid properties in Menu component.
|
|
209
|
+
*/
|
|
210
|
+
export interface MenuProps {
|
|
211
|
+
/**
|
|
212
|
+
* An array of menuitems.
|
|
213
|
+
*/
|
|
214
|
+
model?: MenuItem[] | undefined;
|
|
215
|
+
/**
|
|
216
|
+
* Defines if menu would displayed as a popup.
|
|
217
|
+
* @defaultValue false
|
|
218
|
+
*/
|
|
219
|
+
popup?: boolean | undefined;
|
|
220
|
+
/**
|
|
221
|
+
* A valid query selector or an HTMLElement to specify where the overlay gets attached.
|
|
222
|
+
* @defaultValue body
|
|
223
|
+
*/
|
|
224
|
+
appendTo?: 'body' | 'self' | string | undefined | HTMLElement;
|
|
225
|
+
/**
|
|
226
|
+
* Whether to automatically manage layering.
|
|
227
|
+
* @defaultValue true
|
|
228
|
+
*/
|
|
229
|
+
autoZIndex?: boolean | undefined;
|
|
230
|
+
/**
|
|
231
|
+
* Base zIndex value to use in layering.
|
|
232
|
+
* @defaultValue 0
|
|
233
|
+
*/
|
|
234
|
+
baseZIndex?: number | undefined;
|
|
235
|
+
/**
|
|
236
|
+
* Whether to apply 'router-link-active-exact' class if route exactly matches the item path.
|
|
237
|
+
* @deprecated since v3.40.0.
|
|
238
|
+
* @defaultValue true
|
|
239
|
+
*/
|
|
240
|
+
exact?: boolean | undefined;
|
|
241
|
+
/**
|
|
242
|
+
* Index of the element in tabbing order.
|
|
243
|
+
*/
|
|
244
|
+
tabindex?: number | string | undefined;
|
|
245
|
+
/**
|
|
246
|
+
* Defines a string value that labels an interactive element.
|
|
247
|
+
*/
|
|
248
|
+
ariaLabel?: string | undefined;
|
|
249
|
+
/**
|
|
250
|
+
* Identifier of the underlying input element.
|
|
251
|
+
*/
|
|
252
|
+
ariaLabelledby?: string | undefined;
|
|
253
|
+
/**
|
|
254
|
+
* Used to pass attributes to DOM elements inside the component.
|
|
255
|
+
* @type {MenuPassThroughOptions}
|
|
256
|
+
*/
|
|
257
|
+
pt?: PassThrough<MenuPassThroughOptions>;
|
|
258
|
+
/**
|
|
259
|
+
* Used to configure passthrough(pt) options of the component.
|
|
260
|
+
* @type {PassThroughOptions}
|
|
261
|
+
*/
|
|
262
|
+
ptOptions?: PassThroughOptions;
|
|
263
|
+
/**
|
|
264
|
+
* When enabled, it removes component related styles in the core.
|
|
265
|
+
* @defaultValue false
|
|
266
|
+
*/
|
|
267
|
+
unstyled?: boolean;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Defines valid slots in Menu component.
|
|
272
|
+
*/
|
|
273
|
+
export interface MenuSlots {
|
|
274
|
+
/**
|
|
275
|
+
* Custom start template.
|
|
276
|
+
*/
|
|
277
|
+
start(): VNode[];
|
|
278
|
+
/**
|
|
279
|
+
* Custom end template.
|
|
280
|
+
*/
|
|
281
|
+
end(): VNode[];
|
|
282
|
+
/**
|
|
283
|
+
* Custom item template.
|
|
284
|
+
* @param {Object} scope - item slot's params.
|
|
285
|
+
*/
|
|
286
|
+
item(scope: {
|
|
287
|
+
/**
|
|
288
|
+
* Menuitem instance
|
|
289
|
+
*/
|
|
290
|
+
item: MenuItem;
|
|
291
|
+
/**
|
|
292
|
+
* Label property of the menuitem
|
|
293
|
+
*/
|
|
294
|
+
label: string | ((...args: any) => string) | undefined;
|
|
295
|
+
/**
|
|
296
|
+
* Binding properties of the menuitem
|
|
297
|
+
*/
|
|
298
|
+
props: MenuRouterBindProps;
|
|
299
|
+
}): VNode[];
|
|
300
|
+
/**
|
|
301
|
+
* Custom item icon template.
|
|
302
|
+
* @param {Object} scope - item icon slot's params.
|
|
303
|
+
*/
|
|
304
|
+
itemicon(scope: {
|
|
305
|
+
/**
|
|
306
|
+
* Menuitem instance
|
|
307
|
+
*/
|
|
308
|
+
item: MenuItem;
|
|
309
|
+
/**
|
|
310
|
+
* Style class of the item icon element.
|
|
311
|
+
*/
|
|
312
|
+
class: any;
|
|
313
|
+
}): VNode[];
|
|
314
|
+
/**
|
|
315
|
+
* Custom item template.
|
|
316
|
+
* @param {Object} scope - submenuheader slot's params.
|
|
317
|
+
*/
|
|
318
|
+
submenuheader(scope: {
|
|
319
|
+
/**
|
|
320
|
+
* Menuitem instance
|
|
321
|
+
*/
|
|
322
|
+
item: MenuItem;
|
|
323
|
+
}): VNode[];
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* Defines valid emits in Menu component.
|
|
328
|
+
*/
|
|
329
|
+
export type MenuEmits = {
|
|
330
|
+
/**
|
|
331
|
+
* Callback to invoke when the component receives focus.
|
|
332
|
+
* @param {Event} event - Browser event.
|
|
333
|
+
*/
|
|
334
|
+
focus: [event: Event];
|
|
335
|
+
/**
|
|
336
|
+
* Callback to invoke when the component loses focus.
|
|
337
|
+
* @param {Event} event - Browser event.
|
|
338
|
+
*/
|
|
339
|
+
blur: [event: Event];
|
|
340
|
+
};
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* **TSVue - Menu**
|
|
344
|
+
*
|
|
345
|
+
* _Menu is a navigation / command component that supports dynamic and static positioning._
|
|
346
|
+
*
|
|
347
|
+
* --- ---
|
|
348
|
+
* 
|
|
349
|
+
*
|
|
350
|
+
* @group Component
|
|
351
|
+
*
|
|
352
|
+
*/
|
|
353
|
+
declare class Menu extends ClassComponent<MenuProps, MenuSlots, MenuEmits> {
|
|
354
|
+
/**
|
|
355
|
+
* Toggles the visibility of the overlay.
|
|
356
|
+
* @param {Event} event - Browser event.
|
|
357
|
+
*
|
|
358
|
+
* @memberof Menu
|
|
359
|
+
*/
|
|
360
|
+
toggle(event: Event): void;
|
|
361
|
+
/**
|
|
362
|
+
* Shows the overlay.
|
|
363
|
+
* @param {Event} event - Browser event.
|
|
364
|
+
* @param {*} [target] - Target element
|
|
365
|
+
*
|
|
366
|
+
* @memberof Menu
|
|
367
|
+
*/
|
|
368
|
+
show(event: Event, target?: any): void;
|
|
369
|
+
/**
|
|
370
|
+
* Hides the overlay.
|
|
371
|
+
*
|
|
372
|
+
* @memberof Menu
|
|
373
|
+
*/
|
|
374
|
+
hide(): void;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
declare module '@vue/runtime-core' {
|
|
378
|
+
interface GlobalComponents {
|
|
379
|
+
Menu: GlobalComponentConstructor<Menu>;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
export default Menu;
|