@fewangsit/wangsvue-fats 1.0.0-alpha.22 → 1.0.0-alpha.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/components/animation/Animation.vue.d.ts +24 -0
- package/components/approverinfo/ApproverInfo.vue.d.ts +51 -0
- package/components/assetinfo/AssetInfo.vue.d.ts +31 -0
- package/components/badge/Badge.vue.d.ts +73 -0
- package/components/badgegroup/BadgeGroup.vue.d.ts +52 -0
- package/components/basecomponent/index.d.ts +28 -0
- package/components/basetree/BaseTree.vue.d.ts +591 -0
- package/components/basetree/TreeNode.vue.d.ts +35 -0
- package/components/breadcrumb/Breadcrumb.vue.d.ts +26 -0
- package/components/button/Button.vue.d.ts +193 -0
- package/components/buttonbulkaction/ButtonBulkAction.vue.d.ts +104 -0
- package/components/buttoncopy/ButtonCopy.vue.d.ts +26 -0
- package/components/buttondownload/ButtonDownload.vue.d.ts +49 -0
- package/components/buttonfilter/ButtonFilter.vue.d.ts +12 -0
- package/components/buttonradio/ButtonRadio.vue.d.ts +257 -0
- package/components/buttonscan/ButtonScan.vue.d.ts +201 -0
- package/components/buttonscan/helpers/getErrorCode.helper.d.ts +3 -0
- package/components/buttonscan/helpers/index.d.ts +1 -0
- package/components/buttonscan/workers/scanner.worker.d.ts +1 -0
- package/components/buttonsearch/ButtonSearch.vue.d.ts +38 -0
- package/components/buttonselecttree/ButtonSelectTree.vue.d.ts +200 -0
- package/components/buttonsync/ButtonSync.vue.d.ts +22 -0
- package/components/buttontoggle/ButtonToggle.vue.d.ts +18 -0
- package/components/buttonviewlog/ButtonViewLog.vue.d.ts +17 -0
- package/components/calendar/BaseCalendar.vue.d.ts +127 -0
- package/components/calendar/Calendar.vue.d.ts +570 -0
- package/components/card/Card.vue.d.ts +139 -0
- package/components/checkbox/Checkbox.vue.d.ts +329 -0
- package/components/customcolumn/ColumnList.vue.d.ts +47 -0
- package/components/customcolumn/CustomColumn.vue.d.ts +37 -0
- package/components/customcolumn/helpers/setVisibilityColumn.helper.d.ts +16 -0
- package/components/datatable/DataTable.vue.d.ts +735 -0
- package/components/datatable/MultiRow.vue.d.ts +36 -0
- package/components/datatable/helpers/adjustMenuPosition.helper.d.ts +1 -0
- package/components/datatable/helpers/filter.helper.d.ts +38 -0
- package/components/datatable/helpers/index.d.ts +6 -0
- package/components/datatable/helpers/readConfig.helper.d.ts +5 -0
- package/components/datatable/store/dataTable.store.d.ts +25 -0
- package/components/dialog/Dialog.vue.d.ts +464 -0
- package/components/dialogconfirm/DialogConfirm.vue.d.ts +164 -0
- package/components/dialogform/DialogForm.vue.d.ts +349 -0
- package/components/dialogselecttree/DialogSelectTree.vue.d.ts +136 -0
- package/components/dropdown/Dropdown.vue.d.ts +274 -0
- package/components/editor/CodeSnippetAdapter.vue.d.ts +152 -0
- package/components/editor/Editor.vue.d.ts +191 -0
- package/components/editor/EditorButton.vue.d.ts +35 -0
- package/components/editor/MentionList.vue.d.ts +49 -0
- package/components/editor/MentionSection.vue.d.ts +152 -0
- package/components/editor/codeSnippetExtension.d.ts +3 -0
- package/components/editor/mentionSectionExtension.d.ts +3 -0
- package/components/editor/suggestion.d.ts +2 -0
- package/components/fieldwrapper/FieldWrapper.vue.d.ts +69 -0
- package/components/fileupload/FileUpload.vue.d.ts +169 -0
- package/components/filtercontainer/FilterContainer.vue.d.ts +181 -0
- package/components/filtercontainer/helpers/applyFilter.helper.d.ts +14 -0
- package/components/filtercontainer/helpers/formatDateTimeRange.helper.d.ts +7 -0
- package/components/filtercontainer/helpers/getOption.helper.d.ts +12 -0
- package/components/form/Form.vue.d.ts +316 -0
- package/components/icon/Icon.vue.d.ts +256 -0
- package/components/image/Image.vue.d.ts +403 -0
- package/components/imagecompressor/BackgroundImageCropper.vue.d.ts +59 -0
- package/components/imagecompressor/ImageCompressor.vue.d.ts +229 -0
- package/components/imagecompressor/ImageInputInfo.vue.d.ts +55 -0
- package/components/index.d.ts +58 -0
- package/components/inputbadge/InputBadge.vue.d.ts +122 -0
- package/components/inputcurrency/InputCurrency.vue.d.ts +170 -0
- package/components/inputcurrency/helpers/currency.helper.d.ts +8 -0
- package/components/inputemail/InputEmail.vue.d.ts +25 -0
- package/components/inputnumber/InputNumber.vue.d.ts +282 -0
- package/components/inputpassword/InputPassword.vue.d.ts +32 -0
- package/components/inputphonenumber/InputPhoneNumber.vue.d.ts +99 -0
- package/components/inputphonenumber/helpers/getUserLocation.helper.d.ts +8 -0
- package/components/inputrangenumber/InputRangeNumber.vue.d.ts +120 -0
- package/components/inputsearch/InputSearch.vue.d.ts +33 -0
- package/components/inputtext/InputText.vue.d.ts +352 -0
- package/components/inputurl/InputURL.vue.d.ts +36 -0
- package/components/invisiblefield/InvisibleField.vue.d.ts +32 -0
- package/components/litedropdown/LiteDropdown.vue.d.ts +96 -0
- package/components/loading/Loading.vue.d.ts +47 -0
- package/components/loading/store/loading.store.d.ts +8 -0
- package/components/menu/Menu.vue.d.ts +390 -0
- package/components/menu/helpers/filterMenu.helper.d.ts +15 -0
- package/components/menu/helpers/index.d.ts +1 -0
- package/components/menuitem/MenuItem.vue +70 -0
- package/components/menuitem/MenuItem.vue.d.ts +39 -0
- package/components/menuitem/index.d.ts +106 -0
- package/components/multiselect/MultiSelect.vue.d.ts +194 -0
- package/components/overlaypanel/OverlayPanel.vue.d.ts +301 -0
- package/components/passthrough/index.d.ts +16 -0
- package/components/tabmenu/TabMenu.vue.d.ts +288 -0
- package/components/textarea/Textarea.vue.d.ts +170 -0
- package/components/timeline/Timeline.vue.d.ts +121 -0
- package/components/timeline/TimelineContentByType.vue.d.ts +64 -0
- package/components/toast/Toast.vue.d.ts +367 -0
- package/components/toggleswitch/ToggleSwitch.vue.d.ts +281 -0
- package/components/tree/Tree.vue.d.ts +148 -0
- package/components/tree/helpers/filterNodeKeys.helper.d.ts +22 -0
- package/components/tree/helpers/flattenTreeNodeChildren.helper.d.ts +8 -0
- package/components/tree/helpers/index.d.ts +3 -0
- package/components/ts-helpers.d.ts +85 -0
- package/components/username/UserName.vue.d.ts +113 -0
- package/components/userwithicon/UserWithIcon.vue.d.ts +20 -0
- package/config/defaultProps.d.ts +3 -0
- package/config/index.d.ts +3 -0
- package/config/locale.d.ts +3 -0
- package/loading-page-BrQattYE.js +1 -0
- package/loading-page-CgfbWppy.js +1 -0
- package/loading-page-CoC9UhfC.js +4 -0
- package/loading-page-CoXtqoc9.js +4 -0
- package/loading-page-DbLuqCHa.js +1 -0
- package/loading-page-f8D03l3G.js +4 -0
- package/loading-plane-CgfbWppy.js +1 -0
- package/loading-plane-CoXtqoc9.js +4 -0
- package/loading-table-Bdr9ZhtP.js +1 -0
- package/loading-table-ByUoWqUo.js +4 -0
- package/loading-table-BygEMzFM.js +4 -0
- package/loading-table-BzrSQlA0.js +1 -0
- package/loading-table-D9bw9OcI.js +4 -0
- package/loading-table-chOgXi94.js +1 -0
- package/main.d.ts +31 -0
- package/no-data-CTKux8RI.js +4 -0
- package/no-data-Cgze_Rvp.js +1 -0
- package/no-data-DLHO1L_u.js +4 -0
- package/no-data-Dep79CBh.js +1 -0
- package/no-data-g0dJCy2p.js +4 -0
- package/no-data-y1X5WtcQ.js +1 -0
- package/package.json +1 -1
- package/plugins/i18n-extension.d.ts +4 -0
- package/style.css +1 -0
- package/utils/getSeverityByAssetStatus.util.d.ts +3 -0
- package/utils/index.d.ts +22 -0
- package/utils/listenSidebarChanges.util.d.ts +16 -0
- package/wangsvue-fats.es.js +123684 -0
- package/wangsvue-fats.system.js +478 -0
|
@@ -0,0 +1,390 @@
|
|
|
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.WangsVue.org/menu/)
|
|
8
|
+
*
|
|
9
|
+
* @module menu
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
import { TransitionProps, VNode } from 'vue';
|
|
13
|
+
import { ComponentHooks } from '../basecomponent';
|
|
14
|
+
import { PassThroughOptions } from '../passthrough';
|
|
15
|
+
import { MenuItem } from '../menuitem';
|
|
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
|
+
export interface MenuLocaleConfig {
|
|
37
|
+
/**
|
|
38
|
+
* The label of menu when no selectable menu available.
|
|
39
|
+
*/
|
|
40
|
+
noOptionLabel?: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Custom passthrough(pt) option method.
|
|
45
|
+
*/
|
|
46
|
+
export interface MenuPassThroughMethodOptions {
|
|
47
|
+
/**
|
|
48
|
+
* Defines instance.
|
|
49
|
+
*/
|
|
50
|
+
instance: any;
|
|
51
|
+
/**
|
|
52
|
+
* Defines valid properties.
|
|
53
|
+
*/
|
|
54
|
+
props: MenuProps;
|
|
55
|
+
/**
|
|
56
|
+
* Defines current inline state.
|
|
57
|
+
*/
|
|
58
|
+
state: MenuState;
|
|
59
|
+
/**
|
|
60
|
+
* Defines current options.
|
|
61
|
+
*/
|
|
62
|
+
context: MenuContext;
|
|
63
|
+
/**
|
|
64
|
+
* Defines valid attributes.
|
|
65
|
+
*/
|
|
66
|
+
attrs: any;
|
|
67
|
+
/**
|
|
68
|
+
* Defines parent options.
|
|
69
|
+
*/
|
|
70
|
+
parent: any;
|
|
71
|
+
/**
|
|
72
|
+
* Defines passthrough(pt) options in global config.
|
|
73
|
+
*/
|
|
74
|
+
global: object | undefined;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Custom passthrough(pt) options.
|
|
79
|
+
* @see {@link MenuProps.pt}
|
|
80
|
+
*/
|
|
81
|
+
export interface MenuPassThroughOptions {
|
|
82
|
+
/**
|
|
83
|
+
* Used to pass attributes to the root's DOM element.
|
|
84
|
+
*/
|
|
85
|
+
root?: MenuPassThroughOptionType;
|
|
86
|
+
/**
|
|
87
|
+
* Used to pass attributes to the list's DOM element.
|
|
88
|
+
*/
|
|
89
|
+
menu?: MenuPassThroughOptionType;
|
|
90
|
+
/**
|
|
91
|
+
* Used to pass attributes to the submenu header's DOM element.
|
|
92
|
+
*/
|
|
93
|
+
submenuHeader?: MenuPassThroughOptionType;
|
|
94
|
+
/**
|
|
95
|
+
* Used to pass attributes to the list item's DOM element.
|
|
96
|
+
*/
|
|
97
|
+
menuitem?: MenuPassThroughOptionType;
|
|
98
|
+
/**
|
|
99
|
+
* Used to pass attributes to the content's DOM element.
|
|
100
|
+
*/
|
|
101
|
+
content?: MenuPassThroughOptionType;
|
|
102
|
+
/**
|
|
103
|
+
* Used to pass attributes to the action's DOM element.
|
|
104
|
+
*/
|
|
105
|
+
action?: MenuPassThroughOptionType;
|
|
106
|
+
/**
|
|
107
|
+
* Used to pass attributes to the icon's DOM element.
|
|
108
|
+
*/
|
|
109
|
+
icon?: MenuPassThroughOptionType;
|
|
110
|
+
/**
|
|
111
|
+
* Used to pass attributes to the label's DOM element.
|
|
112
|
+
*/
|
|
113
|
+
label?: MenuPassThroughOptionType;
|
|
114
|
+
/**
|
|
115
|
+
* Used to pass attributes to the separator's DOM element.
|
|
116
|
+
*/
|
|
117
|
+
separator?: MenuPassThroughOptionType;
|
|
118
|
+
/**
|
|
119
|
+
* Used to pass attributes to the start of the component.
|
|
120
|
+
*/
|
|
121
|
+
start?: MenuPassThroughOptionType;
|
|
122
|
+
/**
|
|
123
|
+
* Used to pass attributes to the end of the component.
|
|
124
|
+
*/
|
|
125
|
+
end?: MenuPassThroughOptionType;
|
|
126
|
+
/**
|
|
127
|
+
* Used to manage all lifecycle hooks.
|
|
128
|
+
* @see {@link basecomponent.ComponentHooks}
|
|
129
|
+
*/
|
|
130
|
+
hooks?: ComponentHooks;
|
|
131
|
+
/**
|
|
132
|
+
* Used to control Vue Transition API.
|
|
133
|
+
*/
|
|
134
|
+
transition?: MenuPassThroughTransitionType;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Custom passthrough attributes for each DOM elements
|
|
139
|
+
*/
|
|
140
|
+
export interface MenuPassThroughAttributes {
|
|
141
|
+
[key: string]: any;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Defines current inline state in Menu component.
|
|
146
|
+
*/
|
|
147
|
+
export interface MenuState {
|
|
148
|
+
/**
|
|
149
|
+
* Current id state as a string.
|
|
150
|
+
*/
|
|
151
|
+
id: string;
|
|
152
|
+
/**
|
|
153
|
+
* Current visible state as a boolean.
|
|
154
|
+
* @defaultValue false
|
|
155
|
+
*/
|
|
156
|
+
overlayVisible: boolean;
|
|
157
|
+
/**
|
|
158
|
+
* Current focus state as a boolean.
|
|
159
|
+
* @defaultValue false
|
|
160
|
+
*/
|
|
161
|
+
focused: boolean;
|
|
162
|
+
/**
|
|
163
|
+
* Focused option index.
|
|
164
|
+
*/
|
|
165
|
+
focusedOptionIndex: number;
|
|
166
|
+
/**
|
|
167
|
+
* Selected option index.
|
|
168
|
+
*/
|
|
169
|
+
selectedOptionIndex: number;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Defines current options in Menu component.
|
|
174
|
+
*/
|
|
175
|
+
export interface MenuContext {
|
|
176
|
+
/**
|
|
177
|
+
* Current menuitem
|
|
178
|
+
*/
|
|
179
|
+
item: any;
|
|
180
|
+
/**
|
|
181
|
+
* Current index of the menuitem.
|
|
182
|
+
*/
|
|
183
|
+
index: number;
|
|
184
|
+
/**
|
|
185
|
+
* Current focused state of menuitem as a boolean.
|
|
186
|
+
* @defaultValue false
|
|
187
|
+
*/
|
|
188
|
+
focused: boolean;
|
|
189
|
+
/**
|
|
190
|
+
* Current disabled state of menuitem as a boolean.
|
|
191
|
+
* @defaultValue false
|
|
192
|
+
*/
|
|
193
|
+
disabled: boolean;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Defines valid router binding props in Menu component.
|
|
198
|
+
*/
|
|
199
|
+
export interface MenuRouterBindProps {
|
|
200
|
+
/**
|
|
201
|
+
* Action element binding
|
|
202
|
+
*/
|
|
203
|
+
action: object;
|
|
204
|
+
/**
|
|
205
|
+
* Icon element binding
|
|
206
|
+
*/
|
|
207
|
+
icon: object;
|
|
208
|
+
/**
|
|
209
|
+
* Label element binding
|
|
210
|
+
*/
|
|
211
|
+
label: object;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Defines valid properties in Menu component.
|
|
216
|
+
*/
|
|
217
|
+
export interface MenuProps {
|
|
218
|
+
/**
|
|
219
|
+
* An array of menuitems.
|
|
220
|
+
*/
|
|
221
|
+
model?: MenuItem[] | undefined;
|
|
222
|
+
/**
|
|
223
|
+
* Defines if menu would displayed as a popup.
|
|
224
|
+
* @defaultValue true
|
|
225
|
+
*/
|
|
226
|
+
popup?: boolean | undefined;
|
|
227
|
+
/**
|
|
228
|
+
* A valid query selector or an HTMLElement to specify where the overlay gets attached.
|
|
229
|
+
* @defaultValue body
|
|
230
|
+
*/
|
|
231
|
+
appendTo?: 'body' | 'self' | string | undefined | HTMLElement;
|
|
232
|
+
/**
|
|
233
|
+
* Whether to automatically manage layering.
|
|
234
|
+
* @defaultValue true
|
|
235
|
+
*/
|
|
236
|
+
autoZIndex?: boolean | undefined;
|
|
237
|
+
/**
|
|
238
|
+
* Base zIndex value to use in layering.
|
|
239
|
+
* @defaultValue 0
|
|
240
|
+
*/
|
|
241
|
+
baseZIndex?: number | undefined;
|
|
242
|
+
/**
|
|
243
|
+
* Whether to apply 'router-link-active-exact' class if route exactly matches the item path.
|
|
244
|
+
* @deprecated since v3.40.0.
|
|
245
|
+
* @defaultValue true
|
|
246
|
+
*/
|
|
247
|
+
exact?: boolean | undefined;
|
|
248
|
+
/**
|
|
249
|
+
* Index of the element in tabbing order.
|
|
250
|
+
*/
|
|
251
|
+
tabindex?: number | string | undefined;
|
|
252
|
+
/**
|
|
253
|
+
* Defines a string value that labels an interactive element.
|
|
254
|
+
*/
|
|
255
|
+
ariaLabel?: string | undefined;
|
|
256
|
+
/**
|
|
257
|
+
* Identifier of the underlying input element.
|
|
258
|
+
*/
|
|
259
|
+
ariaLabelledby?: string | undefined;
|
|
260
|
+
/**
|
|
261
|
+
* Used to pass attributes to DOM elements inside the component.
|
|
262
|
+
* @type {MenuPassThroughOptions}
|
|
263
|
+
*/
|
|
264
|
+
pt?: PassThrough<MenuPassThroughOptions>;
|
|
265
|
+
/**
|
|
266
|
+
* Used to configure passthrough(pt) options of the component.
|
|
267
|
+
* @type {PassThroughOptions}
|
|
268
|
+
*/
|
|
269
|
+
ptOptions?: PassThroughOptions;
|
|
270
|
+
/**
|
|
271
|
+
* When enabled, it removes component related styles in the core.
|
|
272
|
+
* @defaultValue false
|
|
273
|
+
*/
|
|
274
|
+
unstyled?: boolean;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Defines valid slots in Menu component.
|
|
279
|
+
*/
|
|
280
|
+
export interface MenuSlots {
|
|
281
|
+
/**
|
|
282
|
+
* Custom start template.
|
|
283
|
+
*/
|
|
284
|
+
start(): VNode[];
|
|
285
|
+
/**
|
|
286
|
+
* Custom end template.
|
|
287
|
+
*/
|
|
288
|
+
end(): VNode[];
|
|
289
|
+
/**
|
|
290
|
+
* Custom item template.
|
|
291
|
+
* @param {Object} scope - item slot's params.
|
|
292
|
+
*/
|
|
293
|
+
item(scope: {
|
|
294
|
+
/**
|
|
295
|
+
* Menuitem instance
|
|
296
|
+
*/
|
|
297
|
+
item: MenuItem;
|
|
298
|
+
/**
|
|
299
|
+
* Label property of the menuitem
|
|
300
|
+
*/
|
|
301
|
+
label: string | ((...args: any) => string) | undefined;
|
|
302
|
+
/**
|
|
303
|
+
* Binding properties of the menuitem
|
|
304
|
+
*/
|
|
305
|
+
props: MenuRouterBindProps;
|
|
306
|
+
}): VNode[];
|
|
307
|
+
/**
|
|
308
|
+
* Custom item icon template.
|
|
309
|
+
* @param {Object} scope - item icon slot's params.
|
|
310
|
+
*/
|
|
311
|
+
itemicon(scope: {
|
|
312
|
+
/**
|
|
313
|
+
* Menuitem instance
|
|
314
|
+
*/
|
|
315
|
+
item: MenuItem;
|
|
316
|
+
/**
|
|
317
|
+
* Style class of the item icon element.
|
|
318
|
+
*/
|
|
319
|
+
class: any;
|
|
320
|
+
}): VNode[];
|
|
321
|
+
/**
|
|
322
|
+
* Custom item template.
|
|
323
|
+
* @param {Object} scope - submenuheader slot's params.
|
|
324
|
+
*/
|
|
325
|
+
submenuheader(scope: {
|
|
326
|
+
/**
|
|
327
|
+
* Menuitem instance
|
|
328
|
+
*/
|
|
329
|
+
item: MenuItem;
|
|
330
|
+
}): VNode[];
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* Defines valid emits in Menu component.
|
|
335
|
+
*/
|
|
336
|
+
export type MenuEmits = {
|
|
337
|
+
/**
|
|
338
|
+
* Callback to invoke when the component receives focus.
|
|
339
|
+
* @param {Event} event - Browser event.
|
|
340
|
+
*/
|
|
341
|
+
focus: [event: Event];
|
|
342
|
+
/**
|
|
343
|
+
* Callback to invoke when the component loses focus.
|
|
344
|
+
* @param {Event} event - Browser event.
|
|
345
|
+
*/
|
|
346
|
+
blur: [event: Event];
|
|
347
|
+
};
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* **WangsVue - Menu**
|
|
351
|
+
*
|
|
352
|
+
* _Menu is a navigation / command component that supports dynamic and static positioning._
|
|
353
|
+
*
|
|
354
|
+
* --- ---
|
|
355
|
+
* 
|
|
356
|
+
*
|
|
357
|
+
* @group Component
|
|
358
|
+
*
|
|
359
|
+
*/
|
|
360
|
+
declare class Menu extends ClassComponent<MenuProps, MenuSlots, MenuEmits> {
|
|
361
|
+
/**
|
|
362
|
+
* Toggles the visibility of the overlay.
|
|
363
|
+
* @param {Event} event - Browser event.
|
|
364
|
+
*
|
|
365
|
+
* @memberof Menu
|
|
366
|
+
*/
|
|
367
|
+
toggle(event: Event): void;
|
|
368
|
+
/**
|
|
369
|
+
* Shows the overlay.
|
|
370
|
+
* @param {Event} event - Browser event.
|
|
371
|
+
* @param {*} [target] - Target element
|
|
372
|
+
*
|
|
373
|
+
* @memberof Menu
|
|
374
|
+
*/
|
|
375
|
+
show(event: Event, target?: any): void;
|
|
376
|
+
/**
|
|
377
|
+
* Hides the overlay.
|
|
378
|
+
*
|
|
379
|
+
* @memberof Menu
|
|
380
|
+
*/
|
|
381
|
+
hide(): void;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
declare module '@vue/runtime-core' {
|
|
385
|
+
interface GlobalComponents {
|
|
386
|
+
Menu: GlobalComponentConstructor<Menu>;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
export default Menu;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MenuItem } from '../../menuitem';
|
|
2
|
+
/**
|
|
3
|
+
* Filters the menu items to return only the visible ones.
|
|
4
|
+
* If no visible menu items are found, it returns a menu with a label 'No Option Available'.
|
|
5
|
+
*
|
|
6
|
+
* @param menuItems - The array of menu items to filter.
|
|
7
|
+
* @param noOptionLabel - The label of menu to be shown when no available option. The value is from locale configuration each project.
|
|
8
|
+
*
|
|
9
|
+
* @returns - The array of visible menu items or an array with a single menu item with label 'No Option Available'.
|
|
10
|
+
*/
|
|
11
|
+
declare const filterVisibleMenu: (
|
|
12
|
+
menuItems: MenuItem[],
|
|
13
|
+
noOptionLabel?: string,
|
|
14
|
+
) => MenuItem[];
|
|
15
|
+
export default filterVisibleMenu;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as filterVisibleMenu } from './filterMenu.helper';
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { WangsIcons } from 'lib/components/icon/Icon.vue.d';
|
|
3
|
+
import { MenuRouterBindProps } from '../menu/Menu.vue.d';
|
|
4
|
+
import { MenuItem } from '.';
|
|
5
|
+
import Icon from '../icon/Icon.vue';
|
|
6
|
+
|
|
7
|
+
const props = defineProps<{
|
|
8
|
+
item: MenuItem;
|
|
9
|
+
routerProps: MenuRouterBindProps;
|
|
10
|
+
}>();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<router-link
|
|
15
|
+
v-slot="{ href, navigate }"
|
|
16
|
+
v-if="props.item.route"
|
|
17
|
+
:to="props.item.route"
|
|
18
|
+
custom
|
|
19
|
+
>
|
|
20
|
+
<a :href="href" v-bind="routerProps?.action" @click="navigate">
|
|
21
|
+
<Icon
|
|
22
|
+
v-if="props.item.icon"
|
|
23
|
+
v-bind="routerProps?.icon"
|
|
24
|
+
:icon="props.item.icon"
|
|
25
|
+
/>
|
|
26
|
+
<span v-bind="routerProps?.label">{{ props.item.label }}</span>
|
|
27
|
+
</a>
|
|
28
|
+
</router-link>
|
|
29
|
+
|
|
30
|
+
<a
|
|
31
|
+
v-else-if="props.item.url"
|
|
32
|
+
:href="props.item.url"
|
|
33
|
+
:target="props.item.target"
|
|
34
|
+
v-bind="routerProps?.action"
|
|
35
|
+
@click.stop
|
|
36
|
+
>
|
|
37
|
+
<Icon
|
|
38
|
+
v-if="props.item.icon"
|
|
39
|
+
v-bind="routerProps?.icon"
|
|
40
|
+
:icon="props.item.icon as WangsIcons"
|
|
41
|
+
/>
|
|
42
|
+
<span v-bind="routerProps?.label">{{ props.item.label }}</span>
|
|
43
|
+
</a>
|
|
44
|
+
|
|
45
|
+
<a
|
|
46
|
+
v-else
|
|
47
|
+
v-bind="routerProps?.action"
|
|
48
|
+
aria-hidden="true"
|
|
49
|
+
data-pc-section="action"
|
|
50
|
+
tabindex="-1"
|
|
51
|
+
>
|
|
52
|
+
<Icon
|
|
53
|
+
v-if="props.item.icon"
|
|
54
|
+
:icon="props.item.icon as WangsIcons"
|
|
55
|
+
:severity="props.item.danger ? 'danger' : undefined"
|
|
56
|
+
v-bind="routerProps?.icon"
|
|
57
|
+
/>
|
|
58
|
+
|
|
59
|
+
<span
|
|
60
|
+
v-bind="
|
|
61
|
+
$preset.menu?.label({
|
|
62
|
+
props: { danger: props.item.danger },
|
|
63
|
+
})
|
|
64
|
+
"
|
|
65
|
+
data-pc-section="label"
|
|
66
|
+
>
|
|
67
|
+
{{ props.item.label }}
|
|
68
|
+
</span>
|
|
69
|
+
</a>
|
|
70
|
+
</template>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { MenuRouterBindProps } from '../menu/Menu.vue.d';
|
|
2
|
+
import { MenuItem } from '.';
|
|
3
|
+
declare const _default: import('vue').DefineComponent<
|
|
4
|
+
__VLS_TypePropsToOption<{
|
|
5
|
+
item: MenuItem;
|
|
6
|
+
routerProps: MenuRouterBindProps;
|
|
7
|
+
}>,
|
|
8
|
+
{},
|
|
9
|
+
unknown,
|
|
10
|
+
{},
|
|
11
|
+
{},
|
|
12
|
+
import('vue').ComponentOptionsMixin,
|
|
13
|
+
import('vue').ComponentOptionsMixin,
|
|
14
|
+
{},
|
|
15
|
+
string,
|
|
16
|
+
import('vue').PublicProps,
|
|
17
|
+
Readonly<
|
|
18
|
+
import('vue').ExtractPropTypes<
|
|
19
|
+
__VLS_TypePropsToOption<{
|
|
20
|
+
item: MenuItem;
|
|
21
|
+
routerProps: MenuRouterBindProps;
|
|
22
|
+
}>
|
|
23
|
+
>
|
|
24
|
+
>,
|
|
25
|
+
{},
|
|
26
|
+
{}
|
|
27
|
+
>;
|
|
28
|
+
export default _default;
|
|
29
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
30
|
+
type __VLS_TypePropsToOption<T> = {
|
|
31
|
+
[K in keyof T]-?: {} extends Pick<T, K>
|
|
32
|
+
? {
|
|
33
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
34
|
+
}
|
|
35
|
+
: {
|
|
36
|
+
type: import('vue').PropType<T[K]>;
|
|
37
|
+
required: true;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { WangsIcons } from '../icon/Icon.vue.d';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* WangsVue menu components share a common api to specify the menuitems and submenus.
|
|
6
|
+
*
|
|
7
|
+
* @module menuitem
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Custom command event.
|
|
13
|
+
* @todo next release should be able to change see menuItem.command
|
|
14
|
+
*/
|
|
15
|
+
export interface MenuItemCommandEvent {
|
|
16
|
+
/**
|
|
17
|
+
* Browser event.
|
|
18
|
+
*/
|
|
19
|
+
originalEvent: Event;
|
|
20
|
+
/**
|
|
21
|
+
* Menuitem instance.
|
|
22
|
+
*/
|
|
23
|
+
item: MenuItem;
|
|
24
|
+
/**
|
|
25
|
+
* Optional
|
|
26
|
+
*/
|
|
27
|
+
[key: string]: any;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Defines model of MenuItem API.
|
|
32
|
+
*/
|
|
33
|
+
export interface MenuItem {
|
|
34
|
+
/**
|
|
35
|
+
* Property name or getter function to use as the label of an item.
|
|
36
|
+
*/
|
|
37
|
+
label?: string | ((...args: any) => string) | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Icon of the item.
|
|
40
|
+
*/
|
|
41
|
+
icon?: WangsIcons | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Callback to execute when item is clicked.
|
|
44
|
+
* @param {MenuItemCommandEvent} event - Custom command event.
|
|
45
|
+
* @todo next release should be able to change
|
|
46
|
+
*/
|
|
47
|
+
command?: (event: MenuItemCommandEvent) => void;
|
|
48
|
+
/**
|
|
49
|
+
* External link to navigate when item is clicked.
|
|
50
|
+
*/
|
|
51
|
+
url?: string | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* Specifies where to open the linked document.
|
|
54
|
+
*/
|
|
55
|
+
target?: string | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* Internal/ vue router link to navigate when item is clicked.
|
|
58
|
+
*/
|
|
59
|
+
route?: string | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* An array of children menuitems.
|
|
62
|
+
*/
|
|
63
|
+
items?: MenuItem[] | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* A boolean or a function to return a boolean to specify if the item is disabled.
|
|
66
|
+
* @defaultValue false
|
|
67
|
+
*/
|
|
68
|
+
disabled?: boolean | ((...args: any) => boolean) | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* A boolean or a function to return a boolean to specify if the item is visible.
|
|
71
|
+
* @defaultValue true
|
|
72
|
+
*/
|
|
73
|
+
visible?: boolean | ((...args: any) => boolean) | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* A boolean or to specify if the item has danger severity.
|
|
76
|
+
* @defaultValue false
|
|
77
|
+
*/
|
|
78
|
+
danger?: boolean | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* Defines the item as a separator.
|
|
81
|
+
* @defaultValue false
|
|
82
|
+
*/
|
|
83
|
+
separator?: boolean | undefined;
|
|
84
|
+
/**
|
|
85
|
+
* Inline style of the menuitem.
|
|
86
|
+
*/
|
|
87
|
+
style?: any;
|
|
88
|
+
/**
|
|
89
|
+
* Style class of the menuitem.
|
|
90
|
+
*/
|
|
91
|
+
class?: any;
|
|
92
|
+
/**
|
|
93
|
+
* Unique identifier of an item.
|
|
94
|
+
*/
|
|
95
|
+
key?: string | undefined;
|
|
96
|
+
/**
|
|
97
|
+
* Specify if the there is additional slot for the selected menuitem.
|
|
98
|
+
* Only work on BulkAction when BulkActionProps.selectMenuType is "dropdown".
|
|
99
|
+
*
|
|
100
|
+
*/
|
|
101
|
+
useAdditionSlot?: boolean;
|
|
102
|
+
/**
|
|
103
|
+
* Optional
|
|
104
|
+
*/
|
|
105
|
+
[key: string]: any;
|
|
106
|
+
}
|