athena-ui-js 2.0.0 → 2.0.1
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/README.md +28 -4
- package/package.json +5 -2
- package/src/athena-ui.js +1 -1
- package/src/libs/config/config.js +1 -1
- package/src/libs/hephaestus/chartGenerator/chartGenerator.js +26 -2
- package/types/athena-ui.d.ts +96 -96
- package/types/chart.d.ts +1 -1
- package/types/classic.d.ts +1 -1
- package/types/components.d.ts +1 -1
- package/types/controls.d.ts +3 -3
- package/types/csv.d.ts +1 -1
- package/types/dialog.d.ts +2 -2
- package/types/dom.d.ts +1 -1
- package/types/feedback.d.ts +1 -1
- package/types/format.d.ts +1 -1
- package/types/forms.d.ts +2 -2
- package/types/i18n.d.ts +1 -1
- package/types/inputs.d.ts +4 -4
- package/types/libs/config/config.d.ts +3 -3
- package/types/libs/config/hooks.d.ts +8 -8
- package/types/libs/core/combobox.d.ts +10 -10
- package/types/libs/core/controls.d.ts +28 -28
- package/types/libs/core/cookies.d.ts +27 -27
- package/types/libs/core/csv.d.ts +12 -12
- package/types/libs/core/dateRange.d.ts +72 -72
- package/types/libs/core/dom.d.ts +65 -65
- package/types/libs/core/elementGenerator.d.ts +30 -30
- package/types/libs/core/errors.d.ts +29 -29
- package/types/libs/core/focus.d.ts +6 -6
- package/types/libs/core/format.d.ts +21 -21
- package/types/libs/core/hungarianControls.d.ts +2 -2
- package/types/libs/core/i18n.d.ts +17 -17
- package/types/libs/core/pagination.d.ts +5 -5
- package/types/libs/core/sanitize.d.ts +6 -6
- package/types/libs/core/tableMath.d.ts +26 -26
- package/types/libs/core/theme.d.ts +39 -39
- package/types/libs/core/validation.d.ts +56 -56
- package/types/libs/hephaestus/LayoutGenerator/basicLayoutGenerator.d.ts +10 -10
- package/types/libs/hephaestus/LayoutGenerator/footerContentGenerator.d.ts +4 -4
- package/types/libs/hephaestus/LayoutGenerator/headerContentGenerator.d.ts +20 -20
- package/types/libs/hephaestus/LayoutGenerator/wrapperContentGenerator.d.ts +1 -1
- package/types/libs/hephaestus/MenuGenerator/basicMenuGenerator.d.ts +14 -14
- package/types/libs/hephaestus/MenuGenerator/menuGenerator.d.ts +65 -65
- package/types/libs/hephaestus/auth/authState.d.ts +26 -26
- package/types/libs/hephaestus/auth/session.d.ts +26 -26
- package/types/libs/hephaestus/chartGenerator/chartGenerator.d.ts +2 -0
- package/types/libs/hephaestus/componentGenerator/componentGenerator.d.ts +222 -222
- package/types/libs/hephaestus/componentGenerator/themePicker.d.ts +24 -24
- package/types/libs/hephaestus/dialogGenerator/dialogGenerator.d.ts +120 -120
- package/types/libs/hephaestus/feedbackGenerator/feedbackGenerator.d.ts +86 -86
- package/types/libs/hephaestus/formGenerator/authForms.d.ts +122 -122
- package/types/libs/hephaestus/formGenerator/changePasswordFormGenerator.d.ts +6 -6
- package/types/libs/hephaestus/formGenerator/formBuilder.d.ts +113 -113
- package/types/libs/hephaestus/formGenerator/formUtils.d.ts +8 -8
- package/types/libs/hephaestus/formGenerator/loginFormGenerator.d.ts +11 -11
- package/types/libs/hephaestus/formGenerator/lostPasswordFormGenerator.d.ts +4 -4
- package/types/libs/hephaestus/formGenerator/registrationFormGenerator.d.ts +7 -7
- package/types/libs/hephaestus/hephaestus.d.ts +3 -3
- package/types/libs/hephaestus/inputGenerator/dropZoneGenerator.d.ts +48 -48
- package/types/libs/hephaestus/inputGenerator/inputGenerator.d.ts +185 -185
- package/types/libs/hephaestus/inputGenerator/richTextGenerator.d.ts +49 -49
- package/types/libs/hephaestus/modalGenerator/modalGenerator.d.ts +2 -2
- package/types/libs/hephaestus/navigationGenerator/navigationGenerator.d.ts +150 -150
- package/types/libs/hephaestus/router/matchRoute.d.ts +12 -12
- package/types/libs/hephaestus/router/router.d.ts +67 -67
- package/types/libs/hephaestus/tableGenerator/tableGenerator.d.ts +120 -120
- package/types/menu.d.ts +1 -1
- package/types/navigation.d.ts +1 -1
- package/types/res/themes/themes.d.ts +7 -7
- package/types/router.d.ts +1 -1
- package/types/sanitize.d.ts +1 -1
- package/types/session.d.ts +3 -3
- package/types/table.d.ts +1 -1
- package/types/testing.d.ts +27 -27
- package/types/theme.d.ts +2 -2
- package/types/validation.d.ts +1 -1
|
@@ -1,222 +1,222 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generates a link. External links open in a new tab and get `rel="noopener noreferrer"`.
|
|
3
|
-
* With `onclick` and no `href` it behaves as an in-page action.
|
|
4
|
-
*
|
|
5
|
-
* @param {object} options
|
|
6
|
-
* @param {string|Element} [options.parent]
|
|
7
|
-
* @param {string} options.text
|
|
8
|
-
* @param {string} [options.href]
|
|
9
|
-
* @param {boolean} [options.external]
|
|
10
|
-
* @param {(event: Event) => void} [options.onclick]
|
|
11
|
-
* @returns {HTMLAnchorElement}
|
|
12
|
-
*/
|
|
13
|
-
export function generateLink(options?: {
|
|
14
|
-
parent?: string | Element;
|
|
15
|
-
text: string;
|
|
16
|
-
href?: string;
|
|
17
|
-
external?: boolean;
|
|
18
|
-
onclick?: (event: Event) => void;
|
|
19
|
-
}): HTMLAnchorElement;
|
|
20
|
-
/**
|
|
21
|
-
* Generates a section with an optional heading. Returns the section, fill it through `content`
|
|
22
|
-
* or append to it.
|
|
23
|
-
*
|
|
24
|
-
* @param {object} options
|
|
25
|
-
* @param {string|Element} [options.parent]
|
|
26
|
-
* @param {string} [options.title]
|
|
27
|
-
* @param {number} [options.level=2] heading level 1..6
|
|
28
|
-
* @param {string|Node|Array|Function} [options.content]
|
|
29
|
-
* @returns {HTMLElement}
|
|
30
|
-
*/
|
|
31
|
-
export function generateSection(options?: {
|
|
32
|
-
parent?: string | Element;
|
|
33
|
-
title?: string;
|
|
34
|
-
level?: number;
|
|
35
|
-
content?: string | Node | any[] | Function;
|
|
36
|
-
}): HTMLElement;
|
|
37
|
-
/**
|
|
38
|
-
* Generates a card.
|
|
39
|
-
*
|
|
40
|
-
* @param {object} options
|
|
41
|
-
* @param {string|Element} [options.parent]
|
|
42
|
-
* @param {string} [options.title]
|
|
43
|
-
* @param {string} [options.image] image URL shown on top
|
|
44
|
-
* @param {string} [options.imageAlt]
|
|
45
|
-
* @param {string|Node|Array|Function} [options.content]
|
|
46
|
-
* @param {string|Node|Array|Function} [options.footer]
|
|
47
|
-
* @returns {{element: HTMLElement, body: HTMLElement}} append to `body` to add more content
|
|
48
|
-
*/
|
|
49
|
-
export function generateCard(options?: {
|
|
50
|
-
parent?: string | Element;
|
|
51
|
-
title?: string;
|
|
52
|
-
image?: string;
|
|
53
|
-
imageAlt?: string;
|
|
54
|
-
content?: string | Node | any[] | Function;
|
|
55
|
-
footer?: string | Node | any[] | Function;
|
|
56
|
-
}): {
|
|
57
|
-
element: HTMLElement;
|
|
58
|
-
body: HTMLElement;
|
|
59
|
-
};
|
|
60
|
-
/**
|
|
61
|
-
* Generates a small label.
|
|
62
|
-
*
|
|
63
|
-
* @param {object} options
|
|
64
|
-
* @param {string|Element} [options.parent]
|
|
65
|
-
* @param {string} options.text
|
|
66
|
-
* @param {"neutral"|"info"|"success"|"warning"|"error"} [options.variant="neutral"]
|
|
67
|
-
* @param {boolean} [options.pill]
|
|
68
|
-
* @returns {HTMLElement}
|
|
69
|
-
*/
|
|
70
|
-
export function generateBadge(options?: {
|
|
71
|
-
parent?: string | Element;
|
|
72
|
-
text: string;
|
|
73
|
-
variant?: "neutral" | "info" | "success" | "warning" | "error";
|
|
74
|
-
pill?: boolean;
|
|
75
|
-
}): HTMLElement;
|
|
76
|
-
export function initialsOf(name?: string): string;
|
|
77
|
-
/**
|
|
78
|
-
* Generates an avatar: the image, or the initials of the name when there is no (working) image.
|
|
79
|
-
*
|
|
80
|
-
* @param {object} options
|
|
81
|
-
* @param {string|Element} [options.parent]
|
|
82
|
-
* @param {string} [options.name]
|
|
83
|
-
* @param {string} [options.src]
|
|
84
|
-
* @param {"small"|"large"} [options.size]
|
|
85
|
-
* @returns {HTMLElement}
|
|
86
|
-
*/
|
|
87
|
-
export function generateAvatar(options?: {
|
|
88
|
-
parent?: string | Element;
|
|
89
|
-
name?: string;
|
|
90
|
-
src?: string;
|
|
91
|
-
size?: "small" | "large";
|
|
92
|
-
}): HTMLElement;
|
|
93
|
-
/**
|
|
94
|
-
* Generates a KPI tile: a label, a big value and an optional change.
|
|
95
|
-
*
|
|
96
|
-
* @param {object} options
|
|
97
|
-
* @param {string|Element} [options.parent]
|
|
98
|
-
* @param {string} options.label
|
|
99
|
-
* @param {string|number} options.value
|
|
100
|
-
* @param {number} [options.delta] change in percent, shown with an arrow
|
|
101
|
-
* @param {boolean} [options.invertDelta] a falling value is good news (costs, errors)
|
|
102
|
-
* @param {"ok"|"warn"|"bad"} [options.tone] colours the tile (the class is-ok / is-warn / is-bad) and adds the word to the screen reader text
|
|
103
|
-
* @param {string} [options.note] small text under the value ("of 120 hosts", "updated 2 min ago")
|
|
104
|
-
* @returns {{element: HTMLElement, setValue: Function, setNote: Function, setTone: Function}}
|
|
105
|
-
*/
|
|
106
|
-
export function generateStat(options?: {
|
|
107
|
-
parent?: string | Element;
|
|
108
|
-
label: string;
|
|
109
|
-
value: string | number;
|
|
110
|
-
delta?: number;
|
|
111
|
-
invertDelta?: boolean;
|
|
112
|
-
tone?: "ok" | "warn" | "bad";
|
|
113
|
-
note?: string;
|
|
114
|
-
}): {
|
|
115
|
-
element: HTMLElement;
|
|
116
|
-
setValue: Function;
|
|
117
|
-
setNote: Function;
|
|
118
|
-
setTone: Function;
|
|
119
|
-
};
|
|
120
|
-
/**
|
|
121
|
-
* Generates a responsive grid. The columns collapse to one on small screens.
|
|
122
|
-
*
|
|
123
|
-
* @param {object} options
|
|
124
|
-
* @param {string|Element} [options.parent]
|
|
125
|
-
* @param {number} [options.columns=3]
|
|
126
|
-
* @param {string} [options.gap] any CSS length
|
|
127
|
-
* @returns {HTMLElement} append the cells to it
|
|
128
|
-
*/
|
|
129
|
-
export function generateGrid(options?: {
|
|
130
|
-
parent?: string | Element;
|
|
131
|
-
columns?: number;
|
|
132
|
-
gap?: string;
|
|
133
|
-
}): HTMLElement;
|
|
134
|
-
/**
|
|
135
|
-
* Adds a tooltip to an element. It shows on hover and on keyboard focus.
|
|
136
|
-
*
|
|
137
|
-
* @param {Element|string} target element or id
|
|
138
|
-
* @param {string} text
|
|
139
|
-
*/
|
|
140
|
-
export function generateTooltip(target: Element | string, text: string): HTMLElement;
|
|
141
|
-
/**
|
|
142
|
-
* The top of a page: breadcrumbs, the title (a heading), a description and the actions of the page.
|
|
143
|
-
*
|
|
144
|
-
* @param {object} options
|
|
145
|
-
* @param {string|Element} [options.parent]
|
|
146
|
-
* @param {string} options.title
|
|
147
|
-
* @param {string} [options.description]
|
|
148
|
-
* @param {{label: string, href?: string, onclick?: Function}[]} [options.breadcrumbs] see generateBreadcrumbs
|
|
149
|
-
* @param {(Node|string)[]|Node} [options.actions] buttons, shown at the end of the header
|
|
150
|
-
* @param {1|2|3} [options.level=1] heading level
|
|
151
|
-
* @returns {{element: HTMLElement, setTitle: Function, setDescription: Function, actions: HTMLElement}}
|
|
152
|
-
*/
|
|
153
|
-
export function generatePageHeader(options?: {
|
|
154
|
-
parent?: string | Element;
|
|
155
|
-
title: string;
|
|
156
|
-
description?: string;
|
|
157
|
-
breadcrumbs?: {
|
|
158
|
-
label: string;
|
|
159
|
-
href?: string;
|
|
160
|
-
onclick?: Function;
|
|
161
|
-
}[];
|
|
162
|
-
actions?: (Node | string)[] | Node;
|
|
163
|
-
level?: 1 | 2 | 3;
|
|
164
|
-
}): {
|
|
165
|
-
element: HTMLElement;
|
|
166
|
-
setTitle: Function;
|
|
167
|
-
setDescription: Function;
|
|
168
|
-
actions: HTMLElement;
|
|
169
|
-
};
|
|
170
|
-
/**
|
|
171
|
-
* A list of facts: a term and its description, in pairs (a <dl>).
|
|
172
|
-
*
|
|
173
|
-
* @param {object} options
|
|
174
|
-
* @param {string|Element} [options.parent]
|
|
175
|
-
* @param {{term: string, description: (string|number|Node|Array), title?: string}[]} options.items text is inserted as text
|
|
176
|
-
* @param {boolean} [options.inline=false] terms and descriptions side by side
|
|
177
|
-
* @returns {{element: HTMLElement, setItems: Function}}
|
|
178
|
-
*/
|
|
179
|
-
export function generateFacts(options?: {
|
|
180
|
-
parent?: string | Element;
|
|
181
|
-
items: {
|
|
182
|
-
term: string;
|
|
183
|
-
description: (string | number | Node | any[]);
|
|
184
|
-
title?: string;
|
|
185
|
-
}[];
|
|
186
|
-
inline?: boolean;
|
|
187
|
-
}): {
|
|
188
|
-
element: HTMLElement;
|
|
189
|
-
setItems: Function;
|
|
190
|
-
};
|
|
191
|
-
/**
|
|
192
|
-
* What a list shows when there is nothing in it: a title, a short explanation and what to do about it.
|
|
193
|
-
*
|
|
194
|
-
* @param {object} options
|
|
195
|
-
* @param {string|Element} [options.parent]
|
|
196
|
-
* @param {string} options.title
|
|
197
|
-
* @param {string} [options.message]
|
|
198
|
-
* @param {string|Node} [options.icon] decorative
|
|
199
|
-
* @param {{text: string, onclick: Function, variant?: string}} [options.action] a button
|
|
200
|
-
*/
|
|
201
|
-
export function generateEmptyState(options?: {
|
|
202
|
-
parent?: string | Element;
|
|
203
|
-
title: string;
|
|
204
|
-
message?: string;
|
|
205
|
-
icon?: string | Node;
|
|
206
|
-
action?: {
|
|
207
|
-
text: string;
|
|
208
|
-
onclick: Function;
|
|
209
|
-
variant?: string;
|
|
210
|
-
};
|
|
211
|
-
}): any;
|
|
212
|
-
/**
|
|
213
|
-
* A placeholder while something loads: a spinner and a text (a live region, so a screen reader says it).
|
|
214
|
-
*
|
|
215
|
-
* @param {object} [options]
|
|
216
|
-
* @param {string|Element} [options.parent]
|
|
217
|
-
* @param {string} [options.text] default: the translated "Loading..."
|
|
218
|
-
*/
|
|
219
|
-
export function generateLoading(options?: {
|
|
220
|
-
parent?: string | Element;
|
|
221
|
-
text?: string;
|
|
222
|
-
}): any;
|
|
1
|
+
/**
|
|
2
|
+
* Generates a link. External links open in a new tab and get `rel="noopener noreferrer"`.
|
|
3
|
+
* With `onclick` and no `href` it behaves as an in-page action.
|
|
4
|
+
*
|
|
5
|
+
* @param {object} options
|
|
6
|
+
* @param {string|Element} [options.parent]
|
|
7
|
+
* @param {string} options.text
|
|
8
|
+
* @param {string} [options.href]
|
|
9
|
+
* @param {boolean} [options.external]
|
|
10
|
+
* @param {(event: Event) => void} [options.onclick]
|
|
11
|
+
* @returns {HTMLAnchorElement}
|
|
12
|
+
*/
|
|
13
|
+
export function generateLink(options?: {
|
|
14
|
+
parent?: string | Element;
|
|
15
|
+
text: string;
|
|
16
|
+
href?: string;
|
|
17
|
+
external?: boolean;
|
|
18
|
+
onclick?: (event: Event) => void;
|
|
19
|
+
}): HTMLAnchorElement;
|
|
20
|
+
/**
|
|
21
|
+
* Generates a section with an optional heading. Returns the section, fill it through `content`
|
|
22
|
+
* or append to it.
|
|
23
|
+
*
|
|
24
|
+
* @param {object} options
|
|
25
|
+
* @param {string|Element} [options.parent]
|
|
26
|
+
* @param {string} [options.title]
|
|
27
|
+
* @param {number} [options.level=2] heading level 1..6
|
|
28
|
+
* @param {string|Node|Array|Function} [options.content]
|
|
29
|
+
* @returns {HTMLElement}
|
|
30
|
+
*/
|
|
31
|
+
export function generateSection(options?: {
|
|
32
|
+
parent?: string | Element;
|
|
33
|
+
title?: string;
|
|
34
|
+
level?: number;
|
|
35
|
+
content?: string | Node | any[] | Function;
|
|
36
|
+
}): HTMLElement;
|
|
37
|
+
/**
|
|
38
|
+
* Generates a card.
|
|
39
|
+
*
|
|
40
|
+
* @param {object} options
|
|
41
|
+
* @param {string|Element} [options.parent]
|
|
42
|
+
* @param {string} [options.title]
|
|
43
|
+
* @param {string} [options.image] image URL shown on top
|
|
44
|
+
* @param {string} [options.imageAlt]
|
|
45
|
+
* @param {string|Node|Array|Function} [options.content]
|
|
46
|
+
* @param {string|Node|Array|Function} [options.footer]
|
|
47
|
+
* @returns {{element: HTMLElement, body: HTMLElement}} append to `body` to add more content
|
|
48
|
+
*/
|
|
49
|
+
export function generateCard(options?: {
|
|
50
|
+
parent?: string | Element;
|
|
51
|
+
title?: string;
|
|
52
|
+
image?: string;
|
|
53
|
+
imageAlt?: string;
|
|
54
|
+
content?: string | Node | any[] | Function;
|
|
55
|
+
footer?: string | Node | any[] | Function;
|
|
56
|
+
}): {
|
|
57
|
+
element: HTMLElement;
|
|
58
|
+
body: HTMLElement;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Generates a small label.
|
|
62
|
+
*
|
|
63
|
+
* @param {object} options
|
|
64
|
+
* @param {string|Element} [options.parent]
|
|
65
|
+
* @param {string} options.text
|
|
66
|
+
* @param {"neutral"|"info"|"success"|"warning"|"error"} [options.variant="neutral"]
|
|
67
|
+
* @param {boolean} [options.pill]
|
|
68
|
+
* @returns {HTMLElement}
|
|
69
|
+
*/
|
|
70
|
+
export function generateBadge(options?: {
|
|
71
|
+
parent?: string | Element;
|
|
72
|
+
text: string;
|
|
73
|
+
variant?: "neutral" | "info" | "success" | "warning" | "error";
|
|
74
|
+
pill?: boolean;
|
|
75
|
+
}): HTMLElement;
|
|
76
|
+
export function initialsOf(name?: string): string;
|
|
77
|
+
/**
|
|
78
|
+
* Generates an avatar: the image, or the initials of the name when there is no (working) image.
|
|
79
|
+
*
|
|
80
|
+
* @param {object} options
|
|
81
|
+
* @param {string|Element} [options.parent]
|
|
82
|
+
* @param {string} [options.name]
|
|
83
|
+
* @param {string} [options.src]
|
|
84
|
+
* @param {"small"|"large"} [options.size]
|
|
85
|
+
* @returns {HTMLElement}
|
|
86
|
+
*/
|
|
87
|
+
export function generateAvatar(options?: {
|
|
88
|
+
parent?: string | Element;
|
|
89
|
+
name?: string;
|
|
90
|
+
src?: string;
|
|
91
|
+
size?: "small" | "large";
|
|
92
|
+
}): HTMLElement;
|
|
93
|
+
/**
|
|
94
|
+
* Generates a KPI tile: a label, a big value and an optional change.
|
|
95
|
+
*
|
|
96
|
+
* @param {object} options
|
|
97
|
+
* @param {string|Element} [options.parent]
|
|
98
|
+
* @param {string} options.label
|
|
99
|
+
* @param {string|number} options.value
|
|
100
|
+
* @param {number} [options.delta] change in percent, shown with an arrow
|
|
101
|
+
* @param {boolean} [options.invertDelta] a falling value is good news (costs, errors)
|
|
102
|
+
* @param {"ok"|"warn"|"bad"} [options.tone] colours the tile (the class is-ok / is-warn / is-bad) and adds the word to the screen reader text
|
|
103
|
+
* @param {string} [options.note] small text under the value ("of 120 hosts", "updated 2 min ago")
|
|
104
|
+
* @returns {{element: HTMLElement, setValue: Function, setNote: Function, setTone: Function}}
|
|
105
|
+
*/
|
|
106
|
+
export function generateStat(options?: {
|
|
107
|
+
parent?: string | Element;
|
|
108
|
+
label: string;
|
|
109
|
+
value: string | number;
|
|
110
|
+
delta?: number;
|
|
111
|
+
invertDelta?: boolean;
|
|
112
|
+
tone?: "ok" | "warn" | "bad";
|
|
113
|
+
note?: string;
|
|
114
|
+
}): {
|
|
115
|
+
element: HTMLElement;
|
|
116
|
+
setValue: Function;
|
|
117
|
+
setNote: Function;
|
|
118
|
+
setTone: Function;
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Generates a responsive grid. The columns collapse to one on small screens.
|
|
122
|
+
*
|
|
123
|
+
* @param {object} options
|
|
124
|
+
* @param {string|Element} [options.parent]
|
|
125
|
+
* @param {number} [options.columns=3]
|
|
126
|
+
* @param {string} [options.gap] any CSS length
|
|
127
|
+
* @returns {HTMLElement} append the cells to it
|
|
128
|
+
*/
|
|
129
|
+
export function generateGrid(options?: {
|
|
130
|
+
parent?: string | Element;
|
|
131
|
+
columns?: number;
|
|
132
|
+
gap?: string;
|
|
133
|
+
}): HTMLElement;
|
|
134
|
+
/**
|
|
135
|
+
* Adds a tooltip to an element. It shows on hover and on keyboard focus.
|
|
136
|
+
*
|
|
137
|
+
* @param {Element|string} target element or id
|
|
138
|
+
* @param {string} text
|
|
139
|
+
*/
|
|
140
|
+
export function generateTooltip(target: Element | string, text: string): HTMLElement;
|
|
141
|
+
/**
|
|
142
|
+
* The top of a page: breadcrumbs, the title (a heading), a description and the actions of the page.
|
|
143
|
+
*
|
|
144
|
+
* @param {object} options
|
|
145
|
+
* @param {string|Element} [options.parent]
|
|
146
|
+
* @param {string} options.title
|
|
147
|
+
* @param {string} [options.description]
|
|
148
|
+
* @param {{label: string, href?: string, onclick?: Function}[]} [options.breadcrumbs] see generateBreadcrumbs
|
|
149
|
+
* @param {(Node|string)[]|Node} [options.actions] buttons, shown at the end of the header
|
|
150
|
+
* @param {1|2|3} [options.level=1] heading level
|
|
151
|
+
* @returns {{element: HTMLElement, setTitle: Function, setDescription: Function, actions: HTMLElement}}
|
|
152
|
+
*/
|
|
153
|
+
export function generatePageHeader(options?: {
|
|
154
|
+
parent?: string | Element;
|
|
155
|
+
title: string;
|
|
156
|
+
description?: string;
|
|
157
|
+
breadcrumbs?: {
|
|
158
|
+
label: string;
|
|
159
|
+
href?: string;
|
|
160
|
+
onclick?: Function;
|
|
161
|
+
}[];
|
|
162
|
+
actions?: (Node | string)[] | Node;
|
|
163
|
+
level?: 1 | 2 | 3;
|
|
164
|
+
}): {
|
|
165
|
+
element: HTMLElement;
|
|
166
|
+
setTitle: Function;
|
|
167
|
+
setDescription: Function;
|
|
168
|
+
actions: HTMLElement;
|
|
169
|
+
};
|
|
170
|
+
/**
|
|
171
|
+
* A list of facts: a term and its description, in pairs (a <dl>).
|
|
172
|
+
*
|
|
173
|
+
* @param {object} options
|
|
174
|
+
* @param {string|Element} [options.parent]
|
|
175
|
+
* @param {{term: string, description: (string|number|Node|Array), title?: string}[]} options.items text is inserted as text
|
|
176
|
+
* @param {boolean} [options.inline=false] terms and descriptions side by side
|
|
177
|
+
* @returns {{element: HTMLElement, setItems: Function}}
|
|
178
|
+
*/
|
|
179
|
+
export function generateFacts(options?: {
|
|
180
|
+
parent?: string | Element;
|
|
181
|
+
items: {
|
|
182
|
+
term: string;
|
|
183
|
+
description: (string | number | Node | any[]);
|
|
184
|
+
title?: string;
|
|
185
|
+
}[];
|
|
186
|
+
inline?: boolean;
|
|
187
|
+
}): {
|
|
188
|
+
element: HTMLElement;
|
|
189
|
+
setItems: Function;
|
|
190
|
+
};
|
|
191
|
+
/**
|
|
192
|
+
* What a list shows when there is nothing in it: a title, a short explanation and what to do about it.
|
|
193
|
+
*
|
|
194
|
+
* @param {object} options
|
|
195
|
+
* @param {string|Element} [options.parent]
|
|
196
|
+
* @param {string} options.title
|
|
197
|
+
* @param {string} [options.message]
|
|
198
|
+
* @param {string|Node} [options.icon] decorative
|
|
199
|
+
* @param {{text: string, onclick: Function, variant?: string}} [options.action] a button
|
|
200
|
+
*/
|
|
201
|
+
export function generateEmptyState(options?: {
|
|
202
|
+
parent?: string | Element;
|
|
203
|
+
title: string;
|
|
204
|
+
message?: string;
|
|
205
|
+
icon?: string | Node;
|
|
206
|
+
action?: {
|
|
207
|
+
text: string;
|
|
208
|
+
onclick: Function;
|
|
209
|
+
variant?: string;
|
|
210
|
+
};
|
|
211
|
+
}): any;
|
|
212
|
+
/**
|
|
213
|
+
* A placeholder while something loads: a spinner and a text (a live region, so a screen reader says it).
|
|
214
|
+
*
|
|
215
|
+
* @param {object} [options]
|
|
216
|
+
* @param {string|Element} [options.parent]
|
|
217
|
+
* @param {string} [options.text] default: the translated "Loading..."
|
|
218
|
+
*/
|
|
219
|
+
export function generateLoading(options?: {
|
|
220
|
+
parent?: string | Element;
|
|
221
|
+
text?: string;
|
|
222
|
+
}): any;
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generates the appearance picker of an account page: a group of themes with a small preview of each, and a group of modes.
|
|
3
|
-
* The preview is drawn with the colours of the theme itself: the stylesheet of a theme applies to any element that has the
|
|
4
|
-
* attributes data-theme and data-mode, not only to <html>.
|
|
5
|
-
*
|
|
6
|
-
* @param {object} options
|
|
7
|
-
* @param {string|Element} [options.parent]
|
|
8
|
-
* @param {ReturnType<import("../../core/theme.js").createThemeManager>} options.manager
|
|
9
|
-
* @param {string} [options.themeLabel] legend of the theme group (default: translated "Theme")
|
|
10
|
-
* @param {string} [options.modeLabel] legend of the mode group (default: translated "Mode")
|
|
11
|
-
* @param {string} [options.class]
|
|
12
|
-
* @returns {{element: HTMLElement, update: Function, destroy: Function}}
|
|
13
|
-
*/
|
|
14
|
-
export function generateThemePicker(options?: {
|
|
15
|
-
parent?: string | Element;
|
|
16
|
-
manager: ReturnType<typeof import("../../core/theme.js").createThemeManager>;
|
|
17
|
-
themeLabel?: string;
|
|
18
|
-
modeLabel?: string;
|
|
19
|
-
class?: string;
|
|
20
|
-
}): {
|
|
21
|
-
element: HTMLElement;
|
|
22
|
-
update: Function;
|
|
23
|
-
destroy: Function;
|
|
24
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* Generates the appearance picker of an account page: a group of themes with a small preview of each, and a group of modes.
|
|
3
|
+
* The preview is drawn with the colours of the theme itself: the stylesheet of a theme applies to any element that has the
|
|
4
|
+
* attributes data-theme and data-mode, not only to <html>.
|
|
5
|
+
*
|
|
6
|
+
* @param {object} options
|
|
7
|
+
* @param {string|Element} [options.parent]
|
|
8
|
+
* @param {ReturnType<import("../../core/theme.js").createThemeManager>} options.manager
|
|
9
|
+
* @param {string} [options.themeLabel] legend of the theme group (default: translated "Theme")
|
|
10
|
+
* @param {string} [options.modeLabel] legend of the mode group (default: translated "Mode")
|
|
11
|
+
* @param {string} [options.class]
|
|
12
|
+
* @returns {{element: HTMLElement, update: Function, destroy: Function}}
|
|
13
|
+
*/
|
|
14
|
+
export function generateThemePicker(options?: {
|
|
15
|
+
parent?: string | Element;
|
|
16
|
+
manager: ReturnType<typeof import("../../core/theme.js").createThemeManager>;
|
|
17
|
+
themeLabel?: string;
|
|
18
|
+
modeLabel?: string;
|
|
19
|
+
class?: string;
|
|
20
|
+
}): {
|
|
21
|
+
element: HTMLElement;
|
|
22
|
+
update: Function;
|
|
23
|
+
destroy: Function;
|
|
24
|
+
};
|