athena-ui-js 2.5.0 → 2.6.0
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 +1158 -1122
- package/docs/migration-2.0.md +99 -83
- package/docs/styling.md +124 -123
- package/package.json +176 -189
- package/src/app.js +85 -0
- package/src/athena-ui.js +60 -135
- package/src/libs/config/config.js +66 -66
- package/src/libs/core/i18n.js +354 -352
- package/src/libs/hephaestus/MenuGenerator/menuGenerator.js +278 -265
- package/src/libs/hephaestus/chartGenerator/chartGenerator.js +772 -722
- package/src/libs/hephaestus/feedbackGenerator/feedbackGenerator.js +171 -161
- package/src/libs/hephaestus/formGenerator/formBuilder.js +470 -460
- package/src/libs/hephaestus/tableGenerator/tableGenerator.js +837 -825
- package/src/res/themes/default/style.css +3128 -3037
- package/types/app.d.ts +58 -0
- package/types/athena-ui.d.ts +1 -55
- package/types/libs/config/config.d.ts +96 -96
- package/types/libs/hephaestus/MenuGenerator/menuGenerator.d.ts +5 -0
- package/types/libs/hephaestus/chartGenerator/chartGenerator.d.ts +123 -117
- package/types/libs/hephaestus/dialogGenerator/dialogGenerator.d.ts +122 -122
- package/types/libs/hephaestus/feedbackGenerator/feedbackGenerator.d.ts +3 -0
- package/types/libs/hephaestus/formGenerator/authForms.d.ts +130 -130
- package/types/libs/hephaestus/formGenerator/formBuilder.d.ts +128 -128
- package/types/libs/hephaestus/tableGenerator/tableGenerator.d.ts +133 -129
package/src/athena-ui.js
CHANGED
|
@@ -1,135 +1,60 @@
|
|
|
1
|
-
//Athena UI
|
|
2
|
-
//Author: Csaba Tóth https://github.com/csabatibortoth/
|
|
3
|
-
//LICENCE: MIT
|
|
4
|
-
//Repository: https://github.com/csabatibortoth/athena-ui
|
|
5
|
-
//Version: 2.
|
|
6
|
-
|
|
7
|
-
// The whole API as ES module exports. There are no side effects: importing this file does not touch the page, does not load a script and does not
|
|
8
|
-
// put anything on globalThis. For pages that need globals use `athena-ui-js/classic`, and to download only what you use import from the entry points
|
|
9
|
-
// (`athena-ui-js/table`, `athena-ui-js/dialog`, ...).
|
|
10
|
-
|
|
11
|
-
import config
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
|
|
32
|
-
export
|
|
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
|
-
export
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
if (!root.id) root.id = uid("athena-app");
|
|
62
|
-
setLayoutRoot(root.id);
|
|
63
|
-
let effective;
|
|
64
|
-
try {
|
|
65
|
-
effective = await init(options);
|
|
66
|
-
} finally {
|
|
67
|
-
setLayoutRoot("");
|
|
68
|
-
}
|
|
69
|
-
return asHandle({
|
|
70
|
-
element: root,
|
|
71
|
-
container: document.getElementById("container"),
|
|
72
|
-
header: document.getElementById("header"),
|
|
73
|
-
wrapper: document.getElementById("wrapper"),
|
|
74
|
-
footer: document.getElementById("footer"),
|
|
75
|
-
config: effective,
|
|
76
|
-
destroy() {
|
|
77
|
-
document.getElementById("container")?.remove();
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Switches the theme at runtime: { id } of a registered theme or { href } of a stylesheet.
|
|
84
|
-
* @returns {Promise<object>} the applied theme
|
|
85
|
-
*/
|
|
86
|
-
export function setTheme(selected) {
|
|
87
|
-
return loadTheme(selected);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export { config, loadScript };
|
|
91
|
-
export { default as Cookies } from "./libs/core/cookies.js";
|
|
92
|
-
export * from "./libs/core/elementGenerator.js";
|
|
93
|
-
export * from "./libs/core/controls.js";
|
|
94
|
-
export * from "./libs/core/hungarianControls.js";
|
|
95
|
-
export * from "./libs/hephaestus/LayoutGenerator/basicLayoutGenerator.js";
|
|
96
|
-
export * from "./libs/hephaestus/LayoutGenerator/headerContentGenerator.js";
|
|
97
|
-
export * from "./libs/hephaestus/LayoutGenerator/wrapperContentGenerator.js";
|
|
98
|
-
export * from "./libs/hephaestus/LayoutGenerator/footerContentGenerator.js";
|
|
99
|
-
export * from "./libs/hephaestus/MenuGenerator/basicMenuGenerator.js";
|
|
100
|
-
export * from "./libs/hephaestus/MenuGenerator/menuGenerator.js";
|
|
101
|
-
export * from "./libs/hephaestus/formGenerator/loginFormGenerator.js";
|
|
102
|
-
export * from "./libs/hephaestus/formGenerator/registrationFormGenerator.js";
|
|
103
|
-
export * from "./libs/hephaestus/formGenerator/lostPasswordFormGenerator.js";
|
|
104
|
-
export * from "./libs/hephaestus/chartGenerator/chartGenerator.js";
|
|
105
|
-
export * from "./libs/hephaestus/tableGenerator/tableGenerator.js";
|
|
106
|
-
export * from "./libs/hephaestus/formGenerator/changePasswordFormGenerator.js";
|
|
107
|
-
export * from "./libs/hephaestus/formGenerator/formBuilder.js";
|
|
108
|
-
export * from "./libs/hephaestus/formGenerator/authForms.js";
|
|
109
|
-
export * from "./libs/hephaestus/feedbackGenerator/feedbackGenerator.js";
|
|
110
|
-
export * from "./libs/hephaestus/dialogGenerator/dialogGenerator.js";
|
|
111
|
-
export * from "./libs/hephaestus/navigationGenerator/navigationGenerator.js";
|
|
112
|
-
export * from "./libs/hephaestus/componentGenerator/componentGenerator.js";
|
|
113
|
-
export * from "./libs/hephaestus/inputGenerator/inputGenerator.js";
|
|
114
|
-
export * from "./libs/hephaestus/inputGenerator/dropZoneGenerator.js";
|
|
115
|
-
export * from "./libs/hephaestus/inputGenerator/richTextGenerator.js";
|
|
116
|
-
export { el, setContent, resolveElement, asHandle, createSafeBuilder } from "./libs/core/dom.js";
|
|
117
|
-
export * from "./libs/core/sanitize.js";
|
|
118
|
-
export * from "./libs/hephaestus/router/router.js";
|
|
119
|
-
export * from "./libs/hephaestus/auth/session.js";
|
|
120
|
-
export * from "./libs/hephaestus/auth/authState.js";
|
|
121
|
-
export * from "./libs/core/i18n.js";
|
|
122
|
-
export * from "./libs/core/validation.js";
|
|
123
|
-
export * from "./libs/core/csv.js";
|
|
124
|
-
export * from "./libs/core/dateRange.js";
|
|
125
|
-
export * from "./libs/core/format.js";
|
|
126
|
-
export * from "./libs/core/motion.js";
|
|
127
|
-
export * from "./libs/hephaestus/widgetGrid/widgetGrid.js";
|
|
128
|
-
export * from "./libs/core/gridLayout.js";
|
|
129
|
-
export * from "./libs/hephaestus/codeGenerator/codeGenerator.js";
|
|
130
|
-
export * from "./libs/hephaestus/codeGenerator/codeEditor.js";
|
|
131
|
-
export * from "./libs/core/codeLanguages.js";
|
|
132
|
-
export * from "./libs/core/codeDiff.js";
|
|
133
|
-
export * from "./libs/hephaestus/modalGenerator/modalGenerator.js";
|
|
134
|
-
export * from "./libs/core/theme.js";
|
|
135
|
-
export * from "./libs/hephaestus/componentGenerator/themePicker.js";
|
|
1
|
+
//Athena UI
|
|
2
|
+
//Author: Csaba Tóth https://github.com/csabatibortoth/
|
|
3
|
+
//LICENCE: MIT
|
|
4
|
+
//Repository: https://github.com/csabatibortoth/athena-ui
|
|
5
|
+
//Version: 2.6.0
|
|
6
|
+
|
|
7
|
+
// The whole API as ES module exports. There are no side effects: importing this file does not touch the page, does not load a script and does not
|
|
8
|
+
// put anything on globalThis. For pages that need globals use `athena-ui-js/classic`, and to download only what you use import from the entry points
|
|
9
|
+
// (`athena-ui-js/table`, `athena-ui-js/dialog`, ...).
|
|
10
|
+
|
|
11
|
+
import config from "./libs/config/config.js";
|
|
12
|
+
import { loadScript } from "./libs/hephaestus/hephaestus.js";
|
|
13
|
+
|
|
14
|
+
export { init, createApp, setTheme } from "./app.js";
|
|
15
|
+
export { config, loadScript };
|
|
16
|
+
export { default as Cookies } from "./libs/core/cookies.js";
|
|
17
|
+
export * from "./libs/core/elementGenerator.js";
|
|
18
|
+
export * from "./libs/core/controls.js";
|
|
19
|
+
export * from "./libs/core/hungarianControls.js";
|
|
20
|
+
export * from "./libs/hephaestus/LayoutGenerator/basicLayoutGenerator.js";
|
|
21
|
+
export * from "./libs/hephaestus/LayoutGenerator/headerContentGenerator.js";
|
|
22
|
+
export * from "./libs/hephaestus/LayoutGenerator/wrapperContentGenerator.js";
|
|
23
|
+
export * from "./libs/hephaestus/LayoutGenerator/footerContentGenerator.js";
|
|
24
|
+
export * from "./libs/hephaestus/MenuGenerator/basicMenuGenerator.js";
|
|
25
|
+
export * from "./libs/hephaestus/MenuGenerator/menuGenerator.js";
|
|
26
|
+
export * from "./libs/hephaestus/formGenerator/loginFormGenerator.js";
|
|
27
|
+
export * from "./libs/hephaestus/formGenerator/registrationFormGenerator.js";
|
|
28
|
+
export * from "./libs/hephaestus/formGenerator/lostPasswordFormGenerator.js";
|
|
29
|
+
export * from "./libs/hephaestus/chartGenerator/chartGenerator.js";
|
|
30
|
+
export * from "./libs/hephaestus/tableGenerator/tableGenerator.js";
|
|
31
|
+
export * from "./libs/hephaestus/formGenerator/changePasswordFormGenerator.js";
|
|
32
|
+
export * from "./libs/hephaestus/formGenerator/formBuilder.js";
|
|
33
|
+
export * from "./libs/hephaestus/formGenerator/authForms.js";
|
|
34
|
+
export * from "./libs/hephaestus/feedbackGenerator/feedbackGenerator.js";
|
|
35
|
+
export * from "./libs/hephaestus/dialogGenerator/dialogGenerator.js";
|
|
36
|
+
export * from "./libs/hephaestus/navigationGenerator/navigationGenerator.js";
|
|
37
|
+
export * from "./libs/hephaestus/componentGenerator/componentGenerator.js";
|
|
38
|
+
export * from "./libs/hephaestus/inputGenerator/inputGenerator.js";
|
|
39
|
+
export * from "./libs/hephaestus/inputGenerator/dropZoneGenerator.js";
|
|
40
|
+
export * from "./libs/hephaestus/inputGenerator/richTextGenerator.js";
|
|
41
|
+
export { el, setContent, resolveElement, asHandle, createSafeBuilder } from "./libs/core/dom.js";
|
|
42
|
+
export * from "./libs/core/sanitize.js";
|
|
43
|
+
export * from "./libs/hephaestus/router/router.js";
|
|
44
|
+
export * from "./libs/hephaestus/auth/session.js";
|
|
45
|
+
export * from "./libs/hephaestus/auth/authState.js";
|
|
46
|
+
export * from "./libs/core/i18n.js";
|
|
47
|
+
export * from "./libs/core/validation.js";
|
|
48
|
+
export * from "./libs/core/csv.js";
|
|
49
|
+
export * from "./libs/core/dateRange.js";
|
|
50
|
+
export * from "./libs/core/format.js";
|
|
51
|
+
export * from "./libs/core/motion.js";
|
|
52
|
+
export * from "./libs/hephaestus/widgetGrid/widgetGrid.js";
|
|
53
|
+
export * from "./libs/core/gridLayout.js";
|
|
54
|
+
export * from "./libs/hephaestus/codeGenerator/codeGenerator.js";
|
|
55
|
+
export * from "./libs/hephaestus/codeGenerator/codeEditor.js";
|
|
56
|
+
export * from "./libs/core/codeLanguages.js";
|
|
57
|
+
export * from "./libs/core/codeDiff.js";
|
|
58
|
+
export * from "./libs/hephaestus/modalGenerator/modalGenerator.js";
|
|
59
|
+
export * from "./libs/core/theme.js";
|
|
60
|
+
export * from "./libs/hephaestus/componentGenerator/themePicker.js";
|
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
//config for Athena UI
|
|
2
|
-
//Author: Csaba Tóth https://github.com/csabatibortoth/
|
|
3
|
-
//LICENCE: MIT
|
|
4
|
-
//Repository: https://github.com/csabatibortoth/athena-ui
|
|
5
|
-
|
|
6
|
-
export const BORDERED_CLASS = "default-cointainer-bordered";
|
|
7
|
-
|
|
8
|
-
export const defaults = Object.freeze({
|
|
9
|
-
version: "2.
|
|
10
|
-
container_class: "container",
|
|
11
|
-
header_class: "header-container",
|
|
12
|
-
header_menu_class: "header-menu menu",
|
|
13
|
-
wrapper_class: "wrapper-container",
|
|
14
|
-
footer_class: "footer-container",
|
|
15
|
-
footer_menu_class: "footer-menu menu",
|
|
16
|
-
loginForm_class: "login-form form",
|
|
17
|
-
registrationForm_class: "registration-form form",
|
|
18
|
-
lostPasswordForm_class: "lost-password-form form",
|
|
19
|
-
changePasswordForm_class: "change-password-form form",
|
|
20
|
-
|
|
21
|
-
bordered: true,
|
|
22
|
-
generateHeader: true,
|
|
23
|
-
generateFooter: true,
|
|
24
|
-
generateHeadercontent: true,
|
|
25
|
-
generateFooterContent: true,
|
|
26
|
-
generateWrappercontent: true,
|
|
27
|
-
login_enabled: false,
|
|
28
|
-
registration_enabled: false,
|
|
29
|
-
lost_password_enabled: false,
|
|
30
|
-
change_password_enabled: false,
|
|
31
|
-
login_remember_me: false,
|
|
32
|
-
|
|
33
|
-
header_title_text: "Athena UI",
|
|
34
|
-
header_img_url: undefined,
|
|
35
|
-
copyright: "Here is the bottom Copyright Text for website",
|
|
36
|
-
|
|
37
|
-
// Language of the generated texts, see core/i18n.js
|
|
38
|
-
locale: "en",
|
|
39
|
-
|
|
40
|
-
// Cookie that keeps the session, and the lifetime (days) of a remembered session
|
|
41
|
-
session_cookie: "athena_session",
|
|
42
|
-
session_days: 7,
|
|
43
|
-
|
|
44
|
-
// URL (relative to the page) of an extra classic script, loaded before the layout is generated
|
|
45
|
-
customLoader: undefined
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
const config = { ...defaults };
|
|
49
|
-
|
|
50
|
-
export default config;
|
|
51
|
-
|
|
52
|
-
// Copies every known setting that is defined in the given sources onto the live config.
|
|
53
|
-
export function applyConfig(...sources) {
|
|
54
|
-
for (const source of sources) {
|
|
55
|
-
if (!source) continue;
|
|
56
|
-
for (const key of Object.keys(defaults)) {
|
|
57
|
-
if (source[key] !== undefined) config[key] = source[key];
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
return config;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// Appends the border class to a class list when borders are enabled.
|
|
64
|
-
export function withBorder(className) {
|
|
65
|
-
return config.bordered ? `${className} ${BORDERED_CLASS}` : className;
|
|
66
|
-
}
|
|
1
|
+
//config for Athena UI
|
|
2
|
+
//Author: Csaba Tóth https://github.com/csabatibortoth/
|
|
3
|
+
//LICENCE: MIT
|
|
4
|
+
//Repository: https://github.com/csabatibortoth/athena-ui
|
|
5
|
+
|
|
6
|
+
export const BORDERED_CLASS = "default-cointainer-bordered";
|
|
7
|
+
|
|
8
|
+
export const defaults = Object.freeze({
|
|
9
|
+
version: "2.6.0",
|
|
10
|
+
container_class: "container",
|
|
11
|
+
header_class: "header-container",
|
|
12
|
+
header_menu_class: "header-menu menu",
|
|
13
|
+
wrapper_class: "wrapper-container",
|
|
14
|
+
footer_class: "footer-container",
|
|
15
|
+
footer_menu_class: "footer-menu menu",
|
|
16
|
+
loginForm_class: "login-form form",
|
|
17
|
+
registrationForm_class: "registration-form form",
|
|
18
|
+
lostPasswordForm_class: "lost-password-form form",
|
|
19
|
+
changePasswordForm_class: "change-password-form form",
|
|
20
|
+
|
|
21
|
+
bordered: true,
|
|
22
|
+
generateHeader: true,
|
|
23
|
+
generateFooter: true,
|
|
24
|
+
generateHeadercontent: true,
|
|
25
|
+
generateFooterContent: true,
|
|
26
|
+
generateWrappercontent: true,
|
|
27
|
+
login_enabled: false,
|
|
28
|
+
registration_enabled: false,
|
|
29
|
+
lost_password_enabled: false,
|
|
30
|
+
change_password_enabled: false,
|
|
31
|
+
login_remember_me: false,
|
|
32
|
+
|
|
33
|
+
header_title_text: "Athena UI",
|
|
34
|
+
header_img_url: undefined,
|
|
35
|
+
copyright: "Here is the bottom Copyright Text for website",
|
|
36
|
+
|
|
37
|
+
// Language of the generated texts, see core/i18n.js
|
|
38
|
+
locale: "en",
|
|
39
|
+
|
|
40
|
+
// Cookie that keeps the session, and the lifetime (days) of a remembered session
|
|
41
|
+
session_cookie: "athena_session",
|
|
42
|
+
session_days: 7,
|
|
43
|
+
|
|
44
|
+
// URL (relative to the page) of an extra classic script, loaded before the layout is generated
|
|
45
|
+
customLoader: undefined
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const config = { ...defaults };
|
|
49
|
+
|
|
50
|
+
export default config;
|
|
51
|
+
|
|
52
|
+
// Copies every known setting that is defined in the given sources onto the live config.
|
|
53
|
+
export function applyConfig(...sources) {
|
|
54
|
+
for (const source of sources) {
|
|
55
|
+
if (!source) continue;
|
|
56
|
+
for (const key of Object.keys(defaults)) {
|
|
57
|
+
if (source[key] !== undefined) config[key] = source[key];
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return config;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Appends the border class to a class list when borders are enabled.
|
|
64
|
+
export function withBorder(className) {
|
|
65
|
+
return config.bordered ? `${className} ${BORDERED_CLASS}` : className;
|
|
66
|
+
}
|