forked from georchestra/header
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig-interfaces.ts
More file actions
79 lines (74 loc) · 2.37 KB
/
config-interfaces.ts
File metadata and controls
79 lines (74 loc) · 2.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
export interface AbstractBaseInterface {
type?: string
//Role required to display the item, can end with a star to match prefixed roles (e.g. ROLE_SUPERSET_*)
hasRole?: string
//Role which hides the item
blockedRole?: string
//If the item is hidden in mobile mode
hideMobile?: boolean
}
export interface Link extends AbstractBaseInterface {
label?: string
//URL to redirect to
url: string
//i18n key to display the label
i18n?: string
//to trigger the active tab (underline). By default, it triggers on start with e.g /console (start:/console) will trigger on /console** pages
// Values can be 'start', 'exact', 'includes', 'end'
activeAppUrl?: string
//Icon to display next to the label
icon?: string
//If the link is clickable
disabled?: boolean
// custom css class to add on element
customClass?: string
// to use icon from url instead icon from lib
iconUrl: string
}
export interface Dropdown extends AbstractBaseInterface {
label: string
//i18n key to display the label
i18n?: string
//List of items to display in the dropdown
items?: Array<Link>
// custom css class to add on element
customClass?: string
// to use icon from url instead icon from lib
iconUrl: string
//Icon to display next to the label
icon?: string
}
export interface Separator extends AbstractBaseInterface {}
export interface Navigation {
class?: string
menus?: Array<Array<Link | Separator | Dropdown>>
}
export interface Config {
//Logo url to display in the header
logoUrl?: string
//Minized logo url to display in the header (used between 768 and 1024px if set)
minimizedLogoUrl?: string
//Title to the logo displayed in the header
logoTitle?: string
//Whether to hide the login button
hideLogin?: boolean
//Custom stylesheet to apply to the header
stylesheet?: string
//Link to icons url. Tested with https://cdn.jsdelivr.net/gh/iconoir-icons/iconoir@main/css/iconoir.css
iconsUrl?: string
//Force header's language
lang?: string
//Login URL to redirect to
login: {
url: string
params?: Array<{ [key: string]: string }>
customClass?: string
showAccountBtnText?: boolean
}
//Logout URL to redirect to
logoutUrl: string
//Use it if you want a different logout URL for external authentication providers
logoutExternalUrl?: string
//Menu items to display in the header
displayFullnameInAccountBtn?: boolean
}